diff --git a/AllOpenSSLHeaders.pas b/AllOpenSSLHeaders.pas new file mode 100644 index 0000000..609524a --- /dev/null +++ b/AllOpenSSLHeaders.pas @@ -0,0 +1,87 @@ +Unit AllOpenSSLHeaders; + +interface + +uses + + IdOpenSSLHeaders_aes, + IdOpenSSLHeaders_asn1err, + IdOpenSSLHeaders_asn1, + IdOpenSSLHeaders_asn1_mac, + IdOpenSSLHeaders_asn1t, + IdOpenSSLHeaders_asyncerr, + IdOpenSSLHeaders_async, + IdOpenSSLHeaders_bioerr, + IdOpenSSLHeaders_bio, + IdOpenSSLHeaders_blowfish, + IdOpenSSLHeaders_bnerr, + IdOpenSSLHeaders_bn, + IdOpenSSLHeaders_buffererr, + IdOpenSSLHeaders_buffer, + IdOpenSSLHeaders_camellia, + IdOpenSSLHeaders_cast, + IdOpenSSLHeaders_cmac, + IdOpenSSLHeaders_cmserr, + IdOpenSSLHeaders_cms, + IdOpenSSLHeaders_comperr, + IdOpenSSLHeaders_comp, + IdOpenSSLHeaders_conf_api, + IdOpenSSLHeaders_conferr, + IdOpenSSLHeaders_conf, + IdOpenSSLHeaders_core, + IdOpenSSLHeaders_cryptoerr, + IdOpenSSLHeaders_crypto, + IdOpenSSLHeaders_cterr, + IdOpenSSLHeaders_des, + IdOpenSSLHeaders_dherr, + IdOpenSSLHeaders_dh, + IdOpenSSLHeaders_dsaerr, + IdOpenSSLHeaders_dsa, + IdOpenSSLHeaders_ebcdic, + IdOpenSSLHeaders_ecerr, + IdOpenSSLHeaders_ec, + IdOpenSSLHeaders_engineerr, + IdOpenSSLHeaders_engine, + IdOpenSSLHeaders_err, + IdOpenSSLHeaders_evperr, + IdOpenSSLHeaders_evp, + IdOpenSSLHeaders_hmac, + IdOpenSSLHeaders_idea, + IdOpenSSLHeaders_kdferr, + IdOpenSSLHeaders_objectserr, + IdOpenSSLHeaders_objects, + IdOpenSSLHeaders_obj_mac, + IdOpenSSLHeaders_ocsperr, + IdOpenSSLHeaders_ossl_typ, + IdOpenSSLHeaders_pemerr, + IdOpenSSLHeaders_pem, + IdOpenSSLHeaders_pkcs12, + IdOpenSSLHeaders_pkcs7err, + IdOpenSSLHeaders_pkcs7, + IdOpenSSLHeaders_provider, + IdOpenSSLHeaders_randerr, + IdOpenSSLHeaders_rand, + IdOpenSSLHeaders_rc4, + IdOpenSSLHeaders_rsaerr, + IdOpenSSLHeaders_rsa, + IdOpenSSLHeaders_sha, + IdOpenSSLHeaders_srtp, + IdOpenSSLHeaders_ssl3, + IdOpenSSLHeaders_sslerr, + IdOpenSSLHeaders_ssl, + IdOpenSSLHeaders_stack, + IdOpenSSLHeaders_storeerr, + IdOpenSSLHeaders_tls1, + IdOpenSSLHeaders_tserr, + IdOpenSSLHeaders_ts, + IdOpenSSLHeaders_txt_db, + IdOpenSSLHeaders_uierr, + IdOpenSSLHeaders_ui, + IdOpenSSLHeaders_whrlpool, + IdOpenSSLHeaders_x509err, + IdOpenSSLHeaders_x509, + IdOpenSSLHeaders_x509v3, + IdOpenSSLHeaders_x509_vfy ; + +implementation +end. diff --git a/IdAllOpenSSLHeaders.pas b/IdAllOpenSSLHeaders.pas new file mode 100644 index 0000000..8b1a8bd --- /dev/null +++ b/IdAllOpenSSLHeaders.pas @@ -0,0 +1,86 @@ +Unit IdAllOpenSSLHeaders; + +interface + +uses + IdOpenSSLHeaders_aes, + IdOpenSSLHeaders_asn1err, + IdOpenSSLHeaders_asn1, + IdOpenSSLHeaders_asn1_mac, + IdOpenSSLHeaders_asn1t, + IdOpenSSLHeaders_asyncerr, + IdOpenSSLHeaders_async, + IdOpenSSLHeaders_bioerr, + IdOpenSSLHeaders_bio, + IdOpenSSLHeaders_blowfish, + IdOpenSSLHeaders_bnerr, + IdOpenSSLHeaders_bn, + IdOpenSSLHeaders_buffererr, + IdOpenSSLHeaders_buffer, + IdOpenSSLHeaders_camellia, + IdOpenSSLHeaders_cast, + IdOpenSSLHeaders_cmac, + IdOpenSSLHeaders_cmserr, + IdOpenSSLHeaders_cms, + IdOpenSSLHeaders_comperr, + IdOpenSSLHeaders_comp, + IdOpenSSLHeaders_conf_api, + IdOpenSSLHeaders_conferr, + IdOpenSSLHeaders_conf, + IdOpenSSLHeaders_core, + IdOpenSSLHeaders_cryptoerr, + IdOpenSSLHeaders_crypto, + IdOpenSSLHeaders_cterr, + IdOpenSSLHeaders_des, + IdOpenSSLHeaders_dherr, + IdOpenSSLHeaders_dh, + IdOpenSSLHeaders_dsaerr, + IdOpenSSLHeaders_dsa, + IdOpenSSLHeaders_ebcdic, + IdOpenSSLHeaders_ecerr, + IdOpenSSLHeaders_ec, + IdOpenSSLHeaders_engineerr, + IdOpenSSLHeaders_engine, + IdOpenSSLHeaders_err, + IdOpenSSLHeaders_evperr, + IdOpenSSLHeaders_evp, + IdOpenSSLHeaders_hmac, + IdOpenSSLHeaders_idea, + IdOpenSSLHeaders_kdferr, + IdOpenSSLHeaders_objectserr, + IdOpenSSLHeaders_objects, + IdOpenSSLHeaders_obj_mac, + IdOpenSSLHeaders_ocsperr, + IdOpenSSLHeaders_ossl_typ, + IdOpenSSLHeaders_pemerr, + IdOpenSSLHeaders_pem, + IdOpenSSLHeaders_pkcs12, + IdOpenSSLHeaders_pkcs7err, + IdOpenSSLHeaders_pkcs7, + IdOpenSSLHeaders_provider, + IdOpenSSLHeaders_randerr, + IdOpenSSLHeaders_rand, + IdOpenSSLHeaders_rc4, + IdOpenSSLHeaders_rsaerr, + IdOpenSSLHeaders_rsa, + IdOpenSSLHeaders_sha, + IdOpenSSLHeaders_srtp, + IdOpenSSLHeaders_ssl3, + IdOpenSSLHeaders_sslerr, + IdOpenSSLHeaders_ssl, + IdOpenSSLHeaders_stack, + IdOpenSSLHeaders_storeerr, + IdOpenSSLHeaders_tls1, + IdOpenSSLHeaders_tserr, + IdOpenSSLHeaders_ts, + IdOpenSSLHeaders_txt_db, + IdOpenSSLHeaders_uierr, + IdOpenSSLHeaders_ui, + IdOpenSSLHeaders_whrlpool, + IdOpenSSLHeaders_x509err, + IdOpenSSLHeaders_x509, + IdOpenSSLHeaders_x509v3, + IdOpenSSLHeaders_x509_vfy ; + +implementation +end. diff --git a/IdCompilerDefines.inc b/IdCompilerDefines.inc index cc1bdd8..bd0c592 100644 --- a/IdCompilerDefines.inc +++ b/IdCompilerDefines.inc @@ -1,1154 +1,1154 @@ -{$IFDEF CONDITIONALEXPRESSIONS} - // Must be at the top... - {$IF CompilerVersion >= 24.0} - {$LEGACYIFEND ON} - {$IFEND} -{$ENDIF} - -// General - -// Make this $DEFINE to use the 16 color icons required by Borland -// or DEFINE to use the 256 color Indy versions -{.$DEFINE Borland} - -// When generating C++Builder output files, certain workarounds to compiler -// problems need to be enabled! When invoking DCC on the command-line, use -// the -DBCB parameter. When invoking MSBUILD, include the DCC_Define="BCB" -// attribute in the /p parameter. -{$IFDEF BCB} - {$DEFINE CBUILDER} -{$ELSE} - {$DEFINE DELPHI} -{$ENDIF} - -{$UNDEF STATICLOAD_OPENSSL} - -// Make sure the following are $DEFINE'd only for Delphi/C++Builder 2009 onwards -// as specified further below. The VCL is fully Unicode, where the 'String' -// type maps to System.UnicodeString, not System.AnsiString anymore -{$UNDEF STRING_IS_UNICODE} -{$UNDEF STRING_IS_ANSI} - -// Make sure the following are $DEFINE'd only for suitable environments -// as specified further below. Delphi/C++Builder Mobile/NextGen compilers -// do not support Ansi data types anymore, and is moving away from raw -// pointers as well. -// -// UPDATE: in Delphi/C++Builder 10.4, all Ansi types are supported again on -// all platforms, including the mobile compilers. -{$DEFINE HAS_PAnsiChar} -{$UNDEF NO_ANSI_TYPES} - -// Make sure the following are $DEFINE'd only for suitable environments -// as specified further below. Delphi/C++Builder Mobile/NextGen compilers -// use ARC for TObject life time management. -// -// UPDATE: ARC for TObject lifetime management has been removed in -// Delphi/C++Builder 10.4 mobile compilers. All platforms now use a single -// unified memory management model! -{$UNDEF USE_MARSHALLED_PTRS} -{$UNDEF USE_OBJECT_ARC} - -//Define for Delphi cross-compiler targetting Posix -{$UNDEF USE_VCL_POSIX} - -// detect compiler versions - -{$IFNDEF FPC} - - // TODO: to detect features in Delphi/C++Builder v6 and later, use CompilerVersion - // and RTLVersion constants instead of VERXXX defines. We still support v5, which - // does not have such constants. - - // Delphi 4 - {$IFDEF VER120} - {$DEFINE DCC} - {$DEFINE VCL_40} - {$DEFINE DELPHI_4} - {$ENDIF} - - // C++Builder 4 - {$IFDEF VER125} - {$DEFINE DCC} - {$DEFINE VCL_40} - {$DEFINE CBUILDER_4} - {$ENDIF} - - // Delphi & C++Builder 5 - {$IFDEF VER130} - {$DEFINE DCC} - {$DEFINE VCL_50} - {$IFDEF CBUILDER} - {$DEFINE CBUILDER_5} - {$ELSE} - {$DEFINE DELPHI_5} - {$ENDIF} - {$ENDIF} - - //Delphi & C++Builder 6 - {$IFDEF VER140} - {$DEFINE DCC} - {$DEFINE VCL_60} - {$IFDEF CBUILDER} - {$DEFINE CBUILDER_6} - {$ELSE} - {$DEFINE DELPHI_6} - {$ENDIF} - {$ENDIF} - - //Delphi 7 - {$IFDEF VER150} - {$DEFINE DCC} - {$DEFINE VCL_70} - {$DEFINE DELPHI_7} // there was no C++ Builder 7 - {$ENDIF} - - //Delphi 8 - {$IFDEF VER160} - {$DEFINE DCC} - {$DEFINE VCL_80} - {$DEFINE DELPHI_8} // there was no C++ Builder 8 - {$ENDIF} - - //Delphi 2005 - {$IFDEF VER170} - {$DEFINE DCC} - {$DEFINE VCL_2005} - {$DEFINE DELPHI_2005} // there was no C++Builder 2005 - {$ENDIF} - - // NOTE: CodeGear decided to make Highlander be a non-breaking release - // (no interface changes, thus fully backwards compatible without any - // end user code changes), so VER180 applies to both BDS 2006 and - // Highlander prior to the release of RAD Studio 2007. Use VER185 to - // identify Highlanger specifically. - - //Delphi & C++Builder 2006 - //Delphi & C++Builder 2007 (Highlander) - {$IFDEF VER180} - {$DEFINE DCC} - {$DEFINE VCL_2006} - {$IFDEF CBUILDER} - {$DEFINE CBUILDER_2006} - {$ELSE} - {$DEFINE DELPHI_2006} - {$ENDIF} - {$ENDIF} - - //Delphi & C++Builder 2007 (Highlander) - {$IFDEF VER185} - {$DEFINE DCC} - {$UNDEF VCL_2006} - {$DEFINE VCL_2007} - {$IFDEF CBUILDER} - {$UNDEF CBUILDER_2006} - {$DEFINE CBUILDER_2007} - {$ELSE} - {$UNDEF DELPHI_2006} - {$DEFINE DELPHI_2007} - {$ENDIF} - {$ENDIF} - - // BDS 2007 NET personality uses VER190 instead of 185. - //Delphi .NET 2007 - {$IFDEF VER190} - {$DEFINE DCC} - {$IFDEF CIL} - //Delphi 2007 - {$DEFINE VCL_2007} - {$DEFINE DELPHI_2007} - {$ENDIF} - {$ENDIF} - - //Delphi & C++Builder 2009 (Tiburon) - {$IFDEF VER200} - {$DEFINE DCC} - {$DEFINE VCL_2009} - {$IFDEF CBUILDER} - {$DEFINE CBUILDER_2009} - {$ELSE} - {$DEFINE DELPHI_2009} - {$ENDIF} - {$ENDIF} - - //Delphi & C++Builder 2010 (Weaver) - {$IFDEF VER210} - {$DEFINE DCC} - {$DEFINE VCL_2010} - {$IFDEF CBUILDER} - {$DEFINE CBUILDER_2010} - {$ELSE} - {$DEFINE DELPHI_2010} - {$ENDIF} - {$ENDIF} - - //Delphi & C++Builder XE (Fulcrum) - {$IFDEF VER220} - //REMOVE DCC DEFINE after the next Fulcrum beta. - //It will be defined there. - {$IFNDEF DCC} - {$DEFINE DCC} - {$ENDIF} - {$DEFINE VCL_XE} - {$IFDEF CBUILDER} - {$DEFINE CBUILDER_XE} - {$ELSE} - {$DEFINE DELPHI_XE} - {$ENDIF} - {$ENDIF} - - // DCC is now defined by the Delphi compiler starting in XE2 - - //Delphi & CBuilder XE2 (Pulsar) - {$IFDEF VER230} - {$DEFINE VCL_XE2} - {$IFDEF CBUILDER} - {$DEFINE CBUILDER_XE2} - {$ELSE} - {$DEFINE DELPHI_XE2} - {$ENDIF} - {$ENDIF} - - //Delphi & CBuilder XE3 (Waterdragon) - //Delphi & CBuilder XE3.5 (Quintessence - early betas only) - {$IFDEF VER240} - {$DEFINE VCL_XE3} - {$IFDEF CBUILDER} - {$DEFINE CBUILDER_XE3} - {$ELSE} - {$DEFINE DELPHI_XE3} - {$ENDIF} - {$ENDIF} - - //Delphi & CBuilder XE4 (Quintessence) - {$IFDEF VER250} - {$UNDEF VCL_XE3} - {$DEFINE VCL_XE4} - {$IFDEF CBUILDER} - {$UNDEF CBUILDER_XE3} - {$DEFINE CBUILDER_XE4} - {$ELSE} - {$UNDEF DELPHI_XE3} - {$DEFINE DELPHI_XE4} - {$ENDIF} - {$ENDIF} - - //Delphi & CBuilder XE5 (Zephyr) - {$IFDEF VER260} - {$DEFINE VCL_XE5} - {$IFDEF CBUILDER} - {$DEFINE CBUILDER_XE5} - {$ELSE} - {$DEFINE DELPHI_XE5} - {$ENDIF} - {$ENDIF} - - //Delphi & CBuilder AppMethod - //AppMethod is just XE5 for mobile only, VCL is removed - {$IFDEF VER265} - {$DEFINE VCL_XE5} - {$IFDEF CBUILDER} - {$DEFINE CBUILDER_XE5} - {$ELSE} - {$DEFINE DELPHI_XE5} - {$ENDIF} - {$ENDIF} - - //Delphi & CBuilder XE6 (Proteus) - {$IFDEF VER270} - {$DEFINE VCL_XE6} - {$IFDEF CBUILDER} - {$DEFINE CBUILDER_XE6} - {$ELSE} - {$DEFINE DELPHI_XE6} - {$ENDIF} - {$ENDIF} - - //Delphi & CBuilder XE7 (Carpathia) - {$IFDEF VER280} - {$DEFINE VCL_XE7} - {$IFDEF CBUILDER} - {$DEFINE CBUILDER_XE7} - {$ELSE} - {$DEFINE DELPHI_XE7} - {$ENDIF} - {$ENDIF} - - //Delphi & CBuilder XE8 (Elbrus) - {$IFDEF VER290} - {$DEFINE VCL_XE8} - {$IFDEF CBUILDER} - {$DEFINE CBUILDER_XE8} - {$ELSE} - {$DEFINE DELPHI_XE8} - {$ENDIF} - {$ENDIF} - - //Delphi & CBuilder 10.0 Seattle (Aitana) - {$IFDEF VER300} - {$DEFINE VCL_10_0} - {$IFDEF CBUILDER} - {$DEFINE CBUILDER_VCL_10_0} - {$ELSE} - {$DEFINE DELPHI_VCL_10_0} - {$ENDIF} - {$ENDIF} - - //Delphi & CBuilder 10.1 Berlin (BigBen) - {$IFDEF VER310} - {$DEFINE VCL_10_1} - {$IFDEF CBUILDER} - {$DEFINE CBUILDER_10_1} - {$ELSE} - {$DEFINE DELPHI_10_1} - {$ENDIF} - {$ENDIF} - - //Delphi & CBuilder 10.2 Tokyo (Godzilla) - {$IFDEF VER320} - {$DEFINE VCL_10_2} - {$IFDEF CBUILDER} - {$DEFINE CBUILDER_10_2} - {$ELSE} - {$DEFINE DELPHI_10_2} - {$ENDIF} - {$ENDIF} - - //Delphi & CBuilder 10.3 Rio (Carnival) - {$IFDEF VER330} - {$DEFINE VCL_10_3} - {$IFDEF CBUILDER} - {$DEFINE CBUILDER_10_3} - {$ELSE} - {$DEFINE DELPHI_10_3} - {$ENDIF} - {$ENDIF} - - //Delphi & CBuilder 10.4 Sydney (Denali) - {$IFDEF VER340} - {$DEFINE VCL_10_4} - {$IFDEF CBUILDER} - {$DEFINE CBUILDER_10_4} - {$ELSE} - {$DEFINE DELPHI_10_4} - {$ENDIF} - {$ENDIF} - - //Delphi & CBuilder 11.0 Alexandria (Olympus) - {$IFDEF VER350} - {$DEFINE VCL_11} - {$IFDEF CBUILDER} - {$DEFINE CBUILDER_11} - {$ELSE} - {$DEFINE DELPHI_11} - {$ENDIF} - {$ENDIF} - - //Delphi & CBuilder 12.0 Athens (Yukon) - {$IFDEF VER360} - {$DEFINE VCL_12} - {$IFDEF CBUILDER} - {$DEFINE CBUILDER_12} - {$ELSE} - {$DEFINE DELPHI_12} - {$ENDIF} - {$ENDIF} - - // Kylix - // - //Important: Don't use CompilerVersion here as IF's are evaluated before - //IFDEF's and Kylix 1 does not have CompilerVersion defined at all. - {$IFDEF LINUX} - {$DEFINE UNIX} - {$IFDEF CONDITIONALEXPRESSIONS} - {$IF (RTLVersion >= 14.0) and (RTLVersion <= 14.5) } - {$DEFINE KYLIX} - {$IF RTLVersion = 14.5} - {$DEFINE KYLIX_3} - {$ELSEIF RTLVersion >= 14.2} - {$DEFINE KYLIX_2} - {$ELSE} - {$DEFINE KYLIX_1} - {$IFEND} - {$IFEND} - {$ENDIF} - {$ENDIF} - -{$ENDIF} - -// Delphi.NET -// Covers D8+ -{$IFDEF CIL} - // Platform specific conditional. Used for platform specific code. - {$DEFINE DOTNET} - {$DEFINE STRING_IS_UNICODE} -{$ENDIF} - -{$IFDEF KYLIX} - {$DEFINE VCL_60} - {$DEFINE CPUI386} - {$UNDEF USE_BASEUNIX} - - {$IFDEF KYLIX_3} - {$DEFINE KYLIX_3_OR_ABOVE} - {$ENDIF} - - {$IFDEF KYLIX_3_OR_ABOVE} - {$DEFINE KYLIX_2_OR_ABOVE} - {$ELSE} - {$IFDEF KYLIX_2} - {$DEFINE KYLIX_2_OR_ABOVE} - {$ENDIF} - {$ENDIF} - - {$IFDEF KYLIX_2_OR_ABOVE} - {$DEFINE KYLIX_1_OR_ABOVE} - {$ELSE} - {$IFDEF KYLIX_1} - {$DEFINE KYLIX_1_OR_ABOVE} - {$ENDIF} - {$ENDIF} - - {$IFNDEF KYLIX_3_OR_ABOVE} - {$DEFINE KYLIXCOMPAT} - {$ENDIF} -{$ENDIF} - -// FPC (2+) - -{$IFDEF FPC} - // TODO: In FreePascal 4.2.0+, a Delphi-like UnicodeString type is supported. - // However, String/(P)Char do not map to UnicodeString/(P)WideChar unless - // either {$MODE DelphiUnicode} or {$MODESWITCH UnicodeStrings} is used. - // We should consider enabling one of them so Indy uses the same Unicode logic - // in Delphi 2009+ and FreePascal 4.2.0+ and reduces IFDEFs (in particular, - // STRING_UNICODE_MISMATCH, see further below). However, FreePascal's RTL - // is largely not UnicodeString-enabled yet. Maybe we should enable - // {$MODE DelphiUnicode} anyway, and then deal with any RTL function issues - // on an as-needed basis... - {$MODE Delphi} - {$IFDEF FPC_2_7_1_OR_ABOVE} - {.$MODE DelphiUnicode} - {.$MODESWITCH UnicodeStrings} - {.$CODEPAGE UTF8} // needed for Unicode string literals to work properly - {$ENDIF} - //note that we may need further defines for widget types depending on - //what we do and what platforms we support in FPC. - //I'll let Marco think about that one. - {$IFDEF UNIX} - {$DEFINE USE_BASEUNIX} - {$IFDEF LINUX} - //In Linux for I386, you can choose between a Kylix-libc API or - //the standard RTL Unix API. Just pass -dKYLIXCOMPAT to the FPC compiler. - //I will see what I can do about the Makefile. - {$IFDEF KYLIXCOMPAT} - {$IFDEF CPUI386} - {$UNDEF USE_BASEUNIX} - {$ENDIF} - {$ENDIF} - {$ENDIF} - {$IFDEF USE_BASEUNIX} - {$UNDEF KYLIXCOMPAT} - {$ENDIF} - {$ENDIF} - - // FPC_FULLVERSION was added in FPC 2.2.4 - // Have to use Defined() or else Delphi compiler chokes, since it - // evaluates $IF statements before $IFDEF statements... - - {$MACRO ON} // must be on in order to use versioning macros - {$IF DEFINED(FPC_FULLVERSION) AND (FPC_FULLVERSION >= 30101)} - {$DEFINE FPC_3_1_1_OR_ABOVE} - {$IFEND} - {$IF DEFINED(FPC_FULLVERSION) AND (FPC_FULLVERSION >= 30000)} - {$DEFINE FPC_3_0_0_OR_ABOVE} - {$IFEND} - {$IF DEFINED(FPC_FULLVERSION) AND (FPC_FULLVERSION >= 20701)} - {$DEFINE FPC_2_7_1_OR_ABOVE} - {$IFEND} - {$IF DEFINED(FPC_FULLVERSION) AND (FPC_FULLVERSION >= 20604)} - {$DEFINE FPC_2_6_4_OR_ABOVE} - {$IFEND} - {$IF DEFINED(FPC_FULLVERSION) AND (FPC_FULLVERSION >= 20602)} - {$DEFINE FPC_2_6_2_OR_ABOVE} - {$IFEND} - {$IF DEFINED(FPC_FULLVERSION) AND (FPC_FULLVERSION >= 20600)} - {$DEFINE FPC_2_6_0_OR_ABOVE} - {$IFEND} - {$IF DEFINED(FPC_FULLVERSION) AND (FPC_FULLVERSION >= 20404)} - {$DEFINE FPC_2_4_4_OR_ABOVE} - {$IFEND} - {$IF DEFINED(FPC_FULLVERSION) AND (FPC_FULLVERSION >= 20402)} - {$DEFINE FPC_2_4_2_OR_ABOVE} - {$IFEND} - {$IF DEFINED(FPC_FULLVERSION) AND (FPC_FULLVERSION >= 20400)} - {$DEFINE FPC_2_4_0_OR_ABOVE} - {$IFEND} - {$IF DEFINED(FPC_FULLVERSION) AND (FPC_FULLVERSION >= 20204)} - {$DEFINE FPC_2_2_4_OR_ABOVE} - {$IFEND} - {$IF DEFINED(FPC_FULLVERSION) AND (FPC_FULLVERSION >= 20202)} - {$DEFINE FPC_2_2_2_OR_ABOVE} - {$IFEND} - {$IF DEFINED(FPC_FULLVERSION) AND (FPC_FULLVERSION >= 20105)} - {$DEFINE FPC_2_1_5_OR_ABOVE} - {$IFEND} - - // just in case - {$IFDEF FPC_3_1_1} - {$DEFINE FPC_3_1_1_OR_ABOVE} - {$ENDIF} - {$IFDEF FPC_3_0_0} - {$DEFINE FPC_3_0_0_OR_ABOVE} - {$ENDIF} - {$IFDEF FPC_2_7_1} - {$DEFINE FPC_2_7_1_OR_ABOVE} - {$ENDIF} - {$IFDEF FPC_2_6_4} - {$DEFINE FPC_2_6_4_OR_ABOVE} - {$ENDIF} - {$IFDEF FPC_2_6_2} - {$DEFINE FPC_2_6_2_OR_ABOVE} - {$ENDIF} - {$IFDEF FPC_2_6_0} - {$DEFINE FPC_2_6_0_OR_ABOVE} - {$ENDIF} - {$IFDEF FPC_2_4_4} - {$DEFINE FPC_2_4_4_OR_ABOVE} - {$ENDIF} - {$IFDEF FPC_2_4_2} - {$DEFINE FPC_2_4_2_OR_ABOVE} - {$ENDIF} - {$IFDEF FPC_2_4_0} - {$DEFINE FPC_2_4_0_OR_ABOVE} - {$ENDIF} - {$IFDEF FPC_2_2_4} - {$DEFINE FPC_2_2_4_OR_ABOVE} - {$ENDIF} - {$IFDEF FPC_2_2_2} - {$DEFINE FPC_2_2_2_OR_ABOVE} - {$ENDIF} - {$IFDEF FPC_2_1_5} - {$DEFINE FPC_2_1_5_OR_ABOVE} - {$ENDIF} - - {$IFDEF FPC_3_1_1_OR_ABOVE} - {$DEFINE FPC_3_0_0_OR_ABOVE} - {$ELSE} - {$IFDEF FPC_3_0_0} - {$DEFINE FPC_3_0_0_OR_ABOVE} - {$ENDIF} - {$ENDIF} - - {$IFDEF FPC_3_0_0_OR_ABOVE} - {$DEFINE FPC_2_7_1_OR_ABOVE} - {$ELSE} - {$IFDEF FPC_2_7_1} - {$DEFINE FPC_2_7_1_OR_ABOVE} - {$ENDIF} - {$ENDIF} - - {$IFDEF FPC_2_7_1_OR_ABOVE} - {$DEFINE FPC_2_6_4_OR_ABOVE} - {$ELSE} - {$IFDEF FPC_2_6_4} - {$DEFINE FPC_2_6_4_OR_ABOVE} - {$ENDIF} - {$ENDIF} - - {$IFDEF FPC_2_6_4_OR_ABOVE} - {$DEFINE FPC_2_6_2_OR_ABOVE} - {$ELSE} - {$IFDEF FPC_2_6_2} - {$DEFINE FPC_2_6_2_OR_ABOVE} - {$ENDIF} - {$ENDIF} - - {$IFDEF FPC_2_6_2_OR_ABOVE} - {$DEFINE FPC_2_6_0_OR_ABOVE} - {$ELSE} - {$IFDEF FPC_2_6_0} - {$DEFINE FPC_2_6_0_OR_ABOVE} - {$ENDIF} - {$ENDIF} - - {$IFDEF FPC_2_6_0_OR_ABOVE} - {$DEFINE FPC_2_4_4_OR_ABOVE} - {$ELSE} - {$IFDEF FPC_2_4_4} - {$DEFINE FPC_2_4_4_OR_ABOVE} - {$ENDIF} - {$ENDIF} - - {$IFDEF FPC_2_4_4_OR_ABOVE} - {$DEFINE FPC_2_4_2_OR_ABOVE} - {$ELSE} - {$IFDEF FPC_2_4_2} - {$DEFINE FPC_2_4_2_OR_ABOVE} - {$ENDIF} - {$ENDIF} - - {$IFDEF FPC_2_4_2_OR_ABOVE} - {$DEFINE FPC_2_4_0_OR_ABOVE} - {$ELSE} - {$IFDEF FPC_2_4_0} - {$DEFINE FPC_2_4_0_OR_ABOVE} - {$ENDIF} - {$ENDIF} - - {$IFDEF FPC_2_4_0_OR_ABOVE} - {$DEFINE FPC_2_2_4_OR_ABOVE} - {$ELSE} - {$IFDEF FPC_2_2_4} - {$DEFINE FPC_2_2_4_OR_ABOVE} - {$ENDIF} - {$ENDIF} - - {$IFDEF FPC_2_2_4_OR_ABOVE} - {$DEFINE FPC_2_2_2_OR_ABOVE} - {$ELSE} - {$IFDEF FPC_2_2_2} - {$DEFINE FPC_2_2_2_OR_ABOVE} - {$ENDIF} - {$ENDIF} - - {$IFDEF FPC_2_2_2_OR_ABOVE} - {$DEFINE FPC_2_2_0_OR_ABOVE} - {$ELSE} - {$IFDEF VER2_2} - {$DEFINE FPC_2_2_0_OR_ABOVE} - {$ENDIF} - {$ENDIF} - - {$IFDEF FPC_2_2_0_OR_ABOVE} - {$DEFINE FPC_2_1_5_OR_ABOVE} - {$ELSE} - {$IFDEF FPC_2_1_5} - {$DEFINE FPC_2_1_5_OR_ABOVE} - {$ENDIF} - {$ENDIF} - - {.$IFDEF FPC_2_7_1_OR_ABOVE} - // support for RawByteString and UnicodeString - {.$DEFINE VCL_2009} - {.$DEFINE DELPHI_2009} - {.$ELSE} - {$DEFINE VCL_70} - {$DEFINE DELPHI_7} - {.$ENDIF} -{$ENDIF} - -// end FPC - -{$IFDEF VCL_12} - {$DEFINE VCL_12_OR_ABOVE} -{$ENDIF} - -{$IFDEF VCL_12_OR_ABOVE} - {$DEFINE VCL_11_OR_ABOVE} -{$ELSE} - {$IFDEF VCL_11} - {$DEFINE VCL_11_OR_ABOVE} - {$ENDIF} -{$ENDIF} - -{$IFDEF VCL_11_OR_ABOVE} - {$DEFINE VCL_10_4_OR_ABOVE} -{$ELSE} - {$IFDEF VCL_10_4} - {$DEFINE VCL_10_4_OR_ABOVE} - {$ENDIF} -{$ENDIF} - -{$IFDEF VCL_10_4_OR_ABOVE} - {$DEFINE VCL_10_3_OR_ABOVE} -{$ELSE} - {$IFDEF VCL_10_3} - {$DEFINE VCL_10_3_OR_ABOVE} - {$ENDIF} -{$ENDIF} - -{$IFDEF VCL_10_3_OR_ABOVE} - {$DEFINE VCL_10_2_OR_ABOVE} -{$ELSE} - {$IFDEF VCL_10_2} - {$DEFINE VCL_10_2_OR_ABOVE} - {$ENDIF} -{$ENDIF} - -{$IFDEF VCL_10_2_OR_ABOVE} - {$DEFINE VCL_10_1_OR_ABOVE} -{$ELSE} - {$IFDEF VCL_10_1} - {$DEFINE VCL_10_1_OR_ABOVE} - {$ENDIF} -{$ENDIF} - -{$IFDEF VCL_10_1_OR_ABOVE} - {$DEFINE VCL_10_0_OR_ABOVE} -{$ELSE} - {$IFDEF VCL_10_0} - {$DEFINE VCL_10_0_OR_ABOVE} - {$ENDIF} -{$ENDIF} - -{$IFDEF VCL_10_0_OR_ABOVE} - {$DEFINE VCL_XE8_OR_ABOVE} -{$ELSE} - {$IFDEF VCL_XE8} - {$DEFINE VCL_XE8_OR_ABOVE} - {$ENDIF} -{$ENDIF} - -{$IFDEF VCL_XE8_OR_ABOVE} - {$DEFINE VCL_XE7_OR_ABOVE} -{$ELSE} - {$IFDEF VCL_XE7} - {$DEFINE VCL_XE7_OR_ABOVE} - {$ENDIF} -{$ENDIF} - -{$IFDEF VCL_XE7_OR_ABOVE} - {$DEFINE VCL_XE6_OR_ABOVE} -{$ELSE} - {$IFDEF VCL_XE6} - {$DEFINE VCL_XE6_OR_ABOVE} - {$ENDIF} -{$ENDIF} - -{$IFDEF VCL_XE6_OR_ABOVE} - {$DEFINE VCL_XE5_OR_ABOVE} -{$ELSE} - {$IFDEF VCL_XE5} - {$DEFINE VCL_XE5_OR_ABOVE} - {$ENDIF} -{$ENDIF} - -{$IFDEF VCL_XE5_OR_ABOVE} - {$DEFINE VCL_XE4_OR_ABOVE} -{$ELSE} - {$IFDEF VCL_XE4} - {$DEFINE VCL_XE4_OR_ABOVE} - {$ENDIF} -{$ENDIF} - -{$IFDEF VCL_XE4_OR_ABOVE} - {$DEFINE VCL_XE3_OR_ABOVE} -{$ELSE} - {$IFDEF VCL_XE3} - {$DEFINE VCL_XE3_OR_ABOVE} - {$ENDIF} -{$ENDIF} - -{$IFDEF VCL_XE3_OR_ABOVE} - {$DEFINE VCL_XE2_OR_ABOVE} -{$ELSE} - {$IFDEF VCL_XE2} - {$DEFINE VCL_XE2_OR_ABOVE} - {$ENDIF} -{$ENDIF} - -{$IFDEF VCL_XE2_OR_ABOVE} - {$DEFINE VCL_XE_OR_ABOVE} -{$ELSE} - {$IFDEF VCL_XE} - {$DEFINE VCL_XE_OR_ABOVE} - {$ENDIF} -{$ENDIF} - -{$IFDEF VCL_XE_OR_ABOVE} - {$DEFINE VCL_2010_OR_ABOVE} -{$ELSE} - {$IFDEF VCL_2010} - {$DEFINE VCL_2010_OR_ABOVE} - {$ENDIF} -{$ENDIF} - -{$IFDEF VCL_2010_OR_ABOVE} - {$DEFINE VCL_2009_OR_ABOVE} -{$ELSE} - {$IFDEF VCL_2009} - {$DEFINE VCL_2009_OR_ABOVE} - {$ENDIF} -{$ENDIF} - -{$IFDEF VCL_2009_OR_ABOVE} - {$DEFINE VCL_2007_OR_ABOVE} -{$ELSE} - {$IFDEF VCL_2007} - {$DEFINE VCL_2007_OR_ABOVE} - {$ENDIF} -{$ENDIF} - -{$IFDEF VCL_2007_OR_ABOVE} - {$DEFINE VCL_2006_OR_ABOVE} -{$ELSE} - {$IFDEF VCL_2006} - {$DEFINE VCL_2006_OR_ABOVE} - {$ENDIF} -{$ENDIF} - -{$IFDEF VCL_2006_OR_ABOVE} - {$DEFINE VCL_2005_OR_ABOVE} -{$ELSE} - {$IFDEF VCL_2005} - {$DEFINE VCL_2005_OR_ABOVE} - {$ENDIF} -{$ENDIF} - -{$IFDEF VCL_2005_OR_ABOVE} - {$DEFINE VCL_8_OR_ABOVE} -{$ELSE} - {$IFDEF VCL_80} - {$DEFINE VCL_8_OR_ABOVE} - {$ENDIF} -{$ENDIF} - -{$IFDEF VCL_8_OR_ABOVE} - {$DEFINE VCL_7_OR_ABOVE} -{$ELSE} - {$IFDEF VCL_70} - {$DEFINE VCL_7_OR_ABOVE} - {$ENDIF} -{$ENDIF} - -{$IFDEF VCL_7_OR_ABOVE} - {$DEFINE VCL_6_OR_ABOVE} -{$ELSE} - {$IFDEF VCL_60} - {$DEFINE VCL_6_OR_ABOVE} - {$ENDIF} -{$ENDIF} - -{$IFDEF VCL_6_OR_ABOVE} - {$DEFINE VCL_5_OR_ABOVE} -{$ELSE} - {$IFDEF VCL_50} - {$DEFINE VCL_5_OR_ABOVE} - {$ENDIF} -{$ENDIF} - -{$IFDEF VCL_5_OR_ABOVE} - {$DEFINE VCL_4_OR_ABOVE} -{$ELSE} - {$IFDEF VCL_40} - {$DEFINE VCL_4_OR_ABOVE} - {$ENDIF} -{$ENDIF} - -// Normalize Delphi compiler defines to match FPC for consistency: -// -// CPU32 - any 32-bit CPU -// CPU64 - any 64-bit CPU -// WINDOWS - any Windows platform (32-bit, 64-bit, CE) -// WIN32 - Windows 32-bit -// WIN64 - Windows 64-bit -// WINCE - Windows CE -// -// Consult the "Free Pascal Programmer's Guide", Appendix G for the complete -// list of defines that are used. Do not work on this unless you understand -// what the FreePascal developers are doing. Not only do you have to -// descriminate with operating systems, but also with chip architectures -// are well. -// -// DCC Pulsar+ define the following values: -// ASSEMBLER -// DCC -// CONDITIONALEXPRESSIONS -// NATIVECODE -// UNICODE -// MACOS -// MACOS32 -// MACOS64 -// MSWINDOWS -// WIN32 -// WIN64 -// LINUX -// POSIX -// POSIX32 -// CPU386 -// CPUX86 -// CPUX64 -// -// Kylix defines the following values: -// LINUX -// (others??) -// - -{$IFNDEF FPC} - // TODO: We need to use ENDIAN_BIG for big endian chip architectures, - // such as 680x0, PowerPC, Sparc, and MIPS, once DCC supports them, - // provided it does not already define its own ENDIAN values by then... - {$DEFINE ENDIAN_LITTLE} - {$IFNDEF VCL_6_OR_ABOVE} - {$DEFINE MSWINDOWS} - {$ENDIF} - {$IFDEF MSWINDOWS} - {$DEFINE WINDOWS} - {$ENDIF} - // TODO: map Pulsar's non-Windows platform defines... - {$IFDEF VCL_XE2_OR_ABOVE} - {$IFDEF VCL_XE8_OR_ABOVE} - {$IFDEF CPU32BITS} - //any 32-bit CPU - {$DEFINE CPU32} - {$ENDIF} - {$IFDEF CPU64BITS} - {$DEFINE CPU64} - {$ENDIF} - {$ELSE} - {$IFDEF CPU386} - //any 32-bit CPU - {$DEFINE CPU32} - //Intel 386 compatible chip architecture - {$DEFINE CPUI386} - {$ENDIF} - {$IFDEF CPUX86} - {$DEFINE CPU32} - {$ENDIF} - {$IFDEF CPUX64} - //any 64-bit CPU - {$DEFINE CPU64} - //AMD64 compatible chip architecture - {$DEFINE CPUX86_64} //historical name for AMD64 - {$DEFINE CPUAMD64} - {$ENDIF} - {$ENDIF} - {$ELSE} - {$IFNDEF DOTNET} - {$IFNDEF KYLIX} - {$DEFINE I386} - {$ENDIF} - {$ENDIF} - {$DEFINE CPU32} - {$ENDIF} -{$ENDIF} - -{$IFDEF DOTNET} - //differences in DotNET Framework versions. - {$IFDEF VCL_2007_OR_ABOVE} - {$DEFINE DOTNET_2} - {$DEFINE DOTNET_2_OR_ABOVE} - {$ELSE} - {$DEFINE DOTNET_1_1} - {$ENDIF} - {$DEFINE DOTNET_1_1_OR_ABOVE} - // Extra include used in D7 for testing. Remove later when all comps are - // ported. Used to selectively exclude non ported parts. Allowed in places - // IFDEFs are otherwise not permitted. - {$DEFINE DOTNET_EXCLUDE} -{$ENDIF} - -// Check for available features - -{$IFDEF VCL_6_OR_ABOVE} - {$DEFINE HAS_PPointer} - {$IFNDEF FPC} - {$DEFINE HAS_TSelectionEditor} - {$ENDIF} -{$ENDIF} - -{$IFDEF VCL_2006_OR_ABOVE} - {$DEFINE USE_INLINE} -{$ENDIF} - -{$IFDEF VCL_2009_OR_ABOVE} - {$IFNDEF DOTNET} - {$DEFINE STRING_IS_UNICODE} - {$ENDIF} -{$ENDIF} - -{$IFDEF VCL_XE3_OR_ABOVE} - {$DEFINE HAS_DIRECTIVE_ZEROBASEDSTRINGS} - {$IFDEF NEXTGEN} - {$DEFINE DCC_NEXTGEN} - {$DEFINE USE_MARSHALLED_PTRS} - {$IFDEF AUTOREFCOUNT} - {$DEFINE USE_OBJECT_ARC} - {$ENDIF} - {$ENDIF} -{$ENDIF} - -{$IFDEF VCL_XE5_UPDATE2_OR_ABOVE} - {$DEFINE HAS_DIRECTIVE_HPPEMIT_LINKUNIT} - {$DEFINE HAS_DIRECTIVE_HPPEMIT_NAMESPACE} -{$ENDIF} - -{$IFDEF VCL_10_2_OR_ABOVE} - {.$WARN IMPLICIT_INTEGER_CAST_LOSS OFF} - {.$WARN IMPLICIT_CONVERSION_LOSS OFF} - {.$WARN COMBINING_SIGNED_UNSIGNED64 OFF} -{$ENDIF} - -{$IFDEF VCL_10_4_OR_ABOVE} - // 0-based string indexing via '[]' is turned off by default in Delphi 10.4. - // TStringHelper is always 0-indexed, flat RTL functions are always 1-indexed, - // and now '[]' is 1-indexed again on all platforms - {$ZEROBASEDSTRINGS OFF} - // is the default. - {.$UNDEF HAS_DIRECTIVE_ZEROBASEDSTRINGS} -{$ENDIF} - -// Delphi XE+ cross-compiling -{$IFNDEF FPC} - {$IFDEF POSIX} - {$IF RTLVersion >= 22.0} - {$DEFINE UNIX} - {$UNDEF USE_BASEUNIX} - {$DEFINE VCL_CROSS_COMPILE} - {$DEFINE USE_VCL_POSIX} - {$IFEND} - {$ENDIF} - {$IFDEF LINUX} - {$IFDEF CONDITIONALEXPRESSIONS} - {$IF RTLVersion >= 22.0} - {$DEFINE VCL_CROSS_COMPILE} - {$DEFINE USE_VCL_POSIX} - {$IFEND} - {$ENDIF} - {$ENDIF} -{$ENDIF} - -{$IFDEF VCL_CROSS_COMPILE} - {$UNDEF KYLIXCOMPAT} -{$ELSE} - {$IFDEF KYLIXCOMPAT} - {$linklib c} - {$ENDIF} -{$ENDIF} - -{$IFDEF FPC} - {$DEFINE USE_INLINE} - {$IFDEF FPC_UNICODESTRINGS} - {$DEFINE STRING_IS_UNICODE} - {$ENDIF} -{$ENDIF} - -// .NET and Delphi 2009+ support UNICODE strings natively! -// -// NOTE: Do not define UNICODE here. The compiler defines -// the symbol automatically. -{$IFNDEF STRING_IS_UNICODE} - {$DEFINE STRING_IS_ANSI} -{$ENDIF} - -{$IFDEF DCC_NEXTGEN} - {$DEFINE NO_ANSI_TYPES} - {$IFDEF USE_OBJECT_ARC} - // TODO: move these to an appropriate section. Not doing this yet because - // it is a major interface change to switch to Generics and we should - // maintain backwards compatibility with earlier compilers for the time - // being. Defining them only here for now because the non-Generic versions - // of these classes have become deprecated by ARC and so we need to start - // taking advantage of the Generics versions... - {$DEFINE HAS_UNIT_Generics_Collections} - {$DEFINE HAS_GENERICS_TList} - {$DEFINE HAS_GENERICS_TThreadList} - {$ENDIF} -{$ENDIF} - -// TODO: Ansi data types were disabled on mobile platforms in XE3, but -// UTF8String and RawByteString were re-enabled in 10.1 Berlin! What else, -// if anything, was re-enabled to facilitate that? -// -// UPDATE: In 10.4 Sydney, AnsiChar and AnsiString were re-enabled on -// mobile platforms! NEXTGEN is no longer defined in the mobile compilers. -{$IFDEF NO_ANSI_TYPES} - {$UNDEF HAS_PAnsiChar} -{$ENDIF} - -{$IFDEF WIN32} - {$DEFINE WIN32_OR_WIN64} -{$ENDIF} -{$IFDEF WIN64} - {$DEFINE WIN32_OR_WIN64} -{$ENDIF} - -{$IFDEF IOS} - // Support for 64-bit ARM iOS Simulator was added in Delphi 11.2 - // TODO: how to detect iOS Simulator in FPC? Does it support 64-bit ARM? - {$IFDEF CPUARM} - {$IFNDEF IOSSIMULATOR} - // RLebeau: For iOS devices, OpenSSL cannot be used as an external library, - // it must be statically linked into the app. For the iOS simulator, this - // is not true. Users who want to use OpenSSL in iOS device apps will need - // to add the static OpenSSL library to the project and then include the - // IdSSLOpenSSLHeaders_static unit in their uses clause. It hooks up the - // statically linked functions for the IdSSLOpenSSLHeaders unit to use... - {$DEFINE STATICLOAD_OPENSSL} - {$ENDIF} - {$ENDIF} -{$ENDIF} - -{$UNDEF USE_INVALIDATE_MOD_CACHE} -//This must come after the iconv defines because this compiler targets a Unix-like -//operating system. One key difference is that it does have a TEncoding class. -//If this comes before the ICONV defines, it creates problems. -//This also must go before the THandle size calculations. -{$IFDEF VCL_CROSS_COMPILE} - {$IFDEF POSIX} - {$IFNDEF LINUX} - {$DEFINE BSD} - {$ENDIF} - {$DEFINE USE_INVALIDATE_MOD_CACHE} - {$ENDIF} -{$ENDIF} - -//IMPORTANT!!!! -// -//Do not remove this!!! This is to work around a conflict. In DCC, MACOS -//will mean OS X. In FreePascal, the DEFINE MACOS means MacIntosh System OS Classic. -{$IFDEF DCC} - // DCC defines MACOS for both iOS and OS X platforms, need to differentiate - {$IFDEF MACOS} - {$IFNDEF IOS} - {$DEFINE OSX} - {$DEFINE DARWIN} - {$ENDIF} - {$ENDIF} -{$ENDIF} -{$IFDEF FPC} - // FPC defines DARWIN for both OSX and iOS, need to differentiate - {$IFDEF DARWIN} - {$IFNDEF IOS} - {$DEFINE OSX} - {$ENDIF} - {$ENDIF} - {$IFDEF MACOS} - {$DEFINE MACOS_CLASSIC} - {$ENDIF} -{$ENDIF} - -{$IFDEF BSD} - //I think BSD might handle FreeBSD, NetBSD, OpenBSD, and Darwin - {$IFDEF IOS} - {$IFDEF CPUARM64} - {$DEFINE CPU64} - {$ELSE} - {$IFDEF CPUARM32} - {$DEFINE CPU32} - {$ENDIF} - {$ENDIF} - {$ENDIF} -{$ENDIF} -{$IFDEF LINUX} - {$IFDEF LINUX64} - {$DEFINE CPU64} - {$ELSE} - {$IFDEF LINUX32} - {$DEFINE CPU32} - {$ENDIF} - {$ENDIF} -{$ENDIF} - -{end Unix OS specific stuff} - -{$IFDEF DEBUG} - {$UNDEF USE_INLINE} -{$ENDIF} - -// RLebeau 9/5/2013: it would take a lot of work to re-write Indy to support -// both 0-based and 1-based string indexing, so we'll just turn off 0-based -// indexing for now... -{$IFDEF HAS_DIRECTIVE_ZEROBASEDSTRINGS} - {$ZEROBASEDSTRINGS OFF} -{$ENDIF} +{$IFDEF CONDITIONALEXPRESSIONS} + // Must be at the top... + {$IF CompilerVersion >= 24.0} + {$LEGACYIFEND ON} + {$IFEND} +{$ENDIF} + +// General + +// Make this $DEFINE to use the 16 color icons required by Borland +// or DEFINE to use the 256 color Indy versions +{.$DEFINE Borland} + +// When generating C++Builder output files, certain workarounds to compiler +// problems need to be enabled! When invoking DCC on the command-line, use +// the -DBCB parameter. When invoking MSBUILD, include the DCC_Define="BCB" +// attribute in the /p parameter. +{$IFDEF BCB} + {$DEFINE CBUILDER} +{$ELSE} + {$DEFINE DELPHI} +{$ENDIF} + +{$UNDEF STATICLOAD_OPENSSL} + +// Make sure the following are $DEFINE'd only for Delphi/C++Builder 2009 onwards +// as specified further below. The VCL is fully Unicode, where the 'String' +// type maps to System.UnicodeString, not System.AnsiString anymore +{$UNDEF STRING_IS_UNICODE} +{$UNDEF STRING_IS_ANSI} + +// Make sure the following are $DEFINE'd only for suitable environments +// as specified further below. Delphi/C++Builder Mobile/NextGen compilers +// do not support Ansi data types anymore, and is moving away from raw +// pointers as well. +// +// UPDATE: in Delphi/C++Builder 10.4, all Ansi types are supported again on +// all platforms, including the mobile compilers. +{$DEFINE HAS_PAnsiChar} +{$UNDEF NO_ANSI_TYPES} + +// Make sure the following are $DEFINE'd only for suitable environments +// as specified further below. Delphi/C++Builder Mobile/NextGen compilers +// use ARC for TObject life time management. +// +// UPDATE: ARC for TObject lifetime management has been removed in +// Delphi/C++Builder 10.4 mobile compilers. All platforms now use a single +// unified memory management model! +{$UNDEF USE_MARSHALLED_PTRS} +{$UNDEF USE_OBJECT_ARC} + +//Define for Delphi cross-compiler targetting Posix +{$UNDEF USE_VCL_POSIX} + +// detect compiler versions + +{$IFNDEF FPC} + + // TODO: to detect features in Delphi/C++Builder v6 and later, use CompilerVersion + // and RTLVersion constants instead of VERXXX defines. We still support v5, which + // does not have such constants. + + // Delphi 4 + {$IFDEF VER120} + {$DEFINE DCC} + {$DEFINE VCL_40} + {$DEFINE DELPHI_4} + {$ENDIF} + + // C++Builder 4 + {$IFDEF VER125} + {$DEFINE DCC} + {$DEFINE VCL_40} + {$DEFINE CBUILDER_4} + {$ENDIF} + + // Delphi & C++Builder 5 + {$IFDEF VER130} + {$DEFINE DCC} + {$DEFINE VCL_50} + {$IFDEF CBUILDER} + {$DEFINE CBUILDER_5} + {$ELSE} + {$DEFINE DELPHI_5} + {$ENDIF} + {$ENDIF} + + //Delphi & C++Builder 6 + {$IFDEF VER140} + {$DEFINE DCC} + {$DEFINE VCL_60} + {$IFDEF CBUILDER} + {$DEFINE CBUILDER_6} + {$ELSE} + {$DEFINE DELPHI_6} + {$ENDIF} + {$ENDIF} + + //Delphi 7 + {$IFDEF VER150} + {$DEFINE DCC} + {$DEFINE VCL_70} + {$DEFINE DELPHI_7} // there was no C++ Builder 7 + {$ENDIF} + + //Delphi 8 + {$IFDEF VER160} + {$DEFINE DCC} + {$DEFINE VCL_80} + {$DEFINE DELPHI_8} // there was no C++ Builder 8 + {$ENDIF} + + //Delphi 2005 + {$IFDEF VER170} + {$DEFINE DCC} + {$DEFINE VCL_2005} + {$DEFINE DELPHI_2005} // there was no C++Builder 2005 + {$ENDIF} + + // NOTE: CodeGear decided to make Highlander be a non-breaking release + // (no interface changes, thus fully backwards compatible without any + // end user code changes), so VER180 applies to both BDS 2006 and + // Highlander prior to the release of RAD Studio 2007. Use VER185 to + // identify Highlanger specifically. + + //Delphi & C++Builder 2006 + //Delphi & C++Builder 2007 (Highlander) + {$IFDEF VER180} + {$DEFINE DCC} + {$DEFINE VCL_2006} + {$IFDEF CBUILDER} + {$DEFINE CBUILDER_2006} + {$ELSE} + {$DEFINE DELPHI_2006} + {$ENDIF} + {$ENDIF} + + //Delphi & C++Builder 2007 (Highlander) + {$IFDEF VER185} + {$DEFINE DCC} + {$UNDEF VCL_2006} + {$DEFINE VCL_2007} + {$IFDEF CBUILDER} + {$UNDEF CBUILDER_2006} + {$DEFINE CBUILDER_2007} + {$ELSE} + {$UNDEF DELPHI_2006} + {$DEFINE DELPHI_2007} + {$ENDIF} + {$ENDIF} + + // BDS 2007 NET personality uses VER190 instead of 185. + //Delphi .NET 2007 + {$IFDEF VER190} + {$DEFINE DCC} + {$IFDEF CIL} + //Delphi 2007 + {$DEFINE VCL_2007} + {$DEFINE DELPHI_2007} + {$ENDIF} + {$ENDIF} + + //Delphi & C++Builder 2009 (Tiburon) + {$IFDEF VER200} + {$DEFINE DCC} + {$DEFINE VCL_2009} + {$IFDEF CBUILDER} + {$DEFINE CBUILDER_2009} + {$ELSE} + {$DEFINE DELPHI_2009} + {$ENDIF} + {$ENDIF} + + //Delphi & C++Builder 2010 (Weaver) + {$IFDEF VER210} + {$DEFINE DCC} + {$DEFINE VCL_2010} + {$IFDEF CBUILDER} + {$DEFINE CBUILDER_2010} + {$ELSE} + {$DEFINE DELPHI_2010} + {$ENDIF} + {$ENDIF} + + //Delphi & C++Builder XE (Fulcrum) + {$IFDEF VER220} + //REMOVE DCC DEFINE after the next Fulcrum beta. + //It will be defined there. + {$IFNDEF DCC} + {$DEFINE DCC} + {$ENDIF} + {$DEFINE VCL_XE} + {$IFDEF CBUILDER} + {$DEFINE CBUILDER_XE} + {$ELSE} + {$DEFINE DELPHI_XE} + {$ENDIF} + {$ENDIF} + + // DCC is now defined by the Delphi compiler starting in XE2 + + //Delphi & CBuilder XE2 (Pulsar) + {$IFDEF VER230} + {$DEFINE VCL_XE2} + {$IFDEF CBUILDER} + {$DEFINE CBUILDER_XE2} + {$ELSE} + {$DEFINE DELPHI_XE2} + {$ENDIF} + {$ENDIF} + + //Delphi & CBuilder XE3 (Waterdragon) + //Delphi & CBuilder XE3.5 (Quintessence - early betas only) + {$IFDEF VER240} + {$DEFINE VCL_XE3} + {$IFDEF CBUILDER} + {$DEFINE CBUILDER_XE3} + {$ELSE} + {$DEFINE DELPHI_XE3} + {$ENDIF} + {$ENDIF} + + //Delphi & CBuilder XE4 (Quintessence) + {$IFDEF VER250} + {$UNDEF VCL_XE3} + {$DEFINE VCL_XE4} + {$IFDEF CBUILDER} + {$UNDEF CBUILDER_XE3} + {$DEFINE CBUILDER_XE4} + {$ELSE} + {$UNDEF DELPHI_XE3} + {$DEFINE DELPHI_XE4} + {$ENDIF} + {$ENDIF} + + //Delphi & CBuilder XE5 (Zephyr) + {$IFDEF VER260} + {$DEFINE VCL_XE5} + {$IFDEF CBUILDER} + {$DEFINE CBUILDER_XE5} + {$ELSE} + {$DEFINE DELPHI_XE5} + {$ENDIF} + {$ENDIF} + + //Delphi & CBuilder AppMethod + //AppMethod is just XE5 for mobile only, VCL is removed + {$IFDEF VER265} + {$DEFINE VCL_XE5} + {$IFDEF CBUILDER} + {$DEFINE CBUILDER_XE5} + {$ELSE} + {$DEFINE DELPHI_XE5} + {$ENDIF} + {$ENDIF} + + //Delphi & CBuilder XE6 (Proteus) + {$IFDEF VER270} + {$DEFINE VCL_XE6} + {$IFDEF CBUILDER} + {$DEFINE CBUILDER_XE6} + {$ELSE} + {$DEFINE DELPHI_XE6} + {$ENDIF} + {$ENDIF} + + //Delphi & CBuilder XE7 (Carpathia) + {$IFDEF VER280} + {$DEFINE VCL_XE7} + {$IFDEF CBUILDER} + {$DEFINE CBUILDER_XE7} + {$ELSE} + {$DEFINE DELPHI_XE7} + {$ENDIF} + {$ENDIF} + + //Delphi & CBuilder XE8 (Elbrus) + {$IFDEF VER290} + {$DEFINE VCL_XE8} + {$IFDEF CBUILDER} + {$DEFINE CBUILDER_XE8} + {$ELSE} + {$DEFINE DELPHI_XE8} + {$ENDIF} + {$ENDIF} + + //Delphi & CBuilder 10.0 Seattle (Aitana) + {$IFDEF VER300} + {$DEFINE VCL_10_0} + {$IFDEF CBUILDER} + {$DEFINE CBUILDER_VCL_10_0} + {$ELSE} + {$DEFINE DELPHI_VCL_10_0} + {$ENDIF} + {$ENDIF} + + //Delphi & CBuilder 10.1 Berlin (BigBen) + {$IFDEF VER310} + {$DEFINE VCL_10_1} + {$IFDEF CBUILDER} + {$DEFINE CBUILDER_10_1} + {$ELSE} + {$DEFINE DELPHI_10_1} + {$ENDIF} + {$ENDIF} + + //Delphi & CBuilder 10.2 Tokyo (Godzilla) + {$IFDEF VER320} + {$DEFINE VCL_10_2} + {$IFDEF CBUILDER} + {$DEFINE CBUILDER_10_2} + {$ELSE} + {$DEFINE DELPHI_10_2} + {$ENDIF} + {$ENDIF} + + //Delphi & CBuilder 10.3 Rio (Carnival) + {$IFDEF VER330} + {$DEFINE VCL_10_3} + {$IFDEF CBUILDER} + {$DEFINE CBUILDER_10_3} + {$ELSE} + {$DEFINE DELPHI_10_3} + {$ENDIF} + {$ENDIF} + + //Delphi & CBuilder 10.4 Sydney (Denali) + {$IFDEF VER340} + {$DEFINE VCL_10_4} + {$IFDEF CBUILDER} + {$DEFINE CBUILDER_10_4} + {$ELSE} + {$DEFINE DELPHI_10_4} + {$ENDIF} + {$ENDIF} + + //Delphi & CBuilder 11.0 Alexandria (Olympus) + {$IFDEF VER350} + {$DEFINE VCL_11} + {$IFDEF CBUILDER} + {$DEFINE CBUILDER_11} + {$ELSE} + {$DEFINE DELPHI_11} + {$ENDIF} + {$ENDIF} + + //Delphi & CBuilder 12.0 Athens (Yukon) + {$IFDEF VER360} + {$DEFINE VCL_12} + {$IFDEF CBUILDER} + {$DEFINE CBUILDER_12} + {$ELSE} + {$DEFINE DELPHI_12} + {$ENDIF} + {$ENDIF} + + // Kylix + // + //Important: Don't use CompilerVersion here as IF's are evaluated before + //IFDEF's and Kylix 1 does not have CompilerVersion defined at all. + {$IFDEF LINUX} + {$DEFINE UNIX} + {$IFDEF CONDITIONALEXPRESSIONS} + {$IF (RTLVersion >= 14.0) and (RTLVersion <= 14.5) } + {$DEFINE KYLIX} + {$IF RTLVersion = 14.5} + {$DEFINE KYLIX_3} + {$ELSEIF RTLVersion >= 14.2} + {$DEFINE KYLIX_2} + {$ELSE} + {$DEFINE KYLIX_1} + {$IFEND} + {$IFEND} + {$ENDIF} + {$ENDIF} + +{$ENDIF} + +// Delphi.NET +// Covers D8+ +{$IFDEF CIL} + // Platform specific conditional. Used for platform specific code. + {$DEFINE DOTNET} + {$DEFINE STRING_IS_UNICODE} +{$ENDIF} + +{$IFDEF KYLIX} + {$DEFINE VCL_60} + {$DEFINE CPUI386} + {$UNDEF USE_BASEUNIX} + + {$IFDEF KYLIX_3} + {$DEFINE KYLIX_3_OR_ABOVE} + {$ENDIF} + + {$IFDEF KYLIX_3_OR_ABOVE} + {$DEFINE KYLIX_2_OR_ABOVE} + {$ELSE} + {$IFDEF KYLIX_2} + {$DEFINE KYLIX_2_OR_ABOVE} + {$ENDIF} + {$ENDIF} + + {$IFDEF KYLIX_2_OR_ABOVE} + {$DEFINE KYLIX_1_OR_ABOVE} + {$ELSE} + {$IFDEF KYLIX_1} + {$DEFINE KYLIX_1_OR_ABOVE} + {$ENDIF} + {$ENDIF} + + {$IFNDEF KYLIX_3_OR_ABOVE} + {$DEFINE KYLIXCOMPAT} + {$ENDIF} +{$ENDIF} + +// FPC (2+) + +{$IFDEF FPC} + // TODO: In FreePascal 4.2.0+, a Delphi-like UnicodeString type is supported. + // However, String/(P)Char do not map to UnicodeString/(P)WideChar unless + // either {$MODE DelphiUnicode} or {$MODESWITCH UnicodeStrings} is used. + // We should consider enabling one of them so Indy uses the same Unicode logic + // in Delphi 2009+ and FreePascal 4.2.0+ and reduces IFDEFs (in particular, + // STRING_UNICODE_MISMATCH, see further below). However, FreePascal's RTL + // is largely not UnicodeString-enabled yet. Maybe we should enable + // {$MODE DelphiUnicode} anyway, and then deal with any RTL function issues + // on an as-needed basis... + {$MODE Delphi} + {$IFDEF FPC_2_7_1_OR_ABOVE} + {.$MODE DelphiUnicode} + {.$MODESWITCH UnicodeStrings} + {.$CODEPAGE UTF8} // needed for Unicode string literals to work properly + {$ENDIF} + //note that we may need further defines for widget types depending on + //what we do and what platforms we support in FPC. + //I'll let Marco think about that one. + {$IFDEF UNIX} + {$DEFINE USE_BASEUNIX} + {$IFDEF LINUX} + //In Linux for I386, you can choose between a Kylix-libc API or + //the standard RTL Unix API. Just pass -dKYLIXCOMPAT to the FPC compiler. + //I will see what I can do about the Makefile. + {$IFDEF KYLIXCOMPAT} + {$IFDEF CPUI386} + {$UNDEF USE_BASEUNIX} + {$ENDIF} + {$ENDIF} + {$ENDIF} + {$IFDEF USE_BASEUNIX} + {$UNDEF KYLIXCOMPAT} + {$ENDIF} + {$ENDIF} + + // FPC_FULLVERSION was added in FPC 2.2.4 + // Have to use Defined() or else Delphi compiler chokes, since it + // evaluates $IF statements before $IFDEF statements... + + {$MACRO ON} // must be on in order to use versioning macros + {$IF DEFINED(FPC_FULLVERSION) AND (FPC_FULLVERSION >= 30101)} + {$DEFINE FPC_3_1_1_OR_ABOVE} + {$IFEND} + {$IF DEFINED(FPC_FULLVERSION) AND (FPC_FULLVERSION >= 30000)} + {$DEFINE FPC_3_0_0_OR_ABOVE} + {$IFEND} + {$IF DEFINED(FPC_FULLVERSION) AND (FPC_FULLVERSION >= 20701)} + {$DEFINE FPC_2_7_1_OR_ABOVE} + {$IFEND} + {$IF DEFINED(FPC_FULLVERSION) AND (FPC_FULLVERSION >= 20604)} + {$DEFINE FPC_2_6_4_OR_ABOVE} + {$IFEND} + {$IF DEFINED(FPC_FULLVERSION) AND (FPC_FULLVERSION >= 20602)} + {$DEFINE FPC_2_6_2_OR_ABOVE} + {$IFEND} + {$IF DEFINED(FPC_FULLVERSION) AND (FPC_FULLVERSION >= 20600)} + {$DEFINE FPC_2_6_0_OR_ABOVE} + {$IFEND} + {$IF DEFINED(FPC_FULLVERSION) AND (FPC_FULLVERSION >= 20404)} + {$DEFINE FPC_2_4_4_OR_ABOVE} + {$IFEND} + {$IF DEFINED(FPC_FULLVERSION) AND (FPC_FULLVERSION >= 20402)} + {$DEFINE FPC_2_4_2_OR_ABOVE} + {$IFEND} + {$IF DEFINED(FPC_FULLVERSION) AND (FPC_FULLVERSION >= 20400)} + {$DEFINE FPC_2_4_0_OR_ABOVE} + {$IFEND} + {$IF DEFINED(FPC_FULLVERSION) AND (FPC_FULLVERSION >= 20204)} + {$DEFINE FPC_2_2_4_OR_ABOVE} + {$IFEND} + {$IF DEFINED(FPC_FULLVERSION) AND (FPC_FULLVERSION >= 20202)} + {$DEFINE FPC_2_2_2_OR_ABOVE} + {$IFEND} + {$IF DEFINED(FPC_FULLVERSION) AND (FPC_FULLVERSION >= 20105)} + {$DEFINE FPC_2_1_5_OR_ABOVE} + {$IFEND} + + // just in case + {$IFDEF FPC_3_1_1} + {$DEFINE FPC_3_1_1_OR_ABOVE} + {$ENDIF} + {$IFDEF FPC_3_0_0} + {$DEFINE FPC_3_0_0_OR_ABOVE} + {$ENDIF} + {$IFDEF FPC_2_7_1} + {$DEFINE FPC_2_7_1_OR_ABOVE} + {$ENDIF} + {$IFDEF FPC_2_6_4} + {$DEFINE FPC_2_6_4_OR_ABOVE} + {$ENDIF} + {$IFDEF FPC_2_6_2} + {$DEFINE FPC_2_6_2_OR_ABOVE} + {$ENDIF} + {$IFDEF FPC_2_6_0} + {$DEFINE FPC_2_6_0_OR_ABOVE} + {$ENDIF} + {$IFDEF FPC_2_4_4} + {$DEFINE FPC_2_4_4_OR_ABOVE} + {$ENDIF} + {$IFDEF FPC_2_4_2} + {$DEFINE FPC_2_4_2_OR_ABOVE} + {$ENDIF} + {$IFDEF FPC_2_4_0} + {$DEFINE FPC_2_4_0_OR_ABOVE} + {$ENDIF} + {$IFDEF FPC_2_2_4} + {$DEFINE FPC_2_2_4_OR_ABOVE} + {$ENDIF} + {$IFDEF FPC_2_2_2} + {$DEFINE FPC_2_2_2_OR_ABOVE} + {$ENDIF} + {$IFDEF FPC_2_1_5} + {$DEFINE FPC_2_1_5_OR_ABOVE} + {$ENDIF} + + {$IFDEF FPC_3_1_1_OR_ABOVE} + {$DEFINE FPC_3_0_0_OR_ABOVE} + {$ELSE} + {$IFDEF FPC_3_0_0} + {$DEFINE FPC_3_0_0_OR_ABOVE} + {$ENDIF} + {$ENDIF} + + {$IFDEF FPC_3_0_0_OR_ABOVE} + {$DEFINE FPC_2_7_1_OR_ABOVE} + {$ELSE} + {$IFDEF FPC_2_7_1} + {$DEFINE FPC_2_7_1_OR_ABOVE} + {$ENDIF} + {$ENDIF} + + {$IFDEF FPC_2_7_1_OR_ABOVE} + {$DEFINE FPC_2_6_4_OR_ABOVE} + {$ELSE} + {$IFDEF FPC_2_6_4} + {$DEFINE FPC_2_6_4_OR_ABOVE} + {$ENDIF} + {$ENDIF} + + {$IFDEF FPC_2_6_4_OR_ABOVE} + {$DEFINE FPC_2_6_2_OR_ABOVE} + {$ELSE} + {$IFDEF FPC_2_6_2} + {$DEFINE FPC_2_6_2_OR_ABOVE} + {$ENDIF} + {$ENDIF} + + {$IFDEF FPC_2_6_2_OR_ABOVE} + {$DEFINE FPC_2_6_0_OR_ABOVE} + {$ELSE} + {$IFDEF FPC_2_6_0} + {$DEFINE FPC_2_6_0_OR_ABOVE} + {$ENDIF} + {$ENDIF} + + {$IFDEF FPC_2_6_0_OR_ABOVE} + {$DEFINE FPC_2_4_4_OR_ABOVE} + {$ELSE} + {$IFDEF FPC_2_4_4} + {$DEFINE FPC_2_4_4_OR_ABOVE} + {$ENDIF} + {$ENDIF} + + {$IFDEF FPC_2_4_4_OR_ABOVE} + {$DEFINE FPC_2_4_2_OR_ABOVE} + {$ELSE} + {$IFDEF FPC_2_4_2} + {$DEFINE FPC_2_4_2_OR_ABOVE} + {$ENDIF} + {$ENDIF} + + {$IFDEF FPC_2_4_2_OR_ABOVE} + {$DEFINE FPC_2_4_0_OR_ABOVE} + {$ELSE} + {$IFDEF FPC_2_4_0} + {$DEFINE FPC_2_4_0_OR_ABOVE} + {$ENDIF} + {$ENDIF} + + {$IFDEF FPC_2_4_0_OR_ABOVE} + {$DEFINE FPC_2_2_4_OR_ABOVE} + {$ELSE} + {$IFDEF FPC_2_2_4} + {$DEFINE FPC_2_2_4_OR_ABOVE} + {$ENDIF} + {$ENDIF} + + {$IFDEF FPC_2_2_4_OR_ABOVE} + {$DEFINE FPC_2_2_2_OR_ABOVE} + {$ELSE} + {$IFDEF FPC_2_2_2} + {$DEFINE FPC_2_2_2_OR_ABOVE} + {$ENDIF} + {$ENDIF} + + {$IFDEF FPC_2_2_2_OR_ABOVE} + {$DEFINE FPC_2_2_0_OR_ABOVE} + {$ELSE} + {$IFDEF VER2_2} + {$DEFINE FPC_2_2_0_OR_ABOVE} + {$ENDIF} + {$ENDIF} + + {$IFDEF FPC_2_2_0_OR_ABOVE} + {$DEFINE FPC_2_1_5_OR_ABOVE} + {$ELSE} + {$IFDEF FPC_2_1_5} + {$DEFINE FPC_2_1_5_OR_ABOVE} + {$ENDIF} + {$ENDIF} + + {.$IFDEF FPC_2_7_1_OR_ABOVE} + // support for RawByteString and UnicodeString + {.$DEFINE VCL_2009} + {.$DEFINE DELPHI_2009} + {.$ELSE} + {$DEFINE VCL_70} + {$DEFINE DELPHI_7} + {.$ENDIF} +{$ENDIF} + +// end FPC + +{$IFDEF VCL_12} + {$DEFINE VCL_12_OR_ABOVE} +{$ENDIF} + +{$IFDEF VCL_12_OR_ABOVE} + {$DEFINE VCL_11_OR_ABOVE} +{$ELSE} + {$IFDEF VCL_11} + {$DEFINE VCL_11_OR_ABOVE} + {$ENDIF} +{$ENDIF} + +{$IFDEF VCL_11_OR_ABOVE} + {$DEFINE VCL_10_4_OR_ABOVE} +{$ELSE} + {$IFDEF VCL_10_4} + {$DEFINE VCL_10_4_OR_ABOVE} + {$ENDIF} +{$ENDIF} + +{$IFDEF VCL_10_4_OR_ABOVE} + {$DEFINE VCL_10_3_OR_ABOVE} +{$ELSE} + {$IFDEF VCL_10_3} + {$DEFINE VCL_10_3_OR_ABOVE} + {$ENDIF} +{$ENDIF} + +{$IFDEF VCL_10_3_OR_ABOVE} + {$DEFINE VCL_10_2_OR_ABOVE} +{$ELSE} + {$IFDEF VCL_10_2} + {$DEFINE VCL_10_2_OR_ABOVE} + {$ENDIF} +{$ENDIF} + +{$IFDEF VCL_10_2_OR_ABOVE} + {$DEFINE VCL_10_1_OR_ABOVE} +{$ELSE} + {$IFDEF VCL_10_1} + {$DEFINE VCL_10_1_OR_ABOVE} + {$ENDIF} +{$ENDIF} + +{$IFDEF VCL_10_1_OR_ABOVE} + {$DEFINE VCL_10_0_OR_ABOVE} +{$ELSE} + {$IFDEF VCL_10_0} + {$DEFINE VCL_10_0_OR_ABOVE} + {$ENDIF} +{$ENDIF} + +{$IFDEF VCL_10_0_OR_ABOVE} + {$DEFINE VCL_XE8_OR_ABOVE} +{$ELSE} + {$IFDEF VCL_XE8} + {$DEFINE VCL_XE8_OR_ABOVE} + {$ENDIF} +{$ENDIF} + +{$IFDEF VCL_XE8_OR_ABOVE} + {$DEFINE VCL_XE7_OR_ABOVE} +{$ELSE} + {$IFDEF VCL_XE7} + {$DEFINE VCL_XE7_OR_ABOVE} + {$ENDIF} +{$ENDIF} + +{$IFDEF VCL_XE7_OR_ABOVE} + {$DEFINE VCL_XE6_OR_ABOVE} +{$ELSE} + {$IFDEF VCL_XE6} + {$DEFINE VCL_XE6_OR_ABOVE} + {$ENDIF} +{$ENDIF} + +{$IFDEF VCL_XE6_OR_ABOVE} + {$DEFINE VCL_XE5_OR_ABOVE} +{$ELSE} + {$IFDEF VCL_XE5} + {$DEFINE VCL_XE5_OR_ABOVE} + {$ENDIF} +{$ENDIF} + +{$IFDEF VCL_XE5_OR_ABOVE} + {$DEFINE VCL_XE4_OR_ABOVE} +{$ELSE} + {$IFDEF VCL_XE4} + {$DEFINE VCL_XE4_OR_ABOVE} + {$ENDIF} +{$ENDIF} + +{$IFDEF VCL_XE4_OR_ABOVE} + {$DEFINE VCL_XE3_OR_ABOVE} +{$ELSE} + {$IFDEF VCL_XE3} + {$DEFINE VCL_XE3_OR_ABOVE} + {$ENDIF} +{$ENDIF} + +{$IFDEF VCL_XE3_OR_ABOVE} + {$DEFINE VCL_XE2_OR_ABOVE} +{$ELSE} + {$IFDEF VCL_XE2} + {$DEFINE VCL_XE2_OR_ABOVE} + {$ENDIF} +{$ENDIF} + +{$IFDEF VCL_XE2_OR_ABOVE} + {$DEFINE VCL_XE_OR_ABOVE} +{$ELSE} + {$IFDEF VCL_XE} + {$DEFINE VCL_XE_OR_ABOVE} + {$ENDIF} +{$ENDIF} + +{$IFDEF VCL_XE_OR_ABOVE} + {$DEFINE VCL_2010_OR_ABOVE} +{$ELSE} + {$IFDEF VCL_2010} + {$DEFINE VCL_2010_OR_ABOVE} + {$ENDIF} +{$ENDIF} + +{$IFDEF VCL_2010_OR_ABOVE} + {$DEFINE VCL_2009_OR_ABOVE} +{$ELSE} + {$IFDEF VCL_2009} + {$DEFINE VCL_2009_OR_ABOVE} + {$ENDIF} +{$ENDIF} + +{$IFDEF VCL_2009_OR_ABOVE} + {$DEFINE VCL_2007_OR_ABOVE} +{$ELSE} + {$IFDEF VCL_2007} + {$DEFINE VCL_2007_OR_ABOVE} + {$ENDIF} +{$ENDIF} + +{$IFDEF VCL_2007_OR_ABOVE} + {$DEFINE VCL_2006_OR_ABOVE} +{$ELSE} + {$IFDEF VCL_2006} + {$DEFINE VCL_2006_OR_ABOVE} + {$ENDIF} +{$ENDIF} + +{$IFDEF VCL_2006_OR_ABOVE} + {$DEFINE VCL_2005_OR_ABOVE} +{$ELSE} + {$IFDEF VCL_2005} + {$DEFINE VCL_2005_OR_ABOVE} + {$ENDIF} +{$ENDIF} + +{$IFDEF VCL_2005_OR_ABOVE} + {$DEFINE VCL_8_OR_ABOVE} +{$ELSE} + {$IFDEF VCL_80} + {$DEFINE VCL_8_OR_ABOVE} + {$ENDIF} +{$ENDIF} + +{$IFDEF VCL_8_OR_ABOVE} + {$DEFINE VCL_7_OR_ABOVE} +{$ELSE} + {$IFDEF VCL_70} + {$DEFINE VCL_7_OR_ABOVE} + {$ENDIF} +{$ENDIF} + +{$IFDEF VCL_7_OR_ABOVE} + {$DEFINE VCL_6_OR_ABOVE} +{$ELSE} + {$IFDEF VCL_60} + {$DEFINE VCL_6_OR_ABOVE} + {$ENDIF} +{$ENDIF} + +{$IFDEF VCL_6_OR_ABOVE} + {$DEFINE VCL_5_OR_ABOVE} +{$ELSE} + {$IFDEF VCL_50} + {$DEFINE VCL_5_OR_ABOVE} + {$ENDIF} +{$ENDIF} + +{$IFDEF VCL_5_OR_ABOVE} + {$DEFINE VCL_4_OR_ABOVE} +{$ELSE} + {$IFDEF VCL_40} + {$DEFINE VCL_4_OR_ABOVE} + {$ENDIF} +{$ENDIF} + +// Normalize Delphi compiler defines to match FPC for consistency: +// +// CPU32 - any 32-bit CPU +// CPU64 - any 64-bit CPU +// WINDOWS - any Windows platform (32-bit, 64-bit, CE) +// WIN32 - Windows 32-bit +// WIN64 - Windows 64-bit +// WINCE - Windows CE +// +// Consult the "Free Pascal Programmer's Guide", Appendix G for the complete +// list of defines that are used. Do not work on this unless you understand +// what the FreePascal developers are doing. Not only do you have to +// descriminate with operating systems, but also with chip architectures +// are well. +// +// DCC Pulsar+ define the following values: +// ASSEMBLER +// DCC +// CONDITIONALEXPRESSIONS +// NATIVECODE +// UNICODE +// MACOS +// MACOS32 +// MACOS64 +// MSWINDOWS +// WIN32 +// WIN64 +// LINUX +// POSIX +// POSIX32 +// CPU386 +// CPUX86 +// CPUX64 +// +// Kylix defines the following values: +// LINUX +// (others??) +// + +{$IFNDEF FPC} + // TODO: We need to use ENDIAN_BIG for big endian chip architectures, + // such as 680x0, PowerPC, Sparc, and MIPS, once DCC supports them, + // provided it does not already define its own ENDIAN values by then... + {$DEFINE ENDIAN_LITTLE} + {$IFNDEF VCL_6_OR_ABOVE} + {$DEFINE MSWINDOWS} + {$ENDIF} + {$IFDEF MSWINDOWS} + {$DEFINE WINDOWS} + {$ENDIF} + // TODO: map Pulsar's non-Windows platform defines... + {$IFDEF VCL_XE2_OR_ABOVE} + {$IFDEF VCL_XE8_OR_ABOVE} + {$IFDEF CPU32BITS} + //any 32-bit CPU + {$DEFINE CPU32} + {$ENDIF} + {$IFDEF CPU64BITS} + {$DEFINE CPU64} + {$ENDIF} + {$ELSE} + {$IFDEF CPU386} + //any 32-bit CPU + {$DEFINE CPU32} + //Intel 386 compatible chip architecture + {$DEFINE CPUI386} + {$ENDIF} + {$IFDEF CPUX86} + {$DEFINE CPU32} + {$ENDIF} + {$IFDEF CPUX64} + //any 64-bit CPU + {$DEFINE CPU64} + //AMD64 compatible chip architecture + {$DEFINE CPUX86_64} //historical name for AMD64 + {$DEFINE CPUAMD64} + {$ENDIF} + {$ENDIF} + {$ELSE} + {$IFNDEF DOTNET} + {$IFNDEF KYLIX} + {$DEFINE I386} + {$ENDIF} + {$ENDIF} + {$DEFINE CPU32} + {$ENDIF} +{$ENDIF} + +{$IFDEF DOTNET} + //differences in DotNET Framework versions. + {$IFDEF VCL_2007_OR_ABOVE} + {$DEFINE DOTNET_2} + {$DEFINE DOTNET_2_OR_ABOVE} + {$ELSE} + {$DEFINE DOTNET_1_1} + {$ENDIF} + {$DEFINE DOTNET_1_1_OR_ABOVE} + // Extra include used in D7 for testing. Remove later when all comps are + // ported. Used to selectively exclude non ported parts. Allowed in places + // IFDEFs are otherwise not permitted. + {$DEFINE DOTNET_EXCLUDE} +{$ENDIF} + +// Check for available features + +{$IFDEF VCL_6_OR_ABOVE} + {$DEFINE HAS_PPointer} + {$IFNDEF FPC} + {$DEFINE HAS_TSelectionEditor} + {$ENDIF} +{$ENDIF} + +{$IFDEF VCL_2006_OR_ABOVE} + {$DEFINE USE_INLINE} +{$ENDIF} + +{$IFDEF VCL_2009_OR_ABOVE} + {$IFNDEF DOTNET} + {$DEFINE STRING_IS_UNICODE} + {$ENDIF} +{$ENDIF} + +{$IFDEF VCL_XE3_OR_ABOVE} + {$DEFINE HAS_DIRECTIVE_ZEROBASEDSTRINGS} + {$IFDEF NEXTGEN} + {$DEFINE DCC_NEXTGEN} + {$DEFINE USE_MARSHALLED_PTRS} + {$IFDEF AUTOREFCOUNT} + {$DEFINE USE_OBJECT_ARC} + {$ENDIF} + {$ENDIF} +{$ENDIF} + +{$IFDEF VCL_XE5_UPDATE2_OR_ABOVE} + {$DEFINE HAS_DIRECTIVE_HPPEMIT_LINKUNIT} + {$DEFINE HAS_DIRECTIVE_HPPEMIT_NAMESPACE} +{$ENDIF} + +{$IFDEF VCL_10_2_OR_ABOVE} + {.$WARN IMPLICIT_INTEGER_CAST_LOSS OFF} + {.$WARN IMPLICIT_CONVERSION_LOSS OFF} + {.$WARN COMBINING_SIGNED_UNSIGNED64 OFF} +{$ENDIF} + +{$IFDEF VCL_10_4_OR_ABOVE} + // 0-based string indexing via '[]' is turned off by default in Delphi 10.4. + // TStringHelper is always 0-indexed, flat RTL functions are always 1-indexed, + // and now '[]' is 1-indexed again on all platforms - {$ZEROBASEDSTRINGS OFF} + // is the default. + {.$UNDEF HAS_DIRECTIVE_ZEROBASEDSTRINGS} +{$ENDIF} + +// Delphi XE+ cross-compiling +{$IFNDEF FPC} + {$IFDEF POSIX} + {$IF RTLVersion >= 22.0} + {$DEFINE UNIX} + {$UNDEF USE_BASEUNIX} + {$DEFINE VCL_CROSS_COMPILE} + {$DEFINE USE_VCL_POSIX} + {$IFEND} + {$ENDIF} + {$IFDEF LINUX} + {$IFDEF CONDITIONALEXPRESSIONS} + {$IF RTLVersion >= 22.0} + {$DEFINE VCL_CROSS_COMPILE} + {$DEFINE USE_VCL_POSIX} + {$IFEND} + {$ENDIF} + {$ENDIF} +{$ENDIF} + +{$IFDEF VCL_CROSS_COMPILE} + {$UNDEF KYLIXCOMPAT} +{$ELSE} + {$IFDEF KYLIXCOMPAT} + {$linklib c} + {$ENDIF} +{$ENDIF} + +{$IFDEF FPC} + {$DEFINE USE_INLINE} + {$IFDEF FPC_UNICODESTRINGS} + {$DEFINE STRING_IS_UNICODE} + {$ENDIF} +{$ENDIF} + +// .NET and Delphi 2009+ support UNICODE strings natively! +// +// NOTE: Do not define UNICODE here. The compiler defines +// the symbol automatically. +{$IFNDEF STRING_IS_UNICODE} + {$DEFINE STRING_IS_ANSI} +{$ENDIF} + +{$IFDEF DCC_NEXTGEN} + {$DEFINE NO_ANSI_TYPES} + {$IFDEF USE_OBJECT_ARC} + // TODO: move these to an appropriate section. Not doing this yet because + // it is a major interface change to switch to Generics and we should + // maintain backwards compatibility with earlier compilers for the time + // being. Defining them only here for now because the non-Generic versions + // of these classes have become deprecated by ARC and so we need to start + // taking advantage of the Generics versions... + {$DEFINE HAS_UNIT_Generics_Collections} + {$DEFINE HAS_GENERICS_TList} + {$DEFINE HAS_GENERICS_TThreadList} + {$ENDIF} +{$ENDIF} + +// TODO: Ansi data types were disabled on mobile platforms in XE3, but +// UTF8String and RawByteString were re-enabled in 10.1 Berlin! What else, +// if anything, was re-enabled to facilitate that? +// +// UPDATE: In 10.4 Sydney, AnsiChar and AnsiString were re-enabled on +// mobile platforms! NEXTGEN is no longer defined in the mobile compilers. +{$IFDEF NO_ANSI_TYPES} + {$UNDEF HAS_PAnsiChar} +{$ENDIF} + +{$IFDEF WIN32} + {$DEFINE WIN32_OR_WIN64} +{$ENDIF} +{$IFDEF WIN64} + {$DEFINE WIN32_OR_WIN64} +{$ENDIF} + +{$IFDEF IOS} + // Support for 64-bit ARM iOS Simulator was added in Delphi 11.2 + // TODO: how to detect iOS Simulator in FPC? Does it support 64-bit ARM? + {$IFDEF CPUARM} + {$IFNDEF IOSSIMULATOR} + // RLebeau: For iOS devices, OpenSSL cannot be used as an external library, + // it must be statically linked into the app. For the iOS simulator, this + // is not true. Users who want to use OpenSSL in iOS device apps will need + // to add the static OpenSSL library to the project and then include the + // IdSSLOpenSSLHeaders_static unit in their uses clause. It hooks up the + // statically linked functions for the IdSSLOpenSSLHeaders unit to use... + {$DEFINE STATICLOAD_OPENSSL} + {$ENDIF} + {$ENDIF} +{$ENDIF} + +{$UNDEF USE_INVALIDATE_MOD_CACHE} +//This must come after the iconv defines because this compiler targets a Unix-like +//operating system. One key difference is that it does have a TEncoding class. +//If this comes before the ICONV defines, it creates problems. +//This also must go before the THandle size calculations. +{$IFDEF VCL_CROSS_COMPILE} + {$IFDEF POSIX} + {$IFNDEF LINUX} + {$DEFINE BSD} + {$ENDIF} + {$DEFINE USE_INVALIDATE_MOD_CACHE} + {$ENDIF} +{$ENDIF} + +//IMPORTANT!!!! +// +//Do not remove this!!! This is to work around a conflict. In DCC, MACOS +//will mean OS X. In FreePascal, the DEFINE MACOS means MacIntosh System OS Classic. +{$IFDEF DCC} + // DCC defines MACOS for both iOS and OS X platforms, need to differentiate + {$IFDEF MACOS} + {$IFNDEF IOS} + {$DEFINE OSX} + {$DEFINE DARWIN} + {$ENDIF} + {$ENDIF} +{$ENDIF} +{$IFDEF FPC} + // FPC defines DARWIN for both OSX and iOS, need to differentiate + {$IFDEF DARWIN} + {$IFNDEF IOS} + {$DEFINE OSX} + {$ENDIF} + {$ENDIF} + {$IFDEF MACOS} + {$DEFINE MACOS_CLASSIC} + {$ENDIF} +{$ENDIF} + +{$IFDEF BSD} + //I think BSD might handle FreeBSD, NetBSD, OpenBSD, and Darwin + {$IFDEF IOS} + {$IFDEF CPUARM64} + {$DEFINE CPU64} + {$ELSE} + {$IFDEF CPUARM32} + {$DEFINE CPU32} + {$ENDIF} + {$ENDIF} + {$ENDIF} +{$ENDIF} +{$IFDEF LINUX} + {$IFDEF LINUX64} + {$DEFINE CPU64} + {$ELSE} + {$IFDEF LINUX32} + {$DEFINE CPU32} + {$ENDIF} + {$ENDIF} +{$ENDIF} + +{end Unix OS specific stuff} + +{$IFDEF DEBUG} + {$UNDEF USE_INLINE} +{$ENDIF} + +// RLebeau 9/5/2013: it would take a lot of work to re-write Indy to support +// both 0-based and 1-based string indexing, so we'll just turn off 0-based +// indexing for now... +{$IFDEF HAS_DIRECTIVE_ZEROBASEDSTRINGS} + {$ZEROBASEDSTRINGS OFF} +{$ENDIF} diff --git a/IdNTLMOpenSSL.pas b/IdNTLMOpenSSL.pas index ff1bec8..8db0b5b 100644 --- a/IdNTLMOpenSSL.pas +++ b/IdNTLMOpenSSL.pas @@ -1,160 +1,179 @@ -{ - This file is part of the Indy (Internet Direct) project, and is offered - under the dual-licensing agreement described on the Indy website. - (http://www.indyproject.org/) - - Copyright: - (c) 1993-2024, Chad Z. Hower and the Indy Pit Crew. All rights reserved. -} - -unit IdNTLMOpenSSL; - -interface - -implementation - -uses - IdGlobal, IdFIPS, IdSSLOpenSSLHeaders, IdHashMessageDigest, - SysUtils; - -{$I IdCompilerDefines.inc} - -function LoadOpenSSL: Boolean; -begin - Result := IdSSLOpenSSLHeaders.Load; -end; - -function IsNTLMFuncsAvail: Boolean; -begin - Result := Assigned(DES_set_odd_parity) and - Assigned(DES_set_key) and - Assigned(DES_ecb_encrypt); -end; - -type - Pdes_key_schedule = ^des_key_schedule; - -{/* - * turns a 56 bit key into the 64 bit, odd parity key and sets the key. - * The key schedule ks is also set. - */} -procedure setup_des_key(key_56: des_cblock; Var ks: des_key_schedule); -Var - key: des_cblock; -begin - key[0] := key_56[0]; - - key[1] := ((key_56[0] SHL 7) and $FF) or (key_56[1] SHR 1); - key[2] := ((key_56[1] SHL 6) and $FF) or (key_56[2] SHR 2); - key[3] := ((key_56[2] SHL 5) and $FF) or (key_56[3] SHR 3); - key[4] := ((key_56[3] SHL 4) and $FF) or (key_56[4] SHR 4); - key[5] := ((key_56[4] SHL 3) and $FF) or (key_56[5] SHR 5); - key[6] := ((key_56[5] SHL 2) and $FF) or (key_56[6] SHR 6); - key[7] := (key_56[6] SHL 1) and $FF; - - DES_set_odd_parity(@key); - DES_set_key(@key, ks); -end; - -{/* - * takes a 21 byte array and treats it as 3 56-bit DES keys. The - * 8 byte plaintext is encrypted with each key and the resulting 24 - * bytes are stored in the results array. - */} -procedure calc_resp(keys: PDES_cblock; const ANonce: TIdBytes; results: Pdes_key_schedule); -Var - ks: des_key_schedule; - nonce: des_cblock; -begin - setup_des_key(keys^, ks); - Move(ANonce[0], nonce, 8); - des_ecb_encrypt(@nonce, Pconst_DES_cblock(results), ks, DES_ENCRYPT); - - setup_des_key(PDES_cblock(PtrUInt(keys) + 7)^, ks); - des_ecb_encrypt(@nonce, Pconst_DES_cblock(PtrUInt(results) + 8), ks, DES_ENCRYPT); - - setup_des_key(PDES_cblock(PtrUInt(keys) + 14)^, ks); - des_ecb_encrypt(@nonce, Pconst_DES_cblock(PtrUInt(results) + 16), ks, DES_ENCRYPT); -end; - -Const - Magic: des_cblock = ($4B, $47, $53, $21, $40, $23, $24, $25 ); - -//* setup LanManager password */ -function SetupLanManagerPassword(const APassword: String; const ANonce: TIdBytes): TIdBytes; -var - lm_hpw: array[0..20] of Byte; - lm_pw: array[0..13] of Byte; - idx, len: Integer; - ks: des_key_schedule; - lm_resp: array [0..23] of Byte; - lPassword: {$IFDEF STRING_IS_UNICODE}TIdBytes{$ELSE}AnsiString{$ENDIF}; -begin - {$IFDEF STRING_IS_UNICODE} - lPassword := IndyTextEncoding_OSDefault.GetBytes(UpperCase(APassword)); - {$ELSE} - lPassword := UpperCase(APassword); - {$ENDIF} - - len := IndyMin(Length(lPassword), 14); - if len > 0 then begin - Move(lPassword[{$IFDEF STRING_IS_UNICODE}0{$ELSE}1{$ENDIF}], lm_pw[0], len); - end; - if len < 14 then begin - for idx := len to 13 do begin - lm_pw[idx] := $0; - end; - end; - - //* create LanManager hashed password */ - - setup_des_key(pdes_cblock(@lm_pw[0])^, ks); - des_ecb_encrypt(@magic, Pconst_DES_cblock(@lm_hpw[0]), ks, DES_ENCRYPT); - - setup_des_key(pdes_cblock(PtrUInt(@lm_pw[0]) + 7)^, ks); - des_ecb_encrypt(@magic, Pconst_DES_cblock(PtrUInt(@lm_hpw[0]) + 8), ks, DES_ENCRYPT); - - FillChar(lm_hpw[16], 5, 0); - - calc_resp(PDes_cblock(@lm_hpw[0]), ANonce, Pdes_key_schedule(@lm_resp[0])); - - SetLength(Result, SizeOf(lm_resp)); - Move(lm_resp[0], Result[0], SizeOf(lm_resp)); -end; - -//* create NT hashed password */ -function CreateNTPassword(const APassword: String; const ANonce: TIdBytes): TIdBytes; -var - nt_hpw: array [1..21] of Byte; - nt_hpw128: TIdBytes; - nt_resp: array [1..24] of Byte; - LMD4: TIdHashMessageDigest4; -begin - CheckMD4Permitted; - LMD4 := TIdHashMessageDigest4.Create; - try - {$IFDEF STRING_IS_UNICODE} - nt_hpw128 := LMD4.HashString(APassword, IndyTextEncoding_UTF16LE); - {$ELSE} - nt_hpw128 := LMD4.HashBytes(BuildUnicode(APassword)); - {$ENDIF} - finally - LMD4.Free; - end; - - Move(nt_hpw128[0], nt_hpw[1], 16); - FillChar(nt_hpw[17], 5, 0); - - calc_resp(pdes_cblock(@nt_hpw[1]), ANonce, Pdes_key_schedule(@nt_resp[1])); - - SetLength(Result, SizeOf(nt_resp)); - Move(nt_resp[1], Result[0], SizeOf(nt_resp)); -end; - -initialization - IdFIPS.LoadNTLMLibrary := LoadOpenSSL; - IdFIPS.IsNTLMFuncsAvail := IsNTLMFuncsAvail; - IdFIPS.NTLMGetLmChallengeResponse := SetupLanManagerPassword; - IdFIPS.NTLMGetNtChallengeResponse := CreateNTPassword; - +{ + This file is part of the Indy (Internet Direct) project, and is offered + under the dual-licensing agreement described on the Indy website. + (http://www.indyproject.org/) + + Copyright: + (c) 1993-2024, Chad Z. Hower and the Indy Pit Crew. All rights reserved. +} + +unit IdNTLMOpenSSL; + +interface + +implementation + +uses + IdGlobal, IdFIPS, IdSSLOpenSSLHeaders, IdHashMessageDigest, + SysUtils; + +{$I IdCompilerDefines.inc} + +function LoadOpenSSL: Boolean; +begin + {$IFDEF OPENSSL_STATIC_LINK_MODEL} + Result := true; + {$ELSE} + Result := GetOpenSSLLoader.Load; + {$ENDIF} +end; + +function IsNTLMFuncsAvail: Boolean; +begin + {$IFDEF OPENSSL_STATIC_LINK_MODEL} + Result := true; + {$ELSE} + Result := Assigned(DES_set_odd_parity) and + Assigned(DES_set_key) and + Assigned(DES_ecb_encrypt); + {$ENDIF} +end; + +type + Pdes_key_schedule = ^des_key_schedule; + +{/* + * turns a 56 bit key into the 64 bit, odd parity key and sets the key. + * The key schedule ks is also set. + */} +procedure setup_des_key(key_56: des_cblock; Var ks: des_key_schedule); +Var + key: des_cblock; +begin + key[0] := key_56[0]; + + key[1] := ((key_56[0] SHL 7) and $FF) or (key_56[1] SHR 1); + key[2] := ((key_56[1] SHL 6) and $FF) or (key_56[2] SHR 2); + key[3] := ((key_56[2] SHL 5) and $FF) or (key_56[3] SHR 3); + key[4] := ((key_56[3] SHL 4) and $FF) or (key_56[4] SHR 4); + key[5] := ((key_56[4] SHL 3) and $FF) or (key_56[5] SHR 5); + key[6] := ((key_56[5] SHL 2) and $FF) or (key_56[6] SHR 6); + key[7] := (key_56[6] SHL 1) and $FF; + + DES_set_odd_parity(@key); + DES_set_key(@key, ks); +end; + +{/* + * takes a 21 byte array and treats it as 3 56-bit DES keys. The + * 8 byte plaintext is encrypted with each key and the resulting 24 + * bytes are stored in the results array. + */} +procedure calc_resp(keys: PDES_cblock; const ANonce: TIdBytes; results: Pdes_key_schedule); +Var + ks: des_key_schedule; + nonce: des_cblock; +begin + setup_des_key(keys^, ks); + Move(ANonce[0], nonce, 8); + des_ecb_encrypt(@nonce, Pconst_DES_cblock(results), ks, DES_ENCRYPT); + + setup_des_key(PDES_cblock(PtrUInt(keys) + 7)^, ks); + des_ecb_encrypt(@nonce, Pconst_DES_cblock(PtrUInt(results) + 8), ks, DES_ENCRYPT); + + setup_des_key(PDES_cblock(PtrUInt(keys) + 14)^, ks); + des_ecb_encrypt(@nonce, Pconst_DES_cblock(PtrUInt(results) + 16), ks, DES_ENCRYPT); +end; + +Const + Magic: des_cblock = ($4B, $47, $53, $21, $40, $23, $24, $25 ); + +//* setup LanManager password */ +function SetupLanManagerPassword(const APassword: String; const ANonce: TIdBytes): TIdBytes; +var + lm_hpw: array[0..20] of Byte; + lm_pw: array[0..13] of Byte; + idx, len: Integer; + ks: des_key_schedule; + lm_resp: array [0..23] of Byte; + lPassword: {$IFDEF STRING_IS_UNICODE}TIdBytes{$ELSE}AnsiString{$ENDIF}; +begin + {$IFDEF STRING_IS_UNICODE} + lPassword := IndyTextEncoding_OSDefault.GetBytes(UpperCase(APassword)); + {$ELSE} + lPassword := UpperCase(APassword); + {$ENDIF} + + len := IndyMin(Length(lPassword), 14); + if len > 0 then begin + Move(lPassword[{$IFDEF STRING_IS_UNICODE}0{$ELSE}1{$ENDIF}], lm_pw[0], len); + end; + if len < 14 then begin + for idx := len to 13 do begin + lm_pw[idx] := $0; + end; + end; + + //* create LanManager hashed password */ + + setup_des_key(pdes_cblock(@lm_pw[0])^, ks); + des_ecb_encrypt(@magic, Pconst_DES_cblock(@lm_hpw[0]), ks, DES_ENCRYPT); + + setup_des_key(pdes_cblock(PtrUInt(@lm_pw[0]) + 7)^, ks); + des_ecb_encrypt(@magic, Pconst_DES_cblock(PtrUInt(@lm_hpw[0]) + 8), ks, DES_ENCRYPT); + + FillChar(lm_hpw[16], 5, 0); + + calc_resp(PDes_cblock(@lm_hpw[0]), ANonce, Pdes_key_schedule(@lm_resp[0])); + + SetLength(Result, SizeOf(lm_resp)); + Move(lm_resp[0], Result[0], SizeOf(lm_resp)); +end; + +//* create NT hashed password */ +function CreateNTPassword(const APassword: String; const ANonce: TIdBytes): TIdBytes; +var + nt_hpw: array [1..21] of Byte; + nt_hpw128: TIdBytes; + nt_resp: array [1..24] of Byte; + LMD4: TIdHashMessageDigest4; + {$IFNDEF STRING_IS_UNICODE} + i: integer; + lPwUnicode: TIdBytes; + {$ENDIF} +begin + CheckMD4Permitted; + LMD4 := TIdHashMessageDigest4.Create; + try + {$IFDEF STRING_IS_UNICODE} + nt_hpw128 := LMD4.HashString(APassword, IndyTextEncoding_UTF16LE); + {$ELSE} + // RLebeau: TODO - should this use UTF-16 as well? This logic will + // not produce a valid Unicode string if non-ASCII characters are present! + SetLength(lPwUnicode, Length(S) * SizeOf(WideChar)); + for i := 0 to Length(S)-1 do begin + lPwUnicode[i*2] := Byte(S[i+1]); + lPwUnicode[(i*2)+1] := Byte(#0); + end; + nt_hpw128 := LMD4.HashBytes(lPwUnicode); + {$ENDIF} + finally + LMD4.Free; + end; + + Move(nt_hpw128[0], nt_hpw[1], 16); + FillChar(nt_hpw[17], 5, 0); + + calc_resp(pdes_cblock(@nt_hpw[1]), ANonce, Pdes_key_schedule(@nt_resp[1])); + + SetLength(Result, SizeOf(nt_resp)); + Move(nt_resp[1], Result[0], SizeOf(nt_resp)); +end; + +initialization + IdFIPS.LoadNTLMLibrary := LoadOpenSSL; + IdFIPS.IsNTLMFuncsAvail := IsNTLMFuncsAvail; + IdFIPS.NTLMGetLmChallengeResponse := SetupLanManagerPassword; + IdFIPS.NTLMGetNtChallengeResponse := CreateNTPassword; + end. \ No newline at end of file diff --git a/IdOpenSSLHeaders_aes.pas b/IdOpenSSLHeaders_aes.pas new file mode 100644 index 0000000..322029e --- /dev/null +++ b/IdOpenSSLHeaders_aes.pas @@ -0,0 +1,786 @@ + (* This unit was generated using the script genOpenSSLHdrs.sh from the source file IdOpenSSLHeaders_aes.h2pas + It should not be modified directly. All changes should be made to IdOpenSSLHeaders_aes.h2pas + and this file regenerated. IdOpenSSLHeaders_aes.h2pas is distributed with the full Indy + Distribution. + *) + +{$i IdCompilerDefines.inc} +{$i IdSSLOpenSSLDefines.inc} +{$IFNDEF USE_OPENSSL} + { error Should not compile if USE_OPENSSL is not defined!!!} +{$ENDIF} +{******************************************************************************} +{ } +{ Indy (Internet Direct) - Internet Protocols Simplified } +{ } +{ https://www.indyproject.org/ } +{ https://gitter.im/IndySockets/Indy } +{ } +{******************************************************************************} +{ } +{ This file is part of the Indy (Internet Direct) project, and is offered } +{ under the dual-licensing agreement described on the Indy website. } +{ (https://www.indyproject.org/license/) } +{ } +{ Copyright: } +{ (c) 1993-2020, Chad Z. Hower and the Indy Pit Crew. All rights reserved. } +{ } +{******************************************************************************} +{ } +{ } +{******************************************************************************} + +unit IdOpenSSLHeaders_aes; + +interface + +// Headers for OpenSSL 1.1.1 +// aes.h + + +uses + IdCTypes, + IdGlobal, + IdSSLOpenSSLConsts; + +const +// Added '_CONST' to avoid name clashes + AES_ENCRYPT_CONST = 1; +// Added '_CONST' to avoid name clashes + AES_DECRYPT_CONST = 0; + AES_MAXNR = 14; + AES_BLOCK_SIZE = 16; + +type + aes_key_st = record + // in old IdSSLOpenSSLHeaders.pas it was also TIdC_UINT ¯\_(ツ)_/¯ +// {$IFDEF AES_LONG} +// rd_key: array[0..(4 * (AES_MAXNR + 1))] of TIdC_ULONG; +// {$ELSE} + rd_key: array[0..(4 * (AES_MAXNR + 1))] of TIdC_UINT; +// {$ENDIF} + rounds: TIdC_INT; + end; + AES_KEY = aes_key_st; + PAES_KEY = ^AES_KEY; + + { The EXTERNALSYM directive is ignored by FPC, however, it is used by Delphi as follows: + + The EXTERNALSYM directive prevents the specified Delphi symbol from appearing in header + files generated for C++. } + + {$EXTERNALSYM AES_options} + {$EXTERNALSYM AES_set_encrypt_key} + {$EXTERNALSYM AES_set_decrypt_key} + {$EXTERNALSYM AES_encrypt} + {$EXTERNALSYM AES_decrypt} + {$EXTERNALSYM AES_ecb_encrypt} + {$EXTERNALSYM AES_cbc_encrypt} + {$EXTERNALSYM AES_cfb128_encrypt} + {$EXTERNALSYM AES_cfb1_encrypt} + {$EXTERNALSYM AES_cfb8_encrypt} + {$EXTERNALSYM AES_ofb128_encrypt} + {$EXTERNALSYM AES_ige_encrypt} + {$EXTERNALSYM AES_bi_ige_encrypt} + {$EXTERNALSYM AES_wrap_key} + {$EXTERNALSYM AES_unwrap_key} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +var + AES_options: function : PIdAnsiChar; cdecl = nil; + + AES_set_encrypt_key: function (const userKey: PByte; const bits: TIdC_INT; const key: PAES_KEY): TIdC_INT; cdecl = nil; + AES_set_decrypt_key: function (const userKey: PByte; const bits: TIdC_INT; const key: PAES_KEY): TIdC_INT; cdecl = nil; + + AES_encrypt: procedure (const in_: PByte; out_: PByte; const key: PAES_KEY); cdecl = nil; + AES_decrypt: procedure (const in_: PByte; out_: PByte; const key: PAES_KEY); cdecl = nil; + + AES_ecb_encrypt: procedure (const in_: PByte; out_: PByte; const key: PAES_KEY; const enc: TIdC_INT); cdecl = nil; + AES_cbc_encrypt: procedure (const in_: PByte; out_: PByte; length: TIdC_SIZET; const key: PAES_KEY; ivec: PByte; const enc: TIdC_INT); cdecl = nil; + AES_cfb128_encrypt: procedure (const in_: PByte; out_: PByte; length: TIdC_SIZET; const key: PAES_KEY; ivec: PByte; num: PIdC_INT; const enc: TIdC_INT); cdecl = nil; + AES_cfb1_encrypt: procedure (const in_: PByte; out_: PByte; length: TIdC_SIZET; const key: PAES_KEY; ivec: PByte; num: PIdC_INT; const enc: TIdC_INT); cdecl = nil; + AES_cfb8_encrypt: procedure (const in_: PByte; out_: PByte; length: TIdC_SIZET; const key: PAES_KEY; ivec: PByte; num: PIdC_INT; const enc: TIdC_INT); cdecl = nil; + AES_ofb128_encrypt: procedure (const in_: PByte; out_: PByte; length: TIdC_SIZET; const key: PAES_KEY; ivec: PByte; num: PIdC_INT); cdecl = nil; + (* NB: the IV is _two_ blocks long *) + AES_ige_encrypt: procedure (const in_: PByte; out_: PByte; length: TIdC_SIZET; const key: PAES_KEY; ivec: PByte; const enc: TIdC_INT); cdecl = nil; + (* NB: the IV is _four_ blocks long *) + AES_bi_ige_encrypt: procedure (const in_: PByte; out_: PByte; length: TIdC_SIZET; const key: PAES_KEY; const key2: PAES_KEY; ivec: PByte; const enc: TIdC_INT); cdecl = nil; + + AES_wrap_key: function (key: PAES_KEY; const iv: PByte; out_: PByte; const in_: PByte; inlen: TIdC_UINT): TIdC_INT; cdecl = nil; + AES_unwrap_key: function (key: PAES_KEY; const iv: PByte; out_: PByte; const in_: PByte; inlen: TIdC_UINT): TIdC_INT; cdecl = nil; + +{$ELSE} + function AES_options: PIdAnsiChar cdecl; external CLibCrypto; + + function AES_set_encrypt_key(const userKey: PByte; const bits: TIdC_INT; const key: PAES_KEY): TIdC_INT cdecl; external CLibCrypto; + function AES_set_decrypt_key(const userKey: PByte; const bits: TIdC_INT; const key: PAES_KEY): TIdC_INT cdecl; external CLibCrypto; + + procedure AES_encrypt(const in_: PByte; out_: PByte; const key: PAES_KEY) cdecl; external CLibCrypto; + procedure AES_decrypt(const in_: PByte; out_: PByte; const key: PAES_KEY) cdecl; external CLibCrypto; + + procedure AES_ecb_encrypt(const in_: PByte; out_: PByte; const key: PAES_KEY; const enc: TIdC_INT) cdecl; external CLibCrypto; + procedure AES_cbc_encrypt(const in_: PByte; out_: PByte; length: TIdC_SIZET; const key: PAES_KEY; ivec: PByte; const enc: TIdC_INT) cdecl; external CLibCrypto; + procedure AES_cfb128_encrypt(const in_: PByte; out_: PByte; length: TIdC_SIZET; const key: PAES_KEY; ivec: PByte; num: PIdC_INT; const enc: TIdC_INT) cdecl; external CLibCrypto; + procedure AES_cfb1_encrypt(const in_: PByte; out_: PByte; length: TIdC_SIZET; const key: PAES_KEY; ivec: PByte; num: PIdC_INT; const enc: TIdC_INT) cdecl; external CLibCrypto; + procedure AES_cfb8_encrypt(const in_: PByte; out_: PByte; length: TIdC_SIZET; const key: PAES_KEY; ivec: PByte; num: PIdC_INT; const enc: TIdC_INT) cdecl; external CLibCrypto; + procedure AES_ofb128_encrypt(const in_: PByte; out_: PByte; length: TIdC_SIZET; const key: PAES_KEY; ivec: PByte; num: PIdC_INT) cdecl; external CLibCrypto; + (* NB: the IV is _two_ blocks long *) + procedure AES_ige_encrypt(const in_: PByte; out_: PByte; length: TIdC_SIZET; const key: PAES_KEY; ivec: PByte; const enc: TIdC_INT) cdecl; external CLibCrypto; + (* NB: the IV is _four_ blocks long *) + procedure AES_bi_ige_encrypt(const in_: PByte; out_: PByte; length: TIdC_SIZET; const key: PAES_KEY; const key2: PAES_KEY; ivec: PByte; const enc: TIdC_INT) cdecl; external CLibCrypto; + + function AES_wrap_key(key: PAES_KEY; const iv: PByte; out_: PByte; const in_: PByte; inlen: TIdC_UINT): TIdC_INT cdecl; external CLibCrypto; + function AES_unwrap_key(key: PAES_KEY; const iv: PByte; out_: PByte; const in_: PByte; inlen: TIdC_UINT): TIdC_INT cdecl; external CLibCrypto; + +{$ENDIF} + +implementation + + uses + classes, + IdSSLOpenSSLExceptionHandlers, + IdResourceStringsOpenSSL + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + ,IdSSLOpenSSLLoader + {$ENDIF}; + + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +const + AES_options_procname = 'AES_options'; + + AES_set_encrypt_key_procname = 'AES_set_encrypt_key'; + AES_set_decrypt_key_procname = 'AES_set_decrypt_key'; + + AES_encrypt_procname = 'AES_encrypt'; + AES_decrypt_procname = 'AES_decrypt'; + + AES_ecb_encrypt_procname = 'AES_ecb_encrypt'; + AES_cbc_encrypt_procname = 'AES_cbc_encrypt'; + AES_cfb128_encrypt_procname = 'AES_cfb128_encrypt'; + AES_cfb1_encrypt_procname = 'AES_cfb1_encrypt'; + AES_cfb8_encrypt_procname = 'AES_cfb8_encrypt'; + AES_ofb128_encrypt_procname = 'AES_ofb128_encrypt'; + (* NB: the IV is _two_ blocks long *) + AES_ige_encrypt_procname = 'AES_ige_encrypt'; + (* NB: the IV is _four_ blocks long *) + AES_bi_ige_encrypt_procname = 'AES_bi_ige_encrypt'; + + AES_wrap_key_procname = 'AES_wrap_key'; + AES_unwrap_key_procname = 'AES_unwrap_key'; + + +{$WARN NO_RETVAL OFF} +function ERR_AES_options: PIdAnsiChar; +begin + EIdAPIFunctionNotPresent.RaiseException(AES_options_procname); +end; + + + +function ERR_AES_set_encrypt_key(const userKey: PByte; const bits: TIdC_INT; const key: PAES_KEY): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(AES_set_encrypt_key_procname); +end; + + +function ERR_AES_set_decrypt_key(const userKey: PByte; const bits: TIdC_INT; const key: PAES_KEY): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(AES_set_decrypt_key_procname); +end; + + + +procedure ERR_AES_encrypt(const in_: PByte; out_: PByte; const key: PAES_KEY); +begin + EIdAPIFunctionNotPresent.RaiseException(AES_encrypt_procname); +end; + + +procedure ERR_AES_decrypt(const in_: PByte; out_: PByte; const key: PAES_KEY); +begin + EIdAPIFunctionNotPresent.RaiseException(AES_decrypt_procname); +end; + + + +procedure ERR_AES_ecb_encrypt(const in_: PByte; out_: PByte; const key: PAES_KEY; const enc: TIdC_INT); +begin + EIdAPIFunctionNotPresent.RaiseException(AES_ecb_encrypt_procname); +end; + + +procedure ERR_AES_cbc_encrypt(const in_: PByte; out_: PByte; length: TIdC_SIZET; const key: PAES_KEY; ivec: PByte; const enc: TIdC_INT); +begin + EIdAPIFunctionNotPresent.RaiseException(AES_cbc_encrypt_procname); +end; + + +procedure ERR_AES_cfb128_encrypt(const in_: PByte; out_: PByte; length: TIdC_SIZET; const key: PAES_KEY; ivec: PByte; num: PIdC_INT; const enc: TIdC_INT); +begin + EIdAPIFunctionNotPresent.RaiseException(AES_cfb128_encrypt_procname); +end; + + +procedure ERR_AES_cfb1_encrypt(const in_: PByte; out_: PByte; length: TIdC_SIZET; const key: PAES_KEY; ivec: PByte; num: PIdC_INT; const enc: TIdC_INT); +begin + EIdAPIFunctionNotPresent.RaiseException(AES_cfb1_encrypt_procname); +end; + + +procedure ERR_AES_cfb8_encrypt(const in_: PByte; out_: PByte; length: TIdC_SIZET; const key: PAES_KEY; ivec: PByte; num: PIdC_INT; const enc: TIdC_INT); +begin + EIdAPIFunctionNotPresent.RaiseException(AES_cfb8_encrypt_procname); +end; + + +procedure ERR_AES_ofb128_encrypt(const in_: PByte; out_: PByte; length: TIdC_SIZET; const key: PAES_KEY; ivec: PByte; num: PIdC_INT); +begin + EIdAPIFunctionNotPresent.RaiseException(AES_ofb128_encrypt_procname); +end; + + + (* NB: the IV is _two_ blocks long *) +procedure ERR_AES_ige_encrypt(const in_: PByte; out_: PByte; length: TIdC_SIZET; const key: PAES_KEY; ivec: PByte; const enc: TIdC_INT); +begin + EIdAPIFunctionNotPresent.RaiseException(AES_ige_encrypt_procname); +end; + + + (* NB: the IV is _four_ blocks long *) +procedure ERR_AES_bi_ige_encrypt(const in_: PByte; out_: PByte; length: TIdC_SIZET; const key: PAES_KEY; const key2: PAES_KEY; ivec: PByte; const enc: TIdC_INT); +begin + EIdAPIFunctionNotPresent.RaiseException(AES_bi_ige_encrypt_procname); +end; + + + +function ERR_AES_wrap_key(key: PAES_KEY; const iv: PByte; out_: PByte; const in_: PByte; inlen: TIdC_UINT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(AES_wrap_key_procname); +end; + + +function ERR_AES_unwrap_key(key: PAES_KEY; const iv: PByte; out_: PByte; const in_: PByte; inlen: TIdC_UINT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(AES_unwrap_key_procname); +end; + + + +{$WARN NO_RETVAL ON} + +procedure Load(const ADllHandle: TIdLibHandle; LibVersion: TIdC_UINT; const AFailed: TStringList); + +var FuncLoadError: boolean; + +begin + AES_options := LoadLibFunction(ADllHandle, AES_options_procname); + FuncLoadError := not assigned(AES_options); + if FuncLoadError then + begin + {$if not defined(AES_options_allownil)} + AES_options := @ERR_AES_options; + {$ifend} + {$if declared(AES_options_introduced)} + if LibVersion < AES_options_introduced then + begin + {$if declared(FC_AES_options)} + AES_options := @FC_AES_options; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(AES_options_removed)} + if AES_options_removed <= LibVersion then + begin + {$if declared(_AES_options)} + AES_options := @_AES_options; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(AES_options_allownil)} + if FuncLoadError then + AFailed.Add('AES_options'); + {$ifend} + end; + + + AES_set_encrypt_key := LoadLibFunction(ADllHandle, AES_set_encrypt_key_procname); + FuncLoadError := not assigned(AES_set_encrypt_key); + if FuncLoadError then + begin + {$if not defined(AES_set_encrypt_key_allownil)} + AES_set_encrypt_key := @ERR_AES_set_encrypt_key; + {$ifend} + {$if declared(AES_set_encrypt_key_introduced)} + if LibVersion < AES_set_encrypt_key_introduced then + begin + {$if declared(FC_AES_set_encrypt_key)} + AES_set_encrypt_key := @FC_AES_set_encrypt_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(AES_set_encrypt_key_removed)} + if AES_set_encrypt_key_removed <= LibVersion then + begin + {$if declared(_AES_set_encrypt_key)} + AES_set_encrypt_key := @_AES_set_encrypt_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(AES_set_encrypt_key_allownil)} + if FuncLoadError then + AFailed.Add('AES_set_encrypt_key'); + {$ifend} + end; + + + AES_set_decrypt_key := LoadLibFunction(ADllHandle, AES_set_decrypt_key_procname); + FuncLoadError := not assigned(AES_set_decrypt_key); + if FuncLoadError then + begin + {$if not defined(AES_set_decrypt_key_allownil)} + AES_set_decrypt_key := @ERR_AES_set_decrypt_key; + {$ifend} + {$if declared(AES_set_decrypt_key_introduced)} + if LibVersion < AES_set_decrypt_key_introduced then + begin + {$if declared(FC_AES_set_decrypt_key)} + AES_set_decrypt_key := @FC_AES_set_decrypt_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(AES_set_decrypt_key_removed)} + if AES_set_decrypt_key_removed <= LibVersion then + begin + {$if declared(_AES_set_decrypt_key)} + AES_set_decrypt_key := @_AES_set_decrypt_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(AES_set_decrypt_key_allownil)} + if FuncLoadError then + AFailed.Add('AES_set_decrypt_key'); + {$ifend} + end; + + + AES_encrypt := LoadLibFunction(ADllHandle, AES_encrypt_procname); + FuncLoadError := not assigned(AES_encrypt); + if FuncLoadError then + begin + {$if not defined(AES_encrypt_allownil)} + AES_encrypt := @ERR_AES_encrypt; + {$ifend} + {$if declared(AES_encrypt_introduced)} + if LibVersion < AES_encrypt_introduced then + begin + {$if declared(FC_AES_encrypt)} + AES_encrypt := @FC_AES_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(AES_encrypt_removed)} + if AES_encrypt_removed <= LibVersion then + begin + {$if declared(_AES_encrypt)} + AES_encrypt := @_AES_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(AES_encrypt_allownil)} + if FuncLoadError then + AFailed.Add('AES_encrypt'); + {$ifend} + end; + + + AES_decrypt := LoadLibFunction(ADllHandle, AES_decrypt_procname); + FuncLoadError := not assigned(AES_decrypt); + if FuncLoadError then + begin + {$if not defined(AES_decrypt_allownil)} + AES_decrypt := @ERR_AES_decrypt; + {$ifend} + {$if declared(AES_decrypt_introduced)} + if LibVersion < AES_decrypt_introduced then + begin + {$if declared(FC_AES_decrypt)} + AES_decrypt := @FC_AES_decrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(AES_decrypt_removed)} + if AES_decrypt_removed <= LibVersion then + begin + {$if declared(_AES_decrypt)} + AES_decrypt := @_AES_decrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(AES_decrypt_allownil)} + if FuncLoadError then + AFailed.Add('AES_decrypt'); + {$ifend} + end; + + + AES_ecb_encrypt := LoadLibFunction(ADllHandle, AES_ecb_encrypt_procname); + FuncLoadError := not assigned(AES_ecb_encrypt); + if FuncLoadError then + begin + {$if not defined(AES_ecb_encrypt_allownil)} + AES_ecb_encrypt := @ERR_AES_ecb_encrypt; + {$ifend} + {$if declared(AES_ecb_encrypt_introduced)} + if LibVersion < AES_ecb_encrypt_introduced then + begin + {$if declared(FC_AES_ecb_encrypt)} + AES_ecb_encrypt := @FC_AES_ecb_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(AES_ecb_encrypt_removed)} + if AES_ecb_encrypt_removed <= LibVersion then + begin + {$if declared(_AES_ecb_encrypt)} + AES_ecb_encrypt := @_AES_ecb_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(AES_ecb_encrypt_allownil)} + if FuncLoadError then + AFailed.Add('AES_ecb_encrypt'); + {$ifend} + end; + + + AES_cbc_encrypt := LoadLibFunction(ADllHandle, AES_cbc_encrypt_procname); + FuncLoadError := not assigned(AES_cbc_encrypt); + if FuncLoadError then + begin + {$if not defined(AES_cbc_encrypt_allownil)} + AES_cbc_encrypt := @ERR_AES_cbc_encrypt; + {$ifend} + {$if declared(AES_cbc_encrypt_introduced)} + if LibVersion < AES_cbc_encrypt_introduced then + begin + {$if declared(FC_AES_cbc_encrypt)} + AES_cbc_encrypt := @FC_AES_cbc_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(AES_cbc_encrypt_removed)} + if AES_cbc_encrypt_removed <= LibVersion then + begin + {$if declared(_AES_cbc_encrypt)} + AES_cbc_encrypt := @_AES_cbc_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(AES_cbc_encrypt_allownil)} + if FuncLoadError then + AFailed.Add('AES_cbc_encrypt'); + {$ifend} + end; + + + AES_cfb128_encrypt := LoadLibFunction(ADllHandle, AES_cfb128_encrypt_procname); + FuncLoadError := not assigned(AES_cfb128_encrypt); + if FuncLoadError then + begin + {$if not defined(AES_cfb128_encrypt_allownil)} + AES_cfb128_encrypt := @ERR_AES_cfb128_encrypt; + {$ifend} + {$if declared(AES_cfb128_encrypt_introduced)} + if LibVersion < AES_cfb128_encrypt_introduced then + begin + {$if declared(FC_AES_cfb128_encrypt)} + AES_cfb128_encrypt := @FC_AES_cfb128_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(AES_cfb128_encrypt_removed)} + if AES_cfb128_encrypt_removed <= LibVersion then + begin + {$if declared(_AES_cfb128_encrypt)} + AES_cfb128_encrypt := @_AES_cfb128_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(AES_cfb128_encrypt_allownil)} + if FuncLoadError then + AFailed.Add('AES_cfb128_encrypt'); + {$ifend} + end; + + + AES_cfb1_encrypt := LoadLibFunction(ADllHandle, AES_cfb1_encrypt_procname); + FuncLoadError := not assigned(AES_cfb1_encrypt); + if FuncLoadError then + begin + {$if not defined(AES_cfb1_encrypt_allownil)} + AES_cfb1_encrypt := @ERR_AES_cfb1_encrypt; + {$ifend} + {$if declared(AES_cfb1_encrypt_introduced)} + if LibVersion < AES_cfb1_encrypt_introduced then + begin + {$if declared(FC_AES_cfb1_encrypt)} + AES_cfb1_encrypt := @FC_AES_cfb1_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(AES_cfb1_encrypt_removed)} + if AES_cfb1_encrypt_removed <= LibVersion then + begin + {$if declared(_AES_cfb1_encrypt)} + AES_cfb1_encrypt := @_AES_cfb1_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(AES_cfb1_encrypt_allownil)} + if FuncLoadError then + AFailed.Add('AES_cfb1_encrypt'); + {$ifend} + end; + + + AES_cfb8_encrypt := LoadLibFunction(ADllHandle, AES_cfb8_encrypt_procname); + FuncLoadError := not assigned(AES_cfb8_encrypt); + if FuncLoadError then + begin + {$if not defined(AES_cfb8_encrypt_allownil)} + AES_cfb8_encrypt := @ERR_AES_cfb8_encrypt; + {$ifend} + {$if declared(AES_cfb8_encrypt_introduced)} + if LibVersion < AES_cfb8_encrypt_introduced then + begin + {$if declared(FC_AES_cfb8_encrypt)} + AES_cfb8_encrypt := @FC_AES_cfb8_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(AES_cfb8_encrypt_removed)} + if AES_cfb8_encrypt_removed <= LibVersion then + begin + {$if declared(_AES_cfb8_encrypt)} + AES_cfb8_encrypt := @_AES_cfb8_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(AES_cfb8_encrypt_allownil)} + if FuncLoadError then + AFailed.Add('AES_cfb8_encrypt'); + {$ifend} + end; + + + AES_ofb128_encrypt := LoadLibFunction(ADllHandle, AES_ofb128_encrypt_procname); + FuncLoadError := not assigned(AES_ofb128_encrypt); + if FuncLoadError then + begin + {$if not defined(AES_ofb128_encrypt_allownil)} + AES_ofb128_encrypt := @ERR_AES_ofb128_encrypt; + {$ifend} + {$if declared(AES_ofb128_encrypt_introduced)} + if LibVersion < AES_ofb128_encrypt_introduced then + begin + {$if declared(FC_AES_ofb128_encrypt)} + AES_ofb128_encrypt := @FC_AES_ofb128_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(AES_ofb128_encrypt_removed)} + if AES_ofb128_encrypt_removed <= LibVersion then + begin + {$if declared(_AES_ofb128_encrypt)} + AES_ofb128_encrypt := @_AES_ofb128_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(AES_ofb128_encrypt_allownil)} + if FuncLoadError then + AFailed.Add('AES_ofb128_encrypt'); + {$ifend} + end; + + + AES_ige_encrypt := LoadLibFunction(ADllHandle, AES_ige_encrypt_procname); + FuncLoadError := not assigned(AES_ige_encrypt); + if FuncLoadError then + begin + {$if not defined(AES_ige_encrypt_allownil)} + AES_ige_encrypt := @ERR_AES_ige_encrypt; + {$ifend} + {$if declared(AES_ige_encrypt_introduced)} + if LibVersion < AES_ige_encrypt_introduced then + begin + {$if declared(FC_AES_ige_encrypt)} + AES_ige_encrypt := @FC_AES_ige_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(AES_ige_encrypt_removed)} + if AES_ige_encrypt_removed <= LibVersion then + begin + {$if declared(_AES_ige_encrypt)} + AES_ige_encrypt := @_AES_ige_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(AES_ige_encrypt_allownil)} + if FuncLoadError then + AFailed.Add('AES_ige_encrypt'); + {$ifend} + end; + + + AES_bi_ige_encrypt := LoadLibFunction(ADllHandle, AES_bi_ige_encrypt_procname); + FuncLoadError := not assigned(AES_bi_ige_encrypt); + if FuncLoadError then + begin + {$if not defined(AES_bi_ige_encrypt_allownil)} + AES_bi_ige_encrypt := @ERR_AES_bi_ige_encrypt; + {$ifend} + {$if declared(AES_bi_ige_encrypt_introduced)} + if LibVersion < AES_bi_ige_encrypt_introduced then + begin + {$if declared(FC_AES_bi_ige_encrypt)} + AES_bi_ige_encrypt := @FC_AES_bi_ige_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(AES_bi_ige_encrypt_removed)} + if AES_bi_ige_encrypt_removed <= LibVersion then + begin + {$if declared(_AES_bi_ige_encrypt)} + AES_bi_ige_encrypt := @_AES_bi_ige_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(AES_bi_ige_encrypt_allownil)} + if FuncLoadError then + AFailed.Add('AES_bi_ige_encrypt'); + {$ifend} + end; + + + AES_wrap_key := LoadLibFunction(ADllHandle, AES_wrap_key_procname); + FuncLoadError := not assigned(AES_wrap_key); + if FuncLoadError then + begin + {$if not defined(AES_wrap_key_allownil)} + AES_wrap_key := @ERR_AES_wrap_key; + {$ifend} + {$if declared(AES_wrap_key_introduced)} + if LibVersion < AES_wrap_key_introduced then + begin + {$if declared(FC_AES_wrap_key)} + AES_wrap_key := @FC_AES_wrap_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(AES_wrap_key_removed)} + if AES_wrap_key_removed <= LibVersion then + begin + {$if declared(_AES_wrap_key)} + AES_wrap_key := @_AES_wrap_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(AES_wrap_key_allownil)} + if FuncLoadError then + AFailed.Add('AES_wrap_key'); + {$ifend} + end; + + + AES_unwrap_key := LoadLibFunction(ADllHandle, AES_unwrap_key_procname); + FuncLoadError := not assigned(AES_unwrap_key); + if FuncLoadError then + begin + {$if not defined(AES_unwrap_key_allownil)} + AES_unwrap_key := @ERR_AES_unwrap_key; + {$ifend} + {$if declared(AES_unwrap_key_introduced)} + if LibVersion < AES_unwrap_key_introduced then + begin + {$if declared(FC_AES_unwrap_key)} + AES_unwrap_key := @FC_AES_unwrap_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(AES_unwrap_key_removed)} + if AES_unwrap_key_removed <= LibVersion then + begin + {$if declared(_AES_unwrap_key)} + AES_unwrap_key := @_AES_unwrap_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(AES_unwrap_key_allownil)} + if FuncLoadError then + AFailed.Add('AES_unwrap_key'); + {$ifend} + end; + + +end; + +procedure Unload; +begin + AES_options := nil; + AES_set_encrypt_key := nil; + AES_set_decrypt_key := nil; + AES_encrypt := nil; + AES_decrypt := nil; + AES_ecb_encrypt := nil; + AES_cbc_encrypt := nil; + AES_cfb128_encrypt := nil; + AES_cfb1_encrypt := nil; + AES_cfb8_encrypt := nil; + AES_ofb128_encrypt := nil; + AES_ige_encrypt := nil; + AES_bi_ige_encrypt := nil; + AES_wrap_key := nil; + AES_unwrap_key := nil; +end; +{$ELSE} +{$ENDIF} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +initialization + Register_SSLLoader(@Load,'LibCrypto'); + Register_SSLUnloader(@Unload); +{$ENDIF} +end. diff --git a/IdOpenSSLHeaders_asn1.pas b/IdOpenSSLHeaders_asn1.pas new file mode 100644 index 0000000..196d093 --- /dev/null +++ b/IdOpenSSLHeaders_asn1.pas @@ -0,0 +1,8910 @@ + (* This unit was generated using the script genOpenSSLHdrs.sh from the source file IdOpenSSLHeaders_asn1.h2pas + It should not be modified directly. All changes should be made to IdOpenSSLHeaders_asn1.h2pas + and this file regenerated. IdOpenSSLHeaders_asn1.h2pas is distributed with the full Indy + Distribution. + *) + +{$i IdCompilerDefines.inc} +{$i IdSSLOpenSSLDefines.inc} +{$IFNDEF USE_OPENSSL} + { error Should not compile if USE_OPENSSL is not defined!!!} +{$ENDIF} +{******************************************************************************} +{ } +{ Indy (Internet Direct) - Internet Protocols Simplified } +{ } +{ https://www.indyproject.org/ } +{ https://gitter.im/IndySockets/Indy } +{ } +{******************************************************************************} +{ } +{ This file is part of the Indy (Internet Direct) project, and is offered } +{ under the dual-licensing agreement described on the Indy website. } +{ (https://www.indyproject.org/license/) } +{ } +{ Copyright: } +{ (c) 1993-2020, Chad Z. Hower and the Indy Pit Crew. All rights reserved. } +{ } +{******************************************************************************} +{ } +{ } +{******************************************************************************} + +unit IdOpenSSLHeaders_asn1; + +interface + +// Headers for OpenSSL 1.1.1 +// asn1.h + + +uses + IdCTypes, + IdGlobal, + IdSSLOpenSSLConsts, + IdOpenSSLHeaders_asn1t, + IdOpenSSLHeaders_bio, + IdOpenSSlHeaders_ossl_typ; + +{$MINENUMSIZE 4} + +const + (* + * NB the constants below are used internally by ASN1_INTEGER + * and ASN1_ENUMERATED to indicate the sign. They are *not* on + * the wire tag values. + *) + + V_ASN1_NEG = $100; + V_ASN1_NEG_INTEGER = 2 or V_ASN1_NEG; + V_ASN1_NEG_ENUMERATED = 10 or V_ASN1_NEG; + + (* For use with d2i_ASN1_type_bytes() *) + B_ASN1_NUMERICSTRING = $0001; + B_ASN1_PRINTABLESTRING = $0002; + B_ASN1_T61STRING = $0004; + B_ASN1_TELETEXSTRING = $0004; + B_ASN1_VIDEOTEXSTRING = $0008; + B_ASN1_IA5STRING = $0010; + B_ASN1_GRAPHICSTRING = $0020; + B_ASN1_ISO64STRING = $0040; + B_ASN1_VISIBLESTRING = $0040; + B_ASN1_GENERALSTRING = $0080; + B_ASN1_UNIVERSALSTRING = $0100; + B_ASN1_OCTET_STRING = $0200; + B_ASN1_BIT_STRING = $0400; + B_ASN1_BMPSTRING = $0800; + B_ASN1_UNKNOWN = $1000; + B_ASN1_UTF8STRING = $2000; + B_ASN1_UTCTIME = $4000; + B_ASN1_GENERALIZEDTIME = $8000; + B_ASN1_SEQUENCE = $10000; + (* For use with ASN1_mbstring_copy() *) + MBSTRING_FLAG = $1000; + MBSTRING_UTF8 = MBSTRING_FLAG; + MBSTRING_ASC = MBSTRING_FLAG or 1; + MBSTRING_BMP = MBSTRING_FLAG or 2; + MBSTRING_UNIV = MBSTRING_FLAG or 4; + SMIME_OLDMIME = $400; + SMIME_CRLFEOL = $800; + SMIME_STREAM = $1000; + +// struct X509_algor_st; +//DEFINE_STACK_OF(X509_ALGOR) + + ASN1_STRING_FLAG_BITS_LEFT = $08; (* Set if $07 has bits left value *) + (* + * This indicates that the ASN1_STRING is not a real value but just a place + * holder for the location where indefinite length constructed data should be + * inserted in the memory buffer + *) + ASN1_STRING_FLAG_NDEF = $010; + + (* + * This flag is used by the CMS code to indicate that a string is not + * complete and is a place holder for content when it had all been accessed. + * The flag will be reset when content has been written to it. + *) + + ASN1_STRING_FLAG_CONT = $020; + (* + * This flag is used by ASN1 code to indicate an ASN1_STRING is an MSTRING + * type. + *) + ASN1_STRING_FLAG_MSTRING = $040; + (* String is embedded and only content should be freed *) + ASN1_STRING_FLAG_EMBED = $080; + (* String should be parsed in RFC 5280's time format *) + ASN1_STRING_FLAG_X509_TIME = $100; + + (* Used with ASN1 LONG type: if a long is set to this it is omitted *) + ASN1_LONG_UNDEF = TIdC_LONG($7fffffff); + + STABLE_FLAGS_MALLOC = $01; + (* + * A zero passed to ASN1_STRING_TABLE_new_add for the flags is interpreted + * as "don't change" and STABLE_FLAGS_MALLOC is always set. By setting + * STABLE_FLAGS_MALLOC only we can clear the existing value. Use the alias + * STABLE_FLAGS_CLEAR to reflect this. + *) + STABLE_FLAGS_CLEAR = STABLE_FLAGS_MALLOC; + STABLE_NO_MASK = $02; + DIRSTRING_TYPE = B_ASN1_PRINTABLESTRING or B_ASN1_T61STRING or B_ASN1_BMPSTRING or B_ASN1_UTF8STRING; + PKCS9STRING_TYPE = DIRSTRING_TYPE or B_ASN1_IA5STRING; + + (* size limits: this stuff is taken straight from RFC2459 *) + ub_name = 32768; + ub_common_name = 64; + ub_locality_name = 128; + ub_state_name = 128; + ub_organization_name = 64; + ub_organization_unit_name = 64; + ub_title = 64; + ub_email_address = 128; + + (* Parameters used by ASN1_STRING_print_ex() *) + + (* + * These determine which characters to escape: RFC2253 special characters, + * control characters and MSB set characters + *) + ASN1_STRFLGS_ESC_2253 = 1; + ASN1_STRFLGS_ESC_CTRL = 2; + ASN1_STRFLGS_ESC_MSB = 4; + + (* + * This flag determines how we do escaping: normally RC2253 backslash only, + * set this to use backslash and quote. + *) + + ASN1_STRFLGS_ESC_QUOTE = 8; + + (* These three flags are internal use only. *) + + (* Character is a valid PrintableString character *) + CHARTYPE_PRINTABLESTRING = $10; + (* Character needs escaping if it is the first character *) + CHARTYPE_FIRST_ESC_2253 = $20; + (* Character needs escaping if it is the last character *) + CHARTYPE_LAST_ESC_2253 = $40; + + (* + * NB the internal flags are safely reused below by flags handled at the top + * level. + *) + + (* + * If this is set we convert all character strings to UTF8 first + *) + + ASN1_STRFLGS_UTF8_CONVERT = $10; + + (* + * If this is set we don't attempt to interpret content: just assume all + * strings are 1 byte per character. This will produce some pretty odd + * looking output! + *) + + ASN1_STRFLGS_IGNORE_TYPE = $20; + + (* If this is set we include the string type in the output *) + ASN1_STRFLGS_SHOW_TYPE = $40; + + (* + * This determines which strings to display and which to 'dump' (hex dump of + * content octets or DER encoding). We can only dump non character strings or + * everything. If we don't dump 'unknown' they are interpreted as character + * strings with 1 octet per character and are subject to the usual escaping + * options. + *) + + ASN1_STRFLGS_DUMP_ALL = $80; + ASN1_STRFLGS_DUMP_UNKNOWN = $100; + + (* + * These determine what 'dumping' does, we can dump the content octets or the + * DER encoding: both use the RFC2253 #XXXXX notation. + *) + + ASN1_STRFLGS_DUMP_DER = $200; + + (* + * This flag specifies that RC2254 escaping shall be performed. + *) + + ASN1_STRFLGS_ESC_2254 = $400; + + (* + * All the string flags consistent with RFC2253, escaping control characters + * isn't essential in RFC2253 but it is advisable anyway. + *) + + ASN1_STRFLGS_RFC2253 = ASN1_STRFLGS_ESC_2253 or ASN1_STRFLGS_ESC_CTRL or + ASN1_STRFLGS_ESC_MSB or ASN1_STRFLGS_UTF8_CONVERT or + ASN1_STRFLGS_DUMP_UNKNOWN or ASN1_STRFLGS_DUMP_DER; + + B_ASN1_TIME = B_ASN1_UTCTIME or B_ASN1_GENERALIZEDTIME; + + B_ASN1_PRINTABLE = B_ASN1_NUMERICSTRING or B_ASN1_PRINTABLESTRING or + B_ASN1_T61STRING or B_ASN1_IA5STRING or B_ASN1_BIT_STRING or + B_ASN1_UNIVERSALSTRING or B_ASN1_BMPSTRING or B_ASN1_UTF8STRING or + B_ASN1_SEQUENCE or B_ASN1_UNKNOWN; + + B_ASN1_DIRECTORYSTRING = B_ASN1_PRINTABLESTRING or B_ASN1_TELETEXSTRING or + B_ASN1_BMPSTRING or B_ASN1_UNIVERSALSTRING or B_ASN1_UTF8STRING; + + B_ASN1_DISPLAYTEXT = B_ASN1_IA5STRING or B_ASN1_VISIBLESTRING or + B_ASN1_BMPSTRING or B_ASN1_UTF8STRING; + + (* ASN1 Print flags *) + (* Indicate missing OPTIONAL fields *) + ASN1_PCTX_FLAGS_SHOW_ABSENT = $001; + (* Mark start and end of SEQUENCE *) + ASN1_PCTX_FLAGS_SHOW_SEQUENCE = $002; + (* Mark start and end of SEQUENCE/SET OF *) + ASN1_PCTX_FLAGS_SHOW_SSOF = $004; + (* Show the ASN1 type of primitives *) + ASN1_PCTX_FLAGS_SHOW_TYPE = $008; + (* Don't show ASN1 type of ANY *) + ASN1_PCTX_FLAGS_NO_ANY_TYPE = $010; + (* Don't show ASN1 type of MSTRINGs *) + ASN1_PCTX_FLAGS_NO_MSTRING_TYPE = $020; + (* Don't show field names in SEQUENCE *) + ASN1_PCTX_FLAGS_NO_FIELD_NAME = $040; + (* Show structure names of each SEQUENCE field *) + ASN1_PCTX_FLAGS_SHOW_FIELD_STRUCT_NAME = $080; + (* Don't show structure name even at top level *) + ASN1_PCTX_FLAGS_NO_STRUCT_NAME = $100; + +type +// Moved to ossl_type to prevent circular references +///(* This is the base type that holds just about everything :-) *) +// asn1_string_st = record +// length: TIdC_int; +// type_: TIdC_int; +// data: PByte; +// (* +// * The value of the following field depends on the type being held. It +// * is mostly being used for BIT_STRING so if the input data has a +// * non-zero 'unused bits' value, it will be handled correctly +// *) +// flags: TIdC_long; +// end; + + pxnew = function: Pointer; cdecl; + pd2i_of_void = function(val_out: PPointer; const der_in: PPByte; length: TIdC_LONG): Pointer; cdecl; + (* + * ASN1_ENCODING structure: this is used to save the received encoding of an + * ASN1 type. This is useful to get round problems with invalid encodings + * which can break signatures. + *) + + ASN1_ENCODING_st = record + enc: PIdAnsiChar; (* DER encoding *) + len: TIdC_LONG; (* Length of encoding *) + modified: TIdC_INT; (* set to 1 if 'enc' is invalid *) + end; + ASN1_ENCODING = ASN1_ENCODING_st; + + asn1_string_table_st = record + nid: TIdC_INT; + minsize: TIdC_LONG; + maxsize: TIdC_LONG; + mask: TIdC_ULONG; + flags: TIdC_ULONG; + end; + ASN1_STRING_TABLE = asn1_string_table_st; + PASN1_STRING_TABLE = ^ASN1_STRING_TABLE; + +// DEFINE_STACK_OF(ASN1_STRING_TABLE) + + (* !!! + * Declarations for template structures: for full definitions see asn1t.h + *) + (* This is just an opaque pointer *) +// typedef struct ASN1_VALUE_st ASN1_VALUE; + + (* Declare ASN1 functions: the implement macro in in asn1t.h *) + +//# define DECLARE_ASN1_FUNCTIONS(type) DECLARE_ASN1_FUNCTIONS_name(type, type) +// +//# define DECLARE_ASN1_ALLOC_FUNCTIONS(type) \ +// DECLARE_ASN1_ALLOC_FUNCTIONS_name(type, type) +// +//# define DECLARE_ASN1_FUNCTIONS_name(type, name) \ +// DECLARE_ASN1_ALLOC_FUNCTIONS_name(type, name) \ +// DECLARE_ASN1_ENCODE_FUNCTIONS(type, name, name) +// +//# define DECLARE_ASN1_FUNCTIONS_fname(type, itname, name) \ +// DECLARE_ASN1_ALLOC_FUNCTIONS_name(type, name) \ +// DECLARE_ASN1_ENCODE_FUNCTIONS(type, itname, name) +// +//# define DECLARE_ASN1_ENCODE_FUNCTIONS(type, itname, name) \ +// type *d2i_##name(type **a, const unsigned char **in, long len); \ +// int i2d_##name(type *a, unsigned char **out); \ +// DECLARE_ASN1_ITEM(itname) +// +//# define DECLARE_ASN1_ENCODE_FUNCTIONS_const(type, name) \ +// type *d2i_##name(type **a, const unsigned char **in, long len); \ +// int i2d_##name(const type *a, unsigned char **out); \ +// DECLARE_ASN1_ITEM(name) +// +//# define DECLARE_ASN1_NDEF_FUNCTION(name) \ +// int i2d_##name##_NDEF(name *a, unsigned char **out); +// +//# define DECLARE_ASN1_FUNCTIONS_const(name) \ +// DECLARE_ASN1_ALLOC_FUNCTIONS(name) \ +// DECLARE_ASN1_ENCODE_FUNCTIONS_const(name, name) +// +//# define DECLARE_ASN1_ALLOC_FUNCTIONS_name(type, name) \ +// type *name##_new(void); \ +// void name##_free(type *a); +// +//# define DECLARE_ASN1_PRINT_FUNCTION(stname) \ +// DECLARE_ASN1_PRINT_FUNCTION_fname(stname, stname) +// +//# define DECLARE_ASN1_PRINT_FUNCTION_fname(stname, fname) \ +// int fname##_print_ctx(BIO *out, stname *x, int indent, \ +// const ASN1_PCTX *pctx); +// +//# define D2I_OF(type) type *(*)(type **,const unsigned char **,long) +//# define I2D_OF(type) int (*)(type *,unsigned char **) +//# define I2D_OF_const(type) int (*)(const type *,unsigned char **) +// +//# define CHECKED_D2I_OF(type, d2i) \ +// ((d2i_of_void*) (1 ? d2i : ((D2I_OF(type))0))) +//# define CHECKED_I2D_OF(type, i2d) \ +// ((i2d_of_void*) (1 ? i2d : ((I2D_OF(type))0))) +//# define CHECKED_NEW_OF(type, xnew) \ +// ((void *(*)(void)) (1 ? xnew : ((type *(*)(void))0))) +//# define CHECKED_PTR_OF(type, p) \ +// ((void*) (1 ? p : (type*)0)) +//# define CHECKED_PPTR_OF(type, p) \ +// ((void**) (1 ? p : (type**)0)) +// +//# define TYPEDEF_D2I_OF(type) typedef type *d2i_of_##type(type **,const unsigned char **,long) +//# define TYPEDEF_I2D_OF(type) typedef int i2d_of_##type(type *,unsigned char **) +//# define TYPEDEF_D2I2D_OF(type) TYPEDEF_D2I_OF(type); TYPEDEF_I2D_OF(type) +// +//TYPEDEF_D2I2D_OF(void); + + (*- + * The following macros and typedefs allow an ASN1_ITEM + * to be embedded in a structure and referenced. Since + * the ASN1_ITEM pointers need to be globally accessible + * (possibly from shared libraries) they may exist in + * different forms. On platforms that support it the + * ASN1_ITEM structure itself will be globally exported. + * Other platforms will export a function that returns + * an ASN1_ITEM pointer. + * + * To handle both cases transparently the macros below + * should be used instead of hard coding an ASN1_ITEM + * pointer in a structure. + * + * The structure will look like this: + * + * typedef struct SOMETHING_st { + * ... + * ASN1_ITEM_EXP *iptr; + * ... + * } SOMETHING; + * + * It would be initialised as e.g.: + * + * SOMETHING somevar = {...,ASN1_ITEM_ref(X509),...}; + * + * and the actual pointer extracted with: + * + * const ASN1_ITEM *it = ASN1_ITEM_ptr(somevar.iptr); + * + * Finally an ASN1_ITEM pointer can be extracted from an + * appropriate reference with: ASN1_ITEM_rptr(X509). This + * would be used when a function takes an ASN1_ITEM * argument. + * + *) + +// # ifndef OPENSSL_EXPORT_VAR_AS_FUNCTION + +///(* ASN1_ITEM pointer exported type *) +//typedef const ASN1_ITEM ASN1_ITEM_EXP; +// +///(* Macro to obtain ASN1_ITEM pointer from exported type *) +//# define ASN1_ITEM_ptr(iptr) (iptr) +// +// (* Macro to include ASN1_ITEM pointer from base type *) +//# define ASN1_ITEM_ref(iptr) (&(iptr##_it)) +// +//# define ASN1_ITEM_rptr(ref) (&(ref##_it)) +// +//# define DECLARE_ASN1_ITEM(name) \ +// OPENSSL_EXTERN const ASN1_ITEM name##_it; +// +//# else + +// (* +// * Platforms that can't easily handle shared global variables are declared as +// * functions returning ASN1_ITEM pointers. +// *) + +///(* ASN1_ITEM pointer exported type *) +//typedef const ASN1_ITEM *ASN1_ITEM_EXP (void); +// +///(* Macro to obtain ASN1_ITEM pointer from exported type *) +//# define ASN1_ITEM_ptr(iptr) (iptr()) +// +///(* Macro to include ASN1_ITEM pointer from base type *) +//# define ASN1_ITEM_ref(iptr) (iptr##_it) +// +//# define ASN1_ITEM_rptr(ref) (ref##_it()) +// +//# define DECLARE_ASN1_ITEM(name) \ +// const ASN1_ITEM * name##_it(void); +// +//# endif + +//DEFINE_STACK_OF(ASN1_INTEGER) +// +//DEFINE_STACK_OF(ASN1_GENERALSTRING) +// +//DEFINE_STACK_OF(ASN1_UTF8STRING) + +//DEFINE_STACK_OF(ASN1_TYPE) +// +//typedef STACK_OF(ASN1_TYPE) ASN1_SEQUENCE_ANY; +// +//DECLARE_ASN1_ENCODE_FUNCTIONS_const(ASN1_SEQUENCE_ANY, ASN1_SEQUENCE_ANY) +//DECLARE_ASN1_ENCODE_FUNCTIONS_const(ASN1_SEQUENCE_ANY, ASN1_SET_ANY) + + (* This is used to contain a list of bit names *) + + BIT_STRING_BITNAME_st = record + bitnum: TIdC_INT; + lname: PIdAnsiChar; + sname: PIdAnsiChar; + end; + BIT_STRING_BITNAME = BIT_STRING_BITNAME_st; + PBIT_STRING_BITNAME = ^BIT_STRING_BITNAME; + +//DECLARE_ASN1_FUNCTIONS(type) --> +// type *name##_new(void); \ +// void name##_free(type *a); +// type *d2i_##name(type **a, const unsigned char **in, long len); \ +// int i2d_##name(type *a, unsigned char **out); \ +//# define DECLARE_ASN1_ITEM(name) \ +// OPENSSL_EXTERN const ASN1_ITEM name##_it; + +// DECLARE_ASN1_FUNCTIONS_fname(ASN1_TYPE, ASN1_ANY, ASN1_TYPE) + { The EXTERNALSYM directive is ignored by FPC, however, it is used by Delphi as follows: + + The EXTERNALSYM directive prevents the specified Delphi symbol from appearing in header + files generated for C++. } + + {$EXTERNALSYM ASN1_TYPE_get} + {$EXTERNALSYM ASN1_TYPE_set} + {$EXTERNALSYM ASN1_TYPE_set1} + {$EXTERNALSYM ASN1_TYPE_cmp} + {$EXTERNALSYM ASN1_TYPE_pack_sequence} {introduced 1.1.0} + {$EXTERNALSYM ASN1_TYPE_unpack_sequence} {introduced 1.1.0} + {$EXTERNALSYM ASN1_OBJECT_new} + {$EXTERNALSYM ASN1_OBJECT_free} + {$EXTERNALSYM i2d_ASN1_OBJECT} + {$EXTERNALSYM d2i_ASN1_OBJECT} + {$EXTERNALSYM ASN1_STRING_new} + {$EXTERNALSYM ASN1_STRING_free} + {$EXTERNALSYM ASN1_STRING_clear_free} + {$EXTERNALSYM ASN1_STRING_copy} + {$EXTERNALSYM ASN1_STRING_dup} + {$EXTERNALSYM ASN1_STRING_type_new} + {$EXTERNALSYM ASN1_STRING_cmp} + {$EXTERNALSYM ASN1_STRING_set} + {$EXTERNALSYM ASN1_STRING_set0} + {$EXTERNALSYM ASN1_STRING_length} + {$EXTERNALSYM ASN1_STRING_length_set} + {$EXTERNALSYM ASN1_STRING_type} + {$EXTERNALSYM ASN1_STRING_get0_data} {introduced 1.1.0} + {$EXTERNALSYM ASN1_BIT_STRING_set} + {$EXTERNALSYM ASN1_BIT_STRING_set_bit} + {$EXTERNALSYM ASN1_BIT_STRING_get_bit} + {$EXTERNALSYM ASN1_BIT_STRING_check} + {$EXTERNALSYM ASN1_BIT_STRING_name_print} + {$EXTERNALSYM ASN1_BIT_STRING_num_asc} + {$EXTERNALSYM ASN1_BIT_STRING_set_asc} + {$EXTERNALSYM ASN1_INTEGER_new} + {$EXTERNALSYM ASN1_INTEGER_free} + {$EXTERNALSYM d2i_ASN1_INTEGER} + {$EXTERNALSYM i2d_ASN1_INTEGER} + {$EXTERNALSYM d2i_ASN1_UINTEGER} + {$EXTERNALSYM ASN1_INTEGER_dup} + {$EXTERNALSYM ASN1_INTEGER_cmp} + {$EXTERNALSYM ASN1_UTCTIME_check} + {$EXTERNALSYM ASN1_UTCTIME_set} + {$EXTERNALSYM ASN1_UTCTIME_adj} + {$EXTERNALSYM ASN1_UTCTIME_set_string} + {$EXTERNALSYM ASN1_UTCTIME_cmp_time_t} + {$EXTERNALSYM ASN1_GENERALIZEDTIME_check} + {$EXTERNALSYM ASN1_GENERALIZEDTIME_set} + {$EXTERNALSYM ASN1_GENERALIZEDTIME_adj} + {$EXTERNALSYM ASN1_GENERALIZEDTIME_set_string} + {$EXTERNALSYM ASN1_TIME_diff} + {$EXTERNALSYM ASN1_OCTET_STRING_dup} + {$EXTERNALSYM ASN1_OCTET_STRING_cmp} + {$EXTERNALSYM ASN1_OCTET_STRING_set} + {$EXTERNALSYM ASN1_OCTET_STRING_free} + {$EXTERNALSYM UTF8_getc} + {$EXTERNALSYM UTF8_putc} + {$EXTERNALSYM ASN1_UTCTIME_new} + {$EXTERNALSYM ASN1_UTCTIME_free} + {$EXTERNALSYM d2i_ASN1_UTCTIME} + {$EXTERNALSYM i2d_ASN1_UTCTIME} + {$EXTERNALSYM ASN1_GENERALIZEDTIME_new} + {$EXTERNALSYM ASN1_GENERALIZEDTIME_free} + {$EXTERNALSYM d2i_ASN1_GENERALIZEDTIME} + {$EXTERNALSYM i2d_ASN1_GENERALIZEDTIME} + {$EXTERNALSYM ASN1_TIME_new} + {$EXTERNALSYM ASN1_TIME_free} + {$EXTERNALSYM d2i_ASN1_TIME} + {$EXTERNALSYM i2d_ASN1_TIME} + {$EXTERNALSYM ASN1_TIME_set} + {$EXTERNALSYM ASN1_TIME_adj} + {$EXTERNALSYM ASN1_TIME_check} + {$EXTERNALSYM ASN1_TIME_to_generalizedtime} + {$EXTERNALSYM ASN1_TIME_set_string} + {$EXTERNALSYM ASN1_TIME_set_string_X509} {introduced 1.1.0} + {$EXTERNALSYM ASN1_TIME_to_tm} {introduced 1.1.0} + {$EXTERNALSYM ASN1_TIME_normalize} {introduced 1.1.0} + {$EXTERNALSYM ASN1_TIME_cmp_time_t} {introduced 1.1.0} + {$EXTERNALSYM ASN1_TIME_compare} {introduced 1.1.0} + {$EXTERNALSYM i2a_ASN1_INTEGER} + {$EXTERNALSYM a2i_ASN1_INTEGER} + {$EXTERNALSYM i2a_ASN1_ENUMERATED} + {$EXTERNALSYM a2i_ASN1_ENUMERATED} + {$EXTERNALSYM i2a_ASN1_OBJECT} + {$EXTERNALSYM a2i_ASN1_STRING} + {$EXTERNALSYM i2a_ASN1_STRING} + {$EXTERNALSYM i2t_ASN1_OBJECT} + {$EXTERNALSYM a2d_ASN1_OBJECT} + {$EXTERNALSYM ASN1_OBJECT_create} + {$EXTERNALSYM ASN1_INTEGER_get_int64} {introduced 1.1.0} + {$EXTERNALSYM ASN1_INTEGER_set_int64} {introduced 1.1.0} + {$EXTERNALSYM ASN1_INTEGER_get_uint64} {introduced 1.1.0} + {$EXTERNALSYM ASN1_INTEGER_set_uint64} {introduced 1.1.0} + {$EXTERNALSYM ASN1_INTEGER_set} + {$EXTERNALSYM ASN1_INTEGER_get} + {$EXTERNALSYM BN_to_ASN1_INTEGER} + {$EXTERNALSYM ASN1_INTEGER_to_BN} + {$EXTERNALSYM ASN1_ENUMERATED_get_int64} {introduced 1.1.0} + {$EXTERNALSYM ASN1_ENUMERATED_set_int64} {introduced 1.1.0} + {$EXTERNALSYM ASN1_ENUMERATED_set} + {$EXTERNALSYM ASN1_ENUMERATED_get} + {$EXTERNALSYM BN_to_ASN1_ENUMERATED} + {$EXTERNALSYM ASN1_ENUMERATED_to_BN} + {$EXTERNALSYM ASN1_PRINTABLE_type} + {$EXTERNALSYM ASN1_tag2bit} + {$EXTERNALSYM ASN1_get_object} + {$EXTERNALSYM ASN1_check_infinite_end} + {$EXTERNALSYM ASN1_const_check_infinite_end} + {$EXTERNALSYM ASN1_put_object} + {$EXTERNALSYM ASN1_put_eoc} + {$EXTERNALSYM ASN1_object_size} + {$EXTERNALSYM ASN1_item_dup} + {$EXTERNALSYM ASN1_STRING_to_UTF8} + {$EXTERNALSYM ASN1_item_d2i_bio} + {$EXTERNALSYM ASN1_i2d_bio} + {$EXTERNALSYM ASN1_item_i2d_bio} + {$EXTERNALSYM ASN1_UTCTIME_print} + {$EXTERNALSYM ASN1_GENERALIZEDTIME_print} + {$EXTERNALSYM ASN1_TIME_print} + {$EXTERNALSYM ASN1_STRING_print} + {$EXTERNALSYM ASN1_STRING_print_ex} + {$EXTERNALSYM ASN1_buf_print} {introduced 1.1.0} + {$EXTERNALSYM ASN1_bn_print} + {$EXTERNALSYM ASN1_parse} + {$EXTERNALSYM ASN1_parse_dump} + {$EXTERNALSYM ASN1_tag2str} + {$EXTERNALSYM ASN1_UNIVERSALSTRING_to_string} + {$EXTERNALSYM ASN1_TYPE_set_octetstring} + {$EXTERNALSYM ASN1_TYPE_get_octetstring} + {$EXTERNALSYM ASN1_TYPE_set_int_octetstring} + {$EXTERNALSYM ASN1_TYPE_get_int_octetstring} + {$EXTERNALSYM ASN1_item_unpack} + {$EXTERNALSYM ASN1_item_pack} + {$EXTERNALSYM ASN1_STRING_set_default_mask} + {$EXTERNALSYM ASN1_STRING_set_default_mask_asc} + {$EXTERNALSYM ASN1_STRING_get_default_mask} + {$EXTERNALSYM ASN1_mbstring_copy} + {$EXTERNALSYM ASN1_mbstring_ncopy} + {$EXTERNALSYM ASN1_STRING_set_by_NID} + {$EXTERNALSYM ASN1_STRING_TABLE_get} + {$EXTERNALSYM ASN1_STRING_TABLE_add} + {$EXTERNALSYM ASN1_STRING_TABLE_cleanup} + {$EXTERNALSYM ASN1_item_new} + {$EXTERNALSYM ASN1_item_free} + {$EXTERNALSYM ASN1_item_d2i} + {$EXTERNALSYM ASN1_item_i2d} + {$EXTERNALSYM ASN1_item_ndef_i2d} + {$EXTERNALSYM ASN1_add_oid_module} + {$EXTERNALSYM ASN1_add_stable_module} {introduced 1.1.0} + {$EXTERNALSYM ASN1_generate_nconf} + {$EXTERNALSYM ASN1_generate_v3} + {$EXTERNALSYM ASN1_str2mask} {introduced 1.1.0} + {$EXTERNALSYM ASN1_item_print} + {$EXTERNALSYM ASN1_PCTX_new} + {$EXTERNALSYM ASN1_PCTX_free} + {$EXTERNALSYM ASN1_PCTX_get_flags} + {$EXTERNALSYM ASN1_PCTX_set_flags} + {$EXTERNALSYM ASN1_PCTX_get_nm_flags} + {$EXTERNALSYM ASN1_PCTX_set_nm_flags} + {$EXTERNALSYM ASN1_PCTX_get_cert_flags} + {$EXTERNALSYM ASN1_PCTX_set_cert_flags} + {$EXTERNALSYM ASN1_PCTX_get_oid_flags} + {$EXTERNALSYM ASN1_PCTX_set_oid_flags} + {$EXTERNALSYM ASN1_PCTX_get_str_flags} + {$EXTERNALSYM ASN1_PCTX_set_str_flags} + {$EXTERNALSYM ASN1_SCTX_free} {introduced 1.1.0} + {$EXTERNALSYM ASN1_SCTX_get_item} {introduced 1.1.0} + {$EXTERNALSYM ASN1_SCTX_get_template} {introduced 1.1.0} + {$EXTERNALSYM ASN1_SCTX_get_flags} {introduced 1.1.0} + {$EXTERNALSYM ASN1_SCTX_set_app_data} {introduced 1.1.0} + {$EXTERNALSYM ASN1_SCTX_get_app_data} {introduced 1.1.0} + {$EXTERNALSYM BIO_f_asn1} + {$EXTERNALSYM BIO_new_NDEF} + {$EXTERNALSYM i2d_ASN1_bio_stream} + {$EXTERNALSYM PEM_write_bio_ASN1_stream} + {$EXTERNALSYM SMIME_read_ASN1} + {$EXTERNALSYM SMIME_crlf_copy} + {$EXTERNALSYM SMIME_text} + {$EXTERNALSYM ASN1_ITEM_lookup} {introduced 1.1.0} + {$EXTERNALSYM ASN1_ITEM_get} {introduced 1.1.0} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +var + ASN1_TYPE_get: function (const a: PASN1_TYPE): TIdC_INT; cdecl = nil; + ASN1_TYPE_set: procedure (a: PASN1_TYPE; type_: TIdC_INT; value: Pointer); cdecl = nil; + ASN1_TYPE_set1: function (a: PASN1_TYPE; type_: TIdC_INT; const value: Pointer): TIdC_INT; cdecl = nil; + ASN1_TYPE_cmp: function (const a: PASN1_TYPE; const b: PASN1_TYPE): TIdC_INT; cdecl = nil; + + ASN1_TYPE_pack_sequence: function (const it: PASN1_ITEM; s: Pointer; t: PPASN1_TYPE): PASN1_TYPE; cdecl = nil; {introduced 1.1.0} + ASN1_TYPE_unpack_sequence: function (const it: PASN1_ITEM; const t: PASN1_TYPE): Pointer; cdecl = nil; {introduced 1.1.0} + + ASN1_OBJECT_new: function : PASN1_OBJECT; cdecl = nil; + ASN1_OBJECT_free: procedure (a: PASN1_OBJECT); cdecl = nil; + i2d_ASN1_OBJECT: function (const a: PASN1_OBJECT; pp: PPByte): TIdC_INT; cdecl = nil; + d2i_ASN1_OBJECT: function (a: PPASN1_OBJECT; const pp: PPByte; length: TIdC_LONG): PASN1_OBJECT; cdecl = nil; + + d2i_ASN1_BIT_STRING : function(val_out : PPASN1_BIT_STRING; const der_in : PPAnsiChar; length : TIdC_LONG) : PASN1_BIT_STRING cdecl = nil; + i2d_ASN1_BIT_STRING : function(val_in : PASN1_BIT_STRING; der_out : PPAnsiChar) : TIdC_long cdecl = nil; + //DECLARE_ASN1_ITEM(ASN1_OBJECT) + // + //DEFINE_STACK_OF(ASN1_OBJECT) + + ASN1_STRING_new: function : PASN1_STRING; cdecl = nil; + ASN1_STRING_free: procedure (a: PASN1_STRING); cdecl = nil; + ASN1_STRING_clear_free: procedure (a: PASN1_STRING); cdecl = nil; + ASN1_STRING_copy: function (dst: PASN1_STRING; const str: PASN1_STRING): TIdC_INT; cdecl = nil; + ASN1_STRING_dup: function (const a: PASN1_STRING): PASN1_STRING; cdecl = nil; + ASN1_STRING_type_new: function (type_: TIdC_INT): PASN1_STRING; cdecl = nil; + ASN1_STRING_cmp: function (const a: PASN1_STRING; const b: PASN1_STRING): TIdC_INT; cdecl = nil; + + (* + * Since this is used to store all sorts of things, via macros, for now, + * make its data void * + *) + ASN1_STRING_set: function (str: PASN1_STRING; const data: Pointer; len: TIdC_INT): TIdC_INT; cdecl = nil; + ASN1_STRING_set0: procedure (str: PASN1_STRING; data: Pointer; len: TIdC_INT); cdecl = nil; + ASN1_STRING_length: function (const x: PASN1_STRING): TIdC_INT; cdecl = nil; + ASN1_STRING_length_set: procedure (x: PASN1_STRING; n: TIdC_INT); cdecl = nil; + ASN1_STRING_type: function (const x: PASN1_STRING): TIdC_INT; cdecl = nil; + ASN1_STRING_get0_data: function (const x: PASN1_STRING): PByte; cdecl = nil; {introduced 1.1.0} + + //DECLARE_ASN1_FUNCTIONS(ASN1_BIT_STRING) + ASN1_BIT_STRING_set: function (a: PASN1_BIT_STRING; d: PByte; length: TIdC_INT): TIdC_INT; cdecl = nil; + ASN1_BIT_STRING_set_bit: function (a: PASN1_BIT_STRING; n: TIdC_INT; value: TIdC_INT): TIdC_INT; cdecl = nil; + ASN1_BIT_STRING_get_bit: function (const a: PASN1_BIT_STRING; n: TIdC_INT): TIdC_INT; cdecl = nil; + ASN1_BIT_STRING_check: function (const a: PASN1_BIT_STRING; const flags: PByte; flags_len: TIdC_INT): TIdC_INT; cdecl = nil; + + ASN1_BIT_STRING_name_print: function (out_: PBIO; bs: PASN1_BIT_STRING; tbl: PBIT_STRING_BITNAME; indent: TIdC_INT): TIdC_INT; cdecl = nil; + ASN1_BIT_STRING_num_asc: function (const name: PIdAnsiChar; tbl: PBIT_STRING_BITNAME): TIdC_INT; cdecl = nil; + ASN1_BIT_STRING_set_asc: function (bs: PASN1_BIT_STRING; const name: PIdAnsiChar; value: TIdC_INT; tbl: PBIT_STRING_BITNAME): TIdC_INT; cdecl = nil; + + ASN1_INTEGER_new: function : PASN1_INTEGER; cdecl = nil; + ASN1_INTEGER_free: procedure (a: PASN1_INTEGER); cdecl = nil; + d2i_ASN1_INTEGER: function (a: PPASN1_INTEGER; const in_: PPByte; len: TIdC_Long): PASN1_INTEGER; cdecl = nil; + i2d_ASN1_INTEGER: function (a: PASN1_INTEGER; out_: PPByte): TIdC_Int; cdecl = nil; + + d2i_ASN1_UINTEGER: function (a: PPASN1_INTEGER; const pp: PPByte; length: TIdC_LONG): PASN1_INTEGER; cdecl = nil; + ASN1_INTEGER_dup: function (const x: PASN1_INTEGER): PASN1_INTEGER; cdecl = nil; + ASN1_INTEGER_cmp: function (const x: PASN1_INTEGER; const y: PASN1_INTEGER): TIdC_INT; cdecl = nil; + + // DECLARE_ASN1_FUNCTIONS(ASN1_ENUMERATED) + + ASN1_UTCTIME_check: function (const a: PASN1_UTCTIME): TIdC_INT; cdecl = nil; + ASN1_UTCTIME_set: function (s: PASN1_UTCTIME; t: TIdC_TIMET): PASN1_UTCTIME; cdecl = nil; + ASN1_UTCTIME_adj: function (s: PASN1_UTCTIME; t: TIdC_TIMET; offset_day: TIdC_INT; offset_sec: TIdC_LONG): PASN1_UTCTIME; cdecl = nil; + ASN1_UTCTIME_set_string: function (s: PASN1_UTCTIME; const str: PAnsiChar): TIdC_INT; cdecl = nil; + ASN1_UTCTIME_cmp_time_t: function (const s: PASN1_UTCTIME; t: TIdC_TIMET): TIdC_INT; cdecl = nil; + + ASN1_GENERALIZEDTIME_check: function (const a: PASN1_GENERALIZEDTIME): TIdC_INT; cdecl = nil; + ASN1_GENERALIZEDTIME_set: function (s: PASN1_GENERALIZEDTIME; t: TIdC_TIMET): PASN1_GENERALIZEDTIME; cdecl = nil; + ASN1_GENERALIZEDTIME_adj: function (s: PASN1_GENERALIZEDTIME; t: TIdC_TIMET; offset_day: TIdC_INT; offset_sec: TIdC_LONG): PASN1_GENERALIZEDTIME; cdecl = nil; + ASN1_GENERALIZEDTIME_set_string: function (s: pASN1_GENERALIZEDTIME; const str: PAnsiChar): TIdC_INT; cdecl = nil; + + ASN1_TIME_diff: function (pday: PIdC_INT; psec: PIdC_INT; const from: PASN1_TIME; const to_: PASN1_TIME): TIdC_INT; cdecl = nil; + + // DECLARE_ASN1_FUNCTIONS(ASN1_OCTET_STRING) + ASN1_OCTET_STRING_dup: function (const a: PASN1_OCTET_STRING): PASN1_OCTET_STRING; cdecl = nil; + ASN1_OCTET_STRING_cmp: function (const a: PASN1_OCTET_STRING; const b: PASN1_OCTET_STRING): TIdC_INT; cdecl = nil; + ASN1_OCTET_STRING_set: function (str: PASN1_OCTET_STRING; const data: PByte; len: TIdC_INT): TIdC_INT; cdecl = nil; + d2i_ASN1_OCTET_STRING : function(val_out : PPASN1_OCTET_STRING; der_in : PPAnsiChar; length : TIdC_LONG) : PASN1_OCTET_STRING; cdecl = nil; + i2d_ASN1_OCTET_STRING : function(val_in : PASN1_OCTET_STRING; der_out : PPAnsiChar) : TIdC_INT; cdecl = nil; + ASN1_OCTET_STRING_free : procedure(a : PASN1_OCTET_STRING); cdecl = nil; + //DECLARE_ASN1_FUNCTIONS(ASN1_VISIBLESTRING) + //DECLARE_ASN1_FUNCTIONS(ASN1_UNIVERSALSTRING) + //DECLARE_ASN1_FUNCTIONS(ASN1_UTF8STRING) + //DECLARE_ASN1_FUNCTIONS(ASN1_NULL) + //DECLARE_ASN1_FUNCTIONS(ASN1_BMPSTRING) + + UTF8_getc: function (const str: PByte; len: TIdC_INT; val: PIdC_ULONG): TIdC_INT; cdecl = nil; + UTF8_putc: function (str: PIdAnsiChar; len: TIdC_INT; value: TIdC_ULONG): TIdC_INT; cdecl = nil; + + //DECLARE_ASN1_FUNCTIONS_name(ASN1_STRING, ASN1_PRINTABLE) + // + //DECLARE_ASN1_FUNCTIONS_name(ASN1_STRING, DIRECTORYSTRING) + //DECLARE_ASN1_FUNCTIONS_name(ASN1_STRING, DISPLAYTEXT) + //DECLARE_ASN1_FUNCTIONS(ASN1_PRINTABLESTRING) + //DECLARE_ASN1_FUNCTIONS(ASN1_T61STRING) + //DECLARE_ASN1_FUNCTIONS(ASN1_IA5STRING) + //DECLARE_ASN1_FUNCTIONS(ASN1_GENERALSTRING) + + ASN1_UTCTIME_new: function : PASN1_UTCTIME; cdecl = nil; + ASN1_UTCTIME_free: procedure (a: PASN1_UTCTIME); cdecl = nil; + d2i_ASN1_UTCTIME: function (a: PPASN1_UTCTIME; const in_: PPByte; len: TIdC_LONG): PASN1_UTCTIME; cdecl = nil; + i2d_ASN1_UTCTIME: function (a: PASN1_UTCTIME; out_: PPByte): TIdC_INT; cdecl = nil; + + ASN1_GENERALIZEDTIME_new: function : PASN1_GENERALIZEDTIME; cdecl = nil; + ASN1_GENERALIZEDTIME_free: procedure (a: PASN1_GENERALIZEDTIME); cdecl = nil; + d2i_ASN1_GENERALIZEDTIME: function (a: PPASN1_GENERALIZEDTIME; const in_: PPByte; len: TIdC_LONG): PASN1_GENERALIZEDTIME; cdecl = nil; + i2d_ASN1_GENERALIZEDTIME: function (a: PASN1_GENERALIZEDTIME; out_: PPByte): TIdC_INT; cdecl = nil; + + ASN1_TIME_new: function : PASN1_TIME; cdecl = nil; + ASN1_TIME_free: procedure (a: PASN1_TIME); cdecl = nil; + d2i_ASN1_TIME: function (a: PPASN1_TIME; const in_: PPByte; len: TIdC_LONG): PASN1_TIME; cdecl = nil; + i2d_ASN1_TIME: function (a: PASN1_TIME; out_: PPByte): TIdC_INT; cdecl = nil; + + // DECLARE_ASN1_ITEM(ASN1_OCTET_STRING_NDEF) + + ASN1_TIME_set: function (s: PASN1_TIME; t: TIdC_TIMET): PASN1_TIME; cdecl = nil; + ASN1_TIME_adj: function (s: PASN1_TIME; t: TIdC_TIMET; offset_day: TIdC_INT; offset_sec: TIdC_LONG): PASN1_TIME; cdecl = nil; + ASN1_TIME_check: function (const t: PASN1_TIME): TIdC_INT; cdecl = nil; + ASN1_TIME_to_generalizedtime: function (const t: PASN1_TIME; out_: PPASN1_GENERALIZEDTIME): PASN1_GENERALIZEDTIME; cdecl = nil; + ASN1_TIME_set_string: function (s: PASN1_TIME; const str: PIdAnsiChar): TIdC_INT; cdecl = nil; + ASN1_TIME_set_string_X509: function (s: PASN1_TIME; const str: PIdAnsiChar): TIdC_INT; cdecl = nil; {introduced 1.1.0} + ASN1_TIME_to_tm: function (const s: PASN1_TIME; tm: PIdC_TM): TIdC_INT; cdecl = nil; {introduced 1.1.0} + ASN1_TIME_normalize: function (s: PASN1_TIME): TIdC_INT; cdecl = nil; {introduced 1.1.0} + ASN1_TIME_cmp_time_t: function (const s: PASN1_TIME; t: TIdC_TIMET): TIdC_INT; cdecl = nil; {introduced 1.1.0} + ASN1_TIME_compare: function (const a: PASN1_TIME; const b: PASN1_TIME): TIdC_INT; cdecl = nil; {introduced 1.1.0} + + i2a_ASN1_INTEGER: function (bp: PBIO; const a: PASN1_INTEGER): TIdC_INT; cdecl = nil; + a2i_ASN1_INTEGER: function (bp: PBIO; bs: PASN1_INTEGER; buf: PIdAnsiChar; size: TIdC_INT): TIdC_INT; cdecl = nil; + i2a_ASN1_ENUMERATED: function (bp: PBIO; const a: PASN1_ENUMERATED): TIdC_INT; cdecl = nil; + a2i_ASN1_ENUMERATED: function (bp: PBIO; bs: PASN1_ENUMERATED; buf: PIdAnsiChar; size: TIdC_INT): TIdC_INT; cdecl = nil; + i2a_ASN1_OBJECT: function (bp: PBIO; const a: PASN1_OBJECT): TIdC_INT; cdecl = nil; + a2i_ASN1_STRING: function (bp: PBIO; bs: PASN1_STRING; buf: PAnsiChar; size: TIdC_INT): TIdC_INT; cdecl = nil; + i2a_ASN1_STRING: function (bp: PBIO; const a: PASN1_STRING; type_: TIdC_INT): TIdC_INT; cdecl = nil; + i2t_ASN1_OBJECT: function (buf: PAnsiChar; buf_len: TIdC_INT; const a: PASN1_OBJECT): TIdC_INT; cdecl = nil; + + a2d_ASN1_OBJECT: function (out_: PByte; olen: TIdC_INT; const buf: PIdAnsiChar; num: TIdC_INT): TIdC_INT; cdecl = nil; + ASN1_OBJECT_create: function (nid: TIdC_INT; data: PByte; len: TIdC_INT; const sn: PAnsiChar; const ln: PAnsiChar): PASN1_OBJECT; cdecl = nil; + + ASN1_INTEGER_get_int64: function (pr: PIdC_Int64; const a: PASN1_INTEGER): TIdC_INT; cdecl = nil; {introduced 1.1.0} + ASN1_INTEGER_set_int64: function (a: PASN1_INTEGER; r: TIdC_Int64): TIdC_INT; cdecl = nil; {introduced 1.1.0} + ASN1_INTEGER_get_uint64: function (pr: PIdC_UInt64; const a: PASN1_INTEGER): TIdC_INT; cdecl = nil; {introduced 1.1.0} + ASN1_INTEGER_set_uint64: function (a: PASN1_INTEGER; r: TIdC_UInt64): TIdC_INT; cdecl = nil; {introduced 1.1.0} + + ASN1_INTEGER_set: function (a: PASN1_INTEGER; v: TIdC_LONG): TIdC_INT; cdecl = nil; + ASN1_INTEGER_get: function (const a: PASN1_INTEGER): TIdC_LONG; cdecl = nil; + BN_to_ASN1_INTEGER: function (const bn: PBIGNUM; ai: PASN1_INTEGER): PASN1_INTEGER; cdecl = nil; + ASN1_INTEGER_to_BN: function (const ai: PASN1_INTEGER; bn: PBIGNUM): PBIGNUM; cdecl = nil; + + ASN1_ENUMERATED_get_int64: function (pr: PIdC_Int64; const a: PASN1_ENUMERATED): TIdC_INT; cdecl = nil; {introduced 1.1.0} + ASN1_ENUMERATED_set_int64: function (a: PASN1_ENUMERATED; r: TIdC_Int64): TIdC_INT; cdecl = nil; {introduced 1.1.0} + + + ASN1_ENUMERATED_set: function (a: PASN1_ENUMERATED; v: TIdC_LONG): TIdC_INT; cdecl = nil; + ASN1_ENUMERATED_get: function (const a: PASN1_ENUMERATED): TIdC_LONG; cdecl = nil; + BN_to_ASN1_ENUMERATED: function (const bn: PBIGNUM; ai: PASN1_ENUMERATED): PASN1_ENUMERATED; cdecl = nil; + ASN1_ENUMERATED_to_BN: function (const ai: PASN1_ENUMERATED; bn: PBIGNUM): PBIGNUM; cdecl = nil; + + (* General *) + (* given a string, return the correct type, max is the maximum length *) + ASN1_PRINTABLE_type: function (const s: PByte; max: TIdC_INT): TIdC_INT; cdecl = nil; + + ASN1_tag2bit: function (tag: TIdC_INT): TIdC_ULONG; cdecl = nil; + + (* SPECIALS *) + ASN1_get_object: function (const pp: PPByte; plength: PIdC_LONG; ptag: PIdC_INT; pclass: PIdC_INT; omax: TIdC_LONG): TIdC_INT; cdecl = nil; + ASN1_check_infinite_end: function (p: PPByte; len: TIdC_LONG): TIdC_INT; cdecl = nil; + ASN1_const_check_infinite_end: function (const p: PPByte; len: TIdC_LONG): TIdC_INT; cdecl = nil; + ASN1_put_object: procedure (pp: PPByte; constructed: TIdC_INT; length: TIdC_INT; tag: TIdC_INT; xclass: TIdC_INT); cdecl = nil; + ASN1_put_eoc: function (pp: PPByte): TIdC_INT; cdecl = nil; + ASN1_object_size: function (constructed: TIdC_INT; length: TIdC_INT; tag: TIdC_INT): TIdC_INT; cdecl = nil; + + (* Used to implement other functions *) + //void *ASN1_dup(i2d_of_void *i2d, d2i_of_void *d2i, void *x); + // + //# define ASN1_dup_of(type,i2d,d2i,x) \ + // ((type*)ASN1_dup(CHECKED_I2D_OF(type, i2d), \ + // CHECKED_D2I_OF(type, d2i), \ + // CHECKED_PTR_OF(type, x))) + // + //# define ASN1_dup_of_const(type,i2d,d2i,x) \ + // ((type*)ASN1_dup(CHECKED_I2D_OF(const type, i2d), \ + // CHECKED_D2I_OF(type, d2i), \ + // CHECKED_PTR_OF(const type, x))) + // + ASN1_item_dup: function (const it: PASN1_ITEM; x: Pointer): Pointer; cdecl = nil; + + (* ASN1 alloc/free macros for when a type is only used internally *) + + //# define M_ASN1_new_of(type) (type *)ASN1_item_new(ASN1_ITEM_rptr(type)) + //# define M_ASN1_free_of(x, type) \ + // ASN1_item_free(CHECKED_PTR_OF(type, x), ASN1_ITEM_rptr(type)) + // + //# ifndef OPENSSL_NO_STDIO + //void *ASN1_d2i_fp(void *(*xnew) (void), d2i_of_void *d2i, FILE *in, void **x); + + //# define ASN1_d2i_fp_of(type,xnew,d2i,in,x) \ + // ((type*)ASN1_d2i_fp(CHECKED_NEW_OF(type, xnew), \ + // CHECKED_D2I_OF(type, d2i), \ + // in, \ + // CHECKED_PPTR_OF(type, x))) + // + //function ASN1_item_d2i_fp(const it: PASN1_ITEM; in_: PFILE; x: Pointer): Pointer; + //function ASN1_i2d_fp(i2d: Pi2d_of_void; out_: PFILE; x: Pointer): TIdC_INT; + // + //# define ASN1_i2d_fp_of(type,i2d,out,x) \ + // (ASN1_i2d_fp(CHECKED_I2D_OF(type, i2d), \ + // out, \ + // CHECKED_PTR_OF(type, x))) + // + //# define ASN1_i2d_fp_of_const(type,i2d,out,x) \ + // (ASN1_i2d_fp(CHECKED_I2D_OF(const type, i2d), \ + // out, \ + // CHECKED_PTR_OF(const type, x))) + // + //function ASN1_item_i2d_fp(const it: PASN1_ITEM; out_: PFILE; x: Pointer): TIdC_INT; + //function ASN1_STRING_print_ex_fp(&fp: PFILE; const str: PASN1_STRING; flags: TIdC_ULONG): TIdC_INT; + //# endif + + ASN1_STRING_to_UTF8: function (out_: PPByte; const in_: PASN1_STRING): TIdC_INT; cdecl = nil; + + //void *ASN1_d2i_bio(void *(*xnew) (void), d2i_of_void *d2i, BIO *in, void **x); + + //# define ASN1_d2i_bio_of(type,xnew,d2i,in,x) \ + // ((type*)ASN1_d2i_bio( CHECKED_NEW_OF(type, xnew), \ + // CHECKED_D2I_OF(type, d2i), \ + // in, \ + // CHECKED_PPTR_OF(type, x))) + + ASN1_d2i_bio: function(xnew: pxnew; d2i: pd2i_of_void; in_: PBIO; x: PPointer): Pointer; cdecl = nil; + ASN1_item_d2i_bio: function (const it: PASN1_ITEM; in_: PBIO; x: Pointer): Pointer; cdecl = nil; + ASN1_i2d_bio: function (i2d: Pi2d_of_void; out_: PBIO; x: PByte): TIdC_INT; cdecl = nil; + + //# define ASN1_i2d_bio_of(type,i2d,out,x) \ + // (ASN1_i2d_bio(CHECKED_I2D_OF(type, i2d), \ + // out, \ + // CHECKED_PTR_OF(type, x))) + // + //# define ASN1_i2d_bio_of_const(type,i2d,out,x) \ + // (ASN1_i2d_bio(CHECKED_I2D_OF(const type, i2d), \ + // out, \ + // CHECKED_PTR_OF(const type, x))) + + ASN1_item_i2d_bio: function (const it: PASN1_ITEM; out_: PBIO; x: Pointer): TIdC_INT; cdecl = nil; + ASN1_UTCTIME_print: function (fp: PBIO; const a: PASN1_UTCTIME): TIdC_INT; cdecl = nil; + ASN1_GENERALIZEDTIME_print: function (fp: PBIO; const a: PASN1_GENERALIZEDTIME): TIdC_INT; cdecl = nil; + ASN1_TIME_print: function (fp: PBIO; const a: PASN1_TIME): TIdC_INT; cdecl = nil; + ASN1_STRING_print: function (bp: PBIO; const v: PASN1_STRING): TIdC_INT; cdecl = nil; + ASN1_STRING_print_ex: function (out_: PBIO; const str: PASN1_STRING; flags: TIdC_ULONG): TIdC_INT; cdecl = nil; + ASN1_buf_print: function (bp: PBIO; const buf: PByte; buflen: TIdC_SIZET; off: TIdC_INT): TIdC_INT; cdecl = nil; {introduced 1.1.0} + ASN1_bn_print: function (bp: PBIO; const number: PIdAnsiChar; const num: PBIGNUM; buf: PByte; off: TIdC_INT): TIdC_INT; cdecl = nil; + ASN1_parse: function (bp: PBIO; const pp: PByte; len: TIdC_LONG; indent: TIdC_INT): TIdC_INT; cdecl = nil; + ASN1_parse_dump: function (bp: PPBIO; const pp: PByte; len: TIdC_LONG; indent: TIdC_INT; dump: TIdC_INT): TIdC_INT; cdecl = nil; + ASN1_tag2str: function (tag: TIdC_INT): PIdAnsiChar; cdecl = nil; + + (* Used to load and write Netscape format cert *) + + ASN1_UNIVERSALSTRING_to_string: function (s: PASN1_UNIVERSALSTRING): TIdC_INT; cdecl = nil; + + ASN1_TYPE_set_octetstring: function (a: PASN1_TYPE; data: PByte; len: TIdC_INT): TIdC_INT; cdecl = nil; + ASN1_TYPE_get_octetstring: function (const a: PASN1_TYPE; data: PByte; max_len: TIdC_INT): TIdC_INT; cdecl = nil; + ASN1_TYPE_set_int_octetstring: function (a: PASN1_TYPE; num: TIdC_LONG; data: PByte; len: TIdC_INT): TIdC_INT; cdecl = nil; + ASN1_TYPE_get_int_octetstring: function (const a: PASN1_TYPE; num: PIdC_LONG; data: PByte; max_len: TIdC_INT): TIdC_INT; cdecl = nil; + + ASN1_item_unpack: function (const oct: PASN1_STRING; const it: PASN1_ITEM): Pointer; cdecl = nil; + + ASN1_item_pack: function (obj: Pointer; const it: PASN1_ITEM; oct: PPASN1_OCTET_STRING): PASN1_STRING; cdecl = nil; + + ASN1_STRING_set_default_mask: procedure (mask: TIdC_ULONG); cdecl = nil; + ASN1_STRING_set_default_mask_asc: function (const p: PAnsiChar): TIdC_INT; cdecl = nil; + ASN1_STRING_get_default_mask: function : TIdC_ULONG; cdecl = nil; + ASN1_mbstring_copy: function (out_: PPASN1_STRING; const in_: PByte; len: TIdC_INT; inform: TIdC_INT; mask: TIdC_ULONG): TIdC_INT; cdecl = nil; + ASN1_mbstring_ncopy: function (out_: PPASN1_STRING; const in_: PByte; len: TIdC_INT; inform: TIdC_INT; mask: TIdC_ULONG; minsize: TIdC_LONG; maxsize: TIdC_LONG): TIdC_INT; cdecl = nil; + + ASN1_STRING_set_by_NID: function (out_: PPASN1_STRING; const in_: PByte; inlen: TIdC_INT; inform: TIdC_INT; nid: TIdC_INT): PASN1_STRING; cdecl = nil; + ASN1_STRING_TABLE_get: function (nid: TIdC_INT): PASN1_STRING_TABLE; cdecl = nil; + ASN1_STRING_TABLE_add: function (v1: TIdC_INT; v2: TIdC_LONG; v3: TIdC_LONG; v4: TIdC_ULONG; v5: TIdC_ULONG): TIdC_INT; cdecl = nil; + ASN1_STRING_TABLE_cleanup: procedure ; cdecl = nil; + + (* ASN1 template functions *) + + (* Old API compatible functions *) + ASN1_item_new: function (const it: PASN1_ITEM): PASN1_VALUE; cdecl = nil; + ASN1_item_free: procedure (val: PASN1_VALUE; const it: PASN1_ITEM); cdecl = nil; + ASN1_item_d2i: function (val: PPASN1_VALUE; const in_: PPByte; len: TIdC_LONG; const it: PASN1_ITEM): PASN1_VALUE; cdecl = nil; + ASN1_item_i2d: function (val: PASN1_VALUE; out_: PPByte; const it: PASN1_ITEM): TIdC_INT; cdecl = nil; + ASN1_item_ndef_i2d: function (val: PASN1_VALUE; out_: PPByte; const it: PASN1_ITEM): TIdC_INT; cdecl = nil; + + ASN1_add_oid_module: procedure ; cdecl = nil; + ASN1_add_stable_module: procedure ; cdecl = nil; {introduced 1.1.0} + + ASN1_generate_nconf: function (const str: PAnsiChar; nconf: PCONF): PASN1_TYPE; cdecl = nil; + ASN1_generate_v3: function (const str: PAnsiChar; cnf: PX509V3_CTX): PASN1_TYPE; cdecl = nil; + ASN1_str2mask: function (const str: PByte; pmask: PIdC_ULONG): TIdC_INT; cdecl = nil; {introduced 1.1.0} + + ASN1_item_print: function (out_: PBIO; ifld: PASN1_VALUE; indent: TIdC_INT; const it: PASN1_ITEM; const pctx: PASN1_PCTX): TIdC_INT; cdecl = nil; + ASN1_PCTX_new: function : PASN1_PCTX; cdecl = nil; + ASN1_PCTX_free: procedure (p: PASN1_PCTX); cdecl = nil; + ASN1_PCTX_get_flags: function (const p: PASN1_PCTX): TIdC_ULONG; cdecl = nil; + ASN1_PCTX_set_flags: procedure (p: PASN1_PCTX; flags: TIdC_ULONG); cdecl = nil; + ASN1_PCTX_get_nm_flags: function (const p: PASN1_PCTX): TIdC_ULONG; cdecl = nil; + ASN1_PCTX_set_nm_flags: procedure (p: PASN1_PCTX; flags: TIdC_ULONG); cdecl = nil; + ASN1_PCTX_get_cert_flags: function (const p: PASN1_PCTX): TIdC_ULONG; cdecl = nil; + ASN1_PCTX_set_cert_flags: procedure (p: PASN1_PCTX; flags: TIdC_ULONG); cdecl = nil; + ASN1_PCTX_get_oid_flags: function (const p: PASN1_PCTX): TIdC_ULONG; cdecl = nil; + ASN1_PCTX_set_oid_flags: procedure (p: PASN1_PCTX; flags: TIdC_ULONG); cdecl = nil; + ASN1_PCTX_get_str_flags: function (const p: PASN1_PCTX): TIdC_ULONG; cdecl = nil; + ASN1_PCTX_set_str_flags: procedure (p: PASN1_PCTX; flags: TIdC_ULONG); cdecl = nil; + + //ASN1_SCTX *ASN1_SCTX_new(int (*scan_cb) (ASN1_SCTX *ctx)); + ASN1_SCTX_free: procedure (p: PASN1_SCTX); cdecl = nil; {introduced 1.1.0} + ASN1_SCTX_get_item: function (p: PASN1_SCTX): PASN1_ITEM; cdecl = nil; {introduced 1.1.0} + ASN1_SCTX_get_template: function (p: PASN1_SCTX): PASN1_TEMPLATE; cdecl = nil; {introduced 1.1.0} + ASN1_SCTX_get_flags: function (p: PASN1_SCTX): TIdC_ULONG; cdecl = nil; {introduced 1.1.0} + ASN1_SCTX_set_app_data: procedure (p: PASN1_SCTX; data: Pointer); cdecl = nil; {introduced 1.1.0} + ASN1_SCTX_get_app_data: function (p: PASN1_SCTX): Pointer; cdecl = nil; {introduced 1.1.0} + + BIO_f_asn1: function : PBIO_METHOD; cdecl = nil; + + BIO_new_NDEF: function (out_: PBIO; val: PASN1_VALUE; const it: PASN1_ITEM): PBIO; cdecl = nil; + + i2d_ASN1_bio_stream: function (out_: PBIO; val: PASN1_VALUE; in_: PBIO; flags: TIdC_INT; const it: PASN1_ITEM): TIdC_INT; cdecl = nil; + PEM_write_bio_ASN1_stream: function (out_: PBIO; val: PASN1_VALUE; in_: PBIO; flags: TIdC_INT; const hdr: PAnsiChar; const it: PASN1_ITEM): TIdC_INT; cdecl = nil; + //function SMIME_write_ASN1(bio: PBIO; val: PASN1_VALUE; data: PBIO; flags: TIdC_INT; + // ctype_nid: TIdC_INT; econt_nid: TIdC_INT; + // STACK_OF(X509_ALGOR) *mdalgs, const ASN1_ITEM *it): TIdC_INT; + SMIME_read_ASN1: function (bio: PBIO; bcont: PPBIO; const it: PASN1_ITEM): PASN1_VALUE; cdecl = nil; + SMIME_crlf_copy: function (in_: PBIO; out_: PBIO; flags: TIdC_INT): TIdC_INT; cdecl = nil; + SMIME_text: function (in_: PBIO; out_: PBIO): TIdC_INT; cdecl = nil; + + ASN1_ITEM_lookup: function (const name: PIdAnsiChar): PASN1_ITEM; cdecl = nil; {introduced 1.1.0} + ASN1_ITEM_get: function (i: TIdC_SIZET): PASN1_ITEM; cdecl = nil; {introduced 1.1.0} + +{$ELSE} + function ASN1_TYPE_get(const a: PASN1_TYPE): TIdC_INT cdecl; external CLibCrypto; + procedure ASN1_TYPE_set(a: PASN1_TYPE; type_: TIdC_INT; value: Pointer) cdecl; external CLibCrypto; + function ASN1_TYPE_set1(a: PASN1_TYPE; type_: TIdC_INT; const value: Pointer): TIdC_INT cdecl; external CLibCrypto; + function ASN1_TYPE_cmp(const a: PASN1_TYPE; const b: PASN1_TYPE): TIdC_INT cdecl; external CLibCrypto; + + function ASN1_TYPE_pack_sequence(const it: PASN1_ITEM; s: Pointer; t: PPASN1_TYPE): PASN1_TYPE cdecl; external CLibCrypto; {introduced 1.1.0} + function ASN1_TYPE_unpack_sequence(const it: PASN1_ITEM; const t: PASN1_TYPE): Pointer cdecl; external CLibCrypto; {introduced 1.1.0} + + function ASN1_OBJECT_new: PASN1_OBJECT cdecl; external CLibCrypto; + procedure ASN1_OBJECT_free(a: PASN1_OBJECT) cdecl; external CLibCrypto; + function i2d_ASN1_OBJECT(const a: PASN1_OBJECT; pp: PPByte): TIdC_INT cdecl; external CLibCrypto; + function d2i_ASN1_OBJECT(a: PPASN1_OBJECT; const pp: PPByte; length: TIdC_LONG): PASN1_OBJECT cdecl; external CLibCrypto; + function d2i_ASN1_BIT_STRING(val_out : PPASN1_BIT_STRING; const der_in : PPAnsiChar; length : TIdC_LONG) : PASN1_BIT_STRING cdecl; external CLibCrypto; + function i2d_ASN1_BIT_STRING(val_in : PASN1_BIT_STRING; der_out : PPAnsiChar) : TIdC_long cdecl; external CLibCrypto; + + //DECLARE_ASN1_ITEM(ASN1_OBJECT) + // + //DEFINE_STACK_OF(ASN1_OBJECT) + + function ASN1_STRING_new: PASN1_STRING cdecl; external CLibCrypto; + procedure ASN1_STRING_free(a: PASN1_STRING) cdecl; external CLibCrypto; + procedure ASN1_STRING_clear_free(a: PASN1_STRING) cdecl; external CLibCrypto; + function ASN1_STRING_copy(dst: PASN1_STRING; const str: PASN1_STRING): TIdC_INT cdecl; external CLibCrypto; + function ASN1_STRING_dup(const a: PASN1_STRING): PASN1_STRING cdecl; external CLibCrypto; + function ASN1_STRING_type_new(type_: TIdC_INT): PASN1_STRING cdecl; external CLibCrypto; + function ASN1_STRING_cmp(const a: PASN1_STRING; const b: PASN1_STRING): TIdC_INT cdecl; external CLibCrypto; + + (* + * Since this is used to store all sorts of things, via macros, for now, + * make its data void * + *) + function ASN1_STRING_set(str: PASN1_STRING; const data: Pointer; len: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + procedure ASN1_STRING_set0(str: PASN1_STRING; data: Pointer; len: TIdC_INT) cdecl; external CLibCrypto; + function ASN1_STRING_length(const x: PASN1_STRING): TIdC_INT cdecl; external CLibCrypto; + procedure ASN1_STRING_length_set(x: PASN1_STRING; n: TIdC_INT) cdecl; external CLibCrypto; + function ASN1_STRING_type(const x: PASN1_STRING): TIdC_INT cdecl; external CLibCrypto; + function ASN1_STRING_get0_data(const x: PASN1_STRING): PByte cdecl; external CLibCrypto; {introduced 1.1.0} + + //DECLARE_ASN1_FUNCTIONS(ASN1_BIT_STRING) + function ASN1_BIT_STRING_set(a: PASN1_BIT_STRING; d: PByte; length: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function ASN1_BIT_STRING_set_bit(a: PASN1_BIT_STRING; n: TIdC_INT; value: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function ASN1_BIT_STRING_get_bit(const a: PASN1_BIT_STRING; n: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function ASN1_BIT_STRING_check(const a: PASN1_BIT_STRING; const flags: PByte; flags_len: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + + function ASN1_BIT_STRING_name_print(out_: PBIO; bs: PASN1_BIT_STRING; tbl: PBIT_STRING_BITNAME; indent: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function ASN1_BIT_STRING_num_asc(const name: PIdAnsiChar; tbl: PBIT_STRING_BITNAME): TIdC_INT cdecl; external CLibCrypto; + function ASN1_BIT_STRING_set_asc(bs: PASN1_BIT_STRING; const name: PIdAnsiChar; value: TIdC_INT; tbl: PBIT_STRING_BITNAME): TIdC_INT cdecl; external CLibCrypto; + + function ASN1_INTEGER_new: PASN1_INTEGER cdecl; external CLibCrypto; + procedure ASN1_INTEGER_free(a: PASN1_INTEGER) cdecl; external CLibCrypto; + function d2i_ASN1_INTEGER(a: PPASN1_INTEGER; const in_: PPByte; len: TIdC_Long): PASN1_INTEGER cdecl; external CLibCrypto; + function i2d_ASN1_INTEGER(a: PASN1_INTEGER; out_: PPByte): TIdC_Int cdecl; external CLibCrypto; + + function d2i_ASN1_UINTEGER(a: PPASN1_INTEGER; const pp: PPByte; length: TIdC_LONG): PASN1_INTEGER cdecl; external CLibCrypto; + function ASN1_INTEGER_dup(const x: PASN1_INTEGER): PASN1_INTEGER cdecl; external CLibCrypto; + function ASN1_INTEGER_cmp(const x: PASN1_INTEGER; const y: PASN1_INTEGER): TIdC_INT cdecl; external CLibCrypto; + + // DECLARE_ASN1_FUNCTIONS(ASN1_ENUMERATED) + + function ASN1_UTCTIME_check(const a: PASN1_UTCTIME): TIdC_INT cdecl; external CLibCrypto; + function ASN1_UTCTIME_set(s: PASN1_UTCTIME; t: TIdC_TIMET): PASN1_UTCTIME cdecl; external CLibCrypto; + function ASN1_UTCTIME_adj(s: PASN1_UTCTIME; t: TIdC_TIMET; offset_day: TIdC_INT; offset_sec: TIdC_LONG): PASN1_UTCTIME cdecl; external CLibCrypto; + function ASN1_UTCTIME_set_string(s: PASN1_UTCTIME; const str: PAnsiChar): TIdC_INT cdecl; external CLibCrypto; + function ASN1_UTCTIME_cmp_time_t(const s: PASN1_UTCTIME; t: TIdC_TIMET): TIdC_INT cdecl; external CLibCrypto; + + function ASN1_GENERALIZEDTIME_check(const a: PASN1_GENERALIZEDTIME): TIdC_INT cdecl; external CLibCrypto; + function ASN1_GENERALIZEDTIME_set(s: PASN1_GENERALIZEDTIME; t: TIdC_TIMET): PASN1_GENERALIZEDTIME cdecl; external CLibCrypto; + function ASN1_GENERALIZEDTIME_adj(s: PASN1_GENERALIZEDTIME; t: TIdC_TIMET; offset_day: TIdC_INT; offset_sec: TIdC_LONG): PASN1_GENERALIZEDTIME cdecl; external CLibCrypto; + function ASN1_GENERALIZEDTIME_set_string(s: pASN1_GENERALIZEDTIME; const str: PAnsiChar): TIdC_INT cdecl; external CLibCrypto; + + function ASN1_TIME_diff(pday: PIdC_INT; psec: PIdC_INT; const from: PASN1_TIME; const to_: PASN1_TIME): TIdC_INT cdecl; external CLibCrypto; + + // DECLARE_ASN1_FUNCTIONS(ASN1_OCTET_STRING) + function ASN1_OCTET_STRING_dup(const a: PASN1_OCTET_STRING): PASN1_OCTET_STRING cdecl; external CLibCrypto; + function ASN1_OCTET_STRING_cmp(const a: PASN1_OCTET_STRING; const b: PASN1_OCTET_STRING): TIdC_INT cdecl; external CLibCrypto; + function ASN1_OCTET_STRING_set(str: PASN1_OCTET_STRING; const data: PByte; len: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function d2i_ASN1_OCTET_STRING(val_out : PPASN1_OCTET_STRING; der_in : PPAnsiChar; length : TIdC_LONG) : PASN1_OCTET_STRING; cdecl; external CLibCrypto; + function i2d_ASN1_OCTET_STRING(val_in : PASN1_OCTET_STRING; der_out : PPAnsiChar) : TIdC_INT; cdecl; external CLibCrypto; + procedure ASN1_OCTET_STRING_free(a : PASN1_OCTET_STRING); cdecl; external CLibCrypto; + + //DECLARE_ASN1_FUNCTIONS(ASN1_VISIBLESTRING) + //DECLARE_ASN1_FUNCTIONS(ASN1_UNIVERSALSTRING) + //DECLARE_ASN1_FUNCTIONS(ASN1_UTF8STRING) + //DECLARE_ASN1_FUNCTIONS(ASN1_NULL) + //DECLARE_ASN1_FUNCTIONS(ASN1_BMPSTRING) + + function UTF8_getc(const str: PByte; len: TIdC_INT; val: PIdC_ULONG): TIdC_INT cdecl; external CLibCrypto; + function UTF8_putc(str: PIdAnsiChar; len: TIdC_INT; value: TIdC_ULONG): TIdC_INT cdecl; external CLibCrypto; + + //DECLARE_ASN1_FUNCTIONS_name(ASN1_STRING, ASN1_PRINTABLE) + // + //DECLARE_ASN1_FUNCTIONS_name(ASN1_STRING, DIRECTORYSTRING) + //DECLARE_ASN1_FUNCTIONS_name(ASN1_STRING, DISPLAYTEXT) + //DECLARE_ASN1_FUNCTIONS(ASN1_PRINTABLESTRING) + //DECLARE_ASN1_FUNCTIONS(ASN1_T61STRING) + //DECLARE_ASN1_FUNCTIONS(ASN1_IA5STRING) + //DECLARE_ASN1_FUNCTIONS(ASN1_GENERALSTRING) + + function ASN1_UTCTIME_new: PASN1_UTCTIME cdecl; external CLibCrypto; + procedure ASN1_UTCTIME_free(a: PASN1_UTCTIME) cdecl; external CLibCrypto; + function d2i_ASN1_UTCTIME(a: PPASN1_UTCTIME; const in_: PPByte; len: TIdC_LONG): PASN1_UTCTIME cdecl; external CLibCrypto; + function i2d_ASN1_UTCTIME(a: PASN1_UTCTIME; out_: PPByte): TIdC_INT cdecl; external CLibCrypto; + + function ASN1_GENERALIZEDTIME_new: PASN1_GENERALIZEDTIME cdecl; external CLibCrypto; + procedure ASN1_GENERALIZEDTIME_free(a: PASN1_GENERALIZEDTIME) cdecl; external CLibCrypto; + function d2i_ASN1_GENERALIZEDTIME(a: PPASN1_GENERALIZEDTIME; const in_: PPByte; len: TIdC_LONG): PASN1_GENERALIZEDTIME cdecl; external CLibCrypto; + function i2d_ASN1_GENERALIZEDTIME(a: PASN1_GENERALIZEDTIME; out_: PPByte): TIdC_INT cdecl; external CLibCrypto; + + function ASN1_TIME_new: PASN1_TIME cdecl; external CLibCrypto; + procedure ASN1_TIME_free(a: PASN1_TIME) cdecl; external CLibCrypto; + function d2i_ASN1_TIME(a: PPASN1_TIME; const in_: PPByte; len: TIdC_LONG): PASN1_TIME cdecl; external CLibCrypto; + function i2d_ASN1_TIME(a: PASN1_TIME; out_: PPByte): TIdC_INT cdecl; external CLibCrypto; + + // DECLARE_ASN1_ITEM(ASN1_OCTET_STRING_NDEF) + + function ASN1_TIME_set(s: PASN1_TIME; t: TIdC_TIMET): PASN1_TIME cdecl; external CLibCrypto; + function ASN1_TIME_adj(s: PASN1_TIME; t: TIdC_TIMET; offset_day: TIdC_INT; offset_sec: TIdC_LONG): PASN1_TIME cdecl; external CLibCrypto; + function ASN1_TIME_check(const t: PASN1_TIME): TIdC_INT cdecl; external CLibCrypto; + function ASN1_TIME_to_generalizedtime(const t: PASN1_TIME; out_: PPASN1_GENERALIZEDTIME): PASN1_GENERALIZEDTIME cdecl; external CLibCrypto; + function ASN1_TIME_set_string(s: PASN1_TIME; const str: PIdAnsiChar): TIdC_INT cdecl; external CLibCrypto; + function ASN1_TIME_set_string_X509(s: PASN1_TIME; const str: PIdAnsiChar): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function ASN1_TIME_to_tm(const s: PASN1_TIME; tm: PIdC_TM): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function ASN1_TIME_normalize(s: PASN1_TIME): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function ASN1_TIME_cmp_time_t(const s: PASN1_TIME; t: TIdC_TIMET): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function ASN1_TIME_compare(const a: PASN1_TIME; const b: PASN1_TIME): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + + function i2a_ASN1_INTEGER(bp: PBIO; const a: PASN1_INTEGER): TIdC_INT cdecl; external CLibCrypto; + function a2i_ASN1_INTEGER(bp: PBIO; bs: PASN1_INTEGER; buf: PIdAnsiChar; size: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function i2a_ASN1_ENUMERATED(bp: PBIO; const a: PASN1_ENUMERATED): TIdC_INT cdecl; external CLibCrypto; + function a2i_ASN1_ENUMERATED(bp: PBIO; bs: PASN1_ENUMERATED; buf: PIdAnsiChar; size: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function i2a_ASN1_OBJECT(bp: PBIO; const a: PASN1_OBJECT): TIdC_INT cdecl; external CLibCrypto; + function a2i_ASN1_STRING(bp: PBIO; bs: PASN1_STRING; buf: PAnsiChar; size: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function i2a_ASN1_STRING(bp: PBIO; const a: PASN1_STRING; type_: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function i2t_ASN1_OBJECT(buf: PAnsiChar; buf_len: TIdC_INT; const a: PASN1_OBJECT): TIdC_INT cdecl; external CLibCrypto; + + function a2d_ASN1_OBJECT(out_: PByte; olen: TIdC_INT; const buf: PIdAnsiChar; num: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function ASN1_OBJECT_create(nid: TIdC_INT; data: PByte; len: TIdC_INT; const sn: PAnsiChar; const ln: PAnsiChar): PASN1_OBJECT cdecl; external CLibCrypto; + + function ASN1_INTEGER_get_int64(pr: PIdC_Int64; const a: PASN1_INTEGER): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function ASN1_INTEGER_set_int64(a: PASN1_INTEGER; r: TIdC_Int64): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function ASN1_INTEGER_get_uint64(pr: PIdC_UInt64; const a: PASN1_INTEGER): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function ASN1_INTEGER_set_uint64(a: PASN1_INTEGER; r: TIdC_UInt64): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + + function ASN1_INTEGER_set(a: PASN1_INTEGER; v: TIdC_LONG): TIdC_INT cdecl; external CLibCrypto; + function ASN1_INTEGER_get(const a: PASN1_INTEGER): TIdC_LONG cdecl; external CLibCrypto; + function BN_to_ASN1_INTEGER(const bn: PBIGNUM; ai: PASN1_INTEGER): PASN1_INTEGER cdecl; external CLibCrypto; + function ASN1_INTEGER_to_BN(const ai: PASN1_INTEGER; bn: PBIGNUM): PBIGNUM cdecl; external CLibCrypto; + + function ASN1_ENUMERATED_get_int64(pr: PIdC_Int64; const a: PASN1_ENUMERATED): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function ASN1_ENUMERATED_set_int64(a: PASN1_ENUMERATED; r: TIdC_Int64): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + + + function ASN1_ENUMERATED_set(a: PASN1_ENUMERATED; v: TIdC_LONG): TIdC_INT cdecl; external CLibCrypto; + function ASN1_ENUMERATED_get(const a: PASN1_ENUMERATED): TIdC_LONG cdecl; external CLibCrypto; + function BN_to_ASN1_ENUMERATED(const bn: PBIGNUM; ai: PASN1_ENUMERATED): PASN1_ENUMERATED cdecl; external CLibCrypto; + function ASN1_ENUMERATED_to_BN(const ai: PASN1_ENUMERATED; bn: PBIGNUM): PBIGNUM cdecl; external CLibCrypto; + + (* General *) + (* given a string, return the correct type, max is the maximum length *) + function ASN1_PRINTABLE_type(const s: PByte; max: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + + function ASN1_tag2bit(tag: TIdC_INT): TIdC_ULONG cdecl; external CLibCrypto; + + (* SPECIALS *) + function ASN1_get_object(const pp: PPByte; plength: PIdC_LONG; ptag: PIdC_INT; pclass: PIdC_INT; omax: TIdC_LONG): TIdC_INT cdecl; external CLibCrypto; + function ASN1_check_infinite_end(p: PPByte; len: TIdC_LONG): TIdC_INT cdecl; external CLibCrypto; + function ASN1_const_check_infinite_end(const p: PPByte; len: TIdC_LONG): TIdC_INT cdecl; external CLibCrypto; + procedure ASN1_put_object(pp: PPByte; constructed: TIdC_INT; length: TIdC_INT; tag: TIdC_INT; xclass: TIdC_INT) cdecl; external CLibCrypto; + function ASN1_put_eoc(pp: PPByte): TIdC_INT cdecl; external CLibCrypto; + function ASN1_object_size(constructed: TIdC_INT; length: TIdC_INT; tag: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + + (* Used to implement other functions *) + //void *ASN1_dup(i2d_of_void *i2d, d2i_of_void *d2i, void *x); + // + //# define ASN1_dup_of(type,i2d,d2i,x) \ + // ((type*)ASN1_dup(CHECKED_I2D_OF(type, i2d), \ + // CHECKED_D2I_OF(type, d2i), \ + // CHECKED_PTR_OF(type, x))) + // + //# define ASN1_dup_of_const(type,i2d,d2i,x) \ + // ((type*)ASN1_dup(CHECKED_I2D_OF(const type, i2d), \ + // CHECKED_D2I_OF(type, d2i), \ + // CHECKED_PTR_OF(const type, x))) + // + function ASN1_item_dup(const it: PASN1_ITEM; x: Pointer): Pointer cdecl; external CLibCrypto; + + (* ASN1 alloc/free macros for when a type is only used internally *) + + //# define M_ASN1_new_of(type) (type *)ASN1_item_new(ASN1_ITEM_rptr(type)) + //# define M_ASN1_free_of(x, type) \ + // ASN1_item_free(CHECKED_PTR_OF(type, x), ASN1_ITEM_rptr(type)) + // + //# ifndef OPENSSL_NO_STDIO + //void *ASN1_d2i_fp(void *(*xnew) (void), d2i_of_void *d2i, FILE *in, void **x); + + //# define ASN1_d2i_fp_of(type,xnew,d2i,in,x) \ + // ((type*)ASN1_d2i_fp(CHECKED_NEW_OF(type, xnew), \ + // CHECKED_D2I_OF(type, d2i), \ + // in, \ + // CHECKED_PPTR_OF(type, x))) + // + //function ASN1_item_d2i_fp(const it: PASN1_ITEM; in_: PFILE; x: Pointer): Pointer; + //function ASN1_i2d_fp(i2d: Pi2d_of_void; out_: PFILE; x: Pointer): TIdC_INT; + // + //# define ASN1_i2d_fp_of(type,i2d,out,x) \ + // (ASN1_i2d_fp(CHECKED_I2D_OF(type, i2d), \ + // out, \ + // CHECKED_PTR_OF(type, x))) + // + //# define ASN1_i2d_fp_of_const(type,i2d,out,x) \ + // (ASN1_i2d_fp(CHECKED_I2D_OF(const type, i2d), \ + // out, \ + // CHECKED_PTR_OF(const type, x))) + // + //function ASN1_item_i2d_fp(const it: PASN1_ITEM; out_: PFILE; x: Pointer): TIdC_INT; + //function ASN1_STRING_print_ex_fp(&fp: PFILE; const str: PASN1_STRING; flags: TIdC_ULONG): TIdC_INT; + //# endif + + function ASN1_STRING_to_UTF8(out_: PPByte; const in_: PASN1_STRING): TIdC_INT cdecl; external CLibCrypto; + + //void *ASN1_d2i_bio(void *(*xnew) (void), d2i_of_void *d2i, BIO *in, void **x); + + //# define ASN1_d2i_bio_of(type,xnew,d2i,in,x) \ + // ((type*)ASN1_d2i_bio( CHECKED_NEW_OF(type, xnew), \ + // CHECKED_D2I_OF(type, d2i), \ + // in, \ + // CHECKED_PPTR_OF(type, x))) + + function ASN1_item_d2i_bio(const it: PASN1_ITEM; in_: PBIO; x: Pointer): Pointer cdecl; external CLibCrypto; + function ASN1_i2d_bio(i2d: Pi2d_of_void; out_: PBIO; x: PByte): TIdC_INT cdecl; external CLibCrypto; + + //# define ASN1_i2d_bio_of(type,i2d,out,x) \ + // (ASN1_i2d_bio(CHECKED_I2D_OF(type, i2d), \ + // out, \ + // CHECKED_PTR_OF(type, x))) + // + //# define ASN1_i2d_bio_of_const(type,i2d,out,x) \ + // (ASN1_i2d_bio(CHECKED_I2D_OF(const type, i2d), \ + // out, \ + // CHECKED_PTR_OF(const type, x))) + + function ASN1_item_i2d_bio(const it: PASN1_ITEM; out_: PBIO; x: Pointer): TIdC_INT cdecl; external CLibCrypto; + function ASN1_UTCTIME_print(fp: PBIO; const a: PASN1_UTCTIME): TIdC_INT cdecl; external CLibCrypto; + function ASN1_GENERALIZEDTIME_print(fp: PBIO; const a: PASN1_GENERALIZEDTIME): TIdC_INT cdecl; external CLibCrypto; + function ASN1_TIME_print(fp: PBIO; const a: PASN1_TIME): TIdC_INT cdecl; external CLibCrypto; + function ASN1_STRING_print(bp: PBIO; const v: PASN1_STRING): TIdC_INT cdecl; external CLibCrypto; + function ASN1_STRING_print_ex(out_: PBIO; const str: PASN1_STRING; flags: TIdC_ULONG): TIdC_INT cdecl; external CLibCrypto; + function ASN1_buf_print(bp: PBIO; const buf: PByte; buflen: TIdC_SIZET; off: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function ASN1_bn_print(bp: PBIO; const number: PIdAnsiChar; const num: PBIGNUM; buf: PByte; off: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function ASN1_parse(bp: PBIO; const pp: PByte; len: TIdC_LONG; indent: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function ASN1_parse_dump(bp: PPBIO; const pp: PByte; len: TIdC_LONG; indent: TIdC_INT; dump: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function ASN1_tag2str(tag: TIdC_INT): PIdAnsiChar cdecl; external CLibCrypto; + + (* Used to load and write Netscape format cert *) + + function ASN1_UNIVERSALSTRING_to_string(s: PASN1_UNIVERSALSTRING): TIdC_INT cdecl; external CLibCrypto; + + function ASN1_TYPE_set_octetstring(a: PASN1_TYPE; data: PByte; len: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function ASN1_TYPE_get_octetstring(const a: PASN1_TYPE; data: PByte; max_len: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function ASN1_TYPE_set_int_octetstring(a: PASN1_TYPE; num: TIdC_LONG; data: PByte; len: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function ASN1_TYPE_get_int_octetstring(const a: PASN1_TYPE; num: PIdC_LONG; data: PByte; max_len: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + + function ASN1_item_unpack(const oct: PASN1_STRING; const it: PASN1_ITEM): Pointer cdecl; external CLibCrypto; + + function ASN1_item_pack(obj: Pointer; const it: PASN1_ITEM; oct: PPASN1_OCTET_STRING): PASN1_STRING cdecl; external CLibCrypto; + + procedure ASN1_STRING_set_default_mask(mask: TIdC_ULONG) cdecl; external CLibCrypto; + function ASN1_STRING_set_default_mask_asc(const p: PAnsiChar): TIdC_INT cdecl; external CLibCrypto; + function ASN1_STRING_get_default_mask: TIdC_ULONG cdecl; external CLibCrypto; + function ASN1_mbstring_copy(out_: PPASN1_STRING; const in_: PByte; len: TIdC_INT; inform: TIdC_INT; mask: TIdC_ULONG): TIdC_INT cdecl; external CLibCrypto; + function ASN1_mbstring_ncopy(out_: PPASN1_STRING; const in_: PByte; len: TIdC_INT; inform: TIdC_INT; mask: TIdC_ULONG; minsize: TIdC_LONG; maxsize: TIdC_LONG): TIdC_INT cdecl; external CLibCrypto; + + function ASN1_STRING_set_by_NID(out_: PPASN1_STRING; const in_: PByte; inlen: TIdC_INT; inform: TIdC_INT; nid: TIdC_INT): PASN1_STRING cdecl; external CLibCrypto; + function ASN1_STRING_TABLE_get(nid: TIdC_INT): PASN1_STRING_TABLE cdecl; external CLibCrypto; + function ASN1_STRING_TABLE_add(v1: TIdC_INT; v2: TIdC_LONG; v3: TIdC_LONG; v4: TIdC_ULONG; v5: TIdC_ULONG): TIdC_INT cdecl; external CLibCrypto; + procedure ASN1_STRING_TABLE_cleanup cdecl; external CLibCrypto; + + (* ASN1 template functions *) + + (* Old API compatible functions *) + function ASN1_item_new(const it: PASN1_ITEM): PASN1_VALUE cdecl; external CLibCrypto; + procedure ASN1_item_free(val: PASN1_VALUE; const it: PASN1_ITEM) cdecl; external CLibCrypto; + function ASN1_item_d2i(val: PPASN1_VALUE; const in_: PPByte; len: TIdC_LONG; const it: PASN1_ITEM): PASN1_VALUE cdecl; external CLibCrypto; + function ASN1_item_i2d(val: PASN1_VALUE; out_: PPByte; const it: PASN1_ITEM): TIdC_INT cdecl; external CLibCrypto; + function ASN1_item_ndef_i2d(val: PASN1_VALUE; out_: PPByte; const it: PASN1_ITEM): TIdC_INT cdecl; external CLibCrypto; + + procedure ASN1_add_oid_module cdecl; external CLibCrypto; + procedure ASN1_add_stable_module cdecl; external CLibCrypto; {introduced 1.1.0} + + function ASN1_generate_nconf(const str: PAnsiChar; nconf: PCONF): PASN1_TYPE cdecl; external CLibCrypto; + function ASN1_generate_v3(const str: PAnsiChar; cnf: PX509V3_CTX): PASN1_TYPE cdecl; external CLibCrypto; + function ASN1_str2mask(const str: PByte; pmask: PIdC_ULONG): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + + function ASN1_item_print(out_: PBIO; ifld: PASN1_VALUE; indent: TIdC_INT; const it: PASN1_ITEM; const pctx: PASN1_PCTX): TIdC_INT cdecl; external CLibCrypto; + function ASN1_PCTX_new: PASN1_PCTX cdecl; external CLibCrypto; + procedure ASN1_PCTX_free(p: PASN1_PCTX) cdecl; external CLibCrypto; + function ASN1_PCTX_get_flags(const p: PASN1_PCTX): TIdC_ULONG cdecl; external CLibCrypto; + procedure ASN1_PCTX_set_flags(p: PASN1_PCTX; flags: TIdC_ULONG) cdecl; external CLibCrypto; + function ASN1_PCTX_get_nm_flags(const p: PASN1_PCTX): TIdC_ULONG cdecl; external CLibCrypto; + procedure ASN1_PCTX_set_nm_flags(p: PASN1_PCTX; flags: TIdC_ULONG) cdecl; external CLibCrypto; + function ASN1_PCTX_get_cert_flags(const p: PASN1_PCTX): TIdC_ULONG cdecl; external CLibCrypto; + procedure ASN1_PCTX_set_cert_flags(p: PASN1_PCTX; flags: TIdC_ULONG) cdecl; external CLibCrypto; + function ASN1_PCTX_get_oid_flags(const p: PASN1_PCTX): TIdC_ULONG cdecl; external CLibCrypto; + procedure ASN1_PCTX_set_oid_flags(p: PASN1_PCTX; flags: TIdC_ULONG) cdecl; external CLibCrypto; + function ASN1_PCTX_get_str_flags(const p: PASN1_PCTX): TIdC_ULONG cdecl; external CLibCrypto; + procedure ASN1_PCTX_set_str_flags(p: PASN1_PCTX; flags: TIdC_ULONG) cdecl; external CLibCrypto; + + //ASN1_SCTX *ASN1_SCTX_new(int (*scan_cb) (ASN1_SCTX *ctx)); + procedure ASN1_SCTX_free(p: PASN1_SCTX) cdecl; external CLibCrypto; {introduced 1.1.0} + function ASN1_SCTX_get_item(p: PASN1_SCTX): PASN1_ITEM cdecl; external CLibCrypto; {introduced 1.1.0} + function ASN1_SCTX_get_template(p: PASN1_SCTX): PASN1_TEMPLATE cdecl; external CLibCrypto; {introduced 1.1.0} + function ASN1_SCTX_get_flags(p: PASN1_SCTX): TIdC_ULONG cdecl; external CLibCrypto; {introduced 1.1.0} + procedure ASN1_SCTX_set_app_data(p: PASN1_SCTX; data: Pointer) cdecl; external CLibCrypto; {introduced 1.1.0} + function ASN1_SCTX_get_app_data(p: PASN1_SCTX): Pointer cdecl; external CLibCrypto; {introduced 1.1.0} + + function BIO_f_asn1: PBIO_METHOD cdecl; external CLibCrypto; + + function BIO_new_NDEF(out_: PBIO; val: PASN1_VALUE; const it: PASN1_ITEM): PBIO cdecl; external CLibCrypto; + + function i2d_ASN1_bio_stream(out_: PBIO; val: PASN1_VALUE; in_: PBIO; flags: TIdC_INT; const it: PASN1_ITEM): TIdC_INT cdecl; external CLibCrypto; + function PEM_write_bio_ASN1_stream(out_: PBIO; val: PASN1_VALUE; in_: PBIO; flags: TIdC_INT; const hdr: PAnsiChar; const it: PASN1_ITEM): TIdC_INT cdecl; external CLibCrypto; + //function SMIME_write_ASN1(bio: PBIO; val: PASN1_VALUE; data: PBIO; flags: TIdC_INT; + // ctype_nid: TIdC_INT; econt_nid: TIdC_INT; + // STACK_OF(X509_ALGOR) *mdalgs, const ASN1_ITEM *it): TIdC_INT; + function SMIME_read_ASN1(bio: PBIO; bcont: PPBIO; const it: PASN1_ITEM): PASN1_VALUE cdecl; external CLibCrypto; + function SMIME_crlf_copy(in_: PBIO; out_: PBIO; flags: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function SMIME_text(in_: PBIO; out_: PBIO): TIdC_INT cdecl; external CLibCrypto; + + function ASN1_ITEM_lookup(const name: PIdAnsiChar): PASN1_ITEM cdecl; external CLibCrypto; {introduced 1.1.0} + function ASN1_ITEM_get(i: TIdC_SIZET): PASN1_ITEM cdecl; external CLibCrypto; {introduced 1.1.0} + +{$ENDIF} + +implementation + + uses + classes, + IdSSLOpenSSLExceptionHandlers, + IdResourceStringsOpenSSL + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + ,IdSSLOpenSSLLoader + {$ENDIF}; + +const + ASN1_TYPE_pack_sequence_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + ASN1_TYPE_unpack_sequence_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + ASN1_STRING_get0_data_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + ASN1_TIME_set_string_X509_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + ASN1_TIME_to_tm_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + ASN1_TIME_normalize_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + ASN1_TIME_cmp_time_t_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + ASN1_TIME_compare_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + ASN1_INTEGER_get_int64_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + ASN1_INTEGER_set_int64_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + ASN1_INTEGER_get_uint64_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + ASN1_INTEGER_set_uint64_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + ASN1_ENUMERATED_get_int64_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + ASN1_ENUMERATED_set_int64_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + ASN1_buf_print_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + ASN1_add_stable_module_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + ASN1_str2mask_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + ASN1_SCTX_free_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + ASN1_SCTX_get_item_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + ASN1_SCTX_get_template_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + ASN1_SCTX_get_flags_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + ASN1_SCTX_set_app_data_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + ASN1_SCTX_get_app_data_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + ASN1_ITEM_lookup_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + ASN1_ITEM_get_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +const + ASN1_TYPE_get_procname = 'ASN1_TYPE_get'; + ASN1_TYPE_set_procname = 'ASN1_TYPE_set'; + ASN1_TYPE_set1_procname = 'ASN1_TYPE_set1'; + ASN1_TYPE_cmp_procname = 'ASN1_TYPE_cmp'; + + ASN1_TYPE_pack_sequence_procname = 'ASN1_TYPE_pack_sequence'; {introduced 1.1.0} + ASN1_TYPE_unpack_sequence_procname = 'ASN1_TYPE_unpack_sequence'; {introduced 1.1.0} + + ASN1_OBJECT_new_procname = 'ASN1_OBJECT_new'; + ASN1_OBJECT_free_procname = 'ASN1_OBJECT_free'; + i2d_ASN1_OBJECT_procname = 'i2d_ASN1_OBJECT'; + d2i_ASN1_OBJECT_procname = 'd2i_ASN1_OBJECT'; + d2i_ASN1_BIT_STRING_procname = 'd2i_ASN1_BIT_STRING'; + i2d_ASN1_BIT_STRING_procname = 'i2d_ASN1_BIT_STRING'; + + //DECLARE_ASN1_ITEM(ASN1_OBJECT) + // + //DEFINE_STACK_OF(ASN1_OBJECT) + + ASN1_STRING_new_procname = 'ASN1_STRING_new'; + ASN1_STRING_free_procname = 'ASN1_STRING_free'; + ASN1_STRING_clear_free_procname = 'ASN1_STRING_clear_free'; + ASN1_STRING_copy_procname = 'ASN1_STRING_copy'; + ASN1_STRING_dup_procname = 'ASN1_STRING_dup'; + ASN1_STRING_type_new_procname = 'ASN1_STRING_type_new'; + ASN1_STRING_cmp_procname = 'ASN1_STRING_cmp'; + + (* + * Since this is used to store all sorts of things, via macros, for now, + * make its data void * + *) + ASN1_STRING_set_procname = 'ASN1_STRING_set'; + ASN1_STRING_set0_procname = 'ASN1_STRING_set0'; + ASN1_STRING_length_procname = 'ASN1_STRING_length'; + ASN1_STRING_length_set_procname = 'ASN1_STRING_length_set'; + ASN1_STRING_type_procname = 'ASN1_STRING_type'; + ASN1_STRING_get0_data_procname = 'ASN1_STRING_get0_data'; {introduced 1.1.0} + + //DECLARE_ASN1_FUNCTIONS(ASN1_BIT_STRING) + ASN1_BIT_STRING_set_procname = 'ASN1_BIT_STRING_set'; + ASN1_BIT_STRING_set_bit_procname = 'ASN1_BIT_STRING_set_bit'; + ASN1_BIT_STRING_get_bit_procname = 'ASN1_BIT_STRING_get_bit'; + ASN1_BIT_STRING_check_procname = 'ASN1_BIT_STRING_check'; + + ASN1_BIT_STRING_name_print_procname = 'ASN1_BIT_STRING_name_print'; + ASN1_BIT_STRING_num_asc_procname = 'ASN1_BIT_STRING_num_asc'; + ASN1_BIT_STRING_set_asc_procname = 'ASN1_BIT_STRING_set_asc'; + + ASN1_INTEGER_new_procname = 'ASN1_INTEGER_new'; + ASN1_INTEGER_free_procname = 'ASN1_INTEGER_free'; + d2i_ASN1_INTEGER_procname = 'd2i_ASN1_INTEGER'; + i2d_ASN1_INTEGER_procname = 'i2d_ASN1_INTEGER'; + + d2i_ASN1_UINTEGER_procname = 'd2i_ASN1_UINTEGER'; + ASN1_INTEGER_dup_procname = 'ASN1_INTEGER_dup'; + ASN1_INTEGER_cmp_procname = 'ASN1_INTEGER_cmp'; + + // DECLARE_ASN1_FUNCTIONS(ASN1_ENUMERATED) + + ASN1_UTCTIME_check_procname = 'ASN1_UTCTIME_check'; + ASN1_UTCTIME_set_procname = 'ASN1_UTCTIME_set'; + ASN1_UTCTIME_adj_procname = 'ASN1_UTCTIME_adj'; + ASN1_UTCTIME_set_string_procname = 'ASN1_UTCTIME_set_string'; + ASN1_UTCTIME_cmp_time_t_procname = 'ASN1_UTCTIME_cmp_time_t'; + + ASN1_GENERALIZEDTIME_check_procname = 'ASN1_GENERALIZEDTIME_check'; + ASN1_GENERALIZEDTIME_set_procname = 'ASN1_GENERALIZEDTIME_set'; + ASN1_GENERALIZEDTIME_adj_procname = 'ASN1_GENERALIZEDTIME_adj'; + ASN1_GENERALIZEDTIME_set_string_procname = 'ASN1_GENERALIZEDTIME_set_string'; + + ASN1_TIME_diff_procname = 'ASN1_TIME_diff'; + + // DECLARE_ASN1_FUNCTIONS(ASN1_OCTET_STRING) + ASN1_OCTET_STRING_dup_procname = 'ASN1_OCTET_STRING_dup'; + ASN1_OCTET_STRING_cmp_procname = 'ASN1_OCTET_STRING_cmp'; + ASN1_OCTET_STRING_set_procname = 'ASN1_OCTET_STRING_set'; + d2i_ASN1_OCTET_STRING_procname = 'd2i_ASN1_OCTET_STRING'; + i2d_ASN1_OCTET_STRING_procname = 'i2d_ASN1_OCTET_STRING'; + ASN1_OCTET_STRING_free_procname = 'ASN1_OCTET_STRING_free'; + + //DECLARE_ASN1_FUNCTIONS(ASN1_VISIBLESTRING) + //DECLARE_ASN1_FUNCTIONS(ASN1_UNIVERSALSTRING) + //DECLARE_ASN1_FUNCTIONS(ASN1_UTF8STRING) + //DECLARE_ASN1_FUNCTIONS(ASN1_NULL) + //DECLARE_ASN1_FUNCTIONS(ASN1_BMPSTRING) + + UTF8_getc_procname = 'UTF8_getc'; + UTF8_putc_procname = 'UTF8_putc'; + + //DECLARE_ASN1_FUNCTIONS_name(ASN1_STRING, ASN1_PRINTABLE) + // + //DECLARE_ASN1_FUNCTIONS_name(ASN1_STRING, DIRECTORYSTRING) + //DECLARE_ASN1_FUNCTIONS_name(ASN1_STRING, DISPLAYTEXT) + //DECLARE_ASN1_FUNCTIONS(ASN1_PRINTABLESTRING) + //DECLARE_ASN1_FUNCTIONS(ASN1_T61STRING) + //DECLARE_ASN1_FUNCTIONS(ASN1_IA5STRING) + //DECLARE_ASN1_FUNCTIONS(ASN1_GENERALSTRING) + + ASN1_UTCTIME_new_procname = 'ASN1_UTCTIME_new'; + ASN1_UTCTIME_free_procname = 'ASN1_UTCTIME_free'; + d2i_ASN1_UTCTIME_procname = 'd2i_ASN1_UTCTIME'; + i2d_ASN1_UTCTIME_procname = 'i2d_ASN1_UTCTIME'; + + ASN1_GENERALIZEDTIME_new_procname = 'ASN1_GENERALIZEDTIME_new'; + ASN1_GENERALIZEDTIME_free_procname = 'ASN1_GENERALIZEDTIME_free'; + d2i_ASN1_GENERALIZEDTIME_procname = 'd2i_ASN1_GENERALIZEDTIME'; + i2d_ASN1_GENERALIZEDTIME_procname = 'i2d_ASN1_GENERALIZEDTIME'; + + ASN1_TIME_new_procname = 'ASN1_TIME_new'; + ASN1_TIME_free_procname = 'ASN1_TIME_free'; + d2i_ASN1_TIME_procname = 'd2i_ASN1_TIME'; + i2d_ASN1_TIME_procname = 'i2d_ASN1_TIME'; + + // DECLARE_ASN1_ITEM(ASN1_OCTET_STRING_NDEF) + + ASN1_TIME_set_procname = 'ASN1_TIME_set'; + ASN1_TIME_adj_procname = 'ASN1_TIME_adj'; + ASN1_TIME_check_procname = 'ASN1_TIME_check'; + ASN1_TIME_to_generalizedtime_procname = 'ASN1_TIME_to_generalizedtime'; + ASN1_TIME_set_string_procname = 'ASN1_TIME_set_string'; + ASN1_TIME_set_string_X509_procname = 'ASN1_TIME_set_string_X509'; {introduced 1.1.0} + ASN1_TIME_to_tm_procname = 'ASN1_TIME_to_tm'; {introduced 1.1.0} + ASN1_TIME_normalize_procname = 'ASN1_TIME_normalize'; {introduced 1.1.0} + ASN1_TIME_cmp_time_t_procname = 'ASN1_TIME_cmp_time_t'; {introduced 1.1.0} + ASN1_TIME_compare_procname = 'ASN1_TIME_compare'; {introduced 1.1.0} + + i2a_ASN1_INTEGER_procname = 'i2a_ASN1_INTEGER'; + a2i_ASN1_INTEGER_procname = 'a2i_ASN1_INTEGER'; + i2a_ASN1_ENUMERATED_procname = 'i2a_ASN1_ENUMERATED'; + a2i_ASN1_ENUMERATED_procname = 'a2i_ASN1_ENUMERATED'; + i2a_ASN1_OBJECT_procname = 'i2a_ASN1_OBJECT'; + a2i_ASN1_STRING_procname = 'a2i_ASN1_STRING'; + i2a_ASN1_STRING_procname = 'i2a_ASN1_STRING'; + i2t_ASN1_OBJECT_procname = 'i2t_ASN1_OBJECT'; + + a2d_ASN1_OBJECT_procname = 'a2d_ASN1_OBJECT'; + ASN1_OBJECT_create_procname = 'ASN1_OBJECT_create'; + + ASN1_INTEGER_get_int64_procname = 'ASN1_INTEGER_get_int64'; {introduced 1.1.0} + ASN1_INTEGER_set_int64_procname = 'ASN1_INTEGER_set_int64'; {introduced 1.1.0} + ASN1_INTEGER_get_uint64_procname = 'ASN1_INTEGER_get_uint64'; {introduced 1.1.0} + ASN1_INTEGER_set_uint64_procname = 'ASN1_INTEGER_set_uint64'; {introduced 1.1.0} + + ASN1_INTEGER_set_procname = 'ASN1_INTEGER_set'; + ASN1_INTEGER_get_procname = 'ASN1_INTEGER_get'; + BN_to_ASN1_INTEGER_procname = 'BN_to_ASN1_INTEGER'; + ASN1_INTEGER_to_BN_procname = 'ASN1_INTEGER_to_BN'; + + ASN1_ENUMERATED_get_int64_procname = 'ASN1_ENUMERATED_get_int64'; {introduced 1.1.0} + ASN1_ENUMERATED_set_int64_procname = 'ASN1_ENUMERATED_set_int64'; {introduced 1.1.0} + + + ASN1_ENUMERATED_set_procname = 'ASN1_ENUMERATED_set'; + ASN1_ENUMERATED_get_procname = 'ASN1_ENUMERATED_get'; + BN_to_ASN1_ENUMERATED_procname = 'BN_to_ASN1_ENUMERATED'; + ASN1_ENUMERATED_to_BN_procname = 'ASN1_ENUMERATED_to_BN'; + + (* General *) + (* given a string, return the correct type, max is the maximum length *) + ASN1_PRINTABLE_type_procname = 'ASN1_PRINTABLE_type'; + + ASN1_tag2bit_procname = 'ASN1_tag2bit'; + + (* SPECIALS *) + ASN1_get_object_procname = 'ASN1_get_object'; + ASN1_check_infinite_end_procname = 'ASN1_check_infinite_end'; + ASN1_const_check_infinite_end_procname = 'ASN1_const_check_infinite_end'; + ASN1_put_object_procname = 'ASN1_put_object'; + ASN1_put_eoc_procname = 'ASN1_put_eoc'; + ASN1_object_size_procname = 'ASN1_object_size'; + + (* Used to implement other functions *) + //void *ASN1_dup(i2d_of_void *i2d, d2i_of_void *d2i, void *x); + // + //# define ASN1_dup_of(type,i2d,d2i,x) \ + // ((type*)ASN1_dup(CHECKED_I2D_OF(type, i2d), \ + // CHECKED_D2I_OF(type, d2i), \ + // CHECKED_PTR_OF(type, x))) + // + //# define ASN1_dup_of_const(type,i2d,d2i,x) \ + // ((type*)ASN1_dup(CHECKED_I2D_OF(const type, i2d), \ + // CHECKED_D2I_OF(type, d2i), \ + // CHECKED_PTR_OF(const type, x))) + // + ASN1_item_dup_procname = 'ASN1_item_dup'; + + (* ASN1 alloc/free macros for when a type is only used internally *) + + //# define M_ASN1_new_of(type) (type *)ASN1_item_new(ASN1_ITEM_rptr(type)) + //# define M_ASN1_free_of(x, type) \ + // ASN1_item_free(CHECKED_PTR_OF(type, x), ASN1_ITEM_rptr(type)) + // + //# ifndef OPENSSL_NO_STDIO + //void *ASN1_d2i_fp(void *(*xnew) (void), d2i_of_void *d2i, FILE *in, void **x); + + //# define ASN1_d2i_fp_of(type,xnew,d2i,in,x) \ + // ((type*)ASN1_d2i_fp(CHECKED_NEW_OF(type, xnew), \ + // CHECKED_D2I_OF(type, d2i), \ + // in, \ + // CHECKED_PPTR_OF(type, x))) + // + //function ASN1_item_d2i_fp(const it: PASN1_ITEM; in_: PFILE; x: Pointer): Pointer; + //function ASN1_i2d_fp(i2d: Pi2d_of_void; out_: PFILE; x: Pointer): TIdC_INT; + // + //# define ASN1_i2d_fp_of(type,i2d,out,x) \ + // (ASN1_i2d_fp(CHECKED_I2D_OF(type, i2d), \ + // out, \ + // CHECKED_PTR_OF(type, x))) + // + //# define ASN1_i2d_fp_of_const(type,i2d,out,x) \ + // (ASN1_i2d_fp(CHECKED_I2D_OF(const type, i2d), \ + // out, \ + // CHECKED_PTR_OF(const type, x))) + // + //function ASN1_item_i2d_fp(const it: PASN1_ITEM; out_: PFILE; x: Pointer): TIdC_INT; + //function ASN1_STRING_print_ex_fp(&fp: PFILE; const str: PASN1_STRING; flags: TIdC_ULONG): TIdC_INT; + //# endif + + ASN1_STRING_to_UTF8_procname = 'ASN1_STRING_to_UTF8'; + + //void *ASN1_d2i_bio(void *(*xnew) (void), d2i_of_void *d2i, BIO *in, void **x); + + //# define ASN1_d2i_bio_of(type,xnew,d2i,in,x) \ + // ((type*)ASN1_d2i_bio( CHECKED_NEW_OF(type, xnew), \ + // CHECKED_D2I_OF(type, d2i), \ + // in, \ + // CHECKED_PPTR_OF(type, x))) + + ASN1_item_d2i_bio_procname = 'ASN1_item_d2i_bio'; + ASN1_i2d_bio_procname = 'ASN1_i2d_bio'; + + //# define ASN1_i2d_bio_of(type,i2d,out,x) \ + // (ASN1_i2d_bio(CHECKED_I2D_OF(type, i2d), \ + // out, \ + // CHECKED_PTR_OF(type, x))) + // + //# define ASN1_i2d_bio_of_const(type,i2d,out,x) \ + // (ASN1_i2d_bio(CHECKED_I2D_OF(const type, i2d), \ + // out, \ + // CHECKED_PTR_OF(const type, x))) + ASN1_d2i_bio_procname = 'ASN1_d2i_bio'; + ASN1_item_i2d_bio_procname = 'ASN1_item_i2d_bio'; + ASN1_UTCTIME_print_procname = 'ASN1_UTCTIME_print'; + ASN1_GENERALIZEDTIME_print_procname = 'ASN1_GENERALIZEDTIME_print'; + ASN1_TIME_print_procname = 'ASN1_TIME_print'; + ASN1_STRING_print_procname = 'ASN1_STRING_print'; + ASN1_STRING_print_ex_procname = 'ASN1_STRING_print_ex'; + ASN1_buf_print_procname = 'ASN1_buf_print'; {introduced 1.1.0} + ASN1_bn_print_procname = 'ASN1_bn_print'; + ASN1_parse_procname = 'ASN1_parse'; + ASN1_parse_dump_procname = 'ASN1_parse_dump'; + ASN1_tag2str_procname = 'ASN1_tag2str'; + + (* Used to load and write Netscape format cert *) + + ASN1_UNIVERSALSTRING_to_string_procname = 'ASN1_UNIVERSALSTRING_to_string'; + + ASN1_TYPE_set_octetstring_procname = 'ASN1_TYPE_set_octetstring'; + ASN1_TYPE_get_octetstring_procname = 'ASN1_TYPE_get_octetstring'; + ASN1_TYPE_set_int_octetstring_procname = 'ASN1_TYPE_set_int_octetstring'; + ASN1_TYPE_get_int_octetstring_procname = 'ASN1_TYPE_get_int_octetstring'; + + ASN1_item_unpack_procname = 'ASN1_item_unpack'; + + ASN1_item_pack_procname = 'ASN1_item_pack'; + + ASN1_STRING_set_default_mask_procname = 'ASN1_STRING_set_default_mask'; + ASN1_STRING_set_default_mask_asc_procname = 'ASN1_STRING_set_default_mask_asc'; + ASN1_STRING_get_default_mask_procname = 'ASN1_STRING_get_default_mask'; + ASN1_mbstring_copy_procname = 'ASN1_mbstring_copy'; + ASN1_mbstring_ncopy_procname = 'ASN1_mbstring_ncopy'; + + ASN1_STRING_set_by_NID_procname = 'ASN1_STRING_set_by_NID'; + ASN1_STRING_TABLE_get_procname = 'ASN1_STRING_TABLE_get'; + ASN1_STRING_TABLE_add_procname = 'ASN1_STRING_TABLE_add'; + ASN1_STRING_TABLE_cleanup_procname = 'ASN1_STRING_TABLE_cleanup'; + + (* ASN1 template functions *) + + (* Old API compatible functions *) + ASN1_item_new_procname = 'ASN1_item_new'; + ASN1_item_free_procname = 'ASN1_item_free'; + ASN1_item_d2i_procname = 'ASN1_item_d2i'; + ASN1_item_i2d_procname = 'ASN1_item_i2d'; + ASN1_item_ndef_i2d_procname = 'ASN1_item_ndef_i2d'; + + ASN1_add_oid_module_procname = 'ASN1_add_oid_module'; + ASN1_add_stable_module_procname = 'ASN1_add_stable_module'; {introduced 1.1.0} + + ASN1_generate_nconf_procname = 'ASN1_generate_nconf'; + ASN1_generate_v3_procname = 'ASN1_generate_v3'; + ASN1_str2mask_procname = 'ASN1_str2mask'; {introduced 1.1.0} + + ASN1_item_print_procname = 'ASN1_item_print'; + ASN1_PCTX_new_procname = 'ASN1_PCTX_new'; + ASN1_PCTX_free_procname = 'ASN1_PCTX_free'; + ASN1_PCTX_get_flags_procname = 'ASN1_PCTX_get_flags'; + ASN1_PCTX_set_flags_procname = 'ASN1_PCTX_set_flags'; + ASN1_PCTX_get_nm_flags_procname = 'ASN1_PCTX_get_nm_flags'; + ASN1_PCTX_set_nm_flags_procname = 'ASN1_PCTX_set_nm_flags'; + ASN1_PCTX_get_cert_flags_procname = 'ASN1_PCTX_get_cert_flags'; + ASN1_PCTX_set_cert_flags_procname = 'ASN1_PCTX_set_cert_flags'; + ASN1_PCTX_get_oid_flags_procname = 'ASN1_PCTX_get_oid_flags'; + ASN1_PCTX_set_oid_flags_procname = 'ASN1_PCTX_set_oid_flags'; + ASN1_PCTX_get_str_flags_procname = 'ASN1_PCTX_get_str_flags'; + ASN1_PCTX_set_str_flags_procname = 'ASN1_PCTX_set_str_flags'; + + //ASN1_SCTX *ASN1_SCTX_new(int (*scan_cb) (ASN1_SCTX *ctx)); + ASN1_SCTX_free_procname = 'ASN1_SCTX_free'; {introduced 1.1.0} + ASN1_SCTX_get_item_procname = 'ASN1_SCTX_get_item'; {introduced 1.1.0} + ASN1_SCTX_get_template_procname = 'ASN1_SCTX_get_template'; {introduced 1.1.0} + ASN1_SCTX_get_flags_procname = 'ASN1_SCTX_get_flags'; {introduced 1.1.0} + ASN1_SCTX_set_app_data_procname = 'ASN1_SCTX_set_app_data'; {introduced 1.1.0} + ASN1_SCTX_get_app_data_procname = 'ASN1_SCTX_get_app_data'; {introduced 1.1.0} + + BIO_f_asn1_procname = 'BIO_f_asn1'; + + BIO_new_NDEF_procname = 'BIO_new_NDEF'; + + i2d_ASN1_bio_stream_procname = 'i2d_ASN1_bio_stream'; + PEM_write_bio_ASN1_stream_procname = 'PEM_write_bio_ASN1_stream'; + //function SMIME_write_ASN1(bio: PBIO; val: PASN1_VALUE; data: PBIO; flags: TIdC_INT; + // ctype_nid: TIdC_INT; econt_nid: TIdC_INT; + // STACK_OF(X509_ALGOR) *mdalgs, const ASN1_ITEM *it): TIdC_INT; + SMIME_read_ASN1_procname = 'SMIME_read_ASN1'; + SMIME_crlf_copy_procname = 'SMIME_crlf_copy'; + SMIME_text_procname = 'SMIME_text'; + + ASN1_ITEM_lookup_procname = 'ASN1_ITEM_lookup'; {introduced 1.1.0} + ASN1_ITEM_get_procname = 'ASN1_ITEM_get'; {introduced 1.1.0} + + +{$WARN NO_RETVAL OFF} +function ERR_ASN1_TYPE_get(const a: PASN1_TYPE): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_TYPE_get_procname); +end; + + +procedure ERR_ASN1_TYPE_set(a: PASN1_TYPE; type_: TIdC_INT; value: Pointer); +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_TYPE_set_procname); +end; + + +function ERR_ASN1_TYPE_set1(a: PASN1_TYPE; type_: TIdC_INT; const value: Pointer): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_TYPE_set1_procname); +end; + + +function ERR_ASN1_TYPE_cmp(const a: PASN1_TYPE; const b: PASN1_TYPE): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_TYPE_cmp_procname); +end; + + + +function ERR_ASN1_TYPE_pack_sequence(const it: PASN1_ITEM; s: Pointer; t: PPASN1_TYPE): PASN1_TYPE; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_TYPE_pack_sequence_procname); +end; + + {introduced 1.1.0} +function ERR_ASN1_TYPE_unpack_sequence(const it: PASN1_ITEM; const t: PASN1_TYPE): Pointer; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_TYPE_unpack_sequence_procname); +end; + + {introduced 1.1.0} + +function ERR_ASN1_OBJECT_new: PASN1_OBJECT; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_OBJECT_new_procname); +end; + + +procedure ERR_ASN1_OBJECT_free(a: PASN1_OBJECT); +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_OBJECT_free_procname); +end; + + +function ERR_i2d_ASN1_OBJECT(const a: PASN1_OBJECT; pp: PPByte): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(i2d_ASN1_OBJECT_procname); +end; + + +function ERR_d2i_ASN1_OBJECT(a: PPASN1_OBJECT; const pp: PPByte; length: TIdC_LONG): PASN1_OBJECT; +begin + EIdAPIFunctionNotPresent.RaiseException(d2i_ASN1_OBJECT_procname); +end; + +function ERR_i2d_ASN1_BIT_STRING(val_in : PASN1_BIT_STRING; der_out : PPAnsiChar) : TIdC_long; +begin + EIdAPIFunctionNotPresent.RaiseException(i2d_ASN1_BIT_STRING_procname); +end; + +function ERR_d2i_ASN1_BIT_STRING(val_out : PPASN1_BIT_STRING; const der_in : PPAnsiChar; length : TIdC_LONG) : PASN1_BIT_STRING; +begin + EIdAPIFunctionNotPresent.RaiseException(d2i_ASN1_BIT_STRING_procname); +end; + + //DECLARE_ASN1_ITEM(ASN1_OBJECT) + // + //DEFINE_STACK_OF(ASN1_OBJECT) + +function ERR_ASN1_STRING_new: PASN1_STRING; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_STRING_new_procname); +end; + + +procedure ERR_ASN1_STRING_free(a: PASN1_STRING); +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_STRING_free_procname); +end; + + +procedure ERR_ASN1_STRING_clear_free(a: PASN1_STRING); +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_STRING_clear_free_procname); +end; + + +function ERR_ASN1_STRING_copy(dst: PASN1_STRING; const str: PASN1_STRING): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_STRING_copy_procname); +end; + + +function ERR_ASN1_STRING_dup(const a: PASN1_STRING): PASN1_STRING; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_STRING_dup_procname); +end; + + +function ERR_ASN1_STRING_type_new(type_: TIdC_INT): PASN1_STRING; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_STRING_type_new_procname); +end; + + +function ERR_ASN1_STRING_cmp(const a: PASN1_STRING; const b: PASN1_STRING): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_STRING_cmp_procname); +end; + + + + (* + * Since this is used to store all sorts of things, via macros, for now, + * make its data void * + *) +function ERR_ASN1_STRING_set(str: PASN1_STRING; const data: Pointer; len: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_STRING_set_procname); +end; + + +procedure ERR_ASN1_STRING_set0(str: PASN1_STRING; data: Pointer; len: TIdC_INT); +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_STRING_set0_procname); +end; + + +function ERR_ASN1_STRING_length(const x: PASN1_STRING): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_STRING_length_procname); +end; + + +procedure ERR_ASN1_STRING_length_set(x: PASN1_STRING; n: TIdC_INT); +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_STRING_length_set_procname); +end; + + +function ERR_ASN1_STRING_type(const x: PASN1_STRING): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_STRING_type_procname); +end; + + +function ERR_ASN1_STRING_get0_data(const x: PASN1_STRING): PByte; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_STRING_get0_data_procname); +end; + + {introduced 1.1.0} + + //DECLARE_ASN1_FUNCTIONS(ASN1_BIT_STRING) +function ERR_ASN1_BIT_STRING_set(a: PASN1_BIT_STRING; d: PByte; length: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_BIT_STRING_set_procname); +end; + + +function ERR_ASN1_BIT_STRING_set_bit(a: PASN1_BIT_STRING; n: TIdC_INT; value: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_BIT_STRING_set_bit_procname); +end; + + +function ERR_ASN1_BIT_STRING_get_bit(const a: PASN1_BIT_STRING; n: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_BIT_STRING_get_bit_procname); +end; + + +function ERR_ASN1_BIT_STRING_check(const a: PASN1_BIT_STRING; const flags: PByte; flags_len: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_BIT_STRING_check_procname); +end; + + + +function ERR_ASN1_BIT_STRING_name_print(out_: PBIO; bs: PASN1_BIT_STRING; tbl: PBIT_STRING_BITNAME; indent: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_BIT_STRING_name_print_procname); +end; + + +function ERR_ASN1_BIT_STRING_num_asc(const name: PIdAnsiChar; tbl: PBIT_STRING_BITNAME): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_BIT_STRING_num_asc_procname); +end; + + +function ERR_ASN1_BIT_STRING_set_asc(bs: PASN1_BIT_STRING; const name: PIdAnsiChar; value: TIdC_INT; tbl: PBIT_STRING_BITNAME): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_BIT_STRING_set_asc_procname); +end; + + + +function ERR_ASN1_INTEGER_new: PASN1_INTEGER; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_INTEGER_new_procname); +end; + + +procedure ERR_ASN1_INTEGER_free(a: PASN1_INTEGER); +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_INTEGER_free_procname); +end; + + +function ERR_d2i_ASN1_INTEGER(a: PPASN1_INTEGER; const in_: PPByte; len: TIdC_Long): PASN1_INTEGER; +begin + EIdAPIFunctionNotPresent.RaiseException(d2i_ASN1_INTEGER_procname); +end; + + +function ERR_i2d_ASN1_INTEGER(a: PASN1_INTEGER; out_: PPByte): TIdC_Int; +begin + EIdAPIFunctionNotPresent.RaiseException(i2d_ASN1_INTEGER_procname); +end; + + + +function ERR_d2i_ASN1_UINTEGER(a: PPASN1_INTEGER; const pp: PPByte; length: TIdC_LONG): PASN1_INTEGER; +begin + EIdAPIFunctionNotPresent.RaiseException(d2i_ASN1_UINTEGER_procname); +end; + + +function ERR_ASN1_INTEGER_dup(const x: PASN1_INTEGER): PASN1_INTEGER; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_INTEGER_dup_procname); +end; + + +function ERR_ASN1_INTEGER_cmp(const x: PASN1_INTEGER; const y: PASN1_INTEGER): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_INTEGER_cmp_procname); +end; + + + + // DECLARE_ASN1_FUNCTIONS(ASN1_ENUMERATED) + +function ERR_ASN1_UTCTIME_check(const a: PASN1_UTCTIME): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_UTCTIME_check_procname); +end; + + +function ERR_ASN1_UTCTIME_set(s: PASN1_UTCTIME; t: TIdC_TIMET): PASN1_UTCTIME; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_UTCTIME_set_procname); +end; + + +function ERR_ASN1_UTCTIME_adj(s: PASN1_UTCTIME; t: TIdC_TIMET; offset_day: TIdC_INT; offset_sec: TIdC_LONG): PASN1_UTCTIME; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_UTCTIME_adj_procname); +end; + + +function ERR_ASN1_UTCTIME_set_string(s: PASN1_UTCTIME; const str: PAnsiChar): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_UTCTIME_set_string_procname); +end; + + +function ERR_ASN1_UTCTIME_cmp_time_t(const s: PASN1_UTCTIME; t: TIdC_TIMET): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_UTCTIME_cmp_time_t_procname); +end; + + + +function ERR_ASN1_GENERALIZEDTIME_check(const a: PASN1_GENERALIZEDTIME): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_GENERALIZEDTIME_check_procname); +end; + + +function ERR_ASN1_GENERALIZEDTIME_set(s: PASN1_GENERALIZEDTIME; t: TIdC_TIMET): PASN1_GENERALIZEDTIME; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_GENERALIZEDTIME_set_procname); +end; + + +function ERR_ASN1_GENERALIZEDTIME_adj(s: PASN1_GENERALIZEDTIME; t: TIdC_TIMET; offset_day: TIdC_INT; offset_sec: TIdC_LONG): PASN1_GENERALIZEDTIME; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_GENERALIZEDTIME_adj_procname); +end; + + +function ERR_ASN1_GENERALIZEDTIME_set_string(s: pASN1_GENERALIZEDTIME; const str: PAnsiChar): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_GENERALIZEDTIME_set_string_procname); +end; + + + +function ERR_ASN1_TIME_diff(pday: PIdC_INT; psec: PIdC_INT; const from: PASN1_TIME; const to_: PASN1_TIME): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_TIME_diff_procname); +end; + + + + // DECLARE_ASN1_FUNCTIONS(ASN1_OCTET_STRING) +function ERR_ASN1_OCTET_STRING_dup(const a: PASN1_OCTET_STRING): PASN1_OCTET_STRING; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_OCTET_STRING_dup_procname); +end; + + +function ERR_ASN1_OCTET_STRING_cmp(const a: PASN1_OCTET_STRING; const b: PASN1_OCTET_STRING): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_OCTET_STRING_cmp_procname); +end; + + +function ERR_ASN1_OCTET_STRING_set(str: PASN1_OCTET_STRING; const data: PByte; len: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_OCTET_STRING_set_procname); +end; + +function ERR_d2i_ASN1_OCTET_STRING(val_out : PPASN1_OCTET_STRING; der_in : PPAnsiChar; length : TIdC_LONG) : PASN1_OCTET_STRING; +begin + EIdAPIFunctionNotPresent.RaiseException(d2i_ASN1_OCTET_STRING_procname); +end; + +function ERR_i2d_ASN1_OCTET_STRING(val_in : PASN1_OCTET_STRING; der_out : PPAnsiChar) : TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(i2d_ASN1_OCTET_STRING_procname); +end; + +procedure ERR_ASN1_OCTET_STRING_free (a : PASN1_OCTET_STRING); +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_OCTET_STRING_free_procname); +end; + + //DECLARE_ASN1_FUNCTIONS(ASN1_VISIBLESTRING) + //DECLARE_ASN1_FUNCTIONS(ASN1_UNIVERSALSTRING) + //DECLARE_ASN1_FUNCTIONS(ASN1_UTF8STRING) + //DECLARE_ASN1_FUNCTIONS(ASN1_NULL) + //DECLARE_ASN1_FUNCTIONS(ASN1_BMPSTRING) + +function ERR_UTF8_getc(const str: PByte; len: TIdC_INT; val: PIdC_ULONG): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(UTF8_getc_procname); +end; + + +function ERR_UTF8_putc(str: PIdAnsiChar; len: TIdC_INT; value: TIdC_ULONG): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(UTF8_putc_procname); +end; + + + + //DECLARE_ASN1_FUNCTIONS_name(ASN1_STRING, ASN1_PRINTABLE) + // + //DECLARE_ASN1_FUNCTIONS_name(ASN1_STRING, DIRECTORYSTRING) + //DECLARE_ASN1_FUNCTIONS_name(ASN1_STRING, DISPLAYTEXT) + //DECLARE_ASN1_FUNCTIONS(ASN1_PRINTABLESTRING) + //DECLARE_ASN1_FUNCTIONS(ASN1_T61STRING) + //DECLARE_ASN1_FUNCTIONS(ASN1_IA5STRING) + //DECLARE_ASN1_FUNCTIONS(ASN1_GENERALSTRING) + +function ERR_ASN1_UTCTIME_new: PASN1_UTCTIME; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_UTCTIME_new_procname); +end; + + +procedure ERR_ASN1_UTCTIME_free(a: PASN1_UTCTIME); +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_UTCTIME_free_procname); +end; + + +function ERR_d2i_ASN1_UTCTIME(a: PPASN1_UTCTIME; const in_: PPByte; len: TIdC_LONG): PASN1_UTCTIME; +begin + EIdAPIFunctionNotPresent.RaiseException(d2i_ASN1_UTCTIME_procname); +end; + + +function ERR_i2d_ASN1_UTCTIME(a: PASN1_UTCTIME; out_: PPByte): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(i2d_ASN1_UTCTIME_procname); +end; + + + +function ERR_ASN1_GENERALIZEDTIME_new: PASN1_GENERALIZEDTIME; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_GENERALIZEDTIME_new_procname); +end; + + +procedure ERR_ASN1_GENERALIZEDTIME_free(a: PASN1_GENERALIZEDTIME); +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_GENERALIZEDTIME_free_procname); +end; + + +function ERR_d2i_ASN1_GENERALIZEDTIME(a: PPASN1_GENERALIZEDTIME; const in_: PPByte; len: TIdC_LONG): PASN1_GENERALIZEDTIME; +begin + EIdAPIFunctionNotPresent.RaiseException(d2i_ASN1_GENERALIZEDTIME_procname); +end; + + +function ERR_i2d_ASN1_GENERALIZEDTIME(a: PASN1_GENERALIZEDTIME; out_: PPByte): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(i2d_ASN1_GENERALIZEDTIME_procname); +end; + + + +function ERR_ASN1_TIME_new: PASN1_TIME; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_TIME_new_procname); +end; + + +procedure ERR_ASN1_TIME_free(a: PASN1_TIME); +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_TIME_free_procname); +end; + + +function ERR_d2i_ASN1_TIME(a: PPASN1_TIME; const in_: PPByte; len: TIdC_LONG): PASN1_TIME; +begin + EIdAPIFunctionNotPresent.RaiseException(d2i_ASN1_TIME_procname); +end; + + +function ERR_i2d_ASN1_TIME(a: PASN1_TIME; out_: PPByte): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(i2d_ASN1_TIME_procname); +end; + + + + // DECLARE_ASN1_ITEM(ASN1_OCTET_STRING_NDEF) + +function ERR_ASN1_TIME_set(s: PASN1_TIME; t: TIdC_TIMET): PASN1_TIME; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_TIME_set_procname); +end; + + +function ERR_ASN1_TIME_adj(s: PASN1_TIME; t: TIdC_TIMET; offset_day: TIdC_INT; offset_sec: TIdC_LONG): PASN1_TIME; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_TIME_adj_procname); +end; + + +function ERR_ASN1_TIME_check(const t: PASN1_TIME): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_TIME_check_procname); +end; + + +function ERR_ASN1_TIME_to_generalizedtime(const t: PASN1_TIME; out_: PPASN1_GENERALIZEDTIME): PASN1_GENERALIZEDTIME; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_TIME_to_generalizedtime_procname); +end; + + +function ERR_ASN1_TIME_set_string(s: PASN1_TIME; const str: PIdAnsiChar): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_TIME_set_string_procname); +end; + + +function ERR_ASN1_TIME_set_string_X509(s: PASN1_TIME; const str: PIdAnsiChar): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_TIME_set_string_X509_procname); +end; + + {introduced 1.1.0} +function ERR_ASN1_TIME_to_tm(const s: PASN1_TIME; tm: PIdC_TM): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_TIME_to_tm_procname); +end; + + {introduced 1.1.0} +function ERR_ASN1_TIME_normalize(s: PASN1_TIME): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_TIME_normalize_procname); +end; + + {introduced 1.1.0} +function ERR_ASN1_TIME_cmp_time_t(const s: PASN1_TIME; t: TIdC_TIMET): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_TIME_cmp_time_t_procname); +end; + + {introduced 1.1.0} +function ERR_ASN1_TIME_compare(const a: PASN1_TIME; const b: PASN1_TIME): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_TIME_compare_procname); +end; + + {introduced 1.1.0} + +function ERR_i2a_ASN1_INTEGER(bp: PBIO; const a: PASN1_INTEGER): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(i2a_ASN1_INTEGER_procname); +end; + + +function ERR_a2i_ASN1_INTEGER(bp: PBIO; bs: PASN1_INTEGER; buf: PIdAnsiChar; size: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(a2i_ASN1_INTEGER_procname); +end; + + +function ERR_i2a_ASN1_ENUMERATED(bp: PBIO; const a: PASN1_ENUMERATED): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(i2a_ASN1_ENUMERATED_procname); +end; + + +function ERR_a2i_ASN1_ENUMERATED(bp: PBIO; bs: PASN1_ENUMERATED; buf: PIdAnsiChar; size: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(a2i_ASN1_ENUMERATED_procname); +end; + + +function ERR_i2a_ASN1_OBJECT(bp: PBIO; const a: PASN1_OBJECT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(i2a_ASN1_OBJECT_procname); +end; + + +function ERR_a2i_ASN1_STRING(bp: PBIO; bs: PASN1_STRING; buf: PAnsiChar; size: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(a2i_ASN1_STRING_procname); +end; + + +function ERR_i2a_ASN1_STRING(bp: PBIO; const a: PASN1_STRING; type_: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(i2a_ASN1_STRING_procname); +end; + + +function ERR_i2t_ASN1_OBJECT(buf: PAnsiChar; buf_len: TIdC_INT; const a: PASN1_OBJECT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(i2t_ASN1_OBJECT_procname); +end; + + + +function ERR_a2d_ASN1_OBJECT(out_: PByte; olen: TIdC_INT; const buf: PIdAnsiChar; num: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(a2d_ASN1_OBJECT_procname); +end; + + +function ERR_ASN1_OBJECT_create(nid: TIdC_INT; data: PByte; len: TIdC_INT; const sn: PAnsiChar; const ln: PAnsiChar): PASN1_OBJECT; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_OBJECT_create_procname); +end; + + + +function ERR_ASN1_INTEGER_get_int64(pr: PIdC_Int64; const a: PASN1_INTEGER): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_INTEGER_get_int64_procname); +end; + + {introduced 1.1.0} +function ERR_ASN1_INTEGER_set_int64(a: PASN1_INTEGER; r: TIdC_Int64): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_INTEGER_set_int64_procname); +end; + + {introduced 1.1.0} +function ERR_ASN1_INTEGER_get_uint64(pr: PIdC_UInt64; const a: PASN1_INTEGER): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_INTEGER_get_uint64_procname); +end; + + {introduced 1.1.0} +function ERR_ASN1_INTEGER_set_uint64(a: PASN1_INTEGER; r: TIdC_UInt64): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_INTEGER_set_uint64_procname); +end; + + {introduced 1.1.0} + +function ERR_ASN1_INTEGER_set(a: PASN1_INTEGER; v: TIdC_LONG): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_INTEGER_set_procname); +end; + + +function ERR_ASN1_INTEGER_get(const a: PASN1_INTEGER): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_INTEGER_get_procname); +end; + + +function ERR_BN_to_ASN1_INTEGER(const bn: PBIGNUM; ai: PASN1_INTEGER): PASN1_INTEGER; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_to_ASN1_INTEGER_procname); +end; + + +function ERR_ASN1_INTEGER_to_BN(const ai: PASN1_INTEGER; bn: PBIGNUM): PBIGNUM; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_INTEGER_to_BN_procname); +end; + + + +function ERR_ASN1_ENUMERATED_get_int64(pr: PIdC_Int64; const a: PASN1_ENUMERATED): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_ENUMERATED_get_int64_procname); +end; + + {introduced 1.1.0} +function ERR_ASN1_ENUMERATED_set_int64(a: PASN1_ENUMERATED; r: TIdC_Int64): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_ENUMERATED_set_int64_procname); +end; + + {introduced 1.1.0} + + +function ERR_ASN1_ENUMERATED_set(a: PASN1_ENUMERATED; v: TIdC_LONG): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_ENUMERATED_set_procname); +end; + + +function ERR_ASN1_ENUMERATED_get(const a: PASN1_ENUMERATED): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_ENUMERATED_get_procname); +end; + + +function ERR_BN_to_ASN1_ENUMERATED(const bn: PBIGNUM; ai: PASN1_ENUMERATED): PASN1_ENUMERATED; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_to_ASN1_ENUMERATED_procname); +end; + + +function ERR_ASN1_ENUMERATED_to_BN(const ai: PASN1_ENUMERATED; bn: PBIGNUM): PBIGNUM; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_ENUMERATED_to_BN_procname); +end; + + + + (* General *) + (* given a string, return the correct type, max is the maximum length *) +function ERR_ASN1_PRINTABLE_type(const s: PByte; max: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_PRINTABLE_type_procname); +end; + + + +function ERR_ASN1_tag2bit(tag: TIdC_INT): TIdC_ULONG; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_tag2bit_procname); +end; + + + + (* SPECIALS *) +function ERR_ASN1_get_object(const pp: PPByte; plength: PIdC_LONG; ptag: PIdC_INT; pclass: PIdC_INT; omax: TIdC_LONG): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_get_object_procname); +end; + + +function ERR_ASN1_check_infinite_end(p: PPByte; len: TIdC_LONG): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_check_infinite_end_procname); +end; + + +function ERR_ASN1_const_check_infinite_end(const p: PPByte; len: TIdC_LONG): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_const_check_infinite_end_procname); +end; + + +procedure ERR_ASN1_put_object(pp: PPByte; constructed: TIdC_INT; length: TIdC_INT; tag: TIdC_INT; xclass: TIdC_INT); +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_put_object_procname); +end; + + +function ERR_ASN1_put_eoc(pp: PPByte): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_put_eoc_procname); +end; + + +function ERR_ASN1_object_size(constructed: TIdC_INT; length: TIdC_INT; tag: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_object_size_procname); +end; + + + + (* Used to implement other functions *) + //void *ASN1_dup(i2d_of_void *i2d, d2i_of_void *d2i, void *x); + // + //# define ASN1_dup_of(type,i2d,d2i,x) \ + // ((type*)ASN1_dup(CHECKED_I2D_OF(type, i2d), \ + // CHECKED_D2I_OF(type, d2i), \ + // CHECKED_PTR_OF(type, x))) + // + //# define ASN1_dup_of_const(type,i2d,d2i,x) \ + // ((type*)ASN1_dup(CHECKED_I2D_OF(const type, i2d), \ + // CHECKED_D2I_OF(type, d2i), \ + // CHECKED_PTR_OF(const type, x))) + // +function ERR_ASN1_item_dup(const it: PASN1_ITEM; x: Pointer): Pointer; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_item_dup_procname); +end; + + + + (* ASN1 alloc/free macros for when a type is only used internally *) + + //# define M_ASN1_new_of(type) (type *)ASN1_item_new(ASN1_ITEM_rptr(type)) + //# define M_ASN1_free_of(x, type) \ + // ASN1_item_free(CHECKED_PTR_OF(type, x), ASN1_ITEM_rptr(type)) + // + //# ifndef OPENSSL_NO_STDIO + //void *ASN1_d2i_fp(void *(*xnew) (void), d2i_of_void *d2i, FILE *in, void **x); + + //# define ASN1_d2i_fp_of(type,xnew,d2i,in,x) \ + // ((type*)ASN1_d2i_fp(CHECKED_NEW_OF(type, xnew), \ + // CHECKED_D2I_OF(type, d2i), \ + // in, \ + // CHECKED_PPTR_OF(type, x))) + // + //function ASN1_item_d2i_fp(const it: PASN1_ITEM; in_: PFILE; x: Pointer): Pointer; + //function ASN1_i2d_fp(i2d: Pi2d_of_void; out_: PFILE; x: Pointer): TIdC_INT; + // + //# define ASN1_i2d_fp_of(type,i2d,out,x) \ + // (ASN1_i2d_fp(CHECKED_I2D_OF(type, i2d), \ + // out, \ + // CHECKED_PTR_OF(type, x))) + // + //# define ASN1_i2d_fp_of_const(type,i2d,out,x) \ + // (ASN1_i2d_fp(CHECKED_I2D_OF(const type, i2d), \ + // out, \ + // CHECKED_PTR_OF(const type, x))) + // + //function ASN1_item_i2d_fp(const it: PASN1_ITEM; out_: PFILE; x: Pointer): TIdC_INT; + //function ASN1_STRING_print_ex_fp(&fp: PFILE; const str: PASN1_STRING; flags: TIdC_ULONG): TIdC_INT; + //# endif + +function ERR_ASN1_STRING_to_UTF8(out_: PPByte; const in_: PASN1_STRING): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_STRING_to_UTF8_procname); +end; + +function ERR_ASN1_d2i_bio(xnew: pxnew; d2i: pd2i_of_void; in_: PBIO; x: PPointer): Pointer; cdecl; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_d2i_bio_procname); +end; + + //void *ASN1_d2i_bio(void *(*xnew) (void), d2i_of_void *d2i, BIO *in, void **x); + + //# define ASN1_d2i_bio_of(type,xnew,d2i,in,x) \ + // ((type*)ASN1_d2i_bio( CHECKED_NEW_OF(type, xnew), \ + // CHECKED_D2I_OF(type, d2i), \ + // in, \ + // CHECKED_PPTR_OF(type, x))) + +function ERR_ASN1_item_d2i_bio(const it: PASN1_ITEM; in_: PBIO; x: Pointer): Pointer; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_item_d2i_bio_procname); +end; + + +function ERR_ASN1_i2d_bio(i2d: Pi2d_of_void; out_: PBIO; x: PByte): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_i2d_bio_procname); +end; + + + + //# define ASN1_i2d_bio_of(type,i2d,out,x) \ + // (ASN1_i2d_bio(CHECKED_I2D_OF(type, i2d), \ + // out, \ + // CHECKED_PTR_OF(type, x))) + // + //# define ASN1_i2d_bio_of_const(type,i2d,out,x) \ + // (ASN1_i2d_bio(CHECKED_I2D_OF(const type, i2d), \ + // out, \ + // CHECKED_PTR_OF(const type, x))) + +function ERR_ASN1_item_i2d_bio(const it: PASN1_ITEM; out_: PBIO; x: Pointer): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_item_i2d_bio_procname); +end; + + +function ERR_ASN1_UTCTIME_print(fp: PBIO; const a: PASN1_UTCTIME): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_UTCTIME_print_procname); +end; + + +function ERR_ASN1_GENERALIZEDTIME_print(fp: PBIO; const a: PASN1_GENERALIZEDTIME): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_GENERALIZEDTIME_print_procname); +end; + + +function ERR_ASN1_TIME_print(fp: PBIO; const a: PASN1_TIME): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_TIME_print_procname); +end; + + +function ERR_ASN1_STRING_print(bp: PBIO; const v: PASN1_STRING): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_STRING_print_procname); +end; + + +function ERR_ASN1_STRING_print_ex(out_: PBIO; const str: PASN1_STRING; flags: TIdC_ULONG): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_STRING_print_ex_procname); +end; + + +function ERR_ASN1_buf_print(bp: PBIO; const buf: PByte; buflen: TIdC_SIZET; off: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_buf_print_procname); +end; + + {introduced 1.1.0} +function ERR_ASN1_bn_print(bp: PBIO; const number: PIdAnsiChar; const num: PBIGNUM; buf: PByte; off: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_bn_print_procname); +end; + + +function ERR_ASN1_parse(bp: PBIO; const pp: PByte; len: TIdC_LONG; indent: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_parse_procname); +end; + + +function ERR_ASN1_parse_dump(bp: PPBIO; const pp: PByte; len: TIdC_LONG; indent: TIdC_INT; dump: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_parse_dump_procname); +end; + + +function ERR_ASN1_tag2str(tag: TIdC_INT): PIdAnsiChar; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_tag2str_procname); +end; + + + + (* Used to load and write Netscape format cert *) + +function ERR_ASN1_UNIVERSALSTRING_to_string(s: PASN1_UNIVERSALSTRING): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_UNIVERSALSTRING_to_string_procname); +end; + + + +function ERR_ASN1_TYPE_set_octetstring(a: PASN1_TYPE; data: PByte; len: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_TYPE_set_octetstring_procname); +end; + + +function ERR_ASN1_TYPE_get_octetstring(const a: PASN1_TYPE; data: PByte; max_len: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_TYPE_get_octetstring_procname); +end; + + +function ERR_ASN1_TYPE_set_int_octetstring(a: PASN1_TYPE; num: TIdC_LONG; data: PByte; len: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_TYPE_set_int_octetstring_procname); +end; + + +function ERR_ASN1_TYPE_get_int_octetstring(const a: PASN1_TYPE; num: PIdC_LONG; data: PByte; max_len: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_TYPE_get_int_octetstring_procname); +end; + + + +function ERR_ASN1_item_unpack(const oct: PASN1_STRING; const it: PASN1_ITEM): Pointer; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_item_unpack_procname); +end; + + + +function ERR_ASN1_item_pack(obj: Pointer; const it: PASN1_ITEM; oct: PPASN1_OCTET_STRING): PASN1_STRING; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_item_pack_procname); +end; + + + +procedure ERR_ASN1_STRING_set_default_mask(mask: TIdC_ULONG); +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_STRING_set_default_mask_procname); +end; + + +function ERR_ASN1_STRING_set_default_mask_asc(const p: PAnsiChar): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_STRING_set_default_mask_asc_procname); +end; + + +function ERR_ASN1_STRING_get_default_mask: TIdC_ULONG; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_STRING_get_default_mask_procname); +end; + + +function ERR_ASN1_mbstring_copy(out_: PPASN1_STRING; const in_: PByte; len: TIdC_INT; inform: TIdC_INT; mask: TIdC_ULONG): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_mbstring_copy_procname); +end; + + +function ERR_ASN1_mbstring_ncopy(out_: PPASN1_STRING; const in_: PByte; len: TIdC_INT; inform: TIdC_INT; mask: TIdC_ULONG; minsize: TIdC_LONG; maxsize: TIdC_LONG): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_mbstring_ncopy_procname); +end; + + + +function ERR_ASN1_STRING_set_by_NID(out_: PPASN1_STRING; const in_: PByte; inlen: TIdC_INT; inform: TIdC_INT; nid: TIdC_INT): PASN1_STRING; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_STRING_set_by_NID_procname); +end; + + +function ERR_ASN1_STRING_TABLE_get(nid: TIdC_INT): PASN1_STRING_TABLE; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_STRING_TABLE_get_procname); +end; + + +function ERR_ASN1_STRING_TABLE_add(v1: TIdC_INT; v2: TIdC_LONG; v3: TIdC_LONG; v4: TIdC_ULONG; v5: TIdC_ULONG): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_STRING_TABLE_add_procname); +end; + + +procedure ERR_ASN1_STRING_TABLE_cleanup; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_STRING_TABLE_cleanup_procname); +end; + + + + (* ASN1 template functions *) + + (* Old API compatible functions *) +function ERR_ASN1_item_new(const it: PASN1_ITEM): PASN1_VALUE; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_item_new_procname); +end; + + +procedure ERR_ASN1_item_free(val: PASN1_VALUE; const it: PASN1_ITEM); +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_item_free_procname); +end; + + +function ERR_ASN1_item_d2i(val: PPASN1_VALUE; const in_: PPByte; len: TIdC_LONG; const it: PASN1_ITEM): PASN1_VALUE; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_item_d2i_procname); +end; + + +function ERR_ASN1_item_i2d(val: PASN1_VALUE; out_: PPByte; const it: PASN1_ITEM): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_item_i2d_procname); +end; + + +function ERR_ASN1_item_ndef_i2d(val: PASN1_VALUE; out_: PPByte; const it: PASN1_ITEM): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_item_ndef_i2d_procname); +end; + + + +procedure ERR_ASN1_add_oid_module; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_add_oid_module_procname); +end; + + +procedure ERR_ASN1_add_stable_module; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_add_stable_module_procname); +end; + + {introduced 1.1.0} + +function ERR_ASN1_generate_nconf(const str: PAnsiChar; nconf: PCONF): PASN1_TYPE; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_generate_nconf_procname); +end; + + +function ERR_ASN1_generate_v3(const str: PAnsiChar; cnf: PX509V3_CTX): PASN1_TYPE; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_generate_v3_procname); +end; + + +function ERR_ASN1_str2mask(const str: PByte; pmask: PIdC_ULONG): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_str2mask_procname); +end; + + {introduced 1.1.0} + +function ERR_ASN1_item_print(out_: PBIO; ifld: PASN1_VALUE; indent: TIdC_INT; const it: PASN1_ITEM; const pctx: PASN1_PCTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_item_print_procname); +end; + + +function ERR_ASN1_PCTX_new: PASN1_PCTX; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_PCTX_new_procname); +end; + + +procedure ERR_ASN1_PCTX_free(p: PASN1_PCTX); +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_PCTX_free_procname); +end; + + +function ERR_ASN1_PCTX_get_flags(const p: PASN1_PCTX): TIdC_ULONG; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_PCTX_get_flags_procname); +end; + + +procedure ERR_ASN1_PCTX_set_flags(p: PASN1_PCTX; flags: TIdC_ULONG); +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_PCTX_set_flags_procname); +end; + + +function ERR_ASN1_PCTX_get_nm_flags(const p: PASN1_PCTX): TIdC_ULONG; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_PCTX_get_nm_flags_procname); +end; + + +procedure ERR_ASN1_PCTX_set_nm_flags(p: PASN1_PCTX; flags: TIdC_ULONG); +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_PCTX_set_nm_flags_procname); +end; + + +function ERR_ASN1_PCTX_get_cert_flags(const p: PASN1_PCTX): TIdC_ULONG; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_PCTX_get_cert_flags_procname); +end; + + +procedure ERR_ASN1_PCTX_set_cert_flags(p: PASN1_PCTX; flags: TIdC_ULONG); +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_PCTX_set_cert_flags_procname); +end; + + +function ERR_ASN1_PCTX_get_oid_flags(const p: PASN1_PCTX): TIdC_ULONG; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_PCTX_get_oid_flags_procname); +end; + + +procedure ERR_ASN1_PCTX_set_oid_flags(p: PASN1_PCTX; flags: TIdC_ULONG); +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_PCTX_set_oid_flags_procname); +end; + + +function ERR_ASN1_PCTX_get_str_flags(const p: PASN1_PCTX): TIdC_ULONG; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_PCTX_get_str_flags_procname); +end; + + +procedure ERR_ASN1_PCTX_set_str_flags(p: PASN1_PCTX; flags: TIdC_ULONG); +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_PCTX_set_str_flags_procname); +end; + + + + //ASN1_SCTX *ASN1_SCTX_new(int (*scan_cb) (ASN1_SCTX *ctx)); +procedure ERR_ASN1_SCTX_free(p: PASN1_SCTX); +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_SCTX_free_procname); +end; + + {introduced 1.1.0} +function ERR_ASN1_SCTX_get_item(p: PASN1_SCTX): PASN1_ITEM; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_SCTX_get_item_procname); +end; + + {introduced 1.1.0} +function ERR_ASN1_SCTX_get_template(p: PASN1_SCTX): PASN1_TEMPLATE; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_SCTX_get_template_procname); +end; + + {introduced 1.1.0} +function ERR_ASN1_SCTX_get_flags(p: PASN1_SCTX): TIdC_ULONG; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_SCTX_get_flags_procname); +end; + + {introduced 1.1.0} +procedure ERR_ASN1_SCTX_set_app_data(p: PASN1_SCTX; data: Pointer); +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_SCTX_set_app_data_procname); +end; + + {introduced 1.1.0} +function ERR_ASN1_SCTX_get_app_data(p: PASN1_SCTX): Pointer; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_SCTX_get_app_data_procname); +end; + + {introduced 1.1.0} + +function ERR_BIO_f_asn1: PBIO_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_f_asn1_procname); +end; + + + +function ERR_BIO_new_NDEF(out_: PBIO; val: PASN1_VALUE; const it: PASN1_ITEM): PBIO; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_new_NDEF_procname); +end; + + + +function ERR_i2d_ASN1_bio_stream(out_: PBIO; val: PASN1_VALUE; in_: PBIO; flags: TIdC_INT; const it: PASN1_ITEM): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(i2d_ASN1_bio_stream_procname); +end; + + +function ERR_PEM_write_bio_ASN1_stream(out_: PBIO; val: PASN1_VALUE; in_: PBIO; flags: TIdC_INT; const hdr: PAnsiChar; const it: PASN1_ITEM): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(PEM_write_bio_ASN1_stream_procname); +end; + + + //function SMIME_write_ASN1(bio: PBIO; val: PASN1_VALUE; data: PBIO; flags: TIdC_INT; + // ctype_nid: TIdC_INT; econt_nid: TIdC_INT; + // STACK_OF(X509_ALGOR) *mdalgs, const ASN1_ITEM *it): TIdC_INT; +function ERR_SMIME_read_ASN1(bio: PBIO; bcont: PPBIO; const it: PASN1_ITEM): PASN1_VALUE; +begin + EIdAPIFunctionNotPresent.RaiseException(SMIME_read_ASN1_procname); +end; + + +function ERR_SMIME_crlf_copy(in_: PBIO; out_: PBIO; flags: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SMIME_crlf_copy_procname); +end; + + +function ERR_SMIME_text(in_: PBIO; out_: PBIO): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SMIME_text_procname); +end; + + + +function ERR_ASN1_ITEM_lookup(const name: PIdAnsiChar): PASN1_ITEM; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_ITEM_lookup_procname); +end; + + {introduced 1.1.0} +function ERR_ASN1_ITEM_get(i: TIdC_SIZET): PASN1_ITEM; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_ITEM_get_procname); +end; + + {introduced 1.1.0} + +{$WARN NO_RETVAL ON} + +procedure Load(const ADllHandle: TIdLibHandle; LibVersion: TIdC_UINT; const AFailed: TStringList); + +var FuncLoadError: boolean; + +begin + ASN1_TYPE_get := LoadLibFunction(ADllHandle, ASN1_TYPE_get_procname); + FuncLoadError := not assigned(ASN1_TYPE_get); + if FuncLoadError then + begin + {$if not defined(ASN1_TYPE_get_allownil)} + ASN1_TYPE_get := @ERR_ASN1_TYPE_get; + {$ifend} + {$if declared(ASN1_TYPE_get_introduced)} + if LibVersion < ASN1_TYPE_get_introduced then + begin + {$if declared(FC_ASN1_TYPE_get)} + ASN1_TYPE_get := @FC_ASN1_TYPE_get; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_TYPE_get_removed)} + if ASN1_TYPE_get_removed <= LibVersion then + begin + {$if declared(_ASN1_TYPE_get)} + ASN1_TYPE_get := @_ASN1_TYPE_get; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_TYPE_get_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_TYPE_get'); + {$ifend} + end; + + + ASN1_TYPE_set := LoadLibFunction(ADllHandle, ASN1_TYPE_set_procname); + FuncLoadError := not assigned(ASN1_TYPE_set); + if FuncLoadError then + begin + {$if not defined(ASN1_TYPE_set_allownil)} + ASN1_TYPE_set := @ERR_ASN1_TYPE_set; + {$ifend} + {$if declared(ASN1_TYPE_set_introduced)} + if LibVersion < ASN1_TYPE_set_introduced then + begin + {$if declared(FC_ASN1_TYPE_set)} + ASN1_TYPE_set := @FC_ASN1_TYPE_set; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_TYPE_set_removed)} + if ASN1_TYPE_set_removed <= LibVersion then + begin + {$if declared(_ASN1_TYPE_set)} + ASN1_TYPE_set := @_ASN1_TYPE_set; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_TYPE_set_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_TYPE_set'); + {$ifend} + end; + + + ASN1_TYPE_set1 := LoadLibFunction(ADllHandle, ASN1_TYPE_set1_procname); + FuncLoadError := not assigned(ASN1_TYPE_set1); + if FuncLoadError then + begin + {$if not defined(ASN1_TYPE_set1_allownil)} + ASN1_TYPE_set1 := @ERR_ASN1_TYPE_set1; + {$ifend} + {$if declared(ASN1_TYPE_set1_introduced)} + if LibVersion < ASN1_TYPE_set1_introduced then + begin + {$if declared(FC_ASN1_TYPE_set1)} + ASN1_TYPE_set1 := @FC_ASN1_TYPE_set1; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_TYPE_set1_removed)} + if ASN1_TYPE_set1_removed <= LibVersion then + begin + {$if declared(_ASN1_TYPE_set1)} + ASN1_TYPE_set1 := @_ASN1_TYPE_set1; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_TYPE_set1_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_TYPE_set1'); + {$ifend} + end; + + + ASN1_TYPE_cmp := LoadLibFunction(ADllHandle, ASN1_TYPE_cmp_procname); + FuncLoadError := not assigned(ASN1_TYPE_cmp); + if FuncLoadError then + begin + {$if not defined(ASN1_TYPE_cmp_allownil)} + ASN1_TYPE_cmp := @ERR_ASN1_TYPE_cmp; + {$ifend} + {$if declared(ASN1_TYPE_cmp_introduced)} + if LibVersion < ASN1_TYPE_cmp_introduced then + begin + {$if declared(FC_ASN1_TYPE_cmp)} + ASN1_TYPE_cmp := @FC_ASN1_TYPE_cmp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_TYPE_cmp_removed)} + if ASN1_TYPE_cmp_removed <= LibVersion then + begin + {$if declared(_ASN1_TYPE_cmp)} + ASN1_TYPE_cmp := @_ASN1_TYPE_cmp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_TYPE_cmp_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_TYPE_cmp'); + {$ifend} + end; + + + ASN1_TYPE_pack_sequence := LoadLibFunction(ADllHandle, ASN1_TYPE_pack_sequence_procname); + FuncLoadError := not assigned(ASN1_TYPE_pack_sequence); + if FuncLoadError then + begin + {$if not defined(ASN1_TYPE_pack_sequence_allownil)} + ASN1_TYPE_pack_sequence := @ERR_ASN1_TYPE_pack_sequence; + {$ifend} + {$if declared(ASN1_TYPE_pack_sequence_introduced)} + if LibVersion < ASN1_TYPE_pack_sequence_introduced then + begin + {$if declared(FC_ASN1_TYPE_pack_sequence)} + ASN1_TYPE_pack_sequence := @FC_ASN1_TYPE_pack_sequence; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_TYPE_pack_sequence_removed)} + if ASN1_TYPE_pack_sequence_removed <= LibVersion then + begin + {$if declared(_ASN1_TYPE_pack_sequence)} + ASN1_TYPE_pack_sequence := @_ASN1_TYPE_pack_sequence; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_TYPE_pack_sequence_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_TYPE_pack_sequence'); + {$ifend} + end; + + {introduced 1.1.0} + ASN1_TYPE_unpack_sequence := LoadLibFunction(ADllHandle, ASN1_TYPE_unpack_sequence_procname); + FuncLoadError := not assigned(ASN1_TYPE_unpack_sequence); + if FuncLoadError then + begin + {$if not defined(ASN1_TYPE_unpack_sequence_allownil)} + ASN1_TYPE_unpack_sequence := @ERR_ASN1_TYPE_unpack_sequence; + {$ifend} + {$if declared(ASN1_TYPE_unpack_sequence_introduced)} + if LibVersion < ASN1_TYPE_unpack_sequence_introduced then + begin + {$if declared(FC_ASN1_TYPE_unpack_sequence)} + ASN1_TYPE_unpack_sequence := @FC_ASN1_TYPE_unpack_sequence; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_TYPE_unpack_sequence_removed)} + if ASN1_TYPE_unpack_sequence_removed <= LibVersion then + begin + {$if declared(_ASN1_TYPE_unpack_sequence)} + ASN1_TYPE_unpack_sequence := @_ASN1_TYPE_unpack_sequence; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_TYPE_unpack_sequence_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_TYPE_unpack_sequence'); + {$ifend} + end; + + {introduced 1.1.0} + ASN1_OBJECT_new := LoadLibFunction(ADllHandle, ASN1_OBJECT_new_procname); + FuncLoadError := not assigned(ASN1_OBJECT_new); + if FuncLoadError then + begin + {$if not defined(ASN1_OBJECT_new_allownil)} + ASN1_OBJECT_new := @ERR_ASN1_OBJECT_new; + {$ifend} + {$if declared(ASN1_OBJECT_new_introduced)} + if LibVersion < ASN1_OBJECT_new_introduced then + begin + {$if declared(FC_ASN1_OBJECT_new)} + ASN1_OBJECT_new := @FC_ASN1_OBJECT_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_OBJECT_new_removed)} + if ASN1_OBJECT_new_removed <= LibVersion then + begin + {$if declared(_ASN1_OBJECT_new)} + ASN1_OBJECT_new := @_ASN1_OBJECT_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_OBJECT_new_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_OBJECT_new'); + {$ifend} + end; + + + ASN1_OBJECT_free := LoadLibFunction(ADllHandle, ASN1_OBJECT_free_procname); + FuncLoadError := not assigned(ASN1_OBJECT_free); + if FuncLoadError then + begin + {$if not defined(ASN1_OBJECT_free_allownil)} + ASN1_OBJECT_free := @ERR_ASN1_OBJECT_free; + {$ifend} + {$if declared(ASN1_OBJECT_free_introduced)} + if LibVersion < ASN1_OBJECT_free_introduced then + begin + {$if declared(FC_ASN1_OBJECT_free)} + ASN1_OBJECT_free := @FC_ASN1_OBJECT_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_OBJECT_free_removed)} + if ASN1_OBJECT_free_removed <= LibVersion then + begin + {$if declared(_ASN1_OBJECT_free)} + ASN1_OBJECT_free := @_ASN1_OBJECT_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_OBJECT_free_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_OBJECT_free'); + {$ifend} + end; + + + i2d_ASN1_OBJECT := LoadLibFunction(ADllHandle, i2d_ASN1_OBJECT_procname); + FuncLoadError := not assigned(i2d_ASN1_OBJECT); + if FuncLoadError then + begin + {$if not defined(i2d_ASN1_OBJECT_allownil)} + i2d_ASN1_OBJECT := @ERR_i2d_ASN1_OBJECT; + {$ifend} + {$if declared(i2d_ASN1_OBJECT_introduced)} + if LibVersion < i2d_ASN1_OBJECT_introduced then + begin + {$if declared(FC_i2d_ASN1_OBJECT)} + i2d_ASN1_OBJECT := @FC_i2d_ASN1_OBJECT; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(i2d_ASN1_OBJECT_removed)} + if i2d_ASN1_OBJECT_removed <= LibVersion then + begin + {$if declared(_i2d_ASN1_OBJECT)} + i2d_ASN1_OBJECT := @_i2d_ASN1_OBJECT; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(i2d_ASN1_OBJECT_allownil)} + if FuncLoadError then + AFailed.Add('i2d_ASN1_OBJECT'); + {$ifend} + end; + + + d2i_ASN1_OBJECT := LoadLibFunction(ADllHandle, d2i_ASN1_OBJECT_procname); + FuncLoadError := not assigned(d2i_ASN1_OBJECT); + if FuncLoadError then + begin + {$if not defined(d2i_ASN1_OBJECT_allownil)} + d2i_ASN1_OBJECT := @ERR_d2i_ASN1_OBJECT; + {$ifend} + {$if declared(d2i_ASN1_OBJECT_introduced)} + if LibVersion < d2i_ASN1_OBJECT_introduced then + begin + {$if declared(FC_d2i_ASN1_OBJECT)} + d2i_ASN1_OBJECT := @FC_d2i_ASN1_OBJECT; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(d2i_ASN1_OBJECT_removed)} + if d2i_ASN1_OBJECT_removed <= LibVersion then + begin + {$if declared(_d2i_ASN1_OBJECT)} + d2i_ASN1_OBJECT := @_d2i_ASN1_OBJECT; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(d2i_ASN1_OBJECT_allownil)} + if FuncLoadError then + AFailed.Add('d2i_ASN1_OBJECT'); + {$ifend} + end; + + d2i_ASN1_BIT_STRING := LoadLibFunction(ADllHandle, d2i_ASN1_BIT_STRING_procname); + FuncLoadError := not assigned(d2i_ASN1_BIT_STRING); + if FuncLoadError then + begin + {$if not defined(d2i_ASN1_OBJECT_allownil)} + d2i_ASN1_BIT_STRING := @ERR_d2i_ASN1_BIT_STRING; + {$ifend} + {$if declared(d2i_ASN1_OBJECT_introduced)} + if LibVersion < d2i_ASN1_BIT_STRING_introduced then + begin + {$if declared(FC_d2i_ASN1_OBJECT)} + d2i_ASN1_OBJECT := @FC_d2i_ASN1_OBJECT; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(d2i_ASN1_BIT_STRING_removed)} + if d2i_ASN1_BIT_STRING_removed <= LibVersion then + begin + {$if declared(_d2i_ASN1_OBJECT)} + d2i_ASN1_BIT_STRING := @d2i_ASN1_BIT_STRING; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(d2i_ASN1_OBJECT_allownil)} + if FuncLoadError then + AFailed.Add('d2i_ASN1_OBJECT'); + {$ifend} + end; + + i2d_ASN1_BIT_STRING := LoadLibFunction(ADllHandle, i2d_ASN1_BIT_STRING_procname); + FuncLoadError := not assigned(d2i_ASN1_OBJECT); + if FuncLoadError then + begin + {$if not defined(i2d_ASN1_BIT_STRING_allownil)} + i2d_ASN1_BIT_STRING := @ERR_i2d_ASN1_BIT_STRING; + {$ifend} + {$if declared(i2d_ASN1_BIT_STRING_introduced)} + if LibVersion < i2d_ASN1_BIT_STRING_introduced then + begin + {$if declared(FC_i2d_ASN1_BIT_STRING)} + i2d_ASN1_BIT_STRING := @FC_i2d_ASN1_BIT_STRING; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(i2d_ASN1_BIT_STRING_removed)} + if i2d_ASN1_BIT_STRING_removed <= LibVersion then + begin + {$if declared(_i2d_ASN1_BIT_STRING)} + d2i_ASN1_OBJECT := @_d2i_ASN1_OBJECT; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(i2d_ASN1_BIT_STRING_allownil)} + if FuncLoadError then + AFailed.Add('i2d_ASN1_BIT_STRING'); + {$ifend} + end; + + ASN1_STRING_new := LoadLibFunction(ADllHandle, ASN1_STRING_new_procname); + FuncLoadError := not assigned(ASN1_STRING_new); + if FuncLoadError then + begin + {$if not defined(ASN1_STRING_new_allownil)} + ASN1_STRING_new := @ERR_ASN1_STRING_new; + {$ifend} + {$if declared(ASN1_STRING_new_introduced)} + if LibVersion < ASN1_STRING_new_introduced then + begin + {$if declared(FC_ASN1_STRING_new)} + ASN1_STRING_new := @FC_ASN1_STRING_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_STRING_new_removed)} + if ASN1_STRING_new_removed <= LibVersion then + begin + {$if declared(_ASN1_STRING_new)} + ASN1_STRING_new := @_ASN1_STRING_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_STRING_new_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_STRING_new'); + {$ifend} + end; + + + ASN1_STRING_free := LoadLibFunction(ADllHandle, ASN1_STRING_free_procname); + FuncLoadError := not assigned(ASN1_STRING_free); + if FuncLoadError then + begin + {$if not defined(ASN1_STRING_free_allownil)} + ASN1_STRING_free := @ERR_ASN1_STRING_free; + {$ifend} + {$if declared(ASN1_STRING_free_introduced)} + if LibVersion < ASN1_STRING_free_introduced then + begin + {$if declared(FC_ASN1_STRING_free)} + ASN1_STRING_free := @FC_ASN1_STRING_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_STRING_free_removed)} + if ASN1_STRING_free_removed <= LibVersion then + begin + {$if declared(_ASN1_STRING_free)} + ASN1_STRING_free := @_ASN1_STRING_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_STRING_free_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_STRING_free'); + {$ifend} + end; + + + ASN1_STRING_clear_free := LoadLibFunction(ADllHandle, ASN1_STRING_clear_free_procname); + FuncLoadError := not assigned(ASN1_STRING_clear_free); + if FuncLoadError then + begin + {$if not defined(ASN1_STRING_clear_free_allownil)} + ASN1_STRING_clear_free := @ERR_ASN1_STRING_clear_free; + {$ifend} + {$if declared(ASN1_STRING_clear_free_introduced)} + if LibVersion < ASN1_STRING_clear_free_introduced then + begin + {$if declared(FC_ASN1_STRING_clear_free)} + ASN1_STRING_clear_free := @FC_ASN1_STRING_clear_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_STRING_clear_free_removed)} + if ASN1_STRING_clear_free_removed <= LibVersion then + begin + {$if declared(_ASN1_STRING_clear_free)} + ASN1_STRING_clear_free := @_ASN1_STRING_clear_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_STRING_clear_free_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_STRING_clear_free'); + {$ifend} + end; + + + ASN1_STRING_copy := LoadLibFunction(ADllHandle, ASN1_STRING_copy_procname); + FuncLoadError := not assigned(ASN1_STRING_copy); + if FuncLoadError then + begin + {$if not defined(ASN1_STRING_copy_allownil)} + ASN1_STRING_copy := @ERR_ASN1_STRING_copy; + {$ifend} + {$if declared(ASN1_STRING_copy_introduced)} + if LibVersion < ASN1_STRING_copy_introduced then + begin + {$if declared(FC_ASN1_STRING_copy)} + ASN1_STRING_copy := @FC_ASN1_STRING_copy; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_STRING_copy_removed)} + if ASN1_STRING_copy_removed <= LibVersion then + begin + {$if declared(_ASN1_STRING_copy)} + ASN1_STRING_copy := @_ASN1_STRING_copy; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_STRING_copy_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_STRING_copy'); + {$ifend} + end; + + + ASN1_STRING_dup := LoadLibFunction(ADllHandle, ASN1_STRING_dup_procname); + FuncLoadError := not assigned(ASN1_STRING_dup); + if FuncLoadError then + begin + {$if not defined(ASN1_STRING_dup_allownil)} + ASN1_STRING_dup := @ERR_ASN1_STRING_dup; + {$ifend} + {$if declared(ASN1_STRING_dup_introduced)} + if LibVersion < ASN1_STRING_dup_introduced then + begin + {$if declared(FC_ASN1_STRING_dup)} + ASN1_STRING_dup := @FC_ASN1_STRING_dup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_STRING_dup_removed)} + if ASN1_STRING_dup_removed <= LibVersion then + begin + {$if declared(_ASN1_STRING_dup)} + ASN1_STRING_dup := @_ASN1_STRING_dup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_STRING_dup_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_STRING_dup'); + {$ifend} + end; + + + ASN1_STRING_type_new := LoadLibFunction(ADllHandle, ASN1_STRING_type_new_procname); + FuncLoadError := not assigned(ASN1_STRING_type_new); + if FuncLoadError then + begin + {$if not defined(ASN1_STRING_type_new_allownil)} + ASN1_STRING_type_new := @ERR_ASN1_STRING_type_new; + {$ifend} + {$if declared(ASN1_STRING_type_new_introduced)} + if LibVersion < ASN1_STRING_type_new_introduced then + begin + {$if declared(FC_ASN1_STRING_type_new)} + ASN1_STRING_type_new := @FC_ASN1_STRING_type_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_STRING_type_new_removed)} + if ASN1_STRING_type_new_removed <= LibVersion then + begin + {$if declared(_ASN1_STRING_type_new)} + ASN1_STRING_type_new := @_ASN1_STRING_type_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_STRING_type_new_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_STRING_type_new'); + {$ifend} + end; + + + ASN1_STRING_cmp := LoadLibFunction(ADllHandle, ASN1_STRING_cmp_procname); + FuncLoadError := not assigned(ASN1_STRING_cmp); + if FuncLoadError then + begin + {$if not defined(ASN1_STRING_cmp_allownil)} + ASN1_STRING_cmp := @ERR_ASN1_STRING_cmp; + {$ifend} + {$if declared(ASN1_STRING_cmp_introduced)} + if LibVersion < ASN1_STRING_cmp_introduced then + begin + {$if declared(FC_ASN1_STRING_cmp)} + ASN1_STRING_cmp := @FC_ASN1_STRING_cmp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_STRING_cmp_removed)} + if ASN1_STRING_cmp_removed <= LibVersion then + begin + {$if declared(_ASN1_STRING_cmp)} + ASN1_STRING_cmp := @_ASN1_STRING_cmp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_STRING_cmp_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_STRING_cmp'); + {$ifend} + end; + + + ASN1_STRING_set := LoadLibFunction(ADllHandle, ASN1_STRING_set_procname); + FuncLoadError := not assigned(ASN1_STRING_set); + if FuncLoadError then + begin + {$if not defined(ASN1_STRING_set_allownil)} + ASN1_STRING_set := @ERR_ASN1_STRING_set; + {$ifend} + {$if declared(ASN1_STRING_set_introduced)} + if LibVersion < ASN1_STRING_set_introduced then + begin + {$if declared(FC_ASN1_STRING_set)} + ASN1_STRING_set := @FC_ASN1_STRING_set; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_STRING_set_removed)} + if ASN1_STRING_set_removed <= LibVersion then + begin + {$if declared(_ASN1_STRING_set)} + ASN1_STRING_set := @_ASN1_STRING_set; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_STRING_set_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_STRING_set'); + {$ifend} + end; + + + ASN1_STRING_set0 := LoadLibFunction(ADllHandle, ASN1_STRING_set0_procname); + FuncLoadError := not assigned(ASN1_STRING_set0); + if FuncLoadError then + begin + {$if not defined(ASN1_STRING_set0_allownil)} + ASN1_STRING_set0 := @ERR_ASN1_STRING_set0; + {$ifend} + {$if declared(ASN1_STRING_set0_introduced)} + if LibVersion < ASN1_STRING_set0_introduced then + begin + {$if declared(FC_ASN1_STRING_set0)} + ASN1_STRING_set0 := @FC_ASN1_STRING_set0; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_STRING_set0_removed)} + if ASN1_STRING_set0_removed <= LibVersion then + begin + {$if declared(_ASN1_STRING_set0)} + ASN1_STRING_set0 := @_ASN1_STRING_set0; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_STRING_set0_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_STRING_set0'); + {$ifend} + end; + + + ASN1_STRING_length := LoadLibFunction(ADllHandle, ASN1_STRING_length_procname); + FuncLoadError := not assigned(ASN1_STRING_length); + if FuncLoadError then + begin + {$if not defined(ASN1_STRING_length_allownil)} + ASN1_STRING_length := @ERR_ASN1_STRING_length; + {$ifend} + {$if declared(ASN1_STRING_length_introduced)} + if LibVersion < ASN1_STRING_length_introduced then + begin + {$if declared(FC_ASN1_STRING_length)} + ASN1_STRING_length := @FC_ASN1_STRING_length; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_STRING_length_removed)} + if ASN1_STRING_length_removed <= LibVersion then + begin + {$if declared(_ASN1_STRING_length)} + ASN1_STRING_length := @_ASN1_STRING_length; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_STRING_length_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_STRING_length'); + {$ifend} + end; + + + ASN1_STRING_length_set := LoadLibFunction(ADllHandle, ASN1_STRING_length_set_procname); + FuncLoadError := not assigned(ASN1_STRING_length_set); + if FuncLoadError then + begin + {$if not defined(ASN1_STRING_length_set_allownil)} + ASN1_STRING_length_set := @ERR_ASN1_STRING_length_set; + {$ifend} + {$if declared(ASN1_STRING_length_set_introduced)} + if LibVersion < ASN1_STRING_length_set_introduced then + begin + {$if declared(FC_ASN1_STRING_length_set)} + ASN1_STRING_length_set := @FC_ASN1_STRING_length_set; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_STRING_length_set_removed)} + if ASN1_STRING_length_set_removed <= LibVersion then + begin + {$if declared(_ASN1_STRING_length_set)} + ASN1_STRING_length_set := @_ASN1_STRING_length_set; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_STRING_length_set_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_STRING_length_set'); + {$ifend} + end; + + + ASN1_STRING_type := LoadLibFunction(ADllHandle, ASN1_STRING_type_procname); + FuncLoadError := not assigned(ASN1_STRING_type); + if FuncLoadError then + begin + {$if not defined(ASN1_STRING_type_allownil)} + ASN1_STRING_type := @ERR_ASN1_STRING_type; + {$ifend} + {$if declared(ASN1_STRING_type_introduced)} + if LibVersion < ASN1_STRING_type_introduced then + begin + {$if declared(FC_ASN1_STRING_type)} + ASN1_STRING_type := @FC_ASN1_STRING_type; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_STRING_type_removed)} + if ASN1_STRING_type_removed <= LibVersion then + begin + {$if declared(_ASN1_STRING_type)} + ASN1_STRING_type := @_ASN1_STRING_type; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_STRING_type_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_STRING_type'); + {$ifend} + end; + + + ASN1_STRING_get0_data := LoadLibFunction(ADllHandle, ASN1_STRING_get0_data_procname); + FuncLoadError := not assigned(ASN1_STRING_get0_data); + if FuncLoadError then + begin + {$if not defined(ASN1_STRING_get0_data_allownil)} + ASN1_STRING_get0_data := @ERR_ASN1_STRING_get0_data; + {$ifend} + {$if declared(ASN1_STRING_get0_data_introduced)} + if LibVersion < ASN1_STRING_get0_data_introduced then + begin + {$if declared(FC_ASN1_STRING_get0_data)} + ASN1_STRING_get0_data := @FC_ASN1_STRING_get0_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_STRING_get0_data_removed)} + if ASN1_STRING_get0_data_removed <= LibVersion then + begin + {$if declared(_ASN1_STRING_get0_data)} + ASN1_STRING_get0_data := @_ASN1_STRING_get0_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_STRING_get0_data_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_STRING_get0_data'); + {$ifend} + end; + + {introduced 1.1.0} + ASN1_BIT_STRING_set := LoadLibFunction(ADllHandle, ASN1_BIT_STRING_set_procname); + FuncLoadError := not assigned(ASN1_BIT_STRING_set); + if FuncLoadError then + begin + {$if not defined(ASN1_BIT_STRING_set_allownil)} + ASN1_BIT_STRING_set := @ERR_ASN1_BIT_STRING_set; + {$ifend} + {$if declared(ASN1_BIT_STRING_set_introduced)} + if LibVersion < ASN1_BIT_STRING_set_introduced then + begin + {$if declared(FC_ASN1_BIT_STRING_set)} + ASN1_BIT_STRING_set := @FC_ASN1_BIT_STRING_set; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_BIT_STRING_set_removed)} + if ASN1_BIT_STRING_set_removed <= LibVersion then + begin + {$if declared(_ASN1_BIT_STRING_set)} + ASN1_BIT_STRING_set := @_ASN1_BIT_STRING_set; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_BIT_STRING_set_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_BIT_STRING_set'); + {$ifend} + end; + + + ASN1_BIT_STRING_set_bit := LoadLibFunction(ADllHandle, ASN1_BIT_STRING_set_bit_procname); + FuncLoadError := not assigned(ASN1_BIT_STRING_set_bit); + if FuncLoadError then + begin + {$if not defined(ASN1_BIT_STRING_set_bit_allownil)} + ASN1_BIT_STRING_set_bit := @ERR_ASN1_BIT_STRING_set_bit; + {$ifend} + {$if declared(ASN1_BIT_STRING_set_bit_introduced)} + if LibVersion < ASN1_BIT_STRING_set_bit_introduced then + begin + {$if declared(FC_ASN1_BIT_STRING_set_bit)} + ASN1_BIT_STRING_set_bit := @FC_ASN1_BIT_STRING_set_bit; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_BIT_STRING_set_bit_removed)} + if ASN1_BIT_STRING_set_bit_removed <= LibVersion then + begin + {$if declared(_ASN1_BIT_STRING_set_bit)} + ASN1_BIT_STRING_set_bit := @_ASN1_BIT_STRING_set_bit; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_BIT_STRING_set_bit_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_BIT_STRING_set_bit'); + {$ifend} + end; + + + ASN1_BIT_STRING_get_bit := LoadLibFunction(ADllHandle, ASN1_BIT_STRING_get_bit_procname); + FuncLoadError := not assigned(ASN1_BIT_STRING_get_bit); + if FuncLoadError then + begin + {$if not defined(ASN1_BIT_STRING_get_bit_allownil)} + ASN1_BIT_STRING_get_bit := @ERR_ASN1_BIT_STRING_get_bit; + {$ifend} + {$if declared(ASN1_BIT_STRING_get_bit_introduced)} + if LibVersion < ASN1_BIT_STRING_get_bit_introduced then + begin + {$if declared(FC_ASN1_BIT_STRING_get_bit)} + ASN1_BIT_STRING_get_bit := @FC_ASN1_BIT_STRING_get_bit; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_BIT_STRING_get_bit_removed)} + if ASN1_BIT_STRING_get_bit_removed <= LibVersion then + begin + {$if declared(_ASN1_BIT_STRING_get_bit)} + ASN1_BIT_STRING_get_bit := @_ASN1_BIT_STRING_get_bit; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_BIT_STRING_get_bit_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_BIT_STRING_get_bit'); + {$ifend} + end; + + + ASN1_BIT_STRING_check := LoadLibFunction(ADllHandle, ASN1_BIT_STRING_check_procname); + FuncLoadError := not assigned(ASN1_BIT_STRING_check); + if FuncLoadError then + begin + {$if not defined(ASN1_BIT_STRING_check_allownil)} + ASN1_BIT_STRING_check := @ERR_ASN1_BIT_STRING_check; + {$ifend} + {$if declared(ASN1_BIT_STRING_check_introduced)} + if LibVersion < ASN1_BIT_STRING_check_introduced then + begin + {$if declared(FC_ASN1_BIT_STRING_check)} + ASN1_BIT_STRING_check := @FC_ASN1_BIT_STRING_check; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_BIT_STRING_check_removed)} + if ASN1_BIT_STRING_check_removed <= LibVersion then + begin + {$if declared(_ASN1_BIT_STRING_check)} + ASN1_BIT_STRING_check := @_ASN1_BIT_STRING_check; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_BIT_STRING_check_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_BIT_STRING_check'); + {$ifend} + end; + + + ASN1_BIT_STRING_name_print := LoadLibFunction(ADllHandle, ASN1_BIT_STRING_name_print_procname); + FuncLoadError := not assigned(ASN1_BIT_STRING_name_print); + if FuncLoadError then + begin + {$if not defined(ASN1_BIT_STRING_name_print_allownil)} + ASN1_BIT_STRING_name_print := @ERR_ASN1_BIT_STRING_name_print; + {$ifend} + {$if declared(ASN1_BIT_STRING_name_print_introduced)} + if LibVersion < ASN1_BIT_STRING_name_print_introduced then + begin + {$if declared(FC_ASN1_BIT_STRING_name_print)} + ASN1_BIT_STRING_name_print := @FC_ASN1_BIT_STRING_name_print; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_BIT_STRING_name_print_removed)} + if ASN1_BIT_STRING_name_print_removed <= LibVersion then + begin + {$if declared(_ASN1_BIT_STRING_name_print)} + ASN1_BIT_STRING_name_print := @_ASN1_BIT_STRING_name_print; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_BIT_STRING_name_print_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_BIT_STRING_name_print'); + {$ifend} + end; + + + ASN1_BIT_STRING_num_asc := LoadLibFunction(ADllHandle, ASN1_BIT_STRING_num_asc_procname); + FuncLoadError := not assigned(ASN1_BIT_STRING_num_asc); + if FuncLoadError then + begin + {$if not defined(ASN1_BIT_STRING_num_asc_allownil)} + ASN1_BIT_STRING_num_asc := @ERR_ASN1_BIT_STRING_num_asc; + {$ifend} + {$if declared(ASN1_BIT_STRING_num_asc_introduced)} + if LibVersion < ASN1_BIT_STRING_num_asc_introduced then + begin + {$if declared(FC_ASN1_BIT_STRING_num_asc)} + ASN1_BIT_STRING_num_asc := @FC_ASN1_BIT_STRING_num_asc; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_BIT_STRING_num_asc_removed)} + if ASN1_BIT_STRING_num_asc_removed <= LibVersion then + begin + {$if declared(_ASN1_BIT_STRING_num_asc)} + ASN1_BIT_STRING_num_asc := @_ASN1_BIT_STRING_num_asc; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_BIT_STRING_num_asc_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_BIT_STRING_num_asc'); + {$ifend} + end; + + + ASN1_BIT_STRING_set_asc := LoadLibFunction(ADllHandle, ASN1_BIT_STRING_set_asc_procname); + FuncLoadError := not assigned(ASN1_BIT_STRING_set_asc); + if FuncLoadError then + begin + {$if not defined(ASN1_BIT_STRING_set_asc_allownil)} + ASN1_BIT_STRING_set_asc := @ERR_ASN1_BIT_STRING_set_asc; + {$ifend} + {$if declared(ASN1_BIT_STRING_set_asc_introduced)} + if LibVersion < ASN1_BIT_STRING_set_asc_introduced then + begin + {$if declared(FC_ASN1_BIT_STRING_set_asc)} + ASN1_BIT_STRING_set_asc := @FC_ASN1_BIT_STRING_set_asc; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_BIT_STRING_set_asc_removed)} + if ASN1_BIT_STRING_set_asc_removed <= LibVersion then + begin + {$if declared(_ASN1_BIT_STRING_set_asc)} + ASN1_BIT_STRING_set_asc := @_ASN1_BIT_STRING_set_asc; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_BIT_STRING_set_asc_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_BIT_STRING_set_asc'); + {$ifend} + end; + + + ASN1_INTEGER_new := LoadLibFunction(ADllHandle, ASN1_INTEGER_new_procname); + FuncLoadError := not assigned(ASN1_INTEGER_new); + if FuncLoadError then + begin + {$if not defined(ASN1_INTEGER_new_allownil)} + ASN1_INTEGER_new := @ERR_ASN1_INTEGER_new; + {$ifend} + {$if declared(ASN1_INTEGER_new_introduced)} + if LibVersion < ASN1_INTEGER_new_introduced then + begin + {$if declared(FC_ASN1_INTEGER_new)} + ASN1_INTEGER_new := @FC_ASN1_INTEGER_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_INTEGER_new_removed)} + if ASN1_INTEGER_new_removed <= LibVersion then + begin + {$if declared(_ASN1_INTEGER_new)} + ASN1_INTEGER_new := @_ASN1_INTEGER_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_INTEGER_new_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_INTEGER_new'); + {$ifend} + end; + + + ASN1_INTEGER_free := LoadLibFunction(ADllHandle, ASN1_INTEGER_free_procname); + FuncLoadError := not assigned(ASN1_INTEGER_free); + if FuncLoadError then + begin + {$if not defined(ASN1_INTEGER_free_allownil)} + ASN1_INTEGER_free := @ERR_ASN1_INTEGER_free; + {$ifend} + {$if declared(ASN1_INTEGER_free_introduced)} + if LibVersion < ASN1_INTEGER_free_introduced then + begin + {$if declared(FC_ASN1_INTEGER_free)} + ASN1_INTEGER_free := @FC_ASN1_INTEGER_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_INTEGER_free_removed)} + if ASN1_INTEGER_free_removed <= LibVersion then + begin + {$if declared(_ASN1_INTEGER_free)} + ASN1_INTEGER_free := @_ASN1_INTEGER_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_INTEGER_free_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_INTEGER_free'); + {$ifend} + end; + + + d2i_ASN1_INTEGER := LoadLibFunction(ADllHandle, d2i_ASN1_INTEGER_procname); + FuncLoadError := not assigned(d2i_ASN1_INTEGER); + if FuncLoadError then + begin + {$if not defined(d2i_ASN1_INTEGER_allownil)} + d2i_ASN1_INTEGER := @ERR_d2i_ASN1_INTEGER; + {$ifend} + {$if declared(d2i_ASN1_INTEGER_introduced)} + if LibVersion < d2i_ASN1_INTEGER_introduced then + begin + {$if declared(FC_d2i_ASN1_INTEGER)} + d2i_ASN1_INTEGER := @FC_d2i_ASN1_INTEGER; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(d2i_ASN1_INTEGER_removed)} + if d2i_ASN1_INTEGER_removed <= LibVersion then + begin + {$if declared(_d2i_ASN1_INTEGER)} + d2i_ASN1_INTEGER := @_d2i_ASN1_INTEGER; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(d2i_ASN1_INTEGER_allownil)} + if FuncLoadError then + AFailed.Add('d2i_ASN1_INTEGER'); + {$ifend} + end; + + + i2d_ASN1_INTEGER := LoadLibFunction(ADllHandle, i2d_ASN1_INTEGER_procname); + FuncLoadError := not assigned(i2d_ASN1_INTEGER); + if FuncLoadError then + begin + {$if not defined(i2d_ASN1_INTEGER_allownil)} + i2d_ASN1_INTEGER := @ERR_i2d_ASN1_INTEGER; + {$ifend} + {$if declared(i2d_ASN1_INTEGER_introduced)} + if LibVersion < i2d_ASN1_INTEGER_introduced then + begin + {$if declared(FC_i2d_ASN1_INTEGER)} + i2d_ASN1_INTEGER := @FC_i2d_ASN1_INTEGER; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(i2d_ASN1_INTEGER_removed)} + if i2d_ASN1_INTEGER_removed <= LibVersion then + begin + {$if declared(_i2d_ASN1_INTEGER)} + i2d_ASN1_INTEGER := @_i2d_ASN1_INTEGER; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(i2d_ASN1_INTEGER_allownil)} + if FuncLoadError then + AFailed.Add('i2d_ASN1_INTEGER'); + {$ifend} + end; + + + d2i_ASN1_UINTEGER := LoadLibFunction(ADllHandle, d2i_ASN1_UINTEGER_procname); + FuncLoadError := not assigned(d2i_ASN1_UINTEGER); + if FuncLoadError then + begin + {$if not defined(d2i_ASN1_UINTEGER_allownil)} + d2i_ASN1_UINTEGER := @ERR_d2i_ASN1_UINTEGER; + {$ifend} + {$if declared(d2i_ASN1_UINTEGER_introduced)} + if LibVersion < d2i_ASN1_UINTEGER_introduced then + begin + {$if declared(FC_d2i_ASN1_UINTEGER)} + d2i_ASN1_UINTEGER := @FC_d2i_ASN1_UINTEGER; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(d2i_ASN1_UINTEGER_removed)} + if d2i_ASN1_UINTEGER_removed <= LibVersion then + begin + {$if declared(_d2i_ASN1_UINTEGER)} + d2i_ASN1_UINTEGER := @_d2i_ASN1_UINTEGER; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(d2i_ASN1_UINTEGER_allownil)} + if FuncLoadError then + AFailed.Add('d2i_ASN1_UINTEGER'); + {$ifend} + end; + + + ASN1_INTEGER_dup := LoadLibFunction(ADllHandle, ASN1_INTEGER_dup_procname); + FuncLoadError := not assigned(ASN1_INTEGER_dup); + if FuncLoadError then + begin + {$if not defined(ASN1_INTEGER_dup_allownil)} + ASN1_INTEGER_dup := @ERR_ASN1_INTEGER_dup; + {$ifend} + {$if declared(ASN1_INTEGER_dup_introduced)} + if LibVersion < ASN1_INTEGER_dup_introduced then + begin + {$if declared(FC_ASN1_INTEGER_dup)} + ASN1_INTEGER_dup := @FC_ASN1_INTEGER_dup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_INTEGER_dup_removed)} + if ASN1_INTEGER_dup_removed <= LibVersion then + begin + {$if declared(_ASN1_INTEGER_dup)} + ASN1_INTEGER_dup := @_ASN1_INTEGER_dup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_INTEGER_dup_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_INTEGER_dup'); + {$ifend} + end; + + + ASN1_INTEGER_cmp := LoadLibFunction(ADllHandle, ASN1_INTEGER_cmp_procname); + FuncLoadError := not assigned(ASN1_INTEGER_cmp); + if FuncLoadError then + begin + {$if not defined(ASN1_INTEGER_cmp_allownil)} + ASN1_INTEGER_cmp := @ERR_ASN1_INTEGER_cmp; + {$ifend} + {$if declared(ASN1_INTEGER_cmp_introduced)} + if LibVersion < ASN1_INTEGER_cmp_introduced then + begin + {$if declared(FC_ASN1_INTEGER_cmp)} + ASN1_INTEGER_cmp := @FC_ASN1_INTEGER_cmp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_INTEGER_cmp_removed)} + if ASN1_INTEGER_cmp_removed <= LibVersion then + begin + {$if declared(_ASN1_INTEGER_cmp)} + ASN1_INTEGER_cmp := @_ASN1_INTEGER_cmp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_INTEGER_cmp_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_INTEGER_cmp'); + {$ifend} + end; + + + ASN1_UTCTIME_check := LoadLibFunction(ADllHandle, ASN1_UTCTIME_check_procname); + FuncLoadError := not assigned(ASN1_UTCTIME_check); + if FuncLoadError then + begin + {$if not defined(ASN1_UTCTIME_check_allownil)} + ASN1_UTCTIME_check := @ERR_ASN1_UTCTIME_check; + {$ifend} + {$if declared(ASN1_UTCTIME_check_introduced)} + if LibVersion < ASN1_UTCTIME_check_introduced then + begin + {$if declared(FC_ASN1_UTCTIME_check)} + ASN1_UTCTIME_check := @FC_ASN1_UTCTIME_check; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_UTCTIME_check_removed)} + if ASN1_UTCTIME_check_removed <= LibVersion then + begin + {$if declared(_ASN1_UTCTIME_check)} + ASN1_UTCTIME_check := @_ASN1_UTCTIME_check; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_UTCTIME_check_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_UTCTIME_check'); + {$ifend} + end; + + + ASN1_UTCTIME_set := LoadLibFunction(ADllHandle, ASN1_UTCTIME_set_procname); + FuncLoadError := not assigned(ASN1_UTCTIME_set); + if FuncLoadError then + begin + {$if not defined(ASN1_UTCTIME_set_allownil)} + ASN1_UTCTIME_set := @ERR_ASN1_UTCTIME_set; + {$ifend} + {$if declared(ASN1_UTCTIME_set_introduced)} + if LibVersion < ASN1_UTCTIME_set_introduced then + begin + {$if declared(FC_ASN1_UTCTIME_set)} + ASN1_UTCTIME_set := @FC_ASN1_UTCTIME_set; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_UTCTIME_set_removed)} + if ASN1_UTCTIME_set_removed <= LibVersion then + begin + {$if declared(_ASN1_UTCTIME_set)} + ASN1_UTCTIME_set := @_ASN1_UTCTIME_set; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_UTCTIME_set_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_UTCTIME_set'); + {$ifend} + end; + + + ASN1_UTCTIME_adj := LoadLibFunction(ADllHandle, ASN1_UTCTIME_adj_procname); + FuncLoadError := not assigned(ASN1_UTCTIME_adj); + if FuncLoadError then + begin + {$if not defined(ASN1_UTCTIME_adj_allownil)} + ASN1_UTCTIME_adj := @ERR_ASN1_UTCTIME_adj; + {$ifend} + {$if declared(ASN1_UTCTIME_adj_introduced)} + if LibVersion < ASN1_UTCTIME_adj_introduced then + begin + {$if declared(FC_ASN1_UTCTIME_adj)} + ASN1_UTCTIME_adj := @FC_ASN1_UTCTIME_adj; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_UTCTIME_adj_removed)} + if ASN1_UTCTIME_adj_removed <= LibVersion then + begin + {$if declared(_ASN1_UTCTIME_adj)} + ASN1_UTCTIME_adj := @_ASN1_UTCTIME_adj; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_UTCTIME_adj_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_UTCTIME_adj'); + {$ifend} + end; + + + ASN1_UTCTIME_set_string := LoadLibFunction(ADllHandle, ASN1_UTCTIME_set_string_procname); + FuncLoadError := not assigned(ASN1_UTCTIME_set_string); + if FuncLoadError then + begin + {$if not defined(ASN1_UTCTIME_set_string_allownil)} + ASN1_UTCTIME_set_string := @ERR_ASN1_UTCTIME_set_string; + {$ifend} + {$if declared(ASN1_UTCTIME_set_string_introduced)} + if LibVersion < ASN1_UTCTIME_set_string_introduced then + begin + {$if declared(FC_ASN1_UTCTIME_set_string)} + ASN1_UTCTIME_set_string := @FC_ASN1_UTCTIME_set_string; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_UTCTIME_set_string_removed)} + if ASN1_UTCTIME_set_string_removed <= LibVersion then + begin + {$if declared(_ASN1_UTCTIME_set_string)} + ASN1_UTCTIME_set_string := @_ASN1_UTCTIME_set_string; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_UTCTIME_set_string_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_UTCTIME_set_string'); + {$ifend} + end; + + + ASN1_UTCTIME_cmp_time_t := LoadLibFunction(ADllHandle, ASN1_UTCTIME_cmp_time_t_procname); + FuncLoadError := not assigned(ASN1_UTCTIME_cmp_time_t); + if FuncLoadError then + begin + {$if not defined(ASN1_UTCTIME_cmp_time_t_allownil)} + ASN1_UTCTIME_cmp_time_t := @ERR_ASN1_UTCTIME_cmp_time_t; + {$ifend} + {$if declared(ASN1_UTCTIME_cmp_time_t_introduced)} + if LibVersion < ASN1_UTCTIME_cmp_time_t_introduced then + begin + {$if declared(FC_ASN1_UTCTIME_cmp_time_t)} + ASN1_UTCTIME_cmp_time_t := @FC_ASN1_UTCTIME_cmp_time_t; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_UTCTIME_cmp_time_t_removed)} + if ASN1_UTCTIME_cmp_time_t_removed <= LibVersion then + begin + {$if declared(_ASN1_UTCTIME_cmp_time_t)} + ASN1_UTCTIME_cmp_time_t := @_ASN1_UTCTIME_cmp_time_t; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_UTCTIME_cmp_time_t_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_UTCTIME_cmp_time_t'); + {$ifend} + end; + + + ASN1_GENERALIZEDTIME_check := LoadLibFunction(ADllHandle, ASN1_GENERALIZEDTIME_check_procname); + FuncLoadError := not assigned(ASN1_GENERALIZEDTIME_check); + if FuncLoadError then + begin + {$if not defined(ASN1_GENERALIZEDTIME_check_allownil)} + ASN1_GENERALIZEDTIME_check := @ERR_ASN1_GENERALIZEDTIME_check; + {$ifend} + {$if declared(ASN1_GENERALIZEDTIME_check_introduced)} + if LibVersion < ASN1_GENERALIZEDTIME_check_introduced then + begin + {$if declared(FC_ASN1_GENERALIZEDTIME_check)} + ASN1_GENERALIZEDTIME_check := @FC_ASN1_GENERALIZEDTIME_check; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_GENERALIZEDTIME_check_removed)} + if ASN1_GENERALIZEDTIME_check_removed <= LibVersion then + begin + {$if declared(_ASN1_GENERALIZEDTIME_check)} + ASN1_GENERALIZEDTIME_check := @_ASN1_GENERALIZEDTIME_check; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_GENERALIZEDTIME_check_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_GENERALIZEDTIME_check'); + {$ifend} + end; + + + ASN1_GENERALIZEDTIME_set := LoadLibFunction(ADllHandle, ASN1_GENERALIZEDTIME_set_procname); + FuncLoadError := not assigned(ASN1_GENERALIZEDTIME_set); + if FuncLoadError then + begin + {$if not defined(ASN1_GENERALIZEDTIME_set_allownil)} + ASN1_GENERALIZEDTIME_set := @ERR_ASN1_GENERALIZEDTIME_set; + {$ifend} + {$if declared(ASN1_GENERALIZEDTIME_set_introduced)} + if LibVersion < ASN1_GENERALIZEDTIME_set_introduced then + begin + {$if declared(FC_ASN1_GENERALIZEDTIME_set)} + ASN1_GENERALIZEDTIME_set := @FC_ASN1_GENERALIZEDTIME_set; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_GENERALIZEDTIME_set_removed)} + if ASN1_GENERALIZEDTIME_set_removed <= LibVersion then + begin + {$if declared(_ASN1_GENERALIZEDTIME_set)} + ASN1_GENERALIZEDTIME_set := @_ASN1_GENERALIZEDTIME_set; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_GENERALIZEDTIME_set_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_GENERALIZEDTIME_set'); + {$ifend} + end; + + + ASN1_GENERALIZEDTIME_adj := LoadLibFunction(ADllHandle, ASN1_GENERALIZEDTIME_adj_procname); + FuncLoadError := not assigned(ASN1_GENERALIZEDTIME_adj); + if FuncLoadError then + begin + {$if not defined(ASN1_GENERALIZEDTIME_adj_allownil)} + ASN1_GENERALIZEDTIME_adj := @ERR_ASN1_GENERALIZEDTIME_adj; + {$ifend} + {$if declared(ASN1_GENERALIZEDTIME_adj_introduced)} + if LibVersion < ASN1_GENERALIZEDTIME_adj_introduced then + begin + {$if declared(FC_ASN1_GENERALIZEDTIME_adj)} + ASN1_GENERALIZEDTIME_adj := @FC_ASN1_GENERALIZEDTIME_adj; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_GENERALIZEDTIME_adj_removed)} + if ASN1_GENERALIZEDTIME_adj_removed <= LibVersion then + begin + {$if declared(_ASN1_GENERALIZEDTIME_adj)} + ASN1_GENERALIZEDTIME_adj := @_ASN1_GENERALIZEDTIME_adj; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_GENERALIZEDTIME_adj_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_GENERALIZEDTIME_adj'); + {$ifend} + end; + + + ASN1_GENERALIZEDTIME_set_string := LoadLibFunction(ADllHandle, ASN1_GENERALIZEDTIME_set_string_procname); + FuncLoadError := not assigned(ASN1_GENERALIZEDTIME_set_string); + if FuncLoadError then + begin + {$if not defined(ASN1_GENERALIZEDTIME_set_string_allownil)} + ASN1_GENERALIZEDTIME_set_string := @ERR_ASN1_GENERALIZEDTIME_set_string; + {$ifend} + {$if declared(ASN1_GENERALIZEDTIME_set_string_introduced)} + if LibVersion < ASN1_GENERALIZEDTIME_set_string_introduced then + begin + {$if declared(FC_ASN1_GENERALIZEDTIME_set_string)} + ASN1_GENERALIZEDTIME_set_string := @FC_ASN1_GENERALIZEDTIME_set_string; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_GENERALIZEDTIME_set_string_removed)} + if ASN1_GENERALIZEDTIME_set_string_removed <= LibVersion then + begin + {$if declared(_ASN1_GENERALIZEDTIME_set_string)} + ASN1_GENERALIZEDTIME_set_string := @_ASN1_GENERALIZEDTIME_set_string; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_GENERALIZEDTIME_set_string_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_GENERALIZEDTIME_set_string'); + {$ifend} + end; + + + ASN1_TIME_diff := LoadLibFunction(ADllHandle, ASN1_TIME_diff_procname); + FuncLoadError := not assigned(ASN1_TIME_diff); + if FuncLoadError then + begin + {$if not defined(ASN1_TIME_diff_allownil)} + ASN1_TIME_diff := @ERR_ASN1_TIME_diff; + {$ifend} + {$if declared(ASN1_TIME_diff_introduced)} + if LibVersion < ASN1_TIME_diff_introduced then + begin + {$if declared(FC_ASN1_TIME_diff)} + ASN1_TIME_diff := @FC_ASN1_TIME_diff; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_TIME_diff_removed)} + if ASN1_TIME_diff_removed <= LibVersion then + begin + {$if declared(_ASN1_TIME_diff)} + ASN1_TIME_diff := @_ASN1_TIME_diff; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_TIME_diff_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_TIME_diff'); + {$ifend} + end; + + + ASN1_OCTET_STRING_dup := LoadLibFunction(ADllHandle, ASN1_OCTET_STRING_dup_procname); + FuncLoadError := not assigned(ASN1_OCTET_STRING_dup); + if FuncLoadError then + begin + {$if not defined(ASN1_OCTET_STRING_dup_allownil)} + ASN1_OCTET_STRING_dup := @ERR_ASN1_OCTET_STRING_dup; + {$ifend} + {$if declared(ASN1_OCTET_STRING_dup_introduced)} + if LibVersion < ASN1_OCTET_STRING_dup_introduced then + begin + {$if declared(FC_ASN1_OCTET_STRING_dup)} + ASN1_OCTET_STRING_dup := @FC_ASN1_OCTET_STRING_dup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_OCTET_STRING_dup_removed)} + if ASN1_OCTET_STRING_dup_removed <= LibVersion then + begin + {$if declared(_ASN1_OCTET_STRING_dup)} + ASN1_OCTET_STRING_dup := @_ASN1_OCTET_STRING_dup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_OCTET_STRING_dup_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_OCTET_STRING_dup'); + {$ifend} + end; + + + ASN1_OCTET_STRING_cmp := LoadLibFunction(ADllHandle, ASN1_OCTET_STRING_cmp_procname); + FuncLoadError := not assigned(ASN1_OCTET_STRING_cmp); + if FuncLoadError then + begin + {$if not defined(ASN1_OCTET_STRING_cmp_allownil)} + ASN1_OCTET_STRING_cmp := @ERR_ASN1_OCTET_STRING_cmp; + {$ifend} + {$if declared(ASN1_OCTET_STRING_cmp_introduced)} + if LibVersion < ASN1_OCTET_STRING_cmp_introduced then + begin + {$if declared(FC_ASN1_OCTET_STRING_cmp)} + ASN1_OCTET_STRING_cmp := @FC_ASN1_OCTET_STRING_cmp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_OCTET_STRING_cmp_removed)} + if ASN1_OCTET_STRING_cmp_removed <= LibVersion then + begin + {$if declared(_ASN1_OCTET_STRING_cmp)} + ASN1_OCTET_STRING_cmp := @_ASN1_OCTET_STRING_cmp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_OCTET_STRING_cmp_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_OCTET_STRING_cmp'); + {$ifend} + end; + + + ASN1_OCTET_STRING_set := LoadLibFunction(ADllHandle, ASN1_OCTET_STRING_set_procname); + FuncLoadError := not assigned(ASN1_OCTET_STRING_set); + if FuncLoadError then + begin + {$if not defined(ASN1_OCTET_STRING_set_allownil)} + ASN1_OCTET_STRING_set := @ERR_ASN1_OCTET_STRING_set; + {$ifend} + {$if declared(ASN1_OCTET_STRING_set_introduced)} + if LibVersion < ASN1_OCTET_STRING_set_introduced then + begin + {$if declared(FC_ASN1_OCTET_STRING_set)} + ASN1_OCTET_STRING_set := @FC_ASN1_OCTET_STRING_set; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_OCTET_STRING_set_removed)} + if ASN1_OCTET_STRING_set_removed <= LibVersion then + begin + {$if declared(_ASN1_OCTET_STRING_set)} + ASN1_OCTET_STRING_set := @_ASN1_OCTET_STRING_set; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_OCTET_STRING_set_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_OCTET_STRING_set'); + {$ifend} + end; + + + d2i_ASN1_OCTET_STRING := LoadLibFunction(ADllHandle, d2i_ASN1_OCTET_STRING_procname); + FuncLoadError := not assigned(d2i_ASN1_OCTET_STRING); + if FuncLoadError then + begin + {$if not defined(d2i_ASN1_OCTET_STRING_allownil)} + UTF8_getc := @ERR_d2i_ASN1_OCTET_STRING; + {$ifend} + {$if declared(d2i_ASN1_OCTET_STRING_introduced)} + if LibVersion < d2i_ASN1_OCTET_STRING_introduced then + begin + {$if declared(d2i_ASN1_OCTET_STRING)} + d2i_ASN1_OCTET_STRING := @FC_d2i_ASN1_OCTET_STRING; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(d2i_ASN1_OCTET_STRING_removed)} + if UTF8_getc_removed <= LibVersion then + begin + {$if declared(_d2i_ASN1_OCTET_STRING)} + d2i_ASN1_OCTET_STRING := @d2i_ASN1_OCTET_STRING; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(d2i_ASN1_OCTET_STRING_allownil)} + if FuncLoadError then + AFailed.Add('d2i_ASN1_OCTET_STRING'); + {$ifend} + + end; + + i2d_ASN1_OCTET_STRING := LoadLibFunction(ADllHandle, i2d_ASN1_OCTET_STRING_procname); + FuncLoadError := not assigned(i2d_ASN1_OCTET_STRING); + if FuncLoadError then + begin + {$if not defined(i2d_ASN1_OCTET_STRING_allownil)} + UTF8_getc := @ERR_i2d_ASN1_OCTET_STRING; + {$ifend} + {$if declared(i2d_ASN1_OCTET_STRING_introduced)} + if LibVersion < i2d_ASN1_OCTET_STRING_introduced then + begin + {$if declared(i2d_ASN1_OCTET_STRING)} + i2d_ASN1_OCTET_STRING := @FC_i2d_ASN1_OCTET_STRING; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(i2d_ASN1_OCTET_STRING_removed)} + if UTF8_getc_removed <= LibVersion then + begin + {$if declared(_i2d_ASN1_OCTET_STRING)} + i2d_ASN1_OCTET_STRING := @i2d_ASN1_OCTET_STRING; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(i2d_ASN1_OCTET_STRING_allownil)} + if FuncLoadError then + AFailed.Add('i2d_ASN1_OCTET_STRING'); + {$ifend} + + end; + + + ASN1_OCTET_STRING_free := LoadLibFunction(ADllHandle, ASN1_OCTET_STRING_free_procname); + FuncLoadError := not assigned(ASN1_OCTET_STRING_free); + if FuncLoadError then + begin + {$if not defined(ASN1_OCTET_STRING_free_allownil)} + UTF8_getc := @ASN1_OCTET_STRING_free; + {$ifend} + {$if declared(ASN1_OCTET_STRING_free_introduced)} + if LibVersion < ASN1_OCTET_STRING_free_introduced then + begin + {$if declared(ASN1_OCTET_STRING_free)} + i2d_ASN1_OCTET_STRING := @FC_ASN1_OCTET_STRING_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_OCTET_STRING_free_removed)} + if UTF8_getc_removed <= LibVersion then + begin + {$if declared(_ASN1_OCTET_STRING_free)} + ASN1_OCTET_STRING_free := @ASN1_OCTET_STRING_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_OCTET_STRING_free_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_OCTET_STRING_free'); + {$ifend} + + end; + + + UTF8_getc := LoadLibFunction(ADllHandle, UTF8_getc_procname); + FuncLoadError := not assigned(UTF8_getc); + if FuncLoadError then + begin + {$if not defined(UTF8_getc_allownil)} + UTF8_getc := @ERR_UTF8_getc; + {$ifend} + {$if declared(UTF8_getc_introduced)} + if LibVersion < UTF8_getc_introduced then + begin + {$if declared(FC_UTF8_getc)} + UTF8_getc := @FC_UTF8_getc; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(UTF8_getc_removed)} + if UTF8_getc_removed <= LibVersion then + begin + {$if declared(_UTF8_getc)} + UTF8_getc := @_UTF8_getc; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(UTF8_getc_allownil)} + if FuncLoadError then + AFailed.Add('UTF8_getc'); + {$ifend} + end; + + + UTF8_putc := LoadLibFunction(ADllHandle, UTF8_putc_procname); + FuncLoadError := not assigned(UTF8_putc); + if FuncLoadError then + begin + {$if not defined(UTF8_putc_allownil)} + UTF8_putc := @ERR_UTF8_putc; + {$ifend} + {$if declared(UTF8_putc_introduced)} + if LibVersion < UTF8_putc_introduced then + begin + {$if declared(FC_UTF8_putc)} + UTF8_putc := @FC_UTF8_putc; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(UTF8_putc_removed)} + if UTF8_putc_removed <= LibVersion then + begin + {$if declared(_UTF8_putc)} + UTF8_putc := @_UTF8_putc; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(UTF8_putc_allownil)} + if FuncLoadError then + AFailed.Add('UTF8_putc'); + {$ifend} + end; + + + ASN1_UTCTIME_new := LoadLibFunction(ADllHandle, ASN1_UTCTIME_new_procname); + FuncLoadError := not assigned(ASN1_UTCTIME_new); + if FuncLoadError then + begin + {$if not defined(ASN1_UTCTIME_new_allownil)} + ASN1_UTCTIME_new := @ERR_ASN1_UTCTIME_new; + {$ifend} + {$if declared(ASN1_UTCTIME_new_introduced)} + if LibVersion < ASN1_UTCTIME_new_introduced then + begin + {$if declared(FC_ASN1_UTCTIME_new)} + ASN1_UTCTIME_new := @FC_ASN1_UTCTIME_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_UTCTIME_new_removed)} + if ASN1_UTCTIME_new_removed <= LibVersion then + begin + {$if declared(_ASN1_UTCTIME_new)} + ASN1_UTCTIME_new := @_ASN1_UTCTIME_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_UTCTIME_new_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_UTCTIME_new'); + {$ifend} + end; + + + ASN1_UTCTIME_free := LoadLibFunction(ADllHandle, ASN1_UTCTIME_free_procname); + FuncLoadError := not assigned(ASN1_UTCTIME_free); + if FuncLoadError then + begin + {$if not defined(ASN1_UTCTIME_free_allownil)} + ASN1_UTCTIME_free := @ERR_ASN1_UTCTIME_free; + {$ifend} + {$if declared(ASN1_UTCTIME_free_introduced)} + if LibVersion < ASN1_UTCTIME_free_introduced then + begin + {$if declared(FC_ASN1_UTCTIME_free)} + ASN1_UTCTIME_free := @FC_ASN1_UTCTIME_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_UTCTIME_free_removed)} + if ASN1_UTCTIME_free_removed <= LibVersion then + begin + {$if declared(_ASN1_UTCTIME_free)} + ASN1_UTCTIME_free := @_ASN1_UTCTIME_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_UTCTIME_free_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_UTCTIME_free'); + {$ifend} + end; + + + d2i_ASN1_UTCTIME := LoadLibFunction(ADllHandle, d2i_ASN1_UTCTIME_procname); + FuncLoadError := not assigned(d2i_ASN1_UTCTIME); + if FuncLoadError then + begin + {$if not defined(d2i_ASN1_UTCTIME_allownil)} + d2i_ASN1_UTCTIME := @ERR_d2i_ASN1_UTCTIME; + {$ifend} + {$if declared(d2i_ASN1_UTCTIME_introduced)} + if LibVersion < d2i_ASN1_UTCTIME_introduced then + begin + {$if declared(FC_d2i_ASN1_UTCTIME)} + d2i_ASN1_UTCTIME := @FC_d2i_ASN1_UTCTIME; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(d2i_ASN1_UTCTIME_removed)} + if d2i_ASN1_UTCTIME_removed <= LibVersion then + begin + {$if declared(_d2i_ASN1_UTCTIME)} + d2i_ASN1_UTCTIME := @_d2i_ASN1_UTCTIME; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(d2i_ASN1_UTCTIME_allownil)} + if FuncLoadError then + AFailed.Add('d2i_ASN1_UTCTIME'); + {$ifend} + end; + + + i2d_ASN1_UTCTIME := LoadLibFunction(ADllHandle, i2d_ASN1_UTCTIME_procname); + FuncLoadError := not assigned(i2d_ASN1_UTCTIME); + if FuncLoadError then + begin + {$if not defined(i2d_ASN1_UTCTIME_allownil)} + i2d_ASN1_UTCTIME := @ERR_i2d_ASN1_UTCTIME; + {$ifend} + {$if declared(i2d_ASN1_UTCTIME_introduced)} + if LibVersion < i2d_ASN1_UTCTIME_introduced then + begin + {$if declared(FC_i2d_ASN1_UTCTIME)} + i2d_ASN1_UTCTIME := @FC_i2d_ASN1_UTCTIME; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(i2d_ASN1_UTCTIME_removed)} + if i2d_ASN1_UTCTIME_removed <= LibVersion then + begin + {$if declared(_i2d_ASN1_UTCTIME)} + i2d_ASN1_UTCTIME := @_i2d_ASN1_UTCTIME; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(i2d_ASN1_UTCTIME_allownil)} + if FuncLoadError then + AFailed.Add('i2d_ASN1_UTCTIME'); + {$ifend} + end; + + + ASN1_GENERALIZEDTIME_new := LoadLibFunction(ADllHandle, ASN1_GENERALIZEDTIME_new_procname); + FuncLoadError := not assigned(ASN1_GENERALIZEDTIME_new); + if FuncLoadError then + begin + {$if not defined(ASN1_GENERALIZEDTIME_new_allownil)} + ASN1_GENERALIZEDTIME_new := @ERR_ASN1_GENERALIZEDTIME_new; + {$ifend} + {$if declared(ASN1_GENERALIZEDTIME_new_introduced)} + if LibVersion < ASN1_GENERALIZEDTIME_new_introduced then + begin + {$if declared(FC_ASN1_GENERALIZEDTIME_new)} + ASN1_GENERALIZEDTIME_new := @FC_ASN1_GENERALIZEDTIME_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_GENERALIZEDTIME_new_removed)} + if ASN1_GENERALIZEDTIME_new_removed <= LibVersion then + begin + {$if declared(_ASN1_GENERALIZEDTIME_new)} + ASN1_GENERALIZEDTIME_new := @_ASN1_GENERALIZEDTIME_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_GENERALIZEDTIME_new_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_GENERALIZEDTIME_new'); + {$ifend} + end; + + + ASN1_GENERALIZEDTIME_free := LoadLibFunction(ADllHandle, ASN1_GENERALIZEDTIME_free_procname); + FuncLoadError := not assigned(ASN1_GENERALIZEDTIME_free); + if FuncLoadError then + begin + {$if not defined(ASN1_GENERALIZEDTIME_free_allownil)} + ASN1_GENERALIZEDTIME_free := @ERR_ASN1_GENERALIZEDTIME_free; + {$ifend} + {$if declared(ASN1_GENERALIZEDTIME_free_introduced)} + if LibVersion < ASN1_GENERALIZEDTIME_free_introduced then + begin + {$if declared(FC_ASN1_GENERALIZEDTIME_free)} + ASN1_GENERALIZEDTIME_free := @FC_ASN1_GENERALIZEDTIME_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_GENERALIZEDTIME_free_removed)} + if ASN1_GENERALIZEDTIME_free_removed <= LibVersion then + begin + {$if declared(_ASN1_GENERALIZEDTIME_free)} + ASN1_GENERALIZEDTIME_free := @_ASN1_GENERALIZEDTIME_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_GENERALIZEDTIME_free_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_GENERALIZEDTIME_free'); + {$ifend} + end; + + + d2i_ASN1_GENERALIZEDTIME := LoadLibFunction(ADllHandle, d2i_ASN1_GENERALIZEDTIME_procname); + FuncLoadError := not assigned(d2i_ASN1_GENERALIZEDTIME); + if FuncLoadError then + begin + {$if not defined(d2i_ASN1_GENERALIZEDTIME_allownil)} + d2i_ASN1_GENERALIZEDTIME := @ERR_d2i_ASN1_GENERALIZEDTIME; + {$ifend} + {$if declared(d2i_ASN1_GENERALIZEDTIME_introduced)} + if LibVersion < d2i_ASN1_GENERALIZEDTIME_introduced then + begin + {$if declared(FC_d2i_ASN1_GENERALIZEDTIME)} + d2i_ASN1_GENERALIZEDTIME := @FC_d2i_ASN1_GENERALIZEDTIME; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(d2i_ASN1_GENERALIZEDTIME_removed)} + if d2i_ASN1_GENERALIZEDTIME_removed <= LibVersion then + begin + {$if declared(_d2i_ASN1_GENERALIZEDTIME)} + d2i_ASN1_GENERALIZEDTIME := @_d2i_ASN1_GENERALIZEDTIME; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(d2i_ASN1_GENERALIZEDTIME_allownil)} + if FuncLoadError then + AFailed.Add('d2i_ASN1_GENERALIZEDTIME'); + {$ifend} + end; + + + i2d_ASN1_GENERALIZEDTIME := LoadLibFunction(ADllHandle, i2d_ASN1_GENERALIZEDTIME_procname); + FuncLoadError := not assigned(i2d_ASN1_GENERALIZEDTIME); + if FuncLoadError then + begin + {$if not defined(i2d_ASN1_GENERALIZEDTIME_allownil)} + i2d_ASN1_GENERALIZEDTIME := @ERR_i2d_ASN1_GENERALIZEDTIME; + {$ifend} + {$if declared(i2d_ASN1_GENERALIZEDTIME_introduced)} + if LibVersion < i2d_ASN1_GENERALIZEDTIME_introduced then + begin + {$if declared(FC_i2d_ASN1_GENERALIZEDTIME)} + i2d_ASN1_GENERALIZEDTIME := @FC_i2d_ASN1_GENERALIZEDTIME; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(i2d_ASN1_GENERALIZEDTIME_removed)} + if i2d_ASN1_GENERALIZEDTIME_removed <= LibVersion then + begin + {$if declared(_i2d_ASN1_GENERALIZEDTIME)} + i2d_ASN1_GENERALIZEDTIME := @_i2d_ASN1_GENERALIZEDTIME; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(i2d_ASN1_GENERALIZEDTIME_allownil)} + if FuncLoadError then + AFailed.Add('i2d_ASN1_GENERALIZEDTIME'); + {$ifend} + end; + + + ASN1_TIME_new := LoadLibFunction(ADllHandle, ASN1_TIME_new_procname); + FuncLoadError := not assigned(ASN1_TIME_new); + if FuncLoadError then + begin + {$if not defined(ASN1_TIME_new_allownil)} + ASN1_TIME_new := @ERR_ASN1_TIME_new; + {$ifend} + {$if declared(ASN1_TIME_new_introduced)} + if LibVersion < ASN1_TIME_new_introduced then + begin + {$if declared(FC_ASN1_TIME_new)} + ASN1_TIME_new := @FC_ASN1_TIME_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_TIME_new_removed)} + if ASN1_TIME_new_removed <= LibVersion then + begin + {$if declared(_ASN1_TIME_new)} + ASN1_TIME_new := @_ASN1_TIME_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_TIME_new_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_TIME_new'); + {$ifend} + end; + + + ASN1_TIME_free := LoadLibFunction(ADllHandle, ASN1_TIME_free_procname); + FuncLoadError := not assigned(ASN1_TIME_free); + if FuncLoadError then + begin + {$if not defined(ASN1_TIME_free_allownil)} + ASN1_TIME_free := @ERR_ASN1_TIME_free; + {$ifend} + {$if declared(ASN1_TIME_free_introduced)} + if LibVersion < ASN1_TIME_free_introduced then + begin + {$if declared(FC_ASN1_TIME_free)} + ASN1_TIME_free := @FC_ASN1_TIME_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_TIME_free_removed)} + if ASN1_TIME_free_removed <= LibVersion then + begin + {$if declared(_ASN1_TIME_free)} + ASN1_TIME_free := @_ASN1_TIME_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_TIME_free_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_TIME_free'); + {$ifend} + end; + + + d2i_ASN1_TIME := LoadLibFunction(ADllHandle, d2i_ASN1_TIME_procname); + FuncLoadError := not assigned(d2i_ASN1_TIME); + if FuncLoadError then + begin + {$if not defined(d2i_ASN1_TIME_allownil)} + d2i_ASN1_TIME := @ERR_d2i_ASN1_TIME; + {$ifend} + {$if declared(d2i_ASN1_TIME_introduced)} + if LibVersion < d2i_ASN1_TIME_introduced then + begin + {$if declared(FC_d2i_ASN1_TIME)} + d2i_ASN1_TIME := @FC_d2i_ASN1_TIME; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(d2i_ASN1_TIME_removed)} + if d2i_ASN1_TIME_removed <= LibVersion then + begin + {$if declared(_d2i_ASN1_TIME)} + d2i_ASN1_TIME := @_d2i_ASN1_TIME; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(d2i_ASN1_TIME_allownil)} + if FuncLoadError then + AFailed.Add('d2i_ASN1_TIME'); + {$ifend} + end; + + + i2d_ASN1_TIME := LoadLibFunction(ADllHandle, i2d_ASN1_TIME_procname); + FuncLoadError := not assigned(i2d_ASN1_TIME); + if FuncLoadError then + begin + {$if not defined(i2d_ASN1_TIME_allownil)} + i2d_ASN1_TIME := @ERR_i2d_ASN1_TIME; + {$ifend} + {$if declared(i2d_ASN1_TIME_introduced)} + if LibVersion < i2d_ASN1_TIME_introduced then + begin + {$if declared(FC_i2d_ASN1_TIME)} + i2d_ASN1_TIME := @FC_i2d_ASN1_TIME; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(i2d_ASN1_TIME_removed)} + if i2d_ASN1_TIME_removed <= LibVersion then + begin + {$if declared(_i2d_ASN1_TIME)} + i2d_ASN1_TIME := @_i2d_ASN1_TIME; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(i2d_ASN1_TIME_allownil)} + if FuncLoadError then + AFailed.Add('i2d_ASN1_TIME'); + {$ifend} + end; + + + ASN1_TIME_set := LoadLibFunction(ADllHandle, ASN1_TIME_set_procname); + FuncLoadError := not assigned(ASN1_TIME_set); + if FuncLoadError then + begin + {$if not defined(ASN1_TIME_set_allownil)} + ASN1_TIME_set := @ERR_ASN1_TIME_set; + {$ifend} + {$if declared(ASN1_TIME_set_introduced)} + if LibVersion < ASN1_TIME_set_introduced then + begin + {$if declared(FC_ASN1_TIME_set)} + ASN1_TIME_set := @FC_ASN1_TIME_set; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_TIME_set_removed)} + if ASN1_TIME_set_removed <= LibVersion then + begin + {$if declared(_ASN1_TIME_set)} + ASN1_TIME_set := @_ASN1_TIME_set; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_TIME_set_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_TIME_set'); + {$ifend} + end; + + + ASN1_TIME_adj := LoadLibFunction(ADllHandle, ASN1_TIME_adj_procname); + FuncLoadError := not assigned(ASN1_TIME_adj); + if FuncLoadError then + begin + {$if not defined(ASN1_TIME_adj_allownil)} + ASN1_TIME_adj := @ERR_ASN1_TIME_adj; + {$ifend} + {$if declared(ASN1_TIME_adj_introduced)} + if LibVersion < ASN1_TIME_adj_introduced then + begin + {$if declared(FC_ASN1_TIME_adj)} + ASN1_TIME_adj := @FC_ASN1_TIME_adj; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_TIME_adj_removed)} + if ASN1_TIME_adj_removed <= LibVersion then + begin + {$if declared(_ASN1_TIME_adj)} + ASN1_TIME_adj := @_ASN1_TIME_adj; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_TIME_adj_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_TIME_adj'); + {$ifend} + end; + + + ASN1_TIME_check := LoadLibFunction(ADllHandle, ASN1_TIME_check_procname); + FuncLoadError := not assigned(ASN1_TIME_check); + if FuncLoadError then + begin + {$if not defined(ASN1_TIME_check_allownil)} + ASN1_TIME_check := @ERR_ASN1_TIME_check; + {$ifend} + {$if declared(ASN1_TIME_check_introduced)} + if LibVersion < ASN1_TIME_check_introduced then + begin + {$if declared(FC_ASN1_TIME_check)} + ASN1_TIME_check := @FC_ASN1_TIME_check; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_TIME_check_removed)} + if ASN1_TIME_check_removed <= LibVersion then + begin + {$if declared(_ASN1_TIME_check)} + ASN1_TIME_check := @_ASN1_TIME_check; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_TIME_check_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_TIME_check'); + {$ifend} + end; + + + ASN1_TIME_to_generalizedtime := LoadLibFunction(ADllHandle, ASN1_TIME_to_generalizedtime_procname); + FuncLoadError := not assigned(ASN1_TIME_to_generalizedtime); + if FuncLoadError then + begin + {$if not defined(ASN1_TIME_to_generalizedtime_allownil)} + ASN1_TIME_to_generalizedtime := @ERR_ASN1_TIME_to_generalizedtime; + {$ifend} + {$if declared(ASN1_TIME_to_generalizedtime_introduced)} + if LibVersion < ASN1_TIME_to_generalizedtime_introduced then + begin + {$if declared(FC_ASN1_TIME_to_generalizedtime)} + ASN1_TIME_to_generalizedtime := @FC_ASN1_TIME_to_generalizedtime; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_TIME_to_generalizedtime_removed)} + if ASN1_TIME_to_generalizedtime_removed <= LibVersion then + begin + {$if declared(_ASN1_TIME_to_generalizedtime)} + ASN1_TIME_to_generalizedtime := @_ASN1_TIME_to_generalizedtime; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_TIME_to_generalizedtime_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_TIME_to_generalizedtime'); + {$ifend} + end; + + + ASN1_TIME_set_string := LoadLibFunction(ADllHandle, ASN1_TIME_set_string_procname); + FuncLoadError := not assigned(ASN1_TIME_set_string); + if FuncLoadError then + begin + {$if not defined(ASN1_TIME_set_string_allownil)} + ASN1_TIME_set_string := @ERR_ASN1_TIME_set_string; + {$ifend} + {$if declared(ASN1_TIME_set_string_introduced)} + if LibVersion < ASN1_TIME_set_string_introduced then + begin + {$if declared(FC_ASN1_TIME_set_string)} + ASN1_TIME_set_string := @FC_ASN1_TIME_set_string; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_TIME_set_string_removed)} + if ASN1_TIME_set_string_removed <= LibVersion then + begin + {$if declared(_ASN1_TIME_set_string)} + ASN1_TIME_set_string := @_ASN1_TIME_set_string; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_TIME_set_string_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_TIME_set_string'); + {$ifend} + end; + + + ASN1_TIME_set_string_X509 := LoadLibFunction(ADllHandle, ASN1_TIME_set_string_X509_procname); + FuncLoadError := not assigned(ASN1_TIME_set_string_X509); + if FuncLoadError then + begin + {$if not defined(ASN1_TIME_set_string_X509_allownil)} + ASN1_TIME_set_string_X509 := @ERR_ASN1_TIME_set_string_X509; + {$ifend} + {$if declared(ASN1_TIME_set_string_X509_introduced)} + if LibVersion < ASN1_TIME_set_string_X509_introduced then + begin + {$if declared(FC_ASN1_TIME_set_string_X509)} + ASN1_TIME_set_string_X509 := @FC_ASN1_TIME_set_string_X509; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_TIME_set_string_X509_removed)} + if ASN1_TIME_set_string_X509_removed <= LibVersion then + begin + {$if declared(_ASN1_TIME_set_string_X509)} + ASN1_TIME_set_string_X509 := @_ASN1_TIME_set_string_X509; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_TIME_set_string_X509_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_TIME_set_string_X509'); + {$ifend} + end; + + {introduced 1.1.0} + ASN1_TIME_to_tm := LoadLibFunction(ADllHandle, ASN1_TIME_to_tm_procname); + FuncLoadError := not assigned(ASN1_TIME_to_tm); + if FuncLoadError then + begin + {$if not defined(ASN1_TIME_to_tm_allownil)} + ASN1_TIME_to_tm := @ERR_ASN1_TIME_to_tm; + {$ifend} + {$if declared(ASN1_TIME_to_tm_introduced)} + if LibVersion < ASN1_TIME_to_tm_introduced then + begin + {$if declared(FC_ASN1_TIME_to_tm)} + ASN1_TIME_to_tm := @FC_ASN1_TIME_to_tm; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_TIME_to_tm_removed)} + if ASN1_TIME_to_tm_removed <= LibVersion then + begin + {$if declared(_ASN1_TIME_to_tm)} + ASN1_TIME_to_tm := @_ASN1_TIME_to_tm; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_TIME_to_tm_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_TIME_to_tm'); + {$ifend} + end; + + {introduced 1.1.0} + ASN1_TIME_normalize := LoadLibFunction(ADllHandle, ASN1_TIME_normalize_procname); + FuncLoadError := not assigned(ASN1_TIME_normalize); + if FuncLoadError then + begin + {$if not defined(ASN1_TIME_normalize_allownil)} + ASN1_TIME_normalize := @ERR_ASN1_TIME_normalize; + {$ifend} + {$if declared(ASN1_TIME_normalize_introduced)} + if LibVersion < ASN1_TIME_normalize_introduced then + begin + {$if declared(FC_ASN1_TIME_normalize)} + ASN1_TIME_normalize := @FC_ASN1_TIME_normalize; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_TIME_normalize_removed)} + if ASN1_TIME_normalize_removed <= LibVersion then + begin + {$if declared(_ASN1_TIME_normalize)} + ASN1_TIME_normalize := @_ASN1_TIME_normalize; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_TIME_normalize_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_TIME_normalize'); + {$ifend} + end; + + {introduced 1.1.0} + ASN1_TIME_cmp_time_t := LoadLibFunction(ADllHandle, ASN1_TIME_cmp_time_t_procname); + FuncLoadError := not assigned(ASN1_TIME_cmp_time_t); + if FuncLoadError then + begin + {$if not defined(ASN1_TIME_cmp_time_t_allownil)} + ASN1_TIME_cmp_time_t := @ERR_ASN1_TIME_cmp_time_t; + {$ifend} + {$if declared(ASN1_TIME_cmp_time_t_introduced)} + if LibVersion < ASN1_TIME_cmp_time_t_introduced then + begin + {$if declared(FC_ASN1_TIME_cmp_time_t)} + ASN1_TIME_cmp_time_t := @FC_ASN1_TIME_cmp_time_t; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_TIME_cmp_time_t_removed)} + if ASN1_TIME_cmp_time_t_removed <= LibVersion then + begin + {$if declared(_ASN1_TIME_cmp_time_t)} + ASN1_TIME_cmp_time_t := @_ASN1_TIME_cmp_time_t; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_TIME_cmp_time_t_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_TIME_cmp_time_t'); + {$ifend} + end; + + {introduced 1.1.0} + ASN1_TIME_compare := LoadLibFunction(ADllHandle, ASN1_TIME_compare_procname); + FuncLoadError := not assigned(ASN1_TIME_compare); + if FuncLoadError then + begin + {$if not defined(ASN1_TIME_compare_allownil)} + ASN1_TIME_compare := @ERR_ASN1_TIME_compare; + {$ifend} + {$if declared(ASN1_TIME_compare_introduced)} + if LibVersion < ASN1_TIME_compare_introduced then + begin + {$if declared(FC_ASN1_TIME_compare)} + ASN1_TIME_compare := @FC_ASN1_TIME_compare; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_TIME_compare_removed)} + if ASN1_TIME_compare_removed <= LibVersion then + begin + {$if declared(_ASN1_TIME_compare)} + ASN1_TIME_compare := @_ASN1_TIME_compare; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_TIME_compare_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_TIME_compare'); + {$ifend} + end; + + {introduced 1.1.0} + i2a_ASN1_INTEGER := LoadLibFunction(ADllHandle, i2a_ASN1_INTEGER_procname); + FuncLoadError := not assigned(i2a_ASN1_INTEGER); + if FuncLoadError then + begin + {$if not defined(i2a_ASN1_INTEGER_allownil)} + i2a_ASN1_INTEGER := @ERR_i2a_ASN1_INTEGER; + {$ifend} + {$if declared(i2a_ASN1_INTEGER_introduced)} + if LibVersion < i2a_ASN1_INTEGER_introduced then + begin + {$if declared(FC_i2a_ASN1_INTEGER)} + i2a_ASN1_INTEGER := @FC_i2a_ASN1_INTEGER; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(i2a_ASN1_INTEGER_removed)} + if i2a_ASN1_INTEGER_removed <= LibVersion then + begin + {$if declared(_i2a_ASN1_INTEGER)} + i2a_ASN1_INTEGER := @_i2a_ASN1_INTEGER; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(i2a_ASN1_INTEGER_allownil)} + if FuncLoadError then + AFailed.Add('i2a_ASN1_INTEGER'); + {$ifend} + end; + + + a2i_ASN1_INTEGER := LoadLibFunction(ADllHandle, a2i_ASN1_INTEGER_procname); + FuncLoadError := not assigned(a2i_ASN1_INTEGER); + if FuncLoadError then + begin + {$if not defined(a2i_ASN1_INTEGER_allownil)} + a2i_ASN1_INTEGER := @ERR_a2i_ASN1_INTEGER; + {$ifend} + {$if declared(a2i_ASN1_INTEGER_introduced)} + if LibVersion < a2i_ASN1_INTEGER_introduced then + begin + {$if declared(FC_a2i_ASN1_INTEGER)} + a2i_ASN1_INTEGER := @FC_a2i_ASN1_INTEGER; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(a2i_ASN1_INTEGER_removed)} + if a2i_ASN1_INTEGER_removed <= LibVersion then + begin + {$if declared(_a2i_ASN1_INTEGER)} + a2i_ASN1_INTEGER := @_a2i_ASN1_INTEGER; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(a2i_ASN1_INTEGER_allownil)} + if FuncLoadError then + AFailed.Add('a2i_ASN1_INTEGER'); + {$ifend} + end; + + + i2a_ASN1_ENUMERATED := LoadLibFunction(ADllHandle, i2a_ASN1_ENUMERATED_procname); + FuncLoadError := not assigned(i2a_ASN1_ENUMERATED); + if FuncLoadError then + begin + {$if not defined(i2a_ASN1_ENUMERATED_allownil)} + i2a_ASN1_ENUMERATED := @ERR_i2a_ASN1_ENUMERATED; + {$ifend} + {$if declared(i2a_ASN1_ENUMERATED_introduced)} + if LibVersion < i2a_ASN1_ENUMERATED_introduced then + begin + {$if declared(FC_i2a_ASN1_ENUMERATED)} + i2a_ASN1_ENUMERATED := @FC_i2a_ASN1_ENUMERATED; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(i2a_ASN1_ENUMERATED_removed)} + if i2a_ASN1_ENUMERATED_removed <= LibVersion then + begin + {$if declared(_i2a_ASN1_ENUMERATED)} + i2a_ASN1_ENUMERATED := @_i2a_ASN1_ENUMERATED; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(i2a_ASN1_ENUMERATED_allownil)} + if FuncLoadError then + AFailed.Add('i2a_ASN1_ENUMERATED'); + {$ifend} + end; + + + a2i_ASN1_ENUMERATED := LoadLibFunction(ADllHandle, a2i_ASN1_ENUMERATED_procname); + FuncLoadError := not assigned(a2i_ASN1_ENUMERATED); + if FuncLoadError then + begin + {$if not defined(a2i_ASN1_ENUMERATED_allownil)} + a2i_ASN1_ENUMERATED := @ERR_a2i_ASN1_ENUMERATED; + {$ifend} + {$if declared(a2i_ASN1_ENUMERATED_introduced)} + if LibVersion < a2i_ASN1_ENUMERATED_introduced then + begin + {$if declared(FC_a2i_ASN1_ENUMERATED)} + a2i_ASN1_ENUMERATED := @FC_a2i_ASN1_ENUMERATED; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(a2i_ASN1_ENUMERATED_removed)} + if a2i_ASN1_ENUMERATED_removed <= LibVersion then + begin + {$if declared(_a2i_ASN1_ENUMERATED)} + a2i_ASN1_ENUMERATED := @_a2i_ASN1_ENUMERATED; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(a2i_ASN1_ENUMERATED_allownil)} + if FuncLoadError then + AFailed.Add('a2i_ASN1_ENUMERATED'); + {$ifend} + end; + + + i2a_ASN1_OBJECT := LoadLibFunction(ADllHandle, i2a_ASN1_OBJECT_procname); + FuncLoadError := not assigned(i2a_ASN1_OBJECT); + if FuncLoadError then + begin + {$if not defined(i2a_ASN1_OBJECT_allownil)} + i2a_ASN1_OBJECT := @ERR_i2a_ASN1_OBJECT; + {$ifend} + {$if declared(i2a_ASN1_OBJECT_introduced)} + if LibVersion < i2a_ASN1_OBJECT_introduced then + begin + {$if declared(FC_i2a_ASN1_OBJECT)} + i2a_ASN1_OBJECT := @FC_i2a_ASN1_OBJECT; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(i2a_ASN1_OBJECT_removed)} + if i2a_ASN1_OBJECT_removed <= LibVersion then + begin + {$if declared(_i2a_ASN1_OBJECT)} + i2a_ASN1_OBJECT := @_i2a_ASN1_OBJECT; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(i2a_ASN1_OBJECT_allownil)} + if FuncLoadError then + AFailed.Add('i2a_ASN1_OBJECT'); + {$ifend} + end; + + + a2i_ASN1_STRING := LoadLibFunction(ADllHandle, a2i_ASN1_STRING_procname); + FuncLoadError := not assigned(a2i_ASN1_STRING); + if FuncLoadError then + begin + {$if not defined(a2i_ASN1_STRING_allownil)} + a2i_ASN1_STRING := @ERR_a2i_ASN1_STRING; + {$ifend} + {$if declared(a2i_ASN1_STRING_introduced)} + if LibVersion < a2i_ASN1_STRING_introduced then + begin + {$if declared(FC_a2i_ASN1_STRING)} + a2i_ASN1_STRING := @FC_a2i_ASN1_STRING; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(a2i_ASN1_STRING_removed)} + if a2i_ASN1_STRING_removed <= LibVersion then + begin + {$if declared(_a2i_ASN1_STRING)} + a2i_ASN1_STRING := @_a2i_ASN1_STRING; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(a2i_ASN1_STRING_allownil)} + if FuncLoadError then + AFailed.Add('a2i_ASN1_STRING'); + {$ifend} + end; + + + i2a_ASN1_STRING := LoadLibFunction(ADllHandle, i2a_ASN1_STRING_procname); + FuncLoadError := not assigned(i2a_ASN1_STRING); + if FuncLoadError then + begin + {$if not defined(i2a_ASN1_STRING_allownil)} + i2a_ASN1_STRING := @ERR_i2a_ASN1_STRING; + {$ifend} + {$if declared(i2a_ASN1_STRING_introduced)} + if LibVersion < i2a_ASN1_STRING_introduced then + begin + {$if declared(FC_i2a_ASN1_STRING)} + i2a_ASN1_STRING := @FC_i2a_ASN1_STRING; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(i2a_ASN1_STRING_removed)} + if i2a_ASN1_STRING_removed <= LibVersion then + begin + {$if declared(_i2a_ASN1_STRING)} + i2a_ASN1_STRING := @_i2a_ASN1_STRING; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(i2a_ASN1_STRING_allownil)} + if FuncLoadError then + AFailed.Add('i2a_ASN1_STRING'); + {$ifend} + end; + + + i2t_ASN1_OBJECT := LoadLibFunction(ADllHandle, i2t_ASN1_OBJECT_procname); + FuncLoadError := not assigned(i2t_ASN1_OBJECT); + if FuncLoadError then + begin + {$if not defined(i2t_ASN1_OBJECT_allownil)} + i2t_ASN1_OBJECT := @ERR_i2t_ASN1_OBJECT; + {$ifend} + {$if declared(i2t_ASN1_OBJECT_introduced)} + if LibVersion < i2t_ASN1_OBJECT_introduced then + begin + {$if declared(FC_i2t_ASN1_OBJECT)} + i2t_ASN1_OBJECT := @FC_i2t_ASN1_OBJECT; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(i2t_ASN1_OBJECT_removed)} + if i2t_ASN1_OBJECT_removed <= LibVersion then + begin + {$if declared(_i2t_ASN1_OBJECT)} + i2t_ASN1_OBJECT := @_i2t_ASN1_OBJECT; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(i2t_ASN1_OBJECT_allownil)} + if FuncLoadError then + AFailed.Add('i2t_ASN1_OBJECT'); + {$ifend} + end; + + + a2d_ASN1_OBJECT := LoadLibFunction(ADllHandle, a2d_ASN1_OBJECT_procname); + FuncLoadError := not assigned(a2d_ASN1_OBJECT); + if FuncLoadError then + begin + {$if not defined(a2d_ASN1_OBJECT_allownil)} + a2d_ASN1_OBJECT := @ERR_a2d_ASN1_OBJECT; + {$ifend} + {$if declared(a2d_ASN1_OBJECT_introduced)} + if LibVersion < a2d_ASN1_OBJECT_introduced then + begin + {$if declared(FC_a2d_ASN1_OBJECT)} + a2d_ASN1_OBJECT := @FC_a2d_ASN1_OBJECT; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(a2d_ASN1_OBJECT_removed)} + if a2d_ASN1_OBJECT_removed <= LibVersion then + begin + {$if declared(_a2d_ASN1_OBJECT)} + a2d_ASN1_OBJECT := @_a2d_ASN1_OBJECT; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(a2d_ASN1_OBJECT_allownil)} + if FuncLoadError then + AFailed.Add('a2d_ASN1_OBJECT'); + {$ifend} + end; + + + ASN1_OBJECT_create := LoadLibFunction(ADllHandle, ASN1_OBJECT_create_procname); + FuncLoadError := not assigned(ASN1_OBJECT_create); + if FuncLoadError then + begin + {$if not defined(ASN1_OBJECT_create_allownil)} + ASN1_OBJECT_create := @ERR_ASN1_OBJECT_create; + {$ifend} + {$if declared(ASN1_OBJECT_create_introduced)} + if LibVersion < ASN1_OBJECT_create_introduced then + begin + {$if declared(FC_ASN1_OBJECT_create)} + ASN1_OBJECT_create := @FC_ASN1_OBJECT_create; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_OBJECT_create_removed)} + if ASN1_OBJECT_create_removed <= LibVersion then + begin + {$if declared(_ASN1_OBJECT_create)} + ASN1_OBJECT_create := @_ASN1_OBJECT_create; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_OBJECT_create_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_OBJECT_create'); + {$ifend} + end; + + + ASN1_INTEGER_get_int64 := LoadLibFunction(ADllHandle, ASN1_INTEGER_get_int64_procname); + FuncLoadError := not assigned(ASN1_INTEGER_get_int64); + if FuncLoadError then + begin + {$if not defined(ASN1_INTEGER_get_int64_allownil)} + ASN1_INTEGER_get_int64 := @ERR_ASN1_INTEGER_get_int64; + {$ifend} + {$if declared(ASN1_INTEGER_get_int64_introduced)} + if LibVersion < ASN1_INTEGER_get_int64_introduced then + begin + {$if declared(FC_ASN1_INTEGER_get_int64)} + ASN1_INTEGER_get_int64 := @FC_ASN1_INTEGER_get_int64; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_INTEGER_get_int64_removed)} + if ASN1_INTEGER_get_int64_removed <= LibVersion then + begin + {$if declared(_ASN1_INTEGER_get_int64)} + ASN1_INTEGER_get_int64 := @_ASN1_INTEGER_get_int64; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_INTEGER_get_int64_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_INTEGER_get_int64'); + {$ifend} + end; + + {introduced 1.1.0} + ASN1_INTEGER_set_int64 := LoadLibFunction(ADllHandle, ASN1_INTEGER_set_int64_procname); + FuncLoadError := not assigned(ASN1_INTEGER_set_int64); + if FuncLoadError then + begin + {$if not defined(ASN1_INTEGER_set_int64_allownil)} + ASN1_INTEGER_set_int64 := @ERR_ASN1_INTEGER_set_int64; + {$ifend} + {$if declared(ASN1_INTEGER_set_int64_introduced)} + if LibVersion < ASN1_INTEGER_set_int64_introduced then + begin + {$if declared(FC_ASN1_INTEGER_set_int64)} + ASN1_INTEGER_set_int64 := @FC_ASN1_INTEGER_set_int64; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_INTEGER_set_int64_removed)} + if ASN1_INTEGER_set_int64_removed <= LibVersion then + begin + {$if declared(_ASN1_INTEGER_set_int64)} + ASN1_INTEGER_set_int64 := @_ASN1_INTEGER_set_int64; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_INTEGER_set_int64_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_INTEGER_set_int64'); + {$ifend} + end; + + {introduced 1.1.0} + ASN1_INTEGER_get_uint64 := LoadLibFunction(ADllHandle, ASN1_INTEGER_get_uint64_procname); + FuncLoadError := not assigned(ASN1_INTEGER_get_uint64); + if FuncLoadError then + begin + {$if not defined(ASN1_INTEGER_get_uint64_allownil)} + ASN1_INTEGER_get_uint64 := @ERR_ASN1_INTEGER_get_uint64; + {$ifend} + {$if declared(ASN1_INTEGER_get_uint64_introduced)} + if LibVersion < ASN1_INTEGER_get_uint64_introduced then + begin + {$if declared(FC_ASN1_INTEGER_get_uint64)} + ASN1_INTEGER_get_uint64 := @FC_ASN1_INTEGER_get_uint64; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_INTEGER_get_uint64_removed)} + if ASN1_INTEGER_get_uint64_removed <= LibVersion then + begin + {$if declared(_ASN1_INTEGER_get_uint64)} + ASN1_INTEGER_get_uint64 := @_ASN1_INTEGER_get_uint64; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_INTEGER_get_uint64_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_INTEGER_get_uint64'); + {$ifend} + end; + + {introduced 1.1.0} + ASN1_INTEGER_set_uint64 := LoadLibFunction(ADllHandle, ASN1_INTEGER_set_uint64_procname); + FuncLoadError := not assigned(ASN1_INTEGER_set_uint64); + if FuncLoadError then + begin + {$if not defined(ASN1_INTEGER_set_uint64_allownil)} + ASN1_INTEGER_set_uint64 := @ERR_ASN1_INTEGER_set_uint64; + {$ifend} + {$if declared(ASN1_INTEGER_set_uint64_introduced)} + if LibVersion < ASN1_INTEGER_set_uint64_introduced then + begin + {$if declared(FC_ASN1_INTEGER_set_uint64)} + ASN1_INTEGER_set_uint64 := @FC_ASN1_INTEGER_set_uint64; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_INTEGER_set_uint64_removed)} + if ASN1_INTEGER_set_uint64_removed <= LibVersion then + begin + {$if declared(_ASN1_INTEGER_set_uint64)} + ASN1_INTEGER_set_uint64 := @_ASN1_INTEGER_set_uint64; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_INTEGER_set_uint64_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_INTEGER_set_uint64'); + {$ifend} + end; + + {introduced 1.1.0} + ASN1_INTEGER_set := LoadLibFunction(ADllHandle, ASN1_INTEGER_set_procname); + FuncLoadError := not assigned(ASN1_INTEGER_set); + if FuncLoadError then + begin + {$if not defined(ASN1_INTEGER_set_allownil)} + ASN1_INTEGER_set := @ERR_ASN1_INTEGER_set; + {$ifend} + {$if declared(ASN1_INTEGER_set_introduced)} + if LibVersion < ASN1_INTEGER_set_introduced then + begin + {$if declared(FC_ASN1_INTEGER_set)} + ASN1_INTEGER_set := @FC_ASN1_INTEGER_set; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_INTEGER_set_removed)} + if ASN1_INTEGER_set_removed <= LibVersion then + begin + {$if declared(_ASN1_INTEGER_set)} + ASN1_INTEGER_set := @_ASN1_INTEGER_set; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_INTEGER_set_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_INTEGER_set'); + {$ifend} + end; + + + ASN1_INTEGER_get := LoadLibFunction(ADllHandle, ASN1_INTEGER_get_procname); + FuncLoadError := not assigned(ASN1_INTEGER_get); + if FuncLoadError then + begin + {$if not defined(ASN1_INTEGER_get_allownil)} + ASN1_INTEGER_get := @ERR_ASN1_INTEGER_get; + {$ifend} + {$if declared(ASN1_INTEGER_get_introduced)} + if LibVersion < ASN1_INTEGER_get_introduced then + begin + {$if declared(FC_ASN1_INTEGER_get)} + ASN1_INTEGER_get := @FC_ASN1_INTEGER_get; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_INTEGER_get_removed)} + if ASN1_INTEGER_get_removed <= LibVersion then + begin + {$if declared(_ASN1_INTEGER_get)} + ASN1_INTEGER_get := @_ASN1_INTEGER_get; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_INTEGER_get_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_INTEGER_get'); + {$ifend} + end; + + + BN_to_ASN1_INTEGER := LoadLibFunction(ADllHandle, BN_to_ASN1_INTEGER_procname); + FuncLoadError := not assigned(BN_to_ASN1_INTEGER); + if FuncLoadError then + begin + {$if not defined(BN_to_ASN1_INTEGER_allownil)} + BN_to_ASN1_INTEGER := @ERR_BN_to_ASN1_INTEGER; + {$ifend} + {$if declared(BN_to_ASN1_INTEGER_introduced)} + if LibVersion < BN_to_ASN1_INTEGER_introduced then + begin + {$if declared(FC_BN_to_ASN1_INTEGER)} + BN_to_ASN1_INTEGER := @FC_BN_to_ASN1_INTEGER; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_to_ASN1_INTEGER_removed)} + if BN_to_ASN1_INTEGER_removed <= LibVersion then + begin + {$if declared(_BN_to_ASN1_INTEGER)} + BN_to_ASN1_INTEGER := @_BN_to_ASN1_INTEGER; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_to_ASN1_INTEGER_allownil)} + if FuncLoadError then + AFailed.Add('BN_to_ASN1_INTEGER'); + {$ifend} + end; + + + ASN1_INTEGER_to_BN := LoadLibFunction(ADllHandle, ASN1_INTEGER_to_BN_procname); + FuncLoadError := not assigned(ASN1_INTEGER_to_BN); + if FuncLoadError then + begin + {$if not defined(ASN1_INTEGER_to_BN_allownil)} + ASN1_INTEGER_to_BN := @ERR_ASN1_INTEGER_to_BN; + {$ifend} + {$if declared(ASN1_INTEGER_to_BN_introduced)} + if LibVersion < ASN1_INTEGER_to_BN_introduced then + begin + {$if declared(FC_ASN1_INTEGER_to_BN)} + ASN1_INTEGER_to_BN := @FC_ASN1_INTEGER_to_BN; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_INTEGER_to_BN_removed)} + if ASN1_INTEGER_to_BN_removed <= LibVersion then + begin + {$if declared(_ASN1_INTEGER_to_BN)} + ASN1_INTEGER_to_BN := @_ASN1_INTEGER_to_BN; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_INTEGER_to_BN_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_INTEGER_to_BN'); + {$ifend} + end; + + + ASN1_ENUMERATED_get_int64 := LoadLibFunction(ADllHandle, ASN1_ENUMERATED_get_int64_procname); + FuncLoadError := not assigned(ASN1_ENUMERATED_get_int64); + if FuncLoadError then + begin + {$if not defined(ASN1_ENUMERATED_get_int64_allownil)} + ASN1_ENUMERATED_get_int64 := @ERR_ASN1_ENUMERATED_get_int64; + {$ifend} + {$if declared(ASN1_ENUMERATED_get_int64_introduced)} + if LibVersion < ASN1_ENUMERATED_get_int64_introduced then + begin + {$if declared(FC_ASN1_ENUMERATED_get_int64)} + ASN1_ENUMERATED_get_int64 := @FC_ASN1_ENUMERATED_get_int64; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_ENUMERATED_get_int64_removed)} + if ASN1_ENUMERATED_get_int64_removed <= LibVersion then + begin + {$if declared(_ASN1_ENUMERATED_get_int64)} + ASN1_ENUMERATED_get_int64 := @_ASN1_ENUMERATED_get_int64; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_ENUMERATED_get_int64_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_ENUMERATED_get_int64'); + {$ifend} + end; + + {introduced 1.1.0} + ASN1_ENUMERATED_set_int64 := LoadLibFunction(ADllHandle, ASN1_ENUMERATED_set_int64_procname); + FuncLoadError := not assigned(ASN1_ENUMERATED_set_int64); + if FuncLoadError then + begin + {$if not defined(ASN1_ENUMERATED_set_int64_allownil)} + ASN1_ENUMERATED_set_int64 := @ERR_ASN1_ENUMERATED_set_int64; + {$ifend} + {$if declared(ASN1_ENUMERATED_set_int64_introduced)} + if LibVersion < ASN1_ENUMERATED_set_int64_introduced then + begin + {$if declared(FC_ASN1_ENUMERATED_set_int64)} + ASN1_ENUMERATED_set_int64 := @FC_ASN1_ENUMERATED_set_int64; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_ENUMERATED_set_int64_removed)} + if ASN1_ENUMERATED_set_int64_removed <= LibVersion then + begin + {$if declared(_ASN1_ENUMERATED_set_int64)} + ASN1_ENUMERATED_set_int64 := @_ASN1_ENUMERATED_set_int64; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_ENUMERATED_set_int64_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_ENUMERATED_set_int64'); + {$ifend} + end; + + {introduced 1.1.0} + ASN1_ENUMERATED_set := LoadLibFunction(ADllHandle, ASN1_ENUMERATED_set_procname); + FuncLoadError := not assigned(ASN1_ENUMERATED_set); + if FuncLoadError then + begin + {$if not defined(ASN1_ENUMERATED_set_allownil)} + ASN1_ENUMERATED_set := @ERR_ASN1_ENUMERATED_set; + {$ifend} + {$if declared(ASN1_ENUMERATED_set_introduced)} + if LibVersion < ASN1_ENUMERATED_set_introduced then + begin + {$if declared(FC_ASN1_ENUMERATED_set)} + ASN1_ENUMERATED_set := @FC_ASN1_ENUMERATED_set; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_ENUMERATED_set_removed)} + if ASN1_ENUMERATED_set_removed <= LibVersion then + begin + {$if declared(_ASN1_ENUMERATED_set)} + ASN1_ENUMERATED_set := @_ASN1_ENUMERATED_set; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_ENUMERATED_set_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_ENUMERATED_set'); + {$ifend} + end; + + + ASN1_ENUMERATED_get := LoadLibFunction(ADllHandle, ASN1_ENUMERATED_get_procname); + FuncLoadError := not assigned(ASN1_ENUMERATED_get); + if FuncLoadError then + begin + {$if not defined(ASN1_ENUMERATED_get_allownil)} + ASN1_ENUMERATED_get := @ERR_ASN1_ENUMERATED_get; + {$ifend} + {$if declared(ASN1_ENUMERATED_get_introduced)} + if LibVersion < ASN1_ENUMERATED_get_introduced then + begin + {$if declared(FC_ASN1_ENUMERATED_get)} + ASN1_ENUMERATED_get := @FC_ASN1_ENUMERATED_get; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_ENUMERATED_get_removed)} + if ASN1_ENUMERATED_get_removed <= LibVersion then + begin + {$if declared(_ASN1_ENUMERATED_get)} + ASN1_ENUMERATED_get := @_ASN1_ENUMERATED_get; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_ENUMERATED_get_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_ENUMERATED_get'); + {$ifend} + end; + + + BN_to_ASN1_ENUMERATED := LoadLibFunction(ADllHandle, BN_to_ASN1_ENUMERATED_procname); + FuncLoadError := not assigned(BN_to_ASN1_ENUMERATED); + if FuncLoadError then + begin + {$if not defined(BN_to_ASN1_ENUMERATED_allownil)} + BN_to_ASN1_ENUMERATED := @ERR_BN_to_ASN1_ENUMERATED; + {$ifend} + {$if declared(BN_to_ASN1_ENUMERATED_introduced)} + if LibVersion < BN_to_ASN1_ENUMERATED_introduced then + begin + {$if declared(FC_BN_to_ASN1_ENUMERATED)} + BN_to_ASN1_ENUMERATED := @FC_BN_to_ASN1_ENUMERATED; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_to_ASN1_ENUMERATED_removed)} + if BN_to_ASN1_ENUMERATED_removed <= LibVersion then + begin + {$if declared(_BN_to_ASN1_ENUMERATED)} + BN_to_ASN1_ENUMERATED := @_BN_to_ASN1_ENUMERATED; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_to_ASN1_ENUMERATED_allownil)} + if FuncLoadError then + AFailed.Add('BN_to_ASN1_ENUMERATED'); + {$ifend} + end; + + + ASN1_ENUMERATED_to_BN := LoadLibFunction(ADllHandle, ASN1_ENUMERATED_to_BN_procname); + FuncLoadError := not assigned(ASN1_ENUMERATED_to_BN); + if FuncLoadError then + begin + {$if not defined(ASN1_ENUMERATED_to_BN_allownil)} + ASN1_ENUMERATED_to_BN := @ERR_ASN1_ENUMERATED_to_BN; + {$ifend} + {$if declared(ASN1_ENUMERATED_to_BN_introduced)} + if LibVersion < ASN1_ENUMERATED_to_BN_introduced then + begin + {$if declared(FC_ASN1_ENUMERATED_to_BN)} + ASN1_ENUMERATED_to_BN := @FC_ASN1_ENUMERATED_to_BN; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_ENUMERATED_to_BN_removed)} + if ASN1_ENUMERATED_to_BN_removed <= LibVersion then + begin + {$if declared(_ASN1_ENUMERATED_to_BN)} + ASN1_ENUMERATED_to_BN := @_ASN1_ENUMERATED_to_BN; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_ENUMERATED_to_BN_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_ENUMERATED_to_BN'); + {$ifend} + end; + + + ASN1_PRINTABLE_type := LoadLibFunction(ADllHandle, ASN1_PRINTABLE_type_procname); + FuncLoadError := not assigned(ASN1_PRINTABLE_type); + if FuncLoadError then + begin + {$if not defined(ASN1_PRINTABLE_type_allownil)} + ASN1_PRINTABLE_type := @ERR_ASN1_PRINTABLE_type; + {$ifend} + {$if declared(ASN1_PRINTABLE_type_introduced)} + if LibVersion < ASN1_PRINTABLE_type_introduced then + begin + {$if declared(FC_ASN1_PRINTABLE_type)} + ASN1_PRINTABLE_type := @FC_ASN1_PRINTABLE_type; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_PRINTABLE_type_removed)} + if ASN1_PRINTABLE_type_removed <= LibVersion then + begin + {$if declared(_ASN1_PRINTABLE_type)} + ASN1_PRINTABLE_type := @_ASN1_PRINTABLE_type; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_PRINTABLE_type_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_PRINTABLE_type'); + {$ifend} + end; + + + ASN1_tag2bit := LoadLibFunction(ADllHandle, ASN1_tag2bit_procname); + FuncLoadError := not assigned(ASN1_tag2bit); + if FuncLoadError then + begin + {$if not defined(ASN1_tag2bit_allownil)} + ASN1_tag2bit := @ERR_ASN1_tag2bit; + {$ifend} + {$if declared(ASN1_tag2bit_introduced)} + if LibVersion < ASN1_tag2bit_introduced then + begin + {$if declared(FC_ASN1_tag2bit)} + ASN1_tag2bit := @FC_ASN1_tag2bit; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_tag2bit_removed)} + if ASN1_tag2bit_removed <= LibVersion then + begin + {$if declared(_ASN1_tag2bit)} + ASN1_tag2bit := @_ASN1_tag2bit; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_tag2bit_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_tag2bit'); + {$ifend} + end; + + + ASN1_get_object := LoadLibFunction(ADllHandle, ASN1_get_object_procname); + FuncLoadError := not assigned(ASN1_get_object); + if FuncLoadError then + begin + {$if not defined(ASN1_get_object_allownil)} + ASN1_get_object := @ERR_ASN1_get_object; + {$ifend} + {$if declared(ASN1_get_object_introduced)} + if LibVersion < ASN1_get_object_introduced then + begin + {$if declared(FC_ASN1_get_object)} + ASN1_get_object := @FC_ASN1_get_object; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_get_object_removed)} + if ASN1_get_object_removed <= LibVersion then + begin + {$if declared(_ASN1_get_object)} + ASN1_get_object := @_ASN1_get_object; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_get_object_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_get_object'); + {$ifend} + end; + + + ASN1_check_infinite_end := LoadLibFunction(ADllHandle, ASN1_check_infinite_end_procname); + FuncLoadError := not assigned(ASN1_check_infinite_end); + if FuncLoadError then + begin + {$if not defined(ASN1_check_infinite_end_allownil)} + ASN1_check_infinite_end := @ERR_ASN1_check_infinite_end; + {$ifend} + {$if declared(ASN1_check_infinite_end_introduced)} + if LibVersion < ASN1_check_infinite_end_introduced then + begin + {$if declared(FC_ASN1_check_infinite_end)} + ASN1_check_infinite_end := @FC_ASN1_check_infinite_end; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_check_infinite_end_removed)} + if ASN1_check_infinite_end_removed <= LibVersion then + begin + {$if declared(_ASN1_check_infinite_end)} + ASN1_check_infinite_end := @_ASN1_check_infinite_end; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_check_infinite_end_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_check_infinite_end'); + {$ifend} + end; + + + ASN1_const_check_infinite_end := LoadLibFunction(ADllHandle, ASN1_const_check_infinite_end_procname); + FuncLoadError := not assigned(ASN1_const_check_infinite_end); + if FuncLoadError then + begin + {$if not defined(ASN1_const_check_infinite_end_allownil)} + ASN1_const_check_infinite_end := @ERR_ASN1_const_check_infinite_end; + {$ifend} + {$if declared(ASN1_const_check_infinite_end_introduced)} + if LibVersion < ASN1_const_check_infinite_end_introduced then + begin + {$if declared(FC_ASN1_const_check_infinite_end)} + ASN1_const_check_infinite_end := @FC_ASN1_const_check_infinite_end; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_const_check_infinite_end_removed)} + if ASN1_const_check_infinite_end_removed <= LibVersion then + begin + {$if declared(_ASN1_const_check_infinite_end)} + ASN1_const_check_infinite_end := @_ASN1_const_check_infinite_end; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_const_check_infinite_end_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_const_check_infinite_end'); + {$ifend} + end; + + + ASN1_put_object := LoadLibFunction(ADllHandle, ASN1_put_object_procname); + FuncLoadError := not assigned(ASN1_put_object); + if FuncLoadError then + begin + {$if not defined(ASN1_put_object_allownil)} + ASN1_put_object := @ERR_ASN1_put_object; + {$ifend} + {$if declared(ASN1_put_object_introduced)} + if LibVersion < ASN1_put_object_introduced then + begin + {$if declared(FC_ASN1_put_object)} + ASN1_put_object := @FC_ASN1_put_object; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_put_object_removed)} + if ASN1_put_object_removed <= LibVersion then + begin + {$if declared(_ASN1_put_object)} + ASN1_put_object := @_ASN1_put_object; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_put_object_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_put_object'); + {$ifend} + end; + + + ASN1_put_eoc := LoadLibFunction(ADllHandle, ASN1_put_eoc_procname); + FuncLoadError := not assigned(ASN1_put_eoc); + if FuncLoadError then + begin + {$if not defined(ASN1_put_eoc_allownil)} + ASN1_put_eoc := @ERR_ASN1_put_eoc; + {$ifend} + {$if declared(ASN1_put_eoc_introduced)} + if LibVersion < ASN1_put_eoc_introduced then + begin + {$if declared(FC_ASN1_put_eoc)} + ASN1_put_eoc := @FC_ASN1_put_eoc; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_put_eoc_removed)} + if ASN1_put_eoc_removed <= LibVersion then + begin + {$if declared(_ASN1_put_eoc)} + ASN1_put_eoc := @_ASN1_put_eoc; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_put_eoc_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_put_eoc'); + {$ifend} + end; + + + ASN1_object_size := LoadLibFunction(ADllHandle, ASN1_object_size_procname); + FuncLoadError := not assigned(ASN1_object_size); + if FuncLoadError then + begin + {$if not defined(ASN1_object_size_allownil)} + ASN1_object_size := @ERR_ASN1_object_size; + {$ifend} + {$if declared(ASN1_object_size_introduced)} + if LibVersion < ASN1_object_size_introduced then + begin + {$if declared(FC_ASN1_object_size)} + ASN1_object_size := @FC_ASN1_object_size; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_object_size_removed)} + if ASN1_object_size_removed <= LibVersion then + begin + {$if declared(_ASN1_object_size)} + ASN1_object_size := @_ASN1_object_size; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_object_size_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_object_size'); + {$ifend} + end; + + + ASN1_item_dup := LoadLibFunction(ADllHandle, ASN1_item_dup_procname); + FuncLoadError := not assigned(ASN1_item_dup); + if FuncLoadError then + begin + {$if not defined(ASN1_item_dup_allownil)} + ASN1_item_dup := @ERR_ASN1_item_dup; + {$ifend} + {$if declared(ASN1_item_dup_introduced)} + if LibVersion < ASN1_item_dup_introduced then + begin + {$if declared(FC_ASN1_item_dup)} + ASN1_item_dup := @FC_ASN1_item_dup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_item_dup_removed)} + if ASN1_item_dup_removed <= LibVersion then + begin + {$if declared(_ASN1_item_dup)} + ASN1_item_dup := @_ASN1_item_dup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_item_dup_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_item_dup'); + {$ifend} + end; + + + ASN1_STRING_to_UTF8 := LoadLibFunction(ADllHandle, ASN1_STRING_to_UTF8_procname); + FuncLoadError := not assigned(ASN1_STRING_to_UTF8); + if FuncLoadError then + begin + {$if not defined(ASN1_STRING_to_UTF8_allownil)} + ASN1_STRING_to_UTF8 := @ERR_ASN1_STRING_to_UTF8; + {$ifend} + {$if declared(ASN1_STRING_to_UTF8_introduced)} + if LibVersion < ASN1_STRING_to_UTF8_introduced then + begin + {$if declared(FC_ASN1_STRING_to_UTF8)} + ASN1_STRING_to_UTF8 := @FC_ASN1_STRING_to_UTF8; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_STRING_to_UTF8_removed)} + if ASN1_STRING_to_UTF8_removed <= LibVersion then + begin + {$if declared(_ASN1_STRING_to_UTF8)} + ASN1_STRING_to_UTF8 := @_ASN1_STRING_to_UTF8; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_STRING_to_UTF8_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_STRING_to_UTF8'); + {$ifend} + end; + + ASN1_d2i_bio := LoadLibFunction(ADllHandle, ASN1_d2i_bio_procname); + FuncLoadError := not assigned(ASN1_d2i_bio); + if FuncLoadError then + begin + {$if not defined(ASN1_item_d2i_bio_allownil)} + ASN1_item_d2i_bio := @ERR_ASN1_d2i_bio; + {$ifend} + {$if declared(ASN1_d2i_bio_introduced)} + if LibVersion < ASN1_d2i_bio_introduced then + begin + {$if declared(FC_ASN1_d2i_bio)} + ASN1_item_d2i_bio := @FC_ASN1_d2i_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_item_d2i_bio_removed)} + if ASN1_item_d2i_bio_removed <= LibVersion then + begin + {$if declared(_ASN1_item_d2i_bio)} + ASN1_item_d2i_bio := @_ASN1_item_d2i_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_item_d2i_bio_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_d2i_bio'); + {$ifend} + end; + ASN1_item_d2i_bio := LoadLibFunction(ADllHandle, ASN1_item_d2i_bio_procname); + FuncLoadError := not assigned(ASN1_item_d2i_bio); + if FuncLoadError then + begin + {$if not defined(ASN1_item_d2i_bio_allownil)} + ASN1_item_d2i_bio := @ERR_ASN1_item_d2i_bio; + {$ifend} + {$if declared(ASN1_item_d2i_bio_introduced)} + if LibVersion < ASN1_item_d2i_bio_introduced then + begin + {$if declared(FC_ASN1_item_d2i_bio)} + ASN1_item_d2i_bio := @FC_ASN1_item_d2i_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_item_d2i_bio_removed)} + if ASN1_item_d2i_bio_removed <= LibVersion then + begin + {$if declared(_ASN1_item_d2i_bio)} + ASN1_item_d2i_bio := @_ASN1_item_d2i_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_item_d2i_bio_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_item_d2i_bio'); + {$ifend} + end; + + + ASN1_i2d_bio := LoadLibFunction(ADllHandle, ASN1_i2d_bio_procname); + FuncLoadError := not assigned(ASN1_i2d_bio); + if FuncLoadError then + begin + {$if not defined(ASN1_i2d_bio_allownil)} + ASN1_i2d_bio := @ERR_ASN1_i2d_bio; + {$ifend} + {$if declared(ASN1_i2d_bio_introduced)} + if LibVersion < ASN1_i2d_bio_introduced then + begin + {$if declared(FC_ASN1_i2d_bio)} + ASN1_i2d_bio := @FC_ASN1_i2d_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_i2d_bio_removed)} + if ASN1_i2d_bio_removed <= LibVersion then + begin + {$if declared(_ASN1_i2d_bio)} + ASN1_i2d_bio := @_ASN1_i2d_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_i2d_bio_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_i2d_bio'); + {$ifend} + end; + + + ASN1_item_i2d_bio := LoadLibFunction(ADllHandle, ASN1_item_i2d_bio_procname); + FuncLoadError := not assigned(ASN1_item_i2d_bio); + if FuncLoadError then + begin + {$if not defined(ASN1_item_i2d_bio_allownil)} + ASN1_item_i2d_bio := @ERR_ASN1_item_i2d_bio; + {$ifend} + {$if declared(ASN1_item_i2d_bio_introduced)} + if LibVersion < ASN1_item_i2d_bio_introduced then + begin + {$if declared(FC_ASN1_item_i2d_bio)} + ASN1_item_i2d_bio := @FC_ASN1_item_i2d_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_item_i2d_bio_removed)} + if ASN1_item_i2d_bio_removed <= LibVersion then + begin + {$if declared(_ASN1_item_i2d_bio)} + ASN1_item_i2d_bio := @_ASN1_item_i2d_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_item_i2d_bio_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_item_i2d_bio'); + {$ifend} + end; + + + ASN1_UTCTIME_print := LoadLibFunction(ADllHandle, ASN1_UTCTIME_print_procname); + FuncLoadError := not assigned(ASN1_UTCTIME_print); + if FuncLoadError then + begin + {$if not defined(ASN1_UTCTIME_print_allownil)} + ASN1_UTCTIME_print := @ERR_ASN1_UTCTIME_print; + {$ifend} + {$if declared(ASN1_UTCTIME_print_introduced)} + if LibVersion < ASN1_UTCTIME_print_introduced then + begin + {$if declared(FC_ASN1_UTCTIME_print)} + ASN1_UTCTIME_print := @FC_ASN1_UTCTIME_print; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_UTCTIME_print_removed)} + if ASN1_UTCTIME_print_removed <= LibVersion then + begin + {$if declared(_ASN1_UTCTIME_print)} + ASN1_UTCTIME_print := @_ASN1_UTCTIME_print; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_UTCTIME_print_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_UTCTIME_print'); + {$ifend} + end; + + + ASN1_GENERALIZEDTIME_print := LoadLibFunction(ADllHandle, ASN1_GENERALIZEDTIME_print_procname); + FuncLoadError := not assigned(ASN1_GENERALIZEDTIME_print); + if FuncLoadError then + begin + {$if not defined(ASN1_GENERALIZEDTIME_print_allownil)} + ASN1_GENERALIZEDTIME_print := @ERR_ASN1_GENERALIZEDTIME_print; + {$ifend} + {$if declared(ASN1_GENERALIZEDTIME_print_introduced)} + if LibVersion < ASN1_GENERALIZEDTIME_print_introduced then + begin + {$if declared(FC_ASN1_GENERALIZEDTIME_print)} + ASN1_GENERALIZEDTIME_print := @FC_ASN1_GENERALIZEDTIME_print; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_GENERALIZEDTIME_print_removed)} + if ASN1_GENERALIZEDTIME_print_removed <= LibVersion then + begin + {$if declared(_ASN1_GENERALIZEDTIME_print)} + ASN1_GENERALIZEDTIME_print := @_ASN1_GENERALIZEDTIME_print; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_GENERALIZEDTIME_print_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_GENERALIZEDTIME_print'); + {$ifend} + end; + + + ASN1_TIME_print := LoadLibFunction(ADllHandle, ASN1_TIME_print_procname); + FuncLoadError := not assigned(ASN1_TIME_print); + if FuncLoadError then + begin + {$if not defined(ASN1_TIME_print_allownil)} + ASN1_TIME_print := @ERR_ASN1_TIME_print; + {$ifend} + {$if declared(ASN1_TIME_print_introduced)} + if LibVersion < ASN1_TIME_print_introduced then + begin + {$if declared(FC_ASN1_TIME_print)} + ASN1_TIME_print := @FC_ASN1_TIME_print; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_TIME_print_removed)} + if ASN1_TIME_print_removed <= LibVersion then + begin + {$if declared(_ASN1_TIME_print)} + ASN1_TIME_print := @_ASN1_TIME_print; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_TIME_print_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_TIME_print'); + {$ifend} + end; + + + ASN1_STRING_print := LoadLibFunction(ADllHandle, ASN1_STRING_print_procname); + FuncLoadError := not assigned(ASN1_STRING_print); + if FuncLoadError then + begin + {$if not defined(ASN1_STRING_print_allownil)} + ASN1_STRING_print := @ERR_ASN1_STRING_print; + {$ifend} + {$if declared(ASN1_STRING_print_introduced)} + if LibVersion < ASN1_STRING_print_introduced then + begin + {$if declared(FC_ASN1_STRING_print)} + ASN1_STRING_print := @FC_ASN1_STRING_print; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_STRING_print_removed)} + if ASN1_STRING_print_removed <= LibVersion then + begin + {$if declared(_ASN1_STRING_print)} + ASN1_STRING_print := @_ASN1_STRING_print; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_STRING_print_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_STRING_print'); + {$ifend} + end; + + + ASN1_STRING_print_ex := LoadLibFunction(ADllHandle, ASN1_STRING_print_ex_procname); + FuncLoadError := not assigned(ASN1_STRING_print_ex); + if FuncLoadError then + begin + {$if not defined(ASN1_STRING_print_ex_allownil)} + ASN1_STRING_print_ex := @ERR_ASN1_STRING_print_ex; + {$ifend} + {$if declared(ASN1_STRING_print_ex_introduced)} + if LibVersion < ASN1_STRING_print_ex_introduced then + begin + {$if declared(FC_ASN1_STRING_print_ex)} + ASN1_STRING_print_ex := @FC_ASN1_STRING_print_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_STRING_print_ex_removed)} + if ASN1_STRING_print_ex_removed <= LibVersion then + begin + {$if declared(_ASN1_STRING_print_ex)} + ASN1_STRING_print_ex := @_ASN1_STRING_print_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_STRING_print_ex_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_STRING_print_ex'); + {$ifend} + end; + + + ASN1_buf_print := LoadLibFunction(ADllHandle, ASN1_buf_print_procname); + FuncLoadError := not assigned(ASN1_buf_print); + if FuncLoadError then + begin + {$if not defined(ASN1_buf_print_allownil)} + ASN1_buf_print := @ERR_ASN1_buf_print; + {$ifend} + {$if declared(ASN1_buf_print_introduced)} + if LibVersion < ASN1_buf_print_introduced then + begin + {$if declared(FC_ASN1_buf_print)} + ASN1_buf_print := @FC_ASN1_buf_print; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_buf_print_removed)} + if ASN1_buf_print_removed <= LibVersion then + begin + {$if declared(_ASN1_buf_print)} + ASN1_buf_print := @_ASN1_buf_print; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_buf_print_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_buf_print'); + {$ifend} + end; + + {introduced 1.1.0} + ASN1_bn_print := LoadLibFunction(ADllHandle, ASN1_bn_print_procname); + FuncLoadError := not assigned(ASN1_bn_print); + if FuncLoadError then + begin + {$if not defined(ASN1_bn_print_allownil)} + ASN1_bn_print := @ERR_ASN1_bn_print; + {$ifend} + {$if declared(ASN1_bn_print_introduced)} + if LibVersion < ASN1_bn_print_introduced then + begin + {$if declared(FC_ASN1_bn_print)} + ASN1_bn_print := @FC_ASN1_bn_print; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_bn_print_removed)} + if ASN1_bn_print_removed <= LibVersion then + begin + {$if declared(_ASN1_bn_print)} + ASN1_bn_print := @_ASN1_bn_print; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_bn_print_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_bn_print'); + {$ifend} + end; + + + ASN1_parse := LoadLibFunction(ADllHandle, ASN1_parse_procname); + FuncLoadError := not assigned(ASN1_parse); + if FuncLoadError then + begin + {$if not defined(ASN1_parse_allownil)} + ASN1_parse := @ERR_ASN1_parse; + {$ifend} + {$if declared(ASN1_parse_introduced)} + if LibVersion < ASN1_parse_introduced then + begin + {$if declared(FC_ASN1_parse)} + ASN1_parse := @FC_ASN1_parse; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_parse_removed)} + if ASN1_parse_removed <= LibVersion then + begin + {$if declared(_ASN1_parse)} + ASN1_parse := @_ASN1_parse; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_parse_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_parse'); + {$ifend} + end; + + + ASN1_parse_dump := LoadLibFunction(ADllHandle, ASN1_parse_dump_procname); + FuncLoadError := not assigned(ASN1_parse_dump); + if FuncLoadError then + begin + {$if not defined(ASN1_parse_dump_allownil)} + ASN1_parse_dump := @ERR_ASN1_parse_dump; + {$ifend} + {$if declared(ASN1_parse_dump_introduced)} + if LibVersion < ASN1_parse_dump_introduced then + begin + {$if declared(FC_ASN1_parse_dump)} + ASN1_parse_dump := @FC_ASN1_parse_dump; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_parse_dump_removed)} + if ASN1_parse_dump_removed <= LibVersion then + begin + {$if declared(_ASN1_parse_dump)} + ASN1_parse_dump := @_ASN1_parse_dump; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_parse_dump_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_parse_dump'); + {$ifend} + end; + + + ASN1_tag2str := LoadLibFunction(ADllHandle, ASN1_tag2str_procname); + FuncLoadError := not assigned(ASN1_tag2str); + if FuncLoadError then + begin + {$if not defined(ASN1_tag2str_allownil)} + ASN1_tag2str := @ERR_ASN1_tag2str; + {$ifend} + {$if declared(ASN1_tag2str_introduced)} + if LibVersion < ASN1_tag2str_introduced then + begin + {$if declared(FC_ASN1_tag2str)} + ASN1_tag2str := @FC_ASN1_tag2str; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_tag2str_removed)} + if ASN1_tag2str_removed <= LibVersion then + begin + {$if declared(_ASN1_tag2str)} + ASN1_tag2str := @_ASN1_tag2str; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_tag2str_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_tag2str'); + {$ifend} + end; + + + ASN1_UNIVERSALSTRING_to_string := LoadLibFunction(ADllHandle, ASN1_UNIVERSALSTRING_to_string_procname); + FuncLoadError := not assigned(ASN1_UNIVERSALSTRING_to_string); + if FuncLoadError then + begin + {$if not defined(ASN1_UNIVERSALSTRING_to_string_allownil)} + ASN1_UNIVERSALSTRING_to_string := @ERR_ASN1_UNIVERSALSTRING_to_string; + {$ifend} + {$if declared(ASN1_UNIVERSALSTRING_to_string_introduced)} + if LibVersion < ASN1_UNIVERSALSTRING_to_string_introduced then + begin + {$if declared(FC_ASN1_UNIVERSALSTRING_to_string)} + ASN1_UNIVERSALSTRING_to_string := @FC_ASN1_UNIVERSALSTRING_to_string; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_UNIVERSALSTRING_to_string_removed)} + if ASN1_UNIVERSALSTRING_to_string_removed <= LibVersion then + begin + {$if declared(_ASN1_UNIVERSALSTRING_to_string)} + ASN1_UNIVERSALSTRING_to_string := @_ASN1_UNIVERSALSTRING_to_string; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_UNIVERSALSTRING_to_string_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_UNIVERSALSTRING_to_string'); + {$ifend} + end; + + + ASN1_TYPE_set_octetstring := LoadLibFunction(ADllHandle, ASN1_TYPE_set_octetstring_procname); + FuncLoadError := not assigned(ASN1_TYPE_set_octetstring); + if FuncLoadError then + begin + {$if not defined(ASN1_TYPE_set_octetstring_allownil)} + ASN1_TYPE_set_octetstring := @ERR_ASN1_TYPE_set_octetstring; + {$ifend} + {$if declared(ASN1_TYPE_set_octetstring_introduced)} + if LibVersion < ASN1_TYPE_set_octetstring_introduced then + begin + {$if declared(FC_ASN1_TYPE_set_octetstring)} + ASN1_TYPE_set_octetstring := @FC_ASN1_TYPE_set_octetstring; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_TYPE_set_octetstring_removed)} + if ASN1_TYPE_set_octetstring_removed <= LibVersion then + begin + {$if declared(_ASN1_TYPE_set_octetstring)} + ASN1_TYPE_set_octetstring := @_ASN1_TYPE_set_octetstring; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_TYPE_set_octetstring_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_TYPE_set_octetstring'); + {$ifend} + end; + + + ASN1_TYPE_get_octetstring := LoadLibFunction(ADllHandle, ASN1_TYPE_get_octetstring_procname); + FuncLoadError := not assigned(ASN1_TYPE_get_octetstring); + if FuncLoadError then + begin + {$if not defined(ASN1_TYPE_get_octetstring_allownil)} + ASN1_TYPE_get_octetstring := @ERR_ASN1_TYPE_get_octetstring; + {$ifend} + {$if declared(ASN1_TYPE_get_octetstring_introduced)} + if LibVersion < ASN1_TYPE_get_octetstring_introduced then + begin + {$if declared(FC_ASN1_TYPE_get_octetstring)} + ASN1_TYPE_get_octetstring := @FC_ASN1_TYPE_get_octetstring; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_TYPE_get_octetstring_removed)} + if ASN1_TYPE_get_octetstring_removed <= LibVersion then + begin + {$if declared(_ASN1_TYPE_get_octetstring)} + ASN1_TYPE_get_octetstring := @_ASN1_TYPE_get_octetstring; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_TYPE_get_octetstring_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_TYPE_get_octetstring'); + {$ifend} + end; + + + ASN1_TYPE_set_int_octetstring := LoadLibFunction(ADllHandle, ASN1_TYPE_set_int_octetstring_procname); + FuncLoadError := not assigned(ASN1_TYPE_set_int_octetstring); + if FuncLoadError then + begin + {$if not defined(ASN1_TYPE_set_int_octetstring_allownil)} + ASN1_TYPE_set_int_octetstring := @ERR_ASN1_TYPE_set_int_octetstring; + {$ifend} + {$if declared(ASN1_TYPE_set_int_octetstring_introduced)} + if LibVersion < ASN1_TYPE_set_int_octetstring_introduced then + begin + {$if declared(FC_ASN1_TYPE_set_int_octetstring)} + ASN1_TYPE_set_int_octetstring := @FC_ASN1_TYPE_set_int_octetstring; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_TYPE_set_int_octetstring_removed)} + if ASN1_TYPE_set_int_octetstring_removed <= LibVersion then + begin + {$if declared(_ASN1_TYPE_set_int_octetstring)} + ASN1_TYPE_set_int_octetstring := @_ASN1_TYPE_set_int_octetstring; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_TYPE_set_int_octetstring_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_TYPE_set_int_octetstring'); + {$ifend} + end; + + + ASN1_TYPE_get_int_octetstring := LoadLibFunction(ADllHandle, ASN1_TYPE_get_int_octetstring_procname); + FuncLoadError := not assigned(ASN1_TYPE_get_int_octetstring); + if FuncLoadError then + begin + {$if not defined(ASN1_TYPE_get_int_octetstring_allownil)} + ASN1_TYPE_get_int_octetstring := @ERR_ASN1_TYPE_get_int_octetstring; + {$ifend} + {$if declared(ASN1_TYPE_get_int_octetstring_introduced)} + if LibVersion < ASN1_TYPE_get_int_octetstring_introduced then + begin + {$if declared(FC_ASN1_TYPE_get_int_octetstring)} + ASN1_TYPE_get_int_octetstring := @FC_ASN1_TYPE_get_int_octetstring; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_TYPE_get_int_octetstring_removed)} + if ASN1_TYPE_get_int_octetstring_removed <= LibVersion then + begin + {$if declared(_ASN1_TYPE_get_int_octetstring)} + ASN1_TYPE_get_int_octetstring := @_ASN1_TYPE_get_int_octetstring; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_TYPE_get_int_octetstring_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_TYPE_get_int_octetstring'); + {$ifend} + end; + + + ASN1_item_unpack := LoadLibFunction(ADllHandle, ASN1_item_unpack_procname); + FuncLoadError := not assigned(ASN1_item_unpack); + if FuncLoadError then + begin + {$if not defined(ASN1_item_unpack_allownil)} + ASN1_item_unpack := @ERR_ASN1_item_unpack; + {$ifend} + {$if declared(ASN1_item_unpack_introduced)} + if LibVersion < ASN1_item_unpack_introduced then + begin + {$if declared(FC_ASN1_item_unpack)} + ASN1_item_unpack := @FC_ASN1_item_unpack; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_item_unpack_removed)} + if ASN1_item_unpack_removed <= LibVersion then + begin + {$if declared(_ASN1_item_unpack)} + ASN1_item_unpack := @_ASN1_item_unpack; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_item_unpack_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_item_unpack'); + {$ifend} + end; + + + ASN1_item_pack := LoadLibFunction(ADllHandle, ASN1_item_pack_procname); + FuncLoadError := not assigned(ASN1_item_pack); + if FuncLoadError then + begin + {$if not defined(ASN1_item_pack_allownil)} + ASN1_item_pack := @ERR_ASN1_item_pack; + {$ifend} + {$if declared(ASN1_item_pack_introduced)} + if LibVersion < ASN1_item_pack_introduced then + begin + {$if declared(FC_ASN1_item_pack)} + ASN1_item_pack := @FC_ASN1_item_pack; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_item_pack_removed)} + if ASN1_item_pack_removed <= LibVersion then + begin + {$if declared(_ASN1_item_pack)} + ASN1_item_pack := @_ASN1_item_pack; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_item_pack_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_item_pack'); + {$ifend} + end; + + + ASN1_STRING_set_default_mask := LoadLibFunction(ADllHandle, ASN1_STRING_set_default_mask_procname); + FuncLoadError := not assigned(ASN1_STRING_set_default_mask); + if FuncLoadError then + begin + {$if not defined(ASN1_STRING_set_default_mask_allownil)} + ASN1_STRING_set_default_mask := @ERR_ASN1_STRING_set_default_mask; + {$ifend} + {$if declared(ASN1_STRING_set_default_mask_introduced)} + if LibVersion < ASN1_STRING_set_default_mask_introduced then + begin + {$if declared(FC_ASN1_STRING_set_default_mask)} + ASN1_STRING_set_default_mask := @FC_ASN1_STRING_set_default_mask; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_STRING_set_default_mask_removed)} + if ASN1_STRING_set_default_mask_removed <= LibVersion then + begin + {$if declared(_ASN1_STRING_set_default_mask)} + ASN1_STRING_set_default_mask := @_ASN1_STRING_set_default_mask; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_STRING_set_default_mask_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_STRING_set_default_mask'); + {$ifend} + end; + + + ASN1_STRING_set_default_mask_asc := LoadLibFunction(ADllHandle, ASN1_STRING_set_default_mask_asc_procname); + FuncLoadError := not assigned(ASN1_STRING_set_default_mask_asc); + if FuncLoadError then + begin + {$if not defined(ASN1_STRING_set_default_mask_asc_allownil)} + ASN1_STRING_set_default_mask_asc := @ERR_ASN1_STRING_set_default_mask_asc; + {$ifend} + {$if declared(ASN1_STRING_set_default_mask_asc_introduced)} + if LibVersion < ASN1_STRING_set_default_mask_asc_introduced then + begin + {$if declared(FC_ASN1_STRING_set_default_mask_asc)} + ASN1_STRING_set_default_mask_asc := @FC_ASN1_STRING_set_default_mask_asc; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_STRING_set_default_mask_asc_removed)} + if ASN1_STRING_set_default_mask_asc_removed <= LibVersion then + begin + {$if declared(_ASN1_STRING_set_default_mask_asc)} + ASN1_STRING_set_default_mask_asc := @_ASN1_STRING_set_default_mask_asc; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_STRING_set_default_mask_asc_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_STRING_set_default_mask_asc'); + {$ifend} + end; + + + ASN1_STRING_get_default_mask := LoadLibFunction(ADllHandle, ASN1_STRING_get_default_mask_procname); + FuncLoadError := not assigned(ASN1_STRING_get_default_mask); + if FuncLoadError then + begin + {$if not defined(ASN1_STRING_get_default_mask_allownil)} + ASN1_STRING_get_default_mask := @ERR_ASN1_STRING_get_default_mask; + {$ifend} + {$if declared(ASN1_STRING_get_default_mask_introduced)} + if LibVersion < ASN1_STRING_get_default_mask_introduced then + begin + {$if declared(FC_ASN1_STRING_get_default_mask)} + ASN1_STRING_get_default_mask := @FC_ASN1_STRING_get_default_mask; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_STRING_get_default_mask_removed)} + if ASN1_STRING_get_default_mask_removed <= LibVersion then + begin + {$if declared(_ASN1_STRING_get_default_mask)} + ASN1_STRING_get_default_mask := @_ASN1_STRING_get_default_mask; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_STRING_get_default_mask_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_STRING_get_default_mask'); + {$ifend} + end; + + + ASN1_mbstring_copy := LoadLibFunction(ADllHandle, ASN1_mbstring_copy_procname); + FuncLoadError := not assigned(ASN1_mbstring_copy); + if FuncLoadError then + begin + {$if not defined(ASN1_mbstring_copy_allownil)} + ASN1_mbstring_copy := @ERR_ASN1_mbstring_copy; + {$ifend} + {$if declared(ASN1_mbstring_copy_introduced)} + if LibVersion < ASN1_mbstring_copy_introduced then + begin + {$if declared(FC_ASN1_mbstring_copy)} + ASN1_mbstring_copy := @FC_ASN1_mbstring_copy; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_mbstring_copy_removed)} + if ASN1_mbstring_copy_removed <= LibVersion then + begin + {$if declared(_ASN1_mbstring_copy)} + ASN1_mbstring_copy := @_ASN1_mbstring_copy; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_mbstring_copy_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_mbstring_copy'); + {$ifend} + end; + + + ASN1_mbstring_ncopy := LoadLibFunction(ADllHandle, ASN1_mbstring_ncopy_procname); + FuncLoadError := not assigned(ASN1_mbstring_ncopy); + if FuncLoadError then + begin + {$if not defined(ASN1_mbstring_ncopy_allownil)} + ASN1_mbstring_ncopy := @ERR_ASN1_mbstring_ncopy; + {$ifend} + {$if declared(ASN1_mbstring_ncopy_introduced)} + if LibVersion < ASN1_mbstring_ncopy_introduced then + begin + {$if declared(FC_ASN1_mbstring_ncopy)} + ASN1_mbstring_ncopy := @FC_ASN1_mbstring_ncopy; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_mbstring_ncopy_removed)} + if ASN1_mbstring_ncopy_removed <= LibVersion then + begin + {$if declared(_ASN1_mbstring_ncopy)} + ASN1_mbstring_ncopy := @_ASN1_mbstring_ncopy; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_mbstring_ncopy_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_mbstring_ncopy'); + {$ifend} + end; + + + ASN1_STRING_set_by_NID := LoadLibFunction(ADllHandle, ASN1_STRING_set_by_NID_procname); + FuncLoadError := not assigned(ASN1_STRING_set_by_NID); + if FuncLoadError then + begin + {$if not defined(ASN1_STRING_set_by_NID_allownil)} + ASN1_STRING_set_by_NID := @ERR_ASN1_STRING_set_by_NID; + {$ifend} + {$if declared(ASN1_STRING_set_by_NID_introduced)} + if LibVersion < ASN1_STRING_set_by_NID_introduced then + begin + {$if declared(FC_ASN1_STRING_set_by_NID)} + ASN1_STRING_set_by_NID := @FC_ASN1_STRING_set_by_NID; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_STRING_set_by_NID_removed)} + if ASN1_STRING_set_by_NID_removed <= LibVersion then + begin + {$if declared(_ASN1_STRING_set_by_NID)} + ASN1_STRING_set_by_NID := @_ASN1_STRING_set_by_NID; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_STRING_set_by_NID_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_STRING_set_by_NID'); + {$ifend} + end; + + + ASN1_STRING_TABLE_get := LoadLibFunction(ADllHandle, ASN1_STRING_TABLE_get_procname); + FuncLoadError := not assigned(ASN1_STRING_TABLE_get); + if FuncLoadError then + begin + {$if not defined(ASN1_STRING_TABLE_get_allownil)} + ASN1_STRING_TABLE_get := @ERR_ASN1_STRING_TABLE_get; + {$ifend} + {$if declared(ASN1_STRING_TABLE_get_introduced)} + if LibVersion < ASN1_STRING_TABLE_get_introduced then + begin + {$if declared(FC_ASN1_STRING_TABLE_get)} + ASN1_STRING_TABLE_get := @FC_ASN1_STRING_TABLE_get; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_STRING_TABLE_get_removed)} + if ASN1_STRING_TABLE_get_removed <= LibVersion then + begin + {$if declared(_ASN1_STRING_TABLE_get)} + ASN1_STRING_TABLE_get := @_ASN1_STRING_TABLE_get; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_STRING_TABLE_get_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_STRING_TABLE_get'); + {$ifend} + end; + + + ASN1_STRING_TABLE_add := LoadLibFunction(ADllHandle, ASN1_STRING_TABLE_add_procname); + FuncLoadError := not assigned(ASN1_STRING_TABLE_add); + if FuncLoadError then + begin + {$if not defined(ASN1_STRING_TABLE_add_allownil)} + ASN1_STRING_TABLE_add := @ERR_ASN1_STRING_TABLE_add; + {$ifend} + {$if declared(ASN1_STRING_TABLE_add_introduced)} + if LibVersion < ASN1_STRING_TABLE_add_introduced then + begin + {$if declared(FC_ASN1_STRING_TABLE_add)} + ASN1_STRING_TABLE_add := @FC_ASN1_STRING_TABLE_add; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_STRING_TABLE_add_removed)} + if ASN1_STRING_TABLE_add_removed <= LibVersion then + begin + {$if declared(_ASN1_STRING_TABLE_add)} + ASN1_STRING_TABLE_add := @_ASN1_STRING_TABLE_add; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_STRING_TABLE_add_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_STRING_TABLE_add'); + {$ifend} + end; + + + ASN1_STRING_TABLE_cleanup := LoadLibFunction(ADllHandle, ASN1_STRING_TABLE_cleanup_procname); + FuncLoadError := not assigned(ASN1_STRING_TABLE_cleanup); + if FuncLoadError then + begin + {$if not defined(ASN1_STRING_TABLE_cleanup_allownil)} + ASN1_STRING_TABLE_cleanup := @ERR_ASN1_STRING_TABLE_cleanup; + {$ifend} + {$if declared(ASN1_STRING_TABLE_cleanup_introduced)} + if LibVersion < ASN1_STRING_TABLE_cleanup_introduced then + begin + {$if declared(FC_ASN1_STRING_TABLE_cleanup)} + ASN1_STRING_TABLE_cleanup := @FC_ASN1_STRING_TABLE_cleanup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_STRING_TABLE_cleanup_removed)} + if ASN1_STRING_TABLE_cleanup_removed <= LibVersion then + begin + {$if declared(_ASN1_STRING_TABLE_cleanup)} + ASN1_STRING_TABLE_cleanup := @_ASN1_STRING_TABLE_cleanup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_STRING_TABLE_cleanup_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_STRING_TABLE_cleanup'); + {$ifend} + end; + + + ASN1_item_new := LoadLibFunction(ADllHandle, ASN1_item_new_procname); + FuncLoadError := not assigned(ASN1_item_new); + if FuncLoadError then + begin + {$if not defined(ASN1_item_new_allownil)} + ASN1_item_new := @ERR_ASN1_item_new; + {$ifend} + {$if declared(ASN1_item_new_introduced)} + if LibVersion < ASN1_item_new_introduced then + begin + {$if declared(FC_ASN1_item_new)} + ASN1_item_new := @FC_ASN1_item_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_item_new_removed)} + if ASN1_item_new_removed <= LibVersion then + begin + {$if declared(_ASN1_item_new)} + ASN1_item_new := @_ASN1_item_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_item_new_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_item_new'); + {$ifend} + end; + + + ASN1_item_free := LoadLibFunction(ADllHandle, ASN1_item_free_procname); + FuncLoadError := not assigned(ASN1_item_free); + if FuncLoadError then + begin + {$if not defined(ASN1_item_free_allownil)} + ASN1_item_free := @ERR_ASN1_item_free; + {$ifend} + {$if declared(ASN1_item_free_introduced)} + if LibVersion < ASN1_item_free_introduced then + begin + {$if declared(FC_ASN1_item_free)} + ASN1_item_free := @FC_ASN1_item_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_item_free_removed)} + if ASN1_item_free_removed <= LibVersion then + begin + {$if declared(_ASN1_item_free)} + ASN1_item_free := @_ASN1_item_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_item_free_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_item_free'); + {$ifend} + end; + + + ASN1_item_d2i := LoadLibFunction(ADllHandle, ASN1_item_d2i_procname); + FuncLoadError := not assigned(ASN1_item_d2i); + if FuncLoadError then + begin + {$if not defined(ASN1_item_d2i_allownil)} + ASN1_item_d2i := @ERR_ASN1_item_d2i; + {$ifend} + {$if declared(ASN1_item_d2i_introduced)} + if LibVersion < ASN1_item_d2i_introduced then + begin + {$if declared(FC_ASN1_item_d2i)} + ASN1_item_d2i := @FC_ASN1_item_d2i; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_item_d2i_removed)} + if ASN1_item_d2i_removed <= LibVersion then + begin + {$if declared(_ASN1_item_d2i)} + ASN1_item_d2i := @_ASN1_item_d2i; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_item_d2i_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_item_d2i'); + {$ifend} + end; + + + ASN1_item_i2d := LoadLibFunction(ADllHandle, ASN1_item_i2d_procname); + FuncLoadError := not assigned(ASN1_item_i2d); + if FuncLoadError then + begin + {$if not defined(ASN1_item_i2d_allownil)} + ASN1_item_i2d := @ERR_ASN1_item_i2d; + {$ifend} + {$if declared(ASN1_item_i2d_introduced)} + if LibVersion < ASN1_item_i2d_introduced then + begin + {$if declared(FC_ASN1_item_i2d)} + ASN1_item_i2d := @FC_ASN1_item_i2d; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_item_i2d_removed)} + if ASN1_item_i2d_removed <= LibVersion then + begin + {$if declared(_ASN1_item_i2d)} + ASN1_item_i2d := @_ASN1_item_i2d; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_item_i2d_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_item_i2d'); + {$ifend} + end; + + + ASN1_item_ndef_i2d := LoadLibFunction(ADllHandle, ASN1_item_ndef_i2d_procname); + FuncLoadError := not assigned(ASN1_item_ndef_i2d); + if FuncLoadError then + begin + {$if not defined(ASN1_item_ndef_i2d_allownil)} + ASN1_item_ndef_i2d := @ERR_ASN1_item_ndef_i2d; + {$ifend} + {$if declared(ASN1_item_ndef_i2d_introduced)} + if LibVersion < ASN1_item_ndef_i2d_introduced then + begin + {$if declared(FC_ASN1_item_ndef_i2d)} + ASN1_item_ndef_i2d := @FC_ASN1_item_ndef_i2d; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_item_ndef_i2d_removed)} + if ASN1_item_ndef_i2d_removed <= LibVersion then + begin + {$if declared(_ASN1_item_ndef_i2d)} + ASN1_item_ndef_i2d := @_ASN1_item_ndef_i2d; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_item_ndef_i2d_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_item_ndef_i2d'); + {$ifend} + end; + + + ASN1_add_oid_module := LoadLibFunction(ADllHandle, ASN1_add_oid_module_procname); + FuncLoadError := not assigned(ASN1_add_oid_module); + if FuncLoadError then + begin + {$if not defined(ASN1_add_oid_module_allownil)} + ASN1_add_oid_module := @ERR_ASN1_add_oid_module; + {$ifend} + {$if declared(ASN1_add_oid_module_introduced)} + if LibVersion < ASN1_add_oid_module_introduced then + begin + {$if declared(FC_ASN1_add_oid_module)} + ASN1_add_oid_module := @FC_ASN1_add_oid_module; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_add_oid_module_removed)} + if ASN1_add_oid_module_removed <= LibVersion then + begin + {$if declared(_ASN1_add_oid_module)} + ASN1_add_oid_module := @_ASN1_add_oid_module; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_add_oid_module_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_add_oid_module'); + {$ifend} + end; + + + ASN1_add_stable_module := LoadLibFunction(ADllHandle, ASN1_add_stable_module_procname); + FuncLoadError := not assigned(ASN1_add_stable_module); + if FuncLoadError then + begin + {$if not defined(ASN1_add_stable_module_allownil)} + ASN1_add_stable_module := @ERR_ASN1_add_stable_module; + {$ifend} + {$if declared(ASN1_add_stable_module_introduced)} + if LibVersion < ASN1_add_stable_module_introduced then + begin + {$if declared(FC_ASN1_add_stable_module)} + ASN1_add_stable_module := @FC_ASN1_add_stable_module; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_add_stable_module_removed)} + if ASN1_add_stable_module_removed <= LibVersion then + begin + {$if declared(_ASN1_add_stable_module)} + ASN1_add_stable_module := @_ASN1_add_stable_module; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_add_stable_module_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_add_stable_module'); + {$ifend} + end; + + {introduced 1.1.0} + ASN1_generate_nconf := LoadLibFunction(ADllHandle, ASN1_generate_nconf_procname); + FuncLoadError := not assigned(ASN1_generate_nconf); + if FuncLoadError then + begin + {$if not defined(ASN1_generate_nconf_allownil)} + ASN1_generate_nconf := @ERR_ASN1_generate_nconf; + {$ifend} + {$if declared(ASN1_generate_nconf_introduced)} + if LibVersion < ASN1_generate_nconf_introduced then + begin + {$if declared(FC_ASN1_generate_nconf)} + ASN1_generate_nconf := @FC_ASN1_generate_nconf; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_generate_nconf_removed)} + if ASN1_generate_nconf_removed <= LibVersion then + begin + {$if declared(_ASN1_generate_nconf)} + ASN1_generate_nconf := @_ASN1_generate_nconf; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_generate_nconf_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_generate_nconf'); + {$ifend} + end; + + + ASN1_generate_v3 := LoadLibFunction(ADllHandle, ASN1_generate_v3_procname); + FuncLoadError := not assigned(ASN1_generate_v3); + if FuncLoadError then + begin + {$if not defined(ASN1_generate_v3_allownil)} + ASN1_generate_v3 := @ERR_ASN1_generate_v3; + {$ifend} + {$if declared(ASN1_generate_v3_introduced)} + if LibVersion < ASN1_generate_v3_introduced then + begin + {$if declared(FC_ASN1_generate_v3)} + ASN1_generate_v3 := @FC_ASN1_generate_v3; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_generate_v3_removed)} + if ASN1_generate_v3_removed <= LibVersion then + begin + {$if declared(_ASN1_generate_v3)} + ASN1_generate_v3 := @_ASN1_generate_v3; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_generate_v3_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_generate_v3'); + {$ifend} + end; + + + ASN1_str2mask := LoadLibFunction(ADllHandle, ASN1_str2mask_procname); + FuncLoadError := not assigned(ASN1_str2mask); + if FuncLoadError then + begin + {$if not defined(ASN1_str2mask_allownil)} + ASN1_str2mask := @ERR_ASN1_str2mask; + {$ifend} + {$if declared(ASN1_str2mask_introduced)} + if LibVersion < ASN1_str2mask_introduced then + begin + {$if declared(FC_ASN1_str2mask)} + ASN1_str2mask := @FC_ASN1_str2mask; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_str2mask_removed)} + if ASN1_str2mask_removed <= LibVersion then + begin + {$if declared(_ASN1_str2mask)} + ASN1_str2mask := @_ASN1_str2mask; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_str2mask_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_str2mask'); + {$ifend} + end; + + {introduced 1.1.0} + ASN1_item_print := LoadLibFunction(ADllHandle, ASN1_item_print_procname); + FuncLoadError := not assigned(ASN1_item_print); + if FuncLoadError then + begin + {$if not defined(ASN1_item_print_allownil)} + ASN1_item_print := @ERR_ASN1_item_print; + {$ifend} + {$if declared(ASN1_item_print_introduced)} + if LibVersion < ASN1_item_print_introduced then + begin + {$if declared(FC_ASN1_item_print)} + ASN1_item_print := @FC_ASN1_item_print; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_item_print_removed)} + if ASN1_item_print_removed <= LibVersion then + begin + {$if declared(_ASN1_item_print)} + ASN1_item_print := @_ASN1_item_print; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_item_print_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_item_print'); + {$ifend} + end; + + + ASN1_PCTX_new := LoadLibFunction(ADllHandle, ASN1_PCTX_new_procname); + FuncLoadError := not assigned(ASN1_PCTX_new); + if FuncLoadError then + begin + {$if not defined(ASN1_PCTX_new_allownil)} + ASN1_PCTX_new := @ERR_ASN1_PCTX_new; + {$ifend} + {$if declared(ASN1_PCTX_new_introduced)} + if LibVersion < ASN1_PCTX_new_introduced then + begin + {$if declared(FC_ASN1_PCTX_new)} + ASN1_PCTX_new := @FC_ASN1_PCTX_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_PCTX_new_removed)} + if ASN1_PCTX_new_removed <= LibVersion then + begin + {$if declared(_ASN1_PCTX_new)} + ASN1_PCTX_new := @_ASN1_PCTX_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_PCTX_new_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_PCTX_new'); + {$ifend} + end; + + + ASN1_PCTX_free := LoadLibFunction(ADllHandle, ASN1_PCTX_free_procname); + FuncLoadError := not assigned(ASN1_PCTX_free); + if FuncLoadError then + begin + {$if not defined(ASN1_PCTX_free_allownil)} + ASN1_PCTX_free := @ERR_ASN1_PCTX_free; + {$ifend} + {$if declared(ASN1_PCTX_free_introduced)} + if LibVersion < ASN1_PCTX_free_introduced then + begin + {$if declared(FC_ASN1_PCTX_free)} + ASN1_PCTX_free := @FC_ASN1_PCTX_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_PCTX_free_removed)} + if ASN1_PCTX_free_removed <= LibVersion then + begin + {$if declared(_ASN1_PCTX_free)} + ASN1_PCTX_free := @_ASN1_PCTX_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_PCTX_free_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_PCTX_free'); + {$ifend} + end; + + + ASN1_PCTX_get_flags := LoadLibFunction(ADllHandle, ASN1_PCTX_get_flags_procname); + FuncLoadError := not assigned(ASN1_PCTX_get_flags); + if FuncLoadError then + begin + {$if not defined(ASN1_PCTX_get_flags_allownil)} + ASN1_PCTX_get_flags := @ERR_ASN1_PCTX_get_flags; + {$ifend} + {$if declared(ASN1_PCTX_get_flags_introduced)} + if LibVersion < ASN1_PCTX_get_flags_introduced then + begin + {$if declared(FC_ASN1_PCTX_get_flags)} + ASN1_PCTX_get_flags := @FC_ASN1_PCTX_get_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_PCTX_get_flags_removed)} + if ASN1_PCTX_get_flags_removed <= LibVersion then + begin + {$if declared(_ASN1_PCTX_get_flags)} + ASN1_PCTX_get_flags := @_ASN1_PCTX_get_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_PCTX_get_flags_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_PCTX_get_flags'); + {$ifend} + end; + + + ASN1_PCTX_set_flags := LoadLibFunction(ADllHandle, ASN1_PCTX_set_flags_procname); + FuncLoadError := not assigned(ASN1_PCTX_set_flags); + if FuncLoadError then + begin + {$if not defined(ASN1_PCTX_set_flags_allownil)} + ASN1_PCTX_set_flags := @ERR_ASN1_PCTX_set_flags; + {$ifend} + {$if declared(ASN1_PCTX_set_flags_introduced)} + if LibVersion < ASN1_PCTX_set_flags_introduced then + begin + {$if declared(FC_ASN1_PCTX_set_flags)} + ASN1_PCTX_set_flags := @FC_ASN1_PCTX_set_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_PCTX_set_flags_removed)} + if ASN1_PCTX_set_flags_removed <= LibVersion then + begin + {$if declared(_ASN1_PCTX_set_flags)} + ASN1_PCTX_set_flags := @_ASN1_PCTX_set_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_PCTX_set_flags_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_PCTX_set_flags'); + {$ifend} + end; + + + ASN1_PCTX_get_nm_flags := LoadLibFunction(ADllHandle, ASN1_PCTX_get_nm_flags_procname); + FuncLoadError := not assigned(ASN1_PCTX_get_nm_flags); + if FuncLoadError then + begin + {$if not defined(ASN1_PCTX_get_nm_flags_allownil)} + ASN1_PCTX_get_nm_flags := @ERR_ASN1_PCTX_get_nm_flags; + {$ifend} + {$if declared(ASN1_PCTX_get_nm_flags_introduced)} + if LibVersion < ASN1_PCTX_get_nm_flags_introduced then + begin + {$if declared(FC_ASN1_PCTX_get_nm_flags)} + ASN1_PCTX_get_nm_flags := @FC_ASN1_PCTX_get_nm_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_PCTX_get_nm_flags_removed)} + if ASN1_PCTX_get_nm_flags_removed <= LibVersion then + begin + {$if declared(_ASN1_PCTX_get_nm_flags)} + ASN1_PCTX_get_nm_flags := @_ASN1_PCTX_get_nm_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_PCTX_get_nm_flags_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_PCTX_get_nm_flags'); + {$ifend} + end; + + + ASN1_PCTX_set_nm_flags := LoadLibFunction(ADllHandle, ASN1_PCTX_set_nm_flags_procname); + FuncLoadError := not assigned(ASN1_PCTX_set_nm_flags); + if FuncLoadError then + begin + {$if not defined(ASN1_PCTX_set_nm_flags_allownil)} + ASN1_PCTX_set_nm_flags := @ERR_ASN1_PCTX_set_nm_flags; + {$ifend} + {$if declared(ASN1_PCTX_set_nm_flags_introduced)} + if LibVersion < ASN1_PCTX_set_nm_flags_introduced then + begin + {$if declared(FC_ASN1_PCTX_set_nm_flags)} + ASN1_PCTX_set_nm_flags := @FC_ASN1_PCTX_set_nm_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_PCTX_set_nm_flags_removed)} + if ASN1_PCTX_set_nm_flags_removed <= LibVersion then + begin + {$if declared(_ASN1_PCTX_set_nm_flags)} + ASN1_PCTX_set_nm_flags := @_ASN1_PCTX_set_nm_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_PCTX_set_nm_flags_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_PCTX_set_nm_flags'); + {$ifend} + end; + + + ASN1_PCTX_get_cert_flags := LoadLibFunction(ADllHandle, ASN1_PCTX_get_cert_flags_procname); + FuncLoadError := not assigned(ASN1_PCTX_get_cert_flags); + if FuncLoadError then + begin + {$if not defined(ASN1_PCTX_get_cert_flags_allownil)} + ASN1_PCTX_get_cert_flags := @ERR_ASN1_PCTX_get_cert_flags; + {$ifend} + {$if declared(ASN1_PCTX_get_cert_flags_introduced)} + if LibVersion < ASN1_PCTX_get_cert_flags_introduced then + begin + {$if declared(FC_ASN1_PCTX_get_cert_flags)} + ASN1_PCTX_get_cert_flags := @FC_ASN1_PCTX_get_cert_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_PCTX_get_cert_flags_removed)} + if ASN1_PCTX_get_cert_flags_removed <= LibVersion then + begin + {$if declared(_ASN1_PCTX_get_cert_flags)} + ASN1_PCTX_get_cert_flags := @_ASN1_PCTX_get_cert_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_PCTX_get_cert_flags_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_PCTX_get_cert_flags'); + {$ifend} + end; + + + ASN1_PCTX_set_cert_flags := LoadLibFunction(ADllHandle, ASN1_PCTX_set_cert_flags_procname); + FuncLoadError := not assigned(ASN1_PCTX_set_cert_flags); + if FuncLoadError then + begin + {$if not defined(ASN1_PCTX_set_cert_flags_allownil)} + ASN1_PCTX_set_cert_flags := @ERR_ASN1_PCTX_set_cert_flags; + {$ifend} + {$if declared(ASN1_PCTX_set_cert_flags_introduced)} + if LibVersion < ASN1_PCTX_set_cert_flags_introduced then + begin + {$if declared(FC_ASN1_PCTX_set_cert_flags)} + ASN1_PCTX_set_cert_flags := @FC_ASN1_PCTX_set_cert_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_PCTX_set_cert_flags_removed)} + if ASN1_PCTX_set_cert_flags_removed <= LibVersion then + begin + {$if declared(_ASN1_PCTX_set_cert_flags)} + ASN1_PCTX_set_cert_flags := @_ASN1_PCTX_set_cert_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_PCTX_set_cert_flags_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_PCTX_set_cert_flags'); + {$ifend} + end; + + + ASN1_PCTX_get_oid_flags := LoadLibFunction(ADllHandle, ASN1_PCTX_get_oid_flags_procname); + FuncLoadError := not assigned(ASN1_PCTX_get_oid_flags); + if FuncLoadError then + begin + {$if not defined(ASN1_PCTX_get_oid_flags_allownil)} + ASN1_PCTX_get_oid_flags := @ERR_ASN1_PCTX_get_oid_flags; + {$ifend} + {$if declared(ASN1_PCTX_get_oid_flags_introduced)} + if LibVersion < ASN1_PCTX_get_oid_flags_introduced then + begin + {$if declared(FC_ASN1_PCTX_get_oid_flags)} + ASN1_PCTX_get_oid_flags := @FC_ASN1_PCTX_get_oid_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_PCTX_get_oid_flags_removed)} + if ASN1_PCTX_get_oid_flags_removed <= LibVersion then + begin + {$if declared(_ASN1_PCTX_get_oid_flags)} + ASN1_PCTX_get_oid_flags := @_ASN1_PCTX_get_oid_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_PCTX_get_oid_flags_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_PCTX_get_oid_flags'); + {$ifend} + end; + + + ASN1_PCTX_set_oid_flags := LoadLibFunction(ADllHandle, ASN1_PCTX_set_oid_flags_procname); + FuncLoadError := not assigned(ASN1_PCTX_set_oid_flags); + if FuncLoadError then + begin + {$if not defined(ASN1_PCTX_set_oid_flags_allownil)} + ASN1_PCTX_set_oid_flags := @ERR_ASN1_PCTX_set_oid_flags; + {$ifend} + {$if declared(ASN1_PCTX_set_oid_flags_introduced)} + if LibVersion < ASN1_PCTX_set_oid_flags_introduced then + begin + {$if declared(FC_ASN1_PCTX_set_oid_flags)} + ASN1_PCTX_set_oid_flags := @FC_ASN1_PCTX_set_oid_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_PCTX_set_oid_flags_removed)} + if ASN1_PCTX_set_oid_flags_removed <= LibVersion then + begin + {$if declared(_ASN1_PCTX_set_oid_flags)} + ASN1_PCTX_set_oid_flags := @_ASN1_PCTX_set_oid_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_PCTX_set_oid_flags_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_PCTX_set_oid_flags'); + {$ifend} + end; + + + ASN1_PCTX_get_str_flags := LoadLibFunction(ADllHandle, ASN1_PCTX_get_str_flags_procname); + FuncLoadError := not assigned(ASN1_PCTX_get_str_flags); + if FuncLoadError then + begin + {$if not defined(ASN1_PCTX_get_str_flags_allownil)} + ASN1_PCTX_get_str_flags := @ERR_ASN1_PCTX_get_str_flags; + {$ifend} + {$if declared(ASN1_PCTX_get_str_flags_introduced)} + if LibVersion < ASN1_PCTX_get_str_flags_introduced then + begin + {$if declared(FC_ASN1_PCTX_get_str_flags)} + ASN1_PCTX_get_str_flags := @FC_ASN1_PCTX_get_str_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_PCTX_get_str_flags_removed)} + if ASN1_PCTX_get_str_flags_removed <= LibVersion then + begin + {$if declared(_ASN1_PCTX_get_str_flags)} + ASN1_PCTX_get_str_flags := @_ASN1_PCTX_get_str_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_PCTX_get_str_flags_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_PCTX_get_str_flags'); + {$ifend} + end; + + + ASN1_PCTX_set_str_flags := LoadLibFunction(ADllHandle, ASN1_PCTX_set_str_flags_procname); + FuncLoadError := not assigned(ASN1_PCTX_set_str_flags); + if FuncLoadError then + begin + {$if not defined(ASN1_PCTX_set_str_flags_allownil)} + ASN1_PCTX_set_str_flags := @ERR_ASN1_PCTX_set_str_flags; + {$ifend} + {$if declared(ASN1_PCTX_set_str_flags_introduced)} + if LibVersion < ASN1_PCTX_set_str_flags_introduced then + begin + {$if declared(FC_ASN1_PCTX_set_str_flags)} + ASN1_PCTX_set_str_flags := @FC_ASN1_PCTX_set_str_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_PCTX_set_str_flags_removed)} + if ASN1_PCTX_set_str_flags_removed <= LibVersion then + begin + {$if declared(_ASN1_PCTX_set_str_flags)} + ASN1_PCTX_set_str_flags := @_ASN1_PCTX_set_str_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_PCTX_set_str_flags_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_PCTX_set_str_flags'); + {$ifend} + end; + + + ASN1_SCTX_free := LoadLibFunction(ADllHandle, ASN1_SCTX_free_procname); + FuncLoadError := not assigned(ASN1_SCTX_free); + if FuncLoadError then + begin + {$if not defined(ASN1_SCTX_free_allownil)} + ASN1_SCTX_free := @ERR_ASN1_SCTX_free; + {$ifend} + {$if declared(ASN1_SCTX_free_introduced)} + if LibVersion < ASN1_SCTX_free_introduced then + begin + {$if declared(FC_ASN1_SCTX_free)} + ASN1_SCTX_free := @FC_ASN1_SCTX_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_SCTX_free_removed)} + if ASN1_SCTX_free_removed <= LibVersion then + begin + {$if declared(_ASN1_SCTX_free)} + ASN1_SCTX_free := @_ASN1_SCTX_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_SCTX_free_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_SCTX_free'); + {$ifend} + end; + + {introduced 1.1.0} + ASN1_SCTX_get_item := LoadLibFunction(ADllHandle, ASN1_SCTX_get_item_procname); + FuncLoadError := not assigned(ASN1_SCTX_get_item); + if FuncLoadError then + begin + {$if not defined(ASN1_SCTX_get_item_allownil)} + ASN1_SCTX_get_item := @ERR_ASN1_SCTX_get_item; + {$ifend} + {$if declared(ASN1_SCTX_get_item_introduced)} + if LibVersion < ASN1_SCTX_get_item_introduced then + begin + {$if declared(FC_ASN1_SCTX_get_item)} + ASN1_SCTX_get_item := @FC_ASN1_SCTX_get_item; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_SCTX_get_item_removed)} + if ASN1_SCTX_get_item_removed <= LibVersion then + begin + {$if declared(_ASN1_SCTX_get_item)} + ASN1_SCTX_get_item := @_ASN1_SCTX_get_item; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_SCTX_get_item_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_SCTX_get_item'); + {$ifend} + end; + + {introduced 1.1.0} + ASN1_SCTX_get_template := LoadLibFunction(ADllHandle, ASN1_SCTX_get_template_procname); + FuncLoadError := not assigned(ASN1_SCTX_get_template); + if FuncLoadError then + begin + {$if not defined(ASN1_SCTX_get_template_allownil)} + ASN1_SCTX_get_template := @ERR_ASN1_SCTX_get_template; + {$ifend} + {$if declared(ASN1_SCTX_get_template_introduced)} + if LibVersion < ASN1_SCTX_get_template_introduced then + begin + {$if declared(FC_ASN1_SCTX_get_template)} + ASN1_SCTX_get_template := @FC_ASN1_SCTX_get_template; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_SCTX_get_template_removed)} + if ASN1_SCTX_get_template_removed <= LibVersion then + begin + {$if declared(_ASN1_SCTX_get_template)} + ASN1_SCTX_get_template := @_ASN1_SCTX_get_template; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_SCTX_get_template_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_SCTX_get_template'); + {$ifend} + end; + + {introduced 1.1.0} + ASN1_SCTX_get_flags := LoadLibFunction(ADllHandle, ASN1_SCTX_get_flags_procname); + FuncLoadError := not assigned(ASN1_SCTX_get_flags); + if FuncLoadError then + begin + {$if not defined(ASN1_SCTX_get_flags_allownil)} + ASN1_SCTX_get_flags := @ERR_ASN1_SCTX_get_flags; + {$ifend} + {$if declared(ASN1_SCTX_get_flags_introduced)} + if LibVersion < ASN1_SCTX_get_flags_introduced then + begin + {$if declared(FC_ASN1_SCTX_get_flags)} + ASN1_SCTX_get_flags := @FC_ASN1_SCTX_get_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_SCTX_get_flags_removed)} + if ASN1_SCTX_get_flags_removed <= LibVersion then + begin + {$if declared(_ASN1_SCTX_get_flags)} + ASN1_SCTX_get_flags := @_ASN1_SCTX_get_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_SCTX_get_flags_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_SCTX_get_flags'); + {$ifend} + end; + + {introduced 1.1.0} + ASN1_SCTX_set_app_data := LoadLibFunction(ADllHandle, ASN1_SCTX_set_app_data_procname); + FuncLoadError := not assigned(ASN1_SCTX_set_app_data); + if FuncLoadError then + begin + {$if not defined(ASN1_SCTX_set_app_data_allownil)} + ASN1_SCTX_set_app_data := @ERR_ASN1_SCTX_set_app_data; + {$ifend} + {$if declared(ASN1_SCTX_set_app_data_introduced)} + if LibVersion < ASN1_SCTX_set_app_data_introduced then + begin + {$if declared(FC_ASN1_SCTX_set_app_data)} + ASN1_SCTX_set_app_data := @FC_ASN1_SCTX_set_app_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_SCTX_set_app_data_removed)} + if ASN1_SCTX_set_app_data_removed <= LibVersion then + begin + {$if declared(_ASN1_SCTX_set_app_data)} + ASN1_SCTX_set_app_data := @_ASN1_SCTX_set_app_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_SCTX_set_app_data_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_SCTX_set_app_data'); + {$ifend} + end; + + {introduced 1.1.0} + ASN1_SCTX_get_app_data := LoadLibFunction(ADllHandle, ASN1_SCTX_get_app_data_procname); + FuncLoadError := not assigned(ASN1_SCTX_get_app_data); + if FuncLoadError then + begin + {$if not defined(ASN1_SCTX_get_app_data_allownil)} + ASN1_SCTX_get_app_data := @ERR_ASN1_SCTX_get_app_data; + {$ifend} + {$if declared(ASN1_SCTX_get_app_data_introduced)} + if LibVersion < ASN1_SCTX_get_app_data_introduced then + begin + {$if declared(FC_ASN1_SCTX_get_app_data)} + ASN1_SCTX_get_app_data := @FC_ASN1_SCTX_get_app_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_SCTX_get_app_data_removed)} + if ASN1_SCTX_get_app_data_removed <= LibVersion then + begin + {$if declared(_ASN1_SCTX_get_app_data)} + ASN1_SCTX_get_app_data := @_ASN1_SCTX_get_app_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_SCTX_get_app_data_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_SCTX_get_app_data'); + {$ifend} + end; + + {introduced 1.1.0} + BIO_f_asn1 := LoadLibFunction(ADllHandle, BIO_f_asn1_procname); + FuncLoadError := not assigned(BIO_f_asn1); + if FuncLoadError then + begin + {$if not defined(BIO_f_asn1_allownil)} + BIO_f_asn1 := @ERR_BIO_f_asn1; + {$ifend} + {$if declared(BIO_f_asn1_introduced)} + if LibVersion < BIO_f_asn1_introduced then + begin + {$if declared(FC_BIO_f_asn1)} + BIO_f_asn1 := @FC_BIO_f_asn1; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_f_asn1_removed)} + if BIO_f_asn1_removed <= LibVersion then + begin + {$if declared(_BIO_f_asn1)} + BIO_f_asn1 := @_BIO_f_asn1; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_f_asn1_allownil)} + if FuncLoadError then + AFailed.Add('BIO_f_asn1'); + {$ifend} + end; + + + BIO_new_NDEF := LoadLibFunction(ADllHandle, BIO_new_NDEF_procname); + FuncLoadError := not assigned(BIO_new_NDEF); + if FuncLoadError then + begin + {$if not defined(BIO_new_NDEF_allownil)} + BIO_new_NDEF := @ERR_BIO_new_NDEF; + {$ifend} + {$if declared(BIO_new_NDEF_introduced)} + if LibVersion < BIO_new_NDEF_introduced then + begin + {$if declared(FC_BIO_new_NDEF)} + BIO_new_NDEF := @FC_BIO_new_NDEF; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_new_NDEF_removed)} + if BIO_new_NDEF_removed <= LibVersion then + begin + {$if declared(_BIO_new_NDEF)} + BIO_new_NDEF := @_BIO_new_NDEF; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_new_NDEF_allownil)} + if FuncLoadError then + AFailed.Add('BIO_new_NDEF'); + {$ifend} + end; + + + i2d_ASN1_bio_stream := LoadLibFunction(ADllHandle, i2d_ASN1_bio_stream_procname); + FuncLoadError := not assigned(i2d_ASN1_bio_stream); + if FuncLoadError then + begin + {$if not defined(i2d_ASN1_bio_stream_allownil)} + i2d_ASN1_bio_stream := @ERR_i2d_ASN1_bio_stream; + {$ifend} + {$if declared(i2d_ASN1_bio_stream_introduced)} + if LibVersion < i2d_ASN1_bio_stream_introduced then + begin + {$if declared(FC_i2d_ASN1_bio_stream)} + i2d_ASN1_bio_stream := @FC_i2d_ASN1_bio_stream; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(i2d_ASN1_bio_stream_removed)} + if i2d_ASN1_bio_stream_removed <= LibVersion then + begin + {$if declared(_i2d_ASN1_bio_stream)} + i2d_ASN1_bio_stream := @_i2d_ASN1_bio_stream; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(i2d_ASN1_bio_stream_allownil)} + if FuncLoadError then + AFailed.Add('i2d_ASN1_bio_stream'); + {$ifend} + end; + + + PEM_write_bio_ASN1_stream := LoadLibFunction(ADllHandle, PEM_write_bio_ASN1_stream_procname); + FuncLoadError := not assigned(PEM_write_bio_ASN1_stream); + if FuncLoadError then + begin + {$if not defined(PEM_write_bio_ASN1_stream_allownil)} + PEM_write_bio_ASN1_stream := @ERR_PEM_write_bio_ASN1_stream; + {$ifend} + {$if declared(PEM_write_bio_ASN1_stream_introduced)} + if LibVersion < PEM_write_bio_ASN1_stream_introduced then + begin + {$if declared(FC_PEM_write_bio_ASN1_stream)} + PEM_write_bio_ASN1_stream := @FC_PEM_write_bio_ASN1_stream; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PEM_write_bio_ASN1_stream_removed)} + if PEM_write_bio_ASN1_stream_removed <= LibVersion then + begin + {$if declared(_PEM_write_bio_ASN1_stream)} + PEM_write_bio_ASN1_stream := @_PEM_write_bio_ASN1_stream; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PEM_write_bio_ASN1_stream_allownil)} + if FuncLoadError then + AFailed.Add('PEM_write_bio_ASN1_stream'); + {$ifend} + end; + + + SMIME_read_ASN1 := LoadLibFunction(ADllHandle, SMIME_read_ASN1_procname); + FuncLoadError := not assigned(SMIME_read_ASN1); + if FuncLoadError then + begin + {$if not defined(SMIME_read_ASN1_allownil)} + SMIME_read_ASN1 := @ERR_SMIME_read_ASN1; + {$ifend} + {$if declared(SMIME_read_ASN1_introduced)} + if LibVersion < SMIME_read_ASN1_introduced then + begin + {$if declared(FC_SMIME_read_ASN1)} + SMIME_read_ASN1 := @FC_SMIME_read_ASN1; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SMIME_read_ASN1_removed)} + if SMIME_read_ASN1_removed <= LibVersion then + begin + {$if declared(_SMIME_read_ASN1)} + SMIME_read_ASN1 := @_SMIME_read_ASN1; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SMIME_read_ASN1_allownil)} + if FuncLoadError then + AFailed.Add('SMIME_read_ASN1'); + {$ifend} + end; + + + SMIME_crlf_copy := LoadLibFunction(ADllHandle, SMIME_crlf_copy_procname); + FuncLoadError := not assigned(SMIME_crlf_copy); + if FuncLoadError then + begin + {$if not defined(SMIME_crlf_copy_allownil)} + SMIME_crlf_copy := @ERR_SMIME_crlf_copy; + {$ifend} + {$if declared(SMIME_crlf_copy_introduced)} + if LibVersion < SMIME_crlf_copy_introduced then + begin + {$if declared(FC_SMIME_crlf_copy)} + SMIME_crlf_copy := @FC_SMIME_crlf_copy; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SMIME_crlf_copy_removed)} + if SMIME_crlf_copy_removed <= LibVersion then + begin + {$if declared(_SMIME_crlf_copy)} + SMIME_crlf_copy := @_SMIME_crlf_copy; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SMIME_crlf_copy_allownil)} + if FuncLoadError then + AFailed.Add('SMIME_crlf_copy'); + {$ifend} + end; + + + SMIME_text := LoadLibFunction(ADllHandle, SMIME_text_procname); + FuncLoadError := not assigned(SMIME_text); + if FuncLoadError then + begin + {$if not defined(SMIME_text_allownil)} + SMIME_text := @ERR_SMIME_text; + {$ifend} + {$if declared(SMIME_text_introduced)} + if LibVersion < SMIME_text_introduced then + begin + {$if declared(FC_SMIME_text)} + SMIME_text := @FC_SMIME_text; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SMIME_text_removed)} + if SMIME_text_removed <= LibVersion then + begin + {$if declared(_SMIME_text)} + SMIME_text := @_SMIME_text; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SMIME_text_allownil)} + if FuncLoadError then + AFailed.Add('SMIME_text'); + {$ifend} + end; + + + ASN1_ITEM_lookup := LoadLibFunction(ADllHandle, ASN1_ITEM_lookup_procname); + FuncLoadError := not assigned(ASN1_ITEM_lookup); + if FuncLoadError then + begin + {$if not defined(ASN1_ITEM_lookup_allownil)} + ASN1_ITEM_lookup := @ERR_ASN1_ITEM_lookup; + {$ifend} + {$if declared(ASN1_ITEM_lookup_introduced)} + if LibVersion < ASN1_ITEM_lookup_introduced then + begin + {$if declared(FC_ASN1_ITEM_lookup)} + ASN1_ITEM_lookup := @FC_ASN1_ITEM_lookup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_ITEM_lookup_removed)} + if ASN1_ITEM_lookup_removed <= LibVersion then + begin + {$if declared(_ASN1_ITEM_lookup)} + ASN1_ITEM_lookup := @_ASN1_ITEM_lookup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_ITEM_lookup_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_ITEM_lookup'); + {$ifend} + end; + + {introduced 1.1.0} + ASN1_ITEM_get := LoadLibFunction(ADllHandle, ASN1_ITEM_get_procname); + FuncLoadError := not assigned(ASN1_ITEM_get); + if FuncLoadError then + begin + {$if not defined(ASN1_ITEM_get_allownil)} + ASN1_ITEM_get := @ERR_ASN1_ITEM_get; + {$ifend} + {$if declared(ASN1_ITEM_get_introduced)} + if LibVersion < ASN1_ITEM_get_introduced then + begin + {$if declared(FC_ASN1_ITEM_get)} + ASN1_ITEM_get := @FC_ASN1_ITEM_get; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_ITEM_get_removed)} + if ASN1_ITEM_get_removed <= LibVersion then + begin + {$if declared(_ASN1_ITEM_get)} + ASN1_ITEM_get := @_ASN1_ITEM_get; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_ITEM_get_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_ITEM_get'); + {$ifend} + end; + + {introduced 1.1.0} +end; + +procedure Unload; +begin + ASN1_TYPE_get := nil; + ASN1_TYPE_set := nil; + ASN1_TYPE_set1 := nil; + ASN1_TYPE_cmp := nil; + ASN1_TYPE_pack_sequence := nil; {introduced 1.1.0} + ASN1_TYPE_unpack_sequence := nil; {introduced 1.1.0} + ASN1_OBJECT_new := nil; + ASN1_OBJECT_free := nil; + i2d_ASN1_OBJECT := nil; + d2i_ASN1_OBJECT := nil; + ASN1_STRING_new := nil; + ASN1_STRING_free := nil; + ASN1_STRING_clear_free := nil; + ASN1_STRING_copy := nil; + ASN1_STRING_dup := nil; + ASN1_STRING_type_new := nil; + ASN1_STRING_cmp := nil; + ASN1_STRING_set := nil; + ASN1_STRING_set0 := nil; + ASN1_STRING_length := nil; + ASN1_STRING_length_set := nil; + ASN1_STRING_type := nil; + ASN1_STRING_get0_data := nil; {introduced 1.1.0} + ASN1_BIT_STRING_set := nil; + ASN1_BIT_STRING_set_bit := nil; + ASN1_BIT_STRING_get_bit := nil; + ASN1_BIT_STRING_check := nil; + ASN1_BIT_STRING_name_print := nil; + ASN1_BIT_STRING_num_asc := nil; + ASN1_BIT_STRING_set_asc := nil; + ASN1_INTEGER_new := nil; + ASN1_INTEGER_free := nil; + d2i_ASN1_INTEGER := nil; + i2d_ASN1_INTEGER := nil; + d2i_ASN1_UINTEGER := nil; + ASN1_INTEGER_dup := nil; + ASN1_INTEGER_cmp := nil; + ASN1_UTCTIME_check := nil; + ASN1_UTCTIME_set := nil; + ASN1_UTCTIME_adj := nil; + ASN1_UTCTIME_set_string := nil; + ASN1_UTCTIME_cmp_time_t := nil; + ASN1_GENERALIZEDTIME_check := nil; + ASN1_GENERALIZEDTIME_set := nil; + ASN1_GENERALIZEDTIME_adj := nil; + ASN1_GENERALIZEDTIME_set_string := nil; + ASN1_TIME_diff := nil; + ASN1_OCTET_STRING_dup := nil; + ASN1_OCTET_STRING_cmp := nil; + ASN1_OCTET_STRING_set := nil; + d2i_ASN1_OCTET_STRING := nil; + i2d_ASN1_OCTET_STRING := nil; + ASN1_OCTET_STRING_free := nil; + UTF8_getc := nil; + UTF8_putc := nil; + ASN1_UTCTIME_new := nil; + ASN1_UTCTIME_free := nil; + d2i_ASN1_UTCTIME := nil; + i2d_ASN1_UTCTIME := nil; + ASN1_GENERALIZEDTIME_new := nil; + ASN1_GENERALIZEDTIME_free := nil; + d2i_ASN1_GENERALIZEDTIME := nil; + i2d_ASN1_GENERALIZEDTIME := nil; + ASN1_TIME_new := nil; + ASN1_TIME_free := nil; + d2i_ASN1_TIME := nil; + i2d_ASN1_TIME := nil; + ASN1_TIME_set := nil; + ASN1_TIME_adj := nil; + ASN1_TIME_check := nil; + ASN1_TIME_to_generalizedtime := nil; + ASN1_TIME_set_string := nil; + ASN1_TIME_set_string_X509 := nil; {introduced 1.1.0} + ASN1_TIME_to_tm := nil; {introduced 1.1.0} + ASN1_TIME_normalize := nil; {introduced 1.1.0} + ASN1_TIME_cmp_time_t := nil; {introduced 1.1.0} + ASN1_TIME_compare := nil; {introduced 1.1.0} + i2a_ASN1_INTEGER := nil; + a2i_ASN1_INTEGER := nil; + i2a_ASN1_ENUMERATED := nil; + a2i_ASN1_ENUMERATED := nil; + i2a_ASN1_OBJECT := nil; + a2i_ASN1_STRING := nil; + i2a_ASN1_STRING := nil; + i2t_ASN1_OBJECT := nil; + a2d_ASN1_OBJECT := nil; + ASN1_OBJECT_create := nil; + ASN1_INTEGER_get_int64 := nil; {introduced 1.1.0} + ASN1_INTEGER_set_int64 := nil; {introduced 1.1.0} + ASN1_INTEGER_get_uint64 := nil; {introduced 1.1.0} + ASN1_INTEGER_set_uint64 := nil; {introduced 1.1.0} + ASN1_INTEGER_set := nil; + ASN1_INTEGER_get := nil; + BN_to_ASN1_INTEGER := nil; + ASN1_INTEGER_to_BN := nil; + ASN1_ENUMERATED_get_int64 := nil; {introduced 1.1.0} + ASN1_ENUMERATED_set_int64 := nil; {introduced 1.1.0} + ASN1_ENUMERATED_set := nil; + ASN1_ENUMERATED_get := nil; + BN_to_ASN1_ENUMERATED := nil; + ASN1_ENUMERATED_to_BN := nil; + ASN1_PRINTABLE_type := nil; + ASN1_tag2bit := nil; + ASN1_get_object := nil; + ASN1_check_infinite_end := nil; + ASN1_const_check_infinite_end := nil; + ASN1_put_object := nil; + ASN1_put_eoc := nil; + ASN1_object_size := nil; + ASN1_item_dup := nil; + ASN1_STRING_to_UTF8 := nil; + ASN1_item_d2i_bio := nil; + ASN1_i2d_bio := nil; + ASN1_item_i2d_bio := nil; + ASN1_UTCTIME_print := nil; + ASN1_GENERALIZEDTIME_print := nil; + ASN1_TIME_print := nil; + ASN1_STRING_print := nil; + ASN1_STRING_print_ex := nil; + ASN1_buf_print := nil; {introduced 1.1.0} + ASN1_bn_print := nil; + ASN1_parse := nil; + ASN1_parse_dump := nil; + ASN1_tag2str := nil; + ASN1_UNIVERSALSTRING_to_string := nil; + ASN1_TYPE_set_octetstring := nil; + ASN1_TYPE_get_octetstring := nil; + ASN1_TYPE_set_int_octetstring := nil; + ASN1_TYPE_get_int_octetstring := nil; + ASN1_item_unpack := nil; + ASN1_item_pack := nil; + ASN1_STRING_set_default_mask := nil; + ASN1_STRING_set_default_mask_asc := nil; + ASN1_STRING_get_default_mask := nil; + ASN1_mbstring_copy := nil; + ASN1_mbstring_ncopy := nil; + ASN1_STRING_set_by_NID := nil; + ASN1_STRING_TABLE_get := nil; + ASN1_STRING_TABLE_add := nil; + ASN1_STRING_TABLE_cleanup := nil; + ASN1_item_new := nil; + ASN1_item_free := nil; + ASN1_item_d2i := nil; + ASN1_item_i2d := nil; + ASN1_item_ndef_i2d := nil; + ASN1_add_oid_module := nil; + ASN1_add_stable_module := nil; {introduced 1.1.0} + ASN1_generate_nconf := nil; + ASN1_generate_v3 := nil; + ASN1_str2mask := nil; {introduced 1.1.0} + ASN1_item_print := nil; + ASN1_PCTX_new := nil; + ASN1_PCTX_free := nil; + ASN1_PCTX_get_flags := nil; + ASN1_PCTX_set_flags := nil; + ASN1_PCTX_get_nm_flags := nil; + ASN1_PCTX_set_nm_flags := nil; + ASN1_PCTX_get_cert_flags := nil; + ASN1_PCTX_set_cert_flags := nil; + ASN1_PCTX_get_oid_flags := nil; + ASN1_PCTX_set_oid_flags := nil; + ASN1_PCTX_get_str_flags := nil; + ASN1_PCTX_set_str_flags := nil; + ASN1_SCTX_free := nil; {introduced 1.1.0} + ASN1_SCTX_get_item := nil; {introduced 1.1.0} + ASN1_SCTX_get_template := nil; {introduced 1.1.0} + ASN1_SCTX_get_flags := nil; {introduced 1.1.0} + ASN1_SCTX_set_app_data := nil; {introduced 1.1.0} + ASN1_SCTX_get_app_data := nil; {introduced 1.1.0} + BIO_f_asn1 := nil; + BIO_new_NDEF := nil; + i2d_ASN1_bio_stream := nil; + PEM_write_bio_ASN1_stream := nil; + SMIME_read_ASN1 := nil; + SMIME_crlf_copy := nil; + SMIME_text := nil; + ASN1_ITEM_lookup := nil; {introduced 1.1.0} + ASN1_ITEM_get := nil; {introduced 1.1.0} +end; +{$ELSE} +{$ENDIF} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +initialization + Register_SSLLoader(@Load,'LibCrypto'); + Register_SSLUnloader(@Unload); +{$ENDIF} +end. diff --git a/IdOpenSSLHeaders_asn1_mac.pas b/IdOpenSSLHeaders_asn1_mac.pas new file mode 100644 index 0000000..0c604c5 --- /dev/null +++ b/IdOpenSSLHeaders_asn1_mac.pas @@ -0,0 +1,46 @@ + (* This unit was generated using the script genOpenSSLHdrs.sh from the source file IdOpenSSLHeaders_asn1_mac.h2pas + It should not be modified directly. All changes should be made to IdOpenSSLHeaders_asn1_mac.h2pas + and this file regenerated. IdOpenSSLHeaders_asn1_mac.h2pas is distributed with the full Indy + Distribution. + *) + +{$i IdCompilerDefines.inc} +{$i IdSSLOpenSSLDefines.inc} +{$IFNDEF USE_OPENSSL} + { error Should not compile if USE_OPENSSL is not defined!!!} +{$ENDIF} +{******************************************************************************} +{ } +{ Indy (Internet Direct) - Internet Protocols Simplified } +{ } +{ https://www.indyproject.org/ } +{ https://gitter.im/IndySockets/Indy } +{ } +{******************************************************************************} +{ } +{ This file is part of the Indy (Internet Direct) project, and is offered } +{ under the dual-licensing agreement described on the Indy website. } +{ (https://www.indyproject.org/license/) } +{ } +{ Copyright: } +{ (c) 1993-2020, Chad Z. Hower and the Indy Pit Crew. All rights reserved. } +{ } +{******************************************************************************} +{ } +{ } +{******************************************************************************} + +unit IdOpenSSLHeaders_asn1_mac; + +interface + +// Headers for OpenSSL 1.1.1 +// asn1_mac.h + +{.$i IdCompilerDefines.inc} + +//#error "This file is obsolete; please update your software." + +implementation + +end. diff --git a/IdOpenSSLHeaders_asn1err.pas b/IdOpenSSLHeaders_asn1err.pas new file mode 100644 index 0000000..62e4c30 --- /dev/null +++ b/IdOpenSSLHeaders_asn1err.pas @@ -0,0 +1,370 @@ + (* This unit was generated using the script genOpenSSLHdrs.sh from the source file IdOpenSSLHeaders_asn1err.h2pas + It should not be modified directly. All changes should be made to IdOpenSSLHeaders_asn1err.h2pas + and this file regenerated. IdOpenSSLHeaders_asn1err.h2pas is distributed with the full Indy + Distribution. + *) + +{$i IdCompilerDefines.inc} +{$i IdSSLOpenSSLDefines.inc} +{$IFNDEF USE_OPENSSL} + { error Should not compile if USE_OPENSSL is not defined!!!} +{$ENDIF} +{******************************************************************************} +{ } +{ Indy (Internet Direct) - Internet Protocols Simplified } +{ } +{ https://www.indyproject.org/ } +{ https://gitter.im/IndySockets/Indy } +{ } +{******************************************************************************} +{ } +{ This file is part of the Indy (Internet Direct) project, and is offered } +{ under the dual-licensing agreement described on the Indy website. } +{ (https://www.indyproject.org/license/) } +{ } +{ Copyright: } +{ (c) 1993-2020, Chad Z. Hower and the Indy Pit Crew. All rights reserved. } +{ } +{******************************************************************************} +{ } +{ } +{******************************************************************************} + +unit IdOpenSSLHeaders_asn1err; + +interface + +// Headers for OpenSSL 1.1.1 +// asn1err.h + + +uses + IdCTypes, + IdGlobal, + IdSSLOpenSSLConsts; + +const + +// ASN1 function codes. + ASN1_F_A2D_ASN1_OBJECT = 100; + ASN1_F_A2I_ASN1_INTEGER = 102; + ASN1_F_A2I_ASN1_STRING = 103; + ASN1_F_APPEND_EXP = 176; + ASN1_F_ASN1_BIO_INIT = 113; + ASN1_F_ASN1_BIT_STRING_SET_BIT = 183; + ASN1_F_ASN1_CB = 177; + ASN1_F_ASN1_CHECK_TLEN = 104; + ASN1_F_ASN1_COLLECT = 106; + ASN1_F_ASN1_D2I_EX_PRIMITIVE = 108; + ASN1_F_ASN1_D2I_FP = 109; + ASN1_F_ASN1_D2I_READ_BIO = 107; + ASN1_F_ASN1_DIGEST = 184; + ASN1_F_ASN1_DO_ADB = 110; + ASN1_F_ASN1_DO_LOCK = 233; + ASN1_F_ASN1_DUP = 111; + ASN1_F_ASN1_ENC_SAVE = 115; + ASN1_F_ASN1_EX_C2I = 204; + ASN1_F_ASN1_FIND_END = 190; + ASN1_F_ASN1_GENERALIZEDTIME_ADJ = 216; + ASN1_F_ASN1_GENERATE_V3 = 178; + ASN1_F_ASN1_GET_INT64 = 224; + ASN1_F_ASN1_GET_OBJECT = 114; + ASN1_F_ASN1_GET_UINT64 = 225; + ASN1_F_ASN1_I2D_BIO = 116; + ASN1_F_ASN1_I2D_FP = 117; + ASN1_F_ASN1_ITEM_D2I_FP = 206; + ASN1_F_ASN1_ITEM_DUP = 191; + ASN1_F_ASN1_ITEM_EMBED_D2I = 120; + ASN1_F_ASN1_ITEM_EMBED_NEW = 121; + ASN1_F_ASN1_ITEM_FLAGS_I2D = 118; + ASN1_F_ASN1_ITEM_I2D_BIO = 192; + ASN1_F_ASN1_ITEM_I2D_FP = 193; + ASN1_F_ASN1_ITEM_PACK = 198; + ASN1_F_ASN1_ITEM_SIGN = 195; + ASN1_F_ASN1_ITEM_SIGN_CTX = 220; + ASN1_F_ASN1_ITEM_UNPACK = 199; + ASN1_F_ASN1_ITEM_VERIFY = 197; + ASN1_F_ASN1_MBSTRING_NCOPY = 122; + ASN1_F_ASN1_OBJECT_NEW = 123; + ASN1_F_ASN1_OUTPUT_DATA = 214; + ASN1_F_ASN1_PCTX_NEW = 205; + ASN1_F_ASN1_PRIMITIVE_NEW = 119; + ASN1_F_ASN1_SCTX_NEW = 221; + ASN1_F_ASN1_SIGN = 128; + ASN1_F_ASN1_STR2TYPE = 179; + ASN1_F_ASN1_STRING_GET_INT64 = 227; + ASN1_F_ASN1_STRING_GET_UINT64 = 230; + ASN1_F_ASN1_STRING_SET = 186; + ASN1_F_ASN1_STRING_TABLE_ADD = 129; + ASN1_F_ASN1_STRING_TO_BN = 228; + ASN1_F_ASN1_STRING_TYPE_NEW = 130; + ASN1_F_ASN1_TEMPLATE_EX_D2I = 132; + ASN1_F_ASN1_TEMPLATE_NEW = 133; + ASN1_F_ASN1_TEMPLATE_NOEXP_D2I = 131; + ASN1_F_ASN1_TIME_ADJ = 217; + ASN1_F_ASN1_TYPE_GET_INT_OCTETSTRING = 134; + ASN1_F_ASN1_TYPE_GET_OCTETSTRING = 135; + ASN1_F_ASN1_UTCTIME_ADJ = 218; + ASN1_F_ASN1_VERIFY = 137; + ASN1_F_B64_READ_ASN1 = 209; + ASN1_F_B64_WRITE_ASN1 = 210; + ASN1_F_BIO_NEW_NDEF = 208; + ASN1_F_BITSTR_CB = 180; + ASN1_F_BN_TO_ASN1_STRING = 229; + ASN1_F_C2I_ASN1_BIT_STRING = 189; + ASN1_F_C2I_ASN1_INTEGER = 194; + ASN1_F_C2I_ASN1_OBJECT = 196; + ASN1_F_C2I_IBUF = 226; + ASN1_F_C2I_UINT64_INT = 101; + ASN1_F_COLLECT_DATA = 140; + ASN1_F_D2I_ASN1_OBJECT = 147; + ASN1_F_D2I_ASN1_UINTEGER = 150; + ASN1_F_D2I_AUTOPRIVATEKEY = 207; + ASN1_F_D2I_PRIVATEKEY = 154; + ASN1_F_D2I_PUBLICKEY = 155; + ASN1_F_DO_BUF = 142; + ASN1_F_DO_CREATE = 124; + ASN1_F_DO_DUMP = 125; + ASN1_F_DO_TCREATE = 222; + ASN1_F_I2A_ASN1_OBJECT = 126; + ASN1_F_I2D_ASN1_BIO_STREAM = 211; + ASN1_F_I2D_ASN1_OBJECT = 143; + ASN1_F_I2D_DSA_PUBKEY = 161; + ASN1_F_I2D_EC_PUBKEY = 181; + ASN1_F_I2D_PRIVATEKEY = 163; + ASN1_F_I2D_PUBLICKEY = 164; + ASN1_F_I2D_RSA_PUBKEY = 165; + ASN1_F_LONG_C2I = 166; + ASN1_F_NDEF_PREFIX = 127; + ASN1_F_NDEF_SUFFIX = 136; + ASN1_F_OID_MODULE_INIT = 174; + ASN1_F_PARSE_TAGGING = 182; + ASN1_F_PKCS5_PBE2_SET_IV = 167; + ASN1_F_PKCS5_PBE2_SET_SCRYPT = 231; + ASN1_F_PKCS5_PBE_SET = 202; + ASN1_F_PKCS5_PBE_SET0_ALGOR = 215; + ASN1_F_PKCS5_PBKDF2_SET = 219; + ASN1_F_PKCS5_SCRYPT_SET = 232; + ASN1_F_SMIME_READ_ASN1 = 212; + ASN1_F_SMIME_TEXT = 213; + ASN1_F_STABLE_GET = 138; + ASN1_F_STBL_MODULE_INIT = 223; + ASN1_F_UINT32_C2I = 105; + ASN1_F_UINT32_NEW = 139; + ASN1_F_UINT64_C2I = 112; + ASN1_F_UINT64_NEW = 141; + ASN1_F_X509_CRL_ADD0_REVOKED = 169; + ASN1_F_X509_INFO_NEW = 170; + ASN1_F_X509_NAME_ENCODE = 203; + ASN1_F_X509_NAME_EX_D2I = 158; + ASN1_F_X509_NAME_EX_NEW = 171; + ASN1_F_X509_PKEY_NEW = 173; + +// ASN1 reason codes. + ASN1_R_ADDING_OBJECT = 171; + ASN1_R_ASN1_PARSE_ERROR = 203; + ASN1_R_ASN1_SIG_PARSE_ERROR = 204; + ASN1_R_AUX_ERROR = 100; + ASN1_R_BAD_OBJECT_HEADER = 102; + ASN1_R_BMPSTRING_IS_WRONG_LENGTH = 214; + ASN1_R_BN_LIB = 105; + ASN1_R_BOOLEAN_IS_WRONG_LENGTH = 106; + ASN1_R_BUFFER_TOO_SMALL = 107; + ASN1_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER = 108; + ASN1_R_CONTEXT_NOT_INITIALISED = 217; + ASN1_R_DATA_IS_WRONG = 109; + ASN1_R_DECODE_ERROR = 110; + ASN1_R_DEPTH_EXCEEDED = 174; + ASN1_R_DIGEST_AND_KEY_TYPE_NOT_SUPPORTED = 198; + ASN1_R_ENCODE_ERROR = 112; + ASN1_R_ERROR_GETTING_TIME = 173; + ASN1_R_ERROR_LOADING_SECTION = 172; + ASN1_R_ERROR_SETTING_CIPHER_PARAMS = 114; + ASN1_R_EXPECTING_AN_INTEGER = 115; + ASN1_R_EXPECTING_AN_OBJECT = 116; + ASN1_R_EXPLICIT_LENGTH_MISMATCH = 119; + ASN1_R_EXPLICIT_TAG_NOT_CONSTRUCTED = 120; + ASN1_R_FIELD_MISSING = 121; + ASN1_R_FIRST_NUM_TOO_LARGE = 122; + ASN1_R_HEADER_TOO_LONG = 123; + ASN1_R_ILLEGAL_BITSTRING_FORMAT = 175; + ASN1_R_ILLEGAL_BOOLEAN = 176; + ASN1_R_ILLEGAL_CHARACTERS = 124; + ASN1_R_ILLEGAL_FORMAT = 177; + ASN1_R_ILLEGAL_HEX = 178; + ASN1_R_ILLEGAL_IMPLICIT_TAG = 179; + ASN1_R_ILLEGAL_INTEGER = 180; + ASN1_R_ILLEGAL_NEGATIVE_VALUE = 226; + ASN1_R_ILLEGAL_NESTED_TAGGING = 181; + ASN1_R_ILLEGAL_NULL = 125; + ASN1_R_ILLEGAL_NULL_VALUE = 182; + ASN1_R_ILLEGAL_OBJECT = 183; + ASN1_R_ILLEGAL_OPTIONAL_ANY = 126; + ASN1_R_ILLEGAL_OPTIONS_ON_ITEM_TEMPLATE = 170; + ASN1_R_ILLEGAL_PADDING = 221; + ASN1_R_ILLEGAL_TAGGED_ANY = 127; + ASN1_R_ILLEGAL_TIME_VALUE = 184; + ASN1_R_ILLEGAL_ZERO_CONTENT = 222; + ASN1_R_INTEGER_NOT_ASCII_FORMAT = 185; + ASN1_R_INTEGER_TOO_LARGE_FOR_LONG = 128; + ASN1_R_INVALID_BIT_STRING_BITS_LEFT = 220; + ASN1_R_INVALID_BMPSTRING_LENGTH = 129; + ASN1_R_INVALID_DIGIT = 130; + ASN1_R_INVALID_MIME_TYPE = 205; + ASN1_R_INVALID_MODIFIER = 186; + ASN1_R_INVALID_NUMBER = 187; + ASN1_R_INVALID_OBJECT_ENCODING = 216; + ASN1_R_INVALID_SCRYPT_PARAMETERS = 227; + ASN1_R_INVALID_SEPARATOR = 131; + ASN1_R_INVALID_STRING_TABLE_VALUE = 218; + ASN1_R_INVALID_UNIVERSALSTRING_LENGTH = 133; + ASN1_R_INVALID_UTF8STRING = 134; + ASN1_R_INVALID_VALUE = 219; + ASN1_R_LIST_ERROR = 188; + ASN1_R_MIME_NO_CONTENT_TYPE = 206; + ASN1_R_MIME_PARSE_ERROR = 207; + ASN1_R_MIME_SIG_PARSE_ERROR = 208; + ASN1_R_MISSING_EOC = 137; + ASN1_R_MISSING_SECOND_NUMBER = 138; + ASN1_R_MISSING_VALUE = 189; + ASN1_R_MSTRING_NOT_UNIVERSAL = 139; + ASN1_R_MSTRING_WRONG_TAG = 140; + ASN1_R_NESTED_ASN1_STRING = 197; + ASN1_R_NESTED_TOO_DEEP = 201; + ASN1_R_NON_HEX_CHARACTERS = 141; + ASN1_R_NOT_ASCII_FORMAT = 190; + ASN1_R_NOT_ENOUGH_DATA = 142; + ASN1_R_NO_CONTENT_TYPE = 209; + ASN1_R_NO_MATCHING_CHOICE_TYPE = 143; + ASN1_R_NO_MULTIPART_BODY_FAILURE = 210; + ASN1_R_NO_MULTIPART_BOUNDARY = 211; + ASN1_R_NO_SIG_CONTENT_TYPE = 212; + ASN1_R_NULL_IS_WRONG_LENGTH = 144; + ASN1_R_OBJECT_NOT_ASCII_FORMAT = 191; + ASN1_R_ODD_NUMBER_OF_CHARS = 145; + ASN1_R_SECOND_NUMBER_TOO_LARGE = 147; + ASN1_R_SEQUENCE_LENGTH_MISMATCH = 148; + ASN1_R_SEQUENCE_NOT_CONSTRUCTED = 149; + ASN1_R_SEQUENCE_OR_SET_NEEDS_CONFIG = 192; + ASN1_R_SHORT_LINE = 150; + ASN1_R_SIG_INVALID_MIME_TYPE = 213; + ASN1_R_STREAMING_NOT_SUPPORTED = 202; + ASN1_R_STRING_TOO_LONG = 151; + ASN1_R_STRING_TOO_SHORT = 152; + ASN1_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD = 154; + ASN1_R_TIME_NOT_ASCII_FORMAT = 193; + ASN1_R_TOO_LARGE = 223; + ASN1_R_TOO_LONG = 155; + ASN1_R_TOO_SMALL = 224; + ASN1_R_TYPE_NOT_CONSTRUCTED = 156; + ASN1_R_TYPE_NOT_PRIMITIVE = 195; + ASN1_R_UNEXPECTED_EOC = 159; + ASN1_R_UNIVERSALSTRING_IS_WRONG_LENGTH = 215; + ASN1_R_UNKNOWN_FORMAT = 160; + ASN1_R_UNKNOWN_MESSAGE_DIGEST_ALGORITHM = 161; + ASN1_R_UNKNOWN_OBJECT_TYPE = 162; + ASN1_R_UNKNOWN_PUBLIC_KEY_TYPE = 163; + ASN1_R_UNKNOWN_SIGNATURE_ALGORITHM = 199; + ASN1_R_UNKNOWN_TAG = 194; + ASN1_R_UNSUPPORTED_ANY_DEFINED_BY_TYPE = 164; + ASN1_R_UNSUPPORTED_CIPHER = 228; + ASN1_R_UNSUPPORTED_PUBLIC_KEY_TYPE = 167; + ASN1_R_UNSUPPORTED_TYPE = 196; + ASN1_R_WRONG_INTEGER_TYPE = 225; + ASN1_R_WRONG_PUBLIC_KEY_TYPE = 200; + ASN1_R_WRONG_TAG = 168; + + { The EXTERNALSYM directive is ignored by FPC, however, it is used by Delphi as follows: + + The EXTERNALSYM directive prevents the specified Delphi symbol from appearing in header + files generated for C++. } + + {$EXTERNALSYM ERR_load_ASN1_strings} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +var + ERR_load_ASN1_strings: function : TIdC_INT; cdecl = nil; + +{$ELSE} + function ERR_load_ASN1_strings: TIdC_INT cdecl; external CLibCrypto; + +{$ENDIF} + +implementation + + uses + classes, + IdSSLOpenSSLExceptionHandlers, + IdResourceStringsOpenSSL + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + ,IdSSLOpenSSLLoader + {$ENDIF}; + + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +const + ERR_load_ASN1_strings_procname = 'ERR_load_ASN1_strings'; + + +{$WARN NO_RETVAL OFF} +function ERR_ERR_load_ASN1_strings: TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ERR_load_ASN1_strings_procname); +end; + + + +{$WARN NO_RETVAL ON} + +procedure Load(const ADllHandle: TIdLibHandle; LibVersion: TIdC_UINT; const AFailed: TStringList); + +var FuncLoadError: boolean; + +begin + ERR_load_ASN1_strings := LoadLibFunction(ADllHandle, ERR_load_ASN1_strings_procname); + FuncLoadError := not assigned(ERR_load_ASN1_strings); + if FuncLoadError then + begin + {$if not defined(ERR_load_ASN1_strings_allownil)} + ERR_load_ASN1_strings := @ERR_ERR_load_ASN1_strings; + {$ifend} + {$if declared(ERR_load_ASN1_strings_introduced)} + if LibVersion < ERR_load_ASN1_strings_introduced then + begin + {$if declared(FC_ERR_load_ASN1_strings)} + ERR_load_ASN1_strings := @FC_ERR_load_ASN1_strings; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ERR_load_ASN1_strings_removed)} + if ERR_load_ASN1_strings_removed <= LibVersion then + begin + {$if declared(_ERR_load_ASN1_strings)} + ERR_load_ASN1_strings := @_ERR_load_ASN1_strings; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ERR_load_ASN1_strings_allownil)} + if FuncLoadError then + AFailed.Add('ERR_load_ASN1_strings'); + {$ifend} + end; + + +end; + +procedure Unload; +begin + ERR_load_ASN1_strings := nil; +end; +{$ELSE} +{$ENDIF} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +initialization + Register_SSLLoader(@Load,'LibCrypto'); + Register_SSLUnloader(@Unload); +{$ENDIF} +end. diff --git a/IdOpenSSLHeaders_asn1t.pas b/IdOpenSSLHeaders_asn1t.pas new file mode 100644 index 0000000..6af160e --- /dev/null +++ b/IdOpenSSLHeaders_asn1t.pas @@ -0,0 +1,1216 @@ + (* This unit was generated using the script genOpenSSLHdrs.sh from the source file IdOpenSSLHeaders_asn1t.h2pas + It should not be modified directly. All changes should be made to IdOpenSSLHeaders_asn1t.h2pas + and this file regenerated. IdOpenSSLHeaders_asn1t.h2pas is distributed with the full Indy + Distribution. + *) + +{$i IdCompilerDefines.inc} +{$i IdSSLOpenSSLDefines.inc} +{$IFNDEF USE_OPENSSL} + { error Should not compile if USE_OPENSSL is not defined!!!} +{$ENDIF} +{******************************************************************************} +{ } +{ Indy (Internet Direct) - Internet Protocols Simplified } +{ } +{ https://www.indyproject.org/ } +{ https://gitter.im/IndySockets/Indy } +{ } +{******************************************************************************} +{ } +{ This file is part of the Indy (Internet Direct) project, and is offered } +{ under the dual-licensing agreement described on the Indy website. } +{ (https://www.indyproject.org/license/) } +{ } +{ Copyright: } +{ (c) 1993-2020, Chad Z. Hower and the Indy Pit Crew. All rights reserved. } +{ } +{******************************************************************************} +{ } +{ } +{******************************************************************************} + +unit IdOpenSSLHeaders_asn1t; + +interface + +// Headers for OpenSSL 1.1.1 +// asn1t.h + + +uses + IdCTypes, + IdGlobal, + IdSSLOpenSSLConsts, + IdOpenSSLHeaders_ossl_typ; + +type + // moved from asn1 + ASN1_ITEM_EXP = ASN1_ITEM; + PASN1_ITEM_EXP = ^ASN1_ITEM_EXP; + +//# ifndef OPENSSL_EXPORT_VAR_AS_FUNCTION +// +///// Macro to obtain ASN1_ADB pointer from a type (only used internally) /// +//# define ASN1_ADB_ptr(iptr) ((const ASN1_ADB //)(iptr)) +// +///// Macros for start and end of ASN1_ITEM definition /// +// +//# define ASN1_ITEM_start(itname) \ +// const ASN1_ITEM itname##_it = { +// +//# define static_ASN1_ITEM_start(itname) \ +// static const ASN1_ITEM itname##_it = { +// +//# define ASN1_ITEM_end(itname) \ +// }; +// +//# else +// +///// Macro to obtain ASN1_ADB pointer from a type (only used internally) /// +//# define ASN1_ADB_ptr(iptr) ((const ASN1_ADB //)((iptr)())) +// +///// Macros for start and end of ASN1_ITEM definition /// +// +//# define ASN1_ITEM_start(itname) \ +// const ASN1_ITEM // itname##_it(void) \ +// { \ +// static const ASN1_ITEM local_it = { +// +//# define static_ASN1_ITEM_start(itname) \ +// static ASN1_ITEM_start(itname) +// +//# define ASN1_ITEM_end(itname) \ +// }; \ +// return &local_it; \ +// } +// +//# endif +// +///// Macros to aid ASN1 template writing /// +// +// ASN1_ITEM_TEMPLATE(tname) \ +// static const PASN1_TEMPLATE tname##_item_tt +// +// ASN1_ITEM_TEMPLATE_END(tname) \ +// ;\ +// ASN1_ITEM_start(tname) \ +// ASN1_ITYPE_PRIMITIVE,\ +// -1,\ +// &tname##_item_tt,\ +// 0,\ +// NULL,\ +// 0,\ +// #tname \ +// ASN1_ITEM_end(tname) +// static_ASN1_ITEM_TEMPLATE_END(tname) \ +// ;\ +// static_ASN1_ITEM_start(tname) \ +// ASN1_ITYPE_PRIMITIVE,\ +// -1,\ +// &tname##_item_tt,\ +// 0,\ +// NULL,\ +// 0,\ +// #tname \ +// ASN1_ITEM_end(tname) +// +///// This is a ASN1 type which just embeds a template /// +// +/////- +// // This pair helps declare a SEQUENCE. We can do: +// // +// // ASN1_SEQUENCE(stname) = { +// // ... SEQUENCE components ... +// // } ASN1_SEQUENCE_END(stname) +// // +// // This will produce an ASN1_ITEM called stname_it +// // for a structure called stname. +// // +// // If you want the same structure but a different +// // name then use: +// // +// // ASN1_SEQUENCE(itname) = { +// // ... SEQUENCE components ... +// // } ASN1_SEQUENCE_END_name(stname, itname) +// // +// // This will create an item called itname_it using +// // a structure called stname. +// /// +// +// ASN1_SEQUENCE(tname) \ +// static const PASN1_TEMPLATE tname##_seq_tt[] +// +// ASN1_SEQUENCE_END(stname) ASN1_SEQUENCE_END_name(stname, stname) +// +// static_ASN1_SEQUENCE_END(stname) static_ASN1_SEQUENCE_END_name(stname, stname) +// +// ASN1_SEQUENCE_END_name(stname, tname) \ +// ;\ +// ASN1_ITEM_start(tname) \ +// ASN1_ITYPE_SEQUENCE,\ +// V_ASN1_SEQUENCE,\ +// tname##_seq_tt,\ +// sizeof(tname##_seq_tt) / sizeof(PASN1_TEMPLATE),\ +// NULL,\ +// sizeof(stname),\ +// #tname \ +// ASN1_ITEM_end(tname) +// +// static_ASN1_SEQUENCE_END_name(stname, tname) \ +// ;\ +// static_ASN1_ITEM_start(tname) \ +// ASN1_ITYPE_SEQUENCE,\ +// V_ASN1_SEQUENCE,\ +// tname##_seq_tt,\ +// sizeof(tname##_seq_tt) / sizeof(PASN1_TEMPLATE),\ +// NULL,\ +// sizeof(stname),\ +// #stname \ +// ASN1_ITEM_end(tname) +// +// ASN1_NDEF_SEQUENCE(tname) \ +// ASN1_SEQUENCE(tname) +// +// ASN1_NDEF_SEQUENCE_cb(tname, cb) \ +// ASN1_SEQUENCE_cb(tname, cb) +// +// ASN1_SEQUENCE_cb(tname, cb) \ +// static const ASN1_AUX tname##_aux = {NULL, 0, 0, 0, cb, 0}; \ +// ASN1_SEQUENCE(tname) +// +// ASN1_BROKEN_SEQUENCE(tname) \ +// static const ASN1_AUX tname##_aux = {NULL, ASN1_AFLG_BROKEN, 0, 0, 0, 0}; \ +// ASN1_SEQUENCE(tname) +// +// ASN1_SEQUENCE_ref(tname, cb) \ +// static const ASN1_AUX tname##_aux = {NULL, ASN1_AFLG_REFCOUNT, offsetof(tname, references), offsetof(tname, lock), cb, 0}; \ +// ASN1_SEQUENCE(tname) +// +// ASN1_SEQUENCE_enc(tname, enc, cb) \ +// static const ASN1_AUX tname##_aux = {NULL, ASN1_AFLG_ENCODING, 0, 0, cb, offsetof(tname, enc)}; \ +// ASN1_SEQUENCE(tname) +// +// ASN1_NDEF_SEQUENCE_END(tname) \ +// ;\ +// ASN1_ITEM_start(tname) \ +// ASN1_ITYPE_NDEF_SEQUENCE,\ +// V_ASN1_SEQUENCE,\ +// tname##_seq_tt,\ +// sizeof(tname##_seq_tt) / sizeof(PASN1_TEMPLATE),\ +// NULL,\ +// sizeof(tname),\ +// #tname \ +// ASN1_ITEM_end(tname) +// static_ASN1_NDEF_SEQUENCE_END(tname) \ +// ;\ +// static_ASN1_ITEM_start(tname) \ +// ASN1_ITYPE_NDEF_SEQUENCE,\ +// V_ASN1_SEQUENCE,\ +// tname##_seq_tt,\ +// sizeof(tname##_seq_tt) / sizeof(PASN1_TEMPLATE),\ +// NULL,\ +// sizeof(tname),\ +// #tname \ +// ASN1_ITEM_end(tname) +// +// ASN1_BROKEN_SEQUENCE_END(stname) ASN1_SEQUENCE_END_ref(stname, stname) +// static_ASN1_BROKEN_SEQUENCE_END(stname) \ +// static_ASN1_SEQUENCE_END_ref(stname, stname) +// +// ASN1_SEQUENCE_END_enc(stname, tname) ASN1_SEQUENCE_END_ref(stname, tname) +// +// ASN1_SEQUENCE_END_cb(stname, tname) ASN1_SEQUENCE_END_ref(stname, tname) +// static_ASN1_SEQUENCE_END_cb(stname, tname) static_ASN1_SEQUENCE_END_ref(stname, tname) +// +// ASN1_SEQUENCE_END_ref(stname, tname) \ +// ;\ +// ASN1_ITEM_start(tname) \ +// ASN1_ITYPE_SEQUENCE,\ +// V_ASN1_SEQUENCE,\ +// tname##_seq_tt,\ +// sizeof(tname##_seq_tt) / sizeof(PASN1_TEMPLATE),\ +// &tname##_aux,\ +// sizeof(stname),\ +// #tname \ +// ASN1_ITEM_end(tname) +// static_ASN1_SEQUENCE_END_ref(stname, tname) \ +// ;\ +// static_ASN1_ITEM_start(tname) \ +// ASN1_ITYPE_SEQUENCE,\ +// V_ASN1_SEQUENCE,\ +// tname##_seq_tt,\ +// sizeof(tname##_seq_tt) / sizeof(PASN1_TEMPLATE),\ +// &tname##_aux,\ +// sizeof(stname),\ +// #stname \ +// ASN1_ITEM_end(tname) +// +// ASN1_NDEF_SEQUENCE_END_cb(stname, tname) \ +// ;\ +// ASN1_ITEM_start(tname) \ +// ASN1_ITYPE_NDEF_SEQUENCE,\ +// V_ASN1_SEQUENCE,\ +// tname##_seq_tt,\ +// sizeof(tname##_seq_tt) / sizeof(PASN1_TEMPLATE),\ +// &tname##_aux,\ +// sizeof(stname),\ +// #stname \ +// ASN1_ITEM_end(tname) +// +/////- +// // This pair helps declare a CHOICE type. We can do: +// // +// // ASN1_CHOICE(chname) = { +// // ... CHOICE options ... +// // ASN1_CHOICE_END(chname) +// // +// // This will produce an ASN1_ITEM called chname_it +// // for a structure called chname. The structure +// // definition must look like this: +// // typedef struct { +// // int type; +// // union { +// // ASN1_SOMETHING //opt1; +// // ASN1_SOMEOTHER //opt2; +// // } value; +// // } chname; +// // +// // the name of the selector must be 'type'. +// // to use an alternative selector name use the +// // ASN1_CHOICE_END_selector() version. +// /// +// +// ASN1_CHOICE(tname) \ +// static const PASN1_TEMPLATE tname##_ch_tt[] +// +// ASN1_CHOICE_cb(tname, cb) \ +// static const ASN1_AUX tname##_aux = {NULL, 0, 0, 0, cb, 0}; \ +// ASN1_CHOICE(tname) +// +// ASN1_CHOICE_END(stname) ASN1_CHOICE_END_name(stname, stname) +// +// static_ASN1_CHOICE_END(stname) static_ASN1_CHOICE_END_name(stname, stname) +// +// ASN1_CHOICE_END_name(stname, tname) ASN1_CHOICE_END_selector(stname, tname, type) +// +// static_ASN1_CHOICE_END_name(stname, tname) static_ASN1_CHOICE_END_selector(stname, tname, type) +// +// ASN1_CHOICE_END_selector(stname, tname, selname) \ +// ;\ +// ASN1_ITEM_start(tname) \ +// ASN1_ITYPE_CHOICE,\ +// offsetof(stname,selname) ,\ +// tname##_ch_tt,\ +// sizeof(tname##_ch_tt) / sizeof(PASN1_TEMPLATE),\ +// NULL,\ +// sizeof(stname),\ +// #stname \ +// ASN1_ITEM_end(tname) +// +// static_ASN1_CHOICE_END_selector(stname, tname, selname) \ +// ;\ +// static_ASN1_ITEM_start(tname) \ +// ASN1_ITYPE_CHOICE,\ +// offsetof(stname,selname) ,\ +// tname##_ch_tt,\ +// sizeof(tname##_ch_tt) / sizeof(PASN1_TEMPLATE),\ +// NULL,\ +// sizeof(stname),\ +// #stname \ +// ASN1_ITEM_end(tname) +// +// ASN1_CHOICE_END_cb(stname, tname, selname) \ +// ;\ +// ASN1_ITEM_start(tname) \ +// ASN1_ITYPE_CHOICE,\ +// offsetof(stname,selname) ,\ +// tname##_ch_tt,\ +// sizeof(tname##_ch_tt) / sizeof(PASN1_TEMPLATE),\ +// &tname##_aux,\ +// sizeof(stname),\ +// #stname \ +// ASN1_ITEM_end(tname) +// +///// This helps with the template wrapper form of ASN1_ITEM /// +// +// ASN1_EX_TEMPLATE_TYPE(flags, tag, name, type) { \ +// (flags), (tag), 0,\ +// #name, ASN1_ITEM_ref(type) } +// +///// These help with SEQUENCE or CHOICE components /// +// +///// used to declare other types /// +// +// ASN1_EX_TYPE(flags, tag, stname, field, type) { \ +// (flags), (tag), offsetof(stname, field),\ +// #field, ASN1_ITEM_ref(type) } +// +///// implicit and explicit helper macros /// +// +// ASN1_IMP_EX(stname, field, type, tag, ex) \ +// ASN1_EX_TYPE(ASN1_TFLG_IMPLICIT | (ex), tag, stname, field, type) +// +// ASN1_EXP_EX(stname, field, type, tag, ex) \ +// ASN1_EX_TYPE(ASN1_TFLG_EXPLICIT | (ex), tag, stname, field, type) +// +///// Any defined by macros: the field used is in the table itself /// +// +//# ifndef OPENSSL_EXPORT_VAR_AS_FUNCTION +//# define ASN1_ADB_OBJECT(tblname) { ASN1_TFLG_ADB_OID, -1, 0, #tblname, (const ASN1_ITEM //)&(tblname##_adb) } +//# define ASN1_ADB_INTEGER(tblname) { ASN1_TFLG_ADB_INT, -1, 0, #tblname, (const ASN1_ITEM //)&(tblname##_adb) } +//# else +//# define ASN1_ADB_OBJECT(tblname) { ASN1_TFLG_ADB_OID, -1, 0, #tblname, tblname##_adb } +//# define ASN1_ADB_INTEGER(tblname) { ASN1_TFLG_ADB_INT, -1, 0, #tblname, tblname##_adb } +//# endif +///// Plain simple type /// +// ASN1_SIMPLE(stname, field, type) ASN1_EX_TYPE(0,0, stname, field, type) +///// Embedded simple type /// +// ASN1_EMBED(stname, field, type) ASN1_EX_TYPE(ASN1_TFLG_EMBED,0, stname, field, type) +// +///// OPTIONAL simple type /// +// ASN1_OPT(stname, field, type) ASN1_EX_TYPE(ASN1_TFLG_OPTIONAL, 0, stname, field, type) +// ASN1_OPT_EMBED(stname, field, type) ASN1_EX_TYPE(ASN1_TFLG_OPTIONAL|ASN1_TFLG_EMBED, 0, stname, field, type) +// +///// IMPLICIT tagged simple type /// +// ASN1_IMP(stname, field, type, tag) ASN1_IMP_EX(stname, field, type, tag, 0) +// ASN1_IMP_EMBED(stname, field, type, tag) ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_EMBED) +// +///// IMPLICIT tagged OPTIONAL simple type /// +// ASN1_IMP_OPT(stname, field, type, tag) ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL) +// ASN1_IMP_OPT_EMBED(stname, field, type, tag) ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL|ASN1_TFLG_EMBED) +// +///// Same as above but EXPLICIT /// +// +// ASN1_EXP(stname, field, type, tag) ASN1_EXP_EX(stname, field, type, tag, 0) +// ASN1_EXP_EMBED(stname, field, type, tag) ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_EMBED) +// ASN1_EXP_OPT(stname, field, type, tag) ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL) +// ASN1_EXP_OPT_EMBED(stname, field, type, tag) ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL|ASN1_TFLG_EMBED) +// +///// SEQUENCE OF type /// +// ASN1_SEQUENCE_OF(stname, field, type) \ +// ASN1_EX_TYPE(ASN1_TFLG_SEQUENCE_OF, 0, stname, field, type) +// +///// OPTIONAL SEQUENCE OF /// +// ASN1_SEQUENCE_OF_OPT(stname, field, type) \ +// ASN1_EX_TYPE(ASN1_TFLG_SEQUENCE_OF|ASN1_TFLG_OPTIONAL, 0, stname, field, type) +// +///// Same as above but for SET OF /// +// +// ASN1_SET_OF(stname, field, type) \ +// ASN1_EX_TYPE(ASN1_TFLG_SET_OF, 0, stname, field, type) +// +// ASN1_SET_OF_OPT(stname, field, type) \ +// ASN1_EX_TYPE(ASN1_TFLG_SET_OF|ASN1_TFLG_OPTIONAL, 0, stname, field, type) +// +///// Finally compound types of SEQUENCE, SET, IMPLICIT, EXPLICIT and OPTIONAL /// +// +// ASN1_IMP_SET_OF(stname, field, type, tag) \ +// ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_SET_OF) +// +// ASN1_EXP_SET_OF(stname, field, type, tag) \ +// ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_SET_OF) +// +// ASN1_IMP_SET_OF_OPT(stname, field, type, tag) \ +// ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_SET_OF|ASN1_TFLG_OPTIONAL) +// +// ASN1_EXP_SET_OF_OPT(stname, field, type, tag) \ +// ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_SET_OF|ASN1_TFLG_OPTIONAL) +// +// ASN1_IMP_SEQUENCE_OF(stname, field, type, tag) \ +// ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_SEQUENCE_OF) +// +// ASN1_IMP_SEQUENCE_OF_OPT(stname, field, type, tag) \ +// ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_SEQUENCE_OF|ASN1_TFLG_OPTIONAL) +// +// ASN1_EXP_SEQUENCE_OF(stname, field, type, tag) \ +// ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_SEQUENCE_OF) +// +// ASN1_EXP_SEQUENCE_OF_OPT(stname, field, type, tag) \ +// ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_SEQUENCE_OF|ASN1_TFLG_OPTIONAL) +// +///// EXPLICIT using indefinite length constructed form /// +// ASN1_NDEF_EXP(stname, field, type, tag) \ +// ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_NDEF) +// +///// EXPLICIT OPTIONAL using indefinite length constructed form /// +// ASN1_NDEF_EXP_OPT(stname, field, type, tag) \ +// ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL|ASN1_TFLG_NDEF) +// +///// Macros for the ASN1_ADB structure /// +// +// ASN1_ADB(name) \ +// static const ASN1_ADB_TABLE name##_adbtbl[] +// +//# ifndef OPENSSL_EXPORT_VAR_AS_FUNCTION +// +//# define ASN1_ADB_END(name, flags, field, adb_cb, def, none) \ +// ;\ +// static const ASN1_ADB name##_adb = {\ +// flags,\ +// offsetof(name, field),\ +// adb_cb,\ +// name##_adbtbl,\ +// sizeof(name##_adbtbl) / sizeof(ASN1_ADB_TABLE),\ +// def,\ +// none\ +// } +// +//# else +// +//# define ASN1_ADB_END(name, flags, field, adb_cb, def, none) \ +// ;\ +// static const ASN1_ITEM //name##_adb(void) \ +// { \ +// static const ASN1_ADB internal_adb = \ +// {\ +// flags,\ +// offsetof(name, field),\ +// adb_cb,\ +// name##_adbtbl,\ +// sizeof(name##_adbtbl) / sizeof(ASN1_ADB_TABLE),\ +// def,\ +// none\ +// }; \ +// return (const ASN1_ITEM //) &internal_adb; \ +// } \ +// void dummy_function(void) +// +//# endif +// +// ADB_ENTRY(val, template) {val, template} +// +// ASN1_ADB_TEMPLATE(name) \ +// static const PASN1_TEMPLATE name##_tt +// +///// +// // This is the ASN1 template structure that defines a wrapper round the +// // actual type. It determines the actual position of the field in the value +// // structure, various flags such as OPTIONAL and the field name. +// /// + +type + ASN1_TEMPLATE_st = record + flags: TIdC_ULONG; + tag: TIdC_LONG; + offset: TIdC_ULONG; + fieldname: PIdAnsiChar; + item: PASN1_ITEM_EXP; + end; + ASN1_TEMPLATE = ASN1_TEMPLATE_st; + PASN1_TEMPLATE = ^ASN1_TEMPLATE; + +///// Macro to extract ASN1_ITEM and ASN1_ADB pointer from PASN1_TEMPLATE /// +// +// ASN1_TEMPLATE_item(t) (t->item_ptr) +// ASN1_TEMPLATE_adb(t) (t->item_ptr) + + adb_cb_callback = function(psel: PIdC_LONG): TIdC_INT; + + ASN1_ADB_TABLE_st = record + value: TIdC_LONG; + tt: PASN1_TEMPLATE; + end; + + ASN1_ADB_TABLE = ASN1_ADB_TABLE_st; + PASN1_ADB_TABLE = ^ASN1_ADB_TABLE; + + ASN1_ADB_st = record + flags: TIdC_ULONG; + offset: TIdC_ULONG; + adb_cb: adb_cb_callback; + tbl: PASN1_ADB_TABLE; + tblcount: TIdC_LONG; + default_tt: PASN1_TEMPLATE; + null_tt: PASN1_TEMPLATE; + end; + ASN1_ADB = ASN1_ADB_st; + +const +// template flags // + +// Field is optional // + ASN1_TFLG_OPTIONAL = $1; + +// Field is a SET OF // + ASN1_TFLG_SET_OF = ($1 shl 1); + +// Field is a SEQUENCE OF // + ASN1_TFLG_SEQUENCE_OF = ($2 shl 1); + +// +// Special case: this refers to a SET OF that will be sorted into DER order +// when encoded /and/ the corresponding STACK will be modified to match the +// new order. + // + ASN1_TFLG_SET_ORDER = ($3 shl 1); + +// Mask for SET OF or SEQUENCE OF // + ASN1_TFLG_SK_MASK = ($3 shl 1); + +// +// These flags mean the tag should be taken from the tag field. If EXPLICIT +// then the underlying type is used for the inner tag. + // + +// IMPLICIT tagging // + ASN1_TFLG_IMPTAG = ($1 shl 3); + +// EXPLICIT tagging, inner tag from underlying type // + ASN1_TFLG_EXPTAG = ($2 shl 3); + + ASN1_TFLG_TAG_MASK = ($3 shl 3); + +// context specific IMPLICIT // +// ASN1_TFLG_IMPLICIT (ASN1_TFLG_IMPTAG|ASN1_TFLG_CONTEXT) + +// context specific EXPLICIT // +// ASN1_TFLG_EXPLICIT (ASN1_TFLG_EXPTAG|ASN1_TFLG_CONTEXT) + +// +// If tagging is in force these determine the type of tag to use. Otherwise +// the tag is determined by the underlying type. These values reflect the +// actual octet format. + // + +// Universal tag // + ASN1_TFLG_UNIVERSAL = ($0 shl 6); +// Application tag // + ASN1_TFLG_APPLICATION = ($1 shl 6); +// Context specific tag // + ASN1_TFLG_CONTEXT = ($2 shl 6); +// Private tag // + ASN1_TFLG_PRIVATE = ($3 shl 6); + + ASN1_TFLG_TAG_CLASS = ($3 shl 6); + +// +// These are for ANY DEFINED BY type. In this case the 'item' field points to +// an ASN1_ADB structure which contains a table of values to decode the +// relevant type + // + + ASN1_TFLG_ADB_MASK = ($3 shl 8); + + ASN1_TFLG_ADB_OID = ($1 shl 8); + + ASN1_TFLG_ADB_INT = ($1 shl 9); + +// +// This flag when present in a SEQUENCE OF, SET OF or EXPLICIT causes +// indefinite length constructed encoding to be used if required. + // + + ASN1_TFLG_NDEF = ($1 shl 11); + +// Field is embedded and not a pointer // + ASN1_TFLG_EMBED = ($1 shl 12); + +// This is the actual ASN1 item itself // + +type + ASN1_ITEM_st = record + itype: AnsiChar; + utype: TIdC_LONG; + template: PASN1_TEMPLATE; + tcount: TIdC_LONG; + funcs: Pointer; + size: TIdC_LONG; + sname: PIdAnsiChar; + end; + +//- + // These are values for the itype field and + // determine how the type is interpreted. + // + // For PRIMITIVE types the underlying type + // determines the behaviour if items is NULL. + // + // Otherwise templates must contain a single + // template and the type is treated in the + // same way as the type specified in the template. + // + // For SEQUENCE types the templates field points + // to the members, the size field is the + // structure size. + // + // For CHOICE types the templates field points + // to each possible member (typically a union) + // and the 'size' field is the offset of the + // selector. + // + // The 'funcs' field is used for application + // specific functions. + // + // The EXTERN type uses a new style d2i/i2d. + // The new style should be used where possible + // because it avoids things like the d2i IMPLICIT + // hack. + // + // MSTRING is a multiple string type, it is used + // for a CHOICE of character strings where the + // actual strings all occupy an ASN1_STRING + // structure. In this case the 'utype' field + // has a special meaning, it is used as a mask + // of acceptable types using the B_ASN1 constants. + // + // NDEF_SEQUENCE is the same as SEQUENCE except + // that it will use indefinite length constructed + // encoding if requested. + // + // +const + ASN1_ITYPE_PRIMITIVE = $0; + + ASN1_ITYPE_SEQUENCE = $1; + + ASN1_ITYPE_CHOICE = $2; + + ASN1_ITYPE_EXTERN = $4; + + ASN1_ITYPE_MSTRING = $5; + + ASN1_ITYPE_NDEF_SEQUENCE = $6; + +// + // Cache for ASN1 tag and length, so we don't keep re-reading it for things + // like CHOICE + // + +type + ASN1_TLC_st = record + valid: AnsiChar; + ret: TIdC_INT; + plen: TIdC_LONG; + ptag: TIdC_INT; + pclass: TIdC_INT; + hdrlen: TIdC_INT; + end; + ASN1_TLC = ASN1_TLC_st; + PASN1_TLC = ^ASN1_TLC; + + ASN1_ex_d2i = function(pval: PPASN1_VALUE; const AIn: PPByte; len: TIdC_LONG; + const it: PASN1_ITEM; tag: TIdC_INT; aclass: TIdC_INT; + opt: AnsiChar; ctx: PASN1_TLC): TIdC_INT; + PASN1_ex_d2i = ^ASN1_ex_d2i; + + ASN1_ex_i2d = function(pval: PPASN1_VALUE; AOut: PPByte; const it: PASN1_ITEM; + tag: TIdC_INT; aclass: TIdC_INT): TIdC_INT; + PASN1_ex_i2d = ^ASN1_ex_i2d; + + ASN1_ex_new_func = function(pval: PPASN1_VALUE; const it: PASN1_ITEM): TIdC_INT; + PASN1_ex_new_func = ^ASN1_ex_new_func; + + ASN1_ex_free_func = procedure(pval: PPASN1_VALUE; const it: PASN1_ITEM); + PASN1_ex_free_func = ^ASN1_ex_free_func; + + ASN1_ex_print_func = function(AOut: PBIO; pval: PPASN1_VALUE; indent: TIdC_INT; + const fname: PIdAnsiChar; const pctx: PASN1_PCTX): TIdC_INT; + PASN1_ex_print_func = ^ASN1_ex_print_func; + + ASN1_primitive_i2c = function(pval: PPASN1_VALUE; const cont: PIdAnsiChar; + puttype: PIdC_INT; const it: PASN1_ITEM): TIdC_INT; + PASN1_primitive_i2c = ^ASN1_primitive_i2c; + + ASN1_primitive_c2i = function(pval: PPASN1_VALUE; const cont: PByte; + len: TIdC_INT; utype: TIdC_INT; free_cont: PIdAnsiChar; + const it: PASN1_ITEM): TIdC_INT; + PASN1_primitive_c2i = ^ASN1_primitive_c2i; + + ASN1_primitive_print = function(AOut: PBIO; pval: PPASN1_VALUE; + const it: PASN1_ITEM; indent: TIdC_INT; const pctx: PASN1_PCTX): TIdC_INT; + PASN1_primitive_print = ^ASN1_primitive_print; + + ASN1_EXTERN_FUNCS_st = record + app_data: Pointer; + asn1_ex_new: PASN1_ex_new_func; + asn1_ex_free: PASN1_ex_free_func; + asn1_ex_clear: PASN1_ex_free_func; + asn1_ex_d2i: PASN1_ex_d2i; + asn1_ex_i2d: PASN1_ex_i2d; + asn1_ex_print: PASN1_ex_print_func; + end; + + ASN1_EXTERN_FUNCS = ASN1_EXTERN_FUNCS_st; + + ASN1_PRIMITIVE_FUNCS_st = record + app_data: Pointer; + flags: TIdC_ULONG; + prim_new: PASN1_ex_new_func; + prim_free: PASN1_ex_free_func; + prim_clear: PASN1_ex_free_func; + prim_c2i: PASN1_primitive_c2i; + prim_i2c: PASN1_primitive_i2c; + prim_print: PASN1_primitive_print; + end; + + ASN1_PRIMITIVE_FUNCS = ASN1_PRIMITIVE_FUNCS_st; + +// + // This is the ASN1_AUX structure: it handles various miscellaneous + // requirements. For example the use of reference counts and an informational + // callback. The "informational callback" is called at various points during + // the ASN1 encoding and decoding. It can be used to provide minor + // customisation of the structures used. This is most useful where the + // supplied routines //almost// do the right thing but need some extra help at + // a few points. If the callback returns zero then it is assumed a fatal + // error has occurred and the main operation should be abandoned. If major + // changes in the default behaviour are required then an external type is + // more appropriate. + // + + ASN1_aux_cb = function(operation: TIdC_INT; AIn: PASN1_VALUE; const it: PASN1_ITEM; exarg: Pointer): TIdC_INT; + PASN1_aux_cb = ^ASN1_aux_cb; + + ASN1_AUX_st = record + app_data: Pointer; + flags: TIdC_INT; + ref_offset: TIdC_INT; + ref_lock: TIdC_INT; + asn1_cb: PASN1_aux_cb; + enc_offset: TidC_INT; + end; + + ASN1_AUX = ASN1_AUX_st; + +// For print related callbacks exarg points to this structure + + ASN1_PRINT_ARG_st = record + AOut: PBIO; + indent: TIdC_INT; + pctx: PASN1_PCTX; + end; + + ASN1_PRINT_ARG = ASN1_PRINT_ARG_st; + +// For streaming related callbacks exarg points to this structure + ASN1_STREAM_ARG_st = record + // BIO to stream through + FOut: PBIO; + // BIO with filters appended + ndef_bio: PBIO; + // Streaming I/O boundary + boundary: PPByte; + end; + + ASN1_STREAM_ARG = ASN1_STREAM_ARG_st; + +const +/// Flags in ASN1_AUX /// + +/// Use a reference count /// + ASN1_AFLG_REFCOUNT = 1; +/// Save the encoding of structure (useful for signatures) /// + ASN1_AFLG_ENCODING = 2; +/// The Sequence length is invalid /// + ASN1_AFLG_BROKEN = 4; + +/// operation values for asn1_cb /// + + ASN1_OP_NEW_PRE = 0; + ASN1_OP_NEW_POST = 1; + ASN1_OP_FREE_PRE = 2; + ASN1_OP_FREE_POST = 3; + ASN1_OP_D2I_PRE = 4; + ASN1_OP_D2I_POST = 5; + ASN1_OP_I2D_PRE = 6; + ASN1_OP_I2D_POST = 7; + ASN1_OP_PRINT_PRE = 8; + ASN1_OP_PRINT_POST = 9; + ASN1_OP_STREAM_PRE = 10; + ASN1_OP_STREAM_POST = 11; + ASN1_OP_DETACHED_PRE = 12; + ASN1_OP_DETACHED_POST = 13; + +///* Macro to implement a primitive type */ +//# define IMPLEMENT_ASN1_TYPE(stname) IMPLEMENT_ASN1_TYPE_ex(stname, stname, 0) +//# define IMPLEMENT_ASN1_TYPE_ex(itname, vname, ex) \ +// ASN1_ITEM_start(itname) \ +// ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \ +// ASN1_ITEM_end(itname) +// +///* Macro to implement a multi string type */ +//# define IMPLEMENT_ASN1_MSTRING(itname, mask) \ +// ASN1_ITEM_start(itname) \ +// ASN1_ITYPE_MSTRING, mask, NULL, 0, NULL, sizeof(ASN1_STRING), #itname \ +// ASN1_ITEM_end(itname) +// +//# define IMPLEMENT_EXTERN_ASN1(sname, tag, fptrs) \ +// ASN1_ITEM_start(sname) \ +// ASN1_ITYPE_EXTERN, \ +// tag, \ +// NULL, \ +// 0, \ +// &fptrs, \ +// 0, \ +// #sname \ +// ASN1_ITEM_end(sname) +// +///* Macro to implement standard functions in terms of ASN1_ITEM structures */ +// +//# define IMPLEMENT_ASN1_FUNCTIONS(stname) IMPLEMENT_ASN1_FUNCTIONS_fname(stname, stname, stname) +// +//# define IMPLEMENT_ASN1_FUNCTIONS_name(stname, itname) IMPLEMENT_ASN1_FUNCTIONS_fname(stname, itname, itname) +// +//# define IMPLEMENT_ASN1_FUNCTIONS_ENCODE_name(stname, itname) \ +// IMPLEMENT_ASN1_FUNCTIONS_ENCODE_fname(stname, itname, itname) +// +//# define IMPLEMENT_STATIC_ASN1_ALLOC_FUNCTIONS(stname) \ +// IMPLEMENT_ASN1_ALLOC_FUNCTIONS_pfname(static, stname, stname, stname) +// +//# define IMPLEMENT_ASN1_ALLOC_FUNCTIONS(stname) \ +// IMPLEMENT_ASN1_ALLOC_FUNCTIONS_fname(stname, stname, stname) +// +//# define IMPLEMENT_ASN1_ALLOC_FUNCTIONS_pfname(pre, stname, itname, fname) \ +// pre stname *fname##_new(void) \ +// { \ +// return (stname *)ASN1_item_new(ASN1_ITEM_rptr(itname)); \ +// } \ +// pre void fname##_free(stname *a) \ +// { \ +// ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \ +// } +// +//# define IMPLEMENT_ASN1_ALLOC_FUNCTIONS_fname(stname, itname, fname) \ +// stname *fname##_new(void) \ +// { \ +// return (stname *)ASN1_item_new(ASN1_ITEM_rptr(itname)); \ +// } \ +// void fname##_free(stname *a) \ +// { \ +// ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \ +// } +// +//# define IMPLEMENT_ASN1_FUNCTIONS_fname(stname, itname, fname) \ +// IMPLEMENT_ASN1_ENCODE_FUNCTIONS_fname(stname, itname, fname) \ +// IMPLEMENT_ASN1_ALLOC_FUNCTIONS_fname(stname, itname, fname) +// +//# define IMPLEMENT_ASN1_ENCODE_FUNCTIONS_fname(stname, itname, fname) \ +// stname *d2i_##fname(stname **a, const unsigned char **in, long len) \ +// { \ +// return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\ +// } \ +// int i2d_##fname(stname *a, unsigned char **out) \ +// { \ +// return ASN1_item_i2d((ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\ +// } +// +//# define IMPLEMENT_ASN1_NDEF_FUNCTION(stname) \ +// int i2d_##stname##_NDEF(stname *a, unsigned char **out) \ +// { \ +// return ASN1_item_ndef_i2d((ASN1_VALUE *)a, out, ASN1_ITEM_rptr(stname));\ +// } +// +//# define IMPLEMENT_STATIC_ASN1_ENCODE_FUNCTIONS(stname) \ +// static stname *d2i_##stname(stname **a, \ +// const unsigned char **in, long len) \ +// { \ +// return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, \ +// ASN1_ITEM_rptr(stname)); \ +// } \ +// static int i2d_##stname(stname *a, unsigned char **out) \ +// { \ +// return ASN1_item_i2d((ASN1_VALUE *)a, out, \ +// ASN1_ITEM_rptr(stname)); \ +// } +// +///* +// * This includes evil casts to remove const: they will go away when full ASN1 +// * constification is done. +// */ +//# define IMPLEMENT_ASN1_ENCODE_FUNCTIONS_const_fname(stname, itname, fname) \ +// stname *d2i_##fname(stname **a, const unsigned char **in, long len) \ +// { \ +// return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\ +// } \ +// int i2d_##fname(const stname *a, unsigned char **out) \ +// { \ +// return ASN1_item_i2d((ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\ +// } +// +//# define IMPLEMENT_ASN1_DUP_FUNCTION(stname) \ +// stname * stname##_dup(stname *x) \ +// { \ +// return ASN1_item_dup(ASN1_ITEM_rptr(stname), x); \ +// } +// +//# define IMPLEMENT_ASN1_PRINT_FUNCTION(stname) \ +// IMPLEMENT_ASN1_PRINT_FUNCTION_fname(stname, stname, stname) +// +//# define IMPLEMENT_ASN1_PRINT_FUNCTION_fname(stname, itname, fname) \ +// int fname##_print_ctx(BIO *out, stname *x, int indent, \ +// const ASN1_PCTX *pctx) \ +// { \ +// return ASN1_item_print(out, (ASN1_VALUE *)x, indent, \ +// ASN1_ITEM_rptr(itname), pctx); \ +// } +// +//# define IMPLEMENT_ASN1_FUNCTIONS_const(name) \ +// IMPLEMENT_ASN1_FUNCTIONS_const_fname(name, name, name) +// +//# define IMPLEMENT_ASN1_FUNCTIONS_const_fname(stname, itname, fname) \ +// IMPLEMENT_ASN1_ENCODE_FUNCTIONS_const_fname(stname, itname, fname) \ +// IMPLEMENT_ASN1_ALLOC_FUNCTIONS_fname(stname, itname, fname) +// +//* external definitions for primitive types */ + +//DECLARE_ASN1_ITEM(ASN1_BOOLEAN) +//DECLARE_ASN1_ITEM(ASN1_TBOOLEAN) +//DECLARE_ASN1_ITEM(ASN1_FBOOLEAN) +//DECLARE_ASN1_ITEM(ASN1_SEQUENCE) +//DECLARE_ASN1_ITEM(CBIGNUM) +//DECLARE_ASN1_ITEM(BIGNUM) +//DECLARE_ASN1_ITEM(INT32) +//DECLARE_ASN1_ITEM(ZINT32) +//DECLARE_ASN1_ITEM(UINT32) +//DECLARE_ASN1_ITEM(ZUINT32) +//DECLARE_ASN1_ITEM(INT64) +//DECLARE_ASN1_ITEM(ZINT64) +//DECLARE_ASN1_ITEM(UINT64) +//DECLARE_ASN1_ITEM(ZUINT64) + +//# if OPENSSL_API_COMPAT < 0x10200000L +///* +// * LONG and ZLONG are strongly discouraged for use as stored data, as the +// * underlying C type (long) differs in size depending on the architecture. +// * They are designed with 32-bit longs in mind. +// */ +//DECLARE_ASN1_ITEM(LONG) +//DECLARE_ASN1_ITEM(ZLONG) +//# endif + +//DEFINE_STACK_OF(ASN1_VALUE) + +//* Functions used internally by the ASN1 code */ + + { The EXTERNALSYM directive is ignored by FPC, however, it is used by Delphi as follows: + + The EXTERNALSYM directive prevents the specified Delphi symbol from appearing in header + files generated for C++. } + + {$EXTERNALSYM ASN1_item_ex_new} + {$EXTERNALSYM ASN1_item_ex_free} + {$EXTERNALSYM ASN1_item_ex_d2i} + {$EXTERNALSYM ASN1_item_ex_i2d} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +var + ASN1_item_ex_new: function (pval: PPASN1_VALUE; const it: PASN1_ITEM): TIdC_INT; cdecl = nil; + ASN1_item_ex_free: procedure (pval: PPASN1_VALUE; const it: PASN1_ITEM); cdecl = nil; + + ASN1_item_ex_d2i: function (pval: PPASN1_VALUE; const AIn: PPByte; len: TIdC_LONG; const it: PASN1_ITEM; tag: TIdC_INT; aclass: TIdC_INT; opt: AnsiChar; ctx: PASN1_TLC): TIdC_INT; cdecl = nil; + + ASN1_item_ex_i2d: function (pval: PPASN1_VALUE; AOut: PPByte; const it: PASN1_ITEM; tag: TIdC_INT; aclass: TIdC_INT): TIdC_INT; cdecl = nil; + +{$ELSE} + function ASN1_item_ex_new(pval: PPASN1_VALUE; const it: PASN1_ITEM): TIdC_INT cdecl; external CLibCrypto; + procedure ASN1_item_ex_free(pval: PPASN1_VALUE; const it: PASN1_ITEM) cdecl; external CLibCrypto; + + function ASN1_item_ex_d2i(pval: PPASN1_VALUE; const AIn: PPByte; len: TIdC_LONG; const it: PASN1_ITEM; tag: TIdC_INT; aclass: TIdC_INT; opt: AnsiChar; ctx: PASN1_TLC): TIdC_INT cdecl; external CLibCrypto; + + function ASN1_item_ex_i2d(pval: PPASN1_VALUE; AOut: PPByte; const it: PASN1_ITEM; tag: TIdC_INT; aclass: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + +{$ENDIF} + +implementation + + uses + classes, + IdSSLOpenSSLExceptionHandlers, + IdResourceStringsOpenSSL + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + ,IdSSLOpenSSLLoader + {$ENDIF}; + + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +const + ASN1_item_ex_new_procname = 'ASN1_item_ex_new'; + ASN1_item_ex_free_procname = 'ASN1_item_ex_free'; + + ASN1_item_ex_d2i_procname = 'ASN1_item_ex_d2i'; + + ASN1_item_ex_i2d_procname = 'ASN1_item_ex_i2d'; + + +{$WARN NO_RETVAL OFF} +function ERR_ASN1_item_ex_new(pval: PPASN1_VALUE; const it: PASN1_ITEM): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_item_ex_new_procname); +end; + + +procedure ERR_ASN1_item_ex_free(pval: PPASN1_VALUE; const it: PASN1_ITEM); +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_item_ex_free_procname); +end; + + + +function ERR_ASN1_item_ex_d2i(pval: PPASN1_VALUE; const AIn: PPByte; len: TIdC_LONG; const it: PASN1_ITEM; tag: TIdC_INT; aclass: TIdC_INT; opt: AnsiChar; ctx: PASN1_TLC): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_item_ex_d2i_procname); +end; + + + +function ERR_ASN1_item_ex_i2d(pval: PPASN1_VALUE; AOut: PPByte; const it: PASN1_ITEM; tag: TIdC_INT; aclass: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_item_ex_i2d_procname); +end; + + + +{$WARN NO_RETVAL ON} + +procedure Load(const ADllHandle: TIdLibHandle; LibVersion: TIdC_UINT; const AFailed: TStringList); + +var FuncLoadError: boolean; + +begin + ASN1_item_ex_new := LoadLibFunction(ADllHandle, ASN1_item_ex_new_procname); + FuncLoadError := not assigned(ASN1_item_ex_new); + if FuncLoadError then + begin + {$if not defined(ASN1_item_ex_new_allownil)} + ASN1_item_ex_new := @ERR_ASN1_item_ex_new; + {$ifend} + {$if declared(ASN1_item_ex_new_introduced)} + if LibVersion < ASN1_item_ex_new_introduced then + begin + {$if declared(FC_ASN1_item_ex_new)} + ASN1_item_ex_new := @FC_ASN1_item_ex_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_item_ex_new_removed)} + if ASN1_item_ex_new_removed <= LibVersion then + begin + {$if declared(_ASN1_item_ex_new)} + ASN1_item_ex_new := @_ASN1_item_ex_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_item_ex_new_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_item_ex_new'); + {$ifend} + end; + + + ASN1_item_ex_free := LoadLibFunction(ADllHandle, ASN1_item_ex_free_procname); + FuncLoadError := not assigned(ASN1_item_ex_free); + if FuncLoadError then + begin + {$if not defined(ASN1_item_ex_free_allownil)} + ASN1_item_ex_free := @ERR_ASN1_item_ex_free; + {$ifend} + {$if declared(ASN1_item_ex_free_introduced)} + if LibVersion < ASN1_item_ex_free_introduced then + begin + {$if declared(FC_ASN1_item_ex_free)} + ASN1_item_ex_free := @FC_ASN1_item_ex_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_item_ex_free_removed)} + if ASN1_item_ex_free_removed <= LibVersion then + begin + {$if declared(_ASN1_item_ex_free)} + ASN1_item_ex_free := @_ASN1_item_ex_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_item_ex_free_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_item_ex_free'); + {$ifend} + end; + + + ASN1_item_ex_d2i := LoadLibFunction(ADllHandle, ASN1_item_ex_d2i_procname); + FuncLoadError := not assigned(ASN1_item_ex_d2i); + if FuncLoadError then + begin + {$if not defined(ASN1_item_ex_d2i_allownil)} + ASN1_item_ex_d2i := @ERR_ASN1_item_ex_d2i; + {$ifend} + {$if declared(ASN1_item_ex_d2i_introduced)} + if LibVersion < ASN1_item_ex_d2i_introduced then + begin + {$if declared(FC_ASN1_item_ex_d2i)} + ASN1_item_ex_d2i := @FC_ASN1_item_ex_d2i; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_item_ex_d2i_removed)} + if ASN1_item_ex_d2i_removed <= LibVersion then + begin + {$if declared(_ASN1_item_ex_d2i)} + ASN1_item_ex_d2i := @_ASN1_item_ex_d2i; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_item_ex_d2i_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_item_ex_d2i'); + {$ifend} + end; + + + ASN1_item_ex_i2d := LoadLibFunction(ADllHandle, ASN1_item_ex_i2d_procname); + FuncLoadError := not assigned(ASN1_item_ex_i2d); + if FuncLoadError then + begin + {$if not defined(ASN1_item_ex_i2d_allownil)} + ASN1_item_ex_i2d := @ERR_ASN1_item_ex_i2d; + {$ifend} + {$if declared(ASN1_item_ex_i2d_introduced)} + if LibVersion < ASN1_item_ex_i2d_introduced then + begin + {$if declared(FC_ASN1_item_ex_i2d)} + ASN1_item_ex_i2d := @FC_ASN1_item_ex_i2d; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_item_ex_i2d_removed)} + if ASN1_item_ex_i2d_removed <= LibVersion then + begin + {$if declared(_ASN1_item_ex_i2d)} + ASN1_item_ex_i2d := @_ASN1_item_ex_i2d; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_item_ex_i2d_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_item_ex_i2d'); + {$ifend} + end; + + +end; + +procedure Unload; +begin + ASN1_item_ex_new := nil; + ASN1_item_ex_free := nil; + ASN1_item_ex_d2i := nil; + ASN1_item_ex_i2d := nil; +end; +{$ELSE} +{$ENDIF} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +initialization + Register_SSLLoader(@Load,'LibCrypto'); + Register_SSLUnloader(@Unload); +{$ENDIF} +end. diff --git a/IdOpenSSLHeaders_async.pas b/IdOpenSSLHeaders_async.pas new file mode 100644 index 0000000..0920a84 --- /dev/null +++ b/IdOpenSSLHeaders_async.pas @@ -0,0 +1,840 @@ + (* This unit was generated using the script genOpenSSLHdrs.sh from the source file IdOpenSSLHeaders_async.h2pas + It should not be modified directly. All changes should be made to IdOpenSSLHeaders_async.h2pas + and this file regenerated. IdOpenSSLHeaders_async.h2pas is distributed with the full Indy + Distribution. + *) + +{$i IdCompilerDefines.inc} +{$i IdSSLOpenSSLDefines.inc} +{$IFNDEF USE_OPENSSL} + { error Should not compile if USE_OPENSSL is not defined!!!} +{$ENDIF} +{******************************************************************************} +{ } +{ Indy (Internet Direct) - Internet Protocols Simplified } +{ } +{ https://www.indyproject.org/ } +{ https://gitter.im/IndySockets/Indy } +{ } +{******************************************************************************} +{ } +{ This file is part of the Indy (Internet Direct) project, and is offered } +{ under the dual-licensing agreement described on the Indy website. } +{ (https://www.indyproject.org/license/) } +{ } +{ Copyright: } +{ (c) 1993-2020, Chad Z. Hower and the Indy Pit Crew. All rights reserved. } +{ } +{******************************************************************************} +{ } +{ } +{******************************************************************************} + +unit IdOpenSSLHeaders_async; + +interface + +// Headers for OpenSSL 1.1.1 +// async.h + + +uses + IdCTypes, + IdGlobal, + IdSSLOpenSSLConsts; + +const + ASYNC_ERR = 0; + ASYNC_NO_JOBS = 0; + ASYNC_PAUSE = 2; + ASYNC_FINISH = 3; + +type + async_job_st = type Pointer; + ASYNC_JOB = async_job_st; + PASYNC_JOB = ^ASYNC_JOB; + PPASYNC_JOB = ^PASYNC_JOB; + + async_wait_ctx_st = type Pointer; + ASYNC_WAIT_CTX = async_wait_ctx_st; + PASYNC_WAIT_CTX = ^ASYNC_WAIT_CTX; + + OSSL_ASYNC_FD = type TIdC_INT; + POSSL_ASYNC_FD = ^OSSL_ASYNC_FD; + + ASYNC_WAIT_CTX_set_wait_fd_cleanup = procedure(v1: PASYNC_WAIT_CTX; + const v2: Pointer; v3: OSSL_ASYNC_FD; v4: Pointer); + ASYNC_start_job_cb = function(v1: Pointer): TIdC_INT; + + { The EXTERNALSYM directive is ignored by FPC, however, it is used by Delphi as follows: + + The EXTERNALSYM directive prevents the specified Delphi symbol from appearing in header + files generated for C++. } + + {$EXTERNALSYM ASYNC_init_thread} {introduced 1.1.0} + {$EXTERNALSYM ASYNC_cleanup_thread} {introduced 1.1.0} + {$EXTERNALSYM ASYNC_WAIT_CTX_new} {introduced 1.1.0} + {$EXTERNALSYM ASYNC_WAIT_CTX_free} {introduced 1.1.0} + {$EXTERNALSYM ASYNC_WAIT_CTX_set_wait_fd} {introduced 1.1.0} + {$EXTERNALSYM ASYNC_WAIT_CTX_get_fd} {introduced 1.1.0} + {$EXTERNALSYM ASYNC_WAIT_CTX_get_all_fds} {introduced 1.1.0} + {$EXTERNALSYM ASYNC_WAIT_CTX_get_changed_fds} {introduced 1.1.0} + {$EXTERNALSYM ASYNC_WAIT_CTX_clear_fd} {introduced 1.1.0} + {$EXTERNALSYM ASYNC_is_capable} {introduced 1.1.0} + {$EXTERNALSYM ASYNC_start_job} {introduced 1.1.0} + {$EXTERNALSYM ASYNC_pause_job} {introduced 1.1.0} + {$EXTERNALSYM ASYNC_get_current_job} {introduced 1.1.0} + {$EXTERNALSYM ASYNC_get_wait_ctx} {introduced 1.1.0} + {$EXTERNALSYM ASYNC_block_pause} {introduced 1.1.0} + {$EXTERNALSYM ASYNC_unblock_pause} {introduced 1.1.0} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +var + ASYNC_init_thread: function (max_size: TIdC_SIZET; init_size: TIdC_SIZET): TIdC_INT; cdecl = nil; {introduced 1.1.0} + ASYNC_cleanup_thread: procedure ; cdecl = nil; {introduced 1.1.0} + + ASYNC_WAIT_CTX_new: function : PASYNC_WAIT_CTX; cdecl = nil; {introduced 1.1.0} + ASYNC_WAIT_CTX_free: procedure (ctx: PASYNC_WAIT_CTX); cdecl = nil; {introduced 1.1.0} + ASYNC_WAIT_CTX_set_wait_fd: function (ctx: PASYNC_WAIT_CTX; const key: Pointer; fd: OSSL_ASYNC_FD; custom_data: Pointer; cleanup_cb: ASYNC_WAIT_CTX_set_wait_fd_cleanup): TIdC_INT; cdecl = nil; {introduced 1.1.0} + ASYNC_WAIT_CTX_get_fd: function (ctx: PASYNC_WAIT_CTX; const key: Pointer; fd: POSSL_ASYNC_FD; custom_data: PPointer): TIdC_INT; cdecl = nil; {introduced 1.1.0} + ASYNC_WAIT_CTX_get_all_fds: function (ctx: PASYNC_WAIT_CTX; fd: POSSL_ASYNC_FD; numfds: PIdC_SIZET): TIdC_INT; cdecl = nil; {introduced 1.1.0} + ASYNC_WAIT_CTX_get_changed_fds: function (ctx: PASYNC_WAIT_CTX; addfd: POSSL_ASYNC_FD; numaddfds: PIdC_SIZET; delfd: POSSL_ASYNC_FD; numdelfds: PIdC_SIZET): TIdC_INT; cdecl = nil; {introduced 1.1.0} + ASYNC_WAIT_CTX_clear_fd: function (ctx: PASYNC_WAIT_CTX; const key: Pointer): TIdC_INT; cdecl = nil; {introduced 1.1.0} + + ASYNC_is_capable: function : TIdC_INT; cdecl = nil; {introduced 1.1.0} + + ASYNC_start_job: function (job: PPASYNC_JOB; ctx: PASYNC_WAIT_CTX; ret: PIdC_INT; func: ASYNC_start_job_cb; args: Pointer; size: TIdC_SIZET): TIdC_INT; cdecl = nil; {introduced 1.1.0} + ASYNC_pause_job: function : TIdC_INT; cdecl = nil; {introduced 1.1.0} + + ASYNC_get_current_job: function : PASYNC_JOB; cdecl = nil; {introduced 1.1.0} + ASYNC_get_wait_ctx: function (job: PASYNC_JOB): PASYNC_WAIT_CTX; cdecl = nil; {introduced 1.1.0} + ASYNC_block_pause: procedure ; cdecl = nil; {introduced 1.1.0} + ASYNC_unblock_pause: procedure ; cdecl = nil; {introduced 1.1.0} + +{$ELSE} + function ASYNC_init_thread(max_size: TIdC_SIZET; init_size: TIdC_SIZET): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + procedure ASYNC_cleanup_thread cdecl; external CLibCrypto; {introduced 1.1.0} + + function ASYNC_WAIT_CTX_new: PASYNC_WAIT_CTX cdecl; external CLibCrypto; {introduced 1.1.0} + procedure ASYNC_WAIT_CTX_free(ctx: PASYNC_WAIT_CTX) cdecl; external CLibCrypto; {introduced 1.1.0} + function ASYNC_WAIT_CTX_set_wait_fd(ctx: PASYNC_WAIT_CTX; const key: Pointer; fd: OSSL_ASYNC_FD; custom_data: Pointer; cleanup_cb: ASYNC_WAIT_CTX_set_wait_fd_cleanup): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function ASYNC_WAIT_CTX_get_fd(ctx: PASYNC_WAIT_CTX; const key: Pointer; fd: POSSL_ASYNC_FD; custom_data: PPointer): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function ASYNC_WAIT_CTX_get_all_fds(ctx: PASYNC_WAIT_CTX; fd: POSSL_ASYNC_FD; numfds: PIdC_SIZET): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function ASYNC_WAIT_CTX_get_changed_fds(ctx: PASYNC_WAIT_CTX; addfd: POSSL_ASYNC_FD; numaddfds: PIdC_SIZET; delfd: POSSL_ASYNC_FD; numdelfds: PIdC_SIZET): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function ASYNC_WAIT_CTX_clear_fd(ctx: PASYNC_WAIT_CTX; const key: Pointer): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + + function ASYNC_is_capable: TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + + function ASYNC_start_job(job: PPASYNC_JOB; ctx: PASYNC_WAIT_CTX; ret: PIdC_INT; func: ASYNC_start_job_cb; args: Pointer; size: TIdC_SIZET): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function ASYNC_pause_job: TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + + function ASYNC_get_current_job: PASYNC_JOB cdecl; external CLibCrypto; {introduced 1.1.0} + function ASYNC_get_wait_ctx(job: PASYNC_JOB): PASYNC_WAIT_CTX cdecl; external CLibCrypto; {introduced 1.1.0} + procedure ASYNC_block_pause cdecl; external CLibCrypto; {introduced 1.1.0} + procedure ASYNC_unblock_pause cdecl; external CLibCrypto; {introduced 1.1.0} + +{$ENDIF} + +implementation + + uses + classes, + IdSSLOpenSSLExceptionHandlers, + IdResourceStringsOpenSSL + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + ,IdSSLOpenSSLLoader + {$ENDIF}; + +const + ASYNC_init_thread_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + ASYNC_cleanup_thread_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + ASYNC_WAIT_CTX_new_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + ASYNC_WAIT_CTX_free_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + ASYNC_WAIT_CTX_set_wait_fd_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + ASYNC_WAIT_CTX_get_fd_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + ASYNC_WAIT_CTX_get_all_fds_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + ASYNC_WAIT_CTX_get_changed_fds_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + ASYNC_WAIT_CTX_clear_fd_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + ASYNC_is_capable_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + ASYNC_start_job_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + ASYNC_pause_job_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + ASYNC_get_current_job_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + ASYNC_get_wait_ctx_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + ASYNC_block_pause_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + ASYNC_unblock_pause_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +const + ASYNC_init_thread_procname = 'ASYNC_init_thread'; {introduced 1.1.0} + ASYNC_cleanup_thread_procname = 'ASYNC_cleanup_thread'; {introduced 1.1.0} + + ASYNC_WAIT_CTX_new_procname = 'ASYNC_WAIT_CTX_new'; {introduced 1.1.0} + ASYNC_WAIT_CTX_free_procname = 'ASYNC_WAIT_CTX_free'; {introduced 1.1.0} + ASYNC_WAIT_CTX_set_wait_fd_procname = 'ASYNC_WAIT_CTX_set_wait_fd'; {introduced 1.1.0} + ASYNC_WAIT_CTX_get_fd_procname = 'ASYNC_WAIT_CTX_get_fd'; {introduced 1.1.0} + ASYNC_WAIT_CTX_get_all_fds_procname = 'ASYNC_WAIT_CTX_get_all_fds'; {introduced 1.1.0} + ASYNC_WAIT_CTX_get_changed_fds_procname = 'ASYNC_WAIT_CTX_get_changed_fds'; {introduced 1.1.0} + ASYNC_WAIT_CTX_clear_fd_procname = 'ASYNC_WAIT_CTX_clear_fd'; {introduced 1.1.0} + + ASYNC_is_capable_procname = 'ASYNC_is_capable'; {introduced 1.1.0} + + ASYNC_start_job_procname = 'ASYNC_start_job'; {introduced 1.1.0} + ASYNC_pause_job_procname = 'ASYNC_pause_job'; {introduced 1.1.0} + + ASYNC_get_current_job_procname = 'ASYNC_get_current_job'; {introduced 1.1.0} + ASYNC_get_wait_ctx_procname = 'ASYNC_get_wait_ctx'; {introduced 1.1.0} + ASYNC_block_pause_procname = 'ASYNC_block_pause'; {introduced 1.1.0} + ASYNC_unblock_pause_procname = 'ASYNC_unblock_pause'; {introduced 1.1.0} + + +{$WARN NO_RETVAL OFF} +function ERR_ASYNC_init_thread(max_size: TIdC_SIZET; init_size: TIdC_SIZET): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ASYNC_init_thread_procname); +end; + + {introduced 1.1.0} +procedure ERR_ASYNC_cleanup_thread; +begin + EIdAPIFunctionNotPresent.RaiseException(ASYNC_cleanup_thread_procname); +end; + + {introduced 1.1.0} + +function ERR_ASYNC_WAIT_CTX_new: PASYNC_WAIT_CTX; +begin + EIdAPIFunctionNotPresent.RaiseException(ASYNC_WAIT_CTX_new_procname); +end; + + {introduced 1.1.0} +procedure ERR_ASYNC_WAIT_CTX_free(ctx: PASYNC_WAIT_CTX); +begin + EIdAPIFunctionNotPresent.RaiseException(ASYNC_WAIT_CTX_free_procname); +end; + + {introduced 1.1.0} +function ERR_ASYNC_WAIT_CTX_set_wait_fd(ctx: PASYNC_WAIT_CTX; const key: Pointer; fd: OSSL_ASYNC_FD; custom_data: Pointer; cleanup_cb: ASYNC_WAIT_CTX_set_wait_fd_cleanup): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ASYNC_WAIT_CTX_set_wait_fd_procname); +end; + + {introduced 1.1.0} +function ERR_ASYNC_WAIT_CTX_get_fd(ctx: PASYNC_WAIT_CTX; const key: Pointer; fd: POSSL_ASYNC_FD; custom_data: PPointer): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ASYNC_WAIT_CTX_get_fd_procname); +end; + + {introduced 1.1.0} +function ERR_ASYNC_WAIT_CTX_get_all_fds(ctx: PASYNC_WAIT_CTX; fd: POSSL_ASYNC_FD; numfds: PIdC_SIZET): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ASYNC_WAIT_CTX_get_all_fds_procname); +end; + + {introduced 1.1.0} +function ERR_ASYNC_WAIT_CTX_get_changed_fds(ctx: PASYNC_WAIT_CTX; addfd: POSSL_ASYNC_FD; numaddfds: PIdC_SIZET; delfd: POSSL_ASYNC_FD; numdelfds: PIdC_SIZET): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ASYNC_WAIT_CTX_get_changed_fds_procname); +end; + + {introduced 1.1.0} +function ERR_ASYNC_WAIT_CTX_clear_fd(ctx: PASYNC_WAIT_CTX; const key: Pointer): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ASYNC_WAIT_CTX_clear_fd_procname); +end; + + {introduced 1.1.0} + +function ERR_ASYNC_is_capable: TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ASYNC_is_capable_procname); +end; + + {introduced 1.1.0} + +function ERR_ASYNC_start_job(job: PPASYNC_JOB; ctx: PASYNC_WAIT_CTX; ret: PIdC_INT; func: ASYNC_start_job_cb; args: Pointer; size: TIdC_SIZET): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ASYNC_start_job_procname); +end; + + {introduced 1.1.0} +function ERR_ASYNC_pause_job: TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ASYNC_pause_job_procname); +end; + + {introduced 1.1.0} + +function ERR_ASYNC_get_current_job: PASYNC_JOB; +begin + EIdAPIFunctionNotPresent.RaiseException(ASYNC_get_current_job_procname); +end; + + {introduced 1.1.0} +function ERR_ASYNC_get_wait_ctx(job: PASYNC_JOB): PASYNC_WAIT_CTX; +begin + EIdAPIFunctionNotPresent.RaiseException(ASYNC_get_wait_ctx_procname); +end; + + {introduced 1.1.0} +procedure ERR_ASYNC_block_pause; +begin + EIdAPIFunctionNotPresent.RaiseException(ASYNC_block_pause_procname); +end; + + {introduced 1.1.0} +procedure ERR_ASYNC_unblock_pause; +begin + EIdAPIFunctionNotPresent.RaiseException(ASYNC_unblock_pause_procname); +end; + + {introduced 1.1.0} + +{$WARN NO_RETVAL ON} + +procedure Load(const ADllHandle: TIdLibHandle; LibVersion: TIdC_UINT; const AFailed: TStringList); + +var FuncLoadError: boolean; + +begin + ASYNC_init_thread := LoadLibFunction(ADllHandle, ASYNC_init_thread_procname); + FuncLoadError := not assigned(ASYNC_init_thread); + if FuncLoadError then + begin + {$if not defined(ASYNC_init_thread_allownil)} + ASYNC_init_thread := @ERR_ASYNC_init_thread; + {$ifend} + {$if declared(ASYNC_init_thread_introduced)} + if LibVersion < ASYNC_init_thread_introduced then + begin + {$if declared(FC_ASYNC_init_thread)} + ASYNC_init_thread := @FC_ASYNC_init_thread; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASYNC_init_thread_removed)} + if ASYNC_init_thread_removed <= LibVersion then + begin + {$if declared(_ASYNC_init_thread)} + ASYNC_init_thread := @_ASYNC_init_thread; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASYNC_init_thread_allownil)} + if FuncLoadError then + AFailed.Add('ASYNC_init_thread'); + {$ifend} + end; + + {introduced 1.1.0} + ASYNC_cleanup_thread := LoadLibFunction(ADllHandle, ASYNC_cleanup_thread_procname); + FuncLoadError := not assigned(ASYNC_cleanup_thread); + if FuncLoadError then + begin + {$if not defined(ASYNC_cleanup_thread_allownil)} + ASYNC_cleanup_thread := @ERR_ASYNC_cleanup_thread; + {$ifend} + {$if declared(ASYNC_cleanup_thread_introduced)} + if LibVersion < ASYNC_cleanup_thread_introduced then + begin + {$if declared(FC_ASYNC_cleanup_thread)} + ASYNC_cleanup_thread := @FC_ASYNC_cleanup_thread; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASYNC_cleanup_thread_removed)} + if ASYNC_cleanup_thread_removed <= LibVersion then + begin + {$if declared(_ASYNC_cleanup_thread)} + ASYNC_cleanup_thread := @_ASYNC_cleanup_thread; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASYNC_cleanup_thread_allownil)} + if FuncLoadError then + AFailed.Add('ASYNC_cleanup_thread'); + {$ifend} + end; + + {introduced 1.1.0} + ASYNC_WAIT_CTX_new := LoadLibFunction(ADllHandle, ASYNC_WAIT_CTX_new_procname); + FuncLoadError := not assigned(ASYNC_WAIT_CTX_new); + if FuncLoadError then + begin + {$if not defined(ASYNC_WAIT_CTX_new_allownil)} + ASYNC_WAIT_CTX_new := @ERR_ASYNC_WAIT_CTX_new; + {$ifend} + {$if declared(ASYNC_WAIT_CTX_new_introduced)} + if LibVersion < ASYNC_WAIT_CTX_new_introduced then + begin + {$if declared(FC_ASYNC_WAIT_CTX_new)} + ASYNC_WAIT_CTX_new := @FC_ASYNC_WAIT_CTX_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASYNC_WAIT_CTX_new_removed)} + if ASYNC_WAIT_CTX_new_removed <= LibVersion then + begin + {$if declared(_ASYNC_WAIT_CTX_new)} + ASYNC_WAIT_CTX_new := @_ASYNC_WAIT_CTX_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASYNC_WAIT_CTX_new_allownil)} + if FuncLoadError then + AFailed.Add('ASYNC_WAIT_CTX_new'); + {$ifend} + end; + + {introduced 1.1.0} + ASYNC_WAIT_CTX_free := LoadLibFunction(ADllHandle, ASYNC_WAIT_CTX_free_procname); + FuncLoadError := not assigned(ASYNC_WAIT_CTX_free); + if FuncLoadError then + begin + {$if not defined(ASYNC_WAIT_CTX_free_allownil)} + ASYNC_WAIT_CTX_free := @ERR_ASYNC_WAIT_CTX_free; + {$ifend} + {$if declared(ASYNC_WAIT_CTX_free_introduced)} + if LibVersion < ASYNC_WAIT_CTX_free_introduced then + begin + {$if declared(FC_ASYNC_WAIT_CTX_free)} + ASYNC_WAIT_CTX_free := @FC_ASYNC_WAIT_CTX_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASYNC_WAIT_CTX_free_removed)} + if ASYNC_WAIT_CTX_free_removed <= LibVersion then + begin + {$if declared(_ASYNC_WAIT_CTX_free)} + ASYNC_WAIT_CTX_free := @_ASYNC_WAIT_CTX_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASYNC_WAIT_CTX_free_allownil)} + if FuncLoadError then + AFailed.Add('ASYNC_WAIT_CTX_free'); + {$ifend} + end; + + {introduced 1.1.0} + ASYNC_WAIT_CTX_set_wait_fd := LoadLibFunction(ADllHandle, ASYNC_WAIT_CTX_set_wait_fd_procname); + FuncLoadError := not assigned(ASYNC_WAIT_CTX_set_wait_fd); + if FuncLoadError then + begin + {$if not defined(ASYNC_WAIT_CTX_set_wait_fd_allownil)} + ASYNC_WAIT_CTX_set_wait_fd := @ERR_ASYNC_WAIT_CTX_set_wait_fd; + {$ifend} + {$if declared(ASYNC_WAIT_CTX_set_wait_fd_introduced)} + if LibVersion < ASYNC_WAIT_CTX_set_wait_fd_introduced then + begin + {$if declared(FC_ASYNC_WAIT_CTX_set_wait_fd)} + ASYNC_WAIT_CTX_set_wait_fd := @FC_ASYNC_WAIT_CTX_set_wait_fd; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASYNC_WAIT_CTX_set_wait_fd_removed)} + if ASYNC_WAIT_CTX_set_wait_fd_removed <= LibVersion then + begin + {$if declared(_ASYNC_WAIT_CTX_set_wait_fd)} + ASYNC_WAIT_CTX_set_wait_fd := @_ASYNC_WAIT_CTX_set_wait_fd; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASYNC_WAIT_CTX_set_wait_fd_allownil)} + if FuncLoadError then + AFailed.Add('ASYNC_WAIT_CTX_set_wait_fd'); + {$ifend} + end; + + {introduced 1.1.0} + ASYNC_WAIT_CTX_get_fd := LoadLibFunction(ADllHandle, ASYNC_WAIT_CTX_get_fd_procname); + FuncLoadError := not assigned(ASYNC_WAIT_CTX_get_fd); + if FuncLoadError then + begin + {$if not defined(ASYNC_WAIT_CTX_get_fd_allownil)} + ASYNC_WAIT_CTX_get_fd := @ERR_ASYNC_WAIT_CTX_get_fd; + {$ifend} + {$if declared(ASYNC_WAIT_CTX_get_fd_introduced)} + if LibVersion < ASYNC_WAIT_CTX_get_fd_introduced then + begin + {$if declared(FC_ASYNC_WAIT_CTX_get_fd)} + ASYNC_WAIT_CTX_get_fd := @FC_ASYNC_WAIT_CTX_get_fd; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASYNC_WAIT_CTX_get_fd_removed)} + if ASYNC_WAIT_CTX_get_fd_removed <= LibVersion then + begin + {$if declared(_ASYNC_WAIT_CTX_get_fd)} + ASYNC_WAIT_CTX_get_fd := @_ASYNC_WAIT_CTX_get_fd; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASYNC_WAIT_CTX_get_fd_allownil)} + if FuncLoadError then + AFailed.Add('ASYNC_WAIT_CTX_get_fd'); + {$ifend} + end; + + {introduced 1.1.0} + ASYNC_WAIT_CTX_get_all_fds := LoadLibFunction(ADllHandle, ASYNC_WAIT_CTX_get_all_fds_procname); + FuncLoadError := not assigned(ASYNC_WAIT_CTX_get_all_fds); + if FuncLoadError then + begin + {$if not defined(ASYNC_WAIT_CTX_get_all_fds_allownil)} + ASYNC_WAIT_CTX_get_all_fds := @ERR_ASYNC_WAIT_CTX_get_all_fds; + {$ifend} + {$if declared(ASYNC_WAIT_CTX_get_all_fds_introduced)} + if LibVersion < ASYNC_WAIT_CTX_get_all_fds_introduced then + begin + {$if declared(FC_ASYNC_WAIT_CTX_get_all_fds)} + ASYNC_WAIT_CTX_get_all_fds := @FC_ASYNC_WAIT_CTX_get_all_fds; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASYNC_WAIT_CTX_get_all_fds_removed)} + if ASYNC_WAIT_CTX_get_all_fds_removed <= LibVersion then + begin + {$if declared(_ASYNC_WAIT_CTX_get_all_fds)} + ASYNC_WAIT_CTX_get_all_fds := @_ASYNC_WAIT_CTX_get_all_fds; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASYNC_WAIT_CTX_get_all_fds_allownil)} + if FuncLoadError then + AFailed.Add('ASYNC_WAIT_CTX_get_all_fds'); + {$ifend} + end; + + {introduced 1.1.0} + ASYNC_WAIT_CTX_get_changed_fds := LoadLibFunction(ADllHandle, ASYNC_WAIT_CTX_get_changed_fds_procname); + FuncLoadError := not assigned(ASYNC_WAIT_CTX_get_changed_fds); + if FuncLoadError then + begin + {$if not defined(ASYNC_WAIT_CTX_get_changed_fds_allownil)} + ASYNC_WAIT_CTX_get_changed_fds := @ERR_ASYNC_WAIT_CTX_get_changed_fds; + {$ifend} + {$if declared(ASYNC_WAIT_CTX_get_changed_fds_introduced)} + if LibVersion < ASYNC_WAIT_CTX_get_changed_fds_introduced then + begin + {$if declared(FC_ASYNC_WAIT_CTX_get_changed_fds)} + ASYNC_WAIT_CTX_get_changed_fds := @FC_ASYNC_WAIT_CTX_get_changed_fds; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASYNC_WAIT_CTX_get_changed_fds_removed)} + if ASYNC_WAIT_CTX_get_changed_fds_removed <= LibVersion then + begin + {$if declared(_ASYNC_WAIT_CTX_get_changed_fds)} + ASYNC_WAIT_CTX_get_changed_fds := @_ASYNC_WAIT_CTX_get_changed_fds; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASYNC_WAIT_CTX_get_changed_fds_allownil)} + if FuncLoadError then + AFailed.Add('ASYNC_WAIT_CTX_get_changed_fds'); + {$ifend} + end; + + {introduced 1.1.0} + ASYNC_WAIT_CTX_clear_fd := LoadLibFunction(ADllHandle, ASYNC_WAIT_CTX_clear_fd_procname); + FuncLoadError := not assigned(ASYNC_WAIT_CTX_clear_fd); + if FuncLoadError then + begin + {$if not defined(ASYNC_WAIT_CTX_clear_fd_allownil)} + ASYNC_WAIT_CTX_clear_fd := @ERR_ASYNC_WAIT_CTX_clear_fd; + {$ifend} + {$if declared(ASYNC_WAIT_CTX_clear_fd_introduced)} + if LibVersion < ASYNC_WAIT_CTX_clear_fd_introduced then + begin + {$if declared(FC_ASYNC_WAIT_CTX_clear_fd)} + ASYNC_WAIT_CTX_clear_fd := @FC_ASYNC_WAIT_CTX_clear_fd; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASYNC_WAIT_CTX_clear_fd_removed)} + if ASYNC_WAIT_CTX_clear_fd_removed <= LibVersion then + begin + {$if declared(_ASYNC_WAIT_CTX_clear_fd)} + ASYNC_WAIT_CTX_clear_fd := @_ASYNC_WAIT_CTX_clear_fd; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASYNC_WAIT_CTX_clear_fd_allownil)} + if FuncLoadError then + AFailed.Add('ASYNC_WAIT_CTX_clear_fd'); + {$ifend} + end; + + {introduced 1.1.0} + ASYNC_is_capable := LoadLibFunction(ADllHandle, ASYNC_is_capable_procname); + FuncLoadError := not assigned(ASYNC_is_capable); + if FuncLoadError then + begin + {$if not defined(ASYNC_is_capable_allownil)} + ASYNC_is_capable := @ERR_ASYNC_is_capable; + {$ifend} + {$if declared(ASYNC_is_capable_introduced)} + if LibVersion < ASYNC_is_capable_introduced then + begin + {$if declared(FC_ASYNC_is_capable)} + ASYNC_is_capable := @FC_ASYNC_is_capable; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASYNC_is_capable_removed)} + if ASYNC_is_capable_removed <= LibVersion then + begin + {$if declared(_ASYNC_is_capable)} + ASYNC_is_capable := @_ASYNC_is_capable; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASYNC_is_capable_allownil)} + if FuncLoadError then + AFailed.Add('ASYNC_is_capable'); + {$ifend} + end; + + {introduced 1.1.0} + ASYNC_start_job := LoadLibFunction(ADllHandle, ASYNC_start_job_procname); + FuncLoadError := not assigned(ASYNC_start_job); + if FuncLoadError then + begin + {$if not defined(ASYNC_start_job_allownil)} + ASYNC_start_job := @ERR_ASYNC_start_job; + {$ifend} + {$if declared(ASYNC_start_job_introduced)} + if LibVersion < ASYNC_start_job_introduced then + begin + {$if declared(FC_ASYNC_start_job)} + ASYNC_start_job := @FC_ASYNC_start_job; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASYNC_start_job_removed)} + if ASYNC_start_job_removed <= LibVersion then + begin + {$if declared(_ASYNC_start_job)} + ASYNC_start_job := @_ASYNC_start_job; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASYNC_start_job_allownil)} + if FuncLoadError then + AFailed.Add('ASYNC_start_job'); + {$ifend} + end; + + {introduced 1.1.0} + ASYNC_pause_job := LoadLibFunction(ADllHandle, ASYNC_pause_job_procname); + FuncLoadError := not assigned(ASYNC_pause_job); + if FuncLoadError then + begin + {$if not defined(ASYNC_pause_job_allownil)} + ASYNC_pause_job := @ERR_ASYNC_pause_job; + {$ifend} + {$if declared(ASYNC_pause_job_introduced)} + if LibVersion < ASYNC_pause_job_introduced then + begin + {$if declared(FC_ASYNC_pause_job)} + ASYNC_pause_job := @FC_ASYNC_pause_job; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASYNC_pause_job_removed)} + if ASYNC_pause_job_removed <= LibVersion then + begin + {$if declared(_ASYNC_pause_job)} + ASYNC_pause_job := @_ASYNC_pause_job; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASYNC_pause_job_allownil)} + if FuncLoadError then + AFailed.Add('ASYNC_pause_job'); + {$ifend} + end; + + {introduced 1.1.0} + ASYNC_get_current_job := LoadLibFunction(ADllHandle, ASYNC_get_current_job_procname); + FuncLoadError := not assigned(ASYNC_get_current_job); + if FuncLoadError then + begin + {$if not defined(ASYNC_get_current_job_allownil)} + ASYNC_get_current_job := @ERR_ASYNC_get_current_job; + {$ifend} + {$if declared(ASYNC_get_current_job_introduced)} + if LibVersion < ASYNC_get_current_job_introduced then + begin + {$if declared(FC_ASYNC_get_current_job)} + ASYNC_get_current_job := @FC_ASYNC_get_current_job; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASYNC_get_current_job_removed)} + if ASYNC_get_current_job_removed <= LibVersion then + begin + {$if declared(_ASYNC_get_current_job)} + ASYNC_get_current_job := @_ASYNC_get_current_job; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASYNC_get_current_job_allownil)} + if FuncLoadError then + AFailed.Add('ASYNC_get_current_job'); + {$ifend} + end; + + {introduced 1.1.0} + ASYNC_get_wait_ctx := LoadLibFunction(ADllHandle, ASYNC_get_wait_ctx_procname); + FuncLoadError := not assigned(ASYNC_get_wait_ctx); + if FuncLoadError then + begin + {$if not defined(ASYNC_get_wait_ctx_allownil)} + ASYNC_get_wait_ctx := @ERR_ASYNC_get_wait_ctx; + {$ifend} + {$if declared(ASYNC_get_wait_ctx_introduced)} + if LibVersion < ASYNC_get_wait_ctx_introduced then + begin + {$if declared(FC_ASYNC_get_wait_ctx)} + ASYNC_get_wait_ctx := @FC_ASYNC_get_wait_ctx; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASYNC_get_wait_ctx_removed)} + if ASYNC_get_wait_ctx_removed <= LibVersion then + begin + {$if declared(_ASYNC_get_wait_ctx)} + ASYNC_get_wait_ctx := @_ASYNC_get_wait_ctx; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASYNC_get_wait_ctx_allownil)} + if FuncLoadError then + AFailed.Add('ASYNC_get_wait_ctx'); + {$ifend} + end; + + {introduced 1.1.0} + ASYNC_block_pause := LoadLibFunction(ADllHandle, ASYNC_block_pause_procname); + FuncLoadError := not assigned(ASYNC_block_pause); + if FuncLoadError then + begin + {$if not defined(ASYNC_block_pause_allownil)} + ASYNC_block_pause := @ERR_ASYNC_block_pause; + {$ifend} + {$if declared(ASYNC_block_pause_introduced)} + if LibVersion < ASYNC_block_pause_introduced then + begin + {$if declared(FC_ASYNC_block_pause)} + ASYNC_block_pause := @FC_ASYNC_block_pause; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASYNC_block_pause_removed)} + if ASYNC_block_pause_removed <= LibVersion then + begin + {$if declared(_ASYNC_block_pause)} + ASYNC_block_pause := @_ASYNC_block_pause; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASYNC_block_pause_allownil)} + if FuncLoadError then + AFailed.Add('ASYNC_block_pause'); + {$ifend} + end; + + {introduced 1.1.0} + ASYNC_unblock_pause := LoadLibFunction(ADllHandle, ASYNC_unblock_pause_procname); + FuncLoadError := not assigned(ASYNC_unblock_pause); + if FuncLoadError then + begin + {$if not defined(ASYNC_unblock_pause_allownil)} + ASYNC_unblock_pause := @ERR_ASYNC_unblock_pause; + {$ifend} + {$if declared(ASYNC_unblock_pause_introduced)} + if LibVersion < ASYNC_unblock_pause_introduced then + begin + {$if declared(FC_ASYNC_unblock_pause)} + ASYNC_unblock_pause := @FC_ASYNC_unblock_pause; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASYNC_unblock_pause_removed)} + if ASYNC_unblock_pause_removed <= LibVersion then + begin + {$if declared(_ASYNC_unblock_pause)} + ASYNC_unblock_pause := @_ASYNC_unblock_pause; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASYNC_unblock_pause_allownil)} + if FuncLoadError then + AFailed.Add('ASYNC_unblock_pause'); + {$ifend} + end; + + {introduced 1.1.0} +end; + +procedure Unload; +begin + ASYNC_init_thread := nil; {introduced 1.1.0} + ASYNC_cleanup_thread := nil; {introduced 1.1.0} + ASYNC_WAIT_CTX_new := nil; {introduced 1.1.0} + ASYNC_WAIT_CTX_free := nil; {introduced 1.1.0} + ASYNC_WAIT_CTX_set_wait_fd := nil; {introduced 1.1.0} + ASYNC_WAIT_CTX_get_fd := nil; {introduced 1.1.0} + ASYNC_WAIT_CTX_get_all_fds := nil; {introduced 1.1.0} + ASYNC_WAIT_CTX_get_changed_fds := nil; {introduced 1.1.0} + ASYNC_WAIT_CTX_clear_fd := nil; {introduced 1.1.0} + ASYNC_is_capable := nil; {introduced 1.1.0} + ASYNC_start_job := nil; {introduced 1.1.0} + ASYNC_pause_job := nil; {introduced 1.1.0} + ASYNC_get_current_job := nil; {introduced 1.1.0} + ASYNC_get_wait_ctx := nil; {introduced 1.1.0} + ASYNC_block_pause := nil; {introduced 1.1.0} + ASYNC_unblock_pause := nil; {introduced 1.1.0} +end; +{$ELSE} +{$ENDIF} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +initialization + Register_SSLLoader(@Load,'LibCrypto'); + Register_SSLUnloader(@Unload); +{$ENDIF} +end. diff --git a/IdOpenSSLHeaders_asyncerr.pas b/IdOpenSSLHeaders_asyncerr.pas new file mode 100644 index 0000000..0be4a00 --- /dev/null +++ b/IdOpenSSLHeaders_asyncerr.pas @@ -0,0 +1,159 @@ + (* This unit was generated using the script genOpenSSLHdrs.sh from the source file IdOpenSSLHeaders_asyncerr.h2pas + It should not be modified directly. All changes should be made to IdOpenSSLHeaders_asyncerr.h2pas + and this file regenerated. IdOpenSSLHeaders_asyncerr.h2pas is distributed with the full Indy + Distribution. + *) + +{$i IdCompilerDefines.inc} +{$i IdSSLOpenSSLDefines.inc} +{$IFNDEF USE_OPENSSL} + { error Should not compile if USE_OPENSSL is not defined!!!} +{$ENDIF} +{******************************************************************************} +{ } +{ Indy (Internet Direct) - Internet Protocols Simplified } +{ } +{ https://www.indyproject.org/ } +{ https://gitter.im/IndySockets/Indy } +{ } +{******************************************************************************} +{ } +{ This file is part of the Indy (Internet Direct) project, and is offered } +{ under the dual-licensing agreement described on the Indy website. } +{ (https://www.indyproject.org/license/) } +{ } +{ Copyright: } +{ (c) 1993-2020, Chad Z. Hower and the Indy Pit Crew. All rights reserved. } +{ } +{******************************************************************************} +{ } +{ } +{******************************************************************************} + +unit IdOpenSSLHeaders_asyncerr; + +interface + +// Headers for OpenSSL 1.1.1 +// asyncerr.h + + +uses + IdCTypes, + IdGlobal, + IdSSLOpenSSLConsts; + +const + // + // ASYNC function codes. + // + ASYNC_F_ASYNC_CTX_NEW = 100; + ASYNC_F_ASYNC_INIT_THREAD = 101; + ASYNC_F_ASYNC_JOB_NEW = 102; + ASYNC_F_ASYNC_PAUSE_JOB = 103; + ASYNC_F_ASYNC_START_FUNC = 104; + ASYNC_F_ASYNC_START_JOB = 105; + ASYNC_F_ASYNC_WAIT_CTX_SET_WAIT_FD = 106; + + // + // ASYNC reason codes. + // + ASYNC_R_FAILED_TO_SET_POOL = 101; + ASYNC_R_FAILED_TO_SWAP_CONTEXT = 102; + ASYNC_R_INIT_FAILED = 105; + ASYNC_R_INVALID_POOL_SIZE = 103; + + { The EXTERNALSYM directive is ignored by FPC, however, it is used by Delphi as follows: + + The EXTERNALSYM directive prevents the specified Delphi symbol from appearing in header + files generated for C++. } + + {$EXTERNALSYM ERR_load_ASYNC_strings} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +var + ERR_load_ASYNC_strings: function : TIdC_INT; cdecl = nil; + +{$ELSE} + function ERR_load_ASYNC_strings: TIdC_INT cdecl; external CLibCrypto; + +{$ENDIF} + +implementation + + uses + classes, + IdSSLOpenSSLExceptionHandlers, + IdResourceStringsOpenSSL + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + ,IdSSLOpenSSLLoader + {$ENDIF}; + + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +const + ERR_load_ASYNC_strings_procname = 'ERR_load_ASYNC_strings'; + + +{$WARN NO_RETVAL OFF} +function ERR_ERR_load_ASYNC_strings: TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ERR_load_ASYNC_strings_procname); +end; + + + +{$WARN NO_RETVAL ON} + +procedure Load(const ADllHandle: TIdLibHandle; LibVersion: TIdC_UINT; const AFailed: TStringList); + +var FuncLoadError: boolean; + +begin + ERR_load_ASYNC_strings := LoadLibFunction(ADllHandle, ERR_load_ASYNC_strings_procname); + FuncLoadError := not assigned(ERR_load_ASYNC_strings); + if FuncLoadError then + begin + {$if not defined(ERR_load_ASYNC_strings_allownil)} + ERR_load_ASYNC_strings := @ERR_ERR_load_ASYNC_strings; + {$ifend} + {$if declared(ERR_load_ASYNC_strings_introduced)} + if LibVersion < ERR_load_ASYNC_strings_introduced then + begin + {$if declared(FC_ERR_load_ASYNC_strings)} + ERR_load_ASYNC_strings := @FC_ERR_load_ASYNC_strings; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ERR_load_ASYNC_strings_removed)} + if ERR_load_ASYNC_strings_removed <= LibVersion then + begin + {$if declared(_ERR_load_ASYNC_strings)} + ERR_load_ASYNC_strings := @_ERR_load_ASYNC_strings; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ERR_load_ASYNC_strings_allownil)} + if FuncLoadError then + AFailed.Add('ERR_load_ASYNC_strings'); + {$ifend} + end; + + +end; + +procedure Unload; +begin + ERR_load_ASYNC_strings := nil; +end; +{$ELSE} +{$ENDIF} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +initialization + Register_SSLLoader(@Load,'LibCrypto'); + Register_SSLUnloader(@Unload); +{$ENDIF} +end. diff --git a/IdOpenSSLHeaders_bio.pas b/IdOpenSSLHeaders_bio.pas new file mode 100644 index 0000000..44ef514 --- /dev/null +++ b/IdOpenSSLHeaders_bio.pas @@ -0,0 +1,7615 @@ + (* This unit was generated using the script genOpenSSLHdrs.sh from the source file IdOpenSSLHeaders_bio.h2pas + It should not be modified directly. All changes should be made to IdOpenSSLHeaders_bio.h2pas + and this file regenerated. IdOpenSSLHeaders_bio.h2pas is distributed with the full Indy + Distribution. + *) + +{$i IdCompilerDefines.inc} +{$i IdSSLOpenSSLDefines.inc} +{$IFNDEF USE_OPENSSL} + { error Should not compile if USE_OPENSSL is not defined!!!} +{$ENDIF} +{******************************************************************************} +{ } +{ Indy (Internet Direct) - Internet Protocols Simplified } +{ } +{ https://www.indyproject.org/ } +{ https://gitter.im/IndySockets/Indy } +{ } +{******************************************************************************} +{ } +{ This file is part of the Indy (Internet Direct) project, and is offered } +{ under the dual-licensing agreement described on the Indy website. } +{ (https://www.indyproject.org/license/) } +{ } +{ Copyright: } +{ (c) 1993-2020, Chad Z. Hower and the Indy Pit Crew. All rights reserved. } +{ } +{******************************************************************************} +{ } +{ } +{******************************************************************************} + +unit IdOpenSSLHeaders_bio; + +interface + +// Headers for OpenSSL 1.1.1 +// bio.h + + +uses + IdCTypes, + IdGlobal, + IdSSLOpenSSLConsts, + IdOpenSSlHeaders_ossl_typ; + +{$MINENUMSIZE 4} + +const + (* There are the classes of BIOs *) + BIO_TYPE_DESCRIPTOR = $0100; + BIO_TYPE_FILTER = $0200; + BIO_TYPE_SOURCE_SINK = $0400; + + (* These are the 'types' of BIOs *) + BIO_TYPE_NONE = 0; + BIO_TYPE_MEM = 1 or BIO_TYPE_SOURCE_SINK; + BIO_TYPE_FILE = 2 or BIO_TYPE_SOURCE_SINK; + + BIO_TYPE_FD = 4 or BIO_TYPE_SOURCE_SINK or BIO_TYPE_DESCRIPTOR; + BIO_TYPE_SOCKET = 5 or BIO_TYPE_SOURCE_SINK or BIO_TYPE_DESCRIPTOR; + BIO_TYPE_NULL = 6 or BIO_TYPE_SOURCE_SINK; + BIO_TYPE_SSL = 7 or BIO_TYPE_FILTER; + BIO_TYPE_MD = 8 or BIO_TYPE_FILTER; + BIO_TYPE_BUFFER = 9 or BIO_TYPE_FILTER; + BIO_TYPE_CIPHER = 10 or BIO_TYPE_FILTER; + BIO_TYPE_BASE64 = 11 or BIO_TYPE_FILTER; + BIO_TYPE_CONNECT = 12 or BIO_TYPE_SOURCE_SINK or BIO_TYPE_DESCRIPTOR; + BIO_TYPE_ACCEPT = 13 or BIO_TYPE_SOURCE_SINK or BIO_TYPE_DESCRIPTOR; + + BIO_TYPE_NBIO_TEST = 16 or BIO_TYPE_FILTER; + BIO_TYPE_NULL_FILTER = 17 or BIO_TYPE_FILTER; + BIO_TYPE_BIO = 19 or BIO_TYPE_SOURCE_SINK; + BIO_TYPE_LINEBUFFER = 20 or BIO_TYPE_FILTER; + BIO_TYPE_DGRAM = 21 or BIO_TYPE_SOURCE_SINK or BIO_TYPE_DESCRIPTOR; + BIO_TYPE_ASN1 = 22 or BIO_TYPE_FILTER; + BIO_TYPE_COMP = 23 or BIO_TYPE_FILTER; + BIO_TYPE_DGRAM_SCTP = 24 or BIO_TYPE_SOURCE_SINK or BIO_TYPE_DESCRIPTOR; + + BIO_TYPE_START = 128; + + (* + * BIO_FILENAME_READ|BIO_CLOSE to open or close on free. + * BIO_set_fp(in,stdin,BIO_NOCLOSE); + *) + BIO_NOCLOSE = $00; + BIO_CLOSE = $01; + + (* + * These are used in the following macros and are passed to BIO_ctrl() + *) + BIO_CTRL_RESET = 1;(* opt - rewind/zero etc *) + BIO_CTRL_EOF = 2;(* opt - are we at the eof *) + BIO_CTRL_INFO = 3;(* opt - extra tit-bits *) + BIO_CTRL_SET = 4;(* man - set the 'IO' type *) + BIO_CTRL_GET = 5;(* man - get the 'IO' type *) + BIO_CTRL_PUSH = 6;(* opt - internal, used to signify change *) + BIO_CTRL_POP = 7;(* opt - internal, used to signify change *) + BIO_CTRL_GET_CLOSE = 8;(* man - set the 'close' on free *) + BIO_CTRL_SET_CLOSE = 9;(* man - set the 'close' on free *) + // Added "_const" to prevent naming clashes + BIO_CTRL_PENDING_const = 10;(* opt - is their more data buffered *) + BIO_CTRL_FLUSH = 11;(* opt - 'flush' buffered output *) + BIO_CTRL_DUP = 12;(* man - extra stuff for 'duped' BIO *) + // Added "_const" to prevent naming clashes + BIO_CTRL_WPENDING_const = 13;(* opt - number of bytes still to write *) + BIO_CTRL_SET_CALLBACK = 14;(* opt - set callback function *) + BIO_CTRL_GET_CALLBACK = 15;(* opt - set callback function *) + + BIO_CTRL_PEEK = 29;(* BIO_f_buffer special *) + BIO_CTRL_SET_FILENAME = 30;(* BIO_s_file special *) + + (* dgram BIO stuff *) + BIO_CTRL_DGRAM_CONNECT = 31;(* BIO dgram special *) + BIO_CTRL_DGRAM_SET_CONNECTED = 32;(* allow for an externally connected + * socket to be passed in *) + BIO_CTRL_DGRAM_SET_RECV_TIMEOUT = 33;(* setsockopt, essentially *) + BIO_CTRL_DGRAM_GET_RECV_TIMEOUT = 34;(* getsockopt, essentially *) + BIO_CTRL_DGRAM_SET_SEND_TIMEOUT = 35;(* setsockopt, essentially *) + BIO_CTRL_DGRAM_GET_SEND_TIMEOUT = 36;(* getsockopt, essentially *) + + BIO_CTRL_DGRAM_GET_RECV_TIMER_EXP = 37;(* flag whether the last *) + BIO_CTRL_DGRAM_GET_SEND_TIMER_EXP = 38;(* I/O operation tiemd out *) + + BIO_CTRL_DGRAM_MTU_DISCOVER = 39;(* set DF bit on egress packets *) + + BIO_CTRL_DGRAM_QUERY_MTU = 40;(* as kernel for current MTU *) + BIO_CTRL_DGRAM_GET_FALLBACK_MTU = 47; + BIO_CTRL_DGRAM_GET_MTU = 41;(* get cached value for MTU *) + BIO_CTRL_DGRAM_SET_MTU = 42;(* set cached value for MTU. + * want to use this if asking + * the kernel fails *) + + BIO_CTRL_DGRAM_MTU_EXCEEDED = 43;(* check whether the MTU was + * exceed in the previous write + * operation *) + + BIO_CTRL_DGRAM_GET_PEER = 46; + BIO_CTRL_DGRAM_SET_PEER = 44;(* Destination for the data *) + + BIO_CTRL_DGRAM_SET_NEXT_TIMEOUT = 45;(* Next DTLS handshake timeout + * to adjust socket timeouts *) + BIO_CTRL_DGRAM_SET_DONT_FRAG = 48; + + BIO_CTRL_DGRAM_GET_MTU_OVERHEAD = 49; + + (* Deliberately outside of OPENSSL_NO_SCTP - used in bss_dgram.c *) + BIO_CTRL_DGRAM_SCTP_SET_IN_HANDSHAKE = 50; + (* SCTP stuff *) + BIO_CTRL_DGRAM_SCTP_ADD_AUTH_KEY = 51; + BIO_CTRL_DGRAM_SCTP_NEXT_AUTH_KEY = 52; + BIO_CTRL_DGRAM_SCTP_AUTH_CCS_RCVD = 53; + BIO_CTRL_DGRAM_SCTP_GET_SNDINFO = 60; + BIO_CTRL_DGRAM_SCTP_SET_SNDINFO = 61; + BIO_CTRL_DGRAM_SCTP_GET_RCVINFO = 62; + BIO_CTRL_DGRAM_SCTP_SET_RCVINFO = 63; + BIO_CTRL_DGRAM_SCTP_GET_PRINFO = 64; + BIO_CTRL_DGRAM_SCTP_SET_PRINFO = 65; + BIO_CTRL_DGRAM_SCTP_SAVE_SHUTDOWN = 70; + + BIO_CTRL_DGRAM_SET_PEEK_MODE = 71; + + (* modifiers *) + BIO_FP_READ = $02; + BIO_FP_WRITE = $04; + BIO_FP_APPEND = $08; + BIO_FP_TEXT = $10; + + BIO_FLAGS_READ = $01; + BIO_FLAGS_WRITE = $02; + BIO_FLAGS_IO_SPECIAL = $04; + BIO_FLAGS_RWS = BIO_FLAGS_READ or BIO_FLAGS_WRITE or BIO_FLAGS_IO_SPECIAL; + BIO_FLAGS_SHOULD_RETRY = $08; + + BIO_FLAGS_BASE64_NO_NL = $100; + + (* + * This is used with memory BIOs: + * BIO_FLAGS_MEM_RDONLY means we shouldn't free up or change the data in any way; + * BIO_FLAGS_NONCLEAR_RST means we shouldn't clear data on reset. + *) + BIO_FLAGS_MEM_RDONLY = $200; + BIO_FLAGS_NONCLEAR_RST = $400; + + BIO_RR_SSL_X509_LOOKUP = $01; + (* Returned from the connect BIO when a connect would have blocked *) + BIO_RR_CONNECT = $02; + (* Returned from the accept BIO when an accept would have blocked *) + BIO_RR_ACCEPT = $03; + + (* These are passed by the BIO callback *) + BIO_CB_FREE = $01; + BIO_CB_READ = $02; + BIO_CB_WRITE = $03; + BIO_CB_PUTS = $04; + BIO_CB_GETS = $05; + BIO_CB_CTRL = $06; +///* +// * The callback is called before and after the underling operation, The +// * BIO_CB_RETURN flag indicates if it is after the call +// */ +//# define BIO_CB_RETURN 0x80 +//# define BIO_CB_return(a) ((a)|BIO_CB_RETURN) +//# define BIO_cb_pre(a) (!((a)&BIO_CB_RETURN)) +//# define BIO_cb_post(a) ((a)&BIO_CB_RETURN) + + BIO_C_SET_CONNECT = 100; + BIO_C_DO_STATE_MACHINE = 101; + BIO_C_SET_NBIO = 102; + (* BIO_C_SET_PROXY_PARAM = 103 *) + BIO_C_SET_FD = 104; + BIO_C_GET_FD = 105; + BIO_C_SET_FILE_PTR = 106; + BIO_C_GET_FILE_PTR = 107; + BIO_C_SET_FILENAME = 108; + BIO_C_SET_SSL = 109; + BIO_C_GET_SSL = 110; + BIO_C_SET_MD = 111; + BIO_C_GET_MD = 112; + BIO_C_GET_CIPHER_STATUS = 113; + BIO_C_SET_BUF_MEM = 114; + BIO_C_GET_BUF_MEM_PTR = 115; + BIO_C_GET_BUFF_NUM_LINES = 116; + BIO_C_SET_BUFF_SIZE = 117; + BIO_C_SET_ACCEPT = 118; + BIO_C_SSL_MODE = 119; + BIO_C_GET_MD_CTX = 120; + (* BIO_C_GET_PROXY_PARAM = 121 *) + BIO_C_SET_BUFF_READ_DATA = 122;(* data to read first *) + BIO_C_GET_CONNECT = 123; + BIO_C_GET_ACCEPT = 124; + BIO_C_SET_SSL_RENEGOTIATE_BYTES = 125; + BIO_C_GET_SSL_NUM_RENEGOTIATES = 126; + BIO_C_SET_SSL_RENEGOTIATE_TIMEOUT = 127; + BIO_C_FILE_SEEK = 128; + BIO_C_GET_CIPHER_CTX = 129; + BIO_C_SET_BUF_MEM_EOF_RETURN = 130;(* return end of input + * value *) + BIO_C_SET_BIND_MODE = 131; + BIO_C_GET_BIND_MODE = 132; + BIO_C_FILE_TELL = 133; + BIO_C_GET_SOCKS = 134; + BIO_C_SET_SOCKS = 135; + + BIO_C_SET_WRITE_BUF_SIZE = 136;(* for BIO_s_bio *) + BIO_C_GET_WRITE_BUF_SIZE = 137; + BIO_C_MAKE_BIO_PAIR = 138; + BIO_C_DESTROY_BIO_PAIR = 139; + BIO_C_GET_WRITE_GUARANTEE = 140; + BIO_C_GET_READ_REQUEST = 141; + BIO_C_SHUTDOWN_WR = 142; + BIO_C_NREAD0 = 143; + BIO_C_NREAD = 144; + BIO_C_NWRITE0 = 145; + BIO_C_NWRITE = 146; + BIO_C_RESET_READ_REQUEST = 147; + BIO_C_SET_MD_CTX = 148; + + BIO_C_SET_PREFIX = 149; + BIO_C_GET_PREFIX = 150; + BIO_C_SET_SUFFIX = 151; + BIO_C_GET_SUFFIX = 152; + + BIO_C_SET_EX_ARG = 153; + BIO_C_GET_EX_ARG = 154; + + BIO_C_SET_CONNECT_MODE = 155; + + BIO_SOCK_REUSEADDR = $01; + BIO_SOCK_V6_ONLY = $02; + BIO_SOCK_KEEPALIVE = $04; + BIO_SOCK_NONBLOCK = $08; + BIO_SOCK_NODELAY = $10; + +type + BIO_ADDR = Pointer; // bio_addr_st + PBIO_ADDR = ^BIO_ADDR; + BIO_ADDRINFO = Pointer; // bio_addrinfo_st + PBIO_ADDRINFO = ^BIO_ADDRINFO; + PPBIO_ADDRINFO = ^PBIO_ADDRINFO; + BIO_callback_fn = function(b: PBIO; oper: TIdC_INT; const argp: PIdAnsiChar; + argi: TIdC_INT; argl: TIdC_LONG; ret: TIdC_LONG): TIdC_LONG; + BIO_callback_fn_ex = function(b: PBIO; oper: TIdC_INT; const argp: PIdAnsiChar; len: TIdC_SIZET; argi: TIdC_INT; argl: TIdC_LONG; ret: TIdC_INT; processed: PIdC_SIZET): TIdC_LONG; + BIO_METHOD = Pointer; // bio_method_st + PBIO_METHOD = ^BIO_METHOD; + BIO_info_cb = function(v1: PBIO; v2: TIdC_INT; v3: TIdC_INT): TIdC_INT; + PBIO_info_cb = ^BIO_info_cb; + asn1_ps_func = function(b: PBIO; pbuf: PPIdAnsiChar; plen: PIdC_INT; parg: Pointer): TIdC_INT; + + bio_dgram_sctp_sndinfo = record + snd_sid: TIdC_UINT16; + snd_flags: TIdC_UINT16; + snd_ppid: TIdC_UINT32; + snd_context: TIdC_UINT32; + end; + + bio_dgram_sctp_rcvinfo = record + rcv_sid: TIdC_UINT16; + rcv_ssn: TIdC_UINT16; + rcv_flags: TIdC_UINT16; + rcv_ppid: TIdC_UINT32; + rcv_tsn: TIdC_UINT32; + rcv_cumtsn: TIdC_UINT32; + rcv_context: TIdC_UINT32; + end; + + bio_dgram_sctp_prinfo = record + pr_policy: TIdC_UINT16; + pr_value: TIdC_UINT32; + end; + + BIO_hostserv_priorities = (BIO_PARSE_PRIO_HOST, BIO_PARSE_PRIO_SERV); + + BIO_lookup_type = (BIO_LOOKUP_CLIENT, BIO_LOOKUP_SERVER); + + BIO_sock_info_u = record + addr: PBIO_ADDR; + end; + PBIO_sock_info_u = ^BIO_sock_info_u; + + BIO_sock_info_type = (BIO_SOCK_INFO_ADDRESS); + + { The EXTERNALSYM directive is ignored by FPC, however, it is used by Delphi as follows: + + The EXTERNALSYM directive prevents the specified Delphi symbol from appearing in header + files generated for C++. } + + {$EXTERNALSYM BIO_get_new_index} {introduced 1.1.0} + {$EXTERNALSYM BIO_set_flags} + {$EXTERNALSYM BIO_test_flags} + {$EXTERNALSYM BIO_clear_flags} + {$EXTERNALSYM BIO_get_callback} + {$EXTERNALSYM BIO_set_callback} + {$EXTERNALSYM BIO_get_callback_ex} {introduced 1.1.0} + {$EXTERNALSYM BIO_set_callback_ex} {introduced 1.1.0} + {$EXTERNALSYM BIO_get_callback_arg} + {$EXTERNALSYM BIO_set_callback_arg} + {$EXTERNALSYM BIO_method_name} + {$EXTERNALSYM BIO_method_type} +// {$EXTERNALSYM PBIO} + {$EXTERNALSYM BIO_ctrl_pending} + {$EXTERNALSYM BIO_ctrl_wpending} + {$EXTERNALSYM BIO_ctrl_get_write_guarantee} + {$EXTERNALSYM BIO_ctrl_get_read_request} + {$EXTERNALSYM BIO_ctrl_reset_read_request} + {$EXTERNALSYM BIO_set_ex_data} + {$EXTERNALSYM BIO_get_ex_data} + {$EXTERNALSYM BIO_number_read} + {$EXTERNALSYM BIO_number_written} + {$EXTERNALSYM BIO_s_file} + {$EXTERNALSYM BIO_new_file} + {$EXTERNALSYM BIO_new} + {$EXTERNALSYM BIO_free} + {$EXTERNALSYM BIO_set_data} {introduced 1.1.0} + {$EXTERNALSYM BIO_get_data} {introduced 1.1.0} + {$EXTERNALSYM BIO_set_init} {introduced 1.1.0} + {$EXTERNALSYM BIO_get_init} {introduced 1.1.0} + {$EXTERNALSYM BIO_set_shutdown} {introduced 1.1.0} + {$EXTERNALSYM BIO_get_shutdown} {introduced 1.1.0} + {$EXTERNALSYM BIO_vfree} + {$EXTERNALSYM BIO_up_ref} {introduced 1.1.0} + {$EXTERNALSYM BIO_read} + {$EXTERNALSYM BIO_read_ex} {introduced 1.1.0} + {$EXTERNALSYM BIO_gets} + {$EXTERNALSYM BIO_write} + {$EXTERNALSYM BIO_write_ex} {introduced 1.1.0} + {$EXTERNALSYM BIO_puts} + {$EXTERNALSYM BIO_indent} + {$EXTERNALSYM BIO_ctrl} + {$EXTERNALSYM BIO_callback_ctrl} + {$EXTERNALSYM BIO_ptr_ctrl} + {$EXTERNALSYM BIO_int_ctrl} + {$EXTERNALSYM BIO_push} + {$EXTERNALSYM BIO_pop} + {$EXTERNALSYM BIO_free_all} + {$EXTERNALSYM BIO_find_type} + {$EXTERNALSYM BIO_next} + {$EXTERNALSYM BIO_set_next} {introduced 1.1.0} + {$EXTERNALSYM BIO_get_retry_BIO} + {$EXTERNALSYM BIO_get_retry_reason} + {$EXTERNALSYM BIO_set_retry_reason} {introduced 1.1.0} + {$EXTERNALSYM BIO_dup_chain} + {$EXTERNALSYM BIO_nread0} + {$EXTERNALSYM BIO_nread} + {$EXTERNALSYM BIO_nwrite0} + {$EXTERNALSYM BIO_nwrite} + {$EXTERNALSYM BIO_debug_callback} + {$EXTERNALSYM BIO_s_mem} + {$EXTERNALSYM BIO_s_secmem} {introduced 1.1.0} + {$EXTERNALSYM BIO_new_mem_buf} + {$EXTERNALSYM BIO_s_socket} + {$EXTERNALSYM BIO_s_connect} + {$EXTERNALSYM BIO_s_accept} + {$EXTERNALSYM BIO_s_fd} + {$EXTERNALSYM BIO_s_log} + {$EXTERNALSYM BIO_s_bio} + {$EXTERNALSYM BIO_s_null} + {$EXTERNALSYM BIO_f_null} + {$EXTERNALSYM BIO_f_buffer} + {$EXTERNALSYM BIO_f_linebuffer} {introduced 1.1.0} + {$EXTERNALSYM BIO_f_nbio_test} + {$EXTERNALSYM BIO_s_datagram} + {$EXTERNALSYM BIO_dgram_non_fatal_error} + {$EXTERNALSYM BIO_new_dgram} + {$EXTERNALSYM BIO_sock_should_retry} + {$EXTERNALSYM BIO_sock_non_fatal_error} + {$EXTERNALSYM BIO_fd_should_retry} + {$EXTERNALSYM BIO_fd_non_fatal_error} + {$EXTERNALSYM BIO_dump} + {$EXTERNALSYM BIO_dump_indent} + {$EXTERNALSYM BIO_hex_string} + {$EXTERNALSYM BIO_ADDR_new} {introduced 1.1.0} + {$EXTERNALSYM BIO_ADDR_rawmake} {introduced 1.1.0} + {$EXTERNALSYM BIO_ADDR_free} {introduced 1.1.0} + {$EXTERNALSYM BIO_ADDR_clear} {introduced 1.1.0} + {$EXTERNALSYM BIO_ADDR_family} {introduced 1.1.0} + {$EXTERNALSYM BIO_ADDR_rawaddress} {introduced 1.1.0} + {$EXTERNALSYM BIO_ADDR_rawport} {introduced 1.1.0} + {$EXTERNALSYM BIO_ADDR_hostname_string} {introduced 1.1.0} + {$EXTERNALSYM BIO_ADDR_service_string} {introduced 1.1.0} + {$EXTERNALSYM BIO_ADDR_path_string} {introduced 1.1.0} + {$EXTERNALSYM BIO_ADDRINFO_next} {introduced 1.1.0} + {$EXTERNALSYM BIO_ADDRINFO_family} {introduced 1.1.0} + {$EXTERNALSYM BIO_ADDRINFO_socktype} {introduced 1.1.0} + {$EXTERNALSYM BIO_ADDRINFO_protocol} {introduced 1.1.0} + {$EXTERNALSYM BIO_ADDRINFO_address} {introduced 1.1.0} + {$EXTERNALSYM BIO_ADDRINFO_free} {introduced 1.1.0} + {$EXTERNALSYM BIO_parse_hostserv} {introduced 1.1.0} + {$EXTERNALSYM BIO_lookup} {introduced 1.1.0} + {$EXTERNALSYM BIO_lookup_ex} {introduced 1.1.0} + {$EXTERNALSYM BIO_sock_error} + {$EXTERNALSYM BIO_socket_ioctl} + {$EXTERNALSYM BIO_socket_nbio} + {$EXTERNALSYM BIO_sock_init} + {$EXTERNALSYM BIO_set_tcp_ndelay} + {$EXTERNALSYM BIO_sock_info} {introduced 1.1.0} + {$EXTERNALSYM BIO_socket} {introduced 1.1.0} + {$EXTERNALSYM BIO_connect} {introduced 1.1.0} + {$EXTERNALSYM BIO_bind} {introduced 1.1.0} + {$EXTERNALSYM BIO_listen} {introduced 1.1.0} + {$EXTERNALSYM BIO_accept_ex} {introduced 1.1.0} + {$EXTERNALSYM BIO_closesocket} {introduced 1.1.0} + {$EXTERNALSYM BIO_new_socket} + {$EXTERNALSYM BIO_new_connect} + {$EXTERNALSYM BIO_new_accept} + {$EXTERNALSYM BIO_new_fd} + {$EXTERNALSYM BIO_new_bio_pair} + {$EXTERNALSYM BIO_copy_next_retry} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +var + {$EXTERNALSYM BIO_get_flags} {removed 1.0.0} + {$EXTERNALSYM BIO_set_retry_special} {removed 1.0.0} + {$EXTERNALSYM BIO_set_retry_read} {removed 1.0.0} + {$EXTERNALSYM BIO_set_retry_write} {removed 1.0.0} + {$EXTERNALSYM BIO_clear_retry_flags} {removed 1.0.0} + {$EXTERNALSYM BIO_get_retry_flags} {removed 1.0.0} + {$EXTERNALSYM BIO_should_read} {removed 1.0.0} + {$EXTERNALSYM BIO_should_write} {removed 1.0.0} + {$EXTERNALSYM BIO_should_io_special} {removed 1.0.0} + {$EXTERNALSYM BIO_retry_type} {removed 1.0.0} + {$EXTERNALSYM BIO_should_retry} {removed 1.0.0} + {$EXTERNALSYM BIO_do_connect} {removed 1.0.0} + {$EXTERNALSYM BIO_do_accept} {removed 1.0.0} + {$EXTERNALSYM BIO_do_handshake} {removed 1.0.0} + {$EXTERNALSYM BIO_get_mem_data} {removed 1.0.0} + {$EXTERNALSYM BIO_set_mem_buf} {removed 1.0.0} + {$EXTERNALSYM BIO_get_mem_ptr} {removed 1.0.0} + {$EXTERNALSYM BIO_set_mem_eof_return} {removed 1.0.0} + BIO_get_flags: function (const b: PBIO): TIdC_INT; cdecl = nil; {removed 1.0.0} + BIO_set_retry_special: procedure (b: PBIO); cdecl = nil; {removed 1.0.0} + BIO_set_retry_read: procedure (b: PBIO); cdecl = nil; {removed 1.0.0} + BIO_set_retry_write: procedure (b: PBIO); cdecl = nil; {removed 1.0.0} + +(* These are normally used internally in BIOs *) + BIO_clear_retry_flags: procedure (b: PBIO); cdecl = nil; {removed 1.0.0} + BIO_get_retry_flags: function (b: PBIO): TIdC_INT; cdecl = nil; {removed 1.0.0} + +(* These should be used by the application to tell why we should retry *) + BIO_should_read: function (b: PBIO): TIdC_INT; cdecl = nil; {removed 1.0.0} + BIO_should_write: function (b: PBIO): TIdC_INT; cdecl = nil; {removed 1.0.0} + BIO_should_io_special: function (b: PBIO): TIdC_INT; cdecl = nil; {removed 1.0.0} + BIO_retry_type: function (b: PBIO): TIdC_INT; cdecl = nil; {removed 1.0.0} + BIO_should_retry: function (b: PBIO): TIdC_INT; cdecl = nil; {removed 1.0.0} + +(* BIO_s_accept() and BIO_s_connect() *) + BIO_do_connect: function (b: PBIO): TIdC_LONG; cdecl = nil; {removed 1.0.0} + BIO_do_accept: function (b: PBIO): TIdC_LONG; cdecl = nil; {removed 1.0.0} + BIO_do_handshake: function (b: PBIO): TIdC_LONG; cdecl = nil; {removed 1.0.0} + + BIO_get_mem_data: function (b: PBIO; pp: PIdAnsiChar) : TIdC_INT; cdecl = nil; {removed 1.0.0} + BIO_set_mem_buf: function (b: PBIO; bm: PIdAnsiChar; c: TIdC_INT): TIdC_INT; cdecl = nil; {removed 1.0.0} + BIO_get_mem_ptr: function (b: PBIO; pp: PIdAnsiChar): TIdC_INT; cdecl = nil; {removed 1.0.0} + BIO_set_mem_eof_return: function (b: PBIO; v: TIdC_INT): TIdC_INT; cdecl = nil; {removed 1.0.0} + + BIO_get_new_index: function : TIdC_INT; cdecl = nil; {introduced 1.1.0} + BIO_set_flags: procedure (b: PBIO; flags: TIdC_INT); cdecl = nil; + BIO_test_flags: function (const b: PBIO; flags: TIdC_INT): TIdC_INT; cdecl = nil; + BIO_clear_flags: procedure (b: PBIO; flags: TIdC_INT); cdecl = nil; + + BIO_get_callback: function (b: PBIO): BIO_callback_fn; cdecl = nil; + BIO_set_callback: procedure (b: PBIO; callback: BIO_callback_fn); cdecl = nil; + + BIO_get_callback_ex: function (b: PBIO): BIO_callback_fn_ex; cdecl = nil; {introduced 1.1.0} + BIO_set_callback_ex: procedure (b: PBIO; callback: BIO_callback_fn_ex); cdecl = nil; {introduced 1.1.0} + + BIO_get_callback_arg: function (const b: PBIO): PIdAnsiChar; cdecl = nil; + BIO_set_callback_arg: procedure (var b: PBIO; arg: PIdAnsiChar); cdecl = nil; + + BIO_method_name: function (const b: PBIO): PIdAnsiChar; cdecl = nil; + BIO_method_type: function (const b: PBIO): TIdC_INT; cdecl = nil; + +// {$HPPEMIT '# define BIO_set_app_data(s,arg) BIO_set_ex_data(s,0,arg)'} +// {$HPPEMIT '# define BIO_get_app_data(s) BIO_get_ex_data(s,0)'} +// +// {$HPPEMIT '# define BIO_set_nbio(b,n) BIO_ctrl(b,BIO_C_SET_NBIO,(n),NULL)'} +// +// {$HPPEMIT '# ifndef OPENSSL_NO_SOCK'} +// (* IP families we support, for BIO_s_connect() and BIO_s_accept() *) +// (* Note: the underlying operating system may not support some of them *) +// {$HPPEMIT '# define BIO_FAMILY_IPV4 4'} +// {$HPPEMIT '# define BIO_FAMILY_IPV6 6'} +// {$HPPEMIT '# define BIO_FAMILY_IPANY 256'} +// +// (* BIO_s_connect() *) +// {$HPPEMIT '# define BIO_set_conn_hostname(b,name) BIO_ctrl(b,BIO_C_SET_CONNECT,0,'} +// (char (name)) +// {$HPPEMIT '# define BIO_set_conn_port(b,port) BIO_ctrl(b,BIO_C_SET_CONNECT,1,'} +// (char (port)) +// {$HPPEMIT '# define BIO_set_conn_address(b,addr) BIO_ctrl(b,BIO_C_SET_CONNECT,2,'} +// (char (addr)) +// {$HPPEMIT '# define BIO_set_conn_ip_family(b,f) BIO_int_ctrl(b,BIO_C_SET_CONNECT,3,f)'} +// {$HPPEMIT '# define BIO_get_conn_hostname(b) (( char )BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,0))'} +// {$HPPEMIT '# define BIO_get_conn_port(b) (( char )BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,1))'} +// {$HPPEMIT '# define BIO_get_conn_address(b) (( PBIO_ADDR )BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,2))'} +// {$HPPEMIT '# define BIO_get_conn_ip_family(b) BIO_ctrl(b,BIO_C_GET_CONNECT,3,NULL)'} +// {$HPPEMIT '# define BIO_set_conn_mode(b,n) BIO_ctrl(b,BIO_C_SET_CONNECT_MODE,(n),NULL)'} +// +// (* BIO_s_accept() *) +// {$HPPEMIT '# define BIO_set_accept_name(b,name) BIO_ctrl(b,BIO_C_SET_ACCEPT,0,'} +// {$EXTERNALSYM PBIO} +// (char (name)) +// {$HPPEMIT '# define BIO_set_accept_port(b,port) BIO_ctrl(b,BIO_C_SET_ACCEPT,1,'} +// (char (port)) +// {$HPPEMIT '# define BIO_get_accept_name(b) (( char )BIO_ptr_ctrl(b,BIO_C_GET_ACCEPT,0))'} +// {$HPPEMIT '# define BIO_get_accept_port(b) (( char )BIO_ptr_ctrl(b,BIO_C_GET_ACCEPT,1))'} +// {$HPPEMIT '# define BIO_get_peer_name(b) (( char )BIO_ptr_ctrl(b,BIO_C_GET_ACCEPT,2))'} +// {$HPPEMIT '# define BIO_get_peer_port(b) (( char )BIO_ptr_ctrl(b,BIO_C_GET_ACCEPT,3))'} +// (* #define BIO_set_nbio(b,n) BIO_ctrl(b,BIO_C_SET_NBIO,(n),NULL) *) +// {$HPPEMIT '# define BIO_set_nbio_accept(b,n) # define BIO_set_nbio_accept(b,n) BIO_ctrl(b,BIO_C_SET_ACCEPT,2,(n)?(procedure )'a':NULL) BIO_ctrl(b,BIO_C_SET_ACCEPT,3,'} +// (char (bio)) +// {$HPPEMIT '# define BIO_set_accept_ip_family(b,f) BIO_int_ctrl(b,BIO_C_SET_ACCEPT,4,f)'} +// {$HPPEMIT '# define BIO_get_accept_ip_family(b) BIO_ctrl(b,BIO_C_GET_ACCEPT,4,NULL)'} +// +// (* Aliases kept for backward compatibility *) +// {$HPPEMIT '# define BIO_BIND_NORMAL 0'} +// {$HPPEMIT '# define BIO_BIND_REUSEADDR BIO_SOCK_REUSEADDR'} +// {$HPPEMIT '# define BIO_BIND_REUSEADDR_IF_UNUSED BIO_SOCK_REUSEADDR'} +// {$HPPEMIT '# define BIO_set_bind_mode(b,mode) BIO_ctrl(b,BIO_C_SET_BIND_MODE,mode,NULL)'} +// {$HPPEMIT '# define BIO_get_bind_mode(b) BIO_ctrl(b,BIO_C_GET_BIND_MODE,0,NULL)'} +// +// (* BIO_s_accept() and BIO_s_connect() *) +// {$HPPEMIT '# define BIO_do_connect(b) BIO_do_handshake(b)'} +// {$HPPEMIT '# define BIO_do_accept(b) BIO_do_handshake(b)'} +// {$HPPEMIT '# endif'} (* OPENSSL_NO_SOCK *) +// +// {$HPPEMIT '# define BIO_do_handshake(b) BIO_ctrl(b,BIO_C_DO_STATE_MACHINE,0,NULL)'} +// +// (* BIO_s_datagram(), BIO_s_fd(), BIO_s_socket(), BIO_s_accept() and BIO_s_connect() *) +// {$HPPEMIT '# define BIO_set_fd(b,fd,c) BIO_int_ctrl(b,BIO_C_SET_FD,c,fd)'} +// {$HPPEMIT '# define BIO_get_fd(b,c) BIO_ctrl(b,BIO_C_GET_FD,0,(char (c))'} +// +// (* BIO_s_file() *) +// {$HPPEMIT '# define BIO_set_fp(b,fp,c) BIO_ctrl(b,BIO_C_SET_FILE_PTR,c,(char (fp))'} +// {$HPPEMIT '# define BIO_get_fp(b,fpp) BIO_ctrl(b,BIO_C_GET_FILE_PTR,0,(char (fpp))'} +// +// (* BIO_s_fd() and BIO_s_file() *) +// {$HPPEMIT '# define BIO_seek(b,ofs(int)BIO_ctrl(b,BIO_C_FILE_SEEK,ofs,NULL)'} +// {$HPPEMIT '# define BIO_tell(b) (int)BIO_ctrl(b,BIO_C_FILE_TELL,0,NULL)'} +// +// (* +// * name is cast to lose , but might be better to route through a +// * cFunction so we can do it safely +// *) +// {$HPPEMIT '# ifdef CONST_STRICT'} +// (* +// * If you are wondering why this isn't defined, its because CONST_STRICT is +// * purely a compile-time kludge to allow to be checked. +// *) +//// function BIO_read_filename(b: PBIO; const name: PIdAnsiChar): TIdC_INT; +// {$HPPEMIT '# define BIO_write_filename(b,name(int)BIO_ctrl(b,BIO_C_SET_FILENAME,'} +// BIO_CLOSE or BIO_FP_WRITE,name) +// {$HPPEMIT '# define BIO_append_filename(b,name(int)BIO_ctrl(b,BIO_C_SET_FILENAME,'} +// BIO_CLOSE or BIO_FP_APPEND,name) +// {$HPPEMIT '# define BIO_rw_filename(b,name(int)BIO_ctrl(b,BIO_C_SET_FILENAME,'} +// BIO_CLOSE or BIO_FP_READ or BIO_FP_WRITE,name) +// +// (* +// * WARNING WARNING, this ups the reference count on the read bio of the SSL +// * structure. This is because the ssl read PBIO is now pointed to by the +// * next_bio field in the bio. So when you free the PBIO, make sure you are +// * doing a BIO_free_all() to catch the underlying PBIO. +// *) +// {$HPPEMIT '# define BIO_set_ssl(b,ssl,c) BIO_ctrl(b,BIO_C_SET_SSL,c,(char (ssl))'} +// {$HPPEMIT '# define BIO_get_ssl(b,sslp) BIO_ctrl(b,BIO_C_GET_SSL,0,(char (sslp))'} +// {$HPPEMIT '# define BIO_set_ssl_mode(b,client) BIO_ctrl(b,BIO_C_SSL_MODE,client,NULL)'} +// {$HPPEMIT '# define BIO_set_ssl_renegotiate_bytes(b,num)'} +// BIO_ctrl(b,BIO_C_SET_SSL_RENEGOTIATE_BYTES,num,0) +// {$HPPEMIT '# define BIO_get_num_renegotiates(b)'} +// BIO_ctrl(b,BIO_C_GET_SSL_NUM_RENEGOTIATES,0,0) +// {$HPPEMIT '# define BIO_set_ssl_renegotiate_timeout(b,seconds)'} +// BIO_ctrl(b,BIO_C_SET_SSL_RENEGOTIATE_TIMEOUT,seconds,0) +// +// (* defined in evp.h *) +// (* #define BIO_set_md(b,md) BIO_ctrl(b,BIO_C_SET_MD,1,(char )(md)) *) +// +// (* For the BIO_f_buffer() type *) +// {$HPPEMIT '# define BIO_get_buffer_num_lines(b) BIO_ctrl(b,BIO_C_GET_BUFF_NUM_LINES,0,NULL)'} +// {$HPPEMIT '# define BIO_set_buffer_size(b,size) BIO_ctrl(b,BIO_C_SET_BUFF_SIZE,size,NULL)'} +// {$HPPEMIT '# define BIO_set_read_buffer_size(b,size) BIO_int_ctrl(b,BIO_C_SET_BUFF_SIZE,size,0)'} +// {$HPPEMIT '# define BIO_set_write_buffer_size(b,size) BIO_int_ctrl(b,BIO_C_SET_BUFF_SIZE,size,1)'} +// {$HPPEMIT '# define BIO_set_buffer_read_data(b,buf,num) BIO_ctrl(b,BIO_C_SET_BUFF_READ_DATA,num,buf)'} +// +// (* Don't use the next one unless you know what you are doing :-) */ +// {$HPPEMIT '# define BIO_dup_state(b,ret) BIO_ctrl(b,BIO_CTRL_DUP,0,(char (ret))'} +// +// {$HPPEMIT '# define BIO_reset(b) (int)BIO_ctrl(b,BIO_CTRL_RESET,0,NULL)'} +// {$HPPEMIT '# define BIO_eof(b) (int)BIO_ctrl(b,BIO_CTRL_EOF,0,NULL)'} +// {$HPPEMIT '# define BIO_set_close(b,c) (int)BIO_ctrl(b,BIO_CTRL_SET_CLOSE,(c),NULL)'} +// {$HPPEMIT '# define BIO_get_close(b) (int)BIO_ctrl(b,BIO_CTRL_GET_CLOSE,0,NULL)'} +// {$HPPEMIT '# define BIO_pending(b) (int)BIO_ctrl(b,BIO_CTRL_PENDING,0,NULL)'} +// {$HPPEMIT '# define BIO_wpending(b) (int)BIO_ctrl(b,BIO_CTRL_WPENDING,0,NULL)'} + (* ...pending macros have inappropriate return type *) + BIO_ctrl_pending: function (b: PBIO): TIdC_SIZET; cdecl = nil; + BIO_ctrl_wpending: function (b: PBIO): TIdC_SIZET; cdecl = nil; +// {$HPPEMIT '# define BIO_flush(b) (int)BIO_ctrl(b,BIO_CTRL_FLUSH,0,NULL)'} +// {$HPPEMIT '# define BIO_get_info_callback(b,cbp(int)BIO_ctrl(b,BIO_CTRL_GET_CALLBACK,0,'} +// cbp) +// {$HPPEMIT '# define BIO_set_info_callback(b,cb(int)BIO_callback_ctrl(b,BIO_CTRL_SET_CALLBACK,cb)'} +// +// (* For the BIO_f_buffer() type *) +// {$HPPEMIT '# define BIO_buffer_get_num_lines(b) BIO_ctrl(b,BIO_CTRL_GET,0,NULL)'} +// {$HPPEMIT '# define BIO_buffer_peek(b,s,l) BIO_ctrl(b,BIO_CTRL_PEEK,(l),(s))'} +// +// (* For BIO_s_bio() *) +// {$HPPEMIT '# define BIO_set_write_buf_size(b,size(int)BIO_ctrl(b,BIO_C_SET_WRITE_BUF_SIZE,size,NULL)'} +// {$HPPEMIT '# define BIO_get_write_buf_size(b,size(TIdC_SIZET)BIO_ctrl(b,BIO_C_GET_WRITE_BUF_SIZE,size,NULL)'} +// {$HPPEMIT '# define BIO_make_bio_pair(b1,b2) (int)BIO_ctrl(b1,BIO_C_MAKE_BIO_PAIR,0,b2)'} +// {$HPPEMIT '# define BIO_destroy_bio_pair(b) (int)BIO_ctrl(b,BIO_C_DESTROY_BIO_PAIR,0,NULL)'} +// {$HPPEMIT '# define BIO_shutdown_wr(b(int)BIO_ctrl(b, BIO_C_SHUTDOWN_WR, 0, NULL)'} +// (* macros with inappropriate type -- but ...pending macros use int too: *) +// {$HPPEMIT '# define BIO_get_write_guarantee(b(int)BIO_ctrl(b,BIO_C_GET_WRITE_GUARANTEE,0,NULL)'} +// {$HPPEMIT '# define BIO_get_read_request(b) (int)BIO_ctrl(b,BIO_C_GET_READ_REQUEST,0,NULL)'} + BIO_ctrl_get_write_guarantee: function (b: PBIO): TIdC_SIZET; cdecl = nil; + BIO_ctrl_get_read_request: function (b: PBIO): TIdC_SIZET; cdecl = nil; + BIO_ctrl_reset_read_request: function (b: PBIO): TIdC_INT; cdecl = nil; + + (* ctrl macros for dgram *) +// {$HPPEMIT '# define BIO_ctrl_dgram_connect(b,peer)'} +// (TIdC_INT)BIO_ctrl(b,BIO_CTRL_DGRAM_CONNECT,0, (char (peer)) +// {$HPPEMIT '# define BIO_ctrl_set_connected(b,peer)'} +// (TIdC_INT)BIO_ctrl(b, BIO_CTRL_DGRAM_SET_CONNECTED, 0, (char (peer)) +// {$HPPEMIT '# define BIO_dgram_recv_timedout(b)'} +// (TIdC_INT)BIO_ctrl(b, BIO_CTRL_DGRAM_GET_RECV_TIMER_EXP, 0, 0) +// {$HPPEMIT '# define BIO_dgram_send_timedout(b)'} +// (TIdC_INT)BIO_ctrl(b, BIO_CTRL_DGRAM_GET_SEND_TIMER_EXP, 0, 0) +// {$HPPEMIT '# define BIO_dgram_get_peer(b,peer)'} +// (TIdC_INT)BIO_ctrl(b, BIO_CTRL_DGRAM_GET_PEER, 0, (char (peer)) +// {$HPPEMIT '# define BIO_dgram_set_peer(b,peer)'} +// (TIdC_INT)BIO_ctrl(b, BIO_CTRL_DGRAM_SET_PEER, 0, (char (peer)) +// {$HPPEMIT '# define BIO_dgram_get_mtu_overhead(b)'} +// (Cardinal)BIO_ctrl((b), BIO_CTRL_DGRAM_GET_MTU_OVERHEAD, 0, 0) + +//#define BIO_get_ex_new_index(l, p, newf, dupf, freef) \ +// CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_BIO, l, p, newf, dupf, freef) + + BIO_set_ex_data: function (bio: PBIO; idx: TIdC_INT; data: Pointer): TIdC_INT; cdecl = nil; + BIO_get_ex_data: function (bio: PBIO; idx: TIdC_INT): Pointer; cdecl = nil; + BIO_number_read: function (bio: PBIO): TIdC_UINT64; cdecl = nil; + BIO_number_written: function (bio: PBIO): TIdC_UINT64; cdecl = nil; + + (* For BIO_f_asn1() *) +// function BIO_asn1_set_prefix(b: PBIO; prefix: ^asn1_ps_func; prefix_free: ^asn1_ps_func): TIdC_INT; +// function BIO_asn1_get_prefix(b: PBIO; pprefix: ^^asn1_ps_func; pprefix_free: ^^asn1_ps_func): TIdC_INT; +// function BIO_asn1_set_suffix(b: PBIO; suffix: ^asn1_ps_func; suffix_free: ^asn1_ps_func): TIdC_INT; +// function BIO_asn1_get_suffix(b: PBIO; psuffix: ^asn1_ps_func; psuffix_free: ^^asn1_ps_func): TIdC_INT; + + BIO_s_file: function : PBIO_METHOD; cdecl = nil; + BIO_new_file: function (const filename: PIdAnsiChar; const mode: PIdAnsiChar): PBIO; cdecl = nil; +// function BIO_new_fp(stream: cFile; close_flag: TIdC_INT): PBIO; + BIO_new: function (const cType: PBIO_METHOD): PBIO; cdecl = nil; + BIO_free: function (a: PBIO): TIdC_INT; cdecl = nil; + BIO_set_data: procedure (a: PBIO; ptr: Pointer); cdecl = nil; {introduced 1.1.0} + BIO_get_data: function (a: PBIO): Pointer; cdecl = nil; {introduced 1.1.0} + BIO_set_init: procedure (a: PBIO; init: TIdC_INT); cdecl = nil; {introduced 1.1.0} + BIO_get_init: function (a: PBIO): TIdC_INT; cdecl = nil; {introduced 1.1.0} + BIO_set_shutdown: procedure (a: PBIO; shut: TIdC_INT); cdecl = nil; {introduced 1.1.0} + BIO_get_shutdown: function (a: PBIO): TIdC_INT; cdecl = nil; {introduced 1.1.0} + BIO_vfree: procedure (a: PBIO); cdecl = nil; + BIO_up_ref: function (a: PBIO): TIdC_INT; cdecl = nil; {introduced 1.1.0} + BIO_read: function (b: PBIO; data: Pointer; dlen: TIdC_INT): TIdC_INT; cdecl = nil; + BIO_read_ex: function (b: PBIO; data: Pointer; dlen: TIdC_SIZET; readbytes: PIdC_SIZET): TIdC_INT; cdecl = nil; {introduced 1.1.0} + BIO_gets: function ( bp: PBIO; buf: PIdAnsiChar; size: TIdC_INT): TIdC_INT; cdecl = nil; + BIO_write: function (b: PBIO; const data: Pointer; dlen: TIdC_INT): TIdC_INT; cdecl = nil; + BIO_write_ex: function (b: PBIO; const data: Pointer; dlen: TIdC_SIZET; written: PIdC_SIZET): TIdC_INT; cdecl = nil; {introduced 1.1.0} + BIO_puts: function (bp: PBIO; const buf: PIdAnsiChar): TIdC_INT; cdecl = nil; + BIO_indent: function (b: PBIO; indent: TIdC_INT; max: TIdC_INT): TIdC_INT; cdecl = nil; + BIO_ctrl: function (bp: PBIO; cmd: TIdC_INT; larg: TIdC_LONG; parg: Pointer): TIdC_LONG; cdecl = nil; + BIO_callback_ctrl: function (b: PBIO; cmd: TIdC_INT; fp: PBIO_info_cb): TIdC_LONG; cdecl = nil; + BIO_ptr_ctrl: function (bp: PBIO; cmd: TIdC_INT; larg: TIdC_LONG): Pointer; cdecl = nil; + BIO_int_ctrl: function (bp: PBIO; cmd: TIdC_INT; larg: TIdC_LONG; iarg: TIdC_INT): TIdC_LONG; cdecl = nil; + BIO_push: function (b: PBIO; append: PBIO): PBIO; cdecl = nil; + BIO_pop: function (b: PBIO): PBIO; cdecl = nil; + BIO_free_all: procedure (a: PBIO); cdecl = nil; + BIO_find_type: function (b: PBIO; bio_type: TIdC_INT): PBIO; cdecl = nil; + BIO_next: function (b: PBIO): PBIO; cdecl = nil; + BIO_set_next: procedure (b: PBIO; next: PBIO); cdecl = nil; {introduced 1.1.0} + BIO_get_retry_BIO: function (bio: PBIO; reason: TIdC_INT): PBIO; cdecl = nil; + BIO_get_retry_reason: function (bio: PBIO): TIdC_INT; cdecl = nil; + BIO_set_retry_reason: procedure (bio: PBIO; reason: TIdC_INT); cdecl = nil; {introduced 1.1.0} + BIO_dup_chain: function (in_: PBIO): PBIO; cdecl = nil; + + BIO_nread0: function (bio: PBIO; buf: PPIdAnsiChar): TIdC_INT; cdecl = nil; + BIO_nread: function (bio: PBIO; buf: PPIdAnsiChar; num: TIdC_INT): TIdC_INT; cdecl = nil; + BIO_nwrite0: function (bio: PBIO; buf: PPIdAnsiChar): TIdC_INT; cdecl = nil; + BIO_nwrite: function (bio: PBIO; buf: PPIdAnsiChar; num: TIdC_INT): TIdC_INT; cdecl = nil; + + BIO_debug_callback: function (bio: PBIO; cmd: TIdC_INT; const argp: PIdAnsiChar; argi: TIdC_INT; argl: TIdC_LONG; ret: TIdC_LONG): TIdC_LONG; cdecl = nil; + + BIO_s_mem: function : PBIO_METHOD; cdecl = nil; + BIO_s_secmem: function : PBIO_METHOD; cdecl = nil; {introduced 1.1.0} + BIO_new_mem_buf: function (const buf: Pointer; len: TIdC_INT): PBIO; cdecl = nil; + + BIO_s_socket: function : PBIO_METHOD; cdecl = nil; + BIO_s_connect: function : PBIO_METHOD; cdecl = nil; + BIO_s_accept: function : PBIO_METHOD; cdecl = nil; + + BIO_s_fd: function : PBIO_METHOD; cdecl = nil; + BIO_s_log: function : PBIO_METHOD; cdecl = nil; + BIO_s_bio: function : PBIO_METHOD; cdecl = nil; + BIO_s_null: function : PBIO_METHOD; cdecl = nil; + BIO_f_null: function : PBIO_METHOD; cdecl = nil; + BIO_f_buffer: function : PBIO_METHOD; cdecl = nil; + BIO_f_linebuffer: function : PBIO_METHOD; cdecl = nil; {introduced 1.1.0} + BIO_f_nbio_test: function : PBIO_METHOD; cdecl = nil; + BIO_s_datagram: function : PBIO_METHOD; cdecl = nil; + BIO_dgram_non_fatal_error: function (error: TIdC_INT): TIdC_INT; cdecl = nil; + BIO_new_dgram: function (fd: TIdC_INT; close_flag: TIdC_INT): PBIO; cdecl = nil; + +// function BIO_s_datagram_sctp: PBIO_METHOD; +// function BIO_new_dgram_sctp(fd: TIdC_INT; close_flag: TIdC_INT): PBIO; +// function BIO_dgram_is_sctp(bio: PBIO): TIdC_INT; +// function BIO_dgram_sctp_notification_cb(bio: PBIO; handle_notifications(PBIO; +// context: Pointer; +// buf: Pointer): TIdC_INT, Pointer context); +// function BIO_dgram_sctp_wait_for_dry(b: PBIO): TIdC_INT; +// function BIO_dgram_sctp_msg_waiting(b: PBIO): TIdC_INT; + + BIO_sock_should_retry: function (i: TIdC_INT): TIdC_INT; cdecl = nil; + BIO_sock_non_fatal_error: function (error: TIdC_INT): TIdC_INT; cdecl = nil; + + BIO_fd_should_retry: function (i: TIdC_INT): TIdC_INT; cdecl = nil; + BIO_fd_non_fatal_error: function (error: TIdC_INT): TIdC_INT; cdecl = nil; +// function BIO_dump_cb( +// Pointer data: cb(; +// len: TIdC_SIZET; +// function: Pointer): u: TIdC_INT, Pointer function , PIdAnsiChar s, TIdC_INT len): u; +// function BIO_dump_indent_cb(TIdC_INT (cb( Pointer data, TIdC_SIZET len, Pointer function ): u: TIdC_INT, Pointer function , PIdAnsiChar s, TIdC_INT len, TIdC_INT indent): u; + BIO_dump: function (b: PBIO; const bytes: PIdAnsiChar; len: TIdC_INT): TIdC_INT; cdecl = nil; + BIO_dump_indent: function (b: PBIO; const bytes: PIdAnsiChar; len: TIdC_INT; indent: TIdC_INT): TIdC_INT; cdecl = nil; + +// function BIO_dump_fp(fp: cFile; const s: PByte; len: TIdC_INT): TIdC_INT; +// function BIO_dump_indent_fp(fp: cFile; const s: PByte; len: TIdC_INT; indent: TIdC_INT): TIdC_INT; + + BIO_hex_string: function (out_: PBIO; indent: TIdC_INT; width: TIdC_INT; data: PByte; datalen: TIdC_INT): TIdC_INT; cdecl = nil; + + BIO_ADDR_new: function : PBIO_ADDR; cdecl = nil; {introduced 1.1.0} + BIO_ADDR_rawmake: function (ap: PBIO_ADDR; familiy: TIdC_INT; const where: Pointer; wherelen: TIdC_SIZET; port: TIdC_SHORT): TIdC_INT; cdecl = nil; {introduced 1.1.0} + BIO_ADDR_free: procedure (a: PBIO_ADDR); cdecl = nil; {introduced 1.1.0} + BIO_ADDR_clear: procedure (ap: PBIO_ADDR); cdecl = nil; {introduced 1.1.0} + BIO_ADDR_family: function (const ap: PBIO_ADDR): TIdC_INT; cdecl = nil; {introduced 1.1.0} + BIO_ADDR_rawaddress: function (const ap: PBIO_ADDR; p: Pointer; l: PIdC_SIZET): TIdC_INT; cdecl = nil; {introduced 1.1.0} + BIO_ADDR_rawport: function (const ap: PBIO_ADDR): TIdC_SHORT; cdecl = nil; {introduced 1.1.0} + BIO_ADDR_hostname_string: function (const ap: PBIO_ADDR; numeric: TIdC_INT): PIdAnsiChar; cdecl = nil; {introduced 1.1.0} + BIO_ADDR_service_string: function (const ap: PBIO_ADDR; numeric: TIdC_INT): PIdAnsiChar; cdecl = nil; {introduced 1.1.0} + BIO_ADDR_path_string: function (const ap: PBIO_ADDR): PIdAnsiChar; cdecl = nil; {introduced 1.1.0} + + BIO_ADDRINFO_next: function (const bai: PBIO_ADDRINFO): PBIO_ADDRINFO; cdecl = nil; {introduced 1.1.0} + BIO_ADDRINFO_family: function (const bai: PBIO_ADDRINFO): TIdC_INT; cdecl = nil; {introduced 1.1.0} + BIO_ADDRINFO_socktype: function (const bai: PBIO_ADDRINFO): TIdC_INT; cdecl = nil; {introduced 1.1.0} + BIO_ADDRINFO_protocol: function (const bai: PBIO_ADDRINFO): TIdC_INT; cdecl = nil; {introduced 1.1.0} + BIO_ADDRINFO_address: function (const bai: PBIO_ADDRINFO): PBIO_ADDR; cdecl = nil; {introduced 1.1.0} + BIO_ADDRINFO_free: procedure (bai: PBIO_ADDRINFO); cdecl = nil; {introduced 1.1.0} + + BIO_parse_hostserv: function (const hostserv: PIdAnsiChar; host: PPIdAnsiChar; service: PPIdAnsiChar; hostserv_prio: BIO_hostserv_priorities): TIdC_INT; cdecl = nil; {introduced 1.1.0} + + BIO_lookup: function (const host: PIdAnsiChar; const service: PIdAnsiChar; lookup_type: BIO_lookup_type; family: TIdC_INT; socktype: TIdC_INT; res: PPBIO_ADDRINFO): TIdC_INT; cdecl = nil; {introduced 1.1.0} + BIO_lookup_ex: function (const host: PIdAnsiChar; const service: PIdAnsiChar; lookup_type: TIdC_INT; family: TIdC_INT; socktype: TIdC_INT; protocol: TIdC_INT; res: PPBIO_ADDRINFO): TIdC_INT; cdecl = nil; {introduced 1.1.0} + BIO_sock_error: function (sock: TIdC_INT): TIdC_INT; cdecl = nil; + BIO_socket_ioctl: function (fd: TIdC_INT; cType: TIdC_LONG; arg: Pointer): TIdC_INT; cdecl = nil; + BIO_socket_nbio: function (fd: TIdC_INT; mode: TIdC_INT): TIdC_INT; cdecl = nil; + BIO_sock_init: function : TIdC_INT; cdecl = nil; + + BIO_set_tcp_ndelay: function (sock: TIdC_INT; turn_on: TIdC_INT): TIdC_INT; cdecl = nil; + + BIO_sock_info: function (sock: TIdC_INT; type_: BIO_sock_info_type; info: PBIO_sock_info_u): TIdC_INT; cdecl = nil; {introduced 1.1.0} + + BIO_socket: function (domain: TIdC_INT; socktype: TIdC_INT; protocol: TIdC_INT; options: TIdC_INT): TIdC_INT; cdecl = nil; {introduced 1.1.0} + BIO_connect: function (sock: TIdC_INT; const addr: PBIO_ADDR; options: TIdC_INT): TIdC_INT; cdecl = nil; {introduced 1.1.0} + BIO_bind: function (sock: TIdC_INT; const addr: PBIO_ADDR; options: TIdC_INT): TIdC_INT; cdecl = nil; {introduced 1.1.0} + BIO_listen: function (sock: TIdC_INT; const addr: PBIO_ADDR; options: TIdC_INT): TIdC_INT; cdecl = nil; {introduced 1.1.0} + BIO_accept_ex: function (accept_sock: TIdC_INT; addr: PBIO_ADDR; options: TIdC_INT): TIdC_INT; cdecl = nil; {introduced 1.1.0} + BIO_closesocket: function (sock: TIdC_INT): TIdC_INT; cdecl = nil; {introduced 1.1.0} + + BIO_new_socket: function (sock: TIdC_INT; close_flag: TIdC_INT): PBIO; cdecl = nil; + BIO_new_connect: function (const host_port: PIdAnsiChar): PBIO; cdecl = nil; + BIO_new_accept: function (const host_port: PIdAnsiChar): PBIO; cdecl = nil; + + BIO_new_fd: function (fd: TIdC_INT; close_flag: TIdC_INT): PBIO; cdecl = nil; + + BIO_new_bio_pair: function (bio1: PPBIO; writebuf1: TIdC_SIZET; bio2: PPBIO; writebuf2: TIdC_SIZET): TIdC_INT; cdecl = nil; + (* + * If successful, returns 1 and in *bio1, *bio2 two BIO pair endpoints. + * Otherwise returns 0 and sets *bio1 and *bio2 to NULL. Size 0 uses default + * value. + *) + + BIO_copy_next_retry: procedure (b: PBIO); cdecl = nil; + +// BIO_METHOD *BIO_meth_new(int type, const char *name); +// void BIO_meth_free(BIO_METHOD *biom); +// int (*BIO_meth_get_write(const BIO_METHOD *biom)) (BIO *, const char *, int); +// int (*BIO_meth_get_write_ex(const BIO_METHOD *biom)) (BIO *, const char *, TIdC_SIZET, +// TIdC_SIZET *); +// int BIO_meth_set_write(BIO_METHOD *biom, +// int (*write) (BIO *, const char *, int)); +// int BIO_meth_set_write_ex(BIO_METHOD *biom, +// int (*bwrite) (BIO *, const char *, TIdC_SIZET, TIdC_SIZET *)); +// int (*BIO_meth_get_read(const BIO_METHOD *biom)) (BIO *, char *, int); +// int (*BIO_meth_get_read_ex(const BIO_METHOD *biom)) (BIO *, char *, TIdC_SIZET, TIdC_SIZET *); +// int BIO_meth_set_read(BIO_METHOD *biom, +// int (*read) (BIO *, char *, int)); +// int BIO_meth_set_read_ex(BIO_METHOD *biom, +// int (*bread) (BIO *, char *, TIdC_SIZET, TIdC_SIZET *)); +// int (*BIO_meth_get_puts(const BIO_METHOD *biom)) (BIO *, const char *); +// int BIO_meth_set_puts(BIO_METHOD *biom, +// int (*puts) (BIO *, const char *)); +// int (*BIO_meth_get_gets(const BIO_METHOD *biom)) (BIO *, char *, int); +// int BIO_meth_set_gets(BIO_METHOD *biom, +// int (*gets) (BIO *, char *, int)); +// long (*BIO_meth_get_ctrl(const BIO_METHOD *biom)) (BIO *, int, long, void *); +// int BIO_meth_set_ctrl(BIO_METHOD *biom, +// long (*ctrl) (BIO *, int, long, void *)); +// int (*BIO_meth_get_create(const BIO_METHOD *bion)) (BIO *); +// int BIO_meth_set_create(BIO_METHOD *biom, int (*create) (BIO *)); +// int (*BIO_meth_get_destroy(const BIO_METHOD *biom)) (BIO *); +// int BIO_meth_set_destroy(BIO_METHOD *biom, int (*destroy) (BIO *)); +// long (*BIO_meth_get_callback_ctrl(const BIO_METHOD *biom)) +// (BIO *, int, BIO_info_cb *); +// int BIO_meth_set_callback_ctrl(BIO_METHOD *biom, +// long (*callback_ctrl) (BIO *, int, +// BIO_info_cb *)); + +{$ELSE} + +(* These are normally used internally in BIOs *) + +(* These should be used by the application to tell why we should retry *) + +(* BIO_s_accept() and BIO_s_connect() *) + + + function BIO_get_new_index: TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + procedure BIO_set_flags(b: PBIO; flags: TIdC_INT) cdecl; external CLibCrypto; + function BIO_test_flags(const b: PBIO; flags: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + procedure BIO_clear_flags(b: PBIO; flags: TIdC_INT) cdecl; external CLibCrypto; + + function BIO_get_callback(b: PBIO): BIO_callback_fn cdecl; external CLibCrypto; + procedure BIO_set_callback(b: PBIO; callback: BIO_callback_fn) cdecl; external CLibCrypto; + + function BIO_get_callback_ex(b: PBIO): BIO_callback_fn_ex cdecl; external CLibCrypto; {introduced 1.1.0} + procedure BIO_set_callback_ex(b: PBIO; callback: BIO_callback_fn_ex) cdecl; external CLibCrypto; {introduced 1.1.0} + + function BIO_get_callback_arg(const b: PBIO): PIdAnsiChar cdecl; external CLibCrypto; + procedure BIO_set_callback_arg(var b: PBIO; arg: PIdAnsiChar) cdecl; external CLibCrypto; + + function BIO_method_name(const b: PBIO): PIdAnsiChar cdecl; external CLibCrypto; + function BIO_method_type(const b: PBIO): TIdC_INT cdecl; external CLibCrypto; + +// {$HPPEMIT '# define BIO_set_app_data(s,arg) BIO_set_ex_data(s,0,arg)'} +// {$HPPEMIT '# define BIO_get_app_data(s) BIO_get_ex_data(s,0)'} +// +// {$HPPEMIT '# define BIO_set_nbio(b,n) BIO_ctrl(b,BIO_C_SET_NBIO,(n),NULL)'} +// +// {$HPPEMIT '# ifndef OPENSSL_NO_SOCK'} +// (* IP families we support, for BIO_s_connect() and BIO_s_accept() *) +// (* Note: the underlying operating system may not support some of them *) +// {$HPPEMIT '# define BIO_FAMILY_IPV4 4'} +// {$HPPEMIT '# define BIO_FAMILY_IPV6 6'} +// {$HPPEMIT '# define BIO_FAMILY_IPANY 256'} +// +// (* BIO_s_connect() *) +// {$HPPEMIT '# define BIO_set_conn_hostname(b,name) BIO_ctrl(b,BIO_C_SET_CONNECT,0,'} +// (char (name)) +// {$HPPEMIT '# define BIO_set_conn_port(b,port) BIO_ctrl(b,BIO_C_SET_CONNECT,1,'} +// (char (port)) +// {$HPPEMIT '# define BIO_set_conn_address(b,addr) BIO_ctrl(b,BIO_C_SET_CONNECT,2,'} +// (char (addr)) +// {$HPPEMIT '# define BIO_set_conn_ip_family(b,f) BIO_int_ctrl(b,BIO_C_SET_CONNECT,3,f)'} +// {$HPPEMIT '# define BIO_get_conn_hostname(b) (( char )BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,0))'} +// {$HPPEMIT '# define BIO_get_conn_port(b) (( char )BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,1))'} +// {$HPPEMIT '# define BIO_get_conn_address(b) (( PBIO_ADDR )BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,2))'} +// {$HPPEMIT '# define BIO_get_conn_ip_family(b) BIO_ctrl(b,BIO_C_GET_CONNECT,3,NULL)'} +// {$HPPEMIT '# define BIO_set_conn_mode(b,n) BIO_ctrl(b,BIO_C_SET_CONNECT_MODE,(n),NULL)'} +// +// (* BIO_s_accept() *) +// {$HPPEMIT '# define BIO_set_accept_name(b,name) BIO_ctrl(b,BIO_C_SET_ACCEPT,0,'} +// {$EXTERNALSYM PBIO} +// (char (name)) +// {$HPPEMIT '# define BIO_set_accept_port(b,port) BIO_ctrl(b,BIO_C_SET_ACCEPT,1,'} +// (char (port)) +// {$HPPEMIT '# define BIO_get_accept_name(b) (( char )BIO_ptr_ctrl(b,BIO_C_GET_ACCEPT,0))'} +// {$HPPEMIT '# define BIO_get_accept_port(b) (( char )BIO_ptr_ctrl(b,BIO_C_GET_ACCEPT,1))'} +// {$HPPEMIT '# define BIO_get_peer_name(b) (( char )BIO_ptr_ctrl(b,BIO_C_GET_ACCEPT,2))'} +// {$HPPEMIT '# define BIO_get_peer_port(b) (( char )BIO_ptr_ctrl(b,BIO_C_GET_ACCEPT,3))'} +// (* #define BIO_set_nbio(b,n) BIO_ctrl(b,BIO_C_SET_NBIO,(n),NULL) *) +// {$HPPEMIT '# define BIO_set_nbio_accept(b,n) # define BIO_set_nbio_accept(b,n) BIO_ctrl(b,BIO_C_SET_ACCEPT,2,(n)?(procedure )'a':NULL) BIO_ctrl(b,BIO_C_SET_ACCEPT,3,'} +// (char (bio)) +// {$HPPEMIT '# define BIO_set_accept_ip_family(b,f) BIO_int_ctrl(b,BIO_C_SET_ACCEPT,4,f)'} +// {$HPPEMIT '# define BIO_get_accept_ip_family(b) BIO_ctrl(b,BIO_C_GET_ACCEPT,4,NULL)'} +// +// (* Aliases kept for backward compatibility *) +// {$HPPEMIT '# define BIO_BIND_NORMAL 0'} +// {$HPPEMIT '# define BIO_BIND_REUSEADDR BIO_SOCK_REUSEADDR'} +// {$HPPEMIT '# define BIO_BIND_REUSEADDR_IF_UNUSED BIO_SOCK_REUSEADDR'} +// {$HPPEMIT '# define BIO_set_bind_mode(b,mode) BIO_ctrl(b,BIO_C_SET_BIND_MODE,mode,NULL)'} +// {$HPPEMIT '# define BIO_get_bind_mode(b) BIO_ctrl(b,BIO_C_GET_BIND_MODE,0,NULL)'} +// +// (* BIO_s_accept() and BIO_s_connect() *) +// {$HPPEMIT '# define BIO_do_connect(b) BIO_do_handshake(b)'} +// {$HPPEMIT '# define BIO_do_accept(b) BIO_do_handshake(b)'} +// {$HPPEMIT '# endif'} (* OPENSSL_NO_SOCK *) +// +// {$HPPEMIT '# define BIO_do_handshake(b) BIO_ctrl(b,BIO_C_DO_STATE_MACHINE,0,NULL)'} +// +// (* BIO_s_datagram(), BIO_s_fd(), BIO_s_socket(), BIO_s_accept() and BIO_s_connect() *) +// {$HPPEMIT '# define BIO_set_fd(b,fd,c) BIO_int_ctrl(b,BIO_C_SET_FD,c,fd)'} +// {$HPPEMIT '# define BIO_get_fd(b,c) BIO_ctrl(b,BIO_C_GET_FD,0,(char (c))'} +// +// (* BIO_s_file() *) +// {$HPPEMIT '# define BIO_set_fp(b,fp,c) BIO_ctrl(b,BIO_C_SET_FILE_PTR,c,(char (fp))'} +// {$HPPEMIT '# define BIO_get_fp(b,fpp) BIO_ctrl(b,BIO_C_GET_FILE_PTR,0,(char (fpp))'} +// +// (* BIO_s_fd() and BIO_s_file() *) +// {$HPPEMIT '# define BIO_seek(b,ofs(int)BIO_ctrl(b,BIO_C_FILE_SEEK,ofs,NULL)'} +// {$HPPEMIT '# define BIO_tell(b) (int)BIO_ctrl(b,BIO_C_FILE_TELL,0,NULL)'} +// +// (* +// * name is cast to lose , but might be better to route through a +// * cFunction so we can do it safely +// *) +// {$HPPEMIT '# ifdef CONST_STRICT'} +// (* +// * If you are wondering why this isn't defined, its because CONST_STRICT is +// * purely a compile-time kludge to allow to be checked. +// *) +//// function BIO_read_filename(b: PBIO; const name: PIdAnsiChar): TIdC_INT; +// {$HPPEMIT '# define BIO_write_filename(b,name(int)BIO_ctrl(b,BIO_C_SET_FILENAME,'} +// BIO_CLOSE or BIO_FP_WRITE,name) +// {$HPPEMIT '# define BIO_append_filename(b,name(int)BIO_ctrl(b,BIO_C_SET_FILENAME,'} +// BIO_CLOSE or BIO_FP_APPEND,name) +// {$HPPEMIT '# define BIO_rw_filename(b,name(int)BIO_ctrl(b,BIO_C_SET_FILENAME,'} +// BIO_CLOSE or BIO_FP_READ or BIO_FP_WRITE,name) +// +// (* +// * WARNING WARNING, this ups the reference count on the read bio of the SSL +// * structure. This is because the ssl read PBIO is now pointed to by the +// * next_bio field in the bio. So when you free the PBIO, make sure you are +// * doing a BIO_free_all() to catch the underlying PBIO. +// *) +// {$HPPEMIT '# define BIO_set_ssl(b,ssl,c) BIO_ctrl(b,BIO_C_SET_SSL,c,(char (ssl))'} +// {$HPPEMIT '# define BIO_get_ssl(b,sslp) BIO_ctrl(b,BIO_C_GET_SSL,0,(char (sslp))'} +// {$HPPEMIT '# define BIO_set_ssl_mode(b,client) BIO_ctrl(b,BIO_C_SSL_MODE,client,NULL)'} +// {$HPPEMIT '# define BIO_set_ssl_renegotiate_bytes(b,num)'} +// BIO_ctrl(b,BIO_C_SET_SSL_RENEGOTIATE_BYTES,num,0) +// {$HPPEMIT '# define BIO_get_num_renegotiates(b)'} +// BIO_ctrl(b,BIO_C_GET_SSL_NUM_RENEGOTIATES,0,0) +// {$HPPEMIT '# define BIO_set_ssl_renegotiate_timeout(b,seconds)'} +// BIO_ctrl(b,BIO_C_SET_SSL_RENEGOTIATE_TIMEOUT,seconds,0) +// +// (* defined in evp.h *) +// (* #define BIO_set_md(b,md) BIO_ctrl(b,BIO_C_SET_MD,1,(char )(md)) *) +// +// (* For the BIO_f_buffer() type *) +// {$HPPEMIT '# define BIO_get_buffer_num_lines(b) BIO_ctrl(b,BIO_C_GET_BUFF_NUM_LINES,0,NULL)'} +// {$HPPEMIT '# define BIO_set_buffer_size(b,size) BIO_ctrl(b,BIO_C_SET_BUFF_SIZE,size,NULL)'} +// {$HPPEMIT '# define BIO_set_read_buffer_size(b,size) BIO_int_ctrl(b,BIO_C_SET_BUFF_SIZE,size,0)'} +// {$HPPEMIT '# define BIO_set_write_buffer_size(b,size) BIO_int_ctrl(b,BIO_C_SET_BUFF_SIZE,size,1)'} +// {$HPPEMIT '# define BIO_set_buffer_read_data(b,buf,num) BIO_ctrl(b,BIO_C_SET_BUFF_READ_DATA,num,buf)'} +// +// (* Don't use the next one unless you know what you are doing :-) */ +// {$HPPEMIT '# define BIO_dup_state(b,ret) BIO_ctrl(b,BIO_CTRL_DUP,0,(char (ret))'} +// +// {$HPPEMIT '# define BIO_reset(b) (int)BIO_ctrl(b,BIO_CTRL_RESET,0,NULL)'} +// {$HPPEMIT '# define BIO_eof(b) (int)BIO_ctrl(b,BIO_CTRL_EOF,0,NULL)'} +// {$HPPEMIT '# define BIO_set_close(b,c) (int)BIO_ctrl(b,BIO_CTRL_SET_CLOSE,(c),NULL)'} +// {$HPPEMIT '# define BIO_get_close(b) (int)BIO_ctrl(b,BIO_CTRL_GET_CLOSE,0,NULL)'} +// {$HPPEMIT '# define BIO_pending(b) (int)BIO_ctrl(b,BIO_CTRL_PENDING,0,NULL)'} +// {$HPPEMIT '# define BIO_wpending(b) (int)BIO_ctrl(b,BIO_CTRL_WPENDING,0,NULL)'} + (* ...pending macros have inappropriate return type *) + function BIO_ctrl_pending(b: PBIO): TIdC_SIZET cdecl; external CLibCrypto; + function BIO_ctrl_wpending(b: PBIO): TIdC_SIZET cdecl; external CLibCrypto; +// {$HPPEMIT '# define BIO_flush(b) (int)BIO_ctrl(b,BIO_CTRL_FLUSH,0,NULL)'} +// {$HPPEMIT '# define BIO_get_info_callback(b,cbp(int)BIO_ctrl(b,BIO_CTRL_GET_CALLBACK,0,'} +// cbp) +// {$HPPEMIT '# define BIO_set_info_callback(b,cb(int)BIO_callback_ctrl(b,BIO_CTRL_SET_CALLBACK,cb)'} +// +// (* For the BIO_f_buffer() type *) +// {$HPPEMIT '# define BIO_buffer_get_num_lines(b) BIO_ctrl(b,BIO_CTRL_GET,0,NULL)'} +// {$HPPEMIT '# define BIO_buffer_peek(b,s,l) BIO_ctrl(b,BIO_CTRL_PEEK,(l),(s))'} +// +// (* For BIO_s_bio() *) +// {$HPPEMIT '# define BIO_set_write_buf_size(b,size(int)BIO_ctrl(b,BIO_C_SET_WRITE_BUF_SIZE,size,NULL)'} +// {$HPPEMIT '# define BIO_get_write_buf_size(b,size(TIdC_SIZET)BIO_ctrl(b,BIO_C_GET_WRITE_BUF_SIZE,size,NULL)'} +// {$HPPEMIT '# define BIO_make_bio_pair(b1,b2) (int)BIO_ctrl(b1,BIO_C_MAKE_BIO_PAIR,0,b2)'} +// {$HPPEMIT '# define BIO_destroy_bio_pair(b) (int)BIO_ctrl(b,BIO_C_DESTROY_BIO_PAIR,0,NULL)'} +// {$HPPEMIT '# define BIO_shutdown_wr(b(int)BIO_ctrl(b, BIO_C_SHUTDOWN_WR, 0, NULL)'} +// (* macros with inappropriate type -- but ...pending macros use int too: *) +// {$HPPEMIT '# define BIO_get_write_guarantee(b(int)BIO_ctrl(b,BIO_C_GET_WRITE_GUARANTEE,0,NULL)'} +// {$HPPEMIT '# define BIO_get_read_request(b) (int)BIO_ctrl(b,BIO_C_GET_READ_REQUEST,0,NULL)'} + function BIO_ctrl_get_write_guarantee(b: PBIO): TIdC_SIZET cdecl; external CLibCrypto; + function BIO_ctrl_get_read_request(b: PBIO): TIdC_SIZET cdecl; external CLibCrypto; + function BIO_ctrl_reset_read_request(b: PBIO): TIdC_INT cdecl; external CLibCrypto; + + (* ctrl macros for dgram *) +// {$HPPEMIT '# define BIO_ctrl_dgram_connect(b,peer)'} +// (TIdC_INT)BIO_ctrl(b,BIO_CTRL_DGRAM_CONNECT,0, (char (peer)) +// {$HPPEMIT '# define BIO_ctrl_set_connected(b,peer)'} +// (TIdC_INT)BIO_ctrl(b, BIO_CTRL_DGRAM_SET_CONNECTED, 0, (char (peer)) +// {$HPPEMIT '# define BIO_dgram_recv_timedout(b)'} +// (TIdC_INT)BIO_ctrl(b, BIO_CTRL_DGRAM_GET_RECV_TIMER_EXP, 0, 0) +// {$HPPEMIT '# define BIO_dgram_send_timedout(b)'} +// (TIdC_INT)BIO_ctrl(b, BIO_CTRL_DGRAM_GET_SEND_TIMER_EXP, 0, 0) +// {$HPPEMIT '# define BIO_dgram_get_peer(b,peer)'} +// (TIdC_INT)BIO_ctrl(b, BIO_CTRL_DGRAM_GET_PEER, 0, (char (peer)) +// {$HPPEMIT '# define BIO_dgram_set_peer(b,peer)'} +// (TIdC_INT)BIO_ctrl(b, BIO_CTRL_DGRAM_SET_PEER, 0, (char (peer)) +// {$HPPEMIT '# define BIO_dgram_get_mtu_overhead(b)'} +// (Cardinal)BIO_ctrl((b), BIO_CTRL_DGRAM_GET_MTU_OVERHEAD, 0, 0) + +//#define BIO_get_ex_new_index(l, p, newf, dupf, freef) \ +// CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_BIO, l, p, newf, dupf, freef) + + function BIO_set_ex_data(bio: PBIO; idx: TIdC_INT; data: Pointer): TIdC_INT cdecl; external CLibCrypto; + function BIO_get_ex_data(bio: PBIO; idx: TIdC_INT): Pointer cdecl; external CLibCrypto; + function BIO_number_read(bio: PBIO): TIdC_UINT64 cdecl; external CLibCrypto; + function BIO_number_written(bio: PBIO): TIdC_UINT64 cdecl; external CLibCrypto; + + (* For BIO_f_asn1() *) +// function BIO_asn1_set_prefix(b: PBIO; prefix: ^asn1_ps_func; prefix_free: ^asn1_ps_func): TIdC_INT; +// function BIO_asn1_get_prefix(b: PBIO; pprefix: ^^asn1_ps_func; pprefix_free: ^^asn1_ps_func): TIdC_INT; +// function BIO_asn1_set_suffix(b: PBIO; suffix: ^asn1_ps_func; suffix_free: ^asn1_ps_func): TIdC_INT; +// function BIO_asn1_get_suffix(b: PBIO; psuffix: ^asn1_ps_func; psuffix_free: ^^asn1_ps_func): TIdC_INT; + + function BIO_s_file: PBIO_METHOD cdecl; external CLibCrypto; + function BIO_new_file(const filename: PIdAnsiChar; const mode: PIdAnsiChar): PBIO cdecl; external CLibCrypto; +// function BIO_new_fp(stream: cFile; close_flag: TIdC_INT): PBIO; + function BIO_new(const cType: PBIO_METHOD): PBIO cdecl; external CLibCrypto; + function BIO_free(a: PBIO): TIdC_INT cdecl; external CLibCrypto; + procedure BIO_set_data(a: PBIO; ptr: Pointer) cdecl; external CLibCrypto; {introduced 1.1.0} + function BIO_get_data(a: PBIO): Pointer cdecl; external CLibCrypto; {introduced 1.1.0} + procedure BIO_set_init(a: PBIO; init: TIdC_INT) cdecl; external CLibCrypto; {introduced 1.1.0} + function BIO_get_init(a: PBIO): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + procedure BIO_set_shutdown(a: PBIO; shut: TIdC_INT) cdecl; external CLibCrypto; {introduced 1.1.0} + function BIO_get_shutdown(a: PBIO): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + procedure BIO_vfree(a: PBIO) cdecl; external CLibCrypto; + function BIO_up_ref(a: PBIO): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function BIO_read(b: PBIO; data: Pointer; dlen: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function BIO_read_ex(b: PBIO; data: Pointer; dlen: TIdC_SIZET; readbytes: PIdC_SIZET): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function BIO_gets( bp: PBIO; buf: PIdAnsiChar; size: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function BIO_write(b: PBIO; const data: Pointer; dlen: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function BIO_write_ex(b: PBIO; const data: Pointer; dlen: TIdC_SIZET; written: PIdC_SIZET): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function BIO_puts(bp: PBIO; const buf: PIdAnsiChar): TIdC_INT cdecl; external CLibCrypto; + function BIO_indent(b: PBIO; indent: TIdC_INT; max: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function BIO_ctrl(bp: PBIO; cmd: TIdC_INT; larg: TIdC_LONG; parg: Pointer): TIdC_LONG cdecl; external CLibCrypto; + function BIO_callback_ctrl(b: PBIO; cmd: TIdC_INT; fp: PBIO_info_cb): TIdC_LONG cdecl; external CLibCrypto; + function BIO_ptr_ctrl(bp: PBIO; cmd: TIdC_INT; larg: TIdC_LONG): Pointer cdecl; external CLibCrypto; + function BIO_int_ctrl(bp: PBIO; cmd: TIdC_INT; larg: TIdC_LONG; iarg: TIdC_INT): TIdC_LONG cdecl; external CLibCrypto; + function BIO_push(b: PBIO; append: PBIO): PBIO cdecl; external CLibCrypto; + function BIO_pop(b: PBIO): PBIO cdecl; external CLibCrypto; + procedure BIO_free_all(a: PBIO) cdecl; external CLibCrypto; + function BIO_find_type(b: PBIO; bio_type: TIdC_INT): PBIO cdecl; external CLibCrypto; + function BIO_next(b: PBIO): PBIO cdecl; external CLibCrypto; + procedure BIO_set_next(b: PBIO; next: PBIO) cdecl; external CLibCrypto; {introduced 1.1.0} + function BIO_get_retry_BIO(bio: PBIO; reason: TIdC_INT): PBIO cdecl; external CLibCrypto; + function BIO_get_retry_reason(bio: PBIO): TIdC_INT cdecl; external CLibCrypto; + procedure BIO_set_retry_reason(bio: PBIO; reason: TIdC_INT) cdecl; external CLibCrypto; {introduced 1.1.0} + function BIO_dup_chain(in_: PBIO): PBIO cdecl; external CLibCrypto; + + function BIO_nread0(bio: PBIO; buf: PPIdAnsiChar): TIdC_INT cdecl; external CLibCrypto; + function BIO_nread(bio: PBIO; buf: PPIdAnsiChar; num: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function BIO_nwrite0(bio: PBIO; buf: PPIdAnsiChar): TIdC_INT cdecl; external CLibCrypto; + function BIO_nwrite(bio: PBIO; buf: PPIdAnsiChar; num: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + + function BIO_debug_callback(bio: PBIO; cmd: TIdC_INT; const argp: PIdAnsiChar; argi: TIdC_INT; argl: TIdC_LONG; ret: TIdC_LONG): TIdC_LONG cdecl; external CLibCrypto; + + function BIO_s_mem: PBIO_METHOD cdecl; external CLibCrypto; + function BIO_s_secmem: PBIO_METHOD cdecl; external CLibCrypto; {introduced 1.1.0} + function BIO_new_mem_buf(const buf: Pointer; len: TIdC_INT): PBIO cdecl; external CLibCrypto; + + function BIO_s_socket: PBIO_METHOD cdecl; external CLibCrypto; + function BIO_s_connect: PBIO_METHOD cdecl; external CLibCrypto; + function BIO_s_accept: PBIO_METHOD cdecl; external CLibCrypto; + + function BIO_s_fd: PBIO_METHOD cdecl; external CLibCrypto; + function BIO_s_log: PBIO_METHOD cdecl; external CLibCrypto; + function BIO_s_bio: PBIO_METHOD cdecl; external CLibCrypto; + function BIO_s_null: PBIO_METHOD cdecl; external CLibCrypto; + function BIO_f_null: PBIO_METHOD cdecl; external CLibCrypto; + function BIO_f_buffer: PBIO_METHOD cdecl; external CLibCrypto; + function BIO_f_linebuffer: PBIO_METHOD cdecl; external CLibCrypto; {introduced 1.1.0} + function BIO_f_nbio_test: PBIO_METHOD cdecl; external CLibCrypto; + function BIO_s_datagram: PBIO_METHOD cdecl; external CLibCrypto; + function BIO_dgram_non_fatal_error(error: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function BIO_new_dgram(fd: TIdC_INT; close_flag: TIdC_INT): PBIO cdecl; external CLibCrypto; + +// function BIO_s_datagram_sctp: PBIO_METHOD; +// function BIO_new_dgram_sctp(fd: TIdC_INT; close_flag: TIdC_INT): PBIO; +// function BIO_dgram_is_sctp(bio: PBIO): TIdC_INT; +// function BIO_dgram_sctp_notification_cb(bio: PBIO; handle_notifications(PBIO; +// context: Pointer; +// buf: Pointer): TIdC_INT, Pointer context); +// function BIO_dgram_sctp_wait_for_dry(b: PBIO): TIdC_INT; +// function BIO_dgram_sctp_msg_waiting(b: PBIO): TIdC_INT; + + function BIO_sock_should_retry(i: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function BIO_sock_non_fatal_error(error: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + + function BIO_fd_should_retry(i: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function BIO_fd_non_fatal_error(error: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; +// function BIO_dump_cb( +// Pointer data: cb(; +// len: TIdC_SIZET; +// function: Pointer): u: TIdC_INT, Pointer function , PIdAnsiChar s, TIdC_INT len): u; +// function BIO_dump_indent_cb(TIdC_INT (cb( Pointer data, TIdC_SIZET len, Pointer function ): u: TIdC_INT, Pointer function , PIdAnsiChar s, TIdC_INT len, TIdC_INT indent): u; + function BIO_dump(b: PBIO; const bytes: PIdAnsiChar; len: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function BIO_dump_indent(b: PBIO; const bytes: PIdAnsiChar; len: TIdC_INT; indent: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + +// function BIO_dump_fp(fp: cFile; const s: PByte; len: TIdC_INT): TIdC_INT; +// function BIO_dump_indent_fp(fp: cFile; const s: PByte; len: TIdC_INT; indent: TIdC_INT): TIdC_INT; + + function BIO_hex_string(out_: PBIO; indent: TIdC_INT; width: TIdC_INT; data: PByte; datalen: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + + function BIO_ADDR_new: PBIO_ADDR cdecl; external CLibCrypto; {introduced 1.1.0} + function BIO_ADDR_rawmake(ap: PBIO_ADDR; familiy: TIdC_INT; const where: Pointer; wherelen: TIdC_SIZET; port: TIdC_SHORT): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + procedure BIO_ADDR_free(a: PBIO_ADDR) cdecl; external CLibCrypto; {introduced 1.1.0} + procedure BIO_ADDR_clear(ap: PBIO_ADDR) cdecl; external CLibCrypto; {introduced 1.1.0} + function BIO_ADDR_family(const ap: PBIO_ADDR): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function BIO_ADDR_rawaddress(const ap: PBIO_ADDR; p: Pointer; l: PIdC_SIZET): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function BIO_ADDR_rawport(const ap: PBIO_ADDR): TIdC_SHORT cdecl; external CLibCrypto; {introduced 1.1.0} + function BIO_ADDR_hostname_string(const ap: PBIO_ADDR; numeric: TIdC_INT): PIdAnsiChar cdecl; external CLibCrypto; {introduced 1.1.0} + function BIO_ADDR_service_string(const ap: PBIO_ADDR; numeric: TIdC_INT): PIdAnsiChar cdecl; external CLibCrypto; {introduced 1.1.0} + function BIO_ADDR_path_string(const ap: PBIO_ADDR): PIdAnsiChar cdecl; external CLibCrypto; {introduced 1.1.0} + + function BIO_ADDRINFO_next(const bai: PBIO_ADDRINFO): PBIO_ADDRINFO cdecl; external CLibCrypto; {introduced 1.1.0} + function BIO_ADDRINFO_family(const bai: PBIO_ADDRINFO): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function BIO_ADDRINFO_socktype(const bai: PBIO_ADDRINFO): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function BIO_ADDRINFO_protocol(const bai: PBIO_ADDRINFO): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function BIO_ADDRINFO_address(const bai: PBIO_ADDRINFO): PBIO_ADDR cdecl; external CLibCrypto; {introduced 1.1.0} + procedure BIO_ADDRINFO_free(bai: PBIO_ADDRINFO) cdecl; external CLibCrypto; {introduced 1.1.0} + + function BIO_parse_hostserv(const hostserv: PIdAnsiChar; host: PPIdAnsiChar; service: PPIdAnsiChar; hostserv_prio: BIO_hostserv_priorities): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + + function BIO_lookup(const host: PIdAnsiChar; const service: PIdAnsiChar; lookup_type: BIO_lookup_type; family: TIdC_INT; socktype: TIdC_INT; res: PPBIO_ADDRINFO): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function BIO_lookup_ex(const host: PIdAnsiChar; const service: PIdAnsiChar; lookup_type: TIdC_INT; family: TIdC_INT; socktype: TIdC_INT; protocol: TIdC_INT; res: PPBIO_ADDRINFO): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function BIO_sock_error(sock: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function BIO_socket_ioctl(fd: TIdC_INT; cType: TIdC_LONG; arg: Pointer): TIdC_INT cdecl; external CLibCrypto; + function BIO_socket_nbio(fd: TIdC_INT; mode: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function BIO_sock_init: TIdC_INT cdecl; external CLibCrypto; + + function BIO_set_tcp_ndelay(sock: TIdC_INT; turn_on: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + + function BIO_sock_info(sock: TIdC_INT; type_: BIO_sock_info_type; info: PBIO_sock_info_u): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + + function BIO_socket(domain: TIdC_INT; socktype: TIdC_INT; protocol: TIdC_INT; options: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function BIO_connect(sock: TIdC_INT; const addr: PBIO_ADDR; options: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function BIO_bind(sock: TIdC_INT; const addr: PBIO_ADDR; options: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function BIO_listen(sock: TIdC_INT; const addr: PBIO_ADDR; options: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function BIO_accept_ex(accept_sock: TIdC_INT; addr: PBIO_ADDR; options: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function BIO_closesocket(sock: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + + function BIO_new_socket(sock: TIdC_INT; close_flag: TIdC_INT): PBIO cdecl; external CLibCrypto; + function BIO_new_connect(const host_port: PIdAnsiChar): PBIO cdecl; external CLibCrypto; + function BIO_new_accept(const host_port: PIdAnsiChar): PBIO cdecl; external CLibCrypto; + + function BIO_new_fd(fd: TIdC_INT; close_flag: TIdC_INT): PBIO cdecl; external CLibCrypto; + + function BIO_new_bio_pair(bio1: PPBIO; writebuf1: TIdC_SIZET; bio2: PPBIO; writebuf2: TIdC_SIZET): TIdC_INT cdecl; external CLibCrypto; + (* + * If successful, returns 1 and in *bio1, *bio2 two BIO pair endpoints. + * Otherwise returns 0 and sets *bio1 and *bio2 to NULL. Size 0 uses default + * value. + *) + + procedure BIO_copy_next_retry(b: PBIO) cdecl; external CLibCrypto; + +// BIO_METHOD *BIO_meth_new(int type, const char *name); +// void BIO_meth_free(BIO_METHOD *biom); +// int (*BIO_meth_get_write(const BIO_METHOD *biom)) (BIO *, const char *, int); +// int (*BIO_meth_get_write_ex(const BIO_METHOD *biom)) (BIO *, const char *, TIdC_SIZET, +// TIdC_SIZET *); +// int BIO_meth_set_write(BIO_METHOD *biom, +// int (*write) (BIO *, const char *, int)); +// int BIO_meth_set_write_ex(BIO_METHOD *biom, +// int (*bwrite) (BIO *, const char *, TIdC_SIZET, TIdC_SIZET *)); +// int (*BIO_meth_get_read(const BIO_METHOD *biom)) (BIO *, char *, int); +// int (*BIO_meth_get_read_ex(const BIO_METHOD *biom)) (BIO *, char *, TIdC_SIZET, TIdC_SIZET *); +// int BIO_meth_set_read(BIO_METHOD *biom, +// int (*read) (BIO *, char *, int)); +// int BIO_meth_set_read_ex(BIO_METHOD *biom, +// int (*bread) (BIO *, char *, TIdC_SIZET, TIdC_SIZET *)); +// int (*BIO_meth_get_puts(const BIO_METHOD *biom)) (BIO *, const char *); +// int BIO_meth_set_puts(BIO_METHOD *biom, +// int (*puts) (BIO *, const char *)); +// int (*BIO_meth_get_gets(const BIO_METHOD *biom)) (BIO *, char *, int); +// int BIO_meth_set_gets(BIO_METHOD *biom, +// int (*gets) (BIO *, char *, int)); +// long (*BIO_meth_get_ctrl(const BIO_METHOD *biom)) (BIO *, int, long, void *); +// int BIO_meth_set_ctrl(BIO_METHOD *biom, +// long (*ctrl) (BIO *, int, long, void *)); +// int (*BIO_meth_get_create(const BIO_METHOD *bion)) (BIO *); +// int BIO_meth_set_create(BIO_METHOD *biom, int (*create) (BIO *)); +// int (*BIO_meth_get_destroy(const BIO_METHOD *biom)) (BIO *); +// int BIO_meth_set_destroy(BIO_METHOD *biom, int (*destroy) (BIO *)); +// long (*BIO_meth_get_callback_ctrl(const BIO_METHOD *biom)) +// (BIO *, int, BIO_info_cb *); +// int BIO_meth_set_callback_ctrl(BIO_METHOD *biom, +// long (*callback_ctrl) (BIO *, int, +// BIO_info_cb *)); + +function BIO_get_flags(const b: PBIO): TIdC_INT; {removed 1.0.0} +procedure BIO_set_retry_special(b: PBIO); {removed 1.0.0} +procedure BIO_set_retry_read(b: PBIO); {removed 1.0.0} +procedure BIO_set_retry_write(b: PBIO); {removed 1.0.0} +procedure BIO_clear_retry_flags(b: PBIO); {removed 1.0.0} +function BIO_get_retry_flags(b: PBIO): TIdC_INT; {removed 1.0.0} +function BIO_should_read(b: PBIO): TIdC_INT; {removed 1.0.0} +function BIO_should_write(b: PBIO): TIdC_INT; {removed 1.0.0} +function BIO_should_io_special(b: PBIO): TIdC_INT; {removed 1.0.0} +function BIO_retry_type(b: PBIO): TIdC_INT; {removed 1.0.0} +function BIO_should_retry(b: PBIO): TIdC_INT; {removed 1.0.0} +function BIO_do_connect(b: PBIO): TIdC_LONG; {removed 1.0.0} +function BIO_do_accept(b: PBIO): TIdC_LONG; {removed 1.0.0} +function BIO_do_handshake(b: PBIO): TIdC_LONG; {removed 1.0.0} +function BIO_get_mem_data(b: PBIO; pp: PIdAnsiChar) : TIdC_INT; {removed 1.0.0} +function BIO_set_mem_buf(b: PBIO; bm: PIdAnsiChar; c: TIdC_INT): TIdC_INT; {removed 1.0.0} +function BIO_get_mem_ptr(b: PBIO; pp: PIdAnsiChar): TIdC_INT; {removed 1.0.0} +function BIO_set_mem_eof_return(b: PBIO; v: TIdC_INT): TIdC_INT; {removed 1.0.0} +{$ENDIF} + +implementation + + uses + classes, + IdSSLOpenSSLExceptionHandlers, + IdResourceStringsOpenSSL + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + ,IdSSLOpenSSLLoader + {$ENDIF}; + +const + BIO_get_new_index_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + BIO_get_callback_ex_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + BIO_set_callback_ex_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + BIO_set_data_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + BIO_get_data_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + BIO_set_init_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + BIO_get_init_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + BIO_set_shutdown_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + BIO_get_shutdown_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + BIO_up_ref_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + BIO_read_ex_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + BIO_write_ex_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + BIO_set_next_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + BIO_set_retry_reason_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + BIO_s_secmem_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + BIO_f_linebuffer_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + BIO_ADDR_new_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + BIO_ADDR_rawmake_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + BIO_ADDR_free_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + BIO_ADDR_clear_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + BIO_ADDR_family_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + BIO_ADDR_rawaddress_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + BIO_ADDR_rawport_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + BIO_ADDR_hostname_string_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + BIO_ADDR_service_string_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + BIO_ADDR_path_string_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + BIO_ADDRINFO_next_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + BIO_ADDRINFO_family_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + BIO_ADDRINFO_socktype_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + BIO_ADDRINFO_protocol_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + BIO_ADDRINFO_address_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + BIO_ADDRINFO_free_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + BIO_parse_hostserv_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + BIO_lookup_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + BIO_lookup_ex_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + BIO_sock_info_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + BIO_socket_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + BIO_connect_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + BIO_bind_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + BIO_listen_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + BIO_accept_ex_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + BIO_closesocket_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + BIO_get_flags_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + BIO_set_retry_special_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + BIO_set_retry_read_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + BIO_set_retry_write_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + BIO_clear_retry_flags_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + BIO_get_retry_flags_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + BIO_should_read_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + BIO_should_write_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + BIO_should_io_special_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + BIO_retry_type_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + BIO_should_retry_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + BIO_do_connect_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + BIO_do_accept_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + BIO_do_handshake_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + BIO_get_mem_data_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + BIO_set_mem_buf_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + BIO_get_mem_ptr_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + BIO_set_mem_eof_return_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + +// # define BIO_get_flags(b) BIO_test_flags(b, ~(0x0)) +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +const + BIO_get_flags_procname = 'BIO_get_flags'; {removed 1.0.0} + BIO_set_retry_special_procname = 'BIO_set_retry_special'; {removed 1.0.0} + BIO_set_retry_read_procname = 'BIO_set_retry_read'; {removed 1.0.0} + BIO_set_retry_write_procname = 'BIO_set_retry_write'; {removed 1.0.0} + +(* These are normally used internally in BIOs *) + BIO_clear_retry_flags_procname = 'BIO_clear_retry_flags'; {removed 1.0.0} + BIO_get_retry_flags_procname = 'BIO_get_retry_flags'; {removed 1.0.0} + +(* These should be used by the application to tell why we should retry *) + BIO_should_read_procname = 'BIO_should_read'; {removed 1.0.0} + BIO_should_write_procname = 'BIO_should_write'; {removed 1.0.0} + BIO_should_io_special_procname = 'BIO_should_io_special'; {removed 1.0.0} + BIO_retry_type_procname = 'BIO_retry_type'; {removed 1.0.0} + BIO_should_retry_procname = 'BIO_should_retry'; {removed 1.0.0} + +(* BIO_s_accept() and BIO_s_connect() *) + BIO_do_connect_procname = 'BIO_do_connect'; {removed 1.0.0} + BIO_do_accept_procname = 'BIO_do_accept'; {removed 1.0.0} + BIO_do_handshake_procname = 'BIO_do_handshake'; {removed 1.0.0} + + BIO_get_mem_data_procname = 'BIO_get_mem_data'; {removed 1.0.0} + BIO_set_mem_buf_procname = 'BIO_set_mem_buf'; {removed 1.0.0} + BIO_get_mem_ptr_procname = 'BIO_get_mem_ptr'; {removed 1.0.0} + BIO_set_mem_eof_return_procname = 'BIO_set_mem_eof_return'; {removed 1.0.0} + + BIO_get_new_index_procname = 'BIO_get_new_index'; {introduced 1.1.0} + BIO_set_flags_procname = 'BIO_set_flags'; + BIO_test_flags_procname = 'BIO_test_flags'; + BIO_clear_flags_procname = 'BIO_clear_flags'; + + BIO_get_callback_procname = 'BIO_get_callback'; + BIO_set_callback_procname = 'BIO_set_callback'; + + BIO_get_callback_ex_procname = 'BIO_get_callback_ex'; {introduced 1.1.0} + BIO_set_callback_ex_procname = 'BIO_set_callback_ex'; {introduced 1.1.0} + + BIO_get_callback_arg_procname = 'BIO_get_callback_arg'; + BIO_set_callback_arg_procname = 'BIO_set_callback_arg'; + + BIO_method_name_procname = 'BIO_method_name'; + BIO_method_type_procname = 'BIO_method_type'; + +// {$HPPEMIT '# define BIO_set_app_data(s,arg) BIO_set_ex_data(s,0,arg)'} +// {$HPPEMIT '# define BIO_get_app_data(s) BIO_get_ex_data(s,0)'} +// +// {$HPPEMIT '# define BIO_set_nbio(b,n) BIO_ctrl(b,BIO_C_SET_NBIO,(n),NULL)'} +// +// {$HPPEMIT '# ifndef OPENSSL_NO_SOCK'} +// (* IP families we support, for BIO_s_connect() and BIO_s_accept() *) +// (* Note: the underlying operating system may not support some of them *) +// {$HPPEMIT '# define BIO_FAMILY_IPV4 4'} +// {$HPPEMIT '# define BIO_FAMILY_IPV6 6'} +// {$HPPEMIT '# define BIO_FAMILY_IPANY 256'} +// +// (* BIO_s_connect() *) +// {$HPPEMIT '# define BIO_set_conn_hostname(b,name) BIO_ctrl(b,BIO_C_SET_CONNECT,0,'} +// (char (name)) +// {$HPPEMIT '# define BIO_set_conn_port(b,port) BIO_ctrl(b,BIO_C_SET_CONNECT,1,'} +// (char (port)) +// {$HPPEMIT '# define BIO_set_conn_address(b,addr) BIO_ctrl(b,BIO_C_SET_CONNECT,2,'} +// (char (addr)) +// {$HPPEMIT '# define BIO_set_conn_ip_family(b,f) BIO_int_ctrl(b,BIO_C_SET_CONNECT,3,f)'} +// {$HPPEMIT '# define BIO_get_conn_hostname(b) (( char )BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,0))'} +// {$HPPEMIT '# define BIO_get_conn_port(b) (( char )BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,1))'} +// {$HPPEMIT '# define BIO_get_conn_address(b) (( PBIO_ADDR )BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,2))'} +// {$HPPEMIT '# define BIO_get_conn_ip_family(b) BIO_ctrl(b,BIO_C_GET_CONNECT,3,NULL)'} +// {$HPPEMIT '# define BIO_set_conn_mode(b,n) BIO_ctrl(b,BIO_C_SET_CONNECT_MODE,(n),NULL)'} +// +// (* BIO_s_accept() *) +// {$HPPEMIT '# define BIO_set_accept_name(b,name) BIO_ctrl(b,BIO_C_SET_ACCEPT,0,'} +// {$EXTERNALSYM PBIO} +// (char (name)) +// {$HPPEMIT '# define BIO_set_accept_port(b,port) BIO_ctrl(b,BIO_C_SET_ACCEPT,1,'} +// (char (port)) +// {$HPPEMIT '# define BIO_get_accept_name(b) (( char )BIO_ptr_ctrl(b,BIO_C_GET_ACCEPT,0))'} +// {$HPPEMIT '# define BIO_get_accept_port(b) (( char )BIO_ptr_ctrl(b,BIO_C_GET_ACCEPT,1))'} +// {$HPPEMIT '# define BIO_get_peer_name(b) (( char )BIO_ptr_ctrl(b,BIO_C_GET_ACCEPT,2))'} +// {$HPPEMIT '# define BIO_get_peer_port(b) (( char )BIO_ptr_ctrl(b,BIO_C_GET_ACCEPT,3))'} +// (* #define BIO_set_nbio(b,n) BIO_ctrl(b,BIO_C_SET_NBIO,(n),NULL) *) +// {$HPPEMIT '# define BIO_set_nbio_accept(b,n) # define BIO_set_nbio_accept(b,n) BIO_ctrl(b,BIO_C_SET_ACCEPT,2,(n)?(procedure )'a':NULL) BIO_ctrl(b,BIO_C_SET_ACCEPT,3,'} +// (char (bio)) +// {$HPPEMIT '# define BIO_set_accept_ip_family(b,f) BIO_int_ctrl(b,BIO_C_SET_ACCEPT,4,f)'} +// {$HPPEMIT '# define BIO_get_accept_ip_family(b) BIO_ctrl(b,BIO_C_GET_ACCEPT,4,NULL)'} +// +// (* Aliases kept for backward compatibility *) +// {$HPPEMIT '# define BIO_BIND_NORMAL 0'} +// {$HPPEMIT '# define BIO_BIND_REUSEADDR BIO_SOCK_REUSEADDR'} +// {$HPPEMIT '# define BIO_BIND_REUSEADDR_IF_UNUSED BIO_SOCK_REUSEADDR'} +// {$HPPEMIT '# define BIO_set_bind_mode(b,mode) BIO_ctrl(b,BIO_C_SET_BIND_MODE,mode,NULL)'} +// {$HPPEMIT '# define BIO_get_bind_mode(b) BIO_ctrl(b,BIO_C_GET_BIND_MODE,0,NULL)'} +// +// (* BIO_s_accept() and BIO_s_connect() *) +// {$HPPEMIT '# define BIO_do_connect(b) BIO_do_handshake(b)'} +// {$HPPEMIT '# define BIO_do_accept(b) BIO_do_handshake(b)'} +// {$HPPEMIT '# endif'} (* OPENSSL_NO_SOCK *) +// +// {$HPPEMIT '# define BIO_do_handshake(b) BIO_ctrl(b,BIO_C_DO_STATE_MACHINE,0,NULL)'} +// +// (* BIO_s_datagram(), BIO_s_fd(), BIO_s_socket(), BIO_s_accept() and BIO_s_connect() *) +// {$HPPEMIT '# define BIO_set_fd(b,fd,c) BIO_int_ctrl(b,BIO_C_SET_FD,c,fd)'} +// {$HPPEMIT '# define BIO_get_fd(b,c) BIO_ctrl(b,BIO_C_GET_FD,0,(char (c))'} +// +// (* BIO_s_file() *) +// {$HPPEMIT '# define BIO_set_fp(b,fp,c) BIO_ctrl(b,BIO_C_SET_FILE_PTR,c,(char (fp))'} +// {$HPPEMIT '# define BIO_get_fp(b,fpp) BIO_ctrl(b,BIO_C_GET_FILE_PTR,0,(char (fpp))'} +// +// (* BIO_s_fd() and BIO_s_file() *) +// {$HPPEMIT '# define BIO_seek(b,ofs(int)BIO_ctrl(b,BIO_C_FILE_SEEK,ofs,NULL)'} +// {$HPPEMIT '# define BIO_tell(b) (int)BIO_ctrl(b,BIO_C_FILE_TELL,0,NULL)'} +// +// (* +// * name is cast to lose , but might be better to route through a +// * cFunction so we can do it safely +// *) +// {$HPPEMIT '# ifdef CONST_STRICT'} +// (* +// * If you are wondering why this isn't defined, its because CONST_STRICT is +// * purely a compile-time kludge to allow to be checked. +// *) +//// function BIO_read_filename(b: PBIO; const name: PIdAnsiChar): TIdC_INT; +// {$HPPEMIT '# define BIO_write_filename(b,name(int)BIO_ctrl(b,BIO_C_SET_FILENAME,'} +// BIO_CLOSE or BIO_FP_WRITE,name) +// {$HPPEMIT '# define BIO_append_filename(b,name(int)BIO_ctrl(b,BIO_C_SET_FILENAME,'} +// BIO_CLOSE or BIO_FP_APPEND,name) +// {$HPPEMIT '# define BIO_rw_filename(b,name(int)BIO_ctrl(b,BIO_C_SET_FILENAME,'} +// BIO_CLOSE or BIO_FP_READ or BIO_FP_WRITE,name) +// +// (* +// * WARNING WARNING, this ups the reference count on the read bio of the SSL +// * structure. This is because the ssl read PBIO is now pointed to by the +// * next_bio field in the bio. So when you free the PBIO, make sure you are +// * doing a BIO_free_all() to catch the underlying PBIO. +// *) +// {$HPPEMIT '# define BIO_set_ssl(b,ssl,c) BIO_ctrl(b,BIO_C_SET_SSL,c,(char (ssl))'} +// {$HPPEMIT '# define BIO_get_ssl(b,sslp) BIO_ctrl(b,BIO_C_GET_SSL,0,(char (sslp))'} +// {$HPPEMIT '# define BIO_set_ssl_mode(b,client) BIO_ctrl(b,BIO_C_SSL_MODE,client,NULL)'} +// {$HPPEMIT '# define BIO_set_ssl_renegotiate_bytes(b,num)'} +// BIO_ctrl(b,BIO_C_SET_SSL_RENEGOTIATE_BYTES,num,0) +// {$HPPEMIT '# define BIO_get_num_renegotiates(b)'} +// BIO_ctrl(b,BIO_C_GET_SSL_NUM_RENEGOTIATES,0,0) +// {$HPPEMIT '# define BIO_set_ssl_renegotiate_timeout(b,seconds)'} +// BIO_ctrl(b,BIO_C_SET_SSL_RENEGOTIATE_TIMEOUT,seconds,0) +// +// (* defined in evp.h *) +// (* #define BIO_set_md(b,md) BIO_ctrl(b,BIO_C_SET_MD,1,(char )(md)) *) +// +// (* For the BIO_f_buffer() type *) +// {$HPPEMIT '# define BIO_get_buffer_num_lines(b) BIO_ctrl(b,BIO_C_GET_BUFF_NUM_LINES,0,NULL)'} +// {$HPPEMIT '# define BIO_set_buffer_size(b,size) BIO_ctrl(b,BIO_C_SET_BUFF_SIZE,size,NULL)'} +// {$HPPEMIT '# define BIO_set_read_buffer_size(b,size) BIO_int_ctrl(b,BIO_C_SET_BUFF_SIZE,size,0)'} +// {$HPPEMIT '# define BIO_set_write_buffer_size(b,size) BIO_int_ctrl(b,BIO_C_SET_BUFF_SIZE,size,1)'} +// {$HPPEMIT '# define BIO_set_buffer_read_data(b,buf,num) BIO_ctrl(b,BIO_C_SET_BUFF_READ_DATA,num,buf)'} +// +// (* Don't use the next one unless you know what you are doing :-) */ +// {$HPPEMIT '# define BIO_dup_state(b,ret) BIO_ctrl(b,BIO_CTRL_DUP,0,(char (ret))'} +// +// {$HPPEMIT '# define BIO_reset(b) (int)BIO_ctrl(b,BIO_CTRL_RESET,0,NULL)'} +// {$HPPEMIT '# define BIO_eof(b) (int)BIO_ctrl(b,BIO_CTRL_EOF,0,NULL)'} +// {$HPPEMIT '# define BIO_set_close(b,c) (int)BIO_ctrl(b,BIO_CTRL_SET_CLOSE,(c),NULL)'} +// {$HPPEMIT '# define BIO_get_close(b) (int)BIO_ctrl(b,BIO_CTRL_GET_CLOSE,0,NULL)'} +// {$HPPEMIT '# define BIO_pending(b) (int)BIO_ctrl(b,BIO_CTRL_PENDING,0,NULL)'} +// {$HPPEMIT '# define BIO_wpending(b) (int)BIO_ctrl(b,BIO_CTRL_WPENDING,0,NULL)'} + (* ...pending macros have inappropriate return type *) + BIO_ctrl_pending_procname = 'BIO_ctrl_pending'; + BIO_ctrl_wpending_procname = 'BIO_ctrl_wpending'; +// {$HPPEMIT '# define BIO_flush(b) (int)BIO_ctrl(b,BIO_CTRL_FLUSH,0,NULL)'} +// {$HPPEMIT '# define BIO_get_info_callback(b,cbp(int)BIO_ctrl(b,BIO_CTRL_GET_CALLBACK,0,'} +// cbp) +// {$HPPEMIT '# define BIO_set_info_callback(b,cb(int)BIO_callback_ctrl(b,BIO_CTRL_SET_CALLBACK,cb)'} +// +// (* For the BIO_f_buffer() type *) +// {$HPPEMIT '# define BIO_buffer_get_num_lines(b) BIO_ctrl(b,BIO_CTRL_GET,0,NULL)'} +// {$HPPEMIT '# define BIO_buffer_peek(b,s,l) BIO_ctrl(b,BIO_CTRL_PEEK,(l),(s))'} +// +// (* For BIO_s_bio() *) +// {$HPPEMIT '# define BIO_set_write_buf_size(b,size(int)BIO_ctrl(b,BIO_C_SET_WRITE_BUF_SIZE,size,NULL)'} +// {$HPPEMIT '# define BIO_get_write_buf_size(b,size(TIdC_SIZET)BIO_ctrl(b,BIO_C_GET_WRITE_BUF_SIZE,size,NULL)'} +// {$HPPEMIT '# define BIO_make_bio_pair(b1,b2) (int)BIO_ctrl(b1,BIO_C_MAKE_BIO_PAIR,0,b2)'} +// {$HPPEMIT '# define BIO_destroy_bio_pair(b) (int)BIO_ctrl(b,BIO_C_DESTROY_BIO_PAIR,0,NULL)'} +// {$HPPEMIT '# define BIO_shutdown_wr(b(int)BIO_ctrl(b, BIO_C_SHUTDOWN_WR, 0, NULL)'} +// (* macros with inappropriate type -- but ...pending macros use int too: *) +// {$HPPEMIT '# define BIO_get_write_guarantee(b(int)BIO_ctrl(b,BIO_C_GET_WRITE_GUARANTEE,0,NULL)'} +// {$HPPEMIT '# define BIO_get_read_request(b) (int)BIO_ctrl(b,BIO_C_GET_READ_REQUEST,0,NULL)'} + BIO_ctrl_get_write_guarantee_procname = 'BIO_ctrl_get_write_guarantee'; + BIO_ctrl_get_read_request_procname = 'BIO_ctrl_get_read_request'; + BIO_ctrl_reset_read_request_procname = 'BIO_ctrl_reset_read_request'; + + (* ctrl macros for dgram *) +// {$HPPEMIT '# define BIO_ctrl_dgram_connect(b,peer)'} +// (TIdC_INT)BIO_ctrl(b,BIO_CTRL_DGRAM_CONNECT,0, (char (peer)) +// {$HPPEMIT '# define BIO_ctrl_set_connected(b,peer)'} +// (TIdC_INT)BIO_ctrl(b, BIO_CTRL_DGRAM_SET_CONNECTED, 0, (char (peer)) +// {$HPPEMIT '# define BIO_dgram_recv_timedout(b)'} +// (TIdC_INT)BIO_ctrl(b, BIO_CTRL_DGRAM_GET_RECV_TIMER_EXP, 0, 0) +// {$HPPEMIT '# define BIO_dgram_send_timedout(b)'} +// (TIdC_INT)BIO_ctrl(b, BIO_CTRL_DGRAM_GET_SEND_TIMER_EXP, 0, 0) +// {$HPPEMIT '# define BIO_dgram_get_peer(b,peer)'} +// (TIdC_INT)BIO_ctrl(b, BIO_CTRL_DGRAM_GET_PEER, 0, (char (peer)) +// {$HPPEMIT '# define BIO_dgram_set_peer(b,peer)'} +// (TIdC_INT)BIO_ctrl(b, BIO_CTRL_DGRAM_SET_PEER, 0, (char (peer)) +// {$HPPEMIT '# define BIO_dgram_get_mtu_overhead(b)'} +// (Cardinal)BIO_ctrl((b), BIO_CTRL_DGRAM_GET_MTU_OVERHEAD, 0, 0) + +//#define BIO_get_ex_new_index(l, p, newf, dupf, freef) \ +// CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_BIO, l, p, newf, dupf, freef) + + BIO_set_ex_data_procname = 'BIO_set_ex_data'; + BIO_get_ex_data_procname = 'BIO_get_ex_data'; + BIO_number_read_procname = 'BIO_number_read'; + BIO_number_written_procname = 'BIO_number_written'; + + (* For BIO_f_asn1() *) +// function BIO_asn1_set_prefix(b: PBIO; prefix: ^asn1_ps_func; prefix_free: ^asn1_ps_func): TIdC_INT; +// function BIO_asn1_get_prefix(b: PBIO; pprefix: ^^asn1_ps_func; pprefix_free: ^^asn1_ps_func): TIdC_INT; +// function BIO_asn1_set_suffix(b: PBIO; suffix: ^asn1_ps_func; suffix_free: ^asn1_ps_func): TIdC_INT; +// function BIO_asn1_get_suffix(b: PBIO; psuffix: ^asn1_ps_func; psuffix_free: ^^asn1_ps_func): TIdC_INT; + + BIO_s_file_procname = 'BIO_s_file'; + BIO_new_file_procname = 'BIO_new_file'; +// function BIO_new_fp(stream: cFile; close_flag: TIdC_INT): PBIO; + BIO_new_procname = 'BIO_new'; + BIO_free_procname = 'BIO_free'; + BIO_set_data_procname = 'BIO_set_data'; {introduced 1.1.0} + BIO_get_data_procname = 'BIO_get_data'; {introduced 1.1.0} + BIO_set_init_procname = 'BIO_set_init'; {introduced 1.1.0} + BIO_get_init_procname = 'BIO_get_init'; {introduced 1.1.0} + BIO_set_shutdown_procname = 'BIO_set_shutdown'; {introduced 1.1.0} + BIO_get_shutdown_procname = 'BIO_get_shutdown'; {introduced 1.1.0} + BIO_vfree_procname = 'BIO_vfree'; + BIO_up_ref_procname = 'BIO_up_ref'; {introduced 1.1.0} + BIO_read_procname = 'BIO_read'; + BIO_read_ex_procname = 'BIO_read_ex'; {introduced 1.1.0} + BIO_gets_procname = 'BIO_gets'; + BIO_write_procname = 'BIO_write'; + BIO_write_ex_procname = 'BIO_write_ex'; {introduced 1.1.0} + BIO_puts_procname = 'BIO_puts'; + BIO_indent_procname = 'BIO_indent'; + BIO_ctrl_procname = 'BIO_ctrl'; + BIO_callback_ctrl_procname = 'BIO_callback_ctrl'; + BIO_ptr_ctrl_procname = 'BIO_ptr_ctrl'; + BIO_int_ctrl_procname = 'BIO_int_ctrl'; + BIO_push_procname = 'BIO_push'; + BIO_pop_procname = 'BIO_pop'; + BIO_free_all_procname = 'BIO_free_all'; + BIO_find_type_procname = 'BIO_find_type'; + BIO_next_procname = 'BIO_next'; + BIO_set_next_procname = 'BIO_set_next'; {introduced 1.1.0} + BIO_get_retry_BIO_procname = 'BIO_get_retry_BIO'; + BIO_get_retry_reason_procname = 'BIO_get_retry_reason'; + BIO_set_retry_reason_procname = 'BIO_set_retry_reason'; {introduced 1.1.0} + BIO_dup_chain_procname = 'BIO_dup_chain'; + + BIO_nread0_procname = 'BIO_nread0'; + BIO_nread_procname = 'BIO_nread'; + BIO_nwrite0_procname = 'BIO_nwrite0'; + BIO_nwrite_procname = 'BIO_nwrite'; + + BIO_debug_callback_procname = 'BIO_debug_callback'; + + BIO_s_mem_procname = 'BIO_s_mem'; + BIO_s_secmem_procname = 'BIO_s_secmem'; {introduced 1.1.0} + BIO_new_mem_buf_procname = 'BIO_new_mem_buf'; + + BIO_s_socket_procname = 'BIO_s_socket'; + BIO_s_connect_procname = 'BIO_s_connect'; + BIO_s_accept_procname = 'BIO_s_accept'; + + BIO_s_fd_procname = 'BIO_s_fd'; + BIO_s_log_procname = 'BIO_s_log'; + BIO_s_bio_procname = 'BIO_s_bio'; + BIO_s_null_procname = 'BIO_s_null'; + BIO_f_null_procname = 'BIO_f_null'; + BIO_f_buffer_procname = 'BIO_f_buffer'; + BIO_f_linebuffer_procname = 'BIO_f_linebuffer'; {introduced 1.1.0} + BIO_f_nbio_test_procname = 'BIO_f_nbio_test'; + BIO_s_datagram_procname = 'BIO_s_datagram'; + BIO_dgram_non_fatal_error_procname = 'BIO_dgram_non_fatal_error'; + BIO_new_dgram_procname = 'BIO_new_dgram'; + +// function BIO_s_datagram_sctp: PBIO_METHOD; +// function BIO_new_dgram_sctp(fd: TIdC_INT; close_flag: TIdC_INT): PBIO; +// function BIO_dgram_is_sctp(bio: PBIO): TIdC_INT; +// function BIO_dgram_sctp_notification_cb(bio: PBIO; handle_notifications(PBIO; +// context: Pointer; +// buf: Pointer): TIdC_INT, Pointer context); +// function BIO_dgram_sctp_wait_for_dry(b: PBIO): TIdC_INT; +// function BIO_dgram_sctp_msg_waiting(b: PBIO): TIdC_INT; + + BIO_sock_should_retry_procname = 'BIO_sock_should_retry'; + BIO_sock_non_fatal_error_procname = 'BIO_sock_non_fatal_error'; + + BIO_fd_should_retry_procname = 'BIO_fd_should_retry'; + BIO_fd_non_fatal_error_procname = 'BIO_fd_non_fatal_error'; +// function BIO_dump_cb( +// Pointer data: cb(; +// len: TIdC_SIZET; +// function: Pointer): u: TIdC_INT, Pointer function , PIdAnsiChar s, TIdC_INT len): u; +// function BIO_dump_indent_cb(TIdC_INT (cb( Pointer data, TIdC_SIZET len, Pointer function ): u: TIdC_INT, Pointer function , PIdAnsiChar s, TIdC_INT len, TIdC_INT indent): u; + BIO_dump_procname = 'BIO_dump'; + BIO_dump_indent_procname = 'BIO_dump_indent'; + +// function BIO_dump_fp(fp: cFile; const s: PByte; len: TIdC_INT): TIdC_INT; +// function BIO_dump_indent_fp(fp: cFile; const s: PByte; len: TIdC_INT; indent: TIdC_INT): TIdC_INT; + + BIO_hex_string_procname = 'BIO_hex_string'; + + BIO_ADDR_new_procname = 'BIO_ADDR_new'; {introduced 1.1.0} + BIO_ADDR_rawmake_procname = 'BIO_ADDR_rawmake'; {introduced 1.1.0} + BIO_ADDR_free_procname = 'BIO_ADDR_free'; {introduced 1.1.0} + BIO_ADDR_clear_procname = 'BIO_ADDR_clear'; {introduced 1.1.0} + BIO_ADDR_family_procname = 'BIO_ADDR_family'; {introduced 1.1.0} + BIO_ADDR_rawaddress_procname = 'BIO_ADDR_rawaddress'; {introduced 1.1.0} + BIO_ADDR_rawport_procname = 'BIO_ADDR_rawport'; {introduced 1.1.0} + BIO_ADDR_hostname_string_procname = 'BIO_ADDR_hostname_string'; {introduced 1.1.0} + BIO_ADDR_service_string_procname = 'BIO_ADDR_service_string'; {introduced 1.1.0} + BIO_ADDR_path_string_procname = 'BIO_ADDR_path_string'; {introduced 1.1.0} + + BIO_ADDRINFO_next_procname = 'BIO_ADDRINFO_next'; {introduced 1.1.0} + BIO_ADDRINFO_family_procname = 'BIO_ADDRINFO_family'; {introduced 1.1.0} + BIO_ADDRINFO_socktype_procname = 'BIO_ADDRINFO_socktype'; {introduced 1.1.0} + BIO_ADDRINFO_protocol_procname = 'BIO_ADDRINFO_protocol'; {introduced 1.1.0} + BIO_ADDRINFO_address_procname = 'BIO_ADDRINFO_address'; {introduced 1.1.0} + BIO_ADDRINFO_free_procname = 'BIO_ADDRINFO_free'; {introduced 1.1.0} + + BIO_parse_hostserv_procname = 'BIO_parse_hostserv'; {introduced 1.1.0} + + BIO_lookup_procname = 'BIO_lookup'; {introduced 1.1.0} + BIO_lookup_ex_procname = 'BIO_lookup_ex'; {introduced 1.1.0} + BIO_sock_error_procname = 'BIO_sock_error'; + BIO_socket_ioctl_procname = 'BIO_socket_ioctl'; + BIO_socket_nbio_procname = 'BIO_socket_nbio'; + BIO_sock_init_procname = 'BIO_sock_init'; + + BIO_set_tcp_ndelay_procname = 'BIO_set_tcp_ndelay'; + + BIO_sock_info_procname = 'BIO_sock_info'; {introduced 1.1.0} + + BIO_socket_procname = 'BIO_socket'; {introduced 1.1.0} + BIO_connect_procname = 'BIO_connect'; {introduced 1.1.0} + BIO_bind_procname = 'BIO_bind'; {introduced 1.1.0} + BIO_listen_procname = 'BIO_listen'; {introduced 1.1.0} + BIO_accept_ex_procname = 'BIO_accept_ex'; {introduced 1.1.0} + BIO_closesocket_procname = 'BIO_closesocket'; {introduced 1.1.0} + + BIO_new_socket_procname = 'BIO_new_socket'; + BIO_new_connect_procname = 'BIO_new_connect'; + BIO_new_accept_procname = 'BIO_new_accept'; + + BIO_new_fd_procname = 'BIO_new_fd'; + + BIO_new_bio_pair_procname = 'BIO_new_bio_pair'; + (* + * If successful, returns 1 and in *bio1, *bio2 two BIO pair endpoints. + * Otherwise returns 0 and sets *bio1 and *bio2 to NULL. Size 0 uses default + * value. + *) + + BIO_copy_next_retry_procname = 'BIO_copy_next_retry'; + +// BIO_METHOD *BIO_meth_new(int type, const char *name); +// void BIO_meth_free(BIO_METHOD *biom); +// int (*BIO_meth_get_write(const BIO_METHOD *biom)) (BIO *, const char *, int); +// int (*BIO_meth_get_write_ex(const BIO_METHOD *biom)) (BIO *, const char *, TIdC_SIZET, +// TIdC_SIZET *); +// int BIO_meth_set_write(BIO_METHOD *biom, +// int (*write) (BIO *, const char *, int)); +// int BIO_meth_set_write_ex(BIO_METHOD *biom, +// int (*bwrite) (BIO *, const char *, TIdC_SIZET, TIdC_SIZET *)); +// int (*BIO_meth_get_read(const BIO_METHOD *biom)) (BIO *, char *, int); +// int (*BIO_meth_get_read_ex(const BIO_METHOD *biom)) (BIO *, char *, TIdC_SIZET, TIdC_SIZET *); +// int BIO_meth_set_read(BIO_METHOD *biom, +// int (*read) (BIO *, char *, int)); +// int BIO_meth_set_read_ex(BIO_METHOD *biom, +// int (*bread) (BIO *, char *, TIdC_SIZET, TIdC_SIZET *)); +// int (*BIO_meth_get_puts(const BIO_METHOD *biom)) (BIO *, const char *); +// int BIO_meth_set_puts(BIO_METHOD *biom, +// int (*puts) (BIO *, const char *)); +// int (*BIO_meth_get_gets(const BIO_METHOD *biom)) (BIO *, char *, int); +// int BIO_meth_set_gets(BIO_METHOD *biom, +// int (*gets) (BIO *, char *, int)); +// long (*BIO_meth_get_ctrl(const BIO_METHOD *biom)) (BIO *, int, long, void *); +// int BIO_meth_set_ctrl(BIO_METHOD *biom, +// long (*ctrl) (BIO *, int, long, void *)); +// int (*BIO_meth_get_create(const BIO_METHOD *bion)) (BIO *); +// int BIO_meth_set_create(BIO_METHOD *biom, int (*create) (BIO *)); +// int (*BIO_meth_get_destroy(const BIO_METHOD *biom)) (BIO *); +// int BIO_meth_set_destroy(BIO_METHOD *biom, int (*destroy) (BIO *)); +// long (*BIO_meth_get_callback_ctrl(const BIO_METHOD *biom)) +// (BIO *, int, BIO_info_cb *); +// int BIO_meth_set_callback_ctrl(BIO_METHOD *biom, +// long (*callback_ctrl) (BIO *, int, +// BIO_info_cb *)); + + +// # define BIO_get_flags(b) BIO_test_flags(b, ~(0x0)) +function _BIO_get_flags(const b: PBIO): TIdC_INT; cdecl; +begin + Result := BIO_test_flags(b, not $0); +end; + +//# define BIO_set_retry_special(b) \ +// BIO_set_flags(b, (BIO_FLAGS_IO_SPECIAL|BIO_FLAGS_SHOULD_RETRY)) +procedure _BIO_set_retry_special(b: PBIO); cdecl; +begin + BIO_set_flags(b, BIO_FLAGS_IO_SPECIAL or BIO_FLAGS_SHOULD_RETRY); +end; + +//# define BIO_set_retry_read(b) \ +// BIO_set_flags(b, (BIO_FLAGS_READ|BIO_FLAGS_SHOULD_RETRY)) +procedure _BIO_set_retry_read(b: PBIO); cdecl; +begin + BIO_set_flags(b, BIO_FLAGS_READ or BIO_FLAGS_SHOULD_RETRY); +end; + +//# define BIO_set_retry_write(b) \ +// BIO_set_flags(b, (BIO_FLAGS_WRITE|BIO_FLAGS_SHOULD_RETRY)) +procedure _BIO_set_retry_write(b: PBIO); cdecl; +begin + BIO_set_flags(b, BIO_FLAGS_WRITE or BIO_FLAGS_SHOULD_RETRY); +end; + +//# define BIO_clear_retry_flags(b) \ +// BIO_clear_flags(b, (BIO_FLAGS_RWS|BIO_FLAGS_SHOULD_RETRY)) +procedure _BIO_clear_retry_flags(b: PBIO); cdecl; +begin + BIO_clear_flags(b, BIO_FLAGS_RWS or BIO_FLAGS_SHOULD_RETRY); +end; + +//# define BIO_get_retry_flags(b) \ +// BIO_test_flags(b, (BIO_FLAGS_RWS|BIO_FLAGS_SHOULD_RETRY)) +function _BIO_get_retry_flags(b: PBIO): TIdC_INT; cdecl; +begin + Result := BIO_test_flags(b, BIO_FLAGS_RWS or BIO_FLAGS_SHOULD_RETRY); +end; + +//# define BIO_should_read(a) BIO_test_flags(a, BIO_FLAGS_READ) +function _BIO_should_read(b: PBIO): TIdC_INT; cdecl; +begin + Result := BIO_test_flags(b, BIO_FLAGS_READ); +end; + +//# define BIO_should_write(a) BIO_test_flags(a, BIO_FLAGS_WRITE) +function _BIO_should_write(b: PBIO): TIdC_INT; cdecl; +begin + Result := BIO_test_flags(b, BIO_FLAGS_WRITE); +end; + +//# define BIO_should_io_special(a) BIO_test_flags(a, BIO_FLAGS_IO_SPECIAL) +function _BIO_should_io_special(b: PBIO): TIdC_INT; cdecl; +begin + Result := BIO_test_flags(b, BIO_FLAGS_IO_SPECIAL); +end; + +//# define BIO_retry_type(a) BIO_test_flags(a, BIO_FLAGS_RWS) +function _BIO_retry_type(b: PBIO): TIdC_INT; cdecl; +begin + Result := BIO_test_flags(b, BIO_FLAGS_RWS); +end; + +//# define BIO_should_retry(a) BIO_test_flags(a, BIO_FLAGS_SHOULD_RETRY) +function _BIO_should_retry(b: PBIO): TIdC_INT; cdecl; +begin + Result := BIO_test_flags(b, BIO_FLAGS_SHOULD_RETRY); +end; + +//# define BIO_do_connect(b) BIO_do_handshake(b) +function _BIO_do_connect(b: PBIO): TIdC_LONG; cdecl; +begin + Result := BIO_do_handshake(b); +end; + +//# define BIO_do_accept(b) BIO_do_handshake(b) +function _BIO_do_accept(b: PBIO): TIdC_LONG; cdecl; +begin + Result := BIO_do_handshake(b); +end; + +//# define BIO_do_handshake(b) BIO_ctrl(b,BIO_C_DO_STATE_MACHINE,0,NULL) +function _BIO_do_handshake(b: PBIO): TIdC_LONG; cdecl; +begin + Result := BIO_ctrl(b, BIO_C_DO_STATE_MACHINE, 0, nil); +end; + +//# define BIO_get_mem_data(b,pp) BIO_ctrl(b,BIO_CTRL_INFO,0,(char (pp)) +function _BIO_get_mem_data(b: PBIO; pp: PIdAnsiChar) : TIdC_INT; cdecl; +begin + Result := BIO_ctrl(b, BIO_CTRL_INFO, 0, pp); +end; + +//# define BIO_set_mem_buf(b,bm,c) BIO_ctrl(b,BIO_C_SET_BUF_MEM,c,(char (bm)) +function _BIO_set_mem_buf(b: PBIO; bm: PIdAnsiChar; c: TIdC_INT): TIdC_INT; cdecl; +begin + Result := BIO_ctrl(b, BIO_C_SET_BUF_MEM, c, bm); +end; + +//# define BIO_get_mem_ptr(b,pp) BIO_ctrl(b,BIO_C_GET_BUF_MEM_PTR,0,(char (pp)) +function _BIO_get_mem_ptr(b: PBIO; pp: PIdAnsiChar): TIdC_INT; cdecl; +begin + Result := BIO_ctrl(b, BIO_C_GET_BUF_MEM_PTR, 0, pp); +end; + +//# define BIO_set_mem_eof_return(b,v) BIO_ctrl(b,BIO_C_SET_BUF_MEM_EOF_RETURN,v,0) +function _BIO_set_mem_eof_return(b: PBIO; v: TIdC_INT): TIdC_INT; cdecl; +begin + Result := BIO_ctrl(b, BIO_C_SET_BUF_MEM_EOF_RETURN, v, nil); +end; + +{$WARN NO_RETVAL OFF} +function ERR_BIO_get_flags(const b: PBIO): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_get_flags_procname); +end; + + +procedure ERR_BIO_set_retry_special(b: PBIO); +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_set_retry_special_procname); +end; + + +procedure ERR_BIO_set_retry_read(b: PBIO); +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_set_retry_read_procname); +end; + + +procedure ERR_BIO_set_retry_write(b: PBIO); +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_set_retry_write_procname); +end; + + + +(* These are normally used internally in BIOs *) +procedure ERR_BIO_clear_retry_flags(b: PBIO); +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_clear_retry_flags_procname); +end; + + +function ERR_BIO_get_retry_flags(b: PBIO): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_get_retry_flags_procname); +end; + + + +(* These should be used by the application to tell why we should retry *) +function ERR_BIO_should_read(b: PBIO): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_should_read_procname); +end; + + +function ERR_BIO_should_write(b: PBIO): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_should_write_procname); +end; + + +function ERR_BIO_should_io_special(b: PBIO): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_should_io_special_procname); +end; + + +function ERR_BIO_retry_type(b: PBIO): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_retry_type_procname); +end; + + +function ERR_BIO_should_retry(b: PBIO): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_should_retry_procname); +end; + + + +(* BIO_s_accept() and BIO_s_connect() *) +function ERR_BIO_do_connect(b: PBIO): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_do_connect_procname); +end; + + +function ERR_BIO_do_accept(b: PBIO): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_do_accept_procname); +end; + + +function ERR_BIO_do_handshake(b: PBIO): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_do_handshake_procname); +end; + + + +function ERR_BIO_get_mem_data(b: PBIO; pp: PIdAnsiChar) : TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_get_mem_data_procname); +end; + + +function ERR_BIO_set_mem_buf(b: PBIO; bm: PIdAnsiChar; c: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_set_mem_buf_procname); +end; + + +function ERR_BIO_get_mem_ptr(b: PBIO; pp: PIdAnsiChar): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_get_mem_ptr_procname); +end; + + +function ERR_BIO_set_mem_eof_return(b: PBIO; v: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_set_mem_eof_return_procname); +end; + + + +function ERR_BIO_get_new_index: TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_get_new_index_procname); +end; + + {introduced 1.1.0} +procedure ERR_BIO_set_flags(b: PBIO; flags: TIdC_INT); +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_set_flags_procname); +end; + + +function ERR_BIO_test_flags(const b: PBIO; flags: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_test_flags_procname); +end; + + +procedure ERR_BIO_clear_flags(b: PBIO; flags: TIdC_INT); +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_clear_flags_procname); +end; + + + +function ERR_BIO_get_callback(b: PBIO): BIO_callback_fn; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_get_callback_procname); +end; + + +procedure ERR_BIO_set_callback(b: PBIO; callback: BIO_callback_fn); +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_set_callback_procname); +end; + + + +function ERR_BIO_get_callback_ex(b: PBIO): BIO_callback_fn_ex; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_get_callback_ex_procname); +end; + + {introduced 1.1.0} +procedure ERR_BIO_set_callback_ex(b: PBIO; callback: BIO_callback_fn_ex); +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_set_callback_ex_procname); +end; + + {introduced 1.1.0} + +function ERR_BIO_get_callback_arg(const b: PBIO): PIdAnsiChar; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_get_callback_arg_procname); +end; + + +procedure ERR_BIO_set_callback_arg(var b: PBIO; arg: PIdAnsiChar); +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_set_callback_arg_procname); +end; + + + +function ERR_BIO_method_name(const b: PBIO): PIdAnsiChar; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_method_name_procname); +end; + + +function ERR_BIO_method_type(const b: PBIO): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_method_type_procname); +end; + + + +// {$HPPEMIT '# define BIO_set_app_data(s,arg) BIO_set_ex_data(s,0,arg)'} +// {$HPPEMIT '# define BIO_get_app_data(s) BIO_get_ex_data(s,0)'} +// +// {$HPPEMIT '# define BIO_set_nbio(b,n) BIO_ctrl(b,BIO_C_SET_NBIO,(n),NULL)'} +// +// {$HPPEMIT '# ifndef OPENSSL_NO_SOCK'} +// (* IP families we support, for BIO_s_connect() and BIO_s_accept() *) +// (* Note: the underlying operating system may not support some of them *) +// {$HPPEMIT '# define BIO_FAMILY_IPV4 4'} +// {$HPPEMIT '# define BIO_FAMILY_IPV6 6'} +// {$HPPEMIT '# define BIO_FAMILY_IPANY 256'} +// +// (* BIO_s_connect() *) +// {$HPPEMIT '# define BIO_set_conn_hostname(b,name) BIO_ctrl(b,BIO_C_SET_CONNECT,0,'} +// (char (name)) +// {$HPPEMIT '# define BIO_set_conn_port(b,port) BIO_ctrl(b,BIO_C_SET_CONNECT,1,'} +// (char (port)) +// {$HPPEMIT '# define BIO_set_conn_address(b,addr) BIO_ctrl(b,BIO_C_SET_CONNECT,2,'} +// (char (addr)) +// {$HPPEMIT '# define BIO_set_conn_ip_family(b,f) BIO_int_ctrl(b,BIO_C_SET_CONNECT,3,f)'} +// {$HPPEMIT '# define BIO_get_conn_hostname(b) (( char )BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,0))'} +// {$HPPEMIT '# define BIO_get_conn_port(b) (( char )BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,1))'} +// {$HPPEMIT '# define BIO_get_conn_address(b) (( PBIO_ADDR )BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,2))'} +// {$HPPEMIT '# define BIO_get_conn_ip_family(b) BIO_ctrl(b,BIO_C_GET_CONNECT,3,NULL)'} +// {$HPPEMIT '# define BIO_set_conn_mode(b,n) BIO_ctrl(b,BIO_C_SET_CONNECT_MODE,(n),NULL)'} +// +// (* BIO_s_accept() *) +// {$HPPEMIT '# define BIO_set_accept_name(b,name) BIO_ctrl(b,BIO_C_SET_ACCEPT,0,'} +// {$EXTERNALSYM PBIO} +// (char (name)) +// {$HPPEMIT '# define BIO_set_accept_port(b,port) BIO_ctrl(b,BIO_C_SET_ACCEPT,1,'} +// (char (port)) +// {$HPPEMIT '# define BIO_get_accept_name(b) (( char )BIO_ptr_ctrl(b,BIO_C_GET_ACCEPT,0))'} +// {$HPPEMIT '# define BIO_get_accept_port(b) (( char )BIO_ptr_ctrl(b,BIO_C_GET_ACCEPT,1))'} +// {$HPPEMIT '# define BIO_get_peer_name(b) (( char )BIO_ptr_ctrl(b,BIO_C_GET_ACCEPT,2))'} +// {$HPPEMIT '# define BIO_get_peer_port(b) (( char )BIO_ptr_ctrl(b,BIO_C_GET_ACCEPT,3))'} +// (* #define BIO_set_nbio(b,n) BIO_ctrl(b,BIO_C_SET_NBIO,(n),NULL) *) +// {$HPPEMIT '# define BIO_set_nbio_accept(b,n) # define BIO_set_nbio_accept(b,n) BIO_ctrl(b,BIO_C_SET_ACCEPT,2,(n)?(procedure )'a':NULL) BIO_ctrl(b,BIO_C_SET_ACCEPT,3,'} +// (char (bio)) +// {$HPPEMIT '# define BIO_set_accept_ip_family(b,f) BIO_int_ctrl(b,BIO_C_SET_ACCEPT,4,f)'} +// {$HPPEMIT '# define BIO_get_accept_ip_family(b) BIO_ctrl(b,BIO_C_GET_ACCEPT,4,NULL)'} +// +// (* Aliases kept for backward compatibility *) +// {$HPPEMIT '# define BIO_BIND_NORMAL 0'} +// {$HPPEMIT '# define BIO_BIND_REUSEADDR BIO_SOCK_REUSEADDR'} +// {$HPPEMIT '# define BIO_BIND_REUSEADDR_IF_UNUSED BIO_SOCK_REUSEADDR'} +// {$HPPEMIT '# define BIO_set_bind_mode(b,mode) BIO_ctrl(b,BIO_C_SET_BIND_MODE,mode,NULL)'} +// {$HPPEMIT '# define BIO_get_bind_mode(b) BIO_ctrl(b,BIO_C_GET_BIND_MODE,0,NULL)'} +// +// (* BIO_s_accept() and BIO_s_connect() *) +// {$HPPEMIT '# define BIO_do_connect(b) BIO_do_handshake(b)'} +// {$HPPEMIT '# define BIO_do_accept(b) BIO_do_handshake(b)'} +// {$HPPEMIT '# endif'} (* OPENSSL_NO_SOCK *) +// +// {$HPPEMIT '# define BIO_do_handshake(b) BIO_ctrl(b,BIO_C_DO_STATE_MACHINE,0,NULL)'} +// +// (* BIO_s_datagram(), BIO_s_fd(), BIO_s_socket(), BIO_s_accept() and BIO_s_connect() *) +// {$HPPEMIT '# define BIO_set_fd(b,fd,c) BIO_int_ctrl(b,BIO_C_SET_FD,c,fd)'} +// {$HPPEMIT '# define BIO_get_fd(b,c) BIO_ctrl(b,BIO_C_GET_FD,0,(char (c))'} +// +// (* BIO_s_file() *) +// {$HPPEMIT '# define BIO_set_fp(b,fp,c) BIO_ctrl(b,BIO_C_SET_FILE_PTR,c,(char (fp))'} +// {$HPPEMIT '# define BIO_get_fp(b,fpp) BIO_ctrl(b,BIO_C_GET_FILE_PTR,0,(char (fpp))'} +// +// (* BIO_s_fd() and BIO_s_file() *) +// {$HPPEMIT '# define BIO_seek(b,ofs(int)BIO_ctrl(b,BIO_C_FILE_SEEK,ofs,NULL)'} +// {$HPPEMIT '# define BIO_tell(b) (int)BIO_ctrl(b,BIO_C_FILE_TELL,0,NULL)'} +// +// (* +// * name is cast to lose , but might be better to route through a +// * cFunction so we can do it safely +// *) +// {$HPPEMIT '# ifdef CONST_STRICT'} +// (* +// * If you are wondering why this isn't defined, its because CONST_STRICT is +// * purely a compile-time kludge to allow to be checked. +// *) +//// function BIO_read_filename(b: PBIO; const name: PIdAnsiChar): TIdC_INT; +// {$HPPEMIT '# define BIO_write_filename(b,name(int)BIO_ctrl(b,BIO_C_SET_FILENAME,'} +// BIO_CLOSE or BIO_FP_WRITE,name) +// {$HPPEMIT '# define BIO_append_filename(b,name(int)BIO_ctrl(b,BIO_C_SET_FILENAME,'} +// BIO_CLOSE or BIO_FP_APPEND,name) +// {$HPPEMIT '# define BIO_rw_filename(b,name(int)BIO_ctrl(b,BIO_C_SET_FILENAME,'} +// BIO_CLOSE or BIO_FP_READ or BIO_FP_WRITE,name) +// +// (* +// * WARNING WARNING, this ups the reference count on the read bio of the SSL +// * structure. This is because the ssl read PBIO is now pointed to by the +// * next_bio field in the bio. So when you free the PBIO, make sure you are +// * doing a BIO_free_all() to catch the underlying PBIO. +// *) +// {$HPPEMIT '# define BIO_set_ssl(b,ssl,c) BIO_ctrl(b,BIO_C_SET_SSL,c,(char (ssl))'} +// {$HPPEMIT '# define BIO_get_ssl(b,sslp) BIO_ctrl(b,BIO_C_GET_SSL,0,(char (sslp))'} +// {$HPPEMIT '# define BIO_set_ssl_mode(b,client) BIO_ctrl(b,BIO_C_SSL_MODE,client,NULL)'} +// {$HPPEMIT '# define BIO_set_ssl_renegotiate_bytes(b,num)'} +// BIO_ctrl(b,BIO_C_SET_SSL_RENEGOTIATE_BYTES,num,0) +// {$HPPEMIT '# define BIO_get_num_renegotiates(b)'} +// BIO_ctrl(b,BIO_C_GET_SSL_NUM_RENEGOTIATES,0,0) +// {$HPPEMIT '# define BIO_set_ssl_renegotiate_timeout(b,seconds)'} +// BIO_ctrl(b,BIO_C_SET_SSL_RENEGOTIATE_TIMEOUT,seconds,0) +// +// (* defined in evp.h *) +// (* #define BIO_set_md(b,md) BIO_ctrl(b,BIO_C_SET_MD,1,(char )(md)) *) +// +// (* For the BIO_f_buffer() type *) +// {$HPPEMIT '# define BIO_get_buffer_num_lines(b) BIO_ctrl(b,BIO_C_GET_BUFF_NUM_LINES,0,NULL)'} +// {$HPPEMIT '# define BIO_set_buffer_size(b,size) BIO_ctrl(b,BIO_C_SET_BUFF_SIZE,size,NULL)'} +// {$HPPEMIT '# define BIO_set_read_buffer_size(b,size) BIO_int_ctrl(b,BIO_C_SET_BUFF_SIZE,size,0)'} +// {$HPPEMIT '# define BIO_set_write_buffer_size(b,size) BIO_int_ctrl(b,BIO_C_SET_BUFF_SIZE,size,1)'} +// {$HPPEMIT '# define BIO_set_buffer_read_data(b,buf,num) BIO_ctrl(b,BIO_C_SET_BUFF_READ_DATA,num,buf)'} +// +// (* Don't use the next one unless you know what you are doing :-) */ +// {$HPPEMIT '# define BIO_dup_state(b,ret) BIO_ctrl(b,BIO_CTRL_DUP,0,(char (ret))'} +// +// {$HPPEMIT '# define BIO_reset(b) (int)BIO_ctrl(b,BIO_CTRL_RESET,0,NULL)'} +// {$HPPEMIT '# define BIO_eof(b) (int)BIO_ctrl(b,BIO_CTRL_EOF,0,NULL)'} +// {$HPPEMIT '# define BIO_set_close(b,c) (int)BIO_ctrl(b,BIO_CTRL_SET_CLOSE,(c),NULL)'} +// {$HPPEMIT '# define BIO_get_close(b) (int)BIO_ctrl(b,BIO_CTRL_GET_CLOSE,0,NULL)'} +// {$HPPEMIT '# define BIO_pending(b) (int)BIO_ctrl(b,BIO_CTRL_PENDING,0,NULL)'} +// {$HPPEMIT '# define BIO_wpending(b) (int)BIO_ctrl(b,BIO_CTRL_WPENDING,0,NULL)'} + (* ...pending macros have inappropriate return type *) +function ERR_BIO_ctrl_pending(b: PBIO): TIdC_SIZET; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_ctrl_pending_procname); +end; + + +function ERR_BIO_ctrl_wpending(b: PBIO): TIdC_SIZET; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_ctrl_wpending_procname); +end; + + +// {$HPPEMIT '# define BIO_flush(b) (int)BIO_ctrl(b,BIO_CTRL_FLUSH,0,NULL)'} +// {$HPPEMIT '# define BIO_get_info_callback(b,cbp(int)BIO_ctrl(b,BIO_CTRL_GET_CALLBACK,0,'} +// cbp) +// {$HPPEMIT '# define BIO_set_info_callback(b,cb(int)BIO_callback_ctrl(b,BIO_CTRL_SET_CALLBACK,cb)'} +// +// (* For the BIO_f_buffer() type *) +// {$HPPEMIT '# define BIO_buffer_get_num_lines(b) BIO_ctrl(b,BIO_CTRL_GET,0,NULL)'} +// {$HPPEMIT '# define BIO_buffer_peek(b,s,l) BIO_ctrl(b,BIO_CTRL_PEEK,(l),(s))'} +// +// (* For BIO_s_bio() *) +// {$HPPEMIT '# define BIO_set_write_buf_size(b,size(int)BIO_ctrl(b,BIO_C_SET_WRITE_BUF_SIZE,size,NULL)'} +// {$HPPEMIT '# define BIO_get_write_buf_size(b,size(TIdC_SIZET)BIO_ctrl(b,BIO_C_GET_WRITE_BUF_SIZE,size,NULL)'} +// {$HPPEMIT '# define BIO_make_bio_pair(b1,b2) (int)BIO_ctrl(b1,BIO_C_MAKE_BIO_PAIR,0,b2)'} +// {$HPPEMIT '# define BIO_destroy_bio_pair(b) (int)BIO_ctrl(b,BIO_C_DESTROY_BIO_PAIR,0,NULL)'} +// {$HPPEMIT '# define BIO_shutdown_wr(b(int)BIO_ctrl(b, BIO_C_SHUTDOWN_WR, 0, NULL)'} +// (* macros with inappropriate type -- but ...pending macros use int too: *) +// {$HPPEMIT '# define BIO_get_write_guarantee(b(int)BIO_ctrl(b,BIO_C_GET_WRITE_GUARANTEE,0,NULL)'} +// {$HPPEMIT '# define BIO_get_read_request(b) (int)BIO_ctrl(b,BIO_C_GET_READ_REQUEST,0,NULL)'} +function ERR_BIO_ctrl_get_write_guarantee(b: PBIO): TIdC_SIZET; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_ctrl_get_write_guarantee_procname); +end; + + +function ERR_BIO_ctrl_get_read_request(b: PBIO): TIdC_SIZET; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_ctrl_get_read_request_procname); +end; + + +function ERR_BIO_ctrl_reset_read_request(b: PBIO): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_ctrl_reset_read_request_procname); +end; + + + + (* ctrl macros for dgram *) +// {$HPPEMIT '# define BIO_ctrl_dgram_connect(b,peer)'} +// (TIdC_INT)BIO_ctrl(b,BIO_CTRL_DGRAM_CONNECT,0, (char (peer)) +// {$HPPEMIT '# define BIO_ctrl_set_connected(b,peer)'} +// (TIdC_INT)BIO_ctrl(b, BIO_CTRL_DGRAM_SET_CONNECTED, 0, (char (peer)) +// {$HPPEMIT '# define BIO_dgram_recv_timedout(b)'} +// (TIdC_INT)BIO_ctrl(b, BIO_CTRL_DGRAM_GET_RECV_TIMER_EXP, 0, 0) +// {$HPPEMIT '# define BIO_dgram_send_timedout(b)'} +// (TIdC_INT)BIO_ctrl(b, BIO_CTRL_DGRAM_GET_SEND_TIMER_EXP, 0, 0) +// {$HPPEMIT '# define BIO_dgram_get_peer(b,peer)'} +// (TIdC_INT)BIO_ctrl(b, BIO_CTRL_DGRAM_GET_PEER, 0, (char (peer)) +// {$HPPEMIT '# define BIO_dgram_set_peer(b,peer)'} +// (TIdC_INT)BIO_ctrl(b, BIO_CTRL_DGRAM_SET_PEER, 0, (char (peer)) +// {$HPPEMIT '# define BIO_dgram_get_mtu_overhead(b)'} +// (Cardinal)BIO_ctrl((b), BIO_CTRL_DGRAM_GET_MTU_OVERHEAD, 0, 0) + +//#define BIO_get_ex_new_index(l, p, newf, dupf, freef) \ +// CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_BIO, l, p, newf, dupf, freef) + +function ERR_BIO_set_ex_data(bio: PBIO; idx: TIdC_INT; data: Pointer): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_set_ex_data_procname); +end; + + +function ERR_BIO_get_ex_data(bio: PBIO; idx: TIdC_INT): Pointer; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_get_ex_data_procname); +end; + + +function ERR_BIO_number_read(bio: PBIO): TIdC_UINT64; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_number_read_procname); +end; + + +function ERR_BIO_number_written(bio: PBIO): TIdC_UINT64; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_number_written_procname); +end; + + + + (* For BIO_f_asn1() *) +// function BIO_asn1_set_prefix(b: PBIO; prefix: ^asn1_ps_func; prefix_free: ^asn1_ps_func): TIdC_INT; +// function BIO_asn1_get_prefix(b: PBIO; pprefix: ^^asn1_ps_func; pprefix_free: ^^asn1_ps_func): TIdC_INT; +// function BIO_asn1_set_suffix(b: PBIO; suffix: ^asn1_ps_func; suffix_free: ^asn1_ps_func): TIdC_INT; +// function BIO_asn1_get_suffix(b: PBIO; psuffix: ^asn1_ps_func; psuffix_free: ^^asn1_ps_func): TIdC_INT; + +function ERR_BIO_s_file: PBIO_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_s_file_procname); +end; + + +function ERR_BIO_new_file(const filename: PIdAnsiChar; const mode: PIdAnsiChar): PBIO; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_new_file_procname); +end; + + +// function BIO_new_fp(stream: cFile; close_flag: TIdC_INT): PBIO; +function ERR_BIO_new(const cType: PBIO_METHOD): PBIO; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_new_procname); +end; + + +function ERR_BIO_free(a: PBIO): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_free_procname); +end; + + +procedure ERR_BIO_set_data(a: PBIO; ptr: Pointer); +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_set_data_procname); +end; + + {introduced 1.1.0} +function ERR_BIO_get_data(a: PBIO): Pointer; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_get_data_procname); +end; + + {introduced 1.1.0} +procedure ERR_BIO_set_init(a: PBIO; init: TIdC_INT); +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_set_init_procname); +end; + + {introduced 1.1.0} +function ERR_BIO_get_init(a: PBIO): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_get_init_procname); +end; + + {introduced 1.1.0} +procedure ERR_BIO_set_shutdown(a: PBIO; shut: TIdC_INT); +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_set_shutdown_procname); +end; + + {introduced 1.1.0} +function ERR_BIO_get_shutdown(a: PBIO): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_get_shutdown_procname); +end; + + {introduced 1.1.0} +procedure ERR_BIO_vfree(a: PBIO); +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_vfree_procname); +end; + + +function ERR_BIO_up_ref(a: PBIO): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_up_ref_procname); +end; + + {introduced 1.1.0} +function ERR_BIO_read(b: PBIO; data: Pointer; dlen: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_read_procname); +end; + + +function ERR_BIO_read_ex(b: PBIO; data: Pointer; dlen: TIdC_SIZET; readbytes: PIdC_SIZET): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_read_ex_procname); +end; + + {introduced 1.1.0} +function ERR_BIO_gets( bp: PBIO; buf: PIdAnsiChar; size: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_gets_procname); +end; + + +function ERR_BIO_write(b: PBIO; const data: Pointer; dlen: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_write_procname); +end; + + +function ERR_BIO_write_ex(b: PBIO; const data: Pointer; dlen: TIdC_SIZET; written: PIdC_SIZET): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_write_ex_procname); +end; + + {introduced 1.1.0} +function ERR_BIO_puts(bp: PBIO; const buf: PIdAnsiChar): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_puts_procname); +end; + + +function ERR_BIO_indent(b: PBIO; indent: TIdC_INT; max: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_indent_procname); +end; + + +function ERR_BIO_ctrl(bp: PBIO; cmd: TIdC_INT; larg: TIdC_LONG; parg: Pointer): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_ctrl_procname); +end; + + +function ERR_BIO_callback_ctrl(b: PBIO; cmd: TIdC_INT; fp: PBIO_info_cb): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_callback_ctrl_procname); +end; + + +function ERR_BIO_ptr_ctrl(bp: PBIO; cmd: TIdC_INT; larg: TIdC_LONG): Pointer; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_ptr_ctrl_procname); +end; + + +function ERR_BIO_int_ctrl(bp: PBIO; cmd: TIdC_INT; larg: TIdC_LONG; iarg: TIdC_INT): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_int_ctrl_procname); +end; + + +function ERR_BIO_push(b: PBIO; append: PBIO): PBIO; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_push_procname); +end; + + +function ERR_BIO_pop(b: PBIO): PBIO; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_pop_procname); +end; + + +procedure ERR_BIO_free_all(a: PBIO); +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_free_all_procname); +end; + + +function ERR_BIO_find_type(b: PBIO; bio_type: TIdC_INT): PBIO; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_find_type_procname); +end; + + +function ERR_BIO_next(b: PBIO): PBIO; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_next_procname); +end; + + +procedure ERR_BIO_set_next(b: PBIO; next: PBIO); +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_set_next_procname); +end; + + {introduced 1.1.0} +function ERR_BIO_get_retry_BIO(bio: PBIO; reason: TIdC_INT): PBIO; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_get_retry_BIO_procname); +end; + + +function ERR_BIO_get_retry_reason(bio: PBIO): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_get_retry_reason_procname); +end; + + +procedure ERR_BIO_set_retry_reason(bio: PBIO; reason: TIdC_INT); +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_set_retry_reason_procname); +end; + + {introduced 1.1.0} +function ERR_BIO_dup_chain(in_: PBIO): PBIO; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_dup_chain_procname); +end; + + + +function ERR_BIO_nread0(bio: PBIO; buf: PPIdAnsiChar): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_nread0_procname); +end; + + +function ERR_BIO_nread(bio: PBIO; buf: PPIdAnsiChar; num: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_nread_procname); +end; + + +function ERR_BIO_nwrite0(bio: PBIO; buf: PPIdAnsiChar): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_nwrite0_procname); +end; + + +function ERR_BIO_nwrite(bio: PBIO; buf: PPIdAnsiChar; num: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_nwrite_procname); +end; + + + +function ERR_BIO_debug_callback(bio: PBIO; cmd: TIdC_INT; const argp: PIdAnsiChar; argi: TIdC_INT; argl: TIdC_LONG; ret: TIdC_LONG): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_debug_callback_procname); +end; + + + +function ERR_BIO_s_mem: PBIO_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_s_mem_procname); +end; + + +function ERR_BIO_s_secmem: PBIO_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_s_secmem_procname); +end; + + {introduced 1.1.0} +function ERR_BIO_new_mem_buf(const buf: Pointer; len: TIdC_INT): PBIO; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_new_mem_buf_procname); +end; + + + +function ERR_BIO_s_socket: PBIO_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_s_socket_procname); +end; + + +function ERR_BIO_s_connect: PBIO_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_s_connect_procname); +end; + + +function ERR_BIO_s_accept: PBIO_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_s_accept_procname); +end; + + + +function ERR_BIO_s_fd: PBIO_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_s_fd_procname); +end; + + +function ERR_BIO_s_log: PBIO_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_s_log_procname); +end; + + +function ERR_BIO_s_bio: PBIO_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_s_bio_procname); +end; + + +function ERR_BIO_s_null: PBIO_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_s_null_procname); +end; + + +function ERR_BIO_f_null: PBIO_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_f_null_procname); +end; + + +function ERR_BIO_f_buffer: PBIO_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_f_buffer_procname); +end; + + +function ERR_BIO_f_linebuffer: PBIO_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_f_linebuffer_procname); +end; + + {introduced 1.1.0} +function ERR_BIO_f_nbio_test: PBIO_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_f_nbio_test_procname); +end; + + +function ERR_BIO_s_datagram: PBIO_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_s_datagram_procname); +end; + + +function ERR_BIO_dgram_non_fatal_error(error: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_dgram_non_fatal_error_procname); +end; + + +function ERR_BIO_new_dgram(fd: TIdC_INT; close_flag: TIdC_INT): PBIO; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_new_dgram_procname); +end; + + + +// function BIO_s_datagram_sctp: PBIO_METHOD; +// function BIO_new_dgram_sctp(fd: TIdC_INT; close_flag: TIdC_INT): PBIO; +// function BIO_dgram_is_sctp(bio: PBIO): TIdC_INT; +// function BIO_dgram_sctp_notification_cb(bio: PBIO; handle_notifications(PBIO; +// context: Pointer; +// buf: Pointer): TIdC_INT, Pointer context); +// function BIO_dgram_sctp_wait_for_dry(b: PBIO): TIdC_INT; +// function BIO_dgram_sctp_msg_waiting(b: PBIO): TIdC_INT; + +function ERR_BIO_sock_should_retry(i: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_sock_should_retry_procname); +end; + + +function ERR_BIO_sock_non_fatal_error(error: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_sock_non_fatal_error_procname); +end; + + + +function ERR_BIO_fd_should_retry(i: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_fd_should_retry_procname); +end; + + +function ERR_BIO_fd_non_fatal_error(error: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_fd_non_fatal_error_procname); +end; + + +// function BIO_dump_cb( +// Pointer data: cb(; +// len: TIdC_SIZET; +// function: Pointer): u: TIdC_INT, Pointer function , PIdAnsiChar s, TIdC_INT len): u; +// function BIO_dump_indent_cb(TIdC_INT (cb( Pointer data, TIdC_SIZET len, Pointer function ): u: TIdC_INT, Pointer function , PIdAnsiChar s, TIdC_INT len, TIdC_INT indent): u; +function ERR_BIO_dump(b: PBIO; const bytes: PIdAnsiChar; len: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_dump_procname); +end; + + +function ERR_BIO_dump_indent(b: PBIO; const bytes: PIdAnsiChar; len: TIdC_INT; indent: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_dump_indent_procname); +end; + + + +// function BIO_dump_fp(fp: cFile; const s: PByte; len: TIdC_INT): TIdC_INT; +// function BIO_dump_indent_fp(fp: cFile; const s: PByte; len: TIdC_INT; indent: TIdC_INT): TIdC_INT; + +function ERR_BIO_hex_string(out_: PBIO; indent: TIdC_INT; width: TIdC_INT; data: PByte; datalen: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_hex_string_procname); +end; + + + +function ERR_BIO_ADDR_new: PBIO_ADDR; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_ADDR_new_procname); +end; + + {introduced 1.1.0} +function ERR_BIO_ADDR_rawmake(ap: PBIO_ADDR; familiy: TIdC_INT; const where: Pointer; wherelen: TIdC_SIZET; port: TIdC_SHORT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_ADDR_rawmake_procname); +end; + + {introduced 1.1.0} +procedure ERR_BIO_ADDR_free(a: PBIO_ADDR); +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_ADDR_free_procname); +end; + + {introduced 1.1.0} +procedure ERR_BIO_ADDR_clear(ap: PBIO_ADDR); +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_ADDR_clear_procname); +end; + + {introduced 1.1.0} +function ERR_BIO_ADDR_family(const ap: PBIO_ADDR): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_ADDR_family_procname); +end; + + {introduced 1.1.0} +function ERR_BIO_ADDR_rawaddress(const ap: PBIO_ADDR; p: Pointer; l: PIdC_SIZET): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_ADDR_rawaddress_procname); +end; + + {introduced 1.1.0} +function ERR_BIO_ADDR_rawport(const ap: PBIO_ADDR): TIdC_SHORT; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_ADDR_rawport_procname); +end; + + {introduced 1.1.0} +function ERR_BIO_ADDR_hostname_string(const ap: PBIO_ADDR; numeric: TIdC_INT): PIdAnsiChar; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_ADDR_hostname_string_procname); +end; + + {introduced 1.1.0} +function ERR_BIO_ADDR_service_string(const ap: PBIO_ADDR; numeric: TIdC_INT): PIdAnsiChar; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_ADDR_service_string_procname); +end; + + {introduced 1.1.0} +function ERR_BIO_ADDR_path_string(const ap: PBIO_ADDR): PIdAnsiChar; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_ADDR_path_string_procname); +end; + + {introduced 1.1.0} + +function ERR_BIO_ADDRINFO_next(const bai: PBIO_ADDRINFO): PBIO_ADDRINFO; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_ADDRINFO_next_procname); +end; + + {introduced 1.1.0} +function ERR_BIO_ADDRINFO_family(const bai: PBIO_ADDRINFO): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_ADDRINFO_family_procname); +end; + + {introduced 1.1.0} +function ERR_BIO_ADDRINFO_socktype(const bai: PBIO_ADDRINFO): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_ADDRINFO_socktype_procname); +end; + + {introduced 1.1.0} +function ERR_BIO_ADDRINFO_protocol(const bai: PBIO_ADDRINFO): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_ADDRINFO_protocol_procname); +end; + + {introduced 1.1.0} +function ERR_BIO_ADDRINFO_address(const bai: PBIO_ADDRINFO): PBIO_ADDR; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_ADDRINFO_address_procname); +end; + + {introduced 1.1.0} +procedure ERR_BIO_ADDRINFO_free(bai: PBIO_ADDRINFO); +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_ADDRINFO_free_procname); +end; + + {introduced 1.1.0} + +function ERR_BIO_parse_hostserv(const hostserv: PIdAnsiChar; host: PPIdAnsiChar; service: PPIdAnsiChar; hostserv_prio: BIO_hostserv_priorities): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_parse_hostserv_procname); +end; + + {introduced 1.1.0} + +function ERR_BIO_lookup(const host: PIdAnsiChar; const service: PIdAnsiChar; lookup_type: BIO_lookup_type; family: TIdC_INT; socktype: TIdC_INT; res: PPBIO_ADDRINFO): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_lookup_procname); +end; + + {introduced 1.1.0} +function ERR_BIO_lookup_ex(const host: PIdAnsiChar; const service: PIdAnsiChar; lookup_type: TIdC_INT; family: TIdC_INT; socktype: TIdC_INT; protocol: TIdC_INT; res: PPBIO_ADDRINFO): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_lookup_ex_procname); +end; + + {introduced 1.1.0} +function ERR_BIO_sock_error(sock: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_sock_error_procname); +end; + + +function ERR_BIO_socket_ioctl(fd: TIdC_INT; cType: TIdC_LONG; arg: Pointer): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_socket_ioctl_procname); +end; + + +function ERR_BIO_socket_nbio(fd: TIdC_INT; mode: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_socket_nbio_procname); +end; + + +function ERR_BIO_sock_init: TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_sock_init_procname); +end; + + + +function ERR_BIO_set_tcp_ndelay(sock: TIdC_INT; turn_on: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_set_tcp_ndelay_procname); +end; + + + +function ERR_BIO_sock_info(sock: TIdC_INT; type_: BIO_sock_info_type; info: PBIO_sock_info_u): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_sock_info_procname); +end; + + {introduced 1.1.0} + +function ERR_BIO_socket(domain: TIdC_INT; socktype: TIdC_INT; protocol: TIdC_INT; options: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_socket_procname); +end; + + {introduced 1.1.0} +function ERR_BIO_connect(sock: TIdC_INT; const addr: PBIO_ADDR; options: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_connect_procname); +end; + + {introduced 1.1.0} +function ERR_BIO_bind(sock: TIdC_INT; const addr: PBIO_ADDR; options: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_bind_procname); +end; + + {introduced 1.1.0} +function ERR_BIO_listen(sock: TIdC_INT; const addr: PBIO_ADDR; options: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_listen_procname); +end; + + {introduced 1.1.0} +function ERR_BIO_accept_ex(accept_sock: TIdC_INT; addr: PBIO_ADDR; options: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_accept_ex_procname); +end; + + {introduced 1.1.0} +function ERR_BIO_closesocket(sock: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_closesocket_procname); +end; + + {introduced 1.1.0} + +function ERR_BIO_new_socket(sock: TIdC_INT; close_flag: TIdC_INT): PBIO; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_new_socket_procname); +end; + + +function ERR_BIO_new_connect(const host_port: PIdAnsiChar): PBIO; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_new_connect_procname); +end; + + +function ERR_BIO_new_accept(const host_port: PIdAnsiChar): PBIO; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_new_accept_procname); +end; + + + +function ERR_BIO_new_fd(fd: TIdC_INT; close_flag: TIdC_INT): PBIO; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_new_fd_procname); +end; + + + +function ERR_BIO_new_bio_pair(bio1: PPBIO; writebuf1: TIdC_SIZET; bio2: PPBIO; writebuf2: TIdC_SIZET): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_new_bio_pair_procname); +end; + + + (* + * If successful, returns 1 and in *bio1, *bio2 two BIO pair endpoints. + * Otherwise returns 0 and sets *bio1 and *bio2 to NULL. Size 0 uses default + * value. + *) + +procedure ERR_BIO_copy_next_retry(b: PBIO); +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_copy_next_retry_procname); +end; + + + +// BIO_METHOD *BIO_meth_new(int type, const char *name); +// void BIO_meth_free(BIO_METHOD *biom); +// int (*BIO_meth_get_write(const BIO_METHOD *biom)) (BIO *, const char *, int); +// int (*BIO_meth_get_write_ex(const BIO_METHOD *biom)) (BIO *, const char *, TIdC_SIZET, +// TIdC_SIZET *); +// int BIO_meth_set_write(BIO_METHOD *biom, +// int (*write) (BIO *, const char *, int)); +// int BIO_meth_set_write_ex(BIO_METHOD *biom, +// int (*bwrite) (BIO *, const char *, TIdC_SIZET, TIdC_SIZET *)); +// int (*BIO_meth_get_read(const BIO_METHOD *biom)) (BIO *, char *, int); +// int (*BIO_meth_get_read_ex(const BIO_METHOD *biom)) (BIO *, char *, TIdC_SIZET, TIdC_SIZET *); +// int BIO_meth_set_read(BIO_METHOD *biom, +// int (*read) (BIO *, char *, int)); +// int BIO_meth_set_read_ex(BIO_METHOD *biom, +// int (*bread) (BIO *, char *, TIdC_SIZET, TIdC_SIZET *)); +// int (*BIO_meth_get_puts(const BIO_METHOD *biom)) (BIO *, const char *); +// int BIO_meth_set_puts(BIO_METHOD *biom, +// int (*puts) (BIO *, const char *)); +// int (*BIO_meth_get_gets(const BIO_METHOD *biom)) (BIO *, char *, int); +// int BIO_meth_set_gets(BIO_METHOD *biom, +// int (*gets) (BIO *, char *, int)); +// long (*BIO_meth_get_ctrl(const BIO_METHOD *biom)) (BIO *, int, long, void *); +// int BIO_meth_set_ctrl(BIO_METHOD *biom, +// long (*ctrl) (BIO *, int, long, void *)); +// int (*BIO_meth_get_create(const BIO_METHOD *bion)) (BIO *); +// int BIO_meth_set_create(BIO_METHOD *biom, int (*create) (BIO *)); +// int (*BIO_meth_get_destroy(const BIO_METHOD *biom)) (BIO *); +// int BIO_meth_set_destroy(BIO_METHOD *biom, int (*destroy) (BIO *)); +// long (*BIO_meth_get_callback_ctrl(const BIO_METHOD *biom)) +// (BIO *, int, BIO_info_cb *); +// int BIO_meth_set_callback_ctrl(BIO_METHOD *biom, +// long (*callback_ctrl) (BIO *, int, +// BIO_info_cb *)); + +{$WARN NO_RETVAL ON} + +procedure Load(const ADllHandle: TIdLibHandle; LibVersion: TIdC_UINT; const AFailed: TStringList); + +var FuncLoadError: boolean; + +begin + BIO_get_flags := LoadLibFunction(ADllHandle, BIO_get_flags_procname); + FuncLoadError := not assigned(BIO_get_flags); + if FuncLoadError then + begin + {$if not defined(BIO_get_flags_allownil)} + BIO_get_flags := @ERR_BIO_get_flags; + {$ifend} + {$if declared(BIO_get_flags_introduced)} + if LibVersion < BIO_get_flags_introduced then + begin + {$if declared(FC_BIO_get_flags)} + BIO_get_flags := @FC_BIO_get_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_get_flags_removed)} + if BIO_get_flags_removed <= LibVersion then + begin + {$if declared(_BIO_get_flags)} + BIO_get_flags := @_BIO_get_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_get_flags_allownil)} + if FuncLoadError then + AFailed.Add('BIO_get_flags'); + {$ifend} + end; + + + BIO_set_retry_special := LoadLibFunction(ADllHandle, BIO_set_retry_special_procname); + FuncLoadError := not assigned(BIO_set_retry_special); + if FuncLoadError then + begin + {$if not defined(BIO_set_retry_special_allownil)} + BIO_set_retry_special := @ERR_BIO_set_retry_special; + {$ifend} + {$if declared(BIO_set_retry_special_introduced)} + if LibVersion < BIO_set_retry_special_introduced then + begin + {$if declared(FC_BIO_set_retry_special)} + BIO_set_retry_special := @FC_BIO_set_retry_special; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_set_retry_special_removed)} + if BIO_set_retry_special_removed <= LibVersion then + begin + {$if declared(_BIO_set_retry_special)} + BIO_set_retry_special := @_BIO_set_retry_special; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_set_retry_special_allownil)} + if FuncLoadError then + AFailed.Add('BIO_set_retry_special'); + {$ifend} + end; + + + BIO_set_retry_read := LoadLibFunction(ADllHandle, BIO_set_retry_read_procname); + FuncLoadError := not assigned(BIO_set_retry_read); + if FuncLoadError then + begin + {$if not defined(BIO_set_retry_read_allownil)} + BIO_set_retry_read := @ERR_BIO_set_retry_read; + {$ifend} + {$if declared(BIO_set_retry_read_introduced)} + if LibVersion < BIO_set_retry_read_introduced then + begin + {$if declared(FC_BIO_set_retry_read)} + BIO_set_retry_read := @FC_BIO_set_retry_read; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_set_retry_read_removed)} + if BIO_set_retry_read_removed <= LibVersion then + begin + {$if declared(_BIO_set_retry_read)} + BIO_set_retry_read := @_BIO_set_retry_read; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_set_retry_read_allownil)} + if FuncLoadError then + AFailed.Add('BIO_set_retry_read'); + {$ifend} + end; + + + BIO_set_retry_write := LoadLibFunction(ADllHandle, BIO_set_retry_write_procname); + FuncLoadError := not assigned(BIO_set_retry_write); + if FuncLoadError then + begin + {$if not defined(BIO_set_retry_write_allownil)} + BIO_set_retry_write := @ERR_BIO_set_retry_write; + {$ifend} + {$if declared(BIO_set_retry_write_introduced)} + if LibVersion < BIO_set_retry_write_introduced then + begin + {$if declared(FC_BIO_set_retry_write)} + BIO_set_retry_write := @FC_BIO_set_retry_write; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_set_retry_write_removed)} + if BIO_set_retry_write_removed <= LibVersion then + begin + {$if declared(_BIO_set_retry_write)} + BIO_set_retry_write := @_BIO_set_retry_write; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_set_retry_write_allownil)} + if FuncLoadError then + AFailed.Add('BIO_set_retry_write'); + {$ifend} + end; + + + BIO_clear_retry_flags := LoadLibFunction(ADllHandle, BIO_clear_retry_flags_procname); + FuncLoadError := not assigned(BIO_clear_retry_flags); + if FuncLoadError then + begin + {$if not defined(BIO_clear_retry_flags_allownil)} + BIO_clear_retry_flags := @ERR_BIO_clear_retry_flags; + {$ifend} + {$if declared(BIO_clear_retry_flags_introduced)} + if LibVersion < BIO_clear_retry_flags_introduced then + begin + {$if declared(FC_BIO_clear_retry_flags)} + BIO_clear_retry_flags := @FC_BIO_clear_retry_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_clear_retry_flags_removed)} + if BIO_clear_retry_flags_removed <= LibVersion then + begin + {$if declared(_BIO_clear_retry_flags)} + BIO_clear_retry_flags := @_BIO_clear_retry_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_clear_retry_flags_allownil)} + if FuncLoadError then + AFailed.Add('BIO_clear_retry_flags'); + {$ifend} + end; + + + BIO_get_retry_flags := LoadLibFunction(ADllHandle, BIO_get_retry_flags_procname); + FuncLoadError := not assigned(BIO_get_retry_flags); + if FuncLoadError then + begin + {$if not defined(BIO_get_retry_flags_allownil)} + BIO_get_retry_flags := @ERR_BIO_get_retry_flags; + {$ifend} + {$if declared(BIO_get_retry_flags_introduced)} + if LibVersion < BIO_get_retry_flags_introduced then + begin + {$if declared(FC_BIO_get_retry_flags)} + BIO_get_retry_flags := @FC_BIO_get_retry_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_get_retry_flags_removed)} + if BIO_get_retry_flags_removed <= LibVersion then + begin + {$if declared(_BIO_get_retry_flags)} + BIO_get_retry_flags := @_BIO_get_retry_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_get_retry_flags_allownil)} + if FuncLoadError then + AFailed.Add('BIO_get_retry_flags'); + {$ifend} + end; + + + BIO_should_read := LoadLibFunction(ADllHandle, BIO_should_read_procname); + FuncLoadError := not assigned(BIO_should_read); + if FuncLoadError then + begin + {$if not defined(BIO_should_read_allownil)} + BIO_should_read := @ERR_BIO_should_read; + {$ifend} + {$if declared(BIO_should_read_introduced)} + if LibVersion < BIO_should_read_introduced then + begin + {$if declared(FC_BIO_should_read)} + BIO_should_read := @FC_BIO_should_read; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_should_read_removed)} + if BIO_should_read_removed <= LibVersion then + begin + {$if declared(_BIO_should_read)} + BIO_should_read := @_BIO_should_read; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_should_read_allownil)} + if FuncLoadError then + AFailed.Add('BIO_should_read'); + {$ifend} + end; + + + BIO_should_write := LoadLibFunction(ADllHandle, BIO_should_write_procname); + FuncLoadError := not assigned(BIO_should_write); + if FuncLoadError then + begin + {$if not defined(BIO_should_write_allownil)} + BIO_should_write := @ERR_BIO_should_write; + {$ifend} + {$if declared(BIO_should_write_introduced)} + if LibVersion < BIO_should_write_introduced then + begin + {$if declared(FC_BIO_should_write)} + BIO_should_write := @FC_BIO_should_write; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_should_write_removed)} + if BIO_should_write_removed <= LibVersion then + begin + {$if declared(_BIO_should_write)} + BIO_should_write := @_BIO_should_write; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_should_write_allownil)} + if FuncLoadError then + AFailed.Add('BIO_should_write'); + {$ifend} + end; + + + BIO_should_io_special := LoadLibFunction(ADllHandle, BIO_should_io_special_procname); + FuncLoadError := not assigned(BIO_should_io_special); + if FuncLoadError then + begin + {$if not defined(BIO_should_io_special_allownil)} + BIO_should_io_special := @ERR_BIO_should_io_special; + {$ifend} + {$if declared(BIO_should_io_special_introduced)} + if LibVersion < BIO_should_io_special_introduced then + begin + {$if declared(FC_BIO_should_io_special)} + BIO_should_io_special := @FC_BIO_should_io_special; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_should_io_special_removed)} + if BIO_should_io_special_removed <= LibVersion then + begin + {$if declared(_BIO_should_io_special)} + BIO_should_io_special := @_BIO_should_io_special; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_should_io_special_allownil)} + if FuncLoadError then + AFailed.Add('BIO_should_io_special'); + {$ifend} + end; + + + BIO_retry_type := LoadLibFunction(ADllHandle, BIO_retry_type_procname); + FuncLoadError := not assigned(BIO_retry_type); + if FuncLoadError then + begin + {$if not defined(BIO_retry_type_allownil)} + BIO_retry_type := @ERR_BIO_retry_type; + {$ifend} + {$if declared(BIO_retry_type_introduced)} + if LibVersion < BIO_retry_type_introduced then + begin + {$if declared(FC_BIO_retry_type)} + BIO_retry_type := @FC_BIO_retry_type; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_retry_type_removed)} + if BIO_retry_type_removed <= LibVersion then + begin + {$if declared(_BIO_retry_type)} + BIO_retry_type := @_BIO_retry_type; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_retry_type_allownil)} + if FuncLoadError then + AFailed.Add('BIO_retry_type'); + {$ifend} + end; + + + BIO_should_retry := LoadLibFunction(ADllHandle, BIO_should_retry_procname); + FuncLoadError := not assigned(BIO_should_retry); + if FuncLoadError then + begin + {$if not defined(BIO_should_retry_allownil)} + BIO_should_retry := @ERR_BIO_should_retry; + {$ifend} + {$if declared(BIO_should_retry_introduced)} + if LibVersion < BIO_should_retry_introduced then + begin + {$if declared(FC_BIO_should_retry)} + BIO_should_retry := @FC_BIO_should_retry; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_should_retry_removed)} + if BIO_should_retry_removed <= LibVersion then + begin + {$if declared(_BIO_should_retry)} + BIO_should_retry := @_BIO_should_retry; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_should_retry_allownil)} + if FuncLoadError then + AFailed.Add('BIO_should_retry'); + {$ifend} + end; + + + BIO_do_connect := LoadLibFunction(ADllHandle, BIO_do_connect_procname); + FuncLoadError := not assigned(BIO_do_connect); + if FuncLoadError then + begin + {$if not defined(BIO_do_connect_allownil)} + BIO_do_connect := @ERR_BIO_do_connect; + {$ifend} + {$if declared(BIO_do_connect_introduced)} + if LibVersion < BIO_do_connect_introduced then + begin + {$if declared(FC_BIO_do_connect)} + BIO_do_connect := @FC_BIO_do_connect; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_do_connect_removed)} + if BIO_do_connect_removed <= LibVersion then + begin + {$if declared(_BIO_do_connect)} + BIO_do_connect := @_BIO_do_connect; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_do_connect_allownil)} + if FuncLoadError then + AFailed.Add('BIO_do_connect'); + {$ifend} + end; + + + BIO_do_accept := LoadLibFunction(ADllHandle, BIO_do_accept_procname); + FuncLoadError := not assigned(BIO_do_accept); + if FuncLoadError then + begin + {$if not defined(BIO_do_accept_allownil)} + BIO_do_accept := @ERR_BIO_do_accept; + {$ifend} + {$if declared(BIO_do_accept_introduced)} + if LibVersion < BIO_do_accept_introduced then + begin + {$if declared(FC_BIO_do_accept)} + BIO_do_accept := @FC_BIO_do_accept; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_do_accept_removed)} + if BIO_do_accept_removed <= LibVersion then + begin + {$if declared(_BIO_do_accept)} + BIO_do_accept := @_BIO_do_accept; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_do_accept_allownil)} + if FuncLoadError then + AFailed.Add('BIO_do_accept'); + {$ifend} + end; + + + BIO_do_handshake := LoadLibFunction(ADllHandle, BIO_do_handshake_procname); + FuncLoadError := not assigned(BIO_do_handshake); + if FuncLoadError then + begin + {$if not defined(BIO_do_handshake_allownil)} + BIO_do_handshake := @ERR_BIO_do_handshake; + {$ifend} + {$if declared(BIO_do_handshake_introduced)} + if LibVersion < BIO_do_handshake_introduced then + begin + {$if declared(FC_BIO_do_handshake)} + BIO_do_handshake := @FC_BIO_do_handshake; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_do_handshake_removed)} + if BIO_do_handshake_removed <= LibVersion then + begin + {$if declared(_BIO_do_handshake)} + BIO_do_handshake := @_BIO_do_handshake; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_do_handshake_allownil)} + if FuncLoadError then + AFailed.Add('BIO_do_handshake'); + {$ifend} + end; + + + BIO_get_mem_data := LoadLibFunction(ADllHandle, BIO_get_mem_data_procname); + FuncLoadError := not assigned(BIO_get_mem_data); + if FuncLoadError then + begin + {$if not defined(BIO_get_mem_data_allownil)} + BIO_get_mem_data := @ERR_BIO_get_mem_data; + {$ifend} + {$if declared(BIO_get_mem_data_introduced)} + if LibVersion < BIO_get_mem_data_introduced then + begin + {$if declared(FC_BIO_get_mem_data)} + BIO_get_mem_data := @FC_BIO_get_mem_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_get_mem_data_removed)} + if BIO_get_mem_data_removed <= LibVersion then + begin + {$if declared(_BIO_get_mem_data)} + BIO_get_mem_data := @_BIO_get_mem_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_get_mem_data_allownil)} + if FuncLoadError then + AFailed.Add('BIO_get_mem_data'); + {$ifend} + end; + + + BIO_set_mem_buf := LoadLibFunction(ADllHandle, BIO_set_mem_buf_procname); + FuncLoadError := not assigned(BIO_set_mem_buf); + if FuncLoadError then + begin + {$if not defined(BIO_set_mem_buf_allownil)} + BIO_set_mem_buf := @ERR_BIO_set_mem_buf; + {$ifend} + {$if declared(BIO_set_mem_buf_introduced)} + if LibVersion < BIO_set_mem_buf_introduced then + begin + {$if declared(FC_BIO_set_mem_buf)} + BIO_set_mem_buf := @FC_BIO_set_mem_buf; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_set_mem_buf_removed)} + if BIO_set_mem_buf_removed <= LibVersion then + begin + {$if declared(_BIO_set_mem_buf)} + BIO_set_mem_buf := @_BIO_set_mem_buf; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_set_mem_buf_allownil)} + if FuncLoadError then + AFailed.Add('BIO_set_mem_buf'); + {$ifend} + end; + + + BIO_get_mem_ptr := LoadLibFunction(ADllHandle, BIO_get_mem_ptr_procname); + FuncLoadError := not assigned(BIO_get_mem_ptr); + if FuncLoadError then + begin + {$if not defined(BIO_get_mem_ptr_allownil)} + BIO_get_mem_ptr := @ERR_BIO_get_mem_ptr; + {$ifend} + {$if declared(BIO_get_mem_ptr_introduced)} + if LibVersion < BIO_get_mem_ptr_introduced then + begin + {$if declared(FC_BIO_get_mem_ptr)} + BIO_get_mem_ptr := @FC_BIO_get_mem_ptr; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_get_mem_ptr_removed)} + if BIO_get_mem_ptr_removed <= LibVersion then + begin + {$if declared(_BIO_get_mem_ptr)} + BIO_get_mem_ptr := @_BIO_get_mem_ptr; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_get_mem_ptr_allownil)} + if FuncLoadError then + AFailed.Add('BIO_get_mem_ptr'); + {$ifend} + end; + + + BIO_set_mem_eof_return := LoadLibFunction(ADllHandle, BIO_set_mem_eof_return_procname); + FuncLoadError := not assigned(BIO_set_mem_eof_return); + if FuncLoadError then + begin + {$if not defined(BIO_set_mem_eof_return_allownil)} + BIO_set_mem_eof_return := @ERR_BIO_set_mem_eof_return; + {$ifend} + {$if declared(BIO_set_mem_eof_return_introduced)} + if LibVersion < BIO_set_mem_eof_return_introduced then + begin + {$if declared(FC_BIO_set_mem_eof_return)} + BIO_set_mem_eof_return := @FC_BIO_set_mem_eof_return; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_set_mem_eof_return_removed)} + if BIO_set_mem_eof_return_removed <= LibVersion then + begin + {$if declared(_BIO_set_mem_eof_return)} + BIO_set_mem_eof_return := @_BIO_set_mem_eof_return; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_set_mem_eof_return_allownil)} + if FuncLoadError then + AFailed.Add('BIO_set_mem_eof_return'); + {$ifend} + end; + + + BIO_get_new_index := LoadLibFunction(ADllHandle, BIO_get_new_index_procname); + FuncLoadError := not assigned(BIO_get_new_index); + if FuncLoadError then + begin + {$if not defined(BIO_get_new_index_allownil)} + BIO_get_new_index := @ERR_BIO_get_new_index; + {$ifend} + {$if declared(BIO_get_new_index_introduced)} + if LibVersion < BIO_get_new_index_introduced then + begin + {$if declared(FC_BIO_get_new_index)} + BIO_get_new_index := @FC_BIO_get_new_index; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_get_new_index_removed)} + if BIO_get_new_index_removed <= LibVersion then + begin + {$if declared(_BIO_get_new_index)} + BIO_get_new_index := @_BIO_get_new_index; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_get_new_index_allownil)} + if FuncLoadError then + AFailed.Add('BIO_get_new_index'); + {$ifend} + end; + + {introduced 1.1.0} + BIO_set_flags := LoadLibFunction(ADllHandle, BIO_set_flags_procname); + FuncLoadError := not assigned(BIO_set_flags); + if FuncLoadError then + begin + {$if not defined(BIO_set_flags_allownil)} + BIO_set_flags := @ERR_BIO_set_flags; + {$ifend} + {$if declared(BIO_set_flags_introduced)} + if LibVersion < BIO_set_flags_introduced then + begin + {$if declared(FC_BIO_set_flags)} + BIO_set_flags := @FC_BIO_set_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_set_flags_removed)} + if BIO_set_flags_removed <= LibVersion then + begin + {$if declared(_BIO_set_flags)} + BIO_set_flags := @_BIO_set_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_set_flags_allownil)} + if FuncLoadError then + AFailed.Add('BIO_set_flags'); + {$ifend} + end; + + + BIO_test_flags := LoadLibFunction(ADllHandle, BIO_test_flags_procname); + FuncLoadError := not assigned(BIO_test_flags); + if FuncLoadError then + begin + {$if not defined(BIO_test_flags_allownil)} + BIO_test_flags := @ERR_BIO_test_flags; + {$ifend} + {$if declared(BIO_test_flags_introduced)} + if LibVersion < BIO_test_flags_introduced then + begin + {$if declared(FC_BIO_test_flags)} + BIO_test_flags := @FC_BIO_test_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_test_flags_removed)} + if BIO_test_flags_removed <= LibVersion then + begin + {$if declared(_BIO_test_flags)} + BIO_test_flags := @_BIO_test_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_test_flags_allownil)} + if FuncLoadError then + AFailed.Add('BIO_test_flags'); + {$ifend} + end; + + + BIO_clear_flags := LoadLibFunction(ADllHandle, BIO_clear_flags_procname); + FuncLoadError := not assigned(BIO_clear_flags); + if FuncLoadError then + begin + {$if not defined(BIO_clear_flags_allownil)} + BIO_clear_flags := @ERR_BIO_clear_flags; + {$ifend} + {$if declared(BIO_clear_flags_introduced)} + if LibVersion < BIO_clear_flags_introduced then + begin + {$if declared(FC_BIO_clear_flags)} + BIO_clear_flags := @FC_BIO_clear_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_clear_flags_removed)} + if BIO_clear_flags_removed <= LibVersion then + begin + {$if declared(_BIO_clear_flags)} + BIO_clear_flags := @_BIO_clear_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_clear_flags_allownil)} + if FuncLoadError then + AFailed.Add('BIO_clear_flags'); + {$ifend} + end; + + + BIO_get_callback := LoadLibFunction(ADllHandle, BIO_get_callback_procname); + FuncLoadError := not assigned(BIO_get_callback); + if FuncLoadError then + begin + {$if not defined(BIO_get_callback_allownil)} + BIO_get_callback := @ERR_BIO_get_callback; + {$ifend} + {$if declared(BIO_get_callback_introduced)} + if LibVersion < BIO_get_callback_introduced then + begin + {$if declared(FC_BIO_get_callback)} + BIO_get_callback := @FC_BIO_get_callback; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_get_callback_removed)} + if BIO_get_callback_removed <= LibVersion then + begin + {$if declared(_BIO_get_callback)} + BIO_get_callback := @_BIO_get_callback; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_get_callback_allownil)} + if FuncLoadError then + AFailed.Add('BIO_get_callback'); + {$ifend} + end; + + + BIO_set_callback := LoadLibFunction(ADllHandle, BIO_set_callback_procname); + FuncLoadError := not assigned(BIO_set_callback); + if FuncLoadError then + begin + {$if not defined(BIO_set_callback_allownil)} + BIO_set_callback := @ERR_BIO_set_callback; + {$ifend} + {$if declared(BIO_set_callback_introduced)} + if LibVersion < BIO_set_callback_introduced then + begin + {$if declared(FC_BIO_set_callback)} + BIO_set_callback := @FC_BIO_set_callback; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_set_callback_removed)} + if BIO_set_callback_removed <= LibVersion then + begin + {$if declared(_BIO_set_callback)} + BIO_set_callback := @_BIO_set_callback; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_set_callback_allownil)} + if FuncLoadError then + AFailed.Add('BIO_set_callback'); + {$ifend} + end; + + + BIO_get_callback_ex := LoadLibFunction(ADllHandle, BIO_get_callback_ex_procname); + FuncLoadError := not assigned(BIO_get_callback_ex); + if FuncLoadError then + begin + {$if not defined(BIO_get_callback_ex_allownil)} + BIO_get_callback_ex := @ERR_BIO_get_callback_ex; + {$ifend} + {$if declared(BIO_get_callback_ex_introduced)} + if LibVersion < BIO_get_callback_ex_introduced then + begin + {$if declared(FC_BIO_get_callback_ex)} + BIO_get_callback_ex := @FC_BIO_get_callback_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_get_callback_ex_removed)} + if BIO_get_callback_ex_removed <= LibVersion then + begin + {$if declared(_BIO_get_callback_ex)} + BIO_get_callback_ex := @_BIO_get_callback_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_get_callback_ex_allownil)} + if FuncLoadError then + AFailed.Add('BIO_get_callback_ex'); + {$ifend} + end; + + {introduced 1.1.0} + BIO_set_callback_ex := LoadLibFunction(ADllHandle, BIO_set_callback_ex_procname); + FuncLoadError := not assigned(BIO_set_callback_ex); + if FuncLoadError then + begin + {$if not defined(BIO_set_callback_ex_allownil)} + BIO_set_callback_ex := @ERR_BIO_set_callback_ex; + {$ifend} + {$if declared(BIO_set_callback_ex_introduced)} + if LibVersion < BIO_set_callback_ex_introduced then + begin + {$if declared(FC_BIO_set_callback_ex)} + BIO_set_callback_ex := @FC_BIO_set_callback_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_set_callback_ex_removed)} + if BIO_set_callback_ex_removed <= LibVersion then + begin + {$if declared(_BIO_set_callback_ex)} + BIO_set_callback_ex := @_BIO_set_callback_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_set_callback_ex_allownil)} + if FuncLoadError then + AFailed.Add('BIO_set_callback_ex'); + {$ifend} + end; + + {introduced 1.1.0} + BIO_get_callback_arg := LoadLibFunction(ADllHandle, BIO_get_callback_arg_procname); + FuncLoadError := not assigned(BIO_get_callback_arg); + if FuncLoadError then + begin + {$if not defined(BIO_get_callback_arg_allownil)} + BIO_get_callback_arg := @ERR_BIO_get_callback_arg; + {$ifend} + {$if declared(BIO_get_callback_arg_introduced)} + if LibVersion < BIO_get_callback_arg_introduced then + begin + {$if declared(FC_BIO_get_callback_arg)} + BIO_get_callback_arg := @FC_BIO_get_callback_arg; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_get_callback_arg_removed)} + if BIO_get_callback_arg_removed <= LibVersion then + begin + {$if declared(_BIO_get_callback_arg)} + BIO_get_callback_arg := @_BIO_get_callback_arg; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_get_callback_arg_allownil)} + if FuncLoadError then + AFailed.Add('BIO_get_callback_arg'); + {$ifend} + end; + + + BIO_set_callback_arg := LoadLibFunction(ADllHandle, BIO_set_callback_arg_procname); + FuncLoadError := not assigned(BIO_set_callback_arg); + if FuncLoadError then + begin + {$if not defined(BIO_set_callback_arg_allownil)} + BIO_set_callback_arg := @ERR_BIO_set_callback_arg; + {$ifend} + {$if declared(BIO_set_callback_arg_introduced)} + if LibVersion < BIO_set_callback_arg_introduced then + begin + {$if declared(FC_BIO_set_callback_arg)} + BIO_set_callback_arg := @FC_BIO_set_callback_arg; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_set_callback_arg_removed)} + if BIO_set_callback_arg_removed <= LibVersion then + begin + {$if declared(_BIO_set_callback_arg)} + BIO_set_callback_arg := @_BIO_set_callback_arg; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_set_callback_arg_allownil)} + if FuncLoadError then + AFailed.Add('BIO_set_callback_arg'); + {$ifend} + end; + + + BIO_method_name := LoadLibFunction(ADllHandle, BIO_method_name_procname); + FuncLoadError := not assigned(BIO_method_name); + if FuncLoadError then + begin + {$if not defined(BIO_method_name_allownil)} + BIO_method_name := @ERR_BIO_method_name; + {$ifend} + {$if declared(BIO_method_name_introduced)} + if LibVersion < BIO_method_name_introduced then + begin + {$if declared(FC_BIO_method_name)} + BIO_method_name := @FC_BIO_method_name; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_method_name_removed)} + if BIO_method_name_removed <= LibVersion then + begin + {$if declared(_BIO_method_name)} + BIO_method_name := @_BIO_method_name; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_method_name_allownil)} + if FuncLoadError then + AFailed.Add('BIO_method_name'); + {$ifend} + end; + + + BIO_method_type := LoadLibFunction(ADllHandle, BIO_method_type_procname); + FuncLoadError := not assigned(BIO_method_type); + if FuncLoadError then + begin + {$if not defined(BIO_method_type_allownil)} + BIO_method_type := @ERR_BIO_method_type; + {$ifend} + {$if declared(BIO_method_type_introduced)} + if LibVersion < BIO_method_type_introduced then + begin + {$if declared(FC_BIO_method_type)} + BIO_method_type := @FC_BIO_method_type; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_method_type_removed)} + if BIO_method_type_removed <= LibVersion then + begin + {$if declared(_BIO_method_type)} + BIO_method_type := @_BIO_method_type; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_method_type_allownil)} + if FuncLoadError then + AFailed.Add('BIO_method_type'); + {$ifend} + end; + + + BIO_ctrl_pending := LoadLibFunction(ADllHandle, BIO_ctrl_pending_procname); + FuncLoadError := not assigned(BIO_ctrl_pending); + if FuncLoadError then + begin + {$if not defined(BIO_ctrl_pending_allownil)} + BIO_ctrl_pending := @ERR_BIO_ctrl_pending; + {$ifend} + {$if declared(BIO_ctrl_pending_introduced)} + if LibVersion < BIO_ctrl_pending_introduced then + begin + {$if declared(FC_BIO_ctrl_pending)} + BIO_ctrl_pending := @FC_BIO_ctrl_pending; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_ctrl_pending_removed)} + if BIO_ctrl_pending_removed <= LibVersion then + begin + {$if declared(_BIO_ctrl_pending)} + BIO_ctrl_pending := @_BIO_ctrl_pending; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_ctrl_pending_allownil)} + if FuncLoadError then + AFailed.Add('BIO_ctrl_pending'); + {$ifend} + end; + + + BIO_ctrl_wpending := LoadLibFunction(ADllHandle, BIO_ctrl_wpending_procname); + FuncLoadError := not assigned(BIO_ctrl_wpending); + if FuncLoadError then + begin + {$if not defined(BIO_ctrl_wpending_allownil)} + BIO_ctrl_wpending := @ERR_BIO_ctrl_wpending; + {$ifend} + {$if declared(BIO_ctrl_wpending_introduced)} + if LibVersion < BIO_ctrl_wpending_introduced then + begin + {$if declared(FC_BIO_ctrl_wpending)} + BIO_ctrl_wpending := @FC_BIO_ctrl_wpending; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_ctrl_wpending_removed)} + if BIO_ctrl_wpending_removed <= LibVersion then + begin + {$if declared(_BIO_ctrl_wpending)} + BIO_ctrl_wpending := @_BIO_ctrl_wpending; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_ctrl_wpending_allownil)} + if FuncLoadError then + AFailed.Add('BIO_ctrl_wpending'); + {$ifend} + end; + + + BIO_ctrl_get_write_guarantee := LoadLibFunction(ADllHandle, BIO_ctrl_get_write_guarantee_procname); + FuncLoadError := not assigned(BIO_ctrl_get_write_guarantee); + if FuncLoadError then + begin + {$if not defined(BIO_ctrl_get_write_guarantee_allownil)} + BIO_ctrl_get_write_guarantee := @ERR_BIO_ctrl_get_write_guarantee; + {$ifend} + {$if declared(BIO_ctrl_get_write_guarantee_introduced)} + if LibVersion < BIO_ctrl_get_write_guarantee_introduced then + begin + {$if declared(FC_BIO_ctrl_get_write_guarantee)} + BIO_ctrl_get_write_guarantee := @FC_BIO_ctrl_get_write_guarantee; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_ctrl_get_write_guarantee_removed)} + if BIO_ctrl_get_write_guarantee_removed <= LibVersion then + begin + {$if declared(_BIO_ctrl_get_write_guarantee)} + BIO_ctrl_get_write_guarantee := @_BIO_ctrl_get_write_guarantee; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_ctrl_get_write_guarantee_allownil)} + if FuncLoadError then + AFailed.Add('BIO_ctrl_get_write_guarantee'); + {$ifend} + end; + + + BIO_ctrl_get_read_request := LoadLibFunction(ADllHandle, BIO_ctrl_get_read_request_procname); + FuncLoadError := not assigned(BIO_ctrl_get_read_request); + if FuncLoadError then + begin + {$if not defined(BIO_ctrl_get_read_request_allownil)} + BIO_ctrl_get_read_request := @ERR_BIO_ctrl_get_read_request; + {$ifend} + {$if declared(BIO_ctrl_get_read_request_introduced)} + if LibVersion < BIO_ctrl_get_read_request_introduced then + begin + {$if declared(FC_BIO_ctrl_get_read_request)} + BIO_ctrl_get_read_request := @FC_BIO_ctrl_get_read_request; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_ctrl_get_read_request_removed)} + if BIO_ctrl_get_read_request_removed <= LibVersion then + begin + {$if declared(_BIO_ctrl_get_read_request)} + BIO_ctrl_get_read_request := @_BIO_ctrl_get_read_request; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_ctrl_get_read_request_allownil)} + if FuncLoadError then + AFailed.Add('BIO_ctrl_get_read_request'); + {$ifend} + end; + + + BIO_ctrl_reset_read_request := LoadLibFunction(ADllHandle, BIO_ctrl_reset_read_request_procname); + FuncLoadError := not assigned(BIO_ctrl_reset_read_request); + if FuncLoadError then + begin + {$if not defined(BIO_ctrl_reset_read_request_allownil)} + BIO_ctrl_reset_read_request := @ERR_BIO_ctrl_reset_read_request; + {$ifend} + {$if declared(BIO_ctrl_reset_read_request_introduced)} + if LibVersion < BIO_ctrl_reset_read_request_introduced then + begin + {$if declared(FC_BIO_ctrl_reset_read_request)} + BIO_ctrl_reset_read_request := @FC_BIO_ctrl_reset_read_request; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_ctrl_reset_read_request_removed)} + if BIO_ctrl_reset_read_request_removed <= LibVersion then + begin + {$if declared(_BIO_ctrl_reset_read_request)} + BIO_ctrl_reset_read_request := @_BIO_ctrl_reset_read_request; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_ctrl_reset_read_request_allownil)} + if FuncLoadError then + AFailed.Add('BIO_ctrl_reset_read_request'); + {$ifend} + end; + + + BIO_set_ex_data := LoadLibFunction(ADllHandle, BIO_set_ex_data_procname); + FuncLoadError := not assigned(BIO_set_ex_data); + if FuncLoadError then + begin + {$if not defined(BIO_set_ex_data_allownil)} + BIO_set_ex_data := @ERR_BIO_set_ex_data; + {$ifend} + {$if declared(BIO_set_ex_data_introduced)} + if LibVersion < BIO_set_ex_data_introduced then + begin + {$if declared(FC_BIO_set_ex_data)} + BIO_set_ex_data := @FC_BIO_set_ex_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_set_ex_data_removed)} + if BIO_set_ex_data_removed <= LibVersion then + begin + {$if declared(_BIO_set_ex_data)} + BIO_set_ex_data := @_BIO_set_ex_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_set_ex_data_allownil)} + if FuncLoadError then + AFailed.Add('BIO_set_ex_data'); + {$ifend} + end; + + + BIO_get_ex_data := LoadLibFunction(ADllHandle, BIO_get_ex_data_procname); + FuncLoadError := not assigned(BIO_get_ex_data); + if FuncLoadError then + begin + {$if not defined(BIO_get_ex_data_allownil)} + BIO_get_ex_data := @ERR_BIO_get_ex_data; + {$ifend} + {$if declared(BIO_get_ex_data_introduced)} + if LibVersion < BIO_get_ex_data_introduced then + begin + {$if declared(FC_BIO_get_ex_data)} + BIO_get_ex_data := @FC_BIO_get_ex_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_get_ex_data_removed)} + if BIO_get_ex_data_removed <= LibVersion then + begin + {$if declared(_BIO_get_ex_data)} + BIO_get_ex_data := @_BIO_get_ex_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_get_ex_data_allownil)} + if FuncLoadError then + AFailed.Add('BIO_get_ex_data'); + {$ifend} + end; + + + BIO_number_read := LoadLibFunction(ADllHandle, BIO_number_read_procname); + FuncLoadError := not assigned(BIO_number_read); + if FuncLoadError then + begin + {$if not defined(BIO_number_read_allownil)} + BIO_number_read := @ERR_BIO_number_read; + {$ifend} + {$if declared(BIO_number_read_introduced)} + if LibVersion < BIO_number_read_introduced then + begin + {$if declared(FC_BIO_number_read)} + BIO_number_read := @FC_BIO_number_read; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_number_read_removed)} + if BIO_number_read_removed <= LibVersion then + begin + {$if declared(_BIO_number_read)} + BIO_number_read := @_BIO_number_read; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_number_read_allownil)} + if FuncLoadError then + AFailed.Add('BIO_number_read'); + {$ifend} + end; + + + BIO_number_written := LoadLibFunction(ADllHandle, BIO_number_written_procname); + FuncLoadError := not assigned(BIO_number_written); + if FuncLoadError then + begin + {$if not defined(BIO_number_written_allownil)} + BIO_number_written := @ERR_BIO_number_written; + {$ifend} + {$if declared(BIO_number_written_introduced)} + if LibVersion < BIO_number_written_introduced then + begin + {$if declared(FC_BIO_number_written)} + BIO_number_written := @FC_BIO_number_written; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_number_written_removed)} + if BIO_number_written_removed <= LibVersion then + begin + {$if declared(_BIO_number_written)} + BIO_number_written := @_BIO_number_written; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_number_written_allownil)} + if FuncLoadError then + AFailed.Add('BIO_number_written'); + {$ifend} + end; + + + BIO_s_file := LoadLibFunction(ADllHandle, BIO_s_file_procname); + FuncLoadError := not assigned(BIO_s_file); + if FuncLoadError then + begin + {$if not defined(BIO_s_file_allownil)} + BIO_s_file := @ERR_BIO_s_file; + {$ifend} + {$if declared(BIO_s_file_introduced)} + if LibVersion < BIO_s_file_introduced then + begin + {$if declared(FC_BIO_s_file)} + BIO_s_file := @FC_BIO_s_file; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_s_file_removed)} + if BIO_s_file_removed <= LibVersion then + begin + {$if declared(_BIO_s_file)} + BIO_s_file := @_BIO_s_file; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_s_file_allownil)} + if FuncLoadError then + AFailed.Add('BIO_s_file'); + {$ifend} + end; + + + BIO_new_file := LoadLibFunction(ADllHandle, BIO_new_file_procname); + FuncLoadError := not assigned(BIO_new_file); + if FuncLoadError then + begin + {$if not defined(BIO_new_file_allownil)} + BIO_new_file := @ERR_BIO_new_file; + {$ifend} + {$if declared(BIO_new_file_introduced)} + if LibVersion < BIO_new_file_introduced then + begin + {$if declared(FC_BIO_new_file)} + BIO_new_file := @FC_BIO_new_file; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_new_file_removed)} + if BIO_new_file_removed <= LibVersion then + begin + {$if declared(_BIO_new_file)} + BIO_new_file := @_BIO_new_file; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_new_file_allownil)} + if FuncLoadError then + AFailed.Add('BIO_new_file'); + {$ifend} + end; + + + BIO_new := LoadLibFunction(ADllHandle, BIO_new_procname); + FuncLoadError := not assigned(BIO_new); + if FuncLoadError then + begin + {$if not defined(BIO_new_allownil)} + BIO_new := @ERR_BIO_new; + {$ifend} + {$if declared(BIO_new_introduced)} + if LibVersion < BIO_new_introduced then + begin + {$if declared(FC_BIO_new)} + BIO_new := @FC_BIO_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_new_removed)} + if BIO_new_removed <= LibVersion then + begin + {$if declared(_BIO_new)} + BIO_new := @_BIO_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_new_allownil)} + if FuncLoadError then + AFailed.Add('BIO_new'); + {$ifend} + end; + + + BIO_free := LoadLibFunction(ADllHandle, BIO_free_procname); + FuncLoadError := not assigned(BIO_free); + if FuncLoadError then + begin + {$if not defined(BIO_free_allownil)} + BIO_free := @ERR_BIO_free; + {$ifend} + {$if declared(BIO_free_introduced)} + if LibVersion < BIO_free_introduced then + begin + {$if declared(FC_BIO_free)} + BIO_free := @FC_BIO_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_free_removed)} + if BIO_free_removed <= LibVersion then + begin + {$if declared(_BIO_free)} + BIO_free := @_BIO_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_free_allownil)} + if FuncLoadError then + AFailed.Add('BIO_free'); + {$ifend} + end; + + + BIO_set_data := LoadLibFunction(ADllHandle, BIO_set_data_procname); + FuncLoadError := not assigned(BIO_set_data); + if FuncLoadError then + begin + {$if not defined(BIO_set_data_allownil)} + BIO_set_data := @ERR_BIO_set_data; + {$ifend} + {$if declared(BIO_set_data_introduced)} + if LibVersion < BIO_set_data_introduced then + begin + {$if declared(FC_BIO_set_data)} + BIO_set_data := @FC_BIO_set_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_set_data_removed)} + if BIO_set_data_removed <= LibVersion then + begin + {$if declared(_BIO_set_data)} + BIO_set_data := @_BIO_set_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_set_data_allownil)} + if FuncLoadError then + AFailed.Add('BIO_set_data'); + {$ifend} + end; + + {introduced 1.1.0} + BIO_get_data := LoadLibFunction(ADllHandle, BIO_get_data_procname); + FuncLoadError := not assigned(BIO_get_data); + if FuncLoadError then + begin + {$if not defined(BIO_get_data_allownil)} + BIO_get_data := @ERR_BIO_get_data; + {$ifend} + {$if declared(BIO_get_data_introduced)} + if LibVersion < BIO_get_data_introduced then + begin + {$if declared(FC_BIO_get_data)} + BIO_get_data := @FC_BIO_get_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_get_data_removed)} + if BIO_get_data_removed <= LibVersion then + begin + {$if declared(_BIO_get_data)} + BIO_get_data := @_BIO_get_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_get_data_allownil)} + if FuncLoadError then + AFailed.Add('BIO_get_data'); + {$ifend} + end; + + {introduced 1.1.0} + BIO_set_init := LoadLibFunction(ADllHandle, BIO_set_init_procname); + FuncLoadError := not assigned(BIO_set_init); + if FuncLoadError then + begin + {$if not defined(BIO_set_init_allownil)} + BIO_set_init := @ERR_BIO_set_init; + {$ifend} + {$if declared(BIO_set_init_introduced)} + if LibVersion < BIO_set_init_introduced then + begin + {$if declared(FC_BIO_set_init)} + BIO_set_init := @FC_BIO_set_init; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_set_init_removed)} + if BIO_set_init_removed <= LibVersion then + begin + {$if declared(_BIO_set_init)} + BIO_set_init := @_BIO_set_init; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_set_init_allownil)} + if FuncLoadError then + AFailed.Add('BIO_set_init'); + {$ifend} + end; + + {introduced 1.1.0} + BIO_get_init := LoadLibFunction(ADllHandle, BIO_get_init_procname); + FuncLoadError := not assigned(BIO_get_init); + if FuncLoadError then + begin + {$if not defined(BIO_get_init_allownil)} + BIO_get_init := @ERR_BIO_get_init; + {$ifend} + {$if declared(BIO_get_init_introduced)} + if LibVersion < BIO_get_init_introduced then + begin + {$if declared(FC_BIO_get_init)} + BIO_get_init := @FC_BIO_get_init; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_get_init_removed)} + if BIO_get_init_removed <= LibVersion then + begin + {$if declared(_BIO_get_init)} + BIO_get_init := @_BIO_get_init; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_get_init_allownil)} + if FuncLoadError then + AFailed.Add('BIO_get_init'); + {$ifend} + end; + + {introduced 1.1.0} + BIO_set_shutdown := LoadLibFunction(ADllHandle, BIO_set_shutdown_procname); + FuncLoadError := not assigned(BIO_set_shutdown); + if FuncLoadError then + begin + {$if not defined(BIO_set_shutdown_allownil)} + BIO_set_shutdown := @ERR_BIO_set_shutdown; + {$ifend} + {$if declared(BIO_set_shutdown_introduced)} + if LibVersion < BIO_set_shutdown_introduced then + begin + {$if declared(FC_BIO_set_shutdown)} + BIO_set_shutdown := @FC_BIO_set_shutdown; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_set_shutdown_removed)} + if BIO_set_shutdown_removed <= LibVersion then + begin + {$if declared(_BIO_set_shutdown)} + BIO_set_shutdown := @_BIO_set_shutdown; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_set_shutdown_allownil)} + if FuncLoadError then + AFailed.Add('BIO_set_shutdown'); + {$ifend} + end; + + {introduced 1.1.0} + BIO_get_shutdown := LoadLibFunction(ADllHandle, BIO_get_shutdown_procname); + FuncLoadError := not assigned(BIO_get_shutdown); + if FuncLoadError then + begin + {$if not defined(BIO_get_shutdown_allownil)} + BIO_get_shutdown := @ERR_BIO_get_shutdown; + {$ifend} + {$if declared(BIO_get_shutdown_introduced)} + if LibVersion < BIO_get_shutdown_introduced then + begin + {$if declared(FC_BIO_get_shutdown)} + BIO_get_shutdown := @FC_BIO_get_shutdown; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_get_shutdown_removed)} + if BIO_get_shutdown_removed <= LibVersion then + begin + {$if declared(_BIO_get_shutdown)} + BIO_get_shutdown := @_BIO_get_shutdown; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_get_shutdown_allownil)} + if FuncLoadError then + AFailed.Add('BIO_get_shutdown'); + {$ifend} + end; + + {introduced 1.1.0} + BIO_vfree := LoadLibFunction(ADllHandle, BIO_vfree_procname); + FuncLoadError := not assigned(BIO_vfree); + if FuncLoadError then + begin + {$if not defined(BIO_vfree_allownil)} + BIO_vfree := @ERR_BIO_vfree; + {$ifend} + {$if declared(BIO_vfree_introduced)} + if LibVersion < BIO_vfree_introduced then + begin + {$if declared(FC_BIO_vfree)} + BIO_vfree := @FC_BIO_vfree; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_vfree_removed)} + if BIO_vfree_removed <= LibVersion then + begin + {$if declared(_BIO_vfree)} + BIO_vfree := @_BIO_vfree; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_vfree_allownil)} + if FuncLoadError then + AFailed.Add('BIO_vfree'); + {$ifend} + end; + + + BIO_up_ref := LoadLibFunction(ADllHandle, BIO_up_ref_procname); + FuncLoadError := not assigned(BIO_up_ref); + if FuncLoadError then + begin + {$if not defined(BIO_up_ref_allownil)} + BIO_up_ref := @ERR_BIO_up_ref; + {$ifend} + {$if declared(BIO_up_ref_introduced)} + if LibVersion < BIO_up_ref_introduced then + begin + {$if declared(FC_BIO_up_ref)} + BIO_up_ref := @FC_BIO_up_ref; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_up_ref_removed)} + if BIO_up_ref_removed <= LibVersion then + begin + {$if declared(_BIO_up_ref)} + BIO_up_ref := @_BIO_up_ref; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_up_ref_allownil)} + if FuncLoadError then + AFailed.Add('BIO_up_ref'); + {$ifend} + end; + + {introduced 1.1.0} + BIO_read := LoadLibFunction(ADllHandle, BIO_read_procname); + FuncLoadError := not assigned(BIO_read); + if FuncLoadError then + begin + {$if not defined(BIO_read_allownil)} + BIO_read := @ERR_BIO_read; + {$ifend} + {$if declared(BIO_read_introduced)} + if LibVersion < BIO_read_introduced then + begin + {$if declared(FC_BIO_read)} + BIO_read := @FC_BIO_read; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_read_removed)} + if BIO_read_removed <= LibVersion then + begin + {$if declared(_BIO_read)} + BIO_read := @_BIO_read; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_read_allownil)} + if FuncLoadError then + AFailed.Add('BIO_read'); + {$ifend} + end; + + + BIO_read_ex := LoadLibFunction(ADllHandle, BIO_read_ex_procname); + FuncLoadError := not assigned(BIO_read_ex); + if FuncLoadError then + begin + {$if not defined(BIO_read_ex_allownil)} + BIO_read_ex := @ERR_BIO_read_ex; + {$ifend} + {$if declared(BIO_read_ex_introduced)} + if LibVersion < BIO_read_ex_introduced then + begin + {$if declared(FC_BIO_read_ex)} + BIO_read_ex := @FC_BIO_read_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_read_ex_removed)} + if BIO_read_ex_removed <= LibVersion then + begin + {$if declared(_BIO_read_ex)} + BIO_read_ex := @_BIO_read_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_read_ex_allownil)} + if FuncLoadError then + AFailed.Add('BIO_read_ex'); + {$ifend} + end; + + {introduced 1.1.0} + BIO_gets := LoadLibFunction(ADllHandle, BIO_gets_procname); + FuncLoadError := not assigned(BIO_gets); + if FuncLoadError then + begin + {$if not defined(BIO_gets_allownil)} + BIO_gets := @ERR_BIO_gets; + {$ifend} + {$if declared(BIO_gets_introduced)} + if LibVersion < BIO_gets_introduced then + begin + {$if declared(FC_BIO_gets)} + BIO_gets := @FC_BIO_gets; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_gets_removed)} + if BIO_gets_removed <= LibVersion then + begin + {$if declared(_BIO_gets)} + BIO_gets := @_BIO_gets; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_gets_allownil)} + if FuncLoadError then + AFailed.Add('BIO_gets'); + {$ifend} + end; + + + BIO_write := LoadLibFunction(ADllHandle, BIO_write_procname); + FuncLoadError := not assigned(BIO_write); + if FuncLoadError then + begin + {$if not defined(BIO_write_allownil)} + BIO_write := @ERR_BIO_write; + {$ifend} + {$if declared(BIO_write_introduced)} + if LibVersion < BIO_write_introduced then + begin + {$if declared(FC_BIO_write)} + BIO_write := @FC_BIO_write; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_write_removed)} + if BIO_write_removed <= LibVersion then + begin + {$if declared(_BIO_write)} + BIO_write := @_BIO_write; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_write_allownil)} + if FuncLoadError then + AFailed.Add('BIO_write'); + {$ifend} + end; + + + BIO_write_ex := LoadLibFunction(ADllHandle, BIO_write_ex_procname); + FuncLoadError := not assigned(BIO_write_ex); + if FuncLoadError then + begin + {$if not defined(BIO_write_ex_allownil)} + BIO_write_ex := @ERR_BIO_write_ex; + {$ifend} + {$if declared(BIO_write_ex_introduced)} + if LibVersion < BIO_write_ex_introduced then + begin + {$if declared(FC_BIO_write_ex)} + BIO_write_ex := @FC_BIO_write_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_write_ex_removed)} + if BIO_write_ex_removed <= LibVersion then + begin + {$if declared(_BIO_write_ex)} + BIO_write_ex := @_BIO_write_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_write_ex_allownil)} + if FuncLoadError then + AFailed.Add('BIO_write_ex'); + {$ifend} + end; + + {introduced 1.1.0} + BIO_puts := LoadLibFunction(ADllHandle, BIO_puts_procname); + FuncLoadError := not assigned(BIO_puts); + if FuncLoadError then + begin + {$if not defined(BIO_puts_allownil)} + BIO_puts := @ERR_BIO_puts; + {$ifend} + {$if declared(BIO_puts_introduced)} + if LibVersion < BIO_puts_introduced then + begin + {$if declared(FC_BIO_puts)} + BIO_puts := @FC_BIO_puts; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_puts_removed)} + if BIO_puts_removed <= LibVersion then + begin + {$if declared(_BIO_puts)} + BIO_puts := @_BIO_puts; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_puts_allownil)} + if FuncLoadError then + AFailed.Add('BIO_puts'); + {$ifend} + end; + + + BIO_indent := LoadLibFunction(ADllHandle, BIO_indent_procname); + FuncLoadError := not assigned(BIO_indent); + if FuncLoadError then + begin + {$if not defined(BIO_indent_allownil)} + BIO_indent := @ERR_BIO_indent; + {$ifend} + {$if declared(BIO_indent_introduced)} + if LibVersion < BIO_indent_introduced then + begin + {$if declared(FC_BIO_indent)} + BIO_indent := @FC_BIO_indent; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_indent_removed)} + if BIO_indent_removed <= LibVersion then + begin + {$if declared(_BIO_indent)} + BIO_indent := @_BIO_indent; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_indent_allownil)} + if FuncLoadError then + AFailed.Add('BIO_indent'); + {$ifend} + end; + + + BIO_ctrl := LoadLibFunction(ADllHandle, BIO_ctrl_procname); + FuncLoadError := not assigned(BIO_ctrl); + if FuncLoadError then + begin + {$if not defined(BIO_ctrl_allownil)} + BIO_ctrl := @ERR_BIO_ctrl; + {$ifend} + {$if declared(BIO_ctrl_introduced)} + if LibVersion < BIO_ctrl_introduced then + begin + {$if declared(FC_BIO_ctrl)} + BIO_ctrl := @FC_BIO_ctrl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_ctrl_removed)} + if BIO_ctrl_removed <= LibVersion then + begin + {$if declared(_BIO_ctrl)} + BIO_ctrl := @_BIO_ctrl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_ctrl_allownil)} + if FuncLoadError then + AFailed.Add('BIO_ctrl'); + {$ifend} + end; + + + BIO_callback_ctrl := LoadLibFunction(ADllHandle, BIO_callback_ctrl_procname); + FuncLoadError := not assigned(BIO_callback_ctrl); + if FuncLoadError then + begin + {$if not defined(BIO_callback_ctrl_allownil)} + BIO_callback_ctrl := @ERR_BIO_callback_ctrl; + {$ifend} + {$if declared(BIO_callback_ctrl_introduced)} + if LibVersion < BIO_callback_ctrl_introduced then + begin + {$if declared(FC_BIO_callback_ctrl)} + BIO_callback_ctrl := @FC_BIO_callback_ctrl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_callback_ctrl_removed)} + if BIO_callback_ctrl_removed <= LibVersion then + begin + {$if declared(_BIO_callback_ctrl)} + BIO_callback_ctrl := @_BIO_callback_ctrl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_callback_ctrl_allownil)} + if FuncLoadError then + AFailed.Add('BIO_callback_ctrl'); + {$ifend} + end; + + + BIO_ptr_ctrl := LoadLibFunction(ADllHandle, BIO_ptr_ctrl_procname); + FuncLoadError := not assigned(BIO_ptr_ctrl); + if FuncLoadError then + begin + {$if not defined(BIO_ptr_ctrl_allownil)} + BIO_ptr_ctrl := @ERR_BIO_ptr_ctrl; + {$ifend} + {$if declared(BIO_ptr_ctrl_introduced)} + if LibVersion < BIO_ptr_ctrl_introduced then + begin + {$if declared(FC_BIO_ptr_ctrl)} + BIO_ptr_ctrl := @FC_BIO_ptr_ctrl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_ptr_ctrl_removed)} + if BIO_ptr_ctrl_removed <= LibVersion then + begin + {$if declared(_BIO_ptr_ctrl)} + BIO_ptr_ctrl := @_BIO_ptr_ctrl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_ptr_ctrl_allownil)} + if FuncLoadError then + AFailed.Add('BIO_ptr_ctrl'); + {$ifend} + end; + + + BIO_int_ctrl := LoadLibFunction(ADllHandle, BIO_int_ctrl_procname); + FuncLoadError := not assigned(BIO_int_ctrl); + if FuncLoadError then + begin + {$if not defined(BIO_int_ctrl_allownil)} + BIO_int_ctrl := @ERR_BIO_int_ctrl; + {$ifend} + {$if declared(BIO_int_ctrl_introduced)} + if LibVersion < BIO_int_ctrl_introduced then + begin + {$if declared(FC_BIO_int_ctrl)} + BIO_int_ctrl := @FC_BIO_int_ctrl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_int_ctrl_removed)} + if BIO_int_ctrl_removed <= LibVersion then + begin + {$if declared(_BIO_int_ctrl)} + BIO_int_ctrl := @_BIO_int_ctrl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_int_ctrl_allownil)} + if FuncLoadError then + AFailed.Add('BIO_int_ctrl'); + {$ifend} + end; + + + BIO_push := LoadLibFunction(ADllHandle, BIO_push_procname); + FuncLoadError := not assigned(BIO_push); + if FuncLoadError then + begin + {$if not defined(BIO_push_allownil)} + BIO_push := @ERR_BIO_push; + {$ifend} + {$if declared(BIO_push_introduced)} + if LibVersion < BIO_push_introduced then + begin + {$if declared(FC_BIO_push)} + BIO_push := @FC_BIO_push; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_push_removed)} + if BIO_push_removed <= LibVersion then + begin + {$if declared(_BIO_push)} + BIO_push := @_BIO_push; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_push_allownil)} + if FuncLoadError then + AFailed.Add('BIO_push'); + {$ifend} + end; + + + BIO_pop := LoadLibFunction(ADllHandle, BIO_pop_procname); + FuncLoadError := not assigned(BIO_pop); + if FuncLoadError then + begin + {$if not defined(BIO_pop_allownil)} + BIO_pop := @ERR_BIO_pop; + {$ifend} + {$if declared(BIO_pop_introduced)} + if LibVersion < BIO_pop_introduced then + begin + {$if declared(FC_BIO_pop)} + BIO_pop := @FC_BIO_pop; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_pop_removed)} + if BIO_pop_removed <= LibVersion then + begin + {$if declared(_BIO_pop)} + BIO_pop := @_BIO_pop; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_pop_allownil)} + if FuncLoadError then + AFailed.Add('BIO_pop'); + {$ifend} + end; + + + BIO_free_all := LoadLibFunction(ADllHandle, BIO_free_all_procname); + FuncLoadError := not assigned(BIO_free_all); + if FuncLoadError then + begin + {$if not defined(BIO_free_all_allownil)} + BIO_free_all := @ERR_BIO_free_all; + {$ifend} + {$if declared(BIO_free_all_introduced)} + if LibVersion < BIO_free_all_introduced then + begin + {$if declared(FC_BIO_free_all)} + BIO_free_all := @FC_BIO_free_all; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_free_all_removed)} + if BIO_free_all_removed <= LibVersion then + begin + {$if declared(_BIO_free_all)} + BIO_free_all := @_BIO_free_all; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_free_all_allownil)} + if FuncLoadError then + AFailed.Add('BIO_free_all'); + {$ifend} + end; + + + BIO_find_type := LoadLibFunction(ADllHandle, BIO_find_type_procname); + FuncLoadError := not assigned(BIO_find_type); + if FuncLoadError then + begin + {$if not defined(BIO_find_type_allownil)} + BIO_find_type := @ERR_BIO_find_type; + {$ifend} + {$if declared(BIO_find_type_introduced)} + if LibVersion < BIO_find_type_introduced then + begin + {$if declared(FC_BIO_find_type)} + BIO_find_type := @FC_BIO_find_type; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_find_type_removed)} + if BIO_find_type_removed <= LibVersion then + begin + {$if declared(_BIO_find_type)} + BIO_find_type := @_BIO_find_type; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_find_type_allownil)} + if FuncLoadError then + AFailed.Add('BIO_find_type'); + {$ifend} + end; + + + BIO_next := LoadLibFunction(ADllHandle, BIO_next_procname); + FuncLoadError := not assigned(BIO_next); + if FuncLoadError then + begin + {$if not defined(BIO_next_allownil)} + BIO_next := @ERR_BIO_next; + {$ifend} + {$if declared(BIO_next_introduced)} + if LibVersion < BIO_next_introduced then + begin + {$if declared(FC_BIO_next)} + BIO_next := @FC_BIO_next; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_next_removed)} + if BIO_next_removed <= LibVersion then + begin + {$if declared(_BIO_next)} + BIO_next := @_BIO_next; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_next_allownil)} + if FuncLoadError then + AFailed.Add('BIO_next'); + {$ifend} + end; + + + BIO_set_next := LoadLibFunction(ADllHandle, BIO_set_next_procname); + FuncLoadError := not assigned(BIO_set_next); + if FuncLoadError then + begin + {$if not defined(BIO_set_next_allownil)} + BIO_set_next := @ERR_BIO_set_next; + {$ifend} + {$if declared(BIO_set_next_introduced)} + if LibVersion < BIO_set_next_introduced then + begin + {$if declared(FC_BIO_set_next)} + BIO_set_next := @FC_BIO_set_next; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_set_next_removed)} + if BIO_set_next_removed <= LibVersion then + begin + {$if declared(_BIO_set_next)} + BIO_set_next := @_BIO_set_next; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_set_next_allownil)} + if FuncLoadError then + AFailed.Add('BIO_set_next'); + {$ifend} + end; + + {introduced 1.1.0} + BIO_get_retry_BIO := LoadLibFunction(ADllHandle, BIO_get_retry_BIO_procname); + FuncLoadError := not assigned(BIO_get_retry_BIO); + if FuncLoadError then + begin + {$if not defined(BIO_get_retry_BIO_allownil)} + BIO_get_retry_BIO := @ERR_BIO_get_retry_BIO; + {$ifend} + {$if declared(BIO_get_retry_BIO_introduced)} + if LibVersion < BIO_get_retry_BIO_introduced then + begin + {$if declared(FC_BIO_get_retry_BIO)} + BIO_get_retry_BIO := @FC_BIO_get_retry_BIO; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_get_retry_BIO_removed)} + if BIO_get_retry_BIO_removed <= LibVersion then + begin + {$if declared(_BIO_get_retry_BIO)} + BIO_get_retry_BIO := @_BIO_get_retry_BIO; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_get_retry_BIO_allownil)} + if FuncLoadError then + AFailed.Add('BIO_get_retry_BIO'); + {$ifend} + end; + + + BIO_get_retry_reason := LoadLibFunction(ADllHandle, BIO_get_retry_reason_procname); + FuncLoadError := not assigned(BIO_get_retry_reason); + if FuncLoadError then + begin + {$if not defined(BIO_get_retry_reason_allownil)} + BIO_get_retry_reason := @ERR_BIO_get_retry_reason; + {$ifend} + {$if declared(BIO_get_retry_reason_introduced)} + if LibVersion < BIO_get_retry_reason_introduced then + begin + {$if declared(FC_BIO_get_retry_reason)} + BIO_get_retry_reason := @FC_BIO_get_retry_reason; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_get_retry_reason_removed)} + if BIO_get_retry_reason_removed <= LibVersion then + begin + {$if declared(_BIO_get_retry_reason)} + BIO_get_retry_reason := @_BIO_get_retry_reason; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_get_retry_reason_allownil)} + if FuncLoadError then + AFailed.Add('BIO_get_retry_reason'); + {$ifend} + end; + + + BIO_set_retry_reason := LoadLibFunction(ADllHandle, BIO_set_retry_reason_procname); + FuncLoadError := not assigned(BIO_set_retry_reason); + if FuncLoadError then + begin + {$if not defined(BIO_set_retry_reason_allownil)} + BIO_set_retry_reason := @ERR_BIO_set_retry_reason; + {$ifend} + {$if declared(BIO_set_retry_reason_introduced)} + if LibVersion < BIO_set_retry_reason_introduced then + begin + {$if declared(FC_BIO_set_retry_reason)} + BIO_set_retry_reason := @FC_BIO_set_retry_reason; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_set_retry_reason_removed)} + if BIO_set_retry_reason_removed <= LibVersion then + begin + {$if declared(_BIO_set_retry_reason)} + BIO_set_retry_reason := @_BIO_set_retry_reason; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_set_retry_reason_allownil)} + if FuncLoadError then + AFailed.Add('BIO_set_retry_reason'); + {$ifend} + end; + + {introduced 1.1.0} + BIO_dup_chain := LoadLibFunction(ADllHandle, BIO_dup_chain_procname); + FuncLoadError := not assigned(BIO_dup_chain); + if FuncLoadError then + begin + {$if not defined(BIO_dup_chain_allownil)} + BIO_dup_chain := @ERR_BIO_dup_chain; + {$ifend} + {$if declared(BIO_dup_chain_introduced)} + if LibVersion < BIO_dup_chain_introduced then + begin + {$if declared(FC_BIO_dup_chain)} + BIO_dup_chain := @FC_BIO_dup_chain; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_dup_chain_removed)} + if BIO_dup_chain_removed <= LibVersion then + begin + {$if declared(_BIO_dup_chain)} + BIO_dup_chain := @_BIO_dup_chain; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_dup_chain_allownil)} + if FuncLoadError then + AFailed.Add('BIO_dup_chain'); + {$ifend} + end; + + + BIO_nread0 := LoadLibFunction(ADllHandle, BIO_nread0_procname); + FuncLoadError := not assigned(BIO_nread0); + if FuncLoadError then + begin + {$if not defined(BIO_nread0_allownil)} + BIO_nread0 := @ERR_BIO_nread0; + {$ifend} + {$if declared(BIO_nread0_introduced)} + if LibVersion < BIO_nread0_introduced then + begin + {$if declared(FC_BIO_nread0)} + BIO_nread0 := @FC_BIO_nread0; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_nread0_removed)} + if BIO_nread0_removed <= LibVersion then + begin + {$if declared(_BIO_nread0)} + BIO_nread0 := @_BIO_nread0; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_nread0_allownil)} + if FuncLoadError then + AFailed.Add('BIO_nread0'); + {$ifend} + end; + + + BIO_nread := LoadLibFunction(ADllHandle, BIO_nread_procname); + FuncLoadError := not assigned(BIO_nread); + if FuncLoadError then + begin + {$if not defined(BIO_nread_allownil)} + BIO_nread := @ERR_BIO_nread; + {$ifend} + {$if declared(BIO_nread_introduced)} + if LibVersion < BIO_nread_introduced then + begin + {$if declared(FC_BIO_nread)} + BIO_nread := @FC_BIO_nread; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_nread_removed)} + if BIO_nread_removed <= LibVersion then + begin + {$if declared(_BIO_nread)} + BIO_nread := @_BIO_nread; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_nread_allownil)} + if FuncLoadError then + AFailed.Add('BIO_nread'); + {$ifend} + end; + + + BIO_nwrite0 := LoadLibFunction(ADllHandle, BIO_nwrite0_procname); + FuncLoadError := not assigned(BIO_nwrite0); + if FuncLoadError then + begin + {$if not defined(BIO_nwrite0_allownil)} + BIO_nwrite0 := @ERR_BIO_nwrite0; + {$ifend} + {$if declared(BIO_nwrite0_introduced)} + if LibVersion < BIO_nwrite0_introduced then + begin + {$if declared(FC_BIO_nwrite0)} + BIO_nwrite0 := @FC_BIO_nwrite0; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_nwrite0_removed)} + if BIO_nwrite0_removed <= LibVersion then + begin + {$if declared(_BIO_nwrite0)} + BIO_nwrite0 := @_BIO_nwrite0; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_nwrite0_allownil)} + if FuncLoadError then + AFailed.Add('BIO_nwrite0'); + {$ifend} + end; + + + BIO_nwrite := LoadLibFunction(ADllHandle, BIO_nwrite_procname); + FuncLoadError := not assigned(BIO_nwrite); + if FuncLoadError then + begin + {$if not defined(BIO_nwrite_allownil)} + BIO_nwrite := @ERR_BIO_nwrite; + {$ifend} + {$if declared(BIO_nwrite_introduced)} + if LibVersion < BIO_nwrite_introduced then + begin + {$if declared(FC_BIO_nwrite)} + BIO_nwrite := @FC_BIO_nwrite; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_nwrite_removed)} + if BIO_nwrite_removed <= LibVersion then + begin + {$if declared(_BIO_nwrite)} + BIO_nwrite := @_BIO_nwrite; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_nwrite_allownil)} + if FuncLoadError then + AFailed.Add('BIO_nwrite'); + {$ifend} + end; + + + BIO_debug_callback := LoadLibFunction(ADllHandle, BIO_debug_callback_procname); + FuncLoadError := not assigned(BIO_debug_callback); + if FuncLoadError then + begin + {$if not defined(BIO_debug_callback_allownil)} + BIO_debug_callback := @ERR_BIO_debug_callback; + {$ifend} + {$if declared(BIO_debug_callback_introduced)} + if LibVersion < BIO_debug_callback_introduced then + begin + {$if declared(FC_BIO_debug_callback)} + BIO_debug_callback := @FC_BIO_debug_callback; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_debug_callback_removed)} + if BIO_debug_callback_removed <= LibVersion then + begin + {$if declared(_BIO_debug_callback)} + BIO_debug_callback := @_BIO_debug_callback; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_debug_callback_allownil)} + if FuncLoadError then + AFailed.Add('BIO_debug_callback'); + {$ifend} + end; + + + BIO_s_mem := LoadLibFunction(ADllHandle, BIO_s_mem_procname); + FuncLoadError := not assigned(BIO_s_mem); + if FuncLoadError then + begin + {$if not defined(BIO_s_mem_allownil)} + BIO_s_mem := @ERR_BIO_s_mem; + {$ifend} + {$if declared(BIO_s_mem_introduced)} + if LibVersion < BIO_s_mem_introduced then + begin + {$if declared(FC_BIO_s_mem)} + BIO_s_mem := @FC_BIO_s_mem; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_s_mem_removed)} + if BIO_s_mem_removed <= LibVersion then + begin + {$if declared(_BIO_s_mem)} + BIO_s_mem := @_BIO_s_mem; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_s_mem_allownil)} + if FuncLoadError then + AFailed.Add('BIO_s_mem'); + {$ifend} + end; + + + BIO_s_secmem := LoadLibFunction(ADllHandle, BIO_s_secmem_procname); + FuncLoadError := not assigned(BIO_s_secmem); + if FuncLoadError then + begin + {$if not defined(BIO_s_secmem_allownil)} + BIO_s_secmem := @ERR_BIO_s_secmem; + {$ifend} + {$if declared(BIO_s_secmem_introduced)} + if LibVersion < BIO_s_secmem_introduced then + begin + {$if declared(FC_BIO_s_secmem)} + BIO_s_secmem := @FC_BIO_s_secmem; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_s_secmem_removed)} + if BIO_s_secmem_removed <= LibVersion then + begin + {$if declared(_BIO_s_secmem)} + BIO_s_secmem := @_BIO_s_secmem; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_s_secmem_allownil)} + if FuncLoadError then + AFailed.Add('BIO_s_secmem'); + {$ifend} + end; + + {introduced 1.1.0} + BIO_new_mem_buf := LoadLibFunction(ADllHandle, BIO_new_mem_buf_procname); + FuncLoadError := not assigned(BIO_new_mem_buf); + if FuncLoadError then + begin + {$if not defined(BIO_new_mem_buf_allownil)} + BIO_new_mem_buf := @ERR_BIO_new_mem_buf; + {$ifend} + {$if declared(BIO_new_mem_buf_introduced)} + if LibVersion < BIO_new_mem_buf_introduced then + begin + {$if declared(FC_BIO_new_mem_buf)} + BIO_new_mem_buf := @FC_BIO_new_mem_buf; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_new_mem_buf_removed)} + if BIO_new_mem_buf_removed <= LibVersion then + begin + {$if declared(_BIO_new_mem_buf)} + BIO_new_mem_buf := @_BIO_new_mem_buf; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_new_mem_buf_allownil)} + if FuncLoadError then + AFailed.Add('BIO_new_mem_buf'); + {$ifend} + end; + + + BIO_s_socket := LoadLibFunction(ADllHandle, BIO_s_socket_procname); + FuncLoadError := not assigned(BIO_s_socket); + if FuncLoadError then + begin + {$if not defined(BIO_s_socket_allownil)} + BIO_s_socket := @ERR_BIO_s_socket; + {$ifend} + {$if declared(BIO_s_socket_introduced)} + if LibVersion < BIO_s_socket_introduced then + begin + {$if declared(FC_BIO_s_socket)} + BIO_s_socket := @FC_BIO_s_socket; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_s_socket_removed)} + if BIO_s_socket_removed <= LibVersion then + begin + {$if declared(_BIO_s_socket)} + BIO_s_socket := @_BIO_s_socket; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_s_socket_allownil)} + if FuncLoadError then + AFailed.Add('BIO_s_socket'); + {$ifend} + end; + + + BIO_s_connect := LoadLibFunction(ADllHandle, BIO_s_connect_procname); + FuncLoadError := not assigned(BIO_s_connect); + if FuncLoadError then + begin + {$if not defined(BIO_s_connect_allownil)} + BIO_s_connect := @ERR_BIO_s_connect; + {$ifend} + {$if declared(BIO_s_connect_introduced)} + if LibVersion < BIO_s_connect_introduced then + begin + {$if declared(FC_BIO_s_connect)} + BIO_s_connect := @FC_BIO_s_connect; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_s_connect_removed)} + if BIO_s_connect_removed <= LibVersion then + begin + {$if declared(_BIO_s_connect)} + BIO_s_connect := @_BIO_s_connect; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_s_connect_allownil)} + if FuncLoadError then + AFailed.Add('BIO_s_connect'); + {$ifend} + end; + + + BIO_s_accept := LoadLibFunction(ADllHandle, BIO_s_accept_procname); + FuncLoadError := not assigned(BIO_s_accept); + if FuncLoadError then + begin + {$if not defined(BIO_s_accept_allownil)} + BIO_s_accept := @ERR_BIO_s_accept; + {$ifend} + {$if declared(BIO_s_accept_introduced)} + if LibVersion < BIO_s_accept_introduced then + begin + {$if declared(FC_BIO_s_accept)} + BIO_s_accept := @FC_BIO_s_accept; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_s_accept_removed)} + if BIO_s_accept_removed <= LibVersion then + begin + {$if declared(_BIO_s_accept)} + BIO_s_accept := @_BIO_s_accept; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_s_accept_allownil)} + if FuncLoadError then + AFailed.Add('BIO_s_accept'); + {$ifend} + end; + + + BIO_s_fd := LoadLibFunction(ADllHandle, BIO_s_fd_procname); + FuncLoadError := not assigned(BIO_s_fd); + if FuncLoadError then + begin + {$if not defined(BIO_s_fd_allownil)} + BIO_s_fd := @ERR_BIO_s_fd; + {$ifend} + {$if declared(BIO_s_fd_introduced)} + if LibVersion < BIO_s_fd_introduced then + begin + {$if declared(FC_BIO_s_fd)} + BIO_s_fd := @FC_BIO_s_fd; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_s_fd_removed)} + if BIO_s_fd_removed <= LibVersion then + begin + {$if declared(_BIO_s_fd)} + BIO_s_fd := @_BIO_s_fd; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_s_fd_allownil)} + if FuncLoadError then + AFailed.Add('BIO_s_fd'); + {$ifend} + end; + + + BIO_s_log := LoadLibFunction(ADllHandle, BIO_s_log_procname); + FuncLoadError := not assigned(BIO_s_log); + if FuncLoadError then + begin + {$if not defined(BIO_s_log_allownil)} + BIO_s_log := @ERR_BIO_s_log; + {$ifend} + {$if declared(BIO_s_log_introduced)} + if LibVersion < BIO_s_log_introduced then + begin + {$if declared(FC_BIO_s_log)} + BIO_s_log := @FC_BIO_s_log; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_s_log_removed)} + if BIO_s_log_removed <= LibVersion then + begin + {$if declared(_BIO_s_log)} + BIO_s_log := @_BIO_s_log; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_s_log_allownil)} + if FuncLoadError then + AFailed.Add('BIO_s_log'); + {$ifend} + end; + + + BIO_s_bio := LoadLibFunction(ADllHandle, BIO_s_bio_procname); + FuncLoadError := not assigned(BIO_s_bio); + if FuncLoadError then + begin + {$if not defined(BIO_s_bio_allownil)} + BIO_s_bio := @ERR_BIO_s_bio; + {$ifend} + {$if declared(BIO_s_bio_introduced)} + if LibVersion < BIO_s_bio_introduced then + begin + {$if declared(FC_BIO_s_bio)} + BIO_s_bio := @FC_BIO_s_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_s_bio_removed)} + if BIO_s_bio_removed <= LibVersion then + begin + {$if declared(_BIO_s_bio)} + BIO_s_bio := @_BIO_s_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_s_bio_allownil)} + if FuncLoadError then + AFailed.Add('BIO_s_bio'); + {$ifend} + end; + + + BIO_s_null := LoadLibFunction(ADllHandle, BIO_s_null_procname); + FuncLoadError := not assigned(BIO_s_null); + if FuncLoadError then + begin + {$if not defined(BIO_s_null_allownil)} + BIO_s_null := @ERR_BIO_s_null; + {$ifend} + {$if declared(BIO_s_null_introduced)} + if LibVersion < BIO_s_null_introduced then + begin + {$if declared(FC_BIO_s_null)} + BIO_s_null := @FC_BIO_s_null; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_s_null_removed)} + if BIO_s_null_removed <= LibVersion then + begin + {$if declared(_BIO_s_null)} + BIO_s_null := @_BIO_s_null; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_s_null_allownil)} + if FuncLoadError then + AFailed.Add('BIO_s_null'); + {$ifend} + end; + + + BIO_f_null := LoadLibFunction(ADllHandle, BIO_f_null_procname); + FuncLoadError := not assigned(BIO_f_null); + if FuncLoadError then + begin + {$if not defined(BIO_f_null_allownil)} + BIO_f_null := @ERR_BIO_f_null; + {$ifend} + {$if declared(BIO_f_null_introduced)} + if LibVersion < BIO_f_null_introduced then + begin + {$if declared(FC_BIO_f_null)} + BIO_f_null := @FC_BIO_f_null; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_f_null_removed)} + if BIO_f_null_removed <= LibVersion then + begin + {$if declared(_BIO_f_null)} + BIO_f_null := @_BIO_f_null; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_f_null_allownil)} + if FuncLoadError then + AFailed.Add('BIO_f_null'); + {$ifend} + end; + + + BIO_f_buffer := LoadLibFunction(ADllHandle, BIO_f_buffer_procname); + FuncLoadError := not assigned(BIO_f_buffer); + if FuncLoadError then + begin + {$if not defined(BIO_f_buffer_allownil)} + BIO_f_buffer := @ERR_BIO_f_buffer; + {$ifend} + {$if declared(BIO_f_buffer_introduced)} + if LibVersion < BIO_f_buffer_introduced then + begin + {$if declared(FC_BIO_f_buffer)} + BIO_f_buffer := @FC_BIO_f_buffer; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_f_buffer_removed)} + if BIO_f_buffer_removed <= LibVersion then + begin + {$if declared(_BIO_f_buffer)} + BIO_f_buffer := @_BIO_f_buffer; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_f_buffer_allownil)} + if FuncLoadError then + AFailed.Add('BIO_f_buffer'); + {$ifend} + end; + + + BIO_f_linebuffer := LoadLibFunction(ADllHandle, BIO_f_linebuffer_procname); + FuncLoadError := not assigned(BIO_f_linebuffer); + if FuncLoadError then + begin + {$if not defined(BIO_f_linebuffer_allownil)} + BIO_f_linebuffer := @ERR_BIO_f_linebuffer; + {$ifend} + {$if declared(BIO_f_linebuffer_introduced)} + if LibVersion < BIO_f_linebuffer_introduced then + begin + {$if declared(FC_BIO_f_linebuffer)} + BIO_f_linebuffer := @FC_BIO_f_linebuffer; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_f_linebuffer_removed)} + if BIO_f_linebuffer_removed <= LibVersion then + begin + {$if declared(_BIO_f_linebuffer)} + BIO_f_linebuffer := @_BIO_f_linebuffer; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_f_linebuffer_allownil)} + if FuncLoadError then + AFailed.Add('BIO_f_linebuffer'); + {$ifend} + end; + + {introduced 1.1.0} + BIO_f_nbio_test := LoadLibFunction(ADllHandle, BIO_f_nbio_test_procname); + FuncLoadError := not assigned(BIO_f_nbio_test); + if FuncLoadError then + begin + {$if not defined(BIO_f_nbio_test_allownil)} + BIO_f_nbio_test := @ERR_BIO_f_nbio_test; + {$ifend} + {$if declared(BIO_f_nbio_test_introduced)} + if LibVersion < BIO_f_nbio_test_introduced then + begin + {$if declared(FC_BIO_f_nbio_test)} + BIO_f_nbio_test := @FC_BIO_f_nbio_test; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_f_nbio_test_removed)} + if BIO_f_nbio_test_removed <= LibVersion then + begin + {$if declared(_BIO_f_nbio_test)} + BIO_f_nbio_test := @_BIO_f_nbio_test; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_f_nbio_test_allownil)} + if FuncLoadError then + AFailed.Add('BIO_f_nbio_test'); + {$ifend} + end; + + + BIO_s_datagram := LoadLibFunction(ADllHandle, BIO_s_datagram_procname); + FuncLoadError := not assigned(BIO_s_datagram); + if FuncLoadError then + begin + {$if not defined(BIO_s_datagram_allownil)} + BIO_s_datagram := @ERR_BIO_s_datagram; + {$ifend} + {$if declared(BIO_s_datagram_introduced)} + if LibVersion < BIO_s_datagram_introduced then + begin + {$if declared(FC_BIO_s_datagram)} + BIO_s_datagram := @FC_BIO_s_datagram; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_s_datagram_removed)} + if BIO_s_datagram_removed <= LibVersion then + begin + {$if declared(_BIO_s_datagram)} + BIO_s_datagram := @_BIO_s_datagram; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_s_datagram_allownil)} + if FuncLoadError then + AFailed.Add('BIO_s_datagram'); + {$ifend} + end; + + + BIO_dgram_non_fatal_error := LoadLibFunction(ADllHandle, BIO_dgram_non_fatal_error_procname); + FuncLoadError := not assigned(BIO_dgram_non_fatal_error); + if FuncLoadError then + begin + {$if not defined(BIO_dgram_non_fatal_error_allownil)} + BIO_dgram_non_fatal_error := @ERR_BIO_dgram_non_fatal_error; + {$ifend} + {$if declared(BIO_dgram_non_fatal_error_introduced)} + if LibVersion < BIO_dgram_non_fatal_error_introduced then + begin + {$if declared(FC_BIO_dgram_non_fatal_error)} + BIO_dgram_non_fatal_error := @FC_BIO_dgram_non_fatal_error; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_dgram_non_fatal_error_removed)} + if BIO_dgram_non_fatal_error_removed <= LibVersion then + begin + {$if declared(_BIO_dgram_non_fatal_error)} + BIO_dgram_non_fatal_error := @_BIO_dgram_non_fatal_error; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_dgram_non_fatal_error_allownil)} + if FuncLoadError then + AFailed.Add('BIO_dgram_non_fatal_error'); + {$ifend} + end; + + + BIO_new_dgram := LoadLibFunction(ADllHandle, BIO_new_dgram_procname); + FuncLoadError := not assigned(BIO_new_dgram); + if FuncLoadError then + begin + {$if not defined(BIO_new_dgram_allownil)} + BIO_new_dgram := @ERR_BIO_new_dgram; + {$ifend} + {$if declared(BIO_new_dgram_introduced)} + if LibVersion < BIO_new_dgram_introduced then + begin + {$if declared(FC_BIO_new_dgram)} + BIO_new_dgram := @FC_BIO_new_dgram; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_new_dgram_removed)} + if BIO_new_dgram_removed <= LibVersion then + begin + {$if declared(_BIO_new_dgram)} + BIO_new_dgram := @_BIO_new_dgram; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_new_dgram_allownil)} + if FuncLoadError then + AFailed.Add('BIO_new_dgram'); + {$ifend} + end; + + + BIO_sock_should_retry := LoadLibFunction(ADllHandle, BIO_sock_should_retry_procname); + FuncLoadError := not assigned(BIO_sock_should_retry); + if FuncLoadError then + begin + {$if not defined(BIO_sock_should_retry_allownil)} + BIO_sock_should_retry := @ERR_BIO_sock_should_retry; + {$ifend} + {$if declared(BIO_sock_should_retry_introduced)} + if LibVersion < BIO_sock_should_retry_introduced then + begin + {$if declared(FC_BIO_sock_should_retry)} + BIO_sock_should_retry := @FC_BIO_sock_should_retry; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_sock_should_retry_removed)} + if BIO_sock_should_retry_removed <= LibVersion then + begin + {$if declared(_BIO_sock_should_retry)} + BIO_sock_should_retry := @_BIO_sock_should_retry; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_sock_should_retry_allownil)} + if FuncLoadError then + AFailed.Add('BIO_sock_should_retry'); + {$ifend} + end; + + + BIO_sock_non_fatal_error := LoadLibFunction(ADllHandle, BIO_sock_non_fatal_error_procname); + FuncLoadError := not assigned(BIO_sock_non_fatal_error); + if FuncLoadError then + begin + {$if not defined(BIO_sock_non_fatal_error_allownil)} + BIO_sock_non_fatal_error := @ERR_BIO_sock_non_fatal_error; + {$ifend} + {$if declared(BIO_sock_non_fatal_error_introduced)} + if LibVersion < BIO_sock_non_fatal_error_introduced then + begin + {$if declared(FC_BIO_sock_non_fatal_error)} + BIO_sock_non_fatal_error := @FC_BIO_sock_non_fatal_error; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_sock_non_fatal_error_removed)} + if BIO_sock_non_fatal_error_removed <= LibVersion then + begin + {$if declared(_BIO_sock_non_fatal_error)} + BIO_sock_non_fatal_error := @_BIO_sock_non_fatal_error; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_sock_non_fatal_error_allownil)} + if FuncLoadError then + AFailed.Add('BIO_sock_non_fatal_error'); + {$ifend} + end; + + + BIO_fd_should_retry := LoadLibFunction(ADllHandle, BIO_fd_should_retry_procname); + FuncLoadError := not assigned(BIO_fd_should_retry); + if FuncLoadError then + begin + {$if not defined(BIO_fd_should_retry_allownil)} + BIO_fd_should_retry := @ERR_BIO_fd_should_retry; + {$ifend} + {$if declared(BIO_fd_should_retry_introduced)} + if LibVersion < BIO_fd_should_retry_introduced then + begin + {$if declared(FC_BIO_fd_should_retry)} + BIO_fd_should_retry := @FC_BIO_fd_should_retry; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_fd_should_retry_removed)} + if BIO_fd_should_retry_removed <= LibVersion then + begin + {$if declared(_BIO_fd_should_retry)} + BIO_fd_should_retry := @_BIO_fd_should_retry; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_fd_should_retry_allownil)} + if FuncLoadError then + AFailed.Add('BIO_fd_should_retry'); + {$ifend} + end; + + + BIO_fd_non_fatal_error := LoadLibFunction(ADllHandle, BIO_fd_non_fatal_error_procname); + FuncLoadError := not assigned(BIO_fd_non_fatal_error); + if FuncLoadError then + begin + {$if not defined(BIO_fd_non_fatal_error_allownil)} + BIO_fd_non_fatal_error := @ERR_BIO_fd_non_fatal_error; + {$ifend} + {$if declared(BIO_fd_non_fatal_error_introduced)} + if LibVersion < BIO_fd_non_fatal_error_introduced then + begin + {$if declared(FC_BIO_fd_non_fatal_error)} + BIO_fd_non_fatal_error := @FC_BIO_fd_non_fatal_error; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_fd_non_fatal_error_removed)} + if BIO_fd_non_fatal_error_removed <= LibVersion then + begin + {$if declared(_BIO_fd_non_fatal_error)} + BIO_fd_non_fatal_error := @_BIO_fd_non_fatal_error; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_fd_non_fatal_error_allownil)} + if FuncLoadError then + AFailed.Add('BIO_fd_non_fatal_error'); + {$ifend} + end; + + + BIO_dump := LoadLibFunction(ADllHandle, BIO_dump_procname); + FuncLoadError := not assigned(BIO_dump); + if FuncLoadError then + begin + {$if not defined(BIO_dump_allownil)} + BIO_dump := @ERR_BIO_dump; + {$ifend} + {$if declared(BIO_dump_introduced)} + if LibVersion < BIO_dump_introduced then + begin + {$if declared(FC_BIO_dump)} + BIO_dump := @FC_BIO_dump; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_dump_removed)} + if BIO_dump_removed <= LibVersion then + begin + {$if declared(_BIO_dump)} + BIO_dump := @_BIO_dump; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_dump_allownil)} + if FuncLoadError then + AFailed.Add('BIO_dump'); + {$ifend} + end; + + + BIO_dump_indent := LoadLibFunction(ADllHandle, BIO_dump_indent_procname); + FuncLoadError := not assigned(BIO_dump_indent); + if FuncLoadError then + begin + {$if not defined(BIO_dump_indent_allownil)} + BIO_dump_indent := @ERR_BIO_dump_indent; + {$ifend} + {$if declared(BIO_dump_indent_introduced)} + if LibVersion < BIO_dump_indent_introduced then + begin + {$if declared(FC_BIO_dump_indent)} + BIO_dump_indent := @FC_BIO_dump_indent; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_dump_indent_removed)} + if BIO_dump_indent_removed <= LibVersion then + begin + {$if declared(_BIO_dump_indent)} + BIO_dump_indent := @_BIO_dump_indent; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_dump_indent_allownil)} + if FuncLoadError then + AFailed.Add('BIO_dump_indent'); + {$ifend} + end; + + + BIO_hex_string := LoadLibFunction(ADllHandle, BIO_hex_string_procname); + FuncLoadError := not assigned(BIO_hex_string); + if FuncLoadError then + begin + {$if not defined(BIO_hex_string_allownil)} + BIO_hex_string := @ERR_BIO_hex_string; + {$ifend} + {$if declared(BIO_hex_string_introduced)} + if LibVersion < BIO_hex_string_introduced then + begin + {$if declared(FC_BIO_hex_string)} + BIO_hex_string := @FC_BIO_hex_string; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_hex_string_removed)} + if BIO_hex_string_removed <= LibVersion then + begin + {$if declared(_BIO_hex_string)} + BIO_hex_string := @_BIO_hex_string; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_hex_string_allownil)} + if FuncLoadError then + AFailed.Add('BIO_hex_string'); + {$ifend} + end; + + + BIO_ADDR_new := LoadLibFunction(ADllHandle, BIO_ADDR_new_procname); + FuncLoadError := not assigned(BIO_ADDR_new); + if FuncLoadError then + begin + {$if not defined(BIO_ADDR_new_allownil)} + BIO_ADDR_new := @ERR_BIO_ADDR_new; + {$ifend} + {$if declared(BIO_ADDR_new_introduced)} + if LibVersion < BIO_ADDR_new_introduced then + begin + {$if declared(FC_BIO_ADDR_new)} + BIO_ADDR_new := @FC_BIO_ADDR_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_ADDR_new_removed)} + if BIO_ADDR_new_removed <= LibVersion then + begin + {$if declared(_BIO_ADDR_new)} + BIO_ADDR_new := @_BIO_ADDR_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_ADDR_new_allownil)} + if FuncLoadError then + AFailed.Add('BIO_ADDR_new'); + {$ifend} + end; + + {introduced 1.1.0} + BIO_ADDR_rawmake := LoadLibFunction(ADllHandle, BIO_ADDR_rawmake_procname); + FuncLoadError := not assigned(BIO_ADDR_rawmake); + if FuncLoadError then + begin + {$if not defined(BIO_ADDR_rawmake_allownil)} + BIO_ADDR_rawmake := @ERR_BIO_ADDR_rawmake; + {$ifend} + {$if declared(BIO_ADDR_rawmake_introduced)} + if LibVersion < BIO_ADDR_rawmake_introduced then + begin + {$if declared(FC_BIO_ADDR_rawmake)} + BIO_ADDR_rawmake := @FC_BIO_ADDR_rawmake; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_ADDR_rawmake_removed)} + if BIO_ADDR_rawmake_removed <= LibVersion then + begin + {$if declared(_BIO_ADDR_rawmake)} + BIO_ADDR_rawmake := @_BIO_ADDR_rawmake; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_ADDR_rawmake_allownil)} + if FuncLoadError then + AFailed.Add('BIO_ADDR_rawmake'); + {$ifend} + end; + + {introduced 1.1.0} + BIO_ADDR_free := LoadLibFunction(ADllHandle, BIO_ADDR_free_procname); + FuncLoadError := not assigned(BIO_ADDR_free); + if FuncLoadError then + begin + {$if not defined(BIO_ADDR_free_allownil)} + BIO_ADDR_free := @ERR_BIO_ADDR_free; + {$ifend} + {$if declared(BIO_ADDR_free_introduced)} + if LibVersion < BIO_ADDR_free_introduced then + begin + {$if declared(FC_BIO_ADDR_free)} + BIO_ADDR_free := @FC_BIO_ADDR_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_ADDR_free_removed)} + if BIO_ADDR_free_removed <= LibVersion then + begin + {$if declared(_BIO_ADDR_free)} + BIO_ADDR_free := @_BIO_ADDR_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_ADDR_free_allownil)} + if FuncLoadError then + AFailed.Add('BIO_ADDR_free'); + {$ifend} + end; + + {introduced 1.1.0} + BIO_ADDR_clear := LoadLibFunction(ADllHandle, BIO_ADDR_clear_procname); + FuncLoadError := not assigned(BIO_ADDR_clear); + if FuncLoadError then + begin + {$if not defined(BIO_ADDR_clear_allownil)} + BIO_ADDR_clear := @ERR_BIO_ADDR_clear; + {$ifend} + {$if declared(BIO_ADDR_clear_introduced)} + if LibVersion < BIO_ADDR_clear_introduced then + begin + {$if declared(FC_BIO_ADDR_clear)} + BIO_ADDR_clear := @FC_BIO_ADDR_clear; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_ADDR_clear_removed)} + if BIO_ADDR_clear_removed <= LibVersion then + begin + {$if declared(_BIO_ADDR_clear)} + BIO_ADDR_clear := @_BIO_ADDR_clear; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_ADDR_clear_allownil)} + if FuncLoadError then + AFailed.Add('BIO_ADDR_clear'); + {$ifend} + end; + + {introduced 1.1.0} + BIO_ADDR_family := LoadLibFunction(ADllHandle, BIO_ADDR_family_procname); + FuncLoadError := not assigned(BIO_ADDR_family); + if FuncLoadError then + begin + {$if not defined(BIO_ADDR_family_allownil)} + BIO_ADDR_family := @ERR_BIO_ADDR_family; + {$ifend} + {$if declared(BIO_ADDR_family_introduced)} + if LibVersion < BIO_ADDR_family_introduced then + begin + {$if declared(FC_BIO_ADDR_family)} + BIO_ADDR_family := @FC_BIO_ADDR_family; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_ADDR_family_removed)} + if BIO_ADDR_family_removed <= LibVersion then + begin + {$if declared(_BIO_ADDR_family)} + BIO_ADDR_family := @_BIO_ADDR_family; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_ADDR_family_allownil)} + if FuncLoadError then + AFailed.Add('BIO_ADDR_family'); + {$ifend} + end; + + {introduced 1.1.0} + BIO_ADDR_rawaddress := LoadLibFunction(ADllHandle, BIO_ADDR_rawaddress_procname); + FuncLoadError := not assigned(BIO_ADDR_rawaddress); + if FuncLoadError then + begin + {$if not defined(BIO_ADDR_rawaddress_allownil)} + BIO_ADDR_rawaddress := @ERR_BIO_ADDR_rawaddress; + {$ifend} + {$if declared(BIO_ADDR_rawaddress_introduced)} + if LibVersion < BIO_ADDR_rawaddress_introduced then + begin + {$if declared(FC_BIO_ADDR_rawaddress)} + BIO_ADDR_rawaddress := @FC_BIO_ADDR_rawaddress; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_ADDR_rawaddress_removed)} + if BIO_ADDR_rawaddress_removed <= LibVersion then + begin + {$if declared(_BIO_ADDR_rawaddress)} + BIO_ADDR_rawaddress := @_BIO_ADDR_rawaddress; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_ADDR_rawaddress_allownil)} + if FuncLoadError then + AFailed.Add('BIO_ADDR_rawaddress'); + {$ifend} + end; + + {introduced 1.1.0} + BIO_ADDR_rawport := LoadLibFunction(ADllHandle, BIO_ADDR_rawport_procname); + FuncLoadError := not assigned(BIO_ADDR_rawport); + if FuncLoadError then + begin + {$if not defined(BIO_ADDR_rawport_allownil)} + BIO_ADDR_rawport := @ERR_BIO_ADDR_rawport; + {$ifend} + {$if declared(BIO_ADDR_rawport_introduced)} + if LibVersion < BIO_ADDR_rawport_introduced then + begin + {$if declared(FC_BIO_ADDR_rawport)} + BIO_ADDR_rawport := @FC_BIO_ADDR_rawport; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_ADDR_rawport_removed)} + if BIO_ADDR_rawport_removed <= LibVersion then + begin + {$if declared(_BIO_ADDR_rawport)} + BIO_ADDR_rawport := @_BIO_ADDR_rawport; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_ADDR_rawport_allownil)} + if FuncLoadError then + AFailed.Add('BIO_ADDR_rawport'); + {$ifend} + end; + + {introduced 1.1.0} + BIO_ADDR_hostname_string := LoadLibFunction(ADllHandle, BIO_ADDR_hostname_string_procname); + FuncLoadError := not assigned(BIO_ADDR_hostname_string); + if FuncLoadError then + begin + {$if not defined(BIO_ADDR_hostname_string_allownil)} + BIO_ADDR_hostname_string := @ERR_BIO_ADDR_hostname_string; + {$ifend} + {$if declared(BIO_ADDR_hostname_string_introduced)} + if LibVersion < BIO_ADDR_hostname_string_introduced then + begin + {$if declared(FC_BIO_ADDR_hostname_string)} + BIO_ADDR_hostname_string := @FC_BIO_ADDR_hostname_string; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_ADDR_hostname_string_removed)} + if BIO_ADDR_hostname_string_removed <= LibVersion then + begin + {$if declared(_BIO_ADDR_hostname_string)} + BIO_ADDR_hostname_string := @_BIO_ADDR_hostname_string; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_ADDR_hostname_string_allownil)} + if FuncLoadError then + AFailed.Add('BIO_ADDR_hostname_string'); + {$ifend} + end; + + {introduced 1.1.0} + BIO_ADDR_service_string := LoadLibFunction(ADllHandle, BIO_ADDR_service_string_procname); + FuncLoadError := not assigned(BIO_ADDR_service_string); + if FuncLoadError then + begin + {$if not defined(BIO_ADDR_service_string_allownil)} + BIO_ADDR_service_string := @ERR_BIO_ADDR_service_string; + {$ifend} + {$if declared(BIO_ADDR_service_string_introduced)} + if LibVersion < BIO_ADDR_service_string_introduced then + begin + {$if declared(FC_BIO_ADDR_service_string)} + BIO_ADDR_service_string := @FC_BIO_ADDR_service_string; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_ADDR_service_string_removed)} + if BIO_ADDR_service_string_removed <= LibVersion then + begin + {$if declared(_BIO_ADDR_service_string)} + BIO_ADDR_service_string := @_BIO_ADDR_service_string; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_ADDR_service_string_allownil)} + if FuncLoadError then + AFailed.Add('BIO_ADDR_service_string'); + {$ifend} + end; + + {introduced 1.1.0} + BIO_ADDR_path_string := LoadLibFunction(ADllHandle, BIO_ADDR_path_string_procname); + FuncLoadError := not assigned(BIO_ADDR_path_string); + if FuncLoadError then + begin + {$if not defined(BIO_ADDR_path_string_allownil)} + BIO_ADDR_path_string := @ERR_BIO_ADDR_path_string; + {$ifend} + {$if declared(BIO_ADDR_path_string_introduced)} + if LibVersion < BIO_ADDR_path_string_introduced then + begin + {$if declared(FC_BIO_ADDR_path_string)} + BIO_ADDR_path_string := @FC_BIO_ADDR_path_string; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_ADDR_path_string_removed)} + if BIO_ADDR_path_string_removed <= LibVersion then + begin + {$if declared(_BIO_ADDR_path_string)} + BIO_ADDR_path_string := @_BIO_ADDR_path_string; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_ADDR_path_string_allownil)} + if FuncLoadError then + AFailed.Add('BIO_ADDR_path_string'); + {$ifend} + end; + + {introduced 1.1.0} + BIO_ADDRINFO_next := LoadLibFunction(ADllHandle, BIO_ADDRINFO_next_procname); + FuncLoadError := not assigned(BIO_ADDRINFO_next); + if FuncLoadError then + begin + {$if not defined(BIO_ADDRINFO_next_allownil)} + BIO_ADDRINFO_next := @ERR_BIO_ADDRINFO_next; + {$ifend} + {$if declared(BIO_ADDRINFO_next_introduced)} + if LibVersion < BIO_ADDRINFO_next_introduced then + begin + {$if declared(FC_BIO_ADDRINFO_next)} + BIO_ADDRINFO_next := @FC_BIO_ADDRINFO_next; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_ADDRINFO_next_removed)} + if BIO_ADDRINFO_next_removed <= LibVersion then + begin + {$if declared(_BIO_ADDRINFO_next)} + BIO_ADDRINFO_next := @_BIO_ADDRINFO_next; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_ADDRINFO_next_allownil)} + if FuncLoadError then + AFailed.Add('BIO_ADDRINFO_next'); + {$ifend} + end; + + {introduced 1.1.0} + BIO_ADDRINFO_family := LoadLibFunction(ADllHandle, BIO_ADDRINFO_family_procname); + FuncLoadError := not assigned(BIO_ADDRINFO_family); + if FuncLoadError then + begin + {$if not defined(BIO_ADDRINFO_family_allownil)} + BIO_ADDRINFO_family := @ERR_BIO_ADDRINFO_family; + {$ifend} + {$if declared(BIO_ADDRINFO_family_introduced)} + if LibVersion < BIO_ADDRINFO_family_introduced then + begin + {$if declared(FC_BIO_ADDRINFO_family)} + BIO_ADDRINFO_family := @FC_BIO_ADDRINFO_family; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_ADDRINFO_family_removed)} + if BIO_ADDRINFO_family_removed <= LibVersion then + begin + {$if declared(_BIO_ADDRINFO_family)} + BIO_ADDRINFO_family := @_BIO_ADDRINFO_family; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_ADDRINFO_family_allownil)} + if FuncLoadError then + AFailed.Add('BIO_ADDRINFO_family'); + {$ifend} + end; + + {introduced 1.1.0} + BIO_ADDRINFO_socktype := LoadLibFunction(ADllHandle, BIO_ADDRINFO_socktype_procname); + FuncLoadError := not assigned(BIO_ADDRINFO_socktype); + if FuncLoadError then + begin + {$if not defined(BIO_ADDRINFO_socktype_allownil)} + BIO_ADDRINFO_socktype := @ERR_BIO_ADDRINFO_socktype; + {$ifend} + {$if declared(BIO_ADDRINFO_socktype_introduced)} + if LibVersion < BIO_ADDRINFO_socktype_introduced then + begin + {$if declared(FC_BIO_ADDRINFO_socktype)} + BIO_ADDRINFO_socktype := @FC_BIO_ADDRINFO_socktype; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_ADDRINFO_socktype_removed)} + if BIO_ADDRINFO_socktype_removed <= LibVersion then + begin + {$if declared(_BIO_ADDRINFO_socktype)} + BIO_ADDRINFO_socktype := @_BIO_ADDRINFO_socktype; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_ADDRINFO_socktype_allownil)} + if FuncLoadError then + AFailed.Add('BIO_ADDRINFO_socktype'); + {$ifend} + end; + + {introduced 1.1.0} + BIO_ADDRINFO_protocol := LoadLibFunction(ADllHandle, BIO_ADDRINFO_protocol_procname); + FuncLoadError := not assigned(BIO_ADDRINFO_protocol); + if FuncLoadError then + begin + {$if not defined(BIO_ADDRINFO_protocol_allownil)} + BIO_ADDRINFO_protocol := @ERR_BIO_ADDRINFO_protocol; + {$ifend} + {$if declared(BIO_ADDRINFO_protocol_introduced)} + if LibVersion < BIO_ADDRINFO_protocol_introduced then + begin + {$if declared(FC_BIO_ADDRINFO_protocol)} + BIO_ADDRINFO_protocol := @FC_BIO_ADDRINFO_protocol; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_ADDRINFO_protocol_removed)} + if BIO_ADDRINFO_protocol_removed <= LibVersion then + begin + {$if declared(_BIO_ADDRINFO_protocol)} + BIO_ADDRINFO_protocol := @_BIO_ADDRINFO_protocol; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_ADDRINFO_protocol_allownil)} + if FuncLoadError then + AFailed.Add('BIO_ADDRINFO_protocol'); + {$ifend} + end; + + {introduced 1.1.0} + BIO_ADDRINFO_address := LoadLibFunction(ADllHandle, BIO_ADDRINFO_address_procname); + FuncLoadError := not assigned(BIO_ADDRINFO_address); + if FuncLoadError then + begin + {$if not defined(BIO_ADDRINFO_address_allownil)} + BIO_ADDRINFO_address := @ERR_BIO_ADDRINFO_address; + {$ifend} + {$if declared(BIO_ADDRINFO_address_introduced)} + if LibVersion < BIO_ADDRINFO_address_introduced then + begin + {$if declared(FC_BIO_ADDRINFO_address)} + BIO_ADDRINFO_address := @FC_BIO_ADDRINFO_address; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_ADDRINFO_address_removed)} + if BIO_ADDRINFO_address_removed <= LibVersion then + begin + {$if declared(_BIO_ADDRINFO_address)} + BIO_ADDRINFO_address := @_BIO_ADDRINFO_address; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_ADDRINFO_address_allownil)} + if FuncLoadError then + AFailed.Add('BIO_ADDRINFO_address'); + {$ifend} + end; + + {introduced 1.1.0} + BIO_ADDRINFO_free := LoadLibFunction(ADllHandle, BIO_ADDRINFO_free_procname); + FuncLoadError := not assigned(BIO_ADDRINFO_free); + if FuncLoadError then + begin + {$if not defined(BIO_ADDRINFO_free_allownil)} + BIO_ADDRINFO_free := @ERR_BIO_ADDRINFO_free; + {$ifend} + {$if declared(BIO_ADDRINFO_free_introduced)} + if LibVersion < BIO_ADDRINFO_free_introduced then + begin + {$if declared(FC_BIO_ADDRINFO_free)} + BIO_ADDRINFO_free := @FC_BIO_ADDRINFO_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_ADDRINFO_free_removed)} + if BIO_ADDRINFO_free_removed <= LibVersion then + begin + {$if declared(_BIO_ADDRINFO_free)} + BIO_ADDRINFO_free := @_BIO_ADDRINFO_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_ADDRINFO_free_allownil)} + if FuncLoadError then + AFailed.Add('BIO_ADDRINFO_free'); + {$ifend} + end; + + {introduced 1.1.0} + BIO_parse_hostserv := LoadLibFunction(ADllHandle, BIO_parse_hostserv_procname); + FuncLoadError := not assigned(BIO_parse_hostserv); + if FuncLoadError then + begin + {$if not defined(BIO_parse_hostserv_allownil)} + BIO_parse_hostserv := @ERR_BIO_parse_hostserv; + {$ifend} + {$if declared(BIO_parse_hostserv_introduced)} + if LibVersion < BIO_parse_hostserv_introduced then + begin + {$if declared(FC_BIO_parse_hostserv)} + BIO_parse_hostserv := @FC_BIO_parse_hostserv; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_parse_hostserv_removed)} + if BIO_parse_hostserv_removed <= LibVersion then + begin + {$if declared(_BIO_parse_hostserv)} + BIO_parse_hostserv := @_BIO_parse_hostserv; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_parse_hostserv_allownil)} + if FuncLoadError then + AFailed.Add('BIO_parse_hostserv'); + {$ifend} + end; + + {introduced 1.1.0} + BIO_lookup := LoadLibFunction(ADllHandle, BIO_lookup_procname); + FuncLoadError := not assigned(BIO_lookup); + if FuncLoadError then + begin + {$if not defined(BIO_lookup_allownil)} + BIO_lookup := @ERR_BIO_lookup; + {$ifend} + {$if declared(BIO_lookup_introduced)} + if LibVersion < BIO_lookup_introduced then + begin + {$if declared(FC_BIO_lookup)} + BIO_lookup := @FC_BIO_lookup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_lookup_removed)} + if BIO_lookup_removed <= LibVersion then + begin + {$if declared(_BIO_lookup)} + BIO_lookup := @_BIO_lookup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_lookup_allownil)} + if FuncLoadError then + AFailed.Add('BIO_lookup'); + {$ifend} + end; + + {introduced 1.1.0} + BIO_lookup_ex := LoadLibFunction(ADllHandle, BIO_lookup_ex_procname); + FuncLoadError := not assigned(BIO_lookup_ex); + if FuncLoadError then + begin + {$if not defined(BIO_lookup_ex_allownil)} + BIO_lookup_ex := @ERR_BIO_lookup_ex; + {$ifend} + {$if declared(BIO_lookup_ex_introduced)} + if LibVersion < BIO_lookup_ex_introduced then + begin + {$if declared(FC_BIO_lookup_ex)} + BIO_lookup_ex := @FC_BIO_lookup_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_lookup_ex_removed)} + if BIO_lookup_ex_removed <= LibVersion then + begin + {$if declared(_BIO_lookup_ex)} + BIO_lookup_ex := @_BIO_lookup_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_lookup_ex_allownil)} + if FuncLoadError then + AFailed.Add('BIO_lookup_ex'); + {$ifend} + end; + + {introduced 1.1.0} + BIO_sock_error := LoadLibFunction(ADllHandle, BIO_sock_error_procname); + FuncLoadError := not assigned(BIO_sock_error); + if FuncLoadError then + begin + {$if not defined(BIO_sock_error_allownil)} + BIO_sock_error := @ERR_BIO_sock_error; + {$ifend} + {$if declared(BIO_sock_error_introduced)} + if LibVersion < BIO_sock_error_introduced then + begin + {$if declared(FC_BIO_sock_error)} + BIO_sock_error := @FC_BIO_sock_error; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_sock_error_removed)} + if BIO_sock_error_removed <= LibVersion then + begin + {$if declared(_BIO_sock_error)} + BIO_sock_error := @_BIO_sock_error; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_sock_error_allownil)} + if FuncLoadError then + AFailed.Add('BIO_sock_error'); + {$ifend} + end; + + + BIO_socket_ioctl := LoadLibFunction(ADllHandle, BIO_socket_ioctl_procname); + FuncLoadError := not assigned(BIO_socket_ioctl); + if FuncLoadError then + begin + {$if not defined(BIO_socket_ioctl_allownil)} + BIO_socket_ioctl := @ERR_BIO_socket_ioctl; + {$ifend} + {$if declared(BIO_socket_ioctl_introduced)} + if LibVersion < BIO_socket_ioctl_introduced then + begin + {$if declared(FC_BIO_socket_ioctl)} + BIO_socket_ioctl := @FC_BIO_socket_ioctl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_socket_ioctl_removed)} + if BIO_socket_ioctl_removed <= LibVersion then + begin + {$if declared(_BIO_socket_ioctl)} + BIO_socket_ioctl := @_BIO_socket_ioctl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_socket_ioctl_allownil)} + if FuncLoadError then + AFailed.Add('BIO_socket_ioctl'); + {$ifend} + end; + + + BIO_socket_nbio := LoadLibFunction(ADllHandle, BIO_socket_nbio_procname); + FuncLoadError := not assigned(BIO_socket_nbio); + if FuncLoadError then + begin + {$if not defined(BIO_socket_nbio_allownil)} + BIO_socket_nbio := @ERR_BIO_socket_nbio; + {$ifend} + {$if declared(BIO_socket_nbio_introduced)} + if LibVersion < BIO_socket_nbio_introduced then + begin + {$if declared(FC_BIO_socket_nbio)} + BIO_socket_nbio := @FC_BIO_socket_nbio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_socket_nbio_removed)} + if BIO_socket_nbio_removed <= LibVersion then + begin + {$if declared(_BIO_socket_nbio)} + BIO_socket_nbio := @_BIO_socket_nbio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_socket_nbio_allownil)} + if FuncLoadError then + AFailed.Add('BIO_socket_nbio'); + {$ifend} + end; + + + BIO_sock_init := LoadLibFunction(ADllHandle, BIO_sock_init_procname); + FuncLoadError := not assigned(BIO_sock_init); + if FuncLoadError then + begin + {$if not defined(BIO_sock_init_allownil)} + BIO_sock_init := @ERR_BIO_sock_init; + {$ifend} + {$if declared(BIO_sock_init_introduced)} + if LibVersion < BIO_sock_init_introduced then + begin + {$if declared(FC_BIO_sock_init)} + BIO_sock_init := @FC_BIO_sock_init; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_sock_init_removed)} + if BIO_sock_init_removed <= LibVersion then + begin + {$if declared(_BIO_sock_init)} + BIO_sock_init := @_BIO_sock_init; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_sock_init_allownil)} + if FuncLoadError then + AFailed.Add('BIO_sock_init'); + {$ifend} + end; + + + BIO_set_tcp_ndelay := LoadLibFunction(ADllHandle, BIO_set_tcp_ndelay_procname); + FuncLoadError := not assigned(BIO_set_tcp_ndelay); + if FuncLoadError then + begin + {$if not defined(BIO_set_tcp_ndelay_allownil)} + BIO_set_tcp_ndelay := @ERR_BIO_set_tcp_ndelay; + {$ifend} + {$if declared(BIO_set_tcp_ndelay_introduced)} + if LibVersion < BIO_set_tcp_ndelay_introduced then + begin + {$if declared(FC_BIO_set_tcp_ndelay)} + BIO_set_tcp_ndelay := @FC_BIO_set_tcp_ndelay; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_set_tcp_ndelay_removed)} + if BIO_set_tcp_ndelay_removed <= LibVersion then + begin + {$if declared(_BIO_set_tcp_ndelay)} + BIO_set_tcp_ndelay := @_BIO_set_tcp_ndelay; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_set_tcp_ndelay_allownil)} + if FuncLoadError then + AFailed.Add('BIO_set_tcp_ndelay'); + {$ifend} + end; + + + BIO_sock_info := LoadLibFunction(ADllHandle, BIO_sock_info_procname); + FuncLoadError := not assigned(BIO_sock_info); + if FuncLoadError then + begin + {$if not defined(BIO_sock_info_allownil)} + BIO_sock_info := @ERR_BIO_sock_info; + {$ifend} + {$if declared(BIO_sock_info_introduced)} + if LibVersion < BIO_sock_info_introduced then + begin + {$if declared(FC_BIO_sock_info)} + BIO_sock_info := @FC_BIO_sock_info; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_sock_info_removed)} + if BIO_sock_info_removed <= LibVersion then + begin + {$if declared(_BIO_sock_info)} + BIO_sock_info := @_BIO_sock_info; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_sock_info_allownil)} + if FuncLoadError then + AFailed.Add('BIO_sock_info'); + {$ifend} + end; + + {introduced 1.1.0} + BIO_socket := LoadLibFunction(ADllHandle, BIO_socket_procname); + FuncLoadError := not assigned(BIO_socket); + if FuncLoadError then + begin + {$if not defined(BIO_socket_allownil)} + BIO_socket := @ERR_BIO_socket; + {$ifend} + {$if declared(BIO_socket_introduced)} + if LibVersion < BIO_socket_introduced then + begin + {$if declared(FC_BIO_socket)} + BIO_socket := @FC_BIO_socket; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_socket_removed)} + if BIO_socket_removed <= LibVersion then + begin + {$if declared(_BIO_socket)} + BIO_socket := @_BIO_socket; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_socket_allownil)} + if FuncLoadError then + AFailed.Add('BIO_socket'); + {$ifend} + end; + + {introduced 1.1.0} + BIO_connect := LoadLibFunction(ADllHandle, BIO_connect_procname); + FuncLoadError := not assigned(BIO_connect); + if FuncLoadError then + begin + {$if not defined(BIO_connect_allownil)} + BIO_connect := @ERR_BIO_connect; + {$ifend} + {$if declared(BIO_connect_introduced)} + if LibVersion < BIO_connect_introduced then + begin + {$if declared(FC_BIO_connect)} + BIO_connect := @FC_BIO_connect; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_connect_removed)} + if BIO_connect_removed <= LibVersion then + begin + {$if declared(_BIO_connect)} + BIO_connect := @_BIO_connect; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_connect_allownil)} + if FuncLoadError then + AFailed.Add('BIO_connect'); + {$ifend} + end; + + {introduced 1.1.0} + BIO_bind := LoadLibFunction(ADllHandle, BIO_bind_procname); + FuncLoadError := not assigned(BIO_bind); + if FuncLoadError then + begin + {$if not defined(BIO_bind_allownil)} + BIO_bind := @ERR_BIO_bind; + {$ifend} + {$if declared(BIO_bind_introduced)} + if LibVersion < BIO_bind_introduced then + begin + {$if declared(FC_BIO_bind)} + BIO_bind := @FC_BIO_bind; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_bind_removed)} + if BIO_bind_removed <= LibVersion then + begin + {$if declared(_BIO_bind)} + BIO_bind := @_BIO_bind; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_bind_allownil)} + if FuncLoadError then + AFailed.Add('BIO_bind'); + {$ifend} + end; + + {introduced 1.1.0} + BIO_listen := LoadLibFunction(ADllHandle, BIO_listen_procname); + FuncLoadError := not assigned(BIO_listen); + if FuncLoadError then + begin + {$if not defined(BIO_listen_allownil)} + BIO_listen := @ERR_BIO_listen; + {$ifend} + {$if declared(BIO_listen_introduced)} + if LibVersion < BIO_listen_introduced then + begin + {$if declared(FC_BIO_listen)} + BIO_listen := @FC_BIO_listen; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_listen_removed)} + if BIO_listen_removed <= LibVersion then + begin + {$if declared(_BIO_listen)} + BIO_listen := @_BIO_listen; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_listen_allownil)} + if FuncLoadError then + AFailed.Add('BIO_listen'); + {$ifend} + end; + + {introduced 1.1.0} + BIO_accept_ex := LoadLibFunction(ADllHandle, BIO_accept_ex_procname); + FuncLoadError := not assigned(BIO_accept_ex); + if FuncLoadError then + begin + {$if not defined(BIO_accept_ex_allownil)} + BIO_accept_ex := @ERR_BIO_accept_ex; + {$ifend} + {$if declared(BIO_accept_ex_introduced)} + if LibVersion < BIO_accept_ex_introduced then + begin + {$if declared(FC_BIO_accept_ex)} + BIO_accept_ex := @FC_BIO_accept_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_accept_ex_removed)} + if BIO_accept_ex_removed <= LibVersion then + begin + {$if declared(_BIO_accept_ex)} + BIO_accept_ex := @_BIO_accept_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_accept_ex_allownil)} + if FuncLoadError then + AFailed.Add('BIO_accept_ex'); + {$ifend} + end; + + {introduced 1.1.0} + BIO_closesocket := LoadLibFunction(ADllHandle, BIO_closesocket_procname); + FuncLoadError := not assigned(BIO_closesocket); + if FuncLoadError then + begin + {$if not defined(BIO_closesocket_allownil)} + BIO_closesocket := @ERR_BIO_closesocket; + {$ifend} + {$if declared(BIO_closesocket_introduced)} + if LibVersion < BIO_closesocket_introduced then + begin + {$if declared(FC_BIO_closesocket)} + BIO_closesocket := @FC_BIO_closesocket; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_closesocket_removed)} + if BIO_closesocket_removed <= LibVersion then + begin + {$if declared(_BIO_closesocket)} + BIO_closesocket := @_BIO_closesocket; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_closesocket_allownil)} + if FuncLoadError then + AFailed.Add('BIO_closesocket'); + {$ifend} + end; + + {introduced 1.1.0} + BIO_new_socket := LoadLibFunction(ADllHandle, BIO_new_socket_procname); + FuncLoadError := not assigned(BIO_new_socket); + if FuncLoadError then + begin + {$if not defined(BIO_new_socket_allownil)} + BIO_new_socket := @ERR_BIO_new_socket; + {$ifend} + {$if declared(BIO_new_socket_introduced)} + if LibVersion < BIO_new_socket_introduced then + begin + {$if declared(FC_BIO_new_socket)} + BIO_new_socket := @FC_BIO_new_socket; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_new_socket_removed)} + if BIO_new_socket_removed <= LibVersion then + begin + {$if declared(_BIO_new_socket)} + BIO_new_socket := @_BIO_new_socket; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_new_socket_allownil)} + if FuncLoadError then + AFailed.Add('BIO_new_socket'); + {$ifend} + end; + + + BIO_new_connect := LoadLibFunction(ADllHandle, BIO_new_connect_procname); + FuncLoadError := not assigned(BIO_new_connect); + if FuncLoadError then + begin + {$if not defined(BIO_new_connect_allownil)} + BIO_new_connect := @ERR_BIO_new_connect; + {$ifend} + {$if declared(BIO_new_connect_introduced)} + if LibVersion < BIO_new_connect_introduced then + begin + {$if declared(FC_BIO_new_connect)} + BIO_new_connect := @FC_BIO_new_connect; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_new_connect_removed)} + if BIO_new_connect_removed <= LibVersion then + begin + {$if declared(_BIO_new_connect)} + BIO_new_connect := @_BIO_new_connect; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_new_connect_allownil)} + if FuncLoadError then + AFailed.Add('BIO_new_connect'); + {$ifend} + end; + + + BIO_new_accept := LoadLibFunction(ADllHandle, BIO_new_accept_procname); + FuncLoadError := not assigned(BIO_new_accept); + if FuncLoadError then + begin + {$if not defined(BIO_new_accept_allownil)} + BIO_new_accept := @ERR_BIO_new_accept; + {$ifend} + {$if declared(BIO_new_accept_introduced)} + if LibVersion < BIO_new_accept_introduced then + begin + {$if declared(FC_BIO_new_accept)} + BIO_new_accept := @FC_BIO_new_accept; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_new_accept_removed)} + if BIO_new_accept_removed <= LibVersion then + begin + {$if declared(_BIO_new_accept)} + BIO_new_accept := @_BIO_new_accept; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_new_accept_allownil)} + if FuncLoadError then + AFailed.Add('BIO_new_accept'); + {$ifend} + end; + + + BIO_new_fd := LoadLibFunction(ADllHandle, BIO_new_fd_procname); + FuncLoadError := not assigned(BIO_new_fd); + if FuncLoadError then + begin + {$if not defined(BIO_new_fd_allownil)} + BIO_new_fd := @ERR_BIO_new_fd; + {$ifend} + {$if declared(BIO_new_fd_introduced)} + if LibVersion < BIO_new_fd_introduced then + begin + {$if declared(FC_BIO_new_fd)} + BIO_new_fd := @FC_BIO_new_fd; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_new_fd_removed)} + if BIO_new_fd_removed <= LibVersion then + begin + {$if declared(_BIO_new_fd)} + BIO_new_fd := @_BIO_new_fd; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_new_fd_allownil)} + if FuncLoadError then + AFailed.Add('BIO_new_fd'); + {$ifend} + end; + + + BIO_new_bio_pair := LoadLibFunction(ADllHandle, BIO_new_bio_pair_procname); + FuncLoadError := not assigned(BIO_new_bio_pair); + if FuncLoadError then + begin + {$if not defined(BIO_new_bio_pair_allownil)} + BIO_new_bio_pair := @ERR_BIO_new_bio_pair; + {$ifend} + {$if declared(BIO_new_bio_pair_introduced)} + if LibVersion < BIO_new_bio_pair_introduced then + begin + {$if declared(FC_BIO_new_bio_pair)} + BIO_new_bio_pair := @FC_BIO_new_bio_pair; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_new_bio_pair_removed)} + if BIO_new_bio_pair_removed <= LibVersion then + begin + {$if declared(_BIO_new_bio_pair)} + BIO_new_bio_pair := @_BIO_new_bio_pair; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_new_bio_pair_allownil)} + if FuncLoadError then + AFailed.Add('BIO_new_bio_pair'); + {$ifend} + end; + + + BIO_copy_next_retry := LoadLibFunction(ADllHandle, BIO_copy_next_retry_procname); + FuncLoadError := not assigned(BIO_copy_next_retry); + if FuncLoadError then + begin + {$if not defined(BIO_copy_next_retry_allownil)} + BIO_copy_next_retry := @ERR_BIO_copy_next_retry; + {$ifend} + {$if declared(BIO_copy_next_retry_introduced)} + if LibVersion < BIO_copy_next_retry_introduced then + begin + {$if declared(FC_BIO_copy_next_retry)} + BIO_copy_next_retry := @FC_BIO_copy_next_retry; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_copy_next_retry_removed)} + if BIO_copy_next_retry_removed <= LibVersion then + begin + {$if declared(_BIO_copy_next_retry)} + BIO_copy_next_retry := @_BIO_copy_next_retry; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_copy_next_retry_allownil)} + if FuncLoadError then + AFailed.Add('BIO_copy_next_retry'); + {$ifend} + end; + + +end; + +procedure Unload; +begin + BIO_get_flags := nil; {removed 1.0.0} + BIO_set_retry_special := nil; {removed 1.0.0} + BIO_set_retry_read := nil; {removed 1.0.0} + BIO_set_retry_write := nil; {removed 1.0.0} + BIO_clear_retry_flags := nil; {removed 1.0.0} + BIO_get_retry_flags := nil; {removed 1.0.0} + BIO_should_read := nil; {removed 1.0.0} + BIO_should_write := nil; {removed 1.0.0} + BIO_should_io_special := nil; {removed 1.0.0} + BIO_retry_type := nil; {removed 1.0.0} + BIO_should_retry := nil; {removed 1.0.0} + BIO_do_connect := nil; {removed 1.0.0} + BIO_do_accept := nil; {removed 1.0.0} + BIO_do_handshake := nil; {removed 1.0.0} + BIO_get_mem_data := nil; {removed 1.0.0} + BIO_set_mem_buf := nil; {removed 1.0.0} + BIO_get_mem_ptr := nil; {removed 1.0.0} + BIO_set_mem_eof_return := nil; {removed 1.0.0} + BIO_get_new_index := nil; {introduced 1.1.0} + BIO_set_flags := nil; + BIO_test_flags := nil; + BIO_clear_flags := nil; + BIO_get_callback := nil; + BIO_set_callback := nil; + BIO_get_callback_ex := nil; {introduced 1.1.0} + BIO_set_callback_ex := nil; {introduced 1.1.0} + BIO_get_callback_arg := nil; + BIO_set_callback_arg := nil; + BIO_method_name := nil; + BIO_method_type := nil; + BIO_ctrl_pending := nil; + BIO_ctrl_wpending := nil; + BIO_ctrl_get_write_guarantee := nil; + BIO_ctrl_get_read_request := nil; + BIO_ctrl_reset_read_request := nil; + BIO_set_ex_data := nil; + BIO_get_ex_data := nil; + BIO_number_read := nil; + BIO_number_written := nil; + BIO_s_file := nil; + BIO_new_file := nil; + BIO_new := nil; + BIO_free := nil; + BIO_set_data := nil; {introduced 1.1.0} + BIO_get_data := nil; {introduced 1.1.0} + BIO_set_init := nil; {introduced 1.1.0} + BIO_get_init := nil; {introduced 1.1.0} + BIO_set_shutdown := nil; {introduced 1.1.0} + BIO_get_shutdown := nil; {introduced 1.1.0} + BIO_vfree := nil; + BIO_up_ref := nil; {introduced 1.1.0} + BIO_read := nil; + BIO_read_ex := nil; {introduced 1.1.0} + BIO_gets := nil; + BIO_write := nil; + BIO_write_ex := nil; {introduced 1.1.0} + BIO_puts := nil; + BIO_indent := nil; + BIO_ctrl := nil; + BIO_callback_ctrl := nil; + BIO_ptr_ctrl := nil; + BIO_int_ctrl := nil; + BIO_push := nil; + BIO_pop := nil; + BIO_free_all := nil; + BIO_find_type := nil; + BIO_next := nil; + BIO_set_next := nil; {introduced 1.1.0} + BIO_get_retry_BIO := nil; + BIO_get_retry_reason := nil; + BIO_set_retry_reason := nil; {introduced 1.1.0} + BIO_dup_chain := nil; + BIO_nread0 := nil; + BIO_nread := nil; + BIO_nwrite0 := nil; + BIO_nwrite := nil; + BIO_debug_callback := nil; + BIO_s_mem := nil; + BIO_s_secmem := nil; {introduced 1.1.0} + BIO_new_mem_buf := nil; + BIO_s_socket := nil; + BIO_s_connect := nil; + BIO_s_accept := nil; + BIO_s_fd := nil; + BIO_s_log := nil; + BIO_s_bio := nil; + BIO_s_null := nil; + BIO_f_null := nil; + BIO_f_buffer := nil; + BIO_f_linebuffer := nil; {introduced 1.1.0} + BIO_f_nbio_test := nil; + BIO_s_datagram := nil; + BIO_dgram_non_fatal_error := nil; + BIO_new_dgram := nil; + BIO_sock_should_retry := nil; + BIO_sock_non_fatal_error := nil; + BIO_fd_should_retry := nil; + BIO_fd_non_fatal_error := nil; + BIO_dump := nil; + BIO_dump_indent := nil; + BIO_hex_string := nil; + BIO_ADDR_new := nil; {introduced 1.1.0} + BIO_ADDR_rawmake := nil; {introduced 1.1.0} + BIO_ADDR_free := nil; {introduced 1.1.0} + BIO_ADDR_clear := nil; {introduced 1.1.0} + BIO_ADDR_family := nil; {introduced 1.1.0} + BIO_ADDR_rawaddress := nil; {introduced 1.1.0} + BIO_ADDR_rawport := nil; {introduced 1.1.0} + BIO_ADDR_hostname_string := nil; {introduced 1.1.0} + BIO_ADDR_service_string := nil; {introduced 1.1.0} + BIO_ADDR_path_string := nil; {introduced 1.1.0} + BIO_ADDRINFO_next := nil; {introduced 1.1.0} + BIO_ADDRINFO_family := nil; {introduced 1.1.0} + BIO_ADDRINFO_socktype := nil; {introduced 1.1.0} + BIO_ADDRINFO_protocol := nil; {introduced 1.1.0} + BIO_ADDRINFO_address := nil; {introduced 1.1.0} + BIO_ADDRINFO_free := nil; {introduced 1.1.0} + BIO_parse_hostserv := nil; {introduced 1.1.0} + BIO_lookup := nil; {introduced 1.1.0} + BIO_lookup_ex := nil; {introduced 1.1.0} + BIO_sock_error := nil; + BIO_socket_ioctl := nil; + BIO_socket_nbio := nil; + BIO_sock_init := nil; + BIO_set_tcp_ndelay := nil; + BIO_sock_info := nil; {introduced 1.1.0} + BIO_socket := nil; {introduced 1.1.0} + BIO_connect := nil; {introduced 1.1.0} + BIO_bind := nil; {introduced 1.1.0} + BIO_listen := nil; {introduced 1.1.0} + BIO_accept_ex := nil; {introduced 1.1.0} + BIO_closesocket := nil; {introduced 1.1.0} + BIO_new_socket := nil; + BIO_new_connect := nil; + BIO_new_accept := nil; + BIO_new_fd := nil; + BIO_new_bio_pair := nil; + BIO_copy_next_retry := nil; +end; +{$ELSE} +function BIO_get_flags(const b: PBIO): TIdC_INT; +begin + Result := BIO_test_flags(b, not $0); +end; + +//# define BIO_set_retry_special(b) \ +// BIO_set_flags(b, (BIO_FLAGS_IO_SPECIAL|BIO_FLAGS_SHOULD_RETRY)) +procedure BIO_set_retry_special(b: PBIO); +begin + BIO_set_flags(b, BIO_FLAGS_IO_SPECIAL or BIO_FLAGS_SHOULD_RETRY); +end; + +//# define BIO_set_retry_read(b) \ +// BIO_set_flags(b, (BIO_FLAGS_READ|BIO_FLAGS_SHOULD_RETRY)) +procedure BIO_set_retry_read(b: PBIO); +begin + BIO_set_flags(b, BIO_FLAGS_READ or BIO_FLAGS_SHOULD_RETRY); +end; + +//# define BIO_set_retry_write(b) \ +// BIO_set_flags(b, (BIO_FLAGS_WRITE|BIO_FLAGS_SHOULD_RETRY)) +procedure BIO_set_retry_write(b: PBIO); +begin + BIO_set_flags(b, BIO_FLAGS_WRITE or BIO_FLAGS_SHOULD_RETRY); +end; + +//# define BIO_clear_retry_flags(b) \ +// BIO_clear_flags(b, (BIO_FLAGS_RWS|BIO_FLAGS_SHOULD_RETRY)) +procedure BIO_clear_retry_flags(b: PBIO); +begin + BIO_clear_flags(b, BIO_FLAGS_RWS or BIO_FLAGS_SHOULD_RETRY); +end; + +//# define BIO_get_retry_flags(b) \ +// BIO_test_flags(b, (BIO_FLAGS_RWS|BIO_FLAGS_SHOULD_RETRY)) +function BIO_get_retry_flags(b: PBIO): TIdC_INT; +begin + Result := BIO_test_flags(b, BIO_FLAGS_RWS or BIO_FLAGS_SHOULD_RETRY); +end; + +//# define BIO_should_read(a) BIO_test_flags(a, BIO_FLAGS_READ) +function BIO_should_read(b: PBIO): TIdC_INT; +begin + Result := BIO_test_flags(b, BIO_FLAGS_READ); +end; + +//# define BIO_should_write(a) BIO_test_flags(a, BIO_FLAGS_WRITE) +function BIO_should_write(b: PBIO): TIdC_INT; +begin + Result := BIO_test_flags(b, BIO_FLAGS_WRITE); +end; + +//# define BIO_should_io_special(a) BIO_test_flags(a, BIO_FLAGS_IO_SPECIAL) +function BIO_should_io_special(b: PBIO): TIdC_INT; +begin + Result := BIO_test_flags(b, BIO_FLAGS_IO_SPECIAL); +end; + +//# define BIO_retry_type(a) BIO_test_flags(a, BIO_FLAGS_RWS) +function BIO_retry_type(b: PBIO): TIdC_INT; +begin + Result := BIO_test_flags(b, BIO_FLAGS_RWS); +end; + +//# define BIO_should_retry(a) BIO_test_flags(a, BIO_FLAGS_SHOULD_RETRY) +function BIO_should_retry(b: PBIO): TIdC_INT; +begin + Result := BIO_test_flags(b, BIO_FLAGS_SHOULD_RETRY); +end; + +//# define BIO_do_connect(b) BIO_do_handshake(b) +function BIO_do_connect(b: PBIO): TIdC_LONG; +begin + Result := BIO_do_handshake(b); +end; + +//# define BIO_do_accept(b) BIO_do_handshake(b) +function BIO_do_accept(b: PBIO): TIdC_LONG; +begin + Result := BIO_do_handshake(b); +end; + +//# define BIO_do_handshake(b) BIO_ctrl(b,BIO_C_DO_STATE_MACHINE,0,NULL) +function BIO_do_handshake(b: PBIO): TIdC_LONG; +begin + Result := BIO_ctrl(b, BIO_C_DO_STATE_MACHINE, 0, nil); +end; + +//# define BIO_get_mem_data(b,pp) BIO_ctrl(b,BIO_CTRL_INFO,0,(char (pp)) +function BIO_get_mem_data(b: PBIO; pp: PIdAnsiChar) : TIdC_INT; +begin + Result := BIO_ctrl(b, BIO_CTRL_INFO, 0, pp); +end; + +//# define BIO_set_mem_buf(b,bm,c) BIO_ctrl(b,BIO_C_SET_BUF_MEM,c,(char (bm)) +function BIO_set_mem_buf(b: PBIO; bm: PIdAnsiChar; c: TIdC_INT): TIdC_INT; +begin + Result := BIO_ctrl(b, BIO_C_SET_BUF_MEM, c, bm); +end; + +//# define BIO_get_mem_ptr(b,pp) BIO_ctrl(b,BIO_C_GET_BUF_MEM_PTR,0,(char (pp)) +function BIO_get_mem_ptr(b: PBIO; pp: PIdAnsiChar): TIdC_INT; +begin + Result := BIO_ctrl(b, BIO_C_GET_BUF_MEM_PTR, 0, pp); +end; + +//# define BIO_set_mem_eof_return(b,v) BIO_ctrl(b,BIO_C_SET_BUF_MEM_EOF_RETURN,v,0) +function BIO_set_mem_eof_return(b: PBIO; v: TIdC_INT): TIdC_INT; +begin + Result := BIO_ctrl(b, BIO_C_SET_BUF_MEM_EOF_RETURN, v, nil); +end; + +{$ENDIF} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +initialization + Register_SSLLoader(@Load,'LibCrypto'); + Register_SSLUnloader(@Unload); +{$ENDIF} +end. diff --git a/IdOpenSSLHeaders_bioerr.pas b/IdOpenSSLHeaders_bioerr.pas new file mode 100644 index 0000000..aee3924 --- /dev/null +++ b/IdOpenSSLHeaders_bioerr.pas @@ -0,0 +1,241 @@ + (* This unit was generated using the script genOpenSSLHdrs.sh from the source file IdOpenSSLHeaders_bioerr.h2pas + It should not be modified directly. All changes should be made to IdOpenSSLHeaders_bioerr.h2pas + and this file regenerated. IdOpenSSLHeaders_bioerr.h2pas is distributed with the full Indy + Distribution. + *) + +{$i IdCompilerDefines.inc} +{$i IdSSLOpenSSLDefines.inc} +{$IFNDEF USE_OPENSSL} + { error Should not compile if USE_OPENSSL is not defined!!!} +{$ENDIF} +{******************************************************************************} +{ } +{ Indy (Internet Direct) - Internet Protocols Simplified } +{ } +{ https://www.indyproject.org/ } +{ https://gitter.im/IndySockets/Indy } +{ } +{******************************************************************************} +{ } +{ This file is part of the Indy (Internet Direct) project, and is offered } +{ under the dual-licensing agreement described on the Indy website. } +{ (https://www.indyproject.org/license/) } +{ } +{ Copyright: } +{ (c) 1993-2020, Chad Z. Hower and the Indy Pit Crew. All rights reserved. } +{ } +{******************************************************************************} +{ } +{ } +{******************************************************************************} + +unit IdOpenSSLHeaders_bioerr; + +interface + +// Headers for OpenSSL 1.1.1 +// bioerr.h + + +uses + IdCTypes, + IdGlobal, + IdSSLOpenSSLConsts; + +const + (* + * BIO function codes. + *) + BIO_F_ACPT_STATE = 100; + BIO_F_ADDRINFO_WRAP = 148; + BIO_F_ADDR_STRINGS = 134; + BIO_F_BIO_ACCEPT = 101; + BIO_F_BIO_ACCEPT_EX = 137; + BIO_F_BIO_ACCEPT_NEW = 152; + BIO_F_BIO_ADDR_NEW = 144; + BIO_F_BIO_BIND = 147; + BIO_F_BIO_CALLBACK_CTRL = 131; + BIO_F_BIO_CONNECT = 138; + BIO_F_BIO_CONNECT_NEW = 153; + BIO_F_BIO_CTRL = 103; + BIO_F_BIO_GETS = 104; + BIO_F_BIO_GET_HOST_IP = 106; + BIO_F_BIO_GET_NEW_INDEX = 102; + BIO_F_BIO_GET_PORT = 107; + BIO_F_BIO_LISTEN = 139; + BIO_F_BIO_LOOKUP = 135; + BIO_F_BIO_LOOKUP_EX = 143; + BIO_F_BIO_MAKE_PAIR = 121; + BIO_F_BIO_METH_NEW = 146; + BIO_F_BIO_NEW = 108; + BIO_F_BIO_NEW_DGRAM_SCTP = 145; + BIO_F_BIO_NEW_FILE = 109; + BIO_F_BIO_NEW_MEM_BUF = 126; + BIO_F_BIO_NREAD = 123; + BIO_F_BIO_NREAD0 = 124; + BIO_F_BIO_NWRITE = 125; + BIO_F_BIO_NWRITE0 = 122; + BIO_F_BIO_PARSE_HOSTSERV = 136; + BIO_F_BIO_PUTS = 110; + BIO_F_BIO_READ = 111; + BIO_F_BIO_READ_EX = 105; + BIO_F_BIO_READ_INTERN = 120; + BIO_F_BIO_SOCKET = 140; + BIO_F_BIO_SOCKET_NBIO = 142; + BIO_F_BIO_SOCK_INFO = 141; + BIO_F_BIO_SOCK_INIT = 112; + BIO_F_BIO_WRITE = 113; + BIO_F_BIO_WRITE_EX = 119; + BIO_F_BIO_WRITE_INTERN = 128; + BIO_F_BUFFER_CTRL = 114; + BIO_F_CONN_CTRL = 127; + BIO_F_CONN_STATE = 115; + BIO_F_DGRAM_SCTP_NEW = 149; + BIO_F_DGRAM_SCTP_READ = 132; + BIO_F_DGRAM_SCTP_WRITE = 133; + BIO_F_DOAPR_OUTCH = 150; + BIO_F_FILE_CTRL = 116; + BIO_F_FILE_READ = 130; + BIO_F_LINEBUFFER_CTRL = 129; + BIO_F_LINEBUFFER_NEW = 151; + BIO_F_MEM_WRITE = 117; + BIO_F_NBIOF_NEW = 154; + BIO_F_SLG_WRITE = 155; + BIO_F_SSL_NEW = 118; + + (* + * BIO reason codes. + *) + BIO_R_ACCEPT_ERROR = 100; + BIO_R_ADDRINFO_ADDR_IS_NOT_AF_INET = 141; + BIO_R_AMBIGUOUS_HOST_OR_SERVICE = 129; + BIO_R_BAD_FOPEN_MODE = 101; + BIO_R_BROKEN_PIPE = 124; + BIO_R_CONNECT_ERROR = 103; + BIO_R_GETHOSTBYNAME_ADDR_IS_NOT_AF_INET = 107; + BIO_R_GETSOCKNAME_ERROR = 132; + BIO_R_GETSOCKNAME_TRUNCATED_ADDRESS = 133; + BIO_R_GETTING_SOCKTYPE = 134; + BIO_R_INVALID_ARGUMENT = 125; + BIO_R_INVALID_SOCKET = 135; + BIO_R_IN_USE = 123; + BIO_R_LENGTH_TOO_LONG = 102; + BIO_R_LISTEN_V6_ONLY = 136; + BIO_R_LOOKUP_RETURNED_NOTHING = 142; + BIO_R_MALFORMED_HOST_OR_SERVICE = 130; + BIO_R_NBIO_CONNECT_ERROR = 110; + BIO_R_NO_ACCEPT_ADDR_OR_SERVICE_SPECIFIED = 143; + BIO_R_NO_HOSTNAME_OR_SERVICE_SPECIFIED = 144; + BIO_R_NO_PORT_DEFINED = 113; + BIO_R_NO_SUCH_FILE = 128; + BIO_R_NULL_PARAMETER = 115; + BIO_R_UNABLE_TO_BIND_SOCKET = 117; + BIO_R_UNABLE_TO_CREATE_SOCKET = 118; + BIO_R_UNABLE_TO_KEEPALIVE = 137; + BIO_R_UNABLE_TO_LISTEN_SOCKET = 119; + BIO_R_UNABLE_TO_NODELAY = 138; + BIO_R_UNABLE_TO_REUSEADDR = 139; + BIO_R_UNAVAILABLE_IP_FAMILY = 145; + BIO_R_UNINITIALIZED = 120; + BIO_R_UNKNOWN_INFO_TYPE = 140; + BIO_R_UNSUPPORTED_IP_FAMILY = 146; + BIO_R_UNSUPPORTED_METHOD = 121; + BIO_R_UNSUPPORTED_PROTOCOL_FAMILY = 131; + BIO_R_WRITE_TO_READ_ONLY_BIO = 126; + BIO_R_WSASTARTUP = 122; + + { The EXTERNALSYM directive is ignored by FPC, however, it is used by Delphi as follows: + + The EXTERNALSYM directive prevents the specified Delphi symbol from appearing in header + files generated for C++. } + + {$EXTERNALSYM ERR_load_BIO_strings} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +var + ERR_load_BIO_strings: function : TIdC_INT; cdecl = nil; + +{$ELSE} + function ERR_load_BIO_strings: TIdC_INT cdecl; external CLibCrypto; + +{$ENDIF} + +implementation + + uses + classes, + IdSSLOpenSSLExceptionHandlers, + IdResourceStringsOpenSSL + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + ,IdSSLOpenSSLLoader + {$ENDIF}; + + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +const + ERR_load_BIO_strings_procname = 'ERR_load_BIO_strings'; + + +{$WARN NO_RETVAL OFF} +function ERR_ERR_load_BIO_strings: TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ERR_load_BIO_strings_procname); +end; + + + +{$WARN NO_RETVAL ON} + +procedure Load(const ADllHandle: TIdLibHandle; LibVersion: TIdC_UINT; const AFailed: TStringList); + +var FuncLoadError: boolean; + +begin + ERR_load_BIO_strings := LoadLibFunction(ADllHandle, ERR_load_BIO_strings_procname); + FuncLoadError := not assigned(ERR_load_BIO_strings); + if FuncLoadError then + begin + {$if not defined(ERR_load_BIO_strings_allownil)} + ERR_load_BIO_strings := @ERR_ERR_load_BIO_strings; + {$ifend} + {$if declared(ERR_load_BIO_strings_introduced)} + if LibVersion < ERR_load_BIO_strings_introduced then + begin + {$if declared(FC_ERR_load_BIO_strings)} + ERR_load_BIO_strings := @FC_ERR_load_BIO_strings; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ERR_load_BIO_strings_removed)} + if ERR_load_BIO_strings_removed <= LibVersion then + begin + {$if declared(_ERR_load_BIO_strings)} + ERR_load_BIO_strings := @_ERR_load_BIO_strings; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ERR_load_BIO_strings_allownil)} + if FuncLoadError then + AFailed.Add('ERR_load_BIO_strings'); + {$ifend} + end; + + +end; + +procedure Unload; +begin + ERR_load_BIO_strings := nil; +end; +{$ELSE} +{$ENDIF} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +initialization + Register_SSLLoader(@Load,'LibCrypto'); + Register_SSLUnloader(@Unload); +{$ENDIF} +end. diff --git a/IdOpenSSLHeaders_blowfish.pas b/IdOpenSSLHeaders_blowfish.pas new file mode 100644 index 0000000..e36dcff --- /dev/null +++ b/IdOpenSSLHeaders_blowfish.pas @@ -0,0 +1,472 @@ + (* This unit was generated using the script genOpenSSLHdrs.sh from the source file IdOpenSSLHeaders_blowfish.h2pas + It should not be modified directly. All changes should be made to IdOpenSSLHeaders_blowfish.h2pas + and this file regenerated. IdOpenSSLHeaders_blowfish.h2pas is distributed with the full Indy + Distribution. + *) + +{$i IdCompilerDefines.inc} +{$i IdSSLOpenSSLDefines.inc} +{$IFNDEF USE_OPENSSL} + { error Should not compile if USE_OPENSSL is not defined!!!} +{$ENDIF} +{******************************************************************************} +{ } +{ Indy (Internet Direct) - Internet Protocols Simplified } +{ } +{ https://www.indyproject.org/ } +{ https://gitter.im/IndySockets/Indy } +{ } +{******************************************************************************} +{ } +{ This file is part of the Indy (Internet Direct) project, and is offered } +{ under the dual-licensing agreement described on the Indy website. } +{ (https://www.indyproject.org/license/) } +{ } +{ Copyright: } +{ (c) 1993-2020, Chad Z. Hower and the Indy Pit Crew. All rights reserved. } +{ } +{******************************************************************************} +{ } +{ } +{******************************************************************************} + +unit IdOpenSSLHeaders_blowfish; + +interface + +// Headers for OpenSSL 1.1.1 +// blowfish.h + + +uses + IdCTypes, + IdGlobal, + IdSSLOpenSSLConsts; + +const + // Added '_CONST' to avoid name clashes + BF_ENCRYPT_CONST = 1; + // Added '_CONST' to avoid name clashes + BF_DECRYPT_CONST = 0; + + BF_ROUNDS = 16; + BF_BLOCK = 8; + +type + BF_LONG = TIdC_UINT; + PBF_LONG = ^BF_LONG; + + bf_key_st = record + p: array[0 .. BF_ROUNDS + 2 - 1] of BF_LONG; + s: array[0 .. 4 * 256 - 1] of BF_LONG; + end; + BF_KEY = bf_key_st; + PBF_KEY = ^BF_KEY; + + { The EXTERNALSYM directive is ignored by FPC, however, it is used by Delphi as follows: + + The EXTERNALSYM directive prevents the specified Delphi symbol from appearing in header + files generated for C++. } + + {$EXTERNALSYM BF_set_key} + {$EXTERNALSYM BF_encrypt} + {$EXTERNALSYM BF_decrypt} + {$EXTERNALSYM BF_ecb_encrypt} + {$EXTERNALSYM BF_cbc_encrypt} + {$EXTERNALSYM BF_cfb64_encrypt} + {$EXTERNALSYM BF_ofb64_encrypt} + {$EXTERNALSYM BF_options} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +var + BF_set_key: procedure (key: PBF_KEY; len: TIdC_INT; const data: PByte); cdecl = nil; + + BF_encrypt: procedure (data: PBF_LONG; const key: PBF_KEY); cdecl = nil; + BF_decrypt: procedure (data: PBF_LONG; const key: PBF_KEY); cdecl = nil; + + BF_ecb_encrypt: procedure (const in_: PByte; out_: PByte; key: PBF_KEY; enc: TIdC_INT); cdecl = nil; + BF_cbc_encrypt: procedure (const in_: PByte; out_: PByte; length: TIdC_LONG; schedule: PBF_KEY; ivec: PByte; enc: TIdC_INT); cdecl = nil; + BF_cfb64_encrypt: procedure (const in_: PByte; out_: PByte; length: TIdC_LONG; schedule: PBF_KEY; ivec: PByte; num: PIdC_INT; enc: TIdC_INT); cdecl = nil; + BF_ofb64_encrypt: procedure (const in_: PByte; out_: PByte; length: TIdC_LONG; schedule: PBF_KEY; ivec: PByte; num: PIdC_INT); cdecl = nil; + + BF_options: function : PIdAnsiChar; cdecl = nil; + +{$ELSE} + procedure BF_set_key(key: PBF_KEY; len: TIdC_INT; const data: PByte) cdecl; external CLibCrypto; + + procedure BF_encrypt(data: PBF_LONG; const key: PBF_KEY) cdecl; external CLibCrypto; + procedure BF_decrypt(data: PBF_LONG; const key: PBF_KEY) cdecl; external CLibCrypto; + + procedure BF_ecb_encrypt(const in_: PByte; out_: PByte; key: PBF_KEY; enc: TIdC_INT) cdecl; external CLibCrypto; + procedure BF_cbc_encrypt(const in_: PByte; out_: PByte; length: TIdC_LONG; schedule: PBF_KEY; ivec: PByte; enc: TIdC_INT) cdecl; external CLibCrypto; + procedure BF_cfb64_encrypt(const in_: PByte; out_: PByte; length: TIdC_LONG; schedule: PBF_KEY; ivec: PByte; num: PIdC_INT; enc: TIdC_INT) cdecl; external CLibCrypto; + procedure BF_ofb64_encrypt(const in_: PByte; out_: PByte; length: TIdC_LONG; schedule: PBF_KEY; ivec: PByte; num: PIdC_INT) cdecl; external CLibCrypto; + + function BF_options: PIdAnsiChar cdecl; external CLibCrypto; + +{$ENDIF} + +implementation + + uses + classes, + IdSSLOpenSSLExceptionHandlers, + IdResourceStringsOpenSSL + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + ,IdSSLOpenSSLLoader + {$ENDIF}; + + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +const + BF_set_key_procname = 'BF_set_key'; + + BF_encrypt_procname = 'BF_encrypt'; + BF_decrypt_procname = 'BF_decrypt'; + + BF_ecb_encrypt_procname = 'BF_ecb_encrypt'; + BF_cbc_encrypt_procname = 'BF_cbc_encrypt'; + BF_cfb64_encrypt_procname = 'BF_cfb64_encrypt'; + BF_ofb64_encrypt_procname = 'BF_ofb64_encrypt'; + + BF_options_procname = 'BF_options'; + + +{$WARN NO_RETVAL OFF} +procedure ERR_BF_set_key(key: PBF_KEY; len: TIdC_INT; const data: PByte); +begin + EIdAPIFunctionNotPresent.RaiseException(BF_set_key_procname); +end; + + + +procedure ERR_BF_encrypt(data: PBF_LONG; const key: PBF_KEY); +begin + EIdAPIFunctionNotPresent.RaiseException(BF_encrypt_procname); +end; + + +procedure ERR_BF_decrypt(data: PBF_LONG; const key: PBF_KEY); +begin + EIdAPIFunctionNotPresent.RaiseException(BF_decrypt_procname); +end; + + + +procedure ERR_BF_ecb_encrypt(const in_: PByte; out_: PByte; key: PBF_KEY; enc: TIdC_INT); +begin + EIdAPIFunctionNotPresent.RaiseException(BF_ecb_encrypt_procname); +end; + + +procedure ERR_BF_cbc_encrypt(const in_: PByte; out_: PByte; length: TIdC_LONG; schedule: PBF_KEY; ivec: PByte; enc: TIdC_INT); +begin + EIdAPIFunctionNotPresent.RaiseException(BF_cbc_encrypt_procname); +end; + + +procedure ERR_BF_cfb64_encrypt(const in_: PByte; out_: PByte; length: TIdC_LONG; schedule: PBF_KEY; ivec: PByte; num: PIdC_INT; enc: TIdC_INT); +begin + EIdAPIFunctionNotPresent.RaiseException(BF_cfb64_encrypt_procname); +end; + + +procedure ERR_BF_ofb64_encrypt(const in_: PByte; out_: PByte; length: TIdC_LONG; schedule: PBF_KEY; ivec: PByte; num: PIdC_INT); +begin + EIdAPIFunctionNotPresent.RaiseException(BF_ofb64_encrypt_procname); +end; + + + +function ERR_BF_options: PIdAnsiChar; +begin + EIdAPIFunctionNotPresent.RaiseException(BF_options_procname); +end; + + + +{$WARN NO_RETVAL ON} + +procedure Load(const ADllHandle: TIdLibHandle; LibVersion: TIdC_UINT; const AFailed: TStringList); + +var FuncLoadError: boolean; + +begin + BF_set_key := LoadLibFunction(ADllHandle, BF_set_key_procname); + FuncLoadError := not assigned(BF_set_key); + if FuncLoadError then + begin + {$if not defined(BF_set_key_allownil)} + BF_set_key := @ERR_BF_set_key; + {$ifend} + {$if declared(BF_set_key_introduced)} + if LibVersion < BF_set_key_introduced then + begin + {$if declared(FC_BF_set_key)} + BF_set_key := @FC_BF_set_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BF_set_key_removed)} + if BF_set_key_removed <= LibVersion then + begin + {$if declared(_BF_set_key)} + BF_set_key := @_BF_set_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BF_set_key_allownil)} + if FuncLoadError then + AFailed.Add('BF_set_key'); + {$ifend} + end; + + + BF_encrypt := LoadLibFunction(ADllHandle, BF_encrypt_procname); + FuncLoadError := not assigned(BF_encrypt); + if FuncLoadError then + begin + {$if not defined(BF_encrypt_allownil)} + BF_encrypt := @ERR_BF_encrypt; + {$ifend} + {$if declared(BF_encrypt_introduced)} + if LibVersion < BF_encrypt_introduced then + begin + {$if declared(FC_BF_encrypt)} + BF_encrypt := @FC_BF_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BF_encrypt_removed)} + if BF_encrypt_removed <= LibVersion then + begin + {$if declared(_BF_encrypt)} + BF_encrypt := @_BF_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BF_encrypt_allownil)} + if FuncLoadError then + AFailed.Add('BF_encrypt'); + {$ifend} + end; + + + BF_decrypt := LoadLibFunction(ADllHandle, BF_decrypt_procname); + FuncLoadError := not assigned(BF_decrypt); + if FuncLoadError then + begin + {$if not defined(BF_decrypt_allownil)} + BF_decrypt := @ERR_BF_decrypt; + {$ifend} + {$if declared(BF_decrypt_introduced)} + if LibVersion < BF_decrypt_introduced then + begin + {$if declared(FC_BF_decrypt)} + BF_decrypt := @FC_BF_decrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BF_decrypt_removed)} + if BF_decrypt_removed <= LibVersion then + begin + {$if declared(_BF_decrypt)} + BF_decrypt := @_BF_decrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BF_decrypt_allownil)} + if FuncLoadError then + AFailed.Add('BF_decrypt'); + {$ifend} + end; + + + BF_ecb_encrypt := LoadLibFunction(ADllHandle, BF_ecb_encrypt_procname); + FuncLoadError := not assigned(BF_ecb_encrypt); + if FuncLoadError then + begin + {$if not defined(BF_ecb_encrypt_allownil)} + BF_ecb_encrypt := @ERR_BF_ecb_encrypt; + {$ifend} + {$if declared(BF_ecb_encrypt_introduced)} + if LibVersion < BF_ecb_encrypt_introduced then + begin + {$if declared(FC_BF_ecb_encrypt)} + BF_ecb_encrypt := @FC_BF_ecb_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BF_ecb_encrypt_removed)} + if BF_ecb_encrypt_removed <= LibVersion then + begin + {$if declared(_BF_ecb_encrypt)} + BF_ecb_encrypt := @_BF_ecb_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BF_ecb_encrypt_allownil)} + if FuncLoadError then + AFailed.Add('BF_ecb_encrypt'); + {$ifend} + end; + + + BF_cbc_encrypt := LoadLibFunction(ADllHandle, BF_cbc_encrypt_procname); + FuncLoadError := not assigned(BF_cbc_encrypt); + if FuncLoadError then + begin + {$if not defined(BF_cbc_encrypt_allownil)} + BF_cbc_encrypt := @ERR_BF_cbc_encrypt; + {$ifend} + {$if declared(BF_cbc_encrypt_introduced)} + if LibVersion < BF_cbc_encrypt_introduced then + begin + {$if declared(FC_BF_cbc_encrypt)} + BF_cbc_encrypt := @FC_BF_cbc_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BF_cbc_encrypt_removed)} + if BF_cbc_encrypt_removed <= LibVersion then + begin + {$if declared(_BF_cbc_encrypt)} + BF_cbc_encrypt := @_BF_cbc_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BF_cbc_encrypt_allownil)} + if FuncLoadError then + AFailed.Add('BF_cbc_encrypt'); + {$ifend} + end; + + + BF_cfb64_encrypt := LoadLibFunction(ADllHandle, BF_cfb64_encrypt_procname); + FuncLoadError := not assigned(BF_cfb64_encrypt); + if FuncLoadError then + begin + {$if not defined(BF_cfb64_encrypt_allownil)} + BF_cfb64_encrypt := @ERR_BF_cfb64_encrypt; + {$ifend} + {$if declared(BF_cfb64_encrypt_introduced)} + if LibVersion < BF_cfb64_encrypt_introduced then + begin + {$if declared(FC_BF_cfb64_encrypt)} + BF_cfb64_encrypt := @FC_BF_cfb64_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BF_cfb64_encrypt_removed)} + if BF_cfb64_encrypt_removed <= LibVersion then + begin + {$if declared(_BF_cfb64_encrypt)} + BF_cfb64_encrypt := @_BF_cfb64_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BF_cfb64_encrypt_allownil)} + if FuncLoadError then + AFailed.Add('BF_cfb64_encrypt'); + {$ifend} + end; + + + BF_ofb64_encrypt := LoadLibFunction(ADllHandle, BF_ofb64_encrypt_procname); + FuncLoadError := not assigned(BF_ofb64_encrypt); + if FuncLoadError then + begin + {$if not defined(BF_ofb64_encrypt_allownil)} + BF_ofb64_encrypt := @ERR_BF_ofb64_encrypt; + {$ifend} + {$if declared(BF_ofb64_encrypt_introduced)} + if LibVersion < BF_ofb64_encrypt_introduced then + begin + {$if declared(FC_BF_ofb64_encrypt)} + BF_ofb64_encrypt := @FC_BF_ofb64_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BF_ofb64_encrypt_removed)} + if BF_ofb64_encrypt_removed <= LibVersion then + begin + {$if declared(_BF_ofb64_encrypt)} + BF_ofb64_encrypt := @_BF_ofb64_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BF_ofb64_encrypt_allownil)} + if FuncLoadError then + AFailed.Add('BF_ofb64_encrypt'); + {$ifend} + end; + + + BF_options := LoadLibFunction(ADllHandle, BF_options_procname); + FuncLoadError := not assigned(BF_options); + if FuncLoadError then + begin + {$if not defined(BF_options_allownil)} + BF_options := @ERR_BF_options; + {$ifend} + {$if declared(BF_options_introduced)} + if LibVersion < BF_options_introduced then + begin + {$if declared(FC_BF_options)} + BF_options := @FC_BF_options; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BF_options_removed)} + if BF_options_removed <= LibVersion then + begin + {$if declared(_BF_options)} + BF_options := @_BF_options; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BF_options_allownil)} + if FuncLoadError then + AFailed.Add('BF_options'); + {$ifend} + end; + + +end; + +procedure Unload; +begin + BF_set_key := nil; + BF_encrypt := nil; + BF_decrypt := nil; + BF_ecb_encrypt := nil; + BF_cbc_encrypt := nil; + BF_cfb64_encrypt := nil; + BF_ofb64_encrypt := nil; + BF_options := nil; +end; +{$ELSE} +{$ENDIF} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +initialization + Register_SSLLoader(@Load,'LibCrypto'); + Register_SSLUnloader(@Unload); +{$ENDIF} +end. diff --git a/IdOpenSSLHeaders_bn.pas b/IdOpenSSLHeaders_bn.pas new file mode 100644 index 0000000..c28b43e --- /dev/null +++ b/IdOpenSSLHeaders_bn.pas @@ -0,0 +1,7886 @@ + (* This unit was generated using the script genOpenSSLHdrs.sh from the source file IdOpenSSLHeaders_bn.h2pas + It should not be modified directly. All changes should be made to IdOpenSSLHeaders_bn.h2pas + and this file regenerated. IdOpenSSLHeaders_bn.h2pas is distributed with the full Indy + Distribution. + *) + +{$i IdCompilerDefines.inc} +{$i IdSSLOpenSSLDefines.inc} +{$IFNDEF USE_OPENSSL} + { error Should not compile if USE_OPENSSL is not defined!!!} +{$ENDIF} +{******************************************************************************} +{ } +{ Indy (Internet Direct) - Internet Protocols Simplified } +{ } +{ https://www.indyproject.org/ } +{ https://gitter.im/IndySockets/Indy } +{ } +{******************************************************************************} +{ } +{ This file is part of the Indy (Internet Direct) project, and is offered } +{ under the dual-licensing agreement described on the Indy website. } +{ (https://www.indyproject.org/license/) } +{ } +{ Copyright: } +{ (c) 1993-2020, Chad Z. Hower and the Indy Pit Crew. All rights reserved. } +{ } +{******************************************************************************} +{ } +{ } +{******************************************************************************} + +unit IdOpenSSLHeaders_bn; + +interface + +// Headers for OpenSSL 1.1.1 +// bn.h + + +uses + IdCTypes, + IdGlobal, + IdSSLOpenSSLConsts, + IdOpenSSLHeaders_ossl_typ; + +const + BN_FLG_MALLOCED = $01; + BN_FLG_STATIC_DATA = $02; + + (* + * avoid leaking exponent information through timing, + * BN_mod_exp_mont() will call BN_mod_exp_mont_consttime, + * BN_div() will call BN_div_no_branch, + * BN_mod_inverse() will call BN_mod_inverse_no_branch. + *) + BN_FLG_CONSTTIME = $04; + BN_FLG_SECURE = $08; + + (* Values for |top| in BN_rand() *) + BN_RAND_TOP_ANY = -1; + BN_RAND_TOP_ONE = 0; + BN_RAND_TOP_TWO = 1; + + (* Values for |bottom| in BN_rand() *) + BN_RAND_BOTTOM_ANY = 0; + BN_RAND_BOTTOM_ODD = 1; + + (* BN_BLINDING flags *) + BN_BLINDING_NO_UPDATE = $00000001; + BN_BLINDING_NO_RECREATE = $00000002; + +type + BN_ULONG = TIdC_ULONG; + + BN_GENCB_set_old_cb = procedure (a: TIdC_INT; b: TIdC_INT; c: Pointer); cdecl; + BN_GENCB_set_cb = function (a: TIdC_INT; b: TIdC_INT; c: PBN_GENCB): TIdC_INT; cdecl; + + { The EXTERNALSYM directive is ignored by FPC, however, it is used by Delphi as follows: + + The EXTERNALSYM directive prevents the specified Delphi symbol from appearing in header + files generated for C++. } + + {$EXTERNALSYM BN_set_flags} + {$EXTERNALSYM BN_get_flags} + {$EXTERNALSYM BN_with_flags} + {$EXTERNALSYM BN_GENCB_call} + {$EXTERNALSYM BN_GENCB_new} + {$EXTERNALSYM BN_GENCB_free} + {$EXTERNALSYM BN_GENCB_set_old} + {$EXTERNALSYM BN_GENCB_set} + {$EXTERNALSYM BN_GENCB_get_arg} + {$EXTERNALSYM BN_abs_is_word} + {$EXTERNALSYM BN_is_zero} + {$EXTERNALSYM BN_is_one} + {$EXTERNALSYM BN_is_word} + {$EXTERNALSYM BN_is_odd} + {$EXTERNALSYM BN_zero_ex} + {$EXTERNALSYM BN_value_one} + {$EXTERNALSYM BN_options} + {$EXTERNALSYM BN_CTX_new} + {$EXTERNALSYM BN_CTX_secure_new} + {$EXTERNALSYM BN_CTX_free} + {$EXTERNALSYM BN_CTX_start} + {$EXTERNALSYM BN_CTX_get} + {$EXTERNALSYM BN_CTX_end} + {$EXTERNALSYM BN_rand} + {$EXTERNALSYM BN_priv_rand} + {$EXTERNALSYM BN_rand_range} + {$EXTERNALSYM BN_priv_rand_range} + {$EXTERNALSYM BN_pseudo_rand} + {$EXTERNALSYM BN_pseudo_rand_range} + {$EXTERNALSYM BN_num_bits} + {$EXTERNALSYM BN_num_bits_word} + {$EXTERNALSYM BN_security_bits} + {$EXTERNALSYM BN_new} + {$EXTERNALSYM BN_secure_new} + {$EXTERNALSYM BN_clear_free} + {$EXTERNALSYM BN_copy} + {$EXTERNALSYM BN_swap} + {$EXTERNALSYM BN_bin2bn} + {$EXTERNALSYM BN_bn2bin} + {$EXTERNALSYM BN_bn2binpad} + {$EXTERNALSYM BN_lebin2bn} + {$EXTERNALSYM BN_bn2lebinpad} + {$EXTERNALSYM BN_mpi2bn} + {$EXTERNALSYM BN_bn2mpi} + {$EXTERNALSYM BN_sub} + {$EXTERNALSYM BN_usub} + {$EXTERNALSYM BN_uadd} + {$EXTERNALSYM BN_add} + {$EXTERNALSYM BN_mul} + {$EXTERNALSYM BN_sqr} + {$EXTERNALSYM BN_set_negative} + {$EXTERNALSYM BN_is_negative} + {$EXTERNALSYM BN_div} + {$EXTERNALSYM BN_nnmod} + {$EXTERNALSYM BN_mod_add} + {$EXTERNALSYM BN_mod_add_quick} + {$EXTERNALSYM BN_mod_sub} + {$EXTERNALSYM BN_mod_sub_quick} + {$EXTERNALSYM BN_mod_mul} + {$EXTERNALSYM BN_mod_sqr} + {$EXTERNALSYM BN_mod_lshift1} + {$EXTERNALSYM BN_mod_lshift1_quick} + {$EXTERNALSYM BN_mod_lshift} + {$EXTERNALSYM BN_mod_lshift_quick} + {$EXTERNALSYM BN_mod_word} + {$EXTERNALSYM BN_div_word} + {$EXTERNALSYM BN_mul_word} + {$EXTERNALSYM BN_add_word} + {$EXTERNALSYM BN_sub_word} + {$EXTERNALSYM BN_set_word} + {$EXTERNALSYM BN_get_word} + {$EXTERNALSYM BN_cmp} + {$EXTERNALSYM BN_free} + {$EXTERNALSYM BN_is_bit_set} + {$EXTERNALSYM BN_lshift} + {$EXTERNALSYM BN_lshift1} + {$EXTERNALSYM BN_exp} + {$EXTERNALSYM BN_mod_exp} + {$EXTERNALSYM BN_mod_exp_mont} + {$EXTERNALSYM BN_mod_exp_mont_consttime} + {$EXTERNALSYM BN_mod_exp_mont_word} + {$EXTERNALSYM BN_mod_exp2_mont} + {$EXTERNALSYM BN_mod_exp_simple} + {$EXTERNALSYM BN_mask_bits} + {$EXTERNALSYM BN_print} + {$EXTERNALSYM BN_reciprocal} + {$EXTERNALSYM BN_rshift} + {$EXTERNALSYM BN_rshift1} + {$EXTERNALSYM BN_clear} + {$EXTERNALSYM BN_dup} + {$EXTERNALSYM BN_ucmp} + {$EXTERNALSYM BN_set_bit} + {$EXTERNALSYM BN_clear_bit} + {$EXTERNALSYM BN_bn2hex} + {$EXTERNALSYM BN_bn2dec} + {$EXTERNALSYM BN_hex2bn} + {$EXTERNALSYM BN_dec2bn} + {$EXTERNALSYM BN_asc2bn} + {$EXTERNALSYM BN_gcd} + {$EXTERNALSYM BN_kronecker} + {$EXTERNALSYM BN_mod_inverse} + {$EXTERNALSYM BN_mod_sqrt} + {$EXTERNALSYM BN_consttime_swap} + {$EXTERNALSYM BN_generate_prime_ex} + {$EXTERNALSYM BN_is_prime_ex} + {$EXTERNALSYM BN_is_prime_fasttest_ex} + {$EXTERNALSYM BN_X931_generate_Xpq} + {$EXTERNALSYM BN_X931_derive_prime_ex} + {$EXTERNALSYM BN_X931_generate_prime_ex} + {$EXTERNALSYM BN_MONT_CTX_new} + {$EXTERNALSYM BN_mod_mul_montgomery} + {$EXTERNALSYM BN_to_montgomery} + {$EXTERNALSYM BN_from_montgomery} + {$EXTERNALSYM BN_MONT_CTX_free} + {$EXTERNALSYM BN_MONT_CTX_set} + {$EXTERNALSYM BN_MONT_CTX_copy} + {$EXTERNALSYM BN_BLINDING_new} + {$EXTERNALSYM BN_BLINDING_free} + {$EXTERNALSYM BN_BLINDING_update} + {$EXTERNALSYM BN_BLINDING_convert} + {$EXTERNALSYM BN_BLINDING_invert} + {$EXTERNALSYM BN_BLINDING_convert_ex} + {$EXTERNALSYM BN_BLINDING_invert_ex} + {$EXTERNALSYM BN_BLINDING_is_current_thread} + {$EXTERNALSYM BN_BLINDING_set_current_thread} + {$EXTERNALSYM BN_BLINDING_lock} + {$EXTERNALSYM BN_BLINDING_unlock} + {$EXTERNALSYM BN_BLINDING_get_flags} + {$EXTERNALSYM BN_BLINDING_set_flags} + {$EXTERNALSYM BN_RECP_CTX_free} + {$EXTERNALSYM BN_RECP_CTX_set} + {$EXTERNALSYM BN_mod_mul_reciprocal} + {$EXTERNALSYM BN_mod_exp_recp} + {$EXTERNALSYM BN_div_recp} + {$EXTERNALSYM BN_GF2m_add} + {$EXTERNALSYM BN_GF2m_mod} + {$EXTERNALSYM BN_GF2m_mod_mul} + {$EXTERNALSYM BN_GF2m_mod_sqr} + {$EXTERNALSYM BN_GF2m_mod_inv} + {$EXTERNALSYM BN_GF2m_mod_div} + {$EXTERNALSYM BN_GF2m_mod_exp} + {$EXTERNALSYM BN_GF2m_mod_sqrt} + {$EXTERNALSYM BN_GF2m_mod_solve_quad} + {$EXTERNALSYM BN_nist_mod_192} + {$EXTERNALSYM BN_nist_mod_224} + {$EXTERNALSYM BN_nist_mod_256} + {$EXTERNALSYM BN_nist_mod_384} + {$EXTERNALSYM BN_nist_mod_521} + {$EXTERNALSYM BN_get0_nist_prime_192} + {$EXTERNALSYM BN_get0_nist_prime_224} + {$EXTERNALSYM BN_get0_nist_prime_256} + {$EXTERNALSYM BN_get0_nist_prime_384} + {$EXTERNALSYM BN_get0_nist_prime_521} + {$EXTERNALSYM BN_generate_dsa_nonce} + {$EXTERNALSYM BN_get_rfc2409_prime_768} + {$EXTERNALSYM BN_get_rfc2409_prime_1024} + {$EXTERNALSYM BN_get_rfc3526_prime_1536} + {$EXTERNALSYM BN_get_rfc3526_prime_2048} + {$EXTERNALSYM BN_get_rfc3526_prime_3072} + {$EXTERNALSYM BN_get_rfc3526_prime_4096} + {$EXTERNALSYM BN_get_rfc3526_prime_6144} + {$EXTERNALSYM BN_get_rfc3526_prime_8192} + {$EXTERNALSYM BN_bntest_rand} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +var + BN_set_flags: procedure (b: PBIGNUM; n: TIdC_INT); cdecl = nil; + BN_get_flags: function (b: PBIGNUM; n: TIdC_INT): TIdC_INT; cdecl = nil; + + (* + * get a clone of a BIGNUM with changed flags, for *temporary* use only (the + * two BIGNUMs cannot be used in parallel!). Also only for *read only* use. The + * value |dest| should be a newly allocated BIGNUM obtained via BN_new() that + * has not been otherwise initialised or used. + *) + BN_with_flags: procedure (dest: PBIGNUM; b: PBIGNUM; flags: TIdC_INT); cdecl = nil; + (* Wrapper function to make using BN_GENCB easier *) + BN_GENCB_call: function (cb: PBN_GENCB; a: TIdC_INT; b: TIdC_INT): TIdC_INT; cdecl = nil; + + BN_GENCB_new: function : PBN_GENCB; cdecl = nil; + BN_GENCB_free: procedure (cb: PBN_GENCB); cdecl = nil; + + (* Populate a PBN_GENCB structure with an "old"-style callback *) + BN_GENCB_set_old: procedure (gencb: PBN_GENCB; callback: BN_GENCB_set_old_cb; cb_arg: Pointer); cdecl = nil; + + (* Populate a PBN_GENCB structure with a "new"-style callback *) + BN_GENCB_set: procedure (gencb: PBN_GENCB; callback: BN_GENCB_set_cb; cb_arg: Pointer); cdecl = nil; + + BN_GENCB_get_arg: function (cb: PBN_GENCB): Pointer; cdecl = nil; + + (* + * BN_prime_checks_for_size() returns the number of Miller-Rabin iterations + * that will be done for checking that a random number is probably prime. The + * error rate for accepting a composite number as prime depends on the size of + * the prime |b|. The error rates used are for calculating an RSA key with 2 primes, + * and so the level is what you would expect for a key of double the size of the + * prime. + * + * This table is generated using the algorithm of FIPS PUB 186-4 + * Digital Signature Standard (DSS), section F.1, page 117. + * (https://dx.doi.org/10.6028/NIST.FIPS.186-4) + * + * The following magma script was used to generate the output: + * securitybits:=125; + * k:=1024; + * for t:=1 to 65 do + * for M:=3 to Floor(2*Sqrt(k-1)-1) do + * S:=0; + * // Sum over m + * for m:=3 to M do + * s:=0; + * // Sum over j + * for j:=2 to m do + * s+:=(RealField(32)!2)^-(j+(k-1)/j); + * end for; + * S+:=2^(m-(m-1)*t)*s; + * end for; + * A:=2^(k-2-M*t); + * B:=8*(Pi(RealField(32))^2-6)/3*2^(k-2)*S; + * pkt:=2.00743*Log(2)*k*2^-k*(A+B); + * seclevel:=Floor(-Log(2,pkt)); + * if seclevel ge securitybits then + * printf "k: %5o, security: %o bits (t: %o, M: %o)\n",k,seclevel,t,M; + * break; + * end if; + * end for; + * if seclevel ge securitybits then break; end if; + * end for; + * + * It can be run online at: + * http://magma.maths.usyd.edu.au/calc + * + * And will output: + * k: 1024, security: 129 bits (t: 6, M: 23) + * + * k is the number of bits of the prime, securitybits is the level we want to + * reach. + * + * prime length | RSA key size | # MR tests | security level + * -------------+--------------|------------+--------------- + * (b) >= 6394 | >= 12788 | 3 | 256 bit + * (b) >= 3747 | >= 7494 | 3 | 192 bit + * (b) >= 1345 | >= 2690 | 4 | 128 bit + * (b) >= 1080 | >= 2160 | 5 | 128 bit + * (b) >= 852 | >= 1704 | 5 | 112 bit + * (b) >= 476 | >= 952 | 5 | 80 bit + * (b) >= 400 | >= 800 | 6 | 80 bit + * (b) >= 347 | >= 694 | 7 | 80 bit + * (b) >= 308 | >= 616 | 8 | 80 bit + * (b) >= 55 | >= 110 | 27 | 64 bit + * (b) >= 6 | >= 12 | 34 | 64 bit + *) + +// # define BN_prime_checks_for_size(b) ((b) >= 3747 ? 3 : \ +// (b) >= 1345 ? 4 : \ +// (b) >= 476 ? 5 : \ +// (b) >= 400 ? 6 : \ +// (b) >= 347 ? 7 : \ +// (b) >= 308 ? 8 : \ +// (b) >= 55 ? 27 : \ +// (* b >= 6 *) 34) +// +// # define BN_num_bytes(a) ((BN_num_bits(a)+7)/8) + + BN_abs_is_word: function (a: PBIGNUM; w: BN_ULONG): TIdC_INT; cdecl = nil; + BN_is_zero: function (a: PBIGNUM): TIdC_INT; cdecl = nil; + BN_is_one: function (a: PBIGNUM): TIdC_INT; cdecl = nil; + BN_is_word: function (a: PBIGNUM; w: BN_ULONG): TIdC_INT; cdecl = nil; + BN_is_odd: function (a: PBIGNUM): TIdC_INT; cdecl = nil; + +// # define BN_one(a) (BN_set_word((a),1)) + + BN_zero_ex: procedure (a: PBIGNUM); cdecl = nil; + + BN_value_one: function : PBIGNUM; cdecl = nil; + BN_options: function : PIdAnsiChar; cdecl = nil; + BN_CTX_new: function : PBN_CTX; cdecl = nil; + BN_CTX_secure_new: function : PBN_CTX; cdecl = nil; + BN_CTX_free: procedure (c: PBN_CTX); cdecl = nil; + BN_CTX_start: procedure (ctx: PBN_CTX); cdecl = nil; + BN_CTX_get: function (ctx: PBN_CTX): PBIGNUM; cdecl = nil; + BN_CTX_end: procedure (ctx: PBN_CTX); cdecl = nil; + BN_rand: function (rnd: PBIGNUM; bits: TIdC_INT; top: TIdC_INT; bottom: TIdC_INT): TIdC_INT; cdecl = nil; + BN_priv_rand: function (rnd: PBIGNUM; bits: TIdC_INT; top: TIdC_INT; bottom: TIdC_INT): TIdC_INT; cdecl = nil; + BN_rand_range: function (rnd: PBIGNUM; range: PBIGNUM): TIdC_INT; cdecl = nil; + BN_priv_rand_range: function (rnd: PBIGNUM; range: PBIGNUM): TIdC_INT; cdecl = nil; + BN_pseudo_rand: function (rnd: PBIGNUM; bits: TIdC_INT; top: TIdC_INT; bottom: TIdC_INT): TIdC_INT; cdecl = nil; + BN_pseudo_rand_range: function (rnd: PBIGNUM; range: PBIGNUM): TIdC_INT; cdecl = nil; + BN_num_bits: function (a: PBIGNUM): TIdC_INT; cdecl = nil; + BN_num_bits_word: function (l: BN_ULONG): TIdC_INT; cdecl = nil; + BN_security_bits: function (L: TIdC_INT; N: TIdC_INT): TIdC_INT; cdecl = nil; + BN_new: function : PBIGNUM; cdecl = nil; + BN_secure_new: function : PBIGNUM; cdecl = nil; + BN_clear_free: procedure (a: PBIGNUM); cdecl = nil; + BN_copy: function (a: PBIGNUM; b: PBIGNUM): PBIGNUM; cdecl = nil; + BN_swap: procedure (a: PBIGNUM; b: PBIGNUM); cdecl = nil; + BN_bin2bn: function (const s: PByte; len: TIdC_INT; ret: PBIGNUM): PBIGNUM; cdecl = nil; + BN_bn2bin: function (const a: PBIGNUM; to_: PByte): TIdC_INT; cdecl = nil; + BN_bn2binpad: function (const a: PBIGNUM; to_: PByte; tolen: TIdC_INT): TIdC_INT; cdecl = nil; + BN_lebin2bn: function (const s: PByte; len: TIdC_INT; ret: PBIGNUM): PBIGNUM; cdecl = nil; + BN_bn2lebinpad: function (a: PBIGNUM; to_: PByte; tolen: TIdC_INT): TIdC_INT; cdecl = nil; + BN_mpi2bn: function (const s: PByte; len: TIdC_INT; ret: PBIGNUM): PBIGNUM; cdecl = nil; + BN_bn2mpi: function (a: PBIGNUM; to_: PByte): TIdC_INT; cdecl = nil; + BN_sub: function (r: PBIGNUM; const a: PBIGNUM; const b: PBIGNUM): TIdC_INT; cdecl = nil; + BN_usub: function (r: PBIGNUM; const a: PBIGNUM; const b: PBIGNUM): TIdC_INT; cdecl = nil; + BN_uadd: function (r: PBIGNUM; const a: PBIGNUM; const b: PBIGNUM): TIdC_INT; cdecl = nil; + BN_add: function (r: PBIGNUM; const a: PBIGNUM; const b: PBIGNUM): TIdC_INT; cdecl = nil; + BN_mul: function (r: PBIGNUM; const a: PBIGNUM; const b: PBIGNUM; ctx: PBN_CTX): TIdC_INT; cdecl = nil; + BN_sqr: function (r: PBIGNUM; const a: PBIGNUM; ctx: PBN_CTX): TIdC_INT; cdecl = nil; + + (** BN_set_negative sets sign of a BIGNUM + * \param b pointer to the BIGNUM object + * \param n 0 if the BIGNUM b should be positive and a value != 0 otherwise + *) + BN_set_negative: procedure (b: PBIGNUM; n: TIdC_INT); cdecl = nil; + (** BN_is_negative returns 1 if the BIGNUM is negative + * \param b pointer to the BIGNUM object + * \return 1 if a < 0 and 0 otherwise + *) + BN_is_negative: function (b: PBIGNUM): TIdC_INT; cdecl = nil; + + BN_div: function (dv: PBIGNUM; rem: PBIGNUM; const m: PBIGNUM; const d: PBIGNUM; ctx: PBN_CTX): TIdC_INT; cdecl = nil; +// # define BN_mod(rem,m,d,ctx) BN_div(NULL,(rem),(m),(d),(ctx)) + BN_nnmod: function (r: PBIGNUM; const m: PBIGNUM; const d: PBIGNUM; ctx: PBN_CTX): TIdC_INT; cdecl = nil; + BN_mod_add: function (r: PBIGNUM; const a: PBIGNUM; const b: PBIGNUM; const m: PBIGNUM; ctx: PBN_CTX): TIdC_INT; cdecl = nil; + BN_mod_add_quick: function (r: PBIGNUM; const a: PBIGNUM; const b: PBIGNUM; const m: PBIGNUM): TIdC_INT; cdecl = nil; + BN_mod_sub: function (r: PBIGNUM; const a: PBIGNUM; const b: PBIGNUM; const m: PBIGNUM; ctx: PBN_CTX): TIdC_INT; cdecl = nil; + BN_mod_sub_quick: function (r: PBIGNUM; const a: PBIGNUM; const b: PBIGNUM; const m: PBIGNUM): TIdC_INT; cdecl = nil; + BN_mod_mul: function (r: PBIGNUM; const a: PBIGNUM; const b: PBIGNUM; const m: PBIGNUM; ctx: PBN_CTX): TIdC_INT; cdecl = nil; + BN_mod_sqr: function (r: PBIGNUM; const a: PBIGNUM; const m: PBIGNUM; ctx: PBN_CTX): TIdC_INT; cdecl = nil; + BN_mod_lshift1: function (r: PBIGNUM; const a: PBIGNUM; const m: PBIGNUM; ctx: PBN_CTX): TIdC_INT; cdecl = nil; + BN_mod_lshift1_quick: function (r: PBIGNUM; const a: PBIGNUM; const m: PBIGNUM): TIdC_INT; cdecl = nil; + BN_mod_lshift: function (r: PBIGNUM; const a: PBIGNUM; n: TIdC_INT; const m: PBIGNUM; ctx: PBN_CTX): TIdC_INT; cdecl = nil; + BN_mod_lshift_quick: function (r: PBIGNUM; const a: PBIGNUM; n: TIdC_INT; const m: PBIGNUM): TIdC_INT; cdecl = nil; + + BN_mod_word: function (const a: PBIGNUM; w: BN_ULONG): BN_ULONG; cdecl = nil; + BN_div_word: function (a: PBIGNUM; w: BN_ULONG): BN_ULONG; cdecl = nil; + BN_mul_word: function (a: PBIGNUM; w: BN_ULONG): TIdC_INT; cdecl = nil; + BN_add_word: function (a: PBIGNUM; w: BN_ULONG): TIdC_INT; cdecl = nil; + BN_sub_word: function (a: PBIGNUM; w: BN_ULONG): TIdC_INT; cdecl = nil; + BN_set_word: function (a: PBIGNUM; w: BN_ULONG): TIdC_INT; cdecl = nil; + BN_get_word: function (const a: PBIGNUM): BN_ULONG; cdecl = nil; + + BN_cmp: function (const a: PBIGNUM; const b: PBIGNUM): TIdC_INT; cdecl = nil; + BN_free: procedure (a: PBIGNUM); cdecl = nil; + BN_is_bit_set: function (const a: PBIGNUM; n: TIdC_INT): TIdC_INT; cdecl = nil; + BN_lshift: function (r: PBIGNUM; const a: PBIGNUM; n: TIdC_INT): TIdC_INT; cdecl = nil; + BN_lshift1: function (r: PBIGNUM; const a: PBIGNUM): TIdC_INT; cdecl = nil; + BN_exp: function (r: PBIGNUM; a: PBIGNUM; p: PBIGNUM; ctx: PBN_CTX): TIdC_INT; cdecl = nil; + + BN_mod_exp: function (r: PBIGNUM; a: PBIGNUM; p: PBIGNUM; const m: PBIGNUM; ctx: PBN_CTX): TIdC_INT; cdecl = nil; + BN_mod_exp_mont: function (r: PBIGNUM; a: PBIGNUM; p: PBIGNUM; m: PBIGNUM; ctx: PBN_CTX; m_ctx: PBN_MONT_CTX): TIdC_INT; cdecl = nil; + BN_mod_exp_mont_consttime: function (rr: PBIGNUM; a: PBIGNUM; p: PBIGNUM; m: PBIGNUM; ctx: PBN_CTX; in_mont: PBN_MONT_CTX): TIdC_INT; cdecl = nil; + BN_mod_exp_mont_word: function (r: PBIGNUM; a: BN_ULONG; p: PBIGNUM; m: PBIGNUM; ctx: PBN_CTX; m_ctx: PBN_MONT_CTX): TIdC_INT; cdecl = nil; + BN_mod_exp2_mont: function (r: PBIGNUM; const a1: PBIGNUM; const p1: PBIGNUM; const a2: PBIGNUM; const p2: PBIGNUM; const m: PBIGNUM; ctx: PBN_CTX; m_ctx: PBN_MONT_CTX): TIdC_INT; cdecl = nil; + BN_mod_exp_simple: function (r: PBIGNUM; a: PBIGNUM; p: PBIGNUM; m: PBIGNUM; ctx: PBN_CTX): TIdC_INT; cdecl = nil; + + BN_mask_bits: function (a: PBIGNUM; n: TIdC_INT): TIdC_INT; cdecl = nil; + BN_print: function (bio: PBIO; a: PBIGNUM): TIdC_INT; cdecl = nil; + BN_reciprocal: function (r: PBIGNUM; m: PBIGNUM; len: TIdC_INT; ctx: PBN_CTX): TIdC_INT; cdecl = nil; + BN_rshift: function (r: PBIGNUM; a: PBIGNUM; n: TIdC_INT): TIdC_INT; cdecl = nil; + BN_rshift1: function (r: PBIGNUM; a: PBIGNUM): TIdC_INT; cdecl = nil; + BN_clear: procedure (a: PBIGNUM); cdecl = nil; + BN_dup: function (const a: PBIGNUM): PBIGNUM; cdecl = nil; + BN_ucmp: function (a: PBIGNUM; b: PBIGNUM): TIdC_INT; cdecl = nil; + BN_set_bit: function (a: PBIGNUM; n: TIdC_INT): TIdC_INT; cdecl = nil; + BN_clear_bit: function (a: PBIGNUM; n: TIdC_INT): TIdC_INT; cdecl = nil; + BN_bn2hex: function (a: PBIGNUM): PIdAnsiChar; cdecl = nil; + BN_bn2dec: function (a: PBIGNUM): PIdAnsiChar; cdecl = nil; + BN_hex2bn: function (a: PPBIGNUM; str: PIdAnsiChar): TIdC_INT; cdecl = nil; + BN_dec2bn: function (a: PPBIGNUM; str: PIdAnsiChar): TIdC_INT; cdecl = nil; + BN_asc2bn: function (a: PPBIGNUM; str: PIdAnsiChar): TIdC_INT; cdecl = nil; + BN_gcd: function (r: PBIGNUM; a: PBIGNUM; b: PBIGNUM; ctx: PBN_CTX): TIdC_INT; cdecl = nil; + BN_kronecker: function (a: PBIGNUM; b: PBIGNUM; ctx: PBN_CTX): TIdC_INT; cdecl = nil; + + BN_mod_inverse: function (ret: PBIGNUM; a: PBIGNUM; const n: PBIGNUM; ctx: PBN_CTX): PBIGNUM; cdecl = nil; + BN_mod_sqrt: function (ret: PBIGNUM; a: PBIGNUM; const n: PBIGNUM; ctx: PBN_CTX): PBIGNUM; cdecl = nil; + + BN_consttime_swap: procedure (swap: BN_ULONG; a: PBIGNUM; b: PBIGNUM; nwords: TIdC_INT); cdecl = nil; + + BN_generate_prime_ex: function (ret: PBIGNUM; bits: TIdC_INT; safe: TIdC_INT; const add: PBIGNUM; const rem: PBIGNUM; cb: PBN_GENCB): TIdC_INT; cdecl = nil; + BN_is_prime_ex: function (const p: PBIGNUM; nchecks: TIdC_INT; ctx: PBN_CTX; cb: PBN_GENCB): TIdC_INT; cdecl = nil; + BN_is_prime_fasttest_ex: function (const p: PBIGNUM; nchecks: TIdC_INT; ctx: PBN_CTX; do_trial_division: TIdC_INT; cb: PBN_GENCB): TIdC_INT; cdecl = nil; + BN_X931_generate_Xpq: function (Xp: PBIGNUM; Xq: PBIGNUM; nbits: TIdC_INT; ctx: PBN_CTX): TIdC_INT; cdecl = nil; + BN_X931_derive_prime_ex: function (p: PBIGNUM; p1: PBIGNUM; p2: PBIGNUM; const Xp: PBIGNUM; const Xp1: PBIGNUM; const Xp2: PBIGNUM; const e: PBIGNUM; ctx: PBN_CTX; cb: PBN_GENCB): TIdC_INT; cdecl = nil; + BN_X931_generate_prime_ex: function (p: PBIGNUM; p1: PBIGNUM; p2: PBIGNUM; Xp1: PBIGNUM; Xp2: PBIGNUM; Xp: PBIGNUM; const e: PBIGNUM; ctx: PBN_CTX; cb: PBN_GENCB): TIdC_INT; cdecl = nil; + BN_MONT_CTX_new: function : PBN_MONT_CTX; cdecl = nil; + BN_mod_mul_montgomery: function (r: PBIGNUM; const a: PBIGNUM; const b: PBIGNUM; mont: PBN_MONT_CTX; ctx: PBN_CTX): TIdC_INT; cdecl = nil; + BN_to_montgomery: function (r: PBIGNUM; a: PBIGNUM; mont: PBN_MONT_CTX; ctx: PBN_CTX): TIdC_INT; cdecl = nil; + BN_from_montgomery: function (r: PBIGNUM; a: PBIGNUM; mont: PBN_MONT_CTX; ctx: PBN_CTX): TIdC_INT; cdecl = nil; + BN_MONT_CTX_free: procedure (mont: PBN_MONT_CTX); cdecl = nil; + BN_MONT_CTX_set: function (mont: PBN_MONT_CTX; mod_: PBIGNUM; ctx: PBN_CTX): TIdC_INT; cdecl = nil; + BN_MONT_CTX_copy: function (to_: PBN_MONT_CTX; from: PBN_MONT_CTX): PBN_MONT_CTX; cdecl = nil; +// function BN_MONT_CTX_set_locked(pmont: ^PBN_MONT_CTX; lock: CRYPTO_RWLOCK; mod_: PBIGNUM; ctx: PBN_CTX): PBN_MONT_CTX; + + BN_BLINDING_new: function (const A: PBIGNUM; const Ai: PBIGNUM; mod_: PBIGNUM): PBN_BLINDING; cdecl = nil; + BN_BLINDING_free: procedure (b: PBN_BLINDING); cdecl = nil; + BN_BLINDING_update: function (b: PBN_BLINDING; ctx: PBN_CTX): TIdC_INT; cdecl = nil; + BN_BLINDING_convert: function (n: PBIGNUM; b: PBN_BLINDING; ctx: PBN_CTX): TIdC_INT; cdecl = nil; + BN_BLINDING_invert: function (n: PBIGNUM; b: PBN_BLINDING; ctx: PBN_CTX): TIdC_INT; cdecl = nil; + BN_BLINDING_convert_ex: function (n: PBIGNUM; r: PBIGNUM; b: PBN_BLINDING; v4: PBN_CTX): TIdC_INT; cdecl = nil; + BN_BLINDING_invert_ex: function (n: PBIGNUM; r: PBIGNUM; b: PBN_BLINDING; v2: PBN_CTX): TIdC_INT; cdecl = nil; + + BN_BLINDING_is_current_thread: function (b: PBN_BLINDING): TIdC_INT; cdecl = nil; + BN_BLINDING_set_current_thread: procedure (b: PBN_BLINDING); cdecl = nil; + BN_BLINDING_lock: function (b: PBN_BLINDING): TIdC_INT; cdecl = nil; + BN_BLINDING_unlock: function (b: PBN_BLINDING): TIdC_INT; cdecl = nil; + + BN_BLINDING_get_flags: function (v1: PBN_BLINDING): TIdC_ULONG; cdecl = nil; + BN_BLINDING_set_flags: procedure (v1: PBN_BLINDING; v2: TIdC_ULONG); cdecl = nil; +// function BN_BLINDING_create_param(PBN_BLINDING *b, +// PBIGNUM *e, PBIGNUM *m, PBN_CTX *ctx, +// function ( +// r: PBIGNUM; +// a: PBIGNUM; +// p: PBIGNUM; +// m: PBIGNUM; +// ctx: PBN_CTX; +// m_ctx: PBN_MONT_CTX): TIdC_INT, +// PBN_MONT_CTX *m_ctx): PBN_BLINDING; + + BN_RECP_CTX_free: procedure (recp: PBN_RECP_CTX); cdecl = nil; + BN_RECP_CTX_set: function (recp: PBN_RECP_CTX; rdiv: PBIGNUM; ctx: PBN_CTX): TIdC_INT; cdecl = nil; + BN_mod_mul_reciprocal: function (r: PBIGNUM; x: PBIGNUM; y: PBIGNUM; recp: PBN_RECP_CTX; ctx: PBN_CTX): TIdC_INT; cdecl = nil; + BN_mod_exp_recp: function (r: PBIGNUM; a: PBIGNUM; p: PBIGNUM; m: PBIGNUM; ctx: PBN_CTX): TIdC_INT; cdecl = nil; + BN_div_recp: function (dv: PBIGNUM; rem: PBIGNUM; m: PBIGNUM; recp: PBN_RECP_CTX; ctx: PBN_CTX): TIdC_INT; cdecl = nil; + + (* + * Functions for arithmetic over binary polynomials represented by BIGNUMs. + * The BIGNUM::neg property of BIGNUMs representing binary polynomials is + * ignored. Note that input arguments are not const so that their bit arrays + * can be expanded to the appropriate size if needed. + *) + + (* + * r = a + b + *) + BN_GF2m_add: function (r: PBIGNUM; a: PBIGNUM; b: PBIGNUM): TIdC_INT; cdecl = nil; +// # define BN_GF2m_sub(r, a, b) BN_GF2m_add(r, a, b) + (* + * r=a mod p + *) + BN_GF2m_mod: function (r: PBIGNUM; a: PBIGNUM; p: PBIGNUM): TIdC_INT; cdecl = nil; + (* r = (a * b) mod p *) + BN_GF2m_mod_mul: function (r: PBIGNUM; a: PBIGNUM; b: PBIGNUM; p: PBIGNUM; ctx: PBN_CTX): TIdC_INT; cdecl = nil; + (* r = (a * a) mod p *) + BN_GF2m_mod_sqr: function (r: PBIGNUM; a: PBIGNUM; p: PBIGNUM; ctx: PBN_CTX): TIdC_INT; cdecl = nil; + (* r = (1 / b) mod p *) + BN_GF2m_mod_inv: function (r: PBIGNUM; b: PBIGNUM; p: PBIGNUM; ctx: PBN_CTX): TIdC_INT; cdecl = nil; + (* r = (a / b) mod p *) + BN_GF2m_mod_div: function (r: PBIGNUM; a: PBIGNUM; b: PBIGNUM; p: PBIGNUM; ctx: PBN_CTX): TIdC_INT; cdecl = nil; + (* r = (a ^ b) mod p *) + BN_GF2m_mod_exp: function (r: PBIGNUM; a: PBIGNUM; b: PBIGNUM; p: PBIGNUM; ctx: PBN_CTX): TIdC_INT; cdecl = nil; + (* r = sqrt(a) mod p *) + BN_GF2m_mod_sqrt: function (r: PBIGNUM; a: PBIGNUM; p: PBIGNUM; ctx: PBN_CTX): TIdC_INT; cdecl = nil; + (* r^2 + r = a mod p *) + BN_GF2m_mod_solve_quad: function (r: PBIGNUM; a: PBIGNUM; p: PBIGNUM; ctx: PBN_CTX): TIdC_INT; cdecl = nil; +// # define BN_GF2m_cmp(a, b) BN_ucmp((a), (b)) + (*- + * Some functions allow for representation of the irreducible polynomials + * as an unsigned int[], say p. The irreducible f(t) is then of the form: + * t^p[0] + t^p[1] + ... + t^p[k] + * where m = p[0] > p[1] > ... > p[k] = 0. + *) + (* r = a mod p *) +// function BN_GF2m_mod_arr(r: PBIGNUM; a: PBIGNUM; p: array of TIdC_INT): TIdC_INT; + (* r = (a * b) mod p *) +// function BN_GF2m_mod_mul_arr(r: PBIGNUM; a: PBIGNUM; p: PBIGNUM; p: array of TIdC_INT; ctx: PBN_CTX): TIdC_INT; + (* r = (a * a) mod p *) +// function BN_GF2m_mod_sqr_arr(r: PBIGNUM; a: PBIGNUM; p: array of TIdC_INT; ctx: PBN_CTX): TIdC_INT; + (* r = (1 / b) mod p *) +// function BN_GF2m_mod_inv_arr(r: PBIGNUM; b: PBIGNUM; p: array of TIdC_INT; ctx: PBN_CTX): TIdC_INT; + (* r = (a / b) mod p *) +// function BN_GF2m_mod_div_arr(r: PBIGNUM; a: PBIGNUM; b: PBIGNUM; p: array of TIdC_INT; ctx: PBN_CTX): TIdC_INT; + (* r = (a ^ b) mod p *) +// function BN_GF2m_mod_exp_arr(r: PBIGNUM; a: PBIGNUM; b: PBIGNUM; p: array of TIdC_INT; ctx: PBN_CTX): TIdC_INT; + (* r = sqrt(a) mod p *) +// function BN_GF2m_mod_sqrt_arr(r: PBIGNUM; a: PBIGNUM; p: array of TIdC_INT; ctx: PBN_CTX): TIdC_INT; + (* r^2 + r = a mod p *) +// function BN_GF2m_mod_solve_quad_arr(r: PBIGNUM; a: PBIGNUM; p: array of TIdC_INT; ctx: PBN_CTX): TIdC_INT; +// function BN_GF2m_poly2arr(a: PBIGNUM; p: array of TIdC_INT; max: TIdC_INT): TIdC_INT; +// function BN_GF2m_arr2poly(p: array of TIdC_INT; a: PBIGNUM): TIdC_INT; + + (* + * faster mod functions for the 'NIST primes' 0 <= a < p^2 + *) + BN_nist_mod_192: function (r: PBIGNUM; a: PBIGNUM; p: PBIGNUM; ctx: PBN_CTX): TIdC_INT; cdecl = nil; + BN_nist_mod_224: function (r: PBIGNUM; a: PBIGNUM; p: PBIGNUM; ctx: PBN_CTX): TIdC_INT; cdecl = nil; + BN_nist_mod_256: function (r: PBIGNUM; a: PBIGNUM; p: PBIGNUM; ctx: PBN_CTX): TIdC_INT; cdecl = nil; + BN_nist_mod_384: function (r: PBIGNUM; a: PBIGNUM; p: PBIGNUM; ctx: PBN_CTX): TIdC_INT; cdecl = nil; + BN_nist_mod_521: function (r: PBIGNUM; a: PBIGNUM; p: PBIGNUM; ctx: PBN_CTX): TIdC_INT; cdecl = nil; + + BN_get0_nist_prime_192: function : PBIGNUM; cdecl = nil; + BN_get0_nist_prime_224: function : PBIGNUM; cdecl = nil; + BN_get0_nist_prime_256: function : PBIGNUM; cdecl = nil; + BN_get0_nist_prime_384: function : PBIGNUM; cdecl = nil; + BN_get0_nist_prime_521: function : PBIGNUM; cdecl = nil; + +//int (*BN_nist_mod_func(const BIGNUM *p)) (BIGNUM *r, const BIGNUM *a, +// const BIGNUM *field, BN_CTX *ctx); + + BN_generate_dsa_nonce: function (out_: PBIGNUM; range: PBIGNUM; priv: PBIGNUM; const message_: PByte; message_len: TIdC_SIZET; ctx: PBN_CTX): TIdC_INT; cdecl = nil; + + (* Primes from RFC 2409 *) + BN_get_rfc2409_prime_768: function (bn: PBIGNUM ): PBIGNUM; cdecl = nil; + BN_get_rfc2409_prime_1024: function (bn: PBIGNUM): PBIGNUM; cdecl = nil; + + (* Primes from RFC 3526 *) + BN_get_rfc3526_prime_1536: function (bn: PBIGNUM): PBIGNUM; cdecl = nil; + BN_get_rfc3526_prime_2048: function (bn: PBIGNUM): PBIGNUM; cdecl = nil; + BN_get_rfc3526_prime_3072: function (bn: PBIGNUM): PBIGNUM; cdecl = nil; + BN_get_rfc3526_prime_4096: function (bn: PBIGNUM): PBIGNUM; cdecl = nil; + BN_get_rfc3526_prime_6144: function (bn: PBIGNUM): PBIGNUM; cdecl = nil; + BN_get_rfc3526_prime_8192: function (bn: PBIGNUM): PBIGNUM; cdecl = nil; + + BN_bntest_rand: function (rnd: PBIGNUM; bits: TIdC_INT; top: TIdC_INT; bottom: TIdC_INT): TIdC_INT; cdecl = nil; + +{$ELSE} + procedure BN_set_flags(b: PBIGNUM; n: TIdC_INT) cdecl; external CLibCrypto; + function BN_get_flags(b: PBIGNUM; n: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + + (* + * get a clone of a BIGNUM with changed flags, for *temporary* use only (the + * two BIGNUMs cannot be used in parallel!). Also only for *read only* use. The + * value |dest| should be a newly allocated BIGNUM obtained via BN_new() that + * has not been otherwise initialised or used. + *) + procedure BN_with_flags(dest: PBIGNUM; b: PBIGNUM; flags: TIdC_INT) cdecl; external CLibCrypto; + (* Wrapper function to make using BN_GENCB easier *) + function BN_GENCB_call(cb: PBN_GENCB; a: TIdC_INT; b: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + + function BN_GENCB_new: PBN_GENCB cdecl; external CLibCrypto; + procedure BN_GENCB_free(cb: PBN_GENCB) cdecl; external CLibCrypto; + + (* Populate a PBN_GENCB structure with an "old"-style callback *) + procedure BN_GENCB_set_old(gencb: PBN_GENCB; callback: BN_GENCB_set_old_cb; cb_arg: Pointer) cdecl; external CLibCrypto; + + (* Populate a PBN_GENCB structure with a "new"-style callback *) + procedure BN_GENCB_set(gencb: PBN_GENCB; callback: BN_GENCB_set_cb; cb_arg: Pointer) cdecl; external CLibCrypto; + + function BN_GENCB_get_arg(cb: PBN_GENCB): Pointer cdecl; external CLibCrypto; + + (* + * BN_prime_checks_for_size() returns the number of Miller-Rabin iterations + * that will be done for checking that a random number is probably prime. The + * error rate for accepting a composite number as prime depends on the size of + * the prime |b|. The error rates used are for calculating an RSA key with 2 primes, + * and so the level is what you would expect for a key of double the size of the + * prime. + * + * This table is generated using the algorithm of FIPS PUB 186-4 + * Digital Signature Standard (DSS), section F.1, page 117. + * (https://dx.doi.org/10.6028/NIST.FIPS.186-4) + * + * The following magma script was used to generate the output: + * securitybits:=125; + * k:=1024; + * for t:=1 to 65 do + * for M:=3 to Floor(2*Sqrt(k-1)-1) do + * S:=0; + * // Sum over m + * for m:=3 to M do + * s:=0; + * // Sum over j + * for j:=2 to m do + * s+:=(RealField(32)!2)^-(j+(k-1)/j); + * end for; + * S+:=2^(m-(m-1)*t)*s; + * end for; + * A:=2^(k-2-M*t); + * B:=8*(Pi(RealField(32))^2-6)/3*2^(k-2)*S; + * pkt:=2.00743*Log(2)*k*2^-k*(A+B); + * seclevel:=Floor(-Log(2,pkt)); + * if seclevel ge securitybits then + * printf "k: %5o, security: %o bits (t: %o, M: %o)\n",k,seclevel,t,M; + * break; + * end if; + * end for; + * if seclevel ge securitybits then break; end if; + * end for; + * + * It can be run online at: + * http://magma.maths.usyd.edu.au/calc + * + * And will output: + * k: 1024, security: 129 bits (t: 6, M: 23) + * + * k is the number of bits of the prime, securitybits is the level we want to + * reach. + * + * prime length | RSA key size | # MR tests | security level + * -------------+--------------|------------+--------------- + * (b) >= 6394 | >= 12788 | 3 | 256 bit + * (b) >= 3747 | >= 7494 | 3 | 192 bit + * (b) >= 1345 | >= 2690 | 4 | 128 bit + * (b) >= 1080 | >= 2160 | 5 | 128 bit + * (b) >= 852 | >= 1704 | 5 | 112 bit + * (b) >= 476 | >= 952 | 5 | 80 bit + * (b) >= 400 | >= 800 | 6 | 80 bit + * (b) >= 347 | >= 694 | 7 | 80 bit + * (b) >= 308 | >= 616 | 8 | 80 bit + * (b) >= 55 | >= 110 | 27 | 64 bit + * (b) >= 6 | >= 12 | 34 | 64 bit + *) + +// # define BN_prime_checks_for_size(b) ((b) >= 3747 ? 3 : \ +// (b) >= 1345 ? 4 : \ +// (b) >= 476 ? 5 : \ +// (b) >= 400 ? 6 : \ +// (b) >= 347 ? 7 : \ +// (b) >= 308 ? 8 : \ +// (b) >= 55 ? 27 : \ +// (* b >= 6 *) 34) +// +// # define BN_num_bytes(a) ((BN_num_bits(a)+7)/8) + + function BN_abs_is_word(a: PBIGNUM; w: BN_ULONG): TIdC_INT cdecl; external CLibCrypto; + function BN_is_zero(a: PBIGNUM): TIdC_INT cdecl; external CLibCrypto; + function BN_is_one(a: PBIGNUM): TIdC_INT cdecl; external CLibCrypto; + function BN_is_word(a: PBIGNUM; w: BN_ULONG): TIdC_INT cdecl; external CLibCrypto; + function BN_is_odd(a: PBIGNUM): TIdC_INT cdecl; external CLibCrypto; + +// # define BN_one(a) (BN_set_word((a),1)) + + procedure BN_zero_ex(a: PBIGNUM) cdecl; external CLibCrypto; + + function BN_value_one: PBIGNUM cdecl; external CLibCrypto; + function BN_options: PIdAnsiChar cdecl; external CLibCrypto; + function BN_CTX_new: PBN_CTX cdecl; external CLibCrypto; + function BN_CTX_secure_new: PBN_CTX cdecl; external CLibCrypto; + procedure BN_CTX_free(c: PBN_CTX) cdecl; external CLibCrypto; + procedure BN_CTX_start(ctx: PBN_CTX) cdecl; external CLibCrypto; + function BN_CTX_get(ctx: PBN_CTX): PBIGNUM cdecl; external CLibCrypto; + procedure BN_CTX_end(ctx: PBN_CTX) cdecl; external CLibCrypto; + function BN_rand(rnd: PBIGNUM; bits: TIdC_INT; top: TIdC_INT; bottom: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function BN_priv_rand(rnd: PBIGNUM; bits: TIdC_INT; top: TIdC_INT; bottom: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function BN_rand_range(rnd: PBIGNUM; range: PBIGNUM): TIdC_INT cdecl; external CLibCrypto; + function BN_priv_rand_range(rnd: PBIGNUM; range: PBIGNUM): TIdC_INT cdecl; external CLibCrypto; + function BN_pseudo_rand(rnd: PBIGNUM; bits: TIdC_INT; top: TIdC_INT; bottom: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function BN_pseudo_rand_range(rnd: PBIGNUM; range: PBIGNUM): TIdC_INT cdecl; external CLibCrypto; + function BN_num_bits(a: PBIGNUM): TIdC_INT cdecl; external CLibCrypto; + function BN_num_bits_word(l: BN_ULONG): TIdC_INT cdecl; external CLibCrypto; + function BN_security_bits(L: TIdC_INT; N: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function BN_new: PBIGNUM cdecl; external CLibCrypto; + function BN_secure_new: PBIGNUM cdecl; external CLibCrypto; + procedure BN_clear_free(a: PBIGNUM) cdecl; external CLibCrypto; + function BN_copy(a: PBIGNUM; b: PBIGNUM): PBIGNUM cdecl; external CLibCrypto; + procedure BN_swap(a: PBIGNUM; b: PBIGNUM) cdecl; external CLibCrypto; + function BN_bin2bn(const s: PByte; len: TIdC_INT; ret: PBIGNUM): PBIGNUM cdecl; external CLibCrypto; + function BN_bn2bin(const a: PBIGNUM; to_: PByte): TIdC_INT cdecl; external CLibCrypto; + function BN_bn2binpad(const a: PBIGNUM; to_: PByte; tolen: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function BN_lebin2bn(const s: PByte; len: TIdC_INT; ret: PBIGNUM): PBIGNUM cdecl; external CLibCrypto; + function BN_bn2lebinpad(a: PBIGNUM; to_: PByte; tolen: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function BN_mpi2bn(const s: PByte; len: TIdC_INT; ret: PBIGNUM): PBIGNUM cdecl; external CLibCrypto; + function BN_bn2mpi(a: PBIGNUM; to_: PByte): TIdC_INT cdecl; external CLibCrypto; + function BN_sub(r: PBIGNUM; const a: PBIGNUM; const b: PBIGNUM): TIdC_INT cdecl; external CLibCrypto; + function BN_usub(r: PBIGNUM; const a: PBIGNUM; const b: PBIGNUM): TIdC_INT cdecl; external CLibCrypto; + function BN_uadd(r: PBIGNUM; const a: PBIGNUM; const b: PBIGNUM): TIdC_INT cdecl; external CLibCrypto; + function BN_add(r: PBIGNUM; const a: PBIGNUM; const b: PBIGNUM): TIdC_INT cdecl; external CLibCrypto; + function BN_mul(r: PBIGNUM; const a: PBIGNUM; const b: PBIGNUM; ctx: PBN_CTX): TIdC_INT cdecl; external CLibCrypto; + function BN_sqr(r: PBIGNUM; const a: PBIGNUM; ctx: PBN_CTX): TIdC_INT cdecl; external CLibCrypto; + + (** BN_set_negative sets sign of a BIGNUM + * \param b pointer to the BIGNUM object + * \param n 0 if the BIGNUM b should be positive and a value != 0 otherwise + *) + procedure BN_set_negative(b: PBIGNUM; n: TIdC_INT) cdecl; external CLibCrypto; + (** BN_is_negative returns 1 if the BIGNUM is negative + * \param b pointer to the BIGNUM object + * \return 1 if a < 0 and 0 otherwise + *) + function BN_is_negative(b: PBIGNUM): TIdC_INT cdecl; external CLibCrypto; + + function BN_div(dv: PBIGNUM; rem: PBIGNUM; const m: PBIGNUM; const d: PBIGNUM; ctx: PBN_CTX): TIdC_INT cdecl; external CLibCrypto; +// # define BN_mod(rem,m,d,ctx) BN_div(NULL,(rem),(m),(d),(ctx)) + function BN_nnmod(r: PBIGNUM; const m: PBIGNUM; const d: PBIGNUM; ctx: PBN_CTX): TIdC_INT cdecl; external CLibCrypto; + function BN_mod_add(r: PBIGNUM; const a: PBIGNUM; const b: PBIGNUM; const m: PBIGNUM; ctx: PBN_CTX): TIdC_INT cdecl; external CLibCrypto; + function BN_mod_add_quick(r: PBIGNUM; const a: PBIGNUM; const b: PBIGNUM; const m: PBIGNUM): TIdC_INT cdecl; external CLibCrypto; + function BN_mod_sub(r: PBIGNUM; const a: PBIGNUM; const b: PBIGNUM; const m: PBIGNUM; ctx: PBN_CTX): TIdC_INT cdecl; external CLibCrypto; + function BN_mod_sub_quick(r: PBIGNUM; const a: PBIGNUM; const b: PBIGNUM; const m: PBIGNUM): TIdC_INT cdecl; external CLibCrypto; + function BN_mod_mul(r: PBIGNUM; const a: PBIGNUM; const b: PBIGNUM; const m: PBIGNUM; ctx: PBN_CTX): TIdC_INT cdecl; external CLibCrypto; + function BN_mod_sqr(r: PBIGNUM; const a: PBIGNUM; const m: PBIGNUM; ctx: PBN_CTX): TIdC_INT cdecl; external CLibCrypto; + function BN_mod_lshift1(r: PBIGNUM; const a: PBIGNUM; const m: PBIGNUM; ctx: PBN_CTX): TIdC_INT cdecl; external CLibCrypto; + function BN_mod_lshift1_quick(r: PBIGNUM; const a: PBIGNUM; const m: PBIGNUM): TIdC_INT cdecl; external CLibCrypto; + function BN_mod_lshift(r: PBIGNUM; const a: PBIGNUM; n: TIdC_INT; const m: PBIGNUM; ctx: PBN_CTX): TIdC_INT cdecl; external CLibCrypto; + function BN_mod_lshift_quick(r: PBIGNUM; const a: PBIGNUM; n: TIdC_INT; const m: PBIGNUM): TIdC_INT cdecl; external CLibCrypto; + + function BN_mod_word(const a: PBIGNUM; w: BN_ULONG): BN_ULONG cdecl; external CLibCrypto; + function BN_div_word(a: PBIGNUM; w: BN_ULONG): BN_ULONG cdecl; external CLibCrypto; + function BN_mul_word(a: PBIGNUM; w: BN_ULONG): TIdC_INT cdecl; external CLibCrypto; + function BN_add_word(a: PBIGNUM; w: BN_ULONG): TIdC_INT cdecl; external CLibCrypto; + function BN_sub_word(a: PBIGNUM; w: BN_ULONG): TIdC_INT cdecl; external CLibCrypto; + function BN_set_word(a: PBIGNUM; w: BN_ULONG): TIdC_INT cdecl; external CLibCrypto; + function BN_get_word(const a: PBIGNUM): BN_ULONG cdecl; external CLibCrypto; + + function BN_cmp(const a: PBIGNUM; const b: PBIGNUM): TIdC_INT cdecl; external CLibCrypto; + procedure BN_free(a: PBIGNUM) cdecl; external CLibCrypto; + function BN_is_bit_set(const a: PBIGNUM; n: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function BN_lshift(r: PBIGNUM; const a: PBIGNUM; n: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function BN_lshift1(r: PBIGNUM; const a: PBIGNUM): TIdC_INT cdecl; external CLibCrypto; + function BN_exp(r: PBIGNUM; a: PBIGNUM; p: PBIGNUM; ctx: PBN_CTX): TIdC_INT cdecl; external CLibCrypto; + + function BN_mod_exp(r: PBIGNUM; a: PBIGNUM; p: PBIGNUM; const m: PBIGNUM; ctx: PBN_CTX): TIdC_INT cdecl; external CLibCrypto; + function BN_mod_exp_mont(r: PBIGNUM; a: PBIGNUM; p: PBIGNUM; m: PBIGNUM; ctx: PBN_CTX; m_ctx: PBN_MONT_CTX): TIdC_INT cdecl; external CLibCrypto; + function BN_mod_exp_mont_consttime(rr: PBIGNUM; a: PBIGNUM; p: PBIGNUM; m: PBIGNUM; ctx: PBN_CTX; in_mont: PBN_MONT_CTX): TIdC_INT cdecl; external CLibCrypto; + function BN_mod_exp_mont_word(r: PBIGNUM; a: BN_ULONG; p: PBIGNUM; m: PBIGNUM; ctx: PBN_CTX; m_ctx: PBN_MONT_CTX): TIdC_INT cdecl; external CLibCrypto; + function BN_mod_exp2_mont(r: PBIGNUM; const a1: PBIGNUM; const p1: PBIGNUM; const a2: PBIGNUM; const p2: PBIGNUM; const m: PBIGNUM; ctx: PBN_CTX; m_ctx: PBN_MONT_CTX): TIdC_INT cdecl; external CLibCrypto; + function BN_mod_exp_simple(r: PBIGNUM; a: PBIGNUM; p: PBIGNUM; m: PBIGNUM; ctx: PBN_CTX): TIdC_INT cdecl; external CLibCrypto; + + function BN_mask_bits(a: PBIGNUM; n: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function BN_print(bio: PBIO; a: PBIGNUM): TIdC_INT cdecl; external CLibCrypto; + function BN_reciprocal(r: PBIGNUM; m: PBIGNUM; len: TIdC_INT; ctx: PBN_CTX): TIdC_INT cdecl; external CLibCrypto; + function BN_rshift(r: PBIGNUM; a: PBIGNUM; n: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function BN_rshift1(r: PBIGNUM; a: PBIGNUM): TIdC_INT cdecl; external CLibCrypto; + procedure BN_clear(a: PBIGNUM) cdecl; external CLibCrypto; + function BN_dup(const a: PBIGNUM): PBIGNUM cdecl; external CLibCrypto; + function BN_ucmp(a: PBIGNUM; b: PBIGNUM): TIdC_INT cdecl; external CLibCrypto; + function BN_set_bit(a: PBIGNUM; n: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function BN_clear_bit(a: PBIGNUM; n: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function BN_bn2hex(a: PBIGNUM): PIdAnsiChar cdecl; external CLibCrypto; + function BN_bn2dec(a: PBIGNUM): PIdAnsiChar cdecl; external CLibCrypto; + function BN_hex2bn(a: PPBIGNUM; str: PIdAnsiChar): TIdC_INT cdecl; external CLibCrypto; + function BN_dec2bn(a: PPBIGNUM; str: PIdAnsiChar): TIdC_INT cdecl; external CLibCrypto; + function BN_asc2bn(a: PPBIGNUM; str: PIdAnsiChar): TIdC_INT cdecl; external CLibCrypto; + function BN_gcd(r: PBIGNUM; a: PBIGNUM; b: PBIGNUM; ctx: PBN_CTX): TIdC_INT cdecl; external CLibCrypto; + function BN_kronecker(a: PBIGNUM; b: PBIGNUM; ctx: PBN_CTX): TIdC_INT cdecl; external CLibCrypto; + + function BN_mod_inverse(ret: PBIGNUM; a: PBIGNUM; const n: PBIGNUM; ctx: PBN_CTX): PBIGNUM cdecl; external CLibCrypto; + function BN_mod_sqrt(ret: PBIGNUM; a: PBIGNUM; const n: PBIGNUM; ctx: PBN_CTX): PBIGNUM cdecl; external CLibCrypto; + + procedure BN_consttime_swap(swap: BN_ULONG; a: PBIGNUM; b: PBIGNUM; nwords: TIdC_INT) cdecl; external CLibCrypto; + + function BN_generate_prime_ex(ret: PBIGNUM; bits: TIdC_INT; safe: TIdC_INT; const add: PBIGNUM; const rem: PBIGNUM; cb: PBN_GENCB): TIdC_INT cdecl; external CLibCrypto; + function BN_is_prime_ex(const p: PBIGNUM; nchecks: TIdC_INT; ctx: PBN_CTX; cb: PBN_GENCB): TIdC_INT cdecl; external CLibCrypto; + function BN_is_prime_fasttest_ex(const p: PBIGNUM; nchecks: TIdC_INT; ctx: PBN_CTX; do_trial_division: TIdC_INT; cb: PBN_GENCB): TIdC_INT cdecl; external CLibCrypto; + function BN_X931_generate_Xpq(Xp: PBIGNUM; Xq: PBIGNUM; nbits: TIdC_INT; ctx: PBN_CTX): TIdC_INT cdecl; external CLibCrypto; + function BN_X931_derive_prime_ex(p: PBIGNUM; p1: PBIGNUM; p2: PBIGNUM; const Xp: PBIGNUM; const Xp1: PBIGNUM; const Xp2: PBIGNUM; const e: PBIGNUM; ctx: PBN_CTX; cb: PBN_GENCB): TIdC_INT cdecl; external CLibCrypto; + function BN_X931_generate_prime_ex(p: PBIGNUM; p1: PBIGNUM; p2: PBIGNUM; Xp1: PBIGNUM; Xp2: PBIGNUM; Xp: PBIGNUM; const e: PBIGNUM; ctx: PBN_CTX; cb: PBN_GENCB): TIdC_INT cdecl; external CLibCrypto; + function BN_MONT_CTX_new: PBN_MONT_CTX cdecl; external CLibCrypto; + function BN_mod_mul_montgomery(r: PBIGNUM; const a: PBIGNUM; const b: PBIGNUM; mont: PBN_MONT_CTX; ctx: PBN_CTX): TIdC_INT cdecl; external CLibCrypto; + function BN_to_montgomery(r: PBIGNUM; a: PBIGNUM; mont: PBN_MONT_CTX; ctx: PBN_CTX): TIdC_INT cdecl; external CLibCrypto; + function BN_from_montgomery(r: PBIGNUM; a: PBIGNUM; mont: PBN_MONT_CTX; ctx: PBN_CTX): TIdC_INT cdecl; external CLibCrypto; + procedure BN_MONT_CTX_free(mont: PBN_MONT_CTX) cdecl; external CLibCrypto; + function BN_MONT_CTX_set(mont: PBN_MONT_CTX; mod_: PBIGNUM; ctx: PBN_CTX): TIdC_INT cdecl; external CLibCrypto; + function BN_MONT_CTX_copy(to_: PBN_MONT_CTX; from: PBN_MONT_CTX): PBN_MONT_CTX cdecl; external CLibCrypto; +// function BN_MONT_CTX_set_locked(pmont: ^PBN_MONT_CTX; lock: CRYPTO_RWLOCK; mod_: PBIGNUM; ctx: PBN_CTX): PBN_MONT_CTX; + + function BN_BLINDING_new(const A: PBIGNUM; const Ai: PBIGNUM; mod_: PBIGNUM): PBN_BLINDING cdecl; external CLibCrypto; + procedure BN_BLINDING_free(b: PBN_BLINDING) cdecl; external CLibCrypto; + function BN_BLINDING_update(b: PBN_BLINDING; ctx: PBN_CTX): TIdC_INT cdecl; external CLibCrypto; + function BN_BLINDING_convert(n: PBIGNUM; b: PBN_BLINDING; ctx: PBN_CTX): TIdC_INT cdecl; external CLibCrypto; + function BN_BLINDING_invert(n: PBIGNUM; b: PBN_BLINDING; ctx: PBN_CTX): TIdC_INT cdecl; external CLibCrypto; + function BN_BLINDING_convert_ex(n: PBIGNUM; r: PBIGNUM; b: PBN_BLINDING; v4: PBN_CTX): TIdC_INT cdecl; external CLibCrypto; + function BN_BLINDING_invert_ex(n: PBIGNUM; r: PBIGNUM; b: PBN_BLINDING; v2: PBN_CTX): TIdC_INT cdecl; external CLibCrypto; + + function BN_BLINDING_is_current_thread(b: PBN_BLINDING): TIdC_INT cdecl; external CLibCrypto; + procedure BN_BLINDING_set_current_thread(b: PBN_BLINDING) cdecl; external CLibCrypto; + function BN_BLINDING_lock(b: PBN_BLINDING): TIdC_INT cdecl; external CLibCrypto; + function BN_BLINDING_unlock(b: PBN_BLINDING): TIdC_INT cdecl; external CLibCrypto; + + function BN_BLINDING_get_flags(v1: PBN_BLINDING): TIdC_ULONG cdecl; external CLibCrypto; + procedure BN_BLINDING_set_flags(v1: PBN_BLINDING; v2: TIdC_ULONG) cdecl; external CLibCrypto; +// function BN_BLINDING_create_param(PBN_BLINDING *b, +// PBIGNUM *e, PBIGNUM *m, PBN_CTX *ctx, +// function ( +// r: PBIGNUM; +// a: PBIGNUM; +// p: PBIGNUM; +// m: PBIGNUM; +// ctx: PBN_CTX; +// m_ctx: PBN_MONT_CTX): TIdC_INT, +// PBN_MONT_CTX *m_ctx): PBN_BLINDING; + + procedure BN_RECP_CTX_free(recp: PBN_RECP_CTX) cdecl; external CLibCrypto; + function BN_RECP_CTX_set(recp: PBN_RECP_CTX; rdiv: PBIGNUM; ctx: PBN_CTX): TIdC_INT cdecl; external CLibCrypto; + function BN_mod_mul_reciprocal(r: PBIGNUM; x: PBIGNUM; y: PBIGNUM; recp: PBN_RECP_CTX; ctx: PBN_CTX): TIdC_INT cdecl; external CLibCrypto; + function BN_mod_exp_recp(r: PBIGNUM; a: PBIGNUM; p: PBIGNUM; m: PBIGNUM; ctx: PBN_CTX): TIdC_INT cdecl; external CLibCrypto; + function BN_div_recp(dv: PBIGNUM; rem: PBIGNUM; m: PBIGNUM; recp: PBN_RECP_CTX; ctx: PBN_CTX): TIdC_INT cdecl; external CLibCrypto; + + (* + * Functions for arithmetic over binary polynomials represented by BIGNUMs. + * The BIGNUM::neg property of BIGNUMs representing binary polynomials is + * ignored. Note that input arguments are not const so that their bit arrays + * can be expanded to the appropriate size if needed. + *) + + (* + * r = a + b + *) + function BN_GF2m_add(r: PBIGNUM; a: PBIGNUM; b: PBIGNUM): TIdC_INT cdecl; external CLibCrypto; +// # define BN_GF2m_sub(r, a, b) BN_GF2m_add(r, a, b) + (* + * r=a mod p + *) + function BN_GF2m_mod(r: PBIGNUM; a: PBIGNUM; p: PBIGNUM): TIdC_INT cdecl; external CLibCrypto; + (* r = (a * b) mod p *) + function BN_GF2m_mod_mul(r: PBIGNUM; a: PBIGNUM; b: PBIGNUM; p: PBIGNUM; ctx: PBN_CTX): TIdC_INT cdecl; external CLibCrypto; + (* r = (a * a) mod p *) + function BN_GF2m_mod_sqr(r: PBIGNUM; a: PBIGNUM; p: PBIGNUM; ctx: PBN_CTX): TIdC_INT cdecl; external CLibCrypto; + (* r = (1 / b) mod p *) + function BN_GF2m_mod_inv(r: PBIGNUM; b: PBIGNUM; p: PBIGNUM; ctx: PBN_CTX): TIdC_INT cdecl; external CLibCrypto; + (* r = (a / b) mod p *) + function BN_GF2m_mod_div(r: PBIGNUM; a: PBIGNUM; b: PBIGNUM; p: PBIGNUM; ctx: PBN_CTX): TIdC_INT cdecl; external CLibCrypto; + (* r = (a ^ b) mod p *) + function BN_GF2m_mod_exp(r: PBIGNUM; a: PBIGNUM; b: PBIGNUM; p: PBIGNUM; ctx: PBN_CTX): TIdC_INT cdecl; external CLibCrypto; + (* r = sqrt(a) mod p *) + function BN_GF2m_mod_sqrt(r: PBIGNUM; a: PBIGNUM; p: PBIGNUM; ctx: PBN_CTX): TIdC_INT cdecl; external CLibCrypto; + (* r^2 + r = a mod p *) + function BN_GF2m_mod_solve_quad(r: PBIGNUM; a: PBIGNUM; p: PBIGNUM; ctx: PBN_CTX): TIdC_INT cdecl; external CLibCrypto; +// # define BN_GF2m_cmp(a, b) BN_ucmp((a), (b)) + (*- + * Some functions allow for representation of the irreducible polynomials + * as an unsigned int[], say p. The irreducible f(t) is then of the form: + * t^p[0] + t^p[1] + ... + t^p[k] + * where m = p[0] > p[1] > ... > p[k] = 0. + *) + (* r = a mod p *) +// function BN_GF2m_mod_arr(r: PBIGNUM; a: PBIGNUM; p: array of TIdC_INT): TIdC_INT; + (* r = (a * b) mod p *) +// function BN_GF2m_mod_mul_arr(r: PBIGNUM; a: PBIGNUM; p: PBIGNUM; p: array of TIdC_INT; ctx: PBN_CTX): TIdC_INT; + (* r = (a * a) mod p *) +// function BN_GF2m_mod_sqr_arr(r: PBIGNUM; a: PBIGNUM; p: array of TIdC_INT; ctx: PBN_CTX): TIdC_INT; + (* r = (1 / b) mod p *) +// function BN_GF2m_mod_inv_arr(r: PBIGNUM; b: PBIGNUM; p: array of TIdC_INT; ctx: PBN_CTX): TIdC_INT; + (* r = (a / b) mod p *) +// function BN_GF2m_mod_div_arr(r: PBIGNUM; a: PBIGNUM; b: PBIGNUM; p: array of TIdC_INT; ctx: PBN_CTX): TIdC_INT; + (* r = (a ^ b) mod p *) +// function BN_GF2m_mod_exp_arr(r: PBIGNUM; a: PBIGNUM; b: PBIGNUM; p: array of TIdC_INT; ctx: PBN_CTX): TIdC_INT; + (* r = sqrt(a) mod p *) +// function BN_GF2m_mod_sqrt_arr(r: PBIGNUM; a: PBIGNUM; p: array of TIdC_INT; ctx: PBN_CTX): TIdC_INT; + (* r^2 + r = a mod p *) +// function BN_GF2m_mod_solve_quad_arr(r: PBIGNUM; a: PBIGNUM; p: array of TIdC_INT; ctx: PBN_CTX): TIdC_INT; +// function BN_GF2m_poly2arr(a: PBIGNUM; p: array of TIdC_INT; max: TIdC_INT): TIdC_INT; +// function BN_GF2m_arr2poly(p: array of TIdC_INT; a: PBIGNUM): TIdC_INT; + + (* + * faster mod functions for the 'NIST primes' 0 <= a < p^2 + *) + function BN_nist_mod_192(r: PBIGNUM; a: PBIGNUM; p: PBIGNUM; ctx: PBN_CTX): TIdC_INT cdecl; external CLibCrypto; + function BN_nist_mod_224(r: PBIGNUM; a: PBIGNUM; p: PBIGNUM; ctx: PBN_CTX): TIdC_INT cdecl; external CLibCrypto; + function BN_nist_mod_256(r: PBIGNUM; a: PBIGNUM; p: PBIGNUM; ctx: PBN_CTX): TIdC_INT cdecl; external CLibCrypto; + function BN_nist_mod_384(r: PBIGNUM; a: PBIGNUM; p: PBIGNUM; ctx: PBN_CTX): TIdC_INT cdecl; external CLibCrypto; + function BN_nist_mod_521(r: PBIGNUM; a: PBIGNUM; p: PBIGNUM; ctx: PBN_CTX): TIdC_INT cdecl; external CLibCrypto; + + function BN_get0_nist_prime_192: PBIGNUM cdecl; external CLibCrypto; + function BN_get0_nist_prime_224: PBIGNUM cdecl; external CLibCrypto; + function BN_get0_nist_prime_256: PBIGNUM cdecl; external CLibCrypto; + function BN_get0_nist_prime_384: PBIGNUM cdecl; external CLibCrypto; + function BN_get0_nist_prime_521: PBIGNUM cdecl; external CLibCrypto; + +//int (*BN_nist_mod_func(const BIGNUM *p)) (BIGNUM *r, const BIGNUM *a, +// const BIGNUM *field, BN_CTX *ctx); + + function BN_generate_dsa_nonce(out_: PBIGNUM; range: PBIGNUM; priv: PBIGNUM; const message_: PByte; message_len: TIdC_SIZET; ctx: PBN_CTX): TIdC_INT cdecl; external CLibCrypto; + + (* Primes from RFC 2409 *) + function BN_get_rfc2409_prime_768(bn: PBIGNUM ): PBIGNUM cdecl; external CLibCrypto; + function BN_get_rfc2409_prime_1024(bn: PBIGNUM): PBIGNUM cdecl; external CLibCrypto; + + (* Primes from RFC 3526 *) + function BN_get_rfc3526_prime_1536(bn: PBIGNUM): PBIGNUM cdecl; external CLibCrypto; + function BN_get_rfc3526_prime_2048(bn: PBIGNUM): PBIGNUM cdecl; external CLibCrypto; + function BN_get_rfc3526_prime_3072(bn: PBIGNUM): PBIGNUM cdecl; external CLibCrypto; + function BN_get_rfc3526_prime_4096(bn: PBIGNUM): PBIGNUM cdecl; external CLibCrypto; + function BN_get_rfc3526_prime_6144(bn: PBIGNUM): PBIGNUM cdecl; external CLibCrypto; + function BN_get_rfc3526_prime_8192(bn: PBIGNUM): PBIGNUM cdecl; external CLibCrypto; + + function BN_bntest_rand(rnd: PBIGNUM; bits: TIdC_INT; top: TIdC_INT; bottom: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + +{$ENDIF} + +implementation + + uses + classes, + IdSSLOpenSSLExceptionHandlers, + IdResourceStringsOpenSSL + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + ,IdSSLOpenSSLLoader + {$ENDIF}; + + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +const + BN_set_flags_procname = 'BN_set_flags'; + BN_get_flags_procname = 'BN_get_flags'; + + (* + * get a clone of a BIGNUM with changed flags, for *temporary* use only (the + * two BIGNUMs cannot be used in parallel!). Also only for *read only* use. The + * value |dest| should be a newly allocated BIGNUM obtained via BN_new() that + * has not been otherwise initialised or used. + *) + BN_with_flags_procname = 'BN_with_flags'; + (* Wrapper function to make using BN_GENCB easier *) + BN_GENCB_call_procname = 'BN_GENCB_call'; + + BN_GENCB_new_procname = 'BN_GENCB_new'; + BN_GENCB_free_procname = 'BN_GENCB_free'; + + (* Populate a PBN_GENCB structure with an "old"-style callback *) + BN_GENCB_set_old_procname = 'BN_GENCB_set_old'; + + (* Populate a PBN_GENCB structure with a "new"-style callback *) + BN_GENCB_set_procname = 'BN_GENCB_set'; + + BN_GENCB_get_arg_procname = 'BN_GENCB_get_arg'; + + (* + * BN_prime_checks_for_size() returns the number of Miller-Rabin iterations + * that will be done for checking that a random number is probably prime. The + * error rate for accepting a composite number as prime depends on the size of + * the prime |b|. The error rates used are for calculating an RSA key with 2 primes, + * and so the level is what you would expect for a key of double the size of the + * prime. + * + * This table is generated using the algorithm of FIPS PUB 186-4 + * Digital Signature Standard (DSS), section F.1, page 117. + * (https://dx.doi.org/10.6028/NIST.FIPS.186-4) + * + * The following magma script was used to generate the output: + * securitybits:=125; + * k:=1024; + * for t:=1 to 65 do + * for M:=3 to Floor(2*Sqrt(k-1)-1) do + * S:=0; + * // Sum over m + * for m:=3 to M do + * s:=0; + * // Sum over j + * for j:=2 to m do + * s+:=(RealField(32)!2)^-(j+(k-1)/j); + * end for; + * S+:=2^(m-(m-1)*t)*s; + * end for; + * A:=2^(k-2-M*t); + * B:=8*(Pi(RealField(32))^2-6)/3*2^(k-2)*S; + * pkt:=2.00743*Log(2)*k*2^-k*(A+B); + * seclevel:=Floor(-Log(2,pkt)); + * if seclevel ge securitybits then + * printf "k: %5o, security: %o bits (t: %o, M: %o)\n",k,seclevel,t,M; + * break; + * end if; + * end for; + * if seclevel ge securitybits then break; end if; + * end for; + * + * It can be run online at: + * http://magma.maths.usyd.edu.au/calc + * + * And will output: + * k: 1024, security: 129 bits (t: 6, M: 23) + * + * k is the number of bits of the prime, securitybits is the level we want to + * reach. + * + * prime length | RSA key size | # MR tests | security level + * -------------+--------------|------------+--------------- + * (b) >= 6394 | >= 12788 | 3 | 256 bit + * (b) >= 3747 | >= 7494 | 3 | 192 bit + * (b) >= 1345 | >= 2690 | 4 | 128 bit + * (b) >= 1080 | >= 2160 | 5 | 128 bit + * (b) >= 852 | >= 1704 | 5 | 112 bit + * (b) >= 476 | >= 952 | 5 | 80 bit + * (b) >= 400 | >= 800 | 6 | 80 bit + * (b) >= 347 | >= 694 | 7 | 80 bit + * (b) >= 308 | >= 616 | 8 | 80 bit + * (b) >= 55 | >= 110 | 27 | 64 bit + * (b) >= 6 | >= 12 | 34 | 64 bit + *) + +// # define BN_prime_checks_for_size(b) ((b) >= 3747 ? 3 : \ +// (b) >= 1345 ? 4 : \ +// (b) >= 476 ? 5 : \ +// (b) >= 400 ? 6 : \ +// (b) >= 347 ? 7 : \ +// (b) >= 308 ? 8 : \ +// (b) >= 55 ? 27 : \ +// (* b >= 6 *) 34) +// +// # define BN_num_bytes(a) ((BN_num_bits(a)+7)/8) + + BN_abs_is_word_procname = 'BN_abs_is_word'; + BN_is_zero_procname = 'BN_is_zero'; + BN_is_one_procname = 'BN_is_one'; + BN_is_word_procname = 'BN_is_word'; + BN_is_odd_procname = 'BN_is_odd'; + +// # define BN_one(a) (BN_set_word((a),1)) + + BN_zero_ex_procname = 'BN_zero_ex'; + + BN_value_one_procname = 'BN_value_one'; + BN_options_procname = 'BN_options'; + BN_CTX_new_procname = 'BN_CTX_new'; + BN_CTX_secure_new_procname = 'BN_CTX_secure_new'; + BN_CTX_free_procname = 'BN_CTX_free'; + BN_CTX_start_procname = 'BN_CTX_start'; + BN_CTX_get_procname = 'BN_CTX_get'; + BN_CTX_end_procname = 'BN_CTX_end'; + BN_rand_procname = 'BN_rand'; + BN_priv_rand_procname = 'BN_priv_rand'; + BN_rand_range_procname = 'BN_rand_range'; + BN_priv_rand_range_procname = 'BN_priv_rand_range'; + BN_pseudo_rand_procname = 'BN_pseudo_rand'; + BN_pseudo_rand_range_procname = 'BN_pseudo_rand_range'; + BN_num_bits_procname = 'BN_num_bits'; + BN_num_bits_word_procname = 'BN_num_bits_word'; + BN_security_bits_procname = 'BN_security_bits'; + BN_new_procname = 'BN_new'; + BN_secure_new_procname = 'BN_secure_new'; + BN_clear_free_procname = 'BN_clear_free'; + BN_copy_procname = 'BN_copy'; + BN_swap_procname = 'BN_swap'; + BN_bin2bn_procname = 'BN_bin2bn'; + BN_bn2bin_procname = 'BN_bn2bin'; + BN_bn2binpad_procname = 'BN_bn2binpad'; + BN_lebin2bn_procname = 'BN_lebin2bn'; + BN_bn2lebinpad_procname = 'BN_bn2lebinpad'; + BN_mpi2bn_procname = 'BN_mpi2bn'; + BN_bn2mpi_procname = 'BN_bn2mpi'; + BN_sub_procname = 'BN_sub'; + BN_usub_procname = 'BN_usub'; + BN_uadd_procname = 'BN_uadd'; + BN_add_procname = 'BN_add'; + BN_mul_procname = 'BN_mul'; + BN_sqr_procname = 'BN_sqr'; + + (** BN_set_negative sets sign of a BIGNUM + * \param b pointer to the BIGNUM object + * \param n 0 if the BIGNUM b should be positive and a value != 0 otherwise + *) + BN_set_negative_procname = 'BN_set_negative'; + (** BN_is_negative returns 1 if the BIGNUM is negative + * \param b pointer to the BIGNUM object + * \return 1 if a < 0 and 0 otherwise + *) + BN_is_negative_procname = 'BN_is_negative'; + + BN_div_procname = 'BN_div'; +// # define BN_mod(rem,m,d,ctx) BN_div(NULL,(rem),(m),(d),(ctx)) + BN_nnmod_procname = 'BN_nnmod'; + BN_mod_add_procname = 'BN_mod_add'; + BN_mod_add_quick_procname = 'BN_mod_add_quick'; + BN_mod_sub_procname = 'BN_mod_sub'; + BN_mod_sub_quick_procname = 'BN_mod_sub_quick'; + BN_mod_mul_procname = 'BN_mod_mul'; + BN_mod_sqr_procname = 'BN_mod_sqr'; + BN_mod_lshift1_procname = 'BN_mod_lshift1'; + BN_mod_lshift1_quick_procname = 'BN_mod_lshift1_quick'; + BN_mod_lshift_procname = 'BN_mod_lshift'; + BN_mod_lshift_quick_procname = 'BN_mod_lshift_quick'; + + BN_mod_word_procname = 'BN_mod_word'; + BN_div_word_procname = 'BN_div_word'; + BN_mul_word_procname = 'BN_mul_word'; + BN_add_word_procname = 'BN_add_word'; + BN_sub_word_procname = 'BN_sub_word'; + BN_set_word_procname = 'BN_set_word'; + BN_get_word_procname = 'BN_get_word'; + + BN_cmp_procname = 'BN_cmp'; + BN_free_procname = 'BN_free'; + BN_is_bit_set_procname = 'BN_is_bit_set'; + BN_lshift_procname = 'BN_lshift'; + BN_lshift1_procname = 'BN_lshift1'; + BN_exp_procname = 'BN_exp'; + + BN_mod_exp_procname = 'BN_mod_exp'; + BN_mod_exp_mont_procname = 'BN_mod_exp_mont'; + BN_mod_exp_mont_consttime_procname = 'BN_mod_exp_mont_consttime'; + BN_mod_exp_mont_word_procname = 'BN_mod_exp_mont_word'; + BN_mod_exp2_mont_procname = 'BN_mod_exp2_mont'; + BN_mod_exp_simple_procname = 'BN_mod_exp_simple'; + + BN_mask_bits_procname = 'BN_mask_bits'; + BN_print_procname = 'BN_print'; + BN_reciprocal_procname = 'BN_reciprocal'; + BN_rshift_procname = 'BN_rshift'; + BN_rshift1_procname = 'BN_rshift1'; + BN_clear_procname = 'BN_clear'; + BN_dup_procname = 'BN_dup'; + BN_ucmp_procname = 'BN_ucmp'; + BN_set_bit_procname = 'BN_set_bit'; + BN_clear_bit_procname = 'BN_clear_bit'; + BN_bn2hex_procname = 'BN_bn2hex'; + BN_bn2dec_procname = 'BN_bn2dec'; + BN_hex2bn_procname = 'BN_hex2bn'; + BN_dec2bn_procname = 'BN_dec2bn'; + BN_asc2bn_procname = 'BN_asc2bn'; + BN_gcd_procname = 'BN_gcd'; + BN_kronecker_procname = 'BN_kronecker'; + + BN_mod_inverse_procname = 'BN_mod_inverse'; + BN_mod_sqrt_procname = 'BN_mod_sqrt'; + + BN_consttime_swap_procname = 'BN_consttime_swap'; + + BN_generate_prime_ex_procname = 'BN_generate_prime_ex'; + BN_is_prime_ex_procname = 'BN_is_prime_ex'; + BN_is_prime_fasttest_ex_procname = 'BN_is_prime_fasttest_ex'; + BN_X931_generate_Xpq_procname = 'BN_X931_generate_Xpq'; + BN_X931_derive_prime_ex_procname = 'BN_X931_derive_prime_ex'; + BN_X931_generate_prime_ex_procname = 'BN_X931_generate_prime_ex'; + BN_MONT_CTX_new_procname = 'BN_MONT_CTX_new'; + BN_mod_mul_montgomery_procname = 'BN_mod_mul_montgomery'; + BN_to_montgomery_procname = 'BN_to_montgomery'; + BN_from_montgomery_procname = 'BN_from_montgomery'; + BN_MONT_CTX_free_procname = 'BN_MONT_CTX_free'; + BN_MONT_CTX_set_procname = 'BN_MONT_CTX_set'; + BN_MONT_CTX_copy_procname = 'BN_MONT_CTX_copy'; +// function BN_MONT_CTX_set_locked(pmont: ^PBN_MONT_CTX; lock: CRYPTO_RWLOCK; mod_: PBIGNUM; ctx: PBN_CTX): PBN_MONT_CTX; + + BN_BLINDING_new_procname = 'BN_BLINDING_new'; + BN_BLINDING_free_procname = 'BN_BLINDING_free'; + BN_BLINDING_update_procname = 'BN_BLINDING_update'; + BN_BLINDING_convert_procname = 'BN_BLINDING_convert'; + BN_BLINDING_invert_procname = 'BN_BLINDING_invert'; + BN_BLINDING_convert_ex_procname = 'BN_BLINDING_convert_ex'; + BN_BLINDING_invert_ex_procname = 'BN_BLINDING_invert_ex'; + + BN_BLINDING_is_current_thread_procname = 'BN_BLINDING_is_current_thread'; + BN_BLINDING_set_current_thread_procname = 'BN_BLINDING_set_current_thread'; + BN_BLINDING_lock_procname = 'BN_BLINDING_lock'; + BN_BLINDING_unlock_procname = 'BN_BLINDING_unlock'; + + BN_BLINDING_get_flags_procname = 'BN_BLINDING_get_flags'; + BN_BLINDING_set_flags_procname = 'BN_BLINDING_set_flags'; +// function BN_BLINDING_create_param(PBN_BLINDING *b, +// PBIGNUM *e, PBIGNUM *m, PBN_CTX *ctx, +// function ( +// r: PBIGNUM; +// a: PBIGNUM; +// p: PBIGNUM; +// m: PBIGNUM; +// ctx: PBN_CTX; +// m_ctx: PBN_MONT_CTX): TIdC_INT, +// PBN_MONT_CTX *m_ctx): PBN_BLINDING; + + BN_RECP_CTX_free_procname = 'BN_RECP_CTX_free'; + BN_RECP_CTX_set_procname = 'BN_RECP_CTX_set'; + BN_mod_mul_reciprocal_procname = 'BN_mod_mul_reciprocal'; + BN_mod_exp_recp_procname = 'BN_mod_exp_recp'; + BN_div_recp_procname = 'BN_div_recp'; + + (* + * Functions for arithmetic over binary polynomials represented by BIGNUMs. + * The BIGNUM::neg property of BIGNUMs representing binary polynomials is + * ignored. Note that input arguments are not const so that their bit arrays + * can be expanded to the appropriate size if needed. + *) + + (* + * r = a + b + *) + BN_GF2m_add_procname = 'BN_GF2m_add'; +// # define BN_GF2m_sub(r, a, b) BN_GF2m_add(r, a, b) + (* + * r=a mod p + *) + BN_GF2m_mod_procname = 'BN_GF2m_mod'; + (* r = (a * b) mod p *) + BN_GF2m_mod_mul_procname = 'BN_GF2m_mod_mul'; + (* r = (a * a) mod p *) + BN_GF2m_mod_sqr_procname = 'BN_GF2m_mod_sqr'; + (* r = (1 / b) mod p *) + BN_GF2m_mod_inv_procname = 'BN_GF2m_mod_inv'; + (* r = (a / b) mod p *) + BN_GF2m_mod_div_procname = 'BN_GF2m_mod_div'; + (* r = (a ^ b) mod p *) + BN_GF2m_mod_exp_procname = 'BN_GF2m_mod_exp'; + (* r = sqrt(a) mod p *) + BN_GF2m_mod_sqrt_procname = 'BN_GF2m_mod_sqrt'; + (* r^2 + r = a mod p *) + BN_GF2m_mod_solve_quad_procname = 'BN_GF2m_mod_solve_quad'; +// # define BN_GF2m_cmp(a, b) BN_ucmp((a), (b)) + (*- + * Some functions allow for representation of the irreducible polynomials + * as an unsigned int[], say p. The irreducible f(t) is then of the form: + * t^p[0] + t^p[1] + ... + t^p[k] + * where m = p[0] > p[1] > ... > p[k] = 0. + *) + (* r = a mod p *) +// function BN_GF2m_mod_arr(r: PBIGNUM; a: PBIGNUM; p: array of TIdC_INT): TIdC_INT; + (* r = (a * b) mod p *) +// function BN_GF2m_mod_mul_arr(r: PBIGNUM; a: PBIGNUM; p: PBIGNUM; p: array of TIdC_INT; ctx: PBN_CTX): TIdC_INT; + (* r = (a * a) mod p *) +// function BN_GF2m_mod_sqr_arr(r: PBIGNUM; a: PBIGNUM; p: array of TIdC_INT; ctx: PBN_CTX): TIdC_INT; + (* r = (1 / b) mod p *) +// function BN_GF2m_mod_inv_arr(r: PBIGNUM; b: PBIGNUM; p: array of TIdC_INT; ctx: PBN_CTX): TIdC_INT; + (* r = (a / b) mod p *) +// function BN_GF2m_mod_div_arr(r: PBIGNUM; a: PBIGNUM; b: PBIGNUM; p: array of TIdC_INT; ctx: PBN_CTX): TIdC_INT; + (* r = (a ^ b) mod p *) +// function BN_GF2m_mod_exp_arr(r: PBIGNUM; a: PBIGNUM; b: PBIGNUM; p: array of TIdC_INT; ctx: PBN_CTX): TIdC_INT; + (* r = sqrt(a) mod p *) +// function BN_GF2m_mod_sqrt_arr(r: PBIGNUM; a: PBIGNUM; p: array of TIdC_INT; ctx: PBN_CTX): TIdC_INT; + (* r^2 + r = a mod p *) +// function BN_GF2m_mod_solve_quad_arr(r: PBIGNUM; a: PBIGNUM; p: array of TIdC_INT; ctx: PBN_CTX): TIdC_INT; +// function BN_GF2m_poly2arr(a: PBIGNUM; p: array of TIdC_INT; max: TIdC_INT): TIdC_INT; +// function BN_GF2m_arr2poly(p: array of TIdC_INT; a: PBIGNUM): TIdC_INT; + + (* + * faster mod functions for the 'NIST primes' 0 <= a < p^2 + *) + BN_nist_mod_192_procname = 'BN_nist_mod_192'; + BN_nist_mod_224_procname = 'BN_nist_mod_224'; + BN_nist_mod_256_procname = 'BN_nist_mod_256'; + BN_nist_mod_384_procname = 'BN_nist_mod_384'; + BN_nist_mod_521_procname = 'BN_nist_mod_521'; + + BN_get0_nist_prime_192_procname = 'BN_get0_nist_prime_192'; + BN_get0_nist_prime_224_procname = 'BN_get0_nist_prime_224'; + BN_get0_nist_prime_256_procname = 'BN_get0_nist_prime_256'; + BN_get0_nist_prime_384_procname = 'BN_get0_nist_prime_384'; + BN_get0_nist_prime_521_procname = 'BN_get0_nist_prime_521'; + +//int (*BN_nist_mod_func(const BIGNUM *p)) (BIGNUM *r, const BIGNUM *a, +// const BIGNUM *field, BN_CTX *ctx); + + BN_generate_dsa_nonce_procname = 'BN_generate_dsa_nonce'; + + (* Primes from RFC 2409 *) + BN_get_rfc2409_prime_768_procname = 'BN_get_rfc2409_prime_768'; + BN_get_rfc2409_prime_1024_procname = 'BN_get_rfc2409_prime_1024'; + + (* Primes from RFC 3526 *) + BN_get_rfc3526_prime_1536_procname = 'BN_get_rfc3526_prime_1536'; + BN_get_rfc3526_prime_2048_procname = 'BN_get_rfc3526_prime_2048'; + BN_get_rfc3526_prime_3072_procname = 'BN_get_rfc3526_prime_3072'; + BN_get_rfc3526_prime_4096_procname = 'BN_get_rfc3526_prime_4096'; + BN_get_rfc3526_prime_6144_procname = 'BN_get_rfc3526_prime_6144'; + BN_get_rfc3526_prime_8192_procname = 'BN_get_rfc3526_prime_8192'; + + BN_bntest_rand_procname = 'BN_bntest_rand'; + + +{$WARN NO_RETVAL OFF} +procedure ERR_BN_set_flags(b: PBIGNUM; n: TIdC_INT); +begin + EIdAPIFunctionNotPresent.RaiseException(BN_set_flags_procname); +end; + + +function ERR_BN_get_flags(b: PBIGNUM; n: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_get_flags_procname); +end; + + + + (* + * get a clone of a BIGNUM with changed flags, for *temporary* use only (the + * two BIGNUMs cannot be used in parallel!). Also only for *read only* use. The + * value |dest| should be a newly allocated BIGNUM obtained via BN_new() that + * has not been otherwise initialised or used. + *) +procedure ERR_BN_with_flags(dest: PBIGNUM; b: PBIGNUM; flags: TIdC_INT); +begin + EIdAPIFunctionNotPresent.RaiseException(BN_with_flags_procname); +end; + + + (* Wrapper function to make using BN_GENCB easier *) +function ERR_BN_GENCB_call(cb: PBN_GENCB; a: TIdC_INT; b: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_GENCB_call_procname); +end; + + + +function ERR_BN_GENCB_new: PBN_GENCB; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_GENCB_new_procname); +end; + + +procedure ERR_BN_GENCB_free(cb: PBN_GENCB); +begin + EIdAPIFunctionNotPresent.RaiseException(BN_GENCB_free_procname); +end; + + + + (* Populate a PBN_GENCB structure with an "old"-style callback *) +procedure ERR_BN_GENCB_set_old(gencb: PBN_GENCB; callback: BN_GENCB_set_old_cb; cb_arg: Pointer); +begin + EIdAPIFunctionNotPresent.RaiseException(BN_GENCB_set_old_procname); +end; + + + + (* Populate a PBN_GENCB structure with a "new"-style callback *) +procedure ERR_BN_GENCB_set(gencb: PBN_GENCB; callback: BN_GENCB_set_cb; cb_arg: Pointer); +begin + EIdAPIFunctionNotPresent.RaiseException(BN_GENCB_set_procname); +end; + + + +function ERR_BN_GENCB_get_arg(cb: PBN_GENCB): Pointer; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_GENCB_get_arg_procname); +end; + + + + (* + * BN_prime_checks_for_size() returns the number of Miller-Rabin iterations + * that will be done for checking that a random number is probably prime. The + * error rate for accepting a composite number as prime depends on the size of + * the prime |b|. The error rates used are for calculating an RSA key with 2 primes, + * and so the level is what you would expect for a key of double the size of the + * prime. + * + * This table is generated using the algorithm of FIPS PUB 186-4 + * Digital Signature Standard (DSS), section F.1, page 117. + * (https://dx.doi.org/10.6028/NIST.FIPS.186-4) + * + * The following magma script was used to generate the output: + * securitybits:=125; + * k:=1024; + * for t:=1 to 65 do + * for M:=3 to Floor(2*Sqrt(k-1)-1) do + * S:=0; + * // Sum over m + * for m:=3 to M do + * s:=0; + * // Sum over j + * for j:=2 to m do + * s+:=(RealField(32)!2)^-(j+(k-1)/j); + * end for; + * S+:=2^(m-(m-1)*t)*s; + * end for; + * A:=2^(k-2-M*t); + * B:=8*(Pi(RealField(32))^2-6)/3*2^(k-2)*S; + * pkt:=2.00743*Log(2)*k*2^-k*(A+B); + * seclevel:=Floor(-Log(2,pkt)); + * if seclevel ge securitybits then + * printf "k: %5o, security: %o bits (t: %o, M: %o)\n",k,seclevel,t,M; + * break; + * end if; + * end for; + * if seclevel ge securitybits then break; end if; + * end for; + * + * It can be run online at: + * http://magma.maths.usyd.edu.au/calc + * + * And will output: + * k: 1024, security: 129 bits (t: 6, M: 23) + * + * k is the number of bits of the prime, securitybits is the level we want to + * reach. + * + * prime length | RSA key size | # MR tests | security level + * -------------+--------------|------------+--------------- + * (b) >= 6394 | >= 12788 | 3 | 256 bit + * (b) >= 3747 | >= 7494 | 3 | 192 bit + * (b) >= 1345 | >= 2690 | 4 | 128 bit + * (b) >= 1080 | >= 2160 | 5 | 128 bit + * (b) >= 852 | >= 1704 | 5 | 112 bit + * (b) >= 476 | >= 952 | 5 | 80 bit + * (b) >= 400 | >= 800 | 6 | 80 bit + * (b) >= 347 | >= 694 | 7 | 80 bit + * (b) >= 308 | >= 616 | 8 | 80 bit + * (b) >= 55 | >= 110 | 27 | 64 bit + * (b) >= 6 | >= 12 | 34 | 64 bit + *) + +// # define BN_prime_checks_for_size(b) ((b) >= 3747 ? 3 : \ +// (b) >= 1345 ? 4 : \ +// (b) >= 476 ? 5 : \ +// (b) >= 400 ? 6 : \ +// (b) >= 347 ? 7 : \ +// (b) >= 308 ? 8 : \ +// (b) >= 55 ? 27 : \ +// (* b >= 6 *) 34) +// +// # define BN_num_bytes(a) ((BN_num_bits(a)+7)/8) + +function ERR_BN_abs_is_word(a: PBIGNUM; w: BN_ULONG): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_abs_is_word_procname); +end; + + +function ERR_BN_is_zero(a: PBIGNUM): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_is_zero_procname); +end; + + +function ERR_BN_is_one(a: PBIGNUM): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_is_one_procname); +end; + + +function ERR_BN_is_word(a: PBIGNUM; w: BN_ULONG): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_is_word_procname); +end; + + +function ERR_BN_is_odd(a: PBIGNUM): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_is_odd_procname); +end; + + + +// # define BN_one(a) (BN_set_word((a),1)) + +procedure ERR_BN_zero_ex(a: PBIGNUM); +begin + EIdAPIFunctionNotPresent.RaiseException(BN_zero_ex_procname); +end; + + + +function ERR_BN_value_one: PBIGNUM; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_value_one_procname); +end; + + +function ERR_BN_options: PIdAnsiChar; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_options_procname); +end; + + +function ERR_BN_CTX_new: PBN_CTX; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_CTX_new_procname); +end; + + +function ERR_BN_CTX_secure_new: PBN_CTX; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_CTX_secure_new_procname); +end; + + +procedure ERR_BN_CTX_free(c: PBN_CTX); +begin + EIdAPIFunctionNotPresent.RaiseException(BN_CTX_free_procname); +end; + + +procedure ERR_BN_CTX_start(ctx: PBN_CTX); +begin + EIdAPIFunctionNotPresent.RaiseException(BN_CTX_start_procname); +end; + + +function ERR_BN_CTX_get(ctx: PBN_CTX): PBIGNUM; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_CTX_get_procname); +end; + + +procedure ERR_BN_CTX_end(ctx: PBN_CTX); +begin + EIdAPIFunctionNotPresent.RaiseException(BN_CTX_end_procname); +end; + + +function ERR_BN_rand(rnd: PBIGNUM; bits: TIdC_INT; top: TIdC_INT; bottom: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_rand_procname); +end; + + +function ERR_BN_priv_rand(rnd: PBIGNUM; bits: TIdC_INT; top: TIdC_INT; bottom: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_priv_rand_procname); +end; + + +function ERR_BN_rand_range(rnd: PBIGNUM; range: PBIGNUM): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_rand_range_procname); +end; + + +function ERR_BN_priv_rand_range(rnd: PBIGNUM; range: PBIGNUM): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_priv_rand_range_procname); +end; + + +function ERR_BN_pseudo_rand(rnd: PBIGNUM; bits: TIdC_INT; top: TIdC_INT; bottom: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_pseudo_rand_procname); +end; + + +function ERR_BN_pseudo_rand_range(rnd: PBIGNUM; range: PBIGNUM): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_pseudo_rand_range_procname); +end; + + +function ERR_BN_num_bits(a: PBIGNUM): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_num_bits_procname); +end; + + +function ERR_BN_num_bits_word(l: BN_ULONG): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_num_bits_word_procname); +end; + + +function ERR_BN_security_bits(L: TIdC_INT; N: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_security_bits_procname); +end; + + +function ERR_BN_new: PBIGNUM; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_new_procname); +end; + + +function ERR_BN_secure_new: PBIGNUM; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_secure_new_procname); +end; + + +procedure ERR_BN_clear_free(a: PBIGNUM); +begin + EIdAPIFunctionNotPresent.RaiseException(BN_clear_free_procname); +end; + + +function ERR_BN_copy(a: PBIGNUM; b: PBIGNUM): PBIGNUM; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_copy_procname); +end; + + +procedure ERR_BN_swap(a: PBIGNUM; b: PBIGNUM); +begin + EIdAPIFunctionNotPresent.RaiseException(BN_swap_procname); +end; + + +function ERR_BN_bin2bn(const s: PByte; len: TIdC_INT; ret: PBIGNUM): PBIGNUM; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_bin2bn_procname); +end; + + +function ERR_BN_bn2bin(const a: PBIGNUM; to_: PByte): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_bn2bin_procname); +end; + + +function ERR_BN_bn2binpad(const a: PBIGNUM; to_: PByte; tolen: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_bn2binpad_procname); +end; + + +function ERR_BN_lebin2bn(const s: PByte; len: TIdC_INT; ret: PBIGNUM): PBIGNUM; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_lebin2bn_procname); +end; + + +function ERR_BN_bn2lebinpad(a: PBIGNUM; to_: PByte; tolen: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_bn2lebinpad_procname); +end; + + +function ERR_BN_mpi2bn(const s: PByte; len: TIdC_INT; ret: PBIGNUM): PBIGNUM; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_mpi2bn_procname); +end; + + +function ERR_BN_bn2mpi(a: PBIGNUM; to_: PByte): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_bn2mpi_procname); +end; + + +function ERR_BN_sub(r: PBIGNUM; const a: PBIGNUM; const b: PBIGNUM): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_sub_procname); +end; + + +function ERR_BN_usub(r: PBIGNUM; const a: PBIGNUM; const b: PBIGNUM): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_usub_procname); +end; + + +function ERR_BN_uadd(r: PBIGNUM; const a: PBIGNUM; const b: PBIGNUM): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_uadd_procname); +end; + + +function ERR_BN_add(r: PBIGNUM; const a: PBIGNUM; const b: PBIGNUM): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_add_procname); +end; + + +function ERR_BN_mul(r: PBIGNUM; const a: PBIGNUM; const b: PBIGNUM; ctx: PBN_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_mul_procname); +end; + + +function ERR_BN_sqr(r: PBIGNUM; const a: PBIGNUM; ctx: PBN_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_sqr_procname); +end; + + + + (** BN_set_negative sets sign of a BIGNUM + * \param b pointer to the BIGNUM object + * \param n 0 if the BIGNUM b should be positive and a value != 0 otherwise + *) +procedure ERR_BN_set_negative(b: PBIGNUM; n: TIdC_INT); +begin + EIdAPIFunctionNotPresent.RaiseException(BN_set_negative_procname); +end; + + + (** BN_is_negative returns 1 if the BIGNUM is negative + * \param b pointer to the BIGNUM object + * \return 1 if a < 0 and 0 otherwise + *) +function ERR_BN_is_negative(b: PBIGNUM): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_is_negative_procname); +end; + + + +function ERR_BN_div(dv: PBIGNUM; rem: PBIGNUM; const m: PBIGNUM; const d: PBIGNUM; ctx: PBN_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_div_procname); +end; + + +// # define BN_mod(rem,m,d,ctx) BN_div(NULL,(rem),(m),(d),(ctx)) +function ERR_BN_nnmod(r: PBIGNUM; const m: PBIGNUM; const d: PBIGNUM; ctx: PBN_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_nnmod_procname); +end; + + +function ERR_BN_mod_add(r: PBIGNUM; const a: PBIGNUM; const b: PBIGNUM; const m: PBIGNUM; ctx: PBN_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_mod_add_procname); +end; + + +function ERR_BN_mod_add_quick(r: PBIGNUM; const a: PBIGNUM; const b: PBIGNUM; const m: PBIGNUM): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_mod_add_quick_procname); +end; + + +function ERR_BN_mod_sub(r: PBIGNUM; const a: PBIGNUM; const b: PBIGNUM; const m: PBIGNUM; ctx: PBN_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_mod_sub_procname); +end; + + +function ERR_BN_mod_sub_quick(r: PBIGNUM; const a: PBIGNUM; const b: PBIGNUM; const m: PBIGNUM): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_mod_sub_quick_procname); +end; + + +function ERR_BN_mod_mul(r: PBIGNUM; const a: PBIGNUM; const b: PBIGNUM; const m: PBIGNUM; ctx: PBN_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_mod_mul_procname); +end; + + +function ERR_BN_mod_sqr(r: PBIGNUM; const a: PBIGNUM; const m: PBIGNUM; ctx: PBN_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_mod_sqr_procname); +end; + + +function ERR_BN_mod_lshift1(r: PBIGNUM; const a: PBIGNUM; const m: PBIGNUM; ctx: PBN_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_mod_lshift1_procname); +end; + + +function ERR_BN_mod_lshift1_quick(r: PBIGNUM; const a: PBIGNUM; const m: PBIGNUM): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_mod_lshift1_quick_procname); +end; + + +function ERR_BN_mod_lshift(r: PBIGNUM; const a: PBIGNUM; n: TIdC_INT; const m: PBIGNUM; ctx: PBN_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_mod_lshift_procname); +end; + + +function ERR_BN_mod_lshift_quick(r: PBIGNUM; const a: PBIGNUM; n: TIdC_INT; const m: PBIGNUM): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_mod_lshift_quick_procname); +end; + + + +function ERR_BN_mod_word(const a: PBIGNUM; w: BN_ULONG): BN_ULONG; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_mod_word_procname); +end; + + +function ERR_BN_div_word(a: PBIGNUM; w: BN_ULONG): BN_ULONG; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_div_word_procname); +end; + + +function ERR_BN_mul_word(a: PBIGNUM; w: BN_ULONG): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_mul_word_procname); +end; + + +function ERR_BN_add_word(a: PBIGNUM; w: BN_ULONG): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_add_word_procname); +end; + + +function ERR_BN_sub_word(a: PBIGNUM; w: BN_ULONG): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_sub_word_procname); +end; + + +function ERR_BN_set_word(a: PBIGNUM; w: BN_ULONG): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_set_word_procname); +end; + + +function ERR_BN_get_word(const a: PBIGNUM): BN_ULONG; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_get_word_procname); +end; + + + +function ERR_BN_cmp(const a: PBIGNUM; const b: PBIGNUM): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_cmp_procname); +end; + + +procedure ERR_BN_free(a: PBIGNUM); +begin + EIdAPIFunctionNotPresent.RaiseException(BN_free_procname); +end; + + +function ERR_BN_is_bit_set(const a: PBIGNUM; n: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_is_bit_set_procname); +end; + + +function ERR_BN_lshift(r: PBIGNUM; const a: PBIGNUM; n: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_lshift_procname); +end; + + +function ERR_BN_lshift1(r: PBIGNUM; const a: PBIGNUM): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_lshift1_procname); +end; + + +function ERR_BN_exp(r: PBIGNUM; a: PBIGNUM; p: PBIGNUM; ctx: PBN_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_exp_procname); +end; + + + +function ERR_BN_mod_exp(r: PBIGNUM; a: PBIGNUM; p: PBIGNUM; const m: PBIGNUM; ctx: PBN_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_mod_exp_procname); +end; + + +function ERR_BN_mod_exp_mont(r: PBIGNUM; a: PBIGNUM; p: PBIGNUM; m: PBIGNUM; ctx: PBN_CTX; m_ctx: PBN_MONT_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_mod_exp_mont_procname); +end; + + +function ERR_BN_mod_exp_mont_consttime(rr: PBIGNUM; a: PBIGNUM; p: PBIGNUM; m: PBIGNUM; ctx: PBN_CTX; in_mont: PBN_MONT_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_mod_exp_mont_consttime_procname); +end; + + +function ERR_BN_mod_exp_mont_word(r: PBIGNUM; a: BN_ULONG; p: PBIGNUM; m: PBIGNUM; ctx: PBN_CTX; m_ctx: PBN_MONT_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_mod_exp_mont_word_procname); +end; + + +function ERR_BN_mod_exp2_mont(r: PBIGNUM; const a1: PBIGNUM; const p1: PBIGNUM; const a2: PBIGNUM; const p2: PBIGNUM; const m: PBIGNUM; ctx: PBN_CTX; m_ctx: PBN_MONT_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_mod_exp2_mont_procname); +end; + + +function ERR_BN_mod_exp_simple(r: PBIGNUM; a: PBIGNUM; p: PBIGNUM; m: PBIGNUM; ctx: PBN_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_mod_exp_simple_procname); +end; + + + +function ERR_BN_mask_bits(a: PBIGNUM; n: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_mask_bits_procname); +end; + + +function ERR_BN_print(bio: PBIO; a: PBIGNUM): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_print_procname); +end; + + +function ERR_BN_reciprocal(r: PBIGNUM; m: PBIGNUM; len: TIdC_INT; ctx: PBN_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_reciprocal_procname); +end; + + +function ERR_BN_rshift(r: PBIGNUM; a: PBIGNUM; n: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_rshift_procname); +end; + + +function ERR_BN_rshift1(r: PBIGNUM; a: PBIGNUM): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_rshift1_procname); +end; + + +procedure ERR_BN_clear(a: PBIGNUM); +begin + EIdAPIFunctionNotPresent.RaiseException(BN_clear_procname); +end; + + +function ERR_BN_dup(const a: PBIGNUM): PBIGNUM; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_dup_procname); +end; + + +function ERR_BN_ucmp(a: PBIGNUM; b: PBIGNUM): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_ucmp_procname); +end; + + +function ERR_BN_set_bit(a: PBIGNUM; n: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_set_bit_procname); +end; + + +function ERR_BN_clear_bit(a: PBIGNUM; n: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_clear_bit_procname); +end; + + +function ERR_BN_bn2hex(a: PBIGNUM): PIdAnsiChar; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_bn2hex_procname); +end; + + +function ERR_BN_bn2dec(a: PBIGNUM): PIdAnsiChar; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_bn2dec_procname); +end; + + +function ERR_BN_hex2bn(a: PPBIGNUM; str: PIdAnsiChar): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_hex2bn_procname); +end; + + +function ERR_BN_dec2bn(a: PPBIGNUM; str: PIdAnsiChar): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_dec2bn_procname); +end; + + +function ERR_BN_asc2bn(a: PPBIGNUM; str: PIdAnsiChar): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_asc2bn_procname); +end; + + +function ERR_BN_gcd(r: PBIGNUM; a: PBIGNUM; b: PBIGNUM; ctx: PBN_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_gcd_procname); +end; + + +function ERR_BN_kronecker(a: PBIGNUM; b: PBIGNUM; ctx: PBN_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_kronecker_procname); +end; + + + +function ERR_BN_mod_inverse(ret: PBIGNUM; a: PBIGNUM; const n: PBIGNUM; ctx: PBN_CTX): PBIGNUM; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_mod_inverse_procname); +end; + + +function ERR_BN_mod_sqrt(ret: PBIGNUM; a: PBIGNUM; const n: PBIGNUM; ctx: PBN_CTX): PBIGNUM; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_mod_sqrt_procname); +end; + + + +procedure ERR_BN_consttime_swap(swap: BN_ULONG; a: PBIGNUM; b: PBIGNUM; nwords: TIdC_INT); +begin + EIdAPIFunctionNotPresent.RaiseException(BN_consttime_swap_procname); +end; + + + +function ERR_BN_generate_prime_ex(ret: PBIGNUM; bits: TIdC_INT; safe: TIdC_INT; const add: PBIGNUM; const rem: PBIGNUM; cb: PBN_GENCB): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_generate_prime_ex_procname); +end; + + +function ERR_BN_is_prime_ex(const p: PBIGNUM; nchecks: TIdC_INT; ctx: PBN_CTX; cb: PBN_GENCB): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_is_prime_ex_procname); +end; + + +function ERR_BN_is_prime_fasttest_ex(const p: PBIGNUM; nchecks: TIdC_INT; ctx: PBN_CTX; do_trial_division: TIdC_INT; cb: PBN_GENCB): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_is_prime_fasttest_ex_procname); +end; + + +function ERR_BN_X931_generate_Xpq(Xp: PBIGNUM; Xq: PBIGNUM; nbits: TIdC_INT; ctx: PBN_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_X931_generate_Xpq_procname); +end; + + +function ERR_BN_X931_derive_prime_ex(p: PBIGNUM; p1: PBIGNUM; p2: PBIGNUM; const Xp: PBIGNUM; const Xp1: PBIGNUM; const Xp2: PBIGNUM; const e: PBIGNUM; ctx: PBN_CTX; cb: PBN_GENCB): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_X931_derive_prime_ex_procname); +end; + + +function ERR_BN_X931_generate_prime_ex(p: PBIGNUM; p1: PBIGNUM; p2: PBIGNUM; Xp1: PBIGNUM; Xp2: PBIGNUM; Xp: PBIGNUM; const e: PBIGNUM; ctx: PBN_CTX; cb: PBN_GENCB): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_X931_generate_prime_ex_procname); +end; + + +function ERR_BN_MONT_CTX_new: PBN_MONT_CTX; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_MONT_CTX_new_procname); +end; + + +function ERR_BN_mod_mul_montgomery(r: PBIGNUM; const a: PBIGNUM; const b: PBIGNUM; mont: PBN_MONT_CTX; ctx: PBN_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_mod_mul_montgomery_procname); +end; + + +function ERR_BN_to_montgomery(r: PBIGNUM; a: PBIGNUM; mont: PBN_MONT_CTX; ctx: PBN_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_to_montgomery_procname); +end; + + +function ERR_BN_from_montgomery(r: PBIGNUM; a: PBIGNUM; mont: PBN_MONT_CTX; ctx: PBN_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_from_montgomery_procname); +end; + + +procedure ERR_BN_MONT_CTX_free(mont: PBN_MONT_CTX); +begin + EIdAPIFunctionNotPresent.RaiseException(BN_MONT_CTX_free_procname); +end; + + +function ERR_BN_MONT_CTX_set(mont: PBN_MONT_CTX; mod_: PBIGNUM; ctx: PBN_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_MONT_CTX_set_procname); +end; + + +function ERR_BN_MONT_CTX_copy(to_: PBN_MONT_CTX; from: PBN_MONT_CTX): PBN_MONT_CTX; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_MONT_CTX_copy_procname); +end; + + +// function BN_MONT_CTX_set_locked(pmont: ^PBN_MONT_CTX; lock: CRYPTO_RWLOCK; mod_: PBIGNUM; ctx: PBN_CTX): PBN_MONT_CTX; + +function ERR_BN_BLINDING_new(const A: PBIGNUM; const Ai: PBIGNUM; mod_: PBIGNUM): PBN_BLINDING; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_BLINDING_new_procname); +end; + + +procedure ERR_BN_BLINDING_free(b: PBN_BLINDING); +begin + EIdAPIFunctionNotPresent.RaiseException(BN_BLINDING_free_procname); +end; + + +function ERR_BN_BLINDING_update(b: PBN_BLINDING; ctx: PBN_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_BLINDING_update_procname); +end; + + +function ERR_BN_BLINDING_convert(n: PBIGNUM; b: PBN_BLINDING; ctx: PBN_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_BLINDING_convert_procname); +end; + + +function ERR_BN_BLINDING_invert(n: PBIGNUM; b: PBN_BLINDING; ctx: PBN_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_BLINDING_invert_procname); +end; + + +function ERR_BN_BLINDING_convert_ex(n: PBIGNUM; r: PBIGNUM; b: PBN_BLINDING; v4: PBN_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_BLINDING_convert_ex_procname); +end; + + +function ERR_BN_BLINDING_invert_ex(n: PBIGNUM; r: PBIGNUM; b: PBN_BLINDING; v2: PBN_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_BLINDING_invert_ex_procname); +end; + + + +function ERR_BN_BLINDING_is_current_thread(b: PBN_BLINDING): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_BLINDING_is_current_thread_procname); +end; + + +procedure ERR_BN_BLINDING_set_current_thread(b: PBN_BLINDING); +begin + EIdAPIFunctionNotPresent.RaiseException(BN_BLINDING_set_current_thread_procname); +end; + + +function ERR_BN_BLINDING_lock(b: PBN_BLINDING): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_BLINDING_lock_procname); +end; + + +function ERR_BN_BLINDING_unlock(b: PBN_BLINDING): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_BLINDING_unlock_procname); +end; + + + +function ERR_BN_BLINDING_get_flags(v1: PBN_BLINDING): TIdC_ULONG; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_BLINDING_get_flags_procname); +end; + + +procedure ERR_BN_BLINDING_set_flags(v1: PBN_BLINDING; v2: TIdC_ULONG); +begin + EIdAPIFunctionNotPresent.RaiseException(BN_BLINDING_set_flags_procname); +end; + + +// function BN_BLINDING_create_param(PBN_BLINDING *b, +// PBIGNUM *e, PBIGNUM *m, PBN_CTX *ctx, +// function ( +// r: PBIGNUM; +// a: PBIGNUM; +// p: PBIGNUM; +// m: PBIGNUM; +// ctx: PBN_CTX; +// m_ctx: PBN_MONT_CTX): TIdC_INT, +// PBN_MONT_CTX *m_ctx): PBN_BLINDING; + +procedure ERR_BN_RECP_CTX_free(recp: PBN_RECP_CTX); +begin + EIdAPIFunctionNotPresent.RaiseException(BN_RECP_CTX_free_procname); +end; + + +function ERR_BN_RECP_CTX_set(recp: PBN_RECP_CTX; rdiv: PBIGNUM; ctx: PBN_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_RECP_CTX_set_procname); +end; + + +function ERR_BN_mod_mul_reciprocal(r: PBIGNUM; x: PBIGNUM; y: PBIGNUM; recp: PBN_RECP_CTX; ctx: PBN_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_mod_mul_reciprocal_procname); +end; + + +function ERR_BN_mod_exp_recp(r: PBIGNUM; a: PBIGNUM; p: PBIGNUM; m: PBIGNUM; ctx: PBN_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_mod_exp_recp_procname); +end; + + +function ERR_BN_div_recp(dv: PBIGNUM; rem: PBIGNUM; m: PBIGNUM; recp: PBN_RECP_CTX; ctx: PBN_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_div_recp_procname); +end; + + + + (* + * Functions for arithmetic over binary polynomials represented by BIGNUMs. + * The BIGNUM::neg property of BIGNUMs representing binary polynomials is + * ignored. Note that input arguments are not const so that their bit arrays + * can be expanded to the appropriate size if needed. + *) + + (* + * r = a + b + *) +function ERR_BN_GF2m_add(r: PBIGNUM; a: PBIGNUM; b: PBIGNUM): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_GF2m_add_procname); +end; + + +// # define BN_GF2m_sub(r, a, b) BN_GF2m_add(r, a, b) + (* + * r=a mod p + *) +function ERR_BN_GF2m_mod(r: PBIGNUM; a: PBIGNUM; p: PBIGNUM): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_GF2m_mod_procname); +end; + + + (* r = (a * b) mod p *) +function ERR_BN_GF2m_mod_mul(r: PBIGNUM; a: PBIGNUM; b: PBIGNUM; p: PBIGNUM; ctx: PBN_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_GF2m_mod_mul_procname); +end; + + + (* r = (a * a) mod p *) +function ERR_BN_GF2m_mod_sqr(r: PBIGNUM; a: PBIGNUM; p: PBIGNUM; ctx: PBN_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_GF2m_mod_sqr_procname); +end; + + + (* r = (1 / b) mod p *) +function ERR_BN_GF2m_mod_inv(r: PBIGNUM; b: PBIGNUM; p: PBIGNUM; ctx: PBN_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_GF2m_mod_inv_procname); +end; + + + (* r = (a / b) mod p *) +function ERR_BN_GF2m_mod_div(r: PBIGNUM; a: PBIGNUM; b: PBIGNUM; p: PBIGNUM; ctx: PBN_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_GF2m_mod_div_procname); +end; + + + (* r = (a ^ b) mod p *) +function ERR_BN_GF2m_mod_exp(r: PBIGNUM; a: PBIGNUM; b: PBIGNUM; p: PBIGNUM; ctx: PBN_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_GF2m_mod_exp_procname); +end; + + + (* r = sqrt(a) mod p *) +function ERR_BN_GF2m_mod_sqrt(r: PBIGNUM; a: PBIGNUM; p: PBIGNUM; ctx: PBN_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_GF2m_mod_sqrt_procname); +end; + + + (* r^2 + r = a mod p *) +function ERR_BN_GF2m_mod_solve_quad(r: PBIGNUM; a: PBIGNUM; p: PBIGNUM; ctx: PBN_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_GF2m_mod_solve_quad_procname); +end; + + +// # define BN_GF2m_cmp(a, b) BN_ucmp((a), (b)) + (*- + * Some functions allow for representation of the irreducible polynomials + * as an unsigned int[], say p. The irreducible f(t) is then of the form: + * t^p[0] + t^p[1] + ... + t^p[k] + * where m = p[0] > p[1] > ... > p[k] = 0. + *) + (* r = a mod p *) +// function BN_GF2m_mod_arr(r: PBIGNUM; a: PBIGNUM; p: array of TIdC_INT): TIdC_INT; + (* r = (a * b) mod p *) +// function BN_GF2m_mod_mul_arr(r: PBIGNUM; a: PBIGNUM; p: PBIGNUM; p: array of TIdC_INT; ctx: PBN_CTX): TIdC_INT; + (* r = (a * a) mod p *) +// function BN_GF2m_mod_sqr_arr(r: PBIGNUM; a: PBIGNUM; p: array of TIdC_INT; ctx: PBN_CTX): TIdC_INT; + (* r = (1 / b) mod p *) +// function BN_GF2m_mod_inv_arr(r: PBIGNUM; b: PBIGNUM; p: array of TIdC_INT; ctx: PBN_CTX): TIdC_INT; + (* r = (a / b) mod p *) +// function BN_GF2m_mod_div_arr(r: PBIGNUM; a: PBIGNUM; b: PBIGNUM; p: array of TIdC_INT; ctx: PBN_CTX): TIdC_INT; + (* r = (a ^ b) mod p *) +// function BN_GF2m_mod_exp_arr(r: PBIGNUM; a: PBIGNUM; b: PBIGNUM; p: array of TIdC_INT; ctx: PBN_CTX): TIdC_INT; + (* r = sqrt(a) mod p *) +// function BN_GF2m_mod_sqrt_arr(r: PBIGNUM; a: PBIGNUM; p: array of TIdC_INT; ctx: PBN_CTX): TIdC_INT; + (* r^2 + r = a mod p *) +// function BN_GF2m_mod_solve_quad_arr(r: PBIGNUM; a: PBIGNUM; p: array of TIdC_INT; ctx: PBN_CTX): TIdC_INT; +// function BN_GF2m_poly2arr(a: PBIGNUM; p: array of TIdC_INT; max: TIdC_INT): TIdC_INT; +// function BN_GF2m_arr2poly(p: array of TIdC_INT; a: PBIGNUM): TIdC_INT; + + (* + * faster mod functions for the 'NIST primes' 0 <= a < p^2 + *) +function ERR_BN_nist_mod_192(r: PBIGNUM; a: PBIGNUM; p: PBIGNUM; ctx: PBN_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_nist_mod_192_procname); +end; + + +function ERR_BN_nist_mod_224(r: PBIGNUM; a: PBIGNUM; p: PBIGNUM; ctx: PBN_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_nist_mod_224_procname); +end; + + +function ERR_BN_nist_mod_256(r: PBIGNUM; a: PBIGNUM; p: PBIGNUM; ctx: PBN_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_nist_mod_256_procname); +end; + + +function ERR_BN_nist_mod_384(r: PBIGNUM; a: PBIGNUM; p: PBIGNUM; ctx: PBN_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_nist_mod_384_procname); +end; + + +function ERR_BN_nist_mod_521(r: PBIGNUM; a: PBIGNUM; p: PBIGNUM; ctx: PBN_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_nist_mod_521_procname); +end; + + + +function ERR_BN_get0_nist_prime_192: PBIGNUM; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_get0_nist_prime_192_procname); +end; + + +function ERR_BN_get0_nist_prime_224: PBIGNUM; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_get0_nist_prime_224_procname); +end; + + +function ERR_BN_get0_nist_prime_256: PBIGNUM; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_get0_nist_prime_256_procname); +end; + + +function ERR_BN_get0_nist_prime_384: PBIGNUM; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_get0_nist_prime_384_procname); +end; + + +function ERR_BN_get0_nist_prime_521: PBIGNUM; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_get0_nist_prime_521_procname); +end; + + + +//int (*BN_nist_mod_func(const BIGNUM *p)) (BIGNUM *r, const BIGNUM *a, +// const BIGNUM *field, BN_CTX *ctx); + +function ERR_BN_generate_dsa_nonce(out_: PBIGNUM; range: PBIGNUM; priv: PBIGNUM; const message_: PByte; message_len: TIdC_SIZET; ctx: PBN_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_generate_dsa_nonce_procname); +end; + + + + (* Primes from RFC 2409 *) +function ERR_BN_get_rfc2409_prime_768(bn: PBIGNUM ): PBIGNUM; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_get_rfc2409_prime_768_procname); +end; + + +function ERR_BN_get_rfc2409_prime_1024(bn: PBIGNUM): PBIGNUM; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_get_rfc2409_prime_1024_procname); +end; + + + + (* Primes from RFC 3526 *) +function ERR_BN_get_rfc3526_prime_1536(bn: PBIGNUM): PBIGNUM; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_get_rfc3526_prime_1536_procname); +end; + + +function ERR_BN_get_rfc3526_prime_2048(bn: PBIGNUM): PBIGNUM; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_get_rfc3526_prime_2048_procname); +end; + + +function ERR_BN_get_rfc3526_prime_3072(bn: PBIGNUM): PBIGNUM; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_get_rfc3526_prime_3072_procname); +end; + + +function ERR_BN_get_rfc3526_prime_4096(bn: PBIGNUM): PBIGNUM; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_get_rfc3526_prime_4096_procname); +end; + + +function ERR_BN_get_rfc3526_prime_6144(bn: PBIGNUM): PBIGNUM; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_get_rfc3526_prime_6144_procname); +end; + + +function ERR_BN_get_rfc3526_prime_8192(bn: PBIGNUM): PBIGNUM; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_get_rfc3526_prime_8192_procname); +end; + + + +function ERR_BN_bntest_rand(rnd: PBIGNUM; bits: TIdC_INT; top: TIdC_INT; bottom: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BN_bntest_rand_procname); +end; + + + +{$WARN NO_RETVAL ON} + +procedure Load(const ADllHandle: TIdLibHandle; LibVersion: TIdC_UINT; const AFailed: TStringList); + +var FuncLoadError: boolean; + +begin + BN_set_flags := LoadLibFunction(ADllHandle, BN_set_flags_procname); + FuncLoadError := not assigned(BN_set_flags); + if FuncLoadError then + begin + {$if not defined(BN_set_flags_allownil)} + BN_set_flags := @ERR_BN_set_flags; + {$ifend} + {$if declared(BN_set_flags_introduced)} + if LibVersion < BN_set_flags_introduced then + begin + {$if declared(FC_BN_set_flags)} + BN_set_flags := @FC_BN_set_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_set_flags_removed)} + if BN_set_flags_removed <= LibVersion then + begin + {$if declared(_BN_set_flags)} + BN_set_flags := @_BN_set_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_set_flags_allownil)} + if FuncLoadError then + AFailed.Add('BN_set_flags'); + {$ifend} + end; + + + BN_get_flags := LoadLibFunction(ADllHandle, BN_get_flags_procname); + FuncLoadError := not assigned(BN_get_flags); + if FuncLoadError then + begin + {$if not defined(BN_get_flags_allownil)} + BN_get_flags := @ERR_BN_get_flags; + {$ifend} + {$if declared(BN_get_flags_introduced)} + if LibVersion < BN_get_flags_introduced then + begin + {$if declared(FC_BN_get_flags)} + BN_get_flags := @FC_BN_get_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_get_flags_removed)} + if BN_get_flags_removed <= LibVersion then + begin + {$if declared(_BN_get_flags)} + BN_get_flags := @_BN_get_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_get_flags_allownil)} + if FuncLoadError then + AFailed.Add('BN_get_flags'); + {$ifend} + end; + + + BN_with_flags := LoadLibFunction(ADllHandle, BN_with_flags_procname); + FuncLoadError := not assigned(BN_with_flags); + if FuncLoadError then + begin + {$if not defined(BN_with_flags_allownil)} + BN_with_flags := @ERR_BN_with_flags; + {$ifend} + {$if declared(BN_with_flags_introduced)} + if LibVersion < BN_with_flags_introduced then + begin + {$if declared(FC_BN_with_flags)} + BN_with_flags := @FC_BN_with_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_with_flags_removed)} + if BN_with_flags_removed <= LibVersion then + begin + {$if declared(_BN_with_flags)} + BN_with_flags := @_BN_with_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_with_flags_allownil)} + if FuncLoadError then + AFailed.Add('BN_with_flags'); + {$ifend} + end; + + + BN_GENCB_call := LoadLibFunction(ADllHandle, BN_GENCB_call_procname); + FuncLoadError := not assigned(BN_GENCB_call); + if FuncLoadError then + begin + {$if not defined(BN_GENCB_call_allownil)} + BN_GENCB_call := @ERR_BN_GENCB_call; + {$ifend} + {$if declared(BN_GENCB_call_introduced)} + if LibVersion < BN_GENCB_call_introduced then + begin + {$if declared(FC_BN_GENCB_call)} + BN_GENCB_call := @FC_BN_GENCB_call; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_GENCB_call_removed)} + if BN_GENCB_call_removed <= LibVersion then + begin + {$if declared(_BN_GENCB_call)} + BN_GENCB_call := @_BN_GENCB_call; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_GENCB_call_allownil)} + if FuncLoadError then + AFailed.Add('BN_GENCB_call'); + {$ifend} + end; + + + BN_GENCB_new := LoadLibFunction(ADllHandle, BN_GENCB_new_procname); + FuncLoadError := not assigned(BN_GENCB_new); + if FuncLoadError then + begin + {$if not defined(BN_GENCB_new_allownil)} + BN_GENCB_new := @ERR_BN_GENCB_new; + {$ifend} + {$if declared(BN_GENCB_new_introduced)} + if LibVersion < BN_GENCB_new_introduced then + begin + {$if declared(FC_BN_GENCB_new)} + BN_GENCB_new := @FC_BN_GENCB_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_GENCB_new_removed)} + if BN_GENCB_new_removed <= LibVersion then + begin + {$if declared(_BN_GENCB_new)} + BN_GENCB_new := @_BN_GENCB_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_GENCB_new_allownil)} + if FuncLoadError then + AFailed.Add('BN_GENCB_new'); + {$ifend} + end; + + + BN_GENCB_free := LoadLibFunction(ADllHandle, BN_GENCB_free_procname); + FuncLoadError := not assigned(BN_GENCB_free); + if FuncLoadError then + begin + {$if not defined(BN_GENCB_free_allownil)} + BN_GENCB_free := @ERR_BN_GENCB_free; + {$ifend} + {$if declared(BN_GENCB_free_introduced)} + if LibVersion < BN_GENCB_free_introduced then + begin + {$if declared(FC_BN_GENCB_free)} + BN_GENCB_free := @FC_BN_GENCB_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_GENCB_free_removed)} + if BN_GENCB_free_removed <= LibVersion then + begin + {$if declared(_BN_GENCB_free)} + BN_GENCB_free := @_BN_GENCB_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_GENCB_free_allownil)} + if FuncLoadError then + AFailed.Add('BN_GENCB_free'); + {$ifend} + end; + + + BN_GENCB_set_old := LoadLibFunction(ADllHandle, BN_GENCB_set_old_procname); + FuncLoadError := not assigned(BN_GENCB_set_old); + if FuncLoadError then + begin + {$if not defined(BN_GENCB_set_old_allownil)} + BN_GENCB_set_old := @ERR_BN_GENCB_set_old; + {$ifend} + {$if declared(BN_GENCB_set_old_introduced)} + if LibVersion < BN_GENCB_set_old_introduced then + begin + {$if declared(FC_BN_GENCB_set_old)} + BN_GENCB_set_old := @FC_BN_GENCB_set_old; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_GENCB_set_old_removed)} + if BN_GENCB_set_old_removed <= LibVersion then + begin + {$if declared(_BN_GENCB_set_old)} + BN_GENCB_set_old := @_BN_GENCB_set_old; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_GENCB_set_old_allownil)} + if FuncLoadError then + AFailed.Add('BN_GENCB_set_old'); + {$ifend} + end; + + + BN_GENCB_set := LoadLibFunction(ADllHandle, BN_GENCB_set_procname); + FuncLoadError := not assigned(BN_GENCB_set); + if FuncLoadError then + begin + {$if not defined(BN_GENCB_set_allownil)} + BN_GENCB_set := @ERR_BN_GENCB_set; + {$ifend} + {$if declared(BN_GENCB_set_introduced)} + if LibVersion < BN_GENCB_set_introduced then + begin + {$if declared(FC_BN_GENCB_set)} + BN_GENCB_set := @FC_BN_GENCB_set; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_GENCB_set_removed)} + if BN_GENCB_set_removed <= LibVersion then + begin + {$if declared(_BN_GENCB_set)} + BN_GENCB_set := @_BN_GENCB_set; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_GENCB_set_allownil)} + if FuncLoadError then + AFailed.Add('BN_GENCB_set'); + {$ifend} + end; + + + BN_GENCB_get_arg := LoadLibFunction(ADllHandle, BN_GENCB_get_arg_procname); + FuncLoadError := not assigned(BN_GENCB_get_arg); + if FuncLoadError then + begin + {$if not defined(BN_GENCB_get_arg_allownil)} + BN_GENCB_get_arg := @ERR_BN_GENCB_get_arg; + {$ifend} + {$if declared(BN_GENCB_get_arg_introduced)} + if LibVersion < BN_GENCB_get_arg_introduced then + begin + {$if declared(FC_BN_GENCB_get_arg)} + BN_GENCB_get_arg := @FC_BN_GENCB_get_arg; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_GENCB_get_arg_removed)} + if BN_GENCB_get_arg_removed <= LibVersion then + begin + {$if declared(_BN_GENCB_get_arg)} + BN_GENCB_get_arg := @_BN_GENCB_get_arg; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_GENCB_get_arg_allownil)} + if FuncLoadError then + AFailed.Add('BN_GENCB_get_arg'); + {$ifend} + end; + + + BN_abs_is_word := LoadLibFunction(ADllHandle, BN_abs_is_word_procname); + FuncLoadError := not assigned(BN_abs_is_word); + if FuncLoadError then + begin + {$if not defined(BN_abs_is_word_allownil)} + BN_abs_is_word := @ERR_BN_abs_is_word; + {$ifend} + {$if declared(BN_abs_is_word_introduced)} + if LibVersion < BN_abs_is_word_introduced then + begin + {$if declared(FC_BN_abs_is_word)} + BN_abs_is_word := @FC_BN_abs_is_word; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_abs_is_word_removed)} + if BN_abs_is_word_removed <= LibVersion then + begin + {$if declared(_BN_abs_is_word)} + BN_abs_is_word := @_BN_abs_is_word; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_abs_is_word_allownil)} + if FuncLoadError then + AFailed.Add('BN_abs_is_word'); + {$ifend} + end; + + + BN_is_zero := LoadLibFunction(ADllHandle, BN_is_zero_procname); + FuncLoadError := not assigned(BN_is_zero); + if FuncLoadError then + begin + {$if not defined(BN_is_zero_allownil)} + BN_is_zero := @ERR_BN_is_zero; + {$ifend} + {$if declared(BN_is_zero_introduced)} + if LibVersion < BN_is_zero_introduced then + begin + {$if declared(FC_BN_is_zero)} + BN_is_zero := @FC_BN_is_zero; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_is_zero_removed)} + if BN_is_zero_removed <= LibVersion then + begin + {$if declared(_BN_is_zero)} + BN_is_zero := @_BN_is_zero; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_is_zero_allownil)} + if FuncLoadError then + AFailed.Add('BN_is_zero'); + {$ifend} + end; + + + BN_is_one := LoadLibFunction(ADllHandle, BN_is_one_procname); + FuncLoadError := not assigned(BN_is_one); + if FuncLoadError then + begin + {$if not defined(BN_is_one_allownil)} + BN_is_one := @ERR_BN_is_one; + {$ifend} + {$if declared(BN_is_one_introduced)} + if LibVersion < BN_is_one_introduced then + begin + {$if declared(FC_BN_is_one)} + BN_is_one := @FC_BN_is_one; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_is_one_removed)} + if BN_is_one_removed <= LibVersion then + begin + {$if declared(_BN_is_one)} + BN_is_one := @_BN_is_one; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_is_one_allownil)} + if FuncLoadError then + AFailed.Add('BN_is_one'); + {$ifend} + end; + + + BN_is_word := LoadLibFunction(ADllHandle, BN_is_word_procname); + FuncLoadError := not assigned(BN_is_word); + if FuncLoadError then + begin + {$if not defined(BN_is_word_allownil)} + BN_is_word := @ERR_BN_is_word; + {$ifend} + {$if declared(BN_is_word_introduced)} + if LibVersion < BN_is_word_introduced then + begin + {$if declared(FC_BN_is_word)} + BN_is_word := @FC_BN_is_word; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_is_word_removed)} + if BN_is_word_removed <= LibVersion then + begin + {$if declared(_BN_is_word)} + BN_is_word := @_BN_is_word; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_is_word_allownil)} + if FuncLoadError then + AFailed.Add('BN_is_word'); + {$ifend} + end; + + + BN_is_odd := LoadLibFunction(ADllHandle, BN_is_odd_procname); + FuncLoadError := not assigned(BN_is_odd); + if FuncLoadError then + begin + {$if not defined(BN_is_odd_allownil)} + BN_is_odd := @ERR_BN_is_odd; + {$ifend} + {$if declared(BN_is_odd_introduced)} + if LibVersion < BN_is_odd_introduced then + begin + {$if declared(FC_BN_is_odd)} + BN_is_odd := @FC_BN_is_odd; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_is_odd_removed)} + if BN_is_odd_removed <= LibVersion then + begin + {$if declared(_BN_is_odd)} + BN_is_odd := @_BN_is_odd; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_is_odd_allownil)} + if FuncLoadError then + AFailed.Add('BN_is_odd'); + {$ifend} + end; + + + BN_zero_ex := LoadLibFunction(ADllHandle, BN_zero_ex_procname); + FuncLoadError := not assigned(BN_zero_ex); + if FuncLoadError then + begin + {$if not defined(BN_zero_ex_allownil)} + BN_zero_ex := @ERR_BN_zero_ex; + {$ifend} + {$if declared(BN_zero_ex_introduced)} + if LibVersion < BN_zero_ex_introduced then + begin + {$if declared(FC_BN_zero_ex)} + BN_zero_ex := @FC_BN_zero_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_zero_ex_removed)} + if BN_zero_ex_removed <= LibVersion then + begin + {$if declared(_BN_zero_ex)} + BN_zero_ex := @_BN_zero_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_zero_ex_allownil)} + if FuncLoadError then + AFailed.Add('BN_zero_ex'); + {$ifend} + end; + + + BN_value_one := LoadLibFunction(ADllHandle, BN_value_one_procname); + FuncLoadError := not assigned(BN_value_one); + if FuncLoadError then + begin + {$if not defined(BN_value_one_allownil)} + BN_value_one := @ERR_BN_value_one; + {$ifend} + {$if declared(BN_value_one_introduced)} + if LibVersion < BN_value_one_introduced then + begin + {$if declared(FC_BN_value_one)} + BN_value_one := @FC_BN_value_one; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_value_one_removed)} + if BN_value_one_removed <= LibVersion then + begin + {$if declared(_BN_value_one)} + BN_value_one := @_BN_value_one; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_value_one_allownil)} + if FuncLoadError then + AFailed.Add('BN_value_one'); + {$ifend} + end; + + + BN_options := LoadLibFunction(ADllHandle, BN_options_procname); + FuncLoadError := not assigned(BN_options); + if FuncLoadError then + begin + {$if not defined(BN_options_allownil)} + BN_options := @ERR_BN_options; + {$ifend} + {$if declared(BN_options_introduced)} + if LibVersion < BN_options_introduced then + begin + {$if declared(FC_BN_options)} + BN_options := @FC_BN_options; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_options_removed)} + if BN_options_removed <= LibVersion then + begin + {$if declared(_BN_options)} + BN_options := @_BN_options; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_options_allownil)} + if FuncLoadError then + AFailed.Add('BN_options'); + {$ifend} + end; + + + BN_CTX_new := LoadLibFunction(ADllHandle, BN_CTX_new_procname); + FuncLoadError := not assigned(BN_CTX_new); + if FuncLoadError then + begin + {$if not defined(BN_CTX_new_allownil)} + BN_CTX_new := @ERR_BN_CTX_new; + {$ifend} + {$if declared(BN_CTX_new_introduced)} + if LibVersion < BN_CTX_new_introduced then + begin + {$if declared(FC_BN_CTX_new)} + BN_CTX_new := @FC_BN_CTX_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_CTX_new_removed)} + if BN_CTX_new_removed <= LibVersion then + begin + {$if declared(_BN_CTX_new)} + BN_CTX_new := @_BN_CTX_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_CTX_new_allownil)} + if FuncLoadError then + AFailed.Add('BN_CTX_new'); + {$ifend} + end; + + + BN_CTX_secure_new := LoadLibFunction(ADllHandle, BN_CTX_secure_new_procname); + FuncLoadError := not assigned(BN_CTX_secure_new); + if FuncLoadError then + begin + {$if not defined(BN_CTX_secure_new_allownil)} + BN_CTX_secure_new := @ERR_BN_CTX_secure_new; + {$ifend} + {$if declared(BN_CTX_secure_new_introduced)} + if LibVersion < BN_CTX_secure_new_introduced then + begin + {$if declared(FC_BN_CTX_secure_new)} + BN_CTX_secure_new := @FC_BN_CTX_secure_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_CTX_secure_new_removed)} + if BN_CTX_secure_new_removed <= LibVersion then + begin + {$if declared(_BN_CTX_secure_new)} + BN_CTX_secure_new := @_BN_CTX_secure_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_CTX_secure_new_allownil)} + if FuncLoadError then + AFailed.Add('BN_CTX_secure_new'); + {$ifend} + end; + + + BN_CTX_free := LoadLibFunction(ADllHandle, BN_CTX_free_procname); + FuncLoadError := not assigned(BN_CTX_free); + if FuncLoadError then + begin + {$if not defined(BN_CTX_free_allownil)} + BN_CTX_free := @ERR_BN_CTX_free; + {$ifend} + {$if declared(BN_CTX_free_introduced)} + if LibVersion < BN_CTX_free_introduced then + begin + {$if declared(FC_BN_CTX_free)} + BN_CTX_free := @FC_BN_CTX_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_CTX_free_removed)} + if BN_CTX_free_removed <= LibVersion then + begin + {$if declared(_BN_CTX_free)} + BN_CTX_free := @_BN_CTX_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_CTX_free_allownil)} + if FuncLoadError then + AFailed.Add('BN_CTX_free'); + {$ifend} + end; + + + BN_CTX_start := LoadLibFunction(ADllHandle, BN_CTX_start_procname); + FuncLoadError := not assigned(BN_CTX_start); + if FuncLoadError then + begin + {$if not defined(BN_CTX_start_allownil)} + BN_CTX_start := @ERR_BN_CTX_start; + {$ifend} + {$if declared(BN_CTX_start_introduced)} + if LibVersion < BN_CTX_start_introduced then + begin + {$if declared(FC_BN_CTX_start)} + BN_CTX_start := @FC_BN_CTX_start; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_CTX_start_removed)} + if BN_CTX_start_removed <= LibVersion then + begin + {$if declared(_BN_CTX_start)} + BN_CTX_start := @_BN_CTX_start; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_CTX_start_allownil)} + if FuncLoadError then + AFailed.Add('BN_CTX_start'); + {$ifend} + end; + + + BN_CTX_get := LoadLibFunction(ADllHandle, BN_CTX_get_procname); + FuncLoadError := not assigned(BN_CTX_get); + if FuncLoadError then + begin + {$if not defined(BN_CTX_get_allownil)} + BN_CTX_get := @ERR_BN_CTX_get; + {$ifend} + {$if declared(BN_CTX_get_introduced)} + if LibVersion < BN_CTX_get_introduced then + begin + {$if declared(FC_BN_CTX_get)} + BN_CTX_get := @FC_BN_CTX_get; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_CTX_get_removed)} + if BN_CTX_get_removed <= LibVersion then + begin + {$if declared(_BN_CTX_get)} + BN_CTX_get := @_BN_CTX_get; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_CTX_get_allownil)} + if FuncLoadError then + AFailed.Add('BN_CTX_get'); + {$ifend} + end; + + + BN_CTX_end := LoadLibFunction(ADllHandle, BN_CTX_end_procname); + FuncLoadError := not assigned(BN_CTX_end); + if FuncLoadError then + begin + {$if not defined(BN_CTX_end_allownil)} + BN_CTX_end := @ERR_BN_CTX_end; + {$ifend} + {$if declared(BN_CTX_end_introduced)} + if LibVersion < BN_CTX_end_introduced then + begin + {$if declared(FC_BN_CTX_end)} + BN_CTX_end := @FC_BN_CTX_end; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_CTX_end_removed)} + if BN_CTX_end_removed <= LibVersion then + begin + {$if declared(_BN_CTX_end)} + BN_CTX_end := @_BN_CTX_end; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_CTX_end_allownil)} + if FuncLoadError then + AFailed.Add('BN_CTX_end'); + {$ifend} + end; + + + BN_rand := LoadLibFunction(ADllHandle, BN_rand_procname); + FuncLoadError := not assigned(BN_rand); + if FuncLoadError then + begin + {$if not defined(BN_rand_allownil)} + BN_rand := @ERR_BN_rand; + {$ifend} + {$if declared(BN_rand_introduced)} + if LibVersion < BN_rand_introduced then + begin + {$if declared(FC_BN_rand)} + BN_rand := @FC_BN_rand; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_rand_removed)} + if BN_rand_removed <= LibVersion then + begin + {$if declared(_BN_rand)} + BN_rand := @_BN_rand; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_rand_allownil)} + if FuncLoadError then + AFailed.Add('BN_rand'); + {$ifend} + end; + + + BN_priv_rand := LoadLibFunction(ADllHandle, BN_priv_rand_procname); + FuncLoadError := not assigned(BN_priv_rand); + if FuncLoadError then + begin + {$if not defined(BN_priv_rand_allownil)} + BN_priv_rand := @ERR_BN_priv_rand; + {$ifend} + {$if declared(BN_priv_rand_introduced)} + if LibVersion < BN_priv_rand_introduced then + begin + {$if declared(FC_BN_priv_rand)} + BN_priv_rand := @FC_BN_priv_rand; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_priv_rand_removed)} + if BN_priv_rand_removed <= LibVersion then + begin + {$if declared(_BN_priv_rand)} + BN_priv_rand := @_BN_priv_rand; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_priv_rand_allownil)} + if FuncLoadError then + AFailed.Add('BN_priv_rand'); + {$ifend} + end; + + + BN_rand_range := LoadLibFunction(ADllHandle, BN_rand_range_procname); + FuncLoadError := not assigned(BN_rand_range); + if FuncLoadError then + begin + {$if not defined(BN_rand_range_allownil)} + BN_rand_range := @ERR_BN_rand_range; + {$ifend} + {$if declared(BN_rand_range_introduced)} + if LibVersion < BN_rand_range_introduced then + begin + {$if declared(FC_BN_rand_range)} + BN_rand_range := @FC_BN_rand_range; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_rand_range_removed)} + if BN_rand_range_removed <= LibVersion then + begin + {$if declared(_BN_rand_range)} + BN_rand_range := @_BN_rand_range; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_rand_range_allownil)} + if FuncLoadError then + AFailed.Add('BN_rand_range'); + {$ifend} + end; + + + BN_priv_rand_range := LoadLibFunction(ADllHandle, BN_priv_rand_range_procname); + FuncLoadError := not assigned(BN_priv_rand_range); + if FuncLoadError then + begin + {$if not defined(BN_priv_rand_range_allownil)} + BN_priv_rand_range := @ERR_BN_priv_rand_range; + {$ifend} + {$if declared(BN_priv_rand_range_introduced)} + if LibVersion < BN_priv_rand_range_introduced then + begin + {$if declared(FC_BN_priv_rand_range)} + BN_priv_rand_range := @FC_BN_priv_rand_range; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_priv_rand_range_removed)} + if BN_priv_rand_range_removed <= LibVersion then + begin + {$if declared(_BN_priv_rand_range)} + BN_priv_rand_range := @_BN_priv_rand_range; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_priv_rand_range_allownil)} + if FuncLoadError then + AFailed.Add('BN_priv_rand_range'); + {$ifend} + end; + + + BN_pseudo_rand := LoadLibFunction(ADllHandle, BN_pseudo_rand_procname); + FuncLoadError := not assigned(BN_pseudo_rand); + if FuncLoadError then + begin + {$if not defined(BN_pseudo_rand_allownil)} + BN_pseudo_rand := @ERR_BN_pseudo_rand; + {$ifend} + {$if declared(BN_pseudo_rand_introduced)} + if LibVersion < BN_pseudo_rand_introduced then + begin + {$if declared(FC_BN_pseudo_rand)} + BN_pseudo_rand := @FC_BN_pseudo_rand; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_pseudo_rand_removed)} + if BN_pseudo_rand_removed <= LibVersion then + begin + {$if declared(_BN_pseudo_rand)} + BN_pseudo_rand := @_BN_pseudo_rand; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_pseudo_rand_allownil)} + if FuncLoadError then + AFailed.Add('BN_pseudo_rand'); + {$ifend} + end; + + + BN_pseudo_rand_range := LoadLibFunction(ADllHandle, BN_pseudo_rand_range_procname); + FuncLoadError := not assigned(BN_pseudo_rand_range); + if FuncLoadError then + begin + {$if not defined(BN_pseudo_rand_range_allownil)} + BN_pseudo_rand_range := @ERR_BN_pseudo_rand_range; + {$ifend} + {$if declared(BN_pseudo_rand_range_introduced)} + if LibVersion < BN_pseudo_rand_range_introduced then + begin + {$if declared(FC_BN_pseudo_rand_range)} + BN_pseudo_rand_range := @FC_BN_pseudo_rand_range; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_pseudo_rand_range_removed)} + if BN_pseudo_rand_range_removed <= LibVersion then + begin + {$if declared(_BN_pseudo_rand_range)} + BN_pseudo_rand_range := @_BN_pseudo_rand_range; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_pseudo_rand_range_allownil)} + if FuncLoadError then + AFailed.Add('BN_pseudo_rand_range'); + {$ifend} + end; + + + BN_num_bits := LoadLibFunction(ADllHandle, BN_num_bits_procname); + FuncLoadError := not assigned(BN_num_bits); + if FuncLoadError then + begin + {$if not defined(BN_num_bits_allownil)} + BN_num_bits := @ERR_BN_num_bits; + {$ifend} + {$if declared(BN_num_bits_introduced)} + if LibVersion < BN_num_bits_introduced then + begin + {$if declared(FC_BN_num_bits)} + BN_num_bits := @FC_BN_num_bits; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_num_bits_removed)} + if BN_num_bits_removed <= LibVersion then + begin + {$if declared(_BN_num_bits)} + BN_num_bits := @_BN_num_bits; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_num_bits_allownil)} + if FuncLoadError then + AFailed.Add('BN_num_bits'); + {$ifend} + end; + + + BN_num_bits_word := LoadLibFunction(ADllHandle, BN_num_bits_word_procname); + FuncLoadError := not assigned(BN_num_bits_word); + if FuncLoadError then + begin + {$if not defined(BN_num_bits_word_allownil)} + BN_num_bits_word := @ERR_BN_num_bits_word; + {$ifend} + {$if declared(BN_num_bits_word_introduced)} + if LibVersion < BN_num_bits_word_introduced then + begin + {$if declared(FC_BN_num_bits_word)} + BN_num_bits_word := @FC_BN_num_bits_word; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_num_bits_word_removed)} + if BN_num_bits_word_removed <= LibVersion then + begin + {$if declared(_BN_num_bits_word)} + BN_num_bits_word := @_BN_num_bits_word; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_num_bits_word_allownil)} + if FuncLoadError then + AFailed.Add('BN_num_bits_word'); + {$ifend} + end; + + + BN_security_bits := LoadLibFunction(ADllHandle, BN_security_bits_procname); + FuncLoadError := not assigned(BN_security_bits); + if FuncLoadError then + begin + {$if not defined(BN_security_bits_allownil)} + BN_security_bits := @ERR_BN_security_bits; + {$ifend} + {$if declared(BN_security_bits_introduced)} + if LibVersion < BN_security_bits_introduced then + begin + {$if declared(FC_BN_security_bits)} + BN_security_bits := @FC_BN_security_bits; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_security_bits_removed)} + if BN_security_bits_removed <= LibVersion then + begin + {$if declared(_BN_security_bits)} + BN_security_bits := @_BN_security_bits; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_security_bits_allownil)} + if FuncLoadError then + AFailed.Add('BN_security_bits'); + {$ifend} + end; + + + BN_new := LoadLibFunction(ADllHandle, BN_new_procname); + FuncLoadError := not assigned(BN_new); + if FuncLoadError then + begin + {$if not defined(BN_new_allownil)} + BN_new := @ERR_BN_new; + {$ifend} + {$if declared(BN_new_introduced)} + if LibVersion < BN_new_introduced then + begin + {$if declared(FC_BN_new)} + BN_new := @FC_BN_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_new_removed)} + if BN_new_removed <= LibVersion then + begin + {$if declared(_BN_new)} + BN_new := @_BN_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_new_allownil)} + if FuncLoadError then + AFailed.Add('BN_new'); + {$ifend} + end; + + + BN_secure_new := LoadLibFunction(ADllHandle, BN_secure_new_procname); + FuncLoadError := not assigned(BN_secure_new); + if FuncLoadError then + begin + {$if not defined(BN_secure_new_allownil)} + BN_secure_new := @ERR_BN_secure_new; + {$ifend} + {$if declared(BN_secure_new_introduced)} + if LibVersion < BN_secure_new_introduced then + begin + {$if declared(FC_BN_secure_new)} + BN_secure_new := @FC_BN_secure_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_secure_new_removed)} + if BN_secure_new_removed <= LibVersion then + begin + {$if declared(_BN_secure_new)} + BN_secure_new := @_BN_secure_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_secure_new_allownil)} + if FuncLoadError then + AFailed.Add('BN_secure_new'); + {$ifend} + end; + + + BN_clear_free := LoadLibFunction(ADllHandle, BN_clear_free_procname); + FuncLoadError := not assigned(BN_clear_free); + if FuncLoadError then + begin + {$if not defined(BN_clear_free_allownil)} + BN_clear_free := @ERR_BN_clear_free; + {$ifend} + {$if declared(BN_clear_free_introduced)} + if LibVersion < BN_clear_free_introduced then + begin + {$if declared(FC_BN_clear_free)} + BN_clear_free := @FC_BN_clear_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_clear_free_removed)} + if BN_clear_free_removed <= LibVersion then + begin + {$if declared(_BN_clear_free)} + BN_clear_free := @_BN_clear_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_clear_free_allownil)} + if FuncLoadError then + AFailed.Add('BN_clear_free'); + {$ifend} + end; + + + BN_copy := LoadLibFunction(ADllHandle, BN_copy_procname); + FuncLoadError := not assigned(BN_copy); + if FuncLoadError then + begin + {$if not defined(BN_copy_allownil)} + BN_copy := @ERR_BN_copy; + {$ifend} + {$if declared(BN_copy_introduced)} + if LibVersion < BN_copy_introduced then + begin + {$if declared(FC_BN_copy)} + BN_copy := @FC_BN_copy; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_copy_removed)} + if BN_copy_removed <= LibVersion then + begin + {$if declared(_BN_copy)} + BN_copy := @_BN_copy; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_copy_allownil)} + if FuncLoadError then + AFailed.Add('BN_copy'); + {$ifend} + end; + + + BN_swap := LoadLibFunction(ADllHandle, BN_swap_procname); + FuncLoadError := not assigned(BN_swap); + if FuncLoadError then + begin + {$if not defined(BN_swap_allownil)} + BN_swap := @ERR_BN_swap; + {$ifend} + {$if declared(BN_swap_introduced)} + if LibVersion < BN_swap_introduced then + begin + {$if declared(FC_BN_swap)} + BN_swap := @FC_BN_swap; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_swap_removed)} + if BN_swap_removed <= LibVersion then + begin + {$if declared(_BN_swap)} + BN_swap := @_BN_swap; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_swap_allownil)} + if FuncLoadError then + AFailed.Add('BN_swap'); + {$ifend} + end; + + + BN_bin2bn := LoadLibFunction(ADllHandle, BN_bin2bn_procname); + FuncLoadError := not assigned(BN_bin2bn); + if FuncLoadError then + begin + {$if not defined(BN_bin2bn_allownil)} + BN_bin2bn := @ERR_BN_bin2bn; + {$ifend} + {$if declared(BN_bin2bn_introduced)} + if LibVersion < BN_bin2bn_introduced then + begin + {$if declared(FC_BN_bin2bn)} + BN_bin2bn := @FC_BN_bin2bn; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_bin2bn_removed)} + if BN_bin2bn_removed <= LibVersion then + begin + {$if declared(_BN_bin2bn)} + BN_bin2bn := @_BN_bin2bn; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_bin2bn_allownil)} + if FuncLoadError then + AFailed.Add('BN_bin2bn'); + {$ifend} + end; + + + BN_bn2bin := LoadLibFunction(ADllHandle, BN_bn2bin_procname); + FuncLoadError := not assigned(BN_bn2bin); + if FuncLoadError then + begin + {$if not defined(BN_bn2bin_allownil)} + BN_bn2bin := @ERR_BN_bn2bin; + {$ifend} + {$if declared(BN_bn2bin_introduced)} + if LibVersion < BN_bn2bin_introduced then + begin + {$if declared(FC_BN_bn2bin)} + BN_bn2bin := @FC_BN_bn2bin; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_bn2bin_removed)} + if BN_bn2bin_removed <= LibVersion then + begin + {$if declared(_BN_bn2bin)} + BN_bn2bin := @_BN_bn2bin; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_bn2bin_allownil)} + if FuncLoadError then + AFailed.Add('BN_bn2bin'); + {$ifend} + end; + + + BN_bn2binpad := LoadLibFunction(ADllHandle, BN_bn2binpad_procname); + FuncLoadError := not assigned(BN_bn2binpad); + if FuncLoadError then + begin + {$if not defined(BN_bn2binpad_allownil)} + BN_bn2binpad := @ERR_BN_bn2binpad; + {$ifend} + {$if declared(BN_bn2binpad_introduced)} + if LibVersion < BN_bn2binpad_introduced then + begin + {$if declared(FC_BN_bn2binpad)} + BN_bn2binpad := @FC_BN_bn2binpad; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_bn2binpad_removed)} + if BN_bn2binpad_removed <= LibVersion then + begin + {$if declared(_BN_bn2binpad)} + BN_bn2binpad := @_BN_bn2binpad; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_bn2binpad_allownil)} + if FuncLoadError then + AFailed.Add('BN_bn2binpad'); + {$ifend} + end; + + + BN_lebin2bn := LoadLibFunction(ADllHandle, BN_lebin2bn_procname); + FuncLoadError := not assigned(BN_lebin2bn); + if FuncLoadError then + begin + {$if not defined(BN_lebin2bn_allownil)} + BN_lebin2bn := @ERR_BN_lebin2bn; + {$ifend} + {$if declared(BN_lebin2bn_introduced)} + if LibVersion < BN_lebin2bn_introduced then + begin + {$if declared(FC_BN_lebin2bn)} + BN_lebin2bn := @FC_BN_lebin2bn; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_lebin2bn_removed)} + if BN_lebin2bn_removed <= LibVersion then + begin + {$if declared(_BN_lebin2bn)} + BN_lebin2bn := @_BN_lebin2bn; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_lebin2bn_allownil)} + if FuncLoadError then + AFailed.Add('BN_lebin2bn'); + {$ifend} + end; + + + BN_bn2lebinpad := LoadLibFunction(ADllHandle, BN_bn2lebinpad_procname); + FuncLoadError := not assigned(BN_bn2lebinpad); + if FuncLoadError then + begin + {$if not defined(BN_bn2lebinpad_allownil)} + BN_bn2lebinpad := @ERR_BN_bn2lebinpad; + {$ifend} + {$if declared(BN_bn2lebinpad_introduced)} + if LibVersion < BN_bn2lebinpad_introduced then + begin + {$if declared(FC_BN_bn2lebinpad)} + BN_bn2lebinpad := @FC_BN_bn2lebinpad; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_bn2lebinpad_removed)} + if BN_bn2lebinpad_removed <= LibVersion then + begin + {$if declared(_BN_bn2lebinpad)} + BN_bn2lebinpad := @_BN_bn2lebinpad; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_bn2lebinpad_allownil)} + if FuncLoadError then + AFailed.Add('BN_bn2lebinpad'); + {$ifend} + end; + + + BN_mpi2bn := LoadLibFunction(ADllHandle, BN_mpi2bn_procname); + FuncLoadError := not assigned(BN_mpi2bn); + if FuncLoadError then + begin + {$if not defined(BN_mpi2bn_allownil)} + BN_mpi2bn := @ERR_BN_mpi2bn; + {$ifend} + {$if declared(BN_mpi2bn_introduced)} + if LibVersion < BN_mpi2bn_introduced then + begin + {$if declared(FC_BN_mpi2bn)} + BN_mpi2bn := @FC_BN_mpi2bn; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_mpi2bn_removed)} + if BN_mpi2bn_removed <= LibVersion then + begin + {$if declared(_BN_mpi2bn)} + BN_mpi2bn := @_BN_mpi2bn; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_mpi2bn_allownil)} + if FuncLoadError then + AFailed.Add('BN_mpi2bn'); + {$ifend} + end; + + + BN_bn2mpi := LoadLibFunction(ADllHandle, BN_bn2mpi_procname); + FuncLoadError := not assigned(BN_bn2mpi); + if FuncLoadError then + begin + {$if not defined(BN_bn2mpi_allownil)} + BN_bn2mpi := @ERR_BN_bn2mpi; + {$ifend} + {$if declared(BN_bn2mpi_introduced)} + if LibVersion < BN_bn2mpi_introduced then + begin + {$if declared(FC_BN_bn2mpi)} + BN_bn2mpi := @FC_BN_bn2mpi; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_bn2mpi_removed)} + if BN_bn2mpi_removed <= LibVersion then + begin + {$if declared(_BN_bn2mpi)} + BN_bn2mpi := @_BN_bn2mpi; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_bn2mpi_allownil)} + if FuncLoadError then + AFailed.Add('BN_bn2mpi'); + {$ifend} + end; + + + BN_sub := LoadLibFunction(ADllHandle, BN_sub_procname); + FuncLoadError := not assigned(BN_sub); + if FuncLoadError then + begin + {$if not defined(BN_sub_allownil)} + BN_sub := @ERR_BN_sub; + {$ifend} + {$if declared(BN_sub_introduced)} + if LibVersion < BN_sub_introduced then + begin + {$if declared(FC_BN_sub)} + BN_sub := @FC_BN_sub; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_sub_removed)} + if BN_sub_removed <= LibVersion then + begin + {$if declared(_BN_sub)} + BN_sub := @_BN_sub; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_sub_allownil)} + if FuncLoadError then + AFailed.Add('BN_sub'); + {$ifend} + end; + + + BN_usub := LoadLibFunction(ADllHandle, BN_usub_procname); + FuncLoadError := not assigned(BN_usub); + if FuncLoadError then + begin + {$if not defined(BN_usub_allownil)} + BN_usub := @ERR_BN_usub; + {$ifend} + {$if declared(BN_usub_introduced)} + if LibVersion < BN_usub_introduced then + begin + {$if declared(FC_BN_usub)} + BN_usub := @FC_BN_usub; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_usub_removed)} + if BN_usub_removed <= LibVersion then + begin + {$if declared(_BN_usub)} + BN_usub := @_BN_usub; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_usub_allownil)} + if FuncLoadError then + AFailed.Add('BN_usub'); + {$ifend} + end; + + + BN_uadd := LoadLibFunction(ADllHandle, BN_uadd_procname); + FuncLoadError := not assigned(BN_uadd); + if FuncLoadError then + begin + {$if not defined(BN_uadd_allownil)} + BN_uadd := @ERR_BN_uadd; + {$ifend} + {$if declared(BN_uadd_introduced)} + if LibVersion < BN_uadd_introduced then + begin + {$if declared(FC_BN_uadd)} + BN_uadd := @FC_BN_uadd; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_uadd_removed)} + if BN_uadd_removed <= LibVersion then + begin + {$if declared(_BN_uadd)} + BN_uadd := @_BN_uadd; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_uadd_allownil)} + if FuncLoadError then + AFailed.Add('BN_uadd'); + {$ifend} + end; + + + BN_add := LoadLibFunction(ADllHandle, BN_add_procname); + FuncLoadError := not assigned(BN_add); + if FuncLoadError then + begin + {$if not defined(BN_add_allownil)} + BN_add := @ERR_BN_add; + {$ifend} + {$if declared(BN_add_introduced)} + if LibVersion < BN_add_introduced then + begin + {$if declared(FC_BN_add)} + BN_add := @FC_BN_add; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_add_removed)} + if BN_add_removed <= LibVersion then + begin + {$if declared(_BN_add)} + BN_add := @_BN_add; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_add_allownil)} + if FuncLoadError then + AFailed.Add('BN_add'); + {$ifend} + end; + + + BN_mul := LoadLibFunction(ADllHandle, BN_mul_procname); + FuncLoadError := not assigned(BN_mul); + if FuncLoadError then + begin + {$if not defined(BN_mul_allownil)} + BN_mul := @ERR_BN_mul; + {$ifend} + {$if declared(BN_mul_introduced)} + if LibVersion < BN_mul_introduced then + begin + {$if declared(FC_BN_mul)} + BN_mul := @FC_BN_mul; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_mul_removed)} + if BN_mul_removed <= LibVersion then + begin + {$if declared(_BN_mul)} + BN_mul := @_BN_mul; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_mul_allownil)} + if FuncLoadError then + AFailed.Add('BN_mul'); + {$ifend} + end; + + + BN_sqr := LoadLibFunction(ADllHandle, BN_sqr_procname); + FuncLoadError := not assigned(BN_sqr); + if FuncLoadError then + begin + {$if not defined(BN_sqr_allownil)} + BN_sqr := @ERR_BN_sqr; + {$ifend} + {$if declared(BN_sqr_introduced)} + if LibVersion < BN_sqr_introduced then + begin + {$if declared(FC_BN_sqr)} + BN_sqr := @FC_BN_sqr; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_sqr_removed)} + if BN_sqr_removed <= LibVersion then + begin + {$if declared(_BN_sqr)} + BN_sqr := @_BN_sqr; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_sqr_allownil)} + if FuncLoadError then + AFailed.Add('BN_sqr'); + {$ifend} + end; + + + BN_set_negative := LoadLibFunction(ADllHandle, BN_set_negative_procname); + FuncLoadError := not assigned(BN_set_negative); + if FuncLoadError then + begin + {$if not defined(BN_set_negative_allownil)} + BN_set_negative := @ERR_BN_set_negative; + {$ifend} + {$if declared(BN_set_negative_introduced)} + if LibVersion < BN_set_negative_introduced then + begin + {$if declared(FC_BN_set_negative)} + BN_set_negative := @FC_BN_set_negative; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_set_negative_removed)} + if BN_set_negative_removed <= LibVersion then + begin + {$if declared(_BN_set_negative)} + BN_set_negative := @_BN_set_negative; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_set_negative_allownil)} + if FuncLoadError then + AFailed.Add('BN_set_negative'); + {$ifend} + end; + + + BN_is_negative := LoadLibFunction(ADllHandle, BN_is_negative_procname); + FuncLoadError := not assigned(BN_is_negative); + if FuncLoadError then + begin + {$if not defined(BN_is_negative_allownil)} + BN_is_negative := @ERR_BN_is_negative; + {$ifend} + {$if declared(BN_is_negative_introduced)} + if LibVersion < BN_is_negative_introduced then + begin + {$if declared(FC_BN_is_negative)} + BN_is_negative := @FC_BN_is_negative; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_is_negative_removed)} + if BN_is_negative_removed <= LibVersion then + begin + {$if declared(_BN_is_negative)} + BN_is_negative := @_BN_is_negative; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_is_negative_allownil)} + if FuncLoadError then + AFailed.Add('BN_is_negative'); + {$ifend} + end; + + + BN_div := LoadLibFunction(ADllHandle, BN_div_procname); + FuncLoadError := not assigned(BN_div); + if FuncLoadError then + begin + {$if not defined(BN_div_allownil)} + BN_div := @ERR_BN_div; + {$ifend} + {$if declared(BN_div_introduced)} + if LibVersion < BN_div_introduced then + begin + {$if declared(FC_BN_div)} + BN_div := @FC_BN_div; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_div_removed)} + if BN_div_removed <= LibVersion then + begin + {$if declared(_BN_div)} + BN_div := @_BN_div; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_div_allownil)} + if FuncLoadError then + AFailed.Add('BN_div'); + {$ifend} + end; + + + BN_nnmod := LoadLibFunction(ADllHandle, BN_nnmod_procname); + FuncLoadError := not assigned(BN_nnmod); + if FuncLoadError then + begin + {$if not defined(BN_nnmod_allownil)} + BN_nnmod := @ERR_BN_nnmod; + {$ifend} + {$if declared(BN_nnmod_introduced)} + if LibVersion < BN_nnmod_introduced then + begin + {$if declared(FC_BN_nnmod)} + BN_nnmod := @FC_BN_nnmod; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_nnmod_removed)} + if BN_nnmod_removed <= LibVersion then + begin + {$if declared(_BN_nnmod)} + BN_nnmod := @_BN_nnmod; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_nnmod_allownil)} + if FuncLoadError then + AFailed.Add('BN_nnmod'); + {$ifend} + end; + + + BN_mod_add := LoadLibFunction(ADllHandle, BN_mod_add_procname); + FuncLoadError := not assigned(BN_mod_add); + if FuncLoadError then + begin + {$if not defined(BN_mod_add_allownil)} + BN_mod_add := @ERR_BN_mod_add; + {$ifend} + {$if declared(BN_mod_add_introduced)} + if LibVersion < BN_mod_add_introduced then + begin + {$if declared(FC_BN_mod_add)} + BN_mod_add := @FC_BN_mod_add; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_mod_add_removed)} + if BN_mod_add_removed <= LibVersion then + begin + {$if declared(_BN_mod_add)} + BN_mod_add := @_BN_mod_add; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_mod_add_allownil)} + if FuncLoadError then + AFailed.Add('BN_mod_add'); + {$ifend} + end; + + + BN_mod_add_quick := LoadLibFunction(ADllHandle, BN_mod_add_quick_procname); + FuncLoadError := not assigned(BN_mod_add_quick); + if FuncLoadError then + begin + {$if not defined(BN_mod_add_quick_allownil)} + BN_mod_add_quick := @ERR_BN_mod_add_quick; + {$ifend} + {$if declared(BN_mod_add_quick_introduced)} + if LibVersion < BN_mod_add_quick_introduced then + begin + {$if declared(FC_BN_mod_add_quick)} + BN_mod_add_quick := @FC_BN_mod_add_quick; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_mod_add_quick_removed)} + if BN_mod_add_quick_removed <= LibVersion then + begin + {$if declared(_BN_mod_add_quick)} + BN_mod_add_quick := @_BN_mod_add_quick; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_mod_add_quick_allownil)} + if FuncLoadError then + AFailed.Add('BN_mod_add_quick'); + {$ifend} + end; + + + BN_mod_sub := LoadLibFunction(ADllHandle, BN_mod_sub_procname); + FuncLoadError := not assigned(BN_mod_sub); + if FuncLoadError then + begin + {$if not defined(BN_mod_sub_allownil)} + BN_mod_sub := @ERR_BN_mod_sub; + {$ifend} + {$if declared(BN_mod_sub_introduced)} + if LibVersion < BN_mod_sub_introduced then + begin + {$if declared(FC_BN_mod_sub)} + BN_mod_sub := @FC_BN_mod_sub; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_mod_sub_removed)} + if BN_mod_sub_removed <= LibVersion then + begin + {$if declared(_BN_mod_sub)} + BN_mod_sub := @_BN_mod_sub; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_mod_sub_allownil)} + if FuncLoadError then + AFailed.Add('BN_mod_sub'); + {$ifend} + end; + + + BN_mod_sub_quick := LoadLibFunction(ADllHandle, BN_mod_sub_quick_procname); + FuncLoadError := not assigned(BN_mod_sub_quick); + if FuncLoadError then + begin + {$if not defined(BN_mod_sub_quick_allownil)} + BN_mod_sub_quick := @ERR_BN_mod_sub_quick; + {$ifend} + {$if declared(BN_mod_sub_quick_introduced)} + if LibVersion < BN_mod_sub_quick_introduced then + begin + {$if declared(FC_BN_mod_sub_quick)} + BN_mod_sub_quick := @FC_BN_mod_sub_quick; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_mod_sub_quick_removed)} + if BN_mod_sub_quick_removed <= LibVersion then + begin + {$if declared(_BN_mod_sub_quick)} + BN_mod_sub_quick := @_BN_mod_sub_quick; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_mod_sub_quick_allownil)} + if FuncLoadError then + AFailed.Add('BN_mod_sub_quick'); + {$ifend} + end; + + + BN_mod_mul := LoadLibFunction(ADllHandle, BN_mod_mul_procname); + FuncLoadError := not assigned(BN_mod_mul); + if FuncLoadError then + begin + {$if not defined(BN_mod_mul_allownil)} + BN_mod_mul := @ERR_BN_mod_mul; + {$ifend} + {$if declared(BN_mod_mul_introduced)} + if LibVersion < BN_mod_mul_introduced then + begin + {$if declared(FC_BN_mod_mul)} + BN_mod_mul := @FC_BN_mod_mul; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_mod_mul_removed)} + if BN_mod_mul_removed <= LibVersion then + begin + {$if declared(_BN_mod_mul)} + BN_mod_mul := @_BN_mod_mul; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_mod_mul_allownil)} + if FuncLoadError then + AFailed.Add('BN_mod_mul'); + {$ifend} + end; + + + BN_mod_sqr := LoadLibFunction(ADllHandle, BN_mod_sqr_procname); + FuncLoadError := not assigned(BN_mod_sqr); + if FuncLoadError then + begin + {$if not defined(BN_mod_sqr_allownil)} + BN_mod_sqr := @ERR_BN_mod_sqr; + {$ifend} + {$if declared(BN_mod_sqr_introduced)} + if LibVersion < BN_mod_sqr_introduced then + begin + {$if declared(FC_BN_mod_sqr)} + BN_mod_sqr := @FC_BN_mod_sqr; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_mod_sqr_removed)} + if BN_mod_sqr_removed <= LibVersion then + begin + {$if declared(_BN_mod_sqr)} + BN_mod_sqr := @_BN_mod_sqr; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_mod_sqr_allownil)} + if FuncLoadError then + AFailed.Add('BN_mod_sqr'); + {$ifend} + end; + + + BN_mod_lshift1 := LoadLibFunction(ADllHandle, BN_mod_lshift1_procname); + FuncLoadError := not assigned(BN_mod_lshift1); + if FuncLoadError then + begin + {$if not defined(BN_mod_lshift1_allownil)} + BN_mod_lshift1 := @ERR_BN_mod_lshift1; + {$ifend} + {$if declared(BN_mod_lshift1_introduced)} + if LibVersion < BN_mod_lshift1_introduced then + begin + {$if declared(FC_BN_mod_lshift1)} + BN_mod_lshift1 := @FC_BN_mod_lshift1; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_mod_lshift1_removed)} + if BN_mod_lshift1_removed <= LibVersion then + begin + {$if declared(_BN_mod_lshift1)} + BN_mod_lshift1 := @_BN_mod_lshift1; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_mod_lshift1_allownil)} + if FuncLoadError then + AFailed.Add('BN_mod_lshift1'); + {$ifend} + end; + + + BN_mod_lshift1_quick := LoadLibFunction(ADllHandle, BN_mod_lshift1_quick_procname); + FuncLoadError := not assigned(BN_mod_lshift1_quick); + if FuncLoadError then + begin + {$if not defined(BN_mod_lshift1_quick_allownil)} + BN_mod_lshift1_quick := @ERR_BN_mod_lshift1_quick; + {$ifend} + {$if declared(BN_mod_lshift1_quick_introduced)} + if LibVersion < BN_mod_lshift1_quick_introduced then + begin + {$if declared(FC_BN_mod_lshift1_quick)} + BN_mod_lshift1_quick := @FC_BN_mod_lshift1_quick; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_mod_lshift1_quick_removed)} + if BN_mod_lshift1_quick_removed <= LibVersion then + begin + {$if declared(_BN_mod_lshift1_quick)} + BN_mod_lshift1_quick := @_BN_mod_lshift1_quick; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_mod_lshift1_quick_allownil)} + if FuncLoadError then + AFailed.Add('BN_mod_lshift1_quick'); + {$ifend} + end; + + + BN_mod_lshift := LoadLibFunction(ADllHandle, BN_mod_lshift_procname); + FuncLoadError := not assigned(BN_mod_lshift); + if FuncLoadError then + begin + {$if not defined(BN_mod_lshift_allownil)} + BN_mod_lshift := @ERR_BN_mod_lshift; + {$ifend} + {$if declared(BN_mod_lshift_introduced)} + if LibVersion < BN_mod_lshift_introduced then + begin + {$if declared(FC_BN_mod_lshift)} + BN_mod_lshift := @FC_BN_mod_lshift; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_mod_lshift_removed)} + if BN_mod_lshift_removed <= LibVersion then + begin + {$if declared(_BN_mod_lshift)} + BN_mod_lshift := @_BN_mod_lshift; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_mod_lshift_allownil)} + if FuncLoadError then + AFailed.Add('BN_mod_lshift'); + {$ifend} + end; + + + BN_mod_lshift_quick := LoadLibFunction(ADllHandle, BN_mod_lshift_quick_procname); + FuncLoadError := not assigned(BN_mod_lshift_quick); + if FuncLoadError then + begin + {$if not defined(BN_mod_lshift_quick_allownil)} + BN_mod_lshift_quick := @ERR_BN_mod_lshift_quick; + {$ifend} + {$if declared(BN_mod_lshift_quick_introduced)} + if LibVersion < BN_mod_lshift_quick_introduced then + begin + {$if declared(FC_BN_mod_lshift_quick)} + BN_mod_lshift_quick := @FC_BN_mod_lshift_quick; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_mod_lshift_quick_removed)} + if BN_mod_lshift_quick_removed <= LibVersion then + begin + {$if declared(_BN_mod_lshift_quick)} + BN_mod_lshift_quick := @_BN_mod_lshift_quick; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_mod_lshift_quick_allownil)} + if FuncLoadError then + AFailed.Add('BN_mod_lshift_quick'); + {$ifend} + end; + + + BN_mod_word := LoadLibFunction(ADllHandle, BN_mod_word_procname); + FuncLoadError := not assigned(BN_mod_word); + if FuncLoadError then + begin + {$if not defined(BN_mod_word_allownil)} + BN_mod_word := @ERR_BN_mod_word; + {$ifend} + {$if declared(BN_mod_word_introduced)} + if LibVersion < BN_mod_word_introduced then + begin + {$if declared(FC_BN_mod_word)} + BN_mod_word := @FC_BN_mod_word; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_mod_word_removed)} + if BN_mod_word_removed <= LibVersion then + begin + {$if declared(_BN_mod_word)} + BN_mod_word := @_BN_mod_word; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_mod_word_allownil)} + if FuncLoadError then + AFailed.Add('BN_mod_word'); + {$ifend} + end; + + + BN_div_word := LoadLibFunction(ADllHandle, BN_div_word_procname); + FuncLoadError := not assigned(BN_div_word); + if FuncLoadError then + begin + {$if not defined(BN_div_word_allownil)} + BN_div_word := @ERR_BN_div_word; + {$ifend} + {$if declared(BN_div_word_introduced)} + if LibVersion < BN_div_word_introduced then + begin + {$if declared(FC_BN_div_word)} + BN_div_word := @FC_BN_div_word; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_div_word_removed)} + if BN_div_word_removed <= LibVersion then + begin + {$if declared(_BN_div_word)} + BN_div_word := @_BN_div_word; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_div_word_allownil)} + if FuncLoadError then + AFailed.Add('BN_div_word'); + {$ifend} + end; + + + BN_mul_word := LoadLibFunction(ADllHandle, BN_mul_word_procname); + FuncLoadError := not assigned(BN_mul_word); + if FuncLoadError then + begin + {$if not defined(BN_mul_word_allownil)} + BN_mul_word := @ERR_BN_mul_word; + {$ifend} + {$if declared(BN_mul_word_introduced)} + if LibVersion < BN_mul_word_introduced then + begin + {$if declared(FC_BN_mul_word)} + BN_mul_word := @FC_BN_mul_word; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_mul_word_removed)} + if BN_mul_word_removed <= LibVersion then + begin + {$if declared(_BN_mul_word)} + BN_mul_word := @_BN_mul_word; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_mul_word_allownil)} + if FuncLoadError then + AFailed.Add('BN_mul_word'); + {$ifend} + end; + + + BN_add_word := LoadLibFunction(ADllHandle, BN_add_word_procname); + FuncLoadError := not assigned(BN_add_word); + if FuncLoadError then + begin + {$if not defined(BN_add_word_allownil)} + BN_add_word := @ERR_BN_add_word; + {$ifend} + {$if declared(BN_add_word_introduced)} + if LibVersion < BN_add_word_introduced then + begin + {$if declared(FC_BN_add_word)} + BN_add_word := @FC_BN_add_word; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_add_word_removed)} + if BN_add_word_removed <= LibVersion then + begin + {$if declared(_BN_add_word)} + BN_add_word := @_BN_add_word; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_add_word_allownil)} + if FuncLoadError then + AFailed.Add('BN_add_word'); + {$ifend} + end; + + + BN_sub_word := LoadLibFunction(ADllHandle, BN_sub_word_procname); + FuncLoadError := not assigned(BN_sub_word); + if FuncLoadError then + begin + {$if not defined(BN_sub_word_allownil)} + BN_sub_word := @ERR_BN_sub_word; + {$ifend} + {$if declared(BN_sub_word_introduced)} + if LibVersion < BN_sub_word_introduced then + begin + {$if declared(FC_BN_sub_word)} + BN_sub_word := @FC_BN_sub_word; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_sub_word_removed)} + if BN_sub_word_removed <= LibVersion then + begin + {$if declared(_BN_sub_word)} + BN_sub_word := @_BN_sub_word; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_sub_word_allownil)} + if FuncLoadError then + AFailed.Add('BN_sub_word'); + {$ifend} + end; + + + BN_set_word := LoadLibFunction(ADllHandle, BN_set_word_procname); + FuncLoadError := not assigned(BN_set_word); + if FuncLoadError then + begin + {$if not defined(BN_set_word_allownil)} + BN_set_word := @ERR_BN_set_word; + {$ifend} + {$if declared(BN_set_word_introduced)} + if LibVersion < BN_set_word_introduced then + begin + {$if declared(FC_BN_set_word)} + BN_set_word := @FC_BN_set_word; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_set_word_removed)} + if BN_set_word_removed <= LibVersion then + begin + {$if declared(_BN_set_word)} + BN_set_word := @_BN_set_word; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_set_word_allownil)} + if FuncLoadError then + AFailed.Add('BN_set_word'); + {$ifend} + end; + + + BN_get_word := LoadLibFunction(ADllHandle, BN_get_word_procname); + FuncLoadError := not assigned(BN_get_word); + if FuncLoadError then + begin + {$if not defined(BN_get_word_allownil)} + BN_get_word := @ERR_BN_get_word; + {$ifend} + {$if declared(BN_get_word_introduced)} + if LibVersion < BN_get_word_introduced then + begin + {$if declared(FC_BN_get_word)} + BN_get_word := @FC_BN_get_word; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_get_word_removed)} + if BN_get_word_removed <= LibVersion then + begin + {$if declared(_BN_get_word)} + BN_get_word := @_BN_get_word; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_get_word_allownil)} + if FuncLoadError then + AFailed.Add('BN_get_word'); + {$ifend} + end; + + + BN_cmp := LoadLibFunction(ADllHandle, BN_cmp_procname); + FuncLoadError := not assigned(BN_cmp); + if FuncLoadError then + begin + {$if not defined(BN_cmp_allownil)} + BN_cmp := @ERR_BN_cmp; + {$ifend} + {$if declared(BN_cmp_introduced)} + if LibVersion < BN_cmp_introduced then + begin + {$if declared(FC_BN_cmp)} + BN_cmp := @FC_BN_cmp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_cmp_removed)} + if BN_cmp_removed <= LibVersion then + begin + {$if declared(_BN_cmp)} + BN_cmp := @_BN_cmp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_cmp_allownil)} + if FuncLoadError then + AFailed.Add('BN_cmp'); + {$ifend} + end; + + + BN_free := LoadLibFunction(ADllHandle, BN_free_procname); + FuncLoadError := not assigned(BN_free); + if FuncLoadError then + begin + {$if not defined(BN_free_allownil)} + BN_free := @ERR_BN_free; + {$ifend} + {$if declared(BN_free_introduced)} + if LibVersion < BN_free_introduced then + begin + {$if declared(FC_BN_free)} + BN_free := @FC_BN_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_free_removed)} + if BN_free_removed <= LibVersion then + begin + {$if declared(_BN_free)} + BN_free := @_BN_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_free_allownil)} + if FuncLoadError then + AFailed.Add('BN_free'); + {$ifend} + end; + + + BN_is_bit_set := LoadLibFunction(ADllHandle, BN_is_bit_set_procname); + FuncLoadError := not assigned(BN_is_bit_set); + if FuncLoadError then + begin + {$if not defined(BN_is_bit_set_allownil)} + BN_is_bit_set := @ERR_BN_is_bit_set; + {$ifend} + {$if declared(BN_is_bit_set_introduced)} + if LibVersion < BN_is_bit_set_introduced then + begin + {$if declared(FC_BN_is_bit_set)} + BN_is_bit_set := @FC_BN_is_bit_set; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_is_bit_set_removed)} + if BN_is_bit_set_removed <= LibVersion then + begin + {$if declared(_BN_is_bit_set)} + BN_is_bit_set := @_BN_is_bit_set; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_is_bit_set_allownil)} + if FuncLoadError then + AFailed.Add('BN_is_bit_set'); + {$ifend} + end; + + + BN_lshift := LoadLibFunction(ADllHandle, BN_lshift_procname); + FuncLoadError := not assigned(BN_lshift); + if FuncLoadError then + begin + {$if not defined(BN_lshift_allownil)} + BN_lshift := @ERR_BN_lshift; + {$ifend} + {$if declared(BN_lshift_introduced)} + if LibVersion < BN_lshift_introduced then + begin + {$if declared(FC_BN_lshift)} + BN_lshift := @FC_BN_lshift; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_lshift_removed)} + if BN_lshift_removed <= LibVersion then + begin + {$if declared(_BN_lshift)} + BN_lshift := @_BN_lshift; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_lshift_allownil)} + if FuncLoadError then + AFailed.Add('BN_lshift'); + {$ifend} + end; + + + BN_lshift1 := LoadLibFunction(ADllHandle, BN_lshift1_procname); + FuncLoadError := not assigned(BN_lshift1); + if FuncLoadError then + begin + {$if not defined(BN_lshift1_allownil)} + BN_lshift1 := @ERR_BN_lshift1; + {$ifend} + {$if declared(BN_lshift1_introduced)} + if LibVersion < BN_lshift1_introduced then + begin + {$if declared(FC_BN_lshift1)} + BN_lshift1 := @FC_BN_lshift1; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_lshift1_removed)} + if BN_lshift1_removed <= LibVersion then + begin + {$if declared(_BN_lshift1)} + BN_lshift1 := @_BN_lshift1; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_lshift1_allownil)} + if FuncLoadError then + AFailed.Add('BN_lshift1'); + {$ifend} + end; + + + BN_exp := LoadLibFunction(ADllHandle, BN_exp_procname); + FuncLoadError := not assigned(BN_exp); + if FuncLoadError then + begin + {$if not defined(BN_exp_allownil)} + BN_exp := @ERR_BN_exp; + {$ifend} + {$if declared(BN_exp_introduced)} + if LibVersion < BN_exp_introduced then + begin + {$if declared(FC_BN_exp)} + BN_exp := @FC_BN_exp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_exp_removed)} + if BN_exp_removed <= LibVersion then + begin + {$if declared(_BN_exp)} + BN_exp := @_BN_exp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_exp_allownil)} + if FuncLoadError then + AFailed.Add('BN_exp'); + {$ifend} + end; + + + BN_mod_exp := LoadLibFunction(ADllHandle, BN_mod_exp_procname); + FuncLoadError := not assigned(BN_mod_exp); + if FuncLoadError then + begin + {$if not defined(BN_mod_exp_allownil)} + BN_mod_exp := @ERR_BN_mod_exp; + {$ifend} + {$if declared(BN_mod_exp_introduced)} + if LibVersion < BN_mod_exp_introduced then + begin + {$if declared(FC_BN_mod_exp)} + BN_mod_exp := @FC_BN_mod_exp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_mod_exp_removed)} + if BN_mod_exp_removed <= LibVersion then + begin + {$if declared(_BN_mod_exp)} + BN_mod_exp := @_BN_mod_exp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_mod_exp_allownil)} + if FuncLoadError then + AFailed.Add('BN_mod_exp'); + {$ifend} + end; + + + BN_mod_exp_mont := LoadLibFunction(ADllHandle, BN_mod_exp_mont_procname); + FuncLoadError := not assigned(BN_mod_exp_mont); + if FuncLoadError then + begin + {$if not defined(BN_mod_exp_mont_allownil)} + BN_mod_exp_mont := @ERR_BN_mod_exp_mont; + {$ifend} + {$if declared(BN_mod_exp_mont_introduced)} + if LibVersion < BN_mod_exp_mont_introduced then + begin + {$if declared(FC_BN_mod_exp_mont)} + BN_mod_exp_mont := @FC_BN_mod_exp_mont; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_mod_exp_mont_removed)} + if BN_mod_exp_mont_removed <= LibVersion then + begin + {$if declared(_BN_mod_exp_mont)} + BN_mod_exp_mont := @_BN_mod_exp_mont; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_mod_exp_mont_allownil)} + if FuncLoadError then + AFailed.Add('BN_mod_exp_mont'); + {$ifend} + end; + + + BN_mod_exp_mont_consttime := LoadLibFunction(ADllHandle, BN_mod_exp_mont_consttime_procname); + FuncLoadError := not assigned(BN_mod_exp_mont_consttime); + if FuncLoadError then + begin + {$if not defined(BN_mod_exp_mont_consttime_allownil)} + BN_mod_exp_mont_consttime := @ERR_BN_mod_exp_mont_consttime; + {$ifend} + {$if declared(BN_mod_exp_mont_consttime_introduced)} + if LibVersion < BN_mod_exp_mont_consttime_introduced then + begin + {$if declared(FC_BN_mod_exp_mont_consttime)} + BN_mod_exp_mont_consttime := @FC_BN_mod_exp_mont_consttime; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_mod_exp_mont_consttime_removed)} + if BN_mod_exp_mont_consttime_removed <= LibVersion then + begin + {$if declared(_BN_mod_exp_mont_consttime)} + BN_mod_exp_mont_consttime := @_BN_mod_exp_mont_consttime; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_mod_exp_mont_consttime_allownil)} + if FuncLoadError then + AFailed.Add('BN_mod_exp_mont_consttime'); + {$ifend} + end; + + + BN_mod_exp_mont_word := LoadLibFunction(ADllHandle, BN_mod_exp_mont_word_procname); + FuncLoadError := not assigned(BN_mod_exp_mont_word); + if FuncLoadError then + begin + {$if not defined(BN_mod_exp_mont_word_allownil)} + BN_mod_exp_mont_word := @ERR_BN_mod_exp_mont_word; + {$ifend} + {$if declared(BN_mod_exp_mont_word_introduced)} + if LibVersion < BN_mod_exp_mont_word_introduced then + begin + {$if declared(FC_BN_mod_exp_mont_word)} + BN_mod_exp_mont_word := @FC_BN_mod_exp_mont_word; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_mod_exp_mont_word_removed)} + if BN_mod_exp_mont_word_removed <= LibVersion then + begin + {$if declared(_BN_mod_exp_mont_word)} + BN_mod_exp_mont_word := @_BN_mod_exp_mont_word; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_mod_exp_mont_word_allownil)} + if FuncLoadError then + AFailed.Add('BN_mod_exp_mont_word'); + {$ifend} + end; + + + BN_mod_exp2_mont := LoadLibFunction(ADllHandle, BN_mod_exp2_mont_procname); + FuncLoadError := not assigned(BN_mod_exp2_mont); + if FuncLoadError then + begin + {$if not defined(BN_mod_exp2_mont_allownil)} + BN_mod_exp2_mont := @ERR_BN_mod_exp2_mont; + {$ifend} + {$if declared(BN_mod_exp2_mont_introduced)} + if LibVersion < BN_mod_exp2_mont_introduced then + begin + {$if declared(FC_BN_mod_exp2_mont)} + BN_mod_exp2_mont := @FC_BN_mod_exp2_mont; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_mod_exp2_mont_removed)} + if BN_mod_exp2_mont_removed <= LibVersion then + begin + {$if declared(_BN_mod_exp2_mont)} + BN_mod_exp2_mont := @_BN_mod_exp2_mont; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_mod_exp2_mont_allownil)} + if FuncLoadError then + AFailed.Add('BN_mod_exp2_mont'); + {$ifend} + end; + + + BN_mod_exp_simple := LoadLibFunction(ADllHandle, BN_mod_exp_simple_procname); + FuncLoadError := not assigned(BN_mod_exp_simple); + if FuncLoadError then + begin + {$if not defined(BN_mod_exp_simple_allownil)} + BN_mod_exp_simple := @ERR_BN_mod_exp_simple; + {$ifend} + {$if declared(BN_mod_exp_simple_introduced)} + if LibVersion < BN_mod_exp_simple_introduced then + begin + {$if declared(FC_BN_mod_exp_simple)} + BN_mod_exp_simple := @FC_BN_mod_exp_simple; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_mod_exp_simple_removed)} + if BN_mod_exp_simple_removed <= LibVersion then + begin + {$if declared(_BN_mod_exp_simple)} + BN_mod_exp_simple := @_BN_mod_exp_simple; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_mod_exp_simple_allownil)} + if FuncLoadError then + AFailed.Add('BN_mod_exp_simple'); + {$ifend} + end; + + + BN_mask_bits := LoadLibFunction(ADllHandle, BN_mask_bits_procname); + FuncLoadError := not assigned(BN_mask_bits); + if FuncLoadError then + begin + {$if not defined(BN_mask_bits_allownil)} + BN_mask_bits := @ERR_BN_mask_bits; + {$ifend} + {$if declared(BN_mask_bits_introduced)} + if LibVersion < BN_mask_bits_introduced then + begin + {$if declared(FC_BN_mask_bits)} + BN_mask_bits := @FC_BN_mask_bits; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_mask_bits_removed)} + if BN_mask_bits_removed <= LibVersion then + begin + {$if declared(_BN_mask_bits)} + BN_mask_bits := @_BN_mask_bits; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_mask_bits_allownil)} + if FuncLoadError then + AFailed.Add('BN_mask_bits'); + {$ifend} + end; + + + BN_print := LoadLibFunction(ADllHandle, BN_print_procname); + FuncLoadError := not assigned(BN_print); + if FuncLoadError then + begin + {$if not defined(BN_print_allownil)} + BN_print := @ERR_BN_print; + {$ifend} + {$if declared(BN_print_introduced)} + if LibVersion < BN_print_introduced then + begin + {$if declared(FC_BN_print)} + BN_print := @FC_BN_print; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_print_removed)} + if BN_print_removed <= LibVersion then + begin + {$if declared(_BN_print)} + BN_print := @_BN_print; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_print_allownil)} + if FuncLoadError then + AFailed.Add('BN_print'); + {$ifend} + end; + + + BN_reciprocal := LoadLibFunction(ADllHandle, BN_reciprocal_procname); + FuncLoadError := not assigned(BN_reciprocal); + if FuncLoadError then + begin + {$if not defined(BN_reciprocal_allownil)} + BN_reciprocal := @ERR_BN_reciprocal; + {$ifend} + {$if declared(BN_reciprocal_introduced)} + if LibVersion < BN_reciprocal_introduced then + begin + {$if declared(FC_BN_reciprocal)} + BN_reciprocal := @FC_BN_reciprocal; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_reciprocal_removed)} + if BN_reciprocal_removed <= LibVersion then + begin + {$if declared(_BN_reciprocal)} + BN_reciprocal := @_BN_reciprocal; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_reciprocal_allownil)} + if FuncLoadError then + AFailed.Add('BN_reciprocal'); + {$ifend} + end; + + + BN_rshift := LoadLibFunction(ADllHandle, BN_rshift_procname); + FuncLoadError := not assigned(BN_rshift); + if FuncLoadError then + begin + {$if not defined(BN_rshift_allownil)} + BN_rshift := @ERR_BN_rshift; + {$ifend} + {$if declared(BN_rshift_introduced)} + if LibVersion < BN_rshift_introduced then + begin + {$if declared(FC_BN_rshift)} + BN_rshift := @FC_BN_rshift; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_rshift_removed)} + if BN_rshift_removed <= LibVersion then + begin + {$if declared(_BN_rshift)} + BN_rshift := @_BN_rshift; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_rshift_allownil)} + if FuncLoadError then + AFailed.Add('BN_rshift'); + {$ifend} + end; + + + BN_rshift1 := LoadLibFunction(ADllHandle, BN_rshift1_procname); + FuncLoadError := not assigned(BN_rshift1); + if FuncLoadError then + begin + {$if not defined(BN_rshift1_allownil)} + BN_rshift1 := @ERR_BN_rshift1; + {$ifend} + {$if declared(BN_rshift1_introduced)} + if LibVersion < BN_rshift1_introduced then + begin + {$if declared(FC_BN_rshift1)} + BN_rshift1 := @FC_BN_rshift1; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_rshift1_removed)} + if BN_rshift1_removed <= LibVersion then + begin + {$if declared(_BN_rshift1)} + BN_rshift1 := @_BN_rshift1; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_rshift1_allownil)} + if FuncLoadError then + AFailed.Add('BN_rshift1'); + {$ifend} + end; + + + BN_clear := LoadLibFunction(ADllHandle, BN_clear_procname); + FuncLoadError := not assigned(BN_clear); + if FuncLoadError then + begin + {$if not defined(BN_clear_allownil)} + BN_clear := @ERR_BN_clear; + {$ifend} + {$if declared(BN_clear_introduced)} + if LibVersion < BN_clear_introduced then + begin + {$if declared(FC_BN_clear)} + BN_clear := @FC_BN_clear; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_clear_removed)} + if BN_clear_removed <= LibVersion then + begin + {$if declared(_BN_clear)} + BN_clear := @_BN_clear; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_clear_allownil)} + if FuncLoadError then + AFailed.Add('BN_clear'); + {$ifend} + end; + + + BN_dup := LoadLibFunction(ADllHandle, BN_dup_procname); + FuncLoadError := not assigned(BN_dup); + if FuncLoadError then + begin + {$if not defined(BN_dup_allownil)} + BN_dup := @ERR_BN_dup; + {$ifend} + {$if declared(BN_dup_introduced)} + if LibVersion < BN_dup_introduced then + begin + {$if declared(FC_BN_dup)} + BN_dup := @FC_BN_dup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_dup_removed)} + if BN_dup_removed <= LibVersion then + begin + {$if declared(_BN_dup)} + BN_dup := @_BN_dup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_dup_allownil)} + if FuncLoadError then + AFailed.Add('BN_dup'); + {$ifend} + end; + + + BN_ucmp := LoadLibFunction(ADllHandle, BN_ucmp_procname); + FuncLoadError := not assigned(BN_ucmp); + if FuncLoadError then + begin + {$if not defined(BN_ucmp_allownil)} + BN_ucmp := @ERR_BN_ucmp; + {$ifend} + {$if declared(BN_ucmp_introduced)} + if LibVersion < BN_ucmp_introduced then + begin + {$if declared(FC_BN_ucmp)} + BN_ucmp := @FC_BN_ucmp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_ucmp_removed)} + if BN_ucmp_removed <= LibVersion then + begin + {$if declared(_BN_ucmp)} + BN_ucmp := @_BN_ucmp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_ucmp_allownil)} + if FuncLoadError then + AFailed.Add('BN_ucmp'); + {$ifend} + end; + + + BN_set_bit := LoadLibFunction(ADllHandle, BN_set_bit_procname); + FuncLoadError := not assigned(BN_set_bit); + if FuncLoadError then + begin + {$if not defined(BN_set_bit_allownil)} + BN_set_bit := @ERR_BN_set_bit; + {$ifend} + {$if declared(BN_set_bit_introduced)} + if LibVersion < BN_set_bit_introduced then + begin + {$if declared(FC_BN_set_bit)} + BN_set_bit := @FC_BN_set_bit; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_set_bit_removed)} + if BN_set_bit_removed <= LibVersion then + begin + {$if declared(_BN_set_bit)} + BN_set_bit := @_BN_set_bit; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_set_bit_allownil)} + if FuncLoadError then + AFailed.Add('BN_set_bit'); + {$ifend} + end; + + + BN_clear_bit := LoadLibFunction(ADllHandle, BN_clear_bit_procname); + FuncLoadError := not assigned(BN_clear_bit); + if FuncLoadError then + begin + {$if not defined(BN_clear_bit_allownil)} + BN_clear_bit := @ERR_BN_clear_bit; + {$ifend} + {$if declared(BN_clear_bit_introduced)} + if LibVersion < BN_clear_bit_introduced then + begin + {$if declared(FC_BN_clear_bit)} + BN_clear_bit := @FC_BN_clear_bit; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_clear_bit_removed)} + if BN_clear_bit_removed <= LibVersion then + begin + {$if declared(_BN_clear_bit)} + BN_clear_bit := @_BN_clear_bit; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_clear_bit_allownil)} + if FuncLoadError then + AFailed.Add('BN_clear_bit'); + {$ifend} + end; + + + BN_bn2hex := LoadLibFunction(ADllHandle, BN_bn2hex_procname); + FuncLoadError := not assigned(BN_bn2hex); + if FuncLoadError then + begin + {$if not defined(BN_bn2hex_allownil)} + BN_bn2hex := @ERR_BN_bn2hex; + {$ifend} + {$if declared(BN_bn2hex_introduced)} + if LibVersion < BN_bn2hex_introduced then + begin + {$if declared(FC_BN_bn2hex)} + BN_bn2hex := @FC_BN_bn2hex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_bn2hex_removed)} + if BN_bn2hex_removed <= LibVersion then + begin + {$if declared(_BN_bn2hex)} + BN_bn2hex := @_BN_bn2hex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_bn2hex_allownil)} + if FuncLoadError then + AFailed.Add('BN_bn2hex'); + {$ifend} + end; + + + BN_bn2dec := LoadLibFunction(ADllHandle, BN_bn2dec_procname); + FuncLoadError := not assigned(BN_bn2dec); + if FuncLoadError then + begin + {$if not defined(BN_bn2dec_allownil)} + BN_bn2dec := @ERR_BN_bn2dec; + {$ifend} + {$if declared(BN_bn2dec_introduced)} + if LibVersion < BN_bn2dec_introduced then + begin + {$if declared(FC_BN_bn2dec)} + BN_bn2dec := @FC_BN_bn2dec; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_bn2dec_removed)} + if BN_bn2dec_removed <= LibVersion then + begin + {$if declared(_BN_bn2dec)} + BN_bn2dec := @_BN_bn2dec; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_bn2dec_allownil)} + if FuncLoadError then + AFailed.Add('BN_bn2dec'); + {$ifend} + end; + + + BN_hex2bn := LoadLibFunction(ADllHandle, BN_hex2bn_procname); + FuncLoadError := not assigned(BN_hex2bn); + if FuncLoadError then + begin + {$if not defined(BN_hex2bn_allownil)} + BN_hex2bn := @ERR_BN_hex2bn; + {$ifend} + {$if declared(BN_hex2bn_introduced)} + if LibVersion < BN_hex2bn_introduced then + begin + {$if declared(FC_BN_hex2bn)} + BN_hex2bn := @FC_BN_hex2bn; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_hex2bn_removed)} + if BN_hex2bn_removed <= LibVersion then + begin + {$if declared(_BN_hex2bn)} + BN_hex2bn := @_BN_hex2bn; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_hex2bn_allownil)} + if FuncLoadError then + AFailed.Add('BN_hex2bn'); + {$ifend} + end; + + + BN_dec2bn := LoadLibFunction(ADllHandle, BN_dec2bn_procname); + FuncLoadError := not assigned(BN_dec2bn); + if FuncLoadError then + begin + {$if not defined(BN_dec2bn_allownil)} + BN_dec2bn := @ERR_BN_dec2bn; + {$ifend} + {$if declared(BN_dec2bn_introduced)} + if LibVersion < BN_dec2bn_introduced then + begin + {$if declared(FC_BN_dec2bn)} + BN_dec2bn := @FC_BN_dec2bn; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_dec2bn_removed)} + if BN_dec2bn_removed <= LibVersion then + begin + {$if declared(_BN_dec2bn)} + BN_dec2bn := @_BN_dec2bn; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_dec2bn_allownil)} + if FuncLoadError then + AFailed.Add('BN_dec2bn'); + {$ifend} + end; + + + BN_asc2bn := LoadLibFunction(ADllHandle, BN_asc2bn_procname); + FuncLoadError := not assigned(BN_asc2bn); + if FuncLoadError then + begin + {$if not defined(BN_asc2bn_allownil)} + BN_asc2bn := @ERR_BN_asc2bn; + {$ifend} + {$if declared(BN_asc2bn_introduced)} + if LibVersion < BN_asc2bn_introduced then + begin + {$if declared(FC_BN_asc2bn)} + BN_asc2bn := @FC_BN_asc2bn; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_asc2bn_removed)} + if BN_asc2bn_removed <= LibVersion then + begin + {$if declared(_BN_asc2bn)} + BN_asc2bn := @_BN_asc2bn; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_asc2bn_allownil)} + if FuncLoadError then + AFailed.Add('BN_asc2bn'); + {$ifend} + end; + + + BN_gcd := LoadLibFunction(ADllHandle, BN_gcd_procname); + FuncLoadError := not assigned(BN_gcd); + if FuncLoadError then + begin + {$if not defined(BN_gcd_allownil)} + BN_gcd := @ERR_BN_gcd; + {$ifend} + {$if declared(BN_gcd_introduced)} + if LibVersion < BN_gcd_introduced then + begin + {$if declared(FC_BN_gcd)} + BN_gcd := @FC_BN_gcd; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_gcd_removed)} + if BN_gcd_removed <= LibVersion then + begin + {$if declared(_BN_gcd)} + BN_gcd := @_BN_gcd; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_gcd_allownil)} + if FuncLoadError then + AFailed.Add('BN_gcd'); + {$ifend} + end; + + + BN_kronecker := LoadLibFunction(ADllHandle, BN_kronecker_procname); + FuncLoadError := not assigned(BN_kronecker); + if FuncLoadError then + begin + {$if not defined(BN_kronecker_allownil)} + BN_kronecker := @ERR_BN_kronecker; + {$ifend} + {$if declared(BN_kronecker_introduced)} + if LibVersion < BN_kronecker_introduced then + begin + {$if declared(FC_BN_kronecker)} + BN_kronecker := @FC_BN_kronecker; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_kronecker_removed)} + if BN_kronecker_removed <= LibVersion then + begin + {$if declared(_BN_kronecker)} + BN_kronecker := @_BN_kronecker; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_kronecker_allownil)} + if FuncLoadError then + AFailed.Add('BN_kronecker'); + {$ifend} + end; + + + BN_mod_inverse := LoadLibFunction(ADllHandle, BN_mod_inverse_procname); + FuncLoadError := not assigned(BN_mod_inverse); + if FuncLoadError then + begin + {$if not defined(BN_mod_inverse_allownil)} + BN_mod_inverse := @ERR_BN_mod_inverse; + {$ifend} + {$if declared(BN_mod_inverse_introduced)} + if LibVersion < BN_mod_inverse_introduced then + begin + {$if declared(FC_BN_mod_inverse)} + BN_mod_inverse := @FC_BN_mod_inverse; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_mod_inverse_removed)} + if BN_mod_inverse_removed <= LibVersion then + begin + {$if declared(_BN_mod_inverse)} + BN_mod_inverse := @_BN_mod_inverse; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_mod_inverse_allownil)} + if FuncLoadError then + AFailed.Add('BN_mod_inverse'); + {$ifend} + end; + + + BN_mod_sqrt := LoadLibFunction(ADllHandle, BN_mod_sqrt_procname); + FuncLoadError := not assigned(BN_mod_sqrt); + if FuncLoadError then + begin + {$if not defined(BN_mod_sqrt_allownil)} + BN_mod_sqrt := @ERR_BN_mod_sqrt; + {$ifend} + {$if declared(BN_mod_sqrt_introduced)} + if LibVersion < BN_mod_sqrt_introduced then + begin + {$if declared(FC_BN_mod_sqrt)} + BN_mod_sqrt := @FC_BN_mod_sqrt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_mod_sqrt_removed)} + if BN_mod_sqrt_removed <= LibVersion then + begin + {$if declared(_BN_mod_sqrt)} + BN_mod_sqrt := @_BN_mod_sqrt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_mod_sqrt_allownil)} + if FuncLoadError then + AFailed.Add('BN_mod_sqrt'); + {$ifend} + end; + + + BN_consttime_swap := LoadLibFunction(ADllHandle, BN_consttime_swap_procname); + FuncLoadError := not assigned(BN_consttime_swap); + if FuncLoadError then + begin + {$if not defined(BN_consttime_swap_allownil)} + BN_consttime_swap := @ERR_BN_consttime_swap; + {$ifend} + {$if declared(BN_consttime_swap_introduced)} + if LibVersion < BN_consttime_swap_introduced then + begin + {$if declared(FC_BN_consttime_swap)} + BN_consttime_swap := @FC_BN_consttime_swap; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_consttime_swap_removed)} + if BN_consttime_swap_removed <= LibVersion then + begin + {$if declared(_BN_consttime_swap)} + BN_consttime_swap := @_BN_consttime_swap; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_consttime_swap_allownil)} + if FuncLoadError then + AFailed.Add('BN_consttime_swap'); + {$ifend} + end; + + + BN_generate_prime_ex := LoadLibFunction(ADllHandle, BN_generate_prime_ex_procname); + FuncLoadError := not assigned(BN_generate_prime_ex); + if FuncLoadError then + begin + {$if not defined(BN_generate_prime_ex_allownil)} + BN_generate_prime_ex := @ERR_BN_generate_prime_ex; + {$ifend} + {$if declared(BN_generate_prime_ex_introduced)} + if LibVersion < BN_generate_prime_ex_introduced then + begin + {$if declared(FC_BN_generate_prime_ex)} + BN_generate_prime_ex := @FC_BN_generate_prime_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_generate_prime_ex_removed)} + if BN_generate_prime_ex_removed <= LibVersion then + begin + {$if declared(_BN_generate_prime_ex)} + BN_generate_prime_ex := @_BN_generate_prime_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_generate_prime_ex_allownil)} + if FuncLoadError then + AFailed.Add('BN_generate_prime_ex'); + {$ifend} + end; + + + BN_is_prime_ex := LoadLibFunction(ADllHandle, BN_is_prime_ex_procname); + FuncLoadError := not assigned(BN_is_prime_ex); + if FuncLoadError then + begin + {$if not defined(BN_is_prime_ex_allownil)} + BN_is_prime_ex := @ERR_BN_is_prime_ex; + {$ifend} + {$if declared(BN_is_prime_ex_introduced)} + if LibVersion < BN_is_prime_ex_introduced then + begin + {$if declared(FC_BN_is_prime_ex)} + BN_is_prime_ex := @FC_BN_is_prime_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_is_prime_ex_removed)} + if BN_is_prime_ex_removed <= LibVersion then + begin + {$if declared(_BN_is_prime_ex)} + BN_is_prime_ex := @_BN_is_prime_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_is_prime_ex_allownil)} + if FuncLoadError then + AFailed.Add('BN_is_prime_ex'); + {$ifend} + end; + + + BN_is_prime_fasttest_ex := LoadLibFunction(ADllHandle, BN_is_prime_fasttest_ex_procname); + FuncLoadError := not assigned(BN_is_prime_fasttest_ex); + if FuncLoadError then + begin + {$if not defined(BN_is_prime_fasttest_ex_allownil)} + BN_is_prime_fasttest_ex := @ERR_BN_is_prime_fasttest_ex; + {$ifend} + {$if declared(BN_is_prime_fasttest_ex_introduced)} + if LibVersion < BN_is_prime_fasttest_ex_introduced then + begin + {$if declared(FC_BN_is_prime_fasttest_ex)} + BN_is_prime_fasttest_ex := @FC_BN_is_prime_fasttest_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_is_prime_fasttest_ex_removed)} + if BN_is_prime_fasttest_ex_removed <= LibVersion then + begin + {$if declared(_BN_is_prime_fasttest_ex)} + BN_is_prime_fasttest_ex := @_BN_is_prime_fasttest_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_is_prime_fasttest_ex_allownil)} + if FuncLoadError then + AFailed.Add('BN_is_prime_fasttest_ex'); + {$ifend} + end; + + + BN_X931_generate_Xpq := LoadLibFunction(ADllHandle, BN_X931_generate_Xpq_procname); + FuncLoadError := not assigned(BN_X931_generate_Xpq); + if FuncLoadError then + begin + {$if not defined(BN_X931_generate_Xpq_allownil)} + BN_X931_generate_Xpq := @ERR_BN_X931_generate_Xpq; + {$ifend} + {$if declared(BN_X931_generate_Xpq_introduced)} + if LibVersion < BN_X931_generate_Xpq_introduced then + begin + {$if declared(FC_BN_X931_generate_Xpq)} + BN_X931_generate_Xpq := @FC_BN_X931_generate_Xpq; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_X931_generate_Xpq_removed)} + if BN_X931_generate_Xpq_removed <= LibVersion then + begin + {$if declared(_BN_X931_generate_Xpq)} + BN_X931_generate_Xpq := @_BN_X931_generate_Xpq; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_X931_generate_Xpq_allownil)} + if FuncLoadError then + AFailed.Add('BN_X931_generate_Xpq'); + {$ifend} + end; + + + BN_X931_derive_prime_ex := LoadLibFunction(ADllHandle, BN_X931_derive_prime_ex_procname); + FuncLoadError := not assigned(BN_X931_derive_prime_ex); + if FuncLoadError then + begin + {$if not defined(BN_X931_derive_prime_ex_allownil)} + BN_X931_derive_prime_ex := @ERR_BN_X931_derive_prime_ex; + {$ifend} + {$if declared(BN_X931_derive_prime_ex_introduced)} + if LibVersion < BN_X931_derive_prime_ex_introduced then + begin + {$if declared(FC_BN_X931_derive_prime_ex)} + BN_X931_derive_prime_ex := @FC_BN_X931_derive_prime_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_X931_derive_prime_ex_removed)} + if BN_X931_derive_prime_ex_removed <= LibVersion then + begin + {$if declared(_BN_X931_derive_prime_ex)} + BN_X931_derive_prime_ex := @_BN_X931_derive_prime_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_X931_derive_prime_ex_allownil)} + if FuncLoadError then + AFailed.Add('BN_X931_derive_prime_ex'); + {$ifend} + end; + + + BN_X931_generate_prime_ex := LoadLibFunction(ADllHandle, BN_X931_generate_prime_ex_procname); + FuncLoadError := not assigned(BN_X931_generate_prime_ex); + if FuncLoadError then + begin + {$if not defined(BN_X931_generate_prime_ex_allownil)} + BN_X931_generate_prime_ex := @ERR_BN_X931_generate_prime_ex; + {$ifend} + {$if declared(BN_X931_generate_prime_ex_introduced)} + if LibVersion < BN_X931_generate_prime_ex_introduced then + begin + {$if declared(FC_BN_X931_generate_prime_ex)} + BN_X931_generate_prime_ex := @FC_BN_X931_generate_prime_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_X931_generate_prime_ex_removed)} + if BN_X931_generate_prime_ex_removed <= LibVersion then + begin + {$if declared(_BN_X931_generate_prime_ex)} + BN_X931_generate_prime_ex := @_BN_X931_generate_prime_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_X931_generate_prime_ex_allownil)} + if FuncLoadError then + AFailed.Add('BN_X931_generate_prime_ex'); + {$ifend} + end; + + + BN_MONT_CTX_new := LoadLibFunction(ADllHandle, BN_MONT_CTX_new_procname); + FuncLoadError := not assigned(BN_MONT_CTX_new); + if FuncLoadError then + begin + {$if not defined(BN_MONT_CTX_new_allownil)} + BN_MONT_CTX_new := @ERR_BN_MONT_CTX_new; + {$ifend} + {$if declared(BN_MONT_CTX_new_introduced)} + if LibVersion < BN_MONT_CTX_new_introduced then + begin + {$if declared(FC_BN_MONT_CTX_new)} + BN_MONT_CTX_new := @FC_BN_MONT_CTX_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_MONT_CTX_new_removed)} + if BN_MONT_CTX_new_removed <= LibVersion then + begin + {$if declared(_BN_MONT_CTX_new)} + BN_MONT_CTX_new := @_BN_MONT_CTX_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_MONT_CTX_new_allownil)} + if FuncLoadError then + AFailed.Add('BN_MONT_CTX_new'); + {$ifend} + end; + + + BN_mod_mul_montgomery := LoadLibFunction(ADllHandle, BN_mod_mul_montgomery_procname); + FuncLoadError := not assigned(BN_mod_mul_montgomery); + if FuncLoadError then + begin + {$if not defined(BN_mod_mul_montgomery_allownil)} + BN_mod_mul_montgomery := @ERR_BN_mod_mul_montgomery; + {$ifend} + {$if declared(BN_mod_mul_montgomery_introduced)} + if LibVersion < BN_mod_mul_montgomery_introduced then + begin + {$if declared(FC_BN_mod_mul_montgomery)} + BN_mod_mul_montgomery := @FC_BN_mod_mul_montgomery; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_mod_mul_montgomery_removed)} + if BN_mod_mul_montgomery_removed <= LibVersion then + begin + {$if declared(_BN_mod_mul_montgomery)} + BN_mod_mul_montgomery := @_BN_mod_mul_montgomery; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_mod_mul_montgomery_allownil)} + if FuncLoadError then + AFailed.Add('BN_mod_mul_montgomery'); + {$ifend} + end; + + + BN_to_montgomery := LoadLibFunction(ADllHandle, BN_to_montgomery_procname); + FuncLoadError := not assigned(BN_to_montgomery); + if FuncLoadError then + begin + {$if not defined(BN_to_montgomery_allownil)} + BN_to_montgomery := @ERR_BN_to_montgomery; + {$ifend} + {$if declared(BN_to_montgomery_introduced)} + if LibVersion < BN_to_montgomery_introduced then + begin + {$if declared(FC_BN_to_montgomery)} + BN_to_montgomery := @FC_BN_to_montgomery; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_to_montgomery_removed)} + if BN_to_montgomery_removed <= LibVersion then + begin + {$if declared(_BN_to_montgomery)} + BN_to_montgomery := @_BN_to_montgomery; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_to_montgomery_allownil)} + if FuncLoadError then + AFailed.Add('BN_to_montgomery'); + {$ifend} + end; + + + BN_from_montgomery := LoadLibFunction(ADllHandle, BN_from_montgomery_procname); + FuncLoadError := not assigned(BN_from_montgomery); + if FuncLoadError then + begin + {$if not defined(BN_from_montgomery_allownil)} + BN_from_montgomery := @ERR_BN_from_montgomery; + {$ifend} + {$if declared(BN_from_montgomery_introduced)} + if LibVersion < BN_from_montgomery_introduced then + begin + {$if declared(FC_BN_from_montgomery)} + BN_from_montgomery := @FC_BN_from_montgomery; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_from_montgomery_removed)} + if BN_from_montgomery_removed <= LibVersion then + begin + {$if declared(_BN_from_montgomery)} + BN_from_montgomery := @_BN_from_montgomery; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_from_montgomery_allownil)} + if FuncLoadError then + AFailed.Add('BN_from_montgomery'); + {$ifend} + end; + + + BN_MONT_CTX_free := LoadLibFunction(ADllHandle, BN_MONT_CTX_free_procname); + FuncLoadError := not assigned(BN_MONT_CTX_free); + if FuncLoadError then + begin + {$if not defined(BN_MONT_CTX_free_allownil)} + BN_MONT_CTX_free := @ERR_BN_MONT_CTX_free; + {$ifend} + {$if declared(BN_MONT_CTX_free_introduced)} + if LibVersion < BN_MONT_CTX_free_introduced then + begin + {$if declared(FC_BN_MONT_CTX_free)} + BN_MONT_CTX_free := @FC_BN_MONT_CTX_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_MONT_CTX_free_removed)} + if BN_MONT_CTX_free_removed <= LibVersion then + begin + {$if declared(_BN_MONT_CTX_free)} + BN_MONT_CTX_free := @_BN_MONT_CTX_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_MONT_CTX_free_allownil)} + if FuncLoadError then + AFailed.Add('BN_MONT_CTX_free'); + {$ifend} + end; + + + BN_MONT_CTX_set := LoadLibFunction(ADllHandle, BN_MONT_CTX_set_procname); + FuncLoadError := not assigned(BN_MONT_CTX_set); + if FuncLoadError then + begin + {$if not defined(BN_MONT_CTX_set_allownil)} + BN_MONT_CTX_set := @ERR_BN_MONT_CTX_set; + {$ifend} + {$if declared(BN_MONT_CTX_set_introduced)} + if LibVersion < BN_MONT_CTX_set_introduced then + begin + {$if declared(FC_BN_MONT_CTX_set)} + BN_MONT_CTX_set := @FC_BN_MONT_CTX_set; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_MONT_CTX_set_removed)} + if BN_MONT_CTX_set_removed <= LibVersion then + begin + {$if declared(_BN_MONT_CTX_set)} + BN_MONT_CTX_set := @_BN_MONT_CTX_set; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_MONT_CTX_set_allownil)} + if FuncLoadError then + AFailed.Add('BN_MONT_CTX_set'); + {$ifend} + end; + + + BN_MONT_CTX_copy := LoadLibFunction(ADllHandle, BN_MONT_CTX_copy_procname); + FuncLoadError := not assigned(BN_MONT_CTX_copy); + if FuncLoadError then + begin + {$if not defined(BN_MONT_CTX_copy_allownil)} + BN_MONT_CTX_copy := @ERR_BN_MONT_CTX_copy; + {$ifend} + {$if declared(BN_MONT_CTX_copy_introduced)} + if LibVersion < BN_MONT_CTX_copy_introduced then + begin + {$if declared(FC_BN_MONT_CTX_copy)} + BN_MONT_CTX_copy := @FC_BN_MONT_CTX_copy; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_MONT_CTX_copy_removed)} + if BN_MONT_CTX_copy_removed <= LibVersion then + begin + {$if declared(_BN_MONT_CTX_copy)} + BN_MONT_CTX_copy := @_BN_MONT_CTX_copy; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_MONT_CTX_copy_allownil)} + if FuncLoadError then + AFailed.Add('BN_MONT_CTX_copy'); + {$ifend} + end; + + + BN_BLINDING_new := LoadLibFunction(ADllHandle, BN_BLINDING_new_procname); + FuncLoadError := not assigned(BN_BLINDING_new); + if FuncLoadError then + begin + {$if not defined(BN_BLINDING_new_allownil)} + BN_BLINDING_new := @ERR_BN_BLINDING_new; + {$ifend} + {$if declared(BN_BLINDING_new_introduced)} + if LibVersion < BN_BLINDING_new_introduced then + begin + {$if declared(FC_BN_BLINDING_new)} + BN_BLINDING_new := @FC_BN_BLINDING_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_BLINDING_new_removed)} + if BN_BLINDING_new_removed <= LibVersion then + begin + {$if declared(_BN_BLINDING_new)} + BN_BLINDING_new := @_BN_BLINDING_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_BLINDING_new_allownil)} + if FuncLoadError then + AFailed.Add('BN_BLINDING_new'); + {$ifend} + end; + + + BN_BLINDING_free := LoadLibFunction(ADllHandle, BN_BLINDING_free_procname); + FuncLoadError := not assigned(BN_BLINDING_free); + if FuncLoadError then + begin + {$if not defined(BN_BLINDING_free_allownil)} + BN_BLINDING_free := @ERR_BN_BLINDING_free; + {$ifend} + {$if declared(BN_BLINDING_free_introduced)} + if LibVersion < BN_BLINDING_free_introduced then + begin + {$if declared(FC_BN_BLINDING_free)} + BN_BLINDING_free := @FC_BN_BLINDING_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_BLINDING_free_removed)} + if BN_BLINDING_free_removed <= LibVersion then + begin + {$if declared(_BN_BLINDING_free)} + BN_BLINDING_free := @_BN_BLINDING_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_BLINDING_free_allownil)} + if FuncLoadError then + AFailed.Add('BN_BLINDING_free'); + {$ifend} + end; + + + BN_BLINDING_update := LoadLibFunction(ADllHandle, BN_BLINDING_update_procname); + FuncLoadError := not assigned(BN_BLINDING_update); + if FuncLoadError then + begin + {$if not defined(BN_BLINDING_update_allownil)} + BN_BLINDING_update := @ERR_BN_BLINDING_update; + {$ifend} + {$if declared(BN_BLINDING_update_introduced)} + if LibVersion < BN_BLINDING_update_introduced then + begin + {$if declared(FC_BN_BLINDING_update)} + BN_BLINDING_update := @FC_BN_BLINDING_update; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_BLINDING_update_removed)} + if BN_BLINDING_update_removed <= LibVersion then + begin + {$if declared(_BN_BLINDING_update)} + BN_BLINDING_update := @_BN_BLINDING_update; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_BLINDING_update_allownil)} + if FuncLoadError then + AFailed.Add('BN_BLINDING_update'); + {$ifend} + end; + + + BN_BLINDING_convert := LoadLibFunction(ADllHandle, BN_BLINDING_convert_procname); + FuncLoadError := not assigned(BN_BLINDING_convert); + if FuncLoadError then + begin + {$if not defined(BN_BLINDING_convert_allownil)} + BN_BLINDING_convert := @ERR_BN_BLINDING_convert; + {$ifend} + {$if declared(BN_BLINDING_convert_introduced)} + if LibVersion < BN_BLINDING_convert_introduced then + begin + {$if declared(FC_BN_BLINDING_convert)} + BN_BLINDING_convert := @FC_BN_BLINDING_convert; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_BLINDING_convert_removed)} + if BN_BLINDING_convert_removed <= LibVersion then + begin + {$if declared(_BN_BLINDING_convert)} + BN_BLINDING_convert := @_BN_BLINDING_convert; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_BLINDING_convert_allownil)} + if FuncLoadError then + AFailed.Add('BN_BLINDING_convert'); + {$ifend} + end; + + + BN_BLINDING_invert := LoadLibFunction(ADllHandle, BN_BLINDING_invert_procname); + FuncLoadError := not assigned(BN_BLINDING_invert); + if FuncLoadError then + begin + {$if not defined(BN_BLINDING_invert_allownil)} + BN_BLINDING_invert := @ERR_BN_BLINDING_invert; + {$ifend} + {$if declared(BN_BLINDING_invert_introduced)} + if LibVersion < BN_BLINDING_invert_introduced then + begin + {$if declared(FC_BN_BLINDING_invert)} + BN_BLINDING_invert := @FC_BN_BLINDING_invert; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_BLINDING_invert_removed)} + if BN_BLINDING_invert_removed <= LibVersion then + begin + {$if declared(_BN_BLINDING_invert)} + BN_BLINDING_invert := @_BN_BLINDING_invert; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_BLINDING_invert_allownil)} + if FuncLoadError then + AFailed.Add('BN_BLINDING_invert'); + {$ifend} + end; + + + BN_BLINDING_convert_ex := LoadLibFunction(ADllHandle, BN_BLINDING_convert_ex_procname); + FuncLoadError := not assigned(BN_BLINDING_convert_ex); + if FuncLoadError then + begin + {$if not defined(BN_BLINDING_convert_ex_allownil)} + BN_BLINDING_convert_ex := @ERR_BN_BLINDING_convert_ex; + {$ifend} + {$if declared(BN_BLINDING_convert_ex_introduced)} + if LibVersion < BN_BLINDING_convert_ex_introduced then + begin + {$if declared(FC_BN_BLINDING_convert_ex)} + BN_BLINDING_convert_ex := @FC_BN_BLINDING_convert_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_BLINDING_convert_ex_removed)} + if BN_BLINDING_convert_ex_removed <= LibVersion then + begin + {$if declared(_BN_BLINDING_convert_ex)} + BN_BLINDING_convert_ex := @_BN_BLINDING_convert_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_BLINDING_convert_ex_allownil)} + if FuncLoadError then + AFailed.Add('BN_BLINDING_convert_ex'); + {$ifend} + end; + + + BN_BLINDING_invert_ex := LoadLibFunction(ADllHandle, BN_BLINDING_invert_ex_procname); + FuncLoadError := not assigned(BN_BLINDING_invert_ex); + if FuncLoadError then + begin + {$if not defined(BN_BLINDING_invert_ex_allownil)} + BN_BLINDING_invert_ex := @ERR_BN_BLINDING_invert_ex; + {$ifend} + {$if declared(BN_BLINDING_invert_ex_introduced)} + if LibVersion < BN_BLINDING_invert_ex_introduced then + begin + {$if declared(FC_BN_BLINDING_invert_ex)} + BN_BLINDING_invert_ex := @FC_BN_BLINDING_invert_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_BLINDING_invert_ex_removed)} + if BN_BLINDING_invert_ex_removed <= LibVersion then + begin + {$if declared(_BN_BLINDING_invert_ex)} + BN_BLINDING_invert_ex := @_BN_BLINDING_invert_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_BLINDING_invert_ex_allownil)} + if FuncLoadError then + AFailed.Add('BN_BLINDING_invert_ex'); + {$ifend} + end; + + + BN_BLINDING_is_current_thread := LoadLibFunction(ADllHandle, BN_BLINDING_is_current_thread_procname); + FuncLoadError := not assigned(BN_BLINDING_is_current_thread); + if FuncLoadError then + begin + {$if not defined(BN_BLINDING_is_current_thread_allownil)} + BN_BLINDING_is_current_thread := @ERR_BN_BLINDING_is_current_thread; + {$ifend} + {$if declared(BN_BLINDING_is_current_thread_introduced)} + if LibVersion < BN_BLINDING_is_current_thread_introduced then + begin + {$if declared(FC_BN_BLINDING_is_current_thread)} + BN_BLINDING_is_current_thread := @FC_BN_BLINDING_is_current_thread; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_BLINDING_is_current_thread_removed)} + if BN_BLINDING_is_current_thread_removed <= LibVersion then + begin + {$if declared(_BN_BLINDING_is_current_thread)} + BN_BLINDING_is_current_thread := @_BN_BLINDING_is_current_thread; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_BLINDING_is_current_thread_allownil)} + if FuncLoadError then + AFailed.Add('BN_BLINDING_is_current_thread'); + {$ifend} + end; + + + BN_BLINDING_set_current_thread := LoadLibFunction(ADllHandle, BN_BLINDING_set_current_thread_procname); + FuncLoadError := not assigned(BN_BLINDING_set_current_thread); + if FuncLoadError then + begin + {$if not defined(BN_BLINDING_set_current_thread_allownil)} + BN_BLINDING_set_current_thread := @ERR_BN_BLINDING_set_current_thread; + {$ifend} + {$if declared(BN_BLINDING_set_current_thread_introduced)} + if LibVersion < BN_BLINDING_set_current_thread_introduced then + begin + {$if declared(FC_BN_BLINDING_set_current_thread)} + BN_BLINDING_set_current_thread := @FC_BN_BLINDING_set_current_thread; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_BLINDING_set_current_thread_removed)} + if BN_BLINDING_set_current_thread_removed <= LibVersion then + begin + {$if declared(_BN_BLINDING_set_current_thread)} + BN_BLINDING_set_current_thread := @_BN_BLINDING_set_current_thread; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_BLINDING_set_current_thread_allownil)} + if FuncLoadError then + AFailed.Add('BN_BLINDING_set_current_thread'); + {$ifend} + end; + + + BN_BLINDING_lock := LoadLibFunction(ADllHandle, BN_BLINDING_lock_procname); + FuncLoadError := not assigned(BN_BLINDING_lock); + if FuncLoadError then + begin + {$if not defined(BN_BLINDING_lock_allownil)} + BN_BLINDING_lock := @ERR_BN_BLINDING_lock; + {$ifend} + {$if declared(BN_BLINDING_lock_introduced)} + if LibVersion < BN_BLINDING_lock_introduced then + begin + {$if declared(FC_BN_BLINDING_lock)} + BN_BLINDING_lock := @FC_BN_BLINDING_lock; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_BLINDING_lock_removed)} + if BN_BLINDING_lock_removed <= LibVersion then + begin + {$if declared(_BN_BLINDING_lock)} + BN_BLINDING_lock := @_BN_BLINDING_lock; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_BLINDING_lock_allownil)} + if FuncLoadError then + AFailed.Add('BN_BLINDING_lock'); + {$ifend} + end; + + + BN_BLINDING_unlock := LoadLibFunction(ADllHandle, BN_BLINDING_unlock_procname); + FuncLoadError := not assigned(BN_BLINDING_unlock); + if FuncLoadError then + begin + {$if not defined(BN_BLINDING_unlock_allownil)} + BN_BLINDING_unlock := @ERR_BN_BLINDING_unlock; + {$ifend} + {$if declared(BN_BLINDING_unlock_introduced)} + if LibVersion < BN_BLINDING_unlock_introduced then + begin + {$if declared(FC_BN_BLINDING_unlock)} + BN_BLINDING_unlock := @FC_BN_BLINDING_unlock; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_BLINDING_unlock_removed)} + if BN_BLINDING_unlock_removed <= LibVersion then + begin + {$if declared(_BN_BLINDING_unlock)} + BN_BLINDING_unlock := @_BN_BLINDING_unlock; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_BLINDING_unlock_allownil)} + if FuncLoadError then + AFailed.Add('BN_BLINDING_unlock'); + {$ifend} + end; + + + BN_BLINDING_get_flags := LoadLibFunction(ADllHandle, BN_BLINDING_get_flags_procname); + FuncLoadError := not assigned(BN_BLINDING_get_flags); + if FuncLoadError then + begin + {$if not defined(BN_BLINDING_get_flags_allownil)} + BN_BLINDING_get_flags := @ERR_BN_BLINDING_get_flags; + {$ifend} + {$if declared(BN_BLINDING_get_flags_introduced)} + if LibVersion < BN_BLINDING_get_flags_introduced then + begin + {$if declared(FC_BN_BLINDING_get_flags)} + BN_BLINDING_get_flags := @FC_BN_BLINDING_get_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_BLINDING_get_flags_removed)} + if BN_BLINDING_get_flags_removed <= LibVersion then + begin + {$if declared(_BN_BLINDING_get_flags)} + BN_BLINDING_get_flags := @_BN_BLINDING_get_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_BLINDING_get_flags_allownil)} + if FuncLoadError then + AFailed.Add('BN_BLINDING_get_flags'); + {$ifend} + end; + + + BN_BLINDING_set_flags := LoadLibFunction(ADllHandle, BN_BLINDING_set_flags_procname); + FuncLoadError := not assigned(BN_BLINDING_set_flags); + if FuncLoadError then + begin + {$if not defined(BN_BLINDING_set_flags_allownil)} + BN_BLINDING_set_flags := @ERR_BN_BLINDING_set_flags; + {$ifend} + {$if declared(BN_BLINDING_set_flags_introduced)} + if LibVersion < BN_BLINDING_set_flags_introduced then + begin + {$if declared(FC_BN_BLINDING_set_flags)} + BN_BLINDING_set_flags := @FC_BN_BLINDING_set_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_BLINDING_set_flags_removed)} + if BN_BLINDING_set_flags_removed <= LibVersion then + begin + {$if declared(_BN_BLINDING_set_flags)} + BN_BLINDING_set_flags := @_BN_BLINDING_set_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_BLINDING_set_flags_allownil)} + if FuncLoadError then + AFailed.Add('BN_BLINDING_set_flags'); + {$ifend} + end; + + + BN_RECP_CTX_free := LoadLibFunction(ADllHandle, BN_RECP_CTX_free_procname); + FuncLoadError := not assigned(BN_RECP_CTX_free); + if FuncLoadError then + begin + {$if not defined(BN_RECP_CTX_free_allownil)} + BN_RECP_CTX_free := @ERR_BN_RECP_CTX_free; + {$ifend} + {$if declared(BN_RECP_CTX_free_introduced)} + if LibVersion < BN_RECP_CTX_free_introduced then + begin + {$if declared(FC_BN_RECP_CTX_free)} + BN_RECP_CTX_free := @FC_BN_RECP_CTX_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_RECP_CTX_free_removed)} + if BN_RECP_CTX_free_removed <= LibVersion then + begin + {$if declared(_BN_RECP_CTX_free)} + BN_RECP_CTX_free := @_BN_RECP_CTX_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_RECP_CTX_free_allownil)} + if FuncLoadError then + AFailed.Add('BN_RECP_CTX_free'); + {$ifend} + end; + + + BN_RECP_CTX_set := LoadLibFunction(ADllHandle, BN_RECP_CTX_set_procname); + FuncLoadError := not assigned(BN_RECP_CTX_set); + if FuncLoadError then + begin + {$if not defined(BN_RECP_CTX_set_allownil)} + BN_RECP_CTX_set := @ERR_BN_RECP_CTX_set; + {$ifend} + {$if declared(BN_RECP_CTX_set_introduced)} + if LibVersion < BN_RECP_CTX_set_introduced then + begin + {$if declared(FC_BN_RECP_CTX_set)} + BN_RECP_CTX_set := @FC_BN_RECP_CTX_set; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_RECP_CTX_set_removed)} + if BN_RECP_CTX_set_removed <= LibVersion then + begin + {$if declared(_BN_RECP_CTX_set)} + BN_RECP_CTX_set := @_BN_RECP_CTX_set; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_RECP_CTX_set_allownil)} + if FuncLoadError then + AFailed.Add('BN_RECP_CTX_set'); + {$ifend} + end; + + + BN_mod_mul_reciprocal := LoadLibFunction(ADllHandle, BN_mod_mul_reciprocal_procname); + FuncLoadError := not assigned(BN_mod_mul_reciprocal); + if FuncLoadError then + begin + {$if not defined(BN_mod_mul_reciprocal_allownil)} + BN_mod_mul_reciprocal := @ERR_BN_mod_mul_reciprocal; + {$ifend} + {$if declared(BN_mod_mul_reciprocal_introduced)} + if LibVersion < BN_mod_mul_reciprocal_introduced then + begin + {$if declared(FC_BN_mod_mul_reciprocal)} + BN_mod_mul_reciprocal := @FC_BN_mod_mul_reciprocal; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_mod_mul_reciprocal_removed)} + if BN_mod_mul_reciprocal_removed <= LibVersion then + begin + {$if declared(_BN_mod_mul_reciprocal)} + BN_mod_mul_reciprocal := @_BN_mod_mul_reciprocal; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_mod_mul_reciprocal_allownil)} + if FuncLoadError then + AFailed.Add('BN_mod_mul_reciprocal'); + {$ifend} + end; + + + BN_mod_exp_recp := LoadLibFunction(ADllHandle, BN_mod_exp_recp_procname); + FuncLoadError := not assigned(BN_mod_exp_recp); + if FuncLoadError then + begin + {$if not defined(BN_mod_exp_recp_allownil)} + BN_mod_exp_recp := @ERR_BN_mod_exp_recp; + {$ifend} + {$if declared(BN_mod_exp_recp_introduced)} + if LibVersion < BN_mod_exp_recp_introduced then + begin + {$if declared(FC_BN_mod_exp_recp)} + BN_mod_exp_recp := @FC_BN_mod_exp_recp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_mod_exp_recp_removed)} + if BN_mod_exp_recp_removed <= LibVersion then + begin + {$if declared(_BN_mod_exp_recp)} + BN_mod_exp_recp := @_BN_mod_exp_recp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_mod_exp_recp_allownil)} + if FuncLoadError then + AFailed.Add('BN_mod_exp_recp'); + {$ifend} + end; + + + BN_div_recp := LoadLibFunction(ADllHandle, BN_div_recp_procname); + FuncLoadError := not assigned(BN_div_recp); + if FuncLoadError then + begin + {$if not defined(BN_div_recp_allownil)} + BN_div_recp := @ERR_BN_div_recp; + {$ifend} + {$if declared(BN_div_recp_introduced)} + if LibVersion < BN_div_recp_introduced then + begin + {$if declared(FC_BN_div_recp)} + BN_div_recp := @FC_BN_div_recp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_div_recp_removed)} + if BN_div_recp_removed <= LibVersion then + begin + {$if declared(_BN_div_recp)} + BN_div_recp := @_BN_div_recp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_div_recp_allownil)} + if FuncLoadError then + AFailed.Add('BN_div_recp'); + {$ifend} + end; + + + BN_GF2m_add := LoadLibFunction(ADllHandle, BN_GF2m_add_procname); + FuncLoadError := not assigned(BN_GF2m_add); + if FuncLoadError then + begin + {$if not defined(BN_GF2m_add_allownil)} + BN_GF2m_add := @ERR_BN_GF2m_add; + {$ifend} + {$if declared(BN_GF2m_add_introduced)} + if LibVersion < BN_GF2m_add_introduced then + begin + {$if declared(FC_BN_GF2m_add)} + BN_GF2m_add := @FC_BN_GF2m_add; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_GF2m_add_removed)} + if BN_GF2m_add_removed <= LibVersion then + begin + {$if declared(_BN_GF2m_add)} + BN_GF2m_add := @_BN_GF2m_add; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_GF2m_add_allownil)} + if FuncLoadError then + AFailed.Add('BN_GF2m_add'); + {$ifend} + end; + + + BN_GF2m_mod := LoadLibFunction(ADllHandle, BN_GF2m_mod_procname); + FuncLoadError := not assigned(BN_GF2m_mod); + if FuncLoadError then + begin + {$if not defined(BN_GF2m_mod_allownil)} + BN_GF2m_mod := @ERR_BN_GF2m_mod; + {$ifend} + {$if declared(BN_GF2m_mod_introduced)} + if LibVersion < BN_GF2m_mod_introduced then + begin + {$if declared(FC_BN_GF2m_mod)} + BN_GF2m_mod := @FC_BN_GF2m_mod; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_GF2m_mod_removed)} + if BN_GF2m_mod_removed <= LibVersion then + begin + {$if declared(_BN_GF2m_mod)} + BN_GF2m_mod := @_BN_GF2m_mod; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_GF2m_mod_allownil)} + if FuncLoadError then + AFailed.Add('BN_GF2m_mod'); + {$ifend} + end; + + + BN_GF2m_mod_mul := LoadLibFunction(ADllHandle, BN_GF2m_mod_mul_procname); + FuncLoadError := not assigned(BN_GF2m_mod_mul); + if FuncLoadError then + begin + {$if not defined(BN_GF2m_mod_mul_allownil)} + BN_GF2m_mod_mul := @ERR_BN_GF2m_mod_mul; + {$ifend} + {$if declared(BN_GF2m_mod_mul_introduced)} + if LibVersion < BN_GF2m_mod_mul_introduced then + begin + {$if declared(FC_BN_GF2m_mod_mul)} + BN_GF2m_mod_mul := @FC_BN_GF2m_mod_mul; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_GF2m_mod_mul_removed)} + if BN_GF2m_mod_mul_removed <= LibVersion then + begin + {$if declared(_BN_GF2m_mod_mul)} + BN_GF2m_mod_mul := @_BN_GF2m_mod_mul; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_GF2m_mod_mul_allownil)} + if FuncLoadError then + AFailed.Add('BN_GF2m_mod_mul'); + {$ifend} + end; + + + BN_GF2m_mod_sqr := LoadLibFunction(ADllHandle, BN_GF2m_mod_sqr_procname); + FuncLoadError := not assigned(BN_GF2m_mod_sqr); + if FuncLoadError then + begin + {$if not defined(BN_GF2m_mod_sqr_allownil)} + BN_GF2m_mod_sqr := @ERR_BN_GF2m_mod_sqr; + {$ifend} + {$if declared(BN_GF2m_mod_sqr_introduced)} + if LibVersion < BN_GF2m_mod_sqr_introduced then + begin + {$if declared(FC_BN_GF2m_mod_sqr)} + BN_GF2m_mod_sqr := @FC_BN_GF2m_mod_sqr; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_GF2m_mod_sqr_removed)} + if BN_GF2m_mod_sqr_removed <= LibVersion then + begin + {$if declared(_BN_GF2m_mod_sqr)} + BN_GF2m_mod_sqr := @_BN_GF2m_mod_sqr; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_GF2m_mod_sqr_allownil)} + if FuncLoadError then + AFailed.Add('BN_GF2m_mod_sqr'); + {$ifend} + end; + + + BN_GF2m_mod_inv := LoadLibFunction(ADllHandle, BN_GF2m_mod_inv_procname); + FuncLoadError := not assigned(BN_GF2m_mod_inv); + if FuncLoadError then + begin + {$if not defined(BN_GF2m_mod_inv_allownil)} + BN_GF2m_mod_inv := @ERR_BN_GF2m_mod_inv; + {$ifend} + {$if declared(BN_GF2m_mod_inv_introduced)} + if LibVersion < BN_GF2m_mod_inv_introduced then + begin + {$if declared(FC_BN_GF2m_mod_inv)} + BN_GF2m_mod_inv := @FC_BN_GF2m_mod_inv; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_GF2m_mod_inv_removed)} + if BN_GF2m_mod_inv_removed <= LibVersion then + begin + {$if declared(_BN_GF2m_mod_inv)} + BN_GF2m_mod_inv := @_BN_GF2m_mod_inv; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_GF2m_mod_inv_allownil)} + if FuncLoadError then + AFailed.Add('BN_GF2m_mod_inv'); + {$ifend} + end; + + + BN_GF2m_mod_div := LoadLibFunction(ADllHandle, BN_GF2m_mod_div_procname); + FuncLoadError := not assigned(BN_GF2m_mod_div); + if FuncLoadError then + begin + {$if not defined(BN_GF2m_mod_div_allownil)} + BN_GF2m_mod_div := @ERR_BN_GF2m_mod_div; + {$ifend} + {$if declared(BN_GF2m_mod_div_introduced)} + if LibVersion < BN_GF2m_mod_div_introduced then + begin + {$if declared(FC_BN_GF2m_mod_div)} + BN_GF2m_mod_div := @FC_BN_GF2m_mod_div; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_GF2m_mod_div_removed)} + if BN_GF2m_mod_div_removed <= LibVersion then + begin + {$if declared(_BN_GF2m_mod_div)} + BN_GF2m_mod_div := @_BN_GF2m_mod_div; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_GF2m_mod_div_allownil)} + if FuncLoadError then + AFailed.Add('BN_GF2m_mod_div'); + {$ifend} + end; + + + BN_GF2m_mod_exp := LoadLibFunction(ADllHandle, BN_GF2m_mod_exp_procname); + FuncLoadError := not assigned(BN_GF2m_mod_exp); + if FuncLoadError then + begin + {$if not defined(BN_GF2m_mod_exp_allownil)} + BN_GF2m_mod_exp := @ERR_BN_GF2m_mod_exp; + {$ifend} + {$if declared(BN_GF2m_mod_exp_introduced)} + if LibVersion < BN_GF2m_mod_exp_introduced then + begin + {$if declared(FC_BN_GF2m_mod_exp)} + BN_GF2m_mod_exp := @FC_BN_GF2m_mod_exp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_GF2m_mod_exp_removed)} + if BN_GF2m_mod_exp_removed <= LibVersion then + begin + {$if declared(_BN_GF2m_mod_exp)} + BN_GF2m_mod_exp := @_BN_GF2m_mod_exp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_GF2m_mod_exp_allownil)} + if FuncLoadError then + AFailed.Add('BN_GF2m_mod_exp'); + {$ifend} + end; + + + BN_GF2m_mod_sqrt := LoadLibFunction(ADllHandle, BN_GF2m_mod_sqrt_procname); + FuncLoadError := not assigned(BN_GF2m_mod_sqrt); + if FuncLoadError then + begin + {$if not defined(BN_GF2m_mod_sqrt_allownil)} + BN_GF2m_mod_sqrt := @ERR_BN_GF2m_mod_sqrt; + {$ifend} + {$if declared(BN_GF2m_mod_sqrt_introduced)} + if LibVersion < BN_GF2m_mod_sqrt_introduced then + begin + {$if declared(FC_BN_GF2m_mod_sqrt)} + BN_GF2m_mod_sqrt := @FC_BN_GF2m_mod_sqrt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_GF2m_mod_sqrt_removed)} + if BN_GF2m_mod_sqrt_removed <= LibVersion then + begin + {$if declared(_BN_GF2m_mod_sqrt)} + BN_GF2m_mod_sqrt := @_BN_GF2m_mod_sqrt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_GF2m_mod_sqrt_allownil)} + if FuncLoadError then + AFailed.Add('BN_GF2m_mod_sqrt'); + {$ifend} + end; + + + BN_GF2m_mod_solve_quad := LoadLibFunction(ADllHandle, BN_GF2m_mod_solve_quad_procname); + FuncLoadError := not assigned(BN_GF2m_mod_solve_quad); + if FuncLoadError then + begin + {$if not defined(BN_GF2m_mod_solve_quad_allownil)} + BN_GF2m_mod_solve_quad := @ERR_BN_GF2m_mod_solve_quad; + {$ifend} + {$if declared(BN_GF2m_mod_solve_quad_introduced)} + if LibVersion < BN_GF2m_mod_solve_quad_introduced then + begin + {$if declared(FC_BN_GF2m_mod_solve_quad)} + BN_GF2m_mod_solve_quad := @FC_BN_GF2m_mod_solve_quad; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_GF2m_mod_solve_quad_removed)} + if BN_GF2m_mod_solve_quad_removed <= LibVersion then + begin + {$if declared(_BN_GF2m_mod_solve_quad)} + BN_GF2m_mod_solve_quad := @_BN_GF2m_mod_solve_quad; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_GF2m_mod_solve_quad_allownil)} + if FuncLoadError then + AFailed.Add('BN_GF2m_mod_solve_quad'); + {$ifend} + end; + + + BN_nist_mod_192 := LoadLibFunction(ADllHandle, BN_nist_mod_192_procname); + FuncLoadError := not assigned(BN_nist_mod_192); + if FuncLoadError then + begin + {$if not defined(BN_nist_mod_192_allownil)} + BN_nist_mod_192 := @ERR_BN_nist_mod_192; + {$ifend} + {$if declared(BN_nist_mod_192_introduced)} + if LibVersion < BN_nist_mod_192_introduced then + begin + {$if declared(FC_BN_nist_mod_192)} + BN_nist_mod_192 := @FC_BN_nist_mod_192; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_nist_mod_192_removed)} + if BN_nist_mod_192_removed <= LibVersion then + begin + {$if declared(_BN_nist_mod_192)} + BN_nist_mod_192 := @_BN_nist_mod_192; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_nist_mod_192_allownil)} + if FuncLoadError then + AFailed.Add('BN_nist_mod_192'); + {$ifend} + end; + + + BN_nist_mod_224 := LoadLibFunction(ADllHandle, BN_nist_mod_224_procname); + FuncLoadError := not assigned(BN_nist_mod_224); + if FuncLoadError then + begin + {$if not defined(BN_nist_mod_224_allownil)} + BN_nist_mod_224 := @ERR_BN_nist_mod_224; + {$ifend} + {$if declared(BN_nist_mod_224_introduced)} + if LibVersion < BN_nist_mod_224_introduced then + begin + {$if declared(FC_BN_nist_mod_224)} + BN_nist_mod_224 := @FC_BN_nist_mod_224; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_nist_mod_224_removed)} + if BN_nist_mod_224_removed <= LibVersion then + begin + {$if declared(_BN_nist_mod_224)} + BN_nist_mod_224 := @_BN_nist_mod_224; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_nist_mod_224_allownil)} + if FuncLoadError then + AFailed.Add('BN_nist_mod_224'); + {$ifend} + end; + + + BN_nist_mod_256 := LoadLibFunction(ADllHandle, BN_nist_mod_256_procname); + FuncLoadError := not assigned(BN_nist_mod_256); + if FuncLoadError then + begin + {$if not defined(BN_nist_mod_256_allownil)} + BN_nist_mod_256 := @ERR_BN_nist_mod_256; + {$ifend} + {$if declared(BN_nist_mod_256_introduced)} + if LibVersion < BN_nist_mod_256_introduced then + begin + {$if declared(FC_BN_nist_mod_256)} + BN_nist_mod_256 := @FC_BN_nist_mod_256; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_nist_mod_256_removed)} + if BN_nist_mod_256_removed <= LibVersion then + begin + {$if declared(_BN_nist_mod_256)} + BN_nist_mod_256 := @_BN_nist_mod_256; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_nist_mod_256_allownil)} + if FuncLoadError then + AFailed.Add('BN_nist_mod_256'); + {$ifend} + end; + + + BN_nist_mod_384 := LoadLibFunction(ADllHandle, BN_nist_mod_384_procname); + FuncLoadError := not assigned(BN_nist_mod_384); + if FuncLoadError then + begin + {$if not defined(BN_nist_mod_384_allownil)} + BN_nist_mod_384 := @ERR_BN_nist_mod_384; + {$ifend} + {$if declared(BN_nist_mod_384_introduced)} + if LibVersion < BN_nist_mod_384_introduced then + begin + {$if declared(FC_BN_nist_mod_384)} + BN_nist_mod_384 := @FC_BN_nist_mod_384; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_nist_mod_384_removed)} + if BN_nist_mod_384_removed <= LibVersion then + begin + {$if declared(_BN_nist_mod_384)} + BN_nist_mod_384 := @_BN_nist_mod_384; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_nist_mod_384_allownil)} + if FuncLoadError then + AFailed.Add('BN_nist_mod_384'); + {$ifend} + end; + + + BN_nist_mod_521 := LoadLibFunction(ADllHandle, BN_nist_mod_521_procname); + FuncLoadError := not assigned(BN_nist_mod_521); + if FuncLoadError then + begin + {$if not defined(BN_nist_mod_521_allownil)} + BN_nist_mod_521 := @ERR_BN_nist_mod_521; + {$ifend} + {$if declared(BN_nist_mod_521_introduced)} + if LibVersion < BN_nist_mod_521_introduced then + begin + {$if declared(FC_BN_nist_mod_521)} + BN_nist_mod_521 := @FC_BN_nist_mod_521; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_nist_mod_521_removed)} + if BN_nist_mod_521_removed <= LibVersion then + begin + {$if declared(_BN_nist_mod_521)} + BN_nist_mod_521 := @_BN_nist_mod_521; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_nist_mod_521_allownil)} + if FuncLoadError then + AFailed.Add('BN_nist_mod_521'); + {$ifend} + end; + + + BN_get0_nist_prime_192 := LoadLibFunction(ADllHandle, BN_get0_nist_prime_192_procname); + FuncLoadError := not assigned(BN_get0_nist_prime_192); + if FuncLoadError then + begin + {$if not defined(BN_get0_nist_prime_192_allownil)} + BN_get0_nist_prime_192 := @ERR_BN_get0_nist_prime_192; + {$ifend} + {$if declared(BN_get0_nist_prime_192_introduced)} + if LibVersion < BN_get0_nist_prime_192_introduced then + begin + {$if declared(FC_BN_get0_nist_prime_192)} + BN_get0_nist_prime_192 := @FC_BN_get0_nist_prime_192; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_get0_nist_prime_192_removed)} + if BN_get0_nist_prime_192_removed <= LibVersion then + begin + {$if declared(_BN_get0_nist_prime_192)} + BN_get0_nist_prime_192 := @_BN_get0_nist_prime_192; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_get0_nist_prime_192_allownil)} + if FuncLoadError then + AFailed.Add('BN_get0_nist_prime_192'); + {$ifend} + end; + + + BN_get0_nist_prime_224 := LoadLibFunction(ADllHandle, BN_get0_nist_prime_224_procname); + FuncLoadError := not assigned(BN_get0_nist_prime_224); + if FuncLoadError then + begin + {$if not defined(BN_get0_nist_prime_224_allownil)} + BN_get0_nist_prime_224 := @ERR_BN_get0_nist_prime_224; + {$ifend} + {$if declared(BN_get0_nist_prime_224_introduced)} + if LibVersion < BN_get0_nist_prime_224_introduced then + begin + {$if declared(FC_BN_get0_nist_prime_224)} + BN_get0_nist_prime_224 := @FC_BN_get0_nist_prime_224; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_get0_nist_prime_224_removed)} + if BN_get0_nist_prime_224_removed <= LibVersion then + begin + {$if declared(_BN_get0_nist_prime_224)} + BN_get0_nist_prime_224 := @_BN_get0_nist_prime_224; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_get0_nist_prime_224_allownil)} + if FuncLoadError then + AFailed.Add('BN_get0_nist_prime_224'); + {$ifend} + end; + + + BN_get0_nist_prime_256 := LoadLibFunction(ADllHandle, BN_get0_nist_prime_256_procname); + FuncLoadError := not assigned(BN_get0_nist_prime_256); + if FuncLoadError then + begin + {$if not defined(BN_get0_nist_prime_256_allownil)} + BN_get0_nist_prime_256 := @ERR_BN_get0_nist_prime_256; + {$ifend} + {$if declared(BN_get0_nist_prime_256_introduced)} + if LibVersion < BN_get0_nist_prime_256_introduced then + begin + {$if declared(FC_BN_get0_nist_prime_256)} + BN_get0_nist_prime_256 := @FC_BN_get0_nist_prime_256; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_get0_nist_prime_256_removed)} + if BN_get0_nist_prime_256_removed <= LibVersion then + begin + {$if declared(_BN_get0_nist_prime_256)} + BN_get0_nist_prime_256 := @_BN_get0_nist_prime_256; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_get0_nist_prime_256_allownil)} + if FuncLoadError then + AFailed.Add('BN_get0_nist_prime_256'); + {$ifend} + end; + + + BN_get0_nist_prime_384 := LoadLibFunction(ADllHandle, BN_get0_nist_prime_384_procname); + FuncLoadError := not assigned(BN_get0_nist_prime_384); + if FuncLoadError then + begin + {$if not defined(BN_get0_nist_prime_384_allownil)} + BN_get0_nist_prime_384 := @ERR_BN_get0_nist_prime_384; + {$ifend} + {$if declared(BN_get0_nist_prime_384_introduced)} + if LibVersion < BN_get0_nist_prime_384_introduced then + begin + {$if declared(FC_BN_get0_nist_prime_384)} + BN_get0_nist_prime_384 := @FC_BN_get0_nist_prime_384; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_get0_nist_prime_384_removed)} + if BN_get0_nist_prime_384_removed <= LibVersion then + begin + {$if declared(_BN_get0_nist_prime_384)} + BN_get0_nist_prime_384 := @_BN_get0_nist_prime_384; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_get0_nist_prime_384_allownil)} + if FuncLoadError then + AFailed.Add('BN_get0_nist_prime_384'); + {$ifend} + end; + + + BN_get0_nist_prime_521 := LoadLibFunction(ADllHandle, BN_get0_nist_prime_521_procname); + FuncLoadError := not assigned(BN_get0_nist_prime_521); + if FuncLoadError then + begin + {$if not defined(BN_get0_nist_prime_521_allownil)} + BN_get0_nist_prime_521 := @ERR_BN_get0_nist_prime_521; + {$ifend} + {$if declared(BN_get0_nist_prime_521_introduced)} + if LibVersion < BN_get0_nist_prime_521_introduced then + begin + {$if declared(FC_BN_get0_nist_prime_521)} + BN_get0_nist_prime_521 := @FC_BN_get0_nist_prime_521; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_get0_nist_prime_521_removed)} + if BN_get0_nist_prime_521_removed <= LibVersion then + begin + {$if declared(_BN_get0_nist_prime_521)} + BN_get0_nist_prime_521 := @_BN_get0_nist_prime_521; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_get0_nist_prime_521_allownil)} + if FuncLoadError then + AFailed.Add('BN_get0_nist_prime_521'); + {$ifend} + end; + + + BN_generate_dsa_nonce := LoadLibFunction(ADllHandle, BN_generate_dsa_nonce_procname); + FuncLoadError := not assigned(BN_generate_dsa_nonce); + if FuncLoadError then + begin + {$if not defined(BN_generate_dsa_nonce_allownil)} + BN_generate_dsa_nonce := @ERR_BN_generate_dsa_nonce; + {$ifend} + {$if declared(BN_generate_dsa_nonce_introduced)} + if LibVersion < BN_generate_dsa_nonce_introduced then + begin + {$if declared(FC_BN_generate_dsa_nonce)} + BN_generate_dsa_nonce := @FC_BN_generate_dsa_nonce; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_generate_dsa_nonce_removed)} + if BN_generate_dsa_nonce_removed <= LibVersion then + begin + {$if declared(_BN_generate_dsa_nonce)} + BN_generate_dsa_nonce := @_BN_generate_dsa_nonce; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_generate_dsa_nonce_allownil)} + if FuncLoadError then + AFailed.Add('BN_generate_dsa_nonce'); + {$ifend} + end; + + + BN_get_rfc2409_prime_768 := LoadLibFunction(ADllHandle, BN_get_rfc2409_prime_768_procname); + FuncLoadError := not assigned(BN_get_rfc2409_prime_768); + if FuncLoadError then + begin + {$if not defined(BN_get_rfc2409_prime_768_allownil)} + BN_get_rfc2409_prime_768 := @ERR_BN_get_rfc2409_prime_768; + {$ifend} + {$if declared(BN_get_rfc2409_prime_768_introduced)} + if LibVersion < BN_get_rfc2409_prime_768_introduced then + begin + {$if declared(FC_BN_get_rfc2409_prime_768)} + BN_get_rfc2409_prime_768 := @FC_BN_get_rfc2409_prime_768; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_get_rfc2409_prime_768_removed)} + if BN_get_rfc2409_prime_768_removed <= LibVersion then + begin + {$if declared(_BN_get_rfc2409_prime_768)} + BN_get_rfc2409_prime_768 := @_BN_get_rfc2409_prime_768; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_get_rfc2409_prime_768_allownil)} + if FuncLoadError then + AFailed.Add('BN_get_rfc2409_prime_768'); + {$ifend} + end; + + + BN_get_rfc2409_prime_1024 := LoadLibFunction(ADllHandle, BN_get_rfc2409_prime_1024_procname); + FuncLoadError := not assigned(BN_get_rfc2409_prime_1024); + if FuncLoadError then + begin + {$if not defined(BN_get_rfc2409_prime_1024_allownil)} + BN_get_rfc2409_prime_1024 := @ERR_BN_get_rfc2409_prime_1024; + {$ifend} + {$if declared(BN_get_rfc2409_prime_1024_introduced)} + if LibVersion < BN_get_rfc2409_prime_1024_introduced then + begin + {$if declared(FC_BN_get_rfc2409_prime_1024)} + BN_get_rfc2409_prime_1024 := @FC_BN_get_rfc2409_prime_1024; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_get_rfc2409_prime_1024_removed)} + if BN_get_rfc2409_prime_1024_removed <= LibVersion then + begin + {$if declared(_BN_get_rfc2409_prime_1024)} + BN_get_rfc2409_prime_1024 := @_BN_get_rfc2409_prime_1024; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_get_rfc2409_prime_1024_allownil)} + if FuncLoadError then + AFailed.Add('BN_get_rfc2409_prime_1024'); + {$ifend} + end; + + + BN_get_rfc3526_prime_1536 := LoadLibFunction(ADllHandle, BN_get_rfc3526_prime_1536_procname); + FuncLoadError := not assigned(BN_get_rfc3526_prime_1536); + if FuncLoadError then + begin + {$if not defined(BN_get_rfc3526_prime_1536_allownil)} + BN_get_rfc3526_prime_1536 := @ERR_BN_get_rfc3526_prime_1536; + {$ifend} + {$if declared(BN_get_rfc3526_prime_1536_introduced)} + if LibVersion < BN_get_rfc3526_prime_1536_introduced then + begin + {$if declared(FC_BN_get_rfc3526_prime_1536)} + BN_get_rfc3526_prime_1536 := @FC_BN_get_rfc3526_prime_1536; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_get_rfc3526_prime_1536_removed)} + if BN_get_rfc3526_prime_1536_removed <= LibVersion then + begin + {$if declared(_BN_get_rfc3526_prime_1536)} + BN_get_rfc3526_prime_1536 := @_BN_get_rfc3526_prime_1536; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_get_rfc3526_prime_1536_allownil)} + if FuncLoadError then + AFailed.Add('BN_get_rfc3526_prime_1536'); + {$ifend} + end; + + + BN_get_rfc3526_prime_2048 := LoadLibFunction(ADllHandle, BN_get_rfc3526_prime_2048_procname); + FuncLoadError := not assigned(BN_get_rfc3526_prime_2048); + if FuncLoadError then + begin + {$if not defined(BN_get_rfc3526_prime_2048_allownil)} + BN_get_rfc3526_prime_2048 := @ERR_BN_get_rfc3526_prime_2048; + {$ifend} + {$if declared(BN_get_rfc3526_prime_2048_introduced)} + if LibVersion < BN_get_rfc3526_prime_2048_introduced then + begin + {$if declared(FC_BN_get_rfc3526_prime_2048)} + BN_get_rfc3526_prime_2048 := @FC_BN_get_rfc3526_prime_2048; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_get_rfc3526_prime_2048_removed)} + if BN_get_rfc3526_prime_2048_removed <= LibVersion then + begin + {$if declared(_BN_get_rfc3526_prime_2048)} + BN_get_rfc3526_prime_2048 := @_BN_get_rfc3526_prime_2048; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_get_rfc3526_prime_2048_allownil)} + if FuncLoadError then + AFailed.Add('BN_get_rfc3526_prime_2048'); + {$ifend} + end; + + + BN_get_rfc3526_prime_3072 := LoadLibFunction(ADllHandle, BN_get_rfc3526_prime_3072_procname); + FuncLoadError := not assigned(BN_get_rfc3526_prime_3072); + if FuncLoadError then + begin + {$if not defined(BN_get_rfc3526_prime_3072_allownil)} + BN_get_rfc3526_prime_3072 := @ERR_BN_get_rfc3526_prime_3072; + {$ifend} + {$if declared(BN_get_rfc3526_prime_3072_introduced)} + if LibVersion < BN_get_rfc3526_prime_3072_introduced then + begin + {$if declared(FC_BN_get_rfc3526_prime_3072)} + BN_get_rfc3526_prime_3072 := @FC_BN_get_rfc3526_prime_3072; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_get_rfc3526_prime_3072_removed)} + if BN_get_rfc3526_prime_3072_removed <= LibVersion then + begin + {$if declared(_BN_get_rfc3526_prime_3072)} + BN_get_rfc3526_prime_3072 := @_BN_get_rfc3526_prime_3072; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_get_rfc3526_prime_3072_allownil)} + if FuncLoadError then + AFailed.Add('BN_get_rfc3526_prime_3072'); + {$ifend} + end; + + + BN_get_rfc3526_prime_4096 := LoadLibFunction(ADllHandle, BN_get_rfc3526_prime_4096_procname); + FuncLoadError := not assigned(BN_get_rfc3526_prime_4096); + if FuncLoadError then + begin + {$if not defined(BN_get_rfc3526_prime_4096_allownil)} + BN_get_rfc3526_prime_4096 := @ERR_BN_get_rfc3526_prime_4096; + {$ifend} + {$if declared(BN_get_rfc3526_prime_4096_introduced)} + if LibVersion < BN_get_rfc3526_prime_4096_introduced then + begin + {$if declared(FC_BN_get_rfc3526_prime_4096)} + BN_get_rfc3526_prime_4096 := @FC_BN_get_rfc3526_prime_4096; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_get_rfc3526_prime_4096_removed)} + if BN_get_rfc3526_prime_4096_removed <= LibVersion then + begin + {$if declared(_BN_get_rfc3526_prime_4096)} + BN_get_rfc3526_prime_4096 := @_BN_get_rfc3526_prime_4096; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_get_rfc3526_prime_4096_allownil)} + if FuncLoadError then + AFailed.Add('BN_get_rfc3526_prime_4096'); + {$ifend} + end; + + + BN_get_rfc3526_prime_6144 := LoadLibFunction(ADllHandle, BN_get_rfc3526_prime_6144_procname); + FuncLoadError := not assigned(BN_get_rfc3526_prime_6144); + if FuncLoadError then + begin + {$if not defined(BN_get_rfc3526_prime_6144_allownil)} + BN_get_rfc3526_prime_6144 := @ERR_BN_get_rfc3526_prime_6144; + {$ifend} + {$if declared(BN_get_rfc3526_prime_6144_introduced)} + if LibVersion < BN_get_rfc3526_prime_6144_introduced then + begin + {$if declared(FC_BN_get_rfc3526_prime_6144)} + BN_get_rfc3526_prime_6144 := @FC_BN_get_rfc3526_prime_6144; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_get_rfc3526_prime_6144_removed)} + if BN_get_rfc3526_prime_6144_removed <= LibVersion then + begin + {$if declared(_BN_get_rfc3526_prime_6144)} + BN_get_rfc3526_prime_6144 := @_BN_get_rfc3526_prime_6144; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_get_rfc3526_prime_6144_allownil)} + if FuncLoadError then + AFailed.Add('BN_get_rfc3526_prime_6144'); + {$ifend} + end; + + + BN_get_rfc3526_prime_8192 := LoadLibFunction(ADllHandle, BN_get_rfc3526_prime_8192_procname); + FuncLoadError := not assigned(BN_get_rfc3526_prime_8192); + if FuncLoadError then + begin + {$if not defined(BN_get_rfc3526_prime_8192_allownil)} + BN_get_rfc3526_prime_8192 := @ERR_BN_get_rfc3526_prime_8192; + {$ifend} + {$if declared(BN_get_rfc3526_prime_8192_introduced)} + if LibVersion < BN_get_rfc3526_prime_8192_introduced then + begin + {$if declared(FC_BN_get_rfc3526_prime_8192)} + BN_get_rfc3526_prime_8192 := @FC_BN_get_rfc3526_prime_8192; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_get_rfc3526_prime_8192_removed)} + if BN_get_rfc3526_prime_8192_removed <= LibVersion then + begin + {$if declared(_BN_get_rfc3526_prime_8192)} + BN_get_rfc3526_prime_8192 := @_BN_get_rfc3526_prime_8192; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_get_rfc3526_prime_8192_allownil)} + if FuncLoadError then + AFailed.Add('BN_get_rfc3526_prime_8192'); + {$ifend} + end; + + + BN_bntest_rand := LoadLibFunction(ADllHandle, BN_bntest_rand_procname); + FuncLoadError := not assigned(BN_bntest_rand); + if FuncLoadError then + begin + {$if not defined(BN_bntest_rand_allownil)} + BN_bntest_rand := @ERR_BN_bntest_rand; + {$ifend} + {$if declared(BN_bntest_rand_introduced)} + if LibVersion < BN_bntest_rand_introduced then + begin + {$if declared(FC_BN_bntest_rand)} + BN_bntest_rand := @FC_BN_bntest_rand; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BN_bntest_rand_removed)} + if BN_bntest_rand_removed <= LibVersion then + begin + {$if declared(_BN_bntest_rand)} + BN_bntest_rand := @_BN_bntest_rand; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BN_bntest_rand_allownil)} + if FuncLoadError then + AFailed.Add('BN_bntest_rand'); + {$ifend} + end; + + +end; + +procedure Unload; +begin + BN_set_flags := nil; + BN_get_flags := nil; + BN_with_flags := nil; + BN_GENCB_call := nil; + BN_GENCB_new := nil; + BN_GENCB_free := nil; + BN_GENCB_set_old := nil; + BN_GENCB_set := nil; + BN_GENCB_get_arg := nil; + BN_abs_is_word := nil; + BN_is_zero := nil; + BN_is_one := nil; + BN_is_word := nil; + BN_is_odd := nil; + BN_zero_ex := nil; + BN_value_one := nil; + BN_options := nil; + BN_CTX_new := nil; + BN_CTX_secure_new := nil; + BN_CTX_free := nil; + BN_CTX_start := nil; + BN_CTX_get := nil; + BN_CTX_end := nil; + BN_rand := nil; + BN_priv_rand := nil; + BN_rand_range := nil; + BN_priv_rand_range := nil; + BN_pseudo_rand := nil; + BN_pseudo_rand_range := nil; + BN_num_bits := nil; + BN_num_bits_word := nil; + BN_security_bits := nil; + BN_new := nil; + BN_secure_new := nil; + BN_clear_free := nil; + BN_copy := nil; + BN_swap := nil; + BN_bin2bn := nil; + BN_bn2bin := nil; + BN_bn2binpad := nil; + BN_lebin2bn := nil; + BN_bn2lebinpad := nil; + BN_mpi2bn := nil; + BN_bn2mpi := nil; + BN_sub := nil; + BN_usub := nil; + BN_uadd := nil; + BN_add := nil; + BN_mul := nil; + BN_sqr := nil; + BN_set_negative := nil; + BN_is_negative := nil; + BN_div := nil; + BN_nnmod := nil; + BN_mod_add := nil; + BN_mod_add_quick := nil; + BN_mod_sub := nil; + BN_mod_sub_quick := nil; + BN_mod_mul := nil; + BN_mod_sqr := nil; + BN_mod_lshift1 := nil; + BN_mod_lshift1_quick := nil; + BN_mod_lshift := nil; + BN_mod_lshift_quick := nil; + BN_mod_word := nil; + BN_div_word := nil; + BN_mul_word := nil; + BN_add_word := nil; + BN_sub_word := nil; + BN_set_word := nil; + BN_get_word := nil; + BN_cmp := nil; + BN_free := nil; + BN_is_bit_set := nil; + BN_lshift := nil; + BN_lshift1 := nil; + BN_exp := nil; + BN_mod_exp := nil; + BN_mod_exp_mont := nil; + BN_mod_exp_mont_consttime := nil; + BN_mod_exp_mont_word := nil; + BN_mod_exp2_mont := nil; + BN_mod_exp_simple := nil; + BN_mask_bits := nil; + BN_print := nil; + BN_reciprocal := nil; + BN_rshift := nil; + BN_rshift1 := nil; + BN_clear := nil; + BN_dup := nil; + BN_ucmp := nil; + BN_set_bit := nil; + BN_clear_bit := nil; + BN_bn2hex := nil; + BN_bn2dec := nil; + BN_hex2bn := nil; + BN_dec2bn := nil; + BN_asc2bn := nil; + BN_gcd := nil; + BN_kronecker := nil; + BN_mod_inverse := nil; + BN_mod_sqrt := nil; + BN_consttime_swap := nil; + BN_generate_prime_ex := nil; + BN_is_prime_ex := nil; + BN_is_prime_fasttest_ex := nil; + BN_X931_generate_Xpq := nil; + BN_X931_derive_prime_ex := nil; + BN_X931_generate_prime_ex := nil; + BN_MONT_CTX_new := nil; + BN_mod_mul_montgomery := nil; + BN_to_montgomery := nil; + BN_from_montgomery := nil; + BN_MONT_CTX_free := nil; + BN_MONT_CTX_set := nil; + BN_MONT_CTX_copy := nil; + BN_BLINDING_new := nil; + BN_BLINDING_free := nil; + BN_BLINDING_update := nil; + BN_BLINDING_convert := nil; + BN_BLINDING_invert := nil; + BN_BLINDING_convert_ex := nil; + BN_BLINDING_invert_ex := nil; + BN_BLINDING_is_current_thread := nil; + BN_BLINDING_set_current_thread := nil; + BN_BLINDING_lock := nil; + BN_BLINDING_unlock := nil; + BN_BLINDING_get_flags := nil; + BN_BLINDING_set_flags := nil; + BN_RECP_CTX_free := nil; + BN_RECP_CTX_set := nil; + BN_mod_mul_reciprocal := nil; + BN_mod_exp_recp := nil; + BN_div_recp := nil; + BN_GF2m_add := nil; + BN_GF2m_mod := nil; + BN_GF2m_mod_mul := nil; + BN_GF2m_mod_sqr := nil; + BN_GF2m_mod_inv := nil; + BN_GF2m_mod_div := nil; + BN_GF2m_mod_exp := nil; + BN_GF2m_mod_sqrt := nil; + BN_GF2m_mod_solve_quad := nil; + BN_nist_mod_192 := nil; + BN_nist_mod_224 := nil; + BN_nist_mod_256 := nil; + BN_nist_mod_384 := nil; + BN_nist_mod_521 := nil; + BN_get0_nist_prime_192 := nil; + BN_get0_nist_prime_224 := nil; + BN_get0_nist_prime_256 := nil; + BN_get0_nist_prime_384 := nil; + BN_get0_nist_prime_521 := nil; + BN_generate_dsa_nonce := nil; + BN_get_rfc2409_prime_768 := nil; + BN_get_rfc2409_prime_1024 := nil; + BN_get_rfc3526_prime_1536 := nil; + BN_get_rfc3526_prime_2048 := nil; + BN_get_rfc3526_prime_3072 := nil; + BN_get_rfc3526_prime_4096 := nil; + BN_get_rfc3526_prime_6144 := nil; + BN_get_rfc3526_prime_8192 := nil; + BN_bntest_rand := nil; +end; +{$ELSE} +{$ENDIF} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +initialization + Register_SSLLoader(@Load,'LibCrypto'); + Register_SSLUnloader(@Unload); +{$ENDIF} +end. diff --git a/IdOpenSSLHeaders_bnerr.pas b/IdOpenSSLHeaders_bnerr.pas new file mode 100644 index 0000000..9a2c23b --- /dev/null +++ b/IdOpenSSLHeaders_bnerr.pas @@ -0,0 +1,217 @@ + (* This unit was generated using the script genOpenSSLHdrs.sh from the source file IdOpenSSLHeaders_bnerr.h2pas + It should not be modified directly. All changes should be made to IdOpenSSLHeaders_bnerr.h2pas + and this file regenerated. IdOpenSSLHeaders_bnerr.h2pas is distributed with the full Indy + Distribution. + *) + +{$i IdCompilerDefines.inc} +{$i IdSSLOpenSSLDefines.inc} +{$IFNDEF USE_OPENSSL} + { error Should not compile if USE_OPENSSL is not defined!!!} +{$ENDIF} +{******************************************************************************} +{ } +{ Indy (Internet Direct) - Internet Protocols Simplified } +{ } +{ https://www.indyproject.org/ } +{ https://gitter.im/IndySockets/Indy } +{ } +{******************************************************************************} +{ } +{ This file is part of the Indy (Internet Direct) project, and is offered } +{ under the dual-licensing agreement described on the Indy website. } +{ (https://www.indyproject.org/license/) } +{ } +{ Copyright: } +{ (c) 1993-2020, Chad Z. Hower and the Indy Pit Crew. All rights reserved. } +{ } +{******************************************************************************} +{ } +{ } +{******************************************************************************} + +unit IdOpenSSLHeaders_bnerr; + +interface + +// Headers for OpenSSL 1.1.1 +// bnerr.h + + +uses + IdCTypes, + IdGlobal, + IdSSLOpenSSLConsts; + +const + (* + * BN function codes. + *) + BN_F_BNRAND = 127; + BN_F_BNRAND_RANGE = 138; + BN_F_BN_BLINDING_CONVERT_EX = 100; + BN_F_BN_BLINDING_CREATE_PARAM = 128; + BN_F_BN_BLINDING_INVERT_EX = 101; + BN_F_BN_BLINDING_NEW = 102; + BN_F_BN_BLINDING_UPDATE = 103; + BN_F_BN_BN2DEC = 104; + BN_F_BN_BN2HEX = 105; + BN_F_BN_COMPUTE_WNAF = 142; + BN_F_BN_CTX_GET = 116; + BN_F_BN_CTX_NEW = 106; + BN_F_BN_CTX_START = 129; + BN_F_BN_DIV = 107; + BN_F_BN_DIV_RECP = 130; + BN_F_BN_EXP = 123; + BN_F_BN_EXPAND_INTERNAL = 120; + BN_F_BN_GENCB_NEW = 143; + BN_F_BN_GENERATE_DSA_NONCE = 140; + BN_F_BN_GENERATE_PRIME_EX = 141; + BN_F_BN_GF2M_MOD = 131; + BN_F_BN_GF2M_MOD_EXP = 132; + BN_F_BN_GF2M_MOD_MUL = 133; + BN_F_BN_GF2M_MOD_SOLVE_QUAD = 134; + BN_F_BN_GF2M_MOD_SOLVE_QUAD_ARR = 135; + BN_F_BN_GF2M_MOD_SQR = 136; + BN_F_BN_GF2M_MOD_SQRT = 137; + BN_F_BN_LSHIFT = 145; + BN_F_BN_MOD_EXP2_MONT = 118; + BN_F_BN_MOD_EXP_MONT = 109; + BN_F_BN_MOD_EXP_MONT_CONSTTIME = 124; + BN_F_BN_MOD_EXP_MONT_WORD = 117; + BN_F_BN_MOD_EXP_RECP = 125; + BN_F_BN_MOD_EXP_SIMPLE = 126; + BN_F_BN_MOD_INVERSE = 110; + BN_F_BN_MOD_INVERSE_NO_BRANCH = 139; + BN_F_BN_MOD_LSHIFT_QUICK = 119; + BN_F_BN_MOD_SQRT = 121; + BN_F_BN_MONT_CTX_NEW = 149; + BN_F_BN_MPI2BN = 112; + BN_F_BN_NEW = 113; + BN_F_BN_POOL_GET = 147; + BN_F_BN_RAND = 114; + BN_F_BN_RAND_RANGE = 122; + BN_F_BN_RECP_CTX_NEW = 150; + BN_F_BN_RSHIFT = 146; + BN_F_BN_SET_WORDS = 144; + BN_F_BN_STACK_PUSH = 148; + BN_F_BN_USUB = 115; + + (* + * BN reason codes. + *) + BN_R_ARG2_LT_ARG3 = 100; + BN_R_BAD_RECIPROCAL = 101; + BN_R_BIGNUM_TOO_LONG = 114; + BN_R_BITS_TOO_SMALL = 118; + BN_R_CALLED_WITH_EVEN_MODULUS = 102; + BN_R_DIV_BY_ZERO = 103; + BN_R_ENCODING_ERROR = 104; + BN_R_EXPAND_ON_STATIC_BIGNUM_DATA = 105; + BN_R_INPUT_NOT_REDUCED = 110; + BN_R_INVALID_LENGTH = 106; + BN_R_INVALID_RANGE = 115; + BN_R_INVALID_SHIFT = 119; + BN_R_NOT_A_SQUARE = 111; + BN_R_NOT_INITIALIZED = 107; + BN_R_NO_INVERSE = 108; + BN_R_NO_SOLUTION = 116; + BN_R_PRIVATE_KEY_TOO_LARGE = 117; + BN_R_P_IS_NOT_PRIME = 112; + BN_R_TOO_MANY_ITERATIONS = 113; + BN_R_TOO_MANY_TEMPORARY_VARIABLES = 109; + + { The EXTERNALSYM directive is ignored by FPC, however, it is used by Delphi as follows: + + The EXTERNALSYM directive prevents the specified Delphi symbol from appearing in header + files generated for C++. } + + {$EXTERNALSYM ERR_load_BN_strings} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +var + ERR_load_BN_strings: function : TIdC_INT; cdecl = nil; + +{$ELSE} + function ERR_load_BN_strings: TIdC_INT cdecl; external CLibCrypto; + +{$ENDIF} + +implementation + + uses + classes, + IdSSLOpenSSLExceptionHandlers, + IdResourceStringsOpenSSL + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + ,IdSSLOpenSSLLoader + {$ENDIF}; + + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +const + ERR_load_BN_strings_procname = 'ERR_load_BN_strings'; + + +{$WARN NO_RETVAL OFF} +function ERR_ERR_load_BN_strings: TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ERR_load_BN_strings_procname); +end; + + + +{$WARN NO_RETVAL ON} + +procedure Load(const ADllHandle: TIdLibHandle; LibVersion: TIdC_UINT; const AFailed: TStringList); + +var FuncLoadError: boolean; + +begin + ERR_load_BN_strings := LoadLibFunction(ADllHandle, ERR_load_BN_strings_procname); + FuncLoadError := not assigned(ERR_load_BN_strings); + if FuncLoadError then + begin + {$if not defined(ERR_load_BN_strings_allownil)} + ERR_load_BN_strings := @ERR_ERR_load_BN_strings; + {$ifend} + {$if declared(ERR_load_BN_strings_introduced)} + if LibVersion < ERR_load_BN_strings_introduced then + begin + {$if declared(FC_ERR_load_BN_strings)} + ERR_load_BN_strings := @FC_ERR_load_BN_strings; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ERR_load_BN_strings_removed)} + if ERR_load_BN_strings_removed <= LibVersion then + begin + {$if declared(_ERR_load_BN_strings)} + ERR_load_BN_strings := @_ERR_load_BN_strings; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ERR_load_BN_strings_allownil)} + if FuncLoadError then + AFailed.Add('ERR_load_BN_strings'); + {$ifend} + end; + + +end; + +procedure Unload; +begin + ERR_load_BN_strings := nil; +end; +{$ELSE} +{$ENDIF} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +initialization + Register_SSLLoader(@Load,'LibCrypto'); + Register_SSLUnloader(@Unload); +{$ENDIF} +end. diff --git a/IdOpenSSLHeaders_buffer.pas b/IdOpenSSLHeaders_buffer.pas new file mode 100644 index 0000000..a2d8941 --- /dev/null +++ b/IdOpenSSLHeaders_buffer.pas @@ -0,0 +1,366 @@ + (* This unit was generated using the script genOpenSSLHdrs.sh from the source file IdOpenSSLHeaders_buffer.h2pas + It should not be modified directly. All changes should be made to IdOpenSSLHeaders_buffer.h2pas + and this file regenerated. IdOpenSSLHeaders_buffer.h2pas is distributed with the full Indy + Distribution. + *) + +{$i IdCompilerDefines.inc} +{$i IdSSLOpenSSLDefines.inc} +{$IFNDEF USE_OPENSSL} + { error Should not compile if USE_OPENSSL is not defined!!!} +{$ENDIF} +{******************************************************************************} +{ } +{ Indy (Internet Direct) - Internet Protocols Simplified } +{ } +{ https://www.indyproject.org/ } +{ https://gitter.im/IndySockets/Indy } +{ } +{******************************************************************************} +{ } +{ This file is part of the Indy (Internet Direct) project, and is offered } +{ under the dual-licensing agreement described on the Indy website. } +{ (https://www.indyproject.org/license/) } +{ } +{ Copyright: } +{ (c) 1993-2020, Chad Z. Hower and the Indy Pit Crew. All rights reserved. } +{ } +{******************************************************************************} +{ } +{ } +{******************************************************************************} + +unit IdOpenSSLHeaders_buffer; + +interface + +// Headers for OpenSSL 1.1.1 +// buffer.h + + +uses + IdCTypes, + IdGlobal, + IdSSLOpenSSLConsts, + IdOpenSSLHeaders_ossl_typ; + +const + BUF_MEM_FLAG_SECURE = $01; + +type + buf_mem_st = record + length: TIdC_SIZET; + data: PIdAnsiChar; + max: TIdC_SIZET; + flags: TIdC_ULONG; + end; + + { The EXTERNALSYM directive is ignored by FPC, however, it is used by Delphi as follows: + + The EXTERNALSYM directive prevents the specified Delphi symbol from appearing in header + files generated for C++. } + + {$EXTERNALSYM BUF_MEM_new} + {$EXTERNALSYM BUF_MEM_new_ex} + {$EXTERNALSYM BUF_MEM_free} + {$EXTERNALSYM BUF_MEM_grow} + {$EXTERNALSYM BUF_MEM_grow_clean} + {$EXTERNALSYM BUF_reverse} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +var + BUF_MEM_new: function : PBUF_MEM; cdecl = nil; + BUF_MEM_new_ex: function (flags: TIdC_ULONG): PBUF_MEM; cdecl = nil; + BUF_MEM_free: procedure (a: PBUF_MEM); cdecl = nil; + BUF_MEM_grow: function (str: PBUF_MEM; len: TIdC_SIZET): TIdC_SIZET; cdecl = nil; + BUF_MEM_grow_clean: function (str: PBUF_MEM; len: TIdC_SIZET): TIdC_SIZET; cdecl = nil; + BUF_reverse: procedure (out_: PByte; const in_: PByte; siz: TIdC_SIZET); cdecl = nil; + +{$ELSE} + function BUF_MEM_new: PBUF_MEM cdecl; external CLibCrypto; + function BUF_MEM_new_ex(flags: TIdC_ULONG): PBUF_MEM cdecl; external CLibCrypto; + procedure BUF_MEM_free(a: PBUF_MEM) cdecl; external CLibCrypto; + function BUF_MEM_grow(str: PBUF_MEM; len: TIdC_SIZET): TIdC_SIZET cdecl; external CLibCrypto; + function BUF_MEM_grow_clean(str: PBUF_MEM; len: TIdC_SIZET): TIdC_SIZET cdecl; external CLibCrypto; + procedure BUF_reverse(out_: PByte; const in_: PByte; siz: TIdC_SIZET) cdecl; external CLibCrypto; + +{$ENDIF} + +implementation + + uses + classes, + IdSSLOpenSSLExceptionHandlers, + IdResourceStringsOpenSSL + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + ,IdSSLOpenSSLLoader + {$ENDIF}; + + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +const + BUF_MEM_new_procname = 'BUF_MEM_new'; + BUF_MEM_new_ex_procname = 'BUF_MEM_new_ex'; + BUF_MEM_free_procname = 'BUF_MEM_free'; + BUF_MEM_grow_procname = 'BUF_MEM_grow'; + BUF_MEM_grow_clean_procname = 'BUF_MEM_grow_clean'; + BUF_reverse_procname = 'BUF_reverse'; + + +{$WARN NO_RETVAL OFF} +function ERR_BUF_MEM_new: PBUF_MEM; +begin + EIdAPIFunctionNotPresent.RaiseException(BUF_MEM_new_procname); +end; + + +function ERR_BUF_MEM_new_ex(flags: TIdC_ULONG): PBUF_MEM; +begin + EIdAPIFunctionNotPresent.RaiseException(BUF_MEM_new_ex_procname); +end; + + +procedure ERR_BUF_MEM_free(a: PBUF_MEM); +begin + EIdAPIFunctionNotPresent.RaiseException(BUF_MEM_free_procname); +end; + + +function ERR_BUF_MEM_grow(str: PBUF_MEM; len: TIdC_SIZET): TIdC_SIZET; +begin + EIdAPIFunctionNotPresent.RaiseException(BUF_MEM_grow_procname); +end; + + +function ERR_BUF_MEM_grow_clean(str: PBUF_MEM; len: TIdC_SIZET): TIdC_SIZET; +begin + EIdAPIFunctionNotPresent.RaiseException(BUF_MEM_grow_clean_procname); +end; + + +procedure ERR_BUF_reverse(out_: PByte; const in_: PByte; siz: TIdC_SIZET); +begin + EIdAPIFunctionNotPresent.RaiseException(BUF_reverse_procname); +end; + + + +{$WARN NO_RETVAL ON} + +procedure Load(const ADllHandle: TIdLibHandle; LibVersion: TIdC_UINT; const AFailed: TStringList); + +var FuncLoadError: boolean; + +begin + BUF_MEM_new := LoadLibFunction(ADllHandle, BUF_MEM_new_procname); + FuncLoadError := not assigned(BUF_MEM_new); + if FuncLoadError then + begin + {$if not defined(BUF_MEM_new_allownil)} + BUF_MEM_new := @ERR_BUF_MEM_new; + {$ifend} + {$if declared(BUF_MEM_new_introduced)} + if LibVersion < BUF_MEM_new_introduced then + begin + {$if declared(FC_BUF_MEM_new)} + BUF_MEM_new := @FC_BUF_MEM_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BUF_MEM_new_removed)} + if BUF_MEM_new_removed <= LibVersion then + begin + {$if declared(_BUF_MEM_new)} + BUF_MEM_new := @_BUF_MEM_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BUF_MEM_new_allownil)} + if FuncLoadError then + AFailed.Add('BUF_MEM_new'); + {$ifend} + end; + + + BUF_MEM_new_ex := LoadLibFunction(ADllHandle, BUF_MEM_new_ex_procname); + FuncLoadError := not assigned(BUF_MEM_new_ex); + if FuncLoadError then + begin + {$if not defined(BUF_MEM_new_ex_allownil)} + BUF_MEM_new_ex := @ERR_BUF_MEM_new_ex; + {$ifend} + {$if declared(BUF_MEM_new_ex_introduced)} + if LibVersion < BUF_MEM_new_ex_introduced then + begin + {$if declared(FC_BUF_MEM_new_ex)} + BUF_MEM_new_ex := @FC_BUF_MEM_new_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BUF_MEM_new_ex_removed)} + if BUF_MEM_new_ex_removed <= LibVersion then + begin + {$if declared(_BUF_MEM_new_ex)} + BUF_MEM_new_ex := @_BUF_MEM_new_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BUF_MEM_new_ex_allownil)} + if FuncLoadError then + AFailed.Add('BUF_MEM_new_ex'); + {$ifend} + end; + + + BUF_MEM_free := LoadLibFunction(ADllHandle, BUF_MEM_free_procname); + FuncLoadError := not assigned(BUF_MEM_free); + if FuncLoadError then + begin + {$if not defined(BUF_MEM_free_allownil)} + BUF_MEM_free := @ERR_BUF_MEM_free; + {$ifend} + {$if declared(BUF_MEM_free_introduced)} + if LibVersion < BUF_MEM_free_introduced then + begin + {$if declared(FC_BUF_MEM_free)} + BUF_MEM_free := @FC_BUF_MEM_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BUF_MEM_free_removed)} + if BUF_MEM_free_removed <= LibVersion then + begin + {$if declared(_BUF_MEM_free)} + BUF_MEM_free := @_BUF_MEM_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BUF_MEM_free_allownil)} + if FuncLoadError then + AFailed.Add('BUF_MEM_free'); + {$ifend} + end; + + + BUF_MEM_grow := LoadLibFunction(ADllHandle, BUF_MEM_grow_procname); + FuncLoadError := not assigned(BUF_MEM_grow); + if FuncLoadError then + begin + {$if not defined(BUF_MEM_grow_allownil)} + BUF_MEM_grow := @ERR_BUF_MEM_grow; + {$ifend} + {$if declared(BUF_MEM_grow_introduced)} + if LibVersion < BUF_MEM_grow_introduced then + begin + {$if declared(FC_BUF_MEM_grow)} + BUF_MEM_grow := @FC_BUF_MEM_grow; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BUF_MEM_grow_removed)} + if BUF_MEM_grow_removed <= LibVersion then + begin + {$if declared(_BUF_MEM_grow)} + BUF_MEM_grow := @_BUF_MEM_grow; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BUF_MEM_grow_allownil)} + if FuncLoadError then + AFailed.Add('BUF_MEM_grow'); + {$ifend} + end; + + + BUF_MEM_grow_clean := LoadLibFunction(ADllHandle, BUF_MEM_grow_clean_procname); + FuncLoadError := not assigned(BUF_MEM_grow_clean); + if FuncLoadError then + begin + {$if not defined(BUF_MEM_grow_clean_allownil)} + BUF_MEM_grow_clean := @ERR_BUF_MEM_grow_clean; + {$ifend} + {$if declared(BUF_MEM_grow_clean_introduced)} + if LibVersion < BUF_MEM_grow_clean_introduced then + begin + {$if declared(FC_BUF_MEM_grow_clean)} + BUF_MEM_grow_clean := @FC_BUF_MEM_grow_clean; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BUF_MEM_grow_clean_removed)} + if BUF_MEM_grow_clean_removed <= LibVersion then + begin + {$if declared(_BUF_MEM_grow_clean)} + BUF_MEM_grow_clean := @_BUF_MEM_grow_clean; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BUF_MEM_grow_clean_allownil)} + if FuncLoadError then + AFailed.Add('BUF_MEM_grow_clean'); + {$ifend} + end; + + + BUF_reverse := LoadLibFunction(ADllHandle, BUF_reverse_procname); + FuncLoadError := not assigned(BUF_reverse); + if FuncLoadError then + begin + {$if not defined(BUF_reverse_allownil)} + BUF_reverse := @ERR_BUF_reverse; + {$ifend} + {$if declared(BUF_reverse_introduced)} + if LibVersion < BUF_reverse_introduced then + begin + {$if declared(FC_BUF_reverse)} + BUF_reverse := @FC_BUF_reverse; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BUF_reverse_removed)} + if BUF_reverse_removed <= LibVersion then + begin + {$if declared(_BUF_reverse)} + BUF_reverse := @_BUF_reverse; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BUF_reverse_allownil)} + if FuncLoadError then + AFailed.Add('BUF_reverse'); + {$ifend} + end; + + +end; + +procedure Unload; +begin + BUF_MEM_new := nil; + BUF_MEM_new_ex := nil; + BUF_MEM_free := nil; + BUF_MEM_grow := nil; + BUF_MEM_grow_clean := nil; + BUF_reverse := nil; +end; +{$ELSE} +{$ENDIF} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +initialization + Register_SSLLoader(@Load,'LibCrypto'); + Register_SSLUnloader(@Unload); +{$ENDIF} +end. diff --git a/IdOpenSSLHeaders_buffererr.pas b/IdOpenSSLHeaders_buffererr.pas new file mode 100644 index 0000000..e57622f --- /dev/null +++ b/IdOpenSSLHeaders_buffererr.pas @@ -0,0 +1,147 @@ + (* This unit was generated using the script genOpenSSLHdrs.sh from the source file IdOpenSSLHeaders_buffererr.h2pas + It should not be modified directly. All changes should be made to IdOpenSSLHeaders_buffererr.h2pas + and this file regenerated. IdOpenSSLHeaders_buffererr.h2pas is distributed with the full Indy + Distribution. + *) + +{$i IdCompilerDefines.inc} +{$i IdSSLOpenSSLDefines.inc} +{$IFNDEF USE_OPENSSL} + { error Should not compile if USE_OPENSSL is not defined!!!} +{$ENDIF} +{******************************************************************************} +{ } +{ Indy (Internet Direct) - Internet Protocols Simplified } +{ } +{ https://www.indyproject.org/ } +{ https://gitter.im/IndySockets/Indy } +{ } +{******************************************************************************} +{ } +{ This file is part of the Indy (Internet Direct) project, and is offered } +{ under the dual-licensing agreement described on the Indy website. } +{ (https://www.indyproject.org/license/) } +{ } +{ Copyright: } +{ (c) 1993-2020, Chad Z. Hower and the Indy Pit Crew. All rights reserved. } +{ } +{******************************************************************************} +{ } +{ } +{******************************************************************************} + +unit IdOpenSSLHeaders_buffererr; + +interface + +// Headers for OpenSSL 1.1.1 +// buffererr.h + + +uses + IdCTypes, + IdGlobal, + IdSSLOpenSSLConsts; + +const +// BUF function codes. + BUF_F_BUF_MEM_GROW = 100; + BUF_F_BUF_MEM_GROW_CLEAN = 105; + BUF_F_BUF_MEM_NEW = 101; + +// BUF reason codes. + + { The EXTERNALSYM directive is ignored by FPC, however, it is used by Delphi as follows: + + The EXTERNALSYM directive prevents the specified Delphi symbol from appearing in header + files generated for C++. } + + {$EXTERNALSYM ERR_load_BUF_strings} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +var + ERR_load_BUF_strings: function : TIdC_INT; cdecl = nil; + +{$ELSE} + function ERR_load_BUF_strings: TIdC_INT cdecl; external CLibCrypto; + +{$ENDIF} + +implementation + + uses + classes, + IdSSLOpenSSLExceptionHandlers, + IdResourceStringsOpenSSL + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + ,IdSSLOpenSSLLoader + {$ENDIF}; + + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +const + ERR_load_BUF_strings_procname = 'ERR_load_BUF_strings'; + + +{$WARN NO_RETVAL OFF} +function ERR_ERR_load_BUF_strings: TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ERR_load_BUF_strings_procname); +end; + + + +{$WARN NO_RETVAL ON} + +procedure Load(const ADllHandle: TIdLibHandle; LibVersion: TIdC_UINT; const AFailed: TStringList); + +var FuncLoadError: boolean; + +begin + ERR_load_BUF_strings := LoadLibFunction(ADllHandle, ERR_load_BUF_strings_procname); + FuncLoadError := not assigned(ERR_load_BUF_strings); + if FuncLoadError then + begin + {$if not defined(ERR_load_BUF_strings_allownil)} + ERR_load_BUF_strings := @ERR_ERR_load_BUF_strings; + {$ifend} + {$if declared(ERR_load_BUF_strings_introduced)} + if LibVersion < ERR_load_BUF_strings_introduced then + begin + {$if declared(FC_ERR_load_BUF_strings)} + ERR_load_BUF_strings := @FC_ERR_load_BUF_strings; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ERR_load_BUF_strings_removed)} + if ERR_load_BUF_strings_removed <= LibVersion then + begin + {$if declared(_ERR_load_BUF_strings)} + ERR_load_BUF_strings := @_ERR_load_BUF_strings; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ERR_load_BUF_strings_allownil)} + if FuncLoadError then + AFailed.Add('ERR_load_BUF_strings'); + {$ifend} + end; + + +end; + +procedure Unload; +begin + ERR_load_BUF_strings := nil; +end; +{$ELSE} +{$ENDIF} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +initialization + Register_SSLLoader(@Load,'LibCrypto'); + Register_SSLUnloader(@Unload); +{$ENDIF} +end. diff --git a/IdOpenSSLHeaders_camellia.pas b/IdOpenSSLHeaders_camellia.pas new file mode 100644 index 0000000..0bde28b --- /dev/null +++ b/IdOpenSSLHeaders_camellia.pas @@ -0,0 +1,564 @@ + (* This unit was generated using the script genOpenSSLHdrs.sh from the source file IdOpenSSLHeaders_camellia.h2pas + It should not be modified directly. All changes should be made to IdOpenSSLHeaders_camellia.h2pas + and this file regenerated. IdOpenSSLHeaders_camellia.h2pas is distributed with the full Indy + Distribution. + *) + +{$i IdCompilerDefines.inc} +{$i IdSSLOpenSSLDefines.inc} +{$IFNDEF USE_OPENSSL} + { error Should not compile if USE_OPENSSL is not defined!!!} +{$ENDIF} +{******************************************************************************} +{ } +{ Indy (Internet Direct) - Internet Protocols Simplified } +{ } +{ https://www.indyproject.org/ } +{ https://gitter.im/IndySockets/Indy } +{ } +{******************************************************************************} +{ } +{ This file is part of the Indy (Internet Direct) project, and is offered } +{ under the dual-licensing agreement described on the Indy website. } +{ (https://www.indyproject.org/license/) } +{ } +{ Copyright: } +{ (c) 1993-2020, Chad Z. Hower and the Indy Pit Crew. All rights reserved. } +{ } +{******************************************************************************} +{ } +{ } +{******************************************************************************} + +unit IdOpenSSLHeaders_camellia; + +interface + +// Headers for OpenSSL 1.1.1 +// camellia.h + + +uses + IdCTypes, + IdGlobal, + IdSSLOpenSSLConsts; + +const + // Added '_CONST' to avoid name clashes + CAMELLIA_ENCRYPT_CONST = 1; + // Added '_CONST' to avoid name clashes + CAMELLIA_DECRYPT_CONST = 0; + + CAMELLIA_BLOCK_SIZE = 16; + CAMELLIA_TABLE_BYTE_LEN = 272; + CAMELLIA_TABLE_WORD_LEN = CAMELLIA_TABLE_BYTE_LEN div 4; + +type + KEY_TABLE_TYPE = array[0 .. CAMELLIA_TABLE_WORD_LEN - 1] of TIdC_UINT; + + camellia_key_st_u = record + case Integer of + 0: (d: TIdC_DOUBLE); + 1: (rd_key: KEY_TABLE_TYPE); + end; + + camellia_key_st = record + u: camellia_key_st_u; + grand_rounds: TIdC_INT; + end; + + CAMELLIA_KEY = camellia_key_st; + PCAMELLIA_KEY = ^CAMELLIA_KEY; + + TCamellia_ctr128_encrypt_ivec = array[0 .. CAMELLIA_TABLE_WORD_LEN - 1] of Byte; + TCamellia_ctr128_encrypt_ecount_buf = array[0 .. CAMELLIA_TABLE_WORD_LEN - 1] of Byte; + + { The EXTERNALSYM directive is ignored by FPC, however, it is used by Delphi as follows: + + The EXTERNALSYM directive prevents the specified Delphi symbol from appearing in header + files generated for C++. } + + {$EXTERNALSYM Camellia_set_key} + {$EXTERNALSYM Camellia_encrypt} + {$EXTERNALSYM Camellia_decrypt} + {$EXTERNALSYM Camellia_ecb_encrypt} + {$EXTERNALSYM Camellia_cbc_encrypt} + {$EXTERNALSYM Camellia_cfb128_encrypt} + {$EXTERNALSYM Camellia_cfb1_encrypt} + {$EXTERNALSYM Camellia_cfb8_encrypt} + {$EXTERNALSYM Camellia_ofb128_encrypt} + {$EXTERNALSYM Camellia_ctr128_encrypt} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +var + Camellia_set_key: function (const userKey: PByte; const bits: TIdC_INT; key: PCAMELLIA_KEY): TIdC_INT; cdecl = nil; + + Camellia_encrypt: procedure (const in_: PByte; const out_: PByte; const key: PCAMELLIA_KEY); cdecl = nil; + Camellia_decrypt: procedure (const in_: PByte; const out_: PByte; const key: PCAMELLIA_KEY); cdecl = nil; + + Camellia_ecb_encrypt: procedure ( const in_: PByte; const out_: PByte; const key: PCAMELLIA_KEY; const enc: TIdC_INT); cdecl = nil; + Camellia_cbc_encrypt: procedure ( const in_: PByte; const out_: PByte; length: TIdC_SIZET; const key: PCAMELLIA_KEY; ivec: PByte; const enc: TIdC_INT); cdecl = nil; + Camellia_cfb128_encrypt: procedure ( const in_: PByte; const out_: PByte; length: TIdC_SIZET; const key: PCAMELLIA_KEY; ivec: PByte; num: PIdC_INT; const enc: TIdC_INT); cdecl = nil; + Camellia_cfb1_encrypt: procedure ( const in_: PByte; const out_: PByte; length: TIdC_SIZET; const key: PCAMELLIA_KEY; ivec: PByte; num: PIdC_INT; const enc: TIdC_INT); cdecl = nil; + Camellia_cfb8_encrypt: procedure ( const in_: PByte; const out_: PByte; length: TIdC_SIZET; const key: PCAMELLIA_KEY; ivec: PByte; num: PIdC_INT; const enc: TIdC_INT); cdecl = nil; + Camellia_ofb128_encrypt: procedure ( const in_: PByte; const out_: PByte; length: TIdC_SIZET; const key: PCAMELLIA_KEY; ivec: PByte; num: PIdC_INT); cdecl = nil; + Camellia_ctr128_encrypt: procedure ( const in_: PByte; const out_: PByte; length: TIdC_SIZET; const key: PCAMELLIA_KEY; ivec: TCamellia_ctr128_encrypt_ivec; ecount_buf: TCamellia_ctr128_encrypt_ecount_buf; num: PIdC_INT); cdecl = nil; + +{$ELSE} + function Camellia_set_key(const userKey: PByte; const bits: TIdC_INT; key: PCAMELLIA_KEY): TIdC_INT cdecl; external CLibCrypto; + + procedure Camellia_encrypt(const in_: PByte; const out_: PByte; const key: PCAMELLIA_KEY) cdecl; external CLibCrypto; + procedure Camellia_decrypt(const in_: PByte; const out_: PByte; const key: PCAMELLIA_KEY) cdecl; external CLibCrypto; + + procedure Camellia_ecb_encrypt( const in_: PByte; const out_: PByte; const key: PCAMELLIA_KEY; const enc: TIdC_INT) cdecl; external CLibCrypto; + procedure Camellia_cbc_encrypt( const in_: PByte; const out_: PByte; length: TIdC_SIZET; const key: PCAMELLIA_KEY; ivec: PByte; const enc: TIdC_INT) cdecl; external CLibCrypto; + procedure Camellia_cfb128_encrypt( const in_: PByte; const out_: PByte; length: TIdC_SIZET; const key: PCAMELLIA_KEY; ivec: PByte; num: PIdC_INT; const enc: TIdC_INT) cdecl; external CLibCrypto; + procedure Camellia_cfb1_encrypt( const in_: PByte; const out_: PByte; length: TIdC_SIZET; const key: PCAMELLIA_KEY; ivec: PByte; num: PIdC_INT; const enc: TIdC_INT) cdecl; external CLibCrypto; + procedure Camellia_cfb8_encrypt( const in_: PByte; const out_: PByte; length: TIdC_SIZET; const key: PCAMELLIA_KEY; ivec: PByte; num: PIdC_INT; const enc: TIdC_INT) cdecl; external CLibCrypto; + procedure Camellia_ofb128_encrypt( const in_: PByte; const out_: PByte; length: TIdC_SIZET; const key: PCAMELLIA_KEY; ivec: PByte; num: PIdC_INT) cdecl; external CLibCrypto; + procedure Camellia_ctr128_encrypt( const in_: PByte; const out_: PByte; length: TIdC_SIZET; const key: PCAMELLIA_KEY; ivec: TCamellia_ctr128_encrypt_ivec; ecount_buf: TCamellia_ctr128_encrypt_ecount_buf; num: PIdC_INT) cdecl; external CLibCrypto; + +{$ENDIF} + +implementation + + uses + classes, + IdSSLOpenSSLExceptionHandlers, + IdResourceStringsOpenSSL + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + ,IdSSLOpenSSLLoader + {$ENDIF}; + + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +const + Camellia_set_key_procname = 'Camellia_set_key'; + + Camellia_encrypt_procname = 'Camellia_encrypt'; + Camellia_decrypt_procname = 'Camellia_decrypt'; + + Camellia_ecb_encrypt_procname = 'Camellia_ecb_encrypt'; + Camellia_cbc_encrypt_procname = 'Camellia_cbc_encrypt'; + Camellia_cfb128_encrypt_procname = 'Camellia_cfb128_encrypt'; + Camellia_cfb1_encrypt_procname = 'Camellia_cfb1_encrypt'; + Camellia_cfb8_encrypt_procname = 'Camellia_cfb8_encrypt'; + Camellia_ofb128_encrypt_procname = 'Camellia_ofb128_encrypt'; + Camellia_ctr128_encrypt_procname = 'Camellia_ctr128_encrypt'; + + +{$WARN NO_RETVAL OFF} +function ERR_Camellia_set_key(const userKey: PByte; const bits: TIdC_INT; key: PCAMELLIA_KEY): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(Camellia_set_key_procname); +end; + + + +procedure ERR_Camellia_encrypt(const in_: PByte; const out_: PByte; const key: PCAMELLIA_KEY); +begin + EIdAPIFunctionNotPresent.RaiseException(Camellia_encrypt_procname); +end; + + +procedure ERR_Camellia_decrypt(const in_: PByte; const out_: PByte; const key: PCAMELLIA_KEY); +begin + EIdAPIFunctionNotPresent.RaiseException(Camellia_decrypt_procname); +end; + + + +procedure ERR_Camellia_ecb_encrypt( const in_: PByte; const out_: PByte; const key: PCAMELLIA_KEY; const enc: TIdC_INT); +begin + EIdAPIFunctionNotPresent.RaiseException(Camellia_ecb_encrypt_procname); +end; + + +procedure ERR_Camellia_cbc_encrypt( const in_: PByte; const out_: PByte; length: TIdC_SIZET; const key: PCAMELLIA_KEY; ivec: PByte; const enc: TIdC_INT); +begin + EIdAPIFunctionNotPresent.RaiseException(Camellia_cbc_encrypt_procname); +end; + + +procedure ERR_Camellia_cfb128_encrypt( const in_: PByte; const out_: PByte; length: TIdC_SIZET; const key: PCAMELLIA_KEY; ivec: PByte; num: PIdC_INT; const enc: TIdC_INT); +begin + EIdAPIFunctionNotPresent.RaiseException(Camellia_cfb128_encrypt_procname); +end; + + +procedure ERR_Camellia_cfb1_encrypt( const in_: PByte; const out_: PByte; length: TIdC_SIZET; const key: PCAMELLIA_KEY; ivec: PByte; num: PIdC_INT; const enc: TIdC_INT); +begin + EIdAPIFunctionNotPresent.RaiseException(Camellia_cfb1_encrypt_procname); +end; + + +procedure ERR_Camellia_cfb8_encrypt( const in_: PByte; const out_: PByte; length: TIdC_SIZET; const key: PCAMELLIA_KEY; ivec: PByte; num: PIdC_INT; const enc: TIdC_INT); +begin + EIdAPIFunctionNotPresent.RaiseException(Camellia_cfb8_encrypt_procname); +end; + + +procedure ERR_Camellia_ofb128_encrypt( const in_: PByte; const out_: PByte; length: TIdC_SIZET; const key: PCAMELLIA_KEY; ivec: PByte; num: PIdC_INT); +begin + EIdAPIFunctionNotPresent.RaiseException(Camellia_ofb128_encrypt_procname); +end; + + +procedure ERR_Camellia_ctr128_encrypt( const in_: PByte; const out_: PByte; length: TIdC_SIZET; const key: PCAMELLIA_KEY; ivec: TCamellia_ctr128_encrypt_ivec; ecount_buf: TCamellia_ctr128_encrypt_ecount_buf; num: PIdC_INT); +begin + EIdAPIFunctionNotPresent.RaiseException(Camellia_ctr128_encrypt_procname); +end; + + + +{$WARN NO_RETVAL ON} + +procedure Load(const ADllHandle: TIdLibHandle; LibVersion: TIdC_UINT; const AFailed: TStringList); + +var FuncLoadError: boolean; + +begin + Camellia_set_key := LoadLibFunction(ADllHandle, Camellia_set_key_procname); + FuncLoadError := not assigned(Camellia_set_key); + if FuncLoadError then + begin + {$if not defined(Camellia_set_key_allownil)} + Camellia_set_key := @ERR_Camellia_set_key; + {$ifend} + {$if declared(Camellia_set_key_introduced)} + if LibVersion < Camellia_set_key_introduced then + begin + {$if declared(FC_Camellia_set_key)} + Camellia_set_key := @FC_Camellia_set_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(Camellia_set_key_removed)} + if Camellia_set_key_removed <= LibVersion then + begin + {$if declared(_Camellia_set_key)} + Camellia_set_key := @_Camellia_set_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(Camellia_set_key_allownil)} + if FuncLoadError then + AFailed.Add('Camellia_set_key'); + {$ifend} + end; + + + Camellia_encrypt := LoadLibFunction(ADllHandle, Camellia_encrypt_procname); + FuncLoadError := not assigned(Camellia_encrypt); + if FuncLoadError then + begin + {$if not defined(Camellia_encrypt_allownil)} + Camellia_encrypt := @ERR_Camellia_encrypt; + {$ifend} + {$if declared(Camellia_encrypt_introduced)} + if LibVersion < Camellia_encrypt_introduced then + begin + {$if declared(FC_Camellia_encrypt)} + Camellia_encrypt := @FC_Camellia_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(Camellia_encrypt_removed)} + if Camellia_encrypt_removed <= LibVersion then + begin + {$if declared(_Camellia_encrypt)} + Camellia_encrypt := @_Camellia_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(Camellia_encrypt_allownil)} + if FuncLoadError then + AFailed.Add('Camellia_encrypt'); + {$ifend} + end; + + + Camellia_decrypt := LoadLibFunction(ADllHandle, Camellia_decrypt_procname); + FuncLoadError := not assigned(Camellia_decrypt); + if FuncLoadError then + begin + {$if not defined(Camellia_decrypt_allownil)} + Camellia_decrypt := @ERR_Camellia_decrypt; + {$ifend} + {$if declared(Camellia_decrypt_introduced)} + if LibVersion < Camellia_decrypt_introduced then + begin + {$if declared(FC_Camellia_decrypt)} + Camellia_decrypt := @FC_Camellia_decrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(Camellia_decrypt_removed)} + if Camellia_decrypt_removed <= LibVersion then + begin + {$if declared(_Camellia_decrypt)} + Camellia_decrypt := @_Camellia_decrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(Camellia_decrypt_allownil)} + if FuncLoadError then + AFailed.Add('Camellia_decrypt'); + {$ifend} + end; + + + Camellia_ecb_encrypt := LoadLibFunction(ADllHandle, Camellia_ecb_encrypt_procname); + FuncLoadError := not assigned(Camellia_ecb_encrypt); + if FuncLoadError then + begin + {$if not defined(Camellia_ecb_encrypt_allownil)} + Camellia_ecb_encrypt := @ERR_Camellia_ecb_encrypt; + {$ifend} + {$if declared(Camellia_ecb_encrypt_introduced)} + if LibVersion < Camellia_ecb_encrypt_introduced then + begin + {$if declared(FC_Camellia_ecb_encrypt)} + Camellia_ecb_encrypt := @FC_Camellia_ecb_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(Camellia_ecb_encrypt_removed)} + if Camellia_ecb_encrypt_removed <= LibVersion then + begin + {$if declared(_Camellia_ecb_encrypt)} + Camellia_ecb_encrypt := @_Camellia_ecb_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(Camellia_ecb_encrypt_allownil)} + if FuncLoadError then + AFailed.Add('Camellia_ecb_encrypt'); + {$ifend} + end; + + + Camellia_cbc_encrypt := LoadLibFunction(ADllHandle, Camellia_cbc_encrypt_procname); + FuncLoadError := not assigned(Camellia_cbc_encrypt); + if FuncLoadError then + begin + {$if not defined(Camellia_cbc_encrypt_allownil)} + Camellia_cbc_encrypt := @ERR_Camellia_cbc_encrypt; + {$ifend} + {$if declared(Camellia_cbc_encrypt_introduced)} + if LibVersion < Camellia_cbc_encrypt_introduced then + begin + {$if declared(FC_Camellia_cbc_encrypt)} + Camellia_cbc_encrypt := @FC_Camellia_cbc_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(Camellia_cbc_encrypt_removed)} + if Camellia_cbc_encrypt_removed <= LibVersion then + begin + {$if declared(_Camellia_cbc_encrypt)} + Camellia_cbc_encrypt := @_Camellia_cbc_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(Camellia_cbc_encrypt_allownil)} + if FuncLoadError then + AFailed.Add('Camellia_cbc_encrypt'); + {$ifend} + end; + + + Camellia_cfb128_encrypt := LoadLibFunction(ADllHandle, Camellia_cfb128_encrypt_procname); + FuncLoadError := not assigned(Camellia_cfb128_encrypt); + if FuncLoadError then + begin + {$if not defined(Camellia_cfb128_encrypt_allownil)} + Camellia_cfb128_encrypt := @ERR_Camellia_cfb128_encrypt; + {$ifend} + {$if declared(Camellia_cfb128_encrypt_introduced)} + if LibVersion < Camellia_cfb128_encrypt_introduced then + begin + {$if declared(FC_Camellia_cfb128_encrypt)} + Camellia_cfb128_encrypt := @FC_Camellia_cfb128_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(Camellia_cfb128_encrypt_removed)} + if Camellia_cfb128_encrypt_removed <= LibVersion then + begin + {$if declared(_Camellia_cfb128_encrypt)} + Camellia_cfb128_encrypt := @_Camellia_cfb128_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(Camellia_cfb128_encrypt_allownil)} + if FuncLoadError then + AFailed.Add('Camellia_cfb128_encrypt'); + {$ifend} + end; + + + Camellia_cfb1_encrypt := LoadLibFunction(ADllHandle, Camellia_cfb1_encrypt_procname); + FuncLoadError := not assigned(Camellia_cfb1_encrypt); + if FuncLoadError then + begin + {$if not defined(Camellia_cfb1_encrypt_allownil)} + Camellia_cfb1_encrypt := @ERR_Camellia_cfb1_encrypt; + {$ifend} + {$if declared(Camellia_cfb1_encrypt_introduced)} + if LibVersion < Camellia_cfb1_encrypt_introduced then + begin + {$if declared(FC_Camellia_cfb1_encrypt)} + Camellia_cfb1_encrypt := @FC_Camellia_cfb1_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(Camellia_cfb1_encrypt_removed)} + if Camellia_cfb1_encrypt_removed <= LibVersion then + begin + {$if declared(_Camellia_cfb1_encrypt)} + Camellia_cfb1_encrypt := @_Camellia_cfb1_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(Camellia_cfb1_encrypt_allownil)} + if FuncLoadError then + AFailed.Add('Camellia_cfb1_encrypt'); + {$ifend} + end; + + + Camellia_cfb8_encrypt := LoadLibFunction(ADllHandle, Camellia_cfb8_encrypt_procname); + FuncLoadError := not assigned(Camellia_cfb8_encrypt); + if FuncLoadError then + begin + {$if not defined(Camellia_cfb8_encrypt_allownil)} + Camellia_cfb8_encrypt := @ERR_Camellia_cfb8_encrypt; + {$ifend} + {$if declared(Camellia_cfb8_encrypt_introduced)} + if LibVersion < Camellia_cfb8_encrypt_introduced then + begin + {$if declared(FC_Camellia_cfb8_encrypt)} + Camellia_cfb8_encrypt := @FC_Camellia_cfb8_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(Camellia_cfb8_encrypt_removed)} + if Camellia_cfb8_encrypt_removed <= LibVersion then + begin + {$if declared(_Camellia_cfb8_encrypt)} + Camellia_cfb8_encrypt := @_Camellia_cfb8_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(Camellia_cfb8_encrypt_allownil)} + if FuncLoadError then + AFailed.Add('Camellia_cfb8_encrypt'); + {$ifend} + end; + + + Camellia_ofb128_encrypt := LoadLibFunction(ADllHandle, Camellia_ofb128_encrypt_procname); + FuncLoadError := not assigned(Camellia_ofb128_encrypt); + if FuncLoadError then + begin + {$if not defined(Camellia_ofb128_encrypt_allownil)} + Camellia_ofb128_encrypt := @ERR_Camellia_ofb128_encrypt; + {$ifend} + {$if declared(Camellia_ofb128_encrypt_introduced)} + if LibVersion < Camellia_ofb128_encrypt_introduced then + begin + {$if declared(FC_Camellia_ofb128_encrypt)} + Camellia_ofb128_encrypt := @FC_Camellia_ofb128_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(Camellia_ofb128_encrypt_removed)} + if Camellia_ofb128_encrypt_removed <= LibVersion then + begin + {$if declared(_Camellia_ofb128_encrypt)} + Camellia_ofb128_encrypt := @_Camellia_ofb128_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(Camellia_ofb128_encrypt_allownil)} + if FuncLoadError then + AFailed.Add('Camellia_ofb128_encrypt'); + {$ifend} + end; + + + Camellia_ctr128_encrypt := LoadLibFunction(ADllHandle, Camellia_ctr128_encrypt_procname); + FuncLoadError := not assigned(Camellia_ctr128_encrypt); + if FuncLoadError then + begin + {$if not defined(Camellia_ctr128_encrypt_allownil)} + Camellia_ctr128_encrypt := @ERR_Camellia_ctr128_encrypt; + {$ifend} + {$if declared(Camellia_ctr128_encrypt_introduced)} + if LibVersion < Camellia_ctr128_encrypt_introduced then + begin + {$if declared(FC_Camellia_ctr128_encrypt)} + Camellia_ctr128_encrypt := @FC_Camellia_ctr128_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(Camellia_ctr128_encrypt_removed)} + if Camellia_ctr128_encrypt_removed <= LibVersion then + begin + {$if declared(_Camellia_ctr128_encrypt)} + Camellia_ctr128_encrypt := @_Camellia_ctr128_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(Camellia_ctr128_encrypt_allownil)} + if FuncLoadError then + AFailed.Add('Camellia_ctr128_encrypt'); + {$ifend} + end; + + +end; + +procedure Unload; +begin + Camellia_set_key := nil; + Camellia_encrypt := nil; + Camellia_decrypt := nil; + Camellia_ecb_encrypt := nil; + Camellia_cbc_encrypt := nil; + Camellia_cfb128_encrypt := nil; + Camellia_cfb1_encrypt := nil; + Camellia_cfb8_encrypt := nil; + Camellia_ofb128_encrypt := nil; + Camellia_ctr128_encrypt := nil; +end; +{$ELSE} +{$ENDIF} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +initialization + Register_SSLLoader(@Load,'LibCrypto'); + Register_SSLUnloader(@Unload); +{$ENDIF} +end. diff --git a/IdOpenSSLHeaders_cast.pas b/IdOpenSSLHeaders_cast.pas new file mode 100644 index 0000000..907a196 --- /dev/null +++ b/IdOpenSSLHeaders_cast.pas @@ -0,0 +1,415 @@ + (* This unit was generated using the script genOpenSSLHdrs.sh from the source file IdOpenSSLHeaders_cast.h2pas + It should not be modified directly. All changes should be made to IdOpenSSLHeaders_cast.h2pas + and this file regenerated. IdOpenSSLHeaders_cast.h2pas is distributed with the full Indy + Distribution. + *) + +{$i IdCompilerDefines.inc} +{$i IdSSLOpenSSLDefines.inc} +{$IFNDEF USE_OPENSSL} + { error Should not compile if USE_OPENSSL is not defined!!!} +{$ENDIF} +{******************************************************************************} +{ } +{ Indy (Internet Direct) - Internet Protocols Simplified } +{ } +{ https://www.indyproject.org/ } +{ https://gitter.im/IndySockets/Indy } +{ } +{******************************************************************************} +{ } +{ This file is part of the Indy (Internet Direct) project, and is offered } +{ under the dual-licensing agreement described on the Indy website. } +{ (https://www.indyproject.org/license/) } +{ } +{ Copyright: } +{ (c) 1993-2020, Chad Z. Hower and the Indy Pit Crew. All rights reserved. } +{ } +{******************************************************************************} +{ } +{ } +{******************************************************************************} + +unit IdOpenSSLHeaders_cast; + +interface + +// Headers for OpenSSL 1.1.1 +// cast.h + + +uses + IdCTypes, + IdGlobal, + IdSSLOpenSSLConsts; + +const + CAST_ENCRYPT_CONST = 1; + CAST_DECRYPT_CONST = 0; + CAST_BLOCK = 8; + CAST_KEY_LENGTH = 16; + +type + CAST_LONG = type TIdC_UINT; + PCAST_LONG = ^CAST_LONG; + + cast_key_st = record + data: array of CAST_LONG; + short_key: TIdC_INT; //* Use reduced rounds for short key */ + end; + + CAST_KEY = cast_key_st; + PCAST_KEY = ^CAST_KEY; + + { The EXTERNALSYM directive is ignored by FPC, however, it is used by Delphi as follows: + + The EXTERNALSYM directive prevents the specified Delphi symbol from appearing in header + files generated for C++. } + + {$EXTERNALSYM CAST_set_key} + {$EXTERNALSYM CAST_ecb_encrypt} + {$EXTERNALSYM CAST_encrypt} + {$EXTERNALSYM CAST_decrypt} + {$EXTERNALSYM CAST_cbc_encrypt} + {$EXTERNALSYM CAST_cfb64_encrypt} + {$EXTERNALSYM CAST_ofb64_encrypt} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +var + CAST_set_key: procedure (key: PCast_Key; len: TIdC_INT; const data: PByte); cdecl = nil; + CAST_ecb_encrypt: procedure (const in_: PByte; out_: PByte; const key: PCast_Key; enc: TIdC_INT); cdecl = nil; + CAST_encrypt: procedure (data: PCAST_LONG; const key: PCast_Key); cdecl = nil; + CAST_decrypt: procedure (data: PCAST_LONG; const key: PCast_Key); cdecl = nil; + CAST_cbc_encrypt: procedure (const in_: PByte; out_: PByte; length: TIdC_LONG; const ks: PCast_Key; iv: PByte; enc: TIdC_INT); cdecl = nil; + CAST_cfb64_encrypt: procedure (const in_: PByte; out_: PByte; length: TIdC_LONG; const schedule: PCast_Key; ivec: PByte; num: PIdC_INT; enc: TIdC_INT); cdecl = nil; + CAST_ofb64_encrypt: procedure (const in_: PByte; out_: PByte; length: TIdC_LONG; const schedule: PCast_Key; ivec: PByte; num: PIdC_INT); cdecl = nil; + +{$ELSE} + procedure CAST_set_key(key: PCast_Key; len: TIdC_INT; const data: PByte) cdecl; external CLibCrypto; + procedure CAST_ecb_encrypt(const in_: PByte; out_: PByte; const key: PCast_Key; enc: TIdC_INT) cdecl; external CLibCrypto; + procedure CAST_encrypt(data: PCAST_LONG; const key: PCast_Key) cdecl; external CLibCrypto; + procedure CAST_decrypt(data: PCAST_LONG; const key: PCast_Key) cdecl; external CLibCrypto; + procedure CAST_cbc_encrypt(const in_: PByte; out_: PByte; length: TIdC_LONG; const ks: PCast_Key; iv: PByte; enc: TIdC_INT) cdecl; external CLibCrypto; + procedure CAST_cfb64_encrypt(const in_: PByte; out_: PByte; length: TIdC_LONG; const schedule: PCast_Key; ivec: PByte; num: PIdC_INT; enc: TIdC_INT) cdecl; external CLibCrypto; + procedure CAST_ofb64_encrypt(const in_: PByte; out_: PByte; length: TIdC_LONG; const schedule: PCast_Key; ivec: PByte; num: PIdC_INT) cdecl; external CLibCrypto; + +{$ENDIF} + +implementation + + uses + classes, + IdSSLOpenSSLExceptionHandlers, + IdResourceStringsOpenSSL + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + ,IdSSLOpenSSLLoader + {$ENDIF}; + + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +const + CAST_set_key_procname = 'CAST_set_key'; + CAST_ecb_encrypt_procname = 'CAST_ecb_encrypt'; + CAST_encrypt_procname = 'CAST_encrypt'; + CAST_decrypt_procname = 'CAST_decrypt'; + CAST_cbc_encrypt_procname = 'CAST_cbc_encrypt'; + CAST_cfb64_encrypt_procname = 'CAST_cfb64_encrypt'; + CAST_ofb64_encrypt_procname = 'CAST_ofb64_encrypt'; + + +{$WARN NO_RETVAL OFF} +procedure ERR_CAST_set_key(key: PCast_Key; len: TIdC_INT; const data: PByte); +begin + EIdAPIFunctionNotPresent.RaiseException(CAST_set_key_procname); +end; + + +procedure ERR_CAST_ecb_encrypt(const in_: PByte; out_: PByte; const key: PCast_Key; enc: TIdC_INT); +begin + EIdAPIFunctionNotPresent.RaiseException(CAST_ecb_encrypt_procname); +end; + + +procedure ERR_CAST_encrypt(data: PCAST_LONG; const key: PCast_Key); +begin + EIdAPIFunctionNotPresent.RaiseException(CAST_encrypt_procname); +end; + + +procedure ERR_CAST_decrypt(data: PCAST_LONG; const key: PCast_Key); +begin + EIdAPIFunctionNotPresent.RaiseException(CAST_decrypt_procname); +end; + + +procedure ERR_CAST_cbc_encrypt(const in_: PByte; out_: PByte; length: TIdC_LONG; const ks: PCast_Key; iv: PByte; enc: TIdC_INT); +begin + EIdAPIFunctionNotPresent.RaiseException(CAST_cbc_encrypt_procname); +end; + + +procedure ERR_CAST_cfb64_encrypt(const in_: PByte; out_: PByte; length: TIdC_LONG; const schedule: PCast_Key; ivec: PByte; num: PIdC_INT; enc: TIdC_INT); +begin + EIdAPIFunctionNotPresent.RaiseException(CAST_cfb64_encrypt_procname); +end; + + +procedure ERR_CAST_ofb64_encrypt(const in_: PByte; out_: PByte; length: TIdC_LONG; const schedule: PCast_Key; ivec: PByte; num: PIdC_INT); +begin + EIdAPIFunctionNotPresent.RaiseException(CAST_ofb64_encrypt_procname); +end; + + + +{$WARN NO_RETVAL ON} + +procedure Load(const ADllHandle: TIdLibHandle; LibVersion: TIdC_UINT; const AFailed: TStringList); + +var FuncLoadError: boolean; + +begin + CAST_set_key := LoadLibFunction(ADllHandle, CAST_set_key_procname); + FuncLoadError := not assigned(CAST_set_key); + if FuncLoadError then + begin + {$if not defined(CAST_set_key_allownil)} + CAST_set_key := @ERR_CAST_set_key; + {$ifend} + {$if declared(CAST_set_key_introduced)} + if LibVersion < CAST_set_key_introduced then + begin + {$if declared(FC_CAST_set_key)} + CAST_set_key := @FC_CAST_set_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CAST_set_key_removed)} + if CAST_set_key_removed <= LibVersion then + begin + {$if declared(_CAST_set_key)} + CAST_set_key := @_CAST_set_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CAST_set_key_allownil)} + if FuncLoadError then + AFailed.Add('CAST_set_key'); + {$ifend} + end; + + + CAST_ecb_encrypt := LoadLibFunction(ADllHandle, CAST_ecb_encrypt_procname); + FuncLoadError := not assigned(CAST_ecb_encrypt); + if FuncLoadError then + begin + {$if not defined(CAST_ecb_encrypt_allownil)} + CAST_ecb_encrypt := @ERR_CAST_ecb_encrypt; + {$ifend} + {$if declared(CAST_ecb_encrypt_introduced)} + if LibVersion < CAST_ecb_encrypt_introduced then + begin + {$if declared(FC_CAST_ecb_encrypt)} + CAST_ecb_encrypt := @FC_CAST_ecb_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CAST_ecb_encrypt_removed)} + if CAST_ecb_encrypt_removed <= LibVersion then + begin + {$if declared(_CAST_ecb_encrypt)} + CAST_ecb_encrypt := @_CAST_ecb_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CAST_ecb_encrypt_allownil)} + if FuncLoadError then + AFailed.Add('CAST_ecb_encrypt'); + {$ifend} + end; + + + CAST_encrypt := LoadLibFunction(ADllHandle, CAST_encrypt_procname); + FuncLoadError := not assigned(CAST_encrypt); + if FuncLoadError then + begin + {$if not defined(CAST_encrypt_allownil)} + CAST_encrypt := @ERR_CAST_encrypt; + {$ifend} + {$if declared(CAST_encrypt_introduced)} + if LibVersion < CAST_encrypt_introduced then + begin + {$if declared(FC_CAST_encrypt)} + CAST_encrypt := @FC_CAST_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CAST_encrypt_removed)} + if CAST_encrypt_removed <= LibVersion then + begin + {$if declared(_CAST_encrypt)} + CAST_encrypt := @_CAST_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CAST_encrypt_allownil)} + if FuncLoadError then + AFailed.Add('CAST_encrypt'); + {$ifend} + end; + + + CAST_decrypt := LoadLibFunction(ADllHandle, CAST_decrypt_procname); + FuncLoadError := not assigned(CAST_decrypt); + if FuncLoadError then + begin + {$if not defined(CAST_decrypt_allownil)} + CAST_decrypt := @ERR_CAST_decrypt; + {$ifend} + {$if declared(CAST_decrypt_introduced)} + if LibVersion < CAST_decrypt_introduced then + begin + {$if declared(FC_CAST_decrypt)} + CAST_decrypt := @FC_CAST_decrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CAST_decrypt_removed)} + if CAST_decrypt_removed <= LibVersion then + begin + {$if declared(_CAST_decrypt)} + CAST_decrypt := @_CAST_decrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CAST_decrypt_allownil)} + if FuncLoadError then + AFailed.Add('CAST_decrypt'); + {$ifend} + end; + + + CAST_cbc_encrypt := LoadLibFunction(ADllHandle, CAST_cbc_encrypt_procname); + FuncLoadError := not assigned(CAST_cbc_encrypt); + if FuncLoadError then + begin + {$if not defined(CAST_cbc_encrypt_allownil)} + CAST_cbc_encrypt := @ERR_CAST_cbc_encrypt; + {$ifend} + {$if declared(CAST_cbc_encrypt_introduced)} + if LibVersion < CAST_cbc_encrypt_introduced then + begin + {$if declared(FC_CAST_cbc_encrypt)} + CAST_cbc_encrypt := @FC_CAST_cbc_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CAST_cbc_encrypt_removed)} + if CAST_cbc_encrypt_removed <= LibVersion then + begin + {$if declared(_CAST_cbc_encrypt)} + CAST_cbc_encrypt := @_CAST_cbc_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CAST_cbc_encrypt_allownil)} + if FuncLoadError then + AFailed.Add('CAST_cbc_encrypt'); + {$ifend} + end; + + + CAST_cfb64_encrypt := LoadLibFunction(ADllHandle, CAST_cfb64_encrypt_procname); + FuncLoadError := not assigned(CAST_cfb64_encrypt); + if FuncLoadError then + begin + {$if not defined(CAST_cfb64_encrypt_allownil)} + CAST_cfb64_encrypt := @ERR_CAST_cfb64_encrypt; + {$ifend} + {$if declared(CAST_cfb64_encrypt_introduced)} + if LibVersion < CAST_cfb64_encrypt_introduced then + begin + {$if declared(FC_CAST_cfb64_encrypt)} + CAST_cfb64_encrypt := @FC_CAST_cfb64_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CAST_cfb64_encrypt_removed)} + if CAST_cfb64_encrypt_removed <= LibVersion then + begin + {$if declared(_CAST_cfb64_encrypt)} + CAST_cfb64_encrypt := @_CAST_cfb64_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CAST_cfb64_encrypt_allownil)} + if FuncLoadError then + AFailed.Add('CAST_cfb64_encrypt'); + {$ifend} + end; + + + CAST_ofb64_encrypt := LoadLibFunction(ADllHandle, CAST_ofb64_encrypt_procname); + FuncLoadError := not assigned(CAST_ofb64_encrypt); + if FuncLoadError then + begin + {$if not defined(CAST_ofb64_encrypt_allownil)} + CAST_ofb64_encrypt := @ERR_CAST_ofb64_encrypt; + {$ifend} + {$if declared(CAST_ofb64_encrypt_introduced)} + if LibVersion < CAST_ofb64_encrypt_introduced then + begin + {$if declared(FC_CAST_ofb64_encrypt)} + CAST_ofb64_encrypt := @FC_CAST_ofb64_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CAST_ofb64_encrypt_removed)} + if CAST_ofb64_encrypt_removed <= LibVersion then + begin + {$if declared(_CAST_ofb64_encrypt)} + CAST_ofb64_encrypt := @_CAST_ofb64_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CAST_ofb64_encrypt_allownil)} + if FuncLoadError then + AFailed.Add('CAST_ofb64_encrypt'); + {$ifend} + end; + + +end; + +procedure Unload; +begin + CAST_set_key := nil; + CAST_ecb_encrypt := nil; + CAST_encrypt := nil; + CAST_decrypt := nil; + CAST_cbc_encrypt := nil; + CAST_cfb64_encrypt := nil; + CAST_ofb64_encrypt := nil; +end; +{$ELSE} +{$ENDIF} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +initialization + Register_SSLLoader(@Load,'LibCrypto'); + Register_SSLUnloader(@Unload); +{$ENDIF} +end. diff --git a/IdOpenSSLHeaders_cmac.pas b/IdOpenSSLHeaders_cmac.pas new file mode 100644 index 0000000..9daf737 --- /dev/null +++ b/IdOpenSSLHeaders_cmac.pas @@ -0,0 +1,491 @@ + (* This unit was generated using the script genOpenSSLHdrs.sh from the source file IdOpenSSLHeaders_cmac.h2pas + It should not be modified directly. All changes should be made to IdOpenSSLHeaders_cmac.h2pas + and this file regenerated. IdOpenSSLHeaders_cmac.h2pas is distributed with the full Indy + Distribution. + *) + +{$i IdCompilerDefines.inc} +{$i IdSSLOpenSSLDefines.inc} +{$IFNDEF USE_OPENSSL} + { error Should not compile if USE_OPENSSL is not defined!!!} +{$ENDIF} +{******************************************************************************} +{ } +{ Indy (Internet Direct) - Internet Protocols Simplified } +{ } +{ https://www.indyproject.org/ } +{ https://gitter.im/IndySockets/Indy } +{ } +{******************************************************************************} +{ } +{ This file is part of the Indy (Internet Direct) project, and is offered } +{ under the dual-licensing agreement described on the Indy website. } +{ (https://www.indyproject.org/license/) } +{ } +{ Copyright: } +{ (c) 1993-2020, Chad Z. Hower and the Indy Pit Crew. All rights reserved. } +{ } +{******************************************************************************} +{ } +{ } +{******************************************************************************} + +unit IdOpenSSLHeaders_cmac; + +interface + +// Headers for OpenSSL 1.1.1 +// cmac.h + + +uses + IdCTypes, + IdGlobal, + IdSSLOpenSSLConsts, + IdOpenSSLHeaders_evp, + IdOpenSSLHeaders_ossl_typ; + +//* Opaque */ +type + CMAC_CTX_st = type Pointer; + CMAC_CTX = CMAC_CTX_st; + PCMAC_CTX = ^CMAC_CTX; + + { The EXTERNALSYM directive is ignored by FPC, however, it is used by Delphi as follows: + + The EXTERNALSYM directive prevents the specified Delphi symbol from appearing in header + files generated for C++. } + + {$EXTERNALSYM CMAC_CTX_new} + {$EXTERNALSYM CMAC_CTX_cleanup} + {$EXTERNALSYM CMAC_CTX_free} + {$EXTERNALSYM CMAC_CTX_get0_cipher_ctx} + {$EXTERNALSYM CMAC_CTX_copy} + {$EXTERNALSYM CMAC_Init} + {$EXTERNALSYM CMAC_Update} + {$EXTERNALSYM CMAC_Final} + {$EXTERNALSYM CMAC_resume} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +var + CMAC_CTX_new: function : PCMAC_CTX; cdecl = nil; + CMAC_CTX_cleanup: procedure (ctx: PCMAC_CTX); cdecl = nil; + CMAC_CTX_free: procedure (ctx: PCMAC_CTX); cdecl = nil; + CMAC_CTX_get0_cipher_ctx: function (ctx: PCMAC_CTX): PEVP_CIPHER_CTX; cdecl = nil; + CMAC_CTX_copy: function (out_: PCMAC_CTX; const in_: PCMAC_CTX): TIdC_INT; cdecl = nil; + CMAC_Init: function (ctx: PCMAC_CTX; const key: Pointer; keylen: TIdC_SIZET; const cipher: PEVP_Cipher; impl: PENGINe): TIdC_INT; cdecl = nil; + CMAC_Update: function (ctx: PCMAC_CTX; const data: Pointer; dlen: TIdC_SIZET): TIdC_INT; cdecl = nil; + CMAC_Final: function (ctx: PCMAC_CTX; out_: PByte; poutlen: PIdC_SIZET): TIdC_INT; cdecl = nil; + CMAC_resume: function (ctx: PCMAC_CTX): TIdC_INT; cdecl = nil; + +{$ELSE} + function CMAC_CTX_new: PCMAC_CTX cdecl; external CLibCrypto; + procedure CMAC_CTX_cleanup(ctx: PCMAC_CTX) cdecl; external CLibCrypto; + procedure CMAC_CTX_free(ctx: PCMAC_CTX) cdecl; external CLibCrypto; + function CMAC_CTX_get0_cipher_ctx(ctx: PCMAC_CTX): PEVP_CIPHER_CTX cdecl; external CLibCrypto; + function CMAC_CTX_copy(out_: PCMAC_CTX; const in_: PCMAC_CTX): TIdC_INT cdecl; external CLibCrypto; + function CMAC_Init(ctx: PCMAC_CTX; const key: Pointer; keylen: TIdC_SIZET; const cipher: PEVP_Cipher; impl: PENGINe): TIdC_INT cdecl; external CLibCrypto; + function CMAC_Update(ctx: PCMAC_CTX; const data: Pointer; dlen: TIdC_SIZET): TIdC_INT cdecl; external CLibCrypto; + function CMAC_Final(ctx: PCMAC_CTX; out_: PByte; poutlen: PIdC_SIZET): TIdC_INT cdecl; external CLibCrypto; + function CMAC_resume(ctx: PCMAC_CTX): TIdC_INT cdecl; external CLibCrypto; + +{$ENDIF} + +implementation + + uses + classes, + IdSSLOpenSSLExceptionHandlers, + IdResourceStringsOpenSSL + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + ,IdSSLOpenSSLLoader + {$ENDIF}; + + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +const + CMAC_CTX_new_procname = 'CMAC_CTX_new'; + CMAC_CTX_cleanup_procname = 'CMAC_CTX_cleanup'; + CMAC_CTX_free_procname = 'CMAC_CTX_free'; + CMAC_CTX_get0_cipher_ctx_procname = 'CMAC_CTX_get0_cipher_ctx'; + CMAC_CTX_copy_procname = 'CMAC_CTX_copy'; + CMAC_Init_procname = 'CMAC_Init'; + CMAC_Update_procname = 'CMAC_Update'; + CMAC_Final_procname = 'CMAC_Final'; + CMAC_resume_procname = 'CMAC_resume'; + + +{$WARN NO_RETVAL OFF} +function ERR_CMAC_CTX_new: PCMAC_CTX; +begin + EIdAPIFunctionNotPresent.RaiseException(CMAC_CTX_new_procname); +end; + + +procedure ERR_CMAC_CTX_cleanup(ctx: PCMAC_CTX); +begin + EIdAPIFunctionNotPresent.RaiseException(CMAC_CTX_cleanup_procname); +end; + + +procedure ERR_CMAC_CTX_free(ctx: PCMAC_CTX); +begin + EIdAPIFunctionNotPresent.RaiseException(CMAC_CTX_free_procname); +end; + + +function ERR_CMAC_CTX_get0_cipher_ctx(ctx: PCMAC_CTX): PEVP_CIPHER_CTX; +begin + EIdAPIFunctionNotPresent.RaiseException(CMAC_CTX_get0_cipher_ctx_procname); +end; + + +function ERR_CMAC_CTX_copy(out_: PCMAC_CTX; const in_: PCMAC_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(CMAC_CTX_copy_procname); +end; + + +function ERR_CMAC_Init(ctx: PCMAC_CTX; const key: Pointer; keylen: TIdC_SIZET; const cipher: PEVP_Cipher; impl: PENGINe): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(CMAC_Init_procname); +end; + + +function ERR_CMAC_Update(ctx: PCMAC_CTX; const data: Pointer; dlen: TIdC_SIZET): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(CMAC_Update_procname); +end; + + +function ERR_CMAC_Final(ctx: PCMAC_CTX; out_: PByte; poutlen: PIdC_SIZET): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(CMAC_Final_procname); +end; + + +function ERR_CMAC_resume(ctx: PCMAC_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(CMAC_resume_procname); +end; + + + +{$WARN NO_RETVAL ON} + +procedure Load(const ADllHandle: TIdLibHandle; LibVersion: TIdC_UINT; const AFailed: TStringList); + +var FuncLoadError: boolean; + +begin + CMAC_CTX_new := LoadLibFunction(ADllHandle, CMAC_CTX_new_procname); + FuncLoadError := not assigned(CMAC_CTX_new); + if FuncLoadError then + begin + {$if not defined(CMAC_CTX_new_allownil)} + CMAC_CTX_new := @ERR_CMAC_CTX_new; + {$ifend} + {$if declared(CMAC_CTX_new_introduced)} + if LibVersion < CMAC_CTX_new_introduced then + begin + {$if declared(FC_CMAC_CTX_new)} + CMAC_CTX_new := @FC_CMAC_CTX_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CMAC_CTX_new_removed)} + if CMAC_CTX_new_removed <= LibVersion then + begin + {$if declared(_CMAC_CTX_new)} + CMAC_CTX_new := @_CMAC_CTX_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CMAC_CTX_new_allownil)} + if FuncLoadError then + AFailed.Add('CMAC_CTX_new'); + {$ifend} + end; + + + CMAC_CTX_cleanup := LoadLibFunction(ADllHandle, CMAC_CTX_cleanup_procname); + FuncLoadError := not assigned(CMAC_CTX_cleanup); + if FuncLoadError then + begin + {$if not defined(CMAC_CTX_cleanup_allownil)} + CMAC_CTX_cleanup := @ERR_CMAC_CTX_cleanup; + {$ifend} + {$if declared(CMAC_CTX_cleanup_introduced)} + if LibVersion < CMAC_CTX_cleanup_introduced then + begin + {$if declared(FC_CMAC_CTX_cleanup)} + CMAC_CTX_cleanup := @FC_CMAC_CTX_cleanup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CMAC_CTX_cleanup_removed)} + if CMAC_CTX_cleanup_removed <= LibVersion then + begin + {$if declared(_CMAC_CTX_cleanup)} + CMAC_CTX_cleanup := @_CMAC_CTX_cleanup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CMAC_CTX_cleanup_allownil)} + if FuncLoadError then + AFailed.Add('CMAC_CTX_cleanup'); + {$ifend} + end; + + + CMAC_CTX_free := LoadLibFunction(ADllHandle, CMAC_CTX_free_procname); + FuncLoadError := not assigned(CMAC_CTX_free); + if FuncLoadError then + begin + {$if not defined(CMAC_CTX_free_allownil)} + CMAC_CTX_free := @ERR_CMAC_CTX_free; + {$ifend} + {$if declared(CMAC_CTX_free_introduced)} + if LibVersion < CMAC_CTX_free_introduced then + begin + {$if declared(FC_CMAC_CTX_free)} + CMAC_CTX_free := @FC_CMAC_CTX_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CMAC_CTX_free_removed)} + if CMAC_CTX_free_removed <= LibVersion then + begin + {$if declared(_CMAC_CTX_free)} + CMAC_CTX_free := @_CMAC_CTX_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CMAC_CTX_free_allownil)} + if FuncLoadError then + AFailed.Add('CMAC_CTX_free'); + {$ifend} + end; + + + CMAC_CTX_get0_cipher_ctx := LoadLibFunction(ADllHandle, CMAC_CTX_get0_cipher_ctx_procname); + FuncLoadError := not assigned(CMAC_CTX_get0_cipher_ctx); + if FuncLoadError then + begin + {$if not defined(CMAC_CTX_get0_cipher_ctx_allownil)} + CMAC_CTX_get0_cipher_ctx := @ERR_CMAC_CTX_get0_cipher_ctx; + {$ifend} + {$if declared(CMAC_CTX_get0_cipher_ctx_introduced)} + if LibVersion < CMAC_CTX_get0_cipher_ctx_introduced then + begin + {$if declared(FC_CMAC_CTX_get0_cipher_ctx)} + CMAC_CTX_get0_cipher_ctx := @FC_CMAC_CTX_get0_cipher_ctx; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CMAC_CTX_get0_cipher_ctx_removed)} + if CMAC_CTX_get0_cipher_ctx_removed <= LibVersion then + begin + {$if declared(_CMAC_CTX_get0_cipher_ctx)} + CMAC_CTX_get0_cipher_ctx := @_CMAC_CTX_get0_cipher_ctx; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CMAC_CTX_get0_cipher_ctx_allownil)} + if FuncLoadError then + AFailed.Add('CMAC_CTX_get0_cipher_ctx'); + {$ifend} + end; + + + CMAC_CTX_copy := LoadLibFunction(ADllHandle, CMAC_CTX_copy_procname); + FuncLoadError := not assigned(CMAC_CTX_copy); + if FuncLoadError then + begin + {$if not defined(CMAC_CTX_copy_allownil)} + CMAC_CTX_copy := @ERR_CMAC_CTX_copy; + {$ifend} + {$if declared(CMAC_CTX_copy_introduced)} + if LibVersion < CMAC_CTX_copy_introduced then + begin + {$if declared(FC_CMAC_CTX_copy)} + CMAC_CTX_copy := @FC_CMAC_CTX_copy; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CMAC_CTX_copy_removed)} + if CMAC_CTX_copy_removed <= LibVersion then + begin + {$if declared(_CMAC_CTX_copy)} + CMAC_CTX_copy := @_CMAC_CTX_copy; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CMAC_CTX_copy_allownil)} + if FuncLoadError then + AFailed.Add('CMAC_CTX_copy'); + {$ifend} + end; + + + CMAC_Init := LoadLibFunction(ADllHandle, CMAC_Init_procname); + FuncLoadError := not assigned(CMAC_Init); + if FuncLoadError then + begin + {$if not defined(CMAC_Init_allownil)} + CMAC_Init := @ERR_CMAC_Init; + {$ifend} + {$if declared(CMAC_Init_introduced)} + if LibVersion < CMAC_Init_introduced then + begin + {$if declared(FC_CMAC_Init)} + CMAC_Init := @FC_CMAC_Init; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CMAC_Init_removed)} + if CMAC_Init_removed <= LibVersion then + begin + {$if declared(_CMAC_Init)} + CMAC_Init := @_CMAC_Init; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CMAC_Init_allownil)} + if FuncLoadError then + AFailed.Add('CMAC_Init'); + {$ifend} + end; + + + CMAC_Update := LoadLibFunction(ADllHandle, CMAC_Update_procname); + FuncLoadError := not assigned(CMAC_Update); + if FuncLoadError then + begin + {$if not defined(CMAC_Update_allownil)} + CMAC_Update := @ERR_CMAC_Update; + {$ifend} + {$if declared(CMAC_Update_introduced)} + if LibVersion < CMAC_Update_introduced then + begin + {$if declared(FC_CMAC_Update)} + CMAC_Update := @FC_CMAC_Update; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CMAC_Update_removed)} + if CMAC_Update_removed <= LibVersion then + begin + {$if declared(_CMAC_Update)} + CMAC_Update := @_CMAC_Update; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CMAC_Update_allownil)} + if FuncLoadError then + AFailed.Add('CMAC_Update'); + {$ifend} + end; + + + CMAC_Final := LoadLibFunction(ADllHandle, CMAC_Final_procname); + FuncLoadError := not assigned(CMAC_Final); + if FuncLoadError then + begin + {$if not defined(CMAC_Final_allownil)} + CMAC_Final := @ERR_CMAC_Final; + {$ifend} + {$if declared(CMAC_Final_introduced)} + if LibVersion < CMAC_Final_introduced then + begin + {$if declared(FC_CMAC_Final)} + CMAC_Final := @FC_CMAC_Final; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CMAC_Final_removed)} + if CMAC_Final_removed <= LibVersion then + begin + {$if declared(_CMAC_Final)} + CMAC_Final := @_CMAC_Final; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CMAC_Final_allownil)} + if FuncLoadError then + AFailed.Add('CMAC_Final'); + {$ifend} + end; + + + CMAC_resume := LoadLibFunction(ADllHandle, CMAC_resume_procname); + FuncLoadError := not assigned(CMAC_resume); + if FuncLoadError then + begin + {$if not defined(CMAC_resume_allownil)} + CMAC_resume := @ERR_CMAC_resume; + {$ifend} + {$if declared(CMAC_resume_introduced)} + if LibVersion < CMAC_resume_introduced then + begin + {$if declared(FC_CMAC_resume)} + CMAC_resume := @FC_CMAC_resume; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CMAC_resume_removed)} + if CMAC_resume_removed <= LibVersion then + begin + {$if declared(_CMAC_resume)} + CMAC_resume := @_CMAC_resume; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CMAC_resume_allownil)} + if FuncLoadError then + AFailed.Add('CMAC_resume'); + {$ifend} + end; + + +end; + +procedure Unload; +begin + CMAC_CTX_new := nil; + CMAC_CTX_cleanup := nil; + CMAC_CTX_free := nil; + CMAC_CTX_get0_cipher_ctx := nil; + CMAC_CTX_copy := nil; + CMAC_Init := nil; + CMAC_Update := nil; + CMAC_Final := nil; + CMAC_resume := nil; +end; +{$ELSE} +{$ENDIF} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +initialization + Register_SSLLoader(@Load,'LibCrypto'); + Register_SSLUnloader(@Unload); +{$ENDIF} +end. diff --git a/IdOpenSSLHeaders_cms.pas b/IdOpenSSLHeaders_cms.pas new file mode 100644 index 0000000..9190045 --- /dev/null +++ b/IdOpenSSLHeaders_cms.pas @@ -0,0 +1,4489 @@ + (* This unit was generated using the script genOpenSSLHdrs.sh from the source file IdOpenSSLHeaders_cms.h2pas + It should not be modified directly. All changes should be made to IdOpenSSLHeaders_cms.h2pas + and this file regenerated. IdOpenSSLHeaders_cms.h2pas is distributed with the full Indy + Distribution. + *) + +{$i IdCompilerDefines.inc} +{$i IdSSLOpenSSLDefines.inc} +{$IFNDEF USE_OPENSSL} + { error Should not compile if USE_OPENSSL is not defined!!!} +{$ENDIF} +{******************************************************************************} +{ } +{ Indy (Internet Direct) - Internet Protocols Simplified } +{ } +{ https://www.indyproject.org/ } +{ https://gitter.im/IndySockets/Indy } +{ } +{******************************************************************************} +{ } +{ This file is part of the Indy (Internet Direct) project, and is offered } +{ under the dual-licensing agreement described on the Indy website. } +{ (https://www.indyproject.org/license/) } +{ } +{ Copyright: } +{ (c) 1993-2020, Chad Z. Hower and the Indy Pit Crew. All rights reserved. } +{ } +{******************************************************************************} +{ } +{ } +{******************************************************************************} + +unit IdOpenSSLHeaders_cms; + +interface + +// Headers for OpenSSL 1.1.1 +// cms.h + + +uses + IdCTypes, + IdGlobal, + IdSSLOpenSSLConsts, + IdOpenSSLHeaders_ossl_typ, + IdOpenSSLHeaders_x509; + +type + CMS_ContentInfo_st = type Pointer; + CMS_ContentInfo = CMS_ContentInfo_st; + PCMS_ContentInfo = ^CMS_ContentInfo; + PPCMS_ContentInfo = ^PCMS_ContentInfo; + + CMS_SignerInfo_st = type Pointer; + CMS_SignerInfo = CMS_SignerInfo_st; + PCMS_SignerInfo = ^CMS_SignerInfo; + + CMS_CertificateChoices_st = type Pointer; + CMS_CertificateChoices = CMS_CertificateChoices_st; + PCMS_CertificateChoices = ^CMS_CertificateChoices; + + CMS_RevocationInfoChoice_st = type Pointer; + CMS_RevocationInfoChoice = CMS_RevocationInfoChoice_st; + PCMS_RevocationInfoChoice = ^CMS_RevocationInfoChoice; + + CMS_RecipientInfo_st = type Pointer; + CMS_RecipientInfo = CMS_RecipientInfo_st; + PCMS_RecipientInfo = ^CMS_RecipientInfo; + PPCMS_RecipientInfo = ^PCMS_RecipientInfo; + + CMS_ReceiptRequest_st = type Pointer; + CMS_ReceiptRequest = CMS_ReceiptRequest_st; + PCMS_ReceiptRequest = ^CMS_ReceiptRequest; + PPCMS_ReceiptRequest = ^PCMS_ReceiptRequest; + + CMS_Receipt_st = type Pointer; + CMS_Receipt = CMS_Receipt_st; + PCMS_Receipt = ^CMS_Receipt; + + CMS_RecipientEncryptedKey_st = type Pointer; + CMS_RecipientEncryptedKey = CMS_RecipientEncryptedKey_st; + PCMS_RecipientEncryptedKey = ^CMS_RecipientEncryptedKey; + + CMS_OtherKeyAttribute_st = type Pointer; + CMS_OtherKeyAttribute = CMS_OtherKeyAttribute_st; + PCMS_OtherKeyAttribute = ^CMS_OtherKeyAttribute; + PPCMS_OtherKeyAttribute = ^PCMS_OtherKeyAttribute; + +//DEFINE_STACK_OF(CMS_SignerInfo) +//DEFINE_STACK_OF(CMS_RecipientEncryptedKey) +//DEFINE_STACK_OF(CMS_RecipientInfo) +//DEFINE_STACK_OF(CMS_RevocationInfoChoice) +//DECLARE_ASN1_FUNCTIONS(CMS_ContentInfo) +//DECLARE_ASN1_FUNCTIONS(CMS_ReceiptRequest) +//DECLARE_ASN1_PRINT_FUNCTION(CMS_ContentInfo) + +const + CMS_SIGNERINFO_ISSUER_SERIAL = 0; + CMS_SIGNERINFO_KEYIDENTIFIER = 1; + + CMS_RECIPINFO_NONE = -1; + CMS_RECIPINFO_TRANS = 0; + CMS_RECIPINFO_AGREE = 1; + CMS_RECIPINFO_KEK = 2; + CMS_RECIPINFO_PASS = 3; + CMS_RECIPINFO_OTHER = 4; + +// S/MIME related flags / + + CMS_TEXT = $1; + CMS_NOCERTS = $2; + CMS_NO_CONTENT_VERIFY = $4; + CMS_NO_ATTR_VERIFY = $8; + CMS_NOSIGS = (CMS_NO_CONTENT_VERIFY or CMS_NO_ATTR_VERIFY); + CMS_NOINTERN = $10; + CMS_NO_SIGNER_CERT_VERIFY = $20; + CMS_NOVERIFY = $20; + CMS_DETACHED = $40; + CMS_BINARY = $80; + CMS_NOATTR = $100; + CMS_NOSMIMECAP = $200; + CMS_NOOLDMIMETYPE = $400; + CMS_CRLFEOL = $800; + CMS_STREAM_CONST = $1000; + CMS_NOCRL = $2000; + CMS_PARTIAL = $4000; + CMS_REUSE_DIGEST = $8000; + CMS_USE_KEYID = $10000; + CMS_DEBUG_DECRYPT = $20000; + CMS_KEY_PARAM = $40000; + CMS_ASCIICRLF = $80000; + + { The EXTERNALSYM directive is ignored by FPC, however, it is used by Delphi as follows: + + The EXTERNALSYM directive prevents the specified Delphi symbol from appearing in header + files generated for C++. } + + {$EXTERNALSYM CMS_get0_type} + {$EXTERNALSYM CMS_dataInit} + {$EXTERNALSYM CMS_dataFinal} + {$EXTERNALSYM CMS_get0_content} + {$EXTERNALSYM CMS_is_detached} + {$EXTERNALSYM CMS_set_detached} + {$EXTERNALSYM CMS_stream} + {$EXTERNALSYM d2i_CMS_bio} + {$EXTERNALSYM i2d_CMS_bio} + {$EXTERNALSYM BIO_new_CMS} + {$EXTERNALSYM i2d_CMS_bio_stream} + {$EXTERNALSYM PEM_write_bio_CMS_stream} + {$EXTERNALSYM SMIME_read_CMS} + {$EXTERNALSYM SMIME_write_CMS} + {$EXTERNALSYM CMS_final} + {$EXTERNALSYM CMS_data} + {$EXTERNALSYM CMS_data_create} + {$EXTERNALSYM CMS_digest_verify} + {$EXTERNALSYM CMS_digest_create} + {$EXTERNALSYM CMS_EncryptedData_decrypt} + {$EXTERNALSYM CMS_EncryptedData_encrypt} + {$EXTERNALSYM CMS_EncryptedData_set1_key} + {$EXTERNALSYM CMS_decrypt} + {$EXTERNALSYM CMS_decrypt_set1_pkey} + {$EXTERNALSYM CMS_decrypt_set1_key} + {$EXTERNALSYM CMS_decrypt_set1_password} + {$EXTERNALSYM CMS_RecipientInfo_type} + {$EXTERNALSYM CMS_RecipientInfo_get0_pkey_ctx} + {$EXTERNALSYM CMS_EnvelopedData_create} + {$EXTERNALSYM CMS_add1_recipient_cert} + {$EXTERNALSYM CMS_RecipientInfo_set0_pkey} + {$EXTERNALSYM CMS_RecipientInfo_ktri_cert_cmp} + {$EXTERNALSYM CMS_RecipientInfo_ktri_get0_algs} + {$EXTERNALSYM CMS_RecipientInfo_ktri_get0_signer_id} + {$EXTERNALSYM CMS_add0_recipient_key} + {$EXTERNALSYM CMS_RecipientInfo_kekri_get0_id} + {$EXTERNALSYM CMS_RecipientInfo_set0_key} + {$EXTERNALSYM CMS_RecipientInfo_kekri_id_cmp} + {$EXTERNALSYM CMS_RecipientInfo_set0_password} + {$EXTERNALSYM CMS_add0_recipient_password} + {$EXTERNALSYM CMS_RecipientInfo_decrypt} + {$EXTERNALSYM CMS_RecipientInfo_encrypt} + {$EXTERNALSYM CMS_uncompress} + {$EXTERNALSYM CMS_compress} + {$EXTERNALSYM CMS_set1_eContentType} + {$EXTERNALSYM CMS_get0_eContentType} + {$EXTERNALSYM CMS_add0_CertificateChoices} + {$EXTERNALSYM CMS_add0_cert} + {$EXTERNALSYM CMS_add1_cert} + {$EXTERNALSYM CMS_add0_RevocationInfoChoice} + {$EXTERNALSYM CMS_add0_crl} + {$EXTERNALSYM CMS_add1_crl} + {$EXTERNALSYM CMS_SignedData_init} + {$EXTERNALSYM CMS_add1_signer} + {$EXTERNALSYM CMS_SignerInfo_get0_pkey_ctx} + {$EXTERNALSYM CMS_SignerInfo_get0_md_ctx} + {$EXTERNALSYM CMS_SignerInfo_set1_signer_cert} + {$EXTERNALSYM CMS_SignerInfo_get0_signer_id} + {$EXTERNALSYM CMS_SignerInfo_cert_cmp} + {$EXTERNALSYM CMS_SignerInfo_get0_algs} + {$EXTERNALSYM CMS_SignerInfo_get0_signature} + {$EXTERNALSYM CMS_SignerInfo_sign} + {$EXTERNALSYM CMS_SignerInfo_verify} + {$EXTERNALSYM CMS_SignerInfo_verify_content} + {$EXTERNALSYM CMS_signed_get_attr_count} + {$EXTERNALSYM CMS_signed_get_attr_by_NID} + {$EXTERNALSYM CMS_signed_get_attr_by_OBJ} + {$EXTERNALSYM CMS_signed_get_attr} + {$EXTERNALSYM CMS_signed_delete_attr} + {$EXTERNALSYM CMS_signed_add1_attr} + {$EXTERNALSYM CMS_signed_add1_attr_by_OBJ} + {$EXTERNALSYM CMS_signed_add1_attr_by_NID} + {$EXTERNALSYM CMS_signed_add1_attr_by_txt} + {$EXTERNALSYM CMS_signed_get0_data_by_OBJ} + {$EXTERNALSYM CMS_unsigned_get_attr_count} + {$EXTERNALSYM CMS_unsigned_get_attr_by_NID} + {$EXTERNALSYM CMS_unsigned_get_attr_by_OBJ} + {$EXTERNALSYM CMS_unsigned_get_attr} + {$EXTERNALSYM CMS_unsigned_delete_attr} + {$EXTERNALSYM CMS_unsigned_add1_attr} + {$EXTERNALSYM CMS_unsigned_add1_attr_by_OBJ} + {$EXTERNALSYM CMS_unsigned_add1_attr_by_NID} + {$EXTERNALSYM CMS_unsigned_add1_attr_by_txt} + {$EXTERNALSYM CMS_unsigned_get0_data_by_OBJ} + {$EXTERNALSYM CMS_get1_ReceiptRequest} + {$EXTERNALSYM CMS_add1_ReceiptRequest} + {$EXTERNALSYM CMS_RecipientInfo_kari_get0_orig_id} + {$EXTERNALSYM CMS_RecipientInfo_kari_orig_id_cmp} + {$EXTERNALSYM CMS_RecipientEncryptedKey_get0_id} + {$EXTERNALSYM CMS_RecipientEncryptedKey_cert_cmp} + {$EXTERNALSYM CMS_RecipientInfo_kari_set0_pkey} + {$EXTERNALSYM CMS_RecipientInfo_kari_get0_ctx} + {$EXTERNALSYM CMS_RecipientInfo_kari_decrypt} + {$EXTERNALSYM CMS_SharedInfo_encode} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +var + CMS_get0_type: function (const cms: PCMS_ContentInfo): PASN1_OBJECT; cdecl = nil; + + CMS_dataInit: function (cms: PCMS_ContentInfo; icont: PBIO): PBIO; cdecl = nil; + CMS_dataFinal: function (cms: PCMS_ContentInfo; bio: PBIO): TIdC_INT; cdecl = nil; + + CMS_get0_content: function (cms: PCMS_ContentInfo): PPASN1_OCTET_STRING; cdecl = nil; + CMS_is_detached: function (cms: PCMS_ContentInfo): TIdC_INT; cdecl = nil; + CMS_set_detached: function (cms: PCMS_ContentInfo; detached: TIdC_INT): TIdC_INT; cdecl = nil; + + CMS_stream: function (cms: PCMS_ContentInfo; boundary: PPPByte): TIdC_INT; cdecl = nil; + d2i_CMS_bio: function (bp: PBIO; cms: PPCMS_ContentInfo): PCMS_ContentInfo; cdecl = nil; + i2d_CMS_bio: function (bp: PBIO; cms: PCMS_ContentInfo): TIdC_INT; cdecl = nil; + + BIO_new_CMS: function (out_: PBIO; cms: PCMS_ContentInfo): PBIO; cdecl = nil; + i2d_CMS_bio_stream: function (out_: PBIO; cms: PCMS_ContentInfo; in_: PBIO; flags: TIdC_INT): TIdC_INT; cdecl = nil; + PEM_write_bio_CMS_stream: function (out_: PBIO; cms: PCMS_ContentInfo; in_: PBIO; flags: TIdC_INT): TIdC_INT; cdecl = nil; + SMIME_read_CMS: function (bio: PBIO; bcont: PPBIO): PCMS_ContentInfo; cdecl = nil; + SMIME_write_CMS: function (bio: PBIO; cms: PCMS_ContentInfo; data: PBIO; flags: TIdC_INT): TIdC_INT; cdecl = nil; + + CMS_final: function (cms: PCMS_ContentInfo; data: PBIO; dcont: PBIO; flags: TIdC_UINT): TIdC_INT; cdecl = nil; + +// function CMS_sign(signcert: PX509; pkey: PEVP_PKEY; {STACK_OF(x509) *certs;} data: PBIO; flags: TIdC_UINT): PCMS_ContentInfo; + +// function CMS_sign_receipt(si: PCMS_SignerInfo; signcert: PX509; pkey: PEVP_PKEY; {STACK_OF(X509) *certs;} flags: TIdC_UINT): PCMS_ContentInfo; + + CMS_data: function (cms: PCMS_ContentInfo; out_: PBIO; flags: TIdC_UINT): TIdC_INT; cdecl = nil; + CMS_data_create: function (in_: PBIO; flags: TIdC_UINT): PCMS_ContentInfo; cdecl = nil; + + CMS_digest_verify: function (cms: PCMS_ContentInfo; dcont: PBIO; out_: PBIO; flags: TIdC_UINT): TIdC_INT; cdecl = nil; + CMS_digest_create: function (in_: PBIO; const md: PEVP_MD; flags: TIdC_UINT): PCMS_ContentInfo; cdecl = nil; + + CMS_EncryptedData_decrypt: function (cms: PCMS_ContentInfo; const key: PByte; keylen: TIdC_SIZET; dcont: PBIO; out_: PBIO; flags: TIdC_UINT): TIdC_INT; cdecl = nil; + + CMS_EncryptedData_encrypt: function (in_: PBIO; const cipher: PEVP_CIPHER; const key: PByte; keylen: TIdC_SIZET; flags: TIdC_UINT): PCMS_ContentInfo; cdecl = nil; + + CMS_EncryptedData_set1_key: function (cms: PCMS_ContentInfo; const ciph: PEVP_CIPHER; const key: PByte; keylen: TIdC_SIZET): TIdC_INT; cdecl = nil; + +// function CMS_verify(cms: PCMS_ContentInfo; {STACK_OF(X509) *certs;} store: PX509_STORE; dcont: PBIO; out_: PBIO; flags: TIdC_UINT): TIdC_INT; + +// function CMS_verify_receipt(rcms: PCMS_ContentInfo; ocms: PCMS_ContentInfo; {STACK_OF(x509) *certs;} store: PX509_STORE; flags: TIdC_UINT): TIdC_INT; + + // STACK_OF(X509) *CMS_get0_signers(CMS_ContentInfo *cms); + +// function CMS_encrypt({STACK_OF(x509) *certs;} in_: PBIO; const cipher: PEVP_CIPHER; flags: TIdC_UINT): PCMS_ContentInfo; + + CMS_decrypt: function (cms: PCMS_ContentInfo; pkey: PEVP_PKEY; cert: PX509; dcont: PBIO; out_: PBIO; flags: TIdC_UINT): TIdC_INT; cdecl = nil; + + CMS_decrypt_set1_pkey: function (cms: PCMS_ContentInfo; pk: PEVP_PKEY; cert: PX509): TIdC_INT; cdecl = nil; + CMS_decrypt_set1_key: function (cms: PCMS_ContentInfo; key: PByte; keylen: TIdC_SIZET; const id: PByte; idlen: TIdC_SIZET): TIdC_INT; cdecl = nil; + CMS_decrypt_set1_password: function (cms: PCMS_ContentInfo; pass: PByte; passlen: ossl_ssize_t): TIdC_INT; cdecl = nil; + + //STACK_OF(CMS_RecipientInfo) *CMS_get0_RecipientInfos(CMS_ContentInfo *cms); + CMS_RecipientInfo_type: function (ri: PCMS_RecipientInfo): TIdC_INT; cdecl = nil; + CMS_RecipientInfo_get0_pkey_ctx: function (ri: PCMS_RecipientInfo): PEVP_PKEY_CTX; cdecl = nil; + CMS_EnvelopedData_create: function (const cipher: PEVP_CIPHER): PCMS_ContentInfo; cdecl = nil; + CMS_add1_recipient_cert: function (cms: PCMS_ContentInfo; recip: PX509; flags: TIdC_UINT): PCMS_RecipientInfo; cdecl = nil; + CMS_RecipientInfo_set0_pkey: function (ri: PCMS_RecipientInfo; pkey: PEVP_PKEY): TIdC_INT; cdecl = nil; + CMS_RecipientInfo_ktri_cert_cmp: function (ri: PCMS_RecipientInfo; cert: PX509): TIdC_INT; cdecl = nil; + CMS_RecipientInfo_ktri_get0_algs: function (ri: PCMS_RecipientInfo; pk: PPEVP_PKEY; recip: PPX509; palg: PPX509_ALGOR): TIdC_INT; cdecl = nil; + CMS_RecipientInfo_ktri_get0_signer_id: function (ri: PPCMS_RecipientInfo; keyid: PPASN1_OCTET_STRING; issuer: PPX509_NAME; sno: PPASN1_INTEGER): TIdC_INT; cdecl = nil; + + CMS_add0_recipient_key: function (cms: PCMS_ContentInfo; nid: TIdC_INT; key: PByte; keylen: TIdC_SIZET; id: PByte; idlen: TIdC_SIZET; date: PASN1_GENERALIZEDTIME; otherTypeId: PASN1_OBJECT; otherType: ASN1_TYPE): PCMS_RecipientInfo; cdecl = nil; + + CMS_RecipientInfo_kekri_get0_id: function (ri: PCMS_RecipientInfo; palg: PPX509_ALGOR; pid: PPASN1_OCTET_STRING; pdate: PPASN1_GENERALIZEDTIME; potherid: PPASN1_OBJECT; pothertype: PASN1_TYPE): TIdC_INT; cdecl = nil; + + CMS_RecipientInfo_set0_key: function (ri: PCMS_RecipientInfo; key: PByte; keylen: TIdC_SIZET): TIdC_INT; cdecl = nil; + + CMS_RecipientInfo_kekri_id_cmp: function (ri: PCMS_RecipientInfo; const id: PByte; idlen: TIdC_SIZET): TIdC_INT; cdecl = nil; + + CMS_RecipientInfo_set0_password: function (ri: PCMS_RecipientInfo; pass: PByte; passlen: ossl_ssize_t): TIdC_INT; cdecl = nil; + + CMS_add0_recipient_password: function (cms: PCMS_ContentInfo; iter: TIdC_INT; wrap_nid: TIdC_INT; pbe_nid: TIdC_INT; pass: PByte; passlen: ossl_ssize_t; const kekciph: PEVP_CIPHER): PCMS_RecipientInfo; cdecl = nil; + + CMS_RecipientInfo_decrypt: function (cms: PCMS_ContentInfo; ri: PCMS_RecipientInfo): TIdC_INT; cdecl = nil; + CMS_RecipientInfo_encrypt: function (cms: PCMS_ContentInfo; ri: PCMS_RecipientInfo): TIdC_INT; cdecl = nil; + + CMS_uncompress: function (cms: PCMS_ContentInfo; dcont: PBIO; out_: PBIO; flags: TIdC_UINT): TIdC_INT; cdecl = nil; + CMS_compress: function (in_: PBIO; comp_nid: TIdC_INT; flags: TIdC_UINT): PCMS_ContentInfo; cdecl = nil; + + CMS_set1_eContentType: function (cms: CMS_ContentInfo; const oit: PASN1_OBJECT): TIdC_INT; cdecl = nil; + CMS_get0_eContentType: function (cms: PCMS_ContentInfo): PASN1_OBJECT; cdecl = nil; + + CMS_add0_CertificateChoices: function (cms: PCMS_ContentInfo): PCMS_CertificateChoices; cdecl = nil; + CMS_add0_cert: function (cms: PCMS_ContentInfo; cert: PX509): TIdC_INT; cdecl = nil; + CMS_add1_cert: function (cms: PCMS_ContentInfo; cert: PX509): TIdC_INT; cdecl = nil; + // STACK_OF(X509) *CMS_get1_certs(CMS_ContentInfo *cms); + + CMS_add0_RevocationInfoChoice: function (cms: PCMS_ContentInfo): PCMS_RevocationInfoChoice; cdecl = nil; + CMS_add0_crl: function (cms: PCMS_ContentInfo; crl: PX509_CRL): TIdC_INT; cdecl = nil; + CMS_add1_crl: function (cms: PCMS_ContentInfo; crl: PX509_CRL): TIdC_INT; cdecl = nil; + // STACK_OF(X509_CRL) *CMS_get1_crls(CMS_ContentInfo *cms); + + CMS_SignedData_init: function (cms: PCMS_ContentInfo): TIdC_INT; cdecl = nil; + CMS_add1_signer: function (cms: PCMS_ContentInfo; signer: PX509; pk: PEVP_PKEY; const md: PEVP_MD; flags: TIdC_UINT): PCMS_SignerInfo; cdecl = nil; + CMS_SignerInfo_get0_pkey_ctx: function (si: PCMS_SignerInfo): PEVP_PKEY_CTX; cdecl = nil; + CMS_SignerInfo_get0_md_ctx: function (si: PCMS_SignerInfo): PEVP_MD_CTX; cdecl = nil; + // STACK_OF(CMS_SignerInfo) *CMS_get0_SignerInfos(CMS_ContentInfo *cms); + + CMS_SignerInfo_set1_signer_cert: procedure (si: PCMS_SignerInfo; signer: PX509); cdecl = nil; + CMS_SignerInfo_get0_signer_id: function (si: PCMS_SignerInfo; keyid: PPASN1_OCTET_STRING; issuer: PPX509_NAME; sno: PPASN1_INTEGER): TIdC_INT; cdecl = nil; + CMS_SignerInfo_cert_cmp: function (si: PCMS_SignerInfo; cert: PX509): TIdC_INT; cdecl = nil; +// function CMS_set1_signers_certs(cms: PCMS_ContentInfo; {STACK_OF(X509) *certs;} flags: TIdC_UINT): TIdC_INT; + CMS_SignerInfo_get0_algs: procedure (si: PCMS_SignerInfo; pk: PPEVP_PKEY; signer: PPX509; pdig: PPX509_ALGOR; psig: PPX509_ALGOR); cdecl = nil; + CMS_SignerInfo_get0_signature: function (si: PCMS_SignerInfo): PASN1_OCTET_STRING; cdecl = nil; + CMS_SignerInfo_sign: function (si: PCMS_SignerInfo): TIdC_INT; cdecl = nil; + CMS_SignerInfo_verify: function (si: PCMS_SignerInfo): TIdC_INT; cdecl = nil; + CMS_SignerInfo_verify_content: function (si: PCMS_SignerInfo; chain: PBIO): TIdC_INT; cdecl = nil; + +// function CMS_add_smimecap(si: PCMS_SignerInfo{; STACK_OF(X509_ALGOR) *algs}): TIdC_INT; +// function CMS_add_simple_smimecap({STACK_OF(X509_ALGOR) **algs;} algnid: TIdC_INT; keysize: TIdC_INT): TIdC_INT; +// function CMS_add_standard_smimecap({STACK_OF(X509_ALGOR) **smcap}): TIdC_INT; + + CMS_signed_get_attr_count: function (const si: PCMS_SignerInfo): TIdC_INT; cdecl = nil; + CMS_signed_get_attr_by_NID: function (const si: PCMS_SignerInfo; nid: TIdC_INT; lastpos: TIdC_INT): TIdC_INT; cdecl = nil; + CMS_signed_get_attr_by_OBJ: function (const si: PCMS_SignerInfo; const obj: ASN1_OBJECT; lastpos: TIdC_INT): TIdC_INT; cdecl = nil; + CMS_signed_get_attr: function (const si: PCMS_SignerInfo; loc: TIdC_INT): PX509_ATTRIBUTE; cdecl = nil; + CMS_signed_delete_attr: function (const si: PCMS_SignerInfo; loc: TIdC_INT): PX509_ATTRIBUTE; cdecl = nil; + CMS_signed_add1_attr: function (si: PCMS_SignerInfo; loc: TIdC_INT): TIdC_INT; cdecl = nil; + CMS_signed_add1_attr_by_OBJ: function (si: PCMS_SignerInfo; const obj: PASN1_OBJECT; type_: TIdC_INT; const bytes: Pointer; len: TIdC_INT): TIdC_INT; cdecl = nil; + CMS_signed_add1_attr_by_NID: function (si: PCMS_SignerInfo; nid: TIdC_INT; type_: TIdC_INT; const bytes: Pointer; len: TIdC_INT): TIdC_INT; cdecl = nil; + CMS_signed_add1_attr_by_txt: function (si: PCMS_SignerInfo; const attrname: PAnsiChar; type_: TIdC_INT; const bytes: Pointer; len: TIdC_INT): TIdC_INT; cdecl = nil; + CMS_signed_get0_data_by_OBJ: function (si: PCMS_SignerInfo; const oid: PASN1_OBJECT; lastpos: TIdC_INT; type_: TIdC_INT): Pointer; cdecl = nil; + + CMS_unsigned_get_attr_count: function (const si: PCMS_SignerInfo): TIdC_INT; cdecl = nil; + CMS_unsigned_get_attr_by_NID: function (const si: PCMS_SignerInfo; nid: TIdC_INT; lastpos: TIdC_INT): TIdC_INT; cdecl = nil; + CMS_unsigned_get_attr_by_OBJ: function (const si: PCMS_SignerInfo; const obj: PASN1_OBJECT; lastpos: TIdC_INT): TIdC_INT; cdecl = nil; + CMS_unsigned_get_attr: function (const si: PCMS_SignerInfo; loc: TIdC_INT): PX509_ATTRIBUTE; cdecl = nil; + CMS_unsigned_delete_attr: function (si: PCMS_SignerInfo; loc: TIdC_INT): PX509_ATTRIBUTE; cdecl = nil; + CMS_unsigned_add1_attr: function (si: PCMS_SignerInfo; attr: PX509_ATTRIBUTE): TIdC_INT; cdecl = nil; + CMS_unsigned_add1_attr_by_OBJ: function (si: PCMS_SignerInfo; const obj: PASN1_OBJECT; type_: TIdC_INT; const bytes: Pointer; len: TIdC_INT): TIdC_INT; cdecl = nil; + CMS_unsigned_add1_attr_by_NID: function (si: PCMS_SignerInfo; nid: TIdC_INT; type_: TIdC_INT; const bytes: Pointer; len: TIdC_INT): TIdC_INT; cdecl = nil; + CMS_unsigned_add1_attr_by_txt: function (si: PCMS_SignerInfo; const attrname: PAnsiChar; type_: TIdC_INT; const bytes: Pointer; len: TIdC_INT): TIdC_INT; cdecl = nil; + CMS_unsigned_get0_data_by_OBJ: function (si: PCMS_SignerInfo; oid: PASN1_OBJECT; lastpos: TIdC_INT; type_: TIdC_INT): Pointer; cdecl = nil; + + CMS_get1_ReceiptRequest: function (si: PCMS_SignerInfo; prr: PPCMS_ReceiptRequest): TIdC_INT; cdecl = nil; +// function CMS_ReceiptRequest_create0(id: PByte; idlen: TIdC_INT; allorfirst: TIdC_INT +// {;STACK_OF(GENERAL_NAMES) *receiptList;} {STACK_OF(GENERAL_NAMES) *receiptsTo}): PCMS_ReceiptRequest; + CMS_add1_ReceiptRequest: function (si: PCMS_SignerInfo; rr: PCMS_ReceiptRequest): TIdC_INT; cdecl = nil; +// procedure CMS_ReceiptRequest_get0_values(rr: PCMS_ReceiptRequest; pcid: PPASN1_STRING; +// pallorfirst: PIdC_INT {;STACK_OF(GENERAL_NAMES) **plist;} +// {STACK_OF(GENERAL_NAMES) **prto}); +// function CMS_RecipientInfo_kari_get0_alg(ri: PCMS_RecipientInfo; palg: PPX509_ALGOR; +// pukm: PPASN1_OCTET_STRING): TIdC_INT; +// // STACK_OF(CMS_RecipientEncryptedKey) *CMS_RecipientInfo_kari_get0_reks(CMS_RecipientInfo *ri); + + CMS_RecipientInfo_kari_get0_orig_id: function (ri: PCMS_RecipientInfo; pubalg: PPX509_ALGOR; pubkey: PASN1_BIT_STRING; keyid: PPASN1_OCTET_STRING; issuer: PPX509_NAME; sno: PPASN1_INTEGER): TIdC_INT; cdecl = nil; + + CMS_RecipientInfo_kari_orig_id_cmp: function (ri: PCMS_RecipientInfo; cert: PX509): TIdC_INT; cdecl = nil; + + CMS_RecipientEncryptedKey_get0_id: function (rek: PCMS_RecipientEncryptedKey; keyid: PPASN1_OCTET_STRING; tm: PPASN1_GENERALIZEDTIME; other: PPCMS_OtherKeyAttribute; issuer: PPX509_NAME; sno: PPASN1_INTEGER): TIdC_INT; cdecl = nil; + CMS_RecipientEncryptedKey_cert_cmp: function (rek: PCMS_RecipientEncryptedKey; cert: PX509): TIdC_INT; cdecl = nil; + CMS_RecipientInfo_kari_set0_pkey: function (ri: PCMS_RecipientInfo; pk: PEVP_PKEY): TIdC_INT; cdecl = nil; + CMS_RecipientInfo_kari_get0_ctx: function (ri: PCMS_RecipientInfo): PEVP_CIPHER_CTX; cdecl = nil; + CMS_RecipientInfo_kari_decrypt: function (cms: PCMS_ContentInfo; ri: PCMS_RecipientInfo; rek: PCMS_RecipientEncryptedKey): TIdC_INT; cdecl = nil; + + CMS_SharedInfo_encode: function (pder: PPByte; kekalg: PX509_ALGOR; ukm: PASN1_OCTET_STRING; keylen: TIdC_INT): TIdC_INT; cdecl = nil; + + ///* Backward compatibility for spelling errors. */ + //# define CMS_R_UNKNOWN_DIGEST_ALGORITM CMS_R_UNKNOWN_DIGEST_ALGORITHM + //# define CMS_R_UNSUPPORTED_RECPIENTINFO_TYPE \ CMS_R_UNSUPPORTED_RECIPIENTINFO_TYPE + +{$ELSE} + function CMS_get0_type(const cms: PCMS_ContentInfo): PASN1_OBJECT cdecl; external CLibCrypto; + + function CMS_dataInit(cms: PCMS_ContentInfo; icont: PBIO): PBIO cdecl; external CLibCrypto; + function CMS_dataFinal(cms: PCMS_ContentInfo; bio: PBIO): TIdC_INT cdecl; external CLibCrypto; + + function CMS_get0_content(cms: PCMS_ContentInfo): PPASN1_OCTET_STRING cdecl; external CLibCrypto; + function CMS_is_detached(cms: PCMS_ContentInfo): TIdC_INT cdecl; external CLibCrypto; + function CMS_set_detached(cms: PCMS_ContentInfo; detached: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + + function CMS_stream(cms: PCMS_ContentInfo; boundary: PPPByte): TIdC_INT cdecl; external CLibCrypto; + function d2i_CMS_bio(bp: PBIO; cms: PPCMS_ContentInfo): PCMS_ContentInfo cdecl; external CLibCrypto; + function i2d_CMS_bio(bp: PBIO; cms: PCMS_ContentInfo): TIdC_INT cdecl; external CLibCrypto; + + function BIO_new_CMS(out_: PBIO; cms: PCMS_ContentInfo): PBIO cdecl; external CLibCrypto; + function i2d_CMS_bio_stream(out_: PBIO; cms: PCMS_ContentInfo; in_: PBIO; flags: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function PEM_write_bio_CMS_stream(out_: PBIO; cms: PCMS_ContentInfo; in_: PBIO; flags: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function SMIME_read_CMS(bio: PBIO; bcont: PPBIO): PCMS_ContentInfo cdecl; external CLibCrypto; + function SMIME_write_CMS(bio: PBIO; cms: PCMS_ContentInfo; data: PBIO; flags: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + + function CMS_final(cms: PCMS_ContentInfo; data: PBIO; dcont: PBIO; flags: TIdC_UINT): TIdC_INT cdecl; external CLibCrypto; + +// function CMS_sign(signcert: PX509; pkey: PEVP_PKEY; {STACK_OF(x509) *certs;} data: PBIO; flags: TIdC_UINT): PCMS_ContentInfo; + +// function CMS_sign_receipt(si: PCMS_SignerInfo; signcert: PX509; pkey: PEVP_PKEY; {STACK_OF(X509) *certs;} flags: TIdC_UINT): PCMS_ContentInfo; + + function CMS_data(cms: PCMS_ContentInfo; out_: PBIO; flags: TIdC_UINT): TIdC_INT cdecl; external CLibCrypto; + function CMS_data_create(in_: PBIO; flags: TIdC_UINT): PCMS_ContentInfo cdecl; external CLibCrypto; + + function CMS_digest_verify(cms: PCMS_ContentInfo; dcont: PBIO; out_: PBIO; flags: TIdC_UINT): TIdC_INT cdecl; external CLibCrypto; + function CMS_digest_create(in_: PBIO; const md: PEVP_MD; flags: TIdC_UINT): PCMS_ContentInfo cdecl; external CLibCrypto; + + function CMS_EncryptedData_decrypt(cms: PCMS_ContentInfo; const key: PByte; keylen: TIdC_SIZET; dcont: PBIO; out_: PBIO; flags: TIdC_UINT): TIdC_INT cdecl; external CLibCrypto; + + function CMS_EncryptedData_encrypt(in_: PBIO; const cipher: PEVP_CIPHER; const key: PByte; keylen: TIdC_SIZET; flags: TIdC_UINT): PCMS_ContentInfo cdecl; external CLibCrypto; + + function CMS_EncryptedData_set1_key(cms: PCMS_ContentInfo; const ciph: PEVP_CIPHER; const key: PByte; keylen: TIdC_SIZET): TIdC_INT cdecl; external CLibCrypto; + +// function CMS_verify(cms: PCMS_ContentInfo; {STACK_OF(X509) *certs;} store: PX509_STORE; dcont: PBIO; out_: PBIO; flags: TIdC_UINT): TIdC_INT; + +// function CMS_verify_receipt(rcms: PCMS_ContentInfo; ocms: PCMS_ContentInfo; {STACK_OF(x509) *certs;} store: PX509_STORE; flags: TIdC_UINT): TIdC_INT; + + // STACK_OF(X509) *CMS_get0_signers(CMS_ContentInfo *cms); + +// function CMS_encrypt({STACK_OF(x509) *certs;} in_: PBIO; const cipher: PEVP_CIPHER; flags: TIdC_UINT): PCMS_ContentInfo; + + function CMS_decrypt(cms: PCMS_ContentInfo; pkey: PEVP_PKEY; cert: PX509; dcont: PBIO; out_: PBIO; flags: TIdC_UINT): TIdC_INT cdecl; external CLibCrypto; + + function CMS_decrypt_set1_pkey(cms: PCMS_ContentInfo; pk: PEVP_PKEY; cert: PX509): TIdC_INT cdecl; external CLibCrypto; + function CMS_decrypt_set1_key(cms: PCMS_ContentInfo; key: PByte; keylen: TIdC_SIZET; const id: PByte; idlen: TIdC_SIZET): TIdC_INT cdecl; external CLibCrypto; + function CMS_decrypt_set1_password(cms: PCMS_ContentInfo; pass: PByte; passlen: ossl_ssize_t): TIdC_INT cdecl; external CLibCrypto; + + //STACK_OF(CMS_RecipientInfo) *CMS_get0_RecipientInfos(CMS_ContentInfo *cms); + function CMS_RecipientInfo_type(ri: PCMS_RecipientInfo): TIdC_INT cdecl; external CLibCrypto; + function CMS_RecipientInfo_get0_pkey_ctx(ri: PCMS_RecipientInfo): PEVP_PKEY_CTX cdecl; external CLibCrypto; + function CMS_EnvelopedData_create(const cipher: PEVP_CIPHER): PCMS_ContentInfo cdecl; external CLibCrypto; + function CMS_add1_recipient_cert(cms: PCMS_ContentInfo; recip: PX509; flags: TIdC_UINT): PCMS_RecipientInfo cdecl; external CLibCrypto; + function CMS_RecipientInfo_set0_pkey(ri: PCMS_RecipientInfo; pkey: PEVP_PKEY): TIdC_INT cdecl; external CLibCrypto; + function CMS_RecipientInfo_ktri_cert_cmp(ri: PCMS_RecipientInfo; cert: PX509): TIdC_INT cdecl; external CLibCrypto; + function CMS_RecipientInfo_ktri_get0_algs(ri: PCMS_RecipientInfo; pk: PPEVP_PKEY; recip: PPX509; palg: PPX509_ALGOR): TIdC_INT cdecl; external CLibCrypto; + function CMS_RecipientInfo_ktri_get0_signer_id(ri: PPCMS_RecipientInfo; keyid: PPASN1_OCTET_STRING; issuer: PPX509_NAME; sno: PPASN1_INTEGER): TIdC_INT cdecl; external CLibCrypto; + + function CMS_add0_recipient_key(cms: PCMS_ContentInfo; nid: TIdC_INT; key: PByte; keylen: TIdC_SIZET; id: PByte; idlen: TIdC_SIZET; date: PASN1_GENERALIZEDTIME; otherTypeId: PASN1_OBJECT; otherType: ASN1_TYPE): PCMS_RecipientInfo cdecl; external CLibCrypto; + + function CMS_RecipientInfo_kekri_get0_id(ri: PCMS_RecipientInfo; palg: PPX509_ALGOR; pid: PPASN1_OCTET_STRING; pdate: PPASN1_GENERALIZEDTIME; potherid: PPASN1_OBJECT; pothertype: PASN1_TYPE): TIdC_INT cdecl; external CLibCrypto; + + function CMS_RecipientInfo_set0_key(ri: PCMS_RecipientInfo; key: PByte; keylen: TIdC_SIZET): TIdC_INT cdecl; external CLibCrypto; + + function CMS_RecipientInfo_kekri_id_cmp(ri: PCMS_RecipientInfo; const id: PByte; idlen: TIdC_SIZET): TIdC_INT cdecl; external CLibCrypto; + + function CMS_RecipientInfo_set0_password(ri: PCMS_RecipientInfo; pass: PByte; passlen: ossl_ssize_t): TIdC_INT cdecl; external CLibCrypto; + + function CMS_add0_recipient_password(cms: PCMS_ContentInfo; iter: TIdC_INT; wrap_nid: TIdC_INT; pbe_nid: TIdC_INT; pass: PByte; passlen: ossl_ssize_t; const kekciph: PEVP_CIPHER): PCMS_RecipientInfo cdecl; external CLibCrypto; + + function CMS_RecipientInfo_decrypt(cms: PCMS_ContentInfo; ri: PCMS_RecipientInfo): TIdC_INT cdecl; external CLibCrypto; + function CMS_RecipientInfo_encrypt(cms: PCMS_ContentInfo; ri: PCMS_RecipientInfo): TIdC_INT cdecl; external CLibCrypto; + + function CMS_uncompress(cms: PCMS_ContentInfo; dcont: PBIO; out_: PBIO; flags: TIdC_UINT): TIdC_INT cdecl; external CLibCrypto; + function CMS_compress(in_: PBIO; comp_nid: TIdC_INT; flags: TIdC_UINT): PCMS_ContentInfo cdecl; external CLibCrypto; + + function CMS_set1_eContentType(cms: CMS_ContentInfo; const oit: PASN1_OBJECT): TIdC_INT cdecl; external CLibCrypto; + function CMS_get0_eContentType(cms: PCMS_ContentInfo): PASN1_OBJECT cdecl; external CLibCrypto; + + function CMS_add0_CertificateChoices(cms: PCMS_ContentInfo): PCMS_CertificateChoices cdecl; external CLibCrypto; + function CMS_add0_cert(cms: PCMS_ContentInfo; cert: PX509): TIdC_INT cdecl; external CLibCrypto; + function CMS_add1_cert(cms: PCMS_ContentInfo; cert: PX509): TIdC_INT cdecl; external CLibCrypto; + // STACK_OF(X509) *CMS_get1_certs(CMS_ContentInfo *cms); + + function CMS_add0_RevocationInfoChoice(cms: PCMS_ContentInfo): PCMS_RevocationInfoChoice cdecl; external CLibCrypto; + function CMS_add0_crl(cms: PCMS_ContentInfo; crl: PX509_CRL): TIdC_INT cdecl; external CLibCrypto; + function CMS_add1_crl(cms: PCMS_ContentInfo; crl: PX509_CRL): TIdC_INT cdecl; external CLibCrypto; + // STACK_OF(X509_CRL) *CMS_get1_crls(CMS_ContentInfo *cms); + + function CMS_SignedData_init(cms: PCMS_ContentInfo): TIdC_INT cdecl; external CLibCrypto; + function CMS_add1_signer(cms: PCMS_ContentInfo; signer: PX509; pk: PEVP_PKEY; const md: PEVP_MD; flags: TIdC_UINT): PCMS_SignerInfo cdecl; external CLibCrypto; + function CMS_SignerInfo_get0_pkey_ctx(si: PCMS_SignerInfo): PEVP_PKEY_CTX cdecl; external CLibCrypto; + function CMS_SignerInfo_get0_md_ctx(si: PCMS_SignerInfo): PEVP_MD_CTX cdecl; external CLibCrypto; + // STACK_OF(CMS_SignerInfo) *CMS_get0_SignerInfos(CMS_ContentInfo *cms); + + procedure CMS_SignerInfo_set1_signer_cert(si: PCMS_SignerInfo; signer: PX509) cdecl; external CLibCrypto; + function CMS_SignerInfo_get0_signer_id(si: PCMS_SignerInfo; keyid: PPASN1_OCTET_STRING; issuer: PPX509_NAME; sno: PPASN1_INTEGER): TIdC_INT cdecl; external CLibCrypto; + function CMS_SignerInfo_cert_cmp(si: PCMS_SignerInfo; cert: PX509): TIdC_INT cdecl; external CLibCrypto; +// function CMS_set1_signers_certs(cms: PCMS_ContentInfo; {STACK_OF(X509) *certs;} flags: TIdC_UINT): TIdC_INT; + procedure CMS_SignerInfo_get0_algs(si: PCMS_SignerInfo; pk: PPEVP_PKEY; signer: PPX509; pdig: PPX509_ALGOR; psig: PPX509_ALGOR) cdecl; external CLibCrypto; + function CMS_SignerInfo_get0_signature(si: PCMS_SignerInfo): PASN1_OCTET_STRING cdecl; external CLibCrypto; + function CMS_SignerInfo_sign(si: PCMS_SignerInfo): TIdC_INT cdecl; external CLibCrypto; + function CMS_SignerInfo_verify(si: PCMS_SignerInfo): TIdC_INT cdecl; external CLibCrypto; + function CMS_SignerInfo_verify_content(si: PCMS_SignerInfo; chain: PBIO): TIdC_INT cdecl; external CLibCrypto; + +// function CMS_add_smimecap(si: PCMS_SignerInfo{; STACK_OF(X509_ALGOR) *algs}): TIdC_INT; +// function CMS_add_simple_smimecap({STACK_OF(X509_ALGOR) **algs;} algnid: TIdC_INT; keysize: TIdC_INT): TIdC_INT; +// function CMS_add_standard_smimecap({STACK_OF(X509_ALGOR) **smcap}): TIdC_INT; + + function CMS_signed_get_attr_count(const si: PCMS_SignerInfo): TIdC_INT cdecl; external CLibCrypto; + function CMS_signed_get_attr_by_NID(const si: PCMS_SignerInfo; nid: TIdC_INT; lastpos: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function CMS_signed_get_attr_by_OBJ(const si: PCMS_SignerInfo; const obj: ASN1_OBJECT; lastpos: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function CMS_signed_get_attr(const si: PCMS_SignerInfo; loc: TIdC_INT): PX509_ATTRIBUTE cdecl; external CLibCrypto; + function CMS_signed_delete_attr(const si: PCMS_SignerInfo; loc: TIdC_INT): PX509_ATTRIBUTE cdecl; external CLibCrypto; + function CMS_signed_add1_attr(si: PCMS_SignerInfo; loc: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function CMS_signed_add1_attr_by_OBJ(si: PCMS_SignerInfo; const obj: PASN1_OBJECT; type_: TIdC_INT; const bytes: Pointer; len: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function CMS_signed_add1_attr_by_NID(si: PCMS_SignerInfo; nid: TIdC_INT; type_: TIdC_INT; const bytes: Pointer; len: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function CMS_signed_add1_attr_by_txt(si: PCMS_SignerInfo; const attrname: PAnsiChar; type_: TIdC_INT; const bytes: Pointer; len: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function CMS_signed_get0_data_by_OBJ(si: PCMS_SignerInfo; const oid: PASN1_OBJECT; lastpos: TIdC_INT; type_: TIdC_INT): Pointer cdecl; external CLibCrypto; + + function CMS_unsigned_get_attr_count(const si: PCMS_SignerInfo): TIdC_INT cdecl; external CLibCrypto; + function CMS_unsigned_get_attr_by_NID(const si: PCMS_SignerInfo; nid: TIdC_INT; lastpos: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function CMS_unsigned_get_attr_by_OBJ(const si: PCMS_SignerInfo; const obj: PASN1_OBJECT; lastpos: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function CMS_unsigned_get_attr(const si: PCMS_SignerInfo; loc: TIdC_INT): PX509_ATTRIBUTE cdecl; external CLibCrypto; + function CMS_unsigned_delete_attr(si: PCMS_SignerInfo; loc: TIdC_INT): PX509_ATTRIBUTE cdecl; external CLibCrypto; + function CMS_unsigned_add1_attr(si: PCMS_SignerInfo; attr: PX509_ATTRIBUTE): TIdC_INT cdecl; external CLibCrypto; + function CMS_unsigned_add1_attr_by_OBJ(si: PCMS_SignerInfo; const obj: PASN1_OBJECT; type_: TIdC_INT; const bytes: Pointer; len: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function CMS_unsigned_add1_attr_by_NID(si: PCMS_SignerInfo; nid: TIdC_INT; type_: TIdC_INT; const bytes: Pointer; len: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function CMS_unsigned_add1_attr_by_txt(si: PCMS_SignerInfo; const attrname: PAnsiChar; type_: TIdC_INT; const bytes: Pointer; len: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function CMS_unsigned_get0_data_by_OBJ(si: PCMS_SignerInfo; oid: PASN1_OBJECT; lastpos: TIdC_INT; type_: TIdC_INT): Pointer cdecl; external CLibCrypto; + + function CMS_get1_ReceiptRequest(si: PCMS_SignerInfo; prr: PPCMS_ReceiptRequest): TIdC_INT cdecl; external CLibCrypto; +// function CMS_ReceiptRequest_create0(id: PByte; idlen: TIdC_INT; allorfirst: TIdC_INT +// {;STACK_OF(GENERAL_NAMES) *receiptList;} {STACK_OF(GENERAL_NAMES) *receiptsTo}): PCMS_ReceiptRequest; + function CMS_add1_ReceiptRequest(si: PCMS_SignerInfo; rr: PCMS_ReceiptRequest): TIdC_INT cdecl; external CLibCrypto; +// procedure CMS_ReceiptRequest_get0_values(rr: PCMS_ReceiptRequest; pcid: PPASN1_STRING; +// pallorfirst: PIdC_INT {;STACK_OF(GENERAL_NAMES) **plist;} +// {STACK_OF(GENERAL_NAMES) **prto}); +// function CMS_RecipientInfo_kari_get0_alg(ri: PCMS_RecipientInfo; palg: PPX509_ALGOR; +// pukm: PPASN1_OCTET_STRING): TIdC_INT; +// // STACK_OF(CMS_RecipientEncryptedKey) *CMS_RecipientInfo_kari_get0_reks(CMS_RecipientInfo *ri); + + function CMS_RecipientInfo_kari_get0_orig_id(ri: PCMS_RecipientInfo; pubalg: PPX509_ALGOR; pubkey: PASN1_BIT_STRING; keyid: PPASN1_OCTET_STRING; issuer: PPX509_NAME; sno: PPASN1_INTEGER): TIdC_INT cdecl; external CLibCrypto; + + function CMS_RecipientInfo_kari_orig_id_cmp(ri: PCMS_RecipientInfo; cert: PX509): TIdC_INT cdecl; external CLibCrypto; + + function CMS_RecipientEncryptedKey_get0_id(rek: PCMS_RecipientEncryptedKey; keyid: PPASN1_OCTET_STRING; tm: PPASN1_GENERALIZEDTIME; other: PPCMS_OtherKeyAttribute; issuer: PPX509_NAME; sno: PPASN1_INTEGER): TIdC_INT cdecl; external CLibCrypto; + function CMS_RecipientEncryptedKey_cert_cmp(rek: PCMS_RecipientEncryptedKey; cert: PX509): TIdC_INT cdecl; external CLibCrypto; + function CMS_RecipientInfo_kari_set0_pkey(ri: PCMS_RecipientInfo; pk: PEVP_PKEY): TIdC_INT cdecl; external CLibCrypto; + function CMS_RecipientInfo_kari_get0_ctx(ri: PCMS_RecipientInfo): PEVP_CIPHER_CTX cdecl; external CLibCrypto; + function CMS_RecipientInfo_kari_decrypt(cms: PCMS_ContentInfo; ri: PCMS_RecipientInfo; rek: PCMS_RecipientEncryptedKey): TIdC_INT cdecl; external CLibCrypto; + + function CMS_SharedInfo_encode(pder: PPByte; kekalg: PX509_ALGOR; ukm: PASN1_OCTET_STRING; keylen: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + + ///* Backward compatibility for spelling errors. */ + //# define CMS_R_UNKNOWN_DIGEST_ALGORITM CMS_R_UNKNOWN_DIGEST_ALGORITHM + //# define CMS_R_UNSUPPORTED_RECPIENTINFO_TYPE \ CMS_R_UNSUPPORTED_RECIPIENTINFO_TYPE + +{$ENDIF} + +implementation + + uses + classes, + IdSSLOpenSSLExceptionHandlers, + IdResourceStringsOpenSSL + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + ,IdSSLOpenSSLLoader + {$ENDIF}; + + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +const + CMS_get0_type_procname = 'CMS_get0_type'; + + CMS_dataInit_procname = 'CMS_dataInit'; + CMS_dataFinal_procname = 'CMS_dataFinal'; + + CMS_get0_content_procname = 'CMS_get0_content'; + CMS_is_detached_procname = 'CMS_is_detached'; + CMS_set_detached_procname = 'CMS_set_detached'; + + CMS_stream_procname = 'CMS_stream'; + d2i_CMS_bio_procname = 'd2i_CMS_bio'; + i2d_CMS_bio_procname = 'i2d_CMS_bio'; + + BIO_new_CMS_procname = 'BIO_new_CMS'; + i2d_CMS_bio_stream_procname = 'i2d_CMS_bio_stream'; + PEM_write_bio_CMS_stream_procname = 'PEM_write_bio_CMS_stream'; + SMIME_read_CMS_procname = 'SMIME_read_CMS'; + SMIME_write_CMS_procname = 'SMIME_write_CMS'; + + CMS_final_procname = 'CMS_final'; + +// function CMS_sign(signcert: PX509; pkey: PEVP_PKEY; {STACK_OF(x509) *certs;} data: PBIO; flags: TIdC_UINT): PCMS_ContentInfo; + +// function CMS_sign_receipt(si: PCMS_SignerInfo; signcert: PX509; pkey: PEVP_PKEY; {STACK_OF(X509) *certs;} flags: TIdC_UINT): PCMS_ContentInfo; + + CMS_data_procname = 'CMS_data'; + CMS_data_create_procname = 'CMS_data_create'; + + CMS_digest_verify_procname = 'CMS_digest_verify'; + CMS_digest_create_procname = 'CMS_digest_create'; + + CMS_EncryptedData_decrypt_procname = 'CMS_EncryptedData_decrypt'; + + CMS_EncryptedData_encrypt_procname = 'CMS_EncryptedData_encrypt'; + + CMS_EncryptedData_set1_key_procname = 'CMS_EncryptedData_set1_key'; + +// function CMS_verify(cms: PCMS_ContentInfo; {STACK_OF(X509) *certs;} store: PX509_STORE; dcont: PBIO; out_: PBIO; flags: TIdC_UINT): TIdC_INT; + +// function CMS_verify_receipt(rcms: PCMS_ContentInfo; ocms: PCMS_ContentInfo; {STACK_OF(x509) *certs;} store: PX509_STORE; flags: TIdC_UINT): TIdC_INT; + + // STACK_OF(X509) *CMS_get0_signers(CMS_ContentInfo *cms); + +// function CMS_encrypt({STACK_OF(x509) *certs;} in_: PBIO; const cipher: PEVP_CIPHER; flags: TIdC_UINT): PCMS_ContentInfo; + + CMS_decrypt_procname = 'CMS_decrypt'; + + CMS_decrypt_set1_pkey_procname = 'CMS_decrypt_set1_pkey'; + CMS_decrypt_set1_key_procname = 'CMS_decrypt_set1_key'; + CMS_decrypt_set1_password_procname = 'CMS_decrypt_set1_password'; + + //STACK_OF(CMS_RecipientInfo) *CMS_get0_RecipientInfos(CMS_ContentInfo *cms); + CMS_RecipientInfo_type_procname = 'CMS_RecipientInfo_type'; + CMS_RecipientInfo_get0_pkey_ctx_procname = 'CMS_RecipientInfo_get0_pkey_ctx'; + CMS_EnvelopedData_create_procname = 'CMS_EnvelopedData_create'; + CMS_add1_recipient_cert_procname = 'CMS_add1_recipient_cert'; + CMS_RecipientInfo_set0_pkey_procname = 'CMS_RecipientInfo_set0_pkey'; + CMS_RecipientInfo_ktri_cert_cmp_procname = 'CMS_RecipientInfo_ktri_cert_cmp'; + CMS_RecipientInfo_ktri_get0_algs_procname = 'CMS_RecipientInfo_ktri_get0_algs'; + CMS_RecipientInfo_ktri_get0_signer_id_procname = 'CMS_RecipientInfo_ktri_get0_signer_id'; + + CMS_add0_recipient_key_procname = 'CMS_add0_recipient_key'; + + CMS_RecipientInfo_kekri_get0_id_procname = 'CMS_RecipientInfo_kekri_get0_id'; + + CMS_RecipientInfo_set0_key_procname = 'CMS_RecipientInfo_set0_key'; + + CMS_RecipientInfo_kekri_id_cmp_procname = 'CMS_RecipientInfo_kekri_id_cmp'; + + CMS_RecipientInfo_set0_password_procname = 'CMS_RecipientInfo_set0_password'; + + CMS_add0_recipient_password_procname = 'CMS_add0_recipient_password'; + + CMS_RecipientInfo_decrypt_procname = 'CMS_RecipientInfo_decrypt'; + CMS_RecipientInfo_encrypt_procname = 'CMS_RecipientInfo_encrypt'; + + CMS_uncompress_procname = 'CMS_uncompress'; + CMS_compress_procname = 'CMS_compress'; + + CMS_set1_eContentType_procname = 'CMS_set1_eContentType'; + CMS_get0_eContentType_procname = 'CMS_get0_eContentType'; + + CMS_add0_CertificateChoices_procname = 'CMS_add0_CertificateChoices'; + CMS_add0_cert_procname = 'CMS_add0_cert'; + CMS_add1_cert_procname = 'CMS_add1_cert'; + // STACK_OF(X509) *CMS_get1_certs(CMS_ContentInfo *cms); + + CMS_add0_RevocationInfoChoice_procname = 'CMS_add0_RevocationInfoChoice'; + CMS_add0_crl_procname = 'CMS_add0_crl'; + CMS_add1_crl_procname = 'CMS_add1_crl'; + // STACK_OF(X509_CRL) *CMS_get1_crls(CMS_ContentInfo *cms); + + CMS_SignedData_init_procname = 'CMS_SignedData_init'; + CMS_add1_signer_procname = 'CMS_add1_signer'; + CMS_SignerInfo_get0_pkey_ctx_procname = 'CMS_SignerInfo_get0_pkey_ctx'; + CMS_SignerInfo_get0_md_ctx_procname = 'CMS_SignerInfo_get0_md_ctx'; + // STACK_OF(CMS_SignerInfo) *CMS_get0_SignerInfos(CMS_ContentInfo *cms); + + CMS_SignerInfo_set1_signer_cert_procname = 'CMS_SignerInfo_set1_signer_cert'; + CMS_SignerInfo_get0_signer_id_procname = 'CMS_SignerInfo_get0_signer_id'; + CMS_SignerInfo_cert_cmp_procname = 'CMS_SignerInfo_cert_cmp'; +// function CMS_set1_signers_certs(cms: PCMS_ContentInfo; {STACK_OF(X509) *certs;} flags: TIdC_UINT): TIdC_INT; + CMS_SignerInfo_get0_algs_procname = 'CMS_SignerInfo_get0_algs'; + CMS_SignerInfo_get0_signature_procname = 'CMS_SignerInfo_get0_signature'; + CMS_SignerInfo_sign_procname = 'CMS_SignerInfo_sign'; + CMS_SignerInfo_verify_procname = 'CMS_SignerInfo_verify'; + CMS_SignerInfo_verify_content_procname = 'CMS_SignerInfo_verify_content'; + +// function CMS_add_smimecap(si: PCMS_SignerInfo{; STACK_OF(X509_ALGOR) *algs}): TIdC_INT; +// function CMS_add_simple_smimecap({STACK_OF(X509_ALGOR) **algs;} algnid: TIdC_INT; keysize: TIdC_INT): TIdC_INT; +// function CMS_add_standard_smimecap({STACK_OF(X509_ALGOR) **smcap}): TIdC_INT; + + CMS_signed_get_attr_count_procname = 'CMS_signed_get_attr_count'; + CMS_signed_get_attr_by_NID_procname = 'CMS_signed_get_attr_by_NID'; + CMS_signed_get_attr_by_OBJ_procname = 'CMS_signed_get_attr_by_OBJ'; + CMS_signed_get_attr_procname = 'CMS_signed_get_attr'; + CMS_signed_delete_attr_procname = 'CMS_signed_delete_attr'; + CMS_signed_add1_attr_procname = 'CMS_signed_add1_attr'; + CMS_signed_add1_attr_by_OBJ_procname = 'CMS_signed_add1_attr_by_OBJ'; + CMS_signed_add1_attr_by_NID_procname = 'CMS_signed_add1_attr_by_NID'; + CMS_signed_add1_attr_by_txt_procname = 'CMS_signed_add1_attr_by_txt'; + CMS_signed_get0_data_by_OBJ_procname = 'CMS_signed_get0_data_by_OBJ'; + + CMS_unsigned_get_attr_count_procname = 'CMS_unsigned_get_attr_count'; + CMS_unsigned_get_attr_by_NID_procname = 'CMS_unsigned_get_attr_by_NID'; + CMS_unsigned_get_attr_by_OBJ_procname = 'CMS_unsigned_get_attr_by_OBJ'; + CMS_unsigned_get_attr_procname = 'CMS_unsigned_get_attr'; + CMS_unsigned_delete_attr_procname = 'CMS_unsigned_delete_attr'; + CMS_unsigned_add1_attr_procname = 'CMS_unsigned_add1_attr'; + CMS_unsigned_add1_attr_by_OBJ_procname = 'CMS_unsigned_add1_attr_by_OBJ'; + CMS_unsigned_add1_attr_by_NID_procname = 'CMS_unsigned_add1_attr_by_NID'; + CMS_unsigned_add1_attr_by_txt_procname = 'CMS_unsigned_add1_attr_by_txt'; + CMS_unsigned_get0_data_by_OBJ_procname = 'CMS_unsigned_get0_data_by_OBJ'; + + CMS_get1_ReceiptRequest_procname = 'CMS_get1_ReceiptRequest'; +// function CMS_ReceiptRequest_create0(id: PByte; idlen: TIdC_INT; allorfirst: TIdC_INT +// {;STACK_OF(GENERAL_NAMES) *receiptList;} {STACK_OF(GENERAL_NAMES) *receiptsTo}): PCMS_ReceiptRequest; + CMS_add1_ReceiptRequest_procname = 'CMS_add1_ReceiptRequest'; +// procedure CMS_ReceiptRequest_get0_values(rr: PCMS_ReceiptRequest; pcid: PPASN1_STRING; +// pallorfirst: PIdC_INT {;STACK_OF(GENERAL_NAMES) **plist;} +// {STACK_OF(GENERAL_NAMES) **prto}); +// function CMS_RecipientInfo_kari_get0_alg(ri: PCMS_RecipientInfo; palg: PPX509_ALGOR; +// pukm: PPASN1_OCTET_STRING): TIdC_INT; +// // STACK_OF(CMS_RecipientEncryptedKey) *CMS_RecipientInfo_kari_get0_reks(CMS_RecipientInfo *ri); + + CMS_RecipientInfo_kari_get0_orig_id_procname = 'CMS_RecipientInfo_kari_get0_orig_id'; + + CMS_RecipientInfo_kari_orig_id_cmp_procname = 'CMS_RecipientInfo_kari_orig_id_cmp'; + + CMS_RecipientEncryptedKey_get0_id_procname = 'CMS_RecipientEncryptedKey_get0_id'; + CMS_RecipientEncryptedKey_cert_cmp_procname = 'CMS_RecipientEncryptedKey_cert_cmp'; + CMS_RecipientInfo_kari_set0_pkey_procname = 'CMS_RecipientInfo_kari_set0_pkey'; + CMS_RecipientInfo_kari_get0_ctx_procname = 'CMS_RecipientInfo_kari_get0_ctx'; + CMS_RecipientInfo_kari_decrypt_procname = 'CMS_RecipientInfo_kari_decrypt'; + + CMS_SharedInfo_encode_procname = 'CMS_SharedInfo_encode'; + + ///* Backward compatibility for spelling errors. */ + //# define CMS_R_UNKNOWN_DIGEST_ALGORITM CMS_R_UNKNOWN_DIGEST_ALGORITHM + //# define CMS_R_UNSUPPORTED_RECPIENTINFO_TYPE \ CMS_R_UNSUPPORTED_RECIPIENTINFO_TYPE + + +{$WARN NO_RETVAL OFF} +function ERR_CMS_get0_type(const cms: PCMS_ContentInfo): PASN1_OBJECT; +begin + EIdAPIFunctionNotPresent.RaiseException(CMS_get0_type_procname); +end; + + + +function ERR_CMS_dataInit(cms: PCMS_ContentInfo; icont: PBIO): PBIO; +begin + EIdAPIFunctionNotPresent.RaiseException(CMS_dataInit_procname); +end; + + +function ERR_CMS_dataFinal(cms: PCMS_ContentInfo; bio: PBIO): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(CMS_dataFinal_procname); +end; + + + +function ERR_CMS_get0_content(cms: PCMS_ContentInfo): PPASN1_OCTET_STRING; +begin + EIdAPIFunctionNotPresent.RaiseException(CMS_get0_content_procname); +end; + + +function ERR_CMS_is_detached(cms: PCMS_ContentInfo): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(CMS_is_detached_procname); +end; + + +function ERR_CMS_set_detached(cms: PCMS_ContentInfo; detached: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(CMS_set_detached_procname); +end; + + + +function ERR_CMS_stream(cms: PCMS_ContentInfo; boundary: PPPByte): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(CMS_stream_procname); +end; + + +function ERR_d2i_CMS_bio(bp: PBIO; cms: PPCMS_ContentInfo): PCMS_ContentInfo; +begin + EIdAPIFunctionNotPresent.RaiseException(d2i_CMS_bio_procname); +end; + + +function ERR_i2d_CMS_bio(bp: PBIO; cms: PCMS_ContentInfo): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(i2d_CMS_bio_procname); +end; + + + +function ERR_BIO_new_CMS(out_: PBIO; cms: PCMS_ContentInfo): PBIO; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_new_CMS_procname); +end; + + +function ERR_i2d_CMS_bio_stream(out_: PBIO; cms: PCMS_ContentInfo; in_: PBIO; flags: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(i2d_CMS_bio_stream_procname); +end; + + +function ERR_PEM_write_bio_CMS_stream(out_: PBIO; cms: PCMS_ContentInfo; in_: PBIO; flags: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(PEM_write_bio_CMS_stream_procname); +end; + + +function ERR_SMIME_read_CMS(bio: PBIO; bcont: PPBIO): PCMS_ContentInfo; +begin + EIdAPIFunctionNotPresent.RaiseException(SMIME_read_CMS_procname); +end; + + +function ERR_SMIME_write_CMS(bio: PBIO; cms: PCMS_ContentInfo; data: PBIO; flags: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SMIME_write_CMS_procname); +end; + + + +function ERR_CMS_final(cms: PCMS_ContentInfo; data: PBIO; dcont: PBIO; flags: TIdC_UINT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(CMS_final_procname); +end; + + + +// function CMS_sign(signcert: PX509; pkey: PEVP_PKEY; {STACK_OF(x509) *certs;} data: PBIO; flags: TIdC_UINT): PCMS_ContentInfo; + +// function CMS_sign_receipt(si: PCMS_SignerInfo; signcert: PX509; pkey: PEVP_PKEY; {STACK_OF(X509) *certs;} flags: TIdC_UINT): PCMS_ContentInfo; + +function ERR_CMS_data(cms: PCMS_ContentInfo; out_: PBIO; flags: TIdC_UINT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(CMS_data_procname); +end; + + +function ERR_CMS_data_create(in_: PBIO; flags: TIdC_UINT): PCMS_ContentInfo; +begin + EIdAPIFunctionNotPresent.RaiseException(CMS_data_create_procname); +end; + + + +function ERR_CMS_digest_verify(cms: PCMS_ContentInfo; dcont: PBIO; out_: PBIO; flags: TIdC_UINT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(CMS_digest_verify_procname); +end; + + +function ERR_CMS_digest_create(in_: PBIO; const md: PEVP_MD; flags: TIdC_UINT): PCMS_ContentInfo; +begin + EIdAPIFunctionNotPresent.RaiseException(CMS_digest_create_procname); +end; + + + +function ERR_CMS_EncryptedData_decrypt(cms: PCMS_ContentInfo; const key: PByte; keylen: TIdC_SIZET; dcont: PBIO; out_: PBIO; flags: TIdC_UINT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(CMS_EncryptedData_decrypt_procname); +end; + + + +function ERR_CMS_EncryptedData_encrypt(in_: PBIO; const cipher: PEVP_CIPHER; const key: PByte; keylen: TIdC_SIZET; flags: TIdC_UINT): PCMS_ContentInfo; +begin + EIdAPIFunctionNotPresent.RaiseException(CMS_EncryptedData_encrypt_procname); +end; + + + +function ERR_CMS_EncryptedData_set1_key(cms: PCMS_ContentInfo; const ciph: PEVP_CIPHER; const key: PByte; keylen: TIdC_SIZET): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(CMS_EncryptedData_set1_key_procname); +end; + + + +// function CMS_verify(cms: PCMS_ContentInfo; {STACK_OF(X509) *certs;} store: PX509_STORE; dcont: PBIO; out_: PBIO; flags: TIdC_UINT): TIdC_INT; + +// function CMS_verify_receipt(rcms: PCMS_ContentInfo; ocms: PCMS_ContentInfo; {STACK_OF(x509) *certs;} store: PX509_STORE; flags: TIdC_UINT): TIdC_INT; + + // STACK_OF(X509) *CMS_get0_signers(CMS_ContentInfo *cms); + +// function CMS_encrypt({STACK_OF(x509) *certs;} in_: PBIO; const cipher: PEVP_CIPHER; flags: TIdC_UINT): PCMS_ContentInfo; + +function ERR_CMS_decrypt(cms: PCMS_ContentInfo; pkey: PEVP_PKEY; cert: PX509; dcont: PBIO; out_: PBIO; flags: TIdC_UINT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(CMS_decrypt_procname); +end; + + + +function ERR_CMS_decrypt_set1_pkey(cms: PCMS_ContentInfo; pk: PEVP_PKEY; cert: PX509): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(CMS_decrypt_set1_pkey_procname); +end; + + +function ERR_CMS_decrypt_set1_key(cms: PCMS_ContentInfo; key: PByte; keylen: TIdC_SIZET; const id: PByte; idlen: TIdC_SIZET): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(CMS_decrypt_set1_key_procname); +end; + + +function ERR_CMS_decrypt_set1_password(cms: PCMS_ContentInfo; pass: PByte; passlen: ossl_ssize_t): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(CMS_decrypt_set1_password_procname); +end; + + + + //STACK_OF(CMS_RecipientInfo) *CMS_get0_RecipientInfos(CMS_ContentInfo *cms); +function ERR_CMS_RecipientInfo_type(ri: PCMS_RecipientInfo): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(CMS_RecipientInfo_type_procname); +end; + + +function ERR_CMS_RecipientInfo_get0_pkey_ctx(ri: PCMS_RecipientInfo): PEVP_PKEY_CTX; +begin + EIdAPIFunctionNotPresent.RaiseException(CMS_RecipientInfo_get0_pkey_ctx_procname); +end; + + +function ERR_CMS_EnvelopedData_create(const cipher: PEVP_CIPHER): PCMS_ContentInfo; +begin + EIdAPIFunctionNotPresent.RaiseException(CMS_EnvelopedData_create_procname); +end; + + +function ERR_CMS_add1_recipient_cert(cms: PCMS_ContentInfo; recip: PX509; flags: TIdC_UINT): PCMS_RecipientInfo; +begin + EIdAPIFunctionNotPresent.RaiseException(CMS_add1_recipient_cert_procname); +end; + + +function ERR_CMS_RecipientInfo_set0_pkey(ri: PCMS_RecipientInfo; pkey: PEVP_PKEY): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(CMS_RecipientInfo_set0_pkey_procname); +end; + + +function ERR_CMS_RecipientInfo_ktri_cert_cmp(ri: PCMS_RecipientInfo; cert: PX509): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(CMS_RecipientInfo_ktri_cert_cmp_procname); +end; + + +function ERR_CMS_RecipientInfo_ktri_get0_algs(ri: PCMS_RecipientInfo; pk: PPEVP_PKEY; recip: PPX509; palg: PPX509_ALGOR): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(CMS_RecipientInfo_ktri_get0_algs_procname); +end; + + +function ERR_CMS_RecipientInfo_ktri_get0_signer_id(ri: PPCMS_RecipientInfo; keyid: PPASN1_OCTET_STRING; issuer: PPX509_NAME; sno: PPASN1_INTEGER): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(CMS_RecipientInfo_ktri_get0_signer_id_procname); +end; + + + +function ERR_CMS_add0_recipient_key(cms: PCMS_ContentInfo; nid: TIdC_INT; key: PByte; keylen: TIdC_SIZET; id: PByte; idlen: TIdC_SIZET; date: PASN1_GENERALIZEDTIME; otherTypeId: PASN1_OBJECT; otherType: ASN1_TYPE): PCMS_RecipientInfo; +begin + EIdAPIFunctionNotPresent.RaiseException(CMS_add0_recipient_key_procname); +end; + + + +function ERR_CMS_RecipientInfo_kekri_get0_id(ri: PCMS_RecipientInfo; palg: PPX509_ALGOR; pid: PPASN1_OCTET_STRING; pdate: PPASN1_GENERALIZEDTIME; potherid: PPASN1_OBJECT; pothertype: PASN1_TYPE): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(CMS_RecipientInfo_kekri_get0_id_procname); +end; + + + +function ERR_CMS_RecipientInfo_set0_key(ri: PCMS_RecipientInfo; key: PByte; keylen: TIdC_SIZET): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(CMS_RecipientInfo_set0_key_procname); +end; + + + +function ERR_CMS_RecipientInfo_kekri_id_cmp(ri: PCMS_RecipientInfo; const id: PByte; idlen: TIdC_SIZET): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(CMS_RecipientInfo_kekri_id_cmp_procname); +end; + + + +function ERR_CMS_RecipientInfo_set0_password(ri: PCMS_RecipientInfo; pass: PByte; passlen: ossl_ssize_t): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(CMS_RecipientInfo_set0_password_procname); +end; + + + +function ERR_CMS_add0_recipient_password(cms: PCMS_ContentInfo; iter: TIdC_INT; wrap_nid: TIdC_INT; pbe_nid: TIdC_INT; pass: PByte; passlen: ossl_ssize_t; const kekciph: PEVP_CIPHER): PCMS_RecipientInfo; +begin + EIdAPIFunctionNotPresent.RaiseException(CMS_add0_recipient_password_procname); +end; + + + +function ERR_CMS_RecipientInfo_decrypt(cms: PCMS_ContentInfo; ri: PCMS_RecipientInfo): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(CMS_RecipientInfo_decrypt_procname); +end; + + +function ERR_CMS_RecipientInfo_encrypt(cms: PCMS_ContentInfo; ri: PCMS_RecipientInfo): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(CMS_RecipientInfo_encrypt_procname); +end; + + + +function ERR_CMS_uncompress(cms: PCMS_ContentInfo; dcont: PBIO; out_: PBIO; flags: TIdC_UINT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(CMS_uncompress_procname); +end; + + +function ERR_CMS_compress(in_: PBIO; comp_nid: TIdC_INT; flags: TIdC_UINT): PCMS_ContentInfo; +begin + EIdAPIFunctionNotPresent.RaiseException(CMS_compress_procname); +end; + + + +function ERR_CMS_set1_eContentType(cms: CMS_ContentInfo; const oit: PASN1_OBJECT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(CMS_set1_eContentType_procname); +end; + + +function ERR_CMS_get0_eContentType(cms: PCMS_ContentInfo): PASN1_OBJECT; +begin + EIdAPIFunctionNotPresent.RaiseException(CMS_get0_eContentType_procname); +end; + + + +function ERR_CMS_add0_CertificateChoices(cms: PCMS_ContentInfo): PCMS_CertificateChoices; +begin + EIdAPIFunctionNotPresent.RaiseException(CMS_add0_CertificateChoices_procname); +end; + + +function ERR_CMS_add0_cert(cms: PCMS_ContentInfo; cert: PX509): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(CMS_add0_cert_procname); +end; + + +function ERR_CMS_add1_cert(cms: PCMS_ContentInfo; cert: PX509): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(CMS_add1_cert_procname); +end; + + + // STACK_OF(X509) *CMS_get1_certs(CMS_ContentInfo *cms); + +function ERR_CMS_add0_RevocationInfoChoice(cms: PCMS_ContentInfo): PCMS_RevocationInfoChoice; +begin + EIdAPIFunctionNotPresent.RaiseException(CMS_add0_RevocationInfoChoice_procname); +end; + + +function ERR_CMS_add0_crl(cms: PCMS_ContentInfo; crl: PX509_CRL): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(CMS_add0_crl_procname); +end; + + +function ERR_CMS_add1_crl(cms: PCMS_ContentInfo; crl: PX509_CRL): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(CMS_add1_crl_procname); +end; + + + // STACK_OF(X509_CRL) *CMS_get1_crls(CMS_ContentInfo *cms); + +function ERR_CMS_SignedData_init(cms: PCMS_ContentInfo): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(CMS_SignedData_init_procname); +end; + + +function ERR_CMS_add1_signer(cms: PCMS_ContentInfo; signer: PX509; pk: PEVP_PKEY; const md: PEVP_MD; flags: TIdC_UINT): PCMS_SignerInfo; +begin + EIdAPIFunctionNotPresent.RaiseException(CMS_add1_signer_procname); +end; + + +function ERR_CMS_SignerInfo_get0_pkey_ctx(si: PCMS_SignerInfo): PEVP_PKEY_CTX; +begin + EIdAPIFunctionNotPresent.RaiseException(CMS_SignerInfo_get0_pkey_ctx_procname); +end; + + +function ERR_CMS_SignerInfo_get0_md_ctx(si: PCMS_SignerInfo): PEVP_MD_CTX; +begin + EIdAPIFunctionNotPresent.RaiseException(CMS_SignerInfo_get0_md_ctx_procname); +end; + + + // STACK_OF(CMS_SignerInfo) *CMS_get0_SignerInfos(CMS_ContentInfo *cms); + +procedure ERR_CMS_SignerInfo_set1_signer_cert(si: PCMS_SignerInfo; signer: PX509); +begin + EIdAPIFunctionNotPresent.RaiseException(CMS_SignerInfo_set1_signer_cert_procname); +end; + + +function ERR_CMS_SignerInfo_get0_signer_id(si: PCMS_SignerInfo; keyid: PPASN1_OCTET_STRING; issuer: PPX509_NAME; sno: PPASN1_INTEGER): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(CMS_SignerInfo_get0_signer_id_procname); +end; + + +function ERR_CMS_SignerInfo_cert_cmp(si: PCMS_SignerInfo; cert: PX509): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(CMS_SignerInfo_cert_cmp_procname); +end; + + +// function CMS_set1_signers_certs(cms: PCMS_ContentInfo; {STACK_OF(X509) *certs;} flags: TIdC_UINT): TIdC_INT; +procedure ERR_CMS_SignerInfo_get0_algs(si: PCMS_SignerInfo; pk: PPEVP_PKEY; signer: PPX509; pdig: PPX509_ALGOR; psig: PPX509_ALGOR); +begin + EIdAPIFunctionNotPresent.RaiseException(CMS_SignerInfo_get0_algs_procname); +end; + + +function ERR_CMS_SignerInfo_get0_signature(si: PCMS_SignerInfo): PASN1_OCTET_STRING; +begin + EIdAPIFunctionNotPresent.RaiseException(CMS_SignerInfo_get0_signature_procname); +end; + + +function ERR_CMS_SignerInfo_sign(si: PCMS_SignerInfo): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(CMS_SignerInfo_sign_procname); +end; + + +function ERR_CMS_SignerInfo_verify(si: PCMS_SignerInfo): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(CMS_SignerInfo_verify_procname); +end; + + +function ERR_CMS_SignerInfo_verify_content(si: PCMS_SignerInfo; chain: PBIO): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(CMS_SignerInfo_verify_content_procname); +end; + + + +// function CMS_add_smimecap(si: PCMS_SignerInfo{; STACK_OF(X509_ALGOR) *algs}): TIdC_INT; +// function CMS_add_simple_smimecap({STACK_OF(X509_ALGOR) **algs;} algnid: TIdC_INT; keysize: TIdC_INT): TIdC_INT; +// function CMS_add_standard_smimecap({STACK_OF(X509_ALGOR) **smcap}): TIdC_INT; + +function ERR_CMS_signed_get_attr_count(const si: PCMS_SignerInfo): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(CMS_signed_get_attr_count_procname); +end; + + +function ERR_CMS_signed_get_attr_by_NID(const si: PCMS_SignerInfo; nid: TIdC_INT; lastpos: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(CMS_signed_get_attr_by_NID_procname); +end; + + +function ERR_CMS_signed_get_attr_by_OBJ(const si: PCMS_SignerInfo; const obj: ASN1_OBJECT; lastpos: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(CMS_signed_get_attr_by_OBJ_procname); +end; + + +function ERR_CMS_signed_get_attr(const si: PCMS_SignerInfo; loc: TIdC_INT): PX509_ATTRIBUTE; +begin + EIdAPIFunctionNotPresent.RaiseException(CMS_signed_get_attr_procname); +end; + + +function ERR_CMS_signed_delete_attr(const si: PCMS_SignerInfo; loc: TIdC_INT): PX509_ATTRIBUTE; +begin + EIdAPIFunctionNotPresent.RaiseException(CMS_signed_delete_attr_procname); +end; + + +function ERR_CMS_signed_add1_attr(si: PCMS_SignerInfo; loc: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(CMS_signed_add1_attr_procname); +end; + + +function ERR_CMS_signed_add1_attr_by_OBJ(si: PCMS_SignerInfo; const obj: PASN1_OBJECT; type_: TIdC_INT; const bytes: Pointer; len: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(CMS_signed_add1_attr_by_OBJ_procname); +end; + + +function ERR_CMS_signed_add1_attr_by_NID(si: PCMS_SignerInfo; nid: TIdC_INT; type_: TIdC_INT; const bytes: Pointer; len: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(CMS_signed_add1_attr_by_NID_procname); +end; + + +function ERR_CMS_signed_add1_attr_by_txt(si: PCMS_SignerInfo; const attrname: PAnsiChar; type_: TIdC_INT; const bytes: Pointer; len: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(CMS_signed_add1_attr_by_txt_procname); +end; + + +function ERR_CMS_signed_get0_data_by_OBJ(si: PCMS_SignerInfo; const oid: PASN1_OBJECT; lastpos: TIdC_INT; type_: TIdC_INT): Pointer; +begin + EIdAPIFunctionNotPresent.RaiseException(CMS_signed_get0_data_by_OBJ_procname); +end; + + + +function ERR_CMS_unsigned_get_attr_count(const si: PCMS_SignerInfo): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(CMS_unsigned_get_attr_count_procname); +end; + + +function ERR_CMS_unsigned_get_attr_by_NID(const si: PCMS_SignerInfo; nid: TIdC_INT; lastpos: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(CMS_unsigned_get_attr_by_NID_procname); +end; + + +function ERR_CMS_unsigned_get_attr_by_OBJ(const si: PCMS_SignerInfo; const obj: PASN1_OBJECT; lastpos: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(CMS_unsigned_get_attr_by_OBJ_procname); +end; + + +function ERR_CMS_unsigned_get_attr(const si: PCMS_SignerInfo; loc: TIdC_INT): PX509_ATTRIBUTE; +begin + EIdAPIFunctionNotPresent.RaiseException(CMS_unsigned_get_attr_procname); +end; + + +function ERR_CMS_unsigned_delete_attr(si: PCMS_SignerInfo; loc: TIdC_INT): PX509_ATTRIBUTE; +begin + EIdAPIFunctionNotPresent.RaiseException(CMS_unsigned_delete_attr_procname); +end; + + +function ERR_CMS_unsigned_add1_attr(si: PCMS_SignerInfo; attr: PX509_ATTRIBUTE): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(CMS_unsigned_add1_attr_procname); +end; + + +function ERR_CMS_unsigned_add1_attr_by_OBJ(si: PCMS_SignerInfo; const obj: PASN1_OBJECT; type_: TIdC_INT; const bytes: Pointer; len: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(CMS_unsigned_add1_attr_by_OBJ_procname); +end; + + +function ERR_CMS_unsigned_add1_attr_by_NID(si: PCMS_SignerInfo; nid: TIdC_INT; type_: TIdC_INT; const bytes: Pointer; len: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(CMS_unsigned_add1_attr_by_NID_procname); +end; + + +function ERR_CMS_unsigned_add1_attr_by_txt(si: PCMS_SignerInfo; const attrname: PAnsiChar; type_: TIdC_INT; const bytes: Pointer; len: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(CMS_unsigned_add1_attr_by_txt_procname); +end; + + +function ERR_CMS_unsigned_get0_data_by_OBJ(si: PCMS_SignerInfo; oid: PASN1_OBJECT; lastpos: TIdC_INT; type_: TIdC_INT): Pointer; +begin + EIdAPIFunctionNotPresent.RaiseException(CMS_unsigned_get0_data_by_OBJ_procname); +end; + + + +function ERR_CMS_get1_ReceiptRequest(si: PCMS_SignerInfo; prr: PPCMS_ReceiptRequest): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(CMS_get1_ReceiptRequest_procname); +end; + + +// function CMS_ReceiptRequest_create0(id: PByte; idlen: TIdC_INT; allorfirst: TIdC_INT +// {;STACK_OF(GENERAL_NAMES) *receiptList;} {STACK_OF(GENERAL_NAMES) *receiptsTo}): PCMS_ReceiptRequest; +function ERR_CMS_add1_ReceiptRequest(si: PCMS_SignerInfo; rr: PCMS_ReceiptRequest): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(CMS_add1_ReceiptRequest_procname); +end; + + +// procedure CMS_ReceiptRequest_get0_values(rr: PCMS_ReceiptRequest; pcid: PPASN1_STRING; +// pallorfirst: PIdC_INT {;STACK_OF(GENERAL_NAMES) **plist;} +// {STACK_OF(GENERAL_NAMES) **prto}); +// function CMS_RecipientInfo_kari_get0_alg(ri: PCMS_RecipientInfo; palg: PPX509_ALGOR; +// pukm: PPASN1_OCTET_STRING): TIdC_INT; +// // STACK_OF(CMS_RecipientEncryptedKey) *CMS_RecipientInfo_kari_get0_reks(CMS_RecipientInfo *ri); + +function ERR_CMS_RecipientInfo_kari_get0_orig_id(ri: PCMS_RecipientInfo; pubalg: PPX509_ALGOR; pubkey: PASN1_BIT_STRING; keyid: PPASN1_OCTET_STRING; issuer: PPX509_NAME; sno: PPASN1_INTEGER): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(CMS_RecipientInfo_kari_get0_orig_id_procname); +end; + + + +function ERR_CMS_RecipientInfo_kari_orig_id_cmp(ri: PCMS_RecipientInfo; cert: PX509): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(CMS_RecipientInfo_kari_orig_id_cmp_procname); +end; + + + +function ERR_CMS_RecipientEncryptedKey_get0_id(rek: PCMS_RecipientEncryptedKey; keyid: PPASN1_OCTET_STRING; tm: PPASN1_GENERALIZEDTIME; other: PPCMS_OtherKeyAttribute; issuer: PPX509_NAME; sno: PPASN1_INTEGER): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(CMS_RecipientEncryptedKey_get0_id_procname); +end; + + +function ERR_CMS_RecipientEncryptedKey_cert_cmp(rek: PCMS_RecipientEncryptedKey; cert: PX509): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(CMS_RecipientEncryptedKey_cert_cmp_procname); +end; + + +function ERR_CMS_RecipientInfo_kari_set0_pkey(ri: PCMS_RecipientInfo; pk: PEVP_PKEY): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(CMS_RecipientInfo_kari_set0_pkey_procname); +end; + + +function ERR_CMS_RecipientInfo_kari_get0_ctx(ri: PCMS_RecipientInfo): PEVP_CIPHER_CTX; +begin + EIdAPIFunctionNotPresent.RaiseException(CMS_RecipientInfo_kari_get0_ctx_procname); +end; + + +function ERR_CMS_RecipientInfo_kari_decrypt(cms: PCMS_ContentInfo; ri: PCMS_RecipientInfo; rek: PCMS_RecipientEncryptedKey): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(CMS_RecipientInfo_kari_decrypt_procname); +end; + + + +function ERR_CMS_SharedInfo_encode(pder: PPByte; kekalg: PX509_ALGOR; ukm: PASN1_OCTET_STRING; keylen: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(CMS_SharedInfo_encode_procname); +end; + + + + ///* Backward compatibility for spelling errors. */ + //# define CMS_R_UNKNOWN_DIGEST_ALGORITM CMS_R_UNKNOWN_DIGEST_ALGORITHM + //# define CMS_R_UNSUPPORTED_RECPIENTINFO_TYPE \ CMS_R_UNSUPPORTED_RECIPIENTINFO_TYPE + +{$WARN NO_RETVAL ON} + +procedure Load(const ADllHandle: TIdLibHandle; LibVersion: TIdC_UINT; const AFailed: TStringList); + +var FuncLoadError: boolean; + +begin + CMS_get0_type := LoadLibFunction(ADllHandle, CMS_get0_type_procname); + FuncLoadError := not assigned(CMS_get0_type); + if FuncLoadError then + begin + {$if not defined(CMS_get0_type_allownil)} + CMS_get0_type := @ERR_CMS_get0_type; + {$ifend} + {$if declared(CMS_get0_type_introduced)} + if LibVersion < CMS_get0_type_introduced then + begin + {$if declared(FC_CMS_get0_type)} + CMS_get0_type := @FC_CMS_get0_type; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CMS_get0_type_removed)} + if CMS_get0_type_removed <= LibVersion then + begin + {$if declared(_CMS_get0_type)} + CMS_get0_type := @_CMS_get0_type; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CMS_get0_type_allownil)} + if FuncLoadError then + AFailed.Add('CMS_get0_type'); + {$ifend} + end; + + + CMS_dataInit := LoadLibFunction(ADllHandle, CMS_dataInit_procname); + FuncLoadError := not assigned(CMS_dataInit); + if FuncLoadError then + begin + {$if not defined(CMS_dataInit_allownil)} + CMS_dataInit := @ERR_CMS_dataInit; + {$ifend} + {$if declared(CMS_dataInit_introduced)} + if LibVersion < CMS_dataInit_introduced then + begin + {$if declared(FC_CMS_dataInit)} + CMS_dataInit := @FC_CMS_dataInit; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CMS_dataInit_removed)} + if CMS_dataInit_removed <= LibVersion then + begin + {$if declared(_CMS_dataInit)} + CMS_dataInit := @_CMS_dataInit; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CMS_dataInit_allownil)} + if FuncLoadError then + AFailed.Add('CMS_dataInit'); + {$ifend} + end; + + + CMS_dataFinal := LoadLibFunction(ADllHandle, CMS_dataFinal_procname); + FuncLoadError := not assigned(CMS_dataFinal); + if FuncLoadError then + begin + {$if not defined(CMS_dataFinal_allownil)} + CMS_dataFinal := @ERR_CMS_dataFinal; + {$ifend} + {$if declared(CMS_dataFinal_introduced)} + if LibVersion < CMS_dataFinal_introduced then + begin + {$if declared(FC_CMS_dataFinal)} + CMS_dataFinal := @FC_CMS_dataFinal; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CMS_dataFinal_removed)} + if CMS_dataFinal_removed <= LibVersion then + begin + {$if declared(_CMS_dataFinal)} + CMS_dataFinal := @_CMS_dataFinal; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CMS_dataFinal_allownil)} + if FuncLoadError then + AFailed.Add('CMS_dataFinal'); + {$ifend} + end; + + + CMS_get0_content := LoadLibFunction(ADllHandle, CMS_get0_content_procname); + FuncLoadError := not assigned(CMS_get0_content); + if FuncLoadError then + begin + {$if not defined(CMS_get0_content_allownil)} + CMS_get0_content := @ERR_CMS_get0_content; + {$ifend} + {$if declared(CMS_get0_content_introduced)} + if LibVersion < CMS_get0_content_introduced then + begin + {$if declared(FC_CMS_get0_content)} + CMS_get0_content := @FC_CMS_get0_content; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CMS_get0_content_removed)} + if CMS_get0_content_removed <= LibVersion then + begin + {$if declared(_CMS_get0_content)} + CMS_get0_content := @_CMS_get0_content; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CMS_get0_content_allownil)} + if FuncLoadError then + AFailed.Add('CMS_get0_content'); + {$ifend} + end; + + + CMS_is_detached := LoadLibFunction(ADllHandle, CMS_is_detached_procname); + FuncLoadError := not assigned(CMS_is_detached); + if FuncLoadError then + begin + {$if not defined(CMS_is_detached_allownil)} + CMS_is_detached := @ERR_CMS_is_detached; + {$ifend} + {$if declared(CMS_is_detached_introduced)} + if LibVersion < CMS_is_detached_introduced then + begin + {$if declared(FC_CMS_is_detached)} + CMS_is_detached := @FC_CMS_is_detached; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CMS_is_detached_removed)} + if CMS_is_detached_removed <= LibVersion then + begin + {$if declared(_CMS_is_detached)} + CMS_is_detached := @_CMS_is_detached; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CMS_is_detached_allownil)} + if FuncLoadError then + AFailed.Add('CMS_is_detached'); + {$ifend} + end; + + + CMS_set_detached := LoadLibFunction(ADllHandle, CMS_set_detached_procname); + FuncLoadError := not assigned(CMS_set_detached); + if FuncLoadError then + begin + {$if not defined(CMS_set_detached_allownil)} + CMS_set_detached := @ERR_CMS_set_detached; + {$ifend} + {$if declared(CMS_set_detached_introduced)} + if LibVersion < CMS_set_detached_introduced then + begin + {$if declared(FC_CMS_set_detached)} + CMS_set_detached := @FC_CMS_set_detached; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CMS_set_detached_removed)} + if CMS_set_detached_removed <= LibVersion then + begin + {$if declared(_CMS_set_detached)} + CMS_set_detached := @_CMS_set_detached; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CMS_set_detached_allownil)} + if FuncLoadError then + AFailed.Add('CMS_set_detached'); + {$ifend} + end; + + + CMS_stream := LoadLibFunction(ADllHandle, CMS_stream_procname); + FuncLoadError := not assigned(CMS_stream); + if FuncLoadError then + begin + {$if not defined(CMS_stream_allownil)} + CMS_stream := @ERR_CMS_stream; + {$ifend} + {$if declared(CMS_stream_introduced)} + if LibVersion < CMS_stream_introduced then + begin + {$if declared(FC_CMS_stream)} + CMS_stream := @FC_CMS_stream; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CMS_stream_removed)} + if CMS_stream_removed <= LibVersion then + begin + {$if declared(_CMS_stream)} + CMS_stream := @_CMS_stream; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CMS_stream_allownil)} + if FuncLoadError then + AFailed.Add('CMS_stream'); + {$ifend} + end; + + + d2i_CMS_bio := LoadLibFunction(ADllHandle, d2i_CMS_bio_procname); + FuncLoadError := not assigned(d2i_CMS_bio); + if FuncLoadError then + begin + {$if not defined(d2i_CMS_bio_allownil)} + d2i_CMS_bio := @ERR_d2i_CMS_bio; + {$ifend} + {$if declared(d2i_CMS_bio_introduced)} + if LibVersion < d2i_CMS_bio_introduced then + begin + {$if declared(FC_d2i_CMS_bio)} + d2i_CMS_bio := @FC_d2i_CMS_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(d2i_CMS_bio_removed)} + if d2i_CMS_bio_removed <= LibVersion then + begin + {$if declared(_d2i_CMS_bio)} + d2i_CMS_bio := @_d2i_CMS_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(d2i_CMS_bio_allownil)} + if FuncLoadError then + AFailed.Add('d2i_CMS_bio'); + {$ifend} + end; + + + i2d_CMS_bio := LoadLibFunction(ADllHandle, i2d_CMS_bio_procname); + FuncLoadError := not assigned(i2d_CMS_bio); + if FuncLoadError then + begin + {$if not defined(i2d_CMS_bio_allownil)} + i2d_CMS_bio := @ERR_i2d_CMS_bio; + {$ifend} + {$if declared(i2d_CMS_bio_introduced)} + if LibVersion < i2d_CMS_bio_introduced then + begin + {$if declared(FC_i2d_CMS_bio)} + i2d_CMS_bio := @FC_i2d_CMS_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(i2d_CMS_bio_removed)} + if i2d_CMS_bio_removed <= LibVersion then + begin + {$if declared(_i2d_CMS_bio)} + i2d_CMS_bio := @_i2d_CMS_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(i2d_CMS_bio_allownil)} + if FuncLoadError then + AFailed.Add('i2d_CMS_bio'); + {$ifend} + end; + + + BIO_new_CMS := LoadLibFunction(ADllHandle, BIO_new_CMS_procname); + FuncLoadError := not assigned(BIO_new_CMS); + if FuncLoadError then + begin + {$if not defined(BIO_new_CMS_allownil)} + BIO_new_CMS := @ERR_BIO_new_CMS; + {$ifend} + {$if declared(BIO_new_CMS_introduced)} + if LibVersion < BIO_new_CMS_introduced then + begin + {$if declared(FC_BIO_new_CMS)} + BIO_new_CMS := @FC_BIO_new_CMS; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_new_CMS_removed)} + if BIO_new_CMS_removed <= LibVersion then + begin + {$if declared(_BIO_new_CMS)} + BIO_new_CMS := @_BIO_new_CMS; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_new_CMS_allownil)} + if FuncLoadError then + AFailed.Add('BIO_new_CMS'); + {$ifend} + end; + + + i2d_CMS_bio_stream := LoadLibFunction(ADllHandle, i2d_CMS_bio_stream_procname); + FuncLoadError := not assigned(i2d_CMS_bio_stream); + if FuncLoadError then + begin + {$if not defined(i2d_CMS_bio_stream_allownil)} + i2d_CMS_bio_stream := @ERR_i2d_CMS_bio_stream; + {$ifend} + {$if declared(i2d_CMS_bio_stream_introduced)} + if LibVersion < i2d_CMS_bio_stream_introduced then + begin + {$if declared(FC_i2d_CMS_bio_stream)} + i2d_CMS_bio_stream := @FC_i2d_CMS_bio_stream; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(i2d_CMS_bio_stream_removed)} + if i2d_CMS_bio_stream_removed <= LibVersion then + begin + {$if declared(_i2d_CMS_bio_stream)} + i2d_CMS_bio_stream := @_i2d_CMS_bio_stream; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(i2d_CMS_bio_stream_allownil)} + if FuncLoadError then + AFailed.Add('i2d_CMS_bio_stream'); + {$ifend} + end; + + + PEM_write_bio_CMS_stream := LoadLibFunction(ADllHandle, PEM_write_bio_CMS_stream_procname); + FuncLoadError := not assigned(PEM_write_bio_CMS_stream); + if FuncLoadError then + begin + {$if not defined(PEM_write_bio_CMS_stream_allownil)} + PEM_write_bio_CMS_stream := @ERR_PEM_write_bio_CMS_stream; + {$ifend} + {$if declared(PEM_write_bio_CMS_stream_introduced)} + if LibVersion < PEM_write_bio_CMS_stream_introduced then + begin + {$if declared(FC_PEM_write_bio_CMS_stream)} + PEM_write_bio_CMS_stream := @FC_PEM_write_bio_CMS_stream; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PEM_write_bio_CMS_stream_removed)} + if PEM_write_bio_CMS_stream_removed <= LibVersion then + begin + {$if declared(_PEM_write_bio_CMS_stream)} + PEM_write_bio_CMS_stream := @_PEM_write_bio_CMS_stream; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PEM_write_bio_CMS_stream_allownil)} + if FuncLoadError then + AFailed.Add('PEM_write_bio_CMS_stream'); + {$ifend} + end; + + + SMIME_read_CMS := LoadLibFunction(ADllHandle, SMIME_read_CMS_procname); + FuncLoadError := not assigned(SMIME_read_CMS); + if FuncLoadError then + begin + {$if not defined(SMIME_read_CMS_allownil)} + SMIME_read_CMS := @ERR_SMIME_read_CMS; + {$ifend} + {$if declared(SMIME_read_CMS_introduced)} + if LibVersion < SMIME_read_CMS_introduced then + begin + {$if declared(FC_SMIME_read_CMS)} + SMIME_read_CMS := @FC_SMIME_read_CMS; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SMIME_read_CMS_removed)} + if SMIME_read_CMS_removed <= LibVersion then + begin + {$if declared(_SMIME_read_CMS)} + SMIME_read_CMS := @_SMIME_read_CMS; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SMIME_read_CMS_allownil)} + if FuncLoadError then + AFailed.Add('SMIME_read_CMS'); + {$ifend} + end; + + + SMIME_write_CMS := LoadLibFunction(ADllHandle, SMIME_write_CMS_procname); + FuncLoadError := not assigned(SMIME_write_CMS); + if FuncLoadError then + begin + {$if not defined(SMIME_write_CMS_allownil)} + SMIME_write_CMS := @ERR_SMIME_write_CMS; + {$ifend} + {$if declared(SMIME_write_CMS_introduced)} + if LibVersion < SMIME_write_CMS_introduced then + begin + {$if declared(FC_SMIME_write_CMS)} + SMIME_write_CMS := @FC_SMIME_write_CMS; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SMIME_write_CMS_removed)} + if SMIME_write_CMS_removed <= LibVersion then + begin + {$if declared(_SMIME_write_CMS)} + SMIME_write_CMS := @_SMIME_write_CMS; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SMIME_write_CMS_allownil)} + if FuncLoadError then + AFailed.Add('SMIME_write_CMS'); + {$ifend} + end; + + + CMS_final := LoadLibFunction(ADllHandle, CMS_final_procname); + FuncLoadError := not assigned(CMS_final); + if FuncLoadError then + begin + {$if not defined(CMS_final_allownil)} + CMS_final := @ERR_CMS_final; + {$ifend} + {$if declared(CMS_final_introduced)} + if LibVersion < CMS_final_introduced then + begin + {$if declared(FC_CMS_final)} + CMS_final := @FC_CMS_final; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CMS_final_removed)} + if CMS_final_removed <= LibVersion then + begin + {$if declared(_CMS_final)} + CMS_final := @_CMS_final; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CMS_final_allownil)} + if FuncLoadError then + AFailed.Add('CMS_final'); + {$ifend} + end; + + + CMS_data := LoadLibFunction(ADllHandle, CMS_data_procname); + FuncLoadError := not assigned(CMS_data); + if FuncLoadError then + begin + {$if not defined(CMS_data_allownil)} + CMS_data := @ERR_CMS_data; + {$ifend} + {$if declared(CMS_data_introduced)} + if LibVersion < CMS_data_introduced then + begin + {$if declared(FC_CMS_data)} + CMS_data := @FC_CMS_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CMS_data_removed)} + if CMS_data_removed <= LibVersion then + begin + {$if declared(_CMS_data)} + CMS_data := @_CMS_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CMS_data_allownil)} + if FuncLoadError then + AFailed.Add('CMS_data'); + {$ifend} + end; + + + CMS_data_create := LoadLibFunction(ADllHandle, CMS_data_create_procname); + FuncLoadError := not assigned(CMS_data_create); + if FuncLoadError then + begin + {$if not defined(CMS_data_create_allownil)} + CMS_data_create := @ERR_CMS_data_create; + {$ifend} + {$if declared(CMS_data_create_introduced)} + if LibVersion < CMS_data_create_introduced then + begin + {$if declared(FC_CMS_data_create)} + CMS_data_create := @FC_CMS_data_create; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CMS_data_create_removed)} + if CMS_data_create_removed <= LibVersion then + begin + {$if declared(_CMS_data_create)} + CMS_data_create := @_CMS_data_create; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CMS_data_create_allownil)} + if FuncLoadError then + AFailed.Add('CMS_data_create'); + {$ifend} + end; + + + CMS_digest_verify := LoadLibFunction(ADllHandle, CMS_digest_verify_procname); + FuncLoadError := not assigned(CMS_digest_verify); + if FuncLoadError then + begin + {$if not defined(CMS_digest_verify_allownil)} + CMS_digest_verify := @ERR_CMS_digest_verify; + {$ifend} + {$if declared(CMS_digest_verify_introduced)} + if LibVersion < CMS_digest_verify_introduced then + begin + {$if declared(FC_CMS_digest_verify)} + CMS_digest_verify := @FC_CMS_digest_verify; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CMS_digest_verify_removed)} + if CMS_digest_verify_removed <= LibVersion then + begin + {$if declared(_CMS_digest_verify)} + CMS_digest_verify := @_CMS_digest_verify; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CMS_digest_verify_allownil)} + if FuncLoadError then + AFailed.Add('CMS_digest_verify'); + {$ifend} + end; + + + CMS_digest_create := LoadLibFunction(ADllHandle, CMS_digest_create_procname); + FuncLoadError := not assigned(CMS_digest_create); + if FuncLoadError then + begin + {$if not defined(CMS_digest_create_allownil)} + CMS_digest_create := @ERR_CMS_digest_create; + {$ifend} + {$if declared(CMS_digest_create_introduced)} + if LibVersion < CMS_digest_create_introduced then + begin + {$if declared(FC_CMS_digest_create)} + CMS_digest_create := @FC_CMS_digest_create; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CMS_digest_create_removed)} + if CMS_digest_create_removed <= LibVersion then + begin + {$if declared(_CMS_digest_create)} + CMS_digest_create := @_CMS_digest_create; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CMS_digest_create_allownil)} + if FuncLoadError then + AFailed.Add('CMS_digest_create'); + {$ifend} + end; + + + CMS_EncryptedData_decrypt := LoadLibFunction(ADllHandle, CMS_EncryptedData_decrypt_procname); + FuncLoadError := not assigned(CMS_EncryptedData_decrypt); + if FuncLoadError then + begin + {$if not defined(CMS_EncryptedData_decrypt_allownil)} + CMS_EncryptedData_decrypt := @ERR_CMS_EncryptedData_decrypt; + {$ifend} + {$if declared(CMS_EncryptedData_decrypt_introduced)} + if LibVersion < CMS_EncryptedData_decrypt_introduced then + begin + {$if declared(FC_CMS_EncryptedData_decrypt)} + CMS_EncryptedData_decrypt := @FC_CMS_EncryptedData_decrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CMS_EncryptedData_decrypt_removed)} + if CMS_EncryptedData_decrypt_removed <= LibVersion then + begin + {$if declared(_CMS_EncryptedData_decrypt)} + CMS_EncryptedData_decrypt := @_CMS_EncryptedData_decrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CMS_EncryptedData_decrypt_allownil)} + if FuncLoadError then + AFailed.Add('CMS_EncryptedData_decrypt'); + {$ifend} + end; + + + CMS_EncryptedData_encrypt := LoadLibFunction(ADllHandle, CMS_EncryptedData_encrypt_procname); + FuncLoadError := not assigned(CMS_EncryptedData_encrypt); + if FuncLoadError then + begin + {$if not defined(CMS_EncryptedData_encrypt_allownil)} + CMS_EncryptedData_encrypt := @ERR_CMS_EncryptedData_encrypt; + {$ifend} + {$if declared(CMS_EncryptedData_encrypt_introduced)} + if LibVersion < CMS_EncryptedData_encrypt_introduced then + begin + {$if declared(FC_CMS_EncryptedData_encrypt)} + CMS_EncryptedData_encrypt := @FC_CMS_EncryptedData_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CMS_EncryptedData_encrypt_removed)} + if CMS_EncryptedData_encrypt_removed <= LibVersion then + begin + {$if declared(_CMS_EncryptedData_encrypt)} + CMS_EncryptedData_encrypt := @_CMS_EncryptedData_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CMS_EncryptedData_encrypt_allownil)} + if FuncLoadError then + AFailed.Add('CMS_EncryptedData_encrypt'); + {$ifend} + end; + + + CMS_EncryptedData_set1_key := LoadLibFunction(ADllHandle, CMS_EncryptedData_set1_key_procname); + FuncLoadError := not assigned(CMS_EncryptedData_set1_key); + if FuncLoadError then + begin + {$if not defined(CMS_EncryptedData_set1_key_allownil)} + CMS_EncryptedData_set1_key := @ERR_CMS_EncryptedData_set1_key; + {$ifend} + {$if declared(CMS_EncryptedData_set1_key_introduced)} + if LibVersion < CMS_EncryptedData_set1_key_introduced then + begin + {$if declared(FC_CMS_EncryptedData_set1_key)} + CMS_EncryptedData_set1_key := @FC_CMS_EncryptedData_set1_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CMS_EncryptedData_set1_key_removed)} + if CMS_EncryptedData_set1_key_removed <= LibVersion then + begin + {$if declared(_CMS_EncryptedData_set1_key)} + CMS_EncryptedData_set1_key := @_CMS_EncryptedData_set1_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CMS_EncryptedData_set1_key_allownil)} + if FuncLoadError then + AFailed.Add('CMS_EncryptedData_set1_key'); + {$ifend} + end; + + + CMS_decrypt := LoadLibFunction(ADllHandle, CMS_decrypt_procname); + FuncLoadError := not assigned(CMS_decrypt); + if FuncLoadError then + begin + {$if not defined(CMS_decrypt_allownil)} + CMS_decrypt := @ERR_CMS_decrypt; + {$ifend} + {$if declared(CMS_decrypt_introduced)} + if LibVersion < CMS_decrypt_introduced then + begin + {$if declared(FC_CMS_decrypt)} + CMS_decrypt := @FC_CMS_decrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CMS_decrypt_removed)} + if CMS_decrypt_removed <= LibVersion then + begin + {$if declared(_CMS_decrypt)} + CMS_decrypt := @_CMS_decrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CMS_decrypt_allownil)} + if FuncLoadError then + AFailed.Add('CMS_decrypt'); + {$ifend} + end; + + + CMS_decrypt_set1_pkey := LoadLibFunction(ADllHandle, CMS_decrypt_set1_pkey_procname); + FuncLoadError := not assigned(CMS_decrypt_set1_pkey); + if FuncLoadError then + begin + {$if not defined(CMS_decrypt_set1_pkey_allownil)} + CMS_decrypt_set1_pkey := @ERR_CMS_decrypt_set1_pkey; + {$ifend} + {$if declared(CMS_decrypt_set1_pkey_introduced)} + if LibVersion < CMS_decrypt_set1_pkey_introduced then + begin + {$if declared(FC_CMS_decrypt_set1_pkey)} + CMS_decrypt_set1_pkey := @FC_CMS_decrypt_set1_pkey; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CMS_decrypt_set1_pkey_removed)} + if CMS_decrypt_set1_pkey_removed <= LibVersion then + begin + {$if declared(_CMS_decrypt_set1_pkey)} + CMS_decrypt_set1_pkey := @_CMS_decrypt_set1_pkey; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CMS_decrypt_set1_pkey_allownil)} + if FuncLoadError then + AFailed.Add('CMS_decrypt_set1_pkey'); + {$ifend} + end; + + + CMS_decrypt_set1_key := LoadLibFunction(ADllHandle, CMS_decrypt_set1_key_procname); + FuncLoadError := not assigned(CMS_decrypt_set1_key); + if FuncLoadError then + begin + {$if not defined(CMS_decrypt_set1_key_allownil)} + CMS_decrypt_set1_key := @ERR_CMS_decrypt_set1_key; + {$ifend} + {$if declared(CMS_decrypt_set1_key_introduced)} + if LibVersion < CMS_decrypt_set1_key_introduced then + begin + {$if declared(FC_CMS_decrypt_set1_key)} + CMS_decrypt_set1_key := @FC_CMS_decrypt_set1_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CMS_decrypt_set1_key_removed)} + if CMS_decrypt_set1_key_removed <= LibVersion then + begin + {$if declared(_CMS_decrypt_set1_key)} + CMS_decrypt_set1_key := @_CMS_decrypt_set1_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CMS_decrypt_set1_key_allownil)} + if FuncLoadError then + AFailed.Add('CMS_decrypt_set1_key'); + {$ifend} + end; + + + CMS_decrypt_set1_password := LoadLibFunction(ADllHandle, CMS_decrypt_set1_password_procname); + FuncLoadError := not assigned(CMS_decrypt_set1_password); + if FuncLoadError then + begin + {$if not defined(CMS_decrypt_set1_password_allownil)} + CMS_decrypt_set1_password := @ERR_CMS_decrypt_set1_password; + {$ifend} + {$if declared(CMS_decrypt_set1_password_introduced)} + if LibVersion < CMS_decrypt_set1_password_introduced then + begin + {$if declared(FC_CMS_decrypt_set1_password)} + CMS_decrypt_set1_password := @FC_CMS_decrypt_set1_password; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CMS_decrypt_set1_password_removed)} + if CMS_decrypt_set1_password_removed <= LibVersion then + begin + {$if declared(_CMS_decrypt_set1_password)} + CMS_decrypt_set1_password := @_CMS_decrypt_set1_password; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CMS_decrypt_set1_password_allownil)} + if FuncLoadError then + AFailed.Add('CMS_decrypt_set1_password'); + {$ifend} + end; + + + CMS_RecipientInfo_type := LoadLibFunction(ADllHandle, CMS_RecipientInfo_type_procname); + FuncLoadError := not assigned(CMS_RecipientInfo_type); + if FuncLoadError then + begin + {$if not defined(CMS_RecipientInfo_type_allownil)} + CMS_RecipientInfo_type := @ERR_CMS_RecipientInfo_type; + {$ifend} + {$if declared(CMS_RecipientInfo_type_introduced)} + if LibVersion < CMS_RecipientInfo_type_introduced then + begin + {$if declared(FC_CMS_RecipientInfo_type)} + CMS_RecipientInfo_type := @FC_CMS_RecipientInfo_type; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CMS_RecipientInfo_type_removed)} + if CMS_RecipientInfo_type_removed <= LibVersion then + begin + {$if declared(_CMS_RecipientInfo_type)} + CMS_RecipientInfo_type := @_CMS_RecipientInfo_type; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CMS_RecipientInfo_type_allownil)} + if FuncLoadError then + AFailed.Add('CMS_RecipientInfo_type'); + {$ifend} + end; + + + CMS_RecipientInfo_get0_pkey_ctx := LoadLibFunction(ADllHandle, CMS_RecipientInfo_get0_pkey_ctx_procname); + FuncLoadError := not assigned(CMS_RecipientInfo_get0_pkey_ctx); + if FuncLoadError then + begin + {$if not defined(CMS_RecipientInfo_get0_pkey_ctx_allownil)} + CMS_RecipientInfo_get0_pkey_ctx := @ERR_CMS_RecipientInfo_get0_pkey_ctx; + {$ifend} + {$if declared(CMS_RecipientInfo_get0_pkey_ctx_introduced)} + if LibVersion < CMS_RecipientInfo_get0_pkey_ctx_introduced then + begin + {$if declared(FC_CMS_RecipientInfo_get0_pkey_ctx)} + CMS_RecipientInfo_get0_pkey_ctx := @FC_CMS_RecipientInfo_get0_pkey_ctx; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CMS_RecipientInfo_get0_pkey_ctx_removed)} + if CMS_RecipientInfo_get0_pkey_ctx_removed <= LibVersion then + begin + {$if declared(_CMS_RecipientInfo_get0_pkey_ctx)} + CMS_RecipientInfo_get0_pkey_ctx := @_CMS_RecipientInfo_get0_pkey_ctx; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CMS_RecipientInfo_get0_pkey_ctx_allownil)} + if FuncLoadError then + AFailed.Add('CMS_RecipientInfo_get0_pkey_ctx'); + {$ifend} + end; + + + CMS_EnvelopedData_create := LoadLibFunction(ADllHandle, CMS_EnvelopedData_create_procname); + FuncLoadError := not assigned(CMS_EnvelopedData_create); + if FuncLoadError then + begin + {$if not defined(CMS_EnvelopedData_create_allownil)} + CMS_EnvelopedData_create := @ERR_CMS_EnvelopedData_create; + {$ifend} + {$if declared(CMS_EnvelopedData_create_introduced)} + if LibVersion < CMS_EnvelopedData_create_introduced then + begin + {$if declared(FC_CMS_EnvelopedData_create)} + CMS_EnvelopedData_create := @FC_CMS_EnvelopedData_create; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CMS_EnvelopedData_create_removed)} + if CMS_EnvelopedData_create_removed <= LibVersion then + begin + {$if declared(_CMS_EnvelopedData_create)} + CMS_EnvelopedData_create := @_CMS_EnvelopedData_create; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CMS_EnvelopedData_create_allownil)} + if FuncLoadError then + AFailed.Add('CMS_EnvelopedData_create'); + {$ifend} + end; + + + CMS_add1_recipient_cert := LoadLibFunction(ADllHandle, CMS_add1_recipient_cert_procname); + FuncLoadError := not assigned(CMS_add1_recipient_cert); + if FuncLoadError then + begin + {$if not defined(CMS_add1_recipient_cert_allownil)} + CMS_add1_recipient_cert := @ERR_CMS_add1_recipient_cert; + {$ifend} + {$if declared(CMS_add1_recipient_cert_introduced)} + if LibVersion < CMS_add1_recipient_cert_introduced then + begin + {$if declared(FC_CMS_add1_recipient_cert)} + CMS_add1_recipient_cert := @FC_CMS_add1_recipient_cert; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CMS_add1_recipient_cert_removed)} + if CMS_add1_recipient_cert_removed <= LibVersion then + begin + {$if declared(_CMS_add1_recipient_cert)} + CMS_add1_recipient_cert := @_CMS_add1_recipient_cert; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CMS_add1_recipient_cert_allownil)} + if FuncLoadError then + AFailed.Add('CMS_add1_recipient_cert'); + {$ifend} + end; + + + CMS_RecipientInfo_set0_pkey := LoadLibFunction(ADllHandle, CMS_RecipientInfo_set0_pkey_procname); + FuncLoadError := not assigned(CMS_RecipientInfo_set0_pkey); + if FuncLoadError then + begin + {$if not defined(CMS_RecipientInfo_set0_pkey_allownil)} + CMS_RecipientInfo_set0_pkey := @ERR_CMS_RecipientInfo_set0_pkey; + {$ifend} + {$if declared(CMS_RecipientInfo_set0_pkey_introduced)} + if LibVersion < CMS_RecipientInfo_set0_pkey_introduced then + begin + {$if declared(FC_CMS_RecipientInfo_set0_pkey)} + CMS_RecipientInfo_set0_pkey := @FC_CMS_RecipientInfo_set0_pkey; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CMS_RecipientInfo_set0_pkey_removed)} + if CMS_RecipientInfo_set0_pkey_removed <= LibVersion then + begin + {$if declared(_CMS_RecipientInfo_set0_pkey)} + CMS_RecipientInfo_set0_pkey := @_CMS_RecipientInfo_set0_pkey; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CMS_RecipientInfo_set0_pkey_allownil)} + if FuncLoadError then + AFailed.Add('CMS_RecipientInfo_set0_pkey'); + {$ifend} + end; + + + CMS_RecipientInfo_ktri_cert_cmp := LoadLibFunction(ADllHandle, CMS_RecipientInfo_ktri_cert_cmp_procname); + FuncLoadError := not assigned(CMS_RecipientInfo_ktri_cert_cmp); + if FuncLoadError then + begin + {$if not defined(CMS_RecipientInfo_ktri_cert_cmp_allownil)} + CMS_RecipientInfo_ktri_cert_cmp := @ERR_CMS_RecipientInfo_ktri_cert_cmp; + {$ifend} + {$if declared(CMS_RecipientInfo_ktri_cert_cmp_introduced)} + if LibVersion < CMS_RecipientInfo_ktri_cert_cmp_introduced then + begin + {$if declared(FC_CMS_RecipientInfo_ktri_cert_cmp)} + CMS_RecipientInfo_ktri_cert_cmp := @FC_CMS_RecipientInfo_ktri_cert_cmp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CMS_RecipientInfo_ktri_cert_cmp_removed)} + if CMS_RecipientInfo_ktri_cert_cmp_removed <= LibVersion then + begin + {$if declared(_CMS_RecipientInfo_ktri_cert_cmp)} + CMS_RecipientInfo_ktri_cert_cmp := @_CMS_RecipientInfo_ktri_cert_cmp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CMS_RecipientInfo_ktri_cert_cmp_allownil)} + if FuncLoadError then + AFailed.Add('CMS_RecipientInfo_ktri_cert_cmp'); + {$ifend} + end; + + + CMS_RecipientInfo_ktri_get0_algs := LoadLibFunction(ADllHandle, CMS_RecipientInfo_ktri_get0_algs_procname); + FuncLoadError := not assigned(CMS_RecipientInfo_ktri_get0_algs); + if FuncLoadError then + begin + {$if not defined(CMS_RecipientInfo_ktri_get0_algs_allownil)} + CMS_RecipientInfo_ktri_get0_algs := @ERR_CMS_RecipientInfo_ktri_get0_algs; + {$ifend} + {$if declared(CMS_RecipientInfo_ktri_get0_algs_introduced)} + if LibVersion < CMS_RecipientInfo_ktri_get0_algs_introduced then + begin + {$if declared(FC_CMS_RecipientInfo_ktri_get0_algs)} + CMS_RecipientInfo_ktri_get0_algs := @FC_CMS_RecipientInfo_ktri_get0_algs; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CMS_RecipientInfo_ktri_get0_algs_removed)} + if CMS_RecipientInfo_ktri_get0_algs_removed <= LibVersion then + begin + {$if declared(_CMS_RecipientInfo_ktri_get0_algs)} + CMS_RecipientInfo_ktri_get0_algs := @_CMS_RecipientInfo_ktri_get0_algs; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CMS_RecipientInfo_ktri_get0_algs_allownil)} + if FuncLoadError then + AFailed.Add('CMS_RecipientInfo_ktri_get0_algs'); + {$ifend} + end; + + + CMS_RecipientInfo_ktri_get0_signer_id := LoadLibFunction(ADllHandle, CMS_RecipientInfo_ktri_get0_signer_id_procname); + FuncLoadError := not assigned(CMS_RecipientInfo_ktri_get0_signer_id); + if FuncLoadError then + begin + {$if not defined(CMS_RecipientInfo_ktri_get0_signer_id_allownil)} + CMS_RecipientInfo_ktri_get0_signer_id := @ERR_CMS_RecipientInfo_ktri_get0_signer_id; + {$ifend} + {$if declared(CMS_RecipientInfo_ktri_get0_signer_id_introduced)} + if LibVersion < CMS_RecipientInfo_ktri_get0_signer_id_introduced then + begin + {$if declared(FC_CMS_RecipientInfo_ktri_get0_signer_id)} + CMS_RecipientInfo_ktri_get0_signer_id := @FC_CMS_RecipientInfo_ktri_get0_signer_id; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CMS_RecipientInfo_ktri_get0_signer_id_removed)} + if CMS_RecipientInfo_ktri_get0_signer_id_removed <= LibVersion then + begin + {$if declared(_CMS_RecipientInfo_ktri_get0_signer_id)} + CMS_RecipientInfo_ktri_get0_signer_id := @_CMS_RecipientInfo_ktri_get0_signer_id; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CMS_RecipientInfo_ktri_get0_signer_id_allownil)} + if FuncLoadError then + AFailed.Add('CMS_RecipientInfo_ktri_get0_signer_id'); + {$ifend} + end; + + + CMS_add0_recipient_key := LoadLibFunction(ADllHandle, CMS_add0_recipient_key_procname); + FuncLoadError := not assigned(CMS_add0_recipient_key); + if FuncLoadError then + begin + {$if not defined(CMS_add0_recipient_key_allownil)} + CMS_add0_recipient_key := @ERR_CMS_add0_recipient_key; + {$ifend} + {$if declared(CMS_add0_recipient_key_introduced)} + if LibVersion < CMS_add0_recipient_key_introduced then + begin + {$if declared(FC_CMS_add0_recipient_key)} + CMS_add0_recipient_key := @FC_CMS_add0_recipient_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CMS_add0_recipient_key_removed)} + if CMS_add0_recipient_key_removed <= LibVersion then + begin + {$if declared(_CMS_add0_recipient_key)} + CMS_add0_recipient_key := @_CMS_add0_recipient_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CMS_add0_recipient_key_allownil)} + if FuncLoadError then + AFailed.Add('CMS_add0_recipient_key'); + {$ifend} + end; + + + CMS_RecipientInfo_kekri_get0_id := LoadLibFunction(ADllHandle, CMS_RecipientInfo_kekri_get0_id_procname); + FuncLoadError := not assigned(CMS_RecipientInfo_kekri_get0_id); + if FuncLoadError then + begin + {$if not defined(CMS_RecipientInfo_kekri_get0_id_allownil)} + CMS_RecipientInfo_kekri_get0_id := @ERR_CMS_RecipientInfo_kekri_get0_id; + {$ifend} + {$if declared(CMS_RecipientInfo_kekri_get0_id_introduced)} + if LibVersion < CMS_RecipientInfo_kekri_get0_id_introduced then + begin + {$if declared(FC_CMS_RecipientInfo_kekri_get0_id)} + CMS_RecipientInfo_kekri_get0_id := @FC_CMS_RecipientInfo_kekri_get0_id; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CMS_RecipientInfo_kekri_get0_id_removed)} + if CMS_RecipientInfo_kekri_get0_id_removed <= LibVersion then + begin + {$if declared(_CMS_RecipientInfo_kekri_get0_id)} + CMS_RecipientInfo_kekri_get0_id := @_CMS_RecipientInfo_kekri_get0_id; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CMS_RecipientInfo_kekri_get0_id_allownil)} + if FuncLoadError then + AFailed.Add('CMS_RecipientInfo_kekri_get0_id'); + {$ifend} + end; + + + CMS_RecipientInfo_set0_key := LoadLibFunction(ADllHandle, CMS_RecipientInfo_set0_key_procname); + FuncLoadError := not assigned(CMS_RecipientInfo_set0_key); + if FuncLoadError then + begin + {$if not defined(CMS_RecipientInfo_set0_key_allownil)} + CMS_RecipientInfo_set0_key := @ERR_CMS_RecipientInfo_set0_key; + {$ifend} + {$if declared(CMS_RecipientInfo_set0_key_introduced)} + if LibVersion < CMS_RecipientInfo_set0_key_introduced then + begin + {$if declared(FC_CMS_RecipientInfo_set0_key)} + CMS_RecipientInfo_set0_key := @FC_CMS_RecipientInfo_set0_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CMS_RecipientInfo_set0_key_removed)} + if CMS_RecipientInfo_set0_key_removed <= LibVersion then + begin + {$if declared(_CMS_RecipientInfo_set0_key)} + CMS_RecipientInfo_set0_key := @_CMS_RecipientInfo_set0_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CMS_RecipientInfo_set0_key_allownil)} + if FuncLoadError then + AFailed.Add('CMS_RecipientInfo_set0_key'); + {$ifend} + end; + + + CMS_RecipientInfo_kekri_id_cmp := LoadLibFunction(ADllHandle, CMS_RecipientInfo_kekri_id_cmp_procname); + FuncLoadError := not assigned(CMS_RecipientInfo_kekri_id_cmp); + if FuncLoadError then + begin + {$if not defined(CMS_RecipientInfo_kekri_id_cmp_allownil)} + CMS_RecipientInfo_kekri_id_cmp := @ERR_CMS_RecipientInfo_kekri_id_cmp; + {$ifend} + {$if declared(CMS_RecipientInfo_kekri_id_cmp_introduced)} + if LibVersion < CMS_RecipientInfo_kekri_id_cmp_introduced then + begin + {$if declared(FC_CMS_RecipientInfo_kekri_id_cmp)} + CMS_RecipientInfo_kekri_id_cmp := @FC_CMS_RecipientInfo_kekri_id_cmp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CMS_RecipientInfo_kekri_id_cmp_removed)} + if CMS_RecipientInfo_kekri_id_cmp_removed <= LibVersion then + begin + {$if declared(_CMS_RecipientInfo_kekri_id_cmp)} + CMS_RecipientInfo_kekri_id_cmp := @_CMS_RecipientInfo_kekri_id_cmp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CMS_RecipientInfo_kekri_id_cmp_allownil)} + if FuncLoadError then + AFailed.Add('CMS_RecipientInfo_kekri_id_cmp'); + {$ifend} + end; + + + CMS_RecipientInfo_set0_password := LoadLibFunction(ADllHandle, CMS_RecipientInfo_set0_password_procname); + FuncLoadError := not assigned(CMS_RecipientInfo_set0_password); + if FuncLoadError then + begin + {$if not defined(CMS_RecipientInfo_set0_password_allownil)} + CMS_RecipientInfo_set0_password := @ERR_CMS_RecipientInfo_set0_password; + {$ifend} + {$if declared(CMS_RecipientInfo_set0_password_introduced)} + if LibVersion < CMS_RecipientInfo_set0_password_introduced then + begin + {$if declared(FC_CMS_RecipientInfo_set0_password)} + CMS_RecipientInfo_set0_password := @FC_CMS_RecipientInfo_set0_password; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CMS_RecipientInfo_set0_password_removed)} + if CMS_RecipientInfo_set0_password_removed <= LibVersion then + begin + {$if declared(_CMS_RecipientInfo_set0_password)} + CMS_RecipientInfo_set0_password := @_CMS_RecipientInfo_set0_password; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CMS_RecipientInfo_set0_password_allownil)} + if FuncLoadError then + AFailed.Add('CMS_RecipientInfo_set0_password'); + {$ifend} + end; + + + CMS_add0_recipient_password := LoadLibFunction(ADllHandle, CMS_add0_recipient_password_procname); + FuncLoadError := not assigned(CMS_add0_recipient_password); + if FuncLoadError then + begin + {$if not defined(CMS_add0_recipient_password_allownil)} + CMS_add0_recipient_password := @ERR_CMS_add0_recipient_password; + {$ifend} + {$if declared(CMS_add0_recipient_password_introduced)} + if LibVersion < CMS_add0_recipient_password_introduced then + begin + {$if declared(FC_CMS_add0_recipient_password)} + CMS_add0_recipient_password := @FC_CMS_add0_recipient_password; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CMS_add0_recipient_password_removed)} + if CMS_add0_recipient_password_removed <= LibVersion then + begin + {$if declared(_CMS_add0_recipient_password)} + CMS_add0_recipient_password := @_CMS_add0_recipient_password; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CMS_add0_recipient_password_allownil)} + if FuncLoadError then + AFailed.Add('CMS_add0_recipient_password'); + {$ifend} + end; + + + CMS_RecipientInfo_decrypt := LoadLibFunction(ADllHandle, CMS_RecipientInfo_decrypt_procname); + FuncLoadError := not assigned(CMS_RecipientInfo_decrypt); + if FuncLoadError then + begin + {$if not defined(CMS_RecipientInfo_decrypt_allownil)} + CMS_RecipientInfo_decrypt := @ERR_CMS_RecipientInfo_decrypt; + {$ifend} + {$if declared(CMS_RecipientInfo_decrypt_introduced)} + if LibVersion < CMS_RecipientInfo_decrypt_introduced then + begin + {$if declared(FC_CMS_RecipientInfo_decrypt)} + CMS_RecipientInfo_decrypt := @FC_CMS_RecipientInfo_decrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CMS_RecipientInfo_decrypt_removed)} + if CMS_RecipientInfo_decrypt_removed <= LibVersion then + begin + {$if declared(_CMS_RecipientInfo_decrypt)} + CMS_RecipientInfo_decrypt := @_CMS_RecipientInfo_decrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CMS_RecipientInfo_decrypt_allownil)} + if FuncLoadError then + AFailed.Add('CMS_RecipientInfo_decrypt'); + {$ifend} + end; + + + CMS_RecipientInfo_encrypt := LoadLibFunction(ADllHandle, CMS_RecipientInfo_encrypt_procname); + FuncLoadError := not assigned(CMS_RecipientInfo_encrypt); + if FuncLoadError then + begin + {$if not defined(CMS_RecipientInfo_encrypt_allownil)} + CMS_RecipientInfo_encrypt := @ERR_CMS_RecipientInfo_encrypt; + {$ifend} + {$if declared(CMS_RecipientInfo_encrypt_introduced)} + if LibVersion < CMS_RecipientInfo_encrypt_introduced then + begin + {$if declared(FC_CMS_RecipientInfo_encrypt)} + CMS_RecipientInfo_encrypt := @FC_CMS_RecipientInfo_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CMS_RecipientInfo_encrypt_removed)} + if CMS_RecipientInfo_encrypt_removed <= LibVersion then + begin + {$if declared(_CMS_RecipientInfo_encrypt)} + CMS_RecipientInfo_encrypt := @_CMS_RecipientInfo_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CMS_RecipientInfo_encrypt_allownil)} + if FuncLoadError then + AFailed.Add('CMS_RecipientInfo_encrypt'); + {$ifend} + end; + + + CMS_uncompress := LoadLibFunction(ADllHandle, CMS_uncompress_procname); + FuncLoadError := not assigned(CMS_uncompress); + if FuncLoadError then + begin + {$if not defined(CMS_uncompress_allownil)} + CMS_uncompress := @ERR_CMS_uncompress; + {$ifend} + {$if declared(CMS_uncompress_introduced)} + if LibVersion < CMS_uncompress_introduced then + begin + {$if declared(FC_CMS_uncompress)} + CMS_uncompress := @FC_CMS_uncompress; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CMS_uncompress_removed)} + if CMS_uncompress_removed <= LibVersion then + begin + {$if declared(_CMS_uncompress)} + CMS_uncompress := @_CMS_uncompress; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CMS_uncompress_allownil)} + if FuncLoadError then + AFailed.Add('CMS_uncompress'); + {$ifend} + end; + + + CMS_compress := LoadLibFunction(ADllHandle, CMS_compress_procname); + FuncLoadError := not assigned(CMS_compress); + if FuncLoadError then + begin + {$if not defined(CMS_compress_allownil)} + CMS_compress := @ERR_CMS_compress; + {$ifend} + {$if declared(CMS_compress_introduced)} + if LibVersion < CMS_compress_introduced then + begin + {$if declared(FC_CMS_compress)} + CMS_compress := @FC_CMS_compress; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CMS_compress_removed)} + if CMS_compress_removed <= LibVersion then + begin + {$if declared(_CMS_compress)} + CMS_compress := @_CMS_compress; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CMS_compress_allownil)} + if FuncLoadError then + AFailed.Add('CMS_compress'); + {$ifend} + end; + + + CMS_set1_eContentType := LoadLibFunction(ADllHandle, CMS_set1_eContentType_procname); + FuncLoadError := not assigned(CMS_set1_eContentType); + if FuncLoadError then + begin + {$if not defined(CMS_set1_eContentType_allownil)} + CMS_set1_eContentType := @ERR_CMS_set1_eContentType; + {$ifend} + {$if declared(CMS_set1_eContentType_introduced)} + if LibVersion < CMS_set1_eContentType_introduced then + begin + {$if declared(FC_CMS_set1_eContentType)} + CMS_set1_eContentType := @FC_CMS_set1_eContentType; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CMS_set1_eContentType_removed)} + if CMS_set1_eContentType_removed <= LibVersion then + begin + {$if declared(_CMS_set1_eContentType)} + CMS_set1_eContentType := @_CMS_set1_eContentType; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CMS_set1_eContentType_allownil)} + if FuncLoadError then + AFailed.Add('CMS_set1_eContentType'); + {$ifend} + end; + + + CMS_get0_eContentType := LoadLibFunction(ADllHandle, CMS_get0_eContentType_procname); + FuncLoadError := not assigned(CMS_get0_eContentType); + if FuncLoadError then + begin + {$if not defined(CMS_get0_eContentType_allownil)} + CMS_get0_eContentType := @ERR_CMS_get0_eContentType; + {$ifend} + {$if declared(CMS_get0_eContentType_introduced)} + if LibVersion < CMS_get0_eContentType_introduced then + begin + {$if declared(FC_CMS_get0_eContentType)} + CMS_get0_eContentType := @FC_CMS_get0_eContentType; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CMS_get0_eContentType_removed)} + if CMS_get0_eContentType_removed <= LibVersion then + begin + {$if declared(_CMS_get0_eContentType)} + CMS_get0_eContentType := @_CMS_get0_eContentType; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CMS_get0_eContentType_allownil)} + if FuncLoadError then + AFailed.Add('CMS_get0_eContentType'); + {$ifend} + end; + + + CMS_add0_CertificateChoices := LoadLibFunction(ADllHandle, CMS_add0_CertificateChoices_procname); + FuncLoadError := not assigned(CMS_add0_CertificateChoices); + if FuncLoadError then + begin + {$if not defined(CMS_add0_CertificateChoices_allownil)} + CMS_add0_CertificateChoices := @ERR_CMS_add0_CertificateChoices; + {$ifend} + {$if declared(CMS_add0_CertificateChoices_introduced)} + if LibVersion < CMS_add0_CertificateChoices_introduced then + begin + {$if declared(FC_CMS_add0_CertificateChoices)} + CMS_add0_CertificateChoices := @FC_CMS_add0_CertificateChoices; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CMS_add0_CertificateChoices_removed)} + if CMS_add0_CertificateChoices_removed <= LibVersion then + begin + {$if declared(_CMS_add0_CertificateChoices)} + CMS_add0_CertificateChoices := @_CMS_add0_CertificateChoices; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CMS_add0_CertificateChoices_allownil)} + if FuncLoadError then + AFailed.Add('CMS_add0_CertificateChoices'); + {$ifend} + end; + + + CMS_add0_cert := LoadLibFunction(ADllHandle, CMS_add0_cert_procname); + FuncLoadError := not assigned(CMS_add0_cert); + if FuncLoadError then + begin + {$if not defined(CMS_add0_cert_allownil)} + CMS_add0_cert := @ERR_CMS_add0_cert; + {$ifend} + {$if declared(CMS_add0_cert_introduced)} + if LibVersion < CMS_add0_cert_introduced then + begin + {$if declared(FC_CMS_add0_cert)} + CMS_add0_cert := @FC_CMS_add0_cert; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CMS_add0_cert_removed)} + if CMS_add0_cert_removed <= LibVersion then + begin + {$if declared(_CMS_add0_cert)} + CMS_add0_cert := @_CMS_add0_cert; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CMS_add0_cert_allownil)} + if FuncLoadError then + AFailed.Add('CMS_add0_cert'); + {$ifend} + end; + + + CMS_add1_cert := LoadLibFunction(ADllHandle, CMS_add1_cert_procname); + FuncLoadError := not assigned(CMS_add1_cert); + if FuncLoadError then + begin + {$if not defined(CMS_add1_cert_allownil)} + CMS_add1_cert := @ERR_CMS_add1_cert; + {$ifend} + {$if declared(CMS_add1_cert_introduced)} + if LibVersion < CMS_add1_cert_introduced then + begin + {$if declared(FC_CMS_add1_cert)} + CMS_add1_cert := @FC_CMS_add1_cert; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CMS_add1_cert_removed)} + if CMS_add1_cert_removed <= LibVersion then + begin + {$if declared(_CMS_add1_cert)} + CMS_add1_cert := @_CMS_add1_cert; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CMS_add1_cert_allownil)} + if FuncLoadError then + AFailed.Add('CMS_add1_cert'); + {$ifend} + end; + + + CMS_add0_RevocationInfoChoice := LoadLibFunction(ADllHandle, CMS_add0_RevocationInfoChoice_procname); + FuncLoadError := not assigned(CMS_add0_RevocationInfoChoice); + if FuncLoadError then + begin + {$if not defined(CMS_add0_RevocationInfoChoice_allownil)} + CMS_add0_RevocationInfoChoice := @ERR_CMS_add0_RevocationInfoChoice; + {$ifend} + {$if declared(CMS_add0_RevocationInfoChoice_introduced)} + if LibVersion < CMS_add0_RevocationInfoChoice_introduced then + begin + {$if declared(FC_CMS_add0_RevocationInfoChoice)} + CMS_add0_RevocationInfoChoice := @FC_CMS_add0_RevocationInfoChoice; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CMS_add0_RevocationInfoChoice_removed)} + if CMS_add0_RevocationInfoChoice_removed <= LibVersion then + begin + {$if declared(_CMS_add0_RevocationInfoChoice)} + CMS_add0_RevocationInfoChoice := @_CMS_add0_RevocationInfoChoice; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CMS_add0_RevocationInfoChoice_allownil)} + if FuncLoadError then + AFailed.Add('CMS_add0_RevocationInfoChoice'); + {$ifend} + end; + + + CMS_add0_crl := LoadLibFunction(ADllHandle, CMS_add0_crl_procname); + FuncLoadError := not assigned(CMS_add0_crl); + if FuncLoadError then + begin + {$if not defined(CMS_add0_crl_allownil)} + CMS_add0_crl := @ERR_CMS_add0_crl; + {$ifend} + {$if declared(CMS_add0_crl_introduced)} + if LibVersion < CMS_add0_crl_introduced then + begin + {$if declared(FC_CMS_add0_crl)} + CMS_add0_crl := @FC_CMS_add0_crl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CMS_add0_crl_removed)} + if CMS_add0_crl_removed <= LibVersion then + begin + {$if declared(_CMS_add0_crl)} + CMS_add0_crl := @_CMS_add0_crl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CMS_add0_crl_allownil)} + if FuncLoadError then + AFailed.Add('CMS_add0_crl'); + {$ifend} + end; + + + CMS_add1_crl := LoadLibFunction(ADllHandle, CMS_add1_crl_procname); + FuncLoadError := not assigned(CMS_add1_crl); + if FuncLoadError then + begin + {$if not defined(CMS_add1_crl_allownil)} + CMS_add1_crl := @ERR_CMS_add1_crl; + {$ifend} + {$if declared(CMS_add1_crl_introduced)} + if LibVersion < CMS_add1_crl_introduced then + begin + {$if declared(FC_CMS_add1_crl)} + CMS_add1_crl := @FC_CMS_add1_crl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CMS_add1_crl_removed)} + if CMS_add1_crl_removed <= LibVersion then + begin + {$if declared(_CMS_add1_crl)} + CMS_add1_crl := @_CMS_add1_crl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CMS_add1_crl_allownil)} + if FuncLoadError then + AFailed.Add('CMS_add1_crl'); + {$ifend} + end; + + + CMS_SignedData_init := LoadLibFunction(ADllHandle, CMS_SignedData_init_procname); + FuncLoadError := not assigned(CMS_SignedData_init); + if FuncLoadError then + begin + {$if not defined(CMS_SignedData_init_allownil)} + CMS_SignedData_init := @ERR_CMS_SignedData_init; + {$ifend} + {$if declared(CMS_SignedData_init_introduced)} + if LibVersion < CMS_SignedData_init_introduced then + begin + {$if declared(FC_CMS_SignedData_init)} + CMS_SignedData_init := @FC_CMS_SignedData_init; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CMS_SignedData_init_removed)} + if CMS_SignedData_init_removed <= LibVersion then + begin + {$if declared(_CMS_SignedData_init)} + CMS_SignedData_init := @_CMS_SignedData_init; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CMS_SignedData_init_allownil)} + if FuncLoadError then + AFailed.Add('CMS_SignedData_init'); + {$ifend} + end; + + + CMS_add1_signer := LoadLibFunction(ADllHandle, CMS_add1_signer_procname); + FuncLoadError := not assigned(CMS_add1_signer); + if FuncLoadError then + begin + {$if not defined(CMS_add1_signer_allownil)} + CMS_add1_signer := @ERR_CMS_add1_signer; + {$ifend} + {$if declared(CMS_add1_signer_introduced)} + if LibVersion < CMS_add1_signer_introduced then + begin + {$if declared(FC_CMS_add1_signer)} + CMS_add1_signer := @FC_CMS_add1_signer; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CMS_add1_signer_removed)} + if CMS_add1_signer_removed <= LibVersion then + begin + {$if declared(_CMS_add1_signer)} + CMS_add1_signer := @_CMS_add1_signer; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CMS_add1_signer_allownil)} + if FuncLoadError then + AFailed.Add('CMS_add1_signer'); + {$ifend} + end; + + + CMS_SignerInfo_get0_pkey_ctx := LoadLibFunction(ADllHandle, CMS_SignerInfo_get0_pkey_ctx_procname); + FuncLoadError := not assigned(CMS_SignerInfo_get0_pkey_ctx); + if FuncLoadError then + begin + {$if not defined(CMS_SignerInfo_get0_pkey_ctx_allownil)} + CMS_SignerInfo_get0_pkey_ctx := @ERR_CMS_SignerInfo_get0_pkey_ctx; + {$ifend} + {$if declared(CMS_SignerInfo_get0_pkey_ctx_introduced)} + if LibVersion < CMS_SignerInfo_get0_pkey_ctx_introduced then + begin + {$if declared(FC_CMS_SignerInfo_get0_pkey_ctx)} + CMS_SignerInfo_get0_pkey_ctx := @FC_CMS_SignerInfo_get0_pkey_ctx; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CMS_SignerInfo_get0_pkey_ctx_removed)} + if CMS_SignerInfo_get0_pkey_ctx_removed <= LibVersion then + begin + {$if declared(_CMS_SignerInfo_get0_pkey_ctx)} + CMS_SignerInfo_get0_pkey_ctx := @_CMS_SignerInfo_get0_pkey_ctx; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CMS_SignerInfo_get0_pkey_ctx_allownil)} + if FuncLoadError then + AFailed.Add('CMS_SignerInfo_get0_pkey_ctx'); + {$ifend} + end; + + + CMS_SignerInfo_get0_md_ctx := LoadLibFunction(ADllHandle, CMS_SignerInfo_get0_md_ctx_procname); + FuncLoadError := not assigned(CMS_SignerInfo_get0_md_ctx); + if FuncLoadError then + begin + {$if not defined(CMS_SignerInfo_get0_md_ctx_allownil)} + CMS_SignerInfo_get0_md_ctx := @ERR_CMS_SignerInfo_get0_md_ctx; + {$ifend} + {$if declared(CMS_SignerInfo_get0_md_ctx_introduced)} + if LibVersion < CMS_SignerInfo_get0_md_ctx_introduced then + begin + {$if declared(FC_CMS_SignerInfo_get0_md_ctx)} + CMS_SignerInfo_get0_md_ctx := @FC_CMS_SignerInfo_get0_md_ctx; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CMS_SignerInfo_get0_md_ctx_removed)} + if CMS_SignerInfo_get0_md_ctx_removed <= LibVersion then + begin + {$if declared(_CMS_SignerInfo_get0_md_ctx)} + CMS_SignerInfo_get0_md_ctx := @_CMS_SignerInfo_get0_md_ctx; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CMS_SignerInfo_get0_md_ctx_allownil)} + if FuncLoadError then + AFailed.Add('CMS_SignerInfo_get0_md_ctx'); + {$ifend} + end; + + + CMS_SignerInfo_set1_signer_cert := LoadLibFunction(ADllHandle, CMS_SignerInfo_set1_signer_cert_procname); + FuncLoadError := not assigned(CMS_SignerInfo_set1_signer_cert); + if FuncLoadError then + begin + {$if not defined(CMS_SignerInfo_set1_signer_cert_allownil)} + CMS_SignerInfo_set1_signer_cert := @ERR_CMS_SignerInfo_set1_signer_cert; + {$ifend} + {$if declared(CMS_SignerInfo_set1_signer_cert_introduced)} + if LibVersion < CMS_SignerInfo_set1_signer_cert_introduced then + begin + {$if declared(FC_CMS_SignerInfo_set1_signer_cert)} + CMS_SignerInfo_set1_signer_cert := @FC_CMS_SignerInfo_set1_signer_cert; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CMS_SignerInfo_set1_signer_cert_removed)} + if CMS_SignerInfo_set1_signer_cert_removed <= LibVersion then + begin + {$if declared(_CMS_SignerInfo_set1_signer_cert)} + CMS_SignerInfo_set1_signer_cert := @_CMS_SignerInfo_set1_signer_cert; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CMS_SignerInfo_set1_signer_cert_allownil)} + if FuncLoadError then + AFailed.Add('CMS_SignerInfo_set1_signer_cert'); + {$ifend} + end; + + + CMS_SignerInfo_get0_signer_id := LoadLibFunction(ADllHandle, CMS_SignerInfo_get0_signer_id_procname); + FuncLoadError := not assigned(CMS_SignerInfo_get0_signer_id); + if FuncLoadError then + begin + {$if not defined(CMS_SignerInfo_get0_signer_id_allownil)} + CMS_SignerInfo_get0_signer_id := @ERR_CMS_SignerInfo_get0_signer_id; + {$ifend} + {$if declared(CMS_SignerInfo_get0_signer_id_introduced)} + if LibVersion < CMS_SignerInfo_get0_signer_id_introduced then + begin + {$if declared(FC_CMS_SignerInfo_get0_signer_id)} + CMS_SignerInfo_get0_signer_id := @FC_CMS_SignerInfo_get0_signer_id; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CMS_SignerInfo_get0_signer_id_removed)} + if CMS_SignerInfo_get0_signer_id_removed <= LibVersion then + begin + {$if declared(_CMS_SignerInfo_get0_signer_id)} + CMS_SignerInfo_get0_signer_id := @_CMS_SignerInfo_get0_signer_id; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CMS_SignerInfo_get0_signer_id_allownil)} + if FuncLoadError then + AFailed.Add('CMS_SignerInfo_get0_signer_id'); + {$ifend} + end; + + + CMS_SignerInfo_cert_cmp := LoadLibFunction(ADllHandle, CMS_SignerInfo_cert_cmp_procname); + FuncLoadError := not assigned(CMS_SignerInfo_cert_cmp); + if FuncLoadError then + begin + {$if not defined(CMS_SignerInfo_cert_cmp_allownil)} + CMS_SignerInfo_cert_cmp := @ERR_CMS_SignerInfo_cert_cmp; + {$ifend} + {$if declared(CMS_SignerInfo_cert_cmp_introduced)} + if LibVersion < CMS_SignerInfo_cert_cmp_introduced then + begin + {$if declared(FC_CMS_SignerInfo_cert_cmp)} + CMS_SignerInfo_cert_cmp := @FC_CMS_SignerInfo_cert_cmp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CMS_SignerInfo_cert_cmp_removed)} + if CMS_SignerInfo_cert_cmp_removed <= LibVersion then + begin + {$if declared(_CMS_SignerInfo_cert_cmp)} + CMS_SignerInfo_cert_cmp := @_CMS_SignerInfo_cert_cmp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CMS_SignerInfo_cert_cmp_allownil)} + if FuncLoadError then + AFailed.Add('CMS_SignerInfo_cert_cmp'); + {$ifend} + end; + + + CMS_SignerInfo_get0_algs := LoadLibFunction(ADllHandle, CMS_SignerInfo_get0_algs_procname); + FuncLoadError := not assigned(CMS_SignerInfo_get0_algs); + if FuncLoadError then + begin + {$if not defined(CMS_SignerInfo_get0_algs_allownil)} + CMS_SignerInfo_get0_algs := @ERR_CMS_SignerInfo_get0_algs; + {$ifend} + {$if declared(CMS_SignerInfo_get0_algs_introduced)} + if LibVersion < CMS_SignerInfo_get0_algs_introduced then + begin + {$if declared(FC_CMS_SignerInfo_get0_algs)} + CMS_SignerInfo_get0_algs := @FC_CMS_SignerInfo_get0_algs; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CMS_SignerInfo_get0_algs_removed)} + if CMS_SignerInfo_get0_algs_removed <= LibVersion then + begin + {$if declared(_CMS_SignerInfo_get0_algs)} + CMS_SignerInfo_get0_algs := @_CMS_SignerInfo_get0_algs; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CMS_SignerInfo_get0_algs_allownil)} + if FuncLoadError then + AFailed.Add('CMS_SignerInfo_get0_algs'); + {$ifend} + end; + + + CMS_SignerInfo_get0_signature := LoadLibFunction(ADllHandle, CMS_SignerInfo_get0_signature_procname); + FuncLoadError := not assigned(CMS_SignerInfo_get0_signature); + if FuncLoadError then + begin + {$if not defined(CMS_SignerInfo_get0_signature_allownil)} + CMS_SignerInfo_get0_signature := @ERR_CMS_SignerInfo_get0_signature; + {$ifend} + {$if declared(CMS_SignerInfo_get0_signature_introduced)} + if LibVersion < CMS_SignerInfo_get0_signature_introduced then + begin + {$if declared(FC_CMS_SignerInfo_get0_signature)} + CMS_SignerInfo_get0_signature := @FC_CMS_SignerInfo_get0_signature; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CMS_SignerInfo_get0_signature_removed)} + if CMS_SignerInfo_get0_signature_removed <= LibVersion then + begin + {$if declared(_CMS_SignerInfo_get0_signature)} + CMS_SignerInfo_get0_signature := @_CMS_SignerInfo_get0_signature; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CMS_SignerInfo_get0_signature_allownil)} + if FuncLoadError then + AFailed.Add('CMS_SignerInfo_get0_signature'); + {$ifend} + end; + + + CMS_SignerInfo_sign := LoadLibFunction(ADllHandle, CMS_SignerInfo_sign_procname); + FuncLoadError := not assigned(CMS_SignerInfo_sign); + if FuncLoadError then + begin + {$if not defined(CMS_SignerInfo_sign_allownil)} + CMS_SignerInfo_sign := @ERR_CMS_SignerInfo_sign; + {$ifend} + {$if declared(CMS_SignerInfo_sign_introduced)} + if LibVersion < CMS_SignerInfo_sign_introduced then + begin + {$if declared(FC_CMS_SignerInfo_sign)} + CMS_SignerInfo_sign := @FC_CMS_SignerInfo_sign; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CMS_SignerInfo_sign_removed)} + if CMS_SignerInfo_sign_removed <= LibVersion then + begin + {$if declared(_CMS_SignerInfo_sign)} + CMS_SignerInfo_sign := @_CMS_SignerInfo_sign; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CMS_SignerInfo_sign_allownil)} + if FuncLoadError then + AFailed.Add('CMS_SignerInfo_sign'); + {$ifend} + end; + + + CMS_SignerInfo_verify := LoadLibFunction(ADllHandle, CMS_SignerInfo_verify_procname); + FuncLoadError := not assigned(CMS_SignerInfo_verify); + if FuncLoadError then + begin + {$if not defined(CMS_SignerInfo_verify_allownil)} + CMS_SignerInfo_verify := @ERR_CMS_SignerInfo_verify; + {$ifend} + {$if declared(CMS_SignerInfo_verify_introduced)} + if LibVersion < CMS_SignerInfo_verify_introduced then + begin + {$if declared(FC_CMS_SignerInfo_verify)} + CMS_SignerInfo_verify := @FC_CMS_SignerInfo_verify; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CMS_SignerInfo_verify_removed)} + if CMS_SignerInfo_verify_removed <= LibVersion then + begin + {$if declared(_CMS_SignerInfo_verify)} + CMS_SignerInfo_verify := @_CMS_SignerInfo_verify; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CMS_SignerInfo_verify_allownil)} + if FuncLoadError then + AFailed.Add('CMS_SignerInfo_verify'); + {$ifend} + end; + + + CMS_SignerInfo_verify_content := LoadLibFunction(ADllHandle, CMS_SignerInfo_verify_content_procname); + FuncLoadError := not assigned(CMS_SignerInfo_verify_content); + if FuncLoadError then + begin + {$if not defined(CMS_SignerInfo_verify_content_allownil)} + CMS_SignerInfo_verify_content := @ERR_CMS_SignerInfo_verify_content; + {$ifend} + {$if declared(CMS_SignerInfo_verify_content_introduced)} + if LibVersion < CMS_SignerInfo_verify_content_introduced then + begin + {$if declared(FC_CMS_SignerInfo_verify_content)} + CMS_SignerInfo_verify_content := @FC_CMS_SignerInfo_verify_content; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CMS_SignerInfo_verify_content_removed)} + if CMS_SignerInfo_verify_content_removed <= LibVersion then + begin + {$if declared(_CMS_SignerInfo_verify_content)} + CMS_SignerInfo_verify_content := @_CMS_SignerInfo_verify_content; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CMS_SignerInfo_verify_content_allownil)} + if FuncLoadError then + AFailed.Add('CMS_SignerInfo_verify_content'); + {$ifend} + end; + + + CMS_signed_get_attr_count := LoadLibFunction(ADllHandle, CMS_signed_get_attr_count_procname); + FuncLoadError := not assigned(CMS_signed_get_attr_count); + if FuncLoadError then + begin + {$if not defined(CMS_signed_get_attr_count_allownil)} + CMS_signed_get_attr_count := @ERR_CMS_signed_get_attr_count; + {$ifend} + {$if declared(CMS_signed_get_attr_count_introduced)} + if LibVersion < CMS_signed_get_attr_count_introduced then + begin + {$if declared(FC_CMS_signed_get_attr_count)} + CMS_signed_get_attr_count := @FC_CMS_signed_get_attr_count; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CMS_signed_get_attr_count_removed)} + if CMS_signed_get_attr_count_removed <= LibVersion then + begin + {$if declared(_CMS_signed_get_attr_count)} + CMS_signed_get_attr_count := @_CMS_signed_get_attr_count; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CMS_signed_get_attr_count_allownil)} + if FuncLoadError then + AFailed.Add('CMS_signed_get_attr_count'); + {$ifend} + end; + + + CMS_signed_get_attr_by_NID := LoadLibFunction(ADllHandle, CMS_signed_get_attr_by_NID_procname); + FuncLoadError := not assigned(CMS_signed_get_attr_by_NID); + if FuncLoadError then + begin + {$if not defined(CMS_signed_get_attr_by_NID_allownil)} + CMS_signed_get_attr_by_NID := @ERR_CMS_signed_get_attr_by_NID; + {$ifend} + {$if declared(CMS_signed_get_attr_by_NID_introduced)} + if LibVersion < CMS_signed_get_attr_by_NID_introduced then + begin + {$if declared(FC_CMS_signed_get_attr_by_NID)} + CMS_signed_get_attr_by_NID := @FC_CMS_signed_get_attr_by_NID; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CMS_signed_get_attr_by_NID_removed)} + if CMS_signed_get_attr_by_NID_removed <= LibVersion then + begin + {$if declared(_CMS_signed_get_attr_by_NID)} + CMS_signed_get_attr_by_NID := @_CMS_signed_get_attr_by_NID; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CMS_signed_get_attr_by_NID_allownil)} + if FuncLoadError then + AFailed.Add('CMS_signed_get_attr_by_NID'); + {$ifend} + end; + + + CMS_signed_get_attr_by_OBJ := LoadLibFunction(ADllHandle, CMS_signed_get_attr_by_OBJ_procname); + FuncLoadError := not assigned(CMS_signed_get_attr_by_OBJ); + if FuncLoadError then + begin + {$if not defined(CMS_signed_get_attr_by_OBJ_allownil)} + CMS_signed_get_attr_by_OBJ := @ERR_CMS_signed_get_attr_by_OBJ; + {$ifend} + {$if declared(CMS_signed_get_attr_by_OBJ_introduced)} + if LibVersion < CMS_signed_get_attr_by_OBJ_introduced then + begin + {$if declared(FC_CMS_signed_get_attr_by_OBJ)} + CMS_signed_get_attr_by_OBJ := @FC_CMS_signed_get_attr_by_OBJ; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CMS_signed_get_attr_by_OBJ_removed)} + if CMS_signed_get_attr_by_OBJ_removed <= LibVersion then + begin + {$if declared(_CMS_signed_get_attr_by_OBJ)} + CMS_signed_get_attr_by_OBJ := @_CMS_signed_get_attr_by_OBJ; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CMS_signed_get_attr_by_OBJ_allownil)} + if FuncLoadError then + AFailed.Add('CMS_signed_get_attr_by_OBJ'); + {$ifend} + end; + + + CMS_signed_get_attr := LoadLibFunction(ADllHandle, CMS_signed_get_attr_procname); + FuncLoadError := not assigned(CMS_signed_get_attr); + if FuncLoadError then + begin + {$if not defined(CMS_signed_get_attr_allownil)} + CMS_signed_get_attr := @ERR_CMS_signed_get_attr; + {$ifend} + {$if declared(CMS_signed_get_attr_introduced)} + if LibVersion < CMS_signed_get_attr_introduced then + begin + {$if declared(FC_CMS_signed_get_attr)} + CMS_signed_get_attr := @FC_CMS_signed_get_attr; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CMS_signed_get_attr_removed)} + if CMS_signed_get_attr_removed <= LibVersion then + begin + {$if declared(_CMS_signed_get_attr)} + CMS_signed_get_attr := @_CMS_signed_get_attr; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CMS_signed_get_attr_allownil)} + if FuncLoadError then + AFailed.Add('CMS_signed_get_attr'); + {$ifend} + end; + + + CMS_signed_delete_attr := LoadLibFunction(ADllHandle, CMS_signed_delete_attr_procname); + FuncLoadError := not assigned(CMS_signed_delete_attr); + if FuncLoadError then + begin + {$if not defined(CMS_signed_delete_attr_allownil)} + CMS_signed_delete_attr := @ERR_CMS_signed_delete_attr; + {$ifend} + {$if declared(CMS_signed_delete_attr_introduced)} + if LibVersion < CMS_signed_delete_attr_introduced then + begin + {$if declared(FC_CMS_signed_delete_attr)} + CMS_signed_delete_attr := @FC_CMS_signed_delete_attr; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CMS_signed_delete_attr_removed)} + if CMS_signed_delete_attr_removed <= LibVersion then + begin + {$if declared(_CMS_signed_delete_attr)} + CMS_signed_delete_attr := @_CMS_signed_delete_attr; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CMS_signed_delete_attr_allownil)} + if FuncLoadError then + AFailed.Add('CMS_signed_delete_attr'); + {$ifend} + end; + + + CMS_signed_add1_attr := LoadLibFunction(ADllHandle, CMS_signed_add1_attr_procname); + FuncLoadError := not assigned(CMS_signed_add1_attr); + if FuncLoadError then + begin + {$if not defined(CMS_signed_add1_attr_allownil)} + CMS_signed_add1_attr := @ERR_CMS_signed_add1_attr; + {$ifend} + {$if declared(CMS_signed_add1_attr_introduced)} + if LibVersion < CMS_signed_add1_attr_introduced then + begin + {$if declared(FC_CMS_signed_add1_attr)} + CMS_signed_add1_attr := @FC_CMS_signed_add1_attr; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CMS_signed_add1_attr_removed)} + if CMS_signed_add1_attr_removed <= LibVersion then + begin + {$if declared(_CMS_signed_add1_attr)} + CMS_signed_add1_attr := @_CMS_signed_add1_attr; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CMS_signed_add1_attr_allownil)} + if FuncLoadError then + AFailed.Add('CMS_signed_add1_attr'); + {$ifend} + end; + + + CMS_signed_add1_attr_by_OBJ := LoadLibFunction(ADllHandle, CMS_signed_add1_attr_by_OBJ_procname); + FuncLoadError := not assigned(CMS_signed_add1_attr_by_OBJ); + if FuncLoadError then + begin + {$if not defined(CMS_signed_add1_attr_by_OBJ_allownil)} + CMS_signed_add1_attr_by_OBJ := @ERR_CMS_signed_add1_attr_by_OBJ; + {$ifend} + {$if declared(CMS_signed_add1_attr_by_OBJ_introduced)} + if LibVersion < CMS_signed_add1_attr_by_OBJ_introduced then + begin + {$if declared(FC_CMS_signed_add1_attr_by_OBJ)} + CMS_signed_add1_attr_by_OBJ := @FC_CMS_signed_add1_attr_by_OBJ; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CMS_signed_add1_attr_by_OBJ_removed)} + if CMS_signed_add1_attr_by_OBJ_removed <= LibVersion then + begin + {$if declared(_CMS_signed_add1_attr_by_OBJ)} + CMS_signed_add1_attr_by_OBJ := @_CMS_signed_add1_attr_by_OBJ; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CMS_signed_add1_attr_by_OBJ_allownil)} + if FuncLoadError then + AFailed.Add('CMS_signed_add1_attr_by_OBJ'); + {$ifend} + end; + + + CMS_signed_add1_attr_by_NID := LoadLibFunction(ADllHandle, CMS_signed_add1_attr_by_NID_procname); + FuncLoadError := not assigned(CMS_signed_add1_attr_by_NID); + if FuncLoadError then + begin + {$if not defined(CMS_signed_add1_attr_by_NID_allownil)} + CMS_signed_add1_attr_by_NID := @ERR_CMS_signed_add1_attr_by_NID; + {$ifend} + {$if declared(CMS_signed_add1_attr_by_NID_introduced)} + if LibVersion < CMS_signed_add1_attr_by_NID_introduced then + begin + {$if declared(FC_CMS_signed_add1_attr_by_NID)} + CMS_signed_add1_attr_by_NID := @FC_CMS_signed_add1_attr_by_NID; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CMS_signed_add1_attr_by_NID_removed)} + if CMS_signed_add1_attr_by_NID_removed <= LibVersion then + begin + {$if declared(_CMS_signed_add1_attr_by_NID)} + CMS_signed_add1_attr_by_NID := @_CMS_signed_add1_attr_by_NID; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CMS_signed_add1_attr_by_NID_allownil)} + if FuncLoadError then + AFailed.Add('CMS_signed_add1_attr_by_NID'); + {$ifend} + end; + + + CMS_signed_add1_attr_by_txt := LoadLibFunction(ADllHandle, CMS_signed_add1_attr_by_txt_procname); + FuncLoadError := not assigned(CMS_signed_add1_attr_by_txt); + if FuncLoadError then + begin + {$if not defined(CMS_signed_add1_attr_by_txt_allownil)} + CMS_signed_add1_attr_by_txt := @ERR_CMS_signed_add1_attr_by_txt; + {$ifend} + {$if declared(CMS_signed_add1_attr_by_txt_introduced)} + if LibVersion < CMS_signed_add1_attr_by_txt_introduced then + begin + {$if declared(FC_CMS_signed_add1_attr_by_txt)} + CMS_signed_add1_attr_by_txt := @FC_CMS_signed_add1_attr_by_txt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CMS_signed_add1_attr_by_txt_removed)} + if CMS_signed_add1_attr_by_txt_removed <= LibVersion then + begin + {$if declared(_CMS_signed_add1_attr_by_txt)} + CMS_signed_add1_attr_by_txt := @_CMS_signed_add1_attr_by_txt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CMS_signed_add1_attr_by_txt_allownil)} + if FuncLoadError then + AFailed.Add('CMS_signed_add1_attr_by_txt'); + {$ifend} + end; + + + CMS_signed_get0_data_by_OBJ := LoadLibFunction(ADllHandle, CMS_signed_get0_data_by_OBJ_procname); + FuncLoadError := not assigned(CMS_signed_get0_data_by_OBJ); + if FuncLoadError then + begin + {$if not defined(CMS_signed_get0_data_by_OBJ_allownil)} + CMS_signed_get0_data_by_OBJ := @ERR_CMS_signed_get0_data_by_OBJ; + {$ifend} + {$if declared(CMS_signed_get0_data_by_OBJ_introduced)} + if LibVersion < CMS_signed_get0_data_by_OBJ_introduced then + begin + {$if declared(FC_CMS_signed_get0_data_by_OBJ)} + CMS_signed_get0_data_by_OBJ := @FC_CMS_signed_get0_data_by_OBJ; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CMS_signed_get0_data_by_OBJ_removed)} + if CMS_signed_get0_data_by_OBJ_removed <= LibVersion then + begin + {$if declared(_CMS_signed_get0_data_by_OBJ)} + CMS_signed_get0_data_by_OBJ := @_CMS_signed_get0_data_by_OBJ; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CMS_signed_get0_data_by_OBJ_allownil)} + if FuncLoadError then + AFailed.Add('CMS_signed_get0_data_by_OBJ'); + {$ifend} + end; + + + CMS_unsigned_get_attr_count := LoadLibFunction(ADllHandle, CMS_unsigned_get_attr_count_procname); + FuncLoadError := not assigned(CMS_unsigned_get_attr_count); + if FuncLoadError then + begin + {$if not defined(CMS_unsigned_get_attr_count_allownil)} + CMS_unsigned_get_attr_count := @ERR_CMS_unsigned_get_attr_count; + {$ifend} + {$if declared(CMS_unsigned_get_attr_count_introduced)} + if LibVersion < CMS_unsigned_get_attr_count_introduced then + begin + {$if declared(FC_CMS_unsigned_get_attr_count)} + CMS_unsigned_get_attr_count := @FC_CMS_unsigned_get_attr_count; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CMS_unsigned_get_attr_count_removed)} + if CMS_unsigned_get_attr_count_removed <= LibVersion then + begin + {$if declared(_CMS_unsigned_get_attr_count)} + CMS_unsigned_get_attr_count := @_CMS_unsigned_get_attr_count; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CMS_unsigned_get_attr_count_allownil)} + if FuncLoadError then + AFailed.Add('CMS_unsigned_get_attr_count'); + {$ifend} + end; + + + CMS_unsigned_get_attr_by_NID := LoadLibFunction(ADllHandle, CMS_unsigned_get_attr_by_NID_procname); + FuncLoadError := not assigned(CMS_unsigned_get_attr_by_NID); + if FuncLoadError then + begin + {$if not defined(CMS_unsigned_get_attr_by_NID_allownil)} + CMS_unsigned_get_attr_by_NID := @ERR_CMS_unsigned_get_attr_by_NID; + {$ifend} + {$if declared(CMS_unsigned_get_attr_by_NID_introduced)} + if LibVersion < CMS_unsigned_get_attr_by_NID_introduced then + begin + {$if declared(FC_CMS_unsigned_get_attr_by_NID)} + CMS_unsigned_get_attr_by_NID := @FC_CMS_unsigned_get_attr_by_NID; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CMS_unsigned_get_attr_by_NID_removed)} + if CMS_unsigned_get_attr_by_NID_removed <= LibVersion then + begin + {$if declared(_CMS_unsigned_get_attr_by_NID)} + CMS_unsigned_get_attr_by_NID := @_CMS_unsigned_get_attr_by_NID; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CMS_unsigned_get_attr_by_NID_allownil)} + if FuncLoadError then + AFailed.Add('CMS_unsigned_get_attr_by_NID'); + {$ifend} + end; + + + CMS_unsigned_get_attr_by_OBJ := LoadLibFunction(ADllHandle, CMS_unsigned_get_attr_by_OBJ_procname); + FuncLoadError := not assigned(CMS_unsigned_get_attr_by_OBJ); + if FuncLoadError then + begin + {$if not defined(CMS_unsigned_get_attr_by_OBJ_allownil)} + CMS_unsigned_get_attr_by_OBJ := @ERR_CMS_unsigned_get_attr_by_OBJ; + {$ifend} + {$if declared(CMS_unsigned_get_attr_by_OBJ_introduced)} + if LibVersion < CMS_unsigned_get_attr_by_OBJ_introduced then + begin + {$if declared(FC_CMS_unsigned_get_attr_by_OBJ)} + CMS_unsigned_get_attr_by_OBJ := @FC_CMS_unsigned_get_attr_by_OBJ; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CMS_unsigned_get_attr_by_OBJ_removed)} + if CMS_unsigned_get_attr_by_OBJ_removed <= LibVersion then + begin + {$if declared(_CMS_unsigned_get_attr_by_OBJ)} + CMS_unsigned_get_attr_by_OBJ := @_CMS_unsigned_get_attr_by_OBJ; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CMS_unsigned_get_attr_by_OBJ_allownil)} + if FuncLoadError then + AFailed.Add('CMS_unsigned_get_attr_by_OBJ'); + {$ifend} + end; + + + CMS_unsigned_get_attr := LoadLibFunction(ADllHandle, CMS_unsigned_get_attr_procname); + FuncLoadError := not assigned(CMS_unsigned_get_attr); + if FuncLoadError then + begin + {$if not defined(CMS_unsigned_get_attr_allownil)} + CMS_unsigned_get_attr := @ERR_CMS_unsigned_get_attr; + {$ifend} + {$if declared(CMS_unsigned_get_attr_introduced)} + if LibVersion < CMS_unsigned_get_attr_introduced then + begin + {$if declared(FC_CMS_unsigned_get_attr)} + CMS_unsigned_get_attr := @FC_CMS_unsigned_get_attr; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CMS_unsigned_get_attr_removed)} + if CMS_unsigned_get_attr_removed <= LibVersion then + begin + {$if declared(_CMS_unsigned_get_attr)} + CMS_unsigned_get_attr := @_CMS_unsigned_get_attr; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CMS_unsigned_get_attr_allownil)} + if FuncLoadError then + AFailed.Add('CMS_unsigned_get_attr'); + {$ifend} + end; + + + CMS_unsigned_delete_attr := LoadLibFunction(ADllHandle, CMS_unsigned_delete_attr_procname); + FuncLoadError := not assigned(CMS_unsigned_delete_attr); + if FuncLoadError then + begin + {$if not defined(CMS_unsigned_delete_attr_allownil)} + CMS_unsigned_delete_attr := @ERR_CMS_unsigned_delete_attr; + {$ifend} + {$if declared(CMS_unsigned_delete_attr_introduced)} + if LibVersion < CMS_unsigned_delete_attr_introduced then + begin + {$if declared(FC_CMS_unsigned_delete_attr)} + CMS_unsigned_delete_attr := @FC_CMS_unsigned_delete_attr; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CMS_unsigned_delete_attr_removed)} + if CMS_unsigned_delete_attr_removed <= LibVersion then + begin + {$if declared(_CMS_unsigned_delete_attr)} + CMS_unsigned_delete_attr := @_CMS_unsigned_delete_attr; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CMS_unsigned_delete_attr_allownil)} + if FuncLoadError then + AFailed.Add('CMS_unsigned_delete_attr'); + {$ifend} + end; + + + CMS_unsigned_add1_attr := LoadLibFunction(ADllHandle, CMS_unsigned_add1_attr_procname); + FuncLoadError := not assigned(CMS_unsigned_add1_attr); + if FuncLoadError then + begin + {$if not defined(CMS_unsigned_add1_attr_allownil)} + CMS_unsigned_add1_attr := @ERR_CMS_unsigned_add1_attr; + {$ifend} + {$if declared(CMS_unsigned_add1_attr_introduced)} + if LibVersion < CMS_unsigned_add1_attr_introduced then + begin + {$if declared(FC_CMS_unsigned_add1_attr)} + CMS_unsigned_add1_attr := @FC_CMS_unsigned_add1_attr; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CMS_unsigned_add1_attr_removed)} + if CMS_unsigned_add1_attr_removed <= LibVersion then + begin + {$if declared(_CMS_unsigned_add1_attr)} + CMS_unsigned_add1_attr := @_CMS_unsigned_add1_attr; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CMS_unsigned_add1_attr_allownil)} + if FuncLoadError then + AFailed.Add('CMS_unsigned_add1_attr'); + {$ifend} + end; + + + CMS_unsigned_add1_attr_by_OBJ := LoadLibFunction(ADllHandle, CMS_unsigned_add1_attr_by_OBJ_procname); + FuncLoadError := not assigned(CMS_unsigned_add1_attr_by_OBJ); + if FuncLoadError then + begin + {$if not defined(CMS_unsigned_add1_attr_by_OBJ_allownil)} + CMS_unsigned_add1_attr_by_OBJ := @ERR_CMS_unsigned_add1_attr_by_OBJ; + {$ifend} + {$if declared(CMS_unsigned_add1_attr_by_OBJ_introduced)} + if LibVersion < CMS_unsigned_add1_attr_by_OBJ_introduced then + begin + {$if declared(FC_CMS_unsigned_add1_attr_by_OBJ)} + CMS_unsigned_add1_attr_by_OBJ := @FC_CMS_unsigned_add1_attr_by_OBJ; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CMS_unsigned_add1_attr_by_OBJ_removed)} + if CMS_unsigned_add1_attr_by_OBJ_removed <= LibVersion then + begin + {$if declared(_CMS_unsigned_add1_attr_by_OBJ)} + CMS_unsigned_add1_attr_by_OBJ := @_CMS_unsigned_add1_attr_by_OBJ; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CMS_unsigned_add1_attr_by_OBJ_allownil)} + if FuncLoadError then + AFailed.Add('CMS_unsigned_add1_attr_by_OBJ'); + {$ifend} + end; + + + CMS_unsigned_add1_attr_by_NID := LoadLibFunction(ADllHandle, CMS_unsigned_add1_attr_by_NID_procname); + FuncLoadError := not assigned(CMS_unsigned_add1_attr_by_NID); + if FuncLoadError then + begin + {$if not defined(CMS_unsigned_add1_attr_by_NID_allownil)} + CMS_unsigned_add1_attr_by_NID := @ERR_CMS_unsigned_add1_attr_by_NID; + {$ifend} + {$if declared(CMS_unsigned_add1_attr_by_NID_introduced)} + if LibVersion < CMS_unsigned_add1_attr_by_NID_introduced then + begin + {$if declared(FC_CMS_unsigned_add1_attr_by_NID)} + CMS_unsigned_add1_attr_by_NID := @FC_CMS_unsigned_add1_attr_by_NID; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CMS_unsigned_add1_attr_by_NID_removed)} + if CMS_unsigned_add1_attr_by_NID_removed <= LibVersion then + begin + {$if declared(_CMS_unsigned_add1_attr_by_NID)} + CMS_unsigned_add1_attr_by_NID := @_CMS_unsigned_add1_attr_by_NID; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CMS_unsigned_add1_attr_by_NID_allownil)} + if FuncLoadError then + AFailed.Add('CMS_unsigned_add1_attr_by_NID'); + {$ifend} + end; + + + CMS_unsigned_add1_attr_by_txt := LoadLibFunction(ADllHandle, CMS_unsigned_add1_attr_by_txt_procname); + FuncLoadError := not assigned(CMS_unsigned_add1_attr_by_txt); + if FuncLoadError then + begin + {$if not defined(CMS_unsigned_add1_attr_by_txt_allownil)} + CMS_unsigned_add1_attr_by_txt := @ERR_CMS_unsigned_add1_attr_by_txt; + {$ifend} + {$if declared(CMS_unsigned_add1_attr_by_txt_introduced)} + if LibVersion < CMS_unsigned_add1_attr_by_txt_introduced then + begin + {$if declared(FC_CMS_unsigned_add1_attr_by_txt)} + CMS_unsigned_add1_attr_by_txt := @FC_CMS_unsigned_add1_attr_by_txt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CMS_unsigned_add1_attr_by_txt_removed)} + if CMS_unsigned_add1_attr_by_txt_removed <= LibVersion then + begin + {$if declared(_CMS_unsigned_add1_attr_by_txt)} + CMS_unsigned_add1_attr_by_txt := @_CMS_unsigned_add1_attr_by_txt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CMS_unsigned_add1_attr_by_txt_allownil)} + if FuncLoadError then + AFailed.Add('CMS_unsigned_add1_attr_by_txt'); + {$ifend} + end; + + + CMS_unsigned_get0_data_by_OBJ := LoadLibFunction(ADllHandle, CMS_unsigned_get0_data_by_OBJ_procname); + FuncLoadError := not assigned(CMS_unsigned_get0_data_by_OBJ); + if FuncLoadError then + begin + {$if not defined(CMS_unsigned_get0_data_by_OBJ_allownil)} + CMS_unsigned_get0_data_by_OBJ := @ERR_CMS_unsigned_get0_data_by_OBJ; + {$ifend} + {$if declared(CMS_unsigned_get0_data_by_OBJ_introduced)} + if LibVersion < CMS_unsigned_get0_data_by_OBJ_introduced then + begin + {$if declared(FC_CMS_unsigned_get0_data_by_OBJ)} + CMS_unsigned_get0_data_by_OBJ := @FC_CMS_unsigned_get0_data_by_OBJ; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CMS_unsigned_get0_data_by_OBJ_removed)} + if CMS_unsigned_get0_data_by_OBJ_removed <= LibVersion then + begin + {$if declared(_CMS_unsigned_get0_data_by_OBJ)} + CMS_unsigned_get0_data_by_OBJ := @_CMS_unsigned_get0_data_by_OBJ; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CMS_unsigned_get0_data_by_OBJ_allownil)} + if FuncLoadError then + AFailed.Add('CMS_unsigned_get0_data_by_OBJ'); + {$ifend} + end; + + + CMS_get1_ReceiptRequest := LoadLibFunction(ADllHandle, CMS_get1_ReceiptRequest_procname); + FuncLoadError := not assigned(CMS_get1_ReceiptRequest); + if FuncLoadError then + begin + {$if not defined(CMS_get1_ReceiptRequest_allownil)} + CMS_get1_ReceiptRequest := @ERR_CMS_get1_ReceiptRequest; + {$ifend} + {$if declared(CMS_get1_ReceiptRequest_introduced)} + if LibVersion < CMS_get1_ReceiptRequest_introduced then + begin + {$if declared(FC_CMS_get1_ReceiptRequest)} + CMS_get1_ReceiptRequest := @FC_CMS_get1_ReceiptRequest; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CMS_get1_ReceiptRequest_removed)} + if CMS_get1_ReceiptRequest_removed <= LibVersion then + begin + {$if declared(_CMS_get1_ReceiptRequest)} + CMS_get1_ReceiptRequest := @_CMS_get1_ReceiptRequest; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CMS_get1_ReceiptRequest_allownil)} + if FuncLoadError then + AFailed.Add('CMS_get1_ReceiptRequest'); + {$ifend} + end; + + + CMS_add1_ReceiptRequest := LoadLibFunction(ADllHandle, CMS_add1_ReceiptRequest_procname); + FuncLoadError := not assigned(CMS_add1_ReceiptRequest); + if FuncLoadError then + begin + {$if not defined(CMS_add1_ReceiptRequest_allownil)} + CMS_add1_ReceiptRequest := @ERR_CMS_add1_ReceiptRequest; + {$ifend} + {$if declared(CMS_add1_ReceiptRequest_introduced)} + if LibVersion < CMS_add1_ReceiptRequest_introduced then + begin + {$if declared(FC_CMS_add1_ReceiptRequest)} + CMS_add1_ReceiptRequest := @FC_CMS_add1_ReceiptRequest; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CMS_add1_ReceiptRequest_removed)} + if CMS_add1_ReceiptRequest_removed <= LibVersion then + begin + {$if declared(_CMS_add1_ReceiptRequest)} + CMS_add1_ReceiptRequest := @_CMS_add1_ReceiptRequest; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CMS_add1_ReceiptRequest_allownil)} + if FuncLoadError then + AFailed.Add('CMS_add1_ReceiptRequest'); + {$ifend} + end; + + + CMS_RecipientInfo_kari_get0_orig_id := LoadLibFunction(ADllHandle, CMS_RecipientInfo_kari_get0_orig_id_procname); + FuncLoadError := not assigned(CMS_RecipientInfo_kari_get0_orig_id); + if FuncLoadError then + begin + {$if not defined(CMS_RecipientInfo_kari_get0_orig_id_allownil)} + CMS_RecipientInfo_kari_get0_orig_id := @ERR_CMS_RecipientInfo_kari_get0_orig_id; + {$ifend} + {$if declared(CMS_RecipientInfo_kari_get0_orig_id_introduced)} + if LibVersion < CMS_RecipientInfo_kari_get0_orig_id_introduced then + begin + {$if declared(FC_CMS_RecipientInfo_kari_get0_orig_id)} + CMS_RecipientInfo_kari_get0_orig_id := @FC_CMS_RecipientInfo_kari_get0_orig_id; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CMS_RecipientInfo_kari_get0_orig_id_removed)} + if CMS_RecipientInfo_kari_get0_orig_id_removed <= LibVersion then + begin + {$if declared(_CMS_RecipientInfo_kari_get0_orig_id)} + CMS_RecipientInfo_kari_get0_orig_id := @_CMS_RecipientInfo_kari_get0_orig_id; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CMS_RecipientInfo_kari_get0_orig_id_allownil)} + if FuncLoadError then + AFailed.Add('CMS_RecipientInfo_kari_get0_orig_id'); + {$ifend} + end; + + + CMS_RecipientInfo_kari_orig_id_cmp := LoadLibFunction(ADllHandle, CMS_RecipientInfo_kari_orig_id_cmp_procname); + FuncLoadError := not assigned(CMS_RecipientInfo_kari_orig_id_cmp); + if FuncLoadError then + begin + {$if not defined(CMS_RecipientInfo_kari_orig_id_cmp_allownil)} + CMS_RecipientInfo_kari_orig_id_cmp := @ERR_CMS_RecipientInfo_kari_orig_id_cmp; + {$ifend} + {$if declared(CMS_RecipientInfo_kari_orig_id_cmp_introduced)} + if LibVersion < CMS_RecipientInfo_kari_orig_id_cmp_introduced then + begin + {$if declared(FC_CMS_RecipientInfo_kari_orig_id_cmp)} + CMS_RecipientInfo_kari_orig_id_cmp := @FC_CMS_RecipientInfo_kari_orig_id_cmp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CMS_RecipientInfo_kari_orig_id_cmp_removed)} + if CMS_RecipientInfo_kari_orig_id_cmp_removed <= LibVersion then + begin + {$if declared(_CMS_RecipientInfo_kari_orig_id_cmp)} + CMS_RecipientInfo_kari_orig_id_cmp := @_CMS_RecipientInfo_kari_orig_id_cmp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CMS_RecipientInfo_kari_orig_id_cmp_allownil)} + if FuncLoadError then + AFailed.Add('CMS_RecipientInfo_kari_orig_id_cmp'); + {$ifend} + end; + + + CMS_RecipientEncryptedKey_get0_id := LoadLibFunction(ADllHandle, CMS_RecipientEncryptedKey_get0_id_procname); + FuncLoadError := not assigned(CMS_RecipientEncryptedKey_get0_id); + if FuncLoadError then + begin + {$if not defined(CMS_RecipientEncryptedKey_get0_id_allownil)} + CMS_RecipientEncryptedKey_get0_id := @ERR_CMS_RecipientEncryptedKey_get0_id; + {$ifend} + {$if declared(CMS_RecipientEncryptedKey_get0_id_introduced)} + if LibVersion < CMS_RecipientEncryptedKey_get0_id_introduced then + begin + {$if declared(FC_CMS_RecipientEncryptedKey_get0_id)} + CMS_RecipientEncryptedKey_get0_id := @FC_CMS_RecipientEncryptedKey_get0_id; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CMS_RecipientEncryptedKey_get0_id_removed)} + if CMS_RecipientEncryptedKey_get0_id_removed <= LibVersion then + begin + {$if declared(_CMS_RecipientEncryptedKey_get0_id)} + CMS_RecipientEncryptedKey_get0_id := @_CMS_RecipientEncryptedKey_get0_id; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CMS_RecipientEncryptedKey_get0_id_allownil)} + if FuncLoadError then + AFailed.Add('CMS_RecipientEncryptedKey_get0_id'); + {$ifend} + end; + + + CMS_RecipientEncryptedKey_cert_cmp := LoadLibFunction(ADllHandle, CMS_RecipientEncryptedKey_cert_cmp_procname); + FuncLoadError := not assigned(CMS_RecipientEncryptedKey_cert_cmp); + if FuncLoadError then + begin + {$if not defined(CMS_RecipientEncryptedKey_cert_cmp_allownil)} + CMS_RecipientEncryptedKey_cert_cmp := @ERR_CMS_RecipientEncryptedKey_cert_cmp; + {$ifend} + {$if declared(CMS_RecipientEncryptedKey_cert_cmp_introduced)} + if LibVersion < CMS_RecipientEncryptedKey_cert_cmp_introduced then + begin + {$if declared(FC_CMS_RecipientEncryptedKey_cert_cmp)} + CMS_RecipientEncryptedKey_cert_cmp := @FC_CMS_RecipientEncryptedKey_cert_cmp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CMS_RecipientEncryptedKey_cert_cmp_removed)} + if CMS_RecipientEncryptedKey_cert_cmp_removed <= LibVersion then + begin + {$if declared(_CMS_RecipientEncryptedKey_cert_cmp)} + CMS_RecipientEncryptedKey_cert_cmp := @_CMS_RecipientEncryptedKey_cert_cmp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CMS_RecipientEncryptedKey_cert_cmp_allownil)} + if FuncLoadError then + AFailed.Add('CMS_RecipientEncryptedKey_cert_cmp'); + {$ifend} + end; + + + CMS_RecipientInfo_kari_set0_pkey := LoadLibFunction(ADllHandle, CMS_RecipientInfo_kari_set0_pkey_procname); + FuncLoadError := not assigned(CMS_RecipientInfo_kari_set0_pkey); + if FuncLoadError then + begin + {$if not defined(CMS_RecipientInfo_kari_set0_pkey_allownil)} + CMS_RecipientInfo_kari_set0_pkey := @ERR_CMS_RecipientInfo_kari_set0_pkey; + {$ifend} + {$if declared(CMS_RecipientInfo_kari_set0_pkey_introduced)} + if LibVersion < CMS_RecipientInfo_kari_set0_pkey_introduced then + begin + {$if declared(FC_CMS_RecipientInfo_kari_set0_pkey)} + CMS_RecipientInfo_kari_set0_pkey := @FC_CMS_RecipientInfo_kari_set0_pkey; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CMS_RecipientInfo_kari_set0_pkey_removed)} + if CMS_RecipientInfo_kari_set0_pkey_removed <= LibVersion then + begin + {$if declared(_CMS_RecipientInfo_kari_set0_pkey)} + CMS_RecipientInfo_kari_set0_pkey := @_CMS_RecipientInfo_kari_set0_pkey; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CMS_RecipientInfo_kari_set0_pkey_allownil)} + if FuncLoadError then + AFailed.Add('CMS_RecipientInfo_kari_set0_pkey'); + {$ifend} + end; + + + CMS_RecipientInfo_kari_get0_ctx := LoadLibFunction(ADllHandle, CMS_RecipientInfo_kari_get0_ctx_procname); + FuncLoadError := not assigned(CMS_RecipientInfo_kari_get0_ctx); + if FuncLoadError then + begin + {$if not defined(CMS_RecipientInfo_kari_get0_ctx_allownil)} + CMS_RecipientInfo_kari_get0_ctx := @ERR_CMS_RecipientInfo_kari_get0_ctx; + {$ifend} + {$if declared(CMS_RecipientInfo_kari_get0_ctx_introduced)} + if LibVersion < CMS_RecipientInfo_kari_get0_ctx_introduced then + begin + {$if declared(FC_CMS_RecipientInfo_kari_get0_ctx)} + CMS_RecipientInfo_kari_get0_ctx := @FC_CMS_RecipientInfo_kari_get0_ctx; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CMS_RecipientInfo_kari_get0_ctx_removed)} + if CMS_RecipientInfo_kari_get0_ctx_removed <= LibVersion then + begin + {$if declared(_CMS_RecipientInfo_kari_get0_ctx)} + CMS_RecipientInfo_kari_get0_ctx := @_CMS_RecipientInfo_kari_get0_ctx; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CMS_RecipientInfo_kari_get0_ctx_allownil)} + if FuncLoadError then + AFailed.Add('CMS_RecipientInfo_kari_get0_ctx'); + {$ifend} + end; + + + CMS_RecipientInfo_kari_decrypt := LoadLibFunction(ADllHandle, CMS_RecipientInfo_kari_decrypt_procname); + FuncLoadError := not assigned(CMS_RecipientInfo_kari_decrypt); + if FuncLoadError then + begin + {$if not defined(CMS_RecipientInfo_kari_decrypt_allownil)} + CMS_RecipientInfo_kari_decrypt := @ERR_CMS_RecipientInfo_kari_decrypt; + {$ifend} + {$if declared(CMS_RecipientInfo_kari_decrypt_introduced)} + if LibVersion < CMS_RecipientInfo_kari_decrypt_introduced then + begin + {$if declared(FC_CMS_RecipientInfo_kari_decrypt)} + CMS_RecipientInfo_kari_decrypt := @FC_CMS_RecipientInfo_kari_decrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CMS_RecipientInfo_kari_decrypt_removed)} + if CMS_RecipientInfo_kari_decrypt_removed <= LibVersion then + begin + {$if declared(_CMS_RecipientInfo_kari_decrypt)} + CMS_RecipientInfo_kari_decrypt := @_CMS_RecipientInfo_kari_decrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CMS_RecipientInfo_kari_decrypt_allownil)} + if FuncLoadError then + AFailed.Add('CMS_RecipientInfo_kari_decrypt'); + {$ifend} + end; + + + CMS_SharedInfo_encode := LoadLibFunction(ADllHandle, CMS_SharedInfo_encode_procname); + FuncLoadError := not assigned(CMS_SharedInfo_encode); + if FuncLoadError then + begin + {$if not defined(CMS_SharedInfo_encode_allownil)} + CMS_SharedInfo_encode := @ERR_CMS_SharedInfo_encode; + {$ifend} + {$if declared(CMS_SharedInfo_encode_introduced)} + if LibVersion < CMS_SharedInfo_encode_introduced then + begin + {$if declared(FC_CMS_SharedInfo_encode)} + CMS_SharedInfo_encode := @FC_CMS_SharedInfo_encode; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CMS_SharedInfo_encode_removed)} + if CMS_SharedInfo_encode_removed <= LibVersion then + begin + {$if declared(_CMS_SharedInfo_encode)} + CMS_SharedInfo_encode := @_CMS_SharedInfo_encode; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CMS_SharedInfo_encode_allownil)} + if FuncLoadError then + AFailed.Add('CMS_SharedInfo_encode'); + {$ifend} + end; + + +end; + +procedure Unload; +begin + CMS_get0_type := nil; + CMS_dataInit := nil; + CMS_dataFinal := nil; + CMS_get0_content := nil; + CMS_is_detached := nil; + CMS_set_detached := nil; + CMS_stream := nil; + d2i_CMS_bio := nil; + i2d_CMS_bio := nil; + BIO_new_CMS := nil; + i2d_CMS_bio_stream := nil; + PEM_write_bio_CMS_stream := nil; + SMIME_read_CMS := nil; + SMIME_write_CMS := nil; + CMS_final := nil; + CMS_data := nil; + CMS_data_create := nil; + CMS_digest_verify := nil; + CMS_digest_create := nil; + CMS_EncryptedData_decrypt := nil; + CMS_EncryptedData_encrypt := nil; + CMS_EncryptedData_set1_key := nil; + CMS_decrypt := nil; + CMS_decrypt_set1_pkey := nil; + CMS_decrypt_set1_key := nil; + CMS_decrypt_set1_password := nil; + CMS_RecipientInfo_type := nil; + CMS_RecipientInfo_get0_pkey_ctx := nil; + CMS_EnvelopedData_create := nil; + CMS_add1_recipient_cert := nil; + CMS_RecipientInfo_set0_pkey := nil; + CMS_RecipientInfo_ktri_cert_cmp := nil; + CMS_RecipientInfo_ktri_get0_algs := nil; + CMS_RecipientInfo_ktri_get0_signer_id := nil; + CMS_add0_recipient_key := nil; + CMS_RecipientInfo_kekri_get0_id := nil; + CMS_RecipientInfo_set0_key := nil; + CMS_RecipientInfo_kekri_id_cmp := nil; + CMS_RecipientInfo_set0_password := nil; + CMS_add0_recipient_password := nil; + CMS_RecipientInfo_decrypt := nil; + CMS_RecipientInfo_encrypt := nil; + CMS_uncompress := nil; + CMS_compress := nil; + CMS_set1_eContentType := nil; + CMS_get0_eContentType := nil; + CMS_add0_CertificateChoices := nil; + CMS_add0_cert := nil; + CMS_add1_cert := nil; + CMS_add0_RevocationInfoChoice := nil; + CMS_add0_crl := nil; + CMS_add1_crl := nil; + CMS_SignedData_init := nil; + CMS_add1_signer := nil; + CMS_SignerInfo_get0_pkey_ctx := nil; + CMS_SignerInfo_get0_md_ctx := nil; + CMS_SignerInfo_set1_signer_cert := nil; + CMS_SignerInfo_get0_signer_id := nil; + CMS_SignerInfo_cert_cmp := nil; + CMS_SignerInfo_get0_algs := nil; + CMS_SignerInfo_get0_signature := nil; + CMS_SignerInfo_sign := nil; + CMS_SignerInfo_verify := nil; + CMS_SignerInfo_verify_content := nil; + CMS_signed_get_attr_count := nil; + CMS_signed_get_attr_by_NID := nil; + CMS_signed_get_attr_by_OBJ := nil; + CMS_signed_get_attr := nil; + CMS_signed_delete_attr := nil; + CMS_signed_add1_attr := nil; + CMS_signed_add1_attr_by_OBJ := nil; + CMS_signed_add1_attr_by_NID := nil; + CMS_signed_add1_attr_by_txt := nil; + CMS_signed_get0_data_by_OBJ := nil; + CMS_unsigned_get_attr_count := nil; + CMS_unsigned_get_attr_by_NID := nil; + CMS_unsigned_get_attr_by_OBJ := nil; + CMS_unsigned_get_attr := nil; + CMS_unsigned_delete_attr := nil; + CMS_unsigned_add1_attr := nil; + CMS_unsigned_add1_attr_by_OBJ := nil; + CMS_unsigned_add1_attr_by_NID := nil; + CMS_unsigned_add1_attr_by_txt := nil; + CMS_unsigned_get0_data_by_OBJ := nil; + CMS_get1_ReceiptRequest := nil; + CMS_add1_ReceiptRequest := nil; + CMS_RecipientInfo_kari_get0_orig_id := nil; + CMS_RecipientInfo_kari_orig_id_cmp := nil; + CMS_RecipientEncryptedKey_get0_id := nil; + CMS_RecipientEncryptedKey_cert_cmp := nil; + CMS_RecipientInfo_kari_set0_pkey := nil; + CMS_RecipientInfo_kari_get0_ctx := nil; + CMS_RecipientInfo_kari_decrypt := nil; + CMS_SharedInfo_encode := nil; +end; +{$ELSE} +{$ENDIF} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +initialization + Register_SSLLoader(@Load,'LibCrypto'); + Register_SSLUnloader(@Unload); +{$ENDIF} +end. diff --git a/IdOpenSSLHeaders_cmserr.pas b/IdOpenSSLHeaders_cmserr.pas new file mode 100644 index 0000000..cd1dd54 --- /dev/null +++ b/IdOpenSSLHeaders_cmserr.pas @@ -0,0 +1,314 @@ + (* This unit was generated using the script genOpenSSLHdrs.sh from the source file IdOpenSSLHeaders_cmserr.h2pas + It should not be modified directly. All changes should be made to IdOpenSSLHeaders_cmserr.h2pas + and this file regenerated. IdOpenSSLHeaders_cmserr.h2pas is distributed with the full Indy + Distribution. + *) + +{$i IdCompilerDefines.inc} +{$i IdSSLOpenSSLDefines.inc} +{$IFNDEF USE_OPENSSL} + { error Should not compile if USE_OPENSSL is not defined!!!} +{$ENDIF} +{******************************************************************************} +{ } +{ Indy (Internet Direct) - Internet Protocols Simplified } +{ } +{ https://www.indyproject.org/ } +{ https://gitter.im/IndySockets/Indy } +{ } +{******************************************************************************} +{ } +{ This file is part of the Indy (Internet Direct) project, and is offered } +{ under the dual-licensing agreement described on the Indy website. } +{ (https://www.indyproject.org/license/) } +{ } +{ Copyright: } +{ (c) 1993-2020, Chad Z. Hower and the Indy Pit Crew. All rights reserved. } +{ } +{******************************************************************************} +{ } +{ } +{******************************************************************************} + +unit IdOpenSSLHeaders_cmserr; + +interface + +// Headers for OpenSSL 1.1.1 +// cmserr.h + + +uses + IdCTypes, + IdGlobal, + IdSSLOpenSSLConsts; + +const + // + // CMS function codes. + // + CMS_F_CHECK_CONTENT = 99; + CMS_F_CMS_ADD0_CERT = 164; + CMS_F_CMS_ADD0_RECIPIENT_KEY = 100; + CMS_F_CMS_ADD0_RECIPIENT_PASSWORD = 165; + CMS_F_CMS_ADD1_RECEIPTREQUEST = 158; + CMS_F_CMS_ADD1_RECIPIENT_CERT = 101; + CMS_F_CMS_ADD1_SIGNER = 102; + CMS_F_CMS_ADD1_SIGNINGTIME = 103; + CMS_F_CMS_COMPRESS = 104; + CMS_F_CMS_COMPRESSEDDATA_CREATE = 105; + CMS_F_CMS_COMPRESSEDDATA_INIT_BIO = 106; + CMS_F_CMS_COPY_CONTENT = 107; + CMS_F_CMS_COPY_MESSAGEDIGEST = 108; + CMS_F_CMS_DATA = 109; + CMS_F_CMS_DATAFINAL = 110; + CMS_F_CMS_DATAINIT = 111; + CMS_F_CMS_DECRYPT = 112; + CMS_F_CMS_DECRYPT_SET1_KEY = 113; + CMS_F_CMS_DECRYPT_SET1_PASSWORD = 166; + CMS_F_CMS_DECRYPT_SET1_PKEY = 114; + CMS_F_CMS_DIGESTALGORITHM_FIND_CTX = 115; + CMS_F_CMS_DIGESTALGORITHM_INIT_BIO = 116; + CMS_F_CMS_DIGESTEDDATA_DO_FINAL = 117; + CMS_F_CMS_DIGEST_VERIFY = 118; + CMS_F_CMS_ENCODE_RECEIPT = 161; + CMS_F_CMS_ENCRYPT = 119; + CMS_F_CMS_ENCRYPTEDCONTENT_INIT = 179; + CMS_F_CMS_ENCRYPTEDCONTENT_INIT_BIO = 120; + CMS_F_CMS_ENCRYPTEDDATA_DECRYPT = 121; + CMS_F_CMS_ENCRYPTEDDATA_ENCRYPT = 122; + CMS_F_CMS_ENCRYPTEDDATA_SET1_KEY = 123; + CMS_F_CMS_ENVELOPEDDATA_CREATE = 124; + CMS_F_CMS_ENVELOPEDDATA_INIT_BIO = 125; + CMS_F_CMS_ENVELOPED_DATA_INIT = 126; + CMS_F_CMS_ENV_ASN1_CTRL = 171; + CMS_F_CMS_FINAL = 127; + CMS_F_CMS_GET0_CERTIFICATE_CHOICES = 128; + CMS_F_CMS_GET0_CONTENT = 129; + CMS_F_CMS_GET0_ECONTENT_TYPE = 130; + CMS_F_CMS_GET0_ENVELOPED = 131; + CMS_F_CMS_GET0_REVOCATION_CHOICES = 132; + CMS_F_CMS_GET0_SIGNED = 133; + CMS_F_CMS_MSGSIGDIGEST_ADD1 = 162; + CMS_F_CMS_RECEIPTREQUEST_CREATE0 = 159; + CMS_F_CMS_RECEIPT_VERIFY = 160; + CMS_F_CMS_RECIPIENTINFO_DECRYPT = 134; + CMS_F_CMS_RECIPIENTINFO_ENCRYPT = 169; + CMS_F_CMS_RECIPIENTINFO_KARI_ENCRYPT = 178; + CMS_F_CMS_RECIPIENTINFO_KARI_GET0_ALG = 175; + CMS_F_CMS_RECIPIENTINFO_KARI_GET0_ORIG_ID = 173; + CMS_F_CMS_RECIPIENTINFO_KARI_GET0_REKS = 172; + CMS_F_CMS_RECIPIENTINFO_KARI_ORIG_ID_CMP = 174; + CMS_F_CMS_RECIPIENTINFO_KEKRI_DECRYPT = 135; + CMS_F_CMS_RECIPIENTINFO_KEKRI_ENCRYPT = 136; + CMS_F_CMS_RECIPIENTINFO_KEKRI_GET0_ID = 137; + CMS_F_CMS_RECIPIENTINFO_KEKRI_ID_CMP = 138; + CMS_F_CMS_RECIPIENTINFO_KTRI_CERT_CMP = 139; + CMS_F_CMS_RECIPIENTINFO_KTRI_DECRYPT = 140; + CMS_F_CMS_RECIPIENTINFO_KTRI_ENCRYPT = 141; + CMS_F_CMS_RECIPIENTINFO_KTRI_GET0_ALGS = 142; + CMS_F_CMS_RECIPIENTINFO_KTRI_GET0_SIGNER_ID = 143; + CMS_F_CMS_RECIPIENTINFO_PWRI_CRYPT = 167; + CMS_F_CMS_RECIPIENTINFO_SET0_KEY = 144; + CMS_F_CMS_RECIPIENTINFO_SET0_PASSWORD = 168; + CMS_F_CMS_RECIPIENTINFO_SET0_PKEY = 145; + CMS_F_CMS_SD_ASN1_CTRL = 170; + CMS_F_CMS_SET1_IAS = 176; + CMS_F_CMS_SET1_KEYID = 177; + CMS_F_CMS_SET1_SIGNERIDENTIFIER = 146; + CMS_F_CMS_SET_DETACHED = 147; + CMS_F_CMS_SIGN = 148; + CMS_F_CMS_SIGNED_DATA_INIT = 149; + CMS_F_CMS_SIGNERINFO_CONTENT_SIGN = 150; + CMS_F_CMS_SIGNERINFO_SIGN = 151; + CMS_F_CMS_SIGNERINFO_VERIFY = 152; + CMS_F_CMS_SIGNERINFO_VERIFY_CERT = 153; + CMS_F_CMS_SIGNERINFO_VERIFY_CONTENT = 154; + CMS_F_CMS_SIGN_RECEIPT = 163; + CMS_F_CMS_SI_CHECK_ATTRIBUTES = 183; + CMS_F_CMS_STREAM = 155; + CMS_F_CMS_UNCOMPRESS = 156; + CMS_F_CMS_VERIFY = 157; + CMS_F_KEK_UNWRAP_KEY = 180; + + // + // CMS reason codes. + // + CMS_R_ADD_SIGNER_ERROR = 99; + CMS_R_ATTRIBUTE_ERROR = 161; + CMS_R_CERTIFICATE_ALREADY_PRESENT = 175; + CMS_R_CERTIFICATE_HAS_NO_KEYID = 160; + CMS_R_CERTIFICATE_VERIFY_ERROR = 100; + CMS_R_CIPHER_INITIALISATION_ERROR = 101; + CMS_R_CIPHER_PARAMETER_INITIALISATION_ERROR = 102; + CMS_R_CMS_DATAFINAL_ERROR = 103; + CMS_R_CMS_LIB = 104; + CMS_R_CONTENTIDENTIFIER_MISMATCH = 170; + CMS_R_CONTENT_NOT_FOUND = 105; + CMS_R_CONTENT_TYPE_MISMATCH = 171; + CMS_R_CONTENT_TYPE_NOT_COMPRESSED_DATA = 106; + CMS_R_CONTENT_TYPE_NOT_ENVELOPED_DATA = 107; + CMS_R_CONTENT_TYPE_NOT_SIGNED_DATA = 108; + CMS_R_CONTENT_VERIFY_ERROR = 109; + CMS_R_CTRL_ERROR = 110; + CMS_R_CTRL_FAILURE = 111; + CMS_R_DECRYPT_ERROR = 112; + CMS_R_ERROR_GETTING_PUBLIC_KEY = 113; + CMS_R_ERROR_READING_MESSAGEDIGEST_ATTRIBUTE = 114; + CMS_R_ERROR_SETTING_KEY = 115; + CMS_R_ERROR_SETTING_RECIPIENTINFO = 116; + CMS_R_INVALID_ENCRYPTED_KEY_LENGTH = 117; + CMS_R_INVALID_KEY_ENCRYPTION_PARAMETER = 176; + CMS_R_INVALID_KEY_LENGTH = 118; + CMS_R_MD_BIO_INIT_ERROR = 119; + CMS_R_MESSAGEDIGEST_ATTRIBUTE_WRONG_LENGTH = 120; + CMS_R_MESSAGEDIGEST_WRONG_LENGTH = 121; + CMS_R_MSGSIGDIGEST_ERROR = 172; + CMS_R_MSGSIGDIGEST_VERIFICATION_FAILURE = 162; + CMS_R_MSGSIGDIGEST_WRONG_LENGTH = 163; + CMS_R_NEED_ONE_SIGNER = 164; + CMS_R_NOT_A_SIGNED_RECEIPT = 165; + CMS_R_NOT_ENCRYPTED_DATA = 122; + CMS_R_NOT_KEK = 123; + CMS_R_NOT_KEY_AGREEMENT = 181; + CMS_R_NOT_KEY_TRANSPORT = 124; + CMS_R_NOT_PWRI = 177; + CMS_R_NOT_SUPPORTED_FOR_THIS_KEY_TYPE = 125; + CMS_R_NO_CIPHER = 126; + CMS_R_NO_CONTENT = 127; + CMS_R_NO_CONTENT_TYPE = 173; + CMS_R_NO_DEFAULT_DIGEST = 128; + CMS_R_NO_DIGEST_SET = 129; + CMS_R_NO_KEY = 130; + CMS_R_NO_KEY_OR_CERT = 174; + CMS_R_NO_MATCHING_DIGEST = 131; + CMS_R_NO_MATCHING_RECIPIENT = 132; + CMS_R_NO_MATCHING_SIGNATURE = 166; + CMS_R_NO_MSGSIGDIGEST = 167; + CMS_R_NO_PASSWORD = 178; + CMS_R_NO_PRIVATE_KEY = 133; + CMS_R_NO_PUBLIC_KEY = 134; + CMS_R_NO_RECEIPT_REQUEST = 168; + CMS_R_NO_SIGNERS = 135; + CMS_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE = 136; + CMS_R_RECEIPT_DECODE_ERROR = 169; + CMS_R_RECIPIENT_ERROR = 137; + CMS_R_SIGNER_CERTIFICATE_NOT_FOUND = 138; + CMS_R_SIGNFINAL_ERROR = 139; + CMS_R_SMIME_TEXT_ERROR = 140; + CMS_R_STORE_INIT_ERROR = 141; + CMS_R_TYPE_NOT_COMPRESSED_DATA = 142; + CMS_R_TYPE_NOT_DATA = 143; + CMS_R_TYPE_NOT_DIGESTED_DATA = 144; + CMS_R_TYPE_NOT_ENCRYPTED_DATA = 145; + CMS_R_TYPE_NOT_ENVELOPED_DATA = 146; + CMS_R_UNABLE_TO_FINALIZE_CONTEXT = 147; + CMS_R_UNKNOWN_CIPHER = 148; + CMS_R_UNKNOWN_DIGEST_ALGORITHM = 149; + CMS_R_UNKNOWN_ID = 150; + CMS_R_UNSUPPORTED_COMPRESSION_ALGORITHM = 151; + CMS_R_UNSUPPORTED_CONTENT_TYPE = 152; + CMS_R_UNSUPPORTED_KEK_ALGORITHM = 153; + CMS_R_UNSUPPORTED_KEY_ENCRYPTION_ALGORITHM = 179; + CMS_R_UNSUPPORTED_RECIPIENTINFO_TYPE = 155; + CMS_R_UNSUPPORTED_RECIPIENT_TYPE = 154; + CMS_R_UNSUPPORTED_TYPE = 156; + CMS_R_UNWRAP_ERROR = 157; + CMS_R_UNWRAP_FAILURE = 180; + CMS_R_VERIFICATION_FAILURE = 158; + CMS_R_WRAP_ERROR = 159; + + { The EXTERNALSYM directive is ignored by FPC, however, it is used by Delphi as follows: + + The EXTERNALSYM directive prevents the specified Delphi symbol from appearing in header + files generated for C++. } + + {$EXTERNALSYM ERR_load_CMS_strings} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +var + ERR_load_CMS_strings: function : TIdC_INT; cdecl = nil; + +{$ELSE} + function ERR_load_CMS_strings: TIdC_INT cdecl; external CLibCrypto; + +{$ENDIF} + +implementation + + uses + classes, + IdSSLOpenSSLExceptionHandlers, + IdResourceStringsOpenSSL + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + ,IdSSLOpenSSLLoader + {$ENDIF}; + + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +const + ERR_load_CMS_strings_procname = 'ERR_load_CMS_strings'; + + +{$WARN NO_RETVAL OFF} +function ERR_ERR_load_CMS_strings: TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ERR_load_CMS_strings_procname); +end; + + + +{$WARN NO_RETVAL ON} + +procedure Load(const ADllHandle: TIdLibHandle; LibVersion: TIdC_UINT; const AFailed: TStringList); + +var FuncLoadError: boolean; + +begin + ERR_load_CMS_strings := LoadLibFunction(ADllHandle, ERR_load_CMS_strings_procname); + FuncLoadError := not assigned(ERR_load_CMS_strings); + if FuncLoadError then + begin + {$if not defined(ERR_load_CMS_strings_allownil)} + ERR_load_CMS_strings := @ERR_ERR_load_CMS_strings; + {$ifend} + {$if declared(ERR_load_CMS_strings_introduced)} + if LibVersion < ERR_load_CMS_strings_introduced then + begin + {$if declared(FC_ERR_load_CMS_strings)} + ERR_load_CMS_strings := @FC_ERR_load_CMS_strings; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ERR_load_CMS_strings_removed)} + if ERR_load_CMS_strings_removed <= LibVersion then + begin + {$if declared(_ERR_load_CMS_strings)} + ERR_load_CMS_strings := @_ERR_load_CMS_strings; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ERR_load_CMS_strings_allownil)} + if FuncLoadError then + AFailed.Add('ERR_load_CMS_strings'); + {$ifend} + end; + + +end; + +procedure Unload; +begin + ERR_load_CMS_strings := nil; +end; +{$ELSE} +{$ENDIF} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +initialization + Register_SSLLoader(@Load,'LibCrypto'); + Register_SSLUnloader(@Unload); +{$ENDIF} +end. diff --git a/IdOpenSSLHeaders_comp.pas b/IdOpenSSLHeaders_comp.pas new file mode 100644 index 0000000..82606e6 --- /dev/null +++ b/IdOpenSSLHeaders_comp.pas @@ -0,0 +1,540 @@ + (* This unit was generated using the script genOpenSSLHdrs.sh from the source file IdOpenSSLHeaders_comp.h2pas + It should not be modified directly. All changes should be made to IdOpenSSLHeaders_comp.h2pas + and this file regenerated. IdOpenSSLHeaders_comp.h2pas is distributed with the full Indy + Distribution. + *) + +{$i IdCompilerDefines.inc} +{$i IdSSLOpenSSLDefines.inc} +{$IFNDEF USE_OPENSSL} + { error Should not compile if USE_OPENSSL is not defined!!!} +{$ENDIF} +{******************************************************************************} +{ } +{ Indy (Internet Direct) - Internet Protocols Simplified } +{ } +{ https://www.indyproject.org/ } +{ https://gitter.im/IndySockets/Indy } +{ } +{******************************************************************************} +{ } +{ This file is part of the Indy (Internet Direct) project, and is offered } +{ under the dual-licensing agreement described on the Indy website. } +{ (https://www.indyproject.org/license/) } +{ } +{ Copyright: } +{ (c) 1993-2020, Chad Z. Hower and the Indy Pit Crew. All rights reserved. } +{ } +{******************************************************************************} +{ } +{ } +{******************************************************************************} + +unit IdOpenSSLHeaders_comp; + +interface + +// Headers for OpenSSL 1.1.1 +// comp.h + + +uses + IdCTypes, + IdGlobal, + IdSSLOpenSSLConsts, + IdOpenSSLHeaders_bio, + IdOpenSSLHeaders_ossl_typ; + + { The EXTERNALSYM directive is ignored by FPC, however, it is used by Delphi as follows: + + The EXTERNALSYM directive prevents the specified Delphi symbol from appearing in header + files generated for C++. } + + {$EXTERNALSYM COMP_CTX_new} + {$EXTERNALSYM COMP_CTX_get_method} + {$EXTERNALSYM COMP_CTX_get_type} + {$EXTERNALSYM COMP_get_type} + {$EXTERNALSYM COMP_get_name} + {$EXTERNALSYM COMP_CTX_free} + {$EXTERNALSYM COMP_compress_block} + {$EXTERNALSYM COMP_expand_block} + {$EXTERNALSYM COMP_zlib} + {$EXTERNALSYM BIO_f_zlib} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +var + COMP_CTX_new: function (meth: PCOMP_METHOD): PCOMP_CTX; cdecl = nil; + COMP_CTX_get_method: function (const ctx: PCOMP_CTX): PCOMP_METHOD; cdecl = nil; + COMP_CTX_get_type: function (const comp: PCOMP_CTX): TIdC_INT; cdecl = nil; + COMP_get_type: function (const meth: PCOMP_METHOD): TIdC_INT; cdecl = nil; + COMP_get_name: function (const meth: PCOMP_METHOD): PIdAnsiChar; cdecl = nil; + COMP_CTX_free: procedure (ctx: PCOMP_CTX); cdecl = nil; + + COMP_compress_block: function (ctx: PCOMP_CTX; out_: PByte; olen: TIdC_INT; in_: PByte; ilen: TIdC_INT): TIdC_INT; cdecl = nil; + COMP_expand_block: function (ctx: PCOMP_CTX; out_: PByte; olen: TIdC_INT; in_: PByte; ilen: TIdC_INT): TIdC_INT; cdecl = nil; + + COMP_zlib: function : PCOMP_METHOD; cdecl = nil; + + BIO_f_zlib: function : PBIO_METHOD; cdecl = nil; + +{$ELSE} + function COMP_CTX_new(meth: PCOMP_METHOD): PCOMP_CTX cdecl; external CLibCrypto; + function COMP_CTX_get_method(const ctx: PCOMP_CTX): PCOMP_METHOD cdecl; external CLibCrypto; + function COMP_CTX_get_type(const comp: PCOMP_CTX): TIdC_INT cdecl; external CLibCrypto; + function COMP_get_type(const meth: PCOMP_METHOD): TIdC_INT cdecl; external CLibCrypto; + function COMP_get_name(const meth: PCOMP_METHOD): PIdAnsiChar cdecl; external CLibCrypto; + procedure COMP_CTX_free(ctx: PCOMP_CTX) cdecl; external CLibCrypto; + + function COMP_compress_block(ctx: PCOMP_CTX; out_: PByte; olen: TIdC_INT; in_: PByte; ilen: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function COMP_expand_block(ctx: PCOMP_CTX; out_: PByte; olen: TIdC_INT; in_: PByte; ilen: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + + function COMP_zlib: PCOMP_METHOD cdecl; external CLibCrypto; + + function BIO_f_zlib: PBIO_METHOD cdecl; external CLibCrypto; + +{$ENDIF} + +implementation + + uses + classes, + IdSSLOpenSSLExceptionHandlers, + IdResourceStringsOpenSSL + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + ,IdSSLOpenSSLLoader + {$ENDIF}; + + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +const + COMP_CTX_new_procname = 'COMP_CTX_new'; + COMP_CTX_get_method_procname = 'COMP_CTX_get_method'; + COMP_CTX_get_type_procname = 'COMP_CTX_get_type'; + COMP_get_type_procname = 'COMP_get_type'; + COMP_get_name_procname = 'COMP_get_name'; + COMP_CTX_free_procname = 'COMP_CTX_free'; + + COMP_compress_block_procname = 'COMP_compress_block'; + COMP_expand_block_procname = 'COMP_expand_block'; + + COMP_zlib_procname = 'COMP_zlib'; + + BIO_f_zlib_procname = 'BIO_f_zlib'; + + +{$WARN NO_RETVAL OFF} +function ERR_COMP_CTX_new(meth: PCOMP_METHOD): PCOMP_CTX; +begin + EIdAPIFunctionNotPresent.RaiseException(COMP_CTX_new_procname); +end; + + +function ERR_COMP_CTX_get_method(const ctx: PCOMP_CTX): PCOMP_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(COMP_CTX_get_method_procname); +end; + + +function ERR_COMP_CTX_get_type(const comp: PCOMP_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(COMP_CTX_get_type_procname); +end; + + +function ERR_COMP_get_type(const meth: PCOMP_METHOD): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(COMP_get_type_procname); +end; + + +function ERR_COMP_get_name(const meth: PCOMP_METHOD): PIdAnsiChar; +begin + EIdAPIFunctionNotPresent.RaiseException(COMP_get_name_procname); +end; + + +procedure ERR_COMP_CTX_free(ctx: PCOMP_CTX); +begin + EIdAPIFunctionNotPresent.RaiseException(COMP_CTX_free_procname); +end; + + + +function ERR_COMP_compress_block(ctx: PCOMP_CTX; out_: PByte; olen: TIdC_INT; in_: PByte; ilen: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(COMP_compress_block_procname); +end; + + +function ERR_COMP_expand_block(ctx: PCOMP_CTX; out_: PByte; olen: TIdC_INT; in_: PByte; ilen: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(COMP_expand_block_procname); +end; + + + +function ERR_COMP_zlib: PCOMP_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(COMP_zlib_procname); +end; + + + +function ERR_BIO_f_zlib: PBIO_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_f_zlib_procname); +end; + + + +{$WARN NO_RETVAL ON} + +procedure Load(const ADllHandle: TIdLibHandle; LibVersion: TIdC_UINT; const AFailed: TStringList); + +var FuncLoadError: boolean; + +begin + COMP_CTX_new := LoadLibFunction(ADllHandle, COMP_CTX_new_procname); + FuncLoadError := not assigned(COMP_CTX_new); + if FuncLoadError then + begin + {$if not defined(COMP_CTX_new_allownil)} + COMP_CTX_new := @ERR_COMP_CTX_new; + {$ifend} + {$if declared(COMP_CTX_new_introduced)} + if LibVersion < COMP_CTX_new_introduced then + begin + {$if declared(FC_COMP_CTX_new)} + COMP_CTX_new := @FC_COMP_CTX_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(COMP_CTX_new_removed)} + if COMP_CTX_new_removed <= LibVersion then + begin + {$if declared(_COMP_CTX_new)} + COMP_CTX_new := @_COMP_CTX_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(COMP_CTX_new_allownil)} + if FuncLoadError then + AFailed.Add('COMP_CTX_new'); + {$ifend} + end; + + + COMP_CTX_get_method := LoadLibFunction(ADllHandle, COMP_CTX_get_method_procname); + FuncLoadError := not assigned(COMP_CTX_get_method); + if FuncLoadError then + begin + {$if not defined(COMP_CTX_get_method_allownil)} + COMP_CTX_get_method := @ERR_COMP_CTX_get_method; + {$ifend} + {$if declared(COMP_CTX_get_method_introduced)} + if LibVersion < COMP_CTX_get_method_introduced then + begin + {$if declared(FC_COMP_CTX_get_method)} + COMP_CTX_get_method := @FC_COMP_CTX_get_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(COMP_CTX_get_method_removed)} + if COMP_CTX_get_method_removed <= LibVersion then + begin + {$if declared(_COMP_CTX_get_method)} + COMP_CTX_get_method := @_COMP_CTX_get_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(COMP_CTX_get_method_allownil)} + if FuncLoadError then + AFailed.Add('COMP_CTX_get_method'); + {$ifend} + end; + + + COMP_CTX_get_type := LoadLibFunction(ADllHandle, COMP_CTX_get_type_procname); + FuncLoadError := not assigned(COMP_CTX_get_type); + if FuncLoadError then + begin + {$if not defined(COMP_CTX_get_type_allownil)} + COMP_CTX_get_type := @ERR_COMP_CTX_get_type; + {$ifend} + {$if declared(COMP_CTX_get_type_introduced)} + if LibVersion < COMP_CTX_get_type_introduced then + begin + {$if declared(FC_COMP_CTX_get_type)} + COMP_CTX_get_type := @FC_COMP_CTX_get_type; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(COMP_CTX_get_type_removed)} + if COMP_CTX_get_type_removed <= LibVersion then + begin + {$if declared(_COMP_CTX_get_type)} + COMP_CTX_get_type := @_COMP_CTX_get_type; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(COMP_CTX_get_type_allownil)} + if FuncLoadError then + AFailed.Add('COMP_CTX_get_type'); + {$ifend} + end; + + + COMP_get_type := LoadLibFunction(ADllHandle, COMP_get_type_procname); + FuncLoadError := not assigned(COMP_get_type); + if FuncLoadError then + begin + {$if not defined(COMP_get_type_allownil)} + COMP_get_type := @ERR_COMP_get_type; + {$ifend} + {$if declared(COMP_get_type_introduced)} + if LibVersion < COMP_get_type_introduced then + begin + {$if declared(FC_COMP_get_type)} + COMP_get_type := @FC_COMP_get_type; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(COMP_get_type_removed)} + if COMP_get_type_removed <= LibVersion then + begin + {$if declared(_COMP_get_type)} + COMP_get_type := @_COMP_get_type; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(COMP_get_type_allownil)} + if FuncLoadError then + AFailed.Add('COMP_get_type'); + {$ifend} + end; + + + COMP_get_name := LoadLibFunction(ADllHandle, COMP_get_name_procname); + FuncLoadError := not assigned(COMP_get_name); + if FuncLoadError then + begin + {$if not defined(COMP_get_name_allownil)} + COMP_get_name := @ERR_COMP_get_name; + {$ifend} + {$if declared(COMP_get_name_introduced)} + if LibVersion < COMP_get_name_introduced then + begin + {$if declared(FC_COMP_get_name)} + COMP_get_name := @FC_COMP_get_name; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(COMP_get_name_removed)} + if COMP_get_name_removed <= LibVersion then + begin + {$if declared(_COMP_get_name)} + COMP_get_name := @_COMP_get_name; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(COMP_get_name_allownil)} + if FuncLoadError then + AFailed.Add('COMP_get_name'); + {$ifend} + end; + + + COMP_CTX_free := LoadLibFunction(ADllHandle, COMP_CTX_free_procname); + FuncLoadError := not assigned(COMP_CTX_free); + if FuncLoadError then + begin + {$if not defined(COMP_CTX_free_allownil)} + COMP_CTX_free := @ERR_COMP_CTX_free; + {$ifend} + {$if declared(COMP_CTX_free_introduced)} + if LibVersion < COMP_CTX_free_introduced then + begin + {$if declared(FC_COMP_CTX_free)} + COMP_CTX_free := @FC_COMP_CTX_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(COMP_CTX_free_removed)} + if COMP_CTX_free_removed <= LibVersion then + begin + {$if declared(_COMP_CTX_free)} + COMP_CTX_free := @_COMP_CTX_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(COMP_CTX_free_allownil)} + if FuncLoadError then + AFailed.Add('COMP_CTX_free'); + {$ifend} + end; + + + COMP_compress_block := LoadLibFunction(ADllHandle, COMP_compress_block_procname); + FuncLoadError := not assigned(COMP_compress_block); + if FuncLoadError then + begin + {$if not defined(COMP_compress_block_allownil)} + COMP_compress_block := @ERR_COMP_compress_block; + {$ifend} + {$if declared(COMP_compress_block_introduced)} + if LibVersion < COMP_compress_block_introduced then + begin + {$if declared(FC_COMP_compress_block)} + COMP_compress_block := @FC_COMP_compress_block; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(COMP_compress_block_removed)} + if COMP_compress_block_removed <= LibVersion then + begin + {$if declared(_COMP_compress_block)} + COMP_compress_block := @_COMP_compress_block; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(COMP_compress_block_allownil)} + if FuncLoadError then + AFailed.Add('COMP_compress_block'); + {$ifend} + end; + + + COMP_expand_block := LoadLibFunction(ADllHandle, COMP_expand_block_procname); + FuncLoadError := not assigned(COMP_expand_block); + if FuncLoadError then + begin + {$if not defined(COMP_expand_block_allownil)} + COMP_expand_block := @ERR_COMP_expand_block; + {$ifend} + {$if declared(COMP_expand_block_introduced)} + if LibVersion < COMP_expand_block_introduced then + begin + {$if declared(FC_COMP_expand_block)} + COMP_expand_block := @FC_COMP_expand_block; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(COMP_expand_block_removed)} + if COMP_expand_block_removed <= LibVersion then + begin + {$if declared(_COMP_expand_block)} + COMP_expand_block := @_COMP_expand_block; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(COMP_expand_block_allownil)} + if FuncLoadError then + AFailed.Add('COMP_expand_block'); + {$ifend} + end; + + + COMP_zlib := LoadLibFunction(ADllHandle, COMP_zlib_procname); + FuncLoadError := not assigned(COMP_zlib); + if FuncLoadError then + begin + {$if not defined(COMP_zlib_allownil)} + COMP_zlib := @ERR_COMP_zlib; + {$ifend} + {$if declared(COMP_zlib_introduced)} + if LibVersion < COMP_zlib_introduced then + begin + {$if declared(FC_COMP_zlib)} + COMP_zlib := @FC_COMP_zlib; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(COMP_zlib_removed)} + if COMP_zlib_removed <= LibVersion then + begin + {$if declared(_COMP_zlib)} + COMP_zlib := @_COMP_zlib; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(COMP_zlib_allownil)} + if FuncLoadError then + AFailed.Add('COMP_zlib'); + {$ifend} + end; + + + BIO_f_zlib := LoadLibFunction(ADllHandle, BIO_f_zlib_procname); + FuncLoadError := not assigned(BIO_f_zlib); + if FuncLoadError then + begin + {$if not defined(BIO_f_zlib_allownil)} + BIO_f_zlib := @ERR_BIO_f_zlib; + {$ifend} + {$if declared(BIO_f_zlib_introduced)} + if LibVersion < BIO_f_zlib_introduced then + begin + {$if declared(FC_BIO_f_zlib)} + BIO_f_zlib := @FC_BIO_f_zlib; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_f_zlib_removed)} + if BIO_f_zlib_removed <= LibVersion then + begin + {$if declared(_BIO_f_zlib)} + BIO_f_zlib := @_BIO_f_zlib; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_f_zlib_allownil)} + if FuncLoadError then + AFailed.Add('BIO_f_zlib'); + {$ifend} + end; + + +end; + +procedure Unload; +begin + COMP_CTX_new := nil; + COMP_CTX_get_method := nil; + COMP_CTX_get_type := nil; + COMP_get_type := nil; + COMP_get_name := nil; + COMP_CTX_free := nil; + COMP_compress_block := nil; + COMP_expand_block := nil; + COMP_zlib := nil; + BIO_f_zlib := nil; +end; +{$ELSE} +{$ENDIF} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +initialization + Register_SSLLoader(@Load,'LibCrypto'); + Register_SSLUnloader(@Unload); +{$ENDIF} +end. diff --git a/IdOpenSSLHeaders_comperr.pas b/IdOpenSSLHeaders_comperr.pas new file mode 100644 index 0000000..96b00f8 --- /dev/null +++ b/IdOpenSSLHeaders_comperr.pas @@ -0,0 +1,156 @@ + (* This unit was generated using the script genOpenSSLHdrs.sh from the source file IdOpenSSLHeaders_comperr.h2pas + It should not be modified directly. All changes should be made to IdOpenSSLHeaders_comperr.h2pas + and this file regenerated. IdOpenSSLHeaders_comperr.h2pas is distributed with the full Indy + Distribution. + *) + +{$i IdCompilerDefines.inc} +{$i IdSSLOpenSSLDefines.inc} +{$IFNDEF USE_OPENSSL} + { error Should not compile if USE_OPENSSL is not defined!!!} +{$ENDIF} +{******************************************************************************} +{ } +{ Indy (Internet Direct) - Internet Protocols Simplified } +{ } +{ https://www.indyproject.org/ } +{ https://gitter.im/IndySockets/Indy } +{ } +{******************************************************************************} +{ } +{ This file is part of the Indy (Internet Direct) project, and is offered } +{ under the dual-licensing agreement described on the Indy website. } +{ (https://www.indyproject.org/license/) } +{ } +{ Copyright: } +{ (c) 1993-2020, Chad Z. Hower and the Indy Pit Crew. All rights reserved. } +{ } +{******************************************************************************} +{ } +{ } +{******************************************************************************} + +unit IdOpenSSLHeaders_comperr; + +interface + +// Headers for OpenSSL 1.1.1 +// comperr.h + + +uses + IdCTypes, + IdGlobal, + IdSSLOpenSSLConsts; + +const +///* +// * COMP function codes. +// */ + COMP_F_BIO_ZLIB_FLUSH = 99; + COMP_F_BIO_ZLIB_NEW = 100; + COMP_F_BIO_ZLIB_READ = 101; + COMP_F_BIO_ZLIB_WRITE = 102; + COMP_F_COMP_CTX_NEW = 103; + +///* +// * COMP reason codes. +// */ + COMP_R_ZLIB_DEFLATE_ERROR = 99; + COMP_R_ZLIB_INFLATE_ERROR = 100; + COMP_R_ZLIB_NOT_SUPPORTED = 101; + + { The EXTERNALSYM directive is ignored by FPC, however, it is used by Delphi as follows: + + The EXTERNALSYM directive prevents the specified Delphi symbol from appearing in header + files generated for C++. } + + {$EXTERNALSYM ERR_load_COMP_strings} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +var + ERR_load_COMP_strings: function : TIdC_INT; cdecl = nil; + +{$ELSE} + function ERR_load_COMP_strings: TIdC_INT cdecl; external CLibCrypto; + +{$ENDIF} + +implementation + + uses + classes, + IdSSLOpenSSLExceptionHandlers, + IdResourceStringsOpenSSL + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + ,IdSSLOpenSSLLoader + {$ENDIF}; + + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +const + ERR_load_COMP_strings_procname = 'ERR_load_COMP_strings'; + + +{$WARN NO_RETVAL OFF} +function ERR_ERR_load_COMP_strings: TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ERR_load_COMP_strings_procname); +end; + + + +{$WARN NO_RETVAL ON} + +procedure Load(const ADllHandle: TIdLibHandle; LibVersion: TIdC_UINT; const AFailed: TStringList); + +var FuncLoadError: boolean; + +begin + ERR_load_COMP_strings := LoadLibFunction(ADllHandle, ERR_load_COMP_strings_procname); + FuncLoadError := not assigned(ERR_load_COMP_strings); + if FuncLoadError then + begin + {$if not defined(ERR_load_COMP_strings_allownil)} + ERR_load_COMP_strings := @ERR_ERR_load_COMP_strings; + {$ifend} + {$if declared(ERR_load_COMP_strings_introduced)} + if LibVersion < ERR_load_COMP_strings_introduced then + begin + {$if declared(FC_ERR_load_COMP_strings)} + ERR_load_COMP_strings := @FC_ERR_load_COMP_strings; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ERR_load_COMP_strings_removed)} + if ERR_load_COMP_strings_removed <= LibVersion then + begin + {$if declared(_ERR_load_COMP_strings)} + ERR_load_COMP_strings := @_ERR_load_COMP_strings; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ERR_load_COMP_strings_allownil)} + if FuncLoadError then + AFailed.Add('ERR_load_COMP_strings'); + {$ifend} + end; + + +end; + +procedure Unload; +begin + ERR_load_COMP_strings := nil; +end; +{$ELSE} +{$ENDIF} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +initialization + Register_SSLLoader(@Load,'LibCrypto'); + Register_SSLUnloader(@Unload); +{$ENDIF} +end. diff --git a/IdOpenSSLHeaders_conf.pas b/IdOpenSSLHeaders_conf.pas new file mode 100644 index 0000000..6d5bc94 --- /dev/null +++ b/IdOpenSSLHeaders_conf.pas @@ -0,0 +1,1489 @@ + (* This unit was generated using the script genOpenSSLHdrs.sh from the source file IdOpenSSLHeaders_conf.h2pas + It should not be modified directly. All changes should be made to IdOpenSSLHeaders_conf.h2pas + and this file regenerated. IdOpenSSLHeaders_conf.h2pas is distributed with the full Indy + Distribution. + *) + +{$i IdCompilerDefines.inc} +{$i IdSSLOpenSSLDefines.inc} +{$IFNDEF USE_OPENSSL} + { error Should not compile if USE_OPENSSL is not defined!!!} +{$ENDIF} +{******************************************************************************} +{ } +{ Indy (Internet Direct) - Internet Protocols Simplified } +{ } +{ https://www.indyproject.org/ } +{ https://gitter.im/IndySockets/Indy } +{ } +{******************************************************************************} +{ } +{ This file is part of the Indy (Internet Direct) project, and is offered } +{ under the dual-licensing agreement described on the Indy website. } +{ (https://www.indyproject.org/license/) } +{ } +{ Copyright: } +{ (c) 1993-2020, Chad Z. Hower and the Indy Pit Crew. All rights reserved. } +{ } +{******************************************************************************} +{ } +{ } +{******************************************************************************} + +unit IdOpenSSLHeaders_conf; + +interface + +// Headers for OpenSSL 1.1.1 +// conf.h + + +uses + IdCTypes, + IdGlobal, + IdSSLOpenSSLConsts, + IdOpenSSLHeaders_bio, + IdOpenSSLHeaders_ossl_typ; + +type + CONF_parse_list_list_cb = function (const elem: PAnsiChar; len: TIdC_INT; usr: Pointer): TIdC_INT; + + CONF_VALUE = record + section: PAnsiChar; + name: PAnsiChar; + value: PAnsiChar; + end; + PCONF_VALUE = ^CONF_VALUE; + +//DEFINE_STACK_OF(CONF_VALUE) +//DEFINE_LHASH_OF(CONF_VALUE); + + conf_st = type Pointer; + conf_method_st = type Pointer; + CONF_METHOD = conf_method_st; + PCONF_METHOD = ^conf_method_st; + CONF = conf_st; + PCONF = ^CONF; + + (*conf_method_st = record + const char *name; + CONF *(*create) (CONF_METHOD *meth); + int (*init) (CONF *conf); + int (*destroy) (CONF *conf); + int (*destroy_data) (CONF *conf); + int (*load_bio) (CONF *conf, BIO *bp, long *eline); + int (*dump) (const CONF *conf, BIO *bp); + int (*is_number) (const CONF *conf, char c); + int (*to_int) (const CONF *conf, char c); + int (*load) (CONF *conf, const char *name, long *eline); + end; *) + +//* Module definitions */ + + conf_imodule_st = type Pointer; + CONF_IMODULE = conf_imodule_st; + PCONF_IMODULE = ^CONF_IMODULE; + conf_module_st = type Pointer; + CONF_MODULE = conf_module_st; + PCONF_MODULE = ^CONF_MODULE; + +//DEFINE_STACK_OF(CONF_MODULE) +//DEFINE_STACK_OF(CONF_IMODULE) + +//* DSO module function typedefs */ + conf_init_func = function(md: PCONF_IMODULE; const cnf: PCONF): TIdC_INT; + conf_finish_func = procedure(md: PCONF_IMODULE); + +const + CONF_MFLAGS_IGNORE_ERRORS = $1; + CONF_MFLAGS_IGNORE_RETURN_CODES = $2; + CONF_MFLAGS_SILENT = $4; + CONF_MFLAGS_NO_DSO = $8; + CONF_MFLAGS_IGNORE_MISSING_FILE = $10; + CONF_MFLAGS_DEFAULT_SECTION = $20; + + { The EXTERNALSYM directive is ignored by FPC, however, it is used by Delphi as follows: + + The EXTERNALSYM directive prevents the specified Delphi symbol from appearing in header + files generated for C++. } + + {$EXTERNALSYM CONF_set_default_method} + {$EXTERNALSYM NCONF_new} + {$EXTERNALSYM NCONF_default} + {$EXTERNALSYM NCONF_WIN32} + {$EXTERNALSYM NCONF_free} + {$EXTERNALSYM NCONF_free_data} + {$EXTERNALSYM NCONF_load} + {$EXTERNALSYM NCONF_load_bio} + {$EXTERNALSYM NCONF_get_string} + {$EXTERNALSYM NCONF_get_number_e} + {$EXTERNALSYM NCONF_dump_bio} + {$EXTERNALSYM CONF_modules_load} + {$EXTERNALSYM CONF_modules_load_file} + {$EXTERNALSYM CONF_modules_unload} + {$EXTERNALSYM CONF_modules_finish} + {$EXTERNALSYM CONF_module_add} + {$EXTERNALSYM CONF_imodule_get_usr_data} + {$EXTERNALSYM CONF_imodule_set_usr_data} + {$EXTERNALSYM CONF_imodule_get_module} + {$EXTERNALSYM CONF_imodule_get_flags} + {$EXTERNALSYM CONF_imodule_set_flags} + {$EXTERNALSYM CONF_module_get_usr_data} + {$EXTERNALSYM CONF_module_set_usr_data} + {$EXTERNALSYM CONF_get1_default_config_file} + {$EXTERNALSYM CONF_parse_list} + {$EXTERNALSYM OPENSSL_load_builtin_modules} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +var + CONF_set_default_method: function (meth: PCONF_METHOD): TIdC_INT; cdecl = nil; +// (* +// void CONF_set_nconf(CONF *conf, LHASH_OF(CONF_VALUE) *hash); +// LHASH_OF(CONF_VALUE) *CONF_load(LHASH_OF(CONF_VALUE) *conf, const char *file, long *eline); +// {$ifndef OPENSSL_NO_STDIO} +// LHASH_OF(CONF_VALUE) *CONF_load_fp(LHASH_OF(CONF_VALUE) *conf, FILE *fp, long *eline); +// {$endif} +// LHASH_OF(CONF_VALUE) *CONF_load_bio(LHASH_OF(CONF_VALUE) *conf, BIO *bp, +// long *eline); +// STACK_OF(CONF_VALUE) *CONF_get_section(LHASH_OF(CONF_VALUE) *conf, +// const char *section); +// char *CONF_get_string(LHASH_OF(CONF_VALUE) *conf, const char *group, +// const char *name); +// long CONF_get_number(LHASH_OF(CONF_VALUE) *conf, const char *group, +// const char *name); +// void CONF_free(LHASH_OF(CONF_VALUE) *conf); +// #ifndef OPENSSL_NO_STDIO +// int CONF_dump_fp(LHASH_OF(CONF_VALUE) *conf, FILE *out); +// #endif +// int CONF_dump_bio(LHASH_OF(CONF_VALUE) *conf, BIO *out); +// +// DEPRECATEDIN_1_1_0(void OPENSSL_config(const char *config_name)) +// +// #if OPENSSL_API_COMPAT < 0x10100000L +// # define OPENSSL_no_config() \ +// OPENSSL_init_crypto(OPENSSL_INIT_NO_LOAD_CONFIG, NULL) +// #endif +// *) + + (* + * New conf code. The semantics are different from the functions above. If + * that wasn't the case, the above functions would have been replaced + *) + + //type Doppelt??? + // conf_st = record + // CONF_METHOD *meth; + // void *meth_data; + // LHASH_OF(CONF_VALUE) *data; + // end; + + NCONF_new: function (meth: PCONF_METHOD): PCONF; cdecl = nil; + NCONF_default: function : PCONF_METHOD; cdecl = nil; + NCONF_WIN32: function : PCONF_METHOD; cdecl = nil; + NCONF_free: procedure (conf: PCONF); cdecl = nil; + NCONF_free_data: procedure (conf: PCONF); cdecl = nil; + + NCONF_load: function (conf: PCONF; const file_: PAnsiChar; eline: PIdC_LONG): TIdC_INT; cdecl = nil; + NCONF_load_bio: function (conf: PCONF; bp: PBIO; eline: PIdC_LONG): TIdC_INT; cdecl = nil; + //STACK_OF(CONF_VALUE) *NCONF_get_section(const CONF *conf, + // const char *section); + NCONF_get_string: function (const conf: PCONF; const group: PAnsiChar; const name: PAnsiChar): PAnsiChar; cdecl = nil; + NCONF_get_number_e: function (const conf: PCONF; const group: PAnsiChar; const name: PAnsiChar; result: PIdC_LONG): TIdC_INT; cdecl = nil; + NCONF_dump_bio: function (const conf: PCONf; out_: PBIO): TIdC_INT; cdecl = nil; + + //#define NCONF_get_number(c,g,n,r) NCONF_get_number_e(c,g,n,r) + + //* Module functions */ + + CONF_modules_load: function (const cnf: PCONF; const appname: PAnsiChar; flags: TIdC_ULONG): TIdC_INT; cdecl = nil; + CONF_modules_load_file: function (const filename: PAnsiChar; const appname: PAnsiChar; flags: TIdC_ULONG): TIdC_INT; cdecl = nil; + + CONF_modules_unload: procedure (all: TIdC_INT); cdecl = nil; + CONF_modules_finish: procedure ; cdecl = nil; + CONF_module_add: function (const name: PAnsiChar; ifunc: conf_init_func; ffunc: conf_finish_func): TIdC_INT; cdecl = nil; + + //const char *CONF_imodule_get_name(const CONF_IMODULE *md); + //const char *CONF_imodule_get_value(const CONF_IMODULE *md); + CONF_imodule_get_usr_data: function (const md: PCONF_IMODULE): Pointer; cdecl = nil; + CONF_imodule_set_usr_data: procedure (md: PCONF_IMODULE; usr_data: Pointer); cdecl = nil; + CONF_imodule_get_module: function (const md: PCONF_IMODULE): PCONF_MODULE; cdecl = nil; + CONF_imodule_get_flags: function (const md: PCONF_IMODULE): TIdC_ULONG; cdecl = nil; + CONF_imodule_set_flags: procedure (md: PCONF_IMODULE; flags: TIdC_ULONG); cdecl = nil; + CONF_module_get_usr_data: function (pmod: PCONF_MODULE): Pointer; cdecl = nil; + CONF_module_set_usr_data: procedure (pmod: PCONF_MODULE; usr_data: Pointer); cdecl = nil; + + CONF_get1_default_config_file: function : PAnsiChar; cdecl = nil; + CONF_parse_list: function (const list: PAnsiChar; sep: TIdC_INT; nospc: TIdC_INT; list_cb: CONF_parse_list_list_cb; arg: Pointer): TIdC_INT; cdecl = nil; + + OPENSSL_load_builtin_modules: procedure ; cdecl = nil; + +{$ELSE} + function CONF_set_default_method(meth: PCONF_METHOD): TIdC_INT cdecl; external CLibCrypto; +// (* +// void CONF_set_nconf(CONF *conf, LHASH_OF(CONF_VALUE) *hash); +// LHASH_OF(CONF_VALUE) *CONF_load(LHASH_OF(CONF_VALUE) *conf, const char *file, long *eline); +// {$ifndef OPENSSL_NO_STDIO} +// LHASH_OF(CONF_VALUE) *CONF_load_fp(LHASH_OF(CONF_VALUE) *conf, FILE *fp, long *eline); +// {$endif} +// LHASH_OF(CONF_VALUE) *CONF_load_bio(LHASH_OF(CONF_VALUE) *conf, BIO *bp, +// long *eline); +// STACK_OF(CONF_VALUE) *CONF_get_section(LHASH_OF(CONF_VALUE) *conf, +// const char *section); +// char *CONF_get_string(LHASH_OF(CONF_VALUE) *conf, const char *group, +// const char *name); +// long CONF_get_number(LHASH_OF(CONF_VALUE) *conf, const char *group, +// const char *name); +// void CONF_free(LHASH_OF(CONF_VALUE) *conf); +// #ifndef OPENSSL_NO_STDIO +// int CONF_dump_fp(LHASH_OF(CONF_VALUE) *conf, FILE *out); +// #endif +// int CONF_dump_bio(LHASH_OF(CONF_VALUE) *conf, BIO *out); +// +// DEPRECATEDIN_1_1_0(void OPENSSL_config(const char *config_name)) +// +// #if OPENSSL_API_COMPAT < 0x10100000L +// # define OPENSSL_no_config() \ +// OPENSSL_init_crypto(OPENSSL_INIT_NO_LOAD_CONFIG, NULL) +// #endif +// *) + + (* + * New conf code. The semantics are different from the functions above. If + * that wasn't the case, the above functions would have been replaced + *) + + //type Doppelt??? + // conf_st = record + // CONF_METHOD *meth; + // void *meth_data; + // LHASH_OF(CONF_VALUE) *data; + // end; + + function NCONF_new(meth: PCONF_METHOD): PCONF cdecl; external CLibCrypto; + function NCONF_default: PCONF_METHOD cdecl; external CLibCrypto; + function NCONF_WIN32: PCONF_METHOD cdecl; external CLibCrypto; + procedure NCONF_free(conf: PCONF) cdecl; external CLibCrypto; + procedure NCONF_free_data(conf: PCONF) cdecl; external CLibCrypto; + + function NCONF_load(conf: PCONF; const file_: PAnsiChar; eline: PIdC_LONG): TIdC_INT cdecl; external CLibCrypto; + function NCONF_load_bio(conf: PCONF; bp: PBIO; eline: PIdC_LONG): TIdC_INT cdecl; external CLibCrypto; + //STACK_OF(CONF_VALUE) *NCONF_get_section(const CONF *conf, + // const char *section); + function NCONF_get_string(const conf: PCONF; const group: PAnsiChar; const name: PAnsiChar): PAnsiChar cdecl; external CLibCrypto; + function NCONF_get_number_e(const conf: PCONF; const group: PAnsiChar; const name: PAnsiChar; result: PIdC_LONG): TIdC_INT cdecl; external CLibCrypto; + function NCONF_dump_bio(const conf: PCONf; out_: PBIO): TIdC_INT cdecl; external CLibCrypto; + + //#define NCONF_get_number(c,g,n,r) NCONF_get_number_e(c,g,n,r) + + //* Module functions */ + + function CONF_modules_load(const cnf: PCONF; const appname: PAnsiChar; flags: TIdC_ULONG): TIdC_INT cdecl; external CLibCrypto; + function CONF_modules_load_file(const filename: PAnsiChar; const appname: PAnsiChar; flags: TIdC_ULONG): TIdC_INT cdecl; external CLibCrypto; + + procedure CONF_modules_unload(all: TIdC_INT) cdecl; external CLibCrypto; + procedure CONF_modules_finish cdecl; external CLibCrypto; + function CONF_module_add(const name: PAnsiChar; ifunc: conf_init_func; ffunc: conf_finish_func): TIdC_INT cdecl; external CLibCrypto; + + //const char *CONF_imodule_get_name(const CONF_IMODULE *md); + //const char *CONF_imodule_get_value(const CONF_IMODULE *md); + function CONF_imodule_get_usr_data(const md: PCONF_IMODULE): Pointer cdecl; external CLibCrypto; + procedure CONF_imodule_set_usr_data(md: PCONF_IMODULE; usr_data: Pointer) cdecl; external CLibCrypto; + function CONF_imodule_get_module(const md: PCONF_IMODULE): PCONF_MODULE cdecl; external CLibCrypto; + function CONF_imodule_get_flags(const md: PCONF_IMODULE): TIdC_ULONG cdecl; external CLibCrypto; + procedure CONF_imodule_set_flags(md: PCONF_IMODULE; flags: TIdC_ULONG) cdecl; external CLibCrypto; + function CONF_module_get_usr_data(pmod: PCONF_MODULE): Pointer cdecl; external CLibCrypto; + procedure CONF_module_set_usr_data(pmod: PCONF_MODULE; usr_data: Pointer) cdecl; external CLibCrypto; + + function CONF_get1_default_config_file: PAnsiChar cdecl; external CLibCrypto; + function CONF_parse_list(const list: PAnsiChar; sep: TIdC_INT; nospc: TIdC_INT; list_cb: CONF_parse_list_list_cb; arg: Pointer): TIdC_INT cdecl; external CLibCrypto; + + procedure OPENSSL_load_builtin_modules cdecl; external CLibCrypto; + +{$ENDIF} + +implementation + + uses + classes, + IdSSLOpenSSLExceptionHandlers, + IdResourceStringsOpenSSL + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + ,IdSSLOpenSSLLoader + {$ENDIF}; + + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +const + CONF_set_default_method_procname = 'CONF_set_default_method'; +// (* +// void CONF_set_nconf(CONF *conf, LHASH_OF(CONF_VALUE) *hash); +// LHASH_OF(CONF_VALUE) *CONF_load(LHASH_OF(CONF_VALUE) *conf, const char *file, long *eline); +// {$ifndef OPENSSL_NO_STDIO} +// LHASH_OF(CONF_VALUE) *CONF_load_fp(LHASH_OF(CONF_VALUE) *conf, FILE *fp, long *eline); +// {$endif} +// LHASH_OF(CONF_VALUE) *CONF_load_bio(LHASH_OF(CONF_VALUE) *conf, BIO *bp, +// long *eline); +// STACK_OF(CONF_VALUE) *CONF_get_section(LHASH_OF(CONF_VALUE) *conf, +// const char *section); +// char *CONF_get_string(LHASH_OF(CONF_VALUE) *conf, const char *group, +// const char *name); +// long CONF_get_number(LHASH_OF(CONF_VALUE) *conf, const char *group, +// const char *name); +// void CONF_free(LHASH_OF(CONF_VALUE) *conf); +// #ifndef OPENSSL_NO_STDIO +// int CONF_dump_fp(LHASH_OF(CONF_VALUE) *conf, FILE *out); +// #endif +// int CONF_dump_bio(LHASH_OF(CONF_VALUE) *conf, BIO *out); +// +// DEPRECATEDIN_1_1_0(void OPENSSL_config(const char *config_name)) +// +// #if OPENSSL_API_COMPAT < 0x10100000L +// # define OPENSSL_no_config() \ +// OPENSSL_init_crypto(OPENSSL_INIT_NO_LOAD_CONFIG, NULL) +// #endif +// *) + + (* + * New conf code. The semantics are different from the functions above. If + * that wasn't the case, the above functions would have been replaced + *) + + //type Doppelt??? + // conf_st = record + // CONF_METHOD *meth; + // void *meth_data; + // LHASH_OF(CONF_VALUE) *data; + // end; + + NCONF_new_procname = 'NCONF_new'; + NCONF_default_procname = 'NCONF_default'; + NCONF_WIN32_procname = 'NCONF_WIN32'; + NCONF_free_procname = 'NCONF_free'; + NCONF_free_data_procname = 'NCONF_free_data'; + + NCONF_load_procname = 'NCONF_load'; + NCONF_load_bio_procname = 'NCONF_load_bio'; + //STACK_OF(CONF_VALUE) *NCONF_get_section(const CONF *conf, + // const char *section); + NCONF_get_string_procname = 'NCONF_get_string'; + NCONF_get_number_e_procname = 'NCONF_get_number_e'; + NCONF_dump_bio_procname = 'NCONF_dump_bio'; + + //#define NCONF_get_number(c,g,n,r) NCONF_get_number_e(c,g,n,r) + + //* Module functions */ + + CONF_modules_load_procname = 'CONF_modules_load'; + CONF_modules_load_file_procname = 'CONF_modules_load_file'; + + CONF_modules_unload_procname = 'CONF_modules_unload'; + CONF_modules_finish_procname = 'CONF_modules_finish'; + CONF_module_add_procname = 'CONF_module_add'; + + //const char *CONF_imodule_get_name(const CONF_IMODULE *md); + //const char *CONF_imodule_get_value(const CONF_IMODULE *md); + CONF_imodule_get_usr_data_procname = 'CONF_imodule_get_usr_data'; + CONF_imodule_set_usr_data_procname = 'CONF_imodule_set_usr_data'; + CONF_imodule_get_module_procname = 'CONF_imodule_get_module'; + CONF_imodule_get_flags_procname = 'CONF_imodule_get_flags'; + CONF_imodule_set_flags_procname = 'CONF_imodule_set_flags'; + CONF_module_get_usr_data_procname = 'CONF_module_get_usr_data'; + CONF_module_set_usr_data_procname = 'CONF_module_set_usr_data'; + + CONF_get1_default_config_file_procname = 'CONF_get1_default_config_file'; + CONF_parse_list_procname = 'CONF_parse_list'; + + OPENSSL_load_builtin_modules_procname = 'OPENSSL_load_builtin_modules'; + + +{$WARN NO_RETVAL OFF} +function ERR_CONF_set_default_method(meth: PCONF_METHOD): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(CONF_set_default_method_procname); +end; + + +// (* +// void CONF_set_nconf(CONF *conf, LHASH_OF(CONF_VALUE) *hash); +// LHASH_OF(CONF_VALUE) *CONF_load(LHASH_OF(CONF_VALUE) *conf, const char *file, long *eline); +// {$ifndef OPENSSL_NO_STDIO} +// LHASH_OF(CONF_VALUE) *CONF_load_fp(LHASH_OF(CONF_VALUE) *conf, FILE *fp, long *eline); +// {$endif} +// LHASH_OF(CONF_VALUE) *CONF_load_bio(LHASH_OF(CONF_VALUE) *conf, BIO *bp, +// long *eline); +// STACK_OF(CONF_VALUE) *CONF_get_section(LHASH_OF(CONF_VALUE) *conf, +// const char *section); +// char *CONF_get_string(LHASH_OF(CONF_VALUE) *conf, const char *group, +// const char *name); +// long CONF_get_number(LHASH_OF(CONF_VALUE) *conf, const char *group, +// const char *name); +// void CONF_free(LHASH_OF(CONF_VALUE) *conf); +// #ifndef OPENSSL_NO_STDIO +// int CONF_dump_fp(LHASH_OF(CONF_VALUE) *conf, FILE *out); +// #endif +// int CONF_dump_bio(LHASH_OF(CONF_VALUE) *conf, BIO *out); +// +// DEPRECATEDIN_1_1_0(void OPENSSL_config(const char *config_name)) +// +// #if OPENSSL_API_COMPAT < 0x10100000L +// # define OPENSSL_no_config() \ +// OPENSSL_init_crypto(OPENSSL_INIT_NO_LOAD_CONFIG, NULL) +// #endif +// *) + + (* + * New conf code. The semantics are different from the functions above. If + * that wasn't the case, the above functions would have been replaced + *) + + //type Doppelt??? + // conf_st = record + // CONF_METHOD *meth; + // void *meth_data; + // LHASH_OF(CONF_VALUE) *data; + // end; + +function ERR_NCONF_new(meth: PCONF_METHOD): PCONF; +begin + EIdAPIFunctionNotPresent.RaiseException(NCONF_new_procname); +end; + + +function ERR_NCONF_default: PCONF_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(NCONF_default_procname); +end; + + +function ERR_NCONF_WIN32: PCONF_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(NCONF_WIN32_procname); +end; + + +procedure ERR_NCONF_free(conf: PCONF); +begin + EIdAPIFunctionNotPresent.RaiseException(NCONF_free_procname); +end; + + +procedure ERR_NCONF_free_data(conf: PCONF); +begin + EIdAPIFunctionNotPresent.RaiseException(NCONF_free_data_procname); +end; + + + +function ERR_NCONF_load(conf: PCONF; const file_: PAnsiChar; eline: PIdC_LONG): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(NCONF_load_procname); +end; + + +function ERR_NCONF_load_bio(conf: PCONF; bp: PBIO; eline: PIdC_LONG): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(NCONF_load_bio_procname); +end; + + + //STACK_OF(CONF_VALUE) *NCONF_get_section(const CONF *conf, + // const char *section); +function ERR_NCONF_get_string(const conf: PCONF; const group: PAnsiChar; const name: PAnsiChar): PAnsiChar; +begin + EIdAPIFunctionNotPresent.RaiseException(NCONF_get_string_procname); +end; + + +function ERR_NCONF_get_number_e(const conf: PCONF; const group: PAnsiChar; const name: PAnsiChar; _result: PIdC_LONG): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(NCONF_get_number_e_procname); +end; + + +function ERR_NCONF_dump_bio(const conf: PCONf; out_: PBIO): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(NCONF_dump_bio_procname); +end; + + + + //#define NCONF_get_number(c,g,n,r) NCONF_get_number_e(c,g,n,r) + + //* Module functions */ + +function ERR_CONF_modules_load(const cnf: PCONF; const appname: PAnsiChar; flags: TIdC_ULONG): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(CONF_modules_load_procname); +end; + + +function ERR_CONF_modules_load_file(const filename: PAnsiChar; const appname: PAnsiChar; flags: TIdC_ULONG): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(CONF_modules_load_file_procname); +end; + + + +procedure ERR_CONF_modules_unload(all: TIdC_INT); +begin + EIdAPIFunctionNotPresent.RaiseException(CONF_modules_unload_procname); +end; + + +procedure ERR_CONF_modules_finish; +begin + EIdAPIFunctionNotPresent.RaiseException(CONF_modules_finish_procname); +end; + + +function ERR_CONF_module_add(const name: PAnsiChar; ifunc: conf_init_func; ffunc: conf_finish_func): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(CONF_module_add_procname); +end; + + + + //const char *CONF_imodule_get_name(const CONF_IMODULE *md); + //const char *CONF_imodule_get_value(const CONF_IMODULE *md); +function ERR_CONF_imodule_get_usr_data(const md: PCONF_IMODULE): Pointer; +begin + EIdAPIFunctionNotPresent.RaiseException(CONF_imodule_get_usr_data_procname); +end; + + +procedure ERR_CONF_imodule_set_usr_data(md: PCONF_IMODULE; usr_data: Pointer); +begin + EIdAPIFunctionNotPresent.RaiseException(CONF_imodule_set_usr_data_procname); +end; + + +function ERR_CONF_imodule_get_module(const md: PCONF_IMODULE): PCONF_MODULE; +begin + EIdAPIFunctionNotPresent.RaiseException(CONF_imodule_get_module_procname); +end; + + +function ERR_CONF_imodule_get_flags(const md: PCONF_IMODULE): TIdC_ULONG; +begin + EIdAPIFunctionNotPresent.RaiseException(CONF_imodule_get_flags_procname); +end; + + +procedure ERR_CONF_imodule_set_flags(md: PCONF_IMODULE; flags: TIdC_ULONG); +begin + EIdAPIFunctionNotPresent.RaiseException(CONF_imodule_set_flags_procname); +end; + + +function ERR_CONF_module_get_usr_data(pmod: PCONF_MODULE): Pointer; +begin + EIdAPIFunctionNotPresent.RaiseException(CONF_module_get_usr_data_procname); +end; + + +procedure ERR_CONF_module_set_usr_data(pmod: PCONF_MODULE; usr_data: Pointer); +begin + EIdAPIFunctionNotPresent.RaiseException(CONF_module_set_usr_data_procname); +end; + + + +function ERR_CONF_get1_default_config_file: PAnsiChar; +begin + EIdAPIFunctionNotPresent.RaiseException(CONF_get1_default_config_file_procname); +end; + + +function ERR_CONF_parse_list(const list: PAnsiChar; sep: TIdC_INT; nospc: TIdC_INT; list_cb: CONF_parse_list_list_cb; arg: Pointer): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(CONF_parse_list_procname); +end; + + + +procedure ERR_OPENSSL_load_builtin_modules; +begin + EIdAPIFunctionNotPresent.RaiseException(OPENSSL_load_builtin_modules_procname); +end; + + + +{$WARN NO_RETVAL ON} + +procedure Load(const ADllHandle: TIdLibHandle; LibVersion: TIdC_UINT; const AFailed: TStringList); + +var FuncLoadError: boolean; + +begin + CONF_set_default_method := LoadLibFunction(ADllHandle, CONF_set_default_method_procname); + FuncLoadError := not assigned(CONF_set_default_method); + if FuncLoadError then + begin + {$if not defined(CONF_set_default_method_allownil)} + CONF_set_default_method := @ERR_CONF_set_default_method; + {$ifend} + {$if declared(CONF_set_default_method_introduced)} + if LibVersion < CONF_set_default_method_introduced then + begin + {$if declared(FC_CONF_set_default_method)} + CONF_set_default_method := @FC_CONF_set_default_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CONF_set_default_method_removed)} + if CONF_set_default_method_removed <= LibVersion then + begin + {$if declared(_CONF_set_default_method)} + CONF_set_default_method := @_CONF_set_default_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CONF_set_default_method_allownil)} + if FuncLoadError then + AFailed.Add('CONF_set_default_method'); + {$ifend} + end; + + + NCONF_new := LoadLibFunction(ADllHandle, NCONF_new_procname); + FuncLoadError := not assigned(NCONF_new); + if FuncLoadError then + begin + {$if not defined(NCONF_new_allownil)} + NCONF_new := @ERR_NCONF_new; + {$ifend} + {$if declared(NCONF_new_introduced)} + if LibVersion < NCONF_new_introduced then + begin + {$if declared(FC_NCONF_new)} + NCONF_new := @FC_NCONF_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(NCONF_new_removed)} + if NCONF_new_removed <= LibVersion then + begin + {$if declared(_NCONF_new)} + NCONF_new := @_NCONF_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(NCONF_new_allownil)} + if FuncLoadError then + AFailed.Add('NCONF_new'); + {$ifend} + end; + + + NCONF_default := LoadLibFunction(ADllHandle, NCONF_default_procname); + FuncLoadError := not assigned(NCONF_default); + if FuncLoadError then + begin + {$if not defined(NCONF_default_allownil)} + NCONF_default := @ERR_NCONF_default; + {$ifend} + {$if declared(NCONF_default_introduced)} + if LibVersion < NCONF_default_introduced then + begin + {$if declared(FC_NCONF_default)} + NCONF_default := @FC_NCONF_default; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(NCONF_default_removed)} + if NCONF_default_removed <= LibVersion then + begin + {$if declared(_NCONF_default)} + NCONF_default := @_NCONF_default; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(NCONF_default_allownil)} + if FuncLoadError then + AFailed.Add('NCONF_default'); + {$ifend} + end; + + + NCONF_WIN32 := LoadLibFunction(ADllHandle, NCONF_WIN32_procname); + FuncLoadError := not assigned(NCONF_WIN32); + if FuncLoadError then + begin + {$if not defined(NCONF_WIN32_allownil)} + NCONF_WIN32 := @ERR_NCONF_WIN32; + {$ifend} + {$if declared(NCONF_WIN32_introduced)} + if LibVersion < NCONF_WIN32_introduced then + begin + {$if declared(FC_NCONF_WIN32)} + NCONF_WIN32 := @FC_NCONF_WIN32; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(NCONF_WIN32_removed)} + if NCONF_WIN32_removed <= LibVersion then + begin + {$if declared(_NCONF_WIN32)} + NCONF_WIN32 := @_NCONF_WIN32; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(NCONF_WIN32_allownil)} + if FuncLoadError then + AFailed.Add('NCONF_WIN32'); + {$ifend} + end; + + + NCONF_free := LoadLibFunction(ADllHandle, NCONF_free_procname); + FuncLoadError := not assigned(NCONF_free); + if FuncLoadError then + begin + {$if not defined(NCONF_free_allownil)} + NCONF_free := @ERR_NCONF_free; + {$ifend} + {$if declared(NCONF_free_introduced)} + if LibVersion < NCONF_free_introduced then + begin + {$if declared(FC_NCONF_free)} + NCONF_free := @FC_NCONF_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(NCONF_free_removed)} + if NCONF_free_removed <= LibVersion then + begin + {$if declared(_NCONF_free)} + NCONF_free := @_NCONF_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(NCONF_free_allownil)} + if FuncLoadError then + AFailed.Add('NCONF_free'); + {$ifend} + end; + + + NCONF_free_data := LoadLibFunction(ADllHandle, NCONF_free_data_procname); + FuncLoadError := not assigned(NCONF_free_data); + if FuncLoadError then + begin + {$if not defined(NCONF_free_data_allownil)} + NCONF_free_data := @ERR_NCONF_free_data; + {$ifend} + {$if declared(NCONF_free_data_introduced)} + if LibVersion < NCONF_free_data_introduced then + begin + {$if declared(FC_NCONF_free_data)} + NCONF_free_data := @FC_NCONF_free_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(NCONF_free_data_removed)} + if NCONF_free_data_removed <= LibVersion then + begin + {$if declared(_NCONF_free_data)} + NCONF_free_data := @_NCONF_free_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(NCONF_free_data_allownil)} + if FuncLoadError then + AFailed.Add('NCONF_free_data'); + {$ifend} + end; + + + NCONF_load := LoadLibFunction(ADllHandle, NCONF_load_procname); + FuncLoadError := not assigned(NCONF_load); + if FuncLoadError then + begin + {$if not defined(NCONF_load_allownil)} + NCONF_load := @ERR_NCONF_load; + {$ifend} + {$if declared(NCONF_load_introduced)} + if LibVersion < NCONF_load_introduced then + begin + {$if declared(FC_NCONF_load)} + NCONF_load := @FC_NCONF_load; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(NCONF_load_removed)} + if NCONF_load_removed <= LibVersion then + begin + {$if declared(_NCONF_load)} + NCONF_load := @_NCONF_load; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(NCONF_load_allownil)} + if FuncLoadError then + AFailed.Add('NCONF_load'); + {$ifend} + end; + + + NCONF_load_bio := LoadLibFunction(ADllHandle, NCONF_load_bio_procname); + FuncLoadError := not assigned(NCONF_load_bio); + if FuncLoadError then + begin + {$if not defined(NCONF_load_bio_allownil)} + NCONF_load_bio := @ERR_NCONF_load_bio; + {$ifend} + {$if declared(NCONF_load_bio_introduced)} + if LibVersion < NCONF_load_bio_introduced then + begin + {$if declared(FC_NCONF_load_bio)} + NCONF_load_bio := @FC_NCONF_load_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(NCONF_load_bio_removed)} + if NCONF_load_bio_removed <= LibVersion then + begin + {$if declared(_NCONF_load_bio)} + NCONF_load_bio := @_NCONF_load_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(NCONF_load_bio_allownil)} + if FuncLoadError then + AFailed.Add('NCONF_load_bio'); + {$ifend} + end; + + + NCONF_get_string := LoadLibFunction(ADllHandle, NCONF_get_string_procname); + FuncLoadError := not assigned(NCONF_get_string); + if FuncLoadError then + begin + {$if not defined(NCONF_get_string_allownil)} + NCONF_get_string := @ERR_NCONF_get_string; + {$ifend} + {$if declared(NCONF_get_string_introduced)} + if LibVersion < NCONF_get_string_introduced then + begin + {$if declared(FC_NCONF_get_string)} + NCONF_get_string := @FC_NCONF_get_string; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(NCONF_get_string_removed)} + if NCONF_get_string_removed <= LibVersion then + begin + {$if declared(_NCONF_get_string)} + NCONF_get_string := @_NCONF_get_string; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(NCONF_get_string_allownil)} + if FuncLoadError then + AFailed.Add('NCONF_get_string'); + {$ifend} + end; + + + NCONF_get_number_e := LoadLibFunction(ADllHandle, NCONF_get_number_e_procname); + FuncLoadError := not assigned(NCONF_get_number_e); + if FuncLoadError then + begin + {$if not defined(NCONF_get_number_e_allownil)} + NCONF_get_number_e := @ERR_NCONF_get_number_e; + {$ifend} + {$if declared(NCONF_get_number_e_introduced)} + if LibVersion < NCONF_get_number_e_introduced then + begin + {$if declared(FC_NCONF_get_number_e)} + NCONF_get_number_e := @FC_NCONF_get_number_e; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(NCONF_get_number_e_removed)} + if NCONF_get_number_e_removed <= LibVersion then + begin + {$if declared(_NCONF_get_number_e)} + NCONF_get_number_e := @_NCONF_get_number_e; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(NCONF_get_number_e_allownil)} + if FuncLoadError then + AFailed.Add('NCONF_get_number_e'); + {$ifend} + end; + + + NCONF_dump_bio := LoadLibFunction(ADllHandle, NCONF_dump_bio_procname); + FuncLoadError := not assigned(NCONF_dump_bio); + if FuncLoadError then + begin + {$if not defined(NCONF_dump_bio_allownil)} + NCONF_dump_bio := @ERR_NCONF_dump_bio; + {$ifend} + {$if declared(NCONF_dump_bio_introduced)} + if LibVersion < NCONF_dump_bio_introduced then + begin + {$if declared(FC_NCONF_dump_bio)} + NCONF_dump_bio := @FC_NCONF_dump_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(NCONF_dump_bio_removed)} + if NCONF_dump_bio_removed <= LibVersion then + begin + {$if declared(_NCONF_dump_bio)} + NCONF_dump_bio := @_NCONF_dump_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(NCONF_dump_bio_allownil)} + if FuncLoadError then + AFailed.Add('NCONF_dump_bio'); + {$ifend} + end; + + + CONF_modules_load := LoadLibFunction(ADllHandle, CONF_modules_load_procname); + FuncLoadError := not assigned(CONF_modules_load); + if FuncLoadError then + begin + {$if not defined(CONF_modules_load_allownil)} + CONF_modules_load := @ERR_CONF_modules_load; + {$ifend} + {$if declared(CONF_modules_load_introduced)} + if LibVersion < CONF_modules_load_introduced then + begin + {$if declared(FC_CONF_modules_load)} + CONF_modules_load := @FC_CONF_modules_load; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CONF_modules_load_removed)} + if CONF_modules_load_removed <= LibVersion then + begin + {$if declared(_CONF_modules_load)} + CONF_modules_load := @_CONF_modules_load; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CONF_modules_load_allownil)} + if FuncLoadError then + AFailed.Add('CONF_modules_load'); + {$ifend} + end; + + + CONF_modules_load_file := LoadLibFunction(ADllHandle, CONF_modules_load_file_procname); + FuncLoadError := not assigned(CONF_modules_load_file); + if FuncLoadError then + begin + {$if not defined(CONF_modules_load_file_allownil)} + CONF_modules_load_file := @ERR_CONF_modules_load_file; + {$ifend} + {$if declared(CONF_modules_load_file_introduced)} + if LibVersion < CONF_modules_load_file_introduced then + begin + {$if declared(FC_CONF_modules_load_file)} + CONF_modules_load_file := @FC_CONF_modules_load_file; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CONF_modules_load_file_removed)} + if CONF_modules_load_file_removed <= LibVersion then + begin + {$if declared(_CONF_modules_load_file)} + CONF_modules_load_file := @_CONF_modules_load_file; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CONF_modules_load_file_allownil)} + if FuncLoadError then + AFailed.Add('CONF_modules_load_file'); + {$ifend} + end; + + + CONF_modules_unload := LoadLibFunction(ADllHandle, CONF_modules_unload_procname); + FuncLoadError := not assigned(CONF_modules_unload); + if FuncLoadError then + begin + {$if not defined(CONF_modules_unload_allownil)} + CONF_modules_unload := @ERR_CONF_modules_unload; + {$ifend} + {$if declared(CONF_modules_unload_introduced)} + if LibVersion < CONF_modules_unload_introduced then + begin + {$if declared(FC_CONF_modules_unload)} + CONF_modules_unload := @FC_CONF_modules_unload; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CONF_modules_unload_removed)} + if CONF_modules_unload_removed <= LibVersion then + begin + {$if declared(_CONF_modules_unload)} + CONF_modules_unload := @_CONF_modules_unload; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CONF_modules_unload_allownil)} + if FuncLoadError then + AFailed.Add('CONF_modules_unload'); + {$ifend} + end; + + + CONF_modules_finish := LoadLibFunction(ADllHandle, CONF_modules_finish_procname); + FuncLoadError := not assigned(CONF_modules_finish); + if FuncLoadError then + begin + {$if not defined(CONF_modules_finish_allownil)} + CONF_modules_finish := @ERR_CONF_modules_finish; + {$ifend} + {$if declared(CONF_modules_finish_introduced)} + if LibVersion < CONF_modules_finish_introduced then + begin + {$if declared(FC_CONF_modules_finish)} + CONF_modules_finish := @FC_CONF_modules_finish; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CONF_modules_finish_removed)} + if CONF_modules_finish_removed <= LibVersion then + begin + {$if declared(_CONF_modules_finish)} + CONF_modules_finish := @_CONF_modules_finish; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CONF_modules_finish_allownil)} + if FuncLoadError then + AFailed.Add('CONF_modules_finish'); + {$ifend} + end; + + + CONF_module_add := LoadLibFunction(ADllHandle, CONF_module_add_procname); + FuncLoadError := not assigned(CONF_module_add); + if FuncLoadError then + begin + {$if not defined(CONF_module_add_allownil)} + CONF_module_add := @ERR_CONF_module_add; + {$ifend} + {$if declared(CONF_module_add_introduced)} + if LibVersion < CONF_module_add_introduced then + begin + {$if declared(FC_CONF_module_add)} + CONF_module_add := @FC_CONF_module_add; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CONF_module_add_removed)} + if CONF_module_add_removed <= LibVersion then + begin + {$if declared(_CONF_module_add)} + CONF_module_add := @_CONF_module_add; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CONF_module_add_allownil)} + if FuncLoadError then + AFailed.Add('CONF_module_add'); + {$ifend} + end; + + + CONF_imodule_get_usr_data := LoadLibFunction(ADllHandle, CONF_imodule_get_usr_data_procname); + FuncLoadError := not assigned(CONF_imodule_get_usr_data); + if FuncLoadError then + begin + {$if not defined(CONF_imodule_get_usr_data_allownil)} + CONF_imodule_get_usr_data := @ERR_CONF_imodule_get_usr_data; + {$ifend} + {$if declared(CONF_imodule_get_usr_data_introduced)} + if LibVersion < CONF_imodule_get_usr_data_introduced then + begin + {$if declared(FC_CONF_imodule_get_usr_data)} + CONF_imodule_get_usr_data := @FC_CONF_imodule_get_usr_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CONF_imodule_get_usr_data_removed)} + if CONF_imodule_get_usr_data_removed <= LibVersion then + begin + {$if declared(_CONF_imodule_get_usr_data)} + CONF_imodule_get_usr_data := @_CONF_imodule_get_usr_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CONF_imodule_get_usr_data_allownil)} + if FuncLoadError then + AFailed.Add('CONF_imodule_get_usr_data'); + {$ifend} + end; + + + CONF_imodule_set_usr_data := LoadLibFunction(ADllHandle, CONF_imodule_set_usr_data_procname); + FuncLoadError := not assigned(CONF_imodule_set_usr_data); + if FuncLoadError then + begin + {$if not defined(CONF_imodule_set_usr_data_allownil)} + CONF_imodule_set_usr_data := @ERR_CONF_imodule_set_usr_data; + {$ifend} + {$if declared(CONF_imodule_set_usr_data_introduced)} + if LibVersion < CONF_imodule_set_usr_data_introduced then + begin + {$if declared(FC_CONF_imodule_set_usr_data)} + CONF_imodule_set_usr_data := @FC_CONF_imodule_set_usr_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CONF_imodule_set_usr_data_removed)} + if CONF_imodule_set_usr_data_removed <= LibVersion then + begin + {$if declared(_CONF_imodule_set_usr_data)} + CONF_imodule_set_usr_data := @_CONF_imodule_set_usr_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CONF_imodule_set_usr_data_allownil)} + if FuncLoadError then + AFailed.Add('CONF_imodule_set_usr_data'); + {$ifend} + end; + + + CONF_imodule_get_module := LoadLibFunction(ADllHandle, CONF_imodule_get_module_procname); + FuncLoadError := not assigned(CONF_imodule_get_module); + if FuncLoadError then + begin + {$if not defined(CONF_imodule_get_module_allownil)} + CONF_imodule_get_module := @ERR_CONF_imodule_get_module; + {$ifend} + {$if declared(CONF_imodule_get_module_introduced)} + if LibVersion < CONF_imodule_get_module_introduced then + begin + {$if declared(FC_CONF_imodule_get_module)} + CONF_imodule_get_module := @FC_CONF_imodule_get_module; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CONF_imodule_get_module_removed)} + if CONF_imodule_get_module_removed <= LibVersion then + begin + {$if declared(_CONF_imodule_get_module)} + CONF_imodule_get_module := @_CONF_imodule_get_module; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CONF_imodule_get_module_allownil)} + if FuncLoadError then + AFailed.Add('CONF_imodule_get_module'); + {$ifend} + end; + + + CONF_imodule_get_flags := LoadLibFunction(ADllHandle, CONF_imodule_get_flags_procname); + FuncLoadError := not assigned(CONF_imodule_get_flags); + if FuncLoadError then + begin + {$if not defined(CONF_imodule_get_flags_allownil)} + CONF_imodule_get_flags := @ERR_CONF_imodule_get_flags; + {$ifend} + {$if declared(CONF_imodule_get_flags_introduced)} + if LibVersion < CONF_imodule_get_flags_introduced then + begin + {$if declared(FC_CONF_imodule_get_flags)} + CONF_imodule_get_flags := @FC_CONF_imodule_get_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CONF_imodule_get_flags_removed)} + if CONF_imodule_get_flags_removed <= LibVersion then + begin + {$if declared(_CONF_imodule_get_flags)} + CONF_imodule_get_flags := @_CONF_imodule_get_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CONF_imodule_get_flags_allownil)} + if FuncLoadError then + AFailed.Add('CONF_imodule_get_flags'); + {$ifend} + end; + + + CONF_imodule_set_flags := LoadLibFunction(ADllHandle, CONF_imodule_set_flags_procname); + FuncLoadError := not assigned(CONF_imodule_set_flags); + if FuncLoadError then + begin + {$if not defined(CONF_imodule_set_flags_allownil)} + CONF_imodule_set_flags := @ERR_CONF_imodule_set_flags; + {$ifend} + {$if declared(CONF_imodule_set_flags_introduced)} + if LibVersion < CONF_imodule_set_flags_introduced then + begin + {$if declared(FC_CONF_imodule_set_flags)} + CONF_imodule_set_flags := @FC_CONF_imodule_set_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CONF_imodule_set_flags_removed)} + if CONF_imodule_set_flags_removed <= LibVersion then + begin + {$if declared(_CONF_imodule_set_flags)} + CONF_imodule_set_flags := @_CONF_imodule_set_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CONF_imodule_set_flags_allownil)} + if FuncLoadError then + AFailed.Add('CONF_imodule_set_flags'); + {$ifend} + end; + + + CONF_module_get_usr_data := LoadLibFunction(ADllHandle, CONF_module_get_usr_data_procname); + FuncLoadError := not assigned(CONF_module_get_usr_data); + if FuncLoadError then + begin + {$if not defined(CONF_module_get_usr_data_allownil)} + CONF_module_get_usr_data := @ERR_CONF_module_get_usr_data; + {$ifend} + {$if declared(CONF_module_get_usr_data_introduced)} + if LibVersion < CONF_module_get_usr_data_introduced then + begin + {$if declared(FC_CONF_module_get_usr_data)} + CONF_module_get_usr_data := @FC_CONF_module_get_usr_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CONF_module_get_usr_data_removed)} + if CONF_module_get_usr_data_removed <= LibVersion then + begin + {$if declared(_CONF_module_get_usr_data)} + CONF_module_get_usr_data := @_CONF_module_get_usr_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CONF_module_get_usr_data_allownil)} + if FuncLoadError then + AFailed.Add('CONF_module_get_usr_data'); + {$ifend} + end; + + + CONF_module_set_usr_data := LoadLibFunction(ADllHandle, CONF_module_set_usr_data_procname); + FuncLoadError := not assigned(CONF_module_set_usr_data); + if FuncLoadError then + begin + {$if not defined(CONF_module_set_usr_data_allownil)} + CONF_module_set_usr_data := @ERR_CONF_module_set_usr_data; + {$ifend} + {$if declared(CONF_module_set_usr_data_introduced)} + if LibVersion < CONF_module_set_usr_data_introduced then + begin + {$if declared(FC_CONF_module_set_usr_data)} + CONF_module_set_usr_data := @FC_CONF_module_set_usr_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CONF_module_set_usr_data_removed)} + if CONF_module_set_usr_data_removed <= LibVersion then + begin + {$if declared(_CONF_module_set_usr_data)} + CONF_module_set_usr_data := @_CONF_module_set_usr_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CONF_module_set_usr_data_allownil)} + if FuncLoadError then + AFailed.Add('CONF_module_set_usr_data'); + {$ifend} + end; + + + CONF_get1_default_config_file := LoadLibFunction(ADllHandle, CONF_get1_default_config_file_procname); + FuncLoadError := not assigned(CONF_get1_default_config_file); + if FuncLoadError then + begin + {$if not defined(CONF_get1_default_config_file_allownil)} + CONF_get1_default_config_file := @ERR_CONF_get1_default_config_file; + {$ifend} + {$if declared(CONF_get1_default_config_file_introduced)} + if LibVersion < CONF_get1_default_config_file_introduced then + begin + {$if declared(FC_CONF_get1_default_config_file)} + CONF_get1_default_config_file := @FC_CONF_get1_default_config_file; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CONF_get1_default_config_file_removed)} + if CONF_get1_default_config_file_removed <= LibVersion then + begin + {$if declared(_CONF_get1_default_config_file)} + CONF_get1_default_config_file := @_CONF_get1_default_config_file; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CONF_get1_default_config_file_allownil)} + if FuncLoadError then + AFailed.Add('CONF_get1_default_config_file'); + {$ifend} + end; + + + CONF_parse_list := LoadLibFunction(ADllHandle, CONF_parse_list_procname); + FuncLoadError := not assigned(CONF_parse_list); + if FuncLoadError then + begin + {$if not defined(CONF_parse_list_allownil)} + CONF_parse_list := @ERR_CONF_parse_list; + {$ifend} + {$if declared(CONF_parse_list_introduced)} + if LibVersion < CONF_parse_list_introduced then + begin + {$if declared(FC_CONF_parse_list)} + CONF_parse_list := @FC_CONF_parse_list; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CONF_parse_list_removed)} + if CONF_parse_list_removed <= LibVersion then + begin + {$if declared(_CONF_parse_list)} + CONF_parse_list := @_CONF_parse_list; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CONF_parse_list_allownil)} + if FuncLoadError then + AFailed.Add('CONF_parse_list'); + {$ifend} + end; + + + OPENSSL_load_builtin_modules := LoadLibFunction(ADllHandle, OPENSSL_load_builtin_modules_procname); + FuncLoadError := not assigned(OPENSSL_load_builtin_modules); + if FuncLoadError then + begin + {$if not defined(OPENSSL_load_builtin_modules_allownil)} + OPENSSL_load_builtin_modules := @ERR_OPENSSL_load_builtin_modules; + {$ifend} + {$if declared(OPENSSL_load_builtin_modules_introduced)} + if LibVersion < OPENSSL_load_builtin_modules_introduced then + begin + {$if declared(FC_OPENSSL_load_builtin_modules)} + OPENSSL_load_builtin_modules := @FC_OPENSSL_load_builtin_modules; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OPENSSL_load_builtin_modules_removed)} + if OPENSSL_load_builtin_modules_removed <= LibVersion then + begin + {$if declared(_OPENSSL_load_builtin_modules)} + OPENSSL_load_builtin_modules := @_OPENSSL_load_builtin_modules; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OPENSSL_load_builtin_modules_allownil)} + if FuncLoadError then + AFailed.Add('OPENSSL_load_builtin_modules'); + {$ifend} + end; + + +end; + +procedure Unload; +begin + CONF_set_default_method := nil; + NCONF_new := nil; + NCONF_default := nil; + NCONF_WIN32 := nil; + NCONF_free := nil; + NCONF_free_data := nil; + NCONF_load := nil; + NCONF_load_bio := nil; + NCONF_get_string := nil; + NCONF_get_number_e := nil; + NCONF_dump_bio := nil; + CONF_modules_load := nil; + CONF_modules_load_file := nil; + CONF_modules_unload := nil; + CONF_modules_finish := nil; + CONF_module_add := nil; + CONF_imodule_get_usr_data := nil; + CONF_imodule_set_usr_data := nil; + CONF_imodule_get_module := nil; + CONF_imodule_get_flags := nil; + CONF_imodule_set_flags := nil; + CONF_module_get_usr_data := nil; + CONF_module_set_usr_data := nil; + CONF_get1_default_config_file := nil; + CONF_parse_list := nil; + OPENSSL_load_builtin_modules := nil; +end; +{$ELSE} +{$ENDIF} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +initialization + Register_SSLLoader(@Load,'LibCrypto'); + Register_SSLUnloader(@Unload); +{$ENDIF} +end. diff --git a/IdOpenSSLHeaders_conf_api.pas b/IdOpenSSLHeaders_conf_api.pas new file mode 100644 index 0000000..ed00313 --- /dev/null +++ b/IdOpenSSLHeaders_conf_api.pas @@ -0,0 +1,427 @@ + (* This unit was generated using the script genOpenSSLHdrs.sh from the source file IdOpenSSLHeaders_conf_api.h2pas + It should not be modified directly. All changes should be made to IdOpenSSLHeaders_conf_api.h2pas + and this file regenerated. IdOpenSSLHeaders_conf_api.h2pas is distributed with the full Indy + Distribution. + *) + +{$i IdCompilerDefines.inc} +{$i IdSSLOpenSSLDefines.inc} +{$IFNDEF USE_OPENSSL} + { error Should not compile if USE_OPENSSL is not defined!!!} +{$ENDIF} +{******************************************************************************} +{ } +{ Indy (Internet Direct) - Internet Protocols Simplified } +{ } +{ https://www.indyproject.org/ } +{ https://gitter.im/IndySockets/Indy } +{ } +{******************************************************************************} +{ } +{ This file is part of the Indy (Internet Direct) project, and is offered } +{ under the dual-licensing agreement described on the Indy website. } +{ (https://www.indyproject.org/license/) } +{ } +{ Copyright: } +{ (c) 1993-2020, Chad Z. Hower and the Indy Pit Crew. All rights reserved. } +{ } +{******************************************************************************} +{ } +{ } +{******************************************************************************} + +unit IdOpenSSLHeaders_conf_api; + +interface + +// Headers for OpenSSL 1.1.1 +// conf_api.h + + +uses + IdCTypes, + IdGlobal, + IdSSLOpenSSLConsts, + IdOpenSSLHeaders_conf; + + //* Up until OpenSSL 0.9.5a, this was new_section */ + { The EXTERNALSYM directive is ignored by FPC, however, it is used by Delphi as follows: + + The EXTERNALSYM directive prevents the specified Delphi symbol from appearing in header + files generated for C++. } + + {$EXTERNALSYM _CONF_new_section} + {$EXTERNALSYM _CONF_get_section} + {$EXTERNALSYM _CONF_add_string} + {$EXTERNALSYM _CONF_get_string} + {$EXTERNALSYM _CONF_get_number} + {$EXTERNALSYM _CONF_new_data} + {$EXTERNALSYM _CONF_free_data} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +var + _CONF_new_section: function (conf: PCONF; const section: PAnsiChar): PCONF_VALUE; cdecl = nil; + //* Up until OpenSSL 0.9.5a, this was get_section */ + _CONF_get_section: function (const conf: PCONF; const section: PAnsiChar): PCONF_VALUE; cdecl = nil; + //* Up until OpenSSL 0.9.5a, this was CONF_get_section */ + //STACK_OF(CONF_VALUE) *_CONF_get_section_values(const CONF *conf, + // const char *section); + + _CONF_add_string: function (conf: PCONF; section: PCONF_VALUE; value: PCONF_VALUE): TIdC_INT; cdecl = nil; + _CONF_get_string: function (const conf: PCONF; const section: PAnsiChar; const name: PAnsiChar): PAnsiChar; cdecl = nil; + _CONF_get_number: function (const conf: PCONF; const section: PAnsiChar; const name: PAnsiChar): TIdC_LONG; cdecl = nil; + + _CONF_new_data: function (conf: PCONF): TIdC_INT; cdecl = nil; + _CONF_free_data: procedure (conf: PCONF); cdecl = nil; + + +{$ELSE} + function _CONF_new_section(conf: PCONF; const section: PAnsiChar): PCONF_VALUE cdecl; external CLibCrypto; + //* Up until OpenSSL 0.9.5a, this was get_section */ + function _CONF_get_section(const conf: PCONF; const section: PAnsiChar): PCONF_VALUE cdecl; external CLibCrypto; + //* Up until OpenSSL 0.9.5a, this was CONF_get_section */ + //STACK_OF(CONF_VALUE) *_CONF_get_section_values(const CONF *conf, + // const char *section); + + function _CONF_add_string(conf: PCONF; section: PCONF_VALUE; value: PCONF_VALUE): TIdC_INT cdecl; external CLibCrypto; + function _CONF_get_string(const conf: PCONF; const section: PAnsiChar; const name: PAnsiChar): PAnsiChar cdecl; external CLibCrypto; + function _CONF_get_number(const conf: PCONF; const section: PAnsiChar; const name: PAnsiChar): TIdC_LONG cdecl; external CLibCrypto; + + function _CONF_new_data(conf: PCONF): TIdC_INT cdecl; external CLibCrypto; + procedure _CONF_free_data(conf: PCONF) cdecl; external CLibCrypto; + + +{$ENDIF} + +implementation + + uses + classes, + IdSSLOpenSSLExceptionHandlers, + IdResourceStringsOpenSSL + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + ,IdSSLOpenSSLLoader + {$ENDIF}; + + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +const + _CONF_new_section_procname = '_CONF_new_section'; + //* Up until OpenSSL 0.9.5a, this was get_section */ + _CONF_get_section_procname = '_CONF_get_section'; + //* Up until OpenSSL 0.9.5a, this was CONF_get_section */ + //STACK_OF(CONF_VALUE) *_CONF_get_section_values(const CONF *conf, + // const char *section); + + _CONF_add_string_procname = '_CONF_add_string'; + _CONF_get_string_procname = '_CONF_get_string'; + _CONF_get_number_procname = '_CONF_get_number'; + + _CONF_new_data_procname = '_CONF_new_data'; + _CONF_free_data_procname = '_CONF_free_data'; + + + +{$WARN NO_RETVAL OFF} +function ERR__CONF_new_section(conf: PCONF; const section: PAnsiChar): PCONF_VALUE; +begin + EIdAPIFunctionNotPresent.RaiseException(_CONF_new_section_procname); +end; + + + //* Up until OpenSSL 0.9.5a, this was get_section */ +function ERR__CONF_get_section(const conf: PCONF; const section: PAnsiChar): PCONF_VALUE; +begin + EIdAPIFunctionNotPresent.RaiseException(_CONF_get_section_procname); +end; + + + //* Up until OpenSSL 0.9.5a, this was CONF_get_section */ + //STACK_OF(CONF_VALUE) *_CONF_get_section_values(const CONF *conf, + // const char *section); + +function ERR__CONF_add_string(conf: PCONF; section: PCONF_VALUE; value: PCONF_VALUE): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(_CONF_add_string_procname); +end; + + +function ERR__CONF_get_string(const conf: PCONF; const section: PAnsiChar; const name: PAnsiChar): PAnsiChar; +begin + EIdAPIFunctionNotPresent.RaiseException(_CONF_get_string_procname); +end; + + +function ERR__CONF_get_number(const conf: PCONF; const section: PAnsiChar; const name: PAnsiChar): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(_CONF_get_number_procname); +end; + + + +function ERR__CONF_new_data(conf: PCONF): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(_CONF_new_data_procname); +end; + + +procedure ERR__CONF_free_data(conf: PCONF); +begin + EIdAPIFunctionNotPresent.RaiseException(_CONF_free_data_procname); +end; + + + + +{$WARN NO_RETVAL ON} + +procedure Load(const ADllHandle: TIdLibHandle; LibVersion: TIdC_UINT; const AFailed: TStringList); + +var FuncLoadError: boolean; + +begin + _CONF_new_section := LoadLibFunction(ADllHandle, _CONF_new_section_procname); + FuncLoadError := not assigned(_CONF_new_section); + if FuncLoadError then + begin + {$if not defined(_CONF_new_section_allownil)} + _CONF_new_section := @ERR__CONF_new_section; + {$ifend} + {$if declared(_CONF_new_section_introduced)} + if LibVersion < _CONF_new_section_introduced then + begin + {$if declared(FC__CONF_new_section)} + _CONF_new_section := @FC__CONF_new_section; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(_CONF_new_section_removed)} + if _CONF_new_section_removed <= LibVersion then + begin + {$if declared(__CONF_new_section)} + _CONF_new_section := @__CONF_new_section; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(_CONF_new_section_allownil)} + if FuncLoadError then + AFailed.Add('_CONF_new_section'); + {$ifend} + end; + + + _CONF_get_section := LoadLibFunction(ADllHandle, _CONF_get_section_procname); + FuncLoadError := not assigned(_CONF_get_section); + if FuncLoadError then + begin + {$if not defined(_CONF_get_section_allownil)} + _CONF_get_section := @ERR__CONF_get_section; + {$ifend} + {$if declared(_CONF_get_section_introduced)} + if LibVersion < _CONF_get_section_introduced then + begin + {$if declared(FC__CONF_get_section)} + _CONF_get_section := @FC__CONF_get_section; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(_CONF_get_section_removed)} + if _CONF_get_section_removed <= LibVersion then + begin + {$if declared(__CONF_get_section)} + _CONF_get_section := @__CONF_get_section; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(_CONF_get_section_allownil)} + if FuncLoadError then + AFailed.Add('_CONF_get_section'); + {$ifend} + end; + + + _CONF_add_string := LoadLibFunction(ADllHandle, _CONF_add_string_procname); + FuncLoadError := not assigned(_CONF_add_string); + if FuncLoadError then + begin + {$if not defined(_CONF_add_string_allownil)} + _CONF_add_string := @ERR__CONF_add_string; + {$ifend} + {$if declared(_CONF_add_string_introduced)} + if LibVersion < _CONF_add_string_introduced then + begin + {$if declared(FC__CONF_add_string)} + _CONF_add_string := @FC__CONF_add_string; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(_CONF_add_string_removed)} + if _CONF_add_string_removed <= LibVersion then + begin + {$if declared(__CONF_add_string)} + _CONF_add_string := @__CONF_add_string; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(_CONF_add_string_allownil)} + if FuncLoadError then + AFailed.Add('_CONF_add_string'); + {$ifend} + end; + + + _CONF_get_string := LoadLibFunction(ADllHandle, _CONF_get_string_procname); + FuncLoadError := not assigned(_CONF_get_string); + if FuncLoadError then + begin + {$if not defined(_CONF_get_string_allownil)} + _CONF_get_string := @ERR__CONF_get_string; + {$ifend} + {$if declared(_CONF_get_string_introduced)} + if LibVersion < _CONF_get_string_introduced then + begin + {$if declared(FC__CONF_get_string)} + _CONF_get_string := @FC__CONF_get_string; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(_CONF_get_string_removed)} + if _CONF_get_string_removed <= LibVersion then + begin + {$if declared(__CONF_get_string)} + _CONF_get_string := @__CONF_get_string; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(_CONF_get_string_allownil)} + if FuncLoadError then + AFailed.Add('_CONF_get_string'); + {$ifend} + end; + + + _CONF_get_number := LoadLibFunction(ADllHandle, _CONF_get_number_procname); + FuncLoadError := not assigned(_CONF_get_number); + if FuncLoadError then + begin + {$if not defined(_CONF_get_number_allownil)} + _CONF_get_number := @ERR__CONF_get_number; + {$ifend} + {$if declared(_CONF_get_number_introduced)} + if LibVersion < _CONF_get_number_introduced then + begin + {$if declared(FC__CONF_get_number)} + _CONF_get_number := @FC__CONF_get_number; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(_CONF_get_number_removed)} + if _CONF_get_number_removed <= LibVersion then + begin + {$if declared(__CONF_get_number)} + _CONF_get_number := @__CONF_get_number; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(_CONF_get_number_allownil)} + if FuncLoadError then + AFailed.Add('_CONF_get_number'); + {$ifend} + end; + + + _CONF_new_data := LoadLibFunction(ADllHandle, _CONF_new_data_procname); + FuncLoadError := not assigned(_CONF_new_data); + if FuncLoadError then + begin + {$if not defined(_CONF_new_data_allownil)} + _CONF_new_data := @ERR__CONF_new_data; + {$ifend} + {$if declared(_CONF_new_data_introduced)} + if LibVersion < _CONF_new_data_introduced then + begin + {$if declared(FC__CONF_new_data)} + _CONF_new_data := @FC__CONF_new_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(_CONF_new_data_removed)} + if _CONF_new_data_removed <= LibVersion then + begin + {$if declared(__CONF_new_data)} + _CONF_new_data := @__CONF_new_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(_CONF_new_data_allownil)} + if FuncLoadError then + AFailed.Add('_CONF_new_data'); + {$ifend} + end; + + + _CONF_free_data := LoadLibFunction(ADllHandle, _CONF_free_data_procname); + FuncLoadError := not assigned(_CONF_free_data); + if FuncLoadError then + begin + {$if not defined(_CONF_free_data_allownil)} + _CONF_free_data := @ERR__CONF_free_data; + {$ifend} + {$if declared(_CONF_free_data_introduced)} + if LibVersion < _CONF_free_data_introduced then + begin + {$if declared(FC__CONF_free_data)} + _CONF_free_data := @FC__CONF_free_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(_CONF_free_data_removed)} + if _CONF_free_data_removed <= LibVersion then + begin + {$if declared(__CONF_free_data)} + _CONF_free_data := @__CONF_free_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(_CONF_free_data_allownil)} + if FuncLoadError then + AFailed.Add('_CONF_free_data'); + {$ifend} + end; + + +end; + +procedure Unload; +begin + _CONF_new_section := nil; + _CONF_get_section := nil; + _CONF_add_string := nil; + _CONF_get_string := nil; + _CONF_get_number := nil; + _CONF_new_data := nil; + _CONF_free_data := nil; +end; +{$ELSE} +{$ENDIF} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +initialization + Register_SSLLoader(@Load,'LibCrypto'); + Register_SSLUnloader(@Unload); +{$ENDIF} +end. diff --git a/IdOpenSSLHeaders_conferr.pas b/IdOpenSSLHeaders_conferr.pas new file mode 100644 index 0000000..f6eeb9e --- /dev/null +++ b/IdOpenSSLHeaders_conferr.pas @@ -0,0 +1,193 @@ + (* This unit was generated using the script genOpenSSLHdrs.sh from the source file IdOpenSSLHeaders_conferr.h2pas + It should not be modified directly. All changes should be made to IdOpenSSLHeaders_conferr.h2pas + and this file regenerated. IdOpenSSLHeaders_conferr.h2pas is distributed with the full Indy + Distribution. + *) + +{$i IdCompilerDefines.inc} +{$i IdSSLOpenSSLDefines.inc} +{$IFNDEF USE_OPENSSL} + { error Should not compile if USE_OPENSSL is not defined!!!} +{$ENDIF} +{******************************************************************************} +{ } +{ Indy (Internet Direct) - Internet Protocols Simplified } +{ } +{ https://www.indyproject.org/ } +{ https://gitter.im/IndySockets/Indy } +{ } +{******************************************************************************} +{ } +{ This file is part of the Indy (Internet Direct) project, and is offered } +{ under the dual-licensing agreement described on the Indy website. } +{ (https://www.indyproject.org/license/) } +{ } +{ Copyright: } +{ (c) 1993-2020, Chad Z. Hower and the Indy Pit Crew. All rights reserved. } +{ } +{******************************************************************************} +{ } +{ } +{******************************************************************************} + +unit IdOpenSSLHeaders_conferr; + +interface + +// Headers for OpenSSL 1.1.1 +// conferr.h + + +uses + IdCTypes, + IdGlobal, + IdSSLOpenSSLConsts; + +const + ///* + // * CONF function codes. + // */ + CONF_F_CONF_DUMP_FP = 104; + CONF_F_CONF_LOAD = 100; + CONF_F_CONF_LOAD_FP = 103; + CONF_F_CONF_PARSE_LIST = 119; + CONF_F_DEF_LOAD = 120; + CONF_F_DEF_LOAD_BIO = 121; + CONF_F_GET_NEXT_FILE = 107; + CONF_F_MODULE_ADD = 122; + CONF_F_MODULE_INIT = 115; + CONF_F_MODULE_LOAD_DSO = 117; + CONF_F_MODULE_RUN = 118; + CONF_F_NCONF_DUMP_BIO = 105; + CONF_F_NCONF_DUMP_FP = 106; + CONF_F_NCONF_GET_NUMBER_E = 112; + CONF_F_NCONF_GET_SECTION = 108; + CONF_F_NCONF_GET_STRING = 109; + CONF_F_NCONF_LOAD = 113; + CONF_F_NCONF_LOAD_BIO = 110; + CONF_F_NCONF_LOAD_FP = 114; + CONF_F_NCONF_NEW = 111; + CONF_F_PROCESS_INCLUDE = 116; + CONF_F_SSL_MODULE_INIT = 123; + CONF_F_STR_COPY = 101; + + ///* + // * CONF reason codes. + // */ + CONF_R_ERROR_LOADING_DSO = 110; + CONF_R_LIST_CANNOT_BE_NULL = 115; + CONF_R_MISSING_CLOSE_SQUARE_BRACKET = 100; + CONF_R_MISSING_EQUAL_SIGN = 101; + CONF_R_MISSING_INIT_FUNCTION = 112; + CONF_R_MODULE_INITIALIZATION_ERROR = 109; + CONF_R_NO_CLOSE_BRACE = 102; + CONF_R_NO_CONF = 105; + CONF_R_NO_CONF_OR_ENVIRONMENT_VARIABLE = 106; + CONF_R_NO_SECTION = 107; + CONF_R_NO_SUCH_FILE = 114; + CONF_R_NO_VALUE = 108; + CONF_R_NUMBER_TOO_LARGE = 121; + CONF_R_RECURSIVE_DIRECTORY_INCLUDE = 111; + CONF_R_SSL_COMMAND_SECTION_EMPTY = 117; + CONF_R_SSL_COMMAND_SECTION_NOT_FOUND = 118; + CONF_R_SSL_SECTION_EMPTY = 119; + CONF_R_SSL_SECTION_NOT_FOUND = 120; + CONF_R_UNABLE_TO_CREATE_NEW_SECTION = 103; + CONF_R_UNKNOWN_MODULE_NAME = 113; + CONF_R_VARIABLE_EXPANSION_TOO_LONG = 116; + CONF_R_VARIABLE_HAS_NO_VALUE = 104; + + { The EXTERNALSYM directive is ignored by FPC, however, it is used by Delphi as follows: + + The EXTERNALSYM directive prevents the specified Delphi symbol from appearing in header + files generated for C++. } + + {$EXTERNALSYM ERR_load_CONF_strings} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +var + ERR_load_CONF_strings: function : TIdC_INT; cdecl = nil; + +{$ELSE} + function ERR_load_CONF_strings: TIdC_INT cdecl; external CLibCrypto; + +{$ENDIF} + +implementation + + uses + classes, + IdSSLOpenSSLExceptionHandlers, + IdResourceStringsOpenSSL + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + ,IdSSLOpenSSLLoader + {$ENDIF}; + + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +const + ERR_load_CONF_strings_procname = 'ERR_load_CONF_strings'; + + +{$WARN NO_RETVAL OFF} +function ERR_ERR_load_CONF_strings: TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ERR_load_CONF_strings_procname); +end; + + + +{$WARN NO_RETVAL ON} + +procedure Load(const ADllHandle: TIdLibHandle; LibVersion: TIdC_UINT; const AFailed: TStringList); + +var FuncLoadError: boolean; + +begin + ERR_load_CONF_strings := LoadLibFunction(ADllHandle, ERR_load_CONF_strings_procname); + FuncLoadError := not assigned(ERR_load_CONF_strings); + if FuncLoadError then + begin + {$if not defined(ERR_load_CONF_strings_allownil)} + ERR_load_CONF_strings := @ERR_ERR_load_CONF_strings; + {$ifend} + {$if declared(ERR_load_CONF_strings_introduced)} + if LibVersion < ERR_load_CONF_strings_introduced then + begin + {$if declared(FC_ERR_load_CONF_strings)} + ERR_load_CONF_strings := @FC_ERR_load_CONF_strings; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ERR_load_CONF_strings_removed)} + if ERR_load_CONF_strings_removed <= LibVersion then + begin + {$if declared(_ERR_load_CONF_strings)} + ERR_load_CONF_strings := @_ERR_load_CONF_strings; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ERR_load_CONF_strings_allownil)} + if FuncLoadError then + AFailed.Add('ERR_load_CONF_strings'); + {$ifend} + end; + + +end; + +procedure Unload; +begin + ERR_load_CONF_strings := nil; +end; +{$ELSE} +{$ENDIF} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +initialization + Register_SSLLoader(@Load,'LibCrypto'); + Register_SSLUnloader(@Unload); +{$ENDIF} +end. diff --git a/IdOpenSSLHeaders_core.pas b/IdOpenSSLHeaders_core.pas new file mode 100644 index 0000000..882c034 --- /dev/null +++ b/IdOpenSSLHeaders_core.pas @@ -0,0 +1,292 @@ + (* This unit was generated using the script genOpenSSLHdrs.sh from the source file IdOpenSSLHeaders_core.h2pas + It should not be modified directly. All changes should be made to IdOpenSSLHeaders_core.h2pas + and this file regenerated. IdOpenSSLHeaders_core.h2pas is distributed with the full Indy + Distribution. + *) + +{$i IdCompilerDefines.inc} +{$i IdSSLOpenSSLDefines.inc} +{$IFNDEF USE_OPENSSL} + { error Should not compile if USE_OPENSSL is not defined!!!} +{$ENDIF} +{******************************************************************************} +{ } +{ Indy (Internet Direct) - Internet Protocols Simplified } +{ } +{ https://www.indyproject.org/ } +{ https://gitter.im/IndySockets/Indy } +{ } +{******************************************************************************} +{ } +{ This file is part of the Indy (Internet Direct) project, and is offered } +{ under the dual-licensing agreement described on the Indy website. } +{ (https://www.indyproject.org/license/) } +{ } +{ Copyright: } +{ (c) 1993-2020, Chad Z. Hower and the Indy Pit Crew. All rights reserved. } +{ } +{******************************************************************************} +{ } +{ } +{******************************************************************************} +unit IdOpenSSLHeaders_core; + +interface + +uses + IdCTypes, + IdGlobal + {$IFDEF VCL_XE3_OR_ABOVE},System.Types{$ELSE},Types{$ENDIF}; + + +{ + Automatically converted by H2Pas 1.0.0 from core.h + The following command line parameters were used: + core.h +} + +{$IFDEF FPC} +{$PACKRECORDS C} +{$ENDIF} + + { + * Copyright 2019-2023 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + } + {- + * Base types + * ---------- + * + * These are the types that the OpenSSL core and providers have in common + * to communicate data between them. + } + { Opaque handles to be used with core upcall functions from providers } + + + type + ossl_core_handle_st = record end; + OSSL_CORE_HANDLE = ossl_core_handle_st; + POSSL_CORE_HANDLE = ^OSSL_CORE_HANDLE; + openssl_core_ctx_st = record end; + OPENSSL_CORE_CTX = openssl_core_ctx_st; + POPENSSL_CORE_CTX = ^OPENSSL_CORE_CTX; + ossl_core_bio_st = record end; + OSSL_CORE_BIO = ossl_core_bio_st; + POSSL_CORE_BIO = ^OSSL_CORE_BIO; + { + * Dispatch table element. function_id numbers and the functions are defined + * in core_dispatch.h, see macros with 'OSSL_CORE_MAKE_FUNC' in their names. + * + * An array of these is always terminated by function_id == 0 + } + ossl_dispatch_st = record + function_id : TIdC_LONG; + _function: procedure;cdecl; + end; + + OSSL_DISPATCH = ossl_dispatch_st; + POSSL_DISPATCH = ^OSSL_DISPATCH; + + { + * Other items, essentially an int<->pointer map element. + * + * We make this type distinct from OSSL_DISPATCH to ensure that dispatch + * tables remain tables with function pointers only. + * + * This is used whenever we need to pass things like a table of error reason + * codes <-> reason string maps, ... + * + * Usage determines which field works as key if any, rather than field order. + * + * An array of these is always terminated by id == 0 && ptr == NULL + } + ossl_item_st = record + id : dword; + ptr : pointer; + end; + + { + * Type to tie together algorithm names, property definition string and + * the algorithm implementation in the form of a dispatch table. + * + * An array of these is always terminated by algorithm_names == NULL + } + ossl_algorithm_st = record + algorithm_names : PIdAnsiChar; + property_definition : PIdAnsiChar; + implementation_ : ^OSSL_DISPATCH; + algorithm_description : PIdAnsiChar; + end; + + OSSL_ALGORITHM = ossl_algorithm_st; + + { + * Type to pass object data in a uniform way, without exposing the object + * structure. + * + * An array of these is always terminated by key == NULL + } + { the name of the parameter } + { declare what kind of content is in buffer } + { value being passed in or out } + { data size } + { returned content size } + ossl_param_st = record + key : PIdAnsiChar; + data_type : dword; + data : pointer; + data_size : TIdC_SSIZET; + return_size : TIdC_SSIZET; + end; + + OSSL_PARAM = ossl_param_st; + + { Currently supported OSSL_PARAM data types } + { + * OSSL_PARAM_INTEGER and OSSL_PARAM_UNSIGNED_INTEGER + * are arbitrary length and therefore require an arbitrarily sized buffer, + * since they may be used to pass numbers larger than what is natively + * available. + * + * The number must be buffered in native form, i.e. MSB first on B_ENDIAN + * systems and LSB first on L_ENDIAN systems. This means that arbitrary + * native integers can be stored in the buffer, just make sure that the + * buffer size is correct and the buffer itself is properly aligned (for + * example by having the buffer field point at a C integer). + } + + const + OSSL_PARAM_INTEGER = 1; + OSSL_PARAM_UNSIGNED_INTEGER = 2; + {- + * OSSL_PARAM_REAL + * is a C binary floating point values in native form and alignment. + } + OSSL_PARAM_REAL = 3; + {- + * OSSL_PARAM_UTF8_STRING + * is a printable string. It is expected to be printed as it is. + } + OSSL_PARAM_UTF8_STRING = 4; + {- + * OSSL_PARAM_OCTET_STRING + * is a string of bytes with no further specification. It is expected to be + * printed as a hexdump. + } + OSSL_PARAM_OCTET_STRING = 5; + {- + * OSSL_PARAM_UTF8_PTR + * is a pointer to a printable string. It is expected to be printed as it is. + * + * The difference between this and OSSL_PARAM_UTF8_STRING is that only pointers + * are manipulated for this type. + * + * This is more relevant for parameter requests, where the responding + * function doesn't need to copy the data to the provided buffer, but + * sets the provided buffer to point at the actual data instead. + * + * WARNING! Using these is FRAGILE, as it assumes that the actual + * data and its location are constant. + * + * EXTRA WARNING! If you are not completely sure you most likely want + * to use the OSSL_PARAM_UTF8_STRING type. + } + OSSL_PARAM_UTF8_PTR = 6; + {- + * OSSL_PARAM_OCTET_PTR + * is a pointer to a string of bytes with no further specification. It is + * expected to be printed as a hexdump. + * + * The difference between this and OSSL_PARAM_OCTET_STRING is that only pointers + * are manipulated for this type. + * + * This is more relevant for parameter requests, where the responding + * function doesn't need to copy the data to the provided buffer, but + * sets the provided buffer to point at the actual data instead. + * + * WARNING! Using these is FRAGILE, as it assumes that the actual + * data and its location are constant. + * + * EXTRA WARNING! If you are not completely sure you most likely want + * to use the OSSL_PARAM_OCTET_STRING type. + } + OSSL_PARAM_OCTET_PTR = 7; + { + * Typedef for the thread stop handling callback. Used both internally and by + * providers. + * + * Providers may register for notifications about threads stopping by + * registering a callback to hear about such events. Providers register the + * callback using the OSSL_FUNC_CORE_THREAD_START function in the |in| dispatch + * table passed to OSSL_provider_init(). The arg passed back to a provider will + * be the provider side context object. + } + + type + + OSSL_thread_stop_handler_fn = procedure (arg:pointer);cdecl; + {- + * Provider entry point + * -------------------- + * + * This function is expected to be present in any dynamically loadable + * provider module. By definition, if this function doesn't exist in a + * module, that module is not an OpenSSL provider module. + } + {- + * |handle| pointer to opaque type OSSL_CORE_HANDLE. This can be used + * together with some functions passed via |in| to query data. + * |in| is the array of functions that the Core passes to the provider. + * |out| will be the array of base functions that the provider passes + * back to the Core. + * |provctx| a provider side context object, optionally created if the + * provider needs it. This value is passed to other provider + * functions, notably other context constructors. + } + +type + OSSL_provider_init_fn = function (const handle: POSSL_CORE_HANDLE; + const in_: POSSL_DISPATCH; + var out_: POSSL_DISPATCH; + var provctx: pointer): TIdC_INT cdecl; + + + OSSL_provider_init = OSSL_provider_init_fn; + + { + * Generic callback function signature. + * + * The expectation is that any provider function that wants to offer + * a callback / hook can do so by taking an argument with this type, + * as well as a pointer to caller-specific data. When calling the + * callback, the provider function can populate an OSSL_PARAM array + * with data of its choice and pass that in the callback call, along + * with the caller data argument. + * + * libcrypto may use the OSSL_PARAM array to create arguments for an + * application callback it knows about. + } + OSSL_CALLBACK = function(params: array of OSSL_PARAM; arg: pointer): TIdC_INT cdecl; + + OSSL_INOUT_CALLBACK = function(in_params: array of OSSL_PARAM; + out_params: array of OSSL_PARAM; arg: pointer): TIdC_INT cdecl; + + { + * Passphrase callback function signature + * + * This is similar to the generic callback function above, but adds a + * result parameter. + } + OSSL_PASSPHRASE_CALLBACK = function(pass: PIdAnsiChar; pass_size: TIdC_SSIZET; + pass_len: PIdC_SSIZET; + params: array of OSSL_PARAM; arg: pointer): TIdC_INT cdecl; + + +implementation + + +end. diff --git a/IdOpenSSLHeaders_crypto.pas b/IdOpenSSLHeaders_crypto.pas new file mode 100644 index 0000000..96a1f5a --- /dev/null +++ b/IdOpenSSLHeaders_crypto.pas @@ -0,0 +1,4576 @@ + (* This unit was generated using the script genOpenSSLHdrs.sh from the source file IdOpenSSLHeaders_crypto.h2pas + It should not be modified directly. All changes should be made to IdOpenSSLHeaders_crypto.h2pas + and this file regenerated. IdOpenSSLHeaders_crypto.h2pas is distributed with the full Indy + Distribution. + *) + +{$i IdCompilerDefines.inc} +{$i IdSSLOpenSSLDefines.inc} +{$IFNDEF USE_OPENSSL} + { error Should not compile if USE_OPENSSL is not defined!!!} +{$ENDIF} +{******************************************************************************} +{ } +{ Indy (Internet Direct) - Internet Protocols Simplified } +{ } +{ https://www.indyproject.org/ } +{ https://gitter.im/IndySockets/Indy } +{ } +{******************************************************************************} +{ } +{ This file is part of the Indy (Internet Direct) project, and is offered } +{ under the dual-licensing agreement described on the Indy website. } +{ (https://www.indyproject.org/license/) } +{ } +{ Copyright: } +{ (c) 1993-2020, Chad Z. Hower and the Indy Pit Crew. All rights reserved. } +{ } +{******************************************************************************} +{ } +{ } +{******************************************************************************} + +unit IdOpenSSLHeaders_crypto; + +interface + +// Headers for OpenSSL 1.1.1 +// crypto.h + + +uses + IdCTypes, + IdGlobal, + IdSSLOpenSSLConsts, + IdOpenSSLHeaders_bio, + IdOpenSSLHeaders_ossl_typ, + IdOpenSSLHeaders_evp, + IdOpenSSLHeaders_provider, + {$IFDEF VCL_XE3_OR_ABOVE}System.Types{$ELSE}Types{$ENDIF}; + +{$MINENUMSIZE 4} + +const + CRYPTO_MEM_CHECK_OFF = $0; //* Control only */ + CRYPTO_MEM_CHECK_ON = $1; //* Control and mode bit */ + CRYPTO_MEM_CHECK_ENABLE = $2; //* Control and mode bit */ + CRYPTO_MEM_CHECK_DISABLE = $3; //* Control only */ + + CRYPTO_EX_INDEX_SSL = 0; + CRYPTO_EX_INDEX_SSL_CTX = 1; + CRYPTO_EX_INDEX_SSL_SESSION = 2; + CRYPTO_EX_INDEX_X509 = 3; + CRYPTO_EX_INDEX_X509_STORE = 4; + CRYPTO_EX_INDEX_X509_STORE_CTX = 5; + CRYPTO_EX_INDEX_DH = 6; + CRYPTO_EX_INDEX_DSA = 7; + CRYPTO_EX_INDEX_EC_KEY = 8; + CRYPTO_EX_INDEX_RSA = 9; + CRYPTO_EX_INDEX_ENGINE = 10; + CRYPTO_EX_INDEX_UI = 11; + CRYPTO_EX_INDEX_BIO = 12; + CRYPTO_EX_INDEX_APP = 13; + CRYPTO_EX_INDEX_UI_METHOD = 14; + CRYPTO_EX_INDEX_DRBG = 15; + CRYPTO_EX_INDEX__COUNT = 16; + + // Added _CONST to prevent nameclashes + OPENSSL_VERSION_CONST = 0; + OPENSSL_CFLAGS = 1; + OPENSSL_BUILT_ON = 2; + OPENSSL_PLATFORM = 3; + OPENSSL_DIR = 4; + OPENSSL_ENGINES_DIR = 5; + SSLEAY_VERSION_CONST = OPENSSL_VERSION_CONST; + + (* + * These defines where used in combination with the old locking callbacks, + * they are not called anymore, but old code that's not called might still + * use them. + *) + CRYPTO_LOCK = 1; + CRYPTO_UNLOCK = 2; + CRYPTO_READ = 4; + CRYPTO_WRITE = 8; + + (* Standard initialisation options *) + OPENSSL_INIT_NO_LOAD_CRYPTO_STRINGS = TIdC_Long($00000001); + OPENSSL_INIT_LOAD_CRYPTO_STRINGS = TIdC_Long($00000002); + OPENSSL_INIT_ADD_ALL_CIPHERS = TIdC_Long($00000004); + OPENSSL_INIT_ADD_ALL_DIGESTS = TIdC_Long($00000008); + OPENSSL_INIT_NO_ADD_ALL_CIPHERS = TIdC_Long($00000010); + OPENSSL_INIT_NO_ADD_ALL_DIGESTS = TIdC_Long($00000020); + OPENSSL_INIT_LOAD_CONFIG = TIdC_Long($00000040); + OPENSSL_INIT_NO_LOAD_CONFIG = TIdC_Long($00000080); + OPENSSL_INIT_ASYNC = TIdC_Long($00000100); + OPENSSL_INIT_ENGINE_RDRAND = TIdC_Long($00000200); + OPENSSL_INIT_ENGINE_DYNAMIC = TIdC_Long($00000400); + OPENSSL_INIT_ENGINE_OPENSSL = TIdC_Long($00000800); + OPENSSL_INIT_ENGINE_CRYPTODEV = TIdC_Long($00001000); + OPENSSL_INIT_ENGINE_CAPI = TIdC_Long($00002000); + OPENSSL_INIT_ENGINE_PADLOCK = TIdC_Long($00004000); + OPENSSL_INIT_ENGINE_AFALG = TIdC_Long($00008000); + (* OPENSSL_INIT_ZLIB = TIdC_Long($00010000); *) + OPENSSL_INIT_ATFORK = TIdC_Long(00020000); + (* OPENSSL_INIT_BASE_ONLY = TIdC_Long(00040000); *) + OPENSSL_INIT_NO_ATEXIT = TIdC_Long(00080000); + (* OPENSSL_INIT flag range 0xfff00000 reserved for OPENSSL_init_ssl() *) + (* Max OPENSSL_INIT flag value is 0x80000000 *) + + (* openssl and dasync not counted as builtin *) + OPENSSL_INIT_ENGINE_ALL_BUILTIN = OPENSSL_INIT_ENGINE_RDRAND + or OPENSSL_INIT_ENGINE_DYNAMIC or OPENSSL_INIT_ENGINE_CRYPTODEV + or OPENSSL_INIT_ENGINE_CAPI or OPENSSL_INIT_ENGINE_PADLOCK; + + CRYPTO_ONCE_STATIC_INIT = 0; + +type + CRYPTO_THREADID = record {1.0.x only} + ptr : Pointer; + val : TIdC_ULONG; + end; + PCRYPTO_THREADID = ^CRYPTO_THREADID; + CRYPTO_RWLOCK = type Pointer; + PCRYPTO_RWLOCK = ^CRYPTO_RWLOCK; + //crypto_ex_data_st = record + // sk: PStackOfVoid; + //end; + //DEFINE_STACK_OF(void) + + Tthreadid_func = procedure (id : PCRYPTO_THREADID) cdecl; + + + // CRYPTO_EX_new = procedure(parent: Pointer; ptr: Pointer; CRYPTO_EX_DATA *ad; idx: TIdC_INT; argl: TIdC_LONG; argp: Pointer); + // CRYPTO_EX_free = procedure(void *parent, void *ptr, CRYPTO_EX_DATA *ad, + // int idx, long argl, void *argp); + //typedef int CRYPTO_EX_dup (CRYPTO_EX_DATA *to, const CRYPTO_EX_DATA *from, + // void *from_d, int idx, long argl, void *argp); + //__owur int CRYPTO_get_ex_new_index(int class_index, long argl, void *argp, + // CRYPTO_EX_new *new_func, CRYPTO_EX_dup *dup_func, + // CRYPTO_EX_free *free_func); + + CRYPTO_mem_leaks_cb_cb = function(const str: PIdAnsiChar; len: TIdC_SIZET; u: Pointer): TIdC_INT; cdecl; + CRYPTO_THREAD_run_once_init = procedure; cdecl; + + CRYPTO_THREAD_LOCAL = type DWORD; + PCRYPTO_THREAD_LOCAL = ^CRYPTO_THREAD_LOCAL; + CRYPTO_THREAD_ID = type DWORD; + CRYPTO_ONCE = type TIdC_LONG; + PCRYPTO_ONCE = ^CRYPTO_ONCE; + + CRYPTO_set_mem_functions_m = function(size: TIdC_SIZET; const filename: PIdAnsiChar; linenumber: TIdC_INT): Pointer; cdecl; + CRYPTO_set_mem_functions_r = function(buffer: Pointer; size: TIdC_SIZET; const filename: PIdAnsiChar; linenumber: TIdC_INT): Pointer; cdecl; + CRYPTO_set_mem_functions_f = procedure(buffer: Pointer; const filename: PIdAnsiChar; const linenumber: TIdC_INT); cdecl; + TIdSslIdCallback = function: TIdC_ULONG; cdecl; + TIdSslLockingCallback = procedure (mode, n : TIdC_INT; Afile : PIdAnsiChar; line : TIdC_INT); cdecl; + + { The EXTERNALSYM directive is ignored by FPC, however, it is used by Delphi as follows: + + The EXTERNALSYM directive prevents the specified Delphi symbol from appearing in header + files generated for C++. } + + {$EXTERNALSYM CRYPTO_THREAD_lock_new} {introduced 1.1.0} + {$EXTERNALSYM CRYPTO_THREAD_read_lock} {introduced 1.1.0} + {$EXTERNALSYM CRYPTO_THREAD_write_lock} {introduced 1.1.0} + {$EXTERNALSYM CRYPTO_THREAD_unlock} {introduced 1.1.0} + {$EXTERNALSYM CRYPTO_THREAD_lock_free} {introduced 1.1.0} + {$EXTERNALSYM CRYPTO_atomic_add} {introduced 1.1.0} + {$EXTERNALSYM OPENSSL_strlcpy} {introduced 1.1.0} + {$EXTERNALSYM OPENSSL_strlcat} {introduced 1.1.0} + {$EXTERNALSYM OPENSSL_strnlen} {introduced 1.1.0} + {$EXTERNALSYM OPENSSL_buf2hexstr} {introduced 1.1.0} + {$EXTERNALSYM OPENSSL_hexstr2buf} {introduced 1.1.0} + {$EXTERNALSYM OPENSSL_hexchar2int} {introduced 1.1.0} + {$EXTERNALSYM OpenSSL_version_num} {introduced 1.1.0} + {$EXTERNALSYM OpenSSL_version} {introduced 1.1.0} + {$EXTERNALSYM OPENSSL_issetugid} + {$EXTERNALSYM CRYPTO_new_ex_data} + {$EXTERNALSYM CRYPTO_dup_ex_data} + {$EXTERNALSYM CRYPTO_free_ex_data} + {$EXTERNALSYM CRYPTO_set_ex_data} + {$EXTERNALSYM CRYPTO_get_ex_data} + {$EXTERNALSYM CRYPTO_set_mem_functions} + {$EXTERNALSYM CRYPTO_malloc} + {$EXTERNALSYM CRYPTO_zalloc} {introduced 1.1.0} + {$EXTERNALSYM CRYPTO_memdup} {introduced 1.1.0} + {$EXTERNALSYM CRYPTO_strdup} + {$EXTERNALSYM CRYPTO_strndup} {introduced 1.1.0} + {$EXTERNALSYM CRYPTO_free} + {$EXTERNALSYM CRYPTO_clear_free} {introduced 1.1.0} + {$EXTERNALSYM CRYPTO_realloc} + {$EXTERNALSYM CRYPTO_clear_realloc} {introduced 1.1.0} + {$EXTERNALSYM CRYPTO_secure_malloc_init} {introduced 1.1.0} + {$EXTERNALSYM CRYPTO_secure_malloc_done} {introduced 1.1.0} + {$EXTERNALSYM CRYPTO_secure_malloc} {introduced 1.1.0} + {$EXTERNALSYM CRYPTO_secure_zalloc} {introduced 1.1.0} + {$EXTERNALSYM CRYPTO_secure_free} {introduced 1.1.0} + {$EXTERNALSYM CRYPTO_secure_clear_free} {introduced 1.1.0} + {$EXTERNALSYM CRYPTO_secure_allocated} {introduced 1.1.0} + {$EXTERNALSYM CRYPTO_secure_malloc_initialized} {introduced 1.1.0} + {$EXTERNALSYM CRYPTO_secure_actual_size} {introduced 1.1.0} + {$EXTERNALSYM CRYPTO_secure_used} {introduced 1.1.0} + {$EXTERNALSYM OPENSSL_cleanse} + {$EXTERNALSYM OPENSSL_isservice} + {$EXTERNALSYM OPENSSL_init} + {$EXTERNALSYM CRYPTO_memcmp} + {$EXTERNALSYM OPENSSL_cleanup} {introduced 1.1.0} + {$EXTERNALSYM OPENSSL_init_crypto} {introduced 1.1.0} + {$EXTERNALSYM OPENSSL_thread_stop} {introduced 1.1.0} + {$EXTERNALSYM OPENSSL_INIT_new} {introduced 1.1.0} + {$EXTERNALSYM OPENSSL_INIT_free} {introduced 1.1.0} + {$EXTERNALSYM CRYPTO_THREAD_run_once} {introduced 1.1.0} + {$EXTERNALSYM CRYPTO_THREAD_get_local} {introduced 1.1.0} + {$EXTERNALSYM CRYPTO_THREAD_set_local} {introduced 1.1.0} + {$EXTERNALSYM CRYPTO_THREAD_cleanup_local} {introduced 1.1.0} + {$EXTERNALSYM CRYPTO_THREAD_get_current_id} {introduced 1.1.0} + {$EXTERNALSYM CRYPTO_THREAD_compare_id} {introduced 1.1.0} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +var + {$EXTERNALSYM OPENSSL_malloc} {removed 1.0.0} + {$EXTERNALSYM OPENSSL_zalloc} {removed 1.0.0} + {$EXTERNALSYM OPENSSL_realloc} {removed 1.0.0} + {$EXTERNALSYM OPENSSL_clear_realloc} {removed 1.0.0} + {$EXTERNALSYM OPENSSL_clear_free} {removed 1.0.0} + {$EXTERNALSYM OPENSSL_free} {removed 1.0.0} + {$EXTERNALSYM OPENSSL_memdup} {removed 1.0.0} + {$EXTERNALSYM OPENSSL_strdup} {removed 1.0.0} + {$EXTERNALSYM OPENSSL_strndup} {removed 1.0.0} + {$EXTERNALSYM OPENSSL_secure_malloc} {removed 1.0.0} + {$EXTERNALSYM OPENSSL_secure_zalloc} {removed 1.0.0} + {$EXTERNALSYM OPENSSL_secure_free} {removed 1.0.0} + {$EXTERNALSYM OPENSSL_secure_clear_free} {removed 1.0.0} + {$EXTERNALSYM OPENSSL_secure_actual_size} {removed 1.0.0} + {$EXTERNALSYM CRYPTO_mem_ctrl} {removed 3.0.0} + {$EXTERNALSYM CRYPTO_num_locks} {removed 1.1.0} + {$EXTERNALSYM CRYPTO_set_locking_callback} {removed 1.1.0} + {$EXTERNALSYM CRYPTO_THREADID_set_numeric} {removed 1.1.0} + {$EXTERNALSYM CRYPTO_THREADID_set_callback} {removed 1.1.0} + {$EXTERNALSYM CRYPTO_set_id_callback} {removed 1.1.0} + {$EXTERNALSYM CRYPTO_set_mem_debug} {introduced 1.1.0 removed 3.0.0} + {$EXTERNALSYM FIPS_mode} {removed 3.0.0} + {$EXTERNALSYM FIPS_mode_set} {removed 3.0.0} + {$EXTERNALSYM SSLeay_version} {removed 1.1.0} + {$EXTERNALSYM SSLeay} {removed 1.1.0} + OPENSSL_malloc: function (num: TIdC_SIZET): Pointer; cdecl = nil; {removed 1.0.0} + OPENSSL_zalloc: function (num: TIdC_SIZET): Pointer; cdecl = nil; {removed 1.0.0} + OPENSSL_realloc: function (addr: Pointer; num: TIdC_SIZET): Pointer; cdecl = nil; {removed 1.0.0} + OPENSSL_clear_realloc: function (addr: Pointer; old_num: TIdC_SIZET; num: TIdC_SIZET): Pointer; cdecl = nil; {removed 1.0.0} + OPENSSL_clear_free: procedure (addr: Pointer; num: TIdC_SIZET); cdecl = nil; {removed 1.0.0} + OPENSSL_free: procedure (addr: Pointer); cdecl = nil; {removed 1.0.0} + OPENSSL_memdup: function (const str: Pointer; s: TIdC_SIZET): Pointer; cdecl = nil; {removed 1.0.0} + OPENSSL_strdup: function (const str: PIdAnsiChar): PIdAnsiChar; cdecl = nil; {removed 1.0.0} + OPENSSL_strndup: function (const str: PIdAnsiChar; n: TIdC_SIZET): PIdAnsiChar; cdecl = nil; {removed 1.0.0} + OPENSSL_secure_malloc: function (num: TIdC_SIZET): Pointer; cdecl = nil; {removed 1.0.0} + OPENSSL_secure_zalloc: function (num: TIdC_SIZET): Pointer; cdecl = nil; {removed 1.0.0} + OPENSSL_secure_free: procedure (addr: Pointer); cdecl = nil; {removed 1.0.0} + OPENSSL_secure_clear_free: procedure (addr: Pointer; num: TIdC_SIZET); cdecl = nil; {removed 1.0.0} + OPENSSL_secure_actual_size: function (ptr: Pointer): TIdC_SIZET; cdecl = nil; {removed 1.0.0} + + CRYPTO_THREAD_lock_new: function : PCRYPTO_RWLOCK; cdecl = nil; {introduced 1.1.0} + CRYPTO_THREAD_read_lock: function (lock: PCRYPTO_RWLOCK): TIdC_INT; cdecl = nil; {introduced 1.1.0} + CRYPTO_THREAD_write_lock: function (lock: PCRYPTO_RWLOCK): TIdC_INT; cdecl = nil; {introduced 1.1.0} + CRYPTO_THREAD_unlock: function (lock: PCRYPTO_RWLOCK): TIdC_INT; cdecl = nil; {introduced 1.1.0} + CRYPTO_THREAD_lock_free: procedure (lock: PCRYPTO_RWLOCK); cdecl = nil; {introduced 1.1.0} + + CRYPTO_atomic_add: function (val: PIdC_INT; amount: TIdC_INT; ret: PIdC_INT; lock: PCRYPTO_RWLOCK): TIdC_INT; cdecl = nil; {introduced 1.1.0} + + CRYPTO_mem_ctrl: function (mode: TIdC_INT): TIdC_INT; cdecl = nil; {removed 3.0.0} + + OPENSSL_strlcpy: function (dst: PIdAnsiChar; const src: PIdAnsiChar; siz: TIdC_SIZET): TIdC_SIZET; cdecl = nil; {introduced 1.1.0} + OPENSSL_strlcat: function (dst: PIdAnsiChar; const src: PIdAnsiChar; siz: TIdC_SIZET): TIdC_SIZET; cdecl = nil; {introduced 1.1.0} + OPENSSL_strnlen: function (const str: PIdAnsiChar; maxlen: TIdC_SIZET): TIdC_SIZET; cdecl = nil; {introduced 1.1.0} + OPENSSL_buf2hexstr: function (const buffer: PByte; len: TIdC_LONG): PIdAnsiChar; cdecl = nil; {introduced 1.1.0} + OPENSSL_hexstr2buf: function (const str: PIdAnsiChar; len: PIdC_LONG): PByte; cdecl = nil; {introduced 1.1.0} + OPENSSL_hexchar2int: function (c: Byte): TIdC_INT; cdecl = nil; {introduced 1.1.0} + + // # define OPENSSL_MALLOC_MAX_NELEMS(type) (((1U<<(sizeof(int)*8-1))-1)/sizeof(type)) + + OpenSSL_version_num: function : TIdC_ULONG; cdecl = nil; {introduced 1.1.0} + OpenSSL_version: function (type_: TIdC_INT): PIdAnsiChar; cdecl = nil; {introduced 1.1.0} + + OPENSSL_issetugid: function : TIdC_INT; cdecl = nil; + + (* No longer use an index. *) + //function CRYPTO_free_ex_index(class_index: TIdC_INT; idx: TIdC_INT): TIdC_INT; + + (* + * Initialise/duplicate/free CRYPTO_EX_DATA variables corresponding to a + * given class (invokes whatever per-class callbacks are applicable) + *) + CRYPTO_new_ex_data: function (class_index: TIdC_INT; obj: Pointer; ad: PCRYPTO_EX_DATA): TIdC_INT; cdecl = nil; + CRYPTO_dup_ex_data: function (class_index: TIdC_INT; to_: PCRYPTO_EX_DATA; const from: PCRYPTO_EX_DATA): TIdC_INT; cdecl = nil; + + CRYPTO_free_ex_data: procedure (class_index: TIdC_INT; obj: Pointer; ad: PCRYPTO_EX_DATA); cdecl = nil; + + (* + * Get/set data in a CRYPTO_EX_DATA variable corresponding to a particular + * index (relative to the class type involved) + *) + CRYPTO_set_ex_data: function (ad: PCRYPTO_EX_DATA; idx: TIdC_INT; val: Pointer): TIdC_INT; cdecl = nil; + CRYPTO_get_ex_data: function (const ad: PCRYPTO_EX_DATA; idx: TIdC_INT): Pointer; cdecl = nil; + + ///* + // * The old locking functions have been removed completely without compatibility + // * macros. This is because the old functions either could not properly report + // * errors, or the returned error values were not clearly documented. + // * Replacing the locking functions with no-ops would cause race condition + // * issues in the affected applications. It is far better for them to fail at + // * compile time. + // * On the other hand, the locking callbacks are no longer used. Consequently, + // * the callback management functions can be safely replaced with no-op macros. + // */ + //# define CRYPTO_num_locks() (1) + CRYPTO_num_locks: function : TIdC_INT; cdecl = nil; {removed 1.1.0} + //# define CRYPTO_set_locking_callback(func) + //# define CRYPTO_get_locking_callback() (NULL) + //# define CRYPTO_set_add_lock_callback(func) + //# define CRYPTO_get_add_lock_callback() (NULL) + CRYPTO_set_locking_callback: procedure (func: TIdSslLockingCallback); cdecl = nil; {removed 1.1.0} + + ///* Only use CRYPTO_THREADID_set_[numeric|pointer]() within callbacks */ + //# define CRYPTO_THREADID_set_numeric(id, val) + CRYPTO_THREADID_set_numeric: procedure (id : PCRYPTO_THREADID; val: TIdC_ULONG); cdecl = nil; {removed 1.1.0} + //# define CRYPTO_THREADID_set_pointer(id, ptr) + //# define CRYPTO_THREADID_set_callback(threadid_func) (0) + CRYPTO_THREADID_set_callback: procedure (threadid_func: Tthreadid_func); cdecl = nil; {removed 1.1.0} + //# define CRYPTO_THREADID_get_callback() (NULL) + //# define CRYPTO_THREADID_current(id) + //# define CRYPTO_THREADID_cmp(a, b) (-1) + //# define CRYPTO_THREADID_cpy(dest, src) + //# define CRYPTO_THREADID_hash(id) (0UL) + + CRYPTO_set_id_callback: procedure (func: TIdSslIdCallback); cdecl = nil; {removed 1.1.0} + // + //# define CRYPTO_set_dynlock_create_callback(dyn_create_function) + //# define CRYPTO_set_dynlock_lock_callback(dyn_lock_function) + //# define CRYPTO_set_dynlock_destroy_callback(dyn_destroy_function) + //# define CRYPTO_get_dynlock_create_callback() (NULL) + //# define CRYPTO_get_dynlock_lock_callback() (NULL) + //# define CRYPTO_get_dynlock_destroy_callback() (NULL) + //# endif /* OPENSSL_API_COMPAT < 0x10100000L */ + + CRYPTO_set_mem_functions: function (m: CRYPTO_set_mem_functions_m; r: CRYPTO_set_mem_functions_r; f: CRYPTO_set_mem_functions_f): TIdC_INT; cdecl = nil; + CRYPTO_set_mem_debug: function (flag: TIdC_INT): TIdC_INT; cdecl = nil; {introduced 1.1.0 removed 3.0.0} + //void CRYPTO_get_mem_functions( + // void *(**m) (TIdC_SIZET, const char *, int), + // void *(**r) (void *, TIdC_SIZET, const char *, int), + // void (**f) (void *, const char *, int)); + + CRYPTO_malloc: function (num: TIdC_SIZET; const file_: PIdAnsiChar; line: TIdC_INT): Pointer; cdecl = nil; + CRYPTO_zalloc: function (num: TIdC_SIZET; const file_: PIdAnsiChar; line: TIdC_INT): Pointer; cdecl = nil; {introduced 1.1.0} + CRYPTO_memdup: function (const str: Pointer; siz: TIdC_SIZET; const file_: PIdAnsiChar; line: TIdC_INT): Pointer; cdecl = nil; {introduced 1.1.0} + CRYPTO_strdup: function (const str: PIdAnsiChar; const file_: PIdAnsiChar; line: TIdC_INT): PIdAnsiChar; cdecl = nil; + CRYPTO_strndup: function (const str: PIdAnsiChar; s: TIdC_SIZET; const file_: PIdAnsiChar; line: TIdC_INT): PIdAnsiChar; cdecl = nil; {introduced 1.1.0} + CRYPTO_free: procedure (ptr: Pointer; const file_: PIdAnsiChar; line: TIdC_INT); cdecl = nil; + CRYPTO_clear_free: procedure (ptr: Pointer; num: TIdC_SIZET; const file_: PIdAnsiChar; line: TIdC_INT); cdecl = nil; {introduced 1.1.0} + CRYPTO_realloc: function (addr: Pointer; num: TIdC_SIZET; const file_: PIdAnsiChar; line: TIdC_INT): Pointer; cdecl = nil; + CRYPTO_clear_realloc: function (addr: Pointer; old_num: TIdC_SIZET; num: TIdC_SIZET; const file_: PIdAnsiChar; line: TIdC_INT): Pointer; cdecl = nil; {introduced 1.1.0} + + CRYPTO_secure_malloc_init: function (sz: TIdC_SIZET; minsize: TIdC_INT): TIdC_INT; cdecl = nil; {introduced 1.1.0} + CRYPTO_secure_malloc_done: function : TIdC_INT; cdecl = nil; {introduced 1.1.0} + CRYPTO_secure_malloc: function (num: TIdC_SIZET; const file_: PIdAnsiChar; line: TIdC_INT): Pointer; cdecl = nil; {introduced 1.1.0} + CRYPTO_secure_zalloc: function (num: TIdC_SIZET; const file_: PIdAnsiChar; line: TIdC_INT): Pointer; cdecl = nil; {introduced 1.1.0} + CRYPTO_secure_free: procedure (ptr: Pointer; const file_: PIdAnsiChar; line: TIdC_INT); cdecl = nil; {introduced 1.1.0} + CRYPTO_secure_clear_free: procedure (ptr: Pointer; num: TIdC_SIZET; const file_: PIdAnsiChar; line: TIdC_INT); cdecl = nil; {introduced 1.1.0} + CRYPTO_secure_allocated: function (const ptr: Pointer): TIdC_INT; cdecl = nil; {introduced 1.1.0} + CRYPTO_secure_malloc_initialized: function : TIdC_INT; cdecl = nil; {introduced 1.1.0} + CRYPTO_secure_actual_size: function (ptr: Pointer): TIdC_SIZET; cdecl = nil; {introduced 1.1.0} + CRYPTO_secure_used: function : TIdC_SIZET; cdecl = nil; {introduced 1.1.0} + + OPENSSL_cleanse: procedure (ptr: Pointer; len: TIdC_SIZET); cdecl = nil; + + (* debug libraries only *) +// function CRYPTO_mem_debug_push(const info: PIdAnsiChar; const file_: PIdAnsiChar; line: TIdC_INT): TIdC_INT; +// function CRYPTO_mem_debug_pop: TIdC_INT; +// procedure CRYPTO_get_alloc_counts(mcount: PIdC_INT; rcount: PIdC_INT; fcount: PIdC_INT); + + (* + * Debugging functions (enabled by CRYPTO_set_mem_debug(1)) + * The flag argument has the following significance: + * 0: called before the actual memory allocation has taken place + * 1: called after the actual memory allocation has taken place + *) + +// procedure CRYPTO_mem_debug_malloc(addr: Pointer; num: TIdC_SIZET; flag: TIdC_INT; const file_: PIdAnsiChar; line: TIdC_INT); +// procedure CRYPTO_mem_debug_realloc(addr1: Pointer; addr2: Pointer; num: TIdC_SIZET; flag: TIdC_INT; const file_: PIdAnsiChar; line: TIdC_INT); +// procedure CRYPTO_mem_debug_free(addr: Pointer; flag: TIdC_INT; const file_: PIdAnsiChar; line: TIdC_INT); + +// function CRYPTO_mem_leaks_cb(cb: CRYPTO_mem_leaks_cb_cb; u: Pointer): TIdC_INT; + +// function CRYPTO_mem_leaks_fp(&FILE: Pointer): TIdC_INT; +// function CRYPTO_mem_leaks(BIO: PBIO): TIdC_INT; + + //* die if we have to */ + //ossl_noreturn void OPENSSL_die(const char *assertion, const char *file, int line); + + //# define OPENSSL_assert(e) \ + // (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1)) + + OPENSSL_isservice: function : TIdC_INT; cdecl = nil; + + FIPS_mode: function : TIdC_INT; cdecl = nil; {removed 3.0.0} + FIPS_mode_set: function (r: TIdC_INT): TIdC_INT; cdecl = nil; {removed 3.0.0} + + OPENSSL_init: procedure ; cdecl = nil; + + // struct tm *OPENSSL_gmtime(const TIdC_TIMET *timer, struct tm *result); + + //function OPENSSL_gmtime_adj(struct tm *tm, int offset_day, long offset_sec): TIdC_INT; + //function OPENSSL_gmtime_diff(int *pday, int *psec, const struct tm *from, const struct tm *to): TIdC_INT; + + (* + * CRYPTO_memcmp returns zero iff the |len| bytes at |a| and |b| are equal. + * It takes an amount of time dependent on |len|, but independent of the + * contents of |a| and |b|. Unlike memcmp, it cannot be used to put elements + * into a defined order as the return value when a != b is undefined, other + * than to be non-zero. + *) + CRYPTO_memcmp: function (const in_a: Pointer; const in_b: Pointer; len: TIdC_SIZET): TIdC_INT; cdecl = nil; + + (* Library initialisation functions *) + OPENSSL_cleanup: procedure ; cdecl = nil; {introduced 1.1.0} + OPENSSL_init_crypto: function (opts: TIdC_UINT64; const settings: POPENSSL_INIT_SETTINGS): TIdC_INT; cdecl = nil; {introduced 1.1.0} + // int OPENSSL_atexit(void (*handler)(void)); + OPENSSL_thread_stop: procedure ; cdecl = nil; {introduced 1.1.0} + + (* Low-level control of initialization *) + OPENSSL_INIT_new: function : POPENSSL_INIT_SETTINGS; cdecl = nil; {introduced 1.1.0} + //int OPENSSL_INIT_set_config_filename(OPENSSL_INIT_SETTINGS *settings, + // const char *config_filename); + //void OPENSSL_INIT_set_config_file_flags(OPENSSL_INIT_SETTINGS *settings, + // unsigned long flags); + //int OPENSSL_INIT_set_config_appname(OPENSSL_INIT_SETTINGS *settings, + // const char *config_appname); + OPENSSL_INIT_free: procedure (settings: POPENSSL_INIT_SETTINGS); cdecl = nil; {introduced 1.1.0} + + CRYPTO_THREAD_run_once: function (once: PCRYPTO_ONCE; init: CRYPTO_THREAD_run_once_init): TIdC_INT; cdecl = nil; {introduced 1.1.0} + + //type + // CRYPTO_THREAD_init_local_cleanup = procedure(v1: Pointer); + // + //function CRYPTO_THREAD_init_local(key: PCRYPTO_THREAD_LOCAL; cleanup: CRYPTO_THREAD_init_local_cleanup): TIdC_INT; + CRYPTO_THREAD_get_local: function (key: PCRYPTO_THREAD_LOCAL): Pointer; cdecl = nil; {introduced 1.1.0} + CRYPTO_THREAD_set_local: function (key: PCRYPTO_THREAD_LOCAL; val: Pointer): TIdC_INT; cdecl = nil; {introduced 1.1.0} + CRYPTO_THREAD_cleanup_local: function (key: PCRYPTO_THREAD_LOCAL): TidC_INT; cdecl = nil; {introduced 1.1.0} + + CRYPTO_THREAD_get_current_id: function : CRYPTO_THREAD_ID; cdecl = nil; {introduced 1.1.0} + CRYPTO_THREAD_compare_id: function (a: CRYPTO_THREAD_ID; b: CRYPTO_THREAD_ID): TIdC_INT; cdecl = nil; {introduced 1.1.0} + + SSLeay_version: function (type_ : TIdC_INT) : PIdAnsiChar; cdecl = nil; {removed 1.1.0} + SSLeay: function : TIdC_ULONG; cdecl = nil; {removed 1.1.0} + +{$ELSE} + + function CRYPTO_THREAD_lock_new: PCRYPTO_RWLOCK cdecl; external CLibCrypto; {introduced 1.1.0} + function CRYPTO_THREAD_read_lock(lock: PCRYPTO_RWLOCK): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function CRYPTO_THREAD_write_lock(lock: PCRYPTO_RWLOCK): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function CRYPTO_THREAD_unlock(lock: PCRYPTO_RWLOCK): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + procedure CRYPTO_THREAD_lock_free(lock: PCRYPTO_RWLOCK) cdecl; external CLibCrypto; {introduced 1.1.0} + + function CRYPTO_atomic_add(val: PIdC_INT; amount: TIdC_INT; ret: PIdC_INT; lock: PCRYPTO_RWLOCK): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + + + function OPENSSL_strlcpy(dst: PIdAnsiChar; const src: PIdAnsiChar; siz: TIdC_SIZET): TIdC_SIZET cdecl; external CLibCrypto; {introduced 1.1.0} + function OPENSSL_strlcat(dst: PIdAnsiChar; const src: PIdAnsiChar; siz: TIdC_SIZET): TIdC_SIZET cdecl; external CLibCrypto; {introduced 1.1.0} + function OPENSSL_strnlen(const str: PIdAnsiChar; maxlen: TIdC_SIZET): TIdC_SIZET cdecl; external CLibCrypto; {introduced 1.1.0} + function OPENSSL_buf2hexstr(const buffer: PByte; len: TIdC_LONG): PIdAnsiChar cdecl; external CLibCrypto; {introduced 1.1.0} + function OPENSSL_hexstr2buf(const str: PIdAnsiChar; len: PIdC_LONG): PByte cdecl; external CLibCrypto; {introduced 1.1.0} + function OPENSSL_hexchar2int(c: Byte): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + + // # define OPENSSL_MALLOC_MAX_NELEMS(type) (((1U<<(sizeof(int)*8-1))-1)/sizeof(type)) + + function OpenSSL_version_num: TIdC_ULONG cdecl; external CLibCrypto; {introduced 1.1.0} + function OpenSSL_version(type_: TIdC_INT): PIdAnsiChar cdecl; external CLibCrypto; {introduced 1.1.0} + + function OPENSSL_issetugid: TIdC_INT cdecl; external CLibCrypto; + + (* No longer use an index. *) + //function CRYPTO_free_ex_index(class_index: TIdC_INT; idx: TIdC_INT): TIdC_INT; + + (* + * Initialise/duplicate/free CRYPTO_EX_DATA variables corresponding to a + * given class (invokes whatever per-class callbacks are applicable) + *) + function CRYPTO_new_ex_data(class_index: TIdC_INT; obj: Pointer; ad: PCRYPTO_EX_DATA): TIdC_INT cdecl; external CLibCrypto; + function CRYPTO_dup_ex_data(class_index: TIdC_INT; to_: PCRYPTO_EX_DATA; const from: PCRYPTO_EX_DATA): TIdC_INT cdecl; external CLibCrypto; + + procedure CRYPTO_free_ex_data(class_index: TIdC_INT; obj: Pointer; ad: PCRYPTO_EX_DATA) cdecl; external CLibCrypto; + + (* + * Get/set data in a CRYPTO_EX_DATA variable corresponding to a particular + * index (relative to the class type involved) + *) + function CRYPTO_set_ex_data(ad: PCRYPTO_EX_DATA; idx: TIdC_INT; val: Pointer): TIdC_INT cdecl; external CLibCrypto; + function CRYPTO_get_ex_data(const ad: PCRYPTO_EX_DATA; idx: TIdC_INT): Pointer cdecl; external CLibCrypto; + + ///* + // * The old locking functions have been removed completely without compatibility + // * macros. This is because the old functions either could not properly report + // * errors, or the returned error values were not clearly documented. + // * Replacing the locking functions with no-ops would cause race condition + // * issues in the affected applications. It is far better for them to fail at + // * compile time. + // * On the other hand, the locking callbacks are no longer used. Consequently, + // * the callback management functions can be safely replaced with no-op macros. + // */ + //# define CRYPTO_num_locks() (1) + //# define CRYPTO_set_locking_callback(func) + //# define CRYPTO_get_locking_callback() (NULL) + //# define CRYPTO_set_add_lock_callback(func) + //# define CRYPTO_get_add_lock_callback() (NULL) + + ///* Only use CRYPTO_THREADID_set_[numeric|pointer]() within callbacks */ + //# define CRYPTO_THREADID_set_numeric(id, val) + //# define CRYPTO_THREADID_set_pointer(id, ptr) + //# define CRYPTO_THREADID_set_callback(threadid_func) (0) + //# define CRYPTO_THREADID_get_callback() (NULL) + //# define CRYPTO_THREADID_current(id) + //# define CRYPTO_THREADID_cmp(a, b) (-1) + //# define CRYPTO_THREADID_cpy(dest, src) + //# define CRYPTO_THREADID_hash(id) (0UL) + + // + //# define CRYPTO_set_dynlock_create_callback(dyn_create_function) + //# define CRYPTO_set_dynlock_lock_callback(dyn_lock_function) + //# define CRYPTO_set_dynlock_destroy_callback(dyn_destroy_function) + //# define CRYPTO_get_dynlock_create_callback() (NULL) + //# define CRYPTO_get_dynlock_lock_callback() (NULL) + //# define CRYPTO_get_dynlock_destroy_callback() (NULL) + //# endif /* OPENSSL_API_COMPAT < 0x10100000L */ + + function CRYPTO_set_mem_functions(m: CRYPTO_set_mem_functions_m; r: CRYPTO_set_mem_functions_r; f: CRYPTO_set_mem_functions_f): TIdC_INT cdecl; external CLibCrypto; + //void CRYPTO_get_mem_functions( + // void *(**m) (TIdC_SIZET, const char *, int), + // void *(**r) (void *, TIdC_SIZET, const char *, int), + // void (**f) (void *, const char *, int)); + + function CRYPTO_malloc(num: TIdC_SIZET; const file_: PIdAnsiChar; line: TIdC_INT): Pointer cdecl; external CLibCrypto; + function CRYPTO_zalloc(num: TIdC_SIZET; const file_: PIdAnsiChar; line: TIdC_INT): Pointer cdecl; external CLibCrypto; {introduced 1.1.0} + function CRYPTO_memdup(const str: Pointer; siz: TIdC_SIZET; const file_: PIdAnsiChar; line: TIdC_INT): Pointer cdecl; external CLibCrypto; {introduced 1.1.0} + function CRYPTO_strdup(const str: PIdAnsiChar; const file_: PIdAnsiChar; line: TIdC_INT): PIdAnsiChar cdecl; external CLibCrypto; + function CRYPTO_strndup(const str: PIdAnsiChar; s: TIdC_SIZET; const file_: PIdAnsiChar; line: TIdC_INT): PIdAnsiChar cdecl; external CLibCrypto; {introduced 1.1.0} + procedure CRYPTO_free(ptr: Pointer; const file_: PIdAnsiChar; line: TIdC_INT) cdecl; external CLibCrypto; + procedure CRYPTO_clear_free(ptr: Pointer; num: TIdC_SIZET; const file_: PIdAnsiChar; line: TIdC_INT) cdecl; external CLibCrypto; {introduced 1.1.0} + function CRYPTO_realloc(addr: Pointer; num: TIdC_SIZET; const file_: PIdAnsiChar; line: TIdC_INT): Pointer cdecl; external CLibCrypto; + function CRYPTO_clear_realloc(addr: Pointer; old_num: TIdC_SIZET; num: TIdC_SIZET; const file_: PIdAnsiChar; line: TIdC_INT): Pointer cdecl; external CLibCrypto; {introduced 1.1.0} + + function CRYPTO_secure_malloc_init(sz: TIdC_SIZET; minsize: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function CRYPTO_secure_malloc_done: TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function CRYPTO_secure_malloc(num: TIdC_SIZET; const file_: PIdAnsiChar; line: TIdC_INT): Pointer cdecl; external CLibCrypto; {introduced 1.1.0} + function CRYPTO_secure_zalloc(num: TIdC_SIZET; const file_: PIdAnsiChar; line: TIdC_INT): Pointer cdecl; external CLibCrypto; {introduced 1.1.0} + procedure CRYPTO_secure_free(ptr: Pointer; const file_: PIdAnsiChar; line: TIdC_INT) cdecl; external CLibCrypto; {introduced 1.1.0} + procedure CRYPTO_secure_clear_free(ptr: Pointer; num: TIdC_SIZET; const file_: PIdAnsiChar; line: TIdC_INT) cdecl; external CLibCrypto; {introduced 1.1.0} + function CRYPTO_secure_allocated(const ptr: Pointer): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function CRYPTO_secure_malloc_initialized: TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function CRYPTO_secure_actual_size(ptr: Pointer): TIdC_SIZET cdecl; external CLibCrypto; {introduced 1.1.0} + function CRYPTO_secure_used: TIdC_SIZET cdecl; external CLibCrypto; {introduced 1.1.0} + + procedure OPENSSL_cleanse(ptr: Pointer; len: TIdC_SIZET) cdecl; external CLibCrypto; + + (* debug libraries only *) +// function CRYPTO_mem_debug_push(const info: PIdAnsiChar; const file_: PIdAnsiChar; line: TIdC_INT): TIdC_INT; +// function CRYPTO_mem_debug_pop: TIdC_INT; +// procedure CRYPTO_get_alloc_counts(mcount: PIdC_INT; rcount: PIdC_INT; fcount: PIdC_INT); + + (* + * Debugging functions (enabled by CRYPTO_set_mem_debug(1)) + * The flag argument has the following significance: + * 0: called before the actual memory allocation has taken place + * 1: called after the actual memory allocation has taken place + *) + +// procedure CRYPTO_mem_debug_malloc(addr: Pointer; num: TIdC_SIZET; flag: TIdC_INT; const file_: PIdAnsiChar; line: TIdC_INT); +// procedure CRYPTO_mem_debug_realloc(addr1: Pointer; addr2: Pointer; num: TIdC_SIZET; flag: TIdC_INT; const file_: PIdAnsiChar; line: TIdC_INT); +// procedure CRYPTO_mem_debug_free(addr: Pointer; flag: TIdC_INT; const file_: PIdAnsiChar; line: TIdC_INT); + +// function CRYPTO_mem_leaks_cb(cb: CRYPTO_mem_leaks_cb_cb; u: Pointer): TIdC_INT; + +// function CRYPTO_mem_leaks_fp(&FILE: Pointer): TIdC_INT; +// function CRYPTO_mem_leaks(BIO: PBIO): TIdC_INT; + + //* die if we have to */ + //ossl_noreturn void OPENSSL_die(const char *assertion, const char *file, int line); + + //# define OPENSSL_assert(e) \ + // (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1)) + + function OPENSSL_isservice: TIdC_INT cdecl; external CLibCrypto; + + + procedure OPENSSL_init cdecl; external CLibCrypto; + + // struct tm *OPENSSL_gmtime(const TIdC_TIMET *timer, struct tm *result); + + //function OPENSSL_gmtime_adj(struct tm *tm, int offset_day, long offset_sec): TIdC_INT; + //function OPENSSL_gmtime_diff(int *pday, int *psec, const struct tm *from, const struct tm *to): TIdC_INT; + + (* + * CRYPTO_memcmp returns zero iff the |len| bytes at |a| and |b| are equal. + * It takes an amount of time dependent on |len|, but independent of the + * contents of |a| and |b|. Unlike memcmp, it cannot be used to put elements + * into a defined order as the return value when a != b is undefined, other + * than to be non-zero. + *) + function CRYPTO_memcmp(const in_a: Pointer; const in_b: Pointer; len: TIdC_SIZET): TIdC_INT cdecl; external CLibCrypto; + + (* Library initialisation functions *) + procedure OPENSSL_cleanup cdecl; external CLibCrypto; {introduced 1.1.0} + function OPENSSL_init_crypto(opts: TIdC_UINT64; const settings: POPENSSL_INIT_SETTINGS): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + // int OPENSSL_atexit(void (*handler)(void)); + procedure OPENSSL_thread_stop cdecl; external CLibCrypto; {introduced 1.1.0} + + (* Low-level control of initialization *) + function OPENSSL_INIT_new: POPENSSL_INIT_SETTINGS cdecl; external CLibCrypto; {introduced 1.1.0} + //int OPENSSL_INIT_set_config_filename(OPENSSL_INIT_SETTINGS *settings, + // const char *config_filename); + //void OPENSSL_INIT_set_config_file_flags(OPENSSL_INIT_SETTINGS *settings, + // unsigned long flags); + //int OPENSSL_INIT_set_config_appname(OPENSSL_INIT_SETTINGS *settings, + // const char *config_appname); + procedure OPENSSL_INIT_free(settings: POPENSSL_INIT_SETTINGS) cdecl; external CLibCrypto; {introduced 1.1.0} + + function CRYPTO_THREAD_run_once(once: PCRYPTO_ONCE; init: CRYPTO_THREAD_run_once_init): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + + //type + // CRYPTO_THREAD_init_local_cleanup = procedure(v1: Pointer); + // + //function CRYPTO_THREAD_init_local(key: PCRYPTO_THREAD_LOCAL; cleanup: CRYPTO_THREAD_init_local_cleanup): TIdC_INT; + function CRYPTO_THREAD_get_local(key: PCRYPTO_THREAD_LOCAL): Pointer cdecl; external CLibCrypto; {introduced 1.1.0} + function CRYPTO_THREAD_set_local(key: PCRYPTO_THREAD_LOCAL; val: Pointer): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function CRYPTO_THREAD_cleanup_local(key: PCRYPTO_THREAD_LOCAL): TidC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + + function CRYPTO_THREAD_get_current_id: CRYPTO_THREAD_ID cdecl; external CLibCrypto; {introduced 1.1.0} + function CRYPTO_THREAD_compare_id(a: CRYPTO_THREAD_ID; b: CRYPTO_THREAD_ID): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + + +function OPENSSL_malloc(num: TIdC_SIZET): Pointer; {removed 1.0.0} +function OPENSSL_zalloc(num: TIdC_SIZET): Pointer; {removed 1.0.0} +function OPENSSL_realloc(addr: Pointer; num: TIdC_SIZET): Pointer; {removed 1.0.0} +function OPENSSL_clear_realloc(addr: Pointer; old_num: TIdC_SIZET; num: TIdC_SIZET): Pointer; {removed 1.0.0} +procedure OPENSSL_clear_free(addr: Pointer; num: TIdC_SIZET); {removed 1.0.0} +procedure OPENSSL_free(addr: Pointer); {removed 1.0.0} +function OPENSSL_memdup(const str: Pointer; s: TIdC_SIZET): Pointer; {removed 1.0.0} +function OPENSSL_strdup(const str: PIdAnsiChar): PIdAnsiChar; {removed 1.0.0} +function OPENSSL_strndup(const str: PIdAnsiChar; n: TIdC_SIZET): PIdAnsiChar; {removed 1.0.0} +function OPENSSL_secure_malloc(num: TIdC_SIZET): Pointer; {removed 1.0.0} +function OPENSSL_secure_zalloc(num: TIdC_SIZET): Pointer; {removed 1.0.0} +procedure OPENSSL_secure_free(addr: Pointer); {removed 1.0.0} +procedure OPENSSL_secure_clear_free(addr: Pointer; num: TIdC_SIZET); {removed 1.0.0} +function OPENSSL_secure_actual_size(ptr: Pointer): TIdC_SIZET; {removed 1.0.0} + function CRYPTO_num_locks: TIdC_INT; {removed 1.1.0} + procedure CRYPTO_set_locking_callback(func: TIdSslLockingCallback); {removed 1.1.0} + procedure CRYPTO_THREADID_set_numeric(id : PCRYPTO_THREADID; val: TIdC_ULONG); {removed 1.1.0} + procedure CRYPTO_THREADID_set_callback(threadid_func: Tthreadid_func); {removed 1.1.0} + procedure CRYPTO_set_id_callback(func: TIdSslIdCallback); {removed 1.1.0} + function FIPS_mode: TIdC_INT; {removed 3.0.0} + function FIPS_mode_set(r: TIdC_INT): TIdC_INT; {removed 3.0.0} + function SSLeay_version(type_ : TIdC_INT) : PIdAnsiChar; {removed 1.1.0} + function SSLeay: TIdC_ULONG; {removed 1.1.0} +{$ENDIF} + +implementation + + uses + classes, + IdSSLOpenSSLExceptionHandlers, + IdResourceStringsOpenSSL + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + ,IdSSLOpenSSLLoader + {$ENDIF}; + +const + CRYPTO_THREAD_lock_new_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + CRYPTO_THREAD_read_lock_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + CRYPTO_THREAD_write_lock_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + CRYPTO_THREAD_unlock_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + CRYPTO_THREAD_lock_free_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + CRYPTO_atomic_add_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + OPENSSL_strlcpy_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + OPENSSL_strlcat_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + OPENSSL_strnlen_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + OPENSSL_buf2hexstr_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + OPENSSL_hexstr2buf_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + OPENSSL_hexchar2int_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + OpenSSL_version_num_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + OpenSSL_version_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + CRYPTO_set_mem_debug_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + CRYPTO_zalloc_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + CRYPTO_memdup_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + CRYPTO_strndup_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + CRYPTO_clear_free_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + CRYPTO_clear_realloc_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + CRYPTO_secure_malloc_init_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + CRYPTO_secure_malloc_done_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + CRYPTO_secure_malloc_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + CRYPTO_secure_zalloc_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + CRYPTO_secure_free_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + CRYPTO_secure_clear_free_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + CRYPTO_secure_allocated_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + CRYPTO_secure_malloc_initialized_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + CRYPTO_secure_actual_size_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + CRYPTO_secure_used_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + OPENSSL_cleanup_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + OPENSSL_init_crypto_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + OPENSSL_thread_stop_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + OPENSSL_INIT_new_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + OPENSSL_INIT_free_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + CRYPTO_THREAD_run_once_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + CRYPTO_THREAD_get_local_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + CRYPTO_THREAD_set_local_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + CRYPTO_THREAD_cleanup_local_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + CRYPTO_THREAD_get_current_id_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + CRYPTO_THREAD_compare_id_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + OPENSSL_malloc_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + OPENSSL_zalloc_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + OPENSSL_realloc_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + OPENSSL_clear_realloc_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + OPENSSL_clear_free_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + OPENSSL_free_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + OPENSSL_memdup_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + OPENSSL_strdup_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + OPENSSL_strndup_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + OPENSSL_secure_malloc_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + OPENSSL_secure_zalloc_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + OPENSSL_secure_free_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + OPENSSL_secure_clear_free_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + OPENSSL_secure_actual_size_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + CRYPTO_mem_ctrl_removed = (byte(3) shl 8 or byte(0)) shl 8 or byte(0); + CRYPTO_num_locks_removed = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + CRYPTO_set_locking_callback_removed = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + CRYPTO_THREADID_set_numeric_removed = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + CRYPTO_THREADID_set_callback_removed = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + CRYPTO_set_id_callback_removed = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + CRYPTO_set_mem_debug_removed = (byte(3) shl 8 or byte(0)) shl 8 or byte(0); + FIPS_mode_removed = (byte(3) shl 8 or byte(0)) shl 8 or byte(0); + FIPS_mode_set_removed = (byte(3) shl 8 or byte(0)) shl 8 or byte(0); + SSLeay_version_removed = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSLeay_removed = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + +// OPENSSL_FILE = __FILE__ = C preprocessor macro +// OPENSSL_LINE = __LINE__ = C preprocessor macro +// FPC hase an equivalent with {$I %FILE%} and {$I %LINENUM%}, see https://www.freepascal.org/docs-html/prog/progsu41.html#x47-460001.1.41 +// Delphi has nothing :( + +//# define OPENSSL_malloc(num) CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE) +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +const + OPENSSL_malloc_procname = 'OPENSSL_malloc'; {removed 1.0.0} + OPENSSL_zalloc_procname = 'OPENSSL_zalloc'; {removed 1.0.0} + OPENSSL_realloc_procname = 'OPENSSL_realloc'; {removed 1.0.0} + OPENSSL_clear_realloc_procname = 'OPENSSL_clear_realloc'; {removed 1.0.0} + OPENSSL_clear_free_procname = 'OPENSSL_clear_free'; {removed 1.0.0} + OPENSSL_free_procname = 'OPENSSL_free'; {removed 1.0.0} + OPENSSL_memdup_procname = 'OPENSSL_memdup'; {removed 1.0.0} + OPENSSL_strdup_procname = 'OPENSSL_strdup'; {removed 1.0.0} + OPENSSL_strndup_procname = 'OPENSSL_strndup'; {removed 1.0.0} + OPENSSL_secure_malloc_procname = 'OPENSSL_secure_malloc'; {removed 1.0.0} + OPENSSL_secure_zalloc_procname = 'OPENSSL_secure_zalloc'; {removed 1.0.0} + OPENSSL_secure_free_procname = 'OPENSSL_secure_free'; {removed 1.0.0} + OPENSSL_secure_clear_free_procname = 'OPENSSL_secure_clear_free'; {removed 1.0.0} + OPENSSL_secure_actual_size_procname = 'OPENSSL_secure_actual_size'; {removed 1.0.0} + + CRYPTO_THREAD_lock_new_procname = 'CRYPTO_THREAD_lock_new'; {introduced 1.1.0} + CRYPTO_THREAD_read_lock_procname = 'CRYPTO_THREAD_read_lock'; {introduced 1.1.0} + CRYPTO_THREAD_write_lock_procname = 'CRYPTO_THREAD_write_lock'; {introduced 1.1.0} + CRYPTO_THREAD_unlock_procname = 'CRYPTO_THREAD_unlock'; {introduced 1.1.0} + CRYPTO_THREAD_lock_free_procname = 'CRYPTO_THREAD_lock_free'; {introduced 1.1.0} + + CRYPTO_atomic_add_procname = 'CRYPTO_atomic_add'; {introduced 1.1.0} + + CRYPTO_mem_ctrl_procname = 'CRYPTO_mem_ctrl'; {removed 3.0.0} + + OPENSSL_strlcpy_procname = 'OPENSSL_strlcpy'; {introduced 1.1.0} + OPENSSL_strlcat_procname = 'OPENSSL_strlcat'; {introduced 1.1.0} + OPENSSL_strnlen_procname = 'OPENSSL_strnlen'; {introduced 1.1.0} + OPENSSL_buf2hexstr_procname = 'OPENSSL_buf2hexstr'; {introduced 1.1.0} + OPENSSL_hexstr2buf_procname = 'OPENSSL_hexstr2buf'; {introduced 1.1.0} + OPENSSL_hexchar2int_procname = 'OPENSSL_hexchar2int'; {introduced 1.1.0} + + // # define OPENSSL_MALLOC_MAX_NELEMS(type) (((1U<<(sizeof(int)*8-1))-1)/sizeof(type)) + + OpenSSL_version_num_procname = 'OpenSSL_version_num'; {introduced 1.1.0} + OpenSSL_version_procname = 'OpenSSL_version'; {introduced 1.1.0} + + OPENSSL_issetugid_procname = 'OPENSSL_issetugid'; + + (* No longer use an index. *) + //function CRYPTO_free_ex_index(class_index: TIdC_INT; idx: TIdC_INT): TIdC_INT; + + (* + * Initialise/duplicate/free CRYPTO_EX_DATA variables corresponding to a + * given class (invokes whatever per-class callbacks are applicable) + *) + CRYPTO_new_ex_data_procname = 'CRYPTO_new_ex_data'; + CRYPTO_dup_ex_data_procname = 'CRYPTO_dup_ex_data'; + + CRYPTO_free_ex_data_procname = 'CRYPTO_free_ex_data'; + + (* + * Get/set data in a CRYPTO_EX_DATA variable corresponding to a particular + * index (relative to the class type involved) + *) + CRYPTO_set_ex_data_procname = 'CRYPTO_set_ex_data'; + CRYPTO_get_ex_data_procname = 'CRYPTO_get_ex_data'; + + ///* + // * The old locking functions have been removed completely without compatibility + // * macros. This is because the old functions either could not properly report + // * errors, or the returned error values were not clearly documented. + // * Replacing the locking functions with no-ops would cause race condition + // * issues in the affected applications. It is far better for them to fail at + // * compile time. + // * On the other hand, the locking callbacks are no longer used. Consequently, + // * the callback management functions can be safely replaced with no-op macros. + // */ + //# define CRYPTO_num_locks() (1) + CRYPTO_num_locks_procname = 'CRYPTO_num_locks'; {removed 1.1.0} + //# define CRYPTO_set_locking_callback(func) + //# define CRYPTO_get_locking_callback() (NULL) + //# define CRYPTO_set_add_lock_callback(func) + //# define CRYPTO_get_add_lock_callback() (NULL) + CRYPTO_set_locking_callback_procname = 'CRYPTO_set_locking_callback'; {removed 1.1.0} + + ///* Only use CRYPTO_THREADID_set_[numeric|pointer]() within callbacks */ + //# define CRYPTO_THREADID_set_numeric(id, val) + CRYPTO_THREADID_set_numeric_procname = 'CRYPTO_THREADID_set_numeric'; {removed 1.1.0} + //# define CRYPTO_THREADID_set_pointer(id, ptr) + //# define CRYPTO_THREADID_set_callback(threadid_func) (0) + CRYPTO_THREADID_set_callback_procname = 'CRYPTO_THREADID_set_callback'; {removed 1.1.0} + //# define CRYPTO_THREADID_get_callback() (NULL) + //# define CRYPTO_THREADID_current(id) + //# define CRYPTO_THREADID_cmp(a, b) (-1) + //# define CRYPTO_THREADID_cpy(dest, src) + //# define CRYPTO_THREADID_hash(id) (0UL) + + CRYPTO_set_id_callback_procname = 'CRYPTO_set_id_callback'; {removed 1.1.0} + // + //# define CRYPTO_set_dynlock_create_callback(dyn_create_function) + //# define CRYPTO_set_dynlock_lock_callback(dyn_lock_function) + //# define CRYPTO_set_dynlock_destroy_callback(dyn_destroy_function) + //# define CRYPTO_get_dynlock_create_callback() (NULL) + //# define CRYPTO_get_dynlock_lock_callback() (NULL) + //# define CRYPTO_get_dynlock_destroy_callback() (NULL) + //# endif /* OPENSSL_API_COMPAT < 0x10100000L */ + + CRYPTO_set_mem_functions_procname = 'CRYPTO_set_mem_functions'; + CRYPTO_set_mem_debug_procname = 'CRYPTO_set_mem_debug'; {introduced 1.1.0 removed 3.0.0} + //void CRYPTO_get_mem_functions( + // void *(**m) (TIdC_SIZET, const char *, int), + // void *(**r) (void *, TIdC_SIZET, const char *, int), + // void (**f) (void *, const char *, int)); + + CRYPTO_malloc_procname = 'CRYPTO_malloc'; + CRYPTO_zalloc_procname = 'CRYPTO_zalloc'; {introduced 1.1.0} + CRYPTO_memdup_procname = 'CRYPTO_memdup'; {introduced 1.1.0} + CRYPTO_strdup_procname = 'CRYPTO_strdup'; + CRYPTO_strndup_procname = 'CRYPTO_strndup'; {introduced 1.1.0} + CRYPTO_free_procname = 'CRYPTO_free'; + CRYPTO_clear_free_procname = 'CRYPTO_clear_free'; {introduced 1.1.0} + CRYPTO_realloc_procname = 'CRYPTO_realloc'; + CRYPTO_clear_realloc_procname = 'CRYPTO_clear_realloc'; {introduced 1.1.0} + + CRYPTO_secure_malloc_init_procname = 'CRYPTO_secure_malloc_init'; {introduced 1.1.0} + CRYPTO_secure_malloc_done_procname = 'CRYPTO_secure_malloc_done'; {introduced 1.1.0} + CRYPTO_secure_malloc_procname = 'CRYPTO_secure_malloc'; {introduced 1.1.0} + CRYPTO_secure_zalloc_procname = 'CRYPTO_secure_zalloc'; {introduced 1.1.0} + CRYPTO_secure_free_procname = 'CRYPTO_secure_free'; {introduced 1.1.0} + CRYPTO_secure_clear_free_procname = 'CRYPTO_secure_clear_free'; {introduced 1.1.0} + CRYPTO_secure_allocated_procname = 'CRYPTO_secure_allocated'; {introduced 1.1.0} + CRYPTO_secure_malloc_initialized_procname = 'CRYPTO_secure_malloc_initialized'; {introduced 1.1.0} + CRYPTO_secure_actual_size_procname = 'CRYPTO_secure_actual_size'; {introduced 1.1.0} + CRYPTO_secure_used_procname = 'CRYPTO_secure_used'; {introduced 1.1.0} + + OPENSSL_cleanse_procname = 'OPENSSL_cleanse'; + + (* debug libraries only *) +// function CRYPTO_mem_debug_push(const info: PIdAnsiChar; const file_: PIdAnsiChar; line: TIdC_INT): TIdC_INT; +// function CRYPTO_mem_debug_pop: TIdC_INT; +// procedure CRYPTO_get_alloc_counts(mcount: PIdC_INT; rcount: PIdC_INT; fcount: PIdC_INT); + + (* + * Debugging functions (enabled by CRYPTO_set_mem_debug(1)) + * The flag argument has the following significance: + * 0: called before the actual memory allocation has taken place + * 1: called after the actual memory allocation has taken place + *) + +// procedure CRYPTO_mem_debug_malloc(addr: Pointer; num: TIdC_SIZET; flag: TIdC_INT; const file_: PIdAnsiChar; line: TIdC_INT); +// procedure CRYPTO_mem_debug_realloc(addr1: Pointer; addr2: Pointer; num: TIdC_SIZET; flag: TIdC_INT; const file_: PIdAnsiChar; line: TIdC_INT); +// procedure CRYPTO_mem_debug_free(addr: Pointer; flag: TIdC_INT; const file_: PIdAnsiChar; line: TIdC_INT); + +// function CRYPTO_mem_leaks_cb(cb: CRYPTO_mem_leaks_cb_cb; u: Pointer): TIdC_INT; + +// function CRYPTO_mem_leaks_fp(&FILE: Pointer): TIdC_INT; +// function CRYPTO_mem_leaks(BIO: PBIO): TIdC_INT; + + //* die if we have to */ + //ossl_noreturn void OPENSSL_die(const char *assertion, const char *file, int line); + + //# define OPENSSL_assert(e) \ + // (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1)) + + OPENSSL_isservice_procname = 'OPENSSL_isservice'; + + FIPS_mode_procname = 'FIPS_mode'; {removed 3.0.0} + FIPS_mode_set_procname = 'FIPS_mode_set'; {removed 3.0.0} + + OPENSSL_init_procname = 'OPENSSL_init'; + + // struct tm *OPENSSL_gmtime(const TIdC_TIMET *timer, struct tm *result); + + //function OPENSSL_gmtime_adj(struct tm *tm, int offset_day, long offset_sec): TIdC_INT; + //function OPENSSL_gmtime_diff(int *pday, int *psec, const struct tm *from, const struct tm *to): TIdC_INT; + + (* + * CRYPTO_memcmp returns zero iff the |len| bytes at |a| and |b| are equal. + * It takes an amount of time dependent on |len|, but independent of the + * contents of |a| and |b|. Unlike memcmp, it cannot be used to put elements + * into a defined order as the return value when a != b is undefined, other + * than to be non-zero. + *) + CRYPTO_memcmp_procname = 'CRYPTO_memcmp'; + + (* Library initialisation functions *) + OPENSSL_cleanup_procname = 'OPENSSL_cleanup'; {introduced 1.1.0} + OPENSSL_init_crypto_procname = 'OPENSSL_init_crypto'; {introduced 1.1.0} + // int OPENSSL_atexit(void (*handler)(void)); + OPENSSL_thread_stop_procname = 'OPENSSL_thread_stop'; {introduced 1.1.0} + + (* Low-level control of initialization *) + OPENSSL_INIT_new_procname = 'OPENSSL_INIT_new'; {introduced 1.1.0} + //int OPENSSL_INIT_set_config_filename(OPENSSL_INIT_SETTINGS *settings, + // const char *config_filename); + //void OPENSSL_INIT_set_config_file_flags(OPENSSL_INIT_SETTINGS *settings, + // unsigned long flags); + //int OPENSSL_INIT_set_config_appname(OPENSSL_INIT_SETTINGS *settings, + // const char *config_appname); + OPENSSL_INIT_free_procname = 'OPENSSL_INIT_free'; {introduced 1.1.0} + + CRYPTO_THREAD_run_once_procname = 'CRYPTO_THREAD_run_once'; {introduced 1.1.0} + + //type + // CRYPTO_THREAD_init_local_cleanup = procedure(v1: Pointer); + // + //function CRYPTO_THREAD_init_local(key: PCRYPTO_THREAD_LOCAL; cleanup: CRYPTO_THREAD_init_local_cleanup): TIdC_INT; + CRYPTO_THREAD_get_local_procname = 'CRYPTO_THREAD_get_local'; {introduced 1.1.0} + CRYPTO_THREAD_set_local_procname = 'CRYPTO_THREAD_set_local'; {introduced 1.1.0} + CRYPTO_THREAD_cleanup_local_procname = 'CRYPTO_THREAD_cleanup_local'; {introduced 1.1.0} + + CRYPTO_THREAD_get_current_id_procname = 'CRYPTO_THREAD_get_current_id'; {introduced 1.1.0} + CRYPTO_THREAD_compare_id_procname = 'CRYPTO_THREAD_compare_id'; {introduced 1.1.0} + + SSLeay_version_procname = 'SSLeay_version'; {removed 1.1.0} + SSLeay_procname = 'SSLeay'; {removed 1.1.0} + + +// OPENSSL_FILE = __FILE__ = C preprocessor macro +// OPENSSL_LINE = __LINE__ = C preprocessor macro +// FPC hase an equivalent with {$I %FILE%} and {$I %LINENUM%}, see https://www.freepascal.org/docs-html/prog/progsu41.html#x47-460001.1.41 +// Delphi has nothing :( + +//# define OPENSSL_malloc(num) CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE) +function _OPENSSL_malloc(num: TIdC_SIZET): Pointer; cdecl; +begin + Result := CRYPTO_malloc(num, {$IFNDEF FPC}''{$ELSE}{$I %FILE%}{$ENDIF}, {$IFNDEF FPC}-1{$ELSE}{$I %LINENUM%}{$ENDIF}); +end; + +//# define OPENSSL_zalloc(num) CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE) +function _OPENSSL_zalloc(num: TIdC_SIZET): Pointer; cdecl; +begin + Result := CRYPTO_zalloc(num, {$IFNDEF FPC}''{$ELSE}{$I %FILE%}{$ENDIF}, {$IFNDEF FPC}-1{$ELSE}{$I %LINENUM%}{$ENDIF}); +end; + +//# define OPENSSL_realloc(addr, num) CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE) +function _OPENSSL_realloc(addr: Pointer; num: TIdC_SIZET): Pointer; cdecl; +begin + Result := CRYPTO_realloc(addr, num, {$IFNDEF FPC}''{$ELSE}{$I %FILE%}{$ENDIF}, {$IFNDEF FPC}-1{$ELSE}{$I %LINENUM%}{$ENDIF}); +end; + +//# define OPENSSL_clear_realloc(addr, old_num, num) CRYPTO_clear_realloc(addr, old_num, num, OPENSSL_FILE, OPENSSL_LINE) +function _OPENSSL_clear_realloc(addr: Pointer; old_num: TIdC_SIZET; num: TIdC_SIZET): Pointer; cdecl; +begin + Result := CRYPTO_clear_realloc(addr, old_num, num, {$IFNDEF FPC}''{$ELSE}{$I %FILE%}{$ENDIF}, {$IFNDEF FPC}-1{$ELSE}{$I %LINENUM%}{$ENDIF}); +end; + +//# define OPENSSL_clear_free(addr, num) CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE) +procedure _OPENSSL_clear_free(addr: Pointer; num: TIdC_SIZET); cdecl; +begin + CRYPTO_clear_free(addr, num, {$IFNDEF FPC}''{$ELSE}{$I %FILE%}{$ENDIF}, {$IFNDEF FPC}-1{$ELSE}{$I %LINENUM%}{$ENDIF}); +end; + +//# define OPENSSL_free(addr) CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE) +procedure _OPENSSL_free(addr: Pointer); cdecl; +begin + CRYPTO_free(addr, {$IFNDEF FPC}''{$ELSE}{$I %FILE%}{$ENDIF}, {$IFNDEF FPC}-1{$ELSE}{$I %LINENUM%}{$ENDIF}); +end; + +//# define OPENSSL_memdup(str, s) CRYPTO_memdup((str), s, OPENSSL_FILE, OPENSSL_LINE) +function _OPENSSL_memdup(const str: Pointer; s: TIdC_SIZET): Pointer; cdecl; +begin + Result := CRYPTO_memdup(str, s, {$IFNDEF FPC}''{$ELSE}{$I %FILE%}{$ENDIF}, {$IFNDEF FPC}-1{$ELSE}{$I %LINENUM%}{$ENDIF}); +end; + +//# define OPENSSL_strdup(str) CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE) +function _OPENSSL_strdup(const str: PIdAnsiChar): PIdAnsiChar; cdecl; +begin + Result := CRYPTO_strdup(str, {$IFNDEF FPC}''{$ELSE}{$I %FILE%}{$ENDIF}, {$IFNDEF FPC}-1{$ELSE}{$I %LINENUM%}{$ENDIF}); +end; + +//# define OPENSSL_strndup(str, n) CRYPTO_strndup(str, n, OPENSSL_FILE, OPENSSL_LINE) +function _OPENSSL_strndup(const str: PIdAnsiChar; n: TIdC_SIZET): PIdAnsiChar; cdecl; +begin + Result := CRYPTO_strndup(str, n, {$IFNDEF FPC}''{$ELSE}{$I %FILE%}{$ENDIF}, {$IFNDEF FPC}-1{$ELSE}{$I %LINENUM%}{$ENDIF}); +end; + +//# define OPENSSL_secure_malloc(num) CRYPTO_secure_malloc(num, OPENSSL_FILE, OPENSSL_LINE) +function _OPENSSL_secure_malloc(num: TIdC_SIZET): Pointer; cdecl; +begin + Result := CRYPTO_secure_malloc(num, {$IFNDEF FPC}''{$ELSE}{$I %FILE%}{$ENDIF}, {$IFNDEF FPC}-1{$ELSE}{$I %LINENUM%}{$ENDIF}); +end; + +//# define OPENSSL_secure_zalloc(num) CRYPTO_secure_zalloc(num, OPENSSL_FILE, OPENSSL_LINE) +function _OPENSSL_secure_zalloc(num: TIdC_SIZET): Pointer; cdecl; +begin + Result := CRYPTO_secure_zalloc(num, {$IFNDEF FPC}''{$ELSE}{$I %FILE%}{$ENDIF}, {$IFNDEF FPC}-1{$ELSE}{$I %LINENUM%}{$ENDIF}); +end; + +//# define OPENSSL_secure_free(addr) CRYPTO_secure_free(addr, OPENSSL_FILE, OPENSSL_LINE) +procedure _OPENSSL_secure_free(addr: Pointer); cdecl; +begin + CRYPTO_secure_free(addr, {$IFNDEF FPC}''{$ELSE}{$I %FILE%}{$ENDIF}, {$IFNDEF FPC}-1{$ELSE}{$I %LINENUM%}{$ENDIF}); +end; + +//# define OPENSSL_secure_clear_free(addr, num) CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE) +procedure _OPENSSL_secure_clear_free(addr: Pointer; num: TIdC_SIZET); cdecl; +begin + CRYPTO_secure_clear_free(addr, num, {$IFNDEF FPC}''{$ELSE}{$I %FILE%}{$ENDIF}, {$IFNDEF FPC}-1{$ELSE}{$I %LINENUM%}{$ENDIF}); +end; + +//# define OPENSSL_secure_actual_size(ptr) CRYPTO_secure_actual_size(ptr) +function _OPENSSL_secure_actual_size(ptr: Pointer): TIdC_SIZET; cdecl; +begin + Result := CRYPTO_secure_actual_size(ptr); +end; + +function _CRYPTO_num_locks: TIdC_INT; cdecl; +begin + Result := 0; +end; + +procedure _CRYPTO_set_locking_callback; cdecl; +begin +end; + +procedure _CRYPTO_set_id_callback(func: TIdSslIdCallback); cdecl; +begin +end; + +function _SSLeay_version(type_ : TIdC_INT) : PIdAnsiChar; cdecl; +begin + Result := OpenSSL_version(type_); +end; + +function _SSLeay: TIdC_ULONG; cdecl; +begin + Result := OpenSSL_version_num(); +end; + +procedure _CRYPTO_THREADID_set_numeric(id : PCRYPTO_THREADID; val: TIdC_ULONG); cdecl; +begin +end; + +procedure _CRYPTO_THREADID_set_callback(threadid_func: Tthreadid_func); cdecl; +begin +end; + +function _FIPS_mode: TIdC_INT; cdecl; +begin + Result := OSSL_PROVIDER_available(nil,PAnsiChar(AnsiString('fips'))); +end; + +var fips_provider: POSSL_PROVIDER; + base_provider: POSSL_PROVIDER; + +function _FIPS_mode_set(r: TIdC_INT): TIdC_INT; cdecl; +begin + if r = 0 then + begin + if base_provider <> nil then + begin + OSSL_PROVIDER_unload(base_provider); + base_provider := nil; + end; + + if fips_provider <> nil then + begin + OSSL_PROVIDER_unload(fips_provider); + fips_provider := nil; + end; + Result := 1; + end + else + begin + Result := 0; + fips_provider := OSSL_PROVIDER_load(nil, PAnsiChar(AnsiString('fips'))); + if fips_provider = nil then + Exit; + base_provider := OSSL_PROVIDER_load(nil, PAnsiChar(AnsiString('base'))); + if base_provider = nil then + begin + OSSL_PROVIDER_unload(fips_provider); + fips_provider := nil; + Exit; + end; + Result := 1; + end; +end; + + + +{forward_compatibility} + +function FC_OPENSSL_init_crypto(opts: TIdC_UINT64; const settings: POPENSSL_INIT_SETTINGS): TIdC_INT; cdecl; +begin + Result := 0; + if opts and OPENSSL_INIT_ADD_ALL_CIPHERS <> 0 then + OpenSSL_add_all_ciphers; + if opts and OPENSSL_INIT_ADD_ALL_DIGESTS <> 0 then + OpenSSL_add_all_digests; + Result := 1; +end; + +procedure FC_OPENSSL_cleanup; cdecl; +begin + {nothing to do} +end; + +{/forward_compatibility} +{$WARN NO_RETVAL OFF} +function ERR_OPENSSL_malloc(num: TIdC_SIZET): Pointer; +begin + EIdAPIFunctionNotPresent.RaiseException(OPENSSL_malloc_procname); +end; + + +function ERR_OPENSSL_zalloc(num: TIdC_SIZET): Pointer; +begin + EIdAPIFunctionNotPresent.RaiseException(OPENSSL_zalloc_procname); +end; + + +function ERR_OPENSSL_realloc(addr: Pointer; num: TIdC_SIZET): Pointer; +begin + EIdAPIFunctionNotPresent.RaiseException(OPENSSL_realloc_procname); +end; + + +function ERR_OPENSSL_clear_realloc(addr: Pointer; old_num: TIdC_SIZET; num: TIdC_SIZET): Pointer; +begin + EIdAPIFunctionNotPresent.RaiseException(OPENSSL_clear_realloc_procname); +end; + + +procedure ERR_OPENSSL_clear_free(addr: Pointer; num: TIdC_SIZET); +begin + EIdAPIFunctionNotPresent.RaiseException(OPENSSL_clear_free_procname); +end; + + +procedure ERR_OPENSSL_free(addr: Pointer); +begin + EIdAPIFunctionNotPresent.RaiseException(OPENSSL_free_procname); +end; + + +function ERR_OPENSSL_memdup(const str: Pointer; s: TIdC_SIZET): Pointer; +begin + EIdAPIFunctionNotPresent.RaiseException(OPENSSL_memdup_procname); +end; + + +function ERR_OPENSSL_strdup(const str: PIdAnsiChar): PIdAnsiChar; +begin + EIdAPIFunctionNotPresent.RaiseException(OPENSSL_strdup_procname); +end; + + +function ERR_OPENSSL_strndup(const str: PIdAnsiChar; n: TIdC_SIZET): PIdAnsiChar; +begin + EIdAPIFunctionNotPresent.RaiseException(OPENSSL_strndup_procname); +end; + + +function ERR_OPENSSL_secure_malloc(num: TIdC_SIZET): Pointer; +begin + EIdAPIFunctionNotPresent.RaiseException(OPENSSL_secure_malloc_procname); +end; + + +function ERR_OPENSSL_secure_zalloc(num: TIdC_SIZET): Pointer; +begin + EIdAPIFunctionNotPresent.RaiseException(OPENSSL_secure_zalloc_procname); +end; + + +procedure ERR_OPENSSL_secure_free(addr: Pointer); +begin + EIdAPIFunctionNotPresent.RaiseException(OPENSSL_secure_free_procname); +end; + + +procedure ERR_OPENSSL_secure_clear_free(addr: Pointer; num: TIdC_SIZET); +begin + EIdAPIFunctionNotPresent.RaiseException(OPENSSL_secure_clear_free_procname); +end; + + +function ERR_OPENSSL_secure_actual_size(ptr: Pointer): TIdC_SIZET; +begin + EIdAPIFunctionNotPresent.RaiseException(OPENSSL_secure_actual_size_procname); +end; + + + +function ERR_CRYPTO_THREAD_lock_new: PCRYPTO_RWLOCK; +begin + EIdAPIFunctionNotPresent.RaiseException(CRYPTO_THREAD_lock_new_procname); +end; + + {introduced 1.1.0} +function ERR_CRYPTO_THREAD_read_lock(lock: PCRYPTO_RWLOCK): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(CRYPTO_THREAD_read_lock_procname); +end; + + {introduced 1.1.0} +function ERR_CRYPTO_THREAD_write_lock(lock: PCRYPTO_RWLOCK): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(CRYPTO_THREAD_write_lock_procname); +end; + + {introduced 1.1.0} +function ERR_CRYPTO_THREAD_unlock(lock: PCRYPTO_RWLOCK): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(CRYPTO_THREAD_unlock_procname); +end; + + {introduced 1.1.0} +procedure ERR_CRYPTO_THREAD_lock_free(lock: PCRYPTO_RWLOCK); +begin + EIdAPIFunctionNotPresent.RaiseException(CRYPTO_THREAD_lock_free_procname); +end; + + {introduced 1.1.0} + +function ERR_CRYPTO_atomic_add(val: PIdC_INT; amount: TIdC_INT; ret: PIdC_INT; lock: PCRYPTO_RWLOCK): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(CRYPTO_atomic_add_procname); +end; + + {introduced 1.1.0} + +function ERR_CRYPTO_mem_ctrl(mode: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(CRYPTO_mem_ctrl_procname); +end; + + + +function ERR_OPENSSL_strlcpy(dst: PIdAnsiChar; const src: PIdAnsiChar; siz: TIdC_SIZET): TIdC_SIZET; +begin + EIdAPIFunctionNotPresent.RaiseException(OPENSSL_strlcpy_procname); +end; + + {introduced 1.1.0} +function ERR_OPENSSL_strlcat(dst: PIdAnsiChar; const src: PIdAnsiChar; siz: TIdC_SIZET): TIdC_SIZET; +begin + EIdAPIFunctionNotPresent.RaiseException(OPENSSL_strlcat_procname); +end; + + {introduced 1.1.0} +function ERR_OPENSSL_strnlen(const str: PIdAnsiChar; maxlen: TIdC_SIZET): TIdC_SIZET; +begin + EIdAPIFunctionNotPresent.RaiseException(OPENSSL_strnlen_procname); +end; + + {introduced 1.1.0} +function ERR_OPENSSL_buf2hexstr(const buffer: PByte; len: TIdC_LONG): PIdAnsiChar; +begin + EIdAPIFunctionNotPresent.RaiseException(OPENSSL_buf2hexstr_procname); +end; + + {introduced 1.1.0} +function ERR_OPENSSL_hexstr2buf(const str: PIdAnsiChar; len: PIdC_LONG): PByte; +begin + EIdAPIFunctionNotPresent.RaiseException(OPENSSL_hexstr2buf_procname); +end; + + {introduced 1.1.0} +function ERR_OPENSSL_hexchar2int(c: Byte): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(OPENSSL_hexchar2int_procname); +end; + + {introduced 1.1.0} + + // # define OPENSSL_MALLOC_MAX_NELEMS(type) (((1U<<(sizeof(int)*8-1))-1)/sizeof(type)) + +function ERR_OpenSSL_version_num: TIdC_ULONG; +begin + EIdAPIFunctionNotPresent.RaiseException(OpenSSL_version_num_procname); +end; + + {introduced 1.1.0} +function ERR_OpenSSL_version(type_: TIdC_INT): PIdAnsiChar; +begin + EIdAPIFunctionNotPresent.RaiseException(OpenSSL_version_procname); +end; + + {introduced 1.1.0} + +function ERR_OPENSSL_issetugid: TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(OPENSSL_issetugid_procname); +end; + + + + (* No longer use an index. *) + //function CRYPTO_free_ex_index(class_index: TIdC_INT; idx: TIdC_INT): TIdC_INT; + + (* + * Initialise/duplicate/free CRYPTO_EX_DATA variables corresponding to a + * given class (invokes whatever per-class callbacks are applicable) + *) +function ERR_CRYPTO_new_ex_data(class_index: TIdC_INT; obj: Pointer; ad: PCRYPTO_EX_DATA): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(CRYPTO_new_ex_data_procname); +end; + + +function ERR_CRYPTO_dup_ex_data(class_index: TIdC_INT; to_: PCRYPTO_EX_DATA; const from: PCRYPTO_EX_DATA): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(CRYPTO_dup_ex_data_procname); +end; + + + +procedure ERR_CRYPTO_free_ex_data(class_index: TIdC_INT; obj: Pointer; ad: PCRYPTO_EX_DATA); +begin + EIdAPIFunctionNotPresent.RaiseException(CRYPTO_free_ex_data_procname); +end; + + + + (* + * Get/set data in a CRYPTO_EX_DATA variable corresponding to a particular + * index (relative to the class type involved) + *) +function ERR_CRYPTO_set_ex_data(ad: PCRYPTO_EX_DATA; idx: TIdC_INT; val: Pointer): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(CRYPTO_set_ex_data_procname); +end; + + +function ERR_CRYPTO_get_ex_data(const ad: PCRYPTO_EX_DATA; idx: TIdC_INT): Pointer; +begin + EIdAPIFunctionNotPresent.RaiseException(CRYPTO_get_ex_data_procname); +end; + + + + ///* + // * The old locking functions have been removed completely without compatibility + // * macros. This is because the old functions either could not properly report + // * errors, or the returned error values were not clearly documented. + // * Replacing the locking functions with no-ops would cause race condition + // * issues in the affected applications. It is far better for them to fail at + // * compile time. + // * On the other hand, the locking callbacks are no longer used. Consequently, + // * the callback management functions can be safely replaced with no-op macros. + // */ + //# define CRYPTO_num_locks() (1) +function ERR_CRYPTO_num_locks: TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(CRYPTO_num_locks_procname); +end; + + + //# define CRYPTO_set_locking_callback(func) + //# define CRYPTO_get_locking_callback() (NULL) + //# define CRYPTO_set_add_lock_callback(func) + //# define CRYPTO_get_add_lock_callback() (NULL) +procedure ERR_CRYPTO_set_locking_callback(func: TIdSslLockingCallback); +begin + EIdAPIFunctionNotPresent.RaiseException(CRYPTO_set_locking_callback_procname); +end; + + + + ///* Only use CRYPTO_THREADID_set_[numeric|pointer]() within callbacks */ + //# define CRYPTO_THREADID_set_numeric(id, val) +procedure ERR_CRYPTO_THREADID_set_numeric(id : PCRYPTO_THREADID; val: TIdC_ULONG); +begin + EIdAPIFunctionNotPresent.RaiseException(CRYPTO_THREADID_set_numeric_procname); +end; + + + //# define CRYPTO_THREADID_set_pointer(id, ptr) + //# define CRYPTO_THREADID_set_callback(threadid_func) (0) +procedure ERR_CRYPTO_THREADID_set_callback(threadid_func: Tthreadid_func); +begin + EIdAPIFunctionNotPresent.RaiseException(CRYPTO_THREADID_set_callback_procname); +end; + + + //# define CRYPTO_THREADID_get_callback() (NULL) + //# define CRYPTO_THREADID_current(id) + //# define CRYPTO_THREADID_cmp(a, b) (-1) + //# define CRYPTO_THREADID_cpy(dest, src) + //# define CRYPTO_THREADID_hash(id) (0UL) + +procedure ERR_CRYPTO_set_id_callback(func: TIdSslIdCallback); +begin + EIdAPIFunctionNotPresent.RaiseException(CRYPTO_set_id_callback_procname); +end; + + + // + //# define CRYPTO_set_dynlock_create_callback(dyn_create_function) + //# define CRYPTO_set_dynlock_lock_callback(dyn_lock_function) + //# define CRYPTO_set_dynlock_destroy_callback(dyn_destroy_function) + //# define CRYPTO_get_dynlock_create_callback() (NULL) + //# define CRYPTO_get_dynlock_lock_callback() (NULL) + //# define CRYPTO_get_dynlock_destroy_callback() (NULL) + //# endif /* OPENSSL_API_COMPAT < 0x10100000L */ + +function ERR_CRYPTO_set_mem_functions(m: CRYPTO_set_mem_functions_m; r: CRYPTO_set_mem_functions_r; f: CRYPTO_set_mem_functions_f): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(CRYPTO_set_mem_functions_procname); +end; + + +function ERR_CRYPTO_set_mem_debug(flag: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(CRYPTO_set_mem_debug_procname); +end; + + + //void CRYPTO_get_mem_functions( + // void *(**m) (TIdC_SIZET, const char *, int), + // void *(**r) (void *, TIdC_SIZET, const char *, int), + // void (**f) (void *, const char *, int)); + +function ERR_CRYPTO_malloc(num: TIdC_SIZET; const file_: PIdAnsiChar; line: TIdC_INT): Pointer; +begin + EIdAPIFunctionNotPresent.RaiseException(CRYPTO_malloc_procname); +end; + + +function ERR_CRYPTO_zalloc(num: TIdC_SIZET; const file_: PIdAnsiChar; line: TIdC_INT): Pointer; +begin + EIdAPIFunctionNotPresent.RaiseException(CRYPTO_zalloc_procname); +end; + + {introduced 1.1.0} +function ERR_CRYPTO_memdup(const str: Pointer; siz: TIdC_SIZET; const file_: PIdAnsiChar; line: TIdC_INT): Pointer; +begin + EIdAPIFunctionNotPresent.RaiseException(CRYPTO_memdup_procname); +end; + + {introduced 1.1.0} +function ERR_CRYPTO_strdup(const str: PIdAnsiChar; const file_: PIdAnsiChar; line: TIdC_INT): PIdAnsiChar; +begin + EIdAPIFunctionNotPresent.RaiseException(CRYPTO_strdup_procname); +end; + + +function ERR_CRYPTO_strndup(const str: PIdAnsiChar; s: TIdC_SIZET; const file_: PIdAnsiChar; line: TIdC_INT): PIdAnsiChar; +begin + EIdAPIFunctionNotPresent.RaiseException(CRYPTO_strndup_procname); +end; + + {introduced 1.1.0} +procedure ERR_CRYPTO_free(ptr: Pointer; const file_: PIdAnsiChar; line: TIdC_INT); +begin + EIdAPIFunctionNotPresent.RaiseException(CRYPTO_free_procname); +end; + + +procedure ERR_CRYPTO_clear_free(ptr: Pointer; num: TIdC_SIZET; const file_: PIdAnsiChar; line: TIdC_INT); +begin + EIdAPIFunctionNotPresent.RaiseException(CRYPTO_clear_free_procname); +end; + + {introduced 1.1.0} +function ERR_CRYPTO_realloc(addr: Pointer; num: TIdC_SIZET; const file_: PIdAnsiChar; line: TIdC_INT): Pointer; +begin + EIdAPIFunctionNotPresent.RaiseException(CRYPTO_realloc_procname); +end; + + +function ERR_CRYPTO_clear_realloc(addr: Pointer; old_num: TIdC_SIZET; num: TIdC_SIZET; const file_: PIdAnsiChar; line: TIdC_INT): Pointer; +begin + EIdAPIFunctionNotPresent.RaiseException(CRYPTO_clear_realloc_procname); +end; + + {introduced 1.1.0} + +function ERR_CRYPTO_secure_malloc_init(sz: TIdC_SIZET; minsize: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(CRYPTO_secure_malloc_init_procname); +end; + + {introduced 1.1.0} +function ERR_CRYPTO_secure_malloc_done: TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(CRYPTO_secure_malloc_done_procname); +end; + + {introduced 1.1.0} +function ERR_CRYPTO_secure_malloc(num: TIdC_SIZET; const file_: PIdAnsiChar; line: TIdC_INT): Pointer; +begin + EIdAPIFunctionNotPresent.RaiseException(CRYPTO_secure_malloc_procname); +end; + + {introduced 1.1.0} +function ERR_CRYPTO_secure_zalloc(num: TIdC_SIZET; const file_: PIdAnsiChar; line: TIdC_INT): Pointer; +begin + EIdAPIFunctionNotPresent.RaiseException(CRYPTO_secure_zalloc_procname); +end; + + {introduced 1.1.0} +procedure ERR_CRYPTO_secure_free(ptr: Pointer; const file_: PIdAnsiChar; line: TIdC_INT); +begin + EIdAPIFunctionNotPresent.RaiseException(CRYPTO_secure_free_procname); +end; + + {introduced 1.1.0} +procedure ERR_CRYPTO_secure_clear_free(ptr: Pointer; num: TIdC_SIZET; const file_: PIdAnsiChar; line: TIdC_INT); +begin + EIdAPIFunctionNotPresent.RaiseException(CRYPTO_secure_clear_free_procname); +end; + + {introduced 1.1.0} +function ERR_CRYPTO_secure_allocated(const ptr: Pointer): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(CRYPTO_secure_allocated_procname); +end; + + {introduced 1.1.0} +function ERR_CRYPTO_secure_malloc_initialized: TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(CRYPTO_secure_malloc_initialized_procname); +end; + + {introduced 1.1.0} +function ERR_CRYPTO_secure_actual_size(ptr: Pointer): TIdC_SIZET; +begin + EIdAPIFunctionNotPresent.RaiseException(CRYPTO_secure_actual_size_procname); +end; + + {introduced 1.1.0} +function ERR_CRYPTO_secure_used: TIdC_SIZET; +begin + EIdAPIFunctionNotPresent.RaiseException(CRYPTO_secure_used_procname); +end; + + {introduced 1.1.0} + +procedure ERR_OPENSSL_cleanse(ptr: Pointer; len: TIdC_SIZET); +begin + EIdAPIFunctionNotPresent.RaiseException(OPENSSL_cleanse_procname); +end; + + + + (* debug libraries only *) +// function CRYPTO_mem_debug_push(const info: PIdAnsiChar; const file_: PIdAnsiChar; line: TIdC_INT): TIdC_INT; +// function CRYPTO_mem_debug_pop: TIdC_INT; +// procedure CRYPTO_get_alloc_counts(mcount: PIdC_INT; rcount: PIdC_INT; fcount: PIdC_INT); + + (* + * Debugging functions (enabled by CRYPTO_set_mem_debug(1)) + * The flag argument has the following significance: + * 0: called before the actual memory allocation has taken place + * 1: called after the actual memory allocation has taken place + *) + +// procedure CRYPTO_mem_debug_malloc(addr: Pointer; num: TIdC_SIZET; flag: TIdC_INT; const file_: PIdAnsiChar; line: TIdC_INT); +// procedure CRYPTO_mem_debug_realloc(addr1: Pointer; addr2: Pointer; num: TIdC_SIZET; flag: TIdC_INT; const file_: PIdAnsiChar; line: TIdC_INT); +// procedure CRYPTO_mem_debug_free(addr: Pointer; flag: TIdC_INT; const file_: PIdAnsiChar; line: TIdC_INT); + +// function CRYPTO_mem_leaks_cb(cb: CRYPTO_mem_leaks_cb_cb; u: Pointer): TIdC_INT; + +// function CRYPTO_mem_leaks_fp(&FILE: Pointer): TIdC_INT; +// function CRYPTO_mem_leaks(BIO: PBIO): TIdC_INT; + + //* die if we have to */ + //ossl_noreturn void OPENSSL_die(const char *assertion, const char *file, int line); + + //# define OPENSSL_assert(e) \ + // (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1)) + +function ERR_OPENSSL_isservice: TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(OPENSSL_isservice_procname); +end; + + + +function ERR_FIPS_mode: TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(FIPS_mode_procname); +end; + + +function ERR_FIPS_mode_set(r: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(FIPS_mode_set_procname); +end; + + + +procedure ERR_OPENSSL_init; +begin + EIdAPIFunctionNotPresent.RaiseException(OPENSSL_init_procname); +end; + + + + // struct tm *OPENSSL_gmtime(const TIdC_TIMET *timer, struct tm *result); + + //function OPENSSL_gmtime_adj(struct tm *tm, int offset_day, long offset_sec): TIdC_INT; + //function OPENSSL_gmtime_diff(int *pday, int *psec, const struct tm *from, const struct tm *to): TIdC_INT; + + (* + * CRYPTO_memcmp returns zero iff the |len| bytes at |a| and |b| are equal. + * It takes an amount of time dependent on |len|, but independent of the + * contents of |a| and |b|. Unlike memcmp, it cannot be used to put elements + * into a defined order as the return value when a != b is undefined, other + * than to be non-zero. + *) +function ERR_CRYPTO_memcmp(const in_a: Pointer; const in_b: Pointer; len: TIdC_SIZET): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(CRYPTO_memcmp_procname); +end; + + + + (* Library initialisation functions *) +procedure ERR_OPENSSL_cleanup; +begin + EIdAPIFunctionNotPresent.RaiseException(OPENSSL_cleanup_procname); +end; + + {introduced 1.1.0} +function ERR_OPENSSL_init_crypto(opts: TIdC_UINT64; const settings: POPENSSL_INIT_SETTINGS): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(OPENSSL_init_crypto_procname); +end; + + {introduced 1.1.0} + // int OPENSSL_atexit(void (*handler)(void)); +procedure ERR_OPENSSL_thread_stop; +begin + EIdAPIFunctionNotPresent.RaiseException(OPENSSL_thread_stop_procname); +end; + + {introduced 1.1.0} + + (* Low-level control of initialization *) +function ERR_OPENSSL_INIT_new: POPENSSL_INIT_SETTINGS; +begin + EIdAPIFunctionNotPresent.RaiseException(OPENSSL_INIT_new_procname); +end; + + {introduced 1.1.0} + //int OPENSSL_INIT_set_config_filename(OPENSSL_INIT_SETTINGS *settings, + // const char *config_filename); + //void OPENSSL_INIT_set_config_file_flags(OPENSSL_INIT_SETTINGS *settings, + // unsigned long flags); + //int OPENSSL_INIT_set_config_appname(OPENSSL_INIT_SETTINGS *settings, + // const char *config_appname); +procedure ERR_OPENSSL_INIT_free(settings: POPENSSL_INIT_SETTINGS); +begin + EIdAPIFunctionNotPresent.RaiseException(OPENSSL_INIT_free_procname); +end; + + {introduced 1.1.0} + +function ERR_CRYPTO_THREAD_run_once(once: PCRYPTO_ONCE; init: CRYPTO_THREAD_run_once_init): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(CRYPTO_THREAD_run_once_procname); +end; + + {introduced 1.1.0} + + //type + // CRYPTO_THREAD_init_local_cleanup = procedure(v1: Pointer); + // + //function CRYPTO_THREAD_init_local(key: PCRYPTO_THREAD_LOCAL; cleanup: CRYPTO_THREAD_init_local_cleanup): TIdC_INT; +function ERR_CRYPTO_THREAD_get_local(key: PCRYPTO_THREAD_LOCAL): Pointer; +begin + EIdAPIFunctionNotPresent.RaiseException(CRYPTO_THREAD_get_local_procname); +end; + + {introduced 1.1.0} +function ERR_CRYPTO_THREAD_set_local(key: PCRYPTO_THREAD_LOCAL; val: Pointer): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(CRYPTO_THREAD_set_local_procname); +end; + + {introduced 1.1.0} +function ERR_CRYPTO_THREAD_cleanup_local(key: PCRYPTO_THREAD_LOCAL): TidC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(CRYPTO_THREAD_cleanup_local_procname); +end; + + {introduced 1.1.0} + +function ERR_CRYPTO_THREAD_get_current_id: CRYPTO_THREAD_ID; +begin + EIdAPIFunctionNotPresent.RaiseException(CRYPTO_THREAD_get_current_id_procname); +end; + + {introduced 1.1.0} +function ERR_CRYPTO_THREAD_compare_id(a: CRYPTO_THREAD_ID; b: CRYPTO_THREAD_ID): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(CRYPTO_THREAD_compare_id_procname); +end; + + {introduced 1.1.0} + +function ERR_SSLeay_version(type_ : TIdC_INT) : PIdAnsiChar; +begin + EIdAPIFunctionNotPresent.RaiseException(SSLeay_version_procname); +end; + + +function ERR_SSLeay: TIdC_ULONG; +begin + EIdAPIFunctionNotPresent.RaiseException(SSLeay_procname); +end; + + + +{$WARN NO_RETVAL ON} + +procedure Load(const ADllHandle: TIdLibHandle; LibVersion: TIdC_UINT; const AFailed: TStringList); + +var FuncLoadError: boolean; + +begin + OPENSSL_malloc := LoadLibFunction(ADllHandle, OPENSSL_malloc_procname); + FuncLoadError := not assigned(OPENSSL_malloc); + if FuncLoadError then + begin + {$if not defined(OPENSSL_malloc_allownil)} + OPENSSL_malloc := @ERR_OPENSSL_malloc; + {$ifend} + {$if declared(OPENSSL_malloc_introduced)} + if LibVersion < OPENSSL_malloc_introduced then + begin + {$if declared(FC_OPENSSL_malloc)} + OPENSSL_malloc := @FC_OPENSSL_malloc; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OPENSSL_malloc_removed)} + if OPENSSL_malloc_removed <= LibVersion then + begin + {$if declared(_OPENSSL_malloc)} + OPENSSL_malloc := @_OPENSSL_malloc; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OPENSSL_malloc_allownil)} + if FuncLoadError then + AFailed.Add('OPENSSL_malloc'); + {$ifend} + end; + + + OPENSSL_zalloc := LoadLibFunction(ADllHandle, OPENSSL_zalloc_procname); + FuncLoadError := not assigned(OPENSSL_zalloc); + if FuncLoadError then + begin + {$if not defined(OPENSSL_zalloc_allownil)} + OPENSSL_zalloc := @ERR_OPENSSL_zalloc; + {$ifend} + {$if declared(OPENSSL_zalloc_introduced)} + if LibVersion < OPENSSL_zalloc_introduced then + begin + {$if declared(FC_OPENSSL_zalloc)} + OPENSSL_zalloc := @FC_OPENSSL_zalloc; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OPENSSL_zalloc_removed)} + if OPENSSL_zalloc_removed <= LibVersion then + begin + {$if declared(_OPENSSL_zalloc)} + OPENSSL_zalloc := @_OPENSSL_zalloc; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OPENSSL_zalloc_allownil)} + if FuncLoadError then + AFailed.Add('OPENSSL_zalloc'); + {$ifend} + end; + + + OPENSSL_realloc := LoadLibFunction(ADllHandle, OPENSSL_realloc_procname); + FuncLoadError := not assigned(OPENSSL_realloc); + if FuncLoadError then + begin + {$if not defined(OPENSSL_realloc_allownil)} + OPENSSL_realloc := @ERR_OPENSSL_realloc; + {$ifend} + {$if declared(OPENSSL_realloc_introduced)} + if LibVersion < OPENSSL_realloc_introduced then + begin + {$if declared(FC_OPENSSL_realloc)} + OPENSSL_realloc := @FC_OPENSSL_realloc; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OPENSSL_realloc_removed)} + if OPENSSL_realloc_removed <= LibVersion then + begin + {$if declared(_OPENSSL_realloc)} + OPENSSL_realloc := @_OPENSSL_realloc; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OPENSSL_realloc_allownil)} + if FuncLoadError then + AFailed.Add('OPENSSL_realloc'); + {$ifend} + end; + + + OPENSSL_clear_realloc := LoadLibFunction(ADllHandle, OPENSSL_clear_realloc_procname); + FuncLoadError := not assigned(OPENSSL_clear_realloc); + if FuncLoadError then + begin + {$if not defined(OPENSSL_clear_realloc_allownil)} + OPENSSL_clear_realloc := @ERR_OPENSSL_clear_realloc; + {$ifend} + {$if declared(OPENSSL_clear_realloc_introduced)} + if LibVersion < OPENSSL_clear_realloc_introduced then + begin + {$if declared(FC_OPENSSL_clear_realloc)} + OPENSSL_clear_realloc := @FC_OPENSSL_clear_realloc; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OPENSSL_clear_realloc_removed)} + if OPENSSL_clear_realloc_removed <= LibVersion then + begin + {$if declared(_OPENSSL_clear_realloc)} + OPENSSL_clear_realloc := @_OPENSSL_clear_realloc; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OPENSSL_clear_realloc_allownil)} + if FuncLoadError then + AFailed.Add('OPENSSL_clear_realloc'); + {$ifend} + end; + + + OPENSSL_clear_free := LoadLibFunction(ADllHandle, OPENSSL_clear_free_procname); + FuncLoadError := not assigned(OPENSSL_clear_free); + if FuncLoadError then + begin + {$if not defined(OPENSSL_clear_free_allownil)} + OPENSSL_clear_free := @ERR_OPENSSL_clear_free; + {$ifend} + {$if declared(OPENSSL_clear_free_introduced)} + if LibVersion < OPENSSL_clear_free_introduced then + begin + {$if declared(FC_OPENSSL_clear_free)} + OPENSSL_clear_free := @FC_OPENSSL_clear_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OPENSSL_clear_free_removed)} + if OPENSSL_clear_free_removed <= LibVersion then + begin + {$if declared(_OPENSSL_clear_free)} + OPENSSL_clear_free := @_OPENSSL_clear_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OPENSSL_clear_free_allownil)} + if FuncLoadError then + AFailed.Add('OPENSSL_clear_free'); + {$ifend} + end; + + + OPENSSL_free := LoadLibFunction(ADllHandle, OPENSSL_free_procname); + FuncLoadError := not assigned(OPENSSL_free); + if FuncLoadError then + begin + {$if not defined(OPENSSL_free_allownil)} + OPENSSL_free := @ERR_OPENSSL_free; + {$ifend} + {$if declared(OPENSSL_free_introduced)} + if LibVersion < OPENSSL_free_introduced then + begin + {$if declared(FC_OPENSSL_free)} + OPENSSL_free := @FC_OPENSSL_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OPENSSL_free_removed)} + if OPENSSL_free_removed <= LibVersion then + begin + {$if declared(_OPENSSL_free)} + OPENSSL_free := @_OPENSSL_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OPENSSL_free_allownil)} + if FuncLoadError then + AFailed.Add('OPENSSL_free'); + {$ifend} + end; + + + OPENSSL_memdup := LoadLibFunction(ADllHandle, OPENSSL_memdup_procname); + FuncLoadError := not assigned(OPENSSL_memdup); + if FuncLoadError then + begin + {$if not defined(OPENSSL_memdup_allownil)} + OPENSSL_memdup := @ERR_OPENSSL_memdup; + {$ifend} + {$if declared(OPENSSL_memdup_introduced)} + if LibVersion < OPENSSL_memdup_introduced then + begin + {$if declared(FC_OPENSSL_memdup)} + OPENSSL_memdup := @FC_OPENSSL_memdup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OPENSSL_memdup_removed)} + if OPENSSL_memdup_removed <= LibVersion then + begin + {$if declared(_OPENSSL_memdup)} + OPENSSL_memdup := @_OPENSSL_memdup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OPENSSL_memdup_allownil)} + if FuncLoadError then + AFailed.Add('OPENSSL_memdup'); + {$ifend} + end; + + + OPENSSL_strdup := LoadLibFunction(ADllHandle, OPENSSL_strdup_procname); + FuncLoadError := not assigned(OPENSSL_strdup); + if FuncLoadError then + begin + {$if not defined(OPENSSL_strdup_allownil)} + OPENSSL_strdup := @ERR_OPENSSL_strdup; + {$ifend} + {$if declared(OPENSSL_strdup_introduced)} + if LibVersion < OPENSSL_strdup_introduced then + begin + {$if declared(FC_OPENSSL_strdup)} + OPENSSL_strdup := @FC_OPENSSL_strdup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OPENSSL_strdup_removed)} + if OPENSSL_strdup_removed <= LibVersion then + begin + {$if declared(_OPENSSL_strdup)} + OPENSSL_strdup := @_OPENSSL_strdup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OPENSSL_strdup_allownil)} + if FuncLoadError then + AFailed.Add('OPENSSL_strdup'); + {$ifend} + end; + + + OPENSSL_strndup := LoadLibFunction(ADllHandle, OPENSSL_strndup_procname); + FuncLoadError := not assigned(OPENSSL_strndup); + if FuncLoadError then + begin + {$if not defined(OPENSSL_strndup_allownil)} + OPENSSL_strndup := @ERR_OPENSSL_strndup; + {$ifend} + {$if declared(OPENSSL_strndup_introduced)} + if LibVersion < OPENSSL_strndup_introduced then + begin + {$if declared(FC_OPENSSL_strndup)} + OPENSSL_strndup := @FC_OPENSSL_strndup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OPENSSL_strndup_removed)} + if OPENSSL_strndup_removed <= LibVersion then + begin + {$if declared(_OPENSSL_strndup)} + OPENSSL_strndup := @_OPENSSL_strndup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OPENSSL_strndup_allownil)} + if FuncLoadError then + AFailed.Add('OPENSSL_strndup'); + {$ifend} + end; + + + OPENSSL_secure_malloc := LoadLibFunction(ADllHandle, OPENSSL_secure_malloc_procname); + FuncLoadError := not assigned(OPENSSL_secure_malloc); + if FuncLoadError then + begin + {$if not defined(OPENSSL_secure_malloc_allownil)} + OPENSSL_secure_malloc := @ERR_OPENSSL_secure_malloc; + {$ifend} + {$if declared(OPENSSL_secure_malloc_introduced)} + if LibVersion < OPENSSL_secure_malloc_introduced then + begin + {$if declared(FC_OPENSSL_secure_malloc)} + OPENSSL_secure_malloc := @FC_OPENSSL_secure_malloc; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OPENSSL_secure_malloc_removed)} + if OPENSSL_secure_malloc_removed <= LibVersion then + begin + {$if declared(_OPENSSL_secure_malloc)} + OPENSSL_secure_malloc := @_OPENSSL_secure_malloc; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OPENSSL_secure_malloc_allownil)} + if FuncLoadError then + AFailed.Add('OPENSSL_secure_malloc'); + {$ifend} + end; + + + OPENSSL_secure_zalloc := LoadLibFunction(ADllHandle, OPENSSL_secure_zalloc_procname); + FuncLoadError := not assigned(OPENSSL_secure_zalloc); + if FuncLoadError then + begin + {$if not defined(OPENSSL_secure_zalloc_allownil)} + OPENSSL_secure_zalloc := @ERR_OPENSSL_secure_zalloc; + {$ifend} + {$if declared(OPENSSL_secure_zalloc_introduced)} + if LibVersion < OPENSSL_secure_zalloc_introduced then + begin + {$if declared(FC_OPENSSL_secure_zalloc)} + OPENSSL_secure_zalloc := @FC_OPENSSL_secure_zalloc; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OPENSSL_secure_zalloc_removed)} + if OPENSSL_secure_zalloc_removed <= LibVersion then + begin + {$if declared(_OPENSSL_secure_zalloc)} + OPENSSL_secure_zalloc := @_OPENSSL_secure_zalloc; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OPENSSL_secure_zalloc_allownil)} + if FuncLoadError then + AFailed.Add('OPENSSL_secure_zalloc'); + {$ifend} + end; + + + OPENSSL_secure_free := LoadLibFunction(ADllHandle, OPENSSL_secure_free_procname); + FuncLoadError := not assigned(OPENSSL_secure_free); + if FuncLoadError then + begin + {$if not defined(OPENSSL_secure_free_allownil)} + OPENSSL_secure_free := @ERR_OPENSSL_secure_free; + {$ifend} + {$if declared(OPENSSL_secure_free_introduced)} + if LibVersion < OPENSSL_secure_free_introduced then + begin + {$if declared(FC_OPENSSL_secure_free)} + OPENSSL_secure_free := @FC_OPENSSL_secure_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OPENSSL_secure_free_removed)} + if OPENSSL_secure_free_removed <= LibVersion then + begin + {$if declared(_OPENSSL_secure_free)} + OPENSSL_secure_free := @_OPENSSL_secure_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OPENSSL_secure_free_allownil)} + if FuncLoadError then + AFailed.Add('OPENSSL_secure_free'); + {$ifend} + end; + + + OPENSSL_secure_clear_free := LoadLibFunction(ADllHandle, OPENSSL_secure_clear_free_procname); + FuncLoadError := not assigned(OPENSSL_secure_clear_free); + if FuncLoadError then + begin + {$if not defined(OPENSSL_secure_clear_free_allownil)} + OPENSSL_secure_clear_free := @ERR_OPENSSL_secure_clear_free; + {$ifend} + {$if declared(OPENSSL_secure_clear_free_introduced)} + if LibVersion < OPENSSL_secure_clear_free_introduced then + begin + {$if declared(FC_OPENSSL_secure_clear_free)} + OPENSSL_secure_clear_free := @FC_OPENSSL_secure_clear_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OPENSSL_secure_clear_free_removed)} + if OPENSSL_secure_clear_free_removed <= LibVersion then + begin + {$if declared(_OPENSSL_secure_clear_free)} + OPENSSL_secure_clear_free := @_OPENSSL_secure_clear_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OPENSSL_secure_clear_free_allownil)} + if FuncLoadError then + AFailed.Add('OPENSSL_secure_clear_free'); + {$ifend} + end; + + + OPENSSL_secure_actual_size := LoadLibFunction(ADllHandle, OPENSSL_secure_actual_size_procname); + FuncLoadError := not assigned(OPENSSL_secure_actual_size); + if FuncLoadError then + begin + {$if not defined(OPENSSL_secure_actual_size_allownil)} + OPENSSL_secure_actual_size := @ERR_OPENSSL_secure_actual_size; + {$ifend} + {$if declared(OPENSSL_secure_actual_size_introduced)} + if LibVersion < OPENSSL_secure_actual_size_introduced then + begin + {$if declared(FC_OPENSSL_secure_actual_size)} + OPENSSL_secure_actual_size := @FC_OPENSSL_secure_actual_size; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OPENSSL_secure_actual_size_removed)} + if OPENSSL_secure_actual_size_removed <= LibVersion then + begin + {$if declared(_OPENSSL_secure_actual_size)} + OPENSSL_secure_actual_size := @_OPENSSL_secure_actual_size; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OPENSSL_secure_actual_size_allownil)} + if FuncLoadError then + AFailed.Add('OPENSSL_secure_actual_size'); + {$ifend} + end; + + + CRYPTO_THREAD_lock_new := LoadLibFunction(ADllHandle, CRYPTO_THREAD_lock_new_procname); + FuncLoadError := not assigned(CRYPTO_THREAD_lock_new); + if FuncLoadError then + begin + {$if not defined(CRYPTO_THREAD_lock_new_allownil)} + CRYPTO_THREAD_lock_new := @ERR_CRYPTO_THREAD_lock_new; + {$ifend} + {$if declared(CRYPTO_THREAD_lock_new_introduced)} + if LibVersion < CRYPTO_THREAD_lock_new_introduced then + begin + {$if declared(FC_CRYPTO_THREAD_lock_new)} + CRYPTO_THREAD_lock_new := @FC_CRYPTO_THREAD_lock_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CRYPTO_THREAD_lock_new_removed)} + if CRYPTO_THREAD_lock_new_removed <= LibVersion then + begin + {$if declared(_CRYPTO_THREAD_lock_new)} + CRYPTO_THREAD_lock_new := @_CRYPTO_THREAD_lock_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CRYPTO_THREAD_lock_new_allownil)} + if FuncLoadError then + AFailed.Add('CRYPTO_THREAD_lock_new'); + {$ifend} + end; + + {introduced 1.1.0} + CRYPTO_THREAD_read_lock := LoadLibFunction(ADllHandle, CRYPTO_THREAD_read_lock_procname); + FuncLoadError := not assigned(CRYPTO_THREAD_read_lock); + if FuncLoadError then + begin + {$if not defined(CRYPTO_THREAD_read_lock_allownil)} + CRYPTO_THREAD_read_lock := @ERR_CRYPTO_THREAD_read_lock; + {$ifend} + {$if declared(CRYPTO_THREAD_read_lock_introduced)} + if LibVersion < CRYPTO_THREAD_read_lock_introduced then + begin + {$if declared(FC_CRYPTO_THREAD_read_lock)} + CRYPTO_THREAD_read_lock := @FC_CRYPTO_THREAD_read_lock; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CRYPTO_THREAD_read_lock_removed)} + if CRYPTO_THREAD_read_lock_removed <= LibVersion then + begin + {$if declared(_CRYPTO_THREAD_read_lock)} + CRYPTO_THREAD_read_lock := @_CRYPTO_THREAD_read_lock; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CRYPTO_THREAD_read_lock_allownil)} + if FuncLoadError then + AFailed.Add('CRYPTO_THREAD_read_lock'); + {$ifend} + end; + + {introduced 1.1.0} + CRYPTO_THREAD_write_lock := LoadLibFunction(ADllHandle, CRYPTO_THREAD_write_lock_procname); + FuncLoadError := not assigned(CRYPTO_THREAD_write_lock); + if FuncLoadError then + begin + {$if not defined(CRYPTO_THREAD_write_lock_allownil)} + CRYPTO_THREAD_write_lock := @ERR_CRYPTO_THREAD_write_lock; + {$ifend} + {$if declared(CRYPTO_THREAD_write_lock_introduced)} + if LibVersion < CRYPTO_THREAD_write_lock_introduced then + begin + {$if declared(FC_CRYPTO_THREAD_write_lock)} + CRYPTO_THREAD_write_lock := @FC_CRYPTO_THREAD_write_lock; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CRYPTO_THREAD_write_lock_removed)} + if CRYPTO_THREAD_write_lock_removed <= LibVersion then + begin + {$if declared(_CRYPTO_THREAD_write_lock)} + CRYPTO_THREAD_write_lock := @_CRYPTO_THREAD_write_lock; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CRYPTO_THREAD_write_lock_allownil)} + if FuncLoadError then + AFailed.Add('CRYPTO_THREAD_write_lock'); + {$ifend} + end; + + {introduced 1.1.0} + CRYPTO_THREAD_unlock := LoadLibFunction(ADllHandle, CRYPTO_THREAD_unlock_procname); + FuncLoadError := not assigned(CRYPTO_THREAD_unlock); + if FuncLoadError then + begin + {$if not defined(CRYPTO_THREAD_unlock_allownil)} + CRYPTO_THREAD_unlock := @ERR_CRYPTO_THREAD_unlock; + {$ifend} + {$if declared(CRYPTO_THREAD_unlock_introduced)} + if LibVersion < CRYPTO_THREAD_unlock_introduced then + begin + {$if declared(FC_CRYPTO_THREAD_unlock)} + CRYPTO_THREAD_unlock := @FC_CRYPTO_THREAD_unlock; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CRYPTO_THREAD_unlock_removed)} + if CRYPTO_THREAD_unlock_removed <= LibVersion then + begin + {$if declared(_CRYPTO_THREAD_unlock)} + CRYPTO_THREAD_unlock := @_CRYPTO_THREAD_unlock; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CRYPTO_THREAD_unlock_allownil)} + if FuncLoadError then + AFailed.Add('CRYPTO_THREAD_unlock'); + {$ifend} + end; + + {introduced 1.1.0} + CRYPTO_THREAD_lock_free := LoadLibFunction(ADllHandle, CRYPTO_THREAD_lock_free_procname); + FuncLoadError := not assigned(CRYPTO_THREAD_lock_free); + if FuncLoadError then + begin + {$if not defined(CRYPTO_THREAD_lock_free_allownil)} + CRYPTO_THREAD_lock_free := @ERR_CRYPTO_THREAD_lock_free; + {$ifend} + {$if declared(CRYPTO_THREAD_lock_free_introduced)} + if LibVersion < CRYPTO_THREAD_lock_free_introduced then + begin + {$if declared(FC_CRYPTO_THREAD_lock_free)} + CRYPTO_THREAD_lock_free := @FC_CRYPTO_THREAD_lock_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CRYPTO_THREAD_lock_free_removed)} + if CRYPTO_THREAD_lock_free_removed <= LibVersion then + begin + {$if declared(_CRYPTO_THREAD_lock_free)} + CRYPTO_THREAD_lock_free := @_CRYPTO_THREAD_lock_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CRYPTO_THREAD_lock_free_allownil)} + if FuncLoadError then + AFailed.Add('CRYPTO_THREAD_lock_free'); + {$ifend} + end; + + {introduced 1.1.0} + CRYPTO_atomic_add := LoadLibFunction(ADllHandle, CRYPTO_atomic_add_procname); + FuncLoadError := not assigned(CRYPTO_atomic_add); + if FuncLoadError then + begin + {$if not defined(CRYPTO_atomic_add_allownil)} + CRYPTO_atomic_add := @ERR_CRYPTO_atomic_add; + {$ifend} + {$if declared(CRYPTO_atomic_add_introduced)} + if LibVersion < CRYPTO_atomic_add_introduced then + begin + {$if declared(FC_CRYPTO_atomic_add)} + CRYPTO_atomic_add := @FC_CRYPTO_atomic_add; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CRYPTO_atomic_add_removed)} + if CRYPTO_atomic_add_removed <= LibVersion then + begin + {$if declared(_CRYPTO_atomic_add)} + CRYPTO_atomic_add := @_CRYPTO_atomic_add; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CRYPTO_atomic_add_allownil)} + if FuncLoadError then + AFailed.Add('CRYPTO_atomic_add'); + {$ifend} + end; + + {introduced 1.1.0} + CRYPTO_mem_ctrl := LoadLibFunction(ADllHandle, CRYPTO_mem_ctrl_procname); + FuncLoadError := not assigned(CRYPTO_mem_ctrl); + if FuncLoadError then + begin + {$if not defined(CRYPTO_mem_ctrl_allownil)} + CRYPTO_mem_ctrl := @ERR_CRYPTO_mem_ctrl; + {$ifend} + {$if declared(CRYPTO_mem_ctrl_introduced)} + if LibVersion < CRYPTO_mem_ctrl_introduced then + begin + {$if declared(FC_CRYPTO_mem_ctrl)} + CRYPTO_mem_ctrl := @FC_CRYPTO_mem_ctrl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CRYPTO_mem_ctrl_removed)} + if CRYPTO_mem_ctrl_removed <= LibVersion then + begin + {$if declared(_CRYPTO_mem_ctrl)} + CRYPTO_mem_ctrl := @_CRYPTO_mem_ctrl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CRYPTO_mem_ctrl_allownil)} + if FuncLoadError then + AFailed.Add('CRYPTO_mem_ctrl'); + {$ifend} + end; + + + OPENSSL_strlcpy := LoadLibFunction(ADllHandle, OPENSSL_strlcpy_procname); + FuncLoadError := not assigned(OPENSSL_strlcpy); + if FuncLoadError then + begin + {$if not defined(OPENSSL_strlcpy_allownil)} + OPENSSL_strlcpy := @ERR_OPENSSL_strlcpy; + {$ifend} + {$if declared(OPENSSL_strlcpy_introduced)} + if LibVersion < OPENSSL_strlcpy_introduced then + begin + {$if declared(FC_OPENSSL_strlcpy)} + OPENSSL_strlcpy := @FC_OPENSSL_strlcpy; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OPENSSL_strlcpy_removed)} + if OPENSSL_strlcpy_removed <= LibVersion then + begin + {$if declared(_OPENSSL_strlcpy)} + OPENSSL_strlcpy := @_OPENSSL_strlcpy; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OPENSSL_strlcpy_allownil)} + if FuncLoadError then + AFailed.Add('OPENSSL_strlcpy'); + {$ifend} + end; + + {introduced 1.1.0} + OPENSSL_strlcat := LoadLibFunction(ADllHandle, OPENSSL_strlcat_procname); + FuncLoadError := not assigned(OPENSSL_strlcat); + if FuncLoadError then + begin + {$if not defined(OPENSSL_strlcat_allownil)} + OPENSSL_strlcat := @ERR_OPENSSL_strlcat; + {$ifend} + {$if declared(OPENSSL_strlcat_introduced)} + if LibVersion < OPENSSL_strlcat_introduced then + begin + {$if declared(FC_OPENSSL_strlcat)} + OPENSSL_strlcat := @FC_OPENSSL_strlcat; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OPENSSL_strlcat_removed)} + if OPENSSL_strlcat_removed <= LibVersion then + begin + {$if declared(_OPENSSL_strlcat)} + OPENSSL_strlcat := @_OPENSSL_strlcat; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OPENSSL_strlcat_allownil)} + if FuncLoadError then + AFailed.Add('OPENSSL_strlcat'); + {$ifend} + end; + + {introduced 1.1.0} + OPENSSL_strnlen := LoadLibFunction(ADllHandle, OPENSSL_strnlen_procname); + FuncLoadError := not assigned(OPENSSL_strnlen); + if FuncLoadError then + begin + {$if not defined(OPENSSL_strnlen_allownil)} + OPENSSL_strnlen := @ERR_OPENSSL_strnlen; + {$ifend} + {$if declared(OPENSSL_strnlen_introduced)} + if LibVersion < OPENSSL_strnlen_introduced then + begin + {$if declared(FC_OPENSSL_strnlen)} + OPENSSL_strnlen := @FC_OPENSSL_strnlen; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OPENSSL_strnlen_removed)} + if OPENSSL_strnlen_removed <= LibVersion then + begin + {$if declared(_OPENSSL_strnlen)} + OPENSSL_strnlen := @_OPENSSL_strnlen; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OPENSSL_strnlen_allownil)} + if FuncLoadError then + AFailed.Add('OPENSSL_strnlen'); + {$ifend} + end; + + {introduced 1.1.0} + OPENSSL_buf2hexstr := LoadLibFunction(ADllHandle, OPENSSL_buf2hexstr_procname); + FuncLoadError := not assigned(OPENSSL_buf2hexstr); + if FuncLoadError then + begin + {$if not defined(OPENSSL_buf2hexstr_allownil)} + OPENSSL_buf2hexstr := @ERR_OPENSSL_buf2hexstr; + {$ifend} + {$if declared(OPENSSL_buf2hexstr_introduced)} + if LibVersion < OPENSSL_buf2hexstr_introduced then + begin + {$if declared(FC_OPENSSL_buf2hexstr)} + OPENSSL_buf2hexstr := @FC_OPENSSL_buf2hexstr; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OPENSSL_buf2hexstr_removed)} + if OPENSSL_buf2hexstr_removed <= LibVersion then + begin + {$if declared(_OPENSSL_buf2hexstr)} + OPENSSL_buf2hexstr := @_OPENSSL_buf2hexstr; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OPENSSL_buf2hexstr_allownil)} + if FuncLoadError then + AFailed.Add('OPENSSL_buf2hexstr'); + {$ifend} + end; + + {introduced 1.1.0} + OPENSSL_hexstr2buf := LoadLibFunction(ADllHandle, OPENSSL_hexstr2buf_procname); + FuncLoadError := not assigned(OPENSSL_hexstr2buf); + if FuncLoadError then + begin + {$if not defined(OPENSSL_hexstr2buf_allownil)} + OPENSSL_hexstr2buf := @ERR_OPENSSL_hexstr2buf; + {$ifend} + {$if declared(OPENSSL_hexstr2buf_introduced)} + if LibVersion < OPENSSL_hexstr2buf_introduced then + begin + {$if declared(FC_OPENSSL_hexstr2buf)} + OPENSSL_hexstr2buf := @FC_OPENSSL_hexstr2buf; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OPENSSL_hexstr2buf_removed)} + if OPENSSL_hexstr2buf_removed <= LibVersion then + begin + {$if declared(_OPENSSL_hexstr2buf)} + OPENSSL_hexstr2buf := @_OPENSSL_hexstr2buf; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OPENSSL_hexstr2buf_allownil)} + if FuncLoadError then + AFailed.Add('OPENSSL_hexstr2buf'); + {$ifend} + end; + + {introduced 1.1.0} + OPENSSL_hexchar2int := LoadLibFunction(ADllHandle, OPENSSL_hexchar2int_procname); + FuncLoadError := not assigned(OPENSSL_hexchar2int); + if FuncLoadError then + begin + {$if not defined(OPENSSL_hexchar2int_allownil)} + OPENSSL_hexchar2int := @ERR_OPENSSL_hexchar2int; + {$ifend} + {$if declared(OPENSSL_hexchar2int_introduced)} + if LibVersion < OPENSSL_hexchar2int_introduced then + begin + {$if declared(FC_OPENSSL_hexchar2int)} + OPENSSL_hexchar2int := @FC_OPENSSL_hexchar2int; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OPENSSL_hexchar2int_removed)} + if OPENSSL_hexchar2int_removed <= LibVersion then + begin + {$if declared(_OPENSSL_hexchar2int)} + OPENSSL_hexchar2int := @_OPENSSL_hexchar2int; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OPENSSL_hexchar2int_allownil)} + if FuncLoadError then + AFailed.Add('OPENSSL_hexchar2int'); + {$ifend} + end; + + {introduced 1.1.0} + OpenSSL_version_num := LoadLibFunction(ADllHandle, OpenSSL_version_num_procname); + FuncLoadError := not assigned(OpenSSL_version_num); + if FuncLoadError then + begin + {$if not defined(OpenSSL_version_num_allownil)} + OpenSSL_version_num := @ERR_OpenSSL_version_num; + {$ifend} + {$if declared(OpenSSL_version_num_introduced)} + if LibVersion < OpenSSL_version_num_introduced then + begin + {$if declared(FC_OpenSSL_version_num)} + OpenSSL_version_num := @FC_OpenSSL_version_num; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OpenSSL_version_num_removed)} + if OpenSSL_version_num_removed <= LibVersion then + begin + {$if declared(_OpenSSL_version_num)} + OpenSSL_version_num := @_OpenSSL_version_num; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OpenSSL_version_num_allownil)} + if FuncLoadError then + AFailed.Add('OpenSSL_version_num'); + {$ifend} + end; + + {introduced 1.1.0} + OpenSSL_version := LoadLibFunction(ADllHandle, OpenSSL_version_procname); + FuncLoadError := not assigned(OpenSSL_version); + if FuncLoadError then + begin + {$if not defined(OpenSSL_version_allownil)} + OpenSSL_version := @ERR_OpenSSL_version; + {$ifend} + {$if declared(OpenSSL_version_introduced)} + if LibVersion < OpenSSL_version_introduced then + begin + {$if declared(FC_OpenSSL_version)} + OpenSSL_version := @FC_OpenSSL_version; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OpenSSL_version_removed)} + if OpenSSL_version_removed <= LibVersion then + begin + {$if declared(_OpenSSL_version)} + OpenSSL_version := @_OpenSSL_version; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OpenSSL_version_allownil)} + if FuncLoadError then + AFailed.Add('OpenSSL_version'); + {$ifend} + end; + + {introduced 1.1.0} + OPENSSL_issetugid := LoadLibFunction(ADllHandle, OPENSSL_issetugid_procname); + FuncLoadError := not assigned(OPENSSL_issetugid); + if FuncLoadError then + begin + {$if not defined(OPENSSL_issetugid_allownil)} + OPENSSL_issetugid := @ERR_OPENSSL_issetugid; + {$ifend} + {$if declared(OPENSSL_issetugid_introduced)} + if LibVersion < OPENSSL_issetugid_introduced then + begin + {$if declared(FC_OPENSSL_issetugid)} + OPENSSL_issetugid := @FC_OPENSSL_issetugid; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OPENSSL_issetugid_removed)} + if OPENSSL_issetugid_removed <= LibVersion then + begin + {$if declared(_OPENSSL_issetugid)} + OPENSSL_issetugid := @_OPENSSL_issetugid; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OPENSSL_issetugid_allownil)} + if FuncLoadError then + AFailed.Add('OPENSSL_issetugid'); + {$ifend} + end; + + + CRYPTO_new_ex_data := LoadLibFunction(ADllHandle, CRYPTO_new_ex_data_procname); + FuncLoadError := not assigned(CRYPTO_new_ex_data); + if FuncLoadError then + begin + {$if not defined(CRYPTO_new_ex_data_allownil)} + CRYPTO_new_ex_data := @ERR_CRYPTO_new_ex_data; + {$ifend} + {$if declared(CRYPTO_new_ex_data_introduced)} + if LibVersion < CRYPTO_new_ex_data_introduced then + begin + {$if declared(FC_CRYPTO_new_ex_data)} + CRYPTO_new_ex_data := @FC_CRYPTO_new_ex_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CRYPTO_new_ex_data_removed)} + if CRYPTO_new_ex_data_removed <= LibVersion then + begin + {$if declared(_CRYPTO_new_ex_data)} + CRYPTO_new_ex_data := @_CRYPTO_new_ex_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CRYPTO_new_ex_data_allownil)} + if FuncLoadError then + AFailed.Add('CRYPTO_new_ex_data'); + {$ifend} + end; + + + CRYPTO_dup_ex_data := LoadLibFunction(ADllHandle, CRYPTO_dup_ex_data_procname); + FuncLoadError := not assigned(CRYPTO_dup_ex_data); + if FuncLoadError then + begin + {$if not defined(CRYPTO_dup_ex_data_allownil)} + CRYPTO_dup_ex_data := @ERR_CRYPTO_dup_ex_data; + {$ifend} + {$if declared(CRYPTO_dup_ex_data_introduced)} + if LibVersion < CRYPTO_dup_ex_data_introduced then + begin + {$if declared(FC_CRYPTO_dup_ex_data)} + CRYPTO_dup_ex_data := @FC_CRYPTO_dup_ex_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CRYPTO_dup_ex_data_removed)} + if CRYPTO_dup_ex_data_removed <= LibVersion then + begin + {$if declared(_CRYPTO_dup_ex_data)} + CRYPTO_dup_ex_data := @_CRYPTO_dup_ex_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CRYPTO_dup_ex_data_allownil)} + if FuncLoadError then + AFailed.Add('CRYPTO_dup_ex_data'); + {$ifend} + end; + + + CRYPTO_free_ex_data := LoadLibFunction(ADllHandle, CRYPTO_free_ex_data_procname); + FuncLoadError := not assigned(CRYPTO_free_ex_data); + if FuncLoadError then + begin + {$if not defined(CRYPTO_free_ex_data_allownil)} + CRYPTO_free_ex_data := @ERR_CRYPTO_free_ex_data; + {$ifend} + {$if declared(CRYPTO_free_ex_data_introduced)} + if LibVersion < CRYPTO_free_ex_data_introduced then + begin + {$if declared(FC_CRYPTO_free_ex_data)} + CRYPTO_free_ex_data := @FC_CRYPTO_free_ex_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CRYPTO_free_ex_data_removed)} + if CRYPTO_free_ex_data_removed <= LibVersion then + begin + {$if declared(_CRYPTO_free_ex_data)} + CRYPTO_free_ex_data := @_CRYPTO_free_ex_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CRYPTO_free_ex_data_allownil)} + if FuncLoadError then + AFailed.Add('CRYPTO_free_ex_data'); + {$ifend} + end; + + + CRYPTO_set_ex_data := LoadLibFunction(ADllHandle, CRYPTO_set_ex_data_procname); + FuncLoadError := not assigned(CRYPTO_set_ex_data); + if FuncLoadError then + begin + {$if not defined(CRYPTO_set_ex_data_allownil)} + CRYPTO_set_ex_data := @ERR_CRYPTO_set_ex_data; + {$ifend} + {$if declared(CRYPTO_set_ex_data_introduced)} + if LibVersion < CRYPTO_set_ex_data_introduced then + begin + {$if declared(FC_CRYPTO_set_ex_data)} + CRYPTO_set_ex_data := @FC_CRYPTO_set_ex_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CRYPTO_set_ex_data_removed)} + if CRYPTO_set_ex_data_removed <= LibVersion then + begin + {$if declared(_CRYPTO_set_ex_data)} + CRYPTO_set_ex_data := @_CRYPTO_set_ex_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CRYPTO_set_ex_data_allownil)} + if FuncLoadError then + AFailed.Add('CRYPTO_set_ex_data'); + {$ifend} + end; + + + CRYPTO_get_ex_data := LoadLibFunction(ADllHandle, CRYPTO_get_ex_data_procname); + FuncLoadError := not assigned(CRYPTO_get_ex_data); + if FuncLoadError then + begin + {$if not defined(CRYPTO_get_ex_data_allownil)} + CRYPTO_get_ex_data := @ERR_CRYPTO_get_ex_data; + {$ifend} + {$if declared(CRYPTO_get_ex_data_introduced)} + if LibVersion < CRYPTO_get_ex_data_introduced then + begin + {$if declared(FC_CRYPTO_get_ex_data)} + CRYPTO_get_ex_data := @FC_CRYPTO_get_ex_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CRYPTO_get_ex_data_removed)} + if CRYPTO_get_ex_data_removed <= LibVersion then + begin + {$if declared(_CRYPTO_get_ex_data)} + CRYPTO_get_ex_data := @_CRYPTO_get_ex_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CRYPTO_get_ex_data_allownil)} + if FuncLoadError then + AFailed.Add('CRYPTO_get_ex_data'); + {$ifend} + end; + + + CRYPTO_num_locks := LoadLibFunction(ADllHandle, CRYPTO_num_locks_procname); + FuncLoadError := not assigned(CRYPTO_num_locks); + if FuncLoadError then + begin + {$if not defined(CRYPTO_num_locks_allownil)} + CRYPTO_num_locks := @ERR_CRYPTO_num_locks; + {$ifend} + {$if declared(CRYPTO_num_locks_introduced)} + if LibVersion < CRYPTO_num_locks_introduced then + begin + {$if declared(FC_CRYPTO_num_locks)} + CRYPTO_num_locks := @FC_CRYPTO_num_locks; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CRYPTO_num_locks_removed)} + if CRYPTO_num_locks_removed <= LibVersion then + begin + {$if declared(_CRYPTO_num_locks)} + CRYPTO_num_locks := @_CRYPTO_num_locks; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CRYPTO_num_locks_allownil)} + if FuncLoadError then + AFailed.Add('CRYPTO_num_locks'); + {$ifend} + end; + + + CRYPTO_set_locking_callback := LoadLibFunction(ADllHandle, CRYPTO_set_locking_callback_procname); + FuncLoadError := not assigned(CRYPTO_set_locking_callback); + if FuncLoadError then + begin + {$if not defined(CRYPTO_set_locking_callback_allownil)} + CRYPTO_set_locking_callback := @ERR_CRYPTO_set_locking_callback; + {$ifend} + {$if declared(CRYPTO_set_locking_callback_introduced)} + if LibVersion < CRYPTO_set_locking_callback_introduced then + begin + {$if declared(FC_CRYPTO_set_locking_callback)} + CRYPTO_set_locking_callback := @FC_CRYPTO_set_locking_callback; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CRYPTO_set_locking_callback_removed)} + if CRYPTO_set_locking_callback_removed <= LibVersion then + begin + {$if declared(_CRYPTO_set_locking_callback)} + CRYPTO_set_locking_callback := @_CRYPTO_set_locking_callback; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CRYPTO_set_locking_callback_allownil)} + if FuncLoadError then + AFailed.Add('CRYPTO_set_locking_callback'); + {$ifend} + end; + + + CRYPTO_THREADID_set_numeric := LoadLibFunction(ADllHandle, CRYPTO_THREADID_set_numeric_procname); + FuncLoadError := not assigned(CRYPTO_THREADID_set_numeric); + if FuncLoadError then + begin + {$if not defined(CRYPTO_THREADID_set_numeric_allownil)} + CRYPTO_THREADID_set_numeric := @ERR_CRYPTO_THREADID_set_numeric; + {$ifend} + {$if declared(CRYPTO_THREADID_set_numeric_introduced)} + if LibVersion < CRYPTO_THREADID_set_numeric_introduced then + begin + {$if declared(FC_CRYPTO_THREADID_set_numeric)} + CRYPTO_THREADID_set_numeric := @FC_CRYPTO_THREADID_set_numeric; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CRYPTO_THREADID_set_numeric_removed)} + if CRYPTO_THREADID_set_numeric_removed <= LibVersion then + begin + {$if declared(_CRYPTO_THREADID_set_numeric)} + CRYPTO_THREADID_set_numeric := @_CRYPTO_THREADID_set_numeric; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CRYPTO_THREADID_set_numeric_allownil)} + if FuncLoadError then + AFailed.Add('CRYPTO_THREADID_set_numeric'); + {$ifend} + end; + + + CRYPTO_THREADID_set_callback := LoadLibFunction(ADllHandle, CRYPTO_THREADID_set_callback_procname); + FuncLoadError := not assigned(CRYPTO_THREADID_set_callback); + if FuncLoadError then + begin + {$if not defined(CRYPTO_THREADID_set_callback_allownil)} + CRYPTO_THREADID_set_callback := @ERR_CRYPTO_THREADID_set_callback; + {$ifend} + {$if declared(CRYPTO_THREADID_set_callback_introduced)} + if LibVersion < CRYPTO_THREADID_set_callback_introduced then + begin + {$if declared(FC_CRYPTO_THREADID_set_callback)} + CRYPTO_THREADID_set_callback := @FC_CRYPTO_THREADID_set_callback; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CRYPTO_THREADID_set_callback_removed)} + if CRYPTO_THREADID_set_callback_removed <= LibVersion then + begin + {$if declared(_CRYPTO_THREADID_set_callback)} + CRYPTO_THREADID_set_callback := @_CRYPTO_THREADID_set_callback; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CRYPTO_THREADID_set_callback_allownil)} + if FuncLoadError then + AFailed.Add('CRYPTO_THREADID_set_callback'); + {$ifend} + end; + + + CRYPTO_set_id_callback := LoadLibFunction(ADllHandle, CRYPTO_set_id_callback_procname); + FuncLoadError := not assigned(CRYPTO_set_id_callback); + if FuncLoadError then + begin + {$if not defined(CRYPTO_set_id_callback_allownil)} + CRYPTO_set_id_callback := @ERR_CRYPTO_set_id_callback; + {$ifend} + {$if declared(CRYPTO_set_id_callback_introduced)} + if LibVersion < CRYPTO_set_id_callback_introduced then + begin + {$if declared(FC_CRYPTO_set_id_callback)} + CRYPTO_set_id_callback := @FC_CRYPTO_set_id_callback; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CRYPTO_set_id_callback_removed)} + if CRYPTO_set_id_callback_removed <= LibVersion then + begin + {$if declared(_CRYPTO_set_id_callback)} + CRYPTO_set_id_callback := @_CRYPTO_set_id_callback; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CRYPTO_set_id_callback_allownil)} + if FuncLoadError then + AFailed.Add('CRYPTO_set_id_callback'); + {$ifend} + end; + + + CRYPTO_set_mem_functions := LoadLibFunction(ADllHandle, CRYPTO_set_mem_functions_procname); + FuncLoadError := not assigned(CRYPTO_set_mem_functions); + if FuncLoadError then + begin + {$if not defined(CRYPTO_set_mem_functions_allownil)} + CRYPTO_set_mem_functions := @ERR_CRYPTO_set_mem_functions; + {$ifend} + {$if declared(CRYPTO_set_mem_functions_introduced)} + if LibVersion < CRYPTO_set_mem_functions_introduced then + begin + {$if declared(FC_CRYPTO_set_mem_functions)} + CRYPTO_set_mem_functions := @FC_CRYPTO_set_mem_functions; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CRYPTO_set_mem_functions_removed)} + if CRYPTO_set_mem_functions_removed <= LibVersion then + begin + {$if declared(_CRYPTO_set_mem_functions)} + CRYPTO_set_mem_functions := @_CRYPTO_set_mem_functions; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CRYPTO_set_mem_functions_allownil)} + if FuncLoadError then + AFailed.Add('CRYPTO_set_mem_functions'); + {$ifend} + end; + + + CRYPTO_set_mem_debug := LoadLibFunction(ADllHandle, CRYPTO_set_mem_debug_procname); + FuncLoadError := not assigned(CRYPTO_set_mem_debug); + if FuncLoadError then + begin + {$if not defined(CRYPTO_set_mem_debug_allownil)} + CRYPTO_set_mem_debug := @ERR_CRYPTO_set_mem_debug; + {$ifend} + {$if declared(CRYPTO_set_mem_debug_introduced)} + if LibVersion < CRYPTO_set_mem_debug_introduced then + begin + {$if declared(FC_CRYPTO_set_mem_debug)} + CRYPTO_set_mem_debug := @FC_CRYPTO_set_mem_debug; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CRYPTO_set_mem_debug_removed)} + if CRYPTO_set_mem_debug_removed <= LibVersion then + begin + {$if declared(_CRYPTO_set_mem_debug)} + CRYPTO_set_mem_debug := @_CRYPTO_set_mem_debug; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CRYPTO_set_mem_debug_allownil)} + if FuncLoadError then + AFailed.Add('CRYPTO_set_mem_debug'); + {$ifend} + end; + + + CRYPTO_malloc := LoadLibFunction(ADllHandle, CRYPTO_malloc_procname); + FuncLoadError := not assigned(CRYPTO_malloc); + if FuncLoadError then + begin + {$if not defined(CRYPTO_malloc_allownil)} + CRYPTO_malloc := @ERR_CRYPTO_malloc; + {$ifend} + {$if declared(CRYPTO_malloc_introduced)} + if LibVersion < CRYPTO_malloc_introduced then + begin + {$if declared(FC_CRYPTO_malloc)} + CRYPTO_malloc := @FC_CRYPTO_malloc; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CRYPTO_malloc_removed)} + if CRYPTO_malloc_removed <= LibVersion then + begin + {$if declared(_CRYPTO_malloc)} + CRYPTO_malloc := @_CRYPTO_malloc; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CRYPTO_malloc_allownil)} + if FuncLoadError then + AFailed.Add('CRYPTO_malloc'); + {$ifend} + end; + + + CRYPTO_zalloc := LoadLibFunction(ADllHandle, CRYPTO_zalloc_procname); + FuncLoadError := not assigned(CRYPTO_zalloc); + if FuncLoadError then + begin + {$if not defined(CRYPTO_zalloc_allownil)} + CRYPTO_zalloc := @ERR_CRYPTO_zalloc; + {$ifend} + {$if declared(CRYPTO_zalloc_introduced)} + if LibVersion < CRYPTO_zalloc_introduced then + begin + {$if declared(FC_CRYPTO_zalloc)} + CRYPTO_zalloc := @FC_CRYPTO_zalloc; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CRYPTO_zalloc_removed)} + if CRYPTO_zalloc_removed <= LibVersion then + begin + {$if declared(_CRYPTO_zalloc)} + CRYPTO_zalloc := @_CRYPTO_zalloc; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CRYPTO_zalloc_allownil)} + if FuncLoadError then + AFailed.Add('CRYPTO_zalloc'); + {$ifend} + end; + + {introduced 1.1.0} + CRYPTO_memdup := LoadLibFunction(ADllHandle, CRYPTO_memdup_procname); + FuncLoadError := not assigned(CRYPTO_memdup); + if FuncLoadError then + begin + {$if not defined(CRYPTO_memdup_allownil)} + CRYPTO_memdup := @ERR_CRYPTO_memdup; + {$ifend} + {$if declared(CRYPTO_memdup_introduced)} + if LibVersion < CRYPTO_memdup_introduced then + begin + {$if declared(FC_CRYPTO_memdup)} + CRYPTO_memdup := @FC_CRYPTO_memdup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CRYPTO_memdup_removed)} + if CRYPTO_memdup_removed <= LibVersion then + begin + {$if declared(_CRYPTO_memdup)} + CRYPTO_memdup := @_CRYPTO_memdup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CRYPTO_memdup_allownil)} + if FuncLoadError then + AFailed.Add('CRYPTO_memdup'); + {$ifend} + end; + + {introduced 1.1.0} + CRYPTO_strdup := LoadLibFunction(ADllHandle, CRYPTO_strdup_procname); + FuncLoadError := not assigned(CRYPTO_strdup); + if FuncLoadError then + begin + {$if not defined(CRYPTO_strdup_allownil)} + CRYPTO_strdup := @ERR_CRYPTO_strdup; + {$ifend} + {$if declared(CRYPTO_strdup_introduced)} + if LibVersion < CRYPTO_strdup_introduced then + begin + {$if declared(FC_CRYPTO_strdup)} + CRYPTO_strdup := @FC_CRYPTO_strdup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CRYPTO_strdup_removed)} + if CRYPTO_strdup_removed <= LibVersion then + begin + {$if declared(_CRYPTO_strdup)} + CRYPTO_strdup := @_CRYPTO_strdup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CRYPTO_strdup_allownil)} + if FuncLoadError then + AFailed.Add('CRYPTO_strdup'); + {$ifend} + end; + + + CRYPTO_strndup := LoadLibFunction(ADllHandle, CRYPTO_strndup_procname); + FuncLoadError := not assigned(CRYPTO_strndup); + if FuncLoadError then + begin + {$if not defined(CRYPTO_strndup_allownil)} + CRYPTO_strndup := @ERR_CRYPTO_strndup; + {$ifend} + {$if declared(CRYPTO_strndup_introduced)} + if LibVersion < CRYPTO_strndup_introduced then + begin + {$if declared(FC_CRYPTO_strndup)} + CRYPTO_strndup := @FC_CRYPTO_strndup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CRYPTO_strndup_removed)} + if CRYPTO_strndup_removed <= LibVersion then + begin + {$if declared(_CRYPTO_strndup)} + CRYPTO_strndup := @_CRYPTO_strndup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CRYPTO_strndup_allownil)} + if FuncLoadError then + AFailed.Add('CRYPTO_strndup'); + {$ifend} + end; + + {introduced 1.1.0} + CRYPTO_free := LoadLibFunction(ADllHandle, CRYPTO_free_procname); + FuncLoadError := not assigned(CRYPTO_free); + if FuncLoadError then + begin + {$if not defined(CRYPTO_free_allownil)} + CRYPTO_free := @ERR_CRYPTO_free; + {$ifend} + {$if declared(CRYPTO_free_introduced)} + if LibVersion < CRYPTO_free_introduced then + begin + {$if declared(FC_CRYPTO_free)} + CRYPTO_free := @FC_CRYPTO_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CRYPTO_free_removed)} + if CRYPTO_free_removed <= LibVersion then + begin + {$if declared(_CRYPTO_free)} + CRYPTO_free := @_CRYPTO_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CRYPTO_free_allownil)} + if FuncLoadError then + AFailed.Add('CRYPTO_free'); + {$ifend} + end; + + + CRYPTO_clear_free := LoadLibFunction(ADllHandle, CRYPTO_clear_free_procname); + FuncLoadError := not assigned(CRYPTO_clear_free); + if FuncLoadError then + begin + {$if not defined(CRYPTO_clear_free_allownil)} + CRYPTO_clear_free := @ERR_CRYPTO_clear_free; + {$ifend} + {$if declared(CRYPTO_clear_free_introduced)} + if LibVersion < CRYPTO_clear_free_introduced then + begin + {$if declared(FC_CRYPTO_clear_free)} + CRYPTO_clear_free := @FC_CRYPTO_clear_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CRYPTO_clear_free_removed)} + if CRYPTO_clear_free_removed <= LibVersion then + begin + {$if declared(_CRYPTO_clear_free)} + CRYPTO_clear_free := @_CRYPTO_clear_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CRYPTO_clear_free_allownil)} + if FuncLoadError then + AFailed.Add('CRYPTO_clear_free'); + {$ifend} + end; + + {introduced 1.1.0} + CRYPTO_realloc := LoadLibFunction(ADllHandle, CRYPTO_realloc_procname); + FuncLoadError := not assigned(CRYPTO_realloc); + if FuncLoadError then + begin + {$if not defined(CRYPTO_realloc_allownil)} + CRYPTO_realloc := @ERR_CRYPTO_realloc; + {$ifend} + {$if declared(CRYPTO_realloc_introduced)} + if LibVersion < CRYPTO_realloc_introduced then + begin + {$if declared(FC_CRYPTO_realloc)} + CRYPTO_realloc := @FC_CRYPTO_realloc; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CRYPTO_realloc_removed)} + if CRYPTO_realloc_removed <= LibVersion then + begin + {$if declared(_CRYPTO_realloc)} + CRYPTO_realloc := @_CRYPTO_realloc; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CRYPTO_realloc_allownil)} + if FuncLoadError then + AFailed.Add('CRYPTO_realloc'); + {$ifend} + end; + + + CRYPTO_clear_realloc := LoadLibFunction(ADllHandle, CRYPTO_clear_realloc_procname); + FuncLoadError := not assigned(CRYPTO_clear_realloc); + if FuncLoadError then + begin + {$if not defined(CRYPTO_clear_realloc_allownil)} + CRYPTO_clear_realloc := @ERR_CRYPTO_clear_realloc; + {$ifend} + {$if declared(CRYPTO_clear_realloc_introduced)} + if LibVersion < CRYPTO_clear_realloc_introduced then + begin + {$if declared(FC_CRYPTO_clear_realloc)} + CRYPTO_clear_realloc := @FC_CRYPTO_clear_realloc; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CRYPTO_clear_realloc_removed)} + if CRYPTO_clear_realloc_removed <= LibVersion then + begin + {$if declared(_CRYPTO_clear_realloc)} + CRYPTO_clear_realloc := @_CRYPTO_clear_realloc; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CRYPTO_clear_realloc_allownil)} + if FuncLoadError then + AFailed.Add('CRYPTO_clear_realloc'); + {$ifend} + end; + + {introduced 1.1.0} + CRYPTO_secure_malloc_init := LoadLibFunction(ADllHandle, CRYPTO_secure_malloc_init_procname); + FuncLoadError := not assigned(CRYPTO_secure_malloc_init); + if FuncLoadError then + begin + {$if not defined(CRYPTO_secure_malloc_init_allownil)} + CRYPTO_secure_malloc_init := @ERR_CRYPTO_secure_malloc_init; + {$ifend} + {$if declared(CRYPTO_secure_malloc_init_introduced)} + if LibVersion < CRYPTO_secure_malloc_init_introduced then + begin + {$if declared(FC_CRYPTO_secure_malloc_init)} + CRYPTO_secure_malloc_init := @FC_CRYPTO_secure_malloc_init; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CRYPTO_secure_malloc_init_removed)} + if CRYPTO_secure_malloc_init_removed <= LibVersion then + begin + {$if declared(_CRYPTO_secure_malloc_init)} + CRYPTO_secure_malloc_init := @_CRYPTO_secure_malloc_init; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CRYPTO_secure_malloc_init_allownil)} + if FuncLoadError then + AFailed.Add('CRYPTO_secure_malloc_init'); + {$ifend} + end; + + {introduced 1.1.0} + CRYPTO_secure_malloc_done := LoadLibFunction(ADllHandle, CRYPTO_secure_malloc_done_procname); + FuncLoadError := not assigned(CRYPTO_secure_malloc_done); + if FuncLoadError then + begin + {$if not defined(CRYPTO_secure_malloc_done_allownil)} + CRYPTO_secure_malloc_done := @ERR_CRYPTO_secure_malloc_done; + {$ifend} + {$if declared(CRYPTO_secure_malloc_done_introduced)} + if LibVersion < CRYPTO_secure_malloc_done_introduced then + begin + {$if declared(FC_CRYPTO_secure_malloc_done)} + CRYPTO_secure_malloc_done := @FC_CRYPTO_secure_malloc_done; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CRYPTO_secure_malloc_done_removed)} + if CRYPTO_secure_malloc_done_removed <= LibVersion then + begin + {$if declared(_CRYPTO_secure_malloc_done)} + CRYPTO_secure_malloc_done := @_CRYPTO_secure_malloc_done; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CRYPTO_secure_malloc_done_allownil)} + if FuncLoadError then + AFailed.Add('CRYPTO_secure_malloc_done'); + {$ifend} + end; + + {introduced 1.1.0} + CRYPTO_secure_malloc := LoadLibFunction(ADllHandle, CRYPTO_secure_malloc_procname); + FuncLoadError := not assigned(CRYPTO_secure_malloc); + if FuncLoadError then + begin + {$if not defined(CRYPTO_secure_malloc_allownil)} + CRYPTO_secure_malloc := @ERR_CRYPTO_secure_malloc; + {$ifend} + {$if declared(CRYPTO_secure_malloc_introduced)} + if LibVersion < CRYPTO_secure_malloc_introduced then + begin + {$if declared(FC_CRYPTO_secure_malloc)} + CRYPTO_secure_malloc := @FC_CRYPTO_secure_malloc; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CRYPTO_secure_malloc_removed)} + if CRYPTO_secure_malloc_removed <= LibVersion then + begin + {$if declared(_CRYPTO_secure_malloc)} + CRYPTO_secure_malloc := @_CRYPTO_secure_malloc; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CRYPTO_secure_malloc_allownil)} + if FuncLoadError then + AFailed.Add('CRYPTO_secure_malloc'); + {$ifend} + end; + + {introduced 1.1.0} + CRYPTO_secure_zalloc := LoadLibFunction(ADllHandle, CRYPTO_secure_zalloc_procname); + FuncLoadError := not assigned(CRYPTO_secure_zalloc); + if FuncLoadError then + begin + {$if not defined(CRYPTO_secure_zalloc_allownil)} + CRYPTO_secure_zalloc := @ERR_CRYPTO_secure_zalloc; + {$ifend} + {$if declared(CRYPTO_secure_zalloc_introduced)} + if LibVersion < CRYPTO_secure_zalloc_introduced then + begin + {$if declared(FC_CRYPTO_secure_zalloc)} + CRYPTO_secure_zalloc := @FC_CRYPTO_secure_zalloc; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CRYPTO_secure_zalloc_removed)} + if CRYPTO_secure_zalloc_removed <= LibVersion then + begin + {$if declared(_CRYPTO_secure_zalloc)} + CRYPTO_secure_zalloc := @_CRYPTO_secure_zalloc; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CRYPTO_secure_zalloc_allownil)} + if FuncLoadError then + AFailed.Add('CRYPTO_secure_zalloc'); + {$ifend} + end; + + {introduced 1.1.0} + CRYPTO_secure_free := LoadLibFunction(ADllHandle, CRYPTO_secure_free_procname); + FuncLoadError := not assigned(CRYPTO_secure_free); + if FuncLoadError then + begin + {$if not defined(CRYPTO_secure_free_allownil)} + CRYPTO_secure_free := @ERR_CRYPTO_secure_free; + {$ifend} + {$if declared(CRYPTO_secure_free_introduced)} + if LibVersion < CRYPTO_secure_free_introduced then + begin + {$if declared(FC_CRYPTO_secure_free)} + CRYPTO_secure_free := @FC_CRYPTO_secure_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CRYPTO_secure_free_removed)} + if CRYPTO_secure_free_removed <= LibVersion then + begin + {$if declared(_CRYPTO_secure_free)} + CRYPTO_secure_free := @_CRYPTO_secure_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CRYPTO_secure_free_allownil)} + if FuncLoadError then + AFailed.Add('CRYPTO_secure_free'); + {$ifend} + end; + + {introduced 1.1.0} + CRYPTO_secure_clear_free := LoadLibFunction(ADllHandle, CRYPTO_secure_clear_free_procname); + FuncLoadError := not assigned(CRYPTO_secure_clear_free); + if FuncLoadError then + begin + {$if not defined(CRYPTO_secure_clear_free_allownil)} + CRYPTO_secure_clear_free := @ERR_CRYPTO_secure_clear_free; + {$ifend} + {$if declared(CRYPTO_secure_clear_free_introduced)} + if LibVersion < CRYPTO_secure_clear_free_introduced then + begin + {$if declared(FC_CRYPTO_secure_clear_free)} + CRYPTO_secure_clear_free := @FC_CRYPTO_secure_clear_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CRYPTO_secure_clear_free_removed)} + if CRYPTO_secure_clear_free_removed <= LibVersion then + begin + {$if declared(_CRYPTO_secure_clear_free)} + CRYPTO_secure_clear_free := @_CRYPTO_secure_clear_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CRYPTO_secure_clear_free_allownil)} + if FuncLoadError then + AFailed.Add('CRYPTO_secure_clear_free'); + {$ifend} + end; + + {introduced 1.1.0} + CRYPTO_secure_allocated := LoadLibFunction(ADllHandle, CRYPTO_secure_allocated_procname); + FuncLoadError := not assigned(CRYPTO_secure_allocated); + if FuncLoadError then + begin + {$if not defined(CRYPTO_secure_allocated_allownil)} + CRYPTO_secure_allocated := @ERR_CRYPTO_secure_allocated; + {$ifend} + {$if declared(CRYPTO_secure_allocated_introduced)} + if LibVersion < CRYPTO_secure_allocated_introduced then + begin + {$if declared(FC_CRYPTO_secure_allocated)} + CRYPTO_secure_allocated := @FC_CRYPTO_secure_allocated; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CRYPTO_secure_allocated_removed)} + if CRYPTO_secure_allocated_removed <= LibVersion then + begin + {$if declared(_CRYPTO_secure_allocated)} + CRYPTO_secure_allocated := @_CRYPTO_secure_allocated; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CRYPTO_secure_allocated_allownil)} + if FuncLoadError then + AFailed.Add('CRYPTO_secure_allocated'); + {$ifend} + end; + + {introduced 1.1.0} + CRYPTO_secure_malloc_initialized := LoadLibFunction(ADllHandle, CRYPTO_secure_malloc_initialized_procname); + FuncLoadError := not assigned(CRYPTO_secure_malloc_initialized); + if FuncLoadError then + begin + {$if not defined(CRYPTO_secure_malloc_initialized_allownil)} + CRYPTO_secure_malloc_initialized := @ERR_CRYPTO_secure_malloc_initialized; + {$ifend} + {$if declared(CRYPTO_secure_malloc_initialized_introduced)} + if LibVersion < CRYPTO_secure_malloc_initialized_introduced then + begin + {$if declared(FC_CRYPTO_secure_malloc_initialized)} + CRYPTO_secure_malloc_initialized := @FC_CRYPTO_secure_malloc_initialized; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CRYPTO_secure_malloc_initialized_removed)} + if CRYPTO_secure_malloc_initialized_removed <= LibVersion then + begin + {$if declared(_CRYPTO_secure_malloc_initialized)} + CRYPTO_secure_malloc_initialized := @_CRYPTO_secure_malloc_initialized; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CRYPTO_secure_malloc_initialized_allownil)} + if FuncLoadError then + AFailed.Add('CRYPTO_secure_malloc_initialized'); + {$ifend} + end; + + {introduced 1.1.0} + CRYPTO_secure_actual_size := LoadLibFunction(ADllHandle, CRYPTO_secure_actual_size_procname); + FuncLoadError := not assigned(CRYPTO_secure_actual_size); + if FuncLoadError then + begin + {$if not defined(CRYPTO_secure_actual_size_allownil)} + CRYPTO_secure_actual_size := @ERR_CRYPTO_secure_actual_size; + {$ifend} + {$if declared(CRYPTO_secure_actual_size_introduced)} + if LibVersion < CRYPTO_secure_actual_size_introduced then + begin + {$if declared(FC_CRYPTO_secure_actual_size)} + CRYPTO_secure_actual_size := @FC_CRYPTO_secure_actual_size; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CRYPTO_secure_actual_size_removed)} + if CRYPTO_secure_actual_size_removed <= LibVersion then + begin + {$if declared(_CRYPTO_secure_actual_size)} + CRYPTO_secure_actual_size := @_CRYPTO_secure_actual_size; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CRYPTO_secure_actual_size_allownil)} + if FuncLoadError then + AFailed.Add('CRYPTO_secure_actual_size'); + {$ifend} + end; + + {introduced 1.1.0} + CRYPTO_secure_used := LoadLibFunction(ADllHandle, CRYPTO_secure_used_procname); + FuncLoadError := not assigned(CRYPTO_secure_used); + if FuncLoadError then + begin + {$if not defined(CRYPTO_secure_used_allownil)} + CRYPTO_secure_used := @ERR_CRYPTO_secure_used; + {$ifend} + {$if declared(CRYPTO_secure_used_introduced)} + if LibVersion < CRYPTO_secure_used_introduced then + begin + {$if declared(FC_CRYPTO_secure_used)} + CRYPTO_secure_used := @FC_CRYPTO_secure_used; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CRYPTO_secure_used_removed)} + if CRYPTO_secure_used_removed <= LibVersion then + begin + {$if declared(_CRYPTO_secure_used)} + CRYPTO_secure_used := @_CRYPTO_secure_used; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CRYPTO_secure_used_allownil)} + if FuncLoadError then + AFailed.Add('CRYPTO_secure_used'); + {$ifend} + end; + + {introduced 1.1.0} + OPENSSL_cleanse := LoadLibFunction(ADllHandle, OPENSSL_cleanse_procname); + FuncLoadError := not assigned(OPENSSL_cleanse); + if FuncLoadError then + begin + {$if not defined(OPENSSL_cleanse_allownil)} + OPENSSL_cleanse := @ERR_OPENSSL_cleanse; + {$ifend} + {$if declared(OPENSSL_cleanse_introduced)} + if LibVersion < OPENSSL_cleanse_introduced then + begin + {$if declared(FC_OPENSSL_cleanse)} + OPENSSL_cleanse := @FC_OPENSSL_cleanse; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OPENSSL_cleanse_removed)} + if OPENSSL_cleanse_removed <= LibVersion then + begin + {$if declared(_OPENSSL_cleanse)} + OPENSSL_cleanse := @_OPENSSL_cleanse; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OPENSSL_cleanse_allownil)} + if FuncLoadError then + AFailed.Add('OPENSSL_cleanse'); + {$ifend} + end; + + + OPENSSL_isservice := LoadLibFunction(ADllHandle, OPENSSL_isservice_procname); + FuncLoadError := not assigned(OPENSSL_isservice); + if FuncLoadError then + begin + {$if not defined(OPENSSL_isservice_allownil)} + OPENSSL_isservice := @ERR_OPENSSL_isservice; + {$ifend} + {$if declared(OPENSSL_isservice_introduced)} + if LibVersion < OPENSSL_isservice_introduced then + begin + {$if declared(FC_OPENSSL_isservice)} + OPENSSL_isservice := @FC_OPENSSL_isservice; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OPENSSL_isservice_removed)} + if OPENSSL_isservice_removed <= LibVersion then + begin + {$if declared(_OPENSSL_isservice)} + OPENSSL_isservice := @_OPENSSL_isservice; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OPENSSL_isservice_allownil)} + if FuncLoadError then + AFailed.Add('OPENSSL_isservice'); + {$ifend} + end; + + + FIPS_mode := LoadLibFunction(ADllHandle, FIPS_mode_procname); + FuncLoadError := not assigned(FIPS_mode); + if FuncLoadError then + begin + {$if not defined(FIPS_mode_allownil)} + FIPS_mode := @ERR_FIPS_mode; + {$ifend} + {$if declared(FIPS_mode_introduced)} + if LibVersion < FIPS_mode_introduced then + begin + {$if declared(FC_FIPS_mode)} + FIPS_mode := @FC_FIPS_mode; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(FIPS_mode_removed)} + if FIPS_mode_removed <= LibVersion then + begin + {$if declared(_FIPS_mode)} + FIPS_mode := @_FIPS_mode; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(FIPS_mode_allownil)} + if FuncLoadError then + AFailed.Add('FIPS_mode'); + {$ifend} + end; + + + FIPS_mode_set := LoadLibFunction(ADllHandle, FIPS_mode_set_procname); + FuncLoadError := not assigned(FIPS_mode_set); + if FuncLoadError then + begin + {$if not defined(FIPS_mode_set_allownil)} + FIPS_mode_set := @ERR_FIPS_mode_set; + {$ifend} + {$if declared(FIPS_mode_set_introduced)} + if LibVersion < FIPS_mode_set_introduced then + begin + {$if declared(FC_FIPS_mode_set)} + FIPS_mode_set := @FC_FIPS_mode_set; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(FIPS_mode_set_removed)} + if FIPS_mode_set_removed <= LibVersion then + begin + {$if declared(_FIPS_mode_set)} + FIPS_mode_set := @_FIPS_mode_set; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(FIPS_mode_set_allownil)} + if FuncLoadError then + AFailed.Add('FIPS_mode_set'); + {$ifend} + end; + + + OPENSSL_init := LoadLibFunction(ADllHandle, OPENSSL_init_procname); + FuncLoadError := not assigned(OPENSSL_init); + if FuncLoadError then + begin + {$if not defined(OPENSSL_init_allownil)} + OPENSSL_init := @ERR_OPENSSL_init; + {$ifend} + {$if declared(OPENSSL_init_introduced)} + if LibVersion < OPENSSL_init_introduced then + begin + {$if declared(FC_OPENSSL_init)} + OPENSSL_init := @FC_OPENSSL_init; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OPENSSL_init_removed)} + if OPENSSL_init_removed <= LibVersion then + begin + {$if declared(_OPENSSL_init)} + OPENSSL_init := @_OPENSSL_init; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OPENSSL_init_allownil)} + if FuncLoadError then + AFailed.Add('OPENSSL_init'); + {$ifend} + end; + + + CRYPTO_memcmp := LoadLibFunction(ADllHandle, CRYPTO_memcmp_procname); + FuncLoadError := not assigned(CRYPTO_memcmp); + if FuncLoadError then + begin + {$if not defined(CRYPTO_memcmp_allownil)} + CRYPTO_memcmp := @ERR_CRYPTO_memcmp; + {$ifend} + {$if declared(CRYPTO_memcmp_introduced)} + if LibVersion < CRYPTO_memcmp_introduced then + begin + {$if declared(FC_CRYPTO_memcmp)} + CRYPTO_memcmp := @FC_CRYPTO_memcmp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CRYPTO_memcmp_removed)} + if CRYPTO_memcmp_removed <= LibVersion then + begin + {$if declared(_CRYPTO_memcmp)} + CRYPTO_memcmp := @_CRYPTO_memcmp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CRYPTO_memcmp_allownil)} + if FuncLoadError then + AFailed.Add('CRYPTO_memcmp'); + {$ifend} + end; + + + OPENSSL_cleanup := LoadLibFunction(ADllHandle, OPENSSL_cleanup_procname); + FuncLoadError := not assigned(OPENSSL_cleanup); + if FuncLoadError then + begin + {$if not defined(OPENSSL_cleanup_allownil)} + OPENSSL_cleanup := @ERR_OPENSSL_cleanup; + {$ifend} + {$if declared(OPENSSL_cleanup_introduced)} + if LibVersion < OPENSSL_cleanup_introduced then + begin + {$if declared(FC_OPENSSL_cleanup)} + OPENSSL_cleanup := @FC_OPENSSL_cleanup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OPENSSL_cleanup_removed)} + if OPENSSL_cleanup_removed <= LibVersion then + begin + {$if declared(_OPENSSL_cleanup)} + OPENSSL_cleanup := @_OPENSSL_cleanup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OPENSSL_cleanup_allownil)} + if FuncLoadError then + AFailed.Add('OPENSSL_cleanup'); + {$ifend} + end; + + {introduced 1.1.0} + OPENSSL_init_crypto := LoadLibFunction(ADllHandle, OPENSSL_init_crypto_procname); + FuncLoadError := not assigned(OPENSSL_init_crypto); + if FuncLoadError then + begin + {$if not defined(OPENSSL_init_crypto_allownil)} + OPENSSL_init_crypto := @ERR_OPENSSL_init_crypto; + {$ifend} + {$if declared(OPENSSL_init_crypto_introduced)} + if LibVersion < OPENSSL_init_crypto_introduced then + begin + {$if declared(FC_OPENSSL_init_crypto)} + OPENSSL_init_crypto := @FC_OPENSSL_init_crypto; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OPENSSL_init_crypto_removed)} + if OPENSSL_init_crypto_removed <= LibVersion then + begin + {$if declared(_OPENSSL_init_crypto)} + OPENSSL_init_crypto := @_OPENSSL_init_crypto; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OPENSSL_init_crypto_allownil)} + if FuncLoadError then + AFailed.Add('OPENSSL_init_crypto'); + {$ifend} + end; + + {introduced 1.1.0} + OPENSSL_thread_stop := LoadLibFunction(ADllHandle, OPENSSL_thread_stop_procname); + FuncLoadError := not assigned(OPENSSL_thread_stop); + if FuncLoadError then + begin + {$if not defined(OPENSSL_thread_stop_allownil)} + OPENSSL_thread_stop := @ERR_OPENSSL_thread_stop; + {$ifend} + {$if declared(OPENSSL_thread_stop_introduced)} + if LibVersion < OPENSSL_thread_stop_introduced then + begin + {$if declared(FC_OPENSSL_thread_stop)} + OPENSSL_thread_stop := @FC_OPENSSL_thread_stop; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OPENSSL_thread_stop_removed)} + if OPENSSL_thread_stop_removed <= LibVersion then + begin + {$if declared(_OPENSSL_thread_stop)} + OPENSSL_thread_stop := @_OPENSSL_thread_stop; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OPENSSL_thread_stop_allownil)} + if FuncLoadError then + AFailed.Add('OPENSSL_thread_stop'); + {$ifend} + end; + + {introduced 1.1.0} + OPENSSL_INIT_new := LoadLibFunction(ADllHandle, OPENSSL_INIT_new_procname); + FuncLoadError := not assigned(OPENSSL_INIT_new); + if FuncLoadError then + begin + {$if not defined(OPENSSL_INIT_new_allownil)} + OPENSSL_INIT_new := @ERR_OPENSSL_INIT_new; + {$ifend} + {$if declared(OPENSSL_INIT_new_introduced)} + if LibVersion < OPENSSL_INIT_new_introduced then + begin + {$if declared(FC_OPENSSL_INIT_new)} + OPENSSL_INIT_new := @FC_OPENSSL_INIT_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OPENSSL_INIT_new_removed)} + if OPENSSL_INIT_new_removed <= LibVersion then + begin + {$if declared(_OPENSSL_INIT_new)} + OPENSSL_INIT_new := @_OPENSSL_INIT_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OPENSSL_INIT_new_allownil)} + if FuncLoadError then + AFailed.Add('OPENSSL_INIT_new'); + {$ifend} + end; + + {introduced 1.1.0} + OPENSSL_INIT_free := LoadLibFunction(ADllHandle, OPENSSL_INIT_free_procname); + FuncLoadError := not assigned(OPENSSL_INIT_free); + if FuncLoadError then + begin + {$if not defined(OPENSSL_INIT_free_allownil)} + OPENSSL_INIT_free := @ERR_OPENSSL_INIT_free; + {$ifend} + {$if declared(OPENSSL_INIT_free_introduced)} + if LibVersion < OPENSSL_INIT_free_introduced then + begin + {$if declared(FC_OPENSSL_INIT_free)} + OPENSSL_INIT_free := @FC_OPENSSL_INIT_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OPENSSL_INIT_free_removed)} + if OPENSSL_INIT_free_removed <= LibVersion then + begin + {$if declared(_OPENSSL_INIT_free)} + OPENSSL_INIT_free := @_OPENSSL_INIT_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OPENSSL_INIT_free_allownil)} + if FuncLoadError then + AFailed.Add('OPENSSL_INIT_free'); + {$ifend} + end; + + {introduced 1.1.0} + CRYPTO_THREAD_run_once := LoadLibFunction(ADllHandle, CRYPTO_THREAD_run_once_procname); + FuncLoadError := not assigned(CRYPTO_THREAD_run_once); + if FuncLoadError then + begin + {$if not defined(CRYPTO_THREAD_run_once_allownil)} + CRYPTO_THREAD_run_once := @ERR_CRYPTO_THREAD_run_once; + {$ifend} + {$if declared(CRYPTO_THREAD_run_once_introduced)} + if LibVersion < CRYPTO_THREAD_run_once_introduced then + begin + {$if declared(FC_CRYPTO_THREAD_run_once)} + CRYPTO_THREAD_run_once := @FC_CRYPTO_THREAD_run_once; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CRYPTO_THREAD_run_once_removed)} + if CRYPTO_THREAD_run_once_removed <= LibVersion then + begin + {$if declared(_CRYPTO_THREAD_run_once)} + CRYPTO_THREAD_run_once := @_CRYPTO_THREAD_run_once; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CRYPTO_THREAD_run_once_allownil)} + if FuncLoadError then + AFailed.Add('CRYPTO_THREAD_run_once'); + {$ifend} + end; + + {introduced 1.1.0} + CRYPTO_THREAD_get_local := LoadLibFunction(ADllHandle, CRYPTO_THREAD_get_local_procname); + FuncLoadError := not assigned(CRYPTO_THREAD_get_local); + if FuncLoadError then + begin + {$if not defined(CRYPTO_THREAD_get_local_allownil)} + CRYPTO_THREAD_get_local := @ERR_CRYPTO_THREAD_get_local; + {$ifend} + {$if declared(CRYPTO_THREAD_get_local_introduced)} + if LibVersion < CRYPTO_THREAD_get_local_introduced then + begin + {$if declared(FC_CRYPTO_THREAD_get_local)} + CRYPTO_THREAD_get_local := @FC_CRYPTO_THREAD_get_local; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CRYPTO_THREAD_get_local_removed)} + if CRYPTO_THREAD_get_local_removed <= LibVersion then + begin + {$if declared(_CRYPTO_THREAD_get_local)} + CRYPTO_THREAD_get_local := @_CRYPTO_THREAD_get_local; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CRYPTO_THREAD_get_local_allownil)} + if FuncLoadError then + AFailed.Add('CRYPTO_THREAD_get_local'); + {$ifend} + end; + + {introduced 1.1.0} + CRYPTO_THREAD_set_local := LoadLibFunction(ADllHandle, CRYPTO_THREAD_set_local_procname); + FuncLoadError := not assigned(CRYPTO_THREAD_set_local); + if FuncLoadError then + begin + {$if not defined(CRYPTO_THREAD_set_local_allownil)} + CRYPTO_THREAD_set_local := @ERR_CRYPTO_THREAD_set_local; + {$ifend} + {$if declared(CRYPTO_THREAD_set_local_introduced)} + if LibVersion < CRYPTO_THREAD_set_local_introduced then + begin + {$if declared(FC_CRYPTO_THREAD_set_local)} + CRYPTO_THREAD_set_local := @FC_CRYPTO_THREAD_set_local; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CRYPTO_THREAD_set_local_removed)} + if CRYPTO_THREAD_set_local_removed <= LibVersion then + begin + {$if declared(_CRYPTO_THREAD_set_local)} + CRYPTO_THREAD_set_local := @_CRYPTO_THREAD_set_local; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CRYPTO_THREAD_set_local_allownil)} + if FuncLoadError then + AFailed.Add('CRYPTO_THREAD_set_local'); + {$ifend} + end; + + {introduced 1.1.0} + CRYPTO_THREAD_cleanup_local := LoadLibFunction(ADllHandle, CRYPTO_THREAD_cleanup_local_procname); + FuncLoadError := not assigned(CRYPTO_THREAD_cleanup_local); + if FuncLoadError then + begin + {$if not defined(CRYPTO_THREAD_cleanup_local_allownil)} + CRYPTO_THREAD_cleanup_local := @ERR_CRYPTO_THREAD_cleanup_local; + {$ifend} + {$if declared(CRYPTO_THREAD_cleanup_local_introduced)} + if LibVersion < CRYPTO_THREAD_cleanup_local_introduced then + begin + {$if declared(FC_CRYPTO_THREAD_cleanup_local)} + CRYPTO_THREAD_cleanup_local := @FC_CRYPTO_THREAD_cleanup_local; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CRYPTO_THREAD_cleanup_local_removed)} + if CRYPTO_THREAD_cleanup_local_removed <= LibVersion then + begin + {$if declared(_CRYPTO_THREAD_cleanup_local)} + CRYPTO_THREAD_cleanup_local := @_CRYPTO_THREAD_cleanup_local; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CRYPTO_THREAD_cleanup_local_allownil)} + if FuncLoadError then + AFailed.Add('CRYPTO_THREAD_cleanup_local'); + {$ifend} + end; + + {introduced 1.1.0} + CRYPTO_THREAD_get_current_id := LoadLibFunction(ADllHandle, CRYPTO_THREAD_get_current_id_procname); + FuncLoadError := not assigned(CRYPTO_THREAD_get_current_id); + if FuncLoadError then + begin + {$if not defined(CRYPTO_THREAD_get_current_id_allownil)} + CRYPTO_THREAD_get_current_id := @ERR_CRYPTO_THREAD_get_current_id; + {$ifend} + {$if declared(CRYPTO_THREAD_get_current_id_introduced)} + if LibVersion < CRYPTO_THREAD_get_current_id_introduced then + begin + {$if declared(FC_CRYPTO_THREAD_get_current_id)} + CRYPTO_THREAD_get_current_id := @FC_CRYPTO_THREAD_get_current_id; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CRYPTO_THREAD_get_current_id_removed)} + if CRYPTO_THREAD_get_current_id_removed <= LibVersion then + begin + {$if declared(_CRYPTO_THREAD_get_current_id)} + CRYPTO_THREAD_get_current_id := @_CRYPTO_THREAD_get_current_id; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CRYPTO_THREAD_get_current_id_allownil)} + if FuncLoadError then + AFailed.Add('CRYPTO_THREAD_get_current_id'); + {$ifend} + end; + + {introduced 1.1.0} + CRYPTO_THREAD_compare_id := LoadLibFunction(ADllHandle, CRYPTO_THREAD_compare_id_procname); + FuncLoadError := not assigned(CRYPTO_THREAD_compare_id); + if FuncLoadError then + begin + {$if not defined(CRYPTO_THREAD_compare_id_allownil)} + CRYPTO_THREAD_compare_id := @ERR_CRYPTO_THREAD_compare_id; + {$ifend} + {$if declared(CRYPTO_THREAD_compare_id_introduced)} + if LibVersion < CRYPTO_THREAD_compare_id_introduced then + begin + {$if declared(FC_CRYPTO_THREAD_compare_id)} + CRYPTO_THREAD_compare_id := @FC_CRYPTO_THREAD_compare_id; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(CRYPTO_THREAD_compare_id_removed)} + if CRYPTO_THREAD_compare_id_removed <= LibVersion then + begin + {$if declared(_CRYPTO_THREAD_compare_id)} + CRYPTO_THREAD_compare_id := @_CRYPTO_THREAD_compare_id; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(CRYPTO_THREAD_compare_id_allownil)} + if FuncLoadError then + AFailed.Add('CRYPTO_THREAD_compare_id'); + {$ifend} + end; + + {introduced 1.1.0} + SSLeay_version := LoadLibFunction(ADllHandle, SSLeay_version_procname); + FuncLoadError := not assigned(SSLeay_version); + if FuncLoadError then + begin + {$if not defined(SSLeay_version_allownil)} + SSLeay_version := @ERR_SSLeay_version; + {$ifend} + {$if declared(SSLeay_version_introduced)} + if LibVersion < SSLeay_version_introduced then + begin + {$if declared(FC_SSLeay_version)} + SSLeay_version := @FC_SSLeay_version; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSLeay_version_removed)} + if SSLeay_version_removed <= LibVersion then + begin + {$if declared(_SSLeay_version)} + SSLeay_version := @_SSLeay_version; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSLeay_version_allownil)} + if FuncLoadError then + AFailed.Add('SSLeay_version'); + {$ifend} + end; + + + SSLeay := LoadLibFunction(ADllHandle, SSLeay_procname); + FuncLoadError := not assigned(SSLeay); + if FuncLoadError then + begin + {$if not defined(SSLeay_allownil)} + SSLeay := @ERR_SSLeay; + {$ifend} + {$if declared(SSLeay_introduced)} + if LibVersion < SSLeay_introduced then + begin + {$if declared(FC_SSLeay)} + SSLeay := @FC_SSLeay; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSLeay_removed)} + if SSLeay_removed <= LibVersion then + begin + {$if declared(_SSLeay)} + SSLeay := @_SSLeay; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSLeay_allownil)} + if FuncLoadError then + AFailed.Add('SSLeay'); + {$ifend} + end; + + +end; + +procedure Unload; +begin + OPENSSL_malloc := nil; {removed 1.0.0} + OPENSSL_zalloc := nil; {removed 1.0.0} + OPENSSL_realloc := nil; {removed 1.0.0} + OPENSSL_clear_realloc := nil; {removed 1.0.0} + OPENSSL_clear_free := nil; {removed 1.0.0} + OPENSSL_free := nil; {removed 1.0.0} + OPENSSL_memdup := nil; {removed 1.0.0} + OPENSSL_strdup := nil; {removed 1.0.0} + OPENSSL_strndup := nil; {removed 1.0.0} + OPENSSL_secure_malloc := nil; {removed 1.0.0} + OPENSSL_secure_zalloc := nil; {removed 1.0.0} + OPENSSL_secure_free := nil; {removed 1.0.0} + OPENSSL_secure_clear_free := nil; {removed 1.0.0} + OPENSSL_secure_actual_size := nil; {removed 1.0.0} + CRYPTO_THREAD_lock_new := nil; {introduced 1.1.0} + CRYPTO_THREAD_read_lock := nil; {introduced 1.1.0} + CRYPTO_THREAD_write_lock := nil; {introduced 1.1.0} + CRYPTO_THREAD_unlock := nil; {introduced 1.1.0} + CRYPTO_THREAD_lock_free := nil; {introduced 1.1.0} + CRYPTO_atomic_add := nil; {introduced 1.1.0} + CRYPTO_mem_ctrl := nil; {removed 3.0.0} + OPENSSL_strlcpy := nil; {introduced 1.1.0} + OPENSSL_strlcat := nil; {introduced 1.1.0} + OPENSSL_strnlen := nil; {introduced 1.1.0} + OPENSSL_buf2hexstr := nil; {introduced 1.1.0} + OPENSSL_hexstr2buf := nil; {introduced 1.1.0} + OPENSSL_hexchar2int := nil; {introduced 1.1.0} + OpenSSL_version_num := nil; {introduced 1.1.0} + OpenSSL_version := nil; {introduced 1.1.0} + OPENSSL_issetugid := nil; + CRYPTO_new_ex_data := nil; + CRYPTO_dup_ex_data := nil; + CRYPTO_free_ex_data := nil; + CRYPTO_set_ex_data := nil; + CRYPTO_get_ex_data := nil; + CRYPTO_num_locks := nil; {removed 1.1.0} + CRYPTO_set_locking_callback := nil; {removed 1.1.0} + CRYPTO_THREADID_set_numeric := nil; {removed 1.1.0} + CRYPTO_THREADID_set_callback := nil; {removed 1.1.0} + CRYPTO_set_id_callback := nil; {removed 1.1.0} + CRYPTO_set_mem_functions := nil; + CRYPTO_set_mem_debug := nil; {introduced 1.1.0 removed 3.0.0} + CRYPTO_malloc := nil; + CRYPTO_zalloc := nil; {introduced 1.1.0} + CRYPTO_memdup := nil; {introduced 1.1.0} + CRYPTO_strdup := nil; + CRYPTO_strndup := nil; {introduced 1.1.0} + CRYPTO_free := nil; + CRYPTO_clear_free := nil; {introduced 1.1.0} + CRYPTO_realloc := nil; + CRYPTO_clear_realloc := nil; {introduced 1.1.0} + CRYPTO_secure_malloc_init := nil; {introduced 1.1.0} + CRYPTO_secure_malloc_done := nil; {introduced 1.1.0} + CRYPTO_secure_malloc := nil; {introduced 1.1.0} + CRYPTO_secure_zalloc := nil; {introduced 1.1.0} + CRYPTO_secure_free := nil; {introduced 1.1.0} + CRYPTO_secure_clear_free := nil; {introduced 1.1.0} + CRYPTO_secure_allocated := nil; {introduced 1.1.0} + CRYPTO_secure_malloc_initialized := nil; {introduced 1.1.0} + CRYPTO_secure_actual_size := nil; {introduced 1.1.0} + CRYPTO_secure_used := nil; {introduced 1.1.0} + OPENSSL_cleanse := nil; + OPENSSL_isservice := nil; + FIPS_mode := nil; {removed 3.0.0} + FIPS_mode_set := nil; {removed 3.0.0} + OPENSSL_init := nil; + CRYPTO_memcmp := nil; + OPENSSL_cleanup := nil; {introduced 1.1.0} + OPENSSL_init_crypto := nil; {introduced 1.1.0} + OPENSSL_thread_stop := nil; {introduced 1.1.0} + OPENSSL_INIT_new := nil; {introduced 1.1.0} + OPENSSL_INIT_free := nil; {introduced 1.1.0} + CRYPTO_THREAD_run_once := nil; {introduced 1.1.0} + CRYPTO_THREAD_get_local := nil; {introduced 1.1.0} + CRYPTO_THREAD_set_local := nil; {introduced 1.1.0} + CRYPTO_THREAD_cleanup_local := nil; {introduced 1.1.0} + CRYPTO_THREAD_get_current_id := nil; {introduced 1.1.0} + CRYPTO_THREAD_compare_id := nil; {introduced 1.1.0} + SSLeay_version := nil; {removed 1.1.0} + SSLeay := nil; {removed 1.1.0} +end; +{$ELSE} +function OPENSSL_malloc(num: TIdC_SIZET): Pointer; +begin + Result := CRYPTO_malloc(num, {$IFNDEF FPC}''{$ELSE}{$I %FILE%}{$ENDIF}, {$IFNDEF FPC}-1{$ELSE}{$I %LINENUM%}{$ENDIF}); +end; + +//# define OPENSSL_zalloc(num) CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE) +function OPENSSL_zalloc(num: TIdC_SIZET): Pointer; +begin + Result := CRYPTO_zalloc(num, {$IFNDEF FPC}''{$ELSE}{$I %FILE%}{$ENDIF}, {$IFNDEF FPC}-1{$ELSE}{$I %LINENUM%}{$ENDIF}); +end; + +//# define OPENSSL_realloc(addr, num) CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE) +function OPENSSL_realloc(addr: Pointer; num: TIdC_SIZET): Pointer; +begin + Result := CRYPTO_realloc(addr, num, {$IFNDEF FPC}''{$ELSE}{$I %FILE%}{$ENDIF}, {$IFNDEF FPC}-1{$ELSE}{$I %LINENUM%}{$ENDIF}); +end; + +//# define OPENSSL_clear_realloc(addr, old_num, num) CRYPTO_clear_realloc(addr, old_num, num, OPENSSL_FILE, OPENSSL_LINE) +function OPENSSL_clear_realloc(addr: Pointer; old_num: TIdC_SIZET; num: TIdC_SIZET): Pointer; +begin + Result := CRYPTO_clear_realloc(addr, old_num, num, {$IFNDEF FPC}''{$ELSE}{$I %FILE%}{$ENDIF}, {$IFNDEF FPC}-1{$ELSE}{$I %LINENUM%}{$ENDIF}); +end; + +//# define OPENSSL_clear_free(addr, num) CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE) +procedure OPENSSL_clear_free(addr: Pointer; num: TIdC_SIZET); +begin + CRYPTO_clear_free(addr, num, {$IFNDEF FPC}''{$ELSE}{$I %FILE%}{$ENDIF}, {$IFNDEF FPC}-1{$ELSE}{$I %LINENUM%}{$ENDIF}); +end; + +//# define OPENSSL_free(addr) CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE) +procedure OPENSSL_free(addr: Pointer); +begin + CRYPTO_free(addr, {$IFNDEF FPC}''{$ELSE}{$I %FILE%}{$ENDIF}, {$IFNDEF FPC}-1{$ELSE}{$I %LINENUM%}{$ENDIF}); +end; + +//# define OPENSSL_memdup(str, s) CRYPTO_memdup((str), s, OPENSSL_FILE, OPENSSL_LINE) +function OPENSSL_memdup(const str: Pointer; s: TIdC_SIZET): Pointer; +begin + Result := CRYPTO_memdup(str, s, {$IFNDEF FPC}''{$ELSE}{$I %FILE%}{$ENDIF}, {$IFNDEF FPC}-1{$ELSE}{$I %LINENUM%}{$ENDIF}); +end; + +//# define OPENSSL_strdup(str) CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE) +function OPENSSL_strdup(const str: PIdAnsiChar): PIdAnsiChar; +begin + Result := CRYPTO_strdup(str, {$IFNDEF FPC}''{$ELSE}{$I %FILE%}{$ENDIF}, {$IFNDEF FPC}-1{$ELSE}{$I %LINENUM%}{$ENDIF}); +end; + +//# define OPENSSL_strndup(str, n) CRYPTO_strndup(str, n, OPENSSL_FILE, OPENSSL_LINE) +function OPENSSL_strndup(const str: PIdAnsiChar; n: TIdC_SIZET): PIdAnsiChar; +begin + Result := CRYPTO_strndup(str, n, {$IFNDEF FPC}''{$ELSE}{$I %FILE%}{$ENDIF}, {$IFNDEF FPC}-1{$ELSE}{$I %LINENUM%}{$ENDIF}); +end; + +//# define OPENSSL_secure_malloc(num) CRYPTO_secure_malloc(num, OPENSSL_FILE, OPENSSL_LINE) +function OPENSSL_secure_malloc(num: TIdC_SIZET): Pointer; +begin + Result := CRYPTO_secure_malloc(num, {$IFNDEF FPC}''{$ELSE}{$I %FILE%}{$ENDIF}, {$IFNDEF FPC}-1{$ELSE}{$I %LINENUM%}{$ENDIF}); +end; + +//# define OPENSSL_secure_zalloc(num) CRYPTO_secure_zalloc(num, OPENSSL_FILE, OPENSSL_LINE) +function OPENSSL_secure_zalloc(num: TIdC_SIZET): Pointer; +begin + Result := CRYPTO_secure_zalloc(num, {$IFNDEF FPC}''{$ELSE}{$I %FILE%}{$ENDIF}, {$IFNDEF FPC}-1{$ELSE}{$I %LINENUM%}{$ENDIF}); +end; + +//# define OPENSSL_secure_free(addr) CRYPTO_secure_free(addr, OPENSSL_FILE, OPENSSL_LINE) +procedure OPENSSL_secure_free(addr: Pointer); +begin + CRYPTO_secure_free(addr, {$IFNDEF FPC}''{$ELSE}{$I %FILE%}{$ENDIF}, {$IFNDEF FPC}-1{$ELSE}{$I %LINENUM%}{$ENDIF}); +end; + +//# define OPENSSL_secure_clear_free(addr, num) CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE) +procedure OPENSSL_secure_clear_free(addr: Pointer; num: TIdC_SIZET); +begin + CRYPTO_secure_clear_free(addr, num, {$IFNDEF FPC}''{$ELSE}{$I %FILE%}{$ENDIF}, {$IFNDEF FPC}-1{$ELSE}{$I %LINENUM%}{$ENDIF}); +end; + +//# define OPENSSL_secure_actual_size(ptr) CRYPTO_secure_actual_size(ptr) +function OPENSSL_secure_actual_size(ptr: Pointer): TIdC_SIZET; +begin + Result := CRYPTO_secure_actual_size(ptr); +end; + +function CRYPTO_num_locks: TIdC_INT; +begin + Result := 0; +end; + +procedure CRYPTO_set_locking_callback; +begin +end; + +procedure CRYPTO_set_id_callback(func: TIdSslIdCallback); +begin +end; + +function SSLeay_version(type_ : TIdC_INT) : PIdAnsiChar; +begin + Result := OpenSSL_version(type_); +end; + +function SSLeay: TIdC_ULONG; +begin + Result := OpenSSL_version_num(); +end; + +procedure CRYPTO_THREADID_set_numeric(id : PCRYPTO_THREADID; val: TIdC_ULONG); +begin +end; + +procedure CRYPTO_THREADID_set_callback(threadid_func: Tthreadid_func); +begin +end; + +function FIPS_mode: TIdC_INT; +begin + Result := OSSL_PROVIDER_available(nil,PAnsiChar(AnsiString('fips'))); +end; + +var fips_provider: POSSL_PROVIDER; + base_provider: POSSL_PROVIDER; + +function FIPS_mode_set(r: TIdC_INT): TIdC_INT; +begin + if r = 0 then + begin + if base_provider <> nil then + begin + OSSL_PROVIDER_unload(base_provider); + base_provider := nil; + end; + + if fips_provider <> nil then + begin + OSSL_PROVIDER_unload(fips_provider); + fips_provider := nil; + end; + Result := 1; + end + else + begin + Result := 0; + fips_provider := OSSL_PROVIDER_load(nil, PAnsiChar(AnsiString('fips'))); + if fips_provider = nil then + Exit; + base_provider := OSSL_PROVIDER_load(nil, PAnsiChar(AnsiString('base'))); + if base_provider = nil then + begin + OSSL_PROVIDER_unload(fips_provider); + fips_provider := nil; + Exit; + end; + Result := 1; + end; +end; + + + +{$ENDIF} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +initialization + Register_SSLLoader(@Load,'LibCrypto'); + Register_SSLUnloader(@Unload); +{$ENDIF} +end. diff --git a/IdOpenSSLHeaders_cryptoerr.pas b/IdOpenSSLHeaders_cryptoerr.pas new file mode 100644 index 0000000..3490f05 --- /dev/null +++ b/IdOpenSSLHeaders_cryptoerr.pas @@ -0,0 +1,174 @@ + (* This unit was generated using the script genOpenSSLHdrs.sh from the source file IdOpenSSLHeaders_cryptoerr.h2pas + It should not be modified directly. All changes should be made to IdOpenSSLHeaders_cryptoerr.h2pas + and this file regenerated. IdOpenSSLHeaders_cryptoerr.h2pas is distributed with the full Indy + Distribution. + *) + +{$i IdCompilerDefines.inc} +{$i IdSSLOpenSSLDefines.inc} +{$IFNDEF USE_OPENSSL} + { error Should not compile if USE_OPENSSL is not defined!!!} +{$ENDIF} +{******************************************************************************} +{ } +{ Indy (Internet Direct) - Internet Protocols Simplified } +{ } +{ https://www.indyproject.org/ } +{ https://gitter.im/IndySockets/Indy } +{ } +{******************************************************************************} +{ } +{ This file is part of the Indy (Internet Direct) project, and is offered } +{ under the dual-licensing agreement described on the Indy website. } +{ (https://www.indyproject.org/license/) } +{ } +{ Copyright: } +{ (c) 1993-2020, Chad Z. Hower and the Indy Pit Crew. All rights reserved. } +{ } +{******************************************************************************} +{ } +{ } +{******************************************************************************} + +unit IdOpenSSLHeaders_cryptoerr; + +interface + +// Headers for OpenSSL 1.1.1 +// cryptoerr.h + + +uses + IdCTypes, + IdGlobal, + IdSSLOpenSSLConsts; + +const + (* + * CRYPTO function codes. + *) + CRYPTO_F_CMAC_CTX_NEW = 120; + CRYPTO_F_CRYPTO_DUP_EX_DATA = 110; + CRYPTO_F_CRYPTO_FREE_EX_DATA = 111; + CRYPTO_F_CRYPTO_GET_EX_NEW_INDEX = 100; + CRYPTO_F_CRYPTO_MEMDUP = 115; + CRYPTO_F_CRYPTO_NEW_EX_DATA = 112; + CRYPTO_F_CRYPTO_OCB128_COPY_CTX = 121; + CRYPTO_F_CRYPTO_OCB128_INIT = 122; + CRYPTO_F_CRYPTO_SET_EX_DATA = 102; + CRYPTO_F_FIPS_MODE_SET = 109; + CRYPTO_F_GET_AND_LOCK = 113; + CRYPTO_F_OPENSSL_ATEXIT = 114; + CRYPTO_F_OPENSSL_BUF2HEXSTR = 117; + CRYPTO_F_OPENSSL_FOPEN = 119; + CRYPTO_F_OPENSSL_HEXSTR2BUF = 118; + CRYPTO_F_OPENSSL_INIT_CRYPTO = 116; + CRYPTO_F_OPENSSL_LH_NEW = 126; + CRYPTO_F_OPENSSL_SK_DEEP_COPY = 127; + CRYPTO_F_OPENSSL_SK_DUP = 128; + CRYPTO_F_PKEY_HMAC_INIT = 123; + CRYPTO_F_PKEY_POLY1305_INIT = 124; + CRYPTO_F_PKEY_SIPHASH_INIT = 125; + CRYPTO_F_SK_RESERVE = 129; + + (* + * CRYPTO reason codes. + *) + CRYPTO_R_FIPS_MODE_NOT_SUPPORTED = 101; + CRYPTO_R_ILLEGAL_HEX_DIGIT = 102; + CRYPTO_R_ODD_NUMBER_OF_DIGITS = 103; + + { The EXTERNALSYM directive is ignored by FPC, however, it is used by Delphi as follows: + + The EXTERNALSYM directive prevents the specified Delphi symbol from appearing in header + files generated for C++. } + + {$EXTERNALSYM ERR_load_CRYPTO_strings} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +var + ERR_load_CRYPTO_strings: function : TIdC_INT; cdecl = nil; + +{$ELSE} + function ERR_load_CRYPTO_strings: TIdC_INT cdecl; external CLibCrypto; + +{$ENDIF} + +implementation + + uses + classes, + IdSSLOpenSSLExceptionHandlers, + IdResourceStringsOpenSSL + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + ,IdSSLOpenSSLLoader + {$ENDIF}; + + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +const + ERR_load_CRYPTO_strings_procname = 'ERR_load_CRYPTO_strings'; + + +{$WARN NO_RETVAL OFF} +function ERR_ERR_load_CRYPTO_strings: TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ERR_load_CRYPTO_strings_procname); +end; + + + +{$WARN NO_RETVAL ON} + +procedure Load(const ADllHandle: TIdLibHandle; LibVersion: TIdC_UINT; const AFailed: TStringList); + +var FuncLoadError: boolean; + +begin + ERR_load_CRYPTO_strings := LoadLibFunction(ADllHandle, ERR_load_CRYPTO_strings_procname); + FuncLoadError := not assigned(ERR_load_CRYPTO_strings); + if FuncLoadError then + begin + {$if not defined(ERR_load_CRYPTO_strings_allownil)} + ERR_load_CRYPTO_strings := @ERR_ERR_load_CRYPTO_strings; + {$ifend} + {$if declared(ERR_load_CRYPTO_strings_introduced)} + if LibVersion < ERR_load_CRYPTO_strings_introduced then + begin + {$if declared(FC_ERR_load_CRYPTO_strings)} + ERR_load_CRYPTO_strings := @FC_ERR_load_CRYPTO_strings; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ERR_load_CRYPTO_strings_removed)} + if ERR_load_CRYPTO_strings_removed <= LibVersion then + begin + {$if declared(_ERR_load_CRYPTO_strings)} + ERR_load_CRYPTO_strings := @_ERR_load_CRYPTO_strings; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ERR_load_CRYPTO_strings_allownil)} + if FuncLoadError then + AFailed.Add('ERR_load_CRYPTO_strings'); + {$ifend} + end; + + +end; + +procedure Unload; +begin + ERR_load_CRYPTO_strings := nil; +end; +{$ELSE} +{$ENDIF} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +initialization + Register_SSLLoader(@Load,'LibCrypto'); + Register_SSLUnloader(@Unload); +{$ENDIF} +end. diff --git a/IdOpenSSLHeaders_cterr.pas b/IdOpenSSLHeaders_cterr.pas new file mode 100644 index 0000000..3cc2d42 --- /dev/null +++ b/IdOpenSSLHeaders_cterr.pas @@ -0,0 +1,193 @@ + (* This unit was generated using the script genOpenSSLHdrs.sh from the source file IdOpenSSLHeaders_cterr.h2pas + It should not be modified directly. All changes should be made to IdOpenSSLHeaders_cterr.h2pas + and this file regenerated. IdOpenSSLHeaders_cterr.h2pas is distributed with the full Indy + Distribution. + *) + +{$i IdCompilerDefines.inc} +{$i IdSSLOpenSSLDefines.inc} +{$IFNDEF USE_OPENSSL} + { error Should not compile if USE_OPENSSL is not defined!!!} +{$ENDIF} +{******************************************************************************} +{ } +{ Indy (Internet Direct) - Internet Protocols Simplified } +{ } +{ https://www.indyproject.org/ } +{ https://gitter.im/IndySockets/Indy } +{ } +{******************************************************************************} +{ } +{ This file is part of the Indy (Internet Direct) project, and is offered } +{ under the dual-licensing agreement described on the Indy website. } +{ (https://www.indyproject.org/license/) } +{ } +{ Copyright: } +{ (c) 1993-2020, Chad Z. Hower and the Indy Pit Crew. All rights reserved. } +{ } +{******************************************************************************} +{ } +{ } +{******************************************************************************} + +unit IdOpenSSLHeaders_cterr; + +interface + +// Headers for OpenSSL 1.1.1 +// cterr.h + + +uses + IdCTypes, + IdGlobal, + IdSSLOpenSSLConsts; + +const + ///* + // * CT function codes. + // */ + CT_F_CTLOG_NEW = 117; + CT_F_CTLOG_NEW_FROM_BASE64 = 118; + CT_F_CTLOG_NEW_FROM_CONF = 119; + CT_F_CTLOG_STORE_LOAD_CTX_NEW = 122; + CT_F_CTLOG_STORE_LOAD_FILE = 123; + CT_F_CTLOG_STORE_LOAD_LOG = 130; + CT_F_CTLOG_STORE_NEW = 131; + CT_F_CT_BASE64_DECODE = 124; + CT_F_CT_POLICY_EVAL_CTX_NEW = 133; + CT_F_CT_V1_LOG_ID_FROM_PKEY = 125; + CT_F_I2O_SCT = 107; + CT_F_I2O_SCT_LIST = 108; + CT_F_I2O_SCT_SIGNATURE = 109; + CT_F_O2I_SCT = 110; + CT_F_O2I_SCT_LIST = 111; + CT_F_O2I_SCT_SIGNATURE = 112; + CT_F_SCT_CTX_NEW = 126; + CT_F_SCT_CTX_VERIFY = 128; + CT_F_SCT_NEW = 100; + CT_F_SCT_NEW_FROM_BASE64 = 127; + CT_F_SCT_SET0_LOG_ID = 101; + CT_F_SCT_SET1_EXTENSIONS = 114; + CT_F_SCT_SET1_LOG_ID = 115; + CT_F_SCT_SET1_SIGNATURE = 116; + CT_F_SCT_SET_LOG_ENTRY_TYPE = 102; + CT_F_SCT_SET_SIGNATURE_NID = 103; + CT_F_SCT_SET_VERSION = 104; + + + ///* + // * CT reason codes. + // */ + CT_R_BASE64_DECODE_ERROR = 108; + CT_R_INVALID_LOG_ID_LENGTH = 100; + CT_R_LOG_CONF_INVALID = 109; + CT_R_LOG_CONF_INVALID_KEY = 110; + CT_R_LOG_CONF_MISSING_DESCRIPTION = 111; + CT_R_LOG_CONF_MISSING_KEY = 112; + CT_R_LOG_KEY_INVALID = 113; + CT_R_SCT_FUTURE_TIMESTAMP = 116; + CT_R_SCT_INVALID = 104; + CT_R_SCT_INVALID_SIGNATURE = 107; + CT_R_SCT_LIST_INVALID = 105; + CT_R_SCT_LOG_ID_MISMATCH = 114; + CT_R_SCT_NOT_SET = 106; + CT_R_SCT_UNSUPPORTED_VERSION = 115; + CT_R_UNRECOGNIZED_SIGNATURE_NID = 101; + CT_R_UNSUPPORTED_ENTRY_TYPE = 102; + CT_R_UNSUPPORTED_VERSION = 103; + + { The EXTERNALSYM directive is ignored by FPC, however, it is used by Delphi as follows: + + The EXTERNALSYM directive prevents the specified Delphi symbol from appearing in header + files generated for C++. } + + {$EXTERNALSYM ERR_load_CT_strings} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +var + ERR_load_CT_strings: function : TIdC_INT; cdecl = nil; + +{$ELSE} + function ERR_load_CT_strings: TIdC_INT cdecl; external CLibCrypto; + +{$ENDIF} + +implementation + + uses + classes, + IdSSLOpenSSLExceptionHandlers, + IdResourceStringsOpenSSL + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + ,IdSSLOpenSSLLoader + {$ENDIF}; + + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +const + ERR_load_CT_strings_procname = 'ERR_load_CT_strings'; + + +{$WARN NO_RETVAL OFF} +function ERR_ERR_load_CT_strings: TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ERR_load_CT_strings_procname); +end; + + + +{$WARN NO_RETVAL ON} + +procedure Load(const ADllHandle: TIdLibHandle; LibVersion: TIdC_UINT; const AFailed: TStringList); + +var FuncLoadError: boolean; + +begin + ERR_load_CT_strings := LoadLibFunction(ADllHandle, ERR_load_CT_strings_procname); + FuncLoadError := not assigned(ERR_load_CT_strings); + if FuncLoadError then + begin + {$if not defined(ERR_load_CT_strings_allownil)} + ERR_load_CT_strings := @ERR_ERR_load_CT_strings; + {$ifend} + {$if declared(ERR_load_CT_strings_introduced)} + if LibVersion < ERR_load_CT_strings_introduced then + begin + {$if declared(FC_ERR_load_CT_strings)} + ERR_load_CT_strings := @FC_ERR_load_CT_strings; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ERR_load_CT_strings_removed)} + if ERR_load_CT_strings_removed <= LibVersion then + begin + {$if declared(_ERR_load_CT_strings)} + ERR_load_CT_strings := @_ERR_load_CT_strings; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ERR_load_CT_strings_allownil)} + if FuncLoadError then + AFailed.Add('ERR_load_CT_strings'); + {$ifend} + end; + + +end; + +procedure Unload; +begin + ERR_load_CT_strings := nil; +end; +{$ELSE} +{$ENDIF} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +initialization + Register_SSLLoader(@Load,'LibCrypto'); + Register_SSLUnloader(@Unload); +{$ENDIF} +end. diff --git a/IdOpenSSLHeaders_des.pas b/IdOpenSSLHeaders_des.pas new file mode 100644 index 0000000..6385981 --- /dev/null +++ b/IdOpenSSLHeaders_des.pas @@ -0,0 +1,2146 @@ + (* This unit was generated using the script genOpenSSLHdrs.sh from the source file IdOpenSSLHeaders_des.h2pas + It should not be modified directly. All changes should be made to IdOpenSSLHeaders_des.h2pas + and this file regenerated. IdOpenSSLHeaders_des.h2pas is distributed with the full Indy + Distribution. + *) + +{$i IdCompilerDefines.inc} +{$i IdSSLOpenSSLDefines.inc} +{$IFNDEF USE_OPENSSL} + { error Should not compile if USE_OPENSSL is not defined!!!} +{$ENDIF} +{******************************************************************************} +{ } +{ Indy (Internet Direct) - Internet Protocols Simplified } +{ } +{ https://www.indyproject.org/ } +{ https://gitter.im/IndySockets/Indy } +{ } +{******************************************************************************} +{ } +{ This file is part of the Indy (Internet Direct) project, and is offered } +{ under the dual-licensing agreement described on the Indy website. } +{ (https://www.indyproject.org/license/) } +{ } +{ Copyright: } +{ (c) 1993-2020, Chad Z. Hower and the Indy Pit Crew. All rights reserved. } +{ } +{******************************************************************************} +{ } +{ } +{******************************************************************************} + + +unit IdOpenSSLHeaders_des; + +interface + + +uses + IdCTypes, + IdGlobal, + IdSSLOpenSSLConsts; + +{ + Automatically converted by H2Pas 1.0.0 from des.h + The following command line parameters were used: + des.h +} + + Type + DES_LONG = type cardinal; + Pconst_DES_cblock = ^const_DES_cblock; + PDES_cblock = ^DES_cblock; + PDES_key_schedule = ^DES_key_schedule; + PDES_LONG = ^DES_LONG; + + + DES_cblock = array[0..7] of byte; + { const } + const_DES_cblock = array[0..7] of byte; + { + * With "const", gcc 2.8.1 on Solaris thinks that DES_cblock * and + * const_DES_cblock * are incompatible pointer types. + } + { + * make sure things are correct size on machines with 8 byte longs + } + + DES_ks = record + ks : array[0..15] of record + case longint of + 0 : ( cblock : DES_cblock ); + 1 : ( deslong : array[0..1] of DES_LONG ); + end; + end; + DES_key_schedule = DES_ks; + +var + DES_check_key : longint; + + + const + DES_ENCRYPT = 1; + DES_DECRYPT = 0; + DES_CBC_MODE = 0; + DES_PCBC_MODE = 1; + + { The EXTERNALSYM directive is ignored by FPC, however, it is used by Delphi as follows: + + The EXTERNALSYM directive prevents the specified Delphi symbol from appearing in header + files generated for C++. } + + {$EXTERNALSYM DES_options} + {$EXTERNALSYM DES_ecb3_encrypt} + {$EXTERNALSYM DES_cbc_cksum} + {$EXTERNALSYM DES_cbc_encrypt} + {$EXTERNALSYM DES_ncbc_encrypt} + {$EXTERNALSYM DES_xcbc_encrypt} + {$EXTERNALSYM DES_cfb_encrypt} + {$EXTERNALSYM DES_ecb_encrypt} + {$EXTERNALSYM DES_encrypt1} + {$EXTERNALSYM DES_encrypt2} + {$EXTERNALSYM DES_encrypt3} + {$EXTERNALSYM DES_decrypt3} + {$EXTERNALSYM DES_ede3_cbc_encrypt} + {$EXTERNALSYM DES_ede3_cfb64_encrypt} + {$EXTERNALSYM DES_ede3_cfb_encrypt} + {$EXTERNALSYM DES_ede3_ofb64_encrypt} + {$EXTERNALSYM DES_fcrypt} + {$EXTERNALSYM DES_crypt} + {$EXTERNALSYM DES_ofb_encrypt} + {$EXTERNALSYM DES_pcbc_encrypt} + {$EXTERNALSYM DES_quad_cksum} + {$EXTERNALSYM DES_random_key} + {$EXTERNALSYM DES_set_odd_parity} + {$EXTERNALSYM DES_check_key_parity} + {$EXTERNALSYM DES_is_weak_key} + {$EXTERNALSYM DES_set_key} + {$EXTERNALSYM DES_key_sched} + {$EXTERNALSYM DES_set_key_checked} + {$EXTERNALSYM DES_set_key_unchecked} + {$EXTERNALSYM DES_string_to_key} + {$EXTERNALSYM DES_string_to_2keys} + {$EXTERNALSYM DES_cfb64_encrypt} + {$EXTERNALSYM DES_ofb64_encrypt} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +var + {$EXTERNALSYM DES_ecb2_encrypt} {removed 1.0.0} + {$EXTERNALSYM DES_ede2_cbc_encrypt} {removed 1.0.0} + {$EXTERNALSYM DES_ede2_cfb64_encrypt} {removed 1.0.0} + {$EXTERNALSYM DES_ede2_ofb64_encrypt} {removed 1.0.0} + {$EXTERNALSYM DES_fixup_key_parity} {removed 1.0.0} + DES_ecb2_encrypt: procedure (input:Pconst_DES_cblock; output:PDES_cblock; ks1:PDES_key_schedule; ks2:PDES_key_schedule; enc:longint); cdecl = nil; {removed 1.0.0} + DES_ede2_cbc_encrypt: procedure (input:Pbyte; output:Pbyte; length:longint; ks1:PDES_key_schedule; ks2:PDES_key_schedule; ivec:PDES_cblock; enc:longint); cdecl = nil; {removed 1.0.0} + DES_ede2_cfb64_encrypt: procedure (in_:Pbyte; out_:Pbyte; length:longint; ks1:PDES_key_schedule; ks2:PDES_key_schedule; ivec:PDES_cblock; num:Plongint; enc:longint); cdecl = nil; {removed 1.0.0} + DES_ede2_ofb64_encrypt: procedure (in_:Pbyte; out_:Pbyte; length:longint; ks1:PDES_key_schedule; ks2:PDES_key_schedule; ivec:PDES_cblock; num:Plongint); cdecl = nil; {removed 1.0.0} + + +(* Const before type ignored *) + DES_options: function : PIdAnsiChar; cdecl = nil; + + DES_ecb3_encrypt: procedure (input:Pconst_DES_cblock; output:PDES_cblock; ks1:PDES_key_schedule; ks2:PDES_key_schedule; ks3:PDES_key_schedule; enc:longint); cdecl = nil; + +(* Const before type ignored *) + DES_cbc_cksum: function (input:Pbyte; output:PDES_cblock; length:longint; schedule:PDES_key_schedule; ivec:Pconst_DES_cblock):DES_LONG; cdecl = nil; + + { DES_cbc_encrypt does not update the IV! Use DES_ncbc_encrypt instead. } +(* Const before type ignored *) + DES_cbc_encrypt: procedure (input:Pbyte; output:Pbyte; length:longint; schedule:PDES_key_schedule; ivec:PDES_cblock; enc:longint); cdecl = nil; + +(* Const before type ignored *) + DES_ncbc_encrypt: procedure (input:Pbyte; output:Pbyte; length:longint; schedule:PDES_key_schedule; ivec:PDES_cblock; enc:longint); cdecl = nil; + +(* Const before type ignored *) + DES_xcbc_encrypt: procedure (input:Pbyte; output:Pbyte; length:longint; schedule:PDES_key_schedule; ivec:PDES_cblock; inw:Pconst_DES_cblock; outw:Pconst_DES_cblock; enc:longint); cdecl = nil; + +(* Const before type ignored *) + DES_cfb_encrypt: procedure (in_:Pbyte; out_:Pbyte; numbits:longint; length:longint; schedule:PDES_key_schedule; ivec:PDES_cblock; enc:longint); cdecl = nil; + + DES_ecb_encrypt: procedure (input:Pconst_DES_cblock; output:PDES_cblock; ks:PDES_key_schedule; enc:longint); cdecl = nil; + { + * This is the DES encryption function that gets called by just about every + * other DES routine in the library. You should not use this function except + * to implement 'modes' of DES. I say this because the functions that call + * this routine do the conversion from 'char *' to long, and this needs to be + * done to make sure 'non-aligned' memory access do not occur. The + * characters are loaded 'little endian'. Data is a pointer to 2 unsigned + * long's and ks is the DES_key_schedule to use. enc, is non zero specifies + * encryption, zero if decryption. + } + DES_encrypt1: procedure (data:PDES_LONG; ks:PDES_key_schedule; enc:longint); cdecl = nil; + + { + * This functions is the same as DES_encrypt1() except that the DES initial + * permutation (IP) and final permutation (FP) have been left out. As for + * DES_encrypt1(), you should not use this function. It is used by the + * routines in the library that implement triple DES. IP() DES_encrypt2() + * DES_encrypt2() DES_encrypt2() FP() is the same as DES_encrypt1() + * DES_encrypt1() DES_encrypt1() except faster :-). + } + DES_encrypt2: procedure (data:PDES_LONG; ks:PDES_key_schedule; enc:longint); cdecl = nil; + + DES_encrypt3: procedure (data:PDES_LONG; ks1:PDES_key_schedule; ks2:PDES_key_schedule; ks3:PDES_key_schedule); cdecl = nil; + + DES_decrypt3: procedure (data:PDES_LONG; ks1:PDES_key_schedule; ks2:PDES_key_schedule; ks3:PDES_key_schedule); cdecl = nil; + +(* Const before type ignored *) + DES_ede3_cbc_encrypt: procedure (input:Pbyte; output:Pbyte; length:longint; ks1:PDES_key_schedule; ks2:PDES_key_schedule; ks3:PDES_key_schedule; ivec:PDES_cblock; enc:longint); cdecl = nil; + +(* Const before type ignored *) + DES_ede3_cfb64_encrypt: procedure (in_:Pbyte; out_:Pbyte; length:longint; ks1:PDES_key_schedule; ks2:PDES_key_schedule; ks3:PDES_key_schedule; ivec:PDES_cblock; num:Plongint; enc:longint); cdecl = nil; + +(* Const before type ignored *) + DES_ede3_cfb_encrypt: procedure (in_:Pbyte; out_:Pbyte; numbits:longint; length:longint; ks1:PDES_key_schedule; ks2:PDES_key_schedule; ks3:PDES_key_schedule; ivec:PDES_cblock; enc:longint); cdecl = nil; + +(* Const before type ignored *) + DES_ede3_ofb64_encrypt: procedure (in_:Pbyte; out_:Pbyte; length:longint; ks1:PDES_key_schedule; ks2:PDES_key_schedule; ks3:PDES_key_schedule; ivec:PDES_cblock; num:Plongint); cdecl = nil; + +(* Const before type ignored *) +(* Const before type ignored *) + DES_fcrypt: function (buf:PIdAnsiChar; salt:PIdAnsiChar; ret:PIdAnsiChar): PIdAnsiChar; cdecl = nil; + +(* Const before type ignored *) +(* Const before type ignored *) + DES_crypt: function (buf:PIdAnsiChar; salt:PIdAnsiChar): PIdAnsiChar; cdecl = nil; + +(* Const before type ignored *) + DES_ofb_encrypt: procedure (in_:Pbyte; out_:Pbyte; numbits:longint; length:longint; schedule:PDES_key_schedule; ivec:PDES_cblock); cdecl = nil; + +(* Const before type ignored *) + DES_pcbc_encrypt: procedure (input:Pbyte; output:Pbyte; length:longint; schedule:PDES_key_schedule; ivec:PDES_cblock; enc:longint); cdecl = nil; + +(* Const before type ignored *) + DES_quad_cksum: function (input:Pbyte; output:PDES_cblock; length:longint; out_count:longint; seed:PDES_cblock):DES_LONG; cdecl = nil; + + DES_random_key: function (ret:PDES_cblock):longint; cdecl = nil; + + DES_set_odd_parity: procedure (key:PDES_cblock); cdecl = nil; + + DES_check_key_parity: function (key:Pconst_DES_cblock):longint; cdecl = nil; + + DES_is_weak_key: function (key:Pconst_DES_cblock):longint; cdecl = nil; + + { + * DES_set_key (= set_key = DES_key_sched = key_sched) calls + * DES_set_key_checked if global variable DES_check_key is set, + * DES_set_key_unchecked otherwise. + } + DES_set_key: function (key:Pconst_DES_cblock; var schedule: DES_key_schedule):longint; cdecl = nil; + + DES_key_sched: function (key:Pconst_DES_cblock; schedule:PDES_key_schedule):longint; cdecl = nil; + + DES_set_key_checked: function (key:Pconst_DES_cblock; schedule:PDES_key_schedule):longint; cdecl = nil; + + DES_set_key_unchecked: procedure (key:Pconst_DES_cblock; schedule:PDES_key_schedule); cdecl = nil; + +(* Const before type ignored *) + DES_string_to_key: procedure (str:PIdAnsiChar; key:PDES_cblock); cdecl = nil; + +(* Const before type ignored *) + DES_string_to_2keys: procedure (str:PIdAnsiChar; key1:PDES_cblock; key2:PDES_cblock); cdecl = nil; + +(* Const before type ignored *) + DES_cfb64_encrypt: procedure (in_:Pbyte; out_:Pbyte; length:longint; schedule:PDES_key_schedule; ivec:PDES_cblock; num:Plongint; enc:longint); cdecl = nil; + +(* Const before type ignored *) + DES_ofb64_encrypt: procedure (in_:Pbyte; out_:Pbyte; length:longint; schedule:PDES_key_schedule; ivec:PDES_cblock; num:Plongint); cdecl = nil; + + DES_fixup_key_parity: procedure (key: PDES_cblock); cdecl = nil; {removed 1.0.0} + +{$ELSE} + + +(* Const before type ignored *) + function DES_options: PIdAnsiChar cdecl; external CLibCrypto; + + procedure DES_ecb3_encrypt(input:Pconst_DES_cblock; output:PDES_cblock; ks1:PDES_key_schedule; ks2:PDES_key_schedule; ks3:PDES_key_schedule; enc:longint) cdecl; external CLibCrypto; + +(* Const before type ignored *) + function DES_cbc_cksum(input:Pbyte; output:PDES_cblock; length:longint; schedule:PDES_key_schedule; ivec:Pconst_DES_cblock):DES_LONG cdecl; external CLibCrypto; + + { DES_cbc_encrypt does not update the IV! Use DES_ncbc_encrypt instead. } +(* Const before type ignored *) + procedure DES_cbc_encrypt(input:Pbyte; output:Pbyte; length:longint; schedule:PDES_key_schedule; ivec:PDES_cblock; enc:longint) cdecl; external CLibCrypto; + +(* Const before type ignored *) + procedure DES_ncbc_encrypt(input:Pbyte; output:Pbyte; length:longint; schedule:PDES_key_schedule; ivec:PDES_cblock; enc:longint) cdecl; external CLibCrypto; + +(* Const before type ignored *) + procedure DES_xcbc_encrypt(input:Pbyte; output:Pbyte; length:longint; schedule:PDES_key_schedule; ivec:PDES_cblock; inw:Pconst_DES_cblock; outw:Pconst_DES_cblock; enc:longint) cdecl; external CLibCrypto; + +(* Const before type ignored *) + procedure DES_cfb_encrypt(in_:Pbyte; out_:Pbyte; numbits:longint; length:longint; schedule:PDES_key_schedule; ivec:PDES_cblock; enc:longint) cdecl; external CLibCrypto; + + procedure DES_ecb_encrypt(input:Pconst_DES_cblock; output:PDES_cblock; ks:PDES_key_schedule; enc:longint) cdecl; external CLibCrypto; + { + * This is the DES encryption function that gets called by just about every + * other DES routine in the library. You should not use this function except + * to implement 'modes' of DES. I say this because the functions that call + * this routine do the conversion from 'char *' to long, and this needs to be + * done to make sure 'non-aligned' memory access do not occur. The + * characters are loaded 'little endian'. Data is a pointer to 2 unsigned + * long's and ks is the DES_key_schedule to use. enc, is non zero specifies + * encryption, zero if decryption. + } + procedure DES_encrypt1(data:PDES_LONG; ks:PDES_key_schedule; enc:longint) cdecl; external CLibCrypto; + + { + * This functions is the same as DES_encrypt1() except that the DES initial + * permutation (IP) and final permutation (FP) have been left out. As for + * DES_encrypt1(), you should not use this function. It is used by the + * routines in the library that implement triple DES. IP() DES_encrypt2() + * DES_encrypt2() DES_encrypt2() FP() is the same as DES_encrypt1() + * DES_encrypt1() DES_encrypt1() except faster :-). + } + procedure DES_encrypt2(data:PDES_LONG; ks:PDES_key_schedule; enc:longint) cdecl; external CLibCrypto; + + procedure DES_encrypt3(data:PDES_LONG; ks1:PDES_key_schedule; ks2:PDES_key_schedule; ks3:PDES_key_schedule) cdecl; external CLibCrypto; + + procedure DES_decrypt3(data:PDES_LONG; ks1:PDES_key_schedule; ks2:PDES_key_schedule; ks3:PDES_key_schedule) cdecl; external CLibCrypto; + +(* Const before type ignored *) + procedure DES_ede3_cbc_encrypt(input:Pbyte; output:Pbyte; length:longint; ks1:PDES_key_schedule; ks2:PDES_key_schedule; ks3:PDES_key_schedule; ivec:PDES_cblock; enc:longint) cdecl; external CLibCrypto; + +(* Const before type ignored *) + procedure DES_ede3_cfb64_encrypt(in_:Pbyte; out_:Pbyte; length:longint; ks1:PDES_key_schedule; ks2:PDES_key_schedule; ks3:PDES_key_schedule; ivec:PDES_cblock; num:Plongint; enc:longint) cdecl; external CLibCrypto; + +(* Const before type ignored *) + procedure DES_ede3_cfb_encrypt(in_:Pbyte; out_:Pbyte; numbits:longint; length:longint; ks1:PDES_key_schedule; ks2:PDES_key_schedule; ks3:PDES_key_schedule; ivec:PDES_cblock; enc:longint) cdecl; external CLibCrypto; + +(* Const before type ignored *) + procedure DES_ede3_ofb64_encrypt(in_:Pbyte; out_:Pbyte; length:longint; ks1:PDES_key_schedule; ks2:PDES_key_schedule; ks3:PDES_key_schedule; ivec:PDES_cblock; num:Plongint) cdecl; external CLibCrypto; + +(* Const before type ignored *) +(* Const before type ignored *) + function DES_fcrypt(buf:PIdAnsiChar; salt:PIdAnsiChar; ret:PIdAnsiChar): PIdAnsiChar cdecl; external CLibCrypto; + +(* Const before type ignored *) +(* Const before type ignored *) + function DES_crypt(buf:PIdAnsiChar; salt:PIdAnsiChar): PIdAnsiChar cdecl; external CLibCrypto; + +(* Const before type ignored *) + procedure DES_ofb_encrypt(in_:Pbyte; out_:Pbyte; numbits:longint; length:longint; schedule:PDES_key_schedule; ivec:PDES_cblock) cdecl; external CLibCrypto; + +(* Const before type ignored *) + procedure DES_pcbc_encrypt(input:Pbyte; output:Pbyte; length:longint; schedule:PDES_key_schedule; ivec:PDES_cblock; enc:longint) cdecl; external CLibCrypto; + +(* Const before type ignored *) + function DES_quad_cksum(input:Pbyte; output:PDES_cblock; length:longint; out_count:longint; seed:PDES_cblock):DES_LONG cdecl; external CLibCrypto; + + function DES_random_key(ret:PDES_cblock):longint cdecl; external CLibCrypto; + + procedure DES_set_odd_parity(key:PDES_cblock) cdecl; external CLibCrypto; + + function DES_check_key_parity(key:Pconst_DES_cblock):longint cdecl; external CLibCrypto; + + function DES_is_weak_key(key:Pconst_DES_cblock):longint cdecl; external CLibCrypto; + + { + * DES_set_key (= set_key = DES_key_sched = key_sched) calls + * DES_set_key_checked if global variable DES_check_key is set, + * DES_set_key_unchecked otherwise. + } + function DES_set_key(key:Pconst_DES_cblock; var schedule: DES_key_schedule):longint cdecl; external CLibCrypto; + + function DES_key_sched(key:Pconst_DES_cblock; schedule:PDES_key_schedule):longint cdecl; external CLibCrypto; + + function DES_set_key_checked(key:Pconst_DES_cblock; schedule:PDES_key_schedule):longint cdecl; external CLibCrypto; + + procedure DES_set_key_unchecked(key:Pconst_DES_cblock; schedule:PDES_key_schedule) cdecl; external CLibCrypto; + +(* Const before type ignored *) + procedure DES_string_to_key(str:PIdAnsiChar; key:PDES_cblock) cdecl; external CLibCrypto; + +(* Const before type ignored *) + procedure DES_string_to_2keys(str:PIdAnsiChar; key1:PDES_cblock; key2:PDES_cblock) cdecl; external CLibCrypto; + +(* Const before type ignored *) + procedure DES_cfb64_encrypt(in_:Pbyte; out_:Pbyte; length:longint; schedule:PDES_key_schedule; ivec:PDES_cblock; num:Plongint; enc:longint) cdecl; external CLibCrypto; + +(* Const before type ignored *) + procedure DES_ofb64_encrypt(in_:Pbyte; out_:Pbyte; length:longint; schedule:PDES_key_schedule; ivec:PDES_cblock; num:Plongint) cdecl; external CLibCrypto; + + + procedure DES_ecb2_encrypt(input:Pconst_DES_cblock; output:PDES_cblock; ks1:PDES_key_schedule; ks2:PDES_key_schedule; enc:longint); {removed 1.0.0} + procedure DES_ede2_cbc_encrypt(input:Pbyte; output:Pbyte; length:longint; ks1:PDES_key_schedule; ks2:PDES_key_schedule; ivec:PDES_cblock; enc:longint); {removed 1.0.0} + procedure DES_ede2_cfb64_encrypt(in_:Pbyte; out_:Pbyte; length:longint; ks1:PDES_key_schedule; ks2:PDES_key_schedule; ivec:PDES_cblock; num:Plongint; enc:longint); {removed 1.0.0} + procedure DES_ede2_ofb64_encrypt(in_:Pbyte; out_:Pbyte; length:longint; ks1:PDES_key_schedule; ks2:PDES_key_schedule; ivec:PDES_cblock; num:Plongint); {removed 1.0.0} + procedure DES_fixup_key_parity(key: PDES_cblock); {removed 1.0.0} +{$ENDIF} + +implementation + + uses + classes, + IdSSLOpenSSLExceptionHandlers, + IdResourceStringsOpenSSL + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + ,IdSSLOpenSSLLoader + {$ENDIF}; + +const + DES_ecb2_encrypt_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + DES_ede2_cbc_encrypt_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + DES_ede2_cfb64_encrypt_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + DES_ede2_ofb64_encrypt_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + DES_fixup_key_parity_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +const + DES_ecb2_encrypt_procname = 'DES_ecb2_encrypt'; {removed 1.0.0} + DES_ede2_cbc_encrypt_procname = 'DES_ede2_cbc_encrypt'; {removed 1.0.0} + DES_ede2_cfb64_encrypt_procname = 'DES_ede2_cfb64_encrypt'; {removed 1.0.0} + DES_ede2_ofb64_encrypt_procname = 'DES_ede2_ofb64_encrypt'; {removed 1.0.0} + + +(* Const before type ignored *) + DES_options_procname = 'DES_options'; + + DES_ecb3_encrypt_procname = 'DES_ecb3_encrypt'; + +(* Const before type ignored *) + DES_cbc_cksum_procname = 'DES_cbc_cksum'; + + { DES_cbc_encrypt does not update the IV! Use DES_ncbc_encrypt instead. } +(* Const before type ignored *) + DES_cbc_encrypt_procname = 'DES_cbc_encrypt'; + +(* Const before type ignored *) + DES_ncbc_encrypt_procname = 'DES_ncbc_encrypt'; + +(* Const before type ignored *) + DES_xcbc_encrypt_procname = 'DES_xcbc_encrypt'; + +(* Const before type ignored *) + DES_cfb_encrypt_procname = 'DES_cfb_encrypt'; + + DES_ecb_encrypt_procname = 'DES_ecb_encrypt'; + { + * This is the DES encryption function that gets called by just about every + * other DES routine in the library. You should not use this function except + * to implement 'modes' of DES. I say this because the functions that call + * this routine do the conversion from 'char *' to long, and this needs to be + * done to make sure 'non-aligned' memory access do not occur. The + * characters are loaded 'little endian'. Data is a pointer to 2 unsigned + * long's and ks is the DES_key_schedule to use. enc, is non zero specifies + * encryption, zero if decryption. + } + DES_encrypt1_procname = 'DES_encrypt1'; + + { + * This functions is the same as DES_encrypt1() except that the DES initial + * permutation (IP) and final permutation (FP) have been left out. As for + * DES_encrypt1(), you should not use this function. It is used by the + * routines in the library that implement triple DES. IP() DES_encrypt2() + * DES_encrypt2() DES_encrypt2() FP() is the same as DES_encrypt1() + * DES_encrypt1() DES_encrypt1() except faster :-). + } + DES_encrypt2_procname = 'DES_encrypt2'; + + DES_encrypt3_procname = 'DES_encrypt3'; + + DES_decrypt3_procname = 'DES_decrypt3'; + +(* Const before type ignored *) + DES_ede3_cbc_encrypt_procname = 'DES_ede3_cbc_encrypt'; + +(* Const before type ignored *) + DES_ede3_cfb64_encrypt_procname = 'DES_ede3_cfb64_encrypt'; + +(* Const before type ignored *) + DES_ede3_cfb_encrypt_procname = 'DES_ede3_cfb_encrypt'; + +(* Const before type ignored *) + DES_ede3_ofb64_encrypt_procname = 'DES_ede3_ofb64_encrypt'; + +(* Const before type ignored *) +(* Const before type ignored *) + DES_fcrypt_procname = 'DES_fcrypt'; + +(* Const before type ignored *) +(* Const before type ignored *) + DES_crypt_procname = 'DES_crypt'; + +(* Const before type ignored *) + DES_ofb_encrypt_procname = 'DES_ofb_encrypt'; + +(* Const before type ignored *) + DES_pcbc_encrypt_procname = 'DES_pcbc_encrypt'; + +(* Const before type ignored *) + DES_quad_cksum_procname = 'DES_quad_cksum'; + + DES_random_key_procname = 'DES_random_key'; + + DES_set_odd_parity_procname = 'DES_set_odd_parity'; + + DES_check_key_parity_procname = 'DES_check_key_parity'; + + DES_is_weak_key_procname = 'DES_is_weak_key'; + + { + * DES_set_key (= set_key = DES_key_sched = key_sched) calls + * DES_set_key_checked if global variable DES_check_key is set, + * DES_set_key_unchecked otherwise. + } + DES_set_key_procname = 'DES_set_key'; + + DES_key_sched_procname = 'DES_key_sched'; + + DES_set_key_checked_procname = 'DES_set_key_checked'; + + DES_set_key_unchecked_procname = 'DES_set_key_unchecked'; + +(* Const before type ignored *) + DES_string_to_key_procname = 'DES_string_to_key'; + +(* Const before type ignored *) + DES_string_to_2keys_procname = 'DES_string_to_2keys'; + +(* Const before type ignored *) + DES_cfb64_encrypt_procname = 'DES_cfb64_encrypt'; + +(* Const before type ignored *) + DES_ofb64_encrypt_procname = 'DES_ofb64_encrypt'; + + DES_fixup_key_parity_procname = 'DES_fixup_key_parity'; {removed 1.0.0} + + +procedure _DES_ecb2_encrypt(input:Pconst_DES_cblock; output:PDES_cblock; ks1: PDES_key_schedule; ks2: PDES_key_schedule; enc: longint); cdecl; + begin + DES_ecb3_encrypt(input,output,ks1,ks2,ks1,enc); + end; + +procedure _DES_ede2_cbc_encrypt(input:Pbyte; output:Pbyte; length: longint; ks1: PDES_key_schedule; ks2: PDES_key_schedule; ivec: PDES_cblock; enc: longint); cdecl; + begin + DES_ede3_cbc_encrypt(input,output,length,ks1,ks2,ks1,ivec,enc); + end; + +procedure _DES_ede2_cfb64_encrypt(in_: Pbyte; out_: Pbyte; length: longint; ks1: PDES_key_schedule; ks2: PDES_key_schedule; ivec: PDES_cblock; num: Plongint; enc: longint); cdecl; + begin + DES_ede3_cfb64_encrypt(in_,out_,length,ks1,ks2,ks1,ivec,num,enc); + end; + +procedure _DES_ede2_ofb64_encrypt(in_: Pbyte; out_: Pbyte; length: longint; ks1: PDES_key_schedule; ks2: PDES_key_schedule; ivec: PDES_cblock; num: Plongint); cdecl; + begin + DES_ede3_ofb64_encrypt(in_,out_,length,ks1,ks2,ks1,ivec,num); + end; + +procedure _DES_fixup_key_parity(key:PDES_cblock); cdecl; + begin + DES_set_odd_parity(key); + end; + + +{$WARN NO_RETVAL OFF} +procedure ERR_DES_ecb2_encrypt(input:Pconst_DES_cblock; output:PDES_cblock; ks1:PDES_key_schedule; ks2:PDES_key_schedule; enc:longint); +begin + EIdAPIFunctionNotPresent.RaiseException(DES_ecb2_encrypt_procname); +end; + + +procedure ERR_DES_ede2_cbc_encrypt(input:Pbyte; output:Pbyte; length:longint; ks1:PDES_key_schedule; ks2:PDES_key_schedule; ivec:PDES_cblock; enc:longint); +begin + EIdAPIFunctionNotPresent.RaiseException(DES_ede2_cbc_encrypt_procname); +end; + + +procedure ERR_DES_ede2_cfb64_encrypt(in_:Pbyte; out_:Pbyte; length:longint; ks1:PDES_key_schedule; ks2:PDES_key_schedule; ivec:PDES_cblock; num:Plongint; enc:longint); +begin + EIdAPIFunctionNotPresent.RaiseException(DES_ede2_cfb64_encrypt_procname); +end; + + +procedure ERR_DES_ede2_ofb64_encrypt(in_:Pbyte; out_:Pbyte; length:longint; ks1:PDES_key_schedule; ks2:PDES_key_schedule; ivec:PDES_cblock; num:Plongint); +begin + EIdAPIFunctionNotPresent.RaiseException(DES_ede2_ofb64_encrypt_procname); +end; + + + + +(* Const before type ignored *) +function ERR_DES_options: PIdAnsiChar; +begin + EIdAPIFunctionNotPresent.RaiseException(DES_options_procname); +end; + + + +procedure ERR_DES_ecb3_encrypt(input:Pconst_DES_cblock; output:PDES_cblock; ks1:PDES_key_schedule; ks2:PDES_key_schedule; ks3:PDES_key_schedule; enc:longint); +begin + EIdAPIFunctionNotPresent.RaiseException(DES_ecb3_encrypt_procname); +end; + + + +(* Const before type ignored *) +function ERR_DES_cbc_cksum(input:Pbyte; output:PDES_cblock; length:longint; schedule:PDES_key_schedule; ivec:Pconst_DES_cblock):DES_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(DES_cbc_cksum_procname); +end; + + + + { DES_cbc_encrypt does not update the IV! Use DES_ncbc_encrypt instead. } +(* Const before type ignored *) +procedure ERR_DES_cbc_encrypt(input:Pbyte; output:Pbyte; length:longint; schedule:PDES_key_schedule; ivec:PDES_cblock; enc:longint); +begin + EIdAPIFunctionNotPresent.RaiseException(DES_cbc_encrypt_procname); +end; + + + +(* Const before type ignored *) +procedure ERR_DES_ncbc_encrypt(input:Pbyte; output:Pbyte; length:longint; schedule:PDES_key_schedule; ivec:PDES_cblock; enc:longint); +begin + EIdAPIFunctionNotPresent.RaiseException(DES_ncbc_encrypt_procname); +end; + + + +(* Const before type ignored *) +procedure ERR_DES_xcbc_encrypt(input:Pbyte; output:Pbyte; length:longint; schedule:PDES_key_schedule; ivec:PDES_cblock; inw:Pconst_DES_cblock; outw:Pconst_DES_cblock; enc:longint); +begin + EIdAPIFunctionNotPresent.RaiseException(DES_xcbc_encrypt_procname); +end; + + + +(* Const before type ignored *) +procedure ERR_DES_cfb_encrypt(in_:Pbyte; out_:Pbyte; numbits:longint; length:longint; schedule:PDES_key_schedule; ivec:PDES_cblock; enc:longint); +begin + EIdAPIFunctionNotPresent.RaiseException(DES_cfb_encrypt_procname); +end; + + + +procedure ERR_DES_ecb_encrypt(input:Pconst_DES_cblock; output:PDES_cblock; ks:PDES_key_schedule; enc:longint); +begin + EIdAPIFunctionNotPresent.RaiseException(DES_ecb_encrypt_procname); +end; + + + { + * This is the DES encryption function that gets called by just about every + * other DES routine in the library. You should not use this function except + * to implement 'modes' of DES. I say this because the functions that call + * this routine do the conversion from 'char *' to long, and this needs to be + * done to make sure 'non-aligned' memory access do not occur. The + * characters are loaded 'little endian'. Data is a pointer to 2 unsigned + * long's and ks is the DES_key_schedule to use. enc, is non zero specifies + * encryption, zero if decryption. + } +procedure ERR_DES_encrypt1(data:PDES_LONG; ks:PDES_key_schedule; enc:longint); +begin + EIdAPIFunctionNotPresent.RaiseException(DES_encrypt1_procname); +end; + + + + { + * This functions is the same as DES_encrypt1() except that the DES initial + * permutation (IP) and final permutation (FP) have been left out. As for + * DES_encrypt1(), you should not use this function. It is used by the + * routines in the library that implement triple DES. IP() DES_encrypt2() + * DES_encrypt2() DES_encrypt2() FP() is the same as DES_encrypt1() + * DES_encrypt1() DES_encrypt1() except faster :-). + } +procedure ERR_DES_encrypt2(data:PDES_LONG; ks:PDES_key_schedule; enc:longint); +begin + EIdAPIFunctionNotPresent.RaiseException(DES_encrypt2_procname); +end; + + + +procedure ERR_DES_encrypt3(data:PDES_LONG; ks1:PDES_key_schedule; ks2:PDES_key_schedule; ks3:PDES_key_schedule); +begin + EIdAPIFunctionNotPresent.RaiseException(DES_encrypt3_procname); +end; + + + +procedure ERR_DES_decrypt3(data:PDES_LONG; ks1:PDES_key_schedule; ks2:PDES_key_schedule; ks3:PDES_key_schedule); +begin + EIdAPIFunctionNotPresent.RaiseException(DES_decrypt3_procname); +end; + + + +(* Const before type ignored *) +procedure ERR_DES_ede3_cbc_encrypt(input:Pbyte; output:Pbyte; length:longint; ks1:PDES_key_schedule; ks2:PDES_key_schedule; ks3:PDES_key_schedule; ivec:PDES_cblock; enc:longint); +begin + EIdAPIFunctionNotPresent.RaiseException(DES_ede3_cbc_encrypt_procname); +end; + + + +(* Const before type ignored *) +procedure ERR_DES_ede3_cfb64_encrypt(in_:Pbyte; out_:Pbyte; length:longint; ks1:PDES_key_schedule; ks2:PDES_key_schedule; ks3:PDES_key_schedule; ivec:PDES_cblock; num:Plongint; enc:longint); +begin + EIdAPIFunctionNotPresent.RaiseException(DES_ede3_cfb64_encrypt_procname); +end; + + + +(* Const before type ignored *) +procedure ERR_DES_ede3_cfb_encrypt(in_:Pbyte; out_:Pbyte; numbits:longint; length:longint; ks1:PDES_key_schedule; ks2:PDES_key_schedule; ks3:PDES_key_schedule; ivec:PDES_cblock; enc:longint); +begin + EIdAPIFunctionNotPresent.RaiseException(DES_ede3_cfb_encrypt_procname); +end; + + + +(* Const before type ignored *) +procedure ERR_DES_ede3_ofb64_encrypt(in_:Pbyte; out_:Pbyte; length:longint; ks1:PDES_key_schedule; ks2:PDES_key_schedule; ks3:PDES_key_schedule; ivec:PDES_cblock; num:Plongint); +begin + EIdAPIFunctionNotPresent.RaiseException(DES_ede3_ofb64_encrypt_procname); +end; + + + +(* Const before type ignored *) +(* Const before type ignored *) +function ERR_DES_fcrypt(buf:PIdAnsiChar; salt:PIdAnsiChar; ret:PIdAnsiChar): PIdAnsiChar; +begin + EIdAPIFunctionNotPresent.RaiseException(DES_fcrypt_procname); +end; + + + +(* Const before type ignored *) +(* Const before type ignored *) +function ERR_DES_crypt(buf:PIdAnsiChar; salt:PIdAnsiChar): PIdAnsiChar; +begin + EIdAPIFunctionNotPresent.RaiseException(DES_crypt_procname); +end; + + + +(* Const before type ignored *) +procedure ERR_DES_ofb_encrypt(in_:Pbyte; out_:Pbyte; numbits:longint; length:longint; schedule:PDES_key_schedule; ivec:PDES_cblock); +begin + EIdAPIFunctionNotPresent.RaiseException(DES_ofb_encrypt_procname); +end; + + + +(* Const before type ignored *) +procedure ERR_DES_pcbc_encrypt(input:Pbyte; output:Pbyte; length:longint; schedule:PDES_key_schedule; ivec:PDES_cblock; enc:longint); +begin + EIdAPIFunctionNotPresent.RaiseException(DES_pcbc_encrypt_procname); +end; + + + +(* Const before type ignored *) +function ERR_DES_quad_cksum(input:Pbyte; output:PDES_cblock; length:longint; out_count:longint; seed:PDES_cblock):DES_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(DES_quad_cksum_procname); +end; + + + +function ERR_DES_random_key(ret:PDES_cblock):longint; +begin + EIdAPIFunctionNotPresent.RaiseException(DES_random_key_procname); +end; + + + +procedure ERR_DES_set_odd_parity(key:PDES_cblock); +begin + EIdAPIFunctionNotPresent.RaiseException(DES_set_odd_parity_procname); +end; + + + +function ERR_DES_check_key_parity(key:Pconst_DES_cblock):longint; +begin + EIdAPIFunctionNotPresent.RaiseException(DES_check_key_parity_procname); +end; + + + +function ERR_DES_is_weak_key(key:Pconst_DES_cblock):longint; +begin + EIdAPIFunctionNotPresent.RaiseException(DES_is_weak_key_procname); +end; + + + + { + * DES_set_key (= set_key = DES_key_sched = key_sched) calls + * DES_set_key_checked if global variable DES_check_key is set, + * DES_set_key_unchecked otherwise. + } +function ERR_DES_set_key(key:Pconst_DES_cblock; var schedule: DES_key_schedule):longint; +begin + EIdAPIFunctionNotPresent.RaiseException(DES_set_key_procname); +end; + + + +function ERR_DES_key_sched(key:Pconst_DES_cblock; schedule:PDES_key_schedule):longint; +begin + EIdAPIFunctionNotPresent.RaiseException(DES_key_sched_procname); +end; + + + +function ERR_DES_set_key_checked(key:Pconst_DES_cblock; schedule:PDES_key_schedule):longint; +begin + EIdAPIFunctionNotPresent.RaiseException(DES_set_key_checked_procname); +end; + + + +procedure ERR_DES_set_key_unchecked(key:Pconst_DES_cblock; schedule:PDES_key_schedule); +begin + EIdAPIFunctionNotPresent.RaiseException(DES_set_key_unchecked_procname); +end; + + + +(* Const before type ignored *) +procedure ERR_DES_string_to_key(str:PIdAnsiChar; key:PDES_cblock); +begin + EIdAPIFunctionNotPresent.RaiseException(DES_string_to_key_procname); +end; + + + +(* Const before type ignored *) +procedure ERR_DES_string_to_2keys(str:PIdAnsiChar; key1:PDES_cblock; key2:PDES_cblock); +begin + EIdAPIFunctionNotPresent.RaiseException(DES_string_to_2keys_procname); +end; + + + +(* Const before type ignored *) +procedure ERR_DES_cfb64_encrypt(in_:Pbyte; out_:Pbyte; length:longint; schedule:PDES_key_schedule; ivec:PDES_cblock; num:Plongint; enc:longint); +begin + EIdAPIFunctionNotPresent.RaiseException(DES_cfb64_encrypt_procname); +end; + + + +(* Const before type ignored *) +procedure ERR_DES_ofb64_encrypt(in_:Pbyte; out_:Pbyte; length:longint; schedule:PDES_key_schedule; ivec:PDES_cblock; num:Plongint); +begin + EIdAPIFunctionNotPresent.RaiseException(DES_ofb64_encrypt_procname); +end; + + + +procedure ERR_DES_fixup_key_parity(key: PDES_cblock); +begin + EIdAPIFunctionNotPresent.RaiseException(DES_fixup_key_parity_procname); +end; + + + +{$WARN NO_RETVAL ON} + +procedure Load(const ADllHandle: TIdLibHandle; LibVersion: TIdC_UINT; const AFailed: TStringList); + +var FuncLoadError: boolean; + +begin + DES_ecb2_encrypt := LoadLibFunction(ADllHandle, DES_ecb2_encrypt_procname); + FuncLoadError := not assigned(DES_ecb2_encrypt); + if FuncLoadError then + begin + {$if not defined(DES_ecb2_encrypt_allownil)} + DES_ecb2_encrypt := @ERR_DES_ecb2_encrypt; + {$ifend} + {$if declared(DES_ecb2_encrypt_introduced)} + if LibVersion < DES_ecb2_encrypt_introduced then + begin + {$if declared(FC_DES_ecb2_encrypt)} + DES_ecb2_encrypt := @FC_DES_ecb2_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DES_ecb2_encrypt_removed)} + if DES_ecb2_encrypt_removed <= LibVersion then + begin + {$if declared(_DES_ecb2_encrypt)} + DES_ecb2_encrypt := @_DES_ecb2_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DES_ecb2_encrypt_allownil)} + if FuncLoadError then + AFailed.Add('DES_ecb2_encrypt'); + {$ifend} + end; + + + DES_ede2_cbc_encrypt := LoadLibFunction(ADllHandle, DES_ede2_cbc_encrypt_procname); + FuncLoadError := not assigned(DES_ede2_cbc_encrypt); + if FuncLoadError then + begin + {$if not defined(DES_ede2_cbc_encrypt_allownil)} + DES_ede2_cbc_encrypt := @ERR_DES_ede2_cbc_encrypt; + {$ifend} + {$if declared(DES_ede2_cbc_encrypt_introduced)} + if LibVersion < DES_ede2_cbc_encrypt_introduced then + begin + {$if declared(FC_DES_ede2_cbc_encrypt)} + DES_ede2_cbc_encrypt := @FC_DES_ede2_cbc_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DES_ede2_cbc_encrypt_removed)} + if DES_ede2_cbc_encrypt_removed <= LibVersion then + begin + {$if declared(_DES_ede2_cbc_encrypt)} + DES_ede2_cbc_encrypt := @_DES_ede2_cbc_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DES_ede2_cbc_encrypt_allownil)} + if FuncLoadError then + AFailed.Add('DES_ede2_cbc_encrypt'); + {$ifend} + end; + + + DES_ede2_cfb64_encrypt := LoadLibFunction(ADllHandle, DES_ede2_cfb64_encrypt_procname); + FuncLoadError := not assigned(DES_ede2_cfb64_encrypt); + if FuncLoadError then + begin + {$if not defined(DES_ede2_cfb64_encrypt_allownil)} + DES_ede2_cfb64_encrypt := @ERR_DES_ede2_cfb64_encrypt; + {$ifend} + {$if declared(DES_ede2_cfb64_encrypt_introduced)} + if LibVersion < DES_ede2_cfb64_encrypt_introduced then + begin + {$if declared(FC_DES_ede2_cfb64_encrypt)} + DES_ede2_cfb64_encrypt := @FC_DES_ede2_cfb64_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DES_ede2_cfb64_encrypt_removed)} + if DES_ede2_cfb64_encrypt_removed <= LibVersion then + begin + {$if declared(_DES_ede2_cfb64_encrypt)} + DES_ede2_cfb64_encrypt := @_DES_ede2_cfb64_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DES_ede2_cfb64_encrypt_allownil)} + if FuncLoadError then + AFailed.Add('DES_ede2_cfb64_encrypt'); + {$ifend} + end; + + + DES_ede2_ofb64_encrypt := LoadLibFunction(ADllHandle, DES_ede2_ofb64_encrypt_procname); + FuncLoadError := not assigned(DES_ede2_ofb64_encrypt); + if FuncLoadError then + begin + {$if not defined(DES_ede2_ofb64_encrypt_allownil)} + DES_ede2_ofb64_encrypt := @ERR_DES_ede2_ofb64_encrypt; + {$ifend} + {$if declared(DES_ede2_ofb64_encrypt_introduced)} + if LibVersion < DES_ede2_ofb64_encrypt_introduced then + begin + {$if declared(FC_DES_ede2_ofb64_encrypt)} + DES_ede2_ofb64_encrypt := @FC_DES_ede2_ofb64_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DES_ede2_ofb64_encrypt_removed)} + if DES_ede2_ofb64_encrypt_removed <= LibVersion then + begin + {$if declared(_DES_ede2_ofb64_encrypt)} + DES_ede2_ofb64_encrypt := @_DES_ede2_ofb64_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DES_ede2_ofb64_encrypt_allownil)} + if FuncLoadError then + AFailed.Add('DES_ede2_ofb64_encrypt'); + {$ifend} + end; + + + DES_options := LoadLibFunction(ADllHandle, DES_options_procname); + FuncLoadError := not assigned(DES_options); + if FuncLoadError then + begin + {$if not defined(DES_options_allownil)} + DES_options := @ERR_DES_options; + {$ifend} + {$if declared(DES_options_introduced)} + if LibVersion < DES_options_introduced then + begin + {$if declared(FC_DES_options)} + DES_options := @FC_DES_options; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DES_options_removed)} + if DES_options_removed <= LibVersion then + begin + {$if declared(_DES_options)} + DES_options := @_DES_options; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DES_options_allownil)} + if FuncLoadError then + AFailed.Add('DES_options'); + {$ifend} + end; + + + DES_ecb3_encrypt := LoadLibFunction(ADllHandle, DES_ecb3_encrypt_procname); + FuncLoadError := not assigned(DES_ecb3_encrypt); + if FuncLoadError then + begin + {$if not defined(DES_ecb3_encrypt_allownil)} + DES_ecb3_encrypt := @ERR_DES_ecb3_encrypt; + {$ifend} + {$if declared(DES_ecb3_encrypt_introduced)} + if LibVersion < DES_ecb3_encrypt_introduced then + begin + {$if declared(FC_DES_ecb3_encrypt)} + DES_ecb3_encrypt := @FC_DES_ecb3_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DES_ecb3_encrypt_removed)} + if DES_ecb3_encrypt_removed <= LibVersion then + begin + {$if declared(_DES_ecb3_encrypt)} + DES_ecb3_encrypt := @_DES_ecb3_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DES_ecb3_encrypt_allownil)} + if FuncLoadError then + AFailed.Add('DES_ecb3_encrypt'); + {$ifend} + end; + + + DES_cbc_cksum := LoadLibFunction(ADllHandle, DES_cbc_cksum_procname); + FuncLoadError := not assigned(DES_cbc_cksum); + if FuncLoadError then + begin + {$if not defined(DES_cbc_cksum_allownil)} + DES_cbc_cksum := @ERR_DES_cbc_cksum; + {$ifend} + {$if declared(DES_cbc_cksum_introduced)} + if LibVersion < DES_cbc_cksum_introduced then + begin + {$if declared(FC_DES_cbc_cksum)} + DES_cbc_cksum := @FC_DES_cbc_cksum; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DES_cbc_cksum_removed)} + if DES_cbc_cksum_removed <= LibVersion then + begin + {$if declared(_DES_cbc_cksum)} + DES_cbc_cksum := @_DES_cbc_cksum; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DES_cbc_cksum_allownil)} + if FuncLoadError then + AFailed.Add('DES_cbc_cksum'); + {$ifend} + end; + + + DES_cbc_encrypt := LoadLibFunction(ADllHandle, DES_cbc_encrypt_procname); + FuncLoadError := not assigned(DES_cbc_encrypt); + if FuncLoadError then + begin + {$if not defined(DES_cbc_encrypt_allownil)} + DES_cbc_encrypt := @ERR_DES_cbc_encrypt; + {$ifend} + {$if declared(DES_cbc_encrypt_introduced)} + if LibVersion < DES_cbc_encrypt_introduced then + begin + {$if declared(FC_DES_cbc_encrypt)} + DES_cbc_encrypt := @FC_DES_cbc_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DES_cbc_encrypt_removed)} + if DES_cbc_encrypt_removed <= LibVersion then + begin + {$if declared(_DES_cbc_encrypt)} + DES_cbc_encrypt := @_DES_cbc_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DES_cbc_encrypt_allownil)} + if FuncLoadError then + AFailed.Add('DES_cbc_encrypt'); + {$ifend} + end; + + + DES_ncbc_encrypt := LoadLibFunction(ADllHandle, DES_ncbc_encrypt_procname); + FuncLoadError := not assigned(DES_ncbc_encrypt); + if FuncLoadError then + begin + {$if not defined(DES_ncbc_encrypt_allownil)} + DES_ncbc_encrypt := @ERR_DES_ncbc_encrypt; + {$ifend} + {$if declared(DES_ncbc_encrypt_introduced)} + if LibVersion < DES_ncbc_encrypt_introduced then + begin + {$if declared(FC_DES_ncbc_encrypt)} + DES_ncbc_encrypt := @FC_DES_ncbc_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DES_ncbc_encrypt_removed)} + if DES_ncbc_encrypt_removed <= LibVersion then + begin + {$if declared(_DES_ncbc_encrypt)} + DES_ncbc_encrypt := @_DES_ncbc_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DES_ncbc_encrypt_allownil)} + if FuncLoadError then + AFailed.Add('DES_ncbc_encrypt'); + {$ifend} + end; + + + DES_xcbc_encrypt := LoadLibFunction(ADllHandle, DES_xcbc_encrypt_procname); + FuncLoadError := not assigned(DES_xcbc_encrypt); + if FuncLoadError then + begin + {$if not defined(DES_xcbc_encrypt_allownil)} + DES_xcbc_encrypt := @ERR_DES_xcbc_encrypt; + {$ifend} + {$if declared(DES_xcbc_encrypt_introduced)} + if LibVersion < DES_xcbc_encrypt_introduced then + begin + {$if declared(FC_DES_xcbc_encrypt)} + DES_xcbc_encrypt := @FC_DES_xcbc_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DES_xcbc_encrypt_removed)} + if DES_xcbc_encrypt_removed <= LibVersion then + begin + {$if declared(_DES_xcbc_encrypt)} + DES_xcbc_encrypt := @_DES_xcbc_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DES_xcbc_encrypt_allownil)} + if FuncLoadError then + AFailed.Add('DES_xcbc_encrypt'); + {$ifend} + end; + + + DES_cfb_encrypt := LoadLibFunction(ADllHandle, DES_cfb_encrypt_procname); + FuncLoadError := not assigned(DES_cfb_encrypt); + if FuncLoadError then + begin + {$if not defined(DES_cfb_encrypt_allownil)} + DES_cfb_encrypt := @ERR_DES_cfb_encrypt; + {$ifend} + {$if declared(DES_cfb_encrypt_introduced)} + if LibVersion < DES_cfb_encrypt_introduced then + begin + {$if declared(FC_DES_cfb_encrypt)} + DES_cfb_encrypt := @FC_DES_cfb_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DES_cfb_encrypt_removed)} + if DES_cfb_encrypt_removed <= LibVersion then + begin + {$if declared(_DES_cfb_encrypt)} + DES_cfb_encrypt := @_DES_cfb_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DES_cfb_encrypt_allownil)} + if FuncLoadError then + AFailed.Add('DES_cfb_encrypt'); + {$ifend} + end; + + + DES_ecb_encrypt := LoadLibFunction(ADllHandle, DES_ecb_encrypt_procname); + FuncLoadError := not assigned(DES_ecb_encrypt); + if FuncLoadError then + begin + {$if not defined(DES_ecb_encrypt_allownil)} + DES_ecb_encrypt := @ERR_DES_ecb_encrypt; + {$ifend} + {$if declared(DES_ecb_encrypt_introduced)} + if LibVersion < DES_ecb_encrypt_introduced then + begin + {$if declared(FC_DES_ecb_encrypt)} + DES_ecb_encrypt := @FC_DES_ecb_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DES_ecb_encrypt_removed)} + if DES_ecb_encrypt_removed <= LibVersion then + begin + {$if declared(_DES_ecb_encrypt)} + DES_ecb_encrypt := @_DES_ecb_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DES_ecb_encrypt_allownil)} + if FuncLoadError then + AFailed.Add('DES_ecb_encrypt'); + {$ifend} + end; + + + DES_encrypt1 := LoadLibFunction(ADllHandle, DES_encrypt1_procname); + FuncLoadError := not assigned(DES_encrypt1); + if FuncLoadError then + begin + {$if not defined(DES_encrypt1_allownil)} + DES_encrypt1 := @ERR_DES_encrypt1; + {$ifend} + {$if declared(DES_encrypt1_introduced)} + if LibVersion < DES_encrypt1_introduced then + begin + {$if declared(FC_DES_encrypt1)} + DES_encrypt1 := @FC_DES_encrypt1; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DES_encrypt1_removed)} + if DES_encrypt1_removed <= LibVersion then + begin + {$if declared(_DES_encrypt1)} + DES_encrypt1 := @_DES_encrypt1; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DES_encrypt1_allownil)} + if FuncLoadError then + AFailed.Add('DES_encrypt1'); + {$ifend} + end; + + + DES_encrypt2 := LoadLibFunction(ADllHandle, DES_encrypt2_procname); + FuncLoadError := not assigned(DES_encrypt2); + if FuncLoadError then + begin + {$if not defined(DES_encrypt2_allownil)} + DES_encrypt2 := @ERR_DES_encrypt2; + {$ifend} + {$if declared(DES_encrypt2_introduced)} + if LibVersion < DES_encrypt2_introduced then + begin + {$if declared(FC_DES_encrypt2)} + DES_encrypt2 := @FC_DES_encrypt2; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DES_encrypt2_removed)} + if DES_encrypt2_removed <= LibVersion then + begin + {$if declared(_DES_encrypt2)} + DES_encrypt2 := @_DES_encrypt2; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DES_encrypt2_allownil)} + if FuncLoadError then + AFailed.Add('DES_encrypt2'); + {$ifend} + end; + + + DES_encrypt3 := LoadLibFunction(ADllHandle, DES_encrypt3_procname); + FuncLoadError := not assigned(DES_encrypt3); + if FuncLoadError then + begin + {$if not defined(DES_encrypt3_allownil)} + DES_encrypt3 := @ERR_DES_encrypt3; + {$ifend} + {$if declared(DES_encrypt3_introduced)} + if LibVersion < DES_encrypt3_introduced then + begin + {$if declared(FC_DES_encrypt3)} + DES_encrypt3 := @FC_DES_encrypt3; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DES_encrypt3_removed)} + if DES_encrypt3_removed <= LibVersion then + begin + {$if declared(_DES_encrypt3)} + DES_encrypt3 := @_DES_encrypt3; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DES_encrypt3_allownil)} + if FuncLoadError then + AFailed.Add('DES_encrypt3'); + {$ifend} + end; + + + DES_decrypt3 := LoadLibFunction(ADllHandle, DES_decrypt3_procname); + FuncLoadError := not assigned(DES_decrypt3); + if FuncLoadError then + begin + {$if not defined(DES_decrypt3_allownil)} + DES_decrypt3 := @ERR_DES_decrypt3; + {$ifend} + {$if declared(DES_decrypt3_introduced)} + if LibVersion < DES_decrypt3_introduced then + begin + {$if declared(FC_DES_decrypt3)} + DES_decrypt3 := @FC_DES_decrypt3; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DES_decrypt3_removed)} + if DES_decrypt3_removed <= LibVersion then + begin + {$if declared(_DES_decrypt3)} + DES_decrypt3 := @_DES_decrypt3; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DES_decrypt3_allownil)} + if FuncLoadError then + AFailed.Add('DES_decrypt3'); + {$ifend} + end; + + + DES_ede3_cbc_encrypt := LoadLibFunction(ADllHandle, DES_ede3_cbc_encrypt_procname); + FuncLoadError := not assigned(DES_ede3_cbc_encrypt); + if FuncLoadError then + begin + {$if not defined(DES_ede3_cbc_encrypt_allownil)} + DES_ede3_cbc_encrypt := @ERR_DES_ede3_cbc_encrypt; + {$ifend} + {$if declared(DES_ede3_cbc_encrypt_introduced)} + if LibVersion < DES_ede3_cbc_encrypt_introduced then + begin + {$if declared(FC_DES_ede3_cbc_encrypt)} + DES_ede3_cbc_encrypt := @FC_DES_ede3_cbc_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DES_ede3_cbc_encrypt_removed)} + if DES_ede3_cbc_encrypt_removed <= LibVersion then + begin + {$if declared(_DES_ede3_cbc_encrypt)} + DES_ede3_cbc_encrypt := @_DES_ede3_cbc_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DES_ede3_cbc_encrypt_allownil)} + if FuncLoadError then + AFailed.Add('DES_ede3_cbc_encrypt'); + {$ifend} + end; + + + DES_ede3_cfb64_encrypt := LoadLibFunction(ADllHandle, DES_ede3_cfb64_encrypt_procname); + FuncLoadError := not assigned(DES_ede3_cfb64_encrypt); + if FuncLoadError then + begin + {$if not defined(DES_ede3_cfb64_encrypt_allownil)} + DES_ede3_cfb64_encrypt := @ERR_DES_ede3_cfb64_encrypt; + {$ifend} + {$if declared(DES_ede3_cfb64_encrypt_introduced)} + if LibVersion < DES_ede3_cfb64_encrypt_introduced then + begin + {$if declared(FC_DES_ede3_cfb64_encrypt)} + DES_ede3_cfb64_encrypt := @FC_DES_ede3_cfb64_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DES_ede3_cfb64_encrypt_removed)} + if DES_ede3_cfb64_encrypt_removed <= LibVersion then + begin + {$if declared(_DES_ede3_cfb64_encrypt)} + DES_ede3_cfb64_encrypt := @_DES_ede3_cfb64_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DES_ede3_cfb64_encrypt_allownil)} + if FuncLoadError then + AFailed.Add('DES_ede3_cfb64_encrypt'); + {$ifend} + end; + + + DES_ede3_cfb_encrypt := LoadLibFunction(ADllHandle, DES_ede3_cfb_encrypt_procname); + FuncLoadError := not assigned(DES_ede3_cfb_encrypt); + if FuncLoadError then + begin + {$if not defined(DES_ede3_cfb_encrypt_allownil)} + DES_ede3_cfb_encrypt := @ERR_DES_ede3_cfb_encrypt; + {$ifend} + {$if declared(DES_ede3_cfb_encrypt_introduced)} + if LibVersion < DES_ede3_cfb_encrypt_introduced then + begin + {$if declared(FC_DES_ede3_cfb_encrypt)} + DES_ede3_cfb_encrypt := @FC_DES_ede3_cfb_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DES_ede3_cfb_encrypt_removed)} + if DES_ede3_cfb_encrypt_removed <= LibVersion then + begin + {$if declared(_DES_ede3_cfb_encrypt)} + DES_ede3_cfb_encrypt := @_DES_ede3_cfb_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DES_ede3_cfb_encrypt_allownil)} + if FuncLoadError then + AFailed.Add('DES_ede3_cfb_encrypt'); + {$ifend} + end; + + + DES_ede3_ofb64_encrypt := LoadLibFunction(ADllHandle, DES_ede3_ofb64_encrypt_procname); + FuncLoadError := not assigned(DES_ede3_ofb64_encrypt); + if FuncLoadError then + begin + {$if not defined(DES_ede3_ofb64_encrypt_allownil)} + DES_ede3_ofb64_encrypt := @ERR_DES_ede3_ofb64_encrypt; + {$ifend} + {$if declared(DES_ede3_ofb64_encrypt_introduced)} + if LibVersion < DES_ede3_ofb64_encrypt_introduced then + begin + {$if declared(FC_DES_ede3_ofb64_encrypt)} + DES_ede3_ofb64_encrypt := @FC_DES_ede3_ofb64_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DES_ede3_ofb64_encrypt_removed)} + if DES_ede3_ofb64_encrypt_removed <= LibVersion then + begin + {$if declared(_DES_ede3_ofb64_encrypt)} + DES_ede3_ofb64_encrypt := @_DES_ede3_ofb64_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DES_ede3_ofb64_encrypt_allownil)} + if FuncLoadError then + AFailed.Add('DES_ede3_ofb64_encrypt'); + {$ifend} + end; + + + DES_fcrypt := LoadLibFunction(ADllHandle, DES_fcrypt_procname); + FuncLoadError := not assigned(DES_fcrypt); + if FuncLoadError then + begin + {$if not defined(DES_fcrypt_allownil)} + DES_fcrypt := @ERR_DES_fcrypt; + {$ifend} + {$if declared(DES_fcrypt_introduced)} + if LibVersion < DES_fcrypt_introduced then + begin + {$if declared(FC_DES_fcrypt)} + DES_fcrypt := @FC_DES_fcrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DES_fcrypt_removed)} + if DES_fcrypt_removed <= LibVersion then + begin + {$if declared(_DES_fcrypt)} + DES_fcrypt := @_DES_fcrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DES_fcrypt_allownil)} + if FuncLoadError then + AFailed.Add('DES_fcrypt'); + {$ifend} + end; + + + DES_crypt := LoadLibFunction(ADllHandle, DES_crypt_procname); + FuncLoadError := not assigned(DES_crypt); + if FuncLoadError then + begin + {$if not defined(DES_crypt_allownil)} + DES_crypt := @ERR_DES_crypt; + {$ifend} + {$if declared(DES_crypt_introduced)} + if LibVersion < DES_crypt_introduced then + begin + {$if declared(FC_DES_crypt)} + DES_crypt := @FC_DES_crypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DES_crypt_removed)} + if DES_crypt_removed <= LibVersion then + begin + {$if declared(_DES_crypt)} + DES_crypt := @_DES_crypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DES_crypt_allownil)} + if FuncLoadError then + AFailed.Add('DES_crypt'); + {$ifend} + end; + + + DES_ofb_encrypt := LoadLibFunction(ADllHandle, DES_ofb_encrypt_procname); + FuncLoadError := not assigned(DES_ofb_encrypt); + if FuncLoadError then + begin + {$if not defined(DES_ofb_encrypt_allownil)} + DES_ofb_encrypt := @ERR_DES_ofb_encrypt; + {$ifend} + {$if declared(DES_ofb_encrypt_introduced)} + if LibVersion < DES_ofb_encrypt_introduced then + begin + {$if declared(FC_DES_ofb_encrypt)} + DES_ofb_encrypt := @FC_DES_ofb_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DES_ofb_encrypt_removed)} + if DES_ofb_encrypt_removed <= LibVersion then + begin + {$if declared(_DES_ofb_encrypt)} + DES_ofb_encrypt := @_DES_ofb_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DES_ofb_encrypt_allownil)} + if FuncLoadError then + AFailed.Add('DES_ofb_encrypt'); + {$ifend} + end; + + + DES_pcbc_encrypt := LoadLibFunction(ADllHandle, DES_pcbc_encrypt_procname); + FuncLoadError := not assigned(DES_pcbc_encrypt); + if FuncLoadError then + begin + {$if not defined(DES_pcbc_encrypt_allownil)} + DES_pcbc_encrypt := @ERR_DES_pcbc_encrypt; + {$ifend} + {$if declared(DES_pcbc_encrypt_introduced)} + if LibVersion < DES_pcbc_encrypt_introduced then + begin + {$if declared(FC_DES_pcbc_encrypt)} + DES_pcbc_encrypt := @FC_DES_pcbc_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DES_pcbc_encrypt_removed)} + if DES_pcbc_encrypt_removed <= LibVersion then + begin + {$if declared(_DES_pcbc_encrypt)} + DES_pcbc_encrypt := @_DES_pcbc_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DES_pcbc_encrypt_allownil)} + if FuncLoadError then + AFailed.Add('DES_pcbc_encrypt'); + {$ifend} + end; + + + DES_quad_cksum := LoadLibFunction(ADllHandle, DES_quad_cksum_procname); + FuncLoadError := not assigned(DES_quad_cksum); + if FuncLoadError then + begin + {$if not defined(DES_quad_cksum_allownil)} + DES_quad_cksum := @ERR_DES_quad_cksum; + {$ifend} + {$if declared(DES_quad_cksum_introduced)} + if LibVersion < DES_quad_cksum_introduced then + begin + {$if declared(FC_DES_quad_cksum)} + DES_quad_cksum := @FC_DES_quad_cksum; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DES_quad_cksum_removed)} + if DES_quad_cksum_removed <= LibVersion then + begin + {$if declared(_DES_quad_cksum)} + DES_quad_cksum := @_DES_quad_cksum; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DES_quad_cksum_allownil)} + if FuncLoadError then + AFailed.Add('DES_quad_cksum'); + {$ifend} + end; + + + DES_random_key := LoadLibFunction(ADllHandle, DES_random_key_procname); + FuncLoadError := not assigned(DES_random_key); + if FuncLoadError then + begin + {$if not defined(DES_random_key_allownil)} + DES_random_key := @ERR_DES_random_key; + {$ifend} + {$if declared(DES_random_key_introduced)} + if LibVersion < DES_random_key_introduced then + begin + {$if declared(FC_DES_random_key)} + DES_random_key := @FC_DES_random_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DES_random_key_removed)} + if DES_random_key_removed <= LibVersion then + begin + {$if declared(_DES_random_key)} + DES_random_key := @_DES_random_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DES_random_key_allownil)} + if FuncLoadError then + AFailed.Add('DES_random_key'); + {$ifend} + end; + + + DES_set_odd_parity := LoadLibFunction(ADllHandle, DES_set_odd_parity_procname); + FuncLoadError := not assigned(DES_set_odd_parity); + if FuncLoadError then + begin + {$if not defined(DES_set_odd_parity_allownil)} + DES_set_odd_parity := @ERR_DES_set_odd_parity; + {$ifend} + {$if declared(DES_set_odd_parity_introduced)} + if LibVersion < DES_set_odd_parity_introduced then + begin + {$if declared(FC_DES_set_odd_parity)} + DES_set_odd_parity := @FC_DES_set_odd_parity; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DES_set_odd_parity_removed)} + if DES_set_odd_parity_removed <= LibVersion then + begin + {$if declared(_DES_set_odd_parity)} + DES_set_odd_parity := @_DES_set_odd_parity; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DES_set_odd_parity_allownil)} + if FuncLoadError then + AFailed.Add('DES_set_odd_parity'); + {$ifend} + end; + + + DES_check_key_parity := LoadLibFunction(ADllHandle, DES_check_key_parity_procname); + FuncLoadError := not assigned(DES_check_key_parity); + if FuncLoadError then + begin + {$if not defined(DES_check_key_parity_allownil)} + DES_check_key_parity := @ERR_DES_check_key_parity; + {$ifend} + {$if declared(DES_check_key_parity_introduced)} + if LibVersion < DES_check_key_parity_introduced then + begin + {$if declared(FC_DES_check_key_parity)} + DES_check_key_parity := @FC_DES_check_key_parity; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DES_check_key_parity_removed)} + if DES_check_key_parity_removed <= LibVersion then + begin + {$if declared(_DES_check_key_parity)} + DES_check_key_parity := @_DES_check_key_parity; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DES_check_key_parity_allownil)} + if FuncLoadError then + AFailed.Add('DES_check_key_parity'); + {$ifend} + end; + + + DES_is_weak_key := LoadLibFunction(ADllHandle, DES_is_weak_key_procname); + FuncLoadError := not assigned(DES_is_weak_key); + if FuncLoadError then + begin + {$if not defined(DES_is_weak_key_allownil)} + DES_is_weak_key := @ERR_DES_is_weak_key; + {$ifend} + {$if declared(DES_is_weak_key_introduced)} + if LibVersion < DES_is_weak_key_introduced then + begin + {$if declared(FC_DES_is_weak_key)} + DES_is_weak_key := @FC_DES_is_weak_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DES_is_weak_key_removed)} + if DES_is_weak_key_removed <= LibVersion then + begin + {$if declared(_DES_is_weak_key)} + DES_is_weak_key := @_DES_is_weak_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DES_is_weak_key_allownil)} + if FuncLoadError then + AFailed.Add('DES_is_weak_key'); + {$ifend} + end; + + + DES_set_key := LoadLibFunction(ADllHandle, DES_set_key_procname); + FuncLoadError := not assigned(DES_set_key); + if FuncLoadError then + begin + {$if not defined(DES_set_key_allownil)} + DES_set_key := @ERR_DES_set_key; + {$ifend} + {$if declared(DES_set_key_introduced)} + if LibVersion < DES_set_key_introduced then + begin + {$if declared(FC_DES_set_key)} + DES_set_key := @FC_DES_set_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DES_set_key_removed)} + if DES_set_key_removed <= LibVersion then + begin + {$if declared(_DES_set_key)} + DES_set_key := @_DES_set_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DES_set_key_allownil)} + if FuncLoadError then + AFailed.Add('DES_set_key'); + {$ifend} + end; + + + DES_key_sched := LoadLibFunction(ADllHandle, DES_key_sched_procname); + FuncLoadError := not assigned(DES_key_sched); + if FuncLoadError then + begin + {$if not defined(DES_key_sched_allownil)} + DES_key_sched := @ERR_DES_key_sched; + {$ifend} + {$if declared(DES_key_sched_introduced)} + if LibVersion < DES_key_sched_introduced then + begin + {$if declared(FC_DES_key_sched)} + DES_key_sched := @FC_DES_key_sched; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DES_key_sched_removed)} + if DES_key_sched_removed <= LibVersion then + begin + {$if declared(_DES_key_sched)} + DES_key_sched := @_DES_key_sched; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DES_key_sched_allownil)} + if FuncLoadError then + AFailed.Add('DES_key_sched'); + {$ifend} + end; + + + DES_set_key_checked := LoadLibFunction(ADllHandle, DES_set_key_checked_procname); + FuncLoadError := not assigned(DES_set_key_checked); + if FuncLoadError then + begin + {$if not defined(DES_set_key_checked_allownil)} + DES_set_key_checked := @ERR_DES_set_key_checked; + {$ifend} + {$if declared(DES_set_key_checked_introduced)} + if LibVersion < DES_set_key_checked_introduced then + begin + {$if declared(FC_DES_set_key_checked)} + DES_set_key_checked := @FC_DES_set_key_checked; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DES_set_key_checked_removed)} + if DES_set_key_checked_removed <= LibVersion then + begin + {$if declared(_DES_set_key_checked)} + DES_set_key_checked := @_DES_set_key_checked; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DES_set_key_checked_allownil)} + if FuncLoadError then + AFailed.Add('DES_set_key_checked'); + {$ifend} + end; + + + DES_set_key_unchecked := LoadLibFunction(ADllHandle, DES_set_key_unchecked_procname); + FuncLoadError := not assigned(DES_set_key_unchecked); + if FuncLoadError then + begin + {$if not defined(DES_set_key_unchecked_allownil)} + DES_set_key_unchecked := @ERR_DES_set_key_unchecked; + {$ifend} + {$if declared(DES_set_key_unchecked_introduced)} + if LibVersion < DES_set_key_unchecked_introduced then + begin + {$if declared(FC_DES_set_key_unchecked)} + DES_set_key_unchecked := @FC_DES_set_key_unchecked; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DES_set_key_unchecked_removed)} + if DES_set_key_unchecked_removed <= LibVersion then + begin + {$if declared(_DES_set_key_unchecked)} + DES_set_key_unchecked := @_DES_set_key_unchecked; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DES_set_key_unchecked_allownil)} + if FuncLoadError then + AFailed.Add('DES_set_key_unchecked'); + {$ifend} + end; + + + DES_string_to_key := LoadLibFunction(ADllHandle, DES_string_to_key_procname); + FuncLoadError := not assigned(DES_string_to_key); + if FuncLoadError then + begin + {$if not defined(DES_string_to_key_allownil)} + DES_string_to_key := @ERR_DES_string_to_key; + {$ifend} + {$if declared(DES_string_to_key_introduced)} + if LibVersion < DES_string_to_key_introduced then + begin + {$if declared(FC_DES_string_to_key)} + DES_string_to_key := @FC_DES_string_to_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DES_string_to_key_removed)} + if DES_string_to_key_removed <= LibVersion then + begin + {$if declared(_DES_string_to_key)} + DES_string_to_key := @_DES_string_to_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DES_string_to_key_allownil)} + if FuncLoadError then + AFailed.Add('DES_string_to_key'); + {$ifend} + end; + + + DES_string_to_2keys := LoadLibFunction(ADllHandle, DES_string_to_2keys_procname); + FuncLoadError := not assigned(DES_string_to_2keys); + if FuncLoadError then + begin + {$if not defined(DES_string_to_2keys_allownil)} + DES_string_to_2keys := @ERR_DES_string_to_2keys; + {$ifend} + {$if declared(DES_string_to_2keys_introduced)} + if LibVersion < DES_string_to_2keys_introduced then + begin + {$if declared(FC_DES_string_to_2keys)} + DES_string_to_2keys := @FC_DES_string_to_2keys; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DES_string_to_2keys_removed)} + if DES_string_to_2keys_removed <= LibVersion then + begin + {$if declared(_DES_string_to_2keys)} + DES_string_to_2keys := @_DES_string_to_2keys; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DES_string_to_2keys_allownil)} + if FuncLoadError then + AFailed.Add('DES_string_to_2keys'); + {$ifend} + end; + + + DES_cfb64_encrypt := LoadLibFunction(ADllHandle, DES_cfb64_encrypt_procname); + FuncLoadError := not assigned(DES_cfb64_encrypt); + if FuncLoadError then + begin + {$if not defined(DES_cfb64_encrypt_allownil)} + DES_cfb64_encrypt := @ERR_DES_cfb64_encrypt; + {$ifend} + {$if declared(DES_cfb64_encrypt_introduced)} + if LibVersion < DES_cfb64_encrypt_introduced then + begin + {$if declared(FC_DES_cfb64_encrypt)} + DES_cfb64_encrypt := @FC_DES_cfb64_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DES_cfb64_encrypt_removed)} + if DES_cfb64_encrypt_removed <= LibVersion then + begin + {$if declared(_DES_cfb64_encrypt)} + DES_cfb64_encrypt := @_DES_cfb64_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DES_cfb64_encrypt_allownil)} + if FuncLoadError then + AFailed.Add('DES_cfb64_encrypt'); + {$ifend} + end; + + + DES_ofb64_encrypt := LoadLibFunction(ADllHandle, DES_ofb64_encrypt_procname); + FuncLoadError := not assigned(DES_ofb64_encrypt); + if FuncLoadError then + begin + {$if not defined(DES_ofb64_encrypt_allownil)} + DES_ofb64_encrypt := @ERR_DES_ofb64_encrypt; + {$ifend} + {$if declared(DES_ofb64_encrypt_introduced)} + if LibVersion < DES_ofb64_encrypt_introduced then + begin + {$if declared(FC_DES_ofb64_encrypt)} + DES_ofb64_encrypt := @FC_DES_ofb64_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DES_ofb64_encrypt_removed)} + if DES_ofb64_encrypt_removed <= LibVersion then + begin + {$if declared(_DES_ofb64_encrypt)} + DES_ofb64_encrypt := @_DES_ofb64_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DES_ofb64_encrypt_allownil)} + if FuncLoadError then + AFailed.Add('DES_ofb64_encrypt'); + {$ifend} + end; + + + DES_fixup_key_parity := LoadLibFunction(ADllHandle, DES_fixup_key_parity_procname); + FuncLoadError := not assigned(DES_fixup_key_parity); + if FuncLoadError then + begin + {$if not defined(DES_fixup_key_parity_allownil)} + DES_fixup_key_parity := @ERR_DES_fixup_key_parity; + {$ifend} + {$if declared(DES_fixup_key_parity_introduced)} + if LibVersion < DES_fixup_key_parity_introduced then + begin + {$if declared(FC_DES_fixup_key_parity)} + DES_fixup_key_parity := @FC_DES_fixup_key_parity; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DES_fixup_key_parity_removed)} + if DES_fixup_key_parity_removed <= LibVersion then + begin + {$if declared(_DES_fixup_key_parity)} + DES_fixup_key_parity := @_DES_fixup_key_parity; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DES_fixup_key_parity_allownil)} + if FuncLoadError then + AFailed.Add('DES_fixup_key_parity'); + {$ifend} + end; + + +end; + +procedure Unload; +begin + DES_ecb2_encrypt := nil; {removed 1.0.0} + DES_ede2_cbc_encrypt := nil; {removed 1.0.0} + DES_ede2_cfb64_encrypt := nil; {removed 1.0.0} + DES_ede2_ofb64_encrypt := nil; {removed 1.0.0} + DES_options := nil; + DES_ecb3_encrypt := nil; + DES_cbc_cksum := nil; + DES_cbc_encrypt := nil; + DES_ncbc_encrypt := nil; + DES_xcbc_encrypt := nil; + DES_cfb_encrypt := nil; + DES_ecb_encrypt := nil; + DES_encrypt1 := nil; + DES_encrypt2 := nil; + DES_encrypt3 := nil; + DES_decrypt3 := nil; + DES_ede3_cbc_encrypt := nil; + DES_ede3_cfb64_encrypt := nil; + DES_ede3_cfb_encrypt := nil; + DES_ede3_ofb64_encrypt := nil; + DES_fcrypt := nil; + DES_crypt := nil; + DES_ofb_encrypt := nil; + DES_pcbc_encrypt := nil; + DES_quad_cksum := nil; + DES_random_key := nil; + DES_set_odd_parity := nil; + DES_check_key_parity := nil; + DES_is_weak_key := nil; + DES_set_key := nil; + DES_key_sched := nil; + DES_set_key_checked := nil; + DES_set_key_unchecked := nil; + DES_string_to_key := nil; + DES_string_to_2keys := nil; + DES_cfb64_encrypt := nil; + DES_ofb64_encrypt := nil; + DES_fixup_key_parity := nil; {removed 1.0.0} +end; +{$ELSE} + procedure DES_ecb2_encrypt(input:Pconst_DES_cblock; output:PDES_cblock; ks1: PDES_key_schedule; ks2: PDES_key_schedule; enc: longint); + begin + DES_ecb3_encrypt(input,output,ks1,ks2,ks1,enc); + end; + + procedure DES_ede2_cbc_encrypt(input:Pbyte; output:Pbyte; length: longint; ks1: PDES_key_schedule; ks2: PDES_key_schedule; ivec: PDES_cblock; enc: longint); + begin + DES_ede3_cbc_encrypt(input,output,length,ks1,ks2,ks1,ivec,enc); + end; + + procedure DES_ede2_cfb64_encrypt(in_: Pbyte; out_: Pbyte; length: longint; ks1: PDES_key_schedule; ks2: PDES_key_schedule; ivec: PDES_cblock; num: Plongint; enc: longint); + begin + DES_ede3_cfb64_encrypt(in_,out_,length,ks1,ks2,ks1,ivec,num,enc); + end; + + procedure DES_ede2_ofb64_encrypt(in_: Pbyte; out_: Pbyte; length: longint; ks1: PDES_key_schedule; ks2: PDES_key_schedule; ivec: PDES_cblock; num: Plongint); + begin + DES_ede3_ofb64_encrypt(in_,out_,length,ks1,ks2,ks1,ivec,num); + end; + + procedure DES_fixup_key_parity(key:PDES_cblock); + begin + DES_set_odd_parity(key); + end; + + +{$ENDIF} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +initialization + Register_SSLLoader(@Load,'LibCrypto'); + Register_SSLUnloader(@Unload); +{$ENDIF} +end. diff --git a/IdOpenSSLHeaders_dh.pas b/IdOpenSSLHeaders_dh.pas new file mode 100644 index 0000000..a6a91e3 --- /dev/null +++ b/IdOpenSSLHeaders_dh.pas @@ -0,0 +1,3690 @@ + (* This unit was generated using the script genOpenSSLHdrs.sh from the source file IdOpenSSLHeaders_dh.h2pas + It should not be modified directly. All changes should be made to IdOpenSSLHeaders_dh.h2pas + and this file regenerated. IdOpenSSLHeaders_dh.h2pas is distributed with the full Indy + Distribution. + *) + +{$i IdCompilerDefines.inc} +{$i IdSSLOpenSSLDefines.inc} +{$IFNDEF USE_OPENSSL} + { error Should not compile if USE_OPENSSL is not defined!!!} +{$ENDIF} +{******************************************************************************} +{ } +{ Indy (Internet Direct) - Internet Protocols Simplified } +{ } +{ https://www.indyproject.org/ } +{ https://gitter.im/IndySockets/Indy } +{ } +{******************************************************************************} +{ } +{ This file is part of the Indy (Internet Direct) project, and is offered } +{ under the dual-licensing agreement described on the Indy website. } +{ (https://www.indyproject.org/license/) } +{ } +{ Copyright: } +{ (c) 1993-2020, Chad Z. Hower and the Indy Pit Crew. All rights reserved. } +{ } +{******************************************************************************} +{ } +{ } +{******************************************************************************} + +unit IdOpenSSLHeaders_dh; + +interface + +// Headers for OpenSSL 1.1.1 +// dh.h + + +uses + IdCTypes, + IdGlobal, + IdSSLOpenSSLConsts, + IdOpenSSLHeaders_ossl_typ, + IdOpenSSLHeaders_evp; + +const + OPENSSL_DH_MAX_MODULUS_BITS = 10000; + OPENSSL_DH_FIPS_MIN_MODULUS_BITS = 1024; + + DH_FLAG_CACHE_MONT_P = $01; + DH_FLAG_FIPS_METHOD = $0400; + DH_FLAG_NON_FIPS_ALLOW = $0400; + + DH_GENERATOR_2 = 2; + DH_GENERATOR_5 = 5; + + DH_CHECK_P_NOT_PRIME = $01; + DH_CHECK_P_NOT_SAFE_PRIME = $02; + DH_UNABLE_TO_CHECK_GENERATOR = $04; + DH_NOT_SUITABLE_GENERATOR = $08; + DH_CHECK_Q_NOT_PRIME = $10; + DH_CHECK_INVALID_Q_VALUE = $20; + DH_CHECK_INVALID_J_VALUE = $40; + DH_CHECK_PUBKEY_TOO_SMALL = $01; + DH_CHECK_PUBKEY_TOO_LARGE = $02; + DH_CHECK_PUBKEY_INVALID = $04; + DH_CHECK_P_NOT_STRONG_PRIME = DH_CHECK_P_NOT_SAFE_PRIME; + + EVP_PKEY_DH_KDF_NONE = 1; + EVP_PKEY_DH_KDF_X9_42 = 2; + + EVP_PKEY_CTRL_DH_PARAMGEN_PRIME_LEN = (EVP_PKEY_ALG_CTRL + 1); + EVP_PKEY_CTRL_DH_PARAMGEN_GENERATOR = (EVP_PKEY_ALG_CTRL + 2); + EVP_PKEY_CTRL_DH_RFC5114 = (EVP_PKEY_ALG_CTRL + 3); + EVP_PKEY_CTRL_DH_PARAMGEN_SUBPRIME_LEN = (EVP_PKEY_ALG_CTRL + 4); + EVP_PKEY_CTRL_DH_PARAMGEN_TYPE = (EVP_PKEY_ALG_CTRL + 5); + EVP_PKEY_CTRL_DH_KDF_TYPE = (EVP_PKEY_ALG_CTRL + 6); + EVP_PKEY_CTRL_DH_KDF_MD = (EVP_PKEY_ALG_CTRL + 7); + EVP_PKEY_CTRL_GET_DH_KDF_MD = (EVP_PKEY_ALG_CTRL + 8); + EVP_PKEY_CTRL_DH_KDF_OUTLEN = (EVP_PKEY_ALG_CTRL + 9); + EVP_PKEY_CTRL_GET_DH_KDF_OUTLEN = (EVP_PKEY_ALG_CTRL + 10); + EVP_PKEY_CTRL_DH_KDF_UKM = (EVP_PKEY_ALG_CTRL + 11); + EVP_PKEY_CTRL_GET_DH_KDF_UKM = (EVP_PKEY_ALG_CTRL + 12); + EVP_PKEY_CTRL_DH_KDF_OID = (EVP_PKEY_ALG_CTRL + 13); + EVP_PKEY_CTRL_GET_DH_KDF_OID = (EVP_PKEY_ALG_CTRL + 14); + EVP_PKEY_CTRL_DH_NID = (EVP_PKEY_ALG_CTRL + 15); + EVP_PKEY_CTRL_DH_PAD = (EVP_PKEY_ALG_CTRL + 16); + +type + DH_meth_generate_key_cb = function(dh: PDH): TIdC_INT cdecl; + DH_meth_compute_key_cb = function(key: PByte; const pub_key: PBIGNUM; dh: PDH): TIdC_INT cdecl; + DH_meth_bn_mod_exp_cb = function( + const dh: PDH; r: PBIGNUM; const a: PBIGNUM; + const p: PBIGNUM; const m: PBIGNUM; + ctx: PBN_CTX; m_ctx: PBN_MONT_CTX): TIdC_INT cdecl; + DH_meth_init_cb = function(dh: PDH): TIdC_INT cdecl; + DH_meth_finish_cb = function(dh: PDH): TIdC_INT cdecl; + DH_meth_generate_params_cb = function(dh: PDH; prime_len: TIdC_INT; generator: TIdC_INT; cb: PBN_GENCB): TIdC_INT cdecl; + +{ + # define DH_CHECK_P_NOT_STRONG_PRIME DH_CHECK_P_NOT_SAFE_PRIME + + # define d2i_DHparams_fp(fp,x) \ + (DH *)ASN1_d2i_fp((char *(*)())DH_new, \ + (char *(*)())d2i_DHparams, \ + (fp), \ + (unsigned char **)(x)) + # define i2d_DHparams_fp(fp,x) \ + ASN1_i2d_fp(i2d_DHparams,(fp), (unsigned char *)(x)) + # define d2i_DHparams_bio(bp,x) \ + ASN1_d2i_bio_of(DH, DH_new, d2i_DHparams, bp, x) + # define i2d_DHparams_bio(bp,x) \ + ASN1_i2d_bio_of_const(DH,i2d_DHparams,bp,x) + + # define d2i_DHxparams_fp(fp,x) \ + (DH *)ASN1_d2i_fp((char *(*)())DH_new, \ + (char *(*)())d2i_DHxparams, \ + (fp), \ + (unsigned char **)(x)) + # define i2d_DHxparams_fp(fp,x) \ + ASN1_i2d_fp(i2d_DHxparams,(fp), (unsigned char *)(x)) + # define d2i_DHxparams_bio(bp,x) \ + ASN1_d2i_bio_of(DH, DH_new, d2i_DHxparams, bp, x) + # define i2d_DHxparams_bio(bp,x) \ + ASN1_i2d_bio_of_const(DH, i2d_DHxparams, bp, x) +} + + { The EXTERNALSYM directive is ignored by FPC, however, it is used by Delphi as follows: + + The EXTERNALSYM directive prevents the specified Delphi symbol from appearing in header + files generated for C++. } + + {$EXTERNALSYM DHparams_dup} + {$EXTERNALSYM DH_OpenSSL} + {$EXTERNALSYM DH_set_default_method} + {$EXTERNALSYM DH_get_default_method} + {$EXTERNALSYM DH_set_method} + {$EXTERNALSYM DH_new_method} + {$EXTERNALSYM DH_new} + {$EXTERNALSYM DH_free} + {$EXTERNALSYM DH_up_ref} + {$EXTERNALSYM DH_bits} {introduced 1.1.0} + {$EXTERNALSYM DH_size} + {$EXTERNALSYM DH_security_bits} {introduced 1.1.0} + {$EXTERNALSYM DH_set_ex_data} + {$EXTERNALSYM DH_get_ex_data} + {$EXTERNALSYM DH_generate_parameters_ex} + {$EXTERNALSYM DH_check_params_ex} {introduced 1.1.0} + {$EXTERNALSYM DH_check_ex} {introduced 1.1.0} + {$EXTERNALSYM DH_check_pub_key_ex} {introduced 1.1.0} + {$EXTERNALSYM DH_check_params} {introduced 1.1.0} + {$EXTERNALSYM DH_check} + {$EXTERNALSYM DH_check_pub_key} + {$EXTERNALSYM DH_generate_key} + {$EXTERNALSYM DH_compute_key} + {$EXTERNALSYM DH_compute_key_padded} + {$EXTERNALSYM d2i_DHparams} + {$EXTERNALSYM i2d_DHparams} + {$EXTERNALSYM d2i_DHxparams} + {$EXTERNALSYM i2d_DHxparams} + {$EXTERNALSYM DHparams_print} + {$EXTERNALSYM DH_get_1024_160} + {$EXTERNALSYM DH_get_2048_224} + {$EXTERNALSYM DH_get_2048_256} + {$EXTERNALSYM DH_new_by_nid} {introduced 1.1.0} + {$EXTERNALSYM DH_get_nid} {introduced 1.1.0} + {$EXTERNALSYM DH_KDF_X9_42} + {$EXTERNALSYM DH_get0_pqg} {introduced 1.1.0} + {$EXTERNALSYM DH_set0_pqg} {introduced 1.1.0} + {$EXTERNALSYM DH_get0_key} {introduced 1.1.0} + {$EXTERNALSYM DH_set0_key} {introduced 1.1.0} + {$EXTERNALSYM DH_get0_p} {introduced 1.1.0} + {$EXTERNALSYM DH_get0_q} {introduced 1.1.0} + {$EXTERNALSYM DH_get0_g} {introduced 1.1.0} + {$EXTERNALSYM DH_get0_priv_key} {introduced 1.1.0} + {$EXTERNALSYM DH_get0_pub_key} {introduced 1.1.0} + {$EXTERNALSYM DH_clear_flags} {introduced 1.1.0} + {$EXTERNALSYM DH_test_flags} {introduced 1.1.0} + {$EXTERNALSYM DH_set_flags} {introduced 1.1.0} + {$EXTERNALSYM DH_get0_engine} {introduced 1.1.0} + {$EXTERNALSYM DH_get_length} {introduced 1.1.0} + {$EXTERNALSYM DH_set_length} {introduced 1.1.0} + {$EXTERNALSYM DH_meth_new} {introduced 1.1.0} + {$EXTERNALSYM DH_meth_free} {introduced 1.1.0} + {$EXTERNALSYM DH_meth_dup} {introduced 1.1.0} + {$EXTERNALSYM DH_meth_get0_name} {introduced 1.1.0} + {$EXTERNALSYM DH_meth_set1_name} {introduced 1.1.0} + {$EXTERNALSYM DH_meth_get_flags} {introduced 1.1.0} + {$EXTERNALSYM DH_meth_set_flags} {introduced 1.1.0} + {$EXTERNALSYM DH_meth_get0_app_data} {introduced 1.1.0} + {$EXTERNALSYM DH_meth_set0_app_data} {introduced 1.1.0} + {$EXTERNALSYM DH_meth_get_generate_key} {introduced 1.1.0} + {$EXTERNALSYM DH_meth_set_generate_key} {introduced 1.1.0} + {$EXTERNALSYM DH_meth_get_compute_key} {introduced 1.1.0} + {$EXTERNALSYM DH_meth_set_compute_key} {introduced 1.1.0} + {$EXTERNALSYM DH_meth_get_bn_mod_exp} {introduced 1.1.0} + {$EXTERNALSYM DH_meth_set_bn_mod_exp} {introduced 1.1.0} + {$EXTERNALSYM DH_meth_get_init} {introduced 1.1.0} + {$EXTERNALSYM DH_meth_set_init} {introduced 1.1.0} + {$EXTERNALSYM DH_meth_get_finish} {introduced 1.1.0} + {$EXTERNALSYM DH_meth_set_finish} {introduced 1.1.0} + {$EXTERNALSYM DH_meth_get_generate_params} {introduced 1.1.0} + {$EXTERNALSYM DH_meth_set_generate_params} {introduced 1.1.0} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +var + DHparams_dup: function (dh: PDH): PDH; cdecl = nil; + + DH_OpenSSL: function : PDH_Method; cdecl = nil; + + DH_set_default_method: procedure (const meth: PDH_Method); cdecl = nil; + DH_get_default_method: function : PDH_Method; cdecl = nil; + DH_set_method: function (dh: PDH; const meth: PDH_Method): TIdC_INT; cdecl = nil; + DH_new_method: function (engine: PENGINE): PDH; cdecl = nil; + + DH_new: function : PDH; cdecl = nil; + DH_free: procedure (dh: PDH); cdecl = nil; + DH_up_ref: function (dh: PDH): TIdC_INT; cdecl = nil; + DH_bits: function (const dh: PDH): TIdC_INT; cdecl = nil; {introduced 1.1.0} + DH_size: function (const dh: PDH): TIdC_INT; cdecl = nil; + DH_security_bits: function (const dh: PDH): TIdC_INT; cdecl = nil; {introduced 1.1.0} + DH_set_ex_data: function (d: PDH; idx: TIdC_INT; arg: Pointer): TIdC_INT; cdecl = nil; + DH_get_ex_data: function (d: PDH; idx: TIdC_INT): Pointer; cdecl = nil; + + DH_generate_parameters_ex: function (dh: PDH; prime_len: TIdC_INT; generator: TIdC_INT; cb: PBN_GENCB): TIdC_INT; cdecl = nil; + + DH_check_params_ex: function (const dh: PDH): TIdC_INT; cdecl = nil; {introduced 1.1.0} + DH_check_ex: function (const dh: PDH): TIdC_INT; cdecl = nil; {introduced 1.1.0} + DH_check_pub_key_ex: function (const dh: PDH; const pub_key: PBIGNUM): TIdC_INT; cdecl = nil; {introduced 1.1.0} + DH_check_params: function (const dh: PDH; ret: PIdC_INT): TIdC_INT; cdecl = nil; {introduced 1.1.0} + DH_check: function (const dh: PDH; codes: PIdC_INT): TIdC_INT; cdecl = nil; + DH_check_pub_key: function (const dh: PDH; const pub_key: PBIGNUM; codes: PIdC_INT): TIdC_INT; cdecl = nil; + DH_generate_key: function (dh: PDH): TIdC_INT; cdecl = nil; + DH_compute_key: function (key: PByte; const pub_key: PBIGNUM; dh: PDH): TIdC_INT; cdecl = nil; + DH_compute_key_padded: function (key: PByte; const pub_key: PBIGNUM; dh: PDH): TIdC_INT; cdecl = nil; + d2i_DHparams: function (a: PPDH; const pp: PPByte; length: TIdC_LONG): PDH; cdecl = nil; + i2d_DHparams: function (const a: PDH; pp: PPByte): TIdC_INT; cdecl = nil; + d2i_DHxparams: function (a: PPDH; const pp: PPByte; length: TIdC_LONG): PDH; cdecl = nil; + i2d_DHxparams: function (const a: PDH; pp: PPByte): TIdC_INT; cdecl = nil; + DHparams_print: function (bp: PBIO; const x: PDH): TIdC_INT; cdecl = nil; + + DH_get_1024_160: function : PDH; cdecl = nil; + DH_get_2048_224: function : PDH; cdecl = nil; + DH_get_2048_256: function : PDH; cdecl = nil; + + DH_new_by_nid: function (nid: TIdC_INT): PDH; cdecl = nil; {introduced 1.1.0} + DH_get_nid: function (const dh: PDH): TIdC_INT; cdecl = nil; {introduced 1.1.0} + + DH_KDF_X9_42: function ( out_: PByte; outlen: TIdC_SIZET; const Z: PByte; Zlen: TIdC_SIZET; key_oid: PASN1_OBJECT; const ukm: PByte; ukmlen: TIdC_SIZET; const md: PEVP_MD): TIdC_INT; cdecl = nil; + + DH_get0_pqg: procedure (const dh: PDH; const p: PPBIGNUM; const q: PPBIGNUM; const g: PPBIGNUM); cdecl = nil; {introduced 1.1.0} + DH_set0_pqg: function (dh: PDH; p: PBIGNUM; q: PBIGNUM; g: PBIGNUM): TIdC_INT; cdecl = nil; {introduced 1.1.0} + DH_get0_key: procedure (const dh: PDH; const pub_key: PPBIGNUM; const priv_key: PPBIGNUM); cdecl = nil; {introduced 1.1.0} + DH_set0_key: function (dh: PDH; pub_key: PBIGNUM; priv_key: PBIGNUM): TIdC_INT; cdecl = nil; {introduced 1.1.0} + DH_get0_p: function (const dh: PDH): PBIGNUM; cdecl = nil; {introduced 1.1.0} + DH_get0_q: function (const dh: PDH): PBIGNUM; cdecl = nil; {introduced 1.1.0} + DH_get0_g: function (const dh: PDH): PBIGNUM; cdecl = nil; {introduced 1.1.0} + DH_get0_priv_key: function (const dh: PDH): PBIGNUM; cdecl = nil; {introduced 1.1.0} + DH_get0_pub_key: function (const dh: PDH): PBIGNUM; cdecl = nil; {introduced 1.1.0} + DH_clear_flags: procedure (dh: PDH; flags: TIdC_INT); cdecl = nil; {introduced 1.1.0} + DH_test_flags: function (const dh: PDH; flags: TIdC_INT): TIdC_INT; cdecl = nil; {introduced 1.1.0} + DH_set_flags: procedure (dh: PDH; flags: TIdC_INT); cdecl = nil; {introduced 1.1.0} + DH_get0_engine: function (d: PDH): PENGINE; cdecl = nil; {introduced 1.1.0} + DH_get_length: function (const dh: PDH): TIdC_LONG; cdecl = nil; {introduced 1.1.0} + DH_set_length: function (dh: PDH; length: TIdC_LONG): TIdC_INT; cdecl = nil; {introduced 1.1.0} + + DH_meth_new: function (const name: PIdAnsiChar; flags: TIdC_INT): PDH_Method; cdecl = nil; {introduced 1.1.0} + DH_meth_free: procedure (dhm: PDH_Method); cdecl = nil; {introduced 1.1.0} + DH_meth_dup: function (const dhm: PDH_Method): PDH_Method; cdecl = nil; {introduced 1.1.0} + DH_meth_get0_name: function (const dhm: PDH_Method): PIdAnsiChar; cdecl = nil; {introduced 1.1.0} + DH_meth_set1_name: function (dhm: PDH_Method; const name: PIdAnsiChar): TIdC_INT; cdecl = nil; {introduced 1.1.0} + DH_meth_get_flags: function (const dhm: PDH_Method): TIdC_INT; cdecl = nil; {introduced 1.1.0} + DH_meth_set_flags: function (const dhm: PDH_Method; flags: TIdC_INT): TIdC_INT; cdecl = nil; {introduced 1.1.0} + DH_meth_get0_app_data: function (const dhm: PDH_Method): Pointer; cdecl = nil; {introduced 1.1.0} + DH_meth_set0_app_data: function (const dhm: PDH_Method; app_data: Pointer): TIdC_INT; cdecl = nil; {introduced 1.1.0} + + DH_meth_get_generate_key: function (const dhm: PDH_Method): DH_meth_generate_key_cb; cdecl = nil; {introduced 1.1.0} + DH_meth_set_generate_key: function (const dhm: PDH_Method; generate_key: DH_meth_generate_key_cb): TIdC_INT; cdecl = nil; {introduced 1.1.0} + + DH_meth_get_compute_key: function (const dhm: PDH_Method): DH_meth_compute_key_cb; cdecl = nil; {introduced 1.1.0} + DH_meth_set_compute_key: function (const dhm: PDH_Method; compute_key: DH_meth_compute_key_cb): TIdC_INT; cdecl = nil; {introduced 1.1.0} + + DH_meth_get_bn_mod_exp: function (const dhm: PDH_Method): DH_meth_bn_mod_exp_cb; cdecl = nil; {introduced 1.1.0} + DH_meth_set_bn_mod_exp: function (const dhm: PDH_Method; bn_mod_expr: DH_meth_bn_mod_exp_cb): TIdC_INT; cdecl = nil; {introduced 1.1.0} + + DH_meth_get_init: function (const dhm: PDH_Method): DH_meth_init_cb; cdecl = nil; {introduced 1.1.0} + DH_meth_set_init: function (const dhm: PDH_Method; init: DH_meth_init_cb): TIdC_INT; cdecl = nil; {introduced 1.1.0} + + DH_meth_get_finish: function (const dhm: PDH_Method): DH_meth_finish_cb; cdecl = nil; {introduced 1.1.0} + DH_meth_set_finish: function (const dhm: PDH_Method; finish: DH_meth_finish_cb): TIdC_INT; cdecl = nil; {introduced 1.1.0} + + DH_meth_get_generate_params: function (const dhm: PDH_Method): DH_meth_generate_params_cb; cdecl = nil; {introduced 1.1.0} + DH_meth_set_generate_params: function (const dhm: PDH_Method; generate_params: DH_meth_generate_params_cb): TIdC_INT; cdecl = nil; {introduced 1.1.0} + +{ +# define EVP_PKEY_CTX_set_dh_paramgen_prime_len(ctx, len) \ + EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DH, EVP_PKEY_OP_PARAMGEN, \ + EVP_PKEY_CTRL_DH_PARAMGEN_PRIME_LEN, len, NULL) + +# define EVP_PKEY_CTX_set_dh_paramgen_subprime_len(ctx, len) \ + EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DH, EVP_PKEY_OP_PARAMGEN, \ + EVP_PKEY_CTRL_DH_PARAMGEN_SUBPRIME_LEN, len, NULL) + +# define EVP_PKEY_CTX_set_dh_paramgen_type(ctx, typ) \ + EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DH, EVP_PKEY_OP_PARAMGEN, \ + EVP_PKEY_CTRL_DH_PARAMGEN_TYPE, typ, NULL) + +# define EVP_PKEY_CTX_set_dh_paramgen_generator(ctx, gen) \ + EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DH, EVP_PKEY_OP_PARAMGEN, \ + EVP_PKEY_CTRL_DH_PARAMGEN_GENERATOR, gen, NULL) + +# define EVP_PKEY_CTX_set_dh_rfc5114(ctx, gen) \ + EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, EVP_PKEY_OP_PARAMGEN, \ + EVP_PKEY_CTRL_DH_RFC5114, gen, NULL) + +# define EVP_PKEY_CTX_set_dhx_rfc5114(ctx, gen) \ + EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, EVP_PKEY_OP_PARAMGEN, \ + EVP_PKEY_CTRL_DH_RFC5114, gen, NULL) + +# define EVP_PKEY_CTX_set_dh_nid(ctx, nid) \ + EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DH, \ + EVP_PKEY_OP_PARAMGEN | EVP_PKEY_OP_KEYGEN, \ + EVP_PKEY_CTRL_DH_NID, nid, NULL) + +# define EVP_PKEY_CTX_set_dh_pad(ctx, pad) \ + EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DH, EVP_PKEY_OP_DERIVE, \ + EVP_PKEY_CTRL_DH_PAD, pad, NULL) + +# define EVP_PKEY_CTX_set_dh_kdf_type(ctx, kdf) \ + EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \ + EVP_PKEY_OP_DERIVE, \ + EVP_PKEY_CTRL_DH_KDF_TYPE, kdf, NULL) + +# define EVP_PKEY_CTX_get_dh_kdf_type(ctx) \ + EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \ + EVP_PKEY_OP_DERIVE, \ + EVP_PKEY_CTRL_DH_KDF_TYPE, -2, NULL) + +# define EVP_PKEY_CTX_set0_dh_kdf_oid(ctx, oid) \ + EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \ + EVP_PKEY_OP_DERIVE, \ + EVP_PKEY_CTRL_DH_KDF_OID, 0, (void *)(oid)) + +# define EVP_PKEY_CTX_get0_dh_kdf_oid(ctx, poid) \ + EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \ + EVP_PKEY_OP_DERIVE, \ + EVP_PKEY_CTRL_GET_DH_KDF_OID, 0, (void *)(poid)) + +# define EVP_PKEY_CTX_set_dh_kdf_md(ctx, md) \ + EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \ + EVP_PKEY_OP_DERIVE, \ + EVP_PKEY_CTRL_DH_KDF_MD, 0, (void *)(md)) + +# define EVP_PKEY_CTX_get_dh_kdf_md(ctx, pmd) \ + EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \ + EVP_PKEY_OP_DERIVE, \ + EVP_PKEY_CTRL_GET_DH_KDF_MD, 0, (void *)(pmd)) + +# define EVP_PKEY_CTX_set_dh_kdf_outlen(ctx, len) \ + EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \ + EVP_PKEY_OP_DERIVE, \ + EVP_PKEY_CTRL_DH_KDF_OUTLEN, len, NULL) + +# define EVP_PKEY_CTX_get_dh_kdf_outlen(ctx, plen) \ + EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \ + EVP_PKEY_OP_DERIVE, \ + EVP_PKEY_CTRL_GET_DH_KDF_OUTLEN, 0, (void *)(plen)) + +# define EVP_PKEY_CTX_set0_dh_kdf_ukm(ctx, p, plen) \ + EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \ + EVP_PKEY_OP_DERIVE, \ + EVP_PKEY_CTRL_DH_KDF_UKM, plen, (void *)(p)) + +# define EVP_PKEY_CTX_get0_dh_kdf_ukm(ctx, p) \ + EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \ + EVP_PKEY_OP_DERIVE, \ + EVP_PKEY_CTRL_GET_DH_KDF_UKM, 0, (void *)(p)) +} + +{$ELSE} + function DHparams_dup(dh: PDH): PDH cdecl; external CLibCrypto; + + function DH_OpenSSL: PDH_Method cdecl; external CLibCrypto; + + procedure DH_set_default_method(const meth: PDH_Method) cdecl; external CLibCrypto; + function DH_get_default_method: PDH_Method cdecl; external CLibCrypto; + function DH_set_method(dh: PDH; const meth: PDH_Method): TIdC_INT cdecl; external CLibCrypto; + function DH_new_method(engine: PENGINE): PDH cdecl; external CLibCrypto; + + function DH_new: PDH cdecl; external CLibCrypto; + procedure DH_free(dh: PDH) cdecl; external CLibCrypto; + function DH_up_ref(dh: PDH): TIdC_INT cdecl; external CLibCrypto; + function DH_bits(const dh: PDH): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function DH_size(const dh: PDH): TIdC_INT cdecl; external CLibCrypto; + function DH_security_bits(const dh: PDH): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function DH_set_ex_data(d: PDH; idx: TIdC_INT; arg: Pointer): TIdC_INT cdecl; external CLibCrypto; + function DH_get_ex_data(d: PDH; idx: TIdC_INT): Pointer cdecl; external CLibCrypto; + + function DH_generate_parameters_ex(dh: PDH; prime_len: TIdC_INT; generator: TIdC_INT; cb: PBN_GENCB): TIdC_INT cdecl; external CLibCrypto; + + function DH_check_params_ex(const dh: PDH): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function DH_check_ex(const dh: PDH): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function DH_check_pub_key_ex(const dh: PDH; const pub_key: PBIGNUM): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function DH_check_params(const dh: PDH; ret: PIdC_INT): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function DH_check(const dh: PDH; codes: PIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function DH_check_pub_key(const dh: PDH; const pub_key: PBIGNUM; codes: PIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function DH_generate_key(dh: PDH): TIdC_INT cdecl; external CLibCrypto; + function DH_compute_key(key: PByte; const pub_key: PBIGNUM; dh: PDH): TIdC_INT cdecl; external CLibCrypto; + function DH_compute_key_padded(key: PByte; const pub_key: PBIGNUM; dh: PDH): TIdC_INT cdecl; external CLibCrypto; + function d2i_DHparams(a: PPDH; const pp: PPByte; length: TIdC_LONG): PDH cdecl; external CLibCrypto; + function i2d_DHparams(const a: PDH; pp: PPByte): TIdC_INT cdecl; external CLibCrypto; + function d2i_DHxparams(a: PPDH; const pp: PPByte; length: TIdC_LONG): PDH cdecl; external CLibCrypto; + function i2d_DHxparams(const a: PDH; pp: PPByte): TIdC_INT cdecl; external CLibCrypto; + function DHparams_print(bp: PBIO; const x: PDH): TIdC_INT cdecl; external CLibCrypto; + + function DH_get_1024_160: PDH cdecl; external CLibCrypto; + function DH_get_2048_224: PDH cdecl; external CLibCrypto; + function DH_get_2048_256: PDH cdecl; external CLibCrypto; + + function DH_new_by_nid(nid: TIdC_INT): PDH cdecl; external CLibCrypto; {introduced 1.1.0} + function DH_get_nid(const dh: PDH): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + + function DH_KDF_X9_42( out_: PByte; outlen: TIdC_SIZET; const Z: PByte; Zlen: TIdC_SIZET; key_oid: PASN1_OBJECT; const ukm: PByte; ukmlen: TIdC_SIZET; const md: PEVP_MD): TIdC_INT cdecl; external CLibCrypto; + + procedure DH_get0_pqg(const dh: PDH; const p: PPBIGNUM; const q: PPBIGNUM; const g: PPBIGNUM) cdecl; external CLibCrypto; {introduced 1.1.0} + function DH_set0_pqg(dh: PDH; p: PBIGNUM; q: PBIGNUM; g: PBIGNUM): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + procedure DH_get0_key(const dh: PDH; const pub_key: PPBIGNUM; const priv_key: PPBIGNUM) cdecl; external CLibCrypto; {introduced 1.1.0} + function DH_set0_key(dh: PDH; pub_key: PBIGNUM; priv_key: PBIGNUM): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function DH_get0_p(const dh: PDH): PBIGNUM cdecl; external CLibCrypto; {introduced 1.1.0} + function DH_get0_q(const dh: PDH): PBIGNUM cdecl; external CLibCrypto; {introduced 1.1.0} + function DH_get0_g(const dh: PDH): PBIGNUM cdecl; external CLibCrypto; {introduced 1.1.0} + function DH_get0_priv_key(const dh: PDH): PBIGNUM cdecl; external CLibCrypto; {introduced 1.1.0} + function DH_get0_pub_key(const dh: PDH): PBIGNUM cdecl; external CLibCrypto; {introduced 1.1.0} + procedure DH_clear_flags(dh: PDH; flags: TIdC_INT) cdecl; external CLibCrypto; {introduced 1.1.0} + function DH_test_flags(const dh: PDH; flags: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + procedure DH_set_flags(dh: PDH; flags: TIdC_INT) cdecl; external CLibCrypto; {introduced 1.1.0} + function DH_get0_engine(d: PDH): PENGINE cdecl; external CLibCrypto; {introduced 1.1.0} + function DH_get_length(const dh: PDH): TIdC_LONG cdecl; external CLibCrypto; {introduced 1.1.0} + function DH_set_length(dh: PDH; length: TIdC_LONG): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + + function DH_meth_new(const name: PIdAnsiChar; flags: TIdC_INT): PDH_Method cdecl; external CLibCrypto; {introduced 1.1.0} + procedure DH_meth_free(dhm: PDH_Method) cdecl; external CLibCrypto; {introduced 1.1.0} + function DH_meth_dup(const dhm: PDH_Method): PDH_Method cdecl; external CLibCrypto; {introduced 1.1.0} + function DH_meth_get0_name(const dhm: PDH_Method): PIdAnsiChar cdecl; external CLibCrypto; {introduced 1.1.0} + function DH_meth_set1_name(dhm: PDH_Method; const name: PIdAnsiChar): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function DH_meth_get_flags(const dhm: PDH_Method): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function DH_meth_set_flags(const dhm: PDH_Method; flags: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function DH_meth_get0_app_data(const dhm: PDH_Method): Pointer cdecl; external CLibCrypto; {introduced 1.1.0} + function DH_meth_set0_app_data(const dhm: PDH_Method; app_data: Pointer): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + + function DH_meth_get_generate_key(const dhm: PDH_Method): DH_meth_generate_key_cb cdecl; external CLibCrypto; {introduced 1.1.0} + function DH_meth_set_generate_key(const dhm: PDH_Method; generate_key: DH_meth_generate_key_cb): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + + function DH_meth_get_compute_key(const dhm: PDH_Method): DH_meth_compute_key_cb cdecl; external CLibCrypto; {introduced 1.1.0} + function DH_meth_set_compute_key(const dhm: PDH_Method; compute_key: DH_meth_compute_key_cb): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + + function DH_meth_get_bn_mod_exp(const dhm: PDH_Method): DH_meth_bn_mod_exp_cb cdecl; external CLibCrypto; {introduced 1.1.0} + function DH_meth_set_bn_mod_exp(const dhm: PDH_Method; bn_mod_expr: DH_meth_bn_mod_exp_cb): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + + function DH_meth_get_init(const dhm: PDH_Method): DH_meth_init_cb cdecl; external CLibCrypto; {introduced 1.1.0} + function DH_meth_set_init(const dhm: PDH_Method; init: DH_meth_init_cb): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + + function DH_meth_get_finish(const dhm: PDH_Method): DH_meth_finish_cb cdecl; external CLibCrypto; {introduced 1.1.0} + function DH_meth_set_finish(const dhm: PDH_Method; finish: DH_meth_finish_cb): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + + function DH_meth_get_generate_params(const dhm: PDH_Method): DH_meth_generate_params_cb cdecl; external CLibCrypto; {introduced 1.1.0} + function DH_meth_set_generate_params(const dhm: PDH_Method; generate_params: DH_meth_generate_params_cb): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + +{ +# define EVP_PKEY_CTX_set_dh_paramgen_prime_len(ctx, len) \ + EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DH, EVP_PKEY_OP_PARAMGEN, \ + EVP_PKEY_CTRL_DH_PARAMGEN_PRIME_LEN, len, NULL) + +# define EVP_PKEY_CTX_set_dh_paramgen_subprime_len(ctx, len) \ + EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DH, EVP_PKEY_OP_PARAMGEN, \ + EVP_PKEY_CTRL_DH_PARAMGEN_SUBPRIME_LEN, len, NULL) + +# define EVP_PKEY_CTX_set_dh_paramgen_type(ctx, typ) \ + EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DH, EVP_PKEY_OP_PARAMGEN, \ + EVP_PKEY_CTRL_DH_PARAMGEN_TYPE, typ, NULL) + +# define EVP_PKEY_CTX_set_dh_paramgen_generator(ctx, gen) \ + EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DH, EVP_PKEY_OP_PARAMGEN, \ + EVP_PKEY_CTRL_DH_PARAMGEN_GENERATOR, gen, NULL) + +# define EVP_PKEY_CTX_set_dh_rfc5114(ctx, gen) \ + EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, EVP_PKEY_OP_PARAMGEN, \ + EVP_PKEY_CTRL_DH_RFC5114, gen, NULL) + +# define EVP_PKEY_CTX_set_dhx_rfc5114(ctx, gen) \ + EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, EVP_PKEY_OP_PARAMGEN, \ + EVP_PKEY_CTRL_DH_RFC5114, gen, NULL) + +# define EVP_PKEY_CTX_set_dh_nid(ctx, nid) \ + EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DH, \ + EVP_PKEY_OP_PARAMGEN | EVP_PKEY_OP_KEYGEN, \ + EVP_PKEY_CTRL_DH_NID, nid, NULL) + +# define EVP_PKEY_CTX_set_dh_pad(ctx, pad) \ + EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DH, EVP_PKEY_OP_DERIVE, \ + EVP_PKEY_CTRL_DH_PAD, pad, NULL) + +# define EVP_PKEY_CTX_set_dh_kdf_type(ctx, kdf) \ + EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \ + EVP_PKEY_OP_DERIVE, \ + EVP_PKEY_CTRL_DH_KDF_TYPE, kdf, NULL) + +# define EVP_PKEY_CTX_get_dh_kdf_type(ctx) \ + EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \ + EVP_PKEY_OP_DERIVE, \ + EVP_PKEY_CTRL_DH_KDF_TYPE, -2, NULL) + +# define EVP_PKEY_CTX_set0_dh_kdf_oid(ctx, oid) \ + EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \ + EVP_PKEY_OP_DERIVE, \ + EVP_PKEY_CTRL_DH_KDF_OID, 0, (void *)(oid)) + +# define EVP_PKEY_CTX_get0_dh_kdf_oid(ctx, poid) \ + EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \ + EVP_PKEY_OP_DERIVE, \ + EVP_PKEY_CTRL_GET_DH_KDF_OID, 0, (void *)(poid)) + +# define EVP_PKEY_CTX_set_dh_kdf_md(ctx, md) \ + EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \ + EVP_PKEY_OP_DERIVE, \ + EVP_PKEY_CTRL_DH_KDF_MD, 0, (void *)(md)) + +# define EVP_PKEY_CTX_get_dh_kdf_md(ctx, pmd) \ + EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \ + EVP_PKEY_OP_DERIVE, \ + EVP_PKEY_CTRL_GET_DH_KDF_MD, 0, (void *)(pmd)) + +# define EVP_PKEY_CTX_set_dh_kdf_outlen(ctx, len) \ + EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \ + EVP_PKEY_OP_DERIVE, \ + EVP_PKEY_CTRL_DH_KDF_OUTLEN, len, NULL) + +# define EVP_PKEY_CTX_get_dh_kdf_outlen(ctx, plen) \ + EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \ + EVP_PKEY_OP_DERIVE, \ + EVP_PKEY_CTRL_GET_DH_KDF_OUTLEN, 0, (void *)(plen)) + +# define EVP_PKEY_CTX_set0_dh_kdf_ukm(ctx, p, plen) \ + EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \ + EVP_PKEY_OP_DERIVE, \ + EVP_PKEY_CTRL_DH_KDF_UKM, plen, (void *)(p)) + +# define EVP_PKEY_CTX_get0_dh_kdf_ukm(ctx, p) \ + EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \ + EVP_PKEY_OP_DERIVE, \ + EVP_PKEY_CTRL_GET_DH_KDF_UKM, 0, (void *)(p)) +} + +{$ENDIF} + +function d2i_DHparams_bio(bp: PBIO; x: PPDH): PDH; + +implementation + + uses + classes, + IdSSLOpenSSLExceptionHandlers, + IdResourceStringsOpenSSL, + IdOpenSSLHeaders_asn1 + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + ,IdSSLOpenSSLLoader + {$ENDIF}; + +const + DH_bits_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + DH_security_bits_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + DH_check_params_ex_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + DH_check_ex_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + DH_check_pub_key_ex_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + DH_check_params_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + DH_new_by_nid_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + DH_get_nid_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + DH_get0_pqg_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + DH_set0_pqg_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + DH_get0_key_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + DH_set0_key_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + DH_get0_p_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + DH_get0_q_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + DH_get0_g_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + DH_get0_priv_key_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + DH_get0_pub_key_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + DH_clear_flags_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + DH_test_flags_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + DH_set_flags_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + DH_get0_engine_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + DH_get_length_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + DH_set_length_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + DH_meth_new_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + DH_meth_free_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + DH_meth_dup_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + DH_meth_get0_name_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + DH_meth_set1_name_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + DH_meth_get_flags_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + DH_meth_set_flags_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + DH_meth_get0_app_data_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + DH_meth_set0_app_data_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + DH_meth_get_generate_key_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + DH_meth_set_generate_key_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + DH_meth_get_compute_key_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + DH_meth_set_compute_key_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + DH_meth_get_bn_mod_exp_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + DH_meth_set_bn_mod_exp_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + DH_meth_get_init_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + DH_meth_set_init_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + DH_meth_get_finish_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + DH_meth_set_finish_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + DH_meth_get_generate_params_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + DH_meth_set_generate_params_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +const + DHparams_dup_procname = 'DHparams_dup'; + + DH_OpenSSL_procname = 'DH_OpenSSL'; + + DH_set_default_method_procname = 'DH_set_default_method'; + DH_get_default_method_procname = 'DH_get_default_method'; + DH_set_method_procname = 'DH_set_method'; + DH_new_method_procname = 'DH_new_method'; + + DH_new_procname = 'DH_new'; + DH_free_procname = 'DH_free'; + DH_up_ref_procname = 'DH_up_ref'; + DH_bits_procname = 'DH_bits'; {introduced 1.1.0} + DH_size_procname = 'DH_size'; + DH_security_bits_procname = 'DH_security_bits'; {introduced 1.1.0} + DH_set_ex_data_procname = 'DH_set_ex_data'; + DH_get_ex_data_procname = 'DH_get_ex_data'; + + DH_generate_parameters_ex_procname = 'DH_generate_parameters_ex'; + + DH_check_params_ex_procname = 'DH_check_params_ex'; {introduced 1.1.0} + DH_check_ex_procname = 'DH_check_ex'; {introduced 1.1.0} + DH_check_pub_key_ex_procname = 'DH_check_pub_key_ex'; {introduced 1.1.0} + DH_check_params_procname = 'DH_check_params'; {introduced 1.1.0} + DH_check_procname = 'DH_check'; + DH_check_pub_key_procname = 'DH_check_pub_key'; + DH_generate_key_procname = 'DH_generate_key'; + DH_compute_key_procname = 'DH_compute_key'; + DH_compute_key_padded_procname = 'DH_compute_key_padded'; + d2i_DHparams_procname = 'd2i_DHparams'; + i2d_DHparams_procname = 'i2d_DHparams'; + d2i_DHxparams_procname = 'd2i_DHxparams'; + i2d_DHxparams_procname = 'i2d_DHxparams'; + DHparams_print_procname = 'DHparams_print'; + + DH_get_1024_160_procname = 'DH_get_1024_160'; + DH_get_2048_224_procname = 'DH_get_2048_224'; + DH_get_2048_256_procname = 'DH_get_2048_256'; + + DH_new_by_nid_procname = 'DH_new_by_nid'; {introduced 1.1.0} + DH_get_nid_procname = 'DH_get_nid'; {introduced 1.1.0} + + DH_KDF_X9_42_procname = 'DH_KDF_X9_42'; + + DH_get0_pqg_procname = 'DH_get0_pqg'; {introduced 1.1.0} + DH_set0_pqg_procname = 'DH_set0_pqg'; {introduced 1.1.0} + DH_get0_key_procname = 'DH_get0_key'; {introduced 1.1.0} + DH_set0_key_procname = 'DH_set0_key'; {introduced 1.1.0} + DH_get0_p_procname = 'DH_get0_p'; {introduced 1.1.0} + DH_get0_q_procname = 'DH_get0_q'; {introduced 1.1.0} + DH_get0_g_procname = 'DH_get0_g'; {introduced 1.1.0} + DH_get0_priv_key_procname = 'DH_get0_priv_key'; {introduced 1.1.0} + DH_get0_pub_key_procname = 'DH_get0_pub_key'; {introduced 1.1.0} + DH_clear_flags_procname = 'DH_clear_flags'; {introduced 1.1.0} + DH_test_flags_procname = 'DH_test_flags'; {introduced 1.1.0} + DH_set_flags_procname = 'DH_set_flags'; {introduced 1.1.0} + DH_get0_engine_procname = 'DH_get0_engine'; {introduced 1.1.0} + DH_get_length_procname = 'DH_get_length'; {introduced 1.1.0} + DH_set_length_procname = 'DH_set_length'; {introduced 1.1.0} + + DH_meth_new_procname = 'DH_meth_new'; {introduced 1.1.0} + DH_meth_free_procname = 'DH_meth_free'; {introduced 1.1.0} + DH_meth_dup_procname = 'DH_meth_dup'; {introduced 1.1.0} + DH_meth_get0_name_procname = 'DH_meth_get0_name'; {introduced 1.1.0} + DH_meth_set1_name_procname = 'DH_meth_set1_name'; {introduced 1.1.0} + DH_meth_get_flags_procname = 'DH_meth_get_flags'; {introduced 1.1.0} + DH_meth_set_flags_procname = 'DH_meth_set_flags'; {introduced 1.1.0} + DH_meth_get0_app_data_procname = 'DH_meth_get0_app_data'; {introduced 1.1.0} + DH_meth_set0_app_data_procname = 'DH_meth_set0_app_data'; {introduced 1.1.0} + + DH_meth_get_generate_key_procname = 'DH_meth_get_generate_key'; {introduced 1.1.0} + DH_meth_set_generate_key_procname = 'DH_meth_set_generate_key'; {introduced 1.1.0} + + DH_meth_get_compute_key_procname = 'DH_meth_get_compute_key'; {introduced 1.1.0} + DH_meth_set_compute_key_procname = 'DH_meth_set_compute_key'; {introduced 1.1.0} + + DH_meth_get_bn_mod_exp_procname = 'DH_meth_get_bn_mod_exp'; {introduced 1.1.0} + DH_meth_set_bn_mod_exp_procname = 'DH_meth_set_bn_mod_exp'; {introduced 1.1.0} + + DH_meth_get_init_procname = 'DH_meth_get_init'; {introduced 1.1.0} + DH_meth_set_init_procname = 'DH_meth_set_init'; {introduced 1.1.0} + + DH_meth_get_finish_procname = 'DH_meth_get_finish'; {introduced 1.1.0} + DH_meth_set_finish_procname = 'DH_meth_set_finish'; {introduced 1.1.0} + + DH_meth_get_generate_params_procname = 'DH_meth_get_generate_params'; {introduced 1.1.0} + DH_meth_set_generate_params_procname = 'DH_meth_set_generate_params'; {introduced 1.1.0} + +{ +# define EVP_PKEY_CTX_set_dh_paramgen_prime_len(ctx, len) \ + EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DH, EVP_PKEY_OP_PARAMGEN, \ + EVP_PKEY_CTRL_DH_PARAMGEN_PRIME_LEN, len, NULL) + +# define EVP_PKEY_CTX_set_dh_paramgen_subprime_len(ctx, len) \ + EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DH, EVP_PKEY_OP_PARAMGEN, \ + EVP_PKEY_CTRL_DH_PARAMGEN_SUBPRIME_LEN, len, NULL) + +# define EVP_PKEY_CTX_set_dh_paramgen_type(ctx, typ) \ + EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DH, EVP_PKEY_OP_PARAMGEN, \ + EVP_PKEY_CTRL_DH_PARAMGEN_TYPE, typ, NULL) + +# define EVP_PKEY_CTX_set_dh_paramgen_generator(ctx, gen) \ + EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DH, EVP_PKEY_OP_PARAMGEN, \ + EVP_PKEY_CTRL_DH_PARAMGEN_GENERATOR, gen, NULL) + +# define EVP_PKEY_CTX_set_dh_rfc5114(ctx, gen) \ + EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, EVP_PKEY_OP_PARAMGEN, \ + EVP_PKEY_CTRL_DH_RFC5114, gen, NULL) + +# define EVP_PKEY_CTX_set_dhx_rfc5114(ctx, gen) \ + EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, EVP_PKEY_OP_PARAMGEN, \ + EVP_PKEY_CTRL_DH_RFC5114, gen, NULL) + +# define EVP_PKEY_CTX_set_dh_nid(ctx, nid) \ + EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DH, \ + EVP_PKEY_OP_PARAMGEN | EVP_PKEY_OP_KEYGEN, \ + EVP_PKEY_CTRL_DH_NID, nid, NULL) + +# define EVP_PKEY_CTX_set_dh_pad(ctx, pad) \ + EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DH, EVP_PKEY_OP_DERIVE, \ + EVP_PKEY_CTRL_DH_PAD, pad, NULL) + +# define EVP_PKEY_CTX_set_dh_kdf_type(ctx, kdf) \ + EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \ + EVP_PKEY_OP_DERIVE, \ + EVP_PKEY_CTRL_DH_KDF_TYPE, kdf, NULL) + +# define EVP_PKEY_CTX_get_dh_kdf_type(ctx) \ + EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \ + EVP_PKEY_OP_DERIVE, \ + EVP_PKEY_CTRL_DH_KDF_TYPE, -2, NULL) + +# define EVP_PKEY_CTX_set0_dh_kdf_oid(ctx, oid) \ + EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \ + EVP_PKEY_OP_DERIVE, \ + EVP_PKEY_CTRL_DH_KDF_OID, 0, (void *)(oid)) + +# define EVP_PKEY_CTX_get0_dh_kdf_oid(ctx, poid) \ + EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \ + EVP_PKEY_OP_DERIVE, \ + EVP_PKEY_CTRL_GET_DH_KDF_OID, 0, (void *)(poid)) + +# define EVP_PKEY_CTX_set_dh_kdf_md(ctx, md) \ + EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \ + EVP_PKEY_OP_DERIVE, \ + EVP_PKEY_CTRL_DH_KDF_MD, 0, (void *)(md)) + +# define EVP_PKEY_CTX_get_dh_kdf_md(ctx, pmd) \ + EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \ + EVP_PKEY_OP_DERIVE, \ + EVP_PKEY_CTRL_GET_DH_KDF_MD, 0, (void *)(pmd)) + +# define EVP_PKEY_CTX_set_dh_kdf_outlen(ctx, len) \ + EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \ + EVP_PKEY_OP_DERIVE, \ + EVP_PKEY_CTRL_DH_KDF_OUTLEN, len, NULL) + +# define EVP_PKEY_CTX_get_dh_kdf_outlen(ctx, plen) \ + EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \ + EVP_PKEY_OP_DERIVE, \ + EVP_PKEY_CTRL_GET_DH_KDF_OUTLEN, 0, (void *)(plen)) + +# define EVP_PKEY_CTX_set0_dh_kdf_ukm(ctx, p, plen) \ + EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \ + EVP_PKEY_OP_DERIVE, \ + EVP_PKEY_CTRL_DH_KDF_UKM, plen, (void *)(p)) + +# define EVP_PKEY_CTX_get0_dh_kdf_ukm(ctx, p) \ + EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \ + EVP_PKEY_OP_DERIVE, \ + EVP_PKEY_CTRL_GET_DH_KDF_UKM, 0, (void *)(p)) +} + + +{$WARN NO_RETVAL OFF} +function ERR_DHparams_dup(dh: PDH): PDH; +begin + EIdAPIFunctionNotPresent.RaiseException(DHparams_dup_procname); +end; + + + +function ERR_DH_OpenSSL: PDH_Method; +begin + EIdAPIFunctionNotPresent.RaiseException(DH_OpenSSL_procname); +end; + + + +procedure ERR_DH_set_default_method(const meth: PDH_Method); +begin + EIdAPIFunctionNotPresent.RaiseException(DH_set_default_method_procname); +end; + + +function ERR_DH_get_default_method: PDH_Method; +begin + EIdAPIFunctionNotPresent.RaiseException(DH_get_default_method_procname); +end; + + +function ERR_DH_set_method(dh: PDH; const meth: PDH_Method): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(DH_set_method_procname); +end; + + +function ERR_DH_new_method(engine: PENGINE): PDH; +begin + EIdAPIFunctionNotPresent.RaiseException(DH_new_method_procname); +end; + + + +function ERR_DH_new: PDH; +begin + EIdAPIFunctionNotPresent.RaiseException(DH_new_procname); +end; + + +procedure ERR_DH_free(dh: PDH); +begin + EIdAPIFunctionNotPresent.RaiseException(DH_free_procname); +end; + + +function ERR_DH_up_ref(dh: PDH): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(DH_up_ref_procname); +end; + + +function ERR_DH_bits(const dh: PDH): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(DH_bits_procname); +end; + + {introduced 1.1.0} +function ERR_DH_size(const dh: PDH): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(DH_size_procname); +end; + + +function ERR_DH_security_bits(const dh: PDH): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(DH_security_bits_procname); +end; + + {introduced 1.1.0} +function ERR_DH_set_ex_data(d: PDH; idx: TIdC_INT; arg: Pointer): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(DH_set_ex_data_procname); +end; + + +function ERR_DH_get_ex_data(d: PDH; idx: TIdC_INT): Pointer; +begin + EIdAPIFunctionNotPresent.RaiseException(DH_get_ex_data_procname); +end; + + + +function ERR_DH_generate_parameters_ex(dh: PDH; prime_len: TIdC_INT; generator: TIdC_INT; cb: PBN_GENCB): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(DH_generate_parameters_ex_procname); +end; + + + +function ERR_DH_check_params_ex(const dh: PDH): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(DH_check_params_ex_procname); +end; + + {introduced 1.1.0} +function ERR_DH_check_ex(const dh: PDH): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(DH_check_ex_procname); +end; + + {introduced 1.1.0} +function ERR_DH_check_pub_key_ex(const dh: PDH; const pub_key: PBIGNUM): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(DH_check_pub_key_ex_procname); +end; + + {introduced 1.1.0} +function ERR_DH_check_params(const dh: PDH; ret: PIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(DH_check_params_procname); +end; + + {introduced 1.1.0} +function ERR_DH_check(const dh: PDH; codes: PIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(DH_check_procname); +end; + + +function ERR_DH_check_pub_key(const dh: PDH; const pub_key: PBIGNUM; codes: PIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(DH_check_pub_key_procname); +end; + + +function ERR_DH_generate_key(dh: PDH): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(DH_generate_key_procname); +end; + + +function ERR_DH_compute_key(key: PByte; const pub_key: PBIGNUM; dh: PDH): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(DH_compute_key_procname); +end; + + +function ERR_DH_compute_key_padded(key: PByte; const pub_key: PBIGNUM; dh: PDH): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(DH_compute_key_padded_procname); +end; + + +function ERR_d2i_DHparams(a: PPDH; const pp: PPByte; length: TIdC_LONG): PDH; +begin + EIdAPIFunctionNotPresent.RaiseException(d2i_DHparams_procname); +end; + + +function ERR_i2d_DHparams(const a: PDH; pp: PPByte): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(i2d_DHparams_procname); +end; + + +function ERR_d2i_DHxparams(a: PPDH; const pp: PPByte; length: TIdC_LONG): PDH; +begin + EIdAPIFunctionNotPresent.RaiseException(d2i_DHxparams_procname); +end; + + +function ERR_i2d_DHxparams(const a: PDH; pp: PPByte): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(i2d_DHxparams_procname); +end; + + +function ERR_DHparams_print(bp: PBIO; const x: PDH): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(DHparams_print_procname); +end; + + + +function ERR_DH_get_1024_160: PDH; +begin + EIdAPIFunctionNotPresent.RaiseException(DH_get_1024_160_procname); +end; + + +function ERR_DH_get_2048_224: PDH; +begin + EIdAPIFunctionNotPresent.RaiseException(DH_get_2048_224_procname); +end; + + +function ERR_DH_get_2048_256: PDH; +begin + EIdAPIFunctionNotPresent.RaiseException(DH_get_2048_256_procname); +end; + + + +function ERR_DH_new_by_nid(nid: TIdC_INT): PDH; +begin + EIdAPIFunctionNotPresent.RaiseException(DH_new_by_nid_procname); +end; + + {introduced 1.1.0} +function ERR_DH_get_nid(const dh: PDH): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(DH_get_nid_procname); +end; + + {introduced 1.1.0} + +function ERR_DH_KDF_X9_42( out_: PByte; outlen: TIdC_SIZET; const Z: PByte; Zlen: TIdC_SIZET; key_oid: PASN1_OBJECT; const ukm: PByte; ukmlen: TIdC_SIZET; const md: PEVP_MD): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(DH_KDF_X9_42_procname); +end; + + + +procedure ERR_DH_get0_pqg(const dh: PDH; const p: PPBIGNUM; const q: PPBIGNUM; const g: PPBIGNUM); +begin + EIdAPIFunctionNotPresent.RaiseException(DH_get0_pqg_procname); +end; + + {introduced 1.1.0} +function ERR_DH_set0_pqg(dh: PDH; p: PBIGNUM; q: PBIGNUM; g: PBIGNUM): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(DH_set0_pqg_procname); +end; + + {introduced 1.1.0} +procedure ERR_DH_get0_key(const dh: PDH; const pub_key: PPBIGNUM; const priv_key: PPBIGNUM); +begin + EIdAPIFunctionNotPresent.RaiseException(DH_get0_key_procname); +end; + + {introduced 1.1.0} +function ERR_DH_set0_key(dh: PDH; pub_key: PBIGNUM; priv_key: PBIGNUM): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(DH_set0_key_procname); +end; + + {introduced 1.1.0} +function ERR_DH_get0_p(const dh: PDH): PBIGNUM; +begin + EIdAPIFunctionNotPresent.RaiseException(DH_get0_p_procname); +end; + + {introduced 1.1.0} +function ERR_DH_get0_q(const dh: PDH): PBIGNUM; +begin + EIdAPIFunctionNotPresent.RaiseException(DH_get0_q_procname); +end; + + {introduced 1.1.0} +function ERR_DH_get0_g(const dh: PDH): PBIGNUM; +begin + EIdAPIFunctionNotPresent.RaiseException(DH_get0_g_procname); +end; + + {introduced 1.1.0} +function ERR_DH_get0_priv_key(const dh: PDH): PBIGNUM; +begin + EIdAPIFunctionNotPresent.RaiseException(DH_get0_priv_key_procname); +end; + + {introduced 1.1.0} +function ERR_DH_get0_pub_key(const dh: PDH): PBIGNUM; +begin + EIdAPIFunctionNotPresent.RaiseException(DH_get0_pub_key_procname); +end; + + {introduced 1.1.0} +procedure ERR_DH_clear_flags(dh: PDH; flags: TIdC_INT); +begin + EIdAPIFunctionNotPresent.RaiseException(DH_clear_flags_procname); +end; + + {introduced 1.1.0} +function ERR_DH_test_flags(const dh: PDH; flags: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(DH_test_flags_procname); +end; + + {introduced 1.1.0} +procedure ERR_DH_set_flags(dh: PDH; flags: TIdC_INT); +begin + EIdAPIFunctionNotPresent.RaiseException(DH_set_flags_procname); +end; + + {introduced 1.1.0} +function ERR_DH_get0_engine(d: PDH): PENGINE; +begin + EIdAPIFunctionNotPresent.RaiseException(DH_get0_engine_procname); +end; + + {introduced 1.1.0} +function ERR_DH_get_length(const dh: PDH): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(DH_get_length_procname); +end; + + {introduced 1.1.0} +function ERR_DH_set_length(dh: PDH; length: TIdC_LONG): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(DH_set_length_procname); +end; + + {introduced 1.1.0} + +function ERR_DH_meth_new(const name: PIdAnsiChar; flags: TIdC_INT): PDH_Method; +begin + EIdAPIFunctionNotPresent.RaiseException(DH_meth_new_procname); +end; + + {introduced 1.1.0} +procedure ERR_DH_meth_free(dhm: PDH_Method); +begin + EIdAPIFunctionNotPresent.RaiseException(DH_meth_free_procname); +end; + + {introduced 1.1.0} +function ERR_DH_meth_dup(const dhm: PDH_Method): PDH_Method; +begin + EIdAPIFunctionNotPresent.RaiseException(DH_meth_dup_procname); +end; + + {introduced 1.1.0} +function ERR_DH_meth_get0_name(const dhm: PDH_Method): PIdAnsiChar; +begin + EIdAPIFunctionNotPresent.RaiseException(DH_meth_get0_name_procname); +end; + + {introduced 1.1.0} +function ERR_DH_meth_set1_name(dhm: PDH_Method; const name: PIdAnsiChar): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(DH_meth_set1_name_procname); +end; + + {introduced 1.1.0} +function ERR_DH_meth_get_flags(const dhm: PDH_Method): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(DH_meth_get_flags_procname); +end; + + {introduced 1.1.0} +function ERR_DH_meth_set_flags(const dhm: PDH_Method; flags: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(DH_meth_set_flags_procname); +end; + + {introduced 1.1.0} +function ERR_DH_meth_get0_app_data(const dhm: PDH_Method): Pointer; +begin + EIdAPIFunctionNotPresent.RaiseException(DH_meth_get0_app_data_procname); +end; + + {introduced 1.1.0} +function ERR_DH_meth_set0_app_data(const dhm: PDH_Method; app_data: Pointer): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(DH_meth_set0_app_data_procname); +end; + + {introduced 1.1.0} + +function ERR_DH_meth_get_generate_key(const dhm: PDH_Method): DH_meth_generate_key_cb; +begin + EIdAPIFunctionNotPresent.RaiseException(DH_meth_get_generate_key_procname); +end; + + {introduced 1.1.0} +function ERR_DH_meth_set_generate_key(const dhm: PDH_Method; generate_key: DH_meth_generate_key_cb): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(DH_meth_set_generate_key_procname); +end; + + {introduced 1.1.0} + +function ERR_DH_meth_get_compute_key(const dhm: PDH_Method): DH_meth_compute_key_cb; +begin + EIdAPIFunctionNotPresent.RaiseException(DH_meth_get_compute_key_procname); +end; + + {introduced 1.1.0} +function ERR_DH_meth_set_compute_key(const dhm: PDH_Method; compute_key: DH_meth_compute_key_cb): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(DH_meth_set_compute_key_procname); +end; + + {introduced 1.1.0} + +function ERR_DH_meth_get_bn_mod_exp(const dhm: PDH_Method): DH_meth_bn_mod_exp_cb; +begin + EIdAPIFunctionNotPresent.RaiseException(DH_meth_get_bn_mod_exp_procname); +end; + + {introduced 1.1.0} +function ERR_DH_meth_set_bn_mod_exp(const dhm: PDH_Method; bn_mod_expr: DH_meth_bn_mod_exp_cb): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(DH_meth_set_bn_mod_exp_procname); +end; + + {introduced 1.1.0} + +function ERR_DH_meth_get_init(const dhm: PDH_Method): DH_meth_init_cb; +begin + EIdAPIFunctionNotPresent.RaiseException(DH_meth_get_init_procname); +end; + + {introduced 1.1.0} +function ERR_DH_meth_set_init(const dhm: PDH_Method; init: DH_meth_init_cb): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(DH_meth_set_init_procname); +end; + + {introduced 1.1.0} + +function ERR_DH_meth_get_finish(const dhm: PDH_Method): DH_meth_finish_cb; +begin + EIdAPIFunctionNotPresent.RaiseException(DH_meth_get_finish_procname); +end; + + {introduced 1.1.0} +function ERR_DH_meth_set_finish(const dhm: PDH_Method; finish: DH_meth_finish_cb): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(DH_meth_set_finish_procname); +end; + + {introduced 1.1.0} + +function ERR_DH_meth_get_generate_params(const dhm: PDH_Method): DH_meth_generate_params_cb; +begin + EIdAPIFunctionNotPresent.RaiseException(DH_meth_get_generate_params_procname); +end; + + {introduced 1.1.0} +function ERR_DH_meth_set_generate_params(const dhm: PDH_Method; generate_params: DH_meth_generate_params_cb): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(DH_meth_set_generate_params_procname); +end; + + {introduced 1.1.0} + +{ +# define EVP_PKEY_CTX_set_dh_paramgen_prime_len(ctx, len) \ + EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DH, EVP_PKEY_OP_PARAMGEN, \ + EVP_PKEY_CTRL_DH_PARAMGEN_PRIME_LEN, len, NULL) + +# define EVP_PKEY_CTX_set_dh_paramgen_subprime_len(ctx, len) \ + EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DH, EVP_PKEY_OP_PARAMGEN, \ + EVP_PKEY_CTRL_DH_PARAMGEN_SUBPRIME_LEN, len, NULL) + +# define EVP_PKEY_CTX_set_dh_paramgen_type(ctx, typ) \ + EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DH, EVP_PKEY_OP_PARAMGEN, \ + EVP_PKEY_CTRL_DH_PARAMGEN_TYPE, typ, NULL) + +# define EVP_PKEY_CTX_set_dh_paramgen_generator(ctx, gen) \ + EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DH, EVP_PKEY_OP_PARAMGEN, \ + EVP_PKEY_CTRL_DH_PARAMGEN_GENERATOR, gen, NULL) + +# define EVP_PKEY_CTX_set_dh_rfc5114(ctx, gen) \ + EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, EVP_PKEY_OP_PARAMGEN, \ + EVP_PKEY_CTRL_DH_RFC5114, gen, NULL) + +# define EVP_PKEY_CTX_set_dhx_rfc5114(ctx, gen) \ + EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, EVP_PKEY_OP_PARAMGEN, \ + EVP_PKEY_CTRL_DH_RFC5114, gen, NULL) + +# define EVP_PKEY_CTX_set_dh_nid(ctx, nid) \ + EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DH, \ + EVP_PKEY_OP_PARAMGEN | EVP_PKEY_OP_KEYGEN, \ + EVP_PKEY_CTRL_DH_NID, nid, NULL) + +# define EVP_PKEY_CTX_set_dh_pad(ctx, pad) \ + EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DH, EVP_PKEY_OP_DERIVE, \ + EVP_PKEY_CTRL_DH_PAD, pad, NULL) + +# define EVP_PKEY_CTX_set_dh_kdf_type(ctx, kdf) \ + EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \ + EVP_PKEY_OP_DERIVE, \ + EVP_PKEY_CTRL_DH_KDF_TYPE, kdf, NULL) + +# define EVP_PKEY_CTX_get_dh_kdf_type(ctx) \ + EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \ + EVP_PKEY_OP_DERIVE, \ + EVP_PKEY_CTRL_DH_KDF_TYPE, -2, NULL) + +# define EVP_PKEY_CTX_set0_dh_kdf_oid(ctx, oid) \ + EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \ + EVP_PKEY_OP_DERIVE, \ + EVP_PKEY_CTRL_DH_KDF_OID, 0, (void *)(oid)) + +# define EVP_PKEY_CTX_get0_dh_kdf_oid(ctx, poid) \ + EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \ + EVP_PKEY_OP_DERIVE, \ + EVP_PKEY_CTRL_GET_DH_KDF_OID, 0, (void *)(poid)) + +# define EVP_PKEY_CTX_set_dh_kdf_md(ctx, md) \ + EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \ + EVP_PKEY_OP_DERIVE, \ + EVP_PKEY_CTRL_DH_KDF_MD, 0, (void *)(md)) + +# define EVP_PKEY_CTX_get_dh_kdf_md(ctx, pmd) \ + EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \ + EVP_PKEY_OP_DERIVE, \ + EVP_PKEY_CTRL_GET_DH_KDF_MD, 0, (void *)(pmd)) + +# define EVP_PKEY_CTX_set_dh_kdf_outlen(ctx, len) \ + EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \ + EVP_PKEY_OP_DERIVE, \ + EVP_PKEY_CTRL_DH_KDF_OUTLEN, len, NULL) + +# define EVP_PKEY_CTX_get_dh_kdf_outlen(ctx, plen) \ + EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \ + EVP_PKEY_OP_DERIVE, \ + EVP_PKEY_CTRL_GET_DH_KDF_OUTLEN, 0, (void *)(plen)) + +# define EVP_PKEY_CTX_set0_dh_kdf_ukm(ctx, p, plen) \ + EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \ + EVP_PKEY_OP_DERIVE, \ + EVP_PKEY_CTRL_DH_KDF_UKM, plen, (void *)(p)) + +# define EVP_PKEY_CTX_get0_dh_kdf_ukm(ctx, p) \ + EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \ + EVP_PKEY_OP_DERIVE, \ + EVP_PKEY_CTRL_GET_DH_KDF_UKM, 0, (void *)(p)) +} + +function d2i_DHparams_bio(bp: PBIO; x: PPDH): PDH; +begin + Result := PDH(ASN1_d2i_bio(pxnew(@DH_new), pd2i_of_void(@d2i_DHparams), bp, PPointer(x))); +end; + +{$WARN NO_RETVAL ON} + +procedure Load(const ADllHandle: TIdLibHandle; LibVersion: TIdC_UINT; const AFailed: TStringList); + +var FuncLoadError: boolean; + +begin + DHparams_dup := LoadLibFunction(ADllHandle, DHparams_dup_procname); + FuncLoadError := not assigned(DHparams_dup); + if FuncLoadError then + begin + {$if not defined(DHparams_dup_allownil)} + DHparams_dup := @ERR_DHparams_dup; + {$ifend} + {$if declared(DHparams_dup_introduced)} + if LibVersion < DHparams_dup_introduced then + begin + {$if declared(FC_DHparams_dup)} + DHparams_dup := @FC_DHparams_dup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DHparams_dup_removed)} + if DHparams_dup_removed <= LibVersion then + begin + {$if declared(_DHparams_dup)} + DHparams_dup := @_DHparams_dup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DHparams_dup_allownil)} + if FuncLoadError then + AFailed.Add('DHparams_dup'); + {$ifend} + end; + + + DH_OpenSSL := LoadLibFunction(ADllHandle, DH_OpenSSL_procname); + FuncLoadError := not assigned(DH_OpenSSL); + if FuncLoadError then + begin + {$if not defined(DH_OpenSSL_allownil)} + DH_OpenSSL := @ERR_DH_OpenSSL; + {$ifend} + {$if declared(DH_OpenSSL_introduced)} + if LibVersion < DH_OpenSSL_introduced then + begin + {$if declared(FC_DH_OpenSSL)} + DH_OpenSSL := @FC_DH_OpenSSL; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DH_OpenSSL_removed)} + if DH_OpenSSL_removed <= LibVersion then + begin + {$if declared(_DH_OpenSSL)} + DH_OpenSSL := @_DH_OpenSSL; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DH_OpenSSL_allownil)} + if FuncLoadError then + AFailed.Add('DH_OpenSSL'); + {$ifend} + end; + + + DH_set_default_method := LoadLibFunction(ADllHandle, DH_set_default_method_procname); + FuncLoadError := not assigned(DH_set_default_method); + if FuncLoadError then + begin + {$if not defined(DH_set_default_method_allownil)} + DH_set_default_method := @ERR_DH_set_default_method; + {$ifend} + {$if declared(DH_set_default_method_introduced)} + if LibVersion < DH_set_default_method_introduced then + begin + {$if declared(FC_DH_set_default_method)} + DH_set_default_method := @FC_DH_set_default_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DH_set_default_method_removed)} + if DH_set_default_method_removed <= LibVersion then + begin + {$if declared(_DH_set_default_method)} + DH_set_default_method := @_DH_set_default_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DH_set_default_method_allownil)} + if FuncLoadError then + AFailed.Add('DH_set_default_method'); + {$ifend} + end; + + + DH_get_default_method := LoadLibFunction(ADllHandle, DH_get_default_method_procname); + FuncLoadError := not assigned(DH_get_default_method); + if FuncLoadError then + begin + {$if not defined(DH_get_default_method_allownil)} + DH_get_default_method := @ERR_DH_get_default_method; + {$ifend} + {$if declared(DH_get_default_method_introduced)} + if LibVersion < DH_get_default_method_introduced then + begin + {$if declared(FC_DH_get_default_method)} + DH_get_default_method := @FC_DH_get_default_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DH_get_default_method_removed)} + if DH_get_default_method_removed <= LibVersion then + begin + {$if declared(_DH_get_default_method)} + DH_get_default_method := @_DH_get_default_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DH_get_default_method_allownil)} + if FuncLoadError then + AFailed.Add('DH_get_default_method'); + {$ifend} + end; + + + DH_set_method := LoadLibFunction(ADllHandle, DH_set_method_procname); + FuncLoadError := not assigned(DH_set_method); + if FuncLoadError then + begin + {$if not defined(DH_set_method_allownil)} + DH_set_method := @ERR_DH_set_method; + {$ifend} + {$if declared(DH_set_method_introduced)} + if LibVersion < DH_set_method_introduced then + begin + {$if declared(FC_DH_set_method)} + DH_set_method := @FC_DH_set_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DH_set_method_removed)} + if DH_set_method_removed <= LibVersion then + begin + {$if declared(_DH_set_method)} + DH_set_method := @_DH_set_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DH_set_method_allownil)} + if FuncLoadError then + AFailed.Add('DH_set_method'); + {$ifend} + end; + + + DH_new_method := LoadLibFunction(ADllHandle, DH_new_method_procname); + FuncLoadError := not assigned(DH_new_method); + if FuncLoadError then + begin + {$if not defined(DH_new_method_allownil)} + DH_new_method := @ERR_DH_new_method; + {$ifend} + {$if declared(DH_new_method_introduced)} + if LibVersion < DH_new_method_introduced then + begin + {$if declared(FC_DH_new_method)} + DH_new_method := @FC_DH_new_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DH_new_method_removed)} + if DH_new_method_removed <= LibVersion then + begin + {$if declared(_DH_new_method)} + DH_new_method := @_DH_new_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DH_new_method_allownil)} + if FuncLoadError then + AFailed.Add('DH_new_method'); + {$ifend} + end; + + + DH_new := LoadLibFunction(ADllHandle, DH_new_procname); + FuncLoadError := not assigned(DH_new); + if FuncLoadError then + begin + {$if not defined(DH_new_allownil)} + DH_new := @ERR_DH_new; + {$ifend} + {$if declared(DH_new_introduced)} + if LibVersion < DH_new_introduced then + begin + {$if declared(FC_DH_new)} + DH_new := @FC_DH_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DH_new_removed)} + if DH_new_removed <= LibVersion then + begin + {$if declared(_DH_new)} + DH_new := @_DH_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DH_new_allownil)} + if FuncLoadError then + AFailed.Add('DH_new'); + {$ifend} + end; + + + DH_free := LoadLibFunction(ADllHandle, DH_free_procname); + FuncLoadError := not assigned(DH_free); + if FuncLoadError then + begin + {$if not defined(DH_free_allownil)} + DH_free := @ERR_DH_free; + {$ifend} + {$if declared(DH_free_introduced)} + if LibVersion < DH_free_introduced then + begin + {$if declared(FC_DH_free)} + DH_free := @FC_DH_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DH_free_removed)} + if DH_free_removed <= LibVersion then + begin + {$if declared(_DH_free)} + DH_free := @_DH_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DH_free_allownil)} + if FuncLoadError then + AFailed.Add('DH_free'); + {$ifend} + end; + + + DH_up_ref := LoadLibFunction(ADllHandle, DH_up_ref_procname); + FuncLoadError := not assigned(DH_up_ref); + if FuncLoadError then + begin + {$if not defined(DH_up_ref_allownil)} + DH_up_ref := @ERR_DH_up_ref; + {$ifend} + {$if declared(DH_up_ref_introduced)} + if LibVersion < DH_up_ref_introduced then + begin + {$if declared(FC_DH_up_ref)} + DH_up_ref := @FC_DH_up_ref; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DH_up_ref_removed)} + if DH_up_ref_removed <= LibVersion then + begin + {$if declared(_DH_up_ref)} + DH_up_ref := @_DH_up_ref; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DH_up_ref_allownil)} + if FuncLoadError then + AFailed.Add('DH_up_ref'); + {$ifend} + end; + + + DH_bits := LoadLibFunction(ADllHandle, DH_bits_procname); + FuncLoadError := not assigned(DH_bits); + if FuncLoadError then + begin + {$if not defined(DH_bits_allownil)} + DH_bits := @ERR_DH_bits; + {$ifend} + {$if declared(DH_bits_introduced)} + if LibVersion < DH_bits_introduced then + begin + {$if declared(FC_DH_bits)} + DH_bits := @FC_DH_bits; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DH_bits_removed)} + if DH_bits_removed <= LibVersion then + begin + {$if declared(_DH_bits)} + DH_bits := @_DH_bits; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DH_bits_allownil)} + if FuncLoadError then + AFailed.Add('DH_bits'); + {$ifend} + end; + + {introduced 1.1.0} + DH_size := LoadLibFunction(ADllHandle, DH_size_procname); + FuncLoadError := not assigned(DH_size); + if FuncLoadError then + begin + {$if not defined(DH_size_allownil)} + DH_size := @ERR_DH_size; + {$ifend} + {$if declared(DH_size_introduced)} + if LibVersion < DH_size_introduced then + begin + {$if declared(FC_DH_size)} + DH_size := @FC_DH_size; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DH_size_removed)} + if DH_size_removed <= LibVersion then + begin + {$if declared(_DH_size)} + DH_size := @_DH_size; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DH_size_allownil)} + if FuncLoadError then + AFailed.Add('DH_size'); + {$ifend} + end; + + + DH_security_bits := LoadLibFunction(ADllHandle, DH_security_bits_procname); + FuncLoadError := not assigned(DH_security_bits); + if FuncLoadError then + begin + {$if not defined(DH_security_bits_allownil)} + DH_security_bits := @ERR_DH_security_bits; + {$ifend} + {$if declared(DH_security_bits_introduced)} + if LibVersion < DH_security_bits_introduced then + begin + {$if declared(FC_DH_security_bits)} + DH_security_bits := @FC_DH_security_bits; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DH_security_bits_removed)} + if DH_security_bits_removed <= LibVersion then + begin + {$if declared(_DH_security_bits)} + DH_security_bits := @_DH_security_bits; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DH_security_bits_allownil)} + if FuncLoadError then + AFailed.Add('DH_security_bits'); + {$ifend} + end; + + {introduced 1.1.0} + DH_set_ex_data := LoadLibFunction(ADllHandle, DH_set_ex_data_procname); + FuncLoadError := not assigned(DH_set_ex_data); + if FuncLoadError then + begin + {$if not defined(DH_set_ex_data_allownil)} + DH_set_ex_data := @ERR_DH_set_ex_data; + {$ifend} + {$if declared(DH_set_ex_data_introduced)} + if LibVersion < DH_set_ex_data_introduced then + begin + {$if declared(FC_DH_set_ex_data)} + DH_set_ex_data := @FC_DH_set_ex_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DH_set_ex_data_removed)} + if DH_set_ex_data_removed <= LibVersion then + begin + {$if declared(_DH_set_ex_data)} + DH_set_ex_data := @_DH_set_ex_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DH_set_ex_data_allownil)} + if FuncLoadError then + AFailed.Add('DH_set_ex_data'); + {$ifend} + end; + + + DH_get_ex_data := LoadLibFunction(ADllHandle, DH_get_ex_data_procname); + FuncLoadError := not assigned(DH_get_ex_data); + if FuncLoadError then + begin + {$if not defined(DH_get_ex_data_allownil)} + DH_get_ex_data := @ERR_DH_get_ex_data; + {$ifend} + {$if declared(DH_get_ex_data_introduced)} + if LibVersion < DH_get_ex_data_introduced then + begin + {$if declared(FC_DH_get_ex_data)} + DH_get_ex_data := @FC_DH_get_ex_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DH_get_ex_data_removed)} + if DH_get_ex_data_removed <= LibVersion then + begin + {$if declared(_DH_get_ex_data)} + DH_get_ex_data := @_DH_get_ex_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DH_get_ex_data_allownil)} + if FuncLoadError then + AFailed.Add('DH_get_ex_data'); + {$ifend} + end; + + + DH_generate_parameters_ex := LoadLibFunction(ADllHandle, DH_generate_parameters_ex_procname); + FuncLoadError := not assigned(DH_generate_parameters_ex); + if FuncLoadError then + begin + {$if not defined(DH_generate_parameters_ex_allownil)} + DH_generate_parameters_ex := @ERR_DH_generate_parameters_ex; + {$ifend} + {$if declared(DH_generate_parameters_ex_introduced)} + if LibVersion < DH_generate_parameters_ex_introduced then + begin + {$if declared(FC_DH_generate_parameters_ex)} + DH_generate_parameters_ex := @FC_DH_generate_parameters_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DH_generate_parameters_ex_removed)} + if DH_generate_parameters_ex_removed <= LibVersion then + begin + {$if declared(_DH_generate_parameters_ex)} + DH_generate_parameters_ex := @_DH_generate_parameters_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DH_generate_parameters_ex_allownil)} + if FuncLoadError then + AFailed.Add('DH_generate_parameters_ex'); + {$ifend} + end; + + + DH_check_params_ex := LoadLibFunction(ADllHandle, DH_check_params_ex_procname); + FuncLoadError := not assigned(DH_check_params_ex); + if FuncLoadError then + begin + {$if not defined(DH_check_params_ex_allownil)} + DH_check_params_ex := @ERR_DH_check_params_ex; + {$ifend} + {$if declared(DH_check_params_ex_introduced)} + if LibVersion < DH_check_params_ex_introduced then + begin + {$if declared(FC_DH_check_params_ex)} + DH_check_params_ex := @FC_DH_check_params_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DH_check_params_ex_removed)} + if DH_check_params_ex_removed <= LibVersion then + begin + {$if declared(_DH_check_params_ex)} + DH_check_params_ex := @_DH_check_params_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DH_check_params_ex_allownil)} + if FuncLoadError then + AFailed.Add('DH_check_params_ex'); + {$ifend} + end; + + {introduced 1.1.0} + DH_check_ex := LoadLibFunction(ADllHandle, DH_check_ex_procname); + FuncLoadError := not assigned(DH_check_ex); + if FuncLoadError then + begin + {$if not defined(DH_check_ex_allownil)} + DH_check_ex := @ERR_DH_check_ex; + {$ifend} + {$if declared(DH_check_ex_introduced)} + if LibVersion < DH_check_ex_introduced then + begin + {$if declared(FC_DH_check_ex)} + DH_check_ex := @FC_DH_check_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DH_check_ex_removed)} + if DH_check_ex_removed <= LibVersion then + begin + {$if declared(_DH_check_ex)} + DH_check_ex := @_DH_check_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DH_check_ex_allownil)} + if FuncLoadError then + AFailed.Add('DH_check_ex'); + {$ifend} + end; + + {introduced 1.1.0} + DH_check_pub_key_ex := LoadLibFunction(ADllHandle, DH_check_pub_key_ex_procname); + FuncLoadError := not assigned(DH_check_pub_key_ex); + if FuncLoadError then + begin + {$if not defined(DH_check_pub_key_ex_allownil)} + DH_check_pub_key_ex := @ERR_DH_check_pub_key_ex; + {$ifend} + {$if declared(DH_check_pub_key_ex_introduced)} + if LibVersion < DH_check_pub_key_ex_introduced then + begin + {$if declared(FC_DH_check_pub_key_ex)} + DH_check_pub_key_ex := @FC_DH_check_pub_key_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DH_check_pub_key_ex_removed)} + if DH_check_pub_key_ex_removed <= LibVersion then + begin + {$if declared(_DH_check_pub_key_ex)} + DH_check_pub_key_ex := @_DH_check_pub_key_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DH_check_pub_key_ex_allownil)} + if FuncLoadError then + AFailed.Add('DH_check_pub_key_ex'); + {$ifend} + end; + + {introduced 1.1.0} + DH_check_params := LoadLibFunction(ADllHandle, DH_check_params_procname); + FuncLoadError := not assigned(DH_check_params); + if FuncLoadError then + begin + {$if not defined(DH_check_params_allownil)} + DH_check_params := @ERR_DH_check_params; + {$ifend} + {$if declared(DH_check_params_introduced)} + if LibVersion < DH_check_params_introduced then + begin + {$if declared(FC_DH_check_params)} + DH_check_params := @FC_DH_check_params; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DH_check_params_removed)} + if DH_check_params_removed <= LibVersion then + begin + {$if declared(_DH_check_params)} + DH_check_params := @_DH_check_params; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DH_check_params_allownil)} + if FuncLoadError then + AFailed.Add('DH_check_params'); + {$ifend} + end; + + {introduced 1.1.0} + DH_check := LoadLibFunction(ADllHandle, DH_check_procname); + FuncLoadError := not assigned(DH_check); + if FuncLoadError then + begin + {$if not defined(DH_check_allownil)} + DH_check := @ERR_DH_check; + {$ifend} + {$if declared(DH_check_introduced)} + if LibVersion < DH_check_introduced then + begin + {$if declared(FC_DH_check)} + DH_check := @FC_DH_check; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DH_check_removed)} + if DH_check_removed <= LibVersion then + begin + {$if declared(_DH_check)} + DH_check := @_DH_check; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DH_check_allownil)} + if FuncLoadError then + AFailed.Add('DH_check'); + {$ifend} + end; + + + DH_check_pub_key := LoadLibFunction(ADllHandle, DH_check_pub_key_procname); + FuncLoadError := not assigned(DH_check_pub_key); + if FuncLoadError then + begin + {$if not defined(DH_check_pub_key_allownil)} + DH_check_pub_key := @ERR_DH_check_pub_key; + {$ifend} + {$if declared(DH_check_pub_key_introduced)} + if LibVersion < DH_check_pub_key_introduced then + begin + {$if declared(FC_DH_check_pub_key)} + DH_check_pub_key := @FC_DH_check_pub_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DH_check_pub_key_removed)} + if DH_check_pub_key_removed <= LibVersion then + begin + {$if declared(_DH_check_pub_key)} + DH_check_pub_key := @_DH_check_pub_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DH_check_pub_key_allownil)} + if FuncLoadError then + AFailed.Add('DH_check_pub_key'); + {$ifend} + end; + + + DH_generate_key := LoadLibFunction(ADllHandle, DH_generate_key_procname); + FuncLoadError := not assigned(DH_generate_key); + if FuncLoadError then + begin + {$if not defined(DH_generate_key_allownil)} + DH_generate_key := @ERR_DH_generate_key; + {$ifend} + {$if declared(DH_generate_key_introduced)} + if LibVersion < DH_generate_key_introduced then + begin + {$if declared(FC_DH_generate_key)} + DH_generate_key := @FC_DH_generate_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DH_generate_key_removed)} + if DH_generate_key_removed <= LibVersion then + begin + {$if declared(_DH_generate_key)} + DH_generate_key := @_DH_generate_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DH_generate_key_allownil)} + if FuncLoadError then + AFailed.Add('DH_generate_key'); + {$ifend} + end; + + + DH_compute_key := LoadLibFunction(ADllHandle, DH_compute_key_procname); + FuncLoadError := not assigned(DH_compute_key); + if FuncLoadError then + begin + {$if not defined(DH_compute_key_allownil)} + DH_compute_key := @ERR_DH_compute_key; + {$ifend} + {$if declared(DH_compute_key_introduced)} + if LibVersion < DH_compute_key_introduced then + begin + {$if declared(FC_DH_compute_key)} + DH_compute_key := @FC_DH_compute_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DH_compute_key_removed)} + if DH_compute_key_removed <= LibVersion then + begin + {$if declared(_DH_compute_key)} + DH_compute_key := @_DH_compute_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DH_compute_key_allownil)} + if FuncLoadError then + AFailed.Add('DH_compute_key'); + {$ifend} + end; + + + DH_compute_key_padded := LoadLibFunction(ADllHandle, DH_compute_key_padded_procname); + FuncLoadError := not assigned(DH_compute_key_padded); + if FuncLoadError then + begin + {$if not defined(DH_compute_key_padded_allownil)} + DH_compute_key_padded := @ERR_DH_compute_key_padded; + {$ifend} + {$if declared(DH_compute_key_padded_introduced)} + if LibVersion < DH_compute_key_padded_introduced then + begin + {$if declared(FC_DH_compute_key_padded)} + DH_compute_key_padded := @FC_DH_compute_key_padded; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DH_compute_key_padded_removed)} + if DH_compute_key_padded_removed <= LibVersion then + begin + {$if declared(_DH_compute_key_padded)} + DH_compute_key_padded := @_DH_compute_key_padded; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DH_compute_key_padded_allownil)} + if FuncLoadError then + AFailed.Add('DH_compute_key_padded'); + {$ifend} + end; + + + d2i_DHparams := LoadLibFunction(ADllHandle, d2i_DHparams_procname); + FuncLoadError := not assigned(d2i_DHparams); + if FuncLoadError then + begin + {$if not defined(d2i_DHparams_allownil)} + d2i_DHparams := @ERR_d2i_DHparams; + {$ifend} + {$if declared(d2i_DHparams_introduced)} + if LibVersion < d2i_DHparams_introduced then + begin + {$if declared(FC_d2i_DHparams)} + d2i_DHparams := @FC_d2i_DHparams; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(d2i_DHparams_removed)} + if d2i_DHparams_removed <= LibVersion then + begin + {$if declared(_d2i_DHparams)} + d2i_DHparams := @_d2i_DHparams; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(d2i_DHparams_allownil)} + if FuncLoadError then + AFailed.Add('d2i_DHparams'); + {$ifend} + end; + + + i2d_DHparams := LoadLibFunction(ADllHandle, i2d_DHparams_procname); + FuncLoadError := not assigned(i2d_DHparams); + if FuncLoadError then + begin + {$if not defined(i2d_DHparams_allownil)} + i2d_DHparams := @ERR_i2d_DHparams; + {$ifend} + {$if declared(i2d_DHparams_introduced)} + if LibVersion < i2d_DHparams_introduced then + begin + {$if declared(FC_i2d_DHparams)} + i2d_DHparams := @FC_i2d_DHparams; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(i2d_DHparams_removed)} + if i2d_DHparams_removed <= LibVersion then + begin + {$if declared(_i2d_DHparams)} + i2d_DHparams := @_i2d_DHparams; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(i2d_DHparams_allownil)} + if FuncLoadError then + AFailed.Add('i2d_DHparams'); + {$ifend} + end; + + + d2i_DHxparams := LoadLibFunction(ADllHandle, d2i_DHxparams_procname); + FuncLoadError := not assigned(d2i_DHxparams); + if FuncLoadError then + begin + {$if not defined(d2i_DHxparams_allownil)} + d2i_DHxparams := @ERR_d2i_DHxparams; + {$ifend} + {$if declared(d2i_DHxparams_introduced)} + if LibVersion < d2i_DHxparams_introduced then + begin + {$if declared(FC_d2i_DHxparams)} + d2i_DHxparams := @FC_d2i_DHxparams; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(d2i_DHxparams_removed)} + if d2i_DHxparams_removed <= LibVersion then + begin + {$if declared(_d2i_DHxparams)} + d2i_DHxparams := @_d2i_DHxparams; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(d2i_DHxparams_allownil)} + if FuncLoadError then + AFailed.Add('d2i_DHxparams'); + {$ifend} + end; + + + i2d_DHxparams := LoadLibFunction(ADllHandle, i2d_DHxparams_procname); + FuncLoadError := not assigned(i2d_DHxparams); + if FuncLoadError then + begin + {$if not defined(i2d_DHxparams_allownil)} + i2d_DHxparams := @ERR_i2d_DHxparams; + {$ifend} + {$if declared(i2d_DHxparams_introduced)} + if LibVersion < i2d_DHxparams_introduced then + begin + {$if declared(FC_i2d_DHxparams)} + i2d_DHxparams := @FC_i2d_DHxparams; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(i2d_DHxparams_removed)} + if i2d_DHxparams_removed <= LibVersion then + begin + {$if declared(_i2d_DHxparams)} + i2d_DHxparams := @_i2d_DHxparams; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(i2d_DHxparams_allownil)} + if FuncLoadError then + AFailed.Add('i2d_DHxparams'); + {$ifend} + end; + + + DHparams_print := LoadLibFunction(ADllHandle, DHparams_print_procname); + FuncLoadError := not assigned(DHparams_print); + if FuncLoadError then + begin + {$if not defined(DHparams_print_allownil)} + DHparams_print := @ERR_DHparams_print; + {$ifend} + {$if declared(DHparams_print_introduced)} + if LibVersion < DHparams_print_introduced then + begin + {$if declared(FC_DHparams_print)} + DHparams_print := @FC_DHparams_print; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DHparams_print_removed)} + if DHparams_print_removed <= LibVersion then + begin + {$if declared(_DHparams_print)} + DHparams_print := @_DHparams_print; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DHparams_print_allownil)} + if FuncLoadError then + AFailed.Add('DHparams_print'); + {$ifend} + end; + + + DH_get_1024_160 := LoadLibFunction(ADllHandle, DH_get_1024_160_procname); + FuncLoadError := not assigned(DH_get_1024_160); + if FuncLoadError then + begin + {$if not defined(DH_get_1024_160_allownil)} + DH_get_1024_160 := @ERR_DH_get_1024_160; + {$ifend} + {$if declared(DH_get_1024_160_introduced)} + if LibVersion < DH_get_1024_160_introduced then + begin + {$if declared(FC_DH_get_1024_160)} + DH_get_1024_160 := @FC_DH_get_1024_160; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DH_get_1024_160_removed)} + if DH_get_1024_160_removed <= LibVersion then + begin + {$if declared(_DH_get_1024_160)} + DH_get_1024_160 := @_DH_get_1024_160; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DH_get_1024_160_allownil)} + if FuncLoadError then + AFailed.Add('DH_get_1024_160'); + {$ifend} + end; + + + DH_get_2048_224 := LoadLibFunction(ADllHandle, DH_get_2048_224_procname); + FuncLoadError := not assigned(DH_get_2048_224); + if FuncLoadError then + begin + {$if not defined(DH_get_2048_224_allownil)} + DH_get_2048_224 := @ERR_DH_get_2048_224; + {$ifend} + {$if declared(DH_get_2048_224_introduced)} + if LibVersion < DH_get_2048_224_introduced then + begin + {$if declared(FC_DH_get_2048_224)} + DH_get_2048_224 := @FC_DH_get_2048_224; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DH_get_2048_224_removed)} + if DH_get_2048_224_removed <= LibVersion then + begin + {$if declared(_DH_get_2048_224)} + DH_get_2048_224 := @_DH_get_2048_224; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DH_get_2048_224_allownil)} + if FuncLoadError then + AFailed.Add('DH_get_2048_224'); + {$ifend} + end; + + + DH_get_2048_256 := LoadLibFunction(ADllHandle, DH_get_2048_256_procname); + FuncLoadError := not assigned(DH_get_2048_256); + if FuncLoadError then + begin + {$if not defined(DH_get_2048_256_allownil)} + DH_get_2048_256 := @ERR_DH_get_2048_256; + {$ifend} + {$if declared(DH_get_2048_256_introduced)} + if LibVersion < DH_get_2048_256_introduced then + begin + {$if declared(FC_DH_get_2048_256)} + DH_get_2048_256 := @FC_DH_get_2048_256; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DH_get_2048_256_removed)} + if DH_get_2048_256_removed <= LibVersion then + begin + {$if declared(_DH_get_2048_256)} + DH_get_2048_256 := @_DH_get_2048_256; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DH_get_2048_256_allownil)} + if FuncLoadError then + AFailed.Add('DH_get_2048_256'); + {$ifend} + end; + + + DH_new_by_nid := LoadLibFunction(ADllHandle, DH_new_by_nid_procname); + FuncLoadError := not assigned(DH_new_by_nid); + if FuncLoadError then + begin + {$if not defined(DH_new_by_nid_allownil)} + DH_new_by_nid := @ERR_DH_new_by_nid; + {$ifend} + {$if declared(DH_new_by_nid_introduced)} + if LibVersion < DH_new_by_nid_introduced then + begin + {$if declared(FC_DH_new_by_nid)} + DH_new_by_nid := @FC_DH_new_by_nid; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DH_new_by_nid_removed)} + if DH_new_by_nid_removed <= LibVersion then + begin + {$if declared(_DH_new_by_nid)} + DH_new_by_nid := @_DH_new_by_nid; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DH_new_by_nid_allownil)} + if FuncLoadError then + AFailed.Add('DH_new_by_nid'); + {$ifend} + end; + + {introduced 1.1.0} + DH_get_nid := LoadLibFunction(ADllHandle, DH_get_nid_procname); + FuncLoadError := not assigned(DH_get_nid); + if FuncLoadError then + begin + {$if not defined(DH_get_nid_allownil)} + DH_get_nid := @ERR_DH_get_nid; + {$ifend} + {$if declared(DH_get_nid_introduced)} + if LibVersion < DH_get_nid_introduced then + begin + {$if declared(FC_DH_get_nid)} + DH_get_nid := @FC_DH_get_nid; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DH_get_nid_removed)} + if DH_get_nid_removed <= LibVersion then + begin + {$if declared(_DH_get_nid)} + DH_get_nid := @_DH_get_nid; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DH_get_nid_allownil)} + if FuncLoadError then + AFailed.Add('DH_get_nid'); + {$ifend} + end; + + {introduced 1.1.0} + DH_KDF_X9_42 := LoadLibFunction(ADllHandle, DH_KDF_X9_42_procname); + FuncLoadError := not assigned(DH_KDF_X9_42); + if FuncLoadError then + begin + {$if not defined(DH_KDF_X9_42_allownil)} + DH_KDF_X9_42 := @ERR_DH_KDF_X9_42; + {$ifend} + {$if declared(DH_KDF_X9_42_introduced)} + if LibVersion < DH_KDF_X9_42_introduced then + begin + {$if declared(FC_DH_KDF_X9_42)} + DH_KDF_X9_42 := @FC_DH_KDF_X9_42; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DH_KDF_X9_42_removed)} + if DH_KDF_X9_42_removed <= LibVersion then + begin + {$if declared(_DH_KDF_X9_42)} + DH_KDF_X9_42 := @_DH_KDF_X9_42; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DH_KDF_X9_42_allownil)} + if FuncLoadError then + AFailed.Add('DH_KDF_X9_42'); + {$ifend} + end; + + + DH_get0_pqg := LoadLibFunction(ADllHandle, DH_get0_pqg_procname); + FuncLoadError := not assigned(DH_get0_pqg); + if FuncLoadError then + begin + {$if not defined(DH_get0_pqg_allownil)} + DH_get0_pqg := @ERR_DH_get0_pqg; + {$ifend} + {$if declared(DH_get0_pqg_introduced)} + if LibVersion < DH_get0_pqg_introduced then + begin + {$if declared(FC_DH_get0_pqg)} + DH_get0_pqg := @FC_DH_get0_pqg; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DH_get0_pqg_removed)} + if DH_get0_pqg_removed <= LibVersion then + begin + {$if declared(_DH_get0_pqg)} + DH_get0_pqg := @_DH_get0_pqg; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DH_get0_pqg_allownil)} + if FuncLoadError then + AFailed.Add('DH_get0_pqg'); + {$ifend} + end; + + {introduced 1.1.0} + DH_set0_pqg := LoadLibFunction(ADllHandle, DH_set0_pqg_procname); + FuncLoadError := not assigned(DH_set0_pqg); + if FuncLoadError then + begin + {$if not defined(DH_set0_pqg_allownil)} + DH_set0_pqg := @ERR_DH_set0_pqg; + {$ifend} + {$if declared(DH_set0_pqg_introduced)} + if LibVersion < DH_set0_pqg_introduced then + begin + {$if declared(FC_DH_set0_pqg)} + DH_set0_pqg := @FC_DH_set0_pqg; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DH_set0_pqg_removed)} + if DH_set0_pqg_removed <= LibVersion then + begin + {$if declared(_DH_set0_pqg)} + DH_set0_pqg := @_DH_set0_pqg; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DH_set0_pqg_allownil)} + if FuncLoadError then + AFailed.Add('DH_set0_pqg'); + {$ifend} + end; + + {introduced 1.1.0} + DH_get0_key := LoadLibFunction(ADllHandle, DH_get0_key_procname); + FuncLoadError := not assigned(DH_get0_key); + if FuncLoadError then + begin + {$if not defined(DH_get0_key_allownil)} + DH_get0_key := @ERR_DH_get0_key; + {$ifend} + {$if declared(DH_get0_key_introduced)} + if LibVersion < DH_get0_key_introduced then + begin + {$if declared(FC_DH_get0_key)} + DH_get0_key := @FC_DH_get0_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DH_get0_key_removed)} + if DH_get0_key_removed <= LibVersion then + begin + {$if declared(_DH_get0_key)} + DH_get0_key := @_DH_get0_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DH_get0_key_allownil)} + if FuncLoadError then + AFailed.Add('DH_get0_key'); + {$ifend} + end; + + {introduced 1.1.0} + DH_set0_key := LoadLibFunction(ADllHandle, DH_set0_key_procname); + FuncLoadError := not assigned(DH_set0_key); + if FuncLoadError then + begin + {$if not defined(DH_set0_key_allownil)} + DH_set0_key := @ERR_DH_set0_key; + {$ifend} + {$if declared(DH_set0_key_introduced)} + if LibVersion < DH_set0_key_introduced then + begin + {$if declared(FC_DH_set0_key)} + DH_set0_key := @FC_DH_set0_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DH_set0_key_removed)} + if DH_set0_key_removed <= LibVersion then + begin + {$if declared(_DH_set0_key)} + DH_set0_key := @_DH_set0_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DH_set0_key_allownil)} + if FuncLoadError then + AFailed.Add('DH_set0_key'); + {$ifend} + end; + + {introduced 1.1.0} + DH_get0_p := LoadLibFunction(ADllHandle, DH_get0_p_procname); + FuncLoadError := not assigned(DH_get0_p); + if FuncLoadError then + begin + {$if not defined(DH_get0_p_allownil)} + DH_get0_p := @ERR_DH_get0_p; + {$ifend} + {$if declared(DH_get0_p_introduced)} + if LibVersion < DH_get0_p_introduced then + begin + {$if declared(FC_DH_get0_p)} + DH_get0_p := @FC_DH_get0_p; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DH_get0_p_removed)} + if DH_get0_p_removed <= LibVersion then + begin + {$if declared(_DH_get0_p)} + DH_get0_p := @_DH_get0_p; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DH_get0_p_allownil)} + if FuncLoadError then + AFailed.Add('DH_get0_p'); + {$ifend} + end; + + {introduced 1.1.0} + DH_get0_q := LoadLibFunction(ADllHandle, DH_get0_q_procname); + FuncLoadError := not assigned(DH_get0_q); + if FuncLoadError then + begin + {$if not defined(DH_get0_q_allownil)} + DH_get0_q := @ERR_DH_get0_q; + {$ifend} + {$if declared(DH_get0_q_introduced)} + if LibVersion < DH_get0_q_introduced then + begin + {$if declared(FC_DH_get0_q)} + DH_get0_q := @FC_DH_get0_q; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DH_get0_q_removed)} + if DH_get0_q_removed <= LibVersion then + begin + {$if declared(_DH_get0_q)} + DH_get0_q := @_DH_get0_q; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DH_get0_q_allownil)} + if FuncLoadError then + AFailed.Add('DH_get0_q'); + {$ifend} + end; + + {introduced 1.1.0} + DH_get0_g := LoadLibFunction(ADllHandle, DH_get0_g_procname); + FuncLoadError := not assigned(DH_get0_g); + if FuncLoadError then + begin + {$if not defined(DH_get0_g_allownil)} + DH_get0_g := @ERR_DH_get0_g; + {$ifend} + {$if declared(DH_get0_g_introduced)} + if LibVersion < DH_get0_g_introduced then + begin + {$if declared(FC_DH_get0_g)} + DH_get0_g := @FC_DH_get0_g; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DH_get0_g_removed)} + if DH_get0_g_removed <= LibVersion then + begin + {$if declared(_DH_get0_g)} + DH_get0_g := @_DH_get0_g; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DH_get0_g_allownil)} + if FuncLoadError then + AFailed.Add('DH_get0_g'); + {$ifend} + end; + + {introduced 1.1.0} + DH_get0_priv_key := LoadLibFunction(ADllHandle, DH_get0_priv_key_procname); + FuncLoadError := not assigned(DH_get0_priv_key); + if FuncLoadError then + begin + {$if not defined(DH_get0_priv_key_allownil)} + DH_get0_priv_key := @ERR_DH_get0_priv_key; + {$ifend} + {$if declared(DH_get0_priv_key_introduced)} + if LibVersion < DH_get0_priv_key_introduced then + begin + {$if declared(FC_DH_get0_priv_key)} + DH_get0_priv_key := @FC_DH_get0_priv_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DH_get0_priv_key_removed)} + if DH_get0_priv_key_removed <= LibVersion then + begin + {$if declared(_DH_get0_priv_key)} + DH_get0_priv_key := @_DH_get0_priv_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DH_get0_priv_key_allownil)} + if FuncLoadError then + AFailed.Add('DH_get0_priv_key'); + {$ifend} + end; + + {introduced 1.1.0} + DH_get0_pub_key := LoadLibFunction(ADllHandle, DH_get0_pub_key_procname); + FuncLoadError := not assigned(DH_get0_pub_key); + if FuncLoadError then + begin + {$if not defined(DH_get0_pub_key_allownil)} + DH_get0_pub_key := @ERR_DH_get0_pub_key; + {$ifend} + {$if declared(DH_get0_pub_key_introduced)} + if LibVersion < DH_get0_pub_key_introduced then + begin + {$if declared(FC_DH_get0_pub_key)} + DH_get0_pub_key := @FC_DH_get0_pub_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DH_get0_pub_key_removed)} + if DH_get0_pub_key_removed <= LibVersion then + begin + {$if declared(_DH_get0_pub_key)} + DH_get0_pub_key := @_DH_get0_pub_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DH_get0_pub_key_allownil)} + if FuncLoadError then + AFailed.Add('DH_get0_pub_key'); + {$ifend} + end; + + {introduced 1.1.0} + DH_clear_flags := LoadLibFunction(ADllHandle, DH_clear_flags_procname); + FuncLoadError := not assigned(DH_clear_flags); + if FuncLoadError then + begin + {$if not defined(DH_clear_flags_allownil)} + DH_clear_flags := @ERR_DH_clear_flags; + {$ifend} + {$if declared(DH_clear_flags_introduced)} + if LibVersion < DH_clear_flags_introduced then + begin + {$if declared(FC_DH_clear_flags)} + DH_clear_flags := @FC_DH_clear_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DH_clear_flags_removed)} + if DH_clear_flags_removed <= LibVersion then + begin + {$if declared(_DH_clear_flags)} + DH_clear_flags := @_DH_clear_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DH_clear_flags_allownil)} + if FuncLoadError then + AFailed.Add('DH_clear_flags'); + {$ifend} + end; + + {introduced 1.1.0} + DH_test_flags := LoadLibFunction(ADllHandle, DH_test_flags_procname); + FuncLoadError := not assigned(DH_test_flags); + if FuncLoadError then + begin + {$if not defined(DH_test_flags_allownil)} + DH_test_flags := @ERR_DH_test_flags; + {$ifend} + {$if declared(DH_test_flags_introduced)} + if LibVersion < DH_test_flags_introduced then + begin + {$if declared(FC_DH_test_flags)} + DH_test_flags := @FC_DH_test_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DH_test_flags_removed)} + if DH_test_flags_removed <= LibVersion then + begin + {$if declared(_DH_test_flags)} + DH_test_flags := @_DH_test_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DH_test_flags_allownil)} + if FuncLoadError then + AFailed.Add('DH_test_flags'); + {$ifend} + end; + + {introduced 1.1.0} + DH_set_flags := LoadLibFunction(ADllHandle, DH_set_flags_procname); + FuncLoadError := not assigned(DH_set_flags); + if FuncLoadError then + begin + {$if not defined(DH_set_flags_allownil)} + DH_set_flags := @ERR_DH_set_flags; + {$ifend} + {$if declared(DH_set_flags_introduced)} + if LibVersion < DH_set_flags_introduced then + begin + {$if declared(FC_DH_set_flags)} + DH_set_flags := @FC_DH_set_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DH_set_flags_removed)} + if DH_set_flags_removed <= LibVersion then + begin + {$if declared(_DH_set_flags)} + DH_set_flags := @_DH_set_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DH_set_flags_allownil)} + if FuncLoadError then + AFailed.Add('DH_set_flags'); + {$ifend} + end; + + {introduced 1.1.0} + DH_get0_engine := LoadLibFunction(ADllHandle, DH_get0_engine_procname); + FuncLoadError := not assigned(DH_get0_engine); + if FuncLoadError then + begin + {$if not defined(DH_get0_engine_allownil)} + DH_get0_engine := @ERR_DH_get0_engine; + {$ifend} + {$if declared(DH_get0_engine_introduced)} + if LibVersion < DH_get0_engine_introduced then + begin + {$if declared(FC_DH_get0_engine)} + DH_get0_engine := @FC_DH_get0_engine; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DH_get0_engine_removed)} + if DH_get0_engine_removed <= LibVersion then + begin + {$if declared(_DH_get0_engine)} + DH_get0_engine := @_DH_get0_engine; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DH_get0_engine_allownil)} + if FuncLoadError then + AFailed.Add('DH_get0_engine'); + {$ifend} + end; + + {introduced 1.1.0} + DH_get_length := LoadLibFunction(ADllHandle, DH_get_length_procname); + FuncLoadError := not assigned(DH_get_length); + if FuncLoadError then + begin + {$if not defined(DH_get_length_allownil)} + DH_get_length := @ERR_DH_get_length; + {$ifend} + {$if declared(DH_get_length_introduced)} + if LibVersion < DH_get_length_introduced then + begin + {$if declared(FC_DH_get_length)} + DH_get_length := @FC_DH_get_length; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DH_get_length_removed)} + if DH_get_length_removed <= LibVersion then + begin + {$if declared(_DH_get_length)} + DH_get_length := @_DH_get_length; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DH_get_length_allownil)} + if FuncLoadError then + AFailed.Add('DH_get_length'); + {$ifend} + end; + + {introduced 1.1.0} + DH_set_length := LoadLibFunction(ADllHandle, DH_set_length_procname); + FuncLoadError := not assigned(DH_set_length); + if FuncLoadError then + begin + {$if not defined(DH_set_length_allownil)} + DH_set_length := @ERR_DH_set_length; + {$ifend} + {$if declared(DH_set_length_introduced)} + if LibVersion < DH_set_length_introduced then + begin + {$if declared(FC_DH_set_length)} + DH_set_length := @FC_DH_set_length; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DH_set_length_removed)} + if DH_set_length_removed <= LibVersion then + begin + {$if declared(_DH_set_length)} + DH_set_length := @_DH_set_length; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DH_set_length_allownil)} + if FuncLoadError then + AFailed.Add('DH_set_length'); + {$ifend} + end; + + {introduced 1.1.0} + DH_meth_new := LoadLibFunction(ADllHandle, DH_meth_new_procname); + FuncLoadError := not assigned(DH_meth_new); + if FuncLoadError then + begin + {$if not defined(DH_meth_new_allownil)} + DH_meth_new := @ERR_DH_meth_new; + {$ifend} + {$if declared(DH_meth_new_introduced)} + if LibVersion < DH_meth_new_introduced then + begin + {$if declared(FC_DH_meth_new)} + DH_meth_new := @FC_DH_meth_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DH_meth_new_removed)} + if DH_meth_new_removed <= LibVersion then + begin + {$if declared(_DH_meth_new)} + DH_meth_new := @_DH_meth_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DH_meth_new_allownil)} + if FuncLoadError then + AFailed.Add('DH_meth_new'); + {$ifend} + end; + + {introduced 1.1.0} + DH_meth_free := LoadLibFunction(ADllHandle, DH_meth_free_procname); + FuncLoadError := not assigned(DH_meth_free); + if FuncLoadError then + begin + {$if not defined(DH_meth_free_allownil)} + DH_meth_free := @ERR_DH_meth_free; + {$ifend} + {$if declared(DH_meth_free_introduced)} + if LibVersion < DH_meth_free_introduced then + begin + {$if declared(FC_DH_meth_free)} + DH_meth_free := @FC_DH_meth_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DH_meth_free_removed)} + if DH_meth_free_removed <= LibVersion then + begin + {$if declared(_DH_meth_free)} + DH_meth_free := @_DH_meth_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DH_meth_free_allownil)} + if FuncLoadError then + AFailed.Add('DH_meth_free'); + {$ifend} + end; + + {introduced 1.1.0} + DH_meth_dup := LoadLibFunction(ADllHandle, DH_meth_dup_procname); + FuncLoadError := not assigned(DH_meth_dup); + if FuncLoadError then + begin + {$if not defined(DH_meth_dup_allownil)} + DH_meth_dup := @ERR_DH_meth_dup; + {$ifend} + {$if declared(DH_meth_dup_introduced)} + if LibVersion < DH_meth_dup_introduced then + begin + {$if declared(FC_DH_meth_dup)} + DH_meth_dup := @FC_DH_meth_dup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DH_meth_dup_removed)} + if DH_meth_dup_removed <= LibVersion then + begin + {$if declared(_DH_meth_dup)} + DH_meth_dup := @_DH_meth_dup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DH_meth_dup_allownil)} + if FuncLoadError then + AFailed.Add('DH_meth_dup'); + {$ifend} + end; + + {introduced 1.1.0} + DH_meth_get0_name := LoadLibFunction(ADllHandle, DH_meth_get0_name_procname); + FuncLoadError := not assigned(DH_meth_get0_name); + if FuncLoadError then + begin + {$if not defined(DH_meth_get0_name_allownil)} + DH_meth_get0_name := @ERR_DH_meth_get0_name; + {$ifend} + {$if declared(DH_meth_get0_name_introduced)} + if LibVersion < DH_meth_get0_name_introduced then + begin + {$if declared(FC_DH_meth_get0_name)} + DH_meth_get0_name := @FC_DH_meth_get0_name; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DH_meth_get0_name_removed)} + if DH_meth_get0_name_removed <= LibVersion then + begin + {$if declared(_DH_meth_get0_name)} + DH_meth_get0_name := @_DH_meth_get0_name; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DH_meth_get0_name_allownil)} + if FuncLoadError then + AFailed.Add('DH_meth_get0_name'); + {$ifend} + end; + + {introduced 1.1.0} + DH_meth_set1_name := LoadLibFunction(ADllHandle, DH_meth_set1_name_procname); + FuncLoadError := not assigned(DH_meth_set1_name); + if FuncLoadError then + begin + {$if not defined(DH_meth_set1_name_allownil)} + DH_meth_set1_name := @ERR_DH_meth_set1_name; + {$ifend} + {$if declared(DH_meth_set1_name_introduced)} + if LibVersion < DH_meth_set1_name_introduced then + begin + {$if declared(FC_DH_meth_set1_name)} + DH_meth_set1_name := @FC_DH_meth_set1_name; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DH_meth_set1_name_removed)} + if DH_meth_set1_name_removed <= LibVersion then + begin + {$if declared(_DH_meth_set1_name)} + DH_meth_set1_name := @_DH_meth_set1_name; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DH_meth_set1_name_allownil)} + if FuncLoadError then + AFailed.Add('DH_meth_set1_name'); + {$ifend} + end; + + {introduced 1.1.0} + DH_meth_get_flags := LoadLibFunction(ADllHandle, DH_meth_get_flags_procname); + FuncLoadError := not assigned(DH_meth_get_flags); + if FuncLoadError then + begin + {$if not defined(DH_meth_get_flags_allownil)} + DH_meth_get_flags := @ERR_DH_meth_get_flags; + {$ifend} + {$if declared(DH_meth_get_flags_introduced)} + if LibVersion < DH_meth_get_flags_introduced then + begin + {$if declared(FC_DH_meth_get_flags)} + DH_meth_get_flags := @FC_DH_meth_get_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DH_meth_get_flags_removed)} + if DH_meth_get_flags_removed <= LibVersion then + begin + {$if declared(_DH_meth_get_flags)} + DH_meth_get_flags := @_DH_meth_get_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DH_meth_get_flags_allownil)} + if FuncLoadError then + AFailed.Add('DH_meth_get_flags'); + {$ifend} + end; + + {introduced 1.1.0} + DH_meth_set_flags := LoadLibFunction(ADllHandle, DH_meth_set_flags_procname); + FuncLoadError := not assigned(DH_meth_set_flags); + if FuncLoadError then + begin + {$if not defined(DH_meth_set_flags_allownil)} + DH_meth_set_flags := @ERR_DH_meth_set_flags; + {$ifend} + {$if declared(DH_meth_set_flags_introduced)} + if LibVersion < DH_meth_set_flags_introduced then + begin + {$if declared(FC_DH_meth_set_flags)} + DH_meth_set_flags := @FC_DH_meth_set_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DH_meth_set_flags_removed)} + if DH_meth_set_flags_removed <= LibVersion then + begin + {$if declared(_DH_meth_set_flags)} + DH_meth_set_flags := @_DH_meth_set_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DH_meth_set_flags_allownil)} + if FuncLoadError then + AFailed.Add('DH_meth_set_flags'); + {$ifend} + end; + + {introduced 1.1.0} + DH_meth_get0_app_data := LoadLibFunction(ADllHandle, DH_meth_get0_app_data_procname); + FuncLoadError := not assigned(DH_meth_get0_app_data); + if FuncLoadError then + begin + {$if not defined(DH_meth_get0_app_data_allownil)} + DH_meth_get0_app_data := @ERR_DH_meth_get0_app_data; + {$ifend} + {$if declared(DH_meth_get0_app_data_introduced)} + if LibVersion < DH_meth_get0_app_data_introduced then + begin + {$if declared(FC_DH_meth_get0_app_data)} + DH_meth_get0_app_data := @FC_DH_meth_get0_app_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DH_meth_get0_app_data_removed)} + if DH_meth_get0_app_data_removed <= LibVersion then + begin + {$if declared(_DH_meth_get0_app_data)} + DH_meth_get0_app_data := @_DH_meth_get0_app_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DH_meth_get0_app_data_allownil)} + if FuncLoadError then + AFailed.Add('DH_meth_get0_app_data'); + {$ifend} + end; + + {introduced 1.1.0} + DH_meth_set0_app_data := LoadLibFunction(ADllHandle, DH_meth_set0_app_data_procname); + FuncLoadError := not assigned(DH_meth_set0_app_data); + if FuncLoadError then + begin + {$if not defined(DH_meth_set0_app_data_allownil)} + DH_meth_set0_app_data := @ERR_DH_meth_set0_app_data; + {$ifend} + {$if declared(DH_meth_set0_app_data_introduced)} + if LibVersion < DH_meth_set0_app_data_introduced then + begin + {$if declared(FC_DH_meth_set0_app_data)} + DH_meth_set0_app_data := @FC_DH_meth_set0_app_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DH_meth_set0_app_data_removed)} + if DH_meth_set0_app_data_removed <= LibVersion then + begin + {$if declared(_DH_meth_set0_app_data)} + DH_meth_set0_app_data := @_DH_meth_set0_app_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DH_meth_set0_app_data_allownil)} + if FuncLoadError then + AFailed.Add('DH_meth_set0_app_data'); + {$ifend} + end; + + {introduced 1.1.0} + DH_meth_get_generate_key := LoadLibFunction(ADllHandle, DH_meth_get_generate_key_procname); + FuncLoadError := not assigned(DH_meth_get_generate_key); + if FuncLoadError then + begin + {$if not defined(DH_meth_get_generate_key_allownil)} + DH_meth_get_generate_key := @ERR_DH_meth_get_generate_key; + {$ifend} + {$if declared(DH_meth_get_generate_key_introduced)} + if LibVersion < DH_meth_get_generate_key_introduced then + begin + {$if declared(FC_DH_meth_get_generate_key)} + DH_meth_get_generate_key := @FC_DH_meth_get_generate_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DH_meth_get_generate_key_removed)} + if DH_meth_get_generate_key_removed <= LibVersion then + begin + {$if declared(_DH_meth_get_generate_key)} + DH_meth_get_generate_key := @_DH_meth_get_generate_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DH_meth_get_generate_key_allownil)} + if FuncLoadError then + AFailed.Add('DH_meth_get_generate_key'); + {$ifend} + end; + + {introduced 1.1.0} + DH_meth_set_generate_key := LoadLibFunction(ADllHandle, DH_meth_set_generate_key_procname); + FuncLoadError := not assigned(DH_meth_set_generate_key); + if FuncLoadError then + begin + {$if not defined(DH_meth_set_generate_key_allownil)} + DH_meth_set_generate_key := @ERR_DH_meth_set_generate_key; + {$ifend} + {$if declared(DH_meth_set_generate_key_introduced)} + if LibVersion < DH_meth_set_generate_key_introduced then + begin + {$if declared(FC_DH_meth_set_generate_key)} + DH_meth_set_generate_key := @FC_DH_meth_set_generate_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DH_meth_set_generate_key_removed)} + if DH_meth_set_generate_key_removed <= LibVersion then + begin + {$if declared(_DH_meth_set_generate_key)} + DH_meth_set_generate_key := @_DH_meth_set_generate_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DH_meth_set_generate_key_allownil)} + if FuncLoadError then + AFailed.Add('DH_meth_set_generate_key'); + {$ifend} + end; + + {introduced 1.1.0} + DH_meth_get_compute_key := LoadLibFunction(ADllHandle, DH_meth_get_compute_key_procname); + FuncLoadError := not assigned(DH_meth_get_compute_key); + if FuncLoadError then + begin + {$if not defined(DH_meth_get_compute_key_allownil)} + DH_meth_get_compute_key := @ERR_DH_meth_get_compute_key; + {$ifend} + {$if declared(DH_meth_get_compute_key_introduced)} + if LibVersion < DH_meth_get_compute_key_introduced then + begin + {$if declared(FC_DH_meth_get_compute_key)} + DH_meth_get_compute_key := @FC_DH_meth_get_compute_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DH_meth_get_compute_key_removed)} + if DH_meth_get_compute_key_removed <= LibVersion then + begin + {$if declared(_DH_meth_get_compute_key)} + DH_meth_get_compute_key := @_DH_meth_get_compute_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DH_meth_get_compute_key_allownil)} + if FuncLoadError then + AFailed.Add('DH_meth_get_compute_key'); + {$ifend} + end; + + {introduced 1.1.0} + DH_meth_set_compute_key := LoadLibFunction(ADllHandle, DH_meth_set_compute_key_procname); + FuncLoadError := not assigned(DH_meth_set_compute_key); + if FuncLoadError then + begin + {$if not defined(DH_meth_set_compute_key_allownil)} + DH_meth_set_compute_key := @ERR_DH_meth_set_compute_key; + {$ifend} + {$if declared(DH_meth_set_compute_key_introduced)} + if LibVersion < DH_meth_set_compute_key_introduced then + begin + {$if declared(FC_DH_meth_set_compute_key)} + DH_meth_set_compute_key := @FC_DH_meth_set_compute_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DH_meth_set_compute_key_removed)} + if DH_meth_set_compute_key_removed <= LibVersion then + begin + {$if declared(_DH_meth_set_compute_key)} + DH_meth_set_compute_key := @_DH_meth_set_compute_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DH_meth_set_compute_key_allownil)} + if FuncLoadError then + AFailed.Add('DH_meth_set_compute_key'); + {$ifend} + end; + + {introduced 1.1.0} + DH_meth_get_bn_mod_exp := LoadLibFunction(ADllHandle, DH_meth_get_bn_mod_exp_procname); + FuncLoadError := not assigned(DH_meth_get_bn_mod_exp); + if FuncLoadError then + begin + {$if not defined(DH_meth_get_bn_mod_exp_allownil)} + DH_meth_get_bn_mod_exp := @ERR_DH_meth_get_bn_mod_exp; + {$ifend} + {$if declared(DH_meth_get_bn_mod_exp_introduced)} + if LibVersion < DH_meth_get_bn_mod_exp_introduced then + begin + {$if declared(FC_DH_meth_get_bn_mod_exp)} + DH_meth_get_bn_mod_exp := @FC_DH_meth_get_bn_mod_exp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DH_meth_get_bn_mod_exp_removed)} + if DH_meth_get_bn_mod_exp_removed <= LibVersion then + begin + {$if declared(_DH_meth_get_bn_mod_exp)} + DH_meth_get_bn_mod_exp := @_DH_meth_get_bn_mod_exp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DH_meth_get_bn_mod_exp_allownil)} + if FuncLoadError then + AFailed.Add('DH_meth_get_bn_mod_exp'); + {$ifend} + end; + + {introduced 1.1.0} + DH_meth_set_bn_mod_exp := LoadLibFunction(ADllHandle, DH_meth_set_bn_mod_exp_procname); + FuncLoadError := not assigned(DH_meth_set_bn_mod_exp); + if FuncLoadError then + begin + {$if not defined(DH_meth_set_bn_mod_exp_allownil)} + DH_meth_set_bn_mod_exp := @ERR_DH_meth_set_bn_mod_exp; + {$ifend} + {$if declared(DH_meth_set_bn_mod_exp_introduced)} + if LibVersion < DH_meth_set_bn_mod_exp_introduced then + begin + {$if declared(FC_DH_meth_set_bn_mod_exp)} + DH_meth_set_bn_mod_exp := @FC_DH_meth_set_bn_mod_exp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DH_meth_set_bn_mod_exp_removed)} + if DH_meth_set_bn_mod_exp_removed <= LibVersion then + begin + {$if declared(_DH_meth_set_bn_mod_exp)} + DH_meth_set_bn_mod_exp := @_DH_meth_set_bn_mod_exp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DH_meth_set_bn_mod_exp_allownil)} + if FuncLoadError then + AFailed.Add('DH_meth_set_bn_mod_exp'); + {$ifend} + end; + + {introduced 1.1.0} + DH_meth_get_init := LoadLibFunction(ADllHandle, DH_meth_get_init_procname); + FuncLoadError := not assigned(DH_meth_get_init); + if FuncLoadError then + begin + {$if not defined(DH_meth_get_init_allownil)} + DH_meth_get_init := @ERR_DH_meth_get_init; + {$ifend} + {$if declared(DH_meth_get_init_introduced)} + if LibVersion < DH_meth_get_init_introduced then + begin + {$if declared(FC_DH_meth_get_init)} + DH_meth_get_init := @FC_DH_meth_get_init; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DH_meth_get_init_removed)} + if DH_meth_get_init_removed <= LibVersion then + begin + {$if declared(_DH_meth_get_init)} + DH_meth_get_init := @_DH_meth_get_init; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DH_meth_get_init_allownil)} + if FuncLoadError then + AFailed.Add('DH_meth_get_init'); + {$ifend} + end; + + {introduced 1.1.0} + DH_meth_set_init := LoadLibFunction(ADllHandle, DH_meth_set_init_procname); + FuncLoadError := not assigned(DH_meth_set_init); + if FuncLoadError then + begin + {$if not defined(DH_meth_set_init_allownil)} + DH_meth_set_init := @ERR_DH_meth_set_init; + {$ifend} + {$if declared(DH_meth_set_init_introduced)} + if LibVersion < DH_meth_set_init_introduced then + begin + {$if declared(FC_DH_meth_set_init)} + DH_meth_set_init := @FC_DH_meth_set_init; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DH_meth_set_init_removed)} + if DH_meth_set_init_removed <= LibVersion then + begin + {$if declared(_DH_meth_set_init)} + DH_meth_set_init := @_DH_meth_set_init; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DH_meth_set_init_allownil)} + if FuncLoadError then + AFailed.Add('DH_meth_set_init'); + {$ifend} + end; + + {introduced 1.1.0} + DH_meth_get_finish := LoadLibFunction(ADllHandle, DH_meth_get_finish_procname); + FuncLoadError := not assigned(DH_meth_get_finish); + if FuncLoadError then + begin + {$if not defined(DH_meth_get_finish_allownil)} + DH_meth_get_finish := @ERR_DH_meth_get_finish; + {$ifend} + {$if declared(DH_meth_get_finish_introduced)} + if LibVersion < DH_meth_get_finish_introduced then + begin + {$if declared(FC_DH_meth_get_finish)} + DH_meth_get_finish := @FC_DH_meth_get_finish; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DH_meth_get_finish_removed)} + if DH_meth_get_finish_removed <= LibVersion then + begin + {$if declared(_DH_meth_get_finish)} + DH_meth_get_finish := @_DH_meth_get_finish; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DH_meth_get_finish_allownil)} + if FuncLoadError then + AFailed.Add('DH_meth_get_finish'); + {$ifend} + end; + + {introduced 1.1.0} + DH_meth_set_finish := LoadLibFunction(ADllHandle, DH_meth_set_finish_procname); + FuncLoadError := not assigned(DH_meth_set_finish); + if FuncLoadError then + begin + {$if not defined(DH_meth_set_finish_allownil)} + DH_meth_set_finish := @ERR_DH_meth_set_finish; + {$ifend} + {$if declared(DH_meth_set_finish_introduced)} + if LibVersion < DH_meth_set_finish_introduced then + begin + {$if declared(FC_DH_meth_set_finish)} + DH_meth_set_finish := @FC_DH_meth_set_finish; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DH_meth_set_finish_removed)} + if DH_meth_set_finish_removed <= LibVersion then + begin + {$if declared(_DH_meth_set_finish)} + DH_meth_set_finish := @_DH_meth_set_finish; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DH_meth_set_finish_allownil)} + if FuncLoadError then + AFailed.Add('DH_meth_set_finish'); + {$ifend} + end; + + {introduced 1.1.0} + DH_meth_get_generate_params := LoadLibFunction(ADllHandle, DH_meth_get_generate_params_procname); + FuncLoadError := not assigned(DH_meth_get_generate_params); + if FuncLoadError then + begin + {$if not defined(DH_meth_get_generate_params_allownil)} + DH_meth_get_generate_params := @ERR_DH_meth_get_generate_params; + {$ifend} + {$if declared(DH_meth_get_generate_params_introduced)} + if LibVersion < DH_meth_get_generate_params_introduced then + begin + {$if declared(FC_DH_meth_get_generate_params)} + DH_meth_get_generate_params := @FC_DH_meth_get_generate_params; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DH_meth_get_generate_params_removed)} + if DH_meth_get_generate_params_removed <= LibVersion then + begin + {$if declared(_DH_meth_get_generate_params)} + DH_meth_get_generate_params := @_DH_meth_get_generate_params; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DH_meth_get_generate_params_allownil)} + if FuncLoadError then + AFailed.Add('DH_meth_get_generate_params'); + {$ifend} + end; + + {introduced 1.1.0} + DH_meth_set_generate_params := LoadLibFunction(ADllHandle, DH_meth_set_generate_params_procname); + FuncLoadError := not assigned(DH_meth_set_generate_params); + if FuncLoadError then + begin + {$if not defined(DH_meth_set_generate_params_allownil)} + DH_meth_set_generate_params := @ERR_DH_meth_set_generate_params; + {$ifend} + {$if declared(DH_meth_set_generate_params_introduced)} + if LibVersion < DH_meth_set_generate_params_introduced then + begin + {$if declared(FC_DH_meth_set_generate_params)} + DH_meth_set_generate_params := @FC_DH_meth_set_generate_params; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DH_meth_set_generate_params_removed)} + if DH_meth_set_generate_params_removed <= LibVersion then + begin + {$if declared(_DH_meth_set_generate_params)} + DH_meth_set_generate_params := @_DH_meth_set_generate_params; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DH_meth_set_generate_params_allownil)} + if FuncLoadError then + AFailed.Add('DH_meth_set_generate_params'); + {$ifend} + end; + + {introduced 1.1.0} +end; + +procedure Unload; +begin + DHparams_dup := nil; + DH_OpenSSL := nil; + DH_set_default_method := nil; + DH_get_default_method := nil; + DH_set_method := nil; + DH_new_method := nil; + DH_new := nil; + DH_free := nil; + DH_up_ref := nil; + DH_bits := nil; {introduced 1.1.0} + DH_size := nil; + DH_security_bits := nil; {introduced 1.1.0} + DH_set_ex_data := nil; + DH_get_ex_data := nil; + DH_generate_parameters_ex := nil; + DH_check_params_ex := nil; {introduced 1.1.0} + DH_check_ex := nil; {introduced 1.1.0} + DH_check_pub_key_ex := nil; {introduced 1.1.0} + DH_check_params := nil; {introduced 1.1.0} + DH_check := nil; + DH_check_pub_key := nil; + DH_generate_key := nil; + DH_compute_key := nil; + DH_compute_key_padded := nil; + d2i_DHparams := nil; + i2d_DHparams := nil; + d2i_DHxparams := nil; + i2d_DHxparams := nil; + DHparams_print := nil; + DH_get_1024_160 := nil; + DH_get_2048_224 := nil; + DH_get_2048_256 := nil; + DH_new_by_nid := nil; {introduced 1.1.0} + DH_get_nid := nil; {introduced 1.1.0} + DH_KDF_X9_42 := nil; + DH_get0_pqg := nil; {introduced 1.1.0} + DH_set0_pqg := nil; {introduced 1.1.0} + DH_get0_key := nil; {introduced 1.1.0} + DH_set0_key := nil; {introduced 1.1.0} + DH_get0_p := nil; {introduced 1.1.0} + DH_get0_q := nil; {introduced 1.1.0} + DH_get0_g := nil; {introduced 1.1.0} + DH_get0_priv_key := nil; {introduced 1.1.0} + DH_get0_pub_key := nil; {introduced 1.1.0} + DH_clear_flags := nil; {introduced 1.1.0} + DH_test_flags := nil; {introduced 1.1.0} + DH_set_flags := nil; {introduced 1.1.0} + DH_get0_engine := nil; {introduced 1.1.0} + DH_get_length := nil; {introduced 1.1.0} + DH_set_length := nil; {introduced 1.1.0} + DH_meth_new := nil; {introduced 1.1.0} + DH_meth_free := nil; {introduced 1.1.0} + DH_meth_dup := nil; {introduced 1.1.0} + DH_meth_get0_name := nil; {introduced 1.1.0} + DH_meth_set1_name := nil; {introduced 1.1.0} + DH_meth_get_flags := nil; {introduced 1.1.0} + DH_meth_set_flags := nil; {introduced 1.1.0} + DH_meth_get0_app_data := nil; {introduced 1.1.0} + DH_meth_set0_app_data := nil; {introduced 1.1.0} + DH_meth_get_generate_key := nil; {introduced 1.1.0} + DH_meth_set_generate_key := nil; {introduced 1.1.0} + DH_meth_get_compute_key := nil; {introduced 1.1.0} + DH_meth_set_compute_key := nil; {introduced 1.1.0} + DH_meth_get_bn_mod_exp := nil; {introduced 1.1.0} + DH_meth_set_bn_mod_exp := nil; {introduced 1.1.0} + DH_meth_get_init := nil; {introduced 1.1.0} + DH_meth_set_init := nil; {introduced 1.1.0} + DH_meth_get_finish := nil; {introduced 1.1.0} + DH_meth_set_finish := nil; {introduced 1.1.0} + DH_meth_get_generate_params := nil; {introduced 1.1.0} + DH_meth_set_generate_params := nil; {introduced 1.1.0} +end; +{$ELSE} +{$ENDIF} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +initialization + Register_SSLLoader(@Load,'LibCrypto'); + Register_SSLUnloader(@Unload); +{$ENDIF} +end. diff --git a/IdOpenSSLHeaders_dherr.pas b/IdOpenSSLHeaders_dherr.pas new file mode 100644 index 0000000..fada5b3 --- /dev/null +++ b/IdOpenSSLHeaders_dherr.pas @@ -0,0 +1,196 @@ + (* This unit was generated using the script genOpenSSLHdrs.sh from the source file IdOpenSSLHeaders_dherr.h2pas + It should not be modified directly. All changes should be made to IdOpenSSLHeaders_dherr.h2pas + and this file regenerated. IdOpenSSLHeaders_dherr.h2pas is distributed with the full Indy + Distribution. + *) + +{$i IdCompilerDefines.inc} +{$i IdSSLOpenSSLDefines.inc} +{$IFNDEF USE_OPENSSL} + { error Should not compile if USE_OPENSSL is not defined!!!} +{$ENDIF} +{******************************************************************************} +{ } +{ Indy (Internet Direct) - Internet Protocols Simplified } +{ } +{ https://www.indyproject.org/ } +{ https://gitter.im/IndySockets/Indy } +{ } +{******************************************************************************} +{ } +{ This file is part of the Indy (Internet Direct) project, and is offered } +{ under the dual-licensing agreement described on the Indy website. } +{ (https://www.indyproject.org/license/) } +{ } +{ Copyright: } +{ (c) 1993-2020, Chad Z. Hower and the Indy Pit Crew. All rights reserved. } +{ } +{******************************************************************************} +{ } +{ } +{******************************************************************************} + +unit IdOpenSSLHeaders_dherr; + +interface + +// Headers for OpenSSL 1.1.1 +// dherr.h + + +uses + IdCTypes, + IdGlobal, + IdSSLOpenSSLConsts; + +const + // DH function codes + DH_F_COMPUTE_KEY = 102; + DH_F_DHPARAMS_PRINT_FP = 101; + DH_F_DH_BUILTIN_GENPARAMS = 106; + DH_F_DH_CHECK_EX = 121; + DH_F_DH_CHECK_PARAMS_EX = 122; + DH_F_DH_CHECK_PUB_KEY_EX = 123; + DH_F_DH_CMS_DECRYPT = 114; + DH_F_DH_CMS_SET_PEERKEY = 115; + DH_F_DH_CMS_SET_SHARED_INFO = 116; + DH_F_DH_METH_DUP = 117; + DH_F_DH_METH_NEW = 118; + DH_F_DH_METH_SET1_NAME = 119; + DH_F_DH_NEW_BY_NID = 104; + DH_F_DH_NEW_METHOD = 105; + DH_F_DH_PARAM_DECODE = 107; + DH_F_DH_PKEY_PUBLIC_CHECK = 124; + DH_F_DH_PRIV_DECODE = 110; + DH_F_DH_PRIV_ENCODE = 111; + DH_F_DH_PUB_DECODE = 108; + DH_F_DH_PUB_ENCODE = 109; + DH_F_DO_DH_PRINT = 100; + DH_F_GENERATE_KEY = 103; + DH_F_PKEY_DH_CTRL_STR = 120; + DH_F_PKEY_DH_DERIVE = 112; + DH_F_PKEY_DH_INIT = 125; + DH_F_PKEY_DH_KEYGEN = 113; + + // DH reason codes + DH_R_BAD_GENERATOR = 101; + DH_R_BN_DECODE_ERROR = 109; + DH_R_BN_ERROR = 106; + DH_R_CHECK_INVALID_J_VALUE = 115; + DH_R_CHECK_INVALID_Q_VALUE = 116; + DH_R_CHECK_PUBKEY_INVALID = 122; + DH_R_CHECK_PUBKEY_TOO_LARGE = 123; + DH_R_CHECK_PUBKEY_TOO_SMALL = 124; + DH_R_CHECK_P_NOT_PRIME = 117; + DH_R_CHECK_P_NOT_SAFE_PRIME = 118; + DH_R_CHECK_Q_NOT_PRIME = 119; + DH_R_DECODE_ERROR = 104; + DH_R_INVALID_PARAMETER_NAME = 110; + DH_R_INVALID_PARAMETER_NID = 114; + DH_R_INVALID_PUBKEY = 102; + DH_R_KDF_PARAMETER_ERROR = 112; + DH_R_KEYS_NOT_SET = 108; + DH_R_MISSING_PUBKEY = 125; + DH_R_MODULUS_TOO_LARGE = 103; + DH_R_NOT_SUITABLE_GENERATOR = 120; + DH_R_NO_PARAMETERS_SET = 107; + DH_R_NO_PRIVATE_VALUE = 100; + DH_R_PARAMETER_ENCODING_ERROR = 105; + DH_R_PEER_KEY_ERROR = 111; + DH_R_SHARED_INFO_ERROR = 113; + DH_R_UNABLE_TO_CHECK_GENERATOR = 121; + + { The EXTERNALSYM directive is ignored by FPC, however, it is used by Delphi as follows: + + The EXTERNALSYM directive prevents the specified Delphi symbol from appearing in header + files generated for C++. } + + {$EXTERNALSYM ERR_load_DH_strings} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +var + ERR_load_DH_strings: function : TIdC_INT; cdecl = nil; + +{$ELSE} + function ERR_load_DH_strings: TIdC_INT cdecl; external CLibCrypto; + +{$ENDIF} + +implementation + + uses + classes, + IdSSLOpenSSLExceptionHandlers, + IdResourceStringsOpenSSL + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + ,IdSSLOpenSSLLoader + {$ENDIF}; + + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +const + ERR_load_DH_strings_procname = 'ERR_load_DH_strings'; + + +{$WARN NO_RETVAL OFF} +function ERR_ERR_load_DH_strings: TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ERR_load_DH_strings_procname); +end; + + + +{$WARN NO_RETVAL ON} + +procedure Load(const ADllHandle: TIdLibHandle; LibVersion: TIdC_UINT; const AFailed: TStringList); + +var FuncLoadError: boolean; + +begin + ERR_load_DH_strings := LoadLibFunction(ADllHandle, ERR_load_DH_strings_procname); + FuncLoadError := not assigned(ERR_load_DH_strings); + if FuncLoadError then + begin + {$if not defined(ERR_load_DH_strings_allownil)} + ERR_load_DH_strings := @ERR_ERR_load_DH_strings; + {$ifend} + {$if declared(ERR_load_DH_strings_introduced)} + if LibVersion < ERR_load_DH_strings_introduced then + begin + {$if declared(FC_ERR_load_DH_strings)} + ERR_load_DH_strings := @FC_ERR_load_DH_strings; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ERR_load_DH_strings_removed)} + if ERR_load_DH_strings_removed <= LibVersion then + begin + {$if declared(_ERR_load_DH_strings)} + ERR_load_DH_strings := @_ERR_load_DH_strings; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ERR_load_DH_strings_allownil)} + if FuncLoadError then + AFailed.Add('ERR_load_DH_strings'); + {$ifend} + end; + + +end; + +procedure Unload; +begin + ERR_load_DH_strings := nil; +end; +{$ELSE} +{$ENDIF} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +initialization + Register_SSLLoader(@Load,'LibCrypto'); + Register_SSLUnloader(@Unload); +{$ENDIF} +end. diff --git a/IdOpenSSLHeaders_dsa.pas b/IdOpenSSLHeaders_dsa.pas new file mode 100644 index 0000000..e04f8ef --- /dev/null +++ b/IdOpenSSLHeaders_dsa.pas @@ -0,0 +1,3537 @@ + (* This unit was generated using the script genOpenSSLHdrs.sh from the source file IdOpenSSLHeaders_dsa.h2pas + It should not be modified directly. All changes should be made to IdOpenSSLHeaders_dsa.h2pas + and this file regenerated. IdOpenSSLHeaders_dsa.h2pas is distributed with the full Indy + Distribution. + *) + +{$i IdCompilerDefines.inc} +{$i IdSSLOpenSSLDefines.inc} +{$IFNDEF USE_OPENSSL} + { error Should not compile if USE_OPENSSL is not defined!!!} +{$ENDIF} +{******************************************************************************} +{ } +{ Indy (Internet Direct) - Internet Protocols Simplified } +{ } +{ https://www.indyproject.org/ } +{ https://gitter.im/IndySockets/Indy } +{ } +{******************************************************************************} +{ } +{ This file is part of the Indy (Internet Direct) project, and is offered } +{ under the dual-licensing agreement described on the Indy website. } +{ (https://www.indyproject.org/license/) } +{ } +{ Copyright: } +{ (c) 1993-2020, Chad Z. Hower and the Indy Pit Crew. All rights reserved. } +{ } +{******************************************************************************} +{ } +{ } +{******************************************************************************} + +unit IdOpenSSLHeaders_dsa; + +interface + +// Headers for OpenSSL 1.1.1 +// dsa.h + + +uses + IdCTypes, + IdGlobal, + IdSSLOpenSSLConsts, + IdOpenSSLHeaders_ossl_typ, + IdOpenSSLHeaders_evp; + +const + OPENSSL_DSA_MAX_MODULUS_BITS = 10000; + OPENSSL_DSA_FIPS_MIN_MODULUS_BITS = 1024; + DSA_FLAG_CACHE_MONT_P = $01; + DSA_FLAG_NO_EXP_CONSTTIME = $00; + DSA_FLAG_FIPS_METHOD = $0400; + DSA_FLAG_NON_FIPS_ALLOW = $0400; + DSA_FLAG_FIPS_CHECKED = $0800; + + DSS_prime_checks = 64; + + EVP_PKEY_CTRL_DSA_PARAMGEN_BITS = EVP_PKEY_ALG_CTRL + 1; + EVP_PKEY_CTRL_DSA_PARAMGEN_Q_BITS = EVP_PKEY_ALG_CTRL + 2; + EVP_PKEY_CTRL_DSA_PARAMGEN_MD = EVP_PKEY_ALG_CTRL + 3; + +type + DSA_SIG = type Pointer; // DSA_SIG_st + PDSA_SIG = ^DSA_SIG; + PPDSA_SIG = ^PDSA_SIG; + + DSA_meth_sign_cb = function (const v1: PByte; v2: TIdC_INT; v3: PDSA): PDSA_SIG cdecl; + DSA_meth_sign_setup_cb = function (v1: PDSA; v2: PBN_CTX; + v3: PPBIGNUM; v4: PPBIGNUM): TIdC_INT cdecl; + DSA_meth_verify_cb = function (const v1: PByte; v2: TIdC_INT; + v3: PDSA_SIG; v4: PDSA): TIdC_INT cdecl; + DSA_meth_mod_exp_cb = function (v1: PDSA; v2: PBIGNUM; + const v3: PBIGNUM; const v4: PBIGNUM; const v5: PBIGNUM; const v6: PBIGNUM; + const v7: PBIGNUM; v8: PBN_CTX; v9: PBN_MONT_CTX): TIdC_INT cdecl; + DSA_meth_bn_mod_exp_cb = function (v1: PDSA; v2: PBIGNUM; + const v3: PBIGNUM; const v4: PBIGNUM; const v5: PBIGNUM; v6: PBN_CTX; v7: PBN_MONT_CTX): TIdC_INT cdecl; + DSA_meth_init_cb = function(v1: PDSA): TIdC_INT cdecl; + DSA_meth_finish_cb = function (v1: PDSA): TIdC_INT cdecl; + DSA_meth_paramgen_cb = function (v1: PDSA; v2: TIdC_INT; + const v3: PByte; v4: TIdC_INT; v5: PIdC_INT; v6: PIdC_ULONG; v7: PBN_GENCB): TIdC_INT cdecl; + DSA_meth_keygen_cb = function (v1: PDSA): TIdC_INT cdecl; + +//# define d2i_DSAparams_fp(fp,x) (DSA *)ASN1_d2i_fp((char *(*)())DSA_new, \ +// (char *(*)())d2i_DSAparams,(fp),(unsigned char **)(x)) +//# define i2d_DSAparams_fp(fp,x) ASN1_i2d_fp(i2d_DSAparams,(fp), \ +// (unsigned char *)(x)) +//# define d2i_DSAparams_bio(bp,x) ASN1_d2i_bio_of(DSA,DSA_new,d2i_DSAparams,bp,x) +//# define i2d_DSAparams_bio(bp,x) ASN1_i2d_bio_of_const(DSA,i2d_DSAparams,bp,x) + + { The EXTERNALSYM directive is ignored by FPC, however, it is used by Delphi as follows: + + The EXTERNALSYM directive prevents the specified Delphi symbol from appearing in header + files generated for C++. } + + {$EXTERNALSYM DSAparams_dup} + {$EXTERNALSYM DSA_SIG_new} + {$EXTERNALSYM DSA_SIG_free} + {$EXTERNALSYM i2d_DSA_SIG} + {$EXTERNALSYM d2i_DSA_SIG} + {$EXTERNALSYM DSA_SIG_get0} + {$EXTERNALSYM DSA_SIG_set0} + {$EXTERNALSYM DSA_do_sign} + {$EXTERNALSYM DSA_do_verify} + {$EXTERNALSYM DSA_OpenSSL} + {$EXTERNALSYM DSA_set_default_method} + {$EXTERNALSYM DSA_get_default_method} + {$EXTERNALSYM DSA_set_method} + {$EXTERNALSYM DSA_get_method} + {$EXTERNALSYM DSA_new} + {$EXTERNALSYM DSA_new_method} + {$EXTERNALSYM DSA_free} + {$EXTERNALSYM DSA_up_ref} + {$EXTERNALSYM DSA_size} + {$EXTERNALSYM DSA_bits} + {$EXTERNALSYM DSA_security_bits} + {$EXTERNALSYM DSA_sign} + {$EXTERNALSYM DSA_verify} + {$EXTERNALSYM DSA_set_ex_data} + {$EXTERNALSYM DSA_get_ex_data} + {$EXTERNALSYM d2i_DSAPublicKey} + {$EXTERNALSYM d2i_DSAPrivateKey} + {$EXTERNALSYM d2i_DSAparams} + {$EXTERNALSYM DSA_generate_parameters_ex} + {$EXTERNALSYM DSA_generate_key} + {$EXTERNALSYM i2d_DSAPublicKey} + {$EXTERNALSYM i2d_DSAPrivateKey} + {$EXTERNALSYM i2d_DSAparams} + {$EXTERNALSYM DSAparams_print} + {$EXTERNALSYM DSA_print} + {$EXTERNALSYM DSA_dup_DH} + {$EXTERNALSYM DSA_get0_pqg} + {$EXTERNALSYM DSA_set0_pqg} + {$EXTERNALSYM DSA_get0_key} + {$EXTERNALSYM DSA_set0_key} + {$EXTERNALSYM DSA_get0_p} + {$EXTERNALSYM DSA_get0_q} + {$EXTERNALSYM DSA_get0_g} + {$EXTERNALSYM DSA_get0_pub_key} + {$EXTERNALSYM DSA_get0_priv_key} + {$EXTERNALSYM DSA_clear_flags} + {$EXTERNALSYM DSA_test_flags} + {$EXTERNALSYM DSA_set_flags} + {$EXTERNALSYM DSA_get0_engine} + {$EXTERNALSYM DSA_meth_new} + {$EXTERNALSYM DSA_meth_free} + {$EXTERNALSYM DSA_meth_dup} + {$EXTERNALSYM DSA_meth_get0_name} + {$EXTERNALSYM DSA_meth_set1_name} + {$EXTERNALSYM DSA_meth_get_flags} + {$EXTERNALSYM DSA_meth_set_flags} + {$EXTERNALSYM DSA_meth_get0_app_data} + {$EXTERNALSYM DSA_meth_set0_app_data} + {$EXTERNALSYM DSA_meth_get_sign} + {$EXTERNALSYM DSA_meth_set_sign} + {$EXTERNALSYM DSA_meth_get_sign_setup} + {$EXTERNALSYM DSA_meth_set_sign_setup} + {$EXTERNALSYM DSA_meth_get_verify} + {$EXTERNALSYM DSA_meth_set_verify} + {$EXTERNALSYM DSA_meth_get_mod_exp} + {$EXTERNALSYM DSA_meth_set_mod_exp} + {$EXTERNALSYM DSA_meth_get_bn_mod_exp} + {$EXTERNALSYM DSA_meth_set_bn_mod_exp} + {$EXTERNALSYM DSA_meth_get_init} + {$EXTERNALSYM DSA_meth_set_init} + {$EXTERNALSYM DSA_meth_get_finish} + {$EXTERNALSYM DSA_meth_set_finish} + {$EXTERNALSYM DSA_meth_get_paramgen} + {$EXTERNALSYM DSA_meth_set_paramgen} + {$EXTERNALSYM DSA_meth_get_keygen} + {$EXTERNALSYM DSA_meth_set_keygen} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +var + DSAparams_dup: function (x: PDSA): PDSA; cdecl = nil; + DSA_SIG_new: function : PDSA_SIG; cdecl = nil; + DSA_SIG_free: procedure (a: PDSA_SIG); cdecl = nil; + i2d_DSA_SIG: function (const a: PDSA_SIG; pp: PPByte): TIdC_INT; cdecl = nil; + d2i_DSA_SIG: function (v: PPDSA_SIG; const pp: PPByte; length: TIdC_LONG): PDSA_SIG; cdecl = nil; + DSA_SIG_get0: procedure (const sig: PDSA_SIG; const pr: PPBIGNUM; const ps: PPBIGNUM); cdecl = nil; + DSA_SIG_set0: function (sig: PDSA_SIG; r: PBIGNUM; s: PBIGNUM): TIdC_INT; cdecl = nil; + + DSA_do_sign: function (const dgst: PByte; dlen: TIdC_INT; dsa: PDSA): PDSA_SIG; cdecl = nil; + DSA_do_verify: function (const dgst: PByte; dgst_len: TIdC_INT; sig: PDSA_SIG; dsa: PDSA): TIdC_INT; cdecl = nil; + + DSA_OpenSSL: function : PDSA_METHOD; cdecl = nil; + DSA_set_default_method: procedure (const v1: PDSA_METHOD); cdecl = nil; + DSA_get_default_method: function : PDSA_METHOD; cdecl = nil; + DSA_set_method: function (dsa: PDSA; const v1: PDSA_METHOD): TIdC_INT; cdecl = nil; + DSA_get_method: function (d: PDSA): PDSA_METHOD; cdecl = nil; + + DSA_new: function : PDSA; cdecl = nil; + DSA_new_method: function (engine: PENGINE): PDSA; cdecl = nil; + DSA_free: procedure (r: PDSA); cdecl = nil; + (* "up" the DSA object's reference count *) + DSA_up_ref: function (r: PDSA): TIdC_INT; cdecl = nil; + DSA_size: function (const v1: PDSA): TIdC_INT; cdecl = nil; + DSA_bits: function (const d: PDSA): TIdC_INT; cdecl = nil; + DSA_security_bits: function (const d: PDSA): TIdC_INT; cdecl = nil; + DSA_sign: function (type_: TIdC_INT; const dgst: PByte; dlen: TIdC_INT; sig: PByte; siglen: PIdC_UINT; dsa: PDSA): TIdC_INT; cdecl = nil; + DSA_verify: function (type_: TIdC_INT; const dgst: PByte; dgst_len: TIdC_INT; const sigbuf: PByte; siglen: TIdC_INT; dsa: PDSA): TIdC_INT; cdecl = nil; + //#define DSA_get_ex_new_index(l, p, newf, dupf, freef) \ + // CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_DSA, l, p, newf, dupf, freef) + DSA_set_ex_data: function (d: PDSA; idx: TIdC_INT; arg: Pointer): TIdC_INT; cdecl = nil; + DSA_get_ex_data: function (d: PDSA; idx: TIdC_INT): Pointer; cdecl = nil; + + d2i_DSAPublicKey: function (a: PPDSA; const pp: PPByte; length: TIdC_LONG): PDSA; cdecl = nil; + d2i_DSAPrivateKey: function (a: PPDSA; const pp: PPByte; length: TIdC_LONG): PDSA; cdecl = nil; + d2i_DSAparams: function (a: PPDSA; const pp: PPByte; length: TIdC_LONG): PDSA; cdecl = nil; + + DSA_generate_parameters_ex: function (dsa: PDSA; bits: TIdC_INT; const seed: PByte; seed_len: TIdC_INT; counter_ret: PIdC_INT; h_ret: PIdC_ULONG; cb: PBN_GENCB): TIdC_INT; cdecl = nil; + + DSA_generate_key: function (a: PDSA): TIdC_INT; cdecl = nil; + i2d_DSAPublicKey: function (const a: PDSA; pp: PPByte): TIdC_INT; cdecl = nil; + i2d_DSAPrivateKey: function (const a: PDSA; pp: PPByte): TIdC_INT; cdecl = nil; + i2d_DSAparams: function (const a: PDSA; pp: PPByte): TIdC_INT; cdecl = nil; + + DSAparams_print: function (bp: PBIO; const x: PDSA): TIdC_INT; cdecl = nil; + DSA_print: function (bp: PBIO; const x: PDSA; off: TIdC_INT): TIdC_INT; cdecl = nil; +// function DSAparams_print_fp(fp: PFile; const x: PDSA): TIdC_INT; +// function DSA_print_fp(bp: PFile; const x: PDSA; off: TIdC_INT): TIdC_INT; + + //# define DSA_is_prime(n, callback, cb_arg) \ + // BN_is_prime(n, DSS_prime_checks, callback, NULL, cb_arg) + + (* + * Convert DSA structure (key or just parameters) into DH structure (be + * careful to avoid small subgroup attacks when using this!) + *) + DSA_dup_DH: function (const r: PDSA): PDH; cdecl = nil; + + //# define EVP_PKEY_CTX_set_dsa_paramgen_bits(ctx, nbits) \ + // EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DSA, EVP_PKEY_OP_PARAMGEN, \ + // EVP_PKEY_CTRL_DSA_PARAMGEN_BITS, nbits, NULL) + //# define EVP_PKEY_CTX_set_dsa_paramgen_q_bits(ctx, qbits) \ + // EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DSA, EVP_PKEY_OP_PARAMGEN, \ + // EVP_PKEY_CTRL_DSA_PARAMGEN_Q_BITS, qbits, NULL) + //# define EVP_PKEY_CTX_set_dsa_paramgen_md(ctx, md) \ + // EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DSA, EVP_PKEY_OP_PARAMGEN, \ + // EVP_PKEY_CTRL_DSA_PARAMGEN_MD, 0, (void *)(md)) + + DSA_get0_pqg: procedure (const d: PDSA; const p: PPBIGNUM; const q: PPBIGNUM; const g: PPBIGNUM); cdecl = nil; + DSA_set0_pqg: function (d: PDSA; p: PBIGNUM; q: PBIGNUM; g: PBIGNUM): TIdC_INT; cdecl = nil; + DSA_get0_key: procedure (const d: PDSA; const pub_key: PPBIGNUM; const priv_key: PPBIGNUM); cdecl = nil; + DSA_set0_key: function (d: PDSA; pub_key: PBIGNUM; priv_key: PBIGNUM): TIdC_INT; cdecl = nil; + DSA_get0_p: function (const d: PDSA): PBIGNUM; cdecl = nil; + DSA_get0_q: function (const d: PDSA): PBIGNUM; cdecl = nil; + DSA_get0_g: function (const d: PDSA): PBIGNUM; cdecl = nil; + DSA_get0_pub_key: function (const d: PDSA): PBIGNUM; cdecl = nil; + DSA_get0_priv_key: function (const d: PDSA): PBIGNUM; cdecl = nil; + DSA_clear_flags: procedure (d: PDSA; flags: TIdC_INT); cdecl = nil; + DSA_test_flags: function (const d: PDSA; flags: TIdC_INT): TIdC_INT; cdecl = nil; + DSA_set_flags: procedure (d: PDSA; flags: TIdC_INT); cdecl = nil; + DSA_get0_engine: function (d: PDSA): PENGINE; cdecl = nil; + + DSA_meth_new: function (const name: PIdAnsiChar; flags: TIdC_INT): PDSA_METHOD; cdecl = nil; + DSA_meth_free: procedure (dsam: PDSA_METHOD); cdecl = nil; + DSA_meth_dup: function (const dsam: PDSA_METHOD): PDSA_METHOD; cdecl = nil; + DSA_meth_get0_name: function (const dsam: PDSA_METHOD): PIdAnsiChar; cdecl = nil; + DSA_meth_set1_name: function (dsam: PDSA_METHOD; const name: PIdAnsiChar): TIdC_INT; cdecl = nil; + DSA_meth_get_flags: function (const dsam: PDSA_METHOD): TIdC_INT; cdecl = nil; + DSA_meth_set_flags: function (dsam: PDSA_METHOD; flags: TIdC_INT): TIdC_INT; cdecl = nil; + DSA_meth_get0_app_data: function (const dsam: PDSA_METHOD): Pointer; cdecl = nil; + DSA_meth_set0_app_data: function (dsam: PDSA_METHOD; app_data: Pointer): TIdC_INT; cdecl = nil; + DSA_meth_get_sign: function (const dsam: PDSA_METHOD): DSA_meth_sign_cb; cdecl = nil; + DSA_meth_set_sign: function (dsam: PDSA_METHOD; sign: DSA_meth_sign_cb): TIdC_INT; cdecl = nil; + DSA_meth_get_sign_setup: function (const dsam: PDSA_METHOD): DSA_meth_sign_setup_cb; cdecl = nil; + DSA_meth_set_sign_setup: function (dsam: PDSA_METHOD; sign_setup: DSA_meth_sign_setup_cb): TIdC_INT; cdecl = nil; + DSA_meth_get_verify: function (const dsam: PDSA_METHOD): DSA_meth_verify_cb; cdecl = nil; + DSA_meth_set_verify: function (dsam: PDSA_METHOD; verify: DSA_meth_verify_cb): TIdC_INT; cdecl = nil; + DSA_meth_get_mod_exp: function (const dsam: PDSA_METHOD): DSA_meth_mod_exp_cb; cdecl = nil; + DSA_meth_set_mod_exp: function (dsam: PDSA_METHOD; mod_exp: DSA_meth_mod_exp_cb): TIdC_INT; cdecl = nil; + DSA_meth_get_bn_mod_exp: function (const dsam: PDSA_METHOD): DSA_meth_bn_mod_exp_cb; cdecl = nil; + DSA_meth_set_bn_mod_exp: function (dsam: PDSA_METHOD; bn_mod_exp: DSA_meth_bn_mod_exp_cb): TIdC_INT; cdecl = nil; + DSA_meth_get_init: function (const dsam: PDSA_METHOD): DSA_meth_init_cb; cdecl = nil; + DSA_meth_set_init: function (dsam: PDSA_METHOD; init: DSA_meth_init_cb): TIdC_INT; cdecl = nil; + DSA_meth_get_finish: function (const dsam: PDSA_METHOD): DSA_meth_finish_cb; cdecl = nil; + DSA_meth_set_finish: function (dsam: PDSA_METHOD; finish: DSA_meth_finish_cb): TIdC_INT; cdecl = nil; + DSA_meth_get_paramgen: function (const dsam: PDSA_METHOD): DSA_meth_paramgen_cb; cdecl = nil; + DSA_meth_set_paramgen: function (dsam: PDSA_METHOD; paramgen: DSA_meth_paramgen_cb): TIdC_INT; cdecl = nil; + DSA_meth_get_keygen: function (const dsam: PDSA_METHOD): DSA_meth_keygen_cb; cdecl = nil; + DSA_meth_set_keygen: function (dsam: PDSA_METHOD; keygen: DSA_meth_keygen_cb): TIdC_INT; cdecl = nil; + +{$ELSE} + function DSAparams_dup(x: PDSA): PDSA cdecl; external CLibCrypto; + function DSA_SIG_new: PDSA_SIG cdecl; external CLibCrypto; + procedure DSA_SIG_free(a: PDSA_SIG) cdecl; external CLibCrypto; + function i2d_DSA_SIG(const a: PDSA_SIG; pp: PPByte): TIdC_INT cdecl; external CLibCrypto; + function d2i_DSA_SIG(v: PPDSA_SIG; const pp: PPByte; length: TIdC_LONG): PDSA_SIG cdecl; external CLibCrypto; + procedure DSA_SIG_get0(const sig: PDSA_SIG; const pr: PPBIGNUM; const ps: PPBIGNUM) cdecl; external CLibCrypto; + function DSA_SIG_set0(sig: PDSA_SIG; r: PBIGNUM; s: PBIGNUM): TIdC_INT cdecl; external CLibCrypto; + + function DSA_do_sign(const dgst: PByte; dlen: TIdC_INT; dsa: PDSA): PDSA_SIG cdecl; external CLibCrypto; + function DSA_do_verify(const dgst: PByte; dgst_len: TIdC_INT; sig: PDSA_SIG; dsa: PDSA): TIdC_INT cdecl; external CLibCrypto; + + function DSA_OpenSSL: PDSA_METHOD cdecl; external CLibCrypto; + procedure DSA_set_default_method(const v1: PDSA_METHOD) cdecl; external CLibCrypto; + function DSA_get_default_method: PDSA_METHOD cdecl; external CLibCrypto; + function DSA_set_method(dsa: PDSA; const v1: PDSA_METHOD): TIdC_INT cdecl; external CLibCrypto; + function DSA_get_method(d: PDSA): PDSA_METHOD cdecl; external CLibCrypto; + + function DSA_new: PDSA cdecl; external CLibCrypto; + function DSA_new_method(engine: PENGINE): PDSA cdecl; external CLibCrypto; + procedure DSA_free(r: PDSA) cdecl; external CLibCrypto; + (* "up" the DSA object's reference count *) + function DSA_up_ref(r: PDSA): TIdC_INT cdecl; external CLibCrypto; + function DSA_size(const v1: PDSA): TIdC_INT cdecl; external CLibCrypto; + function DSA_bits(const d: PDSA): TIdC_INT cdecl; external CLibCrypto; + function DSA_security_bits(const d: PDSA): TIdC_INT cdecl; external CLibCrypto; + function DSA_sign(type_: TIdC_INT; const dgst: PByte; dlen: TIdC_INT; sig: PByte; siglen: PIdC_UINT; dsa: PDSA): TIdC_INT cdecl; external CLibCrypto; + function DSA_verify(type_: TIdC_INT; const dgst: PByte; dgst_len: TIdC_INT; const sigbuf: PByte; siglen: TIdC_INT; dsa: PDSA): TIdC_INT cdecl; external CLibCrypto; + //#define DSA_get_ex_new_index(l, p, newf, dupf, freef) \ + // CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_DSA, l, p, newf, dupf, freef) + function DSA_set_ex_data(d: PDSA; idx: TIdC_INT; arg: Pointer): TIdC_INT cdecl; external CLibCrypto; + function DSA_get_ex_data(d: PDSA; idx: TIdC_INT): Pointer cdecl; external CLibCrypto; + + function d2i_DSAPublicKey(a: PPDSA; const pp: PPByte; length: TIdC_LONG): PDSA cdecl; external CLibCrypto; + function d2i_DSAPrivateKey(a: PPDSA; const pp: PPByte; length: TIdC_LONG): PDSA cdecl; external CLibCrypto; + function d2i_DSAparams(a: PPDSA; const pp: PPByte; length: TIdC_LONG): PDSA cdecl; external CLibCrypto; + + function DSA_generate_parameters_ex(dsa: PDSA; bits: TIdC_INT; const seed: PByte; seed_len: TIdC_INT; counter_ret: PIdC_INT; h_ret: PIdC_ULONG; cb: PBN_GENCB): TIdC_INT cdecl; external CLibCrypto; + + function DSA_generate_key(a: PDSA): TIdC_INT cdecl; external CLibCrypto; + function i2d_DSAPublicKey(const a: PDSA; pp: PPByte): TIdC_INT cdecl; external CLibCrypto; + function i2d_DSAPrivateKey(const a: PDSA; pp: PPByte): TIdC_INT cdecl; external CLibCrypto; + function i2d_DSAparams(const a: PDSA; pp: PPByte): TIdC_INT cdecl; external CLibCrypto; + + function DSAparams_print(bp: PBIO; const x: PDSA): TIdC_INT cdecl; external CLibCrypto; + function DSA_print(bp: PBIO; const x: PDSA; off: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; +// function DSAparams_print_fp(fp: PFile; const x: PDSA): TIdC_INT; +// function DSA_print_fp(bp: PFile; const x: PDSA; off: TIdC_INT): TIdC_INT; + + //# define DSA_is_prime(n, callback, cb_arg) \ + // BN_is_prime(n, DSS_prime_checks, callback, NULL, cb_arg) + + (* + * Convert DSA structure (key or just parameters) into DH structure (be + * careful to avoid small subgroup attacks when using this!) + *) + function DSA_dup_DH(const r: PDSA): PDH cdecl; external CLibCrypto; + + //# define EVP_PKEY_CTX_set_dsa_paramgen_bits(ctx, nbits) \ + // EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DSA, EVP_PKEY_OP_PARAMGEN, \ + // EVP_PKEY_CTRL_DSA_PARAMGEN_BITS, nbits, NULL) + //# define EVP_PKEY_CTX_set_dsa_paramgen_q_bits(ctx, qbits) \ + // EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DSA, EVP_PKEY_OP_PARAMGEN, \ + // EVP_PKEY_CTRL_DSA_PARAMGEN_Q_BITS, qbits, NULL) + //# define EVP_PKEY_CTX_set_dsa_paramgen_md(ctx, md) \ + // EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DSA, EVP_PKEY_OP_PARAMGEN, \ + // EVP_PKEY_CTRL_DSA_PARAMGEN_MD, 0, (void *)(md)) + + procedure DSA_get0_pqg(const d: PDSA; const p: PPBIGNUM; const q: PPBIGNUM; const g: PPBIGNUM) cdecl; external CLibCrypto; + function DSA_set0_pqg(d: PDSA; p: PBIGNUM; q: PBIGNUM; g: PBIGNUM): TIdC_INT cdecl; external CLibCrypto; + procedure DSA_get0_key(const d: PDSA; const pub_key: PPBIGNUM; const priv_key: PPBIGNUM) cdecl; external CLibCrypto; + function DSA_set0_key(d: PDSA; pub_key: PBIGNUM; priv_key: PBIGNUM): TIdC_INT cdecl; external CLibCrypto; + function DSA_get0_p(const d: PDSA): PBIGNUM cdecl; external CLibCrypto; + function DSA_get0_q(const d: PDSA): PBIGNUM cdecl; external CLibCrypto; + function DSA_get0_g(const d: PDSA): PBIGNUM cdecl; external CLibCrypto; + function DSA_get0_pub_key(const d: PDSA): PBIGNUM cdecl; external CLibCrypto; + function DSA_get0_priv_key(const d: PDSA): PBIGNUM cdecl; external CLibCrypto; + procedure DSA_clear_flags(d: PDSA; flags: TIdC_INT) cdecl; external CLibCrypto; + function DSA_test_flags(const d: PDSA; flags: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + procedure DSA_set_flags(d: PDSA; flags: TIdC_INT) cdecl; external CLibCrypto; + function DSA_get0_engine(d: PDSA): PENGINE cdecl; external CLibCrypto; + + function DSA_meth_new(const name: PIdAnsiChar; flags: TIdC_INT): PDSA_METHOD cdecl; external CLibCrypto; + procedure DSA_meth_free(dsam: PDSA_METHOD) cdecl; external CLibCrypto; + function DSA_meth_dup(const dsam: PDSA_METHOD): PDSA_METHOD cdecl; external CLibCrypto; + function DSA_meth_get0_name(const dsam: PDSA_METHOD): PIdAnsiChar cdecl; external CLibCrypto; + function DSA_meth_set1_name(dsam: PDSA_METHOD; const name: PIdAnsiChar): TIdC_INT cdecl; external CLibCrypto; + function DSA_meth_get_flags(const dsam: PDSA_METHOD): TIdC_INT cdecl; external CLibCrypto; + function DSA_meth_set_flags(dsam: PDSA_METHOD; flags: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function DSA_meth_get0_app_data(const dsam: PDSA_METHOD): Pointer cdecl; external CLibCrypto; + function DSA_meth_set0_app_data(dsam: PDSA_METHOD; app_data: Pointer): TIdC_INT cdecl; external CLibCrypto; + function DSA_meth_get_sign(const dsam: PDSA_METHOD): DSA_meth_sign_cb cdecl; external CLibCrypto; + function DSA_meth_set_sign(dsam: PDSA_METHOD; sign: DSA_meth_sign_cb): TIdC_INT cdecl; external CLibCrypto; + function DSA_meth_get_sign_setup(const dsam: PDSA_METHOD): DSA_meth_sign_setup_cb cdecl; external CLibCrypto; + function DSA_meth_set_sign_setup(dsam: PDSA_METHOD; sign_setup: DSA_meth_sign_setup_cb): TIdC_INT cdecl; external CLibCrypto; + function DSA_meth_get_verify(const dsam: PDSA_METHOD): DSA_meth_verify_cb cdecl; external CLibCrypto; + function DSA_meth_set_verify(dsam: PDSA_METHOD; verify: DSA_meth_verify_cb): TIdC_INT cdecl; external CLibCrypto; + function DSA_meth_get_mod_exp(const dsam: PDSA_METHOD): DSA_meth_mod_exp_cb cdecl; external CLibCrypto; + function DSA_meth_set_mod_exp(dsam: PDSA_METHOD; mod_exp: DSA_meth_mod_exp_cb): TIdC_INT cdecl; external CLibCrypto; + function DSA_meth_get_bn_mod_exp(const dsam: PDSA_METHOD): DSA_meth_bn_mod_exp_cb cdecl; external CLibCrypto; + function DSA_meth_set_bn_mod_exp(dsam: PDSA_METHOD; bn_mod_exp: DSA_meth_bn_mod_exp_cb): TIdC_INT cdecl; external CLibCrypto; + function DSA_meth_get_init(const dsam: PDSA_METHOD): DSA_meth_init_cb cdecl; external CLibCrypto; + function DSA_meth_set_init(dsam: PDSA_METHOD; init: DSA_meth_init_cb): TIdC_INT cdecl; external CLibCrypto; + function DSA_meth_get_finish(const dsam: PDSA_METHOD): DSA_meth_finish_cb cdecl; external CLibCrypto; + function DSA_meth_set_finish(dsam: PDSA_METHOD; finish: DSA_meth_finish_cb): TIdC_INT cdecl; external CLibCrypto; + function DSA_meth_get_paramgen(const dsam: PDSA_METHOD): DSA_meth_paramgen_cb cdecl; external CLibCrypto; + function DSA_meth_set_paramgen(dsam: PDSA_METHOD; paramgen: DSA_meth_paramgen_cb): TIdC_INT cdecl; external CLibCrypto; + function DSA_meth_get_keygen(const dsam: PDSA_METHOD): DSA_meth_keygen_cb cdecl; external CLibCrypto; + function DSA_meth_set_keygen(dsam: PDSA_METHOD; keygen: DSA_meth_keygen_cb): TIdC_INT cdecl; external CLibCrypto; + +{$ENDIF} + +implementation + + uses + classes, + IdSSLOpenSSLExceptionHandlers, + IdResourceStringsOpenSSL + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + ,IdSSLOpenSSLLoader + {$ENDIF}; + + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +const + DSAparams_dup_procname = 'DSAparams_dup'; + DSA_SIG_new_procname = 'DSA_SIG_new'; + DSA_SIG_free_procname = 'DSA_SIG_free'; + i2d_DSA_SIG_procname = 'i2d_DSA_SIG'; + d2i_DSA_SIG_procname = 'd2i_DSA_SIG'; + DSA_SIG_get0_procname = 'DSA_SIG_get0'; + DSA_SIG_set0_procname = 'DSA_SIG_set0'; + + DSA_do_sign_procname = 'DSA_do_sign'; + DSA_do_verify_procname = 'DSA_do_verify'; + + DSA_OpenSSL_procname = 'DSA_OpenSSL'; + DSA_set_default_method_procname = 'DSA_set_default_method'; + DSA_get_default_method_procname = 'DSA_get_default_method'; + DSA_set_method_procname = 'DSA_set_method'; + DSA_get_method_procname = 'DSA_get_method'; + + DSA_new_procname = 'DSA_new'; + DSA_new_method_procname = 'DSA_new_method'; + DSA_free_procname = 'DSA_free'; + (* "up" the DSA object's reference count *) + DSA_up_ref_procname = 'DSA_up_ref'; + DSA_size_procname = 'DSA_size'; + DSA_bits_procname = 'DSA_bits'; + DSA_security_bits_procname = 'DSA_security_bits'; + DSA_sign_procname = 'DSA_sign'; + DSA_verify_procname = 'DSA_verify'; + //#define DSA_get_ex_new_index(l, p, newf, dupf, freef) \ + // CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_DSA, l, p, newf, dupf, freef) + DSA_set_ex_data_procname = 'DSA_set_ex_data'; + DSA_get_ex_data_procname = 'DSA_get_ex_data'; + + d2i_DSAPublicKey_procname = 'd2i_DSAPublicKey'; + d2i_DSAPrivateKey_procname = 'd2i_DSAPrivateKey'; + d2i_DSAparams_procname = 'd2i_DSAparams'; + + DSA_generate_parameters_ex_procname = 'DSA_generate_parameters_ex'; + + DSA_generate_key_procname = 'DSA_generate_key'; + i2d_DSAPublicKey_procname = 'i2d_DSAPublicKey'; + i2d_DSAPrivateKey_procname = 'i2d_DSAPrivateKey'; + i2d_DSAparams_procname = 'i2d_DSAparams'; + + DSAparams_print_procname = 'DSAparams_print'; + DSA_print_procname = 'DSA_print'; +// function DSAparams_print_fp(fp: PFile; const x: PDSA): TIdC_INT; +// function DSA_print_fp(bp: PFile; const x: PDSA; off: TIdC_INT): TIdC_INT; + + //# define DSA_is_prime(n, callback, cb_arg) \ + // BN_is_prime(n, DSS_prime_checks, callback, NULL, cb_arg) + + (* + * Convert DSA structure (key or just parameters) into DH structure (be + * careful to avoid small subgroup attacks when using this!) + *) + DSA_dup_DH_procname = 'DSA_dup_DH'; + + //# define EVP_PKEY_CTX_set_dsa_paramgen_bits(ctx, nbits) \ + // EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DSA, EVP_PKEY_OP_PARAMGEN, \ + // EVP_PKEY_CTRL_DSA_PARAMGEN_BITS, nbits, NULL) + //# define EVP_PKEY_CTX_set_dsa_paramgen_q_bits(ctx, qbits) \ + // EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DSA, EVP_PKEY_OP_PARAMGEN, \ + // EVP_PKEY_CTRL_DSA_PARAMGEN_Q_BITS, qbits, NULL) + //# define EVP_PKEY_CTX_set_dsa_paramgen_md(ctx, md) \ + // EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DSA, EVP_PKEY_OP_PARAMGEN, \ + // EVP_PKEY_CTRL_DSA_PARAMGEN_MD, 0, (void *)(md)) + + DSA_get0_pqg_procname = 'DSA_get0_pqg'; + DSA_set0_pqg_procname = 'DSA_set0_pqg'; + DSA_get0_key_procname = 'DSA_get0_key'; + DSA_set0_key_procname = 'DSA_set0_key'; + DSA_get0_p_procname = 'DSA_get0_p'; + DSA_get0_q_procname = 'DSA_get0_q'; + DSA_get0_g_procname = 'DSA_get0_g'; + DSA_get0_pub_key_procname = 'DSA_get0_pub_key'; + DSA_get0_priv_key_procname = 'DSA_get0_priv_key'; + DSA_clear_flags_procname = 'DSA_clear_flags'; + DSA_test_flags_procname = 'DSA_test_flags'; + DSA_set_flags_procname = 'DSA_set_flags'; + DSA_get0_engine_procname = 'DSA_get0_engine'; + + DSA_meth_new_procname = 'DSA_meth_new'; + DSA_meth_free_procname = 'DSA_meth_free'; + DSA_meth_dup_procname = 'DSA_meth_dup'; + DSA_meth_get0_name_procname = 'DSA_meth_get0_name'; + DSA_meth_set1_name_procname = 'DSA_meth_set1_name'; + DSA_meth_get_flags_procname = 'DSA_meth_get_flags'; + DSA_meth_set_flags_procname = 'DSA_meth_set_flags'; + DSA_meth_get0_app_data_procname = 'DSA_meth_get0_app_data'; + DSA_meth_set0_app_data_procname = 'DSA_meth_set0_app_data'; + DSA_meth_get_sign_procname = 'DSA_meth_get_sign'; + DSA_meth_set_sign_procname = 'DSA_meth_set_sign'; + DSA_meth_get_sign_setup_procname = 'DSA_meth_get_sign_setup'; + DSA_meth_set_sign_setup_procname = 'DSA_meth_set_sign_setup'; + DSA_meth_get_verify_procname = 'DSA_meth_get_verify'; + DSA_meth_set_verify_procname = 'DSA_meth_set_verify'; + DSA_meth_get_mod_exp_procname = 'DSA_meth_get_mod_exp'; + DSA_meth_set_mod_exp_procname = 'DSA_meth_set_mod_exp'; + DSA_meth_get_bn_mod_exp_procname = 'DSA_meth_get_bn_mod_exp'; + DSA_meth_set_bn_mod_exp_procname = 'DSA_meth_set_bn_mod_exp'; + DSA_meth_get_init_procname = 'DSA_meth_get_init'; + DSA_meth_set_init_procname = 'DSA_meth_set_init'; + DSA_meth_get_finish_procname = 'DSA_meth_get_finish'; + DSA_meth_set_finish_procname = 'DSA_meth_set_finish'; + DSA_meth_get_paramgen_procname = 'DSA_meth_get_paramgen'; + DSA_meth_set_paramgen_procname = 'DSA_meth_set_paramgen'; + DSA_meth_get_keygen_procname = 'DSA_meth_get_keygen'; + DSA_meth_set_keygen_procname = 'DSA_meth_set_keygen'; + + +{$WARN NO_RETVAL OFF} +function ERR_DSAparams_dup(x: PDSA): PDSA; +begin + EIdAPIFunctionNotPresent.RaiseException(DSAparams_dup_procname); +end; + + +function ERR_DSA_SIG_new: PDSA_SIG; +begin + EIdAPIFunctionNotPresent.RaiseException(DSA_SIG_new_procname); +end; + + +procedure ERR_DSA_SIG_free(a: PDSA_SIG); +begin + EIdAPIFunctionNotPresent.RaiseException(DSA_SIG_free_procname); +end; + + +function ERR_i2d_DSA_SIG(const a: PDSA_SIG; pp: PPByte): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(i2d_DSA_SIG_procname); +end; + + +function ERR_d2i_DSA_SIG(v: PPDSA_SIG; const pp: PPByte; length: TIdC_LONG): PDSA_SIG; +begin + EIdAPIFunctionNotPresent.RaiseException(d2i_DSA_SIG_procname); +end; + + +procedure ERR_DSA_SIG_get0(const sig: PDSA_SIG; const pr: PPBIGNUM; const ps: PPBIGNUM); +begin + EIdAPIFunctionNotPresent.RaiseException(DSA_SIG_get0_procname); +end; + + +function ERR_DSA_SIG_set0(sig: PDSA_SIG; r: PBIGNUM; s: PBIGNUM): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(DSA_SIG_set0_procname); +end; + + + +function ERR_DSA_do_sign(const dgst: PByte; dlen: TIdC_INT; dsa: PDSA): PDSA_SIG; +begin + EIdAPIFunctionNotPresent.RaiseException(DSA_do_sign_procname); +end; + + +function ERR_DSA_do_verify(const dgst: PByte; dgst_len: TIdC_INT; sig: PDSA_SIG; dsa: PDSA): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(DSA_do_verify_procname); +end; + + + +function ERR_DSA_OpenSSL: PDSA_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(DSA_OpenSSL_procname); +end; + + +procedure ERR_DSA_set_default_method(const v1: PDSA_METHOD); +begin + EIdAPIFunctionNotPresent.RaiseException(DSA_set_default_method_procname); +end; + + +function ERR_DSA_get_default_method: PDSA_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(DSA_get_default_method_procname); +end; + + +function ERR_DSA_set_method(dsa: PDSA; const v1: PDSA_METHOD): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(DSA_set_method_procname); +end; + + +function ERR_DSA_get_method(d: PDSA): PDSA_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(DSA_get_method_procname); +end; + + + +function ERR_DSA_new: PDSA; +begin + EIdAPIFunctionNotPresent.RaiseException(DSA_new_procname); +end; + + +function ERR_DSA_new_method(engine: PENGINE): PDSA; +begin + EIdAPIFunctionNotPresent.RaiseException(DSA_new_method_procname); +end; + + +procedure ERR_DSA_free(r: PDSA); +begin + EIdAPIFunctionNotPresent.RaiseException(DSA_free_procname); +end; + + + (* "up" the DSA object's reference count *) +function ERR_DSA_up_ref(r: PDSA): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(DSA_up_ref_procname); +end; + + +function ERR_DSA_size(const v1: PDSA): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(DSA_size_procname); +end; + + +function ERR_DSA_bits(const d: PDSA): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(DSA_bits_procname); +end; + + +function ERR_DSA_security_bits(const d: PDSA): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(DSA_security_bits_procname); +end; + + +function ERR_DSA_sign(type_: TIdC_INT; const dgst: PByte; dlen: TIdC_INT; sig: PByte; siglen: PIdC_UINT; dsa: PDSA): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(DSA_sign_procname); +end; + + +function ERR_DSA_verify(type_: TIdC_INT; const dgst: PByte; dgst_len: TIdC_INT; const sigbuf: PByte; siglen: TIdC_INT; dsa: PDSA): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(DSA_verify_procname); +end; + + + //#define DSA_get_ex_new_index(l, p, newf, dupf, freef) \ + // CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_DSA, l, p, newf, dupf, freef) +function ERR_DSA_set_ex_data(d: PDSA; idx: TIdC_INT; arg: Pointer): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(DSA_set_ex_data_procname); +end; + + +function ERR_DSA_get_ex_data(d: PDSA; idx: TIdC_INT): Pointer; +begin + EIdAPIFunctionNotPresent.RaiseException(DSA_get_ex_data_procname); +end; + + + +function ERR_d2i_DSAPublicKey(a: PPDSA; const pp: PPByte; length: TIdC_LONG): PDSA; +begin + EIdAPIFunctionNotPresent.RaiseException(d2i_DSAPublicKey_procname); +end; + + +function ERR_d2i_DSAPrivateKey(a: PPDSA; const pp: PPByte; length: TIdC_LONG): PDSA; +begin + EIdAPIFunctionNotPresent.RaiseException(d2i_DSAPrivateKey_procname); +end; + + +function ERR_d2i_DSAparams(a: PPDSA; const pp: PPByte; length: TIdC_LONG): PDSA; +begin + EIdAPIFunctionNotPresent.RaiseException(d2i_DSAparams_procname); +end; + + + +function ERR_DSA_generate_parameters_ex(dsa: PDSA; bits: TIdC_INT; const seed: PByte; seed_len: TIdC_INT; counter_ret: PIdC_INT; h_ret: PIdC_ULONG; cb: PBN_GENCB): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(DSA_generate_parameters_ex_procname); +end; + + + +function ERR_DSA_generate_key(a: PDSA): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(DSA_generate_key_procname); +end; + + +function ERR_i2d_DSAPublicKey(const a: PDSA; pp: PPByte): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(i2d_DSAPublicKey_procname); +end; + + +function ERR_i2d_DSAPrivateKey(const a: PDSA; pp: PPByte): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(i2d_DSAPrivateKey_procname); +end; + + +function ERR_i2d_DSAparams(const a: PDSA; pp: PPByte): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(i2d_DSAparams_procname); +end; + + + +function ERR_DSAparams_print(bp: PBIO; const x: PDSA): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(DSAparams_print_procname); +end; + + +function ERR_DSA_print(bp: PBIO; const x: PDSA; off: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(DSA_print_procname); +end; + + +// function DSAparams_print_fp(fp: PFile; const x: PDSA): TIdC_INT; +// function DSA_print_fp(bp: PFile; const x: PDSA; off: TIdC_INT): TIdC_INT; + + //# define DSA_is_prime(n, callback, cb_arg) \ + // BN_is_prime(n, DSS_prime_checks, callback, NULL, cb_arg) + + (* + * Convert DSA structure (key or just parameters) into DH structure (be + * careful to avoid small subgroup attacks when using this!) + *) +function ERR_DSA_dup_DH(const r: PDSA): PDH; +begin + EIdAPIFunctionNotPresent.RaiseException(DSA_dup_DH_procname); +end; + + + + //# define EVP_PKEY_CTX_set_dsa_paramgen_bits(ctx, nbits) \ + // EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DSA, EVP_PKEY_OP_PARAMGEN, \ + // EVP_PKEY_CTRL_DSA_PARAMGEN_BITS, nbits, NULL) + //# define EVP_PKEY_CTX_set_dsa_paramgen_q_bits(ctx, qbits) \ + // EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DSA, EVP_PKEY_OP_PARAMGEN, \ + // EVP_PKEY_CTRL_DSA_PARAMGEN_Q_BITS, qbits, NULL) + //# define EVP_PKEY_CTX_set_dsa_paramgen_md(ctx, md) \ + // EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DSA, EVP_PKEY_OP_PARAMGEN, \ + // EVP_PKEY_CTRL_DSA_PARAMGEN_MD, 0, (void *)(md)) + +procedure ERR_DSA_get0_pqg(const d: PDSA; const p: PPBIGNUM; const q: PPBIGNUM; const g: PPBIGNUM); +begin + EIdAPIFunctionNotPresent.RaiseException(DSA_get0_pqg_procname); +end; + + +function ERR_DSA_set0_pqg(d: PDSA; p: PBIGNUM; q: PBIGNUM; g: PBIGNUM): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(DSA_set0_pqg_procname); +end; + + +procedure ERR_DSA_get0_key(const d: PDSA; const pub_key: PPBIGNUM; const priv_key: PPBIGNUM); +begin + EIdAPIFunctionNotPresent.RaiseException(DSA_get0_key_procname); +end; + + +function ERR_DSA_set0_key(d: PDSA; pub_key: PBIGNUM; priv_key: PBIGNUM): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(DSA_set0_key_procname); +end; + + +function ERR_DSA_get0_p(const d: PDSA): PBIGNUM; +begin + EIdAPIFunctionNotPresent.RaiseException(DSA_get0_p_procname); +end; + + +function ERR_DSA_get0_q(const d: PDSA): PBIGNUM; +begin + EIdAPIFunctionNotPresent.RaiseException(DSA_get0_q_procname); +end; + + +function ERR_DSA_get0_g(const d: PDSA): PBIGNUM; +begin + EIdAPIFunctionNotPresent.RaiseException(DSA_get0_g_procname); +end; + + +function ERR_DSA_get0_pub_key(const d: PDSA): PBIGNUM; +begin + EIdAPIFunctionNotPresent.RaiseException(DSA_get0_pub_key_procname); +end; + + +function ERR_DSA_get0_priv_key(const d: PDSA): PBIGNUM; +begin + EIdAPIFunctionNotPresent.RaiseException(DSA_get0_priv_key_procname); +end; + + +procedure ERR_DSA_clear_flags(d: PDSA; flags: TIdC_INT); +begin + EIdAPIFunctionNotPresent.RaiseException(DSA_clear_flags_procname); +end; + + +function ERR_DSA_test_flags(const d: PDSA; flags: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(DSA_test_flags_procname); +end; + + +procedure ERR_DSA_set_flags(d: PDSA; flags: TIdC_INT); +begin + EIdAPIFunctionNotPresent.RaiseException(DSA_set_flags_procname); +end; + + +function ERR_DSA_get0_engine(d: PDSA): PENGINE; +begin + EIdAPIFunctionNotPresent.RaiseException(DSA_get0_engine_procname); +end; + + + +function ERR_DSA_meth_new(const name: PIdAnsiChar; flags: TIdC_INT): PDSA_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(DSA_meth_new_procname); +end; + + +procedure ERR_DSA_meth_free(dsam: PDSA_METHOD); +begin + EIdAPIFunctionNotPresent.RaiseException(DSA_meth_free_procname); +end; + + +function ERR_DSA_meth_dup(const dsam: PDSA_METHOD): PDSA_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(DSA_meth_dup_procname); +end; + + +function ERR_DSA_meth_get0_name(const dsam: PDSA_METHOD): PIdAnsiChar; +begin + EIdAPIFunctionNotPresent.RaiseException(DSA_meth_get0_name_procname); +end; + + +function ERR_DSA_meth_set1_name(dsam: PDSA_METHOD; const name: PIdAnsiChar): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(DSA_meth_set1_name_procname); +end; + + +function ERR_DSA_meth_get_flags(const dsam: PDSA_METHOD): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(DSA_meth_get_flags_procname); +end; + + +function ERR_DSA_meth_set_flags(dsam: PDSA_METHOD; flags: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(DSA_meth_set_flags_procname); +end; + + +function ERR_DSA_meth_get0_app_data(const dsam: PDSA_METHOD): Pointer; +begin + EIdAPIFunctionNotPresent.RaiseException(DSA_meth_get0_app_data_procname); +end; + + +function ERR_DSA_meth_set0_app_data(dsam: PDSA_METHOD; app_data: Pointer): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(DSA_meth_set0_app_data_procname); +end; + + +function ERR_DSA_meth_get_sign(const dsam: PDSA_METHOD): DSA_meth_sign_cb; +begin + EIdAPIFunctionNotPresent.RaiseException(DSA_meth_get_sign_procname); +end; + + +function ERR_DSA_meth_set_sign(dsam: PDSA_METHOD; sign: DSA_meth_sign_cb): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(DSA_meth_set_sign_procname); +end; + + +function ERR_DSA_meth_get_sign_setup(const dsam: PDSA_METHOD): DSA_meth_sign_setup_cb; +begin + EIdAPIFunctionNotPresent.RaiseException(DSA_meth_get_sign_setup_procname); +end; + + +function ERR_DSA_meth_set_sign_setup(dsam: PDSA_METHOD; sign_setup: DSA_meth_sign_setup_cb): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(DSA_meth_set_sign_setup_procname); +end; + + +function ERR_DSA_meth_get_verify(const dsam: PDSA_METHOD): DSA_meth_verify_cb; +begin + EIdAPIFunctionNotPresent.RaiseException(DSA_meth_get_verify_procname); +end; + + +function ERR_DSA_meth_set_verify(dsam: PDSA_METHOD; verify: DSA_meth_verify_cb): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(DSA_meth_set_verify_procname); +end; + + +function ERR_DSA_meth_get_mod_exp(const dsam: PDSA_METHOD): DSA_meth_mod_exp_cb; +begin + EIdAPIFunctionNotPresent.RaiseException(DSA_meth_get_mod_exp_procname); +end; + + +function ERR_DSA_meth_set_mod_exp(dsam: PDSA_METHOD; mod_exp: DSA_meth_mod_exp_cb): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(DSA_meth_set_mod_exp_procname); +end; + + +function ERR_DSA_meth_get_bn_mod_exp(const dsam: PDSA_METHOD): DSA_meth_bn_mod_exp_cb; +begin + EIdAPIFunctionNotPresent.RaiseException(DSA_meth_get_bn_mod_exp_procname); +end; + + +function ERR_DSA_meth_set_bn_mod_exp(dsam: PDSA_METHOD; bn_mod_exp: DSA_meth_bn_mod_exp_cb): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(DSA_meth_set_bn_mod_exp_procname); +end; + + +function ERR_DSA_meth_get_init(const dsam: PDSA_METHOD): DSA_meth_init_cb; +begin + EIdAPIFunctionNotPresent.RaiseException(DSA_meth_get_init_procname); +end; + + +function ERR_DSA_meth_set_init(dsam: PDSA_METHOD; init: DSA_meth_init_cb): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(DSA_meth_set_init_procname); +end; + + +function ERR_DSA_meth_get_finish(const dsam: PDSA_METHOD): DSA_meth_finish_cb; +begin + EIdAPIFunctionNotPresent.RaiseException(DSA_meth_get_finish_procname); +end; + + +function ERR_DSA_meth_set_finish(dsam: PDSA_METHOD; finish: DSA_meth_finish_cb): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(DSA_meth_set_finish_procname); +end; + + +function ERR_DSA_meth_get_paramgen(const dsam: PDSA_METHOD): DSA_meth_paramgen_cb; +begin + EIdAPIFunctionNotPresent.RaiseException(DSA_meth_get_paramgen_procname); +end; + + +function ERR_DSA_meth_set_paramgen(dsam: PDSA_METHOD; paramgen: DSA_meth_paramgen_cb): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(DSA_meth_set_paramgen_procname); +end; + + +function ERR_DSA_meth_get_keygen(const dsam: PDSA_METHOD): DSA_meth_keygen_cb; +begin + EIdAPIFunctionNotPresent.RaiseException(DSA_meth_get_keygen_procname); +end; + + +function ERR_DSA_meth_set_keygen(dsam: PDSA_METHOD; keygen: DSA_meth_keygen_cb): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(DSA_meth_set_keygen_procname); +end; + + + +{$WARN NO_RETVAL ON} + +procedure Load(const ADllHandle: TIdLibHandle; LibVersion: TIdC_UINT; const AFailed: TStringList); + +var FuncLoadError: boolean; + +begin + DSAparams_dup := LoadLibFunction(ADllHandle, DSAparams_dup_procname); + FuncLoadError := not assigned(DSAparams_dup); + if FuncLoadError then + begin + {$if not defined(DSAparams_dup_allownil)} + DSAparams_dup := @ERR_DSAparams_dup; + {$ifend} + {$if declared(DSAparams_dup_introduced)} + if LibVersion < DSAparams_dup_introduced then + begin + {$if declared(FC_DSAparams_dup)} + DSAparams_dup := @FC_DSAparams_dup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DSAparams_dup_removed)} + if DSAparams_dup_removed <= LibVersion then + begin + {$if declared(_DSAparams_dup)} + DSAparams_dup := @_DSAparams_dup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DSAparams_dup_allownil)} + if FuncLoadError then + AFailed.Add('DSAparams_dup'); + {$ifend} + end; + + + DSA_SIG_new := LoadLibFunction(ADllHandle, DSA_SIG_new_procname); + FuncLoadError := not assigned(DSA_SIG_new); + if FuncLoadError then + begin + {$if not defined(DSA_SIG_new_allownil)} + DSA_SIG_new := @ERR_DSA_SIG_new; + {$ifend} + {$if declared(DSA_SIG_new_introduced)} + if LibVersion < DSA_SIG_new_introduced then + begin + {$if declared(FC_DSA_SIG_new)} + DSA_SIG_new := @FC_DSA_SIG_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DSA_SIG_new_removed)} + if DSA_SIG_new_removed <= LibVersion then + begin + {$if declared(_DSA_SIG_new)} + DSA_SIG_new := @_DSA_SIG_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DSA_SIG_new_allownil)} + if FuncLoadError then + AFailed.Add('DSA_SIG_new'); + {$ifend} + end; + + + DSA_SIG_free := LoadLibFunction(ADllHandle, DSA_SIG_free_procname); + FuncLoadError := not assigned(DSA_SIG_free); + if FuncLoadError then + begin + {$if not defined(DSA_SIG_free_allownil)} + DSA_SIG_free := @ERR_DSA_SIG_free; + {$ifend} + {$if declared(DSA_SIG_free_introduced)} + if LibVersion < DSA_SIG_free_introduced then + begin + {$if declared(FC_DSA_SIG_free)} + DSA_SIG_free := @FC_DSA_SIG_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DSA_SIG_free_removed)} + if DSA_SIG_free_removed <= LibVersion then + begin + {$if declared(_DSA_SIG_free)} + DSA_SIG_free := @_DSA_SIG_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DSA_SIG_free_allownil)} + if FuncLoadError then + AFailed.Add('DSA_SIG_free'); + {$ifend} + end; + + + i2d_DSA_SIG := LoadLibFunction(ADllHandle, i2d_DSA_SIG_procname); + FuncLoadError := not assigned(i2d_DSA_SIG); + if FuncLoadError then + begin + {$if not defined(i2d_DSA_SIG_allownil)} + i2d_DSA_SIG := @ERR_i2d_DSA_SIG; + {$ifend} + {$if declared(i2d_DSA_SIG_introduced)} + if LibVersion < i2d_DSA_SIG_introduced then + begin + {$if declared(FC_i2d_DSA_SIG)} + i2d_DSA_SIG := @FC_i2d_DSA_SIG; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(i2d_DSA_SIG_removed)} + if i2d_DSA_SIG_removed <= LibVersion then + begin + {$if declared(_i2d_DSA_SIG)} + i2d_DSA_SIG := @_i2d_DSA_SIG; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(i2d_DSA_SIG_allownil)} + if FuncLoadError then + AFailed.Add('i2d_DSA_SIG'); + {$ifend} + end; + + + d2i_DSA_SIG := LoadLibFunction(ADllHandle, d2i_DSA_SIG_procname); + FuncLoadError := not assigned(d2i_DSA_SIG); + if FuncLoadError then + begin + {$if not defined(d2i_DSA_SIG_allownil)} + d2i_DSA_SIG := @ERR_d2i_DSA_SIG; + {$ifend} + {$if declared(d2i_DSA_SIG_introduced)} + if LibVersion < d2i_DSA_SIG_introduced then + begin + {$if declared(FC_d2i_DSA_SIG)} + d2i_DSA_SIG := @FC_d2i_DSA_SIG; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(d2i_DSA_SIG_removed)} + if d2i_DSA_SIG_removed <= LibVersion then + begin + {$if declared(_d2i_DSA_SIG)} + d2i_DSA_SIG := @_d2i_DSA_SIG; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(d2i_DSA_SIG_allownil)} + if FuncLoadError then + AFailed.Add('d2i_DSA_SIG'); + {$ifend} + end; + + + DSA_SIG_get0 := LoadLibFunction(ADllHandle, DSA_SIG_get0_procname); + FuncLoadError := not assigned(DSA_SIG_get0); + if FuncLoadError then + begin + {$if not defined(DSA_SIG_get0_allownil)} + DSA_SIG_get0 := @ERR_DSA_SIG_get0; + {$ifend} + {$if declared(DSA_SIG_get0_introduced)} + if LibVersion < DSA_SIG_get0_introduced then + begin + {$if declared(FC_DSA_SIG_get0)} + DSA_SIG_get0 := @FC_DSA_SIG_get0; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DSA_SIG_get0_removed)} + if DSA_SIG_get0_removed <= LibVersion then + begin + {$if declared(_DSA_SIG_get0)} + DSA_SIG_get0 := @_DSA_SIG_get0; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DSA_SIG_get0_allownil)} + if FuncLoadError then + AFailed.Add('DSA_SIG_get0'); + {$ifend} + end; + + + DSA_SIG_set0 := LoadLibFunction(ADllHandle, DSA_SIG_set0_procname); + FuncLoadError := not assigned(DSA_SIG_set0); + if FuncLoadError then + begin + {$if not defined(DSA_SIG_set0_allownil)} + DSA_SIG_set0 := @ERR_DSA_SIG_set0; + {$ifend} + {$if declared(DSA_SIG_set0_introduced)} + if LibVersion < DSA_SIG_set0_introduced then + begin + {$if declared(FC_DSA_SIG_set0)} + DSA_SIG_set0 := @FC_DSA_SIG_set0; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DSA_SIG_set0_removed)} + if DSA_SIG_set0_removed <= LibVersion then + begin + {$if declared(_DSA_SIG_set0)} + DSA_SIG_set0 := @_DSA_SIG_set0; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DSA_SIG_set0_allownil)} + if FuncLoadError then + AFailed.Add('DSA_SIG_set0'); + {$ifend} + end; + + + DSA_do_sign := LoadLibFunction(ADllHandle, DSA_do_sign_procname); + FuncLoadError := not assigned(DSA_do_sign); + if FuncLoadError then + begin + {$if not defined(DSA_do_sign_allownil)} + DSA_do_sign := @ERR_DSA_do_sign; + {$ifend} + {$if declared(DSA_do_sign_introduced)} + if LibVersion < DSA_do_sign_introduced then + begin + {$if declared(FC_DSA_do_sign)} + DSA_do_sign := @FC_DSA_do_sign; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DSA_do_sign_removed)} + if DSA_do_sign_removed <= LibVersion then + begin + {$if declared(_DSA_do_sign)} + DSA_do_sign := @_DSA_do_sign; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DSA_do_sign_allownil)} + if FuncLoadError then + AFailed.Add('DSA_do_sign'); + {$ifend} + end; + + + DSA_do_verify := LoadLibFunction(ADllHandle, DSA_do_verify_procname); + FuncLoadError := not assigned(DSA_do_verify); + if FuncLoadError then + begin + {$if not defined(DSA_do_verify_allownil)} + DSA_do_verify := @ERR_DSA_do_verify; + {$ifend} + {$if declared(DSA_do_verify_introduced)} + if LibVersion < DSA_do_verify_introduced then + begin + {$if declared(FC_DSA_do_verify)} + DSA_do_verify := @FC_DSA_do_verify; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DSA_do_verify_removed)} + if DSA_do_verify_removed <= LibVersion then + begin + {$if declared(_DSA_do_verify)} + DSA_do_verify := @_DSA_do_verify; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DSA_do_verify_allownil)} + if FuncLoadError then + AFailed.Add('DSA_do_verify'); + {$ifend} + end; + + + DSA_OpenSSL := LoadLibFunction(ADllHandle, DSA_OpenSSL_procname); + FuncLoadError := not assigned(DSA_OpenSSL); + if FuncLoadError then + begin + {$if not defined(DSA_OpenSSL_allownil)} + DSA_OpenSSL := @ERR_DSA_OpenSSL; + {$ifend} + {$if declared(DSA_OpenSSL_introduced)} + if LibVersion < DSA_OpenSSL_introduced then + begin + {$if declared(FC_DSA_OpenSSL)} + DSA_OpenSSL := @FC_DSA_OpenSSL; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DSA_OpenSSL_removed)} + if DSA_OpenSSL_removed <= LibVersion then + begin + {$if declared(_DSA_OpenSSL)} + DSA_OpenSSL := @_DSA_OpenSSL; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DSA_OpenSSL_allownil)} + if FuncLoadError then + AFailed.Add('DSA_OpenSSL'); + {$ifend} + end; + + + DSA_set_default_method := LoadLibFunction(ADllHandle, DSA_set_default_method_procname); + FuncLoadError := not assigned(DSA_set_default_method); + if FuncLoadError then + begin + {$if not defined(DSA_set_default_method_allownil)} + DSA_set_default_method := @ERR_DSA_set_default_method; + {$ifend} + {$if declared(DSA_set_default_method_introduced)} + if LibVersion < DSA_set_default_method_introduced then + begin + {$if declared(FC_DSA_set_default_method)} + DSA_set_default_method := @FC_DSA_set_default_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DSA_set_default_method_removed)} + if DSA_set_default_method_removed <= LibVersion then + begin + {$if declared(_DSA_set_default_method)} + DSA_set_default_method := @_DSA_set_default_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DSA_set_default_method_allownil)} + if FuncLoadError then + AFailed.Add('DSA_set_default_method'); + {$ifend} + end; + + + DSA_get_default_method := LoadLibFunction(ADllHandle, DSA_get_default_method_procname); + FuncLoadError := not assigned(DSA_get_default_method); + if FuncLoadError then + begin + {$if not defined(DSA_get_default_method_allownil)} + DSA_get_default_method := @ERR_DSA_get_default_method; + {$ifend} + {$if declared(DSA_get_default_method_introduced)} + if LibVersion < DSA_get_default_method_introduced then + begin + {$if declared(FC_DSA_get_default_method)} + DSA_get_default_method := @FC_DSA_get_default_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DSA_get_default_method_removed)} + if DSA_get_default_method_removed <= LibVersion then + begin + {$if declared(_DSA_get_default_method)} + DSA_get_default_method := @_DSA_get_default_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DSA_get_default_method_allownil)} + if FuncLoadError then + AFailed.Add('DSA_get_default_method'); + {$ifend} + end; + + + DSA_set_method := LoadLibFunction(ADllHandle, DSA_set_method_procname); + FuncLoadError := not assigned(DSA_set_method); + if FuncLoadError then + begin + {$if not defined(DSA_set_method_allownil)} + DSA_set_method := @ERR_DSA_set_method; + {$ifend} + {$if declared(DSA_set_method_introduced)} + if LibVersion < DSA_set_method_introduced then + begin + {$if declared(FC_DSA_set_method)} + DSA_set_method := @FC_DSA_set_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DSA_set_method_removed)} + if DSA_set_method_removed <= LibVersion then + begin + {$if declared(_DSA_set_method)} + DSA_set_method := @_DSA_set_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DSA_set_method_allownil)} + if FuncLoadError then + AFailed.Add('DSA_set_method'); + {$ifend} + end; + + + DSA_get_method := LoadLibFunction(ADllHandle, DSA_get_method_procname); + FuncLoadError := not assigned(DSA_get_method); + if FuncLoadError then + begin + {$if not defined(DSA_get_method_allownil)} + DSA_get_method := @ERR_DSA_get_method; + {$ifend} + {$if declared(DSA_get_method_introduced)} + if LibVersion < DSA_get_method_introduced then + begin + {$if declared(FC_DSA_get_method)} + DSA_get_method := @FC_DSA_get_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DSA_get_method_removed)} + if DSA_get_method_removed <= LibVersion then + begin + {$if declared(_DSA_get_method)} + DSA_get_method := @_DSA_get_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DSA_get_method_allownil)} + if FuncLoadError then + AFailed.Add('DSA_get_method'); + {$ifend} + end; + + + DSA_new := LoadLibFunction(ADllHandle, DSA_new_procname); + FuncLoadError := not assigned(DSA_new); + if FuncLoadError then + begin + {$if not defined(DSA_new_allownil)} + DSA_new := @ERR_DSA_new; + {$ifend} + {$if declared(DSA_new_introduced)} + if LibVersion < DSA_new_introduced then + begin + {$if declared(FC_DSA_new)} + DSA_new := @FC_DSA_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DSA_new_removed)} + if DSA_new_removed <= LibVersion then + begin + {$if declared(_DSA_new)} + DSA_new := @_DSA_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DSA_new_allownil)} + if FuncLoadError then + AFailed.Add('DSA_new'); + {$ifend} + end; + + + DSA_new_method := LoadLibFunction(ADllHandle, DSA_new_method_procname); + FuncLoadError := not assigned(DSA_new_method); + if FuncLoadError then + begin + {$if not defined(DSA_new_method_allownil)} + DSA_new_method := @ERR_DSA_new_method; + {$ifend} + {$if declared(DSA_new_method_introduced)} + if LibVersion < DSA_new_method_introduced then + begin + {$if declared(FC_DSA_new_method)} + DSA_new_method := @FC_DSA_new_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DSA_new_method_removed)} + if DSA_new_method_removed <= LibVersion then + begin + {$if declared(_DSA_new_method)} + DSA_new_method := @_DSA_new_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DSA_new_method_allownil)} + if FuncLoadError then + AFailed.Add('DSA_new_method'); + {$ifend} + end; + + + DSA_free := LoadLibFunction(ADllHandle, DSA_free_procname); + FuncLoadError := not assigned(DSA_free); + if FuncLoadError then + begin + {$if not defined(DSA_free_allownil)} + DSA_free := @ERR_DSA_free; + {$ifend} + {$if declared(DSA_free_introduced)} + if LibVersion < DSA_free_introduced then + begin + {$if declared(FC_DSA_free)} + DSA_free := @FC_DSA_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DSA_free_removed)} + if DSA_free_removed <= LibVersion then + begin + {$if declared(_DSA_free)} + DSA_free := @_DSA_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DSA_free_allownil)} + if FuncLoadError then + AFailed.Add('DSA_free'); + {$ifend} + end; + + + DSA_up_ref := LoadLibFunction(ADllHandle, DSA_up_ref_procname); + FuncLoadError := not assigned(DSA_up_ref); + if FuncLoadError then + begin + {$if not defined(DSA_up_ref_allownil)} + DSA_up_ref := @ERR_DSA_up_ref; + {$ifend} + {$if declared(DSA_up_ref_introduced)} + if LibVersion < DSA_up_ref_introduced then + begin + {$if declared(FC_DSA_up_ref)} + DSA_up_ref := @FC_DSA_up_ref; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DSA_up_ref_removed)} + if DSA_up_ref_removed <= LibVersion then + begin + {$if declared(_DSA_up_ref)} + DSA_up_ref := @_DSA_up_ref; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DSA_up_ref_allownil)} + if FuncLoadError then + AFailed.Add('DSA_up_ref'); + {$ifend} + end; + + + DSA_size := LoadLibFunction(ADllHandle, DSA_size_procname); + FuncLoadError := not assigned(DSA_size); + if FuncLoadError then + begin + {$if not defined(DSA_size_allownil)} + DSA_size := @ERR_DSA_size; + {$ifend} + {$if declared(DSA_size_introduced)} + if LibVersion < DSA_size_introduced then + begin + {$if declared(FC_DSA_size)} + DSA_size := @FC_DSA_size; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DSA_size_removed)} + if DSA_size_removed <= LibVersion then + begin + {$if declared(_DSA_size)} + DSA_size := @_DSA_size; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DSA_size_allownil)} + if FuncLoadError then + AFailed.Add('DSA_size'); + {$ifend} + end; + + + DSA_bits := LoadLibFunction(ADllHandle, DSA_bits_procname); + FuncLoadError := not assigned(DSA_bits); + if FuncLoadError then + begin + {$if not defined(DSA_bits_allownil)} + DSA_bits := @ERR_DSA_bits; + {$ifend} + {$if declared(DSA_bits_introduced)} + if LibVersion < DSA_bits_introduced then + begin + {$if declared(FC_DSA_bits)} + DSA_bits := @FC_DSA_bits; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DSA_bits_removed)} + if DSA_bits_removed <= LibVersion then + begin + {$if declared(_DSA_bits)} + DSA_bits := @_DSA_bits; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DSA_bits_allownil)} + if FuncLoadError then + AFailed.Add('DSA_bits'); + {$ifend} + end; + + + DSA_security_bits := LoadLibFunction(ADllHandle, DSA_security_bits_procname); + FuncLoadError := not assigned(DSA_security_bits); + if FuncLoadError then + begin + {$if not defined(DSA_security_bits_allownil)} + DSA_security_bits := @ERR_DSA_security_bits; + {$ifend} + {$if declared(DSA_security_bits_introduced)} + if LibVersion < DSA_security_bits_introduced then + begin + {$if declared(FC_DSA_security_bits)} + DSA_security_bits := @FC_DSA_security_bits; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DSA_security_bits_removed)} + if DSA_security_bits_removed <= LibVersion then + begin + {$if declared(_DSA_security_bits)} + DSA_security_bits := @_DSA_security_bits; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DSA_security_bits_allownil)} + if FuncLoadError then + AFailed.Add('DSA_security_bits'); + {$ifend} + end; + + + DSA_sign := LoadLibFunction(ADllHandle, DSA_sign_procname); + FuncLoadError := not assigned(DSA_sign); + if FuncLoadError then + begin + {$if not defined(DSA_sign_allownil)} + DSA_sign := @ERR_DSA_sign; + {$ifend} + {$if declared(DSA_sign_introduced)} + if LibVersion < DSA_sign_introduced then + begin + {$if declared(FC_DSA_sign)} + DSA_sign := @FC_DSA_sign; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DSA_sign_removed)} + if DSA_sign_removed <= LibVersion then + begin + {$if declared(_DSA_sign)} + DSA_sign := @_DSA_sign; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DSA_sign_allownil)} + if FuncLoadError then + AFailed.Add('DSA_sign'); + {$ifend} + end; + + + DSA_verify := LoadLibFunction(ADllHandle, DSA_verify_procname); + FuncLoadError := not assigned(DSA_verify); + if FuncLoadError then + begin + {$if not defined(DSA_verify_allownil)} + DSA_verify := @ERR_DSA_verify; + {$ifend} + {$if declared(DSA_verify_introduced)} + if LibVersion < DSA_verify_introduced then + begin + {$if declared(FC_DSA_verify)} + DSA_verify := @FC_DSA_verify; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DSA_verify_removed)} + if DSA_verify_removed <= LibVersion then + begin + {$if declared(_DSA_verify)} + DSA_verify := @_DSA_verify; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DSA_verify_allownil)} + if FuncLoadError then + AFailed.Add('DSA_verify'); + {$ifend} + end; + + + DSA_set_ex_data := LoadLibFunction(ADllHandle, DSA_set_ex_data_procname); + FuncLoadError := not assigned(DSA_set_ex_data); + if FuncLoadError then + begin + {$if not defined(DSA_set_ex_data_allownil)} + DSA_set_ex_data := @ERR_DSA_set_ex_data; + {$ifend} + {$if declared(DSA_set_ex_data_introduced)} + if LibVersion < DSA_set_ex_data_introduced then + begin + {$if declared(FC_DSA_set_ex_data)} + DSA_set_ex_data := @FC_DSA_set_ex_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DSA_set_ex_data_removed)} + if DSA_set_ex_data_removed <= LibVersion then + begin + {$if declared(_DSA_set_ex_data)} + DSA_set_ex_data := @_DSA_set_ex_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DSA_set_ex_data_allownil)} + if FuncLoadError then + AFailed.Add('DSA_set_ex_data'); + {$ifend} + end; + + + DSA_get_ex_data := LoadLibFunction(ADllHandle, DSA_get_ex_data_procname); + FuncLoadError := not assigned(DSA_get_ex_data); + if FuncLoadError then + begin + {$if not defined(DSA_get_ex_data_allownil)} + DSA_get_ex_data := @ERR_DSA_get_ex_data; + {$ifend} + {$if declared(DSA_get_ex_data_introduced)} + if LibVersion < DSA_get_ex_data_introduced then + begin + {$if declared(FC_DSA_get_ex_data)} + DSA_get_ex_data := @FC_DSA_get_ex_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DSA_get_ex_data_removed)} + if DSA_get_ex_data_removed <= LibVersion then + begin + {$if declared(_DSA_get_ex_data)} + DSA_get_ex_data := @_DSA_get_ex_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DSA_get_ex_data_allownil)} + if FuncLoadError then + AFailed.Add('DSA_get_ex_data'); + {$ifend} + end; + + + d2i_DSAPublicKey := LoadLibFunction(ADllHandle, d2i_DSAPublicKey_procname); + FuncLoadError := not assigned(d2i_DSAPublicKey); + if FuncLoadError then + begin + {$if not defined(d2i_DSAPublicKey_allownil)} + d2i_DSAPublicKey := @ERR_d2i_DSAPublicKey; + {$ifend} + {$if declared(d2i_DSAPublicKey_introduced)} + if LibVersion < d2i_DSAPublicKey_introduced then + begin + {$if declared(FC_d2i_DSAPublicKey)} + d2i_DSAPublicKey := @FC_d2i_DSAPublicKey; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(d2i_DSAPublicKey_removed)} + if d2i_DSAPublicKey_removed <= LibVersion then + begin + {$if declared(_d2i_DSAPublicKey)} + d2i_DSAPublicKey := @_d2i_DSAPublicKey; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(d2i_DSAPublicKey_allownil)} + if FuncLoadError then + AFailed.Add('d2i_DSAPublicKey'); + {$ifend} + end; + + + d2i_DSAPrivateKey := LoadLibFunction(ADllHandle, d2i_DSAPrivateKey_procname); + FuncLoadError := not assigned(d2i_DSAPrivateKey); + if FuncLoadError then + begin + {$if not defined(d2i_DSAPrivateKey_allownil)} + d2i_DSAPrivateKey := @ERR_d2i_DSAPrivateKey; + {$ifend} + {$if declared(d2i_DSAPrivateKey_introduced)} + if LibVersion < d2i_DSAPrivateKey_introduced then + begin + {$if declared(FC_d2i_DSAPrivateKey)} + d2i_DSAPrivateKey := @FC_d2i_DSAPrivateKey; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(d2i_DSAPrivateKey_removed)} + if d2i_DSAPrivateKey_removed <= LibVersion then + begin + {$if declared(_d2i_DSAPrivateKey)} + d2i_DSAPrivateKey := @_d2i_DSAPrivateKey; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(d2i_DSAPrivateKey_allownil)} + if FuncLoadError then + AFailed.Add('d2i_DSAPrivateKey'); + {$ifend} + end; + + + d2i_DSAparams := LoadLibFunction(ADllHandle, d2i_DSAparams_procname); + FuncLoadError := not assigned(d2i_DSAparams); + if FuncLoadError then + begin + {$if not defined(d2i_DSAparams_allownil)} + d2i_DSAparams := @ERR_d2i_DSAparams; + {$ifend} + {$if declared(d2i_DSAparams_introduced)} + if LibVersion < d2i_DSAparams_introduced then + begin + {$if declared(FC_d2i_DSAparams)} + d2i_DSAparams := @FC_d2i_DSAparams; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(d2i_DSAparams_removed)} + if d2i_DSAparams_removed <= LibVersion then + begin + {$if declared(_d2i_DSAparams)} + d2i_DSAparams := @_d2i_DSAparams; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(d2i_DSAparams_allownil)} + if FuncLoadError then + AFailed.Add('d2i_DSAparams'); + {$ifend} + end; + + + DSA_generate_parameters_ex := LoadLibFunction(ADllHandle, DSA_generate_parameters_ex_procname); + FuncLoadError := not assigned(DSA_generate_parameters_ex); + if FuncLoadError then + begin + {$if not defined(DSA_generate_parameters_ex_allownil)} + DSA_generate_parameters_ex := @ERR_DSA_generate_parameters_ex; + {$ifend} + {$if declared(DSA_generate_parameters_ex_introduced)} + if LibVersion < DSA_generate_parameters_ex_introduced then + begin + {$if declared(FC_DSA_generate_parameters_ex)} + DSA_generate_parameters_ex := @FC_DSA_generate_parameters_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DSA_generate_parameters_ex_removed)} + if DSA_generate_parameters_ex_removed <= LibVersion then + begin + {$if declared(_DSA_generate_parameters_ex)} + DSA_generate_parameters_ex := @_DSA_generate_parameters_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DSA_generate_parameters_ex_allownil)} + if FuncLoadError then + AFailed.Add('DSA_generate_parameters_ex'); + {$ifend} + end; + + + DSA_generate_key := LoadLibFunction(ADllHandle, DSA_generate_key_procname); + FuncLoadError := not assigned(DSA_generate_key); + if FuncLoadError then + begin + {$if not defined(DSA_generate_key_allownil)} + DSA_generate_key := @ERR_DSA_generate_key; + {$ifend} + {$if declared(DSA_generate_key_introduced)} + if LibVersion < DSA_generate_key_introduced then + begin + {$if declared(FC_DSA_generate_key)} + DSA_generate_key := @FC_DSA_generate_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DSA_generate_key_removed)} + if DSA_generate_key_removed <= LibVersion then + begin + {$if declared(_DSA_generate_key)} + DSA_generate_key := @_DSA_generate_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DSA_generate_key_allownil)} + if FuncLoadError then + AFailed.Add('DSA_generate_key'); + {$ifend} + end; + + + i2d_DSAPublicKey := LoadLibFunction(ADllHandle, i2d_DSAPublicKey_procname); + FuncLoadError := not assigned(i2d_DSAPublicKey); + if FuncLoadError then + begin + {$if not defined(i2d_DSAPublicKey_allownil)} + i2d_DSAPublicKey := @ERR_i2d_DSAPublicKey; + {$ifend} + {$if declared(i2d_DSAPublicKey_introduced)} + if LibVersion < i2d_DSAPublicKey_introduced then + begin + {$if declared(FC_i2d_DSAPublicKey)} + i2d_DSAPublicKey := @FC_i2d_DSAPublicKey; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(i2d_DSAPublicKey_removed)} + if i2d_DSAPublicKey_removed <= LibVersion then + begin + {$if declared(_i2d_DSAPublicKey)} + i2d_DSAPublicKey := @_i2d_DSAPublicKey; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(i2d_DSAPublicKey_allownil)} + if FuncLoadError then + AFailed.Add('i2d_DSAPublicKey'); + {$ifend} + end; + + + i2d_DSAPrivateKey := LoadLibFunction(ADllHandle, i2d_DSAPrivateKey_procname); + FuncLoadError := not assigned(i2d_DSAPrivateKey); + if FuncLoadError then + begin + {$if not defined(i2d_DSAPrivateKey_allownil)} + i2d_DSAPrivateKey := @ERR_i2d_DSAPrivateKey; + {$ifend} + {$if declared(i2d_DSAPrivateKey_introduced)} + if LibVersion < i2d_DSAPrivateKey_introduced then + begin + {$if declared(FC_i2d_DSAPrivateKey)} + i2d_DSAPrivateKey := @FC_i2d_DSAPrivateKey; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(i2d_DSAPrivateKey_removed)} + if i2d_DSAPrivateKey_removed <= LibVersion then + begin + {$if declared(_i2d_DSAPrivateKey)} + i2d_DSAPrivateKey := @_i2d_DSAPrivateKey; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(i2d_DSAPrivateKey_allownil)} + if FuncLoadError then + AFailed.Add('i2d_DSAPrivateKey'); + {$ifend} + end; + + + i2d_DSAparams := LoadLibFunction(ADllHandle, i2d_DSAparams_procname); + FuncLoadError := not assigned(i2d_DSAparams); + if FuncLoadError then + begin + {$if not defined(i2d_DSAparams_allownil)} + i2d_DSAparams := @ERR_i2d_DSAparams; + {$ifend} + {$if declared(i2d_DSAparams_introduced)} + if LibVersion < i2d_DSAparams_introduced then + begin + {$if declared(FC_i2d_DSAparams)} + i2d_DSAparams := @FC_i2d_DSAparams; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(i2d_DSAparams_removed)} + if i2d_DSAparams_removed <= LibVersion then + begin + {$if declared(_i2d_DSAparams)} + i2d_DSAparams := @_i2d_DSAparams; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(i2d_DSAparams_allownil)} + if FuncLoadError then + AFailed.Add('i2d_DSAparams'); + {$ifend} + end; + + + DSAparams_print := LoadLibFunction(ADllHandle, DSAparams_print_procname); + FuncLoadError := not assigned(DSAparams_print); + if FuncLoadError then + begin + {$if not defined(DSAparams_print_allownil)} + DSAparams_print := @ERR_DSAparams_print; + {$ifend} + {$if declared(DSAparams_print_introduced)} + if LibVersion < DSAparams_print_introduced then + begin + {$if declared(FC_DSAparams_print)} + DSAparams_print := @FC_DSAparams_print; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DSAparams_print_removed)} + if DSAparams_print_removed <= LibVersion then + begin + {$if declared(_DSAparams_print)} + DSAparams_print := @_DSAparams_print; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DSAparams_print_allownil)} + if FuncLoadError then + AFailed.Add('DSAparams_print'); + {$ifend} + end; + + + DSA_print := LoadLibFunction(ADllHandle, DSA_print_procname); + FuncLoadError := not assigned(DSA_print); + if FuncLoadError then + begin + {$if not defined(DSA_print_allownil)} + DSA_print := @ERR_DSA_print; + {$ifend} + {$if declared(DSA_print_introduced)} + if LibVersion < DSA_print_introduced then + begin + {$if declared(FC_DSA_print)} + DSA_print := @FC_DSA_print; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DSA_print_removed)} + if DSA_print_removed <= LibVersion then + begin + {$if declared(_DSA_print)} + DSA_print := @_DSA_print; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DSA_print_allownil)} + if FuncLoadError then + AFailed.Add('DSA_print'); + {$ifend} + end; + + + DSA_dup_DH := LoadLibFunction(ADllHandle, DSA_dup_DH_procname); + FuncLoadError := not assigned(DSA_dup_DH); + if FuncLoadError then + begin + {$if not defined(DSA_dup_DH_allownil)} + DSA_dup_DH := @ERR_DSA_dup_DH; + {$ifend} + {$if declared(DSA_dup_DH_introduced)} + if LibVersion < DSA_dup_DH_introduced then + begin + {$if declared(FC_DSA_dup_DH)} + DSA_dup_DH := @FC_DSA_dup_DH; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DSA_dup_DH_removed)} + if DSA_dup_DH_removed <= LibVersion then + begin + {$if declared(_DSA_dup_DH)} + DSA_dup_DH := @_DSA_dup_DH; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DSA_dup_DH_allownil)} + if FuncLoadError then + AFailed.Add('DSA_dup_DH'); + {$ifend} + end; + + + DSA_get0_pqg := LoadLibFunction(ADllHandle, DSA_get0_pqg_procname); + FuncLoadError := not assigned(DSA_get0_pqg); + if FuncLoadError then + begin + {$if not defined(DSA_get0_pqg_allownil)} + DSA_get0_pqg := @ERR_DSA_get0_pqg; + {$ifend} + {$if declared(DSA_get0_pqg_introduced)} + if LibVersion < DSA_get0_pqg_introduced then + begin + {$if declared(FC_DSA_get0_pqg)} + DSA_get0_pqg := @FC_DSA_get0_pqg; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DSA_get0_pqg_removed)} + if DSA_get0_pqg_removed <= LibVersion then + begin + {$if declared(_DSA_get0_pqg)} + DSA_get0_pqg := @_DSA_get0_pqg; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DSA_get0_pqg_allownil)} + if FuncLoadError then + AFailed.Add('DSA_get0_pqg'); + {$ifend} + end; + + + DSA_set0_pqg := LoadLibFunction(ADllHandle, DSA_set0_pqg_procname); + FuncLoadError := not assigned(DSA_set0_pqg); + if FuncLoadError then + begin + {$if not defined(DSA_set0_pqg_allownil)} + DSA_set0_pqg := @ERR_DSA_set0_pqg; + {$ifend} + {$if declared(DSA_set0_pqg_introduced)} + if LibVersion < DSA_set0_pqg_introduced then + begin + {$if declared(FC_DSA_set0_pqg)} + DSA_set0_pqg := @FC_DSA_set0_pqg; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DSA_set0_pqg_removed)} + if DSA_set0_pqg_removed <= LibVersion then + begin + {$if declared(_DSA_set0_pqg)} + DSA_set0_pqg := @_DSA_set0_pqg; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DSA_set0_pqg_allownil)} + if FuncLoadError then + AFailed.Add('DSA_set0_pqg'); + {$ifend} + end; + + + DSA_get0_key := LoadLibFunction(ADllHandle, DSA_get0_key_procname); + FuncLoadError := not assigned(DSA_get0_key); + if FuncLoadError then + begin + {$if not defined(DSA_get0_key_allownil)} + DSA_get0_key := @ERR_DSA_get0_key; + {$ifend} + {$if declared(DSA_get0_key_introduced)} + if LibVersion < DSA_get0_key_introduced then + begin + {$if declared(FC_DSA_get0_key)} + DSA_get0_key := @FC_DSA_get0_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DSA_get0_key_removed)} + if DSA_get0_key_removed <= LibVersion then + begin + {$if declared(_DSA_get0_key)} + DSA_get0_key := @_DSA_get0_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DSA_get0_key_allownil)} + if FuncLoadError then + AFailed.Add('DSA_get0_key'); + {$ifend} + end; + + + DSA_set0_key := LoadLibFunction(ADllHandle, DSA_set0_key_procname); + FuncLoadError := not assigned(DSA_set0_key); + if FuncLoadError then + begin + {$if not defined(DSA_set0_key_allownil)} + DSA_set0_key := @ERR_DSA_set0_key; + {$ifend} + {$if declared(DSA_set0_key_introduced)} + if LibVersion < DSA_set0_key_introduced then + begin + {$if declared(FC_DSA_set0_key)} + DSA_set0_key := @FC_DSA_set0_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DSA_set0_key_removed)} + if DSA_set0_key_removed <= LibVersion then + begin + {$if declared(_DSA_set0_key)} + DSA_set0_key := @_DSA_set0_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DSA_set0_key_allownil)} + if FuncLoadError then + AFailed.Add('DSA_set0_key'); + {$ifend} + end; + + + DSA_get0_p := LoadLibFunction(ADllHandle, DSA_get0_p_procname); + FuncLoadError := not assigned(DSA_get0_p); + if FuncLoadError then + begin + {$if not defined(DSA_get0_p_allownil)} + DSA_get0_p := @ERR_DSA_get0_p; + {$ifend} + {$if declared(DSA_get0_p_introduced)} + if LibVersion < DSA_get0_p_introduced then + begin + {$if declared(FC_DSA_get0_p)} + DSA_get0_p := @FC_DSA_get0_p; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DSA_get0_p_removed)} + if DSA_get0_p_removed <= LibVersion then + begin + {$if declared(_DSA_get0_p)} + DSA_get0_p := @_DSA_get0_p; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DSA_get0_p_allownil)} + if FuncLoadError then + AFailed.Add('DSA_get0_p'); + {$ifend} + end; + + + DSA_get0_q := LoadLibFunction(ADllHandle, DSA_get0_q_procname); + FuncLoadError := not assigned(DSA_get0_q); + if FuncLoadError then + begin + {$if not defined(DSA_get0_q_allownil)} + DSA_get0_q := @ERR_DSA_get0_q; + {$ifend} + {$if declared(DSA_get0_q_introduced)} + if LibVersion < DSA_get0_q_introduced then + begin + {$if declared(FC_DSA_get0_q)} + DSA_get0_q := @FC_DSA_get0_q; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DSA_get0_q_removed)} + if DSA_get0_q_removed <= LibVersion then + begin + {$if declared(_DSA_get0_q)} + DSA_get0_q := @_DSA_get0_q; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DSA_get0_q_allownil)} + if FuncLoadError then + AFailed.Add('DSA_get0_q'); + {$ifend} + end; + + + DSA_get0_g := LoadLibFunction(ADllHandle, DSA_get0_g_procname); + FuncLoadError := not assigned(DSA_get0_g); + if FuncLoadError then + begin + {$if not defined(DSA_get0_g_allownil)} + DSA_get0_g := @ERR_DSA_get0_g; + {$ifend} + {$if declared(DSA_get0_g_introduced)} + if LibVersion < DSA_get0_g_introduced then + begin + {$if declared(FC_DSA_get0_g)} + DSA_get0_g := @FC_DSA_get0_g; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DSA_get0_g_removed)} + if DSA_get0_g_removed <= LibVersion then + begin + {$if declared(_DSA_get0_g)} + DSA_get0_g := @_DSA_get0_g; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DSA_get0_g_allownil)} + if FuncLoadError then + AFailed.Add('DSA_get0_g'); + {$ifend} + end; + + + DSA_get0_pub_key := LoadLibFunction(ADllHandle, DSA_get0_pub_key_procname); + FuncLoadError := not assigned(DSA_get0_pub_key); + if FuncLoadError then + begin + {$if not defined(DSA_get0_pub_key_allownil)} + DSA_get0_pub_key := @ERR_DSA_get0_pub_key; + {$ifend} + {$if declared(DSA_get0_pub_key_introduced)} + if LibVersion < DSA_get0_pub_key_introduced then + begin + {$if declared(FC_DSA_get0_pub_key)} + DSA_get0_pub_key := @FC_DSA_get0_pub_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DSA_get0_pub_key_removed)} + if DSA_get0_pub_key_removed <= LibVersion then + begin + {$if declared(_DSA_get0_pub_key)} + DSA_get0_pub_key := @_DSA_get0_pub_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DSA_get0_pub_key_allownil)} + if FuncLoadError then + AFailed.Add('DSA_get0_pub_key'); + {$ifend} + end; + + + DSA_get0_priv_key := LoadLibFunction(ADllHandle, DSA_get0_priv_key_procname); + FuncLoadError := not assigned(DSA_get0_priv_key); + if FuncLoadError then + begin + {$if not defined(DSA_get0_priv_key_allownil)} + DSA_get0_priv_key := @ERR_DSA_get0_priv_key; + {$ifend} + {$if declared(DSA_get0_priv_key_introduced)} + if LibVersion < DSA_get0_priv_key_introduced then + begin + {$if declared(FC_DSA_get0_priv_key)} + DSA_get0_priv_key := @FC_DSA_get0_priv_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DSA_get0_priv_key_removed)} + if DSA_get0_priv_key_removed <= LibVersion then + begin + {$if declared(_DSA_get0_priv_key)} + DSA_get0_priv_key := @_DSA_get0_priv_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DSA_get0_priv_key_allownil)} + if FuncLoadError then + AFailed.Add('DSA_get0_priv_key'); + {$ifend} + end; + + + DSA_clear_flags := LoadLibFunction(ADllHandle, DSA_clear_flags_procname); + FuncLoadError := not assigned(DSA_clear_flags); + if FuncLoadError then + begin + {$if not defined(DSA_clear_flags_allownil)} + DSA_clear_flags := @ERR_DSA_clear_flags; + {$ifend} + {$if declared(DSA_clear_flags_introduced)} + if LibVersion < DSA_clear_flags_introduced then + begin + {$if declared(FC_DSA_clear_flags)} + DSA_clear_flags := @FC_DSA_clear_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DSA_clear_flags_removed)} + if DSA_clear_flags_removed <= LibVersion then + begin + {$if declared(_DSA_clear_flags)} + DSA_clear_flags := @_DSA_clear_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DSA_clear_flags_allownil)} + if FuncLoadError then + AFailed.Add('DSA_clear_flags'); + {$ifend} + end; + + + DSA_test_flags := LoadLibFunction(ADllHandle, DSA_test_flags_procname); + FuncLoadError := not assigned(DSA_test_flags); + if FuncLoadError then + begin + {$if not defined(DSA_test_flags_allownil)} + DSA_test_flags := @ERR_DSA_test_flags; + {$ifend} + {$if declared(DSA_test_flags_introduced)} + if LibVersion < DSA_test_flags_introduced then + begin + {$if declared(FC_DSA_test_flags)} + DSA_test_flags := @FC_DSA_test_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DSA_test_flags_removed)} + if DSA_test_flags_removed <= LibVersion then + begin + {$if declared(_DSA_test_flags)} + DSA_test_flags := @_DSA_test_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DSA_test_flags_allownil)} + if FuncLoadError then + AFailed.Add('DSA_test_flags'); + {$ifend} + end; + + + DSA_set_flags := LoadLibFunction(ADllHandle, DSA_set_flags_procname); + FuncLoadError := not assigned(DSA_set_flags); + if FuncLoadError then + begin + {$if not defined(DSA_set_flags_allownil)} + DSA_set_flags := @ERR_DSA_set_flags; + {$ifend} + {$if declared(DSA_set_flags_introduced)} + if LibVersion < DSA_set_flags_introduced then + begin + {$if declared(FC_DSA_set_flags)} + DSA_set_flags := @FC_DSA_set_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DSA_set_flags_removed)} + if DSA_set_flags_removed <= LibVersion then + begin + {$if declared(_DSA_set_flags)} + DSA_set_flags := @_DSA_set_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DSA_set_flags_allownil)} + if FuncLoadError then + AFailed.Add('DSA_set_flags'); + {$ifend} + end; + + + DSA_get0_engine := LoadLibFunction(ADllHandle, DSA_get0_engine_procname); + FuncLoadError := not assigned(DSA_get0_engine); + if FuncLoadError then + begin + {$if not defined(DSA_get0_engine_allownil)} + DSA_get0_engine := @ERR_DSA_get0_engine; + {$ifend} + {$if declared(DSA_get0_engine_introduced)} + if LibVersion < DSA_get0_engine_introduced then + begin + {$if declared(FC_DSA_get0_engine)} + DSA_get0_engine := @FC_DSA_get0_engine; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DSA_get0_engine_removed)} + if DSA_get0_engine_removed <= LibVersion then + begin + {$if declared(_DSA_get0_engine)} + DSA_get0_engine := @_DSA_get0_engine; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DSA_get0_engine_allownil)} + if FuncLoadError then + AFailed.Add('DSA_get0_engine'); + {$ifend} + end; + + + DSA_meth_new := LoadLibFunction(ADllHandle, DSA_meth_new_procname); + FuncLoadError := not assigned(DSA_meth_new); + if FuncLoadError then + begin + {$if not defined(DSA_meth_new_allownil)} + DSA_meth_new := @ERR_DSA_meth_new; + {$ifend} + {$if declared(DSA_meth_new_introduced)} + if LibVersion < DSA_meth_new_introduced then + begin + {$if declared(FC_DSA_meth_new)} + DSA_meth_new := @FC_DSA_meth_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DSA_meth_new_removed)} + if DSA_meth_new_removed <= LibVersion then + begin + {$if declared(_DSA_meth_new)} + DSA_meth_new := @_DSA_meth_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DSA_meth_new_allownil)} + if FuncLoadError then + AFailed.Add('DSA_meth_new'); + {$ifend} + end; + + + DSA_meth_free := LoadLibFunction(ADllHandle, DSA_meth_free_procname); + FuncLoadError := not assigned(DSA_meth_free); + if FuncLoadError then + begin + {$if not defined(DSA_meth_free_allownil)} + DSA_meth_free := @ERR_DSA_meth_free; + {$ifend} + {$if declared(DSA_meth_free_introduced)} + if LibVersion < DSA_meth_free_introduced then + begin + {$if declared(FC_DSA_meth_free)} + DSA_meth_free := @FC_DSA_meth_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DSA_meth_free_removed)} + if DSA_meth_free_removed <= LibVersion then + begin + {$if declared(_DSA_meth_free)} + DSA_meth_free := @_DSA_meth_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DSA_meth_free_allownil)} + if FuncLoadError then + AFailed.Add('DSA_meth_free'); + {$ifend} + end; + + + DSA_meth_dup := LoadLibFunction(ADllHandle, DSA_meth_dup_procname); + FuncLoadError := not assigned(DSA_meth_dup); + if FuncLoadError then + begin + {$if not defined(DSA_meth_dup_allownil)} + DSA_meth_dup := @ERR_DSA_meth_dup; + {$ifend} + {$if declared(DSA_meth_dup_introduced)} + if LibVersion < DSA_meth_dup_introduced then + begin + {$if declared(FC_DSA_meth_dup)} + DSA_meth_dup := @FC_DSA_meth_dup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DSA_meth_dup_removed)} + if DSA_meth_dup_removed <= LibVersion then + begin + {$if declared(_DSA_meth_dup)} + DSA_meth_dup := @_DSA_meth_dup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DSA_meth_dup_allownil)} + if FuncLoadError then + AFailed.Add('DSA_meth_dup'); + {$ifend} + end; + + + DSA_meth_get0_name := LoadLibFunction(ADllHandle, DSA_meth_get0_name_procname); + FuncLoadError := not assigned(DSA_meth_get0_name); + if FuncLoadError then + begin + {$if not defined(DSA_meth_get0_name_allownil)} + DSA_meth_get0_name := @ERR_DSA_meth_get0_name; + {$ifend} + {$if declared(DSA_meth_get0_name_introduced)} + if LibVersion < DSA_meth_get0_name_introduced then + begin + {$if declared(FC_DSA_meth_get0_name)} + DSA_meth_get0_name := @FC_DSA_meth_get0_name; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DSA_meth_get0_name_removed)} + if DSA_meth_get0_name_removed <= LibVersion then + begin + {$if declared(_DSA_meth_get0_name)} + DSA_meth_get0_name := @_DSA_meth_get0_name; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DSA_meth_get0_name_allownil)} + if FuncLoadError then + AFailed.Add('DSA_meth_get0_name'); + {$ifend} + end; + + + DSA_meth_set1_name := LoadLibFunction(ADllHandle, DSA_meth_set1_name_procname); + FuncLoadError := not assigned(DSA_meth_set1_name); + if FuncLoadError then + begin + {$if not defined(DSA_meth_set1_name_allownil)} + DSA_meth_set1_name := @ERR_DSA_meth_set1_name; + {$ifend} + {$if declared(DSA_meth_set1_name_introduced)} + if LibVersion < DSA_meth_set1_name_introduced then + begin + {$if declared(FC_DSA_meth_set1_name)} + DSA_meth_set1_name := @FC_DSA_meth_set1_name; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DSA_meth_set1_name_removed)} + if DSA_meth_set1_name_removed <= LibVersion then + begin + {$if declared(_DSA_meth_set1_name)} + DSA_meth_set1_name := @_DSA_meth_set1_name; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DSA_meth_set1_name_allownil)} + if FuncLoadError then + AFailed.Add('DSA_meth_set1_name'); + {$ifend} + end; + + + DSA_meth_get_flags := LoadLibFunction(ADllHandle, DSA_meth_get_flags_procname); + FuncLoadError := not assigned(DSA_meth_get_flags); + if FuncLoadError then + begin + {$if not defined(DSA_meth_get_flags_allownil)} + DSA_meth_get_flags := @ERR_DSA_meth_get_flags; + {$ifend} + {$if declared(DSA_meth_get_flags_introduced)} + if LibVersion < DSA_meth_get_flags_introduced then + begin + {$if declared(FC_DSA_meth_get_flags)} + DSA_meth_get_flags := @FC_DSA_meth_get_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DSA_meth_get_flags_removed)} + if DSA_meth_get_flags_removed <= LibVersion then + begin + {$if declared(_DSA_meth_get_flags)} + DSA_meth_get_flags := @_DSA_meth_get_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DSA_meth_get_flags_allownil)} + if FuncLoadError then + AFailed.Add('DSA_meth_get_flags'); + {$ifend} + end; + + + DSA_meth_set_flags := LoadLibFunction(ADllHandle, DSA_meth_set_flags_procname); + FuncLoadError := not assigned(DSA_meth_set_flags); + if FuncLoadError then + begin + {$if not defined(DSA_meth_set_flags_allownil)} + DSA_meth_set_flags := @ERR_DSA_meth_set_flags; + {$ifend} + {$if declared(DSA_meth_set_flags_introduced)} + if LibVersion < DSA_meth_set_flags_introduced then + begin + {$if declared(FC_DSA_meth_set_flags)} + DSA_meth_set_flags := @FC_DSA_meth_set_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DSA_meth_set_flags_removed)} + if DSA_meth_set_flags_removed <= LibVersion then + begin + {$if declared(_DSA_meth_set_flags)} + DSA_meth_set_flags := @_DSA_meth_set_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DSA_meth_set_flags_allownil)} + if FuncLoadError then + AFailed.Add('DSA_meth_set_flags'); + {$ifend} + end; + + + DSA_meth_get0_app_data := LoadLibFunction(ADllHandle, DSA_meth_get0_app_data_procname); + FuncLoadError := not assigned(DSA_meth_get0_app_data); + if FuncLoadError then + begin + {$if not defined(DSA_meth_get0_app_data_allownil)} + DSA_meth_get0_app_data := @ERR_DSA_meth_get0_app_data; + {$ifend} + {$if declared(DSA_meth_get0_app_data_introduced)} + if LibVersion < DSA_meth_get0_app_data_introduced then + begin + {$if declared(FC_DSA_meth_get0_app_data)} + DSA_meth_get0_app_data := @FC_DSA_meth_get0_app_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DSA_meth_get0_app_data_removed)} + if DSA_meth_get0_app_data_removed <= LibVersion then + begin + {$if declared(_DSA_meth_get0_app_data)} + DSA_meth_get0_app_data := @_DSA_meth_get0_app_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DSA_meth_get0_app_data_allownil)} + if FuncLoadError then + AFailed.Add('DSA_meth_get0_app_data'); + {$ifend} + end; + + + DSA_meth_set0_app_data := LoadLibFunction(ADllHandle, DSA_meth_set0_app_data_procname); + FuncLoadError := not assigned(DSA_meth_set0_app_data); + if FuncLoadError then + begin + {$if not defined(DSA_meth_set0_app_data_allownil)} + DSA_meth_set0_app_data := @ERR_DSA_meth_set0_app_data; + {$ifend} + {$if declared(DSA_meth_set0_app_data_introduced)} + if LibVersion < DSA_meth_set0_app_data_introduced then + begin + {$if declared(FC_DSA_meth_set0_app_data)} + DSA_meth_set0_app_data := @FC_DSA_meth_set0_app_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DSA_meth_set0_app_data_removed)} + if DSA_meth_set0_app_data_removed <= LibVersion then + begin + {$if declared(_DSA_meth_set0_app_data)} + DSA_meth_set0_app_data := @_DSA_meth_set0_app_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DSA_meth_set0_app_data_allownil)} + if FuncLoadError then + AFailed.Add('DSA_meth_set0_app_data'); + {$ifend} + end; + + + DSA_meth_get_sign := LoadLibFunction(ADllHandle, DSA_meth_get_sign_procname); + FuncLoadError := not assigned(DSA_meth_get_sign); + if FuncLoadError then + begin + {$if not defined(DSA_meth_get_sign_allownil)} + DSA_meth_get_sign := @ERR_DSA_meth_get_sign; + {$ifend} + {$if declared(DSA_meth_get_sign_introduced)} + if LibVersion < DSA_meth_get_sign_introduced then + begin + {$if declared(FC_DSA_meth_get_sign)} + DSA_meth_get_sign := @FC_DSA_meth_get_sign; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DSA_meth_get_sign_removed)} + if DSA_meth_get_sign_removed <= LibVersion then + begin + {$if declared(_DSA_meth_get_sign)} + DSA_meth_get_sign := @_DSA_meth_get_sign; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DSA_meth_get_sign_allownil)} + if FuncLoadError then + AFailed.Add('DSA_meth_get_sign'); + {$ifend} + end; + + + DSA_meth_set_sign := LoadLibFunction(ADllHandle, DSA_meth_set_sign_procname); + FuncLoadError := not assigned(DSA_meth_set_sign); + if FuncLoadError then + begin + {$if not defined(DSA_meth_set_sign_allownil)} + DSA_meth_set_sign := @ERR_DSA_meth_set_sign; + {$ifend} + {$if declared(DSA_meth_set_sign_introduced)} + if LibVersion < DSA_meth_set_sign_introduced then + begin + {$if declared(FC_DSA_meth_set_sign)} + DSA_meth_set_sign := @FC_DSA_meth_set_sign; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DSA_meth_set_sign_removed)} + if DSA_meth_set_sign_removed <= LibVersion then + begin + {$if declared(_DSA_meth_set_sign)} + DSA_meth_set_sign := @_DSA_meth_set_sign; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DSA_meth_set_sign_allownil)} + if FuncLoadError then + AFailed.Add('DSA_meth_set_sign'); + {$ifend} + end; + + + DSA_meth_get_sign_setup := LoadLibFunction(ADllHandle, DSA_meth_get_sign_setup_procname); + FuncLoadError := not assigned(DSA_meth_get_sign_setup); + if FuncLoadError then + begin + {$if not defined(DSA_meth_get_sign_setup_allownil)} + DSA_meth_get_sign_setup := @ERR_DSA_meth_get_sign_setup; + {$ifend} + {$if declared(DSA_meth_get_sign_setup_introduced)} + if LibVersion < DSA_meth_get_sign_setup_introduced then + begin + {$if declared(FC_DSA_meth_get_sign_setup)} + DSA_meth_get_sign_setup := @FC_DSA_meth_get_sign_setup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DSA_meth_get_sign_setup_removed)} + if DSA_meth_get_sign_setup_removed <= LibVersion then + begin + {$if declared(_DSA_meth_get_sign_setup)} + DSA_meth_get_sign_setup := @_DSA_meth_get_sign_setup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DSA_meth_get_sign_setup_allownil)} + if FuncLoadError then + AFailed.Add('DSA_meth_get_sign_setup'); + {$ifend} + end; + + + DSA_meth_set_sign_setup := LoadLibFunction(ADllHandle, DSA_meth_set_sign_setup_procname); + FuncLoadError := not assigned(DSA_meth_set_sign_setup); + if FuncLoadError then + begin + {$if not defined(DSA_meth_set_sign_setup_allownil)} + DSA_meth_set_sign_setup := @ERR_DSA_meth_set_sign_setup; + {$ifend} + {$if declared(DSA_meth_set_sign_setup_introduced)} + if LibVersion < DSA_meth_set_sign_setup_introduced then + begin + {$if declared(FC_DSA_meth_set_sign_setup)} + DSA_meth_set_sign_setup := @FC_DSA_meth_set_sign_setup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DSA_meth_set_sign_setup_removed)} + if DSA_meth_set_sign_setup_removed <= LibVersion then + begin + {$if declared(_DSA_meth_set_sign_setup)} + DSA_meth_set_sign_setup := @_DSA_meth_set_sign_setup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DSA_meth_set_sign_setup_allownil)} + if FuncLoadError then + AFailed.Add('DSA_meth_set_sign_setup'); + {$ifend} + end; + + + DSA_meth_get_verify := LoadLibFunction(ADllHandle, DSA_meth_get_verify_procname); + FuncLoadError := not assigned(DSA_meth_get_verify); + if FuncLoadError then + begin + {$if not defined(DSA_meth_get_verify_allownil)} + DSA_meth_get_verify := @ERR_DSA_meth_get_verify; + {$ifend} + {$if declared(DSA_meth_get_verify_introduced)} + if LibVersion < DSA_meth_get_verify_introduced then + begin + {$if declared(FC_DSA_meth_get_verify)} + DSA_meth_get_verify := @FC_DSA_meth_get_verify; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DSA_meth_get_verify_removed)} + if DSA_meth_get_verify_removed <= LibVersion then + begin + {$if declared(_DSA_meth_get_verify)} + DSA_meth_get_verify := @_DSA_meth_get_verify; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DSA_meth_get_verify_allownil)} + if FuncLoadError then + AFailed.Add('DSA_meth_get_verify'); + {$ifend} + end; + + + DSA_meth_set_verify := LoadLibFunction(ADllHandle, DSA_meth_set_verify_procname); + FuncLoadError := not assigned(DSA_meth_set_verify); + if FuncLoadError then + begin + {$if not defined(DSA_meth_set_verify_allownil)} + DSA_meth_set_verify := @ERR_DSA_meth_set_verify; + {$ifend} + {$if declared(DSA_meth_set_verify_introduced)} + if LibVersion < DSA_meth_set_verify_introduced then + begin + {$if declared(FC_DSA_meth_set_verify)} + DSA_meth_set_verify := @FC_DSA_meth_set_verify; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DSA_meth_set_verify_removed)} + if DSA_meth_set_verify_removed <= LibVersion then + begin + {$if declared(_DSA_meth_set_verify)} + DSA_meth_set_verify := @_DSA_meth_set_verify; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DSA_meth_set_verify_allownil)} + if FuncLoadError then + AFailed.Add('DSA_meth_set_verify'); + {$ifend} + end; + + + DSA_meth_get_mod_exp := LoadLibFunction(ADllHandle, DSA_meth_get_mod_exp_procname); + FuncLoadError := not assigned(DSA_meth_get_mod_exp); + if FuncLoadError then + begin + {$if not defined(DSA_meth_get_mod_exp_allownil)} + DSA_meth_get_mod_exp := @ERR_DSA_meth_get_mod_exp; + {$ifend} + {$if declared(DSA_meth_get_mod_exp_introduced)} + if LibVersion < DSA_meth_get_mod_exp_introduced then + begin + {$if declared(FC_DSA_meth_get_mod_exp)} + DSA_meth_get_mod_exp := @FC_DSA_meth_get_mod_exp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DSA_meth_get_mod_exp_removed)} + if DSA_meth_get_mod_exp_removed <= LibVersion then + begin + {$if declared(_DSA_meth_get_mod_exp)} + DSA_meth_get_mod_exp := @_DSA_meth_get_mod_exp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DSA_meth_get_mod_exp_allownil)} + if FuncLoadError then + AFailed.Add('DSA_meth_get_mod_exp'); + {$ifend} + end; + + + DSA_meth_set_mod_exp := LoadLibFunction(ADllHandle, DSA_meth_set_mod_exp_procname); + FuncLoadError := not assigned(DSA_meth_set_mod_exp); + if FuncLoadError then + begin + {$if not defined(DSA_meth_set_mod_exp_allownil)} + DSA_meth_set_mod_exp := @ERR_DSA_meth_set_mod_exp; + {$ifend} + {$if declared(DSA_meth_set_mod_exp_introduced)} + if LibVersion < DSA_meth_set_mod_exp_introduced then + begin + {$if declared(FC_DSA_meth_set_mod_exp)} + DSA_meth_set_mod_exp := @FC_DSA_meth_set_mod_exp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DSA_meth_set_mod_exp_removed)} + if DSA_meth_set_mod_exp_removed <= LibVersion then + begin + {$if declared(_DSA_meth_set_mod_exp)} + DSA_meth_set_mod_exp := @_DSA_meth_set_mod_exp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DSA_meth_set_mod_exp_allownil)} + if FuncLoadError then + AFailed.Add('DSA_meth_set_mod_exp'); + {$ifend} + end; + + + DSA_meth_get_bn_mod_exp := LoadLibFunction(ADllHandle, DSA_meth_get_bn_mod_exp_procname); + FuncLoadError := not assigned(DSA_meth_get_bn_mod_exp); + if FuncLoadError then + begin + {$if not defined(DSA_meth_get_bn_mod_exp_allownil)} + DSA_meth_get_bn_mod_exp := @ERR_DSA_meth_get_bn_mod_exp; + {$ifend} + {$if declared(DSA_meth_get_bn_mod_exp_introduced)} + if LibVersion < DSA_meth_get_bn_mod_exp_introduced then + begin + {$if declared(FC_DSA_meth_get_bn_mod_exp)} + DSA_meth_get_bn_mod_exp := @FC_DSA_meth_get_bn_mod_exp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DSA_meth_get_bn_mod_exp_removed)} + if DSA_meth_get_bn_mod_exp_removed <= LibVersion then + begin + {$if declared(_DSA_meth_get_bn_mod_exp)} + DSA_meth_get_bn_mod_exp := @_DSA_meth_get_bn_mod_exp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DSA_meth_get_bn_mod_exp_allownil)} + if FuncLoadError then + AFailed.Add('DSA_meth_get_bn_mod_exp'); + {$ifend} + end; + + + DSA_meth_set_bn_mod_exp := LoadLibFunction(ADllHandle, DSA_meth_set_bn_mod_exp_procname); + FuncLoadError := not assigned(DSA_meth_set_bn_mod_exp); + if FuncLoadError then + begin + {$if not defined(DSA_meth_set_bn_mod_exp_allownil)} + DSA_meth_set_bn_mod_exp := @ERR_DSA_meth_set_bn_mod_exp; + {$ifend} + {$if declared(DSA_meth_set_bn_mod_exp_introduced)} + if LibVersion < DSA_meth_set_bn_mod_exp_introduced then + begin + {$if declared(FC_DSA_meth_set_bn_mod_exp)} + DSA_meth_set_bn_mod_exp := @FC_DSA_meth_set_bn_mod_exp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DSA_meth_set_bn_mod_exp_removed)} + if DSA_meth_set_bn_mod_exp_removed <= LibVersion then + begin + {$if declared(_DSA_meth_set_bn_mod_exp)} + DSA_meth_set_bn_mod_exp := @_DSA_meth_set_bn_mod_exp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DSA_meth_set_bn_mod_exp_allownil)} + if FuncLoadError then + AFailed.Add('DSA_meth_set_bn_mod_exp'); + {$ifend} + end; + + + DSA_meth_get_init := LoadLibFunction(ADllHandle, DSA_meth_get_init_procname); + FuncLoadError := not assigned(DSA_meth_get_init); + if FuncLoadError then + begin + {$if not defined(DSA_meth_get_init_allownil)} + DSA_meth_get_init := @ERR_DSA_meth_get_init; + {$ifend} + {$if declared(DSA_meth_get_init_introduced)} + if LibVersion < DSA_meth_get_init_introduced then + begin + {$if declared(FC_DSA_meth_get_init)} + DSA_meth_get_init := @FC_DSA_meth_get_init; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DSA_meth_get_init_removed)} + if DSA_meth_get_init_removed <= LibVersion then + begin + {$if declared(_DSA_meth_get_init)} + DSA_meth_get_init := @_DSA_meth_get_init; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DSA_meth_get_init_allownil)} + if FuncLoadError then + AFailed.Add('DSA_meth_get_init'); + {$ifend} + end; + + + DSA_meth_set_init := LoadLibFunction(ADllHandle, DSA_meth_set_init_procname); + FuncLoadError := not assigned(DSA_meth_set_init); + if FuncLoadError then + begin + {$if not defined(DSA_meth_set_init_allownil)} + DSA_meth_set_init := @ERR_DSA_meth_set_init; + {$ifend} + {$if declared(DSA_meth_set_init_introduced)} + if LibVersion < DSA_meth_set_init_introduced then + begin + {$if declared(FC_DSA_meth_set_init)} + DSA_meth_set_init := @FC_DSA_meth_set_init; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DSA_meth_set_init_removed)} + if DSA_meth_set_init_removed <= LibVersion then + begin + {$if declared(_DSA_meth_set_init)} + DSA_meth_set_init := @_DSA_meth_set_init; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DSA_meth_set_init_allownil)} + if FuncLoadError then + AFailed.Add('DSA_meth_set_init'); + {$ifend} + end; + + + DSA_meth_get_finish := LoadLibFunction(ADllHandle, DSA_meth_get_finish_procname); + FuncLoadError := not assigned(DSA_meth_get_finish); + if FuncLoadError then + begin + {$if not defined(DSA_meth_get_finish_allownil)} + DSA_meth_get_finish := @ERR_DSA_meth_get_finish; + {$ifend} + {$if declared(DSA_meth_get_finish_introduced)} + if LibVersion < DSA_meth_get_finish_introduced then + begin + {$if declared(FC_DSA_meth_get_finish)} + DSA_meth_get_finish := @FC_DSA_meth_get_finish; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DSA_meth_get_finish_removed)} + if DSA_meth_get_finish_removed <= LibVersion then + begin + {$if declared(_DSA_meth_get_finish)} + DSA_meth_get_finish := @_DSA_meth_get_finish; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DSA_meth_get_finish_allownil)} + if FuncLoadError then + AFailed.Add('DSA_meth_get_finish'); + {$ifend} + end; + + + DSA_meth_set_finish := LoadLibFunction(ADllHandle, DSA_meth_set_finish_procname); + FuncLoadError := not assigned(DSA_meth_set_finish); + if FuncLoadError then + begin + {$if not defined(DSA_meth_set_finish_allownil)} + DSA_meth_set_finish := @ERR_DSA_meth_set_finish; + {$ifend} + {$if declared(DSA_meth_set_finish_introduced)} + if LibVersion < DSA_meth_set_finish_introduced then + begin + {$if declared(FC_DSA_meth_set_finish)} + DSA_meth_set_finish := @FC_DSA_meth_set_finish; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DSA_meth_set_finish_removed)} + if DSA_meth_set_finish_removed <= LibVersion then + begin + {$if declared(_DSA_meth_set_finish)} + DSA_meth_set_finish := @_DSA_meth_set_finish; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DSA_meth_set_finish_allownil)} + if FuncLoadError then + AFailed.Add('DSA_meth_set_finish'); + {$ifend} + end; + + + DSA_meth_get_paramgen := LoadLibFunction(ADllHandle, DSA_meth_get_paramgen_procname); + FuncLoadError := not assigned(DSA_meth_get_paramgen); + if FuncLoadError then + begin + {$if not defined(DSA_meth_get_paramgen_allownil)} + DSA_meth_get_paramgen := @ERR_DSA_meth_get_paramgen; + {$ifend} + {$if declared(DSA_meth_get_paramgen_introduced)} + if LibVersion < DSA_meth_get_paramgen_introduced then + begin + {$if declared(FC_DSA_meth_get_paramgen)} + DSA_meth_get_paramgen := @FC_DSA_meth_get_paramgen; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DSA_meth_get_paramgen_removed)} + if DSA_meth_get_paramgen_removed <= LibVersion then + begin + {$if declared(_DSA_meth_get_paramgen)} + DSA_meth_get_paramgen := @_DSA_meth_get_paramgen; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DSA_meth_get_paramgen_allownil)} + if FuncLoadError then + AFailed.Add('DSA_meth_get_paramgen'); + {$ifend} + end; + + + DSA_meth_set_paramgen := LoadLibFunction(ADllHandle, DSA_meth_set_paramgen_procname); + FuncLoadError := not assigned(DSA_meth_set_paramgen); + if FuncLoadError then + begin + {$if not defined(DSA_meth_set_paramgen_allownil)} + DSA_meth_set_paramgen := @ERR_DSA_meth_set_paramgen; + {$ifend} + {$if declared(DSA_meth_set_paramgen_introduced)} + if LibVersion < DSA_meth_set_paramgen_introduced then + begin + {$if declared(FC_DSA_meth_set_paramgen)} + DSA_meth_set_paramgen := @FC_DSA_meth_set_paramgen; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DSA_meth_set_paramgen_removed)} + if DSA_meth_set_paramgen_removed <= LibVersion then + begin + {$if declared(_DSA_meth_set_paramgen)} + DSA_meth_set_paramgen := @_DSA_meth_set_paramgen; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DSA_meth_set_paramgen_allownil)} + if FuncLoadError then + AFailed.Add('DSA_meth_set_paramgen'); + {$ifend} + end; + + + DSA_meth_get_keygen := LoadLibFunction(ADllHandle, DSA_meth_get_keygen_procname); + FuncLoadError := not assigned(DSA_meth_get_keygen); + if FuncLoadError then + begin + {$if not defined(DSA_meth_get_keygen_allownil)} + DSA_meth_get_keygen := @ERR_DSA_meth_get_keygen; + {$ifend} + {$if declared(DSA_meth_get_keygen_introduced)} + if LibVersion < DSA_meth_get_keygen_introduced then + begin + {$if declared(FC_DSA_meth_get_keygen)} + DSA_meth_get_keygen := @FC_DSA_meth_get_keygen; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DSA_meth_get_keygen_removed)} + if DSA_meth_get_keygen_removed <= LibVersion then + begin + {$if declared(_DSA_meth_get_keygen)} + DSA_meth_get_keygen := @_DSA_meth_get_keygen; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DSA_meth_get_keygen_allownil)} + if FuncLoadError then + AFailed.Add('DSA_meth_get_keygen'); + {$ifend} + end; + + + DSA_meth_set_keygen := LoadLibFunction(ADllHandle, DSA_meth_set_keygen_procname); + FuncLoadError := not assigned(DSA_meth_set_keygen); + if FuncLoadError then + begin + {$if not defined(DSA_meth_set_keygen_allownil)} + DSA_meth_set_keygen := @ERR_DSA_meth_set_keygen; + {$ifend} + {$if declared(DSA_meth_set_keygen_introduced)} + if LibVersion < DSA_meth_set_keygen_introduced then + begin + {$if declared(FC_DSA_meth_set_keygen)} + DSA_meth_set_keygen := @FC_DSA_meth_set_keygen; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DSA_meth_set_keygen_removed)} + if DSA_meth_set_keygen_removed <= LibVersion then + begin + {$if declared(_DSA_meth_set_keygen)} + DSA_meth_set_keygen := @_DSA_meth_set_keygen; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DSA_meth_set_keygen_allownil)} + if FuncLoadError then + AFailed.Add('DSA_meth_set_keygen'); + {$ifend} + end; + + +end; + +procedure Unload; +begin + DSAparams_dup := nil; + DSA_SIG_new := nil; + DSA_SIG_free := nil; + i2d_DSA_SIG := nil; + d2i_DSA_SIG := nil; + DSA_SIG_get0 := nil; + DSA_SIG_set0 := nil; + DSA_do_sign := nil; + DSA_do_verify := nil; + DSA_OpenSSL := nil; + DSA_set_default_method := nil; + DSA_get_default_method := nil; + DSA_set_method := nil; + DSA_get_method := nil; + DSA_new := nil; + DSA_new_method := nil; + DSA_free := nil; + DSA_up_ref := nil; + DSA_size := nil; + DSA_bits := nil; + DSA_security_bits := nil; + DSA_sign := nil; + DSA_verify := nil; + DSA_set_ex_data := nil; + DSA_get_ex_data := nil; + d2i_DSAPublicKey := nil; + d2i_DSAPrivateKey := nil; + d2i_DSAparams := nil; + DSA_generate_parameters_ex := nil; + DSA_generate_key := nil; + i2d_DSAPublicKey := nil; + i2d_DSAPrivateKey := nil; + i2d_DSAparams := nil; + DSAparams_print := nil; + DSA_print := nil; + DSA_dup_DH := nil; + DSA_get0_pqg := nil; + DSA_set0_pqg := nil; + DSA_get0_key := nil; + DSA_set0_key := nil; + DSA_get0_p := nil; + DSA_get0_q := nil; + DSA_get0_g := nil; + DSA_get0_pub_key := nil; + DSA_get0_priv_key := nil; + DSA_clear_flags := nil; + DSA_test_flags := nil; + DSA_set_flags := nil; + DSA_get0_engine := nil; + DSA_meth_new := nil; + DSA_meth_free := nil; + DSA_meth_dup := nil; + DSA_meth_get0_name := nil; + DSA_meth_set1_name := nil; + DSA_meth_get_flags := nil; + DSA_meth_set_flags := nil; + DSA_meth_get0_app_data := nil; + DSA_meth_set0_app_data := nil; + DSA_meth_get_sign := nil; + DSA_meth_set_sign := nil; + DSA_meth_get_sign_setup := nil; + DSA_meth_set_sign_setup := nil; + DSA_meth_get_verify := nil; + DSA_meth_set_verify := nil; + DSA_meth_get_mod_exp := nil; + DSA_meth_set_mod_exp := nil; + DSA_meth_get_bn_mod_exp := nil; + DSA_meth_set_bn_mod_exp := nil; + DSA_meth_get_init := nil; + DSA_meth_set_init := nil; + DSA_meth_get_finish := nil; + DSA_meth_set_finish := nil; + DSA_meth_get_paramgen := nil; + DSA_meth_set_paramgen := nil; + DSA_meth_get_keygen := nil; + DSA_meth_set_keygen := nil; +end; +{$ELSE} +{$ENDIF} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +initialization + Register_SSLLoader(@Load,'LibCrypto'); + Register_SSLUnloader(@Unload); +{$ENDIF} +end. diff --git a/IdOpenSSLHeaders_dsaerr.pas b/IdOpenSSLHeaders_dsaerr.pas new file mode 100644 index 0000000..1d43788 --- /dev/null +++ b/IdOpenSSLHeaders_dsaerr.pas @@ -0,0 +1,184 @@ + (* This unit was generated using the script genOpenSSLHdrs.sh from the source file IdOpenSSLHeaders_dsaerr.h2pas + It should not be modified directly. All changes should be made to IdOpenSSLHeaders_dsaerr.h2pas + and this file regenerated. IdOpenSSLHeaders_dsaerr.h2pas is distributed with the full Indy + Distribution. + *) + +{$i IdCompilerDefines.inc} +{$i IdSSLOpenSSLDefines.inc} +{$IFNDEF USE_OPENSSL} + { error Should not compile if USE_OPENSSL is not defined!!!} +{$ENDIF} +{******************************************************************************} +{ } +{ Indy (Internet Direct) - Internet Protocols Simplified } +{ } +{ https://www.indyproject.org/ } +{ https://gitter.im/IndySockets/Indy } +{ } +{******************************************************************************} +{ } +{ This file is part of the Indy (Internet Direct) project, and is offered } +{ under the dual-licensing agreement described on the Indy website. } +{ (https://www.indyproject.org/license/) } +{ } +{ Copyright: } +{ (c) 1993-2020, Chad Z. Hower and the Indy Pit Crew. All rights reserved. } +{ } +{******************************************************************************} +{ } +{ } +{******************************************************************************} + +unit IdOpenSSLHeaders_dsaerr; + +interface + +// Headers for OpenSSL 1.1.1 +// dsaerr.h + + +uses + IdCTypes, + IdGlobal, + IdSSLOpenSSLConsts; + +const + ///* + // * DSA function codes. + // */ + DSA_F_DSAPARAMS_PRINT = 100; + DSA_F_DSAPARAMS_PRINT_FP = 101; + DSA_F_DSA_BUILTIN_PARAMGEN = 125; + DSA_F_DSA_BUILTIN_PARAMGEN2 = 126; + DSA_F_DSA_DO_SIGN = 112; + DSA_F_DSA_DO_VERIFY = 113; + DSA_F_DSA_METH_DUP = 127; + DSA_F_DSA_METH_NEW = 128; + DSA_F_DSA_METH_SET1_NAME = 129; + DSA_F_DSA_NEW_METHOD = 103; + DSA_F_DSA_PARAM_DECODE = 119; + DSA_F_DSA_PRINT_FP = 105; + DSA_F_DSA_PRIV_DECODE = 115; + DSA_F_DSA_PRIV_ENCODE = 116; + DSA_F_DSA_PUB_DECODE = 117; + DSA_F_DSA_PUB_ENCODE = 118; + DSA_F_DSA_SIGN = 106; + DSA_F_DSA_SIGN_SETUP = 107; + DSA_F_DSA_SIG_NEW = 102; + DSA_F_OLD_DSA_PRIV_DECODE = 122; + DSA_F_PKEY_DSA_CTRL = 120; + DSA_F_PKEY_DSA_CTRL_STR = 104; + DSA_F_PKEY_DSA_KEYGEN = 121; + + ///* + // * DSA reason codes. + // */ + DSA_R_BAD_Q_VALUE = 102; + DSA_R_BN_DECODE_ERROR = 108; + DSA_R_BN_ERROR = 109; + DSA_R_DECODE_ERROR = 104; + DSA_R_INVALID_DIGEST_TYPE = 106; + DSA_R_INVALID_PARAMETERS = 112; + DSA_R_MISSING_PARAMETERS = 101; + DSA_R_MISSING_PRIVATE_KEY = 111; + DSA_R_MODULUS_TOO_LARGE = 103; + DSA_R_NO_PARAMETERS_SET = 107; + DSA_R_PARAMETER_ENCODING_ERROR = 105; + DSA_R_Q_NOT_PRIME = 113; + DSA_R_SEED_LEN_SMALL = 110; + + { The EXTERNALSYM directive is ignored by FPC, however, it is used by Delphi as follows: + + The EXTERNALSYM directive prevents the specified Delphi symbol from appearing in header + files generated for C++. } + + {$EXTERNALSYM ERR_load_DSA_strings} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +var + ERR_load_DSA_strings: function : TIdC_INT; cdecl = nil; + +{$ELSE} + function ERR_load_DSA_strings: TIdC_INT cdecl; external CLibCrypto; + +{$ENDIF} + +implementation + + uses + classes, + IdSSLOpenSSLExceptionHandlers, + IdResourceStringsOpenSSL + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + ,IdSSLOpenSSLLoader + {$ENDIF}; + + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +const + ERR_load_DSA_strings_procname = 'ERR_load_DSA_strings'; + + +{$WARN NO_RETVAL OFF} +function ERR_ERR_load_DSA_strings: TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ERR_load_DSA_strings_procname); +end; + + + +{$WARN NO_RETVAL ON} + +procedure Load(const ADllHandle: TIdLibHandle; LibVersion: TIdC_UINT; const AFailed: TStringList); + +var FuncLoadError: boolean; + +begin + ERR_load_DSA_strings := LoadLibFunction(ADllHandle, ERR_load_DSA_strings_procname); + FuncLoadError := not assigned(ERR_load_DSA_strings); + if FuncLoadError then + begin + {$if not defined(ERR_load_DSA_strings_allownil)} + ERR_load_DSA_strings := @ERR_ERR_load_DSA_strings; + {$ifend} + {$if declared(ERR_load_DSA_strings_introduced)} + if LibVersion < ERR_load_DSA_strings_introduced then + begin + {$if declared(FC_ERR_load_DSA_strings)} + ERR_load_DSA_strings := @FC_ERR_load_DSA_strings; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ERR_load_DSA_strings_removed)} + if ERR_load_DSA_strings_removed <= LibVersion then + begin + {$if declared(_ERR_load_DSA_strings)} + ERR_load_DSA_strings := @_ERR_load_DSA_strings; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ERR_load_DSA_strings_allownil)} + if FuncLoadError then + AFailed.Add('ERR_load_DSA_strings'); + {$ifend} + end; + + +end; + +procedure Unload; +begin + ERR_load_DSA_strings := nil; +end; +{$ELSE} +{$ENDIF} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +initialization + Register_SSLLoader(@Load,'LibCrypto'); + Register_SSLUnloader(@Unload); +{$ENDIF} +end. diff --git a/IdOpenSSLHeaders_ebcdic.pas b/IdOpenSSLHeaders_ebcdic.pas new file mode 100644 index 0000000..0cd0e62 --- /dev/null +++ b/IdOpenSSLHeaders_ebcdic.pas @@ -0,0 +1,186 @@ + (* This unit was generated using the script genOpenSSLHdrs.sh from the source file IdOpenSSLHeaders_ebcdic.h2pas + It should not be modified directly. All changes should be made to IdOpenSSLHeaders_ebcdic.h2pas + and this file regenerated. IdOpenSSLHeaders_ebcdic.h2pas is distributed with the full Indy + Distribution. + *) + +{$i IdCompilerDefines.inc} +{$i IdSSLOpenSSLDefines.inc} +{$IFNDEF USE_OPENSSL} + { error Should not compile if USE_OPENSSL is not defined!!!} +{$ENDIF} +{******************************************************************************} +{ } +{ Indy (Internet Direct) - Internet Protocols Simplified } +{ } +{ https://www.indyproject.org/ } +{ https://gitter.im/IndySockets/Indy } +{ } +{******************************************************************************} +{ } +{ This file is part of the Indy (Internet Direct) project, and is offered } +{ under the dual-licensing agreement described on the Indy website. } +{ (https://www.indyproject.org/license/) } +{ } +{ Copyright: } +{ (c) 1993-2020, Chad Z. Hower and the Indy Pit Crew. All rights reserved. } +{ } +{******************************************************************************} +{ } +{ } +{******************************************************************************} + +unit IdOpenSSLHeaders_ebcdic; + +interface + +// Headers for OpenSSL 1.1.1 +// ebcdic.h + + +uses + IdCTypes, + IdGlobal, + IdSSLOpenSSLConsts; + + + //extern const unsigned char os_toascii[256]; + //extern const unsigned char os_toebcdic[256]; + + { The EXTERNALSYM directive is ignored by FPC, however, it is used by Delphi as follows: + + The EXTERNALSYM directive prevents the specified Delphi symbol from appearing in header + files generated for C++. } + + {$EXTERNALSYM ebcdic2ascii} + {$EXTERNALSYM ascii2ebcdic} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +var + ebcdic2ascii: function (dest: Pointer; const srce: Pointer; count: TIdC_SIZET): Pointer; cdecl = nil; + ascii2ebcdic: function (dest: Pointer; const srce: Pointer; count: TIdC_SIZET): Pointer; cdecl = nil; + +{$ELSE} + function ebcdic2ascii(dest: Pointer; const srce: Pointer; count: TIdC_SIZET): Pointer cdecl; external CLibCrypto; + function ascii2ebcdic(dest: Pointer; const srce: Pointer; count: TIdC_SIZET): Pointer cdecl; external CLibCrypto; + +{$ENDIF} + +implementation + + uses + classes, + IdSSLOpenSSLExceptionHandlers, + IdResourceStringsOpenSSL + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + ,IdSSLOpenSSLLoader + {$ENDIF}; + + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +const + ebcdic2ascii_procname = 'ebcdic2ascii'; + ascii2ebcdic_procname = 'ascii2ebcdic'; + + +{$WARN NO_RETVAL OFF} +function ERR_ebcdic2ascii(dest: Pointer; const srce: Pointer; count: TIdC_SIZET): Pointer; +begin + EIdAPIFunctionNotPresent.RaiseException(ebcdic2ascii_procname); +end; + + +function ERR_ascii2ebcdic(dest: Pointer; const srce: Pointer; count: TIdC_SIZET): Pointer; +begin + EIdAPIFunctionNotPresent.RaiseException(ascii2ebcdic_procname); +end; + + + +{$WARN NO_RETVAL ON} + +procedure Load(const ADllHandle: TIdLibHandle; LibVersion: TIdC_UINT; const AFailed: TStringList); + +var FuncLoadError: boolean; + +begin + ebcdic2ascii := LoadLibFunction(ADllHandle, ebcdic2ascii_procname); + FuncLoadError := not assigned(ebcdic2ascii); + if FuncLoadError then + begin + {$if not defined(ebcdic2ascii_allownil)} + ebcdic2ascii := @ERR_ebcdic2ascii; + {$ifend} + {$if declared(ebcdic2ascii_introduced)} + if LibVersion < ebcdic2ascii_introduced then + begin + {$if declared(FC_ebcdic2ascii)} + ebcdic2ascii := @FC_ebcdic2ascii; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ebcdic2ascii_removed)} + if ebcdic2ascii_removed <= LibVersion then + begin + {$if declared(_ebcdic2ascii)} + ebcdic2ascii := @_ebcdic2ascii; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ebcdic2ascii_allownil)} + if FuncLoadError then + AFailed.Add('ebcdic2ascii'); + {$ifend} + end; + + + ascii2ebcdic := LoadLibFunction(ADllHandle, ascii2ebcdic_procname); + FuncLoadError := not assigned(ascii2ebcdic); + if FuncLoadError then + begin + {$if not defined(ascii2ebcdic_allownil)} + ascii2ebcdic := @ERR_ascii2ebcdic; + {$ifend} + {$if declared(ascii2ebcdic_introduced)} + if LibVersion < ascii2ebcdic_introduced then + begin + {$if declared(FC_ascii2ebcdic)} + ascii2ebcdic := @FC_ascii2ebcdic; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ascii2ebcdic_removed)} + if ascii2ebcdic_removed <= LibVersion then + begin + {$if declared(_ascii2ebcdic)} + ascii2ebcdic := @_ascii2ebcdic; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ascii2ebcdic_allownil)} + if FuncLoadError then + AFailed.Add('ascii2ebcdic'); + {$ifend} + end; + + +end; + +procedure Unload; +begin + ebcdic2ascii := nil; + ascii2ebcdic := nil; +end; +{$ELSE} +{$ENDIF} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +initialization + Register_SSLLoader(@Load,'LibCrypto'); + Register_SSLUnloader(@Unload); +{$ENDIF} +end. diff --git a/IdOpenSSLHeaders_ec.pas b/IdOpenSSLHeaders_ec.pas new file mode 100644 index 0000000..c5ddcd3 --- /dev/null +++ b/IdOpenSSLHeaders_ec.pas @@ -0,0 +1,7877 @@ + (* This unit was generated using the script genOpenSSLHdrs.sh from the source file IdOpenSSLHeaders_ec.h2pas + It should not be modified directly. All changes should be made to IdOpenSSLHeaders_ec.h2pas + and this file regenerated. IdOpenSSLHeaders_ec.h2pas is distributed with the full Indy + Distribution. + *) + +{$i IdCompilerDefines.inc} +{$i IdSSLOpenSSLDefines.inc} +{$IFNDEF USE_OPENSSL} + { error Should not compile if USE_OPENSSL is not defined!!!} +{$ENDIF} +{******************************************************************************} +{ } +{ Indy (Internet Direct) - Internet Protocols Simplified } +{ } +{ https://www.indyproject.org/ } +{ https://gitter.im/IndySockets/Indy } +{ } +{******************************************************************************} +{ } +{ This file is part of the Indy (Internet Direct) project, and is offered } +{ under the dual-licensing agreement described on the Indy website. } +{ (https://www.indyproject.org/license/) } +{ } +{ Copyright: } +{ (c) 1993-2020, Chad Z. Hower and the Indy Pit Crew. All rights reserved. } +{ } +{******************************************************************************} +{ } +{ } +{******************************************************************************} + +unit IdOpenSSLHeaders_ec; + +interface + +// Headers for OpenSSL 1.1.1 +// ec.h + + +uses + IdCTypes, + IdGlobal, + IdSSLOpenSSLConsts, + IdOpenSSLHeaders_ossl_typ, + IdOpenSSLHeaders_evp; + +const + OPENSSL_EC_EXPLICIT_CURVE = $000; + OPENSSL_EC_NAMED_CURVE = $001; + EC_PKEY_NO_PARAMETERS = $001; + EC_PKEY_NO_PUBKEY = $002; + EC_FLAG_NON_FIPS_ALLOW = $1; + EC_FLAG_FIPS_CHECKED = $2; + EC_FLAG_COFACTOR_ECDH = $1000; + EVP_PKEY_CTRL_EC_PARAMGEN_CURVE_NID = (EVP_PKEY_ALG_CTRL + 1); + EVP_PKEY_CTRL_EC_PARAM_ENC = (EVP_PKEY_ALG_CTRL + 2); + EVP_PKEY_CTRL_EC_ECDH_COFACTOR = (EVP_PKEY_ALG_CTRL + 3); + EVP_PKEY_CTRL_EC_KDF_TYPE = (EVP_PKEY_ALG_CTRL + 4); + EVP_PKEY_CTRL_EC_KDF_MD = (EVP_PKEY_ALG_CTRL + 5); + EVP_PKEY_CTRL_GET_EC_KDF_MD = (EVP_PKEY_ALG_CTRL + 6); + EVP_PKEY_CTRL_EC_KDF_OUTLEN = (EVP_PKEY_ALG_CTRL + 7); + EVP_PKEY_CTRL_GET_EC_KDF_OUTLEN = (EVP_PKEY_ALG_CTRL + 8); + EVP_PKEY_CTRL_EC_KDF_UKM = (EVP_PKEY_ALG_CTRL + 9); + EVP_PKEY_CTRL_GET_EC_KDF_UKM = (EVP_PKEY_ALG_CTRL + 10); + EVP_PKEY_CTRL_SET1_ID = (EVP_PKEY_ALG_CTRL + 11); + EVP_PKEY_CTRL_GET1_ID = (EVP_PKEY_ALG_CTRL + 12); + EVP_PKEY_CTRL_GET1_ID_LEN = (EVP_PKEY_ALG_CTRL + 13); + EVP_PKEY_ECDH_KDF_NONE = 1; + EVP_PKEY_ECDH_KDF_X9_63 = 2; + EVP_PKEY_ECDH_KDF_X9_62 = EVP_PKEY_ECDH_KDF_X9_63; + +type + {$MINENUMSIZE 4} + point_conversion_form_t = ( + POINT_CONVERSION_COMPRESSED = 2, + POINT_CONVERSION_UNCOMPRESSED = 4, + POINT_CONVERSION_HYBRID = 6 + ); + + EC_METHOD = type Pointer; // ec_method_st + PEC_METHOD = ^EC_METHOD; + + EC_GROUP = type Pointer; // ec_group_st + PEC_GROUP = ^EC_GROUP; + PPEC_GROUP = ^PEC_GROUP; + + EC_POINT = type Pointer; // ec_point_st + PEC_POINT = ^EC_POINT; + PPEC_POINT = ^PEC_POINT; + + ECPKPARAMETERS = type Pointer; // ecpk_parameters_st + PECPKPARAMETERS = ^ECPKPARAMETERS; + + ECPARAMETERS = type Pointer; // ec_parameters_st + PECPARAMETERS = ^ECPARAMETERS; + + EC_builtin_curve = record + nid: TIdC_INT; + comment: PIdAnsiChar; + end; + PEC_builtin_curve = ^EC_builtin_curve; + + ECDSA_SIG = type Pointer; // ECDSA_SIG_st + PECDSA_SIG = ^ECDSA_SIG; + PPECDSA_SIG = ^PECDSA_SIG; + + ECDH_compute_key_KDF = function(const in_: Pointer; inlen: TIdC_SIZET; out_: Pointer; outlen: PIdC_SIZET): Pointer; cdecl; + + EC_KEY_METHOD_init_init = function(key: PEC_KEY): TIdC_INT; cdecl; + EC_KEY_METHOD_init_finish = procedure(key: PEC_KEY); cdecl; + EC_KEY_METHOD_init_copy = function(dest: PEC_KEY; const src: PEC_KEY): TIdC_INT; cdecl; + EC_KEY_METHOD_init_set_group = function(key: PEC_KEY; const grp: PEC_GROUP): TIdC_INT; cdecl; + EC_KEY_METHOD_init_set_private = function(key: PEC_KEY; const priv_key: PBIGNUM): TIdC_INT; cdecl; + EC_KEY_METHOD_init_set_public = function(key: PEC_KEY; const pub_key: PEC_POINT): TIdC_INT; cdecl; + + EC_KEY_METHOD_keygen_keygen = function(key: PEC_KEY): TIdC_INT; cdecl; + + EC_KEY_METHOD_compute_key_ckey = function(psec: PPByte; pseclen: PIdC_SIZET; const pub_key: PEC_POINT; const ecdh: PEC_KEY): TIdC_INT; cdecl; + + EC_KEY_METHOD_sign_sign = function(type_: TIdC_INT; const dgst: PByte; dlen: TIdC_INT; sig: PByte; siglen: PIdC_UINT; const kinv: PBIGNUM; const r: PBIGNUM; eckey: PEC_KEY): TIdC_INT; cdecl; + EC_KEY_METHOD_sign_sign_setup = function(eckey: PEC_KEY; ctx_in: PBN_CTX; kinvp: PPBIGNUM; rp: PPBIGNUM): TIdC_INT; cdecl; + EC_KEY_METHOD_sign_sign_sig = function(const dgst: PByte; dgst_len: TIdC_INT; const in_kinv: PBIGNUM; const in_r: PBIGNUM; eckey: PEC_KEY): PECDSA_SIG; cdecl; + + EC_KEY_METHOD_verify_verify = function(type_: TIdC_INT; const dgst: PByte; dgst_len: TIdC_INT; const sigbuf: PByte; sig_len: TIdC_INT; eckey: PEC_KEY): TIdC_INT; cdecl; + EC_KEY_METHOD_verify_verify_sig = function(const dgst: PByte; dgst_len: TIdC_INT; const sig: PECDSA_SIG; eckey: PEC_KEY): TIdC_INT; cdecl; + + PEC_KEY_METHOD_init_init = ^EC_KEY_METHOD_init_init; + PEC_KEY_METHOD_init_finish = ^EC_KEY_METHOD_init_finish; + PEC_KEY_METHOD_init_copy = ^EC_KEY_METHOD_init_copy; + PEC_KEY_METHOD_init_set_group = ^EC_KEY_METHOD_init_set_group; + PEC_KEY_METHOD_init_set_private = ^EC_KEY_METHOD_init_set_private; + PEC_KEY_METHOD_init_set_public = ^EC_KEY_METHOD_init_set_public; + + PEC_KEY_METHOD_keygen_keygen = ^EC_KEY_METHOD_keygen_keygen; + + PEC_KEY_METHOD_compute_key_ckey = ^EC_KEY_METHOD_compute_key_ckey; + + PEC_KEY_METHOD_sign_sign = ^EC_KEY_METHOD_sign_sign; + PEC_KEY_METHOD_sign_sign_setup = ^EC_KEY_METHOD_sign_sign_setup; + PEC_KEY_METHOD_sign_sign_sig = ^EC_KEY_METHOD_sign_sign_sig; + + PEC_KEY_METHOD_verify_verify = ^EC_KEY_METHOD_verify_verify; + PEC_KEY_METHOD_verify_verify_sig = ^EC_KEY_METHOD_verify_verify_sig; + + { The EXTERNALSYM directive is ignored by FPC, however, it is used by Delphi as follows: + + The EXTERNALSYM directive prevents the specified Delphi symbol from appearing in header + files generated for C++. } + + {$EXTERNALSYM EC_GFp_simple_method} + {$EXTERNALSYM EC_GFp_mont_method} + {$EXTERNALSYM EC_GFp_nist_method} + {$EXTERNALSYM EC_GF2m_simple_method} + {$EXTERNALSYM EC_GROUP_new} + {$EXTERNALSYM EC_GROUP_free} + {$EXTERNALSYM EC_GROUP_clear_free} + {$EXTERNALSYM EC_GROUP_copy} + {$EXTERNALSYM EC_GROUP_dup} + {$EXTERNALSYM EC_GROUP_method_of} + {$EXTERNALSYM EC_METHOD_get_field_type} + {$EXTERNALSYM EC_GROUP_set_generator} + {$EXTERNALSYM EC_GROUP_get0_generator} + {$EXTERNALSYM EC_GROUP_get_mont_data} + {$EXTERNALSYM EC_GROUP_get_order} + {$EXTERNALSYM EC_GROUP_get0_order} {introduced 1.1.0} + {$EXTERNALSYM EC_GROUP_order_bits} {introduced 1.1.0} + {$EXTERNALSYM EC_GROUP_get_cofactor} + {$EXTERNALSYM EC_GROUP_get0_cofactor} {introduced 1.1.0} + {$EXTERNALSYM EC_GROUP_set_curve_name} + {$EXTERNALSYM EC_GROUP_get_curve_name} + {$EXTERNALSYM EC_GROUP_set_asn1_flag} + {$EXTERNALSYM EC_GROUP_get_asn1_flag} + {$EXTERNALSYM EC_GROUP_set_point_conversion_form} + {$EXTERNALSYM EC_GROUP_get_point_conversion_form} + {$EXTERNALSYM EC_GROUP_get0_seed} + {$EXTERNALSYM EC_GROUP_get_seed_len} + {$EXTERNALSYM EC_GROUP_set_seed} + {$EXTERNALSYM EC_GROUP_set_curve} {introduced 1.1.0} + {$EXTERNALSYM EC_GROUP_get_curve} {introduced 1.1.0} + {$EXTERNALSYM EC_GROUP_set_curve_GFp} + {$EXTERNALSYM EC_GROUP_get_curve_GFp} + {$EXTERNALSYM EC_GROUP_set_curve_GF2m} + {$EXTERNALSYM EC_GROUP_get_curve_GF2m} + {$EXTERNALSYM EC_GROUP_get_degree} + {$EXTERNALSYM EC_GROUP_check} + {$EXTERNALSYM EC_GROUP_check_discriminant} + {$EXTERNALSYM EC_GROUP_cmp} + {$EXTERNALSYM EC_GROUP_new_curve_GFp} + {$EXTERNALSYM EC_GROUP_new_curve_GF2m} + {$EXTERNALSYM EC_GROUP_new_by_curve_name} + {$EXTERNALSYM EC_GROUP_new_from_ecparameters} {introduced 1.1.0} + {$EXTERNALSYM EC_GROUP_get_ecparameters} {introduced 1.1.0} + {$EXTERNALSYM EC_GROUP_new_from_ecpkparameters} {introduced 1.1.0} + {$EXTERNALSYM EC_GROUP_get_ecpkparameters} {introduced 1.1.0} + {$EXTERNALSYM EC_get_builtin_curves} + {$EXTERNALSYM EC_curve_nid2nist} + {$EXTERNALSYM EC_curve_nist2nid} + {$EXTERNALSYM EC_POINT_new} + {$EXTERNALSYM EC_POINT_free} + {$EXTERNALSYM EC_POINT_clear_free} + {$EXTERNALSYM EC_POINT_copy} + {$EXTERNALSYM EC_POINT_dup} + {$EXTERNALSYM EC_POINT_method_of} + {$EXTERNALSYM EC_POINT_set_to_infinity} + {$EXTERNALSYM EC_POINT_set_Jprojective_coordinates_GFp} + {$EXTERNALSYM EC_POINT_get_Jprojective_coordinates_GFp} + {$EXTERNALSYM EC_POINT_set_affine_coordinates} {introduced 1.1.0} + {$EXTERNALSYM EC_POINT_get_affine_coordinates} {introduced 1.1.0} + {$EXTERNALSYM EC_POINT_set_affine_coordinates_GFp} + {$EXTERNALSYM EC_POINT_get_affine_coordinates_GFp} + {$EXTERNALSYM EC_POINT_set_compressed_coordinates} {introduced 1.1.0} + {$EXTERNALSYM EC_POINT_set_compressed_coordinates_GFp} + {$EXTERNALSYM EC_POINT_set_affine_coordinates_GF2m} + {$EXTERNALSYM EC_POINT_get_affine_coordinates_GF2m} + {$EXTERNALSYM EC_POINT_set_compressed_coordinates_GF2m} + {$EXTERNALSYM EC_POINT_point2oct} + {$EXTERNALSYM EC_POINT_oct2point} + {$EXTERNALSYM EC_POINT_point2buf} {introduced 1.1.0} + {$EXTERNALSYM EC_POINT_point2bn} + {$EXTERNALSYM EC_POINT_bn2point} + {$EXTERNALSYM EC_POINT_point2hex} + {$EXTERNALSYM EC_POINT_hex2point} + {$EXTERNALSYM EC_POINT_add} + {$EXTERNALSYM EC_POINT_dbl} + {$EXTERNALSYM EC_POINT_invert} + {$EXTERNALSYM EC_POINT_is_at_infinity} + {$EXTERNALSYM EC_POINT_is_on_curve} + {$EXTERNALSYM EC_POINT_cmp} + {$EXTERNALSYM EC_POINT_make_affine} + {$EXTERNALSYM EC_POINTs_make_affine} + {$EXTERNALSYM EC_POINTs_mul} + {$EXTERNALSYM EC_POINT_mul} + {$EXTERNALSYM EC_GROUP_precompute_mult} + {$EXTERNALSYM EC_GROUP_have_precompute_mult} + {$EXTERNALSYM ECPKPARAMETERS_it} + {$EXTERNALSYM ECPKPARAMETERS_new} + {$EXTERNALSYM ECPKPARAMETERS_free} + {$EXTERNALSYM ECPARAMETERS_it} + {$EXTERNALSYM ECPARAMETERS_new} + {$EXTERNALSYM ECPARAMETERS_free} + {$EXTERNALSYM EC_GROUP_get_basis_type} + {$EXTERNALSYM EC_GROUP_get_trinomial_basis} + {$EXTERNALSYM EC_GROUP_get_pentanomial_basis} + {$EXTERNALSYM d2i_ECPKParameters} + {$EXTERNALSYM i2d_ECPKParameters} + {$EXTERNALSYM ECPKParameters_print} + {$EXTERNALSYM EC_KEY_new} + {$EXTERNALSYM EC_KEY_get_flags} + {$EXTERNALSYM EC_KEY_set_flags} + {$EXTERNALSYM EC_KEY_clear_flags} + {$EXTERNALSYM EC_KEY_new_by_curve_name} + {$EXTERNALSYM EC_KEY_free} + {$EXTERNALSYM EC_KEY_copy} + {$EXTERNALSYM EC_KEY_dup} + {$EXTERNALSYM EC_KEY_up_ref} + {$EXTERNALSYM EC_KEY_get0_engine} {introduced 1.1.0} + {$EXTERNALSYM EC_KEY_get0_group} + {$EXTERNALSYM EC_KEY_set_group} + {$EXTERNALSYM EC_KEY_get0_private_key} + {$EXTERNALSYM EC_KEY_set_private_key} + {$EXTERNALSYM EC_KEY_get0_public_key} + {$EXTERNALSYM EC_KEY_set_public_key} + {$EXTERNALSYM EC_KEY_get_enc_flags} + {$EXTERNALSYM EC_KEY_set_enc_flags} + {$EXTERNALSYM EC_KEY_get_conv_form} + {$EXTERNALSYM EC_KEY_set_conv_form} + {$EXTERNALSYM EC_KEY_set_ex_data} {introduced 1.1.0} + {$EXTERNALSYM EC_KEY_get_ex_data} {introduced 1.1.0} + {$EXTERNALSYM EC_KEY_set_asn1_flag} + {$EXTERNALSYM EC_KEY_precompute_mult} + {$EXTERNALSYM EC_KEY_generate_key} + {$EXTERNALSYM EC_KEY_check_key} + {$EXTERNALSYM EC_KEY_can_sign} {introduced 1.1.0} + {$EXTERNALSYM EC_KEY_set_public_key_affine_coordinates} + {$EXTERNALSYM EC_KEY_key2buf} {introduced 1.1.0} + {$EXTERNALSYM EC_KEY_oct2key} {introduced 1.1.0} + {$EXTERNALSYM EC_KEY_oct2priv} {introduced 1.1.0} + {$EXTERNALSYM EC_KEY_priv2oct} {introduced 1.1.0} + {$EXTERNALSYM EC_KEY_priv2buf} {introduced 1.1.0} + {$EXTERNALSYM d2i_ECPrivateKey} + {$EXTERNALSYM i2d_ECPrivateKey} + {$EXTERNALSYM o2i_ECPublicKey} + {$EXTERNALSYM i2o_ECPublicKey} + {$EXTERNALSYM ECParameters_print} + {$EXTERNALSYM EC_KEY_print} + {$EXTERNALSYM EC_KEY_OpenSSL} {introduced 1.1.0} + {$EXTERNALSYM EC_KEY_get_default_method} {introduced 1.1.0} + {$EXTERNALSYM EC_KEY_set_default_method} {introduced 1.1.0} + {$EXTERNALSYM EC_KEY_get_method} {introduced 1.1.0} + {$EXTERNALSYM EC_KEY_set_method} {introduced 1.1.0} + {$EXTERNALSYM EC_KEY_new_method} {introduced 1.1.0} + {$EXTERNALSYM ECDH_KDF_X9_62} + {$EXTERNALSYM ECDH_compute_key} + {$EXTERNALSYM ECDSA_SIG_new} + {$EXTERNALSYM ECDSA_SIG_free} + {$EXTERNALSYM i2d_ECDSA_SIG} + {$EXTERNALSYM d2i_ECDSA_SIG} + {$EXTERNALSYM ECDSA_SIG_get0} {introduced 1.1.0} + {$EXTERNALSYM ECDSA_SIG_get0_r} {introduced 1.1.0} + {$EXTERNALSYM ECDSA_SIG_get0_s} {introduced 1.1.0} + {$EXTERNALSYM ECDSA_SIG_set0} {introduced 1.1.0} + {$EXTERNALSYM ECDSA_do_sign} + {$EXTERNALSYM ECDSA_do_sign_ex} + {$EXTERNALSYM ECDSA_do_verify} + {$EXTERNALSYM ECDSA_sign_setup} + {$EXTERNALSYM ECDSA_sign} + {$EXTERNALSYM ECDSA_sign_ex} + {$EXTERNALSYM ECDSA_verify} + {$EXTERNALSYM ECDSA_size} + {$EXTERNALSYM EC_KEY_METHOD_new} {introduced 1.1.0} + {$EXTERNALSYM EC_KEY_METHOD_free} {introduced 1.1.0} + {$EXTERNALSYM EC_KEY_METHOD_set_init} {introduced 1.1.0} + {$EXTERNALSYM EC_KEY_METHOD_set_keygen} {introduced 1.1.0} + {$EXTERNALSYM EC_KEY_METHOD_set_compute_key} {introduced 1.1.0} + {$EXTERNALSYM EC_KEY_METHOD_set_sign} {introduced 1.1.0} + {$EXTERNALSYM EC_KEY_METHOD_set_verify} {introduced 1.1.0} + {$EXTERNALSYM EC_KEY_METHOD_get_init} {introduced 1.1.0} + {$EXTERNALSYM EC_KEY_METHOD_get_keygen} {introduced 1.1.0} + {$EXTERNALSYM EC_KEY_METHOD_get_compute_key} {introduced 1.1.0} + {$EXTERNALSYM EC_KEY_METHOD_get_sign} {introduced 1.1.0} + {$EXTERNALSYM EC_KEY_METHOD_get_verify} {introduced 1.1.0} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +var + {$EXTERNALSYM EC_GFp_nistp224_method} {introduced 1.1.0 removed 3.0.0} + {$EXTERNALSYM EC_GFp_nistp256_method} {introduced 1.1.0 removed 3.0.0} + {$EXTERNALSYM EC_GFp_nistp521_method} {introduced 1.1.0 removed 3.0.0} + EC_GFp_simple_method: function : PEC_METHOD; cdecl = nil; + EC_GFp_mont_method: function : PEC_METHOD; cdecl = nil; + EC_GFp_nist_method: function : PEC_METHOD; cdecl = nil; + EC_GFp_nistp224_method: function : PEC_METHOD; cdecl = nil; {introduced 1.1.0 removed 3.0.0} + EC_GFp_nistp256_method: function : PEC_METHOD; cdecl = nil; {introduced 1.1.0 removed 3.0.0} + EC_GFp_nistp521_method: function : PEC_METHOD; cdecl = nil; {introduced 1.1.0 removed 3.0.0} + + EC_GF2m_simple_method: function : PEC_METHOD; cdecl = nil; + + EC_GROUP_new: function (const meth: PEC_METHOD): PEC_GROUP; cdecl = nil; + EC_GROUP_free: procedure (group: PEC_GROUP); cdecl = nil; + EC_GROUP_clear_free: procedure (group: PEC_GROUP); cdecl = nil; + EC_GROUP_copy: function (dst: PEC_GROUP; const src: PEC_GROUP): TIdC_INT; cdecl = nil; + EC_GROUP_dup: function (const src: PEC_GROUP): PEC_GROUP; cdecl = nil; + EC_GROUP_method_of: function (const group: PEC_GROUP): PEC_GROUP; cdecl = nil; + EC_METHOD_get_field_type: function (const meth: PEC_METHOD): TIdC_INT; cdecl = nil; + EC_GROUP_set_generator: function (group: PEC_GROUP; const generator: PEC_POINT; const order: PBIGNUM; const cofactor: PBIGNUM): TIdC_INT; cdecl = nil; + EC_GROUP_get0_generator: function (const group: PEC_GROUP): PEC_POINT; cdecl = nil; + EC_GROUP_get_mont_data: function (const group: PEC_GROUP): PBN_MONT_CTX; cdecl = nil; + EC_GROUP_get_order: function (const group: PEC_GROUP; order: PBIGNUM; ctx: PBN_CTX): TIdC_INT; cdecl = nil; + EC_GROUP_get0_order: function (const group: PEC_GROUP): PBIGNUM; cdecl = nil; {introduced 1.1.0} + EC_GROUP_order_bits: function (const group: PEC_GROUP): TIdC_INT; cdecl = nil; {introduced 1.1.0} + EC_GROUP_get_cofactor: function (const group: PEC_GROUP; cofactor: PBIGNUM; ctx: PBN_CTX): TIdC_INT; cdecl = nil; + EC_GROUP_get0_cofactor: function (const group: PEC_GROUP): PBIGNUM; cdecl = nil; {introduced 1.1.0} + EC_GROUP_set_curve_name: procedure (group: PEC_GROUP; nid: TIdC_INT); cdecl = nil; + EC_GROUP_get_curve_name: function (const group: PEC_GROUP): TIdC_INT; cdecl = nil; + + EC_GROUP_set_asn1_flag: procedure (group: PEC_GROUP; flag: TIdC_INT); cdecl = nil; + EC_GROUP_get_asn1_flag: function (const group: PEC_GROUP): TIdC_INT; cdecl = nil; + + EC_GROUP_set_point_conversion_form: procedure (group: PEC_GROUP; form: point_conversion_form_t); cdecl = nil; + EC_GROUP_get_point_conversion_form: function (const group: PEC_GROUP): point_conversion_form_t; cdecl = nil; + + EC_GROUP_get0_seed: function (const x: PEC_GROUP): PByte; cdecl = nil; + EC_GROUP_get_seed_len: function (const x: PEC_GROUP): TIdC_SIZET; cdecl = nil; + EC_GROUP_set_seed: function (x: PEC_GROUP; const p: PByte; len: TIdC_SIZET): TIdC_SIZET; cdecl = nil; + + EC_GROUP_set_curve: function (group: PEC_GROUP; const p: PBIGNUM; const a: PBIGNUM; const b: PBIGNUM; ctx: PBN_CTX): TIdC_INT; cdecl = nil; {introduced 1.1.0} + EC_GROUP_get_curve: function (const group: PEC_GROUP; p: PBIGNUM; a: PBIGNUM; b: PBIGNUM; ctx: PBN_CTX): TIdC_INT; cdecl = nil; {introduced 1.1.0} + EC_GROUP_set_curve_GFp: function (group: PEC_GROUP; const p: PBIGNUM; const a: PBIGNUM; const b: PBIGNUM; ctx: PBN_CTX): TIdC_INT; cdecl = nil; + EC_GROUP_get_curve_GFp: function (const group: PEC_GROUP; p: PBIGNUM; a: PBIGNUM; b: PBIGNUM; ctx: PBN_CTX): TIdC_INT; cdecl = nil; + EC_GROUP_set_curve_GF2m: function (group: PEC_GROUP; const p: PBIGNUM; const a: PBIGNUM; const b:PBIGNUM; ctx: PBN_CTX): TIdC_INT; cdecl = nil; + EC_GROUP_get_curve_GF2m: function (const group: PEC_GROUP; p: PBIGNUM; a: PBIGNUM; ctx: PBN_CTX): TIdC_INT; cdecl = nil; + + EC_GROUP_get_degree: function (const group: PEC_GROUP): TIdC_INT; cdecl = nil; + EC_GROUP_check: function (const group: PEC_GROUP; ctx: PBN_CTX): TIdC_INT; cdecl = nil; + EC_GROUP_check_discriminant: function (const group: PEC_GROUP; ctx: PBN_CTX): TIdC_INT; cdecl = nil; + EC_GROUP_cmp: function (const a: PEC_GROUP; const b: PEC_GROUP; ctx: PBN_CTX): TIdC_INT; cdecl = nil; + + EC_GROUP_new_curve_GFp: function (const p: PBIGNUM; const a: PBIGNUM; const b: PBIGNUM; ctx: PBN_CTX): PEC_GROUP; cdecl = nil; + EC_GROUP_new_curve_GF2m: function (const p: PBIGNUM; const a: PBIGNUM; const b: PBIGNUM; ctx: PBN_CTX): PEC_GROUP; cdecl = nil; + EC_GROUP_new_by_curve_name: function (nid: TIdC_INT): PEC_GROUP; cdecl = nil; + EC_GROUP_new_from_ecparameters: function (const params: PECPARAMETERS): PEC_GROUP; cdecl = nil; {introduced 1.1.0} + EC_GROUP_get_ecparameters: function (const group: PEC_GROUP; params: PECPARAMETERS): PECPARAMETERS; cdecl = nil; {introduced 1.1.0} + EC_GROUP_new_from_ecpkparameters: function (const params: PECPKPARAMETERS): PEC_GROUP; cdecl = nil; {introduced 1.1.0} + EC_GROUP_get_ecpkparameters: function (const group: PEC_GROUP; params: PECPKPARAMETERS): PECPKPARAMETERS; cdecl = nil; {introduced 1.1.0} + + EC_get_builtin_curves: function (r: PEC_builtin_curve; nitems: TIdC_SIZET): TIdC_SIZET; cdecl = nil; + + EC_curve_nid2nist: function (nid: TIdC_INT): PIdAnsiChar; cdecl = nil; + EC_curve_nist2nid: function (const name: PIdAnsiChar): TIdC_INT; cdecl = nil; + + EC_POINT_new: function (const group: PEC_GROUP): PEC_POINT; cdecl = nil; + EC_POINT_free: procedure (point: PEC_POINT); cdecl = nil; + EC_POINT_clear_free: procedure (point: PEC_POINT); cdecl = nil; + EC_POINT_copy: function (dst: PEC_POINT; const src: PEC_POINT): TIdC_INT; cdecl = nil; + EC_POINT_dup: function (const src: PEC_POINT; const group: PEC_GROUP): PEC_POINT; cdecl = nil; + EC_POINT_method_of: function (const point: PEC_POINT): PEC_METHOD; cdecl = nil; + EC_POINT_set_to_infinity: function (const group: PEC_GROUP; point: PEC_POINT): TIdC_INT; cdecl = nil; + EC_POINT_set_Jprojective_coordinates_GFp: function (const group: PEC_GROUP; p: PEC_POINT; const x: PBIGNUM; const y: PBIGNUM; const z: PBIGNUM; ctx: PBN_CTX): TIdC_INT; cdecl = nil; + EC_POINT_get_Jprojective_coordinates_GFp: function (const group: PEC_METHOD; const p: PEC_POINT; x: PBIGNUM; y: PBIGNUM; z: PBIGNUM; ctx: PBN_CTX): TIdC_INT; cdecl = nil; + EC_POINT_set_affine_coordinates: function (const group: PEC_GROUP; p: PEC_POINT; const x: PBIGNUM; const y: PBIGNUM; ctx: PBN_CTX): TIdC_INT; cdecl = nil; {introduced 1.1.0} + EC_POINT_get_affine_coordinates: function (const group: PEC_GROUP; const p: PEC_POINT; x: PBIGNUM; y: PBIGNUM; ctx: PBN_CTX): TIdC_INT; cdecl = nil; {introduced 1.1.0} + EC_POINT_set_affine_coordinates_GFp: function (const group: PEC_GROUP; p: PEC_POINT; const x: PBIGNUM; const y: PBIGNUM; ctx: PBN_CTX): TIdC_INT; cdecl = nil; + EC_POINT_get_affine_coordinates_GFp: function (const group: PEC_GROUP; const p: PEC_POINT; x: PBIGNUM; y: PBIGNUM; ctx: PBN_CTX): TIdC_INT; cdecl = nil; + EC_POINT_set_compressed_coordinates: function (const group: PEC_GROUP; p: PEC_POINT; x: PBIGNUM; y_bit: TIdC_INT; ctx: PBN_CTX): TIdC_INT; cdecl = nil; {introduced 1.1.0} + EC_POINT_set_compressed_coordinates_GFp: function (const group: PEC_GROUP; p: PEC_POINT; const x: PBIGNUM; y_bit: TIdC_INT; ctx: PBN_CTX): TIdC_INT; cdecl = nil; + EC_POINT_set_affine_coordinates_GF2m: function (const group: PEC_GROUP; p: PEC_POINT; const x: PBIGNUM; const y: PBIGNUM; ctx: PBN_CTX): TIdC_INT; cdecl = nil; + EC_POINT_get_affine_coordinates_GF2m: function (const group: PEC_GROUP; p: PEC_POINT; x: PBIGNUM; y: PBIGNUM; ctx: PBN_CTX): TIdC_INT; cdecl = nil; + EC_POINT_set_compressed_coordinates_GF2m: function (const group: PEC_GROUP; p: PEC_POINT; const x: PBIGNUM; y_bit: TIdC_INT; ctx: PBN_CTX): TIdC_INT; cdecl = nil; + + EC_POINT_point2oct: function (const group: PEC_GROUP; const p: PEC_POINT; form: point_conversion_form_t; buf: PByte; len: TIdC_SIZET; ctx: PBN_CTX): TIdC_SIZET; cdecl = nil; + EC_POINT_oct2point: function (const group: PEC_GROUP; p: PEC_POINT; const buf: PByte; len: TIdC_SIZET; ctx: PBN_CTX): TIdC_INT; cdecl = nil; + EC_POINT_point2buf: function (const group: PEC_GROUP; const point: PEC_POINT; form: point_conversion_form_t; pbuf: PPByte; ctx: PBN_CTX): TIdC_SIZET; cdecl = nil; {introduced 1.1.0} + EC_POINT_point2bn: function (const group: PEC_GROUP; const p: PEC_POINT; form: point_conversion_form_t; bn: PBIGNUM; ctx: PBN_CTX): PBIGNUM; cdecl = nil; + EC_POINT_bn2point: function (const group: PEC_GROUP; const bn: PBIGNUM; p: PEC_POINT; ctx: PBN_CTX): PEC_POINT; cdecl = nil; + EC_POINT_point2hex: function (const group: PEC_GROUP; const p: PEC_POINT; form: point_conversion_form_t; ctx: PBN_CTX): PIdAnsiChar; cdecl = nil; + EC_POINT_hex2point: function (const group: PEC_GROUP; const buf: PIdAnsiChar; p: PEC_POINT; ctx: PBN_CTX): PEC_POINT; cdecl = nil; + + EC_POINT_add: function (const group: PEC_GROUP; r: PEC_POINT; const a: PEC_POINT; const b: PEC_POINT; ctx: PBN_CTX): TIdC_INT; cdecl = nil; + EC_POINT_dbl: function (const group: PEC_GROUP; r: PEC_POINT; const a: PEC_POINT; ctx: PBN_CTX): TIdC_INT; cdecl = nil; + EC_POINT_invert: function (const group: PEC_GROUP; a: PEC_POINT; ctx: PBN_CTX): TIdC_INT; cdecl = nil; + EC_POINT_is_at_infinity: function (const group: PEC_GROUP; const p: PEC_POINT): TIdC_INT; cdecl = nil; + EC_POINT_is_on_curve: function (const group: PEC_GROUP; const point: PEC_POINT; ctx: PBN_CTX): TIdC_INT; cdecl = nil; + EC_POINT_cmp: function (const group: PEC_GROUP; const a: PEC_POINT; const b: PEC_POINT; ctx: PBN_CTX): TIdC_INT; cdecl = nil; + EC_POINT_make_affine: function (const group: PEC_GROUP; point: PEC_POINT; ctx: PBN_CTX): TIdC_INT; cdecl = nil; + EC_POINTs_make_affine: function (const group: PEC_METHOD; num: TIdC_SIZET; points: PPEC_POINT; ctx: PBN_CTX): TIdC_INT; cdecl = nil; + EC_POINTs_mul: function (const group: PEC_GROUP; r: PEC_POINT; const n: PBIGNUM; num: TIdC_SIZET; const p: PPEC_POINT; const m: PPBIGNUM; ctx: PBN_CTX): TIdC_INT; cdecl = nil; + EC_POINT_mul: function (const group: PEC_GROUP; r: PEC_POINT; const n: PBIGNUM; const q: PEC_POINT; const m: PBIGNUM; ctx: PBN_CTX): TIdC_INT; cdecl = nil; + + EC_GROUP_precompute_mult: function (group: PEC_GROUP; ctx: PBN_CTX): TIdC_INT; cdecl = nil; + EC_GROUP_have_precompute_mult: function (const group: PEC_GROUP): TIdC_INT; cdecl = nil; + + ECPKPARAMETERS_it: function : PASN1_ITEM; cdecl = nil; + ECPKPARAMETERS_new: function : PECPKPARAMETERS; cdecl = nil; + ECPKPARAMETERS_free: procedure (a: PECPKPARAMETERS); cdecl = nil; + + ECPARAMETERS_it: function : PASN1_ITEM; cdecl = nil; + ECPARAMETERS_new: function : PECPARAMETERS; cdecl = nil; + ECPARAMETERS_free: procedure (a: PECPARAMETERS); cdecl = nil; + + EC_GROUP_get_basis_type: function (const group: PEC_GROUP): TIdC_INT; cdecl = nil; + EC_GROUP_get_trinomial_basis: function (const group: PEC_GROUP; k: PIdC_UINT): TIdC_INT; cdecl = nil; + EC_GROUP_get_pentanomial_basis: function (const group: PEC_GROUP; k1: PIdC_UINT; k2: PIdC_UINT; k3: PIdC_UINT): TIdC_INT; cdecl = nil; + + d2i_ECPKParameters: function (group: PPEC_GROUP; const in_: PPByte; len: TIdC_LONG): PEC_GROUP; cdecl = nil; + i2d_ECPKParameters: function (const group: PEC_GROUP; out_: PPByte): TIdC_INT; cdecl = nil; + + ECPKParameters_print: function (bp: PBIO; const x: PEC_GROUP; off: TIdC_INT): TIdC_INT; cdecl = nil; + + EC_KEY_new: function : PEC_KEY; cdecl = nil; + EC_KEY_get_flags: function (const key: PEC_KEY): TIdC_INT; cdecl = nil; + EC_KEY_set_flags: procedure (key: PEC_KEY; flags: TIdC_INT); cdecl = nil; + EC_KEY_clear_flags: procedure (key: PEC_KEY; flags: TIdC_INT); cdecl = nil; + EC_KEY_new_by_curve_name: function (nid: TIdC_INT): PEC_KEY; cdecl = nil; + EC_KEY_free: procedure (key: PEC_KEY); cdecl = nil; + EC_KEY_copy: function (dst: PEC_KEY; const src: PEC_KEY): PEC_KEY; cdecl = nil; + EC_KEY_dup: function (const src: PEC_KEY): PEC_KEY; cdecl = nil; + EC_KEY_up_ref: function (key: PEC_KEY): TIdC_INT; cdecl = nil; + EC_KEY_get0_engine: function (const eckey: PEC_KEY): PENGINE; cdecl = nil; {introduced 1.1.0} + EC_KEY_get0_group: function (const key: PEC_KEY): PEC_GROUP; cdecl = nil; + EC_KEY_set_group: function (key: PEC_KEY; const group: PEC_GROUP): TIdC_INT; cdecl = nil; + EC_KEY_get0_private_key: function (const key: PEC_KEY): PBIGNUM; cdecl = nil; + EC_KEY_set_private_key: function (const key: PEC_KEY; const prv: PBIGNUM): TIdC_INT; cdecl = nil; + EC_KEY_get0_public_key: function (const key: PEC_KEY): PEC_POINT; cdecl = nil; + EC_KEY_set_public_key: function (key: PEC_KEY; const pub: PEC_POINT): TIdC_INT; cdecl = nil; + EC_KEY_get_enc_flags: function (const key: PEC_KEY): TIdC_UINT; cdecl = nil; + EC_KEY_set_enc_flags: procedure (eckey: PEC_KEY; flags: TIdC_UINT); cdecl = nil; + EC_KEY_get_conv_form: function (const key: PEC_KEY): point_conversion_form_t; cdecl = nil; + EC_KEY_set_conv_form: procedure (eckey: PEC_KEY; cform: point_conversion_form_t); cdecl = nil; + EC_KEY_set_ex_data: function (key: PEC_KEY; idx: TIdC_INT; arg: Pointer): TIdC_INT; cdecl = nil; {introduced 1.1.0} + EC_KEY_get_ex_data: function (const key: PEC_KEY; idx: TIdC_INT): Pointer; cdecl = nil; {introduced 1.1.0} + EC_KEY_set_asn1_flag: procedure (eckey: PEC_KEY; asn1_flag: TIdC_INT); cdecl = nil; + EC_KEY_precompute_mult: function (key: PEC_KEY; ctx: PBN_CTX): TIdC_INT; cdecl = nil; + EC_KEY_generate_key: function (key: PEC_KEY): TIdC_INT; cdecl = nil; + EC_KEY_check_key: function (const key: PEC_KEY): TIdC_INT; cdecl = nil; + EC_KEY_can_sign: function (const eckey: PEC_KEY): TIdC_INT; cdecl = nil; {introduced 1.1.0} + EC_KEY_set_public_key_affine_coordinates: function (key: PEC_KEY; x: PBIGNUM; y: PBIGNUM): TIdC_INT; cdecl = nil; + EC_KEY_key2buf: function (const key: PEC_KEY; form: point_conversion_form_t; pbuf: PPByte; ctx: PBN_CTX): TIdC_SIZET; cdecl = nil; {introduced 1.1.0} + EC_KEY_oct2key: function (key: PEC_KEY; const buf: PByte; len: TIdC_SIZET; ctx: PBN_CTX): TIdC_INT; cdecl = nil; {introduced 1.1.0} + EC_KEY_oct2priv: function (key: PEC_KEY; const buf: PByte; len: TIdC_SIZET): TIdC_INT; cdecl = nil; {introduced 1.1.0} + EC_KEY_priv2oct: function (const key: PEC_KEY; buf: PByte; len: TIdC_SIZET): TIdC_SIZET; cdecl = nil; {introduced 1.1.0} + EC_KEY_priv2buf: function (const eckey: PEC_KEY; buf: PPByte): TIdC_SIZET; cdecl = nil; {introduced 1.1.0} + + d2i_ECPrivateKey: function (key: PPEC_KEY; const in_: PPByte; len: TIdC_LONG): PEC_KEY; cdecl = nil; + i2d_ECPrivateKey: function (key: PEC_KEY; out_: PPByte): TIdC_INT; cdecl = nil; + o2i_ECPublicKey: function (key: PPEC_KEY; const in_: PPByte; len: TIdC_LONG): PEC_KEY; cdecl = nil; + i2o_ECPublicKey: function (const key: PEC_KEY; out_: PPByte): TIdC_INT; cdecl = nil; + + ECParameters_print: function (bp: PBIO; const key: PEC_KEY): TIdC_INT; cdecl = nil; + EC_KEY_print: function (bp: PBIO; const key: PEC_KEY; off: TIdC_INT): TIdC_INT; cdecl = nil; + + EC_KEY_OpenSSL: function : PEC_KEY_METHOD; cdecl = nil; {introduced 1.1.0} + EC_KEY_get_default_method: function : PEC_KEY_METHOD; cdecl = nil; {introduced 1.1.0} + EC_KEY_set_default_method: procedure (const meth: PEC_KEY_METHOD); cdecl = nil; {introduced 1.1.0} + EC_KEY_get_method: function (const key: PEC_KEY): PEC_KEY_METHOD; cdecl = nil; {introduced 1.1.0} + EC_KEY_set_method: function (key: PEC_KEY; const meth: PEC_KEY_METHOD): TIdC_INT; cdecl = nil; {introduced 1.1.0} + EC_KEY_new_method: function (engine: PENGINE): PEC_KEY; cdecl = nil; {introduced 1.1.0} + + ECDH_KDF_X9_62: function (out_: PByte; outlen: TIdC_SIZET; const Z: PByte; Zlen: TIdC_SIZET; const sinfo: PByte; sinfolen: TIdC_SIZET; const md: PEVP_MD): TIdC_INT; cdecl = nil; + ECDH_compute_key: function (out_: Pointer; oulen: TIdC_SIZET; const pub_key: PEC_POINT; const ecdh: PEC_KEY; kdf: ECDH_compute_key_KDF): TIdC_INT; cdecl = nil; + + ECDSA_SIG_new: function : PECDSA_SIG; cdecl = nil; + ECDSA_SIG_free: procedure (sig: PECDSA_SIG); cdecl = nil; + i2d_ECDSA_SIG: function (const sig: PECDSA_SIG; pp: PPByte): TIdC_INT; cdecl = nil; + d2i_ECDSA_SIG: function (sig: PPECDSA_SIG; const pp: PPByte; len: TIdC_LONG): PECDSA_SIG; cdecl = nil; + ECDSA_SIG_get0: procedure (const sig: PECDSA_SIG; const pr: PPBIGNUM; const ps: PPBIGNUM); cdecl = nil; {introduced 1.1.0} + ECDSA_SIG_get0_r: function (const sig: PECDSA_SIG): PBIGNUM; cdecl = nil; {introduced 1.1.0} + ECDSA_SIG_get0_s: function (const sig: PECDSA_SIG): PBIGNUM; cdecl = nil; {introduced 1.1.0} + ECDSA_SIG_set0: function (sig: PECDSA_SIG; r: PBIGNUM; s: PBIGNUM): TIdC_INT; cdecl = nil; {introduced 1.1.0} + ECDSA_do_sign: function (const dgst: PByte; dgst_len: TIdC_INT; eckey: PEC_KEY): PECDSA_SIG; cdecl = nil; + ECDSA_do_sign_ex: function (const dgst: PByte; dgst_len: TIdC_INT; const kinv: PBIGNUM; const rp: PBIGNUM; eckey: PEC_KEY): PECDSA_SIG; cdecl = nil; + ECDSA_do_verify: function (const dgst: PByte; dgst_len: TIdC_INT; const sig: PECDSA_SIG; eckey: PEC_KEY): TIdC_INT; cdecl = nil; + ECDSA_sign_setup: function (eckey: PEC_KEY; ctx: PBN_CTX; kiv: PPBIGNUM; rp: PPBIGNUM): TIdC_INT; cdecl = nil; + ECDSA_sign: function (type_: TIdC_INT; const dgst: PByte; dgstlen: TIdC_INT; sig: PByte; siglen: PIdC_UINT; eckey: PEC_KEY): TIdC_INT; cdecl = nil; + ECDSA_sign_ex: function (type_: TIdC_INT; const dgst: PByte; dgstlen: TIdC_INT; sig: PByte; siglen: PIdC_UINT; const kinv: PBIGNUM; const rp: PBIGNUM; eckey: PEC_KEY): TIdC_INT; cdecl = nil; + ECDSA_verify: function (type_: TIdC_INT; const dgst: PByte; dgstlen: TIdC_INT; const sig: PByte; siglen: TIdC_INT; eckey: PEC_KEY): TIdC_INT; cdecl = nil; + ECDSA_size: function (const eckey: PEC_KEY): TIdC_INT; cdecl = nil; + + EC_KEY_METHOD_new: function (const meth: PEC_KEY_METHOD): PEC_KEY_METHOD; cdecl = nil; {introduced 1.1.0} + EC_KEY_METHOD_free: procedure (meth: PEC_KEY_METHOD); cdecl = nil; {introduced 1.1.0} + EC_KEY_METHOD_set_init: procedure (meth: PEC_KEY_METHOD; init: EC_KEY_METHOD_init_init; finish: EC_KEY_METHOD_init_finish; copy: EC_KEY_METHOD_init_copy; set_group: EC_KEY_METHOD_init_set_group; set_private: EC_KEY_METHOD_init_set_private; set_public: EC_KEY_METHOD_init_set_public); cdecl = nil; {introduced 1.1.0} + EC_KEY_METHOD_set_keygen: procedure (meth: PEC_KEY_METHOD; keygen: EC_KEY_METHOD_keygen_keygen); cdecl = nil; {introduced 1.1.0} + EC_KEY_METHOD_set_compute_key: procedure (meth: PEC_KEY_METHOD; ckey: EC_KEY_METHOD_compute_key_ckey); cdecl = nil; {introduced 1.1.0} + EC_KEY_METHOD_set_sign: procedure (meth: PEC_KEY_METHOD; sign: EC_KEY_METHOD_sign_sign; sign_setup: EC_KEY_METHOD_sign_sign_setup; sign_sig: EC_KEY_METHOD_sign_sign_sig); cdecl = nil; {introduced 1.1.0} + EC_KEY_METHOD_set_verify: procedure (meth: PEC_KEY_METHOD; verify: EC_KEY_METHOD_verify_verify; verify_sig: EC_KEY_METHOD_verify_verify_sig); cdecl = nil; {introduced 1.1.0} + + EC_KEY_METHOD_get_init: procedure (const meth: PEC_KEY_METHOD; pinit: PEC_KEY_METHOD_init_init; pfinish: PEC_KEY_METHOD_init_finish; pcopy: PEC_KEY_METHOD_init_copy; pset_group: PEC_KEY_METHOD_init_set_group; pset_private: PEC_KEY_METHOD_init_set_private; pset_public: PEC_KEY_METHOD_init_set_public); cdecl = nil; {introduced 1.1.0} + EC_KEY_METHOD_get_keygen: procedure (const meth: PEC_KEY_METHOD; pkeygen: PEC_KEY_METHOD_keygen_keygen); cdecl = nil; {introduced 1.1.0} + EC_KEY_METHOD_get_compute_key: procedure (const meth: PEC_KEY_METHOD; pck: PEC_KEY_METHOD_compute_key_ckey); cdecl = nil; {introduced 1.1.0} + EC_KEY_METHOD_get_sign: procedure (const meth: PEC_KEY_METHOD; psign: PEC_KEY_METHOD_sign_sign; psign_setup: PEC_KEY_METHOD_sign_sign_setup; psign_sig: PEC_KEY_METHOD_sign_sign_sig); cdecl = nil; {introduced 1.1.0} + EC_KEY_METHOD_get_verify: procedure (const meth: PEC_KEY_METHOD; pverify: PEC_KEY_METHOD_verify_verify; pverify_sig: PEC_KEY_METHOD_verify_verify_sig); cdecl = nil; {introduced 1.1.0} + +{$ELSE} + function EC_GFp_simple_method: PEC_METHOD cdecl; external CLibCrypto; + function EC_GFp_mont_method: PEC_METHOD cdecl; external CLibCrypto; + function EC_GFp_nist_method: PEC_METHOD cdecl; external CLibCrypto; + + function EC_GF2m_simple_method: PEC_METHOD cdecl; external CLibCrypto; + + function EC_GROUP_new(const meth: PEC_METHOD): PEC_GROUP cdecl; external CLibCrypto; + procedure EC_GROUP_free(group: PEC_GROUP) cdecl; external CLibCrypto; + procedure EC_GROUP_clear_free(group: PEC_GROUP) cdecl; external CLibCrypto; + function EC_GROUP_copy(dst: PEC_GROUP; const src: PEC_GROUP): TIdC_INT cdecl; external CLibCrypto; + function EC_GROUP_dup(const src: PEC_GROUP): PEC_GROUP cdecl; external CLibCrypto; + function EC_GROUP_method_of(const group: PEC_GROUP): PEC_GROUP cdecl; external CLibCrypto; + function EC_METHOD_get_field_type(const meth: PEC_METHOD): TIdC_INT cdecl; external CLibCrypto; + function EC_GROUP_set_generator(group: PEC_GROUP; const generator: PEC_POINT; const order: PBIGNUM; const cofactor: PBIGNUM): TIdC_INT cdecl; external CLibCrypto; + function EC_GROUP_get0_generator(const group: PEC_GROUP): PEC_POINT cdecl; external CLibCrypto; + function EC_GROUP_get_mont_data(const group: PEC_GROUP): PBN_MONT_CTX cdecl; external CLibCrypto; + function EC_GROUP_get_order(const group: PEC_GROUP; order: PBIGNUM; ctx: PBN_CTX): TIdC_INT cdecl; external CLibCrypto; + function EC_GROUP_get0_order(const group: PEC_GROUP): PBIGNUM cdecl; external CLibCrypto; {introduced 1.1.0} + function EC_GROUP_order_bits(const group: PEC_GROUP): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function EC_GROUP_get_cofactor(const group: PEC_GROUP; cofactor: PBIGNUM; ctx: PBN_CTX): TIdC_INT cdecl; external CLibCrypto; + function EC_GROUP_get0_cofactor(const group: PEC_GROUP): PBIGNUM cdecl; external CLibCrypto; {introduced 1.1.0} + procedure EC_GROUP_set_curve_name(group: PEC_GROUP; nid: TIdC_INT) cdecl; external CLibCrypto; + function EC_GROUP_get_curve_name(const group: PEC_GROUP): TIdC_INT cdecl; external CLibCrypto; + + procedure EC_GROUP_set_asn1_flag(group: PEC_GROUP; flag: TIdC_INT) cdecl; external CLibCrypto; + function EC_GROUP_get_asn1_flag(const group: PEC_GROUP): TIdC_INT cdecl; external CLibCrypto; + + procedure EC_GROUP_set_point_conversion_form(group: PEC_GROUP; form: point_conversion_form_t) cdecl; external CLibCrypto; + function EC_GROUP_get_point_conversion_form(const group: PEC_GROUP): point_conversion_form_t cdecl; external CLibCrypto; + + function EC_GROUP_get0_seed(const x: PEC_GROUP): PByte cdecl; external CLibCrypto; + function EC_GROUP_get_seed_len(const x: PEC_GROUP): TIdC_SIZET cdecl; external CLibCrypto; + function EC_GROUP_set_seed(x: PEC_GROUP; const p: PByte; len: TIdC_SIZET): TIdC_SIZET cdecl; external CLibCrypto; + + function EC_GROUP_set_curve(group: PEC_GROUP; const p: PBIGNUM; const a: PBIGNUM; const b: PBIGNUM; ctx: PBN_CTX): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function EC_GROUP_get_curve(const group: PEC_GROUP; p: PBIGNUM; a: PBIGNUM; b: PBIGNUM; ctx: PBN_CTX): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function EC_GROUP_set_curve_GFp(group: PEC_GROUP; const p: PBIGNUM; const a: PBIGNUM; const b: PBIGNUM; ctx: PBN_CTX): TIdC_INT cdecl; external CLibCrypto; + function EC_GROUP_get_curve_GFp(const group: PEC_GROUP; p: PBIGNUM; a: PBIGNUM; b: PBIGNUM; ctx: PBN_CTX): TIdC_INT cdecl; external CLibCrypto; + function EC_GROUP_set_curve_GF2m(group: PEC_GROUP; const p: PBIGNUM; const a: PBIGNUM; const b:PBIGNUM; ctx: PBN_CTX): TIdC_INT cdecl; external CLibCrypto; + function EC_GROUP_get_curve_GF2m(const group: PEC_GROUP; p: PBIGNUM; a: PBIGNUM; ctx: PBN_CTX): TIdC_INT cdecl; external CLibCrypto; + + function EC_GROUP_get_degree(const group: PEC_GROUP): TIdC_INT cdecl; external CLibCrypto; + function EC_GROUP_check(const group: PEC_GROUP; ctx: PBN_CTX): TIdC_INT cdecl; external CLibCrypto; + function EC_GROUP_check_discriminant(const group: PEC_GROUP; ctx: PBN_CTX): TIdC_INT cdecl; external CLibCrypto; + function EC_GROUP_cmp(const a: PEC_GROUP; const b: PEC_GROUP; ctx: PBN_CTX): TIdC_INT cdecl; external CLibCrypto; + + function EC_GROUP_new_curve_GFp(const p: PBIGNUM; const a: PBIGNUM; const b: PBIGNUM; ctx: PBN_CTX): PEC_GROUP cdecl; external CLibCrypto; + function EC_GROUP_new_curve_GF2m(const p: PBIGNUM; const a: PBIGNUM; const b: PBIGNUM; ctx: PBN_CTX): PEC_GROUP cdecl; external CLibCrypto; + function EC_GROUP_new_by_curve_name(nid: TIdC_INT): PEC_GROUP cdecl; external CLibCrypto; + function EC_GROUP_new_from_ecparameters(const params: PECPARAMETERS): PEC_GROUP cdecl; external CLibCrypto; {introduced 1.1.0} + function EC_GROUP_get_ecparameters(const group: PEC_GROUP; params: PECPARAMETERS): PECPARAMETERS cdecl; external CLibCrypto; {introduced 1.1.0} + function EC_GROUP_new_from_ecpkparameters(const params: PECPKPARAMETERS): PEC_GROUP cdecl; external CLibCrypto; {introduced 1.1.0} + function EC_GROUP_get_ecpkparameters(const group: PEC_GROUP; params: PECPKPARAMETERS): PECPKPARAMETERS cdecl; external CLibCrypto; {introduced 1.1.0} + + function EC_get_builtin_curves(r: PEC_builtin_curve; nitems: TIdC_SIZET): TIdC_SIZET cdecl; external CLibCrypto; + + function EC_curve_nid2nist(nid: TIdC_INT): PIdAnsiChar cdecl; external CLibCrypto; + function EC_curve_nist2nid(const name: PIdAnsiChar): TIdC_INT cdecl; external CLibCrypto; + + function EC_POINT_new(const group: PEC_GROUP): PEC_POINT cdecl; external CLibCrypto; + procedure EC_POINT_free(point: PEC_POINT) cdecl; external CLibCrypto; + procedure EC_POINT_clear_free(point: PEC_POINT) cdecl; external CLibCrypto; + function EC_POINT_copy(dst: PEC_POINT; const src: PEC_POINT): TIdC_INT cdecl; external CLibCrypto; + function EC_POINT_dup(const src: PEC_POINT; const group: PEC_GROUP): PEC_POINT cdecl; external CLibCrypto; + function EC_POINT_method_of(const point: PEC_POINT): PEC_METHOD cdecl; external CLibCrypto; + function EC_POINT_set_to_infinity(const group: PEC_GROUP; point: PEC_POINT): TIdC_INT cdecl; external CLibCrypto; + function EC_POINT_set_Jprojective_coordinates_GFp(const group: PEC_GROUP; p: PEC_POINT; const x: PBIGNUM; const y: PBIGNUM; const z: PBIGNUM; ctx: PBN_CTX): TIdC_INT cdecl; external CLibCrypto; + function EC_POINT_get_Jprojective_coordinates_GFp(const group: PEC_METHOD; const p: PEC_POINT; x: PBIGNUM; y: PBIGNUM; z: PBIGNUM; ctx: PBN_CTX): TIdC_INT cdecl; external CLibCrypto; + function EC_POINT_set_affine_coordinates(const group: PEC_GROUP; p: PEC_POINT; const x: PBIGNUM; const y: PBIGNUM; ctx: PBN_CTX): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function EC_POINT_get_affine_coordinates(const group: PEC_GROUP; const p: PEC_POINT; x: PBIGNUM; y: PBIGNUM; ctx: PBN_CTX): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function EC_POINT_set_affine_coordinates_GFp(const group: PEC_GROUP; p: PEC_POINT; const x: PBIGNUM; const y: PBIGNUM; ctx: PBN_CTX): TIdC_INT cdecl; external CLibCrypto; + function EC_POINT_get_affine_coordinates_GFp(const group: PEC_GROUP; const p: PEC_POINT; x: PBIGNUM; y: PBIGNUM; ctx: PBN_CTX): TIdC_INT cdecl; external CLibCrypto; + function EC_POINT_set_compressed_coordinates(const group: PEC_GROUP; p: PEC_POINT; x: PBIGNUM; y_bit: TIdC_INT; ctx: PBN_CTX): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function EC_POINT_set_compressed_coordinates_GFp(const group: PEC_GROUP; p: PEC_POINT; const x: PBIGNUM; y_bit: TIdC_INT; ctx: PBN_CTX): TIdC_INT cdecl; external CLibCrypto; + function EC_POINT_set_affine_coordinates_GF2m(const group: PEC_GROUP; p: PEC_POINT; const x: PBIGNUM; const y: PBIGNUM; ctx: PBN_CTX): TIdC_INT cdecl; external CLibCrypto; + function EC_POINT_get_affine_coordinates_GF2m(const group: PEC_GROUP; p: PEC_POINT; x: PBIGNUM; y: PBIGNUM; ctx: PBN_CTX): TIdC_INT cdecl; external CLibCrypto; + function EC_POINT_set_compressed_coordinates_GF2m(const group: PEC_GROUP; p: PEC_POINT; const x: PBIGNUM; y_bit: TIdC_INT; ctx: PBN_CTX): TIdC_INT cdecl; external CLibCrypto; + + function EC_POINT_point2oct(const group: PEC_GROUP; const p: PEC_POINT; form: point_conversion_form_t; buf: PByte; len: TIdC_SIZET; ctx: PBN_CTX): TIdC_SIZET cdecl; external CLibCrypto; + function EC_POINT_oct2point(const group: PEC_GROUP; p: PEC_POINT; const buf: PByte; len: TIdC_SIZET; ctx: PBN_CTX): TIdC_INT cdecl; external CLibCrypto; + function EC_POINT_point2buf(const group: PEC_GROUP; const point: PEC_POINT; form: point_conversion_form_t; pbuf: PPByte; ctx: PBN_CTX): TIdC_SIZET cdecl; external CLibCrypto; {introduced 1.1.0} + function EC_POINT_point2bn(const group: PEC_GROUP; const p: PEC_POINT; form: point_conversion_form_t; bn: PBIGNUM; ctx: PBN_CTX): PBIGNUM cdecl; external CLibCrypto; + function EC_POINT_bn2point(const group: PEC_GROUP; const bn: PBIGNUM; p: PEC_POINT; ctx: PBN_CTX): PEC_POINT cdecl; external CLibCrypto; + function EC_POINT_point2hex(const group: PEC_GROUP; const p: PEC_POINT; form: point_conversion_form_t; ctx: PBN_CTX): PIdAnsiChar cdecl; external CLibCrypto; + function EC_POINT_hex2point(const group: PEC_GROUP; const buf: PIdAnsiChar; p: PEC_POINT; ctx: PBN_CTX): PEC_POINT cdecl; external CLibCrypto; + + function EC_POINT_add(const group: PEC_GROUP; r: PEC_POINT; const a: PEC_POINT; const b: PEC_POINT; ctx: PBN_CTX): TIdC_INT cdecl; external CLibCrypto; + function EC_POINT_dbl(const group: PEC_GROUP; r: PEC_POINT; const a: PEC_POINT; ctx: PBN_CTX): TIdC_INT cdecl; external CLibCrypto; + function EC_POINT_invert(const group: PEC_GROUP; a: PEC_POINT; ctx: PBN_CTX): TIdC_INT cdecl; external CLibCrypto; + function EC_POINT_is_at_infinity(const group: PEC_GROUP; const p: PEC_POINT): TIdC_INT cdecl; external CLibCrypto; + function EC_POINT_is_on_curve(const group: PEC_GROUP; const point: PEC_POINT; ctx: PBN_CTX): TIdC_INT cdecl; external CLibCrypto; + function EC_POINT_cmp(const group: PEC_GROUP; const a: PEC_POINT; const b: PEC_POINT; ctx: PBN_CTX): TIdC_INT cdecl; external CLibCrypto; + function EC_POINT_make_affine(const group: PEC_GROUP; point: PEC_POINT; ctx: PBN_CTX): TIdC_INT cdecl; external CLibCrypto; + function EC_POINTs_make_affine(const group: PEC_METHOD; num: TIdC_SIZET; points: PPEC_POINT; ctx: PBN_CTX): TIdC_INT cdecl; external CLibCrypto; + function EC_POINTs_mul(const group: PEC_GROUP; r: PEC_POINT; const n: PBIGNUM; num: TIdC_SIZET; const p: PPEC_POINT; const m: PPBIGNUM; ctx: PBN_CTX): TIdC_INT cdecl; external CLibCrypto; + function EC_POINT_mul(const group: PEC_GROUP; r: PEC_POINT; const n: PBIGNUM; const q: PEC_POINT; const m: PBIGNUM; ctx: PBN_CTX): TIdC_INT cdecl; external CLibCrypto; + + function EC_GROUP_precompute_mult(group: PEC_GROUP; ctx: PBN_CTX): TIdC_INT cdecl; external CLibCrypto; + function EC_GROUP_have_precompute_mult(const group: PEC_GROUP): TIdC_INT cdecl; external CLibCrypto; + + function ECPKPARAMETERS_it: PASN1_ITEM cdecl; external CLibCrypto; + function ECPKPARAMETERS_new: PECPKPARAMETERS cdecl; external CLibCrypto; + procedure ECPKPARAMETERS_free(a: PECPKPARAMETERS) cdecl; external CLibCrypto; + + function ECPARAMETERS_it: PASN1_ITEM cdecl; external CLibCrypto; + function ECPARAMETERS_new: PECPARAMETERS cdecl; external CLibCrypto; + procedure ECPARAMETERS_free(a: PECPARAMETERS) cdecl; external CLibCrypto; + + function EC_GROUP_get_basis_type(const group: PEC_GROUP): TIdC_INT cdecl; external CLibCrypto; + function EC_GROUP_get_trinomial_basis(const group: PEC_GROUP; k: PIdC_UINT): TIdC_INT cdecl; external CLibCrypto; + function EC_GROUP_get_pentanomial_basis(const group: PEC_GROUP; k1: PIdC_UINT; k2: PIdC_UINT; k3: PIdC_UINT): TIdC_INT cdecl; external CLibCrypto; + + function d2i_ECPKParameters(group: PPEC_GROUP; const in_: PPByte; len: TIdC_LONG): PEC_GROUP cdecl; external CLibCrypto; + function i2d_ECPKParameters(const group: PEC_GROUP; out_: PPByte): TIdC_INT cdecl; external CLibCrypto; + + function ECPKParameters_print(bp: PBIO; const x: PEC_GROUP; off: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + + function EC_KEY_new: PEC_KEY cdecl; external CLibCrypto; + function EC_KEY_get_flags(const key: PEC_KEY): TIdC_INT cdecl; external CLibCrypto; + procedure EC_KEY_set_flags(key: PEC_KEY; flags: TIdC_INT) cdecl; external CLibCrypto; + procedure EC_KEY_clear_flags(key: PEC_KEY; flags: TIdC_INT) cdecl; external CLibCrypto; + function EC_KEY_new_by_curve_name(nid: TIdC_INT): PEC_KEY cdecl; external CLibCrypto; + procedure EC_KEY_free(key: PEC_KEY) cdecl; external CLibCrypto; + function EC_KEY_copy(dst: PEC_KEY; const src: PEC_KEY): PEC_KEY cdecl; external CLibCrypto; + function EC_KEY_dup(const src: PEC_KEY): PEC_KEY cdecl; external CLibCrypto; + function EC_KEY_up_ref(key: PEC_KEY): TIdC_INT cdecl; external CLibCrypto; + function EC_KEY_get0_engine(const eckey: PEC_KEY): PENGINE cdecl; external CLibCrypto; {introduced 1.1.0} + function EC_KEY_get0_group(const key: PEC_KEY): PEC_GROUP cdecl; external CLibCrypto; + function EC_KEY_set_group(key: PEC_KEY; const group: PEC_GROUP): TIdC_INT cdecl; external CLibCrypto; + function EC_KEY_get0_private_key(const key: PEC_KEY): PBIGNUM cdecl; external CLibCrypto; + function EC_KEY_set_private_key(const key: PEC_KEY; const prv: PBIGNUM): TIdC_INT cdecl; external CLibCrypto; + function EC_KEY_get0_public_key(const key: PEC_KEY): PEC_POINT cdecl; external CLibCrypto; + function EC_KEY_set_public_key(key: PEC_KEY; const pub: PEC_POINT): TIdC_INT cdecl; external CLibCrypto; + function EC_KEY_get_enc_flags(const key: PEC_KEY): TIdC_UINT cdecl; external CLibCrypto; + procedure EC_KEY_set_enc_flags(eckey: PEC_KEY; flags: TIdC_UINT) cdecl; external CLibCrypto; + function EC_KEY_get_conv_form(const key: PEC_KEY): point_conversion_form_t cdecl; external CLibCrypto; + procedure EC_KEY_set_conv_form(eckey: PEC_KEY; cform: point_conversion_form_t) cdecl; external CLibCrypto; + function EC_KEY_set_ex_data(key: PEC_KEY; idx: TIdC_INT; arg: Pointer): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function EC_KEY_get_ex_data(const key: PEC_KEY; idx: TIdC_INT): Pointer cdecl; external CLibCrypto; {introduced 1.1.0} + procedure EC_KEY_set_asn1_flag(eckey: PEC_KEY; asn1_flag: TIdC_INT) cdecl; external CLibCrypto; + function EC_KEY_precompute_mult(key: PEC_KEY; ctx: PBN_CTX): TIdC_INT cdecl; external CLibCrypto; + function EC_KEY_generate_key(key: PEC_KEY): TIdC_INT cdecl; external CLibCrypto; + function EC_KEY_check_key(const key: PEC_KEY): TIdC_INT cdecl; external CLibCrypto; + function EC_KEY_can_sign(const eckey: PEC_KEY): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function EC_KEY_set_public_key_affine_coordinates(key: PEC_KEY; x: PBIGNUM; y: PBIGNUM): TIdC_INT cdecl; external CLibCrypto; + function EC_KEY_key2buf(const key: PEC_KEY; form: point_conversion_form_t; pbuf: PPByte; ctx: PBN_CTX): TIdC_SIZET cdecl; external CLibCrypto; {introduced 1.1.0} + function EC_KEY_oct2key(key: PEC_KEY; const buf: PByte; len: TIdC_SIZET; ctx: PBN_CTX): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function EC_KEY_oct2priv(key: PEC_KEY; const buf: PByte; len: TIdC_SIZET): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function EC_KEY_priv2oct(const key: PEC_KEY; buf: PByte; len: TIdC_SIZET): TIdC_SIZET cdecl; external CLibCrypto; {introduced 1.1.0} + function EC_KEY_priv2buf(const eckey: PEC_KEY; buf: PPByte): TIdC_SIZET cdecl; external CLibCrypto; {introduced 1.1.0} + + function d2i_ECPrivateKey(key: PPEC_KEY; const in_: PPByte; len: TIdC_LONG): PEC_KEY cdecl; external CLibCrypto; + function i2d_ECPrivateKey(key: PEC_KEY; out_: PPByte): TIdC_INT cdecl; external CLibCrypto; + function o2i_ECPublicKey(key: PPEC_KEY; const in_: PPByte; len: TIdC_LONG): PEC_KEY cdecl; external CLibCrypto; + function i2o_ECPublicKey(const key: PEC_KEY; out_: PPByte): TIdC_INT cdecl; external CLibCrypto; + + function ECParameters_print(bp: PBIO; const key: PEC_KEY): TIdC_INT cdecl; external CLibCrypto; + function EC_KEY_print(bp: PBIO; const key: PEC_KEY; off: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + + function EC_KEY_OpenSSL: PEC_KEY_METHOD cdecl; external CLibCrypto; {introduced 1.1.0} + function EC_KEY_get_default_method: PEC_KEY_METHOD cdecl; external CLibCrypto; {introduced 1.1.0} + procedure EC_KEY_set_default_method(const meth: PEC_KEY_METHOD) cdecl; external CLibCrypto; {introduced 1.1.0} + function EC_KEY_get_method(const key: PEC_KEY): PEC_KEY_METHOD cdecl; external CLibCrypto; {introduced 1.1.0} + function EC_KEY_set_method(key: PEC_KEY; const meth: PEC_KEY_METHOD): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function EC_KEY_new_method(engine: PENGINE): PEC_KEY cdecl; external CLibCrypto; {introduced 1.1.0} + + function ECDH_KDF_X9_62(out_: PByte; outlen: TIdC_SIZET; const Z: PByte; Zlen: TIdC_SIZET; const sinfo: PByte; sinfolen: TIdC_SIZET; const md: PEVP_MD): TIdC_INT cdecl; external CLibCrypto; + function ECDH_compute_key(out_: Pointer; oulen: TIdC_SIZET; const pub_key: PEC_POINT; const ecdh: PEC_KEY; kdf: ECDH_compute_key_KDF): TIdC_INT cdecl; external CLibCrypto; + + function ECDSA_SIG_new: PECDSA_SIG cdecl; external CLibCrypto; + procedure ECDSA_SIG_free(sig: PECDSA_SIG) cdecl; external CLibCrypto; + function i2d_ECDSA_SIG(const sig: PECDSA_SIG; pp: PPByte): TIdC_INT cdecl; external CLibCrypto; + function d2i_ECDSA_SIG(sig: PPECDSA_SIG; const pp: PPByte; len: TIdC_LONG): PECDSA_SIG cdecl; external CLibCrypto; + procedure ECDSA_SIG_get0(const sig: PECDSA_SIG; const pr: PPBIGNUM; const ps: PPBIGNUM) cdecl; external CLibCrypto; {introduced 1.1.0} + function ECDSA_SIG_get0_r(const sig: PECDSA_SIG): PBIGNUM cdecl; external CLibCrypto; {introduced 1.1.0} + function ECDSA_SIG_get0_s(const sig: PECDSA_SIG): PBIGNUM cdecl; external CLibCrypto; {introduced 1.1.0} + function ECDSA_SIG_set0(sig: PECDSA_SIG; r: PBIGNUM; s: PBIGNUM): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function ECDSA_do_sign(const dgst: PByte; dgst_len: TIdC_INT; eckey: PEC_KEY): PECDSA_SIG cdecl; external CLibCrypto; + function ECDSA_do_sign_ex(const dgst: PByte; dgst_len: TIdC_INT; const kinv: PBIGNUM; const rp: PBIGNUM; eckey: PEC_KEY): PECDSA_SIG cdecl; external CLibCrypto; + function ECDSA_do_verify(const dgst: PByte; dgst_len: TIdC_INT; const sig: PECDSA_SIG; eckey: PEC_KEY): TIdC_INT cdecl; external CLibCrypto; + function ECDSA_sign_setup(eckey: PEC_KEY; ctx: PBN_CTX; kiv: PPBIGNUM; rp: PPBIGNUM): TIdC_INT cdecl; external CLibCrypto; + function ECDSA_sign(type_: TIdC_INT; const dgst: PByte; dgstlen: TIdC_INT; sig: PByte; siglen: PIdC_UINT; eckey: PEC_KEY): TIdC_INT cdecl; external CLibCrypto; + function ECDSA_sign_ex(type_: TIdC_INT; const dgst: PByte; dgstlen: TIdC_INT; sig: PByte; siglen: PIdC_UINT; const kinv: PBIGNUM; const rp: PBIGNUM; eckey: PEC_KEY): TIdC_INT cdecl; external CLibCrypto; + function ECDSA_verify(type_: TIdC_INT; const dgst: PByte; dgstlen: TIdC_INT; const sig: PByte; siglen: TIdC_INT; eckey: PEC_KEY): TIdC_INT cdecl; external CLibCrypto; + function ECDSA_size(const eckey: PEC_KEY): TIdC_INT cdecl; external CLibCrypto; + + function EC_KEY_METHOD_new(const meth: PEC_KEY_METHOD): PEC_KEY_METHOD cdecl; external CLibCrypto; {introduced 1.1.0} + procedure EC_KEY_METHOD_free(meth: PEC_KEY_METHOD) cdecl; external CLibCrypto; {introduced 1.1.0} + procedure EC_KEY_METHOD_set_init(meth: PEC_KEY_METHOD; init: EC_KEY_METHOD_init_init; finish: EC_KEY_METHOD_init_finish; copy: EC_KEY_METHOD_init_copy; set_group: EC_KEY_METHOD_init_set_group; set_private: EC_KEY_METHOD_init_set_private; set_public: EC_KEY_METHOD_init_set_public) cdecl; external CLibCrypto; {introduced 1.1.0} + procedure EC_KEY_METHOD_set_keygen(meth: PEC_KEY_METHOD; keygen: EC_KEY_METHOD_keygen_keygen) cdecl; external CLibCrypto; {introduced 1.1.0} + procedure EC_KEY_METHOD_set_compute_key(meth: PEC_KEY_METHOD; ckey: EC_KEY_METHOD_compute_key_ckey) cdecl; external CLibCrypto; {introduced 1.1.0} + procedure EC_KEY_METHOD_set_sign(meth: PEC_KEY_METHOD; sign: EC_KEY_METHOD_sign_sign; sign_setup: EC_KEY_METHOD_sign_sign_setup; sign_sig: EC_KEY_METHOD_sign_sign_sig) cdecl; external CLibCrypto; {introduced 1.1.0} + procedure EC_KEY_METHOD_set_verify(meth: PEC_KEY_METHOD; verify: EC_KEY_METHOD_verify_verify; verify_sig: EC_KEY_METHOD_verify_verify_sig) cdecl; external CLibCrypto; {introduced 1.1.0} + + procedure EC_KEY_METHOD_get_init(const meth: PEC_KEY_METHOD; pinit: PEC_KEY_METHOD_init_init; pfinish: PEC_KEY_METHOD_init_finish; pcopy: PEC_KEY_METHOD_init_copy; pset_group: PEC_KEY_METHOD_init_set_group; pset_private: PEC_KEY_METHOD_init_set_private; pset_public: PEC_KEY_METHOD_init_set_public) cdecl; external CLibCrypto; {introduced 1.1.0} + procedure EC_KEY_METHOD_get_keygen(const meth: PEC_KEY_METHOD; pkeygen: PEC_KEY_METHOD_keygen_keygen) cdecl; external CLibCrypto; {introduced 1.1.0} + procedure EC_KEY_METHOD_get_compute_key(const meth: PEC_KEY_METHOD; pck: PEC_KEY_METHOD_compute_key_ckey) cdecl; external CLibCrypto; {introduced 1.1.0} + procedure EC_KEY_METHOD_get_sign(const meth: PEC_KEY_METHOD; psign: PEC_KEY_METHOD_sign_sign; psign_setup: PEC_KEY_METHOD_sign_sign_setup; psign_sig: PEC_KEY_METHOD_sign_sign_sig) cdecl; external CLibCrypto; {introduced 1.1.0} + procedure EC_KEY_METHOD_get_verify(const meth: PEC_KEY_METHOD; pverify: PEC_KEY_METHOD_verify_verify; pverify_sig: PEC_KEY_METHOD_verify_verify_sig) cdecl; external CLibCrypto; {introduced 1.1.0} + +{$ENDIF} + +implementation + + uses + classes, + IdSSLOpenSSLExceptionHandlers, + IdResourceStringsOpenSSL + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + ,IdSSLOpenSSLLoader + {$ENDIF}; + +const + EC_GFp_nistp224_method_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EC_GFp_nistp256_method_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EC_GFp_nistp521_method_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EC_GROUP_get0_order_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EC_GROUP_order_bits_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EC_GROUP_get0_cofactor_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EC_GROUP_set_curve_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EC_GROUP_get_curve_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EC_GROUP_new_from_ecparameters_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EC_GROUP_get_ecparameters_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EC_GROUP_new_from_ecpkparameters_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EC_GROUP_get_ecpkparameters_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EC_POINT_set_affine_coordinates_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EC_POINT_get_affine_coordinates_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EC_POINT_set_compressed_coordinates_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EC_POINT_point2buf_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EC_KEY_get0_engine_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EC_KEY_set_ex_data_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EC_KEY_get_ex_data_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EC_KEY_can_sign_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EC_KEY_key2buf_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EC_KEY_oct2key_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EC_KEY_oct2priv_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EC_KEY_priv2oct_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EC_KEY_priv2buf_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EC_KEY_OpenSSL_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EC_KEY_get_default_method_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EC_KEY_set_default_method_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EC_KEY_get_method_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EC_KEY_set_method_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EC_KEY_new_method_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + ECDSA_SIG_get0_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + ECDSA_SIG_get0_r_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + ECDSA_SIG_get0_s_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + ECDSA_SIG_set0_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EC_KEY_METHOD_new_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EC_KEY_METHOD_free_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EC_KEY_METHOD_set_init_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EC_KEY_METHOD_set_keygen_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EC_KEY_METHOD_set_compute_key_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EC_KEY_METHOD_set_sign_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EC_KEY_METHOD_set_verify_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EC_KEY_METHOD_get_init_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EC_KEY_METHOD_get_keygen_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EC_KEY_METHOD_get_compute_key_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EC_KEY_METHOD_get_sign_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EC_KEY_METHOD_get_verify_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EC_GFp_nistp224_method_removed = (byte(3) shl 8 or byte(0)) shl 8 or byte(0); + EC_GFp_nistp256_method_removed = (byte(3) shl 8 or byte(0)) shl 8 or byte(0); + EC_GFp_nistp521_method_removed = (byte(3) shl 8 or byte(0)) shl 8 or byte(0); + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +const + EC_GFp_simple_method_procname = 'EC_GFp_simple_method'; + EC_GFp_mont_method_procname = 'EC_GFp_mont_method'; + EC_GFp_nist_method_procname = 'EC_GFp_nist_method'; + EC_GFp_nistp224_method_procname = 'EC_GFp_nistp224_method'; {introduced 1.1.0 removed 3.0.0} + EC_GFp_nistp256_method_procname = 'EC_GFp_nistp256_method'; {introduced 1.1.0 removed 3.0.0} + EC_GFp_nistp521_method_procname = 'EC_GFp_nistp521_method'; {introduced 1.1.0 removed 3.0.0} + + EC_GF2m_simple_method_procname = 'EC_GF2m_simple_method'; + + EC_GROUP_new_procname = 'EC_GROUP_new'; + EC_GROUP_free_procname = 'EC_GROUP_free'; + EC_GROUP_clear_free_procname = 'EC_GROUP_clear_free'; + EC_GROUP_copy_procname = 'EC_GROUP_copy'; + EC_GROUP_dup_procname = 'EC_GROUP_dup'; + EC_GROUP_method_of_procname = 'EC_GROUP_method_of'; + EC_METHOD_get_field_type_procname = 'EC_METHOD_get_field_type'; + EC_GROUP_set_generator_procname = 'EC_GROUP_set_generator'; + EC_GROUP_get0_generator_procname = 'EC_GROUP_get0_generator'; + EC_GROUP_get_mont_data_procname = 'EC_GROUP_get_mont_data'; + EC_GROUP_get_order_procname = 'EC_GROUP_get_order'; + EC_GROUP_get0_order_procname = 'EC_GROUP_get0_order'; {introduced 1.1.0} + EC_GROUP_order_bits_procname = 'EC_GROUP_order_bits'; {introduced 1.1.0} + EC_GROUP_get_cofactor_procname = 'EC_GROUP_get_cofactor'; + EC_GROUP_get0_cofactor_procname = 'EC_GROUP_get0_cofactor'; {introduced 1.1.0} + EC_GROUP_set_curve_name_procname = 'EC_GROUP_set_curve_name'; + EC_GROUP_get_curve_name_procname = 'EC_GROUP_get_curve_name'; + + EC_GROUP_set_asn1_flag_procname = 'EC_GROUP_set_asn1_flag'; + EC_GROUP_get_asn1_flag_procname = 'EC_GROUP_get_asn1_flag'; + + EC_GROUP_set_point_conversion_form_procname = 'EC_GROUP_set_point_conversion_form'; + EC_GROUP_get_point_conversion_form_procname = 'EC_GROUP_get_point_conversion_form'; + + EC_GROUP_get0_seed_procname = 'EC_GROUP_get0_seed'; + EC_GROUP_get_seed_len_procname = 'EC_GROUP_get_seed_len'; + EC_GROUP_set_seed_procname = 'EC_GROUP_set_seed'; + + EC_GROUP_set_curve_procname = 'EC_GROUP_set_curve'; {introduced 1.1.0} + EC_GROUP_get_curve_procname = 'EC_GROUP_get_curve'; {introduced 1.1.0} + EC_GROUP_set_curve_GFp_procname = 'EC_GROUP_set_curve_GFp'; + EC_GROUP_get_curve_GFp_procname = 'EC_GROUP_get_curve_GFp'; + EC_GROUP_set_curve_GF2m_procname = 'EC_GROUP_set_curve_GF2m'; + EC_GROUP_get_curve_GF2m_procname = 'EC_GROUP_get_curve_GF2m'; + + EC_GROUP_get_degree_procname = 'EC_GROUP_get_degree'; + EC_GROUP_check_procname = 'EC_GROUP_check'; + EC_GROUP_check_discriminant_procname = 'EC_GROUP_check_discriminant'; + EC_GROUP_cmp_procname = 'EC_GROUP_cmp'; + + EC_GROUP_new_curve_GFp_procname = 'EC_GROUP_new_curve_GFp'; + EC_GROUP_new_curve_GF2m_procname = 'EC_GROUP_new_curve_GF2m'; + EC_GROUP_new_by_curve_name_procname = 'EC_GROUP_new_by_curve_name'; + EC_GROUP_new_from_ecparameters_procname = 'EC_GROUP_new_from_ecparameters'; {introduced 1.1.0} + EC_GROUP_get_ecparameters_procname = 'EC_GROUP_get_ecparameters'; {introduced 1.1.0} + EC_GROUP_new_from_ecpkparameters_procname = 'EC_GROUP_new_from_ecpkparameters'; {introduced 1.1.0} + EC_GROUP_get_ecpkparameters_procname = 'EC_GROUP_get_ecpkparameters'; {introduced 1.1.0} + + EC_get_builtin_curves_procname = 'EC_get_builtin_curves'; + + EC_curve_nid2nist_procname = 'EC_curve_nid2nist'; + EC_curve_nist2nid_procname = 'EC_curve_nist2nid'; + + EC_POINT_new_procname = 'EC_POINT_new'; + EC_POINT_free_procname = 'EC_POINT_free'; + EC_POINT_clear_free_procname = 'EC_POINT_clear_free'; + EC_POINT_copy_procname = 'EC_POINT_copy'; + EC_POINT_dup_procname = 'EC_POINT_dup'; + EC_POINT_method_of_procname = 'EC_POINT_method_of'; + EC_POINT_set_to_infinity_procname = 'EC_POINT_set_to_infinity'; + EC_POINT_set_Jprojective_coordinates_GFp_procname = 'EC_POINT_set_Jprojective_coordinates_GFp'; + EC_POINT_get_Jprojective_coordinates_GFp_procname = 'EC_POINT_get_Jprojective_coordinates_GFp'; + EC_POINT_set_affine_coordinates_procname = 'EC_POINT_set_affine_coordinates'; {introduced 1.1.0} + EC_POINT_get_affine_coordinates_procname = 'EC_POINT_get_affine_coordinates'; {introduced 1.1.0} + EC_POINT_set_affine_coordinates_GFp_procname = 'EC_POINT_set_affine_coordinates_GFp'; + EC_POINT_get_affine_coordinates_GFp_procname = 'EC_POINT_get_affine_coordinates_GFp'; + EC_POINT_set_compressed_coordinates_procname = 'EC_POINT_set_compressed_coordinates'; {introduced 1.1.0} + EC_POINT_set_compressed_coordinates_GFp_procname = 'EC_POINT_set_compressed_coordinates_GFp'; + EC_POINT_set_affine_coordinates_GF2m_procname = 'EC_POINT_set_affine_coordinates_GF2m'; + EC_POINT_get_affine_coordinates_GF2m_procname = 'EC_POINT_get_affine_coordinates_GF2m'; + EC_POINT_set_compressed_coordinates_GF2m_procname = 'EC_POINT_set_compressed_coordinates_GF2m'; + + EC_POINT_point2oct_procname = 'EC_POINT_point2oct'; + EC_POINT_oct2point_procname = 'EC_POINT_oct2point'; + EC_POINT_point2buf_procname = 'EC_POINT_point2buf'; {introduced 1.1.0} + EC_POINT_point2bn_procname = 'EC_POINT_point2bn'; + EC_POINT_bn2point_procname = 'EC_POINT_bn2point'; + EC_POINT_point2hex_procname = 'EC_POINT_point2hex'; + EC_POINT_hex2point_procname = 'EC_POINT_hex2point'; + + EC_POINT_add_procname = 'EC_POINT_add'; + EC_POINT_dbl_procname = 'EC_POINT_dbl'; + EC_POINT_invert_procname = 'EC_POINT_invert'; + EC_POINT_is_at_infinity_procname = 'EC_POINT_is_at_infinity'; + EC_POINT_is_on_curve_procname = 'EC_POINT_is_on_curve'; + EC_POINT_cmp_procname = 'EC_POINT_cmp'; + EC_POINT_make_affine_procname = 'EC_POINT_make_affine'; + EC_POINTs_make_affine_procname = 'EC_POINTs_make_affine'; + EC_POINTs_mul_procname = 'EC_POINTs_mul'; + EC_POINT_mul_procname = 'EC_POINT_mul'; + + EC_GROUP_precompute_mult_procname = 'EC_GROUP_precompute_mult'; + EC_GROUP_have_precompute_mult_procname = 'EC_GROUP_have_precompute_mult'; + + ECPKPARAMETERS_it_procname = 'ECPKPARAMETERS_it'; + ECPKPARAMETERS_new_procname = 'ECPKPARAMETERS_new'; + ECPKPARAMETERS_free_procname = 'ECPKPARAMETERS_free'; + + ECPARAMETERS_it_procname = 'ECPARAMETERS_it'; + ECPARAMETERS_new_procname = 'ECPARAMETERS_new'; + ECPARAMETERS_free_procname = 'ECPARAMETERS_free'; + + EC_GROUP_get_basis_type_procname = 'EC_GROUP_get_basis_type'; + EC_GROUP_get_trinomial_basis_procname = 'EC_GROUP_get_trinomial_basis'; + EC_GROUP_get_pentanomial_basis_procname = 'EC_GROUP_get_pentanomial_basis'; + + d2i_ECPKParameters_procname = 'd2i_ECPKParameters'; + i2d_ECPKParameters_procname = 'i2d_ECPKParameters'; + + ECPKParameters_print_procname = 'ECPKParameters_print'; + + EC_KEY_new_procname = 'EC_KEY_new'; + EC_KEY_get_flags_procname = 'EC_KEY_get_flags'; + EC_KEY_set_flags_procname = 'EC_KEY_set_flags'; + EC_KEY_clear_flags_procname = 'EC_KEY_clear_flags'; + EC_KEY_new_by_curve_name_procname = 'EC_KEY_new_by_curve_name'; + EC_KEY_free_procname = 'EC_KEY_free'; + EC_KEY_copy_procname = 'EC_KEY_copy'; + EC_KEY_dup_procname = 'EC_KEY_dup'; + EC_KEY_up_ref_procname = 'EC_KEY_up_ref'; + EC_KEY_get0_engine_procname = 'EC_KEY_get0_engine'; {introduced 1.1.0} + EC_KEY_get0_group_procname = 'EC_KEY_get0_group'; + EC_KEY_set_group_procname = 'EC_KEY_set_group'; + EC_KEY_get0_private_key_procname = 'EC_KEY_get0_private_key'; + EC_KEY_set_private_key_procname = 'EC_KEY_set_private_key'; + EC_KEY_get0_public_key_procname = 'EC_KEY_get0_public_key'; + EC_KEY_set_public_key_procname = 'EC_KEY_set_public_key'; + EC_KEY_get_enc_flags_procname = 'EC_KEY_get_enc_flags'; + EC_KEY_set_enc_flags_procname = 'EC_KEY_set_enc_flags'; + EC_KEY_get_conv_form_procname = 'EC_KEY_get_conv_form'; + EC_KEY_set_conv_form_procname = 'EC_KEY_set_conv_form'; + EC_KEY_set_ex_data_procname = 'EC_KEY_set_ex_data'; {introduced 1.1.0} + EC_KEY_get_ex_data_procname = 'EC_KEY_get_ex_data'; {introduced 1.1.0} + EC_KEY_set_asn1_flag_procname = 'EC_KEY_set_asn1_flag'; + EC_KEY_precompute_mult_procname = 'EC_KEY_precompute_mult'; + EC_KEY_generate_key_procname = 'EC_KEY_generate_key'; + EC_KEY_check_key_procname = 'EC_KEY_check_key'; + EC_KEY_can_sign_procname = 'EC_KEY_can_sign'; {introduced 1.1.0} + EC_KEY_set_public_key_affine_coordinates_procname = 'EC_KEY_set_public_key_affine_coordinates'; + EC_KEY_key2buf_procname = 'EC_KEY_key2buf'; {introduced 1.1.0} + EC_KEY_oct2key_procname = 'EC_KEY_oct2key'; {introduced 1.1.0} + EC_KEY_oct2priv_procname = 'EC_KEY_oct2priv'; {introduced 1.1.0} + EC_KEY_priv2oct_procname = 'EC_KEY_priv2oct'; {introduced 1.1.0} + EC_KEY_priv2buf_procname = 'EC_KEY_priv2buf'; {introduced 1.1.0} + + d2i_ECPrivateKey_procname = 'd2i_ECPrivateKey'; + i2d_ECPrivateKey_procname = 'i2d_ECPrivateKey'; + o2i_ECPublicKey_procname = 'o2i_ECPublicKey'; + i2o_ECPublicKey_procname = 'i2o_ECPublicKey'; + + ECParameters_print_procname = 'ECParameters_print'; + EC_KEY_print_procname = 'EC_KEY_print'; + + EC_KEY_OpenSSL_procname = 'EC_KEY_OpenSSL'; {introduced 1.1.0} + EC_KEY_get_default_method_procname = 'EC_KEY_get_default_method'; {introduced 1.1.0} + EC_KEY_set_default_method_procname = 'EC_KEY_set_default_method'; {introduced 1.1.0} + EC_KEY_get_method_procname = 'EC_KEY_get_method'; {introduced 1.1.0} + EC_KEY_set_method_procname = 'EC_KEY_set_method'; {introduced 1.1.0} + EC_KEY_new_method_procname = 'EC_KEY_new_method'; {introduced 1.1.0} + + ECDH_KDF_X9_62_procname = 'ECDH_KDF_X9_62'; + ECDH_compute_key_procname = 'ECDH_compute_key'; + + ECDSA_SIG_new_procname = 'ECDSA_SIG_new'; + ECDSA_SIG_free_procname = 'ECDSA_SIG_free'; + i2d_ECDSA_SIG_procname = 'i2d_ECDSA_SIG'; + d2i_ECDSA_SIG_procname = 'd2i_ECDSA_SIG'; + ECDSA_SIG_get0_procname = 'ECDSA_SIG_get0'; {introduced 1.1.0} + ECDSA_SIG_get0_r_procname = 'ECDSA_SIG_get0_r'; {introduced 1.1.0} + ECDSA_SIG_get0_s_procname = 'ECDSA_SIG_get0_s'; {introduced 1.1.0} + ECDSA_SIG_set0_procname = 'ECDSA_SIG_set0'; {introduced 1.1.0} + ECDSA_do_sign_procname = 'ECDSA_do_sign'; + ECDSA_do_sign_ex_procname = 'ECDSA_do_sign_ex'; + ECDSA_do_verify_procname = 'ECDSA_do_verify'; + ECDSA_sign_setup_procname = 'ECDSA_sign_setup'; + ECDSA_sign_procname = 'ECDSA_sign'; + ECDSA_sign_ex_procname = 'ECDSA_sign_ex'; + ECDSA_verify_procname = 'ECDSA_verify'; + ECDSA_size_procname = 'ECDSA_size'; + + EC_KEY_METHOD_new_procname = 'EC_KEY_METHOD_new'; {introduced 1.1.0} + EC_KEY_METHOD_free_procname = 'EC_KEY_METHOD_free'; {introduced 1.1.0} + EC_KEY_METHOD_set_init_procname = 'EC_KEY_METHOD_set_init'; {introduced 1.1.0} + EC_KEY_METHOD_set_keygen_procname = 'EC_KEY_METHOD_set_keygen'; {introduced 1.1.0} + EC_KEY_METHOD_set_compute_key_procname = 'EC_KEY_METHOD_set_compute_key'; {introduced 1.1.0} + EC_KEY_METHOD_set_sign_procname = 'EC_KEY_METHOD_set_sign'; {introduced 1.1.0} + EC_KEY_METHOD_set_verify_procname = 'EC_KEY_METHOD_set_verify'; {introduced 1.1.0} + + EC_KEY_METHOD_get_init_procname = 'EC_KEY_METHOD_get_init'; {introduced 1.1.0} + EC_KEY_METHOD_get_keygen_procname = 'EC_KEY_METHOD_get_keygen'; {introduced 1.1.0} + EC_KEY_METHOD_get_compute_key_procname = 'EC_KEY_METHOD_get_compute_key'; {introduced 1.1.0} + EC_KEY_METHOD_get_sign_procname = 'EC_KEY_METHOD_get_sign'; {introduced 1.1.0} + EC_KEY_METHOD_get_verify_procname = 'EC_KEY_METHOD_get_verify'; {introduced 1.1.0} + + +{$WARN NO_RETVAL OFF} +function ERR_EC_GFp_simple_method: PEC_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_GFp_simple_method_procname); +end; + + +function ERR_EC_GFp_mont_method: PEC_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_GFp_mont_method_procname); +end; + + +function ERR_EC_GFp_nist_method: PEC_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_GFp_nist_method_procname); +end; + + +function ERR_EC_GFp_nistp224_method: PEC_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_GFp_nistp224_method_procname); +end; + + +function ERR_EC_GFp_nistp256_method: PEC_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_GFp_nistp256_method_procname); +end; + + +function ERR_EC_GFp_nistp521_method: PEC_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_GFp_nistp521_method_procname); +end; + + + +function ERR_EC_GF2m_simple_method: PEC_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_GF2m_simple_method_procname); +end; + + + +function ERR_EC_GROUP_new(const meth: PEC_METHOD): PEC_GROUP; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_GROUP_new_procname); +end; + + +procedure ERR_EC_GROUP_free(group: PEC_GROUP); +begin + EIdAPIFunctionNotPresent.RaiseException(EC_GROUP_free_procname); +end; + + +procedure ERR_EC_GROUP_clear_free(group: PEC_GROUP); +begin + EIdAPIFunctionNotPresent.RaiseException(EC_GROUP_clear_free_procname); +end; + + +function ERR_EC_GROUP_copy(dst: PEC_GROUP; const src: PEC_GROUP): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_GROUP_copy_procname); +end; + + +function ERR_EC_GROUP_dup(const src: PEC_GROUP): PEC_GROUP; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_GROUP_dup_procname); +end; + + +function ERR_EC_GROUP_method_of(const group: PEC_GROUP): PEC_GROUP; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_GROUP_method_of_procname); +end; + + +function ERR_EC_METHOD_get_field_type(const meth: PEC_METHOD): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_METHOD_get_field_type_procname); +end; + + +function ERR_EC_GROUP_set_generator(group: PEC_GROUP; const generator: PEC_POINT; const order: PBIGNUM; const cofactor: PBIGNUM): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_GROUP_set_generator_procname); +end; + + +function ERR_EC_GROUP_get0_generator(const group: PEC_GROUP): PEC_POINT; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_GROUP_get0_generator_procname); +end; + + +function ERR_EC_GROUP_get_mont_data(const group: PEC_GROUP): PBN_MONT_CTX; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_GROUP_get_mont_data_procname); +end; + + +function ERR_EC_GROUP_get_order(const group: PEC_GROUP; order: PBIGNUM; ctx: PBN_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_GROUP_get_order_procname); +end; + + +function ERR_EC_GROUP_get0_order(const group: PEC_GROUP): PBIGNUM; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_GROUP_get0_order_procname); +end; + + {introduced 1.1.0} +function ERR_EC_GROUP_order_bits(const group: PEC_GROUP): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_GROUP_order_bits_procname); +end; + + {introduced 1.1.0} +function ERR_EC_GROUP_get_cofactor(const group: PEC_GROUP; cofactor: PBIGNUM; ctx: PBN_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_GROUP_get_cofactor_procname); +end; + + +function ERR_EC_GROUP_get0_cofactor(const group: PEC_GROUP): PBIGNUM; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_GROUP_get0_cofactor_procname); +end; + + {introduced 1.1.0} +procedure ERR_EC_GROUP_set_curve_name(group: PEC_GROUP; nid: TIdC_INT); +begin + EIdAPIFunctionNotPresent.RaiseException(EC_GROUP_set_curve_name_procname); +end; + + +function ERR_EC_GROUP_get_curve_name(const group: PEC_GROUP): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_GROUP_get_curve_name_procname); +end; + + + +procedure ERR_EC_GROUP_set_asn1_flag(group: PEC_GROUP; flag: TIdC_INT); +begin + EIdAPIFunctionNotPresent.RaiseException(EC_GROUP_set_asn1_flag_procname); +end; + + +function ERR_EC_GROUP_get_asn1_flag(const group: PEC_GROUP): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_GROUP_get_asn1_flag_procname); +end; + + + +procedure ERR_EC_GROUP_set_point_conversion_form(group: PEC_GROUP; form: point_conversion_form_t); +begin + EIdAPIFunctionNotPresent.RaiseException(EC_GROUP_set_point_conversion_form_procname); +end; + + +function ERR_EC_GROUP_get_point_conversion_form(const group: PEC_GROUP): point_conversion_form_t; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_GROUP_get_point_conversion_form_procname); +end; + + + +function ERR_EC_GROUP_get0_seed(const x: PEC_GROUP): PByte; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_GROUP_get0_seed_procname); +end; + + +function ERR_EC_GROUP_get_seed_len(const x: PEC_GROUP): TIdC_SIZET; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_GROUP_get_seed_len_procname); +end; + + +function ERR_EC_GROUP_set_seed(x: PEC_GROUP; const p: PByte; len: TIdC_SIZET): TIdC_SIZET; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_GROUP_set_seed_procname); +end; + + + +function ERR_EC_GROUP_set_curve(group: PEC_GROUP; const p: PBIGNUM; const a: PBIGNUM; const b: PBIGNUM; ctx: PBN_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_GROUP_set_curve_procname); +end; + + {introduced 1.1.0} +function ERR_EC_GROUP_get_curve(const group: PEC_GROUP; p: PBIGNUM; a: PBIGNUM; b: PBIGNUM; ctx: PBN_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_GROUP_get_curve_procname); +end; + + {introduced 1.1.0} +function ERR_EC_GROUP_set_curve_GFp(group: PEC_GROUP; const p: PBIGNUM; const a: PBIGNUM; const b: PBIGNUM; ctx: PBN_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_GROUP_set_curve_GFp_procname); +end; + + +function ERR_EC_GROUP_get_curve_GFp(const group: PEC_GROUP; p: PBIGNUM; a: PBIGNUM; b: PBIGNUM; ctx: PBN_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_GROUP_get_curve_GFp_procname); +end; + + +function ERR_EC_GROUP_set_curve_GF2m(group: PEC_GROUP; const p: PBIGNUM; const a: PBIGNUM; const b:PBIGNUM; ctx: PBN_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_GROUP_set_curve_GF2m_procname); +end; + + +function ERR_EC_GROUP_get_curve_GF2m(const group: PEC_GROUP; p: PBIGNUM; a: PBIGNUM; ctx: PBN_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_GROUP_get_curve_GF2m_procname); +end; + + + +function ERR_EC_GROUP_get_degree(const group: PEC_GROUP): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_GROUP_get_degree_procname); +end; + + +function ERR_EC_GROUP_check(const group: PEC_GROUP; ctx: PBN_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_GROUP_check_procname); +end; + + +function ERR_EC_GROUP_check_discriminant(const group: PEC_GROUP; ctx: PBN_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_GROUP_check_discriminant_procname); +end; + + +function ERR_EC_GROUP_cmp(const a: PEC_GROUP; const b: PEC_GROUP; ctx: PBN_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_GROUP_cmp_procname); +end; + + + +function ERR_EC_GROUP_new_curve_GFp(const p: PBIGNUM; const a: PBIGNUM; const b: PBIGNUM; ctx: PBN_CTX): PEC_GROUP; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_GROUP_new_curve_GFp_procname); +end; + + +function ERR_EC_GROUP_new_curve_GF2m(const p: PBIGNUM; const a: PBIGNUM; const b: PBIGNUM; ctx: PBN_CTX): PEC_GROUP; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_GROUP_new_curve_GF2m_procname); +end; + + +function ERR_EC_GROUP_new_by_curve_name(nid: TIdC_INT): PEC_GROUP; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_GROUP_new_by_curve_name_procname); +end; + + +function ERR_EC_GROUP_new_from_ecparameters(const params: PECPARAMETERS): PEC_GROUP; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_GROUP_new_from_ecparameters_procname); +end; + + {introduced 1.1.0} +function ERR_EC_GROUP_get_ecparameters(const group: PEC_GROUP; params: PECPARAMETERS): PECPARAMETERS; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_GROUP_get_ecparameters_procname); +end; + + {introduced 1.1.0} +function ERR_EC_GROUP_new_from_ecpkparameters(const params: PECPKPARAMETERS): PEC_GROUP; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_GROUP_new_from_ecpkparameters_procname); +end; + + {introduced 1.1.0} +function ERR_EC_GROUP_get_ecpkparameters(const group: PEC_GROUP; params: PECPKPARAMETERS): PECPKPARAMETERS; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_GROUP_get_ecpkparameters_procname); +end; + + {introduced 1.1.0} + +function ERR_EC_get_builtin_curves(r: PEC_builtin_curve; nitems: TIdC_SIZET): TIdC_SIZET; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_get_builtin_curves_procname); +end; + + + +function ERR_EC_curve_nid2nist(nid: TIdC_INT): PIdAnsiChar; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_curve_nid2nist_procname); +end; + + +function ERR_EC_curve_nist2nid(const name: PIdAnsiChar): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_curve_nist2nid_procname); +end; + + + +function ERR_EC_POINT_new(const group: PEC_GROUP): PEC_POINT; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_POINT_new_procname); +end; + + +procedure ERR_EC_POINT_free(point: PEC_POINT); +begin + EIdAPIFunctionNotPresent.RaiseException(EC_POINT_free_procname); +end; + + +procedure ERR_EC_POINT_clear_free(point: PEC_POINT); +begin + EIdAPIFunctionNotPresent.RaiseException(EC_POINT_clear_free_procname); +end; + + +function ERR_EC_POINT_copy(dst: PEC_POINT; const src: PEC_POINT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_POINT_copy_procname); +end; + + +function ERR_EC_POINT_dup(const src: PEC_POINT; const group: PEC_GROUP): PEC_POINT; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_POINT_dup_procname); +end; + + +function ERR_EC_POINT_method_of(const point: PEC_POINT): PEC_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_POINT_method_of_procname); +end; + + +function ERR_EC_POINT_set_to_infinity(const group: PEC_GROUP; point: PEC_POINT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_POINT_set_to_infinity_procname); +end; + + +function ERR_EC_POINT_set_Jprojective_coordinates_GFp(const group: PEC_GROUP; p: PEC_POINT; const x: PBIGNUM; const y: PBIGNUM; const z: PBIGNUM; ctx: PBN_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_POINT_set_Jprojective_coordinates_GFp_procname); +end; + + +function ERR_EC_POINT_get_Jprojective_coordinates_GFp(const group: PEC_METHOD; const p: PEC_POINT; x: PBIGNUM; y: PBIGNUM; z: PBIGNUM; ctx: PBN_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_POINT_get_Jprojective_coordinates_GFp_procname); +end; + + +function ERR_EC_POINT_set_affine_coordinates(const group: PEC_GROUP; p: PEC_POINT; const x: PBIGNUM; const y: PBIGNUM; ctx: PBN_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_POINT_set_affine_coordinates_procname); +end; + + {introduced 1.1.0} +function ERR_EC_POINT_get_affine_coordinates(const group: PEC_GROUP; const p: PEC_POINT; x: PBIGNUM; y: PBIGNUM; ctx: PBN_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_POINT_get_affine_coordinates_procname); +end; + + {introduced 1.1.0} +function ERR_EC_POINT_set_affine_coordinates_GFp(const group: PEC_GROUP; p: PEC_POINT; const x: PBIGNUM; const y: PBIGNUM; ctx: PBN_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_POINT_set_affine_coordinates_GFp_procname); +end; + + +function ERR_EC_POINT_get_affine_coordinates_GFp(const group: PEC_GROUP; const p: PEC_POINT; x: PBIGNUM; y: PBIGNUM; ctx: PBN_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_POINT_get_affine_coordinates_GFp_procname); +end; + + +function ERR_EC_POINT_set_compressed_coordinates(const group: PEC_GROUP; p: PEC_POINT; x: PBIGNUM; y_bit: TIdC_INT; ctx: PBN_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_POINT_set_compressed_coordinates_procname); +end; + + {introduced 1.1.0} +function ERR_EC_POINT_set_compressed_coordinates_GFp(const group: PEC_GROUP; p: PEC_POINT; const x: PBIGNUM; y_bit: TIdC_INT; ctx: PBN_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_POINT_set_compressed_coordinates_GFp_procname); +end; + + +function ERR_EC_POINT_set_affine_coordinates_GF2m(const group: PEC_GROUP; p: PEC_POINT; const x: PBIGNUM; const y: PBIGNUM; ctx: PBN_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_POINT_set_affine_coordinates_GF2m_procname); +end; + + +function ERR_EC_POINT_get_affine_coordinates_GF2m(const group: PEC_GROUP; p: PEC_POINT; x: PBIGNUM; y: PBIGNUM; ctx: PBN_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_POINT_get_affine_coordinates_GF2m_procname); +end; + + +function ERR_EC_POINT_set_compressed_coordinates_GF2m(const group: PEC_GROUP; p: PEC_POINT; const x: PBIGNUM; y_bit: TIdC_INT; ctx: PBN_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_POINT_set_compressed_coordinates_GF2m_procname); +end; + + + +function ERR_EC_POINT_point2oct(const group: PEC_GROUP; const p: PEC_POINT; form: point_conversion_form_t; buf: PByte; len: TIdC_SIZET; ctx: PBN_CTX): TIdC_SIZET; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_POINT_point2oct_procname); +end; + + +function ERR_EC_POINT_oct2point(const group: PEC_GROUP; p: PEC_POINT; const buf: PByte; len: TIdC_SIZET; ctx: PBN_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_POINT_oct2point_procname); +end; + + +function ERR_EC_POINT_point2buf(const group: PEC_GROUP; const point: PEC_POINT; form: point_conversion_form_t; pbuf: PPByte; ctx: PBN_CTX): TIdC_SIZET; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_POINT_point2buf_procname); +end; + + {introduced 1.1.0} +function ERR_EC_POINT_point2bn(const group: PEC_GROUP; const p: PEC_POINT; form: point_conversion_form_t; bn: PBIGNUM; ctx: PBN_CTX): PBIGNUM; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_POINT_point2bn_procname); +end; + + +function ERR_EC_POINT_bn2point(const group: PEC_GROUP; const bn: PBIGNUM; p: PEC_POINT; ctx: PBN_CTX): PEC_POINT; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_POINT_bn2point_procname); +end; + + +function ERR_EC_POINT_point2hex(const group: PEC_GROUP; const p: PEC_POINT; form: point_conversion_form_t; ctx: PBN_CTX): PIdAnsiChar; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_POINT_point2hex_procname); +end; + + +function ERR_EC_POINT_hex2point(const group: PEC_GROUP; const buf: PIdAnsiChar; p: PEC_POINT; ctx: PBN_CTX): PEC_POINT; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_POINT_hex2point_procname); +end; + + + +function ERR_EC_POINT_add(const group: PEC_GROUP; r: PEC_POINT; const a: PEC_POINT; const b: PEC_POINT; ctx: PBN_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_POINT_add_procname); +end; + + +function ERR_EC_POINT_dbl(const group: PEC_GROUP; r: PEC_POINT; const a: PEC_POINT; ctx: PBN_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_POINT_dbl_procname); +end; + + +function ERR_EC_POINT_invert(const group: PEC_GROUP; a: PEC_POINT; ctx: PBN_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_POINT_invert_procname); +end; + + +function ERR_EC_POINT_is_at_infinity(const group: PEC_GROUP; const p: PEC_POINT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_POINT_is_at_infinity_procname); +end; + + +function ERR_EC_POINT_is_on_curve(const group: PEC_GROUP; const point: PEC_POINT; ctx: PBN_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_POINT_is_on_curve_procname); +end; + + +function ERR_EC_POINT_cmp(const group: PEC_GROUP; const a: PEC_POINT; const b: PEC_POINT; ctx: PBN_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_POINT_cmp_procname); +end; + + +function ERR_EC_POINT_make_affine(const group: PEC_GROUP; point: PEC_POINT; ctx: PBN_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_POINT_make_affine_procname); +end; + + +function ERR_EC_POINTs_make_affine(const group: PEC_METHOD; num: TIdC_SIZET; points: PPEC_POINT; ctx: PBN_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_POINTs_make_affine_procname); +end; + + +function ERR_EC_POINTs_mul(const group: PEC_GROUP; r: PEC_POINT; const n: PBIGNUM; num: TIdC_SIZET; const p: PPEC_POINT; const m: PPBIGNUM; ctx: PBN_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_POINTs_mul_procname); +end; + + +function ERR_EC_POINT_mul(const group: PEC_GROUP; r: PEC_POINT; const n: PBIGNUM; const q: PEC_POINT; const m: PBIGNUM; ctx: PBN_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_POINT_mul_procname); +end; + + + +function ERR_EC_GROUP_precompute_mult(group: PEC_GROUP; ctx: PBN_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_GROUP_precompute_mult_procname); +end; + + +function ERR_EC_GROUP_have_precompute_mult(const group: PEC_GROUP): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_GROUP_have_precompute_mult_procname); +end; + + + +function ERR_ECPKPARAMETERS_it: PASN1_ITEM; +begin + EIdAPIFunctionNotPresent.RaiseException(ECPKPARAMETERS_it_procname); +end; + + +function ERR_ECPKPARAMETERS_new: PECPKPARAMETERS; +begin + EIdAPIFunctionNotPresent.RaiseException(ECPKPARAMETERS_new_procname); +end; + + +procedure ERR_ECPKPARAMETERS_free(a: PECPKPARAMETERS); +begin + EIdAPIFunctionNotPresent.RaiseException(ECPKPARAMETERS_free_procname); +end; + + + +function ERR_ECPARAMETERS_it: PASN1_ITEM; +begin + EIdAPIFunctionNotPresent.RaiseException(ECPARAMETERS_it_procname); +end; + + +function ERR_ECPARAMETERS_new: PECPARAMETERS; +begin + EIdAPIFunctionNotPresent.RaiseException(ECPARAMETERS_new_procname); +end; + + +procedure ERR_ECPARAMETERS_free(a: PECPARAMETERS); +begin + EIdAPIFunctionNotPresent.RaiseException(ECPARAMETERS_free_procname); +end; + + + +function ERR_EC_GROUP_get_basis_type(const group: PEC_GROUP): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_GROUP_get_basis_type_procname); +end; + + +function ERR_EC_GROUP_get_trinomial_basis(const group: PEC_GROUP; k: PIdC_UINT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_GROUP_get_trinomial_basis_procname); +end; + + +function ERR_EC_GROUP_get_pentanomial_basis(const group: PEC_GROUP; k1: PIdC_UINT; k2: PIdC_UINT; k3: PIdC_UINT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_GROUP_get_pentanomial_basis_procname); +end; + + + +function ERR_d2i_ECPKParameters(group: PPEC_GROUP; const in_: PPByte; len: TIdC_LONG): PEC_GROUP; +begin + EIdAPIFunctionNotPresent.RaiseException(d2i_ECPKParameters_procname); +end; + + +function ERR_i2d_ECPKParameters(const group: PEC_GROUP; out_: PPByte): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(i2d_ECPKParameters_procname); +end; + + + +function ERR_ECPKParameters_print(bp: PBIO; const x: PEC_GROUP; off: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ECPKParameters_print_procname); +end; + + + +function ERR_EC_KEY_new: PEC_KEY; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_KEY_new_procname); +end; + + +function ERR_EC_KEY_get_flags(const key: PEC_KEY): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_KEY_get_flags_procname); +end; + + +procedure ERR_EC_KEY_set_flags(key: PEC_KEY; flags: TIdC_INT); +begin + EIdAPIFunctionNotPresent.RaiseException(EC_KEY_set_flags_procname); +end; + + +procedure ERR_EC_KEY_clear_flags(key: PEC_KEY; flags: TIdC_INT); +begin + EIdAPIFunctionNotPresent.RaiseException(EC_KEY_clear_flags_procname); +end; + + +function ERR_EC_KEY_new_by_curve_name(nid: TIdC_INT): PEC_KEY; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_KEY_new_by_curve_name_procname); +end; + + +procedure ERR_EC_KEY_free(key: PEC_KEY); +begin + EIdAPIFunctionNotPresent.RaiseException(EC_KEY_free_procname); +end; + + +function ERR_EC_KEY_copy(dst: PEC_KEY; const src: PEC_KEY): PEC_KEY; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_KEY_copy_procname); +end; + + +function ERR_EC_KEY_dup(const src: PEC_KEY): PEC_KEY; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_KEY_dup_procname); +end; + + +function ERR_EC_KEY_up_ref(key: PEC_KEY): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_KEY_up_ref_procname); +end; + + +function ERR_EC_KEY_get0_engine(const eckey: PEC_KEY): PENGINE; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_KEY_get0_engine_procname); +end; + + {introduced 1.1.0} +function ERR_EC_KEY_get0_group(const key: PEC_KEY): PEC_GROUP; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_KEY_get0_group_procname); +end; + + +function ERR_EC_KEY_set_group(key: PEC_KEY; const group: PEC_GROUP): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_KEY_set_group_procname); +end; + + +function ERR_EC_KEY_get0_private_key(const key: PEC_KEY): PBIGNUM; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_KEY_get0_private_key_procname); +end; + + +function ERR_EC_KEY_set_private_key(const key: PEC_KEY; const prv: PBIGNUM): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_KEY_set_private_key_procname); +end; + + +function ERR_EC_KEY_get0_public_key(const key: PEC_KEY): PEC_POINT; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_KEY_get0_public_key_procname); +end; + + +function ERR_EC_KEY_set_public_key(key: PEC_KEY; const pub: PEC_POINT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_KEY_set_public_key_procname); +end; + + +function ERR_EC_KEY_get_enc_flags(const key: PEC_KEY): TIdC_UINT; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_KEY_get_enc_flags_procname); +end; + + +procedure ERR_EC_KEY_set_enc_flags(eckey: PEC_KEY; flags: TIdC_UINT); +begin + EIdAPIFunctionNotPresent.RaiseException(EC_KEY_set_enc_flags_procname); +end; + + +function ERR_EC_KEY_get_conv_form(const key: PEC_KEY): point_conversion_form_t; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_KEY_get_conv_form_procname); +end; + + +procedure ERR_EC_KEY_set_conv_form(eckey: PEC_KEY; cform: point_conversion_form_t); +begin + EIdAPIFunctionNotPresent.RaiseException(EC_KEY_set_conv_form_procname); +end; + + +function ERR_EC_KEY_set_ex_data(key: PEC_KEY; idx: TIdC_INT; arg: Pointer): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_KEY_set_ex_data_procname); +end; + + {introduced 1.1.0} +function ERR_EC_KEY_get_ex_data(const key: PEC_KEY; idx: TIdC_INT): Pointer; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_KEY_get_ex_data_procname); +end; + + {introduced 1.1.0} +procedure ERR_EC_KEY_set_asn1_flag(eckey: PEC_KEY; asn1_flag: TIdC_INT); +begin + EIdAPIFunctionNotPresent.RaiseException(EC_KEY_set_asn1_flag_procname); +end; + + +function ERR_EC_KEY_precompute_mult(key: PEC_KEY; ctx: PBN_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_KEY_precompute_mult_procname); +end; + + +function ERR_EC_KEY_generate_key(key: PEC_KEY): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_KEY_generate_key_procname); +end; + + +function ERR_EC_KEY_check_key(const key: PEC_KEY): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_KEY_check_key_procname); +end; + + +function ERR_EC_KEY_can_sign(const eckey: PEC_KEY): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_KEY_can_sign_procname); +end; + + {introduced 1.1.0} +function ERR_EC_KEY_set_public_key_affine_coordinates(key: PEC_KEY; x: PBIGNUM; y: PBIGNUM): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_KEY_set_public_key_affine_coordinates_procname); +end; + + +function ERR_EC_KEY_key2buf(const key: PEC_KEY; form: point_conversion_form_t; pbuf: PPByte; ctx: PBN_CTX): TIdC_SIZET; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_KEY_key2buf_procname); +end; + + {introduced 1.1.0} +function ERR_EC_KEY_oct2key(key: PEC_KEY; const buf: PByte; len: TIdC_SIZET; ctx: PBN_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_KEY_oct2key_procname); +end; + + {introduced 1.1.0} +function ERR_EC_KEY_oct2priv(key: PEC_KEY; const buf: PByte; len: TIdC_SIZET): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_KEY_oct2priv_procname); +end; + + {introduced 1.1.0} +function ERR_EC_KEY_priv2oct(const key: PEC_KEY; buf: PByte; len: TIdC_SIZET): TIdC_SIZET; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_KEY_priv2oct_procname); +end; + + {introduced 1.1.0} +function ERR_EC_KEY_priv2buf(const eckey: PEC_KEY; buf: PPByte): TIdC_SIZET; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_KEY_priv2buf_procname); +end; + + {introduced 1.1.0} + +function ERR_d2i_ECPrivateKey(key: PPEC_KEY; const in_: PPByte; len: TIdC_LONG): PEC_KEY; +begin + EIdAPIFunctionNotPresent.RaiseException(d2i_ECPrivateKey_procname); +end; + + +function ERR_i2d_ECPrivateKey(key: PEC_KEY; out_: PPByte): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(i2d_ECPrivateKey_procname); +end; + + +function ERR_o2i_ECPublicKey(key: PPEC_KEY; const in_: PPByte; len: TIdC_LONG): PEC_KEY; +begin + EIdAPIFunctionNotPresent.RaiseException(o2i_ECPublicKey_procname); +end; + + +function ERR_i2o_ECPublicKey(const key: PEC_KEY; out_: PPByte): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(i2o_ECPublicKey_procname); +end; + + + +function ERR_ECParameters_print(bp: PBIO; const key: PEC_KEY): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ECParameters_print_procname); +end; + + +function ERR_EC_KEY_print(bp: PBIO; const key: PEC_KEY; off: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_KEY_print_procname); +end; + + + +function ERR_EC_KEY_OpenSSL: PEC_KEY_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_KEY_OpenSSL_procname); +end; + + {introduced 1.1.0} +function ERR_EC_KEY_get_default_method: PEC_KEY_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_KEY_get_default_method_procname); +end; + + {introduced 1.1.0} +procedure ERR_EC_KEY_set_default_method(const meth: PEC_KEY_METHOD); +begin + EIdAPIFunctionNotPresent.RaiseException(EC_KEY_set_default_method_procname); +end; + + {introduced 1.1.0} +function ERR_EC_KEY_get_method(const key: PEC_KEY): PEC_KEY_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_KEY_get_method_procname); +end; + + {introduced 1.1.0} +function ERR_EC_KEY_set_method(key: PEC_KEY; const meth: PEC_KEY_METHOD): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_KEY_set_method_procname); +end; + + {introduced 1.1.0} +function ERR_EC_KEY_new_method(engine: PENGINE): PEC_KEY; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_KEY_new_method_procname); +end; + + {introduced 1.1.0} + +function ERR_ECDH_KDF_X9_62(out_: PByte; outlen: TIdC_SIZET; const Z: PByte; Zlen: TIdC_SIZET; const sinfo: PByte; sinfolen: TIdC_SIZET; const md: PEVP_MD): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ECDH_KDF_X9_62_procname); +end; + + +function ERR_ECDH_compute_key(out_: Pointer; oulen: TIdC_SIZET; const pub_key: PEC_POINT; const ecdh: PEC_KEY; kdf: ECDH_compute_key_KDF): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ECDH_compute_key_procname); +end; + + + +function ERR_ECDSA_SIG_new: PECDSA_SIG; +begin + EIdAPIFunctionNotPresent.RaiseException(ECDSA_SIG_new_procname); +end; + + +procedure ERR_ECDSA_SIG_free(sig: PECDSA_SIG); +begin + EIdAPIFunctionNotPresent.RaiseException(ECDSA_SIG_free_procname); +end; + + +function ERR_i2d_ECDSA_SIG(const sig: PECDSA_SIG; pp: PPByte): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(i2d_ECDSA_SIG_procname); +end; + + +function ERR_d2i_ECDSA_SIG(sig: PPECDSA_SIG; const pp: PPByte; len: TIdC_LONG): PECDSA_SIG; +begin + EIdAPIFunctionNotPresent.RaiseException(d2i_ECDSA_SIG_procname); +end; + + +procedure ERR_ECDSA_SIG_get0(const sig: PECDSA_SIG; const pr: PPBIGNUM; const ps: PPBIGNUM); +begin + EIdAPIFunctionNotPresent.RaiseException(ECDSA_SIG_get0_procname); +end; + + {introduced 1.1.0} +function ERR_ECDSA_SIG_get0_r(const sig: PECDSA_SIG): PBIGNUM; +begin + EIdAPIFunctionNotPresent.RaiseException(ECDSA_SIG_get0_r_procname); +end; + + {introduced 1.1.0} +function ERR_ECDSA_SIG_get0_s(const sig: PECDSA_SIG): PBIGNUM; +begin + EIdAPIFunctionNotPresent.RaiseException(ECDSA_SIG_get0_s_procname); +end; + + {introduced 1.1.0} +function ERR_ECDSA_SIG_set0(sig: PECDSA_SIG; r: PBIGNUM; s: PBIGNUM): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ECDSA_SIG_set0_procname); +end; + + {introduced 1.1.0} +function ERR_ECDSA_do_sign(const dgst: PByte; dgst_len: TIdC_INT; eckey: PEC_KEY): PECDSA_SIG; +begin + EIdAPIFunctionNotPresent.RaiseException(ECDSA_do_sign_procname); +end; + + +function ERR_ECDSA_do_sign_ex(const dgst: PByte; dgst_len: TIdC_INT; const kinv: PBIGNUM; const rp: PBIGNUM; eckey: PEC_KEY): PECDSA_SIG; +begin + EIdAPIFunctionNotPresent.RaiseException(ECDSA_do_sign_ex_procname); +end; + + +function ERR_ECDSA_do_verify(const dgst: PByte; dgst_len: TIdC_INT; const sig: PECDSA_SIG; eckey: PEC_KEY): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ECDSA_do_verify_procname); +end; + + +function ERR_ECDSA_sign_setup(eckey: PEC_KEY; ctx: PBN_CTX; kiv: PPBIGNUM; rp: PPBIGNUM): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ECDSA_sign_setup_procname); +end; + + +function ERR_ECDSA_sign(type_: TIdC_INT; const dgst: PByte; dgstlen: TIdC_INT; sig: PByte; siglen: PIdC_UINT; eckey: PEC_KEY): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ECDSA_sign_procname); +end; + + +function ERR_ECDSA_sign_ex(type_: TIdC_INT; const dgst: PByte; dgstlen: TIdC_INT; sig: PByte; siglen: PIdC_UINT; const kinv: PBIGNUM; const rp: PBIGNUM; eckey: PEC_KEY): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ECDSA_sign_ex_procname); +end; + + +function ERR_ECDSA_verify(type_: TIdC_INT; const dgst: PByte; dgstlen: TIdC_INT; const sig: PByte; siglen: TIdC_INT; eckey: PEC_KEY): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ECDSA_verify_procname); +end; + + +function ERR_ECDSA_size(const eckey: PEC_KEY): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ECDSA_size_procname); +end; + + + +function ERR_EC_KEY_METHOD_new(const meth: PEC_KEY_METHOD): PEC_KEY_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(EC_KEY_METHOD_new_procname); +end; + + {introduced 1.1.0} +procedure ERR_EC_KEY_METHOD_free(meth: PEC_KEY_METHOD); +begin + EIdAPIFunctionNotPresent.RaiseException(EC_KEY_METHOD_free_procname); +end; + + {introduced 1.1.0} +procedure ERR_EC_KEY_METHOD_set_init(meth: PEC_KEY_METHOD; init: EC_KEY_METHOD_init_init; finish: EC_KEY_METHOD_init_finish; copy: EC_KEY_METHOD_init_copy; set_group: EC_KEY_METHOD_init_set_group; set_private: EC_KEY_METHOD_init_set_private; set_public: EC_KEY_METHOD_init_set_public); +begin + EIdAPIFunctionNotPresent.RaiseException(EC_KEY_METHOD_set_init_procname); +end; + + {introduced 1.1.0} +procedure ERR_EC_KEY_METHOD_set_keygen(meth: PEC_KEY_METHOD; keygen: EC_KEY_METHOD_keygen_keygen); +begin + EIdAPIFunctionNotPresent.RaiseException(EC_KEY_METHOD_set_keygen_procname); +end; + + {introduced 1.1.0} +procedure ERR_EC_KEY_METHOD_set_compute_key(meth: PEC_KEY_METHOD; ckey: EC_KEY_METHOD_compute_key_ckey); +begin + EIdAPIFunctionNotPresent.RaiseException(EC_KEY_METHOD_set_compute_key_procname); +end; + + {introduced 1.1.0} +procedure ERR_EC_KEY_METHOD_set_sign(meth: PEC_KEY_METHOD; sign: EC_KEY_METHOD_sign_sign; sign_setup: EC_KEY_METHOD_sign_sign_setup; sign_sig: EC_KEY_METHOD_sign_sign_sig); +begin + EIdAPIFunctionNotPresent.RaiseException(EC_KEY_METHOD_set_sign_procname); +end; + + {introduced 1.1.0} +procedure ERR_EC_KEY_METHOD_set_verify(meth: PEC_KEY_METHOD; verify: EC_KEY_METHOD_verify_verify; verify_sig: EC_KEY_METHOD_verify_verify_sig); +begin + EIdAPIFunctionNotPresent.RaiseException(EC_KEY_METHOD_set_verify_procname); +end; + + {introduced 1.1.0} + +procedure ERR_EC_KEY_METHOD_get_init(const meth: PEC_KEY_METHOD; pinit: PEC_KEY_METHOD_init_init; pfinish: PEC_KEY_METHOD_init_finish; pcopy: PEC_KEY_METHOD_init_copy; pset_group: PEC_KEY_METHOD_init_set_group; pset_private: PEC_KEY_METHOD_init_set_private; pset_public: PEC_KEY_METHOD_init_set_public); +begin + EIdAPIFunctionNotPresent.RaiseException(EC_KEY_METHOD_get_init_procname); +end; + + {introduced 1.1.0} +procedure ERR_EC_KEY_METHOD_get_keygen(const meth: PEC_KEY_METHOD; pkeygen: PEC_KEY_METHOD_keygen_keygen); +begin + EIdAPIFunctionNotPresent.RaiseException(EC_KEY_METHOD_get_keygen_procname); +end; + + {introduced 1.1.0} +procedure ERR_EC_KEY_METHOD_get_compute_key(const meth: PEC_KEY_METHOD; pck: PEC_KEY_METHOD_compute_key_ckey); +begin + EIdAPIFunctionNotPresent.RaiseException(EC_KEY_METHOD_get_compute_key_procname); +end; + + {introduced 1.1.0} +procedure ERR_EC_KEY_METHOD_get_sign(const meth: PEC_KEY_METHOD; psign: PEC_KEY_METHOD_sign_sign; psign_setup: PEC_KEY_METHOD_sign_sign_setup; psign_sig: PEC_KEY_METHOD_sign_sign_sig); +begin + EIdAPIFunctionNotPresent.RaiseException(EC_KEY_METHOD_get_sign_procname); +end; + + {introduced 1.1.0} +procedure ERR_EC_KEY_METHOD_get_verify(const meth: PEC_KEY_METHOD; pverify: PEC_KEY_METHOD_verify_verify; pverify_sig: PEC_KEY_METHOD_verify_verify_sig); +begin + EIdAPIFunctionNotPresent.RaiseException(EC_KEY_METHOD_get_verify_procname); +end; + + {introduced 1.1.0} + +{$WARN NO_RETVAL ON} + +procedure Load(const ADllHandle: TIdLibHandle; LibVersion: TIdC_UINT; const AFailed: TStringList); + +var FuncLoadError: boolean; + +begin + EC_GFp_simple_method := LoadLibFunction(ADllHandle, EC_GFp_simple_method_procname); + FuncLoadError := not assigned(EC_GFp_simple_method); + if FuncLoadError then + begin + {$if not defined(EC_GFp_simple_method_allownil)} + EC_GFp_simple_method := @ERR_EC_GFp_simple_method; + {$ifend} + {$if declared(EC_GFp_simple_method_introduced)} + if LibVersion < EC_GFp_simple_method_introduced then + begin + {$if declared(FC_EC_GFp_simple_method)} + EC_GFp_simple_method := @FC_EC_GFp_simple_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_GFp_simple_method_removed)} + if EC_GFp_simple_method_removed <= LibVersion then + begin + {$if declared(_EC_GFp_simple_method)} + EC_GFp_simple_method := @_EC_GFp_simple_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_GFp_simple_method_allownil)} + if FuncLoadError then + AFailed.Add('EC_GFp_simple_method'); + {$ifend} + end; + + + EC_GFp_mont_method := LoadLibFunction(ADllHandle, EC_GFp_mont_method_procname); + FuncLoadError := not assigned(EC_GFp_mont_method); + if FuncLoadError then + begin + {$if not defined(EC_GFp_mont_method_allownil)} + EC_GFp_mont_method := @ERR_EC_GFp_mont_method; + {$ifend} + {$if declared(EC_GFp_mont_method_introduced)} + if LibVersion < EC_GFp_mont_method_introduced then + begin + {$if declared(FC_EC_GFp_mont_method)} + EC_GFp_mont_method := @FC_EC_GFp_mont_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_GFp_mont_method_removed)} + if EC_GFp_mont_method_removed <= LibVersion then + begin + {$if declared(_EC_GFp_mont_method)} + EC_GFp_mont_method := @_EC_GFp_mont_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_GFp_mont_method_allownil)} + if FuncLoadError then + AFailed.Add('EC_GFp_mont_method'); + {$ifend} + end; + + + EC_GFp_nist_method := LoadLibFunction(ADllHandle, EC_GFp_nist_method_procname); + FuncLoadError := not assigned(EC_GFp_nist_method); + if FuncLoadError then + begin + {$if not defined(EC_GFp_nist_method_allownil)} + EC_GFp_nist_method := @ERR_EC_GFp_nist_method; + {$ifend} + {$if declared(EC_GFp_nist_method_introduced)} + if LibVersion < EC_GFp_nist_method_introduced then + begin + {$if declared(FC_EC_GFp_nist_method)} + EC_GFp_nist_method := @FC_EC_GFp_nist_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_GFp_nist_method_removed)} + if EC_GFp_nist_method_removed <= LibVersion then + begin + {$if declared(_EC_GFp_nist_method)} + EC_GFp_nist_method := @_EC_GFp_nist_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_GFp_nist_method_allownil)} + if FuncLoadError then + AFailed.Add('EC_GFp_nist_method'); + {$ifend} + end; + + + EC_GFp_nistp224_method := LoadLibFunction(ADllHandle, EC_GFp_nistp224_method_procname); + FuncLoadError := not assigned(EC_GFp_nistp224_method); + if FuncLoadError then + begin + {$if not defined(EC_GFp_nistp224_method_allownil)} + EC_GFp_nistp224_method := @ERR_EC_GFp_nistp224_method; + {$ifend} + {$if declared(EC_GFp_nistp224_method_introduced)} + if LibVersion < EC_GFp_nistp224_method_introduced then + begin + {$if declared(FC_EC_GFp_nistp224_method)} + EC_GFp_nistp224_method := @FC_EC_GFp_nistp224_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_GFp_nistp224_method_removed)} + if EC_GFp_nistp224_method_removed <= LibVersion then + begin + {$if declared(_EC_GFp_nistp224_method)} + EC_GFp_nistp224_method := @_EC_GFp_nistp224_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_GFp_nistp224_method_allownil)} + if FuncLoadError then + AFailed.Add('EC_GFp_nistp224_method'); + {$ifend} + end; + + + EC_GFp_nistp256_method := LoadLibFunction(ADllHandle, EC_GFp_nistp256_method_procname); + FuncLoadError := not assigned(EC_GFp_nistp256_method); + if FuncLoadError then + begin + {$if not defined(EC_GFp_nistp256_method_allownil)} + EC_GFp_nistp256_method := @ERR_EC_GFp_nistp256_method; + {$ifend} + {$if declared(EC_GFp_nistp256_method_introduced)} + if LibVersion < EC_GFp_nistp256_method_introduced then + begin + {$if declared(FC_EC_GFp_nistp256_method)} + EC_GFp_nistp256_method := @FC_EC_GFp_nistp256_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_GFp_nistp256_method_removed)} + if EC_GFp_nistp256_method_removed <= LibVersion then + begin + {$if declared(_EC_GFp_nistp256_method)} + EC_GFp_nistp256_method := @_EC_GFp_nistp256_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_GFp_nistp256_method_allownil)} + if FuncLoadError then + AFailed.Add('EC_GFp_nistp256_method'); + {$ifend} + end; + + + EC_GFp_nistp521_method := LoadLibFunction(ADllHandle, EC_GFp_nistp521_method_procname); + FuncLoadError := not assigned(EC_GFp_nistp521_method); + if FuncLoadError then + begin + {$if not defined(EC_GFp_nistp521_method_allownil)} + EC_GFp_nistp521_method := @ERR_EC_GFp_nistp521_method; + {$ifend} + {$if declared(EC_GFp_nistp521_method_introduced)} + if LibVersion < EC_GFp_nistp521_method_introduced then + begin + {$if declared(FC_EC_GFp_nistp521_method)} + EC_GFp_nistp521_method := @FC_EC_GFp_nistp521_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_GFp_nistp521_method_removed)} + if EC_GFp_nistp521_method_removed <= LibVersion then + begin + {$if declared(_EC_GFp_nistp521_method)} + EC_GFp_nistp521_method := @_EC_GFp_nistp521_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_GFp_nistp521_method_allownil)} + if FuncLoadError then + AFailed.Add('EC_GFp_nistp521_method'); + {$ifend} + end; + + + EC_GF2m_simple_method := LoadLibFunction(ADllHandle, EC_GF2m_simple_method_procname); + FuncLoadError := not assigned(EC_GF2m_simple_method); + if FuncLoadError then + begin + {$if not defined(EC_GF2m_simple_method_allownil)} + EC_GF2m_simple_method := @ERR_EC_GF2m_simple_method; + {$ifend} + {$if declared(EC_GF2m_simple_method_introduced)} + if LibVersion < EC_GF2m_simple_method_introduced then + begin + {$if declared(FC_EC_GF2m_simple_method)} + EC_GF2m_simple_method := @FC_EC_GF2m_simple_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_GF2m_simple_method_removed)} + if EC_GF2m_simple_method_removed <= LibVersion then + begin + {$if declared(_EC_GF2m_simple_method)} + EC_GF2m_simple_method := @_EC_GF2m_simple_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_GF2m_simple_method_allownil)} + if FuncLoadError then + AFailed.Add('EC_GF2m_simple_method'); + {$ifend} + end; + + + EC_GROUP_new := LoadLibFunction(ADllHandle, EC_GROUP_new_procname); + FuncLoadError := not assigned(EC_GROUP_new); + if FuncLoadError then + begin + {$if not defined(EC_GROUP_new_allownil)} + EC_GROUP_new := @ERR_EC_GROUP_new; + {$ifend} + {$if declared(EC_GROUP_new_introduced)} + if LibVersion < EC_GROUP_new_introduced then + begin + {$if declared(FC_EC_GROUP_new)} + EC_GROUP_new := @FC_EC_GROUP_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_GROUP_new_removed)} + if EC_GROUP_new_removed <= LibVersion then + begin + {$if declared(_EC_GROUP_new)} + EC_GROUP_new := @_EC_GROUP_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_GROUP_new_allownil)} + if FuncLoadError then + AFailed.Add('EC_GROUP_new'); + {$ifend} + end; + + + EC_GROUP_free := LoadLibFunction(ADllHandle, EC_GROUP_free_procname); + FuncLoadError := not assigned(EC_GROUP_free); + if FuncLoadError then + begin + {$if not defined(EC_GROUP_free_allownil)} + EC_GROUP_free := @ERR_EC_GROUP_free; + {$ifend} + {$if declared(EC_GROUP_free_introduced)} + if LibVersion < EC_GROUP_free_introduced then + begin + {$if declared(FC_EC_GROUP_free)} + EC_GROUP_free := @FC_EC_GROUP_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_GROUP_free_removed)} + if EC_GROUP_free_removed <= LibVersion then + begin + {$if declared(_EC_GROUP_free)} + EC_GROUP_free := @_EC_GROUP_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_GROUP_free_allownil)} + if FuncLoadError then + AFailed.Add('EC_GROUP_free'); + {$ifend} + end; + + + EC_GROUP_clear_free := LoadLibFunction(ADllHandle, EC_GROUP_clear_free_procname); + FuncLoadError := not assigned(EC_GROUP_clear_free); + if FuncLoadError then + begin + {$if not defined(EC_GROUP_clear_free_allownil)} + EC_GROUP_clear_free := @ERR_EC_GROUP_clear_free; + {$ifend} + {$if declared(EC_GROUP_clear_free_introduced)} + if LibVersion < EC_GROUP_clear_free_introduced then + begin + {$if declared(FC_EC_GROUP_clear_free)} + EC_GROUP_clear_free := @FC_EC_GROUP_clear_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_GROUP_clear_free_removed)} + if EC_GROUP_clear_free_removed <= LibVersion then + begin + {$if declared(_EC_GROUP_clear_free)} + EC_GROUP_clear_free := @_EC_GROUP_clear_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_GROUP_clear_free_allownil)} + if FuncLoadError then + AFailed.Add('EC_GROUP_clear_free'); + {$ifend} + end; + + + EC_GROUP_copy := LoadLibFunction(ADllHandle, EC_GROUP_copy_procname); + FuncLoadError := not assigned(EC_GROUP_copy); + if FuncLoadError then + begin + {$if not defined(EC_GROUP_copy_allownil)} + EC_GROUP_copy := @ERR_EC_GROUP_copy; + {$ifend} + {$if declared(EC_GROUP_copy_introduced)} + if LibVersion < EC_GROUP_copy_introduced then + begin + {$if declared(FC_EC_GROUP_copy)} + EC_GROUP_copy := @FC_EC_GROUP_copy; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_GROUP_copy_removed)} + if EC_GROUP_copy_removed <= LibVersion then + begin + {$if declared(_EC_GROUP_copy)} + EC_GROUP_copy := @_EC_GROUP_copy; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_GROUP_copy_allownil)} + if FuncLoadError then + AFailed.Add('EC_GROUP_copy'); + {$ifend} + end; + + + EC_GROUP_dup := LoadLibFunction(ADllHandle, EC_GROUP_dup_procname); + FuncLoadError := not assigned(EC_GROUP_dup); + if FuncLoadError then + begin + {$if not defined(EC_GROUP_dup_allownil)} + EC_GROUP_dup := @ERR_EC_GROUP_dup; + {$ifend} + {$if declared(EC_GROUP_dup_introduced)} + if LibVersion < EC_GROUP_dup_introduced then + begin + {$if declared(FC_EC_GROUP_dup)} + EC_GROUP_dup := @FC_EC_GROUP_dup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_GROUP_dup_removed)} + if EC_GROUP_dup_removed <= LibVersion then + begin + {$if declared(_EC_GROUP_dup)} + EC_GROUP_dup := @_EC_GROUP_dup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_GROUP_dup_allownil)} + if FuncLoadError then + AFailed.Add('EC_GROUP_dup'); + {$ifend} + end; + + + EC_GROUP_method_of := LoadLibFunction(ADllHandle, EC_GROUP_method_of_procname); + FuncLoadError := not assigned(EC_GROUP_method_of); + if FuncLoadError then + begin + {$if not defined(EC_GROUP_method_of_allownil)} + EC_GROUP_method_of := @ERR_EC_GROUP_method_of; + {$ifend} + {$if declared(EC_GROUP_method_of_introduced)} + if LibVersion < EC_GROUP_method_of_introduced then + begin + {$if declared(FC_EC_GROUP_method_of)} + EC_GROUP_method_of := @FC_EC_GROUP_method_of; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_GROUP_method_of_removed)} + if EC_GROUP_method_of_removed <= LibVersion then + begin + {$if declared(_EC_GROUP_method_of)} + EC_GROUP_method_of := @_EC_GROUP_method_of; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_GROUP_method_of_allownil)} + if FuncLoadError then + AFailed.Add('EC_GROUP_method_of'); + {$ifend} + end; + + + EC_METHOD_get_field_type := LoadLibFunction(ADllHandle, EC_METHOD_get_field_type_procname); + FuncLoadError := not assigned(EC_METHOD_get_field_type); + if FuncLoadError then + begin + {$if not defined(EC_METHOD_get_field_type_allownil)} + EC_METHOD_get_field_type := @ERR_EC_METHOD_get_field_type; + {$ifend} + {$if declared(EC_METHOD_get_field_type_introduced)} + if LibVersion < EC_METHOD_get_field_type_introduced then + begin + {$if declared(FC_EC_METHOD_get_field_type)} + EC_METHOD_get_field_type := @FC_EC_METHOD_get_field_type; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_METHOD_get_field_type_removed)} + if EC_METHOD_get_field_type_removed <= LibVersion then + begin + {$if declared(_EC_METHOD_get_field_type)} + EC_METHOD_get_field_type := @_EC_METHOD_get_field_type; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_METHOD_get_field_type_allownil)} + if FuncLoadError then + AFailed.Add('EC_METHOD_get_field_type'); + {$ifend} + end; + + + EC_GROUP_set_generator := LoadLibFunction(ADllHandle, EC_GROUP_set_generator_procname); + FuncLoadError := not assigned(EC_GROUP_set_generator); + if FuncLoadError then + begin + {$if not defined(EC_GROUP_set_generator_allownil)} + EC_GROUP_set_generator := @ERR_EC_GROUP_set_generator; + {$ifend} + {$if declared(EC_GROUP_set_generator_introduced)} + if LibVersion < EC_GROUP_set_generator_introduced then + begin + {$if declared(FC_EC_GROUP_set_generator)} + EC_GROUP_set_generator := @FC_EC_GROUP_set_generator; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_GROUP_set_generator_removed)} + if EC_GROUP_set_generator_removed <= LibVersion then + begin + {$if declared(_EC_GROUP_set_generator)} + EC_GROUP_set_generator := @_EC_GROUP_set_generator; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_GROUP_set_generator_allownil)} + if FuncLoadError then + AFailed.Add('EC_GROUP_set_generator'); + {$ifend} + end; + + + EC_GROUP_get0_generator := LoadLibFunction(ADllHandle, EC_GROUP_get0_generator_procname); + FuncLoadError := not assigned(EC_GROUP_get0_generator); + if FuncLoadError then + begin + {$if not defined(EC_GROUP_get0_generator_allownil)} + EC_GROUP_get0_generator := @ERR_EC_GROUP_get0_generator; + {$ifend} + {$if declared(EC_GROUP_get0_generator_introduced)} + if LibVersion < EC_GROUP_get0_generator_introduced then + begin + {$if declared(FC_EC_GROUP_get0_generator)} + EC_GROUP_get0_generator := @FC_EC_GROUP_get0_generator; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_GROUP_get0_generator_removed)} + if EC_GROUP_get0_generator_removed <= LibVersion then + begin + {$if declared(_EC_GROUP_get0_generator)} + EC_GROUP_get0_generator := @_EC_GROUP_get0_generator; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_GROUP_get0_generator_allownil)} + if FuncLoadError then + AFailed.Add('EC_GROUP_get0_generator'); + {$ifend} + end; + + + EC_GROUP_get_mont_data := LoadLibFunction(ADllHandle, EC_GROUP_get_mont_data_procname); + FuncLoadError := not assigned(EC_GROUP_get_mont_data); + if FuncLoadError then + begin + {$if not defined(EC_GROUP_get_mont_data_allownil)} + EC_GROUP_get_mont_data := @ERR_EC_GROUP_get_mont_data; + {$ifend} + {$if declared(EC_GROUP_get_mont_data_introduced)} + if LibVersion < EC_GROUP_get_mont_data_introduced then + begin + {$if declared(FC_EC_GROUP_get_mont_data)} + EC_GROUP_get_mont_data := @FC_EC_GROUP_get_mont_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_GROUP_get_mont_data_removed)} + if EC_GROUP_get_mont_data_removed <= LibVersion then + begin + {$if declared(_EC_GROUP_get_mont_data)} + EC_GROUP_get_mont_data := @_EC_GROUP_get_mont_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_GROUP_get_mont_data_allownil)} + if FuncLoadError then + AFailed.Add('EC_GROUP_get_mont_data'); + {$ifend} + end; + + + EC_GROUP_get_order := LoadLibFunction(ADllHandle, EC_GROUP_get_order_procname); + FuncLoadError := not assigned(EC_GROUP_get_order); + if FuncLoadError then + begin + {$if not defined(EC_GROUP_get_order_allownil)} + EC_GROUP_get_order := @ERR_EC_GROUP_get_order; + {$ifend} + {$if declared(EC_GROUP_get_order_introduced)} + if LibVersion < EC_GROUP_get_order_introduced then + begin + {$if declared(FC_EC_GROUP_get_order)} + EC_GROUP_get_order := @FC_EC_GROUP_get_order; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_GROUP_get_order_removed)} + if EC_GROUP_get_order_removed <= LibVersion then + begin + {$if declared(_EC_GROUP_get_order)} + EC_GROUP_get_order := @_EC_GROUP_get_order; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_GROUP_get_order_allownil)} + if FuncLoadError then + AFailed.Add('EC_GROUP_get_order'); + {$ifend} + end; + + + EC_GROUP_get0_order := LoadLibFunction(ADllHandle, EC_GROUP_get0_order_procname); + FuncLoadError := not assigned(EC_GROUP_get0_order); + if FuncLoadError then + begin + {$if not defined(EC_GROUP_get0_order_allownil)} + EC_GROUP_get0_order := @ERR_EC_GROUP_get0_order; + {$ifend} + {$if declared(EC_GROUP_get0_order_introduced)} + if LibVersion < EC_GROUP_get0_order_introduced then + begin + {$if declared(FC_EC_GROUP_get0_order)} + EC_GROUP_get0_order := @FC_EC_GROUP_get0_order; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_GROUP_get0_order_removed)} + if EC_GROUP_get0_order_removed <= LibVersion then + begin + {$if declared(_EC_GROUP_get0_order)} + EC_GROUP_get0_order := @_EC_GROUP_get0_order; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_GROUP_get0_order_allownil)} + if FuncLoadError then + AFailed.Add('EC_GROUP_get0_order'); + {$ifend} + end; + + {introduced 1.1.0} + EC_GROUP_order_bits := LoadLibFunction(ADllHandle, EC_GROUP_order_bits_procname); + FuncLoadError := not assigned(EC_GROUP_order_bits); + if FuncLoadError then + begin + {$if not defined(EC_GROUP_order_bits_allownil)} + EC_GROUP_order_bits := @ERR_EC_GROUP_order_bits; + {$ifend} + {$if declared(EC_GROUP_order_bits_introduced)} + if LibVersion < EC_GROUP_order_bits_introduced then + begin + {$if declared(FC_EC_GROUP_order_bits)} + EC_GROUP_order_bits := @FC_EC_GROUP_order_bits; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_GROUP_order_bits_removed)} + if EC_GROUP_order_bits_removed <= LibVersion then + begin + {$if declared(_EC_GROUP_order_bits)} + EC_GROUP_order_bits := @_EC_GROUP_order_bits; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_GROUP_order_bits_allownil)} + if FuncLoadError then + AFailed.Add('EC_GROUP_order_bits'); + {$ifend} + end; + + {introduced 1.1.0} + EC_GROUP_get_cofactor := LoadLibFunction(ADllHandle, EC_GROUP_get_cofactor_procname); + FuncLoadError := not assigned(EC_GROUP_get_cofactor); + if FuncLoadError then + begin + {$if not defined(EC_GROUP_get_cofactor_allownil)} + EC_GROUP_get_cofactor := @ERR_EC_GROUP_get_cofactor; + {$ifend} + {$if declared(EC_GROUP_get_cofactor_introduced)} + if LibVersion < EC_GROUP_get_cofactor_introduced then + begin + {$if declared(FC_EC_GROUP_get_cofactor)} + EC_GROUP_get_cofactor := @FC_EC_GROUP_get_cofactor; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_GROUP_get_cofactor_removed)} + if EC_GROUP_get_cofactor_removed <= LibVersion then + begin + {$if declared(_EC_GROUP_get_cofactor)} + EC_GROUP_get_cofactor := @_EC_GROUP_get_cofactor; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_GROUP_get_cofactor_allownil)} + if FuncLoadError then + AFailed.Add('EC_GROUP_get_cofactor'); + {$ifend} + end; + + + EC_GROUP_get0_cofactor := LoadLibFunction(ADllHandle, EC_GROUP_get0_cofactor_procname); + FuncLoadError := not assigned(EC_GROUP_get0_cofactor); + if FuncLoadError then + begin + {$if not defined(EC_GROUP_get0_cofactor_allownil)} + EC_GROUP_get0_cofactor := @ERR_EC_GROUP_get0_cofactor; + {$ifend} + {$if declared(EC_GROUP_get0_cofactor_introduced)} + if LibVersion < EC_GROUP_get0_cofactor_introduced then + begin + {$if declared(FC_EC_GROUP_get0_cofactor)} + EC_GROUP_get0_cofactor := @FC_EC_GROUP_get0_cofactor; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_GROUP_get0_cofactor_removed)} + if EC_GROUP_get0_cofactor_removed <= LibVersion then + begin + {$if declared(_EC_GROUP_get0_cofactor)} + EC_GROUP_get0_cofactor := @_EC_GROUP_get0_cofactor; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_GROUP_get0_cofactor_allownil)} + if FuncLoadError then + AFailed.Add('EC_GROUP_get0_cofactor'); + {$ifend} + end; + + {introduced 1.1.0} + EC_GROUP_set_curve_name := LoadLibFunction(ADllHandle, EC_GROUP_set_curve_name_procname); + FuncLoadError := not assigned(EC_GROUP_set_curve_name); + if FuncLoadError then + begin + {$if not defined(EC_GROUP_set_curve_name_allownil)} + EC_GROUP_set_curve_name := @ERR_EC_GROUP_set_curve_name; + {$ifend} + {$if declared(EC_GROUP_set_curve_name_introduced)} + if LibVersion < EC_GROUP_set_curve_name_introduced then + begin + {$if declared(FC_EC_GROUP_set_curve_name)} + EC_GROUP_set_curve_name := @FC_EC_GROUP_set_curve_name; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_GROUP_set_curve_name_removed)} + if EC_GROUP_set_curve_name_removed <= LibVersion then + begin + {$if declared(_EC_GROUP_set_curve_name)} + EC_GROUP_set_curve_name := @_EC_GROUP_set_curve_name; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_GROUP_set_curve_name_allownil)} + if FuncLoadError then + AFailed.Add('EC_GROUP_set_curve_name'); + {$ifend} + end; + + + EC_GROUP_get_curve_name := LoadLibFunction(ADllHandle, EC_GROUP_get_curve_name_procname); + FuncLoadError := not assigned(EC_GROUP_get_curve_name); + if FuncLoadError then + begin + {$if not defined(EC_GROUP_get_curve_name_allownil)} + EC_GROUP_get_curve_name := @ERR_EC_GROUP_get_curve_name; + {$ifend} + {$if declared(EC_GROUP_get_curve_name_introduced)} + if LibVersion < EC_GROUP_get_curve_name_introduced then + begin + {$if declared(FC_EC_GROUP_get_curve_name)} + EC_GROUP_get_curve_name := @FC_EC_GROUP_get_curve_name; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_GROUP_get_curve_name_removed)} + if EC_GROUP_get_curve_name_removed <= LibVersion then + begin + {$if declared(_EC_GROUP_get_curve_name)} + EC_GROUP_get_curve_name := @_EC_GROUP_get_curve_name; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_GROUP_get_curve_name_allownil)} + if FuncLoadError then + AFailed.Add('EC_GROUP_get_curve_name'); + {$ifend} + end; + + + EC_GROUP_set_asn1_flag := LoadLibFunction(ADllHandle, EC_GROUP_set_asn1_flag_procname); + FuncLoadError := not assigned(EC_GROUP_set_asn1_flag); + if FuncLoadError then + begin + {$if not defined(EC_GROUP_set_asn1_flag_allownil)} + EC_GROUP_set_asn1_flag := @ERR_EC_GROUP_set_asn1_flag; + {$ifend} + {$if declared(EC_GROUP_set_asn1_flag_introduced)} + if LibVersion < EC_GROUP_set_asn1_flag_introduced then + begin + {$if declared(FC_EC_GROUP_set_asn1_flag)} + EC_GROUP_set_asn1_flag := @FC_EC_GROUP_set_asn1_flag; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_GROUP_set_asn1_flag_removed)} + if EC_GROUP_set_asn1_flag_removed <= LibVersion then + begin + {$if declared(_EC_GROUP_set_asn1_flag)} + EC_GROUP_set_asn1_flag := @_EC_GROUP_set_asn1_flag; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_GROUP_set_asn1_flag_allownil)} + if FuncLoadError then + AFailed.Add('EC_GROUP_set_asn1_flag'); + {$ifend} + end; + + + EC_GROUP_get_asn1_flag := LoadLibFunction(ADllHandle, EC_GROUP_get_asn1_flag_procname); + FuncLoadError := not assigned(EC_GROUP_get_asn1_flag); + if FuncLoadError then + begin + {$if not defined(EC_GROUP_get_asn1_flag_allownil)} + EC_GROUP_get_asn1_flag := @ERR_EC_GROUP_get_asn1_flag; + {$ifend} + {$if declared(EC_GROUP_get_asn1_flag_introduced)} + if LibVersion < EC_GROUP_get_asn1_flag_introduced then + begin + {$if declared(FC_EC_GROUP_get_asn1_flag)} + EC_GROUP_get_asn1_flag := @FC_EC_GROUP_get_asn1_flag; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_GROUP_get_asn1_flag_removed)} + if EC_GROUP_get_asn1_flag_removed <= LibVersion then + begin + {$if declared(_EC_GROUP_get_asn1_flag)} + EC_GROUP_get_asn1_flag := @_EC_GROUP_get_asn1_flag; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_GROUP_get_asn1_flag_allownil)} + if FuncLoadError then + AFailed.Add('EC_GROUP_get_asn1_flag'); + {$ifend} + end; + + + EC_GROUP_set_point_conversion_form := LoadLibFunction(ADllHandle, EC_GROUP_set_point_conversion_form_procname); + FuncLoadError := not assigned(EC_GROUP_set_point_conversion_form); + if FuncLoadError then + begin + {$if not defined(EC_GROUP_set_point_conversion_form_allownil)} + EC_GROUP_set_point_conversion_form := @ERR_EC_GROUP_set_point_conversion_form; + {$ifend} + {$if declared(EC_GROUP_set_point_conversion_form_introduced)} + if LibVersion < EC_GROUP_set_point_conversion_form_introduced then + begin + {$if declared(FC_EC_GROUP_set_point_conversion_form)} + EC_GROUP_set_point_conversion_form := @FC_EC_GROUP_set_point_conversion_form; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_GROUP_set_point_conversion_form_removed)} + if EC_GROUP_set_point_conversion_form_removed <= LibVersion then + begin + {$if declared(_EC_GROUP_set_point_conversion_form)} + EC_GROUP_set_point_conversion_form := @_EC_GROUP_set_point_conversion_form; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_GROUP_set_point_conversion_form_allownil)} + if FuncLoadError then + AFailed.Add('EC_GROUP_set_point_conversion_form'); + {$ifend} + end; + + + EC_GROUP_get_point_conversion_form := LoadLibFunction(ADllHandle, EC_GROUP_get_point_conversion_form_procname); + FuncLoadError := not assigned(EC_GROUP_get_point_conversion_form); + if FuncLoadError then + begin + {$if not defined(EC_GROUP_get_point_conversion_form_allownil)} + EC_GROUP_get_point_conversion_form := @ERR_EC_GROUP_get_point_conversion_form; + {$ifend} + {$if declared(EC_GROUP_get_point_conversion_form_introduced)} + if LibVersion < EC_GROUP_get_point_conversion_form_introduced then + begin + {$if declared(FC_EC_GROUP_get_point_conversion_form)} + EC_GROUP_get_point_conversion_form := @FC_EC_GROUP_get_point_conversion_form; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_GROUP_get_point_conversion_form_removed)} + if EC_GROUP_get_point_conversion_form_removed <= LibVersion then + begin + {$if declared(_EC_GROUP_get_point_conversion_form)} + EC_GROUP_get_point_conversion_form := @_EC_GROUP_get_point_conversion_form; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_GROUP_get_point_conversion_form_allownil)} + if FuncLoadError then + AFailed.Add('EC_GROUP_get_point_conversion_form'); + {$ifend} + end; + + + EC_GROUP_get0_seed := LoadLibFunction(ADllHandle, EC_GROUP_get0_seed_procname); + FuncLoadError := not assigned(EC_GROUP_get0_seed); + if FuncLoadError then + begin + {$if not defined(EC_GROUP_get0_seed_allownil)} + EC_GROUP_get0_seed := @ERR_EC_GROUP_get0_seed; + {$ifend} + {$if declared(EC_GROUP_get0_seed_introduced)} + if LibVersion < EC_GROUP_get0_seed_introduced then + begin + {$if declared(FC_EC_GROUP_get0_seed)} + EC_GROUP_get0_seed := @FC_EC_GROUP_get0_seed; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_GROUP_get0_seed_removed)} + if EC_GROUP_get0_seed_removed <= LibVersion then + begin + {$if declared(_EC_GROUP_get0_seed)} + EC_GROUP_get0_seed := @_EC_GROUP_get0_seed; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_GROUP_get0_seed_allownil)} + if FuncLoadError then + AFailed.Add('EC_GROUP_get0_seed'); + {$ifend} + end; + + + EC_GROUP_get_seed_len := LoadLibFunction(ADllHandle, EC_GROUP_get_seed_len_procname); + FuncLoadError := not assigned(EC_GROUP_get_seed_len); + if FuncLoadError then + begin + {$if not defined(EC_GROUP_get_seed_len_allownil)} + EC_GROUP_get_seed_len := @ERR_EC_GROUP_get_seed_len; + {$ifend} + {$if declared(EC_GROUP_get_seed_len_introduced)} + if LibVersion < EC_GROUP_get_seed_len_introduced then + begin + {$if declared(FC_EC_GROUP_get_seed_len)} + EC_GROUP_get_seed_len := @FC_EC_GROUP_get_seed_len; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_GROUP_get_seed_len_removed)} + if EC_GROUP_get_seed_len_removed <= LibVersion then + begin + {$if declared(_EC_GROUP_get_seed_len)} + EC_GROUP_get_seed_len := @_EC_GROUP_get_seed_len; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_GROUP_get_seed_len_allownil)} + if FuncLoadError then + AFailed.Add('EC_GROUP_get_seed_len'); + {$ifend} + end; + + + EC_GROUP_set_seed := LoadLibFunction(ADllHandle, EC_GROUP_set_seed_procname); + FuncLoadError := not assigned(EC_GROUP_set_seed); + if FuncLoadError then + begin + {$if not defined(EC_GROUP_set_seed_allownil)} + EC_GROUP_set_seed := @ERR_EC_GROUP_set_seed; + {$ifend} + {$if declared(EC_GROUP_set_seed_introduced)} + if LibVersion < EC_GROUP_set_seed_introduced then + begin + {$if declared(FC_EC_GROUP_set_seed)} + EC_GROUP_set_seed := @FC_EC_GROUP_set_seed; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_GROUP_set_seed_removed)} + if EC_GROUP_set_seed_removed <= LibVersion then + begin + {$if declared(_EC_GROUP_set_seed)} + EC_GROUP_set_seed := @_EC_GROUP_set_seed; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_GROUP_set_seed_allownil)} + if FuncLoadError then + AFailed.Add('EC_GROUP_set_seed'); + {$ifend} + end; + + + EC_GROUP_set_curve := LoadLibFunction(ADllHandle, EC_GROUP_set_curve_procname); + FuncLoadError := not assigned(EC_GROUP_set_curve); + if FuncLoadError then + begin + {$if not defined(EC_GROUP_set_curve_allownil)} + EC_GROUP_set_curve := @ERR_EC_GROUP_set_curve; + {$ifend} + {$if declared(EC_GROUP_set_curve_introduced)} + if LibVersion < EC_GROUP_set_curve_introduced then + begin + {$if declared(FC_EC_GROUP_set_curve)} + EC_GROUP_set_curve := @FC_EC_GROUP_set_curve; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_GROUP_set_curve_removed)} + if EC_GROUP_set_curve_removed <= LibVersion then + begin + {$if declared(_EC_GROUP_set_curve)} + EC_GROUP_set_curve := @_EC_GROUP_set_curve; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_GROUP_set_curve_allownil)} + if FuncLoadError then + AFailed.Add('EC_GROUP_set_curve'); + {$ifend} + end; + + {introduced 1.1.0} + EC_GROUP_get_curve := LoadLibFunction(ADllHandle, EC_GROUP_get_curve_procname); + FuncLoadError := not assigned(EC_GROUP_get_curve); + if FuncLoadError then + begin + {$if not defined(EC_GROUP_get_curve_allownil)} + EC_GROUP_get_curve := @ERR_EC_GROUP_get_curve; + {$ifend} + {$if declared(EC_GROUP_get_curve_introduced)} + if LibVersion < EC_GROUP_get_curve_introduced then + begin + {$if declared(FC_EC_GROUP_get_curve)} + EC_GROUP_get_curve := @FC_EC_GROUP_get_curve; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_GROUP_get_curve_removed)} + if EC_GROUP_get_curve_removed <= LibVersion then + begin + {$if declared(_EC_GROUP_get_curve)} + EC_GROUP_get_curve := @_EC_GROUP_get_curve; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_GROUP_get_curve_allownil)} + if FuncLoadError then + AFailed.Add('EC_GROUP_get_curve'); + {$ifend} + end; + + {introduced 1.1.0} + EC_GROUP_set_curve_GFp := LoadLibFunction(ADllHandle, EC_GROUP_set_curve_GFp_procname); + FuncLoadError := not assigned(EC_GROUP_set_curve_GFp); + if FuncLoadError then + begin + {$if not defined(EC_GROUP_set_curve_GFp_allownil)} + EC_GROUP_set_curve_GFp := @ERR_EC_GROUP_set_curve_GFp; + {$ifend} + {$if declared(EC_GROUP_set_curve_GFp_introduced)} + if LibVersion < EC_GROUP_set_curve_GFp_introduced then + begin + {$if declared(FC_EC_GROUP_set_curve_GFp)} + EC_GROUP_set_curve_GFp := @FC_EC_GROUP_set_curve_GFp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_GROUP_set_curve_GFp_removed)} + if EC_GROUP_set_curve_GFp_removed <= LibVersion then + begin + {$if declared(_EC_GROUP_set_curve_GFp)} + EC_GROUP_set_curve_GFp := @_EC_GROUP_set_curve_GFp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_GROUP_set_curve_GFp_allownil)} + if FuncLoadError then + AFailed.Add('EC_GROUP_set_curve_GFp'); + {$ifend} + end; + + + EC_GROUP_get_curve_GFp := LoadLibFunction(ADllHandle, EC_GROUP_get_curve_GFp_procname); + FuncLoadError := not assigned(EC_GROUP_get_curve_GFp); + if FuncLoadError then + begin + {$if not defined(EC_GROUP_get_curve_GFp_allownil)} + EC_GROUP_get_curve_GFp := @ERR_EC_GROUP_get_curve_GFp; + {$ifend} + {$if declared(EC_GROUP_get_curve_GFp_introduced)} + if LibVersion < EC_GROUP_get_curve_GFp_introduced then + begin + {$if declared(FC_EC_GROUP_get_curve_GFp)} + EC_GROUP_get_curve_GFp := @FC_EC_GROUP_get_curve_GFp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_GROUP_get_curve_GFp_removed)} + if EC_GROUP_get_curve_GFp_removed <= LibVersion then + begin + {$if declared(_EC_GROUP_get_curve_GFp)} + EC_GROUP_get_curve_GFp := @_EC_GROUP_get_curve_GFp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_GROUP_get_curve_GFp_allownil)} + if FuncLoadError then + AFailed.Add('EC_GROUP_get_curve_GFp'); + {$ifend} + end; + + + EC_GROUP_set_curve_GF2m := LoadLibFunction(ADllHandle, EC_GROUP_set_curve_GF2m_procname); + FuncLoadError := not assigned(EC_GROUP_set_curve_GF2m); + if FuncLoadError then + begin + {$if not defined(EC_GROUP_set_curve_GF2m_allownil)} + EC_GROUP_set_curve_GF2m := @ERR_EC_GROUP_set_curve_GF2m; + {$ifend} + {$if declared(EC_GROUP_set_curve_GF2m_introduced)} + if LibVersion < EC_GROUP_set_curve_GF2m_introduced then + begin + {$if declared(FC_EC_GROUP_set_curve_GF2m)} + EC_GROUP_set_curve_GF2m := @FC_EC_GROUP_set_curve_GF2m; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_GROUP_set_curve_GF2m_removed)} + if EC_GROUP_set_curve_GF2m_removed <= LibVersion then + begin + {$if declared(_EC_GROUP_set_curve_GF2m)} + EC_GROUP_set_curve_GF2m := @_EC_GROUP_set_curve_GF2m; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_GROUP_set_curve_GF2m_allownil)} + if FuncLoadError then + AFailed.Add('EC_GROUP_set_curve_GF2m'); + {$ifend} + end; + + + EC_GROUP_get_curve_GF2m := LoadLibFunction(ADllHandle, EC_GROUP_get_curve_GF2m_procname); + FuncLoadError := not assigned(EC_GROUP_get_curve_GF2m); + if FuncLoadError then + begin + {$if not defined(EC_GROUP_get_curve_GF2m_allownil)} + EC_GROUP_get_curve_GF2m := @ERR_EC_GROUP_get_curve_GF2m; + {$ifend} + {$if declared(EC_GROUP_get_curve_GF2m_introduced)} + if LibVersion < EC_GROUP_get_curve_GF2m_introduced then + begin + {$if declared(FC_EC_GROUP_get_curve_GF2m)} + EC_GROUP_get_curve_GF2m := @FC_EC_GROUP_get_curve_GF2m; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_GROUP_get_curve_GF2m_removed)} + if EC_GROUP_get_curve_GF2m_removed <= LibVersion then + begin + {$if declared(_EC_GROUP_get_curve_GF2m)} + EC_GROUP_get_curve_GF2m := @_EC_GROUP_get_curve_GF2m; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_GROUP_get_curve_GF2m_allownil)} + if FuncLoadError then + AFailed.Add('EC_GROUP_get_curve_GF2m'); + {$ifend} + end; + + + EC_GROUP_get_degree := LoadLibFunction(ADllHandle, EC_GROUP_get_degree_procname); + FuncLoadError := not assigned(EC_GROUP_get_degree); + if FuncLoadError then + begin + {$if not defined(EC_GROUP_get_degree_allownil)} + EC_GROUP_get_degree := @ERR_EC_GROUP_get_degree; + {$ifend} + {$if declared(EC_GROUP_get_degree_introduced)} + if LibVersion < EC_GROUP_get_degree_introduced then + begin + {$if declared(FC_EC_GROUP_get_degree)} + EC_GROUP_get_degree := @FC_EC_GROUP_get_degree; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_GROUP_get_degree_removed)} + if EC_GROUP_get_degree_removed <= LibVersion then + begin + {$if declared(_EC_GROUP_get_degree)} + EC_GROUP_get_degree := @_EC_GROUP_get_degree; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_GROUP_get_degree_allownil)} + if FuncLoadError then + AFailed.Add('EC_GROUP_get_degree'); + {$ifend} + end; + + + EC_GROUP_check := LoadLibFunction(ADllHandle, EC_GROUP_check_procname); + FuncLoadError := not assigned(EC_GROUP_check); + if FuncLoadError then + begin + {$if not defined(EC_GROUP_check_allownil)} + EC_GROUP_check := @ERR_EC_GROUP_check; + {$ifend} + {$if declared(EC_GROUP_check_introduced)} + if LibVersion < EC_GROUP_check_introduced then + begin + {$if declared(FC_EC_GROUP_check)} + EC_GROUP_check := @FC_EC_GROUP_check; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_GROUP_check_removed)} + if EC_GROUP_check_removed <= LibVersion then + begin + {$if declared(_EC_GROUP_check)} + EC_GROUP_check := @_EC_GROUP_check; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_GROUP_check_allownil)} + if FuncLoadError then + AFailed.Add('EC_GROUP_check'); + {$ifend} + end; + + + EC_GROUP_check_discriminant := LoadLibFunction(ADllHandle, EC_GROUP_check_discriminant_procname); + FuncLoadError := not assigned(EC_GROUP_check_discriminant); + if FuncLoadError then + begin + {$if not defined(EC_GROUP_check_discriminant_allownil)} + EC_GROUP_check_discriminant := @ERR_EC_GROUP_check_discriminant; + {$ifend} + {$if declared(EC_GROUP_check_discriminant_introduced)} + if LibVersion < EC_GROUP_check_discriminant_introduced then + begin + {$if declared(FC_EC_GROUP_check_discriminant)} + EC_GROUP_check_discriminant := @FC_EC_GROUP_check_discriminant; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_GROUP_check_discriminant_removed)} + if EC_GROUP_check_discriminant_removed <= LibVersion then + begin + {$if declared(_EC_GROUP_check_discriminant)} + EC_GROUP_check_discriminant := @_EC_GROUP_check_discriminant; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_GROUP_check_discriminant_allownil)} + if FuncLoadError then + AFailed.Add('EC_GROUP_check_discriminant'); + {$ifend} + end; + + + EC_GROUP_cmp := LoadLibFunction(ADllHandle, EC_GROUP_cmp_procname); + FuncLoadError := not assigned(EC_GROUP_cmp); + if FuncLoadError then + begin + {$if not defined(EC_GROUP_cmp_allownil)} + EC_GROUP_cmp := @ERR_EC_GROUP_cmp; + {$ifend} + {$if declared(EC_GROUP_cmp_introduced)} + if LibVersion < EC_GROUP_cmp_introduced then + begin + {$if declared(FC_EC_GROUP_cmp)} + EC_GROUP_cmp := @FC_EC_GROUP_cmp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_GROUP_cmp_removed)} + if EC_GROUP_cmp_removed <= LibVersion then + begin + {$if declared(_EC_GROUP_cmp)} + EC_GROUP_cmp := @_EC_GROUP_cmp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_GROUP_cmp_allownil)} + if FuncLoadError then + AFailed.Add('EC_GROUP_cmp'); + {$ifend} + end; + + + EC_GROUP_new_curve_GFp := LoadLibFunction(ADllHandle, EC_GROUP_new_curve_GFp_procname); + FuncLoadError := not assigned(EC_GROUP_new_curve_GFp); + if FuncLoadError then + begin + {$if not defined(EC_GROUP_new_curve_GFp_allownil)} + EC_GROUP_new_curve_GFp := @ERR_EC_GROUP_new_curve_GFp; + {$ifend} + {$if declared(EC_GROUP_new_curve_GFp_introduced)} + if LibVersion < EC_GROUP_new_curve_GFp_introduced then + begin + {$if declared(FC_EC_GROUP_new_curve_GFp)} + EC_GROUP_new_curve_GFp := @FC_EC_GROUP_new_curve_GFp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_GROUP_new_curve_GFp_removed)} + if EC_GROUP_new_curve_GFp_removed <= LibVersion then + begin + {$if declared(_EC_GROUP_new_curve_GFp)} + EC_GROUP_new_curve_GFp := @_EC_GROUP_new_curve_GFp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_GROUP_new_curve_GFp_allownil)} + if FuncLoadError then + AFailed.Add('EC_GROUP_new_curve_GFp'); + {$ifend} + end; + + + EC_GROUP_new_curve_GF2m := LoadLibFunction(ADllHandle, EC_GROUP_new_curve_GF2m_procname); + FuncLoadError := not assigned(EC_GROUP_new_curve_GF2m); + if FuncLoadError then + begin + {$if not defined(EC_GROUP_new_curve_GF2m_allownil)} + EC_GROUP_new_curve_GF2m := @ERR_EC_GROUP_new_curve_GF2m; + {$ifend} + {$if declared(EC_GROUP_new_curve_GF2m_introduced)} + if LibVersion < EC_GROUP_new_curve_GF2m_introduced then + begin + {$if declared(FC_EC_GROUP_new_curve_GF2m)} + EC_GROUP_new_curve_GF2m := @FC_EC_GROUP_new_curve_GF2m; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_GROUP_new_curve_GF2m_removed)} + if EC_GROUP_new_curve_GF2m_removed <= LibVersion then + begin + {$if declared(_EC_GROUP_new_curve_GF2m)} + EC_GROUP_new_curve_GF2m := @_EC_GROUP_new_curve_GF2m; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_GROUP_new_curve_GF2m_allownil)} + if FuncLoadError then + AFailed.Add('EC_GROUP_new_curve_GF2m'); + {$ifend} + end; + + + EC_GROUP_new_by_curve_name := LoadLibFunction(ADllHandle, EC_GROUP_new_by_curve_name_procname); + FuncLoadError := not assigned(EC_GROUP_new_by_curve_name); + if FuncLoadError then + begin + {$if not defined(EC_GROUP_new_by_curve_name_allownil)} + EC_GROUP_new_by_curve_name := @ERR_EC_GROUP_new_by_curve_name; + {$ifend} + {$if declared(EC_GROUP_new_by_curve_name_introduced)} + if LibVersion < EC_GROUP_new_by_curve_name_introduced then + begin + {$if declared(FC_EC_GROUP_new_by_curve_name)} + EC_GROUP_new_by_curve_name := @FC_EC_GROUP_new_by_curve_name; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_GROUP_new_by_curve_name_removed)} + if EC_GROUP_new_by_curve_name_removed <= LibVersion then + begin + {$if declared(_EC_GROUP_new_by_curve_name)} + EC_GROUP_new_by_curve_name := @_EC_GROUP_new_by_curve_name; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_GROUP_new_by_curve_name_allownil)} + if FuncLoadError then + AFailed.Add('EC_GROUP_new_by_curve_name'); + {$ifend} + end; + + + EC_GROUP_new_from_ecparameters := LoadLibFunction(ADllHandle, EC_GROUP_new_from_ecparameters_procname); + FuncLoadError := not assigned(EC_GROUP_new_from_ecparameters); + if FuncLoadError then + begin + {$if not defined(EC_GROUP_new_from_ecparameters_allownil)} + EC_GROUP_new_from_ecparameters := @ERR_EC_GROUP_new_from_ecparameters; + {$ifend} + {$if declared(EC_GROUP_new_from_ecparameters_introduced)} + if LibVersion < EC_GROUP_new_from_ecparameters_introduced then + begin + {$if declared(FC_EC_GROUP_new_from_ecparameters)} + EC_GROUP_new_from_ecparameters := @FC_EC_GROUP_new_from_ecparameters; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_GROUP_new_from_ecparameters_removed)} + if EC_GROUP_new_from_ecparameters_removed <= LibVersion then + begin + {$if declared(_EC_GROUP_new_from_ecparameters)} + EC_GROUP_new_from_ecparameters := @_EC_GROUP_new_from_ecparameters; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_GROUP_new_from_ecparameters_allownil)} + if FuncLoadError then + AFailed.Add('EC_GROUP_new_from_ecparameters'); + {$ifend} + end; + + {introduced 1.1.0} + EC_GROUP_get_ecparameters := LoadLibFunction(ADllHandle, EC_GROUP_get_ecparameters_procname); + FuncLoadError := not assigned(EC_GROUP_get_ecparameters); + if FuncLoadError then + begin + {$if not defined(EC_GROUP_get_ecparameters_allownil)} + EC_GROUP_get_ecparameters := @ERR_EC_GROUP_get_ecparameters; + {$ifend} + {$if declared(EC_GROUP_get_ecparameters_introduced)} + if LibVersion < EC_GROUP_get_ecparameters_introduced then + begin + {$if declared(FC_EC_GROUP_get_ecparameters)} + EC_GROUP_get_ecparameters := @FC_EC_GROUP_get_ecparameters; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_GROUP_get_ecparameters_removed)} + if EC_GROUP_get_ecparameters_removed <= LibVersion then + begin + {$if declared(_EC_GROUP_get_ecparameters)} + EC_GROUP_get_ecparameters := @_EC_GROUP_get_ecparameters; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_GROUP_get_ecparameters_allownil)} + if FuncLoadError then + AFailed.Add('EC_GROUP_get_ecparameters'); + {$ifend} + end; + + {introduced 1.1.0} + EC_GROUP_new_from_ecpkparameters := LoadLibFunction(ADllHandle, EC_GROUP_new_from_ecpkparameters_procname); + FuncLoadError := not assigned(EC_GROUP_new_from_ecpkparameters); + if FuncLoadError then + begin + {$if not defined(EC_GROUP_new_from_ecpkparameters_allownil)} + EC_GROUP_new_from_ecpkparameters := @ERR_EC_GROUP_new_from_ecpkparameters; + {$ifend} + {$if declared(EC_GROUP_new_from_ecpkparameters_introduced)} + if LibVersion < EC_GROUP_new_from_ecpkparameters_introduced then + begin + {$if declared(FC_EC_GROUP_new_from_ecpkparameters)} + EC_GROUP_new_from_ecpkparameters := @FC_EC_GROUP_new_from_ecpkparameters; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_GROUP_new_from_ecpkparameters_removed)} + if EC_GROUP_new_from_ecpkparameters_removed <= LibVersion then + begin + {$if declared(_EC_GROUP_new_from_ecpkparameters)} + EC_GROUP_new_from_ecpkparameters := @_EC_GROUP_new_from_ecpkparameters; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_GROUP_new_from_ecpkparameters_allownil)} + if FuncLoadError then + AFailed.Add('EC_GROUP_new_from_ecpkparameters'); + {$ifend} + end; + + {introduced 1.1.0} + EC_GROUP_get_ecpkparameters := LoadLibFunction(ADllHandle, EC_GROUP_get_ecpkparameters_procname); + FuncLoadError := not assigned(EC_GROUP_get_ecpkparameters); + if FuncLoadError then + begin + {$if not defined(EC_GROUP_get_ecpkparameters_allownil)} + EC_GROUP_get_ecpkparameters := @ERR_EC_GROUP_get_ecpkparameters; + {$ifend} + {$if declared(EC_GROUP_get_ecpkparameters_introduced)} + if LibVersion < EC_GROUP_get_ecpkparameters_introduced then + begin + {$if declared(FC_EC_GROUP_get_ecpkparameters)} + EC_GROUP_get_ecpkparameters := @FC_EC_GROUP_get_ecpkparameters; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_GROUP_get_ecpkparameters_removed)} + if EC_GROUP_get_ecpkparameters_removed <= LibVersion then + begin + {$if declared(_EC_GROUP_get_ecpkparameters)} + EC_GROUP_get_ecpkparameters := @_EC_GROUP_get_ecpkparameters; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_GROUP_get_ecpkparameters_allownil)} + if FuncLoadError then + AFailed.Add('EC_GROUP_get_ecpkparameters'); + {$ifend} + end; + + {introduced 1.1.0} + EC_get_builtin_curves := LoadLibFunction(ADllHandle, EC_get_builtin_curves_procname); + FuncLoadError := not assigned(EC_get_builtin_curves); + if FuncLoadError then + begin + {$if not defined(EC_get_builtin_curves_allownil)} + EC_get_builtin_curves := @ERR_EC_get_builtin_curves; + {$ifend} + {$if declared(EC_get_builtin_curves_introduced)} + if LibVersion < EC_get_builtin_curves_introduced then + begin + {$if declared(FC_EC_get_builtin_curves)} + EC_get_builtin_curves := @FC_EC_get_builtin_curves; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_get_builtin_curves_removed)} + if EC_get_builtin_curves_removed <= LibVersion then + begin + {$if declared(_EC_get_builtin_curves)} + EC_get_builtin_curves := @_EC_get_builtin_curves; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_get_builtin_curves_allownil)} + if FuncLoadError then + AFailed.Add('EC_get_builtin_curves'); + {$ifend} + end; + + + EC_curve_nid2nist := LoadLibFunction(ADllHandle, EC_curve_nid2nist_procname); + FuncLoadError := not assigned(EC_curve_nid2nist); + if FuncLoadError then + begin + {$if not defined(EC_curve_nid2nist_allownil)} + EC_curve_nid2nist := @ERR_EC_curve_nid2nist; + {$ifend} + {$if declared(EC_curve_nid2nist_introduced)} + if LibVersion < EC_curve_nid2nist_introduced then + begin + {$if declared(FC_EC_curve_nid2nist)} + EC_curve_nid2nist := @FC_EC_curve_nid2nist; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_curve_nid2nist_removed)} + if EC_curve_nid2nist_removed <= LibVersion then + begin + {$if declared(_EC_curve_nid2nist)} + EC_curve_nid2nist := @_EC_curve_nid2nist; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_curve_nid2nist_allownil)} + if FuncLoadError then + AFailed.Add('EC_curve_nid2nist'); + {$ifend} + end; + + + EC_curve_nist2nid := LoadLibFunction(ADllHandle, EC_curve_nist2nid_procname); + FuncLoadError := not assigned(EC_curve_nist2nid); + if FuncLoadError then + begin + {$if not defined(EC_curve_nist2nid_allownil)} + EC_curve_nist2nid := @ERR_EC_curve_nist2nid; + {$ifend} + {$if declared(EC_curve_nist2nid_introduced)} + if LibVersion < EC_curve_nist2nid_introduced then + begin + {$if declared(FC_EC_curve_nist2nid)} + EC_curve_nist2nid := @FC_EC_curve_nist2nid; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_curve_nist2nid_removed)} + if EC_curve_nist2nid_removed <= LibVersion then + begin + {$if declared(_EC_curve_nist2nid)} + EC_curve_nist2nid := @_EC_curve_nist2nid; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_curve_nist2nid_allownil)} + if FuncLoadError then + AFailed.Add('EC_curve_nist2nid'); + {$ifend} + end; + + + EC_POINT_new := LoadLibFunction(ADllHandle, EC_POINT_new_procname); + FuncLoadError := not assigned(EC_POINT_new); + if FuncLoadError then + begin + {$if not defined(EC_POINT_new_allownil)} + EC_POINT_new := @ERR_EC_POINT_new; + {$ifend} + {$if declared(EC_POINT_new_introduced)} + if LibVersion < EC_POINT_new_introduced then + begin + {$if declared(FC_EC_POINT_new)} + EC_POINT_new := @FC_EC_POINT_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_POINT_new_removed)} + if EC_POINT_new_removed <= LibVersion then + begin + {$if declared(_EC_POINT_new)} + EC_POINT_new := @_EC_POINT_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_POINT_new_allownil)} + if FuncLoadError then + AFailed.Add('EC_POINT_new'); + {$ifend} + end; + + + EC_POINT_free := LoadLibFunction(ADllHandle, EC_POINT_free_procname); + FuncLoadError := not assigned(EC_POINT_free); + if FuncLoadError then + begin + {$if not defined(EC_POINT_free_allownil)} + EC_POINT_free := @ERR_EC_POINT_free; + {$ifend} + {$if declared(EC_POINT_free_introduced)} + if LibVersion < EC_POINT_free_introduced then + begin + {$if declared(FC_EC_POINT_free)} + EC_POINT_free := @FC_EC_POINT_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_POINT_free_removed)} + if EC_POINT_free_removed <= LibVersion then + begin + {$if declared(_EC_POINT_free)} + EC_POINT_free := @_EC_POINT_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_POINT_free_allownil)} + if FuncLoadError then + AFailed.Add('EC_POINT_free'); + {$ifend} + end; + + + EC_POINT_clear_free := LoadLibFunction(ADllHandle, EC_POINT_clear_free_procname); + FuncLoadError := not assigned(EC_POINT_clear_free); + if FuncLoadError then + begin + {$if not defined(EC_POINT_clear_free_allownil)} + EC_POINT_clear_free := @ERR_EC_POINT_clear_free; + {$ifend} + {$if declared(EC_POINT_clear_free_introduced)} + if LibVersion < EC_POINT_clear_free_introduced then + begin + {$if declared(FC_EC_POINT_clear_free)} + EC_POINT_clear_free := @FC_EC_POINT_clear_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_POINT_clear_free_removed)} + if EC_POINT_clear_free_removed <= LibVersion then + begin + {$if declared(_EC_POINT_clear_free)} + EC_POINT_clear_free := @_EC_POINT_clear_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_POINT_clear_free_allownil)} + if FuncLoadError then + AFailed.Add('EC_POINT_clear_free'); + {$ifend} + end; + + + EC_POINT_copy := LoadLibFunction(ADllHandle, EC_POINT_copy_procname); + FuncLoadError := not assigned(EC_POINT_copy); + if FuncLoadError then + begin + {$if not defined(EC_POINT_copy_allownil)} + EC_POINT_copy := @ERR_EC_POINT_copy; + {$ifend} + {$if declared(EC_POINT_copy_introduced)} + if LibVersion < EC_POINT_copy_introduced then + begin + {$if declared(FC_EC_POINT_copy)} + EC_POINT_copy := @FC_EC_POINT_copy; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_POINT_copy_removed)} + if EC_POINT_copy_removed <= LibVersion then + begin + {$if declared(_EC_POINT_copy)} + EC_POINT_copy := @_EC_POINT_copy; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_POINT_copy_allownil)} + if FuncLoadError then + AFailed.Add('EC_POINT_copy'); + {$ifend} + end; + + + EC_POINT_dup := LoadLibFunction(ADllHandle, EC_POINT_dup_procname); + FuncLoadError := not assigned(EC_POINT_dup); + if FuncLoadError then + begin + {$if not defined(EC_POINT_dup_allownil)} + EC_POINT_dup := @ERR_EC_POINT_dup; + {$ifend} + {$if declared(EC_POINT_dup_introduced)} + if LibVersion < EC_POINT_dup_introduced then + begin + {$if declared(FC_EC_POINT_dup)} + EC_POINT_dup := @FC_EC_POINT_dup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_POINT_dup_removed)} + if EC_POINT_dup_removed <= LibVersion then + begin + {$if declared(_EC_POINT_dup)} + EC_POINT_dup := @_EC_POINT_dup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_POINT_dup_allownil)} + if FuncLoadError then + AFailed.Add('EC_POINT_dup'); + {$ifend} + end; + + + EC_POINT_method_of := LoadLibFunction(ADllHandle, EC_POINT_method_of_procname); + FuncLoadError := not assigned(EC_POINT_method_of); + if FuncLoadError then + begin + {$if not defined(EC_POINT_method_of_allownil)} + EC_POINT_method_of := @ERR_EC_POINT_method_of; + {$ifend} + {$if declared(EC_POINT_method_of_introduced)} + if LibVersion < EC_POINT_method_of_introduced then + begin + {$if declared(FC_EC_POINT_method_of)} + EC_POINT_method_of := @FC_EC_POINT_method_of; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_POINT_method_of_removed)} + if EC_POINT_method_of_removed <= LibVersion then + begin + {$if declared(_EC_POINT_method_of)} + EC_POINT_method_of := @_EC_POINT_method_of; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_POINT_method_of_allownil)} + if FuncLoadError then + AFailed.Add('EC_POINT_method_of'); + {$ifend} + end; + + + EC_POINT_set_to_infinity := LoadLibFunction(ADllHandle, EC_POINT_set_to_infinity_procname); + FuncLoadError := not assigned(EC_POINT_set_to_infinity); + if FuncLoadError then + begin + {$if not defined(EC_POINT_set_to_infinity_allownil)} + EC_POINT_set_to_infinity := @ERR_EC_POINT_set_to_infinity; + {$ifend} + {$if declared(EC_POINT_set_to_infinity_introduced)} + if LibVersion < EC_POINT_set_to_infinity_introduced then + begin + {$if declared(FC_EC_POINT_set_to_infinity)} + EC_POINT_set_to_infinity := @FC_EC_POINT_set_to_infinity; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_POINT_set_to_infinity_removed)} + if EC_POINT_set_to_infinity_removed <= LibVersion then + begin + {$if declared(_EC_POINT_set_to_infinity)} + EC_POINT_set_to_infinity := @_EC_POINT_set_to_infinity; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_POINT_set_to_infinity_allownil)} + if FuncLoadError then + AFailed.Add('EC_POINT_set_to_infinity'); + {$ifend} + end; + + + EC_POINT_set_Jprojective_coordinates_GFp := LoadLibFunction(ADllHandle, EC_POINT_set_Jprojective_coordinates_GFp_procname); + FuncLoadError := not assigned(EC_POINT_set_Jprojective_coordinates_GFp); + if FuncLoadError then + begin + {$if not defined(EC_POINT_set_Jprojective_coordinates_GFp_allownil)} + EC_POINT_set_Jprojective_coordinates_GFp := @ERR_EC_POINT_set_Jprojective_coordinates_GFp; + {$ifend} + {$if declared(EC_POINT_set_Jprojective_coordinates_GFp_introduced)} + if LibVersion < EC_POINT_set_Jprojective_coordinates_GFp_introduced then + begin + {$if declared(FC_EC_POINT_set_Jprojective_coordinates_GFp)} + EC_POINT_set_Jprojective_coordinates_GFp := @FC_EC_POINT_set_Jprojective_coordinates_GFp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_POINT_set_Jprojective_coordinates_GFp_removed)} + if EC_POINT_set_Jprojective_coordinates_GFp_removed <= LibVersion then + begin + {$if declared(_EC_POINT_set_Jprojective_coordinates_GFp)} + EC_POINT_set_Jprojective_coordinates_GFp := @_EC_POINT_set_Jprojective_coordinates_GFp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_POINT_set_Jprojective_coordinates_GFp_allownil)} + if FuncLoadError then + AFailed.Add('EC_POINT_set_Jprojective_coordinates_GFp'); + {$ifend} + end; + + + EC_POINT_get_Jprojective_coordinates_GFp := LoadLibFunction(ADllHandle, EC_POINT_get_Jprojective_coordinates_GFp_procname); + FuncLoadError := not assigned(EC_POINT_get_Jprojective_coordinates_GFp); + if FuncLoadError then + begin + {$if not defined(EC_POINT_get_Jprojective_coordinates_GFp_allownil)} + EC_POINT_get_Jprojective_coordinates_GFp := @ERR_EC_POINT_get_Jprojective_coordinates_GFp; + {$ifend} + {$if declared(EC_POINT_get_Jprojective_coordinates_GFp_introduced)} + if LibVersion < EC_POINT_get_Jprojective_coordinates_GFp_introduced then + begin + {$if declared(FC_EC_POINT_get_Jprojective_coordinates_GFp)} + EC_POINT_get_Jprojective_coordinates_GFp := @FC_EC_POINT_get_Jprojective_coordinates_GFp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_POINT_get_Jprojective_coordinates_GFp_removed)} + if EC_POINT_get_Jprojective_coordinates_GFp_removed <= LibVersion then + begin + {$if declared(_EC_POINT_get_Jprojective_coordinates_GFp)} + EC_POINT_get_Jprojective_coordinates_GFp := @_EC_POINT_get_Jprojective_coordinates_GFp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_POINT_get_Jprojective_coordinates_GFp_allownil)} + if FuncLoadError then + AFailed.Add('EC_POINT_get_Jprojective_coordinates_GFp'); + {$ifend} + end; + + + EC_POINT_set_affine_coordinates := LoadLibFunction(ADllHandle, EC_POINT_set_affine_coordinates_procname); + FuncLoadError := not assigned(EC_POINT_set_affine_coordinates); + if FuncLoadError then + begin + {$if not defined(EC_POINT_set_affine_coordinates_allownil)} + EC_POINT_set_affine_coordinates := @ERR_EC_POINT_set_affine_coordinates; + {$ifend} + {$if declared(EC_POINT_set_affine_coordinates_introduced)} + if LibVersion < EC_POINT_set_affine_coordinates_introduced then + begin + {$if declared(FC_EC_POINT_set_affine_coordinates)} + EC_POINT_set_affine_coordinates := @FC_EC_POINT_set_affine_coordinates; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_POINT_set_affine_coordinates_removed)} + if EC_POINT_set_affine_coordinates_removed <= LibVersion then + begin + {$if declared(_EC_POINT_set_affine_coordinates)} + EC_POINT_set_affine_coordinates := @_EC_POINT_set_affine_coordinates; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_POINT_set_affine_coordinates_allownil)} + if FuncLoadError then + AFailed.Add('EC_POINT_set_affine_coordinates'); + {$ifend} + end; + + {introduced 1.1.0} + EC_POINT_get_affine_coordinates := LoadLibFunction(ADllHandle, EC_POINT_get_affine_coordinates_procname); + FuncLoadError := not assigned(EC_POINT_get_affine_coordinates); + if FuncLoadError then + begin + {$if not defined(EC_POINT_get_affine_coordinates_allownil)} + EC_POINT_get_affine_coordinates := @ERR_EC_POINT_get_affine_coordinates; + {$ifend} + {$if declared(EC_POINT_get_affine_coordinates_introduced)} + if LibVersion < EC_POINT_get_affine_coordinates_introduced then + begin + {$if declared(FC_EC_POINT_get_affine_coordinates)} + EC_POINT_get_affine_coordinates := @FC_EC_POINT_get_affine_coordinates; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_POINT_get_affine_coordinates_removed)} + if EC_POINT_get_affine_coordinates_removed <= LibVersion then + begin + {$if declared(_EC_POINT_get_affine_coordinates)} + EC_POINT_get_affine_coordinates := @_EC_POINT_get_affine_coordinates; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_POINT_get_affine_coordinates_allownil)} + if FuncLoadError then + AFailed.Add('EC_POINT_get_affine_coordinates'); + {$ifend} + end; + + {introduced 1.1.0} + EC_POINT_set_affine_coordinates_GFp := LoadLibFunction(ADllHandle, EC_POINT_set_affine_coordinates_GFp_procname); + FuncLoadError := not assigned(EC_POINT_set_affine_coordinates_GFp); + if FuncLoadError then + begin + {$if not defined(EC_POINT_set_affine_coordinates_GFp_allownil)} + EC_POINT_set_affine_coordinates_GFp := @ERR_EC_POINT_set_affine_coordinates_GFp; + {$ifend} + {$if declared(EC_POINT_set_affine_coordinates_GFp_introduced)} + if LibVersion < EC_POINT_set_affine_coordinates_GFp_introduced then + begin + {$if declared(FC_EC_POINT_set_affine_coordinates_GFp)} + EC_POINT_set_affine_coordinates_GFp := @FC_EC_POINT_set_affine_coordinates_GFp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_POINT_set_affine_coordinates_GFp_removed)} + if EC_POINT_set_affine_coordinates_GFp_removed <= LibVersion then + begin + {$if declared(_EC_POINT_set_affine_coordinates_GFp)} + EC_POINT_set_affine_coordinates_GFp := @_EC_POINT_set_affine_coordinates_GFp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_POINT_set_affine_coordinates_GFp_allownil)} + if FuncLoadError then + AFailed.Add('EC_POINT_set_affine_coordinates_GFp'); + {$ifend} + end; + + + EC_POINT_get_affine_coordinates_GFp := LoadLibFunction(ADllHandle, EC_POINT_get_affine_coordinates_GFp_procname); + FuncLoadError := not assigned(EC_POINT_get_affine_coordinates_GFp); + if FuncLoadError then + begin + {$if not defined(EC_POINT_get_affine_coordinates_GFp_allownil)} + EC_POINT_get_affine_coordinates_GFp := @ERR_EC_POINT_get_affine_coordinates_GFp; + {$ifend} + {$if declared(EC_POINT_get_affine_coordinates_GFp_introduced)} + if LibVersion < EC_POINT_get_affine_coordinates_GFp_introduced then + begin + {$if declared(FC_EC_POINT_get_affine_coordinates_GFp)} + EC_POINT_get_affine_coordinates_GFp := @FC_EC_POINT_get_affine_coordinates_GFp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_POINT_get_affine_coordinates_GFp_removed)} + if EC_POINT_get_affine_coordinates_GFp_removed <= LibVersion then + begin + {$if declared(_EC_POINT_get_affine_coordinates_GFp)} + EC_POINT_get_affine_coordinates_GFp := @_EC_POINT_get_affine_coordinates_GFp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_POINT_get_affine_coordinates_GFp_allownil)} + if FuncLoadError then + AFailed.Add('EC_POINT_get_affine_coordinates_GFp'); + {$ifend} + end; + + + EC_POINT_set_compressed_coordinates := LoadLibFunction(ADllHandle, EC_POINT_set_compressed_coordinates_procname); + FuncLoadError := not assigned(EC_POINT_set_compressed_coordinates); + if FuncLoadError then + begin + {$if not defined(EC_POINT_set_compressed_coordinates_allownil)} + EC_POINT_set_compressed_coordinates := @ERR_EC_POINT_set_compressed_coordinates; + {$ifend} + {$if declared(EC_POINT_set_compressed_coordinates_introduced)} + if LibVersion < EC_POINT_set_compressed_coordinates_introduced then + begin + {$if declared(FC_EC_POINT_set_compressed_coordinates)} + EC_POINT_set_compressed_coordinates := @FC_EC_POINT_set_compressed_coordinates; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_POINT_set_compressed_coordinates_removed)} + if EC_POINT_set_compressed_coordinates_removed <= LibVersion then + begin + {$if declared(_EC_POINT_set_compressed_coordinates)} + EC_POINT_set_compressed_coordinates := @_EC_POINT_set_compressed_coordinates; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_POINT_set_compressed_coordinates_allownil)} + if FuncLoadError then + AFailed.Add('EC_POINT_set_compressed_coordinates'); + {$ifend} + end; + + {introduced 1.1.0} + EC_POINT_set_compressed_coordinates_GFp := LoadLibFunction(ADllHandle, EC_POINT_set_compressed_coordinates_GFp_procname); + FuncLoadError := not assigned(EC_POINT_set_compressed_coordinates_GFp); + if FuncLoadError then + begin + {$if not defined(EC_POINT_set_compressed_coordinates_GFp_allownil)} + EC_POINT_set_compressed_coordinates_GFp := @ERR_EC_POINT_set_compressed_coordinates_GFp; + {$ifend} + {$if declared(EC_POINT_set_compressed_coordinates_GFp_introduced)} + if LibVersion < EC_POINT_set_compressed_coordinates_GFp_introduced then + begin + {$if declared(FC_EC_POINT_set_compressed_coordinates_GFp)} + EC_POINT_set_compressed_coordinates_GFp := @FC_EC_POINT_set_compressed_coordinates_GFp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_POINT_set_compressed_coordinates_GFp_removed)} + if EC_POINT_set_compressed_coordinates_GFp_removed <= LibVersion then + begin + {$if declared(_EC_POINT_set_compressed_coordinates_GFp)} + EC_POINT_set_compressed_coordinates_GFp := @_EC_POINT_set_compressed_coordinates_GFp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_POINT_set_compressed_coordinates_GFp_allownil)} + if FuncLoadError then + AFailed.Add('EC_POINT_set_compressed_coordinates_GFp'); + {$ifend} + end; + + + EC_POINT_set_affine_coordinates_GF2m := LoadLibFunction(ADllHandle, EC_POINT_set_affine_coordinates_GF2m_procname); + FuncLoadError := not assigned(EC_POINT_set_affine_coordinates_GF2m); + if FuncLoadError then + begin + {$if not defined(EC_POINT_set_affine_coordinates_GF2m_allownil)} + EC_POINT_set_affine_coordinates_GF2m := @ERR_EC_POINT_set_affine_coordinates_GF2m; + {$ifend} + {$if declared(EC_POINT_set_affine_coordinates_GF2m_introduced)} + if LibVersion < EC_POINT_set_affine_coordinates_GF2m_introduced then + begin + {$if declared(FC_EC_POINT_set_affine_coordinates_GF2m)} + EC_POINT_set_affine_coordinates_GF2m := @FC_EC_POINT_set_affine_coordinates_GF2m; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_POINT_set_affine_coordinates_GF2m_removed)} + if EC_POINT_set_affine_coordinates_GF2m_removed <= LibVersion then + begin + {$if declared(_EC_POINT_set_affine_coordinates_GF2m)} + EC_POINT_set_affine_coordinates_GF2m := @_EC_POINT_set_affine_coordinates_GF2m; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_POINT_set_affine_coordinates_GF2m_allownil)} + if FuncLoadError then + AFailed.Add('EC_POINT_set_affine_coordinates_GF2m'); + {$ifend} + end; + + + EC_POINT_get_affine_coordinates_GF2m := LoadLibFunction(ADllHandle, EC_POINT_get_affine_coordinates_GF2m_procname); + FuncLoadError := not assigned(EC_POINT_get_affine_coordinates_GF2m); + if FuncLoadError then + begin + {$if not defined(EC_POINT_get_affine_coordinates_GF2m_allownil)} + EC_POINT_get_affine_coordinates_GF2m := @ERR_EC_POINT_get_affine_coordinates_GF2m; + {$ifend} + {$if declared(EC_POINT_get_affine_coordinates_GF2m_introduced)} + if LibVersion < EC_POINT_get_affine_coordinates_GF2m_introduced then + begin + {$if declared(FC_EC_POINT_get_affine_coordinates_GF2m)} + EC_POINT_get_affine_coordinates_GF2m := @FC_EC_POINT_get_affine_coordinates_GF2m; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_POINT_get_affine_coordinates_GF2m_removed)} + if EC_POINT_get_affine_coordinates_GF2m_removed <= LibVersion then + begin + {$if declared(_EC_POINT_get_affine_coordinates_GF2m)} + EC_POINT_get_affine_coordinates_GF2m := @_EC_POINT_get_affine_coordinates_GF2m; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_POINT_get_affine_coordinates_GF2m_allownil)} + if FuncLoadError then + AFailed.Add('EC_POINT_get_affine_coordinates_GF2m'); + {$ifend} + end; + + + EC_POINT_set_compressed_coordinates_GF2m := LoadLibFunction(ADllHandle, EC_POINT_set_compressed_coordinates_GF2m_procname); + FuncLoadError := not assigned(EC_POINT_set_compressed_coordinates_GF2m); + if FuncLoadError then + begin + {$if not defined(EC_POINT_set_compressed_coordinates_GF2m_allownil)} + EC_POINT_set_compressed_coordinates_GF2m := @ERR_EC_POINT_set_compressed_coordinates_GF2m; + {$ifend} + {$if declared(EC_POINT_set_compressed_coordinates_GF2m_introduced)} + if LibVersion < EC_POINT_set_compressed_coordinates_GF2m_introduced then + begin + {$if declared(FC_EC_POINT_set_compressed_coordinates_GF2m)} + EC_POINT_set_compressed_coordinates_GF2m := @FC_EC_POINT_set_compressed_coordinates_GF2m; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_POINT_set_compressed_coordinates_GF2m_removed)} + if EC_POINT_set_compressed_coordinates_GF2m_removed <= LibVersion then + begin + {$if declared(_EC_POINT_set_compressed_coordinates_GF2m)} + EC_POINT_set_compressed_coordinates_GF2m := @_EC_POINT_set_compressed_coordinates_GF2m; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_POINT_set_compressed_coordinates_GF2m_allownil)} + if FuncLoadError then + AFailed.Add('EC_POINT_set_compressed_coordinates_GF2m'); + {$ifend} + end; + + + EC_POINT_point2oct := LoadLibFunction(ADllHandle, EC_POINT_point2oct_procname); + FuncLoadError := not assigned(EC_POINT_point2oct); + if FuncLoadError then + begin + {$if not defined(EC_POINT_point2oct_allownil)} + EC_POINT_point2oct := @ERR_EC_POINT_point2oct; + {$ifend} + {$if declared(EC_POINT_point2oct_introduced)} + if LibVersion < EC_POINT_point2oct_introduced then + begin + {$if declared(FC_EC_POINT_point2oct)} + EC_POINT_point2oct := @FC_EC_POINT_point2oct; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_POINT_point2oct_removed)} + if EC_POINT_point2oct_removed <= LibVersion then + begin + {$if declared(_EC_POINT_point2oct)} + EC_POINT_point2oct := @_EC_POINT_point2oct; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_POINT_point2oct_allownil)} + if FuncLoadError then + AFailed.Add('EC_POINT_point2oct'); + {$ifend} + end; + + + EC_POINT_oct2point := LoadLibFunction(ADllHandle, EC_POINT_oct2point_procname); + FuncLoadError := not assigned(EC_POINT_oct2point); + if FuncLoadError then + begin + {$if not defined(EC_POINT_oct2point_allownil)} + EC_POINT_oct2point := @ERR_EC_POINT_oct2point; + {$ifend} + {$if declared(EC_POINT_oct2point_introduced)} + if LibVersion < EC_POINT_oct2point_introduced then + begin + {$if declared(FC_EC_POINT_oct2point)} + EC_POINT_oct2point := @FC_EC_POINT_oct2point; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_POINT_oct2point_removed)} + if EC_POINT_oct2point_removed <= LibVersion then + begin + {$if declared(_EC_POINT_oct2point)} + EC_POINT_oct2point := @_EC_POINT_oct2point; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_POINT_oct2point_allownil)} + if FuncLoadError then + AFailed.Add('EC_POINT_oct2point'); + {$ifend} + end; + + + EC_POINT_point2buf := LoadLibFunction(ADllHandle, EC_POINT_point2buf_procname); + FuncLoadError := not assigned(EC_POINT_point2buf); + if FuncLoadError then + begin + {$if not defined(EC_POINT_point2buf_allownil)} + EC_POINT_point2buf := @ERR_EC_POINT_point2buf; + {$ifend} + {$if declared(EC_POINT_point2buf_introduced)} + if LibVersion < EC_POINT_point2buf_introduced then + begin + {$if declared(FC_EC_POINT_point2buf)} + EC_POINT_point2buf := @FC_EC_POINT_point2buf; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_POINT_point2buf_removed)} + if EC_POINT_point2buf_removed <= LibVersion then + begin + {$if declared(_EC_POINT_point2buf)} + EC_POINT_point2buf := @_EC_POINT_point2buf; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_POINT_point2buf_allownil)} + if FuncLoadError then + AFailed.Add('EC_POINT_point2buf'); + {$ifend} + end; + + {introduced 1.1.0} + EC_POINT_point2bn := LoadLibFunction(ADllHandle, EC_POINT_point2bn_procname); + FuncLoadError := not assigned(EC_POINT_point2bn); + if FuncLoadError then + begin + {$if not defined(EC_POINT_point2bn_allownil)} + EC_POINT_point2bn := @ERR_EC_POINT_point2bn; + {$ifend} + {$if declared(EC_POINT_point2bn_introduced)} + if LibVersion < EC_POINT_point2bn_introduced then + begin + {$if declared(FC_EC_POINT_point2bn)} + EC_POINT_point2bn := @FC_EC_POINT_point2bn; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_POINT_point2bn_removed)} + if EC_POINT_point2bn_removed <= LibVersion then + begin + {$if declared(_EC_POINT_point2bn)} + EC_POINT_point2bn := @_EC_POINT_point2bn; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_POINT_point2bn_allownil)} + if FuncLoadError then + AFailed.Add('EC_POINT_point2bn'); + {$ifend} + end; + + + EC_POINT_bn2point := LoadLibFunction(ADllHandle, EC_POINT_bn2point_procname); + FuncLoadError := not assigned(EC_POINT_bn2point); + if FuncLoadError then + begin + {$if not defined(EC_POINT_bn2point_allownil)} + EC_POINT_bn2point := @ERR_EC_POINT_bn2point; + {$ifend} + {$if declared(EC_POINT_bn2point_introduced)} + if LibVersion < EC_POINT_bn2point_introduced then + begin + {$if declared(FC_EC_POINT_bn2point)} + EC_POINT_bn2point := @FC_EC_POINT_bn2point; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_POINT_bn2point_removed)} + if EC_POINT_bn2point_removed <= LibVersion then + begin + {$if declared(_EC_POINT_bn2point)} + EC_POINT_bn2point := @_EC_POINT_bn2point; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_POINT_bn2point_allownil)} + if FuncLoadError then + AFailed.Add('EC_POINT_bn2point'); + {$ifend} + end; + + + EC_POINT_point2hex := LoadLibFunction(ADllHandle, EC_POINT_point2hex_procname); + FuncLoadError := not assigned(EC_POINT_point2hex); + if FuncLoadError then + begin + {$if not defined(EC_POINT_point2hex_allownil)} + EC_POINT_point2hex := @ERR_EC_POINT_point2hex; + {$ifend} + {$if declared(EC_POINT_point2hex_introduced)} + if LibVersion < EC_POINT_point2hex_introduced then + begin + {$if declared(FC_EC_POINT_point2hex)} + EC_POINT_point2hex := @FC_EC_POINT_point2hex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_POINT_point2hex_removed)} + if EC_POINT_point2hex_removed <= LibVersion then + begin + {$if declared(_EC_POINT_point2hex)} + EC_POINT_point2hex := @_EC_POINT_point2hex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_POINT_point2hex_allownil)} + if FuncLoadError then + AFailed.Add('EC_POINT_point2hex'); + {$ifend} + end; + + + EC_POINT_hex2point := LoadLibFunction(ADllHandle, EC_POINT_hex2point_procname); + FuncLoadError := not assigned(EC_POINT_hex2point); + if FuncLoadError then + begin + {$if not defined(EC_POINT_hex2point_allownil)} + EC_POINT_hex2point := @ERR_EC_POINT_hex2point; + {$ifend} + {$if declared(EC_POINT_hex2point_introduced)} + if LibVersion < EC_POINT_hex2point_introduced then + begin + {$if declared(FC_EC_POINT_hex2point)} + EC_POINT_hex2point := @FC_EC_POINT_hex2point; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_POINT_hex2point_removed)} + if EC_POINT_hex2point_removed <= LibVersion then + begin + {$if declared(_EC_POINT_hex2point)} + EC_POINT_hex2point := @_EC_POINT_hex2point; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_POINT_hex2point_allownil)} + if FuncLoadError then + AFailed.Add('EC_POINT_hex2point'); + {$ifend} + end; + + + EC_POINT_add := LoadLibFunction(ADllHandle, EC_POINT_add_procname); + FuncLoadError := not assigned(EC_POINT_add); + if FuncLoadError then + begin + {$if not defined(EC_POINT_add_allownil)} + EC_POINT_add := @ERR_EC_POINT_add; + {$ifend} + {$if declared(EC_POINT_add_introduced)} + if LibVersion < EC_POINT_add_introduced then + begin + {$if declared(FC_EC_POINT_add)} + EC_POINT_add := @FC_EC_POINT_add; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_POINT_add_removed)} + if EC_POINT_add_removed <= LibVersion then + begin + {$if declared(_EC_POINT_add)} + EC_POINT_add := @_EC_POINT_add; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_POINT_add_allownil)} + if FuncLoadError then + AFailed.Add('EC_POINT_add'); + {$ifend} + end; + + + EC_POINT_dbl := LoadLibFunction(ADllHandle, EC_POINT_dbl_procname); + FuncLoadError := not assigned(EC_POINT_dbl); + if FuncLoadError then + begin + {$if not defined(EC_POINT_dbl_allownil)} + EC_POINT_dbl := @ERR_EC_POINT_dbl; + {$ifend} + {$if declared(EC_POINT_dbl_introduced)} + if LibVersion < EC_POINT_dbl_introduced then + begin + {$if declared(FC_EC_POINT_dbl)} + EC_POINT_dbl := @FC_EC_POINT_dbl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_POINT_dbl_removed)} + if EC_POINT_dbl_removed <= LibVersion then + begin + {$if declared(_EC_POINT_dbl)} + EC_POINT_dbl := @_EC_POINT_dbl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_POINT_dbl_allownil)} + if FuncLoadError then + AFailed.Add('EC_POINT_dbl'); + {$ifend} + end; + + + EC_POINT_invert := LoadLibFunction(ADllHandle, EC_POINT_invert_procname); + FuncLoadError := not assigned(EC_POINT_invert); + if FuncLoadError then + begin + {$if not defined(EC_POINT_invert_allownil)} + EC_POINT_invert := @ERR_EC_POINT_invert; + {$ifend} + {$if declared(EC_POINT_invert_introduced)} + if LibVersion < EC_POINT_invert_introduced then + begin + {$if declared(FC_EC_POINT_invert)} + EC_POINT_invert := @FC_EC_POINT_invert; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_POINT_invert_removed)} + if EC_POINT_invert_removed <= LibVersion then + begin + {$if declared(_EC_POINT_invert)} + EC_POINT_invert := @_EC_POINT_invert; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_POINT_invert_allownil)} + if FuncLoadError then + AFailed.Add('EC_POINT_invert'); + {$ifend} + end; + + + EC_POINT_is_at_infinity := LoadLibFunction(ADllHandle, EC_POINT_is_at_infinity_procname); + FuncLoadError := not assigned(EC_POINT_is_at_infinity); + if FuncLoadError then + begin + {$if not defined(EC_POINT_is_at_infinity_allownil)} + EC_POINT_is_at_infinity := @ERR_EC_POINT_is_at_infinity; + {$ifend} + {$if declared(EC_POINT_is_at_infinity_introduced)} + if LibVersion < EC_POINT_is_at_infinity_introduced then + begin + {$if declared(FC_EC_POINT_is_at_infinity)} + EC_POINT_is_at_infinity := @FC_EC_POINT_is_at_infinity; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_POINT_is_at_infinity_removed)} + if EC_POINT_is_at_infinity_removed <= LibVersion then + begin + {$if declared(_EC_POINT_is_at_infinity)} + EC_POINT_is_at_infinity := @_EC_POINT_is_at_infinity; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_POINT_is_at_infinity_allownil)} + if FuncLoadError then + AFailed.Add('EC_POINT_is_at_infinity'); + {$ifend} + end; + + + EC_POINT_is_on_curve := LoadLibFunction(ADllHandle, EC_POINT_is_on_curve_procname); + FuncLoadError := not assigned(EC_POINT_is_on_curve); + if FuncLoadError then + begin + {$if not defined(EC_POINT_is_on_curve_allownil)} + EC_POINT_is_on_curve := @ERR_EC_POINT_is_on_curve; + {$ifend} + {$if declared(EC_POINT_is_on_curve_introduced)} + if LibVersion < EC_POINT_is_on_curve_introduced then + begin + {$if declared(FC_EC_POINT_is_on_curve)} + EC_POINT_is_on_curve := @FC_EC_POINT_is_on_curve; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_POINT_is_on_curve_removed)} + if EC_POINT_is_on_curve_removed <= LibVersion then + begin + {$if declared(_EC_POINT_is_on_curve)} + EC_POINT_is_on_curve := @_EC_POINT_is_on_curve; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_POINT_is_on_curve_allownil)} + if FuncLoadError then + AFailed.Add('EC_POINT_is_on_curve'); + {$ifend} + end; + + + EC_POINT_cmp := LoadLibFunction(ADllHandle, EC_POINT_cmp_procname); + FuncLoadError := not assigned(EC_POINT_cmp); + if FuncLoadError then + begin + {$if not defined(EC_POINT_cmp_allownil)} + EC_POINT_cmp := @ERR_EC_POINT_cmp; + {$ifend} + {$if declared(EC_POINT_cmp_introduced)} + if LibVersion < EC_POINT_cmp_introduced then + begin + {$if declared(FC_EC_POINT_cmp)} + EC_POINT_cmp := @FC_EC_POINT_cmp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_POINT_cmp_removed)} + if EC_POINT_cmp_removed <= LibVersion then + begin + {$if declared(_EC_POINT_cmp)} + EC_POINT_cmp := @_EC_POINT_cmp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_POINT_cmp_allownil)} + if FuncLoadError then + AFailed.Add('EC_POINT_cmp'); + {$ifend} + end; + + + EC_POINT_make_affine := LoadLibFunction(ADllHandle, EC_POINT_make_affine_procname); + FuncLoadError := not assigned(EC_POINT_make_affine); + if FuncLoadError then + begin + {$if not defined(EC_POINT_make_affine_allownil)} + EC_POINT_make_affine := @ERR_EC_POINT_make_affine; + {$ifend} + {$if declared(EC_POINT_make_affine_introduced)} + if LibVersion < EC_POINT_make_affine_introduced then + begin + {$if declared(FC_EC_POINT_make_affine)} + EC_POINT_make_affine := @FC_EC_POINT_make_affine; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_POINT_make_affine_removed)} + if EC_POINT_make_affine_removed <= LibVersion then + begin + {$if declared(_EC_POINT_make_affine)} + EC_POINT_make_affine := @_EC_POINT_make_affine; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_POINT_make_affine_allownil)} + if FuncLoadError then + AFailed.Add('EC_POINT_make_affine'); + {$ifend} + end; + + + EC_POINTs_make_affine := LoadLibFunction(ADllHandle, EC_POINTs_make_affine_procname); + FuncLoadError := not assigned(EC_POINTs_make_affine); + if FuncLoadError then + begin + {$if not defined(EC_POINTs_make_affine_allownil)} + EC_POINTs_make_affine := @ERR_EC_POINTs_make_affine; + {$ifend} + {$if declared(EC_POINTs_make_affine_introduced)} + if LibVersion < EC_POINTs_make_affine_introduced then + begin + {$if declared(FC_EC_POINTs_make_affine)} + EC_POINTs_make_affine := @FC_EC_POINTs_make_affine; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_POINTs_make_affine_removed)} + if EC_POINTs_make_affine_removed <= LibVersion then + begin + {$if declared(_EC_POINTs_make_affine)} + EC_POINTs_make_affine := @_EC_POINTs_make_affine; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_POINTs_make_affine_allownil)} + if FuncLoadError then + AFailed.Add('EC_POINTs_make_affine'); + {$ifend} + end; + + + EC_POINTs_mul := LoadLibFunction(ADllHandle, EC_POINTs_mul_procname); + FuncLoadError := not assigned(EC_POINTs_mul); + if FuncLoadError then + begin + {$if not defined(EC_POINTs_mul_allownil)} + EC_POINTs_mul := @ERR_EC_POINTs_mul; + {$ifend} + {$if declared(EC_POINTs_mul_introduced)} + if LibVersion < EC_POINTs_mul_introduced then + begin + {$if declared(FC_EC_POINTs_mul)} + EC_POINTs_mul := @FC_EC_POINTs_mul; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_POINTs_mul_removed)} + if EC_POINTs_mul_removed <= LibVersion then + begin + {$if declared(_EC_POINTs_mul)} + EC_POINTs_mul := @_EC_POINTs_mul; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_POINTs_mul_allownil)} + if FuncLoadError then + AFailed.Add('EC_POINTs_mul'); + {$ifend} + end; + + + EC_POINT_mul := LoadLibFunction(ADllHandle, EC_POINT_mul_procname); + FuncLoadError := not assigned(EC_POINT_mul); + if FuncLoadError then + begin + {$if not defined(EC_POINT_mul_allownil)} + EC_POINT_mul := @ERR_EC_POINT_mul; + {$ifend} + {$if declared(EC_POINT_mul_introduced)} + if LibVersion < EC_POINT_mul_introduced then + begin + {$if declared(FC_EC_POINT_mul)} + EC_POINT_mul := @FC_EC_POINT_mul; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_POINT_mul_removed)} + if EC_POINT_mul_removed <= LibVersion then + begin + {$if declared(_EC_POINT_mul)} + EC_POINT_mul := @_EC_POINT_mul; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_POINT_mul_allownil)} + if FuncLoadError then + AFailed.Add('EC_POINT_mul'); + {$ifend} + end; + + + EC_GROUP_precompute_mult := LoadLibFunction(ADllHandle, EC_GROUP_precompute_mult_procname); + FuncLoadError := not assigned(EC_GROUP_precompute_mult); + if FuncLoadError then + begin + {$if not defined(EC_GROUP_precompute_mult_allownil)} + EC_GROUP_precompute_mult := @ERR_EC_GROUP_precompute_mult; + {$ifend} + {$if declared(EC_GROUP_precompute_mult_introduced)} + if LibVersion < EC_GROUP_precompute_mult_introduced then + begin + {$if declared(FC_EC_GROUP_precompute_mult)} + EC_GROUP_precompute_mult := @FC_EC_GROUP_precompute_mult; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_GROUP_precompute_mult_removed)} + if EC_GROUP_precompute_mult_removed <= LibVersion then + begin + {$if declared(_EC_GROUP_precompute_mult)} + EC_GROUP_precompute_mult := @_EC_GROUP_precompute_mult; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_GROUP_precompute_mult_allownil)} + if FuncLoadError then + AFailed.Add('EC_GROUP_precompute_mult'); + {$ifend} + end; + + + EC_GROUP_have_precompute_mult := LoadLibFunction(ADllHandle, EC_GROUP_have_precompute_mult_procname); + FuncLoadError := not assigned(EC_GROUP_have_precompute_mult); + if FuncLoadError then + begin + {$if not defined(EC_GROUP_have_precompute_mult_allownil)} + EC_GROUP_have_precompute_mult := @ERR_EC_GROUP_have_precompute_mult; + {$ifend} + {$if declared(EC_GROUP_have_precompute_mult_introduced)} + if LibVersion < EC_GROUP_have_precompute_mult_introduced then + begin + {$if declared(FC_EC_GROUP_have_precompute_mult)} + EC_GROUP_have_precompute_mult := @FC_EC_GROUP_have_precompute_mult; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_GROUP_have_precompute_mult_removed)} + if EC_GROUP_have_precompute_mult_removed <= LibVersion then + begin + {$if declared(_EC_GROUP_have_precompute_mult)} + EC_GROUP_have_precompute_mult := @_EC_GROUP_have_precompute_mult; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_GROUP_have_precompute_mult_allownil)} + if FuncLoadError then + AFailed.Add('EC_GROUP_have_precompute_mult'); + {$ifend} + end; + + + ECPKPARAMETERS_it := LoadLibFunction(ADllHandle, ECPKPARAMETERS_it_procname); + FuncLoadError := not assigned(ECPKPARAMETERS_it); + if FuncLoadError then + begin + {$if not defined(ECPKPARAMETERS_it_allownil)} + ECPKPARAMETERS_it := @ERR_ECPKPARAMETERS_it; + {$ifend} + {$if declared(ECPKPARAMETERS_it_introduced)} + if LibVersion < ECPKPARAMETERS_it_introduced then + begin + {$if declared(FC_ECPKPARAMETERS_it)} + ECPKPARAMETERS_it := @FC_ECPKPARAMETERS_it; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ECPKPARAMETERS_it_removed)} + if ECPKPARAMETERS_it_removed <= LibVersion then + begin + {$if declared(_ECPKPARAMETERS_it)} + ECPKPARAMETERS_it := @_ECPKPARAMETERS_it; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ECPKPARAMETERS_it_allownil)} + if FuncLoadError then + AFailed.Add('ECPKPARAMETERS_it'); + {$ifend} + end; + + + ECPKPARAMETERS_new := LoadLibFunction(ADllHandle, ECPKPARAMETERS_new_procname); + FuncLoadError := not assigned(ECPKPARAMETERS_new); + if FuncLoadError then + begin + {$if not defined(ECPKPARAMETERS_new_allownil)} + ECPKPARAMETERS_new := @ERR_ECPKPARAMETERS_new; + {$ifend} + {$if declared(ECPKPARAMETERS_new_introduced)} + if LibVersion < ECPKPARAMETERS_new_introduced then + begin + {$if declared(FC_ECPKPARAMETERS_new)} + ECPKPARAMETERS_new := @FC_ECPKPARAMETERS_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ECPKPARAMETERS_new_removed)} + if ECPKPARAMETERS_new_removed <= LibVersion then + begin + {$if declared(_ECPKPARAMETERS_new)} + ECPKPARAMETERS_new := @_ECPKPARAMETERS_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ECPKPARAMETERS_new_allownil)} + if FuncLoadError then + AFailed.Add('ECPKPARAMETERS_new'); + {$ifend} + end; + + + ECPKPARAMETERS_free := LoadLibFunction(ADllHandle, ECPKPARAMETERS_free_procname); + FuncLoadError := not assigned(ECPKPARAMETERS_free); + if FuncLoadError then + begin + {$if not defined(ECPKPARAMETERS_free_allownil)} + ECPKPARAMETERS_free := @ERR_ECPKPARAMETERS_free; + {$ifend} + {$if declared(ECPKPARAMETERS_free_introduced)} + if LibVersion < ECPKPARAMETERS_free_introduced then + begin + {$if declared(FC_ECPKPARAMETERS_free)} + ECPKPARAMETERS_free := @FC_ECPKPARAMETERS_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ECPKPARAMETERS_free_removed)} + if ECPKPARAMETERS_free_removed <= LibVersion then + begin + {$if declared(_ECPKPARAMETERS_free)} + ECPKPARAMETERS_free := @_ECPKPARAMETERS_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ECPKPARAMETERS_free_allownil)} + if FuncLoadError then + AFailed.Add('ECPKPARAMETERS_free'); + {$ifend} + end; + + + ECPARAMETERS_it := LoadLibFunction(ADllHandle, ECPARAMETERS_it_procname); + FuncLoadError := not assigned(ECPARAMETERS_it); + if FuncLoadError then + begin + {$if not defined(ECPARAMETERS_it_allownil)} + ECPARAMETERS_it := @ERR_ECPARAMETERS_it; + {$ifend} + {$if declared(ECPARAMETERS_it_introduced)} + if LibVersion < ECPARAMETERS_it_introduced then + begin + {$if declared(FC_ECPARAMETERS_it)} + ECPARAMETERS_it := @FC_ECPARAMETERS_it; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ECPARAMETERS_it_removed)} + if ECPARAMETERS_it_removed <= LibVersion then + begin + {$if declared(_ECPARAMETERS_it)} + ECPARAMETERS_it := @_ECPARAMETERS_it; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ECPARAMETERS_it_allownil)} + if FuncLoadError then + AFailed.Add('ECPARAMETERS_it'); + {$ifend} + end; + + + ECPARAMETERS_new := LoadLibFunction(ADllHandle, ECPARAMETERS_new_procname); + FuncLoadError := not assigned(ECPARAMETERS_new); + if FuncLoadError then + begin + {$if not defined(ECPARAMETERS_new_allownil)} + ECPARAMETERS_new := @ERR_ECPARAMETERS_new; + {$ifend} + {$if declared(ECPARAMETERS_new_introduced)} + if LibVersion < ECPARAMETERS_new_introduced then + begin + {$if declared(FC_ECPARAMETERS_new)} + ECPARAMETERS_new := @FC_ECPARAMETERS_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ECPARAMETERS_new_removed)} + if ECPARAMETERS_new_removed <= LibVersion then + begin + {$if declared(_ECPARAMETERS_new)} + ECPARAMETERS_new := @_ECPARAMETERS_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ECPARAMETERS_new_allownil)} + if FuncLoadError then + AFailed.Add('ECPARAMETERS_new'); + {$ifend} + end; + + + ECPARAMETERS_free := LoadLibFunction(ADllHandle, ECPARAMETERS_free_procname); + FuncLoadError := not assigned(ECPARAMETERS_free); + if FuncLoadError then + begin + {$if not defined(ECPARAMETERS_free_allownil)} + ECPARAMETERS_free := @ERR_ECPARAMETERS_free; + {$ifend} + {$if declared(ECPARAMETERS_free_introduced)} + if LibVersion < ECPARAMETERS_free_introduced then + begin + {$if declared(FC_ECPARAMETERS_free)} + ECPARAMETERS_free := @FC_ECPARAMETERS_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ECPARAMETERS_free_removed)} + if ECPARAMETERS_free_removed <= LibVersion then + begin + {$if declared(_ECPARAMETERS_free)} + ECPARAMETERS_free := @_ECPARAMETERS_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ECPARAMETERS_free_allownil)} + if FuncLoadError then + AFailed.Add('ECPARAMETERS_free'); + {$ifend} + end; + + + EC_GROUP_get_basis_type := LoadLibFunction(ADllHandle, EC_GROUP_get_basis_type_procname); + FuncLoadError := not assigned(EC_GROUP_get_basis_type); + if FuncLoadError then + begin + {$if not defined(EC_GROUP_get_basis_type_allownil)} + EC_GROUP_get_basis_type := @ERR_EC_GROUP_get_basis_type; + {$ifend} + {$if declared(EC_GROUP_get_basis_type_introduced)} + if LibVersion < EC_GROUP_get_basis_type_introduced then + begin + {$if declared(FC_EC_GROUP_get_basis_type)} + EC_GROUP_get_basis_type := @FC_EC_GROUP_get_basis_type; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_GROUP_get_basis_type_removed)} + if EC_GROUP_get_basis_type_removed <= LibVersion then + begin + {$if declared(_EC_GROUP_get_basis_type)} + EC_GROUP_get_basis_type := @_EC_GROUP_get_basis_type; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_GROUP_get_basis_type_allownil)} + if FuncLoadError then + AFailed.Add('EC_GROUP_get_basis_type'); + {$ifend} + end; + + + EC_GROUP_get_trinomial_basis := LoadLibFunction(ADllHandle, EC_GROUP_get_trinomial_basis_procname); + FuncLoadError := not assigned(EC_GROUP_get_trinomial_basis); + if FuncLoadError then + begin + {$if not defined(EC_GROUP_get_trinomial_basis_allownil)} + EC_GROUP_get_trinomial_basis := @ERR_EC_GROUP_get_trinomial_basis; + {$ifend} + {$if declared(EC_GROUP_get_trinomial_basis_introduced)} + if LibVersion < EC_GROUP_get_trinomial_basis_introduced then + begin + {$if declared(FC_EC_GROUP_get_trinomial_basis)} + EC_GROUP_get_trinomial_basis := @FC_EC_GROUP_get_trinomial_basis; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_GROUP_get_trinomial_basis_removed)} + if EC_GROUP_get_trinomial_basis_removed <= LibVersion then + begin + {$if declared(_EC_GROUP_get_trinomial_basis)} + EC_GROUP_get_trinomial_basis := @_EC_GROUP_get_trinomial_basis; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_GROUP_get_trinomial_basis_allownil)} + if FuncLoadError then + AFailed.Add('EC_GROUP_get_trinomial_basis'); + {$ifend} + end; + + + EC_GROUP_get_pentanomial_basis := LoadLibFunction(ADllHandle, EC_GROUP_get_pentanomial_basis_procname); + FuncLoadError := not assigned(EC_GROUP_get_pentanomial_basis); + if FuncLoadError then + begin + {$if not defined(EC_GROUP_get_pentanomial_basis_allownil)} + EC_GROUP_get_pentanomial_basis := @ERR_EC_GROUP_get_pentanomial_basis; + {$ifend} + {$if declared(EC_GROUP_get_pentanomial_basis_introduced)} + if LibVersion < EC_GROUP_get_pentanomial_basis_introduced then + begin + {$if declared(FC_EC_GROUP_get_pentanomial_basis)} + EC_GROUP_get_pentanomial_basis := @FC_EC_GROUP_get_pentanomial_basis; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_GROUP_get_pentanomial_basis_removed)} + if EC_GROUP_get_pentanomial_basis_removed <= LibVersion then + begin + {$if declared(_EC_GROUP_get_pentanomial_basis)} + EC_GROUP_get_pentanomial_basis := @_EC_GROUP_get_pentanomial_basis; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_GROUP_get_pentanomial_basis_allownil)} + if FuncLoadError then + AFailed.Add('EC_GROUP_get_pentanomial_basis'); + {$ifend} + end; + + + d2i_ECPKParameters := LoadLibFunction(ADllHandle, d2i_ECPKParameters_procname); + FuncLoadError := not assigned(d2i_ECPKParameters); + if FuncLoadError then + begin + {$if not defined(d2i_ECPKParameters_allownil)} + d2i_ECPKParameters := @ERR_d2i_ECPKParameters; + {$ifend} + {$if declared(d2i_ECPKParameters_introduced)} + if LibVersion < d2i_ECPKParameters_introduced then + begin + {$if declared(FC_d2i_ECPKParameters)} + d2i_ECPKParameters := @FC_d2i_ECPKParameters; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(d2i_ECPKParameters_removed)} + if d2i_ECPKParameters_removed <= LibVersion then + begin + {$if declared(_d2i_ECPKParameters)} + d2i_ECPKParameters := @_d2i_ECPKParameters; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(d2i_ECPKParameters_allownil)} + if FuncLoadError then + AFailed.Add('d2i_ECPKParameters'); + {$ifend} + end; + + + i2d_ECPKParameters := LoadLibFunction(ADllHandle, i2d_ECPKParameters_procname); + FuncLoadError := not assigned(i2d_ECPKParameters); + if FuncLoadError then + begin + {$if not defined(i2d_ECPKParameters_allownil)} + i2d_ECPKParameters := @ERR_i2d_ECPKParameters; + {$ifend} + {$if declared(i2d_ECPKParameters_introduced)} + if LibVersion < i2d_ECPKParameters_introduced then + begin + {$if declared(FC_i2d_ECPKParameters)} + i2d_ECPKParameters := @FC_i2d_ECPKParameters; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(i2d_ECPKParameters_removed)} + if i2d_ECPKParameters_removed <= LibVersion then + begin + {$if declared(_i2d_ECPKParameters)} + i2d_ECPKParameters := @_i2d_ECPKParameters; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(i2d_ECPKParameters_allownil)} + if FuncLoadError then + AFailed.Add('i2d_ECPKParameters'); + {$ifend} + end; + + + ECPKParameters_print := LoadLibFunction(ADllHandle, ECPKParameters_print_procname); + FuncLoadError := not assigned(ECPKParameters_print); + if FuncLoadError then + begin + {$if not defined(ECPKParameters_print_allownil)} + ECPKParameters_print := @ERR_ECPKParameters_print; + {$ifend} + {$if declared(ECPKParameters_print_introduced)} + if LibVersion < ECPKParameters_print_introduced then + begin + {$if declared(FC_ECPKParameters_print)} + ECPKParameters_print := @FC_ECPKParameters_print; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ECPKParameters_print_removed)} + if ECPKParameters_print_removed <= LibVersion then + begin + {$if declared(_ECPKParameters_print)} + ECPKParameters_print := @_ECPKParameters_print; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ECPKParameters_print_allownil)} + if FuncLoadError then + AFailed.Add('ECPKParameters_print'); + {$ifend} + end; + + + EC_KEY_new := LoadLibFunction(ADllHandle, EC_KEY_new_procname); + FuncLoadError := not assigned(EC_KEY_new); + if FuncLoadError then + begin + {$if not defined(EC_KEY_new_allownil)} + EC_KEY_new := @ERR_EC_KEY_new; + {$ifend} + {$if declared(EC_KEY_new_introduced)} + if LibVersion < EC_KEY_new_introduced then + begin + {$if declared(FC_EC_KEY_new)} + EC_KEY_new := @FC_EC_KEY_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_KEY_new_removed)} + if EC_KEY_new_removed <= LibVersion then + begin + {$if declared(_EC_KEY_new)} + EC_KEY_new := @_EC_KEY_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_KEY_new_allownil)} + if FuncLoadError then + AFailed.Add('EC_KEY_new'); + {$ifend} + end; + + + EC_KEY_get_flags := LoadLibFunction(ADllHandle, EC_KEY_get_flags_procname); + FuncLoadError := not assigned(EC_KEY_get_flags); + if FuncLoadError then + begin + {$if not defined(EC_KEY_get_flags_allownil)} + EC_KEY_get_flags := @ERR_EC_KEY_get_flags; + {$ifend} + {$if declared(EC_KEY_get_flags_introduced)} + if LibVersion < EC_KEY_get_flags_introduced then + begin + {$if declared(FC_EC_KEY_get_flags)} + EC_KEY_get_flags := @FC_EC_KEY_get_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_KEY_get_flags_removed)} + if EC_KEY_get_flags_removed <= LibVersion then + begin + {$if declared(_EC_KEY_get_flags)} + EC_KEY_get_flags := @_EC_KEY_get_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_KEY_get_flags_allownil)} + if FuncLoadError then + AFailed.Add('EC_KEY_get_flags'); + {$ifend} + end; + + + EC_KEY_set_flags := LoadLibFunction(ADllHandle, EC_KEY_set_flags_procname); + FuncLoadError := not assigned(EC_KEY_set_flags); + if FuncLoadError then + begin + {$if not defined(EC_KEY_set_flags_allownil)} + EC_KEY_set_flags := @ERR_EC_KEY_set_flags; + {$ifend} + {$if declared(EC_KEY_set_flags_introduced)} + if LibVersion < EC_KEY_set_flags_introduced then + begin + {$if declared(FC_EC_KEY_set_flags)} + EC_KEY_set_flags := @FC_EC_KEY_set_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_KEY_set_flags_removed)} + if EC_KEY_set_flags_removed <= LibVersion then + begin + {$if declared(_EC_KEY_set_flags)} + EC_KEY_set_flags := @_EC_KEY_set_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_KEY_set_flags_allownil)} + if FuncLoadError then + AFailed.Add('EC_KEY_set_flags'); + {$ifend} + end; + + + EC_KEY_clear_flags := LoadLibFunction(ADllHandle, EC_KEY_clear_flags_procname); + FuncLoadError := not assigned(EC_KEY_clear_flags); + if FuncLoadError then + begin + {$if not defined(EC_KEY_clear_flags_allownil)} + EC_KEY_clear_flags := @ERR_EC_KEY_clear_flags; + {$ifend} + {$if declared(EC_KEY_clear_flags_introduced)} + if LibVersion < EC_KEY_clear_flags_introduced then + begin + {$if declared(FC_EC_KEY_clear_flags)} + EC_KEY_clear_flags := @FC_EC_KEY_clear_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_KEY_clear_flags_removed)} + if EC_KEY_clear_flags_removed <= LibVersion then + begin + {$if declared(_EC_KEY_clear_flags)} + EC_KEY_clear_flags := @_EC_KEY_clear_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_KEY_clear_flags_allownil)} + if FuncLoadError then + AFailed.Add('EC_KEY_clear_flags'); + {$ifend} + end; + + + EC_KEY_new_by_curve_name := LoadLibFunction(ADllHandle, EC_KEY_new_by_curve_name_procname); + FuncLoadError := not assigned(EC_KEY_new_by_curve_name); + if FuncLoadError then + begin + {$if not defined(EC_KEY_new_by_curve_name_allownil)} + EC_KEY_new_by_curve_name := @ERR_EC_KEY_new_by_curve_name; + {$ifend} + {$if declared(EC_KEY_new_by_curve_name_introduced)} + if LibVersion < EC_KEY_new_by_curve_name_introduced then + begin + {$if declared(FC_EC_KEY_new_by_curve_name)} + EC_KEY_new_by_curve_name := @FC_EC_KEY_new_by_curve_name; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_KEY_new_by_curve_name_removed)} + if EC_KEY_new_by_curve_name_removed <= LibVersion then + begin + {$if declared(_EC_KEY_new_by_curve_name)} + EC_KEY_new_by_curve_name := @_EC_KEY_new_by_curve_name; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_KEY_new_by_curve_name_allownil)} + if FuncLoadError then + AFailed.Add('EC_KEY_new_by_curve_name'); + {$ifend} + end; + + + EC_KEY_free := LoadLibFunction(ADllHandle, EC_KEY_free_procname); + FuncLoadError := not assigned(EC_KEY_free); + if FuncLoadError then + begin + {$if not defined(EC_KEY_free_allownil)} + EC_KEY_free := @ERR_EC_KEY_free; + {$ifend} + {$if declared(EC_KEY_free_introduced)} + if LibVersion < EC_KEY_free_introduced then + begin + {$if declared(FC_EC_KEY_free)} + EC_KEY_free := @FC_EC_KEY_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_KEY_free_removed)} + if EC_KEY_free_removed <= LibVersion then + begin + {$if declared(_EC_KEY_free)} + EC_KEY_free := @_EC_KEY_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_KEY_free_allownil)} + if FuncLoadError then + AFailed.Add('EC_KEY_free'); + {$ifend} + end; + + + EC_KEY_copy := LoadLibFunction(ADllHandle, EC_KEY_copy_procname); + FuncLoadError := not assigned(EC_KEY_copy); + if FuncLoadError then + begin + {$if not defined(EC_KEY_copy_allownil)} + EC_KEY_copy := @ERR_EC_KEY_copy; + {$ifend} + {$if declared(EC_KEY_copy_introduced)} + if LibVersion < EC_KEY_copy_introduced then + begin + {$if declared(FC_EC_KEY_copy)} + EC_KEY_copy := @FC_EC_KEY_copy; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_KEY_copy_removed)} + if EC_KEY_copy_removed <= LibVersion then + begin + {$if declared(_EC_KEY_copy)} + EC_KEY_copy := @_EC_KEY_copy; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_KEY_copy_allownil)} + if FuncLoadError then + AFailed.Add('EC_KEY_copy'); + {$ifend} + end; + + + EC_KEY_dup := LoadLibFunction(ADllHandle, EC_KEY_dup_procname); + FuncLoadError := not assigned(EC_KEY_dup); + if FuncLoadError then + begin + {$if not defined(EC_KEY_dup_allownil)} + EC_KEY_dup := @ERR_EC_KEY_dup; + {$ifend} + {$if declared(EC_KEY_dup_introduced)} + if LibVersion < EC_KEY_dup_introduced then + begin + {$if declared(FC_EC_KEY_dup)} + EC_KEY_dup := @FC_EC_KEY_dup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_KEY_dup_removed)} + if EC_KEY_dup_removed <= LibVersion then + begin + {$if declared(_EC_KEY_dup)} + EC_KEY_dup := @_EC_KEY_dup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_KEY_dup_allownil)} + if FuncLoadError then + AFailed.Add('EC_KEY_dup'); + {$ifend} + end; + + + EC_KEY_up_ref := LoadLibFunction(ADllHandle, EC_KEY_up_ref_procname); + FuncLoadError := not assigned(EC_KEY_up_ref); + if FuncLoadError then + begin + {$if not defined(EC_KEY_up_ref_allownil)} + EC_KEY_up_ref := @ERR_EC_KEY_up_ref; + {$ifend} + {$if declared(EC_KEY_up_ref_introduced)} + if LibVersion < EC_KEY_up_ref_introduced then + begin + {$if declared(FC_EC_KEY_up_ref)} + EC_KEY_up_ref := @FC_EC_KEY_up_ref; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_KEY_up_ref_removed)} + if EC_KEY_up_ref_removed <= LibVersion then + begin + {$if declared(_EC_KEY_up_ref)} + EC_KEY_up_ref := @_EC_KEY_up_ref; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_KEY_up_ref_allownil)} + if FuncLoadError then + AFailed.Add('EC_KEY_up_ref'); + {$ifend} + end; + + + EC_KEY_get0_engine := LoadLibFunction(ADllHandle, EC_KEY_get0_engine_procname); + FuncLoadError := not assigned(EC_KEY_get0_engine); + if FuncLoadError then + begin + {$if not defined(EC_KEY_get0_engine_allownil)} + EC_KEY_get0_engine := @ERR_EC_KEY_get0_engine; + {$ifend} + {$if declared(EC_KEY_get0_engine_introduced)} + if LibVersion < EC_KEY_get0_engine_introduced then + begin + {$if declared(FC_EC_KEY_get0_engine)} + EC_KEY_get0_engine := @FC_EC_KEY_get0_engine; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_KEY_get0_engine_removed)} + if EC_KEY_get0_engine_removed <= LibVersion then + begin + {$if declared(_EC_KEY_get0_engine)} + EC_KEY_get0_engine := @_EC_KEY_get0_engine; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_KEY_get0_engine_allownil)} + if FuncLoadError then + AFailed.Add('EC_KEY_get0_engine'); + {$ifend} + end; + + {introduced 1.1.0} + EC_KEY_get0_group := LoadLibFunction(ADllHandle, EC_KEY_get0_group_procname); + FuncLoadError := not assigned(EC_KEY_get0_group); + if FuncLoadError then + begin + {$if not defined(EC_KEY_get0_group_allownil)} + EC_KEY_get0_group := @ERR_EC_KEY_get0_group; + {$ifend} + {$if declared(EC_KEY_get0_group_introduced)} + if LibVersion < EC_KEY_get0_group_introduced then + begin + {$if declared(FC_EC_KEY_get0_group)} + EC_KEY_get0_group := @FC_EC_KEY_get0_group; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_KEY_get0_group_removed)} + if EC_KEY_get0_group_removed <= LibVersion then + begin + {$if declared(_EC_KEY_get0_group)} + EC_KEY_get0_group := @_EC_KEY_get0_group; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_KEY_get0_group_allownil)} + if FuncLoadError then + AFailed.Add('EC_KEY_get0_group'); + {$ifend} + end; + + + EC_KEY_set_group := LoadLibFunction(ADllHandle, EC_KEY_set_group_procname); + FuncLoadError := not assigned(EC_KEY_set_group); + if FuncLoadError then + begin + {$if not defined(EC_KEY_set_group_allownil)} + EC_KEY_set_group := @ERR_EC_KEY_set_group; + {$ifend} + {$if declared(EC_KEY_set_group_introduced)} + if LibVersion < EC_KEY_set_group_introduced then + begin + {$if declared(FC_EC_KEY_set_group)} + EC_KEY_set_group := @FC_EC_KEY_set_group; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_KEY_set_group_removed)} + if EC_KEY_set_group_removed <= LibVersion then + begin + {$if declared(_EC_KEY_set_group)} + EC_KEY_set_group := @_EC_KEY_set_group; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_KEY_set_group_allownil)} + if FuncLoadError then + AFailed.Add('EC_KEY_set_group'); + {$ifend} + end; + + + EC_KEY_get0_private_key := LoadLibFunction(ADllHandle, EC_KEY_get0_private_key_procname); + FuncLoadError := not assigned(EC_KEY_get0_private_key); + if FuncLoadError then + begin + {$if not defined(EC_KEY_get0_private_key_allownil)} + EC_KEY_get0_private_key := @ERR_EC_KEY_get0_private_key; + {$ifend} + {$if declared(EC_KEY_get0_private_key_introduced)} + if LibVersion < EC_KEY_get0_private_key_introduced then + begin + {$if declared(FC_EC_KEY_get0_private_key)} + EC_KEY_get0_private_key := @FC_EC_KEY_get0_private_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_KEY_get0_private_key_removed)} + if EC_KEY_get0_private_key_removed <= LibVersion then + begin + {$if declared(_EC_KEY_get0_private_key)} + EC_KEY_get0_private_key := @_EC_KEY_get0_private_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_KEY_get0_private_key_allownil)} + if FuncLoadError then + AFailed.Add('EC_KEY_get0_private_key'); + {$ifend} + end; + + + EC_KEY_set_private_key := LoadLibFunction(ADllHandle, EC_KEY_set_private_key_procname); + FuncLoadError := not assigned(EC_KEY_set_private_key); + if FuncLoadError then + begin + {$if not defined(EC_KEY_set_private_key_allownil)} + EC_KEY_set_private_key := @ERR_EC_KEY_set_private_key; + {$ifend} + {$if declared(EC_KEY_set_private_key_introduced)} + if LibVersion < EC_KEY_set_private_key_introduced then + begin + {$if declared(FC_EC_KEY_set_private_key)} + EC_KEY_set_private_key := @FC_EC_KEY_set_private_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_KEY_set_private_key_removed)} + if EC_KEY_set_private_key_removed <= LibVersion then + begin + {$if declared(_EC_KEY_set_private_key)} + EC_KEY_set_private_key := @_EC_KEY_set_private_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_KEY_set_private_key_allownil)} + if FuncLoadError then + AFailed.Add('EC_KEY_set_private_key'); + {$ifend} + end; + + + EC_KEY_get0_public_key := LoadLibFunction(ADllHandle, EC_KEY_get0_public_key_procname); + FuncLoadError := not assigned(EC_KEY_get0_public_key); + if FuncLoadError then + begin + {$if not defined(EC_KEY_get0_public_key_allownil)} + EC_KEY_get0_public_key := @ERR_EC_KEY_get0_public_key; + {$ifend} + {$if declared(EC_KEY_get0_public_key_introduced)} + if LibVersion < EC_KEY_get0_public_key_introduced then + begin + {$if declared(FC_EC_KEY_get0_public_key)} + EC_KEY_get0_public_key := @FC_EC_KEY_get0_public_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_KEY_get0_public_key_removed)} + if EC_KEY_get0_public_key_removed <= LibVersion then + begin + {$if declared(_EC_KEY_get0_public_key)} + EC_KEY_get0_public_key := @_EC_KEY_get0_public_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_KEY_get0_public_key_allownil)} + if FuncLoadError then + AFailed.Add('EC_KEY_get0_public_key'); + {$ifend} + end; + + + EC_KEY_set_public_key := LoadLibFunction(ADllHandle, EC_KEY_set_public_key_procname); + FuncLoadError := not assigned(EC_KEY_set_public_key); + if FuncLoadError then + begin + {$if not defined(EC_KEY_set_public_key_allownil)} + EC_KEY_set_public_key := @ERR_EC_KEY_set_public_key; + {$ifend} + {$if declared(EC_KEY_set_public_key_introduced)} + if LibVersion < EC_KEY_set_public_key_introduced then + begin + {$if declared(FC_EC_KEY_set_public_key)} + EC_KEY_set_public_key := @FC_EC_KEY_set_public_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_KEY_set_public_key_removed)} + if EC_KEY_set_public_key_removed <= LibVersion then + begin + {$if declared(_EC_KEY_set_public_key)} + EC_KEY_set_public_key := @_EC_KEY_set_public_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_KEY_set_public_key_allownil)} + if FuncLoadError then + AFailed.Add('EC_KEY_set_public_key'); + {$ifend} + end; + + + EC_KEY_get_enc_flags := LoadLibFunction(ADllHandle, EC_KEY_get_enc_flags_procname); + FuncLoadError := not assigned(EC_KEY_get_enc_flags); + if FuncLoadError then + begin + {$if not defined(EC_KEY_get_enc_flags_allownil)} + EC_KEY_get_enc_flags := @ERR_EC_KEY_get_enc_flags; + {$ifend} + {$if declared(EC_KEY_get_enc_flags_introduced)} + if LibVersion < EC_KEY_get_enc_flags_introduced then + begin + {$if declared(FC_EC_KEY_get_enc_flags)} + EC_KEY_get_enc_flags := @FC_EC_KEY_get_enc_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_KEY_get_enc_flags_removed)} + if EC_KEY_get_enc_flags_removed <= LibVersion then + begin + {$if declared(_EC_KEY_get_enc_flags)} + EC_KEY_get_enc_flags := @_EC_KEY_get_enc_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_KEY_get_enc_flags_allownil)} + if FuncLoadError then + AFailed.Add('EC_KEY_get_enc_flags'); + {$ifend} + end; + + + EC_KEY_set_enc_flags := LoadLibFunction(ADllHandle, EC_KEY_set_enc_flags_procname); + FuncLoadError := not assigned(EC_KEY_set_enc_flags); + if FuncLoadError then + begin + {$if not defined(EC_KEY_set_enc_flags_allownil)} + EC_KEY_set_enc_flags := @ERR_EC_KEY_set_enc_flags; + {$ifend} + {$if declared(EC_KEY_set_enc_flags_introduced)} + if LibVersion < EC_KEY_set_enc_flags_introduced then + begin + {$if declared(FC_EC_KEY_set_enc_flags)} + EC_KEY_set_enc_flags := @FC_EC_KEY_set_enc_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_KEY_set_enc_flags_removed)} + if EC_KEY_set_enc_flags_removed <= LibVersion then + begin + {$if declared(_EC_KEY_set_enc_flags)} + EC_KEY_set_enc_flags := @_EC_KEY_set_enc_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_KEY_set_enc_flags_allownil)} + if FuncLoadError then + AFailed.Add('EC_KEY_set_enc_flags'); + {$ifend} + end; + + + EC_KEY_get_conv_form := LoadLibFunction(ADllHandle, EC_KEY_get_conv_form_procname); + FuncLoadError := not assigned(EC_KEY_get_conv_form); + if FuncLoadError then + begin + {$if not defined(EC_KEY_get_conv_form_allownil)} + EC_KEY_get_conv_form := @ERR_EC_KEY_get_conv_form; + {$ifend} + {$if declared(EC_KEY_get_conv_form_introduced)} + if LibVersion < EC_KEY_get_conv_form_introduced then + begin + {$if declared(FC_EC_KEY_get_conv_form)} + EC_KEY_get_conv_form := @FC_EC_KEY_get_conv_form; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_KEY_get_conv_form_removed)} + if EC_KEY_get_conv_form_removed <= LibVersion then + begin + {$if declared(_EC_KEY_get_conv_form)} + EC_KEY_get_conv_form := @_EC_KEY_get_conv_form; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_KEY_get_conv_form_allownil)} + if FuncLoadError then + AFailed.Add('EC_KEY_get_conv_form'); + {$ifend} + end; + + + EC_KEY_set_conv_form := LoadLibFunction(ADllHandle, EC_KEY_set_conv_form_procname); + FuncLoadError := not assigned(EC_KEY_set_conv_form); + if FuncLoadError then + begin + {$if not defined(EC_KEY_set_conv_form_allownil)} + EC_KEY_set_conv_form := @ERR_EC_KEY_set_conv_form; + {$ifend} + {$if declared(EC_KEY_set_conv_form_introduced)} + if LibVersion < EC_KEY_set_conv_form_introduced then + begin + {$if declared(FC_EC_KEY_set_conv_form)} + EC_KEY_set_conv_form := @FC_EC_KEY_set_conv_form; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_KEY_set_conv_form_removed)} + if EC_KEY_set_conv_form_removed <= LibVersion then + begin + {$if declared(_EC_KEY_set_conv_form)} + EC_KEY_set_conv_form := @_EC_KEY_set_conv_form; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_KEY_set_conv_form_allownil)} + if FuncLoadError then + AFailed.Add('EC_KEY_set_conv_form'); + {$ifend} + end; + + + EC_KEY_set_ex_data := LoadLibFunction(ADllHandle, EC_KEY_set_ex_data_procname); + FuncLoadError := not assigned(EC_KEY_set_ex_data); + if FuncLoadError then + begin + {$if not defined(EC_KEY_set_ex_data_allownil)} + EC_KEY_set_ex_data := @ERR_EC_KEY_set_ex_data; + {$ifend} + {$if declared(EC_KEY_set_ex_data_introduced)} + if LibVersion < EC_KEY_set_ex_data_introduced then + begin + {$if declared(FC_EC_KEY_set_ex_data)} + EC_KEY_set_ex_data := @FC_EC_KEY_set_ex_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_KEY_set_ex_data_removed)} + if EC_KEY_set_ex_data_removed <= LibVersion then + begin + {$if declared(_EC_KEY_set_ex_data)} + EC_KEY_set_ex_data := @_EC_KEY_set_ex_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_KEY_set_ex_data_allownil)} + if FuncLoadError then + AFailed.Add('EC_KEY_set_ex_data'); + {$ifend} + end; + + {introduced 1.1.0} + EC_KEY_get_ex_data := LoadLibFunction(ADllHandle, EC_KEY_get_ex_data_procname); + FuncLoadError := not assigned(EC_KEY_get_ex_data); + if FuncLoadError then + begin + {$if not defined(EC_KEY_get_ex_data_allownil)} + EC_KEY_get_ex_data := @ERR_EC_KEY_get_ex_data; + {$ifend} + {$if declared(EC_KEY_get_ex_data_introduced)} + if LibVersion < EC_KEY_get_ex_data_introduced then + begin + {$if declared(FC_EC_KEY_get_ex_data)} + EC_KEY_get_ex_data := @FC_EC_KEY_get_ex_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_KEY_get_ex_data_removed)} + if EC_KEY_get_ex_data_removed <= LibVersion then + begin + {$if declared(_EC_KEY_get_ex_data)} + EC_KEY_get_ex_data := @_EC_KEY_get_ex_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_KEY_get_ex_data_allownil)} + if FuncLoadError then + AFailed.Add('EC_KEY_get_ex_data'); + {$ifend} + end; + + {introduced 1.1.0} + EC_KEY_set_asn1_flag := LoadLibFunction(ADllHandle, EC_KEY_set_asn1_flag_procname); + FuncLoadError := not assigned(EC_KEY_set_asn1_flag); + if FuncLoadError then + begin + {$if not defined(EC_KEY_set_asn1_flag_allownil)} + EC_KEY_set_asn1_flag := @ERR_EC_KEY_set_asn1_flag; + {$ifend} + {$if declared(EC_KEY_set_asn1_flag_introduced)} + if LibVersion < EC_KEY_set_asn1_flag_introduced then + begin + {$if declared(FC_EC_KEY_set_asn1_flag)} + EC_KEY_set_asn1_flag := @FC_EC_KEY_set_asn1_flag; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_KEY_set_asn1_flag_removed)} + if EC_KEY_set_asn1_flag_removed <= LibVersion then + begin + {$if declared(_EC_KEY_set_asn1_flag)} + EC_KEY_set_asn1_flag := @_EC_KEY_set_asn1_flag; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_KEY_set_asn1_flag_allownil)} + if FuncLoadError then + AFailed.Add('EC_KEY_set_asn1_flag'); + {$ifend} + end; + + + EC_KEY_precompute_mult := LoadLibFunction(ADllHandle, EC_KEY_precompute_mult_procname); + FuncLoadError := not assigned(EC_KEY_precompute_mult); + if FuncLoadError then + begin + {$if not defined(EC_KEY_precompute_mult_allownil)} + EC_KEY_precompute_mult := @ERR_EC_KEY_precompute_mult; + {$ifend} + {$if declared(EC_KEY_precompute_mult_introduced)} + if LibVersion < EC_KEY_precompute_mult_introduced then + begin + {$if declared(FC_EC_KEY_precompute_mult)} + EC_KEY_precompute_mult := @FC_EC_KEY_precompute_mult; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_KEY_precompute_mult_removed)} + if EC_KEY_precompute_mult_removed <= LibVersion then + begin + {$if declared(_EC_KEY_precompute_mult)} + EC_KEY_precompute_mult := @_EC_KEY_precompute_mult; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_KEY_precompute_mult_allownil)} + if FuncLoadError then + AFailed.Add('EC_KEY_precompute_mult'); + {$ifend} + end; + + + EC_KEY_generate_key := LoadLibFunction(ADllHandle, EC_KEY_generate_key_procname); + FuncLoadError := not assigned(EC_KEY_generate_key); + if FuncLoadError then + begin + {$if not defined(EC_KEY_generate_key_allownil)} + EC_KEY_generate_key := @ERR_EC_KEY_generate_key; + {$ifend} + {$if declared(EC_KEY_generate_key_introduced)} + if LibVersion < EC_KEY_generate_key_introduced then + begin + {$if declared(FC_EC_KEY_generate_key)} + EC_KEY_generate_key := @FC_EC_KEY_generate_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_KEY_generate_key_removed)} + if EC_KEY_generate_key_removed <= LibVersion then + begin + {$if declared(_EC_KEY_generate_key)} + EC_KEY_generate_key := @_EC_KEY_generate_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_KEY_generate_key_allownil)} + if FuncLoadError then + AFailed.Add('EC_KEY_generate_key'); + {$ifend} + end; + + + EC_KEY_check_key := LoadLibFunction(ADllHandle, EC_KEY_check_key_procname); + FuncLoadError := not assigned(EC_KEY_check_key); + if FuncLoadError then + begin + {$if not defined(EC_KEY_check_key_allownil)} + EC_KEY_check_key := @ERR_EC_KEY_check_key; + {$ifend} + {$if declared(EC_KEY_check_key_introduced)} + if LibVersion < EC_KEY_check_key_introduced then + begin + {$if declared(FC_EC_KEY_check_key)} + EC_KEY_check_key := @FC_EC_KEY_check_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_KEY_check_key_removed)} + if EC_KEY_check_key_removed <= LibVersion then + begin + {$if declared(_EC_KEY_check_key)} + EC_KEY_check_key := @_EC_KEY_check_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_KEY_check_key_allownil)} + if FuncLoadError then + AFailed.Add('EC_KEY_check_key'); + {$ifend} + end; + + + EC_KEY_can_sign := LoadLibFunction(ADllHandle, EC_KEY_can_sign_procname); + FuncLoadError := not assigned(EC_KEY_can_sign); + if FuncLoadError then + begin + {$if not defined(EC_KEY_can_sign_allownil)} + EC_KEY_can_sign := @ERR_EC_KEY_can_sign; + {$ifend} + {$if declared(EC_KEY_can_sign_introduced)} + if LibVersion < EC_KEY_can_sign_introduced then + begin + {$if declared(FC_EC_KEY_can_sign)} + EC_KEY_can_sign := @FC_EC_KEY_can_sign; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_KEY_can_sign_removed)} + if EC_KEY_can_sign_removed <= LibVersion then + begin + {$if declared(_EC_KEY_can_sign)} + EC_KEY_can_sign := @_EC_KEY_can_sign; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_KEY_can_sign_allownil)} + if FuncLoadError then + AFailed.Add('EC_KEY_can_sign'); + {$ifend} + end; + + {introduced 1.1.0} + EC_KEY_set_public_key_affine_coordinates := LoadLibFunction(ADllHandle, EC_KEY_set_public_key_affine_coordinates_procname); + FuncLoadError := not assigned(EC_KEY_set_public_key_affine_coordinates); + if FuncLoadError then + begin + {$if not defined(EC_KEY_set_public_key_affine_coordinates_allownil)} + EC_KEY_set_public_key_affine_coordinates := @ERR_EC_KEY_set_public_key_affine_coordinates; + {$ifend} + {$if declared(EC_KEY_set_public_key_affine_coordinates_introduced)} + if LibVersion < EC_KEY_set_public_key_affine_coordinates_introduced then + begin + {$if declared(FC_EC_KEY_set_public_key_affine_coordinates)} + EC_KEY_set_public_key_affine_coordinates := @FC_EC_KEY_set_public_key_affine_coordinates; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_KEY_set_public_key_affine_coordinates_removed)} + if EC_KEY_set_public_key_affine_coordinates_removed <= LibVersion then + begin + {$if declared(_EC_KEY_set_public_key_affine_coordinates)} + EC_KEY_set_public_key_affine_coordinates := @_EC_KEY_set_public_key_affine_coordinates; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_KEY_set_public_key_affine_coordinates_allownil)} + if FuncLoadError then + AFailed.Add('EC_KEY_set_public_key_affine_coordinates'); + {$ifend} + end; + + + EC_KEY_key2buf := LoadLibFunction(ADllHandle, EC_KEY_key2buf_procname); + FuncLoadError := not assigned(EC_KEY_key2buf); + if FuncLoadError then + begin + {$if not defined(EC_KEY_key2buf_allownil)} + EC_KEY_key2buf := @ERR_EC_KEY_key2buf; + {$ifend} + {$if declared(EC_KEY_key2buf_introduced)} + if LibVersion < EC_KEY_key2buf_introduced then + begin + {$if declared(FC_EC_KEY_key2buf)} + EC_KEY_key2buf := @FC_EC_KEY_key2buf; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_KEY_key2buf_removed)} + if EC_KEY_key2buf_removed <= LibVersion then + begin + {$if declared(_EC_KEY_key2buf)} + EC_KEY_key2buf := @_EC_KEY_key2buf; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_KEY_key2buf_allownil)} + if FuncLoadError then + AFailed.Add('EC_KEY_key2buf'); + {$ifend} + end; + + {introduced 1.1.0} + EC_KEY_oct2key := LoadLibFunction(ADllHandle, EC_KEY_oct2key_procname); + FuncLoadError := not assigned(EC_KEY_oct2key); + if FuncLoadError then + begin + {$if not defined(EC_KEY_oct2key_allownil)} + EC_KEY_oct2key := @ERR_EC_KEY_oct2key; + {$ifend} + {$if declared(EC_KEY_oct2key_introduced)} + if LibVersion < EC_KEY_oct2key_introduced then + begin + {$if declared(FC_EC_KEY_oct2key)} + EC_KEY_oct2key := @FC_EC_KEY_oct2key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_KEY_oct2key_removed)} + if EC_KEY_oct2key_removed <= LibVersion then + begin + {$if declared(_EC_KEY_oct2key)} + EC_KEY_oct2key := @_EC_KEY_oct2key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_KEY_oct2key_allownil)} + if FuncLoadError then + AFailed.Add('EC_KEY_oct2key'); + {$ifend} + end; + + {introduced 1.1.0} + EC_KEY_oct2priv := LoadLibFunction(ADllHandle, EC_KEY_oct2priv_procname); + FuncLoadError := not assigned(EC_KEY_oct2priv); + if FuncLoadError then + begin + {$if not defined(EC_KEY_oct2priv_allownil)} + EC_KEY_oct2priv := @ERR_EC_KEY_oct2priv; + {$ifend} + {$if declared(EC_KEY_oct2priv_introduced)} + if LibVersion < EC_KEY_oct2priv_introduced then + begin + {$if declared(FC_EC_KEY_oct2priv)} + EC_KEY_oct2priv := @FC_EC_KEY_oct2priv; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_KEY_oct2priv_removed)} + if EC_KEY_oct2priv_removed <= LibVersion then + begin + {$if declared(_EC_KEY_oct2priv)} + EC_KEY_oct2priv := @_EC_KEY_oct2priv; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_KEY_oct2priv_allownil)} + if FuncLoadError then + AFailed.Add('EC_KEY_oct2priv'); + {$ifend} + end; + + {introduced 1.1.0} + EC_KEY_priv2oct := LoadLibFunction(ADllHandle, EC_KEY_priv2oct_procname); + FuncLoadError := not assigned(EC_KEY_priv2oct); + if FuncLoadError then + begin + {$if not defined(EC_KEY_priv2oct_allownil)} + EC_KEY_priv2oct := @ERR_EC_KEY_priv2oct; + {$ifend} + {$if declared(EC_KEY_priv2oct_introduced)} + if LibVersion < EC_KEY_priv2oct_introduced then + begin + {$if declared(FC_EC_KEY_priv2oct)} + EC_KEY_priv2oct := @FC_EC_KEY_priv2oct; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_KEY_priv2oct_removed)} + if EC_KEY_priv2oct_removed <= LibVersion then + begin + {$if declared(_EC_KEY_priv2oct)} + EC_KEY_priv2oct := @_EC_KEY_priv2oct; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_KEY_priv2oct_allownil)} + if FuncLoadError then + AFailed.Add('EC_KEY_priv2oct'); + {$ifend} + end; + + {introduced 1.1.0} + EC_KEY_priv2buf := LoadLibFunction(ADllHandle, EC_KEY_priv2buf_procname); + FuncLoadError := not assigned(EC_KEY_priv2buf); + if FuncLoadError then + begin + {$if not defined(EC_KEY_priv2buf_allownil)} + EC_KEY_priv2buf := @ERR_EC_KEY_priv2buf; + {$ifend} + {$if declared(EC_KEY_priv2buf_introduced)} + if LibVersion < EC_KEY_priv2buf_introduced then + begin + {$if declared(FC_EC_KEY_priv2buf)} + EC_KEY_priv2buf := @FC_EC_KEY_priv2buf; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_KEY_priv2buf_removed)} + if EC_KEY_priv2buf_removed <= LibVersion then + begin + {$if declared(_EC_KEY_priv2buf)} + EC_KEY_priv2buf := @_EC_KEY_priv2buf; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_KEY_priv2buf_allownil)} + if FuncLoadError then + AFailed.Add('EC_KEY_priv2buf'); + {$ifend} + end; + + {introduced 1.1.0} + d2i_ECPrivateKey := LoadLibFunction(ADllHandle, d2i_ECPrivateKey_procname); + FuncLoadError := not assigned(d2i_ECPrivateKey); + if FuncLoadError then + begin + {$if not defined(d2i_ECPrivateKey_allownil)} + d2i_ECPrivateKey := @ERR_d2i_ECPrivateKey; + {$ifend} + {$if declared(d2i_ECPrivateKey_introduced)} + if LibVersion < d2i_ECPrivateKey_introduced then + begin + {$if declared(FC_d2i_ECPrivateKey)} + d2i_ECPrivateKey := @FC_d2i_ECPrivateKey; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(d2i_ECPrivateKey_removed)} + if d2i_ECPrivateKey_removed <= LibVersion then + begin + {$if declared(_d2i_ECPrivateKey)} + d2i_ECPrivateKey := @_d2i_ECPrivateKey; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(d2i_ECPrivateKey_allownil)} + if FuncLoadError then + AFailed.Add('d2i_ECPrivateKey'); + {$ifend} + end; + + + i2d_ECPrivateKey := LoadLibFunction(ADllHandle, i2d_ECPrivateKey_procname); + FuncLoadError := not assigned(i2d_ECPrivateKey); + if FuncLoadError then + begin + {$if not defined(i2d_ECPrivateKey_allownil)} + i2d_ECPrivateKey := @ERR_i2d_ECPrivateKey; + {$ifend} + {$if declared(i2d_ECPrivateKey_introduced)} + if LibVersion < i2d_ECPrivateKey_introduced then + begin + {$if declared(FC_i2d_ECPrivateKey)} + i2d_ECPrivateKey := @FC_i2d_ECPrivateKey; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(i2d_ECPrivateKey_removed)} + if i2d_ECPrivateKey_removed <= LibVersion then + begin + {$if declared(_i2d_ECPrivateKey)} + i2d_ECPrivateKey := @_i2d_ECPrivateKey; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(i2d_ECPrivateKey_allownil)} + if FuncLoadError then + AFailed.Add('i2d_ECPrivateKey'); + {$ifend} + end; + + + o2i_ECPublicKey := LoadLibFunction(ADllHandle, o2i_ECPublicKey_procname); + FuncLoadError := not assigned(o2i_ECPublicKey); + if FuncLoadError then + begin + {$if not defined(o2i_ECPublicKey_allownil)} + o2i_ECPublicKey := @ERR_o2i_ECPublicKey; + {$ifend} + {$if declared(o2i_ECPublicKey_introduced)} + if LibVersion < o2i_ECPublicKey_introduced then + begin + {$if declared(FC_o2i_ECPublicKey)} + o2i_ECPublicKey := @FC_o2i_ECPublicKey; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(o2i_ECPublicKey_removed)} + if o2i_ECPublicKey_removed <= LibVersion then + begin + {$if declared(_o2i_ECPublicKey)} + o2i_ECPublicKey := @_o2i_ECPublicKey; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(o2i_ECPublicKey_allownil)} + if FuncLoadError then + AFailed.Add('o2i_ECPublicKey'); + {$ifend} + end; + + + i2o_ECPublicKey := LoadLibFunction(ADllHandle, i2o_ECPublicKey_procname); + FuncLoadError := not assigned(i2o_ECPublicKey); + if FuncLoadError then + begin + {$if not defined(i2o_ECPublicKey_allownil)} + i2o_ECPublicKey := @ERR_i2o_ECPublicKey; + {$ifend} + {$if declared(i2o_ECPublicKey_introduced)} + if LibVersion < i2o_ECPublicKey_introduced then + begin + {$if declared(FC_i2o_ECPublicKey)} + i2o_ECPublicKey := @FC_i2o_ECPublicKey; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(i2o_ECPublicKey_removed)} + if i2o_ECPublicKey_removed <= LibVersion then + begin + {$if declared(_i2o_ECPublicKey)} + i2o_ECPublicKey := @_i2o_ECPublicKey; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(i2o_ECPublicKey_allownil)} + if FuncLoadError then + AFailed.Add('i2o_ECPublicKey'); + {$ifend} + end; + + + ECParameters_print := LoadLibFunction(ADllHandle, ECParameters_print_procname); + FuncLoadError := not assigned(ECParameters_print); + if FuncLoadError then + begin + {$if not defined(ECParameters_print_allownil)} + ECParameters_print := @ERR_ECParameters_print; + {$ifend} + {$if declared(ECParameters_print_introduced)} + if LibVersion < ECParameters_print_introduced then + begin + {$if declared(FC_ECParameters_print)} + ECParameters_print := @FC_ECParameters_print; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ECParameters_print_removed)} + if ECParameters_print_removed <= LibVersion then + begin + {$if declared(_ECParameters_print)} + ECParameters_print := @_ECParameters_print; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ECParameters_print_allownil)} + if FuncLoadError then + AFailed.Add('ECParameters_print'); + {$ifend} + end; + + + EC_KEY_print := LoadLibFunction(ADllHandle, EC_KEY_print_procname); + FuncLoadError := not assigned(EC_KEY_print); + if FuncLoadError then + begin + {$if not defined(EC_KEY_print_allownil)} + EC_KEY_print := @ERR_EC_KEY_print; + {$ifend} + {$if declared(EC_KEY_print_introduced)} + if LibVersion < EC_KEY_print_introduced then + begin + {$if declared(FC_EC_KEY_print)} + EC_KEY_print := @FC_EC_KEY_print; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_KEY_print_removed)} + if EC_KEY_print_removed <= LibVersion then + begin + {$if declared(_EC_KEY_print)} + EC_KEY_print := @_EC_KEY_print; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_KEY_print_allownil)} + if FuncLoadError then + AFailed.Add('EC_KEY_print'); + {$ifend} + end; + + + EC_KEY_OpenSSL := LoadLibFunction(ADllHandle, EC_KEY_OpenSSL_procname); + FuncLoadError := not assigned(EC_KEY_OpenSSL); + if FuncLoadError then + begin + {$if not defined(EC_KEY_OpenSSL_allownil)} + EC_KEY_OpenSSL := @ERR_EC_KEY_OpenSSL; + {$ifend} + {$if declared(EC_KEY_OpenSSL_introduced)} + if LibVersion < EC_KEY_OpenSSL_introduced then + begin + {$if declared(FC_EC_KEY_OpenSSL)} + EC_KEY_OpenSSL := @FC_EC_KEY_OpenSSL; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_KEY_OpenSSL_removed)} + if EC_KEY_OpenSSL_removed <= LibVersion then + begin + {$if declared(_EC_KEY_OpenSSL)} + EC_KEY_OpenSSL := @_EC_KEY_OpenSSL; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_KEY_OpenSSL_allownil)} + if FuncLoadError then + AFailed.Add('EC_KEY_OpenSSL'); + {$ifend} + end; + + {introduced 1.1.0} + EC_KEY_get_default_method := LoadLibFunction(ADllHandle, EC_KEY_get_default_method_procname); + FuncLoadError := not assigned(EC_KEY_get_default_method); + if FuncLoadError then + begin + {$if not defined(EC_KEY_get_default_method_allownil)} + EC_KEY_get_default_method := @ERR_EC_KEY_get_default_method; + {$ifend} + {$if declared(EC_KEY_get_default_method_introduced)} + if LibVersion < EC_KEY_get_default_method_introduced then + begin + {$if declared(FC_EC_KEY_get_default_method)} + EC_KEY_get_default_method := @FC_EC_KEY_get_default_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_KEY_get_default_method_removed)} + if EC_KEY_get_default_method_removed <= LibVersion then + begin + {$if declared(_EC_KEY_get_default_method)} + EC_KEY_get_default_method := @_EC_KEY_get_default_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_KEY_get_default_method_allownil)} + if FuncLoadError then + AFailed.Add('EC_KEY_get_default_method'); + {$ifend} + end; + + {introduced 1.1.0} + EC_KEY_set_default_method := LoadLibFunction(ADllHandle, EC_KEY_set_default_method_procname); + FuncLoadError := not assigned(EC_KEY_set_default_method); + if FuncLoadError then + begin + {$if not defined(EC_KEY_set_default_method_allownil)} + EC_KEY_set_default_method := @ERR_EC_KEY_set_default_method; + {$ifend} + {$if declared(EC_KEY_set_default_method_introduced)} + if LibVersion < EC_KEY_set_default_method_introduced then + begin + {$if declared(FC_EC_KEY_set_default_method)} + EC_KEY_set_default_method := @FC_EC_KEY_set_default_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_KEY_set_default_method_removed)} + if EC_KEY_set_default_method_removed <= LibVersion then + begin + {$if declared(_EC_KEY_set_default_method)} + EC_KEY_set_default_method := @_EC_KEY_set_default_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_KEY_set_default_method_allownil)} + if FuncLoadError then + AFailed.Add('EC_KEY_set_default_method'); + {$ifend} + end; + + {introduced 1.1.0} + EC_KEY_get_method := LoadLibFunction(ADllHandle, EC_KEY_get_method_procname); + FuncLoadError := not assigned(EC_KEY_get_method); + if FuncLoadError then + begin + {$if not defined(EC_KEY_get_method_allownil)} + EC_KEY_get_method := @ERR_EC_KEY_get_method; + {$ifend} + {$if declared(EC_KEY_get_method_introduced)} + if LibVersion < EC_KEY_get_method_introduced then + begin + {$if declared(FC_EC_KEY_get_method)} + EC_KEY_get_method := @FC_EC_KEY_get_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_KEY_get_method_removed)} + if EC_KEY_get_method_removed <= LibVersion then + begin + {$if declared(_EC_KEY_get_method)} + EC_KEY_get_method := @_EC_KEY_get_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_KEY_get_method_allownil)} + if FuncLoadError then + AFailed.Add('EC_KEY_get_method'); + {$ifend} + end; + + {introduced 1.1.0} + EC_KEY_set_method := LoadLibFunction(ADllHandle, EC_KEY_set_method_procname); + FuncLoadError := not assigned(EC_KEY_set_method); + if FuncLoadError then + begin + {$if not defined(EC_KEY_set_method_allownil)} + EC_KEY_set_method := @ERR_EC_KEY_set_method; + {$ifend} + {$if declared(EC_KEY_set_method_introduced)} + if LibVersion < EC_KEY_set_method_introduced then + begin + {$if declared(FC_EC_KEY_set_method)} + EC_KEY_set_method := @FC_EC_KEY_set_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_KEY_set_method_removed)} + if EC_KEY_set_method_removed <= LibVersion then + begin + {$if declared(_EC_KEY_set_method)} + EC_KEY_set_method := @_EC_KEY_set_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_KEY_set_method_allownil)} + if FuncLoadError then + AFailed.Add('EC_KEY_set_method'); + {$ifend} + end; + + {introduced 1.1.0} + EC_KEY_new_method := LoadLibFunction(ADllHandle, EC_KEY_new_method_procname); + FuncLoadError := not assigned(EC_KEY_new_method); + if FuncLoadError then + begin + {$if not defined(EC_KEY_new_method_allownil)} + EC_KEY_new_method := @ERR_EC_KEY_new_method; + {$ifend} + {$if declared(EC_KEY_new_method_introduced)} + if LibVersion < EC_KEY_new_method_introduced then + begin + {$if declared(FC_EC_KEY_new_method)} + EC_KEY_new_method := @FC_EC_KEY_new_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_KEY_new_method_removed)} + if EC_KEY_new_method_removed <= LibVersion then + begin + {$if declared(_EC_KEY_new_method)} + EC_KEY_new_method := @_EC_KEY_new_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_KEY_new_method_allownil)} + if FuncLoadError then + AFailed.Add('EC_KEY_new_method'); + {$ifend} + end; + + {introduced 1.1.0} + ECDH_KDF_X9_62 := LoadLibFunction(ADllHandle, ECDH_KDF_X9_62_procname); + FuncLoadError := not assigned(ECDH_KDF_X9_62); + if FuncLoadError then + begin + {$if not defined(ECDH_KDF_X9_62_allownil)} + ECDH_KDF_X9_62 := @ERR_ECDH_KDF_X9_62; + {$ifend} + {$if declared(ECDH_KDF_X9_62_introduced)} + if LibVersion < ECDH_KDF_X9_62_introduced then + begin + {$if declared(FC_ECDH_KDF_X9_62)} + ECDH_KDF_X9_62 := @FC_ECDH_KDF_X9_62; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ECDH_KDF_X9_62_removed)} + if ECDH_KDF_X9_62_removed <= LibVersion then + begin + {$if declared(_ECDH_KDF_X9_62)} + ECDH_KDF_X9_62 := @_ECDH_KDF_X9_62; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ECDH_KDF_X9_62_allownil)} + if FuncLoadError then + AFailed.Add('ECDH_KDF_X9_62'); + {$ifend} + end; + + + ECDH_compute_key := LoadLibFunction(ADllHandle, ECDH_compute_key_procname); + FuncLoadError := not assigned(ECDH_compute_key); + if FuncLoadError then + begin + {$if not defined(ECDH_compute_key_allownil)} + ECDH_compute_key := @ERR_ECDH_compute_key; + {$ifend} + {$if declared(ECDH_compute_key_introduced)} + if LibVersion < ECDH_compute_key_introduced then + begin + {$if declared(FC_ECDH_compute_key)} + ECDH_compute_key := @FC_ECDH_compute_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ECDH_compute_key_removed)} + if ECDH_compute_key_removed <= LibVersion then + begin + {$if declared(_ECDH_compute_key)} + ECDH_compute_key := @_ECDH_compute_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ECDH_compute_key_allownil)} + if FuncLoadError then + AFailed.Add('ECDH_compute_key'); + {$ifend} + end; + + + ECDSA_SIG_new := LoadLibFunction(ADllHandle, ECDSA_SIG_new_procname); + FuncLoadError := not assigned(ECDSA_SIG_new); + if FuncLoadError then + begin + {$if not defined(ECDSA_SIG_new_allownil)} + ECDSA_SIG_new := @ERR_ECDSA_SIG_new; + {$ifend} + {$if declared(ECDSA_SIG_new_introduced)} + if LibVersion < ECDSA_SIG_new_introduced then + begin + {$if declared(FC_ECDSA_SIG_new)} + ECDSA_SIG_new := @FC_ECDSA_SIG_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ECDSA_SIG_new_removed)} + if ECDSA_SIG_new_removed <= LibVersion then + begin + {$if declared(_ECDSA_SIG_new)} + ECDSA_SIG_new := @_ECDSA_SIG_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ECDSA_SIG_new_allownil)} + if FuncLoadError then + AFailed.Add('ECDSA_SIG_new'); + {$ifend} + end; + + + ECDSA_SIG_free := LoadLibFunction(ADllHandle, ECDSA_SIG_free_procname); + FuncLoadError := not assigned(ECDSA_SIG_free); + if FuncLoadError then + begin + {$if not defined(ECDSA_SIG_free_allownil)} + ECDSA_SIG_free := @ERR_ECDSA_SIG_free; + {$ifend} + {$if declared(ECDSA_SIG_free_introduced)} + if LibVersion < ECDSA_SIG_free_introduced then + begin + {$if declared(FC_ECDSA_SIG_free)} + ECDSA_SIG_free := @FC_ECDSA_SIG_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ECDSA_SIG_free_removed)} + if ECDSA_SIG_free_removed <= LibVersion then + begin + {$if declared(_ECDSA_SIG_free)} + ECDSA_SIG_free := @_ECDSA_SIG_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ECDSA_SIG_free_allownil)} + if FuncLoadError then + AFailed.Add('ECDSA_SIG_free'); + {$ifend} + end; + + + i2d_ECDSA_SIG := LoadLibFunction(ADllHandle, i2d_ECDSA_SIG_procname); + FuncLoadError := not assigned(i2d_ECDSA_SIG); + if FuncLoadError then + begin + {$if not defined(i2d_ECDSA_SIG_allownil)} + i2d_ECDSA_SIG := @ERR_i2d_ECDSA_SIG; + {$ifend} + {$if declared(i2d_ECDSA_SIG_introduced)} + if LibVersion < i2d_ECDSA_SIG_introduced then + begin + {$if declared(FC_i2d_ECDSA_SIG)} + i2d_ECDSA_SIG := @FC_i2d_ECDSA_SIG; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(i2d_ECDSA_SIG_removed)} + if i2d_ECDSA_SIG_removed <= LibVersion then + begin + {$if declared(_i2d_ECDSA_SIG)} + i2d_ECDSA_SIG := @_i2d_ECDSA_SIG; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(i2d_ECDSA_SIG_allownil)} + if FuncLoadError then + AFailed.Add('i2d_ECDSA_SIG'); + {$ifend} + end; + + + d2i_ECDSA_SIG := LoadLibFunction(ADllHandle, d2i_ECDSA_SIG_procname); + FuncLoadError := not assigned(d2i_ECDSA_SIG); + if FuncLoadError then + begin + {$if not defined(d2i_ECDSA_SIG_allownil)} + d2i_ECDSA_SIG := @ERR_d2i_ECDSA_SIG; + {$ifend} + {$if declared(d2i_ECDSA_SIG_introduced)} + if LibVersion < d2i_ECDSA_SIG_introduced then + begin + {$if declared(FC_d2i_ECDSA_SIG)} + d2i_ECDSA_SIG := @FC_d2i_ECDSA_SIG; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(d2i_ECDSA_SIG_removed)} + if d2i_ECDSA_SIG_removed <= LibVersion then + begin + {$if declared(_d2i_ECDSA_SIG)} + d2i_ECDSA_SIG := @_d2i_ECDSA_SIG; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(d2i_ECDSA_SIG_allownil)} + if FuncLoadError then + AFailed.Add('d2i_ECDSA_SIG'); + {$ifend} + end; + + + ECDSA_SIG_get0 := LoadLibFunction(ADllHandle, ECDSA_SIG_get0_procname); + FuncLoadError := not assigned(ECDSA_SIG_get0); + if FuncLoadError then + begin + {$if not defined(ECDSA_SIG_get0_allownil)} + ECDSA_SIG_get0 := @ERR_ECDSA_SIG_get0; + {$ifend} + {$if declared(ECDSA_SIG_get0_introduced)} + if LibVersion < ECDSA_SIG_get0_introduced then + begin + {$if declared(FC_ECDSA_SIG_get0)} + ECDSA_SIG_get0 := @FC_ECDSA_SIG_get0; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ECDSA_SIG_get0_removed)} + if ECDSA_SIG_get0_removed <= LibVersion then + begin + {$if declared(_ECDSA_SIG_get0)} + ECDSA_SIG_get0 := @_ECDSA_SIG_get0; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ECDSA_SIG_get0_allownil)} + if FuncLoadError then + AFailed.Add('ECDSA_SIG_get0'); + {$ifend} + end; + + {introduced 1.1.0} + ECDSA_SIG_get0_r := LoadLibFunction(ADllHandle, ECDSA_SIG_get0_r_procname); + FuncLoadError := not assigned(ECDSA_SIG_get0_r); + if FuncLoadError then + begin + {$if not defined(ECDSA_SIG_get0_r_allownil)} + ECDSA_SIG_get0_r := @ERR_ECDSA_SIG_get0_r; + {$ifend} + {$if declared(ECDSA_SIG_get0_r_introduced)} + if LibVersion < ECDSA_SIG_get0_r_introduced then + begin + {$if declared(FC_ECDSA_SIG_get0_r)} + ECDSA_SIG_get0_r := @FC_ECDSA_SIG_get0_r; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ECDSA_SIG_get0_r_removed)} + if ECDSA_SIG_get0_r_removed <= LibVersion then + begin + {$if declared(_ECDSA_SIG_get0_r)} + ECDSA_SIG_get0_r := @_ECDSA_SIG_get0_r; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ECDSA_SIG_get0_r_allownil)} + if FuncLoadError then + AFailed.Add('ECDSA_SIG_get0_r'); + {$ifend} + end; + + {introduced 1.1.0} + ECDSA_SIG_get0_s := LoadLibFunction(ADllHandle, ECDSA_SIG_get0_s_procname); + FuncLoadError := not assigned(ECDSA_SIG_get0_s); + if FuncLoadError then + begin + {$if not defined(ECDSA_SIG_get0_s_allownil)} + ECDSA_SIG_get0_s := @ERR_ECDSA_SIG_get0_s; + {$ifend} + {$if declared(ECDSA_SIG_get0_s_introduced)} + if LibVersion < ECDSA_SIG_get0_s_introduced then + begin + {$if declared(FC_ECDSA_SIG_get0_s)} + ECDSA_SIG_get0_s := @FC_ECDSA_SIG_get0_s; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ECDSA_SIG_get0_s_removed)} + if ECDSA_SIG_get0_s_removed <= LibVersion then + begin + {$if declared(_ECDSA_SIG_get0_s)} + ECDSA_SIG_get0_s := @_ECDSA_SIG_get0_s; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ECDSA_SIG_get0_s_allownil)} + if FuncLoadError then + AFailed.Add('ECDSA_SIG_get0_s'); + {$ifend} + end; + + {introduced 1.1.0} + ECDSA_SIG_set0 := LoadLibFunction(ADllHandle, ECDSA_SIG_set0_procname); + FuncLoadError := not assigned(ECDSA_SIG_set0); + if FuncLoadError then + begin + {$if not defined(ECDSA_SIG_set0_allownil)} + ECDSA_SIG_set0 := @ERR_ECDSA_SIG_set0; + {$ifend} + {$if declared(ECDSA_SIG_set0_introduced)} + if LibVersion < ECDSA_SIG_set0_introduced then + begin + {$if declared(FC_ECDSA_SIG_set0)} + ECDSA_SIG_set0 := @FC_ECDSA_SIG_set0; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ECDSA_SIG_set0_removed)} + if ECDSA_SIG_set0_removed <= LibVersion then + begin + {$if declared(_ECDSA_SIG_set0)} + ECDSA_SIG_set0 := @_ECDSA_SIG_set0; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ECDSA_SIG_set0_allownil)} + if FuncLoadError then + AFailed.Add('ECDSA_SIG_set0'); + {$ifend} + end; + + {introduced 1.1.0} + ECDSA_do_sign := LoadLibFunction(ADllHandle, ECDSA_do_sign_procname); + FuncLoadError := not assigned(ECDSA_do_sign); + if FuncLoadError then + begin + {$if not defined(ECDSA_do_sign_allownil)} + ECDSA_do_sign := @ERR_ECDSA_do_sign; + {$ifend} + {$if declared(ECDSA_do_sign_introduced)} + if LibVersion < ECDSA_do_sign_introduced then + begin + {$if declared(FC_ECDSA_do_sign)} + ECDSA_do_sign := @FC_ECDSA_do_sign; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ECDSA_do_sign_removed)} + if ECDSA_do_sign_removed <= LibVersion then + begin + {$if declared(_ECDSA_do_sign)} + ECDSA_do_sign := @_ECDSA_do_sign; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ECDSA_do_sign_allownil)} + if FuncLoadError then + AFailed.Add('ECDSA_do_sign'); + {$ifend} + end; + + + ECDSA_do_sign_ex := LoadLibFunction(ADllHandle, ECDSA_do_sign_ex_procname); + FuncLoadError := not assigned(ECDSA_do_sign_ex); + if FuncLoadError then + begin + {$if not defined(ECDSA_do_sign_ex_allownil)} + ECDSA_do_sign_ex := @ERR_ECDSA_do_sign_ex; + {$ifend} + {$if declared(ECDSA_do_sign_ex_introduced)} + if LibVersion < ECDSA_do_sign_ex_introduced then + begin + {$if declared(FC_ECDSA_do_sign_ex)} + ECDSA_do_sign_ex := @FC_ECDSA_do_sign_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ECDSA_do_sign_ex_removed)} + if ECDSA_do_sign_ex_removed <= LibVersion then + begin + {$if declared(_ECDSA_do_sign_ex)} + ECDSA_do_sign_ex := @_ECDSA_do_sign_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ECDSA_do_sign_ex_allownil)} + if FuncLoadError then + AFailed.Add('ECDSA_do_sign_ex'); + {$ifend} + end; + + + ECDSA_do_verify := LoadLibFunction(ADllHandle, ECDSA_do_verify_procname); + FuncLoadError := not assigned(ECDSA_do_verify); + if FuncLoadError then + begin + {$if not defined(ECDSA_do_verify_allownil)} + ECDSA_do_verify := @ERR_ECDSA_do_verify; + {$ifend} + {$if declared(ECDSA_do_verify_introduced)} + if LibVersion < ECDSA_do_verify_introduced then + begin + {$if declared(FC_ECDSA_do_verify)} + ECDSA_do_verify := @FC_ECDSA_do_verify; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ECDSA_do_verify_removed)} + if ECDSA_do_verify_removed <= LibVersion then + begin + {$if declared(_ECDSA_do_verify)} + ECDSA_do_verify := @_ECDSA_do_verify; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ECDSA_do_verify_allownil)} + if FuncLoadError then + AFailed.Add('ECDSA_do_verify'); + {$ifend} + end; + + + ECDSA_sign_setup := LoadLibFunction(ADllHandle, ECDSA_sign_setup_procname); + FuncLoadError := not assigned(ECDSA_sign_setup); + if FuncLoadError then + begin + {$if not defined(ECDSA_sign_setup_allownil)} + ECDSA_sign_setup := @ERR_ECDSA_sign_setup; + {$ifend} + {$if declared(ECDSA_sign_setup_introduced)} + if LibVersion < ECDSA_sign_setup_introduced then + begin + {$if declared(FC_ECDSA_sign_setup)} + ECDSA_sign_setup := @FC_ECDSA_sign_setup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ECDSA_sign_setup_removed)} + if ECDSA_sign_setup_removed <= LibVersion then + begin + {$if declared(_ECDSA_sign_setup)} + ECDSA_sign_setup := @_ECDSA_sign_setup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ECDSA_sign_setup_allownil)} + if FuncLoadError then + AFailed.Add('ECDSA_sign_setup'); + {$ifend} + end; + + + ECDSA_sign := LoadLibFunction(ADllHandle, ECDSA_sign_procname); + FuncLoadError := not assigned(ECDSA_sign); + if FuncLoadError then + begin + {$if not defined(ECDSA_sign_allownil)} + ECDSA_sign := @ERR_ECDSA_sign; + {$ifend} + {$if declared(ECDSA_sign_introduced)} + if LibVersion < ECDSA_sign_introduced then + begin + {$if declared(FC_ECDSA_sign)} + ECDSA_sign := @FC_ECDSA_sign; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ECDSA_sign_removed)} + if ECDSA_sign_removed <= LibVersion then + begin + {$if declared(_ECDSA_sign)} + ECDSA_sign := @_ECDSA_sign; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ECDSA_sign_allownil)} + if FuncLoadError then + AFailed.Add('ECDSA_sign'); + {$ifend} + end; + + + ECDSA_sign_ex := LoadLibFunction(ADllHandle, ECDSA_sign_ex_procname); + FuncLoadError := not assigned(ECDSA_sign_ex); + if FuncLoadError then + begin + {$if not defined(ECDSA_sign_ex_allownil)} + ECDSA_sign_ex := @ERR_ECDSA_sign_ex; + {$ifend} + {$if declared(ECDSA_sign_ex_introduced)} + if LibVersion < ECDSA_sign_ex_introduced then + begin + {$if declared(FC_ECDSA_sign_ex)} + ECDSA_sign_ex := @FC_ECDSA_sign_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ECDSA_sign_ex_removed)} + if ECDSA_sign_ex_removed <= LibVersion then + begin + {$if declared(_ECDSA_sign_ex)} + ECDSA_sign_ex := @_ECDSA_sign_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ECDSA_sign_ex_allownil)} + if FuncLoadError then + AFailed.Add('ECDSA_sign_ex'); + {$ifend} + end; + + + ECDSA_verify := LoadLibFunction(ADllHandle, ECDSA_verify_procname); + FuncLoadError := not assigned(ECDSA_verify); + if FuncLoadError then + begin + {$if not defined(ECDSA_verify_allownil)} + ECDSA_verify := @ERR_ECDSA_verify; + {$ifend} + {$if declared(ECDSA_verify_introduced)} + if LibVersion < ECDSA_verify_introduced then + begin + {$if declared(FC_ECDSA_verify)} + ECDSA_verify := @FC_ECDSA_verify; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ECDSA_verify_removed)} + if ECDSA_verify_removed <= LibVersion then + begin + {$if declared(_ECDSA_verify)} + ECDSA_verify := @_ECDSA_verify; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ECDSA_verify_allownil)} + if FuncLoadError then + AFailed.Add('ECDSA_verify'); + {$ifend} + end; + + + ECDSA_size := LoadLibFunction(ADllHandle, ECDSA_size_procname); + FuncLoadError := not assigned(ECDSA_size); + if FuncLoadError then + begin + {$if not defined(ECDSA_size_allownil)} + ECDSA_size := @ERR_ECDSA_size; + {$ifend} + {$if declared(ECDSA_size_introduced)} + if LibVersion < ECDSA_size_introduced then + begin + {$if declared(FC_ECDSA_size)} + ECDSA_size := @FC_ECDSA_size; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ECDSA_size_removed)} + if ECDSA_size_removed <= LibVersion then + begin + {$if declared(_ECDSA_size)} + ECDSA_size := @_ECDSA_size; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ECDSA_size_allownil)} + if FuncLoadError then + AFailed.Add('ECDSA_size'); + {$ifend} + end; + + + EC_KEY_METHOD_new := LoadLibFunction(ADllHandle, EC_KEY_METHOD_new_procname); + FuncLoadError := not assigned(EC_KEY_METHOD_new); + if FuncLoadError then + begin + {$if not defined(EC_KEY_METHOD_new_allownil)} + EC_KEY_METHOD_new := @ERR_EC_KEY_METHOD_new; + {$ifend} + {$if declared(EC_KEY_METHOD_new_introduced)} + if LibVersion < EC_KEY_METHOD_new_introduced then + begin + {$if declared(FC_EC_KEY_METHOD_new)} + EC_KEY_METHOD_new := @FC_EC_KEY_METHOD_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_KEY_METHOD_new_removed)} + if EC_KEY_METHOD_new_removed <= LibVersion then + begin + {$if declared(_EC_KEY_METHOD_new)} + EC_KEY_METHOD_new := @_EC_KEY_METHOD_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_KEY_METHOD_new_allownil)} + if FuncLoadError then + AFailed.Add('EC_KEY_METHOD_new'); + {$ifend} + end; + + {introduced 1.1.0} + EC_KEY_METHOD_free := LoadLibFunction(ADllHandle, EC_KEY_METHOD_free_procname); + FuncLoadError := not assigned(EC_KEY_METHOD_free); + if FuncLoadError then + begin + {$if not defined(EC_KEY_METHOD_free_allownil)} + EC_KEY_METHOD_free := @ERR_EC_KEY_METHOD_free; + {$ifend} + {$if declared(EC_KEY_METHOD_free_introduced)} + if LibVersion < EC_KEY_METHOD_free_introduced then + begin + {$if declared(FC_EC_KEY_METHOD_free)} + EC_KEY_METHOD_free := @FC_EC_KEY_METHOD_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_KEY_METHOD_free_removed)} + if EC_KEY_METHOD_free_removed <= LibVersion then + begin + {$if declared(_EC_KEY_METHOD_free)} + EC_KEY_METHOD_free := @_EC_KEY_METHOD_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_KEY_METHOD_free_allownil)} + if FuncLoadError then + AFailed.Add('EC_KEY_METHOD_free'); + {$ifend} + end; + + {introduced 1.1.0} + EC_KEY_METHOD_set_init := LoadLibFunction(ADllHandle, EC_KEY_METHOD_set_init_procname); + FuncLoadError := not assigned(EC_KEY_METHOD_set_init); + if FuncLoadError then + begin + {$if not defined(EC_KEY_METHOD_set_init_allownil)} + EC_KEY_METHOD_set_init := @ERR_EC_KEY_METHOD_set_init; + {$ifend} + {$if declared(EC_KEY_METHOD_set_init_introduced)} + if LibVersion < EC_KEY_METHOD_set_init_introduced then + begin + {$if declared(FC_EC_KEY_METHOD_set_init)} + EC_KEY_METHOD_set_init := @FC_EC_KEY_METHOD_set_init; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_KEY_METHOD_set_init_removed)} + if EC_KEY_METHOD_set_init_removed <= LibVersion then + begin + {$if declared(_EC_KEY_METHOD_set_init)} + EC_KEY_METHOD_set_init := @_EC_KEY_METHOD_set_init; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_KEY_METHOD_set_init_allownil)} + if FuncLoadError then + AFailed.Add('EC_KEY_METHOD_set_init'); + {$ifend} + end; + + {introduced 1.1.0} + EC_KEY_METHOD_set_keygen := LoadLibFunction(ADllHandle, EC_KEY_METHOD_set_keygen_procname); + FuncLoadError := not assigned(EC_KEY_METHOD_set_keygen); + if FuncLoadError then + begin + {$if not defined(EC_KEY_METHOD_set_keygen_allownil)} + EC_KEY_METHOD_set_keygen := @ERR_EC_KEY_METHOD_set_keygen; + {$ifend} + {$if declared(EC_KEY_METHOD_set_keygen_introduced)} + if LibVersion < EC_KEY_METHOD_set_keygen_introduced then + begin + {$if declared(FC_EC_KEY_METHOD_set_keygen)} + EC_KEY_METHOD_set_keygen := @FC_EC_KEY_METHOD_set_keygen; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_KEY_METHOD_set_keygen_removed)} + if EC_KEY_METHOD_set_keygen_removed <= LibVersion then + begin + {$if declared(_EC_KEY_METHOD_set_keygen)} + EC_KEY_METHOD_set_keygen := @_EC_KEY_METHOD_set_keygen; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_KEY_METHOD_set_keygen_allownil)} + if FuncLoadError then + AFailed.Add('EC_KEY_METHOD_set_keygen'); + {$ifend} + end; + + {introduced 1.1.0} + EC_KEY_METHOD_set_compute_key := LoadLibFunction(ADllHandle, EC_KEY_METHOD_set_compute_key_procname); + FuncLoadError := not assigned(EC_KEY_METHOD_set_compute_key); + if FuncLoadError then + begin + {$if not defined(EC_KEY_METHOD_set_compute_key_allownil)} + EC_KEY_METHOD_set_compute_key := @ERR_EC_KEY_METHOD_set_compute_key; + {$ifend} + {$if declared(EC_KEY_METHOD_set_compute_key_introduced)} + if LibVersion < EC_KEY_METHOD_set_compute_key_introduced then + begin + {$if declared(FC_EC_KEY_METHOD_set_compute_key)} + EC_KEY_METHOD_set_compute_key := @FC_EC_KEY_METHOD_set_compute_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_KEY_METHOD_set_compute_key_removed)} + if EC_KEY_METHOD_set_compute_key_removed <= LibVersion then + begin + {$if declared(_EC_KEY_METHOD_set_compute_key)} + EC_KEY_METHOD_set_compute_key := @_EC_KEY_METHOD_set_compute_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_KEY_METHOD_set_compute_key_allownil)} + if FuncLoadError then + AFailed.Add('EC_KEY_METHOD_set_compute_key'); + {$ifend} + end; + + {introduced 1.1.0} + EC_KEY_METHOD_set_sign := LoadLibFunction(ADllHandle, EC_KEY_METHOD_set_sign_procname); + FuncLoadError := not assigned(EC_KEY_METHOD_set_sign); + if FuncLoadError then + begin + {$if not defined(EC_KEY_METHOD_set_sign_allownil)} + EC_KEY_METHOD_set_sign := @ERR_EC_KEY_METHOD_set_sign; + {$ifend} + {$if declared(EC_KEY_METHOD_set_sign_introduced)} + if LibVersion < EC_KEY_METHOD_set_sign_introduced then + begin + {$if declared(FC_EC_KEY_METHOD_set_sign)} + EC_KEY_METHOD_set_sign := @FC_EC_KEY_METHOD_set_sign; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_KEY_METHOD_set_sign_removed)} + if EC_KEY_METHOD_set_sign_removed <= LibVersion then + begin + {$if declared(_EC_KEY_METHOD_set_sign)} + EC_KEY_METHOD_set_sign := @_EC_KEY_METHOD_set_sign; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_KEY_METHOD_set_sign_allownil)} + if FuncLoadError then + AFailed.Add('EC_KEY_METHOD_set_sign'); + {$ifend} + end; + + {introduced 1.1.0} + EC_KEY_METHOD_set_verify := LoadLibFunction(ADllHandle, EC_KEY_METHOD_set_verify_procname); + FuncLoadError := not assigned(EC_KEY_METHOD_set_verify); + if FuncLoadError then + begin + {$if not defined(EC_KEY_METHOD_set_verify_allownil)} + EC_KEY_METHOD_set_verify := @ERR_EC_KEY_METHOD_set_verify; + {$ifend} + {$if declared(EC_KEY_METHOD_set_verify_introduced)} + if LibVersion < EC_KEY_METHOD_set_verify_introduced then + begin + {$if declared(FC_EC_KEY_METHOD_set_verify)} + EC_KEY_METHOD_set_verify := @FC_EC_KEY_METHOD_set_verify; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_KEY_METHOD_set_verify_removed)} + if EC_KEY_METHOD_set_verify_removed <= LibVersion then + begin + {$if declared(_EC_KEY_METHOD_set_verify)} + EC_KEY_METHOD_set_verify := @_EC_KEY_METHOD_set_verify; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_KEY_METHOD_set_verify_allownil)} + if FuncLoadError then + AFailed.Add('EC_KEY_METHOD_set_verify'); + {$ifend} + end; + + {introduced 1.1.0} + EC_KEY_METHOD_get_init := LoadLibFunction(ADllHandle, EC_KEY_METHOD_get_init_procname); + FuncLoadError := not assigned(EC_KEY_METHOD_get_init); + if FuncLoadError then + begin + {$if not defined(EC_KEY_METHOD_get_init_allownil)} + EC_KEY_METHOD_get_init := @ERR_EC_KEY_METHOD_get_init; + {$ifend} + {$if declared(EC_KEY_METHOD_get_init_introduced)} + if LibVersion < EC_KEY_METHOD_get_init_introduced then + begin + {$if declared(FC_EC_KEY_METHOD_get_init)} + EC_KEY_METHOD_get_init := @FC_EC_KEY_METHOD_get_init; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_KEY_METHOD_get_init_removed)} + if EC_KEY_METHOD_get_init_removed <= LibVersion then + begin + {$if declared(_EC_KEY_METHOD_get_init)} + EC_KEY_METHOD_get_init := @_EC_KEY_METHOD_get_init; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_KEY_METHOD_get_init_allownil)} + if FuncLoadError then + AFailed.Add('EC_KEY_METHOD_get_init'); + {$ifend} + end; + + {introduced 1.1.0} + EC_KEY_METHOD_get_keygen := LoadLibFunction(ADllHandle, EC_KEY_METHOD_get_keygen_procname); + FuncLoadError := not assigned(EC_KEY_METHOD_get_keygen); + if FuncLoadError then + begin + {$if not defined(EC_KEY_METHOD_get_keygen_allownil)} + EC_KEY_METHOD_get_keygen := @ERR_EC_KEY_METHOD_get_keygen; + {$ifend} + {$if declared(EC_KEY_METHOD_get_keygen_introduced)} + if LibVersion < EC_KEY_METHOD_get_keygen_introduced then + begin + {$if declared(FC_EC_KEY_METHOD_get_keygen)} + EC_KEY_METHOD_get_keygen := @FC_EC_KEY_METHOD_get_keygen; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_KEY_METHOD_get_keygen_removed)} + if EC_KEY_METHOD_get_keygen_removed <= LibVersion then + begin + {$if declared(_EC_KEY_METHOD_get_keygen)} + EC_KEY_METHOD_get_keygen := @_EC_KEY_METHOD_get_keygen; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_KEY_METHOD_get_keygen_allownil)} + if FuncLoadError then + AFailed.Add('EC_KEY_METHOD_get_keygen'); + {$ifend} + end; + + {introduced 1.1.0} + EC_KEY_METHOD_get_compute_key := LoadLibFunction(ADllHandle, EC_KEY_METHOD_get_compute_key_procname); + FuncLoadError := not assigned(EC_KEY_METHOD_get_compute_key); + if FuncLoadError then + begin + {$if not defined(EC_KEY_METHOD_get_compute_key_allownil)} + EC_KEY_METHOD_get_compute_key := @ERR_EC_KEY_METHOD_get_compute_key; + {$ifend} + {$if declared(EC_KEY_METHOD_get_compute_key_introduced)} + if LibVersion < EC_KEY_METHOD_get_compute_key_introduced then + begin + {$if declared(FC_EC_KEY_METHOD_get_compute_key)} + EC_KEY_METHOD_get_compute_key := @FC_EC_KEY_METHOD_get_compute_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_KEY_METHOD_get_compute_key_removed)} + if EC_KEY_METHOD_get_compute_key_removed <= LibVersion then + begin + {$if declared(_EC_KEY_METHOD_get_compute_key)} + EC_KEY_METHOD_get_compute_key := @_EC_KEY_METHOD_get_compute_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_KEY_METHOD_get_compute_key_allownil)} + if FuncLoadError then + AFailed.Add('EC_KEY_METHOD_get_compute_key'); + {$ifend} + end; + + {introduced 1.1.0} + EC_KEY_METHOD_get_sign := LoadLibFunction(ADllHandle, EC_KEY_METHOD_get_sign_procname); + FuncLoadError := not assigned(EC_KEY_METHOD_get_sign); + if FuncLoadError then + begin + {$if not defined(EC_KEY_METHOD_get_sign_allownil)} + EC_KEY_METHOD_get_sign := @ERR_EC_KEY_METHOD_get_sign; + {$ifend} + {$if declared(EC_KEY_METHOD_get_sign_introduced)} + if LibVersion < EC_KEY_METHOD_get_sign_introduced then + begin + {$if declared(FC_EC_KEY_METHOD_get_sign)} + EC_KEY_METHOD_get_sign := @FC_EC_KEY_METHOD_get_sign; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_KEY_METHOD_get_sign_removed)} + if EC_KEY_METHOD_get_sign_removed <= LibVersion then + begin + {$if declared(_EC_KEY_METHOD_get_sign)} + EC_KEY_METHOD_get_sign := @_EC_KEY_METHOD_get_sign; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_KEY_METHOD_get_sign_allownil)} + if FuncLoadError then + AFailed.Add('EC_KEY_METHOD_get_sign'); + {$ifend} + end; + + {introduced 1.1.0} + EC_KEY_METHOD_get_verify := LoadLibFunction(ADllHandle, EC_KEY_METHOD_get_verify_procname); + FuncLoadError := not assigned(EC_KEY_METHOD_get_verify); + if FuncLoadError then + begin + {$if not defined(EC_KEY_METHOD_get_verify_allownil)} + EC_KEY_METHOD_get_verify := @ERR_EC_KEY_METHOD_get_verify; + {$ifend} + {$if declared(EC_KEY_METHOD_get_verify_introduced)} + if LibVersion < EC_KEY_METHOD_get_verify_introduced then + begin + {$if declared(FC_EC_KEY_METHOD_get_verify)} + EC_KEY_METHOD_get_verify := @FC_EC_KEY_METHOD_get_verify; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EC_KEY_METHOD_get_verify_removed)} + if EC_KEY_METHOD_get_verify_removed <= LibVersion then + begin + {$if declared(_EC_KEY_METHOD_get_verify)} + EC_KEY_METHOD_get_verify := @_EC_KEY_METHOD_get_verify; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EC_KEY_METHOD_get_verify_allownil)} + if FuncLoadError then + AFailed.Add('EC_KEY_METHOD_get_verify'); + {$ifend} + end; + + {introduced 1.1.0} +end; + +procedure Unload; +begin + EC_GFp_simple_method := nil; + EC_GFp_mont_method := nil; + EC_GFp_nist_method := nil; + EC_GFp_nistp224_method := nil; {introduced 1.1.0 removed 3.0.0} + EC_GFp_nistp256_method := nil; {introduced 1.1.0 removed 3.0.0} + EC_GFp_nistp521_method := nil; {introduced 1.1.0 removed 3.0.0} + EC_GF2m_simple_method := nil; + EC_GROUP_new := nil; + EC_GROUP_free := nil; + EC_GROUP_clear_free := nil; + EC_GROUP_copy := nil; + EC_GROUP_dup := nil; + EC_GROUP_method_of := nil; + EC_METHOD_get_field_type := nil; + EC_GROUP_set_generator := nil; + EC_GROUP_get0_generator := nil; + EC_GROUP_get_mont_data := nil; + EC_GROUP_get_order := nil; + EC_GROUP_get0_order := nil; {introduced 1.1.0} + EC_GROUP_order_bits := nil; {introduced 1.1.0} + EC_GROUP_get_cofactor := nil; + EC_GROUP_get0_cofactor := nil; {introduced 1.1.0} + EC_GROUP_set_curve_name := nil; + EC_GROUP_get_curve_name := nil; + EC_GROUP_set_asn1_flag := nil; + EC_GROUP_get_asn1_flag := nil; + EC_GROUP_set_point_conversion_form := nil; + EC_GROUP_get_point_conversion_form := nil; + EC_GROUP_get0_seed := nil; + EC_GROUP_get_seed_len := nil; + EC_GROUP_set_seed := nil; + EC_GROUP_set_curve := nil; {introduced 1.1.0} + EC_GROUP_get_curve := nil; {introduced 1.1.0} + EC_GROUP_set_curve_GFp := nil; + EC_GROUP_get_curve_GFp := nil; + EC_GROUP_set_curve_GF2m := nil; + EC_GROUP_get_curve_GF2m := nil; + EC_GROUP_get_degree := nil; + EC_GROUP_check := nil; + EC_GROUP_check_discriminant := nil; + EC_GROUP_cmp := nil; + EC_GROUP_new_curve_GFp := nil; + EC_GROUP_new_curve_GF2m := nil; + EC_GROUP_new_by_curve_name := nil; + EC_GROUP_new_from_ecparameters := nil; {introduced 1.1.0} + EC_GROUP_get_ecparameters := nil; {introduced 1.1.0} + EC_GROUP_new_from_ecpkparameters := nil; {introduced 1.1.0} + EC_GROUP_get_ecpkparameters := nil; {introduced 1.1.0} + EC_get_builtin_curves := nil; + EC_curve_nid2nist := nil; + EC_curve_nist2nid := nil; + EC_POINT_new := nil; + EC_POINT_free := nil; + EC_POINT_clear_free := nil; + EC_POINT_copy := nil; + EC_POINT_dup := nil; + EC_POINT_method_of := nil; + EC_POINT_set_to_infinity := nil; + EC_POINT_set_Jprojective_coordinates_GFp := nil; + EC_POINT_get_Jprojective_coordinates_GFp := nil; + EC_POINT_set_affine_coordinates := nil; {introduced 1.1.0} + EC_POINT_get_affine_coordinates := nil; {introduced 1.1.0} + EC_POINT_set_affine_coordinates_GFp := nil; + EC_POINT_get_affine_coordinates_GFp := nil; + EC_POINT_set_compressed_coordinates := nil; {introduced 1.1.0} + EC_POINT_set_compressed_coordinates_GFp := nil; + EC_POINT_set_affine_coordinates_GF2m := nil; + EC_POINT_get_affine_coordinates_GF2m := nil; + EC_POINT_set_compressed_coordinates_GF2m := nil; + EC_POINT_point2oct := nil; + EC_POINT_oct2point := nil; + EC_POINT_point2buf := nil; {introduced 1.1.0} + EC_POINT_point2bn := nil; + EC_POINT_bn2point := nil; + EC_POINT_point2hex := nil; + EC_POINT_hex2point := nil; + EC_POINT_add := nil; + EC_POINT_dbl := nil; + EC_POINT_invert := nil; + EC_POINT_is_at_infinity := nil; + EC_POINT_is_on_curve := nil; + EC_POINT_cmp := nil; + EC_POINT_make_affine := nil; + EC_POINTs_make_affine := nil; + EC_POINTs_mul := nil; + EC_POINT_mul := nil; + EC_GROUP_precompute_mult := nil; + EC_GROUP_have_precompute_mult := nil; + ECPKPARAMETERS_it := nil; + ECPKPARAMETERS_new := nil; + ECPKPARAMETERS_free := nil; + ECPARAMETERS_it := nil; + ECPARAMETERS_new := nil; + ECPARAMETERS_free := nil; + EC_GROUP_get_basis_type := nil; + EC_GROUP_get_trinomial_basis := nil; + EC_GROUP_get_pentanomial_basis := nil; + d2i_ECPKParameters := nil; + i2d_ECPKParameters := nil; + ECPKParameters_print := nil; + EC_KEY_new := nil; + EC_KEY_get_flags := nil; + EC_KEY_set_flags := nil; + EC_KEY_clear_flags := nil; + EC_KEY_new_by_curve_name := nil; + EC_KEY_free := nil; + EC_KEY_copy := nil; + EC_KEY_dup := nil; + EC_KEY_up_ref := nil; + EC_KEY_get0_engine := nil; {introduced 1.1.0} + EC_KEY_get0_group := nil; + EC_KEY_set_group := nil; + EC_KEY_get0_private_key := nil; + EC_KEY_set_private_key := nil; + EC_KEY_get0_public_key := nil; + EC_KEY_set_public_key := nil; + EC_KEY_get_enc_flags := nil; + EC_KEY_set_enc_flags := nil; + EC_KEY_get_conv_form := nil; + EC_KEY_set_conv_form := nil; + EC_KEY_set_ex_data := nil; {introduced 1.1.0} + EC_KEY_get_ex_data := nil; {introduced 1.1.0} + EC_KEY_set_asn1_flag := nil; + EC_KEY_precompute_mult := nil; + EC_KEY_generate_key := nil; + EC_KEY_check_key := nil; + EC_KEY_can_sign := nil; {introduced 1.1.0} + EC_KEY_set_public_key_affine_coordinates := nil; + EC_KEY_key2buf := nil; {introduced 1.1.0} + EC_KEY_oct2key := nil; {introduced 1.1.0} + EC_KEY_oct2priv := nil; {introduced 1.1.0} + EC_KEY_priv2oct := nil; {introduced 1.1.0} + EC_KEY_priv2buf := nil; {introduced 1.1.0} + d2i_ECPrivateKey := nil; + i2d_ECPrivateKey := nil; + o2i_ECPublicKey := nil; + i2o_ECPublicKey := nil; + ECParameters_print := nil; + EC_KEY_print := nil; + EC_KEY_OpenSSL := nil; {introduced 1.1.0} + EC_KEY_get_default_method := nil; {introduced 1.1.0} + EC_KEY_set_default_method := nil; {introduced 1.1.0} + EC_KEY_get_method := nil; {introduced 1.1.0} + EC_KEY_set_method := nil; {introduced 1.1.0} + EC_KEY_new_method := nil; {introduced 1.1.0} + ECDH_KDF_X9_62 := nil; + ECDH_compute_key := nil; + ECDSA_SIG_new := nil; + ECDSA_SIG_free := nil; + i2d_ECDSA_SIG := nil; + d2i_ECDSA_SIG := nil; + ECDSA_SIG_get0 := nil; {introduced 1.1.0} + ECDSA_SIG_get0_r := nil; {introduced 1.1.0} + ECDSA_SIG_get0_s := nil; {introduced 1.1.0} + ECDSA_SIG_set0 := nil; {introduced 1.1.0} + ECDSA_do_sign := nil; + ECDSA_do_sign_ex := nil; + ECDSA_do_verify := nil; + ECDSA_sign_setup := nil; + ECDSA_sign := nil; + ECDSA_sign_ex := nil; + ECDSA_verify := nil; + ECDSA_size := nil; + EC_KEY_METHOD_new := nil; {introduced 1.1.0} + EC_KEY_METHOD_free := nil; {introduced 1.1.0} + EC_KEY_METHOD_set_init := nil; {introduced 1.1.0} + EC_KEY_METHOD_set_keygen := nil; {introduced 1.1.0} + EC_KEY_METHOD_set_compute_key := nil; {introduced 1.1.0} + EC_KEY_METHOD_set_sign := nil; {introduced 1.1.0} + EC_KEY_METHOD_set_verify := nil; {introduced 1.1.0} + EC_KEY_METHOD_get_init := nil; {introduced 1.1.0} + EC_KEY_METHOD_get_keygen := nil; {introduced 1.1.0} + EC_KEY_METHOD_get_compute_key := nil; {introduced 1.1.0} + EC_KEY_METHOD_get_sign := nil; {introduced 1.1.0} + EC_KEY_METHOD_get_verify := nil; {introduced 1.1.0} +end; +{$ELSE} +{$ENDIF} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +initialization + Register_SSLLoader(@Load,'LibCrypto'); + Register_SSLUnloader(@Unload); +{$ENDIF} +end. diff --git a/IdOpenSSLHeaders_ecerr.pas b/IdOpenSSLHeaders_ecerr.pas new file mode 100644 index 0000000..66f4bf8 --- /dev/null +++ b/IdOpenSSLHeaders_ecerr.pas @@ -0,0 +1,387 @@ + (* This unit was generated using the script genOpenSSLHdrs.sh from the source file IdOpenSSLHeaders_ecerr.h2pas + It should not be modified directly. All changes should be made to IdOpenSSLHeaders_ecerr.h2pas + and this file regenerated. IdOpenSSLHeaders_ecerr.h2pas is distributed with the full Indy + Distribution. + *) + +{$i IdCompilerDefines.inc} +{$i IdSSLOpenSSLDefines.inc} +{$IFNDEF USE_OPENSSL} + { error Should not compile if USE_OPENSSL is not defined!!!} +{$ENDIF} +{******************************************************************************} +{ } +{ Indy (Internet Direct) - Internet Protocols Simplified } +{ } +{ https://www.indyproject.org/ } +{ https://gitter.im/IndySockets/Indy } +{ } +{******************************************************************************} +{ } +{ This file is part of the Indy (Internet Direct) project, and is offered } +{ under the dual-licensing agreement described on the Indy website. } +{ (https://www.indyproject.org/license/) } +{ } +{ Copyright: } +{ (c) 1993-2020, Chad Z. Hower and the Indy Pit Crew. All rights reserved. } +{ } +{******************************************************************************} +{ } +{ } +{******************************************************************************} + +unit IdOpenSSLHeaders_ecerr; + +interface + +// Headers for OpenSSL 1.1.1 +// ecerr.h + + +uses + IdCTypes, + IdGlobal, + IdSSLOpenSSLConsts; + +const + (* + * EC function codes. + *) + EC_F_BN_TO_FELEM = 224; + EC_F_D2I_ECPARAMETERS = 144; + EC_F_D2I_ECPKPARAMETERS = 145; + EC_F_D2I_ECPRIVATEKEY = 146; + EC_F_DO_EC_KEY_PRINT = 221; + EC_F_ECDH_CMS_DECRYPT = 238; + EC_F_ECDH_CMS_SET_SHARED_INFO = 239; + EC_F_ECDH_COMPUTE_KEY = 246; + EC_F_ECDH_SIMPLE_COMPUTE_KEY = 257; + EC_F_ECDSA_DO_SIGN_EX = 251; + EC_F_ECDSA_DO_VERIFY = 252; + EC_F_ECDSA_SIGN_EX = 254; + EC_F_ECDSA_SIGN_SETUP = 248; + EC_F_ECDSA_SIG_NEW = 265; + EC_F_ECDSA_VERIFY = 253; + EC_F_ECD_ITEM_VERIFY = 270; + EC_F_ECKEY_PARAM2TYPE = 223; + EC_F_ECKEY_PARAM_DECODE = 212; + EC_F_ECKEY_PRIV_DECODE = 213; + EC_F_ECKEY_PRIV_ENCODE = 214; + EC_F_ECKEY_PUB_DECODE = 215; + EC_F_ECKEY_PUB_ENCODE = 216; + EC_F_ECKEY_TYPE2PARAM = 220; + EC_F_ECPARAMETERS_PRINT = 147; + EC_F_ECPARAMETERS_PRINT_FP = 148; + EC_F_ECPKPARAMETERS_PRINT = 149; + EC_F_ECPKPARAMETERS_PRINT_FP = 150; + EC_F_ECP_NISTZ256_GET_AFFINE = 240; + EC_F_ECP_NISTZ256_INV_MOD_ORD = 275; + EC_F_ECP_NISTZ256_MULT_PRECOMPUTE = 243; + EC_F_ECP_NISTZ256_POINTS_MUL = 241; + EC_F_ECP_NISTZ256_PRE_COMP_NEW = 244; + EC_F_ECP_NISTZ256_WINDOWED_MUL = 242; + EC_F_ECX_KEY_OP = 266; + EC_F_ECX_PRIV_ENCODE = 267; + EC_F_ECX_PUB_ENCODE = 268; + EC_F_EC_ASN1_GROUP2CURVE = 153; + EC_F_EC_ASN1_GROUP2FIELDID = 154; + EC_F_EC_GF2M_MONTGOMERY_POINT_MULTIPLY = 208; + EC_F_EC_GF2M_SIMPLE_FIELD_INV = 296; + EC_F_EC_GF2M_SIMPLE_GROUP_CHECK_DISCRIMINANT = 159; + EC_F_EC_GF2M_SIMPLE_GROUP_SET_CURVE = 195; + EC_F_EC_GF2M_SIMPLE_LADDER_POST = 285; + EC_F_EC_GF2M_SIMPLE_LADDER_PRE = 288; + EC_F_EC_GF2M_SIMPLE_OCT2POINT = 160; + EC_F_EC_GF2M_SIMPLE_POINT2OCT = 161; + EC_F_EC_GF2M_SIMPLE_POINTS_MUL = 289; + EC_F_EC_GF2M_SIMPLE_POINT_GET_AFFINE_COORDINATES = 162; + EC_F_EC_GF2M_SIMPLE_POINT_SET_AFFINE_COORDINATES = 163; + EC_F_EC_GF2M_SIMPLE_SET_COMPRESSED_COORDINATES = 164; + EC_F_EC_GFP_MONT_FIELD_DECODE = 133; + EC_F_EC_GFP_MONT_FIELD_ENCODE = 134; + EC_F_EC_GFP_MONT_FIELD_INV = 297; + EC_F_EC_GFP_MONT_FIELD_MUL = 131; + EC_F_EC_GFP_MONT_FIELD_SET_TO_ONE = 209; + EC_F_EC_GFP_MONT_FIELD_SQR = 132; + EC_F_EC_GFP_MONT_GROUP_SET_CURVE = 189; + EC_F_EC_GFP_NISTP224_GROUP_SET_CURVE = 225; + EC_F_EC_GFP_NISTP224_POINTS_MUL = 228; + EC_F_EC_GFP_NISTP224_POINT_GET_AFFINE_COORDINATES = 226; + EC_F_EC_GFP_NISTP256_GROUP_SET_CURVE = 230; + EC_F_EC_GFP_NISTP256_POINTS_MUL = 231; + EC_F_EC_GFP_NISTP256_POINT_GET_AFFINE_COORDINATES = 232; + EC_F_EC_GFP_NISTP521_GROUP_SET_CURVE = 233; + EC_F_EC_GFP_NISTP521_POINTS_MUL = 234; + EC_F_EC_GFP_NISTP521_POINT_GET_AFFINE_COORDINATES = 235; + EC_F_EC_GFP_NIST_FIELD_MUL = 200; + EC_F_EC_GFP_NIST_FIELD_SQR = 201; + EC_F_EC_GFP_NIST_GROUP_SET_CURVE = 202; + EC_F_EC_GFP_SIMPLE_BLIND_COORDINATES = 287; + EC_F_EC_GFP_SIMPLE_FIELD_INV = 298; + EC_F_EC_GFP_SIMPLE_GROUP_CHECK_DISCRIMINANT = 165; + EC_F_EC_GFP_SIMPLE_GROUP_SET_CURVE = 166; + EC_F_EC_GFP_SIMPLE_MAKE_AFFINE = 102; + EC_F_EC_GFP_SIMPLE_OCT2POINT = 103; + EC_F_EC_GFP_SIMPLE_POINT2OCT = 104; + EC_F_EC_GFP_SIMPLE_POINTS_MAKE_AFFINE = 137; + EC_F_EC_GFP_SIMPLE_POINT_GET_AFFINE_COORDINATES = 167; + EC_F_EC_GFP_SIMPLE_POINT_SET_AFFINE_COORDINATES = 168; + EC_F_EC_GFP_SIMPLE_SET_COMPRESSED_COORDINATES = 169; + EC_F_EC_GROUP_CHECK = 170; + EC_F_EC_GROUP_CHECK_DISCRIMINANT = 171; + EC_F_EC_GROUP_COPY = 106; + EC_F_EC_GROUP_GET_CURVE = 291; + EC_F_EC_GROUP_GET_CURVE_GF2M = 172; + EC_F_EC_GROUP_GET_CURVE_GFP = 130; + EC_F_EC_GROUP_GET_DEGREE = 173; + EC_F_EC_GROUP_GET_ECPARAMETERS = 261; + EC_F_EC_GROUP_GET_ECPKPARAMETERS = 262; + EC_F_EC_GROUP_GET_PENTANOMIAL_BASIS = 193; + EC_F_EC_GROUP_GET_TRINOMIAL_BASIS = 194; + EC_F_EC_GROUP_NEW = 108; + EC_F_EC_GROUP_NEW_BY_CURVE_NAME = 174; + EC_F_EC_GROUP_NEW_FROM_DATA = 175; + EC_F_EC_GROUP_NEW_FROM_ECPARAMETERS = 263; + EC_F_EC_GROUP_NEW_FROM_ECPKPARAMETERS = 264; + EC_F_EC_GROUP_SET_CURVE = 292; + EC_F_EC_GROUP_SET_CURVE_GF2M = 176; + EC_F_EC_GROUP_SET_CURVE_GFP = 109; + EC_F_EC_GROUP_SET_GENERATOR = 111; + EC_F_EC_GROUP_SET_SEED = 286; + EC_F_EC_KEY_CHECK_KEY = 177; + EC_F_EC_KEY_COPY = 178; + EC_F_EC_KEY_GENERATE_KEY = 179; + EC_F_EC_KEY_NEW = 182; + EC_F_EC_KEY_NEW_METHOD = 245; + EC_F_EC_KEY_OCT2PRIV = 255; + EC_F_EC_KEY_PRINT = 180; + EC_F_EC_KEY_PRINT_FP = 181; + EC_F_EC_KEY_PRIV2BUF = 279; + EC_F_EC_KEY_PRIV2OCT = 256; + EC_F_EC_KEY_SET_PUBLIC_KEY_AFFINE_COORDINATES = 229; + EC_F_EC_KEY_SIMPLE_CHECK_KEY = 258; + EC_F_EC_KEY_SIMPLE_OCT2PRIV = 259; + EC_F_EC_KEY_SIMPLE_PRIV2OCT = 260; + EC_F_EC_PKEY_CHECK = 273; + EC_F_EC_PKEY_PARAM_CHECK = 274; + EC_F_EC_POINTS_MAKE_AFFINE = 136; + EC_F_EC_POINTS_MUL = 290; + EC_F_EC_POINT_ADD = 112; + EC_F_EC_POINT_BN2POINT = 280; + EC_F_EC_POINT_CMP = 113; + EC_F_EC_POINT_COPY = 114; + EC_F_EC_POINT_DBL = 115; + EC_F_EC_POINT_GET_AFFINE_COORDINATES = 293; + EC_F_EC_POINT_GET_AFFINE_COORDINATES_GF2M = 183; + EC_F_EC_POINT_GET_AFFINE_COORDINATES_GFP = 116; + EC_F_EC_POINT_GET_JPROJECTIVE_COORDINATES_GFP = 117; + EC_F_EC_POINT_INVERT = 210; + EC_F_EC_POINT_IS_AT_INFINITY = 118; + EC_F_EC_POINT_IS_ON_CURVE = 119; + EC_F_EC_POINT_MAKE_AFFINE = 120; + EC_F_EC_POINT_NEW = 121; + EC_F_EC_POINT_OCT2POINT = 122; + EC_F_EC_POINT_POINT2BUF = 281; + EC_F_EC_POINT_POINT2OCT = 123; + EC_F_EC_POINT_SET_AFFINE_COORDINATES = 294; + EC_F_EC_POINT_SET_AFFINE_COORDINATES_GF2M = 185; + EC_F_EC_POINT_SET_AFFINE_COORDINATES_GFP = 124; + EC_F_EC_POINT_SET_COMPRESSED_COORDINATES = 295; + EC_F_EC_POINT_SET_COMPRESSED_COORDINATES_GF2M = 186; + EC_F_EC_POINT_SET_COMPRESSED_COORDINATES_GFP = 125; + EC_F_EC_POINT_SET_JPROJECTIVE_COORDINATES_GFP = 126; + EC_F_EC_POINT_SET_TO_INFINITY = 127; + EC_F_EC_PRE_COMP_NEW = 196; + EC_F_EC_SCALAR_MUL_LADDER = 284; + EC_F_EC_WNAF_MUL = 187; + EC_F_EC_WNAF_PRECOMPUTE_MULT = 188; + EC_F_I2D_ECPARAMETERS = 190; + EC_F_I2D_ECPKPARAMETERS = 191; + EC_F_I2D_ECPRIVATEKEY = 192; + EC_F_I2O_ECPUBLICKEY = 151; + EC_F_NISTP224_PRE_COMP_NEW = 227; + EC_F_NISTP256_PRE_COMP_NEW = 236; + EC_F_NISTP521_PRE_COMP_NEW = 237; + EC_F_O2I_ECPUBLICKEY = 152; + EC_F_OLD_EC_PRIV_DECODE = 222; + EC_F_OSSL_ECDH_COMPUTE_KEY = 247; + EC_F_OSSL_ECDSA_SIGN_SIG = 249; + EC_F_OSSL_ECDSA_VERIFY_SIG = 250; + EC_F_PKEY_ECD_CTRL = 271; + EC_F_PKEY_ECD_DIGESTSIGN = 272; + EC_F_PKEY_ECD_DIGESTSIGN25519 = 276; + EC_F_PKEY_ECD_DIGESTSIGN448 = 277; + EC_F_PKEY_ECX_DERIVE = 269; + EC_F_PKEY_EC_CTRL = 197; + EC_F_PKEY_EC_CTRL_STR = 198; + EC_F_PKEY_EC_DERIVE = 217; + EC_F_PKEY_EC_INIT = 282; + EC_F_PKEY_EC_KDF_DERIVE = 283; + EC_F_PKEY_EC_KEYGEN = 199; + EC_F_PKEY_EC_PARAMGEN = 219; + EC_F_PKEY_EC_SIGN = 218; + EC_F_VALIDATE_ECX_DERIVE = 278; + + (* + * EC reason codes. + *) + EC_R_ASN1_ERROR = 115; + EC_R_BAD_SIGNATURE = 156; + EC_R_BIGNUM_OUT_OF_RANGE = 144; + EC_R_BUFFER_TOO_SMALL = 100; + EC_R_CANNOT_INVERT = 165; + EC_R_COORDINATES_OUT_OF_RANGE = 146; + EC_R_CURVE_DOES_NOT_SUPPORT_ECDH = 160; + EC_R_CURVE_DOES_NOT_SUPPORT_SIGNING = 159; + EC_R_D2I_ECPKPARAMETERS_FAILURE = 117; + EC_R_DECODE_ERROR = 142; + EC_R_DISCRIMINANT_IS_ZERO = 118; + EC_R_EC_GROUP_NEW_BY_NAME_FAILURE = 119; + EC_R_FIELD_TOO_LARGE = 143; + EC_R_GF2M_NOT_SUPPORTED = 147; + EC_R_GROUP2PKPARAMETERS_FAILURE = 120; + EC_R_I2D_ECPKPARAMETERS_FAILURE = 121; + EC_R_INCOMPATIBLE_OBJECTS = 101; + EC_R_INVALID_ARGUMENT = 112; + EC_R_INVALID_COMPRESSED_POINT = 110; + EC_R_INVALID_COMPRESSION_BIT = 109; + EC_R_INVALID_CURVE = 141; + EC_R_INVALID_DIGEST = 151; + EC_R_INVALID_DIGEST_TYPE = 138; + EC_R_INVALID_ENCODING = 102; + EC_R_INVALID_FIELD = 103; + EC_R_INVALID_FORM = 104; + EC_R_INVALID_GROUP_ORDER = 122; + EC_R_INVALID_KEY = 116; + EC_R_INVALID_OUTPUT_LENGTH = 161; + EC_R_INVALID_PEER_KEY = 133; + EC_R_INVALID_PENTANOMIAL_BASIS = 132; + EC_R_INVALID_PRIVATE_KEY = 123; + EC_R_INVALID_TRINOMIAL_BASIS = 137; + EC_R_KDF_PARAMETER_ERROR = 148; + EC_R_KEYS_NOT_SET = 140; + EC_R_LADDER_POST_FAILURE = 136; + EC_R_LADDER_PRE_FAILURE = 153; + EC_R_LADDER_STEP_FAILURE = 162; + EC_R_MISSING_PARAMETERS = 124; + EC_R_MISSING_PRIVATE_KEY = 125; + EC_R_NEED_NEW_SETUP_VALUES = 157; + EC_R_NOT_A_NIST_PRIME = 135; + EC_R_NOT_IMPLEMENTED = 126; + EC_R_NOT_INITIALIZED = 111; + EC_R_NO_PARAMETERS_SET = 139; + EC_R_NO_PRIVATE_VALUE = 154; + EC_R_OPERATION_NOT_SUPPORTED = 152; + EC_R_PASSED_NULL_PARAMETER = 134; + EC_R_PEER_KEY_ERROR = 149; + EC_R_PKPARAMETERS2GROUP_FAILURE = 127; + EC_R_POINT_ARITHMETIC_FAILURE = 155; + EC_R_POINT_AT_INFINITY = 106; + EC_R_POINT_COORDINATES_BLIND_FAILURE = 163; + EC_R_POINT_IS_NOT_ON_CURVE = 107; + EC_R_RANDOM_NUMBER_GENERATION_FAILED = 158; + EC_R_SHARED_INFO_ERROR = 150; + EC_R_SLOT_FULL = 108; + EC_R_UNDEFINED_GENERATOR = 113; + EC_R_UNDEFINED_ORDER = 128; + EC_R_UNKNOWN_COFACTOR = 164; + EC_R_UNKNOWN_GROUP = 129; + EC_R_UNKNOWN_ORDER = 114; + EC_R_UNSUPPORTED_FIELD = 131; + EC_R_WRONG_CURVE_PARAMETERS = 145; + EC_R_WRONG_ORDER = 130; + + { The EXTERNALSYM directive is ignored by FPC, however, it is used by Delphi as follows: + + The EXTERNALSYM directive prevents the specified Delphi symbol from appearing in header + files generated for C++. } + + {$EXTERNALSYM ERR_load_EC_strings} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +var + ERR_load_EC_strings: function : TIdC_INT; cdecl = nil; + +{$ELSE} + function ERR_load_EC_strings: TIdC_INT cdecl; external CLibCrypto; + +{$ENDIF} + +implementation + + uses + classes, + IdSSLOpenSSLExceptionHandlers, + IdResourceStringsOpenSSL + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + ,IdSSLOpenSSLLoader + {$ENDIF}; + + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +const + ERR_load_EC_strings_procname = 'ERR_load_EC_strings'; + + +{$WARN NO_RETVAL OFF} +function ERR_ERR_load_EC_strings: TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ERR_load_EC_strings_procname); +end; + + + +{$WARN NO_RETVAL ON} + +procedure Load(const ADllHandle: TIdLibHandle; LibVersion: TIdC_UINT; const AFailed: TStringList); + +var FuncLoadError: boolean; + +begin + ERR_load_EC_strings := LoadLibFunction(ADllHandle, ERR_load_EC_strings_procname); + FuncLoadError := not assigned(ERR_load_EC_strings); + if FuncLoadError then + begin + {$if not defined(ERR_load_EC_strings_allownil)} + ERR_load_EC_strings := @ERR_ERR_load_EC_strings; + {$ifend} + {$if declared(ERR_load_EC_strings_introduced)} + if LibVersion < ERR_load_EC_strings_introduced then + begin + {$if declared(FC_ERR_load_EC_strings)} + ERR_load_EC_strings := @FC_ERR_load_EC_strings; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ERR_load_EC_strings_removed)} + if ERR_load_EC_strings_removed <= LibVersion then + begin + {$if declared(_ERR_load_EC_strings)} + ERR_load_EC_strings := @_ERR_load_EC_strings; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ERR_load_EC_strings_allownil)} + if FuncLoadError then + AFailed.Add('ERR_load_EC_strings'); + {$ifend} + end; + + +end; + +procedure Unload; +begin + ERR_load_EC_strings := nil; +end; +{$ELSE} +{$ENDIF} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +initialization + Register_SSLLoader(@Load,'LibCrypto'); + Register_SSLUnloader(@Unload); +{$ENDIF} +end. diff --git a/IdOpenSSLHeaders_engine.pas b/IdOpenSSLHeaders_engine.pas new file mode 100644 index 0000000..c0d6d19 --- /dev/null +++ b/IdOpenSSLHeaders_engine.pas @@ -0,0 +1,6359 @@ + (* This unit was generated using the script genOpenSSLHdrs.sh from the source file IdOpenSSLHeaders_engine.h2pas + It should not be modified directly. All changes should be made to IdOpenSSLHeaders_engine.h2pas + and this file regenerated. IdOpenSSLHeaders_engine.h2pas is distributed with the full Indy + Distribution. + *) + +{$i IdCompilerDefines.inc} +{$i IdSSLOpenSSLDefines.inc} +{$IFNDEF USE_OPENSSL} + { error Should not compile if USE_OPENSSL is not defined!!!} +{$ENDIF} +{******************************************************************************} +{ } +{ Indy (Internet Direct) - Internet Protocols Simplified } +{ } +{ https://www.indyproject.org/ } +{ https://gitter.im/IndySockets/Indy } +{ } +{******************************************************************************} +{ } +{ This file is part of the Indy (Internet Direct) project, and is offered } +{ under the dual-licensing agreement described on the Indy website. } +{ (https://www.indyproject.org/license/) } +{ } +{ Copyright: } +{ (c) 1993-2020, Chad Z. Hower and the Indy Pit Crew. All rights reserved. } +{ } +{******************************************************************************} +{ } +{ } +{******************************************************************************} + +unit IdOpenSSLHeaders_engine; + +interface + +// Headers for OpenSSL 1.1.1 +// engine.h + + +uses + IdCTypes, + IdGlobal, + IdSSLOpenSSLConsts, + IdOpenSSLHeaders_ossl_typ, + IdOpenSSLHeaders_ec; + +const + (* + * These flags are used to control combinations of algorithm (methods) by + * bitwise "OR"ing. + *) + ENGINE_METHOD_RSA = TIdC_UINT($0001); + ENGINE_METHOD_DSA = TIdC_UINT($0002); + ENGINE_METHOD_DH = TIdC_UINT($0004); + ENGINE_METHOD_RAND = TIdC_UINT($0008); + ENGINE_METHOD_CIPHERS = TIdC_UINT($0040); + ENGINE_METHOD_DIGESTS = TIdC_UINT($0080); + ENGINE_METHOD_PKEY_METHS = TIdC_UINT($0200); + ENGINE_METHOD_PKEY_ASN1_METHS = TIdC_UINT($0400); + ENGINE_METHOD_EC = TIdC_UINT($0800); + (* Obvious all-or-nothing cases. *) + ENGINE_METHOD_ALL = TIdC_UINT($FFFF); + ENGINE_METHOD_NONE = TIdC_UINT($0000); + + // + // This(ese) flag(s) controls behaviour of the ENGINE_TABLE mechanism used + // internally to control registration of ENGINE implementations, and can be + // set by ENGINE_set_table_flags(). The "NOINIT" flag prevents attempts to + // initialise registered ENGINEs if they are not already initialised. + // + ENGINE_TABLE_FLAG_NOINIT = TIdC_UINT($0001); + + // + // This flag is for ENGINEs that wish to handle the various 'CMD'-related + // control commands on their own. Without this flag, ENGINE_ctrl() handles + // these control commands on behalf of the ENGINE using their "cmd_defns" + // data. + // + ENGINE_FLAGS_MANUAL_CMD_CTRL = TIdC_INT($0002); + + // + // This flag is for ENGINEs who return new duplicate structures when found + // via "ENGINE_by_id()". When an ENGINE must store state (eg. if + // ENGINE_ctrl() commands are called in sequence as part of some stateful + // process like key-generation setup and execution), it can set this flag - + // then each attempt to obtain the ENGINE will result in it being copied intoo + // a new structure. Normally, ENGINEs don't declare this flag so + // ENGINE_by_id() just increments the existing ENGINE's structural reference + // count. + // + ENGINE_FLAGS_BY_ID_COPY = TIdC_INT($0004); + + // + // This flag if for an ENGINE that does not want its methods registered as + // part of ENGINE_register_all_complete() for example if the methods are not + // usable as default methods. + // + + ENGINE_FLAGS_NO_REGISTER_ALL = TIdC_INT($0008); + + // + // ENGINEs can support their own command types, and these flags are used in + // ENGINE_CTRL_GET_CMD_FLAGS to indicate to the caller what kind of input + // each command expects. Currently only numeric and string input is + // supported. If a control command supports none of the _NUMERIC, _STRING, or + // _NO_INPUT options, then it is regarded as an "internal" control command - + // and not for use in config setting situations. As such, they're not + // available to the ENGINE_ctrl_cmd_string() function, only raw ENGINE_ctrl() + // access. Changes to this list of 'command types' should be reflected + // carefully in ENGINE_cmd_is_executable() and ENGINE_ctrl_cmd_string(). + // + + // accepts a 'long' input value (3rd parameter to ENGINE_ctrl) */ + ENGINE_CMD_FLAG_NUMERIC = TIdC_UINT($0001); + // + // accepts string input (cast from 'void*' to 'const char *', 4th parameter + // to ENGINE_ctrl) + // + ENGINE_CMD_FLAG_STRING = TIdC_UINT($0002); + // + // Indicates that the control command takes *no* input. Ie. the control + // command is unparameterised. + // + ENGINE_CMD_FLAG_NO_INPUT = TIdC_UINT($0004); + // + // Indicates that the control command is internal. This control command won't + // be shown in any output, and is only usable through the ENGINE_ctrl_cmd() + // function. + // + ENGINE_CMD_FLAG_INTERNAL = TIdC_UINT($0008); + + // + // NB: These 3 control commands are deprecated and should not be used. + // ENGINEs relying on these commands should compile conditional support for + // compatibility (eg. if these symbols are defined) but should also migrate + // the same functionality to their own ENGINE-specific control functions that + // can be "discovered" by calling applications. The fact these control + // commands wouldn't be "executable" (ie. usable by text-based config) + // doesn't change the fact that application code can find and use them + // without requiring per-ENGINE hacking. + // + + // + // These flags are used to tell the ctrl function what should be done. All + // command numbers are shared between all engines, even if some don't make + // sense to some engines. In such a case, they do nothing but return the + // error ENGINE_R_CTRL_COMMAND_NOT_IMPLEMENTED. + // + ENGINE_CTRL_SET_LOGSTREAM = 1; + ENGINE_CTRL_SET_PASSWORD_CALLBACK = 2; + ENGINE_CTRL_HUP = 3;// Close and reinitialise + // any handles/connections + // etc. + ENGINE_CTRL_SET_USER_INTERFACE = 4;// Alternative to callback + ENGINE_CTRL_SET_CALLBACK_DATA = 5;// User-specific data, used + // when calling the password + // callback and the user + // interface + ENGINE_CTRL_LOAD_CONFIGURATION = 6;// Load a configuration, + // given a string that + // represents a file name + // or so + ENGINE_CTRL_LOAD_SECTION = 7;// Load data from a given + // section in the already + // loaded configuration + + // + // These control commands allow an application to deal with an arbitrary + // engine in a dynamic way. Warn: Negative return values indicate errors FOR + // THESE COMMANDS because zero is used to indicate 'end-of-list'. Other + // commands, including ENGINE-specific command types, return zero for an + // error. An ENGINE can choose to implement these ctrl functions, and can + // internally manage things however it chooses - it does so by setting the + // ENGINE_FLAGS_MANUAL_CMD_CTRL flag (using ENGINE_set_flags()). Otherwise + // the ENGINE_ctrl() code handles this on the ENGINE's behalf using the + // cmd_defns data (set using ENGINE_set_cmd_defns()). This means an ENGINE's + // ctrl() handler need only implement its own commands - the above "meta" + // commands will be taken care of. + // + + // + // Returns non-zero if the supplied ENGINE has a ctrl() handler. If "not", + // then all the remaining control commands will return failure, so it is + // worth checking this first if the caller is trying to "discover" the + // engine's capabilities and doesn't want errors generated unnecessarily. + // + ENGINE_CTRL_HAS_CTRL_FUNCTION = 10; + // + // Returns a positive command number for the first command supported by the + // engine. Returns zero if no ctrl commands are supported. + // + ENGINE_CTRL_GET_FIRST_CMD_TYPE = 11; + // + // The 'long' argument specifies a command implemented by the engine, and the + // return value is the next command supported, or zero if there are no more. + // + ENGINE_CTRL_GET_NEXT_CMD_TYPE = 12; + // + // The 'void*' argument is a command name (cast from 'const char *'), and the + // return value is the command that corresponds to it. + // + ENGINE_CTRL_GET_CMD_FROM_NAME = 13; + // + // The next two allow a command to be converted into its corresponding string + // form. In each case, the 'long' argument supplies the command. In the + // NAME_LEN case, the return value is the length of the command name (not + // counting a trailing EOL). In the NAME case, the 'void*' argument must be a + // string buffer large enough, and it will be populated with the name of the + // command (WITH a trailing EOL). + // + ENGINE_CTRL_GET_NAME_LEN_FROM_CMD = 14; + ENGINE_CTRL_GET_NAME_FROM_CMD = 15; + // The next two are similar but give a "short description" of a command. */ + ENGINE_CTRL_GET_DESC_LEN_FROM_CMD = 16; + ENGINE_CTRL_GET_DESC_FROM_CMD = 17; + // + // With this command, the return value is the OR'd combination of + // ENGINE_CMD_FLAG_*** values that indicate what kind of input a given + // engine-specific ctrl command expects. + // + ENGINE_CTRL_GET_CMD_FLAGS = 18; + + // + // ENGINE implementations should start the numbering of their own control + // commands from this value. (ie. ENGINE_CMD_BASE, ENGINE_CMD_BASE += 1, etc). + // + ENGINE_CMD_BASE = 200; + + // + // NB: These 2 nCipher "chil" control commands are deprecated, and their + // functionality is now available through ENGINE-specific control commands + // (exposed through the above-mentioned 'CMD'-handling). Code using these 2 + // commands should be migrated to the more general command handling before + // these are removed. + // + + // Flags specific to the nCipher "chil" engine */ + ENGINE_CTRL_CHIL_SET_FORKCHECK = 100; + // + // Depending on the value of the (long)i argument, this sets or + // unsets the SimpleForkCheck flag in the CHIL API to enable or + // disable checking and workarounds for applications that fork(). + // + ENGINE_CTRL_CHIL_NO_LOCKING = 101; + // + // This prevents the initialisation function from providing mutex + // callbacks to the nCipher library. + // + +type + // + // If an ENGINE supports its own specific control commands and wishes the + // framework to handle the above 'ENGINE_CMD_***'-manipulation commands on + // its behalf, it should supply a null-terminated array of ENGINE_CMD_DEFN + // entries to ENGINE_set_cmd_defns(). It should also implement a ctrl() + // handler that supports the stated commands (ie. the "cmd_num" entries as + // described by the array). NB: The array must be ordered in increasing order + // of cmd_num. "null-terminated" means that the last ENGINE_CMD_DEFN element + // has cmd_num set to zero and/or cmd_name set to NULL. + // + ENGINE_CMD_DEFN_st = record + cmd_num: TIdC_UINT; + cmd_name: PIdAnsiChar; + cmd_desc: PIdAnsiChar; + cmd_flags: TIdC_UINT; + end; + ENGINE_CMD_DEFN = ENGINE_CMD_DEFN_st; + PENGINE_CMD_DEFN = ^ENGINE_CMD_DEFN; + + // Generic function pointer */ + ENGINE_GEN_FUNC_PTR = function: TIdC_INT; cdecl; + // Generic function pointer taking no arguments */ + ENGINE_GEN_INT_FUNC_PTR = function(v1: PENGINE): TIdC_INT; cdecl; + // Specific control function pointer */ + f = procedure; cdecl; + ENGINE_CTRL_FUNC_PTR = function(v1: PENGINE; v2: TIdC_INT; v3: TIdC_LONG; v4: Pointer; v5: f): TIdC_INT; cdecl; + // Generic load_key function pointer */ + ENGINE_LOAD_KEY_PTR = function(v1: PENGINE; const v2: PIdAnsiChar; + ui_method: PUI_METHOD; callback_data: Pointer): PEVP_PKEY; cdecl; + //ENGINE_SSL_CLIENT_CERT_PTR = function(v1: PENGINE; ssl: PSSL; + // {STACK_OF(X509_NAME) *ca_dn;} pcert: PPX509; pkey: PPEVP_PKEY; + // {STACK_OF(X509) **pother;} ui_method: PUI_METHOD; callback_data: Pointer): TIdC_INT; cdecl; + + // + // These callback types are for an ENGINE's handler for cipher and digest logic. + // These handlers have these prototypes; + // int foo(ENGINE *e, const EVP_CIPHER **cipher, const int **nids, int nid); + // int foo(ENGINE *e, const EVP_MD **digest, const int **nids, int nid); + // Looking at how to implement these handlers in the case of cipher support, if + // the framework wants the EVP_CIPHER for 'nid', it will call; + // foo(e, &p_evp_cipher, NULL, nid); (return zero for failure) + // If the framework wants a list of supported 'nid's, it will call; + // foo(e, NULL, &p_nids, 0); (returns number of 'nids' or -1 for error) + // + // + // Returns to a pointer to the array of supported cipher 'nid's. If the + // second parameter is non-NULL it is set to the size of the returned array. + // + ENGINE_CIPHERS_PTR = function(v1: PENGINE; const v2: PPEVP_CIPHER; + const v3: PPIdC_INT; v4: TIdC_INT): TIdC_INT; cdecl; + ENGINE_DIGESTS_PTR = function(v1: PENGINE; const v2: PPEVP_MD; + const v3: PPIdC_INT; v4: TIdC_INT): TIdC_INT; cdecl; + ENGINE_PKEY_METHS_PTR = function(v1: PENGINE; v2: PPEVP_PKEY_METHOD; + const v3: PPIdC_INT; v4: TIdC_INT): TIdC_INT; cdecl; + ENGINE_PKEY_ASN1_METHS_PTR = function(v1: PENGINE; v2: PPEVP_PKEY_ASN1_METHOD; + const v3: PPIdC_INT; v4: TIdC_INT): TIdC_INT; cdecl; + + dyn_MEM_malloc_fn = function(v1: TIdC_SIZET; const v2: PIdAnsiChar; v3: TIdC_INT): Pointer; cdecl; + dyn_MEM_realloc_fn = function(v1: Pointer; v2: TIdC_SIZET; const v3: PIdAnsiChar; v4: TIdC_INT): Pointer; cdecl; + dyn_MEM_free_fn = procedure(v1: Pointer; const v2: PIdAnsiChar; v3: TIdC_INT); cdecl; + + st_dynamic_MEM_fns = record + malloc_fn: dyn_MEM_malloc_fn; + realloc_fn: dyn_MEM_realloc_fn; + free_fn: dyn_MEM_free_fn; + end; + dynamic_MEM_fns = st_dynamic_MEM_fns; + + //* + // * FIXME: Perhaps the memory and locking code (crypto.h) should declare and + // * use these types so we (and any other dependent code) can simplify a bit?? + // */ + //* The top-level structure */ + st_dynamic_fns = record + static_state: Pointer; + mem_fns: dynamic_MEM_fns; + end; + dynamic_fns = st_dynamic_fns; + + //* + // * The version checking function should be of this prototype. NB: The + // * ossl_version value passed in is the OSSL_DYNAMIC_VERSION of the loading + // * code. If this function returns zero, it indicates a (potential) version + // * incompatibility and the loaded library doesn't believe it can proceed. + // * Otherwise, the returned value is the (latest) version supported by the + // * loading library. The loader may still decide that the loaded code's + // * version is unsatisfactory and could veto the load. The function is + // * expected to be implemented with the symbol name "v_check", and a default + // * implementation can be fully instantiated with + // * IMPLEMENT_DYNAMIC_CHECK_FN(). + // */ + dynamic_v_check_fn = function(ossl_version: TIdC_ULONG): TIdC_ULONG; cdecl; + //# define IMPLEMENT_DYNAMIC_CHECK_FN() \ + // OPENSSL_EXPORT unsigned long v_check(unsigned long v); \ + // OPENSSL_EXPORT unsigned long v_check(unsigned long v) { \ + // if (v >= OSSL_DYNAMIC_OLDEST) return OSSL_DYNAMIC_VERSION; \ + // return 0; } + + //* + // * This function is passed the ENGINE structure to initialise with its own + // * function and command settings. It should not adjust the structural or + // * functional reference counts. If this function returns zero, (a) the load + // * will be aborted, (b) the previous ENGINE state will be memcpy'd back onto + // * the structure, and (c) the shared library will be unloaded. So + // * implementations should do their own internal cleanup in failure + // * circumstances otherwise they could leak. The 'id' parameter, if non-NULL, + // * represents the ENGINE id that the loader is looking for. If this is NULL, + // * the shared library can choose to return failure or to initialise a + // * 'default' ENGINE. If non-NULL, the shared library must initialise only an + // * ENGINE matching the passed 'id'. The function is expected to be + // * implemented with the symbol name "bind_engine". A standard implementation + // * can be instantiated with IMPLEMENT_DYNAMIC_BIND_FN(fn) where the parameter + // * 'fn' is a callback function that populates the ENGINE structure and + // * returns an int value (zero for failure). 'fn' should have prototype; + // * [static] int fn(ENGINE *e, const char *id); + // */ + dynamic_bind_engine = function(e: PENGINE; const id: PIdAnsiChar; + const fns: dynamic_fns): TIdC_INT; cdecl; + + // + // STRUCTURE functions ... all of these functions deal with pointers to + // ENGINE structures where the pointers have a "structural reference". This + // means that their reference is to allowed access to the structure but it + // does not imply that the structure is functional. To simply increment or + // decrement the structural reference count, use ENGINE_by_id and + // ENGINE_free. NB: This is not required when iterating using ENGINE_get_next + // as it will automatically decrement the structural reference count of the + // "current" ENGINE and increment the structural reference count of the + // ENGINE it returns (unless it is NULL). + // + // Get the first/last "ENGINE" type available. */ + { The EXTERNALSYM directive is ignored by FPC, however, it is used by Delphi as follows: + + The EXTERNALSYM directive prevents the specified Delphi symbol from appearing in header + files generated for C++. } + + {$EXTERNALSYM ENGINE_get_first} + {$EXTERNALSYM ENGINE_get_last} + {$EXTERNALSYM ENGINE_get_next} + {$EXTERNALSYM ENGINE_get_prev} + {$EXTERNALSYM ENGINE_add} + {$EXTERNALSYM ENGINE_remove} + {$EXTERNALSYM ENGINE_by_id} + {$EXTERNALSYM ENGINE_load_builtin_engines} + {$EXTERNALSYM ENGINE_get_table_flags} + {$EXTERNALSYM ENGINE_set_table_flags} + {$EXTERNALSYM ENGINE_register_RSA} + {$EXTERNALSYM ENGINE_unregister_RSA} + {$EXTERNALSYM ENGINE_register_all_RSA} + {$EXTERNALSYM ENGINE_register_DSA} + {$EXTERNALSYM ENGINE_unregister_DSA} + {$EXTERNALSYM ENGINE_register_all_DSA} + {$EXTERNALSYM ENGINE_register_EC} + {$EXTERNALSYM ENGINE_unregister_EC} + {$EXTERNALSYM ENGINE_register_all_EC} + {$EXTERNALSYM ENGINE_register_DH} + {$EXTERNALSYM ENGINE_unregister_DH} + {$EXTERNALSYM ENGINE_register_all_DH} + {$EXTERNALSYM ENGINE_register_RAND} + {$EXTERNALSYM ENGINE_unregister_RAND} + {$EXTERNALSYM ENGINE_register_all_RAND} + {$EXTERNALSYM ENGINE_register_ciphers} + {$EXTERNALSYM ENGINE_unregister_ciphers} + {$EXTERNALSYM ENGINE_register_all_ciphers} + {$EXTERNALSYM ENGINE_register_digests} + {$EXTERNALSYM ENGINE_unregister_digests} + {$EXTERNALSYM ENGINE_register_all_digests} + {$EXTERNALSYM ENGINE_register_pkey_meths} + {$EXTERNALSYM ENGINE_unregister_pkey_meths} + {$EXTERNALSYM ENGINE_register_all_pkey_meths} + {$EXTERNALSYM ENGINE_register_pkey_asn1_meths} + {$EXTERNALSYM ENGINE_unregister_pkey_asn1_meths} + {$EXTERNALSYM ENGINE_register_all_pkey_asn1_meths} + {$EXTERNALSYM ENGINE_register_complete} + {$EXTERNALSYM ENGINE_register_all_complete} + {$EXTERNALSYM ENGINE_ctrl} + {$EXTERNALSYM ENGINE_cmd_is_executable} + {$EXTERNALSYM ENGINE_ctrl_cmd} + {$EXTERNALSYM ENGINE_ctrl_cmd_string} + {$EXTERNALSYM ENGINE_new} + {$EXTERNALSYM ENGINE_free} + {$EXTERNALSYM ENGINE_up_ref} + {$EXTERNALSYM ENGINE_set_id} + {$EXTERNALSYM ENGINE_set_name} + {$EXTERNALSYM ENGINE_set_RSA} + {$EXTERNALSYM ENGINE_set_DSA} + {$EXTERNALSYM ENGINE_set_EC} + {$EXTERNALSYM ENGINE_set_DH} + {$EXTERNALSYM ENGINE_set_RAND} + {$EXTERNALSYM ENGINE_set_destroy_function} + {$EXTERNALSYM ENGINE_set_init_function} + {$EXTERNALSYM ENGINE_set_finish_function} + {$EXTERNALSYM ENGINE_set_ctrl_function} + {$EXTERNALSYM ENGINE_set_load_privkey_function} + {$EXTERNALSYM ENGINE_set_load_pubkey_function} + {$EXTERNALSYM ENGINE_set_ciphers} + {$EXTERNALSYM ENGINE_set_digests} + {$EXTERNALSYM ENGINE_set_pkey_meths} + {$EXTERNALSYM ENGINE_set_pkey_asn1_meths} + {$EXTERNALSYM ENGINE_set_flags} + {$EXTERNALSYM ENGINE_set_cmd_defns} + {$EXTERNALSYM ENGINE_set_ex_data} + {$EXTERNALSYM ENGINE_get_ex_data} + {$EXTERNALSYM ENGINE_get_id} + {$EXTERNALSYM ENGINE_get_name} + {$EXTERNALSYM ENGINE_get_RSA} + {$EXTERNALSYM ENGINE_get_DSA} + {$EXTERNALSYM ENGINE_get_EC} + {$EXTERNALSYM ENGINE_get_DH} + {$EXTERNALSYM ENGINE_get_RAND} + {$EXTERNALSYM ENGINE_get_destroy_function} + {$EXTERNALSYM ENGINE_get_init_function} + {$EXTERNALSYM ENGINE_get_finish_function} + {$EXTERNALSYM ENGINE_get_ctrl_function} + {$EXTERNALSYM ENGINE_get_load_privkey_function} + {$EXTERNALSYM ENGINE_get_load_pubkey_function} + {$EXTERNALSYM ENGINE_get_ciphers} + {$EXTERNALSYM ENGINE_get_digests} + {$EXTERNALSYM ENGINE_get_pkey_meths} + {$EXTERNALSYM ENGINE_get_pkey_asn1_meths} + {$EXTERNALSYM ENGINE_get_cipher} + {$EXTERNALSYM ENGINE_get_digest} + {$EXTERNALSYM ENGINE_get_pkey_meth} + {$EXTERNALSYM ENGINE_get_pkey_asn1_meth} + {$EXTERNALSYM ENGINE_get_pkey_asn1_meth_str} + {$EXTERNALSYM ENGINE_pkey_asn1_find_str} + {$EXTERNALSYM ENGINE_get_cmd_defns} + {$EXTERNALSYM ENGINE_get_flags} + {$EXTERNALSYM ENGINE_init} + {$EXTERNALSYM ENGINE_finish} + {$EXTERNALSYM ENGINE_load_private_key} + {$EXTERNALSYM ENGINE_load_public_key} + {$EXTERNALSYM ENGINE_get_default_RSA} + {$EXTERNALSYM ENGINE_get_default_DSA} + {$EXTERNALSYM ENGINE_get_default_EC} + {$EXTERNALSYM ENGINE_get_default_DH} + {$EXTERNALSYM ENGINE_get_default_RAND} + {$EXTERNALSYM ENGINE_get_cipher_engine} + {$EXTERNALSYM ENGINE_get_digest_engine} + {$EXTERNALSYM ENGINE_get_pkey_meth_engine} + {$EXTERNALSYM ENGINE_get_pkey_asn1_meth_engine} + {$EXTERNALSYM ENGINE_set_default_RSA} + {$EXTERNALSYM ENGINE_set_default_string} + {$EXTERNALSYM ENGINE_set_default_DSA} + {$EXTERNALSYM ENGINE_set_default_EC} + {$EXTERNALSYM ENGINE_set_default_DH} + {$EXTERNALSYM ENGINE_set_default_RAND} + {$EXTERNALSYM ENGINE_set_default_ciphers} + {$EXTERNALSYM ENGINE_set_default_digests} + {$EXTERNALSYM ENGINE_set_default_pkey_meths} + {$EXTERNALSYM ENGINE_set_default_pkey_asn1_meths} + {$EXTERNALSYM ENGINE_set_default} + {$EXTERNALSYM ENGINE_add_conf_module} + {$EXTERNALSYM ENGINE_get_static_state} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +var + ENGINE_get_first: function : PENGINE; cdecl = nil; + ENGINE_get_last: function : PENGINE; cdecl = nil; + ENGINE_get_next: function (e: PENGINE): PENGINE; cdecl = nil; + ENGINE_get_prev: function (e: PENGINE): PENGINE; cdecl = nil; + ENGINE_add: function (e: PENGINE): TIdC_INT; cdecl = nil; + ENGINE_remove: function (e: PENGINE): TIdC_INT; cdecl = nil; + ENGINE_by_id: function (const id: PIdAnsiChar): PENGINE; cdecl = nil; + + ENGINE_load_builtin_engines: procedure ; cdecl = nil; + + // + // Get and set global flags (ENGINE_TABLE_FLAG_***) for the implementation + // "registry" handling. + // + ENGINE_get_table_flags: function : TIdC_UINT; cdecl = nil; + ENGINE_set_table_flags: procedure (flags: TIdC_UINT); cdecl = nil; + + //- Manage registration of ENGINEs per "table". For each type, there are 3 + // functions; + // ENGINE_register_***(e) - registers the implementation from 'e' (if it has one) + // ENGINE_unregister_***(e) - unregister the implementation from 'e' + // ENGINE_register_all_***() - call ENGINE_register_***() for each 'e' in the list + // Cleanup is automatically registered from each table when required. + // + + ENGINE_register_RSA: function (e: PENGINE): TIdC_INT; cdecl = nil; + ENGINE_unregister_RSA: procedure (e: PENGINE); cdecl = nil; + ENGINE_register_all_RSA: procedure ; cdecl = nil; + + ENGINE_register_DSA: function (e: PENGINE): TIdC_INT; cdecl = nil; + ENGINE_unregister_DSA: procedure (e: PENGINE); cdecl = nil; + ENGINE_register_all_DSA: procedure ; cdecl = nil; + + ENGINE_register_EC: function (e: PENGINE): TIdC_INT; cdecl = nil; + ENGINE_unregister_EC: procedure (e: PENGINE); cdecl = nil; + ENGINE_register_all_EC: procedure ; cdecl = nil; + + ENGINE_register_DH: function (e: PENGINE): TIdC_INT; cdecl = nil; + ENGINE_unregister_DH: procedure (e: PENGINE); cdecl = nil; + ENGINE_register_all_DH: procedure ; cdecl = nil; + + ENGINE_register_RAND: function (e: PENGINE): TIdC_INT; cdecl = nil; + ENGINE_unregister_RAND: procedure (e: PENGINE); cdecl = nil; + ENGINE_register_all_RAND: procedure ; cdecl = nil; + + ENGINE_register_ciphers: function (e: PENGINE): TIdC_INT; cdecl = nil; + ENGINE_unregister_ciphers: procedure (e: PENGINE); cdecl = nil; + ENGINE_register_all_ciphers: procedure ; cdecl = nil; + + ENGINE_register_digests: function (e: PENGINE): TIdC_INT; cdecl = nil; + ENGINE_unregister_digests: procedure (e: PENGINE); cdecl = nil; + ENGINE_register_all_digests: procedure ; cdecl = nil; + + ENGINE_register_pkey_meths: function (e: PENGINE): TIdC_INT; cdecl = nil; + ENGINE_unregister_pkey_meths: procedure (e: PENGINE); cdecl = nil; + ENGINE_register_all_pkey_meths: procedure ; cdecl = nil; + + ENGINE_register_pkey_asn1_meths: function (e: PENGINE): TIdC_INT; cdecl = nil; + ENGINE_unregister_pkey_asn1_meths: procedure (e: PENGINE); cdecl = nil; + ENGINE_register_all_pkey_asn1_meths: procedure ; cdecl = nil; + + // + // These functions register all support from the above categories. Note, use + // of these functions can result in static linkage of code your application + // may not need. If you only need a subset of functionality, consider using + // more selective initialisation. + // + ENGINE_register_complete: function (e: PENGINE): TIdC_INT; cdecl = nil; + ENGINE_register_all_complete: function : TIdC_INT; cdecl = nil; + + // + // Send parameterised control commands to the engine. The possibilities to + // send down an integer, a pointer to data or a function pointer are + // provided. Any of the parameters may or may not be NULL, depending on the + // command number. In actuality, this function only requires a structural + // (rather than functional) reference to an engine, but many control commands + // may require the engine be functional. The caller should be aware of trying + // commands that require an operational ENGINE, and only use functional + // references in such situations. + // + ENGINE_ctrl: function (e: PENGINE; cmd: TIdC_INT; i: TIdC_LONG; p: Pointer; v1: f): TIdC_INT; cdecl = nil; + + // + // This function tests if an ENGINE-specific command is usable as a + // "setting". Eg. in an application's config file that gets processed through + // ENGINE_ctrl_cmd_string(). If this returns zero, it is not available to + // ENGINE_ctrl_cmd_string(), only ENGINE_ctrl(). + // + ENGINE_cmd_is_executable: function (e: PENGINE; cmd: TIdC_INT): TIdC_INT; cdecl = nil; + + // + // This function works like ENGINE_ctrl() with the exception of taking a + // command name instead of a command number, and can handle optional + // commands. See the comment on ENGINE_ctrl_cmd_string() for an explanation + // on how to use the cmd_name and cmd_optional. + // + ENGINE_ctrl_cmd: function (e: PENGINE; const cmd_name: PIdAnsiChar; i: TIdC_LONG; p: Pointer; v1: f; cmd_optional: TIdC_INT): TIdC_INT; cdecl = nil; + + // + // This function passes a command-name and argument to an ENGINE. The + // cmd_name is converted to a command number and the control command is + // called using 'arg' as an argument (unless the ENGINE doesn't support such + // a command, in which case no control command is called). The command is + // checked for input flags, and if necessary the argument will be converted + // to a numeric value. If cmd_optional is non-zero, then if the ENGINE + // doesn't support the given cmd_name the return value will be success + // anyway. This function is intended for applications to use so that users + // (or config files) can supply engine-specific config data to the ENGINE at + // run-time to control behaviour of specific engines. As such, it shouldn't + // be used for calling ENGINE_ctrl() functions that return data, deal with + // binary data, or that are otherwise supposed to be used directly through + // ENGINE_ctrl() in application code. Any "return" data from an ENGINE_ctrl() + // operation in this function will be lost - the return value is interpreted + // as failure if the return value is zero, success otherwise, and this + // function returns a boolean value as a result. In other words, vendors of + // 'ENGINE'-enabled devices should write ENGINE implementations with + // parameterisations that work in this scheme, so that compliant ENGINE-based + // applications can work consistently with the same configuration for the + // same ENGINE-enabled devices, across applications. + // + ENGINE_ctrl_cmd_string: function (e: PENGINE; const cmd_name: PIdAnsiChar; const arg: PIdAnsiChar; cmd_optional: TIdC_INT): TIdC_INT; cdecl = nil; + + // + // These functions are useful for manufacturing new ENGINE structures. They + // don't address reference counting at all - one uses them to populate an + // ENGINE structure with personalised implementations of things prior to + // using it directly or adding it to the builtin ENGINE list in OpenSSL. + // These are also here so that the ENGINE structure doesn't have to be + // exposed and break binary compatibility! + // + ENGINE_new: function : PENGINE; cdecl = nil; + ENGINE_free: function (e: PENGINE): TIdC_INT; cdecl = nil; + ENGINE_up_ref: function (e: PENGINE): TIdC_INT; cdecl = nil; + ENGINE_set_id: function (e: PENGINE; const id: PIdAnsiChar): TIdC_INT; cdecl = nil; + ENGINE_set_name: function (e: PENGINE; const name: PIdAnsiChar): TIdC_INT; cdecl = nil; + ENGINE_set_RSA: function (e: PENGINE; const rsa_meth: PRSA_METHOD): TIdC_INT; cdecl = nil; + ENGINE_set_DSA: function (e: PENGINE; const dsa_meth: PDSA_METHOD): TIdC_INT; cdecl = nil; + ENGINE_set_EC: function (e: PENGINE; const ecdsa_meth: PEC_KEY_METHOD): TIdC_INT; cdecl = nil; + ENGINE_set_DH: function (e: PENGINE; const dh_meth: PDH_METHOD): TIdC_INT; cdecl = nil; + ENGINE_set_RAND: function (e: PENGINE; const rand_meth: PRAND_METHOD): TIdC_INT; cdecl = nil; + ENGINE_set_destroy_function: function (e: PENGINE; destroy_f: ENGINE_GEN_INT_FUNC_PTR): TIdC_INT; cdecl = nil; + ENGINE_set_init_function: function (e: PENGINE; init_f: ENGINE_GEN_INT_FUNC_PTR): TIdC_INT; cdecl = nil; + ENGINE_set_finish_function: function (e: PENGINE; finish_f: ENGINE_GEN_INT_FUNC_PTR): TIdC_INT; cdecl = nil; + ENGINE_set_ctrl_function: function (e: PENGINE; ctrl_f: ENGINE_CTRL_FUNC_PTR): TIdC_INT; cdecl = nil; + ENGINE_set_load_privkey_function: function (e: PENGINE; loadpriv_f: ENGINE_LOAD_KEY_PTR): TIdC_INT; cdecl = nil; + ENGINE_set_load_pubkey_function: function (e: PENGINE; loadpub_f: ENGINE_LOAD_KEY_PTR): TIdC_INT; cdecl = nil; + //function ENGINE_set_load_ssl_client_cert_function(e: PENGINE; loadssl_f: ENGINE_SSL_CLIENT_CERT_PTR): TIdC_INT; + ENGINE_set_ciphers: function (e: PENGINE; f: ENGINE_CIPHERS_PTR): TIdC_INT; cdecl = nil; + ENGINE_set_digests: function (e: PENGINE; f: ENGINE_DIGESTS_PTR): TIdC_INT; cdecl = nil; + ENGINE_set_pkey_meths: function (e: PENGINE; f: ENGINE_PKEY_METHS_PTR): TIdC_INT; cdecl = nil; + ENGINE_set_pkey_asn1_meths: function (e: PENGINE; f: ENGINE_PKEY_ASN1_METHS_PTR): TIdC_INT; cdecl = nil; + ENGINE_set_flags: function (e: PENGINE; flags: TIdC_INT): TIdC_INT; cdecl = nil; + ENGINE_set_cmd_defns: function (e: PENGINE; const defns: PENGINE_CMD_DEFN): TIdC_INT; cdecl = nil; + // These functions allow control over any per-structure ENGINE data. */ + //#define ENGINE_get_ex_new_index(l, p, newf, dupf, freef) CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_ENGINE, l, p, newf, dupf, freef) + ENGINE_set_ex_data: function (e: PENGINE; idx: TIdC_INT; arg: Pointer): TIdC_INT; cdecl = nil; + ENGINE_get_ex_data: function (const e: PENGINE; idx: TIdC_INT): Pointer; cdecl = nil; + + // + // These return values from within the ENGINE structure. These can be useful + // with functional references as well as structural references - it depends + // which you obtained. Using the result for functional purposes if you only + // obtained a structural reference may be problematic! + // + ENGINE_get_id: function (const e: PENGINE): PIdAnsiChar; cdecl = nil; + ENGINE_get_name: function (const e: PENGINE): PIdAnsiChar; cdecl = nil; + ENGINE_get_RSA: function (const e: PENGINE): PRSA_METHOD; cdecl = nil; + ENGINE_get_DSA: function (const e: PENGINE): PDSA_METHOD; cdecl = nil; + ENGINE_get_EC: function (const e: PENGINE): PEC_METHOD; cdecl = nil; + ENGINE_get_DH: function (const e: PENGINE): PDH_METHOD; cdecl = nil; + ENGINE_get_RAND: function (const e: PENGINE): PRAND_METHOD; cdecl = nil; + ENGINE_get_destroy_function: function (const e: PENGINE): ENGINE_GEN_INT_FUNC_PTR; cdecl = nil; + ENGINE_get_init_function: function (const e: PENGINE): ENGINE_GEN_INT_FUNC_PTR; cdecl = nil; + ENGINE_get_finish_function: function (const e: PENGINE): ENGINE_GEN_INT_FUNC_PTR; cdecl = nil; + ENGINE_get_ctrl_function: function (const e: PENGINE): ENGINE_CTRL_FUNC_PTR; cdecl = nil; + ENGINE_get_load_privkey_function: function (const e: PENGINE): ENGINE_LOAD_KEY_PTR; cdecl = nil; + ENGINE_get_load_pubkey_function: function (const e: PENGINE): ENGINE_LOAD_KEY_PTR; cdecl = nil; + //function ENGINE_get_ssl_client_cert_function(const e: PENGINE): ENGINE_SSL_CLIENT_CERT_PTR; + + ENGINE_get_ciphers: function (const e: PENGINE): ENGINE_CIPHERS_PTR; cdecl = nil; + ENGINE_get_digests: function (const e: PENGINE): ENGINE_DIGESTS_PTR; cdecl = nil; + ENGINE_get_pkey_meths: function (const e: PENGINE): ENGINE_PKEY_METHS_PTR; cdecl = nil; + ENGINE_get_pkey_asn1_meths: function (const e: PENGINE): ENGINE_PKEY_ASN1_METHS_PTR; cdecl = nil; + ENGINE_get_cipher: function (e: PENGINE; nid: TIdC_INT): PEVP_CIPHER; cdecl = nil; + ENGINE_get_digest: function (e: PENGINE; nid: TIdC_INT): PEVP_MD; cdecl = nil; + ENGINE_get_pkey_meth: function (e: PENGINE; nid: TIdC_INT): PEVP_PKEY_METHOD; cdecl = nil; + ENGINE_get_pkey_asn1_meth: function (e: PENGINE; nid: TIdC_INT): PEVP_PKEY_ASN1_METHOD; cdecl = nil; + ENGINE_get_pkey_asn1_meth_str: function (e: PENGINE; const str: PIdAnsiChar; len: TIdC_INT): PEVP_PKEY_ASN1_METHOD; cdecl = nil; + ENGINE_pkey_asn1_find_str: function (pe: PPENGINE; const str: PIdAnsiChar; len: TIdC_INT): PEVP_PKEY_ASN1_METHOD; cdecl = nil; + ENGINE_get_cmd_defns: function (const e: PENGINE): PENGINE_CMD_DEFN; cdecl = nil; + ENGINE_get_flags: function (const e: PENGINE): TIdC_INT; cdecl = nil; + + ///* + // * FUNCTIONAL functions. These functions deal with ENGINE structures that + // * have (or will) be initialised for use. Broadly speaking, the structural + // * functions are useful for iterating the list of available engine types, + // * creating new engine types, and other "list" operations. These functions + // * actually deal with ENGINEs that are to be used. As such these functions + // * can fail (if applicable) when particular engines are unavailable - eg. if + // * a hardware accelerator is not attached or not functioning correctly. Each + // * ENGINE has 2 reference counts; structural and functional. Every time a + // * functional reference is obtained or released, a corresponding structural + // * reference is automatically obtained or released too. + // */ + + ///* + // * Initialise a engine type for use (or up its reference count if it's + // * already in use). This will fail if the engine is not currently operational + // * and cannot initialise. + // */ + ENGINE_init: function (e: PENGINE): TIdC_INT; cdecl = nil; + ///* + // * Free a functional reference to a engine type. This does not require a + // * corresponding call to ENGINE_free as it also releases a structural + // * reference. + // */ + ENGINE_finish: function (e: PENGINE): TIdC_INT; cdecl = nil; + + ///* + // * The following functions handle keys that are stored in some secondary + // * location, handled by the engine. The storage may be on a card or + // * whatever. + // */ + ENGINE_load_private_key: function (e: PENGINE; const key_id: PIdAnsiChar; ui_method: PUI_METHOD; callback_data: Pointer): PEVP_PKEY; cdecl = nil; + ENGINE_load_public_key: function (e: PENGINE; const key_id: PIdAnsiChar; ui_method: PUI_METHOD; callback_data: Pointer): PEVP_PKEY; cdecl = nil; + //function ENGINE_load_ssl_client_cert(e: PENGINE; s: PSSL; + // {STACK_OF(X509) *ca_dn;} {STACK_OF(X509) **pother;} ui_method: PUI_METHOD; + // callback_data: Pointer): TIdC_INT; + + ///* + // * This returns a pointer for the current ENGINE structure that is (by + // * default) performing any RSA operations. The value returned is an + // * incremented reference, so it should be free'd (ENGINE_finish) before it is + // * discarded. + // */ + ENGINE_get_default_RSA: function : PENGINE; cdecl = nil; + //* Same for the other "methods" */ + ENGINE_get_default_DSA: function : PENGINE; cdecl = nil; + ENGINE_get_default_EC: function : PENGINE; cdecl = nil; + ENGINE_get_default_DH: function : PENGINE; cdecl = nil; + ENGINE_get_default_RAND: function : PENGINE; cdecl = nil; + ///* + // * These functions can be used to get a functional reference to perform + // * ciphering or digesting corresponding to "nid". + // */ + ENGINE_get_cipher_engine: function (nid: TIdC_INT): PENGINE; cdecl = nil; + ENGINE_get_digest_engine: function (nid: TIdC_INT): PENGINE; cdecl = nil; + ENGINE_get_pkey_meth_engine: function (nid: TIdC_INT): PENGINE; cdecl = nil; + ENGINE_get_pkey_asn1_meth_engine: function (nid: TIdC_INT): PENGINE; cdecl = nil; + ///* + // * This sets a new default ENGINE structure for performing RSA operations. If + // * the result is non-zero (success) then the ENGINE structure will have had + // * its reference count up'd so the caller should still free their own + // * reference 'e'. + // */ + ENGINE_set_default_RSA: function (e: PENGINE): TIdC_INT; cdecl = nil; + ENGINE_set_default_string: function (e: PENGINE; const def_list: PIdAnsiChar): TIdC_INT; cdecl = nil; + // Same for the other "methods" + ENGINE_set_default_DSA: function (e: PENGINE): TIdC_INT; cdecl = nil; + ENGINE_set_default_EC: function (e: PENGINE): TIdC_INT; cdecl = nil; + ENGINE_set_default_DH: function (e: PENGINE): TIdC_INT; cdecl = nil; + ENGINE_set_default_RAND: function (e: PENGINE): TIdC_INT; cdecl = nil; + ENGINE_set_default_ciphers: function (e: PENGINE): TIdC_INT; cdecl = nil; + ENGINE_set_default_digests: function (e: PENGINE): TIdC_INT; cdecl = nil; + ENGINE_set_default_pkey_meths: function (e: PENGINE): TIdC_INT; cdecl = nil; + ENGINE_set_default_pkey_asn1_meths: function (e: PENGINE): TIdC_INT; cdecl = nil; + + ///* + // * The combination "set" - the flags are bitwise "OR"d from the + // * ENGINE_METHOD_*** defines above. As with the "ENGINE_register_complete()" + // * function, this function can result in unnecessary static linkage. If your + // * application requires only specific functionality, consider using more + // * selective functions. + // */ + ENGINE_set_default: function (e: PENGINE; flags: TIdC_ULONG): TIdC_INT; cdecl = nil; + + ENGINE_add_conf_module: procedure ; cdecl = nil; + + ///* Deprecated functions ... */ + ///* int ENGINE_clear_defaults(void); */ + // + //**************************/ + //* DYNAMIC ENGINE SUPPORT */ + //**************************/ + // + //* Binary/behaviour compatibility levels */ + //# define OSSL_DYNAMIC_VERSION (unsigned long)0x00030000 + //* + // * Binary versions older than this are too old for us (whether we're a loader + // * or a loadee) + // */ + //# define OSSL_DYNAMIC_OLDEST (unsigned long)0x00030000 + // + //* + // * When compiling an ENGINE entirely as an external shared library, loadable + // * by the "dynamic" ENGINE, these types are needed. The 'dynamic_fns' + // * structure type provides the calling application's (or library's) error + // * functionality and memory management function pointers to the loaded + // * library. These should be used/set in the loaded library code so that the + // * loading application's 'state' will be used/changed in all operations. The + // * 'static_state' pointer allows the loaded library to know if it shares the + // * same static data as the calling application (or library), and thus whether + // * these callbacks need to be set or not. + // */ + + + //# define IMPLEMENT_DYNAMIC_BIND_FN(fn) \ + // OPENSSL_EXPORT \ + // int bind_engine(ENGINE *e, const char *id, const dynamic_fns *fns); \ + // OPENSSL_EXPORT \ + // int bind_engine(ENGINE *e, const char *id, const dynamic_fns *fns) { \ + // if (ENGINE_get_static_state() == fns->static_state) goto skip_cbs; \ + // CRYPTO_set_mem_functions(fns->mem_fns.malloc_fn, \ + // fns->mem_fns.realloc_fn, \ + // fns->mem_fns.free_fn); \ + // skip_cbs: \ + // if (!fn(e, id)) return 0; \ + // return 1; } + // + //* + // * If the loading application (or library) and the loaded ENGINE library + // * share the same static data (eg. they're both dynamically linked to the + // * same libcrypto.so) we need a way to avoid trying to set system callbacks - + // * this would fail, and for the same reason that it's unnecessary to try. If + // * the loaded ENGINE has (or gets from through the loader) its own copy of + // * the libcrypto static data, we will need to set the callbacks. The easiest + // * way to detect this is to have a function that returns a pointer to some + // * static data and let the loading application and loaded ENGINE compare + // * their respective values. + // */ + ENGINE_get_static_state: function : Pointer; cdecl = nil; + +{$ELSE} + function ENGINE_get_first: PENGINE cdecl; external CLibCrypto; + function ENGINE_get_last: PENGINE cdecl; external CLibCrypto; + function ENGINE_get_next(e: PENGINE): PENGINE cdecl; external CLibCrypto; + function ENGINE_get_prev(e: PENGINE): PENGINE cdecl; external CLibCrypto; + function ENGINE_add(e: PENGINE): TIdC_INT cdecl; external CLibCrypto; + function ENGINE_remove(e: PENGINE): TIdC_INT cdecl; external CLibCrypto; + function ENGINE_by_id(const id: PIdAnsiChar): PENGINE cdecl; external CLibCrypto; + + procedure ENGINE_load_builtin_engines cdecl; external CLibCrypto; + + // + // Get and set global flags (ENGINE_TABLE_FLAG_***) for the implementation + // "registry" handling. + // + function ENGINE_get_table_flags: TIdC_UINT cdecl; external CLibCrypto; + procedure ENGINE_set_table_flags(flags: TIdC_UINT) cdecl; external CLibCrypto; + + //- Manage registration of ENGINEs per "table". For each type, there are 3 + // functions; + // ENGINE_register_***(e) - registers the implementation from 'e' (if it has one) + // ENGINE_unregister_***(e) - unregister the implementation from 'e' + // ENGINE_register_all_***() - call ENGINE_register_***() for each 'e' in the list + // Cleanup is automatically registered from each table when required. + // + + function ENGINE_register_RSA(e: PENGINE): TIdC_INT cdecl; external CLibCrypto; + procedure ENGINE_unregister_RSA(e: PENGINE) cdecl; external CLibCrypto; + procedure ENGINE_register_all_RSA cdecl; external CLibCrypto; + + function ENGINE_register_DSA(e: PENGINE): TIdC_INT cdecl; external CLibCrypto; + procedure ENGINE_unregister_DSA(e: PENGINE) cdecl; external CLibCrypto; + procedure ENGINE_register_all_DSA cdecl; external CLibCrypto; + + function ENGINE_register_EC(e: PENGINE): TIdC_INT cdecl; external CLibCrypto; + procedure ENGINE_unregister_EC(e: PENGINE) cdecl; external CLibCrypto; + procedure ENGINE_register_all_EC cdecl; external CLibCrypto; + + function ENGINE_register_DH(e: PENGINE): TIdC_INT cdecl; external CLibCrypto; + procedure ENGINE_unregister_DH(e: PENGINE) cdecl; external CLibCrypto; + procedure ENGINE_register_all_DH cdecl; external CLibCrypto; + + function ENGINE_register_RAND(e: PENGINE): TIdC_INT cdecl; external CLibCrypto; + procedure ENGINE_unregister_RAND(e: PENGINE) cdecl; external CLibCrypto; + procedure ENGINE_register_all_RAND cdecl; external CLibCrypto; + + function ENGINE_register_ciphers(e: PENGINE): TIdC_INT cdecl; external CLibCrypto; + procedure ENGINE_unregister_ciphers(e: PENGINE) cdecl; external CLibCrypto; + procedure ENGINE_register_all_ciphers cdecl; external CLibCrypto; + + function ENGINE_register_digests(e: PENGINE): TIdC_INT cdecl; external CLibCrypto; + procedure ENGINE_unregister_digests(e: PENGINE) cdecl; external CLibCrypto; + procedure ENGINE_register_all_digests cdecl; external CLibCrypto; + + function ENGINE_register_pkey_meths(e: PENGINE): TIdC_INT cdecl; external CLibCrypto; + procedure ENGINE_unregister_pkey_meths(e: PENGINE) cdecl; external CLibCrypto; + procedure ENGINE_register_all_pkey_meths cdecl; external CLibCrypto; + + function ENGINE_register_pkey_asn1_meths(e: PENGINE): TIdC_INT cdecl; external CLibCrypto; + procedure ENGINE_unregister_pkey_asn1_meths(e: PENGINE) cdecl; external CLibCrypto; + procedure ENGINE_register_all_pkey_asn1_meths cdecl; external CLibCrypto; + + // + // These functions register all support from the above categories. Note, use + // of these functions can result in static linkage of code your application + // may not need. If you only need a subset of functionality, consider using + // more selective initialisation. + // + function ENGINE_register_complete(e: PENGINE): TIdC_INT cdecl; external CLibCrypto; + function ENGINE_register_all_complete: TIdC_INT cdecl; external CLibCrypto; + + // + // Send parameterised control commands to the engine. The possibilities to + // send down an integer, a pointer to data or a function pointer are + // provided. Any of the parameters may or may not be NULL, depending on the + // command number. In actuality, this function only requires a structural + // (rather than functional) reference to an engine, but many control commands + // may require the engine be functional. The caller should be aware of trying + // commands that require an operational ENGINE, and only use functional + // references in such situations. + // + function ENGINE_ctrl(e: PENGINE; cmd: TIdC_INT; i: TIdC_LONG; p: Pointer; v1: f): TIdC_INT cdecl; external CLibCrypto; + + // + // This function tests if an ENGINE-specific command is usable as a + // "setting". Eg. in an application's config file that gets processed through + // ENGINE_ctrl_cmd_string(). If this returns zero, it is not available to + // ENGINE_ctrl_cmd_string(), only ENGINE_ctrl(). + // + function ENGINE_cmd_is_executable(e: PENGINE; cmd: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + + // + // This function works like ENGINE_ctrl() with the exception of taking a + // command name instead of a command number, and can handle optional + // commands. See the comment on ENGINE_ctrl_cmd_string() for an explanation + // on how to use the cmd_name and cmd_optional. + // + function ENGINE_ctrl_cmd(e: PENGINE; const cmd_name: PIdAnsiChar; i: TIdC_LONG; p: Pointer; v1: f; cmd_optional: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + + // + // This function passes a command-name and argument to an ENGINE. The + // cmd_name is converted to a command number and the control command is + // called using 'arg' as an argument (unless the ENGINE doesn't support such + // a command, in which case no control command is called). The command is + // checked for input flags, and if necessary the argument will be converted + // to a numeric value. If cmd_optional is non-zero, then if the ENGINE + // doesn't support the given cmd_name the return value will be success + // anyway. This function is intended for applications to use so that users + // (or config files) can supply engine-specific config data to the ENGINE at + // run-time to control behaviour of specific engines. As such, it shouldn't + // be used for calling ENGINE_ctrl() functions that return data, deal with + // binary data, or that are otherwise supposed to be used directly through + // ENGINE_ctrl() in application code. Any "return" data from an ENGINE_ctrl() + // operation in this function will be lost - the return value is interpreted + // as failure if the return value is zero, success otherwise, and this + // function returns a boolean value as a result. In other words, vendors of + // 'ENGINE'-enabled devices should write ENGINE implementations with + // parameterisations that work in this scheme, so that compliant ENGINE-based + // applications can work consistently with the same configuration for the + // same ENGINE-enabled devices, across applications. + // + function ENGINE_ctrl_cmd_string(e: PENGINE; const cmd_name: PIdAnsiChar; const arg: PIdAnsiChar; cmd_optional: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + + // + // These functions are useful for manufacturing new ENGINE structures. They + // don't address reference counting at all - one uses them to populate an + // ENGINE structure with personalised implementations of things prior to + // using it directly or adding it to the builtin ENGINE list in OpenSSL. + // These are also here so that the ENGINE structure doesn't have to be + // exposed and break binary compatibility! + // + function ENGINE_new: PENGINE cdecl; external CLibCrypto; + function ENGINE_free(e: PENGINE): TIdC_INT cdecl; external CLibCrypto; + function ENGINE_up_ref(e: PENGINE): TIdC_INT cdecl; external CLibCrypto; + function ENGINE_set_id(e: PENGINE; const id: PIdAnsiChar): TIdC_INT cdecl; external CLibCrypto; + function ENGINE_set_name(e: PENGINE; const name: PIdAnsiChar): TIdC_INT cdecl; external CLibCrypto; + function ENGINE_set_RSA(e: PENGINE; const rsa_meth: PRSA_METHOD): TIdC_INT cdecl; external CLibCrypto; + function ENGINE_set_DSA(e: PENGINE; const dsa_meth: PDSA_METHOD): TIdC_INT cdecl; external CLibCrypto; + function ENGINE_set_EC(e: PENGINE; const ecdsa_meth: PEC_KEY_METHOD): TIdC_INT cdecl; external CLibCrypto; + function ENGINE_set_DH(e: PENGINE; const dh_meth: PDH_METHOD): TIdC_INT cdecl; external CLibCrypto; + function ENGINE_set_RAND(e: PENGINE; const rand_meth: PRAND_METHOD): TIdC_INT cdecl; external CLibCrypto; + function ENGINE_set_destroy_function(e: PENGINE; destroy_f: ENGINE_GEN_INT_FUNC_PTR): TIdC_INT cdecl; external CLibCrypto; + function ENGINE_set_init_function(e: PENGINE; init_f: ENGINE_GEN_INT_FUNC_PTR): TIdC_INT cdecl; external CLibCrypto; + function ENGINE_set_finish_function(e: PENGINE; finish_f: ENGINE_GEN_INT_FUNC_PTR): TIdC_INT cdecl; external CLibCrypto; + function ENGINE_set_ctrl_function(e: PENGINE; ctrl_f: ENGINE_CTRL_FUNC_PTR): TIdC_INT cdecl; external CLibCrypto; + function ENGINE_set_load_privkey_function(e: PENGINE; loadpriv_f: ENGINE_LOAD_KEY_PTR): TIdC_INT cdecl; external CLibCrypto; + function ENGINE_set_load_pubkey_function(e: PENGINE; loadpub_f: ENGINE_LOAD_KEY_PTR): TIdC_INT cdecl; external CLibCrypto; + //function ENGINE_set_load_ssl_client_cert_function(e: PENGINE; loadssl_f: ENGINE_SSL_CLIENT_CERT_PTR): TIdC_INT; + function ENGINE_set_ciphers(e: PENGINE; f: ENGINE_CIPHERS_PTR): TIdC_INT cdecl; external CLibCrypto; + function ENGINE_set_digests(e: PENGINE; f: ENGINE_DIGESTS_PTR): TIdC_INT cdecl; external CLibCrypto; + function ENGINE_set_pkey_meths(e: PENGINE; f: ENGINE_PKEY_METHS_PTR): TIdC_INT cdecl; external CLibCrypto; + function ENGINE_set_pkey_asn1_meths(e: PENGINE; f: ENGINE_PKEY_ASN1_METHS_PTR): TIdC_INT cdecl; external CLibCrypto; + function ENGINE_set_flags(e: PENGINE; flags: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function ENGINE_set_cmd_defns(e: PENGINE; const defns: PENGINE_CMD_DEFN): TIdC_INT cdecl; external CLibCrypto; + // These functions allow control over any per-structure ENGINE data. */ + //#define ENGINE_get_ex_new_index(l, p, newf, dupf, freef) CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_ENGINE, l, p, newf, dupf, freef) + function ENGINE_set_ex_data(e: PENGINE; idx: TIdC_INT; arg: Pointer): TIdC_INT cdecl; external CLibCrypto; + function ENGINE_get_ex_data(const e: PENGINE; idx: TIdC_INT): Pointer cdecl; external CLibCrypto; + + // + // These return values from within the ENGINE structure. These can be useful + // with functional references as well as structural references - it depends + // which you obtained. Using the result for functional purposes if you only + // obtained a structural reference may be problematic! + // + function ENGINE_get_id(const e: PENGINE): PIdAnsiChar cdecl; external CLibCrypto; + function ENGINE_get_name(const e: PENGINE): PIdAnsiChar cdecl; external CLibCrypto; + function ENGINE_get_RSA(const e: PENGINE): PRSA_METHOD cdecl; external CLibCrypto; + function ENGINE_get_DSA(const e: PENGINE): PDSA_METHOD cdecl; external CLibCrypto; + function ENGINE_get_EC(const e: PENGINE): PEC_METHOD cdecl; external CLibCrypto; + function ENGINE_get_DH(const e: PENGINE): PDH_METHOD cdecl; external CLibCrypto; + function ENGINE_get_RAND(const e: PENGINE): PRAND_METHOD cdecl; external CLibCrypto; + function ENGINE_get_destroy_function(const e: PENGINE): ENGINE_GEN_INT_FUNC_PTR cdecl; external CLibCrypto; + function ENGINE_get_init_function(const e: PENGINE): ENGINE_GEN_INT_FUNC_PTR cdecl; external CLibCrypto; + function ENGINE_get_finish_function(const e: PENGINE): ENGINE_GEN_INT_FUNC_PTR cdecl; external CLibCrypto; + function ENGINE_get_ctrl_function(const e: PENGINE): ENGINE_CTRL_FUNC_PTR cdecl; external CLibCrypto; + function ENGINE_get_load_privkey_function(const e: PENGINE): ENGINE_LOAD_KEY_PTR cdecl; external CLibCrypto; + function ENGINE_get_load_pubkey_function(const e: PENGINE): ENGINE_LOAD_KEY_PTR cdecl; external CLibCrypto; + //function ENGINE_get_ssl_client_cert_function(const e: PENGINE): ENGINE_SSL_CLIENT_CERT_PTR; + + function ENGINE_get_ciphers(const e: PENGINE): ENGINE_CIPHERS_PTR cdecl; external CLibCrypto; + function ENGINE_get_digests(const e: PENGINE): ENGINE_DIGESTS_PTR cdecl; external CLibCrypto; + function ENGINE_get_pkey_meths(const e: PENGINE): ENGINE_PKEY_METHS_PTR cdecl; external CLibCrypto; + function ENGINE_get_pkey_asn1_meths(const e: PENGINE): ENGINE_PKEY_ASN1_METHS_PTR cdecl; external CLibCrypto; + function ENGINE_get_cipher(e: PENGINE; nid: TIdC_INT): PEVP_CIPHER cdecl; external CLibCrypto; + function ENGINE_get_digest(e: PENGINE; nid: TIdC_INT): PEVP_MD cdecl; external CLibCrypto; + function ENGINE_get_pkey_meth(e: PENGINE; nid: TIdC_INT): PEVP_PKEY_METHOD cdecl; external CLibCrypto; + function ENGINE_get_pkey_asn1_meth(e: PENGINE; nid: TIdC_INT): PEVP_PKEY_ASN1_METHOD cdecl; external CLibCrypto; + function ENGINE_get_pkey_asn1_meth_str(e: PENGINE; const str: PIdAnsiChar; len: TIdC_INT): PEVP_PKEY_ASN1_METHOD cdecl; external CLibCrypto; + function ENGINE_pkey_asn1_find_str(pe: PPENGINE; const str: PIdAnsiChar; len: TIdC_INT): PEVP_PKEY_ASN1_METHOD cdecl; external CLibCrypto; + function ENGINE_get_cmd_defns(const e: PENGINE): PENGINE_CMD_DEFN cdecl; external CLibCrypto; + function ENGINE_get_flags(const e: PENGINE): TIdC_INT cdecl; external CLibCrypto; + + ///* + // * FUNCTIONAL functions. These functions deal with ENGINE structures that + // * have (or will) be initialised for use. Broadly speaking, the structural + // * functions are useful for iterating the list of available engine types, + // * creating new engine types, and other "list" operations. These functions + // * actually deal with ENGINEs that are to be used. As such these functions + // * can fail (if applicable) when particular engines are unavailable - eg. if + // * a hardware accelerator is not attached or not functioning correctly. Each + // * ENGINE has 2 reference counts; structural and functional. Every time a + // * functional reference is obtained or released, a corresponding structural + // * reference is automatically obtained or released too. + // */ + + ///* + // * Initialise a engine type for use (or up its reference count if it's + // * already in use). This will fail if the engine is not currently operational + // * and cannot initialise. + // */ + function ENGINE_init(e: PENGINE): TIdC_INT cdecl; external CLibCrypto; + ///* + // * Free a functional reference to a engine type. This does not require a + // * corresponding call to ENGINE_free as it also releases a structural + // * reference. + // */ + function ENGINE_finish(e: PENGINE): TIdC_INT cdecl; external CLibCrypto; + + ///* + // * The following functions handle keys that are stored in some secondary + // * location, handled by the engine. The storage may be on a card or + // * whatever. + // */ + function ENGINE_load_private_key(e: PENGINE; const key_id: PIdAnsiChar; ui_method: PUI_METHOD; callback_data: Pointer): PEVP_PKEY cdecl; external CLibCrypto; + function ENGINE_load_public_key(e: PENGINE; const key_id: PIdAnsiChar; ui_method: PUI_METHOD; callback_data: Pointer): PEVP_PKEY cdecl; external CLibCrypto; + //function ENGINE_load_ssl_client_cert(e: PENGINE; s: PSSL; + // {STACK_OF(X509) *ca_dn;} {STACK_OF(X509) **pother;} ui_method: PUI_METHOD; + // callback_data: Pointer): TIdC_INT; + + ///* + // * This returns a pointer for the current ENGINE structure that is (by + // * default) performing any RSA operations. The value returned is an + // * incremented reference, so it should be free'd (ENGINE_finish) before it is + // * discarded. + // */ + function ENGINE_get_default_RSA: PENGINE cdecl; external CLibCrypto; + //* Same for the other "methods" */ + function ENGINE_get_default_DSA: PENGINE cdecl; external CLibCrypto; + function ENGINE_get_default_EC: PENGINE cdecl; external CLibCrypto; + function ENGINE_get_default_DH: PENGINE cdecl; external CLibCrypto; + function ENGINE_get_default_RAND: PENGINE cdecl; external CLibCrypto; + ///* + // * These functions can be used to get a functional reference to perform + // * ciphering or digesting corresponding to "nid". + // */ + function ENGINE_get_cipher_engine(nid: TIdC_INT): PENGINE cdecl; external CLibCrypto; + function ENGINE_get_digest_engine(nid: TIdC_INT): PENGINE cdecl; external CLibCrypto; + function ENGINE_get_pkey_meth_engine(nid: TIdC_INT): PENGINE cdecl; external CLibCrypto; + function ENGINE_get_pkey_asn1_meth_engine(nid: TIdC_INT): PENGINE cdecl; external CLibCrypto; + ///* + // * This sets a new default ENGINE structure for performing RSA operations. If + // * the result is non-zero (success) then the ENGINE structure will have had + // * its reference count up'd so the caller should still free their own + // * reference 'e'. + // */ + function ENGINE_set_default_RSA(e: PENGINE): TIdC_INT cdecl; external CLibCrypto; + function ENGINE_set_default_string(e: PENGINE; const def_list: PIdAnsiChar): TIdC_INT cdecl; external CLibCrypto; + // Same for the other "methods" + function ENGINE_set_default_DSA(e: PENGINE): TIdC_INT cdecl; external CLibCrypto; + function ENGINE_set_default_EC(e: PENGINE): TIdC_INT cdecl; external CLibCrypto; + function ENGINE_set_default_DH(e: PENGINE): TIdC_INT cdecl; external CLibCrypto; + function ENGINE_set_default_RAND(e: PENGINE): TIdC_INT cdecl; external CLibCrypto; + function ENGINE_set_default_ciphers(e: PENGINE): TIdC_INT cdecl; external CLibCrypto; + function ENGINE_set_default_digests(e: PENGINE): TIdC_INT cdecl; external CLibCrypto; + function ENGINE_set_default_pkey_meths(e: PENGINE): TIdC_INT cdecl; external CLibCrypto; + function ENGINE_set_default_pkey_asn1_meths(e: PENGINE): TIdC_INT cdecl; external CLibCrypto; + + ///* + // * The combination "set" - the flags are bitwise "OR"d from the + // * ENGINE_METHOD_*** defines above. As with the "ENGINE_register_complete()" + // * function, this function can result in unnecessary static linkage. If your + // * application requires only specific functionality, consider using more + // * selective functions. + // */ + function ENGINE_set_default(e: PENGINE; flags: TIdC_ULONG): TIdC_INT cdecl; external CLibCrypto; + + procedure ENGINE_add_conf_module cdecl; external CLibCrypto; + + ///* Deprecated functions ... */ + ///* int ENGINE_clear_defaults(void); */ + // + //**************************/ + //* DYNAMIC ENGINE SUPPORT */ + //**************************/ + // + //* Binary/behaviour compatibility levels */ + //# define OSSL_DYNAMIC_VERSION (unsigned long)0x00030000 + //* + // * Binary versions older than this are too old for us (whether we're a loader + // * or a loadee) + // */ + //# define OSSL_DYNAMIC_OLDEST (unsigned long)0x00030000 + // + //* + // * When compiling an ENGINE entirely as an external shared library, loadable + // * by the "dynamic" ENGINE, these types are needed. The 'dynamic_fns' + // * structure type provides the calling application's (or library's) error + // * functionality and memory management function pointers to the loaded + // * library. These should be used/set in the loaded library code so that the + // * loading application's 'state' will be used/changed in all operations. The + // * 'static_state' pointer allows the loaded library to know if it shares the + // * same static data as the calling application (or library), and thus whether + // * these callbacks need to be set or not. + // */ + + + //# define IMPLEMENT_DYNAMIC_BIND_FN(fn) \ + // OPENSSL_EXPORT \ + // int bind_engine(ENGINE *e, const char *id, const dynamic_fns *fns); \ + // OPENSSL_EXPORT \ + // int bind_engine(ENGINE *e, const char *id, const dynamic_fns *fns) { \ + // if (ENGINE_get_static_state() == fns->static_state) goto skip_cbs; \ + // CRYPTO_set_mem_functions(fns->mem_fns.malloc_fn, \ + // fns->mem_fns.realloc_fn, \ + // fns->mem_fns.free_fn); \ + // skip_cbs: \ + // if (!fn(e, id)) return 0; \ + // return 1; } + // + //* + // * If the loading application (or library) and the loaded ENGINE library + // * share the same static data (eg. they're both dynamically linked to the + // * same libcrypto.so) we need a way to avoid trying to set system callbacks - + // * this would fail, and for the same reason that it's unnecessary to try. If + // * the loaded ENGINE has (or gets from through the loader) its own copy of + // * the libcrypto static data, we will need to set the callbacks. The easiest + // * way to detect this is to have a function that returns a pointer to some + // * static data and let the loading application and loaded ENGINE compare + // * their respective values. + // */ + function ENGINE_get_static_state: Pointer cdecl; external CLibCrypto; + +{$ENDIF} + +implementation + + uses + classes, + IdSSLOpenSSLExceptionHandlers, + IdResourceStringsOpenSSL + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + ,IdSSLOpenSSLLoader + {$ENDIF}; + + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +const + ENGINE_get_first_procname = 'ENGINE_get_first'; + ENGINE_get_last_procname = 'ENGINE_get_last'; + ENGINE_get_next_procname = 'ENGINE_get_next'; + ENGINE_get_prev_procname = 'ENGINE_get_prev'; + ENGINE_add_procname = 'ENGINE_add'; + ENGINE_remove_procname = 'ENGINE_remove'; + ENGINE_by_id_procname = 'ENGINE_by_id'; + + ENGINE_load_builtin_engines_procname = 'ENGINE_load_builtin_engines'; + + // + // Get and set global flags (ENGINE_TABLE_FLAG_***) for the implementation + // "registry" handling. + // + ENGINE_get_table_flags_procname = 'ENGINE_get_table_flags'; + ENGINE_set_table_flags_procname = 'ENGINE_set_table_flags'; + + //- Manage registration of ENGINEs per "table". For each type, there are 3 + // functions; + // ENGINE_register_***(e) - registers the implementation from 'e' (if it has one) + // ENGINE_unregister_***(e) - unregister the implementation from 'e' + // ENGINE_register_all_***() - call ENGINE_register_***() for each 'e' in the list + // Cleanup is automatically registered from each table when required. + // + + ENGINE_register_RSA_procname = 'ENGINE_register_RSA'; + ENGINE_unregister_RSA_procname = 'ENGINE_unregister_RSA'; + ENGINE_register_all_RSA_procname = 'ENGINE_register_all_RSA'; + + ENGINE_register_DSA_procname = 'ENGINE_register_DSA'; + ENGINE_unregister_DSA_procname = 'ENGINE_unregister_DSA'; + ENGINE_register_all_DSA_procname = 'ENGINE_register_all_DSA'; + + ENGINE_register_EC_procname = 'ENGINE_register_EC'; + ENGINE_unregister_EC_procname = 'ENGINE_unregister_EC'; + ENGINE_register_all_EC_procname = 'ENGINE_register_all_EC'; + + ENGINE_register_DH_procname = 'ENGINE_register_DH'; + ENGINE_unregister_DH_procname = 'ENGINE_unregister_DH'; + ENGINE_register_all_DH_procname = 'ENGINE_register_all_DH'; + + ENGINE_register_RAND_procname = 'ENGINE_register_RAND'; + ENGINE_unregister_RAND_procname = 'ENGINE_unregister_RAND'; + ENGINE_register_all_RAND_procname = 'ENGINE_register_all_RAND'; + + ENGINE_register_ciphers_procname = 'ENGINE_register_ciphers'; + ENGINE_unregister_ciphers_procname = 'ENGINE_unregister_ciphers'; + ENGINE_register_all_ciphers_procname = 'ENGINE_register_all_ciphers'; + + ENGINE_register_digests_procname = 'ENGINE_register_digests'; + ENGINE_unregister_digests_procname = 'ENGINE_unregister_digests'; + ENGINE_register_all_digests_procname = 'ENGINE_register_all_digests'; + + ENGINE_register_pkey_meths_procname = 'ENGINE_register_pkey_meths'; + ENGINE_unregister_pkey_meths_procname = 'ENGINE_unregister_pkey_meths'; + ENGINE_register_all_pkey_meths_procname = 'ENGINE_register_all_pkey_meths'; + + ENGINE_register_pkey_asn1_meths_procname = 'ENGINE_register_pkey_asn1_meths'; + ENGINE_unregister_pkey_asn1_meths_procname = 'ENGINE_unregister_pkey_asn1_meths'; + ENGINE_register_all_pkey_asn1_meths_procname = 'ENGINE_register_all_pkey_asn1_meths'; + + // + // These functions register all support from the above categories. Note, use + // of these functions can result in static linkage of code your application + // may not need. If you only need a subset of functionality, consider using + // more selective initialisation. + // + ENGINE_register_complete_procname = 'ENGINE_register_complete'; + ENGINE_register_all_complete_procname = 'ENGINE_register_all_complete'; + + // + // Send parameterised control commands to the engine. The possibilities to + // send down an integer, a pointer to data or a function pointer are + // provided. Any of the parameters may or may not be NULL, depending on the + // command number. In actuality, this function only requires a structural + // (rather than functional) reference to an engine, but many control commands + // may require the engine be functional. The caller should be aware of trying + // commands that require an operational ENGINE, and only use functional + // references in such situations. + // + ENGINE_ctrl_procname = 'ENGINE_ctrl'; + + // + // This function tests if an ENGINE-specific command is usable as a + // "setting". Eg. in an application's config file that gets processed through + // ENGINE_ctrl_cmd_string(). If this returns zero, it is not available to + // ENGINE_ctrl_cmd_string(), only ENGINE_ctrl(). + // + ENGINE_cmd_is_executable_procname = 'ENGINE_cmd_is_executable'; + + // + // This function works like ENGINE_ctrl() with the exception of taking a + // command name instead of a command number, and can handle optional + // commands. See the comment on ENGINE_ctrl_cmd_string() for an explanation + // on how to use the cmd_name and cmd_optional. + // + ENGINE_ctrl_cmd_procname = 'ENGINE_ctrl_cmd'; + + // + // This function passes a command-name and argument to an ENGINE. The + // cmd_name is converted to a command number and the control command is + // called using 'arg' as an argument (unless the ENGINE doesn't support such + // a command, in which case no control command is called). The command is + // checked for input flags, and if necessary the argument will be converted + // to a numeric value. If cmd_optional is non-zero, then if the ENGINE + // doesn't support the given cmd_name the return value will be success + // anyway. This function is intended for applications to use so that users + // (or config files) can supply engine-specific config data to the ENGINE at + // run-time to control behaviour of specific engines. As such, it shouldn't + // be used for calling ENGINE_ctrl() functions that return data, deal with + // binary data, or that are otherwise supposed to be used directly through + // ENGINE_ctrl() in application code. Any "return" data from an ENGINE_ctrl() + // operation in this function will be lost - the return value is interpreted + // as failure if the return value is zero, success otherwise, and this + // function returns a boolean value as a result. In other words, vendors of + // 'ENGINE'-enabled devices should write ENGINE implementations with + // parameterisations that work in this scheme, so that compliant ENGINE-based + // applications can work consistently with the same configuration for the + // same ENGINE-enabled devices, across applications. + // + ENGINE_ctrl_cmd_string_procname = 'ENGINE_ctrl_cmd_string'; + + // + // These functions are useful for manufacturing new ENGINE structures. They + // don't address reference counting at all - one uses them to populate an + // ENGINE structure with personalised implementations of things prior to + // using it directly or adding it to the builtin ENGINE list in OpenSSL. + // These are also here so that the ENGINE structure doesn't have to be + // exposed and break binary compatibility! + // + ENGINE_new_procname = 'ENGINE_new'; + ENGINE_free_procname = 'ENGINE_free'; + ENGINE_up_ref_procname = 'ENGINE_up_ref'; + ENGINE_set_id_procname = 'ENGINE_set_id'; + ENGINE_set_name_procname = 'ENGINE_set_name'; + ENGINE_set_RSA_procname = 'ENGINE_set_RSA'; + ENGINE_set_DSA_procname = 'ENGINE_set_DSA'; + ENGINE_set_EC_procname = 'ENGINE_set_EC'; + ENGINE_set_DH_procname = 'ENGINE_set_DH'; + ENGINE_set_RAND_procname = 'ENGINE_set_RAND'; + ENGINE_set_destroy_function_procname = 'ENGINE_set_destroy_function'; + ENGINE_set_init_function_procname = 'ENGINE_set_init_function'; + ENGINE_set_finish_function_procname = 'ENGINE_set_finish_function'; + ENGINE_set_ctrl_function_procname = 'ENGINE_set_ctrl_function'; + ENGINE_set_load_privkey_function_procname = 'ENGINE_set_load_privkey_function'; + ENGINE_set_load_pubkey_function_procname = 'ENGINE_set_load_pubkey_function'; + //function ENGINE_set_load_ssl_client_cert_function(e: PENGINE; loadssl_f: ENGINE_SSL_CLIENT_CERT_PTR): TIdC_INT; + ENGINE_set_ciphers_procname = 'ENGINE_set_ciphers'; + ENGINE_set_digests_procname = 'ENGINE_set_digests'; + ENGINE_set_pkey_meths_procname = 'ENGINE_set_pkey_meths'; + ENGINE_set_pkey_asn1_meths_procname = 'ENGINE_set_pkey_asn1_meths'; + ENGINE_set_flags_procname = 'ENGINE_set_flags'; + ENGINE_set_cmd_defns_procname = 'ENGINE_set_cmd_defns'; + // These functions allow control over any per-structure ENGINE data. */ + //#define ENGINE_get_ex_new_index(l, p, newf, dupf, freef) CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_ENGINE, l, p, newf, dupf, freef) + ENGINE_set_ex_data_procname = 'ENGINE_set_ex_data'; + ENGINE_get_ex_data_procname = 'ENGINE_get_ex_data'; + + // + // These return values from within the ENGINE structure. These can be useful + // with functional references as well as structural references - it depends + // which you obtained. Using the result for functional purposes if you only + // obtained a structural reference may be problematic! + // + ENGINE_get_id_procname = 'ENGINE_get_id'; + ENGINE_get_name_procname = 'ENGINE_get_name'; + ENGINE_get_RSA_procname = 'ENGINE_get_RSA'; + ENGINE_get_DSA_procname = 'ENGINE_get_DSA'; + ENGINE_get_EC_procname = 'ENGINE_get_EC'; + ENGINE_get_DH_procname = 'ENGINE_get_DH'; + ENGINE_get_RAND_procname = 'ENGINE_get_RAND'; + ENGINE_get_destroy_function_procname = 'ENGINE_get_destroy_function'; + ENGINE_get_init_function_procname = 'ENGINE_get_init_function'; + ENGINE_get_finish_function_procname = 'ENGINE_get_finish_function'; + ENGINE_get_ctrl_function_procname = 'ENGINE_get_ctrl_function'; + ENGINE_get_load_privkey_function_procname = 'ENGINE_get_load_privkey_function'; + ENGINE_get_load_pubkey_function_procname = 'ENGINE_get_load_pubkey_function'; + //function ENGINE_get_ssl_client_cert_function(const e: PENGINE): ENGINE_SSL_CLIENT_CERT_PTR; + + ENGINE_get_ciphers_procname = 'ENGINE_get_ciphers'; + ENGINE_get_digests_procname = 'ENGINE_get_digests'; + ENGINE_get_pkey_meths_procname = 'ENGINE_get_pkey_meths'; + ENGINE_get_pkey_asn1_meths_procname = 'ENGINE_get_pkey_asn1_meths'; + ENGINE_get_cipher_procname = 'ENGINE_get_cipher'; + ENGINE_get_digest_procname = 'ENGINE_get_digest'; + ENGINE_get_pkey_meth_procname = 'ENGINE_get_pkey_meth'; + ENGINE_get_pkey_asn1_meth_procname = 'ENGINE_get_pkey_asn1_meth'; + ENGINE_get_pkey_asn1_meth_str_procname = 'ENGINE_get_pkey_asn1_meth_str'; + ENGINE_pkey_asn1_find_str_procname = 'ENGINE_pkey_asn1_find_str'; + ENGINE_get_cmd_defns_procname = 'ENGINE_get_cmd_defns'; + ENGINE_get_flags_procname = 'ENGINE_get_flags'; + + ///* + // * FUNCTIONAL functions. These functions deal with ENGINE structures that + // * have (or will) be initialised for use. Broadly speaking, the structural + // * functions are useful for iterating the list of available engine types, + // * creating new engine types, and other "list" operations. These functions + // * actually deal with ENGINEs that are to be used. As such these functions + // * can fail (if applicable) when particular engines are unavailable - eg. if + // * a hardware accelerator is not attached or not functioning correctly. Each + // * ENGINE has 2 reference counts; structural and functional. Every time a + // * functional reference is obtained or released, a corresponding structural + // * reference is automatically obtained or released too. + // */ + + ///* + // * Initialise a engine type for use (or up its reference count if it's + // * already in use). This will fail if the engine is not currently operational + // * and cannot initialise. + // */ + ENGINE_init_procname = 'ENGINE_init'; + ///* + // * Free a functional reference to a engine type. This does not require a + // * corresponding call to ENGINE_free as it also releases a structural + // * reference. + // */ + ENGINE_finish_procname = 'ENGINE_finish'; + + ///* + // * The following functions handle keys that are stored in some secondary + // * location, handled by the engine. The storage may be on a card or + // * whatever. + // */ + ENGINE_load_private_key_procname = 'ENGINE_load_private_key'; + ENGINE_load_public_key_procname = 'ENGINE_load_public_key'; + //function ENGINE_load_ssl_client_cert(e: PENGINE; s: PSSL; + // {STACK_OF(X509) *ca_dn;} {STACK_OF(X509) **pother;} ui_method: PUI_METHOD; + // callback_data: Pointer): TIdC_INT; + + ///* + // * This returns a pointer for the current ENGINE structure that is (by + // * default) performing any RSA operations. The value returned is an + // * incremented reference, so it should be free'd (ENGINE_finish) before it is + // * discarded. + // */ + ENGINE_get_default_RSA_procname = 'ENGINE_get_default_RSA'; + //* Same for the other "methods" */ + ENGINE_get_default_DSA_procname = 'ENGINE_get_default_DSA'; + ENGINE_get_default_EC_procname = 'ENGINE_get_default_EC'; + ENGINE_get_default_DH_procname = 'ENGINE_get_default_DH'; + ENGINE_get_default_RAND_procname = 'ENGINE_get_default_RAND'; + ///* + // * These functions can be used to get a functional reference to perform + // * ciphering or digesting corresponding to "nid". + // */ + ENGINE_get_cipher_engine_procname = 'ENGINE_get_cipher_engine'; + ENGINE_get_digest_engine_procname = 'ENGINE_get_digest_engine'; + ENGINE_get_pkey_meth_engine_procname = 'ENGINE_get_pkey_meth_engine'; + ENGINE_get_pkey_asn1_meth_engine_procname = 'ENGINE_get_pkey_asn1_meth_engine'; + ///* + // * This sets a new default ENGINE structure for performing RSA operations. If + // * the result is non-zero (success) then the ENGINE structure will have had + // * its reference count up'd so the caller should still free their own + // * reference 'e'. + // */ + ENGINE_set_default_RSA_procname = 'ENGINE_set_default_RSA'; + ENGINE_set_default_string_procname = 'ENGINE_set_default_string'; + // Same for the other "methods" + ENGINE_set_default_DSA_procname = 'ENGINE_set_default_DSA'; + ENGINE_set_default_EC_procname = 'ENGINE_set_default_EC'; + ENGINE_set_default_DH_procname = 'ENGINE_set_default_DH'; + ENGINE_set_default_RAND_procname = 'ENGINE_set_default_RAND'; + ENGINE_set_default_ciphers_procname = 'ENGINE_set_default_ciphers'; + ENGINE_set_default_digests_procname = 'ENGINE_set_default_digests'; + ENGINE_set_default_pkey_meths_procname = 'ENGINE_set_default_pkey_meths'; + ENGINE_set_default_pkey_asn1_meths_procname = 'ENGINE_set_default_pkey_asn1_meths'; + + ///* + // * The combination "set" - the flags are bitwise "OR"d from the + // * ENGINE_METHOD_*** defines above. As with the "ENGINE_register_complete()" + // * function, this function can result in unnecessary static linkage. If your + // * application requires only specific functionality, consider using more + // * selective functions. + // */ + ENGINE_set_default_procname = 'ENGINE_set_default'; + + ENGINE_add_conf_module_procname = 'ENGINE_add_conf_module'; + + ///* Deprecated functions ... */ + ///* int ENGINE_clear_defaults(void); */ + // + //**************************/ + //* DYNAMIC ENGINE SUPPORT */ + //**************************/ + // + //* Binary/behaviour compatibility levels */ + //# define OSSL_DYNAMIC_VERSION (unsigned long)0x00030000 + //* + // * Binary versions older than this are too old for us (whether we're a loader + // * or a loadee) + // */ + //# define OSSL_DYNAMIC_OLDEST (unsigned long)0x00030000 + // + //* + // * When compiling an ENGINE entirely as an external shared library, loadable + // * by the "dynamic" ENGINE, these types are needed. The 'dynamic_fns' + // * structure type provides the calling application's (or library's) error + // * functionality and memory management function pointers to the loaded + // * library. These should be used/set in the loaded library code so that the + // * loading application's 'state' will be used/changed in all operations. The + // * 'static_state' pointer allows the loaded library to know if it shares the + // * same static data as the calling application (or library), and thus whether + // * these callbacks need to be set or not. + // */ + + + //# define IMPLEMENT_DYNAMIC_BIND_FN(fn) \ + // OPENSSL_EXPORT \ + // int bind_engine(ENGINE *e, const char *id, const dynamic_fns *fns); \ + // OPENSSL_EXPORT \ + // int bind_engine(ENGINE *e, const char *id, const dynamic_fns *fns) { \ + // if (ENGINE_get_static_state() == fns->static_state) goto skip_cbs; \ + // CRYPTO_set_mem_functions(fns->mem_fns.malloc_fn, \ + // fns->mem_fns.realloc_fn, \ + // fns->mem_fns.free_fn); \ + // skip_cbs: \ + // if (!fn(e, id)) return 0; \ + // return 1; } + // + //* + // * If the loading application (or library) and the loaded ENGINE library + // * share the same static data (eg. they're both dynamically linked to the + // * same libcrypto.so) we need a way to avoid trying to set system callbacks - + // * this would fail, and for the same reason that it's unnecessary to try. If + // * the loaded ENGINE has (or gets from through the loader) its own copy of + // * the libcrypto static data, we will need to set the callbacks. The easiest + // * way to detect this is to have a function that returns a pointer to some + // * static data and let the loading application and loaded ENGINE compare + // * their respective values. + // */ + ENGINE_get_static_state_procname = 'ENGINE_get_static_state'; + + +{$WARN NO_RETVAL OFF} +function ERR_ENGINE_get_first: PENGINE; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_get_first_procname); +end; + + +function ERR_ENGINE_get_last: PENGINE; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_get_last_procname); +end; + + +function ERR_ENGINE_get_next(e: PENGINE): PENGINE; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_get_next_procname); +end; + + +function ERR_ENGINE_get_prev(e: PENGINE): PENGINE; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_get_prev_procname); +end; + + +function ERR_ENGINE_add(e: PENGINE): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_add_procname); +end; + + +function ERR_ENGINE_remove(e: PENGINE): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_remove_procname); +end; + + +function ERR_ENGINE_by_id(const id: PIdAnsiChar): PENGINE; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_by_id_procname); +end; + + + +procedure ERR_ENGINE_load_builtin_engines; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_load_builtin_engines_procname); +end; + + + + // + // Get and set global flags (ENGINE_TABLE_FLAG_***) for the implementation + // "registry" handling. + // +function ERR_ENGINE_get_table_flags: TIdC_UINT; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_get_table_flags_procname); +end; + + +procedure ERR_ENGINE_set_table_flags(flags: TIdC_UINT); +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_set_table_flags_procname); +end; + + + + //- Manage registration of ENGINEs per "table". For each type, there are 3 + // functions; + // ENGINE_register_***(e) - registers the implementation from 'e' (if it has one) + // ENGINE_unregister_***(e) - unregister the implementation from 'e' + // ENGINE_register_all_***() - call ENGINE_register_***() for each 'e' in the list + // Cleanup is automatically registered from each table when required. + // + +function ERR_ENGINE_register_RSA(e: PENGINE): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_register_RSA_procname); +end; + + +procedure ERR_ENGINE_unregister_RSA(e: PENGINE); +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_unregister_RSA_procname); +end; + + +procedure ERR_ENGINE_register_all_RSA; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_register_all_RSA_procname); +end; + + + +function ERR_ENGINE_register_DSA(e: PENGINE): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_register_DSA_procname); +end; + + +procedure ERR_ENGINE_unregister_DSA(e: PENGINE); +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_unregister_DSA_procname); +end; + + +procedure ERR_ENGINE_register_all_DSA; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_register_all_DSA_procname); +end; + + + +function ERR_ENGINE_register_EC(e: PENGINE): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_register_EC_procname); +end; + + +procedure ERR_ENGINE_unregister_EC(e: PENGINE); +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_unregister_EC_procname); +end; + + +procedure ERR_ENGINE_register_all_EC; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_register_all_EC_procname); +end; + + + +function ERR_ENGINE_register_DH(e: PENGINE): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_register_DH_procname); +end; + + +procedure ERR_ENGINE_unregister_DH(e: PENGINE); +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_unregister_DH_procname); +end; + + +procedure ERR_ENGINE_register_all_DH; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_register_all_DH_procname); +end; + + + +function ERR_ENGINE_register_RAND(e: PENGINE): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_register_RAND_procname); +end; + + +procedure ERR_ENGINE_unregister_RAND(e: PENGINE); +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_unregister_RAND_procname); +end; + + +procedure ERR_ENGINE_register_all_RAND; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_register_all_RAND_procname); +end; + + + +function ERR_ENGINE_register_ciphers(e: PENGINE): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_register_ciphers_procname); +end; + + +procedure ERR_ENGINE_unregister_ciphers(e: PENGINE); +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_unregister_ciphers_procname); +end; + + +procedure ERR_ENGINE_register_all_ciphers; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_register_all_ciphers_procname); +end; + + + +function ERR_ENGINE_register_digests(e: PENGINE): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_register_digests_procname); +end; + + +procedure ERR_ENGINE_unregister_digests(e: PENGINE); +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_unregister_digests_procname); +end; + + +procedure ERR_ENGINE_register_all_digests; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_register_all_digests_procname); +end; + + + +function ERR_ENGINE_register_pkey_meths(e: PENGINE): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_register_pkey_meths_procname); +end; + + +procedure ERR_ENGINE_unregister_pkey_meths(e: PENGINE); +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_unregister_pkey_meths_procname); +end; + + +procedure ERR_ENGINE_register_all_pkey_meths; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_register_all_pkey_meths_procname); +end; + + + +function ERR_ENGINE_register_pkey_asn1_meths(e: PENGINE): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_register_pkey_asn1_meths_procname); +end; + + +procedure ERR_ENGINE_unregister_pkey_asn1_meths(e: PENGINE); +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_unregister_pkey_asn1_meths_procname); +end; + + +procedure ERR_ENGINE_register_all_pkey_asn1_meths; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_register_all_pkey_asn1_meths_procname); +end; + + + + // + // These functions register all support from the above categories. Note, use + // of these functions can result in static linkage of code your application + // may not need. If you only need a subset of functionality, consider using + // more selective initialisation. + // +function ERR_ENGINE_register_complete(e: PENGINE): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_register_complete_procname); +end; + + +function ERR_ENGINE_register_all_complete: TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_register_all_complete_procname); +end; + + + + // + // Send parameterised control commands to the engine. The possibilities to + // send down an integer, a pointer to data or a function pointer are + // provided. Any of the parameters may or may not be NULL, depending on the + // command number. In actuality, this function only requires a structural + // (rather than functional) reference to an engine, but many control commands + // may require the engine be functional. The caller should be aware of trying + // commands that require an operational ENGINE, and only use functional + // references in such situations. + // +function ERR_ENGINE_ctrl(e: PENGINE; cmd: TIdC_INT; i: TIdC_LONG; p: Pointer; v1: f): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_ctrl_procname); +end; + + + + // + // This function tests if an ENGINE-specific command is usable as a + // "setting". Eg. in an application's config file that gets processed through + // ENGINE_ctrl_cmd_string(). If this returns zero, it is not available to + // ENGINE_ctrl_cmd_string(), only ENGINE_ctrl(). + // +function ERR_ENGINE_cmd_is_executable(e: PENGINE; cmd: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_cmd_is_executable_procname); +end; + + + + // + // This function works like ENGINE_ctrl() with the exception of taking a + // command name instead of a command number, and can handle optional + // commands. See the comment on ENGINE_ctrl_cmd_string() for an explanation + // on how to use the cmd_name and cmd_optional. + // +function ERR_ENGINE_ctrl_cmd(e: PENGINE; const cmd_name: PIdAnsiChar; i: TIdC_LONG; p: Pointer; v1: f; cmd_optional: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_ctrl_cmd_procname); +end; + + + + // + // This function passes a command-name and argument to an ENGINE. The + // cmd_name is converted to a command number and the control command is + // called using 'arg' as an argument (unless the ENGINE doesn't support such + // a command, in which case no control command is called). The command is + // checked for input flags, and if necessary the argument will be converted + // to a numeric value. If cmd_optional is non-zero, then if the ENGINE + // doesn't support the given cmd_name the return value will be success + // anyway. This function is intended for applications to use so that users + // (or config files) can supply engine-specific config data to the ENGINE at + // run-time to control behaviour of specific engines. As such, it shouldn't + // be used for calling ENGINE_ctrl() functions that return data, deal with + // binary data, or that are otherwise supposed to be used directly through + // ENGINE_ctrl() in application code. Any "return" data from an ENGINE_ctrl() + // operation in this function will be lost - the return value is interpreted + // as failure if the return value is zero, success otherwise, and this + // function returns a boolean value as a result. In other words, vendors of + // 'ENGINE'-enabled devices should write ENGINE implementations with + // parameterisations that work in this scheme, so that compliant ENGINE-based + // applications can work consistently with the same configuration for the + // same ENGINE-enabled devices, across applications. + // +function ERR_ENGINE_ctrl_cmd_string(e: PENGINE; const cmd_name: PIdAnsiChar; const arg: PIdAnsiChar; cmd_optional: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_ctrl_cmd_string_procname); +end; + + + + // + // These functions are useful for manufacturing new ENGINE structures. They + // don't address reference counting at all - one uses them to populate an + // ENGINE structure with personalised implementations of things prior to + // using it directly or adding it to the builtin ENGINE list in OpenSSL. + // These are also here so that the ENGINE structure doesn't have to be + // exposed and break binary compatibility! + // +function ERR_ENGINE_new: PENGINE; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_new_procname); +end; + + +function ERR_ENGINE_free(e: PENGINE): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_free_procname); +end; + + +function ERR_ENGINE_up_ref(e: PENGINE): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_up_ref_procname); +end; + + +function ERR_ENGINE_set_id(e: PENGINE; const id: PIdAnsiChar): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_set_id_procname); +end; + + +function ERR_ENGINE_set_name(e: PENGINE; const name: PIdAnsiChar): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_set_name_procname); +end; + + +function ERR_ENGINE_set_RSA(e: PENGINE; const rsa_meth: PRSA_METHOD): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_set_RSA_procname); +end; + + +function ERR_ENGINE_set_DSA(e: PENGINE; const dsa_meth: PDSA_METHOD): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_set_DSA_procname); +end; + + +function ERR_ENGINE_set_EC(e: PENGINE; const ecdsa_meth: PEC_KEY_METHOD): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_set_EC_procname); +end; + + +function ERR_ENGINE_set_DH(e: PENGINE; const dh_meth: PDH_METHOD): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_set_DH_procname); +end; + + +function ERR_ENGINE_set_RAND(e: PENGINE; const rand_meth: PRAND_METHOD): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_set_RAND_procname); +end; + + +function ERR_ENGINE_set_destroy_function(e: PENGINE; destroy_f: ENGINE_GEN_INT_FUNC_PTR): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_set_destroy_function_procname); +end; + + +function ERR_ENGINE_set_init_function(e: PENGINE; init_f: ENGINE_GEN_INT_FUNC_PTR): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_set_init_function_procname); +end; + + +function ERR_ENGINE_set_finish_function(e: PENGINE; finish_f: ENGINE_GEN_INT_FUNC_PTR): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_set_finish_function_procname); +end; + + +function ERR_ENGINE_set_ctrl_function(e: PENGINE; ctrl_f: ENGINE_CTRL_FUNC_PTR): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_set_ctrl_function_procname); +end; + + +function ERR_ENGINE_set_load_privkey_function(e: PENGINE; loadpriv_f: ENGINE_LOAD_KEY_PTR): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_set_load_privkey_function_procname); +end; + + +function ERR_ENGINE_set_load_pubkey_function(e: PENGINE; loadpub_f: ENGINE_LOAD_KEY_PTR): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_set_load_pubkey_function_procname); +end; + + + //function ENGINE_set_load_ssl_client_cert_function(e: PENGINE; loadssl_f: ENGINE_SSL_CLIENT_CERT_PTR): TIdC_INT; +function ERR_ENGINE_set_ciphers(e: PENGINE; f: ENGINE_CIPHERS_PTR): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_set_ciphers_procname); +end; + + +function ERR_ENGINE_set_digests(e: PENGINE; f: ENGINE_DIGESTS_PTR): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_set_digests_procname); +end; + + +function ERR_ENGINE_set_pkey_meths(e: PENGINE; f: ENGINE_PKEY_METHS_PTR): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_set_pkey_meths_procname); +end; + + +function ERR_ENGINE_set_pkey_asn1_meths(e: PENGINE; f: ENGINE_PKEY_ASN1_METHS_PTR): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_set_pkey_asn1_meths_procname); +end; + + +function ERR_ENGINE_set_flags(e: PENGINE; flags: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_set_flags_procname); +end; + + +function ERR_ENGINE_set_cmd_defns(e: PENGINE; const defns: PENGINE_CMD_DEFN): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_set_cmd_defns_procname); +end; + + + // These functions allow control over any per-structure ENGINE data. */ + //#define ENGINE_get_ex_new_index(l, p, newf, dupf, freef) CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_ENGINE, l, p, newf, dupf, freef) +function ERR_ENGINE_set_ex_data(e: PENGINE; idx: TIdC_INT; arg: Pointer): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_set_ex_data_procname); +end; + + +function ERR_ENGINE_get_ex_data(const e: PENGINE; idx: TIdC_INT): Pointer; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_get_ex_data_procname); +end; + + + + // + // These return values from within the ENGINE structure. These can be useful + // with functional references as well as structural references - it depends + // which you obtained. Using the result for functional purposes if you only + // obtained a structural reference may be problematic! + // +function ERR_ENGINE_get_id(const e: PENGINE): PIdAnsiChar; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_get_id_procname); +end; + + +function ERR_ENGINE_get_name(const e: PENGINE): PIdAnsiChar; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_get_name_procname); +end; + + +function ERR_ENGINE_get_RSA(const e: PENGINE): PRSA_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_get_RSA_procname); +end; + + +function ERR_ENGINE_get_DSA(const e: PENGINE): PDSA_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_get_DSA_procname); +end; + + +function ERR_ENGINE_get_EC(const e: PENGINE): PEC_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_get_EC_procname); +end; + + +function ERR_ENGINE_get_DH(const e: PENGINE): PDH_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_get_DH_procname); +end; + + +function ERR_ENGINE_get_RAND(const e: PENGINE): PRAND_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_get_RAND_procname); +end; + + +function ERR_ENGINE_get_destroy_function(const e: PENGINE): ENGINE_GEN_INT_FUNC_PTR; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_get_destroy_function_procname); +end; + + +function ERR_ENGINE_get_init_function(const e: PENGINE): ENGINE_GEN_INT_FUNC_PTR; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_get_init_function_procname); +end; + + +function ERR_ENGINE_get_finish_function(const e: PENGINE): ENGINE_GEN_INT_FUNC_PTR; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_get_finish_function_procname); +end; + + +function ERR_ENGINE_get_ctrl_function(const e: PENGINE): ENGINE_CTRL_FUNC_PTR; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_get_ctrl_function_procname); +end; + + +function ERR_ENGINE_get_load_privkey_function(const e: PENGINE): ENGINE_LOAD_KEY_PTR; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_get_load_privkey_function_procname); +end; + + +function ERR_ENGINE_get_load_pubkey_function(const e: PENGINE): ENGINE_LOAD_KEY_PTR; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_get_load_pubkey_function_procname); +end; + + + //function ENGINE_get_ssl_client_cert_function(const e: PENGINE): ENGINE_SSL_CLIENT_CERT_PTR; + +function ERR_ENGINE_get_ciphers(const e: PENGINE): ENGINE_CIPHERS_PTR; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_get_ciphers_procname); +end; + + +function ERR_ENGINE_get_digests(const e: PENGINE): ENGINE_DIGESTS_PTR; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_get_digests_procname); +end; + + +function ERR_ENGINE_get_pkey_meths(const e: PENGINE): ENGINE_PKEY_METHS_PTR; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_get_pkey_meths_procname); +end; + + +function ERR_ENGINE_get_pkey_asn1_meths(const e: PENGINE): ENGINE_PKEY_ASN1_METHS_PTR; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_get_pkey_asn1_meths_procname); +end; + + +function ERR_ENGINE_get_cipher(e: PENGINE; nid: TIdC_INT): PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_get_cipher_procname); +end; + + +function ERR_ENGINE_get_digest(e: PENGINE; nid: TIdC_INT): PEVP_MD; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_get_digest_procname); +end; + + +function ERR_ENGINE_get_pkey_meth(e: PENGINE; nid: TIdC_INT): PEVP_PKEY_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_get_pkey_meth_procname); +end; + + +function ERR_ENGINE_get_pkey_asn1_meth(e: PENGINE; nid: TIdC_INT): PEVP_PKEY_ASN1_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_get_pkey_asn1_meth_procname); +end; + + +function ERR_ENGINE_get_pkey_asn1_meth_str(e: PENGINE; const str: PIdAnsiChar; len: TIdC_INT): PEVP_PKEY_ASN1_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_get_pkey_asn1_meth_str_procname); +end; + + +function ERR_ENGINE_pkey_asn1_find_str(pe: PPENGINE; const str: PIdAnsiChar; len: TIdC_INT): PEVP_PKEY_ASN1_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_pkey_asn1_find_str_procname); +end; + + +function ERR_ENGINE_get_cmd_defns(const e: PENGINE): PENGINE_CMD_DEFN; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_get_cmd_defns_procname); +end; + + +function ERR_ENGINE_get_flags(const e: PENGINE): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_get_flags_procname); +end; + + + + ///* + // * FUNCTIONAL functions. These functions deal with ENGINE structures that + // * have (or will) be initialised for use. Broadly speaking, the structural + // * functions are useful for iterating the list of available engine types, + // * creating new engine types, and other "list" operations. These functions + // * actually deal with ENGINEs that are to be used. As such these functions + // * can fail (if applicable) when particular engines are unavailable - eg. if + // * a hardware accelerator is not attached or not functioning correctly. Each + // * ENGINE has 2 reference counts; structural and functional. Every time a + // * functional reference is obtained or released, a corresponding structural + // * reference is automatically obtained or released too. + // */ + + ///* + // * Initialise a engine type for use (or up its reference count if it's + // * already in use). This will fail if the engine is not currently operational + // * and cannot initialise. + // */ +function ERR_ENGINE_init(e: PENGINE): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_init_procname); +end; + + + ///* + // * Free a functional reference to a engine type. This does not require a + // * corresponding call to ENGINE_free as it also releases a structural + // * reference. + // */ +function ERR_ENGINE_finish(e: PENGINE): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_finish_procname); +end; + + + + ///* + // * The following functions handle keys that are stored in some secondary + // * location, handled by the engine. The storage may be on a card or + // * whatever. + // */ +function ERR_ENGINE_load_private_key(e: PENGINE; const key_id: PIdAnsiChar; ui_method: PUI_METHOD; callback_data: Pointer): PEVP_PKEY; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_load_private_key_procname); +end; + + +function ERR_ENGINE_load_public_key(e: PENGINE; const key_id: PIdAnsiChar; ui_method: PUI_METHOD; callback_data: Pointer): PEVP_PKEY; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_load_public_key_procname); +end; + + + //function ENGINE_load_ssl_client_cert(e: PENGINE; s: PSSL; + // {STACK_OF(X509) *ca_dn;} {STACK_OF(X509) **pother;} ui_method: PUI_METHOD; + // callback_data: Pointer): TIdC_INT; + + ///* + // * This returns a pointer for the current ENGINE structure that is (by + // * default) performing any RSA operations. The value returned is an + // * incremented reference, so it should be free'd (ENGINE_finish) before it is + // * discarded. + // */ +function ERR_ENGINE_get_default_RSA: PENGINE; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_get_default_RSA_procname); +end; + + + //* Same for the other "methods" */ +function ERR_ENGINE_get_default_DSA: PENGINE; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_get_default_DSA_procname); +end; + + +function ERR_ENGINE_get_default_EC: PENGINE; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_get_default_EC_procname); +end; + + +function ERR_ENGINE_get_default_DH: PENGINE; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_get_default_DH_procname); +end; + + +function ERR_ENGINE_get_default_RAND: PENGINE; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_get_default_RAND_procname); +end; + + + ///* + // * These functions can be used to get a functional reference to perform + // * ciphering or digesting corresponding to "nid". + // */ +function ERR_ENGINE_get_cipher_engine(nid: TIdC_INT): PENGINE; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_get_cipher_engine_procname); +end; + + +function ERR_ENGINE_get_digest_engine(nid: TIdC_INT): PENGINE; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_get_digest_engine_procname); +end; + + +function ERR_ENGINE_get_pkey_meth_engine(nid: TIdC_INT): PENGINE; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_get_pkey_meth_engine_procname); +end; + + +function ERR_ENGINE_get_pkey_asn1_meth_engine(nid: TIdC_INT): PENGINE; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_get_pkey_asn1_meth_engine_procname); +end; + + + ///* + // * This sets a new default ENGINE structure for performing RSA operations. If + // * the result is non-zero (success) then the ENGINE structure will have had + // * its reference count up'd so the caller should still free their own + // * reference 'e'. + // */ +function ERR_ENGINE_set_default_RSA(e: PENGINE): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_set_default_RSA_procname); +end; + + +function ERR_ENGINE_set_default_string(e: PENGINE; const def_list: PIdAnsiChar): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_set_default_string_procname); +end; + + + // Same for the other "methods" +function ERR_ENGINE_set_default_DSA(e: PENGINE): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_set_default_DSA_procname); +end; + + +function ERR_ENGINE_set_default_EC(e: PENGINE): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_set_default_EC_procname); +end; + + +function ERR_ENGINE_set_default_DH(e: PENGINE): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_set_default_DH_procname); +end; + + +function ERR_ENGINE_set_default_RAND(e: PENGINE): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_set_default_RAND_procname); +end; + + +function ERR_ENGINE_set_default_ciphers(e: PENGINE): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_set_default_ciphers_procname); +end; + + +function ERR_ENGINE_set_default_digests(e: PENGINE): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_set_default_digests_procname); +end; + + +function ERR_ENGINE_set_default_pkey_meths(e: PENGINE): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_set_default_pkey_meths_procname); +end; + + +function ERR_ENGINE_set_default_pkey_asn1_meths(e: PENGINE): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_set_default_pkey_asn1_meths_procname); +end; + + + + ///* + // * The combination "set" - the flags are bitwise "OR"d from the + // * ENGINE_METHOD_*** defines above. As with the "ENGINE_register_complete()" + // * function, this function can result in unnecessary static linkage. If your + // * application requires only specific functionality, consider using more + // * selective functions. + // */ +function ERR_ENGINE_set_default(e: PENGINE; flags: TIdC_ULONG): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_set_default_procname); +end; + + + +procedure ERR_ENGINE_add_conf_module; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_add_conf_module_procname); +end; + + + + ///* Deprecated functions ... */ + ///* int ENGINE_clear_defaults(void); */ + // + //**************************/ + //* DYNAMIC ENGINE SUPPORT */ + //**************************/ + // + //* Binary/behaviour compatibility levels */ + //# define OSSL_DYNAMIC_VERSION (unsigned long)0x00030000 + //* + // * Binary versions older than this are too old for us (whether we're a loader + // * or a loadee) + // */ + //# define OSSL_DYNAMIC_OLDEST (unsigned long)0x00030000 + // + //* + // * When compiling an ENGINE entirely as an external shared library, loadable + // * by the "dynamic" ENGINE, these types are needed. The 'dynamic_fns' + // * structure type provides the calling application's (or library's) error + // * functionality and memory management function pointers to the loaded + // * library. These should be used/set in the loaded library code so that the + // * loading application's 'state' will be used/changed in all operations. The + // * 'static_state' pointer allows the loaded library to know if it shares the + // * same static data as the calling application (or library), and thus whether + // * these callbacks need to be set or not. + // */ + + + //# define IMPLEMENT_DYNAMIC_BIND_FN(fn) \ + // OPENSSL_EXPORT \ + // int bind_engine(ENGINE *e, const char *id, const dynamic_fns *fns); \ + // OPENSSL_EXPORT \ + // int bind_engine(ENGINE *e, const char *id, const dynamic_fns *fns) { \ + // if (ENGINE_get_static_state() == fns->static_state) goto skip_cbs; \ + // CRYPTO_set_mem_functions(fns->mem_fns.malloc_fn, \ + // fns->mem_fns.realloc_fn, \ + // fns->mem_fns.free_fn); \ + // skip_cbs: \ + // if (!fn(e, id)) return 0; \ + // return 1; } + // + //* + // * If the loading application (or library) and the loaded ENGINE library + // * share the same static data (eg. they're both dynamically linked to the + // * same libcrypto.so) we need a way to avoid trying to set system callbacks - + // * this would fail, and for the same reason that it's unnecessary to try. If + // * the loaded ENGINE has (or gets from through the loader) its own copy of + // * the libcrypto static data, we will need to set the callbacks. The easiest + // * way to detect this is to have a function that returns a pointer to some + // * static data and let the loading application and loaded ENGINE compare + // * their respective values. + // */ +function ERR_ENGINE_get_static_state: Pointer; +begin + EIdAPIFunctionNotPresent.RaiseException(ENGINE_get_static_state_procname); +end; + + + +{$WARN NO_RETVAL ON} + +procedure Load(const ADllHandle: TIdLibHandle; LibVersion: TIdC_UINT; const AFailed: TStringList); + +var FuncLoadError: boolean; + +begin + ENGINE_get_first := LoadLibFunction(ADllHandle, ENGINE_get_first_procname); + FuncLoadError := not assigned(ENGINE_get_first); + if FuncLoadError then + begin + {$if not defined(ENGINE_get_first_allownil)} + ENGINE_get_first := @ERR_ENGINE_get_first; + {$ifend} + {$if declared(ENGINE_get_first_introduced)} + if LibVersion < ENGINE_get_first_introduced then + begin + {$if declared(FC_ENGINE_get_first)} + ENGINE_get_first := @FC_ENGINE_get_first; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_get_first_removed)} + if ENGINE_get_first_removed <= LibVersion then + begin + {$if declared(_ENGINE_get_first)} + ENGINE_get_first := @_ENGINE_get_first; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_get_first_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_get_first'); + {$ifend} + end; + + + ENGINE_get_last := LoadLibFunction(ADllHandle, ENGINE_get_last_procname); + FuncLoadError := not assigned(ENGINE_get_last); + if FuncLoadError then + begin + {$if not defined(ENGINE_get_last_allownil)} + ENGINE_get_last := @ERR_ENGINE_get_last; + {$ifend} + {$if declared(ENGINE_get_last_introduced)} + if LibVersion < ENGINE_get_last_introduced then + begin + {$if declared(FC_ENGINE_get_last)} + ENGINE_get_last := @FC_ENGINE_get_last; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_get_last_removed)} + if ENGINE_get_last_removed <= LibVersion then + begin + {$if declared(_ENGINE_get_last)} + ENGINE_get_last := @_ENGINE_get_last; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_get_last_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_get_last'); + {$ifend} + end; + + + ENGINE_get_next := LoadLibFunction(ADllHandle, ENGINE_get_next_procname); + FuncLoadError := not assigned(ENGINE_get_next); + if FuncLoadError then + begin + {$if not defined(ENGINE_get_next_allownil)} + ENGINE_get_next := @ERR_ENGINE_get_next; + {$ifend} + {$if declared(ENGINE_get_next_introduced)} + if LibVersion < ENGINE_get_next_introduced then + begin + {$if declared(FC_ENGINE_get_next)} + ENGINE_get_next := @FC_ENGINE_get_next; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_get_next_removed)} + if ENGINE_get_next_removed <= LibVersion then + begin + {$if declared(_ENGINE_get_next)} + ENGINE_get_next := @_ENGINE_get_next; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_get_next_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_get_next'); + {$ifend} + end; + + + ENGINE_get_prev := LoadLibFunction(ADllHandle, ENGINE_get_prev_procname); + FuncLoadError := not assigned(ENGINE_get_prev); + if FuncLoadError then + begin + {$if not defined(ENGINE_get_prev_allownil)} + ENGINE_get_prev := @ERR_ENGINE_get_prev; + {$ifend} + {$if declared(ENGINE_get_prev_introduced)} + if LibVersion < ENGINE_get_prev_introduced then + begin + {$if declared(FC_ENGINE_get_prev)} + ENGINE_get_prev := @FC_ENGINE_get_prev; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_get_prev_removed)} + if ENGINE_get_prev_removed <= LibVersion then + begin + {$if declared(_ENGINE_get_prev)} + ENGINE_get_prev := @_ENGINE_get_prev; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_get_prev_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_get_prev'); + {$ifend} + end; + + + ENGINE_add := LoadLibFunction(ADllHandle, ENGINE_add_procname); + FuncLoadError := not assigned(ENGINE_add); + if FuncLoadError then + begin + {$if not defined(ENGINE_add_allownil)} + ENGINE_add := @ERR_ENGINE_add; + {$ifend} + {$if declared(ENGINE_add_introduced)} + if LibVersion < ENGINE_add_introduced then + begin + {$if declared(FC_ENGINE_add)} + ENGINE_add := @FC_ENGINE_add; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_add_removed)} + if ENGINE_add_removed <= LibVersion then + begin + {$if declared(_ENGINE_add)} + ENGINE_add := @_ENGINE_add; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_add_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_add'); + {$ifend} + end; + + + ENGINE_remove := LoadLibFunction(ADllHandle, ENGINE_remove_procname); + FuncLoadError := not assigned(ENGINE_remove); + if FuncLoadError then + begin + {$if not defined(ENGINE_remove_allownil)} + ENGINE_remove := @ERR_ENGINE_remove; + {$ifend} + {$if declared(ENGINE_remove_introduced)} + if LibVersion < ENGINE_remove_introduced then + begin + {$if declared(FC_ENGINE_remove)} + ENGINE_remove := @FC_ENGINE_remove; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_remove_removed)} + if ENGINE_remove_removed <= LibVersion then + begin + {$if declared(_ENGINE_remove)} + ENGINE_remove := @_ENGINE_remove; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_remove_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_remove'); + {$ifend} + end; + + + ENGINE_by_id := LoadLibFunction(ADllHandle, ENGINE_by_id_procname); + FuncLoadError := not assigned(ENGINE_by_id); + if FuncLoadError then + begin + {$if not defined(ENGINE_by_id_allownil)} + ENGINE_by_id := @ERR_ENGINE_by_id; + {$ifend} + {$if declared(ENGINE_by_id_introduced)} + if LibVersion < ENGINE_by_id_introduced then + begin + {$if declared(FC_ENGINE_by_id)} + ENGINE_by_id := @FC_ENGINE_by_id; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_by_id_removed)} + if ENGINE_by_id_removed <= LibVersion then + begin + {$if declared(_ENGINE_by_id)} + ENGINE_by_id := @_ENGINE_by_id; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_by_id_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_by_id'); + {$ifend} + end; + + + ENGINE_load_builtin_engines := LoadLibFunction(ADllHandle, ENGINE_load_builtin_engines_procname); + FuncLoadError := not assigned(ENGINE_load_builtin_engines); + if FuncLoadError then + begin + {$if not defined(ENGINE_load_builtin_engines_allownil)} + ENGINE_load_builtin_engines := @ERR_ENGINE_load_builtin_engines; + {$ifend} + {$if declared(ENGINE_load_builtin_engines_introduced)} + if LibVersion < ENGINE_load_builtin_engines_introduced then + begin + {$if declared(FC_ENGINE_load_builtin_engines)} + ENGINE_load_builtin_engines := @FC_ENGINE_load_builtin_engines; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_load_builtin_engines_removed)} + if ENGINE_load_builtin_engines_removed <= LibVersion then + begin + {$if declared(_ENGINE_load_builtin_engines)} + ENGINE_load_builtin_engines := @_ENGINE_load_builtin_engines; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_load_builtin_engines_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_load_builtin_engines'); + {$ifend} + end; + + + ENGINE_get_table_flags := LoadLibFunction(ADllHandle, ENGINE_get_table_flags_procname); + FuncLoadError := not assigned(ENGINE_get_table_flags); + if FuncLoadError then + begin + {$if not defined(ENGINE_get_table_flags_allownil)} + ENGINE_get_table_flags := @ERR_ENGINE_get_table_flags; + {$ifend} + {$if declared(ENGINE_get_table_flags_introduced)} + if LibVersion < ENGINE_get_table_flags_introduced then + begin + {$if declared(FC_ENGINE_get_table_flags)} + ENGINE_get_table_flags := @FC_ENGINE_get_table_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_get_table_flags_removed)} + if ENGINE_get_table_flags_removed <= LibVersion then + begin + {$if declared(_ENGINE_get_table_flags)} + ENGINE_get_table_flags := @_ENGINE_get_table_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_get_table_flags_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_get_table_flags'); + {$ifend} + end; + + + ENGINE_set_table_flags := LoadLibFunction(ADllHandle, ENGINE_set_table_flags_procname); + FuncLoadError := not assigned(ENGINE_set_table_flags); + if FuncLoadError then + begin + {$if not defined(ENGINE_set_table_flags_allownil)} + ENGINE_set_table_flags := @ERR_ENGINE_set_table_flags; + {$ifend} + {$if declared(ENGINE_set_table_flags_introduced)} + if LibVersion < ENGINE_set_table_flags_introduced then + begin + {$if declared(FC_ENGINE_set_table_flags)} + ENGINE_set_table_flags := @FC_ENGINE_set_table_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_set_table_flags_removed)} + if ENGINE_set_table_flags_removed <= LibVersion then + begin + {$if declared(_ENGINE_set_table_flags)} + ENGINE_set_table_flags := @_ENGINE_set_table_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_set_table_flags_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_set_table_flags'); + {$ifend} + end; + + + ENGINE_register_RSA := LoadLibFunction(ADllHandle, ENGINE_register_RSA_procname); + FuncLoadError := not assigned(ENGINE_register_RSA); + if FuncLoadError then + begin + {$if not defined(ENGINE_register_RSA_allownil)} + ENGINE_register_RSA := @ERR_ENGINE_register_RSA; + {$ifend} + {$if declared(ENGINE_register_RSA_introduced)} + if LibVersion < ENGINE_register_RSA_introduced then + begin + {$if declared(FC_ENGINE_register_RSA)} + ENGINE_register_RSA := @FC_ENGINE_register_RSA; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_register_RSA_removed)} + if ENGINE_register_RSA_removed <= LibVersion then + begin + {$if declared(_ENGINE_register_RSA)} + ENGINE_register_RSA := @_ENGINE_register_RSA; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_register_RSA_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_register_RSA'); + {$ifend} + end; + + + ENGINE_unregister_RSA := LoadLibFunction(ADllHandle, ENGINE_unregister_RSA_procname); + FuncLoadError := not assigned(ENGINE_unregister_RSA); + if FuncLoadError then + begin + {$if not defined(ENGINE_unregister_RSA_allownil)} + ENGINE_unregister_RSA := @ERR_ENGINE_unregister_RSA; + {$ifend} + {$if declared(ENGINE_unregister_RSA_introduced)} + if LibVersion < ENGINE_unregister_RSA_introduced then + begin + {$if declared(FC_ENGINE_unregister_RSA)} + ENGINE_unregister_RSA := @FC_ENGINE_unregister_RSA; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_unregister_RSA_removed)} + if ENGINE_unregister_RSA_removed <= LibVersion then + begin + {$if declared(_ENGINE_unregister_RSA)} + ENGINE_unregister_RSA := @_ENGINE_unregister_RSA; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_unregister_RSA_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_unregister_RSA'); + {$ifend} + end; + + + ENGINE_register_all_RSA := LoadLibFunction(ADllHandle, ENGINE_register_all_RSA_procname); + FuncLoadError := not assigned(ENGINE_register_all_RSA); + if FuncLoadError then + begin + {$if not defined(ENGINE_register_all_RSA_allownil)} + ENGINE_register_all_RSA := @ERR_ENGINE_register_all_RSA; + {$ifend} + {$if declared(ENGINE_register_all_RSA_introduced)} + if LibVersion < ENGINE_register_all_RSA_introduced then + begin + {$if declared(FC_ENGINE_register_all_RSA)} + ENGINE_register_all_RSA := @FC_ENGINE_register_all_RSA; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_register_all_RSA_removed)} + if ENGINE_register_all_RSA_removed <= LibVersion then + begin + {$if declared(_ENGINE_register_all_RSA)} + ENGINE_register_all_RSA := @_ENGINE_register_all_RSA; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_register_all_RSA_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_register_all_RSA'); + {$ifend} + end; + + + ENGINE_register_DSA := LoadLibFunction(ADllHandle, ENGINE_register_DSA_procname); + FuncLoadError := not assigned(ENGINE_register_DSA); + if FuncLoadError then + begin + {$if not defined(ENGINE_register_DSA_allownil)} + ENGINE_register_DSA := @ERR_ENGINE_register_DSA; + {$ifend} + {$if declared(ENGINE_register_DSA_introduced)} + if LibVersion < ENGINE_register_DSA_introduced then + begin + {$if declared(FC_ENGINE_register_DSA)} + ENGINE_register_DSA := @FC_ENGINE_register_DSA; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_register_DSA_removed)} + if ENGINE_register_DSA_removed <= LibVersion then + begin + {$if declared(_ENGINE_register_DSA)} + ENGINE_register_DSA := @_ENGINE_register_DSA; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_register_DSA_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_register_DSA'); + {$ifend} + end; + + + ENGINE_unregister_DSA := LoadLibFunction(ADllHandle, ENGINE_unregister_DSA_procname); + FuncLoadError := not assigned(ENGINE_unregister_DSA); + if FuncLoadError then + begin + {$if not defined(ENGINE_unregister_DSA_allownil)} + ENGINE_unregister_DSA := @ERR_ENGINE_unregister_DSA; + {$ifend} + {$if declared(ENGINE_unregister_DSA_introduced)} + if LibVersion < ENGINE_unregister_DSA_introduced then + begin + {$if declared(FC_ENGINE_unregister_DSA)} + ENGINE_unregister_DSA := @FC_ENGINE_unregister_DSA; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_unregister_DSA_removed)} + if ENGINE_unregister_DSA_removed <= LibVersion then + begin + {$if declared(_ENGINE_unregister_DSA)} + ENGINE_unregister_DSA := @_ENGINE_unregister_DSA; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_unregister_DSA_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_unregister_DSA'); + {$ifend} + end; + + + ENGINE_register_all_DSA := LoadLibFunction(ADllHandle, ENGINE_register_all_DSA_procname); + FuncLoadError := not assigned(ENGINE_register_all_DSA); + if FuncLoadError then + begin + {$if not defined(ENGINE_register_all_DSA_allownil)} + ENGINE_register_all_DSA := @ERR_ENGINE_register_all_DSA; + {$ifend} + {$if declared(ENGINE_register_all_DSA_introduced)} + if LibVersion < ENGINE_register_all_DSA_introduced then + begin + {$if declared(FC_ENGINE_register_all_DSA)} + ENGINE_register_all_DSA := @FC_ENGINE_register_all_DSA; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_register_all_DSA_removed)} + if ENGINE_register_all_DSA_removed <= LibVersion then + begin + {$if declared(_ENGINE_register_all_DSA)} + ENGINE_register_all_DSA := @_ENGINE_register_all_DSA; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_register_all_DSA_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_register_all_DSA'); + {$ifend} + end; + + + ENGINE_register_EC := LoadLibFunction(ADllHandle, ENGINE_register_EC_procname); + FuncLoadError := not assigned(ENGINE_register_EC); + if FuncLoadError then + begin + {$if not defined(ENGINE_register_EC_allownil)} + ENGINE_register_EC := @ERR_ENGINE_register_EC; + {$ifend} + {$if declared(ENGINE_register_EC_introduced)} + if LibVersion < ENGINE_register_EC_introduced then + begin + {$if declared(FC_ENGINE_register_EC)} + ENGINE_register_EC := @FC_ENGINE_register_EC; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_register_EC_removed)} + if ENGINE_register_EC_removed <= LibVersion then + begin + {$if declared(_ENGINE_register_EC)} + ENGINE_register_EC := @_ENGINE_register_EC; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_register_EC_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_register_EC'); + {$ifend} + end; + + + ENGINE_unregister_EC := LoadLibFunction(ADllHandle, ENGINE_unregister_EC_procname); + FuncLoadError := not assigned(ENGINE_unregister_EC); + if FuncLoadError then + begin + {$if not defined(ENGINE_unregister_EC_allownil)} + ENGINE_unregister_EC := @ERR_ENGINE_unregister_EC; + {$ifend} + {$if declared(ENGINE_unregister_EC_introduced)} + if LibVersion < ENGINE_unregister_EC_introduced then + begin + {$if declared(FC_ENGINE_unregister_EC)} + ENGINE_unregister_EC := @FC_ENGINE_unregister_EC; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_unregister_EC_removed)} + if ENGINE_unregister_EC_removed <= LibVersion then + begin + {$if declared(_ENGINE_unregister_EC)} + ENGINE_unregister_EC := @_ENGINE_unregister_EC; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_unregister_EC_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_unregister_EC'); + {$ifend} + end; + + + ENGINE_register_all_EC := LoadLibFunction(ADllHandle, ENGINE_register_all_EC_procname); + FuncLoadError := not assigned(ENGINE_register_all_EC); + if FuncLoadError then + begin + {$if not defined(ENGINE_register_all_EC_allownil)} + ENGINE_register_all_EC := @ERR_ENGINE_register_all_EC; + {$ifend} + {$if declared(ENGINE_register_all_EC_introduced)} + if LibVersion < ENGINE_register_all_EC_introduced then + begin + {$if declared(FC_ENGINE_register_all_EC)} + ENGINE_register_all_EC := @FC_ENGINE_register_all_EC; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_register_all_EC_removed)} + if ENGINE_register_all_EC_removed <= LibVersion then + begin + {$if declared(_ENGINE_register_all_EC)} + ENGINE_register_all_EC := @_ENGINE_register_all_EC; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_register_all_EC_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_register_all_EC'); + {$ifend} + end; + + + ENGINE_register_DH := LoadLibFunction(ADllHandle, ENGINE_register_DH_procname); + FuncLoadError := not assigned(ENGINE_register_DH); + if FuncLoadError then + begin + {$if not defined(ENGINE_register_DH_allownil)} + ENGINE_register_DH := @ERR_ENGINE_register_DH; + {$ifend} + {$if declared(ENGINE_register_DH_introduced)} + if LibVersion < ENGINE_register_DH_introduced then + begin + {$if declared(FC_ENGINE_register_DH)} + ENGINE_register_DH := @FC_ENGINE_register_DH; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_register_DH_removed)} + if ENGINE_register_DH_removed <= LibVersion then + begin + {$if declared(_ENGINE_register_DH)} + ENGINE_register_DH := @_ENGINE_register_DH; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_register_DH_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_register_DH'); + {$ifend} + end; + + + ENGINE_unregister_DH := LoadLibFunction(ADllHandle, ENGINE_unregister_DH_procname); + FuncLoadError := not assigned(ENGINE_unregister_DH); + if FuncLoadError then + begin + {$if not defined(ENGINE_unregister_DH_allownil)} + ENGINE_unregister_DH := @ERR_ENGINE_unregister_DH; + {$ifend} + {$if declared(ENGINE_unregister_DH_introduced)} + if LibVersion < ENGINE_unregister_DH_introduced then + begin + {$if declared(FC_ENGINE_unregister_DH)} + ENGINE_unregister_DH := @FC_ENGINE_unregister_DH; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_unregister_DH_removed)} + if ENGINE_unregister_DH_removed <= LibVersion then + begin + {$if declared(_ENGINE_unregister_DH)} + ENGINE_unregister_DH := @_ENGINE_unregister_DH; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_unregister_DH_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_unregister_DH'); + {$ifend} + end; + + + ENGINE_register_all_DH := LoadLibFunction(ADllHandle, ENGINE_register_all_DH_procname); + FuncLoadError := not assigned(ENGINE_register_all_DH); + if FuncLoadError then + begin + {$if not defined(ENGINE_register_all_DH_allownil)} + ENGINE_register_all_DH := @ERR_ENGINE_register_all_DH; + {$ifend} + {$if declared(ENGINE_register_all_DH_introduced)} + if LibVersion < ENGINE_register_all_DH_introduced then + begin + {$if declared(FC_ENGINE_register_all_DH)} + ENGINE_register_all_DH := @FC_ENGINE_register_all_DH; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_register_all_DH_removed)} + if ENGINE_register_all_DH_removed <= LibVersion then + begin + {$if declared(_ENGINE_register_all_DH)} + ENGINE_register_all_DH := @_ENGINE_register_all_DH; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_register_all_DH_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_register_all_DH'); + {$ifend} + end; + + + ENGINE_register_RAND := LoadLibFunction(ADllHandle, ENGINE_register_RAND_procname); + FuncLoadError := not assigned(ENGINE_register_RAND); + if FuncLoadError then + begin + {$if not defined(ENGINE_register_RAND_allownil)} + ENGINE_register_RAND := @ERR_ENGINE_register_RAND; + {$ifend} + {$if declared(ENGINE_register_RAND_introduced)} + if LibVersion < ENGINE_register_RAND_introduced then + begin + {$if declared(FC_ENGINE_register_RAND)} + ENGINE_register_RAND := @FC_ENGINE_register_RAND; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_register_RAND_removed)} + if ENGINE_register_RAND_removed <= LibVersion then + begin + {$if declared(_ENGINE_register_RAND)} + ENGINE_register_RAND := @_ENGINE_register_RAND; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_register_RAND_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_register_RAND'); + {$ifend} + end; + + + ENGINE_unregister_RAND := LoadLibFunction(ADllHandle, ENGINE_unregister_RAND_procname); + FuncLoadError := not assigned(ENGINE_unregister_RAND); + if FuncLoadError then + begin + {$if not defined(ENGINE_unregister_RAND_allownil)} + ENGINE_unregister_RAND := @ERR_ENGINE_unregister_RAND; + {$ifend} + {$if declared(ENGINE_unregister_RAND_introduced)} + if LibVersion < ENGINE_unregister_RAND_introduced then + begin + {$if declared(FC_ENGINE_unregister_RAND)} + ENGINE_unregister_RAND := @FC_ENGINE_unregister_RAND; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_unregister_RAND_removed)} + if ENGINE_unregister_RAND_removed <= LibVersion then + begin + {$if declared(_ENGINE_unregister_RAND)} + ENGINE_unregister_RAND := @_ENGINE_unregister_RAND; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_unregister_RAND_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_unregister_RAND'); + {$ifend} + end; + + + ENGINE_register_all_RAND := LoadLibFunction(ADllHandle, ENGINE_register_all_RAND_procname); + FuncLoadError := not assigned(ENGINE_register_all_RAND); + if FuncLoadError then + begin + {$if not defined(ENGINE_register_all_RAND_allownil)} + ENGINE_register_all_RAND := @ERR_ENGINE_register_all_RAND; + {$ifend} + {$if declared(ENGINE_register_all_RAND_introduced)} + if LibVersion < ENGINE_register_all_RAND_introduced then + begin + {$if declared(FC_ENGINE_register_all_RAND)} + ENGINE_register_all_RAND := @FC_ENGINE_register_all_RAND; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_register_all_RAND_removed)} + if ENGINE_register_all_RAND_removed <= LibVersion then + begin + {$if declared(_ENGINE_register_all_RAND)} + ENGINE_register_all_RAND := @_ENGINE_register_all_RAND; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_register_all_RAND_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_register_all_RAND'); + {$ifend} + end; + + + ENGINE_register_ciphers := LoadLibFunction(ADllHandle, ENGINE_register_ciphers_procname); + FuncLoadError := not assigned(ENGINE_register_ciphers); + if FuncLoadError then + begin + {$if not defined(ENGINE_register_ciphers_allownil)} + ENGINE_register_ciphers := @ERR_ENGINE_register_ciphers; + {$ifend} + {$if declared(ENGINE_register_ciphers_introduced)} + if LibVersion < ENGINE_register_ciphers_introduced then + begin + {$if declared(FC_ENGINE_register_ciphers)} + ENGINE_register_ciphers := @FC_ENGINE_register_ciphers; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_register_ciphers_removed)} + if ENGINE_register_ciphers_removed <= LibVersion then + begin + {$if declared(_ENGINE_register_ciphers)} + ENGINE_register_ciphers := @_ENGINE_register_ciphers; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_register_ciphers_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_register_ciphers'); + {$ifend} + end; + + + ENGINE_unregister_ciphers := LoadLibFunction(ADllHandle, ENGINE_unregister_ciphers_procname); + FuncLoadError := not assigned(ENGINE_unregister_ciphers); + if FuncLoadError then + begin + {$if not defined(ENGINE_unregister_ciphers_allownil)} + ENGINE_unregister_ciphers := @ERR_ENGINE_unregister_ciphers; + {$ifend} + {$if declared(ENGINE_unregister_ciphers_introduced)} + if LibVersion < ENGINE_unregister_ciphers_introduced then + begin + {$if declared(FC_ENGINE_unregister_ciphers)} + ENGINE_unregister_ciphers := @FC_ENGINE_unregister_ciphers; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_unregister_ciphers_removed)} + if ENGINE_unregister_ciphers_removed <= LibVersion then + begin + {$if declared(_ENGINE_unregister_ciphers)} + ENGINE_unregister_ciphers := @_ENGINE_unregister_ciphers; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_unregister_ciphers_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_unregister_ciphers'); + {$ifend} + end; + + + ENGINE_register_all_ciphers := LoadLibFunction(ADllHandle, ENGINE_register_all_ciphers_procname); + FuncLoadError := not assigned(ENGINE_register_all_ciphers); + if FuncLoadError then + begin + {$if not defined(ENGINE_register_all_ciphers_allownil)} + ENGINE_register_all_ciphers := @ERR_ENGINE_register_all_ciphers; + {$ifend} + {$if declared(ENGINE_register_all_ciphers_introduced)} + if LibVersion < ENGINE_register_all_ciphers_introduced then + begin + {$if declared(FC_ENGINE_register_all_ciphers)} + ENGINE_register_all_ciphers := @FC_ENGINE_register_all_ciphers; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_register_all_ciphers_removed)} + if ENGINE_register_all_ciphers_removed <= LibVersion then + begin + {$if declared(_ENGINE_register_all_ciphers)} + ENGINE_register_all_ciphers := @_ENGINE_register_all_ciphers; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_register_all_ciphers_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_register_all_ciphers'); + {$ifend} + end; + + + ENGINE_register_digests := LoadLibFunction(ADllHandle, ENGINE_register_digests_procname); + FuncLoadError := not assigned(ENGINE_register_digests); + if FuncLoadError then + begin + {$if not defined(ENGINE_register_digests_allownil)} + ENGINE_register_digests := @ERR_ENGINE_register_digests; + {$ifend} + {$if declared(ENGINE_register_digests_introduced)} + if LibVersion < ENGINE_register_digests_introduced then + begin + {$if declared(FC_ENGINE_register_digests)} + ENGINE_register_digests := @FC_ENGINE_register_digests; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_register_digests_removed)} + if ENGINE_register_digests_removed <= LibVersion then + begin + {$if declared(_ENGINE_register_digests)} + ENGINE_register_digests := @_ENGINE_register_digests; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_register_digests_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_register_digests'); + {$ifend} + end; + + + ENGINE_unregister_digests := LoadLibFunction(ADllHandle, ENGINE_unregister_digests_procname); + FuncLoadError := not assigned(ENGINE_unregister_digests); + if FuncLoadError then + begin + {$if not defined(ENGINE_unregister_digests_allownil)} + ENGINE_unregister_digests := @ERR_ENGINE_unregister_digests; + {$ifend} + {$if declared(ENGINE_unregister_digests_introduced)} + if LibVersion < ENGINE_unregister_digests_introduced then + begin + {$if declared(FC_ENGINE_unregister_digests)} + ENGINE_unregister_digests := @FC_ENGINE_unregister_digests; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_unregister_digests_removed)} + if ENGINE_unregister_digests_removed <= LibVersion then + begin + {$if declared(_ENGINE_unregister_digests)} + ENGINE_unregister_digests := @_ENGINE_unregister_digests; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_unregister_digests_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_unregister_digests'); + {$ifend} + end; + + + ENGINE_register_all_digests := LoadLibFunction(ADllHandle, ENGINE_register_all_digests_procname); + FuncLoadError := not assigned(ENGINE_register_all_digests); + if FuncLoadError then + begin + {$if not defined(ENGINE_register_all_digests_allownil)} + ENGINE_register_all_digests := @ERR_ENGINE_register_all_digests; + {$ifend} + {$if declared(ENGINE_register_all_digests_introduced)} + if LibVersion < ENGINE_register_all_digests_introduced then + begin + {$if declared(FC_ENGINE_register_all_digests)} + ENGINE_register_all_digests := @FC_ENGINE_register_all_digests; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_register_all_digests_removed)} + if ENGINE_register_all_digests_removed <= LibVersion then + begin + {$if declared(_ENGINE_register_all_digests)} + ENGINE_register_all_digests := @_ENGINE_register_all_digests; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_register_all_digests_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_register_all_digests'); + {$ifend} + end; + + + ENGINE_register_pkey_meths := LoadLibFunction(ADllHandle, ENGINE_register_pkey_meths_procname); + FuncLoadError := not assigned(ENGINE_register_pkey_meths); + if FuncLoadError then + begin + {$if not defined(ENGINE_register_pkey_meths_allownil)} + ENGINE_register_pkey_meths := @ERR_ENGINE_register_pkey_meths; + {$ifend} + {$if declared(ENGINE_register_pkey_meths_introduced)} + if LibVersion < ENGINE_register_pkey_meths_introduced then + begin + {$if declared(FC_ENGINE_register_pkey_meths)} + ENGINE_register_pkey_meths := @FC_ENGINE_register_pkey_meths; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_register_pkey_meths_removed)} + if ENGINE_register_pkey_meths_removed <= LibVersion then + begin + {$if declared(_ENGINE_register_pkey_meths)} + ENGINE_register_pkey_meths := @_ENGINE_register_pkey_meths; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_register_pkey_meths_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_register_pkey_meths'); + {$ifend} + end; + + + ENGINE_unregister_pkey_meths := LoadLibFunction(ADllHandle, ENGINE_unregister_pkey_meths_procname); + FuncLoadError := not assigned(ENGINE_unregister_pkey_meths); + if FuncLoadError then + begin + {$if not defined(ENGINE_unregister_pkey_meths_allownil)} + ENGINE_unregister_pkey_meths := @ERR_ENGINE_unregister_pkey_meths; + {$ifend} + {$if declared(ENGINE_unregister_pkey_meths_introduced)} + if LibVersion < ENGINE_unregister_pkey_meths_introduced then + begin + {$if declared(FC_ENGINE_unregister_pkey_meths)} + ENGINE_unregister_pkey_meths := @FC_ENGINE_unregister_pkey_meths; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_unregister_pkey_meths_removed)} + if ENGINE_unregister_pkey_meths_removed <= LibVersion then + begin + {$if declared(_ENGINE_unregister_pkey_meths)} + ENGINE_unregister_pkey_meths := @_ENGINE_unregister_pkey_meths; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_unregister_pkey_meths_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_unregister_pkey_meths'); + {$ifend} + end; + + + ENGINE_register_all_pkey_meths := LoadLibFunction(ADllHandle, ENGINE_register_all_pkey_meths_procname); + FuncLoadError := not assigned(ENGINE_register_all_pkey_meths); + if FuncLoadError then + begin + {$if not defined(ENGINE_register_all_pkey_meths_allownil)} + ENGINE_register_all_pkey_meths := @ERR_ENGINE_register_all_pkey_meths; + {$ifend} + {$if declared(ENGINE_register_all_pkey_meths_introduced)} + if LibVersion < ENGINE_register_all_pkey_meths_introduced then + begin + {$if declared(FC_ENGINE_register_all_pkey_meths)} + ENGINE_register_all_pkey_meths := @FC_ENGINE_register_all_pkey_meths; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_register_all_pkey_meths_removed)} + if ENGINE_register_all_pkey_meths_removed <= LibVersion then + begin + {$if declared(_ENGINE_register_all_pkey_meths)} + ENGINE_register_all_pkey_meths := @_ENGINE_register_all_pkey_meths; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_register_all_pkey_meths_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_register_all_pkey_meths'); + {$ifend} + end; + + + ENGINE_register_pkey_asn1_meths := LoadLibFunction(ADllHandle, ENGINE_register_pkey_asn1_meths_procname); + FuncLoadError := not assigned(ENGINE_register_pkey_asn1_meths); + if FuncLoadError then + begin + {$if not defined(ENGINE_register_pkey_asn1_meths_allownil)} + ENGINE_register_pkey_asn1_meths := @ERR_ENGINE_register_pkey_asn1_meths; + {$ifend} + {$if declared(ENGINE_register_pkey_asn1_meths_introduced)} + if LibVersion < ENGINE_register_pkey_asn1_meths_introduced then + begin + {$if declared(FC_ENGINE_register_pkey_asn1_meths)} + ENGINE_register_pkey_asn1_meths := @FC_ENGINE_register_pkey_asn1_meths; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_register_pkey_asn1_meths_removed)} + if ENGINE_register_pkey_asn1_meths_removed <= LibVersion then + begin + {$if declared(_ENGINE_register_pkey_asn1_meths)} + ENGINE_register_pkey_asn1_meths := @_ENGINE_register_pkey_asn1_meths; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_register_pkey_asn1_meths_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_register_pkey_asn1_meths'); + {$ifend} + end; + + + ENGINE_unregister_pkey_asn1_meths := LoadLibFunction(ADllHandle, ENGINE_unregister_pkey_asn1_meths_procname); + FuncLoadError := not assigned(ENGINE_unregister_pkey_asn1_meths); + if FuncLoadError then + begin + {$if not defined(ENGINE_unregister_pkey_asn1_meths_allownil)} + ENGINE_unregister_pkey_asn1_meths := @ERR_ENGINE_unregister_pkey_asn1_meths; + {$ifend} + {$if declared(ENGINE_unregister_pkey_asn1_meths_introduced)} + if LibVersion < ENGINE_unregister_pkey_asn1_meths_introduced then + begin + {$if declared(FC_ENGINE_unregister_pkey_asn1_meths)} + ENGINE_unregister_pkey_asn1_meths := @FC_ENGINE_unregister_pkey_asn1_meths; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_unregister_pkey_asn1_meths_removed)} + if ENGINE_unregister_pkey_asn1_meths_removed <= LibVersion then + begin + {$if declared(_ENGINE_unregister_pkey_asn1_meths)} + ENGINE_unregister_pkey_asn1_meths := @_ENGINE_unregister_pkey_asn1_meths; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_unregister_pkey_asn1_meths_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_unregister_pkey_asn1_meths'); + {$ifend} + end; + + + ENGINE_register_all_pkey_asn1_meths := LoadLibFunction(ADllHandle, ENGINE_register_all_pkey_asn1_meths_procname); + FuncLoadError := not assigned(ENGINE_register_all_pkey_asn1_meths); + if FuncLoadError then + begin + {$if not defined(ENGINE_register_all_pkey_asn1_meths_allownil)} + ENGINE_register_all_pkey_asn1_meths := @ERR_ENGINE_register_all_pkey_asn1_meths; + {$ifend} + {$if declared(ENGINE_register_all_pkey_asn1_meths_introduced)} + if LibVersion < ENGINE_register_all_pkey_asn1_meths_introduced then + begin + {$if declared(FC_ENGINE_register_all_pkey_asn1_meths)} + ENGINE_register_all_pkey_asn1_meths := @FC_ENGINE_register_all_pkey_asn1_meths; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_register_all_pkey_asn1_meths_removed)} + if ENGINE_register_all_pkey_asn1_meths_removed <= LibVersion then + begin + {$if declared(_ENGINE_register_all_pkey_asn1_meths)} + ENGINE_register_all_pkey_asn1_meths := @_ENGINE_register_all_pkey_asn1_meths; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_register_all_pkey_asn1_meths_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_register_all_pkey_asn1_meths'); + {$ifend} + end; + + + ENGINE_register_complete := LoadLibFunction(ADllHandle, ENGINE_register_complete_procname); + FuncLoadError := not assigned(ENGINE_register_complete); + if FuncLoadError then + begin + {$if not defined(ENGINE_register_complete_allownil)} + ENGINE_register_complete := @ERR_ENGINE_register_complete; + {$ifend} + {$if declared(ENGINE_register_complete_introduced)} + if LibVersion < ENGINE_register_complete_introduced then + begin + {$if declared(FC_ENGINE_register_complete)} + ENGINE_register_complete := @FC_ENGINE_register_complete; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_register_complete_removed)} + if ENGINE_register_complete_removed <= LibVersion then + begin + {$if declared(_ENGINE_register_complete)} + ENGINE_register_complete := @_ENGINE_register_complete; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_register_complete_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_register_complete'); + {$ifend} + end; + + + ENGINE_register_all_complete := LoadLibFunction(ADllHandle, ENGINE_register_all_complete_procname); + FuncLoadError := not assigned(ENGINE_register_all_complete); + if FuncLoadError then + begin + {$if not defined(ENGINE_register_all_complete_allownil)} + ENGINE_register_all_complete := @ERR_ENGINE_register_all_complete; + {$ifend} + {$if declared(ENGINE_register_all_complete_introduced)} + if LibVersion < ENGINE_register_all_complete_introduced then + begin + {$if declared(FC_ENGINE_register_all_complete)} + ENGINE_register_all_complete := @FC_ENGINE_register_all_complete; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_register_all_complete_removed)} + if ENGINE_register_all_complete_removed <= LibVersion then + begin + {$if declared(_ENGINE_register_all_complete)} + ENGINE_register_all_complete := @_ENGINE_register_all_complete; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_register_all_complete_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_register_all_complete'); + {$ifend} + end; + + + ENGINE_ctrl := LoadLibFunction(ADllHandle, ENGINE_ctrl_procname); + FuncLoadError := not assigned(ENGINE_ctrl); + if FuncLoadError then + begin + {$if not defined(ENGINE_ctrl_allownil)} + ENGINE_ctrl := @ERR_ENGINE_ctrl; + {$ifend} + {$if declared(ENGINE_ctrl_introduced)} + if LibVersion < ENGINE_ctrl_introduced then + begin + {$if declared(FC_ENGINE_ctrl)} + ENGINE_ctrl := @FC_ENGINE_ctrl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_ctrl_removed)} + if ENGINE_ctrl_removed <= LibVersion then + begin + {$if declared(_ENGINE_ctrl)} + ENGINE_ctrl := @_ENGINE_ctrl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_ctrl_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_ctrl'); + {$ifend} + end; + + + ENGINE_cmd_is_executable := LoadLibFunction(ADllHandle, ENGINE_cmd_is_executable_procname); + FuncLoadError := not assigned(ENGINE_cmd_is_executable); + if FuncLoadError then + begin + {$if not defined(ENGINE_cmd_is_executable_allownil)} + ENGINE_cmd_is_executable := @ERR_ENGINE_cmd_is_executable; + {$ifend} + {$if declared(ENGINE_cmd_is_executable_introduced)} + if LibVersion < ENGINE_cmd_is_executable_introduced then + begin + {$if declared(FC_ENGINE_cmd_is_executable)} + ENGINE_cmd_is_executable := @FC_ENGINE_cmd_is_executable; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_cmd_is_executable_removed)} + if ENGINE_cmd_is_executable_removed <= LibVersion then + begin + {$if declared(_ENGINE_cmd_is_executable)} + ENGINE_cmd_is_executable := @_ENGINE_cmd_is_executable; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_cmd_is_executable_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_cmd_is_executable'); + {$ifend} + end; + + + ENGINE_ctrl_cmd := LoadLibFunction(ADllHandle, ENGINE_ctrl_cmd_procname); + FuncLoadError := not assigned(ENGINE_ctrl_cmd); + if FuncLoadError then + begin + {$if not defined(ENGINE_ctrl_cmd_allownil)} + ENGINE_ctrl_cmd := @ERR_ENGINE_ctrl_cmd; + {$ifend} + {$if declared(ENGINE_ctrl_cmd_introduced)} + if LibVersion < ENGINE_ctrl_cmd_introduced then + begin + {$if declared(FC_ENGINE_ctrl_cmd)} + ENGINE_ctrl_cmd := @FC_ENGINE_ctrl_cmd; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_ctrl_cmd_removed)} + if ENGINE_ctrl_cmd_removed <= LibVersion then + begin + {$if declared(_ENGINE_ctrl_cmd)} + ENGINE_ctrl_cmd := @_ENGINE_ctrl_cmd; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_ctrl_cmd_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_ctrl_cmd'); + {$ifend} + end; + + + ENGINE_ctrl_cmd_string := LoadLibFunction(ADllHandle, ENGINE_ctrl_cmd_string_procname); + FuncLoadError := not assigned(ENGINE_ctrl_cmd_string); + if FuncLoadError then + begin + {$if not defined(ENGINE_ctrl_cmd_string_allownil)} + ENGINE_ctrl_cmd_string := @ERR_ENGINE_ctrl_cmd_string; + {$ifend} + {$if declared(ENGINE_ctrl_cmd_string_introduced)} + if LibVersion < ENGINE_ctrl_cmd_string_introduced then + begin + {$if declared(FC_ENGINE_ctrl_cmd_string)} + ENGINE_ctrl_cmd_string := @FC_ENGINE_ctrl_cmd_string; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_ctrl_cmd_string_removed)} + if ENGINE_ctrl_cmd_string_removed <= LibVersion then + begin + {$if declared(_ENGINE_ctrl_cmd_string)} + ENGINE_ctrl_cmd_string := @_ENGINE_ctrl_cmd_string; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_ctrl_cmd_string_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_ctrl_cmd_string'); + {$ifend} + end; + + + ENGINE_new := LoadLibFunction(ADllHandle, ENGINE_new_procname); + FuncLoadError := not assigned(ENGINE_new); + if FuncLoadError then + begin + {$if not defined(ENGINE_new_allownil)} + ENGINE_new := @ERR_ENGINE_new; + {$ifend} + {$if declared(ENGINE_new_introduced)} + if LibVersion < ENGINE_new_introduced then + begin + {$if declared(FC_ENGINE_new)} + ENGINE_new := @FC_ENGINE_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_new_removed)} + if ENGINE_new_removed <= LibVersion then + begin + {$if declared(_ENGINE_new)} + ENGINE_new := @_ENGINE_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_new_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_new'); + {$ifend} + end; + + + ENGINE_free := LoadLibFunction(ADllHandle, ENGINE_free_procname); + FuncLoadError := not assigned(ENGINE_free); + if FuncLoadError then + begin + {$if not defined(ENGINE_free_allownil)} + ENGINE_free := @ERR_ENGINE_free; + {$ifend} + {$if declared(ENGINE_free_introduced)} + if LibVersion < ENGINE_free_introduced then + begin + {$if declared(FC_ENGINE_free)} + ENGINE_free := @FC_ENGINE_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_free_removed)} + if ENGINE_free_removed <= LibVersion then + begin + {$if declared(_ENGINE_free)} + ENGINE_free := @_ENGINE_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_free_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_free'); + {$ifend} + end; + + + ENGINE_up_ref := LoadLibFunction(ADllHandle, ENGINE_up_ref_procname); + FuncLoadError := not assigned(ENGINE_up_ref); + if FuncLoadError then + begin + {$if not defined(ENGINE_up_ref_allownil)} + ENGINE_up_ref := @ERR_ENGINE_up_ref; + {$ifend} + {$if declared(ENGINE_up_ref_introduced)} + if LibVersion < ENGINE_up_ref_introduced then + begin + {$if declared(FC_ENGINE_up_ref)} + ENGINE_up_ref := @FC_ENGINE_up_ref; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_up_ref_removed)} + if ENGINE_up_ref_removed <= LibVersion then + begin + {$if declared(_ENGINE_up_ref)} + ENGINE_up_ref := @_ENGINE_up_ref; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_up_ref_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_up_ref'); + {$ifend} + end; + + + ENGINE_set_id := LoadLibFunction(ADllHandle, ENGINE_set_id_procname); + FuncLoadError := not assigned(ENGINE_set_id); + if FuncLoadError then + begin + {$if not defined(ENGINE_set_id_allownil)} + ENGINE_set_id := @ERR_ENGINE_set_id; + {$ifend} + {$if declared(ENGINE_set_id_introduced)} + if LibVersion < ENGINE_set_id_introduced then + begin + {$if declared(FC_ENGINE_set_id)} + ENGINE_set_id := @FC_ENGINE_set_id; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_set_id_removed)} + if ENGINE_set_id_removed <= LibVersion then + begin + {$if declared(_ENGINE_set_id)} + ENGINE_set_id := @_ENGINE_set_id; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_set_id_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_set_id'); + {$ifend} + end; + + + ENGINE_set_name := LoadLibFunction(ADllHandle, ENGINE_set_name_procname); + FuncLoadError := not assigned(ENGINE_set_name); + if FuncLoadError then + begin + {$if not defined(ENGINE_set_name_allownil)} + ENGINE_set_name := @ERR_ENGINE_set_name; + {$ifend} + {$if declared(ENGINE_set_name_introduced)} + if LibVersion < ENGINE_set_name_introduced then + begin + {$if declared(FC_ENGINE_set_name)} + ENGINE_set_name := @FC_ENGINE_set_name; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_set_name_removed)} + if ENGINE_set_name_removed <= LibVersion then + begin + {$if declared(_ENGINE_set_name)} + ENGINE_set_name := @_ENGINE_set_name; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_set_name_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_set_name'); + {$ifend} + end; + + + ENGINE_set_RSA := LoadLibFunction(ADllHandle, ENGINE_set_RSA_procname); + FuncLoadError := not assigned(ENGINE_set_RSA); + if FuncLoadError then + begin + {$if not defined(ENGINE_set_RSA_allownil)} + ENGINE_set_RSA := @ERR_ENGINE_set_RSA; + {$ifend} + {$if declared(ENGINE_set_RSA_introduced)} + if LibVersion < ENGINE_set_RSA_introduced then + begin + {$if declared(FC_ENGINE_set_RSA)} + ENGINE_set_RSA := @FC_ENGINE_set_RSA; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_set_RSA_removed)} + if ENGINE_set_RSA_removed <= LibVersion then + begin + {$if declared(_ENGINE_set_RSA)} + ENGINE_set_RSA := @_ENGINE_set_RSA; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_set_RSA_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_set_RSA'); + {$ifend} + end; + + + ENGINE_set_DSA := LoadLibFunction(ADllHandle, ENGINE_set_DSA_procname); + FuncLoadError := not assigned(ENGINE_set_DSA); + if FuncLoadError then + begin + {$if not defined(ENGINE_set_DSA_allownil)} + ENGINE_set_DSA := @ERR_ENGINE_set_DSA; + {$ifend} + {$if declared(ENGINE_set_DSA_introduced)} + if LibVersion < ENGINE_set_DSA_introduced then + begin + {$if declared(FC_ENGINE_set_DSA)} + ENGINE_set_DSA := @FC_ENGINE_set_DSA; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_set_DSA_removed)} + if ENGINE_set_DSA_removed <= LibVersion then + begin + {$if declared(_ENGINE_set_DSA)} + ENGINE_set_DSA := @_ENGINE_set_DSA; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_set_DSA_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_set_DSA'); + {$ifend} + end; + + + ENGINE_set_EC := LoadLibFunction(ADllHandle, ENGINE_set_EC_procname); + FuncLoadError := not assigned(ENGINE_set_EC); + if FuncLoadError then + begin + {$if not defined(ENGINE_set_EC_allownil)} + ENGINE_set_EC := @ERR_ENGINE_set_EC; + {$ifend} + {$if declared(ENGINE_set_EC_introduced)} + if LibVersion < ENGINE_set_EC_introduced then + begin + {$if declared(FC_ENGINE_set_EC)} + ENGINE_set_EC := @FC_ENGINE_set_EC; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_set_EC_removed)} + if ENGINE_set_EC_removed <= LibVersion then + begin + {$if declared(_ENGINE_set_EC)} + ENGINE_set_EC := @_ENGINE_set_EC; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_set_EC_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_set_EC'); + {$ifend} + end; + + + ENGINE_set_DH := LoadLibFunction(ADllHandle, ENGINE_set_DH_procname); + FuncLoadError := not assigned(ENGINE_set_DH); + if FuncLoadError then + begin + {$if not defined(ENGINE_set_DH_allownil)} + ENGINE_set_DH := @ERR_ENGINE_set_DH; + {$ifend} + {$if declared(ENGINE_set_DH_introduced)} + if LibVersion < ENGINE_set_DH_introduced then + begin + {$if declared(FC_ENGINE_set_DH)} + ENGINE_set_DH := @FC_ENGINE_set_DH; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_set_DH_removed)} + if ENGINE_set_DH_removed <= LibVersion then + begin + {$if declared(_ENGINE_set_DH)} + ENGINE_set_DH := @_ENGINE_set_DH; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_set_DH_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_set_DH'); + {$ifend} + end; + + + ENGINE_set_RAND := LoadLibFunction(ADllHandle, ENGINE_set_RAND_procname); + FuncLoadError := not assigned(ENGINE_set_RAND); + if FuncLoadError then + begin + {$if not defined(ENGINE_set_RAND_allownil)} + ENGINE_set_RAND := @ERR_ENGINE_set_RAND; + {$ifend} + {$if declared(ENGINE_set_RAND_introduced)} + if LibVersion < ENGINE_set_RAND_introduced then + begin + {$if declared(FC_ENGINE_set_RAND)} + ENGINE_set_RAND := @FC_ENGINE_set_RAND; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_set_RAND_removed)} + if ENGINE_set_RAND_removed <= LibVersion then + begin + {$if declared(_ENGINE_set_RAND)} + ENGINE_set_RAND := @_ENGINE_set_RAND; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_set_RAND_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_set_RAND'); + {$ifend} + end; + + + ENGINE_set_destroy_function := LoadLibFunction(ADllHandle, ENGINE_set_destroy_function_procname); + FuncLoadError := not assigned(ENGINE_set_destroy_function); + if FuncLoadError then + begin + {$if not defined(ENGINE_set_destroy_function_allownil)} + ENGINE_set_destroy_function := @ERR_ENGINE_set_destroy_function; + {$ifend} + {$if declared(ENGINE_set_destroy_function_introduced)} + if LibVersion < ENGINE_set_destroy_function_introduced then + begin + {$if declared(FC_ENGINE_set_destroy_function)} + ENGINE_set_destroy_function := @FC_ENGINE_set_destroy_function; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_set_destroy_function_removed)} + if ENGINE_set_destroy_function_removed <= LibVersion then + begin + {$if declared(_ENGINE_set_destroy_function)} + ENGINE_set_destroy_function := @_ENGINE_set_destroy_function; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_set_destroy_function_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_set_destroy_function'); + {$ifend} + end; + + + ENGINE_set_init_function := LoadLibFunction(ADllHandle, ENGINE_set_init_function_procname); + FuncLoadError := not assigned(ENGINE_set_init_function); + if FuncLoadError then + begin + {$if not defined(ENGINE_set_init_function_allownil)} + ENGINE_set_init_function := @ERR_ENGINE_set_init_function; + {$ifend} + {$if declared(ENGINE_set_init_function_introduced)} + if LibVersion < ENGINE_set_init_function_introduced then + begin + {$if declared(FC_ENGINE_set_init_function)} + ENGINE_set_init_function := @FC_ENGINE_set_init_function; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_set_init_function_removed)} + if ENGINE_set_init_function_removed <= LibVersion then + begin + {$if declared(_ENGINE_set_init_function)} + ENGINE_set_init_function := @_ENGINE_set_init_function; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_set_init_function_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_set_init_function'); + {$ifend} + end; + + + ENGINE_set_finish_function := LoadLibFunction(ADllHandle, ENGINE_set_finish_function_procname); + FuncLoadError := not assigned(ENGINE_set_finish_function); + if FuncLoadError then + begin + {$if not defined(ENGINE_set_finish_function_allownil)} + ENGINE_set_finish_function := @ERR_ENGINE_set_finish_function; + {$ifend} + {$if declared(ENGINE_set_finish_function_introduced)} + if LibVersion < ENGINE_set_finish_function_introduced then + begin + {$if declared(FC_ENGINE_set_finish_function)} + ENGINE_set_finish_function := @FC_ENGINE_set_finish_function; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_set_finish_function_removed)} + if ENGINE_set_finish_function_removed <= LibVersion then + begin + {$if declared(_ENGINE_set_finish_function)} + ENGINE_set_finish_function := @_ENGINE_set_finish_function; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_set_finish_function_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_set_finish_function'); + {$ifend} + end; + + + ENGINE_set_ctrl_function := LoadLibFunction(ADllHandle, ENGINE_set_ctrl_function_procname); + FuncLoadError := not assigned(ENGINE_set_ctrl_function); + if FuncLoadError then + begin + {$if not defined(ENGINE_set_ctrl_function_allownil)} + ENGINE_set_ctrl_function := @ERR_ENGINE_set_ctrl_function; + {$ifend} + {$if declared(ENGINE_set_ctrl_function_introduced)} + if LibVersion < ENGINE_set_ctrl_function_introduced then + begin + {$if declared(FC_ENGINE_set_ctrl_function)} + ENGINE_set_ctrl_function := @FC_ENGINE_set_ctrl_function; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_set_ctrl_function_removed)} + if ENGINE_set_ctrl_function_removed <= LibVersion then + begin + {$if declared(_ENGINE_set_ctrl_function)} + ENGINE_set_ctrl_function := @_ENGINE_set_ctrl_function; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_set_ctrl_function_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_set_ctrl_function'); + {$ifend} + end; + + + ENGINE_set_load_privkey_function := LoadLibFunction(ADllHandle, ENGINE_set_load_privkey_function_procname); + FuncLoadError := not assigned(ENGINE_set_load_privkey_function); + if FuncLoadError then + begin + {$if not defined(ENGINE_set_load_privkey_function_allownil)} + ENGINE_set_load_privkey_function := @ERR_ENGINE_set_load_privkey_function; + {$ifend} + {$if declared(ENGINE_set_load_privkey_function_introduced)} + if LibVersion < ENGINE_set_load_privkey_function_introduced then + begin + {$if declared(FC_ENGINE_set_load_privkey_function)} + ENGINE_set_load_privkey_function := @FC_ENGINE_set_load_privkey_function; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_set_load_privkey_function_removed)} + if ENGINE_set_load_privkey_function_removed <= LibVersion then + begin + {$if declared(_ENGINE_set_load_privkey_function)} + ENGINE_set_load_privkey_function := @_ENGINE_set_load_privkey_function; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_set_load_privkey_function_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_set_load_privkey_function'); + {$ifend} + end; + + + ENGINE_set_load_pubkey_function := LoadLibFunction(ADllHandle, ENGINE_set_load_pubkey_function_procname); + FuncLoadError := not assigned(ENGINE_set_load_pubkey_function); + if FuncLoadError then + begin + {$if not defined(ENGINE_set_load_pubkey_function_allownil)} + ENGINE_set_load_pubkey_function := @ERR_ENGINE_set_load_pubkey_function; + {$ifend} + {$if declared(ENGINE_set_load_pubkey_function_introduced)} + if LibVersion < ENGINE_set_load_pubkey_function_introduced then + begin + {$if declared(FC_ENGINE_set_load_pubkey_function)} + ENGINE_set_load_pubkey_function := @FC_ENGINE_set_load_pubkey_function; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_set_load_pubkey_function_removed)} + if ENGINE_set_load_pubkey_function_removed <= LibVersion then + begin + {$if declared(_ENGINE_set_load_pubkey_function)} + ENGINE_set_load_pubkey_function := @_ENGINE_set_load_pubkey_function; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_set_load_pubkey_function_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_set_load_pubkey_function'); + {$ifend} + end; + + + ENGINE_set_ciphers := LoadLibFunction(ADllHandle, ENGINE_set_ciphers_procname); + FuncLoadError := not assigned(ENGINE_set_ciphers); + if FuncLoadError then + begin + {$if not defined(ENGINE_set_ciphers_allownil)} + ENGINE_set_ciphers := @ERR_ENGINE_set_ciphers; + {$ifend} + {$if declared(ENGINE_set_ciphers_introduced)} + if LibVersion < ENGINE_set_ciphers_introduced then + begin + {$if declared(FC_ENGINE_set_ciphers)} + ENGINE_set_ciphers := @FC_ENGINE_set_ciphers; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_set_ciphers_removed)} + if ENGINE_set_ciphers_removed <= LibVersion then + begin + {$if declared(_ENGINE_set_ciphers)} + ENGINE_set_ciphers := @_ENGINE_set_ciphers; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_set_ciphers_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_set_ciphers'); + {$ifend} + end; + + + ENGINE_set_digests := LoadLibFunction(ADllHandle, ENGINE_set_digests_procname); + FuncLoadError := not assigned(ENGINE_set_digests); + if FuncLoadError then + begin + {$if not defined(ENGINE_set_digests_allownil)} + ENGINE_set_digests := @ERR_ENGINE_set_digests; + {$ifend} + {$if declared(ENGINE_set_digests_introduced)} + if LibVersion < ENGINE_set_digests_introduced then + begin + {$if declared(FC_ENGINE_set_digests)} + ENGINE_set_digests := @FC_ENGINE_set_digests; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_set_digests_removed)} + if ENGINE_set_digests_removed <= LibVersion then + begin + {$if declared(_ENGINE_set_digests)} + ENGINE_set_digests := @_ENGINE_set_digests; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_set_digests_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_set_digests'); + {$ifend} + end; + + + ENGINE_set_pkey_meths := LoadLibFunction(ADllHandle, ENGINE_set_pkey_meths_procname); + FuncLoadError := not assigned(ENGINE_set_pkey_meths); + if FuncLoadError then + begin + {$if not defined(ENGINE_set_pkey_meths_allownil)} + ENGINE_set_pkey_meths := @ERR_ENGINE_set_pkey_meths; + {$ifend} + {$if declared(ENGINE_set_pkey_meths_introduced)} + if LibVersion < ENGINE_set_pkey_meths_introduced then + begin + {$if declared(FC_ENGINE_set_pkey_meths)} + ENGINE_set_pkey_meths := @FC_ENGINE_set_pkey_meths; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_set_pkey_meths_removed)} + if ENGINE_set_pkey_meths_removed <= LibVersion then + begin + {$if declared(_ENGINE_set_pkey_meths)} + ENGINE_set_pkey_meths := @_ENGINE_set_pkey_meths; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_set_pkey_meths_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_set_pkey_meths'); + {$ifend} + end; + + + ENGINE_set_pkey_asn1_meths := LoadLibFunction(ADllHandle, ENGINE_set_pkey_asn1_meths_procname); + FuncLoadError := not assigned(ENGINE_set_pkey_asn1_meths); + if FuncLoadError then + begin + {$if not defined(ENGINE_set_pkey_asn1_meths_allownil)} + ENGINE_set_pkey_asn1_meths := @ERR_ENGINE_set_pkey_asn1_meths; + {$ifend} + {$if declared(ENGINE_set_pkey_asn1_meths_introduced)} + if LibVersion < ENGINE_set_pkey_asn1_meths_introduced then + begin + {$if declared(FC_ENGINE_set_pkey_asn1_meths)} + ENGINE_set_pkey_asn1_meths := @FC_ENGINE_set_pkey_asn1_meths; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_set_pkey_asn1_meths_removed)} + if ENGINE_set_pkey_asn1_meths_removed <= LibVersion then + begin + {$if declared(_ENGINE_set_pkey_asn1_meths)} + ENGINE_set_pkey_asn1_meths := @_ENGINE_set_pkey_asn1_meths; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_set_pkey_asn1_meths_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_set_pkey_asn1_meths'); + {$ifend} + end; + + + ENGINE_set_flags := LoadLibFunction(ADllHandle, ENGINE_set_flags_procname); + FuncLoadError := not assigned(ENGINE_set_flags); + if FuncLoadError then + begin + {$if not defined(ENGINE_set_flags_allownil)} + ENGINE_set_flags := @ERR_ENGINE_set_flags; + {$ifend} + {$if declared(ENGINE_set_flags_introduced)} + if LibVersion < ENGINE_set_flags_introduced then + begin + {$if declared(FC_ENGINE_set_flags)} + ENGINE_set_flags := @FC_ENGINE_set_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_set_flags_removed)} + if ENGINE_set_flags_removed <= LibVersion then + begin + {$if declared(_ENGINE_set_flags)} + ENGINE_set_flags := @_ENGINE_set_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_set_flags_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_set_flags'); + {$ifend} + end; + + + ENGINE_set_cmd_defns := LoadLibFunction(ADllHandle, ENGINE_set_cmd_defns_procname); + FuncLoadError := not assigned(ENGINE_set_cmd_defns); + if FuncLoadError then + begin + {$if not defined(ENGINE_set_cmd_defns_allownil)} + ENGINE_set_cmd_defns := @ERR_ENGINE_set_cmd_defns; + {$ifend} + {$if declared(ENGINE_set_cmd_defns_introduced)} + if LibVersion < ENGINE_set_cmd_defns_introduced then + begin + {$if declared(FC_ENGINE_set_cmd_defns)} + ENGINE_set_cmd_defns := @FC_ENGINE_set_cmd_defns; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_set_cmd_defns_removed)} + if ENGINE_set_cmd_defns_removed <= LibVersion then + begin + {$if declared(_ENGINE_set_cmd_defns)} + ENGINE_set_cmd_defns := @_ENGINE_set_cmd_defns; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_set_cmd_defns_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_set_cmd_defns'); + {$ifend} + end; + + + ENGINE_set_ex_data := LoadLibFunction(ADllHandle, ENGINE_set_ex_data_procname); + FuncLoadError := not assigned(ENGINE_set_ex_data); + if FuncLoadError then + begin + {$if not defined(ENGINE_set_ex_data_allownil)} + ENGINE_set_ex_data := @ERR_ENGINE_set_ex_data; + {$ifend} + {$if declared(ENGINE_set_ex_data_introduced)} + if LibVersion < ENGINE_set_ex_data_introduced then + begin + {$if declared(FC_ENGINE_set_ex_data)} + ENGINE_set_ex_data := @FC_ENGINE_set_ex_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_set_ex_data_removed)} + if ENGINE_set_ex_data_removed <= LibVersion then + begin + {$if declared(_ENGINE_set_ex_data)} + ENGINE_set_ex_data := @_ENGINE_set_ex_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_set_ex_data_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_set_ex_data'); + {$ifend} + end; + + + ENGINE_get_ex_data := LoadLibFunction(ADllHandle, ENGINE_get_ex_data_procname); + FuncLoadError := not assigned(ENGINE_get_ex_data); + if FuncLoadError then + begin + {$if not defined(ENGINE_get_ex_data_allownil)} + ENGINE_get_ex_data := @ERR_ENGINE_get_ex_data; + {$ifend} + {$if declared(ENGINE_get_ex_data_introduced)} + if LibVersion < ENGINE_get_ex_data_introduced then + begin + {$if declared(FC_ENGINE_get_ex_data)} + ENGINE_get_ex_data := @FC_ENGINE_get_ex_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_get_ex_data_removed)} + if ENGINE_get_ex_data_removed <= LibVersion then + begin + {$if declared(_ENGINE_get_ex_data)} + ENGINE_get_ex_data := @_ENGINE_get_ex_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_get_ex_data_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_get_ex_data'); + {$ifend} + end; + + + ENGINE_get_id := LoadLibFunction(ADllHandle, ENGINE_get_id_procname); + FuncLoadError := not assigned(ENGINE_get_id); + if FuncLoadError then + begin + {$if not defined(ENGINE_get_id_allownil)} + ENGINE_get_id := @ERR_ENGINE_get_id; + {$ifend} + {$if declared(ENGINE_get_id_introduced)} + if LibVersion < ENGINE_get_id_introduced then + begin + {$if declared(FC_ENGINE_get_id)} + ENGINE_get_id := @FC_ENGINE_get_id; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_get_id_removed)} + if ENGINE_get_id_removed <= LibVersion then + begin + {$if declared(_ENGINE_get_id)} + ENGINE_get_id := @_ENGINE_get_id; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_get_id_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_get_id'); + {$ifend} + end; + + + ENGINE_get_name := LoadLibFunction(ADllHandle, ENGINE_get_name_procname); + FuncLoadError := not assigned(ENGINE_get_name); + if FuncLoadError then + begin + {$if not defined(ENGINE_get_name_allownil)} + ENGINE_get_name := @ERR_ENGINE_get_name; + {$ifend} + {$if declared(ENGINE_get_name_introduced)} + if LibVersion < ENGINE_get_name_introduced then + begin + {$if declared(FC_ENGINE_get_name)} + ENGINE_get_name := @FC_ENGINE_get_name; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_get_name_removed)} + if ENGINE_get_name_removed <= LibVersion then + begin + {$if declared(_ENGINE_get_name)} + ENGINE_get_name := @_ENGINE_get_name; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_get_name_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_get_name'); + {$ifend} + end; + + + ENGINE_get_RSA := LoadLibFunction(ADllHandle, ENGINE_get_RSA_procname); + FuncLoadError := not assigned(ENGINE_get_RSA); + if FuncLoadError then + begin + {$if not defined(ENGINE_get_RSA_allownil)} + ENGINE_get_RSA := @ERR_ENGINE_get_RSA; + {$ifend} + {$if declared(ENGINE_get_RSA_introduced)} + if LibVersion < ENGINE_get_RSA_introduced then + begin + {$if declared(FC_ENGINE_get_RSA)} + ENGINE_get_RSA := @FC_ENGINE_get_RSA; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_get_RSA_removed)} + if ENGINE_get_RSA_removed <= LibVersion then + begin + {$if declared(_ENGINE_get_RSA)} + ENGINE_get_RSA := @_ENGINE_get_RSA; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_get_RSA_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_get_RSA'); + {$ifend} + end; + + + ENGINE_get_DSA := LoadLibFunction(ADllHandle, ENGINE_get_DSA_procname); + FuncLoadError := not assigned(ENGINE_get_DSA); + if FuncLoadError then + begin + {$if not defined(ENGINE_get_DSA_allownil)} + ENGINE_get_DSA := @ERR_ENGINE_get_DSA; + {$ifend} + {$if declared(ENGINE_get_DSA_introduced)} + if LibVersion < ENGINE_get_DSA_introduced then + begin + {$if declared(FC_ENGINE_get_DSA)} + ENGINE_get_DSA := @FC_ENGINE_get_DSA; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_get_DSA_removed)} + if ENGINE_get_DSA_removed <= LibVersion then + begin + {$if declared(_ENGINE_get_DSA)} + ENGINE_get_DSA := @_ENGINE_get_DSA; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_get_DSA_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_get_DSA'); + {$ifend} + end; + + + ENGINE_get_EC := LoadLibFunction(ADllHandle, ENGINE_get_EC_procname); + FuncLoadError := not assigned(ENGINE_get_EC); + if FuncLoadError then + begin + {$if not defined(ENGINE_get_EC_allownil)} + ENGINE_get_EC := @ERR_ENGINE_get_EC; + {$ifend} + {$if declared(ENGINE_get_EC_introduced)} + if LibVersion < ENGINE_get_EC_introduced then + begin + {$if declared(FC_ENGINE_get_EC)} + ENGINE_get_EC := @FC_ENGINE_get_EC; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_get_EC_removed)} + if ENGINE_get_EC_removed <= LibVersion then + begin + {$if declared(_ENGINE_get_EC)} + ENGINE_get_EC := @_ENGINE_get_EC; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_get_EC_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_get_EC'); + {$ifend} + end; + + + ENGINE_get_DH := LoadLibFunction(ADllHandle, ENGINE_get_DH_procname); + FuncLoadError := not assigned(ENGINE_get_DH); + if FuncLoadError then + begin + {$if not defined(ENGINE_get_DH_allownil)} + ENGINE_get_DH := @ERR_ENGINE_get_DH; + {$ifend} + {$if declared(ENGINE_get_DH_introduced)} + if LibVersion < ENGINE_get_DH_introduced then + begin + {$if declared(FC_ENGINE_get_DH)} + ENGINE_get_DH := @FC_ENGINE_get_DH; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_get_DH_removed)} + if ENGINE_get_DH_removed <= LibVersion then + begin + {$if declared(_ENGINE_get_DH)} + ENGINE_get_DH := @_ENGINE_get_DH; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_get_DH_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_get_DH'); + {$ifend} + end; + + + ENGINE_get_RAND := LoadLibFunction(ADllHandle, ENGINE_get_RAND_procname); + FuncLoadError := not assigned(ENGINE_get_RAND); + if FuncLoadError then + begin + {$if not defined(ENGINE_get_RAND_allownil)} + ENGINE_get_RAND := @ERR_ENGINE_get_RAND; + {$ifend} + {$if declared(ENGINE_get_RAND_introduced)} + if LibVersion < ENGINE_get_RAND_introduced then + begin + {$if declared(FC_ENGINE_get_RAND)} + ENGINE_get_RAND := @FC_ENGINE_get_RAND; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_get_RAND_removed)} + if ENGINE_get_RAND_removed <= LibVersion then + begin + {$if declared(_ENGINE_get_RAND)} + ENGINE_get_RAND := @_ENGINE_get_RAND; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_get_RAND_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_get_RAND'); + {$ifend} + end; + + + ENGINE_get_destroy_function := LoadLibFunction(ADllHandle, ENGINE_get_destroy_function_procname); + FuncLoadError := not assigned(ENGINE_get_destroy_function); + if FuncLoadError then + begin + {$if not defined(ENGINE_get_destroy_function_allownil)} + ENGINE_get_destroy_function := @ERR_ENGINE_get_destroy_function; + {$ifend} + {$if declared(ENGINE_get_destroy_function_introduced)} + if LibVersion < ENGINE_get_destroy_function_introduced then + begin + {$if declared(FC_ENGINE_get_destroy_function)} + ENGINE_get_destroy_function := @FC_ENGINE_get_destroy_function; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_get_destroy_function_removed)} + if ENGINE_get_destroy_function_removed <= LibVersion then + begin + {$if declared(_ENGINE_get_destroy_function)} + ENGINE_get_destroy_function := @_ENGINE_get_destroy_function; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_get_destroy_function_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_get_destroy_function'); + {$ifend} + end; + + + ENGINE_get_init_function := LoadLibFunction(ADllHandle, ENGINE_get_init_function_procname); + FuncLoadError := not assigned(ENGINE_get_init_function); + if FuncLoadError then + begin + {$if not defined(ENGINE_get_init_function_allownil)} + ENGINE_get_init_function := @ERR_ENGINE_get_init_function; + {$ifend} + {$if declared(ENGINE_get_init_function_introduced)} + if LibVersion < ENGINE_get_init_function_introduced then + begin + {$if declared(FC_ENGINE_get_init_function)} + ENGINE_get_init_function := @FC_ENGINE_get_init_function; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_get_init_function_removed)} + if ENGINE_get_init_function_removed <= LibVersion then + begin + {$if declared(_ENGINE_get_init_function)} + ENGINE_get_init_function := @_ENGINE_get_init_function; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_get_init_function_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_get_init_function'); + {$ifend} + end; + + + ENGINE_get_finish_function := LoadLibFunction(ADllHandle, ENGINE_get_finish_function_procname); + FuncLoadError := not assigned(ENGINE_get_finish_function); + if FuncLoadError then + begin + {$if not defined(ENGINE_get_finish_function_allownil)} + ENGINE_get_finish_function := @ERR_ENGINE_get_finish_function; + {$ifend} + {$if declared(ENGINE_get_finish_function_introduced)} + if LibVersion < ENGINE_get_finish_function_introduced then + begin + {$if declared(FC_ENGINE_get_finish_function)} + ENGINE_get_finish_function := @FC_ENGINE_get_finish_function; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_get_finish_function_removed)} + if ENGINE_get_finish_function_removed <= LibVersion then + begin + {$if declared(_ENGINE_get_finish_function)} + ENGINE_get_finish_function := @_ENGINE_get_finish_function; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_get_finish_function_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_get_finish_function'); + {$ifend} + end; + + + ENGINE_get_ctrl_function := LoadLibFunction(ADllHandle, ENGINE_get_ctrl_function_procname); + FuncLoadError := not assigned(ENGINE_get_ctrl_function); + if FuncLoadError then + begin + {$if not defined(ENGINE_get_ctrl_function_allownil)} + ENGINE_get_ctrl_function := @ERR_ENGINE_get_ctrl_function; + {$ifend} + {$if declared(ENGINE_get_ctrl_function_introduced)} + if LibVersion < ENGINE_get_ctrl_function_introduced then + begin + {$if declared(FC_ENGINE_get_ctrl_function)} + ENGINE_get_ctrl_function := @FC_ENGINE_get_ctrl_function; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_get_ctrl_function_removed)} + if ENGINE_get_ctrl_function_removed <= LibVersion then + begin + {$if declared(_ENGINE_get_ctrl_function)} + ENGINE_get_ctrl_function := @_ENGINE_get_ctrl_function; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_get_ctrl_function_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_get_ctrl_function'); + {$ifend} + end; + + + ENGINE_get_load_privkey_function := LoadLibFunction(ADllHandle, ENGINE_get_load_privkey_function_procname); + FuncLoadError := not assigned(ENGINE_get_load_privkey_function); + if FuncLoadError then + begin + {$if not defined(ENGINE_get_load_privkey_function_allownil)} + ENGINE_get_load_privkey_function := @ERR_ENGINE_get_load_privkey_function; + {$ifend} + {$if declared(ENGINE_get_load_privkey_function_introduced)} + if LibVersion < ENGINE_get_load_privkey_function_introduced then + begin + {$if declared(FC_ENGINE_get_load_privkey_function)} + ENGINE_get_load_privkey_function := @FC_ENGINE_get_load_privkey_function; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_get_load_privkey_function_removed)} + if ENGINE_get_load_privkey_function_removed <= LibVersion then + begin + {$if declared(_ENGINE_get_load_privkey_function)} + ENGINE_get_load_privkey_function := @_ENGINE_get_load_privkey_function; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_get_load_privkey_function_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_get_load_privkey_function'); + {$ifend} + end; + + + ENGINE_get_load_pubkey_function := LoadLibFunction(ADllHandle, ENGINE_get_load_pubkey_function_procname); + FuncLoadError := not assigned(ENGINE_get_load_pubkey_function); + if FuncLoadError then + begin + {$if not defined(ENGINE_get_load_pubkey_function_allownil)} + ENGINE_get_load_pubkey_function := @ERR_ENGINE_get_load_pubkey_function; + {$ifend} + {$if declared(ENGINE_get_load_pubkey_function_introduced)} + if LibVersion < ENGINE_get_load_pubkey_function_introduced then + begin + {$if declared(FC_ENGINE_get_load_pubkey_function)} + ENGINE_get_load_pubkey_function := @FC_ENGINE_get_load_pubkey_function; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_get_load_pubkey_function_removed)} + if ENGINE_get_load_pubkey_function_removed <= LibVersion then + begin + {$if declared(_ENGINE_get_load_pubkey_function)} + ENGINE_get_load_pubkey_function := @_ENGINE_get_load_pubkey_function; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_get_load_pubkey_function_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_get_load_pubkey_function'); + {$ifend} + end; + + + ENGINE_get_ciphers := LoadLibFunction(ADllHandle, ENGINE_get_ciphers_procname); + FuncLoadError := not assigned(ENGINE_get_ciphers); + if FuncLoadError then + begin + {$if not defined(ENGINE_get_ciphers_allownil)} + ENGINE_get_ciphers := @ERR_ENGINE_get_ciphers; + {$ifend} + {$if declared(ENGINE_get_ciphers_introduced)} + if LibVersion < ENGINE_get_ciphers_introduced then + begin + {$if declared(FC_ENGINE_get_ciphers)} + ENGINE_get_ciphers := @FC_ENGINE_get_ciphers; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_get_ciphers_removed)} + if ENGINE_get_ciphers_removed <= LibVersion then + begin + {$if declared(_ENGINE_get_ciphers)} + ENGINE_get_ciphers := @_ENGINE_get_ciphers; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_get_ciphers_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_get_ciphers'); + {$ifend} + end; + + + ENGINE_get_digests := LoadLibFunction(ADllHandle, ENGINE_get_digests_procname); + FuncLoadError := not assigned(ENGINE_get_digests); + if FuncLoadError then + begin + {$if not defined(ENGINE_get_digests_allownil)} + ENGINE_get_digests := @ERR_ENGINE_get_digests; + {$ifend} + {$if declared(ENGINE_get_digests_introduced)} + if LibVersion < ENGINE_get_digests_introduced then + begin + {$if declared(FC_ENGINE_get_digests)} + ENGINE_get_digests := @FC_ENGINE_get_digests; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_get_digests_removed)} + if ENGINE_get_digests_removed <= LibVersion then + begin + {$if declared(_ENGINE_get_digests)} + ENGINE_get_digests := @_ENGINE_get_digests; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_get_digests_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_get_digests'); + {$ifend} + end; + + + ENGINE_get_pkey_meths := LoadLibFunction(ADllHandle, ENGINE_get_pkey_meths_procname); + FuncLoadError := not assigned(ENGINE_get_pkey_meths); + if FuncLoadError then + begin + {$if not defined(ENGINE_get_pkey_meths_allownil)} + ENGINE_get_pkey_meths := @ERR_ENGINE_get_pkey_meths; + {$ifend} + {$if declared(ENGINE_get_pkey_meths_introduced)} + if LibVersion < ENGINE_get_pkey_meths_introduced then + begin + {$if declared(FC_ENGINE_get_pkey_meths)} + ENGINE_get_pkey_meths := @FC_ENGINE_get_pkey_meths; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_get_pkey_meths_removed)} + if ENGINE_get_pkey_meths_removed <= LibVersion then + begin + {$if declared(_ENGINE_get_pkey_meths)} + ENGINE_get_pkey_meths := @_ENGINE_get_pkey_meths; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_get_pkey_meths_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_get_pkey_meths'); + {$ifend} + end; + + + ENGINE_get_pkey_asn1_meths := LoadLibFunction(ADllHandle, ENGINE_get_pkey_asn1_meths_procname); + FuncLoadError := not assigned(ENGINE_get_pkey_asn1_meths); + if FuncLoadError then + begin + {$if not defined(ENGINE_get_pkey_asn1_meths_allownil)} + ENGINE_get_pkey_asn1_meths := @ERR_ENGINE_get_pkey_asn1_meths; + {$ifend} + {$if declared(ENGINE_get_pkey_asn1_meths_introduced)} + if LibVersion < ENGINE_get_pkey_asn1_meths_introduced then + begin + {$if declared(FC_ENGINE_get_pkey_asn1_meths)} + ENGINE_get_pkey_asn1_meths := @FC_ENGINE_get_pkey_asn1_meths; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_get_pkey_asn1_meths_removed)} + if ENGINE_get_pkey_asn1_meths_removed <= LibVersion then + begin + {$if declared(_ENGINE_get_pkey_asn1_meths)} + ENGINE_get_pkey_asn1_meths := @_ENGINE_get_pkey_asn1_meths; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_get_pkey_asn1_meths_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_get_pkey_asn1_meths'); + {$ifend} + end; + + + ENGINE_get_cipher := LoadLibFunction(ADllHandle, ENGINE_get_cipher_procname); + FuncLoadError := not assigned(ENGINE_get_cipher); + if FuncLoadError then + begin + {$if not defined(ENGINE_get_cipher_allownil)} + ENGINE_get_cipher := @ERR_ENGINE_get_cipher; + {$ifend} + {$if declared(ENGINE_get_cipher_introduced)} + if LibVersion < ENGINE_get_cipher_introduced then + begin + {$if declared(FC_ENGINE_get_cipher)} + ENGINE_get_cipher := @FC_ENGINE_get_cipher; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_get_cipher_removed)} + if ENGINE_get_cipher_removed <= LibVersion then + begin + {$if declared(_ENGINE_get_cipher)} + ENGINE_get_cipher := @_ENGINE_get_cipher; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_get_cipher_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_get_cipher'); + {$ifend} + end; + + + ENGINE_get_digest := LoadLibFunction(ADllHandle, ENGINE_get_digest_procname); + FuncLoadError := not assigned(ENGINE_get_digest); + if FuncLoadError then + begin + {$if not defined(ENGINE_get_digest_allownil)} + ENGINE_get_digest := @ERR_ENGINE_get_digest; + {$ifend} + {$if declared(ENGINE_get_digest_introduced)} + if LibVersion < ENGINE_get_digest_introduced then + begin + {$if declared(FC_ENGINE_get_digest)} + ENGINE_get_digest := @FC_ENGINE_get_digest; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_get_digest_removed)} + if ENGINE_get_digest_removed <= LibVersion then + begin + {$if declared(_ENGINE_get_digest)} + ENGINE_get_digest := @_ENGINE_get_digest; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_get_digest_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_get_digest'); + {$ifend} + end; + + + ENGINE_get_pkey_meth := LoadLibFunction(ADllHandle, ENGINE_get_pkey_meth_procname); + FuncLoadError := not assigned(ENGINE_get_pkey_meth); + if FuncLoadError then + begin + {$if not defined(ENGINE_get_pkey_meth_allownil)} + ENGINE_get_pkey_meth := @ERR_ENGINE_get_pkey_meth; + {$ifend} + {$if declared(ENGINE_get_pkey_meth_introduced)} + if LibVersion < ENGINE_get_pkey_meth_introduced then + begin + {$if declared(FC_ENGINE_get_pkey_meth)} + ENGINE_get_pkey_meth := @FC_ENGINE_get_pkey_meth; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_get_pkey_meth_removed)} + if ENGINE_get_pkey_meth_removed <= LibVersion then + begin + {$if declared(_ENGINE_get_pkey_meth)} + ENGINE_get_pkey_meth := @_ENGINE_get_pkey_meth; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_get_pkey_meth_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_get_pkey_meth'); + {$ifend} + end; + + + ENGINE_get_pkey_asn1_meth := LoadLibFunction(ADllHandle, ENGINE_get_pkey_asn1_meth_procname); + FuncLoadError := not assigned(ENGINE_get_pkey_asn1_meth); + if FuncLoadError then + begin + {$if not defined(ENGINE_get_pkey_asn1_meth_allownil)} + ENGINE_get_pkey_asn1_meth := @ERR_ENGINE_get_pkey_asn1_meth; + {$ifend} + {$if declared(ENGINE_get_pkey_asn1_meth_introduced)} + if LibVersion < ENGINE_get_pkey_asn1_meth_introduced then + begin + {$if declared(FC_ENGINE_get_pkey_asn1_meth)} + ENGINE_get_pkey_asn1_meth := @FC_ENGINE_get_pkey_asn1_meth; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_get_pkey_asn1_meth_removed)} + if ENGINE_get_pkey_asn1_meth_removed <= LibVersion then + begin + {$if declared(_ENGINE_get_pkey_asn1_meth)} + ENGINE_get_pkey_asn1_meth := @_ENGINE_get_pkey_asn1_meth; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_get_pkey_asn1_meth_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_get_pkey_asn1_meth'); + {$ifend} + end; + + + ENGINE_get_pkey_asn1_meth_str := LoadLibFunction(ADllHandle, ENGINE_get_pkey_asn1_meth_str_procname); + FuncLoadError := not assigned(ENGINE_get_pkey_asn1_meth_str); + if FuncLoadError then + begin + {$if not defined(ENGINE_get_pkey_asn1_meth_str_allownil)} + ENGINE_get_pkey_asn1_meth_str := @ERR_ENGINE_get_pkey_asn1_meth_str; + {$ifend} + {$if declared(ENGINE_get_pkey_asn1_meth_str_introduced)} + if LibVersion < ENGINE_get_pkey_asn1_meth_str_introduced then + begin + {$if declared(FC_ENGINE_get_pkey_asn1_meth_str)} + ENGINE_get_pkey_asn1_meth_str := @FC_ENGINE_get_pkey_asn1_meth_str; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_get_pkey_asn1_meth_str_removed)} + if ENGINE_get_pkey_asn1_meth_str_removed <= LibVersion then + begin + {$if declared(_ENGINE_get_pkey_asn1_meth_str)} + ENGINE_get_pkey_asn1_meth_str := @_ENGINE_get_pkey_asn1_meth_str; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_get_pkey_asn1_meth_str_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_get_pkey_asn1_meth_str'); + {$ifend} + end; + + + ENGINE_pkey_asn1_find_str := LoadLibFunction(ADllHandle, ENGINE_pkey_asn1_find_str_procname); + FuncLoadError := not assigned(ENGINE_pkey_asn1_find_str); + if FuncLoadError then + begin + {$if not defined(ENGINE_pkey_asn1_find_str_allownil)} + ENGINE_pkey_asn1_find_str := @ERR_ENGINE_pkey_asn1_find_str; + {$ifend} + {$if declared(ENGINE_pkey_asn1_find_str_introduced)} + if LibVersion < ENGINE_pkey_asn1_find_str_introduced then + begin + {$if declared(FC_ENGINE_pkey_asn1_find_str)} + ENGINE_pkey_asn1_find_str := @FC_ENGINE_pkey_asn1_find_str; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_pkey_asn1_find_str_removed)} + if ENGINE_pkey_asn1_find_str_removed <= LibVersion then + begin + {$if declared(_ENGINE_pkey_asn1_find_str)} + ENGINE_pkey_asn1_find_str := @_ENGINE_pkey_asn1_find_str; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_pkey_asn1_find_str_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_pkey_asn1_find_str'); + {$ifend} + end; + + + ENGINE_get_cmd_defns := LoadLibFunction(ADllHandle, ENGINE_get_cmd_defns_procname); + FuncLoadError := not assigned(ENGINE_get_cmd_defns); + if FuncLoadError then + begin + {$if not defined(ENGINE_get_cmd_defns_allownil)} + ENGINE_get_cmd_defns := @ERR_ENGINE_get_cmd_defns; + {$ifend} + {$if declared(ENGINE_get_cmd_defns_introduced)} + if LibVersion < ENGINE_get_cmd_defns_introduced then + begin + {$if declared(FC_ENGINE_get_cmd_defns)} + ENGINE_get_cmd_defns := @FC_ENGINE_get_cmd_defns; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_get_cmd_defns_removed)} + if ENGINE_get_cmd_defns_removed <= LibVersion then + begin + {$if declared(_ENGINE_get_cmd_defns)} + ENGINE_get_cmd_defns := @_ENGINE_get_cmd_defns; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_get_cmd_defns_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_get_cmd_defns'); + {$ifend} + end; + + + ENGINE_get_flags := LoadLibFunction(ADllHandle, ENGINE_get_flags_procname); + FuncLoadError := not assigned(ENGINE_get_flags); + if FuncLoadError then + begin + {$if not defined(ENGINE_get_flags_allownil)} + ENGINE_get_flags := @ERR_ENGINE_get_flags; + {$ifend} + {$if declared(ENGINE_get_flags_introduced)} + if LibVersion < ENGINE_get_flags_introduced then + begin + {$if declared(FC_ENGINE_get_flags)} + ENGINE_get_flags := @FC_ENGINE_get_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_get_flags_removed)} + if ENGINE_get_flags_removed <= LibVersion then + begin + {$if declared(_ENGINE_get_flags)} + ENGINE_get_flags := @_ENGINE_get_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_get_flags_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_get_flags'); + {$ifend} + end; + + + ENGINE_init := LoadLibFunction(ADllHandle, ENGINE_init_procname); + FuncLoadError := not assigned(ENGINE_init); + if FuncLoadError then + begin + {$if not defined(ENGINE_init_allownil)} + ENGINE_init := @ERR_ENGINE_init; + {$ifend} + {$if declared(ENGINE_init_introduced)} + if LibVersion < ENGINE_init_introduced then + begin + {$if declared(FC_ENGINE_init)} + ENGINE_init := @FC_ENGINE_init; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_init_removed)} + if ENGINE_init_removed <= LibVersion then + begin + {$if declared(_ENGINE_init)} + ENGINE_init := @_ENGINE_init; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_init_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_init'); + {$ifend} + end; + + + ENGINE_finish := LoadLibFunction(ADllHandle, ENGINE_finish_procname); + FuncLoadError := not assigned(ENGINE_finish); + if FuncLoadError then + begin + {$if not defined(ENGINE_finish_allownil)} + ENGINE_finish := @ERR_ENGINE_finish; + {$ifend} + {$if declared(ENGINE_finish_introduced)} + if LibVersion < ENGINE_finish_introduced then + begin + {$if declared(FC_ENGINE_finish)} + ENGINE_finish := @FC_ENGINE_finish; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_finish_removed)} + if ENGINE_finish_removed <= LibVersion then + begin + {$if declared(_ENGINE_finish)} + ENGINE_finish := @_ENGINE_finish; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_finish_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_finish'); + {$ifend} + end; + + + ENGINE_load_private_key := LoadLibFunction(ADllHandle, ENGINE_load_private_key_procname); + FuncLoadError := not assigned(ENGINE_load_private_key); + if FuncLoadError then + begin + {$if not defined(ENGINE_load_private_key_allownil)} + ENGINE_load_private_key := @ERR_ENGINE_load_private_key; + {$ifend} + {$if declared(ENGINE_load_private_key_introduced)} + if LibVersion < ENGINE_load_private_key_introduced then + begin + {$if declared(FC_ENGINE_load_private_key)} + ENGINE_load_private_key := @FC_ENGINE_load_private_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_load_private_key_removed)} + if ENGINE_load_private_key_removed <= LibVersion then + begin + {$if declared(_ENGINE_load_private_key)} + ENGINE_load_private_key := @_ENGINE_load_private_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_load_private_key_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_load_private_key'); + {$ifend} + end; + + + ENGINE_load_public_key := LoadLibFunction(ADllHandle, ENGINE_load_public_key_procname); + FuncLoadError := not assigned(ENGINE_load_public_key); + if FuncLoadError then + begin + {$if not defined(ENGINE_load_public_key_allownil)} + ENGINE_load_public_key := @ERR_ENGINE_load_public_key; + {$ifend} + {$if declared(ENGINE_load_public_key_introduced)} + if LibVersion < ENGINE_load_public_key_introduced then + begin + {$if declared(FC_ENGINE_load_public_key)} + ENGINE_load_public_key := @FC_ENGINE_load_public_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_load_public_key_removed)} + if ENGINE_load_public_key_removed <= LibVersion then + begin + {$if declared(_ENGINE_load_public_key)} + ENGINE_load_public_key := @_ENGINE_load_public_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_load_public_key_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_load_public_key'); + {$ifend} + end; + + + ENGINE_get_default_RSA := LoadLibFunction(ADllHandle, ENGINE_get_default_RSA_procname); + FuncLoadError := not assigned(ENGINE_get_default_RSA); + if FuncLoadError then + begin + {$if not defined(ENGINE_get_default_RSA_allownil)} + ENGINE_get_default_RSA := @ERR_ENGINE_get_default_RSA; + {$ifend} + {$if declared(ENGINE_get_default_RSA_introduced)} + if LibVersion < ENGINE_get_default_RSA_introduced then + begin + {$if declared(FC_ENGINE_get_default_RSA)} + ENGINE_get_default_RSA := @FC_ENGINE_get_default_RSA; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_get_default_RSA_removed)} + if ENGINE_get_default_RSA_removed <= LibVersion then + begin + {$if declared(_ENGINE_get_default_RSA)} + ENGINE_get_default_RSA := @_ENGINE_get_default_RSA; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_get_default_RSA_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_get_default_RSA'); + {$ifend} + end; + + + ENGINE_get_default_DSA := LoadLibFunction(ADllHandle, ENGINE_get_default_DSA_procname); + FuncLoadError := not assigned(ENGINE_get_default_DSA); + if FuncLoadError then + begin + {$if not defined(ENGINE_get_default_DSA_allownil)} + ENGINE_get_default_DSA := @ERR_ENGINE_get_default_DSA; + {$ifend} + {$if declared(ENGINE_get_default_DSA_introduced)} + if LibVersion < ENGINE_get_default_DSA_introduced then + begin + {$if declared(FC_ENGINE_get_default_DSA)} + ENGINE_get_default_DSA := @FC_ENGINE_get_default_DSA; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_get_default_DSA_removed)} + if ENGINE_get_default_DSA_removed <= LibVersion then + begin + {$if declared(_ENGINE_get_default_DSA)} + ENGINE_get_default_DSA := @_ENGINE_get_default_DSA; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_get_default_DSA_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_get_default_DSA'); + {$ifend} + end; + + + ENGINE_get_default_EC := LoadLibFunction(ADllHandle, ENGINE_get_default_EC_procname); + FuncLoadError := not assigned(ENGINE_get_default_EC); + if FuncLoadError then + begin + {$if not defined(ENGINE_get_default_EC_allownil)} + ENGINE_get_default_EC := @ERR_ENGINE_get_default_EC; + {$ifend} + {$if declared(ENGINE_get_default_EC_introduced)} + if LibVersion < ENGINE_get_default_EC_introduced then + begin + {$if declared(FC_ENGINE_get_default_EC)} + ENGINE_get_default_EC := @FC_ENGINE_get_default_EC; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_get_default_EC_removed)} + if ENGINE_get_default_EC_removed <= LibVersion then + begin + {$if declared(_ENGINE_get_default_EC)} + ENGINE_get_default_EC := @_ENGINE_get_default_EC; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_get_default_EC_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_get_default_EC'); + {$ifend} + end; + + + ENGINE_get_default_DH := LoadLibFunction(ADllHandle, ENGINE_get_default_DH_procname); + FuncLoadError := not assigned(ENGINE_get_default_DH); + if FuncLoadError then + begin + {$if not defined(ENGINE_get_default_DH_allownil)} + ENGINE_get_default_DH := @ERR_ENGINE_get_default_DH; + {$ifend} + {$if declared(ENGINE_get_default_DH_introduced)} + if LibVersion < ENGINE_get_default_DH_introduced then + begin + {$if declared(FC_ENGINE_get_default_DH)} + ENGINE_get_default_DH := @FC_ENGINE_get_default_DH; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_get_default_DH_removed)} + if ENGINE_get_default_DH_removed <= LibVersion then + begin + {$if declared(_ENGINE_get_default_DH)} + ENGINE_get_default_DH := @_ENGINE_get_default_DH; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_get_default_DH_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_get_default_DH'); + {$ifend} + end; + + + ENGINE_get_default_RAND := LoadLibFunction(ADllHandle, ENGINE_get_default_RAND_procname); + FuncLoadError := not assigned(ENGINE_get_default_RAND); + if FuncLoadError then + begin + {$if not defined(ENGINE_get_default_RAND_allownil)} + ENGINE_get_default_RAND := @ERR_ENGINE_get_default_RAND; + {$ifend} + {$if declared(ENGINE_get_default_RAND_introduced)} + if LibVersion < ENGINE_get_default_RAND_introduced then + begin + {$if declared(FC_ENGINE_get_default_RAND)} + ENGINE_get_default_RAND := @FC_ENGINE_get_default_RAND; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_get_default_RAND_removed)} + if ENGINE_get_default_RAND_removed <= LibVersion then + begin + {$if declared(_ENGINE_get_default_RAND)} + ENGINE_get_default_RAND := @_ENGINE_get_default_RAND; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_get_default_RAND_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_get_default_RAND'); + {$ifend} + end; + + + ENGINE_get_cipher_engine := LoadLibFunction(ADllHandle, ENGINE_get_cipher_engine_procname); + FuncLoadError := not assigned(ENGINE_get_cipher_engine); + if FuncLoadError then + begin + {$if not defined(ENGINE_get_cipher_engine_allownil)} + ENGINE_get_cipher_engine := @ERR_ENGINE_get_cipher_engine; + {$ifend} + {$if declared(ENGINE_get_cipher_engine_introduced)} + if LibVersion < ENGINE_get_cipher_engine_introduced then + begin + {$if declared(FC_ENGINE_get_cipher_engine)} + ENGINE_get_cipher_engine := @FC_ENGINE_get_cipher_engine; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_get_cipher_engine_removed)} + if ENGINE_get_cipher_engine_removed <= LibVersion then + begin + {$if declared(_ENGINE_get_cipher_engine)} + ENGINE_get_cipher_engine := @_ENGINE_get_cipher_engine; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_get_cipher_engine_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_get_cipher_engine'); + {$ifend} + end; + + + ENGINE_get_digest_engine := LoadLibFunction(ADllHandle, ENGINE_get_digest_engine_procname); + FuncLoadError := not assigned(ENGINE_get_digest_engine); + if FuncLoadError then + begin + {$if not defined(ENGINE_get_digest_engine_allownil)} + ENGINE_get_digest_engine := @ERR_ENGINE_get_digest_engine; + {$ifend} + {$if declared(ENGINE_get_digest_engine_introduced)} + if LibVersion < ENGINE_get_digest_engine_introduced then + begin + {$if declared(FC_ENGINE_get_digest_engine)} + ENGINE_get_digest_engine := @FC_ENGINE_get_digest_engine; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_get_digest_engine_removed)} + if ENGINE_get_digest_engine_removed <= LibVersion then + begin + {$if declared(_ENGINE_get_digest_engine)} + ENGINE_get_digest_engine := @_ENGINE_get_digest_engine; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_get_digest_engine_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_get_digest_engine'); + {$ifend} + end; + + + ENGINE_get_pkey_meth_engine := LoadLibFunction(ADllHandle, ENGINE_get_pkey_meth_engine_procname); + FuncLoadError := not assigned(ENGINE_get_pkey_meth_engine); + if FuncLoadError then + begin + {$if not defined(ENGINE_get_pkey_meth_engine_allownil)} + ENGINE_get_pkey_meth_engine := @ERR_ENGINE_get_pkey_meth_engine; + {$ifend} + {$if declared(ENGINE_get_pkey_meth_engine_introduced)} + if LibVersion < ENGINE_get_pkey_meth_engine_introduced then + begin + {$if declared(FC_ENGINE_get_pkey_meth_engine)} + ENGINE_get_pkey_meth_engine := @FC_ENGINE_get_pkey_meth_engine; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_get_pkey_meth_engine_removed)} + if ENGINE_get_pkey_meth_engine_removed <= LibVersion then + begin + {$if declared(_ENGINE_get_pkey_meth_engine)} + ENGINE_get_pkey_meth_engine := @_ENGINE_get_pkey_meth_engine; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_get_pkey_meth_engine_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_get_pkey_meth_engine'); + {$ifend} + end; + + + ENGINE_get_pkey_asn1_meth_engine := LoadLibFunction(ADllHandle, ENGINE_get_pkey_asn1_meth_engine_procname); + FuncLoadError := not assigned(ENGINE_get_pkey_asn1_meth_engine); + if FuncLoadError then + begin + {$if not defined(ENGINE_get_pkey_asn1_meth_engine_allownil)} + ENGINE_get_pkey_asn1_meth_engine := @ERR_ENGINE_get_pkey_asn1_meth_engine; + {$ifend} + {$if declared(ENGINE_get_pkey_asn1_meth_engine_introduced)} + if LibVersion < ENGINE_get_pkey_asn1_meth_engine_introduced then + begin + {$if declared(FC_ENGINE_get_pkey_asn1_meth_engine)} + ENGINE_get_pkey_asn1_meth_engine := @FC_ENGINE_get_pkey_asn1_meth_engine; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_get_pkey_asn1_meth_engine_removed)} + if ENGINE_get_pkey_asn1_meth_engine_removed <= LibVersion then + begin + {$if declared(_ENGINE_get_pkey_asn1_meth_engine)} + ENGINE_get_pkey_asn1_meth_engine := @_ENGINE_get_pkey_asn1_meth_engine; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_get_pkey_asn1_meth_engine_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_get_pkey_asn1_meth_engine'); + {$ifend} + end; + + + ENGINE_set_default_RSA := LoadLibFunction(ADllHandle, ENGINE_set_default_RSA_procname); + FuncLoadError := not assigned(ENGINE_set_default_RSA); + if FuncLoadError then + begin + {$if not defined(ENGINE_set_default_RSA_allownil)} + ENGINE_set_default_RSA := @ERR_ENGINE_set_default_RSA; + {$ifend} + {$if declared(ENGINE_set_default_RSA_introduced)} + if LibVersion < ENGINE_set_default_RSA_introduced then + begin + {$if declared(FC_ENGINE_set_default_RSA)} + ENGINE_set_default_RSA := @FC_ENGINE_set_default_RSA; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_set_default_RSA_removed)} + if ENGINE_set_default_RSA_removed <= LibVersion then + begin + {$if declared(_ENGINE_set_default_RSA)} + ENGINE_set_default_RSA := @_ENGINE_set_default_RSA; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_set_default_RSA_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_set_default_RSA'); + {$ifend} + end; + + + ENGINE_set_default_string := LoadLibFunction(ADllHandle, ENGINE_set_default_string_procname); + FuncLoadError := not assigned(ENGINE_set_default_string); + if FuncLoadError then + begin + {$if not defined(ENGINE_set_default_string_allownil)} + ENGINE_set_default_string := @ERR_ENGINE_set_default_string; + {$ifend} + {$if declared(ENGINE_set_default_string_introduced)} + if LibVersion < ENGINE_set_default_string_introduced then + begin + {$if declared(FC_ENGINE_set_default_string)} + ENGINE_set_default_string := @FC_ENGINE_set_default_string; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_set_default_string_removed)} + if ENGINE_set_default_string_removed <= LibVersion then + begin + {$if declared(_ENGINE_set_default_string)} + ENGINE_set_default_string := @_ENGINE_set_default_string; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_set_default_string_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_set_default_string'); + {$ifend} + end; + + + ENGINE_set_default_DSA := LoadLibFunction(ADllHandle, ENGINE_set_default_DSA_procname); + FuncLoadError := not assigned(ENGINE_set_default_DSA); + if FuncLoadError then + begin + {$if not defined(ENGINE_set_default_DSA_allownil)} + ENGINE_set_default_DSA := @ERR_ENGINE_set_default_DSA; + {$ifend} + {$if declared(ENGINE_set_default_DSA_introduced)} + if LibVersion < ENGINE_set_default_DSA_introduced then + begin + {$if declared(FC_ENGINE_set_default_DSA)} + ENGINE_set_default_DSA := @FC_ENGINE_set_default_DSA; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_set_default_DSA_removed)} + if ENGINE_set_default_DSA_removed <= LibVersion then + begin + {$if declared(_ENGINE_set_default_DSA)} + ENGINE_set_default_DSA := @_ENGINE_set_default_DSA; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_set_default_DSA_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_set_default_DSA'); + {$ifend} + end; + + + ENGINE_set_default_EC := LoadLibFunction(ADllHandle, ENGINE_set_default_EC_procname); + FuncLoadError := not assigned(ENGINE_set_default_EC); + if FuncLoadError then + begin + {$if not defined(ENGINE_set_default_EC_allownil)} + ENGINE_set_default_EC := @ERR_ENGINE_set_default_EC; + {$ifend} + {$if declared(ENGINE_set_default_EC_introduced)} + if LibVersion < ENGINE_set_default_EC_introduced then + begin + {$if declared(FC_ENGINE_set_default_EC)} + ENGINE_set_default_EC := @FC_ENGINE_set_default_EC; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_set_default_EC_removed)} + if ENGINE_set_default_EC_removed <= LibVersion then + begin + {$if declared(_ENGINE_set_default_EC)} + ENGINE_set_default_EC := @_ENGINE_set_default_EC; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_set_default_EC_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_set_default_EC'); + {$ifend} + end; + + + ENGINE_set_default_DH := LoadLibFunction(ADllHandle, ENGINE_set_default_DH_procname); + FuncLoadError := not assigned(ENGINE_set_default_DH); + if FuncLoadError then + begin + {$if not defined(ENGINE_set_default_DH_allownil)} + ENGINE_set_default_DH := @ERR_ENGINE_set_default_DH; + {$ifend} + {$if declared(ENGINE_set_default_DH_introduced)} + if LibVersion < ENGINE_set_default_DH_introduced then + begin + {$if declared(FC_ENGINE_set_default_DH)} + ENGINE_set_default_DH := @FC_ENGINE_set_default_DH; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_set_default_DH_removed)} + if ENGINE_set_default_DH_removed <= LibVersion then + begin + {$if declared(_ENGINE_set_default_DH)} + ENGINE_set_default_DH := @_ENGINE_set_default_DH; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_set_default_DH_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_set_default_DH'); + {$ifend} + end; + + + ENGINE_set_default_RAND := LoadLibFunction(ADllHandle, ENGINE_set_default_RAND_procname); + FuncLoadError := not assigned(ENGINE_set_default_RAND); + if FuncLoadError then + begin + {$if not defined(ENGINE_set_default_RAND_allownil)} + ENGINE_set_default_RAND := @ERR_ENGINE_set_default_RAND; + {$ifend} + {$if declared(ENGINE_set_default_RAND_introduced)} + if LibVersion < ENGINE_set_default_RAND_introduced then + begin + {$if declared(FC_ENGINE_set_default_RAND)} + ENGINE_set_default_RAND := @FC_ENGINE_set_default_RAND; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_set_default_RAND_removed)} + if ENGINE_set_default_RAND_removed <= LibVersion then + begin + {$if declared(_ENGINE_set_default_RAND)} + ENGINE_set_default_RAND := @_ENGINE_set_default_RAND; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_set_default_RAND_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_set_default_RAND'); + {$ifend} + end; + + + ENGINE_set_default_ciphers := LoadLibFunction(ADllHandle, ENGINE_set_default_ciphers_procname); + FuncLoadError := not assigned(ENGINE_set_default_ciphers); + if FuncLoadError then + begin + {$if not defined(ENGINE_set_default_ciphers_allownil)} + ENGINE_set_default_ciphers := @ERR_ENGINE_set_default_ciphers; + {$ifend} + {$if declared(ENGINE_set_default_ciphers_introduced)} + if LibVersion < ENGINE_set_default_ciphers_introduced then + begin + {$if declared(FC_ENGINE_set_default_ciphers)} + ENGINE_set_default_ciphers := @FC_ENGINE_set_default_ciphers; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_set_default_ciphers_removed)} + if ENGINE_set_default_ciphers_removed <= LibVersion then + begin + {$if declared(_ENGINE_set_default_ciphers)} + ENGINE_set_default_ciphers := @_ENGINE_set_default_ciphers; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_set_default_ciphers_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_set_default_ciphers'); + {$ifend} + end; + + + ENGINE_set_default_digests := LoadLibFunction(ADllHandle, ENGINE_set_default_digests_procname); + FuncLoadError := not assigned(ENGINE_set_default_digests); + if FuncLoadError then + begin + {$if not defined(ENGINE_set_default_digests_allownil)} + ENGINE_set_default_digests := @ERR_ENGINE_set_default_digests; + {$ifend} + {$if declared(ENGINE_set_default_digests_introduced)} + if LibVersion < ENGINE_set_default_digests_introduced then + begin + {$if declared(FC_ENGINE_set_default_digests)} + ENGINE_set_default_digests := @FC_ENGINE_set_default_digests; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_set_default_digests_removed)} + if ENGINE_set_default_digests_removed <= LibVersion then + begin + {$if declared(_ENGINE_set_default_digests)} + ENGINE_set_default_digests := @_ENGINE_set_default_digests; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_set_default_digests_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_set_default_digests'); + {$ifend} + end; + + + ENGINE_set_default_pkey_meths := LoadLibFunction(ADllHandle, ENGINE_set_default_pkey_meths_procname); + FuncLoadError := not assigned(ENGINE_set_default_pkey_meths); + if FuncLoadError then + begin + {$if not defined(ENGINE_set_default_pkey_meths_allownil)} + ENGINE_set_default_pkey_meths := @ERR_ENGINE_set_default_pkey_meths; + {$ifend} + {$if declared(ENGINE_set_default_pkey_meths_introduced)} + if LibVersion < ENGINE_set_default_pkey_meths_introduced then + begin + {$if declared(FC_ENGINE_set_default_pkey_meths)} + ENGINE_set_default_pkey_meths := @FC_ENGINE_set_default_pkey_meths; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_set_default_pkey_meths_removed)} + if ENGINE_set_default_pkey_meths_removed <= LibVersion then + begin + {$if declared(_ENGINE_set_default_pkey_meths)} + ENGINE_set_default_pkey_meths := @_ENGINE_set_default_pkey_meths; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_set_default_pkey_meths_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_set_default_pkey_meths'); + {$ifend} + end; + + + ENGINE_set_default_pkey_asn1_meths := LoadLibFunction(ADllHandle, ENGINE_set_default_pkey_asn1_meths_procname); + FuncLoadError := not assigned(ENGINE_set_default_pkey_asn1_meths); + if FuncLoadError then + begin + {$if not defined(ENGINE_set_default_pkey_asn1_meths_allownil)} + ENGINE_set_default_pkey_asn1_meths := @ERR_ENGINE_set_default_pkey_asn1_meths; + {$ifend} + {$if declared(ENGINE_set_default_pkey_asn1_meths_introduced)} + if LibVersion < ENGINE_set_default_pkey_asn1_meths_introduced then + begin + {$if declared(FC_ENGINE_set_default_pkey_asn1_meths)} + ENGINE_set_default_pkey_asn1_meths := @FC_ENGINE_set_default_pkey_asn1_meths; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_set_default_pkey_asn1_meths_removed)} + if ENGINE_set_default_pkey_asn1_meths_removed <= LibVersion then + begin + {$if declared(_ENGINE_set_default_pkey_asn1_meths)} + ENGINE_set_default_pkey_asn1_meths := @_ENGINE_set_default_pkey_asn1_meths; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_set_default_pkey_asn1_meths_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_set_default_pkey_asn1_meths'); + {$ifend} + end; + + + ENGINE_set_default := LoadLibFunction(ADllHandle, ENGINE_set_default_procname); + FuncLoadError := not assigned(ENGINE_set_default); + if FuncLoadError then + begin + {$if not defined(ENGINE_set_default_allownil)} + ENGINE_set_default := @ERR_ENGINE_set_default; + {$ifend} + {$if declared(ENGINE_set_default_introduced)} + if LibVersion < ENGINE_set_default_introduced then + begin + {$if declared(FC_ENGINE_set_default)} + ENGINE_set_default := @FC_ENGINE_set_default; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_set_default_removed)} + if ENGINE_set_default_removed <= LibVersion then + begin + {$if declared(_ENGINE_set_default)} + ENGINE_set_default := @_ENGINE_set_default; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_set_default_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_set_default'); + {$ifend} + end; + + + ENGINE_add_conf_module := LoadLibFunction(ADllHandle, ENGINE_add_conf_module_procname); + FuncLoadError := not assigned(ENGINE_add_conf_module); + if FuncLoadError then + begin + {$if not defined(ENGINE_add_conf_module_allownil)} + ENGINE_add_conf_module := @ERR_ENGINE_add_conf_module; + {$ifend} + {$if declared(ENGINE_add_conf_module_introduced)} + if LibVersion < ENGINE_add_conf_module_introduced then + begin + {$if declared(FC_ENGINE_add_conf_module)} + ENGINE_add_conf_module := @FC_ENGINE_add_conf_module; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_add_conf_module_removed)} + if ENGINE_add_conf_module_removed <= LibVersion then + begin + {$if declared(_ENGINE_add_conf_module)} + ENGINE_add_conf_module := @_ENGINE_add_conf_module; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_add_conf_module_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_add_conf_module'); + {$ifend} + end; + + + ENGINE_get_static_state := LoadLibFunction(ADllHandle, ENGINE_get_static_state_procname); + FuncLoadError := not assigned(ENGINE_get_static_state); + if FuncLoadError then + begin + {$if not defined(ENGINE_get_static_state_allownil)} + ENGINE_get_static_state := @ERR_ENGINE_get_static_state; + {$ifend} + {$if declared(ENGINE_get_static_state_introduced)} + if LibVersion < ENGINE_get_static_state_introduced then + begin + {$if declared(FC_ENGINE_get_static_state)} + ENGINE_get_static_state := @FC_ENGINE_get_static_state; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ENGINE_get_static_state_removed)} + if ENGINE_get_static_state_removed <= LibVersion then + begin + {$if declared(_ENGINE_get_static_state)} + ENGINE_get_static_state := @_ENGINE_get_static_state; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ENGINE_get_static_state_allownil)} + if FuncLoadError then + AFailed.Add('ENGINE_get_static_state'); + {$ifend} + end; + + +end; + +procedure Unload; +begin + ENGINE_get_first := nil; + ENGINE_get_last := nil; + ENGINE_get_next := nil; + ENGINE_get_prev := nil; + ENGINE_add := nil; + ENGINE_remove := nil; + ENGINE_by_id := nil; + ENGINE_load_builtin_engines := nil; + ENGINE_get_table_flags := nil; + ENGINE_set_table_flags := nil; + ENGINE_register_RSA := nil; + ENGINE_unregister_RSA := nil; + ENGINE_register_all_RSA := nil; + ENGINE_register_DSA := nil; + ENGINE_unregister_DSA := nil; + ENGINE_register_all_DSA := nil; + ENGINE_register_EC := nil; + ENGINE_unregister_EC := nil; + ENGINE_register_all_EC := nil; + ENGINE_register_DH := nil; + ENGINE_unregister_DH := nil; + ENGINE_register_all_DH := nil; + ENGINE_register_RAND := nil; + ENGINE_unregister_RAND := nil; + ENGINE_register_all_RAND := nil; + ENGINE_register_ciphers := nil; + ENGINE_unregister_ciphers := nil; + ENGINE_register_all_ciphers := nil; + ENGINE_register_digests := nil; + ENGINE_unregister_digests := nil; + ENGINE_register_all_digests := nil; + ENGINE_register_pkey_meths := nil; + ENGINE_unregister_pkey_meths := nil; + ENGINE_register_all_pkey_meths := nil; + ENGINE_register_pkey_asn1_meths := nil; + ENGINE_unregister_pkey_asn1_meths := nil; + ENGINE_register_all_pkey_asn1_meths := nil; + ENGINE_register_complete := nil; + ENGINE_register_all_complete := nil; + ENGINE_ctrl := nil; + ENGINE_cmd_is_executable := nil; + ENGINE_ctrl_cmd := nil; + ENGINE_ctrl_cmd_string := nil; + ENGINE_new := nil; + ENGINE_free := nil; + ENGINE_up_ref := nil; + ENGINE_set_id := nil; + ENGINE_set_name := nil; + ENGINE_set_RSA := nil; + ENGINE_set_DSA := nil; + ENGINE_set_EC := nil; + ENGINE_set_DH := nil; + ENGINE_set_RAND := nil; + ENGINE_set_destroy_function := nil; + ENGINE_set_init_function := nil; + ENGINE_set_finish_function := nil; + ENGINE_set_ctrl_function := nil; + ENGINE_set_load_privkey_function := nil; + ENGINE_set_load_pubkey_function := nil; + ENGINE_set_ciphers := nil; + ENGINE_set_digests := nil; + ENGINE_set_pkey_meths := nil; + ENGINE_set_pkey_asn1_meths := nil; + ENGINE_set_flags := nil; + ENGINE_set_cmd_defns := nil; + ENGINE_set_ex_data := nil; + ENGINE_get_ex_data := nil; + ENGINE_get_id := nil; + ENGINE_get_name := nil; + ENGINE_get_RSA := nil; + ENGINE_get_DSA := nil; + ENGINE_get_EC := nil; + ENGINE_get_DH := nil; + ENGINE_get_RAND := nil; + ENGINE_get_destroy_function := nil; + ENGINE_get_init_function := nil; + ENGINE_get_finish_function := nil; + ENGINE_get_ctrl_function := nil; + ENGINE_get_load_privkey_function := nil; + ENGINE_get_load_pubkey_function := nil; + ENGINE_get_ciphers := nil; + ENGINE_get_digests := nil; + ENGINE_get_pkey_meths := nil; + ENGINE_get_pkey_asn1_meths := nil; + ENGINE_get_cipher := nil; + ENGINE_get_digest := nil; + ENGINE_get_pkey_meth := nil; + ENGINE_get_pkey_asn1_meth := nil; + ENGINE_get_pkey_asn1_meth_str := nil; + ENGINE_pkey_asn1_find_str := nil; + ENGINE_get_cmd_defns := nil; + ENGINE_get_flags := nil; + ENGINE_init := nil; + ENGINE_finish := nil; + ENGINE_load_private_key := nil; + ENGINE_load_public_key := nil; + ENGINE_get_default_RSA := nil; + ENGINE_get_default_DSA := nil; + ENGINE_get_default_EC := nil; + ENGINE_get_default_DH := nil; + ENGINE_get_default_RAND := nil; + ENGINE_get_cipher_engine := nil; + ENGINE_get_digest_engine := nil; + ENGINE_get_pkey_meth_engine := nil; + ENGINE_get_pkey_asn1_meth_engine := nil; + ENGINE_set_default_RSA := nil; + ENGINE_set_default_string := nil; + ENGINE_set_default_DSA := nil; + ENGINE_set_default_EC := nil; + ENGINE_set_default_DH := nil; + ENGINE_set_default_RAND := nil; + ENGINE_set_default_ciphers := nil; + ENGINE_set_default_digests := nil; + ENGINE_set_default_pkey_meths := nil; + ENGINE_set_default_pkey_asn1_meths := nil; + ENGINE_set_default := nil; + ENGINE_add_conf_module := nil; + ENGINE_get_static_state := nil; +end; +{$ELSE} +{$ENDIF} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +initialization + Register_SSLLoader(@Load,'LibCrypto'); + Register_SSLUnloader(@Unload); +{$ENDIF} +end. diff --git a/IdOpenSSLHeaders_engineerr.pas b/IdOpenSSLHeaders_engineerr.pas new file mode 100644 index 0000000..43431e6 --- /dev/null +++ b/IdOpenSSLHeaders_engineerr.pas @@ -0,0 +1,223 @@ + (* This unit was generated using the script genOpenSSLHdrs.sh from the source file IdOpenSSLHeaders_engineerr.h2pas + It should not be modified directly. All changes should be made to IdOpenSSLHeaders_engineerr.h2pas + and this file regenerated. IdOpenSSLHeaders_engineerr.h2pas is distributed with the full Indy + Distribution. + *) + +{$i IdCompilerDefines.inc} +{$i IdSSLOpenSSLDefines.inc} +{$IFNDEF USE_OPENSSL} + { error Should not compile if USE_OPENSSL is not defined!!!} +{$ENDIF} +{******************************************************************************} +{ } +{ Indy (Internet Direct) - Internet Protocols Simplified } +{ } +{ https://www.indyproject.org/ } +{ https://gitter.im/IndySockets/Indy } +{ } +{******************************************************************************} +{ } +{ This file is part of the Indy (Internet Direct) project, and is offered } +{ under the dual-licensing agreement described on the Indy website. } +{ (https://www.indyproject.org/license/) } +{ } +{ Copyright: } +{ (c) 1993-2020, Chad Z. Hower and the Indy Pit Crew. All rights reserved. } +{ } +{******************************************************************************} +{ } +{ } +{******************************************************************************} + +unit IdOpenSSLHeaders_engineerr; + +interface + +// Headers for OpenSSL 1.1.1 +// engineerr.h + + +uses + IdCTypes, + IdGlobal, + IdSSLOpenSSLConsts; + +const + (* + * ENGINE function codes. + *) + ENGINE_F_DIGEST_UPDATE = 198; + ENGINE_F_DYNAMIC_CTRL = 180; + ENGINE_F_DYNAMIC_GET_DATA_CTX = 181; + ENGINE_F_DYNAMIC_LOAD = 182; + ENGINE_F_DYNAMIC_SET_DATA_CTX = 183; + ENGINE_F_ENGINE_ADD = 105; + ENGINE_F_ENGINE_BY_ID = 106; + ENGINE_F_ENGINE_CMD_IS_EXECUTABLE = 170; + ENGINE_F_ENGINE_CTRL = 142; + ENGINE_F_ENGINE_CTRL_CMD = 178; + ENGINE_F_ENGINE_CTRL_CMD_STRING = 171; + ENGINE_F_ENGINE_FINISH = 107; + ENGINE_F_ENGINE_GET_CIPHER = 185; + ENGINE_F_ENGINE_GET_DIGEST = 186; + ENGINE_F_ENGINE_GET_FIRST = 195; + ENGINE_F_ENGINE_GET_LAST = 196; + ENGINE_F_ENGINE_GET_NEXT = 115; + ENGINE_F_ENGINE_GET_PKEY_ASN1_METH = 193; + ENGINE_F_ENGINE_GET_PKEY_METH = 192; + ENGINE_F_ENGINE_GET_PREV = 116; + ENGINE_F_ENGINE_INIT = 119; + ENGINE_F_ENGINE_LIST_ADD = 120; + ENGINE_F_ENGINE_LIST_REMOVE = 121; + ENGINE_F_ENGINE_LOAD_PRIVATE_KEY = 150; + ENGINE_F_ENGINE_LOAD_PUBLIC_KEY = 151; + ENGINE_F_ENGINE_LOAD_SSL_CLIENT_CERT = 194; + ENGINE_F_ENGINE_NEW = 122; + ENGINE_F_ENGINE_PKEY_ASN1_FIND_STR = 197; + ENGINE_F_ENGINE_REMOVE = 123; + ENGINE_F_ENGINE_SET_DEFAULT_STRING = 189; + ENGINE_F_ENGINE_SET_ID = 129; + ENGINE_F_ENGINE_SET_NAME = 130; + ENGINE_F_ENGINE_TABLE_REGISTER = 184; + ENGINE_F_ENGINE_UNLOCKED_FINISH = 191; + ENGINE_F_ENGINE_UP_REF = 190; + ENGINE_F_INT_CLEANUP_ITEM = 199; + ENGINE_F_INT_CTRL_HELPER = 172; + ENGINE_F_INT_ENGINE_CONFIGURE = 188; + ENGINE_F_INT_ENGINE_MODULE_INIT = 187; + ENGINE_F_OSSL_HMAC_INIT = 200; + + (* + * ENGINE reason codes. + *) + ENGINE_R_ALREADY_LOADED = 100; + ENGINE_R_ARGUMENT_IS_NOT_A_NUMBER = 133; + ENGINE_R_CMD_NOT_EXECUTABLE = 134; + ENGINE_R_COMMAND_TAKES_INPUT = 135; + ENGINE_R_COMMAND_TAKES_NO_INPUT = 136; + ENGINE_R_CONFLICTING_ENGINE_ID = 103; + ENGINE_R_CTRL_COMMAND_NOT_IMPLEMENTED = 119; + ENGINE_R_DSO_FAILURE = 104; + ENGINE_R_DSO_NOT_FOUND = 132; + ENGINE_R_ENGINES_SECTION_ERROR = 148; + ENGINE_R_ENGINE_CONFIGURATION_ERROR = 102; + ENGINE_R_ENGINE_IS_NOT_IN_LIST = 105; + ENGINE_R_ENGINE_SECTION_ERROR = 149; + ENGINE_R_FAILED_LOADING_PRIVATE_KEY = 128; + ENGINE_R_FAILED_LOADING_PUBLIC_KEY = 129; + ENGINE_R_FINISH_FAILED = 106; + ENGINE_R_ID_OR_NAME_MISSING = 108; + ENGINE_R_INIT_FAILED = 109; + ENGINE_R_INTERNAL_LIST_ERROR = 110; + ENGINE_R_INVALID_ARGUMENT = 143; + ENGINE_R_INVALID_CMD_NAME = 137; + ENGINE_R_INVALID_CMD_NUMBER = 138; + ENGINE_R_INVALID_INIT_VALUE = 151; + ENGINE_R_INVALID_STRING = 150; + ENGINE_R_NOT_INITIALISED = 117; + ENGINE_R_NOT_LOADED = 112; + ENGINE_R_NO_CONTROL_FUNCTION = 120; + ENGINE_R_NO_INDEX = 144; + ENGINE_R_NO_LOAD_FUNCTION = 125; + ENGINE_R_NO_REFERENCE = 130; + ENGINE_R_NO_SUCH_ENGINE = 116; + ENGINE_R_UNIMPLEMENTED_CIPHER = 146; + ENGINE_R_UNIMPLEMENTED_DIGEST = 147; + ENGINE_R_UNIMPLEMENTED_PUBLIC_KEY_METHOD = 101; + ENGINE_R_VERSION_INCOMPATIBILITY = 145; + + { The EXTERNALSYM directive is ignored by FPC, however, it is used by Delphi as follows: + + The EXTERNALSYM directive prevents the specified Delphi symbol from appearing in header + files generated for C++. } + + {$EXTERNALSYM ERR_load_ENGINE_strings} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +var + ERR_load_ENGINE_strings: function : TIdC_INT; cdecl = nil; + +{$ELSE} + function ERR_load_ENGINE_strings: TIdC_INT cdecl; external CLibCrypto; + +{$ENDIF} + +implementation + + uses + classes, + IdSSLOpenSSLExceptionHandlers, + IdResourceStringsOpenSSL + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + ,IdSSLOpenSSLLoader + {$ENDIF}; + + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +const + ERR_load_ENGINE_strings_procname = 'ERR_load_ENGINE_strings'; + + +{$WARN NO_RETVAL OFF} +function ERR_ERR_load_ENGINE_strings: TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ERR_load_ENGINE_strings_procname); +end; + + + +{$WARN NO_RETVAL ON} + +procedure Load(const ADllHandle: TIdLibHandle; LibVersion: TIdC_UINT; const AFailed: TStringList); + +var FuncLoadError: boolean; + +begin + ERR_load_ENGINE_strings := LoadLibFunction(ADllHandle, ERR_load_ENGINE_strings_procname); + FuncLoadError := not assigned(ERR_load_ENGINE_strings); + if FuncLoadError then + begin + {$if not defined(ERR_load_ENGINE_strings_allownil)} + ERR_load_ENGINE_strings := @ERR_ERR_load_ENGINE_strings; + {$ifend} + {$if declared(ERR_load_ENGINE_strings_introduced)} + if LibVersion < ERR_load_ENGINE_strings_introduced then + begin + {$if declared(FC_ERR_load_ENGINE_strings)} + ERR_load_ENGINE_strings := @FC_ERR_load_ENGINE_strings; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ERR_load_ENGINE_strings_removed)} + if ERR_load_ENGINE_strings_removed <= LibVersion then + begin + {$if declared(_ERR_load_ENGINE_strings)} + ERR_load_ENGINE_strings := @_ERR_load_ENGINE_strings; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ERR_load_ENGINE_strings_allownil)} + if FuncLoadError then + AFailed.Add('ERR_load_ENGINE_strings'); + {$ifend} + end; + + +end; + +procedure Unload; +begin + ERR_load_ENGINE_strings := nil; +end; +{$ELSE} +{$ENDIF} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +initialization + Register_SSLLoader(@Load,'LibCrypto'); + Register_SSLUnloader(@Unload); +{$ENDIF} +end. diff --git a/IdOpenSSLHeaders_err.pas b/IdOpenSSLHeaders_err.pas new file mode 100644 index 0000000..a5159a9 --- /dev/null +++ b/IdOpenSSLHeaders_err.pas @@ -0,0 +1,1852 @@ + (* This unit was generated using the script genOpenSSLHdrs.sh from the source file IdOpenSSLHeaders_err.h2pas + It should not be modified directly. All changes should be made to IdOpenSSLHeaders_err.h2pas + and this file regenerated. IdOpenSSLHeaders_err.h2pas is distributed with the full Indy + Distribution. + *) + +{$i IdCompilerDefines.inc} +{$i IdSSLOpenSSLDefines.inc} +{$IFNDEF USE_OPENSSL} + { error Should not compile if USE_OPENSSL is not defined!!!} +{$ENDIF} +{******************************************************************************} +{ } +{ Indy (Internet Direct) - Internet Protocols Simplified } +{ } +{ https://www.indyproject.org/ } +{ https://gitter.im/IndySockets/Indy } +{ } +{******************************************************************************} +{ } +{ This file is part of the Indy (Internet Direct) project, and is offered } +{ under the dual-licensing agreement described on the Indy website. } +{ (https://www.indyproject.org/license/) } +{ } +{ Copyright: } +{ (c) 1993-2020, Chad Z. Hower and the Indy Pit Crew. All rights reserved. } +{ } +{******************************************************************************} +{ } +{ } +{******************************************************************************} + +unit IdOpenSSLHeaders_err; + +interface + +// Headers for OpenSSL 1.1.1 +// err.h + + +uses + IdCTypes, + IdGlobal, + IdSSLOpenSSLConsts, + IdOpenSSLHeaders_ossl_typ; + +const + ERR_TXT_MALLOCED = $01; + ERR_TXT_STRING = $02; + ERR_FLAG_MARK = $01; + ERR_FLAG_CLEAR = $02; + + ERR_NUM_ERRORS = 16; + +//* library */ + ERR_LIB_SYS = 2; + ERR_LIB_BN = 3; + ERR_LIB_RSA = 4; + ERR_LIB_DH = 5; + ERR_LIB_EVP = 6; + ERR_LIB_BUF = 7; + ERR_LIB_OBJ = 8; + ERR_LIB_PEM = 9; + ERR_LIB_DSA = 10; + ERR_LIB_X509 = 11; + // ERR_LIB_METH 12 + ERR_LIB_ASN1 = 13; + ERR_LIB_CONF = 14; + ERR_LIB_CRYPTO = 15; + ERR_LIB_EC = 16; + ERR_LIB_SSL = 20; +(* #define ERR_LIB_SSL23 21 *) +(* #define ERR_LIB_SSL2 22 *) +(* #define ERR_LIB_SSL3 23 *) +(* #define ERR_LIB_RSAREF 30 *) +(* #define ERR_LIB_PROXY 31 *) + ERR_LIB_BIO = 32; + ERR_LIB_PKCS7 = 33; + ERR_LIB_X509V3 = 34; + ERR_LIB_PKCS12 = 35; + ERR_LIB_RAND = 36; + ERR_LIB_DSO = 37; + ERR_LIB_ENGINE = 38; + ERR_LIB_OCSP = 39; + ERR_LIB_UI = 40; + ERR_LIB_COMP = 41; + ERR_LIB_ECDSA = 42; + ERR_LIB_ECDH = 43; + ERR_LIB_OSSL_STORE = 44; + ERR_LIB_FIPS = 45; + ERR_LIB_CMS = 46; + ERR_LIB_TS = 47; + ERR_LIB_HMAC = 48; +(* # define ERR_LIB_JPAKE 49 *) + ERR_LIB_CT = 50; + ERR_LIB_ASYNC = 51; + ERR_LIB_KDF = 52; + ERR_LIB_SM2 = 53; + ERR_LIB_USER = 128; + +//* OS functions */ + SYS_F_FOPEN = 1; + SYS_F_CONNECT = 2; + SYS_F_GETSERVBYNAME = 3; + SYS_F_SOCKET = 4; + SYS_F_IOCTLSOCKET = 5; + SYS_F_BIND = 6; + SYS_F_LISTEN = 7; + SYS_F_ACCEPT = 8; + SYS_F_WSASTARTUP = 9; (* Winsock stuff *) + SYS_F_OPENDIR = 10; + SYS_F_FREAD = 11; + SYS_F_GETADDRINFO = 12; + SYS_F_GETNAMEINFO = 13; + SYS_F_SETSOCKOPT = 14; + SYS_F_GETSOCKOPT = 15; + SYS_F_GETSOCKNAME = 16; + SYS_F_GETHOSTBYNAME = 17; + SYS_F_FFLUSH = 18; + SYS_F_OPEN = 19; + SYS_F_CLOSE = 20; + SYS_F_IOCTL = 21; + SYS_F_STAT = 22; + SYS_F_FCNTL = 23; + SYS_F_FSTAT = 24; + +//* reasons */ + ERR_R_SYS_LIB = ERR_LIB_SYS; //2 + ERR_R_BN_LIB = ERR_LIB_BN; //3 + ERR_R_RSA_LIB = ERR_LIB_RSA; //4 + ERR_R_DH_LIB = ERR_LIB_DH; //5 + ERR_R_EVP_LIB = ERR_LIB_EVP; //6 + ERR_R_BUF_LIB = ERR_LIB_BUF; //7 + ERR_R_OBJ_LIB = ERR_LIB_OBJ; //8 + ERR_R_PEM_LIB = ERR_LIB_PEM; //9 + ERR_R_DSA_LIB = ERR_LIB_DSA; //10 + ERR_R_X509_LIB = ERR_LIB_X509; //11 + ERR_R_ASN1_LIB = ERR_LIB_ASN1; //13 + ERR_R_EC_LIB = ERR_LIB_EC; //16 + ERR_R_BIO_LIB = ERR_LIB_BIO; //32 + ERR_R_PKCS7_LIB = ERR_LIB_PKCS7; //33 + ERR_R_X509V3_LIB = ERR_LIB_X509V3; //34 + ERR_R_ENGINE_LIB = ERR_LIB_ENGINE; //38 + ERR_R_UI_LIB = ERR_LIB_UI; //40 + ERR_R_ECDSA_LIB = ERR_LIB_ECDSA; //42 + ERR_R_OSSL_STORE_LIB = ERR_LIB_OSSL_STORE; //44 + + ERR_R_NESTED_ASN1_ERROR = 58; + ERR_R_MISSING_ASN1_EOS = 63; + + //* fatal error */ + ERR_R_FATAL = 64; + ERR_R_MALLOC_FAILURE = (1 or ERR_R_FATAL); + ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED = (2 or ERR_R_FATAL); + ERR_R_PASSED_NULL_PARAMETER = (3 or ERR_R_FATAL); + ERR_R_INTERNAL_ERROR = (4 or ERR_R_FATAL); + ERR_R_DISABLED = (5 or ERR_R_FATAL); + ERR_R_INIT_FAIL = (6 or ERR_R_FATAL); + ERR_R_PASSED_INVALID_ARGUMENT = (7); + ERR_R_OPERATION_FAIL = (8 or ERR_R_FATAL); + ERR_R_PKCS12_LIB = ERR_LIB_PKCS12; + + +(* + * 99 is the maximum possible ERR_R_... code, higher values are reserved for + * the individual libraries + *) + +type + err_state_st = record + err_flags: array[0..ERR_NUM_ERRORS -1] of TIdC_INT; + err_buffer: array[0..ERR_NUM_ERRORS -1] of TIdC_ULONG; + err_data: array[0..ERR_NUM_ERRORS -1] of PIdAnsiChar; + err_data_flags: array[0..ERR_NUM_ERRORS -1] of TIdC_INT; + err_file: array[0..ERR_NUM_ERRORS -1] of PIdAnsiChar; + err_line: array[0..ERR_NUM_ERRORS -1] of TIdC_INT; + top, bottom: TIdC_INT; + end; + ERR_STATE = err_state_st; + PERR_STATE = ^ERR_STATE; + + ERR_string_data_st = record + error: TIdC_ULONG; + string_: PIdAnsiChar; + end; + ERR_STRING_DATA = ERR_string_data_st; + PERR_STRING_DATA = ^ERR_STRING_DATA; + + ERR_print_errors_cb_cb = function(str: PIdAnsiChar; len: TIdC_SIZET; u: Pointer): TIdC_INT; cdecl; + +// DEFINE_LHASH_OF(ERR_STRING_DATA); + + { The EXTERNALSYM directive is ignored by FPC, however, it is used by Delphi as follows: + + The EXTERNALSYM directive prevents the specified Delphi symbol from appearing in header + files generated for C++. } + + {$EXTERNALSYM ERR_new} {introduced 3.0.0} + {$EXTERNALSYM ERR_set_debug} {introduced 3.0.0} + {$EXTERNALSYM ERR_set_error} {introduced 3.0.0} + {$EXTERNALSYM ERR_set_error_data} + {$EXTERNALSYM ERR_get_error} + {$EXTERNALSYM ERR_get_error_line} + {$EXTERNALSYM ERR_get_error_line_data} + {$EXTERNALSYM ERR_peek_error} + {$EXTERNALSYM ERR_peek_error_line} + {$EXTERNALSYM ERR_peek_error_line_data} + {$EXTERNALSYM ERR_peek_last_error} + {$EXTERNALSYM ERR_peek_last_error_line} + {$EXTERNALSYM ERR_peek_last_error_line_data} + {$EXTERNALSYM ERR_clear_error} + {$EXTERNALSYM ERR_error_string} + {$EXTERNALSYM ERR_error_string_n} + {$EXTERNALSYM ERR_lib_error_string} + {$EXTERNALSYM ERR_func_error_string} + {$EXTERNALSYM ERR_reason_error_string} + {$EXTERNALSYM ERR_print_errors_cb} + {$EXTERNALSYM ERR_print_errors} + {$EXTERNALSYM ERR_load_strings} + {$EXTERNALSYM ERR_load_strings_const} {introduced 1.1.0} + {$EXTERNALSYM ERR_unload_strings} + {$EXTERNALSYM ERR_load_ERR_strings} + {$EXTERNALSYM ERR_get_state} + {$EXTERNALSYM ERR_get_next_error_library} + {$EXTERNALSYM ERR_set_mark} + {$EXTERNALSYM ERR_pop_to_mark} + {$EXTERNALSYM ERR_clear_last_mark} {introduced 1.1.0} +{helper_functions} +function ERR_GET_LIB(l: TIdC_INT): TIdC_ULONG; +{\helper_functions} + + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +var + {$EXTERNALSYM ERR_put_error} {removed 3.0.0} + {$EXTERNALSYM SSLErr} {removed 1.0.0} + {$EXTERNALSYM X509err} {removed 1.0.0} + {$EXTERNALSYM ERR_GET_REASON} {removed 1.0.0} + ERR_put_error: procedure (lib: TIdC_INT; func: TIdC_INT; reason: TIdC_INT; file_: PIdAnsiChar; line: TIdC_INT); cdecl = nil; {removed 3.0.0} + +{ From 3.0 onwards, replaced by a macro + define ERR_put_error(lib, func, reason, file, line) + (ERR_new(), + ERR_set_debug((file), (line), OPENSSL_FUNC), + ERR_set_error((lib), (reason), NULL))} + + ERR_new: procedure ; cdecl = nil; {introduced 3.0.0} + ERR_set_debug: procedure (const file_: PIdAnsiChar; line: integer; const func: PIdAnsiChar); cdecl = nil; {introduced 3.0.0} + ERR_set_error: procedure (lib: integer; reason: integer; fmt: PIdAnsiChar; args: array of const); cdecl = nil; {introduced 3.0.0} + + + ERR_set_error_data: procedure (data: PIdAnsiChar; flags: TIdC_INT); cdecl = nil; + + ERR_get_error: function : TIdC_ULONG; cdecl = nil; + ERR_get_error_line: function (file_: PPIdAnsiChar; line: PIdC_INT): TIdC_ULONG; cdecl = nil; + ERR_get_error_line_data: function (file_: PPIdAnsiChar; line: PIdC_INT; data: PPIdAnsiChar; flags: PIdC_INT): TIdC_ULONG; cdecl = nil; + + ERR_peek_error: function : TIdC_ULONG; cdecl = nil; + ERR_peek_error_line: function (file_: PPIdAnsiChar; line: PIdC_INT): TIdC_ULONG; cdecl = nil; + ERR_peek_error_line_data: function (file_: PPIdAnsiChar; line: PIdC_INT; data: PPIdAnsiChar; flags: PIdC_INT): TIdC_ULONG; cdecl = nil; + + ERR_peek_last_error: function : TIdC_ULONG; cdecl = nil; + ERR_peek_last_error_line: function (file_: PPIdAnsiChar; line: PIdC_INT): TIdC_ULONG; cdecl = nil; + ERR_peek_last_error_line_data: function (file_: PPIdAnsiChar; line: PIdC_INT; data: PPIdAnsiChar; flags: PIdC_INT): TIdC_ULONG; cdecl = nil; + + ERR_clear_error: procedure ; cdecl = nil; + ERR_error_string: function (e: TIdC_ULONG; buf: PIdAnsiChar): PIdAnsiChar; cdecl = nil; + ERR_error_string_n: procedure (e: TIdC_ULONG; buf: PIdAnsiChar; len: TIdC_SIZET); cdecl = nil; + ERR_lib_error_string: function (e: TIdC_ULONG): PIdAnsiChar; cdecl = nil; + ERR_func_error_string: function (e: TIdC_ULONG): PIdAnsiChar; cdecl = nil; + ERR_reason_error_string: function (e: TIdC_ULONG): PIdAnsiChar; cdecl = nil; + ERR_print_errors_cb: procedure (cb: ERR_print_errors_cb_cb; u: Pointer); cdecl = nil; + + ERR_print_errors: procedure (bp: PBIO); cdecl = nil; + // void ERR_add_error_data(int num, ...); + // procedure ERR_add_error_vdata(num: TIdC_INT; args: va_list); + ERR_load_strings: function (lib: TIdC_INT; str: PERR_STRING_DATA): TIdC_INT; cdecl = nil; + ERR_load_strings_const: function (str: PERR_STRING_DATA): TIdC_INT; cdecl = nil; {introduced 1.1.0} + ERR_unload_strings: function (lib: TIdC_INT; str: PERR_STRING_DATA): TIdC_INT; cdecl = nil; + ERR_load_ERR_strings: function : TIdC_INT; cdecl = nil; + + ERR_get_state: function : PERR_STATE; cdecl = nil; + ERR_get_next_error_library: function : TIdC_INT; cdecl = nil; + ERR_set_mark: function : TIdC_INT; cdecl = nil; + ERR_pop_to_mark: function : TIdC_INT; cdecl = nil; + ERR_clear_last_mark: function : TIdC_INT; cdecl = nil; {introduced 1.1.0} + + SSLErr: procedure (func: TIdC_INT; reason: TIdC_INT); cdecl = nil; {removed 1.0.0} + X509err: procedure (const f,r : TIdC_INT); cdecl = nil; {removed 1.0.0} + ERR_GET_REASON: function (const l : TIdC_INT) : TIdC_INT; cdecl = nil; {removed 1.0.0} + +{$ELSE} + +{ From 3.0 onwards, replaced by a macro + define ERR_put_error(lib, func, reason, file, line) + (ERR_new(), + ERR_set_debug((file), (line), OPENSSL_FUNC), + ERR_set_error((lib), (reason), NULL))} + + procedure ERR_new cdecl; external CLibCrypto; {introduced 3.0.0} + procedure ERR_set_debug(const file_: PIdAnsiChar; line: integer; const func: PIdAnsiChar) cdecl; external CLibCrypto; {introduced 3.0.0} + procedure ERR_set_error(lib: integer; reason: integer; fmt: PIdAnsiChar; args: array of const) cdecl; external CLibCrypto; {introduced 3.0.0} + + + procedure ERR_set_error_data(data: PIdAnsiChar; flags: TIdC_INT) cdecl; external CLibCrypto; + + function ERR_get_error: TIdC_ULONG cdecl; external CLibCrypto; + function ERR_get_error_line(file_: PPIdAnsiChar; line: PIdC_INT): TIdC_ULONG cdecl; external CLibCrypto; + function ERR_get_error_line_data(file_: PPIdAnsiChar; line: PIdC_INT; data: PPIdAnsiChar; flags: PIdC_INT): TIdC_ULONG cdecl; external CLibCrypto; + + function ERR_peek_error: TIdC_ULONG cdecl; external CLibCrypto; + function ERR_peek_error_line(file_: PPIdAnsiChar; line: PIdC_INT): TIdC_ULONG cdecl; external CLibCrypto; + function ERR_peek_error_line_data(file_: PPIdAnsiChar; line: PIdC_INT; data: PPIdAnsiChar; flags: PIdC_INT): TIdC_ULONG cdecl; external CLibCrypto; + + function ERR_peek_last_error: TIdC_ULONG cdecl; external CLibCrypto; + function ERR_peek_last_error_line(file_: PPIdAnsiChar; line: PIdC_INT): TIdC_ULONG cdecl; external CLibCrypto; + function ERR_peek_last_error_line_data(file_: PPIdAnsiChar; line: PIdC_INT; data: PPIdAnsiChar; flags: PIdC_INT): TIdC_ULONG cdecl; external CLibCrypto; + + procedure ERR_clear_error cdecl; external CLibCrypto; + function ERR_error_string(e: TIdC_ULONG; buf: PIdAnsiChar): PIdAnsiChar cdecl; external CLibCrypto; + procedure ERR_error_string_n(e: TIdC_ULONG; buf: PIdAnsiChar; len: TIdC_SIZET) cdecl; external CLibCrypto; + function ERR_lib_error_string(e: TIdC_ULONG): PIdAnsiChar cdecl; external CLibCrypto; + function ERR_func_error_string(e: TIdC_ULONG): PIdAnsiChar cdecl; external CLibCrypto; + function ERR_reason_error_string(e: TIdC_ULONG): PIdAnsiChar cdecl; external CLibCrypto; + procedure ERR_print_errors_cb(cb: ERR_print_errors_cb_cb; u: Pointer) cdecl; external CLibCrypto; + + procedure ERR_print_errors(bp: PBIO) cdecl; external CLibCrypto; + // void ERR_add_error_data(int num, ...); + // procedure ERR_add_error_vdata(num: TIdC_INT; args: va_list); + function ERR_load_strings(lib: TIdC_INT; str: PERR_STRING_DATA): TIdC_INT cdecl; external CLibCrypto; + function ERR_load_strings_const(str: PERR_STRING_DATA): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function ERR_unload_strings(lib: TIdC_INT; str: PERR_STRING_DATA): TIdC_INT cdecl; external CLibCrypto; + function ERR_load_ERR_strings: TIdC_INT cdecl; external CLibCrypto; + + function ERR_get_state: PERR_STATE cdecl; external CLibCrypto; + function ERR_get_next_error_library: TIdC_INT cdecl; external CLibCrypto; + function ERR_set_mark: TIdC_INT cdecl; external CLibCrypto; + function ERR_pop_to_mark: TIdC_INT cdecl; external CLibCrypto; + function ERR_clear_last_mark: TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + + + procedure ERR_put_error(lib: TIdC_INT; func: TIdC_INT; reason: TIdC_INT; file_: PIdAnsiChar; line: TIdC_INT); {removed 3.0.0} + procedure SSLErr(func: TIdC_INT; reason: TIdC_INT); {removed 1.0.0} + procedure X509err(const f,r : TIdC_INT); {removed 1.0.0} + function ERR_GET_REASON(const l : TIdC_INT) : TIdC_INT; {removed 1.0.0} +{$ENDIF} + +implementation + + uses + classes, + IdSSLOpenSSLExceptionHandlers, + IdResourceStringsOpenSSL + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + ,IdSSLOpenSSLLoader + {$ENDIF}; + +const + ERR_new_introduced = (byte(3) shl 8 or byte(0)) shl 8 or byte(0); + ERR_set_debug_introduced = (byte(3) shl 8 or byte(0)) shl 8 or byte(0); + ERR_set_error_introduced = (byte(3) shl 8 or byte(0)) shl 8 or byte(0); + ERR_load_strings_const_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + ERR_clear_last_mark_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + ERR_put_error_removed = (byte(3) shl 8 or byte(0)) shl 8 or byte(0); + SSLErr_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + X509err_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + ERR_GET_REASON_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + +{helper_functions} +function ERR_GET_LIB(l: TIdC_INT): TIdC_ULONG; +begin + Result := (l shr 24) and $ff; +end; +{\helper_functions} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +const + ERR_put_error_procname = 'ERR_put_error'; {removed 3.0.0} + +{ From 3.0 onwards, replaced by a macro + define ERR_put_error(lib, func, reason, file, line) + (ERR_new(), + ERR_set_debug((file), (line), OPENSSL_FUNC), + ERR_set_error((lib), (reason), NULL))} + + ERR_new_procname = 'ERR_new'; {introduced 3.0.0} + ERR_set_debug_procname = 'ERR_set_debug'; {introduced 3.0.0} + ERR_set_error_procname = 'ERR_set_error'; {introduced 3.0.0} + + + ERR_set_error_data_procname = 'ERR_set_error_data'; + + ERR_get_error_procname = 'ERR_get_error'; + ERR_get_error_line_procname = 'ERR_get_error_line'; + ERR_get_error_line_data_procname = 'ERR_get_error_line_data'; + + ERR_peek_error_procname = 'ERR_peek_error'; + ERR_peek_error_line_procname = 'ERR_peek_error_line'; + ERR_peek_error_line_data_procname = 'ERR_peek_error_line_data'; + + ERR_peek_last_error_procname = 'ERR_peek_last_error'; + ERR_peek_last_error_line_procname = 'ERR_peek_last_error_line'; + ERR_peek_last_error_line_data_procname = 'ERR_peek_last_error_line_data'; + + ERR_clear_error_procname = 'ERR_clear_error'; + ERR_error_string_procname = 'ERR_error_string'; + ERR_error_string_n_procname = 'ERR_error_string_n'; + ERR_lib_error_string_procname = 'ERR_lib_error_string'; + ERR_func_error_string_procname = 'ERR_func_error_string'; + ERR_reason_error_string_procname = 'ERR_reason_error_string'; + ERR_print_errors_cb_procname = 'ERR_print_errors_cb'; + + ERR_print_errors_procname = 'ERR_print_errors'; + // void ERR_add_error_data(int num, ...); + // procedure ERR_add_error_vdata(num: TIdC_INT; args: va_list); + ERR_load_strings_procname = 'ERR_load_strings'; + ERR_load_strings_const_procname = 'ERR_load_strings_const'; {introduced 1.1.0} + ERR_unload_strings_procname = 'ERR_unload_strings'; + ERR_load_ERR_strings_procname = 'ERR_load_ERR_strings'; + + ERR_get_state_procname = 'ERR_get_state'; + ERR_get_next_error_library_procname = 'ERR_get_next_error_library'; + ERR_set_mark_procname = 'ERR_set_mark'; + ERR_pop_to_mark_procname = 'ERR_pop_to_mark'; + ERR_clear_last_mark_procname = 'ERR_clear_last_mark'; {introduced 1.1.0} + + SSLErr_procname = 'SSLErr'; {removed 1.0.0} + X509err_procname = 'X509err'; {removed 1.0.0} + ERR_GET_REASON_procname = 'ERR_GET_REASON'; {removed 1.0.0} + + +procedure _SSLErr(func: TIdC_INT; reason: TIdC_INT); cdecl; +begin + ERR_put_error(ERR_LIB_SSL,func,reason,'',0); +end; + +procedure _ERR_put_error(lib: TIdC_INT; func: TIdC_INT; reason: TIdC_INT; file_: PIdAnsiChar; line: TIdC_INT); cdecl; +{ From 3.0 onwards, replaced by a macro + define ERR_put_error(lib, func, reason, file, line) + (ERR_new(), + ERR_set_debug((file), (line), OPENSSL_FUNC), + ERR_set_error((lib), (reason), '',[]))} +begin + ERR_new; + ERR_set_debug(file_,line, ''); + ERR_set_error(lib,reason,'',[]); +end; + +procedure _X509err(const f,r : TIdC_INT); cdecl; +begin + ERR_PUT_error(ERR_LIB_X509,f,r,nil,0); +end; + +function _ERR_GET_REASON(const l : TIdC_INT) : TIdC_INT; cdecl; +begin + Result := l and $fff; +end; + +{$WARN NO_RETVAL OFF} +procedure ERR_ERR_put_error(lib: TIdC_INT; func: TIdC_INT; reason: TIdC_INT; file_: PIdAnsiChar; line: TIdC_INT); +begin + EIdAPIFunctionNotPresent.RaiseException(ERR_put_error_procname); +end; + + + +{ From 3.0 onwards, replaced by a macro + define ERR_put_error(lib, func, reason, file, line) + (ERR_new(), + ERR_set_debug((file), (line), OPENSSL_FUNC), + ERR_set_error((lib), (reason), NULL))} + +procedure ERR_ERR_new; +begin + EIdAPIFunctionNotPresent.RaiseException(ERR_new_procname); +end; + + {introduced 3.0.0} +procedure ERR_ERR_set_debug(const file_: PIdAnsiChar; line: integer; const func: PIdAnsiChar); +begin + EIdAPIFunctionNotPresent.RaiseException(ERR_set_debug_procname); +end; + + {introduced 3.0.0} +procedure ERR_ERR_set_error(lib: integer; reason: integer; fmt: PIdAnsiChar; args: array of const); +begin + EIdAPIFunctionNotPresent.RaiseException(ERR_set_error_procname); +end; + + {introduced 3.0.0} + + +procedure ERR_ERR_set_error_data(data: PIdAnsiChar; flags: TIdC_INT); +begin + EIdAPIFunctionNotPresent.RaiseException(ERR_set_error_data_procname); +end; + + + +function ERR_ERR_get_error: TIdC_ULONG; +begin + EIdAPIFunctionNotPresent.RaiseException(ERR_get_error_procname); +end; + + +function ERR_ERR_get_error_line(file_: PPIdAnsiChar; line: PIdC_INT): TIdC_ULONG; +begin + EIdAPIFunctionNotPresent.RaiseException(ERR_get_error_line_procname); +end; + + +function ERR_ERR_get_error_line_data(file_: PPIdAnsiChar; line: PIdC_INT; data: PPIdAnsiChar; flags: PIdC_INT): TIdC_ULONG; +begin + EIdAPIFunctionNotPresent.RaiseException(ERR_get_error_line_data_procname); +end; + + + +function ERR_ERR_peek_error: TIdC_ULONG; +begin + EIdAPIFunctionNotPresent.RaiseException(ERR_peek_error_procname); +end; + + +function ERR_ERR_peek_error_line(file_: PPIdAnsiChar; line: PIdC_INT): TIdC_ULONG; +begin + EIdAPIFunctionNotPresent.RaiseException(ERR_peek_error_line_procname); +end; + + +function ERR_ERR_peek_error_line_data(file_: PPIdAnsiChar; line: PIdC_INT; data: PPIdAnsiChar; flags: PIdC_INT): TIdC_ULONG; +begin + EIdAPIFunctionNotPresent.RaiseException(ERR_peek_error_line_data_procname); +end; + + + +function ERR_ERR_peek_last_error: TIdC_ULONG; +begin + EIdAPIFunctionNotPresent.RaiseException(ERR_peek_last_error_procname); +end; + + +function ERR_ERR_peek_last_error_line(file_: PPIdAnsiChar; line: PIdC_INT): TIdC_ULONG; +begin + EIdAPIFunctionNotPresent.RaiseException(ERR_peek_last_error_line_procname); +end; + + +function ERR_ERR_peek_last_error_line_data(file_: PPIdAnsiChar; line: PIdC_INT; data: PPIdAnsiChar; flags: PIdC_INT): TIdC_ULONG; +begin + EIdAPIFunctionNotPresent.RaiseException(ERR_peek_last_error_line_data_procname); +end; + + + +procedure ERR_ERR_clear_error; +begin + EIdAPIFunctionNotPresent.RaiseException(ERR_clear_error_procname); +end; + + +function ERR_ERR_error_string(e: TIdC_ULONG; buf: PIdAnsiChar): PIdAnsiChar; +begin + EIdAPIFunctionNotPresent.RaiseException(ERR_error_string_procname); +end; + + +procedure ERR_ERR_error_string_n(e: TIdC_ULONG; buf: PIdAnsiChar; len: TIdC_SIZET); +begin + EIdAPIFunctionNotPresent.RaiseException(ERR_error_string_n_procname); +end; + + +function ERR_ERR_lib_error_string(e: TIdC_ULONG): PIdAnsiChar; +begin + EIdAPIFunctionNotPresent.RaiseException(ERR_lib_error_string_procname); +end; + + +function ERR_ERR_func_error_string(e: TIdC_ULONG): PIdAnsiChar; +begin + EIdAPIFunctionNotPresent.RaiseException(ERR_func_error_string_procname); +end; + + +function ERR_ERR_reason_error_string(e: TIdC_ULONG): PIdAnsiChar; +begin + EIdAPIFunctionNotPresent.RaiseException(ERR_reason_error_string_procname); +end; + + +procedure ERR_ERR_print_errors_cb(cb: ERR_print_errors_cb_cb; u: Pointer); +begin + EIdAPIFunctionNotPresent.RaiseException(ERR_print_errors_cb_procname); +end; + + + +procedure ERR_ERR_print_errors(bp: PBIO); +begin + EIdAPIFunctionNotPresent.RaiseException(ERR_print_errors_procname); +end; + + + // void ERR_add_error_data(int num, ...); + // procedure ERR_add_error_vdata(num: TIdC_INT; args: va_list); +function ERR_ERR_load_strings(lib: TIdC_INT; str: PERR_STRING_DATA): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ERR_load_strings_procname); +end; + + +function ERR_ERR_load_strings_const(str: PERR_STRING_DATA): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ERR_load_strings_const_procname); +end; + + {introduced 1.1.0} +function ERR_ERR_unload_strings(lib: TIdC_INT; str: PERR_STRING_DATA): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ERR_unload_strings_procname); +end; + + +function ERR_ERR_load_ERR_strings: TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ERR_load_ERR_strings_procname); +end; + + + +function ERR_ERR_get_state: PERR_STATE; +begin + EIdAPIFunctionNotPresent.RaiseException(ERR_get_state_procname); +end; + + +function ERR_ERR_get_next_error_library: TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ERR_get_next_error_library_procname); +end; + + +function ERR_ERR_set_mark: TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ERR_set_mark_procname); +end; + + +function ERR_ERR_pop_to_mark: TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ERR_pop_to_mark_procname); +end; + + +function ERR_ERR_clear_last_mark: TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ERR_clear_last_mark_procname); +end; + + {introduced 1.1.0} + +procedure ERR_SSLErr(func: TIdC_INT; reason: TIdC_INT); +begin + EIdAPIFunctionNotPresent.RaiseException(SSLErr_procname); +end; + + +procedure ERR_X509err(const f,r : TIdC_INT); +begin + EIdAPIFunctionNotPresent.RaiseException(X509err_procname); +end; + + +function ERR_ERR_GET_REASON(const l : TIdC_INT) : TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ERR_GET_REASON_procname); +end; + + + +{$WARN NO_RETVAL ON} + +procedure Load(const ADllHandle: TIdLibHandle; LibVersion: TIdC_UINT; const AFailed: TStringList); + +var FuncLoadError: boolean; + +begin + ERR_put_error := LoadLibFunction(ADllHandle, ERR_put_error_procname); + FuncLoadError := not assigned(ERR_put_error); + if FuncLoadError then + begin + {$if not defined(ERR_put_error_allownil)} + ERR_put_error := @ERR_ERR_put_error; + {$ifend} + {$if declared(ERR_put_error_introduced)} + if LibVersion < ERR_put_error_introduced then + begin + {$if declared(FC_ERR_put_error)} + ERR_put_error := @FC_ERR_put_error; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ERR_put_error_removed)} + if ERR_put_error_removed <= LibVersion then + begin + {$if declared(_ERR_put_error)} + ERR_put_error := @_ERR_put_error; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ERR_put_error_allownil)} + if FuncLoadError then + AFailed.Add('ERR_put_error'); + {$ifend} + end; + + + ERR_new := LoadLibFunction(ADllHandle, ERR_new_procname); + FuncLoadError := not assigned(ERR_new); + if FuncLoadError then + begin + {$if not defined(ERR_new_allownil)} + ERR_new := @ERR_ERR_new; + {$ifend} + {$if declared(ERR_new_introduced)} + if LibVersion < ERR_new_introduced then + begin + {$if declared(FC_ERR_new)} + ERR_new := @FC_ERR_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ERR_new_removed)} + if ERR_new_removed <= LibVersion then + begin + {$if declared(_ERR_new)} + ERR_new := @_ERR_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ERR_new_allownil)} + if FuncLoadError then + AFailed.Add('ERR_new'); + {$ifend} + end; + + {introduced 3.0.0} + ERR_set_debug := LoadLibFunction(ADllHandle, ERR_set_debug_procname); + FuncLoadError := not assigned(ERR_set_debug); + if FuncLoadError then + begin + {$if not defined(ERR_set_debug_allownil)} + ERR_set_debug := @ERR_ERR_set_debug; + {$ifend} + {$if declared(ERR_set_debug_introduced)} + if LibVersion < ERR_set_debug_introduced then + begin + {$if declared(FC_ERR_set_debug)} + ERR_set_debug := @FC_ERR_set_debug; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ERR_set_debug_removed)} + if ERR_set_debug_removed <= LibVersion then + begin + {$if declared(_ERR_set_debug)} + ERR_set_debug := @_ERR_set_debug; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ERR_set_debug_allownil)} + if FuncLoadError then + AFailed.Add('ERR_set_debug'); + {$ifend} + end; + + {introduced 3.0.0} + ERR_set_error := LoadLibFunction(ADllHandle, ERR_set_error_procname); + FuncLoadError := not assigned(ERR_set_error); + if FuncLoadError then + begin + {$if not defined(ERR_set_error_allownil)} + ERR_set_error := @ERR_ERR_set_error; + {$ifend} + {$if declared(ERR_set_error_introduced)} + if LibVersion < ERR_set_error_introduced then + begin + {$if declared(FC_ERR_set_error)} + ERR_set_error := @FC_ERR_set_error; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ERR_set_error_removed)} + if ERR_set_error_removed <= LibVersion then + begin + {$if declared(_ERR_set_error)} + ERR_set_error := @_ERR_set_error; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ERR_set_error_allownil)} + if FuncLoadError then + AFailed.Add('ERR_set_error'); + {$ifend} + end; + + {introduced 3.0.0} + ERR_set_error_data := LoadLibFunction(ADllHandle, ERR_set_error_data_procname); + FuncLoadError := not assigned(ERR_set_error_data); + if FuncLoadError then + begin + {$if not defined(ERR_set_error_data_allownil)} + ERR_set_error_data := @ERR_ERR_set_error_data; + {$ifend} + {$if declared(ERR_set_error_data_introduced)} + if LibVersion < ERR_set_error_data_introduced then + begin + {$if declared(FC_ERR_set_error_data)} + ERR_set_error_data := @FC_ERR_set_error_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ERR_set_error_data_removed)} + if ERR_set_error_data_removed <= LibVersion then + begin + {$if declared(_ERR_set_error_data)} + ERR_set_error_data := @_ERR_set_error_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ERR_set_error_data_allownil)} + if FuncLoadError then + AFailed.Add('ERR_set_error_data'); + {$ifend} + end; + + + ERR_get_error := LoadLibFunction(ADllHandle, ERR_get_error_procname); + FuncLoadError := not assigned(ERR_get_error); + if FuncLoadError then + begin + {$if not defined(ERR_get_error_allownil)} + ERR_get_error := @ERR_ERR_get_error; + {$ifend} + {$if declared(ERR_get_error_introduced)} + if LibVersion < ERR_get_error_introduced then + begin + {$if declared(FC_ERR_get_error)} + ERR_get_error := @FC_ERR_get_error; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ERR_get_error_removed)} + if ERR_get_error_removed <= LibVersion then + begin + {$if declared(_ERR_get_error)} + ERR_get_error := @_ERR_get_error; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ERR_get_error_allownil)} + if FuncLoadError then + AFailed.Add('ERR_get_error'); + {$ifend} + end; + + + ERR_get_error_line := LoadLibFunction(ADllHandle, ERR_get_error_line_procname); + FuncLoadError := not assigned(ERR_get_error_line); + if FuncLoadError then + begin + {$if not defined(ERR_get_error_line_allownil)} + ERR_get_error_line := @ERR_ERR_get_error_line; + {$ifend} + {$if declared(ERR_get_error_line_introduced)} + if LibVersion < ERR_get_error_line_introduced then + begin + {$if declared(FC_ERR_get_error_line)} + ERR_get_error_line := @FC_ERR_get_error_line; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ERR_get_error_line_removed)} + if ERR_get_error_line_removed <= LibVersion then + begin + {$if declared(_ERR_get_error_line)} + ERR_get_error_line := @_ERR_get_error_line; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ERR_get_error_line_allownil)} + if FuncLoadError then + AFailed.Add('ERR_get_error_line'); + {$ifend} + end; + + + ERR_get_error_line_data := LoadLibFunction(ADllHandle, ERR_get_error_line_data_procname); + FuncLoadError := not assigned(ERR_get_error_line_data); + if FuncLoadError then + begin + {$if not defined(ERR_get_error_line_data_allownil)} + ERR_get_error_line_data := @ERR_ERR_get_error_line_data; + {$ifend} + {$if declared(ERR_get_error_line_data_introduced)} + if LibVersion < ERR_get_error_line_data_introduced then + begin + {$if declared(FC_ERR_get_error_line_data)} + ERR_get_error_line_data := @FC_ERR_get_error_line_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ERR_get_error_line_data_removed)} + if ERR_get_error_line_data_removed <= LibVersion then + begin + {$if declared(_ERR_get_error_line_data)} + ERR_get_error_line_data := @_ERR_get_error_line_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ERR_get_error_line_data_allownil)} + if FuncLoadError then + AFailed.Add('ERR_get_error_line_data'); + {$ifend} + end; + + + ERR_peek_error := LoadLibFunction(ADllHandle, ERR_peek_error_procname); + FuncLoadError := not assigned(ERR_peek_error); + if FuncLoadError then + begin + {$if not defined(ERR_peek_error_allownil)} + ERR_peek_error := @ERR_ERR_peek_error; + {$ifend} + {$if declared(ERR_peek_error_introduced)} + if LibVersion < ERR_peek_error_introduced then + begin + {$if declared(FC_ERR_peek_error)} + ERR_peek_error := @FC_ERR_peek_error; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ERR_peek_error_removed)} + if ERR_peek_error_removed <= LibVersion then + begin + {$if declared(_ERR_peek_error)} + ERR_peek_error := @_ERR_peek_error; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ERR_peek_error_allownil)} + if FuncLoadError then + AFailed.Add('ERR_peek_error'); + {$ifend} + end; + + + ERR_peek_error_line := LoadLibFunction(ADllHandle, ERR_peek_error_line_procname); + FuncLoadError := not assigned(ERR_peek_error_line); + if FuncLoadError then + begin + {$if not defined(ERR_peek_error_line_allownil)} + ERR_peek_error_line := @ERR_ERR_peek_error_line; + {$ifend} + {$if declared(ERR_peek_error_line_introduced)} + if LibVersion < ERR_peek_error_line_introduced then + begin + {$if declared(FC_ERR_peek_error_line)} + ERR_peek_error_line := @FC_ERR_peek_error_line; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ERR_peek_error_line_removed)} + if ERR_peek_error_line_removed <= LibVersion then + begin + {$if declared(_ERR_peek_error_line)} + ERR_peek_error_line := @_ERR_peek_error_line; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ERR_peek_error_line_allownil)} + if FuncLoadError then + AFailed.Add('ERR_peek_error_line'); + {$ifend} + end; + + + ERR_peek_error_line_data := LoadLibFunction(ADllHandle, ERR_peek_error_line_data_procname); + FuncLoadError := not assigned(ERR_peek_error_line_data); + if FuncLoadError then + begin + {$if not defined(ERR_peek_error_line_data_allownil)} + ERR_peek_error_line_data := @ERR_ERR_peek_error_line_data; + {$ifend} + {$if declared(ERR_peek_error_line_data_introduced)} + if LibVersion < ERR_peek_error_line_data_introduced then + begin + {$if declared(FC_ERR_peek_error_line_data)} + ERR_peek_error_line_data := @FC_ERR_peek_error_line_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ERR_peek_error_line_data_removed)} + if ERR_peek_error_line_data_removed <= LibVersion then + begin + {$if declared(_ERR_peek_error_line_data)} + ERR_peek_error_line_data := @_ERR_peek_error_line_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ERR_peek_error_line_data_allownil)} + if FuncLoadError then + AFailed.Add('ERR_peek_error_line_data'); + {$ifend} + end; + + + ERR_peek_last_error := LoadLibFunction(ADllHandle, ERR_peek_last_error_procname); + FuncLoadError := not assigned(ERR_peek_last_error); + if FuncLoadError then + begin + {$if not defined(ERR_peek_last_error_allownil)} + ERR_peek_last_error := @ERR_ERR_peek_last_error; + {$ifend} + {$if declared(ERR_peek_last_error_introduced)} + if LibVersion < ERR_peek_last_error_introduced then + begin + {$if declared(FC_ERR_peek_last_error)} + ERR_peek_last_error := @FC_ERR_peek_last_error; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ERR_peek_last_error_removed)} + if ERR_peek_last_error_removed <= LibVersion then + begin + {$if declared(_ERR_peek_last_error)} + ERR_peek_last_error := @_ERR_peek_last_error; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ERR_peek_last_error_allownil)} + if FuncLoadError then + AFailed.Add('ERR_peek_last_error'); + {$ifend} + end; + + + ERR_peek_last_error_line := LoadLibFunction(ADllHandle, ERR_peek_last_error_line_procname); + FuncLoadError := not assigned(ERR_peek_last_error_line); + if FuncLoadError then + begin + {$if not defined(ERR_peek_last_error_line_allownil)} + ERR_peek_last_error_line := @ERR_ERR_peek_last_error_line; + {$ifend} + {$if declared(ERR_peek_last_error_line_introduced)} + if LibVersion < ERR_peek_last_error_line_introduced then + begin + {$if declared(FC_ERR_peek_last_error_line)} + ERR_peek_last_error_line := @FC_ERR_peek_last_error_line; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ERR_peek_last_error_line_removed)} + if ERR_peek_last_error_line_removed <= LibVersion then + begin + {$if declared(_ERR_peek_last_error_line)} + ERR_peek_last_error_line := @_ERR_peek_last_error_line; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ERR_peek_last_error_line_allownil)} + if FuncLoadError then + AFailed.Add('ERR_peek_last_error_line'); + {$ifend} + end; + + + ERR_peek_last_error_line_data := LoadLibFunction(ADllHandle, ERR_peek_last_error_line_data_procname); + FuncLoadError := not assigned(ERR_peek_last_error_line_data); + if FuncLoadError then + begin + {$if not defined(ERR_peek_last_error_line_data_allownil)} + ERR_peek_last_error_line_data := @ERR_ERR_peek_last_error_line_data; + {$ifend} + {$if declared(ERR_peek_last_error_line_data_introduced)} + if LibVersion < ERR_peek_last_error_line_data_introduced then + begin + {$if declared(FC_ERR_peek_last_error_line_data)} + ERR_peek_last_error_line_data := @FC_ERR_peek_last_error_line_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ERR_peek_last_error_line_data_removed)} + if ERR_peek_last_error_line_data_removed <= LibVersion then + begin + {$if declared(_ERR_peek_last_error_line_data)} + ERR_peek_last_error_line_data := @_ERR_peek_last_error_line_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ERR_peek_last_error_line_data_allownil)} + if FuncLoadError then + AFailed.Add('ERR_peek_last_error_line_data'); + {$ifend} + end; + + + ERR_clear_error := LoadLibFunction(ADllHandle, ERR_clear_error_procname); + FuncLoadError := not assigned(ERR_clear_error); + if FuncLoadError then + begin + {$if not defined(ERR_clear_error_allownil)} + ERR_clear_error := @ERR_ERR_clear_error; + {$ifend} + {$if declared(ERR_clear_error_introduced)} + if LibVersion < ERR_clear_error_introduced then + begin + {$if declared(FC_ERR_clear_error)} + ERR_clear_error := @FC_ERR_clear_error; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ERR_clear_error_removed)} + if ERR_clear_error_removed <= LibVersion then + begin + {$if declared(_ERR_clear_error)} + ERR_clear_error := @_ERR_clear_error; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ERR_clear_error_allownil)} + if FuncLoadError then + AFailed.Add('ERR_clear_error'); + {$ifend} + end; + + + ERR_error_string := LoadLibFunction(ADllHandle, ERR_error_string_procname); + FuncLoadError := not assigned(ERR_error_string); + if FuncLoadError then + begin + {$if not defined(ERR_error_string_allownil)} + ERR_error_string := @ERR_ERR_error_string; + {$ifend} + {$if declared(ERR_error_string_introduced)} + if LibVersion < ERR_error_string_introduced then + begin + {$if declared(FC_ERR_error_string)} + ERR_error_string := @FC_ERR_error_string; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ERR_error_string_removed)} + if ERR_error_string_removed <= LibVersion then + begin + {$if declared(_ERR_error_string)} + ERR_error_string := @_ERR_error_string; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ERR_error_string_allownil)} + if FuncLoadError then + AFailed.Add('ERR_error_string'); + {$ifend} + end; + + + ERR_error_string_n := LoadLibFunction(ADllHandle, ERR_error_string_n_procname); + FuncLoadError := not assigned(ERR_error_string_n); + if FuncLoadError then + begin + {$if not defined(ERR_error_string_n_allownil)} + ERR_error_string_n := @ERR_ERR_error_string_n; + {$ifend} + {$if declared(ERR_error_string_n_introduced)} + if LibVersion < ERR_error_string_n_introduced then + begin + {$if declared(FC_ERR_error_string_n)} + ERR_error_string_n := @FC_ERR_error_string_n; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ERR_error_string_n_removed)} + if ERR_error_string_n_removed <= LibVersion then + begin + {$if declared(_ERR_error_string_n)} + ERR_error_string_n := @_ERR_error_string_n; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ERR_error_string_n_allownil)} + if FuncLoadError then + AFailed.Add('ERR_error_string_n'); + {$ifend} + end; + + + ERR_lib_error_string := LoadLibFunction(ADllHandle, ERR_lib_error_string_procname); + FuncLoadError := not assigned(ERR_lib_error_string); + if FuncLoadError then + begin + {$if not defined(ERR_lib_error_string_allownil)} + ERR_lib_error_string := @ERR_ERR_lib_error_string; + {$ifend} + {$if declared(ERR_lib_error_string_introduced)} + if LibVersion < ERR_lib_error_string_introduced then + begin + {$if declared(FC_ERR_lib_error_string)} + ERR_lib_error_string := @FC_ERR_lib_error_string; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ERR_lib_error_string_removed)} + if ERR_lib_error_string_removed <= LibVersion then + begin + {$if declared(_ERR_lib_error_string)} + ERR_lib_error_string := @_ERR_lib_error_string; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ERR_lib_error_string_allownil)} + if FuncLoadError then + AFailed.Add('ERR_lib_error_string'); + {$ifend} + end; + + + ERR_func_error_string := LoadLibFunction(ADllHandle, ERR_func_error_string_procname); + FuncLoadError := not assigned(ERR_func_error_string); + if FuncLoadError then + begin + {$if not defined(ERR_func_error_string_allownil)} + ERR_func_error_string := @ERR_ERR_func_error_string; + {$ifend} + {$if declared(ERR_func_error_string_introduced)} + if LibVersion < ERR_func_error_string_introduced then + begin + {$if declared(FC_ERR_func_error_string)} + ERR_func_error_string := @FC_ERR_func_error_string; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ERR_func_error_string_removed)} + if ERR_func_error_string_removed <= LibVersion then + begin + {$if declared(_ERR_func_error_string)} + ERR_func_error_string := @_ERR_func_error_string; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ERR_func_error_string_allownil)} + if FuncLoadError then + AFailed.Add('ERR_func_error_string'); + {$ifend} + end; + + + ERR_reason_error_string := LoadLibFunction(ADllHandle, ERR_reason_error_string_procname); + FuncLoadError := not assigned(ERR_reason_error_string); + if FuncLoadError then + begin + {$if not defined(ERR_reason_error_string_allownil)} + ERR_reason_error_string := @ERR_ERR_reason_error_string; + {$ifend} + {$if declared(ERR_reason_error_string_introduced)} + if LibVersion < ERR_reason_error_string_introduced then + begin + {$if declared(FC_ERR_reason_error_string)} + ERR_reason_error_string := @FC_ERR_reason_error_string; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ERR_reason_error_string_removed)} + if ERR_reason_error_string_removed <= LibVersion then + begin + {$if declared(_ERR_reason_error_string)} + ERR_reason_error_string := @_ERR_reason_error_string; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ERR_reason_error_string_allownil)} + if FuncLoadError then + AFailed.Add('ERR_reason_error_string'); + {$ifend} + end; + + + ERR_print_errors_cb := LoadLibFunction(ADllHandle, ERR_print_errors_cb_procname); + FuncLoadError := not assigned(ERR_print_errors_cb); + if FuncLoadError then + begin + {$if not defined(ERR_print_errors_cb_allownil)} + ERR_print_errors_cb := @ERR_ERR_print_errors_cb; + {$ifend} + {$if declared(ERR_print_errors_cb_introduced)} + if LibVersion < ERR_print_errors_cb_introduced then + begin + {$if declared(FC_ERR_print_errors_cb)} + ERR_print_errors_cb := @FC_ERR_print_errors_cb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ERR_print_errors_cb_removed)} + if ERR_print_errors_cb_removed <= LibVersion then + begin + {$if declared(_ERR_print_errors_cb)} + ERR_print_errors_cb := @_ERR_print_errors_cb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ERR_print_errors_cb_allownil)} + if FuncLoadError then + AFailed.Add('ERR_print_errors_cb'); + {$ifend} + end; + + + ERR_print_errors := LoadLibFunction(ADllHandle, ERR_print_errors_procname); + FuncLoadError := not assigned(ERR_print_errors); + if FuncLoadError then + begin + {$if not defined(ERR_print_errors_allownil)} + ERR_print_errors := @ERR_ERR_print_errors; + {$ifend} + {$if declared(ERR_print_errors_introduced)} + if LibVersion < ERR_print_errors_introduced then + begin + {$if declared(FC_ERR_print_errors)} + ERR_print_errors := @FC_ERR_print_errors; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ERR_print_errors_removed)} + if ERR_print_errors_removed <= LibVersion then + begin + {$if declared(_ERR_print_errors)} + ERR_print_errors := @_ERR_print_errors; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ERR_print_errors_allownil)} + if FuncLoadError then + AFailed.Add('ERR_print_errors'); + {$ifend} + end; + + + ERR_load_strings := LoadLibFunction(ADllHandle, ERR_load_strings_procname); + FuncLoadError := not assigned(ERR_load_strings); + if FuncLoadError then + begin + {$if not defined(ERR_load_strings_allownil)} + ERR_load_strings := @ERR_ERR_load_strings; + {$ifend} + {$if declared(ERR_load_strings_introduced)} + if LibVersion < ERR_load_strings_introduced then + begin + {$if declared(FC_ERR_load_strings)} + ERR_load_strings := @FC_ERR_load_strings; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ERR_load_strings_removed)} + if ERR_load_strings_removed <= LibVersion then + begin + {$if declared(_ERR_load_strings)} + ERR_load_strings := @_ERR_load_strings; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ERR_load_strings_allownil)} + if FuncLoadError then + AFailed.Add('ERR_load_strings'); + {$ifend} + end; + + + ERR_load_strings_const := LoadLibFunction(ADllHandle, ERR_load_strings_const_procname); + FuncLoadError := not assigned(ERR_load_strings_const); + if FuncLoadError then + begin + {$if not defined(ERR_load_strings_const_allownil)} + ERR_load_strings_const := @ERR_ERR_load_strings_const; + {$ifend} + {$if declared(ERR_load_strings_const_introduced)} + if LibVersion < ERR_load_strings_const_introduced then + begin + {$if declared(FC_ERR_load_strings_const)} + ERR_load_strings_const := @FC_ERR_load_strings_const; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ERR_load_strings_const_removed)} + if ERR_load_strings_const_removed <= LibVersion then + begin + {$if declared(_ERR_load_strings_const)} + ERR_load_strings_const := @_ERR_load_strings_const; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ERR_load_strings_const_allownil)} + if FuncLoadError then + AFailed.Add('ERR_load_strings_const'); + {$ifend} + end; + + {introduced 1.1.0} + ERR_unload_strings := LoadLibFunction(ADllHandle, ERR_unload_strings_procname); + FuncLoadError := not assigned(ERR_unload_strings); + if FuncLoadError then + begin + {$if not defined(ERR_unload_strings_allownil)} + ERR_unload_strings := @ERR_ERR_unload_strings; + {$ifend} + {$if declared(ERR_unload_strings_introduced)} + if LibVersion < ERR_unload_strings_introduced then + begin + {$if declared(FC_ERR_unload_strings)} + ERR_unload_strings := @FC_ERR_unload_strings; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ERR_unload_strings_removed)} + if ERR_unload_strings_removed <= LibVersion then + begin + {$if declared(_ERR_unload_strings)} + ERR_unload_strings := @_ERR_unload_strings; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ERR_unload_strings_allownil)} + if FuncLoadError then + AFailed.Add('ERR_unload_strings'); + {$ifend} + end; + + + ERR_load_ERR_strings := LoadLibFunction(ADllHandle, ERR_load_ERR_strings_procname); + FuncLoadError := not assigned(ERR_load_ERR_strings); + if FuncLoadError then + begin + {$if not defined(ERR_load_ERR_strings_allownil)} + ERR_load_ERR_strings := @ERR_ERR_load_ERR_strings; + {$ifend} + {$if declared(ERR_load_ERR_strings_introduced)} + if LibVersion < ERR_load_ERR_strings_introduced then + begin + {$if declared(FC_ERR_load_ERR_strings)} + ERR_load_ERR_strings := @FC_ERR_load_ERR_strings; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ERR_load_ERR_strings_removed)} + if ERR_load_ERR_strings_removed <= LibVersion then + begin + {$if declared(_ERR_load_ERR_strings)} + ERR_load_ERR_strings := @_ERR_load_ERR_strings; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ERR_load_ERR_strings_allownil)} + if FuncLoadError then + AFailed.Add('ERR_load_ERR_strings'); + {$ifend} + end; + + + ERR_get_state := LoadLibFunction(ADllHandle, ERR_get_state_procname); + FuncLoadError := not assigned(ERR_get_state); + if FuncLoadError then + begin + {$if not defined(ERR_get_state_allownil)} + ERR_get_state := @ERR_ERR_get_state; + {$ifend} + {$if declared(ERR_get_state_introduced)} + if LibVersion < ERR_get_state_introduced then + begin + {$if declared(FC_ERR_get_state)} + ERR_get_state := @FC_ERR_get_state; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ERR_get_state_removed)} + if ERR_get_state_removed <= LibVersion then + begin + {$if declared(_ERR_get_state)} + ERR_get_state := @_ERR_get_state; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ERR_get_state_allownil)} + if FuncLoadError then + AFailed.Add('ERR_get_state'); + {$ifend} + end; + + + ERR_get_next_error_library := LoadLibFunction(ADllHandle, ERR_get_next_error_library_procname); + FuncLoadError := not assigned(ERR_get_next_error_library); + if FuncLoadError then + begin + {$if not defined(ERR_get_next_error_library_allownil)} + ERR_get_next_error_library := @ERR_ERR_get_next_error_library; + {$ifend} + {$if declared(ERR_get_next_error_library_introduced)} + if LibVersion < ERR_get_next_error_library_introduced then + begin + {$if declared(FC_ERR_get_next_error_library)} + ERR_get_next_error_library := @FC_ERR_get_next_error_library; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ERR_get_next_error_library_removed)} + if ERR_get_next_error_library_removed <= LibVersion then + begin + {$if declared(_ERR_get_next_error_library)} + ERR_get_next_error_library := @_ERR_get_next_error_library; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ERR_get_next_error_library_allownil)} + if FuncLoadError then + AFailed.Add('ERR_get_next_error_library'); + {$ifend} + end; + + + ERR_set_mark := LoadLibFunction(ADllHandle, ERR_set_mark_procname); + FuncLoadError := not assigned(ERR_set_mark); + if FuncLoadError then + begin + {$if not defined(ERR_set_mark_allownil)} + ERR_set_mark := @ERR_ERR_set_mark; + {$ifend} + {$if declared(ERR_set_mark_introduced)} + if LibVersion < ERR_set_mark_introduced then + begin + {$if declared(FC_ERR_set_mark)} + ERR_set_mark := @FC_ERR_set_mark; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ERR_set_mark_removed)} + if ERR_set_mark_removed <= LibVersion then + begin + {$if declared(_ERR_set_mark)} + ERR_set_mark := @_ERR_set_mark; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ERR_set_mark_allownil)} + if FuncLoadError then + AFailed.Add('ERR_set_mark'); + {$ifend} + end; + + + ERR_pop_to_mark := LoadLibFunction(ADllHandle, ERR_pop_to_mark_procname); + FuncLoadError := not assigned(ERR_pop_to_mark); + if FuncLoadError then + begin + {$if not defined(ERR_pop_to_mark_allownil)} + ERR_pop_to_mark := @ERR_ERR_pop_to_mark; + {$ifend} + {$if declared(ERR_pop_to_mark_introduced)} + if LibVersion < ERR_pop_to_mark_introduced then + begin + {$if declared(FC_ERR_pop_to_mark)} + ERR_pop_to_mark := @FC_ERR_pop_to_mark; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ERR_pop_to_mark_removed)} + if ERR_pop_to_mark_removed <= LibVersion then + begin + {$if declared(_ERR_pop_to_mark)} + ERR_pop_to_mark := @_ERR_pop_to_mark; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ERR_pop_to_mark_allownil)} + if FuncLoadError then + AFailed.Add('ERR_pop_to_mark'); + {$ifend} + end; + + + ERR_clear_last_mark := LoadLibFunction(ADllHandle, ERR_clear_last_mark_procname); + FuncLoadError := not assigned(ERR_clear_last_mark); + if FuncLoadError then + begin + {$if not defined(ERR_clear_last_mark_allownil)} + ERR_clear_last_mark := @ERR_ERR_clear_last_mark; + {$ifend} + {$if declared(ERR_clear_last_mark_introduced)} + if LibVersion < ERR_clear_last_mark_introduced then + begin + {$if declared(FC_ERR_clear_last_mark)} + ERR_clear_last_mark := @FC_ERR_clear_last_mark; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ERR_clear_last_mark_removed)} + if ERR_clear_last_mark_removed <= LibVersion then + begin + {$if declared(_ERR_clear_last_mark)} + ERR_clear_last_mark := @_ERR_clear_last_mark; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ERR_clear_last_mark_allownil)} + if FuncLoadError then + AFailed.Add('ERR_clear_last_mark'); + {$ifend} + end; + + {introduced 1.1.0} + SSLErr := LoadLibFunction(ADllHandle, SSLErr_procname); + FuncLoadError := not assigned(SSLErr); + if FuncLoadError then + begin + {$if not defined(SSLErr_allownil)} + SSLErr := @ERR_SSLErr; + {$ifend} + {$if declared(SSLErr_introduced)} + if LibVersion < SSLErr_introduced then + begin + {$if declared(FC_SSLErr)} + SSLErr := @FC_SSLErr; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSLErr_removed)} + if SSLErr_removed <= LibVersion then + begin + {$if declared(_SSLErr)} + SSLErr := @_SSLErr; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSLErr_allownil)} + if FuncLoadError then + AFailed.Add('SSLErr'); + {$ifend} + end; + + + X509err := LoadLibFunction(ADllHandle, X509err_procname); + FuncLoadError := not assigned(X509err); + if FuncLoadError then + begin + {$if not defined(X509err_allownil)} + X509err := @ERR_X509err; + {$ifend} + {$if declared(X509err_introduced)} + if LibVersion < X509err_introduced then + begin + {$if declared(FC_X509err)} + X509err := @FC_X509err; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509err_removed)} + if X509err_removed <= LibVersion then + begin + {$if declared(_X509err)} + X509err := @_X509err; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509err_allownil)} + if FuncLoadError then + AFailed.Add('X509err'); + {$ifend} + end; + + + ERR_GET_REASON := LoadLibFunction(ADllHandle, ERR_GET_REASON_procname); + FuncLoadError := not assigned(ERR_GET_REASON); + if FuncLoadError then + begin + {$if not defined(ERR_GET_REASON_allownil)} + ERR_GET_REASON := @ERR_ERR_GET_REASON; + {$ifend} + {$if declared(ERR_GET_REASON_introduced)} + if LibVersion < ERR_GET_REASON_introduced then + begin + {$if declared(FC_ERR_GET_REASON)} + ERR_GET_REASON := @FC_ERR_GET_REASON; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ERR_GET_REASON_removed)} + if ERR_GET_REASON_removed <= LibVersion then + begin + {$if declared(_ERR_GET_REASON)} + ERR_GET_REASON := @_ERR_GET_REASON; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ERR_GET_REASON_allownil)} + if FuncLoadError then + AFailed.Add('ERR_GET_REASON'); + {$ifend} + end; + + +end; + +procedure Unload; +begin + ERR_put_error := nil; {removed 3.0.0} + ERR_new := nil; {introduced 3.0.0} + ERR_set_debug := nil; {introduced 3.0.0} + ERR_set_error := nil; {introduced 3.0.0} + ERR_set_error_data := nil; + ERR_get_error := nil; + ERR_get_error_line := nil; + ERR_get_error_line_data := nil; + ERR_peek_error := nil; + ERR_peek_error_line := nil; + ERR_peek_error_line_data := nil; + ERR_peek_last_error := nil; + ERR_peek_last_error_line := nil; + ERR_peek_last_error_line_data := nil; + ERR_clear_error := nil; + ERR_error_string := nil; + ERR_error_string_n := nil; + ERR_lib_error_string := nil; + ERR_func_error_string := nil; + ERR_reason_error_string := nil; + ERR_print_errors_cb := nil; + ERR_print_errors := nil; + ERR_load_strings := nil; + ERR_load_strings_const := nil; {introduced 1.1.0} + ERR_unload_strings := nil; + ERR_load_ERR_strings := nil; + ERR_get_state := nil; + ERR_get_next_error_library := nil; + ERR_set_mark := nil; + ERR_pop_to_mark := nil; + ERR_clear_last_mark := nil; {introduced 1.1.0} + SSLErr := nil; {removed 1.0.0} + X509err := nil; {removed 1.0.0} + ERR_GET_REASON := nil; {removed 1.0.0} +end; +{$ELSE} +procedure SSLErr(func: TIdC_INT; reason: TIdC_INT); +begin + ERR_put_error(ERR_LIB_SSL,func,reason,'',0); +end; + +procedure ERR_put_error(lib: TIdC_INT; func: TIdC_INT; reason: TIdC_INT; file_: PIdAnsiChar; line: TIdC_INT); +{ From 3.0 onwards, replaced by a macro + define ERR_put_error(lib, func, reason, file, line) + (ERR_new(), + ERR_set_debug((file), (line), OPENSSL_FUNC), + ERR_set_error((lib), (reason), '',[]))} +begin + ERR_new; + ERR_set_debug(file_,line, ''); + ERR_set_error(lib,reason,'',[]); +end; + +procedure X509err(const f,r : TIdC_INT); +begin + ERR_PUT_error(ERR_LIB_X509,f,r,nil,0); +end; + +function ERR_GET_REASON(const l : TIdC_INT) : TIdC_INT; +begin + Result := l and $fff; +end; + +{$ENDIF} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +initialization + Register_SSLLoader(@Load,'LibCrypto'); + Register_SSLUnloader(@Unload); +{$ENDIF} +end. diff --git a/IdOpenSSLHeaders_evp.pas b/IdOpenSSLHeaders_evp.pas new file mode 100644 index 0000000..42254f0 --- /dev/null +++ b/IdOpenSSLHeaders_evp.pas @@ -0,0 +1,24079 @@ + (* This unit was generated using the script genOpenSSLHdrs.sh from the source file IdOpenSSLHeaders_evp.h2pas + It should not be modified directly. All changes should be made to IdOpenSSLHeaders_evp.h2pas + and this file regenerated. IdOpenSSLHeaders_evp.h2pas is distributed with the full Indy + Distribution. + *) + +{$i IdCompilerDefines.inc} +{$i IdSSLOpenSSLDefines.inc} +{$IFNDEF USE_OPENSSL} + { error Should not compile if USE_OPENSSL is not defined!!!} +{$ENDIF} +{******************************************************************************} +{ } +{ Indy (Internet Direct) - Internet Protocols Simplified } +{ } +{ https://www.indyproject.org/ } +{ https://gitter.im/IndySockets/Indy } +{ } +{******************************************************************************} +{ } +{ This file is part of the Indy (Internet Direct) project, and is offered } +{ under the dual-licensing agreement described on the Indy website. } +{ (https://www.indyproject.org/license/) } +{ } +{ Copyright: } +{ (c) 1993-2020, Chad Z. Hower and the Indy Pit Crew. All rights reserved. } +{ } +{******************************************************************************} +{ } +{ } +{******************************************************************************} + +unit IdOpenSSLHeaders_evp; + +interface + +// Headers for OpenSSL 1.1.1 +// evp.h + + +uses + IdCTypes, + IdGlobal, + IdSSLOpenSSLConsts, + IdOpenSSLHeaders_bio, + IdOpenSSLHeaders_obj_mac, + IdOpenSSLHeaders_ossl_typ; + +const + EVP_MAX_MD_SIZE = 64; // longest known is SHA512 + EVP_MAX_KEY_LENGTH = 64; + EVP_MAX_IV_LENGTH = 16; + EVP_MAX_BLOCK_LENGTH = 32; + PKCS5_SALT_LEN = 8; + // Default PKCS#5 iteration count + PKCS5_DEFAULT_ITER = 2048; + EVP_PK_RSA = $0001; + EVP_PK_DSA = $0002; + EVP_PK_DH = $0004; + EVP_PK_EC = $0008; + EVP_PKT_SIGN = $0010; + EVP_PKT_ENC = $0020; + EVP_PKT_EXCH = $0040; + EVP_PKS_RSA = $0100; + EVP_PKS_DSA = $0200; + EVP_PKS_EC = $0400; + + EVP_PKEY_NONE = NID_undef; + EVP_PKEY_RSA = NID_rsaEncryption; + EVP_PKEY_RSA2 = NID_rsa; + EVP_PKEY_RSA_PSS = NID_rsassaPss; + EVP_PKEY_DSA = NID_dsa; + EVP_PKEY_DSA1 = NID_dsa_2; + EVP_PKEY_DSA2 = NID_dsaWithSHA; + EVP_PKEY_DSA3 = NID_dsaWithSHA1; + EVP_PKEY_DSA4 = NID_dsaWithSHA1_2; + EVP_PKEY_DH = NID_dhKeyAgreement; + EVP_PKEY_DHX = NID_dhpublicnumber; + EVP_PKEY_EC = NID_X9_62_id_ecPublicKey; + EVP_PKEY_SM2 = NID_sm2; + EVP_PKEY_HMAC = NID_hmac; + EVP_PKEY_CMAC = NID_cmac; + EVP_PKEY_SCRYPT = NID_id_scrypt; + EVP_PKEY_TLS1_PRF = NID_tls1_prf; + EVP_PKEY_HKDF = NID_hkdf; + EVP_PKEY_POLY1305 = NID_poly1305; + EVP_PKEY_SIPHASH = NID_siphash; + EVP_PKEY_X25519 = NID_X25519; + EVP_PKEY_ED25519 = NID_ED25519; + EVP_PKEY_X448 = NID_X448; + EVP_PKEY_ED448 = NID_ED448; + + EVP_PKEY_MO_SIGN = $0001; + EVP_PKEY_MO_VERIFY = $0002; + EVP_PKEY_MO_ENCRYPT = $0004; + EVP_PKEY_MO_DECRYPT = $0008; + +// digest can only handle a single block /// + EVP_MD_FLAG_ONESHOT = $0001; + +// digest is extensible-output function; XOF /// + + EVP_MD_FLAG_XOF = $0002; + +// DigestAlgorithmIdentifier flags... /// + + EVP_MD_FLAG_DIGALGID_MASK = $0018; + +// NULL or absent parameter accepted. Use NULL /// + + EVP_MD_FLAG_DIGALGID_NULL = $0000; + +// NULL or absent parameter accepted. Use NULL for PKCS#1 otherwise absent /// + + EVP_MD_FLAG_DIGALGID_ABSENT = $0008; + +// Custom handling via ctrl /// + + EVP_MD_FLAG_DIGALGID_CUSTOM = $0018; + +// Note if suitable for use in FIPS mode /// + + EVP_MD_FLAG_FIPS = $0400; + +// Digest ctrls /// + + EVP_MD_CTRL_DIGALGID = $1; + EVP_MD_CTRL_MICALG = $2; + EVP_MD_CTRL_XOF_LEN = $3; + +// Minimum Algorithm specific ctrl value /// + + EVP_MD_CTRL_ALG_CTRL = $1000; + // not EVP_MD /// + +// values for EVP_MD_CTX flags /// + EVP_MD_CTX_FLAG_ONESHOT = $0001; + EVP_MD_CTX_FLAG_CLEANED = $0002; + EVP_MD_CTX_FLAG_REUSE = $0004; +// + // FIPS and pad options are ignored in 1.0.0; definitions are here so we + // don't accidentally reuse the values for other purposes. + /// + + EVP_MD_CTX_FLAG_NON_FIPS_ALLOW = $0008; + +// + // The following PAD options are also currently ignored in 1.0.0; digest + // parameters are handled through EVP_DigestSign//() and EVP_DigestVerify//() + // instead. + /// + EVP_MD_CTX_FLAG_PAD_MASK = $F0; + EVP_MD_CTX_FLAG_PAD_PKCS1 = $00; + EVP_MD_CTX_FLAG_PAD_X931 = $10; + EVP_MD_CTX_FLAG_PAD_PSS = $20; + + EVP_MD_CTX_FLAG_NO_INIT = $0100; +// + // Some functions such as EVP_DigestSign only finalise copies of internal + // contexts so additional data can be included after the finalisation call. + // This is inefficient if this functionality is not required: it is disabled + // if the following flag is set. + /// + EVP_MD_CTX_FLAG_FINALISE = $0200; + + +// NOTE: $0400 is reserved for internal usage /// +// Values for cipher flags /// + +// Modes for ciphers /// + + EVP_CIPH_STREAM_CIPHER = $0; + EVP_CIPH_ECB_MODE = $1; + EVP_CIPHC_MODE = $2; + EVP_CIPH_CFB_MODE = $3; + EVP_CIPH_OFB_MODE = $4; + EVP_CIPH_CTR_MODE = $5; + EVP_CIPH_GCM_MODE = $6; + EVP_CIPH_CCM_MODE = $7; + EVP_CIPH_XTS_MODE = $10001; + EVP_CIPH_WRAP_MODE = $10002; + EVP_CIPH_OCB_MODE = $10003; + EVP_CIPH_MODE = $F0007; +// Set if variable length cipher /// + EVP_CIPH_VARIABLE_LENGTH = $8; +// Set if the iv handling should be done by the cipher itself /// + EVP_CIPH_CUSTOM_IV = $10; +// Set if the cipher's init() function should be called if key is NULL /// + EVP_CIPH_ALWAYS_CALL_INIT = $20; +// Call ctrl() to init cipher parameters /// + EVP_CIPH_CTRL_INIT = $40; +// Don't use standard key length function /// + EVP_CIPH_CUSTOM_KEY_LENGTH = $80; +// Don't use standard block padding /// + EVP_CIPH_NO_PADDING = $100; +// cipher handles random key generation /// + EVP_CIPH_RAND_KEY = $200; +// cipher has its own additional copying logic /// + EVP_CIPH_CUSTOM_COPY = $400; +// Don't use standard iv length function /// + EVP_CIPH_CUSTOM_IV_LENGTH = $800; +// Allow use default ASN1 get/set iv /// + EVP_CIPH_FLAG_DEFAULT_ASN1 = $1000; +// Buffer length in bits not bytes: CFB1 mode only /// + EVP_CIPH_FLAG_LENGTH_BITS = $2000; +// Note if suitable for use in FIPS mode /// + EVP_CIPH_FLAG_FIPS = $4000; +// Allow non FIPS cipher in FIPS mode /// + EVP_CIPH_FLAG_NON_FIPS_ALLOW = $8000; +// + // Cipher handles any and all padding logic as well as finalisation. + /// + EVP_CIPH_FLAG_CUSTOM_CIPHER = $100000; + EVP_CIPH_FLAG_AEAD_CIPHER = $200000; + EVP_CIPH_FLAG_TLS1_1_MULTIBLOCK = $400000; +// Cipher can handle pipeline operations /// + EVP_CIPH_FLAG_PIPELINE = $800000; + +// + // Cipher context flag to indicate we can handle wrap mode: if allowed in + // older applications it could overflow buffers. + /// + + EVP_CIPHER_CTX_FLAG_WRAP_ALLOW = $1; + +// ctrl() values /// + + EVP_CTRL_INIT = $0; + EVP_CTRL_SET_KEY_LENGTH = $1; + EVP_CTRL_GET_RC2_KEY_BITS = $2; + EVP_CTRL_SET_RC2_KEY_BITS = $3; + EVP_CTRL_GET_RC5_ROUNDS = $4; + EVP_CTRL_SET_RC5_ROUNDS = $5; + EVP_CTRL_RAND_KEY = $6; + EVP_CTRL_PBE_PRF_NID = $7; + EVP_CTRL_COPY = $8; + EVP_CTRL_AEAD_SET_IVLEN = $9; + EVP_CTRL_AEAD_GET_TAG = $10; + EVP_CTRL_AEAD_SET_TAG = $11; + EVP_CTRL_AEAD_SET_IV_FIXED = $12; + EVP_CTRL_GCM_SET_IVLEN = EVP_CTRL_AEAD_SET_IVLEN; + EVP_CTRL_GCM_GET_TAG = EVP_CTRL_AEAD_GET_TAG; + EVP_CTRL_GCM_SET_TAG = EVP_CTRL_AEAD_SET_TAG; + EVP_CTRL_GCM_SET_IV_FIXED = EVP_CTRL_AEAD_SET_IV_FIXED; + EVP_CTRL_GCM_IV_GEN = $13; + EVP_CTRL_CCM_SET_IVLEN = EVP_CTRL_AEAD_SET_IVLEN; + EVP_CTRL_CCM_GET_TAG = EVP_CTRL_AEAD_GET_TAG; + EVP_CTRL_CCM_SET_TAG = EVP_CTRL_AEAD_SET_TAG; + EVP_CTRL_CCM_SET_IV_FIXED = EVP_CTRL_AEAD_SET_IV_FIXED; + EVP_CTRL_CCM_SET_L = $14; + EVP_CTRL_CCM_SET_MSGLEN = $15; +// + // AEAD cipher deduces payload length and returns number of bytes required to + // store MAC and eventual padding. Subsequent call to EVP_Cipher even + // appends/verifies MAC. + /// + EVP_CTRL_AEAD_TLS1_AAD = $16; +// Used by composite AEAD ciphers; no-op in GCM; CCM... /// + EVP_CTRL_AEAD_SET_MAC_KEY = $17; +// Set the GCM invocation field; decrypt only /// + EVP_CTRL_GCM_SET_IV_INV = $18; + + EVP_CTRL_TLS1_1_MULTIBLOCK_AAD = $19; + EVP_CTRL_TLS1_1_MULTIBLOCK_ENCRYPT = $1a; + EVP_CTRL_TLS1_1_MULTIBLOCK_DECRYPT = $1b; + EVP_CTRL_TLS1_1_MULTIBLOCK_MAX_BUFSIZE = $1c; + + EVP_CTRL_SSL3_MASTER_SECRET = $1d; + +// EVP_CTRL_SET_SBOX takes the PIdAnsiChar// specifying S-boxes/// + EVP_CTRL_SET_SBOX = $1e; +// +// EVP_CTRL_SBOX_USED takes a 'TIdC_SIZET' and 'PIdAnsiChar//'; pointing at a +// pre-allocated buffer with specified size +/// + EVP_CTRL_SBOX_USED = $1f; +// EVP_CTRL_KEY_MESH takes 'TIdC_SIZET' number of bytes to mesh the key after; +// 0 switches meshing off +/// + EVP_CTRL_KEY_MESH = $20; +// EVP_CTRL_BLOCK_PADDING_MODE takes the padding mode/// + EVP_CTRL_BLOCK_PADDING_MODE = $21; + +// Set the output buffers to use for a pipelined operation/// + EVP_CTRL_SET_PIPELINE_OUTPUT_BUFS = $22; +// Set the input buffers to use for a pipelined operation/// + EVP_CTRL_SET_PIPELINE_INPUT_BUFS = $23; +// Set the input buffer lengths to use for a pipelined operation/// + EVP_CTRL_SET_PIPELINE_INPUT_LENS = $24; + + EVP_CTRL_GET_IVLEN = $25; + +// Padding modes/// + EVP_PADDING_PKCS7 = 1; + EVP_PADDING_ISO7816_4 = 2; + EVP_PADDING_ANSI923 = 3; + EVP_PADDING_ISO10126 = 4; + EVP_PADDING_ZERO = 5; + +// RFC 5246 defines additional data to be 13 bytes in length/// + EVP_AEAD_TLS1_AAD_LEN = 13; + +// GCM TLS constants/// +// Length of fixed part of IV derived from PRF/// + EVP_GCM_TLS_FIXED_IV_LEN = 4; +// Length of explicit part of IV part of TLS records/// + EVP_GCM_TLS_EXPLICIT_IV_LEN = 8; +// Length of tag for TLS + EVP_GCM_TLS_TAG_LEN = 16; + +/// CCM TLS constants /// +/// Length of fixed part of IV derived from PRF /// + EVP_CCM_TLS_FIXED_IV_LEN = 4; +/// Length of explicit part of IV part of TLS records /// + EVP_CCM_TLS_EXPLICIT_IV_LEN = 8; +/// Total length of CCM IV length for TLS /// + EVP_CCM_TLS_IV_LEN = 12; +/// Length of tag for TLS /// + EVP_CCM_TLS_TAG_LEN = 16; +/// Length of CCM8 tag for TLS /// + EVP_CCM8_TLS_TAG_LEN = 8; + +/// Length of tag for TLS /// + EVP_CHACHAPOLY_TLS_TAG_LEN = 16; + +(* Can appear as the outermost AlgorithmIdentifier *) + EVP_PBE_TYPE_OUTER = $0; +(* Is an PRF type OID *) + EVP_PBE_TYPE_PRF = $1; +(* Is a PKCS#5 v2.0 KDF *) + EVP_PBE_TYPE_KDF = $2; + + ASN1_PKEY_ALIAS = $1; + ASN1_PKEY_DYNAMIC = $2; + ASN1_PKEY_SIGPARAM_NULL = $4; + + ASN1_PKEY_CTRL_PKCS7_SIGN = $1; + ASN1_PKEY_CTRL_PKCS7_ENCRYPT = $2; + ASN1_PKEY_CTRL_DEFAULT_MD_NID = $3; + ASN1_PKEY_CTRL_CMS_SIGN = $5; + ASN1_PKEY_CTRL_CMS_ENVELOPE = $7; + ASN1_PKEY_CTRL_CMS_RI_TYPE = $8; + + ASN1_PKEY_CTRL_SET1_TLS_ENCPT = $9; + ASN1_PKEY_CTRL_GET1_TLS_ENCPT = $a; + + EVP_PKEY_OP_UNDEFINED = 0; + EVP_PKEY_OP_PARAMGEN = (1 shl 1); + EVP_PKEY_OP_KEYGEN = (1 shl 2); + EVP_PKEY_OP_SIGN = (1 shl 3); + EVP_PKEY_OP_VERIFY = (1 shl 4); + EVP_PKEY_OP_VERIFYRECOVER = (1 shl 5); + EVP_PKEY_OP_SIGNCTX = (1 shl 6); + EVP_PKEY_OP_VERIFYCTX = (1 shl 7); + EVP_PKEY_OP_ENCRYPT = (1 shl 8); + EVP_PKEY_OP_DECRYPT = (1 shl 9); + EVP_PKEY_OP_DERIVE = (1 shl 10); + + EVP_PKEY_OP_TYPE_SIG = EVP_PKEY_OP_SIGN or EVP_PKEY_OP_VERIFY + or EVP_PKEY_OP_VERIFYRECOVER or EVP_PKEY_OP_SIGNCTX or EVP_PKEY_OP_VERIFYCTX; + + EVP_PKEY_OP_TYPE_CRYPT = EVP_PKEY_OP_ENCRYPT or EVP_PKEY_OP_DECRYPT; + + EVP_PKEY_OP_TYPE_NOGEN = EVP_PKEY_OP_TYPE_SIG or EVP_PKEY_OP_TYPE_CRYPT or EVP_PKEY_OP_DERIVE; + + EVP_PKEY_OP_TYPE_GEN = EVP_PKEY_OP_PARAMGEN or EVP_PKEY_OP_KEYGEN; + + EVP_PKEY_CTRL_MD = 1; + EVP_PKEY_CTRL_PEER_KEY = 2; + + EVP_PKEY_CTRL_PKCS7_ENCRYPT = 3; + EVP_PKEY_CTRL_PKCS7_DECRYPT = 4; + + EVP_PKEY_CTRL_PKCS7_SIGN = 5; + + EVP_PKEY_CTRL_SET_MAC_KEY = 6; + + EVP_PKEY_CTRL_DIGESTINIT = 7; + +(* Used by GOST key encryption in TLS *) + EVP_PKEY_CTRL_SET_IV = 8; + + EVP_PKEY_CTRL_CMS_ENCRYPT = 9; + EVP_PKEY_CTRL_CMS_DECRYPT = 10; + EVP_PKEY_CTRL_CMS_SIGN = 11; + + EVP_PKEY_CTRL_CIPHER = 12; + + EVP_PKEY_CTRL_GET_MD = 13; + + EVP_PKEY_CTRL_SET_DIGEST_SIZE = 14; + + EVP_PKEY_ALG_CTRL = $1000; + + EVP_PKEY_FLAG_AUTOARGLEN = 2; + // + // Method handles all operations: don't assume any digest related defaults. + // + EVP_PKEY_FLAG_SIGCTX_CUSTOM = 4; + +type + EVP_MD_meth_init = function(ctx: PEVP_MD_CTX): TIdC_INT; cdecl; + EVP_MD_meth_update = function(ctx: PEVP_MD_CTX; const data: Pointer; + count: TIdC_SIZET): TIdC_INT; cdecl; + EVP_MD_meth_final = function(ctx: PEVP_MD_CTX; const md: PByte): TIdC_INT; cdecl; + EVP_MD_meth_copy = function(to_: PEVP_MD_CTX; const from: PEVP_MD_CTX): TIdC_INT; cdecl; + EVP_MD_meth_cleanup = function(ctx: PEVP_MD_CTX): TIdC_INT; cdecl; + EVP_MD_meth_ctrl = function(ctx: PEVP_MD_CTX; cmd: TIdC_INT; p1: TIdC_INT; + p2: Pointer): TIdC_INT; cdecl; + + EVP_CIPHER_meth_init = function(ctx: PEVP_CIPHER_CTX; const key: PByte; + const iv: PByte; enc: TIdC_SIZET): TIdC_INT; cdecl; + EVP_CIPHER_meth_do_cipher = function(ctx: PEVP_CIPHER_CTX; out_: PByte; + const in_: PByte; inl: TIdC_SIZET): TIdC_INT; cdecl; + EVP_CIPHER_meth_cleanup = function(v1: PEVP_CIPHER_CTX): TIdC_INT; cdecl; + EVP_CIPHER_meth_set_asn1_params = function(v1: PEVP_CIPHER_CTX; + v2: PASN1_TYPE): TIdC_INT; cdecl; + EVP_CIPHER_meth_get_asn1_params = function(v1: PEVP_CIPHER_CTX; + v2: PASN1_TYPE): TIdC_INT; cdecl; + EVP_CIPHER_meth_ctrl = function(v1: PEVP_CIPHER_CTX; type_: TIdC_INT; + arg: TIdC_INT; ptr: Pointer): TIdC_INT; cdecl; + + EVP_CTRL_TLS1_1_MULTIBLOCK_PARAM = record + out_: PByte; + inp: PByte; + len: TIdC_SIZET; + interleave: TidC_UINT; + end; + + evp_cipher_info_st = record + cipher: PEVP_CIPHER; + iv: array[0 .. EVP_MAX_IV_LENGTH - 1] of PByte; + end; + EVP_CIPHER_INFO = evp_cipher_info_st; + + EVP_MD_CTX_update = function(ctx: PEVP_MD_CTX; const data: Pointer; count: TIdC_SIZET): TIdC_INT; cdecl; + + fn = procedure(const ciph: PEVP_CIPHER; const from: PIdAnsiChar; const to_: PIdAnsiChar; x: Pointer); cdecl; + + pub_decode = function(pk: PEVP_PKEY; pub: PX509_PUBKEY): TIdC_INT; cdecl; + pub_encode = function(pub: PX509_PUBKEY; const pk: PEVP_PKEY): TIdC_INT; cdecl; + pub_cmd = function(const a: PEVP_PKEY; const b: PEVP_PKEY): TIdC_INT; cdecl; + pub_print = function(out_: PBIO; const pkey: PEVP_PKEY; indent: TIdC_INT; pctx: PASN1_PCTX): TIdC_INT; cdecl; + pkey_size = function(const pk: PEVP_PKEY): TIdC_INT; cdecl; + pkey_bits = function(const pk: PEVP_PKEY): TIdC_INT; cdecl; + + priv_decode = function(pk: PEVP_PKEY; const p8inf: PKCS8_PRIV_KEY_INFO): TIdC_INT; cdecl; + priv_encode = function(p8: PPKCS8_PRIV_KEY_INFO; const pk: PEVP_PKEY): TIdC_INT; cdecl; + priv_print = function(out_: PBIO; const pkea: PEVP_PKEY; indent: TIdC_INT; pctx: PASN1_PCTX): TIdC_INT; cdecl; + + param_decode = function(pkey: PEVP_PKEY; const pder: PPByte; derlen: TIdC_INT): TIdC_INT; cdecl; + param_encode = function(const pkey: PEVP_PKEY; pder: PPByte): TIdC_INT; cdecl; + param_missing = function(const pk: PEVP_PKEY): TIdC_INT; cdecl; + param_copy = function(to_: PEVP_PKEY; const from: PEVP_PKEY): TIdC_INT; cdecl; + param_cmp = function(const a: PEVP_PKEY; const b: PEVP_PKEY): TIdC_INT; cdecl; + param_print = function(out_: PBIO; const pkey: PEVP_PKEY; indent: TIdC_INT; pctx: PASN1_PCTX): TIdC_INT; cdecl; + + pkey_free = procedure(pkey: PEVP_PKEY); cdecl; + pkey_ctrl = function(pkey: PEVP_PKEY; op: TIdC_INT; arg1: TIdC_LONG; arg2: Pointer): TIdC_INT; cdecl; + item_verify = function(ctx: PEVP_MD_CTX; const it: PASN1_ITEM; asn: Pointer; + a: PX509_ALGOR; sig: PASN1_BIT_STRING; pkey: PEVP_PKEY): TIdC_INT; cdecl; + item_sign = function(ctx: PEVP_MD_CTX; const it: PASN1_ITEM; asn: Pointer; + alg1: PX509_ALGOR; alg2: PX509_ALGOR; sig: PASN1_BIT_STRING): TIdC_INT; cdecl; + siginf_set = function(siginf: PX509_SIG_INFO; const alg: PX509_ALGOR; const sig: PASN1_STRING): TIdC_INT; cdecl; + pkey_check = function(const pk: PEVP_PKEY): TIdC_INT; cdecl; + pkey_pub_check = function(const pk: PEVP_PKEY): TIdC_INT; cdecl; + pkey_param_check = function(const pk: PEVP_PKEY): TIdC_INT; cdecl; + set_priv_key = function(pk: PEVP_PKEY; const priv: PByte; len: TIdC_SIZET): TIdC_INT; cdecl; + set_pub_key = function(pk: PEVP_PKEY; const pub: PByte; len: TIdC_SIZET): TIdC_INT; cdecl; + get_priv_key = function(const pk: PEVP_PKEY; priv: PByte; len: PIdC_SIZET): TIdC_INT; cdecl; + get_pub_key = function(const pk: PEVP_PKEY; pub: PByte; len: PIdC_SIZET): TIdC_INT; cdecl; + pkey_security_bits = function(const pk: PEVP_PKEY): TIdC_INT; cdecl; + + EVP_PKEY_gen_cb = function(ctx: PEVP_PKEY_CTX): TIdC_INT; cdecl; +// PEVP_PKEY_gen_cb = ^EVP_PKEY_gen_cb; + + EVP_PKEY_meth_init = function(ctx: PEVP_PKEY_CTX): TIdC_INT; cdecl; + PEVP_PKEY_meth_init = ^EVP_PKEY_meth_init; + EVP_PKEY_meth_copy_cb = function(dst: PEVP_PKEY_CTX; src: PEVP_PKEY_CTX): TIdC_INT; cdecl; + PEVP_PKEY_meth_copy = ^EVP_PKEY_meth_copy_cb; + EVP_PKEY_meth_cleanup = procedure(ctx: PEVP_PKEY_CTX); cdecl; + PEVP_PKEY_meth_cleanup = ^EVP_PKEY_meth_cleanup; + EVP_PKEY_meth_paramgen_init = function(ctx: PEVP_PKEY_CTX): TIdC_INT; cdecl; + PEVP_PKEY_meth_paramgen_init = ^EVP_PKEY_meth_paramgen_init; + EVP_PKEY_meth_paramgen = function(ctx: PEVP_PKEY_CTX; pkey: PEVP_PKEY): TIdC_INT; cdecl; + PEVP_PKEY_meth_paramgen = ^EVP_PKEY_meth_paramgen; + EVP_PKEY_meth_keygen_init = function(ctx: PEVP_PKEY_CTX): TIdC_INT; cdecl; + PEVP_PKEY_meth_keygen_init = ^EVP_PKEY_meth_keygen_init; + EVP_PKEY_meth_keygen = function(ctx: PEVP_PKEY_CTX; pkey: PEVP_PKEY): TIdC_INT; cdecl; + PEVP_PKEY_meth_keygen = ^EVP_PKEY_meth_keygen; + EVP_PKEY_meth_sign_init = function(ctx: PEVP_PKEY_CTX): TIdC_INT; cdecl; + PEVP_PKEY_meth_sign_init = ^EVP_PKEY_meth_sign_init; + EVP_PKEY_meth_sign = function(ctx: PEVP_PKEY_CTX; sig: PByte; siglen: TIdC_SIZET; + const tbs: PByte; tbslen: TIdC_SIZET): TIdC_INT; cdecl; + PEVP_PKEY_meth_sign = ^EVP_PKEY_meth_sign; + EVP_PKEY_meth_verify_init = function(ctx: PEVP_PKEY_CTX): TIdC_INT; cdecl; + PEVP_PKEY_meth_verify_init = ^EVP_PKEY_meth_verify_init; + EVP_PKEY_meth_verify = function(ctx: PEVP_PKEY_CTX; const sig: PByte; + siglen: TIdC_SIZET; const tbs: PByte; tbslen: TIdC_SIZET): TIdC_INT; cdecl; + PEVP_PKEY_meth_verify = ^EVP_PKEY_meth_verify; + EVP_PKEY_meth_verify_recover_init = function(ctx: PEVP_PKEY_CTX): TIdC_INT; cdecl; + PEVP_PKEY_meth_verify_recover_init = ^EVP_PKEY_meth_verify_recover_init; + EVP_PKEY_meth_verify_recover = function(ctx: PEVP_PKEY_CTX; sig: PByte; + siglen: TIdC_SIZET; const tbs: PByte; tbslen: TIdC_SIZET): TIdC_INT; cdecl; + PEVP_PKEY_meth_verify_recover = ^EVP_PKEY_meth_verify_recover; + EVP_PKEY_meth_signctx_init = function(ctx: PEVP_PKEY_CTX): TIdC_INT; cdecl; + PEVP_PKEY_meth_signctx_init = ^EVP_PKEY_meth_signctx_init; + EVP_PKEY_meth_signctx = function(ctx: PEVP_PKEY_CTX; sig: Pbyte; + siglen: TIdC_SIZET; mctx: PEVP_MD_CTX): TIdC_INT; cdecl; + PEVP_PKEY_meth_signctx = ^EVP_PKEY_meth_signctx; + EVP_PKEY_meth_verifyctx_init = function(ctx: PEVP_PKEY_CTX; mctx: PEVP_MD_CTX): TIdC_INT; cdecl; + PEVP_PKEY_meth_verifyctx_init = ^EVP_PKEY_meth_verifyctx_init; + EVP_PKEY_meth_verifyctx = function(ctx: PEVP_PKEY_CTX; const sig: PByte; + siglen: TIdC_INT; mctx: PEVP_MD_CTX): TIdC_INT; cdecl; + PEVP_PKEY_meth_verifyctx = ^EVP_PKEY_meth_verifyctx; + EVP_PKEY_meth_encrypt_init = function(ctx: PEVP_PKEY_CTX): TIdC_INT; cdecl; + PEVP_PKEY_meth_encrypt_init = ^EVP_PKEY_meth_encrypt_init; + EVP_PKEY_meth_encrypt = function(ctx: PEVP_PKEY_CTX; out_: PByte; + outlen: TIdC_SIZET; const in_: PByte): TIdC_INT; cdecl; + PEVP_PKEY_meth_encrypt = ^ EVP_PKEY_meth_encrypt; + EVP_PKEY_meth_decrypt_init = function(ctx: PEVP_PKEY_CTX): TIdC_INT; cdecl; + PEVP_PKEY_meth_decrypt_init = ^EVP_PKEY_meth_decrypt_init; + EVP_PKEY_meth_decrypt = function(ctx: PEVP_PKEY_CTX; out_: PByte; + outlen: TIdC_SIZET; const in_: PByte; inlen: TIdC_SIZET): TIdC_INT; cdecl; + PEVP_PKEY_meth_decrypt = ^EVP_PKEY_meth_decrypt; + EVP_PKEY_meth_derive_init = function(ctx: PEVP_PKEY_CTX): TIdC_INT; cdecl; + PEVP_PKEY_meth_derive_init = ^EVP_PKEY_meth_derive_init; + EVP_PKEY_meth_derive = function(ctx: PEVP_PKEY_CTX; key: PByte; keylen: PIdC_SIZET): TIdC_INT; cdecl; + PEVP_PKEY_meth_derive = ^EVP_PKEY_meth_derive; + EVP_PKEY_meth_ctrl = function(ctx: PEVP_PKEY_CTX; type_: TIdC_INT; p1: TIdC_INT; p2: Pointer): TIdC_INT; cdecl; + PEVP_PKEY_meth_ctrl = ^EVP_PKEY_meth_ctrl; + EVP_PKEY_meth_ctrl_str = function(ctx: PEVP_PKEY_CTX; key: PByte; keylen: PIdC_SIZET): TIdC_INT; cdecl; + PEVP_PKEY_meth_ctrl_str = ^EVP_PKEY_meth_ctrl_str; + EVP_PKEY_meth_digestsign = function(ctx: PEVP_PKEY_CTX; sig: PByte; + siglen: PIdC_SIZET; const tbs: PByte; tbslen: TIdC_SIZET): TIdC_INT; cdecl; + PEVP_PKEY_meth_digestsign = ^EVP_PKEY_meth_digestsign; + EVP_PKEY_meth_digestverify = function(ctx: PEVP_MD_CTX; const sig: PByte; + siglen: TIdC_SIZET; const tbs: PByte; tbslen: TIdC_SIZET): TIdC_INT; cdecl; + PEVP_PKEY_meth_digestverify = ^EVP_PKEY_meth_digestverify; + EVP_PKEY_meth_check = function(pkey: PEVP_PKEY): TIdC_INT; cdecl; + PEVP_PKEY_meth_check = ^EVP_PKEY_meth_check; + EVP_PKEY_meth_public_check = function(pkey: PEVP_PKEY): TIdC_INT; cdecl; + PEVP_PKEY_meth_public_check = ^EVP_PKEY_meth_public_check; + EVP_PKEY_meth_param_check = function(pkey: PEVP_PKEY): TIdC_INT; cdecl; + PEVP_PKEY_meth_param_check = ^EVP_PKEY_meth_param_check; + EVP_PKEY_meth_digest_custom = function(pkey: PEVP_PKEY; mctx: PEVP_MD_CTX): TIdC_INT; cdecl; + PEVP_PKEY_meth_digest_custom = ^EVP_PKEY_meth_digest_custom; + + // Password based encryption function + EVP_PBE_KEYGEN = function(ctx: PEVP_CIPHER_CTX; const pass: PIdAnsiChar; + passlen: TIdC_INT; param: PASN1_TYPE; const cipher: PEVP_CIPHER; + const md: PEVP_MD; en_de: TIdC_INT): TIdC_INT; cdecl; + PEVP_PBE_KEYGEN = ^EVP_PBE_KEYGEN; + PPEVP_PBE_KEYGEN = ^PEVP_PBE_KEYGEN; + + { The EXTERNALSYM directive is ignored by FPC, however, it is used by Delphi as follows: + + The EXTERNALSYM directive prevents the specified Delphi symbol from appearing in header + files generated for C++. } + + {$EXTERNALSYM EVP_MD_meth_new} {introduced 1.1.0} + {$EXTERNALSYM EVP_MD_meth_dup} {introduced 1.1.0} + {$EXTERNALSYM EVP_MD_meth_free} {introduced 1.1.0} + {$EXTERNALSYM EVP_MD_meth_set_input_blocksize} {introduced 1.1.0} + {$EXTERNALSYM EVP_MD_meth_set_result_size} {introduced 1.1.0} + {$EXTERNALSYM EVP_MD_meth_set_app_datasize} {introduced 1.1.0} + {$EXTERNALSYM EVP_MD_meth_set_flags} {introduced 1.1.0} + {$EXTERNALSYM EVP_MD_meth_set_init} {introduced 1.1.0} + {$EXTERNALSYM EVP_MD_meth_set_update} {introduced 1.1.0} + {$EXTERNALSYM EVP_MD_meth_set_final} {introduced 1.1.0} + {$EXTERNALSYM EVP_MD_meth_set_copy} {introduced 1.1.0} + {$EXTERNALSYM EVP_MD_meth_set_cleanup} {introduced 1.1.0} + {$EXTERNALSYM EVP_MD_meth_set_ctrl} {introduced 1.1.0} + {$EXTERNALSYM EVP_MD_meth_get_input_blocksize} {introduced 1.1.0} + {$EXTERNALSYM EVP_MD_meth_get_result_size} {introduced 1.1.0} + {$EXTERNALSYM EVP_MD_meth_get_app_datasize} {introduced 1.1.0} + {$EXTERNALSYM EVP_MD_meth_get_flags} {introduced 1.1.0} + {$EXTERNALSYM EVP_MD_meth_get_init} {introduced 1.1.0} + {$EXTERNALSYM EVP_MD_meth_get_update} {introduced 1.1.0} + {$EXTERNALSYM EVP_MD_meth_get_final} {introduced 1.1.0} + {$EXTERNALSYM EVP_MD_meth_get_copy} {introduced 1.1.0} + {$EXTERNALSYM EVP_MD_meth_get_cleanup} {introduced 1.1.0} + {$EXTERNALSYM EVP_MD_meth_get_ctrl} {introduced 1.1.0} + {$EXTERNALSYM EVP_CIPHER_meth_new} {introduced 1.1.0} + {$EXTERNALSYM EVP_CIPHER_meth_dup} {introduced 1.1.0} + {$EXTERNALSYM EVP_CIPHER_meth_free} {introduced 1.1.0} + {$EXTERNALSYM EVP_CIPHER_meth_set_iv_length} {introduced 1.1.0} + {$EXTERNALSYM EVP_CIPHER_meth_set_flags} {introduced 1.1.0} + {$EXTERNALSYM EVP_CIPHER_meth_set_impl_ctx_size} {introduced 1.1.0} + {$EXTERNALSYM EVP_CIPHER_meth_set_init} {introduced 1.1.0} + {$EXTERNALSYM EVP_CIPHER_meth_set_do_cipher} {introduced 1.1.0} + {$EXTERNALSYM EVP_CIPHER_meth_set_cleanup} {introduced 1.1.0} + {$EXTERNALSYM EVP_CIPHER_meth_set_set_asn1_params} {introduced 1.1.0} + {$EXTERNALSYM EVP_CIPHER_meth_set_get_asn1_params} {introduced 1.1.0} + {$EXTERNALSYM EVP_CIPHER_meth_set_ctrl} {introduced 1.1.0} + {$EXTERNALSYM EVP_CIPHER_meth_get_init} {introduced 1.1.0} + {$EXTERNALSYM EVP_CIPHER_meth_get_do_cipher} {introduced 1.1.0} + {$EXTERNALSYM EVP_CIPHER_meth_get_cleanup} {introduced 1.1.0} + {$EXTERNALSYM EVP_CIPHER_meth_get_set_asn1_params} {introduced 1.1.0} + {$EXTERNALSYM EVP_CIPHER_meth_get_get_asn1_params} {introduced 1.1.0} + {$EXTERNALSYM EVP_CIPHER_meth_get_ctrl} {introduced 1.1.0} + {$EXTERNALSYM EVP_MD_CTX_md} + {$EXTERNALSYM EVP_MD_CTX_update_fn} {introduced 1.1.0} + {$EXTERNALSYM EVP_MD_CTX_set_update_fn} {introduced 1.1.0} + {$EXTERNALSYM EVP_MD_CTX_set_pkey_ctx} {introduced 1.1.0} + {$EXTERNALSYM EVP_CIPHER_impl_ctx_size} {introduced 1.1.0} + {$EXTERNALSYM EVP_CIPHER_CTX_cipher} + {$EXTERNALSYM EVP_CIPHER_CTX_iv} {introduced 1.1.0} + {$EXTERNALSYM EVP_CIPHER_CTX_original_iv} {introduced 1.1.0} + {$EXTERNALSYM EVP_CIPHER_CTX_iv_noconst} {introduced 1.1.0} + {$EXTERNALSYM EVP_CIPHER_CTX_buf_noconst} {introduced 1.1.0} + {$EXTERNALSYM EVP_CIPHER_CTX_set_num} {introduced 1.1.0} + {$EXTERNALSYM EVP_CIPHER_CTX_copy} + {$EXTERNALSYM EVP_CIPHER_CTX_get_app_data} + {$EXTERNALSYM EVP_CIPHER_CTX_set_app_data} + {$EXTERNALSYM EVP_CIPHER_CTX_get_cipher_data} {introduced 1.1.0} + {$EXTERNALSYM EVP_CIPHER_CTX_set_cipher_data} {introduced 1.1.0} + {$EXTERNALSYM EVP_MD_CTX_ctrl} {introduced 1.1.0} + {$EXTERNALSYM EVP_MD_CTX_new} {introduced 1.1.0} + {$EXTERNALSYM EVP_MD_CTX_reset} {introduced 1.1.0} + {$EXTERNALSYM EVP_MD_CTX_free} {introduced 1.1.0} + {$EXTERNALSYM EVP_MD_CTX_copy_ex} + {$EXTERNALSYM EVP_MD_CTX_set_flags} + {$EXTERNALSYM EVP_MD_CTX_clear_flags} + {$EXTERNALSYM EVP_MD_CTX_test_flags} + {$EXTERNALSYM EVP_DigestInit_ex} + {$EXTERNALSYM EVP_DigestUpdate} + {$EXTERNALSYM EVP_DigestFinal_ex} + {$EXTERNALSYM EVP_Digest} + {$EXTERNALSYM EVP_MD_CTX_copy} + {$EXTERNALSYM EVP_DigestInit} + {$EXTERNALSYM EVP_DigestFinal} + {$EXTERNALSYM EVP_DigestFinalXOF} {introduced 1.1.0} + {$EXTERNALSYM EVP_read_pw_string} + {$EXTERNALSYM EVP_read_pw_string_min} + {$EXTERNALSYM EVP_set_pw_prompt} + {$EXTERNALSYM EVP_get_pw_prompt} + {$EXTERNALSYM EVP_BytesToKey} + {$EXTERNALSYM EVP_CIPHER_CTX_set_flags} + {$EXTERNALSYM EVP_CIPHER_CTX_clear_flags} + {$EXTERNALSYM EVP_CIPHER_CTX_test_flags} + {$EXTERNALSYM EVP_EncryptInit} + {$EXTERNALSYM EVP_EncryptInit_ex} + {$EXTERNALSYM EVP_EncryptUpdate} + {$EXTERNALSYM EVP_EncryptFinal_ex} + {$EXTERNALSYM EVP_EncryptFinal} + {$EXTERNALSYM EVP_DecryptInit} + {$EXTERNALSYM EVP_DecryptInit_ex} + {$EXTERNALSYM EVP_DecryptUpdate} + {$EXTERNALSYM EVP_DecryptFinal} + {$EXTERNALSYM EVP_DecryptFinal_ex} + {$EXTERNALSYM EVP_CipherInit} + {$EXTERNALSYM EVP_CipherInit_ex} + {$EXTERNALSYM EVP_CipherUpdate} + {$EXTERNALSYM EVP_CipherFinal} + {$EXTERNALSYM EVP_CipherFinal_ex} + {$EXTERNALSYM EVP_SignFinal} + {$EXTERNALSYM EVP_DigestSign} {introduced 1.1.0} + {$EXTERNALSYM EVP_VerifyFinal} + {$EXTERNALSYM EVP_DigestVerify} {introduced 1.1.0} + {$EXTERNALSYM EVP_DigestSignInit} + {$EXTERNALSYM EVP_DigestSignFinal} + {$EXTERNALSYM EVP_DigestVerifyInit} + {$EXTERNALSYM EVP_DigestVerifyFinal} + {$EXTERNALSYM EVP_OpenInit} + {$EXTERNALSYM EVP_OpenFinal} + {$EXTERNALSYM EVP_SealInit} + {$EXTERNALSYM EVP_SealFinal} + {$EXTERNALSYM EVP_ENCODE_CTX_new} {introduced 1.1.0} + {$EXTERNALSYM EVP_ENCODE_CTX_free} {introduced 1.1.0} + {$EXTERNALSYM EVP_ENCODE_CTX_copy} {introduced 1.1.0} + {$EXTERNALSYM EVP_ENCODE_CTX_num} {introduced 1.1.0} + {$EXTERNALSYM EVP_EncodeInit} + {$EXTERNALSYM EVP_EncodeUpdate} + {$EXTERNALSYM EVP_EncodeFinal} + {$EXTERNALSYM EVP_EncodeBlock} + {$EXTERNALSYM EVP_DecodeInit} + {$EXTERNALSYM EVP_DecodeUpdate} + {$EXTERNALSYM EVP_DecodeFinal} + {$EXTERNALSYM EVP_DecodeBlock} + {$EXTERNALSYM EVP_CIPHER_CTX_new} + {$EXTERNALSYM EVP_CIPHER_CTX_reset} {introduced 1.1.0} + {$EXTERNALSYM EVP_CIPHER_CTX_free} + {$EXTERNALSYM EVP_CIPHER_CTX_set_key_length} + {$EXTERNALSYM EVP_CIPHER_CTX_set_padding} + {$EXTERNALSYM EVP_CIPHER_CTX_ctrl} + {$EXTERNALSYM EVP_CIPHER_CTX_rand_key} + {$EXTERNALSYM BIO_f_md} + {$EXTERNALSYM BIO_f_base64} + {$EXTERNALSYM BIO_f_cipher} + {$EXTERNALSYM BIO_f_reliable} + {$EXTERNALSYM BIO_set_cipher} + {$EXTERNALSYM EVP_md_null} + {$EXTERNALSYM EVP_md5_sha1} {introduced 1.1.0} + {$EXTERNALSYM EVP_sha1} + {$EXTERNALSYM EVP_sha224} + {$EXTERNALSYM EVP_sha256} + {$EXTERNALSYM EVP_sha384} + {$EXTERNALSYM EVP_sha512} + {$EXTERNALSYM EVP_sha512_224} {introduced 1.1.0} + {$EXTERNALSYM EVP_sha512_256} {introduced 1.1.0} + {$EXTERNALSYM EVP_sha3_224} {introduced 1.1.0} + {$EXTERNALSYM EVP_sha3_256} {introduced 1.1.0} + {$EXTERNALSYM EVP_sha3_384} {introduced 1.1.0} + {$EXTERNALSYM EVP_sha3_512} {introduced 1.1.0} + {$EXTERNALSYM EVP_shake128} {introduced 1.1.0} + {$EXTERNALSYM EVP_shake256} {introduced 1.1.0} + {$EXTERNALSYM EVP_enc_null} + {$EXTERNALSYM EVP_des_ecb} + {$EXTERNALSYM EVP_des_ede} + {$EXTERNALSYM EVP_des_ede3} + {$EXTERNALSYM EVP_des_ede_ecb} + {$EXTERNALSYM EVP_des_ede3_ecb} + {$EXTERNALSYM EVP_des_cfb64} + {$EXTERNALSYM EVP_des_cfb1} + {$EXTERNALSYM EVP_des_cfb8} + {$EXTERNALSYM EVP_des_ede_cfb64} + {$EXTERNALSYM EVP_des_ede3_cfb64} + {$EXTERNALSYM EVP_des_ede3_cfb1} + {$EXTERNALSYM EVP_des_ede3_cfb8} + {$EXTERNALSYM EVP_des_ofb} + {$EXTERNALSYM EVP_des_ede_ofb} + {$EXTERNALSYM EVP_des_ede3_ofb} + {$EXTERNALSYM EVP_des_cbc} + {$EXTERNALSYM EVP_des_ede_cbc} + {$EXTERNALSYM EVP_des_ede3_cbc} + {$EXTERNALSYM EVP_desx_cbc} + {$EXTERNALSYM EVP_des_ede3_wrap} + {$EXTERNALSYM EVP_rc4} + {$EXTERNALSYM EVP_rc4_40} + {$EXTERNALSYM EVP_rc2_ecb} + {$EXTERNALSYM EVP_rc2_cbc} + {$EXTERNALSYM EVP_rc2_40_cbc} + {$EXTERNALSYM EVP_rc2_64_cbc} + {$EXTERNALSYM EVP_rc2_cfb64} + {$EXTERNALSYM EVP_rc2_ofb} + {$EXTERNALSYM EVP_bf_ecb} + {$EXTERNALSYM EVP_bf_cbc} + {$EXTERNALSYM EVP_bf_cfb64} + {$EXTERNALSYM EVP_bf_ofb} + {$EXTERNALSYM EVP_cast5_ecb} + {$EXTERNALSYM EVP_cast5_cbc} + {$EXTERNALSYM EVP_cast5_cfb64} + {$EXTERNALSYM EVP_cast5_ofb} + {$EXTERNALSYM EVP_aes_128_ecb} + {$EXTERNALSYM EVP_aes_128_cbc} + {$EXTERNALSYM EVP_aes_128_cfb1} + {$EXTERNALSYM EVP_aes_128_cfb8} + {$EXTERNALSYM EVP_aes_128_cfb128} + {$EXTERNALSYM EVP_aes_128_ofb} + {$EXTERNALSYM EVP_aes_128_ctr} + {$EXTERNALSYM EVP_aes_128_ccm} + {$EXTERNALSYM EVP_aes_128_gcm} + {$EXTERNALSYM EVP_aes_128_xts} + {$EXTERNALSYM EVP_aes_128_wrap} + {$EXTERNALSYM EVP_aes_128_wrap_pad} {introduced 1.1.0} + {$EXTERNALSYM EVP_aes_128_ocb} {introduced 1.1.0} + {$EXTERNALSYM EVP_aes_192_ecb} + {$EXTERNALSYM EVP_aes_192_cbc} + {$EXTERNALSYM EVP_aes_192_cfb1} + {$EXTERNALSYM EVP_aes_192_cfb8} + {$EXTERNALSYM EVP_aes_192_cfb128} + {$EXTERNALSYM EVP_aes_192_ofb} + {$EXTERNALSYM EVP_aes_192_ctr} + {$EXTERNALSYM EVP_aes_192_ccm} + {$EXTERNALSYM EVP_aes_192_gcm} + {$EXTERNALSYM EVP_aes_192_wrap} + {$EXTERNALSYM EVP_aes_192_wrap_pad} {introduced 1.1.0} + {$EXTERNALSYM EVP_aes_192_ocb} {introduced 1.1.0} + {$EXTERNALSYM EVP_aes_256_ecb} + {$EXTERNALSYM EVP_aes_256_cbc} + {$EXTERNALSYM EVP_aes_256_cfb1} + {$EXTERNALSYM EVP_aes_256_cfb8} + {$EXTERNALSYM EVP_aes_256_cfb128} + {$EXTERNALSYM EVP_aes_256_ofb} + {$EXTERNALSYM EVP_aes_256_ctr} + {$EXTERNALSYM EVP_aes_256_ccm} + {$EXTERNALSYM EVP_aes_256_gcm} + {$EXTERNALSYM EVP_aes_256_xts} + {$EXTERNALSYM EVP_aes_256_wrap} + {$EXTERNALSYM EVP_aes_256_wrap_pad} {introduced 1.1.0} + {$EXTERNALSYM EVP_aes_256_ocb} {introduced 1.1.0} + {$EXTERNALSYM EVP_aes_128_cbc_hmac_sha1} + {$EXTERNALSYM EVP_aes_256_cbc_hmac_sha1} + {$EXTERNALSYM EVP_aes_128_cbc_hmac_sha256} + {$EXTERNALSYM EVP_aes_256_cbc_hmac_sha256} + {$EXTERNALSYM EVP_aria_128_ecb} {introduced 1.1.0} + {$EXTERNALSYM EVP_aria_128_cbc} {introduced 1.1.0} + {$EXTERNALSYM EVP_aria_128_cfb1} {introduced 1.1.0} + {$EXTERNALSYM EVP_aria_128_cfb8} {introduced 1.1.0} + {$EXTERNALSYM EVP_aria_128_cfb128} {introduced 1.1.0} + {$EXTERNALSYM EVP_aria_128_ctr} {introduced 1.1.0} + {$EXTERNALSYM EVP_aria_128_ofb} {introduced 1.1.0} + {$EXTERNALSYM EVP_aria_128_gcm} {introduced 1.1.0} + {$EXTERNALSYM EVP_aria_128_ccm} {introduced 1.1.0} + {$EXTERNALSYM EVP_aria_192_ecb} {introduced 1.1.0} + {$EXTERNALSYM EVP_aria_192_cbc} {introduced 1.1.0} + {$EXTERNALSYM EVP_aria_192_cfb1} {introduced 1.1.0} + {$EXTERNALSYM EVP_aria_192_cfb8} {introduced 1.1.0} + {$EXTERNALSYM EVP_aria_192_cfb128} {introduced 1.1.0} + {$EXTERNALSYM EVP_aria_192_ctr} {introduced 1.1.0} + {$EXTERNALSYM EVP_aria_192_ofb} {introduced 1.1.0} + {$EXTERNALSYM EVP_aria_192_gcm} {introduced 1.1.0} + {$EXTERNALSYM EVP_aria_192_ccm} {introduced 1.1.0} + {$EXTERNALSYM EVP_aria_256_ecb} {introduced 1.1.0} + {$EXTERNALSYM EVP_aria_256_cbc} {introduced 1.1.0} + {$EXTERNALSYM EVP_aria_256_cfb1} {introduced 1.1.0} + {$EXTERNALSYM EVP_aria_256_cfb8} {introduced 1.1.0} + {$EXTERNALSYM EVP_aria_256_cfb128} {introduced 1.1.0} + {$EXTERNALSYM EVP_aria_256_ctr} {introduced 1.1.0} + {$EXTERNALSYM EVP_aria_256_ofb} {introduced 1.1.0} + {$EXTERNALSYM EVP_aria_256_gcm} {introduced 1.1.0} + {$EXTERNALSYM EVP_aria_256_ccm} {introduced 1.1.0} + {$EXTERNALSYM EVP_camellia_128_ecb} + {$EXTERNALSYM EVP_camellia_128_cbc} + {$EXTERNALSYM EVP_camellia_128_cfb1} + {$EXTERNALSYM EVP_camellia_128_cfb8} + {$EXTERNALSYM EVP_camellia_128_cfb128} + {$EXTERNALSYM EVP_camellia_128_ofb} + {$EXTERNALSYM EVP_camellia_128_ctr} {introduced 1.1.0} + {$EXTERNALSYM EVP_camellia_192_ecb} + {$EXTERNALSYM EVP_camellia_192_cbc} + {$EXTERNALSYM EVP_camellia_192_cfb1} + {$EXTERNALSYM EVP_camellia_192_cfb8} + {$EXTERNALSYM EVP_camellia_192_cfb128} + {$EXTERNALSYM EVP_camellia_192_ofb} + {$EXTERNALSYM EVP_camellia_192_ctr} {introduced 1.1.0} + {$EXTERNALSYM EVP_camellia_256_ecb} + {$EXTERNALSYM EVP_camellia_256_cbc} + {$EXTERNALSYM EVP_camellia_256_cfb1} + {$EXTERNALSYM EVP_camellia_256_cfb8} + {$EXTERNALSYM EVP_camellia_256_cfb128} + {$EXTERNALSYM EVP_camellia_256_ofb} + {$EXTERNALSYM EVP_camellia_256_ctr} {introduced 1.1.0} + {$EXTERNALSYM EVP_chacha20} {introduced 1.1.0} + {$EXTERNALSYM EVP_chacha20_poly1305} {introduced 1.1.0} + {$EXTERNALSYM EVP_seed_ecb} + {$EXTERNALSYM EVP_seed_cbc} + {$EXTERNALSYM EVP_seed_cfb128} + {$EXTERNALSYM EVP_seed_ofb} + {$EXTERNALSYM EVP_sm4_ecb} {introduced 1.1.0} + {$EXTERNALSYM EVP_sm4_cbc} {introduced 1.1.0} + {$EXTERNALSYM EVP_sm4_cfb128} {introduced 1.1.0} + {$EXTERNALSYM EVP_sm4_ofb} {introduced 1.1.0} + {$EXTERNALSYM EVP_sm4_ctr} {introduced 1.1.0} + {$EXTERNALSYM EVP_add_cipher} + {$EXTERNALSYM EVP_add_digest} + {$EXTERNALSYM EVP_get_cipherbyname} + {$EXTERNALSYM EVP_get_digestbyname} + {$EXTERNALSYM EVP_CIPHER_do_all} + {$EXTERNALSYM EVP_CIPHER_do_all_sorted} + {$EXTERNALSYM EVP_MD_do_all} + {$EXTERNALSYM EVP_MD_do_all_sorted} + {$EXTERNALSYM EVP_PKEY_decrypt_old} + {$EXTERNALSYM EVP_PKEY_encrypt_old} + {$EXTERNALSYM EVP_PKEY_type} + {$EXTERNALSYM EVP_PKEY_set_type} + {$EXTERNALSYM EVP_PKEY_set_type_str} + {$EXTERNALSYM EVP_PKEY_set1_engine} {introduced 1.1.0} + {$EXTERNALSYM EVP_PKEY_get0_engine} {introduced 1.1.0} + {$EXTERNALSYM EVP_PKEY_assign} + {$EXTERNALSYM EVP_PKEY_get0} + {$EXTERNALSYM EVP_PKEY_get0_hmac} {introduced 1.1.0} + {$EXTERNALSYM EVP_PKEY_get0_poly1305} {introduced 1.1.0} + {$EXTERNALSYM EVP_PKEY_get0_siphash} {introduced 1.1.0} + {$EXTERNALSYM EVP_PKEY_set1_RSA} + {$EXTERNALSYM EVP_PKEY_get0_RSA} {introduced 1.1.0} + {$EXTERNALSYM EVP_PKEY_get1_RSA} + {$EXTERNALSYM EVP_PKEY_set1_DSA} + {$EXTERNALSYM EVP_PKEY_get0_DSA} {introduced 1.1.0} + {$EXTERNALSYM EVP_PKEY_get1_DSA} + {$EXTERNALSYM EVP_PKEY_set1_DH} + {$EXTERNALSYM EVP_PKEY_get0_DH} {introduced 1.1.0} + {$EXTERNALSYM EVP_PKEY_get1_DH} + {$EXTERNALSYM EVP_PKEY_set1_EC_KEY} + {$EXTERNALSYM EVP_PKEY_get0_EC_KEY} {introduced 1.1.0} + {$EXTERNALSYM EVP_PKEY_get1_EC_KEY} + {$EXTERNALSYM EVP_PKEY_new} + {$EXTERNALSYM EVP_PKEY_up_ref} {introduced 1.1.0} + {$EXTERNALSYM EVP_PKEY_free} + {$EXTERNALSYM d2i_PublicKey} + {$EXTERNALSYM i2d_PublicKey} + {$EXTERNALSYM d2i_PrivateKey} + {$EXTERNALSYM d2i_AutoPrivateKey} + {$EXTERNALSYM i2d_PrivateKey} + {$EXTERNALSYM EVP_PKEY_copy_parameters} + {$EXTERNALSYM EVP_PKEY_missing_parameters} + {$EXTERNALSYM EVP_PKEY_save_parameters} + {$EXTERNALSYM EVP_PKEY_cmp_parameters} + {$EXTERNALSYM EVP_PKEY_cmp} + {$EXTERNALSYM EVP_PKEY_print_public} + {$EXTERNALSYM EVP_PKEY_print_private} + {$EXTERNALSYM EVP_PKEY_print_params} + {$EXTERNALSYM EVP_PKEY_get_default_digest_nid} + {$EXTERNALSYM EVP_CIPHER_param_to_asn1} + {$EXTERNALSYM EVP_CIPHER_asn1_to_param} + {$EXTERNALSYM EVP_CIPHER_set_asn1_iv} + {$EXTERNALSYM EVP_CIPHER_get_asn1_iv} + {$EXTERNALSYM PKCS5_PBE_keyivgen} + {$EXTERNALSYM PKCS5_PBKDF2_HMAC_SHA1} + {$EXTERNALSYM PKCS5_PBKDF2_HMAC} + {$EXTERNALSYM PKCS5_v2_PBE_keyivgen} + {$EXTERNALSYM EVP_PBE_scrypt} {introduced 1.1.0} + {$EXTERNALSYM PKCS5_v2_scrypt_keyivgen} {introduced 1.1.0} + {$EXTERNALSYM PKCS5_PBE_add} + {$EXTERNALSYM EVP_PBE_CipherInit} + {$EXTERNALSYM EVP_PBE_alg_add_type} + {$EXTERNALSYM EVP_PBE_alg_add} + {$EXTERNALSYM EVP_PBE_find} + {$EXTERNALSYM EVP_PBE_cleanup} + {$EXTERNALSYM EVP_PBE_get} {introduced 1.1.0} + {$EXTERNALSYM EVP_PKEY_asn1_get_count} + {$EXTERNALSYM EVP_PKEY_asn1_get0} + {$EXTERNALSYM EVP_PKEY_asn1_find} + {$EXTERNALSYM EVP_PKEY_asn1_find_str} + {$EXTERNALSYM EVP_PKEY_asn1_add0} + {$EXTERNALSYM EVP_PKEY_asn1_add_alias} + {$EXTERNALSYM EVP_PKEY_asn1_get0_info} + {$EXTERNALSYM EVP_PKEY_get0_asn1} + {$EXTERNALSYM EVP_PKEY_asn1_new} + {$EXTERNALSYM EVP_PKEY_asn1_copy} + {$EXTERNALSYM EVP_PKEY_asn1_free} + {$EXTERNALSYM EVP_PKEY_asn1_set_public} + {$EXTERNALSYM EVP_PKEY_asn1_set_private} + {$EXTERNALSYM EVP_PKEY_asn1_set_param} + {$EXTERNALSYM EVP_PKEY_asn1_set_free} + {$EXTERNALSYM EVP_PKEY_asn1_set_ctrl} + {$EXTERNALSYM EVP_PKEY_asn1_set_item} + {$EXTERNALSYM EVP_PKEY_asn1_set_siginf} {introduced 1.1.0} + {$EXTERNALSYM EVP_PKEY_asn1_set_check} {introduced 1.1.0} + {$EXTERNALSYM EVP_PKEY_asn1_set_public_check} {introduced 1.1.0} + {$EXTERNALSYM EVP_PKEY_asn1_set_param_check} {introduced 1.1.0} + {$EXTERNALSYM EVP_PKEY_asn1_set_set_priv_key} {introduced 1.1.0} + {$EXTERNALSYM EVP_PKEY_asn1_set_set_pub_key} {introduced 1.1.0} + {$EXTERNALSYM EVP_PKEY_asn1_set_get_priv_key} {introduced 1.1.0} + {$EXTERNALSYM EVP_PKEY_asn1_set_get_pub_key} {introduced 1.1.0} + {$EXTERNALSYM EVP_PKEY_asn1_set_security_bits} {introduced 1.1.0} + {$EXTERNALSYM EVP_PKEY_meth_find} + {$EXTERNALSYM EVP_PKEY_meth_new} + {$EXTERNALSYM EVP_PKEY_meth_get0_info} + {$EXTERNALSYM EVP_PKEY_meth_copy} + {$EXTERNALSYM EVP_PKEY_meth_free} + {$EXTERNALSYM EVP_PKEY_meth_add0} + {$EXTERNALSYM EVP_PKEY_meth_remove} {introduced 1.1.0} + {$EXTERNALSYM EVP_PKEY_meth_get_count} {introduced 1.1.0} + {$EXTERNALSYM EVP_PKEY_meth_get0} {introduced 1.1.0} + {$EXTERNALSYM EVP_PKEY_CTX_new} + {$EXTERNALSYM EVP_PKEY_CTX_new_id} + {$EXTERNALSYM EVP_PKEY_CTX_dup} + {$EXTERNALSYM EVP_PKEY_CTX_free} + {$EXTERNALSYM EVP_PKEY_CTX_ctrl} + {$EXTERNALSYM EVP_PKEY_CTX_ctrl_str} + {$EXTERNALSYM EVP_PKEY_CTX_ctrl_uint64} {introduced 1.1.0} + {$EXTERNALSYM EVP_PKEY_CTX_str2ctrl} {introduced 1.1.0} + {$EXTERNALSYM EVP_PKEY_CTX_hex2ctrl} {introduced 1.1.0} + {$EXTERNALSYM EVP_PKEY_CTX_md} {introduced 1.1.0} + {$EXTERNALSYM EVP_PKEY_CTX_get_operation} + {$EXTERNALSYM EVP_PKEY_CTX_set0_keygen_info} + {$EXTERNALSYM EVP_PKEY_new_mac_key} + {$EXTERNALSYM EVP_PKEY_new_raw_private_key} {introduced 1.1.0} + {$EXTERNALSYM EVP_PKEY_new_raw_public_key} {introduced 1.1.0} + {$EXTERNALSYM EVP_PKEY_get_raw_private_key} {introduced 1.1.0} + {$EXTERNALSYM EVP_PKEY_get_raw_public_key} {introduced 1.1.0} + {$EXTERNALSYM EVP_PKEY_new_CMAC_key} {introduced 1.1.0} + {$EXTERNALSYM EVP_PKEY_CTX_set_data} + {$EXTERNALSYM EVP_PKEY_CTX_get_data} + {$EXTERNALSYM EVP_PKEY_CTX_get0_pkey} + {$EXTERNALSYM EVP_PKEY_CTX_get0_peerkey} + {$EXTERNALSYM EVP_PKEY_CTX_set_app_data} + {$EXTERNALSYM EVP_PKEY_CTX_get_app_data} + {$EXTERNALSYM EVP_PKEY_sign_init} + {$EXTERNALSYM EVP_PKEY_sign} + {$EXTERNALSYM EVP_PKEY_verify_init} + {$EXTERNALSYM EVP_PKEY_verify} + {$EXTERNALSYM EVP_PKEY_verify_recover_init} + {$EXTERNALSYM EVP_PKEY_verify_recover} + {$EXTERNALSYM EVP_PKEY_encrypt_init} + {$EXTERNALSYM EVP_PKEY_encrypt} + {$EXTERNALSYM EVP_PKEY_decrypt_init} + {$EXTERNALSYM EVP_PKEY_decrypt} + {$EXTERNALSYM EVP_PKEY_derive_init} + {$EXTERNALSYM EVP_PKEY_derive_set_peer} + {$EXTERNALSYM EVP_PKEY_derive} + {$EXTERNALSYM EVP_PKEY_paramgen_init} + {$EXTERNALSYM EVP_PKEY_paramgen} + {$EXTERNALSYM EVP_PKEY_keygen_init} + {$EXTERNALSYM EVP_PKEY_keygen} + {$EXTERNALSYM EVP_PKEY_check} {introduced 1.1.0} + {$EXTERNALSYM EVP_PKEY_public_check} {introduced 1.1.0} + {$EXTERNALSYM EVP_PKEY_param_check} {introduced 1.1.0} + {$EXTERNALSYM EVP_PKEY_CTX_set_cb} + {$EXTERNALSYM EVP_PKEY_CTX_get_cb} + {$EXTERNALSYM EVP_PKEY_CTX_get_keygen_info} + {$EXTERNALSYM EVP_PKEY_meth_set_init} + {$EXTERNALSYM EVP_PKEY_meth_set_copy} + {$EXTERNALSYM EVP_PKEY_meth_set_cleanup} + {$EXTERNALSYM EVP_PKEY_meth_set_paramgen} + {$EXTERNALSYM EVP_PKEY_meth_set_keygen} + {$EXTERNALSYM EVP_PKEY_meth_set_sign} + {$EXTERNALSYM EVP_PKEY_meth_set_verify} + {$EXTERNALSYM EVP_PKEY_meth_set_verify_recover} + {$EXTERNALSYM EVP_PKEY_meth_set_signctx} + {$EXTERNALSYM EVP_PKEY_meth_set_verifyctx} + {$EXTERNALSYM EVP_PKEY_meth_set_encrypt} + {$EXTERNALSYM EVP_PKEY_meth_set_decrypt} + {$EXTERNALSYM EVP_PKEY_meth_set_derive} + {$EXTERNALSYM EVP_PKEY_meth_set_ctrl} + {$EXTERNALSYM EVP_PKEY_meth_set_digestsign} {introduced 1.1.0} + {$EXTERNALSYM EVP_PKEY_meth_set_digestverify} {introduced 1.1.0} + {$EXTERNALSYM EVP_PKEY_meth_set_check} {introduced 1.1.0} + {$EXTERNALSYM EVP_PKEY_meth_set_public_check} {introduced 1.1.0} + {$EXTERNALSYM EVP_PKEY_meth_set_param_check} {introduced 1.1.0} + {$EXTERNALSYM EVP_PKEY_meth_set_digest_custom} {introduced 1.1.0} + {$EXTERNALSYM EVP_PKEY_meth_get_init} + {$EXTERNALSYM EVP_PKEY_meth_get_copy} + {$EXTERNALSYM EVP_PKEY_meth_get_cleanup} + {$EXTERNALSYM EVP_PKEY_meth_get_paramgen} + {$EXTERNALSYM EVP_PKEY_meth_get_keygen} + {$EXTERNALSYM EVP_PKEY_meth_get_sign} + {$EXTERNALSYM EVP_PKEY_meth_get_verify} + {$EXTERNALSYM EVP_PKEY_meth_get_verify_recover} + {$EXTERNALSYM EVP_PKEY_meth_get_signctx} + {$EXTERNALSYM EVP_PKEY_meth_get_verifyctx} + {$EXTERNALSYM EVP_PKEY_meth_get_encrypt} + {$EXTERNALSYM EVP_PKEY_meth_get_decrypt} + {$EXTERNALSYM EVP_PKEY_meth_get_derive} + {$EXTERNALSYM EVP_PKEY_meth_get_ctrl} + {$EXTERNALSYM EVP_PKEY_meth_get_digestsign} {introduced 1.1.0} + {$EXTERNALSYM EVP_PKEY_meth_get_digestverify} {introduced 1.1.0} + {$EXTERNALSYM EVP_PKEY_meth_get_check} {introduced 1.1.0} + {$EXTERNALSYM EVP_PKEY_meth_get_public_check} {introduced 1.1.0} + {$EXTERNALSYM EVP_PKEY_meth_get_param_check} {introduced 1.1.0} + {$EXTERNALSYM EVP_PKEY_meth_get_digest_custom} {introduced 1.1.0} + {$EXTERNALSYM EVP_add_alg_module} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +var + {$EXTERNALSYM EVP_PKEY_assign_RSA} {removed 1.0.0} + {$EXTERNALSYM EVP_PKEY_assign_DSA} {removed 1.0.0} + {$EXTERNALSYM EVP_PKEY_assign_DH} {removed 1.0.0} + {$EXTERNALSYM EVP_PKEY_assign_EC_KEY} {removed 1.0.0} + {$EXTERNALSYM EVP_PKEY_assign_SIPHASH} {removed 1.0.0} + {$EXTERNALSYM EVP_PKEY_assign_POLY1305} {removed 1.0.0} + {$EXTERNALSYM EVP_MD_type} {removed 3.0.0} + {$EXTERNALSYM EVP_MD_pkey_type} {removed 3.0.0} + {$EXTERNALSYM EVP_MD_size} {removed 3.0.0} + {$EXTERNALSYM EVP_MD_block_size} {removed 3.0.0} + {$EXTERNALSYM EVP_MD_flags} {removed 3.0.0} + {$EXTERNALSYM EVP_MD_CTX_pkey_ctx} {introduced 1.1.0 removed 3.0.0} + {$EXTERNALSYM EVP_MD_CTX_md_data} {introduced 1.1.0 removed 3.0.0} + {$EXTERNALSYM EVP_CIPHER_nid} {removed 3.0.0} + {$EXTERNALSYM EVP_CIPHER_block_size} {removed 3.0.0} + {$EXTERNALSYM EVP_CIPHER_key_length} {removed 3.0.0} + {$EXTERNALSYM EVP_CIPHER_iv_length} {removed 3.0.0} + {$EXTERNALSYM EVP_CIPHER_flags} {removed 3.0.0} + {$EXTERNALSYM EVP_CIPHER_CTX_encrypting} {introduced 1.1.0 removed 3.0.0} + {$EXTERNALSYM EVP_CIPHER_CTX_nid} {removed 3.0.0} + {$EXTERNALSYM EVP_CIPHER_CTX_block_size} {removed 3.0.0} + {$EXTERNALSYM EVP_CIPHER_CTX_key_length} {removed 3.0.0} + {$EXTERNALSYM EVP_CIPHER_CTX_iv_length} {removed 3.0.0} + {$EXTERNALSYM EVP_CIPHER_CTX_num} {introduced 1.1.0 removed 3.0.0} + {$EXTERNALSYM BIO_set_md} {removed 1.0.0} + {$EXTERNALSYM EVP_MD_CTX_init} {removed 1.1.0} + {$EXTERNALSYM EVP_MD_CTX_cleanup} {removed 1.1.0} + {$EXTERNALSYM EVP_md2} {removed 1.1.0 allow_nil} + {$EXTERNALSYM EVP_md4} {removed 1.1.0 allow_nil} + {$EXTERNALSYM EVP_md5} {removed 1.1.0 allow_nil} + {$EXTERNALSYM EVP_PKEY_id} {removed 3.0.0} + {$EXTERNALSYM EVP_PKEY_base_id} {removed 3.0.0} + {$EXTERNALSYM EVP_PKEY_bits} {removed 3.0.0} + {$EXTERNALSYM EVP_PKEY_security_bits} {introduced 1.1.0 removed 3.0.0} + {$EXTERNALSYM EVP_PKEY_size} {removed 3.0.0} + {$EXTERNALSYM EVP_PKEY_set_alias_type} {introduced 1.1.0 removed 3.0.0} + {$EXTERNALSYM EVP_PKEY_set1_tls_encodedpoint} {introduced 1.1.0 removed 3.0.0} + {$EXTERNALSYM EVP_PKEY_get1_tls_encodedpoint} {introduced 1.1.0 removed 3.0.0} + {$EXTERNALSYM EVP_CIPHER_type} {removed 3.0.0} + {$EXTERNALSYM OpenSSL_add_all_ciphers} {removed 1.1.0} + {$EXTERNALSYM OpenSSL_add_all_digests} {removed 1.1.0} + {$EXTERNALSYM EVP_cleanup} {removed 1.1.0} + EVP_PKEY_assign_RSA: function (pkey: PEVP_PKEY; rsa: Pointer): TIdC_INT; cdecl = nil; {removed 1.0.0} + EVP_PKEY_assign_DSA: function (pkey: PEVP_PKEY; dsa: Pointer): TIdC_INT; cdecl = nil; {removed 1.0.0} + EVP_PKEY_assign_DH: function (pkey: PEVP_PKEY; dh: Pointer): TIdC_INT; cdecl = nil; {removed 1.0.0} + EVP_PKEY_assign_EC_KEY: function (pkey: PEVP_PKEY; eckey: Pointer): TIdC_INT; cdecl = nil; {removed 1.0.0} + EVP_PKEY_assign_SIPHASH: function (pkey: PEVP_PKEY; shkey: Pointer): TIdC_INT; cdecl = nil; {removed 1.0.0} + EVP_PKEY_assign_POLY1305: function (pkey: PEVP_PKEY; polykey: Pointer): TIdC_INT; cdecl = nil; {removed 1.0.0} + + EVP_MD_meth_new: function (md_type: TIdC_INT; pkey_type: TIdC_INT): PEVP_MD; cdecl = nil; {introduced 1.1.0} + EVP_MD_meth_dup: function (const md: PEVP_MD): PEVP_MD; cdecl = nil; {introduced 1.1.0} + EVP_MD_meth_free: procedure (md: PEVP_MD); cdecl = nil; {introduced 1.1.0} + + EVP_MD_meth_set_input_blocksize: function (md: PEVP_MD; blocksize: TIdC_INT): TIdC_INT; cdecl = nil; {introduced 1.1.0} + EVP_MD_meth_set_result_size: function (md: PEVP_MD; resultsize: TIdC_INT): TIdC_INT; cdecl = nil; {introduced 1.1.0} + EVP_MD_meth_set_app_datasize: function (md: PEVP_MD; datasize: TIdC_INT): TIdC_INT; cdecl = nil; {introduced 1.1.0} + EVP_MD_meth_set_flags: function (md: PEVP_MD; flags: TIdC_ULONG): TIdC_INT; cdecl = nil; {introduced 1.1.0} + EVP_MD_meth_set_init: function (md: PEVP_MD; init: EVP_MD_meth_init): TIdC_INT; cdecl = nil; {introduced 1.1.0} + EVP_MD_meth_set_update: function (md: PEVP_MD; update: EVP_MD_meth_update): TIdC_INT; cdecl = nil; {introduced 1.1.0} + EVP_MD_meth_set_final: function (md: PEVP_MD; final_: EVP_MD_meth_final): TIdC_INT; cdecl = nil; {introduced 1.1.0} + EVP_MD_meth_set_copy: function (md: PEVP_MD; copy: EVP_MD_meth_copy): TIdC_INT; cdecl = nil; {introduced 1.1.0} + EVP_MD_meth_set_cleanup: function (md: PEVP_MD; cleanup: EVP_MD_meth_cleanup): TIdC_INT; cdecl = nil; {introduced 1.1.0} + EVP_MD_meth_set_ctrl: function (md: PEVP_MD; ctrl: EVP_MD_meth_ctrl): TIdC_INT; cdecl = nil; {introduced 1.1.0} + + EVP_MD_meth_get_input_blocksize: function (const md: PEVP_MD): TIdC_INT; cdecl = nil; {introduced 1.1.0} + EVP_MD_meth_get_result_size: function (const md: PEVP_MD): TIdC_INT; cdecl = nil; {introduced 1.1.0} + EVP_MD_meth_get_app_datasize: function (const md: PEVP_MD): TIdC_INT; cdecl = nil; {introduced 1.1.0} + EVP_MD_meth_get_flags: function (const md: PEVP_MD): TIdC_ULONG; cdecl = nil; {introduced 1.1.0} + EVP_MD_meth_get_init: function (const md: PEVP_MD): EVP_MD_meth_init; cdecl = nil; {introduced 1.1.0} + EVP_MD_meth_get_update: function (const md: PEVP_MD): EVP_MD_meth_update; cdecl = nil; {introduced 1.1.0} + EVP_MD_meth_get_final: function (const md: PEVP_MD): EVP_MD_meth_final; cdecl = nil; {introduced 1.1.0} + EVP_MD_meth_get_copy: function (const md: PEVP_MD): EVP_MD_meth_copy; cdecl = nil; {introduced 1.1.0} + EVP_MD_meth_get_cleanup: function (const md: PEVP_MD): EVP_MD_meth_cleanup; cdecl = nil; {introduced 1.1.0} + EVP_MD_meth_get_ctrl: function (const md: PEVP_MD): EVP_MD_meth_ctrl; cdecl = nil; {introduced 1.1.0} + + EVP_CIPHER_meth_new: function (cipher_type: TIdC_INT; block_size: TIdC_INT; key_len: TIdC_INT): PEVP_CIPHER; cdecl = nil; {introduced 1.1.0} + EVP_CIPHER_meth_dup: function (const cipher: PEVP_CIPHER): PEVP_CIPHER; cdecl = nil; {introduced 1.1.0} + EVP_CIPHER_meth_free: procedure (cipher: PEVP_CIPHER); cdecl = nil; {introduced 1.1.0} + + EVP_CIPHER_meth_set_iv_length: function (cipher: PEVP_CIPHER; iv_len: TIdC_INT): TIdC_INT; cdecl = nil; {introduced 1.1.0} + EVP_CIPHER_meth_set_flags: function (cipher: PEVP_CIPHER; flags: TIdC_ULONG): TIdC_INT; cdecl = nil; {introduced 1.1.0} + EVP_CIPHER_meth_set_impl_ctx_size: function (cipher: PEVP_CIPHER; ctx_size: TIdC_INT): TIdC_INT; cdecl = nil; {introduced 1.1.0} + EVP_CIPHER_meth_set_init: function (cipher: PEVP_CIPHER; init: EVP_CIPHER_meth_init): TIdC_INT; cdecl = nil; {introduced 1.1.0} + EVP_CIPHER_meth_set_do_cipher: function (cipher: PEVP_CIPHER; do_cipher: EVP_CIPHER_meth_do_cipher): TIdC_INT; cdecl = nil; {introduced 1.1.0} + EVP_CIPHER_meth_set_cleanup: function (cipher: PEVP_CIPHER; cleanup: EVP_CIPHER_meth_cleanup): TIdC_INT; cdecl = nil; {introduced 1.1.0} + EVP_CIPHER_meth_set_set_asn1_params: function (cipher: PEVP_CIPHER; set_asn1_parameters: EVP_CIPHER_meth_set_asn1_params): TIdC_INT; cdecl = nil; {introduced 1.1.0} + EVP_CIPHER_meth_set_get_asn1_params: function (cipher: PEVP_CIPHER; get_asn1_parameters: EVP_CIPHER_meth_get_asn1_params): TIdC_INT; cdecl = nil; {introduced 1.1.0} + EVP_CIPHER_meth_set_ctrl: function (cipher: PEVP_CIPHER; ctrl: EVP_CIPHER_meth_ctrl): TIdC_INT; cdecl = nil; {introduced 1.1.0} + EVP_CIPHER_meth_get_init: function (const cipher: PEVP_CIPHER): EVP_CIPHER_meth_init; cdecl = nil; {introduced 1.1.0} + EVP_CIPHER_meth_get_do_cipher: function (const cipher: PEVP_CIPHER): EVP_CIPHER_meth_do_cipher; cdecl = nil; {introduced 1.1.0} + EVP_CIPHER_meth_get_cleanup: function (const cipher: PEVP_CIPHER): EVP_CIPHER_meth_cleanup; cdecl = nil; {introduced 1.1.0} + EVP_CIPHER_meth_get_set_asn1_params: function (const cipher: PEVP_CIPHER): EVP_CIPHER_meth_set_asn1_params; cdecl = nil; {introduced 1.1.0} + EVP_CIPHER_meth_get_get_asn1_params: function (const cipher: PEVP_CIPHER): EVP_CIPHER_meth_get_asn1_params; cdecl = nil; {introduced 1.1.0} + EVP_CIPHER_meth_get_ctrl: function (const cipher: PEVP_CIPHER): EVP_CIPHER_meth_ctrl; cdecl = nil; {introduced 1.1.0} + + /// Add some extra combinations /// + //# define EVP_get_digestbynid(a) EVP_get_digestbyname(OBJ_nid2sn(a)); + //# define EVP_get_digestbyobj(a) EVP_get_digestbynid(OBJ_obj2nid(a)); + //# define EVP_get_cipherbynid(a) EVP_get_cipherbyname(OBJ_nid2sn(a)); + //# define EVP_get_cipherbyobj(a) EVP_get_cipherbynid(OBJ_obj2nid(a)); + + EVP_MD_type: function (const md: PEVP_MD): TIdC_INT; cdecl = nil; {removed 3.0.0} + //# define EVP_MD_nid(e) EVP_MD_type(e) + //# define EVP_MD_name(e) OBJ_nid2sn(EVP_MD_nid(e)) + EVP_MD_pkey_type: function (const md: PEVP_MD): TIdC_INT; cdecl = nil; {removed 3.0.0} + EVP_MD_size: function (const md: PEVP_MD): TIdC_INT; cdecl = nil; {removed 3.0.0} + EVP_MD_block_size: function (const md: PEVP_MD): TIdC_INT; cdecl = nil; {removed 3.0.0} + EVP_MD_flags: function (const md: PEVP_MD): PIdC_ULONG; cdecl = nil; {removed 3.0.0} + + EVP_MD_CTX_md: function (ctx: PEVP_MD_CTX): PEVP_MD; cdecl = nil; + EVP_MD_CTX_update_fn: function (ctx: PEVP_MD_CTX): EVP_MD_CTX_update; cdecl = nil; {introduced 1.1.0} + EVP_MD_CTX_set_update_fn: procedure (ctx: PEVP_MD_CTX; update: EVP_MD_CTX_update); cdecl = nil; {introduced 1.1.0} + // EVP_MD_CTX_size(e) EVP_MD_size(EVP_MD_CTX_md(e)) + // EVP_MD_CTX_block_size(e) EVP_MD_block_size(EVP_MD_CTX_md(e)) + // EVP_MD_CTX_type(e) EVP_MD_type(EVP_MD_CTX_md(e)) + EVP_MD_CTX_pkey_ctx: function (const ctx: PEVP_MD_CTX): PEVP_PKEY_CTX; cdecl = nil; {introduced 1.1.0 removed 3.0.0} + EVP_MD_CTX_set_pkey_ctx: procedure (ctx: PEVP_MD_CTX; pctx: PEVP_PKEY_CTX); cdecl = nil; {introduced 1.1.0} + EVP_MD_CTX_md_data: function (const ctx: PEVP_MD_CTX): Pointer; cdecl = nil; {introduced 1.1.0 removed 3.0.0} + + EVP_CIPHER_nid: function (const ctx: PEVP_MD_CTX): TIdC_INT; cdecl = nil; {removed 3.0.0} + //# define EVP_CIPHER_name(e) OBJ_nid2sn(EVP_CIPHER_nid(e)) + EVP_CIPHER_block_size: function (const cipher: PEVP_CIPHER): TIdC_INT; cdecl = nil; {removed 3.0.0} + EVP_CIPHER_impl_ctx_size: function (const cipher: PEVP_CIPHER): TIdC_INT; cdecl = nil; {introduced 1.1.0} + EVP_CIPHER_key_length: function (const cipher: PEVP_CIPHER): TIdC_INT; cdecl = nil; {removed 3.0.0} + EVP_CIPHER_iv_length: function (const cipher: PEVP_CIPHER): TIdC_INT; cdecl = nil; {removed 3.0.0} + EVP_CIPHER_flags: function (const cipher: PEVP_CIPHER): TIdC_ULONG; cdecl = nil; {removed 3.0.0} + //# define EVP_CIPHER_mode(e) (EVP_CIPHER_flags(e) & EVP_CIPH_MODE) + + EVP_CIPHER_CTX_cipher: function (const ctx: PEVP_CIPHER_CTX): PEVP_CIPHER; cdecl = nil; + EVP_CIPHER_CTX_encrypting: function (const ctx: PEVP_CIPHER_CTX): TIdC_INT; cdecl = nil; {introduced 1.1.0 removed 3.0.0} + EVP_CIPHER_CTX_nid: function (const ctx: PEVP_CIPHER_CTX): TIdC_INT; cdecl = nil; {removed 3.0.0} + EVP_CIPHER_CTX_block_size: function (const ctx: PEVP_CIPHER_CTX): TIdC_INT; cdecl = nil; {removed 3.0.0} + EVP_CIPHER_CTX_key_length: function (const ctx: PEVP_CIPHER_CTX): TIdC_INT; cdecl = nil; {removed 3.0.0} + EVP_CIPHER_CTX_iv_length: function (const ctx: PEVP_CIPHER_CTX): TIdC_INT; cdecl = nil; {removed 3.0.0} + EVP_CIPHER_CTX_iv: function (const ctx: PEVP_CIPHER_CTX): PByte; cdecl = nil; {introduced 1.1.0} + EVP_CIPHER_CTX_original_iv: function (const ctx: PEVP_CIPHER_CTX): PByte; cdecl = nil; {introduced 1.1.0} + EVP_CIPHER_CTX_iv_noconst: function (ctx: PEVP_CIPHER_CTX): PByte; cdecl = nil; {introduced 1.1.0} + EVP_CIPHER_CTX_buf_noconst: function (ctx: PEVP_CIPHER_CTX): PByte; cdecl = nil; {introduced 1.1.0} + EVP_CIPHER_CTX_num: function (const ctx: PEVP_CIPHER_CTX): TIdC_INT; cdecl = nil; {introduced 1.1.0 removed 3.0.0} + EVP_CIPHER_CTX_set_num: procedure (ctx: PEVP_CIPHER_CTX; num: TIdC_INT); cdecl = nil; {introduced 1.1.0} + EVP_CIPHER_CTX_copy: function (out_: PEVP_CIPHER_CTX; const in_: PEVP_CIPHER_CTX): TIdC_INT; cdecl = nil; + EVP_CIPHER_CTX_get_app_data: function (const ctx: PEVP_CIPHER_CTX): Pointer; cdecl = nil; + EVP_CIPHER_CTX_set_app_data: procedure (ctx: PEVP_CIPHER_CTX; data: Pointer); cdecl = nil; + EVP_CIPHER_CTX_get_cipher_data: function (const ctx: PEVP_CIPHER_CTX): Pointer; cdecl = nil; {introduced 1.1.0} + EVP_CIPHER_CTX_set_cipher_data: function (ctx: PEVP_CIPHER_CTX; cipher_data: Pointer): Pointer; cdecl = nil; {introduced 1.1.0} + + //# define EVP_CIPHER_CTX_type(c) EVP_CIPHER_type(EVP_CIPHER_CTX_cipher(c)) + //# if OPENSSL_API_COMPAT < 0x10100000L + //# define EVP_CIPHER_CTX_flags(c) EVP_CIPHER_flags(EVP_CIPHER_CTX_cipher(c)) + //# endif + //# define EVP_CIPHER_CTX_mode(c) EVP_CIPHER_mode(EVP_CIPHER_CTX_cipher(c)) + // + //# define EVP_ENCODE_LENGTH(l) ((((l)+2)/3*4)+((l)/48+1)*2+80) + //# define EVP_DECODE_LENGTH(l) (((l)+3)/4*3+80) + // + //# define EVP_SignInit_ex(a;b;c) EVP_DigestInit_ex(a;b;c) + //# define EVP_SignInit(a;b) EVP_DigestInit(a;b) + //# define EVP_SignUpdate(a;b;c) EVP_DigestUpdate(a;b;c) + //# define EVP_VerifyInit_ex(a;b;c) EVP_DigestInit_ex(a;b;c) + //# define EVP_VerifyInit(a;b) EVP_DigestInit(a;b) + //# define EVP_VerifyUpdate(a;b;c) EVP_DigestUpdate(a;b;c) + //# define EVP_OpenUpdate(a;b;c;d;e) EVP_DecryptUpdate(a;b;c;d;e) + //# define EVP_SealUpdate(a;b;c;d;e) EVP_EncryptUpdate(a;b;c;d;e) + //# define EVP_DigestSignUpdate(a;b;c) EVP_DigestUpdate(a;b;c) + //# define EVP_DigestVerifyUpdate(a;b;c) EVP_DigestUpdate(a;b;c) + + BIO_set_md: procedure (v1: PBIO; const md: PEVP_MD); cdecl = nil; {removed 1.0.0} + //# define BIO_get_md(b;mdp) BIO_ctrl(b;BIO_C_GET_MD;0;(PIdAnsiChar)(mdp)) + //# define BIO_get_md_ctx(b;mdcp) BIO_ctrl(b;BIO_C_GET_MD_CTX;0; (PIdAnsiChar)(mdcp)) + //# define BIO_set_md_ctx(b;mdcp) BIO_ctrl(b;BIO_C_SET_MD_CTX;0; (PIdAnsiChar)(mdcp)) + //# define BIO_get_cipher_status(b) BIO_ctrl(b;BIO_C_GET_CIPHER_STATUS;0;NULL) + //# define BIO_get_cipher_ctx(b;c_pp) BIO_ctrl(b;BIO_C_GET_CIPHER_CTX;0; (PIdAnsiChar)(c_pp)) + + //function EVP_Cipher(c: PEVP_CIPHER_CTX; out_: PByte; const in_: PByte; in1: TIdC_UINT): TIdC_INT; + + //# define EVP_add_cipher_alias(n;alias) OBJ_NAME_add((alias);OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS;(n)) + //# define EVP_add_digest_alias(n;alias) OBJ_NAME_add((alias);OBJ_NAME_TYPE_MD_METH|OBJ_NAME_ALIAS;(n)) + //# define EVP_delete_cipher_alias(alias) OBJ_NAME_remove(alias;OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS); + //# define EVP_delete_digest_alias(alias) OBJ_NAME_remove(alias;OBJ_NAME_TYPE_MD_METH|OBJ_NAME_ALIAS); + + //void EVP_MD_CTX_init(EVP_MD_CTX *ctx); + //int EVP_MD_CTX_cleanup(EVP_MD_CTX *ctx); + EVP_MD_CTX_init: procedure (ctx : PEVP_MD_CTX); cdecl = nil; {removed 1.1.0} + EVP_MD_CTX_cleanup: function (ctx : PEVP_MD_CTX): TIdC_INT; cdecl = nil; {removed 1.1.0} + + EVP_MD_CTX_ctrl: function (ctx: PEVP_MD_CTX; cmd: TIdC_INT; p1: TIdC_INT; p2: Pointer): TIdC_INT; cdecl = nil; {introduced 1.1.0} + EVP_MD_CTX_new: function : PEVP_MD_CTX; cdecl = nil; {introduced 1.1.0} + EVP_MD_CTX_reset: function (ctx: PEVP_MD_CTX): TIdC_INT; cdecl = nil; {introduced 1.1.0} + EVP_MD_CTX_free: procedure (ctx: PEVP_MD_CTX); cdecl = nil; {introduced 1.1.0} + //# define EVP_MD_CTX_create() EVP_MD_CTX_new() + //# define EVP_MD_CTX_init(ctx) EVP_MD_CTX_reset((ctx)) + //# define EVP_MD_CTX_destroy(ctx) EVP_MD_CTX_free((ctx)) + EVP_MD_CTX_copy_ex: function (out_: PEVP_MD_CTX; const in_: PEVP_MD_CTX): TIdC_INT; cdecl = nil; + EVP_MD_CTX_set_flags: procedure (ctx: PEVP_MD_CTX; flags: TIdC_INT); cdecl = nil; + EVP_MD_CTX_clear_flags: procedure (ctx: PEVP_MD_CTX; flags: TIdC_INT); cdecl = nil; + EVP_MD_CTX_test_flags: function (const ctx: PEVP_MD_CTX; flags: TIdC_INT): TIdC_INT; cdecl = nil; + EVP_DigestInit_ex: function (ctx: PEVP_MD_CTX; const type_: PEVP_MD; impl: PENGINE): TIdC_INT; cdecl = nil; + EVP_DigestUpdate: function (ctx: PEVP_MD_CTX; const d: Pointer; cnt: TIdC_SIZET): TIdC_INT; cdecl = nil; + EVP_DigestFinal_ex: function (ctx: PEVP_MD_CTX; md: PByte; var s: TIdC_UINT): TIdC_INT; cdecl = nil; + EVP_Digest: function (const data: Pointer; count: TIdC_SIZET; md: PByte; size: PIdC_UINT; const type_: PEVP_MD; impl: PENGINE): TIdC_INT; cdecl = nil; + + EVP_MD_CTX_copy: function (out_: PEVP_MD_CTX; const in_: PEVP_MD_CTX): TIdC_INT; cdecl = nil; + EVP_DigestInit: function (ctx: PEVP_MD_CTX; const type_: PEVP_MD): TIdC_INT; cdecl = nil; + EVP_DigestFinal: function (ctx: PEVP_MD_CTX; md: PByte; var s: TIdC_UINT): TIdC_INT; cdecl = nil; + EVP_DigestFinalXOF: function (ctx: PEVP_MD_CTX; md: PByte; len: TIdC_SIZET): TIdC_INT; cdecl = nil; {introduced 1.1.0} + + EVP_read_pw_string: function (buf: PIdAnsiChar; length: TIdC_INT; const prompt: PIdAnsiChar; verify: TIdC_INT): TIdC_INT; cdecl = nil; + EVP_read_pw_string_min: function (buf: PIdAnsiChar; minlen: TIdC_INT; maxlen: TIdC_INT; const prompt: PIdAnsiChar; verify: TIdC_INT): TIdC_INT; cdecl = nil; + EVP_set_pw_prompt: procedure (const prompt: PIdAnsiChar); cdecl = nil; + EVP_get_pw_prompt: function : PIdAnsiChar; cdecl = nil; + EVP_BytesToKey: function (const type_: PEVP_CIPHER; const md: PEVP_MD; const salt: PByte; const data: PByte; data1: TIdC_INT; count: TIdC_INT; key: PByte; iv: PByte): TIdC_INT; cdecl = nil; + + EVP_CIPHER_CTX_set_flags: procedure (ctx: PEVP_CIPHER_CTX; flags: TIdC_INT); cdecl = nil; + EVP_CIPHER_CTX_clear_flags: procedure (ctx: PEVP_CIPHER_CTX; flags: TIdC_INT); cdecl = nil; + EVP_CIPHER_CTX_test_flags: function (const ctx: PEVP_CIPHER_CTX; flags: TIdC_INT): TIdC_INT; cdecl = nil; + + EVP_EncryptInit: function (ctx: PEVP_CIPHER_CTX; const cipher: PEVP_CIPHER; const key: PByte; const iv: PByte): TIdC_INT; cdecl = nil; + EVP_EncryptInit_ex: function (ctx: PEVP_CIPHER_CTX; const cipher: PEVP_CIPHER; impl: PENGINE; const key: PByte; const iv: PByte): TIdC_INT; cdecl = nil; + EVP_EncryptUpdate: function (ctx: PEVP_CIPHER_CTX; out_: PByte; out1: PIdC_INT; const in_: PByte; in_1: TIdC_INT): TIdC_INT; cdecl = nil; + EVP_EncryptFinal_ex: function (ctx: PEVP_CIPHER_CTX; out_: PByte; out1: PIdC_INT): TIdC_INT; cdecl = nil; + EVP_EncryptFinal: function (ctx: PEVP_CIPHER_CTX; out_: PByte; out1: PIdC_INT): TIdC_INT; cdecl = nil; + + EVP_DecryptInit: function (ctx: PEVP_CIPHER_CTX; out_: PByte; out1: PidC_INT): TIdC_INT; cdecl = nil; + EVP_DecryptInit_ex: function (ctx: PEVP_CIPHER_CTX; const cipher: PEVP_CIPHER; impl: PENGINE; const key: PByte; const iv: PByte): TIdC_INT; cdecl = nil; + EVP_DecryptUpdate: function (ctx: PEVP_CIPHER_CTX; out_: PByte; out1: PIdC_INT; const in_: PByte; in_1: TIdC_INT): TIdC_INT; cdecl = nil; + EVP_DecryptFinal: function (ctx: PEVP_CIPHER_CTX; outm: PByte; out1: PIdC_INT): TIdC_INT; cdecl = nil; + EVP_DecryptFinal_ex: function (ctx: PEVP_MD_CTX; outm: PByte; out1: PIdC_INT): TIdC_INT; cdecl = nil; + + EVP_CipherInit: function (ctx: PEVP_CIPHER_CTX; const cipher: PEVP_CIPHER; const key: PByte; const iv: PByte; enc: TIdC_INT): TIdC_INT; cdecl = nil; + EVP_CipherInit_ex: function (ctx: PEVP_CIPHER_CTX; const cipher: PEVP_CIPHER; impl: PENGINE; const key: PByte; const iv: PByte; enc: TidC_INT): TIdC_INT; cdecl = nil; + EVP_CipherUpdate: function (ctx: PEVP_CIPHER_CTX; out_: PByte; out1: PIdC_INT; const in_: PByte; in1: TIdC_INT): TIdC_INT; cdecl = nil; + EVP_CipherFinal: function (ctx: PEVP_CIPHER_CTX; outm: PByte; out1: PIdC_INT): TIdC_INT; cdecl = nil; + EVP_CipherFinal_ex: function (ctx: PEVP_CIPHER_CTX; outm: PByte; out1: PIdC_INT): TIdC_INT; cdecl = nil; + + EVP_SignFinal: function (ctx: PEVP_CIPHER_CTX; md: PByte; s: PIdC_UINT; pkey: PEVP_PKEY): TIdC_INT; cdecl = nil; + + EVP_DigestSign: function (ctx: PEVP_CIPHER_CTX; sigret: PByte; siglen: PIdC_SIZET; const tbs: PByte; tbslen: TIdC_SIZET): TIdC_INT; cdecl = nil; {introduced 1.1.0} + + EVP_VerifyFinal: function (ctx: PEVP_MD_CTX; const sigbuf: PByte; siglen: TIdC_UINT; pkey: PEVP_PKEY): TIdC_INT; cdecl = nil; + + EVP_DigestVerify: function (ctx: PEVP_CIPHER_CTX; const sigret: PByte; siglen: TIdC_SIZET; const tbs: PByte; tbslen: TIdC_SIZET): TIdC_INT; cdecl = nil; {introduced 1.1.0} + + EVP_DigestSignInit: function (ctx: PEVP_MD_CTX; pctx: PPEVP_PKEY_CTX; const type_: PEVP_MD; e: PENGINE; pkey: PEVP_PKEY): TIdC_INT; cdecl = nil; + EVP_DigestSignFinal: function (ctx: PEVP_MD_CTX; sigret: PByte; siglen: PIdC_SIZET): TIdC_INT; cdecl = nil; + + EVP_DigestVerifyInit: function (ctx: PEVP_MD_CTX; ppctx: PPEVP_PKEY_CTX; const type_: PEVP_MD; e: PENGINE; pkey: PEVP_PKEY): TIdC_INT; cdecl = nil; + EVP_DigestVerifyFinal: function (ctx: PEVP_MD_CTX; const sig: PByte; siglen: TIdC_SIZET): TIdC_INT; cdecl = nil; + + EVP_OpenInit: function (ctx: PEVP_CIPHER_CTX; const type_: PEVP_CIPHER; const ek: PByte; ek1: TIdC_INT; const iv: PByte; priv: PEVP_PKEY): TIdC_INT; cdecl = nil; + EVP_OpenFinal: function (ctx: PEVP_CIPHER_CTX; out_: PByte; out1: PIdC_INT): TIdC_INT; cdecl = nil; + + EVP_SealInit: function (ctx: PEVP_CIPHER_CTX; const type_: EVP_CIPHER; ek: PPByte; ek1: PIdC_INT; iv: PByte; pubk: PPEVP_PKEY; npubk: TIdC_INT): TIdC_INT; cdecl = nil; + EVP_SealFinal: function (ctx: PEVP_CIPHER_CTX; out_: PByte; out1: PIdC_INT): TIdC_INT; cdecl = nil; + + EVP_ENCODE_CTX_new: function : PEVP_ENCODE_CTX; cdecl = nil; {introduced 1.1.0} + EVP_ENCODE_CTX_free: procedure (ctx: PEVP_ENCODE_CTX); cdecl = nil; {introduced 1.1.0} + EVP_ENCODE_CTX_copy: function (dctx: PEVP_ENCODE_CTX; sctx: PEVP_ENCODE_CTX): TIdC_INT; cdecl = nil; {introduced 1.1.0} + EVP_ENCODE_CTX_num: function (ctx: PEVP_ENCODE_CTX): TIdC_INT; cdecl = nil; {introduced 1.1.0} + EVP_EncodeInit: procedure (ctx: PEVP_ENCODE_CTX); cdecl = nil; + EVP_EncodeUpdate: function (ctx: PEVP_ENCODE_CTX; out_: PByte; out1: PIdC_INT; const in_: PByte; in1: TIdC_INT): TIdC_INT; cdecl = nil; + EVP_EncodeFinal: procedure (ctx: PEVP_ENCODE_CTX; out_: PByte; out1: PIdC_INT); cdecl = nil; + EVP_EncodeBlock: function (t: PByte; const f: PByte; n: TIdC_INT): TIdC_INT; cdecl = nil; + + EVP_DecodeInit: procedure (ctx: PEVP_ENCODE_CTX); cdecl = nil; + EVP_DecodeUpdate: function (ctx: PEVP_ENCODE_CTX; out_: PByte; out1: PIdC_INT; const in_: PByte; in1: TIdC_INT): TIdC_INT; cdecl = nil; + EVP_DecodeFinal: function (ctx: PEVP_ENCODE_CTX; out_: PByte; out1: PIdC_INT): TIdC_INT; cdecl = nil; + EVP_DecodeBlock: function (t: PByte; const f: PByte; n: TIdC_INT): TIdC_INT; cdecl = nil; + + EVP_CIPHER_CTX_new: function : PEVP_CIPHER_CTX; cdecl = nil; + EVP_CIPHER_CTX_reset: function (c: PEVP_CIPHER_CTX): TIdC_INT; cdecl = nil; {introduced 1.1.0} + EVP_CIPHER_CTX_free: procedure (c: PEVP_CIPHER_CTX); cdecl = nil; + EVP_CIPHER_CTX_set_key_length: function (x: PEVP_CIPHER_CTX; keylen: TIdC_INT): TIdC_INT; cdecl = nil; + EVP_CIPHER_CTX_set_padding: function (c: PEVP_CIPHER_CTX; pad: TIdC_INT): TIdC_INT; cdecl = nil; + EVP_CIPHER_CTX_ctrl: function (ctx: PEVP_CIPHER_CTX; type_: TIdC_INT; arg: TIdC_INT; ptr: Pointer): TIdC_INT; cdecl = nil; + EVP_CIPHER_CTX_rand_key: function (ctx: PEVP_CIPHER_CTX; key: PByte): TIdC_INT; cdecl = nil; + + BIO_f_md: function : PBIO_METHOD; cdecl = nil; + BIO_f_base64: function : PBIO_METHOD; cdecl = nil; + BIO_f_cipher: function : PBIO_METHOD; cdecl = nil; + BIO_f_reliable: function : PBIO_METHOD; cdecl = nil; + BIO_set_cipher: function (b: PBIO; c: PEVP_CIPHER; const k: PByte; const i: PByte; enc: TIdC_INT): TIdC_INT; cdecl = nil; + + EVP_md_null: function : PEVP_MD; cdecl = nil; + + EVP_md2: function : PEVP_MD; cdecl = nil; {removed 1.1.0 allow_nil} + EVP_md4: function : PEVP_MD; cdecl = nil; {removed 1.1.0 allow_nil} + EVP_md5: function : PEVP_MD; cdecl = nil; {removed 1.1.0 allow_nil} + EVP_md5_sha1: function : PEVP_MD; cdecl = nil; {introduced 1.1.0} + + EVP_sha1: function : PEVP_MD; cdecl = nil; + EVP_sha224: function : PEVP_MD; cdecl = nil; + EVP_sha256: function : PEVP_MD; cdecl = nil; + EVP_sha384: function : PEVP_MD; cdecl = nil; + EVP_sha512: function : PEVP_MD; cdecl = nil; + EVP_sha512_224: function : PEVP_MD; cdecl = nil; {introduced 1.1.0} + EVP_sha512_256: function : PEVP_MD; cdecl = nil; {introduced 1.1.0} + EVP_sha3_224: function : PEVP_MD; cdecl = nil; {introduced 1.1.0} + EVP_sha3_256: function : PEVP_MD; cdecl = nil; {introduced 1.1.0} + EVP_sha3_384: function : PEVP_MD; cdecl = nil; {introduced 1.1.0} + EVP_sha3_512: function : PEVP_MD; cdecl = nil; {introduced 1.1.0} + EVP_shake128: function : PEVP_MD; cdecl = nil; {introduced 1.1.0} + EVP_shake256: function : PEVP_MD; cdecl = nil; {introduced 1.1.0} + + (* does nothing :-) *) + EVP_enc_null: function : PEVP_CIPHER; cdecl = nil; + + EVP_des_ecb: function : PEVP_CIPHER; cdecl = nil; + EVP_des_ede: function : PEVP_CIPHER; cdecl = nil; + EVP_des_ede3: function : PEVP_CIPHER; cdecl = nil; + EVP_des_ede_ecb: function : PEVP_CIPHER; cdecl = nil; + EVP_des_ede3_ecb: function : PEVP_CIPHER; cdecl = nil; + EVP_des_cfb64: function : PEVP_CIPHER; cdecl = nil; + //EVP_des_cfb EVP_des_cfb64 + EVP_des_cfb1: function : PEVP_CIPHER; cdecl = nil; + EVP_des_cfb8: function : PEVP_CIPHER; cdecl = nil; + EVP_des_ede_cfb64: function : PEVP_CIPHER; cdecl = nil; + EVP_des_ede3_cfb64: function : PEVP_CIPHER; cdecl = nil; + //EVP_des_ede3_cfb EVP_des_ede3_cfb64 + EVP_des_ede3_cfb1: function : PEVP_CIPHER; cdecl = nil; + EVP_des_ede3_cfb8: function : PEVP_CIPHER; cdecl = nil; + EVP_des_ofb: function : PEVP_CIPHER; cdecl = nil; + EVP_des_ede_ofb: function : PEVP_CIPHER; cdecl = nil; + EVP_des_ede3_ofb: function : PEVP_CIPHER; cdecl = nil; + EVP_des_cbc: function : PEVP_CIPHER; cdecl = nil; + EVP_des_ede_cbc: function : PEVP_CIPHER; cdecl = nil; + EVP_des_ede3_cbc: function : PEVP_CIPHER; cdecl = nil; + EVP_desx_cbc: function : PEVP_CIPHER; cdecl = nil; + EVP_des_ede3_wrap: function : PEVP_CIPHER; cdecl = nil; + // + // This should now be supported through the dev_crypto ENGINE. But also, why + // are rc4 and md5 declarations made here inside a "NO_DES" precompiler + // branch? + // + EVP_rc4: function : PEVP_CIPHER; cdecl = nil; + EVP_rc4_40: function : PEVP_CIPHER; cdecl = nil; +// function EVP_idea_ecb: PEVP_CIPHER; +// function EVP_idea_cfb64: PEVP_CIPHER; + //EVP_idea_cfb EVP_idea_cfb64 +// function EVP_idea_ofb: PEVP_CIPHER; + // function EVP_idea_cbc: PEVP_CIPHER; + EVP_rc2_ecb: function : PEVP_CIPHER; cdecl = nil; + EVP_rc2_cbc: function : PEVP_CIPHER; cdecl = nil; + EVP_rc2_40_cbc: function : PEVP_CIPHER; cdecl = nil; + EVP_rc2_64_cbc: function : PEVP_CIPHER; cdecl = nil; + EVP_rc2_cfb64: function : PEVP_CIPHER; cdecl = nil; + //EVP_rc2_cfb EVP_rc2_cfb64 + EVP_rc2_ofb: function : PEVP_CIPHER; cdecl = nil; + EVP_bf_ecb: function : PEVP_CIPHER; cdecl = nil; + EVP_bf_cbc: function : PEVP_CIPHER; cdecl = nil; + EVP_bf_cfb64: function : PEVP_CIPHER; cdecl = nil; + //EVP_bf_cfb EVP_bf_cfb64 + EVP_bf_ofb: function : PEVP_CIPHER; cdecl = nil; + EVP_cast5_ecb: function : PEVP_CIPHER; cdecl = nil; + EVP_cast5_cbc: function : PEVP_CIPHER; cdecl = nil; + EVP_cast5_cfb64: function : PEVP_CIPHER; cdecl = nil; + //EVP_cast5_cfb EVP_cast5_cfb64 + EVP_cast5_ofb: function : PEVP_CIPHER; cdecl = nil; +// function EVP_rc5_32_12_16_cbc: PEVP_CIPHER; +// function EVP_rc5_32_12_16_ecb: PEVP_CIPHER; +// function EVP_rc5_32_12_16_cfb64: PEVP_CIPHER; + //EVP_rc5_32_12_16_cfb EVP_rc5_32_12_16_cfb64 +// function EVP_rc5_32_12_16_ofb: PEVP_CIPHER; + + EVP_aes_128_ecb: function : PEVP_CIPHER; cdecl = nil; + EVP_aes_128_cbc: function : PEVP_CIPHER; cdecl = nil; + EVP_aes_128_cfb1: function : PEVP_CIPHER; cdecl = nil; + EVP_aes_128_cfb8: function : PEVP_CIPHER; cdecl = nil; + EVP_aes_128_cfb128: function : PEVP_CIPHER; cdecl = nil; + //EVP_aes_128_cfb EVP_aes_128_cfb128 + EVP_aes_128_ofb: function : PEVP_CIPHER; cdecl = nil; + EVP_aes_128_ctr: function : PEVP_CIPHER; cdecl = nil; + EVP_aes_128_ccm: function : PEVP_CIPHER; cdecl = nil; + EVP_aes_128_gcm: function : PEVP_CIPHER; cdecl = nil; + EVP_aes_128_xts: function : PEVP_CIPHER; cdecl = nil; + EVP_aes_128_wrap: function : PEVP_CIPHER; cdecl = nil; + EVP_aes_128_wrap_pad: function : PEVP_CIPHER; cdecl = nil; {introduced 1.1.0} + EVP_aes_128_ocb: function : PEVP_CIPHER; cdecl = nil; {introduced 1.1.0} + EVP_aes_192_ecb: function : PEVP_CIPHER; cdecl = nil; + EVP_aes_192_cbc: function : PEVP_CIPHER; cdecl = nil; + EVP_aes_192_cfb1: function : PEVP_CIPHER; cdecl = nil; + EVP_aes_192_cfb8: function : PEVP_CIPHER; cdecl = nil; + EVP_aes_192_cfb128: function : PEVP_CIPHER; cdecl = nil; + //EVP_aes_192_cfb EVP_aes_192_cfb128 + EVP_aes_192_ofb: function : PEVP_CIPHER; cdecl = nil; + EVP_aes_192_ctr: function : PEVP_CIPHER; cdecl = nil; + EVP_aes_192_ccm: function : PEVP_CIPHER; cdecl = nil; + EVP_aes_192_gcm: function : PEVP_CIPHER; cdecl = nil; + EVP_aes_192_wrap: function : PEVP_CIPHER; cdecl = nil; + EVP_aes_192_wrap_pad: function : PEVP_CIPHER; cdecl = nil; {introduced 1.1.0} + EVP_aes_192_ocb: function : PEVP_CIPHER; cdecl = nil; {introduced 1.1.0} + EVP_aes_256_ecb: function : PEVP_CIPHER; cdecl = nil; + EVP_aes_256_cbc: function : PEVP_CIPHER; cdecl = nil; + EVP_aes_256_cfb1: function : PEVP_CIPHER; cdecl = nil; + EVP_aes_256_cfb8: function : PEVP_CIPHER; cdecl = nil; + EVP_aes_256_cfb128: function : PEVP_CIPHER; cdecl = nil; + //EVP_aes_256_cfb EVP_aes_256_cfb128 + EVP_aes_256_ofb: function : PEVP_CIPHER; cdecl = nil; + EVP_aes_256_ctr: function : PEVP_CIPHER; cdecl = nil; + EVP_aes_256_ccm: function : PEVP_CIPHER; cdecl = nil; + EVP_aes_256_gcm: function : PEVP_CIPHER; cdecl = nil; + EVP_aes_256_xts: function : PEVP_CIPHER; cdecl = nil; + EVP_aes_256_wrap: function : PEVP_CIPHER; cdecl = nil; + EVP_aes_256_wrap_pad: function : PEVP_CIPHER; cdecl = nil; {introduced 1.1.0} + EVP_aes_256_ocb: function : PEVP_CIPHER; cdecl = nil; {introduced 1.1.0} + EVP_aes_128_cbc_hmac_sha1: function : PEVP_CIPHER; cdecl = nil; + EVP_aes_256_cbc_hmac_sha1: function : PEVP_CIPHER; cdecl = nil; + EVP_aes_128_cbc_hmac_sha256: function : PEVP_CIPHER; cdecl = nil; + EVP_aes_256_cbc_hmac_sha256: function : PEVP_CIPHER; cdecl = nil; + + EVP_aria_128_ecb: function : PEVP_CIPHER; cdecl = nil; {introduced 1.1.0} + EVP_aria_128_cbc: function : PEVP_CIPHER; cdecl = nil; {introduced 1.1.0} + EVP_aria_128_cfb1: function : PEVP_CIPHER; cdecl = nil; {introduced 1.1.0} + EVP_aria_128_cfb8: function : PEVP_CIPHER; cdecl = nil; {introduced 1.1.0} + EVP_aria_128_cfb128: function : PEVP_CIPHER; cdecl = nil; {introduced 1.1.0} + EVP_aria_128_ctr: function : PEVP_CIPHER; cdecl = nil; {introduced 1.1.0} + EVP_aria_128_ofb: function : PEVP_CIPHER; cdecl = nil; {introduced 1.1.0} + EVP_aria_128_gcm: function : PEVP_CIPHER; cdecl = nil; {introduced 1.1.0} + EVP_aria_128_ccm: function : PEVP_CIPHER; cdecl = nil; {introduced 1.1.0} + EVP_aria_192_ecb: function : PEVP_CIPHER; cdecl = nil; {introduced 1.1.0} + EVP_aria_192_cbc: function : PEVP_CIPHER; cdecl = nil; {introduced 1.1.0} + EVP_aria_192_cfb1: function : PEVP_CIPHER; cdecl = nil; {introduced 1.1.0} + EVP_aria_192_cfb8: function : PEVP_CIPHER; cdecl = nil; {introduced 1.1.0} + EVP_aria_192_cfb128: function : PEVP_CIPHER; cdecl = nil; {introduced 1.1.0} + //EVP_aria_192_cfb EVP_aria_192_cfb128 + EVP_aria_192_ctr: function : PEVP_CIPHER; cdecl = nil; {introduced 1.1.0} + EVP_aria_192_ofb: function : PEVP_CIPHER; cdecl = nil; {introduced 1.1.0} + EVP_aria_192_gcm: function : PEVP_CIPHER; cdecl = nil; {introduced 1.1.0} + EVP_aria_192_ccm: function : PEVP_CIPHER; cdecl = nil; {introduced 1.1.0} + EVP_aria_256_ecb: function : PEVP_CIPHER; cdecl = nil; {introduced 1.1.0} + EVP_aria_256_cbc: function : PEVP_CIPHER; cdecl = nil; {introduced 1.1.0} + EVP_aria_256_cfb1: function : PEVP_CIPHER; cdecl = nil; {introduced 1.1.0} + EVP_aria_256_cfb8: function : PEVP_CIPHER; cdecl = nil; {introduced 1.1.0} + EVP_aria_256_cfb128: function : PEVP_CIPHER; cdecl = nil; {introduced 1.1.0} + //EVP_aria_256_cfb EVP_aria_256_cfb128 + EVP_aria_256_ctr: function : PEVP_CIPHER; cdecl = nil; {introduced 1.1.0} + EVP_aria_256_ofb: function : PEVP_CIPHER; cdecl = nil; {introduced 1.1.0} + EVP_aria_256_gcm: function : PEVP_CIPHER; cdecl = nil; {introduced 1.1.0} + EVP_aria_256_ccm: function : PEVP_CIPHER; cdecl = nil; {introduced 1.1.0} + + EVP_camellia_128_ecb: function : PEVP_CIPHER; cdecl = nil; + EVP_camellia_128_cbc: function : PEVP_CIPHER; cdecl = nil; + EVP_camellia_128_cfb1: function : PEVP_CIPHER; cdecl = nil; + EVP_camellia_128_cfb8: function : PEVP_CIPHER; cdecl = nil; + EVP_camellia_128_cfb128: function : PEVP_CIPHER; cdecl = nil; + //EVP_camellia_128_cfb EVP_camellia_128_cfb128 + EVP_camellia_128_ofb: function : PEVP_CIPHER; cdecl = nil; + EVP_camellia_128_ctr: function : PEVP_CIPHER; cdecl = nil; {introduced 1.1.0} + EVP_camellia_192_ecb: function : PEVP_CIPHER; cdecl = nil; + EVP_camellia_192_cbc: function : PEVP_CIPHER; cdecl = nil; + EVP_camellia_192_cfb1: function : PEVP_CIPHER; cdecl = nil; + EVP_camellia_192_cfb8: function : PEVP_CIPHER; cdecl = nil; + EVP_camellia_192_cfb128: function : PEVP_CIPHER; cdecl = nil; + //EVP_camellia_192_cfb EVP_camellia_192_cfb128 + EVP_camellia_192_ofb: function : PEVP_CIPHER; cdecl = nil; + EVP_camellia_192_ctr: function : PEVP_CIPHER; cdecl = nil; {introduced 1.1.0} + EVP_camellia_256_ecb: function : PEVP_CIPHER; cdecl = nil; + EVP_camellia_256_cbc: function : PEVP_CIPHER; cdecl = nil; + EVP_camellia_256_cfb1: function : PEVP_CIPHER; cdecl = nil; + EVP_camellia_256_cfb8: function : PEVP_CIPHER; cdecl = nil; + EVP_camellia_256_cfb128: function : PEVP_CIPHER; cdecl = nil; + //EVP_camellia_256_cfb EVP_camellia_256_cfb128 + EVP_camellia_256_ofb: function : PEVP_CIPHER; cdecl = nil; + EVP_camellia_256_ctr: function : PEVP_CIPHER; cdecl = nil; {introduced 1.1.0} + + EVP_chacha20: function : PEVP_CIPHER; cdecl = nil; {introduced 1.1.0} + EVP_chacha20_poly1305: function : PEVP_CIPHER; cdecl = nil; {introduced 1.1.0} + + EVP_seed_ecb: function : PEVP_CIPHER; cdecl = nil; + EVP_seed_cbc: function : PEVP_CIPHER; cdecl = nil; + EVP_seed_cfb128: function : PEVP_CIPHER; cdecl = nil; + //EVP_seed_cfb EVP_seed_cfb128 + EVP_seed_ofb: function : PEVP_CIPHER; cdecl = nil; + + EVP_sm4_ecb: function : PEVP_CIPHER; cdecl = nil; {introduced 1.1.0} + EVP_sm4_cbc: function : PEVP_CIPHER; cdecl = nil; {introduced 1.1.0} + EVP_sm4_cfb128: function : PEVP_CIPHER; cdecl = nil; {introduced 1.1.0} + //EVP_sm4_cfb EVP_sm4_cfb128 + EVP_sm4_ofb: function : PEVP_CIPHER; cdecl = nil; {introduced 1.1.0} + EVP_sm4_ctr: function : PEVP_CIPHER; cdecl = nil; {introduced 1.1.0} + + EVP_add_cipher: function (const cipher: PEVP_CIPHER): TIdC_INT; cdecl = nil; + EVP_add_digest: function (const digest: PEVP_MD): TIdC_INT; cdecl = nil; + + EVP_get_cipherbyname: function (const name: PIdAnsiChar): PEVP_CIPHER; cdecl = nil; + EVP_get_digestbyname: function (const name: PIdAnsiChar): PEVP_MD; cdecl = nil; + + EVP_CIPHER_do_all: procedure (AFn: fn; arg: Pointer); cdecl = nil; + EVP_CIPHER_do_all_sorted: procedure (AFn: fn; arg: Pointer); cdecl = nil; + + EVP_MD_do_all: procedure (AFn: fn; arg: Pointer); cdecl = nil; + EVP_MD_do_all_sorted: procedure (AFn: fn; arg: Pointer); cdecl = nil; + + EVP_PKEY_decrypt_old: function (dec_key: PByte; const enc_key: PByte; enc_key_len: TIdC_INT; private_key: PEVP_PKEY): TIdC_INT; cdecl = nil; + EVP_PKEY_encrypt_old: function (dec_key: PByte; const enc_key: PByte; key_len: TIdC_INT; pub_key: PEVP_PKEY): TIdC_INT; cdecl = nil; + EVP_PKEY_type: function (type_: TIdC_INT): TIdC_INT; cdecl = nil; + EVP_PKEY_id: function (const pkey: PEVP_PKEY): TIdC_INT; cdecl = nil; {removed 3.0.0} + EVP_PKEY_base_id: function (const pkey: PEVP_PKEY): TIdC_INT; cdecl = nil; {removed 3.0.0} + EVP_PKEY_bits: function (const pkey: PEVP_PKEY): TIdC_INT; cdecl = nil; {removed 3.0.0} + EVP_PKEY_security_bits: function (const pkey: PEVP_PKEY): TIdC_INT; cdecl = nil; {introduced 1.1.0 removed 3.0.0} + EVP_PKEY_size: function (const pkey: PEVP_PKEY): TIdC_INT; cdecl = nil; {removed 3.0.0} + EVP_PKEY_set_type: function (pkey: PEVP_PKEY): TIdC_INT; cdecl = nil; + EVP_PKEY_set_type_str: function (pkey: PEVP_PKEY; const str: PIdAnsiChar; len: TIdC_INT): TIdC_INT; cdecl = nil; + EVP_PKEY_set_alias_type: function (pkey: PEVP_PKEY; type_: TIdC_INT): TIdC_INT; cdecl = nil; {introduced 1.1.0 removed 3.0.0} + + EVP_PKEY_set1_engine: function (pkey: PEVP_PKEY; e: PENGINE): TIdC_INT; cdecl = nil; {introduced 1.1.0} + EVP_PKEY_get0_engine: function (const pkey: PEVP_PKEY): PENGINE; cdecl = nil; {introduced 1.1.0} + + EVP_PKEY_assign: function (pkey: PEVP_PKEY; type_: TIdC_INT; key: Pointer): TIdC_INT; cdecl = nil; + EVP_PKEY_get0: function (const pkey: PEVP_PKEY): Pointer; cdecl = nil; + EVP_PKEY_get0_hmac: function (const pkey: PEVP_PKEY; len: PIdC_SIZET): PByte; cdecl = nil; {introduced 1.1.0} + EVP_PKEY_get0_poly1305: function (const pkey: PEVP_PKEY; len: PIdC_SIZET): PByte; cdecl = nil; {introduced 1.1.0} + EVP_PKEY_get0_siphash: function (const pkey: PEVP_PKEY; len: PIdC_SIZET): PByte; cdecl = nil; {introduced 1.1.0} + + EVP_PKEY_set1_RSA: function (pkey: PEVP_PKEY; key: PRSA): TIdC_INT; cdecl = nil; + EVP_PKEY_get0_RSA: function (pkey: PEVP_PKEY): PRSA; cdecl = nil; {introduced 1.1.0} + EVP_PKEY_get1_RSA: function (pkey: PEVP_PKEY): PRSA; cdecl = nil; + + EVP_PKEY_set1_DSA: function (pkey: PEVP_PKEY; key: PDSA): TIdC_INT; cdecl = nil; + EVP_PKEY_get0_DSA: function (pkey: PEVP_PKEY): PDSA; cdecl = nil; {introduced 1.1.0} + EVP_PKEY_get1_DSA: function (pkey: PEVP_PKEY): PDSA; cdecl = nil; + + EVP_PKEY_set1_DH: function (pkey: PEVP_PKEY; key: PDH): TIdC_INT; cdecl = nil; + EVP_PKEY_get0_DH: function (pkey: PEVP_PKEY): PDH; cdecl = nil; {introduced 1.1.0} + EVP_PKEY_get1_DH: function (pkey: PEVP_PKEY): PDH; cdecl = nil; + + EVP_PKEY_set1_EC_KEY: function (pkey: PEVP_PKEY; key: PEC_KEY): TIdC_INT; cdecl = nil; + EVP_PKEY_get0_EC_KEY: function (pkey: PEVP_PKEY): PEC_KEY; cdecl = nil; {introduced 1.1.0} + EVP_PKEY_get1_EC_KEY: function (pkey: PEVP_PKEY): PEC_KEY; cdecl = nil; + + EVP_PKEY_new: function : PEVP_PKEY; cdecl = nil; + EVP_PKEY_up_ref: function (pkey: PEVP_PKEY): TIdC_INT; cdecl = nil; {introduced 1.1.0} + EVP_PKEY_free: procedure (pkey: PEVP_PKEY); cdecl = nil; + + d2i_PublicKey: function (type_: TIdC_INT; a: PPEVP_PKEY; const pp: PPByte; length: TIdC_LONG): PEVP_PKEY; cdecl = nil; + i2d_PublicKey: function (a: PEVP_PKEY; pp: PPByte): TIdC_INT; cdecl = nil; + + d2i_PrivateKey: function (type_: TIdC_INT; a: PEVP_PKEY; const pp: PPByte; length: TIdC_LONG): PEVP_PKEY; cdecl = nil; + d2i_AutoPrivateKey: function (a: PPEVP_PKEY; const pp: PPByte; length: TIdC_LONG): PEVP_PKEY; cdecl = nil; + i2d_PrivateKey: function (a: PEVP_PKEY; pp: PPByte): TIdC_INT; cdecl = nil; + + EVP_PKEY_copy_parameters: function (to_: PEVP_PKEY; const from: PEVP_PKEY): TIdC_INT; cdecl = nil; + EVP_PKEY_missing_parameters: function (const pkey: PEVP_PKEY): TIdC_INT; cdecl = nil; + EVP_PKEY_save_parameters: function (pkey: PEVP_PKEY; mode: TIdC_INT): TIdC_INT; cdecl = nil; + EVP_PKEY_cmp_parameters: function (const a: PEVP_PKEY; const b: PEVP_PKEY): TIdC_INT; cdecl = nil; + + EVP_PKEY_cmp: function (const a: PEVP_PKEY; const b: PEVP_PKEY): TIdC_INT; cdecl = nil; + + EVP_PKEY_print_public: function (out_: PBIO; const pkey: PEVP_PKEY; indent: TIdC_INT; pctx: PASN1_PCTX): TIdC_INT; cdecl = nil; + EVP_PKEY_print_private: function (out_: PBIO; const pkey: PEVP_PKEY; indent: TIdC_INT; pctx: PASN1_PCTX): TIdC_INT; cdecl = nil; + EVP_PKEY_print_params: function (out_: PBIO; const pkey: PEVP_PKEY; indent: TIdC_INT; pctx: PASN1_PCTX): TIdC_INT; cdecl = nil; + + EVP_PKEY_get_default_digest_nid: function (pkey: PEVP_PKEY; pnid: PIdC_INT): TIdC_INT; cdecl = nil; + + EVP_PKEY_set1_tls_encodedpoint: function (pkey: PEVP_PKEY; const pt: PByte; ptlen: TIdC_SIZET): TIdC_INT; cdecl = nil; {introduced 1.1.0 removed 3.0.0} + EVP_PKEY_get1_tls_encodedpoint: function (pkey: PEVP_PKEY; ppt: PPByte): TIdC_SIZET; cdecl = nil; {introduced 1.1.0 removed 3.0.0} + + EVP_CIPHER_type: function (const ctx: PEVP_CIPHER): TIdC_INT; cdecl = nil; {removed 3.0.0} + + (* calls methods *) + EVP_CIPHER_param_to_asn1: function (c: PEVP_CIPHER_CTX; type_: PASN1_TYPE): TIdC_INT; cdecl = nil; + EVP_CIPHER_asn1_to_param: function (c: PEVP_CIPHER_CTX; type_: PASN1_TYPE): TIdC_INT; cdecl = nil; + + (* These are used by EVP_CIPHER methods *) + EVP_CIPHER_set_asn1_iv: function (c: PEVP_CIPHER_CTX; type_: PASN1_TYPE): TIdC_INT; cdecl = nil; + EVP_CIPHER_get_asn1_iv: function (c: PEVP_CIPHER_CTX; type_: PASN1_TYPE): TIdC_INT; cdecl = nil; + + (* PKCS5 password based encryption *) + PKCS5_PBE_keyivgen: function (ctx: PEVP_CIPHER_CTX; const pass: PIdAnsiChar; passlen: TIdC_INT; param: PASN1_TYPE; const cipher: PEVP_CIPHER; const md: PEVP_MD; en_de: TIdC_INT): TIdC_INT; cdecl = nil; + PKCS5_PBKDF2_HMAC_SHA1: function (const pass: PIdAnsiChar; passlen: TIdC_INT; const salt: PByte; saltlen: TIdC_INT; iter: TIdC_INT; keylen: TIdC_INT; out_: PByte): TIdC_INT; cdecl = nil; + PKCS5_PBKDF2_HMAC: function (const pass: PIdAnsiChar; passlen: TIdC_INT; const salt: PByte; saltlen: TIdC_INT; iter: TIdC_INT; const digest: PEVP_MD; keylen: TIdC_INT; out_: PByte): TIdC_INT; cdecl = nil; + PKCS5_v2_PBE_keyivgen: function (ctx: PEVP_CIPHER_CTX; const pass: PIdAnsiChar; passlen: TIdC_INT; param: PASN1_TYPE; const cipher: PEVP_CIPHER; const md: PEVP_MD; en_de: TIdC_INT): TIdC_INT; cdecl = nil; + + EVP_PBE_scrypt: function (const pass: PIdAnsiChar; passlen: TIdC_SIZET; const salt: PByte; saltlen: TIdC_SIZET; N: TIdC_UINT64; r: TIdC_UINT64; p: TIdC_UINT64; maxmem: TIdC_UINT64; key: PByte; keylen: TIdC_SIZET): TIdC_INT; cdecl = nil; {introduced 1.1.0} + + PKCS5_v2_scrypt_keyivgen: function (ctx: PEVP_CIPHER_CTX; const pass: PIdAnsiChar; passlen: TIdC_INT; param: PASN1_TYPE; const c: PEVP_CIPHER; const md: PEVP_MD; en_de: TIdC_INT): TIdC_INT; cdecl = nil; {introduced 1.1.0} + + PKCS5_PBE_add: procedure ; cdecl = nil; + + EVP_PBE_CipherInit: function (pbe_obj: PASN1_OBJECT; const pass: PIdAnsiChar; passlen: TIdC_INT; param: PASN1_TYPE; ctx: PEVP_CIPHER_CTX; en_de: TIdC_INT): TIdC_INT; cdecl = nil; + + (* PBE type *) + EVP_PBE_alg_add_type: function (pbe_type: TIdC_INT; pbe_nid: TIdC_INT; cipher_nid: TIdC_INT; md_nid: TIdC_INT; keygen: PEVP_PBE_KEYGEN): TIdC_INT; cdecl = nil; + EVP_PBE_alg_add: function (nid: TIdC_INT; const cipher: PEVP_CIPHER; const md: PEVP_MD; keygen: PEVP_PBE_KEYGEN): TIdC_INT; cdecl = nil; + EVP_PBE_find: function (type_: TIdC_INT; pbe_nid: TIdC_INT; pcnid: PIdC_INT; pmnid: PIdC_INT; pkeygen: PPEVP_PBE_KEYGEN): TIdC_INT; cdecl = nil; + EVP_PBE_cleanup: procedure ; cdecl = nil; + EVP_PBE_get: function (ptype: PIdC_INT; ppbe_nid: PIdC_INT; num: TIdC_SIZET): TIdC_INT; cdecl = nil; {introduced 1.1.0} + + EVP_PKEY_asn1_get_count: function : TIdC_INT; cdecl = nil; + EVP_PKEY_asn1_get0: function (idx: TIdC_INT): PEVP_PKEY_ASN1_METHOD; cdecl = nil; + EVP_PKEY_asn1_find: function (pe: PPENGINE; type_: TIdC_INT): PEVP_PKEY_ASN1_METHOD; cdecl = nil; + EVP_PKEY_asn1_find_str: function (pe: PPENGINE; const str: PIdAnsiChar; len: TIdC_INT): PEVP_PKEY_ASN1_METHOD; cdecl = nil; + EVP_PKEY_asn1_add0: function (const ameth: PEVP_PKEY_ASN1_METHOD): TIdC_INT; cdecl = nil; + EVP_PKEY_asn1_add_alias: function (to_: TIdC_INT; from: TIdC_INT): TIdC_INT; cdecl = nil; + EVP_PKEY_asn1_get0_info: function (ppkey_id: PIdC_INT; pkey_base_id: PIdC_INT; ppkey_flags: PIdC_INT; const pinfo: PPIdAnsiChar; const ppem_str: PPIdAnsiChar; const ameth: PEVP_PKEY_ASN1_METHOD): TIdC_INT; cdecl = nil; + + EVP_PKEY_get0_asn1: function (const pkey: PEVP_PKEY): PEVP_PKEY_ASN1_METHOD; cdecl = nil; + EVP_PKEY_asn1_new: function (id: TIdC_INT; flags: TIdC_INT; const pem_str: PIdAnsiChar; const info: PIdAnsiChar): PEVP_PKEY_ASN1_METHOD; cdecl = nil; + EVP_PKEY_asn1_copy: procedure (dst: PEVP_PKEY_ASN1_METHOD; const src: PEVP_PKEY_ASN1_METHOD); cdecl = nil; + EVP_PKEY_asn1_free: procedure (ameth: PEVP_PKEY_ASN1_METHOD); cdecl = nil; + + EVP_PKEY_asn1_set_public: procedure (ameth: PEVP_PKEY_ASN1_METHOD; APub_decode: pub_decode; APub_encode: pub_encode; APub_cmd: pub_cmd; APub_print: pub_print; APkey_size: pkey_size; APkey_bits: pkey_bits); cdecl = nil; + EVP_PKEY_asn1_set_private: procedure (ameth: PEVP_PKEY_ASN1_METHOD; APriv_decode: priv_decode; APriv_encode: priv_encode; APriv_print: priv_print); cdecl = nil; + EVP_PKEY_asn1_set_param: procedure (ameth: PEVP_PKEY_ASN1_METHOD; AParam_decode: param_decode; AParam_encode: param_encode; AParam_missing: param_missing; AParam_copy: param_copy; AParam_cmp: param_cmp; AParam_print: param_print); cdecl = nil; + + EVP_PKEY_asn1_set_free: procedure (ameth: PEVP_PKEY_ASN1_METHOD; APkey_free: pkey_free); cdecl = nil; + EVP_PKEY_asn1_set_ctrl: procedure (ameth: PEVP_PKEY_ASN1_METHOD; APkey_ctrl: pkey_ctrl); cdecl = nil; + EVP_PKEY_asn1_set_item: procedure (ameth: PEVP_PKEY_ASN1_METHOD; AItem_verify: item_verify; AItem_sign: item_sign); cdecl = nil; + + EVP_PKEY_asn1_set_siginf: procedure (ameth: PEVP_PKEY_ASN1_METHOD; ASiginf_set: siginf_set); cdecl = nil; {introduced 1.1.0} + + EVP_PKEY_asn1_set_check: procedure (ameth: PEVP_PKEY_ASN1_METHOD; APkey_check: pkey_check); cdecl = nil; {introduced 1.1.0} + + EVP_PKEY_asn1_set_public_check: procedure (ameth: PEVP_PKEY_ASN1_METHOD; APkey_pub_check: pkey_pub_check); cdecl = nil; {introduced 1.1.0} + + EVP_PKEY_asn1_set_param_check: procedure (ameth: PEVP_PKEY_ASN1_METHOD; APkey_param_check: pkey_param_check); cdecl = nil; {introduced 1.1.0} + + EVP_PKEY_asn1_set_set_priv_key: procedure (ameth: PEVP_PKEY_ASN1_METHOD; ASet_priv_key: set_priv_key); cdecl = nil; {introduced 1.1.0} + EVP_PKEY_asn1_set_set_pub_key: procedure (ameth: PEVP_PKEY_ASN1_METHOD; ASet_pub_key: set_pub_key); cdecl = nil; {introduced 1.1.0} + EVP_PKEY_asn1_set_get_priv_key: procedure (ameth: PEVP_PKEY_ASN1_METHOD; AGet_priv_key: get_priv_key); cdecl = nil; {introduced 1.1.0} + EVP_PKEY_asn1_set_get_pub_key: procedure (ameth: PEVP_PKEY_ASN1_METHOD; AGet_pub_key: get_pub_key); cdecl = nil; {introduced 1.1.0} + + EVP_PKEY_asn1_set_security_bits: procedure (ameth: PEVP_PKEY_ASN1_METHOD; APkey_security_bits: pkey_security_bits); cdecl = nil; {introduced 1.1.0} + + EVP_PKEY_meth_find: function (type_: TIdC_INT): PEVP_PKEY_METHOD; cdecl = nil; + EVP_PKEY_meth_new: function (id: TIdC_INT; flags: TIdC_INT): PEVP_PKEY_METHOD; cdecl = nil; + EVP_PKEY_meth_get0_info: procedure (ppkey_id: PIdC_INT; pflags: PIdC_INT; const meth: PEVP_PKEY_METHOD); cdecl = nil; + EVP_PKEY_meth_copy: procedure (dst: PEVP_PKEY_METHOD; const src: PEVP_PKEY_METHOD); cdecl = nil; + EVP_PKEY_meth_free: procedure (pmeth: PEVP_PKEY_METHOD); cdecl = nil; + EVP_PKEY_meth_add0: function (const pmeth: PEVP_PKEY_METHOD): TIdC_INT; cdecl = nil; + EVP_PKEY_meth_remove: function (const pmeth: PEVP_PKEY_METHOD): TIdC_INT; cdecl = nil; {introduced 1.1.0} + EVP_PKEY_meth_get_count: function : TIdC_SIZET; cdecl = nil; {introduced 1.1.0} + EVP_PKEY_meth_get0: function (idx: TIdC_SIZET): PEVP_PKEY_METHOD; cdecl = nil; {introduced 1.1.0} + + EVP_PKEY_CTX_new: function (pkey: PEVP_PKEY; e: PENGINE): PEVP_PKEY_CTX; cdecl = nil; + EVP_PKEY_CTX_new_id: function (id: TIdC_INT; e: PENGINE): PEVP_PKEY_CTX; cdecl = nil; + EVP_PKEY_CTX_dup: function (ctx: PEVP_PKEY_CTX): PEVP_PKEY_CTX; cdecl = nil; + EVP_PKEY_CTX_free: procedure (ctx: PEVP_PKEY_CTX); cdecl = nil; + + EVP_PKEY_CTX_ctrl: function (ctx: PEVP_PKEY_CTX; keytype: TIdC_INT; optype: TIdC_INT; cmd: TIdC_INT; p1: TIdC_INT; p2: Pointer): TIdC_INT; cdecl = nil; + EVP_PKEY_CTX_ctrl_str: function (ctx: PEVP_PKEY_CTX; const type_: PIdAnsiChar; const value: PIdAnsiChar): TIdC_INT; cdecl = nil; + EVP_PKEY_CTX_ctrl_uint64: function (ctx: PEVP_PKEY_CTX; keytype: TIdC_INT; optype: TIdC_INT; cmd: TIdC_INT; value: TIdC_UINT64): TIdC_INT; cdecl = nil; {introduced 1.1.0} + + EVP_PKEY_CTX_str2ctrl: function (ctx: PEVP_PKEY_CTX; cmd: TIdC_INT; const str: PIdAnsiChar): TIdC_INT; cdecl = nil; {introduced 1.1.0} + EVP_PKEY_CTX_hex2ctrl: function (ctx: PEVP_PKEY_CTX; cmd: TIdC_INT; const hex: PIdAnsiChar): TIdC_INT; cdecl = nil; {introduced 1.1.0} + + EVP_PKEY_CTX_md: function (ctx: PEVP_PKEY_CTX; optype: TIdC_INT; cmd: TIdC_INT; const md: PIdAnsiChar): TIdC_INT; cdecl = nil; {introduced 1.1.0} + + EVP_PKEY_CTX_get_operation: function (ctx: PEVP_PKEY_CTX): TIdC_INT; cdecl = nil; + EVP_PKEY_CTX_set0_keygen_info: procedure (ctx: PEVP_PKEY_CTX; dat: PIdC_INT; datlen: TIdC_INT); cdecl = nil; + + EVP_PKEY_new_mac_key: function (type_: TIdC_INT; e: PENGINE; const key: PByte; keylen: TIdC_INT): PEVP_PKEY; cdecl = nil; + EVP_PKEY_new_raw_private_key: function (type_: TIdC_INT; e: PENGINE; const priv: PByte; len: TIdC_SIZET): PEVP_PKEY; cdecl = nil; {introduced 1.1.0} + EVP_PKEY_new_raw_public_key: function (type_: TIdC_INT; e: PENGINE; const pub: PByte; len: TIdC_SIZET): PEVP_PKEY; cdecl = nil; {introduced 1.1.0} + EVP_PKEY_get_raw_private_key: function (const pkey: PEVP_PKEY; priv: PByte; len: PIdC_SIZET): TIdC_INT; cdecl = nil; {introduced 1.1.0} + EVP_PKEY_get_raw_public_key: function (const pkey: PEVP_PKEY; pub: PByte; len: PIdC_SIZET): TIdC_INT; cdecl = nil; {introduced 1.1.0} + + EVP_PKEY_new_CMAC_key: function (e: PENGINE; const priv: PByte; len: TIdC_SIZET; const cipher: PEVP_CIPHER): PEVP_PKEY; cdecl = nil; {introduced 1.1.0} + + EVP_PKEY_CTX_set_data: procedure (ctx: PEVP_PKEY_CTX; data: Pointer); cdecl = nil; + EVP_PKEY_CTX_get_data: function (ctx: PEVP_PKEY_CTX): Pointer; cdecl = nil; + EVP_PKEY_CTX_get0_pkey: function (ctx: PEVP_PKEY_CTX): PEVP_PKEY; cdecl = nil; + + EVP_PKEY_CTX_get0_peerkey: function (ctx: PEVP_PKEY_CTX): PEVP_PKEY; cdecl = nil; + + EVP_PKEY_CTX_set_app_data: procedure (ctx: PEVP_PKEY_CTX; data: Pointer); cdecl = nil; + EVP_PKEY_CTX_get_app_data: function (ctx: PEVP_PKEY_CTX): Pointer; cdecl = nil; + + EVP_PKEY_sign_init: function (ctx: PEVP_PKEY_CTX): TIdC_INT; cdecl = nil; + EVP_PKEY_sign: function (ctx: PEVP_PKEY_CTX; sig: PByte; siglen: PIdC_SIZET; const tbs: PByte; tbslen: TIdC_SIZET): TIdC_INT; cdecl = nil; + EVP_PKEY_verify_init: function (ctx: PEVP_PKEY_CTX): TIdC_INT; cdecl = nil; + EVP_PKEY_verify: function (ctx: PEVP_PKEY_CTX; const sig: PByte; siglen: TIdC_SIZET; const tbs: PByte; tbslen: TIdC_SIZET): TIdC_INT; cdecl = nil; + EVP_PKEY_verify_recover_init: function (ctx: PEVP_PKEY_CTX): TIdC_INT; cdecl = nil; + EVP_PKEY_verify_recover: function (ctx: PEVP_PKEY_CTX; rout: PByte; routlen: PIdC_SIZET; const sig: PByte; siglen: TIdC_SIZET): TIdC_INT; cdecl = nil; + EVP_PKEY_encrypt_init: function (ctx: PEVP_PKEY_CTX): TIdC_INT; cdecl = nil; + EVP_PKEY_encrypt: function (ctx: PEVP_PKEY_CTX; out_: PByte; outlen: PIdC_SIZET; const in_: PByte; inlen: TIdC_SIZET): TIdC_INT; cdecl = nil; + EVP_PKEY_decrypt_init: function (ctx: PEVP_PKEY_CTX): TIdC_INT; cdecl = nil; + EVP_PKEY_decrypt: function (ctx: PEVP_PKEY_CTX; out_: PByte; outlen: PIdC_SIZET; const in_: PByte; inlen: TIdC_SIZET): TIdC_INT; cdecl = nil; + + EVP_PKEY_derive_init: function (ctx: PEVP_PKEY_CTX): TIdC_INT; cdecl = nil; + EVP_PKEY_derive_set_peer: function (ctx: PEVP_PKEY_CTX; peer: PEVP_PKEY): TIdC_INT; cdecl = nil; + EVP_PKEY_derive: function (ctx: PEVP_PKEY_CTX; key: PByte; keylen: PIdC_SIZET): TIdC_INT; cdecl = nil; + + EVP_PKEY_paramgen_init: function (ctx: PEVP_PKEY_CTX): TIdC_INT; cdecl = nil; + EVP_PKEY_paramgen: function (ctx: PEVP_PKEY_CTX; ppkey: PPEVP_PKEY): TIdC_INT; cdecl = nil; + EVP_PKEY_keygen_init: function (ctx: PEVP_PKEY_CTX): TIdC_INT; cdecl = nil; + EVP_PKEY_keygen: function (ctx: PEVP_PKEY_CTX; ppkey: PPEVP_PKEY): TIdC_INT; cdecl = nil; + EVP_PKEY_check: function (ctx: PEVP_PKEY_CTX): TIdC_INT; cdecl = nil; {introduced 1.1.0} + EVP_PKEY_public_check: function (ctx: PEVP_PKEY_CTX): TIdC_INT; cdecl = nil; {introduced 1.1.0} + EVP_PKEY_param_check: function (ctx: PEVP_PKEY_CTX): TIdC_INT; cdecl = nil; {introduced 1.1.0} + + EVP_PKEY_CTX_set_cb: procedure (ctx: PEVP_PKEY_CTX; cb: EVP_PKEY_gen_cb); cdecl = nil; + EVP_PKEY_CTX_get_cb: function (ctx: PEVP_PKEY_CTX): EVP_PKEY_gen_cb; cdecl = nil; + + EVP_PKEY_CTX_get_keygen_info: function (ctx: PEVP_PKEY_CTX; idx: TIdC_INT): TIdC_INT; cdecl = nil; + + EVP_PKEY_meth_set_init: procedure (pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_init: EVP_PKEY_meth_init); cdecl = nil; + + EVP_PKEY_meth_set_copy: procedure (pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_copy_cb: EVP_PKEY_meth_copy_cb); cdecl = nil; + + EVP_PKEY_meth_set_cleanup: procedure (pmeth: PEVP_PKEY_METHOD; PEVP_PKEY_meth_cleanup: EVP_PKEY_meth_cleanup); cdecl = nil; + + EVP_PKEY_meth_set_paramgen: procedure (pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_paramgen_init: EVP_PKEY_meth_paramgen_init; AEVP_PKEY_meth_paramgen: EVP_PKEY_meth_paramgen_init); cdecl = nil; + + EVP_PKEY_meth_set_keygen: procedure (pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_keygen_init: EVP_PKEY_meth_keygen_init; AEVP_PKEY_meth_keygen: EVP_PKEY_meth_keygen); cdecl = nil; + + EVP_PKEY_meth_set_sign: procedure (pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_sign_init: EVP_PKEY_meth_sign_init; AEVP_PKEY_meth_sign: EVP_PKEY_meth_sign); cdecl = nil; + + EVP_PKEY_meth_set_verify: procedure (pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_verify_init: EVP_PKEY_meth_verify_init; AEVP_PKEY_meth_verify: EVP_PKEY_meth_verify_init); cdecl = nil; + + EVP_PKEY_meth_set_verify_recover: procedure (pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_verify_recover_init: EVP_PKEY_meth_verify_recover_init; AEVP_PKEY_meth_verify_recover: EVP_PKEY_meth_verify_recover_init); cdecl = nil; + + EVP_PKEY_meth_set_signctx: procedure (pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_signctx_init: EVP_PKEY_meth_signctx_init; AEVP_PKEY_meth_signctx: EVP_PKEY_meth_signctx); cdecl = nil; + + EVP_PKEY_meth_set_verifyctx: procedure (pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_verifyctx_init: EVP_PKEY_meth_verifyctx_init; AEVP_PKEY_meth_verifyctx: EVP_PKEY_meth_verifyctx); cdecl = nil; + + EVP_PKEY_meth_set_encrypt: procedure (pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_encrypt_init: EVP_PKEY_meth_encrypt_init; AEVP_PKEY_meth_encrypt: EVP_PKEY_meth_encrypt); cdecl = nil; + + EVP_PKEY_meth_set_decrypt: procedure (pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_decrypt_init: EVP_PKEY_meth_decrypt_init; AEVP_PKEY_meth_decrypt: EVP_PKEY_meth_decrypt); cdecl = nil; + + EVP_PKEY_meth_set_derive: procedure (pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_derive_init: EVP_PKEY_meth_derive_init; AEVP_PKEY_meth_derive: EVP_PKEY_meth_derive); cdecl = nil; + + EVP_PKEY_meth_set_ctrl: procedure (pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_ctrl: EVP_PKEY_meth_ctrl; AEVP_PKEY_meth_ctrl_str: EVP_PKEY_meth_ctrl_str); cdecl = nil; + + EVP_PKEY_meth_set_digestsign: procedure (pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_digestsign: EVP_PKEY_meth_digestsign); cdecl = nil; {introduced 1.1.0} + + EVP_PKEY_meth_set_digestverify: procedure (pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_digestverify: EVP_PKEY_meth_digestverify); cdecl = nil; {introduced 1.1.0} + + EVP_PKEY_meth_set_check: procedure (pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_check: EVP_PKEY_meth_check); cdecl = nil; {introduced 1.1.0} + + EVP_PKEY_meth_set_public_check: procedure (pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_public_check: EVP_PKEY_meth_public_check); cdecl = nil; {introduced 1.1.0} + + EVP_PKEY_meth_set_param_check: procedure (pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_param_check: EVP_PKEY_meth_param_check); cdecl = nil; {introduced 1.1.0} + + EVP_PKEY_meth_set_digest_custom: procedure (pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_digest_custom: EVP_PKEY_meth_digest_custom); cdecl = nil; {introduced 1.1.0} + + EVP_PKEY_meth_get_init: procedure (const pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_init: PEVP_PKEY_meth_init); cdecl = nil; + + EVP_PKEY_meth_get_copy: procedure (const pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_copy: PEVP_PKEY_meth_copy); cdecl = nil; + + EVP_PKEY_meth_get_cleanup: procedure (const pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_cleanup: PEVP_PKEY_meth_cleanup); cdecl = nil; + + EVP_PKEY_meth_get_paramgen: procedure (const pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_paramgen_init: EVP_PKEY_meth_paramgen_init; AEVP_PKEY_meth_paramgen: PEVP_PKEY_meth_paramgen); cdecl = nil; + + EVP_PKEY_meth_get_keygen: procedure (const pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_keygen_init: EVP_PKEY_meth_keygen_init; AEVP_PKEY_meth_keygen: PEVP_PKEY_meth_keygen); cdecl = nil; + + EVP_PKEY_meth_get_sign: procedure (const pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_sign_init: PEVP_PKEY_meth_sign_init; AEVP_PKEY_meth_sign: PEVP_PKEY_meth_sign); cdecl = nil; + + EVP_PKEY_meth_get_verify: procedure (pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_verify_init: PEVP_PKEY_meth_verify_init; AEVP_PKEY_meth_verify: PEVP_PKEY_meth_verify_init); cdecl = nil; + + EVP_PKEY_meth_get_verify_recover: procedure (pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_verify_recover_init: PEVP_PKEY_meth_verify_recover_init; AEVP_PKEY_meth_verify_recover: PEVP_PKEY_meth_verify_recover_init); cdecl = nil; + + EVP_PKEY_meth_get_signctx: procedure (pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_signctx_init: PEVP_PKEY_meth_signctx_init; AEVP_PKEY_meth_signctx: PEVP_PKEY_meth_signctx); cdecl = nil; + + EVP_PKEY_meth_get_verifyctx: procedure (pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_verifyctx_init: PEVP_PKEY_meth_verifyctx_init; AEVP_PKEY_meth_verifyctx: PEVP_PKEY_meth_verifyctx); cdecl = nil; + + EVP_PKEY_meth_get_encrypt: procedure (pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_encrypt_init: PEVP_PKEY_meth_encrypt_init; AEVP_PKEY_meth_encrypt: PEVP_PKEY_meth_encrypt); cdecl = nil; + + EVP_PKEY_meth_get_decrypt: procedure (pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_decrypt_init: PEVP_PKEY_meth_decrypt_init; AEVP_PKEY_meth_decrypt: PEVP_PKEY_meth_decrypt); cdecl = nil; + + EVP_PKEY_meth_get_derive: procedure (pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_derive_init: PEVP_PKEY_meth_derive_init; AEVP_PKEY_meth_derive: PEVP_PKEY_meth_derive); cdecl = nil; + + EVP_PKEY_meth_get_ctrl: procedure (pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_ctrl: PEVP_PKEY_meth_ctrl; AEVP_PKEY_meth_ctrl_str: PEVP_PKEY_meth_ctrl_str); cdecl = nil; + + EVP_PKEY_meth_get_digestsign: procedure (pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_digestsign: PEVP_PKEY_meth_digestsign); cdecl = nil; {introduced 1.1.0} + + EVP_PKEY_meth_get_digestverify: procedure (pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_digestverify: PEVP_PKEY_meth_digestverify); cdecl = nil; {introduced 1.1.0} + + EVP_PKEY_meth_get_check: procedure (pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_check: PEVP_PKEY_meth_check); cdecl = nil; {introduced 1.1.0} + + EVP_PKEY_meth_get_public_check: procedure (pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_public_check: PEVP_PKEY_meth_public_check); cdecl = nil; {introduced 1.1.0} + + EVP_PKEY_meth_get_param_check: procedure (pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_param_check: PEVP_PKEY_meth_param_check); cdecl = nil; {introduced 1.1.0} + + EVP_PKEY_meth_get_digest_custom: procedure (pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_digest_custom: PEVP_PKEY_meth_digest_custom); cdecl = nil; {introduced 1.1.0} + + EVP_add_alg_module: procedure ; cdecl = nil; + + OpenSSL_add_all_ciphers: procedure ; cdecl = nil; {removed 1.1.0} + + OpenSSL_add_all_digests: procedure ; cdecl = nil; {removed 1.1.0} + + EVP_cleanup: procedure ; cdecl = nil; {removed 1.1.0} + +{$ELSE} + + function EVP_MD_meth_new(md_type: TIdC_INT; pkey_type: TIdC_INT): PEVP_MD cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_MD_meth_dup(const md: PEVP_MD): PEVP_MD cdecl; external CLibCrypto; {introduced 1.1.0} + procedure EVP_MD_meth_free(md: PEVP_MD) cdecl; external CLibCrypto; {introduced 1.1.0} + + function EVP_MD_meth_set_input_blocksize(md: PEVP_MD; blocksize: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_MD_meth_set_result_size(md: PEVP_MD; resultsize: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_MD_meth_set_app_datasize(md: PEVP_MD; datasize: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_MD_meth_set_flags(md: PEVP_MD; flags: TIdC_ULONG): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_MD_meth_set_init(md: PEVP_MD; init: EVP_MD_meth_init): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_MD_meth_set_update(md: PEVP_MD; update: EVP_MD_meth_update): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_MD_meth_set_final(md: PEVP_MD; final_: EVP_MD_meth_final): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_MD_meth_set_copy(md: PEVP_MD; copy: EVP_MD_meth_copy): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_MD_meth_set_cleanup(md: PEVP_MD; cleanup: EVP_MD_meth_cleanup): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_MD_meth_set_ctrl(md: PEVP_MD; ctrl: EVP_MD_meth_ctrl): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + + function EVP_MD_meth_get_input_blocksize(const md: PEVP_MD): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_MD_meth_get_result_size(const md: PEVP_MD): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_MD_meth_get_app_datasize(const md: PEVP_MD): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_MD_meth_get_flags(const md: PEVP_MD): TIdC_ULONG cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_MD_meth_get_init(const md: PEVP_MD): EVP_MD_meth_init cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_MD_meth_get_update(const md: PEVP_MD): EVP_MD_meth_update cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_MD_meth_get_final(const md: PEVP_MD): EVP_MD_meth_final cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_MD_meth_get_copy(const md: PEVP_MD): EVP_MD_meth_copy cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_MD_meth_get_cleanup(const md: PEVP_MD): EVP_MD_meth_cleanup cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_MD_meth_get_ctrl(const md: PEVP_MD): EVP_MD_meth_ctrl cdecl; external CLibCrypto; {introduced 1.1.0} + + function EVP_CIPHER_meth_new(cipher_type: TIdC_INT; block_size: TIdC_INT; key_len: TIdC_INT): PEVP_CIPHER cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_CIPHER_meth_dup(const cipher: PEVP_CIPHER): PEVP_CIPHER cdecl; external CLibCrypto; {introduced 1.1.0} + procedure EVP_CIPHER_meth_free(cipher: PEVP_CIPHER) cdecl; external CLibCrypto; {introduced 1.1.0} + + function EVP_CIPHER_meth_set_iv_length(cipher: PEVP_CIPHER; iv_len: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_CIPHER_meth_set_flags(cipher: PEVP_CIPHER; flags: TIdC_ULONG): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_CIPHER_meth_set_impl_ctx_size(cipher: PEVP_CIPHER; ctx_size: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_CIPHER_meth_set_init(cipher: PEVP_CIPHER; init: EVP_CIPHER_meth_init): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_CIPHER_meth_set_do_cipher(cipher: PEVP_CIPHER; do_cipher: EVP_CIPHER_meth_do_cipher): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_CIPHER_meth_set_cleanup(cipher: PEVP_CIPHER; cleanup: EVP_CIPHER_meth_cleanup): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_CIPHER_meth_set_set_asn1_params(cipher: PEVP_CIPHER; set_asn1_parameters: EVP_CIPHER_meth_set_asn1_params): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_CIPHER_meth_set_get_asn1_params(cipher: PEVP_CIPHER; get_asn1_parameters: EVP_CIPHER_meth_get_asn1_params): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_CIPHER_meth_set_ctrl(cipher: PEVP_CIPHER; ctrl: EVP_CIPHER_meth_ctrl): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_CIPHER_meth_get_init(const cipher: PEVP_CIPHER): EVP_CIPHER_meth_init cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_CIPHER_meth_get_do_cipher(const cipher: PEVP_CIPHER): EVP_CIPHER_meth_do_cipher cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_CIPHER_meth_get_cleanup(const cipher: PEVP_CIPHER): EVP_CIPHER_meth_cleanup cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_CIPHER_meth_get_set_asn1_params(const cipher: PEVP_CIPHER): EVP_CIPHER_meth_set_asn1_params cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_CIPHER_meth_get_get_asn1_params(const cipher: PEVP_CIPHER): EVP_CIPHER_meth_get_asn1_params cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_CIPHER_meth_get_ctrl(const cipher: PEVP_CIPHER): EVP_CIPHER_meth_ctrl cdecl; external CLibCrypto; {introduced 1.1.0} + + /// Add some extra combinations /// + //# define EVP_get_digestbynid(a) EVP_get_digestbyname(OBJ_nid2sn(a)); + //# define EVP_get_digestbyobj(a) EVP_get_digestbynid(OBJ_obj2nid(a)); + //# define EVP_get_cipherbynid(a) EVP_get_cipherbyname(OBJ_nid2sn(a)); + //# define EVP_get_cipherbyobj(a) EVP_get_cipherbynid(OBJ_obj2nid(a)); + + //# define EVP_MD_nid(e) EVP_MD_type(e) + //# define EVP_MD_name(e) OBJ_nid2sn(EVP_MD_nid(e)) + + function EVP_MD_CTX_md(ctx: PEVP_MD_CTX): PEVP_MD cdecl; external CLibCrypto; + function EVP_MD_CTX_update_fn(ctx: PEVP_MD_CTX): EVP_MD_CTX_update cdecl; external CLibCrypto; {introduced 1.1.0} + procedure EVP_MD_CTX_set_update_fn(ctx: PEVP_MD_CTX; update: EVP_MD_CTX_update) cdecl; external CLibCrypto; {introduced 1.1.0} + // EVP_MD_CTX_size(e) EVP_MD_size(EVP_MD_CTX_md(e)) + // EVP_MD_CTX_block_size(e) EVP_MD_block_size(EVP_MD_CTX_md(e)) + // EVP_MD_CTX_type(e) EVP_MD_type(EVP_MD_CTX_md(e)) + procedure EVP_MD_CTX_set_pkey_ctx(ctx: PEVP_MD_CTX; pctx: PEVP_PKEY_CTX) cdecl; external CLibCrypto; {introduced 1.1.0} + + //# define EVP_CIPHER_name(e) OBJ_nid2sn(EVP_CIPHER_nid(e)) + function EVP_CIPHER_impl_ctx_size(const cipher: PEVP_CIPHER): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + //# define EVP_CIPHER_mode(e) (EVP_CIPHER_flags(e) & EVP_CIPH_MODE) + + function EVP_CIPHER_CTX_cipher(const ctx: PEVP_CIPHER_CTX): PEVP_CIPHER cdecl; external CLibCrypto; + function EVP_CIPHER_CTX_iv(const ctx: PEVP_CIPHER_CTX): PByte cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_CIPHER_CTX_original_iv(const ctx: PEVP_CIPHER_CTX): PByte cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_CIPHER_CTX_iv_noconst(ctx: PEVP_CIPHER_CTX): PByte cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_CIPHER_CTX_buf_noconst(ctx: PEVP_CIPHER_CTX): PByte cdecl; external CLibCrypto; {introduced 1.1.0} + procedure EVP_CIPHER_CTX_set_num(ctx: PEVP_CIPHER_CTX; num: TIdC_INT) cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_CIPHER_CTX_copy(out_: PEVP_CIPHER_CTX; const in_: PEVP_CIPHER_CTX): TIdC_INT cdecl; external CLibCrypto; + function EVP_CIPHER_CTX_get_app_data(const ctx: PEVP_CIPHER_CTX): Pointer cdecl; external CLibCrypto; + procedure EVP_CIPHER_CTX_set_app_data(ctx: PEVP_CIPHER_CTX; data: Pointer) cdecl; external CLibCrypto; + function EVP_CIPHER_CTX_get_cipher_data(const ctx: PEVP_CIPHER_CTX): Pointer cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_CIPHER_CTX_set_cipher_data(ctx: PEVP_CIPHER_CTX; cipher_data: Pointer): Pointer cdecl; external CLibCrypto; {introduced 1.1.0} + + //# define EVP_CIPHER_CTX_type(c) EVP_CIPHER_type(EVP_CIPHER_CTX_cipher(c)) + //# if OPENSSL_API_COMPAT < 0x10100000L + //# define EVP_CIPHER_CTX_flags(c) EVP_CIPHER_flags(EVP_CIPHER_CTX_cipher(c)) + //# endif + //# define EVP_CIPHER_CTX_mode(c) EVP_CIPHER_mode(EVP_CIPHER_CTX_cipher(c)) + // + //# define EVP_ENCODE_LENGTH(l) ((((l)+2)/3*4)+((l)/48+1)*2+80) + //# define EVP_DECODE_LENGTH(l) (((l)+3)/4*3+80) + // + //# define EVP_SignInit_ex(a;b;c) EVP_DigestInit_ex(a;b;c) + //# define EVP_SignInit(a;b) EVP_DigestInit(a;b) + //# define EVP_SignUpdate(a;b;c) EVP_DigestUpdate(a;b;c) + //# define EVP_VerifyInit_ex(a;b;c) EVP_DigestInit_ex(a;b;c) + //# define EVP_VerifyInit(a;b) EVP_DigestInit(a;b) + //# define EVP_VerifyUpdate(a;b;c) EVP_DigestUpdate(a;b;c) + //# define EVP_OpenUpdate(a;b;c;d;e) EVP_DecryptUpdate(a;b;c;d;e) + //# define EVP_SealUpdate(a;b;c;d;e) EVP_EncryptUpdate(a;b;c;d;e) + //# define EVP_DigestSignUpdate(a;b;c) EVP_DigestUpdate(a;b;c) + //# define EVP_DigestVerifyUpdate(a;b;c) EVP_DigestUpdate(a;b;c) + + //# define BIO_get_md(b;mdp) BIO_ctrl(b;BIO_C_GET_MD;0;(PIdAnsiChar)(mdp)) + //# define BIO_get_md_ctx(b;mdcp) BIO_ctrl(b;BIO_C_GET_MD_CTX;0; (PIdAnsiChar)(mdcp)) + //# define BIO_set_md_ctx(b;mdcp) BIO_ctrl(b;BIO_C_SET_MD_CTX;0; (PIdAnsiChar)(mdcp)) + //# define BIO_get_cipher_status(b) BIO_ctrl(b;BIO_C_GET_CIPHER_STATUS;0;NULL) + //# define BIO_get_cipher_ctx(b;c_pp) BIO_ctrl(b;BIO_C_GET_CIPHER_CTX;0; (PIdAnsiChar)(c_pp)) + + //function EVP_Cipher(c: PEVP_CIPHER_CTX; out_: PByte; const in_: PByte; in1: TIdC_UINT): TIdC_INT; + + //# define EVP_add_cipher_alias(n;alias) OBJ_NAME_add((alias);OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS;(n)) + //# define EVP_add_digest_alias(n;alias) OBJ_NAME_add((alias);OBJ_NAME_TYPE_MD_METH|OBJ_NAME_ALIAS;(n)) + //# define EVP_delete_cipher_alias(alias) OBJ_NAME_remove(alias;OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS); + //# define EVP_delete_digest_alias(alias) OBJ_NAME_remove(alias;OBJ_NAME_TYPE_MD_METH|OBJ_NAME_ALIAS); + + //void EVP_MD_CTX_init(EVP_MD_CTX *ctx); + //int EVP_MD_CTX_cleanup(EVP_MD_CTX *ctx); + + function EVP_MD_CTX_ctrl(ctx: PEVP_MD_CTX; cmd: TIdC_INT; p1: TIdC_INT; p2: Pointer): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_MD_CTX_new: PEVP_MD_CTX cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_MD_CTX_reset(ctx: PEVP_MD_CTX): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + procedure EVP_MD_CTX_free(ctx: PEVP_MD_CTX) cdecl; external CLibCrypto; {introduced 1.1.0} + //# define EVP_MD_CTX_create() EVP_MD_CTX_new() + //# define EVP_MD_CTX_init(ctx) EVP_MD_CTX_reset((ctx)) + //# define EVP_MD_CTX_destroy(ctx) EVP_MD_CTX_free((ctx)) + function EVP_MD_CTX_copy_ex(out_: PEVP_MD_CTX; const in_: PEVP_MD_CTX): TIdC_INT cdecl; external CLibCrypto; + procedure EVP_MD_CTX_set_flags(ctx: PEVP_MD_CTX; flags: TIdC_INT) cdecl; external CLibCrypto; + procedure EVP_MD_CTX_clear_flags(ctx: PEVP_MD_CTX; flags: TIdC_INT) cdecl; external CLibCrypto; + function EVP_MD_CTX_test_flags(const ctx: PEVP_MD_CTX; flags: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function EVP_DigestInit_ex(ctx: PEVP_MD_CTX; const type_: PEVP_MD; impl: PENGINE): TIdC_INT cdecl; external CLibCrypto; + function EVP_DigestUpdate(ctx: PEVP_MD_CTX; const d: Pointer; cnt: TIdC_SIZET): TIdC_INT cdecl; external CLibCrypto; + function EVP_DigestFinal_ex(ctx: PEVP_MD_CTX; md: PByte; var s: TIdC_UINT): TIdC_INT cdecl; external CLibCrypto; + function EVP_Digest(const data: Pointer; count: TIdC_SIZET; md: PByte; size: PIdC_UINT; const type_: PEVP_MD; impl: PENGINE): TIdC_INT cdecl; external CLibCrypto; + + function EVP_MD_CTX_copy(out_: PEVP_MD_CTX; const in_: PEVP_MD_CTX): TIdC_INT cdecl; external CLibCrypto; + function EVP_DigestInit(ctx: PEVP_MD_CTX; const type_: PEVP_MD): TIdC_INT cdecl; external CLibCrypto; + function EVP_DigestFinal(ctx: PEVP_MD_CTX; md: PByte; var s: TIdC_UINT): TIdC_INT cdecl; external CLibCrypto; + function EVP_DigestFinalXOF(ctx: PEVP_MD_CTX; md: PByte; len: TIdC_SIZET): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + + function EVP_read_pw_string(buf: PIdAnsiChar; length: TIdC_INT; const prompt: PIdAnsiChar; verify: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function EVP_read_pw_string_min(buf: PIdAnsiChar; minlen: TIdC_INT; maxlen: TIdC_INT; const prompt: PIdAnsiChar; verify: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + procedure EVP_set_pw_prompt(const prompt: PIdAnsiChar) cdecl; external CLibCrypto; + function EVP_get_pw_prompt: PIdAnsiChar cdecl; external CLibCrypto; + function EVP_BytesToKey(const type_: PEVP_CIPHER; const md: PEVP_MD; const salt: PByte; const data: PByte; data1: TIdC_INT; count: TIdC_INT; key: PByte; iv: PByte): TIdC_INT cdecl; external CLibCrypto; + + procedure EVP_CIPHER_CTX_set_flags(ctx: PEVP_CIPHER_CTX; flags: TIdC_INT) cdecl; external CLibCrypto; + procedure EVP_CIPHER_CTX_clear_flags(ctx: PEVP_CIPHER_CTX; flags: TIdC_INT) cdecl; external CLibCrypto; + function EVP_CIPHER_CTX_test_flags(const ctx: PEVP_CIPHER_CTX; flags: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + + function EVP_EncryptInit(ctx: PEVP_CIPHER_CTX; const cipher: PEVP_CIPHER; const key: PByte; const iv: PByte): TIdC_INT cdecl; external CLibCrypto; + function EVP_EncryptInit_ex(ctx: PEVP_CIPHER_CTX; const cipher: PEVP_CIPHER; impl: PENGINE; const key: PByte; const iv: PByte): TIdC_INT cdecl; external CLibCrypto; + function EVP_EncryptUpdate(ctx: PEVP_CIPHER_CTX; out_: PByte; out1: PIdC_INT; const in_: PByte; in_1: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function EVP_EncryptFinal_ex(ctx: PEVP_CIPHER_CTX; out_: PByte; out1: PIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function EVP_EncryptFinal(ctx: PEVP_CIPHER_CTX; out_: PByte; out1: PIdC_INT): TIdC_INT cdecl; external CLibCrypto; + + function EVP_DecryptInit(ctx: PEVP_CIPHER_CTX; out_: PByte; out1: PidC_INT): TIdC_INT cdecl; external CLibCrypto; + function EVP_DecryptInit_ex(ctx: PEVP_CIPHER_CTX; const cipher: PEVP_CIPHER; impl: PENGINE; const key: PByte; const iv: PByte): TIdC_INT cdecl; external CLibCrypto; + function EVP_DecryptUpdate(ctx: PEVP_CIPHER_CTX; out_: PByte; out1: PIdC_INT; const in_: PByte; in_1: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function EVP_DecryptFinal(ctx: PEVP_CIPHER_CTX; outm: PByte; out1: PIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function EVP_DecryptFinal_ex(ctx: PEVP_MD_CTX; outm: PByte; out1: PIdC_INT): TIdC_INT cdecl; external CLibCrypto; + + function EVP_CipherInit(ctx: PEVP_CIPHER_CTX; const cipher: PEVP_CIPHER; const key: PByte; const iv: PByte; enc: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function EVP_CipherInit_ex(ctx: PEVP_CIPHER_CTX; const cipher: PEVP_CIPHER; impl: PENGINE; const key: PByte; const iv: PByte; enc: TidC_INT): TIdC_INT cdecl; external CLibCrypto; + function EVP_CipherUpdate(ctx: PEVP_CIPHER_CTX; out_: PByte; out1: PIdC_INT; const in_: PByte; in1: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function EVP_CipherFinal(ctx: PEVP_CIPHER_CTX; outm: PByte; out1: PIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function EVP_CipherFinal_ex(ctx: PEVP_CIPHER_CTX; outm: PByte; out1: PIdC_INT): TIdC_INT cdecl; external CLibCrypto; + + function EVP_SignFinal(ctx: PEVP_CIPHER_CTX; md: PByte; s: PIdC_UINT; pkey: PEVP_PKEY): TIdC_INT cdecl; external CLibCrypto; + + function EVP_DigestSign(ctx: PEVP_CIPHER_CTX; sigret: PByte; siglen: PIdC_SIZET; const tbs: PByte; tbslen: TIdC_SIZET): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + + function EVP_VerifyFinal(ctx: PEVP_MD_CTX; const sigbuf: PByte; siglen: TIdC_UINT; pkey: PEVP_PKEY): TIdC_INT cdecl; external CLibCrypto; + + function EVP_DigestVerify(ctx: PEVP_CIPHER_CTX; const sigret: PByte; siglen: TIdC_SIZET; const tbs: PByte; tbslen: TIdC_SIZET): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + + function EVP_DigestSignInit(ctx: PEVP_MD_CTX; pctx: PPEVP_PKEY_CTX; const type_: PEVP_MD; e: PENGINE; pkey: PEVP_PKEY): TIdC_INT cdecl; external CLibCrypto; + function EVP_DigestSignFinal(ctx: PEVP_MD_CTX; sigret: PByte; siglen: PIdC_SIZET): TIdC_INT cdecl; external CLibCrypto; + + function EVP_DigestVerifyInit(ctx: PEVP_MD_CTX; ppctx: PPEVP_PKEY_CTX; const type_: PEVP_MD; e: PENGINE; pkey: PEVP_PKEY): TIdC_INT cdecl; external CLibCrypto; + function EVP_DigestVerifyFinal(ctx: PEVP_MD_CTX; const sig: PByte; siglen: TIdC_SIZET): TIdC_INT cdecl; external CLibCrypto; + + function EVP_OpenInit(ctx: PEVP_CIPHER_CTX; const type_: PEVP_CIPHER; const ek: PByte; ek1: TIdC_INT; const iv: PByte; priv: PEVP_PKEY): TIdC_INT cdecl; external CLibCrypto; + function EVP_OpenFinal(ctx: PEVP_CIPHER_CTX; out_: PByte; out1: PIdC_INT): TIdC_INT cdecl; external CLibCrypto; + + function EVP_SealInit(ctx: PEVP_CIPHER_CTX; const type_: EVP_CIPHER; ek: PPByte; ek1: PIdC_INT; iv: PByte; pubk: PPEVP_PKEY; npubk: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function EVP_SealFinal(ctx: PEVP_CIPHER_CTX; out_: PByte; out1: PIdC_INT): TIdC_INT cdecl; external CLibCrypto; + + function EVP_ENCODE_CTX_new: PEVP_ENCODE_CTX cdecl; external CLibCrypto; {introduced 1.1.0} + procedure EVP_ENCODE_CTX_free(ctx: PEVP_ENCODE_CTX) cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_ENCODE_CTX_copy(dctx: PEVP_ENCODE_CTX; sctx: PEVP_ENCODE_CTX): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_ENCODE_CTX_num(ctx: PEVP_ENCODE_CTX): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + procedure EVP_EncodeInit(ctx: PEVP_ENCODE_CTX) cdecl; external CLibCrypto; + function EVP_EncodeUpdate(ctx: PEVP_ENCODE_CTX; out_: PByte; out1: PIdC_INT; const in_: PByte; in1: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + procedure EVP_EncodeFinal(ctx: PEVP_ENCODE_CTX; out_: PByte; out1: PIdC_INT) cdecl; external CLibCrypto; + function EVP_EncodeBlock(t: PByte; const f: PByte; n: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + + procedure EVP_DecodeInit(ctx: PEVP_ENCODE_CTX) cdecl; external CLibCrypto; + function EVP_DecodeUpdate(ctx: PEVP_ENCODE_CTX; out_: PByte; out1: PIdC_INT; const in_: PByte; in1: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function EVP_DecodeFinal(ctx: PEVP_ENCODE_CTX; out_: PByte; out1: PIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function EVP_DecodeBlock(t: PByte; const f: PByte; n: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + + function EVP_CIPHER_CTX_new: PEVP_CIPHER_CTX cdecl; external CLibCrypto; + function EVP_CIPHER_CTX_reset(c: PEVP_CIPHER_CTX): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + procedure EVP_CIPHER_CTX_free(c: PEVP_CIPHER_CTX) cdecl; external CLibCrypto; + function EVP_CIPHER_CTX_set_key_length(x: PEVP_CIPHER_CTX; keylen: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function EVP_CIPHER_CTX_set_padding(c: PEVP_CIPHER_CTX; pad: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function EVP_CIPHER_CTX_ctrl(ctx: PEVP_CIPHER_CTX; type_: TIdC_INT; arg: TIdC_INT; ptr: Pointer): TIdC_INT cdecl; external CLibCrypto; + function EVP_CIPHER_CTX_rand_key(ctx: PEVP_CIPHER_CTX; key: PByte): TIdC_INT cdecl; external CLibCrypto; + + function BIO_f_md: PBIO_METHOD cdecl; external CLibCrypto; + function BIO_f_base64: PBIO_METHOD cdecl; external CLibCrypto; + function BIO_f_cipher: PBIO_METHOD cdecl; external CLibCrypto; + function BIO_f_reliable: PBIO_METHOD cdecl; external CLibCrypto; + function BIO_set_cipher(b: PBIO; c: PEVP_CIPHER; const k: PByte; const i: PByte; enc: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + + function EVP_md_null: PEVP_MD cdecl; external CLibCrypto; + + {$IFNDEF OPENSSL_NO_MD2} + {$ENDIF} + {$IFNDEF OPENSSL_NO_MD4} + {$ENDIF} + {$IFNDEF OPENSSL_NO_MD5} + {$ENDIF} + function EVP_md5_sha1: PEVP_MD cdecl; external CLibCrypto; {introduced 1.1.0} + + function EVP_sha1: PEVP_MD cdecl; external CLibCrypto; + function EVP_sha224: PEVP_MD cdecl; external CLibCrypto; + function EVP_sha256: PEVP_MD cdecl; external CLibCrypto; + function EVP_sha384: PEVP_MD cdecl; external CLibCrypto; + function EVP_sha512: PEVP_MD cdecl; external CLibCrypto; + function EVP_sha512_224: PEVP_MD cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_sha512_256: PEVP_MD cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_sha3_224: PEVP_MD cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_sha3_256: PEVP_MD cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_sha3_384: PEVP_MD cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_sha3_512: PEVP_MD cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_shake128: PEVP_MD cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_shake256: PEVP_MD cdecl; external CLibCrypto; {introduced 1.1.0} + + (* does nothing :-) *) + function EVP_enc_null: PEVP_CIPHER cdecl; external CLibCrypto; + + function EVP_des_ecb: PEVP_CIPHER cdecl; external CLibCrypto; + function EVP_des_ede: PEVP_CIPHER cdecl; external CLibCrypto; + function EVP_des_ede3: PEVP_CIPHER cdecl; external CLibCrypto; + function EVP_des_ede_ecb: PEVP_CIPHER cdecl; external CLibCrypto; + function EVP_des_ede3_ecb: PEVP_CIPHER cdecl; external CLibCrypto; + function EVP_des_cfb64: PEVP_CIPHER cdecl; external CLibCrypto; + //EVP_des_cfb EVP_des_cfb64 + function EVP_des_cfb1: PEVP_CIPHER cdecl; external CLibCrypto; + function EVP_des_cfb8: PEVP_CIPHER cdecl; external CLibCrypto; + function EVP_des_ede_cfb64: PEVP_CIPHER cdecl; external CLibCrypto; + function EVP_des_ede3_cfb64: PEVP_CIPHER cdecl; external CLibCrypto; + //EVP_des_ede3_cfb EVP_des_ede3_cfb64 + function EVP_des_ede3_cfb1: PEVP_CIPHER cdecl; external CLibCrypto; + function EVP_des_ede3_cfb8: PEVP_CIPHER cdecl; external CLibCrypto; + function EVP_des_ofb: PEVP_CIPHER cdecl; external CLibCrypto; + function EVP_des_ede_ofb: PEVP_CIPHER cdecl; external CLibCrypto; + function EVP_des_ede3_ofb: PEVP_CIPHER cdecl; external CLibCrypto; + function EVP_des_cbc: PEVP_CIPHER cdecl; external CLibCrypto; + function EVP_des_ede_cbc: PEVP_CIPHER cdecl; external CLibCrypto; + function EVP_des_ede3_cbc: PEVP_CIPHER cdecl; external CLibCrypto; + function EVP_desx_cbc: PEVP_CIPHER cdecl; external CLibCrypto; + function EVP_des_ede3_wrap: PEVP_CIPHER cdecl; external CLibCrypto; + // + // This should now be supported through the dev_crypto ENGINE. But also, why + // are rc4 and md5 declarations made here inside a "NO_DES" precompiler + // branch? + // + function EVP_rc4: PEVP_CIPHER cdecl; external CLibCrypto; + function EVP_rc4_40: PEVP_CIPHER cdecl; external CLibCrypto; +// function EVP_idea_ecb: PEVP_CIPHER; +// function EVP_idea_cfb64: PEVP_CIPHER; + //EVP_idea_cfb EVP_idea_cfb64 +// function EVP_idea_ofb: PEVP_CIPHER; + // function EVP_idea_cbc: PEVP_CIPHER; + function EVP_rc2_ecb: PEVP_CIPHER cdecl; external CLibCrypto; + function EVP_rc2_cbc: PEVP_CIPHER cdecl; external CLibCrypto; + function EVP_rc2_40_cbc: PEVP_CIPHER cdecl; external CLibCrypto; + function EVP_rc2_64_cbc: PEVP_CIPHER cdecl; external CLibCrypto; + function EVP_rc2_cfb64: PEVP_CIPHER cdecl; external CLibCrypto; + //EVP_rc2_cfb EVP_rc2_cfb64 + function EVP_rc2_ofb: PEVP_CIPHER cdecl; external CLibCrypto; + function EVP_bf_ecb: PEVP_CIPHER cdecl; external CLibCrypto; + function EVP_bf_cbc: PEVP_CIPHER cdecl; external CLibCrypto; + function EVP_bf_cfb64: PEVP_CIPHER cdecl; external CLibCrypto; + //EVP_bf_cfb EVP_bf_cfb64 + function EVP_bf_ofb: PEVP_CIPHER cdecl; external CLibCrypto; + function EVP_cast5_ecb: PEVP_CIPHER cdecl; external CLibCrypto; + function EVP_cast5_cbc: PEVP_CIPHER cdecl; external CLibCrypto; + function EVP_cast5_cfb64: PEVP_CIPHER cdecl; external CLibCrypto; + //EVP_cast5_cfb EVP_cast5_cfb64 + function EVP_cast5_ofb: PEVP_CIPHER cdecl; external CLibCrypto; +// function EVP_rc5_32_12_16_cbc: PEVP_CIPHER; +// function EVP_rc5_32_12_16_ecb: PEVP_CIPHER; +// function EVP_rc5_32_12_16_cfb64: PEVP_CIPHER; + //EVP_rc5_32_12_16_cfb EVP_rc5_32_12_16_cfb64 +// function EVP_rc5_32_12_16_ofb: PEVP_CIPHER; + + function EVP_aes_128_ecb: PEVP_CIPHER cdecl; external CLibCrypto; + function EVP_aes_128_cbc: PEVP_CIPHER cdecl; external CLibCrypto; + function EVP_aes_128_cfb1: PEVP_CIPHER cdecl; external CLibCrypto; + function EVP_aes_128_cfb8: PEVP_CIPHER cdecl; external CLibCrypto; + function EVP_aes_128_cfb128: PEVP_CIPHER cdecl; external CLibCrypto; + //EVP_aes_128_cfb EVP_aes_128_cfb128 + function EVP_aes_128_ofb: PEVP_CIPHER cdecl; external CLibCrypto; + function EVP_aes_128_ctr: PEVP_CIPHER cdecl; external CLibCrypto; + function EVP_aes_128_ccm: PEVP_CIPHER cdecl; external CLibCrypto; + function EVP_aes_128_gcm: PEVP_CIPHER cdecl; external CLibCrypto; + function EVP_aes_128_xts: PEVP_CIPHER cdecl; external CLibCrypto; + function EVP_aes_128_wrap: PEVP_CIPHER cdecl; external CLibCrypto; + function EVP_aes_128_wrap_pad: PEVP_CIPHER cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_aes_128_ocb: PEVP_CIPHER cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_aes_192_ecb: PEVP_CIPHER cdecl; external CLibCrypto; + function EVP_aes_192_cbc: PEVP_CIPHER cdecl; external CLibCrypto; + function EVP_aes_192_cfb1: PEVP_CIPHER cdecl; external CLibCrypto; + function EVP_aes_192_cfb8: PEVP_CIPHER cdecl; external CLibCrypto; + function EVP_aes_192_cfb128: PEVP_CIPHER cdecl; external CLibCrypto; + //EVP_aes_192_cfb EVP_aes_192_cfb128 + function EVP_aes_192_ofb: PEVP_CIPHER cdecl; external CLibCrypto; + function EVP_aes_192_ctr: PEVP_CIPHER cdecl; external CLibCrypto; + function EVP_aes_192_ccm: PEVP_CIPHER cdecl; external CLibCrypto; + function EVP_aes_192_gcm: PEVP_CIPHER cdecl; external CLibCrypto; + function EVP_aes_192_wrap: PEVP_CIPHER cdecl; external CLibCrypto; + function EVP_aes_192_wrap_pad: PEVP_CIPHER cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_aes_192_ocb: PEVP_CIPHER cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_aes_256_ecb: PEVP_CIPHER cdecl; external CLibCrypto; + function EVP_aes_256_cbc: PEVP_CIPHER cdecl; external CLibCrypto; + function EVP_aes_256_cfb1: PEVP_CIPHER cdecl; external CLibCrypto; + function EVP_aes_256_cfb8: PEVP_CIPHER cdecl; external CLibCrypto; + function EVP_aes_256_cfb128: PEVP_CIPHER cdecl; external CLibCrypto; + //EVP_aes_256_cfb EVP_aes_256_cfb128 + function EVP_aes_256_ofb: PEVP_CIPHER cdecl; external CLibCrypto; + function EVP_aes_256_ctr: PEVP_CIPHER cdecl; external CLibCrypto; + function EVP_aes_256_ccm: PEVP_CIPHER cdecl; external CLibCrypto; + function EVP_aes_256_gcm: PEVP_CIPHER cdecl; external CLibCrypto; + function EVP_aes_256_xts: PEVP_CIPHER cdecl; external CLibCrypto; + function EVP_aes_256_wrap: PEVP_CIPHER cdecl; external CLibCrypto; + function EVP_aes_256_wrap_pad: PEVP_CIPHER cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_aes_256_ocb: PEVP_CIPHER cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_aes_128_cbc_hmac_sha1: PEVP_CIPHER cdecl; external CLibCrypto; + function EVP_aes_256_cbc_hmac_sha1: PEVP_CIPHER cdecl; external CLibCrypto; + function EVP_aes_128_cbc_hmac_sha256: PEVP_CIPHER cdecl; external CLibCrypto; + function EVP_aes_256_cbc_hmac_sha256: PEVP_CIPHER cdecl; external CLibCrypto; + + function EVP_aria_128_ecb: PEVP_CIPHER cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_aria_128_cbc: PEVP_CIPHER cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_aria_128_cfb1: PEVP_CIPHER cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_aria_128_cfb8: PEVP_CIPHER cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_aria_128_cfb128: PEVP_CIPHER cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_aria_128_ctr: PEVP_CIPHER cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_aria_128_ofb: PEVP_CIPHER cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_aria_128_gcm: PEVP_CIPHER cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_aria_128_ccm: PEVP_CIPHER cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_aria_192_ecb: PEVP_CIPHER cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_aria_192_cbc: PEVP_CIPHER cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_aria_192_cfb1: PEVP_CIPHER cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_aria_192_cfb8: PEVP_CIPHER cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_aria_192_cfb128: PEVP_CIPHER cdecl; external CLibCrypto; {introduced 1.1.0} + //EVP_aria_192_cfb EVP_aria_192_cfb128 + function EVP_aria_192_ctr: PEVP_CIPHER cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_aria_192_ofb: PEVP_CIPHER cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_aria_192_gcm: PEVP_CIPHER cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_aria_192_ccm: PEVP_CIPHER cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_aria_256_ecb: PEVP_CIPHER cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_aria_256_cbc: PEVP_CIPHER cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_aria_256_cfb1: PEVP_CIPHER cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_aria_256_cfb8: PEVP_CIPHER cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_aria_256_cfb128: PEVP_CIPHER cdecl; external CLibCrypto; {introduced 1.1.0} + //EVP_aria_256_cfb EVP_aria_256_cfb128 + function EVP_aria_256_ctr: PEVP_CIPHER cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_aria_256_ofb: PEVP_CIPHER cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_aria_256_gcm: PEVP_CIPHER cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_aria_256_ccm: PEVP_CIPHER cdecl; external CLibCrypto; {introduced 1.1.0} + + function EVP_camellia_128_ecb: PEVP_CIPHER cdecl; external CLibCrypto; + function EVP_camellia_128_cbc: PEVP_CIPHER cdecl; external CLibCrypto; + function EVP_camellia_128_cfb1: PEVP_CIPHER cdecl; external CLibCrypto; + function EVP_camellia_128_cfb8: PEVP_CIPHER cdecl; external CLibCrypto; + function EVP_camellia_128_cfb128: PEVP_CIPHER cdecl; external CLibCrypto; + //EVP_camellia_128_cfb EVP_camellia_128_cfb128 + function EVP_camellia_128_ofb: PEVP_CIPHER cdecl; external CLibCrypto; + function EVP_camellia_128_ctr: PEVP_CIPHER cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_camellia_192_ecb: PEVP_CIPHER cdecl; external CLibCrypto; + function EVP_camellia_192_cbc: PEVP_CIPHER cdecl; external CLibCrypto; + function EVP_camellia_192_cfb1: PEVP_CIPHER cdecl; external CLibCrypto; + function EVP_camellia_192_cfb8: PEVP_CIPHER cdecl; external CLibCrypto; + function EVP_camellia_192_cfb128: PEVP_CIPHER cdecl; external CLibCrypto; + //EVP_camellia_192_cfb EVP_camellia_192_cfb128 + function EVP_camellia_192_ofb: PEVP_CIPHER cdecl; external CLibCrypto; + function EVP_camellia_192_ctr: PEVP_CIPHER cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_camellia_256_ecb: PEVP_CIPHER cdecl; external CLibCrypto; + function EVP_camellia_256_cbc: PEVP_CIPHER cdecl; external CLibCrypto; + function EVP_camellia_256_cfb1: PEVP_CIPHER cdecl; external CLibCrypto; + function EVP_camellia_256_cfb8: PEVP_CIPHER cdecl; external CLibCrypto; + function EVP_camellia_256_cfb128: PEVP_CIPHER cdecl; external CLibCrypto; + //EVP_camellia_256_cfb EVP_camellia_256_cfb128 + function EVP_camellia_256_ofb: PEVP_CIPHER cdecl; external CLibCrypto; + function EVP_camellia_256_ctr: PEVP_CIPHER cdecl; external CLibCrypto; {introduced 1.1.0} + + function EVP_chacha20: PEVP_CIPHER cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_chacha20_poly1305: PEVP_CIPHER cdecl; external CLibCrypto; {introduced 1.1.0} + + function EVP_seed_ecb: PEVP_CIPHER cdecl; external CLibCrypto; + function EVP_seed_cbc: PEVP_CIPHER cdecl; external CLibCrypto; + function EVP_seed_cfb128: PEVP_CIPHER cdecl; external CLibCrypto; + //EVP_seed_cfb EVP_seed_cfb128 + function EVP_seed_ofb: PEVP_CIPHER cdecl; external CLibCrypto; + + function EVP_sm4_ecb: PEVP_CIPHER cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_sm4_cbc: PEVP_CIPHER cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_sm4_cfb128: PEVP_CIPHER cdecl; external CLibCrypto; {introduced 1.1.0} + //EVP_sm4_cfb EVP_sm4_cfb128 + function EVP_sm4_ofb: PEVP_CIPHER cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_sm4_ctr: PEVP_CIPHER cdecl; external CLibCrypto; {introduced 1.1.0} + + function EVP_add_cipher(const cipher: PEVP_CIPHER): TIdC_INT cdecl; external CLibCrypto; + function EVP_add_digest(const digest: PEVP_MD): TIdC_INT cdecl; external CLibCrypto; + + function EVP_get_cipherbyname(const name: PIdAnsiChar): PEVP_CIPHER cdecl; external CLibCrypto; + function EVP_get_digestbyname(const name: PIdAnsiChar): PEVP_MD cdecl; external CLibCrypto; + + procedure EVP_CIPHER_do_all(AFn: fn; arg: Pointer) cdecl; external CLibCrypto; + procedure EVP_CIPHER_do_all_sorted(AFn: fn; arg: Pointer) cdecl; external CLibCrypto; + + procedure EVP_MD_do_all(AFn: fn; arg: Pointer) cdecl; external CLibCrypto; + procedure EVP_MD_do_all_sorted(AFn: fn; arg: Pointer) cdecl; external CLibCrypto; + + function EVP_PKEY_decrypt_old(dec_key: PByte; const enc_key: PByte; enc_key_len: TIdC_INT; private_key: PEVP_PKEY): TIdC_INT cdecl; external CLibCrypto; + function EVP_PKEY_encrypt_old(dec_key: PByte; const enc_key: PByte; key_len: TIdC_INT; pub_key: PEVP_PKEY): TIdC_INT cdecl; external CLibCrypto; + function EVP_PKEY_type(type_: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function EVP_PKEY_set_type(pkey: PEVP_PKEY): TIdC_INT cdecl; external CLibCrypto; + function EVP_PKEY_set_type_str(pkey: PEVP_PKEY; const str: PIdAnsiChar; len: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + + function EVP_PKEY_set1_engine(pkey: PEVP_PKEY; e: PENGINE): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_PKEY_get0_engine(const pkey: PEVP_PKEY): PENGINE cdecl; external CLibCrypto; {introduced 1.1.0} + + function EVP_PKEY_assign(pkey: PEVP_PKEY; type_: TIdC_INT; key: Pointer): TIdC_INT cdecl; external CLibCrypto; + function EVP_PKEY_get0(const pkey: PEVP_PKEY): Pointer cdecl; external CLibCrypto; + function EVP_PKEY_get0_hmac(const pkey: PEVP_PKEY; len: PIdC_SIZET): PByte cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_PKEY_get0_poly1305(const pkey: PEVP_PKEY; len: PIdC_SIZET): PByte cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_PKEY_get0_siphash(const pkey: PEVP_PKEY; len: PIdC_SIZET): PByte cdecl; external CLibCrypto; {introduced 1.1.0} + + function EVP_PKEY_set1_RSA(pkey: PEVP_PKEY; key: PRSA): TIdC_INT cdecl; external CLibCrypto; + function EVP_PKEY_get0_RSA(pkey: PEVP_PKEY): PRSA cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_PKEY_get1_RSA(pkey: PEVP_PKEY): PRSA cdecl; external CLibCrypto; + + function EVP_PKEY_set1_DSA(pkey: PEVP_PKEY; key: PDSA): TIdC_INT cdecl; external CLibCrypto; + function EVP_PKEY_get0_DSA(pkey: PEVP_PKEY): PDSA cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_PKEY_get1_DSA(pkey: PEVP_PKEY): PDSA cdecl; external CLibCrypto; + + function EVP_PKEY_set1_DH(pkey: PEVP_PKEY; key: PDH): TIdC_INT cdecl; external CLibCrypto; + function EVP_PKEY_get0_DH(pkey: PEVP_PKEY): PDH cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_PKEY_get1_DH(pkey: PEVP_PKEY): PDH cdecl; external CLibCrypto; + + function EVP_PKEY_set1_EC_KEY(pkey: PEVP_PKEY; key: PEC_KEY): TIdC_INT cdecl; external CLibCrypto; + function EVP_PKEY_get0_EC_KEY(pkey: PEVP_PKEY): PEC_KEY cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_PKEY_get1_EC_KEY(pkey: PEVP_PKEY): PEC_KEY cdecl; external CLibCrypto; + + function EVP_PKEY_new: PEVP_PKEY cdecl; external CLibCrypto; + function EVP_PKEY_up_ref(pkey: PEVP_PKEY): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + procedure EVP_PKEY_free(pkey: PEVP_PKEY) cdecl; external CLibCrypto; + + function d2i_PublicKey(type_: TIdC_INT; a: PPEVP_PKEY; const pp: PPByte; length: TIdC_LONG): PEVP_PKEY cdecl; external CLibCrypto; + function i2d_PublicKey(a: PEVP_PKEY; pp: PPByte): TIdC_INT cdecl; external CLibCrypto; + + function d2i_PrivateKey(type_: TIdC_INT; a: PEVP_PKEY; const pp: PPByte; length: TIdC_LONG): PEVP_PKEY cdecl; external CLibCrypto; + function d2i_AutoPrivateKey(a: PPEVP_PKEY; const pp: PPByte; length: TIdC_LONG): PEVP_PKEY cdecl; external CLibCrypto; + function i2d_PrivateKey(a: PEVP_PKEY; pp: PPByte): TIdC_INT cdecl; external CLibCrypto; + + function EVP_PKEY_copy_parameters(to_: PEVP_PKEY; const from: PEVP_PKEY): TIdC_INT cdecl; external CLibCrypto; + function EVP_PKEY_missing_parameters(const pkey: PEVP_PKEY): TIdC_INT cdecl; external CLibCrypto; + function EVP_PKEY_save_parameters(pkey: PEVP_PKEY; mode: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function EVP_PKEY_cmp_parameters(const a: PEVP_PKEY; const b: PEVP_PKEY): TIdC_INT cdecl; external CLibCrypto; + + function EVP_PKEY_cmp(const a: PEVP_PKEY; const b: PEVP_PKEY): TIdC_INT cdecl; external CLibCrypto; + + function EVP_PKEY_print_public(out_: PBIO; const pkey: PEVP_PKEY; indent: TIdC_INT; pctx: PASN1_PCTX): TIdC_INT cdecl; external CLibCrypto; + function EVP_PKEY_print_private(out_: PBIO; const pkey: PEVP_PKEY; indent: TIdC_INT; pctx: PASN1_PCTX): TIdC_INT cdecl; external CLibCrypto; + function EVP_PKEY_print_params(out_: PBIO; const pkey: PEVP_PKEY; indent: TIdC_INT; pctx: PASN1_PCTX): TIdC_INT cdecl; external CLibCrypto; + + function EVP_PKEY_get_default_digest_nid(pkey: PEVP_PKEY; pnid: PIdC_INT): TIdC_INT cdecl; external CLibCrypto; + + + + (* calls methods *) + function EVP_CIPHER_param_to_asn1(c: PEVP_CIPHER_CTX; type_: PASN1_TYPE): TIdC_INT cdecl; external CLibCrypto; + function EVP_CIPHER_asn1_to_param(c: PEVP_CIPHER_CTX; type_: PASN1_TYPE): TIdC_INT cdecl; external CLibCrypto; + + (* These are used by EVP_CIPHER methods *) + function EVP_CIPHER_set_asn1_iv(c: PEVP_CIPHER_CTX; type_: PASN1_TYPE): TIdC_INT cdecl; external CLibCrypto; + function EVP_CIPHER_get_asn1_iv(c: PEVP_CIPHER_CTX; type_: PASN1_TYPE): TIdC_INT cdecl; external CLibCrypto; + + (* PKCS5 password based encryption *) + function PKCS5_PBE_keyivgen(ctx: PEVP_CIPHER_CTX; const pass: PIdAnsiChar; passlen: TIdC_INT; param: PASN1_TYPE; const cipher: PEVP_CIPHER; const md: PEVP_MD; en_de: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function PKCS5_PBKDF2_HMAC_SHA1(const pass: PIdAnsiChar; passlen: TIdC_INT; const salt: PByte; saltlen: TIdC_INT; iter: TIdC_INT; keylen: TIdC_INT; out_: PByte): TIdC_INT cdecl; external CLibCrypto; + function PKCS5_PBKDF2_HMAC(const pass: PIdAnsiChar; passlen: TIdC_INT; const salt: PByte; saltlen: TIdC_INT; iter: TIdC_INT; const digest: PEVP_MD; keylen: TIdC_INT; out_: PByte): TIdC_INT cdecl; external CLibCrypto; + function PKCS5_v2_PBE_keyivgen(ctx: PEVP_CIPHER_CTX; const pass: PIdAnsiChar; passlen: TIdC_INT; param: PASN1_TYPE; const cipher: PEVP_CIPHER; const md: PEVP_MD; en_de: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + + function EVP_PBE_scrypt(const pass: PIdAnsiChar; passlen: TIdC_SIZET; const salt: PByte; saltlen: TIdC_SIZET; N: TIdC_UINT64; r: TIdC_UINT64; p: TIdC_UINT64; maxmem: TIdC_UINT64; key: PByte; keylen: TIdC_SIZET): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + + function PKCS5_v2_scrypt_keyivgen(ctx: PEVP_CIPHER_CTX; const pass: PIdAnsiChar; passlen: TIdC_INT; param: PASN1_TYPE; const c: PEVP_CIPHER; const md: PEVP_MD; en_de: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + + procedure PKCS5_PBE_add cdecl; external CLibCrypto; + + function EVP_PBE_CipherInit(pbe_obj: PASN1_OBJECT; const pass: PIdAnsiChar; passlen: TIdC_INT; param: PASN1_TYPE; ctx: PEVP_CIPHER_CTX; en_de: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + + (* PBE type *) + function EVP_PBE_alg_add_type(pbe_type: TIdC_INT; pbe_nid: TIdC_INT; cipher_nid: TIdC_INT; md_nid: TIdC_INT; keygen: PEVP_PBE_KEYGEN): TIdC_INT cdecl; external CLibCrypto; + function EVP_PBE_alg_add(nid: TIdC_INT; const cipher: PEVP_CIPHER; const md: PEVP_MD; keygen: PEVP_PBE_KEYGEN): TIdC_INT cdecl; external CLibCrypto; + function EVP_PBE_find(type_: TIdC_INT; pbe_nid: TIdC_INT; pcnid: PIdC_INT; pmnid: PIdC_INT; pkeygen: PPEVP_PBE_KEYGEN): TIdC_INT cdecl; external CLibCrypto; + procedure EVP_PBE_cleanup cdecl; external CLibCrypto; + function EVP_PBE_get(ptype: PIdC_INT; ppbe_nid: PIdC_INT; num: TIdC_SIZET): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + + function EVP_PKEY_asn1_get_count: TIdC_INT cdecl; external CLibCrypto; + function EVP_PKEY_asn1_get0(idx: TIdC_INT): PEVP_PKEY_ASN1_METHOD cdecl; external CLibCrypto; + function EVP_PKEY_asn1_find(pe: PPENGINE; type_: TIdC_INT): PEVP_PKEY_ASN1_METHOD cdecl; external CLibCrypto; + function EVP_PKEY_asn1_find_str(pe: PPENGINE; const str: PIdAnsiChar; len: TIdC_INT): PEVP_PKEY_ASN1_METHOD cdecl; external CLibCrypto; + function EVP_PKEY_asn1_add0(const ameth: PEVP_PKEY_ASN1_METHOD): TIdC_INT cdecl; external CLibCrypto; + function EVP_PKEY_asn1_add_alias(to_: TIdC_INT; from: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function EVP_PKEY_asn1_get0_info(ppkey_id: PIdC_INT; pkey_base_id: PIdC_INT; ppkey_flags: PIdC_INT; const pinfo: PPIdAnsiChar; const ppem_str: PPIdAnsiChar; const ameth: PEVP_PKEY_ASN1_METHOD): TIdC_INT cdecl; external CLibCrypto; + + function EVP_PKEY_get0_asn1(const pkey: PEVP_PKEY): PEVP_PKEY_ASN1_METHOD cdecl; external CLibCrypto; + function EVP_PKEY_asn1_new(id: TIdC_INT; flags: TIdC_INT; const pem_str: PIdAnsiChar; const info: PIdAnsiChar): PEVP_PKEY_ASN1_METHOD cdecl; external CLibCrypto; + procedure EVP_PKEY_asn1_copy(dst: PEVP_PKEY_ASN1_METHOD; const src: PEVP_PKEY_ASN1_METHOD) cdecl; external CLibCrypto; + procedure EVP_PKEY_asn1_free(ameth: PEVP_PKEY_ASN1_METHOD) cdecl; external CLibCrypto; + + procedure EVP_PKEY_asn1_set_public(ameth: PEVP_PKEY_ASN1_METHOD; APub_decode: pub_decode; APub_encode: pub_encode; APub_cmd: pub_cmd; APub_print: pub_print; APkey_size: pkey_size; APkey_bits: pkey_bits) cdecl; external CLibCrypto; + procedure EVP_PKEY_asn1_set_private(ameth: PEVP_PKEY_ASN1_METHOD; APriv_decode: priv_decode; APriv_encode: priv_encode; APriv_print: priv_print) cdecl; external CLibCrypto; + procedure EVP_PKEY_asn1_set_param(ameth: PEVP_PKEY_ASN1_METHOD; AParam_decode: param_decode; AParam_encode: param_encode; AParam_missing: param_missing; AParam_copy: param_copy; AParam_cmp: param_cmp; AParam_print: param_print) cdecl; external CLibCrypto; + + procedure EVP_PKEY_asn1_set_free(ameth: PEVP_PKEY_ASN1_METHOD; APkey_free: pkey_free) cdecl; external CLibCrypto; + procedure EVP_PKEY_asn1_set_ctrl(ameth: PEVP_PKEY_ASN1_METHOD; APkey_ctrl: pkey_ctrl) cdecl; external CLibCrypto; + procedure EVP_PKEY_asn1_set_item(ameth: PEVP_PKEY_ASN1_METHOD; AItem_verify: item_verify; AItem_sign: item_sign) cdecl; external CLibCrypto; + + procedure EVP_PKEY_asn1_set_siginf(ameth: PEVP_PKEY_ASN1_METHOD; ASiginf_set: siginf_set) cdecl; external CLibCrypto; {introduced 1.1.0} + + procedure EVP_PKEY_asn1_set_check(ameth: PEVP_PKEY_ASN1_METHOD; APkey_check: pkey_check) cdecl; external CLibCrypto; {introduced 1.1.0} + + procedure EVP_PKEY_asn1_set_public_check(ameth: PEVP_PKEY_ASN1_METHOD; APkey_pub_check: pkey_pub_check) cdecl; external CLibCrypto; {introduced 1.1.0} + + procedure EVP_PKEY_asn1_set_param_check(ameth: PEVP_PKEY_ASN1_METHOD; APkey_param_check: pkey_param_check) cdecl; external CLibCrypto; {introduced 1.1.0} + + procedure EVP_PKEY_asn1_set_set_priv_key(ameth: PEVP_PKEY_ASN1_METHOD; ASet_priv_key: set_priv_key) cdecl; external CLibCrypto; {introduced 1.1.0} + procedure EVP_PKEY_asn1_set_set_pub_key(ameth: PEVP_PKEY_ASN1_METHOD; ASet_pub_key: set_pub_key) cdecl; external CLibCrypto; {introduced 1.1.0} + procedure EVP_PKEY_asn1_set_get_priv_key(ameth: PEVP_PKEY_ASN1_METHOD; AGet_priv_key: get_priv_key) cdecl; external CLibCrypto; {introduced 1.1.0} + procedure EVP_PKEY_asn1_set_get_pub_key(ameth: PEVP_PKEY_ASN1_METHOD; AGet_pub_key: get_pub_key) cdecl; external CLibCrypto; {introduced 1.1.0} + + procedure EVP_PKEY_asn1_set_security_bits(ameth: PEVP_PKEY_ASN1_METHOD; APkey_security_bits: pkey_security_bits) cdecl; external CLibCrypto; {introduced 1.1.0} + + function EVP_PKEY_meth_find(type_: TIdC_INT): PEVP_PKEY_METHOD cdecl; external CLibCrypto; + function EVP_PKEY_meth_new(id: TIdC_INT; flags: TIdC_INT): PEVP_PKEY_METHOD cdecl; external CLibCrypto; + procedure EVP_PKEY_meth_get0_info(ppkey_id: PIdC_INT; pflags: PIdC_INT; const meth: PEVP_PKEY_METHOD) cdecl; external CLibCrypto; + procedure EVP_PKEY_meth_copy(dst: PEVP_PKEY_METHOD; const src: PEVP_PKEY_METHOD) cdecl; external CLibCrypto; + procedure EVP_PKEY_meth_free(pmeth: PEVP_PKEY_METHOD) cdecl; external CLibCrypto; + function EVP_PKEY_meth_add0(const pmeth: PEVP_PKEY_METHOD): TIdC_INT cdecl; external CLibCrypto; + function EVP_PKEY_meth_remove(const pmeth: PEVP_PKEY_METHOD): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_PKEY_meth_get_count: TIdC_SIZET cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_PKEY_meth_get0(idx: TIdC_SIZET): PEVP_PKEY_METHOD cdecl; external CLibCrypto; {introduced 1.1.0} + + function EVP_PKEY_CTX_new(pkey: PEVP_PKEY; e: PENGINE): PEVP_PKEY_CTX cdecl; external CLibCrypto; + function EVP_PKEY_CTX_new_id(id: TIdC_INT; e: PENGINE): PEVP_PKEY_CTX cdecl; external CLibCrypto; + function EVP_PKEY_CTX_dup(ctx: PEVP_PKEY_CTX): PEVP_PKEY_CTX cdecl; external CLibCrypto; + procedure EVP_PKEY_CTX_free(ctx: PEVP_PKEY_CTX) cdecl; external CLibCrypto; + + function EVP_PKEY_CTX_ctrl(ctx: PEVP_PKEY_CTX; keytype: TIdC_INT; optype: TIdC_INT; cmd: TIdC_INT; p1: TIdC_INT; p2: Pointer): TIdC_INT cdecl; external CLibCrypto; + function EVP_PKEY_CTX_ctrl_str(ctx: PEVP_PKEY_CTX; const type_: PIdAnsiChar; const value: PIdAnsiChar): TIdC_INT cdecl; external CLibCrypto; + function EVP_PKEY_CTX_ctrl_uint64(ctx: PEVP_PKEY_CTX; keytype: TIdC_INT; optype: TIdC_INT; cmd: TIdC_INT; value: TIdC_UINT64): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + + function EVP_PKEY_CTX_str2ctrl(ctx: PEVP_PKEY_CTX; cmd: TIdC_INT; const str: PIdAnsiChar): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_PKEY_CTX_hex2ctrl(ctx: PEVP_PKEY_CTX; cmd: TIdC_INT; const hex: PIdAnsiChar): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + + function EVP_PKEY_CTX_md(ctx: PEVP_PKEY_CTX; optype: TIdC_INT; cmd: TIdC_INT; const md: PIdAnsiChar): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + + function EVP_PKEY_CTX_get_operation(ctx: PEVP_PKEY_CTX): TIdC_INT cdecl; external CLibCrypto; + procedure EVP_PKEY_CTX_set0_keygen_info(ctx: PEVP_PKEY_CTX; dat: PIdC_INT; datlen: TIdC_INT) cdecl; external CLibCrypto; + + function EVP_PKEY_new_mac_key(type_: TIdC_INT; e: PENGINE; const key: PByte; keylen: TIdC_INT): PEVP_PKEY cdecl; external CLibCrypto; + function EVP_PKEY_new_raw_private_key(type_: TIdC_INT; e: PENGINE; const priv: PByte; len: TIdC_SIZET): PEVP_PKEY cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_PKEY_new_raw_public_key(type_: TIdC_INT; e: PENGINE; const pub: PByte; len: TIdC_SIZET): PEVP_PKEY cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_PKEY_get_raw_private_key(const pkey: PEVP_PKEY; priv: PByte; len: PIdC_SIZET): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_PKEY_get_raw_public_key(const pkey: PEVP_PKEY; pub: PByte; len: PIdC_SIZET): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + + function EVP_PKEY_new_CMAC_key(e: PENGINE; const priv: PByte; len: TIdC_SIZET; const cipher: PEVP_CIPHER): PEVP_PKEY cdecl; external CLibCrypto; {introduced 1.1.0} + + procedure EVP_PKEY_CTX_set_data(ctx: PEVP_PKEY_CTX; data: Pointer) cdecl; external CLibCrypto; + function EVP_PKEY_CTX_get_data(ctx: PEVP_PKEY_CTX): Pointer cdecl; external CLibCrypto; + function EVP_PKEY_CTX_get0_pkey(ctx: PEVP_PKEY_CTX): PEVP_PKEY cdecl; external CLibCrypto; + + function EVP_PKEY_CTX_get0_peerkey(ctx: PEVP_PKEY_CTX): PEVP_PKEY cdecl; external CLibCrypto; + + procedure EVP_PKEY_CTX_set_app_data(ctx: PEVP_PKEY_CTX; data: Pointer) cdecl; external CLibCrypto; + function EVP_PKEY_CTX_get_app_data(ctx: PEVP_PKEY_CTX): Pointer cdecl; external CLibCrypto; + + function EVP_PKEY_sign_init(ctx: PEVP_PKEY_CTX): TIdC_INT cdecl; external CLibCrypto; + function EVP_PKEY_sign(ctx: PEVP_PKEY_CTX; sig: PByte; siglen: PIdC_SIZET; const tbs: PByte; tbslen: TIdC_SIZET): TIdC_INT cdecl; external CLibCrypto; + function EVP_PKEY_verify_init(ctx: PEVP_PKEY_CTX): TIdC_INT cdecl; external CLibCrypto; + function EVP_PKEY_verify(ctx: PEVP_PKEY_CTX; const sig: PByte; siglen: TIdC_SIZET; const tbs: PByte; tbslen: TIdC_SIZET): TIdC_INT cdecl; external CLibCrypto; + function EVP_PKEY_verify_recover_init(ctx: PEVP_PKEY_CTX): TIdC_INT cdecl; external CLibCrypto; + function EVP_PKEY_verify_recover(ctx: PEVP_PKEY_CTX; rout: PByte; routlen: PIdC_SIZET; const sig: PByte; siglen: TIdC_SIZET): TIdC_INT cdecl; external CLibCrypto; + function EVP_PKEY_encrypt_init(ctx: PEVP_PKEY_CTX): TIdC_INT cdecl; external CLibCrypto; + function EVP_PKEY_encrypt(ctx: PEVP_PKEY_CTX; out_: PByte; outlen: PIdC_SIZET; const in_: PByte; inlen: TIdC_SIZET): TIdC_INT cdecl; external CLibCrypto; + function EVP_PKEY_decrypt_init(ctx: PEVP_PKEY_CTX): TIdC_INT cdecl; external CLibCrypto; + function EVP_PKEY_decrypt(ctx: PEVP_PKEY_CTX; out_: PByte; outlen: PIdC_SIZET; const in_: PByte; inlen: TIdC_SIZET): TIdC_INT cdecl; external CLibCrypto; + + function EVP_PKEY_derive_init(ctx: PEVP_PKEY_CTX): TIdC_INT cdecl; external CLibCrypto; + function EVP_PKEY_derive_set_peer(ctx: PEVP_PKEY_CTX; peer: PEVP_PKEY): TIdC_INT cdecl; external CLibCrypto; + function EVP_PKEY_derive(ctx: PEVP_PKEY_CTX; key: PByte; keylen: PIdC_SIZET): TIdC_INT cdecl; external CLibCrypto; + + function EVP_PKEY_paramgen_init(ctx: PEVP_PKEY_CTX): TIdC_INT cdecl; external CLibCrypto; + function EVP_PKEY_paramgen(ctx: PEVP_PKEY_CTX; ppkey: PPEVP_PKEY): TIdC_INT cdecl; external CLibCrypto; + function EVP_PKEY_keygen_init(ctx: PEVP_PKEY_CTX): TIdC_INT cdecl; external CLibCrypto; + function EVP_PKEY_keygen(ctx: PEVP_PKEY_CTX; ppkey: PPEVP_PKEY): TIdC_INT cdecl; external CLibCrypto; + function EVP_PKEY_check(ctx: PEVP_PKEY_CTX): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_PKEY_public_check(ctx: PEVP_PKEY_CTX): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function EVP_PKEY_param_check(ctx: PEVP_PKEY_CTX): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + + procedure EVP_PKEY_CTX_set_cb(ctx: PEVP_PKEY_CTX; cb: EVP_PKEY_gen_cb) cdecl; external CLibCrypto; + function EVP_PKEY_CTX_get_cb(ctx: PEVP_PKEY_CTX): EVP_PKEY_gen_cb cdecl; external CLibCrypto; + + function EVP_PKEY_CTX_get_keygen_info(ctx: PEVP_PKEY_CTX; idx: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + + procedure EVP_PKEY_meth_set_init(pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_init: EVP_PKEY_meth_init) cdecl; external CLibCrypto; + + procedure EVP_PKEY_meth_set_copy(pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_copy_cb: EVP_PKEY_meth_copy_cb) cdecl; external CLibCrypto; + + procedure EVP_PKEY_meth_set_cleanup(pmeth: PEVP_PKEY_METHOD; PEVP_PKEY_meth_cleanup: EVP_PKEY_meth_cleanup) cdecl; external CLibCrypto; + + procedure EVP_PKEY_meth_set_paramgen(pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_paramgen_init: EVP_PKEY_meth_paramgen_init; AEVP_PKEY_meth_paramgen: EVP_PKEY_meth_paramgen_init) cdecl; external CLibCrypto; + + procedure EVP_PKEY_meth_set_keygen(pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_keygen_init: EVP_PKEY_meth_keygen_init; AEVP_PKEY_meth_keygen: EVP_PKEY_meth_keygen) cdecl; external CLibCrypto; + + procedure EVP_PKEY_meth_set_sign(pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_sign_init: EVP_PKEY_meth_sign_init; AEVP_PKEY_meth_sign: EVP_PKEY_meth_sign) cdecl; external CLibCrypto; + + procedure EVP_PKEY_meth_set_verify(pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_verify_init: EVP_PKEY_meth_verify_init; AEVP_PKEY_meth_verify: EVP_PKEY_meth_verify_init) cdecl; external CLibCrypto; + + procedure EVP_PKEY_meth_set_verify_recover(pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_verify_recover_init: EVP_PKEY_meth_verify_recover_init; AEVP_PKEY_meth_verify_recover: EVP_PKEY_meth_verify_recover_init) cdecl; external CLibCrypto; + + procedure EVP_PKEY_meth_set_signctx(pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_signctx_init: EVP_PKEY_meth_signctx_init; AEVP_PKEY_meth_signctx: EVP_PKEY_meth_signctx) cdecl; external CLibCrypto; + + procedure EVP_PKEY_meth_set_verifyctx(pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_verifyctx_init: EVP_PKEY_meth_verifyctx_init; AEVP_PKEY_meth_verifyctx: EVP_PKEY_meth_verifyctx) cdecl; external CLibCrypto; + + procedure EVP_PKEY_meth_set_encrypt(pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_encrypt_init: EVP_PKEY_meth_encrypt_init; AEVP_PKEY_meth_encrypt: EVP_PKEY_meth_encrypt) cdecl; external CLibCrypto; + + procedure EVP_PKEY_meth_set_decrypt(pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_decrypt_init: EVP_PKEY_meth_decrypt_init; AEVP_PKEY_meth_decrypt: EVP_PKEY_meth_decrypt) cdecl; external CLibCrypto; + + procedure EVP_PKEY_meth_set_derive(pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_derive_init: EVP_PKEY_meth_derive_init; AEVP_PKEY_meth_derive: EVP_PKEY_meth_derive) cdecl; external CLibCrypto; + + procedure EVP_PKEY_meth_set_ctrl(pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_ctrl: EVP_PKEY_meth_ctrl; AEVP_PKEY_meth_ctrl_str: EVP_PKEY_meth_ctrl_str) cdecl; external CLibCrypto; + + procedure EVP_PKEY_meth_set_digestsign(pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_digestsign: EVP_PKEY_meth_digestsign) cdecl; external CLibCrypto; {introduced 1.1.0} + + procedure EVP_PKEY_meth_set_digestverify(pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_digestverify: EVP_PKEY_meth_digestverify) cdecl; external CLibCrypto; {introduced 1.1.0} + + procedure EVP_PKEY_meth_set_check(pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_check: EVP_PKEY_meth_check) cdecl; external CLibCrypto; {introduced 1.1.0} + + procedure EVP_PKEY_meth_set_public_check(pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_public_check: EVP_PKEY_meth_public_check) cdecl; external CLibCrypto; {introduced 1.1.0} + + procedure EVP_PKEY_meth_set_param_check(pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_param_check: EVP_PKEY_meth_param_check) cdecl; external CLibCrypto; {introduced 1.1.0} + + procedure EVP_PKEY_meth_set_digest_custom(pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_digest_custom: EVP_PKEY_meth_digest_custom) cdecl; external CLibCrypto; {introduced 1.1.0} + + procedure EVP_PKEY_meth_get_init(const pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_init: PEVP_PKEY_meth_init) cdecl; external CLibCrypto; + + procedure EVP_PKEY_meth_get_copy(const pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_copy: PEVP_PKEY_meth_copy) cdecl; external CLibCrypto; + + procedure EVP_PKEY_meth_get_cleanup(const pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_cleanup: PEVP_PKEY_meth_cleanup) cdecl; external CLibCrypto; + + procedure EVP_PKEY_meth_get_paramgen(const pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_paramgen_init: EVP_PKEY_meth_paramgen_init; AEVP_PKEY_meth_paramgen: PEVP_PKEY_meth_paramgen) cdecl; external CLibCrypto; + + procedure EVP_PKEY_meth_get_keygen(const pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_keygen_init: EVP_PKEY_meth_keygen_init; AEVP_PKEY_meth_keygen: PEVP_PKEY_meth_keygen) cdecl; external CLibCrypto; + + procedure EVP_PKEY_meth_get_sign(const pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_sign_init: PEVP_PKEY_meth_sign_init; AEVP_PKEY_meth_sign: PEVP_PKEY_meth_sign) cdecl; external CLibCrypto; + + procedure EVP_PKEY_meth_get_verify(pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_verify_init: PEVP_PKEY_meth_verify_init; AEVP_PKEY_meth_verify: PEVP_PKEY_meth_verify_init) cdecl; external CLibCrypto; + + procedure EVP_PKEY_meth_get_verify_recover(pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_verify_recover_init: PEVP_PKEY_meth_verify_recover_init; AEVP_PKEY_meth_verify_recover: PEVP_PKEY_meth_verify_recover_init) cdecl; external CLibCrypto; + + procedure EVP_PKEY_meth_get_signctx(pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_signctx_init: PEVP_PKEY_meth_signctx_init; AEVP_PKEY_meth_signctx: PEVP_PKEY_meth_signctx) cdecl; external CLibCrypto; + + procedure EVP_PKEY_meth_get_verifyctx(pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_verifyctx_init: PEVP_PKEY_meth_verifyctx_init; AEVP_PKEY_meth_verifyctx: PEVP_PKEY_meth_verifyctx) cdecl; external CLibCrypto; + + procedure EVP_PKEY_meth_get_encrypt(pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_encrypt_init: PEVP_PKEY_meth_encrypt_init; AEVP_PKEY_meth_encrypt: PEVP_PKEY_meth_encrypt) cdecl; external CLibCrypto; + + procedure EVP_PKEY_meth_get_decrypt(pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_decrypt_init: PEVP_PKEY_meth_decrypt_init; AEVP_PKEY_meth_decrypt: PEVP_PKEY_meth_decrypt) cdecl; external CLibCrypto; + + procedure EVP_PKEY_meth_get_derive(pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_derive_init: PEVP_PKEY_meth_derive_init; AEVP_PKEY_meth_derive: PEVP_PKEY_meth_derive) cdecl; external CLibCrypto; + + procedure EVP_PKEY_meth_get_ctrl(pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_ctrl: PEVP_PKEY_meth_ctrl; AEVP_PKEY_meth_ctrl_str: PEVP_PKEY_meth_ctrl_str) cdecl; external CLibCrypto; + + procedure EVP_PKEY_meth_get_digestsign(pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_digestsign: PEVP_PKEY_meth_digestsign) cdecl; external CLibCrypto; {introduced 1.1.0} + + procedure EVP_PKEY_meth_get_digestverify(pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_digestverify: PEVP_PKEY_meth_digestverify) cdecl; external CLibCrypto; {introduced 1.1.0} + + procedure EVP_PKEY_meth_get_check(pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_check: PEVP_PKEY_meth_check) cdecl; external CLibCrypto; {introduced 1.1.0} + + procedure EVP_PKEY_meth_get_public_check(pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_public_check: PEVP_PKEY_meth_public_check) cdecl; external CLibCrypto; {introduced 1.1.0} + + procedure EVP_PKEY_meth_get_param_check(pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_param_check: PEVP_PKEY_meth_param_check) cdecl; external CLibCrypto; {introduced 1.1.0} + + procedure EVP_PKEY_meth_get_digest_custom(pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_digest_custom: PEVP_PKEY_meth_digest_custom) cdecl; external CLibCrypto; {introduced 1.1.0} + + procedure EVP_add_alg_module cdecl; external CLibCrypto; + + + + +function EVP_PKEY_assign_RSA(pkey: PEVP_PKEY; rsa: Pointer): TIdC_INT; {removed 1.0.0} +function EVP_PKEY_assign_DSA(pkey: PEVP_PKEY; dsa: Pointer): TIdC_INT; {removed 1.0.0} +function EVP_PKEY_assign_DH(pkey: PEVP_PKEY; dh: Pointer): TIdC_INT; {removed 1.0.0} +function EVP_PKEY_assign_EC_KEY(pkey: PEVP_PKEY; eckey: Pointer): TIdC_INT; {removed 1.0.0} +function EVP_PKEY_assign_SIPHASH(pkey: PEVP_PKEY; shkey: Pointer): TIdC_INT; {removed 1.0.0} +function EVP_PKEY_assign_POLY1305(pkey: PEVP_PKEY; polykey: Pointer): TIdC_INT; {removed 1.0.0} + procedure BIO_set_md(v1: PBIO; const md: PEVP_MD); {removed 1.0.0} + function EVP_md2: PEVP_MD; {removed 1.1.0 allow_nil} + function EVP_md4: PEVP_MD; {removed 1.1.0 allow_nil} + function EVP_md5: PEVP_MD; {removed 1.1.0 allow_nil} + procedure OpenSSL_add_all_ciphers; {removed 1.1.0} + procedure OpenSSL_add_all_digests; {removed 1.1.0} + procedure EVP_cleanup; {removed 1.1.0} +{$ENDIF} + +implementation + +uses + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + classes, + IdSSLOpenSSLLoader, + {$ENDIF} + IdSSLOpenSSLExceptionHandlers, + IdResourceStringsOpenSSL, + IdOpenSSLHeaders_crypto; + +const + EVP_MD_meth_new_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_MD_meth_dup_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_MD_meth_free_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_MD_meth_set_input_blocksize_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_MD_meth_set_result_size_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_MD_meth_set_app_datasize_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_MD_meth_set_flags_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_MD_meth_set_init_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_MD_meth_set_update_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_MD_meth_set_final_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_MD_meth_set_copy_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_MD_meth_set_cleanup_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_MD_meth_set_ctrl_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_MD_meth_get_input_blocksize_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_MD_meth_get_result_size_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_MD_meth_get_app_datasize_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_MD_meth_get_flags_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_MD_meth_get_init_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_MD_meth_get_update_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_MD_meth_get_final_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_MD_meth_get_copy_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_MD_meth_get_cleanup_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_MD_meth_get_ctrl_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_CIPHER_meth_new_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_CIPHER_meth_dup_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_CIPHER_meth_free_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_CIPHER_meth_set_iv_length_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_CIPHER_meth_set_flags_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_CIPHER_meth_set_impl_ctx_size_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_CIPHER_meth_set_init_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_CIPHER_meth_set_do_cipher_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_CIPHER_meth_set_cleanup_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_CIPHER_meth_set_set_asn1_params_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_CIPHER_meth_set_get_asn1_params_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_CIPHER_meth_set_ctrl_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_CIPHER_meth_get_init_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_CIPHER_meth_get_do_cipher_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_CIPHER_meth_get_cleanup_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_CIPHER_meth_get_set_asn1_params_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_CIPHER_meth_get_get_asn1_params_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_CIPHER_meth_get_ctrl_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_MD_CTX_update_fn_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_MD_CTX_set_update_fn_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_MD_CTX_pkey_ctx_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_MD_CTX_set_pkey_ctx_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_MD_CTX_md_data_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_CIPHER_impl_ctx_size_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_CIPHER_CTX_encrypting_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_CIPHER_CTX_iv_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_CIPHER_CTX_original_iv_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_CIPHER_CTX_iv_noconst_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_CIPHER_CTX_buf_noconst_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_CIPHER_CTX_num_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_CIPHER_CTX_set_num_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_CIPHER_CTX_get_cipher_data_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_CIPHER_CTX_set_cipher_data_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_MD_CTX_ctrl_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_MD_CTX_new_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_MD_CTX_reset_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_MD_CTX_free_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_DigestFinalXOF_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_DigestSign_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_DigestVerify_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_ENCODE_CTX_new_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_ENCODE_CTX_free_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_ENCODE_CTX_copy_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_ENCODE_CTX_num_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_CIPHER_CTX_reset_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_md5_sha1_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_sha512_224_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_sha512_256_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_sha3_224_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_sha3_256_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_sha3_384_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_sha3_512_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_shake128_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_shake256_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_aes_128_wrap_pad_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_aes_128_ocb_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_aes_192_wrap_pad_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_aes_192_ocb_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_aes_256_wrap_pad_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_aes_256_ocb_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_aria_128_ecb_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_aria_128_cbc_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_aria_128_cfb1_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_aria_128_cfb8_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_aria_128_cfb128_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_aria_128_ctr_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_aria_128_ofb_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_aria_128_gcm_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_aria_128_ccm_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_aria_192_ecb_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_aria_192_cbc_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_aria_192_cfb1_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_aria_192_cfb8_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_aria_192_cfb128_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_aria_192_ctr_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_aria_192_ofb_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_aria_192_gcm_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_aria_192_ccm_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_aria_256_ecb_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_aria_256_cbc_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_aria_256_cfb1_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_aria_256_cfb8_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_aria_256_cfb128_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_aria_256_ctr_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_aria_256_ofb_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_aria_256_gcm_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_aria_256_ccm_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_camellia_128_ctr_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_camellia_192_ctr_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_camellia_256_ctr_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_chacha20_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_chacha20_poly1305_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_sm4_ecb_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_sm4_cbc_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_sm4_cfb128_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_sm4_ofb_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_sm4_ctr_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_PKEY_security_bits_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_PKEY_set_alias_type_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_PKEY_set1_engine_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_PKEY_get0_engine_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_PKEY_get0_hmac_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_PKEY_get0_poly1305_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_PKEY_get0_siphash_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_PKEY_get0_RSA_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_PKEY_get0_DSA_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_PKEY_get0_DH_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_PKEY_get0_EC_KEY_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_PKEY_up_ref_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_PKEY_set1_tls_encodedpoint_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_PKEY_get1_tls_encodedpoint_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_PBE_scrypt_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + PKCS5_v2_scrypt_keyivgen_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_PBE_get_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_PKEY_asn1_set_siginf_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_PKEY_asn1_set_check_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_PKEY_asn1_set_public_check_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_PKEY_asn1_set_param_check_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_PKEY_asn1_set_set_priv_key_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_PKEY_asn1_set_set_pub_key_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_PKEY_asn1_set_get_priv_key_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_PKEY_asn1_set_get_pub_key_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_PKEY_asn1_set_security_bits_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_PKEY_meth_remove_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_PKEY_meth_get_count_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_PKEY_meth_get0_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_PKEY_CTX_ctrl_uint64_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_PKEY_CTX_str2ctrl_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_PKEY_CTX_hex2ctrl_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_PKEY_CTX_md_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_PKEY_new_raw_private_key_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_PKEY_new_raw_public_key_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_PKEY_get_raw_private_key_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_PKEY_get_raw_public_key_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_PKEY_new_CMAC_key_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_PKEY_check_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_PKEY_public_check_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_PKEY_param_check_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_PKEY_meth_set_digestsign_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_PKEY_meth_set_digestverify_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_PKEY_meth_set_check_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_PKEY_meth_set_public_check_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_PKEY_meth_set_param_check_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_PKEY_meth_set_digest_custom_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_PKEY_meth_get_digestsign_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_PKEY_meth_get_digestverify_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_PKEY_meth_get_check_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_PKEY_meth_get_public_check_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_PKEY_meth_get_param_check_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_PKEY_meth_get_digest_custom_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_PKEY_assign_RSA_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + EVP_PKEY_assign_DSA_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + EVP_PKEY_assign_DH_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + EVP_PKEY_assign_EC_KEY_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + EVP_PKEY_assign_SIPHASH_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + EVP_PKEY_assign_POLY1305_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + EVP_MD_type_removed = (byte(3) shl 8 or byte(0)) shl 8 or byte(0); + EVP_MD_pkey_type_removed = (byte(3) shl 8 or byte(0)) shl 8 or byte(0); + EVP_MD_size_removed = (byte(3) shl 8 or byte(0)) shl 8 or byte(0); + EVP_MD_block_size_removed = (byte(3) shl 8 or byte(0)) shl 8 or byte(0); + EVP_MD_flags_removed = (byte(3) shl 8 or byte(0)) shl 8 or byte(0); + EVP_MD_CTX_pkey_ctx_removed = (byte(3) shl 8 or byte(0)) shl 8 or byte(0); + EVP_MD_CTX_md_data_removed = (byte(3) shl 8 or byte(0)) shl 8 or byte(0); + EVP_CIPHER_nid_removed = (byte(3) shl 8 or byte(0)) shl 8 or byte(0); + EVP_CIPHER_block_size_removed = (byte(3) shl 8 or byte(0)) shl 8 or byte(0); + EVP_CIPHER_key_length_removed = (byte(3) shl 8 or byte(0)) shl 8 or byte(0); + EVP_CIPHER_iv_length_removed = (byte(3) shl 8 or byte(0)) shl 8 or byte(0); + EVP_CIPHER_flags_removed = (byte(3) shl 8 or byte(0)) shl 8 or byte(0); + EVP_CIPHER_CTX_encrypting_removed = (byte(3) shl 8 or byte(0)) shl 8 or byte(0); + EVP_CIPHER_CTX_nid_removed = (byte(3) shl 8 or byte(0)) shl 8 or byte(0); + EVP_CIPHER_CTX_block_size_removed = (byte(3) shl 8 or byte(0)) shl 8 or byte(0); + EVP_CIPHER_CTX_key_length_removed = (byte(3) shl 8 or byte(0)) shl 8 or byte(0); + EVP_CIPHER_CTX_iv_length_removed = (byte(3) shl 8 or byte(0)) shl 8 or byte(0); + EVP_CIPHER_CTX_num_removed = (byte(3) shl 8 or byte(0)) shl 8 or byte(0); + BIO_set_md_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + EVP_MD_CTX_init_removed = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_MD_CTX_cleanup_removed = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_md2_removed = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_md4_removed = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_md5_removed = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_PKEY_id_removed = (byte(3) shl 8 or byte(0)) shl 8 or byte(0); + EVP_PKEY_base_id_removed = (byte(3) shl 8 or byte(0)) shl 8 or byte(0); + EVP_PKEY_bits_removed = (byte(3) shl 8 or byte(0)) shl 8 or byte(0); + EVP_PKEY_security_bits_removed = (byte(3) shl 8 or byte(0)) shl 8 or byte(0); + EVP_PKEY_size_removed = (byte(3) shl 8 or byte(0)) shl 8 or byte(0); + EVP_PKEY_set_alias_type_removed = (byte(3) shl 8 or byte(0)) shl 8 or byte(0); + EVP_PKEY_set1_tls_encodedpoint_removed = (byte(3) shl 8 or byte(0)) shl 8 or byte(0); + EVP_PKEY_get1_tls_encodedpoint_removed = (byte(3) shl 8 or byte(0)) shl 8 or byte(0); + EVP_CIPHER_type_removed = (byte(3) shl 8 or byte(0)) shl 8 or byte(0); + OpenSSL_add_all_ciphers_removed = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + OpenSSL_add_all_digests_removed = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + EVP_cleanup_removed = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + + +//# define EVP_PKEY_assign_RSA(pkey,rsa) EVP_PKEY_assign((pkey),EVP_PKEY_RSA, (char *)(rsa)) +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +const + EVP_PKEY_assign_RSA_procname = 'EVP_PKEY_assign_RSA'; {removed 1.0.0} + EVP_PKEY_assign_DSA_procname = 'EVP_PKEY_assign_DSA'; {removed 1.0.0} + EVP_PKEY_assign_DH_procname = 'EVP_PKEY_assign_DH'; {removed 1.0.0} + EVP_PKEY_assign_EC_KEY_procname = 'EVP_PKEY_assign_EC_KEY'; {removed 1.0.0} + EVP_PKEY_assign_SIPHASH_procname = 'EVP_PKEY_assign_SIPHASH'; {removed 1.0.0} + EVP_PKEY_assign_POLY1305_procname = 'EVP_PKEY_assign_POLY1305'; {removed 1.0.0} + + EVP_MD_meth_new_procname = 'EVP_MD_meth_new'; {introduced 1.1.0} + EVP_MD_meth_dup_procname = 'EVP_MD_meth_dup'; {introduced 1.1.0} + EVP_MD_meth_free_procname = 'EVP_MD_meth_free'; {introduced 1.1.0} + + EVP_MD_meth_set_input_blocksize_procname = 'EVP_MD_meth_set_input_blocksize'; {introduced 1.1.0} + EVP_MD_meth_set_result_size_procname = 'EVP_MD_meth_set_result_size'; {introduced 1.1.0} + EVP_MD_meth_set_app_datasize_procname = 'EVP_MD_meth_set_app_datasize'; {introduced 1.1.0} + EVP_MD_meth_set_flags_procname = 'EVP_MD_meth_set_flags'; {introduced 1.1.0} + EVP_MD_meth_set_init_procname = 'EVP_MD_meth_set_init'; {introduced 1.1.0} + EVP_MD_meth_set_update_procname = 'EVP_MD_meth_set_update'; {introduced 1.1.0} + EVP_MD_meth_set_final_procname = 'EVP_MD_meth_set_final'; {introduced 1.1.0} + EVP_MD_meth_set_copy_procname = 'EVP_MD_meth_set_copy'; {introduced 1.1.0} + EVP_MD_meth_set_cleanup_procname = 'EVP_MD_meth_set_cleanup'; {introduced 1.1.0} + EVP_MD_meth_set_ctrl_procname = 'EVP_MD_meth_set_ctrl'; {introduced 1.1.0} + + EVP_MD_meth_get_input_blocksize_procname = 'EVP_MD_meth_get_input_blocksize'; {introduced 1.1.0} + EVP_MD_meth_get_result_size_procname = 'EVP_MD_meth_get_result_size'; {introduced 1.1.0} + EVP_MD_meth_get_app_datasize_procname = 'EVP_MD_meth_get_app_datasize'; {introduced 1.1.0} + EVP_MD_meth_get_flags_procname = 'EVP_MD_meth_get_flags'; {introduced 1.1.0} + EVP_MD_meth_get_init_procname = 'EVP_MD_meth_get_init'; {introduced 1.1.0} + EVP_MD_meth_get_update_procname = 'EVP_MD_meth_get_update'; {introduced 1.1.0} + EVP_MD_meth_get_final_procname = 'EVP_MD_meth_get_final'; {introduced 1.1.0} + EVP_MD_meth_get_copy_procname = 'EVP_MD_meth_get_copy'; {introduced 1.1.0} + EVP_MD_meth_get_cleanup_procname = 'EVP_MD_meth_get_cleanup'; {introduced 1.1.0} + EVP_MD_meth_get_ctrl_procname = 'EVP_MD_meth_get_ctrl'; {introduced 1.1.0} + + EVP_CIPHER_meth_new_procname = 'EVP_CIPHER_meth_new'; {introduced 1.1.0} + EVP_CIPHER_meth_dup_procname = 'EVP_CIPHER_meth_dup'; {introduced 1.1.0} + EVP_CIPHER_meth_free_procname = 'EVP_CIPHER_meth_free'; {introduced 1.1.0} + + EVP_CIPHER_meth_set_iv_length_procname = 'EVP_CIPHER_meth_set_iv_length'; {introduced 1.1.0} + EVP_CIPHER_meth_set_flags_procname = 'EVP_CIPHER_meth_set_flags'; {introduced 1.1.0} + EVP_CIPHER_meth_set_impl_ctx_size_procname = 'EVP_CIPHER_meth_set_impl_ctx_size'; {introduced 1.1.0} + EVP_CIPHER_meth_set_init_procname = 'EVP_CIPHER_meth_set_init'; {introduced 1.1.0} + EVP_CIPHER_meth_set_do_cipher_procname = 'EVP_CIPHER_meth_set_do_cipher'; {introduced 1.1.0} + EVP_CIPHER_meth_set_cleanup_procname = 'EVP_CIPHER_meth_set_cleanup'; {introduced 1.1.0} + EVP_CIPHER_meth_set_set_asn1_params_procname = 'EVP_CIPHER_meth_set_set_asn1_params'; {introduced 1.1.0} + EVP_CIPHER_meth_set_get_asn1_params_procname = 'EVP_CIPHER_meth_set_get_asn1_params'; {introduced 1.1.0} + EVP_CIPHER_meth_set_ctrl_procname = 'EVP_CIPHER_meth_set_ctrl'; {introduced 1.1.0} + EVP_CIPHER_meth_get_init_procname = 'EVP_CIPHER_meth_get_init'; {introduced 1.1.0} + EVP_CIPHER_meth_get_do_cipher_procname = 'EVP_CIPHER_meth_get_do_cipher'; {introduced 1.1.0} + EVP_CIPHER_meth_get_cleanup_procname = 'EVP_CIPHER_meth_get_cleanup'; {introduced 1.1.0} + EVP_CIPHER_meth_get_set_asn1_params_procname = 'EVP_CIPHER_meth_get_set_asn1_params'; {introduced 1.1.0} + EVP_CIPHER_meth_get_get_asn1_params_procname = 'EVP_CIPHER_meth_get_get_asn1_params'; {introduced 1.1.0} + EVP_CIPHER_meth_get_ctrl_procname = 'EVP_CIPHER_meth_get_ctrl'; {introduced 1.1.0} + + /// Add some extra combinations /// + //# define EVP_get_digestbynid(a) EVP_get_digestbyname(OBJ_nid2sn(a)); + //# define EVP_get_digestbyobj(a) EVP_get_digestbynid(OBJ_obj2nid(a)); + //# define EVP_get_cipherbynid(a) EVP_get_cipherbyname(OBJ_nid2sn(a)); + //# define EVP_get_cipherbyobj(a) EVP_get_cipherbynid(OBJ_obj2nid(a)); + + EVP_MD_type_procname = 'EVP_MD_type'; {removed 3.0.0} + //# define EVP_MD_nid(e) EVP_MD_type(e) + //# define EVP_MD_name(e) OBJ_nid2sn(EVP_MD_nid(e)) + EVP_MD_pkey_type_procname = 'EVP_MD_pkey_type'; {removed 3.0.0} + EVP_MD_size_procname = 'EVP_MD_size'; {removed 3.0.0} + EVP_MD_block_size_procname = 'EVP_MD_block_size'; {removed 3.0.0} + EVP_MD_flags_procname = 'EVP_MD_flags'; {removed 3.0.0} + + EVP_MD_CTX_md_procname = 'EVP_MD_CTX_md'; + EVP_MD_CTX_update_fn_procname = 'EVP_MD_CTX_update_fn'; {introduced 1.1.0} + EVP_MD_CTX_set_update_fn_procname = 'EVP_MD_CTX_set_update_fn'; {introduced 1.1.0} + // EVP_MD_CTX_size(e) EVP_MD_size(EVP_MD_CTX_md(e)) + // EVP_MD_CTX_block_size(e) EVP_MD_block_size(EVP_MD_CTX_md(e)) + // EVP_MD_CTX_type(e) EVP_MD_type(EVP_MD_CTX_md(e)) + EVP_MD_CTX_pkey_ctx_procname = 'EVP_MD_CTX_pkey_ctx'; {introduced 1.1.0 removed 3.0.0} + EVP_MD_CTX_set_pkey_ctx_procname = 'EVP_MD_CTX_set_pkey_ctx'; {introduced 1.1.0} + EVP_MD_CTX_md_data_procname = 'EVP_MD_CTX_md_data'; {introduced 1.1.0 removed 3.0.0} + + EVP_CIPHER_nid_procname = 'EVP_CIPHER_nid'; {removed 3.0.0} + //# define EVP_CIPHER_name(e) OBJ_nid2sn(EVP_CIPHER_nid(e)) + EVP_CIPHER_block_size_procname = 'EVP_CIPHER_block_size'; {removed 3.0.0} + EVP_CIPHER_impl_ctx_size_procname = 'EVP_CIPHER_impl_ctx_size'; {introduced 1.1.0} + EVP_CIPHER_key_length_procname = 'EVP_CIPHER_key_length'; {removed 3.0.0} + EVP_CIPHER_iv_length_procname = 'EVP_CIPHER_iv_length'; {removed 3.0.0} + EVP_CIPHER_flags_procname = 'EVP_CIPHER_flags'; {removed 3.0.0} + //# define EVP_CIPHER_mode(e) (EVP_CIPHER_flags(e) & EVP_CIPH_MODE) + + EVP_CIPHER_CTX_cipher_procname = 'EVP_CIPHER_CTX_cipher'; + EVP_CIPHER_CTX_encrypting_procname = 'EVP_CIPHER_CTX_encrypting'; {introduced 1.1.0 removed 3.0.0} + EVP_CIPHER_CTX_nid_procname = 'EVP_CIPHER_CTX_nid'; {removed 3.0.0} + EVP_CIPHER_CTX_block_size_procname = 'EVP_CIPHER_CTX_block_size'; {removed 3.0.0} + EVP_CIPHER_CTX_key_length_procname = 'EVP_CIPHER_CTX_key_length'; {removed 3.0.0} + EVP_CIPHER_CTX_iv_length_procname = 'EVP_CIPHER_CTX_iv_length'; {removed 3.0.0} + EVP_CIPHER_CTX_iv_procname = 'EVP_CIPHER_CTX_iv'; {introduced 1.1.0} + EVP_CIPHER_CTX_original_iv_procname = 'EVP_CIPHER_CTX_original_iv'; {introduced 1.1.0} + EVP_CIPHER_CTX_iv_noconst_procname = 'EVP_CIPHER_CTX_iv_noconst'; {introduced 1.1.0} + EVP_CIPHER_CTX_buf_noconst_procname = 'EVP_CIPHER_CTX_buf_noconst'; {introduced 1.1.0} + EVP_CIPHER_CTX_num_procname = 'EVP_CIPHER_CTX_num'; {introduced 1.1.0 removed 3.0.0} + EVP_CIPHER_CTX_set_num_procname = 'EVP_CIPHER_CTX_set_num'; {introduced 1.1.0} + EVP_CIPHER_CTX_copy_procname = 'EVP_CIPHER_CTX_copy'; + EVP_CIPHER_CTX_get_app_data_procname = 'EVP_CIPHER_CTX_get_app_data'; + EVP_CIPHER_CTX_set_app_data_procname = 'EVP_CIPHER_CTX_set_app_data'; + EVP_CIPHER_CTX_get_cipher_data_procname = 'EVP_CIPHER_CTX_get_cipher_data'; {introduced 1.1.0} + EVP_CIPHER_CTX_set_cipher_data_procname = 'EVP_CIPHER_CTX_set_cipher_data'; {introduced 1.1.0} + + //# define EVP_CIPHER_CTX_type(c) EVP_CIPHER_type(EVP_CIPHER_CTX_cipher(c)) + //# if OPENSSL_API_COMPAT < 0x10100000L + //# define EVP_CIPHER_CTX_flags(c) EVP_CIPHER_flags(EVP_CIPHER_CTX_cipher(c)) + //# endif + //# define EVP_CIPHER_CTX_mode(c) EVP_CIPHER_mode(EVP_CIPHER_CTX_cipher(c)) + // + //# define EVP_ENCODE_LENGTH(l) ((((l)+2)/3*4)+((l)/48+1)*2+80) + //# define EVP_DECODE_LENGTH(l) (((l)+3)/4*3+80) + // + //# define EVP_SignInit_ex(a;b;c) EVP_DigestInit_ex(a;b;c) + //# define EVP_SignInit(a;b) EVP_DigestInit(a;b) + //# define EVP_SignUpdate(a;b;c) EVP_DigestUpdate(a;b;c) + //# define EVP_VerifyInit_ex(a;b;c) EVP_DigestInit_ex(a;b;c) + //# define EVP_VerifyInit(a;b) EVP_DigestInit(a;b) + //# define EVP_VerifyUpdate(a;b;c) EVP_DigestUpdate(a;b;c) + //# define EVP_OpenUpdate(a;b;c;d;e) EVP_DecryptUpdate(a;b;c;d;e) + //# define EVP_SealUpdate(a;b;c;d;e) EVP_EncryptUpdate(a;b;c;d;e) + //# define EVP_DigestSignUpdate(a;b;c) EVP_DigestUpdate(a;b;c) + //# define EVP_DigestVerifyUpdate(a;b;c) EVP_DigestUpdate(a;b;c) + + BIO_set_md_procname = 'BIO_set_md'; {removed 1.0.0} + //# define BIO_get_md(b;mdp) BIO_ctrl(b;BIO_C_GET_MD;0;(PIdAnsiChar)(mdp)) + //# define BIO_get_md_ctx(b;mdcp) BIO_ctrl(b;BIO_C_GET_MD_CTX;0; (PIdAnsiChar)(mdcp)) + //# define BIO_set_md_ctx(b;mdcp) BIO_ctrl(b;BIO_C_SET_MD_CTX;0; (PIdAnsiChar)(mdcp)) + //# define BIO_get_cipher_status(b) BIO_ctrl(b;BIO_C_GET_CIPHER_STATUS;0;NULL) + //# define BIO_get_cipher_ctx(b;c_pp) BIO_ctrl(b;BIO_C_GET_CIPHER_CTX;0; (PIdAnsiChar)(c_pp)) + + //function EVP_Cipher(c: PEVP_CIPHER_CTX; out_: PByte; const in_: PByte; in1: TIdC_UINT): TIdC_INT; + + //# define EVP_add_cipher_alias(n;alias) OBJ_NAME_add((alias);OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS;(n)) + //# define EVP_add_digest_alias(n;alias) OBJ_NAME_add((alias);OBJ_NAME_TYPE_MD_METH|OBJ_NAME_ALIAS;(n)) + //# define EVP_delete_cipher_alias(alias) OBJ_NAME_remove(alias;OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS); + //# define EVP_delete_digest_alias(alias) OBJ_NAME_remove(alias;OBJ_NAME_TYPE_MD_METH|OBJ_NAME_ALIAS); + + //void EVP_MD_CTX_init(EVP_MD_CTX *ctx); + //int EVP_MD_CTX_cleanup(EVP_MD_CTX *ctx); + EVP_MD_CTX_init_procname = 'EVP_MD_CTX_init'; {removed 1.1.0} + EVP_MD_CTX_cleanup_procname = 'EVP_MD_CTX_cleanup'; {removed 1.1.0} + + EVP_MD_CTX_ctrl_procname = 'EVP_MD_CTX_ctrl'; {introduced 1.1.0} + EVP_MD_CTX_new_procname = 'EVP_MD_CTX_new'; {introduced 1.1.0} + EVP_MD_CTX_reset_procname = 'EVP_MD_CTX_reset'; {introduced 1.1.0} + EVP_MD_CTX_free_procname = 'EVP_MD_CTX_free'; {introduced 1.1.0} + //# define EVP_MD_CTX_create() EVP_MD_CTX_new() + //# define EVP_MD_CTX_init(ctx) EVP_MD_CTX_reset((ctx)) + //# define EVP_MD_CTX_destroy(ctx) EVP_MD_CTX_free((ctx)) + EVP_MD_CTX_copy_ex_procname = 'EVP_MD_CTX_copy_ex'; + EVP_MD_CTX_set_flags_procname = 'EVP_MD_CTX_set_flags'; + EVP_MD_CTX_clear_flags_procname = 'EVP_MD_CTX_clear_flags'; + EVP_MD_CTX_test_flags_procname = 'EVP_MD_CTX_test_flags'; + EVP_DigestInit_ex_procname = 'EVP_DigestInit_ex'; + EVP_DigestUpdate_procname = 'EVP_DigestUpdate'; + EVP_DigestFinal_ex_procname = 'EVP_DigestFinal_ex'; + EVP_Digest_procname = 'EVP_Digest'; + + EVP_MD_CTX_copy_procname = 'EVP_MD_CTX_copy'; + EVP_DigestInit_procname = 'EVP_DigestInit'; + EVP_DigestFinal_procname = 'EVP_DigestFinal'; + EVP_DigestFinalXOF_procname = 'EVP_DigestFinalXOF'; {introduced 1.1.0} + + EVP_read_pw_string_procname = 'EVP_read_pw_string'; + EVP_read_pw_string_min_procname = 'EVP_read_pw_string_min'; + EVP_set_pw_prompt_procname = 'EVP_set_pw_prompt'; + EVP_get_pw_prompt_procname = 'EVP_get_pw_prompt'; + EVP_BytesToKey_procname = 'EVP_BytesToKey'; + + EVP_CIPHER_CTX_set_flags_procname = 'EVP_CIPHER_CTX_set_flags'; + EVP_CIPHER_CTX_clear_flags_procname = 'EVP_CIPHER_CTX_clear_flags'; + EVP_CIPHER_CTX_test_flags_procname = 'EVP_CIPHER_CTX_test_flags'; + + EVP_EncryptInit_procname = 'EVP_EncryptInit'; + EVP_EncryptInit_ex_procname = 'EVP_EncryptInit_ex'; + EVP_EncryptUpdate_procname = 'EVP_EncryptUpdate'; + EVP_EncryptFinal_ex_procname = 'EVP_EncryptFinal_ex'; + EVP_EncryptFinal_procname = 'EVP_EncryptFinal'; + + EVP_DecryptInit_procname = 'EVP_DecryptInit'; + EVP_DecryptInit_ex_procname = 'EVP_DecryptInit_ex'; + EVP_DecryptUpdate_procname = 'EVP_DecryptUpdate'; + EVP_DecryptFinal_procname = 'EVP_DecryptFinal'; + EVP_DecryptFinal_ex_procname = 'EVP_DecryptFinal_ex'; + + EVP_CipherInit_procname = 'EVP_CipherInit'; + EVP_CipherInit_ex_procname = 'EVP_CipherInit_ex'; + EVP_CipherUpdate_procname = 'EVP_CipherUpdate'; + EVP_CipherFinal_procname = 'EVP_CipherFinal'; + EVP_CipherFinal_ex_procname = 'EVP_CipherFinal_ex'; + + EVP_SignFinal_procname = 'EVP_SignFinal'; + + EVP_DigestSign_procname = 'EVP_DigestSign'; {introduced 1.1.0} + + EVP_VerifyFinal_procname = 'EVP_VerifyFinal'; + + EVP_DigestVerify_procname = 'EVP_DigestVerify'; {introduced 1.1.0} + + EVP_DigestSignInit_procname = 'EVP_DigestSignInit'; + EVP_DigestSignFinal_procname = 'EVP_DigestSignFinal'; + + EVP_DigestVerifyInit_procname = 'EVP_DigestVerifyInit'; + EVP_DigestVerifyFinal_procname = 'EVP_DigestVerifyFinal'; + + EVP_OpenInit_procname = 'EVP_OpenInit'; + EVP_OpenFinal_procname = 'EVP_OpenFinal'; + + EVP_SealInit_procname = 'EVP_SealInit'; + EVP_SealFinal_procname = 'EVP_SealFinal'; + + EVP_ENCODE_CTX_new_procname = 'EVP_ENCODE_CTX_new'; {introduced 1.1.0} + EVP_ENCODE_CTX_free_procname = 'EVP_ENCODE_CTX_free'; {introduced 1.1.0} + EVP_ENCODE_CTX_copy_procname = 'EVP_ENCODE_CTX_copy'; {introduced 1.1.0} + EVP_ENCODE_CTX_num_procname = 'EVP_ENCODE_CTX_num'; {introduced 1.1.0} + EVP_EncodeInit_procname = 'EVP_EncodeInit'; + EVP_EncodeUpdate_procname = 'EVP_EncodeUpdate'; + EVP_EncodeFinal_procname = 'EVP_EncodeFinal'; + EVP_EncodeBlock_procname = 'EVP_EncodeBlock'; + + EVP_DecodeInit_procname = 'EVP_DecodeInit'; + EVP_DecodeUpdate_procname = 'EVP_DecodeUpdate'; + EVP_DecodeFinal_procname = 'EVP_DecodeFinal'; + EVP_DecodeBlock_procname = 'EVP_DecodeBlock'; + + EVP_CIPHER_CTX_new_procname = 'EVP_CIPHER_CTX_new'; + EVP_CIPHER_CTX_reset_procname = 'EVP_CIPHER_CTX_reset'; {introduced 1.1.0} + EVP_CIPHER_CTX_free_procname = 'EVP_CIPHER_CTX_free'; + EVP_CIPHER_CTX_set_key_length_procname = 'EVP_CIPHER_CTX_set_key_length'; + EVP_CIPHER_CTX_set_padding_procname = 'EVP_CIPHER_CTX_set_padding'; + EVP_CIPHER_CTX_ctrl_procname = 'EVP_CIPHER_CTX_ctrl'; + EVP_CIPHER_CTX_rand_key_procname = 'EVP_CIPHER_CTX_rand_key'; + + BIO_f_md_procname = 'BIO_f_md'; + BIO_f_base64_procname = 'BIO_f_base64'; + BIO_f_cipher_procname = 'BIO_f_cipher'; + BIO_f_reliable_procname = 'BIO_f_reliable'; + BIO_set_cipher_procname = 'BIO_set_cipher'; + + EVP_md_null_procname = 'EVP_md_null'; + + EVP_md2_procname = 'EVP_md2'; {removed 1.1.0 allow_nil} + EVP_md4_procname = 'EVP_md4'; {removed 1.1.0 allow_nil} + EVP_md5_procname = 'EVP_md5'; {removed 1.1.0 allow_nil} + EVP_md5_sha1_procname = 'EVP_md5_sha1'; {introduced 1.1.0} + + EVP_sha1_procname = 'EVP_sha1'; + EVP_sha224_procname = 'EVP_sha224'; + EVP_sha256_procname = 'EVP_sha256'; + EVP_sha384_procname = 'EVP_sha384'; + EVP_sha512_procname = 'EVP_sha512'; + EVP_sha512_224_procname = 'EVP_sha512_224'; {introduced 1.1.0} + EVP_sha512_256_procname = 'EVP_sha512_256'; {introduced 1.1.0} + EVP_sha3_224_procname = 'EVP_sha3_224'; {introduced 1.1.0} + EVP_sha3_256_procname = 'EVP_sha3_256'; {introduced 1.1.0} + EVP_sha3_384_procname = 'EVP_sha3_384'; {introduced 1.1.0} + EVP_sha3_512_procname = 'EVP_sha3_512'; {introduced 1.1.0} + EVP_shake128_procname = 'EVP_shake128'; {introduced 1.1.0} + EVP_shake256_procname = 'EVP_shake256'; {introduced 1.1.0} + + (* does nothing :-) *) + EVP_enc_null_procname = 'EVP_enc_null'; + + EVP_des_ecb_procname = 'EVP_des_ecb'; + EVP_des_ede_procname = 'EVP_des_ede'; + EVP_des_ede3_procname = 'EVP_des_ede3'; + EVP_des_ede_ecb_procname = 'EVP_des_ede_ecb'; + EVP_des_ede3_ecb_procname = 'EVP_des_ede3_ecb'; + EVP_des_cfb64_procname = 'EVP_des_cfb64'; + //EVP_des_cfb EVP_des_cfb64 + EVP_des_cfb1_procname = 'EVP_des_cfb1'; + EVP_des_cfb8_procname = 'EVP_des_cfb8'; + EVP_des_ede_cfb64_procname = 'EVP_des_ede_cfb64'; + EVP_des_ede3_cfb64_procname = 'EVP_des_ede3_cfb64'; + //EVP_des_ede3_cfb EVP_des_ede3_cfb64 + EVP_des_ede3_cfb1_procname = 'EVP_des_ede3_cfb1'; + EVP_des_ede3_cfb8_procname = 'EVP_des_ede3_cfb8'; + EVP_des_ofb_procname = 'EVP_des_ofb'; + EVP_des_ede_ofb_procname = 'EVP_des_ede_ofb'; + EVP_des_ede3_ofb_procname = 'EVP_des_ede3_ofb'; + EVP_des_cbc_procname = 'EVP_des_cbc'; + EVP_des_ede_cbc_procname = 'EVP_des_ede_cbc'; + EVP_des_ede3_cbc_procname = 'EVP_des_ede3_cbc'; + EVP_desx_cbc_procname = 'EVP_desx_cbc'; + EVP_des_ede3_wrap_procname = 'EVP_des_ede3_wrap'; + // + // This should now be supported through the dev_crypto ENGINE. But also, why + // are rc4 and md5 declarations made here inside a "NO_DES" precompiler + // branch? + // + EVP_rc4_procname = 'EVP_rc4'; + EVP_rc4_40_procname = 'EVP_rc4_40'; +// function EVP_idea_ecb: PEVP_CIPHER; +// function EVP_idea_cfb64: PEVP_CIPHER; + //EVP_idea_cfb EVP_idea_cfb64 +// function EVP_idea_ofb: PEVP_CIPHER; + // function EVP_idea_cbc: PEVP_CIPHER; + EVP_rc2_ecb_procname = 'EVP_rc2_ecb'; + EVP_rc2_cbc_procname = 'EVP_rc2_cbc'; + EVP_rc2_40_cbc_procname = 'EVP_rc2_40_cbc'; + EVP_rc2_64_cbc_procname = 'EVP_rc2_64_cbc'; + EVP_rc2_cfb64_procname = 'EVP_rc2_cfb64'; + //EVP_rc2_cfb EVP_rc2_cfb64 + EVP_rc2_ofb_procname = 'EVP_rc2_ofb'; + EVP_bf_ecb_procname = 'EVP_bf_ecb'; + EVP_bf_cbc_procname = 'EVP_bf_cbc'; + EVP_bf_cfb64_procname = 'EVP_bf_cfb64'; + //EVP_bf_cfb EVP_bf_cfb64 + EVP_bf_ofb_procname = 'EVP_bf_ofb'; + EVP_cast5_ecb_procname = 'EVP_cast5_ecb'; + EVP_cast5_cbc_procname = 'EVP_cast5_cbc'; + EVP_cast5_cfb64_procname = 'EVP_cast5_cfb64'; + //EVP_cast5_cfb EVP_cast5_cfb64 + EVP_cast5_ofb_procname = 'EVP_cast5_ofb'; +// function EVP_rc5_32_12_16_cbc: PEVP_CIPHER; +// function EVP_rc5_32_12_16_ecb: PEVP_CIPHER; +// function EVP_rc5_32_12_16_cfb64: PEVP_CIPHER; + //EVP_rc5_32_12_16_cfb EVP_rc5_32_12_16_cfb64 +// function EVP_rc5_32_12_16_ofb: PEVP_CIPHER; + + EVP_aes_128_ecb_procname = 'EVP_aes_128_ecb'; + EVP_aes_128_cbc_procname = 'EVP_aes_128_cbc'; + EVP_aes_128_cfb1_procname = 'EVP_aes_128_cfb1'; + EVP_aes_128_cfb8_procname = 'EVP_aes_128_cfb8'; + EVP_aes_128_cfb128_procname = 'EVP_aes_128_cfb128'; + //EVP_aes_128_cfb EVP_aes_128_cfb128 + EVP_aes_128_ofb_procname = 'EVP_aes_128_ofb'; + EVP_aes_128_ctr_procname = 'EVP_aes_128_ctr'; + EVP_aes_128_ccm_procname = 'EVP_aes_128_ccm'; + EVP_aes_128_gcm_procname = 'EVP_aes_128_gcm'; + EVP_aes_128_xts_procname = 'EVP_aes_128_xts'; + EVP_aes_128_wrap_procname = 'EVP_aes_128_wrap'; + EVP_aes_128_wrap_pad_procname = 'EVP_aes_128_wrap_pad'; {introduced 1.1.0} + EVP_aes_128_ocb_procname = 'EVP_aes_128_ocb'; {introduced 1.1.0} + EVP_aes_192_ecb_procname = 'EVP_aes_192_ecb'; + EVP_aes_192_cbc_procname = 'EVP_aes_192_cbc'; + EVP_aes_192_cfb1_procname = 'EVP_aes_192_cfb1'; + EVP_aes_192_cfb8_procname = 'EVP_aes_192_cfb8'; + EVP_aes_192_cfb128_procname = 'EVP_aes_192_cfb128'; + //EVP_aes_192_cfb EVP_aes_192_cfb128 + EVP_aes_192_ofb_procname = 'EVP_aes_192_ofb'; + EVP_aes_192_ctr_procname = 'EVP_aes_192_ctr'; + EVP_aes_192_ccm_procname = 'EVP_aes_192_ccm'; + EVP_aes_192_gcm_procname = 'EVP_aes_192_gcm'; + EVP_aes_192_wrap_procname = 'EVP_aes_192_wrap'; + EVP_aes_192_wrap_pad_procname = 'EVP_aes_192_wrap_pad'; {introduced 1.1.0} + EVP_aes_192_ocb_procname = 'EVP_aes_192_ocb'; {introduced 1.1.0} + EVP_aes_256_ecb_procname = 'EVP_aes_256_ecb'; + EVP_aes_256_cbc_procname = 'EVP_aes_256_cbc'; + EVP_aes_256_cfb1_procname = 'EVP_aes_256_cfb1'; + EVP_aes_256_cfb8_procname = 'EVP_aes_256_cfb8'; + EVP_aes_256_cfb128_procname = 'EVP_aes_256_cfb128'; + //EVP_aes_256_cfb EVP_aes_256_cfb128 + EVP_aes_256_ofb_procname = 'EVP_aes_256_ofb'; + EVP_aes_256_ctr_procname = 'EVP_aes_256_ctr'; + EVP_aes_256_ccm_procname = 'EVP_aes_256_ccm'; + EVP_aes_256_gcm_procname = 'EVP_aes_256_gcm'; + EVP_aes_256_xts_procname = 'EVP_aes_256_xts'; + EVP_aes_256_wrap_procname = 'EVP_aes_256_wrap'; + EVP_aes_256_wrap_pad_procname = 'EVP_aes_256_wrap_pad'; {introduced 1.1.0} + EVP_aes_256_ocb_procname = 'EVP_aes_256_ocb'; {introduced 1.1.0} + EVP_aes_128_cbc_hmac_sha1_procname = 'EVP_aes_128_cbc_hmac_sha1'; + EVP_aes_256_cbc_hmac_sha1_procname = 'EVP_aes_256_cbc_hmac_sha1'; + EVP_aes_128_cbc_hmac_sha256_procname = 'EVP_aes_128_cbc_hmac_sha256'; + EVP_aes_256_cbc_hmac_sha256_procname = 'EVP_aes_256_cbc_hmac_sha256'; + + EVP_aria_128_ecb_procname = 'EVP_aria_128_ecb'; {introduced 1.1.0} + EVP_aria_128_cbc_procname = 'EVP_aria_128_cbc'; {introduced 1.1.0} + EVP_aria_128_cfb1_procname = 'EVP_aria_128_cfb1'; {introduced 1.1.0} + EVP_aria_128_cfb8_procname = 'EVP_aria_128_cfb8'; {introduced 1.1.0} + EVP_aria_128_cfb128_procname = 'EVP_aria_128_cfb128'; {introduced 1.1.0} + EVP_aria_128_ctr_procname = 'EVP_aria_128_ctr'; {introduced 1.1.0} + EVP_aria_128_ofb_procname = 'EVP_aria_128_ofb'; {introduced 1.1.0} + EVP_aria_128_gcm_procname = 'EVP_aria_128_gcm'; {introduced 1.1.0} + EVP_aria_128_ccm_procname = 'EVP_aria_128_ccm'; {introduced 1.1.0} + EVP_aria_192_ecb_procname = 'EVP_aria_192_ecb'; {introduced 1.1.0} + EVP_aria_192_cbc_procname = 'EVP_aria_192_cbc'; {introduced 1.1.0} + EVP_aria_192_cfb1_procname = 'EVP_aria_192_cfb1'; {introduced 1.1.0} + EVP_aria_192_cfb8_procname = 'EVP_aria_192_cfb8'; {introduced 1.1.0} + EVP_aria_192_cfb128_procname = 'EVP_aria_192_cfb128'; {introduced 1.1.0} + //EVP_aria_192_cfb EVP_aria_192_cfb128 + EVP_aria_192_ctr_procname = 'EVP_aria_192_ctr'; {introduced 1.1.0} + EVP_aria_192_ofb_procname = 'EVP_aria_192_ofb'; {introduced 1.1.0} + EVP_aria_192_gcm_procname = 'EVP_aria_192_gcm'; {introduced 1.1.0} + EVP_aria_192_ccm_procname = 'EVP_aria_192_ccm'; {introduced 1.1.0} + EVP_aria_256_ecb_procname = 'EVP_aria_256_ecb'; {introduced 1.1.0} + EVP_aria_256_cbc_procname = 'EVP_aria_256_cbc'; {introduced 1.1.0} + EVP_aria_256_cfb1_procname = 'EVP_aria_256_cfb1'; {introduced 1.1.0} + EVP_aria_256_cfb8_procname = 'EVP_aria_256_cfb8'; {introduced 1.1.0} + EVP_aria_256_cfb128_procname = 'EVP_aria_256_cfb128'; {introduced 1.1.0} + //EVP_aria_256_cfb EVP_aria_256_cfb128 + EVP_aria_256_ctr_procname = 'EVP_aria_256_ctr'; {introduced 1.1.0} + EVP_aria_256_ofb_procname = 'EVP_aria_256_ofb'; {introduced 1.1.0} + EVP_aria_256_gcm_procname = 'EVP_aria_256_gcm'; {introduced 1.1.0} + EVP_aria_256_ccm_procname = 'EVP_aria_256_ccm'; {introduced 1.1.0} + + EVP_camellia_128_ecb_procname = 'EVP_camellia_128_ecb'; + EVP_camellia_128_cbc_procname = 'EVP_camellia_128_cbc'; + EVP_camellia_128_cfb1_procname = 'EVP_camellia_128_cfb1'; + EVP_camellia_128_cfb8_procname = 'EVP_camellia_128_cfb8'; + EVP_camellia_128_cfb128_procname = 'EVP_camellia_128_cfb128'; + //EVP_camellia_128_cfb EVP_camellia_128_cfb128 + EVP_camellia_128_ofb_procname = 'EVP_camellia_128_ofb'; + EVP_camellia_128_ctr_procname = 'EVP_camellia_128_ctr'; {introduced 1.1.0} + EVP_camellia_192_ecb_procname = 'EVP_camellia_192_ecb'; + EVP_camellia_192_cbc_procname = 'EVP_camellia_192_cbc'; + EVP_camellia_192_cfb1_procname = 'EVP_camellia_192_cfb1'; + EVP_camellia_192_cfb8_procname = 'EVP_camellia_192_cfb8'; + EVP_camellia_192_cfb128_procname = 'EVP_camellia_192_cfb128'; + //EVP_camellia_192_cfb EVP_camellia_192_cfb128 + EVP_camellia_192_ofb_procname = 'EVP_camellia_192_ofb'; + EVP_camellia_192_ctr_procname = 'EVP_camellia_192_ctr'; {introduced 1.1.0} + EVP_camellia_256_ecb_procname = 'EVP_camellia_256_ecb'; + EVP_camellia_256_cbc_procname = 'EVP_camellia_256_cbc'; + EVP_camellia_256_cfb1_procname = 'EVP_camellia_256_cfb1'; + EVP_camellia_256_cfb8_procname = 'EVP_camellia_256_cfb8'; + EVP_camellia_256_cfb128_procname = 'EVP_camellia_256_cfb128'; + //EVP_camellia_256_cfb EVP_camellia_256_cfb128 + EVP_camellia_256_ofb_procname = 'EVP_camellia_256_ofb'; + EVP_camellia_256_ctr_procname = 'EVP_camellia_256_ctr'; {introduced 1.1.0} + + EVP_chacha20_procname = 'EVP_chacha20'; {introduced 1.1.0} + EVP_chacha20_poly1305_procname = 'EVP_chacha20_poly1305'; {introduced 1.1.0} + + EVP_seed_ecb_procname = 'EVP_seed_ecb'; + EVP_seed_cbc_procname = 'EVP_seed_cbc'; + EVP_seed_cfb128_procname = 'EVP_seed_cfb128'; + //EVP_seed_cfb EVP_seed_cfb128 + EVP_seed_ofb_procname = 'EVP_seed_ofb'; + + EVP_sm4_ecb_procname = 'EVP_sm4_ecb'; {introduced 1.1.0} + EVP_sm4_cbc_procname = 'EVP_sm4_cbc'; {introduced 1.1.0} + EVP_sm4_cfb128_procname = 'EVP_sm4_cfb128'; {introduced 1.1.0} + //EVP_sm4_cfb EVP_sm4_cfb128 + EVP_sm4_ofb_procname = 'EVP_sm4_ofb'; {introduced 1.1.0} + EVP_sm4_ctr_procname = 'EVP_sm4_ctr'; {introduced 1.1.0} + + EVP_add_cipher_procname = 'EVP_add_cipher'; + EVP_add_digest_procname = 'EVP_add_digest'; + + EVP_get_cipherbyname_procname = 'EVP_get_cipherbyname'; + EVP_get_digestbyname_procname = 'EVP_get_digestbyname'; + + EVP_CIPHER_do_all_procname = 'EVP_CIPHER_do_all'; + EVP_CIPHER_do_all_sorted_procname = 'EVP_CIPHER_do_all_sorted'; + + EVP_MD_do_all_procname = 'EVP_MD_do_all'; + EVP_MD_do_all_sorted_procname = 'EVP_MD_do_all_sorted'; + + EVP_PKEY_decrypt_old_procname = 'EVP_PKEY_decrypt_old'; + EVP_PKEY_encrypt_old_procname = 'EVP_PKEY_encrypt_old'; + EVP_PKEY_type_procname = 'EVP_PKEY_type'; + EVP_PKEY_id_procname = 'EVP_PKEY_id'; {removed 3.0.0} + EVP_PKEY_base_id_procname = 'EVP_PKEY_base_id'; {removed 3.0.0} + EVP_PKEY_get_base_id_procname = 'EVP_PKEY_get_base_id'; {introduced 3.0.0} + EVP_PKEY_bits_procname = 'EVP_PKEY_bits'; {removed 3.0.0} + EVP_PKEY_get_bits_procname = 'EVP_PKEY_get_bits'; {introduced 3.0.0} + EVP_PKEY_security_bits_procname = 'EVP_PKEY_security_bits'; {introduced 1.1.0 removed 3.0.0} + EVP_PKEY_get_security_bits_procname = 'EVP_PKEY_get_security_bits'; {introduced 3.0.0} + EVP_PKEY_size_procname = 'EVP_PKEY_size'; {removed 3.0.0} + EVP_PKEY_get_size_procname = 'EVP_PKEY_get_size'; {introduced 3.0.0} + EVP_PKEY_set_type_procname = 'EVP_PKEY_set_type'; + EVP_PKEY_set_type_str_procname = 'EVP_PKEY_set_type_str'; + EVP_PKEY_set_alias_type_procname = 'EVP_PKEY_set_alias_type'; {introduced 1.1.0 removed 3.0.0} + + EVP_PKEY_set1_engine_procname = 'EVP_PKEY_set1_engine'; {introduced 1.1.0} + EVP_PKEY_get0_engine_procname = 'EVP_PKEY_get0_engine'; {introduced 1.1.0} + + EVP_PKEY_assign_procname = 'EVP_PKEY_assign'; + EVP_PKEY_get0_procname = 'EVP_PKEY_get0'; + EVP_PKEY_get0_hmac_procname = 'EVP_PKEY_get0_hmac'; {introduced 1.1.0} + EVP_PKEY_get0_poly1305_procname = 'EVP_PKEY_get0_poly1305'; {introduced 1.1.0} + EVP_PKEY_get0_siphash_procname = 'EVP_PKEY_get0_siphash'; {introduced 1.1.0} + + EVP_PKEY_set1_RSA_procname = 'EVP_PKEY_set1_RSA'; + EVP_PKEY_get0_RSA_procname = 'EVP_PKEY_get0_RSA'; {introduced 1.1.0} + EVP_PKEY_get1_RSA_procname = 'EVP_PKEY_get1_RSA'; + + EVP_PKEY_set1_DSA_procname = 'EVP_PKEY_set1_DSA'; + EVP_PKEY_get0_DSA_procname = 'EVP_PKEY_get0_DSA'; {introduced 1.1.0} + EVP_PKEY_get1_DSA_procname = 'EVP_PKEY_get1_DSA'; + + EVP_PKEY_set1_DH_procname = 'EVP_PKEY_set1_DH'; + EVP_PKEY_get0_DH_procname = 'EVP_PKEY_get0_DH'; {introduced 1.1.0} + EVP_PKEY_get1_DH_procname = 'EVP_PKEY_get1_DH'; + + EVP_PKEY_set1_EC_KEY_procname = 'EVP_PKEY_set1_EC_KEY'; + EVP_PKEY_get0_EC_KEY_procname = 'EVP_PKEY_get0_EC_KEY'; {introduced 1.1.0} + EVP_PKEY_get1_EC_KEY_procname = 'EVP_PKEY_get1_EC_KEY'; + + EVP_PKEY_new_procname = 'EVP_PKEY_new'; + EVP_PKEY_up_ref_procname = 'EVP_PKEY_up_ref'; {introduced 1.1.0} + EVP_PKEY_free_procname = 'EVP_PKEY_free'; + + d2i_PublicKey_procname = 'd2i_PublicKey'; + i2d_PublicKey_procname = 'i2d_PublicKey'; + + d2i_PrivateKey_procname = 'd2i_PrivateKey'; + d2i_AutoPrivateKey_procname = 'd2i_AutoPrivateKey'; + i2d_PrivateKey_procname = 'i2d_PrivateKey'; + + EVP_PKEY_copy_parameters_procname = 'EVP_PKEY_copy_parameters'; + EVP_PKEY_missing_parameters_procname = 'EVP_PKEY_missing_parameters'; + EVP_PKEY_save_parameters_procname = 'EVP_PKEY_save_parameters'; + EVP_PKEY_cmp_parameters_procname = 'EVP_PKEY_cmp_parameters'; + + EVP_PKEY_cmp_procname = 'EVP_PKEY_cmp'; + + EVP_PKEY_print_public_procname = 'EVP_PKEY_print_public'; + EVP_PKEY_print_private_procname = 'EVP_PKEY_print_private'; + EVP_PKEY_print_params_procname = 'EVP_PKEY_print_params'; + + EVP_PKEY_get_default_digest_nid_procname = 'EVP_PKEY_get_default_digest_nid'; + + EVP_PKEY_set1_tls_encodedpoint_procname = 'EVP_PKEY_set1_tls_encodedpoint'; {introduced 1.1.0 removed 3.0.0} + EVP_PKEY_get1_tls_encodedpoint_procname = 'EVP_PKEY_get1_tls_encodedpoint'; {introduced 1.1.0 removed 3.0.0} + + EVP_CIPHER_type_procname = 'EVP_CIPHER_type'; {removed 3.0.0} + + (* calls methods *) + EVP_CIPHER_param_to_asn1_procname = 'EVP_CIPHER_param_to_asn1'; + EVP_CIPHER_asn1_to_param_procname = 'EVP_CIPHER_asn1_to_param'; + + (* These are used by EVP_CIPHER methods *) + EVP_CIPHER_set_asn1_iv_procname = 'EVP_CIPHER_set_asn1_iv'; + EVP_CIPHER_get_asn1_iv_procname = 'EVP_CIPHER_get_asn1_iv'; + + (* PKCS5 password based encryption *) + PKCS5_PBE_keyivgen_procname = 'PKCS5_PBE_keyivgen'; + PKCS5_PBKDF2_HMAC_SHA1_procname = 'PKCS5_PBKDF2_HMAC_SHA1'; + PKCS5_PBKDF2_HMAC_procname = 'PKCS5_PBKDF2_HMAC'; + PKCS5_v2_PBE_keyivgen_procname = 'PKCS5_v2_PBE_keyivgen'; + + EVP_PBE_scrypt_procname = 'EVP_PBE_scrypt'; {introduced 1.1.0} + + PKCS5_v2_scrypt_keyivgen_procname = 'PKCS5_v2_scrypt_keyivgen'; {introduced 1.1.0} + + PKCS5_PBE_add_procname = 'PKCS5_PBE_add'; + + EVP_PBE_CipherInit_procname = 'EVP_PBE_CipherInit'; + + (* PBE type *) + EVP_PBE_alg_add_type_procname = 'EVP_PBE_alg_add_type'; + EVP_PBE_alg_add_procname = 'EVP_PBE_alg_add'; + EVP_PBE_find_procname = 'EVP_PBE_find'; + EVP_PBE_cleanup_procname = 'EVP_PBE_cleanup'; + EVP_PBE_get_procname = 'EVP_PBE_get'; {introduced 1.1.0} + + EVP_PKEY_asn1_get_count_procname = 'EVP_PKEY_asn1_get_count'; + EVP_PKEY_asn1_get0_procname = 'EVP_PKEY_asn1_get0'; + EVP_PKEY_asn1_find_procname = 'EVP_PKEY_asn1_find'; + EVP_PKEY_asn1_find_str_procname = 'EVP_PKEY_asn1_find_str'; + EVP_PKEY_asn1_add0_procname = 'EVP_PKEY_asn1_add0'; + EVP_PKEY_asn1_add_alias_procname = 'EVP_PKEY_asn1_add_alias'; + EVP_PKEY_asn1_get0_info_procname = 'EVP_PKEY_asn1_get0_info'; + + EVP_PKEY_get0_asn1_procname = 'EVP_PKEY_get0_asn1'; + EVP_PKEY_asn1_new_procname = 'EVP_PKEY_asn1_new'; + EVP_PKEY_asn1_copy_procname = 'EVP_PKEY_asn1_copy'; + EVP_PKEY_asn1_free_procname = 'EVP_PKEY_asn1_free'; + + EVP_PKEY_asn1_set_public_procname = 'EVP_PKEY_asn1_set_public'; + EVP_PKEY_asn1_set_private_procname = 'EVP_PKEY_asn1_set_private'; + EVP_PKEY_asn1_set_param_procname = 'EVP_PKEY_asn1_set_param'; + + EVP_PKEY_asn1_set_free_procname = 'EVP_PKEY_asn1_set_free'; + EVP_PKEY_asn1_set_ctrl_procname = 'EVP_PKEY_asn1_set_ctrl'; + EVP_PKEY_asn1_set_item_procname = 'EVP_PKEY_asn1_set_item'; + + EVP_PKEY_asn1_set_siginf_procname = 'EVP_PKEY_asn1_set_siginf'; {introduced 1.1.0} + + EVP_PKEY_asn1_set_check_procname = 'EVP_PKEY_asn1_set_check'; {introduced 1.1.0} + + EVP_PKEY_asn1_set_public_check_procname = 'EVP_PKEY_asn1_set_public_check'; {introduced 1.1.0} + + EVP_PKEY_asn1_set_param_check_procname = 'EVP_PKEY_asn1_set_param_check'; {introduced 1.1.0} + + EVP_PKEY_asn1_set_set_priv_key_procname = 'EVP_PKEY_asn1_set_set_priv_key'; {introduced 1.1.0} + EVP_PKEY_asn1_set_set_pub_key_procname = 'EVP_PKEY_asn1_set_set_pub_key'; {introduced 1.1.0} + EVP_PKEY_asn1_set_get_priv_key_procname = 'EVP_PKEY_asn1_set_get_priv_key'; {introduced 1.1.0} + EVP_PKEY_asn1_set_get_pub_key_procname = 'EVP_PKEY_asn1_set_get_pub_key'; {introduced 1.1.0} + + EVP_PKEY_asn1_set_security_bits_procname = 'EVP_PKEY_asn1_set_security_bits'; {introduced 1.1.0} + + EVP_PKEY_meth_find_procname = 'EVP_PKEY_meth_find'; + EVP_PKEY_meth_new_procname = 'EVP_PKEY_meth_new'; + EVP_PKEY_meth_get0_info_procname = 'EVP_PKEY_meth_get0_info'; + EVP_PKEY_meth_copy_procname = 'EVP_PKEY_meth_copy'; + EVP_PKEY_meth_free_procname = 'EVP_PKEY_meth_free'; + EVP_PKEY_meth_add0_procname = 'EVP_PKEY_meth_add0'; + EVP_PKEY_meth_remove_procname = 'EVP_PKEY_meth_remove'; {introduced 1.1.0} + EVP_PKEY_meth_get_count_procname = 'EVP_PKEY_meth_get_count'; {introduced 1.1.0} + EVP_PKEY_meth_get0_procname = 'EVP_PKEY_meth_get0'; {introduced 1.1.0} + + EVP_PKEY_CTX_new_procname = 'EVP_PKEY_CTX_new'; + EVP_PKEY_CTX_new_id_procname = 'EVP_PKEY_CTX_new_id'; + EVP_PKEY_CTX_dup_procname = 'EVP_PKEY_CTX_dup'; + EVP_PKEY_CTX_free_procname = 'EVP_PKEY_CTX_free'; + + EVP_PKEY_CTX_ctrl_procname = 'EVP_PKEY_CTX_ctrl'; + EVP_PKEY_CTX_ctrl_str_procname = 'EVP_PKEY_CTX_ctrl_str'; + EVP_PKEY_CTX_ctrl_uint64_procname = 'EVP_PKEY_CTX_ctrl_uint64'; {introduced 1.1.0} + + EVP_PKEY_CTX_str2ctrl_procname = 'EVP_PKEY_CTX_str2ctrl'; {introduced 1.1.0} + EVP_PKEY_CTX_hex2ctrl_procname = 'EVP_PKEY_CTX_hex2ctrl'; {introduced 1.1.0} + + EVP_PKEY_CTX_md_procname = 'EVP_PKEY_CTX_md'; {introduced 1.1.0} + + EVP_PKEY_CTX_get_operation_procname = 'EVP_PKEY_CTX_get_operation'; + EVP_PKEY_CTX_set0_keygen_info_procname = 'EVP_PKEY_CTX_set0_keygen_info'; + + EVP_PKEY_new_mac_key_procname = 'EVP_PKEY_new_mac_key'; + EVP_PKEY_new_raw_private_key_procname = 'EVP_PKEY_new_raw_private_key'; {introduced 1.1.0} + EVP_PKEY_new_raw_public_key_procname = 'EVP_PKEY_new_raw_public_key'; {introduced 1.1.0} + EVP_PKEY_get_raw_private_key_procname = 'EVP_PKEY_get_raw_private_key'; {introduced 1.1.0} + EVP_PKEY_get_raw_public_key_procname = 'EVP_PKEY_get_raw_public_key'; {introduced 1.1.0} + + EVP_PKEY_new_CMAC_key_procname = 'EVP_PKEY_new_CMAC_key'; {introduced 1.1.0} + + EVP_PKEY_CTX_set_data_procname = 'EVP_PKEY_CTX_set_data'; + EVP_PKEY_CTX_get_data_procname = 'EVP_PKEY_CTX_get_data'; + EVP_PKEY_CTX_get0_pkey_procname = 'EVP_PKEY_CTX_get0_pkey'; + + EVP_PKEY_CTX_get0_peerkey_procname = 'EVP_PKEY_CTX_get0_peerkey'; + + EVP_PKEY_CTX_set_app_data_procname = 'EVP_PKEY_CTX_set_app_data'; + EVP_PKEY_CTX_get_app_data_procname = 'EVP_PKEY_CTX_get_app_data'; + + EVP_PKEY_sign_init_procname = 'EVP_PKEY_sign_init'; + EVP_PKEY_sign_procname = 'EVP_PKEY_sign'; + EVP_PKEY_verify_init_procname = 'EVP_PKEY_verify_init'; + EVP_PKEY_verify_procname = 'EVP_PKEY_verify'; + EVP_PKEY_verify_recover_init_procname = 'EVP_PKEY_verify_recover_init'; + EVP_PKEY_verify_recover_procname = 'EVP_PKEY_verify_recover'; + EVP_PKEY_encrypt_init_procname = 'EVP_PKEY_encrypt_init'; + EVP_PKEY_encrypt_procname = 'EVP_PKEY_encrypt'; + EVP_PKEY_decrypt_init_procname = 'EVP_PKEY_decrypt_init'; + EVP_PKEY_decrypt_procname = 'EVP_PKEY_decrypt'; + + EVP_PKEY_derive_init_procname = 'EVP_PKEY_derive_init'; + EVP_PKEY_derive_set_peer_procname = 'EVP_PKEY_derive_set_peer'; + EVP_PKEY_derive_procname = 'EVP_PKEY_derive'; + + EVP_PKEY_paramgen_init_procname = 'EVP_PKEY_paramgen_init'; + EVP_PKEY_paramgen_procname = 'EVP_PKEY_paramgen'; + EVP_PKEY_keygen_init_procname = 'EVP_PKEY_keygen_init'; + EVP_PKEY_keygen_procname = 'EVP_PKEY_keygen'; + EVP_PKEY_check_procname = 'EVP_PKEY_check'; {introduced 1.1.0} + EVP_PKEY_public_check_procname = 'EVP_PKEY_public_check'; {introduced 1.1.0} + EVP_PKEY_param_check_procname = 'EVP_PKEY_param_check'; {introduced 1.1.0} + + EVP_PKEY_CTX_set_cb_procname = 'EVP_PKEY_CTX_set_cb'; + EVP_PKEY_CTX_get_cb_procname = 'EVP_PKEY_CTX_get_cb'; + + EVP_PKEY_CTX_get_keygen_info_procname = 'EVP_PKEY_CTX_get_keygen_info'; + + EVP_PKEY_meth_set_init_procname = 'EVP_PKEY_meth_set_init'; + + EVP_PKEY_meth_set_copy_procname = 'EVP_PKEY_meth_set_copy'; + + EVP_PKEY_meth_set_cleanup_procname = 'EVP_PKEY_meth_set_cleanup'; + + EVP_PKEY_meth_set_paramgen_procname = 'EVP_PKEY_meth_set_paramgen'; + + EVP_PKEY_meth_set_keygen_procname = 'EVP_PKEY_meth_set_keygen'; + + EVP_PKEY_meth_set_sign_procname = 'EVP_PKEY_meth_set_sign'; + + EVP_PKEY_meth_set_verify_procname = 'EVP_PKEY_meth_set_verify'; + + EVP_PKEY_meth_set_verify_recover_procname = 'EVP_PKEY_meth_set_verify_recover'; + + EVP_PKEY_meth_set_signctx_procname = 'EVP_PKEY_meth_set_signctx'; + + EVP_PKEY_meth_set_verifyctx_procname = 'EVP_PKEY_meth_set_verifyctx'; + + EVP_PKEY_meth_set_encrypt_procname = 'EVP_PKEY_meth_set_encrypt'; + + EVP_PKEY_meth_set_decrypt_procname = 'EVP_PKEY_meth_set_decrypt'; + + EVP_PKEY_meth_set_derive_procname = 'EVP_PKEY_meth_set_derive'; + + EVP_PKEY_meth_set_ctrl_procname = 'EVP_PKEY_meth_set_ctrl'; + + EVP_PKEY_meth_set_digestsign_procname = 'EVP_PKEY_meth_set_digestsign'; {introduced 1.1.0} + + EVP_PKEY_meth_set_digestverify_procname = 'EVP_PKEY_meth_set_digestverify'; {introduced 1.1.0} + + EVP_PKEY_meth_set_check_procname = 'EVP_PKEY_meth_set_check'; {introduced 1.1.0} + + EVP_PKEY_meth_set_public_check_procname = 'EVP_PKEY_meth_set_public_check'; {introduced 1.1.0} + + EVP_PKEY_meth_set_param_check_procname = 'EVP_PKEY_meth_set_param_check'; {introduced 1.1.0} + + EVP_PKEY_meth_set_digest_custom_procname = 'EVP_PKEY_meth_set_digest_custom'; {introduced 1.1.0} + + EVP_PKEY_meth_get_init_procname = 'EVP_PKEY_meth_get_init'; + + EVP_PKEY_meth_get_copy_procname = 'EVP_PKEY_meth_get_copy'; + + EVP_PKEY_meth_get_cleanup_procname = 'EVP_PKEY_meth_get_cleanup'; + + EVP_PKEY_meth_get_paramgen_procname = 'EVP_PKEY_meth_get_paramgen'; + + EVP_PKEY_meth_get_keygen_procname = 'EVP_PKEY_meth_get_keygen'; + + EVP_PKEY_meth_get_sign_procname = 'EVP_PKEY_meth_get_sign'; + + EVP_PKEY_meth_get_verify_procname = 'EVP_PKEY_meth_get_verify'; + + EVP_PKEY_meth_get_verify_recover_procname = 'EVP_PKEY_meth_get_verify_recover'; + + EVP_PKEY_meth_get_signctx_procname = 'EVP_PKEY_meth_get_signctx'; + + EVP_PKEY_meth_get_verifyctx_procname = 'EVP_PKEY_meth_get_verifyctx'; + + EVP_PKEY_meth_get_encrypt_procname = 'EVP_PKEY_meth_get_encrypt'; + + EVP_PKEY_meth_get_decrypt_procname = 'EVP_PKEY_meth_get_decrypt'; + + EVP_PKEY_meth_get_derive_procname = 'EVP_PKEY_meth_get_derive'; + + EVP_PKEY_meth_get_ctrl_procname = 'EVP_PKEY_meth_get_ctrl'; + + EVP_PKEY_meth_get_digestsign_procname = 'EVP_PKEY_meth_get_digestsign'; {introduced 1.1.0} + + EVP_PKEY_meth_get_digestverify_procname = 'EVP_PKEY_meth_get_digestverify'; {introduced 1.1.0} + + EVP_PKEY_meth_get_check_procname = 'EVP_PKEY_meth_get_check'; {introduced 1.1.0} + + EVP_PKEY_meth_get_public_check_procname = 'EVP_PKEY_meth_get_public_check'; {introduced 1.1.0} + + EVP_PKEY_meth_get_param_check_procname = 'EVP_PKEY_meth_get_param_check'; {introduced 1.1.0} + + EVP_PKEY_meth_get_digest_custom_procname = 'EVP_PKEY_meth_get_digest_custom'; {introduced 1.1.0} + + EVP_add_alg_module_procname = 'EVP_add_alg_module'; + + OpenSSL_add_all_ciphers_procname = 'OpenSSL_add_all_ciphers'; {removed 1.1.0} + + OpenSSL_add_all_digests_procname = 'OpenSSL_add_all_digests'; {removed 1.1.0} + + EVP_cleanup_procname = 'EVP_cleanup'; {removed 1.1.0} + +{$DEFINE EVP_md2_allownil} {removed 1.1.0 allow_nil} +{$DEFINE EVP_md4_allownil} {removed 1.1.0 allow_nil} +{$DEFINE EVP_md5_allownil} {removed 1.1.0 allow_nil} + + +//# define EVP_PKEY_assign_RSA(pkey,rsa) EVP_PKEY_assign((pkey),EVP_PKEY_RSA, (char *)(rsa)) +function _EVP_PKEY_assign_RSA(pkey: PEVP_PKEY; rsa: Pointer): TIdC_INT; cdecl; +begin + Result := EVP_PKEY_assign(pkey, EVP_PKEY_RSA, rsa); +end; + +//# define EVP_PKEY_assign_DSA(pkey,dsa) EVP_PKEY_assign((pkey),EVP_PKEY_DSA, (char *)(dsa)) +function _EVP_PKEY_assign_DSA(pkey: PEVP_PKEY; dsa: Pointer): TIdC_INT; cdecl; +begin + Result := EVP_PKEY_assign(pkey, EVP_PKEY_DSA, dsa); +end; + +//# define EVP_PKEY_assign_DH(pkey,dh) EVP_PKEY_assign((pkey),EVP_PKEY_DH, (char *)(dh)) +function _EVP_PKEY_assign_DH(pkey: PEVP_PKEY; dh: Pointer): TIdC_INT; cdecl; +begin + Result := EVP_PKEY_assign(pkey, EVP_PKEY_DH, dh); +end; + +//# define EVP_PKEY_assign_EC_KEY(pkey,eckey) EVP_PKEY_assign((pkey),EVP_PKEY_EC, (char *)(eckey)) +function _EVP_PKEY_assign_EC_KEY(pkey: PEVP_PKEY; eckey: Pointer): TIdC_INT; cdecl; +begin + Result := EVP_PKEY_assign(pkey, EVP_PKEY_EC, eckey); +end; + +//# define EVP_PKEY_assign_SIPHASH(pkey,shkey) EVP_PKEY_assign((pkey),EVP_PKEY_SIPHASH, (char *)(shkey)) +function _EVP_PKEY_assign_SIPHASH(pkey: PEVP_PKEY; shkey: Pointer): TIdC_INT; cdecl; +begin + Result := EVP_PKEY_assign(pkey, EVP_PKEY_SIPHASH, shkey); +end; + +//# define EVP_PKEY_assign_POLY1305(pkey,polykey) EVP_PKEY_assign((pkey),EVP_PKEY_POLY1305, (char *)(polykey)) +function _EVP_PKEY_assign_POLY1305(pkey: PEVP_PKEY; polykey: Pointer): TIdC_INT; cdecl; +begin + Result := EVP_PKEY_assign(pkey, EVP_PKEY_POLY1305, polykey); +end; + +procedure _OpenSSL_add_all_ciphers; cdecl; +begin + OPENSSL_init_crypto(OPENSSL_INIT_ADD_ALL_CIPHERS, nil); +end; + +procedure _OpenSSL_add_all_digests; cdecl; +begin + OPENSSL_init_crypto(OPENSSL_INIT_ADD_ALL_DIGESTS, Nil); +end; + +procedure _EVP_cleanup; cdecl; +begin +end; + +procedure _BIO_set_md(v1: PBIO; const md: PEVP_MD); cdecl; +begin + {define BIO_set_md(b,md) BIO_ctrl(b,BIO_C_SET_MD,0,(char *)(md))} + BIO_ctrl(v1,BIO_C_SET_MD,0,PIdAnsiChar(md)); +end; + + +{$IFNDEF OPENSSL_NO_MD2} +function _EVP_md2: PEVP_MD; cdecl; +begin + EIdAPIFunctionNotPresent.RaiseException(ROSUnsupported); +end; +{$ENDIF} + +{$IFNDEF OPENSSL_NO_MD4} +function _EVP_md4: PEVP_MD; cdecl; +begin + EIdAPIFunctionNotPresent.RaiseException(ROSUnsupported); +end; +{$ENDIF} + +{$IFNDEF OPENSSL_NO_MD5} +function _EVP_md5: PEVP_MD; cdecl; +begin + EIdAPIFunctionNotPresent.RaiseException(ROSUnsupported); +end; +{$ENDIF} + + +{forward_compatibility} +function FC_EVP_MD_CTX_new: PEVP_MD_CTX; cdecl; +begin + Result := AllocMem(SizeOf(EVP_MD_CTX)); + EVP_MD_CTX_init(Result); +end; + +procedure FC_EVP_MD_CTX_free(ctx: PEVP_MD_CTX); cdecl; +begin + EVP_MD_CTX_cleanup(ctx); + FreeMem(ctx,SizeOf(EVP_MD_CTX)); +end; + +{/forward_compatibility} +{$WARN NO_RETVAL OFF} +function ERR_EVP_PKEY_assign_RSA(pkey: PEVP_PKEY; rsa: Pointer): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_assign_RSA_procname); +end; + + +function ERR_EVP_PKEY_assign_DSA(pkey: PEVP_PKEY; dsa: Pointer): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_assign_DSA_procname); +end; + + +function ERR_EVP_PKEY_assign_DH(pkey: PEVP_PKEY; dh: Pointer): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_assign_DH_procname); +end; + + +function ERR_EVP_PKEY_assign_EC_KEY(pkey: PEVP_PKEY; eckey: Pointer): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_assign_EC_KEY_procname); +end; + + +function ERR_EVP_PKEY_assign_SIPHASH(pkey: PEVP_PKEY; shkey: Pointer): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_assign_SIPHASH_procname); +end; + + +function ERR_EVP_PKEY_assign_POLY1305(pkey: PEVP_PKEY; polykey: Pointer): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_assign_POLY1305_procname); +end; + + + +function ERR_EVP_MD_meth_new(md_type: TIdC_INT; pkey_type: TIdC_INT): PEVP_MD; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_MD_meth_new_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_MD_meth_dup(const md: PEVP_MD): PEVP_MD; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_MD_meth_dup_procname); +end; + + {introduced 1.1.0} +procedure ERR_EVP_MD_meth_free(md: PEVP_MD); +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_MD_meth_free_procname); +end; + + {introduced 1.1.0} + +function ERR_EVP_MD_meth_set_input_blocksize(md: PEVP_MD; blocksize: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_MD_meth_set_input_blocksize_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_MD_meth_set_result_size(md: PEVP_MD; resultsize: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_MD_meth_set_result_size_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_MD_meth_set_app_datasize(md: PEVP_MD; datasize: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_MD_meth_set_app_datasize_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_MD_meth_set_flags(md: PEVP_MD; flags: TIdC_ULONG): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_MD_meth_set_flags_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_MD_meth_set_init(md: PEVP_MD; init: EVP_MD_meth_init): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_MD_meth_set_init_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_MD_meth_set_update(md: PEVP_MD; update: EVP_MD_meth_update): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_MD_meth_set_update_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_MD_meth_set_final(md: PEVP_MD; final_: EVP_MD_meth_final): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_MD_meth_set_final_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_MD_meth_set_copy(md: PEVP_MD; copy: EVP_MD_meth_copy): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_MD_meth_set_copy_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_MD_meth_set_cleanup(md: PEVP_MD; cleanup: EVP_MD_meth_cleanup): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_MD_meth_set_cleanup_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_MD_meth_set_ctrl(md: PEVP_MD; ctrl: EVP_MD_meth_ctrl): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_MD_meth_set_ctrl_procname); +end; + + {introduced 1.1.0} + +function ERR_EVP_MD_meth_get_input_blocksize(const md: PEVP_MD): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_MD_meth_get_input_blocksize_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_MD_meth_get_result_size(const md: PEVP_MD): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_MD_meth_get_result_size_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_MD_meth_get_app_datasize(const md: PEVP_MD): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_MD_meth_get_app_datasize_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_MD_meth_get_flags(const md: PEVP_MD): TIdC_ULONG; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_MD_meth_get_flags_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_MD_meth_get_init(const md: PEVP_MD): EVP_MD_meth_init; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_MD_meth_get_init_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_MD_meth_get_update(const md: PEVP_MD): EVP_MD_meth_update; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_MD_meth_get_update_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_MD_meth_get_final(const md: PEVP_MD): EVP_MD_meth_final; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_MD_meth_get_final_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_MD_meth_get_copy(const md: PEVP_MD): EVP_MD_meth_copy; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_MD_meth_get_copy_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_MD_meth_get_cleanup(const md: PEVP_MD): EVP_MD_meth_cleanup; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_MD_meth_get_cleanup_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_MD_meth_get_ctrl(const md: PEVP_MD): EVP_MD_meth_ctrl; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_MD_meth_get_ctrl_procname); +end; + + {introduced 1.1.0} + +function ERR_EVP_CIPHER_meth_new(cipher_type: TIdC_INT; block_size: TIdC_INT; key_len: TIdC_INT): PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_CIPHER_meth_new_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_CIPHER_meth_dup(const cipher: PEVP_CIPHER): PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_CIPHER_meth_dup_procname); +end; + + {introduced 1.1.0} +procedure ERR_EVP_CIPHER_meth_free(cipher: PEVP_CIPHER); +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_CIPHER_meth_free_procname); +end; + + {introduced 1.1.0} + +function ERR_EVP_CIPHER_meth_set_iv_length(cipher: PEVP_CIPHER; iv_len: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_CIPHER_meth_set_iv_length_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_CIPHER_meth_set_flags(cipher: PEVP_CIPHER; flags: TIdC_ULONG): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_CIPHER_meth_set_flags_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_CIPHER_meth_set_impl_ctx_size(cipher: PEVP_CIPHER; ctx_size: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_CIPHER_meth_set_impl_ctx_size_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_CIPHER_meth_set_init(cipher: PEVP_CIPHER; init: EVP_CIPHER_meth_init): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_CIPHER_meth_set_init_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_CIPHER_meth_set_do_cipher(cipher: PEVP_CIPHER; do_cipher: EVP_CIPHER_meth_do_cipher): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_CIPHER_meth_set_do_cipher_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_CIPHER_meth_set_cleanup(cipher: PEVP_CIPHER; cleanup: EVP_CIPHER_meth_cleanup): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_CIPHER_meth_set_cleanup_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_CIPHER_meth_set_set_asn1_params(cipher: PEVP_CIPHER; set_asn1_parameters: EVP_CIPHER_meth_set_asn1_params): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_CIPHER_meth_set_set_asn1_params_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_CIPHER_meth_set_get_asn1_params(cipher: PEVP_CIPHER; get_asn1_parameters: EVP_CIPHER_meth_get_asn1_params): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_CIPHER_meth_set_get_asn1_params_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_CIPHER_meth_set_ctrl(cipher: PEVP_CIPHER; ctrl: EVP_CIPHER_meth_ctrl): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_CIPHER_meth_set_ctrl_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_CIPHER_meth_get_init(const cipher: PEVP_CIPHER): EVP_CIPHER_meth_init; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_CIPHER_meth_get_init_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_CIPHER_meth_get_do_cipher(const cipher: PEVP_CIPHER): EVP_CIPHER_meth_do_cipher; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_CIPHER_meth_get_do_cipher_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_CIPHER_meth_get_cleanup(const cipher: PEVP_CIPHER): EVP_CIPHER_meth_cleanup; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_CIPHER_meth_get_cleanup_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_CIPHER_meth_get_set_asn1_params(const cipher: PEVP_CIPHER): EVP_CIPHER_meth_set_asn1_params; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_CIPHER_meth_get_set_asn1_params_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_CIPHER_meth_get_get_asn1_params(const cipher: PEVP_CIPHER): EVP_CIPHER_meth_get_asn1_params; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_CIPHER_meth_get_get_asn1_params_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_CIPHER_meth_get_ctrl(const cipher: PEVP_CIPHER): EVP_CIPHER_meth_ctrl; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_CIPHER_meth_get_ctrl_procname); +end; + + {introduced 1.1.0} + + /// Add some extra combinations /// + //# define EVP_get_digestbynid(a) EVP_get_digestbyname(OBJ_nid2sn(a)); + //# define EVP_get_digestbyobj(a) EVP_get_digestbynid(OBJ_obj2nid(a)); + //# define EVP_get_cipherbynid(a) EVP_get_cipherbyname(OBJ_nid2sn(a)); + //# define EVP_get_cipherbyobj(a) EVP_get_cipherbynid(OBJ_obj2nid(a)); + +function ERR_EVP_MD_type(const md: PEVP_MD): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_MD_type_procname); +end; + + + //# define EVP_MD_nid(e) EVP_MD_type(e) + //# define EVP_MD_name(e) OBJ_nid2sn(EVP_MD_nid(e)) +function ERR_EVP_MD_pkey_type(const md: PEVP_MD): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_MD_pkey_type_procname); +end; + + +function ERR_EVP_MD_size(const md: PEVP_MD): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_MD_size_procname); +end; + + +function ERR_EVP_MD_block_size(const md: PEVP_MD): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_MD_block_size_procname); +end; + + +function ERR_EVP_MD_flags(const md: PEVP_MD): PIdC_ULONG; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_MD_flags_procname); +end; + + + +function ERR_EVP_MD_CTX_md(ctx: PEVP_MD_CTX): PEVP_MD; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_MD_CTX_md_procname); +end; + + +function ERR_EVP_MD_CTX_update_fn(ctx: PEVP_MD_CTX): EVP_MD_CTX_update; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_MD_CTX_update_fn_procname); +end; + + {introduced 1.1.0} +procedure ERR_EVP_MD_CTX_set_update_fn(ctx: PEVP_MD_CTX; update: EVP_MD_CTX_update); +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_MD_CTX_set_update_fn_procname); +end; + + {introduced 1.1.0} + // EVP_MD_CTX_size(e) EVP_MD_size(EVP_MD_CTX_md(e)) + // EVP_MD_CTX_block_size(e) EVP_MD_block_size(EVP_MD_CTX_md(e)) + // EVP_MD_CTX_type(e) EVP_MD_type(EVP_MD_CTX_md(e)) +function ERR_EVP_MD_CTX_pkey_ctx(const ctx: PEVP_MD_CTX): PEVP_PKEY_CTX; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_MD_CTX_pkey_ctx_procname); +end; + + +procedure ERR_EVP_MD_CTX_set_pkey_ctx(ctx: PEVP_MD_CTX; pctx: PEVP_PKEY_CTX); +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_MD_CTX_set_pkey_ctx_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_MD_CTX_md_data(const ctx: PEVP_MD_CTX): Pointer; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_MD_CTX_md_data_procname); +end; + + + +function ERR_EVP_CIPHER_nid(const ctx: PEVP_MD_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_CIPHER_nid_procname); +end; + + + //# define EVP_CIPHER_name(e) OBJ_nid2sn(EVP_CIPHER_nid(e)) +function ERR_EVP_CIPHER_block_size(const cipher: PEVP_CIPHER): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_CIPHER_block_size_procname); +end; + + +function ERR_EVP_CIPHER_impl_ctx_size(const cipher: PEVP_CIPHER): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_CIPHER_impl_ctx_size_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_CIPHER_key_length(const cipher: PEVP_CIPHER): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_CIPHER_key_length_procname); +end; + + +function ERR_EVP_CIPHER_iv_length(const cipher: PEVP_CIPHER): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_CIPHER_iv_length_procname); +end; + + +function ERR_EVP_CIPHER_flags(const cipher: PEVP_CIPHER): TIdC_ULONG; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_CIPHER_flags_procname); +end; + + + //# define EVP_CIPHER_mode(e) (EVP_CIPHER_flags(e) & EVP_CIPH_MODE) + +function ERR_EVP_CIPHER_CTX_cipher(const ctx: PEVP_CIPHER_CTX): PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_CIPHER_CTX_cipher_procname); +end; + + +function ERR_EVP_CIPHER_CTX_encrypting(const ctx: PEVP_CIPHER_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_CIPHER_CTX_encrypting_procname); +end; + + +function ERR_EVP_CIPHER_CTX_nid(const ctx: PEVP_CIPHER_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_CIPHER_CTX_nid_procname); +end; + + +function ERR_EVP_CIPHER_CTX_block_size(const ctx: PEVP_CIPHER_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_CIPHER_CTX_block_size_procname); +end; + + +function ERR_EVP_CIPHER_CTX_key_length(const ctx: PEVP_CIPHER_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_CIPHER_CTX_key_length_procname); +end; + + +function ERR_EVP_CIPHER_CTX_iv_length(const ctx: PEVP_CIPHER_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_CIPHER_CTX_iv_length_procname); +end; + + +function ERR_EVP_CIPHER_CTX_iv(const ctx: PEVP_CIPHER_CTX): PByte; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_CIPHER_CTX_iv_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_CIPHER_CTX_original_iv(const ctx: PEVP_CIPHER_CTX): PByte; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_CIPHER_CTX_original_iv_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_CIPHER_CTX_iv_noconst(ctx: PEVP_CIPHER_CTX): PByte; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_CIPHER_CTX_iv_noconst_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_CIPHER_CTX_buf_noconst(ctx: PEVP_CIPHER_CTX): PByte; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_CIPHER_CTX_buf_noconst_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_CIPHER_CTX_num(const ctx: PEVP_CIPHER_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_CIPHER_CTX_num_procname); +end; + + +procedure ERR_EVP_CIPHER_CTX_set_num(ctx: PEVP_CIPHER_CTX; num: TIdC_INT); +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_CIPHER_CTX_set_num_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_CIPHER_CTX_copy(out_: PEVP_CIPHER_CTX; const in_: PEVP_CIPHER_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_CIPHER_CTX_copy_procname); +end; + + +function ERR_EVP_CIPHER_CTX_get_app_data(const ctx: PEVP_CIPHER_CTX): Pointer; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_CIPHER_CTX_get_app_data_procname); +end; + + +procedure ERR_EVP_CIPHER_CTX_set_app_data(ctx: PEVP_CIPHER_CTX; data: Pointer); +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_CIPHER_CTX_set_app_data_procname); +end; + + +function ERR_EVP_CIPHER_CTX_get_cipher_data(const ctx: PEVP_CIPHER_CTX): Pointer; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_CIPHER_CTX_get_cipher_data_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_CIPHER_CTX_set_cipher_data(ctx: PEVP_CIPHER_CTX; cipher_data: Pointer): Pointer; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_CIPHER_CTX_set_cipher_data_procname); +end; + + {introduced 1.1.0} + + //# define EVP_CIPHER_CTX_type(c) EVP_CIPHER_type(EVP_CIPHER_CTX_cipher(c)) + //# if OPENSSL_API_COMPAT < 0x10100000L + //# define EVP_CIPHER_CTX_flags(c) EVP_CIPHER_flags(EVP_CIPHER_CTX_cipher(c)) + //# endif + //# define EVP_CIPHER_CTX_mode(c) EVP_CIPHER_mode(EVP_CIPHER_CTX_cipher(c)) + // + //# define EVP_ENCODE_LENGTH(l) ((((l)+2)/3*4)+((l)/48+1)*2+80) + //# define EVP_DECODE_LENGTH(l) (((l)+3)/4*3+80) + // + //# define EVP_SignInit_ex(a;b;c) EVP_DigestInit_ex(a;b;c) + //# define EVP_SignInit(a;b) EVP_DigestInit(a;b) + //# define EVP_SignUpdate(a;b;c) EVP_DigestUpdate(a;b;c) + //# define EVP_VerifyInit_ex(a;b;c) EVP_DigestInit_ex(a;b;c) + //# define EVP_VerifyInit(a;b) EVP_DigestInit(a;b) + //# define EVP_VerifyUpdate(a;b;c) EVP_DigestUpdate(a;b;c) + //# define EVP_OpenUpdate(a;b;c;d;e) EVP_DecryptUpdate(a;b;c;d;e) + //# define EVP_SealUpdate(a;b;c;d;e) EVP_EncryptUpdate(a;b;c;d;e) + //# define EVP_DigestSignUpdate(a;b;c) EVP_DigestUpdate(a;b;c) + //# define EVP_DigestVerifyUpdate(a;b;c) EVP_DigestUpdate(a;b;c) + +procedure ERR_BIO_set_md(v1: PBIO; const md: PEVP_MD); +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_set_md_procname); +end; + + + //# define BIO_get_md(b;mdp) BIO_ctrl(b;BIO_C_GET_MD;0;(PIdAnsiChar)(mdp)) + //# define BIO_get_md_ctx(b;mdcp) BIO_ctrl(b;BIO_C_GET_MD_CTX;0; (PIdAnsiChar)(mdcp)) + //# define BIO_set_md_ctx(b;mdcp) BIO_ctrl(b;BIO_C_SET_MD_CTX;0; (PIdAnsiChar)(mdcp)) + //# define BIO_get_cipher_status(b) BIO_ctrl(b;BIO_C_GET_CIPHER_STATUS;0;NULL) + //# define BIO_get_cipher_ctx(b;c_pp) BIO_ctrl(b;BIO_C_GET_CIPHER_CTX;0; (PIdAnsiChar)(c_pp)) + + //function EVP_Cipher(c: PEVP_CIPHER_CTX; out_: PByte; const in_: PByte; in1: TIdC_UINT): TIdC_INT; + + //# define EVP_add_cipher_alias(n;alias) OBJ_NAME_add((alias);OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS;(n)) + //# define EVP_add_digest_alias(n;alias) OBJ_NAME_add((alias);OBJ_NAME_TYPE_MD_METH|OBJ_NAME_ALIAS;(n)) + //# define EVP_delete_cipher_alias(alias) OBJ_NAME_remove(alias;OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS); + //# define EVP_delete_digest_alias(alias) OBJ_NAME_remove(alias;OBJ_NAME_TYPE_MD_METH|OBJ_NAME_ALIAS); + + //void EVP_MD_CTX_init(EVP_MD_CTX *ctx); + //int EVP_MD_CTX_cleanup(EVP_MD_CTX *ctx); +procedure ERR_EVP_MD_CTX_init(ctx : PEVP_MD_CTX); +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_MD_CTX_init_procname); +end; + + +function ERR_EVP_MD_CTX_cleanup(ctx : PEVP_MD_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_MD_CTX_cleanup_procname); +end; + + + +function ERR_EVP_MD_CTX_ctrl(ctx: PEVP_MD_CTX; cmd: TIdC_INT; p1: TIdC_INT; p2: Pointer): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_MD_CTX_ctrl_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_MD_CTX_new: PEVP_MD_CTX; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_MD_CTX_new_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_MD_CTX_reset(ctx: PEVP_MD_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_MD_CTX_reset_procname); +end; + + {introduced 1.1.0} +procedure ERR_EVP_MD_CTX_free(ctx: PEVP_MD_CTX); +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_MD_CTX_free_procname); +end; + + {introduced 1.1.0} + //# define EVP_MD_CTX_create() EVP_MD_CTX_new() + //# define EVP_MD_CTX_init(ctx) EVP_MD_CTX_reset((ctx)) + //# define EVP_MD_CTX_destroy(ctx) EVP_MD_CTX_free((ctx)) +function ERR_EVP_MD_CTX_copy_ex(out_: PEVP_MD_CTX; const in_: PEVP_MD_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_MD_CTX_copy_ex_procname); +end; + + +procedure ERR_EVP_MD_CTX_set_flags(ctx: PEVP_MD_CTX; flags: TIdC_INT); +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_MD_CTX_set_flags_procname); +end; + + +procedure ERR_EVP_MD_CTX_clear_flags(ctx: PEVP_MD_CTX; flags: TIdC_INT); +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_MD_CTX_clear_flags_procname); +end; + + +function ERR_EVP_MD_CTX_test_flags(const ctx: PEVP_MD_CTX; flags: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_MD_CTX_test_flags_procname); +end; + + +function ERR_EVP_DigestInit_ex(ctx: PEVP_MD_CTX; const type_: PEVP_MD; impl: PENGINE): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_DigestInit_ex_procname); +end; + + +function ERR_EVP_DigestUpdate(ctx: PEVP_MD_CTX; const d: Pointer; cnt: TIdC_SIZET): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_DigestUpdate_procname); +end; + + +function ERR_EVP_DigestFinal_ex(ctx: PEVP_MD_CTX; md: PByte; var s: TIdC_UINT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_DigestFinal_ex_procname); +end; + + +function ERR_EVP_Digest(const data: Pointer; count: TIdC_SIZET; md: PByte; size: PIdC_UINT; const type_: PEVP_MD; impl: PENGINE): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_Digest_procname); +end; + + + +function ERR_EVP_MD_CTX_copy(out_: PEVP_MD_CTX; const in_: PEVP_MD_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_MD_CTX_copy_procname); +end; + + +function ERR_EVP_DigestInit(ctx: PEVP_MD_CTX; const type_: PEVP_MD): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_DigestInit_procname); +end; + + +function ERR_EVP_DigestFinal(ctx: PEVP_MD_CTX; md: PByte; var s: TIdC_UINT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_DigestFinal_procname); +end; + + +function ERR_EVP_DigestFinalXOF(ctx: PEVP_MD_CTX; md: PByte; len: TIdC_SIZET): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_DigestFinalXOF_procname); +end; + + {introduced 1.1.0} + +function ERR_EVP_read_pw_string(buf: PIdAnsiChar; length: TIdC_INT; const prompt: PIdAnsiChar; verify: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_read_pw_string_procname); +end; + + +function ERR_EVP_read_pw_string_min(buf: PIdAnsiChar; minlen: TIdC_INT; maxlen: TIdC_INT; const prompt: PIdAnsiChar; verify: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_read_pw_string_min_procname); +end; + + +procedure ERR_EVP_set_pw_prompt(const prompt: PIdAnsiChar); +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_set_pw_prompt_procname); +end; + + +function ERR_EVP_get_pw_prompt: PIdAnsiChar; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_get_pw_prompt_procname); +end; + + +function ERR_EVP_BytesToKey(const type_: PEVP_CIPHER; const md: PEVP_MD; const salt: PByte; const data: PByte; data1: TIdC_INT; count: TIdC_INT; key: PByte; iv: PByte): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_BytesToKey_procname); +end; + + + +procedure ERR_EVP_CIPHER_CTX_set_flags(ctx: PEVP_CIPHER_CTX; flags: TIdC_INT); +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_CIPHER_CTX_set_flags_procname); +end; + + +procedure ERR_EVP_CIPHER_CTX_clear_flags(ctx: PEVP_CIPHER_CTX; flags: TIdC_INT); +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_CIPHER_CTX_clear_flags_procname); +end; + + +function ERR_EVP_CIPHER_CTX_test_flags(const ctx: PEVP_CIPHER_CTX; flags: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_CIPHER_CTX_test_flags_procname); +end; + + + +function ERR_EVP_EncryptInit(ctx: PEVP_CIPHER_CTX; const cipher: PEVP_CIPHER; const key: PByte; const iv: PByte): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_EncryptInit_procname); +end; + + +function ERR_EVP_EncryptInit_ex(ctx: PEVP_CIPHER_CTX; const cipher: PEVP_CIPHER; impl: PENGINE; const key: PByte; const iv: PByte): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_EncryptInit_ex_procname); +end; + + +function ERR_EVP_EncryptUpdate(ctx: PEVP_CIPHER_CTX; out_: PByte; out1: PIdC_INT; const in_: PByte; in_1: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_EncryptUpdate_procname); +end; + + +function ERR_EVP_EncryptFinal_ex(ctx: PEVP_CIPHER_CTX; out_: PByte; out1: PIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_EncryptFinal_ex_procname); +end; + + +function ERR_EVP_EncryptFinal(ctx: PEVP_CIPHER_CTX; out_: PByte; out1: PIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_EncryptFinal_procname); +end; + + + +function ERR_EVP_DecryptInit(ctx: PEVP_CIPHER_CTX; out_: PByte; out1: PidC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_DecryptInit_procname); +end; + + +function ERR_EVP_DecryptInit_ex(ctx: PEVP_CIPHER_CTX; const cipher: PEVP_CIPHER; impl: PENGINE; const key: PByte; const iv: PByte): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_DecryptInit_ex_procname); +end; + + +function ERR_EVP_DecryptUpdate(ctx: PEVP_CIPHER_CTX; out_: PByte; out1: PIdC_INT; const in_: PByte; in_1: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_DecryptUpdate_procname); +end; + + +function ERR_EVP_DecryptFinal(ctx: PEVP_CIPHER_CTX; outm: PByte; out1: PIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_DecryptFinal_procname); +end; + + +function ERR_EVP_DecryptFinal_ex(ctx: PEVP_MD_CTX; outm: PByte; out1: PIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_DecryptFinal_ex_procname); +end; + + + +function ERR_EVP_CipherInit(ctx: PEVP_CIPHER_CTX; const cipher: PEVP_CIPHER; const key: PByte; const iv: PByte; enc: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_CipherInit_procname); +end; + + +function ERR_EVP_CipherInit_ex(ctx: PEVP_CIPHER_CTX; const cipher: PEVP_CIPHER; impl: PENGINE; const key: PByte; const iv: PByte; enc: TidC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_CipherInit_ex_procname); +end; + + +function ERR_EVP_CipherUpdate(ctx: PEVP_CIPHER_CTX; out_: PByte; out1: PIdC_INT; const in_: PByte; in1: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_CipherUpdate_procname); +end; + + +function ERR_EVP_CipherFinal(ctx: PEVP_CIPHER_CTX; outm: PByte; out1: PIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_CipherFinal_procname); +end; + + +function ERR_EVP_CipherFinal_ex(ctx: PEVP_CIPHER_CTX; outm: PByte; out1: PIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_CipherFinal_ex_procname); +end; + + + +function ERR_EVP_SignFinal(ctx: PEVP_CIPHER_CTX; md: PByte; s: PIdC_UINT; pkey: PEVP_PKEY): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_SignFinal_procname); +end; + + + +function ERR_EVP_DigestSign(ctx: PEVP_CIPHER_CTX; sigret: PByte; siglen: PIdC_SIZET; const tbs: PByte; tbslen: TIdC_SIZET): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_DigestSign_procname); +end; + + {introduced 1.1.0} + +function ERR_EVP_VerifyFinal(ctx: PEVP_MD_CTX; const sigbuf: PByte; siglen: TIdC_UINT; pkey: PEVP_PKEY): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_VerifyFinal_procname); +end; + + + +function ERR_EVP_DigestVerify(ctx: PEVP_CIPHER_CTX; const sigret: PByte; siglen: TIdC_SIZET; const tbs: PByte; tbslen: TIdC_SIZET): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_DigestVerify_procname); +end; + + {introduced 1.1.0} + +function ERR_EVP_DigestSignInit(ctx: PEVP_MD_CTX; pctx: PPEVP_PKEY_CTX; const type_: PEVP_MD; e: PENGINE; pkey: PEVP_PKEY): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_DigestSignInit_procname); +end; + + +function ERR_EVP_DigestSignFinal(ctx: PEVP_MD_CTX; sigret: PByte; siglen: PIdC_SIZET): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_DigestSignFinal_procname); +end; + + + +function ERR_EVP_DigestVerifyInit(ctx: PEVP_MD_CTX; ppctx: PPEVP_PKEY_CTX; const type_: PEVP_MD; e: PENGINE; pkey: PEVP_PKEY): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_DigestVerifyInit_procname); +end; + + +function ERR_EVP_DigestVerifyFinal(ctx: PEVP_MD_CTX; const sig: PByte; siglen: TIdC_SIZET): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_DigestVerifyFinal_procname); +end; + + + +function ERR_EVP_OpenInit(ctx: PEVP_CIPHER_CTX; const type_: PEVP_CIPHER; const ek: PByte; ek1: TIdC_INT; const iv: PByte; priv: PEVP_PKEY): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_OpenInit_procname); +end; + + +function ERR_EVP_OpenFinal(ctx: PEVP_CIPHER_CTX; out_: PByte; out1: PIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_OpenFinal_procname); +end; + + + +function ERR_EVP_SealInit(ctx: PEVP_CIPHER_CTX; const type_: EVP_CIPHER; ek: PPByte; ek1: PIdC_INT; iv: PByte; pubk: PPEVP_PKEY; npubk: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_SealInit_procname); +end; + + +function ERR_EVP_SealFinal(ctx: PEVP_CIPHER_CTX; out_: PByte; out1: PIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_SealFinal_procname); +end; + + + +function ERR_EVP_ENCODE_CTX_new: PEVP_ENCODE_CTX; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_ENCODE_CTX_new_procname); +end; + + {introduced 1.1.0} +procedure ERR_EVP_ENCODE_CTX_free(ctx: PEVP_ENCODE_CTX); +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_ENCODE_CTX_free_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_ENCODE_CTX_copy(dctx: PEVP_ENCODE_CTX; sctx: PEVP_ENCODE_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_ENCODE_CTX_copy_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_ENCODE_CTX_num(ctx: PEVP_ENCODE_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_ENCODE_CTX_num_procname); +end; + + {introduced 1.1.0} +procedure ERR_EVP_EncodeInit(ctx: PEVP_ENCODE_CTX); +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_EncodeInit_procname); +end; + + +function ERR_EVP_EncodeUpdate(ctx: PEVP_ENCODE_CTX; out_: PByte; out1: PIdC_INT; const in_: PByte; in1: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_EncodeUpdate_procname); +end; + + +procedure ERR_EVP_EncodeFinal(ctx: PEVP_ENCODE_CTX; out_: PByte; out1: PIdC_INT); +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_EncodeFinal_procname); +end; + + +function ERR_EVP_EncodeBlock(t: PByte; const f: PByte; n: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_EncodeBlock_procname); +end; + + + +procedure ERR_EVP_DecodeInit(ctx: PEVP_ENCODE_CTX); +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_DecodeInit_procname); +end; + + +function ERR_EVP_DecodeUpdate(ctx: PEVP_ENCODE_CTX; out_: PByte; out1: PIdC_INT; const in_: PByte; in1: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_DecodeUpdate_procname); +end; + + +function ERR_EVP_DecodeFinal(ctx: PEVP_ENCODE_CTX; out_: PByte; out1: PIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_DecodeFinal_procname); +end; + + +function ERR_EVP_DecodeBlock(t: PByte; const f: PByte; n: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_DecodeBlock_procname); +end; + + + +function ERR_EVP_CIPHER_CTX_new: PEVP_CIPHER_CTX; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_CIPHER_CTX_new_procname); +end; + + +function ERR_EVP_CIPHER_CTX_reset(c: PEVP_CIPHER_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_CIPHER_CTX_reset_procname); +end; + + {introduced 1.1.0} +procedure ERR_EVP_CIPHER_CTX_free(c: PEVP_CIPHER_CTX); +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_CIPHER_CTX_free_procname); +end; + + +function ERR_EVP_CIPHER_CTX_set_key_length(x: PEVP_CIPHER_CTX; keylen: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_CIPHER_CTX_set_key_length_procname); +end; + + +function ERR_EVP_CIPHER_CTX_set_padding(c: PEVP_CIPHER_CTX; pad: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_CIPHER_CTX_set_padding_procname); +end; + + +function ERR_EVP_CIPHER_CTX_ctrl(ctx: PEVP_CIPHER_CTX; type_: TIdC_INT; arg: TIdC_INT; ptr: Pointer): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_CIPHER_CTX_ctrl_procname); +end; + + +function ERR_EVP_CIPHER_CTX_rand_key(ctx: PEVP_CIPHER_CTX; key: PByte): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_CIPHER_CTX_rand_key_procname); +end; + + + +function ERR_BIO_f_md: PBIO_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_f_md_procname); +end; + + +function ERR_BIO_f_base64: PBIO_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_f_base64_procname); +end; + + +function ERR_BIO_f_cipher: PBIO_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_f_cipher_procname); +end; + + +function ERR_BIO_f_reliable: PBIO_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_f_reliable_procname); +end; + + +function ERR_BIO_set_cipher(b: PBIO; c: PEVP_CIPHER; const k: PByte; const i: PByte; enc: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_set_cipher_procname); +end; + + + +function ERR_EVP_md_null: PEVP_MD; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_md_null_procname); +end; + + + +function ERR_EVP_md2: PEVP_MD; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_md2_procname); +end; + + {removed 1.1.0 allow_nil} +function ERR_EVP_md4: PEVP_MD; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_md4_procname); +end; + + {removed 1.1.0 allow_nil} +function ERR_EVP_md5: PEVP_MD; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_md5_procname); +end; + + {removed 1.1.0 allow_nil} +function ERR_EVP_md5_sha1: PEVP_MD; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_md5_sha1_procname); +end; + + {introduced 1.1.0} + +function ERR_EVP_sha1: PEVP_MD; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_sha1_procname); +end; + + +function ERR_EVP_sha224: PEVP_MD; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_sha224_procname); +end; + + +function ERR_EVP_sha256: PEVP_MD; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_sha256_procname); +end; + + +function ERR_EVP_sha384: PEVP_MD; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_sha384_procname); +end; + + +function ERR_EVP_sha512: PEVP_MD; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_sha512_procname); +end; + + +function ERR_EVP_sha512_224: PEVP_MD; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_sha512_224_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_sha512_256: PEVP_MD; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_sha512_256_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_sha3_224: PEVP_MD; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_sha3_224_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_sha3_256: PEVP_MD; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_sha3_256_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_sha3_384: PEVP_MD; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_sha3_384_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_sha3_512: PEVP_MD; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_sha3_512_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_shake128: PEVP_MD; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_shake128_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_shake256: PEVP_MD; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_shake256_procname); +end; + + {introduced 1.1.0} + + (* does nothing :-) *) +function ERR_EVP_enc_null: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_enc_null_procname); +end; + + + +function ERR_EVP_des_ecb: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_des_ecb_procname); +end; + + +function ERR_EVP_des_ede: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_des_ede_procname); +end; + + +function ERR_EVP_des_ede3: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_des_ede3_procname); +end; + + +function ERR_EVP_des_ede_ecb: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_des_ede_ecb_procname); +end; + + +function ERR_EVP_des_ede3_ecb: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_des_ede3_ecb_procname); +end; + + +function ERR_EVP_des_cfb64: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_des_cfb64_procname); +end; + + + //EVP_des_cfb EVP_des_cfb64 +function ERR_EVP_des_cfb1: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_des_cfb1_procname); +end; + + +function ERR_EVP_des_cfb8: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_des_cfb8_procname); +end; + + +function ERR_EVP_des_ede_cfb64: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_des_ede_cfb64_procname); +end; + + +function ERR_EVP_des_ede3_cfb64: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_des_ede3_cfb64_procname); +end; + + + //EVP_des_ede3_cfb EVP_des_ede3_cfb64 +function ERR_EVP_des_ede3_cfb1: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_des_ede3_cfb1_procname); +end; + + +function ERR_EVP_des_ede3_cfb8: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_des_ede3_cfb8_procname); +end; + + +function ERR_EVP_des_ofb: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_des_ofb_procname); +end; + + +function ERR_EVP_des_ede_ofb: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_des_ede_ofb_procname); +end; + + +function ERR_EVP_des_ede3_ofb: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_des_ede3_ofb_procname); +end; + + +function ERR_EVP_des_cbc: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_des_cbc_procname); +end; + + +function ERR_EVP_des_ede_cbc: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_des_ede_cbc_procname); +end; + + +function ERR_EVP_des_ede3_cbc: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_des_ede3_cbc_procname); +end; + + +function ERR_EVP_desx_cbc: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_desx_cbc_procname); +end; + + +function ERR_EVP_des_ede3_wrap: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_des_ede3_wrap_procname); +end; + + + // + // This should now be supported through the dev_crypto ENGINE. But also, why + // are rc4 and md5 declarations made here inside a "NO_DES" precompiler + // branch? + // +function ERR_EVP_rc4: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_rc4_procname); +end; + + +function ERR_EVP_rc4_40: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_rc4_40_procname); +end; + + +// function EVP_idea_ecb: PEVP_CIPHER; +// function EVP_idea_cfb64: PEVP_CIPHER; + //EVP_idea_cfb EVP_idea_cfb64 +// function EVP_idea_ofb: PEVP_CIPHER; + // function EVP_idea_cbc: PEVP_CIPHER; +function ERR_EVP_rc2_ecb: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_rc2_ecb_procname); +end; + + +function ERR_EVP_rc2_cbc: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_rc2_cbc_procname); +end; + + +function ERR_EVP_rc2_40_cbc: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_rc2_40_cbc_procname); +end; + + +function ERR_EVP_rc2_64_cbc: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_rc2_64_cbc_procname); +end; + + +function ERR_EVP_rc2_cfb64: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_rc2_cfb64_procname); +end; + + + //EVP_rc2_cfb EVP_rc2_cfb64 +function ERR_EVP_rc2_ofb: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_rc2_ofb_procname); +end; + + +function ERR_EVP_bf_ecb: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_bf_ecb_procname); +end; + + +function ERR_EVP_bf_cbc: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_bf_cbc_procname); +end; + + +function ERR_EVP_bf_cfb64: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_bf_cfb64_procname); +end; + + + //EVP_bf_cfb EVP_bf_cfb64 +function ERR_EVP_bf_ofb: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_bf_ofb_procname); +end; + + +function ERR_EVP_cast5_ecb: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_cast5_ecb_procname); +end; + + +function ERR_EVP_cast5_cbc: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_cast5_cbc_procname); +end; + + +function ERR_EVP_cast5_cfb64: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_cast5_cfb64_procname); +end; + + + //EVP_cast5_cfb EVP_cast5_cfb64 +function ERR_EVP_cast5_ofb: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_cast5_ofb_procname); +end; + + +// function EVP_rc5_32_12_16_cbc: PEVP_CIPHER; +// function EVP_rc5_32_12_16_ecb: PEVP_CIPHER; +// function EVP_rc5_32_12_16_cfb64: PEVP_CIPHER; + //EVP_rc5_32_12_16_cfb EVP_rc5_32_12_16_cfb64 +// function EVP_rc5_32_12_16_ofb: PEVP_CIPHER; + +function ERR_EVP_aes_128_ecb: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_aes_128_ecb_procname); +end; + + +function ERR_EVP_aes_128_cbc: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_aes_128_cbc_procname); +end; + + +function ERR_EVP_aes_128_cfb1: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_aes_128_cfb1_procname); +end; + + +function ERR_EVP_aes_128_cfb8: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_aes_128_cfb8_procname); +end; + + +function ERR_EVP_aes_128_cfb128: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_aes_128_cfb128_procname); +end; + + + //EVP_aes_128_cfb EVP_aes_128_cfb128 +function ERR_EVP_aes_128_ofb: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_aes_128_ofb_procname); +end; + + +function ERR_EVP_aes_128_ctr: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_aes_128_ctr_procname); +end; + + +function ERR_EVP_aes_128_ccm: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_aes_128_ccm_procname); +end; + + +function ERR_EVP_aes_128_gcm: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_aes_128_gcm_procname); +end; + + +function ERR_EVP_aes_128_xts: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_aes_128_xts_procname); +end; + + +function ERR_EVP_aes_128_wrap: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_aes_128_wrap_procname); +end; + + +function ERR_EVP_aes_128_wrap_pad: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_aes_128_wrap_pad_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_aes_128_ocb: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_aes_128_ocb_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_aes_192_ecb: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_aes_192_ecb_procname); +end; + + +function ERR_EVP_aes_192_cbc: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_aes_192_cbc_procname); +end; + + +function ERR_EVP_aes_192_cfb1: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_aes_192_cfb1_procname); +end; + + +function ERR_EVP_aes_192_cfb8: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_aes_192_cfb8_procname); +end; + + +function ERR_EVP_aes_192_cfb128: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_aes_192_cfb128_procname); +end; + + + //EVP_aes_192_cfb EVP_aes_192_cfb128 +function ERR_EVP_aes_192_ofb: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_aes_192_ofb_procname); +end; + + +function ERR_EVP_aes_192_ctr: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_aes_192_ctr_procname); +end; + + +function ERR_EVP_aes_192_ccm: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_aes_192_ccm_procname); +end; + + +function ERR_EVP_aes_192_gcm: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_aes_192_gcm_procname); +end; + + +function ERR_EVP_aes_192_wrap: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_aes_192_wrap_procname); +end; + + +function ERR_EVP_aes_192_wrap_pad: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_aes_192_wrap_pad_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_aes_192_ocb: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_aes_192_ocb_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_aes_256_ecb: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_aes_256_ecb_procname); +end; + + +function ERR_EVP_aes_256_cbc: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_aes_256_cbc_procname); +end; + + +function ERR_EVP_aes_256_cfb1: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_aes_256_cfb1_procname); +end; + + +function ERR_EVP_aes_256_cfb8: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_aes_256_cfb8_procname); +end; + + +function ERR_EVP_aes_256_cfb128: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_aes_256_cfb128_procname); +end; + + + //EVP_aes_256_cfb EVP_aes_256_cfb128 +function ERR_EVP_aes_256_ofb: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_aes_256_ofb_procname); +end; + + +function ERR_EVP_aes_256_ctr: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_aes_256_ctr_procname); +end; + + +function ERR_EVP_aes_256_ccm: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_aes_256_ccm_procname); +end; + + +function ERR_EVP_aes_256_gcm: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_aes_256_gcm_procname); +end; + + +function ERR_EVP_aes_256_xts: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_aes_256_xts_procname); +end; + + +function ERR_EVP_aes_256_wrap: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_aes_256_wrap_procname); +end; + + +function ERR_EVP_aes_256_wrap_pad: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_aes_256_wrap_pad_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_aes_256_ocb: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_aes_256_ocb_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_aes_128_cbc_hmac_sha1: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_aes_128_cbc_hmac_sha1_procname); +end; + + +function ERR_EVP_aes_256_cbc_hmac_sha1: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_aes_256_cbc_hmac_sha1_procname); +end; + + +function ERR_EVP_aes_128_cbc_hmac_sha256: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_aes_128_cbc_hmac_sha256_procname); +end; + + +function ERR_EVP_aes_256_cbc_hmac_sha256: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_aes_256_cbc_hmac_sha256_procname); +end; + + + +function ERR_EVP_aria_128_ecb: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_aria_128_ecb_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_aria_128_cbc: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_aria_128_cbc_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_aria_128_cfb1: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_aria_128_cfb1_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_aria_128_cfb8: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_aria_128_cfb8_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_aria_128_cfb128: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_aria_128_cfb128_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_aria_128_ctr: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_aria_128_ctr_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_aria_128_ofb: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_aria_128_ofb_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_aria_128_gcm: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_aria_128_gcm_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_aria_128_ccm: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_aria_128_ccm_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_aria_192_ecb: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_aria_192_ecb_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_aria_192_cbc: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_aria_192_cbc_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_aria_192_cfb1: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_aria_192_cfb1_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_aria_192_cfb8: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_aria_192_cfb8_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_aria_192_cfb128: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_aria_192_cfb128_procname); +end; + + {introduced 1.1.0} + //EVP_aria_192_cfb EVP_aria_192_cfb128 +function ERR_EVP_aria_192_ctr: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_aria_192_ctr_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_aria_192_ofb: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_aria_192_ofb_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_aria_192_gcm: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_aria_192_gcm_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_aria_192_ccm: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_aria_192_ccm_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_aria_256_ecb: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_aria_256_ecb_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_aria_256_cbc: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_aria_256_cbc_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_aria_256_cfb1: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_aria_256_cfb1_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_aria_256_cfb8: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_aria_256_cfb8_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_aria_256_cfb128: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_aria_256_cfb128_procname); +end; + + {introduced 1.1.0} + //EVP_aria_256_cfb EVP_aria_256_cfb128 +function ERR_EVP_aria_256_ctr: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_aria_256_ctr_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_aria_256_ofb: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_aria_256_ofb_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_aria_256_gcm: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_aria_256_gcm_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_aria_256_ccm: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_aria_256_ccm_procname); +end; + + {introduced 1.1.0} + +function ERR_EVP_camellia_128_ecb: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_camellia_128_ecb_procname); +end; + + +function ERR_EVP_camellia_128_cbc: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_camellia_128_cbc_procname); +end; + + +function ERR_EVP_camellia_128_cfb1: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_camellia_128_cfb1_procname); +end; + + +function ERR_EVP_camellia_128_cfb8: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_camellia_128_cfb8_procname); +end; + + +function ERR_EVP_camellia_128_cfb128: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_camellia_128_cfb128_procname); +end; + + + //EVP_camellia_128_cfb EVP_camellia_128_cfb128 +function ERR_EVP_camellia_128_ofb: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_camellia_128_ofb_procname); +end; + + +function ERR_EVP_camellia_128_ctr: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_camellia_128_ctr_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_camellia_192_ecb: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_camellia_192_ecb_procname); +end; + + +function ERR_EVP_camellia_192_cbc: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_camellia_192_cbc_procname); +end; + + +function ERR_EVP_camellia_192_cfb1: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_camellia_192_cfb1_procname); +end; + + +function ERR_EVP_camellia_192_cfb8: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_camellia_192_cfb8_procname); +end; + + +function ERR_EVP_camellia_192_cfb128: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_camellia_192_cfb128_procname); +end; + + + //EVP_camellia_192_cfb EVP_camellia_192_cfb128 +function ERR_EVP_camellia_192_ofb: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_camellia_192_ofb_procname); +end; + + +function ERR_EVP_camellia_192_ctr: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_camellia_192_ctr_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_camellia_256_ecb: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_camellia_256_ecb_procname); +end; + + +function ERR_EVP_camellia_256_cbc: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_camellia_256_cbc_procname); +end; + + +function ERR_EVP_camellia_256_cfb1: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_camellia_256_cfb1_procname); +end; + + +function ERR_EVP_camellia_256_cfb8: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_camellia_256_cfb8_procname); +end; + + +function ERR_EVP_camellia_256_cfb128: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_camellia_256_cfb128_procname); +end; + + + //EVP_camellia_256_cfb EVP_camellia_256_cfb128 +function ERR_EVP_camellia_256_ofb: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_camellia_256_ofb_procname); +end; + + +function ERR_EVP_camellia_256_ctr: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_camellia_256_ctr_procname); +end; + + {introduced 1.1.0} + +function ERR_EVP_chacha20: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_chacha20_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_chacha20_poly1305: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_chacha20_poly1305_procname); +end; + + {introduced 1.1.0} + +function ERR_EVP_seed_ecb: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_seed_ecb_procname); +end; + + +function ERR_EVP_seed_cbc: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_seed_cbc_procname); +end; + + +function ERR_EVP_seed_cfb128: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_seed_cfb128_procname); +end; + + + //EVP_seed_cfb EVP_seed_cfb128 +function ERR_EVP_seed_ofb: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_seed_ofb_procname); +end; + + + +function ERR_EVP_sm4_ecb: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_sm4_ecb_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_sm4_cbc: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_sm4_cbc_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_sm4_cfb128: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_sm4_cfb128_procname); +end; + + {introduced 1.1.0} + //EVP_sm4_cfb EVP_sm4_cfb128 +function ERR_EVP_sm4_ofb: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_sm4_ofb_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_sm4_ctr: PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_sm4_ctr_procname); +end; + + {introduced 1.1.0} + +function ERR_EVP_add_cipher(const cipher: PEVP_CIPHER): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_add_cipher_procname); +end; + + +function ERR_EVP_add_digest(const digest: PEVP_MD): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_add_digest_procname); +end; + + + +function ERR_EVP_get_cipherbyname(const name: PIdAnsiChar): PEVP_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_get_cipherbyname_procname); +end; + + +function ERR_EVP_get_digestbyname(const name: PIdAnsiChar): PEVP_MD; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_get_digestbyname_procname); +end; + + + +procedure ERR_EVP_CIPHER_do_all(AFn: fn; arg: Pointer); +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_CIPHER_do_all_procname); +end; + + +procedure ERR_EVP_CIPHER_do_all_sorted(AFn: fn; arg: Pointer); +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_CIPHER_do_all_sorted_procname); +end; + + + +procedure ERR_EVP_MD_do_all(AFn: fn; arg: Pointer); +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_MD_do_all_procname); +end; + + +procedure ERR_EVP_MD_do_all_sorted(AFn: fn; arg: Pointer); +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_MD_do_all_sorted_procname); +end; + + + +function ERR_EVP_PKEY_decrypt_old(dec_key: PByte; const enc_key: PByte; enc_key_len: TIdC_INT; private_key: PEVP_PKEY): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_decrypt_old_procname); +end; + + +function ERR_EVP_PKEY_encrypt_old(dec_key: PByte; const enc_key: PByte; key_len: TIdC_INT; pub_key: PEVP_PKEY): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_encrypt_old_procname); +end; + + +function ERR_EVP_PKEY_type(type_: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_type_procname); +end; + + +function ERR_EVP_PKEY_id(const pkey: PEVP_PKEY): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_id_procname); +end; + + +function ERR_EVP_PKEY_base_id(const pkey: PEVP_PKEY): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_base_id_procname); +end; + + +function ERR_EVP_PKEY_bits(const pkey: PEVP_PKEY): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_bits_procname); +end; + + +function ERR_EVP_PKEY_security_bits(const pkey: PEVP_PKEY): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_security_bits_procname); +end; + + +function ERR_EVP_PKEY_size(const pkey: PEVP_PKEY): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_size_procname); +end; + + +function ERR_EVP_PKEY_set_type(pkey: PEVP_PKEY): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_set_type_procname); +end; + + +function ERR_EVP_PKEY_set_type_str(pkey: PEVP_PKEY; const str: PIdAnsiChar; len: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_set_type_str_procname); +end; + + +function ERR_EVP_PKEY_set_alias_type(pkey: PEVP_PKEY; type_: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_set_alias_type_procname); +end; + + + +function ERR_EVP_PKEY_set1_engine(pkey: PEVP_PKEY; e: PENGINE): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_set1_engine_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_PKEY_get0_engine(const pkey: PEVP_PKEY): PENGINE; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_get0_engine_procname); +end; + + {introduced 1.1.0} + +function ERR_EVP_PKEY_assign(pkey: PEVP_PKEY; type_: TIdC_INT; key: Pointer): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_assign_procname); +end; + + +function ERR_EVP_PKEY_get0(const pkey: PEVP_PKEY): Pointer; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_get0_procname); +end; + + +function ERR_EVP_PKEY_get0_hmac(const pkey: PEVP_PKEY; len: PIdC_SIZET): PByte; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_get0_hmac_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_PKEY_get0_poly1305(const pkey: PEVP_PKEY; len: PIdC_SIZET): PByte; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_get0_poly1305_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_PKEY_get0_siphash(const pkey: PEVP_PKEY; len: PIdC_SIZET): PByte; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_get0_siphash_procname); +end; + + {introduced 1.1.0} + +function ERR_EVP_PKEY_set1_RSA(pkey: PEVP_PKEY; key: PRSA): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_set1_RSA_procname); +end; + + +function ERR_EVP_PKEY_get0_RSA(pkey: PEVP_PKEY): PRSA; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_get0_RSA_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_PKEY_get1_RSA(pkey: PEVP_PKEY): PRSA; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_get1_RSA_procname); +end; + + + +function ERR_EVP_PKEY_set1_DSA(pkey: PEVP_PKEY; key: PDSA): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_set1_DSA_procname); +end; + + +function ERR_EVP_PKEY_get0_DSA(pkey: PEVP_PKEY): PDSA; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_get0_DSA_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_PKEY_get1_DSA(pkey: PEVP_PKEY): PDSA; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_get1_DSA_procname); +end; + + + +function ERR_EVP_PKEY_set1_DH(pkey: PEVP_PKEY; key: PDH): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_set1_DH_procname); +end; + + +function ERR_EVP_PKEY_get0_DH(pkey: PEVP_PKEY): PDH; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_get0_DH_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_PKEY_get1_DH(pkey: PEVP_PKEY): PDH; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_get1_DH_procname); +end; + + + +function ERR_EVP_PKEY_set1_EC_KEY(pkey: PEVP_PKEY; key: PEC_KEY): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_set1_EC_KEY_procname); +end; + + +function ERR_EVP_PKEY_get0_EC_KEY(pkey: PEVP_PKEY): PEC_KEY; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_get0_EC_KEY_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_PKEY_get1_EC_KEY(pkey: PEVP_PKEY): PEC_KEY; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_get1_EC_KEY_procname); +end; + + + +function ERR_EVP_PKEY_new: PEVP_PKEY; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_new_procname); +end; + + +function ERR_EVP_PKEY_up_ref(pkey: PEVP_PKEY): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_up_ref_procname); +end; + + {introduced 1.1.0} +procedure ERR_EVP_PKEY_free(pkey: PEVP_PKEY); +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_free_procname); +end; + + + +function ERR_d2i_PublicKey(type_: TIdC_INT; a: PPEVP_PKEY; const pp: PPByte; length: TIdC_LONG): PEVP_PKEY; +begin + EIdAPIFunctionNotPresent.RaiseException(d2i_PublicKey_procname); +end; + + +function ERR_i2d_PublicKey(a: PEVP_PKEY; pp: PPByte): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(i2d_PublicKey_procname); +end; + + + +function ERR_d2i_PrivateKey(type_: TIdC_INT; a: PEVP_PKEY; const pp: PPByte; length: TIdC_LONG): PEVP_PKEY; +begin + EIdAPIFunctionNotPresent.RaiseException(d2i_PrivateKey_procname); +end; + + +function ERR_d2i_AutoPrivateKey(a: PPEVP_PKEY; const pp: PPByte; length: TIdC_LONG): PEVP_PKEY; +begin + EIdAPIFunctionNotPresent.RaiseException(d2i_AutoPrivateKey_procname); +end; + + +function ERR_i2d_PrivateKey(a: PEVP_PKEY; pp: PPByte): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(i2d_PrivateKey_procname); +end; + + + +function ERR_EVP_PKEY_copy_parameters(to_: PEVP_PKEY; const from: PEVP_PKEY): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_copy_parameters_procname); +end; + + +function ERR_EVP_PKEY_missing_parameters(const pkey: PEVP_PKEY): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_missing_parameters_procname); +end; + + +function ERR_EVP_PKEY_save_parameters(pkey: PEVP_PKEY; mode: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_save_parameters_procname); +end; + + +function ERR_EVP_PKEY_cmp_parameters(const a: PEVP_PKEY; const b: PEVP_PKEY): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_cmp_parameters_procname); +end; + + + +function ERR_EVP_PKEY_cmp(const a: PEVP_PKEY; const b: PEVP_PKEY): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_cmp_procname); +end; + + + +function ERR_EVP_PKEY_print_public(out_: PBIO; const pkey: PEVP_PKEY; indent: TIdC_INT; pctx: PASN1_PCTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_print_public_procname); +end; + + +function ERR_EVP_PKEY_print_private(out_: PBIO; const pkey: PEVP_PKEY; indent: TIdC_INT; pctx: PASN1_PCTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_print_private_procname); +end; + + +function ERR_EVP_PKEY_print_params(out_: PBIO; const pkey: PEVP_PKEY; indent: TIdC_INT; pctx: PASN1_PCTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_print_params_procname); +end; + + + +function ERR_EVP_PKEY_get_default_digest_nid(pkey: PEVP_PKEY; pnid: PIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_get_default_digest_nid_procname); +end; + + + +function ERR_EVP_PKEY_set1_tls_encodedpoint(pkey: PEVP_PKEY; const pt: PByte; ptlen: TIdC_SIZET): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_set1_tls_encodedpoint_procname); +end; + + +function ERR_EVP_PKEY_get1_tls_encodedpoint(pkey: PEVP_PKEY; ppt: PPByte): TIdC_SIZET; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_get1_tls_encodedpoint_procname); +end; + + + +function ERR_EVP_CIPHER_type(const ctx: PEVP_CIPHER): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_CIPHER_type_procname); +end; + + + + (* calls methods *) +function ERR_EVP_CIPHER_param_to_asn1(c: PEVP_CIPHER_CTX; type_: PASN1_TYPE): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_CIPHER_param_to_asn1_procname); +end; + + +function ERR_EVP_CIPHER_asn1_to_param(c: PEVP_CIPHER_CTX; type_: PASN1_TYPE): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_CIPHER_asn1_to_param_procname); +end; + + + + (* These are used by EVP_CIPHER methods *) +function ERR_EVP_CIPHER_set_asn1_iv(c: PEVP_CIPHER_CTX; type_: PASN1_TYPE): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_CIPHER_set_asn1_iv_procname); +end; + + +function ERR_EVP_CIPHER_get_asn1_iv(c: PEVP_CIPHER_CTX; type_: PASN1_TYPE): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_CIPHER_get_asn1_iv_procname); +end; + + + + (* PKCS5 password based encryption *) +function ERR_PKCS5_PBE_keyivgen(ctx: PEVP_CIPHER_CTX; const pass: PIdAnsiChar; passlen: TIdC_INT; param: PASN1_TYPE; const cipher: PEVP_CIPHER; const md: PEVP_MD; en_de: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS5_PBE_keyivgen_procname); +end; + + +function ERR_PKCS5_PBKDF2_HMAC_SHA1(const pass: PIdAnsiChar; passlen: TIdC_INT; const salt: PByte; saltlen: TIdC_INT; iter: TIdC_INT; keylen: TIdC_INT; out_: PByte): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS5_PBKDF2_HMAC_SHA1_procname); +end; + + +function ERR_PKCS5_PBKDF2_HMAC(const pass: PIdAnsiChar; passlen: TIdC_INT; const salt: PByte; saltlen: TIdC_INT; iter: TIdC_INT; const digest: PEVP_MD; keylen: TIdC_INT; out_: PByte): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS5_PBKDF2_HMAC_procname); +end; + + +function ERR_PKCS5_v2_PBE_keyivgen(ctx: PEVP_CIPHER_CTX; const pass: PIdAnsiChar; passlen: TIdC_INT; param: PASN1_TYPE; const cipher: PEVP_CIPHER; const md: PEVP_MD; en_de: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS5_v2_PBE_keyivgen_procname); +end; + + + +function ERR_EVP_PBE_scrypt(const pass: PIdAnsiChar; passlen: TIdC_SIZET; const salt: PByte; saltlen: TIdC_SIZET; N: TIdC_UINT64; r: TIdC_UINT64; p: TIdC_UINT64; maxmem: TIdC_UINT64; key: PByte; keylen: TIdC_SIZET): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PBE_scrypt_procname); +end; + + {introduced 1.1.0} + +function ERR_PKCS5_v2_scrypt_keyivgen(ctx: PEVP_CIPHER_CTX; const pass: PIdAnsiChar; passlen: TIdC_INT; param: PASN1_TYPE; const c: PEVP_CIPHER; const md: PEVP_MD; en_de: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS5_v2_scrypt_keyivgen_procname); +end; + + {introduced 1.1.0} + +procedure ERR_PKCS5_PBE_add; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS5_PBE_add_procname); +end; + + + +function ERR_EVP_PBE_CipherInit(pbe_obj: PASN1_OBJECT; const pass: PIdAnsiChar; passlen: TIdC_INT; param: PASN1_TYPE; ctx: PEVP_CIPHER_CTX; en_de: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PBE_CipherInit_procname); +end; + + + + (* PBE type *) +function ERR_EVP_PBE_alg_add_type(pbe_type: TIdC_INT; pbe_nid: TIdC_INT; cipher_nid: TIdC_INT; md_nid: TIdC_INT; keygen: PEVP_PBE_KEYGEN): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PBE_alg_add_type_procname); +end; + + +function ERR_EVP_PBE_alg_add(nid: TIdC_INT; const cipher: PEVP_CIPHER; const md: PEVP_MD; keygen: PEVP_PBE_KEYGEN): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PBE_alg_add_procname); +end; + + +function ERR_EVP_PBE_find(type_: TIdC_INT; pbe_nid: TIdC_INT; pcnid: PIdC_INT; pmnid: PIdC_INT; pkeygen: PPEVP_PBE_KEYGEN): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PBE_find_procname); +end; + + +procedure ERR_EVP_PBE_cleanup; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PBE_cleanup_procname); +end; + + +function ERR_EVP_PBE_get(ptype: PIdC_INT; ppbe_nid: PIdC_INT; num: TIdC_SIZET): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PBE_get_procname); +end; + + {introduced 1.1.0} + +function ERR_EVP_PKEY_asn1_get_count: TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_asn1_get_count_procname); +end; + + +function ERR_EVP_PKEY_asn1_get0(idx: TIdC_INT): PEVP_PKEY_ASN1_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_asn1_get0_procname); +end; + + +function ERR_EVP_PKEY_asn1_find(pe: PPENGINE; type_: TIdC_INT): PEVP_PKEY_ASN1_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_asn1_find_procname); +end; + + +function ERR_EVP_PKEY_asn1_find_str(pe: PPENGINE; const str: PIdAnsiChar; len: TIdC_INT): PEVP_PKEY_ASN1_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_asn1_find_str_procname); +end; + + +function ERR_EVP_PKEY_asn1_add0(const ameth: PEVP_PKEY_ASN1_METHOD): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_asn1_add0_procname); +end; + + +function ERR_EVP_PKEY_asn1_add_alias(to_: TIdC_INT; from: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_asn1_add_alias_procname); +end; + + +function ERR_EVP_PKEY_asn1_get0_info(ppkey_id: PIdC_INT; pkey_base_id: PIdC_INT; ppkey_flags: PIdC_INT; const pinfo: PPIdAnsiChar; const ppem_str: PPIdAnsiChar; const ameth: PEVP_PKEY_ASN1_METHOD): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_asn1_get0_info_procname); +end; + + + +function ERR_EVP_PKEY_get0_asn1(const pkey: PEVP_PKEY): PEVP_PKEY_ASN1_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_get0_asn1_procname); +end; + + +function ERR_EVP_PKEY_asn1_new(id: TIdC_INT; flags: TIdC_INT; const pem_str: PIdAnsiChar; const info: PIdAnsiChar): PEVP_PKEY_ASN1_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_asn1_new_procname); +end; + + +procedure ERR_EVP_PKEY_asn1_copy(dst: PEVP_PKEY_ASN1_METHOD; const src: PEVP_PKEY_ASN1_METHOD); +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_asn1_copy_procname); +end; + + +procedure ERR_EVP_PKEY_asn1_free(ameth: PEVP_PKEY_ASN1_METHOD); +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_asn1_free_procname); +end; + + + +procedure ERR_EVP_PKEY_asn1_set_public(ameth: PEVP_PKEY_ASN1_METHOD; APub_decode: pub_decode; APub_encode: pub_encode; APub_cmd: pub_cmd; APub_print: pub_print; APkey_size: pkey_size; APkey_bits: pkey_bits); +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_asn1_set_public_procname); +end; + + +procedure ERR_EVP_PKEY_asn1_set_private(ameth: PEVP_PKEY_ASN1_METHOD; APriv_decode: priv_decode; APriv_encode: priv_encode; APriv_print: priv_print); +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_asn1_set_private_procname); +end; + + +procedure ERR_EVP_PKEY_asn1_set_param(ameth: PEVP_PKEY_ASN1_METHOD; AParam_decode: param_decode; AParam_encode: param_encode; AParam_missing: param_missing; AParam_copy: param_copy; AParam_cmp: param_cmp; AParam_print: param_print); +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_asn1_set_param_procname); +end; + + + +procedure ERR_EVP_PKEY_asn1_set_free(ameth: PEVP_PKEY_ASN1_METHOD; APkey_free: pkey_free); +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_asn1_set_free_procname); +end; + + +procedure ERR_EVP_PKEY_asn1_set_ctrl(ameth: PEVP_PKEY_ASN1_METHOD; APkey_ctrl: pkey_ctrl); +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_asn1_set_ctrl_procname); +end; + + +procedure ERR_EVP_PKEY_asn1_set_item(ameth: PEVP_PKEY_ASN1_METHOD; AItem_verify: item_verify; AItem_sign: item_sign); +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_asn1_set_item_procname); +end; + + + +procedure ERR_EVP_PKEY_asn1_set_siginf(ameth: PEVP_PKEY_ASN1_METHOD; ASiginf_set: siginf_set); +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_asn1_set_siginf_procname); +end; + + {introduced 1.1.0} + +procedure ERR_EVP_PKEY_asn1_set_check(ameth: PEVP_PKEY_ASN1_METHOD; APkey_check: pkey_check); +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_asn1_set_check_procname); +end; + + {introduced 1.1.0} + +procedure ERR_EVP_PKEY_asn1_set_public_check(ameth: PEVP_PKEY_ASN1_METHOD; APkey_pub_check: pkey_pub_check); +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_asn1_set_public_check_procname); +end; + + {introduced 1.1.0} + +procedure ERR_EVP_PKEY_asn1_set_param_check(ameth: PEVP_PKEY_ASN1_METHOD; APkey_param_check: pkey_param_check); +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_asn1_set_param_check_procname); +end; + + {introduced 1.1.0} + +procedure ERR_EVP_PKEY_asn1_set_set_priv_key(ameth: PEVP_PKEY_ASN1_METHOD; ASet_priv_key: set_priv_key); +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_asn1_set_set_priv_key_procname); +end; + + {introduced 1.1.0} +procedure ERR_EVP_PKEY_asn1_set_set_pub_key(ameth: PEVP_PKEY_ASN1_METHOD; ASet_pub_key: set_pub_key); +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_asn1_set_set_pub_key_procname); +end; + + {introduced 1.1.0} +procedure ERR_EVP_PKEY_asn1_set_get_priv_key(ameth: PEVP_PKEY_ASN1_METHOD; AGet_priv_key: get_priv_key); +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_asn1_set_get_priv_key_procname); +end; + + {introduced 1.1.0} +procedure ERR_EVP_PKEY_asn1_set_get_pub_key(ameth: PEVP_PKEY_ASN1_METHOD; AGet_pub_key: get_pub_key); +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_asn1_set_get_pub_key_procname); +end; + + {introduced 1.1.0} + +procedure ERR_EVP_PKEY_asn1_set_security_bits(ameth: PEVP_PKEY_ASN1_METHOD; APkey_security_bits: pkey_security_bits); +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_asn1_set_security_bits_procname); +end; + + {introduced 1.1.0} + +function ERR_EVP_PKEY_meth_find(type_: TIdC_INT): PEVP_PKEY_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_meth_find_procname); +end; + + +function ERR_EVP_PKEY_meth_new(id: TIdC_INT; flags: TIdC_INT): PEVP_PKEY_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_meth_new_procname); +end; + + +procedure ERR_EVP_PKEY_meth_get0_info(ppkey_id: PIdC_INT; pflags: PIdC_INT; const meth: PEVP_PKEY_METHOD); +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_meth_get0_info_procname); +end; + + +procedure ERR_EVP_PKEY_meth_copy(dst: PEVP_PKEY_METHOD; const src: PEVP_PKEY_METHOD); +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_meth_copy_procname); +end; + + +procedure ERR_EVP_PKEY_meth_free(pmeth: PEVP_PKEY_METHOD); +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_meth_free_procname); +end; + + +function ERR_EVP_PKEY_meth_add0(const pmeth: PEVP_PKEY_METHOD): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_meth_add0_procname); +end; + + +function ERR_EVP_PKEY_meth_remove(const pmeth: PEVP_PKEY_METHOD): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_meth_remove_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_PKEY_meth_get_count: TIdC_SIZET; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_meth_get_count_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_PKEY_meth_get0(idx: TIdC_SIZET): PEVP_PKEY_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_meth_get0_procname); +end; + + {introduced 1.1.0} + +function ERR_EVP_PKEY_CTX_new(pkey: PEVP_PKEY; e: PENGINE): PEVP_PKEY_CTX; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_CTX_new_procname); +end; + + +function ERR_EVP_PKEY_CTX_new_id(id: TIdC_INT; e: PENGINE): PEVP_PKEY_CTX; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_CTX_new_id_procname); +end; + + +function ERR_EVP_PKEY_CTX_dup(ctx: PEVP_PKEY_CTX): PEVP_PKEY_CTX; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_CTX_dup_procname); +end; + + +procedure ERR_EVP_PKEY_CTX_free(ctx: PEVP_PKEY_CTX); +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_CTX_free_procname); +end; + + + +function ERR_EVP_PKEY_CTX_ctrl(ctx: PEVP_PKEY_CTX; keytype: TIdC_INT; optype: TIdC_INT; cmd: TIdC_INT; p1: TIdC_INT; p2: Pointer): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_CTX_ctrl_procname); +end; + + +function ERR_EVP_PKEY_CTX_ctrl_str(ctx: PEVP_PKEY_CTX; const type_: PIdAnsiChar; const value: PIdAnsiChar): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_CTX_ctrl_str_procname); +end; + + +function ERR_EVP_PKEY_CTX_ctrl_uint64(ctx: PEVP_PKEY_CTX; keytype: TIdC_INT; optype: TIdC_INT; cmd: TIdC_INT; value: TIdC_UINT64): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_CTX_ctrl_uint64_procname); +end; + + {introduced 1.1.0} + +function ERR_EVP_PKEY_CTX_str2ctrl(ctx: PEVP_PKEY_CTX; cmd: TIdC_INT; const str: PIdAnsiChar): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_CTX_str2ctrl_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_PKEY_CTX_hex2ctrl(ctx: PEVP_PKEY_CTX; cmd: TIdC_INT; const hex: PIdAnsiChar): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_CTX_hex2ctrl_procname); +end; + + {introduced 1.1.0} + +function ERR_EVP_PKEY_CTX_md(ctx: PEVP_PKEY_CTX; optype: TIdC_INT; cmd: TIdC_INT; const md: PIdAnsiChar): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_CTX_md_procname); +end; + + {introduced 1.1.0} + +function ERR_EVP_PKEY_CTX_get_operation(ctx: PEVP_PKEY_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_CTX_get_operation_procname); +end; + + +procedure ERR_EVP_PKEY_CTX_set0_keygen_info(ctx: PEVP_PKEY_CTX; dat: PIdC_INT; datlen: TIdC_INT); +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_CTX_set0_keygen_info_procname); +end; + + + +function ERR_EVP_PKEY_new_mac_key(type_: TIdC_INT; e: PENGINE; const key: PByte; keylen: TIdC_INT): PEVP_PKEY; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_new_mac_key_procname); +end; + + +function ERR_EVP_PKEY_new_raw_private_key(type_: TIdC_INT; e: PENGINE; const priv: PByte; len: TIdC_SIZET): PEVP_PKEY; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_new_raw_private_key_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_PKEY_new_raw_public_key(type_: TIdC_INT; e: PENGINE; const pub: PByte; len: TIdC_SIZET): PEVP_PKEY; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_new_raw_public_key_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_PKEY_get_raw_private_key(const pkey: PEVP_PKEY; priv: PByte; len: PIdC_SIZET): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_get_raw_private_key_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_PKEY_get_raw_public_key(const pkey: PEVP_PKEY; pub: PByte; len: PIdC_SIZET): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_get_raw_public_key_procname); +end; + + {introduced 1.1.0} + +function ERR_EVP_PKEY_new_CMAC_key(e: PENGINE; const priv: PByte; len: TIdC_SIZET; const cipher: PEVP_CIPHER): PEVP_PKEY; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_new_CMAC_key_procname); +end; + + {introduced 1.1.0} + +procedure ERR_EVP_PKEY_CTX_set_data(ctx: PEVP_PKEY_CTX; data: Pointer); +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_CTX_set_data_procname); +end; + + +function ERR_EVP_PKEY_CTX_get_data(ctx: PEVP_PKEY_CTX): Pointer; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_CTX_get_data_procname); +end; + + +function ERR_EVP_PKEY_CTX_get0_pkey(ctx: PEVP_PKEY_CTX): PEVP_PKEY; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_CTX_get0_pkey_procname); +end; + + + +function ERR_EVP_PKEY_CTX_get0_peerkey(ctx: PEVP_PKEY_CTX): PEVP_PKEY; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_CTX_get0_peerkey_procname); +end; + + + +procedure ERR_EVP_PKEY_CTX_set_app_data(ctx: PEVP_PKEY_CTX; data: Pointer); +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_CTX_set_app_data_procname); +end; + + +function ERR_EVP_PKEY_CTX_get_app_data(ctx: PEVP_PKEY_CTX): Pointer; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_CTX_get_app_data_procname); +end; + + + +function ERR_EVP_PKEY_sign_init(ctx: PEVP_PKEY_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_sign_init_procname); +end; + + +function ERR_EVP_PKEY_sign(ctx: PEVP_PKEY_CTX; sig: PByte; siglen: PIdC_SIZET; const tbs: PByte; tbslen: TIdC_SIZET): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_sign_procname); +end; + + +function ERR_EVP_PKEY_verify_init(ctx: PEVP_PKEY_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_verify_init_procname); +end; + + +function ERR_EVP_PKEY_verify(ctx: PEVP_PKEY_CTX; const sig: PByte; siglen: TIdC_SIZET; const tbs: PByte; tbslen: TIdC_SIZET): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_verify_procname); +end; + + +function ERR_EVP_PKEY_verify_recover_init(ctx: PEVP_PKEY_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_verify_recover_init_procname); +end; + + +function ERR_EVP_PKEY_verify_recover(ctx: PEVP_PKEY_CTX; rout: PByte; routlen: PIdC_SIZET; const sig: PByte; siglen: TIdC_SIZET): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_verify_recover_procname); +end; + + +function ERR_EVP_PKEY_encrypt_init(ctx: PEVP_PKEY_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_encrypt_init_procname); +end; + + +function ERR_EVP_PKEY_encrypt(ctx: PEVP_PKEY_CTX; out_: PByte; outlen: PIdC_SIZET; const in_: PByte; inlen: TIdC_SIZET): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_encrypt_procname); +end; + + +function ERR_EVP_PKEY_decrypt_init(ctx: PEVP_PKEY_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_decrypt_init_procname); +end; + + +function ERR_EVP_PKEY_decrypt(ctx: PEVP_PKEY_CTX; out_: PByte; outlen: PIdC_SIZET; const in_: PByte; inlen: TIdC_SIZET): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_decrypt_procname); +end; + + + +function ERR_EVP_PKEY_derive_init(ctx: PEVP_PKEY_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_derive_init_procname); +end; + + +function ERR_EVP_PKEY_derive_set_peer(ctx: PEVP_PKEY_CTX; peer: PEVP_PKEY): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_derive_set_peer_procname); +end; + + +function ERR_EVP_PKEY_derive(ctx: PEVP_PKEY_CTX; key: PByte; keylen: PIdC_SIZET): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_derive_procname); +end; + + + +function ERR_EVP_PKEY_paramgen_init(ctx: PEVP_PKEY_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_paramgen_init_procname); +end; + + +function ERR_EVP_PKEY_paramgen(ctx: PEVP_PKEY_CTX; ppkey: PPEVP_PKEY): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_paramgen_procname); +end; + + +function ERR_EVP_PKEY_keygen_init(ctx: PEVP_PKEY_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_keygen_init_procname); +end; + + +function ERR_EVP_PKEY_keygen(ctx: PEVP_PKEY_CTX; ppkey: PPEVP_PKEY): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_keygen_procname); +end; + + +function ERR_EVP_PKEY_check(ctx: PEVP_PKEY_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_check_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_PKEY_public_check(ctx: PEVP_PKEY_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_public_check_procname); +end; + + {introduced 1.1.0} +function ERR_EVP_PKEY_param_check(ctx: PEVP_PKEY_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_param_check_procname); +end; + + {introduced 1.1.0} + +procedure ERR_EVP_PKEY_CTX_set_cb(ctx: PEVP_PKEY_CTX; cb: EVP_PKEY_gen_cb); +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_CTX_set_cb_procname); +end; + + +function ERR_EVP_PKEY_CTX_get_cb(ctx: PEVP_PKEY_CTX): EVP_PKEY_gen_cb; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_CTX_get_cb_procname); +end; + + + +function ERR_EVP_PKEY_CTX_get_keygen_info(ctx: PEVP_PKEY_CTX; idx: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_CTX_get_keygen_info_procname); +end; + + + +procedure ERR_EVP_PKEY_meth_set_init(pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_init: EVP_PKEY_meth_init); +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_meth_set_init_procname); +end; + + + +procedure ERR_EVP_PKEY_meth_set_copy(pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_copy_cb: EVP_PKEY_meth_copy_cb); +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_meth_set_copy_procname); +end; + + + +procedure ERR_EVP_PKEY_meth_set_cleanup(pmeth: PEVP_PKEY_METHOD; PEVP_PKEY_meth_cleanup: EVP_PKEY_meth_cleanup); +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_meth_set_cleanup_procname); +end; + + + +procedure ERR_EVP_PKEY_meth_set_paramgen(pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_paramgen_init: EVP_PKEY_meth_paramgen_init; AEVP_PKEY_meth_paramgen: EVP_PKEY_meth_paramgen_init); +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_meth_set_paramgen_procname); +end; + + + +procedure ERR_EVP_PKEY_meth_set_keygen(pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_keygen_init: EVP_PKEY_meth_keygen_init; AEVP_PKEY_meth_keygen: EVP_PKEY_meth_keygen); +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_meth_set_keygen_procname); +end; + + + +procedure ERR_EVP_PKEY_meth_set_sign(pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_sign_init: EVP_PKEY_meth_sign_init; AEVP_PKEY_meth_sign: EVP_PKEY_meth_sign); +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_meth_set_sign_procname); +end; + + + +procedure ERR_EVP_PKEY_meth_set_verify(pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_verify_init: EVP_PKEY_meth_verify_init; AEVP_PKEY_meth_verify: EVP_PKEY_meth_verify_init); +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_meth_set_verify_procname); +end; + + + +procedure ERR_EVP_PKEY_meth_set_verify_recover(pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_verify_recover_init: EVP_PKEY_meth_verify_recover_init; AEVP_PKEY_meth_verify_recover: EVP_PKEY_meth_verify_recover_init); +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_meth_set_verify_recover_procname); +end; + + + +procedure ERR_EVP_PKEY_meth_set_signctx(pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_signctx_init: EVP_PKEY_meth_signctx_init; AEVP_PKEY_meth_signctx: EVP_PKEY_meth_signctx); +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_meth_set_signctx_procname); +end; + + + +procedure ERR_EVP_PKEY_meth_set_verifyctx(pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_verifyctx_init: EVP_PKEY_meth_verifyctx_init; AEVP_PKEY_meth_verifyctx: EVP_PKEY_meth_verifyctx); +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_meth_set_verifyctx_procname); +end; + + + +procedure ERR_EVP_PKEY_meth_set_encrypt(pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_encrypt_init: EVP_PKEY_meth_encrypt_init; AEVP_PKEY_meth_encrypt: EVP_PKEY_meth_encrypt); +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_meth_set_encrypt_procname); +end; + + + +procedure ERR_EVP_PKEY_meth_set_decrypt(pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_decrypt_init: EVP_PKEY_meth_decrypt_init; AEVP_PKEY_meth_decrypt: EVP_PKEY_meth_decrypt); +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_meth_set_decrypt_procname); +end; + + + +procedure ERR_EVP_PKEY_meth_set_derive(pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_derive_init: EVP_PKEY_meth_derive_init; AEVP_PKEY_meth_derive: EVP_PKEY_meth_derive); +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_meth_set_derive_procname); +end; + + + +procedure ERR_EVP_PKEY_meth_set_ctrl(pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_ctrl: EVP_PKEY_meth_ctrl; AEVP_PKEY_meth_ctrl_str: EVP_PKEY_meth_ctrl_str); +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_meth_set_ctrl_procname); +end; + + + +procedure ERR_EVP_PKEY_meth_set_digestsign(pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_digestsign: EVP_PKEY_meth_digestsign); +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_meth_set_digestsign_procname); +end; + + {introduced 1.1.0} + +procedure ERR_EVP_PKEY_meth_set_digestverify(pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_digestverify: EVP_PKEY_meth_digestverify); +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_meth_set_digestverify_procname); +end; + + {introduced 1.1.0} + +procedure ERR_EVP_PKEY_meth_set_check(pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_check: EVP_PKEY_meth_check); +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_meth_set_check_procname); +end; + + {introduced 1.1.0} + +procedure ERR_EVP_PKEY_meth_set_public_check(pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_public_check: EVP_PKEY_meth_public_check); +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_meth_set_public_check_procname); +end; + + {introduced 1.1.0} + +procedure ERR_EVP_PKEY_meth_set_param_check(pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_param_check: EVP_PKEY_meth_param_check); +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_meth_set_param_check_procname); +end; + + {introduced 1.1.0} + +procedure ERR_EVP_PKEY_meth_set_digest_custom(pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_digest_custom: EVP_PKEY_meth_digest_custom); +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_meth_set_digest_custom_procname); +end; + + {introduced 1.1.0} + +procedure ERR_EVP_PKEY_meth_get_init(const pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_init: PEVP_PKEY_meth_init); +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_meth_get_init_procname); +end; + + + +procedure ERR_EVP_PKEY_meth_get_copy(const pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_copy: PEVP_PKEY_meth_copy); +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_meth_get_copy_procname); +end; + + + +procedure ERR_EVP_PKEY_meth_get_cleanup(const pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_cleanup: PEVP_PKEY_meth_cleanup); +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_meth_get_cleanup_procname); +end; + + + +procedure ERR_EVP_PKEY_meth_get_paramgen(const pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_paramgen_init: EVP_PKEY_meth_paramgen_init; AEVP_PKEY_meth_paramgen: PEVP_PKEY_meth_paramgen); +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_meth_get_paramgen_procname); +end; + + + +procedure ERR_EVP_PKEY_meth_get_keygen(const pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_keygen_init: EVP_PKEY_meth_keygen_init; AEVP_PKEY_meth_keygen: PEVP_PKEY_meth_keygen); +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_meth_get_keygen_procname); +end; + + + +procedure ERR_EVP_PKEY_meth_get_sign(const pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_sign_init: PEVP_PKEY_meth_sign_init; AEVP_PKEY_meth_sign: PEVP_PKEY_meth_sign); +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_meth_get_sign_procname); +end; + + + +procedure ERR_EVP_PKEY_meth_get_verify(pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_verify_init: PEVP_PKEY_meth_verify_init; AEVP_PKEY_meth_verify: PEVP_PKEY_meth_verify_init); +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_meth_get_verify_procname); +end; + + + +procedure ERR_EVP_PKEY_meth_get_verify_recover(pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_verify_recover_init: PEVP_PKEY_meth_verify_recover_init; AEVP_PKEY_meth_verify_recover: PEVP_PKEY_meth_verify_recover_init); +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_meth_get_verify_recover_procname); +end; + + + +procedure ERR_EVP_PKEY_meth_get_signctx(pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_signctx_init: PEVP_PKEY_meth_signctx_init; AEVP_PKEY_meth_signctx: PEVP_PKEY_meth_signctx); +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_meth_get_signctx_procname); +end; + + + +procedure ERR_EVP_PKEY_meth_get_verifyctx(pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_verifyctx_init: PEVP_PKEY_meth_verifyctx_init; AEVP_PKEY_meth_verifyctx: PEVP_PKEY_meth_verifyctx); +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_meth_get_verifyctx_procname); +end; + + + +procedure ERR_EVP_PKEY_meth_get_encrypt(pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_encrypt_init: PEVP_PKEY_meth_encrypt_init; AEVP_PKEY_meth_encrypt: PEVP_PKEY_meth_encrypt); +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_meth_get_encrypt_procname); +end; + + + +procedure ERR_EVP_PKEY_meth_get_decrypt(pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_decrypt_init: PEVP_PKEY_meth_decrypt_init; AEVP_PKEY_meth_decrypt: PEVP_PKEY_meth_decrypt); +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_meth_get_decrypt_procname); +end; + + + +procedure ERR_EVP_PKEY_meth_get_derive(pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_derive_init: PEVP_PKEY_meth_derive_init; AEVP_PKEY_meth_derive: PEVP_PKEY_meth_derive); +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_meth_get_derive_procname); +end; + + + +procedure ERR_EVP_PKEY_meth_get_ctrl(pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_ctrl: PEVP_PKEY_meth_ctrl; AEVP_PKEY_meth_ctrl_str: PEVP_PKEY_meth_ctrl_str); +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_meth_get_ctrl_procname); +end; + + + +procedure ERR_EVP_PKEY_meth_get_digestsign(pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_digestsign: PEVP_PKEY_meth_digestsign); +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_meth_get_digestsign_procname); +end; + + {introduced 1.1.0} + +procedure ERR_EVP_PKEY_meth_get_digestverify(pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_digestverify: PEVP_PKEY_meth_digestverify); +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_meth_get_digestverify_procname); +end; + + {introduced 1.1.0} + +procedure ERR_EVP_PKEY_meth_get_check(pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_check: PEVP_PKEY_meth_check); +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_meth_get_check_procname); +end; + + {introduced 1.1.0} + +procedure ERR_EVP_PKEY_meth_get_public_check(pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_public_check: PEVP_PKEY_meth_public_check); +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_meth_get_public_check_procname); +end; + + {introduced 1.1.0} + +procedure ERR_EVP_PKEY_meth_get_param_check(pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_param_check: PEVP_PKEY_meth_param_check); +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_meth_get_param_check_procname); +end; + + {introduced 1.1.0} + +procedure ERR_EVP_PKEY_meth_get_digest_custom(pmeth: PEVP_PKEY_METHOD; AEVP_PKEY_meth_digest_custom: PEVP_PKEY_meth_digest_custom); +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_meth_get_digest_custom_procname); +end; + + {introduced 1.1.0} + +procedure ERR_EVP_add_alg_module; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_add_alg_module_procname); +end; + + + +procedure ERR_OpenSSL_add_all_ciphers; +begin + EIdAPIFunctionNotPresent.RaiseException(OpenSSL_add_all_ciphers_procname); +end; + + + +procedure ERR_OpenSSL_add_all_digests; +begin + EIdAPIFunctionNotPresent.RaiseException(OpenSSL_add_all_digests_procname); +end; + + + +procedure ERR_EVP_cleanup; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_cleanup_procname); +end; + + + +{$WARN NO_RETVAL ON} + +procedure Load(const ADllHandle: TIdLibHandle; LibVersion: TIdC_UINT; const AFailed: TStringList); + +var FuncLoadError: boolean; + +begin + EVP_PKEY_assign_RSA := LoadLibFunction(ADllHandle, EVP_PKEY_assign_RSA_procname); + FuncLoadError := not assigned(EVP_PKEY_assign_RSA); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_assign_RSA_allownil)} + EVP_PKEY_assign_RSA := @ERR_EVP_PKEY_assign_RSA; + {$ifend} + {$if declared(EVP_PKEY_assign_RSA_introduced)} + if LibVersion < EVP_PKEY_assign_RSA_introduced then + begin + {$if declared(FC_EVP_PKEY_assign_RSA)} + EVP_PKEY_assign_RSA := @FC_EVP_PKEY_assign_RSA; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_assign_RSA_removed)} + if EVP_PKEY_assign_RSA_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_assign_RSA)} + EVP_PKEY_assign_RSA := @_EVP_PKEY_assign_RSA; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_assign_RSA_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_assign_RSA'); + {$ifend} + end; + + + EVP_PKEY_assign_DSA := LoadLibFunction(ADllHandle, EVP_PKEY_assign_DSA_procname); + FuncLoadError := not assigned(EVP_PKEY_assign_DSA); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_assign_DSA_allownil)} + EVP_PKEY_assign_DSA := @ERR_EVP_PKEY_assign_DSA; + {$ifend} + {$if declared(EVP_PKEY_assign_DSA_introduced)} + if LibVersion < EVP_PKEY_assign_DSA_introduced then + begin + {$if declared(FC_EVP_PKEY_assign_DSA)} + EVP_PKEY_assign_DSA := @FC_EVP_PKEY_assign_DSA; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_assign_DSA_removed)} + if EVP_PKEY_assign_DSA_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_assign_DSA)} + EVP_PKEY_assign_DSA := @_EVP_PKEY_assign_DSA; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_assign_DSA_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_assign_DSA'); + {$ifend} + end; + + + EVP_PKEY_assign_DH := LoadLibFunction(ADllHandle, EVP_PKEY_assign_DH_procname); + FuncLoadError := not assigned(EVP_PKEY_assign_DH); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_assign_DH_allownil)} + EVP_PKEY_assign_DH := @ERR_EVP_PKEY_assign_DH; + {$ifend} + {$if declared(EVP_PKEY_assign_DH_introduced)} + if LibVersion < EVP_PKEY_assign_DH_introduced then + begin + {$if declared(FC_EVP_PKEY_assign_DH)} + EVP_PKEY_assign_DH := @FC_EVP_PKEY_assign_DH; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_assign_DH_removed)} + if EVP_PKEY_assign_DH_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_assign_DH)} + EVP_PKEY_assign_DH := @_EVP_PKEY_assign_DH; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_assign_DH_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_assign_DH'); + {$ifend} + end; + + + EVP_PKEY_assign_EC_KEY := LoadLibFunction(ADllHandle, EVP_PKEY_assign_EC_KEY_procname); + FuncLoadError := not assigned(EVP_PKEY_assign_EC_KEY); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_assign_EC_KEY_allownil)} + EVP_PKEY_assign_EC_KEY := @ERR_EVP_PKEY_assign_EC_KEY; + {$ifend} + {$if declared(EVP_PKEY_assign_EC_KEY_introduced)} + if LibVersion < EVP_PKEY_assign_EC_KEY_introduced then + begin + {$if declared(FC_EVP_PKEY_assign_EC_KEY)} + EVP_PKEY_assign_EC_KEY := @FC_EVP_PKEY_assign_EC_KEY; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_assign_EC_KEY_removed)} + if EVP_PKEY_assign_EC_KEY_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_assign_EC_KEY)} + EVP_PKEY_assign_EC_KEY := @_EVP_PKEY_assign_EC_KEY; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_assign_EC_KEY_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_assign_EC_KEY'); + {$ifend} + end; + + + EVP_PKEY_assign_SIPHASH := LoadLibFunction(ADllHandle, EVP_PKEY_assign_SIPHASH_procname); + FuncLoadError := not assigned(EVP_PKEY_assign_SIPHASH); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_assign_SIPHASH_allownil)} + EVP_PKEY_assign_SIPHASH := @ERR_EVP_PKEY_assign_SIPHASH; + {$ifend} + {$if declared(EVP_PKEY_assign_SIPHASH_introduced)} + if LibVersion < EVP_PKEY_assign_SIPHASH_introduced then + begin + {$if declared(FC_EVP_PKEY_assign_SIPHASH)} + EVP_PKEY_assign_SIPHASH := @FC_EVP_PKEY_assign_SIPHASH; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_assign_SIPHASH_removed)} + if EVP_PKEY_assign_SIPHASH_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_assign_SIPHASH)} + EVP_PKEY_assign_SIPHASH := @_EVP_PKEY_assign_SIPHASH; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_assign_SIPHASH_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_assign_SIPHASH'); + {$ifend} + end; + + + EVP_PKEY_assign_POLY1305 := LoadLibFunction(ADllHandle, EVP_PKEY_assign_POLY1305_procname); + FuncLoadError := not assigned(EVP_PKEY_assign_POLY1305); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_assign_POLY1305_allownil)} + EVP_PKEY_assign_POLY1305 := @ERR_EVP_PKEY_assign_POLY1305; + {$ifend} + {$if declared(EVP_PKEY_assign_POLY1305_introduced)} + if LibVersion < EVP_PKEY_assign_POLY1305_introduced then + begin + {$if declared(FC_EVP_PKEY_assign_POLY1305)} + EVP_PKEY_assign_POLY1305 := @FC_EVP_PKEY_assign_POLY1305; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_assign_POLY1305_removed)} + if EVP_PKEY_assign_POLY1305_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_assign_POLY1305)} + EVP_PKEY_assign_POLY1305 := @_EVP_PKEY_assign_POLY1305; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_assign_POLY1305_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_assign_POLY1305'); + {$ifend} + end; + + + EVP_MD_meth_new := LoadLibFunction(ADllHandle, EVP_MD_meth_new_procname); + FuncLoadError := not assigned(EVP_MD_meth_new); + if FuncLoadError then + begin + {$if not defined(EVP_MD_meth_new_allownil)} + EVP_MD_meth_new := @ERR_EVP_MD_meth_new; + {$ifend} + {$if declared(EVP_MD_meth_new_introduced)} + if LibVersion < EVP_MD_meth_new_introduced then + begin + {$if declared(FC_EVP_MD_meth_new)} + EVP_MD_meth_new := @FC_EVP_MD_meth_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_MD_meth_new_removed)} + if EVP_MD_meth_new_removed <= LibVersion then + begin + {$if declared(_EVP_MD_meth_new)} + EVP_MD_meth_new := @_EVP_MD_meth_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_MD_meth_new_allownil)} + if FuncLoadError then + AFailed.Add('EVP_MD_meth_new'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_MD_meth_dup := LoadLibFunction(ADllHandle, EVP_MD_meth_dup_procname); + FuncLoadError := not assigned(EVP_MD_meth_dup); + if FuncLoadError then + begin + {$if not defined(EVP_MD_meth_dup_allownil)} + EVP_MD_meth_dup := @ERR_EVP_MD_meth_dup; + {$ifend} + {$if declared(EVP_MD_meth_dup_introduced)} + if LibVersion < EVP_MD_meth_dup_introduced then + begin + {$if declared(FC_EVP_MD_meth_dup)} + EVP_MD_meth_dup := @FC_EVP_MD_meth_dup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_MD_meth_dup_removed)} + if EVP_MD_meth_dup_removed <= LibVersion then + begin + {$if declared(_EVP_MD_meth_dup)} + EVP_MD_meth_dup := @_EVP_MD_meth_dup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_MD_meth_dup_allownil)} + if FuncLoadError then + AFailed.Add('EVP_MD_meth_dup'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_MD_meth_free := LoadLibFunction(ADllHandle, EVP_MD_meth_free_procname); + FuncLoadError := not assigned(EVP_MD_meth_free); + if FuncLoadError then + begin + {$if not defined(EVP_MD_meth_free_allownil)} + EVP_MD_meth_free := @ERR_EVP_MD_meth_free; + {$ifend} + {$if declared(EVP_MD_meth_free_introduced)} + if LibVersion < EVP_MD_meth_free_introduced then + begin + {$if declared(FC_EVP_MD_meth_free)} + EVP_MD_meth_free := @FC_EVP_MD_meth_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_MD_meth_free_removed)} + if EVP_MD_meth_free_removed <= LibVersion then + begin + {$if declared(_EVP_MD_meth_free)} + EVP_MD_meth_free := @_EVP_MD_meth_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_MD_meth_free_allownil)} + if FuncLoadError then + AFailed.Add('EVP_MD_meth_free'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_MD_meth_set_input_blocksize := LoadLibFunction(ADllHandle, EVP_MD_meth_set_input_blocksize_procname); + FuncLoadError := not assigned(EVP_MD_meth_set_input_blocksize); + if FuncLoadError then + begin + {$if not defined(EVP_MD_meth_set_input_blocksize_allownil)} + EVP_MD_meth_set_input_blocksize := @ERR_EVP_MD_meth_set_input_blocksize; + {$ifend} + {$if declared(EVP_MD_meth_set_input_blocksize_introduced)} + if LibVersion < EVP_MD_meth_set_input_blocksize_introduced then + begin + {$if declared(FC_EVP_MD_meth_set_input_blocksize)} + EVP_MD_meth_set_input_blocksize := @FC_EVP_MD_meth_set_input_blocksize; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_MD_meth_set_input_blocksize_removed)} + if EVP_MD_meth_set_input_blocksize_removed <= LibVersion then + begin + {$if declared(_EVP_MD_meth_set_input_blocksize)} + EVP_MD_meth_set_input_blocksize := @_EVP_MD_meth_set_input_blocksize; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_MD_meth_set_input_blocksize_allownil)} + if FuncLoadError then + AFailed.Add('EVP_MD_meth_set_input_blocksize'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_MD_meth_set_result_size := LoadLibFunction(ADllHandle, EVP_MD_meth_set_result_size_procname); + FuncLoadError := not assigned(EVP_MD_meth_set_result_size); + if FuncLoadError then + begin + {$if not defined(EVP_MD_meth_set_result_size_allownil)} + EVP_MD_meth_set_result_size := @ERR_EVP_MD_meth_set_result_size; + {$ifend} + {$if declared(EVP_MD_meth_set_result_size_introduced)} + if LibVersion < EVP_MD_meth_set_result_size_introduced then + begin + {$if declared(FC_EVP_MD_meth_set_result_size)} + EVP_MD_meth_set_result_size := @FC_EVP_MD_meth_set_result_size; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_MD_meth_set_result_size_removed)} + if EVP_MD_meth_set_result_size_removed <= LibVersion then + begin + {$if declared(_EVP_MD_meth_set_result_size)} + EVP_MD_meth_set_result_size := @_EVP_MD_meth_set_result_size; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_MD_meth_set_result_size_allownil)} + if FuncLoadError then + AFailed.Add('EVP_MD_meth_set_result_size'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_MD_meth_set_app_datasize := LoadLibFunction(ADllHandle, EVP_MD_meth_set_app_datasize_procname); + FuncLoadError := not assigned(EVP_MD_meth_set_app_datasize); + if FuncLoadError then + begin + {$if not defined(EVP_MD_meth_set_app_datasize_allownil)} + EVP_MD_meth_set_app_datasize := @ERR_EVP_MD_meth_set_app_datasize; + {$ifend} + {$if declared(EVP_MD_meth_set_app_datasize_introduced)} + if LibVersion < EVP_MD_meth_set_app_datasize_introduced then + begin + {$if declared(FC_EVP_MD_meth_set_app_datasize)} + EVP_MD_meth_set_app_datasize := @FC_EVP_MD_meth_set_app_datasize; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_MD_meth_set_app_datasize_removed)} + if EVP_MD_meth_set_app_datasize_removed <= LibVersion then + begin + {$if declared(_EVP_MD_meth_set_app_datasize)} + EVP_MD_meth_set_app_datasize := @_EVP_MD_meth_set_app_datasize; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_MD_meth_set_app_datasize_allownil)} + if FuncLoadError then + AFailed.Add('EVP_MD_meth_set_app_datasize'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_MD_meth_set_flags := LoadLibFunction(ADllHandle, EVP_MD_meth_set_flags_procname); + FuncLoadError := not assigned(EVP_MD_meth_set_flags); + if FuncLoadError then + begin + {$if not defined(EVP_MD_meth_set_flags_allownil)} + EVP_MD_meth_set_flags := @ERR_EVP_MD_meth_set_flags; + {$ifend} + {$if declared(EVP_MD_meth_set_flags_introduced)} + if LibVersion < EVP_MD_meth_set_flags_introduced then + begin + {$if declared(FC_EVP_MD_meth_set_flags)} + EVP_MD_meth_set_flags := @FC_EVP_MD_meth_set_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_MD_meth_set_flags_removed)} + if EVP_MD_meth_set_flags_removed <= LibVersion then + begin + {$if declared(_EVP_MD_meth_set_flags)} + EVP_MD_meth_set_flags := @_EVP_MD_meth_set_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_MD_meth_set_flags_allownil)} + if FuncLoadError then + AFailed.Add('EVP_MD_meth_set_flags'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_MD_meth_set_init := LoadLibFunction(ADllHandle, EVP_MD_meth_set_init_procname); + FuncLoadError := not assigned(EVP_MD_meth_set_init); + if FuncLoadError then + begin + {$if not defined(EVP_MD_meth_set_init_allownil)} + EVP_MD_meth_set_init := @ERR_EVP_MD_meth_set_init; + {$ifend} + {$if declared(EVP_MD_meth_set_init_introduced)} + if LibVersion < EVP_MD_meth_set_init_introduced then + begin + {$if declared(FC_EVP_MD_meth_set_init)} + EVP_MD_meth_set_init := @FC_EVP_MD_meth_set_init; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_MD_meth_set_init_removed)} + if EVP_MD_meth_set_init_removed <= LibVersion then + begin + {$if declared(_EVP_MD_meth_set_init)} + EVP_MD_meth_set_init := @_EVP_MD_meth_set_init; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_MD_meth_set_init_allownil)} + if FuncLoadError then + AFailed.Add('EVP_MD_meth_set_init'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_MD_meth_set_update := LoadLibFunction(ADllHandle, EVP_MD_meth_set_update_procname); + FuncLoadError := not assigned(EVP_MD_meth_set_update); + if FuncLoadError then + begin + {$if not defined(EVP_MD_meth_set_update_allownil)} + EVP_MD_meth_set_update := @ERR_EVP_MD_meth_set_update; + {$ifend} + {$if declared(EVP_MD_meth_set_update_introduced)} + if LibVersion < EVP_MD_meth_set_update_introduced then + begin + {$if declared(FC_EVP_MD_meth_set_update)} + EVP_MD_meth_set_update := @FC_EVP_MD_meth_set_update; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_MD_meth_set_update_removed)} + if EVP_MD_meth_set_update_removed <= LibVersion then + begin + {$if declared(_EVP_MD_meth_set_update)} + EVP_MD_meth_set_update := @_EVP_MD_meth_set_update; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_MD_meth_set_update_allownil)} + if FuncLoadError then + AFailed.Add('EVP_MD_meth_set_update'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_MD_meth_set_final := LoadLibFunction(ADllHandle, EVP_MD_meth_set_final_procname); + FuncLoadError := not assigned(EVP_MD_meth_set_final); + if FuncLoadError then + begin + {$if not defined(EVP_MD_meth_set_final_allownil)} + EVP_MD_meth_set_final := @ERR_EVP_MD_meth_set_final; + {$ifend} + {$if declared(EVP_MD_meth_set_final_introduced)} + if LibVersion < EVP_MD_meth_set_final_introduced then + begin + {$if declared(FC_EVP_MD_meth_set_final)} + EVP_MD_meth_set_final := @FC_EVP_MD_meth_set_final; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_MD_meth_set_final_removed)} + if EVP_MD_meth_set_final_removed <= LibVersion then + begin + {$if declared(_EVP_MD_meth_set_final)} + EVP_MD_meth_set_final := @_EVP_MD_meth_set_final; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_MD_meth_set_final_allownil)} + if FuncLoadError then + AFailed.Add('EVP_MD_meth_set_final'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_MD_meth_set_copy := LoadLibFunction(ADllHandle, EVP_MD_meth_set_copy_procname); + FuncLoadError := not assigned(EVP_MD_meth_set_copy); + if FuncLoadError then + begin + {$if not defined(EVP_MD_meth_set_copy_allownil)} + EVP_MD_meth_set_copy := @ERR_EVP_MD_meth_set_copy; + {$ifend} + {$if declared(EVP_MD_meth_set_copy_introduced)} + if LibVersion < EVP_MD_meth_set_copy_introduced then + begin + {$if declared(FC_EVP_MD_meth_set_copy)} + EVP_MD_meth_set_copy := @FC_EVP_MD_meth_set_copy; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_MD_meth_set_copy_removed)} + if EVP_MD_meth_set_copy_removed <= LibVersion then + begin + {$if declared(_EVP_MD_meth_set_copy)} + EVP_MD_meth_set_copy := @_EVP_MD_meth_set_copy; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_MD_meth_set_copy_allownil)} + if FuncLoadError then + AFailed.Add('EVP_MD_meth_set_copy'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_MD_meth_set_cleanup := LoadLibFunction(ADllHandle, EVP_MD_meth_set_cleanup_procname); + FuncLoadError := not assigned(EVP_MD_meth_set_cleanup); + if FuncLoadError then + begin + {$if not defined(EVP_MD_meth_set_cleanup_allownil)} + EVP_MD_meth_set_cleanup := @ERR_EVP_MD_meth_set_cleanup; + {$ifend} + {$if declared(EVP_MD_meth_set_cleanup_introduced)} + if LibVersion < EVP_MD_meth_set_cleanup_introduced then + begin + {$if declared(FC_EVP_MD_meth_set_cleanup)} + EVP_MD_meth_set_cleanup := @FC_EVP_MD_meth_set_cleanup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_MD_meth_set_cleanup_removed)} + if EVP_MD_meth_set_cleanup_removed <= LibVersion then + begin + {$if declared(_EVP_MD_meth_set_cleanup)} + EVP_MD_meth_set_cleanup := @_EVP_MD_meth_set_cleanup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_MD_meth_set_cleanup_allownil)} + if FuncLoadError then + AFailed.Add('EVP_MD_meth_set_cleanup'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_MD_meth_set_ctrl := LoadLibFunction(ADllHandle, EVP_MD_meth_set_ctrl_procname); + FuncLoadError := not assigned(EVP_MD_meth_set_ctrl); + if FuncLoadError then + begin + {$if not defined(EVP_MD_meth_set_ctrl_allownil)} + EVP_MD_meth_set_ctrl := @ERR_EVP_MD_meth_set_ctrl; + {$ifend} + {$if declared(EVP_MD_meth_set_ctrl_introduced)} + if LibVersion < EVP_MD_meth_set_ctrl_introduced then + begin + {$if declared(FC_EVP_MD_meth_set_ctrl)} + EVP_MD_meth_set_ctrl := @FC_EVP_MD_meth_set_ctrl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_MD_meth_set_ctrl_removed)} + if EVP_MD_meth_set_ctrl_removed <= LibVersion then + begin + {$if declared(_EVP_MD_meth_set_ctrl)} + EVP_MD_meth_set_ctrl := @_EVP_MD_meth_set_ctrl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_MD_meth_set_ctrl_allownil)} + if FuncLoadError then + AFailed.Add('EVP_MD_meth_set_ctrl'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_MD_meth_get_input_blocksize := LoadLibFunction(ADllHandle, EVP_MD_meth_get_input_blocksize_procname); + FuncLoadError := not assigned(EVP_MD_meth_get_input_blocksize); + if FuncLoadError then + begin + {$if not defined(EVP_MD_meth_get_input_blocksize_allownil)} + EVP_MD_meth_get_input_blocksize := @ERR_EVP_MD_meth_get_input_blocksize; + {$ifend} + {$if declared(EVP_MD_meth_get_input_blocksize_introduced)} + if LibVersion < EVP_MD_meth_get_input_blocksize_introduced then + begin + {$if declared(FC_EVP_MD_meth_get_input_blocksize)} + EVP_MD_meth_get_input_blocksize := @FC_EVP_MD_meth_get_input_blocksize; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_MD_meth_get_input_blocksize_removed)} + if EVP_MD_meth_get_input_blocksize_removed <= LibVersion then + begin + {$if declared(_EVP_MD_meth_get_input_blocksize)} + EVP_MD_meth_get_input_blocksize := @_EVP_MD_meth_get_input_blocksize; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_MD_meth_get_input_blocksize_allownil)} + if FuncLoadError then + AFailed.Add('EVP_MD_meth_get_input_blocksize'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_MD_meth_get_result_size := LoadLibFunction(ADllHandle, EVP_MD_meth_get_result_size_procname); + FuncLoadError := not assigned(EVP_MD_meth_get_result_size); + if FuncLoadError then + begin + {$if not defined(EVP_MD_meth_get_result_size_allownil)} + EVP_MD_meth_get_result_size := @ERR_EVP_MD_meth_get_result_size; + {$ifend} + {$if declared(EVP_MD_meth_get_result_size_introduced)} + if LibVersion < EVP_MD_meth_get_result_size_introduced then + begin + {$if declared(FC_EVP_MD_meth_get_result_size)} + EVP_MD_meth_get_result_size := @FC_EVP_MD_meth_get_result_size; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_MD_meth_get_result_size_removed)} + if EVP_MD_meth_get_result_size_removed <= LibVersion then + begin + {$if declared(_EVP_MD_meth_get_result_size)} + EVP_MD_meth_get_result_size := @_EVP_MD_meth_get_result_size; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_MD_meth_get_result_size_allownil)} + if FuncLoadError then + AFailed.Add('EVP_MD_meth_get_result_size'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_MD_meth_get_app_datasize := LoadLibFunction(ADllHandle, EVP_MD_meth_get_app_datasize_procname); + FuncLoadError := not assigned(EVP_MD_meth_get_app_datasize); + if FuncLoadError then + begin + {$if not defined(EVP_MD_meth_get_app_datasize_allownil)} + EVP_MD_meth_get_app_datasize := @ERR_EVP_MD_meth_get_app_datasize; + {$ifend} + {$if declared(EVP_MD_meth_get_app_datasize_introduced)} + if LibVersion < EVP_MD_meth_get_app_datasize_introduced then + begin + {$if declared(FC_EVP_MD_meth_get_app_datasize)} + EVP_MD_meth_get_app_datasize := @FC_EVP_MD_meth_get_app_datasize; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_MD_meth_get_app_datasize_removed)} + if EVP_MD_meth_get_app_datasize_removed <= LibVersion then + begin + {$if declared(_EVP_MD_meth_get_app_datasize)} + EVP_MD_meth_get_app_datasize := @_EVP_MD_meth_get_app_datasize; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_MD_meth_get_app_datasize_allownil)} + if FuncLoadError then + AFailed.Add('EVP_MD_meth_get_app_datasize'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_MD_meth_get_flags := LoadLibFunction(ADllHandle, EVP_MD_meth_get_flags_procname); + FuncLoadError := not assigned(EVP_MD_meth_get_flags); + if FuncLoadError then + begin + {$if not defined(EVP_MD_meth_get_flags_allownil)} + EVP_MD_meth_get_flags := @ERR_EVP_MD_meth_get_flags; + {$ifend} + {$if declared(EVP_MD_meth_get_flags_introduced)} + if LibVersion < EVP_MD_meth_get_flags_introduced then + begin + {$if declared(FC_EVP_MD_meth_get_flags)} + EVP_MD_meth_get_flags := @FC_EVP_MD_meth_get_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_MD_meth_get_flags_removed)} + if EVP_MD_meth_get_flags_removed <= LibVersion then + begin + {$if declared(_EVP_MD_meth_get_flags)} + EVP_MD_meth_get_flags := @_EVP_MD_meth_get_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_MD_meth_get_flags_allownil)} + if FuncLoadError then + AFailed.Add('EVP_MD_meth_get_flags'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_MD_meth_get_init := LoadLibFunction(ADllHandle, EVP_MD_meth_get_init_procname); + FuncLoadError := not assigned(EVP_MD_meth_get_init); + if FuncLoadError then + begin + {$if not defined(EVP_MD_meth_get_init_allownil)} + EVP_MD_meth_get_init := @ERR_EVP_MD_meth_get_init; + {$ifend} + {$if declared(EVP_MD_meth_get_init_introduced)} + if LibVersion < EVP_MD_meth_get_init_introduced then + begin + {$if declared(FC_EVP_MD_meth_get_init)} + EVP_MD_meth_get_init := @FC_EVP_MD_meth_get_init; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_MD_meth_get_init_removed)} + if EVP_MD_meth_get_init_removed <= LibVersion then + begin + {$if declared(_EVP_MD_meth_get_init)} + EVP_MD_meth_get_init := @_EVP_MD_meth_get_init; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_MD_meth_get_init_allownil)} + if FuncLoadError then + AFailed.Add('EVP_MD_meth_get_init'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_MD_meth_get_update := LoadLibFunction(ADllHandle, EVP_MD_meth_get_update_procname); + FuncLoadError := not assigned(EVP_MD_meth_get_update); + if FuncLoadError then + begin + {$if not defined(EVP_MD_meth_get_update_allownil)} + EVP_MD_meth_get_update := @ERR_EVP_MD_meth_get_update; + {$ifend} + {$if declared(EVP_MD_meth_get_update_introduced)} + if LibVersion < EVP_MD_meth_get_update_introduced then + begin + {$if declared(FC_EVP_MD_meth_get_update)} + EVP_MD_meth_get_update := @FC_EVP_MD_meth_get_update; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_MD_meth_get_update_removed)} + if EVP_MD_meth_get_update_removed <= LibVersion then + begin + {$if declared(_EVP_MD_meth_get_update)} + EVP_MD_meth_get_update := @_EVP_MD_meth_get_update; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_MD_meth_get_update_allownil)} + if FuncLoadError then + AFailed.Add('EVP_MD_meth_get_update'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_MD_meth_get_final := LoadLibFunction(ADllHandle, EVP_MD_meth_get_final_procname); + FuncLoadError := not assigned(EVP_MD_meth_get_final); + if FuncLoadError then + begin + {$if not defined(EVP_MD_meth_get_final_allownil)} + EVP_MD_meth_get_final := @ERR_EVP_MD_meth_get_final; + {$ifend} + {$if declared(EVP_MD_meth_get_final_introduced)} + if LibVersion < EVP_MD_meth_get_final_introduced then + begin + {$if declared(FC_EVP_MD_meth_get_final)} + EVP_MD_meth_get_final := @FC_EVP_MD_meth_get_final; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_MD_meth_get_final_removed)} + if EVP_MD_meth_get_final_removed <= LibVersion then + begin + {$if declared(_EVP_MD_meth_get_final)} + EVP_MD_meth_get_final := @_EVP_MD_meth_get_final; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_MD_meth_get_final_allownil)} + if FuncLoadError then + AFailed.Add('EVP_MD_meth_get_final'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_MD_meth_get_copy := LoadLibFunction(ADllHandle, EVP_MD_meth_get_copy_procname); + FuncLoadError := not assigned(EVP_MD_meth_get_copy); + if FuncLoadError then + begin + {$if not defined(EVP_MD_meth_get_copy_allownil)} + EVP_MD_meth_get_copy := @ERR_EVP_MD_meth_get_copy; + {$ifend} + {$if declared(EVP_MD_meth_get_copy_introduced)} + if LibVersion < EVP_MD_meth_get_copy_introduced then + begin + {$if declared(FC_EVP_MD_meth_get_copy)} + EVP_MD_meth_get_copy := @FC_EVP_MD_meth_get_copy; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_MD_meth_get_copy_removed)} + if EVP_MD_meth_get_copy_removed <= LibVersion then + begin + {$if declared(_EVP_MD_meth_get_copy)} + EVP_MD_meth_get_copy := @_EVP_MD_meth_get_copy; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_MD_meth_get_copy_allownil)} + if FuncLoadError then + AFailed.Add('EVP_MD_meth_get_copy'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_MD_meth_get_cleanup := LoadLibFunction(ADllHandle, EVP_MD_meth_get_cleanup_procname); + FuncLoadError := not assigned(EVP_MD_meth_get_cleanup); + if FuncLoadError then + begin + {$if not defined(EVP_MD_meth_get_cleanup_allownil)} + EVP_MD_meth_get_cleanup := @ERR_EVP_MD_meth_get_cleanup; + {$ifend} + {$if declared(EVP_MD_meth_get_cleanup_introduced)} + if LibVersion < EVP_MD_meth_get_cleanup_introduced then + begin + {$if declared(FC_EVP_MD_meth_get_cleanup)} + EVP_MD_meth_get_cleanup := @FC_EVP_MD_meth_get_cleanup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_MD_meth_get_cleanup_removed)} + if EVP_MD_meth_get_cleanup_removed <= LibVersion then + begin + {$if declared(_EVP_MD_meth_get_cleanup)} + EVP_MD_meth_get_cleanup := @_EVP_MD_meth_get_cleanup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_MD_meth_get_cleanup_allownil)} + if FuncLoadError then + AFailed.Add('EVP_MD_meth_get_cleanup'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_MD_meth_get_ctrl := LoadLibFunction(ADllHandle, EVP_MD_meth_get_ctrl_procname); + FuncLoadError := not assigned(EVP_MD_meth_get_ctrl); + if FuncLoadError then + begin + {$if not defined(EVP_MD_meth_get_ctrl_allownil)} + EVP_MD_meth_get_ctrl := @ERR_EVP_MD_meth_get_ctrl; + {$ifend} + {$if declared(EVP_MD_meth_get_ctrl_introduced)} + if LibVersion < EVP_MD_meth_get_ctrl_introduced then + begin + {$if declared(FC_EVP_MD_meth_get_ctrl)} + EVP_MD_meth_get_ctrl := @FC_EVP_MD_meth_get_ctrl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_MD_meth_get_ctrl_removed)} + if EVP_MD_meth_get_ctrl_removed <= LibVersion then + begin + {$if declared(_EVP_MD_meth_get_ctrl)} + EVP_MD_meth_get_ctrl := @_EVP_MD_meth_get_ctrl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_MD_meth_get_ctrl_allownil)} + if FuncLoadError then + AFailed.Add('EVP_MD_meth_get_ctrl'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_CIPHER_meth_new := LoadLibFunction(ADllHandle, EVP_CIPHER_meth_new_procname); + FuncLoadError := not assigned(EVP_CIPHER_meth_new); + if FuncLoadError then + begin + {$if not defined(EVP_CIPHER_meth_new_allownil)} + EVP_CIPHER_meth_new := @ERR_EVP_CIPHER_meth_new; + {$ifend} + {$if declared(EVP_CIPHER_meth_new_introduced)} + if LibVersion < EVP_CIPHER_meth_new_introduced then + begin + {$if declared(FC_EVP_CIPHER_meth_new)} + EVP_CIPHER_meth_new := @FC_EVP_CIPHER_meth_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_CIPHER_meth_new_removed)} + if EVP_CIPHER_meth_new_removed <= LibVersion then + begin + {$if declared(_EVP_CIPHER_meth_new)} + EVP_CIPHER_meth_new := @_EVP_CIPHER_meth_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_CIPHER_meth_new_allownil)} + if FuncLoadError then + AFailed.Add('EVP_CIPHER_meth_new'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_CIPHER_meth_dup := LoadLibFunction(ADllHandle, EVP_CIPHER_meth_dup_procname); + FuncLoadError := not assigned(EVP_CIPHER_meth_dup); + if FuncLoadError then + begin + {$if not defined(EVP_CIPHER_meth_dup_allownil)} + EVP_CIPHER_meth_dup := @ERR_EVP_CIPHER_meth_dup; + {$ifend} + {$if declared(EVP_CIPHER_meth_dup_introduced)} + if LibVersion < EVP_CIPHER_meth_dup_introduced then + begin + {$if declared(FC_EVP_CIPHER_meth_dup)} + EVP_CIPHER_meth_dup := @FC_EVP_CIPHER_meth_dup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_CIPHER_meth_dup_removed)} + if EVP_CIPHER_meth_dup_removed <= LibVersion then + begin + {$if declared(_EVP_CIPHER_meth_dup)} + EVP_CIPHER_meth_dup := @_EVP_CIPHER_meth_dup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_CIPHER_meth_dup_allownil)} + if FuncLoadError then + AFailed.Add('EVP_CIPHER_meth_dup'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_CIPHER_meth_free := LoadLibFunction(ADllHandle, EVP_CIPHER_meth_free_procname); + FuncLoadError := not assigned(EVP_CIPHER_meth_free); + if FuncLoadError then + begin + {$if not defined(EVP_CIPHER_meth_free_allownil)} + EVP_CIPHER_meth_free := @ERR_EVP_CIPHER_meth_free; + {$ifend} + {$if declared(EVP_CIPHER_meth_free_introduced)} + if LibVersion < EVP_CIPHER_meth_free_introduced then + begin + {$if declared(FC_EVP_CIPHER_meth_free)} + EVP_CIPHER_meth_free := @FC_EVP_CIPHER_meth_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_CIPHER_meth_free_removed)} + if EVP_CIPHER_meth_free_removed <= LibVersion then + begin + {$if declared(_EVP_CIPHER_meth_free)} + EVP_CIPHER_meth_free := @_EVP_CIPHER_meth_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_CIPHER_meth_free_allownil)} + if FuncLoadError then + AFailed.Add('EVP_CIPHER_meth_free'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_CIPHER_meth_set_iv_length := LoadLibFunction(ADllHandle, EVP_CIPHER_meth_set_iv_length_procname); + FuncLoadError := not assigned(EVP_CIPHER_meth_set_iv_length); + if FuncLoadError then + begin + {$if not defined(EVP_CIPHER_meth_set_iv_length_allownil)} + EVP_CIPHER_meth_set_iv_length := @ERR_EVP_CIPHER_meth_set_iv_length; + {$ifend} + {$if declared(EVP_CIPHER_meth_set_iv_length_introduced)} + if LibVersion < EVP_CIPHER_meth_set_iv_length_introduced then + begin + {$if declared(FC_EVP_CIPHER_meth_set_iv_length)} + EVP_CIPHER_meth_set_iv_length := @FC_EVP_CIPHER_meth_set_iv_length; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_CIPHER_meth_set_iv_length_removed)} + if EVP_CIPHER_meth_set_iv_length_removed <= LibVersion then + begin + {$if declared(_EVP_CIPHER_meth_set_iv_length)} + EVP_CIPHER_meth_set_iv_length := @_EVP_CIPHER_meth_set_iv_length; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_CIPHER_meth_set_iv_length_allownil)} + if FuncLoadError then + AFailed.Add('EVP_CIPHER_meth_set_iv_length'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_CIPHER_meth_set_flags := LoadLibFunction(ADllHandle, EVP_CIPHER_meth_set_flags_procname); + FuncLoadError := not assigned(EVP_CIPHER_meth_set_flags); + if FuncLoadError then + begin + {$if not defined(EVP_CIPHER_meth_set_flags_allownil)} + EVP_CIPHER_meth_set_flags := @ERR_EVP_CIPHER_meth_set_flags; + {$ifend} + {$if declared(EVP_CIPHER_meth_set_flags_introduced)} + if LibVersion < EVP_CIPHER_meth_set_flags_introduced then + begin + {$if declared(FC_EVP_CIPHER_meth_set_flags)} + EVP_CIPHER_meth_set_flags := @FC_EVP_CIPHER_meth_set_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_CIPHER_meth_set_flags_removed)} + if EVP_CIPHER_meth_set_flags_removed <= LibVersion then + begin + {$if declared(_EVP_CIPHER_meth_set_flags)} + EVP_CIPHER_meth_set_flags := @_EVP_CIPHER_meth_set_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_CIPHER_meth_set_flags_allownil)} + if FuncLoadError then + AFailed.Add('EVP_CIPHER_meth_set_flags'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_CIPHER_meth_set_impl_ctx_size := LoadLibFunction(ADllHandle, EVP_CIPHER_meth_set_impl_ctx_size_procname); + FuncLoadError := not assigned(EVP_CIPHER_meth_set_impl_ctx_size); + if FuncLoadError then + begin + {$if not defined(EVP_CIPHER_meth_set_impl_ctx_size_allownil)} + EVP_CIPHER_meth_set_impl_ctx_size := @ERR_EVP_CIPHER_meth_set_impl_ctx_size; + {$ifend} + {$if declared(EVP_CIPHER_meth_set_impl_ctx_size_introduced)} + if LibVersion < EVP_CIPHER_meth_set_impl_ctx_size_introduced then + begin + {$if declared(FC_EVP_CIPHER_meth_set_impl_ctx_size)} + EVP_CIPHER_meth_set_impl_ctx_size := @FC_EVP_CIPHER_meth_set_impl_ctx_size; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_CIPHER_meth_set_impl_ctx_size_removed)} + if EVP_CIPHER_meth_set_impl_ctx_size_removed <= LibVersion then + begin + {$if declared(_EVP_CIPHER_meth_set_impl_ctx_size)} + EVP_CIPHER_meth_set_impl_ctx_size := @_EVP_CIPHER_meth_set_impl_ctx_size; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_CIPHER_meth_set_impl_ctx_size_allownil)} + if FuncLoadError then + AFailed.Add('EVP_CIPHER_meth_set_impl_ctx_size'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_CIPHER_meth_set_init := LoadLibFunction(ADllHandle, EVP_CIPHER_meth_set_init_procname); + FuncLoadError := not assigned(EVP_CIPHER_meth_set_init); + if FuncLoadError then + begin + {$if not defined(EVP_CIPHER_meth_set_init_allownil)} + EVP_CIPHER_meth_set_init := @ERR_EVP_CIPHER_meth_set_init; + {$ifend} + {$if declared(EVP_CIPHER_meth_set_init_introduced)} + if LibVersion < EVP_CIPHER_meth_set_init_introduced then + begin + {$if declared(FC_EVP_CIPHER_meth_set_init)} + EVP_CIPHER_meth_set_init := @FC_EVP_CIPHER_meth_set_init; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_CIPHER_meth_set_init_removed)} + if EVP_CIPHER_meth_set_init_removed <= LibVersion then + begin + {$if declared(_EVP_CIPHER_meth_set_init)} + EVP_CIPHER_meth_set_init := @_EVP_CIPHER_meth_set_init; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_CIPHER_meth_set_init_allownil)} + if FuncLoadError then + AFailed.Add('EVP_CIPHER_meth_set_init'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_CIPHER_meth_set_do_cipher := LoadLibFunction(ADllHandle, EVP_CIPHER_meth_set_do_cipher_procname); + FuncLoadError := not assigned(EVP_CIPHER_meth_set_do_cipher); + if FuncLoadError then + begin + {$if not defined(EVP_CIPHER_meth_set_do_cipher_allownil)} + EVP_CIPHER_meth_set_do_cipher := @ERR_EVP_CIPHER_meth_set_do_cipher; + {$ifend} + {$if declared(EVP_CIPHER_meth_set_do_cipher_introduced)} + if LibVersion < EVP_CIPHER_meth_set_do_cipher_introduced then + begin + {$if declared(FC_EVP_CIPHER_meth_set_do_cipher)} + EVP_CIPHER_meth_set_do_cipher := @FC_EVP_CIPHER_meth_set_do_cipher; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_CIPHER_meth_set_do_cipher_removed)} + if EVP_CIPHER_meth_set_do_cipher_removed <= LibVersion then + begin + {$if declared(_EVP_CIPHER_meth_set_do_cipher)} + EVP_CIPHER_meth_set_do_cipher := @_EVP_CIPHER_meth_set_do_cipher; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_CIPHER_meth_set_do_cipher_allownil)} + if FuncLoadError then + AFailed.Add('EVP_CIPHER_meth_set_do_cipher'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_CIPHER_meth_set_cleanup := LoadLibFunction(ADllHandle, EVP_CIPHER_meth_set_cleanup_procname); + FuncLoadError := not assigned(EVP_CIPHER_meth_set_cleanup); + if FuncLoadError then + begin + {$if not defined(EVP_CIPHER_meth_set_cleanup_allownil)} + EVP_CIPHER_meth_set_cleanup := @ERR_EVP_CIPHER_meth_set_cleanup; + {$ifend} + {$if declared(EVP_CIPHER_meth_set_cleanup_introduced)} + if LibVersion < EVP_CIPHER_meth_set_cleanup_introduced then + begin + {$if declared(FC_EVP_CIPHER_meth_set_cleanup)} + EVP_CIPHER_meth_set_cleanup := @FC_EVP_CIPHER_meth_set_cleanup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_CIPHER_meth_set_cleanup_removed)} + if EVP_CIPHER_meth_set_cleanup_removed <= LibVersion then + begin + {$if declared(_EVP_CIPHER_meth_set_cleanup)} + EVP_CIPHER_meth_set_cleanup := @_EVP_CIPHER_meth_set_cleanup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_CIPHER_meth_set_cleanup_allownil)} + if FuncLoadError then + AFailed.Add('EVP_CIPHER_meth_set_cleanup'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_CIPHER_meth_set_set_asn1_params := LoadLibFunction(ADllHandle, EVP_CIPHER_meth_set_set_asn1_params_procname); + FuncLoadError := not assigned(EVP_CIPHER_meth_set_set_asn1_params); + if FuncLoadError then + begin + {$if not defined(EVP_CIPHER_meth_set_set_asn1_params_allownil)} + EVP_CIPHER_meth_set_set_asn1_params := @ERR_EVP_CIPHER_meth_set_set_asn1_params; + {$ifend} + {$if declared(EVP_CIPHER_meth_set_set_asn1_params_introduced)} + if LibVersion < EVP_CIPHER_meth_set_set_asn1_params_introduced then + begin + {$if declared(FC_EVP_CIPHER_meth_set_set_asn1_params)} + EVP_CIPHER_meth_set_set_asn1_params := @FC_EVP_CIPHER_meth_set_set_asn1_params; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_CIPHER_meth_set_set_asn1_params_removed)} + if EVP_CIPHER_meth_set_set_asn1_params_removed <= LibVersion then + begin + {$if declared(_EVP_CIPHER_meth_set_set_asn1_params)} + EVP_CIPHER_meth_set_set_asn1_params := @_EVP_CIPHER_meth_set_set_asn1_params; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_CIPHER_meth_set_set_asn1_params_allownil)} + if FuncLoadError then + AFailed.Add('EVP_CIPHER_meth_set_set_asn1_params'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_CIPHER_meth_set_get_asn1_params := LoadLibFunction(ADllHandle, EVP_CIPHER_meth_set_get_asn1_params_procname); + FuncLoadError := not assigned(EVP_CIPHER_meth_set_get_asn1_params); + if FuncLoadError then + begin + {$if not defined(EVP_CIPHER_meth_set_get_asn1_params_allownil)} + EVP_CIPHER_meth_set_get_asn1_params := @ERR_EVP_CIPHER_meth_set_get_asn1_params; + {$ifend} + {$if declared(EVP_CIPHER_meth_set_get_asn1_params_introduced)} + if LibVersion < EVP_CIPHER_meth_set_get_asn1_params_introduced then + begin + {$if declared(FC_EVP_CIPHER_meth_set_get_asn1_params)} + EVP_CIPHER_meth_set_get_asn1_params := @FC_EVP_CIPHER_meth_set_get_asn1_params; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_CIPHER_meth_set_get_asn1_params_removed)} + if EVP_CIPHER_meth_set_get_asn1_params_removed <= LibVersion then + begin + {$if declared(_EVP_CIPHER_meth_set_get_asn1_params)} + EVP_CIPHER_meth_set_get_asn1_params := @_EVP_CIPHER_meth_set_get_asn1_params; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_CIPHER_meth_set_get_asn1_params_allownil)} + if FuncLoadError then + AFailed.Add('EVP_CIPHER_meth_set_get_asn1_params'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_CIPHER_meth_set_ctrl := LoadLibFunction(ADllHandle, EVP_CIPHER_meth_set_ctrl_procname); + FuncLoadError := not assigned(EVP_CIPHER_meth_set_ctrl); + if FuncLoadError then + begin + {$if not defined(EVP_CIPHER_meth_set_ctrl_allownil)} + EVP_CIPHER_meth_set_ctrl := @ERR_EVP_CIPHER_meth_set_ctrl; + {$ifend} + {$if declared(EVP_CIPHER_meth_set_ctrl_introduced)} + if LibVersion < EVP_CIPHER_meth_set_ctrl_introduced then + begin + {$if declared(FC_EVP_CIPHER_meth_set_ctrl)} + EVP_CIPHER_meth_set_ctrl := @FC_EVP_CIPHER_meth_set_ctrl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_CIPHER_meth_set_ctrl_removed)} + if EVP_CIPHER_meth_set_ctrl_removed <= LibVersion then + begin + {$if declared(_EVP_CIPHER_meth_set_ctrl)} + EVP_CIPHER_meth_set_ctrl := @_EVP_CIPHER_meth_set_ctrl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_CIPHER_meth_set_ctrl_allownil)} + if FuncLoadError then + AFailed.Add('EVP_CIPHER_meth_set_ctrl'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_CIPHER_meth_get_init := LoadLibFunction(ADllHandle, EVP_CIPHER_meth_get_init_procname); + FuncLoadError := not assigned(EVP_CIPHER_meth_get_init); + if FuncLoadError then + begin + {$if not defined(EVP_CIPHER_meth_get_init_allownil)} + EVP_CIPHER_meth_get_init := @ERR_EVP_CIPHER_meth_get_init; + {$ifend} + {$if declared(EVP_CIPHER_meth_get_init_introduced)} + if LibVersion < EVP_CIPHER_meth_get_init_introduced then + begin + {$if declared(FC_EVP_CIPHER_meth_get_init)} + EVP_CIPHER_meth_get_init := @FC_EVP_CIPHER_meth_get_init; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_CIPHER_meth_get_init_removed)} + if EVP_CIPHER_meth_get_init_removed <= LibVersion then + begin + {$if declared(_EVP_CIPHER_meth_get_init)} + EVP_CIPHER_meth_get_init := @_EVP_CIPHER_meth_get_init; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_CIPHER_meth_get_init_allownil)} + if FuncLoadError then + AFailed.Add('EVP_CIPHER_meth_get_init'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_CIPHER_meth_get_do_cipher := LoadLibFunction(ADllHandle, EVP_CIPHER_meth_get_do_cipher_procname); + FuncLoadError := not assigned(EVP_CIPHER_meth_get_do_cipher); + if FuncLoadError then + begin + {$if not defined(EVP_CIPHER_meth_get_do_cipher_allownil)} + EVP_CIPHER_meth_get_do_cipher := @ERR_EVP_CIPHER_meth_get_do_cipher; + {$ifend} + {$if declared(EVP_CIPHER_meth_get_do_cipher_introduced)} + if LibVersion < EVP_CIPHER_meth_get_do_cipher_introduced then + begin + {$if declared(FC_EVP_CIPHER_meth_get_do_cipher)} + EVP_CIPHER_meth_get_do_cipher := @FC_EVP_CIPHER_meth_get_do_cipher; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_CIPHER_meth_get_do_cipher_removed)} + if EVP_CIPHER_meth_get_do_cipher_removed <= LibVersion then + begin + {$if declared(_EVP_CIPHER_meth_get_do_cipher)} + EVP_CIPHER_meth_get_do_cipher := @_EVP_CIPHER_meth_get_do_cipher; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_CIPHER_meth_get_do_cipher_allownil)} + if FuncLoadError then + AFailed.Add('EVP_CIPHER_meth_get_do_cipher'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_CIPHER_meth_get_cleanup := LoadLibFunction(ADllHandle, EVP_CIPHER_meth_get_cleanup_procname); + FuncLoadError := not assigned(EVP_CIPHER_meth_get_cleanup); + if FuncLoadError then + begin + {$if not defined(EVP_CIPHER_meth_get_cleanup_allownil)} + EVP_CIPHER_meth_get_cleanup := @ERR_EVP_CIPHER_meth_get_cleanup; + {$ifend} + {$if declared(EVP_CIPHER_meth_get_cleanup_introduced)} + if LibVersion < EVP_CIPHER_meth_get_cleanup_introduced then + begin + {$if declared(FC_EVP_CIPHER_meth_get_cleanup)} + EVP_CIPHER_meth_get_cleanup := @FC_EVP_CIPHER_meth_get_cleanup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_CIPHER_meth_get_cleanup_removed)} + if EVP_CIPHER_meth_get_cleanup_removed <= LibVersion then + begin + {$if declared(_EVP_CIPHER_meth_get_cleanup)} + EVP_CIPHER_meth_get_cleanup := @_EVP_CIPHER_meth_get_cleanup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_CIPHER_meth_get_cleanup_allownil)} + if FuncLoadError then + AFailed.Add('EVP_CIPHER_meth_get_cleanup'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_CIPHER_meth_get_set_asn1_params := LoadLibFunction(ADllHandle, EVP_CIPHER_meth_get_set_asn1_params_procname); + FuncLoadError := not assigned(EVP_CIPHER_meth_get_set_asn1_params); + if FuncLoadError then + begin + {$if not defined(EVP_CIPHER_meth_get_set_asn1_params_allownil)} + EVP_CIPHER_meth_get_set_asn1_params := @ERR_EVP_CIPHER_meth_get_set_asn1_params; + {$ifend} + {$if declared(EVP_CIPHER_meth_get_set_asn1_params_introduced)} + if LibVersion < EVP_CIPHER_meth_get_set_asn1_params_introduced then + begin + {$if declared(FC_EVP_CIPHER_meth_get_set_asn1_params)} + EVP_CIPHER_meth_get_set_asn1_params := @FC_EVP_CIPHER_meth_get_set_asn1_params; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_CIPHER_meth_get_set_asn1_params_removed)} + if EVP_CIPHER_meth_get_set_asn1_params_removed <= LibVersion then + begin + {$if declared(_EVP_CIPHER_meth_get_set_asn1_params)} + EVP_CIPHER_meth_get_set_asn1_params := @_EVP_CIPHER_meth_get_set_asn1_params; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_CIPHER_meth_get_set_asn1_params_allownil)} + if FuncLoadError then + AFailed.Add('EVP_CIPHER_meth_get_set_asn1_params'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_CIPHER_meth_get_get_asn1_params := LoadLibFunction(ADllHandle, EVP_CIPHER_meth_get_get_asn1_params_procname); + FuncLoadError := not assigned(EVP_CIPHER_meth_get_get_asn1_params); + if FuncLoadError then + begin + {$if not defined(EVP_CIPHER_meth_get_get_asn1_params_allownil)} + EVP_CIPHER_meth_get_get_asn1_params := @ERR_EVP_CIPHER_meth_get_get_asn1_params; + {$ifend} + {$if declared(EVP_CIPHER_meth_get_get_asn1_params_introduced)} + if LibVersion < EVP_CIPHER_meth_get_get_asn1_params_introduced then + begin + {$if declared(FC_EVP_CIPHER_meth_get_get_asn1_params)} + EVP_CIPHER_meth_get_get_asn1_params := @FC_EVP_CIPHER_meth_get_get_asn1_params; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_CIPHER_meth_get_get_asn1_params_removed)} + if EVP_CIPHER_meth_get_get_asn1_params_removed <= LibVersion then + begin + {$if declared(_EVP_CIPHER_meth_get_get_asn1_params)} + EVP_CIPHER_meth_get_get_asn1_params := @_EVP_CIPHER_meth_get_get_asn1_params; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_CIPHER_meth_get_get_asn1_params_allownil)} + if FuncLoadError then + AFailed.Add('EVP_CIPHER_meth_get_get_asn1_params'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_CIPHER_meth_get_ctrl := LoadLibFunction(ADllHandle, EVP_CIPHER_meth_get_ctrl_procname); + FuncLoadError := not assigned(EVP_CIPHER_meth_get_ctrl); + if FuncLoadError then + begin + {$if not defined(EVP_CIPHER_meth_get_ctrl_allownil)} + EVP_CIPHER_meth_get_ctrl := @ERR_EVP_CIPHER_meth_get_ctrl; + {$ifend} + {$if declared(EVP_CIPHER_meth_get_ctrl_introduced)} + if LibVersion < EVP_CIPHER_meth_get_ctrl_introduced then + begin + {$if declared(FC_EVP_CIPHER_meth_get_ctrl)} + EVP_CIPHER_meth_get_ctrl := @FC_EVP_CIPHER_meth_get_ctrl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_CIPHER_meth_get_ctrl_removed)} + if EVP_CIPHER_meth_get_ctrl_removed <= LibVersion then + begin + {$if declared(_EVP_CIPHER_meth_get_ctrl)} + EVP_CIPHER_meth_get_ctrl := @_EVP_CIPHER_meth_get_ctrl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_CIPHER_meth_get_ctrl_allownil)} + if FuncLoadError then + AFailed.Add('EVP_CIPHER_meth_get_ctrl'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_MD_type := LoadLibFunction(ADllHandle, EVP_MD_type_procname); + FuncLoadError := not assigned(EVP_MD_type); + if FuncLoadError then + begin + {$if not defined(EVP_MD_type_allownil)} + EVP_MD_type := @ERR_EVP_MD_type; + {$ifend} + {$if declared(EVP_MD_type_introduced)} + if LibVersion < EVP_MD_type_introduced then + begin + {$if declared(FC_EVP_MD_type)} + EVP_MD_type := @FC_EVP_MD_type; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_MD_type_removed)} + if EVP_MD_type_removed <= LibVersion then + begin + {$if declared(_EVP_MD_type)} + EVP_MD_type := @_EVP_MD_type; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_MD_type_allownil)} + if FuncLoadError then + AFailed.Add('EVP_MD_type'); + {$ifend} + end; + + + EVP_MD_pkey_type := LoadLibFunction(ADllHandle, EVP_MD_pkey_type_procname); + FuncLoadError := not assigned(EVP_MD_pkey_type); + if FuncLoadError then + begin + {$if not defined(EVP_MD_pkey_type_allownil)} + EVP_MD_pkey_type := @ERR_EVP_MD_pkey_type; + {$ifend} + {$if declared(EVP_MD_pkey_type_introduced)} + if LibVersion < EVP_MD_pkey_type_introduced then + begin + {$if declared(FC_EVP_MD_pkey_type)} + EVP_MD_pkey_type := @FC_EVP_MD_pkey_type; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_MD_pkey_type_removed)} + if EVP_MD_pkey_type_removed <= LibVersion then + begin + {$if declared(_EVP_MD_pkey_type)} + EVP_MD_pkey_type := @_EVP_MD_pkey_type; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_MD_pkey_type_allownil)} + if FuncLoadError then + AFailed.Add('EVP_MD_pkey_type'); + {$ifend} + end; + + + EVP_MD_size := LoadLibFunction(ADllHandle, EVP_MD_size_procname); + FuncLoadError := not assigned(EVP_MD_size); + if FuncLoadError then + begin + {$if not defined(EVP_MD_size_allownil)} + EVP_MD_size := @ERR_EVP_MD_size; + {$ifend} + {$if declared(EVP_MD_size_introduced)} + if LibVersion < EVP_MD_size_introduced then + begin + {$if declared(FC_EVP_MD_size)} + EVP_MD_size := @FC_EVP_MD_size; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_MD_size_removed)} + if EVP_MD_size_removed <= LibVersion then + begin + {$if declared(_EVP_MD_size)} + EVP_MD_size := @_EVP_MD_size; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_MD_size_allownil)} + if FuncLoadError then + AFailed.Add('EVP_MD_size'); + {$ifend} + end; + + + EVP_MD_block_size := LoadLibFunction(ADllHandle, EVP_MD_block_size_procname); + FuncLoadError := not assigned(EVP_MD_block_size); + if FuncLoadError then + begin + {$if not defined(EVP_MD_block_size_allownil)} + EVP_MD_block_size := @ERR_EVP_MD_block_size; + {$ifend} + {$if declared(EVP_MD_block_size_introduced)} + if LibVersion < EVP_MD_block_size_introduced then + begin + {$if declared(FC_EVP_MD_block_size)} + EVP_MD_block_size := @FC_EVP_MD_block_size; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_MD_block_size_removed)} + if EVP_MD_block_size_removed <= LibVersion then + begin + {$if declared(_EVP_MD_block_size)} + EVP_MD_block_size := @_EVP_MD_block_size; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_MD_block_size_allownil)} + if FuncLoadError then + AFailed.Add('EVP_MD_block_size'); + {$ifend} + end; + + + EVP_MD_flags := LoadLibFunction(ADllHandle, EVP_MD_flags_procname); + FuncLoadError := not assigned(EVP_MD_flags); + if FuncLoadError then + begin + {$if not defined(EVP_MD_flags_allownil)} + EVP_MD_flags := @ERR_EVP_MD_flags; + {$ifend} + {$if declared(EVP_MD_flags_introduced)} + if LibVersion < EVP_MD_flags_introduced then + begin + {$if declared(FC_EVP_MD_flags)} + EVP_MD_flags := @FC_EVP_MD_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_MD_flags_removed)} + if EVP_MD_flags_removed <= LibVersion then + begin + {$if declared(_EVP_MD_flags)} + EVP_MD_flags := @_EVP_MD_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_MD_flags_allownil)} + if FuncLoadError then + AFailed.Add('EVP_MD_flags'); + {$ifend} + end; + + + EVP_MD_CTX_md := LoadLibFunction(ADllHandle, EVP_MD_CTX_md_procname); + FuncLoadError := not assigned(EVP_MD_CTX_md); + if FuncLoadError then + begin + {$if not defined(EVP_MD_CTX_md_allownil)} + EVP_MD_CTX_md := @ERR_EVP_MD_CTX_md; + {$ifend} + {$if declared(EVP_MD_CTX_md_introduced)} + if LibVersion < EVP_MD_CTX_md_introduced then + begin + {$if declared(FC_EVP_MD_CTX_md)} + EVP_MD_CTX_md := @FC_EVP_MD_CTX_md; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_MD_CTX_md_removed)} + if EVP_MD_CTX_md_removed <= LibVersion then + begin + {$if declared(_EVP_MD_CTX_md)} + EVP_MD_CTX_md := @_EVP_MD_CTX_md; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_MD_CTX_md_allownil)} + if FuncLoadError then + AFailed.Add('EVP_MD_CTX_md'); + {$ifend} + end; + + + EVP_MD_CTX_update_fn := LoadLibFunction(ADllHandle, EVP_MD_CTX_update_fn_procname); + FuncLoadError := not assigned(EVP_MD_CTX_update_fn); + if FuncLoadError then + begin + {$if not defined(EVP_MD_CTX_update_fn_allownil)} + EVP_MD_CTX_update_fn := @ERR_EVP_MD_CTX_update_fn; + {$ifend} + {$if declared(EVP_MD_CTX_update_fn_introduced)} + if LibVersion < EVP_MD_CTX_update_fn_introduced then + begin + {$if declared(FC_EVP_MD_CTX_update_fn)} + EVP_MD_CTX_update_fn := @FC_EVP_MD_CTX_update_fn; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_MD_CTX_update_fn_removed)} + if EVP_MD_CTX_update_fn_removed <= LibVersion then + begin + {$if declared(_EVP_MD_CTX_update_fn)} + EVP_MD_CTX_update_fn := @_EVP_MD_CTX_update_fn; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_MD_CTX_update_fn_allownil)} + if FuncLoadError then + AFailed.Add('EVP_MD_CTX_update_fn'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_MD_CTX_set_update_fn := LoadLibFunction(ADllHandle, EVP_MD_CTX_set_update_fn_procname); + FuncLoadError := not assigned(EVP_MD_CTX_set_update_fn); + if FuncLoadError then + begin + {$if not defined(EVP_MD_CTX_set_update_fn_allownil)} + EVP_MD_CTX_set_update_fn := @ERR_EVP_MD_CTX_set_update_fn; + {$ifend} + {$if declared(EVP_MD_CTX_set_update_fn_introduced)} + if LibVersion < EVP_MD_CTX_set_update_fn_introduced then + begin + {$if declared(FC_EVP_MD_CTX_set_update_fn)} + EVP_MD_CTX_set_update_fn := @FC_EVP_MD_CTX_set_update_fn; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_MD_CTX_set_update_fn_removed)} + if EVP_MD_CTX_set_update_fn_removed <= LibVersion then + begin + {$if declared(_EVP_MD_CTX_set_update_fn)} + EVP_MD_CTX_set_update_fn := @_EVP_MD_CTX_set_update_fn; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_MD_CTX_set_update_fn_allownil)} + if FuncLoadError then + AFailed.Add('EVP_MD_CTX_set_update_fn'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_MD_CTX_pkey_ctx := LoadLibFunction(ADllHandle, EVP_MD_CTX_pkey_ctx_procname); + FuncLoadError := not assigned(EVP_MD_CTX_pkey_ctx); + if FuncLoadError then + begin + {$if not defined(EVP_MD_CTX_pkey_ctx_allownil)} + EVP_MD_CTX_pkey_ctx := @ERR_EVP_MD_CTX_pkey_ctx; + {$ifend} + {$if declared(EVP_MD_CTX_pkey_ctx_introduced)} + if LibVersion < EVP_MD_CTX_pkey_ctx_introduced then + begin + {$if declared(FC_EVP_MD_CTX_pkey_ctx)} + EVP_MD_CTX_pkey_ctx := @FC_EVP_MD_CTX_pkey_ctx; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_MD_CTX_pkey_ctx_removed)} + if EVP_MD_CTX_pkey_ctx_removed <= LibVersion then + begin + {$if declared(_EVP_MD_CTX_pkey_ctx)} + EVP_MD_CTX_pkey_ctx := @_EVP_MD_CTX_pkey_ctx; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_MD_CTX_pkey_ctx_allownil)} + if FuncLoadError then + AFailed.Add('EVP_MD_CTX_pkey_ctx'); + {$ifend} + end; + + + EVP_MD_CTX_set_pkey_ctx := LoadLibFunction(ADllHandle, EVP_MD_CTX_set_pkey_ctx_procname); + FuncLoadError := not assigned(EVP_MD_CTX_set_pkey_ctx); + if FuncLoadError then + begin + {$if not defined(EVP_MD_CTX_set_pkey_ctx_allownil)} + EVP_MD_CTX_set_pkey_ctx := @ERR_EVP_MD_CTX_set_pkey_ctx; + {$ifend} + {$if declared(EVP_MD_CTX_set_pkey_ctx_introduced)} + if LibVersion < EVP_MD_CTX_set_pkey_ctx_introduced then + begin + {$if declared(FC_EVP_MD_CTX_set_pkey_ctx)} + EVP_MD_CTX_set_pkey_ctx := @FC_EVP_MD_CTX_set_pkey_ctx; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_MD_CTX_set_pkey_ctx_removed)} + if EVP_MD_CTX_set_pkey_ctx_removed <= LibVersion then + begin + {$if declared(_EVP_MD_CTX_set_pkey_ctx)} + EVP_MD_CTX_set_pkey_ctx := @_EVP_MD_CTX_set_pkey_ctx; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_MD_CTX_set_pkey_ctx_allownil)} + if FuncLoadError then + AFailed.Add('EVP_MD_CTX_set_pkey_ctx'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_MD_CTX_md_data := LoadLibFunction(ADllHandle, EVP_MD_CTX_md_data_procname); + FuncLoadError := not assigned(EVP_MD_CTX_md_data); + if FuncLoadError then + begin + {$if not defined(EVP_MD_CTX_md_data_allownil)} + EVP_MD_CTX_md_data := @ERR_EVP_MD_CTX_md_data; + {$ifend} + {$if declared(EVP_MD_CTX_md_data_introduced)} + if LibVersion < EVP_MD_CTX_md_data_introduced then + begin + {$if declared(FC_EVP_MD_CTX_md_data)} + EVP_MD_CTX_md_data := @FC_EVP_MD_CTX_md_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_MD_CTX_md_data_removed)} + if EVP_MD_CTX_md_data_removed <= LibVersion then + begin + {$if declared(_EVP_MD_CTX_md_data)} + EVP_MD_CTX_md_data := @_EVP_MD_CTX_md_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_MD_CTX_md_data_allownil)} + if FuncLoadError then + AFailed.Add('EVP_MD_CTX_md_data'); + {$ifend} + end; + + + EVP_CIPHER_nid := LoadLibFunction(ADllHandle, EVP_CIPHER_nid_procname); + FuncLoadError := not assigned(EVP_CIPHER_nid); + if FuncLoadError then + begin + {$if not defined(EVP_CIPHER_nid_allownil)} + EVP_CIPHER_nid := @ERR_EVP_CIPHER_nid; + {$ifend} + {$if declared(EVP_CIPHER_nid_introduced)} + if LibVersion < EVP_CIPHER_nid_introduced then + begin + {$if declared(FC_EVP_CIPHER_nid)} + EVP_CIPHER_nid := @FC_EVP_CIPHER_nid; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_CIPHER_nid_removed)} + if EVP_CIPHER_nid_removed <= LibVersion then + begin + {$if declared(_EVP_CIPHER_nid)} + EVP_CIPHER_nid := @_EVP_CIPHER_nid; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_CIPHER_nid_allownil)} + if FuncLoadError then + AFailed.Add('EVP_CIPHER_nid'); + {$ifend} + end; + + + EVP_CIPHER_block_size := LoadLibFunction(ADllHandle, EVP_CIPHER_block_size_procname); + FuncLoadError := not assigned(EVP_CIPHER_block_size); + if FuncLoadError then + begin + {$if not defined(EVP_CIPHER_block_size_allownil)} + EVP_CIPHER_block_size := @ERR_EVP_CIPHER_block_size; + {$ifend} + {$if declared(EVP_CIPHER_block_size_introduced)} + if LibVersion < EVP_CIPHER_block_size_introduced then + begin + {$if declared(FC_EVP_CIPHER_block_size)} + EVP_CIPHER_block_size := @FC_EVP_CIPHER_block_size; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_CIPHER_block_size_removed)} + if EVP_CIPHER_block_size_removed <= LibVersion then + begin + {$if declared(_EVP_CIPHER_block_size)} + EVP_CIPHER_block_size := @_EVP_CIPHER_block_size; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_CIPHER_block_size_allownil)} + if FuncLoadError then + AFailed.Add('EVP_CIPHER_block_size'); + {$ifend} + end; + + + EVP_CIPHER_impl_ctx_size := LoadLibFunction(ADllHandle, EVP_CIPHER_impl_ctx_size_procname); + FuncLoadError := not assigned(EVP_CIPHER_impl_ctx_size); + if FuncLoadError then + begin + {$if not defined(EVP_CIPHER_impl_ctx_size_allownil)} + EVP_CIPHER_impl_ctx_size := @ERR_EVP_CIPHER_impl_ctx_size; + {$ifend} + {$if declared(EVP_CIPHER_impl_ctx_size_introduced)} + if LibVersion < EVP_CIPHER_impl_ctx_size_introduced then + begin + {$if declared(FC_EVP_CIPHER_impl_ctx_size)} + EVP_CIPHER_impl_ctx_size := @FC_EVP_CIPHER_impl_ctx_size; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_CIPHER_impl_ctx_size_removed)} + if EVP_CIPHER_impl_ctx_size_removed <= LibVersion then + begin + {$if declared(_EVP_CIPHER_impl_ctx_size)} + EVP_CIPHER_impl_ctx_size := @_EVP_CIPHER_impl_ctx_size; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_CIPHER_impl_ctx_size_allownil)} + if FuncLoadError then + AFailed.Add('EVP_CIPHER_impl_ctx_size'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_CIPHER_key_length := LoadLibFunction(ADllHandle, EVP_CIPHER_key_length_procname); + FuncLoadError := not assigned(EVP_CIPHER_key_length); + if FuncLoadError then + begin + {$if not defined(EVP_CIPHER_key_length_allownil)} + EVP_CIPHER_key_length := @ERR_EVP_CIPHER_key_length; + {$ifend} + {$if declared(EVP_CIPHER_key_length_introduced)} + if LibVersion < EVP_CIPHER_key_length_introduced then + begin + {$if declared(FC_EVP_CIPHER_key_length)} + EVP_CIPHER_key_length := @FC_EVP_CIPHER_key_length; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_CIPHER_key_length_removed)} + if EVP_CIPHER_key_length_removed <= LibVersion then + begin + {$if declared(_EVP_CIPHER_key_length)} + EVP_CIPHER_key_length := @_EVP_CIPHER_key_length; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_CIPHER_key_length_allownil)} + if FuncLoadError then + AFailed.Add('EVP_CIPHER_key_length'); + {$ifend} + end; + + + EVP_CIPHER_iv_length := LoadLibFunction(ADllHandle, EVP_CIPHER_iv_length_procname); + FuncLoadError := not assigned(EVP_CIPHER_iv_length); + if FuncLoadError then + begin + {$if not defined(EVP_CIPHER_iv_length_allownil)} + EVP_CIPHER_iv_length := @ERR_EVP_CIPHER_iv_length; + {$ifend} + {$if declared(EVP_CIPHER_iv_length_introduced)} + if LibVersion < EVP_CIPHER_iv_length_introduced then + begin + {$if declared(FC_EVP_CIPHER_iv_length)} + EVP_CIPHER_iv_length := @FC_EVP_CIPHER_iv_length; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_CIPHER_iv_length_removed)} + if EVP_CIPHER_iv_length_removed <= LibVersion then + begin + {$if declared(_EVP_CIPHER_iv_length)} + EVP_CIPHER_iv_length := @_EVP_CIPHER_iv_length; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_CIPHER_iv_length_allownil)} + if FuncLoadError then + AFailed.Add('EVP_CIPHER_iv_length'); + {$ifend} + end; + + + EVP_CIPHER_flags := LoadLibFunction(ADllHandle, EVP_CIPHER_flags_procname); + FuncLoadError := not assigned(EVP_CIPHER_flags); + if FuncLoadError then + begin + {$if not defined(EVP_CIPHER_flags_allownil)} + EVP_CIPHER_flags := @ERR_EVP_CIPHER_flags; + {$ifend} + {$if declared(EVP_CIPHER_flags_introduced)} + if LibVersion < EVP_CIPHER_flags_introduced then + begin + {$if declared(FC_EVP_CIPHER_flags)} + EVP_CIPHER_flags := @FC_EVP_CIPHER_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_CIPHER_flags_removed)} + if EVP_CIPHER_flags_removed <= LibVersion then + begin + {$if declared(_EVP_CIPHER_flags)} + EVP_CIPHER_flags := @_EVP_CIPHER_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_CIPHER_flags_allownil)} + if FuncLoadError then + AFailed.Add('EVP_CIPHER_flags'); + {$ifend} + end; + + + EVP_CIPHER_CTX_cipher := LoadLibFunction(ADllHandle, EVP_CIPHER_CTX_cipher_procname); + FuncLoadError := not assigned(EVP_CIPHER_CTX_cipher); + if FuncLoadError then + begin + {$if not defined(EVP_CIPHER_CTX_cipher_allownil)} + EVP_CIPHER_CTX_cipher := @ERR_EVP_CIPHER_CTX_cipher; + {$ifend} + {$if declared(EVP_CIPHER_CTX_cipher_introduced)} + if LibVersion < EVP_CIPHER_CTX_cipher_introduced then + begin + {$if declared(FC_EVP_CIPHER_CTX_cipher)} + EVP_CIPHER_CTX_cipher := @FC_EVP_CIPHER_CTX_cipher; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_CIPHER_CTX_cipher_removed)} + if EVP_CIPHER_CTX_cipher_removed <= LibVersion then + begin + {$if declared(_EVP_CIPHER_CTX_cipher)} + EVP_CIPHER_CTX_cipher := @_EVP_CIPHER_CTX_cipher; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_CIPHER_CTX_cipher_allownil)} + if FuncLoadError then + AFailed.Add('EVP_CIPHER_CTX_cipher'); + {$ifend} + end; + + + EVP_CIPHER_CTX_encrypting := LoadLibFunction(ADllHandle, EVP_CIPHER_CTX_encrypting_procname); + FuncLoadError := not assigned(EVP_CIPHER_CTX_encrypting); + if FuncLoadError then + begin + {$if not defined(EVP_CIPHER_CTX_encrypting_allownil)} + EVP_CIPHER_CTX_encrypting := @ERR_EVP_CIPHER_CTX_encrypting; + {$ifend} + {$if declared(EVP_CIPHER_CTX_encrypting_introduced)} + if LibVersion < EVP_CIPHER_CTX_encrypting_introduced then + begin + {$if declared(FC_EVP_CIPHER_CTX_encrypting)} + EVP_CIPHER_CTX_encrypting := @FC_EVP_CIPHER_CTX_encrypting; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_CIPHER_CTX_encrypting_removed)} + if EVP_CIPHER_CTX_encrypting_removed <= LibVersion then + begin + {$if declared(_EVP_CIPHER_CTX_encrypting)} + EVP_CIPHER_CTX_encrypting := @_EVP_CIPHER_CTX_encrypting; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_CIPHER_CTX_encrypting_allownil)} + if FuncLoadError then + AFailed.Add('EVP_CIPHER_CTX_encrypting'); + {$ifend} + end; + + + EVP_CIPHER_CTX_nid := LoadLibFunction(ADllHandle, EVP_CIPHER_CTX_nid_procname); + FuncLoadError := not assigned(EVP_CIPHER_CTX_nid); + if FuncLoadError then + begin + {$if not defined(EVP_CIPHER_CTX_nid_allownil)} + EVP_CIPHER_CTX_nid := @ERR_EVP_CIPHER_CTX_nid; + {$ifend} + {$if declared(EVP_CIPHER_CTX_nid_introduced)} + if LibVersion < EVP_CIPHER_CTX_nid_introduced then + begin + {$if declared(FC_EVP_CIPHER_CTX_nid)} + EVP_CIPHER_CTX_nid := @FC_EVP_CIPHER_CTX_nid; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_CIPHER_CTX_nid_removed)} + if EVP_CIPHER_CTX_nid_removed <= LibVersion then + begin + {$if declared(_EVP_CIPHER_CTX_nid)} + EVP_CIPHER_CTX_nid := @_EVP_CIPHER_CTX_nid; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_CIPHER_CTX_nid_allownil)} + if FuncLoadError then + AFailed.Add('EVP_CIPHER_CTX_nid'); + {$ifend} + end; + + + EVP_CIPHER_CTX_block_size := LoadLibFunction(ADllHandle, EVP_CIPHER_CTX_block_size_procname); + FuncLoadError := not assigned(EVP_CIPHER_CTX_block_size); + if FuncLoadError then + begin + {$if not defined(EVP_CIPHER_CTX_block_size_allownil)} + EVP_CIPHER_CTX_block_size := @ERR_EVP_CIPHER_CTX_block_size; + {$ifend} + {$if declared(EVP_CIPHER_CTX_block_size_introduced)} + if LibVersion < EVP_CIPHER_CTX_block_size_introduced then + begin + {$if declared(FC_EVP_CIPHER_CTX_block_size)} + EVP_CIPHER_CTX_block_size := @FC_EVP_CIPHER_CTX_block_size; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_CIPHER_CTX_block_size_removed)} + if EVP_CIPHER_CTX_block_size_removed <= LibVersion then + begin + {$if declared(_EVP_CIPHER_CTX_block_size)} + EVP_CIPHER_CTX_block_size := @_EVP_CIPHER_CTX_block_size; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_CIPHER_CTX_block_size_allownil)} + if FuncLoadError then + AFailed.Add('EVP_CIPHER_CTX_block_size'); + {$ifend} + end; + + + EVP_CIPHER_CTX_key_length := LoadLibFunction(ADllHandle, EVP_CIPHER_CTX_key_length_procname); + FuncLoadError := not assigned(EVP_CIPHER_CTX_key_length); + if FuncLoadError then + begin + {$if not defined(EVP_CIPHER_CTX_key_length_allownil)} + EVP_CIPHER_CTX_key_length := @ERR_EVP_CIPHER_CTX_key_length; + {$ifend} + {$if declared(EVP_CIPHER_CTX_key_length_introduced)} + if LibVersion < EVP_CIPHER_CTX_key_length_introduced then + begin + {$if declared(FC_EVP_CIPHER_CTX_key_length)} + EVP_CIPHER_CTX_key_length := @FC_EVP_CIPHER_CTX_key_length; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_CIPHER_CTX_key_length_removed)} + if EVP_CIPHER_CTX_key_length_removed <= LibVersion then + begin + {$if declared(_EVP_CIPHER_CTX_key_length)} + EVP_CIPHER_CTX_key_length := @_EVP_CIPHER_CTX_key_length; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_CIPHER_CTX_key_length_allownil)} + if FuncLoadError then + AFailed.Add('EVP_CIPHER_CTX_key_length'); + {$ifend} + end; + + + EVP_CIPHER_CTX_iv_length := LoadLibFunction(ADllHandle, EVP_CIPHER_CTX_iv_length_procname); + FuncLoadError := not assigned(EVP_CIPHER_CTX_iv_length); + if FuncLoadError then + begin + {$if not defined(EVP_CIPHER_CTX_iv_length_allownil)} + EVP_CIPHER_CTX_iv_length := @ERR_EVP_CIPHER_CTX_iv_length; + {$ifend} + {$if declared(EVP_CIPHER_CTX_iv_length_introduced)} + if LibVersion < EVP_CIPHER_CTX_iv_length_introduced then + begin + {$if declared(FC_EVP_CIPHER_CTX_iv_length)} + EVP_CIPHER_CTX_iv_length := @FC_EVP_CIPHER_CTX_iv_length; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_CIPHER_CTX_iv_length_removed)} + if EVP_CIPHER_CTX_iv_length_removed <= LibVersion then + begin + {$if declared(_EVP_CIPHER_CTX_iv_length)} + EVP_CIPHER_CTX_iv_length := @_EVP_CIPHER_CTX_iv_length; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_CIPHER_CTX_iv_length_allownil)} + if FuncLoadError then + AFailed.Add('EVP_CIPHER_CTX_iv_length'); + {$ifend} + end; + + + EVP_CIPHER_CTX_iv := LoadLibFunction(ADllHandle, EVP_CIPHER_CTX_iv_procname); + FuncLoadError := not assigned(EVP_CIPHER_CTX_iv); + if FuncLoadError then + begin + {$if not defined(EVP_CIPHER_CTX_iv_allownil)} + EVP_CIPHER_CTX_iv := @ERR_EVP_CIPHER_CTX_iv; + {$ifend} + {$if declared(EVP_CIPHER_CTX_iv_introduced)} + if LibVersion < EVP_CIPHER_CTX_iv_introduced then + begin + {$if declared(FC_EVP_CIPHER_CTX_iv)} + EVP_CIPHER_CTX_iv := @FC_EVP_CIPHER_CTX_iv; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_CIPHER_CTX_iv_removed)} + if EVP_CIPHER_CTX_iv_removed <= LibVersion then + begin + {$if declared(_EVP_CIPHER_CTX_iv)} + EVP_CIPHER_CTX_iv := @_EVP_CIPHER_CTX_iv; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_CIPHER_CTX_iv_allownil)} + if FuncLoadError then + AFailed.Add('EVP_CIPHER_CTX_iv'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_CIPHER_CTX_original_iv := LoadLibFunction(ADllHandle, EVP_CIPHER_CTX_original_iv_procname); + FuncLoadError := not assigned(EVP_CIPHER_CTX_original_iv); + if FuncLoadError then + begin + {$if not defined(EVP_CIPHER_CTX_original_iv_allownil)} + EVP_CIPHER_CTX_original_iv := @ERR_EVP_CIPHER_CTX_original_iv; + {$ifend} + {$if declared(EVP_CIPHER_CTX_original_iv_introduced)} + if LibVersion < EVP_CIPHER_CTX_original_iv_introduced then + begin + {$if declared(FC_EVP_CIPHER_CTX_original_iv)} + EVP_CIPHER_CTX_original_iv := @FC_EVP_CIPHER_CTX_original_iv; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_CIPHER_CTX_original_iv_removed)} + if EVP_CIPHER_CTX_original_iv_removed <= LibVersion then + begin + {$if declared(_EVP_CIPHER_CTX_original_iv)} + EVP_CIPHER_CTX_original_iv := @_EVP_CIPHER_CTX_original_iv; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_CIPHER_CTX_original_iv_allownil)} + if FuncLoadError then + AFailed.Add('EVP_CIPHER_CTX_original_iv'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_CIPHER_CTX_iv_noconst := LoadLibFunction(ADllHandle, EVP_CIPHER_CTX_iv_noconst_procname); + FuncLoadError := not assigned(EVP_CIPHER_CTX_iv_noconst); + if FuncLoadError then + begin + {$if not defined(EVP_CIPHER_CTX_iv_noconst_allownil)} + EVP_CIPHER_CTX_iv_noconst := @ERR_EVP_CIPHER_CTX_iv_noconst; + {$ifend} + {$if declared(EVP_CIPHER_CTX_iv_noconst_introduced)} + if LibVersion < EVP_CIPHER_CTX_iv_noconst_introduced then + begin + {$if declared(FC_EVP_CIPHER_CTX_iv_noconst)} + EVP_CIPHER_CTX_iv_noconst := @FC_EVP_CIPHER_CTX_iv_noconst; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_CIPHER_CTX_iv_noconst_removed)} + if EVP_CIPHER_CTX_iv_noconst_removed <= LibVersion then + begin + {$if declared(_EVP_CIPHER_CTX_iv_noconst)} + EVP_CIPHER_CTX_iv_noconst := @_EVP_CIPHER_CTX_iv_noconst; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_CIPHER_CTX_iv_noconst_allownil)} + if FuncLoadError then + AFailed.Add('EVP_CIPHER_CTX_iv_noconst'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_CIPHER_CTX_buf_noconst := LoadLibFunction(ADllHandle, EVP_CIPHER_CTX_buf_noconst_procname); + FuncLoadError := not assigned(EVP_CIPHER_CTX_buf_noconst); + if FuncLoadError then + begin + {$if not defined(EVP_CIPHER_CTX_buf_noconst_allownil)} + EVP_CIPHER_CTX_buf_noconst := @ERR_EVP_CIPHER_CTX_buf_noconst; + {$ifend} + {$if declared(EVP_CIPHER_CTX_buf_noconst_introduced)} + if LibVersion < EVP_CIPHER_CTX_buf_noconst_introduced then + begin + {$if declared(FC_EVP_CIPHER_CTX_buf_noconst)} + EVP_CIPHER_CTX_buf_noconst := @FC_EVP_CIPHER_CTX_buf_noconst; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_CIPHER_CTX_buf_noconst_removed)} + if EVP_CIPHER_CTX_buf_noconst_removed <= LibVersion then + begin + {$if declared(_EVP_CIPHER_CTX_buf_noconst)} + EVP_CIPHER_CTX_buf_noconst := @_EVP_CIPHER_CTX_buf_noconst; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_CIPHER_CTX_buf_noconst_allownil)} + if FuncLoadError then + AFailed.Add('EVP_CIPHER_CTX_buf_noconst'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_CIPHER_CTX_num := LoadLibFunction(ADllHandle, EVP_CIPHER_CTX_num_procname); + FuncLoadError := not assigned(EVP_CIPHER_CTX_num); + if FuncLoadError then + begin + {$if not defined(EVP_CIPHER_CTX_num_allownil)} + EVP_CIPHER_CTX_num := @ERR_EVP_CIPHER_CTX_num; + {$ifend} + {$if declared(EVP_CIPHER_CTX_num_introduced)} + if LibVersion < EVP_CIPHER_CTX_num_introduced then + begin + {$if declared(FC_EVP_CIPHER_CTX_num)} + EVP_CIPHER_CTX_num := @FC_EVP_CIPHER_CTX_num; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_CIPHER_CTX_num_removed)} + if EVP_CIPHER_CTX_num_removed <= LibVersion then + begin + {$if declared(_EVP_CIPHER_CTX_num)} + EVP_CIPHER_CTX_num := @_EVP_CIPHER_CTX_num; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_CIPHER_CTX_num_allownil)} + if FuncLoadError then + AFailed.Add('EVP_CIPHER_CTX_num'); + {$ifend} + end; + + + EVP_CIPHER_CTX_set_num := LoadLibFunction(ADllHandle, EVP_CIPHER_CTX_set_num_procname); + FuncLoadError := not assigned(EVP_CIPHER_CTX_set_num); + if FuncLoadError then + begin + {$if not defined(EVP_CIPHER_CTX_set_num_allownil)} + EVP_CIPHER_CTX_set_num := @ERR_EVP_CIPHER_CTX_set_num; + {$ifend} + {$if declared(EVP_CIPHER_CTX_set_num_introduced)} + if LibVersion < EVP_CIPHER_CTX_set_num_introduced then + begin + {$if declared(FC_EVP_CIPHER_CTX_set_num)} + EVP_CIPHER_CTX_set_num := @FC_EVP_CIPHER_CTX_set_num; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_CIPHER_CTX_set_num_removed)} + if EVP_CIPHER_CTX_set_num_removed <= LibVersion then + begin + {$if declared(_EVP_CIPHER_CTX_set_num)} + EVP_CIPHER_CTX_set_num := @_EVP_CIPHER_CTX_set_num; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_CIPHER_CTX_set_num_allownil)} + if FuncLoadError then + AFailed.Add('EVP_CIPHER_CTX_set_num'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_CIPHER_CTX_copy := LoadLibFunction(ADllHandle, EVP_CIPHER_CTX_copy_procname); + FuncLoadError := not assigned(EVP_CIPHER_CTX_copy); + if FuncLoadError then + begin + {$if not defined(EVP_CIPHER_CTX_copy_allownil)} + EVP_CIPHER_CTX_copy := @ERR_EVP_CIPHER_CTX_copy; + {$ifend} + {$if declared(EVP_CIPHER_CTX_copy_introduced)} + if LibVersion < EVP_CIPHER_CTX_copy_introduced then + begin + {$if declared(FC_EVP_CIPHER_CTX_copy)} + EVP_CIPHER_CTX_copy := @FC_EVP_CIPHER_CTX_copy; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_CIPHER_CTX_copy_removed)} + if EVP_CIPHER_CTX_copy_removed <= LibVersion then + begin + {$if declared(_EVP_CIPHER_CTX_copy)} + EVP_CIPHER_CTX_copy := @_EVP_CIPHER_CTX_copy; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_CIPHER_CTX_copy_allownil)} + if FuncLoadError then + AFailed.Add('EVP_CIPHER_CTX_copy'); + {$ifend} + end; + + + EVP_CIPHER_CTX_get_app_data := LoadLibFunction(ADllHandle, EVP_CIPHER_CTX_get_app_data_procname); + FuncLoadError := not assigned(EVP_CIPHER_CTX_get_app_data); + if FuncLoadError then + begin + {$if not defined(EVP_CIPHER_CTX_get_app_data_allownil)} + EVP_CIPHER_CTX_get_app_data := @ERR_EVP_CIPHER_CTX_get_app_data; + {$ifend} + {$if declared(EVP_CIPHER_CTX_get_app_data_introduced)} + if LibVersion < EVP_CIPHER_CTX_get_app_data_introduced then + begin + {$if declared(FC_EVP_CIPHER_CTX_get_app_data)} + EVP_CIPHER_CTX_get_app_data := @FC_EVP_CIPHER_CTX_get_app_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_CIPHER_CTX_get_app_data_removed)} + if EVP_CIPHER_CTX_get_app_data_removed <= LibVersion then + begin + {$if declared(_EVP_CIPHER_CTX_get_app_data)} + EVP_CIPHER_CTX_get_app_data := @_EVP_CIPHER_CTX_get_app_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_CIPHER_CTX_get_app_data_allownil)} + if FuncLoadError then + AFailed.Add('EVP_CIPHER_CTX_get_app_data'); + {$ifend} + end; + + + EVP_CIPHER_CTX_set_app_data := LoadLibFunction(ADllHandle, EVP_CIPHER_CTX_set_app_data_procname); + FuncLoadError := not assigned(EVP_CIPHER_CTX_set_app_data); + if FuncLoadError then + begin + {$if not defined(EVP_CIPHER_CTX_set_app_data_allownil)} + EVP_CIPHER_CTX_set_app_data := @ERR_EVP_CIPHER_CTX_set_app_data; + {$ifend} + {$if declared(EVP_CIPHER_CTX_set_app_data_introduced)} + if LibVersion < EVP_CIPHER_CTX_set_app_data_introduced then + begin + {$if declared(FC_EVP_CIPHER_CTX_set_app_data)} + EVP_CIPHER_CTX_set_app_data := @FC_EVP_CIPHER_CTX_set_app_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_CIPHER_CTX_set_app_data_removed)} + if EVP_CIPHER_CTX_set_app_data_removed <= LibVersion then + begin + {$if declared(_EVP_CIPHER_CTX_set_app_data)} + EVP_CIPHER_CTX_set_app_data := @_EVP_CIPHER_CTX_set_app_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_CIPHER_CTX_set_app_data_allownil)} + if FuncLoadError then + AFailed.Add('EVP_CIPHER_CTX_set_app_data'); + {$ifend} + end; + + + EVP_CIPHER_CTX_get_cipher_data := LoadLibFunction(ADllHandle, EVP_CIPHER_CTX_get_cipher_data_procname); + FuncLoadError := not assigned(EVP_CIPHER_CTX_get_cipher_data); + if FuncLoadError then + begin + {$if not defined(EVP_CIPHER_CTX_get_cipher_data_allownil)} + EVP_CIPHER_CTX_get_cipher_data := @ERR_EVP_CIPHER_CTX_get_cipher_data; + {$ifend} + {$if declared(EVP_CIPHER_CTX_get_cipher_data_introduced)} + if LibVersion < EVP_CIPHER_CTX_get_cipher_data_introduced then + begin + {$if declared(FC_EVP_CIPHER_CTX_get_cipher_data)} + EVP_CIPHER_CTX_get_cipher_data := @FC_EVP_CIPHER_CTX_get_cipher_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_CIPHER_CTX_get_cipher_data_removed)} + if EVP_CIPHER_CTX_get_cipher_data_removed <= LibVersion then + begin + {$if declared(_EVP_CIPHER_CTX_get_cipher_data)} + EVP_CIPHER_CTX_get_cipher_data := @_EVP_CIPHER_CTX_get_cipher_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_CIPHER_CTX_get_cipher_data_allownil)} + if FuncLoadError then + AFailed.Add('EVP_CIPHER_CTX_get_cipher_data'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_CIPHER_CTX_set_cipher_data := LoadLibFunction(ADllHandle, EVP_CIPHER_CTX_set_cipher_data_procname); + FuncLoadError := not assigned(EVP_CIPHER_CTX_set_cipher_data); + if FuncLoadError then + begin + {$if not defined(EVP_CIPHER_CTX_set_cipher_data_allownil)} + EVP_CIPHER_CTX_set_cipher_data := @ERR_EVP_CIPHER_CTX_set_cipher_data; + {$ifend} + {$if declared(EVP_CIPHER_CTX_set_cipher_data_introduced)} + if LibVersion < EVP_CIPHER_CTX_set_cipher_data_introduced then + begin + {$if declared(FC_EVP_CIPHER_CTX_set_cipher_data)} + EVP_CIPHER_CTX_set_cipher_data := @FC_EVP_CIPHER_CTX_set_cipher_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_CIPHER_CTX_set_cipher_data_removed)} + if EVP_CIPHER_CTX_set_cipher_data_removed <= LibVersion then + begin + {$if declared(_EVP_CIPHER_CTX_set_cipher_data)} + EVP_CIPHER_CTX_set_cipher_data := @_EVP_CIPHER_CTX_set_cipher_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_CIPHER_CTX_set_cipher_data_allownil)} + if FuncLoadError then + AFailed.Add('EVP_CIPHER_CTX_set_cipher_data'); + {$ifend} + end; + + {introduced 1.1.0} + BIO_set_md := LoadLibFunction(ADllHandle, BIO_set_md_procname); + FuncLoadError := not assigned(BIO_set_md); + if FuncLoadError then + begin + {$if not defined(BIO_set_md_allownil)} + BIO_set_md := @ERR_BIO_set_md; + {$ifend} + {$if declared(BIO_set_md_introduced)} + if LibVersion < BIO_set_md_introduced then + begin + {$if declared(FC_BIO_set_md)} + BIO_set_md := @FC_BIO_set_md; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_set_md_removed)} + if BIO_set_md_removed <= LibVersion then + begin + {$if declared(_BIO_set_md)} + BIO_set_md := @_BIO_set_md; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_set_md_allownil)} + if FuncLoadError then + AFailed.Add('BIO_set_md'); + {$ifend} + end; + + + EVP_MD_CTX_init := LoadLibFunction(ADllHandle, EVP_MD_CTX_init_procname); + FuncLoadError := not assigned(EVP_MD_CTX_init); + if FuncLoadError then + begin + {$if not defined(EVP_MD_CTX_init_allownil)} + EVP_MD_CTX_init := @ERR_EVP_MD_CTX_init; + {$ifend} + {$if declared(EVP_MD_CTX_init_introduced)} + if LibVersion < EVP_MD_CTX_init_introduced then + begin + {$if declared(FC_EVP_MD_CTX_init)} + EVP_MD_CTX_init := @FC_EVP_MD_CTX_init; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_MD_CTX_init_removed)} + if EVP_MD_CTX_init_removed <= LibVersion then + begin + {$if declared(_EVP_MD_CTX_init)} + EVP_MD_CTX_init := @_EVP_MD_CTX_init; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_MD_CTX_init_allownil)} + if FuncLoadError then + AFailed.Add('EVP_MD_CTX_init'); + {$ifend} + end; + + + EVP_MD_CTX_cleanup := LoadLibFunction(ADllHandle, EVP_MD_CTX_cleanup_procname); + FuncLoadError := not assigned(EVP_MD_CTX_cleanup); + if FuncLoadError then + begin + {$if not defined(EVP_MD_CTX_cleanup_allownil)} + EVP_MD_CTX_cleanup := @ERR_EVP_MD_CTX_cleanup; + {$ifend} + {$if declared(EVP_MD_CTX_cleanup_introduced)} + if LibVersion < EVP_MD_CTX_cleanup_introduced then + begin + {$if declared(FC_EVP_MD_CTX_cleanup)} + EVP_MD_CTX_cleanup := @FC_EVP_MD_CTX_cleanup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_MD_CTX_cleanup_removed)} + if EVP_MD_CTX_cleanup_removed <= LibVersion then + begin + {$if declared(_EVP_MD_CTX_cleanup)} + EVP_MD_CTX_cleanup := @_EVP_MD_CTX_cleanup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_MD_CTX_cleanup_allownil)} + if FuncLoadError then + AFailed.Add('EVP_MD_CTX_cleanup'); + {$ifend} + end; + + + EVP_MD_CTX_ctrl := LoadLibFunction(ADllHandle, EVP_MD_CTX_ctrl_procname); + FuncLoadError := not assigned(EVP_MD_CTX_ctrl); + if FuncLoadError then + begin + {$if not defined(EVP_MD_CTX_ctrl_allownil)} + EVP_MD_CTX_ctrl := @ERR_EVP_MD_CTX_ctrl; + {$ifend} + {$if declared(EVP_MD_CTX_ctrl_introduced)} + if LibVersion < EVP_MD_CTX_ctrl_introduced then + begin + {$if declared(FC_EVP_MD_CTX_ctrl)} + EVP_MD_CTX_ctrl := @FC_EVP_MD_CTX_ctrl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_MD_CTX_ctrl_removed)} + if EVP_MD_CTX_ctrl_removed <= LibVersion then + begin + {$if declared(_EVP_MD_CTX_ctrl)} + EVP_MD_CTX_ctrl := @_EVP_MD_CTX_ctrl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_MD_CTX_ctrl_allownil)} + if FuncLoadError then + AFailed.Add('EVP_MD_CTX_ctrl'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_MD_CTX_new := LoadLibFunction(ADllHandle, EVP_MD_CTX_new_procname); + FuncLoadError := not assigned(EVP_MD_CTX_new); + if FuncLoadError then + begin + {$if not defined(EVP_MD_CTX_new_allownil)} + EVP_MD_CTX_new := @ERR_EVP_MD_CTX_new; + {$ifend} + {$if declared(EVP_MD_CTX_new_introduced)} + if LibVersion < EVP_MD_CTX_new_introduced then + begin + {$if declared(FC_EVP_MD_CTX_new)} + EVP_MD_CTX_new := @FC_EVP_MD_CTX_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_MD_CTX_new_removed)} + if EVP_MD_CTX_new_removed <= LibVersion then + begin + {$if declared(_EVP_MD_CTX_new)} + EVP_MD_CTX_new := @_EVP_MD_CTX_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_MD_CTX_new_allownil)} + if FuncLoadError then + AFailed.Add('EVP_MD_CTX_new'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_MD_CTX_reset := LoadLibFunction(ADllHandle, EVP_MD_CTX_reset_procname); + FuncLoadError := not assigned(EVP_MD_CTX_reset); + if FuncLoadError then + begin + {$if not defined(EVP_MD_CTX_reset_allownil)} + EVP_MD_CTX_reset := @ERR_EVP_MD_CTX_reset; + {$ifend} + {$if declared(EVP_MD_CTX_reset_introduced)} + if LibVersion < EVP_MD_CTX_reset_introduced then + begin + {$if declared(FC_EVP_MD_CTX_reset)} + EVP_MD_CTX_reset := @FC_EVP_MD_CTX_reset; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_MD_CTX_reset_removed)} + if EVP_MD_CTX_reset_removed <= LibVersion then + begin + {$if declared(_EVP_MD_CTX_reset)} + EVP_MD_CTX_reset := @_EVP_MD_CTX_reset; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_MD_CTX_reset_allownil)} + if FuncLoadError then + AFailed.Add('EVP_MD_CTX_reset'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_MD_CTX_free := LoadLibFunction(ADllHandle, EVP_MD_CTX_free_procname); + FuncLoadError := not assigned(EVP_MD_CTX_free); + if FuncLoadError then + begin + {$if not defined(EVP_MD_CTX_free_allownil)} + EVP_MD_CTX_free := @ERR_EVP_MD_CTX_free; + {$ifend} + {$if declared(EVP_MD_CTX_free_introduced)} + if LibVersion < EVP_MD_CTX_free_introduced then + begin + {$if declared(FC_EVP_MD_CTX_free)} + EVP_MD_CTX_free := @FC_EVP_MD_CTX_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_MD_CTX_free_removed)} + if EVP_MD_CTX_free_removed <= LibVersion then + begin + {$if declared(_EVP_MD_CTX_free)} + EVP_MD_CTX_free := @_EVP_MD_CTX_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_MD_CTX_free_allownil)} + if FuncLoadError then + AFailed.Add('EVP_MD_CTX_free'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_MD_CTX_copy_ex := LoadLibFunction(ADllHandle, EVP_MD_CTX_copy_ex_procname); + FuncLoadError := not assigned(EVP_MD_CTX_copy_ex); + if FuncLoadError then + begin + {$if not defined(EVP_MD_CTX_copy_ex_allownil)} + EVP_MD_CTX_copy_ex := @ERR_EVP_MD_CTX_copy_ex; + {$ifend} + {$if declared(EVP_MD_CTX_copy_ex_introduced)} + if LibVersion < EVP_MD_CTX_copy_ex_introduced then + begin + {$if declared(FC_EVP_MD_CTX_copy_ex)} + EVP_MD_CTX_copy_ex := @FC_EVP_MD_CTX_copy_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_MD_CTX_copy_ex_removed)} + if EVP_MD_CTX_copy_ex_removed <= LibVersion then + begin + {$if declared(_EVP_MD_CTX_copy_ex)} + EVP_MD_CTX_copy_ex := @_EVP_MD_CTX_copy_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_MD_CTX_copy_ex_allownil)} + if FuncLoadError then + AFailed.Add('EVP_MD_CTX_copy_ex'); + {$ifend} + end; + + + EVP_MD_CTX_set_flags := LoadLibFunction(ADllHandle, EVP_MD_CTX_set_flags_procname); + FuncLoadError := not assigned(EVP_MD_CTX_set_flags); + if FuncLoadError then + begin + {$if not defined(EVP_MD_CTX_set_flags_allownil)} + EVP_MD_CTX_set_flags := @ERR_EVP_MD_CTX_set_flags; + {$ifend} + {$if declared(EVP_MD_CTX_set_flags_introduced)} + if LibVersion < EVP_MD_CTX_set_flags_introduced then + begin + {$if declared(FC_EVP_MD_CTX_set_flags)} + EVP_MD_CTX_set_flags := @FC_EVP_MD_CTX_set_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_MD_CTX_set_flags_removed)} + if EVP_MD_CTX_set_flags_removed <= LibVersion then + begin + {$if declared(_EVP_MD_CTX_set_flags)} + EVP_MD_CTX_set_flags := @_EVP_MD_CTX_set_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_MD_CTX_set_flags_allownil)} + if FuncLoadError then + AFailed.Add('EVP_MD_CTX_set_flags'); + {$ifend} + end; + + + EVP_MD_CTX_clear_flags := LoadLibFunction(ADllHandle, EVP_MD_CTX_clear_flags_procname); + FuncLoadError := not assigned(EVP_MD_CTX_clear_flags); + if FuncLoadError then + begin + {$if not defined(EVP_MD_CTX_clear_flags_allownil)} + EVP_MD_CTX_clear_flags := @ERR_EVP_MD_CTX_clear_flags; + {$ifend} + {$if declared(EVP_MD_CTX_clear_flags_introduced)} + if LibVersion < EVP_MD_CTX_clear_flags_introduced then + begin + {$if declared(FC_EVP_MD_CTX_clear_flags)} + EVP_MD_CTX_clear_flags := @FC_EVP_MD_CTX_clear_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_MD_CTX_clear_flags_removed)} + if EVP_MD_CTX_clear_flags_removed <= LibVersion then + begin + {$if declared(_EVP_MD_CTX_clear_flags)} + EVP_MD_CTX_clear_flags := @_EVP_MD_CTX_clear_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_MD_CTX_clear_flags_allownil)} + if FuncLoadError then + AFailed.Add('EVP_MD_CTX_clear_flags'); + {$ifend} + end; + + + EVP_MD_CTX_test_flags := LoadLibFunction(ADllHandle, EVP_MD_CTX_test_flags_procname); + FuncLoadError := not assigned(EVP_MD_CTX_test_flags); + if FuncLoadError then + begin + {$if not defined(EVP_MD_CTX_test_flags_allownil)} + EVP_MD_CTX_test_flags := @ERR_EVP_MD_CTX_test_flags; + {$ifend} + {$if declared(EVP_MD_CTX_test_flags_introduced)} + if LibVersion < EVP_MD_CTX_test_flags_introduced then + begin + {$if declared(FC_EVP_MD_CTX_test_flags)} + EVP_MD_CTX_test_flags := @FC_EVP_MD_CTX_test_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_MD_CTX_test_flags_removed)} + if EVP_MD_CTX_test_flags_removed <= LibVersion then + begin + {$if declared(_EVP_MD_CTX_test_flags)} + EVP_MD_CTX_test_flags := @_EVP_MD_CTX_test_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_MD_CTX_test_flags_allownil)} + if FuncLoadError then + AFailed.Add('EVP_MD_CTX_test_flags'); + {$ifend} + end; + + + EVP_DigestInit_ex := LoadLibFunction(ADllHandle, EVP_DigestInit_ex_procname); + FuncLoadError := not assigned(EVP_DigestInit_ex); + if FuncLoadError then + begin + {$if not defined(EVP_DigestInit_ex_allownil)} + EVP_DigestInit_ex := @ERR_EVP_DigestInit_ex; + {$ifend} + {$if declared(EVP_DigestInit_ex_introduced)} + if LibVersion < EVP_DigestInit_ex_introduced then + begin + {$if declared(FC_EVP_DigestInit_ex)} + EVP_DigestInit_ex := @FC_EVP_DigestInit_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_DigestInit_ex_removed)} + if EVP_DigestInit_ex_removed <= LibVersion then + begin + {$if declared(_EVP_DigestInit_ex)} + EVP_DigestInit_ex := @_EVP_DigestInit_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_DigestInit_ex_allownil)} + if FuncLoadError then + AFailed.Add('EVP_DigestInit_ex'); + {$ifend} + end; + + + EVP_DigestUpdate := LoadLibFunction(ADllHandle, EVP_DigestUpdate_procname); + FuncLoadError := not assigned(EVP_DigestUpdate); + if FuncLoadError then + begin + {$if not defined(EVP_DigestUpdate_allownil)} + EVP_DigestUpdate := @ERR_EVP_DigestUpdate; + {$ifend} + {$if declared(EVP_DigestUpdate_introduced)} + if LibVersion < EVP_DigestUpdate_introduced then + begin + {$if declared(FC_EVP_DigestUpdate)} + EVP_DigestUpdate := @FC_EVP_DigestUpdate; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_DigestUpdate_removed)} + if EVP_DigestUpdate_removed <= LibVersion then + begin + {$if declared(_EVP_DigestUpdate)} + EVP_DigestUpdate := @_EVP_DigestUpdate; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_DigestUpdate_allownil)} + if FuncLoadError then + AFailed.Add('EVP_DigestUpdate'); + {$ifend} + end; + + + EVP_DigestFinal_ex := LoadLibFunction(ADllHandle, EVP_DigestFinal_ex_procname); + FuncLoadError := not assigned(EVP_DigestFinal_ex); + if FuncLoadError then + begin + {$if not defined(EVP_DigestFinal_ex_allownil)} + EVP_DigestFinal_ex := @ERR_EVP_DigestFinal_ex; + {$ifend} + {$if declared(EVP_DigestFinal_ex_introduced)} + if LibVersion < EVP_DigestFinal_ex_introduced then + begin + {$if declared(FC_EVP_DigestFinal_ex)} + EVP_DigestFinal_ex := @FC_EVP_DigestFinal_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_DigestFinal_ex_removed)} + if EVP_DigestFinal_ex_removed <= LibVersion then + begin + {$if declared(_EVP_DigestFinal_ex)} + EVP_DigestFinal_ex := @_EVP_DigestFinal_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_DigestFinal_ex_allownil)} + if FuncLoadError then + AFailed.Add('EVP_DigestFinal_ex'); + {$ifend} + end; + + + EVP_Digest := LoadLibFunction(ADllHandle, EVP_Digest_procname); + FuncLoadError := not assigned(EVP_Digest); + if FuncLoadError then + begin + {$if not defined(EVP_Digest_allownil)} + EVP_Digest := @ERR_EVP_Digest; + {$ifend} + {$if declared(EVP_Digest_introduced)} + if LibVersion < EVP_Digest_introduced then + begin + {$if declared(FC_EVP_Digest)} + EVP_Digest := @FC_EVP_Digest; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_Digest_removed)} + if EVP_Digest_removed <= LibVersion then + begin + {$if declared(_EVP_Digest)} + EVP_Digest := @_EVP_Digest; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_Digest_allownil)} + if FuncLoadError then + AFailed.Add('EVP_Digest'); + {$ifend} + end; + + + EVP_MD_CTX_copy := LoadLibFunction(ADllHandle, EVP_MD_CTX_copy_procname); + FuncLoadError := not assigned(EVP_MD_CTX_copy); + if FuncLoadError then + begin + {$if not defined(EVP_MD_CTX_copy_allownil)} + EVP_MD_CTX_copy := @ERR_EVP_MD_CTX_copy; + {$ifend} + {$if declared(EVP_MD_CTX_copy_introduced)} + if LibVersion < EVP_MD_CTX_copy_introduced then + begin + {$if declared(FC_EVP_MD_CTX_copy)} + EVP_MD_CTX_copy := @FC_EVP_MD_CTX_copy; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_MD_CTX_copy_removed)} + if EVP_MD_CTX_copy_removed <= LibVersion then + begin + {$if declared(_EVP_MD_CTX_copy)} + EVP_MD_CTX_copy := @_EVP_MD_CTX_copy; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_MD_CTX_copy_allownil)} + if FuncLoadError then + AFailed.Add('EVP_MD_CTX_copy'); + {$ifend} + end; + + + EVP_DigestInit := LoadLibFunction(ADllHandle, EVP_DigestInit_procname); + FuncLoadError := not assigned(EVP_DigestInit); + if FuncLoadError then + begin + {$if not defined(EVP_DigestInit_allownil)} + EVP_DigestInit := @ERR_EVP_DigestInit; + {$ifend} + {$if declared(EVP_DigestInit_introduced)} + if LibVersion < EVP_DigestInit_introduced then + begin + {$if declared(FC_EVP_DigestInit)} + EVP_DigestInit := @FC_EVP_DigestInit; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_DigestInit_removed)} + if EVP_DigestInit_removed <= LibVersion then + begin + {$if declared(_EVP_DigestInit)} + EVP_DigestInit := @_EVP_DigestInit; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_DigestInit_allownil)} + if FuncLoadError then + AFailed.Add('EVP_DigestInit'); + {$ifend} + end; + + + EVP_DigestFinal := LoadLibFunction(ADllHandle, EVP_DigestFinal_procname); + FuncLoadError := not assigned(EVP_DigestFinal); + if FuncLoadError then + begin + {$if not defined(EVP_DigestFinal_allownil)} + EVP_DigestFinal := @ERR_EVP_DigestFinal; + {$ifend} + {$if declared(EVP_DigestFinal_introduced)} + if LibVersion < EVP_DigestFinal_introduced then + begin + {$if declared(FC_EVP_DigestFinal)} + EVP_DigestFinal := @FC_EVP_DigestFinal; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_DigestFinal_removed)} + if EVP_DigestFinal_removed <= LibVersion then + begin + {$if declared(_EVP_DigestFinal)} + EVP_DigestFinal := @_EVP_DigestFinal; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_DigestFinal_allownil)} + if FuncLoadError then + AFailed.Add('EVP_DigestFinal'); + {$ifend} + end; + + + EVP_DigestFinalXOF := LoadLibFunction(ADllHandle, EVP_DigestFinalXOF_procname); + FuncLoadError := not assigned(EVP_DigestFinalXOF); + if FuncLoadError then + begin + {$if not defined(EVP_DigestFinalXOF_allownil)} + EVP_DigestFinalXOF := @ERR_EVP_DigestFinalXOF; + {$ifend} + {$if declared(EVP_DigestFinalXOF_introduced)} + if LibVersion < EVP_DigestFinalXOF_introduced then + begin + {$if declared(FC_EVP_DigestFinalXOF)} + EVP_DigestFinalXOF := @FC_EVP_DigestFinalXOF; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_DigestFinalXOF_removed)} + if EVP_DigestFinalXOF_removed <= LibVersion then + begin + {$if declared(_EVP_DigestFinalXOF)} + EVP_DigestFinalXOF := @_EVP_DigestFinalXOF; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_DigestFinalXOF_allownil)} + if FuncLoadError then + AFailed.Add('EVP_DigestFinalXOF'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_read_pw_string := LoadLibFunction(ADllHandle, EVP_read_pw_string_procname); + FuncLoadError := not assigned(EVP_read_pw_string); + if FuncLoadError then + begin + {$if not defined(EVP_read_pw_string_allownil)} + EVP_read_pw_string := @ERR_EVP_read_pw_string; + {$ifend} + {$if declared(EVP_read_pw_string_introduced)} + if LibVersion < EVP_read_pw_string_introduced then + begin + {$if declared(FC_EVP_read_pw_string)} + EVP_read_pw_string := @FC_EVP_read_pw_string; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_read_pw_string_removed)} + if EVP_read_pw_string_removed <= LibVersion then + begin + {$if declared(_EVP_read_pw_string)} + EVP_read_pw_string := @_EVP_read_pw_string; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_read_pw_string_allownil)} + if FuncLoadError then + AFailed.Add('EVP_read_pw_string'); + {$ifend} + end; + + + EVP_read_pw_string_min := LoadLibFunction(ADllHandle, EVP_read_pw_string_min_procname); + FuncLoadError := not assigned(EVP_read_pw_string_min); + if FuncLoadError then + begin + {$if not defined(EVP_read_pw_string_min_allownil)} + EVP_read_pw_string_min := @ERR_EVP_read_pw_string_min; + {$ifend} + {$if declared(EVP_read_pw_string_min_introduced)} + if LibVersion < EVP_read_pw_string_min_introduced then + begin + {$if declared(FC_EVP_read_pw_string_min)} + EVP_read_pw_string_min := @FC_EVP_read_pw_string_min; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_read_pw_string_min_removed)} + if EVP_read_pw_string_min_removed <= LibVersion then + begin + {$if declared(_EVP_read_pw_string_min)} + EVP_read_pw_string_min := @_EVP_read_pw_string_min; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_read_pw_string_min_allownil)} + if FuncLoadError then + AFailed.Add('EVP_read_pw_string_min'); + {$ifend} + end; + + + EVP_set_pw_prompt := LoadLibFunction(ADllHandle, EVP_set_pw_prompt_procname); + FuncLoadError := not assigned(EVP_set_pw_prompt); + if FuncLoadError then + begin + {$if not defined(EVP_set_pw_prompt_allownil)} + EVP_set_pw_prompt := @ERR_EVP_set_pw_prompt; + {$ifend} + {$if declared(EVP_set_pw_prompt_introduced)} + if LibVersion < EVP_set_pw_prompt_introduced then + begin + {$if declared(FC_EVP_set_pw_prompt)} + EVP_set_pw_prompt := @FC_EVP_set_pw_prompt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_set_pw_prompt_removed)} + if EVP_set_pw_prompt_removed <= LibVersion then + begin + {$if declared(_EVP_set_pw_prompt)} + EVP_set_pw_prompt := @_EVP_set_pw_prompt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_set_pw_prompt_allownil)} + if FuncLoadError then + AFailed.Add('EVP_set_pw_prompt'); + {$ifend} + end; + + + EVP_get_pw_prompt := LoadLibFunction(ADllHandle, EVP_get_pw_prompt_procname); + FuncLoadError := not assigned(EVP_get_pw_prompt); + if FuncLoadError then + begin + {$if not defined(EVP_get_pw_prompt_allownil)} + EVP_get_pw_prompt := @ERR_EVP_get_pw_prompt; + {$ifend} + {$if declared(EVP_get_pw_prompt_introduced)} + if LibVersion < EVP_get_pw_prompt_introduced then + begin + {$if declared(FC_EVP_get_pw_prompt)} + EVP_get_pw_prompt := @FC_EVP_get_pw_prompt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_get_pw_prompt_removed)} + if EVP_get_pw_prompt_removed <= LibVersion then + begin + {$if declared(_EVP_get_pw_prompt)} + EVP_get_pw_prompt := @_EVP_get_pw_prompt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_get_pw_prompt_allownil)} + if FuncLoadError then + AFailed.Add('EVP_get_pw_prompt'); + {$ifend} + end; + + + EVP_BytesToKey := LoadLibFunction(ADllHandle, EVP_BytesToKey_procname); + FuncLoadError := not assigned(EVP_BytesToKey); + if FuncLoadError then + begin + {$if not defined(EVP_BytesToKey_allownil)} + EVP_BytesToKey := @ERR_EVP_BytesToKey; + {$ifend} + {$if declared(EVP_BytesToKey_introduced)} + if LibVersion < EVP_BytesToKey_introduced then + begin + {$if declared(FC_EVP_BytesToKey)} + EVP_BytesToKey := @FC_EVP_BytesToKey; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_BytesToKey_removed)} + if EVP_BytesToKey_removed <= LibVersion then + begin + {$if declared(_EVP_BytesToKey)} + EVP_BytesToKey := @_EVP_BytesToKey; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_BytesToKey_allownil)} + if FuncLoadError then + AFailed.Add('EVP_BytesToKey'); + {$ifend} + end; + + + EVP_CIPHER_CTX_set_flags := LoadLibFunction(ADllHandle, EVP_CIPHER_CTX_set_flags_procname); + FuncLoadError := not assigned(EVP_CIPHER_CTX_set_flags); + if FuncLoadError then + begin + {$if not defined(EVP_CIPHER_CTX_set_flags_allownil)} + EVP_CIPHER_CTX_set_flags := @ERR_EVP_CIPHER_CTX_set_flags; + {$ifend} + {$if declared(EVP_CIPHER_CTX_set_flags_introduced)} + if LibVersion < EVP_CIPHER_CTX_set_flags_introduced then + begin + {$if declared(FC_EVP_CIPHER_CTX_set_flags)} + EVP_CIPHER_CTX_set_flags := @FC_EVP_CIPHER_CTX_set_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_CIPHER_CTX_set_flags_removed)} + if EVP_CIPHER_CTX_set_flags_removed <= LibVersion then + begin + {$if declared(_EVP_CIPHER_CTX_set_flags)} + EVP_CIPHER_CTX_set_flags := @_EVP_CIPHER_CTX_set_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_CIPHER_CTX_set_flags_allownil)} + if FuncLoadError then + AFailed.Add('EVP_CIPHER_CTX_set_flags'); + {$ifend} + end; + + + EVP_CIPHER_CTX_clear_flags := LoadLibFunction(ADllHandle, EVP_CIPHER_CTX_clear_flags_procname); + FuncLoadError := not assigned(EVP_CIPHER_CTX_clear_flags); + if FuncLoadError then + begin + {$if not defined(EVP_CIPHER_CTX_clear_flags_allownil)} + EVP_CIPHER_CTX_clear_flags := @ERR_EVP_CIPHER_CTX_clear_flags; + {$ifend} + {$if declared(EVP_CIPHER_CTX_clear_flags_introduced)} + if LibVersion < EVP_CIPHER_CTX_clear_flags_introduced then + begin + {$if declared(FC_EVP_CIPHER_CTX_clear_flags)} + EVP_CIPHER_CTX_clear_flags := @FC_EVP_CIPHER_CTX_clear_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_CIPHER_CTX_clear_flags_removed)} + if EVP_CIPHER_CTX_clear_flags_removed <= LibVersion then + begin + {$if declared(_EVP_CIPHER_CTX_clear_flags)} + EVP_CIPHER_CTX_clear_flags := @_EVP_CIPHER_CTX_clear_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_CIPHER_CTX_clear_flags_allownil)} + if FuncLoadError then + AFailed.Add('EVP_CIPHER_CTX_clear_flags'); + {$ifend} + end; + + + EVP_CIPHER_CTX_test_flags := LoadLibFunction(ADllHandle, EVP_CIPHER_CTX_test_flags_procname); + FuncLoadError := not assigned(EVP_CIPHER_CTX_test_flags); + if FuncLoadError then + begin + {$if not defined(EVP_CIPHER_CTX_test_flags_allownil)} + EVP_CIPHER_CTX_test_flags := @ERR_EVP_CIPHER_CTX_test_flags; + {$ifend} + {$if declared(EVP_CIPHER_CTX_test_flags_introduced)} + if LibVersion < EVP_CIPHER_CTX_test_flags_introduced then + begin + {$if declared(FC_EVP_CIPHER_CTX_test_flags)} + EVP_CIPHER_CTX_test_flags := @FC_EVP_CIPHER_CTX_test_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_CIPHER_CTX_test_flags_removed)} + if EVP_CIPHER_CTX_test_flags_removed <= LibVersion then + begin + {$if declared(_EVP_CIPHER_CTX_test_flags)} + EVP_CIPHER_CTX_test_flags := @_EVP_CIPHER_CTX_test_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_CIPHER_CTX_test_flags_allownil)} + if FuncLoadError then + AFailed.Add('EVP_CIPHER_CTX_test_flags'); + {$ifend} + end; + + + EVP_EncryptInit := LoadLibFunction(ADllHandle, EVP_EncryptInit_procname); + FuncLoadError := not assigned(EVP_EncryptInit); + if FuncLoadError then + begin + {$if not defined(EVP_EncryptInit_allownil)} + EVP_EncryptInit := @ERR_EVP_EncryptInit; + {$ifend} + {$if declared(EVP_EncryptInit_introduced)} + if LibVersion < EVP_EncryptInit_introduced then + begin + {$if declared(FC_EVP_EncryptInit)} + EVP_EncryptInit := @FC_EVP_EncryptInit; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_EncryptInit_removed)} + if EVP_EncryptInit_removed <= LibVersion then + begin + {$if declared(_EVP_EncryptInit)} + EVP_EncryptInit := @_EVP_EncryptInit; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_EncryptInit_allownil)} + if FuncLoadError then + AFailed.Add('EVP_EncryptInit'); + {$ifend} + end; + + + EVP_EncryptInit_ex := LoadLibFunction(ADllHandle, EVP_EncryptInit_ex_procname); + FuncLoadError := not assigned(EVP_EncryptInit_ex); + if FuncLoadError then + begin + {$if not defined(EVP_EncryptInit_ex_allownil)} + EVP_EncryptInit_ex := @ERR_EVP_EncryptInit_ex; + {$ifend} + {$if declared(EVP_EncryptInit_ex_introduced)} + if LibVersion < EVP_EncryptInit_ex_introduced then + begin + {$if declared(FC_EVP_EncryptInit_ex)} + EVP_EncryptInit_ex := @FC_EVP_EncryptInit_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_EncryptInit_ex_removed)} + if EVP_EncryptInit_ex_removed <= LibVersion then + begin + {$if declared(_EVP_EncryptInit_ex)} + EVP_EncryptInit_ex := @_EVP_EncryptInit_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_EncryptInit_ex_allownil)} + if FuncLoadError then + AFailed.Add('EVP_EncryptInit_ex'); + {$ifend} + end; + + + EVP_EncryptUpdate := LoadLibFunction(ADllHandle, EVP_EncryptUpdate_procname); + FuncLoadError := not assigned(EVP_EncryptUpdate); + if FuncLoadError then + begin + {$if not defined(EVP_EncryptUpdate_allownil)} + EVP_EncryptUpdate := @ERR_EVP_EncryptUpdate; + {$ifend} + {$if declared(EVP_EncryptUpdate_introduced)} + if LibVersion < EVP_EncryptUpdate_introduced then + begin + {$if declared(FC_EVP_EncryptUpdate)} + EVP_EncryptUpdate := @FC_EVP_EncryptUpdate; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_EncryptUpdate_removed)} + if EVP_EncryptUpdate_removed <= LibVersion then + begin + {$if declared(_EVP_EncryptUpdate)} + EVP_EncryptUpdate := @_EVP_EncryptUpdate; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_EncryptUpdate_allownil)} + if FuncLoadError then + AFailed.Add('EVP_EncryptUpdate'); + {$ifend} + end; + + + EVP_EncryptFinal_ex := LoadLibFunction(ADllHandle, EVP_EncryptFinal_ex_procname); + FuncLoadError := not assigned(EVP_EncryptFinal_ex); + if FuncLoadError then + begin + {$if not defined(EVP_EncryptFinal_ex_allownil)} + EVP_EncryptFinal_ex := @ERR_EVP_EncryptFinal_ex; + {$ifend} + {$if declared(EVP_EncryptFinal_ex_introduced)} + if LibVersion < EVP_EncryptFinal_ex_introduced then + begin + {$if declared(FC_EVP_EncryptFinal_ex)} + EVP_EncryptFinal_ex := @FC_EVP_EncryptFinal_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_EncryptFinal_ex_removed)} + if EVP_EncryptFinal_ex_removed <= LibVersion then + begin + {$if declared(_EVP_EncryptFinal_ex)} + EVP_EncryptFinal_ex := @_EVP_EncryptFinal_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_EncryptFinal_ex_allownil)} + if FuncLoadError then + AFailed.Add('EVP_EncryptFinal_ex'); + {$ifend} + end; + + + EVP_EncryptFinal := LoadLibFunction(ADllHandle, EVP_EncryptFinal_procname); + FuncLoadError := not assigned(EVP_EncryptFinal); + if FuncLoadError then + begin + {$if not defined(EVP_EncryptFinal_allownil)} + EVP_EncryptFinal := @ERR_EVP_EncryptFinal; + {$ifend} + {$if declared(EVP_EncryptFinal_introduced)} + if LibVersion < EVP_EncryptFinal_introduced then + begin + {$if declared(FC_EVP_EncryptFinal)} + EVP_EncryptFinal := @FC_EVP_EncryptFinal; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_EncryptFinal_removed)} + if EVP_EncryptFinal_removed <= LibVersion then + begin + {$if declared(_EVP_EncryptFinal)} + EVP_EncryptFinal := @_EVP_EncryptFinal; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_EncryptFinal_allownil)} + if FuncLoadError then + AFailed.Add('EVP_EncryptFinal'); + {$ifend} + end; + + + EVP_DecryptInit := LoadLibFunction(ADllHandle, EVP_DecryptInit_procname); + FuncLoadError := not assigned(EVP_DecryptInit); + if FuncLoadError then + begin + {$if not defined(EVP_DecryptInit_allownil)} + EVP_DecryptInit := @ERR_EVP_DecryptInit; + {$ifend} + {$if declared(EVP_DecryptInit_introduced)} + if LibVersion < EVP_DecryptInit_introduced then + begin + {$if declared(FC_EVP_DecryptInit)} + EVP_DecryptInit := @FC_EVP_DecryptInit; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_DecryptInit_removed)} + if EVP_DecryptInit_removed <= LibVersion then + begin + {$if declared(_EVP_DecryptInit)} + EVP_DecryptInit := @_EVP_DecryptInit; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_DecryptInit_allownil)} + if FuncLoadError then + AFailed.Add('EVP_DecryptInit'); + {$ifend} + end; + + + EVP_DecryptInit_ex := LoadLibFunction(ADllHandle, EVP_DecryptInit_ex_procname); + FuncLoadError := not assigned(EVP_DecryptInit_ex); + if FuncLoadError then + begin + {$if not defined(EVP_DecryptInit_ex_allownil)} + EVP_DecryptInit_ex := @ERR_EVP_DecryptInit_ex; + {$ifend} + {$if declared(EVP_DecryptInit_ex_introduced)} + if LibVersion < EVP_DecryptInit_ex_introduced then + begin + {$if declared(FC_EVP_DecryptInit_ex)} + EVP_DecryptInit_ex := @FC_EVP_DecryptInit_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_DecryptInit_ex_removed)} + if EVP_DecryptInit_ex_removed <= LibVersion then + begin + {$if declared(_EVP_DecryptInit_ex)} + EVP_DecryptInit_ex := @_EVP_DecryptInit_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_DecryptInit_ex_allownil)} + if FuncLoadError then + AFailed.Add('EVP_DecryptInit_ex'); + {$ifend} + end; + + + EVP_DecryptUpdate := LoadLibFunction(ADllHandle, EVP_DecryptUpdate_procname); + FuncLoadError := not assigned(EVP_DecryptUpdate); + if FuncLoadError then + begin + {$if not defined(EVP_DecryptUpdate_allownil)} + EVP_DecryptUpdate := @ERR_EVP_DecryptUpdate; + {$ifend} + {$if declared(EVP_DecryptUpdate_introduced)} + if LibVersion < EVP_DecryptUpdate_introduced then + begin + {$if declared(FC_EVP_DecryptUpdate)} + EVP_DecryptUpdate := @FC_EVP_DecryptUpdate; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_DecryptUpdate_removed)} + if EVP_DecryptUpdate_removed <= LibVersion then + begin + {$if declared(_EVP_DecryptUpdate)} + EVP_DecryptUpdate := @_EVP_DecryptUpdate; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_DecryptUpdate_allownil)} + if FuncLoadError then + AFailed.Add('EVP_DecryptUpdate'); + {$ifend} + end; + + + EVP_DecryptFinal := LoadLibFunction(ADllHandle, EVP_DecryptFinal_procname); + FuncLoadError := not assigned(EVP_DecryptFinal); + if FuncLoadError then + begin + {$if not defined(EVP_DecryptFinal_allownil)} + EVP_DecryptFinal := @ERR_EVP_DecryptFinal; + {$ifend} + {$if declared(EVP_DecryptFinal_introduced)} + if LibVersion < EVP_DecryptFinal_introduced then + begin + {$if declared(FC_EVP_DecryptFinal)} + EVP_DecryptFinal := @FC_EVP_DecryptFinal; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_DecryptFinal_removed)} + if EVP_DecryptFinal_removed <= LibVersion then + begin + {$if declared(_EVP_DecryptFinal)} + EVP_DecryptFinal := @_EVP_DecryptFinal; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_DecryptFinal_allownil)} + if FuncLoadError then + AFailed.Add('EVP_DecryptFinal'); + {$ifend} + end; + + + EVP_DecryptFinal_ex := LoadLibFunction(ADllHandle, EVP_DecryptFinal_ex_procname); + FuncLoadError := not assigned(EVP_DecryptFinal_ex); + if FuncLoadError then + begin + {$if not defined(EVP_DecryptFinal_ex_allownil)} + EVP_DecryptFinal_ex := @ERR_EVP_DecryptFinal_ex; + {$ifend} + {$if declared(EVP_DecryptFinal_ex_introduced)} + if LibVersion < EVP_DecryptFinal_ex_introduced then + begin + {$if declared(FC_EVP_DecryptFinal_ex)} + EVP_DecryptFinal_ex := @FC_EVP_DecryptFinal_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_DecryptFinal_ex_removed)} + if EVP_DecryptFinal_ex_removed <= LibVersion then + begin + {$if declared(_EVP_DecryptFinal_ex)} + EVP_DecryptFinal_ex := @_EVP_DecryptFinal_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_DecryptFinal_ex_allownil)} + if FuncLoadError then + AFailed.Add('EVP_DecryptFinal_ex'); + {$ifend} + end; + + + EVP_CipherInit := LoadLibFunction(ADllHandle, EVP_CipherInit_procname); + FuncLoadError := not assigned(EVP_CipherInit); + if FuncLoadError then + begin + {$if not defined(EVP_CipherInit_allownil)} + EVP_CipherInit := @ERR_EVP_CipherInit; + {$ifend} + {$if declared(EVP_CipherInit_introduced)} + if LibVersion < EVP_CipherInit_introduced then + begin + {$if declared(FC_EVP_CipherInit)} + EVP_CipherInit := @FC_EVP_CipherInit; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_CipherInit_removed)} + if EVP_CipherInit_removed <= LibVersion then + begin + {$if declared(_EVP_CipherInit)} + EVP_CipherInit := @_EVP_CipherInit; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_CipherInit_allownil)} + if FuncLoadError then + AFailed.Add('EVP_CipherInit'); + {$ifend} + end; + + + EVP_CipherInit_ex := LoadLibFunction(ADllHandle, EVP_CipherInit_ex_procname); + FuncLoadError := not assigned(EVP_CipherInit_ex); + if FuncLoadError then + begin + {$if not defined(EVP_CipherInit_ex_allownil)} + EVP_CipherInit_ex := @ERR_EVP_CipherInit_ex; + {$ifend} + {$if declared(EVP_CipherInit_ex_introduced)} + if LibVersion < EVP_CipherInit_ex_introduced then + begin + {$if declared(FC_EVP_CipherInit_ex)} + EVP_CipherInit_ex := @FC_EVP_CipherInit_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_CipherInit_ex_removed)} + if EVP_CipherInit_ex_removed <= LibVersion then + begin + {$if declared(_EVP_CipherInit_ex)} + EVP_CipherInit_ex := @_EVP_CipherInit_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_CipherInit_ex_allownil)} + if FuncLoadError then + AFailed.Add('EVP_CipherInit_ex'); + {$ifend} + end; + + + EVP_CipherUpdate := LoadLibFunction(ADllHandle, EVP_CipherUpdate_procname); + FuncLoadError := not assigned(EVP_CipherUpdate); + if FuncLoadError then + begin + {$if not defined(EVP_CipherUpdate_allownil)} + EVP_CipherUpdate := @ERR_EVP_CipherUpdate; + {$ifend} + {$if declared(EVP_CipherUpdate_introduced)} + if LibVersion < EVP_CipherUpdate_introduced then + begin + {$if declared(FC_EVP_CipherUpdate)} + EVP_CipherUpdate := @FC_EVP_CipherUpdate; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_CipherUpdate_removed)} + if EVP_CipherUpdate_removed <= LibVersion then + begin + {$if declared(_EVP_CipherUpdate)} + EVP_CipherUpdate := @_EVP_CipherUpdate; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_CipherUpdate_allownil)} + if FuncLoadError then + AFailed.Add('EVP_CipherUpdate'); + {$ifend} + end; + + + EVP_CipherFinal := LoadLibFunction(ADllHandle, EVP_CipherFinal_procname); + FuncLoadError := not assigned(EVP_CipherFinal); + if FuncLoadError then + begin + {$if not defined(EVP_CipherFinal_allownil)} + EVP_CipherFinal := @ERR_EVP_CipherFinal; + {$ifend} + {$if declared(EVP_CipherFinal_introduced)} + if LibVersion < EVP_CipherFinal_introduced then + begin + {$if declared(FC_EVP_CipherFinal)} + EVP_CipherFinal := @FC_EVP_CipherFinal; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_CipherFinal_removed)} + if EVP_CipherFinal_removed <= LibVersion then + begin + {$if declared(_EVP_CipherFinal)} + EVP_CipherFinal := @_EVP_CipherFinal; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_CipherFinal_allownil)} + if FuncLoadError then + AFailed.Add('EVP_CipherFinal'); + {$ifend} + end; + + + EVP_CipherFinal_ex := LoadLibFunction(ADllHandle, EVP_CipherFinal_ex_procname); + FuncLoadError := not assigned(EVP_CipherFinal_ex); + if FuncLoadError then + begin + {$if not defined(EVP_CipherFinal_ex_allownil)} + EVP_CipherFinal_ex := @ERR_EVP_CipherFinal_ex; + {$ifend} + {$if declared(EVP_CipherFinal_ex_introduced)} + if LibVersion < EVP_CipherFinal_ex_introduced then + begin + {$if declared(FC_EVP_CipherFinal_ex)} + EVP_CipherFinal_ex := @FC_EVP_CipherFinal_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_CipherFinal_ex_removed)} + if EVP_CipherFinal_ex_removed <= LibVersion then + begin + {$if declared(_EVP_CipherFinal_ex)} + EVP_CipherFinal_ex := @_EVP_CipherFinal_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_CipherFinal_ex_allownil)} + if FuncLoadError then + AFailed.Add('EVP_CipherFinal_ex'); + {$ifend} + end; + + + EVP_SignFinal := LoadLibFunction(ADllHandle, EVP_SignFinal_procname); + FuncLoadError := not assigned(EVP_SignFinal); + if FuncLoadError then + begin + {$if not defined(EVP_SignFinal_allownil)} + EVP_SignFinal := @ERR_EVP_SignFinal; + {$ifend} + {$if declared(EVP_SignFinal_introduced)} + if LibVersion < EVP_SignFinal_introduced then + begin + {$if declared(FC_EVP_SignFinal)} + EVP_SignFinal := @FC_EVP_SignFinal; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_SignFinal_removed)} + if EVP_SignFinal_removed <= LibVersion then + begin + {$if declared(_EVP_SignFinal)} + EVP_SignFinal := @_EVP_SignFinal; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_SignFinal_allownil)} + if FuncLoadError then + AFailed.Add('EVP_SignFinal'); + {$ifend} + end; + + + EVP_DigestSign := LoadLibFunction(ADllHandle, EVP_DigestSign_procname); + FuncLoadError := not assigned(EVP_DigestSign); + if FuncLoadError then + begin + {$if not defined(EVP_DigestSign_allownil)} + EVP_DigestSign := @ERR_EVP_DigestSign; + {$ifend} + {$if declared(EVP_DigestSign_introduced)} + if LibVersion < EVP_DigestSign_introduced then + begin + {$if declared(FC_EVP_DigestSign)} + EVP_DigestSign := @FC_EVP_DigestSign; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_DigestSign_removed)} + if EVP_DigestSign_removed <= LibVersion then + begin + {$if declared(_EVP_DigestSign)} + EVP_DigestSign := @_EVP_DigestSign; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_DigestSign_allownil)} + if FuncLoadError then + AFailed.Add('EVP_DigestSign'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_VerifyFinal := LoadLibFunction(ADllHandle, EVP_VerifyFinal_procname); + FuncLoadError := not assigned(EVP_VerifyFinal); + if FuncLoadError then + begin + {$if not defined(EVP_VerifyFinal_allownil)} + EVP_VerifyFinal := @ERR_EVP_VerifyFinal; + {$ifend} + {$if declared(EVP_VerifyFinal_introduced)} + if LibVersion < EVP_VerifyFinal_introduced then + begin + {$if declared(FC_EVP_VerifyFinal)} + EVP_VerifyFinal := @FC_EVP_VerifyFinal; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_VerifyFinal_removed)} + if EVP_VerifyFinal_removed <= LibVersion then + begin + {$if declared(_EVP_VerifyFinal)} + EVP_VerifyFinal := @_EVP_VerifyFinal; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_VerifyFinal_allownil)} + if FuncLoadError then + AFailed.Add('EVP_VerifyFinal'); + {$ifend} + end; + + + EVP_DigestVerify := LoadLibFunction(ADllHandle, EVP_DigestVerify_procname); + FuncLoadError := not assigned(EVP_DigestVerify); + if FuncLoadError then + begin + {$if not defined(EVP_DigestVerify_allownil)} + EVP_DigestVerify := @ERR_EVP_DigestVerify; + {$ifend} + {$if declared(EVP_DigestVerify_introduced)} + if LibVersion < EVP_DigestVerify_introduced then + begin + {$if declared(FC_EVP_DigestVerify)} + EVP_DigestVerify := @FC_EVP_DigestVerify; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_DigestVerify_removed)} + if EVP_DigestVerify_removed <= LibVersion then + begin + {$if declared(_EVP_DigestVerify)} + EVP_DigestVerify := @_EVP_DigestVerify; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_DigestVerify_allownil)} + if FuncLoadError then + AFailed.Add('EVP_DigestVerify'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_DigestSignInit := LoadLibFunction(ADllHandle, EVP_DigestSignInit_procname); + FuncLoadError := not assigned(EVP_DigestSignInit); + if FuncLoadError then + begin + {$if not defined(EVP_DigestSignInit_allownil)} + EVP_DigestSignInit := @ERR_EVP_DigestSignInit; + {$ifend} + {$if declared(EVP_DigestSignInit_introduced)} + if LibVersion < EVP_DigestSignInit_introduced then + begin + {$if declared(FC_EVP_DigestSignInit)} + EVP_DigestSignInit := @FC_EVP_DigestSignInit; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_DigestSignInit_removed)} + if EVP_DigestSignInit_removed <= LibVersion then + begin + {$if declared(_EVP_DigestSignInit)} + EVP_DigestSignInit := @_EVP_DigestSignInit; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_DigestSignInit_allownil)} + if FuncLoadError then + AFailed.Add('EVP_DigestSignInit'); + {$ifend} + end; + + + EVP_DigestSignFinal := LoadLibFunction(ADllHandle, EVP_DigestSignFinal_procname); + FuncLoadError := not assigned(EVP_DigestSignFinal); + if FuncLoadError then + begin + {$if not defined(EVP_DigestSignFinal_allownil)} + EVP_DigestSignFinal := @ERR_EVP_DigestSignFinal; + {$ifend} + {$if declared(EVP_DigestSignFinal_introduced)} + if LibVersion < EVP_DigestSignFinal_introduced then + begin + {$if declared(FC_EVP_DigestSignFinal)} + EVP_DigestSignFinal := @FC_EVP_DigestSignFinal; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_DigestSignFinal_removed)} + if EVP_DigestSignFinal_removed <= LibVersion then + begin + {$if declared(_EVP_DigestSignFinal)} + EVP_DigestSignFinal := @_EVP_DigestSignFinal; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_DigestSignFinal_allownil)} + if FuncLoadError then + AFailed.Add('EVP_DigestSignFinal'); + {$ifend} + end; + + + EVP_DigestVerifyInit := LoadLibFunction(ADllHandle, EVP_DigestVerifyInit_procname); + FuncLoadError := not assigned(EVP_DigestVerifyInit); + if FuncLoadError then + begin + {$if not defined(EVP_DigestVerifyInit_allownil)} + EVP_DigestVerifyInit := @ERR_EVP_DigestVerifyInit; + {$ifend} + {$if declared(EVP_DigestVerifyInit_introduced)} + if LibVersion < EVP_DigestVerifyInit_introduced then + begin + {$if declared(FC_EVP_DigestVerifyInit)} + EVP_DigestVerifyInit := @FC_EVP_DigestVerifyInit; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_DigestVerifyInit_removed)} + if EVP_DigestVerifyInit_removed <= LibVersion then + begin + {$if declared(_EVP_DigestVerifyInit)} + EVP_DigestVerifyInit := @_EVP_DigestVerifyInit; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_DigestVerifyInit_allownil)} + if FuncLoadError then + AFailed.Add('EVP_DigestVerifyInit'); + {$ifend} + end; + + + EVP_DigestVerifyFinal := LoadLibFunction(ADllHandle, EVP_DigestVerifyFinal_procname); + FuncLoadError := not assigned(EVP_DigestVerifyFinal); + if FuncLoadError then + begin + {$if not defined(EVP_DigestVerifyFinal_allownil)} + EVP_DigestVerifyFinal := @ERR_EVP_DigestVerifyFinal; + {$ifend} + {$if declared(EVP_DigestVerifyFinal_introduced)} + if LibVersion < EVP_DigestVerifyFinal_introduced then + begin + {$if declared(FC_EVP_DigestVerifyFinal)} + EVP_DigestVerifyFinal := @FC_EVP_DigestVerifyFinal; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_DigestVerifyFinal_removed)} + if EVP_DigestVerifyFinal_removed <= LibVersion then + begin + {$if declared(_EVP_DigestVerifyFinal)} + EVP_DigestVerifyFinal := @_EVP_DigestVerifyFinal; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_DigestVerifyFinal_allownil)} + if FuncLoadError then + AFailed.Add('EVP_DigestVerifyFinal'); + {$ifend} + end; + + + EVP_OpenInit := LoadLibFunction(ADllHandle, EVP_OpenInit_procname); + FuncLoadError := not assigned(EVP_OpenInit); + if FuncLoadError then + begin + {$if not defined(EVP_OpenInit_allownil)} + EVP_OpenInit := @ERR_EVP_OpenInit; + {$ifend} + {$if declared(EVP_OpenInit_introduced)} + if LibVersion < EVP_OpenInit_introduced then + begin + {$if declared(FC_EVP_OpenInit)} + EVP_OpenInit := @FC_EVP_OpenInit; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_OpenInit_removed)} + if EVP_OpenInit_removed <= LibVersion then + begin + {$if declared(_EVP_OpenInit)} + EVP_OpenInit := @_EVP_OpenInit; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_OpenInit_allownil)} + if FuncLoadError then + AFailed.Add('EVP_OpenInit'); + {$ifend} + end; + + + EVP_OpenFinal := LoadLibFunction(ADllHandle, EVP_OpenFinal_procname); + FuncLoadError := not assigned(EVP_OpenFinal); + if FuncLoadError then + begin + {$if not defined(EVP_OpenFinal_allownil)} + EVP_OpenFinal := @ERR_EVP_OpenFinal; + {$ifend} + {$if declared(EVP_OpenFinal_introduced)} + if LibVersion < EVP_OpenFinal_introduced then + begin + {$if declared(FC_EVP_OpenFinal)} + EVP_OpenFinal := @FC_EVP_OpenFinal; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_OpenFinal_removed)} + if EVP_OpenFinal_removed <= LibVersion then + begin + {$if declared(_EVP_OpenFinal)} + EVP_OpenFinal := @_EVP_OpenFinal; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_OpenFinal_allownil)} + if FuncLoadError then + AFailed.Add('EVP_OpenFinal'); + {$ifend} + end; + + + EVP_SealInit := LoadLibFunction(ADllHandle, EVP_SealInit_procname); + FuncLoadError := not assigned(EVP_SealInit); + if FuncLoadError then + begin + {$if not defined(EVP_SealInit_allownil)} + EVP_SealInit := @ERR_EVP_SealInit; + {$ifend} + {$if declared(EVP_SealInit_introduced)} + if LibVersion < EVP_SealInit_introduced then + begin + {$if declared(FC_EVP_SealInit)} + EVP_SealInit := @FC_EVP_SealInit; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_SealInit_removed)} + if EVP_SealInit_removed <= LibVersion then + begin + {$if declared(_EVP_SealInit)} + EVP_SealInit := @_EVP_SealInit; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_SealInit_allownil)} + if FuncLoadError then + AFailed.Add('EVP_SealInit'); + {$ifend} + end; + + + EVP_SealFinal := LoadLibFunction(ADllHandle, EVP_SealFinal_procname); + FuncLoadError := not assigned(EVP_SealFinal); + if FuncLoadError then + begin + {$if not defined(EVP_SealFinal_allownil)} + EVP_SealFinal := @ERR_EVP_SealFinal; + {$ifend} + {$if declared(EVP_SealFinal_introduced)} + if LibVersion < EVP_SealFinal_introduced then + begin + {$if declared(FC_EVP_SealFinal)} + EVP_SealFinal := @FC_EVP_SealFinal; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_SealFinal_removed)} + if EVP_SealFinal_removed <= LibVersion then + begin + {$if declared(_EVP_SealFinal)} + EVP_SealFinal := @_EVP_SealFinal; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_SealFinal_allownil)} + if FuncLoadError then + AFailed.Add('EVP_SealFinal'); + {$ifend} + end; + + + EVP_ENCODE_CTX_new := LoadLibFunction(ADllHandle, EVP_ENCODE_CTX_new_procname); + FuncLoadError := not assigned(EVP_ENCODE_CTX_new); + if FuncLoadError then + begin + {$if not defined(EVP_ENCODE_CTX_new_allownil)} + EVP_ENCODE_CTX_new := @ERR_EVP_ENCODE_CTX_new; + {$ifend} + {$if declared(EVP_ENCODE_CTX_new_introduced)} + if LibVersion < EVP_ENCODE_CTX_new_introduced then + begin + {$if declared(FC_EVP_ENCODE_CTX_new)} + EVP_ENCODE_CTX_new := @FC_EVP_ENCODE_CTX_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_ENCODE_CTX_new_removed)} + if EVP_ENCODE_CTX_new_removed <= LibVersion then + begin + {$if declared(_EVP_ENCODE_CTX_new)} + EVP_ENCODE_CTX_new := @_EVP_ENCODE_CTX_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_ENCODE_CTX_new_allownil)} + if FuncLoadError then + AFailed.Add('EVP_ENCODE_CTX_new'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_ENCODE_CTX_free := LoadLibFunction(ADllHandle, EVP_ENCODE_CTX_free_procname); + FuncLoadError := not assigned(EVP_ENCODE_CTX_free); + if FuncLoadError then + begin + {$if not defined(EVP_ENCODE_CTX_free_allownil)} + EVP_ENCODE_CTX_free := @ERR_EVP_ENCODE_CTX_free; + {$ifend} + {$if declared(EVP_ENCODE_CTX_free_introduced)} + if LibVersion < EVP_ENCODE_CTX_free_introduced then + begin + {$if declared(FC_EVP_ENCODE_CTX_free)} + EVP_ENCODE_CTX_free := @FC_EVP_ENCODE_CTX_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_ENCODE_CTX_free_removed)} + if EVP_ENCODE_CTX_free_removed <= LibVersion then + begin + {$if declared(_EVP_ENCODE_CTX_free)} + EVP_ENCODE_CTX_free := @_EVP_ENCODE_CTX_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_ENCODE_CTX_free_allownil)} + if FuncLoadError then + AFailed.Add('EVP_ENCODE_CTX_free'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_ENCODE_CTX_copy := LoadLibFunction(ADllHandle, EVP_ENCODE_CTX_copy_procname); + FuncLoadError := not assigned(EVP_ENCODE_CTX_copy); + if FuncLoadError then + begin + {$if not defined(EVP_ENCODE_CTX_copy_allownil)} + EVP_ENCODE_CTX_copy := @ERR_EVP_ENCODE_CTX_copy; + {$ifend} + {$if declared(EVP_ENCODE_CTX_copy_introduced)} + if LibVersion < EVP_ENCODE_CTX_copy_introduced then + begin + {$if declared(FC_EVP_ENCODE_CTX_copy)} + EVP_ENCODE_CTX_copy := @FC_EVP_ENCODE_CTX_copy; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_ENCODE_CTX_copy_removed)} + if EVP_ENCODE_CTX_copy_removed <= LibVersion then + begin + {$if declared(_EVP_ENCODE_CTX_copy)} + EVP_ENCODE_CTX_copy := @_EVP_ENCODE_CTX_copy; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_ENCODE_CTX_copy_allownil)} + if FuncLoadError then + AFailed.Add('EVP_ENCODE_CTX_copy'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_ENCODE_CTX_num := LoadLibFunction(ADllHandle, EVP_ENCODE_CTX_num_procname); + FuncLoadError := not assigned(EVP_ENCODE_CTX_num); + if FuncLoadError then + begin + {$if not defined(EVP_ENCODE_CTX_num_allownil)} + EVP_ENCODE_CTX_num := @ERR_EVP_ENCODE_CTX_num; + {$ifend} + {$if declared(EVP_ENCODE_CTX_num_introduced)} + if LibVersion < EVP_ENCODE_CTX_num_introduced then + begin + {$if declared(FC_EVP_ENCODE_CTX_num)} + EVP_ENCODE_CTX_num := @FC_EVP_ENCODE_CTX_num; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_ENCODE_CTX_num_removed)} + if EVP_ENCODE_CTX_num_removed <= LibVersion then + begin + {$if declared(_EVP_ENCODE_CTX_num)} + EVP_ENCODE_CTX_num := @_EVP_ENCODE_CTX_num; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_ENCODE_CTX_num_allownil)} + if FuncLoadError then + AFailed.Add('EVP_ENCODE_CTX_num'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_EncodeInit := LoadLibFunction(ADllHandle, EVP_EncodeInit_procname); + FuncLoadError := not assigned(EVP_EncodeInit); + if FuncLoadError then + begin + {$if not defined(EVP_EncodeInit_allownil)} + EVP_EncodeInit := @ERR_EVP_EncodeInit; + {$ifend} + {$if declared(EVP_EncodeInit_introduced)} + if LibVersion < EVP_EncodeInit_introduced then + begin + {$if declared(FC_EVP_EncodeInit)} + EVP_EncodeInit := @FC_EVP_EncodeInit; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_EncodeInit_removed)} + if EVP_EncodeInit_removed <= LibVersion then + begin + {$if declared(_EVP_EncodeInit)} + EVP_EncodeInit := @_EVP_EncodeInit; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_EncodeInit_allownil)} + if FuncLoadError then + AFailed.Add('EVP_EncodeInit'); + {$ifend} + end; + + + EVP_EncodeUpdate := LoadLibFunction(ADllHandle, EVP_EncodeUpdate_procname); + FuncLoadError := not assigned(EVP_EncodeUpdate); + if FuncLoadError then + begin + {$if not defined(EVP_EncodeUpdate_allownil)} + EVP_EncodeUpdate := @ERR_EVP_EncodeUpdate; + {$ifend} + {$if declared(EVP_EncodeUpdate_introduced)} + if LibVersion < EVP_EncodeUpdate_introduced then + begin + {$if declared(FC_EVP_EncodeUpdate)} + EVP_EncodeUpdate := @FC_EVP_EncodeUpdate; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_EncodeUpdate_removed)} + if EVP_EncodeUpdate_removed <= LibVersion then + begin + {$if declared(_EVP_EncodeUpdate)} + EVP_EncodeUpdate := @_EVP_EncodeUpdate; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_EncodeUpdate_allownil)} + if FuncLoadError then + AFailed.Add('EVP_EncodeUpdate'); + {$ifend} + end; + + + EVP_EncodeFinal := LoadLibFunction(ADllHandle, EVP_EncodeFinal_procname); + FuncLoadError := not assigned(EVP_EncodeFinal); + if FuncLoadError then + begin + {$if not defined(EVP_EncodeFinal_allownil)} + EVP_EncodeFinal := @ERR_EVP_EncodeFinal; + {$ifend} + {$if declared(EVP_EncodeFinal_introduced)} + if LibVersion < EVP_EncodeFinal_introduced then + begin + {$if declared(FC_EVP_EncodeFinal)} + EVP_EncodeFinal := @FC_EVP_EncodeFinal; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_EncodeFinal_removed)} + if EVP_EncodeFinal_removed <= LibVersion then + begin + {$if declared(_EVP_EncodeFinal)} + EVP_EncodeFinal := @_EVP_EncodeFinal; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_EncodeFinal_allownil)} + if FuncLoadError then + AFailed.Add('EVP_EncodeFinal'); + {$ifend} + end; + + + EVP_EncodeBlock := LoadLibFunction(ADllHandle, EVP_EncodeBlock_procname); + FuncLoadError := not assigned(EVP_EncodeBlock); + if FuncLoadError then + begin + {$if not defined(EVP_EncodeBlock_allownil)} + EVP_EncodeBlock := @ERR_EVP_EncodeBlock; + {$ifend} + {$if declared(EVP_EncodeBlock_introduced)} + if LibVersion < EVP_EncodeBlock_introduced then + begin + {$if declared(FC_EVP_EncodeBlock)} + EVP_EncodeBlock := @FC_EVP_EncodeBlock; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_EncodeBlock_removed)} + if EVP_EncodeBlock_removed <= LibVersion then + begin + {$if declared(_EVP_EncodeBlock)} + EVP_EncodeBlock := @_EVP_EncodeBlock; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_EncodeBlock_allownil)} + if FuncLoadError then + AFailed.Add('EVP_EncodeBlock'); + {$ifend} + end; + + + EVP_DecodeInit := LoadLibFunction(ADllHandle, EVP_DecodeInit_procname); + FuncLoadError := not assigned(EVP_DecodeInit); + if FuncLoadError then + begin + {$if not defined(EVP_DecodeInit_allownil)} + EVP_DecodeInit := @ERR_EVP_DecodeInit; + {$ifend} + {$if declared(EVP_DecodeInit_introduced)} + if LibVersion < EVP_DecodeInit_introduced then + begin + {$if declared(FC_EVP_DecodeInit)} + EVP_DecodeInit := @FC_EVP_DecodeInit; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_DecodeInit_removed)} + if EVP_DecodeInit_removed <= LibVersion then + begin + {$if declared(_EVP_DecodeInit)} + EVP_DecodeInit := @_EVP_DecodeInit; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_DecodeInit_allownil)} + if FuncLoadError then + AFailed.Add('EVP_DecodeInit'); + {$ifend} + end; + + + EVP_DecodeUpdate := LoadLibFunction(ADllHandle, EVP_DecodeUpdate_procname); + FuncLoadError := not assigned(EVP_DecodeUpdate); + if FuncLoadError then + begin + {$if not defined(EVP_DecodeUpdate_allownil)} + EVP_DecodeUpdate := @ERR_EVP_DecodeUpdate; + {$ifend} + {$if declared(EVP_DecodeUpdate_introduced)} + if LibVersion < EVP_DecodeUpdate_introduced then + begin + {$if declared(FC_EVP_DecodeUpdate)} + EVP_DecodeUpdate := @FC_EVP_DecodeUpdate; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_DecodeUpdate_removed)} + if EVP_DecodeUpdate_removed <= LibVersion then + begin + {$if declared(_EVP_DecodeUpdate)} + EVP_DecodeUpdate := @_EVP_DecodeUpdate; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_DecodeUpdate_allownil)} + if FuncLoadError then + AFailed.Add('EVP_DecodeUpdate'); + {$ifend} + end; + + + EVP_DecodeFinal := LoadLibFunction(ADllHandle, EVP_DecodeFinal_procname); + FuncLoadError := not assigned(EVP_DecodeFinal); + if FuncLoadError then + begin + {$if not defined(EVP_DecodeFinal_allownil)} + EVP_DecodeFinal := @ERR_EVP_DecodeFinal; + {$ifend} + {$if declared(EVP_DecodeFinal_introduced)} + if LibVersion < EVP_DecodeFinal_introduced then + begin + {$if declared(FC_EVP_DecodeFinal)} + EVP_DecodeFinal := @FC_EVP_DecodeFinal; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_DecodeFinal_removed)} + if EVP_DecodeFinal_removed <= LibVersion then + begin + {$if declared(_EVP_DecodeFinal)} + EVP_DecodeFinal := @_EVP_DecodeFinal; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_DecodeFinal_allownil)} + if FuncLoadError then + AFailed.Add('EVP_DecodeFinal'); + {$ifend} + end; + + + EVP_DecodeBlock := LoadLibFunction(ADllHandle, EVP_DecodeBlock_procname); + FuncLoadError := not assigned(EVP_DecodeBlock); + if FuncLoadError then + begin + {$if not defined(EVP_DecodeBlock_allownil)} + EVP_DecodeBlock := @ERR_EVP_DecodeBlock; + {$ifend} + {$if declared(EVP_DecodeBlock_introduced)} + if LibVersion < EVP_DecodeBlock_introduced then + begin + {$if declared(FC_EVP_DecodeBlock)} + EVP_DecodeBlock := @FC_EVP_DecodeBlock; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_DecodeBlock_removed)} + if EVP_DecodeBlock_removed <= LibVersion then + begin + {$if declared(_EVP_DecodeBlock)} + EVP_DecodeBlock := @_EVP_DecodeBlock; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_DecodeBlock_allownil)} + if FuncLoadError then + AFailed.Add('EVP_DecodeBlock'); + {$ifend} + end; + + + EVP_CIPHER_CTX_new := LoadLibFunction(ADllHandle, EVP_CIPHER_CTX_new_procname); + FuncLoadError := not assigned(EVP_CIPHER_CTX_new); + if FuncLoadError then + begin + {$if not defined(EVP_CIPHER_CTX_new_allownil)} + EVP_CIPHER_CTX_new := @ERR_EVP_CIPHER_CTX_new; + {$ifend} + {$if declared(EVP_CIPHER_CTX_new_introduced)} + if LibVersion < EVP_CIPHER_CTX_new_introduced then + begin + {$if declared(FC_EVP_CIPHER_CTX_new)} + EVP_CIPHER_CTX_new := @FC_EVP_CIPHER_CTX_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_CIPHER_CTX_new_removed)} + if EVP_CIPHER_CTX_new_removed <= LibVersion then + begin + {$if declared(_EVP_CIPHER_CTX_new)} + EVP_CIPHER_CTX_new := @_EVP_CIPHER_CTX_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_CIPHER_CTX_new_allownil)} + if FuncLoadError then + AFailed.Add('EVP_CIPHER_CTX_new'); + {$ifend} + end; + + + EVP_CIPHER_CTX_reset := LoadLibFunction(ADllHandle, EVP_CIPHER_CTX_reset_procname); + FuncLoadError := not assigned(EVP_CIPHER_CTX_reset); + if FuncLoadError then + begin + {$if not defined(EVP_CIPHER_CTX_reset_allownil)} + EVP_CIPHER_CTX_reset := @ERR_EVP_CIPHER_CTX_reset; + {$ifend} + {$if declared(EVP_CIPHER_CTX_reset_introduced)} + if LibVersion < EVP_CIPHER_CTX_reset_introduced then + begin + {$if declared(FC_EVP_CIPHER_CTX_reset)} + EVP_CIPHER_CTX_reset := @FC_EVP_CIPHER_CTX_reset; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_CIPHER_CTX_reset_removed)} + if EVP_CIPHER_CTX_reset_removed <= LibVersion then + begin + {$if declared(_EVP_CIPHER_CTX_reset)} + EVP_CIPHER_CTX_reset := @_EVP_CIPHER_CTX_reset; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_CIPHER_CTX_reset_allownil)} + if FuncLoadError then + AFailed.Add('EVP_CIPHER_CTX_reset'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_CIPHER_CTX_free := LoadLibFunction(ADllHandle, EVP_CIPHER_CTX_free_procname); + FuncLoadError := not assigned(EVP_CIPHER_CTX_free); + if FuncLoadError then + begin + {$if not defined(EVP_CIPHER_CTX_free_allownil)} + EVP_CIPHER_CTX_free := @ERR_EVP_CIPHER_CTX_free; + {$ifend} + {$if declared(EVP_CIPHER_CTX_free_introduced)} + if LibVersion < EVP_CIPHER_CTX_free_introduced then + begin + {$if declared(FC_EVP_CIPHER_CTX_free)} + EVP_CIPHER_CTX_free := @FC_EVP_CIPHER_CTX_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_CIPHER_CTX_free_removed)} + if EVP_CIPHER_CTX_free_removed <= LibVersion then + begin + {$if declared(_EVP_CIPHER_CTX_free)} + EVP_CIPHER_CTX_free := @_EVP_CIPHER_CTX_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_CIPHER_CTX_free_allownil)} + if FuncLoadError then + AFailed.Add('EVP_CIPHER_CTX_free'); + {$ifend} + end; + + + EVP_CIPHER_CTX_set_key_length := LoadLibFunction(ADllHandle, EVP_CIPHER_CTX_set_key_length_procname); + FuncLoadError := not assigned(EVP_CIPHER_CTX_set_key_length); + if FuncLoadError then + begin + {$if not defined(EVP_CIPHER_CTX_set_key_length_allownil)} + EVP_CIPHER_CTX_set_key_length := @ERR_EVP_CIPHER_CTX_set_key_length; + {$ifend} + {$if declared(EVP_CIPHER_CTX_set_key_length_introduced)} + if LibVersion < EVP_CIPHER_CTX_set_key_length_introduced then + begin + {$if declared(FC_EVP_CIPHER_CTX_set_key_length)} + EVP_CIPHER_CTX_set_key_length := @FC_EVP_CIPHER_CTX_set_key_length; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_CIPHER_CTX_set_key_length_removed)} + if EVP_CIPHER_CTX_set_key_length_removed <= LibVersion then + begin + {$if declared(_EVP_CIPHER_CTX_set_key_length)} + EVP_CIPHER_CTX_set_key_length := @_EVP_CIPHER_CTX_set_key_length; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_CIPHER_CTX_set_key_length_allownil)} + if FuncLoadError then + AFailed.Add('EVP_CIPHER_CTX_set_key_length'); + {$ifend} + end; + + + EVP_CIPHER_CTX_set_padding := LoadLibFunction(ADllHandle, EVP_CIPHER_CTX_set_padding_procname); + FuncLoadError := not assigned(EVP_CIPHER_CTX_set_padding); + if FuncLoadError then + begin + {$if not defined(EVP_CIPHER_CTX_set_padding_allownil)} + EVP_CIPHER_CTX_set_padding := @ERR_EVP_CIPHER_CTX_set_padding; + {$ifend} + {$if declared(EVP_CIPHER_CTX_set_padding_introduced)} + if LibVersion < EVP_CIPHER_CTX_set_padding_introduced then + begin + {$if declared(FC_EVP_CIPHER_CTX_set_padding)} + EVP_CIPHER_CTX_set_padding := @FC_EVP_CIPHER_CTX_set_padding; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_CIPHER_CTX_set_padding_removed)} + if EVP_CIPHER_CTX_set_padding_removed <= LibVersion then + begin + {$if declared(_EVP_CIPHER_CTX_set_padding)} + EVP_CIPHER_CTX_set_padding := @_EVP_CIPHER_CTX_set_padding; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_CIPHER_CTX_set_padding_allownil)} + if FuncLoadError then + AFailed.Add('EVP_CIPHER_CTX_set_padding'); + {$ifend} + end; + + + EVP_CIPHER_CTX_ctrl := LoadLibFunction(ADllHandle, EVP_CIPHER_CTX_ctrl_procname); + FuncLoadError := not assigned(EVP_CIPHER_CTX_ctrl); + if FuncLoadError then + begin + {$if not defined(EVP_CIPHER_CTX_ctrl_allownil)} + EVP_CIPHER_CTX_ctrl := @ERR_EVP_CIPHER_CTX_ctrl; + {$ifend} + {$if declared(EVP_CIPHER_CTX_ctrl_introduced)} + if LibVersion < EVP_CIPHER_CTX_ctrl_introduced then + begin + {$if declared(FC_EVP_CIPHER_CTX_ctrl)} + EVP_CIPHER_CTX_ctrl := @FC_EVP_CIPHER_CTX_ctrl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_CIPHER_CTX_ctrl_removed)} + if EVP_CIPHER_CTX_ctrl_removed <= LibVersion then + begin + {$if declared(_EVP_CIPHER_CTX_ctrl)} + EVP_CIPHER_CTX_ctrl := @_EVP_CIPHER_CTX_ctrl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_CIPHER_CTX_ctrl_allownil)} + if FuncLoadError then + AFailed.Add('EVP_CIPHER_CTX_ctrl'); + {$ifend} + end; + + + EVP_CIPHER_CTX_rand_key := LoadLibFunction(ADllHandle, EVP_CIPHER_CTX_rand_key_procname); + FuncLoadError := not assigned(EVP_CIPHER_CTX_rand_key); + if FuncLoadError then + begin + {$if not defined(EVP_CIPHER_CTX_rand_key_allownil)} + EVP_CIPHER_CTX_rand_key := @ERR_EVP_CIPHER_CTX_rand_key; + {$ifend} + {$if declared(EVP_CIPHER_CTX_rand_key_introduced)} + if LibVersion < EVP_CIPHER_CTX_rand_key_introduced then + begin + {$if declared(FC_EVP_CIPHER_CTX_rand_key)} + EVP_CIPHER_CTX_rand_key := @FC_EVP_CIPHER_CTX_rand_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_CIPHER_CTX_rand_key_removed)} + if EVP_CIPHER_CTX_rand_key_removed <= LibVersion then + begin + {$if declared(_EVP_CIPHER_CTX_rand_key)} + EVP_CIPHER_CTX_rand_key := @_EVP_CIPHER_CTX_rand_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_CIPHER_CTX_rand_key_allownil)} + if FuncLoadError then + AFailed.Add('EVP_CIPHER_CTX_rand_key'); + {$ifend} + end; + + + BIO_f_md := LoadLibFunction(ADllHandle, BIO_f_md_procname); + FuncLoadError := not assigned(BIO_f_md); + if FuncLoadError then + begin + {$if not defined(BIO_f_md_allownil)} + BIO_f_md := @ERR_BIO_f_md; + {$ifend} + {$if declared(BIO_f_md_introduced)} + if LibVersion < BIO_f_md_introduced then + begin + {$if declared(FC_BIO_f_md)} + BIO_f_md := @FC_BIO_f_md; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_f_md_removed)} + if BIO_f_md_removed <= LibVersion then + begin + {$if declared(_BIO_f_md)} + BIO_f_md := @_BIO_f_md; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_f_md_allownil)} + if FuncLoadError then + AFailed.Add('BIO_f_md'); + {$ifend} + end; + + + BIO_f_base64 := LoadLibFunction(ADllHandle, BIO_f_base64_procname); + FuncLoadError := not assigned(BIO_f_base64); + if FuncLoadError then + begin + {$if not defined(BIO_f_base64_allownil)} + BIO_f_base64 := @ERR_BIO_f_base64; + {$ifend} + {$if declared(BIO_f_base64_introduced)} + if LibVersion < BIO_f_base64_introduced then + begin + {$if declared(FC_BIO_f_base64)} + BIO_f_base64 := @FC_BIO_f_base64; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_f_base64_removed)} + if BIO_f_base64_removed <= LibVersion then + begin + {$if declared(_BIO_f_base64)} + BIO_f_base64 := @_BIO_f_base64; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_f_base64_allownil)} + if FuncLoadError then + AFailed.Add('BIO_f_base64'); + {$ifend} + end; + + + BIO_f_cipher := LoadLibFunction(ADllHandle, BIO_f_cipher_procname); + FuncLoadError := not assigned(BIO_f_cipher); + if FuncLoadError then + begin + {$if not defined(BIO_f_cipher_allownil)} + BIO_f_cipher := @ERR_BIO_f_cipher; + {$ifend} + {$if declared(BIO_f_cipher_introduced)} + if LibVersion < BIO_f_cipher_introduced then + begin + {$if declared(FC_BIO_f_cipher)} + BIO_f_cipher := @FC_BIO_f_cipher; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_f_cipher_removed)} + if BIO_f_cipher_removed <= LibVersion then + begin + {$if declared(_BIO_f_cipher)} + BIO_f_cipher := @_BIO_f_cipher; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_f_cipher_allownil)} + if FuncLoadError then + AFailed.Add('BIO_f_cipher'); + {$ifend} + end; + + + BIO_f_reliable := LoadLibFunction(ADllHandle, BIO_f_reliable_procname); + FuncLoadError := not assigned(BIO_f_reliable); + if FuncLoadError then + begin + {$if not defined(BIO_f_reliable_allownil)} + BIO_f_reliable := @ERR_BIO_f_reliable; + {$ifend} + {$if declared(BIO_f_reliable_introduced)} + if LibVersion < BIO_f_reliable_introduced then + begin + {$if declared(FC_BIO_f_reliable)} + BIO_f_reliable := @FC_BIO_f_reliable; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_f_reliable_removed)} + if BIO_f_reliable_removed <= LibVersion then + begin + {$if declared(_BIO_f_reliable)} + BIO_f_reliable := @_BIO_f_reliable; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_f_reliable_allownil)} + if FuncLoadError then + AFailed.Add('BIO_f_reliable'); + {$ifend} + end; + + + BIO_set_cipher := LoadLibFunction(ADllHandle, BIO_set_cipher_procname); + FuncLoadError := not assigned(BIO_set_cipher); + if FuncLoadError then + begin + {$if not defined(BIO_set_cipher_allownil)} + BIO_set_cipher := @ERR_BIO_set_cipher; + {$ifend} + {$if declared(BIO_set_cipher_introduced)} + if LibVersion < BIO_set_cipher_introduced then + begin + {$if declared(FC_BIO_set_cipher)} + BIO_set_cipher := @FC_BIO_set_cipher; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_set_cipher_removed)} + if BIO_set_cipher_removed <= LibVersion then + begin + {$if declared(_BIO_set_cipher)} + BIO_set_cipher := @_BIO_set_cipher; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_set_cipher_allownil)} + if FuncLoadError then + AFailed.Add('BIO_set_cipher'); + {$ifend} + end; + + + EVP_md_null := LoadLibFunction(ADllHandle, EVP_md_null_procname); + FuncLoadError := not assigned(EVP_md_null); + if FuncLoadError then + begin + {$if not defined(EVP_md_null_allownil)} + EVP_md_null := @ERR_EVP_md_null; + {$ifend} + {$if declared(EVP_md_null_introduced)} + if LibVersion < EVP_md_null_introduced then + begin + {$if declared(FC_EVP_md_null)} + EVP_md_null := @FC_EVP_md_null; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_md_null_removed)} + if EVP_md_null_removed <= LibVersion then + begin + {$if declared(_EVP_md_null)} + EVP_md_null := @_EVP_md_null; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_md_null_allownil)} + if FuncLoadError then + AFailed.Add('EVP_md_null'); + {$ifend} + end; + + + EVP_md2 := LoadLibFunction(ADllHandle, EVP_md2_procname); + FuncLoadError := not assigned(EVP_md2); + if FuncLoadError then + begin + {$if not defined(EVP_md2_allownil)} + EVP_md2 := @ERR_EVP_md2; + {$ifend} + {$if declared(EVP_md2_introduced)} + if LibVersion < EVP_md2_introduced then + begin + {$if declared(FC_EVP_md2)} + EVP_md2 := @FC_EVP_md2; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_md2_removed)} + if EVP_md2_removed <= LibVersion then + begin + {$if declared(_EVP_md2)} + EVP_md2 := @_EVP_md2; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_md2_allownil)} + if FuncLoadError then + AFailed.Add('EVP_md2'); + {$ifend} + end; + + {removed 1.1.0 allow_nil} + EVP_md4 := LoadLibFunction(ADllHandle, EVP_md4_procname); + FuncLoadError := not assigned(EVP_md4); + if FuncLoadError then + begin + {$if not defined(EVP_md4_allownil)} + EVP_md4 := @ERR_EVP_md4; + {$ifend} + {$if declared(EVP_md4_introduced)} + if LibVersion < EVP_md4_introduced then + begin + {$if declared(FC_EVP_md4)} + EVP_md4 := @FC_EVP_md4; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_md4_removed)} + if EVP_md4_removed <= LibVersion then + begin + {$if declared(_EVP_md4)} + EVP_md4 := @_EVP_md4; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_md4_allownil)} + if FuncLoadError then + AFailed.Add('EVP_md4'); + {$ifend} + end; + + {removed 1.1.0 allow_nil} + EVP_md5 := LoadLibFunction(ADllHandle, EVP_md5_procname); + FuncLoadError := not assigned(EVP_md5); + if FuncLoadError then + begin + {$if not defined(EVP_md5_allownil)} + EVP_md5 := @ERR_EVP_md5; + {$ifend} + {$if declared(EVP_md5_introduced)} + if LibVersion < EVP_md5_introduced then + begin + {$if declared(FC_EVP_md5)} + EVP_md5 := @FC_EVP_md5; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_md5_removed)} + if EVP_md5_removed <= LibVersion then + begin + {$if declared(_EVP_md5)} + EVP_md5 := @_EVP_md5; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_md5_allownil)} + if FuncLoadError then + AFailed.Add('EVP_md5'); + {$ifend} + end; + + {removed 1.1.0 allow_nil} + EVP_md5_sha1 := LoadLibFunction(ADllHandle, EVP_md5_sha1_procname); + FuncLoadError := not assigned(EVP_md5_sha1); + if FuncLoadError then + begin + {$if not defined(EVP_md5_sha1_allownil)} + EVP_md5_sha1 := @ERR_EVP_md5_sha1; + {$ifend} + {$if declared(EVP_md5_sha1_introduced)} + if LibVersion < EVP_md5_sha1_introduced then + begin + {$if declared(FC_EVP_md5_sha1)} + EVP_md5_sha1 := @FC_EVP_md5_sha1; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_md5_sha1_removed)} + if EVP_md5_sha1_removed <= LibVersion then + begin + {$if declared(_EVP_md5_sha1)} + EVP_md5_sha1 := @_EVP_md5_sha1; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_md5_sha1_allownil)} + if FuncLoadError then + AFailed.Add('EVP_md5_sha1'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_sha1 := LoadLibFunction(ADllHandle, EVP_sha1_procname); + FuncLoadError := not assigned(EVP_sha1); + if FuncLoadError then + begin + {$if not defined(EVP_sha1_allownil)} + EVP_sha1 := @ERR_EVP_sha1; + {$ifend} + {$if declared(EVP_sha1_introduced)} + if LibVersion < EVP_sha1_introduced then + begin + {$if declared(FC_EVP_sha1)} + EVP_sha1 := @FC_EVP_sha1; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_sha1_removed)} + if EVP_sha1_removed <= LibVersion then + begin + {$if declared(_EVP_sha1)} + EVP_sha1 := @_EVP_sha1; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_sha1_allownil)} + if FuncLoadError then + AFailed.Add('EVP_sha1'); + {$ifend} + end; + + + EVP_sha224 := LoadLibFunction(ADllHandle, EVP_sha224_procname); + FuncLoadError := not assigned(EVP_sha224); + if FuncLoadError then + begin + {$if not defined(EVP_sha224_allownil)} + EVP_sha224 := @ERR_EVP_sha224; + {$ifend} + {$if declared(EVP_sha224_introduced)} + if LibVersion < EVP_sha224_introduced then + begin + {$if declared(FC_EVP_sha224)} + EVP_sha224 := @FC_EVP_sha224; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_sha224_removed)} + if EVP_sha224_removed <= LibVersion then + begin + {$if declared(_EVP_sha224)} + EVP_sha224 := @_EVP_sha224; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_sha224_allownil)} + if FuncLoadError then + AFailed.Add('EVP_sha224'); + {$ifend} + end; + + + EVP_sha256 := LoadLibFunction(ADllHandle, EVP_sha256_procname); + FuncLoadError := not assigned(EVP_sha256); + if FuncLoadError then + begin + {$if not defined(EVP_sha256_allownil)} + EVP_sha256 := @ERR_EVP_sha256; + {$ifend} + {$if declared(EVP_sha256_introduced)} + if LibVersion < EVP_sha256_introduced then + begin + {$if declared(FC_EVP_sha256)} + EVP_sha256 := @FC_EVP_sha256; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_sha256_removed)} + if EVP_sha256_removed <= LibVersion then + begin + {$if declared(_EVP_sha256)} + EVP_sha256 := @_EVP_sha256; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_sha256_allownil)} + if FuncLoadError then + AFailed.Add('EVP_sha256'); + {$ifend} + end; + + + EVP_sha384 := LoadLibFunction(ADllHandle, EVP_sha384_procname); + FuncLoadError := not assigned(EVP_sha384); + if FuncLoadError then + begin + {$if not defined(EVP_sha384_allownil)} + EVP_sha384 := @ERR_EVP_sha384; + {$ifend} + {$if declared(EVP_sha384_introduced)} + if LibVersion < EVP_sha384_introduced then + begin + {$if declared(FC_EVP_sha384)} + EVP_sha384 := @FC_EVP_sha384; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_sha384_removed)} + if EVP_sha384_removed <= LibVersion then + begin + {$if declared(_EVP_sha384)} + EVP_sha384 := @_EVP_sha384; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_sha384_allownil)} + if FuncLoadError then + AFailed.Add('EVP_sha384'); + {$ifend} + end; + + + EVP_sha512 := LoadLibFunction(ADllHandle, EVP_sha512_procname); + FuncLoadError := not assigned(EVP_sha512); + if FuncLoadError then + begin + {$if not defined(EVP_sha512_allownil)} + EVP_sha512 := @ERR_EVP_sha512; + {$ifend} + {$if declared(EVP_sha512_introduced)} + if LibVersion < EVP_sha512_introduced then + begin + {$if declared(FC_EVP_sha512)} + EVP_sha512 := @FC_EVP_sha512; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_sha512_removed)} + if EVP_sha512_removed <= LibVersion then + begin + {$if declared(_EVP_sha512)} + EVP_sha512 := @_EVP_sha512; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_sha512_allownil)} + if FuncLoadError then + AFailed.Add('EVP_sha512'); + {$ifend} + end; + + + EVP_sha512_224 := LoadLibFunction(ADllHandle, EVP_sha512_224_procname); + FuncLoadError := not assigned(EVP_sha512_224); + if FuncLoadError then + begin + {$if not defined(EVP_sha512_224_allownil)} + EVP_sha512_224 := @ERR_EVP_sha512_224; + {$ifend} + {$if declared(EVP_sha512_224_introduced)} + if LibVersion < EVP_sha512_224_introduced then + begin + {$if declared(FC_EVP_sha512_224)} + EVP_sha512_224 := @FC_EVP_sha512_224; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_sha512_224_removed)} + if EVP_sha512_224_removed <= LibVersion then + begin + {$if declared(_EVP_sha512_224)} + EVP_sha512_224 := @_EVP_sha512_224; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_sha512_224_allownil)} + if FuncLoadError then + AFailed.Add('EVP_sha512_224'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_sha512_256 := LoadLibFunction(ADllHandle, EVP_sha512_256_procname); + FuncLoadError := not assigned(EVP_sha512_256); + if FuncLoadError then + begin + {$if not defined(EVP_sha512_256_allownil)} + EVP_sha512_256 := @ERR_EVP_sha512_256; + {$ifend} + {$if declared(EVP_sha512_256_introduced)} + if LibVersion < EVP_sha512_256_introduced then + begin + {$if declared(FC_EVP_sha512_256)} + EVP_sha512_256 := @FC_EVP_sha512_256; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_sha512_256_removed)} + if EVP_sha512_256_removed <= LibVersion then + begin + {$if declared(_EVP_sha512_256)} + EVP_sha512_256 := @_EVP_sha512_256; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_sha512_256_allownil)} + if FuncLoadError then + AFailed.Add('EVP_sha512_256'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_sha3_224 := LoadLibFunction(ADllHandle, EVP_sha3_224_procname); + FuncLoadError := not assigned(EVP_sha3_224); + if FuncLoadError then + begin + {$if not defined(EVP_sha3_224_allownil)} + EVP_sha3_224 := @ERR_EVP_sha3_224; + {$ifend} + {$if declared(EVP_sha3_224_introduced)} + if LibVersion < EVP_sha3_224_introduced then + begin + {$if declared(FC_EVP_sha3_224)} + EVP_sha3_224 := @FC_EVP_sha3_224; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_sha3_224_removed)} + if EVP_sha3_224_removed <= LibVersion then + begin + {$if declared(_EVP_sha3_224)} + EVP_sha3_224 := @_EVP_sha3_224; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_sha3_224_allownil)} + if FuncLoadError then + AFailed.Add('EVP_sha3_224'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_sha3_256 := LoadLibFunction(ADllHandle, EVP_sha3_256_procname); + FuncLoadError := not assigned(EVP_sha3_256); + if FuncLoadError then + begin + {$if not defined(EVP_sha3_256_allownil)} + EVP_sha3_256 := @ERR_EVP_sha3_256; + {$ifend} + {$if declared(EVP_sha3_256_introduced)} + if LibVersion < EVP_sha3_256_introduced then + begin + {$if declared(FC_EVP_sha3_256)} + EVP_sha3_256 := @FC_EVP_sha3_256; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_sha3_256_removed)} + if EVP_sha3_256_removed <= LibVersion then + begin + {$if declared(_EVP_sha3_256)} + EVP_sha3_256 := @_EVP_sha3_256; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_sha3_256_allownil)} + if FuncLoadError then + AFailed.Add('EVP_sha3_256'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_sha3_384 := LoadLibFunction(ADllHandle, EVP_sha3_384_procname); + FuncLoadError := not assigned(EVP_sha3_384); + if FuncLoadError then + begin + {$if not defined(EVP_sha3_384_allownil)} + EVP_sha3_384 := @ERR_EVP_sha3_384; + {$ifend} + {$if declared(EVP_sha3_384_introduced)} + if LibVersion < EVP_sha3_384_introduced then + begin + {$if declared(FC_EVP_sha3_384)} + EVP_sha3_384 := @FC_EVP_sha3_384; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_sha3_384_removed)} + if EVP_sha3_384_removed <= LibVersion then + begin + {$if declared(_EVP_sha3_384)} + EVP_sha3_384 := @_EVP_sha3_384; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_sha3_384_allownil)} + if FuncLoadError then + AFailed.Add('EVP_sha3_384'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_sha3_512 := LoadLibFunction(ADllHandle, EVP_sha3_512_procname); + FuncLoadError := not assigned(EVP_sha3_512); + if FuncLoadError then + begin + {$if not defined(EVP_sha3_512_allownil)} + EVP_sha3_512 := @ERR_EVP_sha3_512; + {$ifend} + {$if declared(EVP_sha3_512_introduced)} + if LibVersion < EVP_sha3_512_introduced then + begin + {$if declared(FC_EVP_sha3_512)} + EVP_sha3_512 := @FC_EVP_sha3_512; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_sha3_512_removed)} + if EVP_sha3_512_removed <= LibVersion then + begin + {$if declared(_EVP_sha3_512)} + EVP_sha3_512 := @_EVP_sha3_512; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_sha3_512_allownil)} + if FuncLoadError then + AFailed.Add('EVP_sha3_512'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_shake128 := LoadLibFunction(ADllHandle, EVP_shake128_procname); + FuncLoadError := not assigned(EVP_shake128); + if FuncLoadError then + begin + {$if not defined(EVP_shake128_allownil)} + EVP_shake128 := @ERR_EVP_shake128; + {$ifend} + {$if declared(EVP_shake128_introduced)} + if LibVersion < EVP_shake128_introduced then + begin + {$if declared(FC_EVP_shake128)} + EVP_shake128 := @FC_EVP_shake128; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_shake128_removed)} + if EVP_shake128_removed <= LibVersion then + begin + {$if declared(_EVP_shake128)} + EVP_shake128 := @_EVP_shake128; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_shake128_allownil)} + if FuncLoadError then + AFailed.Add('EVP_shake128'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_shake256 := LoadLibFunction(ADllHandle, EVP_shake256_procname); + FuncLoadError := not assigned(EVP_shake256); + if FuncLoadError then + begin + {$if not defined(EVP_shake256_allownil)} + EVP_shake256 := @ERR_EVP_shake256; + {$ifend} + {$if declared(EVP_shake256_introduced)} + if LibVersion < EVP_shake256_introduced then + begin + {$if declared(FC_EVP_shake256)} + EVP_shake256 := @FC_EVP_shake256; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_shake256_removed)} + if EVP_shake256_removed <= LibVersion then + begin + {$if declared(_EVP_shake256)} + EVP_shake256 := @_EVP_shake256; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_shake256_allownil)} + if FuncLoadError then + AFailed.Add('EVP_shake256'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_enc_null := LoadLibFunction(ADllHandle, EVP_enc_null_procname); + FuncLoadError := not assigned(EVP_enc_null); + if FuncLoadError then + begin + {$if not defined(EVP_enc_null_allownil)} + EVP_enc_null := @ERR_EVP_enc_null; + {$ifend} + {$if declared(EVP_enc_null_introduced)} + if LibVersion < EVP_enc_null_introduced then + begin + {$if declared(FC_EVP_enc_null)} + EVP_enc_null := @FC_EVP_enc_null; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_enc_null_removed)} + if EVP_enc_null_removed <= LibVersion then + begin + {$if declared(_EVP_enc_null)} + EVP_enc_null := @_EVP_enc_null; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_enc_null_allownil)} + if FuncLoadError then + AFailed.Add('EVP_enc_null'); + {$ifend} + end; + + + EVP_des_ecb := LoadLibFunction(ADllHandle, EVP_des_ecb_procname); + FuncLoadError := not assigned(EVP_des_ecb); + if FuncLoadError then + begin + {$if not defined(EVP_des_ecb_allownil)} + EVP_des_ecb := @ERR_EVP_des_ecb; + {$ifend} + {$if declared(EVP_des_ecb_introduced)} + if LibVersion < EVP_des_ecb_introduced then + begin + {$if declared(FC_EVP_des_ecb)} + EVP_des_ecb := @FC_EVP_des_ecb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_des_ecb_removed)} + if EVP_des_ecb_removed <= LibVersion then + begin + {$if declared(_EVP_des_ecb)} + EVP_des_ecb := @_EVP_des_ecb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_des_ecb_allownil)} + if FuncLoadError then + AFailed.Add('EVP_des_ecb'); + {$ifend} + end; + + + EVP_des_ede := LoadLibFunction(ADllHandle, EVP_des_ede_procname); + FuncLoadError := not assigned(EVP_des_ede); + if FuncLoadError then + begin + {$if not defined(EVP_des_ede_allownil)} + EVP_des_ede := @ERR_EVP_des_ede; + {$ifend} + {$if declared(EVP_des_ede_introduced)} + if LibVersion < EVP_des_ede_introduced then + begin + {$if declared(FC_EVP_des_ede)} + EVP_des_ede := @FC_EVP_des_ede; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_des_ede_removed)} + if EVP_des_ede_removed <= LibVersion then + begin + {$if declared(_EVP_des_ede)} + EVP_des_ede := @_EVP_des_ede; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_des_ede_allownil)} + if FuncLoadError then + AFailed.Add('EVP_des_ede'); + {$ifend} + end; + + + EVP_des_ede3 := LoadLibFunction(ADllHandle, EVP_des_ede3_procname); + FuncLoadError := not assigned(EVP_des_ede3); + if FuncLoadError then + begin + {$if not defined(EVP_des_ede3_allownil)} + EVP_des_ede3 := @ERR_EVP_des_ede3; + {$ifend} + {$if declared(EVP_des_ede3_introduced)} + if LibVersion < EVP_des_ede3_introduced then + begin + {$if declared(FC_EVP_des_ede3)} + EVP_des_ede3 := @FC_EVP_des_ede3; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_des_ede3_removed)} + if EVP_des_ede3_removed <= LibVersion then + begin + {$if declared(_EVP_des_ede3)} + EVP_des_ede3 := @_EVP_des_ede3; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_des_ede3_allownil)} + if FuncLoadError then + AFailed.Add('EVP_des_ede3'); + {$ifend} + end; + + + EVP_des_ede_ecb := LoadLibFunction(ADllHandle, EVP_des_ede_ecb_procname); + FuncLoadError := not assigned(EVP_des_ede_ecb); + if FuncLoadError then + begin + {$if not defined(EVP_des_ede_ecb_allownil)} + EVP_des_ede_ecb := @ERR_EVP_des_ede_ecb; + {$ifend} + {$if declared(EVP_des_ede_ecb_introduced)} + if LibVersion < EVP_des_ede_ecb_introduced then + begin + {$if declared(FC_EVP_des_ede_ecb)} + EVP_des_ede_ecb := @FC_EVP_des_ede_ecb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_des_ede_ecb_removed)} + if EVP_des_ede_ecb_removed <= LibVersion then + begin + {$if declared(_EVP_des_ede_ecb)} + EVP_des_ede_ecb := @_EVP_des_ede_ecb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_des_ede_ecb_allownil)} + if FuncLoadError then + AFailed.Add('EVP_des_ede_ecb'); + {$ifend} + end; + + + EVP_des_ede3_ecb := LoadLibFunction(ADllHandle, EVP_des_ede3_ecb_procname); + FuncLoadError := not assigned(EVP_des_ede3_ecb); + if FuncLoadError then + begin + {$if not defined(EVP_des_ede3_ecb_allownil)} + EVP_des_ede3_ecb := @ERR_EVP_des_ede3_ecb; + {$ifend} + {$if declared(EVP_des_ede3_ecb_introduced)} + if LibVersion < EVP_des_ede3_ecb_introduced then + begin + {$if declared(FC_EVP_des_ede3_ecb)} + EVP_des_ede3_ecb := @FC_EVP_des_ede3_ecb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_des_ede3_ecb_removed)} + if EVP_des_ede3_ecb_removed <= LibVersion then + begin + {$if declared(_EVP_des_ede3_ecb)} + EVP_des_ede3_ecb := @_EVP_des_ede3_ecb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_des_ede3_ecb_allownil)} + if FuncLoadError then + AFailed.Add('EVP_des_ede3_ecb'); + {$ifend} + end; + + + EVP_des_cfb64 := LoadLibFunction(ADllHandle, EVP_des_cfb64_procname); + FuncLoadError := not assigned(EVP_des_cfb64); + if FuncLoadError then + begin + {$if not defined(EVP_des_cfb64_allownil)} + EVP_des_cfb64 := @ERR_EVP_des_cfb64; + {$ifend} + {$if declared(EVP_des_cfb64_introduced)} + if LibVersion < EVP_des_cfb64_introduced then + begin + {$if declared(FC_EVP_des_cfb64)} + EVP_des_cfb64 := @FC_EVP_des_cfb64; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_des_cfb64_removed)} + if EVP_des_cfb64_removed <= LibVersion then + begin + {$if declared(_EVP_des_cfb64)} + EVP_des_cfb64 := @_EVP_des_cfb64; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_des_cfb64_allownil)} + if FuncLoadError then + AFailed.Add('EVP_des_cfb64'); + {$ifend} + end; + + + EVP_des_cfb1 := LoadLibFunction(ADllHandle, EVP_des_cfb1_procname); + FuncLoadError := not assigned(EVP_des_cfb1); + if FuncLoadError then + begin + {$if not defined(EVP_des_cfb1_allownil)} + EVP_des_cfb1 := @ERR_EVP_des_cfb1; + {$ifend} + {$if declared(EVP_des_cfb1_introduced)} + if LibVersion < EVP_des_cfb1_introduced then + begin + {$if declared(FC_EVP_des_cfb1)} + EVP_des_cfb1 := @FC_EVP_des_cfb1; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_des_cfb1_removed)} + if EVP_des_cfb1_removed <= LibVersion then + begin + {$if declared(_EVP_des_cfb1)} + EVP_des_cfb1 := @_EVP_des_cfb1; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_des_cfb1_allownil)} + if FuncLoadError then + AFailed.Add('EVP_des_cfb1'); + {$ifend} + end; + + + EVP_des_cfb8 := LoadLibFunction(ADllHandle, EVP_des_cfb8_procname); + FuncLoadError := not assigned(EVP_des_cfb8); + if FuncLoadError then + begin + {$if not defined(EVP_des_cfb8_allownil)} + EVP_des_cfb8 := @ERR_EVP_des_cfb8; + {$ifend} + {$if declared(EVP_des_cfb8_introduced)} + if LibVersion < EVP_des_cfb8_introduced then + begin + {$if declared(FC_EVP_des_cfb8)} + EVP_des_cfb8 := @FC_EVP_des_cfb8; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_des_cfb8_removed)} + if EVP_des_cfb8_removed <= LibVersion then + begin + {$if declared(_EVP_des_cfb8)} + EVP_des_cfb8 := @_EVP_des_cfb8; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_des_cfb8_allownil)} + if FuncLoadError then + AFailed.Add('EVP_des_cfb8'); + {$ifend} + end; + + + EVP_des_ede_cfb64 := LoadLibFunction(ADllHandle, EVP_des_ede_cfb64_procname); + FuncLoadError := not assigned(EVP_des_ede_cfb64); + if FuncLoadError then + begin + {$if not defined(EVP_des_ede_cfb64_allownil)} + EVP_des_ede_cfb64 := @ERR_EVP_des_ede_cfb64; + {$ifend} + {$if declared(EVP_des_ede_cfb64_introduced)} + if LibVersion < EVP_des_ede_cfb64_introduced then + begin + {$if declared(FC_EVP_des_ede_cfb64)} + EVP_des_ede_cfb64 := @FC_EVP_des_ede_cfb64; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_des_ede_cfb64_removed)} + if EVP_des_ede_cfb64_removed <= LibVersion then + begin + {$if declared(_EVP_des_ede_cfb64)} + EVP_des_ede_cfb64 := @_EVP_des_ede_cfb64; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_des_ede_cfb64_allownil)} + if FuncLoadError then + AFailed.Add('EVP_des_ede_cfb64'); + {$ifend} + end; + + + EVP_des_ede3_cfb64 := LoadLibFunction(ADllHandle, EVP_des_ede3_cfb64_procname); + FuncLoadError := not assigned(EVP_des_ede3_cfb64); + if FuncLoadError then + begin + {$if not defined(EVP_des_ede3_cfb64_allownil)} + EVP_des_ede3_cfb64 := @ERR_EVP_des_ede3_cfb64; + {$ifend} + {$if declared(EVP_des_ede3_cfb64_introduced)} + if LibVersion < EVP_des_ede3_cfb64_introduced then + begin + {$if declared(FC_EVP_des_ede3_cfb64)} + EVP_des_ede3_cfb64 := @FC_EVP_des_ede3_cfb64; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_des_ede3_cfb64_removed)} + if EVP_des_ede3_cfb64_removed <= LibVersion then + begin + {$if declared(_EVP_des_ede3_cfb64)} + EVP_des_ede3_cfb64 := @_EVP_des_ede3_cfb64; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_des_ede3_cfb64_allownil)} + if FuncLoadError then + AFailed.Add('EVP_des_ede3_cfb64'); + {$ifend} + end; + + + EVP_des_ede3_cfb1 := LoadLibFunction(ADllHandle, EVP_des_ede3_cfb1_procname); + FuncLoadError := not assigned(EVP_des_ede3_cfb1); + if FuncLoadError then + begin + {$if not defined(EVP_des_ede3_cfb1_allownil)} + EVP_des_ede3_cfb1 := @ERR_EVP_des_ede3_cfb1; + {$ifend} + {$if declared(EVP_des_ede3_cfb1_introduced)} + if LibVersion < EVP_des_ede3_cfb1_introduced then + begin + {$if declared(FC_EVP_des_ede3_cfb1)} + EVP_des_ede3_cfb1 := @FC_EVP_des_ede3_cfb1; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_des_ede3_cfb1_removed)} + if EVP_des_ede3_cfb1_removed <= LibVersion then + begin + {$if declared(_EVP_des_ede3_cfb1)} + EVP_des_ede3_cfb1 := @_EVP_des_ede3_cfb1; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_des_ede3_cfb1_allownil)} + if FuncLoadError then + AFailed.Add('EVP_des_ede3_cfb1'); + {$ifend} + end; + + + EVP_des_ede3_cfb8 := LoadLibFunction(ADllHandle, EVP_des_ede3_cfb8_procname); + FuncLoadError := not assigned(EVP_des_ede3_cfb8); + if FuncLoadError then + begin + {$if not defined(EVP_des_ede3_cfb8_allownil)} + EVP_des_ede3_cfb8 := @ERR_EVP_des_ede3_cfb8; + {$ifend} + {$if declared(EVP_des_ede3_cfb8_introduced)} + if LibVersion < EVP_des_ede3_cfb8_introduced then + begin + {$if declared(FC_EVP_des_ede3_cfb8)} + EVP_des_ede3_cfb8 := @FC_EVP_des_ede3_cfb8; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_des_ede3_cfb8_removed)} + if EVP_des_ede3_cfb8_removed <= LibVersion then + begin + {$if declared(_EVP_des_ede3_cfb8)} + EVP_des_ede3_cfb8 := @_EVP_des_ede3_cfb8; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_des_ede3_cfb8_allownil)} + if FuncLoadError then + AFailed.Add('EVP_des_ede3_cfb8'); + {$ifend} + end; + + + EVP_des_ofb := LoadLibFunction(ADllHandle, EVP_des_ofb_procname); + FuncLoadError := not assigned(EVP_des_ofb); + if FuncLoadError then + begin + {$if not defined(EVP_des_ofb_allownil)} + EVP_des_ofb := @ERR_EVP_des_ofb; + {$ifend} + {$if declared(EVP_des_ofb_introduced)} + if LibVersion < EVP_des_ofb_introduced then + begin + {$if declared(FC_EVP_des_ofb)} + EVP_des_ofb := @FC_EVP_des_ofb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_des_ofb_removed)} + if EVP_des_ofb_removed <= LibVersion then + begin + {$if declared(_EVP_des_ofb)} + EVP_des_ofb := @_EVP_des_ofb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_des_ofb_allownil)} + if FuncLoadError then + AFailed.Add('EVP_des_ofb'); + {$ifend} + end; + + + EVP_des_ede_ofb := LoadLibFunction(ADllHandle, EVP_des_ede_ofb_procname); + FuncLoadError := not assigned(EVP_des_ede_ofb); + if FuncLoadError then + begin + {$if not defined(EVP_des_ede_ofb_allownil)} + EVP_des_ede_ofb := @ERR_EVP_des_ede_ofb; + {$ifend} + {$if declared(EVP_des_ede_ofb_introduced)} + if LibVersion < EVP_des_ede_ofb_introduced then + begin + {$if declared(FC_EVP_des_ede_ofb)} + EVP_des_ede_ofb := @FC_EVP_des_ede_ofb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_des_ede_ofb_removed)} + if EVP_des_ede_ofb_removed <= LibVersion then + begin + {$if declared(_EVP_des_ede_ofb)} + EVP_des_ede_ofb := @_EVP_des_ede_ofb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_des_ede_ofb_allownil)} + if FuncLoadError then + AFailed.Add('EVP_des_ede_ofb'); + {$ifend} + end; + + + EVP_des_ede3_ofb := LoadLibFunction(ADllHandle, EVP_des_ede3_ofb_procname); + FuncLoadError := not assigned(EVP_des_ede3_ofb); + if FuncLoadError then + begin + {$if not defined(EVP_des_ede3_ofb_allownil)} + EVP_des_ede3_ofb := @ERR_EVP_des_ede3_ofb; + {$ifend} + {$if declared(EVP_des_ede3_ofb_introduced)} + if LibVersion < EVP_des_ede3_ofb_introduced then + begin + {$if declared(FC_EVP_des_ede3_ofb)} + EVP_des_ede3_ofb := @FC_EVP_des_ede3_ofb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_des_ede3_ofb_removed)} + if EVP_des_ede3_ofb_removed <= LibVersion then + begin + {$if declared(_EVP_des_ede3_ofb)} + EVP_des_ede3_ofb := @_EVP_des_ede3_ofb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_des_ede3_ofb_allownil)} + if FuncLoadError then + AFailed.Add('EVP_des_ede3_ofb'); + {$ifend} + end; + + + EVP_des_cbc := LoadLibFunction(ADllHandle, EVP_des_cbc_procname); + FuncLoadError := not assigned(EVP_des_cbc); + if FuncLoadError then + begin + {$if not defined(EVP_des_cbc_allownil)} + EVP_des_cbc := @ERR_EVP_des_cbc; + {$ifend} + {$if declared(EVP_des_cbc_introduced)} + if LibVersion < EVP_des_cbc_introduced then + begin + {$if declared(FC_EVP_des_cbc)} + EVP_des_cbc := @FC_EVP_des_cbc; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_des_cbc_removed)} + if EVP_des_cbc_removed <= LibVersion then + begin + {$if declared(_EVP_des_cbc)} + EVP_des_cbc := @_EVP_des_cbc; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_des_cbc_allownil)} + if FuncLoadError then + AFailed.Add('EVP_des_cbc'); + {$ifend} + end; + + + EVP_des_ede_cbc := LoadLibFunction(ADllHandle, EVP_des_ede_cbc_procname); + FuncLoadError := not assigned(EVP_des_ede_cbc); + if FuncLoadError then + begin + {$if not defined(EVP_des_ede_cbc_allownil)} + EVP_des_ede_cbc := @ERR_EVP_des_ede_cbc; + {$ifend} + {$if declared(EVP_des_ede_cbc_introduced)} + if LibVersion < EVP_des_ede_cbc_introduced then + begin + {$if declared(FC_EVP_des_ede_cbc)} + EVP_des_ede_cbc := @FC_EVP_des_ede_cbc; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_des_ede_cbc_removed)} + if EVP_des_ede_cbc_removed <= LibVersion then + begin + {$if declared(_EVP_des_ede_cbc)} + EVP_des_ede_cbc := @_EVP_des_ede_cbc; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_des_ede_cbc_allownil)} + if FuncLoadError then + AFailed.Add('EVP_des_ede_cbc'); + {$ifend} + end; + + + EVP_des_ede3_cbc := LoadLibFunction(ADllHandle, EVP_des_ede3_cbc_procname); + FuncLoadError := not assigned(EVP_des_ede3_cbc); + if FuncLoadError then + begin + {$if not defined(EVP_des_ede3_cbc_allownil)} + EVP_des_ede3_cbc := @ERR_EVP_des_ede3_cbc; + {$ifend} + {$if declared(EVP_des_ede3_cbc_introduced)} + if LibVersion < EVP_des_ede3_cbc_introduced then + begin + {$if declared(FC_EVP_des_ede3_cbc)} + EVP_des_ede3_cbc := @FC_EVP_des_ede3_cbc; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_des_ede3_cbc_removed)} + if EVP_des_ede3_cbc_removed <= LibVersion then + begin + {$if declared(_EVP_des_ede3_cbc)} + EVP_des_ede3_cbc := @_EVP_des_ede3_cbc; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_des_ede3_cbc_allownil)} + if FuncLoadError then + AFailed.Add('EVP_des_ede3_cbc'); + {$ifend} + end; + + + EVP_desx_cbc := LoadLibFunction(ADllHandle, EVP_desx_cbc_procname); + FuncLoadError := not assigned(EVP_desx_cbc); + if FuncLoadError then + begin + {$if not defined(EVP_desx_cbc_allownil)} + EVP_desx_cbc := @ERR_EVP_desx_cbc; + {$ifend} + {$if declared(EVP_desx_cbc_introduced)} + if LibVersion < EVP_desx_cbc_introduced then + begin + {$if declared(FC_EVP_desx_cbc)} + EVP_desx_cbc := @FC_EVP_desx_cbc; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_desx_cbc_removed)} + if EVP_desx_cbc_removed <= LibVersion then + begin + {$if declared(_EVP_desx_cbc)} + EVP_desx_cbc := @_EVP_desx_cbc; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_desx_cbc_allownil)} + if FuncLoadError then + AFailed.Add('EVP_desx_cbc'); + {$ifend} + end; + + + EVP_des_ede3_wrap := LoadLibFunction(ADllHandle, EVP_des_ede3_wrap_procname); + FuncLoadError := not assigned(EVP_des_ede3_wrap); + if FuncLoadError then + begin + {$if not defined(EVP_des_ede3_wrap_allownil)} + EVP_des_ede3_wrap := @ERR_EVP_des_ede3_wrap; + {$ifend} + {$if declared(EVP_des_ede3_wrap_introduced)} + if LibVersion < EVP_des_ede3_wrap_introduced then + begin + {$if declared(FC_EVP_des_ede3_wrap)} + EVP_des_ede3_wrap := @FC_EVP_des_ede3_wrap; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_des_ede3_wrap_removed)} + if EVP_des_ede3_wrap_removed <= LibVersion then + begin + {$if declared(_EVP_des_ede3_wrap)} + EVP_des_ede3_wrap := @_EVP_des_ede3_wrap; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_des_ede3_wrap_allownil)} + if FuncLoadError then + AFailed.Add('EVP_des_ede3_wrap'); + {$ifend} + end; + + + EVP_rc4 := LoadLibFunction(ADllHandle, EVP_rc4_procname); + FuncLoadError := not assigned(EVP_rc4); + if FuncLoadError then + begin + {$if not defined(EVP_rc4_allownil)} + EVP_rc4 := @ERR_EVP_rc4; + {$ifend} + {$if declared(EVP_rc4_introduced)} + if LibVersion < EVP_rc4_introduced then + begin + {$if declared(FC_EVP_rc4)} + EVP_rc4 := @FC_EVP_rc4; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_rc4_removed)} + if EVP_rc4_removed <= LibVersion then + begin + {$if declared(_EVP_rc4)} + EVP_rc4 := @_EVP_rc4; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_rc4_allownil)} + if FuncLoadError then + AFailed.Add('EVP_rc4'); + {$ifend} + end; + + + EVP_rc4_40 := LoadLibFunction(ADllHandle, EVP_rc4_40_procname); + FuncLoadError := not assigned(EVP_rc4_40); + if FuncLoadError then + begin + {$if not defined(EVP_rc4_40_allownil)} + EVP_rc4_40 := @ERR_EVP_rc4_40; + {$ifend} + {$if declared(EVP_rc4_40_introduced)} + if LibVersion < EVP_rc4_40_introduced then + begin + {$if declared(FC_EVP_rc4_40)} + EVP_rc4_40 := @FC_EVP_rc4_40; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_rc4_40_removed)} + if EVP_rc4_40_removed <= LibVersion then + begin + {$if declared(_EVP_rc4_40)} + EVP_rc4_40 := @_EVP_rc4_40; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_rc4_40_allownil)} + if FuncLoadError then + AFailed.Add('EVP_rc4_40'); + {$ifend} + end; + + + EVP_rc2_ecb := LoadLibFunction(ADllHandle, EVP_rc2_ecb_procname); + FuncLoadError := not assigned(EVP_rc2_ecb); + if FuncLoadError then + begin + {$if not defined(EVP_rc2_ecb_allownil)} + EVP_rc2_ecb := @ERR_EVP_rc2_ecb; + {$ifend} + {$if declared(EVP_rc2_ecb_introduced)} + if LibVersion < EVP_rc2_ecb_introduced then + begin + {$if declared(FC_EVP_rc2_ecb)} + EVP_rc2_ecb := @FC_EVP_rc2_ecb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_rc2_ecb_removed)} + if EVP_rc2_ecb_removed <= LibVersion then + begin + {$if declared(_EVP_rc2_ecb)} + EVP_rc2_ecb := @_EVP_rc2_ecb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_rc2_ecb_allownil)} + if FuncLoadError then + AFailed.Add('EVP_rc2_ecb'); + {$ifend} + end; + + + EVP_rc2_cbc := LoadLibFunction(ADllHandle, EVP_rc2_cbc_procname); + FuncLoadError := not assigned(EVP_rc2_cbc); + if FuncLoadError then + begin + {$if not defined(EVP_rc2_cbc_allownil)} + EVP_rc2_cbc := @ERR_EVP_rc2_cbc; + {$ifend} + {$if declared(EVP_rc2_cbc_introduced)} + if LibVersion < EVP_rc2_cbc_introduced then + begin + {$if declared(FC_EVP_rc2_cbc)} + EVP_rc2_cbc := @FC_EVP_rc2_cbc; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_rc2_cbc_removed)} + if EVP_rc2_cbc_removed <= LibVersion then + begin + {$if declared(_EVP_rc2_cbc)} + EVP_rc2_cbc := @_EVP_rc2_cbc; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_rc2_cbc_allownil)} + if FuncLoadError then + AFailed.Add('EVP_rc2_cbc'); + {$ifend} + end; + + + EVP_rc2_40_cbc := LoadLibFunction(ADllHandle, EVP_rc2_40_cbc_procname); + FuncLoadError := not assigned(EVP_rc2_40_cbc); + if FuncLoadError then + begin + {$if not defined(EVP_rc2_40_cbc_allownil)} + EVP_rc2_40_cbc := @ERR_EVP_rc2_40_cbc; + {$ifend} + {$if declared(EVP_rc2_40_cbc_introduced)} + if LibVersion < EVP_rc2_40_cbc_introduced then + begin + {$if declared(FC_EVP_rc2_40_cbc)} + EVP_rc2_40_cbc := @FC_EVP_rc2_40_cbc; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_rc2_40_cbc_removed)} + if EVP_rc2_40_cbc_removed <= LibVersion then + begin + {$if declared(_EVP_rc2_40_cbc)} + EVP_rc2_40_cbc := @_EVP_rc2_40_cbc; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_rc2_40_cbc_allownil)} + if FuncLoadError then + AFailed.Add('EVP_rc2_40_cbc'); + {$ifend} + end; + + + EVP_rc2_64_cbc := LoadLibFunction(ADllHandle, EVP_rc2_64_cbc_procname); + FuncLoadError := not assigned(EVP_rc2_64_cbc); + if FuncLoadError then + begin + {$if not defined(EVP_rc2_64_cbc_allownil)} + EVP_rc2_64_cbc := @ERR_EVP_rc2_64_cbc; + {$ifend} + {$if declared(EVP_rc2_64_cbc_introduced)} + if LibVersion < EVP_rc2_64_cbc_introduced then + begin + {$if declared(FC_EVP_rc2_64_cbc)} + EVP_rc2_64_cbc := @FC_EVP_rc2_64_cbc; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_rc2_64_cbc_removed)} + if EVP_rc2_64_cbc_removed <= LibVersion then + begin + {$if declared(_EVP_rc2_64_cbc)} + EVP_rc2_64_cbc := @_EVP_rc2_64_cbc; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_rc2_64_cbc_allownil)} + if FuncLoadError then + AFailed.Add('EVP_rc2_64_cbc'); + {$ifend} + end; + + + EVP_rc2_cfb64 := LoadLibFunction(ADllHandle, EVP_rc2_cfb64_procname); + FuncLoadError := not assigned(EVP_rc2_cfb64); + if FuncLoadError then + begin + {$if not defined(EVP_rc2_cfb64_allownil)} + EVP_rc2_cfb64 := @ERR_EVP_rc2_cfb64; + {$ifend} + {$if declared(EVP_rc2_cfb64_introduced)} + if LibVersion < EVP_rc2_cfb64_introduced then + begin + {$if declared(FC_EVP_rc2_cfb64)} + EVP_rc2_cfb64 := @FC_EVP_rc2_cfb64; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_rc2_cfb64_removed)} + if EVP_rc2_cfb64_removed <= LibVersion then + begin + {$if declared(_EVP_rc2_cfb64)} + EVP_rc2_cfb64 := @_EVP_rc2_cfb64; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_rc2_cfb64_allownil)} + if FuncLoadError then + AFailed.Add('EVP_rc2_cfb64'); + {$ifend} + end; + + + EVP_rc2_ofb := LoadLibFunction(ADllHandle, EVP_rc2_ofb_procname); + FuncLoadError := not assigned(EVP_rc2_ofb); + if FuncLoadError then + begin + {$if not defined(EVP_rc2_ofb_allownil)} + EVP_rc2_ofb := @ERR_EVP_rc2_ofb; + {$ifend} + {$if declared(EVP_rc2_ofb_introduced)} + if LibVersion < EVP_rc2_ofb_introduced then + begin + {$if declared(FC_EVP_rc2_ofb)} + EVP_rc2_ofb := @FC_EVP_rc2_ofb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_rc2_ofb_removed)} + if EVP_rc2_ofb_removed <= LibVersion then + begin + {$if declared(_EVP_rc2_ofb)} + EVP_rc2_ofb := @_EVP_rc2_ofb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_rc2_ofb_allownil)} + if FuncLoadError then + AFailed.Add('EVP_rc2_ofb'); + {$ifend} + end; + + + EVP_bf_ecb := LoadLibFunction(ADllHandle, EVP_bf_ecb_procname); + FuncLoadError := not assigned(EVP_bf_ecb); + if FuncLoadError then + begin + {$if not defined(EVP_bf_ecb_allownil)} + EVP_bf_ecb := @ERR_EVP_bf_ecb; + {$ifend} + {$if declared(EVP_bf_ecb_introduced)} + if LibVersion < EVP_bf_ecb_introduced then + begin + {$if declared(FC_EVP_bf_ecb)} + EVP_bf_ecb := @FC_EVP_bf_ecb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_bf_ecb_removed)} + if EVP_bf_ecb_removed <= LibVersion then + begin + {$if declared(_EVP_bf_ecb)} + EVP_bf_ecb := @_EVP_bf_ecb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_bf_ecb_allownil)} + if FuncLoadError then + AFailed.Add('EVP_bf_ecb'); + {$ifend} + end; + + + EVP_bf_cbc := LoadLibFunction(ADllHandle, EVP_bf_cbc_procname); + FuncLoadError := not assigned(EVP_bf_cbc); + if FuncLoadError then + begin + {$if not defined(EVP_bf_cbc_allownil)} + EVP_bf_cbc := @ERR_EVP_bf_cbc; + {$ifend} + {$if declared(EVP_bf_cbc_introduced)} + if LibVersion < EVP_bf_cbc_introduced then + begin + {$if declared(FC_EVP_bf_cbc)} + EVP_bf_cbc := @FC_EVP_bf_cbc; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_bf_cbc_removed)} + if EVP_bf_cbc_removed <= LibVersion then + begin + {$if declared(_EVP_bf_cbc)} + EVP_bf_cbc := @_EVP_bf_cbc; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_bf_cbc_allownil)} + if FuncLoadError then + AFailed.Add('EVP_bf_cbc'); + {$ifend} + end; + + + EVP_bf_cfb64 := LoadLibFunction(ADllHandle, EVP_bf_cfb64_procname); + FuncLoadError := not assigned(EVP_bf_cfb64); + if FuncLoadError then + begin + {$if not defined(EVP_bf_cfb64_allownil)} + EVP_bf_cfb64 := @ERR_EVP_bf_cfb64; + {$ifend} + {$if declared(EVP_bf_cfb64_introduced)} + if LibVersion < EVP_bf_cfb64_introduced then + begin + {$if declared(FC_EVP_bf_cfb64)} + EVP_bf_cfb64 := @FC_EVP_bf_cfb64; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_bf_cfb64_removed)} + if EVP_bf_cfb64_removed <= LibVersion then + begin + {$if declared(_EVP_bf_cfb64)} + EVP_bf_cfb64 := @_EVP_bf_cfb64; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_bf_cfb64_allownil)} + if FuncLoadError then + AFailed.Add('EVP_bf_cfb64'); + {$ifend} + end; + + + EVP_bf_ofb := LoadLibFunction(ADllHandle, EVP_bf_ofb_procname); + FuncLoadError := not assigned(EVP_bf_ofb); + if FuncLoadError then + begin + {$if not defined(EVP_bf_ofb_allownil)} + EVP_bf_ofb := @ERR_EVP_bf_ofb; + {$ifend} + {$if declared(EVP_bf_ofb_introduced)} + if LibVersion < EVP_bf_ofb_introduced then + begin + {$if declared(FC_EVP_bf_ofb)} + EVP_bf_ofb := @FC_EVP_bf_ofb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_bf_ofb_removed)} + if EVP_bf_ofb_removed <= LibVersion then + begin + {$if declared(_EVP_bf_ofb)} + EVP_bf_ofb := @_EVP_bf_ofb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_bf_ofb_allownil)} + if FuncLoadError then + AFailed.Add('EVP_bf_ofb'); + {$ifend} + end; + + + EVP_cast5_ecb := LoadLibFunction(ADllHandle, EVP_cast5_ecb_procname); + FuncLoadError := not assigned(EVP_cast5_ecb); + if FuncLoadError then + begin + {$if not defined(EVP_cast5_ecb_allownil)} + EVP_cast5_ecb := @ERR_EVP_cast5_ecb; + {$ifend} + {$if declared(EVP_cast5_ecb_introduced)} + if LibVersion < EVP_cast5_ecb_introduced then + begin + {$if declared(FC_EVP_cast5_ecb)} + EVP_cast5_ecb := @FC_EVP_cast5_ecb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_cast5_ecb_removed)} + if EVP_cast5_ecb_removed <= LibVersion then + begin + {$if declared(_EVP_cast5_ecb)} + EVP_cast5_ecb := @_EVP_cast5_ecb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_cast5_ecb_allownil)} + if FuncLoadError then + AFailed.Add('EVP_cast5_ecb'); + {$ifend} + end; + + + EVP_cast5_cbc := LoadLibFunction(ADllHandle, EVP_cast5_cbc_procname); + FuncLoadError := not assigned(EVP_cast5_cbc); + if FuncLoadError then + begin + {$if not defined(EVP_cast5_cbc_allownil)} + EVP_cast5_cbc := @ERR_EVP_cast5_cbc; + {$ifend} + {$if declared(EVP_cast5_cbc_introduced)} + if LibVersion < EVP_cast5_cbc_introduced then + begin + {$if declared(FC_EVP_cast5_cbc)} + EVP_cast5_cbc := @FC_EVP_cast5_cbc; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_cast5_cbc_removed)} + if EVP_cast5_cbc_removed <= LibVersion then + begin + {$if declared(_EVP_cast5_cbc)} + EVP_cast5_cbc := @_EVP_cast5_cbc; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_cast5_cbc_allownil)} + if FuncLoadError then + AFailed.Add('EVP_cast5_cbc'); + {$ifend} + end; + + + EVP_cast5_cfb64 := LoadLibFunction(ADllHandle, EVP_cast5_cfb64_procname); + FuncLoadError := not assigned(EVP_cast5_cfb64); + if FuncLoadError then + begin + {$if not defined(EVP_cast5_cfb64_allownil)} + EVP_cast5_cfb64 := @ERR_EVP_cast5_cfb64; + {$ifend} + {$if declared(EVP_cast5_cfb64_introduced)} + if LibVersion < EVP_cast5_cfb64_introduced then + begin + {$if declared(FC_EVP_cast5_cfb64)} + EVP_cast5_cfb64 := @FC_EVP_cast5_cfb64; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_cast5_cfb64_removed)} + if EVP_cast5_cfb64_removed <= LibVersion then + begin + {$if declared(_EVP_cast5_cfb64)} + EVP_cast5_cfb64 := @_EVP_cast5_cfb64; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_cast5_cfb64_allownil)} + if FuncLoadError then + AFailed.Add('EVP_cast5_cfb64'); + {$ifend} + end; + + + EVP_cast5_ofb := LoadLibFunction(ADllHandle, EVP_cast5_ofb_procname); + FuncLoadError := not assigned(EVP_cast5_ofb); + if FuncLoadError then + begin + {$if not defined(EVP_cast5_ofb_allownil)} + EVP_cast5_ofb := @ERR_EVP_cast5_ofb; + {$ifend} + {$if declared(EVP_cast5_ofb_introduced)} + if LibVersion < EVP_cast5_ofb_introduced then + begin + {$if declared(FC_EVP_cast5_ofb)} + EVP_cast5_ofb := @FC_EVP_cast5_ofb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_cast5_ofb_removed)} + if EVP_cast5_ofb_removed <= LibVersion then + begin + {$if declared(_EVP_cast5_ofb)} + EVP_cast5_ofb := @_EVP_cast5_ofb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_cast5_ofb_allownil)} + if FuncLoadError then + AFailed.Add('EVP_cast5_ofb'); + {$ifend} + end; + + + EVP_aes_128_ecb := LoadLibFunction(ADllHandle, EVP_aes_128_ecb_procname); + FuncLoadError := not assigned(EVP_aes_128_ecb); + if FuncLoadError then + begin + {$if not defined(EVP_aes_128_ecb_allownil)} + EVP_aes_128_ecb := @ERR_EVP_aes_128_ecb; + {$ifend} + {$if declared(EVP_aes_128_ecb_introduced)} + if LibVersion < EVP_aes_128_ecb_introduced then + begin + {$if declared(FC_EVP_aes_128_ecb)} + EVP_aes_128_ecb := @FC_EVP_aes_128_ecb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_aes_128_ecb_removed)} + if EVP_aes_128_ecb_removed <= LibVersion then + begin + {$if declared(_EVP_aes_128_ecb)} + EVP_aes_128_ecb := @_EVP_aes_128_ecb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_aes_128_ecb_allownil)} + if FuncLoadError then + AFailed.Add('EVP_aes_128_ecb'); + {$ifend} + end; + + + EVP_aes_128_cbc := LoadLibFunction(ADllHandle, EVP_aes_128_cbc_procname); + FuncLoadError := not assigned(EVP_aes_128_cbc); + if FuncLoadError then + begin + {$if not defined(EVP_aes_128_cbc_allownil)} + EVP_aes_128_cbc := @ERR_EVP_aes_128_cbc; + {$ifend} + {$if declared(EVP_aes_128_cbc_introduced)} + if LibVersion < EVP_aes_128_cbc_introduced then + begin + {$if declared(FC_EVP_aes_128_cbc)} + EVP_aes_128_cbc := @FC_EVP_aes_128_cbc; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_aes_128_cbc_removed)} + if EVP_aes_128_cbc_removed <= LibVersion then + begin + {$if declared(_EVP_aes_128_cbc)} + EVP_aes_128_cbc := @_EVP_aes_128_cbc; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_aes_128_cbc_allownil)} + if FuncLoadError then + AFailed.Add('EVP_aes_128_cbc'); + {$ifend} + end; + + + EVP_aes_128_cfb1 := LoadLibFunction(ADllHandle, EVP_aes_128_cfb1_procname); + FuncLoadError := not assigned(EVP_aes_128_cfb1); + if FuncLoadError then + begin + {$if not defined(EVP_aes_128_cfb1_allownil)} + EVP_aes_128_cfb1 := @ERR_EVP_aes_128_cfb1; + {$ifend} + {$if declared(EVP_aes_128_cfb1_introduced)} + if LibVersion < EVP_aes_128_cfb1_introduced then + begin + {$if declared(FC_EVP_aes_128_cfb1)} + EVP_aes_128_cfb1 := @FC_EVP_aes_128_cfb1; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_aes_128_cfb1_removed)} + if EVP_aes_128_cfb1_removed <= LibVersion then + begin + {$if declared(_EVP_aes_128_cfb1)} + EVP_aes_128_cfb1 := @_EVP_aes_128_cfb1; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_aes_128_cfb1_allownil)} + if FuncLoadError then + AFailed.Add('EVP_aes_128_cfb1'); + {$ifend} + end; + + + EVP_aes_128_cfb8 := LoadLibFunction(ADllHandle, EVP_aes_128_cfb8_procname); + FuncLoadError := not assigned(EVP_aes_128_cfb8); + if FuncLoadError then + begin + {$if not defined(EVP_aes_128_cfb8_allownil)} + EVP_aes_128_cfb8 := @ERR_EVP_aes_128_cfb8; + {$ifend} + {$if declared(EVP_aes_128_cfb8_introduced)} + if LibVersion < EVP_aes_128_cfb8_introduced then + begin + {$if declared(FC_EVP_aes_128_cfb8)} + EVP_aes_128_cfb8 := @FC_EVP_aes_128_cfb8; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_aes_128_cfb8_removed)} + if EVP_aes_128_cfb8_removed <= LibVersion then + begin + {$if declared(_EVP_aes_128_cfb8)} + EVP_aes_128_cfb8 := @_EVP_aes_128_cfb8; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_aes_128_cfb8_allownil)} + if FuncLoadError then + AFailed.Add('EVP_aes_128_cfb8'); + {$ifend} + end; + + + EVP_aes_128_cfb128 := LoadLibFunction(ADllHandle, EVP_aes_128_cfb128_procname); + FuncLoadError := not assigned(EVP_aes_128_cfb128); + if FuncLoadError then + begin + {$if not defined(EVP_aes_128_cfb128_allownil)} + EVP_aes_128_cfb128 := @ERR_EVP_aes_128_cfb128; + {$ifend} + {$if declared(EVP_aes_128_cfb128_introduced)} + if LibVersion < EVP_aes_128_cfb128_introduced then + begin + {$if declared(FC_EVP_aes_128_cfb128)} + EVP_aes_128_cfb128 := @FC_EVP_aes_128_cfb128; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_aes_128_cfb128_removed)} + if EVP_aes_128_cfb128_removed <= LibVersion then + begin + {$if declared(_EVP_aes_128_cfb128)} + EVP_aes_128_cfb128 := @_EVP_aes_128_cfb128; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_aes_128_cfb128_allownil)} + if FuncLoadError then + AFailed.Add('EVP_aes_128_cfb128'); + {$ifend} + end; + + + EVP_aes_128_ofb := LoadLibFunction(ADllHandle, EVP_aes_128_ofb_procname); + FuncLoadError := not assigned(EVP_aes_128_ofb); + if FuncLoadError then + begin + {$if not defined(EVP_aes_128_ofb_allownil)} + EVP_aes_128_ofb := @ERR_EVP_aes_128_ofb; + {$ifend} + {$if declared(EVP_aes_128_ofb_introduced)} + if LibVersion < EVP_aes_128_ofb_introduced then + begin + {$if declared(FC_EVP_aes_128_ofb)} + EVP_aes_128_ofb := @FC_EVP_aes_128_ofb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_aes_128_ofb_removed)} + if EVP_aes_128_ofb_removed <= LibVersion then + begin + {$if declared(_EVP_aes_128_ofb)} + EVP_aes_128_ofb := @_EVP_aes_128_ofb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_aes_128_ofb_allownil)} + if FuncLoadError then + AFailed.Add('EVP_aes_128_ofb'); + {$ifend} + end; + + + EVP_aes_128_ctr := LoadLibFunction(ADllHandle, EVP_aes_128_ctr_procname); + FuncLoadError := not assigned(EVP_aes_128_ctr); + if FuncLoadError then + begin + {$if not defined(EVP_aes_128_ctr_allownil)} + EVP_aes_128_ctr := @ERR_EVP_aes_128_ctr; + {$ifend} + {$if declared(EVP_aes_128_ctr_introduced)} + if LibVersion < EVP_aes_128_ctr_introduced then + begin + {$if declared(FC_EVP_aes_128_ctr)} + EVP_aes_128_ctr := @FC_EVP_aes_128_ctr; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_aes_128_ctr_removed)} + if EVP_aes_128_ctr_removed <= LibVersion then + begin + {$if declared(_EVP_aes_128_ctr)} + EVP_aes_128_ctr := @_EVP_aes_128_ctr; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_aes_128_ctr_allownil)} + if FuncLoadError then + AFailed.Add('EVP_aes_128_ctr'); + {$ifend} + end; + + + EVP_aes_128_ccm := LoadLibFunction(ADllHandle, EVP_aes_128_ccm_procname); + FuncLoadError := not assigned(EVP_aes_128_ccm); + if FuncLoadError then + begin + {$if not defined(EVP_aes_128_ccm_allownil)} + EVP_aes_128_ccm := @ERR_EVP_aes_128_ccm; + {$ifend} + {$if declared(EVP_aes_128_ccm_introduced)} + if LibVersion < EVP_aes_128_ccm_introduced then + begin + {$if declared(FC_EVP_aes_128_ccm)} + EVP_aes_128_ccm := @FC_EVP_aes_128_ccm; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_aes_128_ccm_removed)} + if EVP_aes_128_ccm_removed <= LibVersion then + begin + {$if declared(_EVP_aes_128_ccm)} + EVP_aes_128_ccm := @_EVP_aes_128_ccm; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_aes_128_ccm_allownil)} + if FuncLoadError then + AFailed.Add('EVP_aes_128_ccm'); + {$ifend} + end; + + + EVP_aes_128_gcm := LoadLibFunction(ADllHandle, EVP_aes_128_gcm_procname); + FuncLoadError := not assigned(EVP_aes_128_gcm); + if FuncLoadError then + begin + {$if not defined(EVP_aes_128_gcm_allownil)} + EVP_aes_128_gcm := @ERR_EVP_aes_128_gcm; + {$ifend} + {$if declared(EVP_aes_128_gcm_introduced)} + if LibVersion < EVP_aes_128_gcm_introduced then + begin + {$if declared(FC_EVP_aes_128_gcm)} + EVP_aes_128_gcm := @FC_EVP_aes_128_gcm; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_aes_128_gcm_removed)} + if EVP_aes_128_gcm_removed <= LibVersion then + begin + {$if declared(_EVP_aes_128_gcm)} + EVP_aes_128_gcm := @_EVP_aes_128_gcm; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_aes_128_gcm_allownil)} + if FuncLoadError then + AFailed.Add('EVP_aes_128_gcm'); + {$ifend} + end; + + + EVP_aes_128_xts := LoadLibFunction(ADllHandle, EVP_aes_128_xts_procname); + FuncLoadError := not assigned(EVP_aes_128_xts); + if FuncLoadError then + begin + {$if not defined(EVP_aes_128_xts_allownil)} + EVP_aes_128_xts := @ERR_EVP_aes_128_xts; + {$ifend} + {$if declared(EVP_aes_128_xts_introduced)} + if LibVersion < EVP_aes_128_xts_introduced then + begin + {$if declared(FC_EVP_aes_128_xts)} + EVP_aes_128_xts := @FC_EVP_aes_128_xts; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_aes_128_xts_removed)} + if EVP_aes_128_xts_removed <= LibVersion then + begin + {$if declared(_EVP_aes_128_xts)} + EVP_aes_128_xts := @_EVP_aes_128_xts; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_aes_128_xts_allownil)} + if FuncLoadError then + AFailed.Add('EVP_aes_128_xts'); + {$ifend} + end; + + + EVP_aes_128_wrap := LoadLibFunction(ADllHandle, EVP_aes_128_wrap_procname); + FuncLoadError := not assigned(EVP_aes_128_wrap); + if FuncLoadError then + begin + {$if not defined(EVP_aes_128_wrap_allownil)} + EVP_aes_128_wrap := @ERR_EVP_aes_128_wrap; + {$ifend} + {$if declared(EVP_aes_128_wrap_introduced)} + if LibVersion < EVP_aes_128_wrap_introduced then + begin + {$if declared(FC_EVP_aes_128_wrap)} + EVP_aes_128_wrap := @FC_EVP_aes_128_wrap; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_aes_128_wrap_removed)} + if EVP_aes_128_wrap_removed <= LibVersion then + begin + {$if declared(_EVP_aes_128_wrap)} + EVP_aes_128_wrap := @_EVP_aes_128_wrap; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_aes_128_wrap_allownil)} + if FuncLoadError then + AFailed.Add('EVP_aes_128_wrap'); + {$ifend} + end; + + + EVP_aes_128_wrap_pad := LoadLibFunction(ADllHandle, EVP_aes_128_wrap_pad_procname); + FuncLoadError := not assigned(EVP_aes_128_wrap_pad); + if FuncLoadError then + begin + {$if not defined(EVP_aes_128_wrap_pad_allownil)} + EVP_aes_128_wrap_pad := @ERR_EVP_aes_128_wrap_pad; + {$ifend} + {$if declared(EVP_aes_128_wrap_pad_introduced)} + if LibVersion < EVP_aes_128_wrap_pad_introduced then + begin + {$if declared(FC_EVP_aes_128_wrap_pad)} + EVP_aes_128_wrap_pad := @FC_EVP_aes_128_wrap_pad; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_aes_128_wrap_pad_removed)} + if EVP_aes_128_wrap_pad_removed <= LibVersion then + begin + {$if declared(_EVP_aes_128_wrap_pad)} + EVP_aes_128_wrap_pad := @_EVP_aes_128_wrap_pad; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_aes_128_wrap_pad_allownil)} + if FuncLoadError then + AFailed.Add('EVP_aes_128_wrap_pad'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_aes_128_ocb := LoadLibFunction(ADllHandle, EVP_aes_128_ocb_procname); + FuncLoadError := not assigned(EVP_aes_128_ocb); + if FuncLoadError then + begin + {$if not defined(EVP_aes_128_ocb_allownil)} + EVP_aes_128_ocb := @ERR_EVP_aes_128_ocb; + {$ifend} + {$if declared(EVP_aes_128_ocb_introduced)} + if LibVersion < EVP_aes_128_ocb_introduced then + begin + {$if declared(FC_EVP_aes_128_ocb)} + EVP_aes_128_ocb := @FC_EVP_aes_128_ocb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_aes_128_ocb_removed)} + if EVP_aes_128_ocb_removed <= LibVersion then + begin + {$if declared(_EVP_aes_128_ocb)} + EVP_aes_128_ocb := @_EVP_aes_128_ocb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_aes_128_ocb_allownil)} + if FuncLoadError then + AFailed.Add('EVP_aes_128_ocb'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_aes_192_ecb := LoadLibFunction(ADllHandle, EVP_aes_192_ecb_procname); + FuncLoadError := not assigned(EVP_aes_192_ecb); + if FuncLoadError then + begin + {$if not defined(EVP_aes_192_ecb_allownil)} + EVP_aes_192_ecb := @ERR_EVP_aes_192_ecb; + {$ifend} + {$if declared(EVP_aes_192_ecb_introduced)} + if LibVersion < EVP_aes_192_ecb_introduced then + begin + {$if declared(FC_EVP_aes_192_ecb)} + EVP_aes_192_ecb := @FC_EVP_aes_192_ecb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_aes_192_ecb_removed)} + if EVP_aes_192_ecb_removed <= LibVersion then + begin + {$if declared(_EVP_aes_192_ecb)} + EVP_aes_192_ecb := @_EVP_aes_192_ecb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_aes_192_ecb_allownil)} + if FuncLoadError then + AFailed.Add('EVP_aes_192_ecb'); + {$ifend} + end; + + + EVP_aes_192_cbc := LoadLibFunction(ADllHandle, EVP_aes_192_cbc_procname); + FuncLoadError := not assigned(EVP_aes_192_cbc); + if FuncLoadError then + begin + {$if not defined(EVP_aes_192_cbc_allownil)} + EVP_aes_192_cbc := @ERR_EVP_aes_192_cbc; + {$ifend} + {$if declared(EVP_aes_192_cbc_introduced)} + if LibVersion < EVP_aes_192_cbc_introduced then + begin + {$if declared(FC_EVP_aes_192_cbc)} + EVP_aes_192_cbc := @FC_EVP_aes_192_cbc; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_aes_192_cbc_removed)} + if EVP_aes_192_cbc_removed <= LibVersion then + begin + {$if declared(_EVP_aes_192_cbc)} + EVP_aes_192_cbc := @_EVP_aes_192_cbc; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_aes_192_cbc_allownil)} + if FuncLoadError then + AFailed.Add('EVP_aes_192_cbc'); + {$ifend} + end; + + + EVP_aes_192_cfb1 := LoadLibFunction(ADllHandle, EVP_aes_192_cfb1_procname); + FuncLoadError := not assigned(EVP_aes_192_cfb1); + if FuncLoadError then + begin + {$if not defined(EVP_aes_192_cfb1_allownil)} + EVP_aes_192_cfb1 := @ERR_EVP_aes_192_cfb1; + {$ifend} + {$if declared(EVP_aes_192_cfb1_introduced)} + if LibVersion < EVP_aes_192_cfb1_introduced then + begin + {$if declared(FC_EVP_aes_192_cfb1)} + EVP_aes_192_cfb1 := @FC_EVP_aes_192_cfb1; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_aes_192_cfb1_removed)} + if EVP_aes_192_cfb1_removed <= LibVersion then + begin + {$if declared(_EVP_aes_192_cfb1)} + EVP_aes_192_cfb1 := @_EVP_aes_192_cfb1; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_aes_192_cfb1_allownil)} + if FuncLoadError then + AFailed.Add('EVP_aes_192_cfb1'); + {$ifend} + end; + + + EVP_aes_192_cfb8 := LoadLibFunction(ADllHandle, EVP_aes_192_cfb8_procname); + FuncLoadError := not assigned(EVP_aes_192_cfb8); + if FuncLoadError then + begin + {$if not defined(EVP_aes_192_cfb8_allownil)} + EVP_aes_192_cfb8 := @ERR_EVP_aes_192_cfb8; + {$ifend} + {$if declared(EVP_aes_192_cfb8_introduced)} + if LibVersion < EVP_aes_192_cfb8_introduced then + begin + {$if declared(FC_EVP_aes_192_cfb8)} + EVP_aes_192_cfb8 := @FC_EVP_aes_192_cfb8; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_aes_192_cfb8_removed)} + if EVP_aes_192_cfb8_removed <= LibVersion then + begin + {$if declared(_EVP_aes_192_cfb8)} + EVP_aes_192_cfb8 := @_EVP_aes_192_cfb8; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_aes_192_cfb8_allownil)} + if FuncLoadError then + AFailed.Add('EVP_aes_192_cfb8'); + {$ifend} + end; + + + EVP_aes_192_cfb128 := LoadLibFunction(ADllHandle, EVP_aes_192_cfb128_procname); + FuncLoadError := not assigned(EVP_aes_192_cfb128); + if FuncLoadError then + begin + {$if not defined(EVP_aes_192_cfb128_allownil)} + EVP_aes_192_cfb128 := @ERR_EVP_aes_192_cfb128; + {$ifend} + {$if declared(EVP_aes_192_cfb128_introduced)} + if LibVersion < EVP_aes_192_cfb128_introduced then + begin + {$if declared(FC_EVP_aes_192_cfb128)} + EVP_aes_192_cfb128 := @FC_EVP_aes_192_cfb128; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_aes_192_cfb128_removed)} + if EVP_aes_192_cfb128_removed <= LibVersion then + begin + {$if declared(_EVP_aes_192_cfb128)} + EVP_aes_192_cfb128 := @_EVP_aes_192_cfb128; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_aes_192_cfb128_allownil)} + if FuncLoadError then + AFailed.Add('EVP_aes_192_cfb128'); + {$ifend} + end; + + + EVP_aes_192_ofb := LoadLibFunction(ADllHandle, EVP_aes_192_ofb_procname); + FuncLoadError := not assigned(EVP_aes_192_ofb); + if FuncLoadError then + begin + {$if not defined(EVP_aes_192_ofb_allownil)} + EVP_aes_192_ofb := @ERR_EVP_aes_192_ofb; + {$ifend} + {$if declared(EVP_aes_192_ofb_introduced)} + if LibVersion < EVP_aes_192_ofb_introduced then + begin + {$if declared(FC_EVP_aes_192_ofb)} + EVP_aes_192_ofb := @FC_EVP_aes_192_ofb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_aes_192_ofb_removed)} + if EVP_aes_192_ofb_removed <= LibVersion then + begin + {$if declared(_EVP_aes_192_ofb)} + EVP_aes_192_ofb := @_EVP_aes_192_ofb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_aes_192_ofb_allownil)} + if FuncLoadError then + AFailed.Add('EVP_aes_192_ofb'); + {$ifend} + end; + + + EVP_aes_192_ctr := LoadLibFunction(ADllHandle, EVP_aes_192_ctr_procname); + FuncLoadError := not assigned(EVP_aes_192_ctr); + if FuncLoadError then + begin + {$if not defined(EVP_aes_192_ctr_allownil)} + EVP_aes_192_ctr := @ERR_EVP_aes_192_ctr; + {$ifend} + {$if declared(EVP_aes_192_ctr_introduced)} + if LibVersion < EVP_aes_192_ctr_introduced then + begin + {$if declared(FC_EVP_aes_192_ctr)} + EVP_aes_192_ctr := @FC_EVP_aes_192_ctr; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_aes_192_ctr_removed)} + if EVP_aes_192_ctr_removed <= LibVersion then + begin + {$if declared(_EVP_aes_192_ctr)} + EVP_aes_192_ctr := @_EVP_aes_192_ctr; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_aes_192_ctr_allownil)} + if FuncLoadError then + AFailed.Add('EVP_aes_192_ctr'); + {$ifend} + end; + + + EVP_aes_192_ccm := LoadLibFunction(ADllHandle, EVP_aes_192_ccm_procname); + FuncLoadError := not assigned(EVP_aes_192_ccm); + if FuncLoadError then + begin + {$if not defined(EVP_aes_192_ccm_allownil)} + EVP_aes_192_ccm := @ERR_EVP_aes_192_ccm; + {$ifend} + {$if declared(EVP_aes_192_ccm_introduced)} + if LibVersion < EVP_aes_192_ccm_introduced then + begin + {$if declared(FC_EVP_aes_192_ccm)} + EVP_aes_192_ccm := @FC_EVP_aes_192_ccm; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_aes_192_ccm_removed)} + if EVP_aes_192_ccm_removed <= LibVersion then + begin + {$if declared(_EVP_aes_192_ccm)} + EVP_aes_192_ccm := @_EVP_aes_192_ccm; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_aes_192_ccm_allownil)} + if FuncLoadError then + AFailed.Add('EVP_aes_192_ccm'); + {$ifend} + end; + + + EVP_aes_192_gcm := LoadLibFunction(ADllHandle, EVP_aes_192_gcm_procname); + FuncLoadError := not assigned(EVP_aes_192_gcm); + if FuncLoadError then + begin + {$if not defined(EVP_aes_192_gcm_allownil)} + EVP_aes_192_gcm := @ERR_EVP_aes_192_gcm; + {$ifend} + {$if declared(EVP_aes_192_gcm_introduced)} + if LibVersion < EVP_aes_192_gcm_introduced then + begin + {$if declared(FC_EVP_aes_192_gcm)} + EVP_aes_192_gcm := @FC_EVP_aes_192_gcm; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_aes_192_gcm_removed)} + if EVP_aes_192_gcm_removed <= LibVersion then + begin + {$if declared(_EVP_aes_192_gcm)} + EVP_aes_192_gcm := @_EVP_aes_192_gcm; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_aes_192_gcm_allownil)} + if FuncLoadError then + AFailed.Add('EVP_aes_192_gcm'); + {$ifend} + end; + + + EVP_aes_192_wrap := LoadLibFunction(ADllHandle, EVP_aes_192_wrap_procname); + FuncLoadError := not assigned(EVP_aes_192_wrap); + if FuncLoadError then + begin + {$if not defined(EVP_aes_192_wrap_allownil)} + EVP_aes_192_wrap := @ERR_EVP_aes_192_wrap; + {$ifend} + {$if declared(EVP_aes_192_wrap_introduced)} + if LibVersion < EVP_aes_192_wrap_introduced then + begin + {$if declared(FC_EVP_aes_192_wrap)} + EVP_aes_192_wrap := @FC_EVP_aes_192_wrap; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_aes_192_wrap_removed)} + if EVP_aes_192_wrap_removed <= LibVersion then + begin + {$if declared(_EVP_aes_192_wrap)} + EVP_aes_192_wrap := @_EVP_aes_192_wrap; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_aes_192_wrap_allownil)} + if FuncLoadError then + AFailed.Add('EVP_aes_192_wrap'); + {$ifend} + end; + + + EVP_aes_192_wrap_pad := LoadLibFunction(ADllHandle, EVP_aes_192_wrap_pad_procname); + FuncLoadError := not assigned(EVP_aes_192_wrap_pad); + if FuncLoadError then + begin + {$if not defined(EVP_aes_192_wrap_pad_allownil)} + EVP_aes_192_wrap_pad := @ERR_EVP_aes_192_wrap_pad; + {$ifend} + {$if declared(EVP_aes_192_wrap_pad_introduced)} + if LibVersion < EVP_aes_192_wrap_pad_introduced then + begin + {$if declared(FC_EVP_aes_192_wrap_pad)} + EVP_aes_192_wrap_pad := @FC_EVP_aes_192_wrap_pad; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_aes_192_wrap_pad_removed)} + if EVP_aes_192_wrap_pad_removed <= LibVersion then + begin + {$if declared(_EVP_aes_192_wrap_pad)} + EVP_aes_192_wrap_pad := @_EVP_aes_192_wrap_pad; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_aes_192_wrap_pad_allownil)} + if FuncLoadError then + AFailed.Add('EVP_aes_192_wrap_pad'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_aes_192_ocb := LoadLibFunction(ADllHandle, EVP_aes_192_ocb_procname); + FuncLoadError := not assigned(EVP_aes_192_ocb); + if FuncLoadError then + begin + {$if not defined(EVP_aes_192_ocb_allownil)} + EVP_aes_192_ocb := @ERR_EVP_aes_192_ocb; + {$ifend} + {$if declared(EVP_aes_192_ocb_introduced)} + if LibVersion < EVP_aes_192_ocb_introduced then + begin + {$if declared(FC_EVP_aes_192_ocb)} + EVP_aes_192_ocb := @FC_EVP_aes_192_ocb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_aes_192_ocb_removed)} + if EVP_aes_192_ocb_removed <= LibVersion then + begin + {$if declared(_EVP_aes_192_ocb)} + EVP_aes_192_ocb := @_EVP_aes_192_ocb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_aes_192_ocb_allownil)} + if FuncLoadError then + AFailed.Add('EVP_aes_192_ocb'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_aes_256_ecb := LoadLibFunction(ADllHandle, EVP_aes_256_ecb_procname); + FuncLoadError := not assigned(EVP_aes_256_ecb); + if FuncLoadError then + begin + {$if not defined(EVP_aes_256_ecb_allownil)} + EVP_aes_256_ecb := @ERR_EVP_aes_256_ecb; + {$ifend} + {$if declared(EVP_aes_256_ecb_introduced)} + if LibVersion < EVP_aes_256_ecb_introduced then + begin + {$if declared(FC_EVP_aes_256_ecb)} + EVP_aes_256_ecb := @FC_EVP_aes_256_ecb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_aes_256_ecb_removed)} + if EVP_aes_256_ecb_removed <= LibVersion then + begin + {$if declared(_EVP_aes_256_ecb)} + EVP_aes_256_ecb := @_EVP_aes_256_ecb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_aes_256_ecb_allownil)} + if FuncLoadError then + AFailed.Add('EVP_aes_256_ecb'); + {$ifend} + end; + + + EVP_aes_256_cbc := LoadLibFunction(ADllHandle, EVP_aes_256_cbc_procname); + FuncLoadError := not assigned(EVP_aes_256_cbc); + if FuncLoadError then + begin + {$if not defined(EVP_aes_256_cbc_allownil)} + EVP_aes_256_cbc := @ERR_EVP_aes_256_cbc; + {$ifend} + {$if declared(EVP_aes_256_cbc_introduced)} + if LibVersion < EVP_aes_256_cbc_introduced then + begin + {$if declared(FC_EVP_aes_256_cbc)} + EVP_aes_256_cbc := @FC_EVP_aes_256_cbc; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_aes_256_cbc_removed)} + if EVP_aes_256_cbc_removed <= LibVersion then + begin + {$if declared(_EVP_aes_256_cbc)} + EVP_aes_256_cbc := @_EVP_aes_256_cbc; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_aes_256_cbc_allownil)} + if FuncLoadError then + AFailed.Add('EVP_aes_256_cbc'); + {$ifend} + end; + + + EVP_aes_256_cfb1 := LoadLibFunction(ADllHandle, EVP_aes_256_cfb1_procname); + FuncLoadError := not assigned(EVP_aes_256_cfb1); + if FuncLoadError then + begin + {$if not defined(EVP_aes_256_cfb1_allownil)} + EVP_aes_256_cfb1 := @ERR_EVP_aes_256_cfb1; + {$ifend} + {$if declared(EVP_aes_256_cfb1_introduced)} + if LibVersion < EVP_aes_256_cfb1_introduced then + begin + {$if declared(FC_EVP_aes_256_cfb1)} + EVP_aes_256_cfb1 := @FC_EVP_aes_256_cfb1; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_aes_256_cfb1_removed)} + if EVP_aes_256_cfb1_removed <= LibVersion then + begin + {$if declared(_EVP_aes_256_cfb1)} + EVP_aes_256_cfb1 := @_EVP_aes_256_cfb1; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_aes_256_cfb1_allownil)} + if FuncLoadError then + AFailed.Add('EVP_aes_256_cfb1'); + {$ifend} + end; + + + EVP_aes_256_cfb8 := LoadLibFunction(ADllHandle, EVP_aes_256_cfb8_procname); + FuncLoadError := not assigned(EVP_aes_256_cfb8); + if FuncLoadError then + begin + {$if not defined(EVP_aes_256_cfb8_allownil)} + EVP_aes_256_cfb8 := @ERR_EVP_aes_256_cfb8; + {$ifend} + {$if declared(EVP_aes_256_cfb8_introduced)} + if LibVersion < EVP_aes_256_cfb8_introduced then + begin + {$if declared(FC_EVP_aes_256_cfb8)} + EVP_aes_256_cfb8 := @FC_EVP_aes_256_cfb8; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_aes_256_cfb8_removed)} + if EVP_aes_256_cfb8_removed <= LibVersion then + begin + {$if declared(_EVP_aes_256_cfb8)} + EVP_aes_256_cfb8 := @_EVP_aes_256_cfb8; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_aes_256_cfb8_allownil)} + if FuncLoadError then + AFailed.Add('EVP_aes_256_cfb8'); + {$ifend} + end; + + + EVP_aes_256_cfb128 := LoadLibFunction(ADllHandle, EVP_aes_256_cfb128_procname); + FuncLoadError := not assigned(EVP_aes_256_cfb128); + if FuncLoadError then + begin + {$if not defined(EVP_aes_256_cfb128_allownil)} + EVP_aes_256_cfb128 := @ERR_EVP_aes_256_cfb128; + {$ifend} + {$if declared(EVP_aes_256_cfb128_introduced)} + if LibVersion < EVP_aes_256_cfb128_introduced then + begin + {$if declared(FC_EVP_aes_256_cfb128)} + EVP_aes_256_cfb128 := @FC_EVP_aes_256_cfb128; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_aes_256_cfb128_removed)} + if EVP_aes_256_cfb128_removed <= LibVersion then + begin + {$if declared(_EVP_aes_256_cfb128)} + EVP_aes_256_cfb128 := @_EVP_aes_256_cfb128; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_aes_256_cfb128_allownil)} + if FuncLoadError then + AFailed.Add('EVP_aes_256_cfb128'); + {$ifend} + end; + + + EVP_aes_256_ofb := LoadLibFunction(ADllHandle, EVP_aes_256_ofb_procname); + FuncLoadError := not assigned(EVP_aes_256_ofb); + if FuncLoadError then + begin + {$if not defined(EVP_aes_256_ofb_allownil)} + EVP_aes_256_ofb := @ERR_EVP_aes_256_ofb; + {$ifend} + {$if declared(EVP_aes_256_ofb_introduced)} + if LibVersion < EVP_aes_256_ofb_introduced then + begin + {$if declared(FC_EVP_aes_256_ofb)} + EVP_aes_256_ofb := @FC_EVP_aes_256_ofb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_aes_256_ofb_removed)} + if EVP_aes_256_ofb_removed <= LibVersion then + begin + {$if declared(_EVP_aes_256_ofb)} + EVP_aes_256_ofb := @_EVP_aes_256_ofb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_aes_256_ofb_allownil)} + if FuncLoadError then + AFailed.Add('EVP_aes_256_ofb'); + {$ifend} + end; + + + EVP_aes_256_ctr := LoadLibFunction(ADllHandle, EVP_aes_256_ctr_procname); + FuncLoadError := not assigned(EVP_aes_256_ctr); + if FuncLoadError then + begin + {$if not defined(EVP_aes_256_ctr_allownil)} + EVP_aes_256_ctr := @ERR_EVP_aes_256_ctr; + {$ifend} + {$if declared(EVP_aes_256_ctr_introduced)} + if LibVersion < EVP_aes_256_ctr_introduced then + begin + {$if declared(FC_EVP_aes_256_ctr)} + EVP_aes_256_ctr := @FC_EVP_aes_256_ctr; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_aes_256_ctr_removed)} + if EVP_aes_256_ctr_removed <= LibVersion then + begin + {$if declared(_EVP_aes_256_ctr)} + EVP_aes_256_ctr := @_EVP_aes_256_ctr; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_aes_256_ctr_allownil)} + if FuncLoadError then + AFailed.Add('EVP_aes_256_ctr'); + {$ifend} + end; + + + EVP_aes_256_ccm := LoadLibFunction(ADllHandle, EVP_aes_256_ccm_procname); + FuncLoadError := not assigned(EVP_aes_256_ccm); + if FuncLoadError then + begin + {$if not defined(EVP_aes_256_ccm_allownil)} + EVP_aes_256_ccm := @ERR_EVP_aes_256_ccm; + {$ifend} + {$if declared(EVP_aes_256_ccm_introduced)} + if LibVersion < EVP_aes_256_ccm_introduced then + begin + {$if declared(FC_EVP_aes_256_ccm)} + EVP_aes_256_ccm := @FC_EVP_aes_256_ccm; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_aes_256_ccm_removed)} + if EVP_aes_256_ccm_removed <= LibVersion then + begin + {$if declared(_EVP_aes_256_ccm)} + EVP_aes_256_ccm := @_EVP_aes_256_ccm; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_aes_256_ccm_allownil)} + if FuncLoadError then + AFailed.Add('EVP_aes_256_ccm'); + {$ifend} + end; + + + EVP_aes_256_gcm := LoadLibFunction(ADllHandle, EVP_aes_256_gcm_procname); + FuncLoadError := not assigned(EVP_aes_256_gcm); + if FuncLoadError then + begin + {$if not defined(EVP_aes_256_gcm_allownil)} + EVP_aes_256_gcm := @ERR_EVP_aes_256_gcm; + {$ifend} + {$if declared(EVP_aes_256_gcm_introduced)} + if LibVersion < EVP_aes_256_gcm_introduced then + begin + {$if declared(FC_EVP_aes_256_gcm)} + EVP_aes_256_gcm := @FC_EVP_aes_256_gcm; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_aes_256_gcm_removed)} + if EVP_aes_256_gcm_removed <= LibVersion then + begin + {$if declared(_EVP_aes_256_gcm)} + EVP_aes_256_gcm := @_EVP_aes_256_gcm; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_aes_256_gcm_allownil)} + if FuncLoadError then + AFailed.Add('EVP_aes_256_gcm'); + {$ifend} + end; + + + EVP_aes_256_xts := LoadLibFunction(ADllHandle, EVP_aes_256_xts_procname); + FuncLoadError := not assigned(EVP_aes_256_xts); + if FuncLoadError then + begin + {$if not defined(EVP_aes_256_xts_allownil)} + EVP_aes_256_xts := @ERR_EVP_aes_256_xts; + {$ifend} + {$if declared(EVP_aes_256_xts_introduced)} + if LibVersion < EVP_aes_256_xts_introduced then + begin + {$if declared(FC_EVP_aes_256_xts)} + EVP_aes_256_xts := @FC_EVP_aes_256_xts; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_aes_256_xts_removed)} + if EVP_aes_256_xts_removed <= LibVersion then + begin + {$if declared(_EVP_aes_256_xts)} + EVP_aes_256_xts := @_EVP_aes_256_xts; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_aes_256_xts_allownil)} + if FuncLoadError then + AFailed.Add('EVP_aes_256_xts'); + {$ifend} + end; + + + EVP_aes_256_wrap := LoadLibFunction(ADllHandle, EVP_aes_256_wrap_procname); + FuncLoadError := not assigned(EVP_aes_256_wrap); + if FuncLoadError then + begin + {$if not defined(EVP_aes_256_wrap_allownil)} + EVP_aes_256_wrap := @ERR_EVP_aes_256_wrap; + {$ifend} + {$if declared(EVP_aes_256_wrap_introduced)} + if LibVersion < EVP_aes_256_wrap_introduced then + begin + {$if declared(FC_EVP_aes_256_wrap)} + EVP_aes_256_wrap := @FC_EVP_aes_256_wrap; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_aes_256_wrap_removed)} + if EVP_aes_256_wrap_removed <= LibVersion then + begin + {$if declared(_EVP_aes_256_wrap)} + EVP_aes_256_wrap := @_EVP_aes_256_wrap; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_aes_256_wrap_allownil)} + if FuncLoadError then + AFailed.Add('EVP_aes_256_wrap'); + {$ifend} + end; + + + EVP_aes_256_wrap_pad := LoadLibFunction(ADllHandle, EVP_aes_256_wrap_pad_procname); + FuncLoadError := not assigned(EVP_aes_256_wrap_pad); + if FuncLoadError then + begin + {$if not defined(EVP_aes_256_wrap_pad_allownil)} + EVP_aes_256_wrap_pad := @ERR_EVP_aes_256_wrap_pad; + {$ifend} + {$if declared(EVP_aes_256_wrap_pad_introduced)} + if LibVersion < EVP_aes_256_wrap_pad_introduced then + begin + {$if declared(FC_EVP_aes_256_wrap_pad)} + EVP_aes_256_wrap_pad := @FC_EVP_aes_256_wrap_pad; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_aes_256_wrap_pad_removed)} + if EVP_aes_256_wrap_pad_removed <= LibVersion then + begin + {$if declared(_EVP_aes_256_wrap_pad)} + EVP_aes_256_wrap_pad := @_EVP_aes_256_wrap_pad; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_aes_256_wrap_pad_allownil)} + if FuncLoadError then + AFailed.Add('EVP_aes_256_wrap_pad'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_aes_256_ocb := LoadLibFunction(ADllHandle, EVP_aes_256_ocb_procname); + FuncLoadError := not assigned(EVP_aes_256_ocb); + if FuncLoadError then + begin + {$if not defined(EVP_aes_256_ocb_allownil)} + EVP_aes_256_ocb := @ERR_EVP_aes_256_ocb; + {$ifend} + {$if declared(EVP_aes_256_ocb_introduced)} + if LibVersion < EVP_aes_256_ocb_introduced then + begin + {$if declared(FC_EVP_aes_256_ocb)} + EVP_aes_256_ocb := @FC_EVP_aes_256_ocb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_aes_256_ocb_removed)} + if EVP_aes_256_ocb_removed <= LibVersion then + begin + {$if declared(_EVP_aes_256_ocb)} + EVP_aes_256_ocb := @_EVP_aes_256_ocb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_aes_256_ocb_allownil)} + if FuncLoadError then + AFailed.Add('EVP_aes_256_ocb'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_aes_128_cbc_hmac_sha1 := LoadLibFunction(ADllHandle, EVP_aes_128_cbc_hmac_sha1_procname); + FuncLoadError := not assigned(EVP_aes_128_cbc_hmac_sha1); + if FuncLoadError then + begin + {$if not defined(EVP_aes_128_cbc_hmac_sha1_allownil)} + EVP_aes_128_cbc_hmac_sha1 := @ERR_EVP_aes_128_cbc_hmac_sha1; + {$ifend} + {$if declared(EVP_aes_128_cbc_hmac_sha1_introduced)} + if LibVersion < EVP_aes_128_cbc_hmac_sha1_introduced then + begin + {$if declared(FC_EVP_aes_128_cbc_hmac_sha1)} + EVP_aes_128_cbc_hmac_sha1 := @FC_EVP_aes_128_cbc_hmac_sha1; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_aes_128_cbc_hmac_sha1_removed)} + if EVP_aes_128_cbc_hmac_sha1_removed <= LibVersion then + begin + {$if declared(_EVP_aes_128_cbc_hmac_sha1)} + EVP_aes_128_cbc_hmac_sha1 := @_EVP_aes_128_cbc_hmac_sha1; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_aes_128_cbc_hmac_sha1_allownil)} + if FuncLoadError then + AFailed.Add('EVP_aes_128_cbc_hmac_sha1'); + {$ifend} + end; + + + EVP_aes_256_cbc_hmac_sha1 := LoadLibFunction(ADllHandle, EVP_aes_256_cbc_hmac_sha1_procname); + FuncLoadError := not assigned(EVP_aes_256_cbc_hmac_sha1); + if FuncLoadError then + begin + {$if not defined(EVP_aes_256_cbc_hmac_sha1_allownil)} + EVP_aes_256_cbc_hmac_sha1 := @ERR_EVP_aes_256_cbc_hmac_sha1; + {$ifend} + {$if declared(EVP_aes_256_cbc_hmac_sha1_introduced)} + if LibVersion < EVP_aes_256_cbc_hmac_sha1_introduced then + begin + {$if declared(FC_EVP_aes_256_cbc_hmac_sha1)} + EVP_aes_256_cbc_hmac_sha1 := @FC_EVP_aes_256_cbc_hmac_sha1; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_aes_256_cbc_hmac_sha1_removed)} + if EVP_aes_256_cbc_hmac_sha1_removed <= LibVersion then + begin + {$if declared(_EVP_aes_256_cbc_hmac_sha1)} + EVP_aes_256_cbc_hmac_sha1 := @_EVP_aes_256_cbc_hmac_sha1; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_aes_256_cbc_hmac_sha1_allownil)} + if FuncLoadError then + AFailed.Add('EVP_aes_256_cbc_hmac_sha1'); + {$ifend} + end; + + + EVP_aes_128_cbc_hmac_sha256 := LoadLibFunction(ADllHandle, EVP_aes_128_cbc_hmac_sha256_procname); + FuncLoadError := not assigned(EVP_aes_128_cbc_hmac_sha256); + if FuncLoadError then + begin + {$if not defined(EVP_aes_128_cbc_hmac_sha256_allownil)} + EVP_aes_128_cbc_hmac_sha256 := @ERR_EVP_aes_128_cbc_hmac_sha256; + {$ifend} + {$if declared(EVP_aes_128_cbc_hmac_sha256_introduced)} + if LibVersion < EVP_aes_128_cbc_hmac_sha256_introduced then + begin + {$if declared(FC_EVP_aes_128_cbc_hmac_sha256)} + EVP_aes_128_cbc_hmac_sha256 := @FC_EVP_aes_128_cbc_hmac_sha256; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_aes_128_cbc_hmac_sha256_removed)} + if EVP_aes_128_cbc_hmac_sha256_removed <= LibVersion then + begin + {$if declared(_EVP_aes_128_cbc_hmac_sha256)} + EVP_aes_128_cbc_hmac_sha256 := @_EVP_aes_128_cbc_hmac_sha256; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_aes_128_cbc_hmac_sha256_allownil)} + if FuncLoadError then + AFailed.Add('EVP_aes_128_cbc_hmac_sha256'); + {$ifend} + end; + + + EVP_aes_256_cbc_hmac_sha256 := LoadLibFunction(ADllHandle, EVP_aes_256_cbc_hmac_sha256_procname); + FuncLoadError := not assigned(EVP_aes_256_cbc_hmac_sha256); + if FuncLoadError then + begin + {$if not defined(EVP_aes_256_cbc_hmac_sha256_allownil)} + EVP_aes_256_cbc_hmac_sha256 := @ERR_EVP_aes_256_cbc_hmac_sha256; + {$ifend} + {$if declared(EVP_aes_256_cbc_hmac_sha256_introduced)} + if LibVersion < EVP_aes_256_cbc_hmac_sha256_introduced then + begin + {$if declared(FC_EVP_aes_256_cbc_hmac_sha256)} + EVP_aes_256_cbc_hmac_sha256 := @FC_EVP_aes_256_cbc_hmac_sha256; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_aes_256_cbc_hmac_sha256_removed)} + if EVP_aes_256_cbc_hmac_sha256_removed <= LibVersion then + begin + {$if declared(_EVP_aes_256_cbc_hmac_sha256)} + EVP_aes_256_cbc_hmac_sha256 := @_EVP_aes_256_cbc_hmac_sha256; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_aes_256_cbc_hmac_sha256_allownil)} + if FuncLoadError then + AFailed.Add('EVP_aes_256_cbc_hmac_sha256'); + {$ifend} + end; + + + EVP_aria_128_ecb := LoadLibFunction(ADllHandle, EVP_aria_128_ecb_procname); + FuncLoadError := not assigned(EVP_aria_128_ecb); + if FuncLoadError then + begin + {$if not defined(EVP_aria_128_ecb_allownil)} + EVP_aria_128_ecb := @ERR_EVP_aria_128_ecb; + {$ifend} + {$if declared(EVP_aria_128_ecb_introduced)} + if LibVersion < EVP_aria_128_ecb_introduced then + begin + {$if declared(FC_EVP_aria_128_ecb)} + EVP_aria_128_ecb := @FC_EVP_aria_128_ecb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_aria_128_ecb_removed)} + if EVP_aria_128_ecb_removed <= LibVersion then + begin + {$if declared(_EVP_aria_128_ecb)} + EVP_aria_128_ecb := @_EVP_aria_128_ecb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_aria_128_ecb_allownil)} + if FuncLoadError then + AFailed.Add('EVP_aria_128_ecb'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_aria_128_cbc := LoadLibFunction(ADllHandle, EVP_aria_128_cbc_procname); + FuncLoadError := not assigned(EVP_aria_128_cbc); + if FuncLoadError then + begin + {$if not defined(EVP_aria_128_cbc_allownil)} + EVP_aria_128_cbc := @ERR_EVP_aria_128_cbc; + {$ifend} + {$if declared(EVP_aria_128_cbc_introduced)} + if LibVersion < EVP_aria_128_cbc_introduced then + begin + {$if declared(FC_EVP_aria_128_cbc)} + EVP_aria_128_cbc := @FC_EVP_aria_128_cbc; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_aria_128_cbc_removed)} + if EVP_aria_128_cbc_removed <= LibVersion then + begin + {$if declared(_EVP_aria_128_cbc)} + EVP_aria_128_cbc := @_EVP_aria_128_cbc; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_aria_128_cbc_allownil)} + if FuncLoadError then + AFailed.Add('EVP_aria_128_cbc'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_aria_128_cfb1 := LoadLibFunction(ADllHandle, EVP_aria_128_cfb1_procname); + FuncLoadError := not assigned(EVP_aria_128_cfb1); + if FuncLoadError then + begin + {$if not defined(EVP_aria_128_cfb1_allownil)} + EVP_aria_128_cfb1 := @ERR_EVP_aria_128_cfb1; + {$ifend} + {$if declared(EVP_aria_128_cfb1_introduced)} + if LibVersion < EVP_aria_128_cfb1_introduced then + begin + {$if declared(FC_EVP_aria_128_cfb1)} + EVP_aria_128_cfb1 := @FC_EVP_aria_128_cfb1; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_aria_128_cfb1_removed)} + if EVP_aria_128_cfb1_removed <= LibVersion then + begin + {$if declared(_EVP_aria_128_cfb1)} + EVP_aria_128_cfb1 := @_EVP_aria_128_cfb1; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_aria_128_cfb1_allownil)} + if FuncLoadError then + AFailed.Add('EVP_aria_128_cfb1'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_aria_128_cfb8 := LoadLibFunction(ADllHandle, EVP_aria_128_cfb8_procname); + FuncLoadError := not assigned(EVP_aria_128_cfb8); + if FuncLoadError then + begin + {$if not defined(EVP_aria_128_cfb8_allownil)} + EVP_aria_128_cfb8 := @ERR_EVP_aria_128_cfb8; + {$ifend} + {$if declared(EVP_aria_128_cfb8_introduced)} + if LibVersion < EVP_aria_128_cfb8_introduced then + begin + {$if declared(FC_EVP_aria_128_cfb8)} + EVP_aria_128_cfb8 := @FC_EVP_aria_128_cfb8; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_aria_128_cfb8_removed)} + if EVP_aria_128_cfb8_removed <= LibVersion then + begin + {$if declared(_EVP_aria_128_cfb8)} + EVP_aria_128_cfb8 := @_EVP_aria_128_cfb8; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_aria_128_cfb8_allownil)} + if FuncLoadError then + AFailed.Add('EVP_aria_128_cfb8'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_aria_128_cfb128 := LoadLibFunction(ADllHandle, EVP_aria_128_cfb128_procname); + FuncLoadError := not assigned(EVP_aria_128_cfb128); + if FuncLoadError then + begin + {$if not defined(EVP_aria_128_cfb128_allownil)} + EVP_aria_128_cfb128 := @ERR_EVP_aria_128_cfb128; + {$ifend} + {$if declared(EVP_aria_128_cfb128_introduced)} + if LibVersion < EVP_aria_128_cfb128_introduced then + begin + {$if declared(FC_EVP_aria_128_cfb128)} + EVP_aria_128_cfb128 := @FC_EVP_aria_128_cfb128; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_aria_128_cfb128_removed)} + if EVP_aria_128_cfb128_removed <= LibVersion then + begin + {$if declared(_EVP_aria_128_cfb128)} + EVP_aria_128_cfb128 := @_EVP_aria_128_cfb128; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_aria_128_cfb128_allownil)} + if FuncLoadError then + AFailed.Add('EVP_aria_128_cfb128'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_aria_128_ctr := LoadLibFunction(ADllHandle, EVP_aria_128_ctr_procname); + FuncLoadError := not assigned(EVP_aria_128_ctr); + if FuncLoadError then + begin + {$if not defined(EVP_aria_128_ctr_allownil)} + EVP_aria_128_ctr := @ERR_EVP_aria_128_ctr; + {$ifend} + {$if declared(EVP_aria_128_ctr_introduced)} + if LibVersion < EVP_aria_128_ctr_introduced then + begin + {$if declared(FC_EVP_aria_128_ctr)} + EVP_aria_128_ctr := @FC_EVP_aria_128_ctr; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_aria_128_ctr_removed)} + if EVP_aria_128_ctr_removed <= LibVersion then + begin + {$if declared(_EVP_aria_128_ctr)} + EVP_aria_128_ctr := @_EVP_aria_128_ctr; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_aria_128_ctr_allownil)} + if FuncLoadError then + AFailed.Add('EVP_aria_128_ctr'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_aria_128_ofb := LoadLibFunction(ADllHandle, EVP_aria_128_ofb_procname); + FuncLoadError := not assigned(EVP_aria_128_ofb); + if FuncLoadError then + begin + {$if not defined(EVP_aria_128_ofb_allownil)} + EVP_aria_128_ofb := @ERR_EVP_aria_128_ofb; + {$ifend} + {$if declared(EVP_aria_128_ofb_introduced)} + if LibVersion < EVP_aria_128_ofb_introduced then + begin + {$if declared(FC_EVP_aria_128_ofb)} + EVP_aria_128_ofb := @FC_EVP_aria_128_ofb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_aria_128_ofb_removed)} + if EVP_aria_128_ofb_removed <= LibVersion then + begin + {$if declared(_EVP_aria_128_ofb)} + EVP_aria_128_ofb := @_EVP_aria_128_ofb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_aria_128_ofb_allownil)} + if FuncLoadError then + AFailed.Add('EVP_aria_128_ofb'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_aria_128_gcm := LoadLibFunction(ADllHandle, EVP_aria_128_gcm_procname); + FuncLoadError := not assigned(EVP_aria_128_gcm); + if FuncLoadError then + begin + {$if not defined(EVP_aria_128_gcm_allownil)} + EVP_aria_128_gcm := @ERR_EVP_aria_128_gcm; + {$ifend} + {$if declared(EVP_aria_128_gcm_introduced)} + if LibVersion < EVP_aria_128_gcm_introduced then + begin + {$if declared(FC_EVP_aria_128_gcm)} + EVP_aria_128_gcm := @FC_EVP_aria_128_gcm; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_aria_128_gcm_removed)} + if EVP_aria_128_gcm_removed <= LibVersion then + begin + {$if declared(_EVP_aria_128_gcm)} + EVP_aria_128_gcm := @_EVP_aria_128_gcm; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_aria_128_gcm_allownil)} + if FuncLoadError then + AFailed.Add('EVP_aria_128_gcm'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_aria_128_ccm := LoadLibFunction(ADllHandle, EVP_aria_128_ccm_procname); + FuncLoadError := not assigned(EVP_aria_128_ccm); + if FuncLoadError then + begin + {$if not defined(EVP_aria_128_ccm_allownil)} + EVP_aria_128_ccm := @ERR_EVP_aria_128_ccm; + {$ifend} + {$if declared(EVP_aria_128_ccm_introduced)} + if LibVersion < EVP_aria_128_ccm_introduced then + begin + {$if declared(FC_EVP_aria_128_ccm)} + EVP_aria_128_ccm := @FC_EVP_aria_128_ccm; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_aria_128_ccm_removed)} + if EVP_aria_128_ccm_removed <= LibVersion then + begin + {$if declared(_EVP_aria_128_ccm)} + EVP_aria_128_ccm := @_EVP_aria_128_ccm; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_aria_128_ccm_allownil)} + if FuncLoadError then + AFailed.Add('EVP_aria_128_ccm'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_aria_192_ecb := LoadLibFunction(ADllHandle, EVP_aria_192_ecb_procname); + FuncLoadError := not assigned(EVP_aria_192_ecb); + if FuncLoadError then + begin + {$if not defined(EVP_aria_192_ecb_allownil)} + EVP_aria_192_ecb := @ERR_EVP_aria_192_ecb; + {$ifend} + {$if declared(EVP_aria_192_ecb_introduced)} + if LibVersion < EVP_aria_192_ecb_introduced then + begin + {$if declared(FC_EVP_aria_192_ecb)} + EVP_aria_192_ecb := @FC_EVP_aria_192_ecb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_aria_192_ecb_removed)} + if EVP_aria_192_ecb_removed <= LibVersion then + begin + {$if declared(_EVP_aria_192_ecb)} + EVP_aria_192_ecb := @_EVP_aria_192_ecb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_aria_192_ecb_allownil)} + if FuncLoadError then + AFailed.Add('EVP_aria_192_ecb'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_aria_192_cbc := LoadLibFunction(ADllHandle, EVP_aria_192_cbc_procname); + FuncLoadError := not assigned(EVP_aria_192_cbc); + if FuncLoadError then + begin + {$if not defined(EVP_aria_192_cbc_allownil)} + EVP_aria_192_cbc := @ERR_EVP_aria_192_cbc; + {$ifend} + {$if declared(EVP_aria_192_cbc_introduced)} + if LibVersion < EVP_aria_192_cbc_introduced then + begin + {$if declared(FC_EVP_aria_192_cbc)} + EVP_aria_192_cbc := @FC_EVP_aria_192_cbc; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_aria_192_cbc_removed)} + if EVP_aria_192_cbc_removed <= LibVersion then + begin + {$if declared(_EVP_aria_192_cbc)} + EVP_aria_192_cbc := @_EVP_aria_192_cbc; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_aria_192_cbc_allownil)} + if FuncLoadError then + AFailed.Add('EVP_aria_192_cbc'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_aria_192_cfb1 := LoadLibFunction(ADllHandle, EVP_aria_192_cfb1_procname); + FuncLoadError := not assigned(EVP_aria_192_cfb1); + if FuncLoadError then + begin + {$if not defined(EVP_aria_192_cfb1_allownil)} + EVP_aria_192_cfb1 := @ERR_EVP_aria_192_cfb1; + {$ifend} + {$if declared(EVP_aria_192_cfb1_introduced)} + if LibVersion < EVP_aria_192_cfb1_introduced then + begin + {$if declared(FC_EVP_aria_192_cfb1)} + EVP_aria_192_cfb1 := @FC_EVP_aria_192_cfb1; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_aria_192_cfb1_removed)} + if EVP_aria_192_cfb1_removed <= LibVersion then + begin + {$if declared(_EVP_aria_192_cfb1)} + EVP_aria_192_cfb1 := @_EVP_aria_192_cfb1; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_aria_192_cfb1_allownil)} + if FuncLoadError then + AFailed.Add('EVP_aria_192_cfb1'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_aria_192_cfb8 := LoadLibFunction(ADllHandle, EVP_aria_192_cfb8_procname); + FuncLoadError := not assigned(EVP_aria_192_cfb8); + if FuncLoadError then + begin + {$if not defined(EVP_aria_192_cfb8_allownil)} + EVP_aria_192_cfb8 := @ERR_EVP_aria_192_cfb8; + {$ifend} + {$if declared(EVP_aria_192_cfb8_introduced)} + if LibVersion < EVP_aria_192_cfb8_introduced then + begin + {$if declared(FC_EVP_aria_192_cfb8)} + EVP_aria_192_cfb8 := @FC_EVP_aria_192_cfb8; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_aria_192_cfb8_removed)} + if EVP_aria_192_cfb8_removed <= LibVersion then + begin + {$if declared(_EVP_aria_192_cfb8)} + EVP_aria_192_cfb8 := @_EVP_aria_192_cfb8; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_aria_192_cfb8_allownil)} + if FuncLoadError then + AFailed.Add('EVP_aria_192_cfb8'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_aria_192_cfb128 := LoadLibFunction(ADllHandle, EVP_aria_192_cfb128_procname); + FuncLoadError := not assigned(EVP_aria_192_cfb128); + if FuncLoadError then + begin + {$if not defined(EVP_aria_192_cfb128_allownil)} + EVP_aria_192_cfb128 := @ERR_EVP_aria_192_cfb128; + {$ifend} + {$if declared(EVP_aria_192_cfb128_introduced)} + if LibVersion < EVP_aria_192_cfb128_introduced then + begin + {$if declared(FC_EVP_aria_192_cfb128)} + EVP_aria_192_cfb128 := @FC_EVP_aria_192_cfb128; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_aria_192_cfb128_removed)} + if EVP_aria_192_cfb128_removed <= LibVersion then + begin + {$if declared(_EVP_aria_192_cfb128)} + EVP_aria_192_cfb128 := @_EVP_aria_192_cfb128; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_aria_192_cfb128_allownil)} + if FuncLoadError then + AFailed.Add('EVP_aria_192_cfb128'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_aria_192_ctr := LoadLibFunction(ADllHandle, EVP_aria_192_ctr_procname); + FuncLoadError := not assigned(EVP_aria_192_ctr); + if FuncLoadError then + begin + {$if not defined(EVP_aria_192_ctr_allownil)} + EVP_aria_192_ctr := @ERR_EVP_aria_192_ctr; + {$ifend} + {$if declared(EVP_aria_192_ctr_introduced)} + if LibVersion < EVP_aria_192_ctr_introduced then + begin + {$if declared(FC_EVP_aria_192_ctr)} + EVP_aria_192_ctr := @FC_EVP_aria_192_ctr; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_aria_192_ctr_removed)} + if EVP_aria_192_ctr_removed <= LibVersion then + begin + {$if declared(_EVP_aria_192_ctr)} + EVP_aria_192_ctr := @_EVP_aria_192_ctr; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_aria_192_ctr_allownil)} + if FuncLoadError then + AFailed.Add('EVP_aria_192_ctr'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_aria_192_ofb := LoadLibFunction(ADllHandle, EVP_aria_192_ofb_procname); + FuncLoadError := not assigned(EVP_aria_192_ofb); + if FuncLoadError then + begin + {$if not defined(EVP_aria_192_ofb_allownil)} + EVP_aria_192_ofb := @ERR_EVP_aria_192_ofb; + {$ifend} + {$if declared(EVP_aria_192_ofb_introduced)} + if LibVersion < EVP_aria_192_ofb_introduced then + begin + {$if declared(FC_EVP_aria_192_ofb)} + EVP_aria_192_ofb := @FC_EVP_aria_192_ofb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_aria_192_ofb_removed)} + if EVP_aria_192_ofb_removed <= LibVersion then + begin + {$if declared(_EVP_aria_192_ofb)} + EVP_aria_192_ofb := @_EVP_aria_192_ofb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_aria_192_ofb_allownil)} + if FuncLoadError then + AFailed.Add('EVP_aria_192_ofb'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_aria_192_gcm := LoadLibFunction(ADllHandle, EVP_aria_192_gcm_procname); + FuncLoadError := not assigned(EVP_aria_192_gcm); + if FuncLoadError then + begin + {$if not defined(EVP_aria_192_gcm_allownil)} + EVP_aria_192_gcm := @ERR_EVP_aria_192_gcm; + {$ifend} + {$if declared(EVP_aria_192_gcm_introduced)} + if LibVersion < EVP_aria_192_gcm_introduced then + begin + {$if declared(FC_EVP_aria_192_gcm)} + EVP_aria_192_gcm := @FC_EVP_aria_192_gcm; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_aria_192_gcm_removed)} + if EVP_aria_192_gcm_removed <= LibVersion then + begin + {$if declared(_EVP_aria_192_gcm)} + EVP_aria_192_gcm := @_EVP_aria_192_gcm; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_aria_192_gcm_allownil)} + if FuncLoadError then + AFailed.Add('EVP_aria_192_gcm'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_aria_192_ccm := LoadLibFunction(ADllHandle, EVP_aria_192_ccm_procname); + FuncLoadError := not assigned(EVP_aria_192_ccm); + if FuncLoadError then + begin + {$if not defined(EVP_aria_192_ccm_allownil)} + EVP_aria_192_ccm := @ERR_EVP_aria_192_ccm; + {$ifend} + {$if declared(EVP_aria_192_ccm_introduced)} + if LibVersion < EVP_aria_192_ccm_introduced then + begin + {$if declared(FC_EVP_aria_192_ccm)} + EVP_aria_192_ccm := @FC_EVP_aria_192_ccm; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_aria_192_ccm_removed)} + if EVP_aria_192_ccm_removed <= LibVersion then + begin + {$if declared(_EVP_aria_192_ccm)} + EVP_aria_192_ccm := @_EVP_aria_192_ccm; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_aria_192_ccm_allownil)} + if FuncLoadError then + AFailed.Add('EVP_aria_192_ccm'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_aria_256_ecb := LoadLibFunction(ADllHandle, EVP_aria_256_ecb_procname); + FuncLoadError := not assigned(EVP_aria_256_ecb); + if FuncLoadError then + begin + {$if not defined(EVP_aria_256_ecb_allownil)} + EVP_aria_256_ecb := @ERR_EVP_aria_256_ecb; + {$ifend} + {$if declared(EVP_aria_256_ecb_introduced)} + if LibVersion < EVP_aria_256_ecb_introduced then + begin + {$if declared(FC_EVP_aria_256_ecb)} + EVP_aria_256_ecb := @FC_EVP_aria_256_ecb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_aria_256_ecb_removed)} + if EVP_aria_256_ecb_removed <= LibVersion then + begin + {$if declared(_EVP_aria_256_ecb)} + EVP_aria_256_ecb := @_EVP_aria_256_ecb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_aria_256_ecb_allownil)} + if FuncLoadError then + AFailed.Add('EVP_aria_256_ecb'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_aria_256_cbc := LoadLibFunction(ADllHandle, EVP_aria_256_cbc_procname); + FuncLoadError := not assigned(EVP_aria_256_cbc); + if FuncLoadError then + begin + {$if not defined(EVP_aria_256_cbc_allownil)} + EVP_aria_256_cbc := @ERR_EVP_aria_256_cbc; + {$ifend} + {$if declared(EVP_aria_256_cbc_introduced)} + if LibVersion < EVP_aria_256_cbc_introduced then + begin + {$if declared(FC_EVP_aria_256_cbc)} + EVP_aria_256_cbc := @FC_EVP_aria_256_cbc; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_aria_256_cbc_removed)} + if EVP_aria_256_cbc_removed <= LibVersion then + begin + {$if declared(_EVP_aria_256_cbc)} + EVP_aria_256_cbc := @_EVP_aria_256_cbc; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_aria_256_cbc_allownil)} + if FuncLoadError then + AFailed.Add('EVP_aria_256_cbc'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_aria_256_cfb1 := LoadLibFunction(ADllHandle, EVP_aria_256_cfb1_procname); + FuncLoadError := not assigned(EVP_aria_256_cfb1); + if FuncLoadError then + begin + {$if not defined(EVP_aria_256_cfb1_allownil)} + EVP_aria_256_cfb1 := @ERR_EVP_aria_256_cfb1; + {$ifend} + {$if declared(EVP_aria_256_cfb1_introduced)} + if LibVersion < EVP_aria_256_cfb1_introduced then + begin + {$if declared(FC_EVP_aria_256_cfb1)} + EVP_aria_256_cfb1 := @FC_EVP_aria_256_cfb1; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_aria_256_cfb1_removed)} + if EVP_aria_256_cfb1_removed <= LibVersion then + begin + {$if declared(_EVP_aria_256_cfb1)} + EVP_aria_256_cfb1 := @_EVP_aria_256_cfb1; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_aria_256_cfb1_allownil)} + if FuncLoadError then + AFailed.Add('EVP_aria_256_cfb1'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_aria_256_cfb8 := LoadLibFunction(ADllHandle, EVP_aria_256_cfb8_procname); + FuncLoadError := not assigned(EVP_aria_256_cfb8); + if FuncLoadError then + begin + {$if not defined(EVP_aria_256_cfb8_allownil)} + EVP_aria_256_cfb8 := @ERR_EVP_aria_256_cfb8; + {$ifend} + {$if declared(EVP_aria_256_cfb8_introduced)} + if LibVersion < EVP_aria_256_cfb8_introduced then + begin + {$if declared(FC_EVP_aria_256_cfb8)} + EVP_aria_256_cfb8 := @FC_EVP_aria_256_cfb8; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_aria_256_cfb8_removed)} + if EVP_aria_256_cfb8_removed <= LibVersion then + begin + {$if declared(_EVP_aria_256_cfb8)} + EVP_aria_256_cfb8 := @_EVP_aria_256_cfb8; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_aria_256_cfb8_allownil)} + if FuncLoadError then + AFailed.Add('EVP_aria_256_cfb8'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_aria_256_cfb128 := LoadLibFunction(ADllHandle, EVP_aria_256_cfb128_procname); + FuncLoadError := not assigned(EVP_aria_256_cfb128); + if FuncLoadError then + begin + {$if not defined(EVP_aria_256_cfb128_allownil)} + EVP_aria_256_cfb128 := @ERR_EVP_aria_256_cfb128; + {$ifend} + {$if declared(EVP_aria_256_cfb128_introduced)} + if LibVersion < EVP_aria_256_cfb128_introduced then + begin + {$if declared(FC_EVP_aria_256_cfb128)} + EVP_aria_256_cfb128 := @FC_EVP_aria_256_cfb128; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_aria_256_cfb128_removed)} + if EVP_aria_256_cfb128_removed <= LibVersion then + begin + {$if declared(_EVP_aria_256_cfb128)} + EVP_aria_256_cfb128 := @_EVP_aria_256_cfb128; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_aria_256_cfb128_allownil)} + if FuncLoadError then + AFailed.Add('EVP_aria_256_cfb128'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_aria_256_ctr := LoadLibFunction(ADllHandle, EVP_aria_256_ctr_procname); + FuncLoadError := not assigned(EVP_aria_256_ctr); + if FuncLoadError then + begin + {$if not defined(EVP_aria_256_ctr_allownil)} + EVP_aria_256_ctr := @ERR_EVP_aria_256_ctr; + {$ifend} + {$if declared(EVP_aria_256_ctr_introduced)} + if LibVersion < EVP_aria_256_ctr_introduced then + begin + {$if declared(FC_EVP_aria_256_ctr)} + EVP_aria_256_ctr := @FC_EVP_aria_256_ctr; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_aria_256_ctr_removed)} + if EVP_aria_256_ctr_removed <= LibVersion then + begin + {$if declared(_EVP_aria_256_ctr)} + EVP_aria_256_ctr := @_EVP_aria_256_ctr; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_aria_256_ctr_allownil)} + if FuncLoadError then + AFailed.Add('EVP_aria_256_ctr'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_aria_256_ofb := LoadLibFunction(ADllHandle, EVP_aria_256_ofb_procname); + FuncLoadError := not assigned(EVP_aria_256_ofb); + if FuncLoadError then + begin + {$if not defined(EVP_aria_256_ofb_allownil)} + EVP_aria_256_ofb := @ERR_EVP_aria_256_ofb; + {$ifend} + {$if declared(EVP_aria_256_ofb_introduced)} + if LibVersion < EVP_aria_256_ofb_introduced then + begin + {$if declared(FC_EVP_aria_256_ofb)} + EVP_aria_256_ofb := @FC_EVP_aria_256_ofb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_aria_256_ofb_removed)} + if EVP_aria_256_ofb_removed <= LibVersion then + begin + {$if declared(_EVP_aria_256_ofb)} + EVP_aria_256_ofb := @_EVP_aria_256_ofb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_aria_256_ofb_allownil)} + if FuncLoadError then + AFailed.Add('EVP_aria_256_ofb'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_aria_256_gcm := LoadLibFunction(ADllHandle, EVP_aria_256_gcm_procname); + FuncLoadError := not assigned(EVP_aria_256_gcm); + if FuncLoadError then + begin + {$if not defined(EVP_aria_256_gcm_allownil)} + EVP_aria_256_gcm := @ERR_EVP_aria_256_gcm; + {$ifend} + {$if declared(EVP_aria_256_gcm_introduced)} + if LibVersion < EVP_aria_256_gcm_introduced then + begin + {$if declared(FC_EVP_aria_256_gcm)} + EVP_aria_256_gcm := @FC_EVP_aria_256_gcm; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_aria_256_gcm_removed)} + if EVP_aria_256_gcm_removed <= LibVersion then + begin + {$if declared(_EVP_aria_256_gcm)} + EVP_aria_256_gcm := @_EVP_aria_256_gcm; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_aria_256_gcm_allownil)} + if FuncLoadError then + AFailed.Add('EVP_aria_256_gcm'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_aria_256_ccm := LoadLibFunction(ADllHandle, EVP_aria_256_ccm_procname); + FuncLoadError := not assigned(EVP_aria_256_ccm); + if FuncLoadError then + begin + {$if not defined(EVP_aria_256_ccm_allownil)} + EVP_aria_256_ccm := @ERR_EVP_aria_256_ccm; + {$ifend} + {$if declared(EVP_aria_256_ccm_introduced)} + if LibVersion < EVP_aria_256_ccm_introduced then + begin + {$if declared(FC_EVP_aria_256_ccm)} + EVP_aria_256_ccm := @FC_EVP_aria_256_ccm; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_aria_256_ccm_removed)} + if EVP_aria_256_ccm_removed <= LibVersion then + begin + {$if declared(_EVP_aria_256_ccm)} + EVP_aria_256_ccm := @_EVP_aria_256_ccm; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_aria_256_ccm_allownil)} + if FuncLoadError then + AFailed.Add('EVP_aria_256_ccm'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_camellia_128_ecb := LoadLibFunction(ADllHandle, EVP_camellia_128_ecb_procname); + FuncLoadError := not assigned(EVP_camellia_128_ecb); + if FuncLoadError then + begin + {$if not defined(EVP_camellia_128_ecb_allownil)} + EVP_camellia_128_ecb := @ERR_EVP_camellia_128_ecb; + {$ifend} + {$if declared(EVP_camellia_128_ecb_introduced)} + if LibVersion < EVP_camellia_128_ecb_introduced then + begin + {$if declared(FC_EVP_camellia_128_ecb)} + EVP_camellia_128_ecb := @FC_EVP_camellia_128_ecb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_camellia_128_ecb_removed)} + if EVP_camellia_128_ecb_removed <= LibVersion then + begin + {$if declared(_EVP_camellia_128_ecb)} + EVP_camellia_128_ecb := @_EVP_camellia_128_ecb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_camellia_128_ecb_allownil)} + if FuncLoadError then + AFailed.Add('EVP_camellia_128_ecb'); + {$ifend} + end; + + + EVP_camellia_128_cbc := LoadLibFunction(ADllHandle, EVP_camellia_128_cbc_procname); + FuncLoadError := not assigned(EVP_camellia_128_cbc); + if FuncLoadError then + begin + {$if not defined(EVP_camellia_128_cbc_allownil)} + EVP_camellia_128_cbc := @ERR_EVP_camellia_128_cbc; + {$ifend} + {$if declared(EVP_camellia_128_cbc_introduced)} + if LibVersion < EVP_camellia_128_cbc_introduced then + begin + {$if declared(FC_EVP_camellia_128_cbc)} + EVP_camellia_128_cbc := @FC_EVP_camellia_128_cbc; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_camellia_128_cbc_removed)} + if EVP_camellia_128_cbc_removed <= LibVersion then + begin + {$if declared(_EVP_camellia_128_cbc)} + EVP_camellia_128_cbc := @_EVP_camellia_128_cbc; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_camellia_128_cbc_allownil)} + if FuncLoadError then + AFailed.Add('EVP_camellia_128_cbc'); + {$ifend} + end; + + + EVP_camellia_128_cfb1 := LoadLibFunction(ADllHandle, EVP_camellia_128_cfb1_procname); + FuncLoadError := not assigned(EVP_camellia_128_cfb1); + if FuncLoadError then + begin + {$if not defined(EVP_camellia_128_cfb1_allownil)} + EVP_camellia_128_cfb1 := @ERR_EVP_camellia_128_cfb1; + {$ifend} + {$if declared(EVP_camellia_128_cfb1_introduced)} + if LibVersion < EVP_camellia_128_cfb1_introduced then + begin + {$if declared(FC_EVP_camellia_128_cfb1)} + EVP_camellia_128_cfb1 := @FC_EVP_camellia_128_cfb1; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_camellia_128_cfb1_removed)} + if EVP_camellia_128_cfb1_removed <= LibVersion then + begin + {$if declared(_EVP_camellia_128_cfb1)} + EVP_camellia_128_cfb1 := @_EVP_camellia_128_cfb1; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_camellia_128_cfb1_allownil)} + if FuncLoadError then + AFailed.Add('EVP_camellia_128_cfb1'); + {$ifend} + end; + + + EVP_camellia_128_cfb8 := LoadLibFunction(ADllHandle, EVP_camellia_128_cfb8_procname); + FuncLoadError := not assigned(EVP_camellia_128_cfb8); + if FuncLoadError then + begin + {$if not defined(EVP_camellia_128_cfb8_allownil)} + EVP_camellia_128_cfb8 := @ERR_EVP_camellia_128_cfb8; + {$ifend} + {$if declared(EVP_camellia_128_cfb8_introduced)} + if LibVersion < EVP_camellia_128_cfb8_introduced then + begin + {$if declared(FC_EVP_camellia_128_cfb8)} + EVP_camellia_128_cfb8 := @FC_EVP_camellia_128_cfb8; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_camellia_128_cfb8_removed)} + if EVP_camellia_128_cfb8_removed <= LibVersion then + begin + {$if declared(_EVP_camellia_128_cfb8)} + EVP_camellia_128_cfb8 := @_EVP_camellia_128_cfb8; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_camellia_128_cfb8_allownil)} + if FuncLoadError then + AFailed.Add('EVP_camellia_128_cfb8'); + {$ifend} + end; + + + EVP_camellia_128_cfb128 := LoadLibFunction(ADllHandle, EVP_camellia_128_cfb128_procname); + FuncLoadError := not assigned(EVP_camellia_128_cfb128); + if FuncLoadError then + begin + {$if not defined(EVP_camellia_128_cfb128_allownil)} + EVP_camellia_128_cfb128 := @ERR_EVP_camellia_128_cfb128; + {$ifend} + {$if declared(EVP_camellia_128_cfb128_introduced)} + if LibVersion < EVP_camellia_128_cfb128_introduced then + begin + {$if declared(FC_EVP_camellia_128_cfb128)} + EVP_camellia_128_cfb128 := @FC_EVP_camellia_128_cfb128; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_camellia_128_cfb128_removed)} + if EVP_camellia_128_cfb128_removed <= LibVersion then + begin + {$if declared(_EVP_camellia_128_cfb128)} + EVP_camellia_128_cfb128 := @_EVP_camellia_128_cfb128; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_camellia_128_cfb128_allownil)} + if FuncLoadError then + AFailed.Add('EVP_camellia_128_cfb128'); + {$ifend} + end; + + + EVP_camellia_128_ofb := LoadLibFunction(ADllHandle, EVP_camellia_128_ofb_procname); + FuncLoadError := not assigned(EVP_camellia_128_ofb); + if FuncLoadError then + begin + {$if not defined(EVP_camellia_128_ofb_allownil)} + EVP_camellia_128_ofb := @ERR_EVP_camellia_128_ofb; + {$ifend} + {$if declared(EVP_camellia_128_ofb_introduced)} + if LibVersion < EVP_camellia_128_ofb_introduced then + begin + {$if declared(FC_EVP_camellia_128_ofb)} + EVP_camellia_128_ofb := @FC_EVP_camellia_128_ofb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_camellia_128_ofb_removed)} + if EVP_camellia_128_ofb_removed <= LibVersion then + begin + {$if declared(_EVP_camellia_128_ofb)} + EVP_camellia_128_ofb := @_EVP_camellia_128_ofb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_camellia_128_ofb_allownil)} + if FuncLoadError then + AFailed.Add('EVP_camellia_128_ofb'); + {$ifend} + end; + + + EVP_camellia_128_ctr := LoadLibFunction(ADllHandle, EVP_camellia_128_ctr_procname); + FuncLoadError := not assigned(EVP_camellia_128_ctr); + if FuncLoadError then + begin + {$if not defined(EVP_camellia_128_ctr_allownil)} + EVP_camellia_128_ctr := @ERR_EVP_camellia_128_ctr; + {$ifend} + {$if declared(EVP_camellia_128_ctr_introduced)} + if LibVersion < EVP_camellia_128_ctr_introduced then + begin + {$if declared(FC_EVP_camellia_128_ctr)} + EVP_camellia_128_ctr := @FC_EVP_camellia_128_ctr; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_camellia_128_ctr_removed)} + if EVP_camellia_128_ctr_removed <= LibVersion then + begin + {$if declared(_EVP_camellia_128_ctr)} + EVP_camellia_128_ctr := @_EVP_camellia_128_ctr; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_camellia_128_ctr_allownil)} + if FuncLoadError then + AFailed.Add('EVP_camellia_128_ctr'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_camellia_192_ecb := LoadLibFunction(ADllHandle, EVP_camellia_192_ecb_procname); + FuncLoadError := not assigned(EVP_camellia_192_ecb); + if FuncLoadError then + begin + {$if not defined(EVP_camellia_192_ecb_allownil)} + EVP_camellia_192_ecb := @ERR_EVP_camellia_192_ecb; + {$ifend} + {$if declared(EVP_camellia_192_ecb_introduced)} + if LibVersion < EVP_camellia_192_ecb_introduced then + begin + {$if declared(FC_EVP_camellia_192_ecb)} + EVP_camellia_192_ecb := @FC_EVP_camellia_192_ecb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_camellia_192_ecb_removed)} + if EVP_camellia_192_ecb_removed <= LibVersion then + begin + {$if declared(_EVP_camellia_192_ecb)} + EVP_camellia_192_ecb := @_EVP_camellia_192_ecb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_camellia_192_ecb_allownil)} + if FuncLoadError then + AFailed.Add('EVP_camellia_192_ecb'); + {$ifend} + end; + + + EVP_camellia_192_cbc := LoadLibFunction(ADllHandle, EVP_camellia_192_cbc_procname); + FuncLoadError := not assigned(EVP_camellia_192_cbc); + if FuncLoadError then + begin + {$if not defined(EVP_camellia_192_cbc_allownil)} + EVP_camellia_192_cbc := @ERR_EVP_camellia_192_cbc; + {$ifend} + {$if declared(EVP_camellia_192_cbc_introduced)} + if LibVersion < EVP_camellia_192_cbc_introduced then + begin + {$if declared(FC_EVP_camellia_192_cbc)} + EVP_camellia_192_cbc := @FC_EVP_camellia_192_cbc; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_camellia_192_cbc_removed)} + if EVP_camellia_192_cbc_removed <= LibVersion then + begin + {$if declared(_EVP_camellia_192_cbc)} + EVP_camellia_192_cbc := @_EVP_camellia_192_cbc; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_camellia_192_cbc_allownil)} + if FuncLoadError then + AFailed.Add('EVP_camellia_192_cbc'); + {$ifend} + end; + + + EVP_camellia_192_cfb1 := LoadLibFunction(ADllHandle, EVP_camellia_192_cfb1_procname); + FuncLoadError := not assigned(EVP_camellia_192_cfb1); + if FuncLoadError then + begin + {$if not defined(EVP_camellia_192_cfb1_allownil)} + EVP_camellia_192_cfb1 := @ERR_EVP_camellia_192_cfb1; + {$ifend} + {$if declared(EVP_camellia_192_cfb1_introduced)} + if LibVersion < EVP_camellia_192_cfb1_introduced then + begin + {$if declared(FC_EVP_camellia_192_cfb1)} + EVP_camellia_192_cfb1 := @FC_EVP_camellia_192_cfb1; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_camellia_192_cfb1_removed)} + if EVP_camellia_192_cfb1_removed <= LibVersion then + begin + {$if declared(_EVP_camellia_192_cfb1)} + EVP_camellia_192_cfb1 := @_EVP_camellia_192_cfb1; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_camellia_192_cfb1_allownil)} + if FuncLoadError then + AFailed.Add('EVP_camellia_192_cfb1'); + {$ifend} + end; + + + EVP_camellia_192_cfb8 := LoadLibFunction(ADllHandle, EVP_camellia_192_cfb8_procname); + FuncLoadError := not assigned(EVP_camellia_192_cfb8); + if FuncLoadError then + begin + {$if not defined(EVP_camellia_192_cfb8_allownil)} + EVP_camellia_192_cfb8 := @ERR_EVP_camellia_192_cfb8; + {$ifend} + {$if declared(EVP_camellia_192_cfb8_introduced)} + if LibVersion < EVP_camellia_192_cfb8_introduced then + begin + {$if declared(FC_EVP_camellia_192_cfb8)} + EVP_camellia_192_cfb8 := @FC_EVP_camellia_192_cfb8; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_camellia_192_cfb8_removed)} + if EVP_camellia_192_cfb8_removed <= LibVersion then + begin + {$if declared(_EVP_camellia_192_cfb8)} + EVP_camellia_192_cfb8 := @_EVP_camellia_192_cfb8; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_camellia_192_cfb8_allownil)} + if FuncLoadError then + AFailed.Add('EVP_camellia_192_cfb8'); + {$ifend} + end; + + + EVP_camellia_192_cfb128 := LoadLibFunction(ADllHandle, EVP_camellia_192_cfb128_procname); + FuncLoadError := not assigned(EVP_camellia_192_cfb128); + if FuncLoadError then + begin + {$if not defined(EVP_camellia_192_cfb128_allownil)} + EVP_camellia_192_cfb128 := @ERR_EVP_camellia_192_cfb128; + {$ifend} + {$if declared(EVP_camellia_192_cfb128_introduced)} + if LibVersion < EVP_camellia_192_cfb128_introduced then + begin + {$if declared(FC_EVP_camellia_192_cfb128)} + EVP_camellia_192_cfb128 := @FC_EVP_camellia_192_cfb128; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_camellia_192_cfb128_removed)} + if EVP_camellia_192_cfb128_removed <= LibVersion then + begin + {$if declared(_EVP_camellia_192_cfb128)} + EVP_camellia_192_cfb128 := @_EVP_camellia_192_cfb128; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_camellia_192_cfb128_allownil)} + if FuncLoadError then + AFailed.Add('EVP_camellia_192_cfb128'); + {$ifend} + end; + + + EVP_camellia_192_ofb := LoadLibFunction(ADllHandle, EVP_camellia_192_ofb_procname); + FuncLoadError := not assigned(EVP_camellia_192_ofb); + if FuncLoadError then + begin + {$if not defined(EVP_camellia_192_ofb_allownil)} + EVP_camellia_192_ofb := @ERR_EVP_camellia_192_ofb; + {$ifend} + {$if declared(EVP_camellia_192_ofb_introduced)} + if LibVersion < EVP_camellia_192_ofb_introduced then + begin + {$if declared(FC_EVP_camellia_192_ofb)} + EVP_camellia_192_ofb := @FC_EVP_camellia_192_ofb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_camellia_192_ofb_removed)} + if EVP_camellia_192_ofb_removed <= LibVersion then + begin + {$if declared(_EVP_camellia_192_ofb)} + EVP_camellia_192_ofb := @_EVP_camellia_192_ofb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_camellia_192_ofb_allownil)} + if FuncLoadError then + AFailed.Add('EVP_camellia_192_ofb'); + {$ifend} + end; + + + EVP_camellia_192_ctr := LoadLibFunction(ADllHandle, EVP_camellia_192_ctr_procname); + FuncLoadError := not assigned(EVP_camellia_192_ctr); + if FuncLoadError then + begin + {$if not defined(EVP_camellia_192_ctr_allownil)} + EVP_camellia_192_ctr := @ERR_EVP_camellia_192_ctr; + {$ifend} + {$if declared(EVP_camellia_192_ctr_introduced)} + if LibVersion < EVP_camellia_192_ctr_introduced then + begin + {$if declared(FC_EVP_camellia_192_ctr)} + EVP_camellia_192_ctr := @FC_EVP_camellia_192_ctr; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_camellia_192_ctr_removed)} + if EVP_camellia_192_ctr_removed <= LibVersion then + begin + {$if declared(_EVP_camellia_192_ctr)} + EVP_camellia_192_ctr := @_EVP_camellia_192_ctr; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_camellia_192_ctr_allownil)} + if FuncLoadError then + AFailed.Add('EVP_camellia_192_ctr'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_camellia_256_ecb := LoadLibFunction(ADllHandle, EVP_camellia_256_ecb_procname); + FuncLoadError := not assigned(EVP_camellia_256_ecb); + if FuncLoadError then + begin + {$if not defined(EVP_camellia_256_ecb_allownil)} + EVP_camellia_256_ecb := @ERR_EVP_camellia_256_ecb; + {$ifend} + {$if declared(EVP_camellia_256_ecb_introduced)} + if LibVersion < EVP_camellia_256_ecb_introduced then + begin + {$if declared(FC_EVP_camellia_256_ecb)} + EVP_camellia_256_ecb := @FC_EVP_camellia_256_ecb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_camellia_256_ecb_removed)} + if EVP_camellia_256_ecb_removed <= LibVersion then + begin + {$if declared(_EVP_camellia_256_ecb)} + EVP_camellia_256_ecb := @_EVP_camellia_256_ecb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_camellia_256_ecb_allownil)} + if FuncLoadError then + AFailed.Add('EVP_camellia_256_ecb'); + {$ifend} + end; + + + EVP_camellia_256_cbc := LoadLibFunction(ADllHandle, EVP_camellia_256_cbc_procname); + FuncLoadError := not assigned(EVP_camellia_256_cbc); + if FuncLoadError then + begin + {$if not defined(EVP_camellia_256_cbc_allownil)} + EVP_camellia_256_cbc := @ERR_EVP_camellia_256_cbc; + {$ifend} + {$if declared(EVP_camellia_256_cbc_introduced)} + if LibVersion < EVP_camellia_256_cbc_introduced then + begin + {$if declared(FC_EVP_camellia_256_cbc)} + EVP_camellia_256_cbc := @FC_EVP_camellia_256_cbc; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_camellia_256_cbc_removed)} + if EVP_camellia_256_cbc_removed <= LibVersion then + begin + {$if declared(_EVP_camellia_256_cbc)} + EVP_camellia_256_cbc := @_EVP_camellia_256_cbc; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_camellia_256_cbc_allownil)} + if FuncLoadError then + AFailed.Add('EVP_camellia_256_cbc'); + {$ifend} + end; + + + EVP_camellia_256_cfb1 := LoadLibFunction(ADllHandle, EVP_camellia_256_cfb1_procname); + FuncLoadError := not assigned(EVP_camellia_256_cfb1); + if FuncLoadError then + begin + {$if not defined(EVP_camellia_256_cfb1_allownil)} + EVP_camellia_256_cfb1 := @ERR_EVP_camellia_256_cfb1; + {$ifend} + {$if declared(EVP_camellia_256_cfb1_introduced)} + if LibVersion < EVP_camellia_256_cfb1_introduced then + begin + {$if declared(FC_EVP_camellia_256_cfb1)} + EVP_camellia_256_cfb1 := @FC_EVP_camellia_256_cfb1; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_camellia_256_cfb1_removed)} + if EVP_camellia_256_cfb1_removed <= LibVersion then + begin + {$if declared(_EVP_camellia_256_cfb1)} + EVP_camellia_256_cfb1 := @_EVP_camellia_256_cfb1; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_camellia_256_cfb1_allownil)} + if FuncLoadError then + AFailed.Add('EVP_camellia_256_cfb1'); + {$ifend} + end; + + + EVP_camellia_256_cfb8 := LoadLibFunction(ADllHandle, EVP_camellia_256_cfb8_procname); + FuncLoadError := not assigned(EVP_camellia_256_cfb8); + if FuncLoadError then + begin + {$if not defined(EVP_camellia_256_cfb8_allownil)} + EVP_camellia_256_cfb8 := @ERR_EVP_camellia_256_cfb8; + {$ifend} + {$if declared(EVP_camellia_256_cfb8_introduced)} + if LibVersion < EVP_camellia_256_cfb8_introduced then + begin + {$if declared(FC_EVP_camellia_256_cfb8)} + EVP_camellia_256_cfb8 := @FC_EVP_camellia_256_cfb8; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_camellia_256_cfb8_removed)} + if EVP_camellia_256_cfb8_removed <= LibVersion then + begin + {$if declared(_EVP_camellia_256_cfb8)} + EVP_camellia_256_cfb8 := @_EVP_camellia_256_cfb8; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_camellia_256_cfb8_allownil)} + if FuncLoadError then + AFailed.Add('EVP_camellia_256_cfb8'); + {$ifend} + end; + + + EVP_camellia_256_cfb128 := LoadLibFunction(ADllHandle, EVP_camellia_256_cfb128_procname); + FuncLoadError := not assigned(EVP_camellia_256_cfb128); + if FuncLoadError then + begin + {$if not defined(EVP_camellia_256_cfb128_allownil)} + EVP_camellia_256_cfb128 := @ERR_EVP_camellia_256_cfb128; + {$ifend} + {$if declared(EVP_camellia_256_cfb128_introduced)} + if LibVersion < EVP_camellia_256_cfb128_introduced then + begin + {$if declared(FC_EVP_camellia_256_cfb128)} + EVP_camellia_256_cfb128 := @FC_EVP_camellia_256_cfb128; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_camellia_256_cfb128_removed)} + if EVP_camellia_256_cfb128_removed <= LibVersion then + begin + {$if declared(_EVP_camellia_256_cfb128)} + EVP_camellia_256_cfb128 := @_EVP_camellia_256_cfb128; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_camellia_256_cfb128_allownil)} + if FuncLoadError then + AFailed.Add('EVP_camellia_256_cfb128'); + {$ifend} + end; + + + EVP_camellia_256_ofb := LoadLibFunction(ADllHandle, EVP_camellia_256_ofb_procname); + FuncLoadError := not assigned(EVP_camellia_256_ofb); + if FuncLoadError then + begin + {$if not defined(EVP_camellia_256_ofb_allownil)} + EVP_camellia_256_ofb := @ERR_EVP_camellia_256_ofb; + {$ifend} + {$if declared(EVP_camellia_256_ofb_introduced)} + if LibVersion < EVP_camellia_256_ofb_introduced then + begin + {$if declared(FC_EVP_camellia_256_ofb)} + EVP_camellia_256_ofb := @FC_EVP_camellia_256_ofb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_camellia_256_ofb_removed)} + if EVP_camellia_256_ofb_removed <= LibVersion then + begin + {$if declared(_EVP_camellia_256_ofb)} + EVP_camellia_256_ofb := @_EVP_camellia_256_ofb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_camellia_256_ofb_allownil)} + if FuncLoadError then + AFailed.Add('EVP_camellia_256_ofb'); + {$ifend} + end; + + + EVP_camellia_256_ctr := LoadLibFunction(ADllHandle, EVP_camellia_256_ctr_procname); + FuncLoadError := not assigned(EVP_camellia_256_ctr); + if FuncLoadError then + begin + {$if not defined(EVP_camellia_256_ctr_allownil)} + EVP_camellia_256_ctr := @ERR_EVP_camellia_256_ctr; + {$ifend} + {$if declared(EVP_camellia_256_ctr_introduced)} + if LibVersion < EVP_camellia_256_ctr_introduced then + begin + {$if declared(FC_EVP_camellia_256_ctr)} + EVP_camellia_256_ctr := @FC_EVP_camellia_256_ctr; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_camellia_256_ctr_removed)} + if EVP_camellia_256_ctr_removed <= LibVersion then + begin + {$if declared(_EVP_camellia_256_ctr)} + EVP_camellia_256_ctr := @_EVP_camellia_256_ctr; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_camellia_256_ctr_allownil)} + if FuncLoadError then + AFailed.Add('EVP_camellia_256_ctr'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_chacha20 := LoadLibFunction(ADllHandle, EVP_chacha20_procname); + FuncLoadError := not assigned(EVP_chacha20); + if FuncLoadError then + begin + {$if not defined(EVP_chacha20_allownil)} + EVP_chacha20 := @ERR_EVP_chacha20; + {$ifend} + {$if declared(EVP_chacha20_introduced)} + if LibVersion < EVP_chacha20_introduced then + begin + {$if declared(FC_EVP_chacha20)} + EVP_chacha20 := @FC_EVP_chacha20; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_chacha20_removed)} + if EVP_chacha20_removed <= LibVersion then + begin + {$if declared(_EVP_chacha20)} + EVP_chacha20 := @_EVP_chacha20; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_chacha20_allownil)} + if FuncLoadError then + AFailed.Add('EVP_chacha20'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_chacha20_poly1305 := LoadLibFunction(ADllHandle, EVP_chacha20_poly1305_procname); + FuncLoadError := not assigned(EVP_chacha20_poly1305); + if FuncLoadError then + begin + {$if not defined(EVP_chacha20_poly1305_allownil)} + EVP_chacha20_poly1305 := @ERR_EVP_chacha20_poly1305; + {$ifend} + {$if declared(EVP_chacha20_poly1305_introduced)} + if LibVersion < EVP_chacha20_poly1305_introduced then + begin + {$if declared(FC_EVP_chacha20_poly1305)} + EVP_chacha20_poly1305 := @FC_EVP_chacha20_poly1305; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_chacha20_poly1305_removed)} + if EVP_chacha20_poly1305_removed <= LibVersion then + begin + {$if declared(_EVP_chacha20_poly1305)} + EVP_chacha20_poly1305 := @_EVP_chacha20_poly1305; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_chacha20_poly1305_allownil)} + if FuncLoadError then + AFailed.Add('EVP_chacha20_poly1305'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_seed_ecb := LoadLibFunction(ADllHandle, EVP_seed_ecb_procname); + FuncLoadError := not assigned(EVP_seed_ecb); + if FuncLoadError then + begin + {$if not defined(EVP_seed_ecb_allownil)} + EVP_seed_ecb := @ERR_EVP_seed_ecb; + {$ifend} + {$if declared(EVP_seed_ecb_introduced)} + if LibVersion < EVP_seed_ecb_introduced then + begin + {$if declared(FC_EVP_seed_ecb)} + EVP_seed_ecb := @FC_EVP_seed_ecb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_seed_ecb_removed)} + if EVP_seed_ecb_removed <= LibVersion then + begin + {$if declared(_EVP_seed_ecb)} + EVP_seed_ecb := @_EVP_seed_ecb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_seed_ecb_allownil)} + if FuncLoadError then + AFailed.Add('EVP_seed_ecb'); + {$ifend} + end; + + + EVP_seed_cbc := LoadLibFunction(ADllHandle, EVP_seed_cbc_procname); + FuncLoadError := not assigned(EVP_seed_cbc); + if FuncLoadError then + begin + {$if not defined(EVP_seed_cbc_allownil)} + EVP_seed_cbc := @ERR_EVP_seed_cbc; + {$ifend} + {$if declared(EVP_seed_cbc_introduced)} + if LibVersion < EVP_seed_cbc_introduced then + begin + {$if declared(FC_EVP_seed_cbc)} + EVP_seed_cbc := @FC_EVP_seed_cbc; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_seed_cbc_removed)} + if EVP_seed_cbc_removed <= LibVersion then + begin + {$if declared(_EVP_seed_cbc)} + EVP_seed_cbc := @_EVP_seed_cbc; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_seed_cbc_allownil)} + if FuncLoadError then + AFailed.Add('EVP_seed_cbc'); + {$ifend} + end; + + + EVP_seed_cfb128 := LoadLibFunction(ADllHandle, EVP_seed_cfb128_procname); + FuncLoadError := not assigned(EVP_seed_cfb128); + if FuncLoadError then + begin + {$if not defined(EVP_seed_cfb128_allownil)} + EVP_seed_cfb128 := @ERR_EVP_seed_cfb128; + {$ifend} + {$if declared(EVP_seed_cfb128_introduced)} + if LibVersion < EVP_seed_cfb128_introduced then + begin + {$if declared(FC_EVP_seed_cfb128)} + EVP_seed_cfb128 := @FC_EVP_seed_cfb128; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_seed_cfb128_removed)} + if EVP_seed_cfb128_removed <= LibVersion then + begin + {$if declared(_EVP_seed_cfb128)} + EVP_seed_cfb128 := @_EVP_seed_cfb128; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_seed_cfb128_allownil)} + if FuncLoadError then + AFailed.Add('EVP_seed_cfb128'); + {$ifend} + end; + + + EVP_seed_ofb := LoadLibFunction(ADllHandle, EVP_seed_ofb_procname); + FuncLoadError := not assigned(EVP_seed_ofb); + if FuncLoadError then + begin + {$if not defined(EVP_seed_ofb_allownil)} + EVP_seed_ofb := @ERR_EVP_seed_ofb; + {$ifend} + {$if declared(EVP_seed_ofb_introduced)} + if LibVersion < EVP_seed_ofb_introduced then + begin + {$if declared(FC_EVP_seed_ofb)} + EVP_seed_ofb := @FC_EVP_seed_ofb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_seed_ofb_removed)} + if EVP_seed_ofb_removed <= LibVersion then + begin + {$if declared(_EVP_seed_ofb)} + EVP_seed_ofb := @_EVP_seed_ofb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_seed_ofb_allownil)} + if FuncLoadError then + AFailed.Add('EVP_seed_ofb'); + {$ifend} + end; + + + EVP_sm4_ecb := LoadLibFunction(ADllHandle, EVP_sm4_ecb_procname); + FuncLoadError := not assigned(EVP_sm4_ecb); + if FuncLoadError then + begin + {$if not defined(EVP_sm4_ecb_allownil)} + EVP_sm4_ecb := @ERR_EVP_sm4_ecb; + {$ifend} + {$if declared(EVP_sm4_ecb_introduced)} + if LibVersion < EVP_sm4_ecb_introduced then + begin + {$if declared(FC_EVP_sm4_ecb)} + EVP_sm4_ecb := @FC_EVP_sm4_ecb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_sm4_ecb_removed)} + if EVP_sm4_ecb_removed <= LibVersion then + begin + {$if declared(_EVP_sm4_ecb)} + EVP_sm4_ecb := @_EVP_sm4_ecb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_sm4_ecb_allownil)} + if FuncLoadError then + AFailed.Add('EVP_sm4_ecb'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_sm4_cbc := LoadLibFunction(ADllHandle, EVP_sm4_cbc_procname); + FuncLoadError := not assigned(EVP_sm4_cbc); + if FuncLoadError then + begin + {$if not defined(EVP_sm4_cbc_allownil)} + EVP_sm4_cbc := @ERR_EVP_sm4_cbc; + {$ifend} + {$if declared(EVP_sm4_cbc_introduced)} + if LibVersion < EVP_sm4_cbc_introduced then + begin + {$if declared(FC_EVP_sm4_cbc)} + EVP_sm4_cbc := @FC_EVP_sm4_cbc; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_sm4_cbc_removed)} + if EVP_sm4_cbc_removed <= LibVersion then + begin + {$if declared(_EVP_sm4_cbc)} + EVP_sm4_cbc := @_EVP_sm4_cbc; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_sm4_cbc_allownil)} + if FuncLoadError then + AFailed.Add('EVP_sm4_cbc'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_sm4_cfb128 := LoadLibFunction(ADllHandle, EVP_sm4_cfb128_procname); + FuncLoadError := not assigned(EVP_sm4_cfb128); + if FuncLoadError then + begin + {$if not defined(EVP_sm4_cfb128_allownil)} + EVP_sm4_cfb128 := @ERR_EVP_sm4_cfb128; + {$ifend} + {$if declared(EVP_sm4_cfb128_introduced)} + if LibVersion < EVP_sm4_cfb128_introduced then + begin + {$if declared(FC_EVP_sm4_cfb128)} + EVP_sm4_cfb128 := @FC_EVP_sm4_cfb128; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_sm4_cfb128_removed)} + if EVP_sm4_cfb128_removed <= LibVersion then + begin + {$if declared(_EVP_sm4_cfb128)} + EVP_sm4_cfb128 := @_EVP_sm4_cfb128; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_sm4_cfb128_allownil)} + if FuncLoadError then + AFailed.Add('EVP_sm4_cfb128'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_sm4_ofb := LoadLibFunction(ADllHandle, EVP_sm4_ofb_procname); + FuncLoadError := not assigned(EVP_sm4_ofb); + if FuncLoadError then + begin + {$if not defined(EVP_sm4_ofb_allownil)} + EVP_sm4_ofb := @ERR_EVP_sm4_ofb; + {$ifend} + {$if declared(EVP_sm4_ofb_introduced)} + if LibVersion < EVP_sm4_ofb_introduced then + begin + {$if declared(FC_EVP_sm4_ofb)} + EVP_sm4_ofb := @FC_EVP_sm4_ofb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_sm4_ofb_removed)} + if EVP_sm4_ofb_removed <= LibVersion then + begin + {$if declared(_EVP_sm4_ofb)} + EVP_sm4_ofb := @_EVP_sm4_ofb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_sm4_ofb_allownil)} + if FuncLoadError then + AFailed.Add('EVP_sm4_ofb'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_sm4_ctr := LoadLibFunction(ADllHandle, EVP_sm4_ctr_procname); + FuncLoadError := not assigned(EVP_sm4_ctr); + if FuncLoadError then + begin + {$if not defined(EVP_sm4_ctr_allownil)} + EVP_sm4_ctr := @ERR_EVP_sm4_ctr; + {$ifend} + {$if declared(EVP_sm4_ctr_introduced)} + if LibVersion < EVP_sm4_ctr_introduced then + begin + {$if declared(FC_EVP_sm4_ctr)} + EVP_sm4_ctr := @FC_EVP_sm4_ctr; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_sm4_ctr_removed)} + if EVP_sm4_ctr_removed <= LibVersion then + begin + {$if declared(_EVP_sm4_ctr)} + EVP_sm4_ctr := @_EVP_sm4_ctr; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_sm4_ctr_allownil)} + if FuncLoadError then + AFailed.Add('EVP_sm4_ctr'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_add_cipher := LoadLibFunction(ADllHandle, EVP_add_cipher_procname); + FuncLoadError := not assigned(EVP_add_cipher); + if FuncLoadError then + begin + {$if not defined(EVP_add_cipher_allownil)} + EVP_add_cipher := @ERR_EVP_add_cipher; + {$ifend} + {$if declared(EVP_add_cipher_introduced)} + if LibVersion < EVP_add_cipher_introduced then + begin + {$if declared(FC_EVP_add_cipher)} + EVP_add_cipher := @FC_EVP_add_cipher; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_add_cipher_removed)} + if EVP_add_cipher_removed <= LibVersion then + begin + {$if declared(_EVP_add_cipher)} + EVP_add_cipher := @_EVP_add_cipher; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_add_cipher_allownil)} + if FuncLoadError then + AFailed.Add('EVP_add_cipher'); + {$ifend} + end; + + + EVP_add_digest := LoadLibFunction(ADllHandle, EVP_add_digest_procname); + FuncLoadError := not assigned(EVP_add_digest); + if FuncLoadError then + begin + {$if not defined(EVP_add_digest_allownil)} + EVP_add_digest := @ERR_EVP_add_digest; + {$ifend} + {$if declared(EVP_add_digest_introduced)} + if LibVersion < EVP_add_digest_introduced then + begin + {$if declared(FC_EVP_add_digest)} + EVP_add_digest := @FC_EVP_add_digest; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_add_digest_removed)} + if EVP_add_digest_removed <= LibVersion then + begin + {$if declared(_EVP_add_digest)} + EVP_add_digest := @_EVP_add_digest; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_add_digest_allownil)} + if FuncLoadError then + AFailed.Add('EVP_add_digest'); + {$ifend} + end; + + + EVP_get_cipherbyname := LoadLibFunction(ADllHandle, EVP_get_cipherbyname_procname); + FuncLoadError := not assigned(EVP_get_cipherbyname); + if FuncLoadError then + begin + {$if not defined(EVP_get_cipherbyname_allownil)} + EVP_get_cipherbyname := @ERR_EVP_get_cipherbyname; + {$ifend} + {$if declared(EVP_get_cipherbyname_introduced)} + if LibVersion < EVP_get_cipherbyname_introduced then + begin + {$if declared(FC_EVP_get_cipherbyname)} + EVP_get_cipherbyname := @FC_EVP_get_cipherbyname; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_get_cipherbyname_removed)} + if EVP_get_cipherbyname_removed <= LibVersion then + begin + {$if declared(_EVP_get_cipherbyname)} + EVP_get_cipherbyname := @_EVP_get_cipherbyname; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_get_cipherbyname_allownil)} + if FuncLoadError then + AFailed.Add('EVP_get_cipherbyname'); + {$ifend} + end; + + + EVP_get_digestbyname := LoadLibFunction(ADllHandle, EVP_get_digestbyname_procname); + FuncLoadError := not assigned(EVP_get_digestbyname); + if FuncLoadError then + begin + {$if not defined(EVP_get_digestbyname_allownil)} + EVP_get_digestbyname := @ERR_EVP_get_digestbyname; + {$ifend} + {$if declared(EVP_get_digestbyname_introduced)} + if LibVersion < EVP_get_digestbyname_introduced then + begin + {$if declared(FC_EVP_get_digestbyname)} + EVP_get_digestbyname := @FC_EVP_get_digestbyname; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_get_digestbyname_removed)} + if EVP_get_digestbyname_removed <= LibVersion then + begin + {$if declared(_EVP_get_digestbyname)} + EVP_get_digestbyname := @_EVP_get_digestbyname; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_get_digestbyname_allownil)} + if FuncLoadError then + AFailed.Add('EVP_get_digestbyname'); + {$ifend} + end; + + + EVP_CIPHER_do_all := LoadLibFunction(ADllHandle, EVP_CIPHER_do_all_procname); + FuncLoadError := not assigned(EVP_CIPHER_do_all); + if FuncLoadError then + begin + {$if not defined(EVP_CIPHER_do_all_allownil)} + EVP_CIPHER_do_all := @ERR_EVP_CIPHER_do_all; + {$ifend} + {$if declared(EVP_CIPHER_do_all_introduced)} + if LibVersion < EVP_CIPHER_do_all_introduced then + begin + {$if declared(FC_EVP_CIPHER_do_all)} + EVP_CIPHER_do_all := @FC_EVP_CIPHER_do_all; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_CIPHER_do_all_removed)} + if EVP_CIPHER_do_all_removed <= LibVersion then + begin + {$if declared(_EVP_CIPHER_do_all)} + EVP_CIPHER_do_all := @_EVP_CIPHER_do_all; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_CIPHER_do_all_allownil)} + if FuncLoadError then + AFailed.Add('EVP_CIPHER_do_all'); + {$ifend} + end; + + + EVP_CIPHER_do_all_sorted := LoadLibFunction(ADllHandle, EVP_CIPHER_do_all_sorted_procname); + FuncLoadError := not assigned(EVP_CIPHER_do_all_sorted); + if FuncLoadError then + begin + {$if not defined(EVP_CIPHER_do_all_sorted_allownil)} + EVP_CIPHER_do_all_sorted := @ERR_EVP_CIPHER_do_all_sorted; + {$ifend} + {$if declared(EVP_CIPHER_do_all_sorted_introduced)} + if LibVersion < EVP_CIPHER_do_all_sorted_introduced then + begin + {$if declared(FC_EVP_CIPHER_do_all_sorted)} + EVP_CIPHER_do_all_sorted := @FC_EVP_CIPHER_do_all_sorted; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_CIPHER_do_all_sorted_removed)} + if EVP_CIPHER_do_all_sorted_removed <= LibVersion then + begin + {$if declared(_EVP_CIPHER_do_all_sorted)} + EVP_CIPHER_do_all_sorted := @_EVP_CIPHER_do_all_sorted; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_CIPHER_do_all_sorted_allownil)} + if FuncLoadError then + AFailed.Add('EVP_CIPHER_do_all_sorted'); + {$ifend} + end; + + + EVP_MD_do_all := LoadLibFunction(ADllHandle, EVP_MD_do_all_procname); + FuncLoadError := not assigned(EVP_MD_do_all); + if FuncLoadError then + begin + {$if not defined(EVP_MD_do_all_allownil)} + EVP_MD_do_all := @ERR_EVP_MD_do_all; + {$ifend} + {$if declared(EVP_MD_do_all_introduced)} + if LibVersion < EVP_MD_do_all_introduced then + begin + {$if declared(FC_EVP_MD_do_all)} + EVP_MD_do_all := @FC_EVP_MD_do_all; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_MD_do_all_removed)} + if EVP_MD_do_all_removed <= LibVersion then + begin + {$if declared(_EVP_MD_do_all)} + EVP_MD_do_all := @_EVP_MD_do_all; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_MD_do_all_allownil)} + if FuncLoadError then + AFailed.Add('EVP_MD_do_all'); + {$ifend} + end; + + + EVP_MD_do_all_sorted := LoadLibFunction(ADllHandle, EVP_MD_do_all_sorted_procname); + FuncLoadError := not assigned(EVP_MD_do_all_sorted); + if FuncLoadError then + begin + {$if not defined(EVP_MD_do_all_sorted_allownil)} + EVP_MD_do_all_sorted := @ERR_EVP_MD_do_all_sorted; + {$ifend} + {$if declared(EVP_MD_do_all_sorted_introduced)} + if LibVersion < EVP_MD_do_all_sorted_introduced then + begin + {$if declared(FC_EVP_MD_do_all_sorted)} + EVP_MD_do_all_sorted := @FC_EVP_MD_do_all_sorted; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_MD_do_all_sorted_removed)} + if EVP_MD_do_all_sorted_removed <= LibVersion then + begin + {$if declared(_EVP_MD_do_all_sorted)} + EVP_MD_do_all_sorted := @_EVP_MD_do_all_sorted; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_MD_do_all_sorted_allownil)} + if FuncLoadError then + AFailed.Add('EVP_MD_do_all_sorted'); + {$ifend} + end; + + + EVP_PKEY_decrypt_old := LoadLibFunction(ADllHandle, EVP_PKEY_decrypt_old_procname); + FuncLoadError := not assigned(EVP_PKEY_decrypt_old); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_decrypt_old_allownil)} + EVP_PKEY_decrypt_old := @ERR_EVP_PKEY_decrypt_old; + {$ifend} + {$if declared(EVP_PKEY_decrypt_old_introduced)} + if LibVersion < EVP_PKEY_decrypt_old_introduced then + begin + {$if declared(FC_EVP_PKEY_decrypt_old)} + EVP_PKEY_decrypt_old := @FC_EVP_PKEY_decrypt_old; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_decrypt_old_removed)} + if EVP_PKEY_decrypt_old_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_decrypt_old)} + EVP_PKEY_decrypt_old := @_EVP_PKEY_decrypt_old; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_decrypt_old_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_decrypt_old'); + {$ifend} + end; + + + EVP_PKEY_encrypt_old := LoadLibFunction(ADllHandle, EVP_PKEY_encrypt_old_procname); + FuncLoadError := not assigned(EVP_PKEY_encrypt_old); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_encrypt_old_allownil)} + EVP_PKEY_encrypt_old := @ERR_EVP_PKEY_encrypt_old; + {$ifend} + {$if declared(EVP_PKEY_encrypt_old_introduced)} + if LibVersion < EVP_PKEY_encrypt_old_introduced then + begin + {$if declared(FC_EVP_PKEY_encrypt_old)} + EVP_PKEY_encrypt_old := @FC_EVP_PKEY_encrypt_old; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_encrypt_old_removed)} + if EVP_PKEY_encrypt_old_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_encrypt_old)} + EVP_PKEY_encrypt_old := @_EVP_PKEY_encrypt_old; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_encrypt_old_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_encrypt_old'); + {$ifend} + end; + + + EVP_PKEY_type := LoadLibFunction(ADllHandle, EVP_PKEY_type_procname); + FuncLoadError := not assigned(EVP_PKEY_type); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_type_allownil)} + EVP_PKEY_type := @ERR_EVP_PKEY_type; + {$ifend} + {$if declared(EVP_PKEY_type_introduced)} + if LibVersion < EVP_PKEY_type_introduced then + begin + {$if declared(FC_EVP_PKEY_type)} + EVP_PKEY_type := @FC_EVP_PKEY_type; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_type_removed)} + if EVP_PKEY_type_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_type)} + EVP_PKEY_type := @_EVP_PKEY_type; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_type_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_type'); + {$ifend} + end; + + + EVP_PKEY_id := LoadLibFunction(ADllHandle, EVP_PKEY_id_procname); + FuncLoadError := not assigned(EVP_PKEY_id); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_id_allownil)} + EVP_PKEY_id := @ERR_EVP_PKEY_id; + {$ifend} + {$if declared(EVP_PKEY_id_introduced)} + if LibVersion < EVP_PKEY_id_introduced then + begin + {$if declared(FC_EVP_PKEY_id)} + EVP_PKEY_id := @FC_EVP_PKEY_id; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_id_removed)} + if EVP_PKEY_id_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_id)} + EVP_PKEY_id := @_EVP_PKEY_id; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_id_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_id'); + {$ifend} + end; + + + EVP_PKEY_base_id := LoadLibFunction(ADllHandle, EVP_PKEY_base_id_procname); + if not Assigned(EVP_PKEY_base_id) then begin + EVP_PKEY_base_id := LoadLibFunction(ADllHandle, EVP_PKEY_get_base_id_procname); + end; + + FuncLoadError := not assigned(EVP_PKEY_base_id); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_base_id_allownil)} + EVP_PKEY_base_id := @ERR_EVP_PKEY_base_id; + {$ifend} + {$if declared(EVP_PKEY_base_id_introduced)} + if LibVersion < EVP_PKEY_base_id_introduced then + begin + {$if declared(FC_EVP_PKEY_base_id)} + EVP_PKEY_base_id := @FC_EVP_PKEY_base_id; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_base_id_removed)} + if EVP_PKEY_base_id_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_base_id)} + EVP_PKEY_base_id := @_EVP_PKEY_base_id; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_base_id_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_base_id'); + {$ifend} + end; + + + EVP_PKEY_bits := LoadLibFunction(ADllHandle, EVP_PKEY_bits_procname); + if not Assigned( EVP_PKEY_bits) then begin + EVP_PKEY_bits := LoadLibFunction(ADllHandle, EVP_PKEY_get_bits_procname); + end; + + FuncLoadError := not assigned(EVP_PKEY_bits); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_bits_allownil)} + EVP_PKEY_bits := @ERR_EVP_PKEY_bits; + {$ifend} + {$if declared(EVP_PKEY_bits_introduced)} + if LibVersion < EVP_PKEY_bits_introduced then + begin + {$if declared(FC_EVP_PKEY_bits)} + EVP_PKEY_bits := @FC_EVP_PKEY_bits; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_bits_removed)} + if EVP_PKEY_bits_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_bits)} + EVP_PKEY_bits := @_EVP_PKEY_bits; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_bits_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_bits'); + {$ifend} + end; + + + EVP_PKEY_security_bits := LoadLibFunction(ADllHandle, EVP_PKEY_security_bits_procname); + if not Assigned( EVP_PKEY_security_bits) then begin + EVP_PKEY_security_bits := LoadLibFunction(ADllHandle, EVP_PKEY_get_security_bits_procname); + end; + FuncLoadError := not assigned(EVP_PKEY_security_bits); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_security_bits_allownil)} + EVP_PKEY_security_bits := @ERR_EVP_PKEY_security_bits; + {$ifend} + {$if declared(EVP_PKEY_security_bits_introduced)} + if LibVersion < EVP_PKEY_security_bits_introduced then + begin + {$if declared(FC_EVP_PKEY_security_bits)} + EVP_PKEY_security_bits := @FC_EVP_PKEY_security_bits; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_security_bits_removed)} + if EVP_PKEY_security_bits_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_security_bits)} + EVP_PKEY_security_bits := @_EVP_PKEY_security_bits; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_security_bits_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_security_bits'); + {$ifend} + end; + + + EVP_PKEY_size := LoadLibFunction(ADllHandle, EVP_PKEY_size_procname); + if not Assigned( EVP_PKEY_size) then begin + EVP_PKEY_size := LoadLibFunction(ADllHandle, EVP_PKEY_get_size_procname); + end; + FuncLoadError := not assigned(EVP_PKEY_size); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_size_allownil)} + EVP_PKEY_size := @ERR_EVP_PKEY_size; + {$ifend} + {$if declared(EVP_PKEY_size_introduced)} + if LibVersion < EVP_PKEY_size_introduced then + begin + {$if declared(FC_EVP_PKEY_size)} + EVP_PKEY_size := @FC_EVP_PKEY_size; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_size_removed)} + if EVP_PKEY_size_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_size)} + EVP_PKEY_size := @_EVP_PKEY_size; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_size_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_size'); + {$ifend} + end; + + + EVP_PKEY_set_type := LoadLibFunction(ADllHandle, EVP_PKEY_set_type_procname); + FuncLoadError := not assigned(EVP_PKEY_set_type); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_set_type_allownil)} + EVP_PKEY_set_type := @ERR_EVP_PKEY_set_type; + {$ifend} + {$if declared(EVP_PKEY_set_type_introduced)} + if LibVersion < EVP_PKEY_set_type_introduced then + begin + {$if declared(FC_EVP_PKEY_set_type)} + EVP_PKEY_set_type := @FC_EVP_PKEY_set_type; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_set_type_removed)} + if EVP_PKEY_set_type_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_set_type)} + EVP_PKEY_set_type := @_EVP_PKEY_set_type; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_set_type_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_set_type'); + {$ifend} + end; + + + EVP_PKEY_set_type_str := LoadLibFunction(ADllHandle, EVP_PKEY_set_type_str_procname); + FuncLoadError := not assigned(EVP_PKEY_set_type_str); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_set_type_str_allownil)} + EVP_PKEY_set_type_str := @ERR_EVP_PKEY_set_type_str; + {$ifend} + {$if declared(EVP_PKEY_set_type_str_introduced)} + if LibVersion < EVP_PKEY_set_type_str_introduced then + begin + {$if declared(FC_EVP_PKEY_set_type_str)} + EVP_PKEY_set_type_str := @FC_EVP_PKEY_set_type_str; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_set_type_str_removed)} + if EVP_PKEY_set_type_str_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_set_type_str)} + EVP_PKEY_set_type_str := @_EVP_PKEY_set_type_str; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_set_type_str_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_set_type_str'); + {$ifend} + end; + + + EVP_PKEY_set_alias_type := LoadLibFunction(ADllHandle, EVP_PKEY_set_alias_type_procname); + FuncLoadError := not assigned(EVP_PKEY_set_alias_type); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_set_alias_type_allownil)} + EVP_PKEY_set_alias_type := @ERR_EVP_PKEY_set_alias_type; + {$ifend} + {$if declared(EVP_PKEY_set_alias_type_introduced)} + if LibVersion < EVP_PKEY_set_alias_type_introduced then + begin + {$if declared(FC_EVP_PKEY_set_alias_type)} + EVP_PKEY_set_alias_type := @FC_EVP_PKEY_set_alias_type; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_set_alias_type_removed)} + if EVP_PKEY_set_alias_type_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_set_alias_type)} + EVP_PKEY_set_alias_type := @_EVP_PKEY_set_alias_type; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_set_alias_type_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_set_alias_type'); + {$ifend} + end; + + + EVP_PKEY_set1_engine := LoadLibFunction(ADllHandle, EVP_PKEY_set1_engine_procname); + FuncLoadError := not assigned(EVP_PKEY_set1_engine); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_set1_engine_allownil)} + EVP_PKEY_set1_engine := @ERR_EVP_PKEY_set1_engine; + {$ifend} + {$if declared(EVP_PKEY_set1_engine_introduced)} + if LibVersion < EVP_PKEY_set1_engine_introduced then + begin + {$if declared(FC_EVP_PKEY_set1_engine)} + EVP_PKEY_set1_engine := @FC_EVP_PKEY_set1_engine; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_set1_engine_removed)} + if EVP_PKEY_set1_engine_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_set1_engine)} + EVP_PKEY_set1_engine := @_EVP_PKEY_set1_engine; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_set1_engine_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_set1_engine'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_PKEY_get0_engine := LoadLibFunction(ADllHandle, EVP_PKEY_get0_engine_procname); + FuncLoadError := not assigned(EVP_PKEY_get0_engine); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_get0_engine_allownil)} + EVP_PKEY_get0_engine := @ERR_EVP_PKEY_get0_engine; + {$ifend} + {$if declared(EVP_PKEY_get0_engine_introduced)} + if LibVersion < EVP_PKEY_get0_engine_introduced then + begin + {$if declared(FC_EVP_PKEY_get0_engine)} + EVP_PKEY_get0_engine := @FC_EVP_PKEY_get0_engine; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_get0_engine_removed)} + if EVP_PKEY_get0_engine_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_get0_engine)} + EVP_PKEY_get0_engine := @_EVP_PKEY_get0_engine; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_get0_engine_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_get0_engine'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_PKEY_assign := LoadLibFunction(ADllHandle, EVP_PKEY_assign_procname); + FuncLoadError := not assigned(EVP_PKEY_assign); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_assign_allownil)} + EVP_PKEY_assign := @ERR_EVP_PKEY_assign; + {$ifend} + {$if declared(EVP_PKEY_assign_introduced)} + if LibVersion < EVP_PKEY_assign_introduced then + begin + {$if declared(FC_EVP_PKEY_assign)} + EVP_PKEY_assign := @FC_EVP_PKEY_assign; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_assign_removed)} + if EVP_PKEY_assign_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_assign)} + EVP_PKEY_assign := @_EVP_PKEY_assign; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_assign_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_assign'); + {$ifend} + end; + + + EVP_PKEY_get0 := LoadLibFunction(ADllHandle, EVP_PKEY_get0_procname); + FuncLoadError := not assigned(EVP_PKEY_get0); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_get0_allownil)} + EVP_PKEY_get0 := @ERR_EVP_PKEY_get0; + {$ifend} + {$if declared(EVP_PKEY_get0_introduced)} + if LibVersion < EVP_PKEY_get0_introduced then + begin + {$if declared(FC_EVP_PKEY_get0)} + EVP_PKEY_get0 := @FC_EVP_PKEY_get0; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_get0_removed)} + if EVP_PKEY_get0_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_get0)} + EVP_PKEY_get0 := @_EVP_PKEY_get0; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_get0_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_get0'); + {$ifend} + end; + + + EVP_PKEY_get0_hmac := LoadLibFunction(ADllHandle, EVP_PKEY_get0_hmac_procname); + FuncLoadError := not assigned(EVP_PKEY_get0_hmac); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_get0_hmac_allownil)} + EVP_PKEY_get0_hmac := @ERR_EVP_PKEY_get0_hmac; + {$ifend} + {$if declared(EVP_PKEY_get0_hmac_introduced)} + if LibVersion < EVP_PKEY_get0_hmac_introduced then + begin + {$if declared(FC_EVP_PKEY_get0_hmac)} + EVP_PKEY_get0_hmac := @FC_EVP_PKEY_get0_hmac; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_get0_hmac_removed)} + if EVP_PKEY_get0_hmac_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_get0_hmac)} + EVP_PKEY_get0_hmac := @_EVP_PKEY_get0_hmac; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_get0_hmac_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_get0_hmac'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_PKEY_get0_poly1305 := LoadLibFunction(ADllHandle, EVP_PKEY_get0_poly1305_procname); + FuncLoadError := not assigned(EVP_PKEY_get0_poly1305); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_get0_poly1305_allownil)} + EVP_PKEY_get0_poly1305 := @ERR_EVP_PKEY_get0_poly1305; + {$ifend} + {$if declared(EVP_PKEY_get0_poly1305_introduced)} + if LibVersion < EVP_PKEY_get0_poly1305_introduced then + begin + {$if declared(FC_EVP_PKEY_get0_poly1305)} + EVP_PKEY_get0_poly1305 := @FC_EVP_PKEY_get0_poly1305; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_get0_poly1305_removed)} + if EVP_PKEY_get0_poly1305_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_get0_poly1305)} + EVP_PKEY_get0_poly1305 := @_EVP_PKEY_get0_poly1305; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_get0_poly1305_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_get0_poly1305'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_PKEY_get0_siphash := LoadLibFunction(ADllHandle, EVP_PKEY_get0_siphash_procname); + FuncLoadError := not assigned(EVP_PKEY_get0_siphash); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_get0_siphash_allownil)} + EVP_PKEY_get0_siphash := @ERR_EVP_PKEY_get0_siphash; + {$ifend} + {$if declared(EVP_PKEY_get0_siphash_introduced)} + if LibVersion < EVP_PKEY_get0_siphash_introduced then + begin + {$if declared(FC_EVP_PKEY_get0_siphash)} + EVP_PKEY_get0_siphash := @FC_EVP_PKEY_get0_siphash; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_get0_siphash_removed)} + if EVP_PKEY_get0_siphash_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_get0_siphash)} + EVP_PKEY_get0_siphash := @_EVP_PKEY_get0_siphash; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_get0_siphash_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_get0_siphash'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_PKEY_set1_RSA := LoadLibFunction(ADllHandle, EVP_PKEY_set1_RSA_procname); + FuncLoadError := not assigned(EVP_PKEY_set1_RSA); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_set1_RSA_allownil)} + EVP_PKEY_set1_RSA := @ERR_EVP_PKEY_set1_RSA; + {$ifend} + {$if declared(EVP_PKEY_set1_RSA_introduced)} + if LibVersion < EVP_PKEY_set1_RSA_introduced then + begin + {$if declared(FC_EVP_PKEY_set1_RSA)} + EVP_PKEY_set1_RSA := @FC_EVP_PKEY_set1_RSA; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_set1_RSA_removed)} + if EVP_PKEY_set1_RSA_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_set1_RSA)} + EVP_PKEY_set1_RSA := @_EVP_PKEY_set1_RSA; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_set1_RSA_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_set1_RSA'); + {$ifend} + end; + + + EVP_PKEY_get0_RSA := LoadLibFunction(ADllHandle, EVP_PKEY_get0_RSA_procname); + FuncLoadError := not assigned(EVP_PKEY_get0_RSA); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_get0_RSA_allownil)} + EVP_PKEY_get0_RSA := @ERR_EVP_PKEY_get0_RSA; + {$ifend} + {$if declared(EVP_PKEY_get0_RSA_introduced)} + if LibVersion < EVP_PKEY_get0_RSA_introduced then + begin + {$if declared(FC_EVP_PKEY_get0_RSA)} + EVP_PKEY_get0_RSA := @FC_EVP_PKEY_get0_RSA; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_get0_RSA_removed)} + if EVP_PKEY_get0_RSA_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_get0_RSA)} + EVP_PKEY_get0_RSA := @_EVP_PKEY_get0_RSA; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_get0_RSA_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_get0_RSA'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_PKEY_get1_RSA := LoadLibFunction(ADllHandle, EVP_PKEY_get1_RSA_procname); + FuncLoadError := not assigned(EVP_PKEY_get1_RSA); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_get1_RSA_allownil)} + EVP_PKEY_get1_RSA := @ERR_EVP_PKEY_get1_RSA; + {$ifend} + {$if declared(EVP_PKEY_get1_RSA_introduced)} + if LibVersion < EVP_PKEY_get1_RSA_introduced then + begin + {$if declared(FC_EVP_PKEY_get1_RSA)} + EVP_PKEY_get1_RSA := @FC_EVP_PKEY_get1_RSA; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_get1_RSA_removed)} + if EVP_PKEY_get1_RSA_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_get1_RSA)} + EVP_PKEY_get1_RSA := @_EVP_PKEY_get1_RSA; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_get1_RSA_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_get1_RSA'); + {$ifend} + end; + + + EVP_PKEY_set1_DSA := LoadLibFunction(ADllHandle, EVP_PKEY_set1_DSA_procname); + FuncLoadError := not assigned(EVP_PKEY_set1_DSA); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_set1_DSA_allownil)} + EVP_PKEY_set1_DSA := @ERR_EVP_PKEY_set1_DSA; + {$ifend} + {$if declared(EVP_PKEY_set1_DSA_introduced)} + if LibVersion < EVP_PKEY_set1_DSA_introduced then + begin + {$if declared(FC_EVP_PKEY_set1_DSA)} + EVP_PKEY_set1_DSA := @FC_EVP_PKEY_set1_DSA; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_set1_DSA_removed)} + if EVP_PKEY_set1_DSA_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_set1_DSA)} + EVP_PKEY_set1_DSA := @_EVP_PKEY_set1_DSA; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_set1_DSA_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_set1_DSA'); + {$ifend} + end; + + + EVP_PKEY_get0_DSA := LoadLibFunction(ADllHandle, EVP_PKEY_get0_DSA_procname); + FuncLoadError := not assigned(EVP_PKEY_get0_DSA); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_get0_DSA_allownil)} + EVP_PKEY_get0_DSA := @ERR_EVP_PKEY_get0_DSA; + {$ifend} + {$if declared(EVP_PKEY_get0_DSA_introduced)} + if LibVersion < EVP_PKEY_get0_DSA_introduced then + begin + {$if declared(FC_EVP_PKEY_get0_DSA)} + EVP_PKEY_get0_DSA := @FC_EVP_PKEY_get0_DSA; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_get0_DSA_removed)} + if EVP_PKEY_get0_DSA_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_get0_DSA)} + EVP_PKEY_get0_DSA := @_EVP_PKEY_get0_DSA; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_get0_DSA_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_get0_DSA'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_PKEY_get1_DSA := LoadLibFunction(ADllHandle, EVP_PKEY_get1_DSA_procname); + FuncLoadError := not assigned(EVP_PKEY_get1_DSA); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_get1_DSA_allownil)} + EVP_PKEY_get1_DSA := @ERR_EVP_PKEY_get1_DSA; + {$ifend} + {$if declared(EVP_PKEY_get1_DSA_introduced)} + if LibVersion < EVP_PKEY_get1_DSA_introduced then + begin + {$if declared(FC_EVP_PKEY_get1_DSA)} + EVP_PKEY_get1_DSA := @FC_EVP_PKEY_get1_DSA; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_get1_DSA_removed)} + if EVP_PKEY_get1_DSA_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_get1_DSA)} + EVP_PKEY_get1_DSA := @_EVP_PKEY_get1_DSA; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_get1_DSA_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_get1_DSA'); + {$ifend} + end; + + + EVP_PKEY_set1_DH := LoadLibFunction(ADllHandle, EVP_PKEY_set1_DH_procname); + FuncLoadError := not assigned(EVP_PKEY_set1_DH); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_set1_DH_allownil)} + EVP_PKEY_set1_DH := @ERR_EVP_PKEY_set1_DH; + {$ifend} + {$if declared(EVP_PKEY_set1_DH_introduced)} + if LibVersion < EVP_PKEY_set1_DH_introduced then + begin + {$if declared(FC_EVP_PKEY_set1_DH)} + EVP_PKEY_set1_DH := @FC_EVP_PKEY_set1_DH; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_set1_DH_removed)} + if EVP_PKEY_set1_DH_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_set1_DH)} + EVP_PKEY_set1_DH := @_EVP_PKEY_set1_DH; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_set1_DH_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_set1_DH'); + {$ifend} + end; + + + EVP_PKEY_get0_DH := LoadLibFunction(ADllHandle, EVP_PKEY_get0_DH_procname); + FuncLoadError := not assigned(EVP_PKEY_get0_DH); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_get0_DH_allownil)} + EVP_PKEY_get0_DH := @ERR_EVP_PKEY_get0_DH; + {$ifend} + {$if declared(EVP_PKEY_get0_DH_introduced)} + if LibVersion < EVP_PKEY_get0_DH_introduced then + begin + {$if declared(FC_EVP_PKEY_get0_DH)} + EVP_PKEY_get0_DH := @FC_EVP_PKEY_get0_DH; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_get0_DH_removed)} + if EVP_PKEY_get0_DH_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_get0_DH)} + EVP_PKEY_get0_DH := @_EVP_PKEY_get0_DH; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_get0_DH_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_get0_DH'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_PKEY_get1_DH := LoadLibFunction(ADllHandle, EVP_PKEY_get1_DH_procname); + FuncLoadError := not assigned(EVP_PKEY_get1_DH); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_get1_DH_allownil)} + EVP_PKEY_get1_DH := @ERR_EVP_PKEY_get1_DH; + {$ifend} + {$if declared(EVP_PKEY_get1_DH_introduced)} + if LibVersion < EVP_PKEY_get1_DH_introduced then + begin + {$if declared(FC_EVP_PKEY_get1_DH)} + EVP_PKEY_get1_DH := @FC_EVP_PKEY_get1_DH; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_get1_DH_removed)} + if EVP_PKEY_get1_DH_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_get1_DH)} + EVP_PKEY_get1_DH := @_EVP_PKEY_get1_DH; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_get1_DH_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_get1_DH'); + {$ifend} + end; + + + EVP_PKEY_set1_EC_KEY := LoadLibFunction(ADllHandle, EVP_PKEY_set1_EC_KEY_procname); + FuncLoadError := not assigned(EVP_PKEY_set1_EC_KEY); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_set1_EC_KEY_allownil)} + EVP_PKEY_set1_EC_KEY := @ERR_EVP_PKEY_set1_EC_KEY; + {$ifend} + {$if declared(EVP_PKEY_set1_EC_KEY_introduced)} + if LibVersion < EVP_PKEY_set1_EC_KEY_introduced then + begin + {$if declared(FC_EVP_PKEY_set1_EC_KEY)} + EVP_PKEY_set1_EC_KEY := @FC_EVP_PKEY_set1_EC_KEY; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_set1_EC_KEY_removed)} + if EVP_PKEY_set1_EC_KEY_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_set1_EC_KEY)} + EVP_PKEY_set1_EC_KEY := @_EVP_PKEY_set1_EC_KEY; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_set1_EC_KEY_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_set1_EC_KEY'); + {$ifend} + end; + + + EVP_PKEY_get0_EC_KEY := LoadLibFunction(ADllHandle, EVP_PKEY_get0_EC_KEY_procname); + FuncLoadError := not assigned(EVP_PKEY_get0_EC_KEY); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_get0_EC_KEY_allownil)} + EVP_PKEY_get0_EC_KEY := @ERR_EVP_PKEY_get0_EC_KEY; + {$ifend} + {$if declared(EVP_PKEY_get0_EC_KEY_introduced)} + if LibVersion < EVP_PKEY_get0_EC_KEY_introduced then + begin + {$if declared(FC_EVP_PKEY_get0_EC_KEY)} + EVP_PKEY_get0_EC_KEY := @FC_EVP_PKEY_get0_EC_KEY; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_get0_EC_KEY_removed)} + if EVP_PKEY_get0_EC_KEY_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_get0_EC_KEY)} + EVP_PKEY_get0_EC_KEY := @_EVP_PKEY_get0_EC_KEY; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_get0_EC_KEY_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_get0_EC_KEY'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_PKEY_get1_EC_KEY := LoadLibFunction(ADllHandle, EVP_PKEY_get1_EC_KEY_procname); + FuncLoadError := not assigned(EVP_PKEY_get1_EC_KEY); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_get1_EC_KEY_allownil)} + EVP_PKEY_get1_EC_KEY := @ERR_EVP_PKEY_get1_EC_KEY; + {$ifend} + {$if declared(EVP_PKEY_get1_EC_KEY_introduced)} + if LibVersion < EVP_PKEY_get1_EC_KEY_introduced then + begin + {$if declared(FC_EVP_PKEY_get1_EC_KEY)} + EVP_PKEY_get1_EC_KEY := @FC_EVP_PKEY_get1_EC_KEY; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_get1_EC_KEY_removed)} + if EVP_PKEY_get1_EC_KEY_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_get1_EC_KEY)} + EVP_PKEY_get1_EC_KEY := @_EVP_PKEY_get1_EC_KEY; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_get1_EC_KEY_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_get1_EC_KEY'); + {$ifend} + end; + + + EVP_PKEY_new := LoadLibFunction(ADllHandle, EVP_PKEY_new_procname); + FuncLoadError := not assigned(EVP_PKEY_new); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_new_allownil)} + EVP_PKEY_new := @ERR_EVP_PKEY_new; + {$ifend} + {$if declared(EVP_PKEY_new_introduced)} + if LibVersion < EVP_PKEY_new_introduced then + begin + {$if declared(FC_EVP_PKEY_new)} + EVP_PKEY_new := @FC_EVP_PKEY_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_new_removed)} + if EVP_PKEY_new_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_new)} + EVP_PKEY_new := @_EVP_PKEY_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_new_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_new'); + {$ifend} + end; + + + EVP_PKEY_up_ref := LoadLibFunction(ADllHandle, EVP_PKEY_up_ref_procname); + FuncLoadError := not assigned(EVP_PKEY_up_ref); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_up_ref_allownil)} + EVP_PKEY_up_ref := @ERR_EVP_PKEY_up_ref; + {$ifend} + {$if declared(EVP_PKEY_up_ref_introduced)} + if LibVersion < EVP_PKEY_up_ref_introduced then + begin + {$if declared(FC_EVP_PKEY_up_ref)} + EVP_PKEY_up_ref := @FC_EVP_PKEY_up_ref; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_up_ref_removed)} + if EVP_PKEY_up_ref_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_up_ref)} + EVP_PKEY_up_ref := @_EVP_PKEY_up_ref; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_up_ref_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_up_ref'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_PKEY_free := LoadLibFunction(ADllHandle, EVP_PKEY_free_procname); + FuncLoadError := not assigned(EVP_PKEY_free); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_free_allownil)} + EVP_PKEY_free := @ERR_EVP_PKEY_free; + {$ifend} + {$if declared(EVP_PKEY_free_introduced)} + if LibVersion < EVP_PKEY_free_introduced then + begin + {$if declared(FC_EVP_PKEY_free)} + EVP_PKEY_free := @FC_EVP_PKEY_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_free_removed)} + if EVP_PKEY_free_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_free)} + EVP_PKEY_free := @_EVP_PKEY_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_free_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_free'); + {$ifend} + end; + + + d2i_PublicKey := LoadLibFunction(ADllHandle, d2i_PublicKey_procname); + FuncLoadError := not assigned(d2i_PublicKey); + if FuncLoadError then + begin + {$if not defined(d2i_PublicKey_allownil)} + d2i_PublicKey := @ERR_d2i_PublicKey; + {$ifend} + {$if declared(d2i_PublicKey_introduced)} + if LibVersion < d2i_PublicKey_introduced then + begin + {$if declared(FC_d2i_PublicKey)} + d2i_PublicKey := @FC_d2i_PublicKey; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(d2i_PublicKey_removed)} + if d2i_PublicKey_removed <= LibVersion then + begin + {$if declared(_d2i_PublicKey)} + d2i_PublicKey := @_d2i_PublicKey; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(d2i_PublicKey_allownil)} + if FuncLoadError then + AFailed.Add('d2i_PublicKey'); + {$ifend} + end; + + + i2d_PublicKey := LoadLibFunction(ADllHandle, i2d_PublicKey_procname); + FuncLoadError := not assigned(i2d_PublicKey); + if FuncLoadError then + begin + {$if not defined(i2d_PublicKey_allownil)} + i2d_PublicKey := @ERR_i2d_PublicKey; + {$ifend} + {$if declared(i2d_PublicKey_introduced)} + if LibVersion < i2d_PublicKey_introduced then + begin + {$if declared(FC_i2d_PublicKey)} + i2d_PublicKey := @FC_i2d_PublicKey; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(i2d_PublicKey_removed)} + if i2d_PublicKey_removed <= LibVersion then + begin + {$if declared(_i2d_PublicKey)} + i2d_PublicKey := @_i2d_PublicKey; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(i2d_PublicKey_allownil)} + if FuncLoadError then + AFailed.Add('i2d_PublicKey'); + {$ifend} + end; + + + d2i_PrivateKey := LoadLibFunction(ADllHandle, d2i_PrivateKey_procname); + FuncLoadError := not assigned(d2i_PrivateKey); + if FuncLoadError then + begin + {$if not defined(d2i_PrivateKey_allownil)} + d2i_PrivateKey := @ERR_d2i_PrivateKey; + {$ifend} + {$if declared(d2i_PrivateKey_introduced)} + if LibVersion < d2i_PrivateKey_introduced then + begin + {$if declared(FC_d2i_PrivateKey)} + d2i_PrivateKey := @FC_d2i_PrivateKey; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(d2i_PrivateKey_removed)} + if d2i_PrivateKey_removed <= LibVersion then + begin + {$if declared(_d2i_PrivateKey)} + d2i_PrivateKey := @_d2i_PrivateKey; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(d2i_PrivateKey_allownil)} + if FuncLoadError then + AFailed.Add('d2i_PrivateKey'); + {$ifend} + end; + + + d2i_AutoPrivateKey := LoadLibFunction(ADllHandle, d2i_AutoPrivateKey_procname); + FuncLoadError := not assigned(d2i_AutoPrivateKey); + if FuncLoadError then + begin + {$if not defined(d2i_AutoPrivateKey_allownil)} + d2i_AutoPrivateKey := @ERR_d2i_AutoPrivateKey; + {$ifend} + {$if declared(d2i_AutoPrivateKey_introduced)} + if LibVersion < d2i_AutoPrivateKey_introduced then + begin + {$if declared(FC_d2i_AutoPrivateKey)} + d2i_AutoPrivateKey := @FC_d2i_AutoPrivateKey; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(d2i_AutoPrivateKey_removed)} + if d2i_AutoPrivateKey_removed <= LibVersion then + begin + {$if declared(_d2i_AutoPrivateKey)} + d2i_AutoPrivateKey := @_d2i_AutoPrivateKey; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(d2i_AutoPrivateKey_allownil)} + if FuncLoadError then + AFailed.Add('d2i_AutoPrivateKey'); + {$ifend} + end; + + + i2d_PrivateKey := LoadLibFunction(ADllHandle, i2d_PrivateKey_procname); + FuncLoadError := not assigned(i2d_PrivateKey); + if FuncLoadError then + begin + {$if not defined(i2d_PrivateKey_allownil)} + i2d_PrivateKey := @ERR_i2d_PrivateKey; + {$ifend} + {$if declared(i2d_PrivateKey_introduced)} + if LibVersion < i2d_PrivateKey_introduced then + begin + {$if declared(FC_i2d_PrivateKey)} + i2d_PrivateKey := @FC_i2d_PrivateKey; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(i2d_PrivateKey_removed)} + if i2d_PrivateKey_removed <= LibVersion then + begin + {$if declared(_i2d_PrivateKey)} + i2d_PrivateKey := @_i2d_PrivateKey; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(i2d_PrivateKey_allownil)} + if FuncLoadError then + AFailed.Add('i2d_PrivateKey'); + {$ifend} + end; + + + EVP_PKEY_copy_parameters := LoadLibFunction(ADllHandle, EVP_PKEY_copy_parameters_procname); + FuncLoadError := not assigned(EVP_PKEY_copy_parameters); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_copy_parameters_allownil)} + EVP_PKEY_copy_parameters := @ERR_EVP_PKEY_copy_parameters; + {$ifend} + {$if declared(EVP_PKEY_copy_parameters_introduced)} + if LibVersion < EVP_PKEY_copy_parameters_introduced then + begin + {$if declared(FC_EVP_PKEY_copy_parameters)} + EVP_PKEY_copy_parameters := @FC_EVP_PKEY_copy_parameters; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_copy_parameters_removed)} + if EVP_PKEY_copy_parameters_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_copy_parameters)} + EVP_PKEY_copy_parameters := @_EVP_PKEY_copy_parameters; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_copy_parameters_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_copy_parameters'); + {$ifend} + end; + + + EVP_PKEY_missing_parameters := LoadLibFunction(ADllHandle, EVP_PKEY_missing_parameters_procname); + FuncLoadError := not assigned(EVP_PKEY_missing_parameters); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_missing_parameters_allownil)} + EVP_PKEY_missing_parameters := @ERR_EVP_PKEY_missing_parameters; + {$ifend} + {$if declared(EVP_PKEY_missing_parameters_introduced)} + if LibVersion < EVP_PKEY_missing_parameters_introduced then + begin + {$if declared(FC_EVP_PKEY_missing_parameters)} + EVP_PKEY_missing_parameters := @FC_EVP_PKEY_missing_parameters; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_missing_parameters_removed)} + if EVP_PKEY_missing_parameters_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_missing_parameters)} + EVP_PKEY_missing_parameters := @_EVP_PKEY_missing_parameters; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_missing_parameters_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_missing_parameters'); + {$ifend} + end; + + + EVP_PKEY_save_parameters := LoadLibFunction(ADllHandle, EVP_PKEY_save_parameters_procname); + FuncLoadError := not assigned(EVP_PKEY_save_parameters); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_save_parameters_allownil)} + EVP_PKEY_save_parameters := @ERR_EVP_PKEY_save_parameters; + {$ifend} + {$if declared(EVP_PKEY_save_parameters_introduced)} + if LibVersion < EVP_PKEY_save_parameters_introduced then + begin + {$if declared(FC_EVP_PKEY_save_parameters)} + EVP_PKEY_save_parameters := @FC_EVP_PKEY_save_parameters; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_save_parameters_removed)} + if EVP_PKEY_save_parameters_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_save_parameters)} + EVP_PKEY_save_parameters := @_EVP_PKEY_save_parameters; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_save_parameters_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_save_parameters'); + {$ifend} + end; + + + EVP_PKEY_cmp_parameters := LoadLibFunction(ADllHandle, EVP_PKEY_cmp_parameters_procname); + FuncLoadError := not assigned(EVP_PKEY_cmp_parameters); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_cmp_parameters_allownil)} + EVP_PKEY_cmp_parameters := @ERR_EVP_PKEY_cmp_parameters; + {$ifend} + {$if declared(EVP_PKEY_cmp_parameters_introduced)} + if LibVersion < EVP_PKEY_cmp_parameters_introduced then + begin + {$if declared(FC_EVP_PKEY_cmp_parameters)} + EVP_PKEY_cmp_parameters := @FC_EVP_PKEY_cmp_parameters; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_cmp_parameters_removed)} + if EVP_PKEY_cmp_parameters_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_cmp_parameters)} + EVP_PKEY_cmp_parameters := @_EVP_PKEY_cmp_parameters; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_cmp_parameters_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_cmp_parameters'); + {$ifend} + end; + + + EVP_PKEY_cmp := LoadLibFunction(ADllHandle, EVP_PKEY_cmp_procname); + FuncLoadError := not assigned(EVP_PKEY_cmp); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_cmp_allownil)} + EVP_PKEY_cmp := @ERR_EVP_PKEY_cmp; + {$ifend} + {$if declared(EVP_PKEY_cmp_introduced)} + if LibVersion < EVP_PKEY_cmp_introduced then + begin + {$if declared(FC_EVP_PKEY_cmp)} + EVP_PKEY_cmp := @FC_EVP_PKEY_cmp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_cmp_removed)} + if EVP_PKEY_cmp_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_cmp)} + EVP_PKEY_cmp := @_EVP_PKEY_cmp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_cmp_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_cmp'); + {$ifend} + end; + + + EVP_PKEY_print_public := LoadLibFunction(ADllHandle, EVP_PKEY_print_public_procname); + FuncLoadError := not assigned(EVP_PKEY_print_public); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_print_public_allownil)} + EVP_PKEY_print_public := @ERR_EVP_PKEY_print_public; + {$ifend} + {$if declared(EVP_PKEY_print_public_introduced)} + if LibVersion < EVP_PKEY_print_public_introduced then + begin + {$if declared(FC_EVP_PKEY_print_public)} + EVP_PKEY_print_public := @FC_EVP_PKEY_print_public; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_print_public_removed)} + if EVP_PKEY_print_public_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_print_public)} + EVP_PKEY_print_public := @_EVP_PKEY_print_public; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_print_public_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_print_public'); + {$ifend} + end; + + + EVP_PKEY_print_private := LoadLibFunction(ADllHandle, EVP_PKEY_print_private_procname); + FuncLoadError := not assigned(EVP_PKEY_print_private); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_print_private_allownil)} + EVP_PKEY_print_private := @ERR_EVP_PKEY_print_private; + {$ifend} + {$if declared(EVP_PKEY_print_private_introduced)} + if LibVersion < EVP_PKEY_print_private_introduced then + begin + {$if declared(FC_EVP_PKEY_print_private)} + EVP_PKEY_print_private := @FC_EVP_PKEY_print_private; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_print_private_removed)} + if EVP_PKEY_print_private_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_print_private)} + EVP_PKEY_print_private := @_EVP_PKEY_print_private; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_print_private_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_print_private'); + {$ifend} + end; + + + EVP_PKEY_print_params := LoadLibFunction(ADllHandle, EVP_PKEY_print_params_procname); + FuncLoadError := not assigned(EVP_PKEY_print_params); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_print_params_allownil)} + EVP_PKEY_print_params := @ERR_EVP_PKEY_print_params; + {$ifend} + {$if declared(EVP_PKEY_print_params_introduced)} + if LibVersion < EVP_PKEY_print_params_introduced then + begin + {$if declared(FC_EVP_PKEY_print_params)} + EVP_PKEY_print_params := @FC_EVP_PKEY_print_params; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_print_params_removed)} + if EVP_PKEY_print_params_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_print_params)} + EVP_PKEY_print_params := @_EVP_PKEY_print_params; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_print_params_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_print_params'); + {$ifend} + end; + + + EVP_PKEY_get_default_digest_nid := LoadLibFunction(ADllHandle, EVP_PKEY_get_default_digest_nid_procname); + FuncLoadError := not assigned(EVP_PKEY_get_default_digest_nid); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_get_default_digest_nid_allownil)} + EVP_PKEY_get_default_digest_nid := @ERR_EVP_PKEY_get_default_digest_nid; + {$ifend} + {$if declared(EVP_PKEY_get_default_digest_nid_introduced)} + if LibVersion < EVP_PKEY_get_default_digest_nid_introduced then + begin + {$if declared(FC_EVP_PKEY_get_default_digest_nid)} + EVP_PKEY_get_default_digest_nid := @FC_EVP_PKEY_get_default_digest_nid; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_get_default_digest_nid_removed)} + if EVP_PKEY_get_default_digest_nid_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_get_default_digest_nid)} + EVP_PKEY_get_default_digest_nid := @_EVP_PKEY_get_default_digest_nid; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_get_default_digest_nid_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_get_default_digest_nid'); + {$ifend} + end; + + + EVP_PKEY_set1_tls_encodedpoint := LoadLibFunction(ADllHandle, EVP_PKEY_set1_tls_encodedpoint_procname); + FuncLoadError := not assigned(EVP_PKEY_set1_tls_encodedpoint); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_set1_tls_encodedpoint_allownil)} + EVP_PKEY_set1_tls_encodedpoint := @ERR_EVP_PKEY_set1_tls_encodedpoint; + {$ifend} + {$if declared(EVP_PKEY_set1_tls_encodedpoint_introduced)} + if LibVersion < EVP_PKEY_set1_tls_encodedpoint_introduced then + begin + {$if declared(FC_EVP_PKEY_set1_tls_encodedpoint)} + EVP_PKEY_set1_tls_encodedpoint := @FC_EVP_PKEY_set1_tls_encodedpoint; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_set1_tls_encodedpoint_removed)} + if EVP_PKEY_set1_tls_encodedpoint_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_set1_tls_encodedpoint)} + EVP_PKEY_set1_tls_encodedpoint := @_EVP_PKEY_set1_tls_encodedpoint; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_set1_tls_encodedpoint_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_set1_tls_encodedpoint'); + {$ifend} + end; + + + EVP_PKEY_get1_tls_encodedpoint := LoadLibFunction(ADllHandle, EVP_PKEY_get1_tls_encodedpoint_procname); + FuncLoadError := not assigned(EVP_PKEY_get1_tls_encodedpoint); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_get1_tls_encodedpoint_allownil)} + EVP_PKEY_get1_tls_encodedpoint := @ERR_EVP_PKEY_get1_tls_encodedpoint; + {$ifend} + {$if declared(EVP_PKEY_get1_tls_encodedpoint_introduced)} + if LibVersion < EVP_PKEY_get1_tls_encodedpoint_introduced then + begin + {$if declared(FC_EVP_PKEY_get1_tls_encodedpoint)} + EVP_PKEY_get1_tls_encodedpoint := @FC_EVP_PKEY_get1_tls_encodedpoint; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_get1_tls_encodedpoint_removed)} + if EVP_PKEY_get1_tls_encodedpoint_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_get1_tls_encodedpoint)} + EVP_PKEY_get1_tls_encodedpoint := @_EVP_PKEY_get1_tls_encodedpoint; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_get1_tls_encodedpoint_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_get1_tls_encodedpoint'); + {$ifend} + end; + + + EVP_CIPHER_type := LoadLibFunction(ADllHandle, EVP_CIPHER_type_procname); + FuncLoadError := not assigned(EVP_CIPHER_type); + if FuncLoadError then + begin + {$if not defined(EVP_CIPHER_type_allownil)} + EVP_CIPHER_type := @ERR_EVP_CIPHER_type; + {$ifend} + {$if declared(EVP_CIPHER_type_introduced)} + if LibVersion < EVP_CIPHER_type_introduced then + begin + {$if declared(FC_EVP_CIPHER_type)} + EVP_CIPHER_type := @FC_EVP_CIPHER_type; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_CIPHER_type_removed)} + if EVP_CIPHER_type_removed <= LibVersion then + begin + {$if declared(_EVP_CIPHER_type)} + EVP_CIPHER_type := @_EVP_CIPHER_type; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_CIPHER_type_allownil)} + if FuncLoadError then + AFailed.Add('EVP_CIPHER_type'); + {$ifend} + end; + + + EVP_CIPHER_param_to_asn1 := LoadLibFunction(ADllHandle, EVP_CIPHER_param_to_asn1_procname); + FuncLoadError := not assigned(EVP_CIPHER_param_to_asn1); + if FuncLoadError then + begin + {$if not defined(EVP_CIPHER_param_to_asn1_allownil)} + EVP_CIPHER_param_to_asn1 := @ERR_EVP_CIPHER_param_to_asn1; + {$ifend} + {$if declared(EVP_CIPHER_param_to_asn1_introduced)} + if LibVersion < EVP_CIPHER_param_to_asn1_introduced then + begin + {$if declared(FC_EVP_CIPHER_param_to_asn1)} + EVP_CIPHER_param_to_asn1 := @FC_EVP_CIPHER_param_to_asn1; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_CIPHER_param_to_asn1_removed)} + if EVP_CIPHER_param_to_asn1_removed <= LibVersion then + begin + {$if declared(_EVP_CIPHER_param_to_asn1)} + EVP_CIPHER_param_to_asn1 := @_EVP_CIPHER_param_to_asn1; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_CIPHER_param_to_asn1_allownil)} + if FuncLoadError then + AFailed.Add('EVP_CIPHER_param_to_asn1'); + {$ifend} + end; + + + EVP_CIPHER_asn1_to_param := LoadLibFunction(ADllHandle, EVP_CIPHER_asn1_to_param_procname); + FuncLoadError := not assigned(EVP_CIPHER_asn1_to_param); + if FuncLoadError then + begin + {$if not defined(EVP_CIPHER_asn1_to_param_allownil)} + EVP_CIPHER_asn1_to_param := @ERR_EVP_CIPHER_asn1_to_param; + {$ifend} + {$if declared(EVP_CIPHER_asn1_to_param_introduced)} + if LibVersion < EVP_CIPHER_asn1_to_param_introduced then + begin + {$if declared(FC_EVP_CIPHER_asn1_to_param)} + EVP_CIPHER_asn1_to_param := @FC_EVP_CIPHER_asn1_to_param; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_CIPHER_asn1_to_param_removed)} + if EVP_CIPHER_asn1_to_param_removed <= LibVersion then + begin + {$if declared(_EVP_CIPHER_asn1_to_param)} + EVP_CIPHER_asn1_to_param := @_EVP_CIPHER_asn1_to_param; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_CIPHER_asn1_to_param_allownil)} + if FuncLoadError then + AFailed.Add('EVP_CIPHER_asn1_to_param'); + {$ifend} + end; + + + EVP_CIPHER_set_asn1_iv := LoadLibFunction(ADllHandle, EVP_CIPHER_set_asn1_iv_procname); + FuncLoadError := not assigned(EVP_CIPHER_set_asn1_iv); + if FuncLoadError then + begin + {$if not defined(EVP_CIPHER_set_asn1_iv_allownil)} + EVP_CIPHER_set_asn1_iv := @ERR_EVP_CIPHER_set_asn1_iv; + {$ifend} + {$if declared(EVP_CIPHER_set_asn1_iv_introduced)} + if LibVersion < EVP_CIPHER_set_asn1_iv_introduced then + begin + {$if declared(FC_EVP_CIPHER_set_asn1_iv)} + EVP_CIPHER_set_asn1_iv := @FC_EVP_CIPHER_set_asn1_iv; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_CIPHER_set_asn1_iv_removed)} + if EVP_CIPHER_set_asn1_iv_removed <= LibVersion then + begin + {$if declared(_EVP_CIPHER_set_asn1_iv)} + EVP_CIPHER_set_asn1_iv := @_EVP_CIPHER_set_asn1_iv; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_CIPHER_set_asn1_iv_allownil)} + if FuncLoadError then + AFailed.Add('EVP_CIPHER_set_asn1_iv'); + {$ifend} + end; + + + EVP_CIPHER_get_asn1_iv := LoadLibFunction(ADllHandle, EVP_CIPHER_get_asn1_iv_procname); + FuncLoadError := not assigned(EVP_CIPHER_get_asn1_iv); + if FuncLoadError then + begin + {$if not defined(EVP_CIPHER_get_asn1_iv_allownil)} + EVP_CIPHER_get_asn1_iv := @ERR_EVP_CIPHER_get_asn1_iv; + {$ifend} + {$if declared(EVP_CIPHER_get_asn1_iv_introduced)} + if LibVersion < EVP_CIPHER_get_asn1_iv_introduced then + begin + {$if declared(FC_EVP_CIPHER_get_asn1_iv)} + EVP_CIPHER_get_asn1_iv := @FC_EVP_CIPHER_get_asn1_iv; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_CIPHER_get_asn1_iv_removed)} + if EVP_CIPHER_get_asn1_iv_removed <= LibVersion then + begin + {$if declared(_EVP_CIPHER_get_asn1_iv)} + EVP_CIPHER_get_asn1_iv := @_EVP_CIPHER_get_asn1_iv; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_CIPHER_get_asn1_iv_allownil)} + if FuncLoadError then + AFailed.Add('EVP_CIPHER_get_asn1_iv'); + {$ifend} + end; + + + PKCS5_PBE_keyivgen := LoadLibFunction(ADllHandle, PKCS5_PBE_keyivgen_procname); + FuncLoadError := not assigned(PKCS5_PBE_keyivgen); + if FuncLoadError then + begin + {$if not defined(PKCS5_PBE_keyivgen_allownil)} + PKCS5_PBE_keyivgen := @ERR_PKCS5_PBE_keyivgen; + {$ifend} + {$if declared(PKCS5_PBE_keyivgen_introduced)} + if LibVersion < PKCS5_PBE_keyivgen_introduced then + begin + {$if declared(FC_PKCS5_PBE_keyivgen)} + PKCS5_PBE_keyivgen := @FC_PKCS5_PBE_keyivgen; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS5_PBE_keyivgen_removed)} + if PKCS5_PBE_keyivgen_removed <= LibVersion then + begin + {$if declared(_PKCS5_PBE_keyivgen)} + PKCS5_PBE_keyivgen := @_PKCS5_PBE_keyivgen; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS5_PBE_keyivgen_allownil)} + if FuncLoadError then + AFailed.Add('PKCS5_PBE_keyivgen'); + {$ifend} + end; + + + PKCS5_PBKDF2_HMAC_SHA1 := LoadLibFunction(ADllHandle, PKCS5_PBKDF2_HMAC_SHA1_procname); + FuncLoadError := not assigned(PKCS5_PBKDF2_HMAC_SHA1); + if FuncLoadError then + begin + {$if not defined(PKCS5_PBKDF2_HMAC_SHA1_allownil)} + PKCS5_PBKDF2_HMAC_SHA1 := @ERR_PKCS5_PBKDF2_HMAC_SHA1; + {$ifend} + {$if declared(PKCS5_PBKDF2_HMAC_SHA1_introduced)} + if LibVersion < PKCS5_PBKDF2_HMAC_SHA1_introduced then + begin + {$if declared(FC_PKCS5_PBKDF2_HMAC_SHA1)} + PKCS5_PBKDF2_HMAC_SHA1 := @FC_PKCS5_PBKDF2_HMAC_SHA1; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS5_PBKDF2_HMAC_SHA1_removed)} + if PKCS5_PBKDF2_HMAC_SHA1_removed <= LibVersion then + begin + {$if declared(_PKCS5_PBKDF2_HMAC_SHA1)} + PKCS5_PBKDF2_HMAC_SHA1 := @_PKCS5_PBKDF2_HMAC_SHA1; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS5_PBKDF2_HMAC_SHA1_allownil)} + if FuncLoadError then + AFailed.Add('PKCS5_PBKDF2_HMAC_SHA1'); + {$ifend} + end; + + + PKCS5_PBKDF2_HMAC := LoadLibFunction(ADllHandle, PKCS5_PBKDF2_HMAC_procname); + FuncLoadError := not assigned(PKCS5_PBKDF2_HMAC); + if FuncLoadError then + begin + {$if not defined(PKCS5_PBKDF2_HMAC_allownil)} + PKCS5_PBKDF2_HMAC := @ERR_PKCS5_PBKDF2_HMAC; + {$ifend} + {$if declared(PKCS5_PBKDF2_HMAC_introduced)} + if LibVersion < PKCS5_PBKDF2_HMAC_introduced then + begin + {$if declared(FC_PKCS5_PBKDF2_HMAC)} + PKCS5_PBKDF2_HMAC := @FC_PKCS5_PBKDF2_HMAC; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS5_PBKDF2_HMAC_removed)} + if PKCS5_PBKDF2_HMAC_removed <= LibVersion then + begin + {$if declared(_PKCS5_PBKDF2_HMAC)} + PKCS5_PBKDF2_HMAC := @_PKCS5_PBKDF2_HMAC; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS5_PBKDF2_HMAC_allownil)} + if FuncLoadError then + AFailed.Add('PKCS5_PBKDF2_HMAC'); + {$ifend} + end; + + + PKCS5_v2_PBE_keyivgen := LoadLibFunction(ADllHandle, PKCS5_v2_PBE_keyivgen_procname); + FuncLoadError := not assigned(PKCS5_v2_PBE_keyivgen); + if FuncLoadError then + begin + {$if not defined(PKCS5_v2_PBE_keyivgen_allownil)} + PKCS5_v2_PBE_keyivgen := @ERR_PKCS5_v2_PBE_keyivgen; + {$ifend} + {$if declared(PKCS5_v2_PBE_keyivgen_introduced)} + if LibVersion < PKCS5_v2_PBE_keyivgen_introduced then + begin + {$if declared(FC_PKCS5_v2_PBE_keyivgen)} + PKCS5_v2_PBE_keyivgen := @FC_PKCS5_v2_PBE_keyivgen; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS5_v2_PBE_keyivgen_removed)} + if PKCS5_v2_PBE_keyivgen_removed <= LibVersion then + begin + {$if declared(_PKCS5_v2_PBE_keyivgen)} + PKCS5_v2_PBE_keyivgen := @_PKCS5_v2_PBE_keyivgen; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS5_v2_PBE_keyivgen_allownil)} + if FuncLoadError then + AFailed.Add('PKCS5_v2_PBE_keyivgen'); + {$ifend} + end; + + + EVP_PBE_scrypt := LoadLibFunction(ADllHandle, EVP_PBE_scrypt_procname); + FuncLoadError := not assigned(EVP_PBE_scrypt); + if FuncLoadError then + begin + {$if not defined(EVP_PBE_scrypt_allownil)} + EVP_PBE_scrypt := @ERR_EVP_PBE_scrypt; + {$ifend} + {$if declared(EVP_PBE_scrypt_introduced)} + if LibVersion < EVP_PBE_scrypt_introduced then + begin + {$if declared(FC_EVP_PBE_scrypt)} + EVP_PBE_scrypt := @FC_EVP_PBE_scrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PBE_scrypt_removed)} + if EVP_PBE_scrypt_removed <= LibVersion then + begin + {$if declared(_EVP_PBE_scrypt)} + EVP_PBE_scrypt := @_EVP_PBE_scrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PBE_scrypt_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PBE_scrypt'); + {$ifend} + end; + + {introduced 1.1.0} + PKCS5_v2_scrypt_keyivgen := LoadLibFunction(ADllHandle, PKCS5_v2_scrypt_keyivgen_procname); + FuncLoadError := not assigned(PKCS5_v2_scrypt_keyivgen); + if FuncLoadError then + begin + {$if not defined(PKCS5_v2_scrypt_keyivgen_allownil)} + PKCS5_v2_scrypt_keyivgen := @ERR_PKCS5_v2_scrypt_keyivgen; + {$ifend} + {$if declared(PKCS5_v2_scrypt_keyivgen_introduced)} + if LibVersion < PKCS5_v2_scrypt_keyivgen_introduced then + begin + {$if declared(FC_PKCS5_v2_scrypt_keyivgen)} + PKCS5_v2_scrypt_keyivgen := @FC_PKCS5_v2_scrypt_keyivgen; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS5_v2_scrypt_keyivgen_removed)} + if PKCS5_v2_scrypt_keyivgen_removed <= LibVersion then + begin + {$if declared(_PKCS5_v2_scrypt_keyivgen)} + PKCS5_v2_scrypt_keyivgen := @_PKCS5_v2_scrypt_keyivgen; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS5_v2_scrypt_keyivgen_allownil)} + if FuncLoadError then + AFailed.Add('PKCS5_v2_scrypt_keyivgen'); + {$ifend} + end; + + {introduced 1.1.0} + PKCS5_PBE_add := LoadLibFunction(ADllHandle, PKCS5_PBE_add_procname); + FuncLoadError := not assigned(PKCS5_PBE_add); + if FuncLoadError then + begin + {$if not defined(PKCS5_PBE_add_allownil)} + PKCS5_PBE_add := @ERR_PKCS5_PBE_add; + {$ifend} + {$if declared(PKCS5_PBE_add_introduced)} + if LibVersion < PKCS5_PBE_add_introduced then + begin + {$if declared(FC_PKCS5_PBE_add)} + PKCS5_PBE_add := @FC_PKCS5_PBE_add; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS5_PBE_add_removed)} + if PKCS5_PBE_add_removed <= LibVersion then + begin + {$if declared(_PKCS5_PBE_add)} + PKCS5_PBE_add := @_PKCS5_PBE_add; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS5_PBE_add_allownil)} + if FuncLoadError then + AFailed.Add('PKCS5_PBE_add'); + {$ifend} + end; + + + EVP_PBE_CipherInit := LoadLibFunction(ADllHandle, EVP_PBE_CipherInit_procname); + FuncLoadError := not assigned(EVP_PBE_CipherInit); + if FuncLoadError then + begin + {$if not defined(EVP_PBE_CipherInit_allownil)} + EVP_PBE_CipherInit := @ERR_EVP_PBE_CipherInit; + {$ifend} + {$if declared(EVP_PBE_CipherInit_introduced)} + if LibVersion < EVP_PBE_CipherInit_introduced then + begin + {$if declared(FC_EVP_PBE_CipherInit)} + EVP_PBE_CipherInit := @FC_EVP_PBE_CipherInit; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PBE_CipherInit_removed)} + if EVP_PBE_CipherInit_removed <= LibVersion then + begin + {$if declared(_EVP_PBE_CipherInit)} + EVP_PBE_CipherInit := @_EVP_PBE_CipherInit; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PBE_CipherInit_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PBE_CipherInit'); + {$ifend} + end; + + + EVP_PBE_alg_add_type := LoadLibFunction(ADllHandle, EVP_PBE_alg_add_type_procname); + FuncLoadError := not assigned(EVP_PBE_alg_add_type); + if FuncLoadError then + begin + {$if not defined(EVP_PBE_alg_add_type_allownil)} + EVP_PBE_alg_add_type := @ERR_EVP_PBE_alg_add_type; + {$ifend} + {$if declared(EVP_PBE_alg_add_type_introduced)} + if LibVersion < EVP_PBE_alg_add_type_introduced then + begin + {$if declared(FC_EVP_PBE_alg_add_type)} + EVP_PBE_alg_add_type := @FC_EVP_PBE_alg_add_type; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PBE_alg_add_type_removed)} + if EVP_PBE_alg_add_type_removed <= LibVersion then + begin + {$if declared(_EVP_PBE_alg_add_type)} + EVP_PBE_alg_add_type := @_EVP_PBE_alg_add_type; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PBE_alg_add_type_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PBE_alg_add_type'); + {$ifend} + end; + + + EVP_PBE_alg_add := LoadLibFunction(ADllHandle, EVP_PBE_alg_add_procname); + FuncLoadError := not assigned(EVP_PBE_alg_add); + if FuncLoadError then + begin + {$if not defined(EVP_PBE_alg_add_allownil)} + EVP_PBE_alg_add := @ERR_EVP_PBE_alg_add; + {$ifend} + {$if declared(EVP_PBE_alg_add_introduced)} + if LibVersion < EVP_PBE_alg_add_introduced then + begin + {$if declared(FC_EVP_PBE_alg_add)} + EVP_PBE_alg_add := @FC_EVP_PBE_alg_add; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PBE_alg_add_removed)} + if EVP_PBE_alg_add_removed <= LibVersion then + begin + {$if declared(_EVP_PBE_alg_add)} + EVP_PBE_alg_add := @_EVP_PBE_alg_add; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PBE_alg_add_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PBE_alg_add'); + {$ifend} + end; + + + EVP_PBE_find := LoadLibFunction(ADllHandle, EVP_PBE_find_procname); + FuncLoadError := not assigned(EVP_PBE_find); + if FuncLoadError then + begin + {$if not defined(EVP_PBE_find_allownil)} + EVP_PBE_find := @ERR_EVP_PBE_find; + {$ifend} + {$if declared(EVP_PBE_find_introduced)} + if LibVersion < EVP_PBE_find_introduced then + begin + {$if declared(FC_EVP_PBE_find)} + EVP_PBE_find := @FC_EVP_PBE_find; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PBE_find_removed)} + if EVP_PBE_find_removed <= LibVersion then + begin + {$if declared(_EVP_PBE_find)} + EVP_PBE_find := @_EVP_PBE_find; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PBE_find_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PBE_find'); + {$ifend} + end; + + + EVP_PBE_cleanup := LoadLibFunction(ADllHandle, EVP_PBE_cleanup_procname); + FuncLoadError := not assigned(EVP_PBE_cleanup); + if FuncLoadError then + begin + {$if not defined(EVP_PBE_cleanup_allownil)} + EVP_PBE_cleanup := @ERR_EVP_PBE_cleanup; + {$ifend} + {$if declared(EVP_PBE_cleanup_introduced)} + if LibVersion < EVP_PBE_cleanup_introduced then + begin + {$if declared(FC_EVP_PBE_cleanup)} + EVP_PBE_cleanup := @FC_EVP_PBE_cleanup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PBE_cleanup_removed)} + if EVP_PBE_cleanup_removed <= LibVersion then + begin + {$if declared(_EVP_PBE_cleanup)} + EVP_PBE_cleanup := @_EVP_PBE_cleanup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PBE_cleanup_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PBE_cleanup'); + {$ifend} + end; + + + EVP_PBE_get := LoadLibFunction(ADllHandle, EVP_PBE_get_procname); + FuncLoadError := not assigned(EVP_PBE_get); + if FuncLoadError then + begin + {$if not defined(EVP_PBE_get_allownil)} + EVP_PBE_get := @ERR_EVP_PBE_get; + {$ifend} + {$if declared(EVP_PBE_get_introduced)} + if LibVersion < EVP_PBE_get_introduced then + begin + {$if declared(FC_EVP_PBE_get)} + EVP_PBE_get := @FC_EVP_PBE_get; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PBE_get_removed)} + if EVP_PBE_get_removed <= LibVersion then + begin + {$if declared(_EVP_PBE_get)} + EVP_PBE_get := @_EVP_PBE_get; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PBE_get_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PBE_get'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_PKEY_asn1_get_count := LoadLibFunction(ADllHandle, EVP_PKEY_asn1_get_count_procname); + FuncLoadError := not assigned(EVP_PKEY_asn1_get_count); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_asn1_get_count_allownil)} + EVP_PKEY_asn1_get_count := @ERR_EVP_PKEY_asn1_get_count; + {$ifend} + {$if declared(EVP_PKEY_asn1_get_count_introduced)} + if LibVersion < EVP_PKEY_asn1_get_count_introduced then + begin + {$if declared(FC_EVP_PKEY_asn1_get_count)} + EVP_PKEY_asn1_get_count := @FC_EVP_PKEY_asn1_get_count; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_asn1_get_count_removed)} + if EVP_PKEY_asn1_get_count_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_asn1_get_count)} + EVP_PKEY_asn1_get_count := @_EVP_PKEY_asn1_get_count; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_asn1_get_count_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_asn1_get_count'); + {$ifend} + end; + + + EVP_PKEY_asn1_get0 := LoadLibFunction(ADllHandle, EVP_PKEY_asn1_get0_procname); + FuncLoadError := not assigned(EVP_PKEY_asn1_get0); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_asn1_get0_allownil)} + EVP_PKEY_asn1_get0 := @ERR_EVP_PKEY_asn1_get0; + {$ifend} + {$if declared(EVP_PKEY_asn1_get0_introduced)} + if LibVersion < EVP_PKEY_asn1_get0_introduced then + begin + {$if declared(FC_EVP_PKEY_asn1_get0)} + EVP_PKEY_asn1_get0 := @FC_EVP_PKEY_asn1_get0; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_asn1_get0_removed)} + if EVP_PKEY_asn1_get0_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_asn1_get0)} + EVP_PKEY_asn1_get0 := @_EVP_PKEY_asn1_get0; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_asn1_get0_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_asn1_get0'); + {$ifend} + end; + + + EVP_PKEY_asn1_find := LoadLibFunction(ADllHandle, EVP_PKEY_asn1_find_procname); + FuncLoadError := not assigned(EVP_PKEY_asn1_find); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_asn1_find_allownil)} + EVP_PKEY_asn1_find := @ERR_EVP_PKEY_asn1_find; + {$ifend} + {$if declared(EVP_PKEY_asn1_find_introduced)} + if LibVersion < EVP_PKEY_asn1_find_introduced then + begin + {$if declared(FC_EVP_PKEY_asn1_find)} + EVP_PKEY_asn1_find := @FC_EVP_PKEY_asn1_find; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_asn1_find_removed)} + if EVP_PKEY_asn1_find_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_asn1_find)} + EVP_PKEY_asn1_find := @_EVP_PKEY_asn1_find; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_asn1_find_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_asn1_find'); + {$ifend} + end; + + + EVP_PKEY_asn1_find_str := LoadLibFunction(ADllHandle, EVP_PKEY_asn1_find_str_procname); + FuncLoadError := not assigned(EVP_PKEY_asn1_find_str); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_asn1_find_str_allownil)} + EVP_PKEY_asn1_find_str := @ERR_EVP_PKEY_asn1_find_str; + {$ifend} + {$if declared(EVP_PKEY_asn1_find_str_introduced)} + if LibVersion < EVP_PKEY_asn1_find_str_introduced then + begin + {$if declared(FC_EVP_PKEY_asn1_find_str)} + EVP_PKEY_asn1_find_str := @FC_EVP_PKEY_asn1_find_str; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_asn1_find_str_removed)} + if EVP_PKEY_asn1_find_str_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_asn1_find_str)} + EVP_PKEY_asn1_find_str := @_EVP_PKEY_asn1_find_str; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_asn1_find_str_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_asn1_find_str'); + {$ifend} + end; + + + EVP_PKEY_asn1_add0 := LoadLibFunction(ADllHandle, EVP_PKEY_asn1_add0_procname); + FuncLoadError := not assigned(EVP_PKEY_asn1_add0); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_asn1_add0_allownil)} + EVP_PKEY_asn1_add0 := @ERR_EVP_PKEY_asn1_add0; + {$ifend} + {$if declared(EVP_PKEY_asn1_add0_introduced)} + if LibVersion < EVP_PKEY_asn1_add0_introduced then + begin + {$if declared(FC_EVP_PKEY_asn1_add0)} + EVP_PKEY_asn1_add0 := @FC_EVP_PKEY_asn1_add0; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_asn1_add0_removed)} + if EVP_PKEY_asn1_add0_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_asn1_add0)} + EVP_PKEY_asn1_add0 := @_EVP_PKEY_asn1_add0; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_asn1_add0_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_asn1_add0'); + {$ifend} + end; + + + EVP_PKEY_asn1_add_alias := LoadLibFunction(ADllHandle, EVP_PKEY_asn1_add_alias_procname); + FuncLoadError := not assigned(EVP_PKEY_asn1_add_alias); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_asn1_add_alias_allownil)} + EVP_PKEY_asn1_add_alias := @ERR_EVP_PKEY_asn1_add_alias; + {$ifend} + {$if declared(EVP_PKEY_asn1_add_alias_introduced)} + if LibVersion < EVP_PKEY_asn1_add_alias_introduced then + begin + {$if declared(FC_EVP_PKEY_asn1_add_alias)} + EVP_PKEY_asn1_add_alias := @FC_EVP_PKEY_asn1_add_alias; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_asn1_add_alias_removed)} + if EVP_PKEY_asn1_add_alias_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_asn1_add_alias)} + EVP_PKEY_asn1_add_alias := @_EVP_PKEY_asn1_add_alias; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_asn1_add_alias_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_asn1_add_alias'); + {$ifend} + end; + + + EVP_PKEY_asn1_get0_info := LoadLibFunction(ADllHandle, EVP_PKEY_asn1_get0_info_procname); + FuncLoadError := not assigned(EVP_PKEY_asn1_get0_info); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_asn1_get0_info_allownil)} + EVP_PKEY_asn1_get0_info := @ERR_EVP_PKEY_asn1_get0_info; + {$ifend} + {$if declared(EVP_PKEY_asn1_get0_info_introduced)} + if LibVersion < EVP_PKEY_asn1_get0_info_introduced then + begin + {$if declared(FC_EVP_PKEY_asn1_get0_info)} + EVP_PKEY_asn1_get0_info := @FC_EVP_PKEY_asn1_get0_info; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_asn1_get0_info_removed)} + if EVP_PKEY_asn1_get0_info_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_asn1_get0_info)} + EVP_PKEY_asn1_get0_info := @_EVP_PKEY_asn1_get0_info; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_asn1_get0_info_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_asn1_get0_info'); + {$ifend} + end; + + + EVP_PKEY_get0_asn1 := LoadLibFunction(ADllHandle, EVP_PKEY_get0_asn1_procname); + FuncLoadError := not assigned(EVP_PKEY_get0_asn1); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_get0_asn1_allownil)} + EVP_PKEY_get0_asn1 := @ERR_EVP_PKEY_get0_asn1; + {$ifend} + {$if declared(EVP_PKEY_get0_asn1_introduced)} + if LibVersion < EVP_PKEY_get0_asn1_introduced then + begin + {$if declared(FC_EVP_PKEY_get0_asn1)} + EVP_PKEY_get0_asn1 := @FC_EVP_PKEY_get0_asn1; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_get0_asn1_removed)} + if EVP_PKEY_get0_asn1_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_get0_asn1)} + EVP_PKEY_get0_asn1 := @_EVP_PKEY_get0_asn1; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_get0_asn1_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_get0_asn1'); + {$ifend} + end; + + + EVP_PKEY_asn1_new := LoadLibFunction(ADllHandle, EVP_PKEY_asn1_new_procname); + FuncLoadError := not assigned(EVP_PKEY_asn1_new); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_asn1_new_allownil)} + EVP_PKEY_asn1_new := @ERR_EVP_PKEY_asn1_new; + {$ifend} + {$if declared(EVP_PKEY_asn1_new_introduced)} + if LibVersion < EVP_PKEY_asn1_new_introduced then + begin + {$if declared(FC_EVP_PKEY_asn1_new)} + EVP_PKEY_asn1_new := @FC_EVP_PKEY_asn1_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_asn1_new_removed)} + if EVP_PKEY_asn1_new_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_asn1_new)} + EVP_PKEY_asn1_new := @_EVP_PKEY_asn1_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_asn1_new_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_asn1_new'); + {$ifend} + end; + + + EVP_PKEY_asn1_copy := LoadLibFunction(ADllHandle, EVP_PKEY_asn1_copy_procname); + FuncLoadError := not assigned(EVP_PKEY_asn1_copy); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_asn1_copy_allownil)} + EVP_PKEY_asn1_copy := @ERR_EVP_PKEY_asn1_copy; + {$ifend} + {$if declared(EVP_PKEY_asn1_copy_introduced)} + if LibVersion < EVP_PKEY_asn1_copy_introduced then + begin + {$if declared(FC_EVP_PKEY_asn1_copy)} + EVP_PKEY_asn1_copy := @FC_EVP_PKEY_asn1_copy; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_asn1_copy_removed)} + if EVP_PKEY_asn1_copy_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_asn1_copy)} + EVP_PKEY_asn1_copy := @_EVP_PKEY_asn1_copy; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_asn1_copy_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_asn1_copy'); + {$ifend} + end; + + + EVP_PKEY_asn1_free := LoadLibFunction(ADllHandle, EVP_PKEY_asn1_free_procname); + FuncLoadError := not assigned(EVP_PKEY_asn1_free); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_asn1_free_allownil)} + EVP_PKEY_asn1_free := @ERR_EVP_PKEY_asn1_free; + {$ifend} + {$if declared(EVP_PKEY_asn1_free_introduced)} + if LibVersion < EVP_PKEY_asn1_free_introduced then + begin + {$if declared(FC_EVP_PKEY_asn1_free)} + EVP_PKEY_asn1_free := @FC_EVP_PKEY_asn1_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_asn1_free_removed)} + if EVP_PKEY_asn1_free_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_asn1_free)} + EVP_PKEY_asn1_free := @_EVP_PKEY_asn1_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_asn1_free_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_asn1_free'); + {$ifend} + end; + + + EVP_PKEY_asn1_set_public := LoadLibFunction(ADllHandle, EVP_PKEY_asn1_set_public_procname); + FuncLoadError := not assigned(EVP_PKEY_asn1_set_public); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_asn1_set_public_allownil)} + EVP_PKEY_asn1_set_public := @ERR_EVP_PKEY_asn1_set_public; + {$ifend} + {$if declared(EVP_PKEY_asn1_set_public_introduced)} + if LibVersion < EVP_PKEY_asn1_set_public_introduced then + begin + {$if declared(FC_EVP_PKEY_asn1_set_public)} + EVP_PKEY_asn1_set_public := @FC_EVP_PKEY_asn1_set_public; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_asn1_set_public_removed)} + if EVP_PKEY_asn1_set_public_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_asn1_set_public)} + EVP_PKEY_asn1_set_public := @_EVP_PKEY_asn1_set_public; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_asn1_set_public_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_asn1_set_public'); + {$ifend} + end; + + + EVP_PKEY_asn1_set_private := LoadLibFunction(ADllHandle, EVP_PKEY_asn1_set_private_procname); + FuncLoadError := not assigned(EVP_PKEY_asn1_set_private); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_asn1_set_private_allownil)} + EVP_PKEY_asn1_set_private := @ERR_EVP_PKEY_asn1_set_private; + {$ifend} + {$if declared(EVP_PKEY_asn1_set_private_introduced)} + if LibVersion < EVP_PKEY_asn1_set_private_introduced then + begin + {$if declared(FC_EVP_PKEY_asn1_set_private)} + EVP_PKEY_asn1_set_private := @FC_EVP_PKEY_asn1_set_private; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_asn1_set_private_removed)} + if EVP_PKEY_asn1_set_private_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_asn1_set_private)} + EVP_PKEY_asn1_set_private := @_EVP_PKEY_asn1_set_private; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_asn1_set_private_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_asn1_set_private'); + {$ifend} + end; + + + EVP_PKEY_asn1_set_param := LoadLibFunction(ADllHandle, EVP_PKEY_asn1_set_param_procname); + FuncLoadError := not assigned(EVP_PKEY_asn1_set_param); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_asn1_set_param_allownil)} + EVP_PKEY_asn1_set_param := @ERR_EVP_PKEY_asn1_set_param; + {$ifend} + {$if declared(EVP_PKEY_asn1_set_param_introduced)} + if LibVersion < EVP_PKEY_asn1_set_param_introduced then + begin + {$if declared(FC_EVP_PKEY_asn1_set_param)} + EVP_PKEY_asn1_set_param := @FC_EVP_PKEY_asn1_set_param; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_asn1_set_param_removed)} + if EVP_PKEY_asn1_set_param_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_asn1_set_param)} + EVP_PKEY_asn1_set_param := @_EVP_PKEY_asn1_set_param; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_asn1_set_param_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_asn1_set_param'); + {$ifend} + end; + + + EVP_PKEY_asn1_set_free := LoadLibFunction(ADllHandle, EVP_PKEY_asn1_set_free_procname); + FuncLoadError := not assigned(EVP_PKEY_asn1_set_free); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_asn1_set_free_allownil)} + EVP_PKEY_asn1_set_free := @ERR_EVP_PKEY_asn1_set_free; + {$ifend} + {$if declared(EVP_PKEY_asn1_set_free_introduced)} + if LibVersion < EVP_PKEY_asn1_set_free_introduced then + begin + {$if declared(FC_EVP_PKEY_asn1_set_free)} + EVP_PKEY_asn1_set_free := @FC_EVP_PKEY_asn1_set_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_asn1_set_free_removed)} + if EVP_PKEY_asn1_set_free_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_asn1_set_free)} + EVP_PKEY_asn1_set_free := @_EVP_PKEY_asn1_set_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_asn1_set_free_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_asn1_set_free'); + {$ifend} + end; + + + EVP_PKEY_asn1_set_ctrl := LoadLibFunction(ADllHandle, EVP_PKEY_asn1_set_ctrl_procname); + FuncLoadError := not assigned(EVP_PKEY_asn1_set_ctrl); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_asn1_set_ctrl_allownil)} + EVP_PKEY_asn1_set_ctrl := @ERR_EVP_PKEY_asn1_set_ctrl; + {$ifend} + {$if declared(EVP_PKEY_asn1_set_ctrl_introduced)} + if LibVersion < EVP_PKEY_asn1_set_ctrl_introduced then + begin + {$if declared(FC_EVP_PKEY_asn1_set_ctrl)} + EVP_PKEY_asn1_set_ctrl := @FC_EVP_PKEY_asn1_set_ctrl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_asn1_set_ctrl_removed)} + if EVP_PKEY_asn1_set_ctrl_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_asn1_set_ctrl)} + EVP_PKEY_asn1_set_ctrl := @_EVP_PKEY_asn1_set_ctrl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_asn1_set_ctrl_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_asn1_set_ctrl'); + {$ifend} + end; + + + EVP_PKEY_asn1_set_item := LoadLibFunction(ADllHandle, EVP_PKEY_asn1_set_item_procname); + FuncLoadError := not assigned(EVP_PKEY_asn1_set_item); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_asn1_set_item_allownil)} + EVP_PKEY_asn1_set_item := @ERR_EVP_PKEY_asn1_set_item; + {$ifend} + {$if declared(EVP_PKEY_asn1_set_item_introduced)} + if LibVersion < EVP_PKEY_asn1_set_item_introduced then + begin + {$if declared(FC_EVP_PKEY_asn1_set_item)} + EVP_PKEY_asn1_set_item := @FC_EVP_PKEY_asn1_set_item; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_asn1_set_item_removed)} + if EVP_PKEY_asn1_set_item_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_asn1_set_item)} + EVP_PKEY_asn1_set_item := @_EVP_PKEY_asn1_set_item; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_asn1_set_item_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_asn1_set_item'); + {$ifend} + end; + + + EVP_PKEY_asn1_set_siginf := LoadLibFunction(ADllHandle, EVP_PKEY_asn1_set_siginf_procname); + FuncLoadError := not assigned(EVP_PKEY_asn1_set_siginf); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_asn1_set_siginf_allownil)} + EVP_PKEY_asn1_set_siginf := @ERR_EVP_PKEY_asn1_set_siginf; + {$ifend} + {$if declared(EVP_PKEY_asn1_set_siginf_introduced)} + if LibVersion < EVP_PKEY_asn1_set_siginf_introduced then + begin + {$if declared(FC_EVP_PKEY_asn1_set_siginf)} + EVP_PKEY_asn1_set_siginf := @FC_EVP_PKEY_asn1_set_siginf; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_asn1_set_siginf_removed)} + if EVP_PKEY_asn1_set_siginf_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_asn1_set_siginf)} + EVP_PKEY_asn1_set_siginf := @_EVP_PKEY_asn1_set_siginf; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_asn1_set_siginf_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_asn1_set_siginf'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_PKEY_asn1_set_check := LoadLibFunction(ADllHandle, EVP_PKEY_asn1_set_check_procname); + FuncLoadError := not assigned(EVP_PKEY_asn1_set_check); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_asn1_set_check_allownil)} + EVP_PKEY_asn1_set_check := @ERR_EVP_PKEY_asn1_set_check; + {$ifend} + {$if declared(EVP_PKEY_asn1_set_check_introduced)} + if LibVersion < EVP_PKEY_asn1_set_check_introduced then + begin + {$if declared(FC_EVP_PKEY_asn1_set_check)} + EVP_PKEY_asn1_set_check := @FC_EVP_PKEY_asn1_set_check; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_asn1_set_check_removed)} + if EVP_PKEY_asn1_set_check_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_asn1_set_check)} + EVP_PKEY_asn1_set_check := @_EVP_PKEY_asn1_set_check; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_asn1_set_check_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_asn1_set_check'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_PKEY_asn1_set_public_check := LoadLibFunction(ADllHandle, EVP_PKEY_asn1_set_public_check_procname); + FuncLoadError := not assigned(EVP_PKEY_asn1_set_public_check); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_asn1_set_public_check_allownil)} + EVP_PKEY_asn1_set_public_check := @ERR_EVP_PKEY_asn1_set_public_check; + {$ifend} + {$if declared(EVP_PKEY_asn1_set_public_check_introduced)} + if LibVersion < EVP_PKEY_asn1_set_public_check_introduced then + begin + {$if declared(FC_EVP_PKEY_asn1_set_public_check)} + EVP_PKEY_asn1_set_public_check := @FC_EVP_PKEY_asn1_set_public_check; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_asn1_set_public_check_removed)} + if EVP_PKEY_asn1_set_public_check_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_asn1_set_public_check)} + EVP_PKEY_asn1_set_public_check := @_EVP_PKEY_asn1_set_public_check; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_asn1_set_public_check_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_asn1_set_public_check'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_PKEY_asn1_set_param_check := LoadLibFunction(ADllHandle, EVP_PKEY_asn1_set_param_check_procname); + FuncLoadError := not assigned(EVP_PKEY_asn1_set_param_check); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_asn1_set_param_check_allownil)} + EVP_PKEY_asn1_set_param_check := @ERR_EVP_PKEY_asn1_set_param_check; + {$ifend} + {$if declared(EVP_PKEY_asn1_set_param_check_introduced)} + if LibVersion < EVP_PKEY_asn1_set_param_check_introduced then + begin + {$if declared(FC_EVP_PKEY_asn1_set_param_check)} + EVP_PKEY_asn1_set_param_check := @FC_EVP_PKEY_asn1_set_param_check; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_asn1_set_param_check_removed)} + if EVP_PKEY_asn1_set_param_check_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_asn1_set_param_check)} + EVP_PKEY_asn1_set_param_check := @_EVP_PKEY_asn1_set_param_check; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_asn1_set_param_check_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_asn1_set_param_check'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_PKEY_asn1_set_set_priv_key := LoadLibFunction(ADllHandle, EVP_PKEY_asn1_set_set_priv_key_procname); + FuncLoadError := not assigned(EVP_PKEY_asn1_set_set_priv_key); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_asn1_set_set_priv_key_allownil)} + EVP_PKEY_asn1_set_set_priv_key := @ERR_EVP_PKEY_asn1_set_set_priv_key; + {$ifend} + {$if declared(EVP_PKEY_asn1_set_set_priv_key_introduced)} + if LibVersion < EVP_PKEY_asn1_set_set_priv_key_introduced then + begin + {$if declared(FC_EVP_PKEY_asn1_set_set_priv_key)} + EVP_PKEY_asn1_set_set_priv_key := @FC_EVP_PKEY_asn1_set_set_priv_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_asn1_set_set_priv_key_removed)} + if EVP_PKEY_asn1_set_set_priv_key_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_asn1_set_set_priv_key)} + EVP_PKEY_asn1_set_set_priv_key := @_EVP_PKEY_asn1_set_set_priv_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_asn1_set_set_priv_key_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_asn1_set_set_priv_key'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_PKEY_asn1_set_set_pub_key := LoadLibFunction(ADllHandle, EVP_PKEY_asn1_set_set_pub_key_procname); + FuncLoadError := not assigned(EVP_PKEY_asn1_set_set_pub_key); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_asn1_set_set_pub_key_allownil)} + EVP_PKEY_asn1_set_set_pub_key := @ERR_EVP_PKEY_asn1_set_set_pub_key; + {$ifend} + {$if declared(EVP_PKEY_asn1_set_set_pub_key_introduced)} + if LibVersion < EVP_PKEY_asn1_set_set_pub_key_introduced then + begin + {$if declared(FC_EVP_PKEY_asn1_set_set_pub_key)} + EVP_PKEY_asn1_set_set_pub_key := @FC_EVP_PKEY_asn1_set_set_pub_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_asn1_set_set_pub_key_removed)} + if EVP_PKEY_asn1_set_set_pub_key_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_asn1_set_set_pub_key)} + EVP_PKEY_asn1_set_set_pub_key := @_EVP_PKEY_asn1_set_set_pub_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_asn1_set_set_pub_key_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_asn1_set_set_pub_key'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_PKEY_asn1_set_get_priv_key := LoadLibFunction(ADllHandle, EVP_PKEY_asn1_set_get_priv_key_procname); + FuncLoadError := not assigned(EVP_PKEY_asn1_set_get_priv_key); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_asn1_set_get_priv_key_allownil)} + EVP_PKEY_asn1_set_get_priv_key := @ERR_EVP_PKEY_asn1_set_get_priv_key; + {$ifend} + {$if declared(EVP_PKEY_asn1_set_get_priv_key_introduced)} + if LibVersion < EVP_PKEY_asn1_set_get_priv_key_introduced then + begin + {$if declared(FC_EVP_PKEY_asn1_set_get_priv_key)} + EVP_PKEY_asn1_set_get_priv_key := @FC_EVP_PKEY_asn1_set_get_priv_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_asn1_set_get_priv_key_removed)} + if EVP_PKEY_asn1_set_get_priv_key_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_asn1_set_get_priv_key)} + EVP_PKEY_asn1_set_get_priv_key := @_EVP_PKEY_asn1_set_get_priv_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_asn1_set_get_priv_key_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_asn1_set_get_priv_key'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_PKEY_asn1_set_get_pub_key := LoadLibFunction(ADllHandle, EVP_PKEY_asn1_set_get_pub_key_procname); + FuncLoadError := not assigned(EVP_PKEY_asn1_set_get_pub_key); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_asn1_set_get_pub_key_allownil)} + EVP_PKEY_asn1_set_get_pub_key := @ERR_EVP_PKEY_asn1_set_get_pub_key; + {$ifend} + {$if declared(EVP_PKEY_asn1_set_get_pub_key_introduced)} + if LibVersion < EVP_PKEY_asn1_set_get_pub_key_introduced then + begin + {$if declared(FC_EVP_PKEY_asn1_set_get_pub_key)} + EVP_PKEY_asn1_set_get_pub_key := @FC_EVP_PKEY_asn1_set_get_pub_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_asn1_set_get_pub_key_removed)} + if EVP_PKEY_asn1_set_get_pub_key_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_asn1_set_get_pub_key)} + EVP_PKEY_asn1_set_get_pub_key := @_EVP_PKEY_asn1_set_get_pub_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_asn1_set_get_pub_key_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_asn1_set_get_pub_key'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_PKEY_asn1_set_security_bits := LoadLibFunction(ADllHandle, EVP_PKEY_asn1_set_security_bits_procname); + FuncLoadError := not assigned(EVP_PKEY_asn1_set_security_bits); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_asn1_set_security_bits_allownil)} + EVP_PKEY_asn1_set_security_bits := @ERR_EVP_PKEY_asn1_set_security_bits; + {$ifend} + {$if declared(EVP_PKEY_asn1_set_security_bits_introduced)} + if LibVersion < EVP_PKEY_asn1_set_security_bits_introduced then + begin + {$if declared(FC_EVP_PKEY_asn1_set_security_bits)} + EVP_PKEY_asn1_set_security_bits := @FC_EVP_PKEY_asn1_set_security_bits; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_asn1_set_security_bits_removed)} + if EVP_PKEY_asn1_set_security_bits_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_asn1_set_security_bits)} + EVP_PKEY_asn1_set_security_bits := @_EVP_PKEY_asn1_set_security_bits; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_asn1_set_security_bits_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_asn1_set_security_bits'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_PKEY_meth_find := LoadLibFunction(ADllHandle, EVP_PKEY_meth_find_procname); + FuncLoadError := not assigned(EVP_PKEY_meth_find); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_meth_find_allownil)} + EVP_PKEY_meth_find := @ERR_EVP_PKEY_meth_find; + {$ifend} + {$if declared(EVP_PKEY_meth_find_introduced)} + if LibVersion < EVP_PKEY_meth_find_introduced then + begin + {$if declared(FC_EVP_PKEY_meth_find)} + EVP_PKEY_meth_find := @FC_EVP_PKEY_meth_find; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_meth_find_removed)} + if EVP_PKEY_meth_find_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_meth_find)} + EVP_PKEY_meth_find := @_EVP_PKEY_meth_find; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_meth_find_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_meth_find'); + {$ifend} + end; + + + EVP_PKEY_meth_new := LoadLibFunction(ADllHandle, EVP_PKEY_meth_new_procname); + FuncLoadError := not assigned(EVP_PKEY_meth_new); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_meth_new_allownil)} + EVP_PKEY_meth_new := @ERR_EVP_PKEY_meth_new; + {$ifend} + {$if declared(EVP_PKEY_meth_new_introduced)} + if LibVersion < EVP_PKEY_meth_new_introduced then + begin + {$if declared(FC_EVP_PKEY_meth_new)} + EVP_PKEY_meth_new := @FC_EVP_PKEY_meth_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_meth_new_removed)} + if EVP_PKEY_meth_new_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_meth_new)} + EVP_PKEY_meth_new := @_EVP_PKEY_meth_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_meth_new_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_meth_new'); + {$ifend} + end; + + + EVP_PKEY_meth_get0_info := LoadLibFunction(ADllHandle, EVP_PKEY_meth_get0_info_procname); + FuncLoadError := not assigned(EVP_PKEY_meth_get0_info); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_meth_get0_info_allownil)} + EVP_PKEY_meth_get0_info := @ERR_EVP_PKEY_meth_get0_info; + {$ifend} + {$if declared(EVP_PKEY_meth_get0_info_introduced)} + if LibVersion < EVP_PKEY_meth_get0_info_introduced then + begin + {$if declared(FC_EVP_PKEY_meth_get0_info)} + EVP_PKEY_meth_get0_info := @FC_EVP_PKEY_meth_get0_info; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_meth_get0_info_removed)} + if EVP_PKEY_meth_get0_info_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_meth_get0_info)} + EVP_PKEY_meth_get0_info := @_EVP_PKEY_meth_get0_info; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_meth_get0_info_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_meth_get0_info'); + {$ifend} + end; + + + EVP_PKEY_meth_copy := LoadLibFunction(ADllHandle, EVP_PKEY_meth_copy_procname); + FuncLoadError := not assigned(EVP_PKEY_meth_copy); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_meth_copy_allownil)} + EVP_PKEY_meth_copy := @ERR_EVP_PKEY_meth_copy; + {$ifend} + {$if declared(EVP_PKEY_meth_copy_introduced)} + if LibVersion < EVP_PKEY_meth_copy_introduced then + begin + {$if declared(FC_EVP_PKEY_meth_copy)} + EVP_PKEY_meth_copy := @FC_EVP_PKEY_meth_copy; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_meth_copy_removed)} + if EVP_PKEY_meth_copy_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_meth_copy)} + EVP_PKEY_meth_copy := @_EVP_PKEY_meth_copy; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_meth_copy_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_meth_copy'); + {$ifend} + end; + + + EVP_PKEY_meth_free := LoadLibFunction(ADllHandle, EVP_PKEY_meth_free_procname); + FuncLoadError := not assigned(EVP_PKEY_meth_free); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_meth_free_allownil)} + EVP_PKEY_meth_free := @ERR_EVP_PKEY_meth_free; + {$ifend} + {$if declared(EVP_PKEY_meth_free_introduced)} + if LibVersion < EVP_PKEY_meth_free_introduced then + begin + {$if declared(FC_EVP_PKEY_meth_free)} + EVP_PKEY_meth_free := @FC_EVP_PKEY_meth_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_meth_free_removed)} + if EVP_PKEY_meth_free_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_meth_free)} + EVP_PKEY_meth_free := @_EVP_PKEY_meth_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_meth_free_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_meth_free'); + {$ifend} + end; + + + EVP_PKEY_meth_add0 := LoadLibFunction(ADllHandle, EVP_PKEY_meth_add0_procname); + FuncLoadError := not assigned(EVP_PKEY_meth_add0); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_meth_add0_allownil)} + EVP_PKEY_meth_add0 := @ERR_EVP_PKEY_meth_add0; + {$ifend} + {$if declared(EVP_PKEY_meth_add0_introduced)} + if LibVersion < EVP_PKEY_meth_add0_introduced then + begin + {$if declared(FC_EVP_PKEY_meth_add0)} + EVP_PKEY_meth_add0 := @FC_EVP_PKEY_meth_add0; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_meth_add0_removed)} + if EVP_PKEY_meth_add0_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_meth_add0)} + EVP_PKEY_meth_add0 := @_EVP_PKEY_meth_add0; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_meth_add0_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_meth_add0'); + {$ifend} + end; + + + EVP_PKEY_meth_remove := LoadLibFunction(ADllHandle, EVP_PKEY_meth_remove_procname); + FuncLoadError := not assigned(EVP_PKEY_meth_remove); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_meth_remove_allownil)} + EVP_PKEY_meth_remove := @ERR_EVP_PKEY_meth_remove; + {$ifend} + {$if declared(EVP_PKEY_meth_remove_introduced)} + if LibVersion < EVP_PKEY_meth_remove_introduced then + begin + {$if declared(FC_EVP_PKEY_meth_remove)} + EVP_PKEY_meth_remove := @FC_EVP_PKEY_meth_remove; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_meth_remove_removed)} + if EVP_PKEY_meth_remove_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_meth_remove)} + EVP_PKEY_meth_remove := @_EVP_PKEY_meth_remove; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_meth_remove_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_meth_remove'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_PKEY_meth_get_count := LoadLibFunction(ADllHandle, EVP_PKEY_meth_get_count_procname); + FuncLoadError := not assigned(EVP_PKEY_meth_get_count); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_meth_get_count_allownil)} + EVP_PKEY_meth_get_count := @ERR_EVP_PKEY_meth_get_count; + {$ifend} + {$if declared(EVP_PKEY_meth_get_count_introduced)} + if LibVersion < EVP_PKEY_meth_get_count_introduced then + begin + {$if declared(FC_EVP_PKEY_meth_get_count)} + EVP_PKEY_meth_get_count := @FC_EVP_PKEY_meth_get_count; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_meth_get_count_removed)} + if EVP_PKEY_meth_get_count_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_meth_get_count)} + EVP_PKEY_meth_get_count := @_EVP_PKEY_meth_get_count; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_meth_get_count_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_meth_get_count'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_PKEY_meth_get0 := LoadLibFunction(ADllHandle, EVP_PKEY_meth_get0_procname); + FuncLoadError := not assigned(EVP_PKEY_meth_get0); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_meth_get0_allownil)} + EVP_PKEY_meth_get0 := @ERR_EVP_PKEY_meth_get0; + {$ifend} + {$if declared(EVP_PKEY_meth_get0_introduced)} + if LibVersion < EVP_PKEY_meth_get0_introduced then + begin + {$if declared(FC_EVP_PKEY_meth_get0)} + EVP_PKEY_meth_get0 := @FC_EVP_PKEY_meth_get0; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_meth_get0_removed)} + if EVP_PKEY_meth_get0_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_meth_get0)} + EVP_PKEY_meth_get0 := @_EVP_PKEY_meth_get0; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_meth_get0_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_meth_get0'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_PKEY_CTX_new := LoadLibFunction(ADllHandle, EVP_PKEY_CTX_new_procname); + FuncLoadError := not assigned(EVP_PKEY_CTX_new); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_CTX_new_allownil)} + EVP_PKEY_CTX_new := @ERR_EVP_PKEY_CTX_new; + {$ifend} + {$if declared(EVP_PKEY_CTX_new_introduced)} + if LibVersion < EVP_PKEY_CTX_new_introduced then + begin + {$if declared(FC_EVP_PKEY_CTX_new)} + EVP_PKEY_CTX_new := @FC_EVP_PKEY_CTX_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_CTX_new_removed)} + if EVP_PKEY_CTX_new_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_CTX_new)} + EVP_PKEY_CTX_new := @_EVP_PKEY_CTX_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_CTX_new_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_CTX_new'); + {$ifend} + end; + + + EVP_PKEY_CTX_new_id := LoadLibFunction(ADllHandle, EVP_PKEY_CTX_new_id_procname); + FuncLoadError := not assigned(EVP_PKEY_CTX_new_id); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_CTX_new_id_allownil)} + EVP_PKEY_CTX_new_id := @ERR_EVP_PKEY_CTX_new_id; + {$ifend} + {$if declared(EVP_PKEY_CTX_new_id_introduced)} + if LibVersion < EVP_PKEY_CTX_new_id_introduced then + begin + {$if declared(FC_EVP_PKEY_CTX_new_id)} + EVP_PKEY_CTX_new_id := @FC_EVP_PKEY_CTX_new_id; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_CTX_new_id_removed)} + if EVP_PKEY_CTX_new_id_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_CTX_new_id)} + EVP_PKEY_CTX_new_id := @_EVP_PKEY_CTX_new_id; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_CTX_new_id_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_CTX_new_id'); + {$ifend} + end; + + + EVP_PKEY_CTX_dup := LoadLibFunction(ADllHandle, EVP_PKEY_CTX_dup_procname); + FuncLoadError := not assigned(EVP_PKEY_CTX_dup); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_CTX_dup_allownil)} + EVP_PKEY_CTX_dup := @ERR_EVP_PKEY_CTX_dup; + {$ifend} + {$if declared(EVP_PKEY_CTX_dup_introduced)} + if LibVersion < EVP_PKEY_CTX_dup_introduced then + begin + {$if declared(FC_EVP_PKEY_CTX_dup)} + EVP_PKEY_CTX_dup := @FC_EVP_PKEY_CTX_dup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_CTX_dup_removed)} + if EVP_PKEY_CTX_dup_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_CTX_dup)} + EVP_PKEY_CTX_dup := @_EVP_PKEY_CTX_dup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_CTX_dup_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_CTX_dup'); + {$ifend} + end; + + + EVP_PKEY_CTX_free := LoadLibFunction(ADllHandle, EVP_PKEY_CTX_free_procname); + FuncLoadError := not assigned(EVP_PKEY_CTX_free); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_CTX_free_allownil)} + EVP_PKEY_CTX_free := @ERR_EVP_PKEY_CTX_free; + {$ifend} + {$if declared(EVP_PKEY_CTX_free_introduced)} + if LibVersion < EVP_PKEY_CTX_free_introduced then + begin + {$if declared(FC_EVP_PKEY_CTX_free)} + EVP_PKEY_CTX_free := @FC_EVP_PKEY_CTX_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_CTX_free_removed)} + if EVP_PKEY_CTX_free_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_CTX_free)} + EVP_PKEY_CTX_free := @_EVP_PKEY_CTX_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_CTX_free_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_CTX_free'); + {$ifend} + end; + + + EVP_PKEY_CTX_ctrl := LoadLibFunction(ADllHandle, EVP_PKEY_CTX_ctrl_procname); + FuncLoadError := not assigned(EVP_PKEY_CTX_ctrl); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_CTX_ctrl_allownil)} + EVP_PKEY_CTX_ctrl := @ERR_EVP_PKEY_CTX_ctrl; + {$ifend} + {$if declared(EVP_PKEY_CTX_ctrl_introduced)} + if LibVersion < EVP_PKEY_CTX_ctrl_introduced then + begin + {$if declared(FC_EVP_PKEY_CTX_ctrl)} + EVP_PKEY_CTX_ctrl := @FC_EVP_PKEY_CTX_ctrl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_CTX_ctrl_removed)} + if EVP_PKEY_CTX_ctrl_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_CTX_ctrl)} + EVP_PKEY_CTX_ctrl := @_EVP_PKEY_CTX_ctrl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_CTX_ctrl_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_CTX_ctrl'); + {$ifend} + end; + + + EVP_PKEY_CTX_ctrl_str := LoadLibFunction(ADllHandle, EVP_PKEY_CTX_ctrl_str_procname); + FuncLoadError := not assigned(EVP_PKEY_CTX_ctrl_str); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_CTX_ctrl_str_allownil)} + EVP_PKEY_CTX_ctrl_str := @ERR_EVP_PKEY_CTX_ctrl_str; + {$ifend} + {$if declared(EVP_PKEY_CTX_ctrl_str_introduced)} + if LibVersion < EVP_PKEY_CTX_ctrl_str_introduced then + begin + {$if declared(FC_EVP_PKEY_CTX_ctrl_str)} + EVP_PKEY_CTX_ctrl_str := @FC_EVP_PKEY_CTX_ctrl_str; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_CTX_ctrl_str_removed)} + if EVP_PKEY_CTX_ctrl_str_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_CTX_ctrl_str)} + EVP_PKEY_CTX_ctrl_str := @_EVP_PKEY_CTX_ctrl_str; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_CTX_ctrl_str_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_CTX_ctrl_str'); + {$ifend} + end; + + + EVP_PKEY_CTX_ctrl_uint64 := LoadLibFunction(ADllHandle, EVP_PKEY_CTX_ctrl_uint64_procname); + FuncLoadError := not assigned(EVP_PKEY_CTX_ctrl_uint64); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_CTX_ctrl_uint64_allownil)} + EVP_PKEY_CTX_ctrl_uint64 := @ERR_EVP_PKEY_CTX_ctrl_uint64; + {$ifend} + {$if declared(EVP_PKEY_CTX_ctrl_uint64_introduced)} + if LibVersion < EVP_PKEY_CTX_ctrl_uint64_introduced then + begin + {$if declared(FC_EVP_PKEY_CTX_ctrl_uint64)} + EVP_PKEY_CTX_ctrl_uint64 := @FC_EVP_PKEY_CTX_ctrl_uint64; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_CTX_ctrl_uint64_removed)} + if EVP_PKEY_CTX_ctrl_uint64_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_CTX_ctrl_uint64)} + EVP_PKEY_CTX_ctrl_uint64 := @_EVP_PKEY_CTX_ctrl_uint64; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_CTX_ctrl_uint64_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_CTX_ctrl_uint64'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_PKEY_CTX_str2ctrl := LoadLibFunction(ADllHandle, EVP_PKEY_CTX_str2ctrl_procname); + FuncLoadError := not assigned(EVP_PKEY_CTX_str2ctrl); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_CTX_str2ctrl_allownil)} + EVP_PKEY_CTX_str2ctrl := @ERR_EVP_PKEY_CTX_str2ctrl; + {$ifend} + {$if declared(EVP_PKEY_CTX_str2ctrl_introduced)} + if LibVersion < EVP_PKEY_CTX_str2ctrl_introduced then + begin + {$if declared(FC_EVP_PKEY_CTX_str2ctrl)} + EVP_PKEY_CTX_str2ctrl := @FC_EVP_PKEY_CTX_str2ctrl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_CTX_str2ctrl_removed)} + if EVP_PKEY_CTX_str2ctrl_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_CTX_str2ctrl)} + EVP_PKEY_CTX_str2ctrl := @_EVP_PKEY_CTX_str2ctrl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_CTX_str2ctrl_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_CTX_str2ctrl'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_PKEY_CTX_hex2ctrl := LoadLibFunction(ADllHandle, EVP_PKEY_CTX_hex2ctrl_procname); + FuncLoadError := not assigned(EVP_PKEY_CTX_hex2ctrl); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_CTX_hex2ctrl_allownil)} + EVP_PKEY_CTX_hex2ctrl := @ERR_EVP_PKEY_CTX_hex2ctrl; + {$ifend} + {$if declared(EVP_PKEY_CTX_hex2ctrl_introduced)} + if LibVersion < EVP_PKEY_CTX_hex2ctrl_introduced then + begin + {$if declared(FC_EVP_PKEY_CTX_hex2ctrl)} + EVP_PKEY_CTX_hex2ctrl := @FC_EVP_PKEY_CTX_hex2ctrl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_CTX_hex2ctrl_removed)} + if EVP_PKEY_CTX_hex2ctrl_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_CTX_hex2ctrl)} + EVP_PKEY_CTX_hex2ctrl := @_EVP_PKEY_CTX_hex2ctrl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_CTX_hex2ctrl_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_CTX_hex2ctrl'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_PKEY_CTX_md := LoadLibFunction(ADllHandle, EVP_PKEY_CTX_md_procname); + FuncLoadError := not assigned(EVP_PKEY_CTX_md); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_CTX_md_allownil)} + EVP_PKEY_CTX_md := @ERR_EVP_PKEY_CTX_md; + {$ifend} + {$if declared(EVP_PKEY_CTX_md_introduced)} + if LibVersion < EVP_PKEY_CTX_md_introduced then + begin + {$if declared(FC_EVP_PKEY_CTX_md)} + EVP_PKEY_CTX_md := @FC_EVP_PKEY_CTX_md; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_CTX_md_removed)} + if EVP_PKEY_CTX_md_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_CTX_md)} + EVP_PKEY_CTX_md := @_EVP_PKEY_CTX_md; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_CTX_md_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_CTX_md'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_PKEY_CTX_get_operation := LoadLibFunction(ADllHandle, EVP_PKEY_CTX_get_operation_procname); + FuncLoadError := not assigned(EVP_PKEY_CTX_get_operation); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_CTX_get_operation_allownil)} + EVP_PKEY_CTX_get_operation := @ERR_EVP_PKEY_CTX_get_operation; + {$ifend} + {$if declared(EVP_PKEY_CTX_get_operation_introduced)} + if LibVersion < EVP_PKEY_CTX_get_operation_introduced then + begin + {$if declared(FC_EVP_PKEY_CTX_get_operation)} + EVP_PKEY_CTX_get_operation := @FC_EVP_PKEY_CTX_get_operation; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_CTX_get_operation_removed)} + if EVP_PKEY_CTX_get_operation_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_CTX_get_operation)} + EVP_PKEY_CTX_get_operation := @_EVP_PKEY_CTX_get_operation; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_CTX_get_operation_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_CTX_get_operation'); + {$ifend} + end; + + + EVP_PKEY_CTX_set0_keygen_info := LoadLibFunction(ADllHandle, EVP_PKEY_CTX_set0_keygen_info_procname); + FuncLoadError := not assigned(EVP_PKEY_CTX_set0_keygen_info); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_CTX_set0_keygen_info_allownil)} + EVP_PKEY_CTX_set0_keygen_info := @ERR_EVP_PKEY_CTX_set0_keygen_info; + {$ifend} + {$if declared(EVP_PKEY_CTX_set0_keygen_info_introduced)} + if LibVersion < EVP_PKEY_CTX_set0_keygen_info_introduced then + begin + {$if declared(FC_EVP_PKEY_CTX_set0_keygen_info)} + EVP_PKEY_CTX_set0_keygen_info := @FC_EVP_PKEY_CTX_set0_keygen_info; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_CTX_set0_keygen_info_removed)} + if EVP_PKEY_CTX_set0_keygen_info_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_CTX_set0_keygen_info)} + EVP_PKEY_CTX_set0_keygen_info := @_EVP_PKEY_CTX_set0_keygen_info; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_CTX_set0_keygen_info_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_CTX_set0_keygen_info'); + {$ifend} + end; + + + EVP_PKEY_new_mac_key := LoadLibFunction(ADllHandle, EVP_PKEY_new_mac_key_procname); + FuncLoadError := not assigned(EVP_PKEY_new_mac_key); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_new_mac_key_allownil)} + EVP_PKEY_new_mac_key := @ERR_EVP_PKEY_new_mac_key; + {$ifend} + {$if declared(EVP_PKEY_new_mac_key_introduced)} + if LibVersion < EVP_PKEY_new_mac_key_introduced then + begin + {$if declared(FC_EVP_PKEY_new_mac_key)} + EVP_PKEY_new_mac_key := @FC_EVP_PKEY_new_mac_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_new_mac_key_removed)} + if EVP_PKEY_new_mac_key_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_new_mac_key)} + EVP_PKEY_new_mac_key := @_EVP_PKEY_new_mac_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_new_mac_key_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_new_mac_key'); + {$ifend} + end; + + + EVP_PKEY_new_raw_private_key := LoadLibFunction(ADllHandle, EVP_PKEY_new_raw_private_key_procname); + FuncLoadError := not assigned(EVP_PKEY_new_raw_private_key); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_new_raw_private_key_allownil)} + EVP_PKEY_new_raw_private_key := @ERR_EVP_PKEY_new_raw_private_key; + {$ifend} + {$if declared(EVP_PKEY_new_raw_private_key_introduced)} + if LibVersion < EVP_PKEY_new_raw_private_key_introduced then + begin + {$if declared(FC_EVP_PKEY_new_raw_private_key)} + EVP_PKEY_new_raw_private_key := @FC_EVP_PKEY_new_raw_private_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_new_raw_private_key_removed)} + if EVP_PKEY_new_raw_private_key_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_new_raw_private_key)} + EVP_PKEY_new_raw_private_key := @_EVP_PKEY_new_raw_private_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_new_raw_private_key_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_new_raw_private_key'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_PKEY_new_raw_public_key := LoadLibFunction(ADllHandle, EVP_PKEY_new_raw_public_key_procname); + FuncLoadError := not assigned(EVP_PKEY_new_raw_public_key); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_new_raw_public_key_allownil)} + EVP_PKEY_new_raw_public_key := @ERR_EVP_PKEY_new_raw_public_key; + {$ifend} + {$if declared(EVP_PKEY_new_raw_public_key_introduced)} + if LibVersion < EVP_PKEY_new_raw_public_key_introduced then + begin + {$if declared(FC_EVP_PKEY_new_raw_public_key)} + EVP_PKEY_new_raw_public_key := @FC_EVP_PKEY_new_raw_public_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_new_raw_public_key_removed)} + if EVP_PKEY_new_raw_public_key_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_new_raw_public_key)} + EVP_PKEY_new_raw_public_key := @_EVP_PKEY_new_raw_public_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_new_raw_public_key_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_new_raw_public_key'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_PKEY_get_raw_private_key := LoadLibFunction(ADllHandle, EVP_PKEY_get_raw_private_key_procname); + FuncLoadError := not assigned(EVP_PKEY_get_raw_private_key); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_get_raw_private_key_allownil)} + EVP_PKEY_get_raw_private_key := @ERR_EVP_PKEY_get_raw_private_key; + {$ifend} + {$if declared(EVP_PKEY_get_raw_private_key_introduced)} + if LibVersion < EVP_PKEY_get_raw_private_key_introduced then + begin + {$if declared(FC_EVP_PKEY_get_raw_private_key)} + EVP_PKEY_get_raw_private_key := @FC_EVP_PKEY_get_raw_private_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_get_raw_private_key_removed)} + if EVP_PKEY_get_raw_private_key_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_get_raw_private_key)} + EVP_PKEY_get_raw_private_key := @_EVP_PKEY_get_raw_private_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_get_raw_private_key_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_get_raw_private_key'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_PKEY_get_raw_public_key := LoadLibFunction(ADllHandle, EVP_PKEY_get_raw_public_key_procname); + FuncLoadError := not assigned(EVP_PKEY_get_raw_public_key); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_get_raw_public_key_allownil)} + EVP_PKEY_get_raw_public_key := @ERR_EVP_PKEY_get_raw_public_key; + {$ifend} + {$if declared(EVP_PKEY_get_raw_public_key_introduced)} + if LibVersion < EVP_PKEY_get_raw_public_key_introduced then + begin + {$if declared(FC_EVP_PKEY_get_raw_public_key)} + EVP_PKEY_get_raw_public_key := @FC_EVP_PKEY_get_raw_public_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_get_raw_public_key_removed)} + if EVP_PKEY_get_raw_public_key_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_get_raw_public_key)} + EVP_PKEY_get_raw_public_key := @_EVP_PKEY_get_raw_public_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_get_raw_public_key_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_get_raw_public_key'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_PKEY_new_CMAC_key := LoadLibFunction(ADllHandle, EVP_PKEY_new_CMAC_key_procname); + FuncLoadError := not assigned(EVP_PKEY_new_CMAC_key); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_new_CMAC_key_allownil)} + EVP_PKEY_new_CMAC_key := @ERR_EVP_PKEY_new_CMAC_key; + {$ifend} + {$if declared(EVP_PKEY_new_CMAC_key_introduced)} + if LibVersion < EVP_PKEY_new_CMAC_key_introduced then + begin + {$if declared(FC_EVP_PKEY_new_CMAC_key)} + EVP_PKEY_new_CMAC_key := @FC_EVP_PKEY_new_CMAC_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_new_CMAC_key_removed)} + if EVP_PKEY_new_CMAC_key_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_new_CMAC_key)} + EVP_PKEY_new_CMAC_key := @_EVP_PKEY_new_CMAC_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_new_CMAC_key_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_new_CMAC_key'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_PKEY_CTX_set_data := LoadLibFunction(ADllHandle, EVP_PKEY_CTX_set_data_procname); + FuncLoadError := not assigned(EVP_PKEY_CTX_set_data); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_CTX_set_data_allownil)} + EVP_PKEY_CTX_set_data := @ERR_EVP_PKEY_CTX_set_data; + {$ifend} + {$if declared(EVP_PKEY_CTX_set_data_introduced)} + if LibVersion < EVP_PKEY_CTX_set_data_introduced then + begin + {$if declared(FC_EVP_PKEY_CTX_set_data)} + EVP_PKEY_CTX_set_data := @FC_EVP_PKEY_CTX_set_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_CTX_set_data_removed)} + if EVP_PKEY_CTX_set_data_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_CTX_set_data)} + EVP_PKEY_CTX_set_data := @_EVP_PKEY_CTX_set_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_CTX_set_data_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_CTX_set_data'); + {$ifend} + end; + + + EVP_PKEY_CTX_get_data := LoadLibFunction(ADllHandle, EVP_PKEY_CTX_get_data_procname); + FuncLoadError := not assigned(EVP_PKEY_CTX_get_data); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_CTX_get_data_allownil)} + EVP_PKEY_CTX_get_data := @ERR_EVP_PKEY_CTX_get_data; + {$ifend} + {$if declared(EVP_PKEY_CTX_get_data_introduced)} + if LibVersion < EVP_PKEY_CTX_get_data_introduced then + begin + {$if declared(FC_EVP_PKEY_CTX_get_data)} + EVP_PKEY_CTX_get_data := @FC_EVP_PKEY_CTX_get_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_CTX_get_data_removed)} + if EVP_PKEY_CTX_get_data_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_CTX_get_data)} + EVP_PKEY_CTX_get_data := @_EVP_PKEY_CTX_get_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_CTX_get_data_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_CTX_get_data'); + {$ifend} + end; + + + EVP_PKEY_CTX_get0_pkey := LoadLibFunction(ADllHandle, EVP_PKEY_CTX_get0_pkey_procname); + FuncLoadError := not assigned(EVP_PKEY_CTX_get0_pkey); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_CTX_get0_pkey_allownil)} + EVP_PKEY_CTX_get0_pkey := @ERR_EVP_PKEY_CTX_get0_pkey; + {$ifend} + {$if declared(EVP_PKEY_CTX_get0_pkey_introduced)} + if LibVersion < EVP_PKEY_CTX_get0_pkey_introduced then + begin + {$if declared(FC_EVP_PKEY_CTX_get0_pkey)} + EVP_PKEY_CTX_get0_pkey := @FC_EVP_PKEY_CTX_get0_pkey; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_CTX_get0_pkey_removed)} + if EVP_PKEY_CTX_get0_pkey_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_CTX_get0_pkey)} + EVP_PKEY_CTX_get0_pkey := @_EVP_PKEY_CTX_get0_pkey; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_CTX_get0_pkey_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_CTX_get0_pkey'); + {$ifend} + end; + + + EVP_PKEY_CTX_get0_peerkey := LoadLibFunction(ADllHandle, EVP_PKEY_CTX_get0_peerkey_procname); + FuncLoadError := not assigned(EVP_PKEY_CTX_get0_peerkey); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_CTX_get0_peerkey_allownil)} + EVP_PKEY_CTX_get0_peerkey := @ERR_EVP_PKEY_CTX_get0_peerkey; + {$ifend} + {$if declared(EVP_PKEY_CTX_get0_peerkey_introduced)} + if LibVersion < EVP_PKEY_CTX_get0_peerkey_introduced then + begin + {$if declared(FC_EVP_PKEY_CTX_get0_peerkey)} + EVP_PKEY_CTX_get0_peerkey := @FC_EVP_PKEY_CTX_get0_peerkey; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_CTX_get0_peerkey_removed)} + if EVP_PKEY_CTX_get0_peerkey_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_CTX_get0_peerkey)} + EVP_PKEY_CTX_get0_peerkey := @_EVP_PKEY_CTX_get0_peerkey; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_CTX_get0_peerkey_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_CTX_get0_peerkey'); + {$ifend} + end; + + + EVP_PKEY_CTX_set_app_data := LoadLibFunction(ADllHandle, EVP_PKEY_CTX_set_app_data_procname); + FuncLoadError := not assigned(EVP_PKEY_CTX_set_app_data); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_CTX_set_app_data_allownil)} + EVP_PKEY_CTX_set_app_data := @ERR_EVP_PKEY_CTX_set_app_data; + {$ifend} + {$if declared(EVP_PKEY_CTX_set_app_data_introduced)} + if LibVersion < EVP_PKEY_CTX_set_app_data_introduced then + begin + {$if declared(FC_EVP_PKEY_CTX_set_app_data)} + EVP_PKEY_CTX_set_app_data := @FC_EVP_PKEY_CTX_set_app_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_CTX_set_app_data_removed)} + if EVP_PKEY_CTX_set_app_data_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_CTX_set_app_data)} + EVP_PKEY_CTX_set_app_data := @_EVP_PKEY_CTX_set_app_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_CTX_set_app_data_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_CTX_set_app_data'); + {$ifend} + end; + + + EVP_PKEY_CTX_get_app_data := LoadLibFunction(ADllHandle, EVP_PKEY_CTX_get_app_data_procname); + FuncLoadError := not assigned(EVP_PKEY_CTX_get_app_data); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_CTX_get_app_data_allownil)} + EVP_PKEY_CTX_get_app_data := @ERR_EVP_PKEY_CTX_get_app_data; + {$ifend} + {$if declared(EVP_PKEY_CTX_get_app_data_introduced)} + if LibVersion < EVP_PKEY_CTX_get_app_data_introduced then + begin + {$if declared(FC_EVP_PKEY_CTX_get_app_data)} + EVP_PKEY_CTX_get_app_data := @FC_EVP_PKEY_CTX_get_app_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_CTX_get_app_data_removed)} + if EVP_PKEY_CTX_get_app_data_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_CTX_get_app_data)} + EVP_PKEY_CTX_get_app_data := @_EVP_PKEY_CTX_get_app_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_CTX_get_app_data_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_CTX_get_app_data'); + {$ifend} + end; + + + EVP_PKEY_sign_init := LoadLibFunction(ADllHandle, EVP_PKEY_sign_init_procname); + FuncLoadError := not assigned(EVP_PKEY_sign_init); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_sign_init_allownil)} + EVP_PKEY_sign_init := @ERR_EVP_PKEY_sign_init; + {$ifend} + {$if declared(EVP_PKEY_sign_init_introduced)} + if LibVersion < EVP_PKEY_sign_init_introduced then + begin + {$if declared(FC_EVP_PKEY_sign_init)} + EVP_PKEY_sign_init := @FC_EVP_PKEY_sign_init; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_sign_init_removed)} + if EVP_PKEY_sign_init_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_sign_init)} + EVP_PKEY_sign_init := @_EVP_PKEY_sign_init; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_sign_init_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_sign_init'); + {$ifend} + end; + + + EVP_PKEY_sign := LoadLibFunction(ADllHandle, EVP_PKEY_sign_procname); + FuncLoadError := not assigned(EVP_PKEY_sign); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_sign_allownil)} + EVP_PKEY_sign := @ERR_EVP_PKEY_sign; + {$ifend} + {$if declared(EVP_PKEY_sign_introduced)} + if LibVersion < EVP_PKEY_sign_introduced then + begin + {$if declared(FC_EVP_PKEY_sign)} + EVP_PKEY_sign := @FC_EVP_PKEY_sign; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_sign_removed)} + if EVP_PKEY_sign_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_sign)} + EVP_PKEY_sign := @_EVP_PKEY_sign; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_sign_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_sign'); + {$ifend} + end; + + + EVP_PKEY_verify_init := LoadLibFunction(ADllHandle, EVP_PKEY_verify_init_procname); + FuncLoadError := not assigned(EVP_PKEY_verify_init); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_verify_init_allownil)} + EVP_PKEY_verify_init := @ERR_EVP_PKEY_verify_init; + {$ifend} + {$if declared(EVP_PKEY_verify_init_introduced)} + if LibVersion < EVP_PKEY_verify_init_introduced then + begin + {$if declared(FC_EVP_PKEY_verify_init)} + EVP_PKEY_verify_init := @FC_EVP_PKEY_verify_init; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_verify_init_removed)} + if EVP_PKEY_verify_init_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_verify_init)} + EVP_PKEY_verify_init := @_EVP_PKEY_verify_init; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_verify_init_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_verify_init'); + {$ifend} + end; + + + EVP_PKEY_verify := LoadLibFunction(ADllHandle, EVP_PKEY_verify_procname); + FuncLoadError := not assigned(EVP_PKEY_verify); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_verify_allownil)} + EVP_PKEY_verify := @ERR_EVP_PKEY_verify; + {$ifend} + {$if declared(EVP_PKEY_verify_introduced)} + if LibVersion < EVP_PKEY_verify_introduced then + begin + {$if declared(FC_EVP_PKEY_verify)} + EVP_PKEY_verify := @FC_EVP_PKEY_verify; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_verify_removed)} + if EVP_PKEY_verify_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_verify)} + EVP_PKEY_verify := @_EVP_PKEY_verify; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_verify_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_verify'); + {$ifend} + end; + + + EVP_PKEY_verify_recover_init := LoadLibFunction(ADllHandle, EVP_PKEY_verify_recover_init_procname); + FuncLoadError := not assigned(EVP_PKEY_verify_recover_init); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_verify_recover_init_allownil)} + EVP_PKEY_verify_recover_init := @ERR_EVP_PKEY_verify_recover_init; + {$ifend} + {$if declared(EVP_PKEY_verify_recover_init_introduced)} + if LibVersion < EVP_PKEY_verify_recover_init_introduced then + begin + {$if declared(FC_EVP_PKEY_verify_recover_init)} + EVP_PKEY_verify_recover_init := @FC_EVP_PKEY_verify_recover_init; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_verify_recover_init_removed)} + if EVP_PKEY_verify_recover_init_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_verify_recover_init)} + EVP_PKEY_verify_recover_init := @_EVP_PKEY_verify_recover_init; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_verify_recover_init_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_verify_recover_init'); + {$ifend} + end; + + + EVP_PKEY_verify_recover := LoadLibFunction(ADllHandle, EVP_PKEY_verify_recover_procname); + FuncLoadError := not assigned(EVP_PKEY_verify_recover); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_verify_recover_allownil)} + EVP_PKEY_verify_recover := @ERR_EVP_PKEY_verify_recover; + {$ifend} + {$if declared(EVP_PKEY_verify_recover_introduced)} + if LibVersion < EVP_PKEY_verify_recover_introduced then + begin + {$if declared(FC_EVP_PKEY_verify_recover)} + EVP_PKEY_verify_recover := @FC_EVP_PKEY_verify_recover; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_verify_recover_removed)} + if EVP_PKEY_verify_recover_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_verify_recover)} + EVP_PKEY_verify_recover := @_EVP_PKEY_verify_recover; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_verify_recover_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_verify_recover'); + {$ifend} + end; + + + EVP_PKEY_encrypt_init := LoadLibFunction(ADllHandle, EVP_PKEY_encrypt_init_procname); + FuncLoadError := not assigned(EVP_PKEY_encrypt_init); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_encrypt_init_allownil)} + EVP_PKEY_encrypt_init := @ERR_EVP_PKEY_encrypt_init; + {$ifend} + {$if declared(EVP_PKEY_encrypt_init_introduced)} + if LibVersion < EVP_PKEY_encrypt_init_introduced then + begin + {$if declared(FC_EVP_PKEY_encrypt_init)} + EVP_PKEY_encrypt_init := @FC_EVP_PKEY_encrypt_init; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_encrypt_init_removed)} + if EVP_PKEY_encrypt_init_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_encrypt_init)} + EVP_PKEY_encrypt_init := @_EVP_PKEY_encrypt_init; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_encrypt_init_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_encrypt_init'); + {$ifend} + end; + + + EVP_PKEY_encrypt := LoadLibFunction(ADllHandle, EVP_PKEY_encrypt_procname); + FuncLoadError := not assigned(EVP_PKEY_encrypt); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_encrypt_allownil)} + EVP_PKEY_encrypt := @ERR_EVP_PKEY_encrypt; + {$ifend} + {$if declared(EVP_PKEY_encrypt_introduced)} + if LibVersion < EVP_PKEY_encrypt_introduced then + begin + {$if declared(FC_EVP_PKEY_encrypt)} + EVP_PKEY_encrypt := @FC_EVP_PKEY_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_encrypt_removed)} + if EVP_PKEY_encrypt_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_encrypt)} + EVP_PKEY_encrypt := @_EVP_PKEY_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_encrypt_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_encrypt'); + {$ifend} + end; + + + EVP_PKEY_decrypt_init := LoadLibFunction(ADllHandle, EVP_PKEY_decrypt_init_procname); + FuncLoadError := not assigned(EVP_PKEY_decrypt_init); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_decrypt_init_allownil)} + EVP_PKEY_decrypt_init := @ERR_EVP_PKEY_decrypt_init; + {$ifend} + {$if declared(EVP_PKEY_decrypt_init_introduced)} + if LibVersion < EVP_PKEY_decrypt_init_introduced then + begin + {$if declared(FC_EVP_PKEY_decrypt_init)} + EVP_PKEY_decrypt_init := @FC_EVP_PKEY_decrypt_init; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_decrypt_init_removed)} + if EVP_PKEY_decrypt_init_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_decrypt_init)} + EVP_PKEY_decrypt_init := @_EVP_PKEY_decrypt_init; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_decrypt_init_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_decrypt_init'); + {$ifend} + end; + + + EVP_PKEY_decrypt := LoadLibFunction(ADllHandle, EVP_PKEY_decrypt_procname); + FuncLoadError := not assigned(EVP_PKEY_decrypt); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_decrypt_allownil)} + EVP_PKEY_decrypt := @ERR_EVP_PKEY_decrypt; + {$ifend} + {$if declared(EVP_PKEY_decrypt_introduced)} + if LibVersion < EVP_PKEY_decrypt_introduced then + begin + {$if declared(FC_EVP_PKEY_decrypt)} + EVP_PKEY_decrypt := @FC_EVP_PKEY_decrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_decrypt_removed)} + if EVP_PKEY_decrypt_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_decrypt)} + EVP_PKEY_decrypt := @_EVP_PKEY_decrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_decrypt_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_decrypt'); + {$ifend} + end; + + + EVP_PKEY_derive_init := LoadLibFunction(ADllHandle, EVP_PKEY_derive_init_procname); + FuncLoadError := not assigned(EVP_PKEY_derive_init); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_derive_init_allownil)} + EVP_PKEY_derive_init := @ERR_EVP_PKEY_derive_init; + {$ifend} + {$if declared(EVP_PKEY_derive_init_introduced)} + if LibVersion < EVP_PKEY_derive_init_introduced then + begin + {$if declared(FC_EVP_PKEY_derive_init)} + EVP_PKEY_derive_init := @FC_EVP_PKEY_derive_init; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_derive_init_removed)} + if EVP_PKEY_derive_init_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_derive_init)} + EVP_PKEY_derive_init := @_EVP_PKEY_derive_init; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_derive_init_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_derive_init'); + {$ifend} + end; + + + EVP_PKEY_derive_set_peer := LoadLibFunction(ADllHandle, EVP_PKEY_derive_set_peer_procname); + FuncLoadError := not assigned(EVP_PKEY_derive_set_peer); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_derive_set_peer_allownil)} + EVP_PKEY_derive_set_peer := @ERR_EVP_PKEY_derive_set_peer; + {$ifend} + {$if declared(EVP_PKEY_derive_set_peer_introduced)} + if LibVersion < EVP_PKEY_derive_set_peer_introduced then + begin + {$if declared(FC_EVP_PKEY_derive_set_peer)} + EVP_PKEY_derive_set_peer := @FC_EVP_PKEY_derive_set_peer; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_derive_set_peer_removed)} + if EVP_PKEY_derive_set_peer_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_derive_set_peer)} + EVP_PKEY_derive_set_peer := @_EVP_PKEY_derive_set_peer; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_derive_set_peer_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_derive_set_peer'); + {$ifend} + end; + + + EVP_PKEY_derive := LoadLibFunction(ADllHandle, EVP_PKEY_derive_procname); + FuncLoadError := not assigned(EVP_PKEY_derive); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_derive_allownil)} + EVP_PKEY_derive := @ERR_EVP_PKEY_derive; + {$ifend} + {$if declared(EVP_PKEY_derive_introduced)} + if LibVersion < EVP_PKEY_derive_introduced then + begin + {$if declared(FC_EVP_PKEY_derive)} + EVP_PKEY_derive := @FC_EVP_PKEY_derive; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_derive_removed)} + if EVP_PKEY_derive_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_derive)} + EVP_PKEY_derive := @_EVP_PKEY_derive; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_derive_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_derive'); + {$ifend} + end; + + + EVP_PKEY_paramgen_init := LoadLibFunction(ADllHandle, EVP_PKEY_paramgen_init_procname); + FuncLoadError := not assigned(EVP_PKEY_paramgen_init); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_paramgen_init_allownil)} + EVP_PKEY_paramgen_init := @ERR_EVP_PKEY_paramgen_init; + {$ifend} + {$if declared(EVP_PKEY_paramgen_init_introduced)} + if LibVersion < EVP_PKEY_paramgen_init_introduced then + begin + {$if declared(FC_EVP_PKEY_paramgen_init)} + EVP_PKEY_paramgen_init := @FC_EVP_PKEY_paramgen_init; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_paramgen_init_removed)} + if EVP_PKEY_paramgen_init_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_paramgen_init)} + EVP_PKEY_paramgen_init := @_EVP_PKEY_paramgen_init; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_paramgen_init_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_paramgen_init'); + {$ifend} + end; + + + EVP_PKEY_paramgen := LoadLibFunction(ADllHandle, EVP_PKEY_paramgen_procname); + FuncLoadError := not assigned(EVP_PKEY_paramgen); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_paramgen_allownil)} + EVP_PKEY_paramgen := @ERR_EVP_PKEY_paramgen; + {$ifend} + {$if declared(EVP_PKEY_paramgen_introduced)} + if LibVersion < EVP_PKEY_paramgen_introduced then + begin + {$if declared(FC_EVP_PKEY_paramgen)} + EVP_PKEY_paramgen := @FC_EVP_PKEY_paramgen; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_paramgen_removed)} + if EVP_PKEY_paramgen_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_paramgen)} + EVP_PKEY_paramgen := @_EVP_PKEY_paramgen; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_paramgen_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_paramgen'); + {$ifend} + end; + + + EVP_PKEY_keygen_init := LoadLibFunction(ADllHandle, EVP_PKEY_keygen_init_procname); + FuncLoadError := not assigned(EVP_PKEY_keygen_init); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_keygen_init_allownil)} + EVP_PKEY_keygen_init := @ERR_EVP_PKEY_keygen_init; + {$ifend} + {$if declared(EVP_PKEY_keygen_init_introduced)} + if LibVersion < EVP_PKEY_keygen_init_introduced then + begin + {$if declared(FC_EVP_PKEY_keygen_init)} + EVP_PKEY_keygen_init := @FC_EVP_PKEY_keygen_init; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_keygen_init_removed)} + if EVP_PKEY_keygen_init_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_keygen_init)} + EVP_PKEY_keygen_init := @_EVP_PKEY_keygen_init; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_keygen_init_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_keygen_init'); + {$ifend} + end; + + + EVP_PKEY_keygen := LoadLibFunction(ADllHandle, EVP_PKEY_keygen_procname); + FuncLoadError := not assigned(EVP_PKEY_keygen); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_keygen_allownil)} + EVP_PKEY_keygen := @ERR_EVP_PKEY_keygen; + {$ifend} + {$if declared(EVP_PKEY_keygen_introduced)} + if LibVersion < EVP_PKEY_keygen_introduced then + begin + {$if declared(FC_EVP_PKEY_keygen)} + EVP_PKEY_keygen := @FC_EVP_PKEY_keygen; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_keygen_removed)} + if EVP_PKEY_keygen_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_keygen)} + EVP_PKEY_keygen := @_EVP_PKEY_keygen; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_keygen_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_keygen'); + {$ifend} + end; + + + EVP_PKEY_check := LoadLibFunction(ADllHandle, EVP_PKEY_check_procname); + FuncLoadError := not assigned(EVP_PKEY_check); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_check_allownil)} + EVP_PKEY_check := @ERR_EVP_PKEY_check; + {$ifend} + {$if declared(EVP_PKEY_check_introduced)} + if LibVersion < EVP_PKEY_check_introduced then + begin + {$if declared(FC_EVP_PKEY_check)} + EVP_PKEY_check := @FC_EVP_PKEY_check; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_check_removed)} + if EVP_PKEY_check_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_check)} + EVP_PKEY_check := @_EVP_PKEY_check; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_check_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_check'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_PKEY_public_check := LoadLibFunction(ADllHandle, EVP_PKEY_public_check_procname); + FuncLoadError := not assigned(EVP_PKEY_public_check); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_public_check_allownil)} + EVP_PKEY_public_check := @ERR_EVP_PKEY_public_check; + {$ifend} + {$if declared(EVP_PKEY_public_check_introduced)} + if LibVersion < EVP_PKEY_public_check_introduced then + begin + {$if declared(FC_EVP_PKEY_public_check)} + EVP_PKEY_public_check := @FC_EVP_PKEY_public_check; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_public_check_removed)} + if EVP_PKEY_public_check_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_public_check)} + EVP_PKEY_public_check := @_EVP_PKEY_public_check; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_public_check_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_public_check'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_PKEY_param_check := LoadLibFunction(ADllHandle, EVP_PKEY_param_check_procname); + FuncLoadError := not assigned(EVP_PKEY_param_check); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_param_check_allownil)} + EVP_PKEY_param_check := @ERR_EVP_PKEY_param_check; + {$ifend} + {$if declared(EVP_PKEY_param_check_introduced)} + if LibVersion < EVP_PKEY_param_check_introduced then + begin + {$if declared(FC_EVP_PKEY_param_check)} + EVP_PKEY_param_check := @FC_EVP_PKEY_param_check; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_param_check_removed)} + if EVP_PKEY_param_check_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_param_check)} + EVP_PKEY_param_check := @_EVP_PKEY_param_check; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_param_check_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_param_check'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_PKEY_CTX_set_cb := LoadLibFunction(ADllHandle, EVP_PKEY_CTX_set_cb_procname); + FuncLoadError := not assigned(EVP_PKEY_CTX_set_cb); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_CTX_set_cb_allownil)} + EVP_PKEY_CTX_set_cb := @ERR_EVP_PKEY_CTX_set_cb; + {$ifend} + {$if declared(EVP_PKEY_CTX_set_cb_introduced)} + if LibVersion < EVP_PKEY_CTX_set_cb_introduced then + begin + {$if declared(FC_EVP_PKEY_CTX_set_cb)} + EVP_PKEY_CTX_set_cb := @FC_EVP_PKEY_CTX_set_cb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_CTX_set_cb_removed)} + if EVP_PKEY_CTX_set_cb_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_CTX_set_cb)} + EVP_PKEY_CTX_set_cb := @_EVP_PKEY_CTX_set_cb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_CTX_set_cb_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_CTX_set_cb'); + {$ifend} + end; + + + EVP_PKEY_CTX_get_cb := LoadLibFunction(ADllHandle, EVP_PKEY_CTX_get_cb_procname); + FuncLoadError := not assigned(EVP_PKEY_CTX_get_cb); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_CTX_get_cb_allownil)} + EVP_PKEY_CTX_get_cb := @ERR_EVP_PKEY_CTX_get_cb; + {$ifend} + {$if declared(EVP_PKEY_CTX_get_cb_introduced)} + if LibVersion < EVP_PKEY_CTX_get_cb_introduced then + begin + {$if declared(FC_EVP_PKEY_CTX_get_cb)} + EVP_PKEY_CTX_get_cb := @FC_EVP_PKEY_CTX_get_cb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_CTX_get_cb_removed)} + if EVP_PKEY_CTX_get_cb_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_CTX_get_cb)} + EVP_PKEY_CTX_get_cb := @_EVP_PKEY_CTX_get_cb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_CTX_get_cb_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_CTX_get_cb'); + {$ifend} + end; + + + EVP_PKEY_CTX_get_keygen_info := LoadLibFunction(ADllHandle, EVP_PKEY_CTX_get_keygen_info_procname); + FuncLoadError := not assigned(EVP_PKEY_CTX_get_keygen_info); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_CTX_get_keygen_info_allownil)} + EVP_PKEY_CTX_get_keygen_info := @ERR_EVP_PKEY_CTX_get_keygen_info; + {$ifend} + {$if declared(EVP_PKEY_CTX_get_keygen_info_introduced)} + if LibVersion < EVP_PKEY_CTX_get_keygen_info_introduced then + begin + {$if declared(FC_EVP_PKEY_CTX_get_keygen_info)} + EVP_PKEY_CTX_get_keygen_info := @FC_EVP_PKEY_CTX_get_keygen_info; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_CTX_get_keygen_info_removed)} + if EVP_PKEY_CTX_get_keygen_info_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_CTX_get_keygen_info)} + EVP_PKEY_CTX_get_keygen_info := @_EVP_PKEY_CTX_get_keygen_info; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_CTX_get_keygen_info_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_CTX_get_keygen_info'); + {$ifend} + end; + + + EVP_PKEY_meth_set_init := LoadLibFunction(ADllHandle, EVP_PKEY_meth_set_init_procname); + FuncLoadError := not assigned(EVP_PKEY_meth_set_init); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_meth_set_init_allownil)} + EVP_PKEY_meth_set_init := @ERR_EVP_PKEY_meth_set_init; + {$ifend} + {$if declared(EVP_PKEY_meth_set_init_introduced)} + if LibVersion < EVP_PKEY_meth_set_init_introduced then + begin + {$if declared(FC_EVP_PKEY_meth_set_init)} + EVP_PKEY_meth_set_init := @FC_EVP_PKEY_meth_set_init; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_meth_set_init_removed)} + if EVP_PKEY_meth_set_init_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_meth_set_init)} + EVP_PKEY_meth_set_init := @_EVP_PKEY_meth_set_init; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_meth_set_init_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_meth_set_init'); + {$ifend} + end; + + + EVP_PKEY_meth_set_copy := LoadLibFunction(ADllHandle, EVP_PKEY_meth_set_copy_procname); + FuncLoadError := not assigned(EVP_PKEY_meth_set_copy); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_meth_set_copy_allownil)} + EVP_PKEY_meth_set_copy := @ERR_EVP_PKEY_meth_set_copy; + {$ifend} + {$if declared(EVP_PKEY_meth_set_copy_introduced)} + if LibVersion < EVP_PKEY_meth_set_copy_introduced then + begin + {$if declared(FC_EVP_PKEY_meth_set_copy)} + EVP_PKEY_meth_set_copy := @FC_EVP_PKEY_meth_set_copy; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_meth_set_copy_removed)} + if EVP_PKEY_meth_set_copy_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_meth_set_copy)} + EVP_PKEY_meth_set_copy := @_EVP_PKEY_meth_set_copy; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_meth_set_copy_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_meth_set_copy'); + {$ifend} + end; + + + EVP_PKEY_meth_set_cleanup := LoadLibFunction(ADllHandle, EVP_PKEY_meth_set_cleanup_procname); + FuncLoadError := not assigned(EVP_PKEY_meth_set_cleanup); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_meth_set_cleanup_allownil)} + EVP_PKEY_meth_set_cleanup := @ERR_EVP_PKEY_meth_set_cleanup; + {$ifend} + {$if declared(EVP_PKEY_meth_set_cleanup_introduced)} + if LibVersion < EVP_PKEY_meth_set_cleanup_introduced then + begin + {$if declared(FC_EVP_PKEY_meth_set_cleanup)} + EVP_PKEY_meth_set_cleanup := @FC_EVP_PKEY_meth_set_cleanup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_meth_set_cleanup_removed)} + if EVP_PKEY_meth_set_cleanup_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_meth_set_cleanup)} + EVP_PKEY_meth_set_cleanup := @_EVP_PKEY_meth_set_cleanup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_meth_set_cleanup_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_meth_set_cleanup'); + {$ifend} + end; + + + EVP_PKEY_meth_set_paramgen := LoadLibFunction(ADllHandle, EVP_PKEY_meth_set_paramgen_procname); + FuncLoadError := not assigned(EVP_PKEY_meth_set_paramgen); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_meth_set_paramgen_allownil)} + EVP_PKEY_meth_set_paramgen := @ERR_EVP_PKEY_meth_set_paramgen; + {$ifend} + {$if declared(EVP_PKEY_meth_set_paramgen_introduced)} + if LibVersion < EVP_PKEY_meth_set_paramgen_introduced then + begin + {$if declared(FC_EVP_PKEY_meth_set_paramgen)} + EVP_PKEY_meth_set_paramgen := @FC_EVP_PKEY_meth_set_paramgen; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_meth_set_paramgen_removed)} + if EVP_PKEY_meth_set_paramgen_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_meth_set_paramgen)} + EVP_PKEY_meth_set_paramgen := @_EVP_PKEY_meth_set_paramgen; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_meth_set_paramgen_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_meth_set_paramgen'); + {$ifend} + end; + + + EVP_PKEY_meth_set_keygen := LoadLibFunction(ADllHandle, EVP_PKEY_meth_set_keygen_procname); + FuncLoadError := not assigned(EVP_PKEY_meth_set_keygen); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_meth_set_keygen_allownil)} + EVP_PKEY_meth_set_keygen := @ERR_EVP_PKEY_meth_set_keygen; + {$ifend} + {$if declared(EVP_PKEY_meth_set_keygen_introduced)} + if LibVersion < EVP_PKEY_meth_set_keygen_introduced then + begin + {$if declared(FC_EVP_PKEY_meth_set_keygen)} + EVP_PKEY_meth_set_keygen := @FC_EVP_PKEY_meth_set_keygen; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_meth_set_keygen_removed)} + if EVP_PKEY_meth_set_keygen_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_meth_set_keygen)} + EVP_PKEY_meth_set_keygen := @_EVP_PKEY_meth_set_keygen; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_meth_set_keygen_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_meth_set_keygen'); + {$ifend} + end; + + + EVP_PKEY_meth_set_sign := LoadLibFunction(ADllHandle, EVP_PKEY_meth_set_sign_procname); + FuncLoadError := not assigned(EVP_PKEY_meth_set_sign); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_meth_set_sign_allownil)} + EVP_PKEY_meth_set_sign := @ERR_EVP_PKEY_meth_set_sign; + {$ifend} + {$if declared(EVP_PKEY_meth_set_sign_introduced)} + if LibVersion < EVP_PKEY_meth_set_sign_introduced then + begin + {$if declared(FC_EVP_PKEY_meth_set_sign)} + EVP_PKEY_meth_set_sign := @FC_EVP_PKEY_meth_set_sign; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_meth_set_sign_removed)} + if EVP_PKEY_meth_set_sign_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_meth_set_sign)} + EVP_PKEY_meth_set_sign := @_EVP_PKEY_meth_set_sign; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_meth_set_sign_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_meth_set_sign'); + {$ifend} + end; + + + EVP_PKEY_meth_set_verify := LoadLibFunction(ADllHandle, EVP_PKEY_meth_set_verify_procname); + FuncLoadError := not assigned(EVP_PKEY_meth_set_verify); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_meth_set_verify_allownil)} + EVP_PKEY_meth_set_verify := @ERR_EVP_PKEY_meth_set_verify; + {$ifend} + {$if declared(EVP_PKEY_meth_set_verify_introduced)} + if LibVersion < EVP_PKEY_meth_set_verify_introduced then + begin + {$if declared(FC_EVP_PKEY_meth_set_verify)} + EVP_PKEY_meth_set_verify := @FC_EVP_PKEY_meth_set_verify; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_meth_set_verify_removed)} + if EVP_PKEY_meth_set_verify_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_meth_set_verify)} + EVP_PKEY_meth_set_verify := @_EVP_PKEY_meth_set_verify; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_meth_set_verify_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_meth_set_verify'); + {$ifend} + end; + + + EVP_PKEY_meth_set_verify_recover := LoadLibFunction(ADllHandle, EVP_PKEY_meth_set_verify_recover_procname); + FuncLoadError := not assigned(EVP_PKEY_meth_set_verify_recover); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_meth_set_verify_recover_allownil)} + EVP_PKEY_meth_set_verify_recover := @ERR_EVP_PKEY_meth_set_verify_recover; + {$ifend} + {$if declared(EVP_PKEY_meth_set_verify_recover_introduced)} + if LibVersion < EVP_PKEY_meth_set_verify_recover_introduced then + begin + {$if declared(FC_EVP_PKEY_meth_set_verify_recover)} + EVP_PKEY_meth_set_verify_recover := @FC_EVP_PKEY_meth_set_verify_recover; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_meth_set_verify_recover_removed)} + if EVP_PKEY_meth_set_verify_recover_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_meth_set_verify_recover)} + EVP_PKEY_meth_set_verify_recover := @_EVP_PKEY_meth_set_verify_recover; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_meth_set_verify_recover_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_meth_set_verify_recover'); + {$ifend} + end; + + + EVP_PKEY_meth_set_signctx := LoadLibFunction(ADllHandle, EVP_PKEY_meth_set_signctx_procname); + FuncLoadError := not assigned(EVP_PKEY_meth_set_signctx); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_meth_set_signctx_allownil)} + EVP_PKEY_meth_set_signctx := @ERR_EVP_PKEY_meth_set_signctx; + {$ifend} + {$if declared(EVP_PKEY_meth_set_signctx_introduced)} + if LibVersion < EVP_PKEY_meth_set_signctx_introduced then + begin + {$if declared(FC_EVP_PKEY_meth_set_signctx)} + EVP_PKEY_meth_set_signctx := @FC_EVP_PKEY_meth_set_signctx; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_meth_set_signctx_removed)} + if EVP_PKEY_meth_set_signctx_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_meth_set_signctx)} + EVP_PKEY_meth_set_signctx := @_EVP_PKEY_meth_set_signctx; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_meth_set_signctx_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_meth_set_signctx'); + {$ifend} + end; + + + EVP_PKEY_meth_set_verifyctx := LoadLibFunction(ADllHandle, EVP_PKEY_meth_set_verifyctx_procname); + FuncLoadError := not assigned(EVP_PKEY_meth_set_verifyctx); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_meth_set_verifyctx_allownil)} + EVP_PKEY_meth_set_verifyctx := @ERR_EVP_PKEY_meth_set_verifyctx; + {$ifend} + {$if declared(EVP_PKEY_meth_set_verifyctx_introduced)} + if LibVersion < EVP_PKEY_meth_set_verifyctx_introduced then + begin + {$if declared(FC_EVP_PKEY_meth_set_verifyctx)} + EVP_PKEY_meth_set_verifyctx := @FC_EVP_PKEY_meth_set_verifyctx; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_meth_set_verifyctx_removed)} + if EVP_PKEY_meth_set_verifyctx_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_meth_set_verifyctx)} + EVP_PKEY_meth_set_verifyctx := @_EVP_PKEY_meth_set_verifyctx; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_meth_set_verifyctx_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_meth_set_verifyctx'); + {$ifend} + end; + + + EVP_PKEY_meth_set_encrypt := LoadLibFunction(ADllHandle, EVP_PKEY_meth_set_encrypt_procname); + FuncLoadError := not assigned(EVP_PKEY_meth_set_encrypt); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_meth_set_encrypt_allownil)} + EVP_PKEY_meth_set_encrypt := @ERR_EVP_PKEY_meth_set_encrypt; + {$ifend} + {$if declared(EVP_PKEY_meth_set_encrypt_introduced)} + if LibVersion < EVP_PKEY_meth_set_encrypt_introduced then + begin + {$if declared(FC_EVP_PKEY_meth_set_encrypt)} + EVP_PKEY_meth_set_encrypt := @FC_EVP_PKEY_meth_set_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_meth_set_encrypt_removed)} + if EVP_PKEY_meth_set_encrypt_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_meth_set_encrypt)} + EVP_PKEY_meth_set_encrypt := @_EVP_PKEY_meth_set_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_meth_set_encrypt_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_meth_set_encrypt'); + {$ifend} + end; + + + EVP_PKEY_meth_set_decrypt := LoadLibFunction(ADllHandle, EVP_PKEY_meth_set_decrypt_procname); + FuncLoadError := not assigned(EVP_PKEY_meth_set_decrypt); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_meth_set_decrypt_allownil)} + EVP_PKEY_meth_set_decrypt := @ERR_EVP_PKEY_meth_set_decrypt; + {$ifend} + {$if declared(EVP_PKEY_meth_set_decrypt_introduced)} + if LibVersion < EVP_PKEY_meth_set_decrypt_introduced then + begin + {$if declared(FC_EVP_PKEY_meth_set_decrypt)} + EVP_PKEY_meth_set_decrypt := @FC_EVP_PKEY_meth_set_decrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_meth_set_decrypt_removed)} + if EVP_PKEY_meth_set_decrypt_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_meth_set_decrypt)} + EVP_PKEY_meth_set_decrypt := @_EVP_PKEY_meth_set_decrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_meth_set_decrypt_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_meth_set_decrypt'); + {$ifend} + end; + + + EVP_PKEY_meth_set_derive := LoadLibFunction(ADllHandle, EVP_PKEY_meth_set_derive_procname); + FuncLoadError := not assigned(EVP_PKEY_meth_set_derive); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_meth_set_derive_allownil)} + EVP_PKEY_meth_set_derive := @ERR_EVP_PKEY_meth_set_derive; + {$ifend} + {$if declared(EVP_PKEY_meth_set_derive_introduced)} + if LibVersion < EVP_PKEY_meth_set_derive_introduced then + begin + {$if declared(FC_EVP_PKEY_meth_set_derive)} + EVP_PKEY_meth_set_derive := @FC_EVP_PKEY_meth_set_derive; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_meth_set_derive_removed)} + if EVP_PKEY_meth_set_derive_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_meth_set_derive)} + EVP_PKEY_meth_set_derive := @_EVP_PKEY_meth_set_derive; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_meth_set_derive_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_meth_set_derive'); + {$ifend} + end; + + + EVP_PKEY_meth_set_ctrl := LoadLibFunction(ADllHandle, EVP_PKEY_meth_set_ctrl_procname); + FuncLoadError := not assigned(EVP_PKEY_meth_set_ctrl); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_meth_set_ctrl_allownil)} + EVP_PKEY_meth_set_ctrl := @ERR_EVP_PKEY_meth_set_ctrl; + {$ifend} + {$if declared(EVP_PKEY_meth_set_ctrl_introduced)} + if LibVersion < EVP_PKEY_meth_set_ctrl_introduced then + begin + {$if declared(FC_EVP_PKEY_meth_set_ctrl)} + EVP_PKEY_meth_set_ctrl := @FC_EVP_PKEY_meth_set_ctrl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_meth_set_ctrl_removed)} + if EVP_PKEY_meth_set_ctrl_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_meth_set_ctrl)} + EVP_PKEY_meth_set_ctrl := @_EVP_PKEY_meth_set_ctrl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_meth_set_ctrl_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_meth_set_ctrl'); + {$ifend} + end; + + + EVP_PKEY_meth_set_digestsign := LoadLibFunction(ADllHandle, EVP_PKEY_meth_set_digestsign_procname); + FuncLoadError := not assigned(EVP_PKEY_meth_set_digestsign); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_meth_set_digestsign_allownil)} + EVP_PKEY_meth_set_digestsign := @ERR_EVP_PKEY_meth_set_digestsign; + {$ifend} + {$if declared(EVP_PKEY_meth_set_digestsign_introduced)} + if LibVersion < EVP_PKEY_meth_set_digestsign_introduced then + begin + {$if declared(FC_EVP_PKEY_meth_set_digestsign)} + EVP_PKEY_meth_set_digestsign := @FC_EVP_PKEY_meth_set_digestsign; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_meth_set_digestsign_removed)} + if EVP_PKEY_meth_set_digestsign_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_meth_set_digestsign)} + EVP_PKEY_meth_set_digestsign := @_EVP_PKEY_meth_set_digestsign; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_meth_set_digestsign_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_meth_set_digestsign'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_PKEY_meth_set_digestverify := LoadLibFunction(ADllHandle, EVP_PKEY_meth_set_digestverify_procname); + FuncLoadError := not assigned(EVP_PKEY_meth_set_digestverify); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_meth_set_digestverify_allownil)} + EVP_PKEY_meth_set_digestverify := @ERR_EVP_PKEY_meth_set_digestverify; + {$ifend} + {$if declared(EVP_PKEY_meth_set_digestverify_introduced)} + if LibVersion < EVP_PKEY_meth_set_digestverify_introduced then + begin + {$if declared(FC_EVP_PKEY_meth_set_digestverify)} + EVP_PKEY_meth_set_digestverify := @FC_EVP_PKEY_meth_set_digestverify; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_meth_set_digestverify_removed)} + if EVP_PKEY_meth_set_digestverify_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_meth_set_digestverify)} + EVP_PKEY_meth_set_digestverify := @_EVP_PKEY_meth_set_digestverify; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_meth_set_digestverify_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_meth_set_digestverify'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_PKEY_meth_set_check := LoadLibFunction(ADllHandle, EVP_PKEY_meth_set_check_procname); + FuncLoadError := not assigned(EVP_PKEY_meth_set_check); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_meth_set_check_allownil)} + EVP_PKEY_meth_set_check := @ERR_EVP_PKEY_meth_set_check; + {$ifend} + {$if declared(EVP_PKEY_meth_set_check_introduced)} + if LibVersion < EVP_PKEY_meth_set_check_introduced then + begin + {$if declared(FC_EVP_PKEY_meth_set_check)} + EVP_PKEY_meth_set_check := @FC_EVP_PKEY_meth_set_check; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_meth_set_check_removed)} + if EVP_PKEY_meth_set_check_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_meth_set_check)} + EVP_PKEY_meth_set_check := @_EVP_PKEY_meth_set_check; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_meth_set_check_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_meth_set_check'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_PKEY_meth_set_public_check := LoadLibFunction(ADllHandle, EVP_PKEY_meth_set_public_check_procname); + FuncLoadError := not assigned(EVP_PKEY_meth_set_public_check); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_meth_set_public_check_allownil)} + EVP_PKEY_meth_set_public_check := @ERR_EVP_PKEY_meth_set_public_check; + {$ifend} + {$if declared(EVP_PKEY_meth_set_public_check_introduced)} + if LibVersion < EVP_PKEY_meth_set_public_check_introduced then + begin + {$if declared(FC_EVP_PKEY_meth_set_public_check)} + EVP_PKEY_meth_set_public_check := @FC_EVP_PKEY_meth_set_public_check; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_meth_set_public_check_removed)} + if EVP_PKEY_meth_set_public_check_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_meth_set_public_check)} + EVP_PKEY_meth_set_public_check := @_EVP_PKEY_meth_set_public_check; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_meth_set_public_check_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_meth_set_public_check'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_PKEY_meth_set_param_check := LoadLibFunction(ADllHandle, EVP_PKEY_meth_set_param_check_procname); + FuncLoadError := not assigned(EVP_PKEY_meth_set_param_check); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_meth_set_param_check_allownil)} + EVP_PKEY_meth_set_param_check := @ERR_EVP_PKEY_meth_set_param_check; + {$ifend} + {$if declared(EVP_PKEY_meth_set_param_check_introduced)} + if LibVersion < EVP_PKEY_meth_set_param_check_introduced then + begin + {$if declared(FC_EVP_PKEY_meth_set_param_check)} + EVP_PKEY_meth_set_param_check := @FC_EVP_PKEY_meth_set_param_check; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_meth_set_param_check_removed)} + if EVP_PKEY_meth_set_param_check_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_meth_set_param_check)} + EVP_PKEY_meth_set_param_check := @_EVP_PKEY_meth_set_param_check; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_meth_set_param_check_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_meth_set_param_check'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_PKEY_meth_set_digest_custom := LoadLibFunction(ADllHandle, EVP_PKEY_meth_set_digest_custom_procname); + FuncLoadError := not assigned(EVP_PKEY_meth_set_digest_custom); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_meth_set_digest_custom_allownil)} + EVP_PKEY_meth_set_digest_custom := @ERR_EVP_PKEY_meth_set_digest_custom; + {$ifend} + {$if declared(EVP_PKEY_meth_set_digest_custom_introduced)} + if LibVersion < EVP_PKEY_meth_set_digest_custom_introduced then + begin + {$if declared(FC_EVP_PKEY_meth_set_digest_custom)} + EVP_PKEY_meth_set_digest_custom := @FC_EVP_PKEY_meth_set_digest_custom; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_meth_set_digest_custom_removed)} + if EVP_PKEY_meth_set_digest_custom_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_meth_set_digest_custom)} + EVP_PKEY_meth_set_digest_custom := @_EVP_PKEY_meth_set_digest_custom; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_meth_set_digest_custom_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_meth_set_digest_custom'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_PKEY_meth_get_init := LoadLibFunction(ADllHandle, EVP_PKEY_meth_get_init_procname); + FuncLoadError := not assigned(EVP_PKEY_meth_get_init); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_meth_get_init_allownil)} + EVP_PKEY_meth_get_init := @ERR_EVP_PKEY_meth_get_init; + {$ifend} + {$if declared(EVP_PKEY_meth_get_init_introduced)} + if LibVersion < EVP_PKEY_meth_get_init_introduced then + begin + {$if declared(FC_EVP_PKEY_meth_get_init)} + EVP_PKEY_meth_get_init := @FC_EVP_PKEY_meth_get_init; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_meth_get_init_removed)} + if EVP_PKEY_meth_get_init_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_meth_get_init)} + EVP_PKEY_meth_get_init := @_EVP_PKEY_meth_get_init; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_meth_get_init_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_meth_get_init'); + {$ifend} + end; + + + EVP_PKEY_meth_get_copy := LoadLibFunction(ADllHandle, EVP_PKEY_meth_get_copy_procname); + FuncLoadError := not assigned(EVP_PKEY_meth_get_copy); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_meth_get_copy_allownil)} + EVP_PKEY_meth_get_copy := @ERR_EVP_PKEY_meth_get_copy; + {$ifend} + {$if declared(EVP_PKEY_meth_get_copy_introduced)} + if LibVersion < EVP_PKEY_meth_get_copy_introduced then + begin + {$if declared(FC_EVP_PKEY_meth_get_copy)} + EVP_PKEY_meth_get_copy := @FC_EVP_PKEY_meth_get_copy; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_meth_get_copy_removed)} + if EVP_PKEY_meth_get_copy_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_meth_get_copy)} + EVP_PKEY_meth_get_copy := @_EVP_PKEY_meth_get_copy; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_meth_get_copy_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_meth_get_copy'); + {$ifend} + end; + + + EVP_PKEY_meth_get_cleanup := LoadLibFunction(ADllHandle, EVP_PKEY_meth_get_cleanup_procname); + FuncLoadError := not assigned(EVP_PKEY_meth_get_cleanup); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_meth_get_cleanup_allownil)} + EVP_PKEY_meth_get_cleanup := @ERR_EVP_PKEY_meth_get_cleanup; + {$ifend} + {$if declared(EVP_PKEY_meth_get_cleanup_introduced)} + if LibVersion < EVP_PKEY_meth_get_cleanup_introduced then + begin + {$if declared(FC_EVP_PKEY_meth_get_cleanup)} + EVP_PKEY_meth_get_cleanup := @FC_EVP_PKEY_meth_get_cleanup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_meth_get_cleanup_removed)} + if EVP_PKEY_meth_get_cleanup_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_meth_get_cleanup)} + EVP_PKEY_meth_get_cleanup := @_EVP_PKEY_meth_get_cleanup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_meth_get_cleanup_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_meth_get_cleanup'); + {$ifend} + end; + + + EVP_PKEY_meth_get_paramgen := LoadLibFunction(ADllHandle, EVP_PKEY_meth_get_paramgen_procname); + FuncLoadError := not assigned(EVP_PKEY_meth_get_paramgen); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_meth_get_paramgen_allownil)} + EVP_PKEY_meth_get_paramgen := @ERR_EVP_PKEY_meth_get_paramgen; + {$ifend} + {$if declared(EVP_PKEY_meth_get_paramgen_introduced)} + if LibVersion < EVP_PKEY_meth_get_paramgen_introduced then + begin + {$if declared(FC_EVP_PKEY_meth_get_paramgen)} + EVP_PKEY_meth_get_paramgen := @FC_EVP_PKEY_meth_get_paramgen; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_meth_get_paramgen_removed)} + if EVP_PKEY_meth_get_paramgen_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_meth_get_paramgen)} + EVP_PKEY_meth_get_paramgen := @_EVP_PKEY_meth_get_paramgen; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_meth_get_paramgen_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_meth_get_paramgen'); + {$ifend} + end; + + + EVP_PKEY_meth_get_keygen := LoadLibFunction(ADllHandle, EVP_PKEY_meth_get_keygen_procname); + FuncLoadError := not assigned(EVP_PKEY_meth_get_keygen); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_meth_get_keygen_allownil)} + EVP_PKEY_meth_get_keygen := @ERR_EVP_PKEY_meth_get_keygen; + {$ifend} + {$if declared(EVP_PKEY_meth_get_keygen_introduced)} + if LibVersion < EVP_PKEY_meth_get_keygen_introduced then + begin + {$if declared(FC_EVP_PKEY_meth_get_keygen)} + EVP_PKEY_meth_get_keygen := @FC_EVP_PKEY_meth_get_keygen; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_meth_get_keygen_removed)} + if EVP_PKEY_meth_get_keygen_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_meth_get_keygen)} + EVP_PKEY_meth_get_keygen := @_EVP_PKEY_meth_get_keygen; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_meth_get_keygen_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_meth_get_keygen'); + {$ifend} + end; + + + EVP_PKEY_meth_get_sign := LoadLibFunction(ADllHandle, EVP_PKEY_meth_get_sign_procname); + FuncLoadError := not assigned(EVP_PKEY_meth_get_sign); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_meth_get_sign_allownil)} + EVP_PKEY_meth_get_sign := @ERR_EVP_PKEY_meth_get_sign; + {$ifend} + {$if declared(EVP_PKEY_meth_get_sign_introduced)} + if LibVersion < EVP_PKEY_meth_get_sign_introduced then + begin + {$if declared(FC_EVP_PKEY_meth_get_sign)} + EVP_PKEY_meth_get_sign := @FC_EVP_PKEY_meth_get_sign; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_meth_get_sign_removed)} + if EVP_PKEY_meth_get_sign_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_meth_get_sign)} + EVP_PKEY_meth_get_sign := @_EVP_PKEY_meth_get_sign; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_meth_get_sign_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_meth_get_sign'); + {$ifend} + end; + + + EVP_PKEY_meth_get_verify := LoadLibFunction(ADllHandle, EVP_PKEY_meth_get_verify_procname); + FuncLoadError := not assigned(EVP_PKEY_meth_get_verify); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_meth_get_verify_allownil)} + EVP_PKEY_meth_get_verify := @ERR_EVP_PKEY_meth_get_verify; + {$ifend} + {$if declared(EVP_PKEY_meth_get_verify_introduced)} + if LibVersion < EVP_PKEY_meth_get_verify_introduced then + begin + {$if declared(FC_EVP_PKEY_meth_get_verify)} + EVP_PKEY_meth_get_verify := @FC_EVP_PKEY_meth_get_verify; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_meth_get_verify_removed)} + if EVP_PKEY_meth_get_verify_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_meth_get_verify)} + EVP_PKEY_meth_get_verify := @_EVP_PKEY_meth_get_verify; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_meth_get_verify_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_meth_get_verify'); + {$ifend} + end; + + + EVP_PKEY_meth_get_verify_recover := LoadLibFunction(ADllHandle, EVP_PKEY_meth_get_verify_recover_procname); + FuncLoadError := not assigned(EVP_PKEY_meth_get_verify_recover); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_meth_get_verify_recover_allownil)} + EVP_PKEY_meth_get_verify_recover := @ERR_EVP_PKEY_meth_get_verify_recover; + {$ifend} + {$if declared(EVP_PKEY_meth_get_verify_recover_introduced)} + if LibVersion < EVP_PKEY_meth_get_verify_recover_introduced then + begin + {$if declared(FC_EVP_PKEY_meth_get_verify_recover)} + EVP_PKEY_meth_get_verify_recover := @FC_EVP_PKEY_meth_get_verify_recover; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_meth_get_verify_recover_removed)} + if EVP_PKEY_meth_get_verify_recover_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_meth_get_verify_recover)} + EVP_PKEY_meth_get_verify_recover := @_EVP_PKEY_meth_get_verify_recover; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_meth_get_verify_recover_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_meth_get_verify_recover'); + {$ifend} + end; + + + EVP_PKEY_meth_get_signctx := LoadLibFunction(ADllHandle, EVP_PKEY_meth_get_signctx_procname); + FuncLoadError := not assigned(EVP_PKEY_meth_get_signctx); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_meth_get_signctx_allownil)} + EVP_PKEY_meth_get_signctx := @ERR_EVP_PKEY_meth_get_signctx; + {$ifend} + {$if declared(EVP_PKEY_meth_get_signctx_introduced)} + if LibVersion < EVP_PKEY_meth_get_signctx_introduced then + begin + {$if declared(FC_EVP_PKEY_meth_get_signctx)} + EVP_PKEY_meth_get_signctx := @FC_EVP_PKEY_meth_get_signctx; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_meth_get_signctx_removed)} + if EVP_PKEY_meth_get_signctx_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_meth_get_signctx)} + EVP_PKEY_meth_get_signctx := @_EVP_PKEY_meth_get_signctx; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_meth_get_signctx_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_meth_get_signctx'); + {$ifend} + end; + + + EVP_PKEY_meth_get_verifyctx := LoadLibFunction(ADllHandle, EVP_PKEY_meth_get_verifyctx_procname); + FuncLoadError := not assigned(EVP_PKEY_meth_get_verifyctx); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_meth_get_verifyctx_allownil)} + EVP_PKEY_meth_get_verifyctx := @ERR_EVP_PKEY_meth_get_verifyctx; + {$ifend} + {$if declared(EVP_PKEY_meth_get_verifyctx_introduced)} + if LibVersion < EVP_PKEY_meth_get_verifyctx_introduced then + begin + {$if declared(FC_EVP_PKEY_meth_get_verifyctx)} + EVP_PKEY_meth_get_verifyctx := @FC_EVP_PKEY_meth_get_verifyctx; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_meth_get_verifyctx_removed)} + if EVP_PKEY_meth_get_verifyctx_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_meth_get_verifyctx)} + EVP_PKEY_meth_get_verifyctx := @_EVP_PKEY_meth_get_verifyctx; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_meth_get_verifyctx_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_meth_get_verifyctx'); + {$ifend} + end; + + + EVP_PKEY_meth_get_encrypt := LoadLibFunction(ADllHandle, EVP_PKEY_meth_get_encrypt_procname); + FuncLoadError := not assigned(EVP_PKEY_meth_get_encrypt); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_meth_get_encrypt_allownil)} + EVP_PKEY_meth_get_encrypt := @ERR_EVP_PKEY_meth_get_encrypt; + {$ifend} + {$if declared(EVP_PKEY_meth_get_encrypt_introduced)} + if LibVersion < EVP_PKEY_meth_get_encrypt_introduced then + begin + {$if declared(FC_EVP_PKEY_meth_get_encrypt)} + EVP_PKEY_meth_get_encrypt := @FC_EVP_PKEY_meth_get_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_meth_get_encrypt_removed)} + if EVP_PKEY_meth_get_encrypt_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_meth_get_encrypt)} + EVP_PKEY_meth_get_encrypt := @_EVP_PKEY_meth_get_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_meth_get_encrypt_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_meth_get_encrypt'); + {$ifend} + end; + + + EVP_PKEY_meth_get_decrypt := LoadLibFunction(ADllHandle, EVP_PKEY_meth_get_decrypt_procname); + FuncLoadError := not assigned(EVP_PKEY_meth_get_decrypt); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_meth_get_decrypt_allownil)} + EVP_PKEY_meth_get_decrypt := @ERR_EVP_PKEY_meth_get_decrypt; + {$ifend} + {$if declared(EVP_PKEY_meth_get_decrypt_introduced)} + if LibVersion < EVP_PKEY_meth_get_decrypt_introduced then + begin + {$if declared(FC_EVP_PKEY_meth_get_decrypt)} + EVP_PKEY_meth_get_decrypt := @FC_EVP_PKEY_meth_get_decrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_meth_get_decrypt_removed)} + if EVP_PKEY_meth_get_decrypt_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_meth_get_decrypt)} + EVP_PKEY_meth_get_decrypt := @_EVP_PKEY_meth_get_decrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_meth_get_decrypt_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_meth_get_decrypt'); + {$ifend} + end; + + + EVP_PKEY_meth_get_derive := LoadLibFunction(ADllHandle, EVP_PKEY_meth_get_derive_procname); + FuncLoadError := not assigned(EVP_PKEY_meth_get_derive); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_meth_get_derive_allownil)} + EVP_PKEY_meth_get_derive := @ERR_EVP_PKEY_meth_get_derive; + {$ifend} + {$if declared(EVP_PKEY_meth_get_derive_introduced)} + if LibVersion < EVP_PKEY_meth_get_derive_introduced then + begin + {$if declared(FC_EVP_PKEY_meth_get_derive)} + EVP_PKEY_meth_get_derive := @FC_EVP_PKEY_meth_get_derive; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_meth_get_derive_removed)} + if EVP_PKEY_meth_get_derive_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_meth_get_derive)} + EVP_PKEY_meth_get_derive := @_EVP_PKEY_meth_get_derive; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_meth_get_derive_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_meth_get_derive'); + {$ifend} + end; + + + EVP_PKEY_meth_get_ctrl := LoadLibFunction(ADllHandle, EVP_PKEY_meth_get_ctrl_procname); + FuncLoadError := not assigned(EVP_PKEY_meth_get_ctrl); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_meth_get_ctrl_allownil)} + EVP_PKEY_meth_get_ctrl := @ERR_EVP_PKEY_meth_get_ctrl; + {$ifend} + {$if declared(EVP_PKEY_meth_get_ctrl_introduced)} + if LibVersion < EVP_PKEY_meth_get_ctrl_introduced then + begin + {$if declared(FC_EVP_PKEY_meth_get_ctrl)} + EVP_PKEY_meth_get_ctrl := @FC_EVP_PKEY_meth_get_ctrl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_meth_get_ctrl_removed)} + if EVP_PKEY_meth_get_ctrl_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_meth_get_ctrl)} + EVP_PKEY_meth_get_ctrl := @_EVP_PKEY_meth_get_ctrl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_meth_get_ctrl_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_meth_get_ctrl'); + {$ifend} + end; + + + EVP_PKEY_meth_get_digestsign := LoadLibFunction(ADllHandle, EVP_PKEY_meth_get_digestsign_procname); + FuncLoadError := not assigned(EVP_PKEY_meth_get_digestsign); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_meth_get_digestsign_allownil)} + EVP_PKEY_meth_get_digestsign := @ERR_EVP_PKEY_meth_get_digestsign; + {$ifend} + {$if declared(EVP_PKEY_meth_get_digestsign_introduced)} + if LibVersion < EVP_PKEY_meth_get_digestsign_introduced then + begin + {$if declared(FC_EVP_PKEY_meth_get_digestsign)} + EVP_PKEY_meth_get_digestsign := @FC_EVP_PKEY_meth_get_digestsign; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_meth_get_digestsign_removed)} + if EVP_PKEY_meth_get_digestsign_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_meth_get_digestsign)} + EVP_PKEY_meth_get_digestsign := @_EVP_PKEY_meth_get_digestsign; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_meth_get_digestsign_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_meth_get_digestsign'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_PKEY_meth_get_digestverify := LoadLibFunction(ADllHandle, EVP_PKEY_meth_get_digestverify_procname); + FuncLoadError := not assigned(EVP_PKEY_meth_get_digestverify); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_meth_get_digestverify_allownil)} + EVP_PKEY_meth_get_digestverify := @ERR_EVP_PKEY_meth_get_digestverify; + {$ifend} + {$if declared(EVP_PKEY_meth_get_digestverify_introduced)} + if LibVersion < EVP_PKEY_meth_get_digestverify_introduced then + begin + {$if declared(FC_EVP_PKEY_meth_get_digestverify)} + EVP_PKEY_meth_get_digestverify := @FC_EVP_PKEY_meth_get_digestverify; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_meth_get_digestverify_removed)} + if EVP_PKEY_meth_get_digestverify_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_meth_get_digestverify)} + EVP_PKEY_meth_get_digestverify := @_EVP_PKEY_meth_get_digestverify; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_meth_get_digestverify_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_meth_get_digestverify'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_PKEY_meth_get_check := LoadLibFunction(ADllHandle, EVP_PKEY_meth_get_check_procname); + FuncLoadError := not assigned(EVP_PKEY_meth_get_check); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_meth_get_check_allownil)} + EVP_PKEY_meth_get_check := @ERR_EVP_PKEY_meth_get_check; + {$ifend} + {$if declared(EVP_PKEY_meth_get_check_introduced)} + if LibVersion < EVP_PKEY_meth_get_check_introduced then + begin + {$if declared(FC_EVP_PKEY_meth_get_check)} + EVP_PKEY_meth_get_check := @FC_EVP_PKEY_meth_get_check; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_meth_get_check_removed)} + if EVP_PKEY_meth_get_check_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_meth_get_check)} + EVP_PKEY_meth_get_check := @_EVP_PKEY_meth_get_check; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_meth_get_check_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_meth_get_check'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_PKEY_meth_get_public_check := LoadLibFunction(ADllHandle, EVP_PKEY_meth_get_public_check_procname); + FuncLoadError := not assigned(EVP_PKEY_meth_get_public_check); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_meth_get_public_check_allownil)} + EVP_PKEY_meth_get_public_check := @ERR_EVP_PKEY_meth_get_public_check; + {$ifend} + {$if declared(EVP_PKEY_meth_get_public_check_introduced)} + if LibVersion < EVP_PKEY_meth_get_public_check_introduced then + begin + {$if declared(FC_EVP_PKEY_meth_get_public_check)} + EVP_PKEY_meth_get_public_check := @FC_EVP_PKEY_meth_get_public_check; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_meth_get_public_check_removed)} + if EVP_PKEY_meth_get_public_check_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_meth_get_public_check)} + EVP_PKEY_meth_get_public_check := @_EVP_PKEY_meth_get_public_check; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_meth_get_public_check_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_meth_get_public_check'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_PKEY_meth_get_param_check := LoadLibFunction(ADllHandle, EVP_PKEY_meth_get_param_check_procname); + FuncLoadError := not assigned(EVP_PKEY_meth_get_param_check); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_meth_get_param_check_allownil)} + EVP_PKEY_meth_get_param_check := @ERR_EVP_PKEY_meth_get_param_check; + {$ifend} + {$if declared(EVP_PKEY_meth_get_param_check_introduced)} + if LibVersion < EVP_PKEY_meth_get_param_check_introduced then + begin + {$if declared(FC_EVP_PKEY_meth_get_param_check)} + EVP_PKEY_meth_get_param_check := @FC_EVP_PKEY_meth_get_param_check; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_meth_get_param_check_removed)} + if EVP_PKEY_meth_get_param_check_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_meth_get_param_check)} + EVP_PKEY_meth_get_param_check := @_EVP_PKEY_meth_get_param_check; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_meth_get_param_check_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_meth_get_param_check'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_PKEY_meth_get_digest_custom := LoadLibFunction(ADllHandle, EVP_PKEY_meth_get_digest_custom_procname); + FuncLoadError := not assigned(EVP_PKEY_meth_get_digest_custom); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_meth_get_digest_custom_allownil)} + EVP_PKEY_meth_get_digest_custom := @ERR_EVP_PKEY_meth_get_digest_custom; + {$ifend} + {$if declared(EVP_PKEY_meth_get_digest_custom_introduced)} + if LibVersion < EVP_PKEY_meth_get_digest_custom_introduced then + begin + {$if declared(FC_EVP_PKEY_meth_get_digest_custom)} + EVP_PKEY_meth_get_digest_custom := @FC_EVP_PKEY_meth_get_digest_custom; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_meth_get_digest_custom_removed)} + if EVP_PKEY_meth_get_digest_custom_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_meth_get_digest_custom)} + EVP_PKEY_meth_get_digest_custom := @_EVP_PKEY_meth_get_digest_custom; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_meth_get_digest_custom_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_meth_get_digest_custom'); + {$ifend} + end; + + {introduced 1.1.0} + EVP_add_alg_module := LoadLibFunction(ADllHandle, EVP_add_alg_module_procname); + FuncLoadError := not assigned(EVP_add_alg_module); + if FuncLoadError then + begin + {$if not defined(EVP_add_alg_module_allownil)} + EVP_add_alg_module := @ERR_EVP_add_alg_module; + {$ifend} + {$if declared(EVP_add_alg_module_introduced)} + if LibVersion < EVP_add_alg_module_introduced then + begin + {$if declared(FC_EVP_add_alg_module)} + EVP_add_alg_module := @FC_EVP_add_alg_module; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_add_alg_module_removed)} + if EVP_add_alg_module_removed <= LibVersion then + begin + {$if declared(_EVP_add_alg_module)} + EVP_add_alg_module := @_EVP_add_alg_module; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_add_alg_module_allownil)} + if FuncLoadError then + AFailed.Add('EVP_add_alg_module'); + {$ifend} + end; + + + OpenSSL_add_all_ciphers := LoadLibFunction(ADllHandle, OpenSSL_add_all_ciphers_procname); + FuncLoadError := not assigned(OpenSSL_add_all_ciphers); + if FuncLoadError then + begin + {$if not defined(OpenSSL_add_all_ciphers_allownil)} + OpenSSL_add_all_ciphers := @ERR_OpenSSL_add_all_ciphers; + {$ifend} + {$if declared(OpenSSL_add_all_ciphers_introduced)} + if LibVersion < OpenSSL_add_all_ciphers_introduced then + begin + {$if declared(FC_OpenSSL_add_all_ciphers)} + OpenSSL_add_all_ciphers := @FC_OpenSSL_add_all_ciphers; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OpenSSL_add_all_ciphers_removed)} + if OpenSSL_add_all_ciphers_removed <= LibVersion then + begin + {$if declared(_OpenSSL_add_all_ciphers)} + OpenSSL_add_all_ciphers := @_OpenSSL_add_all_ciphers; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OpenSSL_add_all_ciphers_allownil)} + if FuncLoadError then + AFailed.Add('OpenSSL_add_all_ciphers'); + {$ifend} + end; + + + OpenSSL_add_all_digests := LoadLibFunction(ADllHandle, OpenSSL_add_all_digests_procname); + FuncLoadError := not assigned(OpenSSL_add_all_digests); + if FuncLoadError then + begin + {$if not defined(OpenSSL_add_all_digests_allownil)} + OpenSSL_add_all_digests := @ERR_OpenSSL_add_all_digests; + {$ifend} + {$if declared(OpenSSL_add_all_digests_introduced)} + if LibVersion < OpenSSL_add_all_digests_introduced then + begin + {$if declared(FC_OpenSSL_add_all_digests)} + OpenSSL_add_all_digests := @FC_OpenSSL_add_all_digests; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OpenSSL_add_all_digests_removed)} + if OpenSSL_add_all_digests_removed <= LibVersion then + begin + {$if declared(_OpenSSL_add_all_digests)} + OpenSSL_add_all_digests := @_OpenSSL_add_all_digests; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OpenSSL_add_all_digests_allownil)} + if FuncLoadError then + AFailed.Add('OpenSSL_add_all_digests'); + {$ifend} + end; + + + EVP_cleanup := LoadLibFunction(ADllHandle, EVP_cleanup_procname); + FuncLoadError := not assigned(EVP_cleanup); + if FuncLoadError then + begin + {$if not defined(EVP_cleanup_allownil)} + EVP_cleanup := @ERR_EVP_cleanup; + {$ifend} + {$if declared(EVP_cleanup_introduced)} + if LibVersion < EVP_cleanup_introduced then + begin + {$if declared(FC_EVP_cleanup)} + EVP_cleanup := @FC_EVP_cleanup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_cleanup_removed)} + if EVP_cleanup_removed <= LibVersion then + begin + {$if declared(_EVP_cleanup)} + EVP_cleanup := @_EVP_cleanup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_cleanup_allownil)} + if FuncLoadError then + AFailed.Add('EVP_cleanup'); + {$ifend} + end; + + +end; + +procedure Unload; +begin + EVP_PKEY_assign_RSA := nil; {removed 1.0.0} + EVP_PKEY_assign_DSA := nil; {removed 1.0.0} + EVP_PKEY_assign_DH := nil; {removed 1.0.0} + EVP_PKEY_assign_EC_KEY := nil; {removed 1.0.0} + EVP_PKEY_assign_SIPHASH := nil; {removed 1.0.0} + EVP_PKEY_assign_POLY1305 := nil; {removed 1.0.0} + EVP_MD_meth_new := nil; {introduced 1.1.0} + EVP_MD_meth_dup := nil; {introduced 1.1.0} + EVP_MD_meth_free := nil; {introduced 1.1.0} + EVP_MD_meth_set_input_blocksize := nil; {introduced 1.1.0} + EVP_MD_meth_set_result_size := nil; {introduced 1.1.0} + EVP_MD_meth_set_app_datasize := nil; {introduced 1.1.0} + EVP_MD_meth_set_flags := nil; {introduced 1.1.0} + EVP_MD_meth_set_init := nil; {introduced 1.1.0} + EVP_MD_meth_set_update := nil; {introduced 1.1.0} + EVP_MD_meth_set_final := nil; {introduced 1.1.0} + EVP_MD_meth_set_copy := nil; {introduced 1.1.0} + EVP_MD_meth_set_cleanup := nil; {introduced 1.1.0} + EVP_MD_meth_set_ctrl := nil; {introduced 1.1.0} + EVP_MD_meth_get_input_blocksize := nil; {introduced 1.1.0} + EVP_MD_meth_get_result_size := nil; {introduced 1.1.0} + EVP_MD_meth_get_app_datasize := nil; {introduced 1.1.0} + EVP_MD_meth_get_flags := nil; {introduced 1.1.0} + EVP_MD_meth_get_init := nil; {introduced 1.1.0} + EVP_MD_meth_get_update := nil; {introduced 1.1.0} + EVP_MD_meth_get_final := nil; {introduced 1.1.0} + EVP_MD_meth_get_copy := nil; {introduced 1.1.0} + EVP_MD_meth_get_cleanup := nil; {introduced 1.1.0} + EVP_MD_meth_get_ctrl := nil; {introduced 1.1.0} + EVP_CIPHER_meth_new := nil; {introduced 1.1.0} + EVP_CIPHER_meth_dup := nil; {introduced 1.1.0} + EVP_CIPHER_meth_free := nil; {introduced 1.1.0} + EVP_CIPHER_meth_set_iv_length := nil; {introduced 1.1.0} + EVP_CIPHER_meth_set_flags := nil; {introduced 1.1.0} + EVP_CIPHER_meth_set_impl_ctx_size := nil; {introduced 1.1.0} + EVP_CIPHER_meth_set_init := nil; {introduced 1.1.0} + EVP_CIPHER_meth_set_do_cipher := nil; {introduced 1.1.0} + EVP_CIPHER_meth_set_cleanup := nil; {introduced 1.1.0} + EVP_CIPHER_meth_set_set_asn1_params := nil; {introduced 1.1.0} + EVP_CIPHER_meth_set_get_asn1_params := nil; {introduced 1.1.0} + EVP_CIPHER_meth_set_ctrl := nil; {introduced 1.1.0} + EVP_CIPHER_meth_get_init := nil; {introduced 1.1.0} + EVP_CIPHER_meth_get_do_cipher := nil; {introduced 1.1.0} + EVP_CIPHER_meth_get_cleanup := nil; {introduced 1.1.0} + EVP_CIPHER_meth_get_set_asn1_params := nil; {introduced 1.1.0} + EVP_CIPHER_meth_get_get_asn1_params := nil; {introduced 1.1.0} + EVP_CIPHER_meth_get_ctrl := nil; {introduced 1.1.0} + EVP_MD_type := nil; {removed 3.0.0} + EVP_MD_pkey_type := nil; {removed 3.0.0} + EVP_MD_size := nil; {removed 3.0.0} + EVP_MD_block_size := nil; {removed 3.0.0} + EVP_MD_flags := nil; {removed 3.0.0} + EVP_MD_CTX_md := nil; + EVP_MD_CTX_update_fn := nil; {introduced 1.1.0} + EVP_MD_CTX_set_update_fn := nil; {introduced 1.1.0} + EVP_MD_CTX_pkey_ctx := nil; {introduced 1.1.0 removed 3.0.0} + EVP_MD_CTX_set_pkey_ctx := nil; {introduced 1.1.0} + EVP_MD_CTX_md_data := nil; {introduced 1.1.0 removed 3.0.0} + EVP_CIPHER_nid := nil; {removed 3.0.0} + EVP_CIPHER_block_size := nil; {removed 3.0.0} + EVP_CIPHER_impl_ctx_size := nil; {introduced 1.1.0} + EVP_CIPHER_key_length := nil; {removed 3.0.0} + EVP_CIPHER_iv_length := nil; {removed 3.0.0} + EVP_CIPHER_flags := nil; {removed 3.0.0} + EVP_CIPHER_CTX_cipher := nil; + EVP_CIPHER_CTX_encrypting := nil; {introduced 1.1.0 removed 3.0.0} + EVP_CIPHER_CTX_nid := nil; {removed 3.0.0} + EVP_CIPHER_CTX_block_size := nil; {removed 3.0.0} + EVP_CIPHER_CTX_key_length := nil; {removed 3.0.0} + EVP_CIPHER_CTX_iv_length := nil; {removed 3.0.0} + EVP_CIPHER_CTX_iv := nil; {introduced 1.1.0} + EVP_CIPHER_CTX_original_iv := nil; {introduced 1.1.0} + EVP_CIPHER_CTX_iv_noconst := nil; {introduced 1.1.0} + EVP_CIPHER_CTX_buf_noconst := nil; {introduced 1.1.0} + EVP_CIPHER_CTX_num := nil; {introduced 1.1.0 removed 3.0.0} + EVP_CIPHER_CTX_set_num := nil; {introduced 1.1.0} + EVP_CIPHER_CTX_copy := nil; + EVP_CIPHER_CTX_get_app_data := nil; + EVP_CIPHER_CTX_set_app_data := nil; + EVP_CIPHER_CTX_get_cipher_data := nil; {introduced 1.1.0} + EVP_CIPHER_CTX_set_cipher_data := nil; {introduced 1.1.0} + BIO_set_md := nil; {removed 1.0.0} + EVP_MD_CTX_init := nil; {removed 1.1.0} + EVP_MD_CTX_cleanup := nil; {removed 1.1.0} + EVP_MD_CTX_ctrl := nil; {introduced 1.1.0} + EVP_MD_CTX_new := nil; {introduced 1.1.0} + EVP_MD_CTX_reset := nil; {introduced 1.1.0} + EVP_MD_CTX_free := nil; {introduced 1.1.0} + EVP_MD_CTX_copy_ex := nil; + EVP_MD_CTX_set_flags := nil; + EVP_MD_CTX_clear_flags := nil; + EVP_MD_CTX_test_flags := nil; + EVP_DigestInit_ex := nil; + EVP_DigestUpdate := nil; + EVP_DigestFinal_ex := nil; + EVP_Digest := nil; + EVP_MD_CTX_copy := nil; + EVP_DigestInit := nil; + EVP_DigestFinal := nil; + EVP_DigestFinalXOF := nil; {introduced 1.1.0} + EVP_read_pw_string := nil; + EVP_read_pw_string_min := nil; + EVP_set_pw_prompt := nil; + EVP_get_pw_prompt := nil; + EVP_BytesToKey := nil; + EVP_CIPHER_CTX_set_flags := nil; + EVP_CIPHER_CTX_clear_flags := nil; + EVP_CIPHER_CTX_test_flags := nil; + EVP_EncryptInit := nil; + EVP_EncryptInit_ex := nil; + EVP_EncryptUpdate := nil; + EVP_EncryptFinal_ex := nil; + EVP_EncryptFinal := nil; + EVP_DecryptInit := nil; + EVP_DecryptInit_ex := nil; + EVP_DecryptUpdate := nil; + EVP_DecryptFinal := nil; + EVP_DecryptFinal_ex := nil; + EVP_CipherInit := nil; + EVP_CipherInit_ex := nil; + EVP_CipherUpdate := nil; + EVP_CipherFinal := nil; + EVP_CipherFinal_ex := nil; + EVP_SignFinal := nil; + EVP_DigestSign := nil; {introduced 1.1.0} + EVP_VerifyFinal := nil; + EVP_DigestVerify := nil; {introduced 1.1.0} + EVP_DigestSignInit := nil; + EVP_DigestSignFinal := nil; + EVP_DigestVerifyInit := nil; + EVP_DigestVerifyFinal := nil; + EVP_OpenInit := nil; + EVP_OpenFinal := nil; + EVP_SealInit := nil; + EVP_SealFinal := nil; + EVP_ENCODE_CTX_new := nil; {introduced 1.1.0} + EVP_ENCODE_CTX_free := nil; {introduced 1.1.0} + EVP_ENCODE_CTX_copy := nil; {introduced 1.1.0} + EVP_ENCODE_CTX_num := nil; {introduced 1.1.0} + EVP_EncodeInit := nil; + EVP_EncodeUpdate := nil; + EVP_EncodeFinal := nil; + EVP_EncodeBlock := nil; + EVP_DecodeInit := nil; + EVP_DecodeUpdate := nil; + EVP_DecodeFinal := nil; + EVP_DecodeBlock := nil; + EVP_CIPHER_CTX_new := nil; + EVP_CIPHER_CTX_reset := nil; {introduced 1.1.0} + EVP_CIPHER_CTX_free := nil; + EVP_CIPHER_CTX_set_key_length := nil; + EVP_CIPHER_CTX_set_padding := nil; + EVP_CIPHER_CTX_ctrl := nil; + EVP_CIPHER_CTX_rand_key := nil; + BIO_f_md := nil; + BIO_f_base64 := nil; + BIO_f_cipher := nil; + BIO_f_reliable := nil; + BIO_set_cipher := nil; + EVP_md_null := nil; + EVP_md2 := nil; {removed 1.1.0 allow_nil} + EVP_md4 := nil; {removed 1.1.0 allow_nil} + EVP_md5 := nil; {removed 1.1.0 allow_nil} + EVP_md5_sha1 := nil; {introduced 1.1.0} + EVP_sha1 := nil; + EVP_sha224 := nil; + EVP_sha256 := nil; + EVP_sha384 := nil; + EVP_sha512 := nil; + EVP_sha512_224 := nil; {introduced 1.1.0} + EVP_sha512_256 := nil; {introduced 1.1.0} + EVP_sha3_224 := nil; {introduced 1.1.0} + EVP_sha3_256 := nil; {introduced 1.1.0} + EVP_sha3_384 := nil; {introduced 1.1.0} + EVP_sha3_512 := nil; {introduced 1.1.0} + EVP_shake128 := nil; {introduced 1.1.0} + EVP_shake256 := nil; {introduced 1.1.0} + EVP_enc_null := nil; + EVP_des_ecb := nil; + EVP_des_ede := nil; + EVP_des_ede3 := nil; + EVP_des_ede_ecb := nil; + EVP_des_ede3_ecb := nil; + EVP_des_cfb64 := nil; + EVP_des_cfb1 := nil; + EVP_des_cfb8 := nil; + EVP_des_ede_cfb64 := nil; + EVP_des_ede3_cfb64 := nil; + EVP_des_ede3_cfb1 := nil; + EVP_des_ede3_cfb8 := nil; + EVP_des_ofb := nil; + EVP_des_ede_ofb := nil; + EVP_des_ede3_ofb := nil; + EVP_des_cbc := nil; + EVP_des_ede_cbc := nil; + EVP_des_ede3_cbc := nil; + EVP_desx_cbc := nil; + EVP_des_ede3_wrap := nil; + EVP_rc4 := nil; + EVP_rc4_40 := nil; + EVP_rc2_ecb := nil; + EVP_rc2_cbc := nil; + EVP_rc2_40_cbc := nil; + EVP_rc2_64_cbc := nil; + EVP_rc2_cfb64 := nil; + EVP_rc2_ofb := nil; + EVP_bf_ecb := nil; + EVP_bf_cbc := nil; + EVP_bf_cfb64 := nil; + EVP_bf_ofb := nil; + EVP_cast5_ecb := nil; + EVP_cast5_cbc := nil; + EVP_cast5_cfb64 := nil; + EVP_cast5_ofb := nil; + EVP_aes_128_ecb := nil; + EVP_aes_128_cbc := nil; + EVP_aes_128_cfb1 := nil; + EVP_aes_128_cfb8 := nil; + EVP_aes_128_cfb128 := nil; + EVP_aes_128_ofb := nil; + EVP_aes_128_ctr := nil; + EVP_aes_128_ccm := nil; + EVP_aes_128_gcm := nil; + EVP_aes_128_xts := nil; + EVP_aes_128_wrap := nil; + EVP_aes_128_wrap_pad := nil; {introduced 1.1.0} + EVP_aes_128_ocb := nil; {introduced 1.1.0} + EVP_aes_192_ecb := nil; + EVP_aes_192_cbc := nil; + EVP_aes_192_cfb1 := nil; + EVP_aes_192_cfb8 := nil; + EVP_aes_192_cfb128 := nil; + EVP_aes_192_ofb := nil; + EVP_aes_192_ctr := nil; + EVP_aes_192_ccm := nil; + EVP_aes_192_gcm := nil; + EVP_aes_192_wrap := nil; + EVP_aes_192_wrap_pad := nil; {introduced 1.1.0} + EVP_aes_192_ocb := nil; {introduced 1.1.0} + EVP_aes_256_ecb := nil; + EVP_aes_256_cbc := nil; + EVP_aes_256_cfb1 := nil; + EVP_aes_256_cfb8 := nil; + EVP_aes_256_cfb128 := nil; + EVP_aes_256_ofb := nil; + EVP_aes_256_ctr := nil; + EVP_aes_256_ccm := nil; + EVP_aes_256_gcm := nil; + EVP_aes_256_xts := nil; + EVP_aes_256_wrap := nil; + EVP_aes_256_wrap_pad := nil; {introduced 1.1.0} + EVP_aes_256_ocb := nil; {introduced 1.1.0} + EVP_aes_128_cbc_hmac_sha1 := nil; + EVP_aes_256_cbc_hmac_sha1 := nil; + EVP_aes_128_cbc_hmac_sha256 := nil; + EVP_aes_256_cbc_hmac_sha256 := nil; + EVP_aria_128_ecb := nil; {introduced 1.1.0} + EVP_aria_128_cbc := nil; {introduced 1.1.0} + EVP_aria_128_cfb1 := nil; {introduced 1.1.0} + EVP_aria_128_cfb8 := nil; {introduced 1.1.0} + EVP_aria_128_cfb128 := nil; {introduced 1.1.0} + EVP_aria_128_ctr := nil; {introduced 1.1.0} + EVP_aria_128_ofb := nil; {introduced 1.1.0} + EVP_aria_128_gcm := nil; {introduced 1.1.0} + EVP_aria_128_ccm := nil; {introduced 1.1.0} + EVP_aria_192_ecb := nil; {introduced 1.1.0} + EVP_aria_192_cbc := nil; {introduced 1.1.0} + EVP_aria_192_cfb1 := nil; {introduced 1.1.0} + EVP_aria_192_cfb8 := nil; {introduced 1.1.0} + EVP_aria_192_cfb128 := nil; {introduced 1.1.0} + EVP_aria_192_ctr := nil; {introduced 1.1.0} + EVP_aria_192_ofb := nil; {introduced 1.1.0} + EVP_aria_192_gcm := nil; {introduced 1.1.0} + EVP_aria_192_ccm := nil; {introduced 1.1.0} + EVP_aria_256_ecb := nil; {introduced 1.1.0} + EVP_aria_256_cbc := nil; {introduced 1.1.0} + EVP_aria_256_cfb1 := nil; {introduced 1.1.0} + EVP_aria_256_cfb8 := nil; {introduced 1.1.0} + EVP_aria_256_cfb128 := nil; {introduced 1.1.0} + EVP_aria_256_ctr := nil; {introduced 1.1.0} + EVP_aria_256_ofb := nil; {introduced 1.1.0} + EVP_aria_256_gcm := nil; {introduced 1.1.0} + EVP_aria_256_ccm := nil; {introduced 1.1.0} + EVP_camellia_128_ecb := nil; + EVP_camellia_128_cbc := nil; + EVP_camellia_128_cfb1 := nil; + EVP_camellia_128_cfb8 := nil; + EVP_camellia_128_cfb128 := nil; + EVP_camellia_128_ofb := nil; + EVP_camellia_128_ctr := nil; {introduced 1.1.0} + EVP_camellia_192_ecb := nil; + EVP_camellia_192_cbc := nil; + EVP_camellia_192_cfb1 := nil; + EVP_camellia_192_cfb8 := nil; + EVP_camellia_192_cfb128 := nil; + EVP_camellia_192_ofb := nil; + EVP_camellia_192_ctr := nil; {introduced 1.1.0} + EVP_camellia_256_ecb := nil; + EVP_camellia_256_cbc := nil; + EVP_camellia_256_cfb1 := nil; + EVP_camellia_256_cfb8 := nil; + EVP_camellia_256_cfb128 := nil; + EVP_camellia_256_ofb := nil; + EVP_camellia_256_ctr := nil; {introduced 1.1.0} + EVP_chacha20 := nil; {introduced 1.1.0} + EVP_chacha20_poly1305 := nil; {introduced 1.1.0} + EVP_seed_ecb := nil; + EVP_seed_cbc := nil; + EVP_seed_cfb128 := nil; + EVP_seed_ofb := nil; + EVP_sm4_ecb := nil; {introduced 1.1.0} + EVP_sm4_cbc := nil; {introduced 1.1.0} + EVP_sm4_cfb128 := nil; {introduced 1.1.0} + EVP_sm4_ofb := nil; {introduced 1.1.0} + EVP_sm4_ctr := nil; {introduced 1.1.0} + EVP_add_cipher := nil; + EVP_add_digest := nil; + EVP_get_cipherbyname := nil; + EVP_get_digestbyname := nil; + EVP_CIPHER_do_all := nil; + EVP_CIPHER_do_all_sorted := nil; + EVP_MD_do_all := nil; + EVP_MD_do_all_sorted := nil; + EVP_PKEY_decrypt_old := nil; + EVP_PKEY_encrypt_old := nil; + EVP_PKEY_type := nil; + EVP_PKEY_id := nil; {removed 3.0.0} + EVP_PKEY_base_id := nil; {removed 3.0.0} + EVP_PKEY_bits := nil; {removed 3.0.0} + EVP_PKEY_security_bits := nil; {introduced 1.1.0 removed 3.0.0} + EVP_PKEY_size := nil; {removed 3.0.0} + EVP_PKEY_set_type := nil; + EVP_PKEY_set_type_str := nil; + EVP_PKEY_set_alias_type := nil; {introduced 1.1.0 removed 3.0.0} + EVP_PKEY_set1_engine := nil; {introduced 1.1.0} + EVP_PKEY_get0_engine := nil; {introduced 1.1.0} + EVP_PKEY_assign := nil; + EVP_PKEY_get0 := nil; + EVP_PKEY_get0_hmac := nil; {introduced 1.1.0} + EVP_PKEY_get0_poly1305 := nil; {introduced 1.1.0} + EVP_PKEY_get0_siphash := nil; {introduced 1.1.0} + EVP_PKEY_set1_RSA := nil; + EVP_PKEY_get0_RSA := nil; {introduced 1.1.0} + EVP_PKEY_get1_RSA := nil; + EVP_PKEY_set1_DSA := nil; + EVP_PKEY_get0_DSA := nil; {introduced 1.1.0} + EVP_PKEY_get1_DSA := nil; + EVP_PKEY_set1_DH := nil; + EVP_PKEY_get0_DH := nil; {introduced 1.1.0} + EVP_PKEY_get1_DH := nil; + EVP_PKEY_set1_EC_KEY := nil; + EVP_PKEY_get0_EC_KEY := nil; {introduced 1.1.0} + EVP_PKEY_get1_EC_KEY := nil; + EVP_PKEY_new := nil; + EVP_PKEY_up_ref := nil; {introduced 1.1.0} + EVP_PKEY_free := nil; + d2i_PublicKey := nil; + i2d_PublicKey := nil; + d2i_PrivateKey := nil; + d2i_AutoPrivateKey := nil; + i2d_PrivateKey := nil; + EVP_PKEY_copy_parameters := nil; + EVP_PKEY_missing_parameters := nil; + EVP_PKEY_save_parameters := nil; + EVP_PKEY_cmp_parameters := nil; + EVP_PKEY_cmp := nil; + EVP_PKEY_print_public := nil; + EVP_PKEY_print_private := nil; + EVP_PKEY_print_params := nil; + EVP_PKEY_get_default_digest_nid := nil; + EVP_PKEY_set1_tls_encodedpoint := nil; {introduced 1.1.0 removed 3.0.0} + EVP_PKEY_get1_tls_encodedpoint := nil; {introduced 1.1.0 removed 3.0.0} + EVP_CIPHER_type := nil; {removed 3.0.0} + EVP_CIPHER_param_to_asn1 := nil; + EVP_CIPHER_asn1_to_param := nil; + EVP_CIPHER_set_asn1_iv := nil; + EVP_CIPHER_get_asn1_iv := nil; + PKCS5_PBE_keyivgen := nil; + PKCS5_PBKDF2_HMAC_SHA1 := nil; + PKCS5_PBKDF2_HMAC := nil; + PKCS5_v2_PBE_keyivgen := nil; + EVP_PBE_scrypt := nil; {introduced 1.1.0} + PKCS5_v2_scrypt_keyivgen := nil; {introduced 1.1.0} + PKCS5_PBE_add := nil; + EVP_PBE_CipherInit := nil; + EVP_PBE_alg_add_type := nil; + EVP_PBE_alg_add := nil; + EVP_PBE_find := nil; + EVP_PBE_cleanup := nil; + EVP_PBE_get := nil; {introduced 1.1.0} + EVP_PKEY_asn1_get_count := nil; + EVP_PKEY_asn1_get0 := nil; + EVP_PKEY_asn1_find := nil; + EVP_PKEY_asn1_find_str := nil; + EVP_PKEY_asn1_add0 := nil; + EVP_PKEY_asn1_add_alias := nil; + EVP_PKEY_asn1_get0_info := nil; + EVP_PKEY_get0_asn1 := nil; + EVP_PKEY_asn1_new := nil; + EVP_PKEY_asn1_copy := nil; + EVP_PKEY_asn1_free := nil; + EVP_PKEY_asn1_set_public := nil; + EVP_PKEY_asn1_set_private := nil; + EVP_PKEY_asn1_set_param := nil; + EVP_PKEY_asn1_set_free := nil; + EVP_PKEY_asn1_set_ctrl := nil; + EVP_PKEY_asn1_set_item := nil; + EVP_PKEY_asn1_set_siginf := nil; {introduced 1.1.0} + EVP_PKEY_asn1_set_check := nil; {introduced 1.1.0} + EVP_PKEY_asn1_set_public_check := nil; {introduced 1.1.0} + EVP_PKEY_asn1_set_param_check := nil; {introduced 1.1.0} + EVP_PKEY_asn1_set_set_priv_key := nil; {introduced 1.1.0} + EVP_PKEY_asn1_set_set_pub_key := nil; {introduced 1.1.0} + EVP_PKEY_asn1_set_get_priv_key := nil; {introduced 1.1.0} + EVP_PKEY_asn1_set_get_pub_key := nil; {introduced 1.1.0} + EVP_PKEY_asn1_set_security_bits := nil; {introduced 1.1.0} + EVP_PKEY_meth_find := nil; + EVP_PKEY_meth_new := nil; + EVP_PKEY_meth_get0_info := nil; + EVP_PKEY_meth_copy := nil; + EVP_PKEY_meth_free := nil; + EVP_PKEY_meth_add0 := nil; + EVP_PKEY_meth_remove := nil; {introduced 1.1.0} + EVP_PKEY_meth_get_count := nil; {introduced 1.1.0} + EVP_PKEY_meth_get0 := nil; {introduced 1.1.0} + EVP_PKEY_CTX_new := nil; + EVP_PKEY_CTX_new_id := nil; + EVP_PKEY_CTX_dup := nil; + EVP_PKEY_CTX_free := nil; + EVP_PKEY_CTX_ctrl := nil; + EVP_PKEY_CTX_ctrl_str := nil; + EVP_PKEY_CTX_ctrl_uint64 := nil; {introduced 1.1.0} + EVP_PKEY_CTX_str2ctrl := nil; {introduced 1.1.0} + EVP_PKEY_CTX_hex2ctrl := nil; {introduced 1.1.0} + EVP_PKEY_CTX_md := nil; {introduced 1.1.0} + EVP_PKEY_CTX_get_operation := nil; + EVP_PKEY_CTX_set0_keygen_info := nil; + EVP_PKEY_new_mac_key := nil; + EVP_PKEY_new_raw_private_key := nil; {introduced 1.1.0} + EVP_PKEY_new_raw_public_key := nil; {introduced 1.1.0} + EVP_PKEY_get_raw_private_key := nil; {introduced 1.1.0} + EVP_PKEY_get_raw_public_key := nil; {introduced 1.1.0} + EVP_PKEY_new_CMAC_key := nil; {introduced 1.1.0} + EVP_PKEY_CTX_set_data := nil; + EVP_PKEY_CTX_get_data := nil; + EVP_PKEY_CTX_get0_pkey := nil; + EVP_PKEY_CTX_get0_peerkey := nil; + EVP_PKEY_CTX_set_app_data := nil; + EVP_PKEY_CTX_get_app_data := nil; + EVP_PKEY_sign_init := nil; + EVP_PKEY_sign := nil; + EVP_PKEY_verify_init := nil; + EVP_PKEY_verify := nil; + EVP_PKEY_verify_recover_init := nil; + EVP_PKEY_verify_recover := nil; + EVP_PKEY_encrypt_init := nil; + EVP_PKEY_encrypt := nil; + EVP_PKEY_decrypt_init := nil; + EVP_PKEY_decrypt := nil; + EVP_PKEY_derive_init := nil; + EVP_PKEY_derive_set_peer := nil; + EVP_PKEY_derive := nil; + EVP_PKEY_paramgen_init := nil; + EVP_PKEY_paramgen := nil; + EVP_PKEY_keygen_init := nil; + EVP_PKEY_keygen := nil; + EVP_PKEY_check := nil; {introduced 1.1.0} + EVP_PKEY_public_check := nil; {introduced 1.1.0} + EVP_PKEY_param_check := nil; {introduced 1.1.0} + EVP_PKEY_CTX_set_cb := nil; + EVP_PKEY_CTX_get_cb := nil; + EVP_PKEY_CTX_get_keygen_info := nil; + EVP_PKEY_meth_set_init := nil; + EVP_PKEY_meth_set_copy := nil; + EVP_PKEY_meth_set_cleanup := nil; + EVP_PKEY_meth_set_paramgen := nil; + EVP_PKEY_meth_set_keygen := nil; + EVP_PKEY_meth_set_sign := nil; + EVP_PKEY_meth_set_verify := nil; + EVP_PKEY_meth_set_verify_recover := nil; + EVP_PKEY_meth_set_signctx := nil; + EVP_PKEY_meth_set_verifyctx := nil; + EVP_PKEY_meth_set_encrypt := nil; + EVP_PKEY_meth_set_decrypt := nil; + EVP_PKEY_meth_set_derive := nil; + EVP_PKEY_meth_set_ctrl := nil; + EVP_PKEY_meth_set_digestsign := nil; {introduced 1.1.0} + EVP_PKEY_meth_set_digestverify := nil; {introduced 1.1.0} + EVP_PKEY_meth_set_check := nil; {introduced 1.1.0} + EVP_PKEY_meth_set_public_check := nil; {introduced 1.1.0} + EVP_PKEY_meth_set_param_check := nil; {introduced 1.1.0} + EVP_PKEY_meth_set_digest_custom := nil; {introduced 1.1.0} + EVP_PKEY_meth_get_init := nil; + EVP_PKEY_meth_get_copy := nil; + EVP_PKEY_meth_get_cleanup := nil; + EVP_PKEY_meth_get_paramgen := nil; + EVP_PKEY_meth_get_keygen := nil; + EVP_PKEY_meth_get_sign := nil; + EVP_PKEY_meth_get_verify := nil; + EVP_PKEY_meth_get_verify_recover := nil; + EVP_PKEY_meth_get_signctx := nil; + EVP_PKEY_meth_get_verifyctx := nil; + EVP_PKEY_meth_get_encrypt := nil; + EVP_PKEY_meth_get_decrypt := nil; + EVP_PKEY_meth_get_derive := nil; + EVP_PKEY_meth_get_ctrl := nil; + EVP_PKEY_meth_get_digestsign := nil; {introduced 1.1.0} + EVP_PKEY_meth_get_digestverify := nil; {introduced 1.1.0} + EVP_PKEY_meth_get_check := nil; {introduced 1.1.0} + EVP_PKEY_meth_get_public_check := nil; {introduced 1.1.0} + EVP_PKEY_meth_get_param_check := nil; {introduced 1.1.0} + EVP_PKEY_meth_get_digest_custom := nil; {introduced 1.1.0} + EVP_add_alg_module := nil; + OpenSSL_add_all_ciphers := nil; {removed 1.1.0} + OpenSSL_add_all_digests := nil; {removed 1.1.0} + EVP_cleanup := nil; {removed 1.1.0} +end; +{$ELSE} +function EVP_PKEY_assign_RSA(pkey: PEVP_PKEY; rsa: Pointer): TIdC_INT; +begin + Result := EVP_PKEY_assign(pkey, EVP_PKEY_RSA, rsa); +end; + +//# define EVP_PKEY_assign_DSA(pkey,dsa) EVP_PKEY_assign((pkey),EVP_PKEY_DSA, (char *)(dsa)) +function EVP_PKEY_assign_DSA(pkey: PEVP_PKEY; dsa: Pointer): TIdC_INT; +begin + Result := EVP_PKEY_assign(pkey, EVP_PKEY_DSA, dsa); +end; + +//# define EVP_PKEY_assign_DH(pkey,dh) EVP_PKEY_assign((pkey),EVP_PKEY_DH, (char *)(dh)) +function EVP_PKEY_assign_DH(pkey: PEVP_PKEY; dh: Pointer): TIdC_INT; +begin + Result := EVP_PKEY_assign(pkey, EVP_PKEY_DH, dh); +end; + +//# define EVP_PKEY_assign_EC_KEY(pkey,eckey) EVP_PKEY_assign((pkey),EVP_PKEY_EC, (char *)(eckey)) +function EVP_PKEY_assign_EC_KEY(pkey: PEVP_PKEY; eckey: Pointer): TIdC_INT; +begin + Result := EVP_PKEY_assign(pkey, EVP_PKEY_EC, eckey); +end; + +//# define EVP_PKEY_assign_SIPHASH(pkey,shkey) EVP_PKEY_assign((pkey),EVP_PKEY_SIPHASH, (char *)(shkey)) +function EVP_PKEY_assign_SIPHASH(pkey: PEVP_PKEY; shkey: Pointer): TIdC_INT; +begin + Result := EVP_PKEY_assign(pkey, EVP_PKEY_SIPHASH, shkey); +end; + +//# define EVP_PKEY_assign_POLY1305(pkey,polykey) EVP_PKEY_assign((pkey),EVP_PKEY_POLY1305, (char *)(polykey)) +function EVP_PKEY_assign_POLY1305(pkey: PEVP_PKEY; polykey: Pointer): TIdC_INT; +begin + Result := EVP_PKEY_assign(pkey, EVP_PKEY_POLY1305, polykey); +end; + +procedure OpenSSL_add_all_ciphers; +begin + OPENSSL_init_crypto(OPENSSL_INIT_ADD_ALL_CIPHERS, nil); +end; + +procedure OpenSSL_add_all_digests; +begin + OPENSSL_init_crypto(OPENSSL_INIT_ADD_ALL_DIGESTS, Nil); +end; + +procedure EVP_cleanup; +begin +end; + +procedure BIO_set_md(v1: PBIO; const md: PEVP_MD); +begin + {define BIO_set_md(b,md) BIO_ctrl(b,BIO_C_SET_MD,0,(char *)(md))} + BIO_ctrl(v1,BIO_C_SET_MD,0,PIdAnsiChar(md)); +end; + + +{$IFNDEF OPENSSL_NO_MD2} +function EVP_md2: PEVP_MD; +begin + EIdAPIFunctionNotPresent.RaiseException(ROSUnsupported); +end; +{$ENDIF} + +{$IFNDEF OPENSSL_NO_MD4} +function EVP_md4: PEVP_MD; +begin + EIdAPIFunctionNotPresent.RaiseException(ROSUnsupported); +end; +{$ENDIF} + +{$IFNDEF OPENSSL_NO_MD5} +function EVP_md5: PEVP_MD; +begin + EIdAPIFunctionNotPresent.RaiseException(ROSUnsupported); +end; +{$ENDIF} + + +{$ENDIF} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +initialization + Register_SSLLoader(@Load,'LibCrypto'); + Register_SSLUnloader(@Unload); +{$ENDIF} +end. diff --git a/IdOpenSSLHeaders_evperr.pas b/IdOpenSSLHeaders_evperr.pas new file mode 100644 index 0000000..fcd3d48 --- /dev/null +++ b/IdOpenSSLHeaders_evperr.pas @@ -0,0 +1,321 @@ + (* This unit was generated using the script genOpenSSLHdrs.sh from the source file IdOpenSSLHeaders_evperr.h2pas + It should not be modified directly. All changes should be made to IdOpenSSLHeaders_evperr.h2pas + and this file regenerated. IdOpenSSLHeaders_evperr.h2pas is distributed with the full Indy + Distribution. + *) + +{$i IdCompilerDefines.inc} +{$i IdSSLOpenSSLDefines.inc} +{$IFNDEF USE_OPENSSL} + { error Should not compile if USE_OPENSSL is not defined!!!} +{$ENDIF} +{******************************************************************************} +{ } +{ Indy (Internet Direct) - Internet Protocols Simplified } +{ } +{ https://www.indyproject.org/ } +{ https://gitter.im/IndySockets/Indy } +{ } +{******************************************************************************} +{ } +{ This file is part of the Indy (Internet Direct) project, and is offered } +{ under the dual-licensing agreement described on the Indy website. } +{ (https://www.indyproject.org/license/) } +{ } +{ Copyright: } +{ (c) 1993-2020, Chad Z. Hower and the Indy Pit Crew. All rights reserved. } +{ } +{******************************************************************************} +{ } +{ } +{******************************************************************************} + +unit IdOpenSSLHeaders_evperr; + +interface + +// Headers for OpenSSL 1.1.1 +// evperr.h + + +uses + IdCTypes, + IdGlobal, + IdSSLOpenSSLConsts; + +const + (* + * EVP function codes. + *) + EVP_F_AESNI_INIT_KEY = 165; + EVP_F_AESNI_XTS_INIT_KEY = 207; + EVP_F_AES_GCM_CTRL = 196; + EVP_F_AES_INIT_KEY = 133; + EVP_F_AES_OCB_CIPHER = 169; + EVP_F_AES_T4_INIT_KEY = 178; + EVP_F_AES_T4_XTS_INIT_KEY = 208; + EVP_F_AES_WRAP_CIPHER = 170; + EVP_F_AES_XTS_INIT_KEY = 209; + EVP_F_ALG_MODULE_INIT = 177; + EVP_F_ARIA_CCM_INIT_KEY = 175; + EVP_F_ARIA_GCM_CTRL = 197; + EVP_F_ARIA_GCM_INIT_KEY = 176; + EVP_F_ARIA_INIT_KEY = 185; + EVP_F_B64_NEW = 198; + EVP_F_CAMELLIA_INIT_KEY = 159; + EVP_F_CHACHA20_POLY1305_CTRL = 182; + EVP_F_CMLL_T4_INIT_KEY = 179; + EVP_F_DES_EDE3_WRAP_CIPHER = 171; + EVP_F_DO_SIGVER_INIT = 161; + EVP_F_ENC_NEW = 199; + EVP_F_EVP_CIPHERINIT_EX = 123; + EVP_F_EVP_CIPHER_ASN1_TO_PARAM = 204; + EVP_F_EVP_CIPHER_CTX_COPY = 163; + EVP_F_EVP_CIPHER_CTX_CTRL = 124; + EVP_F_EVP_CIPHER_CTX_SET_KEY_LENGTH = 122; + EVP_F_EVP_CIPHER_PARAM_TO_ASN1 = 205; + EVP_F_EVP_DECRYPTFINAL_EX = 101; + EVP_F_EVP_DECRYPTUPDATE = 166; + EVP_F_EVP_DIGESTFINALXOF = 174; + EVP_F_EVP_DIGESTINIT_EX = 128; + EVP_F_EVP_ENCRYPTDECRYPTUPDATE = 219; + EVP_F_EVP_ENCRYPTFINAL_EX = 127; + EVP_F_EVP_ENCRYPTUPDATE = 167; + EVP_F_EVP_MD_CTX_COPY_EX = 110; + EVP_F_EVP_MD_SIZE = 162; + EVP_F_EVP_OPENINIT = 102; + EVP_F_EVP_PBE_ALG_ADD = 115; + EVP_F_EVP_PBE_ALG_ADD_TYPE = 160; + EVP_F_EVP_PBE_CIPHERINIT = 116; + EVP_F_EVP_PBE_SCRYPT = 181; + EVP_F_EVP_PKCS82PKEY = 111; + EVP_F_EVP_PKEY2PKCS8 = 113; + EVP_F_EVP_PKEY_ASN1_ADD0 = 188; + EVP_F_EVP_PKEY_CHECK = 186; + EVP_F_EVP_PKEY_COPY_PARAMETERS = 103; + EVP_F_EVP_PKEY_CTX_CTRL = 137; + EVP_F_EVP_PKEY_CTX_CTRL_STR = 150; + EVP_F_EVP_PKEY_CTX_DUP = 156; + EVP_F_EVP_PKEY_CTX_MD = 168; + EVP_F_EVP_PKEY_DECRYPT = 104; + EVP_F_EVP_PKEY_DECRYPT_INIT = 138; + EVP_F_EVP_PKEY_DECRYPT_OLD = 151; + EVP_F_EVP_PKEY_DERIVE = 153; + EVP_F_EVP_PKEY_DERIVE_INIT = 154; + EVP_F_EVP_PKEY_DERIVE_SET_PEER = 155; + EVP_F_EVP_PKEY_ENCRYPT = 105; + EVP_F_EVP_PKEY_ENCRYPT_INIT = 139; + EVP_F_EVP_PKEY_ENCRYPT_OLD = 152; + EVP_F_EVP_PKEY_GET0_DH = 119; + EVP_F_EVP_PKEY_GET0_DSA = 120; + EVP_F_EVP_PKEY_GET0_EC_KEY = 131; + EVP_F_EVP_PKEY_GET0_HMAC = 183; + EVP_F_EVP_PKEY_GET0_POLY1305 = 184; + EVP_F_EVP_PKEY_GET0_RSA = 121; + EVP_F_EVP_PKEY_GET0_SIPHASH = 172; + EVP_F_EVP_PKEY_GET_RAW_PRIVATE_KEY = 202; + EVP_F_EVP_PKEY_GET_RAW_PUBLIC_KEY = 203; + EVP_F_EVP_PKEY_KEYGEN = 146; + EVP_F_EVP_PKEY_KEYGEN_INIT = 147; + EVP_F_EVP_PKEY_METH_ADD0 = 194; + EVP_F_EVP_PKEY_METH_NEW = 195; + EVP_F_EVP_PKEY_NEW = 106; + EVP_F_EVP_PKEY_NEW_CMAC_KEY = 193; + EVP_F_EVP_PKEY_NEW_RAW_PRIVATE_KEY = 191; + EVP_F_EVP_PKEY_NEW_RAW_PUBLIC_KEY = 192; + EVP_F_EVP_PKEY_PARAMGEN = 148; + EVP_F_EVP_PKEY_PARAMGEN_INIT = 149; + EVP_F_EVP_PKEY_PARAM_CHECK = 189; + EVP_F_EVP_PKEY_PUBLIC_CHECK = 190; + EVP_F_EVP_PKEY_SET1_ENGINE = 187; + EVP_F_EVP_PKEY_SET_ALIAS_TYPE = 206; + EVP_F_EVP_PKEY_SIGN = 140; + EVP_F_EVP_PKEY_SIGN_INIT = 141; + EVP_F_EVP_PKEY_VERIFY = 142; + EVP_F_EVP_PKEY_VERIFY_INIT = 143; + EVP_F_EVP_PKEY_VERIFY_RECOVER = 144; + EVP_F_EVP_PKEY_VERIFY_RECOVER_INIT = 145; + EVP_F_EVP_SIGNFINAL = 107; + EVP_F_EVP_VERIFYFINAL = 108; + EVP_F_INT_CTX_NEW = 157; + EVP_F_OK_NEW = 200; + EVP_F_PKCS5_PBE_KEYIVGEN = 117; + EVP_F_PKCS5_V2_PBE_KEYIVGEN = 118; + EVP_F_PKCS5_V2_PBKDF2_KEYIVGEN = 164; + EVP_F_PKCS5_V2_SCRYPT_KEYIVGEN = 180; + EVP_F_PKEY_SET_TYPE = 158; + EVP_F_RC2_MAGIC_TO_METH = 109; + EVP_F_RC5_CTRL = 125; + EVP_F_R_32_12_16_INIT_KEY = 242; + EVP_F_S390X_AES_GCM_CTRL = 201; + EVP_F_UPDATE = 173; + + (* + * EVP reason codes. + *) + EVP_R_AES_KEY_SETUP_FAILED = 143; + EVP_R_ARIA_KEY_SETUP_FAILED = 176; + EVP_R_BAD_DECRYPT = 100; + EVP_R_BAD_KEY_LENGTH = 195; + EVP_R_BUFFER_TOO_SMALL = 155; + EVP_R_CAMELLIA_KEY_SETUP_FAILED = 157; + EVP_R_CIPHER_PARAMETER_ERROR = 122; + EVP_R_COMMAND_NOT_SUPPORTED = 147; + EVP_R_COPY_ERROR = 173; + EVP_R_CTRL_NOT_IMPLEMENTED = 132; + EVP_R_CTRL_OPERATION_NOT_IMPLEMENTED = 133; + EVP_R_DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH = 138; + EVP_R_DECODE_ERROR = 114; + EVP_R_DIFFERENT_KEY_TYPES = 101; + EVP_R_DIFFERENT_PARAMETERS = 153; + EVP_R_ERROR_LOADING_SECTION = 165; + EVP_R_ERROR_SETTING_FIPS_MODE = 166; + EVP_R_EXPECTING_AN_HMAC_KEY = 174; + EVP_R_EXPECTING_AN_RSA_KEY = 127; + EVP_R_EXPECTING_A_DH_KEY = 128; + EVP_R_EXPECTING_A_DSA_KEY = 129; + EVP_R_EXPECTING_A_EC_KEY = 142; + EVP_R_EXPECTING_A_POLY1305_KEY = 164; + EVP_R_EXPECTING_A_SIPHASH_KEY = 175; + EVP_R_FIPS_MODE_NOT_SUPPORTED = 167; + EVP_R_GET_RAW_KEY_FAILED = 182; + EVP_R_ILLEGAL_SCRYPT_PARAMETERS = 171; + EVP_R_INITIALIZATION_ERROR = 134; + EVP_R_INPUT_NOT_INITIALIZED = 111; + EVP_R_INVALID_DIGEST = 152; + EVP_R_INVALID_FIPS_MODE = 168; + EVP_R_INVALID_KEY = 163; + EVP_R_INVALID_KEY_LENGTH = 130; + EVP_R_INVALID_OPERATION = 148; + EVP_R_KEYGEN_FAILURE = 120; + EVP_R_KEY_SETUP_FAILED = 180; + EVP_R_MEMORY_LIMIT_EXCEEDED = 172; + EVP_R_MESSAGE_DIGEST_IS_NULL = 159; + EVP_R_METHOD_NOT_SUPPORTED = 144; + EVP_R_MISSING_PARAMETERS = 103; + EVP_R_NOT_XOF_OR_INVALID_LENGTH = 178; + EVP_R_NO_CIPHER_SET = 131; + EVP_R_NO_DEFAULT_DIGEST = 158; + EVP_R_NO_DIGEST_SET = 139; + EVP_R_NO_KEY_SET = 154; + EVP_R_NO_OPERATION_SET = 149; + EVP_R_ONLY_ONESHOT_SUPPORTED = 177; + EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE = 150; + EVP_R_OPERATON_NOT_INITIALIZED = 151; + EVP_R_PARTIALLY_OVERLAPPING = 162; + EVP_R_PBKDF2_ERROR = 181; + EVP_R_PKEY_APPLICATION_ASN1_METHOD_ALREADY_REGISTERED = 179; + EVP_R_PRIVATE_KEY_DECODE_ERROR = 145; + EVP_R_PRIVATE_KEY_ENCODE_ERROR = 146; + EVP_R_PUBLIC_KEY_NOT_RSA = 106; + EVP_R_UNKNOWN_CIPHER = 160; + EVP_R_UNKNOWN_DIGEST = 161; + EVP_R_UNKNOWN_OPTION = 169; + EVP_R_UNKNOWN_PBE_ALGORITHM = 121; + EVP_R_UNSUPPORTED_ALGORITHM = 156; + EVP_R_UNSUPPORTED_CIPHER = 107; + EVP_R_UNSUPPORTED_KEYLENGTH = 123; + EVP_R_UNSUPPORTED_KEY_DERIVATION_FUNCTION = 124; + EVP_R_UNSUPPORTED_KEY_SIZE = 108; + EVP_R_UNSUPPORTED_NUMBER_OF_ROUNDS = 135; + EVP_R_UNSUPPORTED_PRF = 125; + EVP_R_UNSUPPORTED_PRIVATE_KEY_ALGORITHM = 118; + EVP_R_UNSUPPORTED_SALT_TYPE = 126; + EVP_R_WRAP_MODE_NOT_ALLOWED = 170; + EVP_R_WRONG_FINAL_BLOCK_LENGTH = 109; + EVP_R_XTS_DUPLICATED_KEYS = 183; + + { The EXTERNALSYM directive is ignored by FPC, however, it is used by Delphi as follows: + + The EXTERNALSYM directive prevents the specified Delphi symbol from appearing in header + files generated for C++. } + + {$EXTERNALSYM ERR_load_EVP_strings} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +var + ERR_load_EVP_strings: function : TIdC_INT; cdecl = nil; + +{$ELSE} + function ERR_load_EVP_strings: TIdC_INT cdecl; external CLibCrypto; + +{$ENDIF} + +implementation + + uses + classes, + IdSSLOpenSSLExceptionHandlers, + IdResourceStringsOpenSSL + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + ,IdSSLOpenSSLLoader + {$ENDIF}; + + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +const + ERR_load_EVP_strings_procname = 'ERR_load_EVP_strings'; + + +{$WARN NO_RETVAL OFF} +function ERR_ERR_load_EVP_strings: TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ERR_load_EVP_strings_procname); +end; + + + +{$WARN NO_RETVAL ON} + +procedure Load(const ADllHandle: TIdLibHandle; LibVersion: TIdC_UINT; const AFailed: TStringList); + +var FuncLoadError: boolean; + +begin + ERR_load_EVP_strings := LoadLibFunction(ADllHandle, ERR_load_EVP_strings_procname); + FuncLoadError := not assigned(ERR_load_EVP_strings); + if FuncLoadError then + begin + {$if not defined(ERR_load_EVP_strings_allownil)} + ERR_load_EVP_strings := @ERR_ERR_load_EVP_strings; + {$ifend} + {$if declared(ERR_load_EVP_strings_introduced)} + if LibVersion < ERR_load_EVP_strings_introduced then + begin + {$if declared(FC_ERR_load_EVP_strings)} + ERR_load_EVP_strings := @FC_ERR_load_EVP_strings; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ERR_load_EVP_strings_removed)} + if ERR_load_EVP_strings_removed <= LibVersion then + begin + {$if declared(_ERR_load_EVP_strings)} + ERR_load_EVP_strings := @_ERR_load_EVP_strings; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ERR_load_EVP_strings_allownil)} + if FuncLoadError then + AFailed.Add('ERR_load_EVP_strings'); + {$ifend} + end; + + +end; + +procedure Unload; +begin + ERR_load_EVP_strings := nil; +end; +{$ELSE} +{$ENDIF} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +initialization + Register_SSLLoader(@Load,'LibCrypto'); + Register_SSLUnloader(@Unload); +{$ENDIF} +end. diff --git a/IdOpenSSLHeaders_hmac.pas b/IdOpenSSLHeaders_hmac.pas new file mode 100644 index 0000000..852da0f --- /dev/null +++ b/IdOpenSSLHeaders_hmac.pas @@ -0,0 +1,720 @@ + (* This unit was generated using the script genOpenSSLHdrs.sh from the source file IdOpenSSLHeaders_hmac.h2pas + It should not be modified directly. All changes should be made to IdOpenSSLHeaders_hmac.h2pas + and this file regenerated. IdOpenSSLHeaders_hmac.h2pas is distributed with the full Indy + Distribution. + *) + +{$i IdCompilerDefines.inc} +{$i IdSSLOpenSSLDefines.inc} +{$IFNDEF USE_OPENSSL} + { error Should not compile if USE_OPENSSL is not defined!!!} +{$ENDIF} +{******************************************************************************} +{ } +{ Indy (Internet Direct) - Internet Protocols Simplified } +{ } +{ https://www.indyproject.org/ } +{ https://gitter.im/IndySockets/Indy } +{ } +{******************************************************************************} +{ } +{ This file is part of the Indy (Internet Direct) project, and is offered } +{ under the dual-licensing agreement described on the Indy website. } +{ (https://www.indyproject.org/license/) } +{ } +{ Copyright: } +{ (c) 1993-2020, Chad Z. Hower and the Indy Pit Crew. All rights reserved. } +{ } +{******************************************************************************} +{ } +{ } +{******************************************************************************} + +unit IdOpenSSLHeaders_hmac; + +interface + +// Headers for OpenSSL 1.1.1 +// hmac.h + + +uses + IdCTypes, + IdGlobal, + IdSSLOpenSSLConsts, + IdOpenSSLHeaders_ossl_typ, + IdOpenSSLHeaders_evp; + + { The EXTERNALSYM directive is ignored by FPC, however, it is used by Delphi as follows: + + The EXTERNALSYM directive prevents the specified Delphi symbol from appearing in header + files generated for C++. } + + {$EXTERNALSYM HMAC_size} {introduced 1.1.0} + {$EXTERNALSYM HMAC_CTX_new} {introduced 1.1.0} + {$EXTERNALSYM HMAC_CTX_reset} {introduced 1.1.0} + {$EXTERNALSYM HMAC_CTX_free} {introduced 1.1.0} + {$EXTERNALSYM HMAC_Init_ex} + {$EXTERNALSYM HMAC_Update} + {$EXTERNALSYM HMAC_Final} + {$EXTERNALSYM HMAC} + {$EXTERNALSYM HMAC_CTX_copy} + {$EXTERNALSYM HMAC_CTX_set_flags} + {$EXTERNALSYM HMAC_CTX_get_md} {introduced 1.1.0} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +var + {$EXTERNALSYM HMAC_CTX_init} {removed 1.1.0} + {$EXTERNALSYM HMAC_CTX_cleanup} {removed 1.1.0} + HMAC_CTX_init: procedure (ctx : PHMAC_CTX); cdecl = nil; {removed 1.1.0} + HMAC_size: function (const e: PHMAC_CTX): TIdC_SIZET; cdecl = nil; {introduced 1.1.0} + HMAC_CTX_new: function : PHMAC_CTX; cdecl = nil; {introduced 1.1.0} + HMAC_CTX_reset: function (ctx: PHMAC_CTX): TIdC_INT; cdecl = nil; {introduced 1.1.0} + HMAC_CTX_cleanup: procedure (ctx : PHMAC_CTX); cdecl = nil; {removed 1.1.0} + HMAC_CTX_free: procedure (ctx: PHMAC_CTX); cdecl = nil; {introduced 1.1.0} + + HMAC_Init_ex: function (ctx: PHMAC_CTX; const key: Pointer; len: TIdC_INT; const md: PEVP_MD; impl: PENGINE): TIdC_INT; cdecl = nil; + HMAC_Update: function (ctx: PHMAC_CTX; const data: PByte; len: TIdC_SIZET): TIdC_INT; cdecl = nil; + HMAC_Final: function (ctx: PHMAC_CTX; md: PByte; len: PByte): TIdC_INT; cdecl = nil; + HMAC: function (const evp_md: PEVP_MD; const key: Pointer; key_len: TIdC_INT; const d: PByte; n: TIdC_SIZET; md: PByte; md_len: PIdC_INT): PByte; cdecl = nil; + HMAC_CTX_copy: function (dctx: PHMAC_CTX; sctx: PHMAC_CTX): TIdC_INT; cdecl = nil; + + HMAC_CTX_set_flags: procedure (ctx: PHMAC_CTX; flags: TIdC_ULONG); cdecl = nil; + HMAC_CTX_get_md: function (const ctx: PHMAC_CTX): PEVP_MD; cdecl = nil; {introduced 1.1.0} + +{$ELSE} + function HMAC_size(const e: PHMAC_CTX): TIdC_SIZET cdecl; external CLibCrypto; {introduced 1.1.0} + function HMAC_CTX_new: PHMAC_CTX cdecl; external CLibCrypto; {introduced 1.1.0} + function HMAC_CTX_reset(ctx: PHMAC_CTX): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + procedure HMAC_CTX_free(ctx: PHMAC_CTX) cdecl; external CLibCrypto; {introduced 1.1.0} + + function HMAC_Init_ex(ctx: PHMAC_CTX; const key: Pointer; len: TIdC_INT; const md: PEVP_MD; impl: PENGINE): TIdC_INT cdecl; external CLibCrypto; + function HMAC_Update(ctx: PHMAC_CTX; const data: PByte; len: TIdC_SIZET): TIdC_INT cdecl; external CLibCrypto; + function HMAC_Final(ctx: PHMAC_CTX; md: PByte; len: PByte): TIdC_INT cdecl; external CLibCrypto; + function HMAC(const evp_md: PEVP_MD; const key: Pointer; key_len: TIdC_INT; const d: PByte; n: TIdC_SIZET; md: PByte; md_len: PIdC_INT): PByte cdecl; external CLibCrypto; + function HMAC_CTX_copy(dctx: PHMAC_CTX; sctx: PHMAC_CTX): TIdC_INT cdecl; external CLibCrypto; + + procedure HMAC_CTX_set_flags(ctx: PHMAC_CTX; flags: TIdC_ULONG) cdecl; external CLibCrypto; + function HMAC_CTX_get_md(const ctx: PHMAC_CTX): PEVP_MD cdecl; external CLibCrypto; {introduced 1.1.0} + +{$ENDIF} + +implementation + + uses + classes, + IdSSLOpenSSLExceptionHandlers, + IdResourceStringsOpenSSL + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + ,IdSSLOpenSSLLoader + {$ENDIF}; + +const + HMAC_size_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + HMAC_CTX_new_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + HMAC_CTX_reset_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + HMAC_CTX_free_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + HMAC_CTX_get_md_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + HMAC_CTX_init_removed = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + HMAC_CTX_cleanup_removed = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + + + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +const + HMAC_CTX_init_procname = 'HMAC_CTX_init'; {removed 1.1.0} + HMAC_size_procname = 'HMAC_size'; {introduced 1.1.0} + HMAC_CTX_new_procname = 'HMAC_CTX_new'; {introduced 1.1.0} + HMAC_CTX_reset_procname = 'HMAC_CTX_reset'; {introduced 1.1.0} + HMAC_CTX_cleanup_procname = 'HMAC_CTX_cleanup'; {removed 1.1.0} + HMAC_CTX_free_procname = 'HMAC_CTX_free'; {introduced 1.1.0} + + HMAC_Init_ex_procname = 'HMAC_Init_ex'; + HMAC_Update_procname = 'HMAC_Update'; + HMAC_Final_procname = 'HMAC_Final'; + HMAC_procname = 'HMAC'; + HMAC_CTX_copy_procname = 'HMAC_CTX_copy'; + + HMAC_CTX_set_flags_procname = 'HMAC_CTX_set_flags'; + HMAC_CTX_get_md_procname = 'HMAC_CTX_get_md'; {introduced 1.1.0} + + + + +{forward_compatibility} +function FC_HMAC_CTX_new: PHMAC_CTX; cdecl; +begin + Result := AllocMem(SizeOf(HMAC_CTX)); + HMAC_CTX_init(Result); +end; + +procedure FC_HMAC_CTX_free(ctx: PHMAC_CTX); cdecl; +begin + HMAC_CTX_cleanup(ctx); + FreeMem(ctx,SizeOf(HMAC_CTX)); +end; + +(* +typedef struct hmac_ctx_st { + const EVP_MD *md; + EVP_MD_CTX md_ctx; + EVP_MD_CTX i_ctx; + EVP_MD_CTX o_ctx; + unsigned int key_length; + unsigned char key[HMAC_MAX_MD_CBLOCK]; +} HMAC_CTX; +*) + +const + HMAC_MAX_MD_CBLOCK = 128; {largest known is SHA512} + +type + PHMAC_CTX = ^HMAC_CTX; + HMAC_CTX = record + md: EVP_MD; + md_ctx: EVP_MD_CTX; + i_ctx: EVP_MD_CTX; + o_ctx: EVP_MD_CTX; + key_length: TIdC_UINT; + key: array [0..HMAC_MAX_MD_CBLOCK] of char; + end; + + +function FC_HMAC_size(const e: PHMAC_CTX): TIdC_SIZET; cdecl; +begin + Result := EVP_MD_size(e^.md); +end; + +{/forward_compatibility} +{$WARN NO_RETVAL OFF} +procedure ERR_HMAC_CTX_init(ctx : PHMAC_CTX); +begin + EIdAPIFunctionNotPresent.RaiseException(HMAC_CTX_init_procname); +end; + + +function ERR_HMAC_size(const e: PHMAC_CTX): TIdC_SIZET; +begin + EIdAPIFunctionNotPresent.RaiseException(HMAC_size_procname); +end; + + {introduced 1.1.0} +function ERR_HMAC_CTX_new: PHMAC_CTX; +begin + EIdAPIFunctionNotPresent.RaiseException(HMAC_CTX_new_procname); +end; + + {introduced 1.1.0} +function ERR_HMAC_CTX_reset(ctx: PHMAC_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(HMAC_CTX_reset_procname); +end; + + {introduced 1.1.0} +procedure ERR_HMAC_CTX_cleanup(ctx : PHMAC_CTX); +begin + EIdAPIFunctionNotPresent.RaiseException(HMAC_CTX_cleanup_procname); +end; + + +procedure ERR_HMAC_CTX_free(ctx: PHMAC_CTX); +begin + EIdAPIFunctionNotPresent.RaiseException(HMAC_CTX_free_procname); +end; + + {introduced 1.1.0} + +function ERR_HMAC_Init_ex(ctx: PHMAC_CTX; const key: Pointer; len: TIdC_INT; const md: PEVP_MD; impl: PENGINE): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(HMAC_Init_ex_procname); +end; + + +function ERR_HMAC_Update(ctx: PHMAC_CTX; const data: PByte; len: TIdC_SIZET): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(HMAC_Update_procname); +end; + + +function ERR_HMAC_Final(ctx: PHMAC_CTX; md: PByte; len: PByte): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(HMAC_Final_procname); +end; + + +function ERR_HMAC(const evp_md: PEVP_MD; const key: Pointer; key_len: TIdC_INT; const d: PByte; n: TIdC_SIZET; md: PByte; md_len: PIdC_INT): PByte; +begin + EIdAPIFunctionNotPresent.RaiseException(HMAC_procname); +end; + + +function ERR_HMAC_CTX_copy(dctx: PHMAC_CTX; sctx: PHMAC_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(HMAC_CTX_copy_procname); +end; + + + +procedure ERR_HMAC_CTX_set_flags(ctx: PHMAC_CTX; flags: TIdC_ULONG); +begin + EIdAPIFunctionNotPresent.RaiseException(HMAC_CTX_set_flags_procname); +end; + + +function ERR_HMAC_CTX_get_md(const ctx: PHMAC_CTX): PEVP_MD; +begin + EIdAPIFunctionNotPresent.RaiseException(HMAC_CTX_get_md_procname); +end; + + {introduced 1.1.0} + +{$WARN NO_RETVAL ON} + +procedure Load(const ADllHandle: TIdLibHandle; LibVersion: TIdC_UINT; const AFailed: TStringList); + +var FuncLoadError: boolean; + +begin + HMAC_CTX_init := LoadLibFunction(ADllHandle, HMAC_CTX_init_procname); + FuncLoadError := not assigned(HMAC_CTX_init); + if FuncLoadError then + begin + {$if not defined(HMAC_CTX_init_allownil)} + HMAC_CTX_init := @ERR_HMAC_CTX_init; + {$ifend} + {$if declared(HMAC_CTX_init_introduced)} + if LibVersion < HMAC_CTX_init_introduced then + begin + {$if declared(FC_HMAC_CTX_init)} + HMAC_CTX_init := @FC_HMAC_CTX_init; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(HMAC_CTX_init_removed)} + if HMAC_CTX_init_removed <= LibVersion then + begin + {$if declared(_HMAC_CTX_init)} + HMAC_CTX_init := @_HMAC_CTX_init; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(HMAC_CTX_init_allownil)} + if FuncLoadError then + AFailed.Add('HMAC_CTX_init'); + {$ifend} + end; + + + HMAC_size := LoadLibFunction(ADllHandle, HMAC_size_procname); + FuncLoadError := not assigned(HMAC_size); + if FuncLoadError then + begin + {$if not defined(HMAC_size_allownil)} + HMAC_size := @ERR_HMAC_size; + {$ifend} + {$if declared(HMAC_size_introduced)} + if LibVersion < HMAC_size_introduced then + begin + {$if declared(FC_HMAC_size)} + HMAC_size := @FC_HMAC_size; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(HMAC_size_removed)} + if HMAC_size_removed <= LibVersion then + begin + {$if declared(_HMAC_size)} + HMAC_size := @_HMAC_size; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(HMAC_size_allownil)} + if FuncLoadError then + AFailed.Add('HMAC_size'); + {$ifend} + end; + + {introduced 1.1.0} + HMAC_CTX_new := LoadLibFunction(ADllHandle, HMAC_CTX_new_procname); + FuncLoadError := not assigned(HMAC_CTX_new); + if FuncLoadError then + begin + {$if not defined(HMAC_CTX_new_allownil)} + HMAC_CTX_new := @ERR_HMAC_CTX_new; + {$ifend} + {$if declared(HMAC_CTX_new_introduced)} + if LibVersion < HMAC_CTX_new_introduced then + begin + {$if declared(FC_HMAC_CTX_new)} + HMAC_CTX_new := @FC_HMAC_CTX_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(HMAC_CTX_new_removed)} + if HMAC_CTX_new_removed <= LibVersion then + begin + {$if declared(_HMAC_CTX_new)} + HMAC_CTX_new := @_HMAC_CTX_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(HMAC_CTX_new_allownil)} + if FuncLoadError then + AFailed.Add('HMAC_CTX_new'); + {$ifend} + end; + + {introduced 1.1.0} + HMAC_CTX_reset := LoadLibFunction(ADllHandle, HMAC_CTX_reset_procname); + FuncLoadError := not assigned(HMAC_CTX_reset); + if FuncLoadError then + begin + {$if not defined(HMAC_CTX_reset_allownil)} + HMAC_CTX_reset := @ERR_HMAC_CTX_reset; + {$ifend} + {$if declared(HMAC_CTX_reset_introduced)} + if LibVersion < HMAC_CTX_reset_introduced then + begin + {$if declared(FC_HMAC_CTX_reset)} + HMAC_CTX_reset := @FC_HMAC_CTX_reset; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(HMAC_CTX_reset_removed)} + if HMAC_CTX_reset_removed <= LibVersion then + begin + {$if declared(_HMAC_CTX_reset)} + HMAC_CTX_reset := @_HMAC_CTX_reset; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(HMAC_CTX_reset_allownil)} + if FuncLoadError then + AFailed.Add('HMAC_CTX_reset'); + {$ifend} + end; + + {introduced 1.1.0} + HMAC_CTX_cleanup := LoadLibFunction(ADllHandle, HMAC_CTX_cleanup_procname); + FuncLoadError := not assigned(HMAC_CTX_cleanup); + if FuncLoadError then + begin + {$if not defined(HMAC_CTX_cleanup_allownil)} + HMAC_CTX_cleanup := @ERR_HMAC_CTX_cleanup; + {$ifend} + {$if declared(HMAC_CTX_cleanup_introduced)} + if LibVersion < HMAC_CTX_cleanup_introduced then + begin + {$if declared(FC_HMAC_CTX_cleanup)} + HMAC_CTX_cleanup := @FC_HMAC_CTX_cleanup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(HMAC_CTX_cleanup_removed)} + if HMAC_CTX_cleanup_removed <= LibVersion then + begin + {$if declared(_HMAC_CTX_cleanup)} + HMAC_CTX_cleanup := @_HMAC_CTX_cleanup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(HMAC_CTX_cleanup_allownil)} + if FuncLoadError then + AFailed.Add('HMAC_CTX_cleanup'); + {$ifend} + end; + + + HMAC_CTX_free := LoadLibFunction(ADllHandle, HMAC_CTX_free_procname); + FuncLoadError := not assigned(HMAC_CTX_free); + if FuncLoadError then + begin + {$if not defined(HMAC_CTX_free_allownil)} + HMAC_CTX_free := @ERR_HMAC_CTX_free; + {$ifend} + {$if declared(HMAC_CTX_free_introduced)} + if LibVersion < HMAC_CTX_free_introduced then + begin + {$if declared(FC_HMAC_CTX_free)} + HMAC_CTX_free := @FC_HMAC_CTX_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(HMAC_CTX_free_removed)} + if HMAC_CTX_free_removed <= LibVersion then + begin + {$if declared(_HMAC_CTX_free)} + HMAC_CTX_free := @_HMAC_CTX_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(HMAC_CTX_free_allownil)} + if FuncLoadError then + AFailed.Add('HMAC_CTX_free'); + {$ifend} + end; + + {introduced 1.1.0} + HMAC_Init_ex := LoadLibFunction(ADllHandle, HMAC_Init_ex_procname); + FuncLoadError := not assigned(HMAC_Init_ex); + if FuncLoadError then + begin + {$if not defined(HMAC_Init_ex_allownil)} + HMAC_Init_ex := @ERR_HMAC_Init_ex; + {$ifend} + {$if declared(HMAC_Init_ex_introduced)} + if LibVersion < HMAC_Init_ex_introduced then + begin + {$if declared(FC_HMAC_Init_ex)} + HMAC_Init_ex := @FC_HMAC_Init_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(HMAC_Init_ex_removed)} + if HMAC_Init_ex_removed <= LibVersion then + begin + {$if declared(_HMAC_Init_ex)} + HMAC_Init_ex := @_HMAC_Init_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(HMAC_Init_ex_allownil)} + if FuncLoadError then + AFailed.Add('HMAC_Init_ex'); + {$ifend} + end; + + + HMAC_Update := LoadLibFunction(ADllHandle, HMAC_Update_procname); + FuncLoadError := not assigned(HMAC_Update); + if FuncLoadError then + begin + {$if not defined(HMAC_Update_allownil)} + HMAC_Update := @ERR_HMAC_Update; + {$ifend} + {$if declared(HMAC_Update_introduced)} + if LibVersion < HMAC_Update_introduced then + begin + {$if declared(FC_HMAC_Update)} + HMAC_Update := @FC_HMAC_Update; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(HMAC_Update_removed)} + if HMAC_Update_removed <= LibVersion then + begin + {$if declared(_HMAC_Update)} + HMAC_Update := @_HMAC_Update; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(HMAC_Update_allownil)} + if FuncLoadError then + AFailed.Add('HMAC_Update'); + {$ifend} + end; + + + HMAC_Final := LoadLibFunction(ADllHandle, HMAC_Final_procname); + FuncLoadError := not assigned(HMAC_Final); + if FuncLoadError then + begin + {$if not defined(HMAC_Final_allownil)} + HMAC_Final := @ERR_HMAC_Final; + {$ifend} + {$if declared(HMAC_Final_introduced)} + if LibVersion < HMAC_Final_introduced then + begin + {$if declared(FC_HMAC_Final)} + HMAC_Final := @FC_HMAC_Final; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(HMAC_Final_removed)} + if HMAC_Final_removed <= LibVersion then + begin + {$if declared(_HMAC_Final)} + HMAC_Final := @_HMAC_Final; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(HMAC_Final_allownil)} + if FuncLoadError then + AFailed.Add('HMAC_Final'); + {$ifend} + end; + + + HMAC := LoadLibFunction(ADllHandle, HMAC_procname); + FuncLoadError := not assigned(HMAC); + if FuncLoadError then + begin + {$if not defined(HMAC_allownil)} + HMAC := @ERR_HMAC; + {$ifend} + {$if declared(HMAC_introduced)} + if LibVersion < HMAC_introduced then + begin + {$if declared(FC_HMAC)} + HMAC := @FC_HMAC; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(HMAC_removed)} + if HMAC_removed <= LibVersion then + begin + {$if declared(_HMAC)} + HMAC := @_HMAC; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(HMAC_allownil)} + if FuncLoadError then + AFailed.Add('HMAC'); + {$ifend} + end; + + + HMAC_CTX_copy := LoadLibFunction(ADllHandle, HMAC_CTX_copy_procname); + FuncLoadError := not assigned(HMAC_CTX_copy); + if FuncLoadError then + begin + {$if not defined(HMAC_CTX_copy_allownil)} + HMAC_CTX_copy := @ERR_HMAC_CTX_copy; + {$ifend} + {$if declared(HMAC_CTX_copy_introduced)} + if LibVersion < HMAC_CTX_copy_introduced then + begin + {$if declared(FC_HMAC_CTX_copy)} + HMAC_CTX_copy := @FC_HMAC_CTX_copy; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(HMAC_CTX_copy_removed)} + if HMAC_CTX_copy_removed <= LibVersion then + begin + {$if declared(_HMAC_CTX_copy)} + HMAC_CTX_copy := @_HMAC_CTX_copy; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(HMAC_CTX_copy_allownil)} + if FuncLoadError then + AFailed.Add('HMAC_CTX_copy'); + {$ifend} + end; + + + HMAC_CTX_set_flags := LoadLibFunction(ADllHandle, HMAC_CTX_set_flags_procname); + FuncLoadError := not assigned(HMAC_CTX_set_flags); + if FuncLoadError then + begin + {$if not defined(HMAC_CTX_set_flags_allownil)} + HMAC_CTX_set_flags := @ERR_HMAC_CTX_set_flags; + {$ifend} + {$if declared(HMAC_CTX_set_flags_introduced)} + if LibVersion < HMAC_CTX_set_flags_introduced then + begin + {$if declared(FC_HMAC_CTX_set_flags)} + HMAC_CTX_set_flags := @FC_HMAC_CTX_set_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(HMAC_CTX_set_flags_removed)} + if HMAC_CTX_set_flags_removed <= LibVersion then + begin + {$if declared(_HMAC_CTX_set_flags)} + HMAC_CTX_set_flags := @_HMAC_CTX_set_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(HMAC_CTX_set_flags_allownil)} + if FuncLoadError then + AFailed.Add('HMAC_CTX_set_flags'); + {$ifend} + end; + + + HMAC_CTX_get_md := LoadLibFunction(ADllHandle, HMAC_CTX_get_md_procname); + FuncLoadError := not assigned(HMAC_CTX_get_md); + if FuncLoadError then + begin + {$if not defined(HMAC_CTX_get_md_allownil)} + HMAC_CTX_get_md := @ERR_HMAC_CTX_get_md; + {$ifend} + {$if declared(HMAC_CTX_get_md_introduced)} + if LibVersion < HMAC_CTX_get_md_introduced then + begin + {$if declared(FC_HMAC_CTX_get_md)} + HMAC_CTX_get_md := @FC_HMAC_CTX_get_md; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(HMAC_CTX_get_md_removed)} + if HMAC_CTX_get_md_removed <= LibVersion then + begin + {$if declared(_HMAC_CTX_get_md)} + HMAC_CTX_get_md := @_HMAC_CTX_get_md; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(HMAC_CTX_get_md_allownil)} + if FuncLoadError then + AFailed.Add('HMAC_CTX_get_md'); + {$ifend} + end; + + {introduced 1.1.0} +end; + +procedure Unload; +begin + HMAC_CTX_init := nil; {removed 1.1.0} + HMAC_size := nil; {introduced 1.1.0} + HMAC_CTX_new := nil; {introduced 1.1.0} + HMAC_CTX_reset := nil; {introduced 1.1.0} + HMAC_CTX_cleanup := nil; {removed 1.1.0} + HMAC_CTX_free := nil; {introduced 1.1.0} + HMAC_Init_ex := nil; + HMAC_Update := nil; + HMAC_Final := nil; + HMAC := nil; + HMAC_CTX_copy := nil; + HMAC_CTX_set_flags := nil; + HMAC_CTX_get_md := nil; {introduced 1.1.0} +end; +{$ELSE} +{$ENDIF} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +initialization + Register_SSLLoader(@Load,'LibCrypto'); + Register_SSLUnloader(@Unload); +{$ENDIF} +end. diff --git a/IdOpenSSLHeaders_idea.pas b/IdOpenSSLHeaders_idea.pas new file mode 100644 index 0000000..24f1a2b --- /dev/null +++ b/IdOpenSSLHeaders_idea.pas @@ -0,0 +1,458 @@ + (* This unit was generated using the script genOpenSSLHdrs.sh from the source file IdOpenSSLHeaders_idea.h2pas + It should not be modified directly. All changes should be made to IdOpenSSLHeaders_idea.h2pas + and this file regenerated. IdOpenSSLHeaders_idea.h2pas is distributed with the full Indy + Distribution. + *) + +{$i IdCompilerDefines.inc} +{$i IdSSLOpenSSLDefines.inc} +{$IFNDEF USE_OPENSSL} + { error Should not compile if USE_OPENSSL is not defined!!!} +{$ENDIF} +{******************************************************************************} +{ } +{ Indy (Internet Direct) - Internet Protocols Simplified } +{ } +{ https://www.indyproject.org/ } +{ https://gitter.im/IndySockets/Indy } +{ } +{******************************************************************************} +{ } +{ This file is part of the Indy (Internet Direct) project, and is offered } +{ under the dual-licensing agreement described on the Indy website. } +{ (https://www.indyproject.org/license/) } +{ } +{ Copyright: } +{ (c) 1993-2020, Chad Z. Hower and the Indy Pit Crew. All rights reserved. } +{ } +{******************************************************************************} +{ } +{ } +{******************************************************************************} + +unit IdOpenSSLHeaders_idea; + +interface + +// Headers for OpenSSL 1.1.1 +// idea.h + + +uses + IdCTypes, + IdGlobal, + IdSSLOpenSSLConsts; + +const + // Added '_CONST' to avoid name clashes + IDEA_ENCRYPT_CONST = 1; + // Added '_CONST' to avoid name clashes + IDEA_DECRYPT_CONST = 0; + + IDEA_BLOCK = 8; + IDEA_KEY_LENGTH = 16; + +type + IDEA_INT = type TIdC_INT; + + idea_key_st = record + data: array[0..8, 0..5] of IDEA_INT; + end; + IDEA_KEY_SCHEDULE = idea_key_st; + PIDEA_KEY_SCHEDULE = ^IDEA_KEY_SCHEDULE; + + { The EXTERNALSYM directive is ignored by FPC, however, it is used by Delphi as follows: + + The EXTERNALSYM directive prevents the specified Delphi symbol from appearing in header + files generated for C++. } + + {$EXTERNALSYM IDEA_options} + {$EXTERNALSYM IDEA_ecb_encrypt} + {$EXTERNALSYM IDEA_set_encrypt_key} + {$EXTERNALSYM IDEA_set_decrypt_key} + {$EXTERNALSYM IDEA_cbc_encrypt} + {$EXTERNALSYM IDEA_cfb64_encrypt} + {$EXTERNALSYM IDEA_ofb64_encrypt} + {$EXTERNALSYM IDEA_encrypt} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +var + IDEA_options: function : PIdAnsiChar; cdecl = nil; + IDEA_ecb_encrypt: procedure (const in_: PByte; out_: PByte; ks: PIDEA_KEY_SCHEDULE); cdecl = nil; + IDEA_set_encrypt_key: procedure (const key: PByte; ks: PIDEA_KEY_SCHEDULE); cdecl = nil; + IDEA_set_decrypt_key: procedure (ek: PIDEA_KEY_SCHEDULE; dk: PIDEA_KEY_SCHEDULE); cdecl = nil; + IDEA_cbc_encrypt: procedure (const in_: PByte; out_: PByte; length: TIdC_LONG; ks: PIDEA_KEY_SCHEDULE; iv: PByte; enc: TIdC_INT); cdecl = nil; + IDEA_cfb64_encrypt: procedure (const in_: PByte; out_: PByte; length: TIdC_LONG; ks: PIDEA_KEY_SCHEDULE; iv: PByte; num: PIdC_INT; enc: TIdC_INT); cdecl = nil; + IDEA_ofb64_encrypt: procedure (const in_: PByte; out_: PByte; length: TIdC_LONG; ks: PIDEA_KEY_SCHEDULE; iv: PByte; num: PIdC_INT); cdecl = nil; + IDEA_encrypt: procedure (in_: PIdC_LONG; ks: PIDEA_KEY_SCHEDULE); cdecl = nil; + +{$ELSE} + function IDEA_options: PIdAnsiChar cdecl; external CLibCrypto; + procedure IDEA_ecb_encrypt(const in_: PByte; out_: PByte; ks: PIDEA_KEY_SCHEDULE) cdecl; external CLibCrypto; + procedure IDEA_set_encrypt_key(const key: PByte; ks: PIDEA_KEY_SCHEDULE) cdecl; external CLibCrypto; + procedure IDEA_set_decrypt_key(ek: PIDEA_KEY_SCHEDULE; dk: PIDEA_KEY_SCHEDULE) cdecl; external CLibCrypto; + procedure IDEA_cbc_encrypt(const in_: PByte; out_: PByte; length: TIdC_LONG; ks: PIDEA_KEY_SCHEDULE; iv: PByte; enc: TIdC_INT) cdecl; external CLibCrypto; + procedure IDEA_cfb64_encrypt(const in_: PByte; out_: PByte; length: TIdC_LONG; ks: PIDEA_KEY_SCHEDULE; iv: PByte; num: PIdC_INT; enc: TIdC_INT) cdecl; external CLibCrypto; + procedure IDEA_ofb64_encrypt(const in_: PByte; out_: PByte; length: TIdC_LONG; ks: PIDEA_KEY_SCHEDULE; iv: PByte; num: PIdC_INT) cdecl; external CLibCrypto; + procedure IDEA_encrypt(in_: PIdC_LONG; ks: PIDEA_KEY_SCHEDULE) cdecl; external CLibCrypto; + +{$ENDIF} + +implementation + + uses + classes, + IdSSLOpenSSLExceptionHandlers, + IdResourceStringsOpenSSL + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + ,IdSSLOpenSSLLoader + {$ENDIF}; + + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +const + IDEA_options_procname = 'IDEA_options'; + IDEA_ecb_encrypt_procname = 'IDEA_ecb_encrypt'; + IDEA_set_encrypt_key_procname = 'IDEA_set_encrypt_key'; + IDEA_set_decrypt_key_procname = 'IDEA_set_decrypt_key'; + IDEA_cbc_encrypt_procname = 'IDEA_cbc_encrypt'; + IDEA_cfb64_encrypt_procname = 'IDEA_cfb64_encrypt'; + IDEA_ofb64_encrypt_procname = 'IDEA_ofb64_encrypt'; + IDEA_encrypt_procname = 'IDEA_encrypt'; + + +{$WARN NO_RETVAL OFF} +function ERR_IDEA_options: PIdAnsiChar; +begin + EIdAPIFunctionNotPresent.RaiseException(IDEA_options_procname); +end; + + +procedure ERR_IDEA_ecb_encrypt(const in_: PByte; out_: PByte; ks: PIDEA_KEY_SCHEDULE); +begin + EIdAPIFunctionNotPresent.RaiseException(IDEA_ecb_encrypt_procname); +end; + + +procedure ERR_IDEA_set_encrypt_key(const key: PByte; ks: PIDEA_KEY_SCHEDULE); +begin + EIdAPIFunctionNotPresent.RaiseException(IDEA_set_encrypt_key_procname); +end; + + +procedure ERR_IDEA_set_decrypt_key(ek: PIDEA_KEY_SCHEDULE; dk: PIDEA_KEY_SCHEDULE); +begin + EIdAPIFunctionNotPresent.RaiseException(IDEA_set_decrypt_key_procname); +end; + + +procedure ERR_IDEA_cbc_encrypt(const in_: PByte; out_: PByte; length: TIdC_LONG; ks: PIDEA_KEY_SCHEDULE; iv: PByte; enc: TIdC_INT); +begin + EIdAPIFunctionNotPresent.RaiseException(IDEA_cbc_encrypt_procname); +end; + + +procedure ERR_IDEA_cfb64_encrypt(const in_: PByte; out_: PByte; length: TIdC_LONG; ks: PIDEA_KEY_SCHEDULE; iv: PByte; num: PIdC_INT; enc: TIdC_INT); +begin + EIdAPIFunctionNotPresent.RaiseException(IDEA_cfb64_encrypt_procname); +end; + + +procedure ERR_IDEA_ofb64_encrypt(const in_: PByte; out_: PByte; length: TIdC_LONG; ks: PIDEA_KEY_SCHEDULE; iv: PByte; num: PIdC_INT); +begin + EIdAPIFunctionNotPresent.RaiseException(IDEA_ofb64_encrypt_procname); +end; + + +procedure ERR_IDEA_encrypt(in_: PIdC_LONG; ks: PIDEA_KEY_SCHEDULE); +begin + EIdAPIFunctionNotPresent.RaiseException(IDEA_encrypt_procname); +end; + + + +{$WARN NO_RETVAL ON} + +procedure Load(const ADllHandle: TIdLibHandle; LibVersion: TIdC_UINT; const AFailed: TStringList); + +var FuncLoadError: boolean; + +begin + IDEA_options := LoadLibFunction(ADllHandle, IDEA_options_procname); + FuncLoadError := not assigned(IDEA_options); + if FuncLoadError then + begin + {$if not defined(IDEA_options_allownil)} + IDEA_options := @ERR_IDEA_options; + {$ifend} + {$if declared(IDEA_options_introduced)} + if LibVersion < IDEA_options_introduced then + begin + {$if declared(FC_IDEA_options)} + IDEA_options := @FC_IDEA_options; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(IDEA_options_removed)} + if IDEA_options_removed <= LibVersion then + begin + {$if declared(_IDEA_options)} + IDEA_options := @_IDEA_options; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(IDEA_options_allownil)} + if FuncLoadError then + AFailed.Add('IDEA_options'); + {$ifend} + end; + + + IDEA_ecb_encrypt := LoadLibFunction(ADllHandle, IDEA_ecb_encrypt_procname); + FuncLoadError := not assigned(IDEA_ecb_encrypt); + if FuncLoadError then + begin + {$if not defined(IDEA_ecb_encrypt_allownil)} + IDEA_ecb_encrypt := @ERR_IDEA_ecb_encrypt; + {$ifend} + {$if declared(IDEA_ecb_encrypt_introduced)} + if LibVersion < IDEA_ecb_encrypt_introduced then + begin + {$if declared(FC_IDEA_ecb_encrypt)} + IDEA_ecb_encrypt := @FC_IDEA_ecb_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(IDEA_ecb_encrypt_removed)} + if IDEA_ecb_encrypt_removed <= LibVersion then + begin + {$if declared(_IDEA_ecb_encrypt)} + IDEA_ecb_encrypt := @_IDEA_ecb_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(IDEA_ecb_encrypt_allownil)} + if FuncLoadError then + AFailed.Add('IDEA_ecb_encrypt'); + {$ifend} + end; + + + IDEA_set_encrypt_key := LoadLibFunction(ADllHandle, IDEA_set_encrypt_key_procname); + FuncLoadError := not assigned(IDEA_set_encrypt_key); + if FuncLoadError then + begin + {$if not defined(IDEA_set_encrypt_key_allownil)} + IDEA_set_encrypt_key := @ERR_IDEA_set_encrypt_key; + {$ifend} + {$if declared(IDEA_set_encrypt_key_introduced)} + if LibVersion < IDEA_set_encrypt_key_introduced then + begin + {$if declared(FC_IDEA_set_encrypt_key)} + IDEA_set_encrypt_key := @FC_IDEA_set_encrypt_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(IDEA_set_encrypt_key_removed)} + if IDEA_set_encrypt_key_removed <= LibVersion then + begin + {$if declared(_IDEA_set_encrypt_key)} + IDEA_set_encrypt_key := @_IDEA_set_encrypt_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(IDEA_set_encrypt_key_allownil)} + if FuncLoadError then + AFailed.Add('IDEA_set_encrypt_key'); + {$ifend} + end; + + + IDEA_set_decrypt_key := LoadLibFunction(ADllHandle, IDEA_set_decrypt_key_procname); + FuncLoadError := not assigned(IDEA_set_decrypt_key); + if FuncLoadError then + begin + {$if not defined(IDEA_set_decrypt_key_allownil)} + IDEA_set_decrypt_key := @ERR_IDEA_set_decrypt_key; + {$ifend} + {$if declared(IDEA_set_decrypt_key_introduced)} + if LibVersion < IDEA_set_decrypt_key_introduced then + begin + {$if declared(FC_IDEA_set_decrypt_key)} + IDEA_set_decrypt_key := @FC_IDEA_set_decrypt_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(IDEA_set_decrypt_key_removed)} + if IDEA_set_decrypt_key_removed <= LibVersion then + begin + {$if declared(_IDEA_set_decrypt_key)} + IDEA_set_decrypt_key := @_IDEA_set_decrypt_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(IDEA_set_decrypt_key_allownil)} + if FuncLoadError then + AFailed.Add('IDEA_set_decrypt_key'); + {$ifend} + end; + + + IDEA_cbc_encrypt := LoadLibFunction(ADllHandle, IDEA_cbc_encrypt_procname); + FuncLoadError := not assigned(IDEA_cbc_encrypt); + if FuncLoadError then + begin + {$if not defined(IDEA_cbc_encrypt_allownil)} + IDEA_cbc_encrypt := @ERR_IDEA_cbc_encrypt; + {$ifend} + {$if declared(IDEA_cbc_encrypt_introduced)} + if LibVersion < IDEA_cbc_encrypt_introduced then + begin + {$if declared(FC_IDEA_cbc_encrypt)} + IDEA_cbc_encrypt := @FC_IDEA_cbc_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(IDEA_cbc_encrypt_removed)} + if IDEA_cbc_encrypt_removed <= LibVersion then + begin + {$if declared(_IDEA_cbc_encrypt)} + IDEA_cbc_encrypt := @_IDEA_cbc_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(IDEA_cbc_encrypt_allownil)} + if FuncLoadError then + AFailed.Add('IDEA_cbc_encrypt'); + {$ifend} + end; + + + IDEA_cfb64_encrypt := LoadLibFunction(ADllHandle, IDEA_cfb64_encrypt_procname); + FuncLoadError := not assigned(IDEA_cfb64_encrypt); + if FuncLoadError then + begin + {$if not defined(IDEA_cfb64_encrypt_allownil)} + IDEA_cfb64_encrypt := @ERR_IDEA_cfb64_encrypt; + {$ifend} + {$if declared(IDEA_cfb64_encrypt_introduced)} + if LibVersion < IDEA_cfb64_encrypt_introduced then + begin + {$if declared(FC_IDEA_cfb64_encrypt)} + IDEA_cfb64_encrypt := @FC_IDEA_cfb64_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(IDEA_cfb64_encrypt_removed)} + if IDEA_cfb64_encrypt_removed <= LibVersion then + begin + {$if declared(_IDEA_cfb64_encrypt)} + IDEA_cfb64_encrypt := @_IDEA_cfb64_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(IDEA_cfb64_encrypt_allownil)} + if FuncLoadError then + AFailed.Add('IDEA_cfb64_encrypt'); + {$ifend} + end; + + + IDEA_ofb64_encrypt := LoadLibFunction(ADllHandle, IDEA_ofb64_encrypt_procname); + FuncLoadError := not assigned(IDEA_ofb64_encrypt); + if FuncLoadError then + begin + {$if not defined(IDEA_ofb64_encrypt_allownil)} + IDEA_ofb64_encrypt := @ERR_IDEA_ofb64_encrypt; + {$ifend} + {$if declared(IDEA_ofb64_encrypt_introduced)} + if LibVersion < IDEA_ofb64_encrypt_introduced then + begin + {$if declared(FC_IDEA_ofb64_encrypt)} + IDEA_ofb64_encrypt := @FC_IDEA_ofb64_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(IDEA_ofb64_encrypt_removed)} + if IDEA_ofb64_encrypt_removed <= LibVersion then + begin + {$if declared(_IDEA_ofb64_encrypt)} + IDEA_ofb64_encrypt := @_IDEA_ofb64_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(IDEA_ofb64_encrypt_allownil)} + if FuncLoadError then + AFailed.Add('IDEA_ofb64_encrypt'); + {$ifend} + end; + + + IDEA_encrypt := LoadLibFunction(ADllHandle, IDEA_encrypt_procname); + FuncLoadError := not assigned(IDEA_encrypt); + if FuncLoadError then + begin + {$if not defined(IDEA_encrypt_allownil)} + IDEA_encrypt := @ERR_IDEA_encrypt; + {$ifend} + {$if declared(IDEA_encrypt_introduced)} + if LibVersion < IDEA_encrypt_introduced then + begin + {$if declared(FC_IDEA_encrypt)} + IDEA_encrypt := @FC_IDEA_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(IDEA_encrypt_removed)} + if IDEA_encrypt_removed <= LibVersion then + begin + {$if declared(_IDEA_encrypt)} + IDEA_encrypt := @_IDEA_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(IDEA_encrypt_allownil)} + if FuncLoadError then + AFailed.Add('IDEA_encrypt'); + {$ifend} + end; + + +end; + +procedure Unload; +begin + IDEA_options := nil; + IDEA_ecb_encrypt := nil; + IDEA_set_encrypt_key := nil; + IDEA_set_decrypt_key := nil; + IDEA_cbc_encrypt := nil; + IDEA_cfb64_encrypt := nil; + IDEA_ofb64_encrypt := nil; + IDEA_encrypt := nil; +end; +{$ELSE} +{$ENDIF} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +initialization + Register_SSLLoader(@Load,'LibCrypto'); + Register_SSLUnloader(@Unload); +{$ENDIF} +end. diff --git a/IdOpenSSLHeaders_kdferr.pas b/IdOpenSSLHeaders_kdferr.pas new file mode 100644 index 0000000..a0f8ea9 --- /dev/null +++ b/IdOpenSSLHeaders_kdferr.pas @@ -0,0 +1,172 @@ + (* This unit was generated using the script genOpenSSLHdrs.sh from the source file IdOpenSSLHeaders_kdferr.h2pas + It should not be modified directly. All changes should be made to IdOpenSSLHeaders_kdferr.h2pas + and this file regenerated. IdOpenSSLHeaders_kdferr.h2pas is distributed with the full Indy + Distribution. + *) + +{$i IdCompilerDefines.inc} +{$i IdSSLOpenSSLDefines.inc} +{$IFNDEF USE_OPENSSL} + { error Should not compile if USE_OPENSSL is not defined!!!} +{$ENDIF} +{******************************************************************************} +{ } +{ Indy (Internet Direct) - Internet Protocols Simplified } +{ } +{ https://www.indyproject.org/ } +{ https://gitter.im/IndySockets/Indy } +{ } +{******************************************************************************} +{ } +{ This file is part of the Indy (Internet Direct) project, and is offered } +{ under the dual-licensing agreement described on the Indy website. } +{ (https://www.indyproject.org/license/) } +{ } +{ Copyright: } +{ (c) 1993-2020, Chad Z. Hower and the Indy Pit Crew. All rights reserved. } +{ } +{******************************************************************************} +{ } +{ } +{******************************************************************************} + +unit IdOpenSSLHeaders_kdferr; + +interface + +// Headers for OpenSSL 1.1.1 +// kdferr.h + + +uses + IdCTypes, + IdGlobal, + IdSSLOpenSSLConsts; + +const + (* + * KDF function codes. + *) + KDF_F_PKEY_HKDF_CTRL_STR = 103; + KDF_F_PKEY_HKDF_DERIVE = 102; + KDF_F_PKEY_HKDF_INIT = 108; + KDF_F_PKEY_SCRYPT_CTRL_STR = 104; + KDF_F_PKEY_SCRYPT_CTRL_UINT64 = 105; + KDF_F_PKEY_SCRYPT_DERIVE = 109; + KDF_F_PKEY_SCRYPT_INIT = 106; + KDF_F_PKEY_SCRYPT_SET_MEMBUF = 107; + KDF_F_PKEY_TLS1_PRF_CTRL_STR = 100; + KDF_F_PKEY_TLS1_PRF_DERIVE = 101; + KDF_F_PKEY_TLS1_PRF_INIT = 110; + KDF_F_TLS1_PRF_ALG = 111; + + (* + * KDF reason codes. + *) + KDF_R_INVALID_DIGEST = 100; + KDF_R_MISSING_ITERATION_COUNT = 109; + KDF_R_MISSING_KEY = 104; + KDF_R_MISSING_MESSAGE_DIGEST = 105; + KDF_R_MISSING_PARAMETER = 101; + KDF_R_MISSING_PASS = 110; + KDF_R_MISSING_SALT = 111; + KDF_R_MISSING_SECRET = 107; + KDF_R_MISSING_SEED = 106; + KDF_R_UNKNOWN_PARAMETER_TYPE = 103; + KDF_R_VALUE_ERROR = 108; + KDF_R_VALUE_MISSING = 102; + + { The EXTERNALSYM directive is ignored by FPC, however, it is used by Delphi as follows: + + The EXTERNALSYM directive prevents the specified Delphi symbol from appearing in header + files generated for C++. } + + {$EXTERNALSYM ERR_load_KDF_strings} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +var + ERR_load_KDF_strings: function : TIdC_INT; cdecl = nil; + +{$ELSE} + function ERR_load_KDF_strings: TIdC_INT cdecl; external CLibCrypto; + +{$ENDIF} + +implementation + + uses + classes, + IdSSLOpenSSLExceptionHandlers, + IdResourceStringsOpenSSL + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + ,IdSSLOpenSSLLoader + {$ENDIF}; + + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +const + ERR_load_KDF_strings_procname = 'ERR_load_KDF_strings'; + + +{$WARN NO_RETVAL OFF} +function ERR_ERR_load_KDF_strings: TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ERR_load_KDF_strings_procname); +end; + + + +{$WARN NO_RETVAL ON} + +procedure Load(const ADllHandle: TIdLibHandle; LibVersion: TIdC_UINT; const AFailed: TStringList); + +var FuncLoadError: boolean; + +begin + ERR_load_KDF_strings := LoadLibFunction(ADllHandle, ERR_load_KDF_strings_procname); + FuncLoadError := not assigned(ERR_load_KDF_strings); + if FuncLoadError then + begin + {$if not defined(ERR_load_KDF_strings_allownil)} + ERR_load_KDF_strings := @ERR_ERR_load_KDF_strings; + {$ifend} + {$if declared(ERR_load_KDF_strings_introduced)} + if LibVersion < ERR_load_KDF_strings_introduced then + begin + {$if declared(FC_ERR_load_KDF_strings)} + ERR_load_KDF_strings := @FC_ERR_load_KDF_strings; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ERR_load_KDF_strings_removed)} + if ERR_load_KDF_strings_removed <= LibVersion then + begin + {$if declared(_ERR_load_KDF_strings)} + ERR_load_KDF_strings := @_ERR_load_KDF_strings; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ERR_load_KDF_strings_allownil)} + if FuncLoadError then + AFailed.Add('ERR_load_KDF_strings'); + {$ifend} + end; + + +end; + +procedure Unload; +begin + ERR_load_KDF_strings := nil; +end; +{$ELSE} +{$ENDIF} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +initialization + Register_SSLLoader(@Load,'LibCrypto'); + Register_SSLUnloader(@Unload); +{$ENDIF} +end. diff --git a/IdOpenSSLHeaders_obj_mac.pas b/IdOpenSSLHeaders_obj_mac.pas new file mode 100644 index 0000000..c69b2fd --- /dev/null +++ b/IdOpenSSLHeaders_obj_mac.pas @@ -0,0 +1,4104 @@ + (* This unit was generated using the script genOpenSSLHdrs.sh from the source file IdOpenSSLHeaders_obj_mac.h2pas + It should not be modified directly. All changes should be made to IdOpenSSLHeaders_obj_mac.h2pas + and this file regenerated. IdOpenSSLHeaders_obj_mac.h2pas is distributed with the full Indy + Distribution. + *) + +{$i IdCompilerDefines.inc} +{$i IdSSLOpenSSLDefines.inc} +{$IFNDEF USE_OPENSSL} + { error Should not compile if USE_OPENSSL is not defined!!!} +{$ENDIF} +{******************************************************************************} +{ } +{ Indy (Internet Direct) - Internet Protocols Simplified } +{ } +{ https://www.indyproject.org/ } +{ https://gitter.im/IndySockets/Indy } +{ } +{******************************************************************************} +{ } +{ This file is part of the Indy (Internet Direct) project, and is offered } +{ under the dual-licensing agreement described on the Indy website. } +{ (https://www.indyproject.org/license/) } +{ } +{ Copyright: } +{ (c) 1993-2020, Chad Z. Hower and the Indy Pit Crew. All rights reserved. } +{ } +{******************************************************************************} +{ } +{ } +{******************************************************************************} + +unit IdOpenSSLHeaders_obj_mac; + +interface + +// Headers for OpenSSL 1.1.1 +// obj_mac.h + + +const + SN_undef = AnsiString('UNDEF'); + LN_undef = AnsiString('undefined'); + NID_undef = 0; + + SN_itu_t = AnsiString('ITU-T'); + LN_itu_t = AnsiString('itu-t'); + NID_itu_t = 645; + + NID_ccitt = 404; + + SN_iso = AnsiString('ISO'); + LN_iso = AnsiString('iso'); + NID_iso = 181; + + SN_joint_iso_itu_t = AnsiString('JOINT-ISO-ITU-T'); + LN_joint_iso_itu_t = AnsiString('joint-iso-itu-t'); + NID_joint_iso_itu_t = 646; + + NID_joint_iso_ccitt = 393; + + SN_member_body = AnsiString('member-body'); + LN_member_body = AnsiString('ISO Member Body'); + NID_member_body = 182; + + SN_identified_organization = AnsiString('identified-organization'); + NID_identified_organization = 676; + + SN_hmac_md5 = AnsiString('HMAC-MD5'); + LN_hmac_md5 = AnsiString('hmac-md5'); + NID_hmac_md5 = 780; + + SN_hmac_sha1 = AnsiString('HMAC-SHA1'); + LN_hmac_sha1 = AnsiString('hmac-sha1'); + NID_hmac_sha1 = 781; + + SN_x509ExtAdmission = AnsiString('x509ExtAdmission'); + LN_x509ExtAdmission = AnsiString('Professional Information or basis for Admission'); + NID_x509ExtAdmission = 1093; + + SN_certicom_arc = AnsiString('certicom-arc'); + NID_certicom_arc = 677; + + SN_ieee = AnsiString('ieee'); + NID_ieee = 1170; + + SN_ieee_siswg = AnsiString('ieee-siswg'); + LN_ieee_siswg = AnsiString('IEEE Security in Storage Working Group'); + NID_ieee_siswg = 1171; + + SN_international_organizations = AnsiString('international-organizations'); + LN_international_organizations = AnsiString('International Organizations'); + NID_international_organizations = 647; + + SN_wap = AnsiString('wap'); + NID_wap = 678; + + SN_wap_wsg = AnsiString('wap-wsg'); + NID_wap_wsg = 679; + + SN_selected_attribute_types = AnsiString('selected-attribute-types'); + LN_selected_attribute_types = AnsiString('Selected Attribute Types'); + NID_selected_attribute_types = 394; + + SN_clearance = AnsiString('clearance'); + NID_clearance = 395; + + SN_ISO_US = AnsiString('ISO-US'); + LN_ISO_US = AnsiString('ISO US Member Body'); + NID_ISO_US = 183; + + SN_X9_57 = AnsiString('X9-57'); + LN_X9_57 = AnsiString('X9.57'); + NID_X9_57 = 184; + + SN_X9cm = AnsiString('X9cm'); + LN_X9cm = AnsiString('X9.57 CM ?'); + NID_X9cm = 185; + + SN_ISO_CN = AnsiString('ISO-CN'); + LN_ISO_CN = AnsiString('ISO CN Member Body'); + NID_ISO_CN = 1140; + + SN_oscca = AnsiString('oscca'); + NID_oscca = 1141; + + SN_sm_scheme = AnsiString('sm-scheme'); + NID_sm_scheme = 1142; + + SN_dsa = AnsiString('DSA'); + LN_dsa = AnsiString('dsaEncryption'); + NID_dsa = 116; + + SN_dsaWithSHA1 = AnsiString('DSA-SHA1'); + LN_dsaWithSHA1 = AnsiString('dsaWithSHA1'); + NID_dsaWithSHA1 = 113; + + SN_ansi_X9_62 = AnsiString('ansi-X9-62'); + LN_ansi_X9_62 = AnsiString('ANSI X9.62'); + NID_ansi_X9_62 = 405; + + SN_X9_62_prime_field = AnsiString('prime-field'); + NID_X9_62_prime_field = 406; + + SN_X9_62_characteristic_two_field = AnsiString('characteristic-two-field'); + NID_X9_62_characteristic_two_field = 407; + + SN_X9_62_id_characteristic_two_basis = AnsiString('id-characteristic-two-basis'); + NID_X9_62_id_characteristic_two_basis = 680; + + SN_X9_62_onBasis = AnsiString('onBasis'); + NID_X9_62_onBasis = 681; + + SN_X9_62_tpBasis = AnsiString('tpBasis'); + NID_X9_62_tpBasis = 682; + + SN_X9_62_ppBasis = AnsiString('ppBasis'); + NID_X9_62_ppBasis = 683; + + SN_X9_62_id_ecPublicKey = AnsiString('id-ecPublicKey'); + NID_X9_62_id_ecPublicKey = 408; + + SN_X9_62_c2pnb163v1 = AnsiString('c2pnb163v1'); + NID_X9_62_c2pnb163v1 = 684; + + SN_X9_62_c2pnb163v2 = AnsiString('c2pnb163v2'); + NID_X9_62_c2pnb163v2 = 685; + + SN_X9_62_c2pnb163v3 = AnsiString('c2pnb163v3'); + NID_X9_62_c2pnb163v3 = 686; + + SN_X9_62_c2pnb176v1 = AnsiString('c2pnb176v1'); + NID_X9_62_c2pnb176v1 = 687; + + SN_X9_62_c2tnb191v1 = AnsiString('c2tnb191v1'); + NID_X9_62_c2tnb191v1 = 688; + + SN_X9_62_c2tnb191v2 = AnsiString('c2tnb191v2'); + NID_X9_62_c2tnb191v2 = 689; + + SN_X9_62_c2tnb191v3 = AnsiString('c2tnb191v3'); + NID_X9_62_c2tnb191v3 = 690; + + SN_X9_62_c2onb191v4 = AnsiString('c2onb191v4'); + NID_X9_62_c2onb191v4 = 691; + + SN_X9_62_c2onb191v5 = AnsiString('c2onb191v5'); + NID_X9_62_c2onb191v5 = 692; + + SN_X9_62_c2pnb208w1 = AnsiString('c2pnb208w1'); + NID_X9_62_c2pnb208w1 = 693; + + SN_X9_62_c2tnb239v1 = AnsiString('c2tnb239v1'); + NID_X9_62_c2tnb239v1 = 694; + + SN_X9_62_c2tnb239v2 = AnsiString('c2tnb239v2'); + NID_X9_62_c2tnb239v2 = 695; + + SN_X9_62_c2tnb239v3 = AnsiString('c2tnb239v3'); + NID_X9_62_c2tnb239v3 = 696; + + SN_X9_62_c2onb239v4 = AnsiString('c2onb239v4'); + NID_X9_62_c2onb239v4 = 697; + + SN_X9_62_c2onb239v5 = AnsiString('c2onb239v5'); + NID_X9_62_c2onb239v5 = 698; + + SN_X9_62_c2pnb272w1 = AnsiString('c2pnb272w1'); + NID_X9_62_c2pnb272w1 = 699; + + SN_X9_62_c2pnb304w1 = AnsiString('c2pnb304w1'); + NID_X9_62_c2pnb304w1 = 700; + + SN_X9_62_c2tnb359v1 = AnsiString('c2tnb359v1'); + NID_X9_62_c2tnb359v1 = 701; + + SN_X9_62_c2pnb368w1 = AnsiString('c2pnb368w1'); + NID_X9_62_c2pnb368w1 = 702; + + SN_X9_62_c2tnb431r1 = AnsiString('c2tnb431r1'); + NID_X9_62_c2tnb431r1 = 703; + + SN_X9_62_prime192v1 = AnsiString('prime192v1'); + NID_X9_62_prime192v1 = 409; + + SN_X9_62_prime192v2 = AnsiString('prime192v2'); + NID_X9_62_prime192v2 = 410; + + SN_X9_62_prime192v3 = AnsiString('prime192v3'); + NID_X9_62_prime192v3 = 411; + + SN_X9_62_prime239v1 = AnsiString('prime239v1'); + NID_X9_62_prime239v1 = 412; + + SN_X9_62_prime239v2 = AnsiString('prime239v2'); + NID_X9_62_prime239v2 = 413; + + SN_X9_62_prime239v3 = AnsiString('prime239v3'); + NID_X9_62_prime239v3 = 414; + + SN_X9_62_prime256v1 = AnsiString('prime256v1'); + NID_X9_62_prime256v1 = 415; + + SN_ecdsa_with_SHA1 = AnsiString('ecdsa-with-SHA1'); + NID_ecdsa_with_SHA1 = 416; + + SN_ecdsa_with_Recommended = AnsiString('ecdsa-with-Recommended'); + NID_ecdsa_with_Recommended = 791; + + SN_ecdsa_with_Specified = AnsiString('ecdsa-with-Specified'); + NID_ecdsa_with_Specified = 792; + + SN_ecdsa_with_SHA224 = AnsiString('ecdsa-with-SHA224'); + NID_ecdsa_with_SHA224 = 793; + + SN_ecdsa_with_SHA256 = AnsiString('ecdsa-with-SHA256'); + NID_ecdsa_with_SHA256 = 794; + + SN_ecdsa_with_SHA384 = AnsiString('ecdsa-with-SHA384'); + NID_ecdsa_with_SHA384 = 795; + + SN_ecdsa_with_SHA512 = AnsiString('ecdsa-with-SHA512'); + NID_ecdsa_with_SHA512 = 796; + + SN_secp112r1 = AnsiString('secp112r1'); + NID_secp112r1 = 704; + + SN_secp112r2 = AnsiString('secp112r2'); + NID_secp112r2 = 705; + + SN_secp128r1 = AnsiString('secp128r1'); + NID_secp128r1 = 706; + + SN_secp128r2 = AnsiString('secp128r2'); + NID_secp128r2 = 707; + + SN_secp160k1 = AnsiString('secp160k1'); + NID_secp160k1 = 708; + + SN_secp160r1 = AnsiString('secp160r1'); + NID_secp160r1 = 709; + + SN_secp160r2 = AnsiString('secp160r2'); + NID_secp160r2 = 710; + + SN_secp192k1 = AnsiString('secp192k1'); + NID_secp192k1 = 711; + + SN_secp224k1 = AnsiString('secp224k1'); + NID_secp224k1 = 712; + + SN_secp224r1 = AnsiString('secp224r1'); + NID_secp224r1 = 713; + + SN_secp256k1 = AnsiString('secp256k1'); + NID_secp256k1 = 714; + + SN_secp384r1 = AnsiString('secp384r1'); + NID_secp384r1 = 715; + + SN_secp521r1 = AnsiString('secp521r1'); + NID_secp521r1 = 716; + + SN_sect113r1 = AnsiString('sect113r1'); + NID_sect113r1 = 717; + + SN_sect113r2 = AnsiString('sect113r2'); + NID_sect113r2 = 718; + + SN_sect131r1 = AnsiString('sect131r1'); + NID_sect131r1 = 719; + + SN_sect131r2 = AnsiString('sect131r2'); + NID_sect131r2 = 720; + + SN_sect163k1 = AnsiString('sect163k1'); + NID_sect163k1 = 721; + + SN_sect163r1 = AnsiString('sect163r1'); + NID_sect163r1 = 722; + + SN_sect163r2 = AnsiString('sect163r2'); + NID_sect163r2 = 723; + + SN_sect193r1 = AnsiString('sect193r1'); + NID_sect193r1 = 724; + + SN_sect193r2 = AnsiString('sect193r2'); + NID_sect193r2 = 725; + + SN_sect233k1 = AnsiString('sect233k1'); + NID_sect233k1 = 726; + + SN_sect233r1 = AnsiString('sect233r1'); + NID_sect233r1 = 727; + + SN_sect239k1 = AnsiString('sect239k1'); + NID_sect239k1 = 728; + + SN_sect283k1 = AnsiString('sect283k1'); + NID_sect283k1 = 729; + + SN_sect283r1 = AnsiString('sect283r1'); + NID_sect283r1 = 730; + + SN_sect409k1 = AnsiString('sect409k1'); + NID_sect409k1 = 731; + + SN_sect409r1 = AnsiString('sect409r1'); + NID_sect409r1 = 732; + + SN_sect571k1 = AnsiString('sect571k1'); + NID_sect571k1 = 733; + + SN_sect571r1 = AnsiString('sect571r1'); + NID_sect571r1 = 734; + + SN_wap_wsg_idm_ecid_wtls1 = AnsiString('wap-wsg-idm-ecid-wtls1'); + NID_wap_wsg_idm_ecid_wtls1 = 735; + + SN_wap_wsg_idm_ecid_wtls3 = AnsiString('wap-wsg-idm-ecid-wtls3'); + NID_wap_wsg_idm_ecid_wtls3 = 736; + + SN_wap_wsg_idm_ecid_wtls4 = AnsiString('wap-wsg-idm-ecid-wtls4'); + NID_wap_wsg_idm_ecid_wtls4 = 737; + + SN_wap_wsg_idm_ecid_wtls5 = AnsiString('wap-wsg-idm-ecid-wtls5'); + NID_wap_wsg_idm_ecid_wtls5 = 738; + + SN_wap_wsg_idm_ecid_wtls6 = AnsiString('wap-wsg-idm-ecid-wtls6'); + NID_wap_wsg_idm_ecid_wtls6 = 739; + + SN_wap_wsg_idm_ecid_wtls7 = AnsiString('wap-wsg-idm-ecid-wtls7'); + NID_wap_wsg_idm_ecid_wtls7 = 740; + + SN_wap_wsg_idm_ecid_wtls8 = AnsiString('wap-wsg-idm-ecid-wtls8'); + NID_wap_wsg_idm_ecid_wtls8 = 741; + + SN_wap_wsg_idm_ecid_wtls9 = AnsiString('wap-wsg-idm-ecid-wtls9'); + NID_wap_wsg_idm_ecid_wtls9 = 742; + + SN_wap_wsg_idm_ecid_wtls10 = AnsiString('wap-wsg-idm-ecid-wtls10'); + NID_wap_wsg_idm_ecid_wtls10 = 743; + + SN_wap_wsg_idm_ecid_wtls11 = AnsiString('wap-wsg-idm-ecid-wtls11'); + NID_wap_wsg_idm_ecid_wtls11 = 744; + + SN_wap_wsg_idm_ecid_wtls12 = AnsiString('wap-wsg-idm-ecid-wtls12'); + NID_wap_wsg_idm_ecid_wtls12 = 745; + + SN_cast5_cbc = AnsiString('CAST5-CBC'); + LN_cast5_cbc = AnsiString('cast5-cbc'); + NID_cast5_cbc = 108; + + SN_cast5_ecb = AnsiString('CAST5-ECB'); + LN_cast5_ecb = AnsiString('cast5-ecb'); + NID_cast5_ecb = 109; + + SN_cast5_cfb64 = AnsiString('CAST5-CFB'); + LN_cast5_cfb64 = AnsiString('cast5-cfb'); + NID_cast5_cfb64 = 110; + + SN_cast5_ofb64 = AnsiString('CAST5-OFB'); + LN_cast5_ofb64 = AnsiString('cast5-ofb'); + NID_cast5_ofb64 = 111; + + LN_pbeWithMD5AndCast5_CBC = AnsiString('pbeWithMD5AndCast5CBC'); + NID_pbeWithMD5AndCast5_CBC = 112; + + SN_id_PasswordBasedMAC = AnsiString('id-PasswordBasedMAC'); + LN_id_PasswordBasedMAC = AnsiString('password based MAC'); + NID_id_PasswordBasedMAC = 782; + + SN_id_DHBasedMac = AnsiString('id-DHBasedMac'); + LN_id_DHBasedMac = AnsiString('Diffie-Hellman based MAC'); + NID_id_DHBasedMac = 783; + + SN_rsadsi = AnsiString('rsadsi'); + LN_rsadsi = AnsiString('RSA Data Security; Inc.'); + NID_rsadsi = 1; + + SN_pkcs = AnsiString('pkcs'); + LN_pkcs = AnsiString('RSA Data Security; Inc. PKCS'); + NID_pkcs = 2; + + SN_pkcs1 = AnsiString('pkcs1'); + NID_pkcs1 = 186; + + LN_rsaEncryption = AnsiString('rsaEncryption'); + NID_rsaEncryption = 6; + + SN_md2WithRSAEncryption = AnsiString('RSA-MD2'); + LN_md2WithRSAEncryption = AnsiString('md2WithRSAEncryption'); + NID_md2WithRSAEncryption = 7; + + SN_md4WithRSAEncryption = AnsiString('RSA-MD4'); + LN_md4WithRSAEncryption = AnsiString('md4WithRSAEncryption'); + NID_md4WithRSAEncryption = 396; + + SN_md5WithRSAEncryption = AnsiString('RSA-MD5'); + LN_md5WithRSAEncryption = AnsiString('md5WithRSAEncryption'); + NID_md5WithRSAEncryption = 8; + + SN_sha1WithRSAEncryption = AnsiString('RSA-SHA1'); + LN_sha1WithRSAEncryption = AnsiString('sha1WithRSAEncryption'); + NID_sha1WithRSAEncryption = 65; + + SN_rsaesOaep = AnsiString('RSAES-OAEP'); + LN_rsaesOaep = AnsiString('rsaesOaep'); + NID_rsaesOaep = 919; + + SN_mgf1 = AnsiString('MGF1'); + LN_mgf1 = AnsiString('mgf1'); + NID_mgf1 = 911; + + SN_pSpecified = AnsiString('PSPECIFIED'); + LN_pSpecified = AnsiString('pSpecified'); + NID_pSpecified = 935; + + SN_rsassaPss = AnsiString('RSASSA-PSS'); + LN_rsassaPss = AnsiString('rsassaPss'); + NID_rsassaPss = 912; + + SN_sha256WithRSAEncryption = AnsiString('RSA-SHA256'); + LN_sha256WithRSAEncryption = AnsiString('sha256WithRSAEncryption'); + NID_sha256WithRSAEncryption = 668; + + SN_sha384WithRSAEncryption = AnsiString('RSA-SHA384'); + LN_sha384WithRSAEncryption = AnsiString('sha384WithRSAEncryption'); + NID_sha384WithRSAEncryption = 669; + + SN_sha512WithRSAEncryption = AnsiString('RSA-SHA512'); + LN_sha512WithRSAEncryption = AnsiString('sha512WithRSAEncryption'); + NID_sha512WithRSAEncryption = 670; + + SN_sha224WithRSAEncryption = AnsiString('RSA-SHA224'); + LN_sha224WithRSAEncryption = AnsiString('sha224WithRSAEncryption'); + NID_sha224WithRSAEncryption = 671; + + SN_sha512_224WithRSAEncryption = AnsiString('RSA-SHA512/224'); + LN_sha512_224WithRSAEncryption = AnsiString('sha512-224WithRSAEncryption'); + NID_sha512_224WithRSAEncryption = 1145; + + SN_sha512_256WithRSAEncryption = AnsiString('RSA-SHA512/256'); + LN_sha512_256WithRSAEncryption = AnsiString('sha512-256WithRSAEncryption'); + NID_sha512_256WithRSAEncryption = 1146; + + SN_pkcs3 = AnsiString('pkcs3'); + NID_pkcs3 = 27; + + LN_dhKeyAgreement = AnsiString('dhKeyAgreement'); + NID_dhKeyAgreement = 28; + + SN_pkcs5 = AnsiString('pkcs5'); + NID_pkcs5 = 187; + + SN_pbeWithMD2AndDES_CBC = AnsiString('PBE-MD2-DES'); + LN_pbeWithMD2AndDES_CBC = AnsiString('pbeWithMD2AndDES-CBC'); + NID_pbeWithMD2AndDES_CBC = 9; + + SN_pbeWithMD5AndDES_CBC = AnsiString('PBE-MD5-DES'); + LN_pbeWithMD5AndDES_CBC = AnsiString('pbeWithMD5AndDES-CBC'); + NID_pbeWithMD5AndDES_CBC = 10; + + SN_pbeWithMD2AndRC2_CBC = AnsiString('PBE-MD2-RC2-64'); + LN_pbeWithMD2AndRC2_CBC = AnsiString('pbeWithMD2AndRC2-CBC'); + NID_pbeWithMD2AndRC2_CBC = 168; + + SN_pbeWithMD5AndRC2_CBC = AnsiString('PBE-MD5-RC2-64'); + LN_pbeWithMD5AndRC2_CBC = AnsiString('pbeWithMD5AndRC2-CBC'); + NID_pbeWithMD5AndRC2_CBC = 169; + + SN_pbeWithSHA1AndDES_CBC = AnsiString('PBE-SHA1-DES'); + LN_pbeWithSHA1AndDES_CBC = AnsiString('pbeWithSHA1AndDES-CBC'); + NID_pbeWithSHA1AndDES_CBC = 170; + + SN_pbeWithSHA1AndRC2_CBC = AnsiString('PBE-SHA1-RC2-64'); + LN_pbeWithSHA1AndRC2_CBC = AnsiString('pbeWithSHA1AndRC2-CBC'); + NID_pbeWithSHA1AndRC2_CBC = 68; + + LN_id_pbkdf2 = AnsiString('PBKDF2'); + NID_id_pbkdf2 = 69; + + LN_pbes2 = AnsiString('PBES2'); + NID_pbes2 = 161; + + LN_pbmac1 = AnsiString('PBMAC1'); + NID_pbmac1 = 162; + + SN_pkcs7 = AnsiString('pkcs7'); + NID_pkcs7 = 20; + + LN_pkcs7_data = AnsiString('pkcs7-data'); + NID_pkcs7_data = 21; + + LN_pkcs7_signed = AnsiString('pkcs7-signedData'); + NID_pkcs7_signed = 22; + + LN_pkcs7_enveloped = AnsiString('pkcs7-envelopedData'); + NID_pkcs7_enveloped = 23; + + LN_pkcs7_signedAndEnveloped = AnsiString('pkcs7-signedAndEnvelopedData'); + NID_pkcs7_signedAndEnveloped = 24; + + LN_pkcs7_digest = AnsiString('pkcs7-digestData'); + NID_pkcs7_digest = 25; + + LN_pkcs7_encrypted = AnsiString('pkcs7-encryptedData'); + NID_pkcs7_encrypted = 26; + + SN_pkcs9 = AnsiString('pkcs9'); + NID_pkcs9 = 47; + + LN_pkcs9_emailAddress = AnsiString('emailAddress'); + NID_pkcs9_emailAddress = 48; + + LN_pkcs9_unstructuredName = AnsiString('unstructuredName'); + NID_pkcs9_unstructuredName = 49; + + LN_pkcs9_contentType = AnsiString('contentType'); + NID_pkcs9_contentType = 50; + + LN_pkcs9_messageDigest = AnsiString('messageDigest'); + NID_pkcs9_messageDigest = 51; + + LN_pkcs9_signingTime = AnsiString('signingTime'); + NID_pkcs9_signingTime = 52; + + LN_pkcs9_countersignature = AnsiString('countersignature'); + NID_pkcs9_countersignature = 53; + + LN_pkcs9_challengePassword = AnsiString('challengePassword'); + NID_pkcs9_challengePassword = 54; + + LN_pkcs9_unstructuredAddress = AnsiString('unstructuredAddress'); + NID_pkcs9_unstructuredAddress = 55; + + LN_pkcs9_extCertAttributes = AnsiString('extendedCertificateAttributes'); + NID_pkcs9_extCertAttributes = 56; + + SN_ext_req = AnsiString('extReq'); + LN_ext_req = AnsiString('Extension Request'); + NID_ext_req = 172; + + SN_SMIMECapabilities = AnsiString('SMIME-CAPS'); + LN_SMIMECapabilities = AnsiString('S/MIME Capabilities'); + NID_SMIMECapabilities = 167; + + SN_SMIME = AnsiString('SMIME'); + LN_SMIME = AnsiString('S/MIME'); + NID_SMIME = 188; + + SN_id_smime_mod = AnsiString('id-smime-mod'); + NID_id_smime_mod = 189; + + SN_id_smime_ct = AnsiString('id-smime-ct'); + NID_id_smime_ct = 190; + + SN_id_smime_aa = AnsiString('id-smime-aa'); + NID_id_smime_aa = 191; + + SN_id_smime_alg = AnsiString('id-smime-alg'); + NID_id_smime_alg = 192; + + SN_id_smime_cd = AnsiString('id-smime-cd'); + NID_id_smime_cd = 193; + + SN_id_smime_spq = AnsiString('id-smime-spq'); + NID_id_smime_spq = 194; + + SN_id_smime_cti = AnsiString('id-smime-cti'); + NID_id_smime_cti = 195; + + SN_id_smime_mod_cms = AnsiString('id-smime-mod-cms'); + NID_id_smime_mod_cms = 196; + + SN_id_smime_mod_ess = AnsiString('id-smime-mod-ess'); + NID_id_smime_mod_ess = 197; + + SN_id_smime_mod_oid = AnsiString('id-smime-mod-oid'); + NID_id_smime_mod_oid = 198; + + SN_id_smime_mod_msg_v3 = AnsiString('id-smime-mod-msg-v3'); + NID_id_smime_mod_msg_v3 = 199; + + SN_id_smime_mod_ets_eSignature_88 = AnsiString('id-smime-mod-ets-eSignature-88'); + NID_id_smime_mod_ets_eSignature_88 = 200; + + SN_id_smime_mod_ets_eSignature_97 = AnsiString('id-smime-mod-ets-eSignature-97'); + NID_id_smime_mod_ets_eSignature_97 = 201; + + SN_id_smime_mod_ets_eSigPolicy_88 = AnsiString('id-smime-mod-ets-eSigPolicy-88'); + NID_id_smime_mod_ets_eSigPolicy_88 = 202; + + SN_id_smime_mod_ets_eSigPolicy_97 = AnsiString('id-smime-mod-ets-eSigPolicy-97'); + NID_id_smime_mod_ets_eSigPolicy_97 = 203; + + SN_id_smime_ct_receipt = AnsiString('id-smime-ct-receipt'); + NID_id_smime_ct_receipt = 204; + + SN_id_smime_ct_authData = AnsiString('id-smime-ct-authData'); + NID_id_smime_ct_authData = 205; + + SN_id_smime_ct_publishCert = AnsiString('id-smime-ct-publishCert'); + NID_id_smime_ct_publishCert = 206; + + SN_id_smime_ct_TSTInfo = AnsiString('id-smime-ct-TSTInfo'); + NID_id_smime_ct_TSTInfo = 207; + + SN_id_smime_ct_TDTInfo = AnsiString('id-smime-ct-TDTInfo'); + NID_id_smime_ct_TDTInfo = 208; + + SN_id_smime_ct_contentInfo = AnsiString('id-smime-ct-contentInfo'); + NID_id_smime_ct_contentInfo = 209; + + SN_id_smime_ct_DVCSRequestData = AnsiString('id-smime-ct-DVCSRequestData'); + NID_id_smime_ct_DVCSRequestData = 210; + + SN_id_smime_ct_DVCSResponseData = AnsiString('id-smime-ct-DVCSResponseData'); + NID_id_smime_ct_DVCSResponseData = 211; + + SN_id_smime_ct_compressedData = AnsiString('id-smime-ct-compressedData'); + NID_id_smime_ct_compressedData = 786; + + SN_id_smime_ct_contentCollection = AnsiString('id-smime-ct-contentCollection'); + NID_id_smime_ct_contentCollection = 1058; + + SN_id_smime_ct_authEnvelopedData = AnsiString('id-smime-ct-authEnvelopedData'); + NID_id_smime_ct_authEnvelopedData = 1059; + + SN_id_ct_asciiTextWithCRLF = AnsiString('id-ct-asciiTextWithCRLF'); + NID_id_ct_asciiTextWithCRLF = 787; + + SN_id_ct_xml = AnsiString('id-ct-xml'); + NID_id_ct_xml = 1060; + + SN_id_smime_aa_receiptRequest = AnsiString('id-smime-aa-receiptRequest'); + NID_id_smime_aa_receiptRequest = 212; + + SN_id_smime_aa_securityLabel = AnsiString('id-smime-aa-securityLabel'); + NID_id_smime_aa_securityLabel = 213; + + SN_id_smime_aa_mlExpandHistory = AnsiString('id-smime-aa-mlExpandHistory'); + NID_id_smime_aa_mlExpandHistory = 214; + + SN_id_smime_aa_contentHint = AnsiString('id-smime-aa-contentHint'); + NID_id_smime_aa_contentHint = 215; + + SN_id_smime_aa_msgSigDigest = AnsiString('id-smime-aa-msgSigDigest'); + NID_id_smime_aa_msgSigDigest = 216; + + SN_id_smime_aa_encapContentType = AnsiString('id-smime-aa-encapContentType'); + NID_id_smime_aa_encapContentType = 217; + + SN_id_smime_aa_contentIdentifier = AnsiString('id-smime-aa-contentIdentifier'); + NID_id_smime_aa_contentIdentifier = 218; + + SN_id_smime_aa_macValue = AnsiString('id-smime-aa-macValue'); + NID_id_smime_aa_macValue = 219; + + SN_id_smime_aa_equivalentLabels = AnsiString('id-smime-aa-equivalentLabels'); + NID_id_smime_aa_equivalentLabels = 220; + + SN_id_smime_aa_contentReference = AnsiString('id-smime-aa-contentReference'); + NID_id_smime_aa_contentReference = 221; + + SN_id_smime_aa_encrypKeyPref = AnsiString('id-smime-aa-encrypKeyPref'); + NID_id_smime_aa_encrypKeyPref = 222; + + SN_id_smime_aa_signingCertificate = AnsiString('id-smime-aa-signingCertificate'); + NID_id_smime_aa_signingCertificate = 223; + + SN_id_smime_aa_smimeEncryptCerts = AnsiString('id-smime-aa-smimeEncryptCerts'); + NID_id_smime_aa_smimeEncryptCerts = 224; + + SN_id_smime_aa_timeStampToken = AnsiString('id-smime-aa-timeStampToken'); + NID_id_smime_aa_timeStampToken = 225; + + SN_id_smime_aa_ets_sigPolicyId = AnsiString('id-smime-aa-ets-sigPolicyId'); + NID_id_smime_aa_ets_sigPolicyId = 226; + + SN_id_smime_aa_ets_commitmentType = AnsiString('id-smime-aa-ets-commitmentType'); + NID_id_smime_aa_ets_commitmentType = 227; + + SN_id_smime_aa_ets_signerLocation = AnsiString('id-smime-aa-ets-signerLocation'); + NID_id_smime_aa_ets_signerLocation = 228; + + SN_id_smime_aa_ets_signerAttr = AnsiString('id-smime-aa-ets-signerAttr'); + NID_id_smime_aa_ets_signerAttr = 229; + + SN_id_smime_aa_ets_otherSigCert = AnsiString('id-smime-aa-ets-otherSigCert'); + NID_id_smime_aa_ets_otherSigCert = 230; + + SN_id_smime_aa_ets_contentTimestamp = AnsiString('id-smime-aa-ets-contentTimestamp'); + NID_id_smime_aa_ets_contentTimestamp = 231; + + SN_id_smime_aa_ets_CertificateRefs = AnsiString('id-smime-aa-ets-CertificateRefs'); + NID_id_smime_aa_ets_CertificateRefs = 232; + + SN_id_smime_aa_ets_RevocationRefs = AnsiString('id-smime-aa-ets-RevocationRefs'); + NID_id_smime_aa_ets_RevocationRefs = 233; + + SN_id_smime_aa_ets_certValues = AnsiString('id-smime-aa-ets-certValues'); + NID_id_smime_aa_ets_certValues = 234; + + SN_id_smime_aa_ets_revocationValues = AnsiString('id-smime-aa-ets-revocationValues'); + NID_id_smime_aa_ets_revocationValues = 235; + + SN_id_smime_aa_ets_escTimeStamp = AnsiString('id-smime-aa-ets-escTimeStamp'); + NID_id_smime_aa_ets_escTimeStamp = 236; + + SN_id_smime_aa_ets_certCRLTimestamp = AnsiString('id-smime-aa-ets-certCRLTimestamp'); + NID_id_smime_aa_ets_certCRLTimestamp = 237; + + SN_id_smime_aa_ets_archiveTimeStamp = AnsiString('id-smime-aa-ets-archiveTimeStamp'); + NID_id_smime_aa_ets_archiveTimeStamp = 238; + + SN_id_smime_aa_signatureType = AnsiString('id-smime-aa-signatureType'); + NID_id_smime_aa_signatureType = 239; + + SN_id_smime_aa_dvcs_dvc = AnsiString('id-smime-aa-dvcs-dvc'); + NID_id_smime_aa_dvcs_dvc = 240; + + SN_id_smime_aa_signingCertificateV2 = AnsiString('id-smime-aa-signingCertificateV2'); + NID_id_smime_aa_signingCertificateV2 = 1086; + + SN_id_smime_alg_ESDHwith3DES = AnsiString('id-smime-alg-ESDHwith3DES'); + NID_id_smime_alg_ESDHwith3DES = 241; + + SN_id_smime_alg_ESDHwithRC2 = AnsiString('id-smime-alg-ESDHwithRC2'); + NID_id_smime_alg_ESDHwithRC2 = 242; + + SN_id_smime_alg_3DESwrap = AnsiString('id-smime-alg-3DESwrap'); + NID_id_smime_alg_3DESwrap = 243; + + SN_id_smime_alg_RC2wrap = AnsiString('id-smime-alg-RC2wrap'); + NID_id_smime_alg_RC2wrap = 244; + + SN_id_smime_alg_ESDH = AnsiString('id-smime-alg-ESDH'); + NID_id_smime_alg_ESDH = 245; + + SN_id_smime_alg_CMS3DESwrap = AnsiString('id-smime-alg-CMS3DESwrap'); + NID_id_smime_alg_CMS3DESwrap = 246; + + SN_id_smime_alg_CMSRC2wrap = AnsiString('id-smime-alg-CMSRC2wrap'); + NID_id_smime_alg_CMSRC2wrap = 247; + + SN_id_alg_PWRI_KEK = AnsiString('id-alg-PWRI-KEK'); + NID_id_alg_PWRI_KEK = 893; + + SN_id_smime_cd_ldap = AnsiString('id-smime-cd-ldap'); + NID_id_smime_cd_ldap = 248; + + SN_id_smime_spq_ets_sqt_uri = AnsiString('id-smime-spq-ets-sqt-uri'); + NID_id_smime_spq_ets_sqt_uri = 249; + + SN_id_smime_spq_ets_sqt_unotice = AnsiString('id-smime-spq-ets-sqt-unotice'); + NID_id_smime_spq_ets_sqt_unotice = 250; + + SN_id_smime_cti_ets_proofOfOrigin = AnsiString('id-smime-cti-ets-proofOfOrigin'); + NID_id_smime_cti_ets_proofOfOrigin = 251; + + SN_id_smime_cti_ets_proofOfReceipt = AnsiString('id-smime-cti-ets-proofOfReceipt'); + NID_id_smime_cti_ets_proofOfReceipt = 252; + + SN_id_smime_cti_ets_proofOfDelivery = AnsiString('id-smime-cti-ets-proofOfDelivery'); + NID_id_smime_cti_ets_proofOfDelivery = 253; + + SN_id_smime_cti_ets_proofOfSender = AnsiString('id-smime-cti-ets-proofOfSender'); + NID_id_smime_cti_ets_proofOfSender = 254; + + SN_id_smime_cti_ets_proofOfApproval = AnsiString('id-smime-cti-ets-proofOfApproval'); + NID_id_smime_cti_ets_proofOfApproval = 255; + + SN_id_smime_cti_ets_proofOfCreation = AnsiString('id-smime-cti-ets-proofOfCreation'); + NID_id_smime_cti_ets_proofOfCreation = 256; + + LN_friendlyName = AnsiString('friendlyName'); + NID_friendlyName = 156; + + LN_localKeyID = AnsiString('localKeyID'); + NID_localKeyID = 157; + + SN_ms_csp_name = AnsiString('CSPName'); + LN_ms_csp_name = AnsiString('Microsoft CSP Name'); + NID_ms_csp_name = 417; + + SN_LocalKeySet = AnsiString('LocalKeySet'); + LN_LocalKeySet = AnsiString('Microsoft Local Key set'); + NID_LocalKeySet = 856; + + LN_x509Certificate = AnsiString('x509Certificate'); + NID_x509Certificate = 158; + + LN_sdsiCertificate = AnsiString('sdsiCertificate'); + NID_sdsiCertificate = 159; + + LN_x509Crl = AnsiString('x509Crl'); + NID_x509Crl = 160; + + SN_pbe_WithSHA1And128BitRC4 = AnsiString('PBE-SHA1-RC4-128'); + LN_pbe_WithSHA1And128BitRC4 = AnsiString('pbeWithSHA1And128BitRC4'); + NID_pbe_WithSHA1And128BitRC4 = 144; + + SN_pbe_WithSHA1And40BitRC4 = AnsiString('PBE-SHA1-RC4-40'); + LN_pbe_WithSHA1And40BitRC4 = AnsiString('pbeWithSHA1And40BitRC4'); + NID_pbe_WithSHA1And40BitRC4 = 145; + + SN_pbe_WithSHA1And3_Key_TripleDES_CBC = AnsiString('PBE-SHA1-3DES'); + LN_pbe_WithSHA1And3_Key_TripleDES_CBC = AnsiString('pbeWithSHA1And3-KeyTripleDES-CBC'); + NID_pbe_WithSHA1And3_Key_TripleDES_CBC = 146; + + SN_pbe_WithSHA1And2_Key_TripleDES_CBC = AnsiString('PBE-SHA1-2DES'); + LN_pbe_WithSHA1And2_Key_TripleDES_CBC = AnsiString('pbeWithSHA1And2-KeyTripleDES-CBC'); + NID_pbe_WithSHA1And2_Key_TripleDES_CBC = 147; + + SN_pbe_WithSHA1And128BitRC2_CBC = AnsiString('PBE-SHA1-RC2-128'); + LN_pbe_WithSHA1And128BitRC2_CBC = AnsiString('pbeWithSHA1And128BitRC2-CBC'); + NID_pbe_WithSHA1And128BitRC2_CBC = 148; + + SN_pbe_WithSHA1And40BitRC2_CBC = AnsiString('PBE-SHA1-RC2-40'); + LN_pbe_WithSHA1And40BitRC2_CBC = AnsiString('pbeWithSHA1And40BitRC2-CBC'); + NID_pbe_WithSHA1And40BitRC2_CBC = 149; + + LN_keyBag = AnsiString('keyBag'); + NID_keyBag = 150; + + LN_pkcs8ShroudedKeyBag = AnsiString('pkcs8ShroudedKeyBag'); + NID_pkcs8ShroudedKeyBag = 151; + + LN_certBag = AnsiString('certBag'); + NID_certBag = 152; + + LN_crlBag = AnsiString('crlBag'); + NID_crlBag = 153; + + LN_secretBag = AnsiString('secretBag'); + NID_secretBag = 154; + + LN_safeContentsBag = AnsiString('safeContentsBag'); + NID_safeContentsBag = 155; + + SN_md2 = AnsiString('MD2'); + LN_md2 = AnsiString('md2'); + NID_md2 = 3; + + SN_md4 = AnsiString('MD4'); + LN_md4 = AnsiString('md4'); + NID_md4 = 257; + + SN_md5 = AnsiString('MD5'); + LN_md5 = AnsiString('md5'); + NID_md5 = 4; + + SN_md5_sha1 = AnsiString('MD5-SHA1'); + LN_md5_sha1 = AnsiString('md5-sha1'); + NID_md5_sha1 = 114; + + LN_hmacWithMD5 = AnsiString('hmacWithMD5'); + NID_hmacWithMD5 = 797; + + LN_hmacWithSHA1 = AnsiString('hmacWithSHA1'); + NID_hmacWithSHA1 = 163; + + SN_sm2 = AnsiString('SM2'); + LN_sm2 = AnsiString('sm2'); + NID_sm2 = 1172; + + SN_sm3 = AnsiString('SM3'); + LN_sm3 = AnsiString('sm3'); + NID_sm3 = 1143; + + SN_sm3WithRSAEncryption = AnsiString('RSA-SM3'); + LN_sm3WithRSAEncryption = AnsiString('sm3WithRSAEncryption'); + NID_sm3WithRSAEncryption = 1144; + + LN_hmacWithSHA224 = AnsiString('hmacWithSHA224'); + NID_hmacWithSHA224 = 798; + + LN_hmacWithSHA256 = AnsiString('hmacWithSHA256'); + NID_hmacWithSHA256 = 799; + + LN_hmacWithSHA384 = AnsiString('hmacWithSHA384'); + NID_hmacWithSHA384 = 800; + + LN_hmacWithSHA512 = AnsiString('hmacWithSHA512'); + NID_hmacWithSHA512 = 801; + + LN_hmacWithSHA512_224 = AnsiString('hmacWithSHA512-224'); + NID_hmacWithSHA512_224 = 1193; + + LN_hmacWithSHA512_256 = AnsiString('hmacWithSHA512-256'); + NID_hmacWithSHA512_256 = 1194; + + SN_rc2_cbc = AnsiString('RC2-CBC'); + LN_rc2_cbc = AnsiString('rc2-cbc'); + NID_rc2_cbc = 37; + + SN_rc2_ecb = AnsiString('RC2-ECB'); + LN_rc2_ecb = AnsiString('rc2-ecb'); + NID_rc2_ecb = 38; + + SN_rc2_cfb64 = AnsiString('RC2-CFB'); + LN_rc2_cfb64 = AnsiString('rc2-cfb'); + NID_rc2_cfb64 = 39; + + SN_rc2_ofb64 = AnsiString('RC2-OFB'); + LN_rc2_ofb64 = AnsiString('rc2-ofb'); + NID_rc2_ofb64 = 40; + + SN_rc2_40_cbc = AnsiString('RC2-40-CBC'); + LN_rc2_40_cbc = AnsiString('rc2-40-cbc'); + NID_rc2_40_cbc = 98; + + SN_rc2_64_cbc = AnsiString('RC2-64-CBC'); + LN_rc2_64_cbc = AnsiString('rc2-64-cbc'); + NID_rc2_64_cbc = 166; + + SN_rc4 = AnsiString('RC4'); + LN_rc4 = AnsiString('rc4'); + NID_rc4 = 5; + + SN_rc4_40 = AnsiString('RC4-40'); + LN_rc4_40 = AnsiString('rc4-40'); + NID_rc4_40 = 97; + + SN_des_ede3_cbc = AnsiString('DES-EDE3-CBC'); + LN_des_ede3_cbc = AnsiString('des-ede3-cbc'); + NID_des_ede3_cbc = 44; + + SN_rc5_cbc = AnsiString('RC5-CBC'); + LN_rc5_cbc = AnsiString('rc5-cbc'); + NID_rc5_cbc = 120; + + SN_rc5_ecb = AnsiString('RC5-ECB'); + LN_rc5_ecb = AnsiString('rc5-ecb'); + NID_rc5_ecb = 121; + + SN_rc5_cfb64 = AnsiString('RC5-CFB'); + LN_rc5_cfb64 = AnsiString('rc5-cfb'); + NID_rc5_cfb64 = 122; + + SN_rc5_ofb64 = AnsiString('RC5-OFB'); + LN_rc5_ofb64 = AnsiString('rc5-ofb'); + NID_rc5_ofb64 = 123; + + SN_ms_ext_req = AnsiString('msExtReq'); + LN_ms_ext_req = AnsiString('Microsoft Extension Request'); + NID_ms_ext_req = 171; + + SN_ms_code_ind = AnsiString('msCodeInd'); + LN_ms_code_ind = AnsiString('Microsoft Individual Code Signing'); + NID_ms_code_ind = 134; + + SN_ms_code_com = AnsiString('msCodeCom'); + LN_ms_code_com = AnsiString('Microsoft Commercial Code Signing'); + NID_ms_code_com = 135; + + SN_ms_ctl_sign = AnsiString('msCTLSign'); + LN_ms_ctl_sign = AnsiString('Microsoft Trust List Signing'); + NID_ms_ctl_sign = 136; + + SN_ms_sgc = AnsiString('msSGC'); + LN_ms_sgc = AnsiString('Microsoft Server Gated Crypto'); + NID_ms_sgc = 137; + + SN_ms_efs = AnsiString('msEFS'); + LN_ms_efs = AnsiString('Microsoft Encrypted File System'); + NID_ms_efs = 138; + + SN_ms_smartcard_login = AnsiString('msSmartcardLogin'); + LN_ms_smartcard_login = AnsiString('Microsoft Smartcard Login'); + NID_ms_smartcard_login = 648; + + SN_ms_upn = AnsiString('msUPN'); + LN_ms_upn = AnsiString('Microsoft User Principal Name'); + NID_ms_upn = 649; + + SN_idea_cbc = AnsiString('IDEA-CBC'); + LN_idea_cbc = AnsiString('idea-cbc'); + NID_idea_cbc = 34; + + SN_idea_ecb = AnsiString('IDEA-ECB'); + LN_idea_ecb = AnsiString('idea-ecb'); + NID_idea_ecb = 36; + + SN_idea_cfb64 = AnsiString('IDEA-CFB'); + LN_idea_cfb64 = AnsiString('idea-cfb'); + NID_idea_cfb64 = 35; + + SN_idea_ofb64 = AnsiString('IDEA-OFB'); + LN_idea_ofb64 = AnsiString('idea-ofb'); + NID_idea_ofb64 = 46; + + SN_bf_cbc = AnsiString('BF-CBC'); + LN_bf_cbc = AnsiString('bf-cbc'); + NID_bf_cbc = 91; + + SN_bf_ecb = AnsiString('BF-ECB'); + LN_bf_ecb = AnsiString('bf-ecb'); + NID_bf_ecb = 92; + + SN_bf_cfb64 = AnsiString('BF-CFB'); + LN_bf_cfb64 = AnsiString('bf-cfb'); + NID_bf_cfb64 = 93; + + SN_bf_ofb64 = AnsiString('BF-OFB'); + LN_bf_ofb64 = AnsiString('bf-ofb'); + NID_bf_ofb64 = 94; + + SN_id_pkix = AnsiString('PKIX'); + NID_id_pkix = 127; + + SN_id_pkix_mod = AnsiString('id-pkix-mod'); + NID_id_pkix_mod = 258; + + SN_id_pe = AnsiString('id-pe'); + NID_id_pe = 175; + + SN_id_qt = AnsiString('id-qt'); + NID_id_qt = 259; + + SN_id_kp = AnsiString('id-kp'); + NID_id_kp = 128; + + SN_id_it = AnsiString('id-it'); + NID_id_it = 260; + + SN_id_pkip = AnsiString('id-pkip'); + NID_id_pkip = 261; + + SN_id_alg = AnsiString('id-alg'); + NID_id_alg = 262; + + SN_id_cmc = AnsiString('id-cmc'); + NID_id_cmc = 263; + + SN_id_on = AnsiString('id-on'); + NID_id_on = 264; + + SN_id_pda = AnsiString('id-pda'); + NID_id_pda = 265; + + SN_id_aca = AnsiString('id-aca'); + NID_id_aca = 266; + + SN_id_qcs = AnsiString('id-qcs'); + NID_id_qcs = 267; + + SN_id_cct = AnsiString('id-cct'); + NID_id_cct = 268; + + SN_id_ppl = AnsiString('id-ppl'); + NID_id_ppl = 662; + + SN_id_ad = AnsiString('id-ad'); + NID_id_ad = 176; + + SN_id_pkix1_explicit_88 = AnsiString('id-pkix1-explicit-88'); + NID_id_pkix1_explicit_88 = 269; + + SN_id_pkix1_implicit_88 = AnsiString('id-pkix1-implicit-88'); + NID_id_pkix1_implicit_88 = 270; + + SN_id_pkix1_explicit_93 = AnsiString('id-pkix1-explicit-93'); + NID_id_pkix1_explicit_93 = 271; + + SN_id_pkix1_implicit_93 = AnsiString('id-pkix1-implicit-93'); + NID_id_pkix1_implicit_93 = 272; + + SN_id_mod_crmf = AnsiString('id-mod-crmf'); + NID_id_mod_crmf = 273; + + SN_id_mod_cmc = AnsiString('id-mod-cmc'); + NID_id_mod_cmc = 274; + + SN_id_mod_kea_profile_88 = AnsiString('id-mod-kea-profile-88'); + NID_id_mod_kea_profile_88 = 275; + + SN_id_mod_kea_profile_93 = AnsiString('id-mod-kea-profile-93'); + NID_id_mod_kea_profile_93 = 276; + + SN_id_mod_cmp = AnsiString('id-mod-cmp'); + NID_id_mod_cmp = 277; + + SN_id_mod_qualified_cert_88 = AnsiString('id-mod-qualified-cert-88'); + NID_id_mod_qualified_cert_88 = 278; + + SN_id_mod_qualified_cert_93 = AnsiString('id-mod-qualified-cert-93'); + NID_id_mod_qualified_cert_93 = 279; + + SN_id_mod_attribute_cert = AnsiString('id-mod-attribute-cert'); + NID_id_mod_attribute_cert = 280; + + SN_id_mod_timestamp_protocol = AnsiString('id-mod-timestamp-protocol'); + NID_id_mod_timestamp_protocol = 281; + + SN_id_mod_ocsp = AnsiString('id-mod-ocsp'); + NID_id_mod_ocsp = 282; + + SN_id_mod_dvcs = AnsiString('id-mod-dvcs'); + NID_id_mod_dvcs = 283; + + SN_id_mod_cmp2000 = AnsiString('id-mod-cmp2000'); + NID_id_mod_cmp2000 = 284; + + SN_info_access = AnsiString('authorityInfoAccess'); + LN_info_access = AnsiString('Authority Information Access'); + NID_info_access = 177; + + SN_biometricInfo = AnsiString('biometricInfo'); + LN_biometricInfo = AnsiString('Biometric Info'); + NID_biometricInfo = 285; + + SN_qcStatements = AnsiString('qcStatements'); + NID_qcStatements = 286; + + SN_ac_auditEntity = AnsiString('ac-auditEntity'); + NID_ac_auditEntity = 287; + + SN_ac_targeting = AnsiString('ac-targeting'); + NID_ac_targeting = 288; + + SN_aaControls = AnsiString('aaControls'); + NID_aaControls = 289; + + SN_sbgp_ipAddrBlock = AnsiString('sbgp-ipAddrBlock'); + NID_sbgp_ipAddrBlock = 290; + + SN_sbgp_autonomousSysNum = AnsiString('sbgp-autonomousSysNum'); + NID_sbgp_autonomousSysNum = 291; + + SN_sbgp_routerIdentifier = AnsiString('sbgp-routerIdentifier'); + NID_sbgp_routerIdentifier = 292; + + SN_ac_proxying = AnsiString('ac-proxying'); + NID_ac_proxying = 397; + + SN_sinfo_access = AnsiString('subjectInfoAccess'); + LN_sinfo_access = AnsiString('Subject Information Access'); + NID_sinfo_access = 398; + + SN_proxyCertInfo = AnsiString('proxyCertInfo'); + LN_proxyCertInfo = AnsiString('Proxy Certificate Information'); + NID_proxyCertInfo = 663; + + SN_tlsfeature = AnsiString('tlsfeature'); + LN_tlsfeature = AnsiString('TLS Feature'); + NID_tlsfeature = 1020; + + SN_id_qt_cps = AnsiString('id-qt-cps'); + LN_id_qt_cps = AnsiString('Policy Qualifier CPS'); + NID_id_qt_cps = 164; + + SN_id_qt_unotice = AnsiString('id-qt-unotice'); + LN_id_qt_unotice = AnsiString('Policy Qualifier User Notice'); + NID_id_qt_unotice = 165; + + SN_textNotice = AnsiString('textNotice'); + NID_textNotice = 293; + + SN_server_auth = AnsiString('serverAuth'); + LN_server_auth = AnsiString('TLS Web Server Authentication'); + NID_server_auth = 129; + + SN_client_auth = AnsiString('clientAuth'); + LN_client_auth = AnsiString('TLS Web Client Authentication'); + NID_client_auth = 130; + + SN_code_sign = AnsiString('codeSigning'); + LN_code_sign = AnsiString('Code Signing'); + NID_code_sign = 131; + + SN_email_protect = AnsiString('emailProtection'); + LN_email_protect = AnsiString('E-mail Protection'); + NID_email_protect = 132; + + SN_ipsecEndSystem = AnsiString('ipsecEndSystem'); + LN_ipsecEndSystem = AnsiString('IPSec End System'); + NID_ipsecEndSystem = 294; + + SN_ipsecTunnel = AnsiString('ipsecTunnel'); + LN_ipsecTunnel = AnsiString('IPSec Tunnel'); + NID_ipsecTunnel = 295; + + SN_ipsecUser = AnsiString('ipsecUser'); + LN_ipsecUser = AnsiString('IPSec User'); + NID_ipsecUser = 296; + + SN_time_stamp = AnsiString('timeStamping'); + LN_time_stamp = AnsiString('Time Stamping'); + NID_time_stamp = 133; + + SN_OCSP_sign = AnsiString('OCSPSigning'); + LN_OCSP_sign = AnsiString('OCSP Signing'); + NID_OCSP_sign = 180; + + SN_dvcs = AnsiString('DVCS'); + LN_dvcs = AnsiString('dvcs'); + NID_dvcs = 297; + + SN_ipsec_IKE = AnsiString('ipsecIKE'); + LN_ipsec_IKE = AnsiString('ipsec Internet Key Exchange'); + NID_ipsec_IKE = 1022; + + SN_capwapAC = AnsiString('capwapAC'); + LN_capwapAC = AnsiString('Ctrl/provision WAP Access'); + NID_capwapAC = 1023; + + SN_capwapWTP = AnsiString('capwapWTP'); + LN_capwapWTP = AnsiString('Ctrl/Provision WAP Termination'); + NID_capwapWTP = 1024; + + SN_sshClient = AnsiString('secureShellClient'); + LN_sshClient = AnsiString('SSH Client'); + NID_sshClient = 1025; + + SN_sshServer = AnsiString('secureShellServer'); + LN_sshServer = AnsiString('SSH Server'); + NID_sshServer = 1026; + + SN_sendRouter = AnsiString('sendRouter'); + LN_sendRouter = AnsiString('Send Router'); + NID_sendRouter = 1027; + + SN_sendProxiedRouter = AnsiString('sendProxiedRouter'); + LN_sendProxiedRouter = AnsiString('Send Proxied Router'); + NID_sendProxiedRouter = 1028; + + SN_sendOwner = AnsiString('sendOwner'); + LN_sendOwner = AnsiString('Send Owner'); + NID_sendOwner = 1029; + + SN_sendProxiedOwner = AnsiString('sendProxiedOwner'); + LN_sendProxiedOwner = AnsiString('Send Proxied Owner'); + NID_sendProxiedOwner = 1030; + + SN_cmcCA = AnsiString('cmcCA'); + LN_cmcCA = AnsiString('CMC Certificate Authority'); + NID_cmcCA = 1131; + + SN_cmcRA = AnsiString('cmcRA'); + LN_cmcRA = AnsiString('CMC Registration Authority'); + NID_cmcRA = 1132; + + SN_id_it_caProtEncCert = AnsiString('id-it-caProtEncCert'); + NID_id_it_caProtEncCert = 298; + + SN_id_it_signKeyPairTypes = AnsiString('id-it-signKeyPairTypes'); + NID_id_it_signKeyPairTypes = 299; + + SN_id_it_encKeyPairTypes = AnsiString('id-it-encKeyPairTypes'); + NID_id_it_encKeyPairTypes = 300; + + SN_id_it_preferredSymmAlg = AnsiString('id-it-preferredSymmAlg'); + NID_id_it_preferredSymmAlg = 301; + + SN_id_it_caKeyUpdateInfo = AnsiString('id-it-caKeyUpdateInfo'); + NID_id_it_caKeyUpdateInfo = 302; + + SN_id_it_currentCRL = AnsiString('id-it-currentCRL'); + NID_id_it_currentCRL = 303; + + SN_id_it_unsupportedOIDs = AnsiString('id-it-unsupportedOIDs'); + NID_id_it_unsupportedOIDs = 304; + + SN_id_it_subscriptionRequest = AnsiString('id-it-subscriptionRequest'); + NID_id_it_subscriptionRequest = 305; + + SN_id_it_subscriptionResponse = AnsiString('id-it-subscriptionResponse'); + NID_id_it_subscriptionResponse = 306; + + SN_id_it_keyPairParamReq = AnsiString('id-it-keyPairParamReq'); + NID_id_it_keyPairParamReq = 307; + + SN_id_it_keyPairParamRep = AnsiString('id-it-keyPairParamRep'); + NID_id_it_keyPairParamRep = 308; + + SN_id_it_revPassphrase = AnsiString('id-it-revPassphrase'); + NID_id_it_revPassphrase = 309; + + SN_id_it_implicitConfirm = AnsiString('id-it-implicitConfirm'); + NID_id_it_implicitConfirm = 310; + + SN_id_it_confirmWaitTime = AnsiString('id-it-confirmWaitTime'); + NID_id_it_confirmWaitTime = 311; + + SN_id_it_origPKIMessage = AnsiString('id-it-origPKIMessage'); + NID_id_it_origPKIMessage = 312; + + SN_id_it_suppLangTags = AnsiString('id-it-suppLangTags'); + NID_id_it_suppLangTags = 784; + + SN_id_regCtrl = AnsiString('id-regCtrl'); + NID_id_regCtrl = 313; + + SN_id_regInfo = AnsiString('id-regInfo'); + NID_id_regInfo = 314; + + SN_id_regCtrl_regToken = AnsiString('id-regCtrl-regToken'); + NID_id_regCtrl_regToken = 315; + + SN_id_regCtrl_authenticator = AnsiString('id-regCtrl-authenticator'); + NID_id_regCtrl_authenticator = 316; + + SN_id_regCtrl_pkiPublicationInfo = AnsiString('id-regCtrl-pkiPublicationInfo'); + NID_id_regCtrl_pkiPublicationInfo = 317; + + SN_id_regCtrl_pkiArchiveOptions = AnsiString('id-regCtrl-pkiArchiveOptions'); + NID_id_regCtrl_pkiArchiveOptions = 318; + + SN_id_regCtrl_oldCertID = AnsiString('id-regCtrl-oldCertID'); + NID_id_regCtrl_oldCertID = 319; + + SN_id_regCtrl_protocolEncrKey = AnsiString('id-regCtrl-protocolEncrKey'); + NID_id_regCtrl_protocolEncrKey = 320; + + SN_id_regInfo_utf8Pairs = AnsiString('id-regInfo-utf8Pairs'); + NID_id_regInfo_utf8Pairs = 321; + + SN_id_regInfo_certReq = AnsiString('id-regInfo-certReq'); + NID_id_regInfo_certReq = 322; + + SN_id_alg_des40 = AnsiString('id-alg-des40'); + NID_id_alg_des40 = 323; + + SN_id_alg_noSignature = AnsiString('id-alg-noSignature'); + NID_id_alg_noSignature = 324; + + SN_id_alg_dh_sig_hmac_sha1 = AnsiString('id-alg-dh-sig-hmac-sha1'); + NID_id_alg_dh_sig_hmac_sha1 = 325; + + SN_id_alg_dh_pop = AnsiString('id-alg-dh-pop'); + NID_id_alg_dh_pop = 326; + + SN_id_cmc_statusInfo = AnsiString('id-cmc-statusInfo'); + NID_id_cmc_statusInfo = 327; + + SN_id_cmc_identification = AnsiString('id-cmc-identification'); + NID_id_cmc_identification = 328; + + SN_id_cmc_identityProof = AnsiString('id-cmc-identityProof'); + NID_id_cmc_identityProof = 329; + + SN_id_cmc_dataReturn = AnsiString('id-cmc-dataReturn'); + NID_id_cmc_dataReturn = 330; + + SN_id_cmc_transactionId = AnsiString('id-cmc-transactionId'); + NID_id_cmc_transactionId = 331; + + SN_id_cmc_senderNonce = AnsiString('id-cmc-senderNonce'); + NID_id_cmc_senderNonce = 332; + + SN_id_cmc_recipientNonce = AnsiString('id-cmc-recipientNonce'); + NID_id_cmc_recipientNonce = 333; + + SN_id_cmc_addExtensions = AnsiString('id-cmc-addExtensions'); + NID_id_cmc_addExtensions = 334; + + SN_id_cmc_encryptedPOP = AnsiString('id-cmc-encryptedPOP'); + NID_id_cmc_encryptedPOP = 335; + + SN_id_cmc_decryptedPOP = AnsiString('id-cmc-decryptedPOP'); + NID_id_cmc_decryptedPOP = 336; + + SN_id_cmc_lraPOPWitness = AnsiString('id-cmc-lraPOPWitness'); + NID_id_cmc_lraPOPWitness = 337; + + SN_id_cmc_getCert = AnsiString('id-cmc-getCert'); + NID_id_cmc_getCert = 338; + + SN_id_cmc_getCRL = AnsiString('id-cmc-getCRL'); + NID_id_cmc_getCRL = 339; + + SN_id_cmc_revokeRequest = AnsiString('id-cmc-revokeRequest'); + NID_id_cmc_revokeRequest = 340; + + SN_id_cmc_regInfo = AnsiString('id-cmc-regInfo'); + NID_id_cmc_regInfo = 341; + + SN_id_cmc_responseInfo = AnsiString('id-cmc-responseInfo'); + NID_id_cmc_responseInfo = 342; + + SN_id_cmc_queryPending = AnsiString('id-cmc-queryPending'); + NID_id_cmc_queryPending = 343; + + SN_id_cmc_popLinkRandom = AnsiString('id-cmc-popLinkRandom'); + NID_id_cmc_popLinkRandom = 344; + + SN_id_cmc_popLinkWitness = AnsiString('id-cmc-popLinkWitness'); + NID_id_cmc_popLinkWitness = 345; + + SN_id_cmc_confirmCertAcceptance = AnsiString('id-cmc-confirmCertAcceptance'); + NID_id_cmc_confirmCertAcceptance = 346; + + SN_id_on_personalData = AnsiString('id-on-personalData'); + NID_id_on_personalData = 347; + + SN_id_on_permanentIdentifier = AnsiString('id-on-permanentIdentifier'); + LN_id_on_permanentIdentifier = AnsiString('Permanent Identifier'); + NID_id_on_permanentIdentifier = 858; + + SN_id_pda_dateOfBirth = AnsiString('id-pda-dateOfBirth'); + NID_id_pda_dateOfBirth = 348; + + SN_id_pda_placeOfBirth = AnsiString('id-pda-placeOfBirth'); + NID_id_pda_placeOfBirth = 349; + + SN_id_pda_gender = AnsiString('id-pda-gender'); + NID_id_pda_gender = 351; + + SN_id_pda_countryOfCitizenship = AnsiString('id-pda-countryOfCitizenship'); + NID_id_pda_countryOfCitizenship = 352; + + SN_id_pda_countryOfResidence = AnsiString('id-pda-countryOfResidence'); + NID_id_pda_countryOfResidence = 353; + + SN_id_aca_authenticationInfo = AnsiString('id-aca-authenticationInfo'); + NID_id_aca_authenticationInfo = 354; + + SN_id_aca_accessIdentity = AnsiString('id-aca-accessIdentity'); + NID_id_aca_accessIdentity = 355; + + SN_id_aca_chargingIdentity = AnsiString('id-aca-chargingIdentity'); + NID_id_aca_chargingIdentity = 356; + + SN_id_aca_group = AnsiString('id-aca-group'); + NID_id_aca_group = 357; + + SN_id_aca_role = AnsiString('id-aca-role'); + NID_id_aca_role = 358; + + SN_id_aca_encAttrs = AnsiString('id-aca-encAttrs'); + NID_id_aca_encAttrs = 399; + + SN_id_qcs_pkixQCSyntax_v1 = AnsiString('id-qcs-pkixQCSyntax-v1'); + NID_id_qcs_pkixQCSyntax_v1 = 359; + + SN_id_cct_crs = AnsiString('id-cct-crs'); + NID_id_cct_crs = 360; + + SN_id_cct_PKIData = AnsiString('id-cct-PKIData'); + NID_id_cct_PKIData = 361; + + SN_id_cct_PKIResponse = AnsiString('id-cct-PKIResponse'); + NID_id_cct_PKIResponse = 362; + + SN_id_ppl_anyLanguage = AnsiString('id-ppl-anyLanguage'); + LN_id_ppl_anyLanguage = AnsiString('Any language'); + + NID_id_ppl_anyLanguage = 664; + SN_id_ppl_inheritAll = AnsiString('id-ppl-inheritAll'); + + LN_id_ppl_inheritAll = AnsiString('Inherit all'); + NID_id_ppl_inheritAll = 665; + + SN_Independent = AnsiString('id-ppl-independent'); + LN_Independent = AnsiString('Independent'); + NID_Independent = 667; + + SN_ad_OCSP = AnsiString('OCSP'); + LN_ad_OCSP = AnsiString('OCSP'); + NID_ad_OCSP = 178; + + SN_ad_ca_issuers = AnsiString('caIssuers'); + LN_ad_ca_issuers = AnsiString('CA Issuers'); + NID_ad_ca_issuers = 179; + + SN_ad_timeStamping = AnsiString('ad_timestamping'); + LN_ad_timeStamping = AnsiString('AD Time Stamping'); + NID_ad_timeStamping = 363; + + SN_ad_dvcs = AnsiString('AD_DVCS'); + LN_ad_dvcs = AnsiString('ad dvcs'); + NID_ad_dvcs = 364; + + SN_caRepository = AnsiString('caRepository'); + LN_caRepository = AnsiString('CA Repository'); + NID_caRepository = 785; + + SN_id_pkix_OCSP_basic = AnsiString('basicOCSPResponse'); + LN_id_pkix_OCSP_basic = AnsiString('Basic OCSP Response'); + NID_id_pkix_OCSP_basic = 365; + + SN_id_pkix_OCSP_Nonce = AnsiString('Nonce'); + LN_id_pkix_OCSP_Nonce = AnsiString('OCSP Nonce'); + NID_id_pkix_OCSP_Nonce = 366; + + SN_id_pkix_OCSP_CrlID = AnsiString('CrlID'); + LN_id_pkix_OCSP_CrlID = AnsiString('OCSP CRL ID'); + NID_id_pkix_OCSP_CrlID = 367; + + SN_id_pkix_OCSP_acceptableResponses = AnsiString('acceptableResponses'); + LN_id_pkix_OCSP_acceptableResponses = AnsiString('Acceptable OCSP Responses'); + NID_id_pkix_OCSP_acceptableResponses = 368; + + SN_id_pkix_OCSP_noCheck = AnsiString('noCheck'); + LN_id_pkix_OCSP_noCheck = AnsiString('OCSP No Check'); + NID_id_pkix_OCSP_noCheck = 369; + + SN_id_pkix_OCSP_archiveCutoff = AnsiString('archiveCutoff'); + LN_id_pkix_OCSP_archiveCutoff = AnsiString('OCSP Archive Cutoff'); + NID_id_pkix_OCSP_archiveCutoff = 370; + + SN_id_pkix_OCSP_serviceLocator = AnsiString('serviceLocator'); + LN_id_pkix_OCSP_serviceLocator = AnsiString('OCSP Service Locator'); + NID_id_pkix_OCSP_serviceLocator = 371; + + SN_id_pkix_OCSP_extendedStatus = AnsiString('extendedStatus'); + LN_id_pkix_OCSP_extendedStatus = AnsiString('Extended OCSP Status'); + NID_id_pkix_OCSP_extendedStatus = 372; + + SN_id_pkix_OCSP_valid = AnsiString('valid'); + NID_id_pkix_OCSP_valid = 373; + + SN_id_pkix_OCSP_path = AnsiString('path'); + NID_id_pkix_OCSP_path = 374; + + SN_id_pkix_OCSP_trustRoot = AnsiString('trustRoot'); + LN_id_pkix_OCSP_trustRoot = AnsiString('Trust Root'); + NID_id_pkix_OCSP_trustRoot = 375; + + SN_algorithm = AnsiString('algorithm'); + LN_algorithm = AnsiString('algorithm'); + NID_algorithm = 376; + + SN_md5WithRSA = AnsiString('RSA-NP-MD5'); + LN_md5WithRSA = AnsiString('md5WithRSA'); + NID_md5WithRSA = 104; + + SN_des_ecb = AnsiString('DES-ECB'); + LN_des_ecb = AnsiString('des-ecb'); + NID_des_ecb = 29; + + SN_des_cbc = AnsiString('DES-CBC'); + LN_des_cbc = AnsiString('des-cbc'); + NID_des_cbc = 31; + + SN_des_ofb64 = AnsiString('DES-OFB'); + LN_des_ofb64 = AnsiString('des-ofb'); + NID_des_ofb64 = 45; + + SN_des_cfb64 = AnsiString('DES-CFB'); + LN_des_cfb64 = AnsiString('des-cfb'); + NID_des_cfb64 = 30; + + SN_rsaSignature = AnsiString('rsaSignature'); + NID_rsaSignature = 377; + + SN_dsa_2 = AnsiString('DSA-old'); + LN_dsa_2 = AnsiString('dsaEncryption-old'); + NID_dsa_2 = 67; + + SN_dsaWithSHA = AnsiString('DSA-SHA'); + LN_dsaWithSHA = AnsiString('dsaWithSHA'); + NID_dsaWithSHA = 66; + + SN_shaWithRSAEncryption = AnsiString('RSA-SHA'); + LN_shaWithRSAEncryption = AnsiString('shaWithRSAEncryption'); + NID_shaWithRSAEncryption = 42; + + SN_des_ede_ecb = AnsiString('DES-EDE'); + LN_des_ede_ecb = AnsiString('des-ede'); + NID_des_ede_ecb = 32; + + SN_des_ede3_ecb = AnsiString('DES-EDE3'); + LN_des_ede3_ecb = AnsiString('des-ede3'); + NID_des_ede3_ecb = 33; + + SN_des_ede_cbc = AnsiString('DES-EDE-CBC'); + LN_des_ede_cbc = AnsiString('des-ede-cbc'); + NID_des_ede_cbc = 43; + + SN_des_ede_cfb64 = AnsiString('DES-EDE-CFB'); + LN_des_ede_cfb64 = AnsiString('des-ede-cfb'); + NID_des_ede_cfb64 = 60; + + SN_des_ede3_cfb64 = AnsiString('DES-EDE3-CFB'); + LN_des_ede3_cfb64 = AnsiString('des-ede3-cfb'); + NID_des_ede3_cfb64 = 61; + + SN_des_ede_ofb64 = AnsiString('DES-EDE-OFB'); + LN_des_ede_ofb64 = AnsiString('des-ede-ofb'); + NID_des_ede_ofb64 = 62; + + SN_des_ede3_ofb64 = AnsiString('DES-EDE3-OFB'); + LN_des_ede3_ofb64 = AnsiString('des-ede3-ofb'); + NID_des_ede3_ofb64 = 63; + + SN_desx_cbc = AnsiString('DESX-CBC'); + LN_desx_cbc = AnsiString('desx-cbc'); + NID_desx_cbc = 80; + + SN_sha = AnsiString('SHA'); + LN_sha = AnsiString('sha'); + NID_sha = 41; + + SN_sha1 = AnsiString('SHA1'); + LN_sha1 = AnsiString('sha1'); + NID_sha1 = 64; + + SN_dsaWithSHA1_2 = AnsiString('DSA-SHA1-old'); + LN_dsaWithSHA1_2 = AnsiString('dsaWithSHA1-old'); + NID_dsaWithSHA1_2 = 70; + + SN_sha1WithRSA = AnsiString('RSA-SHA1-2'); + LN_sha1WithRSA = AnsiString('sha1WithRSA'); + NID_sha1WithRSA = 115; + + SN_ripemd160 = AnsiString('RIPEMD160'); + LN_ripemd160 = AnsiString('ripemd160'); + NID_ripemd160 = 117; + + SN_ripemd160WithRSA = AnsiString('RSA-RIPEMD160'); + LN_ripemd160WithRSA = AnsiString('ripemd160WithRSA'); + NID_ripemd160WithRSA = 119; + + SN_blake2b512 = AnsiString('BLAKE2b512'); + LN_blake2b512 = AnsiString('blake2b512'); + NID_blake2b512 = 1056; + + SN_blake2s256 = AnsiString('BLAKE2s256'); + LN_blake2s256 = AnsiString('blake2s256'); + NID_blake2s256 = 1057; + + SN_sxnet = AnsiString('SXNetID'); + LN_sxnet = AnsiString('Strong Extranet ID'); + NID_sxnet = 143; + + SN_X500 = AnsiString('X500'); + LN_X500 = AnsiString('directory services(X.500)'); + NID_X500 = 11; + + SN_X509 = AnsiString('X509'); + NID_X509 = 12; + + SN_commonName = AnsiString('CN'); + LN_commonName = AnsiString('commonName'); + NID_commonName = 13; + + SN_surname = AnsiString('SN'); + LN_surname = AnsiString('surname'); + NID_surname = 100; + + LN_serialNumber = AnsiString('serialNumber'); + NID_serialNumber = 105; + + SN_countryName = AnsiString('C'); + LN_countryName = AnsiString('countryName'); + NID_countryName = 14; + + SN_localityName = AnsiString('L'); + LN_localityName = AnsiString('localityName'); + NID_localityName = 15; + + SN_stateOrProvinceName = AnsiString('ST'); + LN_stateOrProvinceName = AnsiString('stateOrProvinceName'); + NID_stateOrProvinceName = 16; + + SN_streetAddress = AnsiString('street'); + LN_streetAddress = AnsiString('streetAddress'); + NID_streetAddress = 660; + + SN_organizationName = AnsiString('O'); + LN_organizationName = AnsiString('organizationName'); + NID_organizationName = 17; + + SN_organizationalUnitName = AnsiString('OU'); + LN_organizationalUnitName = AnsiString('organizationalUnitName'); + NID_organizationalUnitName = 18; + + SN_title = AnsiString('title'); + LN_title = AnsiString('title'); + NID_title = 106; + + LN_description = AnsiString('description'); + NID_description = 107; + + LN_searchGuide = AnsiString('searchGuide'); + NID_searchGuide = 859; + LN_businessCategory = AnsiString('businessCategory'); + NID_businessCategory = 860; + + LN_postalAddress = AnsiString('postalAddress'); + NID_postalAddress = 861; + + LN_postalCode = AnsiString('postalCode'); + NID_postalCode = 661; + + LN_postOfficeBox = AnsiString('postOfficeBox'); + NID_postOfficeBox = 862; + + LN_physicalDeliveryOfficeName = AnsiString('physicalDeliveryOfficeName'); + NID_physicalDeliveryOfficeName = 863; + + LN_telephoneNumber = AnsiString('telephoneNumber'); + NID_telephoneNumber = 864; + + LN_telexNumber = AnsiString('telexNumber'); + NID_telexNumber = 865; + + LN_teletexTerminalIdentifier = AnsiString('teletexTerminalIdentifier'); + NID_teletexTerminalIdentifier = 866; + + LN_facsimileTelephoneNumber = AnsiString('facsimileTelephoneNumber'); + NID_facsimileTelephoneNumber = 867; + + LN_x121Address = AnsiString('x121Address'); + NID_x121Address = 868; + + LN_internationaliSDNNumber = AnsiString('internationaliSDNNumber'); + NID_internationaliSDNNumber = 869; + + LN_registeredAddress = AnsiString('registeredAddress'); + NID_registeredAddress = 870; + + LN_destinationIndicator = AnsiString('destinationIndicator'); + NID_destinationIndicator = 871; + + LN_preferredDeliveryMethod = AnsiString('preferredDeliveryMethod'); + NID_preferredDeliveryMethod = 872; + + LN_presentationAddress = AnsiString('presentationAddress'); + NID_presentationAddress = 873; + + LN_supportedApplicationContext = AnsiString('supportedApplicationContext'); + NID_supportedApplicationContext = 874; + + SN_member = AnsiString('member'); + NID_member = 875; + + SN_owner = AnsiString('owner'); + NID_owner = 876; + + LN_roleOccupant = AnsiString('roleOccupant'); + NID_roleOccupant = 877; + + SN_seeAlso = AnsiString('seeAlso'); + NID_seeAlso = 878; + + LN_userPassword = AnsiString('userPassword'); + NID_userPassword = 879; + + LN_userCertificate = AnsiString('userCertificate'); + NID_userCertificate = 880; + + LN_cACertificate = AnsiString('cACertificate'); + NID_cACertificate = 881; + + LN_authorityRevocationList = AnsiString('authorityRevocationList'); + NID_authorityRevocationList = 882; + + LN_certificateRevocationList = AnsiString('certificateRevocationList'); + NID_certificateRevocationList = 883; + + LN_crossCertificatePair = AnsiString('crossCertificatePair'); + NID_crossCertificatePair = 884; + + SN_name = AnsiString('name'); + LN_name = AnsiString('name'); + NID_name = 173; + + SN_givenName = AnsiString('GN'); + LN_givenName = AnsiString('givenName'); + NID_givenName = 99; + + SN_initials = AnsiString('initials'); + LN_initials = AnsiString('initials'); + NID_initials = 101; + + LN_generationQualifier = AnsiString('generationQualifier'); + NID_generationQualifier = 509; + + LN_x500UniqueIdentifier = AnsiString('x500UniqueIdentifier'); + NID_x500UniqueIdentifier = 503; + + SN_dnQualifier = AnsiString('dnQualifier'); + LN_dnQualifier = AnsiString('dnQualifier'); + NID_dnQualifier = 174; + + LN_enhancedSearchGuide = AnsiString('enhancedSearchGuide'); + NID_enhancedSearchGuide = 885; + + LN_protocolInformation = AnsiString('protocolInformation'); + NID_protocolInformation = 886; + + LN_distinguishedName = AnsiString('distinguishedName'); + NID_distinguishedName = 887; + + LN_uniqueMember = AnsiString('uniqueMember'); + NID_uniqueMember = 888; + + LN_houseIdentifier = AnsiString('houseIdentifier'); + NID_houseIdentifier = 889; + + LN_supportedAlgorithms = AnsiString('supportedAlgorithms'); + NID_supportedAlgorithms = 890; + + LN_deltaRevocationList = AnsiString('deltaRevocationList'); + NID_deltaRevocationList = 891; + + SN_dmdName = AnsiString('dmdName'); + NID_dmdName = 892; + + LN_pseudonym = AnsiString('pseudonym'); + NID_pseudonym = 510; + + SN_role = AnsiString('role'); + LN_role = AnsiString('role'); + NID_role = 400; + + LN_organizationIdentifier = AnsiString('organizationIdentifier'); + NID_organizationIdentifier = 1089; + + SN_countryCode3c = AnsiString('c3'); + LN_countryCode3c = AnsiString('countryCode3c'); + NID_countryCode3c = 1090; + + SN_countryCode3n = AnsiString('n3'); + LN_countryCode3n = AnsiString('countryCode3n'); + NID_countryCode3n = 1091; + + LN_dnsName = AnsiString('dnsName'); + NID_dnsName = 1092; + + SN_X500algorithms = AnsiString('X500algorithms'); + LN_X500algorithms = AnsiString('directory services - algorithms'); + NID_X500algorithms = 378; + + SN_rsa = AnsiString('RSA'); + LN_rsa = AnsiString('rsa'); + NID_rsa = 19; + + SN_mdc2WithRSA = AnsiString('RSA-MDC2'); + LN_mdc2WithRSA = AnsiString('mdc2WithRSA'); + NID_mdc2WithRSA = 96; + + SN_mdc2 = AnsiString('MDC2'); + LN_mdc2 = AnsiString('mdc2'); + NID_mdc2 = 95; + + SN_id_ce = AnsiString('id-ce'); + NID_id_ce = 81; + + SN_subject_directory_attributes = AnsiString('subjectDirectoryAttributes'); + LN_subject_directory_attributes = AnsiString('X509v3 Subject Directory Attributes'); + NID_subject_directory_attributes = 769; + + SN_subject_key_identifier = AnsiString('subjectKeyIdentifier'); + LN_subject_key_identifier = AnsiString('X509v3 Subject Key Identifier'); + NID_subject_key_identifier = 82; + + SN_key_usage = AnsiString('keyUsage'); + LN_key_usage = AnsiString('X509v3 Key Usage'); + NID_key_usage = 83; + + SN_private_key_usage_period = AnsiString('privateKeyUsagePeriod'); + LN_private_key_usage_period = AnsiString('X509v3 Private Key Usage Period'); + NID_private_key_usage_period = 84; + + SN_subject_alt_name = AnsiString('subjectAltName'); + LN_subject_alt_name = AnsiString('X509v3 Subject Alternative Name'); + NID_subject_alt_name = 85; + + SN_issuer_alt_name = AnsiString('issuerAltName'); + LN_issuer_alt_name = AnsiString('X509v3 Issuer Alternative Name'); + NID_issuer_alt_name = 86; + + SN_basic_constraints = AnsiString('basicConstraints'); + LN_basic_constraints = AnsiString('X509v3 Basic Constraints'); + NID_basic_constraints = 87; + + SN_crl_number = AnsiString('crlNumber'); + LN_crl_number = AnsiString('X509v3 CRL Number'); + NID_crl_number = 88; + + SN_crl_reason = AnsiString('CRLReason'); + LN_crl_reason = AnsiString('X509v3 CRL Reason Code'); + NID_crl_reason = 141; + + SN_invalidity_date = AnsiString('invalidityDate'); + LN_invalidity_date = AnsiString('Invalidity Date'); + NID_invalidity_date = 142; + + SN_delta_crl = AnsiString('deltaCRL'); + LN_delta_crl = AnsiString('X509v3 Delta CRL Indicator'); + NID_delta_crl = 140; + + SN_issuing_distribution_point = AnsiString('issuingDistributionPoint'); + LN_issuing_distribution_point = AnsiString('X509v3 Issuing Distribution Point'); + NID_issuing_distribution_point = 770; + + SN_certificate_issuer = AnsiString('certificateIssuer'); + LN_certificate_issuer = AnsiString('X509v3 Certificate Issuer'); + NID_certificate_issuer = 771; + + SN_name_constraints = AnsiString('nameConstraints'); + LN_name_constraints = AnsiString('X509v3 Name Constraints'); + NID_name_constraints = 666; + + SN_crl_distribution_points = AnsiString('crlDistributionPoints'); + LN_crl_distribution_points = AnsiString('X509v3 CRL Distribution Points'); + NID_crl_distribution_points = 103; + + SN_certificate_policies = AnsiString('certificatePolicies'); + LN_certificate_policies = AnsiString('X509v3 Certificate Policies'); + NID_certificate_policies = 89; + + SN_any_policy = AnsiString('anyPolicy'); + LN_any_policy = AnsiString('X509v3 Any Policy'); + NID_any_policy = 746; + + SN_policy_mappings = AnsiString('policyMappings'); + LN_policy_mappings = AnsiString('X509v3 Policy Mappings'); + NID_policy_mappings = 747; + + SN_authority_key_identifier = AnsiString('authorityKeyIdentifier'); + LN_authority_key_identifier = AnsiString('X509v3 Authority Key Identifier'); + NID_authority_key_identifier = 90; + + SN_policy_constraints = AnsiString('policyConstraints'); + LN_policy_constraints = AnsiString('X509v3 Policy Constraints'); + NID_policy_constraints = 401; + + SN_ext_key_usage = AnsiString('extendedKeyUsage'); + LN_ext_key_usage = AnsiString('X509v3 Extended Key Usage'); + NID_ext_key_usage = 126; + + SN_freshest_crl = AnsiString('freshestCRL'); + LN_freshest_crl = AnsiString('X509v3 Freshest CRL'); + NID_freshest_crl = 857; + + SN_inhibit_any_policy = AnsiString('inhibitAnyPolicy'); + LN_inhibit_any_policy = AnsiString('X509v3 Inhibit Any Policy'); + NID_inhibit_any_policy = 748; + + SN_target_information = AnsiString('targetInformation'); + LN_target_information = AnsiString('X509v3 AC Targeting'); + NID_target_information = 402; + + SN_no_rev_avail = AnsiString('noRevAvail'); + LN_no_rev_avail = AnsiString('X509v3 No Revocation Available'); + NID_no_rev_avail = 403; + + SN_anyExtendedKeyUsage = AnsiString('anyExtendedKeyUsage'); + LN_anyExtendedKeyUsage = AnsiString('Any Extended Key Usage'); + NID_anyExtendedKeyUsage = 910; + + SN_netscape = AnsiString('Netscape'); + LN_netscape = AnsiString('Netscape Communications Corp.'); + NID_netscape = 57; + + SN_netscape_cert_extension = AnsiString('nsCertExt'); + LN_netscape_cert_extension = AnsiString('Netscape Certificate Extension'); + NID_netscape_cert_extension = 58; + + SN_netscape_data_type = AnsiString('nsDataType'); + LN_netscape_data_type = AnsiString('Netscape Data Type'); + NID_netscape_data_type = 59; + + SN_netscape_cert_type = AnsiString('nsCertType'); + LN_netscape_cert_type = AnsiString('Netscape Cert Type'); + NID_netscape_cert_type = 71; + + SN_netscape_base_url = AnsiString('nsBaseUrl'); + LN_netscape_base_url = AnsiString('Netscape Base Url'); + NID_netscape_base_url = 72; + + SN_netscape_revocation_url = AnsiString('nsRevocationUrl'); + LN_netscape_revocation_url = AnsiString('Netscape Revocation Url'); + NID_netscape_revocation_url = 73; + + SN_netscape_ca_revocation_url = AnsiString('nsCaRevocationUrl'); + LN_netscape_ca_revocation_url = AnsiString('Netscape CA Revocation Url'); + NID_netscape_ca_revocation_url = 74; + + SN_netscape_renewal_url = AnsiString('nsRenewalUrl'); + LN_netscape_renewal_url = AnsiString('Netscape Renewal Url'); + NID_netscape_renewal_url = 75; + + SN_netscape_ca_policy_url = AnsiString('nsCaPolicyUrl'); + LN_netscape_ca_policy_url = AnsiString('Netscape CA Policy Url'); + NID_netscape_ca_policy_url = 76; + + SN_netscape_ssl_server_name = AnsiString('nsSslServerName'); + LN_netscape_ssl_server_name = AnsiString('Netscape Server: SSl Name'); + NID_netscape_ssl_server_name = 77; + + SN_netscape_comment = AnsiString('nsComment'); + LN_netscape_comment = AnsiString('Netscape Comment'); + NID_netscape_comment = 78; + + SN_netscape_cert_sequence = AnsiString('nsCertSequence'); + LN_netscape_cert_sequence = AnsiString('Netscape Certificate Sequence'); + NID_netscape_cert_sequence = 79; + + SN_ns_sgc = AnsiString('nsSGC'); + LN_ns_sgc = AnsiString('Netscape Server Gated Crypto'); + NID_ns_sgc = 139; + + SN_org = AnsiString('ORG'); + LN_org = AnsiString('org'); + NID_org = 379; + + SN_dod = AnsiString('DOD'); + LN_dod = AnsiString('dod'); + NID_dod = 380; + + SN_iana = AnsiString('IANA'); + LN_iana = AnsiString('iana'); + NID_iana = 381; + + SN_Directory = AnsiString('directory'); + LN_Directory = AnsiString('Directory'); + NID_Directory = 382; + + SN_Management = AnsiString('mgmt'); + LN_Management = AnsiString('Management'); + NID_Management = 383; + + SN_Experimental = AnsiString('experimental'); + LN_Experimental = AnsiString('Experimental'); + NID_Experimental = 384; + + SN_Private = AnsiString('private'); + LN_Private = AnsiString('Private'); + NID_Private = 385; + + SN_Security = AnsiString('security'); + LN_Security = AnsiString('Security'); + NID_Security = 386; + + SN_SNMPv2 = AnsiString('snmpv2'); + LN_SNMPv2 = AnsiString('SNMPv2'); + NID_SNMPv2 = 387; + + LN_Mail = AnsiString('Mail'); + NID_Mail = 388; + + SN_Enterprises = AnsiString('enterprises'); + LN_Enterprises = AnsiString('Enterprises'); + NID_Enterprises = 389; + + SN_dcObject = AnsiString('dcobject'); + LN_dcObject = AnsiString('dcObject'); + NID_dcObject = 390; + + SN_mime_mhs = AnsiString('mime-mhs'); + LN_mime_mhs = AnsiString('MIME MHS'); + NID_mime_mhs = 504; + + SN_mime_mhs_headings = AnsiString('mime-mhs-headings'); + LN_mime_mhs_headings = AnsiString('mime-mhs-headings'); + NID_mime_mhs_headings = 505; + + SN_mime_mhs_bodies = AnsiString('mime-mhs-bodies'); + LN_mime_mhs_bodies = AnsiString('mime-mhs-bodies'); + NID_mime_mhs_bodies = 506; + + SN_id_hex_partial_message = AnsiString('id-hex-partial-message'); + LN_id_hex_partial_message = AnsiString('id-hex-partial-message'); + NID_id_hex_partial_message = 507; + + SN_id_hex_multipart_message = AnsiString('id-hex-multipart-message'); + LN_id_hex_multipart_message = AnsiString('id-hex-multipart-message'); + NID_id_hex_multipart_message = 508; + + SN_zlib_compression = AnsiString('ZLIB'); + LN_zlib_compression = AnsiString('zlib compression'); + NID_zlib_compression = 125; + + SN_aes_128_ecb = AnsiString('AES-128-ECB'); + LN_aes_128_ecb = AnsiString('aes-128-ecb'); + NID_aes_128_ecb = 418; + + SN_aes_128_cbc = AnsiString('AES-128-CBC'); + LN_aes_128_cbc = AnsiString('aes-128-cbc'); + NID_aes_128_cbc = 419; + + SN_aes_128_ofb128 = AnsiString('AES-128-OFB'); + LN_aes_128_ofb128 = AnsiString('aes-128-ofb'); + NID_aes_128_ofb128 = 420; + + SN_aes_128_cfb128 = AnsiString('AES-128-CFB'); + LN_aes_128_cfb128 = AnsiString('aes-128-cfb'); + NID_aes_128_cfb128 = 421; + + SN_id_aes128_wrap = AnsiString('id-aes128-wrap'); + NID_id_aes128_wrap = 788; + + SN_aes_128_gcm = AnsiString('id-aes128-GCM'); + LN_aes_128_gcm = AnsiString('aes-128-gcm'); + NID_aes_128_gcm = 895; + + SN_aes_128_ccm = AnsiString('id-aes128-CCM'); + LN_aes_128_ccm = AnsiString('aes-128-ccm'); + NID_aes_128_ccm = 896; + + SN_id_aes128_wrap_pad = AnsiString('id-aes128-wrap-pad'); + NID_id_aes128_wrap_pad = 897; + + SN_aes_192_ecb = AnsiString('AES-192-ECB'); + LN_aes_192_ecb = AnsiString('aes-192-ecb'); + NID_aes_192_ecb = 422; + + SN_aes_192_cbc = AnsiString('AES-192-CBC'); + LN_aes_192_cbc = AnsiString('aes-192-cbc'); + NID_aes_192_cbc = 423; + + SN_aes_192_ofb128 = AnsiString('AES-192-OFB'); + LN_aes_192_ofb128 = AnsiString('aes-192-ofb'); + NID_aes_192_ofb128 = 424; + + SN_aes_192_cfb128 = AnsiString('AES-192-CFB'); + LN_aes_192_cfb128 = AnsiString('aes-192-cfb'); + NID_aes_192_cfb128 = 425; + + SN_id_aes192_wrap = AnsiString('id-aes192-wrap'); + NID_id_aes192_wrap = 789; + + SN_aes_192_gcm = AnsiString('id-aes192-GCM'); + LN_aes_192_gcm = AnsiString('aes-192-gcm'); + NID_aes_192_gcm = 898; + + SN_aes_192_ccm = AnsiString('id-aes192-CCM'); + LN_aes_192_ccm = AnsiString('aes-192-ccm'); + NID_aes_192_ccm = 899; + + SN_id_aes192_wrap_pad = AnsiString('id-aes192-wrap-pad'); + NID_id_aes192_wrap_pad = 900; + + SN_aes_256_ecb = AnsiString('AES-256-ECB'); + LN_aes_256_ecb = AnsiString('aes-256-ecb'); + NID_aes_256_ecb = 426; + + SN_aes_256_cbc = AnsiString('AES-256-CBC'); + LN_aes_256_cbc = AnsiString('aes-256-cbc'); + NID_aes_256_cbc = 427; + + SN_aes_256_ofb128 = AnsiString('AES-256-OFB'); + LN_aes_256_ofb128 = AnsiString('aes-256-ofb'); + NID_aes_256_ofb128 = 428; + + SN_aes_256_cfb128 = AnsiString('AES-256-CFB'); + LN_aes_256_cfb128 = AnsiString('aes-256-cfb'); + NID_aes_256_cfb128 = 429; + + SN_id_aes256_wrap = AnsiString('id-aes256-wrap'); + NID_id_aes256_wrap = 790; + + SN_aes_256_gcm = AnsiString('id-aes256-GCM'); + LN_aes_256_gcm = AnsiString('aes-256-gcm'); + NID_aes_256_gcm = 901; + + SN_aes_256_ccm = AnsiString('id-aes256-CCM'); + LN_aes_256_ccm = AnsiString('aes-256-ccm'); + NID_aes_256_ccm = 902; + + SN_id_aes256_wrap_pad = AnsiString('id-aes256-wrap-pad'); + NID_id_aes256_wrap_pad = 903; + + SN_aes_128_xts = AnsiString('AES-128-XTS'); + LN_aes_128_xts = AnsiString('aes-128-xts'); + NID_aes_128_xts = 913; + + SN_aes_256_xts = AnsiString('AES-256-XTS'); + LN_aes_256_xts = AnsiString('aes-256-xts'); + NID_aes_256_xts = 914; + + SN_aes_128_cfb1 = AnsiString('AES-128-CFB1'); + LN_aes_128_cfb1 = AnsiString('aes-128-cfb1'); + NID_aes_128_cfb1 = 650; + + SN_aes_192_cfb1 = AnsiString('AES-192-CFB1'); + LN_aes_192_cfb1 = AnsiString('aes-192-cfb1'); + NID_aes_192_cfb1 = 651; + + SN_aes_256_cfb1 = AnsiString('AES-256-CFB1'); + LN_aes_256_cfb1 = AnsiString('aes-256-cfb1'); + NID_aes_256_cfb1 = 652; + + SN_aes_128_cfb8 = AnsiString('AES-128-CFB8'); + LN_aes_128_cfb8 = AnsiString('aes-128-cfb8'); + NID_aes_128_cfb8 = 653; + + SN_aes_192_cfb8 = AnsiString('AES-192-CFB8'); + LN_aes_192_cfb8 = AnsiString('aes-192-cfb8'); + NID_aes_192_cfb8 = 654; + + SN_aes_256_cfb8 = AnsiString('AES-256-CFB8'); + LN_aes_256_cfb8 = AnsiString('aes-256-cfb8'); + NID_aes_256_cfb8 = 655; + + SN_aes_128_ctr = AnsiString('AES-128-CTR'); + LN_aes_128_ctr = AnsiString('aes-128-ctr'); + NID_aes_128_ctr = 904; + + SN_aes_192_ctr = AnsiString('AES-192-CTR'); + LN_aes_192_ctr = AnsiString('aes-192-ctr'); + NID_aes_192_ctr = 905; + + SN_aes_256_ctr = AnsiString('AES-256-CTR'); + LN_aes_256_ctr = AnsiString('aes-256-ctr'); + NID_aes_256_ctr = 906; + + SN_aes_128_ocb = AnsiString('AES-128-OCB'); + LN_aes_128_ocb = AnsiString('aes-128-ocb'); + NID_aes_128_ocb = 958; + + SN_aes_192_ocb = AnsiString('AES-192-OCB'); + LN_aes_192_ocb = AnsiString('aes-192-ocb'); + NID_aes_192_ocb = 959; + + SN_aes_256_ocb = AnsiString('AES-256-OCB'); + LN_aes_256_ocb = AnsiString('aes-256-ocb'); + NID_aes_256_ocb = 960; + + SN_des_cfb1 = AnsiString('DES-CFB1'); + LN_des_cfb1 = AnsiString('des-cfb1'); + NID_des_cfb1 = 656; + + SN_des_cfb8 = AnsiString('DES-CFB8'); + LN_des_cfb8 = AnsiString('des-cfb8'); + NID_des_cfb8 = 657; + + SN_des_ede3_cfb1 = AnsiString('DES-EDE3-CFB1'); + LN_des_ede3_cfb1 = AnsiString('des-ede3-cfb1'); + NID_des_ede3_cfb1 = 658; + + SN_des_ede3_cfb8 = AnsiString('DES-EDE3-CFB8'); + LN_des_ede3_cfb8 = AnsiString('des-ede3-cfb8'); + NID_des_ede3_cfb8 = 659; + + SN_sha256 = AnsiString('SHA256'); + LN_sha256 = AnsiString('sha256'); + NID_sha256 = 672; + + SN_sha384 = AnsiString('SHA384'); + LN_sha384 = AnsiString('sha384'); + NID_sha384 = 673; + + SN_sha512 = AnsiString('SHA512'); + LN_sha512 = AnsiString('sha512'); + NID_sha512 = 674; + + SN_sha224 = AnsiString('SHA224'); + LN_sha224 = AnsiString('sha224'); + NID_sha224 = 675; + + SN_sha512_224 = AnsiString('SHA512-224'); + LN_sha512_224 = AnsiString('sha512-224'); + NID_sha512_224 = 1094; + + SN_sha512_256 = AnsiString('SHA512-256'); + LN_sha512_256 = AnsiString('sha512-256'); + NID_sha512_256 = 1095; + + SN_sha3_224 = AnsiString('SHA3-224'); + LN_sha3_224 = AnsiString('sha3-224'); + NID_sha3_224 = 1096; + + SN_sha3_256 = AnsiString('SHA3-256'); + LN_sha3_256 = AnsiString('sha3-256'); + NID_sha3_256 = 1097; + + SN_sha3_384 = AnsiString('SHA3-384'); + LN_sha3_384 = AnsiString('sha3-384'); + NID_sha3_384 = 1098; + + SN_sha3_512 = AnsiString('SHA3-512'); + LN_sha3_512 = AnsiString('sha3-512'); + NID_sha3_512 = 1099; + + SN_shake128 = AnsiString('SHAKE128'); + LN_shake128 = AnsiString('shake128'); + NID_shake128 = 1100; + + SN_shake256 = AnsiString('SHAKE256'); + LN_shake256 = AnsiString('shake256'); + NID_shake256 = 1101; + + SN_hmac_sha3_224 = AnsiString('id-hmacWithSHA3-224'); + LN_hmac_sha3_224 = AnsiString('hmac-sha3-224'); + NID_hmac_sha3_224 = 1102; + + SN_hmac_sha3_256 = AnsiString('id-hmacWithSHA3-256'); + LN_hmac_sha3_256 = AnsiString('hmac-sha3-256'); + NID_hmac_sha3_256 = 1103; + + SN_hmac_sha3_384 = AnsiString('id-hmacWithSHA3-384'); + LN_hmac_sha3_384 = AnsiString('hmac-sha3-384'); + NID_hmac_sha3_384 = 1104; + + SN_hmac_sha3_512 = AnsiString('id-hmacWithSHA3-512'); + LN_hmac_sha3_512 = AnsiString('hmac-sha3-512'); + NID_hmac_sha3_512 = 1105; + + SN_dsa_with_SHA224 = AnsiString('dsa_with_SHA224'); + NID_dsa_with_SHA224 = 802; + + SN_dsa_with_SHA256 = AnsiString('dsa_with_SHA256'); + NID_dsa_with_SHA256 = 803; + + SN_dsa_with_SHA384 = AnsiString('id-dsa-with-sha384'); + LN_dsa_with_SHA384 = AnsiString('dsa_with_SHA384'); + NID_dsa_with_SHA384 = 1106; + + SN_dsa_with_SHA512 = AnsiString('id-dsa-with-sha512'); + LN_dsa_with_SHA512 = AnsiString('dsa_with_SHA512'); + NID_dsa_with_SHA512 = 1107; + + SN_dsa_with_SHA3_224 = AnsiString('id-dsa-with-sha3-224'); + LN_dsa_with_SHA3_224 = AnsiString('dsa_with_SHA3-224'); + NID_dsa_with_SHA3_224 = 1108; + + SN_dsa_with_SHA3_256 = AnsiString('id-dsa-with-sha3-256'); + LN_dsa_with_SHA3_256 = AnsiString('dsa_with_SHA3-256'); + NID_dsa_with_SHA3_256 = 1109; + + SN_dsa_with_SHA3_384 = AnsiString('id-dsa-with-sha3-384'); + LN_dsa_with_SHA3_384 = AnsiString('dsa_with_SHA3-384'); + NID_dsa_with_SHA3_384 = 1110; + + SN_dsa_with_SHA3_512 = AnsiString('id-dsa-with-sha3-512'); + LN_dsa_with_SHA3_512 = AnsiString('dsa_with_SHA3-512'); + NID_dsa_with_SHA3_512 = 1111; + + SN_ecdsa_with_SHA3_224 = AnsiString('id-ecdsa-with-sha3-224'); + LN_ecdsa_with_SHA3_224 = AnsiString('ecdsa_with_SHA3-224'); + NID_ecdsa_with_SHA3_224 = 1112; + + SN_ecdsa_with_SHA3_256 = AnsiString('id-ecdsa-with-sha3-256'); + LN_ecdsa_with_SHA3_256 = AnsiString('ecdsa_with_SHA3-256'); + NID_ecdsa_with_SHA3_256 = 1113; + + SN_ecdsa_with_SHA3_384 = AnsiString('id-ecdsa-with-sha3-384'); + LN_ecdsa_with_SHA3_384 = AnsiString('ecdsa_with_SHA3-384'); + NID_ecdsa_with_SHA3_384 = 1114; + + SN_ecdsa_with_SHA3_512 = AnsiString('id-ecdsa-with-sha3-512'); + LN_ecdsa_with_SHA3_512 = AnsiString('ecdsa_with_SHA3-512'); + NID_ecdsa_with_SHA3_512 = 1115; + + SN_RSA_SHA3_224 = AnsiString('id-rsassa-pkcs1-v1_5-with-sha3-224'); + LN_RSA_SHA3_224 = AnsiString('RSA-SHA3-224'); + NID_RSA_SHA3_224 = 1116; + + SN_RSA_SHA3_256 = AnsiString('id-rsassa-pkcs1-v1_5-with-sha3-256'); + LN_RSA_SHA3_256 = AnsiString('RSA-SHA3-256'); + NID_RSA_SHA3_256 = 1117; + + SN_RSA_SHA3_384 = AnsiString('id-rsassa-pkcs1-v1_5-with-sha3-384'); + LN_RSA_SHA3_384 = AnsiString('RSA-SHA3-384'); + NID_RSA_SHA3_384 = 1118; + + SN_RSA_SHA3_512 = AnsiString('id-rsassa-pkcs1-v1_5-with-sha3-512'); + LN_RSA_SHA3_512 = AnsiString('RSA-SHA3-512'); + NID_RSA_SHA3_512 = 1119; + + SN_hold_instruction_code = AnsiString('holdInstructionCode'); + LN_hold_instruction_code = AnsiString('Hold Instruction Code'); + NID_hold_instruction_code = 430; + + SN_hold_instruction_none = AnsiString('holdInstructionNone'); + LN_hold_instruction_none = AnsiString('Hold Instruction None'); + NID_hold_instruction_none = 431; + + SN_hold_instruction_call_issuer = AnsiString('holdInstructionCallIssuer'); + LN_hold_instruction_call_issuer = AnsiString('Hold Instruction Call Issuer'); + NID_hold_instruction_call_issuer = 432; + + SN_hold_instruction_reject = AnsiString('holdInstructionReject'); + LN_hold_instruction_reject = AnsiString('Hold Instruction Reject'); + NID_hold_instruction_reject = 433; + + SN_data = AnsiString('data'); + NID_data = 434; + + SN_pss = AnsiString('pss'); + NID_pss = 435; + + SN_ucl = AnsiString('ucl'); + NID_ucl = 436; + + SN_pilot = AnsiString('pilot'); + NID_pilot = 437; + + LN_pilotAttributeType = AnsiString('pilotAttributeType'); + NID_pilotAttributeType = 438; + + LN_pilotAttributeSyntax = AnsiString('pilotAttributeSyntax'); + NID_pilotAttributeSyntax = 439; + + LN_pilotObjectClass = AnsiString('pilotObjectClass'); + NID_pilotObjectClass = 440; + + LN_pilotGroups = AnsiString('pilotGroups'); + NID_pilotGroups = 441; + + LN_iA5StringSyntax = AnsiString('iA5StringSyntax'); + NID_iA5StringSyntax = 442; + + LN_caseIgnoreIA5StringSyntax = AnsiString('caseIgnoreIA5StringSyntax'); + NID_caseIgnoreIA5StringSyntax = 443; + + LN_pilotObject = AnsiString('pilotObject'); + NID_pilotObject = 444; + + LN_pilotPerson = AnsiString('pilotPerson'); + NID_pilotPerson = 445; + + SN_account = AnsiString('account'); + NID_account = 446; + + SN_document = AnsiString('document'); + NID_document = 447; + + SN_room = AnsiString('room'); + NID_room = 448; + + LN_documentSeries = AnsiString('documentSeries'); + NID_documentSeries = 449; + + SN_Domain = AnsiString('domain'); + LN_Domain = AnsiString('Domain'); + NID_Domain = 392; + + LN_rFC822localPart = AnsiString('rFC822localPart'); + NID_rFC822localPart = 450; + + LN_dNSDomain = AnsiString('dNSDomain'); + NID_dNSDomain = 451; + + LN_domainRelatedObject = AnsiString('domainRelatedObject'); + NID_domainRelatedObject = 452; + + LN_friendlyCountry = AnsiString('friendlyCountry'); + NID_friendlyCountry = 453; + + LN_simpleSecurityObject = AnsiString('simpleSecurityObject'); + NID_simpleSecurityObject = 454; + + LN_pilotOrganization = AnsiString('pilotOrganization'); + NID_pilotOrganization = 455; + + LN_pilotDSA = AnsiString('pilotDSA'); + NID_pilotDSA = 456; + + LN_qualityLabelledData = AnsiString('qualityLabelledData'); + NID_qualityLabelledData = 457; + + SN_userId = AnsiString('UID'); + LN_userId = AnsiString('userId'); + NID_userId = 458; + + LN_textEncodedORAddress = AnsiString('textEncodedORAddress'); + NID_textEncodedORAddress = 459; + + SN_rfc822Mailbox = AnsiString('mail'); + LN_rfc822Mailbox = AnsiString('rfc822Mailbox'); + NID_rfc822Mailbox = 460; + + SN_info = AnsiString('info'); + NID_info = 461; + + LN_favouriteDrink = AnsiString('favouriteDrink'); + NID_favouriteDrink = 462; + + LN_roomNumber = AnsiString('roomNumber'); + NID_roomNumber = 463; + + SN_photo = AnsiString('photo'); + NID_photo = 464; + + LN_userClass = AnsiString('userClass'); + NID_userClass = 465; + + SN_host = AnsiString('host'); + NID_host = 466; + + SN_manager = AnsiString('manager'); + NID_manager = 467; + + LN_documentIdentifier = AnsiString('documentIdentifier'); + NID_documentIdentifier = 468; + + LN_documentTitle = AnsiString('documentTitle'); + NID_documentTitle = 469; + + LN_documentVersion = AnsiString('documentVersion'); + NID_documentVersion = 470; + + LN_documentAuthor = AnsiString('documentAuthor'); + NID_documentAuthor = 471; + + LN_documentLocation = AnsiString('documentLocation'); + NID_documentLocation = 472; + + LN_homeTelephoneNumber = AnsiString('homeTelephoneNumber'); + NID_homeTelephoneNumber = 473; + + SN_secretary = AnsiString('secretary'); + NID_secretary = 474; + + LN_otherMailbox = AnsiString('otherMailbox'); + NID_otherMailbox = 475; + + LN_lastModifiedTime = AnsiString('lastModifiedTime'); + NID_lastModifiedTime = 476; + + LN_lastModifiedBy = AnsiString('lastModifiedBy'); + NID_lastModifiedBy = 477; + + SN_domainComponent = AnsiString('DC'); + LN_domainComponent = AnsiString('domainComponent'); + NID_domainComponent = 391; + + LN_aRecord = AnsiString('aRecord'); + NID_aRecord = 478; + + LN_pilotAttributeType27 = AnsiString('pilotAttributeType27'); + NID_pilotAttributeType27 = 479; + + LN_mXRecord = AnsiString('mXRecord'); + NID_mXRecord = 480; + + LN_nSRecord = AnsiString('nSRecord'); + NID_nSRecord = 481; + + LN_sOARecord = AnsiString('sOARecord'); + NID_sOARecord = 482; + + LN_cNAMERecord = AnsiString('cNAMERecord'); + NID_cNAMERecord = 483; + + LN_associatedDomain = AnsiString('associatedDomain'); + NID_associatedDomain = 484; + + LN_associatedName = AnsiString('associatedName'); + NID_associatedName = 485; + + LN_homePostalAddress = AnsiString('homePostalAddress'); + NID_homePostalAddress = 486; + + LN_personalTitle = AnsiString('personalTitle'); + NID_personalTitle = 487; + + LN_mobileTelephoneNumber = AnsiString('mobileTelephoneNumber'); + NID_mobileTelephoneNumber = 488; + + LN_pagerTelephoneNumber = AnsiString('pagerTelephoneNumber'); + NID_pagerTelephoneNumber = 489; + + LN_friendlyCountryName = AnsiString('friendlyCountryName'); + NID_friendlyCountryName = 490; + + SN_uniqueIdentifier = AnsiString('uid'); + LN_uniqueIdentifier = AnsiString('uniqueIdentifier'); + NID_uniqueIdentifier = 102; + + LN_organizationalStatus = AnsiString('organizationalStatus'); + NID_organizationalStatus = 491; + + LN_janetMailbox = AnsiString('janetMailbox'); + NID_janetMailbox = 492; + LN_mailPreferenceOption = AnsiString('mailPreferenceOption'); + NID_mailPreferenceOption = 493; + + LN_buildingName = AnsiString('buildingName'); + NID_buildingName = 494; + + LN_dSAQuality = AnsiString('dSAQuality'); + NID_dSAQuality = 495; + + LN_singleLevelQuality = AnsiString('singleLevelQuality'); + NID_singleLevelQuality = 496; + + LN_subtreeMinimumQuality = AnsiString('subtreeMinimumQuality'); + NID_subtreeMinimumQuality = 497; + + LN_subtreeMaximumQuality = AnsiString('subtreeMaximumQuality'); + NID_subtreeMaximumQuality = 498; + + LN_personalSignature = AnsiString('personalSignature'); + NID_personalSignature = 499; + + LN_dITRedirect = AnsiString('dITRedirect'); + NID_dITRedirect = 500; + + SN_audio = AnsiString('audio'); + NID_audio = 501; + + LN_documentPublisher = AnsiString('documentPublisher'); + NID_documentPublisher = 502; + + SN_id_set = AnsiString('id-set'); + LN_id_set = AnsiString('Secure Electronic Transactions'); + NID_id_set = 512; + + SN_set_ctype = AnsiString('set-ctype'); + LN_set_ctype = AnsiString('content types'); + NID_set_ctype = 513; + + SN_set_msgExt = AnsiString('set-msgExt'); + LN_set_msgExt = AnsiString('message extensions'); + NID_set_msgExt = 514; + + SN_set_attr = AnsiString('set-attr'); + NID_set_attr = 515; + + SN_set_policy = AnsiString('set-policy'); + NID_set_policy = 516; + + SN_set_certExt = AnsiString('set-certExt'); + LN_set_certExt = AnsiString('certificate extensions'); + NID_set_certExt = 517; + + SN_set_brand = AnsiString('set-brand'); + NID_set_brand = 518; + + SN_setct_PANData = AnsiString('setct-PANData'); + NID_setct_PANData = 519; + + SN_setct_PANToken = AnsiString('setct-PANToken'); + NID_setct_PANToken = 520; + + SN_setct_PANOnly = AnsiString('setct-PANOnly'); + NID_setct_PANOnly = 521; + + SN_setct_OIData = AnsiString('setct-OIData'); + NID_setct_OIData = 522; + + SN_setct_PI = AnsiString('setct-PI'); + NID_setct_PI = 523; + + SN_setct_PIData = AnsiString('setct-PIData'); + NID_setct_PIData = 524; + + SN_setct_PIDataUnsigned = AnsiString('setct-PIDataUnsigned'); + NID_setct_PIDataUnsigned = 525; + + SN_setct_HODInput = AnsiString('setct-HODInput'); + NID_setct_HODInput = 526; + + SN_setct_AuthResBaggage = AnsiString('setct-AuthResBaggage'); + NID_setct_AuthResBaggage = 527; + + SN_setct_AuthRevReqBaggage = AnsiString('setct-AuthRevReqBaggage'); + NID_setct_AuthRevReqBaggage = 528; + + SN_setct_AuthRevResBaggage = AnsiString('setct-AuthRevResBaggage'); + NID_setct_AuthRevResBaggage = 529; + + SN_setct_CapTokenSeq = AnsiString('setct-CapTokenSeq'); + NID_setct_CapTokenSeq = 530; + + SN_setct_PInitResData = AnsiString('setct-PInitResData'); + NID_setct_PInitResData = 531; + + SN_setct_PI_TBS = AnsiString('setct-PI-TBS'); + NID_setct_PI_TBS = 532; + + SN_setct_PResData = AnsiString('setct-PResData'); + NID_setct_PResData = 533; + + SN_setct_AuthReqTBS = AnsiString('setct-AuthReqTBS'); + NID_setct_AuthReqTBS = 534; + + SN_setct_AuthResTBS = AnsiString('setct-AuthResTBS'); + NID_setct_AuthResTBS = 535; + + SN_setct_AuthResTBSX = AnsiString('setct-AuthResTBSX'); + NID_setct_AuthResTBSX = 536; + + SN_setct_AuthTokenTBS = AnsiString('setct-AuthTokenTBS'); + NID_setct_AuthTokenTBS = 537; + + SN_setct_CapTokenData = AnsiString('setct-CapTokenData'); + NID_setct_CapTokenData = 538; + + SN_setct_CapTokenTBS = AnsiString('setct-CapTokenTBS'); + NID_setct_CapTokenTBS = 539; + + SN_setct_AcqCardCodeMsg = AnsiString('setct-AcqCardCodeMsg'); + NID_setct_AcqCardCodeMsg = 540; + + SN_setct_AuthRevReqTBS = AnsiString('setct-AuthRevReqTBS'); + NID_setct_AuthRevReqTBS = 541; + + SN_setct_AuthRevResData = AnsiString('setct-AuthRevResData'); + NID_setct_AuthRevResData = 542; + + SN_setct_AuthRevResTBS = AnsiString('setct-AuthRevResTBS'); + NID_setct_AuthRevResTBS = 543; + + SN_setct_CapReqTBS = AnsiString('setct-CapReqTBS'); + NID_setct_CapReqTBS = 544; + + SN_setct_CapReqTBSX = AnsiString('setct-CapReqTBSX'); + NID_setct_CapReqTBSX = 545; + + SN_setct_CapResData = AnsiString('setct-CapResData'); + NID_setct_CapResData = 546; + + SN_setct_CapRevReqTBS = AnsiString('setct-CapRevReqTBS'); + NID_setct_CapRevReqTBS = 547; + + SN_setct_CapRevReqTBSX = AnsiString('setct-CapRevReqTBSX'); + NID_setct_CapRevReqTBSX = 548; + + SN_setct_CapRevResData = AnsiString('setct-CapRevResData'); + NID_setct_CapRevResData = 549; + + SN_setct_CredReqTBS = AnsiString('setct-CredReqTBS'); + NID_setct_CredReqTBS = 550; + + SN_setct_CredReqTBSX = AnsiString('setct-CredReqTBSX'); + NID_setct_CredReqTBSX = 551; + + SN_setct_CredResData = AnsiString('setct-CredResData'); + NID_setct_CredResData = 552; + + SN_setct_CredRevReqTBS = AnsiString('setct-CredRevReqTBS'); + NID_setct_CredRevReqTBS = 553; + + SN_setct_CredRevReqTBSX = AnsiString('setct-CredRevReqTBSX'); + NID_setct_CredRevReqTBSX = 554; + + SN_setct_CredRevResData = AnsiString('setct-CredRevResData'); + NID_setct_CredRevResData = 555; + + SN_setct_PCertReqData = AnsiString('setct-PCertReqData'); + NID_setct_PCertReqData = 556; + + SN_setct_PCertResTBS = AnsiString('setct-PCertResTBS'); + NID_setct_PCertResTBS = 557; + + SN_setct_BatchAdminReqData = AnsiString('setct-BatchAdminReqData'); + NID_setct_BatchAdminReqData = 558; + + SN_setct_BatchAdminResData = AnsiString('setct-BatchAdminResData'); + NID_setct_BatchAdminResData = 559; + + SN_setct_CardCInitResTBS = AnsiString('setct-CardCInitResTBS'); + NID_setct_CardCInitResTBS = 560; + + SN_setct_MeAqCInitResTBS = AnsiString('setct-MeAqCInitResTBS'); + NID_setct_MeAqCInitResTBS = 561; + + SN_setct_RegFormResTBS = AnsiString('setct-RegFormResTBS'); + NID_setct_RegFormResTBS = 562; + + SN_setct_CertReqData = AnsiString('setct-CertReqData'); + NID_setct_CertReqData = 563; + + SN_setct_CertReqTBS = AnsiString('setct-CertReqTBS'); + NID_setct_CertReqTBS = 564; + + SN_setct_CertResData = AnsiString('setct-CertResData'); + NID_setct_CertResData = 565; + + SN_setct_CertInqReqTBS = AnsiString('setct-CertInqReqTBS'); + NID_setct_CertInqReqTBS = 566; + + SN_setct_ErrorTBS = AnsiString('setct-ErrorTBS'); + NID_setct_ErrorTBS = 567; + + SN_setct_PIDualSignedTBE = AnsiString('setct-PIDualSignedTBE'); + NID_setct_PIDualSignedTBE = 568; + + SN_setct_PIUnsignedTBE = AnsiString('setct-PIUnsignedTBE'); + NID_setct_PIUnsignedTBE = 569; + + SN_setct_AuthReqTBE = AnsiString('setct-AuthReqTBE'); + NID_setct_AuthReqTBE = 570; + + SN_setct_AuthResTBE = AnsiString('setct-AuthResTBE'); + NID_setct_AuthResTBE = 571; + + SN_setct_AuthResTBEX = AnsiString('setct-AuthResTBEX'); + NID_setct_AuthResTBEX = 572; + + SN_setct_AuthTokenTBE = AnsiString('setct-AuthTokenTBE'); + NID_setct_AuthTokenTBE = 573; + + SN_setct_CapTokenTBE = AnsiString('setct-CapTokenTBE'); + NID_setct_CapTokenTBE = 574; + + SN_setct_CapTokenTBEX = AnsiString('setct-CapTokenTBEX'); + NID_setct_CapTokenTBEX = 575; + + SN_setct_AcqCardCodeMsgTBE = AnsiString('setct-AcqCardCodeMsgTBE'); + NID_setct_AcqCardCodeMsgTBE = 576; + + SN_setct_AuthRevReqTBE = AnsiString('setct-AuthRevReqTBE'); + NID_setct_AuthRevReqTBE = 577; + + SN_setct_AuthRevResTBE = AnsiString('setct-AuthRevResTBE'); + NID_setct_AuthRevResTBE = 578; + + SN_setct_AuthRevResTBEB = AnsiString('setct-AuthRevResTBEB'); + NID_setct_AuthRevResTBEB = 579; + + SN_setct_CapReqTBE = AnsiString('setct-CapReqTBE'); + NID_setct_CapReqTBE = 580; + + SN_setct_CapReqTBEX = AnsiString('setct-CapReqTBEX'); + NID_setct_CapReqTBEX = 581; + + SN_setct_CapResTBE = AnsiString('setct-CapResTBE'); + NID_setct_CapResTBE = 582; + + SN_setct_CapRevReqTBE = AnsiString('setct-CapRevReqTBE'); + NID_setct_CapRevReqTBE = 583; + + SN_setct_CapRevReqTBEX = AnsiString('setct-CapRevReqTBEX'); + NID_setct_CapRevReqTBEX = 584; + + SN_setct_CapRevResTBE = AnsiString('setct-CapRevResTBE'); + NID_setct_CapRevResTBE = 585; + + SN_setct_CredReqTBE = AnsiString('setct-CredReqTBE'); + NID_setct_CredReqTBE = 586; + + SN_setct_CredReqTBEX = AnsiString('setct-CredReqTBEX'); + NID_setct_CredReqTBEX = 587; + + SN_setct_CredResTBE = AnsiString('setct-CredResTBE'); + NID_setct_CredResTBE = 588; + + SN_setct_CredRevReqTBE = AnsiString('setct-CredRevReqTBE'); + NID_setct_CredRevReqTBE = 589; + + SN_setct_CredRevReqTBEX = AnsiString('setct-CredRevReqTBEX'); + NID_setct_CredRevReqTBEX = 590; + + SN_setct_CredRevResTBE = AnsiString('setct-CredRevResTBE'); + NID_setct_CredRevResTBE = 591; + + SN_setct_BatchAdminReqTBE = AnsiString('setct-BatchAdminReqTBE'); + NID_setct_BatchAdminReqTBE = 592; + + SN_setct_BatchAdminResTBE = AnsiString('setct-BatchAdminResTBE'); + NID_setct_BatchAdminResTBE = 593; + + SN_setct_RegFormReqTBE = AnsiString('setct-RegFormReqTBE'); + NID_setct_RegFormReqTBE = 594; + + SN_setct_CertReqTBE = AnsiString('setct-CertReqTBE'); + NID_setct_CertReqTBE = 595; + + SN_setct_CertReqTBEX = AnsiString('setct-CertReqTBEX'); + NID_setct_CertReqTBEX = 596; + + SN_setct_CertResTBE = AnsiString('setct-CertResTBE'); + NID_setct_CertResTBE = 597; + + SN_setct_CRLNotificationTBS = AnsiString('setct-CRLNotificationTBS'); + NID_setct_CRLNotificationTBS = 598; + + SN_setct_CRLNotificationResTBS = AnsiString('setct-CRLNotificationResTBS'); + NID_setct_CRLNotificationResTBS = 599; + + SN_setct_BCIDistributionTBS = AnsiString('setct-BCIDistributionTBS'); + NID_setct_BCIDistributionTBS = 600; + + SN_setext_genCrypt = AnsiString('setext-genCrypt'); + LN_setext_genCrypt = AnsiString('generic cryptogram'); + NID_setext_genCrypt = 601; + + SN_setext_miAuth = AnsiString('setext-miAuth'); + LN_setext_miAuth = AnsiString('merchant initiated auth'); + NID_setext_miAuth = 602; + + SN_setext_pinSecure = AnsiString('setext-pinSecure'); + NID_setext_pinSecure = 603; + + SN_setext_pinAny = AnsiString('setext-pinAny'); + NID_setext_pinAny = 604; + + SN_setext_track2 = AnsiString('setext-track2'); + NID_setext_track2 = 605; + + SN_setext_cv = AnsiString('setext-cv'); + LN_setext_cv = AnsiString('additional verification'); + NID_setext_cv = 606; + + SN_set_policy_root = AnsiString('set-policy-root'); + NID_set_policy_root = 607; + + SN_setCext_hashedRoot = AnsiString('setCext-hashedRoot'); + NID_setCext_hashedRoot = 608; + + SN_setCext_certType = AnsiString('setCext-certType'); + NID_setCext_certType = 609; + + SN_setCext_merchData = AnsiString('setCext-merchData'); + NID_setCext_merchData = 610; + + SN_setCext_cCertRequired = AnsiString('setCext-cCertRequired'); + NID_setCext_cCertRequired = 611; + + SN_setCext_tunneling = AnsiString('setCext-tunneling'); + NID_setCext_tunneling = 612; + + SN_setCext_setExt = AnsiString('setCext-setExt'); + NID_setCext_setExt = 613; + + SN_setCext_setQualf = AnsiString('setCext-setQualf'); + NID_setCext_setQualf = 614; + + SN_setCext_PGWYcapabilities = AnsiString('setCext-PGWYcapabilities'); + NID_setCext_PGWYcapabilities = 615; + + SN_setCext_TokenIdentifier = AnsiString('setCext-TokenIdentifier'); + NID_setCext_TokenIdentifier = 616; + + SN_setCext_Track2Data = AnsiString('setCext-Track2Data'); + NID_setCext_Track2Data = 617; + + SN_setCext_TokenType = AnsiString('setCext-TokenType'); + NID_setCext_TokenType = 618; + + SN_setCext_IssuerCapabilities = AnsiString('setCext-IssuerCapabilities'); + NID_setCext_IssuerCapabilities = 619; + + SN_setAttr_Cert = AnsiString('setAttr-Cert'); + NID_setAttr_Cert = 620; + + SN_setAttr_PGWYcap = AnsiString('setAttr-PGWYcap'); + LN_setAttr_PGWYcap = AnsiString('payment gateway capabilities'); + NID_setAttr_PGWYcap = 621; + + SN_setAttr_TokenType = AnsiString('setAttr-TokenType'); + NID_setAttr_TokenType = 622; + + SN_setAttr_IssCap = AnsiString('setAttr-IssCap'); + LN_setAttr_IssCap = AnsiString('issuer capabilities'); + NID_setAttr_IssCap = 623; + + SN_set_rootKeyThumb = AnsiString('set-rootKeyThumb'); + NID_set_rootKeyThumb = 624; + + SN_set_addPolicy = AnsiString('set-addPolicy'); + NID_set_addPolicy = 625; + + SN_setAttr_Token_EMV = AnsiString('setAttr-Token-EMV'); + NID_setAttr_Token_EMV = 626; + + SN_setAttr_Token_B0Prime = AnsiString('setAttr-Token-B0Prime'); + NID_setAttr_Token_B0Prime = 627; + + SN_setAttr_IssCap_CVM = AnsiString('setAttr-IssCap-CVM'); + NID_setAttr_IssCap_CVM = 628; + + SN_setAttr_IssCap_T2 = AnsiString('setAttr-IssCap-T2'); + NID_setAttr_IssCap_T2 = 629; + + SN_setAttr_IssCap_Sig = AnsiString('setAttr-IssCap-Sig'); + NID_setAttr_IssCap_Sig = 630; + + SN_setAttr_GenCryptgrm = AnsiString('setAttr-GenCryptgrm'); + LN_setAttr_GenCryptgrm = AnsiString('generate cryptogram'); + NID_setAttr_GenCryptgrm = 631; + + SN_setAttr_T2Enc = AnsiString('setAttr-T2Enc'); + LN_setAttr_T2Enc = AnsiString('encrypted track 2'); + NID_setAttr_T2Enc = 632; + + SN_setAttr_T2cleartxt = AnsiString('setAttr-T2cleartxt'); + LN_setAttr_T2cleartxt = AnsiString('cleartext track 2'); + NID_setAttr_T2cleartxt = 633; + + SN_setAttr_TokICCsig = AnsiString('setAttr-TokICCsig'); + LN_setAttr_TokICCsig = AnsiString('ICC or token signature'); + NID_setAttr_TokICCsig = 634; + + SN_setAttr_SecDevSig = AnsiString('setAttr-SecDevSig'); + LN_setAttr_SecDevSig = AnsiString('secure device signature'); + NID_setAttr_SecDevSig = 635; + + SN_set_brand_IATA_ATA = AnsiString('set-brand-IATA-ATA'); + NID_set_brand_IATA_ATA = 636; + + SN_set_brand_Diners = AnsiString('set-brand-Diners'); + NID_set_brand_Diners = 637; + + SN_set_brand_AmericanExpress = AnsiString('set-brand-AmericanExpress'); + NID_set_brand_AmericanExpress = 638; + + SN_set_brand_JCB = AnsiString('set-brand-JCB'); + NID_set_brand_JCB = 639; + + SN_set_brand_Visa = AnsiString('set-brand-Visa'); + NID_set_brand_Visa = 640; + + SN_set_brand_MasterCard = AnsiString('set-brand-MasterCard'); + NID_set_brand_MasterCard = 641; + + SN_set_brand_Novus = AnsiString('set-brand-Novus'); + NID_set_brand_Novus = 642; + + SN_des_cdmf = AnsiString('DES-CDMF'); + LN_des_cdmf = AnsiString('des-cdmf'); + NID_des_cdmf = 643; + + SN_rsaOAEPEncryptionSET = AnsiString('rsaOAEPEncryptionSET'); + NID_rsaOAEPEncryptionSET = 644; + + SN_ipsec3 = AnsiString('Oakley-EC2N-3'); + LN_ipsec3 = AnsiString('ipsec3'); + NID_ipsec3 = 749; + + SN_ipsec4 = AnsiString('Oakley-EC2N-4'); + LN_ipsec4 = AnsiString('ipsec4'); + NID_ipsec4 = 750; + + SN_whirlpool = AnsiString('whirlpool'); + NID_whirlpool = 804; + + SN_cryptopro = AnsiString('cryptopro'); + NID_cryptopro = 805; + + SN_cryptocom = AnsiString('cryptocom'); + NID_cryptocom = 806; + + SN_id_tc26 = AnsiString('id-tc26'); + NID_id_tc26 = 974; + + SN_id_GostR3411_94_with_GostR3410_2001 = AnsiString('id-GostR3411-94-with-GostR3410-2001'); + LN_id_GostR3411_94_with_GostR3410_2001 = AnsiString('GOST R 34.11-94 with GOST R 34.10-2001'); + NID_id_GostR3411_94_with_GostR3410_2001 = 807; + + SN_id_GostR3411_94_with_GostR3410_94 = AnsiString('id-GostR3411-94-with-GostR3410-94'); + LN_id_GostR3411_94_with_GostR3410_94 = AnsiString('GOST R 34.11-94 with GOST R 34.10-94'); + NID_id_GostR3411_94_with_GostR3410_94 = 808; + + SN_id_GostR3411_94 = AnsiString('md_gost94'); + LN_id_GostR3411_94 = AnsiString('GOST R 34.11-94'); + NID_id_GostR3411_94 = 809; + + SN_id_HMACGostR3411_94 = AnsiString('id-HMACGostR3411-94'); + LN_id_HMACGostR3411_94 = AnsiString('HMAC GOST 34.11-94'); + NID_id_HMACGostR3411_94 = 810; + + SN_id_GostR3410_2001 = AnsiString('gost2001'); + LN_id_GostR3410_2001 = AnsiString('GOST R 34.10-2001'); + NID_id_GostR3410_2001 = 811; + + SN_id_GostR3410_94 = AnsiString('gost94'); + LN_id_GostR3410_94 = AnsiString('GOST R 34.10-94'); + NID_id_GostR3410_94 = 812; + + SN_id_Gost28147_89 = AnsiString('gost89'); + LN_id_Gost28147_89 = AnsiString('GOST 28147-89'); + NID_id_Gost28147_89 = 813; + + SN_gost89_cnt = AnsiString('gost89-cnt'); + NID_gost89_cnt = 814; + + SN_gost89_cnt_12 = AnsiString('gost89-cnt-12'); + NID_gost89_cnt_12 = 975; + + SN_gost89_cbc = AnsiString('gost89-cbc'); + NID_gost89_cbc = 1009; + + SN_gost89_ecb = AnsiString('gost89-ecb'); + NID_gost89_ecb = 1010; + + SN_gost89_ctr = AnsiString('gost89-ctr'); + NID_gost89_ctr = 1011; + + SN_id_Gost28147_89_MAC = AnsiString('gost-mac'); + LN_id_Gost28147_89_MAC = AnsiString('GOST 28147-89 MAC'); + NID_id_Gost28147_89_MAC = 815; + + SN_gost_mac_12 = AnsiString('gost-mac-12'); + NID_gost_mac_12 = 976; + + SN_id_GostR3411_94_prf = AnsiString('prf-gostr3411-94'); + LN_id_GostR3411_94_prf = AnsiString('GOST R 34.11-94 PRF'); + NID_id_GostR3411_94_prf = 816; + + SN_id_GostR3410_2001DH = AnsiString('id-GostR3410-2001DH'); + LN_id_GostR3410_2001DH = AnsiString('GOST R 34.10-2001 DH'); + NID_id_GostR3410_2001DH = 817; + + SN_id_GostR3410_94DH = AnsiString('id-GostR3410-94DH'); + LN_id_GostR3410_94DH = AnsiString('GOST R 34.10-94 DH'); + NID_id_GostR3410_94DH = 818; + + SN_id_Gost28147_89_CryptoPro_KeyMeshing = AnsiString('id-Gost28147-89-CryptoPro-KeyMeshing'); + NID_id_Gost28147_89_CryptoPro_KeyMeshing = 819; + + SN_id_Gost28147_89_None_KeyMeshing = AnsiString('id-Gost28147-89-None-KeyMeshing'); + NID_id_Gost28147_89_None_KeyMeshing = 820; + + SN_id_GostR3411_94_TestParamSet = AnsiString('id-GostR3411-94-TestParamSet'); + NID_id_GostR3411_94_TestParamSet = 821; + + SN_id_GostR3411_94_CryptoProParamSet = AnsiString('id-GostR3411-94-CryptoProParamSet'); + NID_id_GostR3411_94_CryptoProParamSet = 822; + + SN_id_Gost28147_89_TestParamSet = AnsiString('id-Gost28147-89-TestParamSet'); + NID_id_Gost28147_89_TestParamSet = 823; + + SN_id_Gost28147_89_CryptoPro_A_ParamSet = AnsiString('id-Gost28147-89-CryptoPro-A-ParamSet'); + NID_id_Gost28147_89_CryptoPro_A_ParamSet = 824; + + SN_id_Gost28147_89_CryptoPro_B_ParamSet = AnsiString('id-Gost28147-89-CryptoPro-B-ParamSet'); + NID_id_Gost28147_89_CryptoPro_B_ParamSet = 825; + + SN_id_Gost28147_89_CryptoPro_C_ParamSet = AnsiString('id-Gost28147-89-CryptoPro-C-ParamSet'); + NID_id_Gost28147_89_CryptoPro_C_ParamSet = 826; + + SN_id_Gost28147_89_CryptoPro_D_ParamSet = AnsiString('id-Gost28147-89-CryptoPro-D-ParamSet'); + NID_id_Gost28147_89_CryptoPro_D_ParamSet = 827; + + SN_id_Gost28147_89_CryptoPro_Oscar_1_1_ParamSet = AnsiString('id-Gost28147-89-CryptoPro-Oscar-1-1-ParamSet'); + NID_id_Gost28147_89_CryptoPro_Oscar_1_1_ParamSet = 828; + + SN_id_Gost28147_89_CryptoPro_Oscar_1_0_ParamSet = AnsiString('id-Gost28147-89-CryptoPro-Oscar-1-0-ParamSet'); + NID_id_Gost28147_89_CryptoPro_Oscar_1_0_ParamSet = 829; + + SN_id_Gost28147_89_CryptoPro_RIC_1_ParamSet = AnsiString('id-Gost28147-89-CryptoPro-RIC-1-ParamSet'); + NID_id_Gost28147_89_CryptoPro_RIC_1_ParamSet = 830; + + SN_id_GostR3410_94_TestParamSet = AnsiString('id-GostR3410-94-TestParamSet'); + NID_id_GostR3410_94_TestParamSet = 831; + + SN_id_GostR3410_94_CryptoPro_A_ParamSet = AnsiString('id-GostR3410-94-CryptoPro-A-ParamSet'); + NID_id_GostR3410_94_CryptoPro_A_ParamSet = 832; + + SN_id_GostR3410_94_CryptoPro_B_ParamSet = AnsiString('id-GostR3410-94-CryptoPro-B-ParamSet'); + NID_id_GostR3410_94_CryptoPro_B_ParamSet = 833; + + SN_id_GostR3410_94_CryptoPro_C_ParamSet = AnsiString('id-GostR3410-94-CryptoPro-C-ParamSet'); + NID_id_GostR3410_94_CryptoPro_C_ParamSet = 834; + + SN_id_GostR3410_94_CryptoPro_D_ParamSet = AnsiString('id-GostR3410-94-CryptoPro-D-ParamSet'); + NID_id_GostR3410_94_CryptoPro_D_ParamSet = 835; + + SN_id_GostR3410_94_CryptoPro_XchA_ParamSet = AnsiString('id-GostR3410-94-CryptoPro-XchA-ParamSet'); + NID_id_GostR3410_94_CryptoPro_XchA_ParamSet = 836; + + SN_id_GostR3410_94_CryptoPro_XchB_ParamSet = AnsiString('id-GostR3410-94-CryptoPro-XchB-ParamSet'); + NID_id_GostR3410_94_CryptoPro_XchB_ParamSet = 837; + + SN_id_GostR3410_94_CryptoPro_XchC_ParamSet = AnsiString('id-GostR3410-94-CryptoPro-XchC-ParamSet'); + NID_id_GostR3410_94_CryptoPro_XchC_ParamSet = 838; + + SN_id_GostR3410_2001_TestParamSet = AnsiString('id-GostR3410-2001-TestParamSet'); + NID_id_GostR3410_2001_TestParamSet = 839; + + SN_id_GostR3410_2001_CryptoPro_A_ParamSet = AnsiString('id-GostR3410-2001-CryptoPro-A-ParamSet'); + NID_id_GostR3410_2001_CryptoPro_A_ParamSet = 840; + + SN_id_GostR3410_2001_CryptoPro_B_ParamSet = AnsiString('id-GostR3410-2001-CryptoPro-B-ParamSet'); + NID_id_GostR3410_2001_CryptoPro_B_ParamSet = 841; + + SN_id_GostR3410_2001_CryptoPro_C_ParamSet = AnsiString('id-GostR3410-2001-CryptoPro-C-ParamSet'); + NID_id_GostR3410_2001_CryptoPro_C_ParamSet = 842; + + SN_id_GostR3410_2001_CryptoPro_XchA_ParamSet = AnsiString('id-GostR3410-2001-CryptoPro-XchA-ParamSet'); + NID_id_GostR3410_2001_CryptoPro_XchA_ParamSet = 843; + + SN_id_GostR3410_2001_CryptoPro_XchB_ParamSet = AnsiString('id-GostR3410-2001-CryptoPro-XchB-ParamSet'); + NID_id_GostR3410_2001_CryptoPro_XchB_ParamSet = 844; + + SN_id_GostR3410_94_a = AnsiString('id-GostR3410-94-a'); + NID_id_GostR3410_94_a = 845; + + SN_id_GostR3410_94_aBis = AnsiString('id-GostR3410-94-aBis'); + NID_id_GostR3410_94_aBis = 846; + + SN_id_GostR3410_94_b = AnsiString('id-GostR3410-94-b'); + NID_id_GostR3410_94_b = 847; + + SN_id_GostR3410_94_bBis = AnsiString('id-GostR3410-94-bBis'); + NID_id_GostR3410_94_bBis = 848; + + SN_id_Gost28147_89_cc = AnsiString('id-Gost28147-89-cc'); + LN_id_Gost28147_89_cc = AnsiString('GOST 28147-89 Cryptocom ParamSet'); + NID_id_Gost28147_89_cc = 849; + + SN_id_GostR3410_94_cc = AnsiString('gost94cc'); + LN_id_GostR3410_94_cc = AnsiString('GOST 34.10-94 Cryptocom'); + NID_id_GostR3410_94_cc = 850; + + SN_id_GostR3410_2001_cc = AnsiString('gost2001cc'); + LN_id_GostR3410_2001_cc = AnsiString('GOST 34.10-2001 Cryptocom'); + NID_id_GostR3410_2001_cc = 851; + + SN_id_GostR3411_94_with_GostR3410_94_cc = AnsiString('id-GostR3411-94-with-GostR3410-94-cc'); + LN_id_GostR3411_94_with_GostR3410_94_cc = AnsiString('GOST R 34.11-94 with GOST R 34.10-94 Cryptocom'); + NID_id_GostR3411_94_with_GostR3410_94_cc = 852; + + SN_id_GostR3411_94_with_GostR3410_2001_cc = AnsiString('id-GostR3411-94-with-GostR3410-2001-cc'); + LN_id_GostR3411_94_with_GostR3410_2001_cc = AnsiString('GOST R 34.11-94 with GOST R 34.10-2001 Cryptocom'); + NID_id_GostR3411_94_with_GostR3410_2001_cc = 853; + + SN_id_GostR3410_2001_ParamSet_cc = AnsiString('id-GostR3410-2001-ParamSet-cc'); + LN_id_GostR3410_2001_ParamSet_cc = AnsiString('GOST R 3410-2001 Parameter Set Cryptocom'); + NID_id_GostR3410_2001_ParamSet_cc = 854; + + SN_id_tc26_algorithms = AnsiString('id-tc26-algorithms'); + NID_id_tc26_algorithms = 977; + + SN_id_tc26_sign = AnsiString('id-tc26-sign'); + NID_id_tc26_sign = 978; + + SN_id_GostR3410_2012_256 = AnsiString('gost2012_256'); + LN_id_GostR3410_2012_256 = AnsiString('GOST R 34.10-2012 with 256 bit modulus'); + NID_id_GostR3410_2012_256 = 979; + + SN_id_GostR3410_2012_512 = AnsiString('gost2012_512'); + LN_id_GostR3410_2012_512 = AnsiString('GOST R 34.10-2012 with 512 bit modulus'); + NID_id_GostR3410_2012_512 = 980; + + SN_id_tc26_digest = AnsiString('id-tc26-digest'); + NID_id_tc26_digest = 981; + + SN_id_GostR3411_2012_256 = AnsiString('md_gost12_256'); + LN_id_GostR3411_2012_256 = AnsiString('GOST R 34.11-2012 with 256 bit hash'); + NID_id_GostR3411_2012_256 = 982; + + SN_id_GostR3411_2012_512 = AnsiString('md_gost12_512'); + LN_id_GostR3411_2012_512 = AnsiString('GOST R 34.11-2012 with 512 bit hash'); + NID_id_GostR3411_2012_512 = 983; + + SN_id_tc26_signwithdigest = AnsiString('id-tc26-signwithdigest'); + NID_id_tc26_signwithdigest = 984; + + SN_id_tc26_signwithdigest_gost3410_2012_256 = AnsiString('id-tc26-signwithdigest-gost3410-2012-256'); + LN_id_tc26_signwithdigest_gost3410_2012_256 = AnsiString('GOST R 34.10-2012 with GOST R 34.11-2012(256 bit)'); + NID_id_tc26_signwithdigest_gost3410_2012_256 = 985; + + SN_id_tc26_signwithdigest_gost3410_2012_512 = AnsiString('id-tc26-signwithdigest-gost3410-2012-512'); + LN_id_tc26_signwithdigest_gost3410_2012_512 = AnsiString('GOST R 34.10-2012 with GOST R 34.11-2012(512 bit)'); + NID_id_tc26_signwithdigest_gost3410_2012_512 = 986; + + SN_id_tc26_mac = AnsiString('id-tc26-mac'); + NID_id_tc26_mac = 987; + + SN_id_tc26_hmac_gost_3411_2012_256 = AnsiString('id-tc26-hmac-gost-3411-2012-256'); + LN_id_tc26_hmac_gost_3411_2012_256 = AnsiString('HMAC GOST 34.11-2012 256 bit'); + NID_id_tc26_hmac_gost_3411_2012_256 = 988; + + SN_id_tc26_hmac_gost_3411_2012_512 = AnsiString('id-tc26-hmac-gost-3411-2012-512'); + LN_id_tc26_hmac_gost_3411_2012_512 = AnsiString('HMAC GOST 34.11-2012 512 bit'); + NID_id_tc26_hmac_gost_3411_2012_512 = 989; + + SN_id_tc26_cipher = AnsiString('id-tc26-cipher'); + NID_id_tc26_cipher = 990; + + SN_id_tc26_cipher_gostr3412_2015_magma = AnsiString('id-tc26-cipher-gostr3412-2015-magma'); + NID_id_tc26_cipher_gostr3412_2015_magma = 1173; + + SN_id_tc26_cipher_gostr3412_2015_magma_ctracpkm = AnsiString('id-tc26-cipher-gostr3412-2015-magma-ctracpkm'); + NID_id_tc26_cipher_gostr3412_2015_magma_ctracpkm = 1174; + + SN_id_tc26_cipher_gostr3412_2015_magma_ctracpkm_omac = AnsiString('id-tc26-cipher-gostr3412-2015-magma-ctracpkm-omac'); + NID_id_tc26_cipher_gostr3412_2015_magma_ctracpkm_omac = 1175; + + SN_id_tc26_cipher_gostr3412_2015_kuznyechik = AnsiString('id-tc26-cipher-gostr3412-2015-kuznyechik'); + NID_id_tc26_cipher_gostr3412_2015_kuznyechik = 1176; + + SN_id_tc26_cipher_gostr3412_2015_kuznyechik_ctracpkm = AnsiString('id-tc26-cipher-gostr3412-2015-kuznyechik-ctracpkm'); + NID_id_tc26_cipher_gostr3412_2015_kuznyechik_ctracpkm = 1177; + + SN_id_tc26_cipher_gostr3412_2015_kuznyechik_ctracpkm_omac = AnsiString('id-tc26-cipher-gostr3412-2015-kuznyechik-ctracpkm-omac'); + NID_id_tc26_cipher_gostr3412_2015_kuznyechik_ctracpkm_omac = 1178; + + SN_id_tc26_agreement = AnsiString('id-tc26-agreement'); + NID_id_tc26_agreement = 991; + + SN_id_tc26_agreement_gost_3410_2012_256 = AnsiString('id-tc26-agreement-gost-3410-2012-256'); + NID_id_tc26_agreement_gost_3410_2012_256 = 992; + + SN_id_tc26_agreement_gost_3410_2012_512 = AnsiString('id-tc26-agreement-gost-3410-2012-512'); + NID_id_tc26_agreement_gost_3410_2012_512 = 993; + + SN_id_tc26_wrap = AnsiString('id-tc26-wrap'); + NID_id_tc26_wrap = 1179; + + SN_id_tc26_wrap_gostr3412_2015_magma = AnsiString('id-tc26-wrap-gostr3412-2015-magma'); + NID_id_tc26_wrap_gostr3412_2015_magma = 1180; + + SN_id_tc26_wrap_gostr3412_2015_magma_kexp15 = AnsiString('id-tc26-wrap-gostr3412-2015-magma-kexp15'); + NID_id_tc26_wrap_gostr3412_2015_magma_kexp15 = 1181; + + SN_id_tc26_wrap_gostr3412_2015_kuznyechik = AnsiString('id-tc26-wrap-gostr3412-2015-kuznyechik'); + NID_id_tc26_wrap_gostr3412_2015_kuznyechik = 1182; + + SN_id_tc26_wrap_gostr3412_2015_kuznyechik_kexp15 = AnsiString('id-tc26-wrap-gostr3412-2015-kuznyechik-kexp15'); + NID_id_tc26_wrap_gostr3412_2015_kuznyechik_kexp15 = 1183; + + SN_id_tc26_constants = AnsiString('id-tc26-constants'); + NID_id_tc26_constants = 994; + + SN_id_tc26_sign_constants = AnsiString('id-tc26-sign-constants'); + NID_id_tc26_sign_constants = 995; + + SN_id_tc26_gost_3410_2012_256_constants = AnsiString('id-tc26-gost-3410-2012-256-constants'); + NID_id_tc26_gost_3410_2012_256_constants = 1147; + + SN_id_tc26_gost_3410_2012_256_paramSetA = AnsiString('id-tc26-gost-3410-2012-256-paramSetA'); + LN_id_tc26_gost_3410_2012_256_paramSetA = AnsiString('GOST R 34.10-2012(256 bit)ParamSet A'); + NID_id_tc26_gost_3410_2012_256_paramSetA = 1148; + + SN_id_tc26_gost_3410_2012_256_paramSetB = AnsiString('id-tc26-gost-3410-2012-256-paramSetB'); + LN_id_tc26_gost_3410_2012_256_paramSetB = AnsiString('GOST R 34.10-2012(256 bit)ParamSet B'); + NID_id_tc26_gost_3410_2012_256_paramSetB = 1184; + + SN_id_tc26_gost_3410_2012_256_paramSetC = AnsiString('id-tc26-gost-3410-2012-256-paramSetC'); + LN_id_tc26_gost_3410_2012_256_paramSetC = AnsiString('GOST R 34.10-2012(256 bit)ParamSet C'); + NID_id_tc26_gost_3410_2012_256_paramSetC = 1185; + + SN_id_tc26_gost_3410_2012_256_paramSetD = AnsiString('id-tc26-gost-3410-2012-256-paramSetD'); + LN_id_tc26_gost_3410_2012_256_paramSetD = AnsiString('GOST R 34.10-2012(256 bit)ParamSet D'); + NID_id_tc26_gost_3410_2012_256_paramSetD = 1186; + + SN_id_tc26_gost_3410_2012_512_constants = AnsiString('id-tc26-gost-3410-2012-512-constants'); + NID_id_tc26_gost_3410_2012_512_constants = 996; + + SN_id_tc26_gost_3410_2012_512_paramSetTest = AnsiString('id-tc26-gost-3410-2012-512-paramSetTest'); + LN_id_tc26_gost_3410_2012_512_paramSetTest = AnsiString('GOST R 34.10-2012(512 bit)testing parameter set'); + NID_id_tc26_gost_3410_2012_512_paramSetTest = 997; + + SN_id_tc26_gost_3410_2012_512_paramSetA = AnsiString('id-tc26-gost-3410-2012-512-paramSetA'); + LN_id_tc26_gost_3410_2012_512_paramSetA = AnsiString('GOST R 34.10-2012(512 bit)ParamSet A'); + NID_id_tc26_gost_3410_2012_512_paramSetA = 998; + + SN_id_tc26_gost_3410_2012_512_paramSetB = AnsiString('id-tc26-gost-3410-2012-512-paramSetB'); + LN_id_tc26_gost_3410_2012_512_paramSetB = AnsiString('GOST R 34.10-2012(512 bit)ParamSet B'); + NID_id_tc26_gost_3410_2012_512_paramSetB = 999; + + SN_id_tc26_gost_3410_2012_512_paramSetC = AnsiString('id-tc26-gost-3410-2012-512-paramSetC'); + LN_id_tc26_gost_3410_2012_512_paramSetC = AnsiString('GOST R 34.10-2012(512 bit)ParamSet C'); + NID_id_tc26_gost_3410_2012_512_paramSetC = 1149; + + SN_id_tc26_digest_constants = AnsiString('id-tc26-digest-constants'); + NID_id_tc26_digest_constants = 1000; + + SN_id_tc26_cipher_constants = AnsiString('id-tc26-cipher-constants'); + NID_id_tc26_cipher_constants = 1001; + + SN_id_tc26_gost_28147_constants = AnsiString('id-tc26-gost-28147-constants'); + NID_id_tc26_gost_28147_constants = 1002; + + SN_id_tc26_gost_28147_param_Z = AnsiString('id-tc26-gost-28147-param-Z'); + LN_id_tc26_gost_28147_param_Z = AnsiString('GOST 28147-89 TC26 parameter set'); + NID_id_tc26_gost_28147_param_Z = 1003; + + SN_INN = AnsiString('INN'); + LN_INN = AnsiString('INN'); + NID_INN = 1004; + + SN_OGRN = AnsiString('OGRN'); + LN_OGRN = AnsiString('OGRN'); + NID_OGRN = 1005; + + SN_SNILS = AnsiString('SNILS'); + LN_SNILS = AnsiString('SNILS'); + NID_SNILS = 1006; + + SN_subjectSignTool = AnsiString('subjectSignTool'); + LN_subjectSignTool = AnsiString('Signing Tool of Subject'); + NID_subjectSignTool = 1007; + + SN_issuerSignTool = AnsiString('issuerSignTool'); + LN_issuerSignTool = AnsiString('Signing Tool of Issuer'); + NID_issuerSignTool = 1008; + + SN_grasshopper_ecb = AnsiString('grasshopper-ecb'); + NID_grasshopper_ecb = 1012; + + SN_grasshopper_ctr = AnsiString('grasshopper-ctr'); + NID_grasshopper_ctr = 1013; + + SN_grasshopper_ofb = AnsiString('grasshopper-ofb'); + NID_grasshopper_ofb = 1014; + + SN_grasshopper_cbc = AnsiString('grasshopper-cbc'); + NID_grasshopper_cbc = 1015; + + SN_grasshopper_cfb = AnsiString('grasshopper-cfb'); + NID_grasshopper_cfb = 1016; + + SN_grasshopper_mac = AnsiString('grasshopper-mac'); + NID_grasshopper_mac = 1017; + + SN_magma_ecb = AnsiString('magma-ecb'); + NID_magma_ecb = 1187; + + SN_magma_ctr = AnsiString('magma-ctr'); + NID_magma_ctr = 1188; + + SN_magma_ofb = AnsiString('magma-ofb'); + NID_magma_ofb = 1189; + + SN_magma_cbc = AnsiString('magma-cbc'); + NID_magma_cbc = 1190; + + SN_magma_cfb = AnsiString('magma-cfb'); + NID_magma_cfb = 1191; + + SN_magma_mac = AnsiString('magma-mac'); + NID_magma_mac = 1192; + + SN_camellia_128_cbc = AnsiString('CAMELLIA-128-CBC'); + LN_camellia_128_cbc = AnsiString('camellia-128-cbc'); + NID_camellia_128_cbc = 751; + + SN_camellia_192_cbc = AnsiString('CAMELLIA-192-CBC'); + LN_camellia_192_cbc = AnsiString('camellia-192-cbc'); + NID_camellia_192_cbc = 752; + + SN_camellia_256_cbc = AnsiString('CAMELLIA-256-CBC'); + LN_camellia_256_cbc = AnsiString('camellia-256-cbc'); + NID_camellia_256_cbc = 753; + + SN_id_camellia128_wrap = AnsiString('id-camellia128-wrap'); + NID_id_camellia128_wrap = 907; + + SN_id_camellia192_wrap = AnsiString('id-camellia192-wrap'); + NID_id_camellia192_wrap = 908; + + SN_id_camellia256_wrap = AnsiString('id-camellia256-wrap'); + NID_id_camellia256_wrap = 909; + + SN_camellia_128_ecb = AnsiString('CAMELLIA-128-ECB'); + LN_camellia_128_ecb = AnsiString('camellia-128-ecb'); + NID_camellia_128_ecb = 754; + + SN_camellia_128_ofb128 = AnsiString('CAMELLIA-128-OFB'); + LN_camellia_128_ofb128 = AnsiString('camellia-128-ofb'); + NID_camellia_128_ofb128 = 766; + + SN_camellia_128_cfb128 = AnsiString('CAMELLIA-128-CFB'); + LN_camellia_128_cfb128 = AnsiString('camellia-128-cfb'); + NID_camellia_128_cfb128 = 757; + + SN_camellia_128_gcm = AnsiString('CAMELLIA-128-GCM'); + LN_camellia_128_gcm = AnsiString('camellia-128-gcm'); + NID_camellia_128_gcm = 961; + + SN_camellia_128_ccm = AnsiString('CAMELLIA-128-CCM'); + LN_camellia_128_ccm = AnsiString('camellia-128-ccm'); + NID_camellia_128_ccm = 962; + + SN_camellia_128_ctr = AnsiString('CAMELLIA-128-CTR'); + LN_camellia_128_ctr = AnsiString('camellia-128-ctr'); + NID_camellia_128_ctr = 963; + + SN_camellia_128_cmac = AnsiString('CAMELLIA-128-CMAC'); + LN_camellia_128_cmac = AnsiString('camellia-128-cmac'); + NID_camellia_128_cmac = 964; + + SN_camellia_192_ecb = AnsiString('CAMELLIA-192-ECB'); + LN_camellia_192_ecb = AnsiString('camellia-192-ecb'); + NID_camellia_192_ecb = 755; + + SN_camellia_192_ofb128 = AnsiString('CAMELLIA-192-OFB'); + LN_camellia_192_ofb128 = AnsiString('camellia-192-ofb'); + NID_camellia_192_ofb128 = 767; + + SN_camellia_192_cfb128 = AnsiString('CAMELLIA-192-CFB'); + LN_camellia_192_cfb128 = AnsiString('camellia-192-cfb'); + NID_camellia_192_cfb128 = 758; + + SN_camellia_192_gcm = AnsiString('CAMELLIA-192-GCM'); + LN_camellia_192_gcm = AnsiString('camellia-192-gcm'); + NID_camellia_192_gcm = 965; + + SN_camellia_192_ccm = AnsiString('CAMELLIA-192-CCM'); + LN_camellia_192_ccm = AnsiString('camellia-192-ccm'); + NID_camellia_192_ccm = 966; + + SN_camellia_192_ctr = AnsiString('CAMELLIA-192-CTR'); + LN_camellia_192_ctr = AnsiString('camellia-192-ctr'); + NID_camellia_192_ctr = 967; + + SN_camellia_192_cmac = AnsiString('CAMELLIA-192-CMAC'); + LN_camellia_192_cmac = AnsiString('camellia-192-cmac'); + NID_camellia_192_cmac = 968; + + SN_camellia_256_ecb = AnsiString('CAMELLIA-256-ECB'); + LN_camellia_256_ecb = AnsiString('camellia-256-ecb'); + NID_camellia_256_ecb = 756; + + SN_camellia_256_ofb128 = AnsiString('CAMELLIA-256-OFB'); + LN_camellia_256_ofb128 = AnsiString('camellia-256-ofb'); + NID_camellia_256_ofb128 = 768; + + SN_camellia_256_cfb128 = AnsiString('CAMELLIA-256-CFB'); + LN_camellia_256_cfb128 = AnsiString('camellia-256-cfb'); + NID_camellia_256_cfb128 = 759; + + SN_camellia_256_gcm = AnsiString('CAMELLIA-256-GCM'); + LN_camellia_256_gcm = AnsiString('camellia-256-gcm'); + NID_camellia_256_gcm = 969; + + SN_camellia_256_ccm = AnsiString('CAMELLIA-256-CCM'); + LN_camellia_256_ccm = AnsiString('camellia-256-ccm'); + NID_camellia_256_ccm = 970; + + SN_camellia_256_ctr = AnsiString('CAMELLIA-256-CTR'); + LN_camellia_256_ctr = AnsiString('camellia-256-ctr'); + NID_camellia_256_ctr = 971; + + SN_camellia_256_cmac = AnsiString('CAMELLIA-256-CMAC'); + LN_camellia_256_cmac = AnsiString('camellia-256-cmac'); + NID_camellia_256_cmac = 972; + + SN_camellia_128_cfb1 = AnsiString('CAMELLIA-128-CFB1'); + LN_camellia_128_cfb1 = AnsiString('camellia-128-cfb1'); + NID_camellia_128_cfb1 = 760; + + SN_camellia_192_cfb1 = AnsiString('CAMELLIA-192-CFB1'); + LN_camellia_192_cfb1 = AnsiString('camellia-192-cfb1'); + NID_camellia_192_cfb1 = 761; + + SN_camellia_256_cfb1 = AnsiString('CAMELLIA-256-CFB1'); + LN_camellia_256_cfb1 = AnsiString('camellia-256-cfb1'); + NID_camellia_256_cfb1 = 762; + + SN_camellia_128_cfb8 = AnsiString('CAMELLIA-128-CFB8'); + LN_camellia_128_cfb8 = AnsiString('camellia-128-cfb8'); + NID_camellia_128_cfb8 = 763; + + SN_camellia_192_cfb8 = AnsiString('CAMELLIA-192-CFB8'); + LN_camellia_192_cfb8 = AnsiString('camellia-192-cfb8'); + NID_camellia_192_cfb8 = 764; + + SN_camellia_256_cfb8 = AnsiString('CAMELLIA-256-CFB8'); + LN_camellia_256_cfb8 = AnsiString('camellia-256-cfb8'); + NID_camellia_256_cfb8 = 765; + + SN_aria_128_ecb = AnsiString('ARIA-128-ECB'); + LN_aria_128_ecb = AnsiString('aria-128-ecb'); + NID_aria_128_ecb = 1065; + + SN_aria_128_cbc = AnsiString('ARIA-128-CBC'); + LN_aria_128_cbc = AnsiString('aria-128-cbc'); + NID_aria_128_cbc = 1066; + + SN_aria_128_cfb128 = AnsiString('ARIA-128-CFB'); + LN_aria_128_cfb128 = AnsiString('aria-128-cfb'); + NID_aria_128_cfb128 = 1067; + + SN_aria_128_ofb128 = AnsiString('ARIA-128-OFB'); + LN_aria_128_ofb128 = AnsiString('aria-128-ofb'); + NID_aria_128_ofb128 = 1068; + + SN_aria_128_ctr = AnsiString('ARIA-128-CTR'); + LN_aria_128_ctr = AnsiString('aria-128-ctr'); + NID_aria_128_ctr = 1069; + + SN_aria_192_ecb = AnsiString('ARIA-192-ECB'); + LN_aria_192_ecb = AnsiString('aria-192-ecb'); + NID_aria_192_ecb = 1070; + + SN_aria_192_cbc = AnsiString('ARIA-192-CBC'); + LN_aria_192_cbc = AnsiString('aria-192-cbc'); + NID_aria_192_cbc = 1071; + + SN_aria_192_cfb128 = AnsiString('ARIA-192-CFB'); + LN_aria_192_cfb128 = AnsiString('aria-192-cfb'); + NID_aria_192_cfb128 = 1072; + + SN_aria_192_ofb128 = AnsiString('ARIA-192-OFB'); + LN_aria_192_ofb128 = AnsiString('aria-192-ofb'); + NID_aria_192_ofb128 = 1073; + + SN_aria_192_ctr = AnsiString('ARIA-192-CTR'); + LN_aria_192_ctr = AnsiString('aria-192-ctr'); + NID_aria_192_ctr = 1074; + + SN_aria_256_ecb = AnsiString('ARIA-256-ECB'); + LN_aria_256_ecb = AnsiString('aria-256-ecb'); + NID_aria_256_ecb = 1075; + + SN_aria_256_cbc = AnsiString('ARIA-256-CBC'); + LN_aria_256_cbc = AnsiString('aria-256-cbc'); + NID_aria_256_cbc = 1076; + + SN_aria_256_cfb128 = AnsiString('ARIA-256-CFB'); + LN_aria_256_cfb128 = AnsiString('aria-256-cfb'); + NID_aria_256_cfb128 = 1077; + + SN_aria_256_ofb128 = AnsiString('ARIA-256-OFB'); + LN_aria_256_ofb128 = AnsiString('aria-256-ofb'); + NID_aria_256_ofb128 = 1078; + + SN_aria_256_ctr = AnsiString('ARIA-256-CTR'); + LN_aria_256_ctr = AnsiString('aria-256-ctr'); + NID_aria_256_ctr = 1079; + + SN_aria_128_cfb1 = AnsiString('ARIA-128-CFB1'); + LN_aria_128_cfb1 = AnsiString('aria-128-cfb1'); + NID_aria_128_cfb1 = 1080; + + SN_aria_192_cfb1 = AnsiString('ARIA-192-CFB1'); + LN_aria_192_cfb1 = AnsiString('aria-192-cfb1'); + NID_aria_192_cfb1 = 1081; + + SN_aria_256_cfb1 = AnsiString('ARIA-256-CFB1'); + LN_aria_256_cfb1 = AnsiString('aria-256-cfb1'); + NID_aria_256_cfb1 = 1082; + + SN_aria_128_cfb8 = AnsiString('ARIA-128-CFB8'); + LN_aria_128_cfb8 = AnsiString('aria-128-cfb8'); + NID_aria_128_cfb8 = 1083; + + SN_aria_192_cfb8 = AnsiString('ARIA-192-CFB8'); + LN_aria_192_cfb8 = AnsiString('aria-192-cfb8'); + NID_aria_192_cfb8 = 1084; + + SN_aria_256_cfb8 = AnsiString('ARIA-256-CFB8'); + LN_aria_256_cfb8 = AnsiString('aria-256-cfb8'); + NID_aria_256_cfb8 = 1085; + + SN_aria_128_ccm = AnsiString('ARIA-128-CCM'); + LN_aria_128_ccm = AnsiString('aria-128-ccm'); + NID_aria_128_ccm = 1120; + + SN_aria_192_ccm = AnsiString('ARIA-192-CCM'); + LN_aria_192_ccm = AnsiString('aria-192-ccm'); + NID_aria_192_ccm = 1121; + + SN_aria_256_ccm = AnsiString('ARIA-256-CCM'); + LN_aria_256_ccm = AnsiString('aria-256-ccm'); + NID_aria_256_ccm = 1122; + + SN_aria_128_gcm = AnsiString('ARIA-128-GCM'); + LN_aria_128_gcm = AnsiString('aria-128-gcm'); + NID_aria_128_gcm = 1123; + + SN_aria_192_gcm = AnsiString('ARIA-192-GCM'); + LN_aria_192_gcm = AnsiString('aria-192-gcm'); + NID_aria_192_gcm = 1124; + + SN_aria_256_gcm = AnsiString('ARIA-256-GCM'); + LN_aria_256_gcm = AnsiString('aria-256-gcm'); + NID_aria_256_gcm = 1125; + + SN_kisa = AnsiString('KISA'); + LN_kisa = AnsiString('kisa'); + NID_kisa = 773; + + SN_seed_ecb = AnsiString('SEED-ECB'); + LN_seed_ecb = AnsiString('seed-ecb'); + NID_seed_ecb = 776; + + SN_seed_cbc = AnsiString('SEED-CBC'); + LN_seed_cbc = AnsiString('seed-cbc'); + NID_seed_cbc = 777; + + SN_seed_cfb128 = AnsiString('SEED-CFB'); + LN_seed_cfb128 = AnsiString('seed-cfb'); + NID_seed_cfb128 = 779; + + SN_seed_ofb128 = AnsiString('SEED-OFB'); + LN_seed_ofb128 = AnsiString('seed-ofb'); + NID_seed_ofb128 = 778; + + SN_sm4_ecb = AnsiString('SM4-ECB'); + LN_sm4_ecb = AnsiString('sm4-ecb'); + NID_sm4_ecb = 1133; + + SN_sm4_cbc = AnsiString('SM4-CBC'); + LN_sm4_cbc = AnsiString('sm4-cbc'); + NID_sm4_cbc = 1134; + + SN_sm4_ofb128 = AnsiString('SM4-OFB'); + LN_sm4_ofb128 = AnsiString('sm4-ofb'); + NID_sm4_ofb128 = 1135; + + SN_sm4_cfb128 = AnsiString('SM4-CFB'); + LN_sm4_cfb128 = AnsiString('sm4-cfb'); + NID_sm4_cfb128 = 1137; + + SN_sm4_cfb1 = AnsiString('SM4-CFB1'); + LN_sm4_cfb1 = AnsiString('sm4-cfb1'); + NID_sm4_cfb1 = 1136; + + SN_sm4_cfb8 = AnsiString('SM4-CFB8'); + LN_sm4_cfb8 = AnsiString('sm4-cfb8'); + NID_sm4_cfb8 = 1138; + + SN_sm4_ctr = AnsiString('SM4-CTR'); + LN_sm4_ctr = AnsiString('sm4-ctr'); + NID_sm4_ctr = 1139; + + SN_hmac = AnsiString('HMAC'); + LN_hmac = AnsiString('hmac'); + NID_hmac = 855; + + SN_cmac = AnsiString('CMAC'); + LN_cmac = AnsiString('cmac'); + NID_cmac = 894; + + SN_rc4_hmac_md5 = AnsiString('RC4-HMAC-MD5'); + LN_rc4_hmac_md5 = AnsiString('rc4-hmac-md5'); + NID_rc4_hmac_md5 = 915; + + SN_aes_128_cbc_hmac_sha1 = AnsiString('AES-128-CBC-HMAC-SHA1'); + LN_aes_128_cbc_hmac_sha1 = AnsiString('aes-128-cbc-hmac-sha1'); + NID_aes_128_cbc_hmac_sha1 = 916; + + SN_aes_192_cbc_hmac_sha1 = AnsiString('AES-192-CBC-HMAC-SHA1'); + LN_aes_192_cbc_hmac_sha1 = AnsiString('aes-192-cbc-hmac-sha1'); + NID_aes_192_cbc_hmac_sha1 = 917; + + SN_aes_256_cbc_hmac_sha1 = AnsiString('AES-256-CBC-HMAC-SHA1'); + LN_aes_256_cbc_hmac_sha1 = AnsiString('aes-256-cbc-hmac-sha1'); + NID_aes_256_cbc_hmac_sha1 = 918; + + SN_aes_128_cbc_hmac_sha256 = AnsiString('AES-128-CBC-HMAC-SHA256'); + LN_aes_128_cbc_hmac_sha256 = AnsiString('aes-128-cbc-hmac-sha256'); + NID_aes_128_cbc_hmac_sha256 = 948; + + SN_aes_192_cbc_hmac_sha256 = AnsiString('AES-192-CBC-HMAC-SHA256'); + LN_aes_192_cbc_hmac_sha256 = AnsiString('aes-192-cbc-hmac-sha256'); + NID_aes_192_cbc_hmac_sha256 = 949; + + SN_aes_256_cbc_hmac_sha256 = AnsiString('AES-256-CBC-HMAC-SHA256'); + LN_aes_256_cbc_hmac_sha256 = AnsiString('aes-256-cbc-hmac-sha256'); + NID_aes_256_cbc_hmac_sha256 = 950; + + SN_chacha20_poly1305 = AnsiString('ChaCha20-Poly1305'); + LN_chacha20_poly1305 = AnsiString('chacha20-poly1305'); + NID_chacha20_poly1305 = 1018; + + SN_chacha20 = AnsiString('ChaCha20'); + LN_chacha20 = AnsiString('chacha20'); + NID_chacha20 = 1019; + + SN_dhpublicnumber = AnsiString('dhpublicnumber'); + LN_dhpublicnumber = AnsiString('X9.42 DH'); + NID_dhpublicnumber = 920; + + SN_brainpoolP160r1 = AnsiString('brainpoolP160r1'); + NID_brainpoolP160r1 = 921; + + SN_brainpoolP160t1 = AnsiString('brainpoolP160t1'); + NID_brainpoolP160t1 = 922; + + SN_brainpoolP192r1 = AnsiString('brainpoolP192r1'); + NID_brainpoolP192r1 = 923; + + SN_brainpoolP192t1 = AnsiString('brainpoolP192t1'); + NID_brainpoolP192t1 = 924; + + SN_brainpoolP224r1 = AnsiString('brainpoolP224r1'); + NID_brainpoolP224r1 = 925; + + SN_brainpoolP224t1 = AnsiString('brainpoolP224t1'); + NID_brainpoolP224t1 = 926; + + SN_brainpoolP256r1 = AnsiString('brainpoolP256r1'); + NID_brainpoolP256r1 = 927; + + SN_brainpoolP256t1 = AnsiString('brainpoolP256t1'); + NID_brainpoolP256t1 = 928; + + SN_brainpoolP320r1 = AnsiString('brainpoolP320r1'); + NID_brainpoolP320r1 = 929; + + SN_brainpoolP320t1 = AnsiString('brainpoolP320t1'); + NID_brainpoolP320t1 = 930; + + SN_brainpoolP384r1 = AnsiString('brainpoolP384r1'); + NID_brainpoolP384r1 = 931; + + SN_brainpoolP384t1 = AnsiString('brainpoolP384t1'); + NID_brainpoolP384t1 = 932; + + SN_brainpoolP512r1 = AnsiString('brainpoolP512r1'); + NID_brainpoolP512r1 = 933; + + SN_brainpoolP512t1 = AnsiString('brainpoolP512t1'); + NID_brainpoolP512t1 = 934; + + SN_dhSinglePass_stdDH_sha1kdf_scheme = AnsiString('dhSinglePass-stdDH-sha1kdf-scheme'); + NID_dhSinglePass_stdDH_sha1kdf_scheme = 936; + + SN_dhSinglePass_stdDH_sha224kdf_scheme = AnsiString('dhSinglePass-stdDH-sha224kdf-scheme'); + NID_dhSinglePass_stdDH_sha224kdf_scheme = 937; + + SN_dhSinglePass_stdDH_sha256kdf_scheme = AnsiString('dhSinglePass-stdDH-sha256kdf-scheme'); + NID_dhSinglePass_stdDH_sha256kdf_scheme = 938; + + SN_dhSinglePass_stdDH_sha384kdf_scheme = AnsiString('dhSinglePass-stdDH-sha384kdf-scheme'); + NID_dhSinglePass_stdDH_sha384kdf_scheme = 939; + + SN_dhSinglePass_stdDH_sha512kdf_scheme = AnsiString('dhSinglePass-stdDH-sha512kdf-scheme'); + NID_dhSinglePass_stdDH_sha512kdf_scheme = 940; + + SN_dhSinglePass_cofactorDH_sha1kdf_scheme = AnsiString('dhSinglePass-cofactorDH-sha1kdf-scheme'); + NID_dhSinglePass_cofactorDH_sha1kdf_scheme = 941; + + SN_dhSinglePass_cofactorDH_sha224kdf_scheme = AnsiString('dhSinglePass-cofactorDH-sha224kdf-scheme'); + NID_dhSinglePass_cofactorDH_sha224kdf_scheme = 942; + + SN_dhSinglePass_cofactorDH_sha256kdf_scheme = AnsiString('dhSinglePass-cofactorDH-sha256kdf-scheme'); + NID_dhSinglePass_cofactorDH_sha256kdf_scheme = 943; + + SN_dhSinglePass_cofactorDH_sha384kdf_scheme = AnsiString('dhSinglePass-cofactorDH-sha384kdf-scheme'); + NID_dhSinglePass_cofactorDH_sha384kdf_scheme = 944; + + SN_dhSinglePass_cofactorDH_sha512kdf_scheme = AnsiString('dhSinglePass-cofactorDH-sha512kdf-scheme'); + NID_dhSinglePass_cofactorDH_sha512kdf_scheme = 945; + + SN_dh_std_kdf = AnsiString('dh-std-kdf'); + NID_dh_std_kdf = 946; + + SN_dh_cofactor_kdf = AnsiString('dh-cofactor-kdf'); + NID_dh_cofactor_kdf = 947; + + SN_ct_precert_scts = AnsiString('ct_precert_scts'); + LN_ct_precert_scts = AnsiString('CT Precertificate SCTs'); + NID_ct_precert_scts = 951; + + SN_ct_precert_poison = AnsiString('ct_precert_poison'); + LN_ct_precert_poison = AnsiString('CT Precertificate Poison'); + NID_ct_precert_poison = 952; + + SN_ct_precert_signer = AnsiString('ct_precert_signer'); + LN_ct_precert_signer = AnsiString('CT Precertificate Signer'); + NID_ct_precert_signer = 953; + + SN_ct_cert_scts = AnsiString('ct_cert_scts'); + LN_ct_cert_scts = AnsiString('CT Certificate SCTs'); + NID_ct_cert_scts = 954; + + SN_jurisdictionLocalityName = AnsiString('jurisdictionL'); + LN_jurisdictionLocalityName = AnsiString('jurisdictionLocalityName'); + NID_jurisdictionLocalityName = 955; + + SN_jurisdictionStateOrProvinceName = AnsiString('jurisdictionST'); + LN_jurisdictionStateOrProvinceName = AnsiString('jurisdictionStateOrProvinceName'); + NID_jurisdictionStateOrProvinceName = 956; + + SN_jurisdictionCountryName = AnsiString('jurisdictionC'); + LN_jurisdictionCountryName = AnsiString('jurisdictionCountryName'); + NID_jurisdictionCountryName = 957; + + SN_id_scrypt = AnsiString('id-scrypt'); + LN_id_scrypt = AnsiString('scrypt'); + NID_id_scrypt = 973; + + SN_tls1_prf = AnsiString('TLS1-PRF'); + LN_tls1_prf = AnsiString('tls1-prf'); + NID_tls1_prf = 1021; + + SN_hkdf = AnsiString('HKDF'); + LN_hkdf = AnsiString('hkdf'); + NID_hkdf = 1036; + + SN_id_pkinit = AnsiString('id-pkinit'); + NID_id_pkinit = 1031; + + SN_pkInitClientAuth = AnsiString('pkInitClientAuth'); + LN_pkInitClientAuth = AnsiString('PKINIT Client Auth'); + NID_pkInitClientAuth = 1032; + + SN_pkInitKDC = AnsiString('pkInitKDC'); + LN_pkInitKDC = AnsiString('Signing KDC Response'); + NID_pkInitKDC = 1033; + + SN_X25519 = AnsiString('X25519'); + NID_X25519 = 1034; + + SN_X448 = AnsiString('X448'); + NID_X448 = 1035; + + SN_ED25519 = AnsiString('ED25519'); + NID_ED25519 = 1087; + + SN_ED448 = AnsiString('ED448'); + NID_ED448 = 1088; + + SN_kx_rsa = AnsiString('KxRSA'); + LN_kx_rsa = AnsiString('kx-rsa'); + NID_kx_rsa = 1037; + + SN_kx_ecdhe = AnsiString('KxECDHE'); + LN_kx_ecdhe = AnsiString('kx-ecdhe'); + NID_kx_ecdhe = 1038; + + SN_kx_dhe = AnsiString('KxDHE'); + LN_kx_dhe = AnsiString('kx-dhe'); + NID_kx_dhe = 1039; + + SN_kx_ecdhe_psk = AnsiString('KxECDHE-PSK'); + LN_kx_ecdhe_psk = AnsiString('kx-ecdhe-psk'); + NID_kx_ecdhe_psk = 1040; + + SN_kx_dhe_psk = AnsiString('KxDHE-PSK'); + LN_kx_dhe_psk = AnsiString('kx-dhe-psk'); + NID_kx_dhe_psk = 1041; + + SN_kx_rsa_psk = AnsiString('KxRSA_PSK'); + LN_kx_rsa_psk = AnsiString('kx-rsa-psk'); + NID_kx_rsa_psk = 1042; + + SN_kx_psk = AnsiString('KxPSK'); + LN_kx_psk = AnsiString('kx-psk'); + NID_kx_psk = 1043; + + SN_kx_srp = AnsiString('KxSRP'); + LN_kx_srp = AnsiString('kx-srp'); + NID_kx_srp = 1044; + + SN_kx_gost = AnsiString('KxGOST'); + LN_kx_gost = AnsiString('kx-gost'); + NID_kx_gost = 1045; + + SN_kx_any = AnsiString('KxANY'); + LN_kx_any = AnsiString('kx-any'); + NID_kx_any = 1063; + + SN_auth_rsa = AnsiString('AuthRSA'); + LN_auth_rsa = AnsiString('auth-rsa'); + NID_auth_rsa = 1046; + + SN_auth_ecdsa = AnsiString('AuthECDSA'); + LN_auth_ecdsa = AnsiString('auth-ecdsa'); + NID_auth_ecdsa = 1047; + + SN_auth_psk = AnsiString('AuthPSK'); + LN_auth_psk = AnsiString('auth-psk'); + NID_auth_psk = 1048; + + SN_auth_dss = AnsiString('AuthDSS'); + LN_auth_dss = AnsiString('auth-dss'); + NID_auth_dss = 1049; + + SN_auth_gost01 = AnsiString('AuthGOST01'); + LN_auth_gost01 = AnsiString('auth-gost01'); + NID_auth_gost01 = 1050; + + SN_auth_gost12 = AnsiString('AuthGOST12'); + LN_auth_gost12 = AnsiString('auth-gost12'); + NID_auth_gost12 = 1051; + + SN_auth_srp = AnsiString('AuthSRP'); + LN_auth_srp = AnsiString('auth-srp'); + NID_auth_srp = 1052; + + SN_auth_null = AnsiString('AuthNULL'); + LN_auth_null = AnsiString('auth-null'); + NID_auth_null = 1053; + + SN_auth_any = AnsiString('AuthANY'); + LN_auth_any = AnsiString('auth-any'); + NID_auth_any = 1064; + + SN_poly1305 = AnsiString('Poly1305'); + LN_poly1305 = AnsiString('poly1305'); + NID_poly1305 = 1061; + + SN_siphash = AnsiString('SipHash'); + LN_siphash = AnsiString('siphash'); + NID_siphash = 1062; + + SN_ffdhe2048 = AnsiString('ffdhe2048'); + NID_ffdhe2048 = 1126; + + SN_ffdhe3072 = AnsiString('ffdhe3072'); + NID_ffdhe3072 = 1127; + + SN_ffdhe4096 = AnsiString('ffdhe4096'); + NID_ffdhe4096 = 1128; + + SN_ffdhe6144 = AnsiString('ffdhe6144'); + NID_ffdhe6144 = 1129; + + SN_ffdhe8192 = AnsiString('ffdhe8192'); + NID_ffdhe8192 = 1130; + + SN_ISO_UA = AnsiString('ISO-UA'); + NID_ISO_UA = 1150; + + SN_ua_pki = AnsiString('ua-pki'); + NID_ua_pki = 1151; + + SN_dstu28147 = AnsiString('dstu28147'); + LN_dstu28147 = AnsiString('DSTU Gost 28147-2009'); + NID_dstu28147 = 1152; + + SN_dstu28147_ofb = AnsiString('dstu28147-ofb'); + LN_dstu28147_ofb = AnsiString('DSTU Gost 28147-2009 OFB mode'); + NID_dstu28147_ofb = 1153; + + SN_dstu28147_cfb = AnsiString('dstu28147-cfb'); + LN_dstu28147_cfb = AnsiString('DSTU Gost 28147-2009 CFB mode'); + NID_dstu28147_cfb = 1154; + + SN_dstu28147_wrap = AnsiString('dstu28147-wrap'); + LN_dstu28147_wrap = AnsiString('DSTU Gost 28147-2009 key wrap'); + NID_dstu28147_wrap = 1155; + + SN_hmacWithDstu34311 = AnsiString('hmacWithDstu34311'); + LN_hmacWithDstu34311 = AnsiString('HMAC DSTU Gost 34311-95'); + NID_hmacWithDstu34311 = 1156; + + SN_dstu34311 = AnsiString('dstu34311'); + LN_dstu34311 = AnsiString('DSTU Gost 34311-95'); + NID_dstu34311 = 1157; + + SN_dstu4145le = AnsiString('dstu4145le'); + LN_dstu4145le = AnsiString('DSTU 4145-2002 little endian'); + NID_dstu4145le = 1158; + + SN_dstu4145be = AnsiString('dstu4145be'); + LN_dstu4145be = AnsiString('DSTU 4145-2002 big endian'); + NID_dstu4145be = 1159; + + SN_uacurve0 = AnsiString('uacurve0'); + LN_uacurve0 = AnsiString('DSTU curve 0'); + NID_uacurve0 = 1160; + + SN_uacurve1 = AnsiString('uacurve1'); + LN_uacurve1 = AnsiString('DSTU curve 1'); + NID_uacurve1 = 1161; + + SN_uacurve2 = AnsiString('uacurve2'); + LN_uacurve2 = AnsiString('DSTU curve 2'); + NID_uacurve2 = 1162; + + SN_uacurve3 = AnsiString('uacurve3'); + LN_uacurve3 = AnsiString('DSTU curve 3'); + NID_uacurve3 = 1163; + + SN_uacurve4 = AnsiString('uacurve4'); + LN_uacurve4 = AnsiString('DSTU curve 4'); + NID_uacurve4 = 1164; + + SN_uacurve5 = AnsiString('uacurve5'); + LN_uacurve5 = AnsiString('DSTU curve 5'); + NID_uacurve5 = 1165; + + SN_uacurve6 = AnsiString('uacurve6'); + LN_uacurve6 = AnsiString('DSTU curve 6'); + NID_uacurve6 = 1166; + + SN_uacurve7 = AnsiString('uacurve7'); + LN_uacurve7 = AnsiString('DSTU curve 7'); + NID_uacurve7 = 1167; + + SN_uacurve8 = AnsiString('uacurve8'); + LN_uacurve8 = AnsiString('DSTU curve 8'); + NID_uacurve8 = 1168; + + SN_uacurve9 = AnsiString('uacurve9'); + LN_uacurve9 = AnsiString('DSTU curve 9'); + NID_uacurve9 = 1169; + +implementation + +end. diff --git a/IdOpenSSLHeaders_objects.pas b/IdOpenSSLHeaders_objects.pas new file mode 100644 index 0000000..5fa2d43 --- /dev/null +++ b/IdOpenSSLHeaders_objects.pas @@ -0,0 +1,1618 @@ + (* This unit was generated using the script genOpenSSLHdrs.sh from the source file IdOpenSSLHeaders_objects.h2pas + It should not be modified directly. All changes should be made to IdOpenSSLHeaders_objects.h2pas + and this file regenerated. IdOpenSSLHeaders_objects.h2pas is distributed with the full Indy + Distribution. + *) + +{$i IdCompilerDefines.inc} +{$i IdSSLOpenSSLDefines.inc} +{$IFNDEF USE_OPENSSL} + { error Should not compile if USE_OPENSSL is not defined!!!} +{$ENDIF} +{******************************************************************************} +{ } +{ Indy (Internet Direct) - Internet Protocols Simplified } +{ } +{ https://www.indyproject.org/ } +{ https://gitter.im/IndySockets/Indy } +{ } +{******************************************************************************} +{ } +{ This file is part of the Indy (Internet Direct) project, and is offered } +{ under the dual-licensing agreement described on the Indy website. } +{ (https://www.indyproject.org/license/) } +{ } +{ Copyright: } +{ (c) 1993-2020, Chad Z. Hower and the Indy Pit Crew. All rights reserved. } +{ } +{******************************************************************************} +{ } +{ } +{******************************************************************************} + +unit IdOpenSSLHeaders_objects; + +interface + +// Headers for OpenSSL 1.1.1 +// objects.h + + +uses + IdCTypes, + IdGlobal, + IdSSLOpenSSLConsts, + IdOpenSSLHeaders_ossl_typ; + +type + obj_name_st = record + type_: TIdC_INT; + alias: TIdC_INT; + name: PIdAnsiChar; + data: PIdAnsiChar; + end; + OBJ_NAME = obj_name_st; + POBJ_NAME = ^OBJ_NAME; + +//# define OBJ_create_and_add_object(a,b,c) OBJ_create(a,b,c) + + { The EXTERNALSYM directive is ignored by FPC, however, it is used by Delphi as follows: + + The EXTERNALSYM directive prevents the specified Delphi symbol from appearing in header + files generated for C++. } + + {$EXTERNALSYM OBJ_NAME_init} + {$EXTERNALSYM OBJ_NAME_get} + {$EXTERNALSYM OBJ_NAME_add} + {$EXTERNALSYM OBJ_NAME_remove} + {$EXTERNALSYM OBJ_NAME_cleanup} + {$EXTERNALSYM OBJ_dup} + {$EXTERNALSYM OBJ_nid2obj} + {$EXTERNALSYM OBJ_nid2ln} + {$EXTERNALSYM OBJ_nid2sn} + {$EXTERNALSYM OBJ_obj2nid} + {$EXTERNALSYM OBJ_txt2obj} + {$EXTERNALSYM OBJ_obj2txt} + {$EXTERNALSYM OBJ_txt2nid} + {$EXTERNALSYM OBJ_ln2nid} + {$EXTERNALSYM OBJ_sn2nid} + {$EXTERNALSYM OBJ_cmp} + {$EXTERNALSYM OBJ_new_nid} + {$EXTERNALSYM OBJ_add_object} + {$EXTERNALSYM OBJ_create} + {$EXTERNALSYM OBJ_create_objects} + {$EXTERNALSYM OBJ_length} {introduced 1.1.0} + {$EXTERNALSYM OBJ_get0_data} {introduced 1.1.0} + {$EXTERNALSYM OBJ_find_sigid_algs} + {$EXTERNALSYM OBJ_find_sigid_by_algs} + {$EXTERNALSYM OBJ_add_sigid} + {$EXTERNALSYM OBJ_sigid_free} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +var + OBJ_NAME_init: function : TIdC_INT; cdecl = nil; + //TIdC_INT OBJ_NAME_new_index(TIdC_ULONG (*hash_func) (const PIdAnsiChar *); + // TIdC_INT (*cmp_func) (const PIdAnsiChar *; const PIdAnsiChar *); + // void (*free_func) (const PIdAnsiChar *; TIdC_INT; const PIdAnsiChar *)); + OBJ_NAME_get: function (const name: PIdAnsiChar; type_: TIdC_INT): PIdAnsiChar; cdecl = nil; + OBJ_NAME_add: function (const name: PIdAnsiChar; type_: TIdC_INT; const data: PIdAnsiChar): TIdC_INT; cdecl = nil; + OBJ_NAME_remove: function (const name: PIdAnsiChar; type_: TIdC_INT): TIdC_INT; cdecl = nil; + OBJ_NAME_cleanup: procedure (type_: TIdC_INT); cdecl = nil; +// void OBJ_NAME_do_all(TIdC_INT type_; void (*fn) (const OBJ_NAME *; void *arg); +// void *arg); +// void OBJ_NAME_do_all_sorted(TIdC_INT type_; +// void (*fn) (const OBJ_NAME *; void *arg); +// void *arg); + + OBJ_dup: function (const o: PASN1_OBJECT): PASN1_OBJECT; cdecl = nil; + OBJ_nid2obj: function (n: TIdC_INT): PASN1_OBJECT; cdecl = nil; + OBJ_nid2ln: function (n: TIdC_INT): PIdAnsiChar; cdecl = nil; + OBJ_nid2sn: function (n: TIdC_INT): PIdAnsiChar; cdecl = nil; + OBJ_obj2nid: function (const o: PASN1_OBJECT): TIdC_INT; cdecl = nil; + OBJ_txt2obj: function (const s: PIdAnsiChar; no_name: TIdC_INT): PASN1_OBJECT; cdecl = nil; + OBJ_obj2txt: function (buf: PIdAnsiChar; buf_len: TIdC_INT; const a: PASN1_OBJECT; no_name: TIdC_INT): TIdC_INT; cdecl = nil; + OBJ_txt2nid: function (const s: PIdAnsiChar): TIdC_INT; cdecl = nil; + OBJ_ln2nid: function (const s: PIdAnsiChar): TIdC_INT; cdecl = nil; + OBJ_sn2nid: function (const s: PIdAnsiChar): TIdC_INT; cdecl = nil; + OBJ_cmp: function (const a: PASN1_OBJECT; const b: PASN1_OBJECT): TIdC_INT; cdecl = nil; +// const void *OBJ_bsearch_(const void *key; const void *base; TIdC_INT num; TIdC_INT size; +// TIdC_INT (*cmp) (const void *; const void *)); +// const void *OBJ_bsearch_ex_(const void *key; const void *base; TIdC_INT num; +// TIdC_INT size; +// TIdC_INT (*cmp) (const void *; const void *); +// TIdC_INT flags); + + //# define _DECLARE_OBJ_BSEARCH_CMP_FN(scope; type1; type2; nm) \ + // static TIdC_INT nm##_cmp_BSEARCH_CMP_FN(const void *; const void *); \ + // static TIdC_INT nm##_cmp(type1 const *; type2 const *); \ + // scope type2 * OBJ_bsearch_##nm(type1 *key; type2 const *base; TIdC_INT num) + // + //# define DECLARE_OBJ_BSEARCH_CMP_FN(type1; type2; cmp) \ + // _DECLARE_OBJ_BSEARCH_CMP_FN(static; type1; type2; cmp) + //# define DECLARE_OBJ_BSEARCH_GLOBAL_CMP_FN(type1; type2; nm) \ + // type2 * OBJ_bsearch_##nm(type1 *key; type2 const *base; TIdC_INT num) + + (* + * Unsolved problem: if a type is actually a pointer type, like + * nid_triple is, then its impossible to get a const where you need + * it. Consider: + * + * typedef TIdC_INT nid_triple[3]; + * const void *a_; + * const nid_triple const *a = a_; + * + * The assignment discards a const because what you really want is: + * + * const TIdC_INT const * const *a = a_; + * + * But if you do that, you lose the fact that a is an array of 3 ints, + * which breaks comparison functions. + * + * Thus we end up having to cast, sadly, or unpack the + * declarations. Or, as I finally did in this case, declare nid_triple + * to be a struct, which it should have been in the first place. + * + * Ben, August 2008. + * + * Also, strictly speaking not all types need be const, but handling + * the non-constness means a lot of complication, and in practice + * comparison routines do always not touch their arguments. + *) + + //# define IMPLEMENT_OBJ_BSEARCH_CMP_FN(type1, type2, nm) \ + // static TIdC_INT nm##_cmp_BSEARCH_CMP_FN(const void *a_; const void *b_) \ + // { \ + // type1 const *a = a_; \ + // type2 const *b = b_; \ + // return nm##_cmp(a;b); \ + // } \ + // static type2 *OBJ_bsearch_##nm(type1 *key; type2 const *base; TIdC_INT num) \ + // { \ + // return (type2 *)OBJ_bsearch_(key; base; num; sizeof(type2); \ + // nm##_cmp_BSEARCH_CMP_FN); \ + // } \ + // extern void dummy_prototype(void) + // + //# define IMPLEMENT_OBJ_BSEARCH_GLOBAL_CMP_FN(type1; type2; nm) \ + // static TIdC_INT nm##_cmp_BSEARCH_CMP_FN(const void *a_; const void *b_) \ + // { \ + // type1 const *a = a_; \ + // type2 const *b = b_; \ + // return nm##_cmp(a;b); \ + // } \ + // type2 *OBJ_bsearch_##nm(type1 *key; type2 const *base; TIdC_INT num) \ + // { \ + // return (type2 *)OBJ_bsearch_(key; base; num; sizeof(type2); \ + // nm##_cmp_BSEARCH_CMP_FN); \ + // } \ + // extern void dummy_prototype(void) + // + //# define OBJ_bsearch(type1;key;type2;base;num;cmp) \ + // ((type2 *)OBJ_bsearch_(CHECKED_PTR_OF(type1;key);CHECKED_PTR_OF(type2;base); \ + // num;sizeof(type2); \ + // ((void)CHECKED_PTR_OF(type1;cmp##_type_1); \ + // (void)CHECKED_PTR_OF(type2;cmp##_type_2); \ + // cmp##_BSEARCH_CMP_FN))) + // + //# define OBJ_bsearch_ex(type1;key;type2;base;num;cmp;flags) \ + // ((type2 *)OBJ_bsearch_ex_(CHECKED_PTR_OF(type1;key);CHECKED_PTR_OF(type2;base); \ + // num;sizeof(type2); \ + // ((void)CHECKED_PTR_OF(type1;cmp##_type_1); \ + // (void)type_2=CHECKED_PTR_OF(type2;cmp##_type_2); \ + // cmp##_BSEARCH_CMP_FN));flags) + + OBJ_new_nid: function (num: TIdC_INT): TIdC_INT; cdecl = nil; + OBJ_add_object: function (const obj: PASN1_OBJECT): TIdC_INT; cdecl = nil; + OBJ_create: function (const oid: PIdAnsiChar; const sn: PIdAnsiChar; const ln: PIdAnsiChar): TIdC_INT; cdecl = nil; + OBJ_create_objects: function (in_: PBIO): TIdC_INT; cdecl = nil; + + OBJ_length: function (const obj: PASN1_OBJECT): TIdC_SIZET; cdecl = nil; {introduced 1.1.0} + OBJ_get0_data: function (const obj: PASN1_OBJECT): PByte; cdecl = nil; {introduced 1.1.0} + + OBJ_find_sigid_algs: function (signid: TIdC_INT; pdig_nid: PIdC_INT; ppkey_nid: PIdC_INT): TIdC_INT; cdecl = nil; + OBJ_find_sigid_by_algs: function (psignid: PIdC_INT; dig_nid: TIdC_INT; pkey_nid: TIdC_INT): TIdC_INT; cdecl = nil; + OBJ_add_sigid: function (signid: TIdC_INT; dig_id: TIdC_INT; pkey_id: TIdC_INT): TIdC_INT; cdecl = nil; + OBJ_sigid_free: procedure ; cdecl = nil; + +{$ELSE} + function OBJ_NAME_init: TIdC_INT cdecl; external CLibCrypto; + //TIdC_INT OBJ_NAME_new_index(TIdC_ULONG (*hash_func) (const PIdAnsiChar *); + // TIdC_INT (*cmp_func) (const PIdAnsiChar *; const PIdAnsiChar *); + // void (*free_func) (const PIdAnsiChar *; TIdC_INT; const PIdAnsiChar *)); + function OBJ_NAME_get(const name: PIdAnsiChar; type_: TIdC_INT): PIdAnsiChar cdecl; external CLibCrypto; + function OBJ_NAME_add(const name: PIdAnsiChar; type_: TIdC_INT; const data: PIdAnsiChar): TIdC_INT cdecl; external CLibCrypto; + function OBJ_NAME_remove(const name: PIdAnsiChar; type_: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + procedure OBJ_NAME_cleanup(type_: TIdC_INT) cdecl; external CLibCrypto; +// void OBJ_NAME_do_all(TIdC_INT type_; void (*fn) (const OBJ_NAME *; void *arg); +// void *arg); +// void OBJ_NAME_do_all_sorted(TIdC_INT type_; +// void (*fn) (const OBJ_NAME *; void *arg); +// void *arg); + + function OBJ_dup(const o: PASN1_OBJECT): PASN1_OBJECT cdecl; external CLibCrypto; + function OBJ_nid2obj(n: TIdC_INT): PASN1_OBJECT cdecl; external CLibCrypto; + function OBJ_nid2ln(n: TIdC_INT): PIdAnsiChar cdecl; external CLibCrypto; + function OBJ_nid2sn(n: TIdC_INT): PIdAnsiChar cdecl; external CLibCrypto; + function OBJ_obj2nid(const o: PASN1_OBJECT): TIdC_INT cdecl; external CLibCrypto; + function OBJ_txt2obj(const s: PIdAnsiChar; no_name: TIdC_INT): PASN1_OBJECT cdecl; external CLibCrypto; + function OBJ_obj2txt(buf: PIdAnsiChar; buf_len: TIdC_INT; const a: PASN1_OBJECT; no_name: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function OBJ_txt2nid(const s: PIdAnsiChar): TIdC_INT cdecl; external CLibCrypto; + function OBJ_ln2nid(const s: PIdAnsiChar): TIdC_INT cdecl; external CLibCrypto; + function OBJ_sn2nid(const s: PIdAnsiChar): TIdC_INT cdecl; external CLibCrypto; + function OBJ_cmp(const a: PASN1_OBJECT; const b: PASN1_OBJECT): TIdC_INT cdecl; external CLibCrypto; +// const void *OBJ_bsearch_(const void *key; const void *base; TIdC_INT num; TIdC_INT size; +// TIdC_INT (*cmp) (const void *; const void *)); +// const void *OBJ_bsearch_ex_(const void *key; const void *base; TIdC_INT num; +// TIdC_INT size; +// TIdC_INT (*cmp) (const void *; const void *); +// TIdC_INT flags); + + //# define _DECLARE_OBJ_BSEARCH_CMP_FN(scope; type1; type2; nm) \ + // static TIdC_INT nm##_cmp_BSEARCH_CMP_FN(const void *; const void *); \ + // static TIdC_INT nm##_cmp(type1 const *; type2 const *); \ + // scope type2 * OBJ_bsearch_##nm(type1 *key; type2 const *base; TIdC_INT num) + // + //# define DECLARE_OBJ_BSEARCH_CMP_FN(type1; type2; cmp) \ + // _DECLARE_OBJ_BSEARCH_CMP_FN(static; type1; type2; cmp) + //# define DECLARE_OBJ_BSEARCH_GLOBAL_CMP_FN(type1; type2; nm) \ + // type2 * OBJ_bsearch_##nm(type1 *key; type2 const *base; TIdC_INT num) + + (* + * Unsolved problem: if a type is actually a pointer type, like + * nid_triple is, then its impossible to get a const where you need + * it. Consider: + * + * typedef TIdC_INT nid_triple[3]; + * const void *a_; + * const nid_triple const *a = a_; + * + * The assignment discards a const because what you really want is: + * + * const TIdC_INT const * const *a = a_; + * + * But if you do that, you lose the fact that a is an array of 3 ints, + * which breaks comparison functions. + * + * Thus we end up having to cast, sadly, or unpack the + * declarations. Or, as I finally did in this case, declare nid_triple + * to be a struct, which it should have been in the first place. + * + * Ben, August 2008. + * + * Also, strictly speaking not all types need be const, but handling + * the non-constness means a lot of complication, and in practice + * comparison routines do always not touch their arguments. + *) + + //# define IMPLEMENT_OBJ_BSEARCH_CMP_FN(type1, type2, nm) \ + // static TIdC_INT nm##_cmp_BSEARCH_CMP_FN(const void *a_; const void *b_) \ + // { \ + // type1 const *a = a_; \ + // type2 const *b = b_; \ + // return nm##_cmp(a;b); \ + // } \ + // static type2 *OBJ_bsearch_##nm(type1 *key; type2 const *base; TIdC_INT num) \ + // { \ + // return (type2 *)OBJ_bsearch_(key; base; num; sizeof(type2); \ + // nm##_cmp_BSEARCH_CMP_FN); \ + // } \ + // extern void dummy_prototype(void) + // + //# define IMPLEMENT_OBJ_BSEARCH_GLOBAL_CMP_FN(type1; type2; nm) \ + // static TIdC_INT nm##_cmp_BSEARCH_CMP_FN(const void *a_; const void *b_) \ + // { \ + // type1 const *a = a_; \ + // type2 const *b = b_; \ + // return nm##_cmp(a;b); \ + // } \ + // type2 *OBJ_bsearch_##nm(type1 *key; type2 const *base; TIdC_INT num) \ + // { \ + // return (type2 *)OBJ_bsearch_(key; base; num; sizeof(type2); \ + // nm##_cmp_BSEARCH_CMP_FN); \ + // } \ + // extern void dummy_prototype(void) + // + //# define OBJ_bsearch(type1;key;type2;base;num;cmp) \ + // ((type2 *)OBJ_bsearch_(CHECKED_PTR_OF(type1;key);CHECKED_PTR_OF(type2;base); \ + // num;sizeof(type2); \ + // ((void)CHECKED_PTR_OF(type1;cmp##_type_1); \ + // (void)CHECKED_PTR_OF(type2;cmp##_type_2); \ + // cmp##_BSEARCH_CMP_FN))) + // + //# define OBJ_bsearch_ex(type1;key;type2;base;num;cmp;flags) \ + // ((type2 *)OBJ_bsearch_ex_(CHECKED_PTR_OF(type1;key);CHECKED_PTR_OF(type2;base); \ + // num;sizeof(type2); \ + // ((void)CHECKED_PTR_OF(type1;cmp##_type_1); \ + // (void)type_2=CHECKED_PTR_OF(type2;cmp##_type_2); \ + // cmp##_BSEARCH_CMP_FN));flags) + + function OBJ_new_nid(num: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function OBJ_add_object(const obj: PASN1_OBJECT): TIdC_INT cdecl; external CLibCrypto; + function OBJ_create(const oid: PIdAnsiChar; const sn: PIdAnsiChar; const ln: PIdAnsiChar): TIdC_INT cdecl; external CLibCrypto; + function OBJ_create_objects(in_: PBIO): TIdC_INT cdecl; external CLibCrypto; + + function OBJ_length(const obj: PASN1_OBJECT): TIdC_SIZET cdecl; external CLibCrypto; {introduced 1.1.0} + function OBJ_get0_data(const obj: PASN1_OBJECT): PByte cdecl; external CLibCrypto; {introduced 1.1.0} + + function OBJ_find_sigid_algs(signid: TIdC_INT; pdig_nid: PIdC_INT; ppkey_nid: PIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function OBJ_find_sigid_by_algs(psignid: PIdC_INT; dig_nid: TIdC_INT; pkey_nid: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function OBJ_add_sigid(signid: TIdC_INT; dig_id: TIdC_INT; pkey_id: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + procedure OBJ_sigid_free cdecl; external CLibCrypto; + +{$ENDIF} + +implementation + + uses + classes, + IdSSLOpenSSLExceptionHandlers, + IdResourceStringsOpenSSL + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + ,IdSSLOpenSSLLoader + {$ENDIF}; + +const + OBJ_length_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + OBJ_get0_data_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +const + OBJ_NAME_init_procname = 'OBJ_NAME_init'; + //TIdC_INT OBJ_NAME_new_index(TIdC_ULONG (*hash_func) (const PIdAnsiChar *); + // TIdC_INT (*cmp_func) (const PIdAnsiChar *; const PIdAnsiChar *); + // void (*free_func) (const PIdAnsiChar *; TIdC_INT; const PIdAnsiChar *)); + OBJ_NAME_get_procname = 'OBJ_NAME_get'; + OBJ_NAME_add_procname = 'OBJ_NAME_add'; + OBJ_NAME_remove_procname = 'OBJ_NAME_remove'; + OBJ_NAME_cleanup_procname = 'OBJ_NAME_cleanup'; +// void OBJ_NAME_do_all(TIdC_INT type_; void (*fn) (const OBJ_NAME *; void *arg); +// void *arg); +// void OBJ_NAME_do_all_sorted(TIdC_INT type_; +// void (*fn) (const OBJ_NAME *; void *arg); +// void *arg); + + OBJ_dup_procname = 'OBJ_dup'; + OBJ_nid2obj_procname = 'OBJ_nid2obj'; + OBJ_nid2ln_procname = 'OBJ_nid2ln'; + OBJ_nid2sn_procname = 'OBJ_nid2sn'; + OBJ_obj2nid_procname = 'OBJ_obj2nid'; + OBJ_txt2obj_procname = 'OBJ_txt2obj'; + OBJ_obj2txt_procname = 'OBJ_obj2txt'; + OBJ_txt2nid_procname = 'OBJ_txt2nid'; + OBJ_ln2nid_procname = 'OBJ_ln2nid'; + OBJ_sn2nid_procname = 'OBJ_sn2nid'; + OBJ_cmp_procname = 'OBJ_cmp'; +// const void *OBJ_bsearch_(const void *key; const void *base; TIdC_INT num; TIdC_INT size; +// TIdC_INT (*cmp) (const void *; const void *)); +// const void *OBJ_bsearch_ex_(const void *key; const void *base; TIdC_INT num; +// TIdC_INT size; +// TIdC_INT (*cmp) (const void *; const void *); +// TIdC_INT flags); + + //# define _DECLARE_OBJ_BSEARCH_CMP_FN(scope; type1; type2; nm) \ + // static TIdC_INT nm##_cmp_BSEARCH_CMP_FN(const void *; const void *); \ + // static TIdC_INT nm##_cmp(type1 const *; type2 const *); \ + // scope type2 * OBJ_bsearch_##nm(type1 *key; type2 const *base; TIdC_INT num) + // + //# define DECLARE_OBJ_BSEARCH_CMP_FN(type1; type2; cmp) \ + // _DECLARE_OBJ_BSEARCH_CMP_FN(static; type1; type2; cmp) + //# define DECLARE_OBJ_BSEARCH_GLOBAL_CMP_FN(type1; type2; nm) \ + // type2 * OBJ_bsearch_##nm(type1 *key; type2 const *base; TIdC_INT num) + + (* + * Unsolved problem: if a type is actually a pointer type, like + * nid_triple is, then its impossible to get a const where you need + * it. Consider: + * + * typedef TIdC_INT nid_triple[3]; + * const void *a_; + * const nid_triple const *a = a_; + * + * The assignment discards a const because what you really want is: + * + * const TIdC_INT const * const *a = a_; + * + * But if you do that, you lose the fact that a is an array of 3 ints, + * which breaks comparison functions. + * + * Thus we end up having to cast, sadly, or unpack the + * declarations. Or, as I finally did in this case, declare nid_triple + * to be a struct, which it should have been in the first place. + * + * Ben, August 2008. + * + * Also, strictly speaking not all types need be const, but handling + * the non-constness means a lot of complication, and in practice + * comparison routines do always not touch their arguments. + *) + + //# define IMPLEMENT_OBJ_BSEARCH_CMP_FN(type1, type2, nm) \ + // static TIdC_INT nm##_cmp_BSEARCH_CMP_FN(const void *a_; const void *b_) \ + // { \ + // type1 const *a = a_; \ + // type2 const *b = b_; \ + // return nm##_cmp(a;b); \ + // } \ + // static type2 *OBJ_bsearch_##nm(type1 *key; type2 const *base; TIdC_INT num) \ + // { \ + // return (type2 *)OBJ_bsearch_(key; base; num; sizeof(type2); \ + // nm##_cmp_BSEARCH_CMP_FN); \ + // } \ + // extern void dummy_prototype(void) + // + //# define IMPLEMENT_OBJ_BSEARCH_GLOBAL_CMP_FN(type1; type2; nm) \ + // static TIdC_INT nm##_cmp_BSEARCH_CMP_FN(const void *a_; const void *b_) \ + // { \ + // type1 const *a = a_; \ + // type2 const *b = b_; \ + // return nm##_cmp(a;b); \ + // } \ + // type2 *OBJ_bsearch_##nm(type1 *key; type2 const *base; TIdC_INT num) \ + // { \ + // return (type2 *)OBJ_bsearch_(key; base; num; sizeof(type2); \ + // nm##_cmp_BSEARCH_CMP_FN); \ + // } \ + // extern void dummy_prototype(void) + // + //# define OBJ_bsearch(type1;key;type2;base;num;cmp) \ + // ((type2 *)OBJ_bsearch_(CHECKED_PTR_OF(type1;key);CHECKED_PTR_OF(type2;base); \ + // num;sizeof(type2); \ + // ((void)CHECKED_PTR_OF(type1;cmp##_type_1); \ + // (void)CHECKED_PTR_OF(type2;cmp##_type_2); \ + // cmp##_BSEARCH_CMP_FN))) + // + //# define OBJ_bsearch_ex(type1;key;type2;base;num;cmp;flags) \ + // ((type2 *)OBJ_bsearch_ex_(CHECKED_PTR_OF(type1;key);CHECKED_PTR_OF(type2;base); \ + // num;sizeof(type2); \ + // ((void)CHECKED_PTR_OF(type1;cmp##_type_1); \ + // (void)type_2=CHECKED_PTR_OF(type2;cmp##_type_2); \ + // cmp##_BSEARCH_CMP_FN));flags) + + OBJ_new_nid_procname = 'OBJ_new_nid'; + OBJ_add_object_procname = 'OBJ_add_object'; + OBJ_create_procname = 'OBJ_create'; + OBJ_create_objects_procname = 'OBJ_create_objects'; + + OBJ_length_procname = 'OBJ_length'; {introduced 1.1.0} + OBJ_get0_data_procname = 'OBJ_get0_data'; {introduced 1.1.0} + + OBJ_find_sigid_algs_procname = 'OBJ_find_sigid_algs'; + OBJ_find_sigid_by_algs_procname = 'OBJ_find_sigid_by_algs'; + OBJ_add_sigid_procname = 'OBJ_add_sigid'; + OBJ_sigid_free_procname = 'OBJ_sigid_free'; + + +{$WARN NO_RETVAL OFF} +function ERR_OBJ_NAME_init: TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(OBJ_NAME_init_procname); +end; + + + //TIdC_INT OBJ_NAME_new_index(TIdC_ULONG (*hash_func) (const PIdAnsiChar *); + // TIdC_INT (*cmp_func) (const PIdAnsiChar *; const PIdAnsiChar *); + // void (*free_func) (const PIdAnsiChar *; TIdC_INT; const PIdAnsiChar *)); +function ERR_OBJ_NAME_get(const name: PIdAnsiChar; type_: TIdC_INT): PIdAnsiChar; +begin + EIdAPIFunctionNotPresent.RaiseException(OBJ_NAME_get_procname); +end; + + +function ERR_OBJ_NAME_add(const name: PIdAnsiChar; type_: TIdC_INT; const data: PIdAnsiChar): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(OBJ_NAME_add_procname); +end; + + +function ERR_OBJ_NAME_remove(const name: PIdAnsiChar; type_: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(OBJ_NAME_remove_procname); +end; + + +procedure ERR_OBJ_NAME_cleanup(type_: TIdC_INT); +begin + EIdAPIFunctionNotPresent.RaiseException(OBJ_NAME_cleanup_procname); +end; + + +// void OBJ_NAME_do_all(TIdC_INT type_; void (*fn) (const OBJ_NAME *; void *arg); +// void *arg); +// void OBJ_NAME_do_all_sorted(TIdC_INT type_; +// void (*fn) (const OBJ_NAME *; void *arg); +// void *arg); + +function ERR_OBJ_dup(const o: PASN1_OBJECT): PASN1_OBJECT; +begin + EIdAPIFunctionNotPresent.RaiseException(OBJ_dup_procname); +end; + + +function ERR_OBJ_nid2obj(n: TIdC_INT): PASN1_OBJECT; +begin + EIdAPIFunctionNotPresent.RaiseException(OBJ_nid2obj_procname); +end; + + +function ERR_OBJ_nid2ln(n: TIdC_INT): PIdAnsiChar; +begin + EIdAPIFunctionNotPresent.RaiseException(OBJ_nid2ln_procname); +end; + + +function ERR_OBJ_nid2sn(n: TIdC_INT): PIdAnsiChar; +begin + EIdAPIFunctionNotPresent.RaiseException(OBJ_nid2sn_procname); +end; + + +function ERR_OBJ_obj2nid(const o: PASN1_OBJECT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(OBJ_obj2nid_procname); +end; + + +function ERR_OBJ_txt2obj(const s: PIdAnsiChar; no_name: TIdC_INT): PASN1_OBJECT; +begin + EIdAPIFunctionNotPresent.RaiseException(OBJ_txt2obj_procname); +end; + + +function ERR_OBJ_obj2txt(buf: PIdAnsiChar; buf_len: TIdC_INT; const a: PASN1_OBJECT; no_name: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(OBJ_obj2txt_procname); +end; + + +function ERR_OBJ_txt2nid(const s: PIdAnsiChar): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(OBJ_txt2nid_procname); +end; + + +function ERR_OBJ_ln2nid(const s: PIdAnsiChar): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(OBJ_ln2nid_procname); +end; + + +function ERR_OBJ_sn2nid(const s: PIdAnsiChar): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(OBJ_sn2nid_procname); +end; + + +function ERR_OBJ_cmp(const a: PASN1_OBJECT; const b: PASN1_OBJECT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(OBJ_cmp_procname); +end; + + +// const void *OBJ_bsearch_(const void *key; const void *base; TIdC_INT num; TIdC_INT size; +// TIdC_INT (*cmp) (const void *; const void *)); +// const void *OBJ_bsearch_ex_(const void *key; const void *base; TIdC_INT num; +// TIdC_INT size; +// TIdC_INT (*cmp) (const void *; const void *); +// TIdC_INT flags); + + //# define _DECLARE_OBJ_BSEARCH_CMP_FN(scope; type1; type2; nm) \ + // static TIdC_INT nm##_cmp_BSEARCH_CMP_FN(const void *; const void *); \ + // static TIdC_INT nm##_cmp(type1 const *; type2 const *); \ + // scope type2 * OBJ_bsearch_##nm(type1 *key; type2 const *base; TIdC_INT num) + // + //# define DECLARE_OBJ_BSEARCH_CMP_FN(type1; type2; cmp) \ + // _DECLARE_OBJ_BSEARCH_CMP_FN(static; type1; type2; cmp) + //# define DECLARE_OBJ_BSEARCH_GLOBAL_CMP_FN(type1; type2; nm) \ + // type2 * OBJ_bsearch_##nm(type1 *key; type2 const *base; TIdC_INT num) + + (* + * Unsolved problem: if a type is actually a pointer type, like + * nid_triple is, then its impossible to get a const where you need + * it. Consider: + * + * typedef TIdC_INT nid_triple[3]; + * const void *a_; + * const nid_triple const *a = a_; + * + * The assignment discards a const because what you really want is: + * + * const TIdC_INT const * const *a = a_; + * + * But if you do that, you lose the fact that a is an array of 3 ints, + * which breaks comparison functions. + * + * Thus we end up having to cast, sadly, or unpack the + * declarations. Or, as I finally did in this case, declare nid_triple + * to be a struct, which it should have been in the first place. + * + * Ben, August 2008. + * + * Also, strictly speaking not all types need be const, but handling + * the non-constness means a lot of complication, and in practice + * comparison routines do always not touch their arguments. + *) + + //# define IMPLEMENT_OBJ_BSEARCH_CMP_FN(type1, type2, nm) \ + // static TIdC_INT nm##_cmp_BSEARCH_CMP_FN(const void *a_; const void *b_) \ + // { \ + // type1 const *a = a_; \ + // type2 const *b = b_; \ + // return nm##_cmp(a;b); \ + // } \ + // static type2 *OBJ_bsearch_##nm(type1 *key; type2 const *base; TIdC_INT num) \ + // { \ + // return (type2 *)OBJ_bsearch_(key; base; num; sizeof(type2); \ + // nm##_cmp_BSEARCH_CMP_FN); \ + // } \ + // extern void dummy_prototype(void) + // + //# define IMPLEMENT_OBJ_BSEARCH_GLOBAL_CMP_FN(type1; type2; nm) \ + // static TIdC_INT nm##_cmp_BSEARCH_CMP_FN(const void *a_; const void *b_) \ + // { \ + // type1 const *a = a_; \ + // type2 const *b = b_; \ + // return nm##_cmp(a;b); \ + // } \ + // type2 *OBJ_bsearch_##nm(type1 *key; type2 const *base; TIdC_INT num) \ + // { \ + // return (type2 *)OBJ_bsearch_(key; base; num; sizeof(type2); \ + // nm##_cmp_BSEARCH_CMP_FN); \ + // } \ + // extern void dummy_prototype(void) + // + //# define OBJ_bsearch(type1;key;type2;base;num;cmp) \ + // ((type2 *)OBJ_bsearch_(CHECKED_PTR_OF(type1;key);CHECKED_PTR_OF(type2;base); \ + // num;sizeof(type2); \ + // ((void)CHECKED_PTR_OF(type1;cmp##_type_1); \ + // (void)CHECKED_PTR_OF(type2;cmp##_type_2); \ + // cmp##_BSEARCH_CMP_FN))) + // + //# define OBJ_bsearch_ex(type1;key;type2;base;num;cmp;flags) \ + // ((type2 *)OBJ_bsearch_ex_(CHECKED_PTR_OF(type1;key);CHECKED_PTR_OF(type2;base); \ + // num;sizeof(type2); \ + // ((void)CHECKED_PTR_OF(type1;cmp##_type_1); \ + // (void)type_2=CHECKED_PTR_OF(type2;cmp##_type_2); \ + // cmp##_BSEARCH_CMP_FN));flags) + +function ERR_OBJ_new_nid(num: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(OBJ_new_nid_procname); +end; + + +function ERR_OBJ_add_object(const obj: PASN1_OBJECT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(OBJ_add_object_procname); +end; + + +function ERR_OBJ_create(const oid: PIdAnsiChar; const sn: PIdAnsiChar; const ln: PIdAnsiChar): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(OBJ_create_procname); +end; + + +function ERR_OBJ_create_objects(in_: PBIO): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(OBJ_create_objects_procname); +end; + + + +function ERR_OBJ_length(const obj: PASN1_OBJECT): TIdC_SIZET; +begin + EIdAPIFunctionNotPresent.RaiseException(OBJ_length_procname); +end; + + {introduced 1.1.0} +function ERR_OBJ_get0_data(const obj: PASN1_OBJECT): PByte; +begin + EIdAPIFunctionNotPresent.RaiseException(OBJ_get0_data_procname); +end; + + {introduced 1.1.0} + +function ERR_OBJ_find_sigid_algs(signid: TIdC_INT; pdig_nid: PIdC_INT; ppkey_nid: PIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(OBJ_find_sigid_algs_procname); +end; + + +function ERR_OBJ_find_sigid_by_algs(psignid: PIdC_INT; dig_nid: TIdC_INT; pkey_nid: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(OBJ_find_sigid_by_algs_procname); +end; + + +function ERR_OBJ_add_sigid(signid: TIdC_INT; dig_id: TIdC_INT; pkey_id: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(OBJ_add_sigid_procname); +end; + + +procedure ERR_OBJ_sigid_free; +begin + EIdAPIFunctionNotPresent.RaiseException(OBJ_sigid_free_procname); +end; + + + +{$WARN NO_RETVAL ON} + +procedure Load(const ADllHandle: TIdLibHandle; LibVersion: TIdC_UINT; const AFailed: TStringList); + +var FuncLoadError: boolean; + +begin + OBJ_NAME_init := LoadLibFunction(ADllHandle, OBJ_NAME_init_procname); + FuncLoadError := not assigned(OBJ_NAME_init); + if FuncLoadError then + begin + {$if not defined(OBJ_NAME_init_allownil)} + OBJ_NAME_init := @ERR_OBJ_NAME_init; + {$ifend} + {$if declared(OBJ_NAME_init_introduced)} + if LibVersion < OBJ_NAME_init_introduced then + begin + {$if declared(FC_OBJ_NAME_init)} + OBJ_NAME_init := @FC_OBJ_NAME_init; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OBJ_NAME_init_removed)} + if OBJ_NAME_init_removed <= LibVersion then + begin + {$if declared(_OBJ_NAME_init)} + OBJ_NAME_init := @_OBJ_NAME_init; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OBJ_NAME_init_allownil)} + if FuncLoadError then + AFailed.Add('OBJ_NAME_init'); + {$ifend} + end; + + + OBJ_NAME_get := LoadLibFunction(ADllHandle, OBJ_NAME_get_procname); + FuncLoadError := not assigned(OBJ_NAME_get); + if FuncLoadError then + begin + {$if not defined(OBJ_NAME_get_allownil)} + OBJ_NAME_get := @ERR_OBJ_NAME_get; + {$ifend} + {$if declared(OBJ_NAME_get_introduced)} + if LibVersion < OBJ_NAME_get_introduced then + begin + {$if declared(FC_OBJ_NAME_get)} + OBJ_NAME_get := @FC_OBJ_NAME_get; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OBJ_NAME_get_removed)} + if OBJ_NAME_get_removed <= LibVersion then + begin + {$if declared(_OBJ_NAME_get)} + OBJ_NAME_get := @_OBJ_NAME_get; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OBJ_NAME_get_allownil)} + if FuncLoadError then + AFailed.Add('OBJ_NAME_get'); + {$ifend} + end; + + + OBJ_NAME_add := LoadLibFunction(ADllHandle, OBJ_NAME_add_procname); + FuncLoadError := not assigned(OBJ_NAME_add); + if FuncLoadError then + begin + {$if not defined(OBJ_NAME_add_allownil)} + OBJ_NAME_add := @ERR_OBJ_NAME_add; + {$ifend} + {$if declared(OBJ_NAME_add_introduced)} + if LibVersion < OBJ_NAME_add_introduced then + begin + {$if declared(FC_OBJ_NAME_add)} + OBJ_NAME_add := @FC_OBJ_NAME_add; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OBJ_NAME_add_removed)} + if OBJ_NAME_add_removed <= LibVersion then + begin + {$if declared(_OBJ_NAME_add)} + OBJ_NAME_add := @_OBJ_NAME_add; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OBJ_NAME_add_allownil)} + if FuncLoadError then + AFailed.Add('OBJ_NAME_add'); + {$ifend} + end; + + + OBJ_NAME_remove := LoadLibFunction(ADllHandle, OBJ_NAME_remove_procname); + FuncLoadError := not assigned(OBJ_NAME_remove); + if FuncLoadError then + begin + {$if not defined(OBJ_NAME_remove_allownil)} + OBJ_NAME_remove := @ERR_OBJ_NAME_remove; + {$ifend} + {$if declared(OBJ_NAME_remove_introduced)} + if LibVersion < OBJ_NAME_remove_introduced then + begin + {$if declared(FC_OBJ_NAME_remove)} + OBJ_NAME_remove := @FC_OBJ_NAME_remove; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OBJ_NAME_remove_removed)} + if OBJ_NAME_remove_removed <= LibVersion then + begin + {$if declared(_OBJ_NAME_remove)} + OBJ_NAME_remove := @_OBJ_NAME_remove; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OBJ_NAME_remove_allownil)} + if FuncLoadError then + AFailed.Add('OBJ_NAME_remove'); + {$ifend} + end; + + + OBJ_NAME_cleanup := LoadLibFunction(ADllHandle, OBJ_NAME_cleanup_procname); + FuncLoadError := not assigned(OBJ_NAME_cleanup); + if FuncLoadError then + begin + {$if not defined(OBJ_NAME_cleanup_allownil)} + OBJ_NAME_cleanup := @ERR_OBJ_NAME_cleanup; + {$ifend} + {$if declared(OBJ_NAME_cleanup_introduced)} + if LibVersion < OBJ_NAME_cleanup_introduced then + begin + {$if declared(FC_OBJ_NAME_cleanup)} + OBJ_NAME_cleanup := @FC_OBJ_NAME_cleanup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OBJ_NAME_cleanup_removed)} + if OBJ_NAME_cleanup_removed <= LibVersion then + begin + {$if declared(_OBJ_NAME_cleanup)} + OBJ_NAME_cleanup := @_OBJ_NAME_cleanup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OBJ_NAME_cleanup_allownil)} + if FuncLoadError then + AFailed.Add('OBJ_NAME_cleanup'); + {$ifend} + end; + + + OBJ_dup := LoadLibFunction(ADllHandle, OBJ_dup_procname); + FuncLoadError := not assigned(OBJ_dup); + if FuncLoadError then + begin + {$if not defined(OBJ_dup_allownil)} + OBJ_dup := @ERR_OBJ_dup; + {$ifend} + {$if declared(OBJ_dup_introduced)} + if LibVersion < OBJ_dup_introduced then + begin + {$if declared(FC_OBJ_dup)} + OBJ_dup := @FC_OBJ_dup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OBJ_dup_removed)} + if OBJ_dup_removed <= LibVersion then + begin + {$if declared(_OBJ_dup)} + OBJ_dup := @_OBJ_dup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OBJ_dup_allownil)} + if FuncLoadError then + AFailed.Add('OBJ_dup'); + {$ifend} + end; + + + OBJ_nid2obj := LoadLibFunction(ADllHandle, OBJ_nid2obj_procname); + FuncLoadError := not assigned(OBJ_nid2obj); + if FuncLoadError then + begin + {$if not defined(OBJ_nid2obj_allownil)} + OBJ_nid2obj := @ERR_OBJ_nid2obj; + {$ifend} + {$if declared(OBJ_nid2obj_introduced)} + if LibVersion < OBJ_nid2obj_introduced then + begin + {$if declared(FC_OBJ_nid2obj)} + OBJ_nid2obj := @FC_OBJ_nid2obj; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OBJ_nid2obj_removed)} + if OBJ_nid2obj_removed <= LibVersion then + begin + {$if declared(_OBJ_nid2obj)} + OBJ_nid2obj := @_OBJ_nid2obj; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OBJ_nid2obj_allownil)} + if FuncLoadError then + AFailed.Add('OBJ_nid2obj'); + {$ifend} + end; + + + OBJ_nid2ln := LoadLibFunction(ADllHandle, OBJ_nid2ln_procname); + FuncLoadError := not assigned(OBJ_nid2ln); + if FuncLoadError then + begin + {$if not defined(OBJ_nid2ln_allownil)} + OBJ_nid2ln := @ERR_OBJ_nid2ln; + {$ifend} + {$if declared(OBJ_nid2ln_introduced)} + if LibVersion < OBJ_nid2ln_introduced then + begin + {$if declared(FC_OBJ_nid2ln)} + OBJ_nid2ln := @FC_OBJ_nid2ln; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OBJ_nid2ln_removed)} + if OBJ_nid2ln_removed <= LibVersion then + begin + {$if declared(_OBJ_nid2ln)} + OBJ_nid2ln := @_OBJ_nid2ln; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OBJ_nid2ln_allownil)} + if FuncLoadError then + AFailed.Add('OBJ_nid2ln'); + {$ifend} + end; + + + OBJ_nid2sn := LoadLibFunction(ADllHandle, OBJ_nid2sn_procname); + FuncLoadError := not assigned(OBJ_nid2sn); + if FuncLoadError then + begin + {$if not defined(OBJ_nid2sn_allownil)} + OBJ_nid2sn := @ERR_OBJ_nid2sn; + {$ifend} + {$if declared(OBJ_nid2sn_introduced)} + if LibVersion < OBJ_nid2sn_introduced then + begin + {$if declared(FC_OBJ_nid2sn)} + OBJ_nid2sn := @FC_OBJ_nid2sn; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OBJ_nid2sn_removed)} + if OBJ_nid2sn_removed <= LibVersion then + begin + {$if declared(_OBJ_nid2sn)} + OBJ_nid2sn := @_OBJ_nid2sn; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OBJ_nid2sn_allownil)} + if FuncLoadError then + AFailed.Add('OBJ_nid2sn'); + {$ifend} + end; + + + OBJ_obj2nid := LoadLibFunction(ADllHandle, OBJ_obj2nid_procname); + FuncLoadError := not assigned(OBJ_obj2nid); + if FuncLoadError then + begin + {$if not defined(OBJ_obj2nid_allownil)} + OBJ_obj2nid := @ERR_OBJ_obj2nid; + {$ifend} + {$if declared(OBJ_obj2nid_introduced)} + if LibVersion < OBJ_obj2nid_introduced then + begin + {$if declared(FC_OBJ_obj2nid)} + OBJ_obj2nid := @FC_OBJ_obj2nid; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OBJ_obj2nid_removed)} + if OBJ_obj2nid_removed <= LibVersion then + begin + {$if declared(_OBJ_obj2nid)} + OBJ_obj2nid := @_OBJ_obj2nid; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OBJ_obj2nid_allownil)} + if FuncLoadError then + AFailed.Add('OBJ_obj2nid'); + {$ifend} + end; + + + OBJ_txt2obj := LoadLibFunction(ADllHandle, OBJ_txt2obj_procname); + FuncLoadError := not assigned(OBJ_txt2obj); + if FuncLoadError then + begin + {$if not defined(OBJ_txt2obj_allownil)} + OBJ_txt2obj := @ERR_OBJ_txt2obj; + {$ifend} + {$if declared(OBJ_txt2obj_introduced)} + if LibVersion < OBJ_txt2obj_introduced then + begin + {$if declared(FC_OBJ_txt2obj)} + OBJ_txt2obj := @FC_OBJ_txt2obj; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OBJ_txt2obj_removed)} + if OBJ_txt2obj_removed <= LibVersion then + begin + {$if declared(_OBJ_txt2obj)} + OBJ_txt2obj := @_OBJ_txt2obj; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OBJ_txt2obj_allownil)} + if FuncLoadError then + AFailed.Add('OBJ_txt2obj'); + {$ifend} + end; + + + OBJ_obj2txt := LoadLibFunction(ADllHandle, OBJ_obj2txt_procname); + FuncLoadError := not assigned(OBJ_obj2txt); + if FuncLoadError then + begin + {$if not defined(OBJ_obj2txt_allownil)} + OBJ_obj2txt := @ERR_OBJ_obj2txt; + {$ifend} + {$if declared(OBJ_obj2txt_introduced)} + if LibVersion < OBJ_obj2txt_introduced then + begin + {$if declared(FC_OBJ_obj2txt)} + OBJ_obj2txt := @FC_OBJ_obj2txt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OBJ_obj2txt_removed)} + if OBJ_obj2txt_removed <= LibVersion then + begin + {$if declared(_OBJ_obj2txt)} + OBJ_obj2txt := @_OBJ_obj2txt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OBJ_obj2txt_allownil)} + if FuncLoadError then + AFailed.Add('OBJ_obj2txt'); + {$ifend} + end; + + + OBJ_txt2nid := LoadLibFunction(ADllHandle, OBJ_txt2nid_procname); + FuncLoadError := not assigned(OBJ_txt2nid); + if FuncLoadError then + begin + {$if not defined(OBJ_txt2nid_allownil)} + OBJ_txt2nid := @ERR_OBJ_txt2nid; + {$ifend} + {$if declared(OBJ_txt2nid_introduced)} + if LibVersion < OBJ_txt2nid_introduced then + begin + {$if declared(FC_OBJ_txt2nid)} + OBJ_txt2nid := @FC_OBJ_txt2nid; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OBJ_txt2nid_removed)} + if OBJ_txt2nid_removed <= LibVersion then + begin + {$if declared(_OBJ_txt2nid)} + OBJ_txt2nid := @_OBJ_txt2nid; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OBJ_txt2nid_allownil)} + if FuncLoadError then + AFailed.Add('OBJ_txt2nid'); + {$ifend} + end; + + + OBJ_ln2nid := LoadLibFunction(ADllHandle, OBJ_ln2nid_procname); + FuncLoadError := not assigned(OBJ_ln2nid); + if FuncLoadError then + begin + {$if not defined(OBJ_ln2nid_allownil)} + OBJ_ln2nid := @ERR_OBJ_ln2nid; + {$ifend} + {$if declared(OBJ_ln2nid_introduced)} + if LibVersion < OBJ_ln2nid_introduced then + begin + {$if declared(FC_OBJ_ln2nid)} + OBJ_ln2nid := @FC_OBJ_ln2nid; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OBJ_ln2nid_removed)} + if OBJ_ln2nid_removed <= LibVersion then + begin + {$if declared(_OBJ_ln2nid)} + OBJ_ln2nid := @_OBJ_ln2nid; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OBJ_ln2nid_allownil)} + if FuncLoadError then + AFailed.Add('OBJ_ln2nid'); + {$ifend} + end; + + + OBJ_sn2nid := LoadLibFunction(ADllHandle, OBJ_sn2nid_procname); + FuncLoadError := not assigned(OBJ_sn2nid); + if FuncLoadError then + begin + {$if not defined(OBJ_sn2nid_allownil)} + OBJ_sn2nid := @ERR_OBJ_sn2nid; + {$ifend} + {$if declared(OBJ_sn2nid_introduced)} + if LibVersion < OBJ_sn2nid_introduced then + begin + {$if declared(FC_OBJ_sn2nid)} + OBJ_sn2nid := @FC_OBJ_sn2nid; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OBJ_sn2nid_removed)} + if OBJ_sn2nid_removed <= LibVersion then + begin + {$if declared(_OBJ_sn2nid)} + OBJ_sn2nid := @_OBJ_sn2nid; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OBJ_sn2nid_allownil)} + if FuncLoadError then + AFailed.Add('OBJ_sn2nid'); + {$ifend} + end; + + + OBJ_cmp := LoadLibFunction(ADllHandle, OBJ_cmp_procname); + FuncLoadError := not assigned(OBJ_cmp); + if FuncLoadError then + begin + {$if not defined(OBJ_cmp_allownil)} + OBJ_cmp := @ERR_OBJ_cmp; + {$ifend} + {$if declared(OBJ_cmp_introduced)} + if LibVersion < OBJ_cmp_introduced then + begin + {$if declared(FC_OBJ_cmp)} + OBJ_cmp := @FC_OBJ_cmp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OBJ_cmp_removed)} + if OBJ_cmp_removed <= LibVersion then + begin + {$if declared(_OBJ_cmp)} + OBJ_cmp := @_OBJ_cmp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OBJ_cmp_allownil)} + if FuncLoadError then + AFailed.Add('OBJ_cmp'); + {$ifend} + end; + + + OBJ_new_nid := LoadLibFunction(ADllHandle, OBJ_new_nid_procname); + FuncLoadError := not assigned(OBJ_new_nid); + if FuncLoadError then + begin + {$if not defined(OBJ_new_nid_allownil)} + OBJ_new_nid := @ERR_OBJ_new_nid; + {$ifend} + {$if declared(OBJ_new_nid_introduced)} + if LibVersion < OBJ_new_nid_introduced then + begin + {$if declared(FC_OBJ_new_nid)} + OBJ_new_nid := @FC_OBJ_new_nid; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OBJ_new_nid_removed)} + if OBJ_new_nid_removed <= LibVersion then + begin + {$if declared(_OBJ_new_nid)} + OBJ_new_nid := @_OBJ_new_nid; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OBJ_new_nid_allownil)} + if FuncLoadError then + AFailed.Add('OBJ_new_nid'); + {$ifend} + end; + + + OBJ_add_object := LoadLibFunction(ADllHandle, OBJ_add_object_procname); + FuncLoadError := not assigned(OBJ_add_object); + if FuncLoadError then + begin + {$if not defined(OBJ_add_object_allownil)} + OBJ_add_object := @ERR_OBJ_add_object; + {$ifend} + {$if declared(OBJ_add_object_introduced)} + if LibVersion < OBJ_add_object_introduced then + begin + {$if declared(FC_OBJ_add_object)} + OBJ_add_object := @FC_OBJ_add_object; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OBJ_add_object_removed)} + if OBJ_add_object_removed <= LibVersion then + begin + {$if declared(_OBJ_add_object)} + OBJ_add_object := @_OBJ_add_object; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OBJ_add_object_allownil)} + if FuncLoadError then + AFailed.Add('OBJ_add_object'); + {$ifend} + end; + + + OBJ_create := LoadLibFunction(ADllHandle, OBJ_create_procname); + FuncLoadError := not assigned(OBJ_create); + if FuncLoadError then + begin + {$if not defined(OBJ_create_allownil)} + OBJ_create := @ERR_OBJ_create; + {$ifend} + {$if declared(OBJ_create_introduced)} + if LibVersion < OBJ_create_introduced then + begin + {$if declared(FC_OBJ_create)} + OBJ_create := @FC_OBJ_create; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OBJ_create_removed)} + if OBJ_create_removed <= LibVersion then + begin + {$if declared(_OBJ_create)} + OBJ_create := @_OBJ_create; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OBJ_create_allownil)} + if FuncLoadError then + AFailed.Add('OBJ_create'); + {$ifend} + end; + + + OBJ_create_objects := LoadLibFunction(ADllHandle, OBJ_create_objects_procname); + FuncLoadError := not assigned(OBJ_create_objects); + if FuncLoadError then + begin + {$if not defined(OBJ_create_objects_allownil)} + OBJ_create_objects := @ERR_OBJ_create_objects; + {$ifend} + {$if declared(OBJ_create_objects_introduced)} + if LibVersion < OBJ_create_objects_introduced then + begin + {$if declared(FC_OBJ_create_objects)} + OBJ_create_objects := @FC_OBJ_create_objects; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OBJ_create_objects_removed)} + if OBJ_create_objects_removed <= LibVersion then + begin + {$if declared(_OBJ_create_objects)} + OBJ_create_objects := @_OBJ_create_objects; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OBJ_create_objects_allownil)} + if FuncLoadError then + AFailed.Add('OBJ_create_objects'); + {$ifend} + end; + + + OBJ_length := LoadLibFunction(ADllHandle, OBJ_length_procname); + FuncLoadError := not assigned(OBJ_length); + if FuncLoadError then + begin + {$if not defined(OBJ_length_allownil)} + OBJ_length := @ERR_OBJ_length; + {$ifend} + {$if declared(OBJ_length_introduced)} + if LibVersion < OBJ_length_introduced then + begin + {$if declared(FC_OBJ_length)} + OBJ_length := @FC_OBJ_length; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OBJ_length_removed)} + if OBJ_length_removed <= LibVersion then + begin + {$if declared(_OBJ_length)} + OBJ_length := @_OBJ_length; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OBJ_length_allownil)} + if FuncLoadError then + AFailed.Add('OBJ_length'); + {$ifend} + end; + + {introduced 1.1.0} + OBJ_get0_data := LoadLibFunction(ADllHandle, OBJ_get0_data_procname); + FuncLoadError := not assigned(OBJ_get0_data); + if FuncLoadError then + begin + {$if not defined(OBJ_get0_data_allownil)} + OBJ_get0_data := @ERR_OBJ_get0_data; + {$ifend} + {$if declared(OBJ_get0_data_introduced)} + if LibVersion < OBJ_get0_data_introduced then + begin + {$if declared(FC_OBJ_get0_data)} + OBJ_get0_data := @FC_OBJ_get0_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OBJ_get0_data_removed)} + if OBJ_get0_data_removed <= LibVersion then + begin + {$if declared(_OBJ_get0_data)} + OBJ_get0_data := @_OBJ_get0_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OBJ_get0_data_allownil)} + if FuncLoadError then + AFailed.Add('OBJ_get0_data'); + {$ifend} + end; + + {introduced 1.1.0} + OBJ_find_sigid_algs := LoadLibFunction(ADllHandle, OBJ_find_sigid_algs_procname); + FuncLoadError := not assigned(OBJ_find_sigid_algs); + if FuncLoadError then + begin + {$if not defined(OBJ_find_sigid_algs_allownil)} + OBJ_find_sigid_algs := @ERR_OBJ_find_sigid_algs; + {$ifend} + {$if declared(OBJ_find_sigid_algs_introduced)} + if LibVersion < OBJ_find_sigid_algs_introduced then + begin + {$if declared(FC_OBJ_find_sigid_algs)} + OBJ_find_sigid_algs := @FC_OBJ_find_sigid_algs; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OBJ_find_sigid_algs_removed)} + if OBJ_find_sigid_algs_removed <= LibVersion then + begin + {$if declared(_OBJ_find_sigid_algs)} + OBJ_find_sigid_algs := @_OBJ_find_sigid_algs; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OBJ_find_sigid_algs_allownil)} + if FuncLoadError then + AFailed.Add('OBJ_find_sigid_algs'); + {$ifend} + end; + + + OBJ_find_sigid_by_algs := LoadLibFunction(ADllHandle, OBJ_find_sigid_by_algs_procname); + FuncLoadError := not assigned(OBJ_find_sigid_by_algs); + if FuncLoadError then + begin + {$if not defined(OBJ_find_sigid_by_algs_allownil)} + OBJ_find_sigid_by_algs := @ERR_OBJ_find_sigid_by_algs; + {$ifend} + {$if declared(OBJ_find_sigid_by_algs_introduced)} + if LibVersion < OBJ_find_sigid_by_algs_introduced then + begin + {$if declared(FC_OBJ_find_sigid_by_algs)} + OBJ_find_sigid_by_algs := @FC_OBJ_find_sigid_by_algs; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OBJ_find_sigid_by_algs_removed)} + if OBJ_find_sigid_by_algs_removed <= LibVersion then + begin + {$if declared(_OBJ_find_sigid_by_algs)} + OBJ_find_sigid_by_algs := @_OBJ_find_sigid_by_algs; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OBJ_find_sigid_by_algs_allownil)} + if FuncLoadError then + AFailed.Add('OBJ_find_sigid_by_algs'); + {$ifend} + end; + + + OBJ_add_sigid := LoadLibFunction(ADllHandle, OBJ_add_sigid_procname); + FuncLoadError := not assigned(OBJ_add_sigid); + if FuncLoadError then + begin + {$if not defined(OBJ_add_sigid_allownil)} + OBJ_add_sigid := @ERR_OBJ_add_sigid; + {$ifend} + {$if declared(OBJ_add_sigid_introduced)} + if LibVersion < OBJ_add_sigid_introduced then + begin + {$if declared(FC_OBJ_add_sigid)} + OBJ_add_sigid := @FC_OBJ_add_sigid; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OBJ_add_sigid_removed)} + if OBJ_add_sigid_removed <= LibVersion then + begin + {$if declared(_OBJ_add_sigid)} + OBJ_add_sigid := @_OBJ_add_sigid; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OBJ_add_sigid_allownil)} + if FuncLoadError then + AFailed.Add('OBJ_add_sigid'); + {$ifend} + end; + + + OBJ_sigid_free := LoadLibFunction(ADllHandle, OBJ_sigid_free_procname); + FuncLoadError := not assigned(OBJ_sigid_free); + if FuncLoadError then + begin + {$if not defined(OBJ_sigid_free_allownil)} + OBJ_sigid_free := @ERR_OBJ_sigid_free; + {$ifend} + {$if declared(OBJ_sigid_free_introduced)} + if LibVersion < OBJ_sigid_free_introduced then + begin + {$if declared(FC_OBJ_sigid_free)} + OBJ_sigid_free := @FC_OBJ_sigid_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OBJ_sigid_free_removed)} + if OBJ_sigid_free_removed <= LibVersion then + begin + {$if declared(_OBJ_sigid_free)} + OBJ_sigid_free := @_OBJ_sigid_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OBJ_sigid_free_allownil)} + if FuncLoadError then + AFailed.Add('OBJ_sigid_free'); + {$ifend} + end; + + +end; + +procedure Unload; +begin + OBJ_NAME_init := nil; + OBJ_NAME_get := nil; + OBJ_NAME_add := nil; + OBJ_NAME_remove := nil; + OBJ_NAME_cleanup := nil; + OBJ_dup := nil; + OBJ_nid2obj := nil; + OBJ_nid2ln := nil; + OBJ_nid2sn := nil; + OBJ_obj2nid := nil; + OBJ_txt2obj := nil; + OBJ_obj2txt := nil; + OBJ_txt2nid := nil; + OBJ_ln2nid := nil; + OBJ_sn2nid := nil; + OBJ_cmp := nil; + OBJ_new_nid := nil; + OBJ_add_object := nil; + OBJ_create := nil; + OBJ_create_objects := nil; + OBJ_length := nil; {introduced 1.1.0} + OBJ_get0_data := nil; {introduced 1.1.0} + OBJ_find_sigid_algs := nil; + OBJ_find_sigid_by_algs := nil; + OBJ_add_sigid := nil; + OBJ_sigid_free := nil; +end; +{$ELSE} +{$ENDIF} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +initialization + Register_SSLLoader(@Load,'LibCrypto'); + Register_SSLUnloader(@Unload); +{$ENDIF} +end. diff --git a/IdOpenSSLHeaders_objectserr.pas b/IdOpenSSLHeaders_objectserr.pas new file mode 100644 index 0000000..ae0388f --- /dev/null +++ b/IdOpenSSLHeaders_objectserr.pas @@ -0,0 +1,159 @@ + (* This unit was generated using the script genOpenSSLHdrs.sh from the source file IdOpenSSLHeaders_objectserr.h2pas + It should not be modified directly. All changes should be made to IdOpenSSLHeaders_objectserr.h2pas + and this file regenerated. IdOpenSSLHeaders_objectserr.h2pas is distributed with the full Indy + Distribution. + *) + +{$i IdCompilerDefines.inc} +{$i IdSSLOpenSSLDefines.inc} +{$IFNDEF USE_OPENSSL} + { error Should not compile if USE_OPENSSL is not defined!!!} +{$ENDIF} +{******************************************************************************} +{ } +{ Indy (Internet Direct) - Internet Protocols Simplified } +{ } +{ https://www.indyproject.org/ } +{ https://gitter.im/IndySockets/Indy } +{ } +{******************************************************************************} +{ } +{ This file is part of the Indy (Internet Direct) project, and is offered } +{ under the dual-licensing agreement described on the Indy website. } +{ (https://www.indyproject.org/license/) } +{ } +{ Copyright: } +{ (c) 1993-2020, Chad Z. Hower and the Indy Pit Crew. All rights reserved. } +{ } +{******************************************************************************} +{ } +{ } +{******************************************************************************} + +unit IdOpenSSLHeaders_objectserr; + +interface + +// Headers for OpenSSL 1.1.1 +// objectserr.h + + +uses + IdCTypes, + IdGlobal, + IdSSLOpenSSLConsts; + +const + (* + * OBJ function codes. + *) + OBJ_F_OBJ_ADD_OBJECT = 105; + OBJ_F_OBJ_ADD_SIGID = 107; + OBJ_F_OBJ_CREATE = 100; + OBJ_F_OBJ_DUP = 101; + OBJ_F_OBJ_NAME_NEW_INDEX = 106; + OBJ_F_OBJ_NID2LN = 102; + OBJ_F_OBJ_NID2OBJ = 103; + OBJ_F_OBJ_NID2SN = 104; + OBJ_F_OBJ_TXT2OBJ = 108; + + (* + * OBJ reason codes. + *) + OBJ_R_OID_EXISTS = 102; + OBJ_R_UNKNOWN_NID = 101; + + { The EXTERNALSYM directive is ignored by FPC, however, it is used by Delphi as follows: + + The EXTERNALSYM directive prevents the specified Delphi symbol from appearing in header + files generated for C++. } + + {$EXTERNALSYM ERR_load_OBJ_strings} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +var + ERR_load_OBJ_strings: function : TIdC_INT; cdecl = nil; + +{$ELSE} + function ERR_load_OBJ_strings: TIdC_INT cdecl; external CLibCrypto; + +{$ENDIF} + +implementation + + uses + classes, + IdSSLOpenSSLExceptionHandlers, + IdResourceStringsOpenSSL + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + ,IdSSLOpenSSLLoader + {$ENDIF}; + + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +const + ERR_load_OBJ_strings_procname = 'ERR_load_OBJ_strings'; + + +{$WARN NO_RETVAL OFF} +function ERR_ERR_load_OBJ_strings: TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ERR_load_OBJ_strings_procname); +end; + + + +{$WARN NO_RETVAL ON} + +procedure Load(const ADllHandle: TIdLibHandle; LibVersion: TIdC_UINT; const AFailed: TStringList); + +var FuncLoadError: boolean; + +begin + ERR_load_OBJ_strings := LoadLibFunction(ADllHandle, ERR_load_OBJ_strings_procname); + FuncLoadError := not assigned(ERR_load_OBJ_strings); + if FuncLoadError then + begin + {$if not defined(ERR_load_OBJ_strings_allownil)} + ERR_load_OBJ_strings := @ERR_ERR_load_OBJ_strings; + {$ifend} + {$if declared(ERR_load_OBJ_strings_introduced)} + if LibVersion < ERR_load_OBJ_strings_introduced then + begin + {$if declared(FC_ERR_load_OBJ_strings)} + ERR_load_OBJ_strings := @FC_ERR_load_OBJ_strings; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ERR_load_OBJ_strings_removed)} + if ERR_load_OBJ_strings_removed <= LibVersion then + begin + {$if declared(_ERR_load_OBJ_strings)} + ERR_load_OBJ_strings := @_ERR_load_OBJ_strings; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ERR_load_OBJ_strings_allownil)} + if FuncLoadError then + AFailed.Add('ERR_load_OBJ_strings'); + {$ifend} + end; + + +end; + +procedure Unload; +begin + ERR_load_OBJ_strings := nil; +end; +{$ELSE} +{$ENDIF} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +initialization + Register_SSLLoader(@Load,'LibCrypto'); + Register_SSLUnloader(@Unload); +{$ENDIF} +end. diff --git a/IdOpenSSLHeaders_ocsperr.pas b/IdOpenSSLHeaders_ocsperr.pas new file mode 100644 index 0000000..815028a --- /dev/null +++ b/IdOpenSSLHeaders_ocsperr.pas @@ -0,0 +1,190 @@ + (* This unit was generated using the script genOpenSSLHdrs.sh from the source file IdOpenSSLHeaders_ocsperr.h2pas + It should not be modified directly. All changes should be made to IdOpenSSLHeaders_ocsperr.h2pas + and this file regenerated. IdOpenSSLHeaders_ocsperr.h2pas is distributed with the full Indy + Distribution. + *) + +{$i IdCompilerDefines.inc} +{$i IdSSLOpenSSLDefines.inc} +{$IFNDEF USE_OPENSSL} + { error Should not compile if USE_OPENSSL is not defined!!!} +{$ENDIF} +{******************************************************************************} +{ } +{ Indy (Internet Direct) - Internet Protocols Simplified } +{ } +{ https://www.indyproject.org/ } +{ https://gitter.im/IndySockets/Indy } +{ } +{******************************************************************************} +{ } +{ This file is part of the Indy (Internet Direct) project, and is offered } +{ under the dual-licensing agreement described on the Indy website. } +{ (https://www.indyproject.org/license/) } +{ } +{ Copyright: } +{ (c) 1993-2020, Chad Z. Hower and the Indy Pit Crew. All rights reserved. } +{ } +{******************************************************************************} +{ } +{ } +{******************************************************************************} + +unit IdOpenSSLHeaders_ocsperr; + +interface + +// Headers for OpenSSL 1.1.1 +// ocsperr.h + + +uses + IdCTypes, + IdGlobal, + IdSSLOpenSSLConsts; + +const + (* + * OCSP function codes. + *) + OCSP_F_D2I_OCSP_NONCE = 102; + OCSP_F_OCSP_BASIC_ADD1_STATUS = 103; + OCSP_F_OCSP_BASIC_SIGN = 104; + OCSP_F_OCSP_BASIC_SIGN_CTX = 119; + OCSP_F_OCSP_BASIC_VERIFY = 105; + OCSP_F_OCSP_CERT_ID_NEW = 101; + OCSP_F_OCSP_CHECK_DELEGATED = 106; + OCSP_F_OCSP_CHECK_IDS = 107; + OCSP_F_OCSP_CHECK_ISSUER = 108; + OCSP_F_OCSP_CHECK_VALIDITY = 115; + OCSP_F_OCSP_MATCH_ISSUERID = 109; + OCSP_F_OCSP_PARSE_URL = 114; + OCSP_F_OCSP_REQUEST_SIGN = 110; + OCSP_F_OCSP_REQUEST_VERIFY = 116; + OCSP_F_OCSP_RESPONSE_GET1_BASIC = 111; + OCSP_F_PARSE_HTTP_LINE1 = 118; + + (* + * OCSP reason codes. + *) + OCSP_R_CERTIFICATE_VERIFY_ERROR = 101; + OCSP_R_DIGEST_ERR = 102; + OCSP_R_ERROR_IN_NEXTUPDATE_FIELD = 122; + OCSP_R_ERROR_IN_THISUPDATE_FIELD = 123; + OCSP_R_ERROR_PARSING_URL = 121; + OCSP_R_MISSING_OCSPSIGNING_USAGE = 103; + OCSP_R_NEXTUPDATE_BEFORE_THISUPDATE = 124; + OCSP_R_NOT_BASIC_RESPONSE = 104; + OCSP_R_NO_CERTIFICATES_IN_CHAIN = 105; + OCSP_R_NO_RESPONSE_DATA = 108; + OCSP_R_NO_REVOKED_TIME = 109; + OCSP_R_NO_SIGNER_KEY = 130; + OCSP_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE = 110; + OCSP_R_REQUEST_NOT_SIGNED = 128; + OCSP_R_RESPONSE_CONTAINS_NO_REVOCATION_DATA = 111; + OCSP_R_ROOT_CA_NOT_TRUSTED = 112; + OCSP_R_SERVER_RESPONSE_ERROR = 114; + OCSP_R_SERVER_RESPONSE_PARSE_ERROR = 115; + OCSP_R_SIGNATURE_FAILURE = 117; + OCSP_R_SIGNER_CERTIFICATE_NOT_FOUND = 118; + OCSP_R_STATUS_EXPIRED = 125; + OCSP_R_STATUS_NOT_YET_VALID = 126; + OCSP_R_STATUS_TOO_OLD = 127; + OCSP_R_UNKNOWN_MESSAGE_DIGEST = 119; + OCSP_R_UNKNOWN_NID = 120; + OCSP_R_UNSUPPORTED_REQUESTORNAME_TYPE = 129; + + { The EXTERNALSYM directive is ignored by FPC, however, it is used by Delphi as follows: + + The EXTERNALSYM directive prevents the specified Delphi symbol from appearing in header + files generated for C++. } + + {$EXTERNALSYM ERR_load_OCSP_strings} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +var + ERR_load_OCSP_strings: function : TIdC_INT; cdecl = nil; + +{$ELSE} + function ERR_load_OCSP_strings: TIdC_INT cdecl; external CLibCrypto; + +{$ENDIF} + +implementation + + uses + classes, + IdSSLOpenSSLExceptionHandlers, + IdResourceStringsOpenSSL + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + ,IdSSLOpenSSLLoader + {$ENDIF}; + + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +const + ERR_load_OCSP_strings_procname = 'ERR_load_OCSP_strings'; + + +{$WARN NO_RETVAL OFF} +function ERR_ERR_load_OCSP_strings: TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ERR_load_OCSP_strings_procname); +end; + + + +{$WARN NO_RETVAL ON} + +procedure Load(const ADllHandle: TIdLibHandle; LibVersion: TIdC_UINT; const AFailed: TStringList); + +var FuncLoadError: boolean; + +begin + ERR_load_OCSP_strings := LoadLibFunction(ADllHandle, ERR_load_OCSP_strings_procname); + FuncLoadError := not assigned(ERR_load_OCSP_strings); + if FuncLoadError then + begin + {$if not defined(ERR_load_OCSP_strings_allownil)} + ERR_load_OCSP_strings := @ERR_ERR_load_OCSP_strings; + {$ifend} + {$if declared(ERR_load_OCSP_strings_introduced)} + if LibVersion < ERR_load_OCSP_strings_introduced then + begin + {$if declared(FC_ERR_load_OCSP_strings)} + ERR_load_OCSP_strings := @FC_ERR_load_OCSP_strings; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ERR_load_OCSP_strings_removed)} + if ERR_load_OCSP_strings_removed <= LibVersion then + begin + {$if declared(_ERR_load_OCSP_strings)} + ERR_load_OCSP_strings := @_ERR_load_OCSP_strings; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ERR_load_OCSP_strings_allownil)} + if FuncLoadError then + AFailed.Add('ERR_load_OCSP_strings'); + {$ifend} + end; + + +end; + +procedure Unload; +begin + ERR_load_OCSP_strings := nil; +end; +{$ELSE} +{$ENDIF} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +initialization + Register_SSLLoader(@Load,'LibCrypto'); + Register_SSLUnloader(@Unload); +{$ENDIF} +end. diff --git a/IdOpenSSLHeaders_ossl_typ.pas b/IdOpenSSLHeaders_ossl_typ.pas new file mode 100644 index 0000000..4fe0d61 --- /dev/null +++ b/IdOpenSSLHeaders_ossl_typ.pas @@ -0,0 +1,547 @@ + (* This unit was generated using the script genOpenSSLHdrs.sh from the source file IdOpenSSLHeaders_ossl_typ.h2pas + It should not be modified directly. All changes should be made to IdOpenSSLHeaders_ossl_typ.h2pas + and this file regenerated. IdOpenSSLHeaders_ossl_typ.h2pas is distributed with the full Indy + Distribution. + *) + +{$i IdCompilerDefines.inc} +{$i IdSSLOpenSSLDefines.inc} +{$IFNDEF USE_OPENSSL} + { error Should not compile if USE_OPENSSL is not defined!!!} +{$ENDIF} +{******************************************************************************} +{ } +{ Indy (Internet Direct) - Internet Protocols Simplified } +{ } +{ https://www.indyproject.org/ } +{ https://gitter.im/IndySockets/Indy } +{ } +{******************************************************************************} +{ } +{ This file is part of the Indy (Internet Direct) project, and is offered } +{ under the dual-licensing agreement described on the Indy website. } +{ (https://www.indyproject.org/license/) } +{ } +{ Copyright: } +{ (c) 1993-2020, Chad Z. Hower and the Indy Pit Crew. All rights reserved. } +{ } +{******************************************************************************} +{ } +{ } +{******************************************************************************} + +unit IdOpenSSLHeaders_ossl_typ; + +interface + +// Headers for OpenSSL 1.1.1 +// ossl_typ.h + + +uses + IdCTypes, + IdGlobal, + IdSSLOpenSSLConsts; + +type +// moved from unit "asn1" to prevent circular references + asn1_string_st = record + length: TIdC_INT; + type_: TIdC_INT; + data: PByte; + (* + * The value of the following field depends on the type being held. It + * is mostly being used for BIT_STRING so if the input data has a + * non-zero 'unused bits' value, it will be handled correctly + *) + flags: TIdC_LONG; + end; + + // moved from asn1 + ASN1_VALUE_st = type Pointer; + ASN1_VALUE = ASN1_VALUE_st; + PASN1_VALUE = ^ASN1_VALUE; + PPASN1_VALUE = ^PASN1_VALUE; + + // moved from e_os2 + ossl_ssize_t = type {$IFDEF WIN64}TIdC_INT64{$ELSE}TIdC_INT{$ENDIF}; + + asn1_object_st = type Pointer; + ASN1_OBJECT = asn1_object_st; + PASN1_OBJECT = ^ASN1_OBJECT; + PPASN1_OBJECT = ^PASN1_OBJECT; + + ASN1_INTEGER = type asn1_string_st; + PASN1_INTEGER = ^ASN1_INTEGER; + PPASN1_INTEGER = ^PASN1_INTEGER; + + ASN1_ENUMERATED = type asn1_string_st; + PASN1_ENUMERATED = ^ASN1_ENUMERATED; + + ASN1_BIT_STRING = type asn1_string_st; + PASN1_BIT_STRING = ^ASN1_BIT_STRING; + PPASN1_BIT_STRING = ^PASN1_BIT_STRING; + + ASN1_OCTET_STRING = type asn1_string_st; + PASN1_OCTET_STRING = ^ASN1_OCTET_STRING; + PPASN1_OCTET_STRING = ^PASN1_OCTET_STRING; + + ASN1_PRINTABLESTRING = type asn1_string_st; + PASN1_PRINTABLESTRING = ^ASN1_PRINTABLESTRING; + + ASN1_T61STRING = type asn1_string_st; + PASN1_T61STRING = ^ASN1_T61STRING; + + ASN1_IA5STRING = type asn1_string_st; + PASN1_IA5STRING = ^ASN1_IA5STRING; + + ASN1_GENERALSTRING = type asn1_string_st; + PASN1_GENERALSTRING = ^ASN1_GENERALSTRING; + + ASN1_UNIVERSALSTRING = type asn1_string_st; + PASN1_UNIVERSALSTRING = ^ASN1_UNIVERSALSTRING; + + ASN1_BMPSTRING = type asn1_string_st; + PASN1_BMPSTRING = ^ASN1_BMPSTRING; + + ASN1_UTCTIME = type asn1_string_st; + PASN1_UTCTIME = ^ASN1_UTCTIME; + PPASN1_UTCTIME = ^PASN1_UTCTIME; + + ASN1_TIME = type asn1_string_st; + PASN1_TIME = ^ASN1_TIME; + PPASN1_TIME = ^PASN1_TIME; + + ASN1_GENERALIZEDTIME = type asn1_string_st; + PASN1_GENERALIZEDTIME = ^ASN1_GENERALIZEDTIME; + PPASN1_GENERALIZEDTIME = ^PASN1_GENERALIZEDTIME; + + ASN1_VISIBLESTRING = type asn1_string_st; + PASN1_VISIBLESTRING = ^ASN1_VISIBLESTRING; + + ASN1_UTF8STRING = type asn1_string_st; + PASN1_UTF8STRING = ^ASN1_UTF8STRING; + + ASN1_STRING = type asn1_string_st; + PASN1_STRING = ^ASN1_STRING; + PPASN1_STRING = ^PASN1_STRING; + + ASN1_BOOLEAN = type TIdC_INT; + PASN1_BOOLEAN = ^ASN1_BOOLEAN; + + ASN1_NULL = type TIdC_INT; + PASN1_NULL = ^ASN1_NULL; + + + ASN1_ITEM_st = type Pointer; + ASN1_ITEM = ASN1_ITEM_st; + PASN1_ITEM = ^ASN1_ITEM; + + asn1_pctx_st = type Pointer; + ASN1_PCTX = asn1_pctx_st; + PASN1_PCTX = ^ASN1_PCTX; + + asn1_sctx_st = type Pointer; + ASN1_SCTX = asn1_sctx_st; + PASN1_SCTX = ^ASN1_SCTX; + + dane_st = type Pointer; + bio_st = type Pointer; + BIO = bio_st; + PBIO = ^BIO; + PPBIO = ^PBIO; + bignum_st = type Pointer; + BIGNUM = bignum_st; + PBIGNUM = ^BIGNUM; + PPBIGNUM = ^PBIGNUM; + bignum_ctx = type Pointer; + BN_CTX = bignum_ctx; + PBN_CTX = ^BN_CTX; + bn_blinding_st = type Pointer; + BN_BLINDING = bn_blinding_st; + PBN_BLINDING = ^BN_BLINDING; + bn_mont_ctx_st = type Pointer; + BN_MONT_CTX = bn_mont_ctx_st; + PBN_MONT_CTX = ^BN_MONT_CTX; + bn_recp_ctx_st = type Pointer; + BN_RECP_CTX = bn_recp_ctx_st; + PBN_RECP_CTX = ^BN_RECP_CTX; + bn_gencb_st = type Pointer; + BN_GENCB = bn_gencb_st; + PBN_GENCB = ^BN_GENCB; + + buf_mem_st = type Pointer; + BUF_MEM = buf_mem_st; + PBUF_MEM = ^BUF_MEM; + + evp_cipher_st = type Pointer; + EVP_CIPHER = evp_cipher_st; + PEVP_CIPHER = ^EVP_CIPHER; + PPEVP_CIPHER = ^PEVP_CIPHER; + evp_cipher_ctx_st = type Pointer; + EVP_CIPHER_CTX = evp_cipher_ctx_st; + PEVP_CIPHER_CTX = ^EVP_CIPHER_CTX; + evp_md_st = type Pointer; + EVP_MD = evp_md_st; + PEVP_MD = ^EVP_MD; + PPEVP_MD = ^PEVP_MD; + evp_md_ctx_st = type Pointer; + EVP_MD_CTX = evp_md_ctx_st; + PEVP_MD_CTX = ^EVP_MD_CTX; + evp_pkey_st = type Pointer; + EVP_PKEY = evp_pkey_st; + PEVP_PKEY = ^EVP_PKEY; + PPEVP_PKEY = ^PEVP_PKEY; + + evp_pkey_asn1_method_st = type Pointer; + EVP_PKEY_ASN1_METHOD = evp_pkey_asn1_method_st; + PEVP_PKEY_ASN1_METHOD = ^EVP_PKEY_ASN1_METHOD; + PPEVP_PKEY_ASN1_METHOD = ^PEVP_PKEY_ASN1_METHOD; + + evp_pkey_method_st = type Pointer; + EVP_PKEY_METHOD = evp_pkey_method_st; + PEVP_PKEY_METHOD = ^EVP_PKEY_METHOD; + PPEVP_PKEY_METHOD = ^PEVP_PKEY_METHOD; + evp_pkey_ctx_st = type Pointer; + EVP_PKEY_CTX = evp_pkey_ctx_st; + PEVP_PKEY_CTX = ^EVP_PKEY_CTX; + PPEVP_PKEY_CTX = ^PEVP_PKEY_CTX; + + evp_Encode_Ctx_st = type Pointer; + EVP_ENCODE_CTX = evp_Encode_Ctx_st; + PEVP_ENCODE_CTX = ^EVP_ENCODE_CTX; + + hmac_ctx_st = type Pointer; + HMAC_CTX = hmac_ctx_st; + PHMAC_CTX = ^HMAC_CTX; + + dh_st = type Pointer; + DH = dh_st; + PDH = ^DH; + PPDH = ^PDH; + dh_method_st = type Pointer; + DH_METHOD = dh_method_st; + PDH_METHOD = ^DH_METHOD; + + dsa_st = type Pointer; + DSA = dsa_st; + PDSA = ^DSA; + PPDSA = ^PDSA; + dsa_method_st = type Pointer; + DSA_METHOD = dsa_method_st; + PDSA_METHOD = ^DSA_METHOD; + + rsa_st = type Pointer; + RSA = rsa_st; + PRSA = ^RSA; + PPRSA = ^PRSA; + rsa_meth_st = type Pointer; + RSA_METHOD = rsa_meth_st; + PRSA_METHOD = ^RSA_METHOD; + + ec_key_st = type Pointer; + EC_KEY = ec_key_st; + PEC_KEY = ^EC_KEY; + PPEC_KEY = ^PEC_KEY; + ec_key_method_st = type Pointer; + EC_KEY_METHOD = ec_key_method_st; + PEC_KEY_METHOD = ^EC_KEY_METHOD; + + rand_meth_st = type Pointer; + RAND_METHOD = rand_meth_st; + PRAND_METHOD = ^RAND_METHOD; + rand_drbg_st = type Pointer; + RAND_DRBG = rand_drbg_st; + PRAND_DRBG = ^RAND_DRBG; + + ssl_dane_st = type Pointer; + SSL_DANE = ssl_dane_st; + PSSL_DANE = ^SSL_DANE; + x509_st = type Pointer; + X509 = x509_st; + PX509 = ^X509; + PPX509 = ^PX509; + Stack_Of_X509 = type Pointer; + PStack_Of_X509 = ^Stack_Of_X509; + PPStack_Of_X509 = ^PStack_Of_X509; + X509_crl_st = type Pointer; + X509_CRL = X509_crl_st; + PX509_CRL = ^X509_CRL; + PPX509_CRL = ^PX509_CRL; + x509_crl_method_st = type Pointer; + X509_CRL_METHOD = x509_crl_method_st; + PX509_CRL_METHOD = ^X509_CRL_METHOD; + x509_revoked_st = type Pointer; + X509_REVOKED = x509_revoked_st; + PX509_REVOKED = ^X509_REVOKED; + PPX509_REVOKED = ^PX509_REVOKED; + X509_name_st = type Pointer; + X509_NAME = X509_name_st; + PX509_NAME = ^X509_NAME; + PPX509_NAME = ^PX509_NAME; + X509_pubkey_st = type Pointer; + X509_PUBKEY = X509_pubkey_st; + PX509_PUBKEY = ^X509_PUBKEY; + PPX509_PUBKEY = ^PX509_PUBKEY; + x509_store_st = type Pointer; + X509_STORE = x509_store_st; + PX509_STORE = ^X509_STORE; + x509_store_ctx_st = type Pointer; + X509_STORE_CTX = x509_store_ctx_st; + PX509_STORE_CTX = ^X509_STORE_CTX; + + x509_object_st = type Pointer; + X509_OBJECT = x509_object_st; + PX509_OBJECT = ^X509_OBJECT; + x509_lookup_st = type Pointer; + X509_LOOKUP = x509_lookup_st; + PX509_LOOKUP = ^X509_LOOKUP; + x509_lookup_method_st = type Pointer; + X509_LOOKUP_METHOD = x509_lookup_method_st; + PX509_LOOKUP_METHOD = ^X509_LOOKUP_METHOD; + X509_VERIFY_PARAM_st = type Pointer; + X509_VERIFY_PARAM = X509_VERIFY_PARAM_st; + PX509_VERIFY_PARAM = ^X509_VERIFY_PARAM; + + x509_sig_info_st = type Pointer; + X509_SIG_INFO = x509_sig_info_st; + PX509_SIG_INFO = ^X509_SIG_INFO; + + pkcs8_priv_key_info_st = type Pointer; + PKCS8_PRIV_KEY_INFO = pkcs8_priv_key_info_st; + PPKCS8_PRIV_KEY_INFO = ^PKCS8_PRIV_KEY_INFO; + PPPKCS8_PRIV_KEY_INFO = ^PPKCS8_PRIV_KEY_INFO; + +// moved from x509 to prevent circular references + X509_REQ = type Pointer; // X509_req_st + PX509_REQ = ^X509_REQ; + PPX509_REQ = ^PX509_REQ; + +// moved from x509v3 to prevent circular references + (* Context specific info *) + v3_ext_ctx = record + flags: TIdC_INT; + issuer_cert: PX509; + subject_cert: PX509; + subject_req: PX509_REQ; + crl: PX509_CRL; + db_meth: Pointer; //PX509V3_CONF_METHOD; + db: Pointer; + (* Maybe more here *) + end; +// v3_ext_ctx = type Pointer; + X509V3_CTX = v3_ext_ctx; + PX509V3_CTX = ^X509V3_CTX; + conf_st = type Pointer; + CONF = conf_st; + PCONF = ^CONF; + ossl_init_settings_st = type Pointer; + OPENSSL_INIT_SETTINGS = ossl_init_settings_st; + POPENSSL_INIT_SETTINGS = ^OPENSSL_INIT_SETTINGS; + + ui_st = type Pointer; + UI = ui_st; + PUI = ^UI; + ui_method_st = type Pointer; + UI_METHOD = ui_method_st; + PUI_METHOD = ^UI_METHOD; + + engine_st = type Pointer; + ENGINE = engine_st; + PENGINE = ^ENGINE; + PPENGINE = ^PENGINE; + ssl_st = type Pointer; + SSL = ssl_st; + PSSL = ^SSL; + ssl_ctx_st = type Pointer; + SSL_CTX = ssl_ctx_st; + PSSL_CTX = ^SSL_CTX; + PPSSL_CTX = ^PSSL_CTX; + + comp_ctx_st = type Pointer; + COMP_CTX = comp_ctx_st; + PCOMP_CTX = ^COMP_CTX; + comp_method_st = type Pointer; + COMP_METHOD = comp_method_st; + PCOMP_METHOD = ^COMP_METHOD; + + X509_POLICY_NODE_st = type Pointer; + X509_POLICY_NODE = X509_POLICY_NODE_st; + PX509_POLICY_NODE = ^X509_POLICY_NODE; + X509_POLICY_LEVEL_st = type Pointer; + X509_POLICY_LEVEL = X509_POLICY_LEVEL_st; + PX509_POLICY_LEVEL = ^X509_POLICY_LEVEL; + X509_POLICY_TREE_st = type Pointer; + X509_POLICY_TREE = X509_POLICY_TREE_st; + PX509_POLICY_TREE = ^X509_POLICY_TREE; + X509_POLICY_CACHE_st = type Pointer; + X509_POLICY_CACHE = X509_POLICY_CACHE_st; + PX509_POLICY_CACHE = ^X509_POLICY_CACHE; + + AUTHORITY_KEYID_st = type Pointer; + AUTHORITY_KEYID = AUTHORITY_KEYID_st; + PAUTHORITY_KEYID = ^AUTHORITY_KEYID; + DIST_POINT_st = type Pointer; + DIST_POINT = DIST_POINT_st; + PDIST_POINT = ^DIST_POINT; + ISSUING_DIST_POINT_st = type Pointer; + ISSUING_DIST_POINT = ISSUING_DIST_POINT_st; + PISSUING_DIST_POINT = ^ISSUING_DIST_POINT; + NAME_CONSTRAINTS_st = type Pointer; + NAME_CONSTRAINTS = NAME_CONSTRAINTS_st; + PNAME_CONSTRAINTS = ^NAME_CONSTRAINTS; + + crypto_ex_data_st = type Pointer; + CRYPTO_EX_DATA = crypto_ex_data_st; + PCRYPTO_EX_DATA = ^CRYPTO_EX_DATA; + + ocsp_req_ctx_st = type Pointer; + OCSP_REQ_CTX = ocsp_req_ctx_st; + POCSP_REQ_CTX = ^OCSP_REQ_CTX; + ocsp_response_st = type Pointer; + OCSP_RESPONSE = ocsp_response_st; + POCSP_RESPONSE = ^OCSP_RESPONSE; + ocsp_responder_id_st = type Pointer; + OCSP_RESPID = ocsp_responder_id_st; + POCSP_RESPID = ^OCSP_RESPID; + + sct_st = type Pointer; + SCT = sct_st; + PSCT = ^SCT; + sct_ctx_st = type Pointer; + SCT_CTX = sct_ctx_st; + PSCT_CTX = ^SCT_CTX; + ctlog_st = type Pointer; + CTLOG = ctlog_st; + PCTLOG = ^CTLOG; + ctlog_store_st = type Pointer; + CTLOG_STORE = ctlog_store_st; + PCTLOG_STORE = ^CTLOG_STORE; + ct_policy_eval_ctx_st = type Pointer; + CT_POLICY_EVAL_CTX = ct_policy_eval_ctx_st; + PCT_POLICY_EVAL_CTX = ^CT_POLICY_EVAL_CTX; + + ossl_store_info_st = type Pointer; + OSSL_STORE_INFO = ossl_store_info_st; + POSSL_STORE_INFO = ^OSSL_STORE_INFO; + ossl_store_search_st = type Pointer; + OSSL_STORE_SEARCH = ossl_store_search_st; + POSSL_STORE_SEARCH = ^OSSL_STORE_SEARCH; + +// moved from unit "asn1" to prevent circular references' +const + V_ASN1_UNIVERSAL = $00; + V_ASN1_APPLICATION = $40; + V_ASN1_CONTEXT_SPECIFIC = $80; + V_ASN1_PRIVATE = $c0; + + V_ASN1_CONSTRUCTED = $20; + V_ASN1_PRIMITIVE_TAG = $1f; + V_ASN1_PRIMATIVE_TAG = V_ASN1_PRIMITIVE_TAG; + + V_ASN1_APP_CHOOSE = -2; (* let the recipient choose *) + V_ASN1_OTHER = -3; (* used in ASN1_TYPE *) + V_ASN1_ANY = -4; (* used in ASN1 template code *) + + V_ASN1_UNDEF = -1; + V_ASN1_EOC = 0; + V_ASN1_BOOLEAN = 1; + V_ASN1_INTEGER = 2; + V_ASN1_BIT_STRING = 3; + V_ASN1_OCTET_STRING = 4; + V_ASN1_NULL = 5; + V_ASN1_OBJECT = 6; + V_ASN1_OBJECT_DESCRIPTOR = 7; + V_ASN1_EXTERNAL = 8; + V_ASN1_REAL = 9; + V_ASN1_ENUMERATED = 10; + V_ASN1_UTF8STRING = 12; + V_ASN1_SEQUENCE = 16; + V_ASN1_SET = 17; + V_ASN1_NUMERICSTRING = 18; + V_ASN1_PRINTABLESTRING = 19; + V_ASN1_T61STRING = 20; + V_ASN1_TELETEXSTRING = 20; + V_ASN1_VIDEOTEXSTRING = 21; + V_ASN1_IA5STRING = 22; + V_ASN1_UTCTIME = 23; + V_ASN1_GENERALIZEDTIME = 24; + V_ASN1_GRAPHICSTRING = 25; + V_ASN1_ISO64STRING = 26; + V_ASN1_VISIBLESTRING = 26; + V_ASN1_GENERALSTRING = 27; + V_ASN1_UNIVERSALSTRING = 28; + V_ASN1_BMPSTRING = 30; + +type + asn1_type_st = record + case type_: TIdC_INT of +// (ptr: PIdAnsichar); + V_ASN1_BOOLEAN: (boolean: ASN1_BOOLEAN); +// (asn1_string: PASN1_STRING); + V_ASN1_OBJECT: (object_: PASN1_OBJECT); + V_ASN1_INTEGER: (integer: PASN1_INTEGER); + V_ASN1_ENUMERATED: (enumerated: PASN1_ENUMERATED); + V_ASN1_BIT_STRING: (bit_string: PASN1_BIT_STRING); + V_ASN1_OCTET_STRING: (octet_string: PASN1_OCTET_STRING); + V_ASN1_PRINTABLESTRING: (printablestring: PASN1_PRINTABLESTRING); + V_ASN1_T61STRING: (t61string: PASN1_T61STRING); + V_ASN1_IA5STRING: (ia5string: PASN1_IA5STRING); + V_ASN1_GENERALSTRING: (generalstring: PASN1_GENERALSTRING); + V_ASN1_BMPSTRING: (bmpstring: PASN1_BMPSTRING); + V_ASN1_UNIVERSALSTRING: (universalstring: PASN1_UNIVERSALSTRING); + V_ASN1_UTCTIME: (utctime: PASN1_UTCTIME); + V_ASN1_GENERALIZEDTIME: (generalizedtime: PASN1_GENERALIZEDTIME); + V_ASN1_VISIBLESTRING: (visiblestring: PASN1_VISIBLESTRING); + V_ASN1_UTF8STRING: (utf8string: PASN1_UTF8STRING); + (* + * set and sequence are left complete and still contain the set or + * sequence bytes + *) + V_ASN1_SET: (set_: PASN1_STRING); + V_ASN1_SEQUENCE: (sequence: PASN1_STRING); +// (asn1_value: PASN1_VALUE); + +// V_ASN1_UNDEF: ; +// V_ASN1_EOC: ; +// V_ASN1_NULL: ; +// V_ASN1_OBJECT_DESCRIPTOR: ; +// V_ASN1_EXTERNAL: ; +// V_ASN1_REAL: ; +// V_ASN1_NUMERICSTRING: ; +// V_ASN1_TELETEXSTRING: ; +// V_ASN1_VIDEOTEXSTRING: ; +// V_ASN1_GRAPHICSTRING: ; +// V_ASN1_ISO64STRING: ; + end; + ASN1_TYPE = asn1_type_st; + PASN1_TYPE = ^ASN1_TYPE; + PPASN1_TYPE = ^PASN1_TYPE; + +// moved from unit "x509" to prevent circular references + X509_algor_st = record + algorithm: PASN1_OBJECT; + parameter: PASN1_TYPE; + end; (* X509_ALGOR *) + + X509_ALGOR = X509_algor_st; + PX509_ALGOR = ^X509_ALGOR; + PPX509_ALGOR = ^PX509_ALGOR; + + i2d_of_void = type Pointer; + Pi2d_of_void = ^i2d_of_void; + + d2i_of_void = type Pointer; + Pd2i_of_void = ^d2i_of_void; + + {OSSL_LIB_CTX is defined in types.h from 3.0.0 onwards} + // typedef struct ossl_lib_ctx_st OSSL_LIB_CTX; + ossl_lib_ctx_st = record + end; + POSSL_LIB_CTX = ^OSSL_LIB_CTX; + OSSL_LIB_CTX = ossl_lib_ctx_st; + + +implementation + +end. diff --git a/IdOpenSSLHeaders_pem.pas b/IdOpenSSLHeaders_pem.pas new file mode 100644 index 0000000..d22bf34 --- /dev/null +++ b/IdOpenSSLHeaders_pem.pas @@ -0,0 +1,3479 @@ + (* This unit was generated using the script genOpenSSLHdrs.sh from the source file IdOpenSSLHeaders_pem.h2pas + It should not be modified directly. All changes should be made to IdOpenSSLHeaders_pem.h2pas + and this file regenerated. IdOpenSSLHeaders_pem.h2pas is distributed with the full Indy + Distribution. + *) + +{$i IdCompilerDefines.inc} +{$i IdSSLOpenSSLDefines.inc} +{$IFNDEF USE_OPENSSL} + { error Should not compile if USE_OPENSSL is not defined!!!} +{$ENDIF} +{******************************************************************************} +{ } +{ Indy (Internet Direct) - Internet Protocols Simplified } +{ } +{ https://www.indyproject.org/ } +{ https://gitter.im/IndySockets/Indy } +{ } +{******************************************************************************} +{ } +{ This file is part of the Indy (Internet Direct) project, and is offered } +{ under the dual-licensing agreement described on the Indy website. } +{ (https://www.indyproject.org/license/) } +{ } +{ Copyright: } +{ (c) 1993-2020, Chad Z. Hower and the Indy Pit Crew. All rights reserved. } +{ } +{******************************************************************************} +{ } +{ } +{******************************************************************************} + +unit IdOpenSSLHeaders_pem; + +interface + +// Headers for OpenSSL 1.1.1 +// pem.h + + +uses + IdCTypes, + IdGlobal, + IdSSLOpenSSLConsts, + IdOpenSSLHeaders_ec, + IdOpenSSLHeaders_ossl_typ, + IdOpenSSLHeaders_pkcs7, + IdOpenSSLHeaders_x509; + +type + EVP_CIPHER_INFO = type Pointer; + PEVP_CIPHER_INFO = ^EVP_CIPHER_INFO; + +const + PEM_BUFSIZE = 1024; + + PEM_STRING_X509_OLD = AnsiString('X509 CERTIFICATE'); + PEM_STRING_X509 = AnsiString('CERTIFICATE'); + PEM_STRING_X509_TRUSTED = AnsiString('TRUSTED CERTIFICATE'); + PEM_STRING_X509_REQ_OLD = AnsiString('NEW CERTIFICATE REQUEST'); + PEM_STRING_X509_REQ = AnsiString('CERTIFICATE REQUEST'); + PEM_STRING_X509_CRL = AnsiString('X509 CRL'); + PEM_STRING_EVP_PKEY = AnsiString('ANY PRIVATE KEY'); + PEM_STRING_PUBLIC = AnsiString('PUBLIC KEY'); + PEM_STRING_RSA = AnsiString('RSA PRIVATE KEY'); + PEM_STRING_RSA_PUBLIC = AnsiString('RSA PUBLIC KEY'); + PEM_STRING_DSA = AnsiString('DSA PRIVATE KEY'); + PEM_STRING_DSA_PUBLIC = AnsiString('DSA PUBLIC KEY'); + PEM_STRING_PKCS7 = AnsiString('PKCS7'); + PEM_STRING_PKCS7_SIGNED = AnsiString('PKCS #7 SIGNED DATA'); + PEM_STRING_PKCS8 = AnsiString('ENCRYPTED PRIVATE KEY'); + PEM_STRING_PKCS8INF = AnsiString('PRIVATE KEY'); + PEM_STRING_DHPARAMS = AnsiString('DH PARAMETERS'); + PEM_STRING_DHXPARAMS = AnsiString('X9.42 DH PARAMETERS'); + PEM_STRING_SSL_SESSION = AnsiString('SSL SESSION PARAMETERS'); + PEM_STRING_DSAPARAMS = AnsiString('DSA PARAMETERS'); + PEM_STRING_ECDSA_PUBLIC = AnsiString('ECDSA PUBLIC KEY'); + PEM_STRING_ECPARAMETERS = AnsiString('EC PARAMETERS'); + PEM_STRING_ECPRIVATEKEY = AnsiString('EC PRIVATE KEY'); + PEM_STRING_PARAMETERS = AnsiString('PARAMETERS'); + PEM_STRING_CMS = AnsiString('CMS'); + + PEM_TYPE_ENCRYPTED = 10; + PEM_TYPE_MIC_ONLY = 20; + PEM_TYPE_MIC_CLEAR = 30; + PEM_TYPE_CLEAR = 40; + + PEM_FLAG_SECURE = $1; + PEM_FLAG_EAY_COMPATIBLE = $2; + PEM_FLAG_ONLY_B64 = $4; + + {Reason Codes} + PEM_R_BAD_BASE64_DECODE = 100; + PEM_R_BAD_DECRYPT = 101; + PEM_R_BAD_END_LINE = 102; + PEM_R_BAD_IV_CHARS = 103; + PEM_R_BAD_MAGIC_NUMBER = 116; + PEM_R_BAD_PASSWORD_READ = 104; + PEM_R_BAD_VERSION_NUMBER = 117; + PEM_R_BIO_WRITE_FAILURE = 118; + PEM_R_CIPHER_IS_NULL = 127; + PEM_R_ERROR_CONVERTING_PRIVATE_KEY = 115; + PEM_R_EXPECTING_PRIVATE_KEY_BLOB = 119; + PEM_R_EXPECTING_PUBLIC_KEY_BLOB = 120; + PEM_R_HEADER_TOO_LONG = 128; + PEM_R_INCONSISTENT_HEADER = 121; + PEM_R_KEYBLOB_HEADER_PARSE_ERROR = 122; + PEM_R_KEYBLOB_TOO_SHORT = 123; + PEM_R_NOT_DEK_INFO = 105; + PEM_R_NOT_ENCRYPTED = 106; + PEM_R_NOT_PROC_TYPE = 107; + PEM_R_NO_START_LINE = 108; + PEM_R_PROBLEMS_GETTING_PASSWORD = 109; + PEM_R_PUBLIC_KEY_NO_RSA = 110; + PEM_R_PVK_DATA_TOO_SHORT = 124; + PEM_R_PVK_TOO_SHORT = 125; + PEM_R_READ_KEY = 111; + PEM_R_SHORT_HEADER = 112; + PEM_R_UNSUPPORTED_CIPHER = 113; + PEM_R_UNSUPPORTED_ENCRYPTION = 114; + +type + PSTACK_OF_X509_INFO = pointer; + pem_password_cb = function(buf: PIdAnsiChar; size: TIdC_INT; rwflag: TIdC_INT; userdata: Pointer): TIdC_INT; cdecl; + + { The EXTERNALSYM directive is ignored by FPC, however, it is used by Delphi as follows: + + The EXTERNALSYM directive prevents the specified Delphi symbol from appearing in header + files generated for C++. } + + {$EXTERNALSYM PEM_get_EVP_CIPHER_INFO} + {$EXTERNALSYM PEM_do_header} + {$EXTERNALSYM PEM_read_bio} + {$EXTERNALSYM PEM_read_bio_ex} {introduced 1.1.0} + {$EXTERNALSYM PEM_bytes_read_bio_secmem} {introduced 1.1.0} + {$EXTERNALSYM PEM_write_bio} + {$EXTERNALSYM PEM_bytes_read_bio} + {$EXTERNALSYM PEM_ASN1_read_bio} + {$EXTERNALSYM PEM_ASN1_write_bio} + {$EXTERNALSYM PEM_X509_INFO_read_bio} + {$EXTERNALSYM PEM_X509_INFO_write_bio} + {$EXTERNALSYM PEM_SignInit} + {$EXTERNALSYM PEM_SignUpdate} + {$EXTERNALSYM PEM_SignFinal} + {$EXTERNALSYM PEM_def_callback} + {$EXTERNALSYM PEM_proc_type} + {$EXTERNALSYM PEM_dek_info} + {$EXTERNALSYM PEM_read_bio_X509} + {$EXTERNALSYM PEM_write_bio_X509} + {$EXTERNALSYM PEM_read_bio_X509_AUX} + {$EXTERNALSYM PEM_write_bio_X509_AUX} + {$EXTERNALSYM PEM_read_bio_X509_REQ} + {$EXTERNALSYM PEM_write_bio_X509_REQ} + {$EXTERNALSYM PEM_write_bio_X509_REQ_NEW} + {$EXTERNALSYM PEM_read_bio_X509_CRL} + {$EXTERNALSYM PEM_write_bio_X509_CRL} + {$EXTERNALSYM PEM_read_bio_PKCS7} + {$EXTERNALSYM PEM_write_bio_PKCS7} + {$EXTERNALSYM PEM_read_bio_PKCS8} + {$EXTERNALSYM PEM_write_bio_PKCS8} + {$EXTERNALSYM PEM_read_bio_PKCS8_PRIV_KEY_INFO} + {$EXTERNALSYM PEM_write_bio_PKCS8_PRIV_KEY_INFO} + {$EXTERNALSYM PEM_read_bio_RSAPrivateKey} + {$EXTERNALSYM PEM_write_bio_RSAPrivateKey} + {$EXTERNALSYM PEM_read_bio_RSAPublicKey} + {$EXTERNALSYM PEM_write_bio_RSAPublicKey} + {$EXTERNALSYM PEM_read_bio_RSA_PUBKEY} + {$EXTERNALSYM PEM_write_bio_RSA_PUBKEY} + {$EXTERNALSYM PEM_read_bio_DSAPrivateKey} + {$EXTERNALSYM PEM_write_bio_DSAPrivateKey} + {$EXTERNALSYM PEM_read_bio_DSA_PUBKEY} + {$EXTERNALSYM PEM_write_bio_DSA_PUBKEY} + {$EXTERNALSYM PEM_read_bio_DSAparams} + {$EXTERNALSYM PEM_write_bio_DSAparams} + {$EXTERNALSYM PEM_read_bio_ECPKParameters} + {$EXTERNALSYM PEM_write_bio_ECPKParameters} + {$EXTERNALSYM PEM_read_bio_ECPrivateKey} + {$EXTERNALSYM PEM_write_bio_ECPrivateKey} + {$EXTERNALSYM PEM_read_bio_EC_PUBKEY} + {$EXTERNALSYM PEM_write_bio_EC_PUBKEY} + {$EXTERNALSYM PEM_read_bio_DHparams} + {$EXTERNALSYM PEM_write_bio_DHparams} + {$EXTERNALSYM PEM_write_bio_DHxparams} + {$EXTERNALSYM PEM_read_bio_PrivateKey} + {$EXTERNALSYM PEM_write_bio_PrivateKey} + {$EXTERNALSYM PEM_read_bio_PUBKEY} + {$EXTERNALSYM PEM_write_bio_PUBKEY} + {$EXTERNALSYM PEM_write_bio_PrivateKey_traditional} {introduced 1.1.0} + {$EXTERNALSYM PEM_write_bio_PKCS8PrivateKey_nid} + {$EXTERNALSYM PEM_write_bio_PKCS8PrivateKey} + {$EXTERNALSYM i2d_PKCS8PrivateKey_bio} + {$EXTERNALSYM i2d_PKCS8PrivateKey_nid_bio} + {$EXTERNALSYM d2i_PKCS8PrivateKey_bio} + {$EXTERNALSYM PEM_read_bio_Parameters} + {$EXTERNALSYM PEM_write_bio_Parameters} + {$EXTERNALSYM b2i_PrivateKey} + {$EXTERNALSYM b2i_PublicKey} + {$EXTERNALSYM b2i_PrivateKey_bio} + {$EXTERNALSYM b2i_PublicKey_bio} + {$EXTERNALSYM i2b_PrivateKey_bio} + {$EXTERNALSYM i2b_PublicKey_bio} + {$EXTERNALSYM b2i_PVK_bio} + {$EXTERNALSYM i2b_PVK_bio} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +var + PEM_get_EVP_CIPHER_INFO: function (header: PIdAnsiChar; cipher: PEVP_CIPHER_INFO): TIdC_INT; cdecl = nil; + PEM_do_header: function (cipher: PEVP_CIPHER_INFO; data: PByte; len: PIdC_LONG; callback: pem_password_cb; u: Pointer): TIdC_INT; cdecl = nil; + + PEM_read_bio: function (bp: PBIO; name: PPIdAnsiChar; header: PPIdAnsiChar; data: PPByte; len: PIdC_LONG): TIdC_INT; cdecl = nil; + PEM_read_bio_ex: function (bp: PBIO; name: PPIdAnsiChar; header: PPIdAnsiChar; data: PPByte; len: PIdC_LONG; flags: TIdC_UINT): TIdC_INT; cdecl = nil; {introduced 1.1.0} + PEM_bytes_read_bio_secmem: function (pdata: PPByte; plen: PIdC_LONG; pnm: PPIdAnsiChar; const name: PIdAnsiChar; bp: PBIO; cb: pem_password_cb; u: Pointer): TIdC_INT; cdecl = nil; {introduced 1.1.0} + PEM_write_bio: function (bp: PBIO; const name: PIdAnsiChar; const hdr: PIdAnsiChar; const data: PByte; len: TIdC_LONG): TIdC_INT; cdecl = nil; + PEM_bytes_read_bio: function (pdata: PPByte; plen: PIdC_LONG; pnm: PPIdAnsiChar; const name: PIdAnsiChar; bp: PBIO; cb: pem_password_cb; u: Pointer): TIdC_INT; cdecl = nil; + PEM_ASN1_read_bio: function (d2i: d2i_of_void; const name: PIdAnsiChar; bp: PBIO; x: PPointer; cb: pem_password_cb; u: Pointer): Pointer; cdecl = nil; + PEM_ASN1_write_bio: function (i2d: i2d_of_void; const name: PIdAnsiChar; bp: PBIO; x: Pointer; const enc: PEVP_CIPHER; kstr: PByte; klen: TIdC_INT; cb: pem_password_cb; u: Pointer): TIdC_INT; cdecl = nil; + + PEM_X509_INFO_read_bio: function (bp: PBIO; sk: PSTACK_OF_X509_INFO; cb: pem_password_cb; u: Pointer): PSTACK_OF_X509_INFO; cdecl = nil; + PEM_X509_INFO_write_bio: function (bp: PBIO; xi: PX509_INFO; enc: PEVP_CIPHER; kstr: PByte; klen: TIdC_INT; cd: pem_password_cb; u: Pointer): TIdC_INT; cdecl = nil; + + PEM_SignInit: function (ctx: PEVP_MD_CTX; type_: PEVP_MD): TIdC_INT; cdecl = nil; + PEM_SignUpdate: function (ctx: PEVP_MD_CTX; d: PByte; cnt: Byte): TIdC_INT; cdecl = nil; + PEM_SignFinal: function (ctx: PEVP_MD_CTX; sigret: PByte; siglen: PIdC_UINT; pkey: PEVP_PKEY): TIdC_INT; cdecl = nil; + + (* The default pem_password_cb that's used internally *) + PEM_def_callback: function (buf: PIdAnsiChar; num: TIdC_INT; rwflag: TIdC_INT; userdata: Pointer): TIdC_INT; cdecl = nil; + PEM_proc_type: procedure (buf: PIdAnsiChar; type_: TIdC_INT); cdecl = nil; + PEM_dek_info: procedure (buf: PIdAnsiChar; const type_: PIdAnsiChar; len: TIdC_INT; str: PIdAnsiChar); cdecl = nil; + + PEM_read_bio_X509: function (bp: PBIO; x: PPX509; cb: pem_password_cb; u: Pointer): PX509; cdecl = nil; + PEM_write_bio_X509: function (bp: PBIO; x: PX509): TIdC_INT; cdecl = nil; + + PEM_read_bio_X509_AUX: function (bp: PBIO; x: PPX509; cb: pem_password_cb; u: Pointer): PX509; cdecl = nil; + PEM_write_bio_X509_AUX: function (bp: PBIO; x: PX509): TIdC_INT; cdecl = nil; + + PEM_read_bio_X509_REQ: function (bp: PBIO; x: PPX509_REQ; cb: pem_password_cb; u: Pointer): PX509_REQ; cdecl = nil; + PEM_write_bio_X509_REQ: function (bp: PBIO; x: PX509_REQ): TIdC_INT; cdecl = nil; + + PEM_write_bio_X509_REQ_NEW: function (bp: PBIO; x: PX509_REQ): TIdC_INT; cdecl = nil; + + PEM_read_bio_X509_CRL: function (bp: PBIO; x: PPX509_CRL; cb: pem_password_cb; u: Pointer): PX509_CRL; cdecl = nil; + PEM_write_bio_X509_CRL: function (bp: PBIO; x: PX509_CRL): TIdC_INT; cdecl = nil; + + PEM_read_bio_PKCS7: function (bp: PBIO; x: PPPKCS7; cb: pem_password_cb; u: Pointer): PPKCS7; cdecl = nil; + PEM_write_bio_PKCS7: function (bp: PBIO; x: PPKCS7): TIdC_INT; cdecl = nil; + +// function PEM_read_bio_NETSCAPE_CERT_SEQUENCE(bp: PBIO; x: PPNETSCAPE_CERT_SEQUENCE; cb: pem_password_cb; u: Pointer): PNETSCAPE_CERT_SEQUENCE; +// function PEM_write_bio_NETSCAPE_CERT_SEQUENCE(bp: PBIO; x: PNETSCAPE_CERT_SEQUENCE): TIdC_INT; + + PEM_read_bio_PKCS8: function (bp: PBIO; x: PPX509_SIG; cb: pem_password_cb; u: Pointer): PX509_SIG; cdecl = nil; + PEM_write_bio_PKCS8: function (bp: PBIO; x: PX509_SIG): TIdC_INT; cdecl = nil; + + PEM_read_bio_PKCS8_PRIV_KEY_INFO: function (bp: PBIO; x: PPPKCS8_PRIV_KEY_INFO; cb: pem_password_cb; u: Pointer): PPKCS8_PRIV_KEY_INFO; cdecl = nil; + PEM_write_bio_PKCS8_PRIV_KEY_INFO: function (bp: PBIO; x: PPKCS8_PRIV_KEY_INFO): TIdC_INT; cdecl = nil; + + // RSA + PEM_read_bio_RSAPrivateKey: function (bp: PBIO; x: PPRSA; cb: pem_password_cb; u: Pointer): PRSA; cdecl = nil; + PEM_write_bio_RSAPrivateKey: function (bp: PBIO; x: PRSA; const enc: PEVP_CIPHER; kstr: PByte; klen: TIdC_INT; cb: pem_password_cb; u: Pointer): TIdC_INT; cdecl = nil; + + PEM_read_bio_RSAPublicKey: function (bp: PBIO; x: PPRSA; cb: pem_password_cb; u: Pointer): PRSA; cdecl = nil; + PEM_write_bio_RSAPublicKey: function (bp: PBIO; const x: PRSA): TIdC_INT; cdecl = nil; + + PEM_read_bio_RSA_PUBKEY: function (bp: PBIO; x: PPRSA; cb: pem_password_cb; u: Pointer): PRSA; cdecl = nil; + PEM_write_bio_RSA_PUBKEY: function (bp: PBIO; x: PRSA): TIdC_INT; cdecl = nil; + // ~RSA + + // DSA + PEM_read_bio_DSAPrivateKey: function (bp: PBIO; x: PPDSA; cb: pem_password_cb; u: Pointer): PDSA; cdecl = nil; + PEM_write_bio_DSAPrivateKey: function (bp: PBIO; x: PDSA; const enc: PEVP_CIPHER; kstr: PByte; klen: TIdC_INT; cb: pem_password_cb; u: Pointer): TIdC_INT; cdecl = nil; + + PEM_read_bio_DSA_PUBKEY: function (bp: PBIO; x: PPDSA; cb: pem_password_cb; u: Pointer): PDSA; cdecl = nil; + PEM_write_bio_DSA_PUBKEY: function (bp: PBIO; x: PDSA): TIdC_INT; cdecl = nil; + + PEM_read_bio_DSAparams: function (bp: PBIO; x: PPDSA; cb: pem_password_cb; u: Pointer): PDSA; cdecl = nil; + PEM_write_bio_DSAparams: function (bp: PBIO; const x: PDSA): TIdC_INT; cdecl = nil; + // ~DSA + + // EC + PEM_read_bio_ECPKParameters: function (bp: PBIO; x: PPEC_GROUP; cb: pem_password_cb; u: Pointer): PEC_GROUP; cdecl = nil; + PEM_write_bio_ECPKParameters: function (bp: PBIO; const x: PEC_GROUP): TIdC_INT; cdecl = nil; + + PEM_read_bio_ECPrivateKey: function (bp: PBIO; x: PPEC_KEY; cb: pem_password_cb; u: Pointer): PEC_KEY; cdecl = nil; + PEM_write_bio_ECPrivateKey: function (bp: PBIO; x: PEC_KEY; const enc: PEVP_CIPHER; kstr: PByte; klen: TIdC_INT; cb: pem_password_cb; u: Pointer): TIdC_INT; cdecl = nil; + + PEM_read_bio_EC_PUBKEY: function (bp: PBIO; x: PPEC_KEY; cb: pem_password_cb; u: Pointer): PEC_KEY; cdecl = nil; + PEM_write_bio_EC_PUBKEY: function (bp: PBIO; x: PEC_KEY): TIdC_INT; cdecl = nil; + // ~EC + + // DH + PEM_read_bio_DHparams: function (bp: PBIO; x: PPDH; cb: pem_password_cb; u: Pointer): PDH; cdecl = nil; + PEM_write_bio_DHparams: function (bp: PBIO; const x: PDH): TIdC_INT; cdecl = nil; + + PEM_write_bio_DHxparams: function (bp: PBIO; const x: PDH): TIdC_INT; cdecl = nil; + // ~DH + + PEM_read_bio_PrivateKey: function (bp: PBIO; x: PPEVP_PKEY; cb: pem_password_cb; u: Pointer): PEVP_PKEY; cdecl = nil; + PEM_write_bio_PrivateKey: function (bp: PBIO; x: PEVP_PKEY; const enc: PEVP_CIPHER; kstr: PByte; klen: TIdC_INT; cb: pem_password_cb; u: Pointer): TIdC_INT; cdecl = nil; + + PEM_read_bio_PUBKEY: function (bp: PBIO; x: PPEVP_PKEY; cb: pem_password_cb; u: Pointer): PEVP_PKEY; cdecl = nil; + PEM_write_bio_PUBKEY: function (bp: PBIO; x: PEVP_PKEY): TIdC_INT; cdecl = nil; + + PEM_write_bio_PrivateKey_traditional: function (bp: PBIO; x: PEVP_PKEY; const enc: PEVP_CIPHER; kstr: PByte; klen: TIdC_INT; cb: pem_password_cb; u: Pointer): TIdC_INT; cdecl = nil; {introduced 1.1.0} + PEM_write_bio_PKCS8PrivateKey_nid: function (bp: PBIO; x: PEVP_PKEY; nid: TIdC_INT; kstr: PIdAnsiChar; klen: TIdC_INT; cb: pem_password_cb; u: Pointer): TIdC_INT; cdecl = nil; + PEM_write_bio_PKCS8PrivateKey: function (bp: PBIO; x: PEVP_PKEY_METHOD; const enc: PEVP_CIPHER; kstr: PIdAnsiChar; klen: TIdC_INT; cb: pem_password_cb; u: Pointer): TIdC_INT; cdecl = nil; + i2d_PKCS8PrivateKey_bio: function (bp: PBIO; x: PEVP_PKEY; const enc: PEVP_CIPHER_CTX; kstr: PIdAnsiChar; klen: TIdC_INT; cb: pem_password_cb; u: Pointer): TIdC_INT; cdecl = nil; + i2d_PKCS8PrivateKey_nid_bio: function (bp: PBIO; x: PEVP_PKEY; nid: TIdC_INT; kstr: PIdAnsiChar; klen: TIdC_INT; cb: pem_password_cb; u: Pointer): TIdC_INT; cdecl = nil; + d2i_PKCS8PrivateKey_bio: function (bp: PBIO; x: PPEVP_PKEY_CTX; cb: pem_password_cb; u: Pointer): PEVP_PKEY; cdecl = nil; + + PEM_read_bio_Parameters: function (bp: PBIO; x: PPEVP_PKEY): PEVP_PKEY; cdecl = nil; + PEM_write_bio_Parameters: function (bp: PBIO; x: PEVP_PKEY): TIdC_INT; cdecl = nil; + + b2i_PrivateKey: function (const in_: PPByte; length: TIdC_LONG): PEVP_PKEY; cdecl = nil; + b2i_PublicKey: function (const in_: PPByte; length: TIdC_LONG): PEVP_PKEY; cdecl = nil; + b2i_PrivateKey_bio: function (in_: PBIO): PEVP_PKEY; cdecl = nil; + b2i_PublicKey_bio: function (in_: PBIO): PEVP_PKEY; cdecl = nil; + i2b_PrivateKey_bio: function (out_: PBIO; pk: PEVP_PKEY): TIdC_INT; cdecl = nil; + i2b_PublicKey_bio: function (out_: PBIO; pk: PEVP_PKEY): TIdC_INT; cdecl = nil; + b2i_PVK_bio: function (in_: PBIO; cb: pem_password_cb; u: Pointer): PEVP_PKEY; cdecl = nil; + i2b_PVK_bio: function (out_: PBIO; pk: PEVP_PKEY; enclevel: TIdC_INT; cb: pem_password_cb; u: Pointer): TIdC_INT; cdecl = nil; + +{$ELSE} + function PEM_get_EVP_CIPHER_INFO(header: PIdAnsiChar; cipher: PEVP_CIPHER_INFO): TIdC_INT cdecl; external CLibCrypto; + function PEM_do_header(cipher: PEVP_CIPHER_INFO; data: PByte; len: PIdC_LONG; callback: pem_password_cb; u: Pointer): TIdC_INT cdecl; external CLibCrypto; + + function PEM_read_bio(bp: PBIO; name: PPIdAnsiChar; header: PPIdAnsiChar; data: PPByte; len: PIdC_LONG): TIdC_INT cdecl; external CLibCrypto; + function PEM_read_bio_ex(bp: PBIO; name: PPIdAnsiChar; header: PPIdAnsiChar; data: PPByte; len: PIdC_LONG; flags: TIdC_UINT): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function PEM_bytes_read_bio_secmem(pdata: PPByte; plen: PIdC_LONG; pnm: PPIdAnsiChar; const name: PIdAnsiChar; bp: PBIO; cb: pem_password_cb; u: Pointer): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function PEM_write_bio(bp: PBIO; const name: PIdAnsiChar; const hdr: PIdAnsiChar; const data: PByte; len: TIdC_LONG): TIdC_INT cdecl; external CLibCrypto; + function PEM_bytes_read_bio(pdata: PPByte; plen: PIdC_LONG; pnm: PPIdAnsiChar; const name: PIdAnsiChar; bp: PBIO; cb: pem_password_cb; u: Pointer): TIdC_INT cdecl; external CLibCrypto; + function PEM_ASN1_read_bio(d2i: d2i_of_void; const name: PIdAnsiChar; bp: PBIO; x: PPointer; cb: pem_password_cb; u: Pointer): Pointer cdecl; external CLibCrypto; + function PEM_ASN1_write_bio(i2d: i2d_of_void; const name: PIdAnsiChar; bp: PBIO; x: Pointer; const enc: PEVP_CIPHER; kstr: PByte; klen: TIdC_INT; cb: pem_password_cb; u: Pointer): TIdC_INT cdecl; external CLibCrypto; + + function PEM_X509_INFO_read_bio(bp: PBIO; sk: PSTACK_OF_X509_INFO; cb: pem_password_cb; u: Pointer): PSTACK_OF_X509_INFO cdecl; external CLibCrypto; + function PEM_X509_INFO_write_bio(bp: PBIO; xi: PX509_INFO; enc: PEVP_CIPHER; kstr: PByte; klen: TIdC_INT; cd: pem_password_cb; u: Pointer): TIdC_INT cdecl; external CLibCrypto; + + function PEM_SignInit(ctx: PEVP_MD_CTX; type_: PEVP_MD): TIdC_INT cdecl; external CLibCrypto; + function PEM_SignUpdate(ctx: PEVP_MD_CTX; d: PByte; cnt: Byte): TIdC_INT cdecl; external CLibCrypto; + function PEM_SignFinal(ctx: PEVP_MD_CTX; sigret: PByte; siglen: PIdC_UINT; pkey: PEVP_PKEY): TIdC_INT cdecl; external CLibCrypto; + + (* The default pem_password_cb that's used internally *) + function PEM_def_callback(buf: PIdAnsiChar; num: TIdC_INT; rwflag: TIdC_INT; userdata: Pointer): TIdC_INT cdecl; external CLibCrypto; + procedure PEM_proc_type(buf: PIdAnsiChar; type_: TIdC_INT) cdecl; external CLibCrypto; + procedure PEM_dek_info(buf: PIdAnsiChar; const type_: PIdAnsiChar; len: TIdC_INT; str: PIdAnsiChar) cdecl; external CLibCrypto; + + function PEM_read_bio_X509(bp: PBIO; x: PPX509; cb: pem_password_cb; u: Pointer): PX509 cdecl; external CLibCrypto; + function PEM_write_bio_X509(bp: PBIO; x: PX509): TIdC_INT cdecl; external CLibCrypto; + + function PEM_read_bio_X509_AUX(bp: PBIO; x: PPX509; cb: pem_password_cb; u: Pointer): PX509 cdecl; external CLibCrypto; + function PEM_write_bio_X509_AUX(bp: PBIO; x: PX509): TIdC_INT cdecl; external CLibCrypto; + + function PEM_read_bio_X509_REQ(bp: PBIO; x: PPX509_REQ; cb: pem_password_cb; u: Pointer): PX509_REQ cdecl; external CLibCrypto; + function PEM_write_bio_X509_REQ(bp: PBIO; x: PX509_REQ): TIdC_INT cdecl; external CLibCrypto; + + function PEM_write_bio_X509_REQ_NEW(bp: PBIO; x: PX509_REQ): TIdC_INT cdecl; external CLibCrypto; + + function PEM_read_bio_X509_CRL(bp: PBIO; x: PPX509_CRL; cb: pem_password_cb; u: Pointer): PX509_CRL cdecl; external CLibCrypto; + function PEM_write_bio_X509_CRL(bp: PBIO; x: PX509_CRL): TIdC_INT cdecl; external CLibCrypto; + + function PEM_read_bio_PKCS7(bp: PBIO; x: PPPKCS7; cb: pem_password_cb; u: Pointer): PPKCS7 cdecl; external CLibCrypto; + function PEM_write_bio_PKCS7(bp: PBIO; x: PPKCS7): TIdC_INT cdecl; external CLibCrypto; + +// function PEM_read_bio_NETSCAPE_CERT_SEQUENCE(bp: PBIO; x: PPNETSCAPE_CERT_SEQUENCE; cb: pem_password_cb; u: Pointer): PNETSCAPE_CERT_SEQUENCE; +// function PEM_write_bio_NETSCAPE_CERT_SEQUENCE(bp: PBIO; x: PNETSCAPE_CERT_SEQUENCE): TIdC_INT; + + function PEM_read_bio_PKCS8(bp: PBIO; x: PPX509_SIG; cb: pem_password_cb; u: Pointer): PX509_SIG cdecl; external CLibCrypto; + function PEM_write_bio_PKCS8(bp: PBIO; x: PX509_SIG): TIdC_INT cdecl; external CLibCrypto; + + function PEM_read_bio_PKCS8_PRIV_KEY_INFO(bp: PBIO; x: PPPKCS8_PRIV_KEY_INFO; cb: pem_password_cb; u: Pointer): PPKCS8_PRIV_KEY_INFO cdecl; external CLibCrypto; + function PEM_write_bio_PKCS8_PRIV_KEY_INFO(bp: PBIO; x: PPKCS8_PRIV_KEY_INFO): TIdC_INT cdecl; external CLibCrypto; + + // RSA + function PEM_read_bio_RSAPrivateKey(bp: PBIO; x: PPRSA; cb: pem_password_cb; u: Pointer): PRSA cdecl; external CLibCrypto; + function PEM_write_bio_RSAPrivateKey(bp: PBIO; x: PRSA; const enc: PEVP_CIPHER; kstr: PByte; klen: TIdC_INT; cb: pem_password_cb; u: Pointer): TIdC_INT cdecl; external CLibCrypto; + + function PEM_read_bio_RSAPublicKey(bp: PBIO; x: PPRSA; cb: pem_password_cb; u: Pointer): PRSA cdecl; external CLibCrypto; + function PEM_write_bio_RSAPublicKey(bp: PBIO; const x: PRSA): TIdC_INT cdecl; external CLibCrypto; + + function PEM_read_bio_RSA_PUBKEY(bp: PBIO; x: PPRSA; cb: pem_password_cb; u: Pointer): PRSA cdecl; external CLibCrypto; + function PEM_write_bio_RSA_PUBKEY(bp: PBIO; x: PRSA): TIdC_INT cdecl; external CLibCrypto; + // ~RSA + + // DSA + function PEM_read_bio_DSAPrivateKey(bp: PBIO; x: PPDSA; cb: pem_password_cb; u: Pointer): PDSA cdecl; external CLibCrypto; + function PEM_write_bio_DSAPrivateKey(bp: PBIO; x: PDSA; const enc: PEVP_CIPHER; kstr: PByte; klen: TIdC_INT; cb: pem_password_cb; u: Pointer): TIdC_INT cdecl; external CLibCrypto; + + function PEM_read_bio_DSA_PUBKEY(bp: PBIO; x: PPDSA; cb: pem_password_cb; u: Pointer): PDSA cdecl; external CLibCrypto; + function PEM_write_bio_DSA_PUBKEY(bp: PBIO; x: PDSA): TIdC_INT cdecl; external CLibCrypto; + + function PEM_read_bio_DSAparams(bp: PBIO; x: PPDSA; cb: pem_password_cb; u: Pointer): PDSA cdecl; external CLibCrypto; + function PEM_write_bio_DSAparams(bp: PBIO; const x: PDSA): TIdC_INT cdecl; external CLibCrypto; + // ~DSA + + // EC + function PEM_read_bio_ECPKParameters(bp: PBIO; x: PPEC_GROUP; cb: pem_password_cb; u: Pointer): PEC_GROUP cdecl; external CLibCrypto; + function PEM_write_bio_ECPKParameters(bp: PBIO; const x: PEC_GROUP): TIdC_INT cdecl; external CLibCrypto; + + function PEM_read_bio_ECPrivateKey(bp: PBIO; x: PPEC_KEY; cb: pem_password_cb; u: Pointer): PEC_KEY cdecl; external CLibCrypto; + function PEM_write_bio_ECPrivateKey(bp: PBIO; x: PEC_KEY; const enc: PEVP_CIPHER; kstr: PByte; klen: TIdC_INT; cb: pem_password_cb; u: Pointer): TIdC_INT cdecl; external CLibCrypto; + + function PEM_read_bio_EC_PUBKEY(bp: PBIO; x: PPEC_KEY; cb: pem_password_cb; u: Pointer): PEC_KEY cdecl; external CLibCrypto; + function PEM_write_bio_EC_PUBKEY(bp: PBIO; x: PEC_KEY): TIdC_INT cdecl; external CLibCrypto; + // ~EC + + // DH + function PEM_read_bio_DHparams(bp: PBIO; x: PPDH; cb: pem_password_cb; u: Pointer): PDH cdecl; external CLibCrypto; + function PEM_write_bio_DHparams(bp: PBIO; const x: PDH): TIdC_INT cdecl; external CLibCrypto; + + function PEM_write_bio_DHxparams(bp: PBIO; const x: PDH): TIdC_INT cdecl; external CLibCrypto; + // ~DH + + function PEM_read_bio_PrivateKey(bp: PBIO; x: PPEVP_PKEY; cb: pem_password_cb; u: Pointer): PEVP_PKEY cdecl; external CLibCrypto; + function PEM_write_bio_PrivateKey(bp: PBIO; x: PEVP_PKEY; const enc: PEVP_CIPHER; kstr: PByte; klen: TIdC_INT; cb: pem_password_cb; u: Pointer): TIdC_INT cdecl; external CLibCrypto; + + function PEM_read_bio_PUBKEY(bp: PBIO; x: PPEVP_PKEY; cb: pem_password_cb; u: Pointer): PEVP_PKEY cdecl; external CLibCrypto; + function PEM_write_bio_PUBKEY(bp: PBIO; x: PEVP_PKEY): TIdC_INT cdecl; external CLibCrypto; + + function PEM_write_bio_PrivateKey_traditional(bp: PBIO; x: PEVP_PKEY; const enc: PEVP_CIPHER; kstr: PByte; klen: TIdC_INT; cb: pem_password_cb; u: Pointer): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function PEM_write_bio_PKCS8PrivateKey_nid(bp: PBIO; x: PEVP_PKEY; nid: TIdC_INT; kstr: PIdAnsiChar; klen: TIdC_INT; cb: pem_password_cb; u: Pointer): TIdC_INT cdecl; external CLibCrypto; + function PEM_write_bio_PKCS8PrivateKey(bp: PBIO; x: PEVP_PKEY_METHOD; const enc: PEVP_CIPHER; kstr: PIdAnsiChar; klen: TIdC_INT; cb: pem_password_cb; u: Pointer): TIdC_INT cdecl; external CLibCrypto; + function i2d_PKCS8PrivateKey_bio(bp: PBIO; x: PEVP_PKEY; const enc: PEVP_CIPHER_CTX; kstr: PIdAnsiChar; klen: TIdC_INT; cb: pem_password_cb; u: Pointer): TIdC_INT cdecl; external CLibCrypto; + function i2d_PKCS8PrivateKey_nid_bio(bp: PBIO; x: PEVP_PKEY; nid: TIdC_INT; kstr: PIdAnsiChar; klen: TIdC_INT; cb: pem_password_cb; u: Pointer): TIdC_INT cdecl; external CLibCrypto; + function d2i_PKCS8PrivateKey_bio(bp: PBIO; x: PPEVP_PKEY_CTX; cb: pem_password_cb; u: Pointer): PEVP_PKEY cdecl; external CLibCrypto; + + function PEM_read_bio_Parameters(bp: PBIO; x: PPEVP_PKEY): PEVP_PKEY cdecl; external CLibCrypto; + function PEM_write_bio_Parameters(bp: PBIO; x: PEVP_PKEY): TIdC_INT cdecl; external CLibCrypto; + + function b2i_PrivateKey(const in_: PPByte; length: TIdC_LONG): PEVP_PKEY cdecl; external CLibCrypto; + function b2i_PublicKey(const in_: PPByte; length: TIdC_LONG): PEVP_PKEY cdecl; external CLibCrypto; + function b2i_PrivateKey_bio(in_: PBIO): PEVP_PKEY cdecl; external CLibCrypto; + function b2i_PublicKey_bio(in_: PBIO): PEVP_PKEY cdecl; external CLibCrypto; + function i2b_PrivateKey_bio(out_: PBIO; pk: PEVP_PKEY): TIdC_INT cdecl; external CLibCrypto; + function i2b_PublicKey_bio(out_: PBIO; pk: PEVP_PKEY): TIdC_INT cdecl; external CLibCrypto; + function b2i_PVK_bio(in_: PBIO; cb: pem_password_cb; u: Pointer): PEVP_PKEY cdecl; external CLibCrypto; + function i2b_PVK_bio(out_: PBIO; pk: PEVP_PKEY; enclevel: TIdC_INT; cb: pem_password_cb; u: Pointer): TIdC_INT cdecl; external CLibCrypto; + +{$ENDIF} + +implementation + + uses + classes, + IdSSLOpenSSLExceptionHandlers, + IdResourceStringsOpenSSL + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + ,IdSSLOpenSSLLoader + {$ENDIF}; + +const + PEM_read_bio_ex_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + PEM_bytes_read_bio_secmem_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + PEM_write_bio_PrivateKey_traditional_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +const + PEM_get_EVP_CIPHER_INFO_procname = 'PEM_get_EVP_CIPHER_INFO'; + PEM_do_header_procname = 'PEM_do_header'; + + PEM_read_bio_procname = 'PEM_read_bio'; + PEM_read_bio_ex_procname = 'PEM_read_bio_ex'; {introduced 1.1.0} + PEM_bytes_read_bio_secmem_procname = 'PEM_bytes_read_bio_secmem'; {introduced 1.1.0} + PEM_write_bio_procname = 'PEM_write_bio'; + PEM_bytes_read_bio_procname = 'PEM_bytes_read_bio'; + PEM_ASN1_read_bio_procname = 'PEM_ASN1_read_bio'; + PEM_ASN1_write_bio_procname = 'PEM_ASN1_write_bio'; + + PEM_X509_INFO_read_bio_procname = 'PEM_X509_INFO_read_bio'; + PEM_X509_INFO_write_bio_procname = 'PEM_X509_INFO_write_bio'; + + PEM_SignInit_procname = 'PEM_SignInit'; + PEM_SignUpdate_procname = 'PEM_SignUpdate'; + PEM_SignFinal_procname = 'PEM_SignFinal'; + + (* The default pem_password_cb that's used internally *) + PEM_def_callback_procname = 'PEM_def_callback'; + PEM_proc_type_procname = 'PEM_proc_type'; + PEM_dek_info_procname = 'PEM_dek_info'; + + PEM_read_bio_X509_procname = 'PEM_read_bio_X509'; + PEM_write_bio_X509_procname = 'PEM_write_bio_X509'; + + PEM_read_bio_X509_AUX_procname = 'PEM_read_bio_X509_AUX'; + PEM_write_bio_X509_AUX_procname = 'PEM_write_bio_X509_AUX'; + + PEM_read_bio_X509_REQ_procname = 'PEM_read_bio_X509_REQ'; + PEM_write_bio_X509_REQ_procname = 'PEM_write_bio_X509_REQ'; + + PEM_write_bio_X509_REQ_NEW_procname = 'PEM_write_bio_X509_REQ_NEW'; + + PEM_read_bio_X509_CRL_procname = 'PEM_read_bio_X509_CRL'; + PEM_write_bio_X509_CRL_procname = 'PEM_write_bio_X509_CRL'; + + PEM_read_bio_PKCS7_procname = 'PEM_read_bio_PKCS7'; + PEM_write_bio_PKCS7_procname = 'PEM_write_bio_PKCS7'; + +// function PEM_read_bio_NETSCAPE_CERT_SEQUENCE(bp: PBIO; x: PPNETSCAPE_CERT_SEQUENCE; cb: pem_password_cb; u: Pointer): PNETSCAPE_CERT_SEQUENCE; +// function PEM_write_bio_NETSCAPE_CERT_SEQUENCE(bp: PBIO; x: PNETSCAPE_CERT_SEQUENCE): TIdC_INT; + + PEM_read_bio_PKCS8_procname = 'PEM_read_bio_PKCS8'; + PEM_write_bio_PKCS8_procname = 'PEM_write_bio_PKCS8'; + + PEM_read_bio_PKCS8_PRIV_KEY_INFO_procname = 'PEM_read_bio_PKCS8_PRIV_KEY_INFO'; + PEM_write_bio_PKCS8_PRIV_KEY_INFO_procname = 'PEM_write_bio_PKCS8_PRIV_KEY_INFO'; + + // RSA + PEM_read_bio_RSAPrivateKey_procname = 'PEM_read_bio_RSAPrivateKey'; + PEM_write_bio_RSAPrivateKey_procname = 'PEM_write_bio_RSAPrivateKey'; + + PEM_read_bio_RSAPublicKey_procname = 'PEM_read_bio_RSAPublicKey'; + PEM_write_bio_RSAPublicKey_procname = 'PEM_write_bio_RSAPublicKey'; + + PEM_read_bio_RSA_PUBKEY_procname = 'PEM_read_bio_RSA_PUBKEY'; + PEM_write_bio_RSA_PUBKEY_procname = 'PEM_write_bio_RSA_PUBKEY'; + // ~RSA + + // DSA + PEM_read_bio_DSAPrivateKey_procname = 'PEM_read_bio_DSAPrivateKey'; + PEM_write_bio_DSAPrivateKey_procname = 'PEM_write_bio_DSAPrivateKey'; + + PEM_read_bio_DSA_PUBKEY_procname = 'PEM_read_bio_DSA_PUBKEY'; + PEM_write_bio_DSA_PUBKEY_procname = 'PEM_write_bio_DSA_PUBKEY'; + + PEM_read_bio_DSAparams_procname = 'PEM_read_bio_DSAparams'; + PEM_write_bio_DSAparams_procname = 'PEM_write_bio_DSAparams'; + // ~DSA + + // EC + PEM_read_bio_ECPKParameters_procname = 'PEM_read_bio_ECPKParameters'; + PEM_write_bio_ECPKParameters_procname = 'PEM_write_bio_ECPKParameters'; + + PEM_read_bio_ECPrivateKey_procname = 'PEM_read_bio_ECPrivateKey'; + PEM_write_bio_ECPrivateKey_procname = 'PEM_write_bio_ECPrivateKey'; + + PEM_read_bio_EC_PUBKEY_procname = 'PEM_read_bio_EC_PUBKEY'; + PEM_write_bio_EC_PUBKEY_procname = 'PEM_write_bio_EC_PUBKEY'; + // ~EC + + // DH + PEM_read_bio_DHparams_procname = 'PEM_read_bio_DHparams'; + PEM_write_bio_DHparams_procname = 'PEM_write_bio_DHparams'; + + PEM_write_bio_DHxparams_procname = 'PEM_write_bio_DHxparams'; + // ~DH + + PEM_read_bio_PrivateKey_procname = 'PEM_read_bio_PrivateKey'; + PEM_write_bio_PrivateKey_procname = 'PEM_write_bio_PrivateKey'; + + PEM_read_bio_PUBKEY_procname = 'PEM_read_bio_PUBKEY'; + PEM_write_bio_PUBKEY_procname = 'PEM_write_bio_PUBKEY'; + + PEM_write_bio_PrivateKey_traditional_procname = 'PEM_write_bio_PrivateKey_traditional'; {introduced 1.1.0} + PEM_write_bio_PKCS8PrivateKey_nid_procname = 'PEM_write_bio_PKCS8PrivateKey_nid'; + PEM_write_bio_PKCS8PrivateKey_procname = 'PEM_write_bio_PKCS8PrivateKey'; + i2d_PKCS8PrivateKey_bio_procname = 'i2d_PKCS8PrivateKey_bio'; + i2d_PKCS8PrivateKey_nid_bio_procname = 'i2d_PKCS8PrivateKey_nid_bio'; + d2i_PKCS8PrivateKey_bio_procname = 'd2i_PKCS8PrivateKey_bio'; + + PEM_read_bio_Parameters_procname = 'PEM_read_bio_Parameters'; + PEM_write_bio_Parameters_procname = 'PEM_write_bio_Parameters'; + + b2i_PrivateKey_procname = 'b2i_PrivateKey'; + b2i_PublicKey_procname = 'b2i_PublicKey'; + b2i_PrivateKey_bio_procname = 'b2i_PrivateKey_bio'; + b2i_PublicKey_bio_procname = 'b2i_PublicKey_bio'; + i2b_PrivateKey_bio_procname = 'i2b_PrivateKey_bio'; + i2b_PublicKey_bio_procname = 'i2b_PublicKey_bio'; + b2i_PVK_bio_procname = 'b2i_PVK_bio'; + i2b_PVK_bio_procname = 'i2b_PVK_bio'; + + +{$WARN NO_RETVAL OFF} +function ERR_PEM_get_EVP_CIPHER_INFO(header: PIdAnsiChar; cipher: PEVP_CIPHER_INFO): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(PEM_get_EVP_CIPHER_INFO_procname); +end; + + +function ERR_PEM_do_header(cipher: PEVP_CIPHER_INFO; data: PByte; len: PIdC_LONG; callback: pem_password_cb; u: Pointer): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(PEM_do_header_procname); +end; + + + +function ERR_PEM_read_bio(bp: PBIO; name: PPIdAnsiChar; header: PPIdAnsiChar; data: PPByte; len: PIdC_LONG): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(PEM_read_bio_procname); +end; + + +function ERR_PEM_read_bio_ex(bp: PBIO; name: PPIdAnsiChar; header: PPIdAnsiChar; data: PPByte; len: PIdC_LONG; flags: TIdC_UINT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(PEM_read_bio_ex_procname); +end; + + {introduced 1.1.0} +function ERR_PEM_bytes_read_bio_secmem(pdata: PPByte; plen: PIdC_LONG; pnm: PPIdAnsiChar; const name: PIdAnsiChar; bp: PBIO; cb: pem_password_cb; u: Pointer): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(PEM_bytes_read_bio_secmem_procname); +end; + + {introduced 1.1.0} +function ERR_PEM_write_bio(bp: PBIO; const name: PIdAnsiChar; const hdr: PIdAnsiChar; const data: PByte; len: TIdC_LONG): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(PEM_write_bio_procname); +end; + + +function ERR_PEM_bytes_read_bio(pdata: PPByte; plen: PIdC_LONG; pnm: PPIdAnsiChar; const name: PIdAnsiChar; bp: PBIO; cb: pem_password_cb; u: Pointer): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(PEM_bytes_read_bio_procname); +end; + + +function ERR_PEM_ASN1_read_bio(d2i: d2i_of_void; const name: PIdAnsiChar; bp: PBIO; x: PPointer; cb: pem_password_cb; u: Pointer): Pointer; +begin + EIdAPIFunctionNotPresent.RaiseException(PEM_ASN1_read_bio_procname); +end; + + +function ERR_PEM_ASN1_write_bio(i2d: i2d_of_void; const name: PIdAnsiChar; bp: PBIO; x: Pointer; const enc: PEVP_CIPHER; kstr: PByte; klen: TIdC_INT; cb: pem_password_cb; u: Pointer): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(PEM_ASN1_write_bio_procname); +end; + + + +function ERR_PEM_X509_INFO_read_bio(bp: PBIO; sk: PSTACK_OF_X509_INFO; cb: pem_password_cb; u: Pointer): PSTACK_OF_X509_INFO; +begin + EIdAPIFunctionNotPresent.RaiseException(PEM_X509_INFO_read_bio_procname); +end; + + +function ERR_PEM_X509_INFO_write_bio(bp: PBIO; xi: PX509_INFO; enc: PEVP_CIPHER; kstr: PByte; klen: TIdC_INT; cd: pem_password_cb; u: Pointer): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(PEM_X509_INFO_write_bio_procname); +end; + + + +function ERR_PEM_SignInit(ctx: PEVP_MD_CTX; type_: PEVP_MD): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(PEM_SignInit_procname); +end; + + +function ERR_PEM_SignUpdate(ctx: PEVP_MD_CTX; d: PByte; cnt: Byte): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(PEM_SignUpdate_procname); +end; + + +function ERR_PEM_SignFinal(ctx: PEVP_MD_CTX; sigret: PByte; siglen: PIdC_UINT; pkey: PEVP_PKEY): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(PEM_SignFinal_procname); +end; + + + + (* The default pem_password_cb that's used internally *) +function ERR_PEM_def_callback(buf: PIdAnsiChar; num: TIdC_INT; rwflag: TIdC_INT; userdata: Pointer): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(PEM_def_callback_procname); +end; + + +procedure ERR_PEM_proc_type(buf: PIdAnsiChar; type_: TIdC_INT); +begin + EIdAPIFunctionNotPresent.RaiseException(PEM_proc_type_procname); +end; + + +procedure ERR_PEM_dek_info(buf: PIdAnsiChar; const type_: PIdAnsiChar; len: TIdC_INT; str: PIdAnsiChar); +begin + EIdAPIFunctionNotPresent.RaiseException(PEM_dek_info_procname); +end; + + + +function ERR_PEM_read_bio_X509(bp: PBIO; x: PPX509; cb: pem_password_cb; u: Pointer): PX509; +begin + EIdAPIFunctionNotPresent.RaiseException(PEM_read_bio_X509_procname); +end; + + +function ERR_PEM_write_bio_X509(bp: PBIO; x: PX509): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(PEM_write_bio_X509_procname); +end; + + + +function ERR_PEM_read_bio_X509_AUX(bp: PBIO; x: PPX509; cb: pem_password_cb; u: Pointer): PX509; +begin + EIdAPIFunctionNotPresent.RaiseException(PEM_read_bio_X509_AUX_procname); +end; + + +function ERR_PEM_write_bio_X509_AUX(bp: PBIO; x: PX509): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(PEM_write_bio_X509_AUX_procname); +end; + + + +function ERR_PEM_read_bio_X509_REQ(bp: PBIO; x: PPX509_REQ; cb: pem_password_cb; u: Pointer): PX509_REQ; +begin + EIdAPIFunctionNotPresent.RaiseException(PEM_read_bio_X509_REQ_procname); +end; + + +function ERR_PEM_write_bio_X509_REQ(bp: PBIO; x: PX509_REQ): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(PEM_write_bio_X509_REQ_procname); +end; + + + +function ERR_PEM_write_bio_X509_REQ_NEW(bp: PBIO; x: PX509_REQ): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(PEM_write_bio_X509_REQ_NEW_procname); +end; + + + +function ERR_PEM_read_bio_X509_CRL(bp: PBIO; x: PPX509_CRL; cb: pem_password_cb; u: Pointer): PX509_CRL; +begin + EIdAPIFunctionNotPresent.RaiseException(PEM_read_bio_X509_CRL_procname); +end; + + +function ERR_PEM_write_bio_X509_CRL(bp: PBIO; x: PX509_CRL): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(PEM_write_bio_X509_CRL_procname); +end; + + + +function ERR_PEM_read_bio_PKCS7(bp: PBIO; x: PPPKCS7; cb: pem_password_cb; u: Pointer): PPKCS7; +begin + EIdAPIFunctionNotPresent.RaiseException(PEM_read_bio_PKCS7_procname); +end; + + +function ERR_PEM_write_bio_PKCS7(bp: PBIO; x: PPKCS7): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(PEM_write_bio_PKCS7_procname); +end; + + + +// function PEM_read_bio_NETSCAPE_CERT_SEQUENCE(bp: PBIO; x: PPNETSCAPE_CERT_SEQUENCE; cb: pem_password_cb; u: Pointer): PNETSCAPE_CERT_SEQUENCE; +// function PEM_write_bio_NETSCAPE_CERT_SEQUENCE(bp: PBIO; x: PNETSCAPE_CERT_SEQUENCE): TIdC_INT; + +function ERR_PEM_read_bio_PKCS8(bp: PBIO; x: PPX509_SIG; cb: pem_password_cb; u: Pointer): PX509_SIG; +begin + EIdAPIFunctionNotPresent.RaiseException(PEM_read_bio_PKCS8_procname); +end; + + +function ERR_PEM_write_bio_PKCS8(bp: PBIO; x: PX509_SIG): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(PEM_write_bio_PKCS8_procname); +end; + + + +function ERR_PEM_read_bio_PKCS8_PRIV_KEY_INFO(bp: PBIO; x: PPPKCS8_PRIV_KEY_INFO; cb: pem_password_cb; u: Pointer): PPKCS8_PRIV_KEY_INFO; +begin + EIdAPIFunctionNotPresent.RaiseException(PEM_read_bio_PKCS8_PRIV_KEY_INFO_procname); +end; + + +function ERR_PEM_write_bio_PKCS8_PRIV_KEY_INFO(bp: PBIO; x: PPKCS8_PRIV_KEY_INFO): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(PEM_write_bio_PKCS8_PRIV_KEY_INFO_procname); +end; + + + + // RSA +function ERR_PEM_read_bio_RSAPrivateKey(bp: PBIO; x: PPRSA; cb: pem_password_cb; u: Pointer): PRSA; +begin + EIdAPIFunctionNotPresent.RaiseException(PEM_read_bio_RSAPrivateKey_procname); +end; + + +function ERR_PEM_write_bio_RSAPrivateKey(bp: PBIO; x: PRSA; const enc: PEVP_CIPHER; kstr: PByte; klen: TIdC_INT; cb: pem_password_cb; u: Pointer): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(PEM_write_bio_RSAPrivateKey_procname); +end; + + + +function ERR_PEM_read_bio_RSAPublicKey(bp: PBIO; x: PPRSA; cb: pem_password_cb; u: Pointer): PRSA; +begin + EIdAPIFunctionNotPresent.RaiseException(PEM_read_bio_RSAPublicKey_procname); +end; + + +function ERR_PEM_write_bio_RSAPublicKey(bp: PBIO; const x: PRSA): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(PEM_write_bio_RSAPublicKey_procname); +end; + + + +function ERR_PEM_read_bio_RSA_PUBKEY(bp: PBIO; x: PPRSA; cb: pem_password_cb; u: Pointer): PRSA; +begin + EIdAPIFunctionNotPresent.RaiseException(PEM_read_bio_RSA_PUBKEY_procname); +end; + + +function ERR_PEM_write_bio_RSA_PUBKEY(bp: PBIO; x: PRSA): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(PEM_write_bio_RSA_PUBKEY_procname); +end; + + + // ~RSA + + // DSA +function ERR_PEM_read_bio_DSAPrivateKey(bp: PBIO; x: PPDSA; cb: pem_password_cb; u: Pointer): PDSA; +begin + EIdAPIFunctionNotPresent.RaiseException(PEM_read_bio_DSAPrivateKey_procname); +end; + + +function ERR_PEM_write_bio_DSAPrivateKey(bp: PBIO; x: PDSA; const enc: PEVP_CIPHER; kstr: PByte; klen: TIdC_INT; cb: pem_password_cb; u: Pointer): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(PEM_write_bio_DSAPrivateKey_procname); +end; + + + +function ERR_PEM_read_bio_DSA_PUBKEY(bp: PBIO; x: PPDSA; cb: pem_password_cb; u: Pointer): PDSA; +begin + EIdAPIFunctionNotPresent.RaiseException(PEM_read_bio_DSA_PUBKEY_procname); +end; + + +function ERR_PEM_write_bio_DSA_PUBKEY(bp: PBIO; x: PDSA): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(PEM_write_bio_DSA_PUBKEY_procname); +end; + + + +function ERR_PEM_read_bio_DSAparams(bp: PBIO; x: PPDSA; cb: pem_password_cb; u: Pointer): PDSA; +begin + EIdAPIFunctionNotPresent.RaiseException(PEM_read_bio_DSAparams_procname); +end; + + +function ERR_PEM_write_bio_DSAparams(bp: PBIO; const x: PDSA): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(PEM_write_bio_DSAparams_procname); +end; + + + // ~DSA + + // EC +function ERR_PEM_read_bio_ECPKParameters(bp: PBIO; x: PPEC_GROUP; cb: pem_password_cb; u: Pointer): PEC_GROUP; +begin + EIdAPIFunctionNotPresent.RaiseException(PEM_read_bio_ECPKParameters_procname); +end; + + +function ERR_PEM_write_bio_ECPKParameters(bp: PBIO; const x: PEC_GROUP): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(PEM_write_bio_ECPKParameters_procname); +end; + + + +function ERR_PEM_read_bio_ECPrivateKey(bp: PBIO; x: PPEC_KEY; cb: pem_password_cb; u: Pointer): PEC_KEY; +begin + EIdAPIFunctionNotPresent.RaiseException(PEM_read_bio_ECPrivateKey_procname); +end; + + +function ERR_PEM_write_bio_ECPrivateKey(bp: PBIO; x: PEC_KEY; const enc: PEVP_CIPHER; kstr: PByte; klen: TIdC_INT; cb: pem_password_cb; u: Pointer): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(PEM_write_bio_ECPrivateKey_procname); +end; + + + +function ERR_PEM_read_bio_EC_PUBKEY(bp: PBIO; x: PPEC_KEY; cb: pem_password_cb; u: Pointer): PEC_KEY; +begin + EIdAPIFunctionNotPresent.RaiseException(PEM_read_bio_EC_PUBKEY_procname); +end; + + +function ERR_PEM_write_bio_EC_PUBKEY(bp: PBIO; x: PEC_KEY): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(PEM_write_bio_EC_PUBKEY_procname); +end; + + + // ~EC + + // DH +function ERR_PEM_read_bio_DHparams(bp: PBIO; x: PPDH; cb: pem_password_cb; u: Pointer): PDH; +begin + EIdAPIFunctionNotPresent.RaiseException(PEM_read_bio_DHparams_procname); +end; + + +function ERR_PEM_write_bio_DHparams(bp: PBIO; const x: PDH): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(PEM_write_bio_DHparams_procname); +end; + + + +function ERR_PEM_write_bio_DHxparams(bp: PBIO; const x: PDH): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(PEM_write_bio_DHxparams_procname); +end; + + + // ~DH + +function ERR_PEM_read_bio_PrivateKey(bp: PBIO; x: PPEVP_PKEY; cb: pem_password_cb; u: Pointer): PEVP_PKEY; +begin + EIdAPIFunctionNotPresent.RaiseException(PEM_read_bio_PrivateKey_procname); +end; + + +function ERR_PEM_write_bio_PrivateKey(bp: PBIO; x: PEVP_PKEY; const enc: PEVP_CIPHER; kstr: PByte; klen: TIdC_INT; cb: pem_password_cb; u: Pointer): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(PEM_write_bio_PrivateKey_procname); +end; + + + +function ERR_PEM_read_bio_PUBKEY(bp: PBIO; x: PPEVP_PKEY; cb: pem_password_cb; u: Pointer): PEVP_PKEY; +begin + EIdAPIFunctionNotPresent.RaiseException(PEM_read_bio_PUBKEY_procname); +end; + + +function ERR_PEM_write_bio_PUBKEY(bp: PBIO; x: PEVP_PKEY): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(PEM_write_bio_PUBKEY_procname); +end; + + + +function ERR_PEM_write_bio_PrivateKey_traditional(bp: PBIO; x: PEVP_PKEY; const enc: PEVP_CIPHER; kstr: PByte; klen: TIdC_INT; cb: pem_password_cb; u: Pointer): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(PEM_write_bio_PrivateKey_traditional_procname); +end; + + {introduced 1.1.0} +function ERR_PEM_write_bio_PKCS8PrivateKey_nid(bp: PBIO; x: PEVP_PKEY; nid: TIdC_INT; kstr: PIdAnsiChar; klen: TIdC_INT; cb: pem_password_cb; u: Pointer): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(PEM_write_bio_PKCS8PrivateKey_nid_procname); +end; + + +function ERR_PEM_write_bio_PKCS8PrivateKey(bp: PBIO; x: PEVP_PKEY_METHOD; const enc: PEVP_CIPHER; kstr: PIdAnsiChar; klen: TIdC_INT; cb: pem_password_cb; u: Pointer): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(PEM_write_bio_PKCS8PrivateKey_procname); +end; + + +function ERR_i2d_PKCS8PrivateKey_bio(bp: PBIO; x: PEVP_PKEY; const enc: PEVP_CIPHER_CTX; kstr: PIdAnsiChar; klen: TIdC_INT; cb: pem_password_cb; u: Pointer): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(i2d_PKCS8PrivateKey_bio_procname); +end; + + +function ERR_i2d_PKCS8PrivateKey_nid_bio(bp: PBIO; x: PEVP_PKEY; nid: TIdC_INT; kstr: PIdAnsiChar; klen: TIdC_INT; cb: pem_password_cb; u: Pointer): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(i2d_PKCS8PrivateKey_nid_bio_procname); +end; + + +function ERR_d2i_PKCS8PrivateKey_bio(bp: PBIO; x: PPEVP_PKEY_CTX; cb: pem_password_cb; u: Pointer): PEVP_PKEY; +begin + EIdAPIFunctionNotPresent.RaiseException(d2i_PKCS8PrivateKey_bio_procname); +end; + + + +function ERR_PEM_read_bio_Parameters(bp: PBIO; x: PPEVP_PKEY): PEVP_PKEY; +begin + EIdAPIFunctionNotPresent.RaiseException(PEM_read_bio_Parameters_procname); +end; + + +function ERR_PEM_write_bio_Parameters(bp: PBIO; x: PEVP_PKEY): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(PEM_write_bio_Parameters_procname); +end; + + + +function ERR_b2i_PrivateKey(const in_: PPByte; length: TIdC_LONG): PEVP_PKEY; +begin + EIdAPIFunctionNotPresent.RaiseException(b2i_PrivateKey_procname); +end; + + +function ERR_b2i_PublicKey(const in_: PPByte; length: TIdC_LONG): PEVP_PKEY; +begin + EIdAPIFunctionNotPresent.RaiseException(b2i_PublicKey_procname); +end; + + +function ERR_b2i_PrivateKey_bio(in_: PBIO): PEVP_PKEY; +begin + EIdAPIFunctionNotPresent.RaiseException(b2i_PrivateKey_bio_procname); +end; + + +function ERR_b2i_PublicKey_bio(in_: PBIO): PEVP_PKEY; +begin + EIdAPIFunctionNotPresent.RaiseException(b2i_PublicKey_bio_procname); +end; + + +function ERR_i2b_PrivateKey_bio(out_: PBIO; pk: PEVP_PKEY): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(i2b_PrivateKey_bio_procname); +end; + + +function ERR_i2b_PublicKey_bio(out_: PBIO; pk: PEVP_PKEY): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(i2b_PublicKey_bio_procname); +end; + + +function ERR_b2i_PVK_bio(in_: PBIO; cb: pem_password_cb; u: Pointer): PEVP_PKEY; +begin + EIdAPIFunctionNotPresent.RaiseException(b2i_PVK_bio_procname); +end; + + +function ERR_i2b_PVK_bio(out_: PBIO; pk: PEVP_PKEY; enclevel: TIdC_INT; cb: pem_password_cb; u: Pointer): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(i2b_PVK_bio_procname); +end; + + + +{$WARN NO_RETVAL ON} + +procedure Load(const ADllHandle: TIdLibHandle; LibVersion: TIdC_UINT; const AFailed: TStringList); + +var FuncLoadError: boolean; + +begin + PEM_get_EVP_CIPHER_INFO := LoadLibFunction(ADllHandle, PEM_get_EVP_CIPHER_INFO_procname); + FuncLoadError := not assigned(PEM_get_EVP_CIPHER_INFO); + if FuncLoadError then + begin + {$if not defined(PEM_get_EVP_CIPHER_INFO_allownil)} + PEM_get_EVP_CIPHER_INFO := @ERR_PEM_get_EVP_CIPHER_INFO; + {$ifend} + {$if declared(PEM_get_EVP_CIPHER_INFO_introduced)} + if LibVersion < PEM_get_EVP_CIPHER_INFO_introduced then + begin + {$if declared(FC_PEM_get_EVP_CIPHER_INFO)} + PEM_get_EVP_CIPHER_INFO := @FC_PEM_get_EVP_CIPHER_INFO; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PEM_get_EVP_CIPHER_INFO_removed)} + if PEM_get_EVP_CIPHER_INFO_removed <= LibVersion then + begin + {$if declared(_PEM_get_EVP_CIPHER_INFO)} + PEM_get_EVP_CIPHER_INFO := @_PEM_get_EVP_CIPHER_INFO; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PEM_get_EVP_CIPHER_INFO_allownil)} + if FuncLoadError then + AFailed.Add('PEM_get_EVP_CIPHER_INFO'); + {$ifend} + end; + + + PEM_do_header := LoadLibFunction(ADllHandle, PEM_do_header_procname); + FuncLoadError := not assigned(PEM_do_header); + if FuncLoadError then + begin + {$if not defined(PEM_do_header_allownil)} + PEM_do_header := @ERR_PEM_do_header; + {$ifend} + {$if declared(PEM_do_header_introduced)} + if LibVersion < PEM_do_header_introduced then + begin + {$if declared(FC_PEM_do_header)} + PEM_do_header := @FC_PEM_do_header; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PEM_do_header_removed)} + if PEM_do_header_removed <= LibVersion then + begin + {$if declared(_PEM_do_header)} + PEM_do_header := @_PEM_do_header; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PEM_do_header_allownil)} + if FuncLoadError then + AFailed.Add('PEM_do_header'); + {$ifend} + end; + + + PEM_read_bio := LoadLibFunction(ADllHandle, PEM_read_bio_procname); + FuncLoadError := not assigned(PEM_read_bio); + if FuncLoadError then + begin + {$if not defined(PEM_read_bio_allownil)} + PEM_read_bio := @ERR_PEM_read_bio; + {$ifend} + {$if declared(PEM_read_bio_introduced)} + if LibVersion < PEM_read_bio_introduced then + begin + {$if declared(FC_PEM_read_bio)} + PEM_read_bio := @FC_PEM_read_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PEM_read_bio_removed)} + if PEM_read_bio_removed <= LibVersion then + begin + {$if declared(_PEM_read_bio)} + PEM_read_bio := @_PEM_read_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PEM_read_bio_allownil)} + if FuncLoadError then + AFailed.Add('PEM_read_bio'); + {$ifend} + end; + + + PEM_read_bio_ex := LoadLibFunction(ADllHandle, PEM_read_bio_ex_procname); + FuncLoadError := not assigned(PEM_read_bio_ex); + if FuncLoadError then + begin + {$if not defined(PEM_read_bio_ex_allownil)} + PEM_read_bio_ex := @ERR_PEM_read_bio_ex; + {$ifend} + {$if declared(PEM_read_bio_ex_introduced)} + if LibVersion < PEM_read_bio_ex_introduced then + begin + {$if declared(FC_PEM_read_bio_ex)} + PEM_read_bio_ex := @FC_PEM_read_bio_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PEM_read_bio_ex_removed)} + if PEM_read_bio_ex_removed <= LibVersion then + begin + {$if declared(_PEM_read_bio_ex)} + PEM_read_bio_ex := @_PEM_read_bio_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PEM_read_bio_ex_allownil)} + if FuncLoadError then + AFailed.Add('PEM_read_bio_ex'); + {$ifend} + end; + + {introduced 1.1.0} + PEM_bytes_read_bio_secmem := LoadLibFunction(ADllHandle, PEM_bytes_read_bio_secmem_procname); + FuncLoadError := not assigned(PEM_bytes_read_bio_secmem); + if FuncLoadError then + begin + {$if not defined(PEM_bytes_read_bio_secmem_allownil)} + PEM_bytes_read_bio_secmem := @ERR_PEM_bytes_read_bio_secmem; + {$ifend} + {$if declared(PEM_bytes_read_bio_secmem_introduced)} + if LibVersion < PEM_bytes_read_bio_secmem_introduced then + begin + {$if declared(FC_PEM_bytes_read_bio_secmem)} + PEM_bytes_read_bio_secmem := @FC_PEM_bytes_read_bio_secmem; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PEM_bytes_read_bio_secmem_removed)} + if PEM_bytes_read_bio_secmem_removed <= LibVersion then + begin + {$if declared(_PEM_bytes_read_bio_secmem)} + PEM_bytes_read_bio_secmem := @_PEM_bytes_read_bio_secmem; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PEM_bytes_read_bio_secmem_allownil)} + if FuncLoadError then + AFailed.Add('PEM_bytes_read_bio_secmem'); + {$ifend} + end; + + {introduced 1.1.0} + PEM_write_bio := LoadLibFunction(ADllHandle, PEM_write_bio_procname); + FuncLoadError := not assigned(PEM_write_bio); + if FuncLoadError then + begin + {$if not defined(PEM_write_bio_allownil)} + PEM_write_bio := @ERR_PEM_write_bio; + {$ifend} + {$if declared(PEM_write_bio_introduced)} + if LibVersion < PEM_write_bio_introduced then + begin + {$if declared(FC_PEM_write_bio)} + PEM_write_bio := @FC_PEM_write_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PEM_write_bio_removed)} + if PEM_write_bio_removed <= LibVersion then + begin + {$if declared(_PEM_write_bio)} + PEM_write_bio := @_PEM_write_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PEM_write_bio_allownil)} + if FuncLoadError then + AFailed.Add('PEM_write_bio'); + {$ifend} + end; + + + PEM_bytes_read_bio := LoadLibFunction(ADllHandle, PEM_bytes_read_bio_procname); + FuncLoadError := not assigned(PEM_bytes_read_bio); + if FuncLoadError then + begin + {$if not defined(PEM_bytes_read_bio_allownil)} + PEM_bytes_read_bio := @ERR_PEM_bytes_read_bio; + {$ifend} + {$if declared(PEM_bytes_read_bio_introduced)} + if LibVersion < PEM_bytes_read_bio_introduced then + begin + {$if declared(FC_PEM_bytes_read_bio)} + PEM_bytes_read_bio := @FC_PEM_bytes_read_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PEM_bytes_read_bio_removed)} + if PEM_bytes_read_bio_removed <= LibVersion then + begin + {$if declared(_PEM_bytes_read_bio)} + PEM_bytes_read_bio := @_PEM_bytes_read_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PEM_bytes_read_bio_allownil)} + if FuncLoadError then + AFailed.Add('PEM_bytes_read_bio'); + {$ifend} + end; + + + PEM_ASN1_read_bio := LoadLibFunction(ADllHandle, PEM_ASN1_read_bio_procname); + FuncLoadError := not assigned(PEM_ASN1_read_bio); + if FuncLoadError then + begin + {$if not defined(PEM_ASN1_read_bio_allownil)} + PEM_ASN1_read_bio := @ERR_PEM_ASN1_read_bio; + {$ifend} + {$if declared(PEM_ASN1_read_bio_introduced)} + if LibVersion < PEM_ASN1_read_bio_introduced then + begin + {$if declared(FC_PEM_ASN1_read_bio)} + PEM_ASN1_read_bio := @FC_PEM_ASN1_read_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PEM_ASN1_read_bio_removed)} + if PEM_ASN1_read_bio_removed <= LibVersion then + begin + {$if declared(_PEM_ASN1_read_bio)} + PEM_ASN1_read_bio := @_PEM_ASN1_read_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PEM_ASN1_read_bio_allownil)} + if FuncLoadError then + AFailed.Add('PEM_ASN1_read_bio'); + {$ifend} + end; + + + PEM_ASN1_write_bio := LoadLibFunction(ADllHandle, PEM_ASN1_write_bio_procname); + FuncLoadError := not assigned(PEM_ASN1_write_bio); + if FuncLoadError then + begin + {$if not defined(PEM_ASN1_write_bio_allownil)} + PEM_ASN1_write_bio := @ERR_PEM_ASN1_write_bio; + {$ifend} + {$if declared(PEM_ASN1_write_bio_introduced)} + if LibVersion < PEM_ASN1_write_bio_introduced then + begin + {$if declared(FC_PEM_ASN1_write_bio)} + PEM_ASN1_write_bio := @FC_PEM_ASN1_write_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PEM_ASN1_write_bio_removed)} + if PEM_ASN1_write_bio_removed <= LibVersion then + begin + {$if declared(_PEM_ASN1_write_bio)} + PEM_ASN1_write_bio := @_PEM_ASN1_write_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PEM_ASN1_write_bio_allownil)} + if FuncLoadError then + AFailed.Add('PEM_ASN1_write_bio'); + {$ifend} + end; + + + PEM_X509_INFO_read_bio := LoadLibFunction(ADllHandle, PEM_X509_INFO_read_bio_procname); + FuncLoadError := not assigned(PEM_X509_INFO_read_bio); + if FuncLoadError then + begin + {$if not defined(PEM_X509_INFO_read_bio_allownil)} + PEM_X509_INFO_read_bio := @ERR_PEM_X509_INFO_read_bio; + {$ifend} + {$if declared(PEM_X509_INFO_read_bio_introduced)} + if LibVersion < PEM_X509_INFO_read_bio_introduced then + begin + {$if declared(FC_PEM_X509_INFO_read_bio)} + PEM_X509_INFO_read_bio := @FC_PEM_X509_INFO_read_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PEM_X509_INFO_read_bio_removed)} + if PEM_X509_INFO_read_bio_removed <= LibVersion then + begin + {$if declared(_PEM_X509_INFO_read_bio)} + PEM_X509_INFO_read_bio := @_PEM_X509_INFO_read_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PEM_X509_INFO_read_bio_allownil)} + if FuncLoadError then + AFailed.Add('PEM_X509_INFO_read_bio'); + {$ifend} + end; + + + PEM_X509_INFO_write_bio := LoadLibFunction(ADllHandle, PEM_X509_INFO_write_bio_procname); + FuncLoadError := not assigned(PEM_X509_INFO_write_bio); + if FuncLoadError then + begin + {$if not defined(PEM_X509_INFO_write_bio_allownil)} + PEM_X509_INFO_write_bio := @ERR_PEM_X509_INFO_write_bio; + {$ifend} + {$if declared(PEM_X509_INFO_write_bio_introduced)} + if LibVersion < PEM_X509_INFO_write_bio_introduced then + begin + {$if declared(FC_PEM_X509_INFO_write_bio)} + PEM_X509_INFO_write_bio := @FC_PEM_X509_INFO_write_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PEM_X509_INFO_write_bio_removed)} + if PEM_X509_INFO_write_bio_removed <= LibVersion then + begin + {$if declared(_PEM_X509_INFO_write_bio)} + PEM_X509_INFO_write_bio := @_PEM_X509_INFO_write_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PEM_X509_INFO_write_bio_allownil)} + if FuncLoadError then + AFailed.Add('PEM_X509_INFO_write_bio'); + {$ifend} + end; + + + PEM_SignInit := LoadLibFunction(ADllHandle, PEM_SignInit_procname); + FuncLoadError := not assigned(PEM_SignInit); + if FuncLoadError then + begin + {$if not defined(PEM_SignInit_allownil)} + PEM_SignInit := @ERR_PEM_SignInit; + {$ifend} + {$if declared(PEM_SignInit_introduced)} + if LibVersion < PEM_SignInit_introduced then + begin + {$if declared(FC_PEM_SignInit)} + PEM_SignInit := @FC_PEM_SignInit; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PEM_SignInit_removed)} + if PEM_SignInit_removed <= LibVersion then + begin + {$if declared(_PEM_SignInit)} + PEM_SignInit := @_PEM_SignInit; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PEM_SignInit_allownil)} + if FuncLoadError then + AFailed.Add('PEM_SignInit'); + {$ifend} + end; + + + PEM_SignUpdate := LoadLibFunction(ADllHandle, PEM_SignUpdate_procname); + FuncLoadError := not assigned(PEM_SignUpdate); + if FuncLoadError then + begin + {$if not defined(PEM_SignUpdate_allownil)} + PEM_SignUpdate := @ERR_PEM_SignUpdate; + {$ifend} + {$if declared(PEM_SignUpdate_introduced)} + if LibVersion < PEM_SignUpdate_introduced then + begin + {$if declared(FC_PEM_SignUpdate)} + PEM_SignUpdate := @FC_PEM_SignUpdate; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PEM_SignUpdate_removed)} + if PEM_SignUpdate_removed <= LibVersion then + begin + {$if declared(_PEM_SignUpdate)} + PEM_SignUpdate := @_PEM_SignUpdate; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PEM_SignUpdate_allownil)} + if FuncLoadError then + AFailed.Add('PEM_SignUpdate'); + {$ifend} + end; + + + PEM_SignFinal := LoadLibFunction(ADllHandle, PEM_SignFinal_procname); + FuncLoadError := not assigned(PEM_SignFinal); + if FuncLoadError then + begin + {$if not defined(PEM_SignFinal_allownil)} + PEM_SignFinal := @ERR_PEM_SignFinal; + {$ifend} + {$if declared(PEM_SignFinal_introduced)} + if LibVersion < PEM_SignFinal_introduced then + begin + {$if declared(FC_PEM_SignFinal)} + PEM_SignFinal := @FC_PEM_SignFinal; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PEM_SignFinal_removed)} + if PEM_SignFinal_removed <= LibVersion then + begin + {$if declared(_PEM_SignFinal)} + PEM_SignFinal := @_PEM_SignFinal; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PEM_SignFinal_allownil)} + if FuncLoadError then + AFailed.Add('PEM_SignFinal'); + {$ifend} + end; + + + PEM_def_callback := LoadLibFunction(ADllHandle, PEM_def_callback_procname); + FuncLoadError := not assigned(PEM_def_callback); + if FuncLoadError then + begin + {$if not defined(PEM_def_callback_allownil)} + PEM_def_callback := @ERR_PEM_def_callback; + {$ifend} + {$if declared(PEM_def_callback_introduced)} + if LibVersion < PEM_def_callback_introduced then + begin + {$if declared(FC_PEM_def_callback)} + PEM_def_callback := @FC_PEM_def_callback; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PEM_def_callback_removed)} + if PEM_def_callback_removed <= LibVersion then + begin + {$if declared(_PEM_def_callback)} + PEM_def_callback := @_PEM_def_callback; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PEM_def_callback_allownil)} + if FuncLoadError then + AFailed.Add('PEM_def_callback'); + {$ifend} + end; + + + PEM_proc_type := LoadLibFunction(ADllHandle, PEM_proc_type_procname); + FuncLoadError := not assigned(PEM_proc_type); + if FuncLoadError then + begin + {$if not defined(PEM_proc_type_allownil)} + PEM_proc_type := @ERR_PEM_proc_type; + {$ifend} + {$if declared(PEM_proc_type_introduced)} + if LibVersion < PEM_proc_type_introduced then + begin + {$if declared(FC_PEM_proc_type)} + PEM_proc_type := @FC_PEM_proc_type; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PEM_proc_type_removed)} + if PEM_proc_type_removed <= LibVersion then + begin + {$if declared(_PEM_proc_type)} + PEM_proc_type := @_PEM_proc_type; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PEM_proc_type_allownil)} + if FuncLoadError then + AFailed.Add('PEM_proc_type'); + {$ifend} + end; + + + PEM_dek_info := LoadLibFunction(ADllHandle, PEM_dek_info_procname); + FuncLoadError := not assigned(PEM_dek_info); + if FuncLoadError then + begin + {$if not defined(PEM_dek_info_allownil)} + PEM_dek_info := @ERR_PEM_dek_info; + {$ifend} + {$if declared(PEM_dek_info_introduced)} + if LibVersion < PEM_dek_info_introduced then + begin + {$if declared(FC_PEM_dek_info)} + PEM_dek_info := @FC_PEM_dek_info; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PEM_dek_info_removed)} + if PEM_dek_info_removed <= LibVersion then + begin + {$if declared(_PEM_dek_info)} + PEM_dek_info := @_PEM_dek_info; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PEM_dek_info_allownil)} + if FuncLoadError then + AFailed.Add('PEM_dek_info'); + {$ifend} + end; + + + PEM_read_bio_X509 := LoadLibFunction(ADllHandle, PEM_read_bio_X509_procname); + FuncLoadError := not assigned(PEM_read_bio_X509); + if FuncLoadError then + begin + {$if not defined(PEM_read_bio_X509_allownil)} + PEM_read_bio_X509 := @ERR_PEM_read_bio_X509; + {$ifend} + {$if declared(PEM_read_bio_X509_introduced)} + if LibVersion < PEM_read_bio_X509_introduced then + begin + {$if declared(FC_PEM_read_bio_X509)} + PEM_read_bio_X509 := @FC_PEM_read_bio_X509; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PEM_read_bio_X509_removed)} + if PEM_read_bio_X509_removed <= LibVersion then + begin + {$if declared(_PEM_read_bio_X509)} + PEM_read_bio_X509 := @_PEM_read_bio_X509; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PEM_read_bio_X509_allownil)} + if FuncLoadError then + AFailed.Add('PEM_read_bio_X509'); + {$ifend} + end; + + + PEM_write_bio_X509 := LoadLibFunction(ADllHandle, PEM_write_bio_X509_procname); + FuncLoadError := not assigned(PEM_write_bio_X509); + if FuncLoadError then + begin + {$if not defined(PEM_write_bio_X509_allownil)} + PEM_write_bio_X509 := @ERR_PEM_write_bio_X509; + {$ifend} + {$if declared(PEM_write_bio_X509_introduced)} + if LibVersion < PEM_write_bio_X509_introduced then + begin + {$if declared(FC_PEM_write_bio_X509)} + PEM_write_bio_X509 := @FC_PEM_write_bio_X509; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PEM_write_bio_X509_removed)} + if PEM_write_bio_X509_removed <= LibVersion then + begin + {$if declared(_PEM_write_bio_X509)} + PEM_write_bio_X509 := @_PEM_write_bio_X509; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PEM_write_bio_X509_allownil)} + if FuncLoadError then + AFailed.Add('PEM_write_bio_X509'); + {$ifend} + end; + + + PEM_read_bio_X509_AUX := LoadLibFunction(ADllHandle, PEM_read_bio_X509_AUX_procname); + FuncLoadError := not assigned(PEM_read_bio_X509_AUX); + if FuncLoadError then + begin + {$if not defined(PEM_read_bio_X509_AUX_allownil)} + PEM_read_bio_X509_AUX := @ERR_PEM_read_bio_X509_AUX; + {$ifend} + {$if declared(PEM_read_bio_X509_AUX_introduced)} + if LibVersion < PEM_read_bio_X509_AUX_introduced then + begin + {$if declared(FC_PEM_read_bio_X509_AUX)} + PEM_read_bio_X509_AUX := @FC_PEM_read_bio_X509_AUX; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PEM_read_bio_X509_AUX_removed)} + if PEM_read_bio_X509_AUX_removed <= LibVersion then + begin + {$if declared(_PEM_read_bio_X509_AUX)} + PEM_read_bio_X509_AUX := @_PEM_read_bio_X509_AUX; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PEM_read_bio_X509_AUX_allownil)} + if FuncLoadError then + AFailed.Add('PEM_read_bio_X509_AUX'); + {$ifend} + end; + + + PEM_write_bio_X509_AUX := LoadLibFunction(ADllHandle, PEM_write_bio_X509_AUX_procname); + FuncLoadError := not assigned(PEM_write_bio_X509_AUX); + if FuncLoadError then + begin + {$if not defined(PEM_write_bio_X509_AUX_allownil)} + PEM_write_bio_X509_AUX := @ERR_PEM_write_bio_X509_AUX; + {$ifend} + {$if declared(PEM_write_bio_X509_AUX_introduced)} + if LibVersion < PEM_write_bio_X509_AUX_introduced then + begin + {$if declared(FC_PEM_write_bio_X509_AUX)} + PEM_write_bio_X509_AUX := @FC_PEM_write_bio_X509_AUX; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PEM_write_bio_X509_AUX_removed)} + if PEM_write_bio_X509_AUX_removed <= LibVersion then + begin + {$if declared(_PEM_write_bio_X509_AUX)} + PEM_write_bio_X509_AUX := @_PEM_write_bio_X509_AUX; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PEM_write_bio_X509_AUX_allownil)} + if FuncLoadError then + AFailed.Add('PEM_write_bio_X509_AUX'); + {$ifend} + end; + + + PEM_read_bio_X509_REQ := LoadLibFunction(ADllHandle, PEM_read_bio_X509_REQ_procname); + FuncLoadError := not assigned(PEM_read_bio_X509_REQ); + if FuncLoadError then + begin + {$if not defined(PEM_read_bio_X509_REQ_allownil)} + PEM_read_bio_X509_REQ := @ERR_PEM_read_bio_X509_REQ; + {$ifend} + {$if declared(PEM_read_bio_X509_REQ_introduced)} + if LibVersion < PEM_read_bio_X509_REQ_introduced then + begin + {$if declared(FC_PEM_read_bio_X509_REQ)} + PEM_read_bio_X509_REQ := @FC_PEM_read_bio_X509_REQ; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PEM_read_bio_X509_REQ_removed)} + if PEM_read_bio_X509_REQ_removed <= LibVersion then + begin + {$if declared(_PEM_read_bio_X509_REQ)} + PEM_read_bio_X509_REQ := @_PEM_read_bio_X509_REQ; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PEM_read_bio_X509_REQ_allownil)} + if FuncLoadError then + AFailed.Add('PEM_read_bio_X509_REQ'); + {$ifend} + end; + + + PEM_write_bio_X509_REQ := LoadLibFunction(ADllHandle, PEM_write_bio_X509_REQ_procname); + FuncLoadError := not assigned(PEM_write_bio_X509_REQ); + if FuncLoadError then + begin + {$if not defined(PEM_write_bio_X509_REQ_allownil)} + PEM_write_bio_X509_REQ := @ERR_PEM_write_bio_X509_REQ; + {$ifend} + {$if declared(PEM_write_bio_X509_REQ_introduced)} + if LibVersion < PEM_write_bio_X509_REQ_introduced then + begin + {$if declared(FC_PEM_write_bio_X509_REQ)} + PEM_write_bio_X509_REQ := @FC_PEM_write_bio_X509_REQ; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PEM_write_bio_X509_REQ_removed)} + if PEM_write_bio_X509_REQ_removed <= LibVersion then + begin + {$if declared(_PEM_write_bio_X509_REQ)} + PEM_write_bio_X509_REQ := @_PEM_write_bio_X509_REQ; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PEM_write_bio_X509_REQ_allownil)} + if FuncLoadError then + AFailed.Add('PEM_write_bio_X509_REQ'); + {$ifend} + end; + + + PEM_write_bio_X509_REQ_NEW := LoadLibFunction(ADllHandle, PEM_write_bio_X509_REQ_NEW_procname); + FuncLoadError := not assigned(PEM_write_bio_X509_REQ_NEW); + if FuncLoadError then + begin + {$if not defined(PEM_write_bio_X509_REQ_NEW_allownil)} + PEM_write_bio_X509_REQ_NEW := @ERR_PEM_write_bio_X509_REQ_NEW; + {$ifend} + {$if declared(PEM_write_bio_X509_REQ_NEW_introduced)} + if LibVersion < PEM_write_bio_X509_REQ_NEW_introduced then + begin + {$if declared(FC_PEM_write_bio_X509_REQ_NEW)} + PEM_write_bio_X509_REQ_NEW := @FC_PEM_write_bio_X509_REQ_NEW; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PEM_write_bio_X509_REQ_NEW_removed)} + if PEM_write_bio_X509_REQ_NEW_removed <= LibVersion then + begin + {$if declared(_PEM_write_bio_X509_REQ_NEW)} + PEM_write_bio_X509_REQ_NEW := @_PEM_write_bio_X509_REQ_NEW; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PEM_write_bio_X509_REQ_NEW_allownil)} + if FuncLoadError then + AFailed.Add('PEM_write_bio_X509_REQ_NEW'); + {$ifend} + end; + + + PEM_read_bio_X509_CRL := LoadLibFunction(ADllHandle, PEM_read_bio_X509_CRL_procname); + FuncLoadError := not assigned(PEM_read_bio_X509_CRL); + if FuncLoadError then + begin + {$if not defined(PEM_read_bio_X509_CRL_allownil)} + PEM_read_bio_X509_CRL := @ERR_PEM_read_bio_X509_CRL; + {$ifend} + {$if declared(PEM_read_bio_X509_CRL_introduced)} + if LibVersion < PEM_read_bio_X509_CRL_introduced then + begin + {$if declared(FC_PEM_read_bio_X509_CRL)} + PEM_read_bio_X509_CRL := @FC_PEM_read_bio_X509_CRL; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PEM_read_bio_X509_CRL_removed)} + if PEM_read_bio_X509_CRL_removed <= LibVersion then + begin + {$if declared(_PEM_read_bio_X509_CRL)} + PEM_read_bio_X509_CRL := @_PEM_read_bio_X509_CRL; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PEM_read_bio_X509_CRL_allownil)} + if FuncLoadError then + AFailed.Add('PEM_read_bio_X509_CRL'); + {$ifend} + end; + + + PEM_write_bio_X509_CRL := LoadLibFunction(ADllHandle, PEM_write_bio_X509_CRL_procname); + FuncLoadError := not assigned(PEM_write_bio_X509_CRL); + if FuncLoadError then + begin + {$if not defined(PEM_write_bio_X509_CRL_allownil)} + PEM_write_bio_X509_CRL := @ERR_PEM_write_bio_X509_CRL; + {$ifend} + {$if declared(PEM_write_bio_X509_CRL_introduced)} + if LibVersion < PEM_write_bio_X509_CRL_introduced then + begin + {$if declared(FC_PEM_write_bio_X509_CRL)} + PEM_write_bio_X509_CRL := @FC_PEM_write_bio_X509_CRL; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PEM_write_bio_X509_CRL_removed)} + if PEM_write_bio_X509_CRL_removed <= LibVersion then + begin + {$if declared(_PEM_write_bio_X509_CRL)} + PEM_write_bio_X509_CRL := @_PEM_write_bio_X509_CRL; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PEM_write_bio_X509_CRL_allownil)} + if FuncLoadError then + AFailed.Add('PEM_write_bio_X509_CRL'); + {$ifend} + end; + + + PEM_read_bio_PKCS7 := LoadLibFunction(ADllHandle, PEM_read_bio_PKCS7_procname); + FuncLoadError := not assigned(PEM_read_bio_PKCS7); + if FuncLoadError then + begin + {$if not defined(PEM_read_bio_PKCS7_allownil)} + PEM_read_bio_PKCS7 := @ERR_PEM_read_bio_PKCS7; + {$ifend} + {$if declared(PEM_read_bio_PKCS7_introduced)} + if LibVersion < PEM_read_bio_PKCS7_introduced then + begin + {$if declared(FC_PEM_read_bio_PKCS7)} + PEM_read_bio_PKCS7 := @FC_PEM_read_bio_PKCS7; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PEM_read_bio_PKCS7_removed)} + if PEM_read_bio_PKCS7_removed <= LibVersion then + begin + {$if declared(_PEM_read_bio_PKCS7)} + PEM_read_bio_PKCS7 := @_PEM_read_bio_PKCS7; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PEM_read_bio_PKCS7_allownil)} + if FuncLoadError then + AFailed.Add('PEM_read_bio_PKCS7'); + {$ifend} + end; + + + PEM_write_bio_PKCS7 := LoadLibFunction(ADllHandle, PEM_write_bio_PKCS7_procname); + FuncLoadError := not assigned(PEM_write_bio_PKCS7); + if FuncLoadError then + begin + {$if not defined(PEM_write_bio_PKCS7_allownil)} + PEM_write_bio_PKCS7 := @ERR_PEM_write_bio_PKCS7; + {$ifend} + {$if declared(PEM_write_bio_PKCS7_introduced)} + if LibVersion < PEM_write_bio_PKCS7_introduced then + begin + {$if declared(FC_PEM_write_bio_PKCS7)} + PEM_write_bio_PKCS7 := @FC_PEM_write_bio_PKCS7; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PEM_write_bio_PKCS7_removed)} + if PEM_write_bio_PKCS7_removed <= LibVersion then + begin + {$if declared(_PEM_write_bio_PKCS7)} + PEM_write_bio_PKCS7 := @_PEM_write_bio_PKCS7; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PEM_write_bio_PKCS7_allownil)} + if FuncLoadError then + AFailed.Add('PEM_write_bio_PKCS7'); + {$ifend} + end; + + + PEM_read_bio_PKCS8 := LoadLibFunction(ADllHandle, PEM_read_bio_PKCS8_procname); + FuncLoadError := not assigned(PEM_read_bio_PKCS8); + if FuncLoadError then + begin + {$if not defined(PEM_read_bio_PKCS8_allownil)} + PEM_read_bio_PKCS8 := @ERR_PEM_read_bio_PKCS8; + {$ifend} + {$if declared(PEM_read_bio_PKCS8_introduced)} + if LibVersion < PEM_read_bio_PKCS8_introduced then + begin + {$if declared(FC_PEM_read_bio_PKCS8)} + PEM_read_bio_PKCS8 := @FC_PEM_read_bio_PKCS8; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PEM_read_bio_PKCS8_removed)} + if PEM_read_bio_PKCS8_removed <= LibVersion then + begin + {$if declared(_PEM_read_bio_PKCS8)} + PEM_read_bio_PKCS8 := @_PEM_read_bio_PKCS8; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PEM_read_bio_PKCS8_allownil)} + if FuncLoadError then + AFailed.Add('PEM_read_bio_PKCS8'); + {$ifend} + end; + + + PEM_write_bio_PKCS8 := LoadLibFunction(ADllHandle, PEM_write_bio_PKCS8_procname); + FuncLoadError := not assigned(PEM_write_bio_PKCS8); + if FuncLoadError then + begin + {$if not defined(PEM_write_bio_PKCS8_allownil)} + PEM_write_bio_PKCS8 := @ERR_PEM_write_bio_PKCS8; + {$ifend} + {$if declared(PEM_write_bio_PKCS8_introduced)} + if LibVersion < PEM_write_bio_PKCS8_introduced then + begin + {$if declared(FC_PEM_write_bio_PKCS8)} + PEM_write_bio_PKCS8 := @FC_PEM_write_bio_PKCS8; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PEM_write_bio_PKCS8_removed)} + if PEM_write_bio_PKCS8_removed <= LibVersion then + begin + {$if declared(_PEM_write_bio_PKCS8)} + PEM_write_bio_PKCS8 := @_PEM_write_bio_PKCS8; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PEM_write_bio_PKCS8_allownil)} + if FuncLoadError then + AFailed.Add('PEM_write_bio_PKCS8'); + {$ifend} + end; + + + PEM_read_bio_PKCS8_PRIV_KEY_INFO := LoadLibFunction(ADllHandle, PEM_read_bio_PKCS8_PRIV_KEY_INFO_procname); + FuncLoadError := not assigned(PEM_read_bio_PKCS8_PRIV_KEY_INFO); + if FuncLoadError then + begin + {$if not defined(PEM_read_bio_PKCS8_PRIV_KEY_INFO_allownil)} + PEM_read_bio_PKCS8_PRIV_KEY_INFO := @ERR_PEM_read_bio_PKCS8_PRIV_KEY_INFO; + {$ifend} + {$if declared(PEM_read_bio_PKCS8_PRIV_KEY_INFO_introduced)} + if LibVersion < PEM_read_bio_PKCS8_PRIV_KEY_INFO_introduced then + begin + {$if declared(FC_PEM_read_bio_PKCS8_PRIV_KEY_INFO)} + PEM_read_bio_PKCS8_PRIV_KEY_INFO := @FC_PEM_read_bio_PKCS8_PRIV_KEY_INFO; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PEM_read_bio_PKCS8_PRIV_KEY_INFO_removed)} + if PEM_read_bio_PKCS8_PRIV_KEY_INFO_removed <= LibVersion then + begin + {$if declared(_PEM_read_bio_PKCS8_PRIV_KEY_INFO)} + PEM_read_bio_PKCS8_PRIV_KEY_INFO := @_PEM_read_bio_PKCS8_PRIV_KEY_INFO; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PEM_read_bio_PKCS8_PRIV_KEY_INFO_allownil)} + if FuncLoadError then + AFailed.Add('PEM_read_bio_PKCS8_PRIV_KEY_INFO'); + {$ifend} + end; + + + PEM_write_bio_PKCS8_PRIV_KEY_INFO := LoadLibFunction(ADllHandle, PEM_write_bio_PKCS8_PRIV_KEY_INFO_procname); + FuncLoadError := not assigned(PEM_write_bio_PKCS8_PRIV_KEY_INFO); + if FuncLoadError then + begin + {$if not defined(PEM_write_bio_PKCS8_PRIV_KEY_INFO_allownil)} + PEM_write_bio_PKCS8_PRIV_KEY_INFO := @ERR_PEM_write_bio_PKCS8_PRIV_KEY_INFO; + {$ifend} + {$if declared(PEM_write_bio_PKCS8_PRIV_KEY_INFO_introduced)} + if LibVersion < PEM_write_bio_PKCS8_PRIV_KEY_INFO_introduced then + begin + {$if declared(FC_PEM_write_bio_PKCS8_PRIV_KEY_INFO)} + PEM_write_bio_PKCS8_PRIV_KEY_INFO := @FC_PEM_write_bio_PKCS8_PRIV_KEY_INFO; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PEM_write_bio_PKCS8_PRIV_KEY_INFO_removed)} + if PEM_write_bio_PKCS8_PRIV_KEY_INFO_removed <= LibVersion then + begin + {$if declared(_PEM_write_bio_PKCS8_PRIV_KEY_INFO)} + PEM_write_bio_PKCS8_PRIV_KEY_INFO := @_PEM_write_bio_PKCS8_PRIV_KEY_INFO; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PEM_write_bio_PKCS8_PRIV_KEY_INFO_allownil)} + if FuncLoadError then + AFailed.Add('PEM_write_bio_PKCS8_PRIV_KEY_INFO'); + {$ifend} + end; + + + PEM_read_bio_RSAPrivateKey := LoadLibFunction(ADllHandle, PEM_read_bio_RSAPrivateKey_procname); + FuncLoadError := not assigned(PEM_read_bio_RSAPrivateKey); + if FuncLoadError then + begin + {$if not defined(PEM_read_bio_RSAPrivateKey_allownil)} + PEM_read_bio_RSAPrivateKey := @ERR_PEM_read_bio_RSAPrivateKey; + {$ifend} + {$if declared(PEM_read_bio_RSAPrivateKey_introduced)} + if LibVersion < PEM_read_bio_RSAPrivateKey_introduced then + begin + {$if declared(FC_PEM_read_bio_RSAPrivateKey)} + PEM_read_bio_RSAPrivateKey := @FC_PEM_read_bio_RSAPrivateKey; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PEM_read_bio_RSAPrivateKey_removed)} + if PEM_read_bio_RSAPrivateKey_removed <= LibVersion then + begin + {$if declared(_PEM_read_bio_RSAPrivateKey)} + PEM_read_bio_RSAPrivateKey := @_PEM_read_bio_RSAPrivateKey; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PEM_read_bio_RSAPrivateKey_allownil)} + if FuncLoadError then + AFailed.Add('PEM_read_bio_RSAPrivateKey'); + {$ifend} + end; + + + PEM_write_bio_RSAPrivateKey := LoadLibFunction(ADllHandle, PEM_write_bio_RSAPrivateKey_procname); + FuncLoadError := not assigned(PEM_write_bio_RSAPrivateKey); + if FuncLoadError then + begin + {$if not defined(PEM_write_bio_RSAPrivateKey_allownil)} + PEM_write_bio_RSAPrivateKey := @ERR_PEM_write_bio_RSAPrivateKey; + {$ifend} + {$if declared(PEM_write_bio_RSAPrivateKey_introduced)} + if LibVersion < PEM_write_bio_RSAPrivateKey_introduced then + begin + {$if declared(FC_PEM_write_bio_RSAPrivateKey)} + PEM_write_bio_RSAPrivateKey := @FC_PEM_write_bio_RSAPrivateKey; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PEM_write_bio_RSAPrivateKey_removed)} + if PEM_write_bio_RSAPrivateKey_removed <= LibVersion then + begin + {$if declared(_PEM_write_bio_RSAPrivateKey)} + PEM_write_bio_RSAPrivateKey := @_PEM_write_bio_RSAPrivateKey; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PEM_write_bio_RSAPrivateKey_allownil)} + if FuncLoadError then + AFailed.Add('PEM_write_bio_RSAPrivateKey'); + {$ifend} + end; + + + PEM_read_bio_RSAPublicKey := LoadLibFunction(ADllHandle, PEM_read_bio_RSAPublicKey_procname); + FuncLoadError := not assigned(PEM_read_bio_RSAPublicKey); + if FuncLoadError then + begin + {$if not defined(PEM_read_bio_RSAPublicKey_allownil)} + PEM_read_bio_RSAPublicKey := @ERR_PEM_read_bio_RSAPublicKey; + {$ifend} + {$if declared(PEM_read_bio_RSAPublicKey_introduced)} + if LibVersion < PEM_read_bio_RSAPublicKey_introduced then + begin + {$if declared(FC_PEM_read_bio_RSAPublicKey)} + PEM_read_bio_RSAPublicKey := @FC_PEM_read_bio_RSAPublicKey; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PEM_read_bio_RSAPublicKey_removed)} + if PEM_read_bio_RSAPublicKey_removed <= LibVersion then + begin + {$if declared(_PEM_read_bio_RSAPublicKey)} + PEM_read_bio_RSAPublicKey := @_PEM_read_bio_RSAPublicKey; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PEM_read_bio_RSAPublicKey_allownil)} + if FuncLoadError then + AFailed.Add('PEM_read_bio_RSAPublicKey'); + {$ifend} + end; + + + PEM_write_bio_RSAPublicKey := LoadLibFunction(ADllHandle, PEM_write_bio_RSAPublicKey_procname); + FuncLoadError := not assigned(PEM_write_bio_RSAPublicKey); + if FuncLoadError then + begin + {$if not defined(PEM_write_bio_RSAPublicKey_allownil)} + PEM_write_bio_RSAPublicKey := @ERR_PEM_write_bio_RSAPublicKey; + {$ifend} + {$if declared(PEM_write_bio_RSAPublicKey_introduced)} + if LibVersion < PEM_write_bio_RSAPublicKey_introduced then + begin + {$if declared(FC_PEM_write_bio_RSAPublicKey)} + PEM_write_bio_RSAPublicKey := @FC_PEM_write_bio_RSAPublicKey; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PEM_write_bio_RSAPublicKey_removed)} + if PEM_write_bio_RSAPublicKey_removed <= LibVersion then + begin + {$if declared(_PEM_write_bio_RSAPublicKey)} + PEM_write_bio_RSAPublicKey := @_PEM_write_bio_RSAPublicKey; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PEM_write_bio_RSAPublicKey_allownil)} + if FuncLoadError then + AFailed.Add('PEM_write_bio_RSAPublicKey'); + {$ifend} + end; + + + PEM_read_bio_RSA_PUBKEY := LoadLibFunction(ADllHandle, PEM_read_bio_RSA_PUBKEY_procname); + FuncLoadError := not assigned(PEM_read_bio_RSA_PUBKEY); + if FuncLoadError then + begin + {$if not defined(PEM_read_bio_RSA_PUBKEY_allownil)} + PEM_read_bio_RSA_PUBKEY := @ERR_PEM_read_bio_RSA_PUBKEY; + {$ifend} + {$if declared(PEM_read_bio_RSA_PUBKEY_introduced)} + if LibVersion < PEM_read_bio_RSA_PUBKEY_introduced then + begin + {$if declared(FC_PEM_read_bio_RSA_PUBKEY)} + PEM_read_bio_RSA_PUBKEY := @FC_PEM_read_bio_RSA_PUBKEY; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PEM_read_bio_RSA_PUBKEY_removed)} + if PEM_read_bio_RSA_PUBKEY_removed <= LibVersion then + begin + {$if declared(_PEM_read_bio_RSA_PUBKEY)} + PEM_read_bio_RSA_PUBKEY := @_PEM_read_bio_RSA_PUBKEY; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PEM_read_bio_RSA_PUBKEY_allownil)} + if FuncLoadError then + AFailed.Add('PEM_read_bio_RSA_PUBKEY'); + {$ifend} + end; + + + PEM_write_bio_RSA_PUBKEY := LoadLibFunction(ADllHandle, PEM_write_bio_RSA_PUBKEY_procname); + FuncLoadError := not assigned(PEM_write_bio_RSA_PUBKEY); + if FuncLoadError then + begin + {$if not defined(PEM_write_bio_RSA_PUBKEY_allownil)} + PEM_write_bio_RSA_PUBKEY := @ERR_PEM_write_bio_RSA_PUBKEY; + {$ifend} + {$if declared(PEM_write_bio_RSA_PUBKEY_introduced)} + if LibVersion < PEM_write_bio_RSA_PUBKEY_introduced then + begin + {$if declared(FC_PEM_write_bio_RSA_PUBKEY)} + PEM_write_bio_RSA_PUBKEY := @FC_PEM_write_bio_RSA_PUBKEY; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PEM_write_bio_RSA_PUBKEY_removed)} + if PEM_write_bio_RSA_PUBKEY_removed <= LibVersion then + begin + {$if declared(_PEM_write_bio_RSA_PUBKEY)} + PEM_write_bio_RSA_PUBKEY := @_PEM_write_bio_RSA_PUBKEY; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PEM_write_bio_RSA_PUBKEY_allownil)} + if FuncLoadError then + AFailed.Add('PEM_write_bio_RSA_PUBKEY'); + {$ifend} + end; + + + PEM_read_bio_DSAPrivateKey := LoadLibFunction(ADllHandle, PEM_read_bio_DSAPrivateKey_procname); + FuncLoadError := not assigned(PEM_read_bio_DSAPrivateKey); + if FuncLoadError then + begin + {$if not defined(PEM_read_bio_DSAPrivateKey_allownil)} + PEM_read_bio_DSAPrivateKey := @ERR_PEM_read_bio_DSAPrivateKey; + {$ifend} + {$if declared(PEM_read_bio_DSAPrivateKey_introduced)} + if LibVersion < PEM_read_bio_DSAPrivateKey_introduced then + begin + {$if declared(FC_PEM_read_bio_DSAPrivateKey)} + PEM_read_bio_DSAPrivateKey := @FC_PEM_read_bio_DSAPrivateKey; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PEM_read_bio_DSAPrivateKey_removed)} + if PEM_read_bio_DSAPrivateKey_removed <= LibVersion then + begin + {$if declared(_PEM_read_bio_DSAPrivateKey)} + PEM_read_bio_DSAPrivateKey := @_PEM_read_bio_DSAPrivateKey; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PEM_read_bio_DSAPrivateKey_allownil)} + if FuncLoadError then + AFailed.Add('PEM_read_bio_DSAPrivateKey'); + {$ifend} + end; + + + PEM_write_bio_DSAPrivateKey := LoadLibFunction(ADllHandle, PEM_write_bio_DSAPrivateKey_procname); + FuncLoadError := not assigned(PEM_write_bio_DSAPrivateKey); + if FuncLoadError then + begin + {$if not defined(PEM_write_bio_DSAPrivateKey_allownil)} + PEM_write_bio_DSAPrivateKey := @ERR_PEM_write_bio_DSAPrivateKey; + {$ifend} + {$if declared(PEM_write_bio_DSAPrivateKey_introduced)} + if LibVersion < PEM_write_bio_DSAPrivateKey_introduced then + begin + {$if declared(FC_PEM_write_bio_DSAPrivateKey)} + PEM_write_bio_DSAPrivateKey := @FC_PEM_write_bio_DSAPrivateKey; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PEM_write_bio_DSAPrivateKey_removed)} + if PEM_write_bio_DSAPrivateKey_removed <= LibVersion then + begin + {$if declared(_PEM_write_bio_DSAPrivateKey)} + PEM_write_bio_DSAPrivateKey := @_PEM_write_bio_DSAPrivateKey; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PEM_write_bio_DSAPrivateKey_allownil)} + if FuncLoadError then + AFailed.Add('PEM_write_bio_DSAPrivateKey'); + {$ifend} + end; + + + PEM_read_bio_DSA_PUBKEY := LoadLibFunction(ADllHandle, PEM_read_bio_DSA_PUBKEY_procname); + FuncLoadError := not assigned(PEM_read_bio_DSA_PUBKEY); + if FuncLoadError then + begin + {$if not defined(PEM_read_bio_DSA_PUBKEY_allownil)} + PEM_read_bio_DSA_PUBKEY := @ERR_PEM_read_bio_DSA_PUBKEY; + {$ifend} + {$if declared(PEM_read_bio_DSA_PUBKEY_introduced)} + if LibVersion < PEM_read_bio_DSA_PUBKEY_introduced then + begin + {$if declared(FC_PEM_read_bio_DSA_PUBKEY)} + PEM_read_bio_DSA_PUBKEY := @FC_PEM_read_bio_DSA_PUBKEY; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PEM_read_bio_DSA_PUBKEY_removed)} + if PEM_read_bio_DSA_PUBKEY_removed <= LibVersion then + begin + {$if declared(_PEM_read_bio_DSA_PUBKEY)} + PEM_read_bio_DSA_PUBKEY := @_PEM_read_bio_DSA_PUBKEY; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PEM_read_bio_DSA_PUBKEY_allownil)} + if FuncLoadError then + AFailed.Add('PEM_read_bio_DSA_PUBKEY'); + {$ifend} + end; + + + PEM_write_bio_DSA_PUBKEY := LoadLibFunction(ADllHandle, PEM_write_bio_DSA_PUBKEY_procname); + FuncLoadError := not assigned(PEM_write_bio_DSA_PUBKEY); + if FuncLoadError then + begin + {$if not defined(PEM_write_bio_DSA_PUBKEY_allownil)} + PEM_write_bio_DSA_PUBKEY := @ERR_PEM_write_bio_DSA_PUBKEY; + {$ifend} + {$if declared(PEM_write_bio_DSA_PUBKEY_introduced)} + if LibVersion < PEM_write_bio_DSA_PUBKEY_introduced then + begin + {$if declared(FC_PEM_write_bio_DSA_PUBKEY)} + PEM_write_bio_DSA_PUBKEY := @FC_PEM_write_bio_DSA_PUBKEY; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PEM_write_bio_DSA_PUBKEY_removed)} + if PEM_write_bio_DSA_PUBKEY_removed <= LibVersion then + begin + {$if declared(_PEM_write_bio_DSA_PUBKEY)} + PEM_write_bio_DSA_PUBKEY := @_PEM_write_bio_DSA_PUBKEY; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PEM_write_bio_DSA_PUBKEY_allownil)} + if FuncLoadError then + AFailed.Add('PEM_write_bio_DSA_PUBKEY'); + {$ifend} + end; + + + PEM_read_bio_DSAparams := LoadLibFunction(ADllHandle, PEM_read_bio_DSAparams_procname); + FuncLoadError := not assigned(PEM_read_bio_DSAparams); + if FuncLoadError then + begin + {$if not defined(PEM_read_bio_DSAparams_allownil)} + PEM_read_bio_DSAparams := @ERR_PEM_read_bio_DSAparams; + {$ifend} + {$if declared(PEM_read_bio_DSAparams_introduced)} + if LibVersion < PEM_read_bio_DSAparams_introduced then + begin + {$if declared(FC_PEM_read_bio_DSAparams)} + PEM_read_bio_DSAparams := @FC_PEM_read_bio_DSAparams; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PEM_read_bio_DSAparams_removed)} + if PEM_read_bio_DSAparams_removed <= LibVersion then + begin + {$if declared(_PEM_read_bio_DSAparams)} + PEM_read_bio_DSAparams := @_PEM_read_bio_DSAparams; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PEM_read_bio_DSAparams_allownil)} + if FuncLoadError then + AFailed.Add('PEM_read_bio_DSAparams'); + {$ifend} + end; + + + PEM_write_bio_DSAparams := LoadLibFunction(ADllHandle, PEM_write_bio_DSAparams_procname); + FuncLoadError := not assigned(PEM_write_bio_DSAparams); + if FuncLoadError then + begin + {$if not defined(PEM_write_bio_DSAparams_allownil)} + PEM_write_bio_DSAparams := @ERR_PEM_write_bio_DSAparams; + {$ifend} + {$if declared(PEM_write_bio_DSAparams_introduced)} + if LibVersion < PEM_write_bio_DSAparams_introduced then + begin + {$if declared(FC_PEM_write_bio_DSAparams)} + PEM_write_bio_DSAparams := @FC_PEM_write_bio_DSAparams; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PEM_write_bio_DSAparams_removed)} + if PEM_write_bio_DSAparams_removed <= LibVersion then + begin + {$if declared(_PEM_write_bio_DSAparams)} + PEM_write_bio_DSAparams := @_PEM_write_bio_DSAparams; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PEM_write_bio_DSAparams_allownil)} + if FuncLoadError then + AFailed.Add('PEM_write_bio_DSAparams'); + {$ifend} + end; + + + PEM_read_bio_ECPKParameters := LoadLibFunction(ADllHandle, PEM_read_bio_ECPKParameters_procname); + FuncLoadError := not assigned(PEM_read_bio_ECPKParameters); + if FuncLoadError then + begin + {$if not defined(PEM_read_bio_ECPKParameters_allownil)} + PEM_read_bio_ECPKParameters := @ERR_PEM_read_bio_ECPKParameters; + {$ifend} + {$if declared(PEM_read_bio_ECPKParameters_introduced)} + if LibVersion < PEM_read_bio_ECPKParameters_introduced then + begin + {$if declared(FC_PEM_read_bio_ECPKParameters)} + PEM_read_bio_ECPKParameters := @FC_PEM_read_bio_ECPKParameters; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PEM_read_bio_ECPKParameters_removed)} + if PEM_read_bio_ECPKParameters_removed <= LibVersion then + begin + {$if declared(_PEM_read_bio_ECPKParameters)} + PEM_read_bio_ECPKParameters := @_PEM_read_bio_ECPKParameters; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PEM_read_bio_ECPKParameters_allownil)} + if FuncLoadError then + AFailed.Add('PEM_read_bio_ECPKParameters'); + {$ifend} + end; + + + PEM_write_bio_ECPKParameters := LoadLibFunction(ADllHandle, PEM_write_bio_ECPKParameters_procname); + FuncLoadError := not assigned(PEM_write_bio_ECPKParameters); + if FuncLoadError then + begin + {$if not defined(PEM_write_bio_ECPKParameters_allownil)} + PEM_write_bio_ECPKParameters := @ERR_PEM_write_bio_ECPKParameters; + {$ifend} + {$if declared(PEM_write_bio_ECPKParameters_introduced)} + if LibVersion < PEM_write_bio_ECPKParameters_introduced then + begin + {$if declared(FC_PEM_write_bio_ECPKParameters)} + PEM_write_bio_ECPKParameters := @FC_PEM_write_bio_ECPKParameters; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PEM_write_bio_ECPKParameters_removed)} + if PEM_write_bio_ECPKParameters_removed <= LibVersion then + begin + {$if declared(_PEM_write_bio_ECPKParameters)} + PEM_write_bio_ECPKParameters := @_PEM_write_bio_ECPKParameters; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PEM_write_bio_ECPKParameters_allownil)} + if FuncLoadError then + AFailed.Add('PEM_write_bio_ECPKParameters'); + {$ifend} + end; + + + PEM_read_bio_ECPrivateKey := LoadLibFunction(ADllHandle, PEM_read_bio_ECPrivateKey_procname); + FuncLoadError := not assigned(PEM_read_bio_ECPrivateKey); + if FuncLoadError then + begin + {$if not defined(PEM_read_bio_ECPrivateKey_allownil)} + PEM_read_bio_ECPrivateKey := @ERR_PEM_read_bio_ECPrivateKey; + {$ifend} + {$if declared(PEM_read_bio_ECPrivateKey_introduced)} + if LibVersion < PEM_read_bio_ECPrivateKey_introduced then + begin + {$if declared(FC_PEM_read_bio_ECPrivateKey)} + PEM_read_bio_ECPrivateKey := @FC_PEM_read_bio_ECPrivateKey; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PEM_read_bio_ECPrivateKey_removed)} + if PEM_read_bio_ECPrivateKey_removed <= LibVersion then + begin + {$if declared(_PEM_read_bio_ECPrivateKey)} + PEM_read_bio_ECPrivateKey := @_PEM_read_bio_ECPrivateKey; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PEM_read_bio_ECPrivateKey_allownil)} + if FuncLoadError then + AFailed.Add('PEM_read_bio_ECPrivateKey'); + {$ifend} + end; + + + PEM_write_bio_ECPrivateKey := LoadLibFunction(ADllHandle, PEM_write_bio_ECPrivateKey_procname); + FuncLoadError := not assigned(PEM_write_bio_ECPrivateKey); + if FuncLoadError then + begin + {$if not defined(PEM_write_bio_ECPrivateKey_allownil)} + PEM_write_bio_ECPrivateKey := @ERR_PEM_write_bio_ECPrivateKey; + {$ifend} + {$if declared(PEM_write_bio_ECPrivateKey_introduced)} + if LibVersion < PEM_write_bio_ECPrivateKey_introduced then + begin + {$if declared(FC_PEM_write_bio_ECPrivateKey)} + PEM_write_bio_ECPrivateKey := @FC_PEM_write_bio_ECPrivateKey; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PEM_write_bio_ECPrivateKey_removed)} + if PEM_write_bio_ECPrivateKey_removed <= LibVersion then + begin + {$if declared(_PEM_write_bio_ECPrivateKey)} + PEM_write_bio_ECPrivateKey := @_PEM_write_bio_ECPrivateKey; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PEM_write_bio_ECPrivateKey_allownil)} + if FuncLoadError then + AFailed.Add('PEM_write_bio_ECPrivateKey'); + {$ifend} + end; + + + PEM_read_bio_EC_PUBKEY := LoadLibFunction(ADllHandle, PEM_read_bio_EC_PUBKEY_procname); + FuncLoadError := not assigned(PEM_read_bio_EC_PUBKEY); + if FuncLoadError then + begin + {$if not defined(PEM_read_bio_EC_PUBKEY_allownil)} + PEM_read_bio_EC_PUBKEY := @ERR_PEM_read_bio_EC_PUBKEY; + {$ifend} + {$if declared(PEM_read_bio_EC_PUBKEY_introduced)} + if LibVersion < PEM_read_bio_EC_PUBKEY_introduced then + begin + {$if declared(FC_PEM_read_bio_EC_PUBKEY)} + PEM_read_bio_EC_PUBKEY := @FC_PEM_read_bio_EC_PUBKEY; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PEM_read_bio_EC_PUBKEY_removed)} + if PEM_read_bio_EC_PUBKEY_removed <= LibVersion then + begin + {$if declared(_PEM_read_bio_EC_PUBKEY)} + PEM_read_bio_EC_PUBKEY := @_PEM_read_bio_EC_PUBKEY; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PEM_read_bio_EC_PUBKEY_allownil)} + if FuncLoadError then + AFailed.Add('PEM_read_bio_EC_PUBKEY'); + {$ifend} + end; + + + PEM_write_bio_EC_PUBKEY := LoadLibFunction(ADllHandle, PEM_write_bio_EC_PUBKEY_procname); + FuncLoadError := not assigned(PEM_write_bio_EC_PUBKEY); + if FuncLoadError then + begin + {$if not defined(PEM_write_bio_EC_PUBKEY_allownil)} + PEM_write_bio_EC_PUBKEY := @ERR_PEM_write_bio_EC_PUBKEY; + {$ifend} + {$if declared(PEM_write_bio_EC_PUBKEY_introduced)} + if LibVersion < PEM_write_bio_EC_PUBKEY_introduced then + begin + {$if declared(FC_PEM_write_bio_EC_PUBKEY)} + PEM_write_bio_EC_PUBKEY := @FC_PEM_write_bio_EC_PUBKEY; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PEM_write_bio_EC_PUBKEY_removed)} + if PEM_write_bio_EC_PUBKEY_removed <= LibVersion then + begin + {$if declared(_PEM_write_bio_EC_PUBKEY)} + PEM_write_bio_EC_PUBKEY := @_PEM_write_bio_EC_PUBKEY; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PEM_write_bio_EC_PUBKEY_allownil)} + if FuncLoadError then + AFailed.Add('PEM_write_bio_EC_PUBKEY'); + {$ifend} + end; + + + PEM_read_bio_DHparams := LoadLibFunction(ADllHandle, PEM_read_bio_DHparams_procname); + FuncLoadError := not assigned(PEM_read_bio_DHparams); + if FuncLoadError then + begin + {$if not defined(PEM_read_bio_DHparams_allownil)} + PEM_read_bio_DHparams := @ERR_PEM_read_bio_DHparams; + {$ifend} + {$if declared(PEM_read_bio_DHparams_introduced)} + if LibVersion < PEM_read_bio_DHparams_introduced then + begin + {$if declared(FC_PEM_read_bio_DHparams)} + PEM_read_bio_DHparams := @FC_PEM_read_bio_DHparams; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PEM_read_bio_DHparams_removed)} + if PEM_read_bio_DHparams_removed <= LibVersion then + begin + {$if declared(_PEM_read_bio_DHparams)} + PEM_read_bio_DHparams := @_PEM_read_bio_DHparams; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PEM_read_bio_DHparams_allownil)} + if FuncLoadError then + AFailed.Add('PEM_read_bio_DHparams'); + {$ifend} + end; + + + PEM_write_bio_DHparams := LoadLibFunction(ADllHandle, PEM_write_bio_DHparams_procname); + FuncLoadError := not assigned(PEM_write_bio_DHparams); + if FuncLoadError then + begin + {$if not defined(PEM_write_bio_DHparams_allownil)} + PEM_write_bio_DHparams := @ERR_PEM_write_bio_DHparams; + {$ifend} + {$if declared(PEM_write_bio_DHparams_introduced)} + if LibVersion < PEM_write_bio_DHparams_introduced then + begin + {$if declared(FC_PEM_write_bio_DHparams)} + PEM_write_bio_DHparams := @FC_PEM_write_bio_DHparams; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PEM_write_bio_DHparams_removed)} + if PEM_write_bio_DHparams_removed <= LibVersion then + begin + {$if declared(_PEM_write_bio_DHparams)} + PEM_write_bio_DHparams := @_PEM_write_bio_DHparams; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PEM_write_bio_DHparams_allownil)} + if FuncLoadError then + AFailed.Add('PEM_write_bio_DHparams'); + {$ifend} + end; + + + PEM_write_bio_DHxparams := LoadLibFunction(ADllHandle, PEM_write_bio_DHxparams_procname); + FuncLoadError := not assigned(PEM_write_bio_DHxparams); + if FuncLoadError then + begin + {$if not defined(PEM_write_bio_DHxparams_allownil)} + PEM_write_bio_DHxparams := @ERR_PEM_write_bio_DHxparams; + {$ifend} + {$if declared(PEM_write_bio_DHxparams_introduced)} + if LibVersion < PEM_write_bio_DHxparams_introduced then + begin + {$if declared(FC_PEM_write_bio_DHxparams)} + PEM_write_bio_DHxparams := @FC_PEM_write_bio_DHxparams; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PEM_write_bio_DHxparams_removed)} + if PEM_write_bio_DHxparams_removed <= LibVersion then + begin + {$if declared(_PEM_write_bio_DHxparams)} + PEM_write_bio_DHxparams := @_PEM_write_bio_DHxparams; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PEM_write_bio_DHxparams_allownil)} + if FuncLoadError then + AFailed.Add('PEM_write_bio_DHxparams'); + {$ifend} + end; + + + PEM_read_bio_PrivateKey := LoadLibFunction(ADllHandle, PEM_read_bio_PrivateKey_procname); + FuncLoadError := not assigned(PEM_read_bio_PrivateKey); + if FuncLoadError then + begin + {$if not defined(PEM_read_bio_PrivateKey_allownil)} + PEM_read_bio_PrivateKey := @ERR_PEM_read_bio_PrivateKey; + {$ifend} + {$if declared(PEM_read_bio_PrivateKey_introduced)} + if LibVersion < PEM_read_bio_PrivateKey_introduced then + begin + {$if declared(FC_PEM_read_bio_PrivateKey)} + PEM_read_bio_PrivateKey := @FC_PEM_read_bio_PrivateKey; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PEM_read_bio_PrivateKey_removed)} + if PEM_read_bio_PrivateKey_removed <= LibVersion then + begin + {$if declared(_PEM_read_bio_PrivateKey)} + PEM_read_bio_PrivateKey := @_PEM_read_bio_PrivateKey; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PEM_read_bio_PrivateKey_allownil)} + if FuncLoadError then + AFailed.Add('PEM_read_bio_PrivateKey'); + {$ifend} + end; + + + PEM_write_bio_PrivateKey := LoadLibFunction(ADllHandle, PEM_write_bio_PrivateKey_procname); + FuncLoadError := not assigned(PEM_write_bio_PrivateKey); + if FuncLoadError then + begin + {$if not defined(PEM_write_bio_PrivateKey_allownil)} + PEM_write_bio_PrivateKey := @ERR_PEM_write_bio_PrivateKey; + {$ifend} + {$if declared(PEM_write_bio_PrivateKey_introduced)} + if LibVersion < PEM_write_bio_PrivateKey_introduced then + begin + {$if declared(FC_PEM_write_bio_PrivateKey)} + PEM_write_bio_PrivateKey := @FC_PEM_write_bio_PrivateKey; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PEM_write_bio_PrivateKey_removed)} + if PEM_write_bio_PrivateKey_removed <= LibVersion then + begin + {$if declared(_PEM_write_bio_PrivateKey)} + PEM_write_bio_PrivateKey := @_PEM_write_bio_PrivateKey; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PEM_write_bio_PrivateKey_allownil)} + if FuncLoadError then + AFailed.Add('PEM_write_bio_PrivateKey'); + {$ifend} + end; + + + PEM_read_bio_PUBKEY := LoadLibFunction(ADllHandle, PEM_read_bio_PUBKEY_procname); + FuncLoadError := not assigned(PEM_read_bio_PUBKEY); + if FuncLoadError then + begin + {$if not defined(PEM_read_bio_PUBKEY_allownil)} + PEM_read_bio_PUBKEY := @ERR_PEM_read_bio_PUBKEY; + {$ifend} + {$if declared(PEM_read_bio_PUBKEY_introduced)} + if LibVersion < PEM_read_bio_PUBKEY_introduced then + begin + {$if declared(FC_PEM_read_bio_PUBKEY)} + PEM_read_bio_PUBKEY := @FC_PEM_read_bio_PUBKEY; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PEM_read_bio_PUBKEY_removed)} + if PEM_read_bio_PUBKEY_removed <= LibVersion then + begin + {$if declared(_PEM_read_bio_PUBKEY)} + PEM_read_bio_PUBKEY := @_PEM_read_bio_PUBKEY; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PEM_read_bio_PUBKEY_allownil)} + if FuncLoadError then + AFailed.Add('PEM_read_bio_PUBKEY'); + {$ifend} + end; + + + PEM_write_bio_PUBKEY := LoadLibFunction(ADllHandle, PEM_write_bio_PUBKEY_procname); + FuncLoadError := not assigned(PEM_write_bio_PUBKEY); + if FuncLoadError then + begin + {$if not defined(PEM_write_bio_PUBKEY_allownil)} + PEM_write_bio_PUBKEY := @ERR_PEM_write_bio_PUBKEY; + {$ifend} + {$if declared(PEM_write_bio_PUBKEY_introduced)} + if LibVersion < PEM_write_bio_PUBKEY_introduced then + begin + {$if declared(FC_PEM_write_bio_PUBKEY)} + PEM_write_bio_PUBKEY := @FC_PEM_write_bio_PUBKEY; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PEM_write_bio_PUBKEY_removed)} + if PEM_write_bio_PUBKEY_removed <= LibVersion then + begin + {$if declared(_PEM_write_bio_PUBKEY)} + PEM_write_bio_PUBKEY := @_PEM_write_bio_PUBKEY; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PEM_write_bio_PUBKEY_allownil)} + if FuncLoadError then + AFailed.Add('PEM_write_bio_PUBKEY'); + {$ifend} + end; + + + PEM_write_bio_PrivateKey_traditional := LoadLibFunction(ADllHandle, PEM_write_bio_PrivateKey_traditional_procname); + FuncLoadError := not assigned(PEM_write_bio_PrivateKey_traditional); + if FuncLoadError then + begin + {$if not defined(PEM_write_bio_PrivateKey_traditional_allownil)} + PEM_write_bio_PrivateKey_traditional := @ERR_PEM_write_bio_PrivateKey_traditional; + {$ifend} + {$if declared(PEM_write_bio_PrivateKey_traditional_introduced)} + if LibVersion < PEM_write_bio_PrivateKey_traditional_introduced then + begin + {$if declared(FC_PEM_write_bio_PrivateKey_traditional)} + PEM_write_bio_PrivateKey_traditional := @FC_PEM_write_bio_PrivateKey_traditional; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PEM_write_bio_PrivateKey_traditional_removed)} + if PEM_write_bio_PrivateKey_traditional_removed <= LibVersion then + begin + {$if declared(_PEM_write_bio_PrivateKey_traditional)} + PEM_write_bio_PrivateKey_traditional := @_PEM_write_bio_PrivateKey_traditional; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PEM_write_bio_PrivateKey_traditional_allownil)} + if FuncLoadError then + AFailed.Add('PEM_write_bio_PrivateKey_traditional'); + {$ifend} + end; + + {introduced 1.1.0} + PEM_write_bio_PKCS8PrivateKey_nid := LoadLibFunction(ADllHandle, PEM_write_bio_PKCS8PrivateKey_nid_procname); + FuncLoadError := not assigned(PEM_write_bio_PKCS8PrivateKey_nid); + if FuncLoadError then + begin + {$if not defined(PEM_write_bio_PKCS8PrivateKey_nid_allownil)} + PEM_write_bio_PKCS8PrivateKey_nid := @ERR_PEM_write_bio_PKCS8PrivateKey_nid; + {$ifend} + {$if declared(PEM_write_bio_PKCS8PrivateKey_nid_introduced)} + if LibVersion < PEM_write_bio_PKCS8PrivateKey_nid_introduced then + begin + {$if declared(FC_PEM_write_bio_PKCS8PrivateKey_nid)} + PEM_write_bio_PKCS8PrivateKey_nid := @FC_PEM_write_bio_PKCS8PrivateKey_nid; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PEM_write_bio_PKCS8PrivateKey_nid_removed)} + if PEM_write_bio_PKCS8PrivateKey_nid_removed <= LibVersion then + begin + {$if declared(_PEM_write_bio_PKCS8PrivateKey_nid)} + PEM_write_bio_PKCS8PrivateKey_nid := @_PEM_write_bio_PKCS8PrivateKey_nid; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PEM_write_bio_PKCS8PrivateKey_nid_allownil)} + if FuncLoadError then + AFailed.Add('PEM_write_bio_PKCS8PrivateKey_nid'); + {$ifend} + end; + + + PEM_write_bio_PKCS8PrivateKey := LoadLibFunction(ADllHandle, PEM_write_bio_PKCS8PrivateKey_procname); + FuncLoadError := not assigned(PEM_write_bio_PKCS8PrivateKey); + if FuncLoadError then + begin + {$if not defined(PEM_write_bio_PKCS8PrivateKey_allownil)} + PEM_write_bio_PKCS8PrivateKey := @ERR_PEM_write_bio_PKCS8PrivateKey; + {$ifend} + {$if declared(PEM_write_bio_PKCS8PrivateKey_introduced)} + if LibVersion < PEM_write_bio_PKCS8PrivateKey_introduced then + begin + {$if declared(FC_PEM_write_bio_PKCS8PrivateKey)} + PEM_write_bio_PKCS8PrivateKey := @FC_PEM_write_bio_PKCS8PrivateKey; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PEM_write_bio_PKCS8PrivateKey_removed)} + if PEM_write_bio_PKCS8PrivateKey_removed <= LibVersion then + begin + {$if declared(_PEM_write_bio_PKCS8PrivateKey)} + PEM_write_bio_PKCS8PrivateKey := @_PEM_write_bio_PKCS8PrivateKey; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PEM_write_bio_PKCS8PrivateKey_allownil)} + if FuncLoadError then + AFailed.Add('PEM_write_bio_PKCS8PrivateKey'); + {$ifend} + end; + + + i2d_PKCS8PrivateKey_bio := LoadLibFunction(ADllHandle, i2d_PKCS8PrivateKey_bio_procname); + FuncLoadError := not assigned(i2d_PKCS8PrivateKey_bio); + if FuncLoadError then + begin + {$if not defined(i2d_PKCS8PrivateKey_bio_allownil)} + i2d_PKCS8PrivateKey_bio := @ERR_i2d_PKCS8PrivateKey_bio; + {$ifend} + {$if declared(i2d_PKCS8PrivateKey_bio_introduced)} + if LibVersion < i2d_PKCS8PrivateKey_bio_introduced then + begin + {$if declared(FC_i2d_PKCS8PrivateKey_bio)} + i2d_PKCS8PrivateKey_bio := @FC_i2d_PKCS8PrivateKey_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(i2d_PKCS8PrivateKey_bio_removed)} + if i2d_PKCS8PrivateKey_bio_removed <= LibVersion then + begin + {$if declared(_i2d_PKCS8PrivateKey_bio)} + i2d_PKCS8PrivateKey_bio := @_i2d_PKCS8PrivateKey_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(i2d_PKCS8PrivateKey_bio_allownil)} + if FuncLoadError then + AFailed.Add('i2d_PKCS8PrivateKey_bio'); + {$ifend} + end; + + + i2d_PKCS8PrivateKey_nid_bio := LoadLibFunction(ADllHandle, i2d_PKCS8PrivateKey_nid_bio_procname); + FuncLoadError := not assigned(i2d_PKCS8PrivateKey_nid_bio); + if FuncLoadError then + begin + {$if not defined(i2d_PKCS8PrivateKey_nid_bio_allownil)} + i2d_PKCS8PrivateKey_nid_bio := @ERR_i2d_PKCS8PrivateKey_nid_bio; + {$ifend} + {$if declared(i2d_PKCS8PrivateKey_nid_bio_introduced)} + if LibVersion < i2d_PKCS8PrivateKey_nid_bio_introduced then + begin + {$if declared(FC_i2d_PKCS8PrivateKey_nid_bio)} + i2d_PKCS8PrivateKey_nid_bio := @FC_i2d_PKCS8PrivateKey_nid_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(i2d_PKCS8PrivateKey_nid_bio_removed)} + if i2d_PKCS8PrivateKey_nid_bio_removed <= LibVersion then + begin + {$if declared(_i2d_PKCS8PrivateKey_nid_bio)} + i2d_PKCS8PrivateKey_nid_bio := @_i2d_PKCS8PrivateKey_nid_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(i2d_PKCS8PrivateKey_nid_bio_allownil)} + if FuncLoadError then + AFailed.Add('i2d_PKCS8PrivateKey_nid_bio'); + {$ifend} + end; + + + d2i_PKCS8PrivateKey_bio := LoadLibFunction(ADllHandle, d2i_PKCS8PrivateKey_bio_procname); + FuncLoadError := not assigned(d2i_PKCS8PrivateKey_bio); + if FuncLoadError then + begin + {$if not defined(d2i_PKCS8PrivateKey_bio_allownil)} + d2i_PKCS8PrivateKey_bio := @ERR_d2i_PKCS8PrivateKey_bio; + {$ifend} + {$if declared(d2i_PKCS8PrivateKey_bio_introduced)} + if LibVersion < d2i_PKCS8PrivateKey_bio_introduced then + begin + {$if declared(FC_d2i_PKCS8PrivateKey_bio)} + d2i_PKCS8PrivateKey_bio := @FC_d2i_PKCS8PrivateKey_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(d2i_PKCS8PrivateKey_bio_removed)} + if d2i_PKCS8PrivateKey_bio_removed <= LibVersion then + begin + {$if declared(_d2i_PKCS8PrivateKey_bio)} + d2i_PKCS8PrivateKey_bio := @_d2i_PKCS8PrivateKey_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(d2i_PKCS8PrivateKey_bio_allownil)} + if FuncLoadError then + AFailed.Add('d2i_PKCS8PrivateKey_bio'); + {$ifend} + end; + + + PEM_read_bio_Parameters := LoadLibFunction(ADllHandle, PEM_read_bio_Parameters_procname); + FuncLoadError := not assigned(PEM_read_bio_Parameters); + if FuncLoadError then + begin + {$if not defined(PEM_read_bio_Parameters_allownil)} + PEM_read_bio_Parameters := @ERR_PEM_read_bio_Parameters; + {$ifend} + {$if declared(PEM_read_bio_Parameters_introduced)} + if LibVersion < PEM_read_bio_Parameters_introduced then + begin + {$if declared(FC_PEM_read_bio_Parameters)} + PEM_read_bio_Parameters := @FC_PEM_read_bio_Parameters; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PEM_read_bio_Parameters_removed)} + if PEM_read_bio_Parameters_removed <= LibVersion then + begin + {$if declared(_PEM_read_bio_Parameters)} + PEM_read_bio_Parameters := @_PEM_read_bio_Parameters; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PEM_read_bio_Parameters_allownil)} + if FuncLoadError then + AFailed.Add('PEM_read_bio_Parameters'); + {$ifend} + end; + + + PEM_write_bio_Parameters := LoadLibFunction(ADllHandle, PEM_write_bio_Parameters_procname); + FuncLoadError := not assigned(PEM_write_bio_Parameters); + if FuncLoadError then + begin + {$if not defined(PEM_write_bio_Parameters_allownil)} + PEM_write_bio_Parameters := @ERR_PEM_write_bio_Parameters; + {$ifend} + {$if declared(PEM_write_bio_Parameters_introduced)} + if LibVersion < PEM_write_bio_Parameters_introduced then + begin + {$if declared(FC_PEM_write_bio_Parameters)} + PEM_write_bio_Parameters := @FC_PEM_write_bio_Parameters; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PEM_write_bio_Parameters_removed)} + if PEM_write_bio_Parameters_removed <= LibVersion then + begin + {$if declared(_PEM_write_bio_Parameters)} + PEM_write_bio_Parameters := @_PEM_write_bio_Parameters; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PEM_write_bio_Parameters_allownil)} + if FuncLoadError then + AFailed.Add('PEM_write_bio_Parameters'); + {$ifend} + end; + + + b2i_PrivateKey := LoadLibFunction(ADllHandle, b2i_PrivateKey_procname); + FuncLoadError := not assigned(b2i_PrivateKey); + if FuncLoadError then + begin + {$if not defined(b2i_PrivateKey_allownil)} + b2i_PrivateKey := @ERR_b2i_PrivateKey; + {$ifend} + {$if declared(b2i_PrivateKey_introduced)} + if LibVersion < b2i_PrivateKey_introduced then + begin + {$if declared(FC_b2i_PrivateKey)} + b2i_PrivateKey := @FC_b2i_PrivateKey; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(b2i_PrivateKey_removed)} + if b2i_PrivateKey_removed <= LibVersion then + begin + {$if declared(_b2i_PrivateKey)} + b2i_PrivateKey := @_b2i_PrivateKey; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(b2i_PrivateKey_allownil)} + if FuncLoadError then + AFailed.Add('b2i_PrivateKey'); + {$ifend} + end; + + + b2i_PublicKey := LoadLibFunction(ADllHandle, b2i_PublicKey_procname); + FuncLoadError := not assigned(b2i_PublicKey); + if FuncLoadError then + begin + {$if not defined(b2i_PublicKey_allownil)} + b2i_PublicKey := @ERR_b2i_PublicKey; + {$ifend} + {$if declared(b2i_PublicKey_introduced)} + if LibVersion < b2i_PublicKey_introduced then + begin + {$if declared(FC_b2i_PublicKey)} + b2i_PublicKey := @FC_b2i_PublicKey; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(b2i_PublicKey_removed)} + if b2i_PublicKey_removed <= LibVersion then + begin + {$if declared(_b2i_PublicKey)} + b2i_PublicKey := @_b2i_PublicKey; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(b2i_PublicKey_allownil)} + if FuncLoadError then + AFailed.Add('b2i_PublicKey'); + {$ifend} + end; + + + b2i_PrivateKey_bio := LoadLibFunction(ADllHandle, b2i_PrivateKey_bio_procname); + FuncLoadError := not assigned(b2i_PrivateKey_bio); + if FuncLoadError then + begin + {$if not defined(b2i_PrivateKey_bio_allownil)} + b2i_PrivateKey_bio := @ERR_b2i_PrivateKey_bio; + {$ifend} + {$if declared(b2i_PrivateKey_bio_introduced)} + if LibVersion < b2i_PrivateKey_bio_introduced then + begin + {$if declared(FC_b2i_PrivateKey_bio)} + b2i_PrivateKey_bio := @FC_b2i_PrivateKey_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(b2i_PrivateKey_bio_removed)} + if b2i_PrivateKey_bio_removed <= LibVersion then + begin + {$if declared(_b2i_PrivateKey_bio)} + b2i_PrivateKey_bio := @_b2i_PrivateKey_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(b2i_PrivateKey_bio_allownil)} + if FuncLoadError then + AFailed.Add('b2i_PrivateKey_bio'); + {$ifend} + end; + + + b2i_PublicKey_bio := LoadLibFunction(ADllHandle, b2i_PublicKey_bio_procname); + FuncLoadError := not assigned(b2i_PublicKey_bio); + if FuncLoadError then + begin + {$if not defined(b2i_PublicKey_bio_allownil)} + b2i_PublicKey_bio := @ERR_b2i_PublicKey_bio; + {$ifend} + {$if declared(b2i_PublicKey_bio_introduced)} + if LibVersion < b2i_PublicKey_bio_introduced then + begin + {$if declared(FC_b2i_PublicKey_bio)} + b2i_PublicKey_bio := @FC_b2i_PublicKey_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(b2i_PublicKey_bio_removed)} + if b2i_PublicKey_bio_removed <= LibVersion then + begin + {$if declared(_b2i_PublicKey_bio)} + b2i_PublicKey_bio := @_b2i_PublicKey_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(b2i_PublicKey_bio_allownil)} + if FuncLoadError then + AFailed.Add('b2i_PublicKey_bio'); + {$ifend} + end; + + + i2b_PrivateKey_bio := LoadLibFunction(ADllHandle, i2b_PrivateKey_bio_procname); + FuncLoadError := not assigned(i2b_PrivateKey_bio); + if FuncLoadError then + begin + {$if not defined(i2b_PrivateKey_bio_allownil)} + i2b_PrivateKey_bio := @ERR_i2b_PrivateKey_bio; + {$ifend} + {$if declared(i2b_PrivateKey_bio_introduced)} + if LibVersion < i2b_PrivateKey_bio_introduced then + begin + {$if declared(FC_i2b_PrivateKey_bio)} + i2b_PrivateKey_bio := @FC_i2b_PrivateKey_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(i2b_PrivateKey_bio_removed)} + if i2b_PrivateKey_bio_removed <= LibVersion then + begin + {$if declared(_i2b_PrivateKey_bio)} + i2b_PrivateKey_bio := @_i2b_PrivateKey_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(i2b_PrivateKey_bio_allownil)} + if FuncLoadError then + AFailed.Add('i2b_PrivateKey_bio'); + {$ifend} + end; + + + i2b_PublicKey_bio := LoadLibFunction(ADllHandle, i2b_PublicKey_bio_procname); + FuncLoadError := not assigned(i2b_PublicKey_bio); + if FuncLoadError then + begin + {$if not defined(i2b_PublicKey_bio_allownil)} + i2b_PublicKey_bio := @ERR_i2b_PublicKey_bio; + {$ifend} + {$if declared(i2b_PublicKey_bio_introduced)} + if LibVersion < i2b_PublicKey_bio_introduced then + begin + {$if declared(FC_i2b_PublicKey_bio)} + i2b_PublicKey_bio := @FC_i2b_PublicKey_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(i2b_PublicKey_bio_removed)} + if i2b_PublicKey_bio_removed <= LibVersion then + begin + {$if declared(_i2b_PublicKey_bio)} + i2b_PublicKey_bio := @_i2b_PublicKey_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(i2b_PublicKey_bio_allownil)} + if FuncLoadError then + AFailed.Add('i2b_PublicKey_bio'); + {$ifend} + end; + + + b2i_PVK_bio := LoadLibFunction(ADllHandle, b2i_PVK_bio_procname); + FuncLoadError := not assigned(b2i_PVK_bio); + if FuncLoadError then + begin + {$if not defined(b2i_PVK_bio_allownil)} + b2i_PVK_bio := @ERR_b2i_PVK_bio; + {$ifend} + {$if declared(b2i_PVK_bio_introduced)} + if LibVersion < b2i_PVK_bio_introduced then + begin + {$if declared(FC_b2i_PVK_bio)} + b2i_PVK_bio := @FC_b2i_PVK_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(b2i_PVK_bio_removed)} + if b2i_PVK_bio_removed <= LibVersion then + begin + {$if declared(_b2i_PVK_bio)} + b2i_PVK_bio := @_b2i_PVK_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(b2i_PVK_bio_allownil)} + if FuncLoadError then + AFailed.Add('b2i_PVK_bio'); + {$ifend} + end; + + + i2b_PVK_bio := LoadLibFunction(ADllHandle, i2b_PVK_bio_procname); + FuncLoadError := not assigned(i2b_PVK_bio); + if FuncLoadError then + begin + {$if not defined(i2b_PVK_bio_allownil)} + i2b_PVK_bio := @ERR_i2b_PVK_bio; + {$ifend} + {$if declared(i2b_PVK_bio_introduced)} + if LibVersion < i2b_PVK_bio_introduced then + begin + {$if declared(FC_i2b_PVK_bio)} + i2b_PVK_bio := @FC_i2b_PVK_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(i2b_PVK_bio_removed)} + if i2b_PVK_bio_removed <= LibVersion then + begin + {$if declared(_i2b_PVK_bio)} + i2b_PVK_bio := @_i2b_PVK_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(i2b_PVK_bio_allownil)} + if FuncLoadError then + AFailed.Add('i2b_PVK_bio'); + {$ifend} + end; + + +end; + +procedure Unload; +begin + PEM_get_EVP_CIPHER_INFO := nil; + PEM_do_header := nil; + PEM_read_bio := nil; + PEM_read_bio_ex := nil; {introduced 1.1.0} + PEM_bytes_read_bio_secmem := nil; {introduced 1.1.0} + PEM_write_bio := nil; + PEM_bytes_read_bio := nil; + PEM_ASN1_read_bio := nil; + PEM_ASN1_write_bio := nil; + PEM_X509_INFO_read_bio := nil; + PEM_X509_INFO_write_bio := nil; + PEM_SignInit := nil; + PEM_SignUpdate := nil; + PEM_SignFinal := nil; + PEM_def_callback := nil; + PEM_proc_type := nil; + PEM_dek_info := nil; + PEM_read_bio_X509 := nil; + PEM_write_bio_X509 := nil; + PEM_read_bio_X509_AUX := nil; + PEM_write_bio_X509_AUX := nil; + PEM_read_bio_X509_REQ := nil; + PEM_write_bio_X509_REQ := nil; + PEM_write_bio_X509_REQ_NEW := nil; + PEM_read_bio_X509_CRL := nil; + PEM_write_bio_X509_CRL := nil; + PEM_read_bio_PKCS7 := nil; + PEM_write_bio_PKCS7 := nil; + PEM_read_bio_PKCS8 := nil; + PEM_write_bio_PKCS8 := nil; + PEM_read_bio_PKCS8_PRIV_KEY_INFO := nil; + PEM_write_bio_PKCS8_PRIV_KEY_INFO := nil; + PEM_read_bio_RSAPrivateKey := nil; + PEM_write_bio_RSAPrivateKey := nil; + PEM_read_bio_RSAPublicKey := nil; + PEM_write_bio_RSAPublicKey := nil; + PEM_read_bio_RSA_PUBKEY := nil; + PEM_write_bio_RSA_PUBKEY := nil; + PEM_read_bio_DSAPrivateKey := nil; + PEM_write_bio_DSAPrivateKey := nil; + PEM_read_bio_DSA_PUBKEY := nil; + PEM_write_bio_DSA_PUBKEY := nil; + PEM_read_bio_DSAparams := nil; + PEM_write_bio_DSAparams := nil; + PEM_read_bio_ECPKParameters := nil; + PEM_write_bio_ECPKParameters := nil; + PEM_read_bio_ECPrivateKey := nil; + PEM_write_bio_ECPrivateKey := nil; + PEM_read_bio_EC_PUBKEY := nil; + PEM_write_bio_EC_PUBKEY := nil; + PEM_read_bio_DHparams := nil; + PEM_write_bio_DHparams := nil; + PEM_write_bio_DHxparams := nil; + PEM_read_bio_PrivateKey := nil; + PEM_write_bio_PrivateKey := nil; + PEM_read_bio_PUBKEY := nil; + PEM_write_bio_PUBKEY := nil; + PEM_write_bio_PrivateKey_traditional := nil; {introduced 1.1.0} + PEM_write_bio_PKCS8PrivateKey_nid := nil; + PEM_write_bio_PKCS8PrivateKey := nil; + i2d_PKCS8PrivateKey_bio := nil; + i2d_PKCS8PrivateKey_nid_bio := nil; + d2i_PKCS8PrivateKey_bio := nil; + PEM_read_bio_Parameters := nil; + PEM_write_bio_Parameters := nil; + b2i_PrivateKey := nil; + b2i_PublicKey := nil; + b2i_PrivateKey_bio := nil; + b2i_PublicKey_bio := nil; + i2b_PrivateKey_bio := nil; + i2b_PublicKey_bio := nil; + b2i_PVK_bio := nil; + i2b_PVK_bio := nil; +end; +{$ELSE} +{$ENDIF} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +initialization + Register_SSLLoader(@Load,'LibCrypto'); + Register_SSLUnloader(@Unload); +{$ENDIF} +end. diff --git a/IdOpenSSLHeaders_pemerr.pas b/IdOpenSSLHeaders_pemerr.pas new file mode 100644 index 0000000..b320993 --- /dev/null +++ b/IdOpenSSLHeaders_pemerr.pas @@ -0,0 +1,215 @@ + (* This unit was generated using the script genOpenSSLHdrs.sh from the source file IdOpenSSLHeaders_pemerr.h2pas + It should not be modified directly. All changes should be made to IdOpenSSLHeaders_pemerr.h2pas + and this file regenerated. IdOpenSSLHeaders_pemerr.h2pas is distributed with the full Indy + Distribution. + *) + +{$i IdCompilerDefines.inc} +{$i IdSSLOpenSSLDefines.inc} +{$IFNDEF USE_OPENSSL} + { error Should not compile if USE_OPENSSL is not defined!!!} +{$ENDIF} +{******************************************************************************} +{ } +{ Indy (Internet Direct) - Internet Protocols Simplified } +{ } +{ https://www.indyproject.org/ } +{ https://gitter.im/IndySockets/Indy } +{ } +{******************************************************************************} +{ } +{ This file is part of the Indy (Internet Direct) project, and is offered } +{ under the dual-licensing agreement described on the Indy website. } +{ (https://www.indyproject.org/license/) } +{ } +{ Copyright: } +{ (c) 1993-2020, Chad Z. Hower and the Indy Pit Crew. All rights reserved. } +{ } +{******************************************************************************} +{ } +{ } +{******************************************************************************} + +unit IdOpenSSLHeaders_pemerr; + +interface + +// Headers for OpenSSL 1.1.1 +// pemerr.h + + +uses + IdCTypes, + IdGlobal, + IdSSLOpenSSLConsts; + +const + // PEM function codes + PEM_F_B2I_DSS = 127; + PEM_F_B2I_PVK_BIO = 128; + PEM_F_B2I_RSA = 129; + PEM_F_CHECK_BITLEN_DSA = 130; + PEM_F_CHECK_BITLEN_RSA = 131; + PEM_F_D2I_PKCS8PRIVATEKEY_BIO = 120; + PEM_F_D2I_PKCS8PRIVATEKEY_FP = 121; + PEM_F_DO_B2I = 132; + PEM_F_DO_B2I_BIO = 133; + PEM_F_DO_BLOB_HEADER = 134; + PEM_F_DO_I2B = 146; + PEM_F_DO_PK8PKEY = 126; + PEM_F_DO_PK8PKEY_FP = 125; + PEM_F_DO_PVK_BODY = 135; + PEM_F_DO_PVK_HEADER = 136; + PEM_F_GET_HEADER_AND_DATA = 143; + PEM_F_GET_NAME = 144; + PEM_F_I2B_PVK = 137; + PEM_F_I2B_PVK_BIO = 138; + PEM_F_LOAD_IV = 101; + PEM_F_PEM_ASN1_READ = 102; + PEM_F_PEM_ASN1_READ_BIO = 103; + PEM_F_PEM_ASN1_WRITE = 104; + PEM_F_PEM_ASN1_WRITE_BIO = 105; + PEM_F_PEM_DEF_CALLBACK = 100; + PEM_F_PEM_DO_HEADER = 106; + PEM_F_PEM_GET_EVP_CIPHER_INFO = 107; + PEM_F_PEM_READ = 108; + PEM_F_PEM_READ_BIO = 109; + PEM_F_PEM_READ_BIO_DHPARAMS = 141; + PEM_F_PEM_READ_BIO_EX = 145; + PEM_F_PEM_READ_BIO_PARAMETERS = 140; + PEM_F_PEM_READ_BIO_PRIVATEKEY = 123; + PEM_F_PEM_READ_DHPARAMS = 142; + PEM_F_PEM_READ_PRIVATEKEY = 124; + PEM_F_PEM_SIGNFINAL = 112; + PEM_F_PEM_WRITE = 113; + PEM_F_PEM_WRITE_BIO = 114; + PEM_F_PEM_WRITE_PRIVATEKEY = 139; + PEM_F_PEM_X509_INFO_READ = 115; + PEM_F_PEM_X509_INFO_READ_BIO = 116; + PEM_F_PEM_X509_INFO_WRITE_BIO = 117; + // PEM reason codes + PEM_R_BAD_BASE64_DECODE = 100; + PEM_R_BAD_DECRYPT = 101; + PEM_R_BAD_END_LINE = 102; + PEM_R_BAD_IV_CHARS = 103; + PEM_R_BAD_MAGIC_NUMBER = 116; + PEM_R_BAD_PASSWORD_READ = 104; + PEM_R_BAD_VERSION_NUMBER = 117; + PEM_R_BIO_WRITE_FAILURE = 118; + PEM_R_CIPHER_IS_NULL = 127; + PEM_R_ERROR_CONVERTING_PRIVATE_KEY = 115; + PEM_R_EXPECTING_PRIVATE_KEY_BLOB = 119; + PEM_R_EXPECTING_PUBLIC_KEY_BLOB = 120; + PEM_R_HEADER_TOO_LONG = 128; + PEM_R_INCONSISTENT_HEADER = 121; + PEM_R_KEYBLOB_HEADER_PARSE_ERROR = 122; + PEM_R_KEYBLOB_TOO_SHORT = 123; + PEM_R_MISSING_DEK_IV = 129; + PEM_R_NOT_DEK_INFO = 105; + PEM_R_NOT_ENCRYPTED = 106; + PEM_R_NOT_PROC_TYPE = 107; + PEM_R_NO_START_LINE = 108; + PEM_R_PROBLEMS_GETTING_PASSWORD = 109; + PEM_R_PVK_DATA_TOO_SHORT = 124; + PEM_R_PVK_TOO_SHORT = 125; + PEM_R_READ_KEY = 111; + PEM_R_SHORT_HEADER = 112; + PEM_R_UNEXPECTED_DEK_IV = 130; + PEM_R_UNSUPPORTED_CIPHER = 113; + PEM_R_UNSUPPORTED_ENCRYPTION = 114; + PEM_R_UNSUPPORTED_KEY_COMPONENTS = 126; + + { The EXTERNALSYM directive is ignored by FPC, however, it is used by Delphi as follows: + + The EXTERNALSYM directive prevents the specified Delphi symbol from appearing in header + files generated for C++. } + + {$EXTERNALSYM ERR_load_PEM_strings} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +var + ERR_load_PEM_strings: function : TIdC_INT; cdecl = nil; + +{$ELSE} + function ERR_load_PEM_strings: TIdC_INT cdecl; external CLibCrypto; + +{$ENDIF} + +implementation + + uses + classes, + IdSSLOpenSSLExceptionHandlers, + IdResourceStringsOpenSSL + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + ,IdSSLOpenSSLLoader + {$ENDIF}; + + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +const + ERR_load_PEM_strings_procname = 'ERR_load_PEM_strings'; + + +{$WARN NO_RETVAL OFF} +function ERR_ERR_load_PEM_strings: TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ERR_load_PEM_strings_procname); +end; + + + +{$WARN NO_RETVAL ON} + +procedure Load(const ADllHandle: TIdLibHandle; LibVersion: TIdC_UINT; const AFailed: TStringList); + +var FuncLoadError: boolean; + +begin + ERR_load_PEM_strings := LoadLibFunction(ADllHandle, ERR_load_PEM_strings_procname); + FuncLoadError := not assigned(ERR_load_PEM_strings); + if FuncLoadError then + begin + {$if not defined(ERR_load_PEM_strings_allownil)} + ERR_load_PEM_strings := @ERR_ERR_load_PEM_strings; + {$ifend} + {$if declared(ERR_load_PEM_strings_introduced)} + if LibVersion < ERR_load_PEM_strings_introduced then + begin + {$if declared(FC_ERR_load_PEM_strings)} + ERR_load_PEM_strings := @FC_ERR_load_PEM_strings; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ERR_load_PEM_strings_removed)} + if ERR_load_PEM_strings_removed <= LibVersion then + begin + {$if declared(_ERR_load_PEM_strings)} + ERR_load_PEM_strings := @_ERR_load_PEM_strings; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ERR_load_PEM_strings_allownil)} + if FuncLoadError then + AFailed.Add('ERR_load_PEM_strings'); + {$ifend} + end; + + +end; + +procedure Unload; +begin + ERR_load_PEM_strings := nil; +end; +{$ELSE} +{$ENDIF} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +initialization + Register_SSLLoader(@Load,'LibCrypto'); + Register_SSLUnloader(@Unload); +{$ENDIF} +end. diff --git a/IdOpenSSLHeaders_pkcs12.pas b/IdOpenSSLHeaders_pkcs12.pas new file mode 100644 index 0000000..6e40b68 --- /dev/null +++ b/IdOpenSSLHeaders_pkcs12.pas @@ -0,0 +1,3264 @@ + (* This unit was generated using the script genOpenSSLHdrs.sh from the source file IdOpenSSLHeaders_pkcs12.h2pas + It should not be modified directly. All changes should be made to IdOpenSSLHeaders_pkcs12.h2pas + and this file regenerated. IdOpenSSLHeaders_pkcs12.h2pas is distributed with the full Indy + Distribution. + *) + +{$i IdCompilerDefines.inc} +{$i IdSSLOpenSSLDefines.inc} +{$IFNDEF USE_OPENSSL} + { error Should not compile if USE_OPENSSL is not defined!!!} +{$ENDIF} +{******************************************************************************} +{ } +{ Indy (Internet Direct) - Internet Protocols Simplified } +{ } +{ https://www.indyproject.org/ } +{ https://gitter.im/IndySockets/Indy } +{ } +{******************************************************************************} +{ } +{ This file is part of the Indy (Internet Direct) project, and is offered } +{ under the dual-licensing agreement described on the Indy website. } +{ (https://www.indyproject.org/license/) } +{ } +{ Copyright: } +{ (c) 1993-2020, Chad Z. Hower and the Indy Pit Crew. All rights reserved. } +{ } +{******************************************************************************} +{ } +{ } +{******************************************************************************} + +unit IdOpenSSLHeaders_pkcs12; + +interface + +// Headers for OpenSSL 1.1.1 +// pkcs12.h + + +uses + IdCTypes, + IdGlobal, + IdSSLOpenSSLConsts, + IdOpenSSLHeaders_ossl_typ, + IdOpenSSLHeaders_pkcs7, + IdOpenSSLHeaders_x509; + +const + PKCS12_KEY_ID = 1; + PKCS12_IV_ID = 2; + PKCS12_MAC_ID = 3; + + ///* Default iteration count */ + //# ifndef PKCS12_DEFAULT_ITER + //# define PKCS12_DEFAULT_ITER PKCS5_DEFAULT_ITER + //# endif + + PKCS12_MAC_KEY_LENGTH = 20; + + PKCS12_SALT_LEN = 8; + + ///* It's not clear if these are actually needed... */ + //# define PKCS12_key_gen PKCS12_key_gen_utf8 + //# define PKCS12_add_friendlyname PKCS12_add_friendlyname_utf8 + + (* MS key usage constants *) + KEY_EX = $10; + KEY_SIG = $80; + + PKCS12_ERROR = 0; + PKCS12_OK = 1; + +type + PKCS12_MAC_DATA_st = type Pointer; + PKCS12_MAC_DATA = PKCS12_MAC_DATA_st; + PPKCS12_MAC_DATA = ^PKCS12_MAC_DATA; + PPPKCS12_MAC_DATA = ^PPKCS12_MAC_DATA; + + PKCS12_st = type Pointer; + PKCS12 = PKCS12_st; + PPKCS12 = ^PKCS12; + PPPKCS12 = ^PPKCS12; + + PKCS12_SAFEBAG_st = type Pointer; + PKCS12_SAFEBAG = PKCS12_SAFEBAG_st; + PPKCS12_SAFEBAG = ^PKCS12_SAFEBAG; + PPPKCS12_SAFEBAG = ^PPKCS12_SAFEBAG; + +// DEFINE_STACK_OF(PKCS12_SAFEBAG) + + pkcs12_bag_st = type Pointer; + PKCS12_BAGS = pkcs12_bag_st; + PPKCS12_BAGS = ^PKCS12_BAGS; + PPPKCS12_BAGS = ^PPKCS12_BAGS; + + //ASN1_TYPE *PKCS8_get_attr(PKCS8_PRIV_KEY_INFO *p8, TIdC_INT attr_nid); + { The EXTERNALSYM directive is ignored by FPC, however, it is used by Delphi as follows: + + The EXTERNALSYM directive prevents the specified Delphi symbol from appearing in header + files generated for C++. } + + {$EXTERNALSYM PKCS12_mac_present} {introduced 1.1.0} + {$EXTERNALSYM PKCS12_get0_mac} {introduced 1.1.0} + {$EXTERNALSYM PKCS12_SAFEBAG_get0_attr} {introduced 1.1.0} + {$EXTERNALSYM PKCS12_SAFEBAG_get0_type} {introduced 1.1.0} + {$EXTERNALSYM PKCS12_SAFEBAG_get_nid} {introduced 1.1.0} + {$EXTERNALSYM PKCS12_SAFEBAG_get_bag_nid} {introduced 1.1.0} + {$EXTERNALSYM PKCS12_SAFEBAG_get1_cert} {introduced 1.1.0} + {$EXTERNALSYM PKCS12_SAFEBAG_get1_crl} {introduced 1.1.0} + {$EXTERNALSYM PKCS12_SAFEBAG_get0_p8inf} {introduced 1.1.0} + {$EXTERNALSYM PKCS12_SAFEBAG_get0_pkcs8} {introduced 1.1.0} + {$EXTERNALSYM PKCS12_SAFEBAG_create_cert} {introduced 1.1.0} + {$EXTERNALSYM PKCS12_SAFEBAG_create_crl} {introduced 1.1.0} + {$EXTERNALSYM PKCS12_SAFEBAG_create0_p8inf} {introduced 1.1.0} + {$EXTERNALSYM PKCS12_SAFEBAG_create0_pkcs8} {introduced 1.1.0} + {$EXTERNALSYM PKCS12_SAFEBAG_create_pkcs8_encrypt} {introduced 1.1.0} + {$EXTERNALSYM PKCS12_item_pack_safebag} + {$EXTERNALSYM PKCS8_decrypt} + {$EXTERNALSYM PKCS12_decrypt_skey} + {$EXTERNALSYM PKCS8_encrypt} + {$EXTERNALSYM PKCS8_set0_pbe} {introduced 1.1.0} + {$EXTERNALSYM PKCS12_add_localkeyid} + {$EXTERNALSYM PKCS12_add_friendlyname_asc} + {$EXTERNALSYM PKCS12_add_friendlyname_utf8} {introduced 1.1.0} + {$EXTERNALSYM PKCS12_add_CSPName_asc} + {$EXTERNALSYM PKCS12_add_friendlyname_uni} + {$EXTERNALSYM PKCS8_add_keyusage} + {$EXTERNALSYM PKCS12_get_friendlyname} + {$EXTERNALSYM PKCS12_pbe_crypt} + {$EXTERNALSYM PKCS12_item_decrypt_d2i} + {$EXTERNALSYM PKCS12_item_i2d_encrypt} + {$EXTERNALSYM PKCS12_init} + {$EXTERNALSYM PKCS12_key_gen_asc} + {$EXTERNALSYM PKCS12_key_gen_uni} + {$EXTERNALSYM PKCS12_key_gen_utf8} {introduced 1.1.0} + {$EXTERNALSYM PKCS12_PBE_keyivgen} + {$EXTERNALSYM PKCS12_gen_mac} + {$EXTERNALSYM PKCS12_verify_mac} + {$EXTERNALSYM PKCS12_set_mac} + {$EXTERNALSYM PKCS12_setup_mac} + {$EXTERNALSYM OPENSSL_asc2uni} + {$EXTERNALSYM OPENSSL_uni2asc} + {$EXTERNALSYM OPENSSL_utf82uni} {introduced 1.1.0} + {$EXTERNALSYM OPENSSL_uni2utf8} {introduced 1.1.0} + {$EXTERNALSYM PKCS12_new} + {$EXTERNALSYM PKCS12_free} + {$EXTERNALSYM d2i_PKCS12} + {$EXTERNALSYM i2d_PKCS12} + {$EXTERNALSYM PKCS12_it} + {$EXTERNALSYM PKCS12_MAC_DATA_new} + {$EXTERNALSYM PKCS12_MAC_DATA_free} + {$EXTERNALSYM d2i_PKCS12_MAC_DATA} + {$EXTERNALSYM i2d_PKCS12_MAC_DATA} + {$EXTERNALSYM PKCS12_MAC_DATA_it} + {$EXTERNALSYM PKCS12_SAFEBAG_new} + {$EXTERNALSYM PKCS12_SAFEBAG_free} + {$EXTERNALSYM d2i_PKCS12_SAFEBAG} + {$EXTERNALSYM i2d_PKCS12_SAFEBAG} + {$EXTERNALSYM PKCS12_SAFEBAG_it} + {$EXTERNALSYM PKCS12_BAGS_new} + {$EXTERNALSYM PKCS12_BAGS_free} + {$EXTERNALSYM d2i_PKCS12_BAGS} + {$EXTERNALSYM i2d_PKCS12_BAGS} + {$EXTERNALSYM PKCS12_BAGS_it} + {$EXTERNALSYM PKCS12_PBE_add} + {$EXTERNALSYM PKCS12_parse} + {$EXTERNALSYM PKCS12_create} + {$EXTERNALSYM i2d_PKCS12_bio} + {$EXTERNALSYM d2i_PKCS12_bio} + {$EXTERNALSYM PKCS12_newpass} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +var + PKCS12_mac_present: function (const p12: PPKCS12): TIdC_INT; cdecl = nil; {introduced 1.1.0} + PKCS12_get0_mac: procedure (const pmac: PPASN1_OCTET_STRING; const pmacalg: PPX509_ALGOR; const psalt: PPASN1_OCTET_STRING; const piter: PPASN1_INTEGER; const p12: PPKCS12); cdecl = nil; {introduced 1.1.0} + + PKCS12_SAFEBAG_get0_attr: function (const bag: PPKCS12_SAFEBAG; attr_nid: TIdC_INT): PASN1_TYPE; cdecl = nil; {introduced 1.1.0} + PKCS12_SAFEBAG_get0_type: function (const bag: PPKCS12_SAFEBAG): PASN1_OBJECT; cdecl = nil; {introduced 1.1.0} + PKCS12_SAFEBAG_get_nid: function (const bag: PPKCS12_SAFEBAG): TIdC_INT; cdecl = nil; {introduced 1.1.0} + PKCS12_SAFEBAG_get_bag_nid: function (const bag: PPKCS12_SAFEBAG): TIdC_INT; cdecl = nil; {introduced 1.1.0} + + PKCS12_SAFEBAG_get1_cert: function (const bag: PPKCS12_SAFEBAG): PX509; cdecl = nil; {introduced 1.1.0} + PKCS12_SAFEBAG_get1_crl: function (const bag: PPKCS12_SAFEBAG): PX509_CRL; cdecl = nil; {introduced 1.1.0} +// const STACK_OF(PKCS12_SAFEBAG) *PKCS12_SAFEBAG_get0_safes(const PKCS12_SAFEBAG *bag); + PKCS12_SAFEBAG_get0_p8inf: function (const bag: PPKCS12_SAFEBAG): PPKCS8_PRIV_KEY_INFO; cdecl = nil; {introduced 1.1.0} + PKCS12_SAFEBAG_get0_pkcs8: function (const bag: PPKCS12_SAFEBAG): PX509_SIG; cdecl = nil; {introduced 1.1.0} + + PKCS12_SAFEBAG_create_cert: function (x509: PX509): PPKCS12_SAFEBAG; cdecl = nil; {introduced 1.1.0} + PKCS12_SAFEBAG_create_crl: function (crl: PX509_CRL): PPKCS12_SAFEBAG; cdecl = nil; {introduced 1.1.0} + PKCS12_SAFEBAG_create0_p8inf: function (p8: PPKCS8_PRIV_KEY_INFO): PPKCS12_SAFEBAG; cdecl = nil; {introduced 1.1.0} + PKCS12_SAFEBAG_create0_pkcs8: function (p8: PX509_SIG): PPKCS12_SAFEBAG; cdecl = nil; {introduced 1.1.0} + PKCS12_SAFEBAG_create_pkcs8_encrypt: function (pbe_nid: TIdC_INT; const pass: PIdAnsiChar; passlen: TIdC_INT; salt: PByte; saltlen: TIdC_INT; iter: TIdC_INT; p8inf: PPKCS8_PRIV_KEY_INFO): PPKCS12_SAFEBAG; cdecl = nil; {introduced 1.1.0} + + PKCS12_item_pack_safebag: function (obj: Pointer; const it: PASN1_ITEM; nid1: TIdC_INT; nid2: TIdC_INT): PPKCS12_SAFEBAG; cdecl = nil; + PKCS8_decrypt: function (const p8: PX509_SIG; const pass: PIdAnsiChar; passlen: TIdC_INT): PPKCS8_PRIV_KEY_INFO; cdecl = nil; + PKCS12_decrypt_skey: function (const bag: PPKCS12_SAFEBAG; const pass: PIdAnsiChar; passlen: TIdC_INT): PPKCS8_PRIV_KEY_INFO; cdecl = nil; + PKCS8_encrypt: function (pbe_nid: TIdC_INT; const cipher: PEVP_CIPHER; const pass: PIdAnsiChar; passlen: TIdC_INT; salt: PByte; saltlen: TIdC_INT; iter: TIdC_INT; p8: PPKCS8_PRIV_KEY_INFO): PX509_SIG; cdecl = nil; + PKCS8_set0_pbe: function (const pass: PIdAnsiChar; passlen: TIdC_INT; p8inf: PPKCS8_PRIV_KEY_INFO; pbe: PX509_ALGOR): PX509_SIG; cdecl = nil; {introduced 1.1.0} +// PKCS7 *PKCS12_pack_p7data(STACK_OF(PKCS12_SAFEBAG) *sk); +// STACK_OF(PKCS12_SAFEBAG) *PKCS12_unpack_p7data(PKCS7 *p7); +// function PKCS12_pack_p7encdata(TIdC_INT pbe_nid, const PIdAnsiChar pass, TIdC_INT passlen, +// Byte *salt, TIdC_INT saltlen, TIdC_INT iter, +// STACK_OF(PKCS12_SAFEBAG) *bags): PPKCS7; +// STACK_OF(PKCS12_SAFEBAG) *PKCS12_unpack_p7encdata(PKCS7 *p7, const PIdAnsiChar *pass, +// TIdC_INT passlen); + +// TIdC_INT PKCS12_pack_authsafes(PKCS12 *p12, STACK_OF(PKCS7) *safes); +// STACK_OF(PKCS7) *PKCS12_unpack_authsafes(const PKCS12 *p12); + + PKCS12_add_localkeyid: function (bag: PPKCS12_SAFEBAG; name: PByte; namelen: TIdC_INT): TIdC_INT; cdecl = nil; + PKCS12_add_friendlyname_asc: function (bag: PPKCS12_SAFEBAG; const name: PIdAnsiChar; namelen: TIdC_INT): TIdC_INT; cdecl = nil; + PKCS12_add_friendlyname_utf8: function (bag: PPKCS12_SAFEBAG; const name: PIdAnsiChar; namelen: TIdC_INT): TIdC_INT; cdecl = nil; {introduced 1.1.0} + PKCS12_add_CSPName_asc: function (bag: PPKCS12_SAFEBAG; const name: PIdAnsiChar; namelen: TIdC_INT): TIdC_INT; cdecl = nil; + PKCS12_add_friendlyname_uni: function (bag: PPKCS12_SAFEBAG; const name: PByte; namelen: TIdC_INT): TIdC_INT; cdecl = nil; + PKCS8_add_keyusage: function (p8: PPKCS8_PRIV_KEY_INFO; usage: TIdC_INT): TIdC_INT; cdecl = nil; +// function PKCS12_get_attr_gen(const STACK_OF(X509_ATTRIBUTE) *attrs; TIdC_INT attr_nid): PASN1_TYPE; + PKCS12_get_friendlyname: function (bag: PPKCS12_SAFEBAG): PIdAnsiChar; cdecl = nil; +// const STACK_OF(X509_ATTRIBUTE) *PKCS12_SAFEBAG_get0_attrs(const PKCS12_SAFEBAG *bag); + PKCS12_pbe_crypt: function (const algor: PX509_ALGOR; const pass: PIdAnsiChar; passlen: TIdC_INT; const in_: PByte; inlen: TIdC_INT; data: PPByte; datalen: PIdC_INT; en_de: TIdC_INT): PByte; cdecl = nil; + PKCS12_item_decrypt_d2i: function (const algor: PX509_ALGOR; const it: PASN1_ITEM; const pass: PIdAnsiChar; passlen: TIdC_INT; const oct: PASN1_OCTET_STRING; zbuf: TIdC_INT): Pointer; cdecl = nil; + PKCS12_item_i2d_encrypt: function (algor: PX509_ALGOR; const it: PASN1_ITEM; const pass: PIdAnsiChar; passlen: TIdC_INT; obj: Pointer; zbuf: TIdC_INT): PASN1_OCTET_STRING; cdecl = nil; + PKCS12_init: function (mode: TIdC_INT): PPKCS12; cdecl = nil; + PKCS12_key_gen_asc: function (const pass: PIdAnsiChar; passlen: TIdC_INT; salt: PByte; saltlen: TIdC_INT; id: TIdC_INT; iter: TIdC_INT; n: TIdC_INT; out_: PByte; const md_type: PEVP_MD): TIdC_INT; cdecl = nil; + PKCS12_key_gen_uni: function (pass: PByte; passlen: TIdC_INT; salt: PByte; saltlen: TIdC_INT; id: TIdC_INT; iter: TIdC_INT; n: TIdC_INT; out_: PByte; const md_type: PEVP_MD): TIdC_INT; cdecl = nil; + PKCS12_key_gen_utf8: function (const pass: PIdAnsiChar; passlen: TIdC_INT; salt: PByte; saltlen: TIdC_INT; id: TIdC_INT; iter: TIdC_INT; n: TIdC_INT; out_: PByte; const md_type: PEVP_MD): TIdC_INT; cdecl = nil; {introduced 1.1.0} + PKCS12_PBE_keyivgen: function (ctx: PEVP_CIPHER_CTX; const pass: PIdAnsiChar; passlen: TIdC_INT; param: PASN1_TYPE; const cipher: PEVP_CIPHER; const md_type: PEVP_MD; en_de: TIdC_INT): TIdC_INT; cdecl = nil; + PKCS12_gen_mac: function (p12: PPKCS12; const pass: PIdAnsiChar; passlen: TIdC_INT; mac: PByte; maclen: PIdC_UINT): TIdC_INT; cdecl = nil; + PKCS12_verify_mac: function (p12: PPKCS12; const pass: PIdAnsiChar; passlen: TIdC_INT): TIdC_INT; cdecl = nil; + PKCS12_set_mac: function (p12: PPKCS12; const pass: PIdAnsiChar; passlen: TIdC_INT; salt: PByte; saltlen: TIdC_INT; iter: TIdC_INT; const md_type: PEVP_MD): TIdC_INT; cdecl = nil; + PKCS12_setup_mac: function (p12: PPKCS12; iter: TIdC_INT; salt: PByte; saltlen: TIdC_INT; const md_type: PEVP_MD): TIdC_INT; cdecl = nil; + OPENSSL_asc2uni: function (const asc: PIdAnsiChar; asclen: TIdC_INT; uni: PPByte; unilen: PIdC_INT): PByte; cdecl = nil; + OPENSSL_uni2asc: function (const uni: PByte; unilen: TIdC_INT): PIdAnsiChar; cdecl = nil; + OPENSSL_utf82uni: function (const asc: PIdAnsiChar; asclen: TIdC_INT; uni: PPByte; unilen: PIdC_INT): PByte; cdecl = nil; {introduced 1.1.0} + OPENSSL_uni2utf8: function (const uni: PByte; unilen: TIdC_INT): PIdAnsiChar; cdecl = nil; {introduced 1.1.0} + + PKCS12_new: function : PPKCS12; cdecl = nil; + PKCS12_free: procedure (a: PPKCS12); cdecl = nil; + d2i_PKCS12: function (a: PPPKCS12; const in_: PPByte; len: TIdC_LONG): PPKCS12; cdecl = nil; + i2d_PKCS12: function (a: PPKCS12; out_: PPByte): TIdC_INT; cdecl = nil; + PKCS12_it: function : PASN1_ITEM; cdecl = nil; + + PKCS12_MAC_DATA_new: function : PPKCS12_MAC_DATA; cdecl = nil; + PKCS12_MAC_DATA_free: procedure (a: PPKCS12_MAC_DATA); cdecl = nil; + d2i_PKCS12_MAC_DATA: function (a: PPPKCS12_MAC_DATA; const in_: PPByte; len: TIdC_LONG): PPKCS12_MAC_DATA; cdecl = nil; + i2d_PKCS12_MAC_DATA: function (a: PPKCS12_MAC_DATA; out_: PPByte): TIdC_INT; cdecl = nil; + PKCS12_MAC_DATA_it: function : PASN1_ITEM; cdecl = nil; + + PKCS12_SAFEBAG_new: function : PPKCS12_SAFEBAG; cdecl = nil; + PKCS12_SAFEBAG_free: procedure (a: PPKCS12_SAFEBAG); cdecl = nil; + d2i_PKCS12_SAFEBAG: function (a: PPPKCS12_SAFEBAG; const in_: PPByte; len: TIdC_LONG): PPKCS12_SAFEBAG; cdecl = nil; + i2d_PKCS12_SAFEBAG: function (a: PPKCS12_SAFEBAG; out_: PPByte): TIdC_INT; cdecl = nil; + PKCS12_SAFEBAG_it: function : PASN1_ITEM; cdecl = nil; + + PKCS12_BAGS_new: function : PPKCS12_BAGS; cdecl = nil; + PKCS12_BAGS_free: procedure (a: PPKCS12_BAGS); cdecl = nil; + d2i_PKCS12_BAGS: function (a: PPPKCS12_BAGS; const in_: PPByte; len: TIdC_LONG): PPKCS12_BAGS; cdecl = nil; + i2d_PKCS12_BAGS: function (a: PPKCS12_BAGS; out_: PPByte): TIdC_INT; cdecl = nil; + PKCS12_BAGS_it: function : PASN1_ITEM; cdecl = nil; + + PKCS12_PBE_add: procedure (v: Pointer); cdecl = nil; + PKCS12_parse: function (p12: PPKCS12; const pass: PIdAnsiChar; out pkey: PEVP_PKEY; out cert: PX509; ca: PPStack_Of_X509): TIdC_INT; cdecl = nil; + PKCS12_create: function (const pass: PIdAnsiChar; const name: PIdAnsiChar; pkey: PEVP_PKEY; cert: PX509; ca: PStack_Of_X509; nid_key: TIdC_INT; nid_cert: TIdC_INT; iter: TIdC_INT; mac_iter: TIdC_INT; keytype: TIdC_INT): PPKCS12; cdecl = nil; + +// function PKCS12_add_cert(STACK_OF(PKCS12_SAFEBAG) **pbags; X509 *cert): PKCS12_SAFEBAG; +// PKCS12_SAFEBAG *PKCS12_add_key(STACK_OF(PKCS12_SAFEBAG) **pbags; +// EVP_PKEY *key; TIdC_INT key_usage; iter: TIdC_INT; +// TIdC_INT key_nid; const pass: PIdAnsiChar); +// TIdC_INT PKCS12_add_safe(STACK_OF(PKCS7) **psafes; STACK_OF(PKCS12_SAFEBAG) *bags; +// TIdC_INT safe_nid; iter: TIdC_INT; const pass: PIdAnsiChar); +// PKCS12 *PKCS12_add_safes(STACK_OF(PKCS7) *safes; TIdC_INT p7_nid); + + i2d_PKCS12_bio: function (bp: PBIO; p12: PPKCS12): TIdC_INT; cdecl = nil; + d2i_PKCS12_bio: function (bp: PBIO; p12: PPPKCS12): PPKCS12; cdecl = nil; + PKCS12_newpass: function (p12: PPKCS12; const oldpass: PIdAnsiChar; const newpass: PIdAnsiChar): TIdC_INT; cdecl = nil; + +{$ELSE} + function PKCS12_mac_present(const p12: PPKCS12): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + procedure PKCS12_get0_mac(const pmac: PPASN1_OCTET_STRING; const pmacalg: PPX509_ALGOR; const psalt: PPASN1_OCTET_STRING; const piter: PPASN1_INTEGER; const p12: PPKCS12) cdecl; external CLibCrypto; {introduced 1.1.0} + + function PKCS12_SAFEBAG_get0_attr(const bag: PPKCS12_SAFEBAG; attr_nid: TIdC_INT): PASN1_TYPE cdecl; external CLibCrypto; {introduced 1.1.0} + function PKCS12_SAFEBAG_get0_type(const bag: PPKCS12_SAFEBAG): PASN1_OBJECT cdecl; external CLibCrypto; {introduced 1.1.0} + function PKCS12_SAFEBAG_get_nid(const bag: PPKCS12_SAFEBAG): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function PKCS12_SAFEBAG_get_bag_nid(const bag: PPKCS12_SAFEBAG): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + + function PKCS12_SAFEBAG_get1_cert(const bag: PPKCS12_SAFEBAG): PX509 cdecl; external CLibCrypto; {introduced 1.1.0} + function PKCS12_SAFEBAG_get1_crl(const bag: PPKCS12_SAFEBAG): PX509_CRL cdecl; external CLibCrypto; {introduced 1.1.0} +// const STACK_OF(PKCS12_SAFEBAG) *PKCS12_SAFEBAG_get0_safes(const PKCS12_SAFEBAG *bag); + function PKCS12_SAFEBAG_get0_p8inf(const bag: PPKCS12_SAFEBAG): PPKCS8_PRIV_KEY_INFO cdecl; external CLibCrypto; {introduced 1.1.0} + function PKCS12_SAFEBAG_get0_pkcs8(const bag: PPKCS12_SAFEBAG): PX509_SIG cdecl; external CLibCrypto; {introduced 1.1.0} + + function PKCS12_SAFEBAG_create_cert(x509: PX509): PPKCS12_SAFEBAG cdecl; external CLibCrypto; {introduced 1.1.0} + function PKCS12_SAFEBAG_create_crl(crl: PX509_CRL): PPKCS12_SAFEBAG cdecl; external CLibCrypto; {introduced 1.1.0} + function PKCS12_SAFEBAG_create0_p8inf(p8: PPKCS8_PRIV_KEY_INFO): PPKCS12_SAFEBAG cdecl; external CLibCrypto; {introduced 1.1.0} + function PKCS12_SAFEBAG_create0_pkcs8(p8: PX509_SIG): PPKCS12_SAFEBAG cdecl; external CLibCrypto; {introduced 1.1.0} + function PKCS12_SAFEBAG_create_pkcs8_encrypt(pbe_nid: TIdC_INT; const pass: PIdAnsiChar; passlen: TIdC_INT; salt: PByte; saltlen: TIdC_INT; iter: TIdC_INT; p8inf: PPKCS8_PRIV_KEY_INFO): PPKCS12_SAFEBAG cdecl; external CLibCrypto; {introduced 1.1.0} + + function PKCS12_item_pack_safebag(obj: Pointer; const it: PASN1_ITEM; nid1: TIdC_INT; nid2: TIdC_INT): PPKCS12_SAFEBAG cdecl; external CLibCrypto; + function PKCS8_decrypt(const p8: PX509_SIG; const pass: PIdAnsiChar; passlen: TIdC_INT): PPKCS8_PRIV_KEY_INFO cdecl; external CLibCrypto; + function PKCS12_decrypt_skey(const bag: PPKCS12_SAFEBAG; const pass: PIdAnsiChar; passlen: TIdC_INT): PPKCS8_PRIV_KEY_INFO cdecl; external CLibCrypto; + function PKCS8_encrypt(pbe_nid: TIdC_INT; const cipher: PEVP_CIPHER; const pass: PIdAnsiChar; passlen: TIdC_INT; salt: PByte; saltlen: TIdC_INT; iter: TIdC_INT; p8: PPKCS8_PRIV_KEY_INFO): PX509_SIG cdecl; external CLibCrypto; + function PKCS8_set0_pbe(const pass: PIdAnsiChar; passlen: TIdC_INT; p8inf: PPKCS8_PRIV_KEY_INFO; pbe: PX509_ALGOR): PX509_SIG cdecl; external CLibCrypto; {introduced 1.1.0} +// PKCS7 *PKCS12_pack_p7data(STACK_OF(PKCS12_SAFEBAG) *sk); +// STACK_OF(PKCS12_SAFEBAG) *PKCS12_unpack_p7data(PKCS7 *p7); +// function PKCS12_pack_p7encdata(TIdC_INT pbe_nid, const PIdAnsiChar pass, TIdC_INT passlen, +// Byte *salt, TIdC_INT saltlen, TIdC_INT iter, +// STACK_OF(PKCS12_SAFEBAG) *bags): PPKCS7; +// STACK_OF(PKCS12_SAFEBAG) *PKCS12_unpack_p7encdata(PKCS7 *p7, const PIdAnsiChar *pass, +// TIdC_INT passlen); + +// TIdC_INT PKCS12_pack_authsafes(PKCS12 *p12, STACK_OF(PKCS7) *safes); +// STACK_OF(PKCS7) *PKCS12_unpack_authsafes(const PKCS12 *p12); + + function PKCS12_add_localkeyid(bag: PPKCS12_SAFEBAG; name: PByte; namelen: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function PKCS12_add_friendlyname_asc(bag: PPKCS12_SAFEBAG; const name: PIdAnsiChar; namelen: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function PKCS12_add_friendlyname_utf8(bag: PPKCS12_SAFEBAG; const name: PIdAnsiChar; namelen: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function PKCS12_add_CSPName_asc(bag: PPKCS12_SAFEBAG; const name: PIdAnsiChar; namelen: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function PKCS12_add_friendlyname_uni(bag: PPKCS12_SAFEBAG; const name: PByte; namelen: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function PKCS8_add_keyusage(p8: PPKCS8_PRIV_KEY_INFO; usage: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; +// function PKCS12_get_attr_gen(const STACK_OF(X509_ATTRIBUTE) *attrs; TIdC_INT attr_nid): PASN1_TYPE; + function PKCS12_get_friendlyname(bag: PPKCS12_SAFEBAG): PIdAnsiChar cdecl; external CLibCrypto; +// const STACK_OF(X509_ATTRIBUTE) *PKCS12_SAFEBAG_get0_attrs(const PKCS12_SAFEBAG *bag); + function PKCS12_pbe_crypt(const algor: PX509_ALGOR; const pass: PIdAnsiChar; passlen: TIdC_INT; const in_: PByte; inlen: TIdC_INT; data: PPByte; datalen: PIdC_INT; en_de: TIdC_INT): PByte cdecl; external CLibCrypto; + function PKCS12_item_decrypt_d2i(const algor: PX509_ALGOR; const it: PASN1_ITEM; const pass: PIdAnsiChar; passlen: TIdC_INT; const oct: PASN1_OCTET_STRING; zbuf: TIdC_INT): Pointer cdecl; external CLibCrypto; + function PKCS12_item_i2d_encrypt(algor: PX509_ALGOR; const it: PASN1_ITEM; const pass: PIdAnsiChar; passlen: TIdC_INT; obj: Pointer; zbuf: TIdC_INT): PASN1_OCTET_STRING cdecl; external CLibCrypto; + function PKCS12_init(mode: TIdC_INT): PPKCS12 cdecl; external CLibCrypto; + function PKCS12_key_gen_asc(const pass: PIdAnsiChar; passlen: TIdC_INT; salt: PByte; saltlen: TIdC_INT; id: TIdC_INT; iter: TIdC_INT; n: TIdC_INT; out_: PByte; const md_type: PEVP_MD): TIdC_INT cdecl; external CLibCrypto; + function PKCS12_key_gen_uni(pass: PByte; passlen: TIdC_INT; salt: PByte; saltlen: TIdC_INT; id: TIdC_INT; iter: TIdC_INT; n: TIdC_INT; out_: PByte; const md_type: PEVP_MD): TIdC_INT cdecl; external CLibCrypto; + function PKCS12_key_gen_utf8(const pass: PIdAnsiChar; passlen: TIdC_INT; salt: PByte; saltlen: TIdC_INT; id: TIdC_INT; iter: TIdC_INT; n: TIdC_INT; out_: PByte; const md_type: PEVP_MD): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function PKCS12_PBE_keyivgen(ctx: PEVP_CIPHER_CTX; const pass: PIdAnsiChar; passlen: TIdC_INT; param: PASN1_TYPE; const cipher: PEVP_CIPHER; const md_type: PEVP_MD; en_de: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function PKCS12_gen_mac(p12: PPKCS12; const pass: PIdAnsiChar; passlen: TIdC_INT; mac: PByte; maclen: PIdC_UINT): TIdC_INT cdecl; external CLibCrypto; + function PKCS12_verify_mac(p12: PPKCS12; const pass: PIdAnsiChar; passlen: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function PKCS12_set_mac(p12: PPKCS12; const pass: PIdAnsiChar; passlen: TIdC_INT; salt: PByte; saltlen: TIdC_INT; iter: TIdC_INT; const md_type: PEVP_MD): TIdC_INT cdecl; external CLibCrypto; + function PKCS12_setup_mac(p12: PPKCS12; iter: TIdC_INT; salt: PByte; saltlen: TIdC_INT; const md_type: PEVP_MD): TIdC_INT cdecl; external CLibCrypto; + function OPENSSL_asc2uni(const asc: PIdAnsiChar; asclen: TIdC_INT; uni: PPByte; unilen: PIdC_INT): PByte cdecl; external CLibCrypto; + function OPENSSL_uni2asc(const uni: PByte; unilen: TIdC_INT): PIdAnsiChar cdecl; external CLibCrypto; + function OPENSSL_utf82uni(const asc: PIdAnsiChar; asclen: TIdC_INT; uni: PPByte; unilen: PIdC_INT): PByte cdecl; external CLibCrypto; {introduced 1.1.0} + function OPENSSL_uni2utf8(const uni: PByte; unilen: TIdC_INT): PIdAnsiChar cdecl; external CLibCrypto; {introduced 1.1.0} + + function PKCS12_new: PPKCS12 cdecl; external CLibCrypto; + procedure PKCS12_free(a: PPKCS12) cdecl; external CLibCrypto; + function d2i_PKCS12(a: PPPKCS12; const in_: PPByte; len: TIdC_LONG): PPKCS12 cdecl; external CLibCrypto; + function i2d_PKCS12(a: PPKCS12; out_: PPByte): TIdC_INT cdecl; external CLibCrypto; + function PKCS12_it: PASN1_ITEM cdecl; external CLibCrypto; + + function PKCS12_MAC_DATA_new: PPKCS12_MAC_DATA cdecl; external CLibCrypto; + procedure PKCS12_MAC_DATA_free(a: PPKCS12_MAC_DATA) cdecl; external CLibCrypto; + function d2i_PKCS12_MAC_DATA(a: PPPKCS12_MAC_DATA; const in_: PPByte; len: TIdC_LONG): PPKCS12_MAC_DATA cdecl; external CLibCrypto; + function i2d_PKCS12_MAC_DATA(a: PPKCS12_MAC_DATA; out_: PPByte): TIdC_INT cdecl; external CLibCrypto; + function PKCS12_MAC_DATA_it: PASN1_ITEM cdecl; external CLibCrypto; + + function PKCS12_SAFEBAG_new: PPKCS12_SAFEBAG cdecl; external CLibCrypto; + procedure PKCS12_SAFEBAG_free(a: PPKCS12_SAFEBAG) cdecl; external CLibCrypto; + function d2i_PKCS12_SAFEBAG(a: PPPKCS12_SAFEBAG; const in_: PPByte; len: TIdC_LONG): PPKCS12_SAFEBAG cdecl; external CLibCrypto; + function i2d_PKCS12_SAFEBAG(a: PPKCS12_SAFEBAG; out_: PPByte): TIdC_INT cdecl; external CLibCrypto; + function PKCS12_SAFEBAG_it: PASN1_ITEM cdecl; external CLibCrypto; + + function PKCS12_BAGS_new: PPKCS12_BAGS cdecl; external CLibCrypto; + procedure PKCS12_BAGS_free(a: PPKCS12_BAGS) cdecl; external CLibCrypto; + function d2i_PKCS12_BAGS(a: PPPKCS12_BAGS; const in_: PPByte; len: TIdC_LONG): PPKCS12_BAGS cdecl; external CLibCrypto; + function i2d_PKCS12_BAGS(a: PPKCS12_BAGS; out_: PPByte): TIdC_INT cdecl; external CLibCrypto; + function PKCS12_BAGS_it: PASN1_ITEM cdecl; external CLibCrypto; + + procedure PKCS12_PBE_add(v: Pointer) cdecl; external CLibCrypto; + function PKCS12_parse(p12: PPKCS12; const pass: PIdAnsiChar; out pkey: PEVP_PKEY; out cert: PX509; ca: PPStack_Of_X509): TIdC_INT cdecl; external CLibCrypto; + function PKCS12_create(const pass: PIdAnsiChar; const name: PIdAnsiChar; pkey: PEVP_PKEY; cert: PX509; ca: PStack_Of_X509; nid_key: TIdC_INT; nid_cert: TIdC_INT; iter: TIdC_INT; mac_iter: TIdC_INT; keytype: TIdC_INT): PPKCS12 cdecl; external CLibCrypto; + +// function PKCS12_add_cert(STACK_OF(PKCS12_SAFEBAG) **pbags; X509 *cert): PKCS12_SAFEBAG; +// PKCS12_SAFEBAG *PKCS12_add_key(STACK_OF(PKCS12_SAFEBAG) **pbags; +// EVP_PKEY *key; TIdC_INT key_usage; iter: TIdC_INT; +// TIdC_INT key_nid; const pass: PIdAnsiChar); +// TIdC_INT PKCS12_add_safe(STACK_OF(PKCS7) **psafes; STACK_OF(PKCS12_SAFEBAG) *bags; +// TIdC_INT safe_nid; iter: TIdC_INT; const pass: PIdAnsiChar); +// PKCS12 *PKCS12_add_safes(STACK_OF(PKCS7) *safes; TIdC_INT p7_nid); + + function i2d_PKCS12_bio(bp: PBIO; p12: PPKCS12): TIdC_INT cdecl; external CLibCrypto; + function d2i_PKCS12_bio(bp: PBIO; p12: PPPKCS12): PPKCS12 cdecl; external CLibCrypto; + function PKCS12_newpass(p12: PPKCS12; const oldpass: PIdAnsiChar; const newpass: PIdAnsiChar): TIdC_INT cdecl; external CLibCrypto; + +{$ENDIF} + +implementation + + uses + classes, + IdSSLOpenSSLExceptionHandlers, + IdResourceStringsOpenSSL + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + ,IdSSLOpenSSLLoader + {$ENDIF}; + +const + PKCS12_mac_present_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + PKCS12_get0_mac_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + PKCS12_SAFEBAG_get0_attr_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + PKCS12_SAFEBAG_get0_type_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + PKCS12_SAFEBAG_get_nid_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + PKCS12_SAFEBAG_get_bag_nid_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + PKCS12_SAFEBAG_get1_cert_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + PKCS12_SAFEBAG_get1_crl_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + PKCS12_SAFEBAG_get0_p8inf_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + PKCS12_SAFEBAG_get0_pkcs8_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + PKCS12_SAFEBAG_create_cert_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + PKCS12_SAFEBAG_create_crl_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + PKCS12_SAFEBAG_create0_p8inf_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + PKCS12_SAFEBAG_create0_pkcs8_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + PKCS12_SAFEBAG_create_pkcs8_encrypt_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + PKCS8_set0_pbe_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + PKCS12_add_friendlyname_utf8_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + PKCS12_key_gen_utf8_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + OPENSSL_utf82uni_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + OPENSSL_uni2utf8_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +const + PKCS12_mac_present_procname = 'PKCS12_mac_present'; {introduced 1.1.0} + PKCS12_get0_mac_procname = 'PKCS12_get0_mac'; {introduced 1.1.0} + + PKCS12_SAFEBAG_get0_attr_procname = 'PKCS12_SAFEBAG_get0_attr'; {introduced 1.1.0} + PKCS12_SAFEBAG_get0_type_procname = 'PKCS12_SAFEBAG_get0_type'; {introduced 1.1.0} + PKCS12_SAFEBAG_get_nid_procname = 'PKCS12_SAFEBAG_get_nid'; {introduced 1.1.0} + PKCS12_SAFEBAG_get_bag_nid_procname = 'PKCS12_SAFEBAG_get_bag_nid'; {introduced 1.1.0} + + PKCS12_SAFEBAG_get1_cert_procname = 'PKCS12_SAFEBAG_get1_cert'; {introduced 1.1.0} + PKCS12_SAFEBAG_get1_crl_procname = 'PKCS12_SAFEBAG_get1_crl'; {introduced 1.1.0} +// const STACK_OF(PKCS12_SAFEBAG) *PKCS12_SAFEBAG_get0_safes(const PKCS12_SAFEBAG *bag); + PKCS12_SAFEBAG_get0_p8inf_procname = 'PKCS12_SAFEBAG_get0_p8inf'; {introduced 1.1.0} + PKCS12_SAFEBAG_get0_pkcs8_procname = 'PKCS12_SAFEBAG_get0_pkcs8'; {introduced 1.1.0} + + PKCS12_SAFEBAG_create_cert_procname = 'PKCS12_SAFEBAG_create_cert'; {introduced 1.1.0} + PKCS12_SAFEBAG_create_crl_procname = 'PKCS12_SAFEBAG_create_crl'; {introduced 1.1.0} + PKCS12_SAFEBAG_create0_p8inf_procname = 'PKCS12_SAFEBAG_create0_p8inf'; {introduced 1.1.0} + PKCS12_SAFEBAG_create0_pkcs8_procname = 'PKCS12_SAFEBAG_create0_pkcs8'; {introduced 1.1.0} + PKCS12_SAFEBAG_create_pkcs8_encrypt_procname = 'PKCS12_SAFEBAG_create_pkcs8_encrypt'; {introduced 1.1.0} + + PKCS12_item_pack_safebag_procname = 'PKCS12_item_pack_safebag'; + PKCS8_decrypt_procname = 'PKCS8_decrypt'; + PKCS12_decrypt_skey_procname = 'PKCS12_decrypt_skey'; + PKCS8_encrypt_procname = 'PKCS8_encrypt'; + PKCS8_set0_pbe_procname = 'PKCS8_set0_pbe'; {introduced 1.1.0} +// PKCS7 *PKCS12_pack_p7data(STACK_OF(PKCS12_SAFEBAG) *sk); +// STACK_OF(PKCS12_SAFEBAG) *PKCS12_unpack_p7data(PKCS7 *p7); +// function PKCS12_pack_p7encdata(TIdC_INT pbe_nid, const PIdAnsiChar pass, TIdC_INT passlen, +// Byte *salt, TIdC_INT saltlen, TIdC_INT iter, +// STACK_OF(PKCS12_SAFEBAG) *bags): PPKCS7; +// STACK_OF(PKCS12_SAFEBAG) *PKCS12_unpack_p7encdata(PKCS7 *p7, const PIdAnsiChar *pass, +// TIdC_INT passlen); + +// TIdC_INT PKCS12_pack_authsafes(PKCS12 *p12, STACK_OF(PKCS7) *safes); +// STACK_OF(PKCS7) *PKCS12_unpack_authsafes(const PKCS12 *p12); + + PKCS12_add_localkeyid_procname = 'PKCS12_add_localkeyid'; + PKCS12_add_friendlyname_asc_procname = 'PKCS12_add_friendlyname_asc'; + PKCS12_add_friendlyname_utf8_procname = 'PKCS12_add_friendlyname_utf8'; {introduced 1.1.0} + PKCS12_add_CSPName_asc_procname = 'PKCS12_add_CSPName_asc'; + PKCS12_add_friendlyname_uni_procname = 'PKCS12_add_friendlyname_uni'; + PKCS8_add_keyusage_procname = 'PKCS8_add_keyusage'; +// function PKCS12_get_attr_gen(const STACK_OF(X509_ATTRIBUTE) *attrs; TIdC_INT attr_nid): PASN1_TYPE; + PKCS12_get_friendlyname_procname = 'PKCS12_get_friendlyname'; +// const STACK_OF(X509_ATTRIBUTE) *PKCS12_SAFEBAG_get0_attrs(const PKCS12_SAFEBAG *bag); + PKCS12_pbe_crypt_procname = 'PKCS12_pbe_crypt'; + PKCS12_item_decrypt_d2i_procname = 'PKCS12_item_decrypt_d2i'; + PKCS12_item_i2d_encrypt_procname = 'PKCS12_item_i2d_encrypt'; + PKCS12_init_procname = 'PKCS12_init'; + PKCS12_key_gen_asc_procname = 'PKCS12_key_gen_asc'; + PKCS12_key_gen_uni_procname = 'PKCS12_key_gen_uni'; + PKCS12_key_gen_utf8_procname = 'PKCS12_key_gen_utf8'; {introduced 1.1.0} + PKCS12_PBE_keyivgen_procname = 'PKCS12_PBE_keyivgen'; + PKCS12_gen_mac_procname = 'PKCS12_gen_mac'; + PKCS12_verify_mac_procname = 'PKCS12_verify_mac'; + PKCS12_set_mac_procname = 'PKCS12_set_mac'; + PKCS12_setup_mac_procname = 'PKCS12_setup_mac'; + OPENSSL_asc2uni_procname = 'OPENSSL_asc2uni'; + OPENSSL_uni2asc_procname = 'OPENSSL_uni2asc'; + OPENSSL_utf82uni_procname = 'OPENSSL_utf82uni'; {introduced 1.1.0} + OPENSSL_uni2utf8_procname = 'OPENSSL_uni2utf8'; {introduced 1.1.0} + + PKCS12_new_procname = 'PKCS12_new'; + PKCS12_free_procname = 'PKCS12_free'; + d2i_PKCS12_procname = 'd2i_PKCS12'; + i2d_PKCS12_procname = 'i2d_PKCS12'; + PKCS12_it_procname = 'PKCS12_it'; + + PKCS12_MAC_DATA_new_procname = 'PKCS12_MAC_DATA_new'; + PKCS12_MAC_DATA_free_procname = 'PKCS12_MAC_DATA_free'; + d2i_PKCS12_MAC_DATA_procname = 'd2i_PKCS12_MAC_DATA'; + i2d_PKCS12_MAC_DATA_procname = 'i2d_PKCS12_MAC_DATA'; + PKCS12_MAC_DATA_it_procname = 'PKCS12_MAC_DATA_it'; + + PKCS12_SAFEBAG_new_procname = 'PKCS12_SAFEBAG_new'; + PKCS12_SAFEBAG_free_procname = 'PKCS12_SAFEBAG_free'; + d2i_PKCS12_SAFEBAG_procname = 'd2i_PKCS12_SAFEBAG'; + i2d_PKCS12_SAFEBAG_procname = 'i2d_PKCS12_SAFEBAG'; + PKCS12_SAFEBAG_it_procname = 'PKCS12_SAFEBAG_it'; + + PKCS12_BAGS_new_procname = 'PKCS12_BAGS_new'; + PKCS12_BAGS_free_procname = 'PKCS12_BAGS_free'; + d2i_PKCS12_BAGS_procname = 'd2i_PKCS12_BAGS'; + i2d_PKCS12_BAGS_procname = 'i2d_PKCS12_BAGS'; + PKCS12_BAGS_it_procname = 'PKCS12_BAGS_it'; + + PKCS12_PBE_add_procname = 'PKCS12_PBE_add'; + PKCS12_parse_procname = 'PKCS12_parse'; + PKCS12_create_procname = 'PKCS12_create'; + +// function PKCS12_add_cert(STACK_OF(PKCS12_SAFEBAG) **pbags; X509 *cert): PKCS12_SAFEBAG; +// PKCS12_SAFEBAG *PKCS12_add_key(STACK_OF(PKCS12_SAFEBAG) **pbags; +// EVP_PKEY *key; TIdC_INT key_usage; iter: TIdC_INT; +// TIdC_INT key_nid; const pass: PIdAnsiChar); +// TIdC_INT PKCS12_add_safe(STACK_OF(PKCS7) **psafes; STACK_OF(PKCS12_SAFEBAG) *bags; +// TIdC_INT safe_nid; iter: TIdC_INT; const pass: PIdAnsiChar); +// PKCS12 *PKCS12_add_safes(STACK_OF(PKCS7) *safes; TIdC_INT p7_nid); + + i2d_PKCS12_bio_procname = 'i2d_PKCS12_bio'; + d2i_PKCS12_bio_procname = 'd2i_PKCS12_bio'; + PKCS12_newpass_procname = 'PKCS12_newpass'; + + +{$WARN NO_RETVAL OFF} +function ERR_PKCS12_mac_present(const p12: PPKCS12): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS12_mac_present_procname); +end; + + {introduced 1.1.0} +procedure ERR_PKCS12_get0_mac(const pmac: PPASN1_OCTET_STRING; const pmacalg: PPX509_ALGOR; const psalt: PPASN1_OCTET_STRING; const piter: PPASN1_INTEGER; const p12: PPKCS12); +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS12_get0_mac_procname); +end; + + {introduced 1.1.0} + +function ERR_PKCS12_SAFEBAG_get0_attr(const bag: PPKCS12_SAFEBAG; attr_nid: TIdC_INT): PASN1_TYPE; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS12_SAFEBAG_get0_attr_procname); +end; + + {introduced 1.1.0} +function ERR_PKCS12_SAFEBAG_get0_type(const bag: PPKCS12_SAFEBAG): PASN1_OBJECT; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS12_SAFEBAG_get0_type_procname); +end; + + {introduced 1.1.0} +function ERR_PKCS12_SAFEBAG_get_nid(const bag: PPKCS12_SAFEBAG): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS12_SAFEBAG_get_nid_procname); +end; + + {introduced 1.1.0} +function ERR_PKCS12_SAFEBAG_get_bag_nid(const bag: PPKCS12_SAFEBAG): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS12_SAFEBAG_get_bag_nid_procname); +end; + + {introduced 1.1.0} + +function ERR_PKCS12_SAFEBAG_get1_cert(const bag: PPKCS12_SAFEBAG): PX509; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS12_SAFEBAG_get1_cert_procname); +end; + + {introduced 1.1.0} +function ERR_PKCS12_SAFEBAG_get1_crl(const bag: PPKCS12_SAFEBAG): PX509_CRL; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS12_SAFEBAG_get1_crl_procname); +end; + + {introduced 1.1.0} +// const STACK_OF(PKCS12_SAFEBAG) *PKCS12_SAFEBAG_get0_safes(const PKCS12_SAFEBAG *bag); +function ERR_PKCS12_SAFEBAG_get0_p8inf(const bag: PPKCS12_SAFEBAG): PPKCS8_PRIV_KEY_INFO; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS12_SAFEBAG_get0_p8inf_procname); +end; + + {introduced 1.1.0} +function ERR_PKCS12_SAFEBAG_get0_pkcs8(const bag: PPKCS12_SAFEBAG): PX509_SIG; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS12_SAFEBAG_get0_pkcs8_procname); +end; + + {introduced 1.1.0} + +function ERR_PKCS12_SAFEBAG_create_cert(x509: PX509): PPKCS12_SAFEBAG; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS12_SAFEBAG_create_cert_procname); +end; + + {introduced 1.1.0} +function ERR_PKCS12_SAFEBAG_create_crl(crl: PX509_CRL): PPKCS12_SAFEBAG; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS12_SAFEBAG_create_crl_procname); +end; + + {introduced 1.1.0} +function ERR_PKCS12_SAFEBAG_create0_p8inf(p8: PPKCS8_PRIV_KEY_INFO): PPKCS12_SAFEBAG; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS12_SAFEBAG_create0_p8inf_procname); +end; + + {introduced 1.1.0} +function ERR_PKCS12_SAFEBAG_create0_pkcs8(p8: PX509_SIG): PPKCS12_SAFEBAG; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS12_SAFEBAG_create0_pkcs8_procname); +end; + + {introduced 1.1.0} +function ERR_PKCS12_SAFEBAG_create_pkcs8_encrypt(pbe_nid: TIdC_INT; const pass: PIdAnsiChar; passlen: TIdC_INT; salt: PByte; saltlen: TIdC_INT; iter: TIdC_INT; p8inf: PPKCS8_PRIV_KEY_INFO): PPKCS12_SAFEBAG; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS12_SAFEBAG_create_pkcs8_encrypt_procname); +end; + + {introduced 1.1.0} + +function ERR_PKCS12_item_pack_safebag(obj: Pointer; const it: PASN1_ITEM; nid1: TIdC_INT; nid2: TIdC_INT): PPKCS12_SAFEBAG; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS12_item_pack_safebag_procname); +end; + + +function ERR_PKCS8_decrypt(const p8: PX509_SIG; const pass: PIdAnsiChar; passlen: TIdC_INT): PPKCS8_PRIV_KEY_INFO; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS8_decrypt_procname); +end; + + +function ERR_PKCS12_decrypt_skey(const bag: PPKCS12_SAFEBAG; const pass: PIdAnsiChar; passlen: TIdC_INT): PPKCS8_PRIV_KEY_INFO; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS12_decrypt_skey_procname); +end; + + +function ERR_PKCS8_encrypt(pbe_nid: TIdC_INT; const cipher: PEVP_CIPHER; const pass: PIdAnsiChar; passlen: TIdC_INT; salt: PByte; saltlen: TIdC_INT; iter: TIdC_INT; p8: PPKCS8_PRIV_KEY_INFO): PX509_SIG; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS8_encrypt_procname); +end; + + +function ERR_PKCS8_set0_pbe(const pass: PIdAnsiChar; passlen: TIdC_INT; p8inf: PPKCS8_PRIV_KEY_INFO; pbe: PX509_ALGOR): PX509_SIG; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS8_set0_pbe_procname); +end; + + {introduced 1.1.0} +// PKCS7 *PKCS12_pack_p7data(STACK_OF(PKCS12_SAFEBAG) *sk); +// STACK_OF(PKCS12_SAFEBAG) *PKCS12_unpack_p7data(PKCS7 *p7); +// function PKCS12_pack_p7encdata(TIdC_INT pbe_nid, const PIdAnsiChar pass, TIdC_INT passlen, +// Byte *salt, TIdC_INT saltlen, TIdC_INT iter, +// STACK_OF(PKCS12_SAFEBAG) *bags): PPKCS7; +// STACK_OF(PKCS12_SAFEBAG) *PKCS12_unpack_p7encdata(PKCS7 *p7, const PIdAnsiChar *pass, +// TIdC_INT passlen); + +// TIdC_INT PKCS12_pack_authsafes(PKCS12 *p12, STACK_OF(PKCS7) *safes); +// STACK_OF(PKCS7) *PKCS12_unpack_authsafes(const PKCS12 *p12); + +function ERR_PKCS12_add_localkeyid(bag: PPKCS12_SAFEBAG; name: PByte; namelen: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS12_add_localkeyid_procname); +end; + + +function ERR_PKCS12_add_friendlyname_asc(bag: PPKCS12_SAFEBAG; const name: PIdAnsiChar; namelen: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS12_add_friendlyname_asc_procname); +end; + + +function ERR_PKCS12_add_friendlyname_utf8(bag: PPKCS12_SAFEBAG; const name: PIdAnsiChar; namelen: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS12_add_friendlyname_utf8_procname); +end; + + {introduced 1.1.0} +function ERR_PKCS12_add_CSPName_asc(bag: PPKCS12_SAFEBAG; const name: PIdAnsiChar; namelen: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS12_add_CSPName_asc_procname); +end; + + +function ERR_PKCS12_add_friendlyname_uni(bag: PPKCS12_SAFEBAG; const name: PByte; namelen: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS12_add_friendlyname_uni_procname); +end; + + +function ERR_PKCS8_add_keyusage(p8: PPKCS8_PRIV_KEY_INFO; usage: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS8_add_keyusage_procname); +end; + + +// function PKCS12_get_attr_gen(const STACK_OF(X509_ATTRIBUTE) *attrs; TIdC_INT attr_nid): PASN1_TYPE; +function ERR_PKCS12_get_friendlyname(bag: PPKCS12_SAFEBAG): PIdAnsiChar; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS12_get_friendlyname_procname); +end; + + +// const STACK_OF(X509_ATTRIBUTE) *PKCS12_SAFEBAG_get0_attrs(const PKCS12_SAFEBAG *bag); +function ERR_PKCS12_pbe_crypt(const algor: PX509_ALGOR; const pass: PIdAnsiChar; passlen: TIdC_INT; const in_: PByte; inlen: TIdC_INT; data: PPByte; datalen: PIdC_INT; en_de: TIdC_INT): PByte; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS12_pbe_crypt_procname); +end; + + +function ERR_PKCS12_item_decrypt_d2i(const algor: PX509_ALGOR; const it: PASN1_ITEM; const pass: PIdAnsiChar; passlen: TIdC_INT; const oct: PASN1_OCTET_STRING; zbuf: TIdC_INT): Pointer; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS12_item_decrypt_d2i_procname); +end; + + +function ERR_PKCS12_item_i2d_encrypt(algor: PX509_ALGOR; const it: PASN1_ITEM; const pass: PIdAnsiChar; passlen: TIdC_INT; obj: Pointer; zbuf: TIdC_INT): PASN1_OCTET_STRING; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS12_item_i2d_encrypt_procname); +end; + + +function ERR_PKCS12_init(mode: TIdC_INT): PPKCS12; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS12_init_procname); +end; + + +function ERR_PKCS12_key_gen_asc(const pass: PIdAnsiChar; passlen: TIdC_INT; salt: PByte; saltlen: TIdC_INT; id: TIdC_INT; iter: TIdC_INT; n: TIdC_INT; out_: PByte; const md_type: PEVP_MD): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS12_key_gen_asc_procname); +end; + + +function ERR_PKCS12_key_gen_uni(pass: PByte; passlen: TIdC_INT; salt: PByte; saltlen: TIdC_INT; id: TIdC_INT; iter: TIdC_INT; n: TIdC_INT; out_: PByte; const md_type: PEVP_MD): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS12_key_gen_uni_procname); +end; + + +function ERR_PKCS12_key_gen_utf8(const pass: PIdAnsiChar; passlen: TIdC_INT; salt: PByte; saltlen: TIdC_INT; id: TIdC_INT; iter: TIdC_INT; n: TIdC_INT; out_: PByte; const md_type: PEVP_MD): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS12_key_gen_utf8_procname); +end; + + {introduced 1.1.0} +function ERR_PKCS12_PBE_keyivgen(ctx: PEVP_CIPHER_CTX; const pass: PIdAnsiChar; passlen: TIdC_INT; param: PASN1_TYPE; const cipher: PEVP_CIPHER; const md_type: PEVP_MD; en_de: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS12_PBE_keyivgen_procname); +end; + + +function ERR_PKCS12_gen_mac(p12: PPKCS12; const pass: PIdAnsiChar; passlen: TIdC_INT; mac: PByte; maclen: PIdC_UINT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS12_gen_mac_procname); +end; + + +function ERR_PKCS12_verify_mac(p12: PPKCS12; const pass: PIdAnsiChar; passlen: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS12_verify_mac_procname); +end; + + +function ERR_PKCS12_set_mac(p12: PPKCS12; const pass: PIdAnsiChar; passlen: TIdC_INT; salt: PByte; saltlen: TIdC_INT; iter: TIdC_INT; const md_type: PEVP_MD): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS12_set_mac_procname); +end; + + +function ERR_PKCS12_setup_mac(p12: PPKCS12; iter: TIdC_INT; salt: PByte; saltlen: TIdC_INT; const md_type: PEVP_MD): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS12_setup_mac_procname); +end; + + +function ERR_OPENSSL_asc2uni(const asc: PIdAnsiChar; asclen: TIdC_INT; uni: PPByte; unilen: PIdC_INT): PByte; +begin + EIdAPIFunctionNotPresent.RaiseException(OPENSSL_asc2uni_procname); +end; + + +function ERR_OPENSSL_uni2asc(const uni: PByte; unilen: TIdC_INT): PIdAnsiChar; +begin + EIdAPIFunctionNotPresent.RaiseException(OPENSSL_uni2asc_procname); +end; + + +function ERR_OPENSSL_utf82uni(const asc: PIdAnsiChar; asclen: TIdC_INT; uni: PPByte; unilen: PIdC_INT): PByte; +begin + EIdAPIFunctionNotPresent.RaiseException(OPENSSL_utf82uni_procname); +end; + + {introduced 1.1.0} +function ERR_OPENSSL_uni2utf8(const uni: PByte; unilen: TIdC_INT): PIdAnsiChar; +begin + EIdAPIFunctionNotPresent.RaiseException(OPENSSL_uni2utf8_procname); +end; + + {introduced 1.1.0} + +function ERR_PKCS12_new: PPKCS12; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS12_new_procname); +end; + + +procedure ERR_PKCS12_free(a: PPKCS12); +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS12_free_procname); +end; + + +function ERR_d2i_PKCS12(a: PPPKCS12; const in_: PPByte; len: TIdC_LONG): PPKCS12; +begin + EIdAPIFunctionNotPresent.RaiseException(d2i_PKCS12_procname); +end; + + +function ERR_i2d_PKCS12(a: PPKCS12; out_: PPByte): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(i2d_PKCS12_procname); +end; + + +function ERR_PKCS12_it: PASN1_ITEM; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS12_it_procname); +end; + + + +function ERR_PKCS12_MAC_DATA_new: PPKCS12_MAC_DATA; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS12_MAC_DATA_new_procname); +end; + + +procedure ERR_PKCS12_MAC_DATA_free(a: PPKCS12_MAC_DATA); +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS12_MAC_DATA_free_procname); +end; + + +function ERR_d2i_PKCS12_MAC_DATA(a: PPPKCS12_MAC_DATA; const in_: PPByte; len: TIdC_LONG): PPKCS12_MAC_DATA; +begin + EIdAPIFunctionNotPresent.RaiseException(d2i_PKCS12_MAC_DATA_procname); +end; + + +function ERR_i2d_PKCS12_MAC_DATA(a: PPKCS12_MAC_DATA; out_: PPByte): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(i2d_PKCS12_MAC_DATA_procname); +end; + + +function ERR_PKCS12_MAC_DATA_it: PASN1_ITEM; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS12_MAC_DATA_it_procname); +end; + + + +function ERR_PKCS12_SAFEBAG_new: PPKCS12_SAFEBAG; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS12_SAFEBAG_new_procname); +end; + + +procedure ERR_PKCS12_SAFEBAG_free(a: PPKCS12_SAFEBAG); +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS12_SAFEBAG_free_procname); +end; + + +function ERR_d2i_PKCS12_SAFEBAG(a: PPPKCS12_SAFEBAG; const in_: PPByte; len: TIdC_LONG): PPKCS12_SAFEBAG; +begin + EIdAPIFunctionNotPresent.RaiseException(d2i_PKCS12_SAFEBAG_procname); +end; + + +function ERR_i2d_PKCS12_SAFEBAG(a: PPKCS12_SAFEBAG; out_: PPByte): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(i2d_PKCS12_SAFEBAG_procname); +end; + + +function ERR_PKCS12_SAFEBAG_it: PASN1_ITEM; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS12_SAFEBAG_it_procname); +end; + + + +function ERR_PKCS12_BAGS_new: PPKCS12_BAGS; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS12_BAGS_new_procname); +end; + + +procedure ERR_PKCS12_BAGS_free(a: PPKCS12_BAGS); +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS12_BAGS_free_procname); +end; + + +function ERR_d2i_PKCS12_BAGS(a: PPPKCS12_BAGS; const in_: PPByte; len: TIdC_LONG): PPKCS12_BAGS; +begin + EIdAPIFunctionNotPresent.RaiseException(d2i_PKCS12_BAGS_procname); +end; + + +function ERR_i2d_PKCS12_BAGS(a: PPKCS12_BAGS; out_: PPByte): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(i2d_PKCS12_BAGS_procname); +end; + + +function ERR_PKCS12_BAGS_it: PASN1_ITEM; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS12_BAGS_it_procname); +end; + + + +procedure ERR_PKCS12_PBE_add(v: Pointer); +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS12_PBE_add_procname); +end; + + +function ERR_PKCS12_parse(p12: PPKCS12; const pass: PIdAnsiChar; out pkey: PEVP_PKEY; out cert: PX509; ca: PPStack_Of_X509): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS12_parse_procname); +end; + + +function ERR_PKCS12_create(const pass: PIdAnsiChar; const name: PIdAnsiChar; pkey: PEVP_PKEY; cert: PX509; ca: PStack_Of_X509; nid_key: TIdC_INT; nid_cert: TIdC_INT; iter: TIdC_INT; mac_iter: TIdC_INT; keytype: TIdC_INT): PPKCS12; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS12_create_procname); +end; + + + +// function PKCS12_add_cert(STACK_OF(PKCS12_SAFEBAG) **pbags; X509 *cert): PKCS12_SAFEBAG; +// PKCS12_SAFEBAG *PKCS12_add_key(STACK_OF(PKCS12_SAFEBAG) **pbags; +// EVP_PKEY *key; TIdC_INT key_usage; iter: TIdC_INT; +// TIdC_INT key_nid; const pass: PIdAnsiChar); +// TIdC_INT PKCS12_add_safe(STACK_OF(PKCS7) **psafes; STACK_OF(PKCS12_SAFEBAG) *bags; +// TIdC_INT safe_nid; iter: TIdC_INT; const pass: PIdAnsiChar); +// PKCS12 *PKCS12_add_safes(STACK_OF(PKCS7) *safes; TIdC_INT p7_nid); + +function ERR_i2d_PKCS12_bio(bp: PBIO; p12: PPKCS12): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(i2d_PKCS12_bio_procname); +end; + + +function ERR_d2i_PKCS12_bio(bp: PBIO; p12: PPPKCS12): PPKCS12; +begin + EIdAPIFunctionNotPresent.RaiseException(d2i_PKCS12_bio_procname); +end; + + +function ERR_PKCS12_newpass(p12: PPKCS12; const oldpass: PIdAnsiChar; const newpass: PIdAnsiChar): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS12_newpass_procname); +end; + + + +{$WARN NO_RETVAL ON} + +procedure Load(const ADllHandle: TIdLibHandle; LibVersion: TIdC_UINT; const AFailed: TStringList); + +var FuncLoadError: boolean; + +begin + PKCS12_mac_present := LoadLibFunction(ADllHandle, PKCS12_mac_present_procname); + FuncLoadError := not assigned(PKCS12_mac_present); + if FuncLoadError then + begin + {$if not defined(PKCS12_mac_present_allownil)} + PKCS12_mac_present := @ERR_PKCS12_mac_present; + {$ifend} + {$if declared(PKCS12_mac_present_introduced)} + if LibVersion < PKCS12_mac_present_introduced then + begin + {$if declared(FC_PKCS12_mac_present)} + PKCS12_mac_present := @FC_PKCS12_mac_present; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS12_mac_present_removed)} + if PKCS12_mac_present_removed <= LibVersion then + begin + {$if declared(_PKCS12_mac_present)} + PKCS12_mac_present := @_PKCS12_mac_present; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS12_mac_present_allownil)} + if FuncLoadError then + AFailed.Add('PKCS12_mac_present'); + {$ifend} + end; + + {introduced 1.1.0} + PKCS12_get0_mac := LoadLibFunction(ADllHandle, PKCS12_get0_mac_procname); + FuncLoadError := not assigned(PKCS12_get0_mac); + if FuncLoadError then + begin + {$if not defined(PKCS12_get0_mac_allownil)} + PKCS12_get0_mac := @ERR_PKCS12_get0_mac; + {$ifend} + {$if declared(PKCS12_get0_mac_introduced)} + if LibVersion < PKCS12_get0_mac_introduced then + begin + {$if declared(FC_PKCS12_get0_mac)} + PKCS12_get0_mac := @FC_PKCS12_get0_mac; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS12_get0_mac_removed)} + if PKCS12_get0_mac_removed <= LibVersion then + begin + {$if declared(_PKCS12_get0_mac)} + PKCS12_get0_mac := @_PKCS12_get0_mac; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS12_get0_mac_allownil)} + if FuncLoadError then + AFailed.Add('PKCS12_get0_mac'); + {$ifend} + end; + + {introduced 1.1.0} + PKCS12_SAFEBAG_get0_attr := LoadLibFunction(ADllHandle, PKCS12_SAFEBAG_get0_attr_procname); + FuncLoadError := not assigned(PKCS12_SAFEBAG_get0_attr); + if FuncLoadError then + begin + {$if not defined(PKCS12_SAFEBAG_get0_attr_allownil)} + PKCS12_SAFEBAG_get0_attr := @ERR_PKCS12_SAFEBAG_get0_attr; + {$ifend} + {$if declared(PKCS12_SAFEBAG_get0_attr_introduced)} + if LibVersion < PKCS12_SAFEBAG_get0_attr_introduced then + begin + {$if declared(FC_PKCS12_SAFEBAG_get0_attr)} + PKCS12_SAFEBAG_get0_attr := @FC_PKCS12_SAFEBAG_get0_attr; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS12_SAFEBAG_get0_attr_removed)} + if PKCS12_SAFEBAG_get0_attr_removed <= LibVersion then + begin + {$if declared(_PKCS12_SAFEBAG_get0_attr)} + PKCS12_SAFEBAG_get0_attr := @_PKCS12_SAFEBAG_get0_attr; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS12_SAFEBAG_get0_attr_allownil)} + if FuncLoadError then + AFailed.Add('PKCS12_SAFEBAG_get0_attr'); + {$ifend} + end; + + {introduced 1.1.0} + PKCS12_SAFEBAG_get0_type := LoadLibFunction(ADllHandle, PKCS12_SAFEBAG_get0_type_procname); + FuncLoadError := not assigned(PKCS12_SAFEBAG_get0_type); + if FuncLoadError then + begin + {$if not defined(PKCS12_SAFEBAG_get0_type_allownil)} + PKCS12_SAFEBAG_get0_type := @ERR_PKCS12_SAFEBAG_get0_type; + {$ifend} + {$if declared(PKCS12_SAFEBAG_get0_type_introduced)} + if LibVersion < PKCS12_SAFEBAG_get0_type_introduced then + begin + {$if declared(FC_PKCS12_SAFEBAG_get0_type)} + PKCS12_SAFEBAG_get0_type := @FC_PKCS12_SAFEBAG_get0_type; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS12_SAFEBAG_get0_type_removed)} + if PKCS12_SAFEBAG_get0_type_removed <= LibVersion then + begin + {$if declared(_PKCS12_SAFEBAG_get0_type)} + PKCS12_SAFEBAG_get0_type := @_PKCS12_SAFEBAG_get0_type; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS12_SAFEBAG_get0_type_allownil)} + if FuncLoadError then + AFailed.Add('PKCS12_SAFEBAG_get0_type'); + {$ifend} + end; + + {introduced 1.1.0} + PKCS12_SAFEBAG_get_nid := LoadLibFunction(ADllHandle, PKCS12_SAFEBAG_get_nid_procname); + FuncLoadError := not assigned(PKCS12_SAFEBAG_get_nid); + if FuncLoadError then + begin + {$if not defined(PKCS12_SAFEBAG_get_nid_allownil)} + PKCS12_SAFEBAG_get_nid := @ERR_PKCS12_SAFEBAG_get_nid; + {$ifend} + {$if declared(PKCS12_SAFEBAG_get_nid_introduced)} + if LibVersion < PKCS12_SAFEBAG_get_nid_introduced then + begin + {$if declared(FC_PKCS12_SAFEBAG_get_nid)} + PKCS12_SAFEBAG_get_nid := @FC_PKCS12_SAFEBAG_get_nid; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS12_SAFEBAG_get_nid_removed)} + if PKCS12_SAFEBAG_get_nid_removed <= LibVersion then + begin + {$if declared(_PKCS12_SAFEBAG_get_nid)} + PKCS12_SAFEBAG_get_nid := @_PKCS12_SAFEBAG_get_nid; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS12_SAFEBAG_get_nid_allownil)} + if FuncLoadError then + AFailed.Add('PKCS12_SAFEBAG_get_nid'); + {$ifend} + end; + + {introduced 1.1.0} + PKCS12_SAFEBAG_get_bag_nid := LoadLibFunction(ADllHandle, PKCS12_SAFEBAG_get_bag_nid_procname); + FuncLoadError := not assigned(PKCS12_SAFEBAG_get_bag_nid); + if FuncLoadError then + begin + {$if not defined(PKCS12_SAFEBAG_get_bag_nid_allownil)} + PKCS12_SAFEBAG_get_bag_nid := @ERR_PKCS12_SAFEBAG_get_bag_nid; + {$ifend} + {$if declared(PKCS12_SAFEBAG_get_bag_nid_introduced)} + if LibVersion < PKCS12_SAFEBAG_get_bag_nid_introduced then + begin + {$if declared(FC_PKCS12_SAFEBAG_get_bag_nid)} + PKCS12_SAFEBAG_get_bag_nid := @FC_PKCS12_SAFEBAG_get_bag_nid; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS12_SAFEBAG_get_bag_nid_removed)} + if PKCS12_SAFEBAG_get_bag_nid_removed <= LibVersion then + begin + {$if declared(_PKCS12_SAFEBAG_get_bag_nid)} + PKCS12_SAFEBAG_get_bag_nid := @_PKCS12_SAFEBAG_get_bag_nid; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS12_SAFEBAG_get_bag_nid_allownil)} + if FuncLoadError then + AFailed.Add('PKCS12_SAFEBAG_get_bag_nid'); + {$ifend} + end; + + {introduced 1.1.0} + PKCS12_SAFEBAG_get1_cert := LoadLibFunction(ADllHandle, PKCS12_SAFEBAG_get1_cert_procname); + FuncLoadError := not assigned(PKCS12_SAFEBAG_get1_cert); + if FuncLoadError then + begin + {$if not defined(PKCS12_SAFEBAG_get1_cert_allownil)} + PKCS12_SAFEBAG_get1_cert := @ERR_PKCS12_SAFEBAG_get1_cert; + {$ifend} + {$if declared(PKCS12_SAFEBAG_get1_cert_introduced)} + if LibVersion < PKCS12_SAFEBAG_get1_cert_introduced then + begin + {$if declared(FC_PKCS12_SAFEBAG_get1_cert)} + PKCS12_SAFEBAG_get1_cert := @FC_PKCS12_SAFEBAG_get1_cert; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS12_SAFEBAG_get1_cert_removed)} + if PKCS12_SAFEBAG_get1_cert_removed <= LibVersion then + begin + {$if declared(_PKCS12_SAFEBAG_get1_cert)} + PKCS12_SAFEBAG_get1_cert := @_PKCS12_SAFEBAG_get1_cert; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS12_SAFEBAG_get1_cert_allownil)} + if FuncLoadError then + AFailed.Add('PKCS12_SAFEBAG_get1_cert'); + {$ifend} + end; + + {introduced 1.1.0} + PKCS12_SAFEBAG_get1_crl := LoadLibFunction(ADllHandle, PKCS12_SAFEBAG_get1_crl_procname); + FuncLoadError := not assigned(PKCS12_SAFEBAG_get1_crl); + if FuncLoadError then + begin + {$if not defined(PKCS12_SAFEBAG_get1_crl_allownil)} + PKCS12_SAFEBAG_get1_crl := @ERR_PKCS12_SAFEBAG_get1_crl; + {$ifend} + {$if declared(PKCS12_SAFEBAG_get1_crl_introduced)} + if LibVersion < PKCS12_SAFEBAG_get1_crl_introduced then + begin + {$if declared(FC_PKCS12_SAFEBAG_get1_crl)} + PKCS12_SAFEBAG_get1_crl := @FC_PKCS12_SAFEBAG_get1_crl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS12_SAFEBAG_get1_crl_removed)} + if PKCS12_SAFEBAG_get1_crl_removed <= LibVersion then + begin + {$if declared(_PKCS12_SAFEBAG_get1_crl)} + PKCS12_SAFEBAG_get1_crl := @_PKCS12_SAFEBAG_get1_crl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS12_SAFEBAG_get1_crl_allownil)} + if FuncLoadError then + AFailed.Add('PKCS12_SAFEBAG_get1_crl'); + {$ifend} + end; + + {introduced 1.1.0} + PKCS12_SAFEBAG_get0_p8inf := LoadLibFunction(ADllHandle, PKCS12_SAFEBAG_get0_p8inf_procname); + FuncLoadError := not assigned(PKCS12_SAFEBAG_get0_p8inf); + if FuncLoadError then + begin + {$if not defined(PKCS12_SAFEBAG_get0_p8inf_allownil)} + PKCS12_SAFEBAG_get0_p8inf := @ERR_PKCS12_SAFEBAG_get0_p8inf; + {$ifend} + {$if declared(PKCS12_SAFEBAG_get0_p8inf_introduced)} + if LibVersion < PKCS12_SAFEBAG_get0_p8inf_introduced then + begin + {$if declared(FC_PKCS12_SAFEBAG_get0_p8inf)} + PKCS12_SAFEBAG_get0_p8inf := @FC_PKCS12_SAFEBAG_get0_p8inf; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS12_SAFEBAG_get0_p8inf_removed)} + if PKCS12_SAFEBAG_get0_p8inf_removed <= LibVersion then + begin + {$if declared(_PKCS12_SAFEBAG_get0_p8inf)} + PKCS12_SAFEBAG_get0_p8inf := @_PKCS12_SAFEBAG_get0_p8inf; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS12_SAFEBAG_get0_p8inf_allownil)} + if FuncLoadError then + AFailed.Add('PKCS12_SAFEBAG_get0_p8inf'); + {$ifend} + end; + + {introduced 1.1.0} + PKCS12_SAFEBAG_get0_pkcs8 := LoadLibFunction(ADllHandle, PKCS12_SAFEBAG_get0_pkcs8_procname); + FuncLoadError := not assigned(PKCS12_SAFEBAG_get0_pkcs8); + if FuncLoadError then + begin + {$if not defined(PKCS12_SAFEBAG_get0_pkcs8_allownil)} + PKCS12_SAFEBAG_get0_pkcs8 := @ERR_PKCS12_SAFEBAG_get0_pkcs8; + {$ifend} + {$if declared(PKCS12_SAFEBAG_get0_pkcs8_introduced)} + if LibVersion < PKCS12_SAFEBAG_get0_pkcs8_introduced then + begin + {$if declared(FC_PKCS12_SAFEBAG_get0_pkcs8)} + PKCS12_SAFEBAG_get0_pkcs8 := @FC_PKCS12_SAFEBAG_get0_pkcs8; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS12_SAFEBAG_get0_pkcs8_removed)} + if PKCS12_SAFEBAG_get0_pkcs8_removed <= LibVersion then + begin + {$if declared(_PKCS12_SAFEBAG_get0_pkcs8)} + PKCS12_SAFEBAG_get0_pkcs8 := @_PKCS12_SAFEBAG_get0_pkcs8; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS12_SAFEBAG_get0_pkcs8_allownil)} + if FuncLoadError then + AFailed.Add('PKCS12_SAFEBAG_get0_pkcs8'); + {$ifend} + end; + + {introduced 1.1.0} + PKCS12_SAFEBAG_create_cert := LoadLibFunction(ADllHandle, PKCS12_SAFEBAG_create_cert_procname); + FuncLoadError := not assigned(PKCS12_SAFEBAG_create_cert); + if FuncLoadError then + begin + {$if not defined(PKCS12_SAFEBAG_create_cert_allownil)} + PKCS12_SAFEBAG_create_cert := @ERR_PKCS12_SAFEBAG_create_cert; + {$ifend} + {$if declared(PKCS12_SAFEBAG_create_cert_introduced)} + if LibVersion < PKCS12_SAFEBAG_create_cert_introduced then + begin + {$if declared(FC_PKCS12_SAFEBAG_create_cert)} + PKCS12_SAFEBAG_create_cert := @FC_PKCS12_SAFEBAG_create_cert; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS12_SAFEBAG_create_cert_removed)} + if PKCS12_SAFEBAG_create_cert_removed <= LibVersion then + begin + {$if declared(_PKCS12_SAFEBAG_create_cert)} + PKCS12_SAFEBAG_create_cert := @_PKCS12_SAFEBAG_create_cert; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS12_SAFEBAG_create_cert_allownil)} + if FuncLoadError then + AFailed.Add('PKCS12_SAFEBAG_create_cert'); + {$ifend} + end; + + {introduced 1.1.0} + PKCS12_SAFEBAG_create_crl := LoadLibFunction(ADllHandle, PKCS12_SAFEBAG_create_crl_procname); + FuncLoadError := not assigned(PKCS12_SAFEBAG_create_crl); + if FuncLoadError then + begin + {$if not defined(PKCS12_SAFEBAG_create_crl_allownil)} + PKCS12_SAFEBAG_create_crl := @ERR_PKCS12_SAFEBAG_create_crl; + {$ifend} + {$if declared(PKCS12_SAFEBAG_create_crl_introduced)} + if LibVersion < PKCS12_SAFEBAG_create_crl_introduced then + begin + {$if declared(FC_PKCS12_SAFEBAG_create_crl)} + PKCS12_SAFEBAG_create_crl := @FC_PKCS12_SAFEBAG_create_crl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS12_SAFEBAG_create_crl_removed)} + if PKCS12_SAFEBAG_create_crl_removed <= LibVersion then + begin + {$if declared(_PKCS12_SAFEBAG_create_crl)} + PKCS12_SAFEBAG_create_crl := @_PKCS12_SAFEBAG_create_crl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS12_SAFEBAG_create_crl_allownil)} + if FuncLoadError then + AFailed.Add('PKCS12_SAFEBAG_create_crl'); + {$ifend} + end; + + {introduced 1.1.0} + PKCS12_SAFEBAG_create0_p8inf := LoadLibFunction(ADllHandle, PKCS12_SAFEBAG_create0_p8inf_procname); + FuncLoadError := not assigned(PKCS12_SAFEBAG_create0_p8inf); + if FuncLoadError then + begin + {$if not defined(PKCS12_SAFEBAG_create0_p8inf_allownil)} + PKCS12_SAFEBAG_create0_p8inf := @ERR_PKCS12_SAFEBAG_create0_p8inf; + {$ifend} + {$if declared(PKCS12_SAFEBAG_create0_p8inf_introduced)} + if LibVersion < PKCS12_SAFEBAG_create0_p8inf_introduced then + begin + {$if declared(FC_PKCS12_SAFEBAG_create0_p8inf)} + PKCS12_SAFEBAG_create0_p8inf := @FC_PKCS12_SAFEBAG_create0_p8inf; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS12_SAFEBAG_create0_p8inf_removed)} + if PKCS12_SAFEBAG_create0_p8inf_removed <= LibVersion then + begin + {$if declared(_PKCS12_SAFEBAG_create0_p8inf)} + PKCS12_SAFEBAG_create0_p8inf := @_PKCS12_SAFEBAG_create0_p8inf; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS12_SAFEBAG_create0_p8inf_allownil)} + if FuncLoadError then + AFailed.Add('PKCS12_SAFEBAG_create0_p8inf'); + {$ifend} + end; + + {introduced 1.1.0} + PKCS12_SAFEBAG_create0_pkcs8 := LoadLibFunction(ADllHandle, PKCS12_SAFEBAG_create0_pkcs8_procname); + FuncLoadError := not assigned(PKCS12_SAFEBAG_create0_pkcs8); + if FuncLoadError then + begin + {$if not defined(PKCS12_SAFEBAG_create0_pkcs8_allownil)} + PKCS12_SAFEBAG_create0_pkcs8 := @ERR_PKCS12_SAFEBAG_create0_pkcs8; + {$ifend} + {$if declared(PKCS12_SAFEBAG_create0_pkcs8_introduced)} + if LibVersion < PKCS12_SAFEBAG_create0_pkcs8_introduced then + begin + {$if declared(FC_PKCS12_SAFEBAG_create0_pkcs8)} + PKCS12_SAFEBAG_create0_pkcs8 := @FC_PKCS12_SAFEBAG_create0_pkcs8; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS12_SAFEBAG_create0_pkcs8_removed)} + if PKCS12_SAFEBAG_create0_pkcs8_removed <= LibVersion then + begin + {$if declared(_PKCS12_SAFEBAG_create0_pkcs8)} + PKCS12_SAFEBAG_create0_pkcs8 := @_PKCS12_SAFEBAG_create0_pkcs8; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS12_SAFEBAG_create0_pkcs8_allownil)} + if FuncLoadError then + AFailed.Add('PKCS12_SAFEBAG_create0_pkcs8'); + {$ifend} + end; + + {introduced 1.1.0} + PKCS12_SAFEBAG_create_pkcs8_encrypt := LoadLibFunction(ADllHandle, PKCS12_SAFEBAG_create_pkcs8_encrypt_procname); + FuncLoadError := not assigned(PKCS12_SAFEBAG_create_pkcs8_encrypt); + if FuncLoadError then + begin + {$if not defined(PKCS12_SAFEBAG_create_pkcs8_encrypt_allownil)} + PKCS12_SAFEBAG_create_pkcs8_encrypt := @ERR_PKCS12_SAFEBAG_create_pkcs8_encrypt; + {$ifend} + {$if declared(PKCS12_SAFEBAG_create_pkcs8_encrypt_introduced)} + if LibVersion < PKCS12_SAFEBAG_create_pkcs8_encrypt_introduced then + begin + {$if declared(FC_PKCS12_SAFEBAG_create_pkcs8_encrypt)} + PKCS12_SAFEBAG_create_pkcs8_encrypt := @FC_PKCS12_SAFEBAG_create_pkcs8_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS12_SAFEBAG_create_pkcs8_encrypt_removed)} + if PKCS12_SAFEBAG_create_pkcs8_encrypt_removed <= LibVersion then + begin + {$if declared(_PKCS12_SAFEBAG_create_pkcs8_encrypt)} + PKCS12_SAFEBAG_create_pkcs8_encrypt := @_PKCS12_SAFEBAG_create_pkcs8_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS12_SAFEBAG_create_pkcs8_encrypt_allownil)} + if FuncLoadError then + AFailed.Add('PKCS12_SAFEBAG_create_pkcs8_encrypt'); + {$ifend} + end; + + {introduced 1.1.0} + PKCS12_item_pack_safebag := LoadLibFunction(ADllHandle, PKCS12_item_pack_safebag_procname); + FuncLoadError := not assigned(PKCS12_item_pack_safebag); + if FuncLoadError then + begin + {$if not defined(PKCS12_item_pack_safebag_allownil)} + PKCS12_item_pack_safebag := @ERR_PKCS12_item_pack_safebag; + {$ifend} + {$if declared(PKCS12_item_pack_safebag_introduced)} + if LibVersion < PKCS12_item_pack_safebag_introduced then + begin + {$if declared(FC_PKCS12_item_pack_safebag)} + PKCS12_item_pack_safebag := @FC_PKCS12_item_pack_safebag; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS12_item_pack_safebag_removed)} + if PKCS12_item_pack_safebag_removed <= LibVersion then + begin + {$if declared(_PKCS12_item_pack_safebag)} + PKCS12_item_pack_safebag := @_PKCS12_item_pack_safebag; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS12_item_pack_safebag_allownil)} + if FuncLoadError then + AFailed.Add('PKCS12_item_pack_safebag'); + {$ifend} + end; + + + PKCS8_decrypt := LoadLibFunction(ADllHandle, PKCS8_decrypt_procname); + FuncLoadError := not assigned(PKCS8_decrypt); + if FuncLoadError then + begin + {$if not defined(PKCS8_decrypt_allownil)} + PKCS8_decrypt := @ERR_PKCS8_decrypt; + {$ifend} + {$if declared(PKCS8_decrypt_introduced)} + if LibVersion < PKCS8_decrypt_introduced then + begin + {$if declared(FC_PKCS8_decrypt)} + PKCS8_decrypt := @FC_PKCS8_decrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS8_decrypt_removed)} + if PKCS8_decrypt_removed <= LibVersion then + begin + {$if declared(_PKCS8_decrypt)} + PKCS8_decrypt := @_PKCS8_decrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS8_decrypt_allownil)} + if FuncLoadError then + AFailed.Add('PKCS8_decrypt'); + {$ifend} + end; + + + PKCS12_decrypt_skey := LoadLibFunction(ADllHandle, PKCS12_decrypt_skey_procname); + FuncLoadError := not assigned(PKCS12_decrypt_skey); + if FuncLoadError then + begin + {$if not defined(PKCS12_decrypt_skey_allownil)} + PKCS12_decrypt_skey := @ERR_PKCS12_decrypt_skey; + {$ifend} + {$if declared(PKCS12_decrypt_skey_introduced)} + if LibVersion < PKCS12_decrypt_skey_introduced then + begin + {$if declared(FC_PKCS12_decrypt_skey)} + PKCS12_decrypt_skey := @FC_PKCS12_decrypt_skey; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS12_decrypt_skey_removed)} + if PKCS12_decrypt_skey_removed <= LibVersion then + begin + {$if declared(_PKCS12_decrypt_skey)} + PKCS12_decrypt_skey := @_PKCS12_decrypt_skey; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS12_decrypt_skey_allownil)} + if FuncLoadError then + AFailed.Add('PKCS12_decrypt_skey'); + {$ifend} + end; + + + PKCS8_encrypt := LoadLibFunction(ADllHandle, PKCS8_encrypt_procname); + FuncLoadError := not assigned(PKCS8_encrypt); + if FuncLoadError then + begin + {$if not defined(PKCS8_encrypt_allownil)} + PKCS8_encrypt := @ERR_PKCS8_encrypt; + {$ifend} + {$if declared(PKCS8_encrypt_introduced)} + if LibVersion < PKCS8_encrypt_introduced then + begin + {$if declared(FC_PKCS8_encrypt)} + PKCS8_encrypt := @FC_PKCS8_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS8_encrypt_removed)} + if PKCS8_encrypt_removed <= LibVersion then + begin + {$if declared(_PKCS8_encrypt)} + PKCS8_encrypt := @_PKCS8_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS8_encrypt_allownil)} + if FuncLoadError then + AFailed.Add('PKCS8_encrypt'); + {$ifend} + end; + + + PKCS8_set0_pbe := LoadLibFunction(ADllHandle, PKCS8_set0_pbe_procname); + FuncLoadError := not assigned(PKCS8_set0_pbe); + if FuncLoadError then + begin + {$if not defined(PKCS8_set0_pbe_allownil)} + PKCS8_set0_pbe := @ERR_PKCS8_set0_pbe; + {$ifend} + {$if declared(PKCS8_set0_pbe_introduced)} + if LibVersion < PKCS8_set0_pbe_introduced then + begin + {$if declared(FC_PKCS8_set0_pbe)} + PKCS8_set0_pbe := @FC_PKCS8_set0_pbe; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS8_set0_pbe_removed)} + if PKCS8_set0_pbe_removed <= LibVersion then + begin + {$if declared(_PKCS8_set0_pbe)} + PKCS8_set0_pbe := @_PKCS8_set0_pbe; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS8_set0_pbe_allownil)} + if FuncLoadError then + AFailed.Add('PKCS8_set0_pbe'); + {$ifend} + end; + + {introduced 1.1.0} + PKCS12_add_localkeyid := LoadLibFunction(ADllHandle, PKCS12_add_localkeyid_procname); + FuncLoadError := not assigned(PKCS12_add_localkeyid); + if FuncLoadError then + begin + {$if not defined(PKCS12_add_localkeyid_allownil)} + PKCS12_add_localkeyid := @ERR_PKCS12_add_localkeyid; + {$ifend} + {$if declared(PKCS12_add_localkeyid_introduced)} + if LibVersion < PKCS12_add_localkeyid_introduced then + begin + {$if declared(FC_PKCS12_add_localkeyid)} + PKCS12_add_localkeyid := @FC_PKCS12_add_localkeyid; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS12_add_localkeyid_removed)} + if PKCS12_add_localkeyid_removed <= LibVersion then + begin + {$if declared(_PKCS12_add_localkeyid)} + PKCS12_add_localkeyid := @_PKCS12_add_localkeyid; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS12_add_localkeyid_allownil)} + if FuncLoadError then + AFailed.Add('PKCS12_add_localkeyid'); + {$ifend} + end; + + + PKCS12_add_friendlyname_asc := LoadLibFunction(ADllHandle, PKCS12_add_friendlyname_asc_procname); + FuncLoadError := not assigned(PKCS12_add_friendlyname_asc); + if FuncLoadError then + begin + {$if not defined(PKCS12_add_friendlyname_asc_allownil)} + PKCS12_add_friendlyname_asc := @ERR_PKCS12_add_friendlyname_asc; + {$ifend} + {$if declared(PKCS12_add_friendlyname_asc_introduced)} + if LibVersion < PKCS12_add_friendlyname_asc_introduced then + begin + {$if declared(FC_PKCS12_add_friendlyname_asc)} + PKCS12_add_friendlyname_asc := @FC_PKCS12_add_friendlyname_asc; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS12_add_friendlyname_asc_removed)} + if PKCS12_add_friendlyname_asc_removed <= LibVersion then + begin + {$if declared(_PKCS12_add_friendlyname_asc)} + PKCS12_add_friendlyname_asc := @_PKCS12_add_friendlyname_asc; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS12_add_friendlyname_asc_allownil)} + if FuncLoadError then + AFailed.Add('PKCS12_add_friendlyname_asc'); + {$ifend} + end; + + + PKCS12_add_friendlyname_utf8 := LoadLibFunction(ADllHandle, PKCS12_add_friendlyname_utf8_procname); + FuncLoadError := not assigned(PKCS12_add_friendlyname_utf8); + if FuncLoadError then + begin + {$if not defined(PKCS12_add_friendlyname_utf8_allownil)} + PKCS12_add_friendlyname_utf8 := @ERR_PKCS12_add_friendlyname_utf8; + {$ifend} + {$if declared(PKCS12_add_friendlyname_utf8_introduced)} + if LibVersion < PKCS12_add_friendlyname_utf8_introduced then + begin + {$if declared(FC_PKCS12_add_friendlyname_utf8)} + PKCS12_add_friendlyname_utf8 := @FC_PKCS12_add_friendlyname_utf8; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS12_add_friendlyname_utf8_removed)} + if PKCS12_add_friendlyname_utf8_removed <= LibVersion then + begin + {$if declared(_PKCS12_add_friendlyname_utf8)} + PKCS12_add_friendlyname_utf8 := @_PKCS12_add_friendlyname_utf8; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS12_add_friendlyname_utf8_allownil)} + if FuncLoadError then + AFailed.Add('PKCS12_add_friendlyname_utf8'); + {$ifend} + end; + + {introduced 1.1.0} + PKCS12_add_CSPName_asc := LoadLibFunction(ADllHandle, PKCS12_add_CSPName_asc_procname); + FuncLoadError := not assigned(PKCS12_add_CSPName_asc); + if FuncLoadError then + begin + {$if not defined(PKCS12_add_CSPName_asc_allownil)} + PKCS12_add_CSPName_asc := @ERR_PKCS12_add_CSPName_asc; + {$ifend} + {$if declared(PKCS12_add_CSPName_asc_introduced)} + if LibVersion < PKCS12_add_CSPName_asc_introduced then + begin + {$if declared(FC_PKCS12_add_CSPName_asc)} + PKCS12_add_CSPName_asc := @FC_PKCS12_add_CSPName_asc; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS12_add_CSPName_asc_removed)} + if PKCS12_add_CSPName_asc_removed <= LibVersion then + begin + {$if declared(_PKCS12_add_CSPName_asc)} + PKCS12_add_CSPName_asc := @_PKCS12_add_CSPName_asc; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS12_add_CSPName_asc_allownil)} + if FuncLoadError then + AFailed.Add('PKCS12_add_CSPName_asc'); + {$ifend} + end; + + + PKCS12_add_friendlyname_uni := LoadLibFunction(ADllHandle, PKCS12_add_friendlyname_uni_procname); + FuncLoadError := not assigned(PKCS12_add_friendlyname_uni); + if FuncLoadError then + begin + {$if not defined(PKCS12_add_friendlyname_uni_allownil)} + PKCS12_add_friendlyname_uni := @ERR_PKCS12_add_friendlyname_uni; + {$ifend} + {$if declared(PKCS12_add_friendlyname_uni_introduced)} + if LibVersion < PKCS12_add_friendlyname_uni_introduced then + begin + {$if declared(FC_PKCS12_add_friendlyname_uni)} + PKCS12_add_friendlyname_uni := @FC_PKCS12_add_friendlyname_uni; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS12_add_friendlyname_uni_removed)} + if PKCS12_add_friendlyname_uni_removed <= LibVersion then + begin + {$if declared(_PKCS12_add_friendlyname_uni)} + PKCS12_add_friendlyname_uni := @_PKCS12_add_friendlyname_uni; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS12_add_friendlyname_uni_allownil)} + if FuncLoadError then + AFailed.Add('PKCS12_add_friendlyname_uni'); + {$ifend} + end; + + + PKCS8_add_keyusage := LoadLibFunction(ADllHandle, PKCS8_add_keyusage_procname); + FuncLoadError := not assigned(PKCS8_add_keyusage); + if FuncLoadError then + begin + {$if not defined(PKCS8_add_keyusage_allownil)} + PKCS8_add_keyusage := @ERR_PKCS8_add_keyusage; + {$ifend} + {$if declared(PKCS8_add_keyusage_introduced)} + if LibVersion < PKCS8_add_keyusage_introduced then + begin + {$if declared(FC_PKCS8_add_keyusage)} + PKCS8_add_keyusage := @FC_PKCS8_add_keyusage; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS8_add_keyusage_removed)} + if PKCS8_add_keyusage_removed <= LibVersion then + begin + {$if declared(_PKCS8_add_keyusage)} + PKCS8_add_keyusage := @_PKCS8_add_keyusage; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS8_add_keyusage_allownil)} + if FuncLoadError then + AFailed.Add('PKCS8_add_keyusage'); + {$ifend} + end; + + + PKCS12_get_friendlyname := LoadLibFunction(ADllHandle, PKCS12_get_friendlyname_procname); + FuncLoadError := not assigned(PKCS12_get_friendlyname); + if FuncLoadError then + begin + {$if not defined(PKCS12_get_friendlyname_allownil)} + PKCS12_get_friendlyname := @ERR_PKCS12_get_friendlyname; + {$ifend} + {$if declared(PKCS12_get_friendlyname_introduced)} + if LibVersion < PKCS12_get_friendlyname_introduced then + begin + {$if declared(FC_PKCS12_get_friendlyname)} + PKCS12_get_friendlyname := @FC_PKCS12_get_friendlyname; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS12_get_friendlyname_removed)} + if PKCS12_get_friendlyname_removed <= LibVersion then + begin + {$if declared(_PKCS12_get_friendlyname)} + PKCS12_get_friendlyname := @_PKCS12_get_friendlyname; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS12_get_friendlyname_allownil)} + if FuncLoadError then + AFailed.Add('PKCS12_get_friendlyname'); + {$ifend} + end; + + + PKCS12_pbe_crypt := LoadLibFunction(ADllHandle, PKCS12_pbe_crypt_procname); + FuncLoadError := not assigned(PKCS12_pbe_crypt); + if FuncLoadError then + begin + {$if not defined(PKCS12_pbe_crypt_allownil)} + PKCS12_pbe_crypt := @ERR_PKCS12_pbe_crypt; + {$ifend} + {$if declared(PKCS12_pbe_crypt_introduced)} + if LibVersion < PKCS12_pbe_crypt_introduced then + begin + {$if declared(FC_PKCS12_pbe_crypt)} + PKCS12_pbe_crypt := @FC_PKCS12_pbe_crypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS12_pbe_crypt_removed)} + if PKCS12_pbe_crypt_removed <= LibVersion then + begin + {$if declared(_PKCS12_pbe_crypt)} + PKCS12_pbe_crypt := @_PKCS12_pbe_crypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS12_pbe_crypt_allownil)} + if FuncLoadError then + AFailed.Add('PKCS12_pbe_crypt'); + {$ifend} + end; + + + PKCS12_item_decrypt_d2i := LoadLibFunction(ADllHandle, PKCS12_item_decrypt_d2i_procname); + FuncLoadError := not assigned(PKCS12_item_decrypt_d2i); + if FuncLoadError then + begin + {$if not defined(PKCS12_item_decrypt_d2i_allownil)} + PKCS12_item_decrypt_d2i := @ERR_PKCS12_item_decrypt_d2i; + {$ifend} + {$if declared(PKCS12_item_decrypt_d2i_introduced)} + if LibVersion < PKCS12_item_decrypt_d2i_introduced then + begin + {$if declared(FC_PKCS12_item_decrypt_d2i)} + PKCS12_item_decrypt_d2i := @FC_PKCS12_item_decrypt_d2i; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS12_item_decrypt_d2i_removed)} + if PKCS12_item_decrypt_d2i_removed <= LibVersion then + begin + {$if declared(_PKCS12_item_decrypt_d2i)} + PKCS12_item_decrypt_d2i := @_PKCS12_item_decrypt_d2i; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS12_item_decrypt_d2i_allownil)} + if FuncLoadError then + AFailed.Add('PKCS12_item_decrypt_d2i'); + {$ifend} + end; + + + PKCS12_item_i2d_encrypt := LoadLibFunction(ADllHandle, PKCS12_item_i2d_encrypt_procname); + FuncLoadError := not assigned(PKCS12_item_i2d_encrypt); + if FuncLoadError then + begin + {$if not defined(PKCS12_item_i2d_encrypt_allownil)} + PKCS12_item_i2d_encrypt := @ERR_PKCS12_item_i2d_encrypt; + {$ifend} + {$if declared(PKCS12_item_i2d_encrypt_introduced)} + if LibVersion < PKCS12_item_i2d_encrypt_introduced then + begin + {$if declared(FC_PKCS12_item_i2d_encrypt)} + PKCS12_item_i2d_encrypt := @FC_PKCS12_item_i2d_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS12_item_i2d_encrypt_removed)} + if PKCS12_item_i2d_encrypt_removed <= LibVersion then + begin + {$if declared(_PKCS12_item_i2d_encrypt)} + PKCS12_item_i2d_encrypt := @_PKCS12_item_i2d_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS12_item_i2d_encrypt_allownil)} + if FuncLoadError then + AFailed.Add('PKCS12_item_i2d_encrypt'); + {$ifend} + end; + + + PKCS12_init := LoadLibFunction(ADllHandle, PKCS12_init_procname); + FuncLoadError := not assigned(PKCS12_init); + if FuncLoadError then + begin + {$if not defined(PKCS12_init_allownil)} + PKCS12_init := @ERR_PKCS12_init; + {$ifend} + {$if declared(PKCS12_init_introduced)} + if LibVersion < PKCS12_init_introduced then + begin + {$if declared(FC_PKCS12_init)} + PKCS12_init := @FC_PKCS12_init; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS12_init_removed)} + if PKCS12_init_removed <= LibVersion then + begin + {$if declared(_PKCS12_init)} + PKCS12_init := @_PKCS12_init; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS12_init_allownil)} + if FuncLoadError then + AFailed.Add('PKCS12_init'); + {$ifend} + end; + + + PKCS12_key_gen_asc := LoadLibFunction(ADllHandle, PKCS12_key_gen_asc_procname); + FuncLoadError := not assigned(PKCS12_key_gen_asc); + if FuncLoadError then + begin + {$if not defined(PKCS12_key_gen_asc_allownil)} + PKCS12_key_gen_asc := @ERR_PKCS12_key_gen_asc; + {$ifend} + {$if declared(PKCS12_key_gen_asc_introduced)} + if LibVersion < PKCS12_key_gen_asc_introduced then + begin + {$if declared(FC_PKCS12_key_gen_asc)} + PKCS12_key_gen_asc := @FC_PKCS12_key_gen_asc; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS12_key_gen_asc_removed)} + if PKCS12_key_gen_asc_removed <= LibVersion then + begin + {$if declared(_PKCS12_key_gen_asc)} + PKCS12_key_gen_asc := @_PKCS12_key_gen_asc; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS12_key_gen_asc_allownil)} + if FuncLoadError then + AFailed.Add('PKCS12_key_gen_asc'); + {$ifend} + end; + + + PKCS12_key_gen_uni := LoadLibFunction(ADllHandle, PKCS12_key_gen_uni_procname); + FuncLoadError := not assigned(PKCS12_key_gen_uni); + if FuncLoadError then + begin + {$if not defined(PKCS12_key_gen_uni_allownil)} + PKCS12_key_gen_uni := @ERR_PKCS12_key_gen_uni; + {$ifend} + {$if declared(PKCS12_key_gen_uni_introduced)} + if LibVersion < PKCS12_key_gen_uni_introduced then + begin + {$if declared(FC_PKCS12_key_gen_uni)} + PKCS12_key_gen_uni := @FC_PKCS12_key_gen_uni; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS12_key_gen_uni_removed)} + if PKCS12_key_gen_uni_removed <= LibVersion then + begin + {$if declared(_PKCS12_key_gen_uni)} + PKCS12_key_gen_uni := @_PKCS12_key_gen_uni; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS12_key_gen_uni_allownil)} + if FuncLoadError then + AFailed.Add('PKCS12_key_gen_uni'); + {$ifend} + end; + + + PKCS12_key_gen_utf8 := LoadLibFunction(ADllHandle, PKCS12_key_gen_utf8_procname); + FuncLoadError := not assigned(PKCS12_key_gen_utf8); + if FuncLoadError then + begin + {$if not defined(PKCS12_key_gen_utf8_allownil)} + PKCS12_key_gen_utf8 := @ERR_PKCS12_key_gen_utf8; + {$ifend} + {$if declared(PKCS12_key_gen_utf8_introduced)} + if LibVersion < PKCS12_key_gen_utf8_introduced then + begin + {$if declared(FC_PKCS12_key_gen_utf8)} + PKCS12_key_gen_utf8 := @FC_PKCS12_key_gen_utf8; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS12_key_gen_utf8_removed)} + if PKCS12_key_gen_utf8_removed <= LibVersion then + begin + {$if declared(_PKCS12_key_gen_utf8)} + PKCS12_key_gen_utf8 := @_PKCS12_key_gen_utf8; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS12_key_gen_utf8_allownil)} + if FuncLoadError then + AFailed.Add('PKCS12_key_gen_utf8'); + {$ifend} + end; + + {introduced 1.1.0} + PKCS12_PBE_keyivgen := LoadLibFunction(ADllHandle, PKCS12_PBE_keyivgen_procname); + FuncLoadError := not assigned(PKCS12_PBE_keyivgen); + if FuncLoadError then + begin + {$if not defined(PKCS12_PBE_keyivgen_allownil)} + PKCS12_PBE_keyivgen := @ERR_PKCS12_PBE_keyivgen; + {$ifend} + {$if declared(PKCS12_PBE_keyivgen_introduced)} + if LibVersion < PKCS12_PBE_keyivgen_introduced then + begin + {$if declared(FC_PKCS12_PBE_keyivgen)} + PKCS12_PBE_keyivgen := @FC_PKCS12_PBE_keyivgen; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS12_PBE_keyivgen_removed)} + if PKCS12_PBE_keyivgen_removed <= LibVersion then + begin + {$if declared(_PKCS12_PBE_keyivgen)} + PKCS12_PBE_keyivgen := @_PKCS12_PBE_keyivgen; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS12_PBE_keyivgen_allownil)} + if FuncLoadError then + AFailed.Add('PKCS12_PBE_keyivgen'); + {$ifend} + end; + + + PKCS12_gen_mac := LoadLibFunction(ADllHandle, PKCS12_gen_mac_procname); + FuncLoadError := not assigned(PKCS12_gen_mac); + if FuncLoadError then + begin + {$if not defined(PKCS12_gen_mac_allownil)} + PKCS12_gen_mac := @ERR_PKCS12_gen_mac; + {$ifend} + {$if declared(PKCS12_gen_mac_introduced)} + if LibVersion < PKCS12_gen_mac_introduced then + begin + {$if declared(FC_PKCS12_gen_mac)} + PKCS12_gen_mac := @FC_PKCS12_gen_mac; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS12_gen_mac_removed)} + if PKCS12_gen_mac_removed <= LibVersion then + begin + {$if declared(_PKCS12_gen_mac)} + PKCS12_gen_mac := @_PKCS12_gen_mac; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS12_gen_mac_allownil)} + if FuncLoadError then + AFailed.Add('PKCS12_gen_mac'); + {$ifend} + end; + + + PKCS12_verify_mac := LoadLibFunction(ADllHandle, PKCS12_verify_mac_procname); + FuncLoadError := not assigned(PKCS12_verify_mac); + if FuncLoadError then + begin + {$if not defined(PKCS12_verify_mac_allownil)} + PKCS12_verify_mac := @ERR_PKCS12_verify_mac; + {$ifend} + {$if declared(PKCS12_verify_mac_introduced)} + if LibVersion < PKCS12_verify_mac_introduced then + begin + {$if declared(FC_PKCS12_verify_mac)} + PKCS12_verify_mac := @FC_PKCS12_verify_mac; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS12_verify_mac_removed)} + if PKCS12_verify_mac_removed <= LibVersion then + begin + {$if declared(_PKCS12_verify_mac)} + PKCS12_verify_mac := @_PKCS12_verify_mac; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS12_verify_mac_allownil)} + if FuncLoadError then + AFailed.Add('PKCS12_verify_mac'); + {$ifend} + end; + + + PKCS12_set_mac := LoadLibFunction(ADllHandle, PKCS12_set_mac_procname); + FuncLoadError := not assigned(PKCS12_set_mac); + if FuncLoadError then + begin + {$if not defined(PKCS12_set_mac_allownil)} + PKCS12_set_mac := @ERR_PKCS12_set_mac; + {$ifend} + {$if declared(PKCS12_set_mac_introduced)} + if LibVersion < PKCS12_set_mac_introduced then + begin + {$if declared(FC_PKCS12_set_mac)} + PKCS12_set_mac := @FC_PKCS12_set_mac; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS12_set_mac_removed)} + if PKCS12_set_mac_removed <= LibVersion then + begin + {$if declared(_PKCS12_set_mac)} + PKCS12_set_mac := @_PKCS12_set_mac; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS12_set_mac_allownil)} + if FuncLoadError then + AFailed.Add('PKCS12_set_mac'); + {$ifend} + end; + + + PKCS12_setup_mac := LoadLibFunction(ADllHandle, PKCS12_setup_mac_procname); + FuncLoadError := not assigned(PKCS12_setup_mac); + if FuncLoadError then + begin + {$if not defined(PKCS12_setup_mac_allownil)} + PKCS12_setup_mac := @ERR_PKCS12_setup_mac; + {$ifend} + {$if declared(PKCS12_setup_mac_introduced)} + if LibVersion < PKCS12_setup_mac_introduced then + begin + {$if declared(FC_PKCS12_setup_mac)} + PKCS12_setup_mac := @FC_PKCS12_setup_mac; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS12_setup_mac_removed)} + if PKCS12_setup_mac_removed <= LibVersion then + begin + {$if declared(_PKCS12_setup_mac)} + PKCS12_setup_mac := @_PKCS12_setup_mac; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS12_setup_mac_allownil)} + if FuncLoadError then + AFailed.Add('PKCS12_setup_mac'); + {$ifend} + end; + + + OPENSSL_asc2uni := LoadLibFunction(ADllHandle, OPENSSL_asc2uni_procname); + FuncLoadError := not assigned(OPENSSL_asc2uni); + if FuncLoadError then + begin + {$if not defined(OPENSSL_asc2uni_allownil)} + OPENSSL_asc2uni := @ERR_OPENSSL_asc2uni; + {$ifend} + {$if declared(OPENSSL_asc2uni_introduced)} + if LibVersion < OPENSSL_asc2uni_introduced then + begin + {$if declared(FC_OPENSSL_asc2uni)} + OPENSSL_asc2uni := @FC_OPENSSL_asc2uni; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OPENSSL_asc2uni_removed)} + if OPENSSL_asc2uni_removed <= LibVersion then + begin + {$if declared(_OPENSSL_asc2uni)} + OPENSSL_asc2uni := @_OPENSSL_asc2uni; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OPENSSL_asc2uni_allownil)} + if FuncLoadError then + AFailed.Add('OPENSSL_asc2uni'); + {$ifend} + end; + + + OPENSSL_uni2asc := LoadLibFunction(ADllHandle, OPENSSL_uni2asc_procname); + FuncLoadError := not assigned(OPENSSL_uni2asc); + if FuncLoadError then + begin + {$if not defined(OPENSSL_uni2asc_allownil)} + OPENSSL_uni2asc := @ERR_OPENSSL_uni2asc; + {$ifend} + {$if declared(OPENSSL_uni2asc_introduced)} + if LibVersion < OPENSSL_uni2asc_introduced then + begin + {$if declared(FC_OPENSSL_uni2asc)} + OPENSSL_uni2asc := @FC_OPENSSL_uni2asc; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OPENSSL_uni2asc_removed)} + if OPENSSL_uni2asc_removed <= LibVersion then + begin + {$if declared(_OPENSSL_uni2asc)} + OPENSSL_uni2asc := @_OPENSSL_uni2asc; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OPENSSL_uni2asc_allownil)} + if FuncLoadError then + AFailed.Add('OPENSSL_uni2asc'); + {$ifend} + end; + + + OPENSSL_utf82uni := LoadLibFunction(ADllHandle, OPENSSL_utf82uni_procname); + FuncLoadError := not assigned(OPENSSL_utf82uni); + if FuncLoadError then + begin + {$if not defined(OPENSSL_utf82uni_allownil)} + OPENSSL_utf82uni := @ERR_OPENSSL_utf82uni; + {$ifend} + {$if declared(OPENSSL_utf82uni_introduced)} + if LibVersion < OPENSSL_utf82uni_introduced then + begin + {$if declared(FC_OPENSSL_utf82uni)} + OPENSSL_utf82uni := @FC_OPENSSL_utf82uni; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OPENSSL_utf82uni_removed)} + if OPENSSL_utf82uni_removed <= LibVersion then + begin + {$if declared(_OPENSSL_utf82uni)} + OPENSSL_utf82uni := @_OPENSSL_utf82uni; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OPENSSL_utf82uni_allownil)} + if FuncLoadError then + AFailed.Add('OPENSSL_utf82uni'); + {$ifend} + end; + + {introduced 1.1.0} + OPENSSL_uni2utf8 := LoadLibFunction(ADllHandle, OPENSSL_uni2utf8_procname); + FuncLoadError := not assigned(OPENSSL_uni2utf8); + if FuncLoadError then + begin + {$if not defined(OPENSSL_uni2utf8_allownil)} + OPENSSL_uni2utf8 := @ERR_OPENSSL_uni2utf8; + {$ifend} + {$if declared(OPENSSL_uni2utf8_introduced)} + if LibVersion < OPENSSL_uni2utf8_introduced then + begin + {$if declared(FC_OPENSSL_uni2utf8)} + OPENSSL_uni2utf8 := @FC_OPENSSL_uni2utf8; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OPENSSL_uni2utf8_removed)} + if OPENSSL_uni2utf8_removed <= LibVersion then + begin + {$if declared(_OPENSSL_uni2utf8)} + OPENSSL_uni2utf8 := @_OPENSSL_uni2utf8; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OPENSSL_uni2utf8_allownil)} + if FuncLoadError then + AFailed.Add('OPENSSL_uni2utf8'); + {$ifend} + end; + + {introduced 1.1.0} + PKCS12_new := LoadLibFunction(ADllHandle, PKCS12_new_procname); + FuncLoadError := not assigned(PKCS12_new); + if FuncLoadError then + begin + {$if not defined(PKCS12_new_allownil)} + PKCS12_new := @ERR_PKCS12_new; + {$ifend} + {$if declared(PKCS12_new_introduced)} + if LibVersion < PKCS12_new_introduced then + begin + {$if declared(FC_PKCS12_new)} + PKCS12_new := @FC_PKCS12_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS12_new_removed)} + if PKCS12_new_removed <= LibVersion then + begin + {$if declared(_PKCS12_new)} + PKCS12_new := @_PKCS12_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS12_new_allownil)} + if FuncLoadError then + AFailed.Add('PKCS12_new'); + {$ifend} + end; + + + PKCS12_free := LoadLibFunction(ADllHandle, PKCS12_free_procname); + FuncLoadError := not assigned(PKCS12_free); + if FuncLoadError then + begin + {$if not defined(PKCS12_free_allownil)} + PKCS12_free := @ERR_PKCS12_free; + {$ifend} + {$if declared(PKCS12_free_introduced)} + if LibVersion < PKCS12_free_introduced then + begin + {$if declared(FC_PKCS12_free)} + PKCS12_free := @FC_PKCS12_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS12_free_removed)} + if PKCS12_free_removed <= LibVersion then + begin + {$if declared(_PKCS12_free)} + PKCS12_free := @_PKCS12_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS12_free_allownil)} + if FuncLoadError then + AFailed.Add('PKCS12_free'); + {$ifend} + end; + + + d2i_PKCS12 := LoadLibFunction(ADllHandle, d2i_PKCS12_procname); + FuncLoadError := not assigned(d2i_PKCS12); + if FuncLoadError then + begin + {$if not defined(d2i_PKCS12_allownil)} + d2i_PKCS12 := @ERR_d2i_PKCS12; + {$ifend} + {$if declared(d2i_PKCS12_introduced)} + if LibVersion < d2i_PKCS12_introduced then + begin + {$if declared(FC_d2i_PKCS12)} + d2i_PKCS12 := @FC_d2i_PKCS12; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(d2i_PKCS12_removed)} + if d2i_PKCS12_removed <= LibVersion then + begin + {$if declared(_d2i_PKCS12)} + d2i_PKCS12 := @_d2i_PKCS12; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(d2i_PKCS12_allownil)} + if FuncLoadError then + AFailed.Add('d2i_PKCS12'); + {$ifend} + end; + + + i2d_PKCS12 := LoadLibFunction(ADllHandle, i2d_PKCS12_procname); + FuncLoadError := not assigned(i2d_PKCS12); + if FuncLoadError then + begin + {$if not defined(i2d_PKCS12_allownil)} + i2d_PKCS12 := @ERR_i2d_PKCS12; + {$ifend} + {$if declared(i2d_PKCS12_introduced)} + if LibVersion < i2d_PKCS12_introduced then + begin + {$if declared(FC_i2d_PKCS12)} + i2d_PKCS12 := @FC_i2d_PKCS12; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(i2d_PKCS12_removed)} + if i2d_PKCS12_removed <= LibVersion then + begin + {$if declared(_i2d_PKCS12)} + i2d_PKCS12 := @_i2d_PKCS12; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(i2d_PKCS12_allownil)} + if FuncLoadError then + AFailed.Add('i2d_PKCS12'); + {$ifend} + end; + + + PKCS12_it := LoadLibFunction(ADllHandle, PKCS12_it_procname); + FuncLoadError := not assigned(PKCS12_it); + if FuncLoadError then + begin + {$if not defined(PKCS12_it_allownil)} + PKCS12_it := @ERR_PKCS12_it; + {$ifend} + {$if declared(PKCS12_it_introduced)} + if LibVersion < PKCS12_it_introduced then + begin + {$if declared(FC_PKCS12_it)} + PKCS12_it := @FC_PKCS12_it; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS12_it_removed)} + if PKCS12_it_removed <= LibVersion then + begin + {$if declared(_PKCS12_it)} + PKCS12_it := @_PKCS12_it; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS12_it_allownil)} + if FuncLoadError then + AFailed.Add('PKCS12_it'); + {$ifend} + end; + + + PKCS12_MAC_DATA_new := LoadLibFunction(ADllHandle, PKCS12_MAC_DATA_new_procname); + FuncLoadError := not assigned(PKCS12_MAC_DATA_new); + if FuncLoadError then + begin + {$if not defined(PKCS12_MAC_DATA_new_allownil)} + PKCS12_MAC_DATA_new := @ERR_PKCS12_MAC_DATA_new; + {$ifend} + {$if declared(PKCS12_MAC_DATA_new_introduced)} + if LibVersion < PKCS12_MAC_DATA_new_introduced then + begin + {$if declared(FC_PKCS12_MAC_DATA_new)} + PKCS12_MAC_DATA_new := @FC_PKCS12_MAC_DATA_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS12_MAC_DATA_new_removed)} + if PKCS12_MAC_DATA_new_removed <= LibVersion then + begin + {$if declared(_PKCS12_MAC_DATA_new)} + PKCS12_MAC_DATA_new := @_PKCS12_MAC_DATA_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS12_MAC_DATA_new_allownil)} + if FuncLoadError then + AFailed.Add('PKCS12_MAC_DATA_new'); + {$ifend} + end; + + + PKCS12_MAC_DATA_free := LoadLibFunction(ADllHandle, PKCS12_MAC_DATA_free_procname); + FuncLoadError := not assigned(PKCS12_MAC_DATA_free); + if FuncLoadError then + begin + {$if not defined(PKCS12_MAC_DATA_free_allownil)} + PKCS12_MAC_DATA_free := @ERR_PKCS12_MAC_DATA_free; + {$ifend} + {$if declared(PKCS12_MAC_DATA_free_introduced)} + if LibVersion < PKCS12_MAC_DATA_free_introduced then + begin + {$if declared(FC_PKCS12_MAC_DATA_free)} + PKCS12_MAC_DATA_free := @FC_PKCS12_MAC_DATA_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS12_MAC_DATA_free_removed)} + if PKCS12_MAC_DATA_free_removed <= LibVersion then + begin + {$if declared(_PKCS12_MAC_DATA_free)} + PKCS12_MAC_DATA_free := @_PKCS12_MAC_DATA_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS12_MAC_DATA_free_allownil)} + if FuncLoadError then + AFailed.Add('PKCS12_MAC_DATA_free'); + {$ifend} + end; + + + d2i_PKCS12_MAC_DATA := LoadLibFunction(ADllHandle, d2i_PKCS12_MAC_DATA_procname); + FuncLoadError := not assigned(d2i_PKCS12_MAC_DATA); + if FuncLoadError then + begin + {$if not defined(d2i_PKCS12_MAC_DATA_allownil)} + d2i_PKCS12_MAC_DATA := @ERR_d2i_PKCS12_MAC_DATA; + {$ifend} + {$if declared(d2i_PKCS12_MAC_DATA_introduced)} + if LibVersion < d2i_PKCS12_MAC_DATA_introduced then + begin + {$if declared(FC_d2i_PKCS12_MAC_DATA)} + d2i_PKCS12_MAC_DATA := @FC_d2i_PKCS12_MAC_DATA; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(d2i_PKCS12_MAC_DATA_removed)} + if d2i_PKCS12_MAC_DATA_removed <= LibVersion then + begin + {$if declared(_d2i_PKCS12_MAC_DATA)} + d2i_PKCS12_MAC_DATA := @_d2i_PKCS12_MAC_DATA; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(d2i_PKCS12_MAC_DATA_allownil)} + if FuncLoadError then + AFailed.Add('d2i_PKCS12_MAC_DATA'); + {$ifend} + end; + + + i2d_PKCS12_MAC_DATA := LoadLibFunction(ADllHandle, i2d_PKCS12_MAC_DATA_procname); + FuncLoadError := not assigned(i2d_PKCS12_MAC_DATA); + if FuncLoadError then + begin + {$if not defined(i2d_PKCS12_MAC_DATA_allownil)} + i2d_PKCS12_MAC_DATA := @ERR_i2d_PKCS12_MAC_DATA; + {$ifend} + {$if declared(i2d_PKCS12_MAC_DATA_introduced)} + if LibVersion < i2d_PKCS12_MAC_DATA_introduced then + begin + {$if declared(FC_i2d_PKCS12_MAC_DATA)} + i2d_PKCS12_MAC_DATA := @FC_i2d_PKCS12_MAC_DATA; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(i2d_PKCS12_MAC_DATA_removed)} + if i2d_PKCS12_MAC_DATA_removed <= LibVersion then + begin + {$if declared(_i2d_PKCS12_MAC_DATA)} + i2d_PKCS12_MAC_DATA := @_i2d_PKCS12_MAC_DATA; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(i2d_PKCS12_MAC_DATA_allownil)} + if FuncLoadError then + AFailed.Add('i2d_PKCS12_MAC_DATA'); + {$ifend} + end; + + + PKCS12_MAC_DATA_it := LoadLibFunction(ADllHandle, PKCS12_MAC_DATA_it_procname); + FuncLoadError := not assigned(PKCS12_MAC_DATA_it); + if FuncLoadError then + begin + {$if not defined(PKCS12_MAC_DATA_it_allownil)} + PKCS12_MAC_DATA_it := @ERR_PKCS12_MAC_DATA_it; + {$ifend} + {$if declared(PKCS12_MAC_DATA_it_introduced)} + if LibVersion < PKCS12_MAC_DATA_it_introduced then + begin + {$if declared(FC_PKCS12_MAC_DATA_it)} + PKCS12_MAC_DATA_it := @FC_PKCS12_MAC_DATA_it; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS12_MAC_DATA_it_removed)} + if PKCS12_MAC_DATA_it_removed <= LibVersion then + begin + {$if declared(_PKCS12_MAC_DATA_it)} + PKCS12_MAC_DATA_it := @_PKCS12_MAC_DATA_it; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS12_MAC_DATA_it_allownil)} + if FuncLoadError then + AFailed.Add('PKCS12_MAC_DATA_it'); + {$ifend} + end; + + + PKCS12_SAFEBAG_new := LoadLibFunction(ADllHandle, PKCS12_SAFEBAG_new_procname); + FuncLoadError := not assigned(PKCS12_SAFEBAG_new); + if FuncLoadError then + begin + {$if not defined(PKCS12_SAFEBAG_new_allownil)} + PKCS12_SAFEBAG_new := @ERR_PKCS12_SAFEBAG_new; + {$ifend} + {$if declared(PKCS12_SAFEBAG_new_introduced)} + if LibVersion < PKCS12_SAFEBAG_new_introduced then + begin + {$if declared(FC_PKCS12_SAFEBAG_new)} + PKCS12_SAFEBAG_new := @FC_PKCS12_SAFEBAG_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS12_SAFEBAG_new_removed)} + if PKCS12_SAFEBAG_new_removed <= LibVersion then + begin + {$if declared(_PKCS12_SAFEBAG_new)} + PKCS12_SAFEBAG_new := @_PKCS12_SAFEBAG_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS12_SAFEBAG_new_allownil)} + if FuncLoadError then + AFailed.Add('PKCS12_SAFEBAG_new'); + {$ifend} + end; + + + PKCS12_SAFEBAG_free := LoadLibFunction(ADllHandle, PKCS12_SAFEBAG_free_procname); + FuncLoadError := not assigned(PKCS12_SAFEBAG_free); + if FuncLoadError then + begin + {$if not defined(PKCS12_SAFEBAG_free_allownil)} + PKCS12_SAFEBAG_free := @ERR_PKCS12_SAFEBAG_free; + {$ifend} + {$if declared(PKCS12_SAFEBAG_free_introduced)} + if LibVersion < PKCS12_SAFEBAG_free_introduced then + begin + {$if declared(FC_PKCS12_SAFEBAG_free)} + PKCS12_SAFEBAG_free := @FC_PKCS12_SAFEBAG_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS12_SAFEBAG_free_removed)} + if PKCS12_SAFEBAG_free_removed <= LibVersion then + begin + {$if declared(_PKCS12_SAFEBAG_free)} + PKCS12_SAFEBAG_free := @_PKCS12_SAFEBAG_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS12_SAFEBAG_free_allownil)} + if FuncLoadError then + AFailed.Add('PKCS12_SAFEBAG_free'); + {$ifend} + end; + + + d2i_PKCS12_SAFEBAG := LoadLibFunction(ADllHandle, d2i_PKCS12_SAFEBAG_procname); + FuncLoadError := not assigned(d2i_PKCS12_SAFEBAG); + if FuncLoadError then + begin + {$if not defined(d2i_PKCS12_SAFEBAG_allownil)} + d2i_PKCS12_SAFEBAG := @ERR_d2i_PKCS12_SAFEBAG; + {$ifend} + {$if declared(d2i_PKCS12_SAFEBAG_introduced)} + if LibVersion < d2i_PKCS12_SAFEBAG_introduced then + begin + {$if declared(FC_d2i_PKCS12_SAFEBAG)} + d2i_PKCS12_SAFEBAG := @FC_d2i_PKCS12_SAFEBAG; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(d2i_PKCS12_SAFEBAG_removed)} + if d2i_PKCS12_SAFEBAG_removed <= LibVersion then + begin + {$if declared(_d2i_PKCS12_SAFEBAG)} + d2i_PKCS12_SAFEBAG := @_d2i_PKCS12_SAFEBAG; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(d2i_PKCS12_SAFEBAG_allownil)} + if FuncLoadError then + AFailed.Add('d2i_PKCS12_SAFEBAG'); + {$ifend} + end; + + + i2d_PKCS12_SAFEBAG := LoadLibFunction(ADllHandle, i2d_PKCS12_SAFEBAG_procname); + FuncLoadError := not assigned(i2d_PKCS12_SAFEBAG); + if FuncLoadError then + begin + {$if not defined(i2d_PKCS12_SAFEBAG_allownil)} + i2d_PKCS12_SAFEBAG := @ERR_i2d_PKCS12_SAFEBAG; + {$ifend} + {$if declared(i2d_PKCS12_SAFEBAG_introduced)} + if LibVersion < i2d_PKCS12_SAFEBAG_introduced then + begin + {$if declared(FC_i2d_PKCS12_SAFEBAG)} + i2d_PKCS12_SAFEBAG := @FC_i2d_PKCS12_SAFEBAG; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(i2d_PKCS12_SAFEBAG_removed)} + if i2d_PKCS12_SAFEBAG_removed <= LibVersion then + begin + {$if declared(_i2d_PKCS12_SAFEBAG)} + i2d_PKCS12_SAFEBAG := @_i2d_PKCS12_SAFEBAG; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(i2d_PKCS12_SAFEBAG_allownil)} + if FuncLoadError then + AFailed.Add('i2d_PKCS12_SAFEBAG'); + {$ifend} + end; + + + PKCS12_SAFEBAG_it := LoadLibFunction(ADllHandle, PKCS12_SAFEBAG_it_procname); + FuncLoadError := not assigned(PKCS12_SAFEBAG_it); + if FuncLoadError then + begin + {$if not defined(PKCS12_SAFEBAG_it_allownil)} + PKCS12_SAFEBAG_it := @ERR_PKCS12_SAFEBAG_it; + {$ifend} + {$if declared(PKCS12_SAFEBAG_it_introduced)} + if LibVersion < PKCS12_SAFEBAG_it_introduced then + begin + {$if declared(FC_PKCS12_SAFEBAG_it)} + PKCS12_SAFEBAG_it := @FC_PKCS12_SAFEBAG_it; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS12_SAFEBAG_it_removed)} + if PKCS12_SAFEBAG_it_removed <= LibVersion then + begin + {$if declared(_PKCS12_SAFEBAG_it)} + PKCS12_SAFEBAG_it := @_PKCS12_SAFEBAG_it; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS12_SAFEBAG_it_allownil)} + if FuncLoadError then + AFailed.Add('PKCS12_SAFEBAG_it'); + {$ifend} + end; + + + PKCS12_BAGS_new := LoadLibFunction(ADllHandle, PKCS12_BAGS_new_procname); + FuncLoadError := not assigned(PKCS12_BAGS_new); + if FuncLoadError then + begin + {$if not defined(PKCS12_BAGS_new_allownil)} + PKCS12_BAGS_new := @ERR_PKCS12_BAGS_new; + {$ifend} + {$if declared(PKCS12_BAGS_new_introduced)} + if LibVersion < PKCS12_BAGS_new_introduced then + begin + {$if declared(FC_PKCS12_BAGS_new)} + PKCS12_BAGS_new := @FC_PKCS12_BAGS_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS12_BAGS_new_removed)} + if PKCS12_BAGS_new_removed <= LibVersion then + begin + {$if declared(_PKCS12_BAGS_new)} + PKCS12_BAGS_new := @_PKCS12_BAGS_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS12_BAGS_new_allownil)} + if FuncLoadError then + AFailed.Add('PKCS12_BAGS_new'); + {$ifend} + end; + + + PKCS12_BAGS_free := LoadLibFunction(ADllHandle, PKCS12_BAGS_free_procname); + FuncLoadError := not assigned(PKCS12_BAGS_free); + if FuncLoadError then + begin + {$if not defined(PKCS12_BAGS_free_allownil)} + PKCS12_BAGS_free := @ERR_PKCS12_BAGS_free; + {$ifend} + {$if declared(PKCS12_BAGS_free_introduced)} + if LibVersion < PKCS12_BAGS_free_introduced then + begin + {$if declared(FC_PKCS12_BAGS_free)} + PKCS12_BAGS_free := @FC_PKCS12_BAGS_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS12_BAGS_free_removed)} + if PKCS12_BAGS_free_removed <= LibVersion then + begin + {$if declared(_PKCS12_BAGS_free)} + PKCS12_BAGS_free := @_PKCS12_BAGS_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS12_BAGS_free_allownil)} + if FuncLoadError then + AFailed.Add('PKCS12_BAGS_free'); + {$ifend} + end; + + + d2i_PKCS12_BAGS := LoadLibFunction(ADllHandle, d2i_PKCS12_BAGS_procname); + FuncLoadError := not assigned(d2i_PKCS12_BAGS); + if FuncLoadError then + begin + {$if not defined(d2i_PKCS12_BAGS_allownil)} + d2i_PKCS12_BAGS := @ERR_d2i_PKCS12_BAGS; + {$ifend} + {$if declared(d2i_PKCS12_BAGS_introduced)} + if LibVersion < d2i_PKCS12_BAGS_introduced then + begin + {$if declared(FC_d2i_PKCS12_BAGS)} + d2i_PKCS12_BAGS := @FC_d2i_PKCS12_BAGS; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(d2i_PKCS12_BAGS_removed)} + if d2i_PKCS12_BAGS_removed <= LibVersion then + begin + {$if declared(_d2i_PKCS12_BAGS)} + d2i_PKCS12_BAGS := @_d2i_PKCS12_BAGS; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(d2i_PKCS12_BAGS_allownil)} + if FuncLoadError then + AFailed.Add('d2i_PKCS12_BAGS'); + {$ifend} + end; + + + i2d_PKCS12_BAGS := LoadLibFunction(ADllHandle, i2d_PKCS12_BAGS_procname); + FuncLoadError := not assigned(i2d_PKCS12_BAGS); + if FuncLoadError then + begin + {$if not defined(i2d_PKCS12_BAGS_allownil)} + i2d_PKCS12_BAGS := @ERR_i2d_PKCS12_BAGS; + {$ifend} + {$if declared(i2d_PKCS12_BAGS_introduced)} + if LibVersion < i2d_PKCS12_BAGS_introduced then + begin + {$if declared(FC_i2d_PKCS12_BAGS)} + i2d_PKCS12_BAGS := @FC_i2d_PKCS12_BAGS; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(i2d_PKCS12_BAGS_removed)} + if i2d_PKCS12_BAGS_removed <= LibVersion then + begin + {$if declared(_i2d_PKCS12_BAGS)} + i2d_PKCS12_BAGS := @_i2d_PKCS12_BAGS; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(i2d_PKCS12_BAGS_allownil)} + if FuncLoadError then + AFailed.Add('i2d_PKCS12_BAGS'); + {$ifend} + end; + + + PKCS12_BAGS_it := LoadLibFunction(ADllHandle, PKCS12_BAGS_it_procname); + FuncLoadError := not assigned(PKCS12_BAGS_it); + if FuncLoadError then + begin + {$if not defined(PKCS12_BAGS_it_allownil)} + PKCS12_BAGS_it := @ERR_PKCS12_BAGS_it; + {$ifend} + {$if declared(PKCS12_BAGS_it_introduced)} + if LibVersion < PKCS12_BAGS_it_introduced then + begin + {$if declared(FC_PKCS12_BAGS_it)} + PKCS12_BAGS_it := @FC_PKCS12_BAGS_it; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS12_BAGS_it_removed)} + if PKCS12_BAGS_it_removed <= LibVersion then + begin + {$if declared(_PKCS12_BAGS_it)} + PKCS12_BAGS_it := @_PKCS12_BAGS_it; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS12_BAGS_it_allownil)} + if FuncLoadError then + AFailed.Add('PKCS12_BAGS_it'); + {$ifend} + end; + + + PKCS12_PBE_add := LoadLibFunction(ADllHandle, PKCS12_PBE_add_procname); + FuncLoadError := not assigned(PKCS12_PBE_add); + if FuncLoadError then + begin + {$if not defined(PKCS12_PBE_add_allownil)} + PKCS12_PBE_add := @ERR_PKCS12_PBE_add; + {$ifend} + {$if declared(PKCS12_PBE_add_introduced)} + if LibVersion < PKCS12_PBE_add_introduced then + begin + {$if declared(FC_PKCS12_PBE_add)} + PKCS12_PBE_add := @FC_PKCS12_PBE_add; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS12_PBE_add_removed)} + if PKCS12_PBE_add_removed <= LibVersion then + begin + {$if declared(_PKCS12_PBE_add)} + PKCS12_PBE_add := @_PKCS12_PBE_add; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS12_PBE_add_allownil)} + if FuncLoadError then + AFailed.Add('PKCS12_PBE_add'); + {$ifend} + end; + + + PKCS12_parse := LoadLibFunction(ADllHandle, PKCS12_parse_procname); + FuncLoadError := not assigned(PKCS12_parse); + if FuncLoadError then + begin + {$if not defined(PKCS12_parse_allownil)} + PKCS12_parse := @ERR_PKCS12_parse; + {$ifend} + {$if declared(PKCS12_parse_introduced)} + if LibVersion < PKCS12_parse_introduced then + begin + {$if declared(FC_PKCS12_parse)} + PKCS12_parse := @FC_PKCS12_parse; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS12_parse_removed)} + if PKCS12_parse_removed <= LibVersion then + begin + {$if declared(_PKCS12_parse)} + PKCS12_parse := @_PKCS12_parse; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS12_parse_allownil)} + if FuncLoadError then + AFailed.Add('PKCS12_parse'); + {$ifend} + end; + + + PKCS12_create := LoadLibFunction(ADllHandle, PKCS12_create_procname); + FuncLoadError := not assigned(PKCS12_create); + if FuncLoadError then + begin + {$if not defined(PKCS12_create_allownil)} + PKCS12_create := @ERR_PKCS12_create; + {$ifend} + {$if declared(PKCS12_create_introduced)} + if LibVersion < PKCS12_create_introduced then + begin + {$if declared(FC_PKCS12_create)} + PKCS12_create := @FC_PKCS12_create; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS12_create_removed)} + if PKCS12_create_removed <= LibVersion then + begin + {$if declared(_PKCS12_create)} + PKCS12_create := @_PKCS12_create; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS12_create_allownil)} + if FuncLoadError then + AFailed.Add('PKCS12_create'); + {$ifend} + end; + + + i2d_PKCS12_bio := LoadLibFunction(ADllHandle, i2d_PKCS12_bio_procname); + FuncLoadError := not assigned(i2d_PKCS12_bio); + if FuncLoadError then + begin + {$if not defined(i2d_PKCS12_bio_allownil)} + i2d_PKCS12_bio := @ERR_i2d_PKCS12_bio; + {$ifend} + {$if declared(i2d_PKCS12_bio_introduced)} + if LibVersion < i2d_PKCS12_bio_introduced then + begin + {$if declared(FC_i2d_PKCS12_bio)} + i2d_PKCS12_bio := @FC_i2d_PKCS12_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(i2d_PKCS12_bio_removed)} + if i2d_PKCS12_bio_removed <= LibVersion then + begin + {$if declared(_i2d_PKCS12_bio)} + i2d_PKCS12_bio := @_i2d_PKCS12_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(i2d_PKCS12_bio_allownil)} + if FuncLoadError then + AFailed.Add('i2d_PKCS12_bio'); + {$ifend} + end; + + + d2i_PKCS12_bio := LoadLibFunction(ADllHandle, d2i_PKCS12_bio_procname); + FuncLoadError := not assigned(d2i_PKCS12_bio); + if FuncLoadError then + begin + {$if not defined(d2i_PKCS12_bio_allownil)} + d2i_PKCS12_bio := @ERR_d2i_PKCS12_bio; + {$ifend} + {$if declared(d2i_PKCS12_bio_introduced)} + if LibVersion < d2i_PKCS12_bio_introduced then + begin + {$if declared(FC_d2i_PKCS12_bio)} + d2i_PKCS12_bio := @FC_d2i_PKCS12_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(d2i_PKCS12_bio_removed)} + if d2i_PKCS12_bio_removed <= LibVersion then + begin + {$if declared(_d2i_PKCS12_bio)} + d2i_PKCS12_bio := @_d2i_PKCS12_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(d2i_PKCS12_bio_allownil)} + if FuncLoadError then + AFailed.Add('d2i_PKCS12_bio'); + {$ifend} + end; + + + PKCS12_newpass := LoadLibFunction(ADllHandle, PKCS12_newpass_procname); + FuncLoadError := not assigned(PKCS12_newpass); + if FuncLoadError then + begin + {$if not defined(PKCS12_newpass_allownil)} + PKCS12_newpass := @ERR_PKCS12_newpass; + {$ifend} + {$if declared(PKCS12_newpass_introduced)} + if LibVersion < PKCS12_newpass_introduced then + begin + {$if declared(FC_PKCS12_newpass)} + PKCS12_newpass := @FC_PKCS12_newpass; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS12_newpass_removed)} + if PKCS12_newpass_removed <= LibVersion then + begin + {$if declared(_PKCS12_newpass)} + PKCS12_newpass := @_PKCS12_newpass; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS12_newpass_allownil)} + if FuncLoadError then + AFailed.Add('PKCS12_newpass'); + {$ifend} + end; + + +end; + +procedure Unload; +begin + PKCS12_mac_present := nil; {introduced 1.1.0} + PKCS12_get0_mac := nil; {introduced 1.1.0} + PKCS12_SAFEBAG_get0_attr := nil; {introduced 1.1.0} + PKCS12_SAFEBAG_get0_type := nil; {introduced 1.1.0} + PKCS12_SAFEBAG_get_nid := nil; {introduced 1.1.0} + PKCS12_SAFEBAG_get_bag_nid := nil; {introduced 1.1.0} + PKCS12_SAFEBAG_get1_cert := nil; {introduced 1.1.0} + PKCS12_SAFEBAG_get1_crl := nil; {introduced 1.1.0} + PKCS12_SAFEBAG_get0_p8inf := nil; {introduced 1.1.0} + PKCS12_SAFEBAG_get0_pkcs8 := nil; {introduced 1.1.0} + PKCS12_SAFEBAG_create_cert := nil; {introduced 1.1.0} + PKCS12_SAFEBAG_create_crl := nil; {introduced 1.1.0} + PKCS12_SAFEBAG_create0_p8inf := nil; {introduced 1.1.0} + PKCS12_SAFEBAG_create0_pkcs8 := nil; {introduced 1.1.0} + PKCS12_SAFEBAG_create_pkcs8_encrypt := nil; {introduced 1.1.0} + PKCS12_item_pack_safebag := nil; + PKCS8_decrypt := nil; + PKCS12_decrypt_skey := nil; + PKCS8_encrypt := nil; + PKCS8_set0_pbe := nil; {introduced 1.1.0} + PKCS12_add_localkeyid := nil; + PKCS12_add_friendlyname_asc := nil; + PKCS12_add_friendlyname_utf8 := nil; {introduced 1.1.0} + PKCS12_add_CSPName_asc := nil; + PKCS12_add_friendlyname_uni := nil; + PKCS8_add_keyusage := nil; + PKCS12_get_friendlyname := nil; + PKCS12_pbe_crypt := nil; + PKCS12_item_decrypt_d2i := nil; + PKCS12_item_i2d_encrypt := nil; + PKCS12_init := nil; + PKCS12_key_gen_asc := nil; + PKCS12_key_gen_uni := nil; + PKCS12_key_gen_utf8 := nil; {introduced 1.1.0} + PKCS12_PBE_keyivgen := nil; + PKCS12_gen_mac := nil; + PKCS12_verify_mac := nil; + PKCS12_set_mac := nil; + PKCS12_setup_mac := nil; + OPENSSL_asc2uni := nil; + OPENSSL_uni2asc := nil; + OPENSSL_utf82uni := nil; {introduced 1.1.0} + OPENSSL_uni2utf8 := nil; {introduced 1.1.0} + PKCS12_new := nil; + PKCS12_free := nil; + d2i_PKCS12 := nil; + i2d_PKCS12 := nil; + PKCS12_it := nil; + PKCS12_MAC_DATA_new := nil; + PKCS12_MAC_DATA_free := nil; + d2i_PKCS12_MAC_DATA := nil; + i2d_PKCS12_MAC_DATA := nil; + PKCS12_MAC_DATA_it := nil; + PKCS12_SAFEBAG_new := nil; + PKCS12_SAFEBAG_free := nil; + d2i_PKCS12_SAFEBAG := nil; + i2d_PKCS12_SAFEBAG := nil; + PKCS12_SAFEBAG_it := nil; + PKCS12_BAGS_new := nil; + PKCS12_BAGS_free := nil; + d2i_PKCS12_BAGS := nil; + i2d_PKCS12_BAGS := nil; + PKCS12_BAGS_it := nil; + PKCS12_PBE_add := nil; + PKCS12_parse := nil; + PKCS12_create := nil; + i2d_PKCS12_bio := nil; + d2i_PKCS12_bio := nil; + PKCS12_newpass := nil; +end; +{$ELSE} +{$ENDIF} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +initialization + Register_SSLLoader(@Load,'LibCrypto'); + Register_SSLUnloader(@Unload); +{$ENDIF} +end. diff --git a/IdOpenSSLHeaders_pkcs7.pas b/IdOpenSSLHeaders_pkcs7.pas new file mode 100644 index 0000000..a611139 --- /dev/null +++ b/IdOpenSSLHeaders_pkcs7.pas @@ -0,0 +1,2546 @@ + (* This unit was generated using the script genOpenSSLHdrs.sh from the source file IdOpenSSLHeaders_pkcs7.h2pas + It should not be modified directly. All changes should be made to IdOpenSSLHeaders_pkcs7.h2pas + and this file regenerated. IdOpenSSLHeaders_pkcs7.h2pas is distributed with the full Indy + Distribution. + *) + +{$i IdCompilerDefines.inc} +{$i IdSSLOpenSSLDefines.inc} +{$IFNDEF USE_OPENSSL} + { error Should not compile if USE_OPENSSL is not defined!!!} +{$ENDIF} +{******************************************************************************} +{ } +{ Indy (Internet Direct) - Internet Protocols Simplified } +{ } +{ https://www.indyproject.org/ } +{ https://gitter.im/IndySockets/Indy } +{ } +{******************************************************************************} +{ } +{ This file is part of the Indy (Internet Direct) project, and is offered } +{ under the dual-licensing agreement described on the Indy website. } +{ (https://www.indyproject.org/license/) } +{ } +{ Copyright: } +{ (c) 1993-2020, Chad Z. Hower and the Indy Pit Crew. All rights reserved. } +{ } +{******************************************************************************} +{ } +{ } +{******************************************************************************} + +unit IdOpenSSLHeaders_pkcs7; + +interface + +// Headers for OpenSSL 1.1.1 +// pkcs7.h + + +uses + IdCTypes, + IdGlobal, + IdSSLOpenSSLConsts, + IdOpenSSLHeaders_ossl_typ; + +const + PKCS7_S_HEADER = 0; + PKCS7_S_BODY = 1; + PKCS7_S_TAIL = 2; + + PKCS7_OP_SET_DETACHED_SIGNATURE = 1; + PKCS7_OP_GET_DETACHED_SIGNATURE = 2; + + (* S/MIME related flags *) + PKCS7_TEXT = $1; + PKCS7_NOCERTS = $2; + PKCS7_NOSIGS = $4; + PKCS7_NOCHAIN = $8; + PKCS7_NOINTERN = $10; + PKCS7_NOVERIFY = $20; + PKCS7_DETACHED = $40; + PKCS7_BINARY = $80; + PKCS7_NOATTR = $100; + PKCS7_NOSMIMECAP = $200; + PKCS7_NOOLDMIMETYPE = $400; + PKCS7_CRLFEOL = $800; + // Added '_CONST' to avoid name clashes + PKCS7_STREAM_CONST = $1000; + PKCS7_NOCRL = $2000; + PKCS7_PARTIAL = $4000; + PKCS7_REUSE_DIGEST = $8000; + PKCS7_NO_DUAL_CONTENT = $10000; + + (* Flags: for compatibility with older code *) + SMIME_TEXT = PKCS7_TEXT; + SMIME_NOCERTS = PKCS7_NOCERTS; + SMIME_NOSIGS = PKCS7_NOSIGS; + SMIME_NOCHAIN = PKCS7_NOCHAIN; + SMIME_NOINTERN = PKCS7_NOINTERN; + SMIME_NOVERIFY = PKCS7_NOVERIFY; + SMIME_DETACHED = PKCS7_DETACHED; + SMIME_BINARY = PKCS7_BINARY; + SMIME_NOATTR = PKCS7_NOATTR; + + (* CRLF ASCII canonicalisation *) + SMIME_ASCIICRLF = $80000; + +type + PPKCS7 = ^PKCS7; + PPPKCS7 = ^PPKCS7; + + PPKCS7_DIGEST = ^PKCS7_DIGEST; + PPPKCS7_DIGEST = ^PPKCS7_DIGEST; + + pkcs7_issuer_and_serial_st = record + issue: PX509_NAME; + serial: PASN1_INTEGER; + end; + PKCS7_ISSUER_AND_SERIAL = pkcs7_issuer_and_serial_st; + PPKCS7_ISSUER_AND_SERIAL = ^PKCS7_ISSUER_AND_SERIAL; + PPPKCS7_ISSUER_AND_SERIAL = ^PPKCS7_ISSUER_AND_SERIAL; + + pkcs7_signer_info_st = record + version: PASN1_INTEGER; + issuer_and_serial: PPKCS7_ISSUER_AND_SERIAL; + digest_alg: PX509_ALGOR; + auth_attr: Pointer; //PSTACK_OF_X509_ATTRIBUTE; + digest_enc_alg: PX509_ALGOR; + enc_digest: PASN1_OCTET_STRING; + unauth_attr: Pointer; //PSTACK_OF_X509_ATTRIBUTE; + pkey: PEVP_PKEY; + end; + PKCS7_SIGNER_INFO = pkcs7_issuer_and_serial_st; + PPKCS7_SIGNER_INFO = ^PKCS7_SIGNER_INFO; + PPPKCS7_SIGNER_INFO = ^PPKCS7_SIGNER_INFO; + + pkcs7_recip_info_st = record + version: PASN1_INTEGER; + issuer_and_serial: PPKCS7_ISSUER_AND_SERIAL; + key_enc_algor: PX509_ALGOR; + enc_key: PASN1_OCTET_STRING; + cert: PX509; + end; + PKCS7_RECIP_INFO = pkcs7_recip_info_st; + PPKCS7_RECIP_INFO = ^PKCS7_RECIP_INFO; + PPPKCS7_RECIP_INFO = ^PPKCS7_RECIP_INFO; + + pkcs7_signed_st = record + version: PASN1_INTEGER; + md_algs: Pointer; //PSTACK_OF_X509_ALGOR; + cert: Pointer; //PSTACK_OF_X509; + crl: Pointer; //PSTACK_OF_X509_CRL; + signer_info: Pointer; //PSTACK_OF_PKCS7_SIGNER_INFO; + contents: PPKCS7; + end; + PKCS7_SIGNED = pkcs7_signed_st; + PPKCS7_SIGNED = ^PKCS7_SIGNED; + PPPKCS7_SIGNED = ^PPKCS7_SIGNED; + + pkcs7_enc_content_st = record + content_type: PASN1_OBJECT; + algorithm: PX509_ALGOR; + enc_data: PASN1_OCTET_STRING; + cipher: PEVP_CIPHER; + end; + PKCS7_ENC_CONTENT = pkcs7_enc_content_st; + PPKCS7_ENC_CONTENT = ^PKCS7_ENC_CONTENT; + PPPKCS7_ENC_CONTENT = ^PPKCS7_ENC_CONTENT; + + pkcs7_enveloped_st = record + version: PASN1_INTEGER; + recipientinfo: Pointer; //PSTACK_OF_PKCS7_RECIP_INFO; + enc_data: PPKCS7_ENC_CONTENT; + end; + PKCS7_ENVELOPE = pkcs7_enveloped_st; + PPKCS7_ENVELOPE = ^PKCS7_ENVELOPE; + PPPKCS7_ENVELOPE = ^PPKCS7_ENVELOPE; + + pkcs7_signedandenveloped_st = record + version: PASN1_INTEGER; + md_algs: Pointer; //PSTACK_OF_X509_ALGOR; + cert: Pointer; //PSTACK_OF_X509; + crl: Pointer; //PSTACK_OF_X509_CRL; + signer_info: Pointer; //PSTACK_OF_PKCS7_SIGNER_INFO; + enc_data: PPKCS7_ENC_CONTENT; + recipientinfo: Pointer; //PSTACK_OF_PKCS7_RECIP_INFO; + end; + PKCS7_SIGN_ENVELOPE = pkcs7_signedandenveloped_st; + PPKCS7_SIGN_ENVELOPE = ^PKCS7_SIGN_ENVELOPE; + PPPKCS7_SIGN_ENVELOPE = ^PPKCS7_SIGN_ENVELOPE; + + pkcs7_encrypted_st = record + version: PASN1_INTEGER; + enc_data: PPKCS7_ENC_CONTENT; + end; + // Added '_STRUCT' to avoid name clashes + PKCS7_ENCRYPT_STRUCT = pkcs7_encrypted_st; + PPKCS7_ENCRYPT_STRUCT = ^PKCS7_ENCRYPT_STRUCT; + PPPKCS7_ENCRYPT_STRUCT = ^PPKCS7_ENCRYPT_STRUCT; + + pkcs7_st_d = record + case Integer of + 0: (ptr: PIdAnsiChar); + 1: (data: PASN1_OCTET_STRING); + 2: (sign: PPKCS7_SIGNED); + 3: (enveloped: PPKCS7_ENVELOPE); + 4: (signed_and_enveloped: PPKCS7_SIGN_ENVELOPE); + 5: (digest: PPKCS7_DIGEST); + 6: (encrypted: PPKCS7_ENCRYPT_STRUCT); + 7: (other: PASN1_TYPE); + end; + pkcs7_st = record + asn1: PByte; + length: TIdC_LONG; + state: TIdC_INT; + detached: TIdC_INT; + type_: PASN1_OBJECT; + d: pkcs7_st_d; + end; + PKCS7 = pkcs7_st; + + pkcs7_digest_st = record + version: PASN1_INTEGER; + md: PX509_ALGOR; + contents: PPKCS7; + digest: PASN1_OCTET_STRING; + end; + PKCS7_DIGEST = pkcs7_digest_st; + + //function PKCS7_ISSUER_AND_SERIAL_new: PPKCS7_ISSUER_AND_SERIAL; + //procedure PKCS7_ISSUER_AND_SERIAL_free(a: PPKCS7_ISSUER_AND_SERIAL); + //function d2i_PKCS7_ISSUER_AND_SERIAL(a: PPPKCS7_ISSUER_AND_SERIAL; const in_: PByte; len: TIdC_LONG): PPKCS7_ISSUER_AND_SERIAL; + //function i2d_PKCS7_ISSUER_AND_SERIAL(const a: PPKCS7_ISSUER_AND_SERIAL; out_: PByte): TIdC_INT; + //function PKCS7_ISSUER_AND_SERIAL_it: PASN1_ITEM; + + { The EXTERNALSYM directive is ignored by FPC, however, it is used by Delphi as follows: + + The EXTERNALSYM directive prevents the specified Delphi symbol from appearing in header + files generated for C++. } + + {$EXTERNALSYM PKCS7_ISSUER_AND_SERIAL_digest} + {$EXTERNALSYM PKCS7_dup} + {$EXTERNALSYM d2i_PKCS7_bio} + {$EXTERNALSYM i2d_PKCS7_bio} + {$EXTERNALSYM i2d_PKCS7_bio_stream} + {$EXTERNALSYM PEM_write_bio_PKCS7_stream} + {$EXTERNALSYM PKCS7_ctrl} + {$EXTERNALSYM PKCS7_set_type} + {$EXTERNALSYM PKCS7_set0_type_other} + {$EXTERNALSYM PKCS7_set_content} + {$EXTERNALSYM PKCS7_SIGNER_INFO_set} + {$EXTERNALSYM PKCS7_SIGNER_INFO_sign} + {$EXTERNALSYM PKCS7_add_signer} + {$EXTERNALSYM PKCS7_add_certificate} + {$EXTERNALSYM PKCS7_add_crl} + {$EXTERNALSYM PKCS7_content_new} + {$EXTERNALSYM PKCS7_dataVerify} + {$EXTERNALSYM PKCS7_signatureVerify} + {$EXTERNALSYM PKCS7_dataInit} + {$EXTERNALSYM PKCS7_dataFinal} + {$EXTERNALSYM PKCS7_dataDecode} + {$EXTERNALSYM PKCS7_add_signature} + {$EXTERNALSYM PKCS7_cert_from_signer_info} + {$EXTERNALSYM PKCS7_set_digest} + {$EXTERNALSYM PKCS7_add_recipient} + {$EXTERNALSYM PKCS7_SIGNER_INFO_get0_algs} + {$EXTERNALSYM PKCS7_RECIP_INFO_get0_alg} + {$EXTERNALSYM PKCS7_add_recipient_info} + {$EXTERNALSYM PKCS7_RECIP_INFO_set} + {$EXTERNALSYM PKCS7_set_cipher} + {$EXTERNALSYM PKCS7_stream} + {$EXTERNALSYM PKCS7_get_issuer_and_serial} + {$EXTERNALSYM PKCS7_add_signed_attribute} + {$EXTERNALSYM PKCS7_add_attribute} + {$EXTERNALSYM PKCS7_get_attribute} + {$EXTERNALSYM PKCS7_get_signed_attribute} + {$EXTERNALSYM PKCS7_sign_add_signer} + {$EXTERNALSYM PKCS7_final} + {$EXTERNALSYM PKCS7_decrypt} + {$EXTERNALSYM PKCS7_add_attrib_content_type} + {$EXTERNALSYM PKCS7_add0_attrib_signing_time} + {$EXTERNALSYM PKCS7_add1_attrib_digest} + {$EXTERNALSYM SMIME_write_PKCS7} + {$EXTERNALSYM SMIME_read_PKCS7} + {$EXTERNALSYM BIO_new_PKCS7} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +var + PKCS7_ISSUER_AND_SERIAL_digest: function (data: PPKCS7_ISSUER_AND_SERIAL; const type_: PEVP_MD; md: PByte; len: PIdC_UINT): TIdC_INT; cdecl = nil; + + PKCS7_dup: function (p7: PPKCS7): PPKCS7; cdecl = nil; + d2i_PKCS7_bio: function (bp: PBIO; p7: PPPKCS7): PPKCS7; cdecl = nil; + i2d_PKCS7_bio: function (bp: PBIO; p7: PPKCS7): TIdC_INT; cdecl = nil; + i2d_PKCS7_bio_stream: function (out_: PBIO; p7: PPKCS7; in_: PBIO; flags: TIdC_INT): TIdC_INT; cdecl = nil; + PEM_write_bio_PKCS7_stream: function (out_: PBIO; p7: PPKCS7; in_: PBIO; flags: TIdC_INT): TIdC_INT; cdecl = nil; + +// function PKCS7_SIGNER_INFO_new: PPKCS7_SIGNER_INFO; +// procedure PKCS7_SIGNER_INFO_free(a: PPKCS7_SIGNER_INFO); +// function d2i_PKCS7_SIGNER_INFO(a: PPPKCS7_SIGNER_INFO; const in_: PByte; len: TIdC_LONG): PPKCS7_SIGNER_INFO; +// function i2d_PKCS7_SIGNER_INFO(const a: PPKCS7_SIGNER_INFO; out_: PByte): TIdC_INT; +// function PKCS7_SIGNER_INFO_it: PASN1_ITEM; +// +// function PKCS7_RECIP_INFO_new: PPKCS7_RECIP_INFO; +// procedure PKCS7_RECIP_INFO_free(a: PPKCS7_RECIP_INFO); +// function d2i_PKCS7_RECIP_INFO(a: PPPKCS7_RECIP_INFO; const in_: PByte; len: TIdC_LONG): PPKCS7_RECIP_INFO; +// function i2d_PKCS7_RECIP_INFO(const a: PPKCS7_RECIP_INFO; out_: PByte): TIdC_INT; +// function PKCS7_RECIP_INFO_it: PASN1_ITEM; +// +// function PKCS7_SIGNED_new: PPKCS7_SIGNED; +// procedure PKCS7_SIGNED_free(a: PPKCS7_SIGNED); +// function d2i_PKCS7_SIGNED(a: PPPKCS7_SIGNED; const in_: PByte; len: TIdC_LONG): PPKCS7_SIGNED; +// function i2d_PKCS7_SIGNED(const a: PPKCS7_SIGNED; out_: PByte): TIdC_INT; +// function PKCS7_SIGNED_it: PASN1_ITEM; +// +// function PKCS7_ENC_CONTENT_new: PPKCS7_ENC_CONTENT; +// procedure PKCS7_ENC_CONTENT_free(a: PPKCS7_ENC_CONTENT); +// function d2i_PKCS7_ENC_CONTENT(a: PPPKCS7_ENC_CONTENT; const in_: PByte; len: TIdC_LONG): PPKCS7_ENC_CONTENT; +// function i2d_PKCS7_ENC_CONTENT(const a: PPKCS7_ENC_CONTENT; out_: PByte): TIdC_INT; +// function PKCS7_ENC_CONTENT_it: PASN1_ITEM; +// +// function PKCS7_ENVELOPE_new: PPKCS7_ENVELOPE; +// procedure PKCS7_ENVELOPE_free(a: PPKCS7_ENVELOPE); +// function d2i_PKCS7_ENVELOPE(a: PPPKCS7_ENVELOPE; const in_: PByte; len: TIdC_LONG): PPKCS7_ENVELOPE; +// function i2d_PKCS7_ENVELOPE(const a: PPKCS7_ENVELOPE; out_: PByte): TIdC_INT; +// function PKCS7_ENVELOPE_it: PASN1_ITEM; +// +// function PKCS7_SIGN_ENVELOPE_new: PPKCS7_SIGN_ENVELOPE; +// procedure PKCS7_SIGN_ENVELOPE_free(a: PPKCS7_SIGN_ENVELOPE); +// function d2i_PKCS7_SIGN_ENVELOPE(a: PPPKCS7_SIGN_ENVELOPE; const in_: PByte; len: TIdC_LONG): PPKCS7_SIGN_ENVELOPE; +// function i2d_PKCS7_SIGN_ENVELOPE(const a: PPKCS7_SIGN_ENVELOPE; out_: PByte): TIdC_INT; +// function PKCS7_SIGN_ENVELOPE_it: PASN1_ITEM; +// +// function PKCS7_DIGEST_new: PPKCS7_DIGEST; +// procedure PKCS7_DIGEST_free(a: PPKCS7_DIGEST); +// function d2i_PKCS7_DIGEST(a: PPPKCS7_DIGEST; const in_: PByte; len: TIdC_LONG): PPKCS7_DIGEST; +// function i2d_PKCS7_DIGEST(const a: PPKCS7_DIGEST; out_: PByte): TIdC_INT; +// function PKCS7_DIGEST_it: PASN1_ITEM; +// +// function PKCS7_ENCRYPT_new: PPKCS7_ENCRYPT_STRUCT; +// procedure PKCS7_ENCRYPT_free(a: PPKCS7_ENCRYPT_STRUCT); +// function d2i_PKCS7_ENCRYPT(a: PPPKCS7_ENCRYPT_STRUCT; const in_: PByte; len: TIdC_LONG): PPKCS7_ENCRYPT_STRUCT; +// function i2d_PKCS7_ENCRYPT(const a: PPKCS7_ENCRYPT_STRUCT; out_: PByte): TIdC_INT; +// function PKCS7_ENCRYPT_it: PASN1_ITEM; +// +// function PKCS7_new: PPKCS7; +// procedure PKCS7_free(a: PPKCS7); +// function d2i_PKCS7(a: PPPKCS7; const in_: PByte; len: TIdC_LONG): PPKCS7; +// function i2d_PKCS7(const a: PPKCS7; out_: PByte): TIdC_INT; +// function PKCS7_it: PASN1_ITEM; +// +// function PKCS7_ATTR_SIGN_it: PASN1_ITEM; +// +// function PKCS7_ATTR_VERIFY_it: PASN1_ITEM; +// +// function i2d_PKCS7_NDEF(const a: PPKCS7; out_: PPByte): TIdC_INT; +// function PKCS7_print_ctx(out_: PBIO; const x: PPKCS7; indent: TIdC_INT; const pctx: PASN1_PCTX): TIdC_INT; + + PKCS7_ctrl: function (p7: PPKCS7; cmd: TIdC_INT; larg: TIdC_LONG; parg: PIdAnsiChar): TIdC_LONG; cdecl = nil; + + PKCS7_set_type: function (p7: PPKCS7; type_: TIdC_INT): TIdC_INT; cdecl = nil; + PKCS7_set0_type_other: function (p7: PPKCS7; type_: TIdC_INT; other: PASN1_TYPE): TIdC_INT; cdecl = nil; + PKCS7_set_content: function (p7: PPKCS7; p7_data: PPKCS7): TIdC_INT; cdecl = nil; + PKCS7_SIGNER_INFO_set: function (p7i: PPKCS7_SIGNER_INFO; x509: PX509; pkey: PEVP_PKEY; const dgst: PEVP_MD): TIdC_INT; cdecl = nil; + PKCS7_SIGNER_INFO_sign: function (si: PPKCS7_SIGNER_INFO): TIdC_INT; cdecl = nil; + PKCS7_add_signer: function (p7: PPKCS7; p7i: PPKCS7_SIGNER_INFO): TIdC_INT; cdecl = nil; + PKCS7_add_certificate: function (p7: PPKCS7; x509: PX509): TIdC_INT; cdecl = nil; + PKCS7_add_crl: function (p7: PPKCS7; x509: PX509_CRL): TIdC_INT; cdecl = nil; + PKCS7_content_new: function (p7: PPKCS7; nid: TIdC_INT): TIdC_INT; cdecl = nil; + PKCS7_dataVerify: function (cert_store: PX509_STORE; ctx: PX509_STORE_CTX; bio: PBIO; p7: PPKCS7; si: PPKCS7_SIGNER_INFO): TIdC_INT; cdecl = nil; + PKCS7_signatureVerify: function (bio: PBIO; p7: PPKCS7; si: PPKCS7_SIGNER_INFO; x509: PX509): TIdC_INT; cdecl = nil; + + PKCS7_dataInit: function (p7: PPKCS7; bio: PBIO): PBIO; cdecl = nil; + PKCS7_dataFinal: function (p7: PPKCS7; bio: PBIO): TIdC_INT; cdecl = nil; + PKCS7_dataDecode: function (p7: PPKCS7; pkey: PEVP_PKEY; in_bio: PBIO; pcert: PX509): PBIO; cdecl = nil; + + PKCS7_add_signature: function (p7: PPKCS7; x509: PX509; pkey: PEVP_PKEY; const dgst: PEVP_MD): PPKCS7_SIGNER_INFO; cdecl = nil; + PKCS7_cert_from_signer_info: function (p7: PPKCS7; si: PPKCS7_SIGNER_INFO): PX509; cdecl = nil; + PKCS7_set_digest: function (p7: PPKCS7; const md: PEVP_MD): TIdC_INT; cdecl = nil; +// function PKCS7_get_signer_info(p7: PPKCS7): PSTACK_OF_PKCS7_SIGNER_INFO; + + PKCS7_add_recipient: function (p7: PPKCS7; x509: PX509): PPKCS7_RECIP_INFO; cdecl = nil; + PKCS7_SIGNER_INFO_get0_algs: procedure (si: PPKCS7_SIGNER_INFO; pk: PPEVP_PKEY; pdig: PPX509_ALGOR; psig: PPX509_ALGOR); cdecl = nil; + PKCS7_RECIP_INFO_get0_alg: procedure (ri: PPKCS7_RECIP_INFO; penc: PPX509_ALGOR); cdecl = nil; + PKCS7_add_recipient_info: function (p7: PPKCS7; ri: PPKCS7_RECIP_INFO): TIdC_INT; cdecl = nil; + PKCS7_RECIP_INFO_set: function (p7i: PPKCS7_RECIP_INFO; x509: PX509): TIdC_INT; cdecl = nil; + PKCS7_set_cipher: function (p7: PPKCS7; const cipher: PEVP_CIPHER): TIdC_INT; cdecl = nil; + PKCS7_stream: function (boundary: PPPByte; p7: PPKCS7): TIdC_INT; cdecl = nil; + + PKCS7_get_issuer_and_serial: function (p7: PPKCS7; idx: TIdC_INT): PPKCS7_ISSUER_AND_SERIAL; cdecl = nil; + //function PKCS7_digest_from_attributes(sk: Pointer{PSTACK_OF_X509_ATTRIBUTE}): PASN1_OCTET_STRING; + PKCS7_add_signed_attribute: function (p7si: PPKCS7_SIGNER_INFO; nid: TIdC_INT; type_: TIdC_INT; data: Pointer): TIdC_INT; cdecl = nil; + PKCS7_add_attribute: function (p7si: PPKCS7_SIGNER_INFO; nid: TIdC_INT; atrtype: TIdC_INT; value: Pointer): TIdC_INT; cdecl = nil; + PKCS7_get_attribute: function (si: PPKCS7_SIGNER_INFO; nid: TIdC_INT): PASN1_TYPE; cdecl = nil; + PKCS7_get_signed_attribute: function (si: PPKCS7_SIGNER_INFO; nid: TIdC_INT): PASN1_TYPE; cdecl = nil; + //function PKCS7_set_signed_attributes(p7si: PPKCS7_SIGNER_INFO; sk: PSTACK_OF_X509): TIdC_INT; + //function PKCS7_set_attributes(p7si: PPKCS7_SIGNER_INFO; sk: PSTACK_OF_X509_ATTRIBUTE): TIdC_INT; + + //function PKCS7_sign(signcert: PX509; pkey: PEVP_PKEY; certs: PSTACK_OF_X509; data: PBIO; flags: TIdC_INT): PPKCS7; + + PKCS7_sign_add_signer: function (p7: PPKCS7; signcert: PX509; pkey: PEVP_PKEY; const md: PEVP_MD; flags: TIdC_INT): PPKCS7_SIGNER_INFO; cdecl = nil; + + PKCS7_final: function (p7: PPKCS7; data: PBIO; flags: TIdC_INT): TIdC_INT; cdecl = nil; + //function PKCS7_verify(p7: PPKCS7; certs: PSTACK_OF_X509; store: PX509_STORE; indata: PBIO; out_: PBIO; flags: TIdC_INT): TIdC_INT; + //function PKCS7_get0_signers(p7: PPKCS7; certs: PSTACK_OF_X509; flags: TIdC_INT): PSTACK_OF_X509; + //function PKCS7_encrypt(certs: PSTACK_OF_X509; in_: PBIO; const cipher: PEVP_CIPHER; flags: TIdC_INT): PPKCS7; + PKCS7_decrypt: function (p7: PPKCS7; pkey: PEVP_PKEY; cert: PX509; data: PBIO; flags: TIdC_INT): TIdC_INT; cdecl = nil; + + //function PKCS7_add_attrib_smimecap(si: PPKCS7_SIGNER_INFO; cap: PSTACK_OF_X509_ALGOR): TIdC_INT; + //function PKCS7_get_smimecap(si: PPKCS7_SIGNER_INFO): PSTACK_OF_X509_ALGOR; + //function PKCS7_simple_smimecap(sk: PSTACK_OF_X509_ALGOR; nid: TIdC_INT; arg: TIdC_INT): TIdC_INT; + + PKCS7_add_attrib_content_type: function (si: PPKCS7_SIGNER_INFO; coid: PASN1_OBJECT): TIdC_INT; cdecl = nil; + PKCS7_add0_attrib_signing_time: function (si: PPKCS7_SIGNER_INFO; t: PASN1_TIME): TIdC_INT; cdecl = nil; + PKCS7_add1_attrib_digest: function (si: PPKCS7_SIGNER_INFO; const md: PByte; mdlen: TIdC_INT): TIdC_INT; cdecl = nil; + + SMIME_write_PKCS7: function (bio: PBIO; p7: PPKCS7; data: PBIO; flags: TIdC_INT): TIdC_INT; cdecl = nil; + SMIME_read_PKCS7: function (bio: PBIO; bcont: PPBIO): PPKCS7; cdecl = nil; + + BIO_new_PKCS7: function (out_: PBIO; p7: PPKCS7): PBIO; cdecl = nil; + +{$ELSE} + function PKCS7_ISSUER_AND_SERIAL_digest(data: PPKCS7_ISSUER_AND_SERIAL; const type_: PEVP_MD; md: PByte; len: PIdC_UINT): TIdC_INT cdecl; external CLibCrypto; + + function PKCS7_dup(p7: PPKCS7): PPKCS7 cdecl; external CLibCrypto; + function d2i_PKCS7_bio(bp: PBIO; p7: PPPKCS7): PPKCS7 cdecl; external CLibCrypto; + function i2d_PKCS7_bio(bp: PBIO; p7: PPKCS7): TIdC_INT cdecl; external CLibCrypto; + function i2d_PKCS7_bio_stream(out_: PBIO; p7: PPKCS7; in_: PBIO; flags: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function PEM_write_bio_PKCS7_stream(out_: PBIO; p7: PPKCS7; in_: PBIO; flags: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + +// function PKCS7_SIGNER_INFO_new: PPKCS7_SIGNER_INFO; +// procedure PKCS7_SIGNER_INFO_free(a: PPKCS7_SIGNER_INFO); +// function d2i_PKCS7_SIGNER_INFO(a: PPPKCS7_SIGNER_INFO; const in_: PByte; len: TIdC_LONG): PPKCS7_SIGNER_INFO; +// function i2d_PKCS7_SIGNER_INFO(const a: PPKCS7_SIGNER_INFO; out_: PByte): TIdC_INT; +// function PKCS7_SIGNER_INFO_it: PASN1_ITEM; +// +// function PKCS7_RECIP_INFO_new: PPKCS7_RECIP_INFO; +// procedure PKCS7_RECIP_INFO_free(a: PPKCS7_RECIP_INFO); +// function d2i_PKCS7_RECIP_INFO(a: PPPKCS7_RECIP_INFO; const in_: PByte; len: TIdC_LONG): PPKCS7_RECIP_INFO; +// function i2d_PKCS7_RECIP_INFO(const a: PPKCS7_RECIP_INFO; out_: PByte): TIdC_INT; +// function PKCS7_RECIP_INFO_it: PASN1_ITEM; +// +// function PKCS7_SIGNED_new: PPKCS7_SIGNED; +// procedure PKCS7_SIGNED_free(a: PPKCS7_SIGNED); +// function d2i_PKCS7_SIGNED(a: PPPKCS7_SIGNED; const in_: PByte; len: TIdC_LONG): PPKCS7_SIGNED; +// function i2d_PKCS7_SIGNED(const a: PPKCS7_SIGNED; out_: PByte): TIdC_INT; +// function PKCS7_SIGNED_it: PASN1_ITEM; +// +// function PKCS7_ENC_CONTENT_new: PPKCS7_ENC_CONTENT; +// procedure PKCS7_ENC_CONTENT_free(a: PPKCS7_ENC_CONTENT); +// function d2i_PKCS7_ENC_CONTENT(a: PPPKCS7_ENC_CONTENT; const in_: PByte; len: TIdC_LONG): PPKCS7_ENC_CONTENT; +// function i2d_PKCS7_ENC_CONTENT(const a: PPKCS7_ENC_CONTENT; out_: PByte): TIdC_INT; +// function PKCS7_ENC_CONTENT_it: PASN1_ITEM; +// +// function PKCS7_ENVELOPE_new: PPKCS7_ENVELOPE; +// procedure PKCS7_ENVELOPE_free(a: PPKCS7_ENVELOPE); +// function d2i_PKCS7_ENVELOPE(a: PPPKCS7_ENVELOPE; const in_: PByte; len: TIdC_LONG): PPKCS7_ENVELOPE; +// function i2d_PKCS7_ENVELOPE(const a: PPKCS7_ENVELOPE; out_: PByte): TIdC_INT; +// function PKCS7_ENVELOPE_it: PASN1_ITEM; +// +// function PKCS7_SIGN_ENVELOPE_new: PPKCS7_SIGN_ENVELOPE; +// procedure PKCS7_SIGN_ENVELOPE_free(a: PPKCS7_SIGN_ENVELOPE); +// function d2i_PKCS7_SIGN_ENVELOPE(a: PPPKCS7_SIGN_ENVELOPE; const in_: PByte; len: TIdC_LONG): PPKCS7_SIGN_ENVELOPE; +// function i2d_PKCS7_SIGN_ENVELOPE(const a: PPKCS7_SIGN_ENVELOPE; out_: PByte): TIdC_INT; +// function PKCS7_SIGN_ENVELOPE_it: PASN1_ITEM; +// +// function PKCS7_DIGEST_new: PPKCS7_DIGEST; +// procedure PKCS7_DIGEST_free(a: PPKCS7_DIGEST); +// function d2i_PKCS7_DIGEST(a: PPPKCS7_DIGEST; const in_: PByte; len: TIdC_LONG): PPKCS7_DIGEST; +// function i2d_PKCS7_DIGEST(const a: PPKCS7_DIGEST; out_: PByte): TIdC_INT; +// function PKCS7_DIGEST_it: PASN1_ITEM; +// +// function PKCS7_ENCRYPT_new: PPKCS7_ENCRYPT_STRUCT; +// procedure PKCS7_ENCRYPT_free(a: PPKCS7_ENCRYPT_STRUCT); +// function d2i_PKCS7_ENCRYPT(a: PPPKCS7_ENCRYPT_STRUCT; const in_: PByte; len: TIdC_LONG): PPKCS7_ENCRYPT_STRUCT; +// function i2d_PKCS7_ENCRYPT(const a: PPKCS7_ENCRYPT_STRUCT; out_: PByte): TIdC_INT; +// function PKCS7_ENCRYPT_it: PASN1_ITEM; +// +// function PKCS7_new: PPKCS7; +// procedure PKCS7_free(a: PPKCS7); +// function d2i_PKCS7(a: PPPKCS7; const in_: PByte; len: TIdC_LONG): PPKCS7; +// function i2d_PKCS7(const a: PPKCS7; out_: PByte): TIdC_INT; +// function PKCS7_it: PASN1_ITEM; +// +// function PKCS7_ATTR_SIGN_it: PASN1_ITEM; +// +// function PKCS7_ATTR_VERIFY_it: PASN1_ITEM; +// +// function i2d_PKCS7_NDEF(const a: PPKCS7; out_: PPByte): TIdC_INT; +// function PKCS7_print_ctx(out_: PBIO; const x: PPKCS7; indent: TIdC_INT; const pctx: PASN1_PCTX): TIdC_INT; + + function PKCS7_ctrl(p7: PPKCS7; cmd: TIdC_INT; larg: TIdC_LONG; parg: PIdAnsiChar): TIdC_LONG cdecl; external CLibCrypto; + + function PKCS7_set_type(p7: PPKCS7; type_: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function PKCS7_set0_type_other(p7: PPKCS7; type_: TIdC_INT; other: PASN1_TYPE): TIdC_INT cdecl; external CLibCrypto; + function PKCS7_set_content(p7: PPKCS7; p7_data: PPKCS7): TIdC_INT cdecl; external CLibCrypto; + function PKCS7_SIGNER_INFO_set(p7i: PPKCS7_SIGNER_INFO; x509: PX509; pkey: PEVP_PKEY; const dgst: PEVP_MD): TIdC_INT cdecl; external CLibCrypto; + function PKCS7_SIGNER_INFO_sign(si: PPKCS7_SIGNER_INFO): TIdC_INT cdecl; external CLibCrypto; + function PKCS7_add_signer(p7: PPKCS7; p7i: PPKCS7_SIGNER_INFO): TIdC_INT cdecl; external CLibCrypto; + function PKCS7_add_certificate(p7: PPKCS7; x509: PX509): TIdC_INT cdecl; external CLibCrypto; + function PKCS7_add_crl(p7: PPKCS7; x509: PX509_CRL): TIdC_INT cdecl; external CLibCrypto; + function PKCS7_content_new(p7: PPKCS7; nid: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function PKCS7_dataVerify(cert_store: PX509_STORE; ctx: PX509_STORE_CTX; bio: PBIO; p7: PPKCS7; si: PPKCS7_SIGNER_INFO): TIdC_INT cdecl; external CLibCrypto; + function PKCS7_signatureVerify(bio: PBIO; p7: PPKCS7; si: PPKCS7_SIGNER_INFO; x509: PX509): TIdC_INT cdecl; external CLibCrypto; + + function PKCS7_dataInit(p7: PPKCS7; bio: PBIO): PBIO cdecl; external CLibCrypto; + function PKCS7_dataFinal(p7: PPKCS7; bio: PBIO): TIdC_INT cdecl; external CLibCrypto; + function PKCS7_dataDecode(p7: PPKCS7; pkey: PEVP_PKEY; in_bio: PBIO; pcert: PX509): PBIO cdecl; external CLibCrypto; + + function PKCS7_add_signature(p7: PPKCS7; x509: PX509; pkey: PEVP_PKEY; const dgst: PEVP_MD): PPKCS7_SIGNER_INFO cdecl; external CLibCrypto; + function PKCS7_cert_from_signer_info(p7: PPKCS7; si: PPKCS7_SIGNER_INFO): PX509 cdecl; external CLibCrypto; + function PKCS7_set_digest(p7: PPKCS7; const md: PEVP_MD): TIdC_INT cdecl; external CLibCrypto; +// function PKCS7_get_signer_info(p7: PPKCS7): PSTACK_OF_PKCS7_SIGNER_INFO; + + function PKCS7_add_recipient(p7: PPKCS7; x509: PX509): PPKCS7_RECIP_INFO cdecl; external CLibCrypto; + procedure PKCS7_SIGNER_INFO_get0_algs(si: PPKCS7_SIGNER_INFO; pk: PPEVP_PKEY; pdig: PPX509_ALGOR; psig: PPX509_ALGOR) cdecl; external CLibCrypto; + procedure PKCS7_RECIP_INFO_get0_alg(ri: PPKCS7_RECIP_INFO; penc: PPX509_ALGOR) cdecl; external CLibCrypto; + function PKCS7_add_recipient_info(p7: PPKCS7; ri: PPKCS7_RECIP_INFO): TIdC_INT cdecl; external CLibCrypto; + function PKCS7_RECIP_INFO_set(p7i: PPKCS7_RECIP_INFO; x509: PX509): TIdC_INT cdecl; external CLibCrypto; + function PKCS7_set_cipher(p7: PPKCS7; const cipher: PEVP_CIPHER): TIdC_INT cdecl; external CLibCrypto; + function PKCS7_stream(boundary: PPPByte; p7: PPKCS7): TIdC_INT cdecl; external CLibCrypto; + + function PKCS7_get_issuer_and_serial(p7: PPKCS7; idx: TIdC_INT): PPKCS7_ISSUER_AND_SERIAL cdecl; external CLibCrypto; + //function PKCS7_digest_from_attributes(sk: Pointer{PSTACK_OF_X509_ATTRIBUTE}): PASN1_OCTET_STRING; + function PKCS7_add_signed_attribute(p7si: PPKCS7_SIGNER_INFO; nid: TIdC_INT; type_: TIdC_INT; data: Pointer): TIdC_INT cdecl; external CLibCrypto; + function PKCS7_add_attribute(p7si: PPKCS7_SIGNER_INFO; nid: TIdC_INT; atrtype: TIdC_INT; value: Pointer): TIdC_INT cdecl; external CLibCrypto; + function PKCS7_get_attribute(si: PPKCS7_SIGNER_INFO; nid: TIdC_INT): PASN1_TYPE cdecl; external CLibCrypto; + function PKCS7_get_signed_attribute(si: PPKCS7_SIGNER_INFO; nid: TIdC_INT): PASN1_TYPE cdecl; external CLibCrypto; + //function PKCS7_set_signed_attributes(p7si: PPKCS7_SIGNER_INFO; sk: PSTACK_OF_X509): TIdC_INT; + //function PKCS7_set_attributes(p7si: PPKCS7_SIGNER_INFO; sk: PSTACK_OF_X509_ATTRIBUTE): TIdC_INT; + + //function PKCS7_sign(signcert: PX509; pkey: PEVP_PKEY; certs: PSTACK_OF_X509; data: PBIO; flags: TIdC_INT): PPKCS7; + + function PKCS7_sign_add_signer(p7: PPKCS7; signcert: PX509; pkey: PEVP_PKEY; const md: PEVP_MD; flags: TIdC_INT): PPKCS7_SIGNER_INFO cdecl; external CLibCrypto; + + function PKCS7_final(p7: PPKCS7; data: PBIO; flags: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + //function PKCS7_verify(p7: PPKCS7; certs: PSTACK_OF_X509; store: PX509_STORE; indata: PBIO; out_: PBIO; flags: TIdC_INT): TIdC_INT; + //function PKCS7_get0_signers(p7: PPKCS7; certs: PSTACK_OF_X509; flags: TIdC_INT): PSTACK_OF_X509; + //function PKCS7_encrypt(certs: PSTACK_OF_X509; in_: PBIO; const cipher: PEVP_CIPHER; flags: TIdC_INT): PPKCS7; + function PKCS7_decrypt(p7: PPKCS7; pkey: PEVP_PKEY; cert: PX509; data: PBIO; flags: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + + //function PKCS7_add_attrib_smimecap(si: PPKCS7_SIGNER_INFO; cap: PSTACK_OF_X509_ALGOR): TIdC_INT; + //function PKCS7_get_smimecap(si: PPKCS7_SIGNER_INFO): PSTACK_OF_X509_ALGOR; + //function PKCS7_simple_smimecap(sk: PSTACK_OF_X509_ALGOR; nid: TIdC_INT; arg: TIdC_INT): TIdC_INT; + + function PKCS7_add_attrib_content_type(si: PPKCS7_SIGNER_INFO; coid: PASN1_OBJECT): TIdC_INT cdecl; external CLibCrypto; + function PKCS7_add0_attrib_signing_time(si: PPKCS7_SIGNER_INFO; t: PASN1_TIME): TIdC_INT cdecl; external CLibCrypto; + function PKCS7_add1_attrib_digest(si: PPKCS7_SIGNER_INFO; const md: PByte; mdlen: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + + function SMIME_write_PKCS7(bio: PBIO; p7: PPKCS7; data: PBIO; flags: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function SMIME_read_PKCS7(bio: PBIO; bcont: PPBIO): PPKCS7 cdecl; external CLibCrypto; + + function BIO_new_PKCS7(out_: PBIO; p7: PPKCS7): PBIO cdecl; external CLibCrypto; + +{$ENDIF} + +implementation + + uses + classes, + IdSSLOpenSSLExceptionHandlers, + IdResourceStringsOpenSSL + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + ,IdSSLOpenSSLLoader + {$ENDIF}; + + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +const + PKCS7_ISSUER_AND_SERIAL_digest_procname = 'PKCS7_ISSUER_AND_SERIAL_digest'; + + PKCS7_dup_procname = 'PKCS7_dup'; + d2i_PKCS7_bio_procname = 'd2i_PKCS7_bio'; + i2d_PKCS7_bio_procname = 'i2d_PKCS7_bio'; + i2d_PKCS7_bio_stream_procname = 'i2d_PKCS7_bio_stream'; + PEM_write_bio_PKCS7_stream_procname = 'PEM_write_bio_PKCS7_stream'; + +// function PKCS7_SIGNER_INFO_new: PPKCS7_SIGNER_INFO; +// procedure PKCS7_SIGNER_INFO_free(a: PPKCS7_SIGNER_INFO); +// function d2i_PKCS7_SIGNER_INFO(a: PPPKCS7_SIGNER_INFO; const in_: PByte; len: TIdC_LONG): PPKCS7_SIGNER_INFO; +// function i2d_PKCS7_SIGNER_INFO(const a: PPKCS7_SIGNER_INFO; out_: PByte): TIdC_INT; +// function PKCS7_SIGNER_INFO_it: PASN1_ITEM; +// +// function PKCS7_RECIP_INFO_new: PPKCS7_RECIP_INFO; +// procedure PKCS7_RECIP_INFO_free(a: PPKCS7_RECIP_INFO); +// function d2i_PKCS7_RECIP_INFO(a: PPPKCS7_RECIP_INFO; const in_: PByte; len: TIdC_LONG): PPKCS7_RECIP_INFO; +// function i2d_PKCS7_RECIP_INFO(const a: PPKCS7_RECIP_INFO; out_: PByte): TIdC_INT; +// function PKCS7_RECIP_INFO_it: PASN1_ITEM; +// +// function PKCS7_SIGNED_new: PPKCS7_SIGNED; +// procedure PKCS7_SIGNED_free(a: PPKCS7_SIGNED); +// function d2i_PKCS7_SIGNED(a: PPPKCS7_SIGNED; const in_: PByte; len: TIdC_LONG): PPKCS7_SIGNED; +// function i2d_PKCS7_SIGNED(const a: PPKCS7_SIGNED; out_: PByte): TIdC_INT; +// function PKCS7_SIGNED_it: PASN1_ITEM; +// +// function PKCS7_ENC_CONTENT_new: PPKCS7_ENC_CONTENT; +// procedure PKCS7_ENC_CONTENT_free(a: PPKCS7_ENC_CONTENT); +// function d2i_PKCS7_ENC_CONTENT(a: PPPKCS7_ENC_CONTENT; const in_: PByte; len: TIdC_LONG): PPKCS7_ENC_CONTENT; +// function i2d_PKCS7_ENC_CONTENT(const a: PPKCS7_ENC_CONTENT; out_: PByte): TIdC_INT; +// function PKCS7_ENC_CONTENT_it: PASN1_ITEM; +// +// function PKCS7_ENVELOPE_new: PPKCS7_ENVELOPE; +// procedure PKCS7_ENVELOPE_free(a: PPKCS7_ENVELOPE); +// function d2i_PKCS7_ENVELOPE(a: PPPKCS7_ENVELOPE; const in_: PByte; len: TIdC_LONG): PPKCS7_ENVELOPE; +// function i2d_PKCS7_ENVELOPE(const a: PPKCS7_ENVELOPE; out_: PByte): TIdC_INT; +// function PKCS7_ENVELOPE_it: PASN1_ITEM; +// +// function PKCS7_SIGN_ENVELOPE_new: PPKCS7_SIGN_ENVELOPE; +// procedure PKCS7_SIGN_ENVELOPE_free(a: PPKCS7_SIGN_ENVELOPE); +// function d2i_PKCS7_SIGN_ENVELOPE(a: PPPKCS7_SIGN_ENVELOPE; const in_: PByte; len: TIdC_LONG): PPKCS7_SIGN_ENVELOPE; +// function i2d_PKCS7_SIGN_ENVELOPE(const a: PPKCS7_SIGN_ENVELOPE; out_: PByte): TIdC_INT; +// function PKCS7_SIGN_ENVELOPE_it: PASN1_ITEM; +// +// function PKCS7_DIGEST_new: PPKCS7_DIGEST; +// procedure PKCS7_DIGEST_free(a: PPKCS7_DIGEST); +// function d2i_PKCS7_DIGEST(a: PPPKCS7_DIGEST; const in_: PByte; len: TIdC_LONG): PPKCS7_DIGEST; +// function i2d_PKCS7_DIGEST(const a: PPKCS7_DIGEST; out_: PByte): TIdC_INT; +// function PKCS7_DIGEST_it: PASN1_ITEM; +// +// function PKCS7_ENCRYPT_new: PPKCS7_ENCRYPT_STRUCT; +// procedure PKCS7_ENCRYPT_free(a: PPKCS7_ENCRYPT_STRUCT); +// function d2i_PKCS7_ENCRYPT(a: PPPKCS7_ENCRYPT_STRUCT; const in_: PByte; len: TIdC_LONG): PPKCS7_ENCRYPT_STRUCT; +// function i2d_PKCS7_ENCRYPT(const a: PPKCS7_ENCRYPT_STRUCT; out_: PByte): TIdC_INT; +// function PKCS7_ENCRYPT_it: PASN1_ITEM; +// +// function PKCS7_new: PPKCS7; +// procedure PKCS7_free(a: PPKCS7); +// function d2i_PKCS7(a: PPPKCS7; const in_: PByte; len: TIdC_LONG): PPKCS7; +// function i2d_PKCS7(const a: PPKCS7; out_: PByte): TIdC_INT; +// function PKCS7_it: PASN1_ITEM; +// +// function PKCS7_ATTR_SIGN_it: PASN1_ITEM; +// +// function PKCS7_ATTR_VERIFY_it: PASN1_ITEM; +// +// function i2d_PKCS7_NDEF(const a: PPKCS7; out_: PPByte): TIdC_INT; +// function PKCS7_print_ctx(out_: PBIO; const x: PPKCS7; indent: TIdC_INT; const pctx: PASN1_PCTX): TIdC_INT; + + PKCS7_ctrl_procname = 'PKCS7_ctrl'; + + PKCS7_set_type_procname = 'PKCS7_set_type'; + PKCS7_set0_type_other_procname = 'PKCS7_set0_type_other'; + PKCS7_set_content_procname = 'PKCS7_set_content'; + PKCS7_SIGNER_INFO_set_procname = 'PKCS7_SIGNER_INFO_set'; + PKCS7_SIGNER_INFO_sign_procname = 'PKCS7_SIGNER_INFO_sign'; + PKCS7_add_signer_procname = 'PKCS7_add_signer'; + PKCS7_add_certificate_procname = 'PKCS7_add_certificate'; + PKCS7_add_crl_procname = 'PKCS7_add_crl'; + PKCS7_content_new_procname = 'PKCS7_content_new'; + PKCS7_dataVerify_procname = 'PKCS7_dataVerify'; + PKCS7_signatureVerify_procname = 'PKCS7_signatureVerify'; + + PKCS7_dataInit_procname = 'PKCS7_dataInit'; + PKCS7_dataFinal_procname = 'PKCS7_dataFinal'; + PKCS7_dataDecode_procname = 'PKCS7_dataDecode'; + + PKCS7_add_signature_procname = 'PKCS7_add_signature'; + PKCS7_cert_from_signer_info_procname = 'PKCS7_cert_from_signer_info'; + PKCS7_set_digest_procname = 'PKCS7_set_digest'; +// function PKCS7_get_signer_info(p7: PPKCS7): PSTACK_OF_PKCS7_SIGNER_INFO; + + PKCS7_add_recipient_procname = 'PKCS7_add_recipient'; + PKCS7_SIGNER_INFO_get0_algs_procname = 'PKCS7_SIGNER_INFO_get0_algs'; + PKCS7_RECIP_INFO_get0_alg_procname = 'PKCS7_RECIP_INFO_get0_alg'; + PKCS7_add_recipient_info_procname = 'PKCS7_add_recipient_info'; + PKCS7_RECIP_INFO_set_procname = 'PKCS7_RECIP_INFO_set'; + PKCS7_set_cipher_procname = 'PKCS7_set_cipher'; + PKCS7_stream_procname = 'PKCS7_stream'; + + PKCS7_get_issuer_and_serial_procname = 'PKCS7_get_issuer_and_serial'; + //function PKCS7_digest_from_attributes(sk: Pointer{PSTACK_OF_X509_ATTRIBUTE}): PASN1_OCTET_STRING; + PKCS7_add_signed_attribute_procname = 'PKCS7_add_signed_attribute'; + PKCS7_add_attribute_procname = 'PKCS7_add_attribute'; + PKCS7_get_attribute_procname = 'PKCS7_get_attribute'; + PKCS7_get_signed_attribute_procname = 'PKCS7_get_signed_attribute'; + //function PKCS7_set_signed_attributes(p7si: PPKCS7_SIGNER_INFO; sk: PSTACK_OF_X509): TIdC_INT; + //function PKCS7_set_attributes(p7si: PPKCS7_SIGNER_INFO; sk: PSTACK_OF_X509_ATTRIBUTE): TIdC_INT; + + //function PKCS7_sign(signcert: PX509; pkey: PEVP_PKEY; certs: PSTACK_OF_X509; data: PBIO; flags: TIdC_INT): PPKCS7; + + PKCS7_sign_add_signer_procname = 'PKCS7_sign_add_signer'; + + PKCS7_final_procname = 'PKCS7_final'; + //function PKCS7_verify(p7: PPKCS7; certs: PSTACK_OF_X509; store: PX509_STORE; indata: PBIO; out_: PBIO; flags: TIdC_INT): TIdC_INT; + //function PKCS7_get0_signers(p7: PPKCS7; certs: PSTACK_OF_X509; flags: TIdC_INT): PSTACK_OF_X509; + //function PKCS7_encrypt(certs: PSTACK_OF_X509; in_: PBIO; const cipher: PEVP_CIPHER; flags: TIdC_INT): PPKCS7; + PKCS7_decrypt_procname = 'PKCS7_decrypt'; + + //function PKCS7_add_attrib_smimecap(si: PPKCS7_SIGNER_INFO; cap: PSTACK_OF_X509_ALGOR): TIdC_INT; + //function PKCS7_get_smimecap(si: PPKCS7_SIGNER_INFO): PSTACK_OF_X509_ALGOR; + //function PKCS7_simple_smimecap(sk: PSTACK_OF_X509_ALGOR; nid: TIdC_INT; arg: TIdC_INT): TIdC_INT; + + PKCS7_add_attrib_content_type_procname = 'PKCS7_add_attrib_content_type'; + PKCS7_add0_attrib_signing_time_procname = 'PKCS7_add0_attrib_signing_time'; + PKCS7_add1_attrib_digest_procname = 'PKCS7_add1_attrib_digest'; + + SMIME_write_PKCS7_procname = 'SMIME_write_PKCS7'; + SMIME_read_PKCS7_procname = 'SMIME_read_PKCS7'; + + BIO_new_PKCS7_procname = 'BIO_new_PKCS7'; + + +{$WARN NO_RETVAL OFF} +function ERR_PKCS7_ISSUER_AND_SERIAL_digest(data: PPKCS7_ISSUER_AND_SERIAL; const type_: PEVP_MD; md: PByte; len: PIdC_UINT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS7_ISSUER_AND_SERIAL_digest_procname); +end; + + + +function ERR_PKCS7_dup(p7: PPKCS7): PPKCS7; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS7_dup_procname); +end; + + +function ERR_d2i_PKCS7_bio(bp: PBIO; p7: PPPKCS7): PPKCS7; +begin + EIdAPIFunctionNotPresent.RaiseException(d2i_PKCS7_bio_procname); +end; + + +function ERR_i2d_PKCS7_bio(bp: PBIO; p7: PPKCS7): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(i2d_PKCS7_bio_procname); +end; + + +function ERR_i2d_PKCS7_bio_stream(out_: PBIO; p7: PPKCS7; in_: PBIO; flags: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(i2d_PKCS7_bio_stream_procname); +end; + + +function ERR_PEM_write_bio_PKCS7_stream(out_: PBIO; p7: PPKCS7; in_: PBIO; flags: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(PEM_write_bio_PKCS7_stream_procname); +end; + + + +// function PKCS7_SIGNER_INFO_new: PPKCS7_SIGNER_INFO; +// procedure PKCS7_SIGNER_INFO_free(a: PPKCS7_SIGNER_INFO); +// function d2i_PKCS7_SIGNER_INFO(a: PPPKCS7_SIGNER_INFO; const in_: PByte; len: TIdC_LONG): PPKCS7_SIGNER_INFO; +// function i2d_PKCS7_SIGNER_INFO(const a: PPKCS7_SIGNER_INFO; out_: PByte): TIdC_INT; +// function PKCS7_SIGNER_INFO_it: PASN1_ITEM; +// +// function PKCS7_RECIP_INFO_new: PPKCS7_RECIP_INFO; +// procedure PKCS7_RECIP_INFO_free(a: PPKCS7_RECIP_INFO); +// function d2i_PKCS7_RECIP_INFO(a: PPPKCS7_RECIP_INFO; const in_: PByte; len: TIdC_LONG): PPKCS7_RECIP_INFO; +// function i2d_PKCS7_RECIP_INFO(const a: PPKCS7_RECIP_INFO; out_: PByte): TIdC_INT; +// function PKCS7_RECIP_INFO_it: PASN1_ITEM; +// +// function PKCS7_SIGNED_new: PPKCS7_SIGNED; +// procedure PKCS7_SIGNED_free(a: PPKCS7_SIGNED); +// function d2i_PKCS7_SIGNED(a: PPPKCS7_SIGNED; const in_: PByte; len: TIdC_LONG): PPKCS7_SIGNED; +// function i2d_PKCS7_SIGNED(const a: PPKCS7_SIGNED; out_: PByte): TIdC_INT; +// function PKCS7_SIGNED_it: PASN1_ITEM; +// +// function PKCS7_ENC_CONTENT_new: PPKCS7_ENC_CONTENT; +// procedure PKCS7_ENC_CONTENT_free(a: PPKCS7_ENC_CONTENT); +// function d2i_PKCS7_ENC_CONTENT(a: PPPKCS7_ENC_CONTENT; const in_: PByte; len: TIdC_LONG): PPKCS7_ENC_CONTENT; +// function i2d_PKCS7_ENC_CONTENT(const a: PPKCS7_ENC_CONTENT; out_: PByte): TIdC_INT; +// function PKCS7_ENC_CONTENT_it: PASN1_ITEM; +// +// function PKCS7_ENVELOPE_new: PPKCS7_ENVELOPE; +// procedure PKCS7_ENVELOPE_free(a: PPKCS7_ENVELOPE); +// function d2i_PKCS7_ENVELOPE(a: PPPKCS7_ENVELOPE; const in_: PByte; len: TIdC_LONG): PPKCS7_ENVELOPE; +// function i2d_PKCS7_ENVELOPE(const a: PPKCS7_ENVELOPE; out_: PByte): TIdC_INT; +// function PKCS7_ENVELOPE_it: PASN1_ITEM; +// +// function PKCS7_SIGN_ENVELOPE_new: PPKCS7_SIGN_ENVELOPE; +// procedure PKCS7_SIGN_ENVELOPE_free(a: PPKCS7_SIGN_ENVELOPE); +// function d2i_PKCS7_SIGN_ENVELOPE(a: PPPKCS7_SIGN_ENVELOPE; const in_: PByte; len: TIdC_LONG): PPKCS7_SIGN_ENVELOPE; +// function i2d_PKCS7_SIGN_ENVELOPE(const a: PPKCS7_SIGN_ENVELOPE; out_: PByte): TIdC_INT; +// function PKCS7_SIGN_ENVELOPE_it: PASN1_ITEM; +// +// function PKCS7_DIGEST_new: PPKCS7_DIGEST; +// procedure PKCS7_DIGEST_free(a: PPKCS7_DIGEST); +// function d2i_PKCS7_DIGEST(a: PPPKCS7_DIGEST; const in_: PByte; len: TIdC_LONG): PPKCS7_DIGEST; +// function i2d_PKCS7_DIGEST(const a: PPKCS7_DIGEST; out_: PByte): TIdC_INT; +// function PKCS7_DIGEST_it: PASN1_ITEM; +// +// function PKCS7_ENCRYPT_new: PPKCS7_ENCRYPT_STRUCT; +// procedure PKCS7_ENCRYPT_free(a: PPKCS7_ENCRYPT_STRUCT); +// function d2i_PKCS7_ENCRYPT(a: PPPKCS7_ENCRYPT_STRUCT; const in_: PByte; len: TIdC_LONG): PPKCS7_ENCRYPT_STRUCT; +// function i2d_PKCS7_ENCRYPT(const a: PPKCS7_ENCRYPT_STRUCT; out_: PByte): TIdC_INT; +// function PKCS7_ENCRYPT_it: PASN1_ITEM; +// +// function PKCS7_new: PPKCS7; +// procedure PKCS7_free(a: PPKCS7); +// function d2i_PKCS7(a: PPPKCS7; const in_: PByte; len: TIdC_LONG): PPKCS7; +// function i2d_PKCS7(const a: PPKCS7; out_: PByte): TIdC_INT; +// function PKCS7_it: PASN1_ITEM; +// +// function PKCS7_ATTR_SIGN_it: PASN1_ITEM; +// +// function PKCS7_ATTR_VERIFY_it: PASN1_ITEM; +// +// function i2d_PKCS7_NDEF(const a: PPKCS7; out_: PPByte): TIdC_INT; +// function PKCS7_print_ctx(out_: PBIO; const x: PPKCS7; indent: TIdC_INT; const pctx: PASN1_PCTX): TIdC_INT; + +function ERR_PKCS7_ctrl(p7: PPKCS7; cmd: TIdC_INT; larg: TIdC_LONG; parg: PIdAnsiChar): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS7_ctrl_procname); +end; + + + +function ERR_PKCS7_set_type(p7: PPKCS7; type_: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS7_set_type_procname); +end; + + +function ERR_PKCS7_set0_type_other(p7: PPKCS7; type_: TIdC_INT; other: PASN1_TYPE): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS7_set0_type_other_procname); +end; + + +function ERR_PKCS7_set_content(p7: PPKCS7; p7_data: PPKCS7): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS7_set_content_procname); +end; + + +function ERR_PKCS7_SIGNER_INFO_set(p7i: PPKCS7_SIGNER_INFO; x509: PX509; pkey: PEVP_PKEY; const dgst: PEVP_MD): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS7_SIGNER_INFO_set_procname); +end; + + +function ERR_PKCS7_SIGNER_INFO_sign(si: PPKCS7_SIGNER_INFO): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS7_SIGNER_INFO_sign_procname); +end; + + +function ERR_PKCS7_add_signer(p7: PPKCS7; p7i: PPKCS7_SIGNER_INFO): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS7_add_signer_procname); +end; + + +function ERR_PKCS7_add_certificate(p7: PPKCS7; x509: PX509): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS7_add_certificate_procname); +end; + + +function ERR_PKCS7_add_crl(p7: PPKCS7; x509: PX509_CRL): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS7_add_crl_procname); +end; + + +function ERR_PKCS7_content_new(p7: PPKCS7; nid: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS7_content_new_procname); +end; + + +function ERR_PKCS7_dataVerify(cert_store: PX509_STORE; ctx: PX509_STORE_CTX; bio: PBIO; p7: PPKCS7; si: PPKCS7_SIGNER_INFO): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS7_dataVerify_procname); +end; + + +function ERR_PKCS7_signatureVerify(bio: PBIO; p7: PPKCS7; si: PPKCS7_SIGNER_INFO; x509: PX509): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS7_signatureVerify_procname); +end; + + + +function ERR_PKCS7_dataInit(p7: PPKCS7; bio: PBIO): PBIO; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS7_dataInit_procname); +end; + + +function ERR_PKCS7_dataFinal(p7: PPKCS7; bio: PBIO): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS7_dataFinal_procname); +end; + + +function ERR_PKCS7_dataDecode(p7: PPKCS7; pkey: PEVP_PKEY; in_bio: PBIO; pcert: PX509): PBIO; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS7_dataDecode_procname); +end; + + + +function ERR_PKCS7_add_signature(p7: PPKCS7; x509: PX509; pkey: PEVP_PKEY; const dgst: PEVP_MD): PPKCS7_SIGNER_INFO; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS7_add_signature_procname); +end; + + +function ERR_PKCS7_cert_from_signer_info(p7: PPKCS7; si: PPKCS7_SIGNER_INFO): PX509; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS7_cert_from_signer_info_procname); +end; + + +function ERR_PKCS7_set_digest(p7: PPKCS7; const md: PEVP_MD): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS7_set_digest_procname); +end; + + +// function PKCS7_get_signer_info(p7: PPKCS7): PSTACK_OF_PKCS7_SIGNER_INFO; + +function ERR_PKCS7_add_recipient(p7: PPKCS7; x509: PX509): PPKCS7_RECIP_INFO; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS7_add_recipient_procname); +end; + + +procedure ERR_PKCS7_SIGNER_INFO_get0_algs(si: PPKCS7_SIGNER_INFO; pk: PPEVP_PKEY; pdig: PPX509_ALGOR; psig: PPX509_ALGOR); +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS7_SIGNER_INFO_get0_algs_procname); +end; + + +procedure ERR_PKCS7_RECIP_INFO_get0_alg(ri: PPKCS7_RECIP_INFO; penc: PPX509_ALGOR); +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS7_RECIP_INFO_get0_alg_procname); +end; + + +function ERR_PKCS7_add_recipient_info(p7: PPKCS7; ri: PPKCS7_RECIP_INFO): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS7_add_recipient_info_procname); +end; + + +function ERR_PKCS7_RECIP_INFO_set(p7i: PPKCS7_RECIP_INFO; x509: PX509): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS7_RECIP_INFO_set_procname); +end; + + +function ERR_PKCS7_set_cipher(p7: PPKCS7; const cipher: PEVP_CIPHER): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS7_set_cipher_procname); +end; + + +function ERR_PKCS7_stream(boundary: PPPByte; p7: PPKCS7): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS7_stream_procname); +end; + + + +function ERR_PKCS7_get_issuer_and_serial(p7: PPKCS7; idx: TIdC_INT): PPKCS7_ISSUER_AND_SERIAL; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS7_get_issuer_and_serial_procname); +end; + + + //function PKCS7_digest_from_attributes(sk: Pointer{PSTACK_OF_X509_ATTRIBUTE}): PASN1_OCTET_STRING; +function ERR_PKCS7_add_signed_attribute(p7si: PPKCS7_SIGNER_INFO; nid: TIdC_INT; type_: TIdC_INT; data: Pointer): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS7_add_signed_attribute_procname); +end; + + +function ERR_PKCS7_add_attribute(p7si: PPKCS7_SIGNER_INFO; nid: TIdC_INT; atrtype: TIdC_INT; value: Pointer): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS7_add_attribute_procname); +end; + + +function ERR_PKCS7_get_attribute(si: PPKCS7_SIGNER_INFO; nid: TIdC_INT): PASN1_TYPE; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS7_get_attribute_procname); +end; + + +function ERR_PKCS7_get_signed_attribute(si: PPKCS7_SIGNER_INFO; nid: TIdC_INT): PASN1_TYPE; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS7_get_signed_attribute_procname); +end; + + + //function PKCS7_set_signed_attributes(p7si: PPKCS7_SIGNER_INFO; sk: PSTACK_OF_X509): TIdC_INT; + //function PKCS7_set_attributes(p7si: PPKCS7_SIGNER_INFO; sk: PSTACK_OF_X509_ATTRIBUTE): TIdC_INT; + + //function PKCS7_sign(signcert: PX509; pkey: PEVP_PKEY; certs: PSTACK_OF_X509; data: PBIO; flags: TIdC_INT): PPKCS7; + +function ERR_PKCS7_sign_add_signer(p7: PPKCS7; signcert: PX509; pkey: PEVP_PKEY; const md: PEVP_MD; flags: TIdC_INT): PPKCS7_SIGNER_INFO; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS7_sign_add_signer_procname); +end; + + + +function ERR_PKCS7_final(p7: PPKCS7; data: PBIO; flags: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS7_final_procname); +end; + + + //function PKCS7_verify(p7: PPKCS7; certs: PSTACK_OF_X509; store: PX509_STORE; indata: PBIO; out_: PBIO; flags: TIdC_INT): TIdC_INT; + //function PKCS7_get0_signers(p7: PPKCS7; certs: PSTACK_OF_X509; flags: TIdC_INT): PSTACK_OF_X509; + //function PKCS7_encrypt(certs: PSTACK_OF_X509; in_: PBIO; const cipher: PEVP_CIPHER; flags: TIdC_INT): PPKCS7; +function ERR_PKCS7_decrypt(p7: PPKCS7; pkey: PEVP_PKEY; cert: PX509; data: PBIO; flags: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS7_decrypt_procname); +end; + + + + //function PKCS7_add_attrib_smimecap(si: PPKCS7_SIGNER_INFO; cap: PSTACK_OF_X509_ALGOR): TIdC_INT; + //function PKCS7_get_smimecap(si: PPKCS7_SIGNER_INFO): PSTACK_OF_X509_ALGOR; + //function PKCS7_simple_smimecap(sk: PSTACK_OF_X509_ALGOR; nid: TIdC_INT; arg: TIdC_INT): TIdC_INT; + +function ERR_PKCS7_add_attrib_content_type(si: PPKCS7_SIGNER_INFO; coid: PASN1_OBJECT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS7_add_attrib_content_type_procname); +end; + + +function ERR_PKCS7_add0_attrib_signing_time(si: PPKCS7_SIGNER_INFO; t: PASN1_TIME): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS7_add0_attrib_signing_time_procname); +end; + + +function ERR_PKCS7_add1_attrib_digest(si: PPKCS7_SIGNER_INFO; const md: PByte; mdlen: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS7_add1_attrib_digest_procname); +end; + + + +function ERR_SMIME_write_PKCS7(bio: PBIO; p7: PPKCS7; data: PBIO; flags: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SMIME_write_PKCS7_procname); +end; + + +function ERR_SMIME_read_PKCS7(bio: PBIO; bcont: PPBIO): PPKCS7; +begin + EIdAPIFunctionNotPresent.RaiseException(SMIME_read_PKCS7_procname); +end; + + + +function ERR_BIO_new_PKCS7(out_: PBIO; p7: PPKCS7): PBIO; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_new_PKCS7_procname); +end; + + + +{$WARN NO_RETVAL ON} + +procedure Load(const ADllHandle: TIdLibHandle; LibVersion: TIdC_UINT; const AFailed: TStringList); + +var FuncLoadError: boolean; + +begin + PKCS7_ISSUER_AND_SERIAL_digest := LoadLibFunction(ADllHandle, PKCS7_ISSUER_AND_SERIAL_digest_procname); + FuncLoadError := not assigned(PKCS7_ISSUER_AND_SERIAL_digest); + if FuncLoadError then + begin + {$if not defined(PKCS7_ISSUER_AND_SERIAL_digest_allownil)} + PKCS7_ISSUER_AND_SERIAL_digest := @ERR_PKCS7_ISSUER_AND_SERIAL_digest; + {$ifend} + {$if declared(PKCS7_ISSUER_AND_SERIAL_digest_introduced)} + if LibVersion < PKCS7_ISSUER_AND_SERIAL_digest_introduced then + begin + {$if declared(FC_PKCS7_ISSUER_AND_SERIAL_digest)} + PKCS7_ISSUER_AND_SERIAL_digest := @FC_PKCS7_ISSUER_AND_SERIAL_digest; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS7_ISSUER_AND_SERIAL_digest_removed)} + if PKCS7_ISSUER_AND_SERIAL_digest_removed <= LibVersion then + begin + {$if declared(_PKCS7_ISSUER_AND_SERIAL_digest)} + PKCS7_ISSUER_AND_SERIAL_digest := @_PKCS7_ISSUER_AND_SERIAL_digest; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS7_ISSUER_AND_SERIAL_digest_allownil)} + if FuncLoadError then + AFailed.Add('PKCS7_ISSUER_AND_SERIAL_digest'); + {$ifend} + end; + + + PKCS7_dup := LoadLibFunction(ADllHandle, PKCS7_dup_procname); + FuncLoadError := not assigned(PKCS7_dup); + if FuncLoadError then + begin + {$if not defined(PKCS7_dup_allownil)} + PKCS7_dup := @ERR_PKCS7_dup; + {$ifend} + {$if declared(PKCS7_dup_introduced)} + if LibVersion < PKCS7_dup_introduced then + begin + {$if declared(FC_PKCS7_dup)} + PKCS7_dup := @FC_PKCS7_dup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS7_dup_removed)} + if PKCS7_dup_removed <= LibVersion then + begin + {$if declared(_PKCS7_dup)} + PKCS7_dup := @_PKCS7_dup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS7_dup_allownil)} + if FuncLoadError then + AFailed.Add('PKCS7_dup'); + {$ifend} + end; + + + d2i_PKCS7_bio := LoadLibFunction(ADllHandle, d2i_PKCS7_bio_procname); + FuncLoadError := not assigned(d2i_PKCS7_bio); + if FuncLoadError then + begin + {$if not defined(d2i_PKCS7_bio_allownil)} + d2i_PKCS7_bio := @ERR_d2i_PKCS7_bio; + {$ifend} + {$if declared(d2i_PKCS7_bio_introduced)} + if LibVersion < d2i_PKCS7_bio_introduced then + begin + {$if declared(FC_d2i_PKCS7_bio)} + d2i_PKCS7_bio := @FC_d2i_PKCS7_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(d2i_PKCS7_bio_removed)} + if d2i_PKCS7_bio_removed <= LibVersion then + begin + {$if declared(_d2i_PKCS7_bio)} + d2i_PKCS7_bio := @_d2i_PKCS7_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(d2i_PKCS7_bio_allownil)} + if FuncLoadError then + AFailed.Add('d2i_PKCS7_bio'); + {$ifend} + end; + + + i2d_PKCS7_bio := LoadLibFunction(ADllHandle, i2d_PKCS7_bio_procname); + FuncLoadError := not assigned(i2d_PKCS7_bio); + if FuncLoadError then + begin + {$if not defined(i2d_PKCS7_bio_allownil)} + i2d_PKCS7_bio := @ERR_i2d_PKCS7_bio; + {$ifend} + {$if declared(i2d_PKCS7_bio_introduced)} + if LibVersion < i2d_PKCS7_bio_introduced then + begin + {$if declared(FC_i2d_PKCS7_bio)} + i2d_PKCS7_bio := @FC_i2d_PKCS7_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(i2d_PKCS7_bio_removed)} + if i2d_PKCS7_bio_removed <= LibVersion then + begin + {$if declared(_i2d_PKCS7_bio)} + i2d_PKCS7_bio := @_i2d_PKCS7_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(i2d_PKCS7_bio_allownil)} + if FuncLoadError then + AFailed.Add('i2d_PKCS7_bio'); + {$ifend} + end; + + + i2d_PKCS7_bio_stream := LoadLibFunction(ADllHandle, i2d_PKCS7_bio_stream_procname); + FuncLoadError := not assigned(i2d_PKCS7_bio_stream); + if FuncLoadError then + begin + {$if not defined(i2d_PKCS7_bio_stream_allownil)} + i2d_PKCS7_bio_stream := @ERR_i2d_PKCS7_bio_stream; + {$ifend} + {$if declared(i2d_PKCS7_bio_stream_introduced)} + if LibVersion < i2d_PKCS7_bio_stream_introduced then + begin + {$if declared(FC_i2d_PKCS7_bio_stream)} + i2d_PKCS7_bio_stream := @FC_i2d_PKCS7_bio_stream; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(i2d_PKCS7_bio_stream_removed)} + if i2d_PKCS7_bio_stream_removed <= LibVersion then + begin + {$if declared(_i2d_PKCS7_bio_stream)} + i2d_PKCS7_bio_stream := @_i2d_PKCS7_bio_stream; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(i2d_PKCS7_bio_stream_allownil)} + if FuncLoadError then + AFailed.Add('i2d_PKCS7_bio_stream'); + {$ifend} + end; + + + PEM_write_bio_PKCS7_stream := LoadLibFunction(ADllHandle, PEM_write_bio_PKCS7_stream_procname); + FuncLoadError := not assigned(PEM_write_bio_PKCS7_stream); + if FuncLoadError then + begin + {$if not defined(PEM_write_bio_PKCS7_stream_allownil)} + PEM_write_bio_PKCS7_stream := @ERR_PEM_write_bio_PKCS7_stream; + {$ifend} + {$if declared(PEM_write_bio_PKCS7_stream_introduced)} + if LibVersion < PEM_write_bio_PKCS7_stream_introduced then + begin + {$if declared(FC_PEM_write_bio_PKCS7_stream)} + PEM_write_bio_PKCS7_stream := @FC_PEM_write_bio_PKCS7_stream; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PEM_write_bio_PKCS7_stream_removed)} + if PEM_write_bio_PKCS7_stream_removed <= LibVersion then + begin + {$if declared(_PEM_write_bio_PKCS7_stream)} + PEM_write_bio_PKCS7_stream := @_PEM_write_bio_PKCS7_stream; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PEM_write_bio_PKCS7_stream_allownil)} + if FuncLoadError then + AFailed.Add('PEM_write_bio_PKCS7_stream'); + {$ifend} + end; + + + PKCS7_ctrl := LoadLibFunction(ADllHandle, PKCS7_ctrl_procname); + FuncLoadError := not assigned(PKCS7_ctrl); + if FuncLoadError then + begin + {$if not defined(PKCS7_ctrl_allownil)} + PKCS7_ctrl := @ERR_PKCS7_ctrl; + {$ifend} + {$if declared(PKCS7_ctrl_introduced)} + if LibVersion < PKCS7_ctrl_introduced then + begin + {$if declared(FC_PKCS7_ctrl)} + PKCS7_ctrl := @FC_PKCS7_ctrl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS7_ctrl_removed)} + if PKCS7_ctrl_removed <= LibVersion then + begin + {$if declared(_PKCS7_ctrl)} + PKCS7_ctrl := @_PKCS7_ctrl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS7_ctrl_allownil)} + if FuncLoadError then + AFailed.Add('PKCS7_ctrl'); + {$ifend} + end; + + + PKCS7_set_type := LoadLibFunction(ADllHandle, PKCS7_set_type_procname); + FuncLoadError := not assigned(PKCS7_set_type); + if FuncLoadError then + begin + {$if not defined(PKCS7_set_type_allownil)} + PKCS7_set_type := @ERR_PKCS7_set_type; + {$ifend} + {$if declared(PKCS7_set_type_introduced)} + if LibVersion < PKCS7_set_type_introduced then + begin + {$if declared(FC_PKCS7_set_type)} + PKCS7_set_type := @FC_PKCS7_set_type; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS7_set_type_removed)} + if PKCS7_set_type_removed <= LibVersion then + begin + {$if declared(_PKCS7_set_type)} + PKCS7_set_type := @_PKCS7_set_type; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS7_set_type_allownil)} + if FuncLoadError then + AFailed.Add('PKCS7_set_type'); + {$ifend} + end; + + + PKCS7_set0_type_other := LoadLibFunction(ADllHandle, PKCS7_set0_type_other_procname); + FuncLoadError := not assigned(PKCS7_set0_type_other); + if FuncLoadError then + begin + {$if not defined(PKCS7_set0_type_other_allownil)} + PKCS7_set0_type_other := @ERR_PKCS7_set0_type_other; + {$ifend} + {$if declared(PKCS7_set0_type_other_introduced)} + if LibVersion < PKCS7_set0_type_other_introduced then + begin + {$if declared(FC_PKCS7_set0_type_other)} + PKCS7_set0_type_other := @FC_PKCS7_set0_type_other; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS7_set0_type_other_removed)} + if PKCS7_set0_type_other_removed <= LibVersion then + begin + {$if declared(_PKCS7_set0_type_other)} + PKCS7_set0_type_other := @_PKCS7_set0_type_other; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS7_set0_type_other_allownil)} + if FuncLoadError then + AFailed.Add('PKCS7_set0_type_other'); + {$ifend} + end; + + + PKCS7_set_content := LoadLibFunction(ADllHandle, PKCS7_set_content_procname); + FuncLoadError := not assigned(PKCS7_set_content); + if FuncLoadError then + begin + {$if not defined(PKCS7_set_content_allownil)} + PKCS7_set_content := @ERR_PKCS7_set_content; + {$ifend} + {$if declared(PKCS7_set_content_introduced)} + if LibVersion < PKCS7_set_content_introduced then + begin + {$if declared(FC_PKCS7_set_content)} + PKCS7_set_content := @FC_PKCS7_set_content; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS7_set_content_removed)} + if PKCS7_set_content_removed <= LibVersion then + begin + {$if declared(_PKCS7_set_content)} + PKCS7_set_content := @_PKCS7_set_content; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS7_set_content_allownil)} + if FuncLoadError then + AFailed.Add('PKCS7_set_content'); + {$ifend} + end; + + + PKCS7_SIGNER_INFO_set := LoadLibFunction(ADllHandle, PKCS7_SIGNER_INFO_set_procname); + FuncLoadError := not assigned(PKCS7_SIGNER_INFO_set); + if FuncLoadError then + begin + {$if not defined(PKCS7_SIGNER_INFO_set_allownil)} + PKCS7_SIGNER_INFO_set := @ERR_PKCS7_SIGNER_INFO_set; + {$ifend} + {$if declared(PKCS7_SIGNER_INFO_set_introduced)} + if LibVersion < PKCS7_SIGNER_INFO_set_introduced then + begin + {$if declared(FC_PKCS7_SIGNER_INFO_set)} + PKCS7_SIGNER_INFO_set := @FC_PKCS7_SIGNER_INFO_set; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS7_SIGNER_INFO_set_removed)} + if PKCS7_SIGNER_INFO_set_removed <= LibVersion then + begin + {$if declared(_PKCS7_SIGNER_INFO_set)} + PKCS7_SIGNER_INFO_set := @_PKCS7_SIGNER_INFO_set; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS7_SIGNER_INFO_set_allownil)} + if FuncLoadError then + AFailed.Add('PKCS7_SIGNER_INFO_set'); + {$ifend} + end; + + + PKCS7_SIGNER_INFO_sign := LoadLibFunction(ADllHandle, PKCS7_SIGNER_INFO_sign_procname); + FuncLoadError := not assigned(PKCS7_SIGNER_INFO_sign); + if FuncLoadError then + begin + {$if not defined(PKCS7_SIGNER_INFO_sign_allownil)} + PKCS7_SIGNER_INFO_sign := @ERR_PKCS7_SIGNER_INFO_sign; + {$ifend} + {$if declared(PKCS7_SIGNER_INFO_sign_introduced)} + if LibVersion < PKCS7_SIGNER_INFO_sign_introduced then + begin + {$if declared(FC_PKCS7_SIGNER_INFO_sign)} + PKCS7_SIGNER_INFO_sign := @FC_PKCS7_SIGNER_INFO_sign; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS7_SIGNER_INFO_sign_removed)} + if PKCS7_SIGNER_INFO_sign_removed <= LibVersion then + begin + {$if declared(_PKCS7_SIGNER_INFO_sign)} + PKCS7_SIGNER_INFO_sign := @_PKCS7_SIGNER_INFO_sign; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS7_SIGNER_INFO_sign_allownil)} + if FuncLoadError then + AFailed.Add('PKCS7_SIGNER_INFO_sign'); + {$ifend} + end; + + + PKCS7_add_signer := LoadLibFunction(ADllHandle, PKCS7_add_signer_procname); + FuncLoadError := not assigned(PKCS7_add_signer); + if FuncLoadError then + begin + {$if not defined(PKCS7_add_signer_allownil)} + PKCS7_add_signer := @ERR_PKCS7_add_signer; + {$ifend} + {$if declared(PKCS7_add_signer_introduced)} + if LibVersion < PKCS7_add_signer_introduced then + begin + {$if declared(FC_PKCS7_add_signer)} + PKCS7_add_signer := @FC_PKCS7_add_signer; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS7_add_signer_removed)} + if PKCS7_add_signer_removed <= LibVersion then + begin + {$if declared(_PKCS7_add_signer)} + PKCS7_add_signer := @_PKCS7_add_signer; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS7_add_signer_allownil)} + if FuncLoadError then + AFailed.Add('PKCS7_add_signer'); + {$ifend} + end; + + + PKCS7_add_certificate := LoadLibFunction(ADllHandle, PKCS7_add_certificate_procname); + FuncLoadError := not assigned(PKCS7_add_certificate); + if FuncLoadError then + begin + {$if not defined(PKCS7_add_certificate_allownil)} + PKCS7_add_certificate := @ERR_PKCS7_add_certificate; + {$ifend} + {$if declared(PKCS7_add_certificate_introduced)} + if LibVersion < PKCS7_add_certificate_introduced then + begin + {$if declared(FC_PKCS7_add_certificate)} + PKCS7_add_certificate := @FC_PKCS7_add_certificate; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS7_add_certificate_removed)} + if PKCS7_add_certificate_removed <= LibVersion then + begin + {$if declared(_PKCS7_add_certificate)} + PKCS7_add_certificate := @_PKCS7_add_certificate; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS7_add_certificate_allownil)} + if FuncLoadError then + AFailed.Add('PKCS7_add_certificate'); + {$ifend} + end; + + + PKCS7_add_crl := LoadLibFunction(ADllHandle, PKCS7_add_crl_procname); + FuncLoadError := not assigned(PKCS7_add_crl); + if FuncLoadError then + begin + {$if not defined(PKCS7_add_crl_allownil)} + PKCS7_add_crl := @ERR_PKCS7_add_crl; + {$ifend} + {$if declared(PKCS7_add_crl_introduced)} + if LibVersion < PKCS7_add_crl_introduced then + begin + {$if declared(FC_PKCS7_add_crl)} + PKCS7_add_crl := @FC_PKCS7_add_crl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS7_add_crl_removed)} + if PKCS7_add_crl_removed <= LibVersion then + begin + {$if declared(_PKCS7_add_crl)} + PKCS7_add_crl := @_PKCS7_add_crl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS7_add_crl_allownil)} + if FuncLoadError then + AFailed.Add('PKCS7_add_crl'); + {$ifend} + end; + + + PKCS7_content_new := LoadLibFunction(ADllHandle, PKCS7_content_new_procname); + FuncLoadError := not assigned(PKCS7_content_new); + if FuncLoadError then + begin + {$if not defined(PKCS7_content_new_allownil)} + PKCS7_content_new := @ERR_PKCS7_content_new; + {$ifend} + {$if declared(PKCS7_content_new_introduced)} + if LibVersion < PKCS7_content_new_introduced then + begin + {$if declared(FC_PKCS7_content_new)} + PKCS7_content_new := @FC_PKCS7_content_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS7_content_new_removed)} + if PKCS7_content_new_removed <= LibVersion then + begin + {$if declared(_PKCS7_content_new)} + PKCS7_content_new := @_PKCS7_content_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS7_content_new_allownil)} + if FuncLoadError then + AFailed.Add('PKCS7_content_new'); + {$ifend} + end; + + + PKCS7_dataVerify := LoadLibFunction(ADllHandle, PKCS7_dataVerify_procname); + FuncLoadError := not assigned(PKCS7_dataVerify); + if FuncLoadError then + begin + {$if not defined(PKCS7_dataVerify_allownil)} + PKCS7_dataVerify := @ERR_PKCS7_dataVerify; + {$ifend} + {$if declared(PKCS7_dataVerify_introduced)} + if LibVersion < PKCS7_dataVerify_introduced then + begin + {$if declared(FC_PKCS7_dataVerify)} + PKCS7_dataVerify := @FC_PKCS7_dataVerify; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS7_dataVerify_removed)} + if PKCS7_dataVerify_removed <= LibVersion then + begin + {$if declared(_PKCS7_dataVerify)} + PKCS7_dataVerify := @_PKCS7_dataVerify; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS7_dataVerify_allownil)} + if FuncLoadError then + AFailed.Add('PKCS7_dataVerify'); + {$ifend} + end; + + + PKCS7_signatureVerify := LoadLibFunction(ADllHandle, PKCS7_signatureVerify_procname); + FuncLoadError := not assigned(PKCS7_signatureVerify); + if FuncLoadError then + begin + {$if not defined(PKCS7_signatureVerify_allownil)} + PKCS7_signatureVerify := @ERR_PKCS7_signatureVerify; + {$ifend} + {$if declared(PKCS7_signatureVerify_introduced)} + if LibVersion < PKCS7_signatureVerify_introduced then + begin + {$if declared(FC_PKCS7_signatureVerify)} + PKCS7_signatureVerify := @FC_PKCS7_signatureVerify; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS7_signatureVerify_removed)} + if PKCS7_signatureVerify_removed <= LibVersion then + begin + {$if declared(_PKCS7_signatureVerify)} + PKCS7_signatureVerify := @_PKCS7_signatureVerify; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS7_signatureVerify_allownil)} + if FuncLoadError then + AFailed.Add('PKCS7_signatureVerify'); + {$ifend} + end; + + + PKCS7_dataInit := LoadLibFunction(ADllHandle, PKCS7_dataInit_procname); + FuncLoadError := not assigned(PKCS7_dataInit); + if FuncLoadError then + begin + {$if not defined(PKCS7_dataInit_allownil)} + PKCS7_dataInit := @ERR_PKCS7_dataInit; + {$ifend} + {$if declared(PKCS7_dataInit_introduced)} + if LibVersion < PKCS7_dataInit_introduced then + begin + {$if declared(FC_PKCS7_dataInit)} + PKCS7_dataInit := @FC_PKCS7_dataInit; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS7_dataInit_removed)} + if PKCS7_dataInit_removed <= LibVersion then + begin + {$if declared(_PKCS7_dataInit)} + PKCS7_dataInit := @_PKCS7_dataInit; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS7_dataInit_allownil)} + if FuncLoadError then + AFailed.Add('PKCS7_dataInit'); + {$ifend} + end; + + + PKCS7_dataFinal := LoadLibFunction(ADllHandle, PKCS7_dataFinal_procname); + FuncLoadError := not assigned(PKCS7_dataFinal); + if FuncLoadError then + begin + {$if not defined(PKCS7_dataFinal_allownil)} + PKCS7_dataFinal := @ERR_PKCS7_dataFinal; + {$ifend} + {$if declared(PKCS7_dataFinal_introduced)} + if LibVersion < PKCS7_dataFinal_introduced then + begin + {$if declared(FC_PKCS7_dataFinal)} + PKCS7_dataFinal := @FC_PKCS7_dataFinal; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS7_dataFinal_removed)} + if PKCS7_dataFinal_removed <= LibVersion then + begin + {$if declared(_PKCS7_dataFinal)} + PKCS7_dataFinal := @_PKCS7_dataFinal; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS7_dataFinal_allownil)} + if FuncLoadError then + AFailed.Add('PKCS7_dataFinal'); + {$ifend} + end; + + + PKCS7_dataDecode := LoadLibFunction(ADllHandle, PKCS7_dataDecode_procname); + FuncLoadError := not assigned(PKCS7_dataDecode); + if FuncLoadError then + begin + {$if not defined(PKCS7_dataDecode_allownil)} + PKCS7_dataDecode := @ERR_PKCS7_dataDecode; + {$ifend} + {$if declared(PKCS7_dataDecode_introduced)} + if LibVersion < PKCS7_dataDecode_introduced then + begin + {$if declared(FC_PKCS7_dataDecode)} + PKCS7_dataDecode := @FC_PKCS7_dataDecode; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS7_dataDecode_removed)} + if PKCS7_dataDecode_removed <= LibVersion then + begin + {$if declared(_PKCS7_dataDecode)} + PKCS7_dataDecode := @_PKCS7_dataDecode; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS7_dataDecode_allownil)} + if FuncLoadError then + AFailed.Add('PKCS7_dataDecode'); + {$ifend} + end; + + + PKCS7_add_signature := LoadLibFunction(ADllHandle, PKCS7_add_signature_procname); + FuncLoadError := not assigned(PKCS7_add_signature); + if FuncLoadError then + begin + {$if not defined(PKCS7_add_signature_allownil)} + PKCS7_add_signature := @ERR_PKCS7_add_signature; + {$ifend} + {$if declared(PKCS7_add_signature_introduced)} + if LibVersion < PKCS7_add_signature_introduced then + begin + {$if declared(FC_PKCS7_add_signature)} + PKCS7_add_signature := @FC_PKCS7_add_signature; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS7_add_signature_removed)} + if PKCS7_add_signature_removed <= LibVersion then + begin + {$if declared(_PKCS7_add_signature)} + PKCS7_add_signature := @_PKCS7_add_signature; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS7_add_signature_allownil)} + if FuncLoadError then + AFailed.Add('PKCS7_add_signature'); + {$ifend} + end; + + + PKCS7_cert_from_signer_info := LoadLibFunction(ADllHandle, PKCS7_cert_from_signer_info_procname); + FuncLoadError := not assigned(PKCS7_cert_from_signer_info); + if FuncLoadError then + begin + {$if not defined(PKCS7_cert_from_signer_info_allownil)} + PKCS7_cert_from_signer_info := @ERR_PKCS7_cert_from_signer_info; + {$ifend} + {$if declared(PKCS7_cert_from_signer_info_introduced)} + if LibVersion < PKCS7_cert_from_signer_info_introduced then + begin + {$if declared(FC_PKCS7_cert_from_signer_info)} + PKCS7_cert_from_signer_info := @FC_PKCS7_cert_from_signer_info; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS7_cert_from_signer_info_removed)} + if PKCS7_cert_from_signer_info_removed <= LibVersion then + begin + {$if declared(_PKCS7_cert_from_signer_info)} + PKCS7_cert_from_signer_info := @_PKCS7_cert_from_signer_info; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS7_cert_from_signer_info_allownil)} + if FuncLoadError then + AFailed.Add('PKCS7_cert_from_signer_info'); + {$ifend} + end; + + + PKCS7_set_digest := LoadLibFunction(ADllHandle, PKCS7_set_digest_procname); + FuncLoadError := not assigned(PKCS7_set_digest); + if FuncLoadError then + begin + {$if not defined(PKCS7_set_digest_allownil)} + PKCS7_set_digest := @ERR_PKCS7_set_digest; + {$ifend} + {$if declared(PKCS7_set_digest_introduced)} + if LibVersion < PKCS7_set_digest_introduced then + begin + {$if declared(FC_PKCS7_set_digest)} + PKCS7_set_digest := @FC_PKCS7_set_digest; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS7_set_digest_removed)} + if PKCS7_set_digest_removed <= LibVersion then + begin + {$if declared(_PKCS7_set_digest)} + PKCS7_set_digest := @_PKCS7_set_digest; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS7_set_digest_allownil)} + if FuncLoadError then + AFailed.Add('PKCS7_set_digest'); + {$ifend} + end; + + + PKCS7_add_recipient := LoadLibFunction(ADllHandle, PKCS7_add_recipient_procname); + FuncLoadError := not assigned(PKCS7_add_recipient); + if FuncLoadError then + begin + {$if not defined(PKCS7_add_recipient_allownil)} + PKCS7_add_recipient := @ERR_PKCS7_add_recipient; + {$ifend} + {$if declared(PKCS7_add_recipient_introduced)} + if LibVersion < PKCS7_add_recipient_introduced then + begin + {$if declared(FC_PKCS7_add_recipient)} + PKCS7_add_recipient := @FC_PKCS7_add_recipient; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS7_add_recipient_removed)} + if PKCS7_add_recipient_removed <= LibVersion then + begin + {$if declared(_PKCS7_add_recipient)} + PKCS7_add_recipient := @_PKCS7_add_recipient; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS7_add_recipient_allownil)} + if FuncLoadError then + AFailed.Add('PKCS7_add_recipient'); + {$ifend} + end; + + + PKCS7_SIGNER_INFO_get0_algs := LoadLibFunction(ADllHandle, PKCS7_SIGNER_INFO_get0_algs_procname); + FuncLoadError := not assigned(PKCS7_SIGNER_INFO_get0_algs); + if FuncLoadError then + begin + {$if not defined(PKCS7_SIGNER_INFO_get0_algs_allownil)} + PKCS7_SIGNER_INFO_get0_algs := @ERR_PKCS7_SIGNER_INFO_get0_algs; + {$ifend} + {$if declared(PKCS7_SIGNER_INFO_get0_algs_introduced)} + if LibVersion < PKCS7_SIGNER_INFO_get0_algs_introduced then + begin + {$if declared(FC_PKCS7_SIGNER_INFO_get0_algs)} + PKCS7_SIGNER_INFO_get0_algs := @FC_PKCS7_SIGNER_INFO_get0_algs; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS7_SIGNER_INFO_get0_algs_removed)} + if PKCS7_SIGNER_INFO_get0_algs_removed <= LibVersion then + begin + {$if declared(_PKCS7_SIGNER_INFO_get0_algs)} + PKCS7_SIGNER_INFO_get0_algs := @_PKCS7_SIGNER_INFO_get0_algs; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS7_SIGNER_INFO_get0_algs_allownil)} + if FuncLoadError then + AFailed.Add('PKCS7_SIGNER_INFO_get0_algs'); + {$ifend} + end; + + + PKCS7_RECIP_INFO_get0_alg := LoadLibFunction(ADllHandle, PKCS7_RECIP_INFO_get0_alg_procname); + FuncLoadError := not assigned(PKCS7_RECIP_INFO_get0_alg); + if FuncLoadError then + begin + {$if not defined(PKCS7_RECIP_INFO_get0_alg_allownil)} + PKCS7_RECIP_INFO_get0_alg := @ERR_PKCS7_RECIP_INFO_get0_alg; + {$ifend} + {$if declared(PKCS7_RECIP_INFO_get0_alg_introduced)} + if LibVersion < PKCS7_RECIP_INFO_get0_alg_introduced then + begin + {$if declared(FC_PKCS7_RECIP_INFO_get0_alg)} + PKCS7_RECIP_INFO_get0_alg := @FC_PKCS7_RECIP_INFO_get0_alg; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS7_RECIP_INFO_get0_alg_removed)} + if PKCS7_RECIP_INFO_get0_alg_removed <= LibVersion then + begin + {$if declared(_PKCS7_RECIP_INFO_get0_alg)} + PKCS7_RECIP_INFO_get0_alg := @_PKCS7_RECIP_INFO_get0_alg; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS7_RECIP_INFO_get0_alg_allownil)} + if FuncLoadError then + AFailed.Add('PKCS7_RECIP_INFO_get0_alg'); + {$ifend} + end; + + + PKCS7_add_recipient_info := LoadLibFunction(ADllHandle, PKCS7_add_recipient_info_procname); + FuncLoadError := not assigned(PKCS7_add_recipient_info); + if FuncLoadError then + begin + {$if not defined(PKCS7_add_recipient_info_allownil)} + PKCS7_add_recipient_info := @ERR_PKCS7_add_recipient_info; + {$ifend} + {$if declared(PKCS7_add_recipient_info_introduced)} + if LibVersion < PKCS7_add_recipient_info_introduced then + begin + {$if declared(FC_PKCS7_add_recipient_info)} + PKCS7_add_recipient_info := @FC_PKCS7_add_recipient_info; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS7_add_recipient_info_removed)} + if PKCS7_add_recipient_info_removed <= LibVersion then + begin + {$if declared(_PKCS7_add_recipient_info)} + PKCS7_add_recipient_info := @_PKCS7_add_recipient_info; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS7_add_recipient_info_allownil)} + if FuncLoadError then + AFailed.Add('PKCS7_add_recipient_info'); + {$ifend} + end; + + + PKCS7_RECIP_INFO_set := LoadLibFunction(ADllHandle, PKCS7_RECIP_INFO_set_procname); + FuncLoadError := not assigned(PKCS7_RECIP_INFO_set); + if FuncLoadError then + begin + {$if not defined(PKCS7_RECIP_INFO_set_allownil)} + PKCS7_RECIP_INFO_set := @ERR_PKCS7_RECIP_INFO_set; + {$ifend} + {$if declared(PKCS7_RECIP_INFO_set_introduced)} + if LibVersion < PKCS7_RECIP_INFO_set_introduced then + begin + {$if declared(FC_PKCS7_RECIP_INFO_set)} + PKCS7_RECIP_INFO_set := @FC_PKCS7_RECIP_INFO_set; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS7_RECIP_INFO_set_removed)} + if PKCS7_RECIP_INFO_set_removed <= LibVersion then + begin + {$if declared(_PKCS7_RECIP_INFO_set)} + PKCS7_RECIP_INFO_set := @_PKCS7_RECIP_INFO_set; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS7_RECIP_INFO_set_allownil)} + if FuncLoadError then + AFailed.Add('PKCS7_RECIP_INFO_set'); + {$ifend} + end; + + + PKCS7_set_cipher := LoadLibFunction(ADllHandle, PKCS7_set_cipher_procname); + FuncLoadError := not assigned(PKCS7_set_cipher); + if FuncLoadError then + begin + {$if not defined(PKCS7_set_cipher_allownil)} + PKCS7_set_cipher := @ERR_PKCS7_set_cipher; + {$ifend} + {$if declared(PKCS7_set_cipher_introduced)} + if LibVersion < PKCS7_set_cipher_introduced then + begin + {$if declared(FC_PKCS7_set_cipher)} + PKCS7_set_cipher := @FC_PKCS7_set_cipher; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS7_set_cipher_removed)} + if PKCS7_set_cipher_removed <= LibVersion then + begin + {$if declared(_PKCS7_set_cipher)} + PKCS7_set_cipher := @_PKCS7_set_cipher; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS7_set_cipher_allownil)} + if FuncLoadError then + AFailed.Add('PKCS7_set_cipher'); + {$ifend} + end; + + + PKCS7_stream := LoadLibFunction(ADllHandle, PKCS7_stream_procname); + FuncLoadError := not assigned(PKCS7_stream); + if FuncLoadError then + begin + {$if not defined(PKCS7_stream_allownil)} + PKCS7_stream := @ERR_PKCS7_stream; + {$ifend} + {$if declared(PKCS7_stream_introduced)} + if LibVersion < PKCS7_stream_introduced then + begin + {$if declared(FC_PKCS7_stream)} + PKCS7_stream := @FC_PKCS7_stream; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS7_stream_removed)} + if PKCS7_stream_removed <= LibVersion then + begin + {$if declared(_PKCS7_stream)} + PKCS7_stream := @_PKCS7_stream; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS7_stream_allownil)} + if FuncLoadError then + AFailed.Add('PKCS7_stream'); + {$ifend} + end; + + + PKCS7_get_issuer_and_serial := LoadLibFunction(ADllHandle, PKCS7_get_issuer_and_serial_procname); + FuncLoadError := not assigned(PKCS7_get_issuer_and_serial); + if FuncLoadError then + begin + {$if not defined(PKCS7_get_issuer_and_serial_allownil)} + PKCS7_get_issuer_and_serial := @ERR_PKCS7_get_issuer_and_serial; + {$ifend} + {$if declared(PKCS7_get_issuer_and_serial_introduced)} + if LibVersion < PKCS7_get_issuer_and_serial_introduced then + begin + {$if declared(FC_PKCS7_get_issuer_and_serial)} + PKCS7_get_issuer_and_serial := @FC_PKCS7_get_issuer_and_serial; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS7_get_issuer_and_serial_removed)} + if PKCS7_get_issuer_and_serial_removed <= LibVersion then + begin + {$if declared(_PKCS7_get_issuer_and_serial)} + PKCS7_get_issuer_and_serial := @_PKCS7_get_issuer_and_serial; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS7_get_issuer_and_serial_allownil)} + if FuncLoadError then + AFailed.Add('PKCS7_get_issuer_and_serial'); + {$ifend} + end; + + + PKCS7_add_signed_attribute := LoadLibFunction(ADllHandle, PKCS7_add_signed_attribute_procname); + FuncLoadError := not assigned(PKCS7_add_signed_attribute); + if FuncLoadError then + begin + {$if not defined(PKCS7_add_signed_attribute_allownil)} + PKCS7_add_signed_attribute := @ERR_PKCS7_add_signed_attribute; + {$ifend} + {$if declared(PKCS7_add_signed_attribute_introduced)} + if LibVersion < PKCS7_add_signed_attribute_introduced then + begin + {$if declared(FC_PKCS7_add_signed_attribute)} + PKCS7_add_signed_attribute := @FC_PKCS7_add_signed_attribute; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS7_add_signed_attribute_removed)} + if PKCS7_add_signed_attribute_removed <= LibVersion then + begin + {$if declared(_PKCS7_add_signed_attribute)} + PKCS7_add_signed_attribute := @_PKCS7_add_signed_attribute; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS7_add_signed_attribute_allownil)} + if FuncLoadError then + AFailed.Add('PKCS7_add_signed_attribute'); + {$ifend} + end; + + + PKCS7_add_attribute := LoadLibFunction(ADllHandle, PKCS7_add_attribute_procname); + FuncLoadError := not assigned(PKCS7_add_attribute); + if FuncLoadError then + begin + {$if not defined(PKCS7_add_attribute_allownil)} + PKCS7_add_attribute := @ERR_PKCS7_add_attribute; + {$ifend} + {$if declared(PKCS7_add_attribute_introduced)} + if LibVersion < PKCS7_add_attribute_introduced then + begin + {$if declared(FC_PKCS7_add_attribute)} + PKCS7_add_attribute := @FC_PKCS7_add_attribute; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS7_add_attribute_removed)} + if PKCS7_add_attribute_removed <= LibVersion then + begin + {$if declared(_PKCS7_add_attribute)} + PKCS7_add_attribute := @_PKCS7_add_attribute; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS7_add_attribute_allownil)} + if FuncLoadError then + AFailed.Add('PKCS7_add_attribute'); + {$ifend} + end; + + + PKCS7_get_attribute := LoadLibFunction(ADllHandle, PKCS7_get_attribute_procname); + FuncLoadError := not assigned(PKCS7_get_attribute); + if FuncLoadError then + begin + {$if not defined(PKCS7_get_attribute_allownil)} + PKCS7_get_attribute := @ERR_PKCS7_get_attribute; + {$ifend} + {$if declared(PKCS7_get_attribute_introduced)} + if LibVersion < PKCS7_get_attribute_introduced then + begin + {$if declared(FC_PKCS7_get_attribute)} + PKCS7_get_attribute := @FC_PKCS7_get_attribute; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS7_get_attribute_removed)} + if PKCS7_get_attribute_removed <= LibVersion then + begin + {$if declared(_PKCS7_get_attribute)} + PKCS7_get_attribute := @_PKCS7_get_attribute; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS7_get_attribute_allownil)} + if FuncLoadError then + AFailed.Add('PKCS7_get_attribute'); + {$ifend} + end; + + + PKCS7_get_signed_attribute := LoadLibFunction(ADllHandle, PKCS7_get_signed_attribute_procname); + FuncLoadError := not assigned(PKCS7_get_signed_attribute); + if FuncLoadError then + begin + {$if not defined(PKCS7_get_signed_attribute_allownil)} + PKCS7_get_signed_attribute := @ERR_PKCS7_get_signed_attribute; + {$ifend} + {$if declared(PKCS7_get_signed_attribute_introduced)} + if LibVersion < PKCS7_get_signed_attribute_introduced then + begin + {$if declared(FC_PKCS7_get_signed_attribute)} + PKCS7_get_signed_attribute := @FC_PKCS7_get_signed_attribute; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS7_get_signed_attribute_removed)} + if PKCS7_get_signed_attribute_removed <= LibVersion then + begin + {$if declared(_PKCS7_get_signed_attribute)} + PKCS7_get_signed_attribute := @_PKCS7_get_signed_attribute; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS7_get_signed_attribute_allownil)} + if FuncLoadError then + AFailed.Add('PKCS7_get_signed_attribute'); + {$ifend} + end; + + + PKCS7_sign_add_signer := LoadLibFunction(ADllHandle, PKCS7_sign_add_signer_procname); + FuncLoadError := not assigned(PKCS7_sign_add_signer); + if FuncLoadError then + begin + {$if not defined(PKCS7_sign_add_signer_allownil)} + PKCS7_sign_add_signer := @ERR_PKCS7_sign_add_signer; + {$ifend} + {$if declared(PKCS7_sign_add_signer_introduced)} + if LibVersion < PKCS7_sign_add_signer_introduced then + begin + {$if declared(FC_PKCS7_sign_add_signer)} + PKCS7_sign_add_signer := @FC_PKCS7_sign_add_signer; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS7_sign_add_signer_removed)} + if PKCS7_sign_add_signer_removed <= LibVersion then + begin + {$if declared(_PKCS7_sign_add_signer)} + PKCS7_sign_add_signer := @_PKCS7_sign_add_signer; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS7_sign_add_signer_allownil)} + if FuncLoadError then + AFailed.Add('PKCS7_sign_add_signer'); + {$ifend} + end; + + + PKCS7_final := LoadLibFunction(ADllHandle, PKCS7_final_procname); + FuncLoadError := not assigned(PKCS7_final); + if FuncLoadError then + begin + {$if not defined(PKCS7_final_allownil)} + PKCS7_final := @ERR_PKCS7_final; + {$ifend} + {$if declared(PKCS7_final_introduced)} + if LibVersion < PKCS7_final_introduced then + begin + {$if declared(FC_PKCS7_final)} + PKCS7_final := @FC_PKCS7_final; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS7_final_removed)} + if PKCS7_final_removed <= LibVersion then + begin + {$if declared(_PKCS7_final)} + PKCS7_final := @_PKCS7_final; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS7_final_allownil)} + if FuncLoadError then + AFailed.Add('PKCS7_final'); + {$ifend} + end; + + + PKCS7_decrypt := LoadLibFunction(ADllHandle, PKCS7_decrypt_procname); + FuncLoadError := not assigned(PKCS7_decrypt); + if FuncLoadError then + begin + {$if not defined(PKCS7_decrypt_allownil)} + PKCS7_decrypt := @ERR_PKCS7_decrypt; + {$ifend} + {$if declared(PKCS7_decrypt_introduced)} + if LibVersion < PKCS7_decrypt_introduced then + begin + {$if declared(FC_PKCS7_decrypt)} + PKCS7_decrypt := @FC_PKCS7_decrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS7_decrypt_removed)} + if PKCS7_decrypt_removed <= LibVersion then + begin + {$if declared(_PKCS7_decrypt)} + PKCS7_decrypt := @_PKCS7_decrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS7_decrypt_allownil)} + if FuncLoadError then + AFailed.Add('PKCS7_decrypt'); + {$ifend} + end; + + + PKCS7_add_attrib_content_type := LoadLibFunction(ADllHandle, PKCS7_add_attrib_content_type_procname); + FuncLoadError := not assigned(PKCS7_add_attrib_content_type); + if FuncLoadError then + begin + {$if not defined(PKCS7_add_attrib_content_type_allownil)} + PKCS7_add_attrib_content_type := @ERR_PKCS7_add_attrib_content_type; + {$ifend} + {$if declared(PKCS7_add_attrib_content_type_introduced)} + if LibVersion < PKCS7_add_attrib_content_type_introduced then + begin + {$if declared(FC_PKCS7_add_attrib_content_type)} + PKCS7_add_attrib_content_type := @FC_PKCS7_add_attrib_content_type; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS7_add_attrib_content_type_removed)} + if PKCS7_add_attrib_content_type_removed <= LibVersion then + begin + {$if declared(_PKCS7_add_attrib_content_type)} + PKCS7_add_attrib_content_type := @_PKCS7_add_attrib_content_type; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS7_add_attrib_content_type_allownil)} + if FuncLoadError then + AFailed.Add('PKCS7_add_attrib_content_type'); + {$ifend} + end; + + + PKCS7_add0_attrib_signing_time := LoadLibFunction(ADllHandle, PKCS7_add0_attrib_signing_time_procname); + FuncLoadError := not assigned(PKCS7_add0_attrib_signing_time); + if FuncLoadError then + begin + {$if not defined(PKCS7_add0_attrib_signing_time_allownil)} + PKCS7_add0_attrib_signing_time := @ERR_PKCS7_add0_attrib_signing_time; + {$ifend} + {$if declared(PKCS7_add0_attrib_signing_time_introduced)} + if LibVersion < PKCS7_add0_attrib_signing_time_introduced then + begin + {$if declared(FC_PKCS7_add0_attrib_signing_time)} + PKCS7_add0_attrib_signing_time := @FC_PKCS7_add0_attrib_signing_time; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS7_add0_attrib_signing_time_removed)} + if PKCS7_add0_attrib_signing_time_removed <= LibVersion then + begin + {$if declared(_PKCS7_add0_attrib_signing_time)} + PKCS7_add0_attrib_signing_time := @_PKCS7_add0_attrib_signing_time; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS7_add0_attrib_signing_time_allownil)} + if FuncLoadError then + AFailed.Add('PKCS7_add0_attrib_signing_time'); + {$ifend} + end; + + + PKCS7_add1_attrib_digest := LoadLibFunction(ADllHandle, PKCS7_add1_attrib_digest_procname); + FuncLoadError := not assigned(PKCS7_add1_attrib_digest); + if FuncLoadError then + begin + {$if not defined(PKCS7_add1_attrib_digest_allownil)} + PKCS7_add1_attrib_digest := @ERR_PKCS7_add1_attrib_digest; + {$ifend} + {$if declared(PKCS7_add1_attrib_digest_introduced)} + if LibVersion < PKCS7_add1_attrib_digest_introduced then + begin + {$if declared(FC_PKCS7_add1_attrib_digest)} + PKCS7_add1_attrib_digest := @FC_PKCS7_add1_attrib_digest; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS7_add1_attrib_digest_removed)} + if PKCS7_add1_attrib_digest_removed <= LibVersion then + begin + {$if declared(_PKCS7_add1_attrib_digest)} + PKCS7_add1_attrib_digest := @_PKCS7_add1_attrib_digest; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS7_add1_attrib_digest_allownil)} + if FuncLoadError then + AFailed.Add('PKCS7_add1_attrib_digest'); + {$ifend} + end; + + + SMIME_write_PKCS7 := LoadLibFunction(ADllHandle, SMIME_write_PKCS7_procname); + FuncLoadError := not assigned(SMIME_write_PKCS7); + if FuncLoadError then + begin + {$if not defined(SMIME_write_PKCS7_allownil)} + SMIME_write_PKCS7 := @ERR_SMIME_write_PKCS7; + {$ifend} + {$if declared(SMIME_write_PKCS7_introduced)} + if LibVersion < SMIME_write_PKCS7_introduced then + begin + {$if declared(FC_SMIME_write_PKCS7)} + SMIME_write_PKCS7 := @FC_SMIME_write_PKCS7; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SMIME_write_PKCS7_removed)} + if SMIME_write_PKCS7_removed <= LibVersion then + begin + {$if declared(_SMIME_write_PKCS7)} + SMIME_write_PKCS7 := @_SMIME_write_PKCS7; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SMIME_write_PKCS7_allownil)} + if FuncLoadError then + AFailed.Add('SMIME_write_PKCS7'); + {$ifend} + end; + + + SMIME_read_PKCS7 := LoadLibFunction(ADllHandle, SMIME_read_PKCS7_procname); + FuncLoadError := not assigned(SMIME_read_PKCS7); + if FuncLoadError then + begin + {$if not defined(SMIME_read_PKCS7_allownil)} + SMIME_read_PKCS7 := @ERR_SMIME_read_PKCS7; + {$ifend} + {$if declared(SMIME_read_PKCS7_introduced)} + if LibVersion < SMIME_read_PKCS7_introduced then + begin + {$if declared(FC_SMIME_read_PKCS7)} + SMIME_read_PKCS7 := @FC_SMIME_read_PKCS7; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SMIME_read_PKCS7_removed)} + if SMIME_read_PKCS7_removed <= LibVersion then + begin + {$if declared(_SMIME_read_PKCS7)} + SMIME_read_PKCS7 := @_SMIME_read_PKCS7; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SMIME_read_PKCS7_allownil)} + if FuncLoadError then + AFailed.Add('SMIME_read_PKCS7'); + {$ifend} + end; + + + BIO_new_PKCS7 := LoadLibFunction(ADllHandle, BIO_new_PKCS7_procname); + FuncLoadError := not assigned(BIO_new_PKCS7); + if FuncLoadError then + begin + {$if not defined(BIO_new_PKCS7_allownil)} + BIO_new_PKCS7 := @ERR_BIO_new_PKCS7; + {$ifend} + {$if declared(BIO_new_PKCS7_introduced)} + if LibVersion < BIO_new_PKCS7_introduced then + begin + {$if declared(FC_BIO_new_PKCS7)} + BIO_new_PKCS7 := @FC_BIO_new_PKCS7; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_new_PKCS7_removed)} + if BIO_new_PKCS7_removed <= LibVersion then + begin + {$if declared(_BIO_new_PKCS7)} + BIO_new_PKCS7 := @_BIO_new_PKCS7; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_new_PKCS7_allownil)} + if FuncLoadError then + AFailed.Add('BIO_new_PKCS7'); + {$ifend} + end; + + +end; + +procedure Unload; +begin + PKCS7_ISSUER_AND_SERIAL_digest := nil; + PKCS7_dup := nil; + d2i_PKCS7_bio := nil; + i2d_PKCS7_bio := nil; + i2d_PKCS7_bio_stream := nil; + PEM_write_bio_PKCS7_stream := nil; + PKCS7_ctrl := nil; + PKCS7_set_type := nil; + PKCS7_set0_type_other := nil; + PKCS7_set_content := nil; + PKCS7_SIGNER_INFO_set := nil; + PKCS7_SIGNER_INFO_sign := nil; + PKCS7_add_signer := nil; + PKCS7_add_certificate := nil; + PKCS7_add_crl := nil; + PKCS7_content_new := nil; + PKCS7_dataVerify := nil; + PKCS7_signatureVerify := nil; + PKCS7_dataInit := nil; + PKCS7_dataFinal := nil; + PKCS7_dataDecode := nil; + PKCS7_add_signature := nil; + PKCS7_cert_from_signer_info := nil; + PKCS7_set_digest := nil; + PKCS7_add_recipient := nil; + PKCS7_SIGNER_INFO_get0_algs := nil; + PKCS7_RECIP_INFO_get0_alg := nil; + PKCS7_add_recipient_info := nil; + PKCS7_RECIP_INFO_set := nil; + PKCS7_set_cipher := nil; + PKCS7_stream := nil; + PKCS7_get_issuer_and_serial := nil; + PKCS7_add_signed_attribute := nil; + PKCS7_add_attribute := nil; + PKCS7_get_attribute := nil; + PKCS7_get_signed_attribute := nil; + PKCS7_sign_add_signer := nil; + PKCS7_final := nil; + PKCS7_decrypt := nil; + PKCS7_add_attrib_content_type := nil; + PKCS7_add0_attrib_signing_time := nil; + PKCS7_add1_attrib_digest := nil; + SMIME_write_PKCS7 := nil; + SMIME_read_PKCS7 := nil; + BIO_new_PKCS7 := nil; +end; +{$ELSE} +{$ENDIF} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +initialization + Register_SSLLoader(@Load,'LibCrypto'); + Register_SSLUnloader(@Unload); +{$ENDIF} +end. diff --git a/IdOpenSSLHeaders_pkcs7err.pas b/IdOpenSSLHeaders_pkcs7err.pas new file mode 100644 index 0000000..e6a9ff7 --- /dev/null +++ b/IdOpenSSLHeaders_pkcs7err.pas @@ -0,0 +1,220 @@ + (* This unit was generated using the script genOpenSSLHdrs.sh from the source file IdOpenSSLHeaders_pkcs7err.h2pas + It should not be modified directly. All changes should be made to IdOpenSSLHeaders_pkcs7err.h2pas + and this file regenerated. IdOpenSSLHeaders_pkcs7err.h2pas is distributed with the full Indy + Distribution. + *) + +{$i IdCompilerDefines.inc} +{$i IdSSLOpenSSLDefines.inc} +{$IFNDEF USE_OPENSSL} + { error Should not compile if USE_OPENSSL is not defined!!!} +{$ENDIF} +{******************************************************************************} +{ } +{ Indy (Internet Direct) - Internet Protocols Simplified } +{ } +{ https://www.indyproject.org/ } +{ https://gitter.im/IndySockets/Indy } +{ } +{******************************************************************************} +{ } +{ This file is part of the Indy (Internet Direct) project, and is offered } +{ under the dual-licensing agreement described on the Indy website. } +{ (https://www.indyproject.org/license/) } +{ } +{ Copyright: } +{ (c) 1993-2020, Chad Z. Hower and the Indy Pit Crew. All rights reserved. } +{ } +{******************************************************************************} +{ } +{ } +{******************************************************************************} + +unit IdOpenSSLHeaders_pkcs7err; + +interface + +// Headers for OpenSSL 1.1.1 +// pkcs7err.h + + +uses + IdCTypes, + IdGlobal, + IdSSLOpenSSLConsts; + +const + (* + * PKCS7 function codes. + *) + PKCS7_F_DO_PKCS7_SIGNED_ATTRIB = 136; + PKCS7_F_PKCS7_ADD0_ATTRIB_SIGNING_TIME = 135; + PKCS7_F_PKCS7_ADD_ATTRIB_SMIMECAP = 118; + PKCS7_F_PKCS7_ADD_CERTIFICATE = 100; + PKCS7_F_PKCS7_ADD_CRL = 101; + PKCS7_F_PKCS7_ADD_RECIPIENT_INFO = 102; + PKCS7_F_PKCS7_ADD_SIGNATURE = 131; + PKCS7_F_PKCS7_ADD_SIGNER = 103; + PKCS7_F_PKCS7_BIO_ADD_DIGEST = 125; + PKCS7_F_PKCS7_COPY_EXISTING_DIGEST = 138; + PKCS7_F_PKCS7_CTRL = 104; + PKCS7_F_PKCS7_DATADECODE = 112; + PKCS7_F_PKCS7_DATAFINAL = 128; + PKCS7_F_PKCS7_DATAINIT = 105; + PKCS7_F_PKCS7_DATAVERIFY = 107; + PKCS7_F_PKCS7_DECRYPT = 114; + PKCS7_F_PKCS7_DECRYPT_RINFO = 133; + PKCS7_F_PKCS7_ENCODE_RINFO = 132; + PKCS7_F_PKCS7_ENCRYPT = 115; + PKCS7_F_PKCS7_FINAL = 134; + PKCS7_F_PKCS7_FIND_DIGEST = 127; + PKCS7_F_PKCS7_GET0_SIGNERS = 124; + PKCS7_F_PKCS7_RECIP_INFO_SET = 130; + PKCS7_F_PKCS7_SET_CIPHER = 108; + PKCS7_F_PKCS7_SET_CONTENT = 109; + PKCS7_F_PKCS7_SET_DIGEST = 126; + PKCS7_F_PKCS7_SET_TYPE = 110; + PKCS7_F_PKCS7_SIGN = 116; + PKCS7_F_PKCS7_SIGNATUREVERIFY = 113; + PKCS7_F_PKCS7_SIGNER_INFO_SET = 129; + PKCS7_F_PKCS7_SIGNER_INFO_SIGN = 139; + PKCS7_F_PKCS7_SIGN_ADD_SIGNER = 137; + PKCS7_F_PKCS7_SIMPLE_SMIMECAP = 119; + PKCS7_F_PKCS7_VERIFY = 117; + + (* + * PKCS7 reason codes. + *) + PKCS7_R_CERTIFICATE_VERIFY_ERROR = 117; + PKCS7_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER = 144; + PKCS7_R_CIPHER_NOT_INITIALIZED = 116; + PKCS7_R_CONTENT_AND_DATA_PRESENT = 118; + PKCS7_R_CTRL_ERROR = 152; + PKCS7_R_DECRYPT_ERROR = 119; + PKCS7_R_DIGEST_FAILURE = 101; + PKCS7_R_ENCRYPTION_CTRL_FAILURE = 149; + PKCS7_R_ENCRYPTION_NOT_SUPPORTED_FOR_THIS_KEY_TYPE = 150; + PKCS7_R_ERROR_ADDING_RECIPIENT = 120; + PKCS7_R_ERROR_SETTING_CIPHER = 121; + PKCS7_R_INVALID_NULL_POINTER = 143; + PKCS7_R_INVALID_SIGNED_DATA_TYPE = 155; + PKCS7_R_NO_CONTENT = 122; + PKCS7_R_NO_DEFAULT_DIGEST = 151; + PKCS7_R_NO_MATCHING_DIGEST_TYPE_FOUND = 154; + PKCS7_R_NO_RECIPIENT_MATCHES_CERTIFICATE = 115; + PKCS7_R_NO_SIGNATURES_ON_DATA = 123; + PKCS7_R_NO_SIGNERS = 142; + PKCS7_R_OPERATION_NOT_SUPPORTED_ON_THIS_TYPE = 104; + PKCS7_R_PKCS7_ADD_SIGNATURE_ERROR = 124; + PKCS7_R_PKCS7_ADD_SIGNER_ERROR = 153; + PKCS7_R_PKCS7_DATASIGN = 145; + PKCS7_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE = 127; + PKCS7_R_SIGNATURE_FAILURE = 105; + PKCS7_R_SIGNER_CERTIFICATE_NOT_FOUND = 128; + PKCS7_R_SIGNING_CTRL_FAILURE = 147; + PKCS7_R_SIGNING_NOT_SUPPORTED_FOR_THIS_KEY_TYPE = 148; + PKCS7_R_SMIME_TEXT_ERROR = 129; + PKCS7_R_UNABLE_TO_FIND_CERTIFICATE = 106; + PKCS7_R_UNABLE_TO_FIND_MEM_BIO = 107; + PKCS7_R_UNABLE_TO_FIND_MESSAGE_DIGEST = 108; + PKCS7_R_UNKNOWN_DIGEST_TYPE = 109; + PKCS7_R_UNKNOWN_OPERATION = 110; + PKCS7_R_UNSUPPORTED_CIPHER_TYPE = 111; + PKCS7_R_UNSUPPORTED_CONTENT_TYPE = 112; + PKCS7_R_WRONG_CONTENT_TYPE = 113; + PKCS7_R_WRONG_PKCS7_TYPE = 114; + + { The EXTERNALSYM directive is ignored by FPC, however, it is used by Delphi as follows: + + The EXTERNALSYM directive prevents the specified Delphi symbol from appearing in header + files generated for C++. } + + {$EXTERNALSYM ERR_load_PKCS7_strings} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +var + ERR_load_PKCS7_strings: function : TIdC_INT; cdecl = nil; + +{$ELSE} + function ERR_load_PKCS7_strings: TIdC_INT cdecl; external CLibCrypto; + +{$ENDIF} + +implementation + + uses + classes, + IdSSLOpenSSLExceptionHandlers, + IdResourceStringsOpenSSL + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + ,IdSSLOpenSSLLoader + {$ENDIF}; + + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +const + ERR_load_PKCS7_strings_procname = 'ERR_load_PKCS7_strings'; + + +{$WARN NO_RETVAL OFF} +function ERR_ERR_load_PKCS7_strings: TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ERR_load_PKCS7_strings_procname); +end; + + + +{$WARN NO_RETVAL ON} + +procedure Load(const ADllHandle: TIdLibHandle; LibVersion: TIdC_UINT; const AFailed: TStringList); + +var FuncLoadError: boolean; + +begin + ERR_load_PKCS7_strings := LoadLibFunction(ADllHandle, ERR_load_PKCS7_strings_procname); + FuncLoadError := not assigned(ERR_load_PKCS7_strings); + if FuncLoadError then + begin + {$if not defined(ERR_load_PKCS7_strings_allownil)} + ERR_load_PKCS7_strings := @ERR_ERR_load_PKCS7_strings; + {$ifend} + {$if declared(ERR_load_PKCS7_strings_introduced)} + if LibVersion < ERR_load_PKCS7_strings_introduced then + begin + {$if declared(FC_ERR_load_PKCS7_strings)} + ERR_load_PKCS7_strings := @FC_ERR_load_PKCS7_strings; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ERR_load_PKCS7_strings_removed)} + if ERR_load_PKCS7_strings_removed <= LibVersion then + begin + {$if declared(_ERR_load_PKCS7_strings)} + ERR_load_PKCS7_strings := @_ERR_load_PKCS7_strings; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ERR_load_PKCS7_strings_allownil)} + if FuncLoadError then + AFailed.Add('ERR_load_PKCS7_strings'); + {$ifend} + end; + + +end; + +procedure Unload; +begin + ERR_load_PKCS7_strings := nil; +end; +{$ELSE} +{$ENDIF} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +initialization + Register_SSLLoader(@Load,'LibCrypto'); + Register_SSLUnloader(@Unload); +{$ENDIF} +end. diff --git a/IdOpenSSLHeaders_provider.pas b/IdOpenSSLHeaders_provider.pas new file mode 100644 index 0000000..37d0437 --- /dev/null +++ b/IdOpenSSLHeaders_provider.pas @@ -0,0 +1,977 @@ + (* This unit was generated using the script genOpenSSLHdrs.sh from the source file IdOpenSSLHeaders_provider.h2pas + It should not be modified directly. All changes should be made to IdOpenSSLHeaders_provider.h2pas + and this file regenerated. IdOpenSSLHeaders_provider.h2pas is distributed with the full Indy + Distribution. + *) + +{$i IdCompilerDefines.inc} +{$i IdSSLOpenSSLDefines.inc} +{$IFNDEF USE_OPENSSL} + { error Should not compile if USE_OPENSSL is not defined!!!} +{$ENDIF} +{******************************************************************************} +{ } +{ Indy (Internet Direct) - Internet Protocols Simplified } +{ } +{ https://www.indyproject.org/ } +{ https://gitter.im/IndySockets/Indy } +{ } +{******************************************************************************} +{ } +{ This file is part of the Indy (Internet Direct) project, and is offered } +{ under the dual-licensing agreement described on the Indy website. } +{ (https://www.indyproject.org/license/) } +{ } +{ Copyright: } +{ (c) 1993-2020, Chad Z. Hower and the Indy Pit Crew. All rights reserved. } +{ } +{******************************************************************************} +{ } +{ } +{******************************************************************************} + +unit IdOpenSSLHeaders_provider; + +interface + +{ + Automatically converted by H2Pas 1.0.0 from provider.h + The following command line parameters were used: + provider.h +} + +uses + IdCTypes, + IdGlobal, + IdSSLOpenSSLConsts, + IdOpenSSLHeaders_ossl_typ, + IdOpenSSLHeaders_core; + +type + POSSL_ALGORITHM = ^OSSL_ALGORITHM; + POSSL_CALLBACK = ^OSSL_CALLBACK; + POSSL_DISPATCH = ^OSSL_DISPATCH; + POSSL_PARAM = ^OSSL_PARAM; + POSSL_PROVIDER = pointer; + POSSL_provider_init_fn = ^OSSL_provider_init_fn; + + TDo_AllCallback = function (provider:POSSL_PROVIDER; cbdata:pointer):TIdC_LONG; cdecl; + +{$IFDEF FPC} +{$PACKRECORDS C} +{$ENDIF} + { + * Copyright 2019-2023 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + } + { Set and Get a library context search path } + { The EXTERNALSYM directive is ignored by FPC, however, it is used by Delphi as follows: + + The EXTERNALSYM directive prevents the specified Delphi symbol from appearing in header + files generated for C++. } + + {$EXTERNALSYM OSSL_PROVIDER_set_default_search_path} {introduced 3.0.0} + {$EXTERNALSYM OSSL_PROVIDER_load} {introduced 3.0.0} + {$EXTERNALSYM OSSL_PROVIDER_try_load} {introduced 3.0.0} + {$EXTERNALSYM OSSL_PROVIDER_unload} {introduced 3.0.0} + {$EXTERNALSYM OSSL_PROVIDER_available} {introduced 3.0.0} + {$EXTERNALSYM OSSL_PROVIDER_do_all} {introduced 3.0.0} + {$EXTERNALSYM OSSL_PROVIDER_gettable_params} {introduced 3.0.0} + {$EXTERNALSYM OSSL_PROVIDER_get_params} {introduced 3.0.0} + {$EXTERNALSYM OSSL_PROVIDER_self_test}{introduced 3.0.0} + {$EXTERNALSYM OSSL_PROVIDER_get_capabilities}{introduced 3.0.0} + {$EXTERNALSYM OSSL_PROVIDER_query_operation} {introduced 3.0.0} + {$EXTERNALSYM OSSL_PROVIDER_unquery_operation} {introduced 3.0.0} + {$EXTERNALSYM OSSL_PROVIDER_get0_provider_ctx} {introduced 3.0.0} + {$EXTERNALSYM OSSL_PROVIDER_get0_dispatch} {introduced 3.0.0} + {$EXTERNALSYM OSSL_PROVIDER_add_builtin} {introduced 3.0.0} + {$EXTERNALSYM OSSL_PROVIDER_get0_name} {introduced 3.0.0} + {$IFDEF OPENSSL_3_2_ORLATER} + {$EXTERNALSYM OSSL_PROVIDER_get0_default_search_path} {introduced 3.2.0} + {$EXTERNALSYM OSSL_PROVIDER_try_load_ex} {introduced 3.2.0} + {$EXTERNALSYM OSSL_PROVIDER_load_ex} {introduced 3.2.0} + {$ENDIF} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +var + OSSL_PROVIDER_set_default_search_path: function (ctx: POSSL_LIB_CTX; path: PIdAnsiChar): TIdC_INT; cdecl = nil; {introduced 3.0.0} + { Load and unload a provider } + OSSL_PROVIDER_load: function (_para1:POSSL_LIB_CTX; name: PIdAnsiChar):POSSL_PROVIDER; cdecl = nil; {introduced 3.0.0} + OSSL_PROVIDER_try_load: function (_para1:POSSL_LIB_CTX; name: PIdAnsiChar; retain_fallbacks: TIdC_LONG):POSSL_PROVIDER; cdecl = nil; {introduced 3.0.0} + OSSL_PROVIDER_unload: function (prov:POSSL_PROVIDER):TIdC_LONG; cdecl = nil; {introduced 3.0.0} + OSSL_PROVIDER_available: function (_para1:POSSL_LIB_CTX; name:PIdAnsiChar):TIdC_LONG; cdecl = nil; {introduced 3.0.0} + OSSL_PROVIDER_do_all: function (ctx:POSSL_LIB_CTX; cb:TDo_AllCallback; cbdata:pointer):TIdC_LONG; cdecl = nil; {introduced 3.0.0} + OSSL_PROVIDER_gettable_params: function (prov:POSSL_PROVIDER):POSSL_PARAM; cdecl = nil; {introduced 3.0.0} + OSSL_PROVIDER_get_params: function (prov:POSSL_PROVIDER; params:POSSL_PARAM):TIdC_LONG; cdecl = nil; {introduced 3.0.0} + OSSL_PROVIDER_self_test: function (prov:POSSL_PROVIDER):TIdC_LONG; cdecl = nil;{introduced 3.0.0} + OSSL_PROVIDER_get_capabilities: function (prov:POSSL_PROVIDER; capability:PIdAnsiChar; cb:POSSL_CALLBACK; arg:pointer):TIdC_LONG; cdecl = nil;{introduced 3.0.0} + OSSL_PROVIDER_query_operation: function (prov:POSSL_PROVIDER; operation_id:TIdC_LONG; no_cache:PIdC_LONG):POSSL_ALGORITHM; cdecl = nil; {introduced 3.0.0} + OSSL_PROVIDER_unquery_operation: procedure (prov:POSSL_PROVIDER; operation_id:TIdC_LONG; algs:POSSL_ALGORITHM); cdecl = nil; {introduced 3.0.0} + OSSL_PROVIDER_get0_provider_ctx: function (prov:POSSL_PROVIDER):pointer; cdecl = nil; {introduced 3.0.0} + OSSL_PROVIDER_get0_dispatch: function (prov:POSSL_PROVIDER):POSSL_DISPATCH; cdecl = nil; {introduced 3.0.0} + { Add a built in providers } + OSSL_PROVIDER_add_builtin: function (_para1:POSSL_LIB_CTX; name:PIdAnsiChar; init_fn:POSSL_provider_init_fn):TIdC_LONG; cdecl = nil; {introduced 3.0.0} + + { Information } + OSSL_PROVIDER_get0_name: function (prov:POSSL_PROVIDER):PIdAnsiChar; cdecl = nil; {introduced 3.0.0} + OSSL_PROVIDER_get0_default_search_path: function (libctx: POSSL_LIB_CTX): PIdAnsiChar; cdecl = nil; {introduced 3.2.0} + OSSL_PROVIDER_try_load_ex: function (_para1:POSSL_LIB_CTX; name: PIdAnsiChar; params:POSSL_PARAM; retain_fallbacks:TIdC_LONG):POSSL_PROVIDER; cdecl = nil; {introduced 3.2.0} + OSSL_PROVIDER_load_ex: function (_para1:POSSL_LIB_CTX; name: PIdAnsiChar; params: POSSL_PARAM):POSSL_PROVIDER; cdecl = nil; {introduced 3.2.0} + +{$ELSE} + function OSSL_PROVIDER_set_default_search_path(ctx: POSSL_LIB_CTX; path: PIdAnsiChar): TIdC_INT cdecl; external CLibCrypto; {introduced 3.0.0} + { Load and unload a provider } + function OSSL_PROVIDER_load(_para1:POSSL_LIB_CTX; name: PIdAnsiChar):POSSL_PROVIDER cdecl; external CLibCrypto; {introduced 3.0.0} + function OSSL_PROVIDER_try_load(_para1:POSSL_LIB_CTX; name: PIdAnsiChar; retain_fallbacks: TIdC_LONG):POSSL_PROVIDER cdecl; external CLibCrypto; {introduced 3.0.0} + function OSSL_PROVIDER_unload(prov:POSSL_PROVIDER):TIdC_LONG cdecl; external CLibCrypto; {introduced 3.0.0} + function OSSL_PROVIDER_available(_para1:POSSL_LIB_CTX; name:PIdAnsiChar):TIdC_LONG cdecl; external CLibCrypto; {introduced 3.0.0} + function OSSL_PROVIDER_do_all(ctx:POSSL_LIB_CTX; cb:TDo_AllCallback; cbdata:pointer):TIdC_LONG cdecl; external CLibCrypto; {introduced 3.0.0} + function OSSL_PROVIDER_gettable_params(prov:POSSL_PROVIDER):POSSL_PARAM cdecl; external CLibCrypto; {introduced 3.0.0} + function OSSL_PROVIDER_get_params(prov:POSSL_PROVIDER; params:POSSL_PARAM):TIdC_LONG cdecl; external CLibCrypto; {introduced 3.0.0} + function OSSL_PROVIDER_self_test(prov:POSSL_PROVIDER):TIdC_LONG cdecl; external CLibCrypto;{introduced 3.0.0} + function OSSL_PROVIDER_get_capabilities(prov:POSSL_PROVIDER; capability:PIdAnsiChar; cb:POSSL_CALLBACK; arg:pointer):TIdC_LONG cdecl; external CLibCrypto;{introduced 3.0.0} + function OSSL_PROVIDER_query_operation(prov:POSSL_PROVIDER; operation_id:TIdC_LONG; no_cache:PIdC_LONG):POSSL_ALGORITHM cdecl; external CLibCrypto; {introduced 3.0.0} + procedure OSSL_PROVIDER_unquery_operation(prov:POSSL_PROVIDER; operation_id:TIdC_LONG; algs:POSSL_ALGORITHM) cdecl; external CLibCrypto; {introduced 3.0.0} + function OSSL_PROVIDER_get0_provider_ctx(prov:POSSL_PROVIDER):pointer cdecl; external CLibCrypto; {introduced 3.0.0} + function OSSL_PROVIDER_get0_dispatch(prov:POSSL_PROVIDER):POSSL_DISPATCH cdecl; external CLibCrypto; {introduced 3.0.0} + { Add a built in providers } + function OSSL_PROVIDER_add_builtin(_para1:POSSL_LIB_CTX; name:PIdAnsiChar; init_fn:POSSL_provider_init_fn):TIdC_LONG cdecl; external CLibCrypto; {introduced 3.0.0} + + { Information } + function OSSL_PROVIDER_get0_name(prov:POSSL_PROVIDER):PIdAnsiChar cdecl; external CLibCrypto; {introduced 3.0.0} + {$IFDEF OPENSSL_3_2_ORLATER} + function OSSL_PROVIDER_get0_default_search_path(libctx: POSSL_LIB_CTX): PIdAnsiChar cdecl; external CLibCrypto; {introduced 3.2.0} + function OSSL_PROVIDER_try_load_ex(_para1:POSSL_LIB_CTX; name: PIdAnsiChar; params:POSSL_PARAM; retain_fallbacks:TIdC_LONG):POSSL_PROVIDER cdecl; external CLibCrypto; {introduced 3.2.0} + function OSSL_PROVIDER_load_ex(_para1:POSSL_LIB_CTX; name: PIdAnsiChar; params: POSSL_PARAM):POSSL_PROVIDER cdecl; external CLibCrypto; {introduced 3.2.0} + {$ENDIF} + +{$ENDIF} + +implementation + + uses + classes, + IdSSLOpenSSLExceptionHandlers, + IdResourceStringsOpenSSL + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + ,IdSSLOpenSSLLoader + {$ENDIF}; + +const + OSSL_PROVIDER_set_default_search_path_introduced = (byte(3) shl 8 or byte(0)) shl 8 or byte(0); + OSSL_PROVIDER_load_introduced = (byte(3) shl 8 or byte(0)) shl 8 or byte(0); + OSSL_PROVIDER_try_load_introduced = (byte(3) shl 8 or byte(0)) shl 8 or byte(0); + OSSL_PROVIDER_unload_introduced = (byte(3) shl 8 or byte(0)) shl 8 or byte(0); + OSSL_PROVIDER_available_introduced = (byte(3) shl 8 or byte(0)) shl 8 or byte(0); + OSSL_PROVIDER_do_all_introduced = (byte(3) shl 8 or byte(0)) shl 8 or byte(0); + OSSL_PROVIDER_gettable_params_introduced = (byte(3) shl 8 or byte(0)) shl 8 or byte(0); + OSSL_PROVIDER_get_params_introduced = (byte(3) shl 8 or byte(0)) shl 8 or byte(0); + OSSL_PROVIDER_self_test_introduced = (byte(3) shl 8 or byte(0)) shl 8 or byte(0); + OSSL_PROVIDER_get_capabilities_introduced = (byte(3) shl 8 or byte(0)) shl 8 or byte(0); + OSSL_PROVIDER_query_operation_introduced = (byte(3) shl 8 or byte(0)) shl 8 or byte(0); + OSSL_PROVIDER_unquery_operation_introduced = (byte(3) shl 8 or byte(0)) shl 8 or byte(0); + OSSL_PROVIDER_get0_provider_ctx_introduced = (byte(3) shl 8 or byte(0)) shl 8 or byte(0); + OSSL_PROVIDER_get0_dispatch_introduced = (byte(3) shl 8 or byte(0)) shl 8 or byte(0); + OSSL_PROVIDER_add_builtin_introduced = (byte(3) shl 8 or byte(0)) shl 8 or byte(0); + OSSL_PROVIDER_get0_name_introduced = (byte(3) shl 8 or byte(0)) shl 8 or byte(0); + OSSL_PROVIDER_get0_default_search_path_introduced = (byte(3) shl 8 or byte(2)) shl 8 or byte(0); + OSSL_PROVIDER_try_load_ex_introduced = (byte(3) shl 8 or byte(2)) shl 8 or byte(0); + OSSL_PROVIDER_load_ex_introduced = (byte(3) shl 8 or byte(2)) shl 8 or byte(0); +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +const + OSSL_PROVIDER_set_default_search_path_procname = 'OSSL_PROVIDER_set_default_search_path'; {introduced 3.0.0} + { Load and unload a provider } + OSSL_PROVIDER_load_procname = 'OSSL_PROVIDER_load'; {introduced 3.0.0} + OSSL_PROVIDER_try_load_procname = 'OSSL_PROVIDER_try_load'; {introduced 3.0.0} + OSSL_PROVIDER_unload_procname = 'OSSL_PROVIDER_unload'; {introduced 3.0.0} + OSSL_PROVIDER_available_procname = 'OSSL_PROVIDER_available'; {introduced 3.0.0} + OSSL_PROVIDER_do_all_procname = 'OSSL_PROVIDER_do_all'; {introduced 3.0.0} + OSSL_PROVIDER_gettable_params_procname = 'OSSL_PROVIDER_gettable_params'; {introduced 3.0.0} + OSSL_PROVIDER_get_params_procname = 'OSSL_PROVIDER_get_params'; {introduced 3.0.0} + OSSL_PROVIDER_self_test_procname = 'OSSL_PROVIDER_self_test';{introduced 3.0.0} + OSSL_PROVIDER_get_capabilities_procname = 'OSSL_PROVIDER_get_capabilities';{introduced 3.0.0} + OSSL_PROVIDER_query_operation_procname = 'OSSL_PROVIDER_query_operation'; {introduced 3.0.0} + OSSL_PROVIDER_unquery_operation_procname = 'OSSL_PROVIDER_unquery_operation'; {introduced 3.0.0} + OSSL_PROVIDER_get0_provider_ctx_procname = 'OSSL_PROVIDER_get0_provider_ctx'; {introduced 3.0.0} + OSSL_PROVIDER_get0_dispatch_procname = 'OSSL_PROVIDER_get0_dispatch'; {introduced 3.0.0} + { Add a built in providers } + OSSL_PROVIDER_add_builtin_procname = 'OSSL_PROVIDER_add_builtin'; {introduced 3.0.0} + + { Information } + OSSL_PROVIDER_get0_name_procname = 'OSSL_PROVIDER_get0_name'; {introduced 3.0.0} + OSSL_PROVIDER_get0_default_search_path_procname = 'OSSL_PROVIDER_get0_default_search_path'; {introduced 3.2.0} + OSSL_PROVIDER_try_load_ex_procname = 'OSSL_PROVIDER_try_load_ex'; {introduced 3.2.0} + OSSL_PROVIDER_load_ex_procname = 'OSSL_PROVIDER_load_ex'; {introduced 3.2.0} + +{$WARN NO_RETVAL OFF} +function ERR_OSSL_PROVIDER_set_default_search_path(ctx: POSSL_LIB_CTX; path: PIdAnsiChar): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(OSSL_PROVIDER_set_default_search_path_procname); +end; + + {introduced 3.0.0} + { Load and unload a provider } +function ERR_OSSL_PROVIDER_load(_para1:POSSL_LIB_CTX; name: PIdAnsiChar):POSSL_PROVIDER; +begin + EIdAPIFunctionNotPresent.RaiseException(OSSL_PROVIDER_load_procname); +end; + + {introduced 3.0.0} +function ERR_OSSL_PROVIDER_try_load(_para1:POSSL_LIB_CTX; name: PIdAnsiChar; retain_fallbacks: TIdC_LONG):POSSL_PROVIDER; +begin + EIdAPIFunctionNotPresent.RaiseException(OSSL_PROVIDER_try_load_procname); +end; + + {introduced 3.0.0} +function ERR_OSSL_PROVIDER_unload(prov:POSSL_PROVIDER):TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(OSSL_PROVIDER_unload_procname); +end; + + {introduced 3.0.0} +function ERR_OSSL_PROVIDER_available(_para1:POSSL_LIB_CTX; name:PIdAnsiChar):TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(OSSL_PROVIDER_available_procname); +end; + + {introduced 3.0.0} +function ERR_OSSL_PROVIDER_do_all(ctx:POSSL_LIB_CTX; cb:TDo_AllCallback; cbdata:pointer):TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(OSSL_PROVIDER_do_all_procname); +end; + + {introduced 3.0.0} +function ERR_OSSL_PROVIDER_gettable_params(prov:POSSL_PROVIDER):POSSL_PARAM; +begin + EIdAPIFunctionNotPresent.RaiseException(OSSL_PROVIDER_gettable_params_procname); +end; + + {introduced 3.0.0} +function ERR_OSSL_PROVIDER_get_params(prov:POSSL_PROVIDER; params:POSSL_PARAM):TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(OSSL_PROVIDER_get_params_procname); +end; + + {introduced 3.0.0} +function ERR_OSSL_PROVIDER_self_test(prov:POSSL_PROVIDER):TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(OSSL_PROVIDER_self_test_procname); +end; + +{introduced 3.0.0} +function ERR_OSSL_PROVIDER_get_capabilities(prov:POSSL_PROVIDER; capability:PIdAnsiChar; cb:POSSL_CALLBACK; arg:pointer):TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(OSSL_PROVIDER_get_capabilities_procname); +end; + +{introduced 3.0.0} +function ERR_OSSL_PROVIDER_query_operation(prov:POSSL_PROVIDER; operation_id:TIdC_LONG; no_cache:PIdC_LONG):POSSL_ALGORITHM; +begin + EIdAPIFunctionNotPresent.RaiseException(OSSL_PROVIDER_query_operation_procname); +end; + + {introduced 3.0.0} +procedure ERR_OSSL_PROVIDER_unquery_operation(prov:POSSL_PROVIDER; operation_id:TIdC_LONG; algs:POSSL_ALGORITHM); +begin + EIdAPIFunctionNotPresent.RaiseException(OSSL_PROVIDER_unquery_operation_procname); +end; + + {introduced 3.0.0} +function ERR_OSSL_PROVIDER_get0_provider_ctx(prov:POSSL_PROVIDER):pointer; +begin + EIdAPIFunctionNotPresent.RaiseException(OSSL_PROVIDER_get0_provider_ctx_procname); +end; + + {introduced 3.0.0} +function ERR_OSSL_PROVIDER_get0_dispatch(prov:POSSL_PROVIDER):POSSL_DISPATCH; +begin + EIdAPIFunctionNotPresent.RaiseException(OSSL_PROVIDER_get0_dispatch_procname); +end; + + {introduced 3.0.0} + { Add a built in providers } +function ERR_OSSL_PROVIDER_add_builtin(_para1:POSSL_LIB_CTX; name:PIdAnsiChar; init_fn:POSSL_provider_init_fn):TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(OSSL_PROVIDER_add_builtin_procname); +end; + + {introduced 3.0.0} + + { Information } +function ERR_OSSL_PROVIDER_get0_name(prov:POSSL_PROVIDER):PIdAnsiChar; +begin + EIdAPIFunctionNotPresent.RaiseException(OSSL_PROVIDER_get0_name_procname); +end; + + {introduced 3.0.0} +function ERR_OSSL_PROVIDER_get0_default_search_path(libctx: POSSL_LIB_CTX): PIdAnsiChar; +begin + EIdAPIFunctionNotPresent.RaiseException(OSSL_PROVIDER_get0_default_search_path_procname); +end; + + {introduced 3.2.0} +function ERR_OSSL_PROVIDER_try_load_ex(_para1:POSSL_LIB_CTX; name: PIdAnsiChar; params:POSSL_PARAM; retain_fallbacks:TIdC_LONG):POSSL_PROVIDER; +begin + EIdAPIFunctionNotPresent.RaiseException(OSSL_PROVIDER_try_load_ex_procname); +end; + + {introduced 3.2.0} +function ERR_OSSL_PROVIDER_load_ex(_para1:POSSL_LIB_CTX; name: PIdAnsiChar; params: POSSL_PARAM):POSSL_PROVIDER; +begin + EIdAPIFunctionNotPresent.RaiseException(OSSL_PROVIDER_load_ex_procname); +end; + + {introduced 3.2.0} + +{$WARN NO_RETVAL ON} + +procedure Load(const ADllHandle: TIdLibHandle; LibVersion: TIdC_UINT; const AFailed: TStringList); + +var FuncLoadError: boolean; + +begin + OSSL_PROVIDER_set_default_search_path := LoadLibFunction(ADllHandle, OSSL_PROVIDER_set_default_search_path_procname); + FuncLoadError := not assigned(OSSL_PROVIDER_set_default_search_path); + if FuncLoadError then + begin + {$if not defined(OSSL_PROVIDER_set_default_search_path_allownil)} + OSSL_PROVIDER_set_default_search_path := @ERR_OSSL_PROVIDER_set_default_search_path; + {$ifend} + {$if declared(OSSL_PROVIDER_set_default_search_path_introduced)} + if LibVersion < OSSL_PROVIDER_set_default_search_path_introduced then + begin + {$if declared(FC_OSSL_PROVIDER_set_default_search_path)} + OSSL_PROVIDER_set_default_search_path := @FC_OSSL_PROVIDER_set_default_search_path; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OSSL_PROVIDER_set_default_search_path_removed)} + if OSSL_PROVIDER_set_default_search_path_removed <= LibVersion then + begin + {$if declared(_OSSL_PROVIDER_set_default_search_path)} + OSSL_PROVIDER_set_default_search_path := @_OSSL_PROVIDER_set_default_search_path; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OSSL_PROVIDER_set_default_search_path_allownil)} + if FuncLoadError then + AFailed.Add('OSSL_PROVIDER_set_default_search_path'); + {$ifend} + end; + + {introduced 3.0.0} + OSSL_PROVIDER_load := LoadLibFunction(ADllHandle, OSSL_PROVIDER_load_procname); + FuncLoadError := not assigned(OSSL_PROVIDER_load); + if FuncLoadError then + begin + {$if not defined(OSSL_PROVIDER_load_allownil)} + OSSL_PROVIDER_load := @ERR_OSSL_PROVIDER_load; + {$ifend} + {$if declared(OSSL_PROVIDER_load_introduced)} + if LibVersion < OSSL_PROVIDER_load_introduced then + begin + {$if declared(FC_OSSL_PROVIDER_load)} + OSSL_PROVIDER_load := @FC_OSSL_PROVIDER_load; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OSSL_PROVIDER_load_removed)} + if OSSL_PROVIDER_load_removed <= LibVersion then + begin + {$if declared(_OSSL_PROVIDER_load)} + OSSL_PROVIDER_load := @_OSSL_PROVIDER_load; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OSSL_PROVIDER_load_allownil)} + if FuncLoadError then + AFailed.Add('OSSL_PROVIDER_load'); + {$ifend} + end; + + {introduced 3.0.0} + OSSL_PROVIDER_try_load := LoadLibFunction(ADllHandle, OSSL_PROVIDER_try_load_procname); + FuncLoadError := not assigned(OSSL_PROVIDER_try_load); + if FuncLoadError then + begin + {$if not defined(OSSL_PROVIDER_try_load_allownil)} + OSSL_PROVIDER_try_load := @ERR_OSSL_PROVIDER_try_load; + {$ifend} + {$if declared(OSSL_PROVIDER_try_load_introduced)} + if LibVersion < OSSL_PROVIDER_try_load_introduced then + begin + {$if declared(FC_OSSL_PROVIDER_try_load)} + OSSL_PROVIDER_try_load := @FC_OSSL_PROVIDER_try_load; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OSSL_PROVIDER_try_load_removed)} + if OSSL_PROVIDER_try_load_removed <= LibVersion then + begin + {$if declared(_OSSL_PROVIDER_try_load)} + OSSL_PROVIDER_try_load := @_OSSL_PROVIDER_try_load; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OSSL_PROVIDER_try_load_allownil)} + if FuncLoadError then + AFailed.Add('OSSL_PROVIDER_try_load'); + {$ifend} + end; + + {introduced 3.0.0} + OSSL_PROVIDER_unload := LoadLibFunction(ADllHandle, OSSL_PROVIDER_unload_procname); + FuncLoadError := not assigned(OSSL_PROVIDER_unload); + if FuncLoadError then + begin + {$if not defined(OSSL_PROVIDER_unload_allownil)} + OSSL_PROVIDER_unload := @ERR_OSSL_PROVIDER_unload; + {$ifend} + {$if declared(OSSL_PROVIDER_unload_introduced)} + if LibVersion < OSSL_PROVIDER_unload_introduced then + begin + {$if declared(FC_OSSL_PROVIDER_unload)} + OSSL_PROVIDER_unload := @FC_OSSL_PROVIDER_unload; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OSSL_PROVIDER_unload_removed)} + if OSSL_PROVIDER_unload_removed <= LibVersion then + begin + {$if declared(_OSSL_PROVIDER_unload)} + OSSL_PROVIDER_unload := @_OSSL_PROVIDER_unload; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OSSL_PROVIDER_unload_allownil)} + if FuncLoadError then + AFailed.Add('OSSL_PROVIDER_unload'); + {$ifend} + end; + + {introduced 3.0.0} + OSSL_PROVIDER_available := LoadLibFunction(ADllHandle, OSSL_PROVIDER_available_procname); + FuncLoadError := not assigned(OSSL_PROVIDER_available); + if FuncLoadError then + begin + {$if not defined(OSSL_PROVIDER_available_allownil)} + OSSL_PROVIDER_available := @ERR_OSSL_PROVIDER_available; + {$ifend} + {$if declared(OSSL_PROVIDER_available_introduced)} + if LibVersion < OSSL_PROVIDER_available_introduced then + begin + {$if declared(FC_OSSL_PROVIDER_available)} + OSSL_PROVIDER_available := @FC_OSSL_PROVIDER_available; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OSSL_PROVIDER_available_removed)} + if OSSL_PROVIDER_available_removed <= LibVersion then + begin + {$if declared(_OSSL_PROVIDER_available)} + OSSL_PROVIDER_available := @_OSSL_PROVIDER_available; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OSSL_PROVIDER_available_allownil)} + if FuncLoadError then + AFailed.Add('OSSL_PROVIDER_available'); + {$ifend} + end; + + {introduced 3.0.0} + OSSL_PROVIDER_do_all := LoadLibFunction(ADllHandle, OSSL_PROVIDER_do_all_procname); + FuncLoadError := not assigned(OSSL_PROVIDER_do_all); + if FuncLoadError then + begin + {$if not defined(OSSL_PROVIDER_do_all_allownil)} + OSSL_PROVIDER_do_all := @ERR_OSSL_PROVIDER_do_all; + {$ifend} + {$if declared(OSSL_PROVIDER_do_all_introduced)} + if LibVersion < OSSL_PROVIDER_do_all_introduced then + begin + {$if declared(FC_OSSL_PROVIDER_do_all)} + OSSL_PROVIDER_do_all := @FC_OSSL_PROVIDER_do_all; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OSSL_PROVIDER_do_all_removed)} + if OSSL_PROVIDER_do_all_removed <= LibVersion then + begin + {$if declared(_OSSL_PROVIDER_do_all)} + OSSL_PROVIDER_do_all := @_OSSL_PROVIDER_do_all; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OSSL_PROVIDER_do_all_allownil)} + if FuncLoadError then + AFailed.Add('OSSL_PROVIDER_do_all'); + {$ifend} + end; + + {introduced 3.0.0} + OSSL_PROVIDER_gettable_params := LoadLibFunction(ADllHandle, OSSL_PROVIDER_gettable_params_procname); + FuncLoadError := not assigned(OSSL_PROVIDER_gettable_params); + if FuncLoadError then + begin + {$if not defined(OSSL_PROVIDER_gettable_params_allownil)} + OSSL_PROVIDER_gettable_params := @ERR_OSSL_PROVIDER_gettable_params; + {$ifend} + {$if declared(OSSL_PROVIDER_gettable_params_introduced)} + if LibVersion < OSSL_PROVIDER_gettable_params_introduced then + begin + {$if declared(FC_OSSL_PROVIDER_gettable_params)} + OSSL_PROVIDER_gettable_params := @FC_OSSL_PROVIDER_gettable_params; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OSSL_PROVIDER_gettable_params_removed)} + if OSSL_PROVIDER_gettable_params_removed <= LibVersion then + begin + {$if declared(_OSSL_PROVIDER_gettable_params)} + OSSL_PROVIDER_gettable_params := @_OSSL_PROVIDER_gettable_params; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OSSL_PROVIDER_gettable_params_allownil)} + if FuncLoadError then + AFailed.Add('OSSL_PROVIDER_gettable_params'); + {$ifend} + end; + + {introduced 3.0.0} + OSSL_PROVIDER_get_params := LoadLibFunction(ADllHandle, OSSL_PROVIDER_get_params_procname); + FuncLoadError := not assigned(OSSL_PROVIDER_get_params); + if FuncLoadError then + begin + {$if not defined(OSSL_PROVIDER_get_params_allownil)} + OSSL_PROVIDER_get_params := @ERR_OSSL_PROVIDER_get_params; + {$ifend} + {$if declared(OSSL_PROVIDER_get_params_introduced)} + if LibVersion < OSSL_PROVIDER_get_params_introduced then + begin + {$if declared(FC_OSSL_PROVIDER_get_params)} + OSSL_PROVIDER_get_params := @FC_OSSL_PROVIDER_get_params; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OSSL_PROVIDER_get_params_removed)} + if OSSL_PROVIDER_get_params_removed <= LibVersion then + begin + {$if declared(_OSSL_PROVIDER_get_params)} + OSSL_PROVIDER_get_params := @_OSSL_PROVIDER_get_params; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OSSL_PROVIDER_get_params_allownil)} + if FuncLoadError then + AFailed.Add('OSSL_PROVIDER_get_params'); + {$ifend} + end; + + {introduced 3.0.0} + OSSL_PROVIDER_self_test := LoadLibFunction(ADllHandle, OSSL_PROVIDER_self_test_procname); + FuncLoadError := not assigned(OSSL_PROVIDER_self_test); + if FuncLoadError then + begin + {$if not defined(OSSL_PROVIDER_self_test_allownil)} + OSSL_PROVIDER_self_test := @ERR_OSSL_PROVIDER_self_test; + {$ifend} + {$if declared(OSSL_PROVIDER_self_test_introduced)} + if LibVersion < OSSL_PROVIDER_self_test_introduced then + begin + {$if declared(FC_OSSL_PROVIDER_self_test)} + OSSL_PROVIDER_self_test := @FC_OSSL_PROVIDER_self_test; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OSSL_PROVIDER_self_test_removed)} + if OSSL_PROVIDER_self_test_removed <= LibVersion then + begin + {$if declared(_OSSL_PROVIDER_self_test)} + OSSL_PROVIDER_self_test := @_OSSL_PROVIDER_self_test; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OSSL_PROVIDER_self_test_allownil)} + if FuncLoadError then + AFailed.Add('OSSL_PROVIDER_self_test'); + {$ifend} + end; + +{introduced 3.0.0} + OSSL_PROVIDER_get_capabilities := LoadLibFunction(ADllHandle, OSSL_PROVIDER_get_capabilities_procname); + FuncLoadError := not assigned(OSSL_PROVIDER_get_capabilities); + if FuncLoadError then + begin + {$if not defined(OSSL_PROVIDER_get_capabilities_allownil)} + OSSL_PROVIDER_get_capabilities := @ERR_OSSL_PROVIDER_get_capabilities; + {$ifend} + {$if declared(OSSL_PROVIDER_get_capabilities_introduced)} + if LibVersion < OSSL_PROVIDER_get_capabilities_introduced then + begin + {$if declared(FC_OSSL_PROVIDER_get_capabilities)} + OSSL_PROVIDER_get_capabilities := @FC_OSSL_PROVIDER_get_capabilities; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OSSL_PROVIDER_get_capabilities_removed)} + if OSSL_PROVIDER_get_capabilities_removed <= LibVersion then + begin + {$if declared(_OSSL_PROVIDER_get_capabilities)} + OSSL_PROVIDER_get_capabilities := @_OSSL_PROVIDER_get_capabilities; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OSSL_PROVIDER_get_capabilities_allownil)} + if FuncLoadError then + AFailed.Add('OSSL_PROVIDER_get_capabilities'); + {$ifend} + end; + +{introduced 3.0.0} + OSSL_PROVIDER_query_operation := LoadLibFunction(ADllHandle, OSSL_PROVIDER_query_operation_procname); + FuncLoadError := not assigned(OSSL_PROVIDER_query_operation); + if FuncLoadError then + begin + {$if not defined(OSSL_PROVIDER_query_operation_allownil)} + OSSL_PROVIDER_query_operation := @ERR_OSSL_PROVIDER_query_operation; + {$ifend} + {$if declared(OSSL_PROVIDER_query_operation_introduced)} + if LibVersion < OSSL_PROVIDER_query_operation_introduced then + begin + {$if declared(FC_OSSL_PROVIDER_query_operation)} + OSSL_PROVIDER_query_operation := @FC_OSSL_PROVIDER_query_operation; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OSSL_PROVIDER_query_operation_removed)} + if OSSL_PROVIDER_query_operation_removed <= LibVersion then + begin + {$if declared(_OSSL_PROVIDER_query_operation)} + OSSL_PROVIDER_query_operation := @_OSSL_PROVIDER_query_operation; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OSSL_PROVIDER_query_operation_allownil)} + if FuncLoadError then + AFailed.Add('OSSL_PROVIDER_query_operation'); + {$ifend} + end; + + {introduced 3.0.0} + OSSL_PROVIDER_unquery_operation := LoadLibFunction(ADllHandle, OSSL_PROVIDER_unquery_operation_procname); + FuncLoadError := not assigned(OSSL_PROVIDER_unquery_operation); + if FuncLoadError then + begin + {$if not defined(OSSL_PROVIDER_unquery_operation_allownil)} + OSSL_PROVIDER_unquery_operation := @ERR_OSSL_PROVIDER_unquery_operation; + {$ifend} + {$if declared(OSSL_PROVIDER_unquery_operation_introduced)} + if LibVersion < OSSL_PROVIDER_unquery_operation_introduced then + begin + {$if declared(FC_OSSL_PROVIDER_unquery_operation)} + OSSL_PROVIDER_unquery_operation := @FC_OSSL_PROVIDER_unquery_operation; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OSSL_PROVIDER_unquery_operation_removed)} + if OSSL_PROVIDER_unquery_operation_removed <= LibVersion then + begin + {$if declared(_OSSL_PROVIDER_unquery_operation)} + OSSL_PROVIDER_unquery_operation := @_OSSL_PROVIDER_unquery_operation; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OSSL_PROVIDER_unquery_operation_allownil)} + if FuncLoadError then + AFailed.Add('OSSL_PROVIDER_unquery_operation'); + {$ifend} + end; + + {introduced 3.0.0} + OSSL_PROVIDER_get0_provider_ctx := LoadLibFunction(ADllHandle, OSSL_PROVIDER_get0_provider_ctx_procname); + FuncLoadError := not assigned(OSSL_PROVIDER_get0_provider_ctx); + if FuncLoadError then + begin + {$if not defined(OSSL_PROVIDER_get0_provider_ctx_allownil)} + OSSL_PROVIDER_get0_provider_ctx := @ERR_OSSL_PROVIDER_get0_provider_ctx; + {$ifend} + {$if declared(OSSL_PROVIDER_get0_provider_ctx_introduced)} + if LibVersion < OSSL_PROVIDER_get0_provider_ctx_introduced then + begin + {$if declared(FC_OSSL_PROVIDER_get0_provider_ctx)} + OSSL_PROVIDER_get0_provider_ctx := @FC_OSSL_PROVIDER_get0_provider_ctx; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OSSL_PROVIDER_get0_provider_ctx_removed)} + if OSSL_PROVIDER_get0_provider_ctx_removed <= LibVersion then + begin + {$if declared(_OSSL_PROVIDER_get0_provider_ctx)} + OSSL_PROVIDER_get0_provider_ctx := @_OSSL_PROVIDER_get0_provider_ctx; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OSSL_PROVIDER_get0_provider_ctx_allownil)} + if FuncLoadError then + AFailed.Add('OSSL_PROVIDER_get0_provider_ctx'); + {$ifend} + end; + + {introduced 3.0.0} + OSSL_PROVIDER_get0_dispatch := LoadLibFunction(ADllHandle, OSSL_PROVIDER_get0_dispatch_procname); + FuncLoadError := not assigned(OSSL_PROVIDER_get0_dispatch); + if FuncLoadError then + begin + {$if not defined(OSSL_PROVIDER_get0_dispatch_allownil)} + OSSL_PROVIDER_get0_dispatch := @ERR_OSSL_PROVIDER_get0_dispatch; + {$ifend} + {$if declared(OSSL_PROVIDER_get0_dispatch_introduced)} + if LibVersion < OSSL_PROVIDER_get0_dispatch_introduced then + begin + {$if declared(FC_OSSL_PROVIDER_get0_dispatch)} + OSSL_PROVIDER_get0_dispatch := @FC_OSSL_PROVIDER_get0_dispatch; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OSSL_PROVIDER_get0_dispatch_removed)} + if OSSL_PROVIDER_get0_dispatch_removed <= LibVersion then + begin + {$if declared(_OSSL_PROVIDER_get0_dispatch)} + OSSL_PROVIDER_get0_dispatch := @_OSSL_PROVIDER_get0_dispatch; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OSSL_PROVIDER_get0_dispatch_allownil)} + if FuncLoadError then + AFailed.Add('OSSL_PROVIDER_get0_dispatch'); + {$ifend} + end; + + {introduced 3.0.0} + OSSL_PROVIDER_add_builtin := LoadLibFunction(ADllHandle, OSSL_PROVIDER_add_builtin_procname); + FuncLoadError := not assigned(OSSL_PROVIDER_add_builtin); + if FuncLoadError then + begin + {$if not defined(OSSL_PROVIDER_add_builtin_allownil)} + OSSL_PROVIDER_add_builtin := @ERR_OSSL_PROVIDER_add_builtin; + {$ifend} + {$if declared(OSSL_PROVIDER_add_builtin_introduced)} + if LibVersion < OSSL_PROVIDER_add_builtin_introduced then + begin + {$if declared(FC_OSSL_PROVIDER_add_builtin)} + OSSL_PROVIDER_add_builtin := @FC_OSSL_PROVIDER_add_builtin; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OSSL_PROVIDER_add_builtin_removed)} + if OSSL_PROVIDER_add_builtin_removed <= LibVersion then + begin + {$if declared(_OSSL_PROVIDER_add_builtin)} + OSSL_PROVIDER_add_builtin := @_OSSL_PROVIDER_add_builtin; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OSSL_PROVIDER_add_builtin_allownil)} + if FuncLoadError then + AFailed.Add('OSSL_PROVIDER_add_builtin'); + {$ifend} + end; + + {introduced 3.0.0} + OSSL_PROVIDER_get0_name := LoadLibFunction(ADllHandle, OSSL_PROVIDER_get0_name_procname); + FuncLoadError := not assigned(OSSL_PROVIDER_get0_name); + if FuncLoadError then + begin + {$if not defined(OSSL_PROVIDER_get0_name_allownil)} + OSSL_PROVIDER_get0_name := @ERR_OSSL_PROVIDER_get0_name; + {$ifend} + {$if declared(OSSL_PROVIDER_get0_name_introduced)} + if LibVersion < OSSL_PROVIDER_get0_name_introduced then + begin + {$if declared(FC_OSSL_PROVIDER_get0_name)} + OSSL_PROVIDER_get0_name := @FC_OSSL_PROVIDER_get0_name; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OSSL_PROVIDER_get0_name_removed)} + if OSSL_PROVIDER_get0_name_removed <= LibVersion then + begin + {$if declared(_OSSL_PROVIDER_get0_name)} + OSSL_PROVIDER_get0_name := @_OSSL_PROVIDER_get0_name; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OSSL_PROVIDER_get0_name_allownil)} + if FuncLoadError then + AFailed.Add('OSSL_PROVIDER_get0_name'); + {$ifend} + end; + + {introduced 3.0.0} + OSSL_PROVIDER_get0_default_search_path := LoadLibFunction(ADllHandle, OSSL_PROVIDER_get0_default_search_path_procname); + FuncLoadError := not assigned(OSSL_PROVIDER_get0_default_search_path); + if FuncLoadError then + begin + {$if not defined(OSSL_PROVIDER_get0_default_search_path_allownil)} + OSSL_PROVIDER_get0_default_search_path := @ERR_OSSL_PROVIDER_get0_default_search_path; + {$ifend} + {$if declared(OSSL_PROVIDER_get0_default_search_path_introduced)} + if LibVersion < OSSL_PROVIDER_get0_default_search_path_introduced then + begin + {$if declared(FC_OSSL_PROVIDER_get0_default_search_path)} + OSSL_PROVIDER_get0_default_search_path := @FC_OSSL_PROVIDER_get0_default_search_path; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OSSL_PROVIDER_get0_default_search_path_removed)} + if OSSL_PROVIDER_get0_default_search_path_removed <= LibVersion then + begin + {$if declared(_OSSL_PROVIDER_get0_default_search_path)} + OSSL_PROVIDER_get0_default_search_path := @_OSSL_PROVIDER_get0_default_search_path; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OSSL_PROVIDER_get0_default_search_path_allownil)} + if FuncLoadError then + AFailed.Add('OSSL_PROVIDER_get0_default_search_path'); + {$ifend} + end; + + {introduced 3.2.0} + OSSL_PROVIDER_try_load_ex := LoadLibFunction(ADllHandle, OSSL_PROVIDER_try_load_ex_procname); + FuncLoadError := not assigned(OSSL_PROVIDER_try_load_ex); + if FuncLoadError then + begin + {$if not defined(OSSL_PROVIDER_try_load_ex_allownil)} + OSSL_PROVIDER_try_load_ex := @ERR_OSSL_PROVIDER_try_load_ex; + {$ifend} + {$if declared(OSSL_PROVIDER_try_load_ex_introduced)} + if LibVersion < OSSL_PROVIDER_try_load_ex_introduced then + begin + {$if declared(FC_OSSL_PROVIDER_try_load_ex)} + OSSL_PROVIDER_try_load_ex := @FC_OSSL_PROVIDER_try_load_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OSSL_PROVIDER_try_load_ex_removed)} + if OSSL_PROVIDER_try_load_ex_removed <= LibVersion then + begin + {$if declared(_OSSL_PROVIDER_try_load_ex)} + OSSL_PROVIDER_try_load_ex := @_OSSL_PROVIDER_try_load_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OSSL_PROVIDER_try_load_ex_allownil)} + if FuncLoadError then + AFailed.Add('OSSL_PROVIDER_try_load_ex'); + {$ifend} + end; + + {introduced 3.2.0} + OSSL_PROVIDER_load_ex := LoadLibFunction(ADllHandle, OSSL_PROVIDER_load_ex_procname); + FuncLoadError := not assigned(OSSL_PROVIDER_load_ex); + if FuncLoadError then + begin + {$if not defined(OSSL_PROVIDER_load_ex_allownil)} + OSSL_PROVIDER_load_ex := @ERR_OSSL_PROVIDER_load_ex; + {$ifend} + {$if declared(OSSL_PROVIDER_load_ex_introduced)} + if LibVersion < OSSL_PROVIDER_load_ex_introduced then + begin + {$if declared(FC_OSSL_PROVIDER_load_ex)} + OSSL_PROVIDER_load_ex := @FC_OSSL_PROVIDER_load_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OSSL_PROVIDER_load_ex_removed)} + if OSSL_PROVIDER_load_ex_removed <= LibVersion then + begin + {$if declared(_OSSL_PROVIDER_load_ex)} + OSSL_PROVIDER_load_ex := @_OSSL_PROVIDER_load_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OSSL_PROVIDER_load_ex_allownil)} + if FuncLoadError then + AFailed.Add('OSSL_PROVIDER_load_ex'); + {$ifend} + end; + + {introduced 3.2.0} +end; + +procedure Unload; +begin + OSSL_PROVIDER_set_default_search_path := nil; {introduced 3.0.0} + OSSL_PROVIDER_load := nil; {introduced 3.0.0} + OSSL_PROVIDER_try_load := nil; {introduced 3.0.0} + OSSL_PROVIDER_unload := nil; {introduced 3.0.0} + OSSL_PROVIDER_available := nil; {introduced 3.0.0} + OSSL_PROVIDER_do_all := nil; {introduced 3.0.0} + OSSL_PROVIDER_gettable_params := nil; {introduced 3.0.0} + OSSL_PROVIDER_get_params := nil; {introduced 3.0.0} + OSSL_PROVIDER_self_test := nil;{introduced 3.0.0} + OSSL_PROVIDER_get_capabilities := nil;{introduced 3.0.0} + OSSL_PROVIDER_query_operation := nil; {introduced 3.0.0} + OSSL_PROVIDER_unquery_operation := nil; {introduced 3.0.0} + OSSL_PROVIDER_get0_provider_ctx := nil; {introduced 3.0.0} + OSSL_PROVIDER_get0_dispatch := nil; {introduced 3.0.0} + OSSL_PROVIDER_add_builtin := nil; {introduced 3.0.0} + OSSL_PROVIDER_get0_name := nil; {introduced 3.0.0} + OSSL_PROVIDER_get0_default_search_path := nil; {introduced 3.2.0} + OSSL_PROVIDER_try_load_ex := nil; {introduced 3.2.0} + OSSL_PROVIDER_load_ex := nil; {introduced 3.2.0} +end; +{$ELSE} +{$ENDIF} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +initialization + Register_SSLLoader(@Load,'LibCrypto'); + Register_SSLUnloader(@Unload); +{$ENDIF} +end. diff --git a/IdOpenSSLHeaders_rand.pas b/IdOpenSSLHeaders_rand.pas new file mode 100644 index 0000000..62e6b7d --- /dev/null +++ b/IdOpenSSLHeaders_rand.pas @@ -0,0 +1,826 @@ + (* This unit was generated using the script genOpenSSLHdrs.sh from the source file IdOpenSSLHeaders_rand.h2pas + It should not be modified directly. All changes should be made to IdOpenSSLHeaders_rand.h2pas + and this file regenerated. IdOpenSSLHeaders_rand.h2pas is distributed with the full Indy + Distribution. + *) + +{$i IdCompilerDefines.inc} +{$i IdSSLOpenSSLDefines.inc} +{$IFNDEF USE_OPENSSL} + { error Should not compile if USE_OPENSSL is not defined!!!} +{$ENDIF} +{******************************************************************************} +{ } +{ Indy (Internet Direct) - Internet Protocols Simplified } +{ } +{ https://www.indyproject.org/ } +{ https://gitter.im/IndySockets/Indy } +{ } +{******************************************************************************} +{ } +{ This file is part of the Indy (Internet Direct) project, and is offered } +{ under the dual-licensing agreement described on the Indy website. } +{ (https://www.indyproject.org/license/) } +{ } +{ Copyright: } +{ (c) 1993-2020, Chad Z. Hower and the Indy Pit Crew. All rights reserved. } +{ } +{******************************************************************************} +{ } +{ } +{******************************************************************************} + +unit IdOpenSSLHeaders_rand; + +interface + +// Headers for OpenSSL 1.1.1 +// rand.h + + +uses + IdCTypes, + IdGlobal, + IdSSLOpenSSLConsts, + IdOpenSSLHeaders_ossl_typ; + +type + rand_meth_st_seed = function (const buf: Pointer; num: TIdC_INT): TIdC_INT; cdecl; + rand_meth_st_bytes = function (buf: PByte; num: TIdC_INT): TIdC_INT; cdecl; + rand_meth_st_cleanup = procedure; cdecl; + rand_meth_st_add = function (const buf: Pointer; num: TIdC_INT; randomness: TIdC_DOUBLE): TIdC_INT; cdecl; + rand_meth_st_pseudorand = function (buf: PByte; num: TIdC_INT): TIdC_INT; cdecl; + rand_meth_st_status = function: TIdC_INT; cdecl; + + rand_meth_st = record + seed: rand_meth_st_seed; + bytes: rand_meth_st_bytes; + cleanup: rand_meth_st_cleanup; + add: rand_meth_st_add; + pseudorand: rand_meth_st_pseudorand; + status: rand_meth_st_status; + end; + + { The EXTERNALSYM directive is ignored by FPC, however, it is used by Delphi as follows: + + The EXTERNALSYM directive prevents the specified Delphi symbol from appearing in header + files generated for C++. } + + {$EXTERNALSYM RAND_set_rand_method} + {$EXTERNALSYM RAND_get_rand_method} + {$EXTERNALSYM RAND_set_rand_engine} + {$EXTERNALSYM RAND_OpenSSL} + {$EXTERNALSYM RAND_bytes} + {$EXTERNALSYM RAND_priv_bytes} + {$EXTERNALSYM RAND_seed} + {$EXTERNALSYM RAND_keep_random_devices_open} + {$EXTERNALSYM RAND_add} + {$EXTERNALSYM RAND_load_file} + {$EXTERNALSYM RAND_write_file} + {$EXTERNALSYM RAND_status} + {$EXTERNALSYM RAND_query_egd_bytes} + {$EXTERNALSYM RAND_egd} + {$EXTERNALSYM RAND_egd_bytes} + {$EXTERNALSYM RAND_poll} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +var + RAND_set_rand_method: function (const meth: PRAND_METHOD): TIdC_INT; cdecl = nil; + RAND_get_rand_method: function : PRAND_METHOD; cdecl = nil; + RAND_set_rand_engine: function (engine: PENGINE): TIdC_INT; cdecl = nil; + + RAND_OpenSSL: function : PRAND_METHOD; cdecl = nil; + + RAND_bytes: function (buf: PByte; num: TIdC_INT): TIdC_INT; cdecl = nil; + RAND_priv_bytes: function (buf: PByte; num: TIdC_INT): TIdC_INT; cdecl = nil; + + RAND_seed: procedure (const buf: Pointer; num: TIdC_INT); cdecl = nil; + RAND_keep_random_devices_open: procedure (keep: TIdC_INT); cdecl = nil; + + RAND_add: procedure (const buf: Pointer; num: TIdC_INT; randomness: TIdC_DOUBLE); cdecl = nil; + RAND_load_file: function (const file_: PIdAnsiChar; max_bytes: TIdC_LONG): TIdC_INT; cdecl = nil; + RAND_write_file: function (const file_: PIdAnsiChar): TIdC_INT; cdecl = nil; + RAND_status: function : TIdC_INT; cdecl = nil; + + RAND_query_egd_bytes: function (const path: PIdAnsiChar; buf: PByte; bytes: TIdC_INT): TIdC_INT; cdecl = nil; + RAND_egd: function (const path: PIdAnsiChar): TIdC_INT; cdecl = nil; + RAND_egd_bytes: function (const path: PIdAnsiChar; bytes: TIdC_INT): TIdC_INT; cdecl = nil; + + RAND_poll: function : TIdC_INT; cdecl = nil; + +{$ELSE} + function RAND_set_rand_method(const meth: PRAND_METHOD): TIdC_INT cdecl; external CLibCrypto; + function RAND_get_rand_method: PRAND_METHOD cdecl; external CLibCrypto; + function RAND_set_rand_engine(engine: PENGINE): TIdC_INT cdecl; external CLibCrypto; + + function RAND_OpenSSL: PRAND_METHOD cdecl; external CLibCrypto; + + function RAND_bytes(buf: PByte; num: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function RAND_priv_bytes(buf: PByte; num: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + + procedure RAND_seed(const buf: Pointer; num: TIdC_INT) cdecl; external CLibCrypto; + procedure RAND_keep_random_devices_open(keep: TIdC_INT) cdecl; external CLibCrypto; + + procedure RAND_add(const buf: Pointer; num: TIdC_INT; randomness: TIdC_DOUBLE) cdecl; external CLibCrypto; + function RAND_load_file(const file_: PIdAnsiChar; max_bytes: TIdC_LONG): TIdC_INT cdecl; external CLibCrypto; + function RAND_write_file(const file_: PIdAnsiChar): TIdC_INT cdecl; external CLibCrypto; + function RAND_status: TIdC_INT cdecl; external CLibCrypto; + + function RAND_query_egd_bytes(const path: PIdAnsiChar; buf: PByte; bytes: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function RAND_egd(const path: PIdAnsiChar): TIdC_INT cdecl; external CLibCrypto; + function RAND_egd_bytes(const path: PIdAnsiChar; bytes: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + + function RAND_poll: TIdC_INT cdecl; external CLibCrypto; + +{$ENDIF} + +implementation + + uses + classes, + IdSSLOpenSSLExceptionHandlers, + IdResourceStringsOpenSSL + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + ,IdSSLOpenSSLLoader + {$ENDIF}; + + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +const + RAND_set_rand_method_procname = 'RAND_set_rand_method'; + RAND_get_rand_method_procname = 'RAND_get_rand_method'; + RAND_set_rand_engine_procname = 'RAND_set_rand_engine'; + + RAND_OpenSSL_procname = 'RAND_OpenSSL'; + + RAND_bytes_procname = 'RAND_bytes'; + RAND_priv_bytes_procname = 'RAND_priv_bytes'; + + RAND_seed_procname = 'RAND_seed'; + RAND_keep_random_devices_open_procname = 'RAND_keep_random_devices_open'; + + RAND_add_procname = 'RAND_add'; + RAND_load_file_procname = 'RAND_load_file'; + RAND_write_file_procname = 'RAND_write_file'; + RAND_status_procname = 'RAND_status'; + + RAND_query_egd_bytes_procname = 'RAND_query_egd_bytes'; + RAND_egd_procname = 'RAND_egd'; + RAND_egd_bytes_procname = 'RAND_egd_bytes'; + + RAND_poll_procname = 'RAND_poll'; + + +{$WARN NO_RETVAL OFF} +function ERR_RAND_set_rand_method(const meth: PRAND_METHOD): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(RAND_set_rand_method_procname); +end; + + +function ERR_RAND_get_rand_method: PRAND_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(RAND_get_rand_method_procname); +end; + + +function ERR_RAND_set_rand_engine(engine: PENGINE): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(RAND_set_rand_engine_procname); +end; + + + +function ERR_RAND_OpenSSL: PRAND_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(RAND_OpenSSL_procname); +end; + + + +function ERR_RAND_bytes(buf: PByte; num: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(RAND_bytes_procname); +end; + + +function ERR_RAND_priv_bytes(buf: PByte; num: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(RAND_priv_bytes_procname); +end; + + + +procedure ERR_RAND_seed(const buf: Pointer; num: TIdC_INT); +begin + EIdAPIFunctionNotPresent.RaiseException(RAND_seed_procname); +end; + + +procedure ERR_RAND_keep_random_devices_open(keep: TIdC_INT); +begin + EIdAPIFunctionNotPresent.RaiseException(RAND_keep_random_devices_open_procname); +end; + + + +procedure ERR_RAND_add(const buf: Pointer; num: TIdC_INT; randomness: TIdC_DOUBLE); +begin + EIdAPIFunctionNotPresent.RaiseException(RAND_add_procname); +end; + + +function ERR_RAND_load_file(const file_: PIdAnsiChar; max_bytes: TIdC_LONG): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(RAND_load_file_procname); +end; + + +function ERR_RAND_write_file(const file_: PIdAnsiChar): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(RAND_write_file_procname); +end; + + +function ERR_RAND_status: TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(RAND_status_procname); +end; + + + +function ERR_RAND_query_egd_bytes(const path: PIdAnsiChar; buf: PByte; bytes: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(RAND_query_egd_bytes_procname); +end; + + +function ERR_RAND_egd(const path: PIdAnsiChar): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(RAND_egd_procname); +end; + + +function ERR_RAND_egd_bytes(const path: PIdAnsiChar; bytes: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(RAND_egd_bytes_procname); +end; + + + +function ERR_RAND_poll: TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(RAND_poll_procname); +end; + + + +{$WARN NO_RETVAL ON} + +procedure Load(const ADllHandle: TIdLibHandle; LibVersion: TIdC_UINT; const AFailed: TStringList); + +var FuncLoadError: boolean; + +begin + RAND_set_rand_method := LoadLibFunction(ADllHandle, RAND_set_rand_method_procname); + FuncLoadError := not assigned(RAND_set_rand_method); + if FuncLoadError then + begin + {$if not defined(RAND_set_rand_method_allownil)} + RAND_set_rand_method := @ERR_RAND_set_rand_method; + {$ifend} + {$if declared(RAND_set_rand_method_introduced)} + if LibVersion < RAND_set_rand_method_introduced then + begin + {$if declared(FC_RAND_set_rand_method)} + RAND_set_rand_method := @FC_RAND_set_rand_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RAND_set_rand_method_removed)} + if RAND_set_rand_method_removed <= LibVersion then + begin + {$if declared(_RAND_set_rand_method)} + RAND_set_rand_method := @_RAND_set_rand_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RAND_set_rand_method_allownil)} + if FuncLoadError then + AFailed.Add('RAND_set_rand_method'); + {$ifend} + end; + + + RAND_get_rand_method := LoadLibFunction(ADllHandle, RAND_get_rand_method_procname); + FuncLoadError := not assigned(RAND_get_rand_method); + if FuncLoadError then + begin + {$if not defined(RAND_get_rand_method_allownil)} + RAND_get_rand_method := @ERR_RAND_get_rand_method; + {$ifend} + {$if declared(RAND_get_rand_method_introduced)} + if LibVersion < RAND_get_rand_method_introduced then + begin + {$if declared(FC_RAND_get_rand_method)} + RAND_get_rand_method := @FC_RAND_get_rand_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RAND_get_rand_method_removed)} + if RAND_get_rand_method_removed <= LibVersion then + begin + {$if declared(_RAND_get_rand_method)} + RAND_get_rand_method := @_RAND_get_rand_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RAND_get_rand_method_allownil)} + if FuncLoadError then + AFailed.Add('RAND_get_rand_method'); + {$ifend} + end; + + + RAND_set_rand_engine := LoadLibFunction(ADllHandle, RAND_set_rand_engine_procname); + FuncLoadError := not assigned(RAND_set_rand_engine); + if FuncLoadError then + begin + {$if not defined(RAND_set_rand_engine_allownil)} + RAND_set_rand_engine := @ERR_RAND_set_rand_engine; + {$ifend} + {$if declared(RAND_set_rand_engine_introduced)} + if LibVersion < RAND_set_rand_engine_introduced then + begin + {$if declared(FC_RAND_set_rand_engine)} + RAND_set_rand_engine := @FC_RAND_set_rand_engine; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RAND_set_rand_engine_removed)} + if RAND_set_rand_engine_removed <= LibVersion then + begin + {$if declared(_RAND_set_rand_engine)} + RAND_set_rand_engine := @_RAND_set_rand_engine; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RAND_set_rand_engine_allownil)} + if FuncLoadError then + AFailed.Add('RAND_set_rand_engine'); + {$ifend} + end; + + + RAND_OpenSSL := LoadLibFunction(ADllHandle, RAND_OpenSSL_procname); + FuncLoadError := not assigned(RAND_OpenSSL); + if FuncLoadError then + begin + {$if not defined(RAND_OpenSSL_allownil)} + RAND_OpenSSL := @ERR_RAND_OpenSSL; + {$ifend} + {$if declared(RAND_OpenSSL_introduced)} + if LibVersion < RAND_OpenSSL_introduced then + begin + {$if declared(FC_RAND_OpenSSL)} + RAND_OpenSSL := @FC_RAND_OpenSSL; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RAND_OpenSSL_removed)} + if RAND_OpenSSL_removed <= LibVersion then + begin + {$if declared(_RAND_OpenSSL)} + RAND_OpenSSL := @_RAND_OpenSSL; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RAND_OpenSSL_allownil)} + if FuncLoadError then + AFailed.Add('RAND_OpenSSL'); + {$ifend} + end; + + + RAND_bytes := LoadLibFunction(ADllHandle, RAND_bytes_procname); + FuncLoadError := not assigned(RAND_bytes); + if FuncLoadError then + begin + {$if not defined(RAND_bytes_allownil)} + RAND_bytes := @ERR_RAND_bytes; + {$ifend} + {$if declared(RAND_bytes_introduced)} + if LibVersion < RAND_bytes_introduced then + begin + {$if declared(FC_RAND_bytes)} + RAND_bytes := @FC_RAND_bytes; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RAND_bytes_removed)} + if RAND_bytes_removed <= LibVersion then + begin + {$if declared(_RAND_bytes)} + RAND_bytes := @_RAND_bytes; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RAND_bytes_allownil)} + if FuncLoadError then + AFailed.Add('RAND_bytes'); + {$ifend} + end; + + + RAND_priv_bytes := LoadLibFunction(ADllHandle, RAND_priv_bytes_procname); + FuncLoadError := not assigned(RAND_priv_bytes); + if FuncLoadError then + begin + {$if not defined(RAND_priv_bytes_allownil)} + RAND_priv_bytes := @ERR_RAND_priv_bytes; + {$ifend} + {$if declared(RAND_priv_bytes_introduced)} + if LibVersion < RAND_priv_bytes_introduced then + begin + {$if declared(FC_RAND_priv_bytes)} + RAND_priv_bytes := @FC_RAND_priv_bytes; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RAND_priv_bytes_removed)} + if RAND_priv_bytes_removed <= LibVersion then + begin + {$if declared(_RAND_priv_bytes)} + RAND_priv_bytes := @_RAND_priv_bytes; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RAND_priv_bytes_allownil)} + if FuncLoadError then + AFailed.Add('RAND_priv_bytes'); + {$ifend} + end; + + + RAND_seed := LoadLibFunction(ADllHandle, RAND_seed_procname); + FuncLoadError := not assigned(RAND_seed); + if FuncLoadError then + begin + {$if not defined(RAND_seed_allownil)} + RAND_seed := @ERR_RAND_seed; + {$ifend} + {$if declared(RAND_seed_introduced)} + if LibVersion < RAND_seed_introduced then + begin + {$if declared(FC_RAND_seed)} + RAND_seed := @FC_RAND_seed; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RAND_seed_removed)} + if RAND_seed_removed <= LibVersion then + begin + {$if declared(_RAND_seed)} + RAND_seed := @_RAND_seed; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RAND_seed_allownil)} + if FuncLoadError then + AFailed.Add('RAND_seed'); + {$ifend} + end; + + + RAND_keep_random_devices_open := LoadLibFunction(ADllHandle, RAND_keep_random_devices_open_procname); + FuncLoadError := not assigned(RAND_keep_random_devices_open); + if FuncLoadError then + begin + {$if not defined(RAND_keep_random_devices_open_allownil)} + RAND_keep_random_devices_open := @ERR_RAND_keep_random_devices_open; + {$ifend} + {$if declared(RAND_keep_random_devices_open_introduced)} + if LibVersion < RAND_keep_random_devices_open_introduced then + begin + {$if declared(FC_RAND_keep_random_devices_open)} + RAND_keep_random_devices_open := @FC_RAND_keep_random_devices_open; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RAND_keep_random_devices_open_removed)} + if RAND_keep_random_devices_open_removed <= LibVersion then + begin + {$if declared(_RAND_keep_random_devices_open)} + RAND_keep_random_devices_open := @_RAND_keep_random_devices_open; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RAND_keep_random_devices_open_allownil)} + if FuncLoadError then + AFailed.Add('RAND_keep_random_devices_open'); + {$ifend} + end; + + + RAND_add := LoadLibFunction(ADllHandle, RAND_add_procname); + FuncLoadError := not assigned(RAND_add); + if FuncLoadError then + begin + {$if not defined(RAND_add_allownil)} + RAND_add := @ERR_RAND_add; + {$ifend} + {$if declared(RAND_add_introduced)} + if LibVersion < RAND_add_introduced then + begin + {$if declared(FC_RAND_add)} + RAND_add := @FC_RAND_add; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RAND_add_removed)} + if RAND_add_removed <= LibVersion then + begin + {$if declared(_RAND_add)} + RAND_add := @_RAND_add; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RAND_add_allownil)} + if FuncLoadError then + AFailed.Add('RAND_add'); + {$ifend} + end; + + + RAND_load_file := LoadLibFunction(ADllHandle, RAND_load_file_procname); + FuncLoadError := not assigned(RAND_load_file); + if FuncLoadError then + begin + {$if not defined(RAND_load_file_allownil)} + RAND_load_file := @ERR_RAND_load_file; + {$ifend} + {$if declared(RAND_load_file_introduced)} + if LibVersion < RAND_load_file_introduced then + begin + {$if declared(FC_RAND_load_file)} + RAND_load_file := @FC_RAND_load_file; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RAND_load_file_removed)} + if RAND_load_file_removed <= LibVersion then + begin + {$if declared(_RAND_load_file)} + RAND_load_file := @_RAND_load_file; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RAND_load_file_allownil)} + if FuncLoadError then + AFailed.Add('RAND_load_file'); + {$ifend} + end; + + + RAND_write_file := LoadLibFunction(ADllHandle, RAND_write_file_procname); + FuncLoadError := not assigned(RAND_write_file); + if FuncLoadError then + begin + {$if not defined(RAND_write_file_allownil)} + RAND_write_file := @ERR_RAND_write_file; + {$ifend} + {$if declared(RAND_write_file_introduced)} + if LibVersion < RAND_write_file_introduced then + begin + {$if declared(FC_RAND_write_file)} + RAND_write_file := @FC_RAND_write_file; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RAND_write_file_removed)} + if RAND_write_file_removed <= LibVersion then + begin + {$if declared(_RAND_write_file)} + RAND_write_file := @_RAND_write_file; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RAND_write_file_allownil)} + if FuncLoadError then + AFailed.Add('RAND_write_file'); + {$ifend} + end; + + + RAND_status := LoadLibFunction(ADllHandle, RAND_status_procname); + FuncLoadError := not assigned(RAND_status); + if FuncLoadError then + begin + {$if not defined(RAND_status_allownil)} + RAND_status := @ERR_RAND_status; + {$ifend} + {$if declared(RAND_status_introduced)} + if LibVersion < RAND_status_introduced then + begin + {$if declared(FC_RAND_status)} + RAND_status := @FC_RAND_status; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RAND_status_removed)} + if RAND_status_removed <= LibVersion then + begin + {$if declared(_RAND_status)} + RAND_status := @_RAND_status; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RAND_status_allownil)} + if FuncLoadError then + AFailed.Add('RAND_status'); + {$ifend} + end; + + + RAND_query_egd_bytes := LoadLibFunction(ADllHandle, RAND_query_egd_bytes_procname); + FuncLoadError := not assigned(RAND_query_egd_bytes); + if FuncLoadError then + begin + {$if not defined(RAND_query_egd_bytes_allownil)} + RAND_query_egd_bytes := @ERR_RAND_query_egd_bytes; + {$ifend} + {$if declared(RAND_query_egd_bytes_introduced)} + if LibVersion < RAND_query_egd_bytes_introduced then + begin + {$if declared(FC_RAND_query_egd_bytes)} + RAND_query_egd_bytes := @FC_RAND_query_egd_bytes; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RAND_query_egd_bytes_removed)} + if RAND_query_egd_bytes_removed <= LibVersion then + begin + {$if declared(_RAND_query_egd_bytes)} + RAND_query_egd_bytes := @_RAND_query_egd_bytes; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RAND_query_egd_bytes_allownil)} + if FuncLoadError then + AFailed.Add('RAND_query_egd_bytes'); + {$ifend} + end; + + + RAND_egd := LoadLibFunction(ADllHandle, RAND_egd_procname); + FuncLoadError := not assigned(RAND_egd); + if FuncLoadError then + begin + {$if not defined(RAND_egd_allownil)} + RAND_egd := @ERR_RAND_egd; + {$ifend} + {$if declared(RAND_egd_introduced)} + if LibVersion < RAND_egd_introduced then + begin + {$if declared(FC_RAND_egd)} + RAND_egd := @FC_RAND_egd; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RAND_egd_removed)} + if RAND_egd_removed <= LibVersion then + begin + {$if declared(_RAND_egd)} + RAND_egd := @_RAND_egd; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RAND_egd_allownil)} + if FuncLoadError then + AFailed.Add('RAND_egd'); + {$ifend} + end; + + + RAND_egd_bytes := LoadLibFunction(ADllHandle, RAND_egd_bytes_procname); + FuncLoadError := not assigned(RAND_egd_bytes); + if FuncLoadError then + begin + {$if not defined(RAND_egd_bytes_allownil)} + RAND_egd_bytes := @ERR_RAND_egd_bytes; + {$ifend} + {$if declared(RAND_egd_bytes_introduced)} + if LibVersion < RAND_egd_bytes_introduced then + begin + {$if declared(FC_RAND_egd_bytes)} + RAND_egd_bytes := @FC_RAND_egd_bytes; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RAND_egd_bytes_removed)} + if RAND_egd_bytes_removed <= LibVersion then + begin + {$if declared(_RAND_egd_bytes)} + RAND_egd_bytes := @_RAND_egd_bytes; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RAND_egd_bytes_allownil)} + if FuncLoadError then + AFailed.Add('RAND_egd_bytes'); + {$ifend} + end; + + + RAND_poll := LoadLibFunction(ADllHandle, RAND_poll_procname); + FuncLoadError := not assigned(RAND_poll); + if FuncLoadError then + begin + {$if not defined(RAND_poll_allownil)} + RAND_poll := @ERR_RAND_poll; + {$ifend} + {$if declared(RAND_poll_introduced)} + if LibVersion < RAND_poll_introduced then + begin + {$if declared(FC_RAND_poll)} + RAND_poll := @FC_RAND_poll; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RAND_poll_removed)} + if RAND_poll_removed <= LibVersion then + begin + {$if declared(_RAND_poll)} + RAND_poll := @_RAND_poll; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RAND_poll_allownil)} + if FuncLoadError then + AFailed.Add('RAND_poll'); + {$ifend} + end; + + +end; + +procedure Unload; +begin + RAND_set_rand_method := nil; + RAND_get_rand_method := nil; + RAND_set_rand_engine := nil; + RAND_OpenSSL := nil; + RAND_bytes := nil; + RAND_priv_bytes := nil; + RAND_seed := nil; + RAND_keep_random_devices_open := nil; + RAND_add := nil; + RAND_load_file := nil; + RAND_write_file := nil; + RAND_status := nil; + RAND_query_egd_bytes := nil; + RAND_egd := nil; + RAND_egd_bytes := nil; + RAND_poll := nil; +end; +{$ELSE} +{$ENDIF} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +initialization + Register_SSLLoader(@Load,'LibCrypto'); + Register_SSLUnloader(@Unload); +{$ENDIF} +end. diff --git a/IdOpenSSLHeaders_randerr.pas b/IdOpenSSLHeaders_randerr.pas new file mode 100644 index 0000000..d8ed1b4 --- /dev/null +++ b/IdOpenSSLHeaders_randerr.pas @@ -0,0 +1,211 @@ + (* This unit was generated using the script genOpenSSLHdrs.sh from the source file IdOpenSSLHeaders_randerr.h2pas + It should not be modified directly. All changes should be made to IdOpenSSLHeaders_randerr.h2pas + and this file regenerated. IdOpenSSLHeaders_randerr.h2pas is distributed with the full Indy + Distribution. + *) + +{$i IdCompilerDefines.inc} +{$i IdSSLOpenSSLDefines.inc} +{$IFNDEF USE_OPENSSL} + { error Should not compile if USE_OPENSSL is not defined!!!} +{$ENDIF} +{******************************************************************************} +{ } +{ Indy (Internet Direct) - Internet Protocols Simplified } +{ } +{ https://www.indyproject.org/ } +{ https://gitter.im/IndySockets/Indy } +{ } +{******************************************************************************} +{ } +{ This file is part of the Indy (Internet Direct) project, and is offered } +{ under the dual-licensing agreement described on the Indy website. } +{ (https://www.indyproject.org/license/) } +{ } +{ Copyright: } +{ (c) 1993-2020, Chad Z. Hower and the Indy Pit Crew. All rights reserved. } +{ } +{******************************************************************************} +{ } +{ } +{******************************************************************************} + +unit IdOpenSSLHeaders_randerr; + +interface + +// Headers for OpenSSL 1.1.1 +// randerr.h + + +uses + IdCTypes, + IdGlobal, + IdSSLOpenSSLConsts; + +const + (* + * RAND function codes. + *) + RAND_F_DRBG_BYTES = 101; + RAND_F_DRBG_GET_ENTROPY = 105; + RAND_F_DRBG_SETUP = 117; + RAND_F_GET_ENTROPY = 106; + RAND_F_RAND_BYTES = 100; + RAND_F_RAND_DRBG_ENABLE_LOCKING = 119; + RAND_F_RAND_DRBG_GENERATE = 107; + RAND_F_RAND_DRBG_GET_ENTROPY = 120; + RAND_F_RAND_DRBG_GET_NONCE = 123; + RAND_F_RAND_DRBG_INSTANTIATE = 108; + RAND_F_RAND_DRBG_NEW = 109; + RAND_F_RAND_DRBG_RESEED = 110; + RAND_F_RAND_DRBG_RESTART = 102; + RAND_F_RAND_DRBG_SET = 104; + RAND_F_RAND_DRBG_SET_DEFAULTS = 121; + RAND_F_RAND_DRBG_UNINSTANTIATE = 118; + RAND_F_RAND_LOAD_FILE = 111; + RAND_F_RAND_POOL_ACQUIRE_ENTROPY = 122; + RAND_F_RAND_POOL_ADD = 103; + RAND_F_RAND_POOL_ADD_BEGIN = 113; + RAND_F_RAND_POOL_ADD_END = 114; + RAND_F_RAND_POOL_ATTACH = 124; + RAND_F_RAND_POOL_BYTES_NEEDED = 115; + RAND_F_RAND_POOL_GROW = 125; + RAND_F_RAND_POOL_NEW = 116; + RAND_F_RAND_WRITE_FILE = 112; + + (* + * RAND reason codes. + *) + RAND_R_ADDITIONAL_INPUT_TOO_LONG = 102; + RAND_R_ALREADY_INSTANTIATED = 103; + RAND_R_ARGUMENT_OUT_OF_RANGE = 105; + RAND_R_CANNOT_OPEN_FILE = 121; + RAND_R_DRBG_ALREADY_INITIALIZED = 129; + RAND_R_DRBG_NOT_INITIALISED = 104; + RAND_R_ENTROPY_INPUT_TOO_LONG = 106; + RAND_R_ENTROPY_OUT_OF_RANGE = 124; + RAND_R_ERROR_ENTROPY_POOL_WAS_IGNORED = 127; + RAND_R_ERROR_INITIALISING_DRBG = 107; + RAND_R_ERROR_INSTANTIATING_DRBG = 108; + RAND_R_ERROR_RETRIEVING_ADDITIONAL_INPUT = 109; + RAND_R_ERROR_RETRIEVING_ENTROPY = 110; + RAND_R_ERROR_RETRIEVING_NONCE = 111; + RAND_R_FAILED_TO_CREATE_LOCK = 126; + RAND_R_FUNC_NOT_IMPLEMENTED = 101; + RAND_R_FWRITE_ERROR = 123; + RAND_R_GENERATE_ERROR = 112; + RAND_R_INTERNAL_ERROR = 113; + RAND_R_IN_ERROR_STATE = 114; + RAND_R_NOT_A_REGULAR_FILE = 122; + RAND_R_NOT_INSTANTIATED = 115; + RAND_R_NO_DRBG_IMPLEMENTATION_SELECTED = 128; + RAND_R_PARENT_LOCKING_NOT_ENABLED = 130; + RAND_R_PARENT_STRENGTH_TOO_WEAK = 131; + RAND_R_PERSONALISATION_STRING_TOO_LONG = 116; + RAND_R_PREDICTION_RESISTANCE_NOT_SUPPORTED = 133; + RAND_R_PRNG_NOT_SEEDED = 100; + RAND_R_RANDOM_POOL_OVERFLOW = 125; + RAND_R_RANDOM_POOL_UNDERFLOW = 134; + RAND_R_REQUEST_TOO_LARGE_FOR_DRBG = 117; + RAND_R_RESEED_ERROR = 118; + RAND_R_SELFTEST_FAILURE = 119; + RAND_R_TOO_LITTLE_NONCE_REQUESTED = 135; + RAND_R_TOO_MUCH_NONCE_REQUESTED = 136; + RAND_R_UNSUPPORTED_DRBG_FLAGS = 132; + RAND_R_UNSUPPORTED_DRBG_TYPE = 120; + + { The EXTERNALSYM directive is ignored by FPC, however, it is used by Delphi as follows: + + The EXTERNALSYM directive prevents the specified Delphi symbol from appearing in header + files generated for C++. } + + {$EXTERNALSYM ERR_load_RAND_strings} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +var + ERR_load_RAND_strings: function : TIdC_INT; cdecl = nil; + +{$ELSE} + function ERR_load_RAND_strings: TIdC_INT cdecl; external CLibCrypto; + +{$ENDIF} + +implementation + + uses + classes, + IdSSLOpenSSLExceptionHandlers, + IdResourceStringsOpenSSL + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + ,IdSSLOpenSSLLoader + {$ENDIF}; + + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +const + ERR_load_RAND_strings_procname = 'ERR_load_RAND_strings'; + + +{$WARN NO_RETVAL OFF} +function ERR_ERR_load_RAND_strings: TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ERR_load_RAND_strings_procname); +end; + + + +{$WARN NO_RETVAL ON} + +procedure Load(const ADllHandle: TIdLibHandle; LibVersion: TIdC_UINT; const AFailed: TStringList); + +var FuncLoadError: boolean; + +begin + ERR_load_RAND_strings := LoadLibFunction(ADllHandle, ERR_load_RAND_strings_procname); + FuncLoadError := not assigned(ERR_load_RAND_strings); + if FuncLoadError then + begin + {$if not defined(ERR_load_RAND_strings_allownil)} + ERR_load_RAND_strings := @ERR_ERR_load_RAND_strings; + {$ifend} + {$if declared(ERR_load_RAND_strings_introduced)} + if LibVersion < ERR_load_RAND_strings_introduced then + begin + {$if declared(FC_ERR_load_RAND_strings)} + ERR_load_RAND_strings := @FC_ERR_load_RAND_strings; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ERR_load_RAND_strings_removed)} + if ERR_load_RAND_strings_removed <= LibVersion then + begin + {$if declared(_ERR_load_RAND_strings)} + ERR_load_RAND_strings := @_ERR_load_RAND_strings; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ERR_load_RAND_strings_allownil)} + if FuncLoadError then + AFailed.Add('ERR_load_RAND_strings'); + {$ifend} + end; + + +end; + +procedure Unload; +begin + ERR_load_RAND_strings := nil; +end; +{$ELSE} +{$ENDIF} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +initialization + Register_SSLLoader(@Load,'LibCrypto'); + Register_SSLUnloader(@Unload); +{$ENDIF} +end. diff --git a/IdOpenSSLHeaders_rc4.pas b/IdOpenSSLHeaders_rc4.pas new file mode 100644 index 0000000..a39183a --- /dev/null +++ b/IdOpenSSLHeaders_rc4.pas @@ -0,0 +1,348 @@ + (* This unit was generated using the script genOpenSSLHdrs.sh from the source file IdOpenSSLHeaders_rc4.h2pas + It should not be modified directly. All changes should be made to IdOpenSSLHeaders_rc4.h2pas + and this file regenerated. IdOpenSSLHeaders_rc4.h2pas is distributed with the full Indy + Distribution. + *) + +{$i IdCompilerDefines.inc} +{$i IdSSLOpenSSLDefines.inc} +{$IFNDEF USE_OPENSSL} + { error Should not compile if USE_OPENSSL is not defined!!!} +{$ENDIF} +{******************************************************************************} +{ } +{ Indy (Internet Direct) - Internet Protocols Simplified } +{ } +{ https://www.indyproject.org/ } +{ https://gitter.im/IndySockets/Indy } +{ } +{******************************************************************************} +{ } +{ This file is part of the Indy (Internet Direct) project, and is offered } +{ under the dual-licensing agreement described on the Indy website. } +{ (https://www.indyproject.org/license/) } +{ } +{ Copyright: } +{ (c) 1993-2020, Chad Z. Hower and the Indy Pit Crew. All rights reserved. } +{ } +{******************************************************************************} +{ } +{ } +{******************************************************************************} +unit IdOpenSSLHeaders_rc4; + +interface + +{ + Automatically converted by H2Pas 1.0.0 from rc4.h + The following command line parameters were used: + rc4.h +} + +uses + IdCTypes, + IdGlobal; + +{$IFDEF FPC} +{$PACKRECORDS C} +{$ENDIF} + + + { crypto/rc4/rc4.h } + { Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + } + + type + PRC4_KEY = ^RC4_KEY; + RC4_INT = TIdC_UINT; + rc4_key_st = record + x : RC4_INT; + y : RC4_INT; + data : array[0..255] of RC4_INT; + end; + RC4_KEY = rc4_key_st; + + { The EXTERNALSYM directive is ignored by FPC, however, it is used by Delphi as follows: + + The EXTERNALSYM directive prevents the specified Delphi symbol from appearing in header + files generated for C++. } + + {$EXTERNALSYM RC4_options} {allow_nil} + {$EXTERNALSYM RC4_set_key} {allow_nil} + {$EXTERNALSYM private_RC4_set_key} {allow_nil} + {$EXTERNALSYM RC4} {allow_nil} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +var + RC4_options: function : PIdAnsiChar; cdecl = nil; {allow_nil} + RC4_set_key: procedure (key:PRC4_KEY; len: TIdC_LONG; const data:Pbyte); cdecl = nil; {allow_nil} + private_RC4_set_key: procedure (key:PRC4_KEY; len: TIdC_LONG; const data:Pbyte); cdecl = nil; {allow_nil} + RC4: procedure (key:PRC4_KEY; len: TIdC_SIZET; const indata: Pbyte; outdata: Pbyte); cdecl = nil; {allow_nil} + +{$ELSE} +{interface_body} +{$IFNDEF OPENSSL_NO_RC4} + function RC4_options: PIdAnsiChar cdecl; external CLibCrypto; + procedure RC4_set_key(key:PRC4_KEY; len: TIdC_LONG; const data:Pbyte) cdecl; external CLibCrypto; + procedure private_RC4_set_key(key:PRC4_KEY; len: TIdC_LONG; const data:Pbyte) cdecl; external CLibCrypto; + procedure RC4(key:PRC4_KEY; len: TIdC_SIZET; const indata: Pbyte; outdata: Pbyte) cdecl; external CLibCrypto; +{$ENDIF} + +{$ENDIF} + +implementation + + uses + classes, + IdSSLOpenSSLExceptionHandlers, + IdResourceStringsOpenSSL + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + ,IdSSLOpenSSLLoader + {$ENDIF}; + + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +const + RC4_options_procname = 'RC4_options'; {allow_nil} + RC4_set_key_procname = 'RC4_set_key'; {allow_nil} + private_RC4_set_key_procname = 'private_RC4_set_key'; {allow_nil} + RC4_procname = 'RC4'; {allow_nil} + +{$DEFINE RC4_options_allownil} {allow_nil} +{$DEFINE RC4_set_key_allownil} {allow_nil} +{$DEFINE private_RC4_set_key_allownil} {allow_nil} +{$DEFINE RC4_allownil} {allow_nil} + +{$WARN NO_RETVAL OFF} +function ERR_RC4_options: PIdAnsiChar; +begin + EIdAPIFunctionNotPresent.RaiseException(RC4_options_procname); +end; + + {allow_nil} +procedure ERR_RC4_set_key(key:PRC4_KEY; len: TIdC_LONG; const data:Pbyte); +begin + EIdAPIFunctionNotPresent.RaiseException(RC4_set_key_procname); +end; + + {allow_nil} +procedure ERR_private_RC4_set_key(key:PRC4_KEY; len: TIdC_LONG; const data:Pbyte); +begin + EIdAPIFunctionNotPresent.RaiseException(private_RC4_set_key_procname); +end; + + {allow_nil} +procedure ERR_RC4(key:PRC4_KEY; len: TIdC_SIZET; const indata: Pbyte; outdata: Pbyte); +begin + EIdAPIFunctionNotPresent.RaiseException(RC4_procname); +end; + + {allow_nil} + +{$WARN NO_RETVAL ON} + +procedure Load(const ADllHandle: TIdLibHandle; LibVersion: TIdC_UINT; const AFailed: TStringList); + +var FuncLoadError: boolean; + +begin + RC4_options := LoadLibFunction(ADllHandle, RC4_options_procname); + FuncLoadError := not assigned(RC4_options); + if FuncLoadError then + begin + {$if not defined(RC4_options_allownil)} + RC4_options := @ERR_RC4_options; + {$ifend} + {$if declared(RC4_options_introduced)} + if LibVersion < RC4_options_introduced then + begin + {$if declared(FC_RC4_options)} + RC4_options := @FC_RC4_options; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RC4_options_removed)} + if RC4_options_removed <= LibVersion then + begin + {$if declared(_RC4_options)} + RC4_options := @_RC4_options; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RC4_options_allownil)} + if FuncLoadError then + AFailed.Add('RC4_options'); + {$ifend} + end; + + {allow_nil} + RC4_set_key := LoadLibFunction(ADllHandle, RC4_set_key_procname); + FuncLoadError := not assigned(RC4_set_key); + if FuncLoadError then + begin + {$if not defined(RC4_set_key_allownil)} + RC4_set_key := @ERR_RC4_set_key; + {$ifend} + {$if declared(RC4_set_key_introduced)} + if LibVersion < RC4_set_key_introduced then + begin + {$if declared(FC_RC4_set_key)} + RC4_set_key := @FC_RC4_set_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RC4_set_key_removed)} + if RC4_set_key_removed <= LibVersion then + begin + {$if declared(_RC4_set_key)} + RC4_set_key := @_RC4_set_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RC4_set_key_allownil)} + if FuncLoadError then + AFailed.Add('RC4_set_key'); + {$ifend} + end; + + {allow_nil} + private_RC4_set_key := LoadLibFunction(ADllHandle, private_RC4_set_key_procname); + FuncLoadError := not assigned(private_RC4_set_key); + if FuncLoadError then + begin + {$if not defined(private_RC4_set_key_allownil)} + private_RC4_set_key := @ERR_private_RC4_set_key; + {$ifend} + {$if declared(private_RC4_set_key_introduced)} + if LibVersion < private_RC4_set_key_introduced then + begin + {$if declared(FC_private_RC4_set_key)} + private_RC4_set_key := @FC_private_RC4_set_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(private_RC4_set_key_removed)} + if private_RC4_set_key_removed <= LibVersion then + begin + {$if declared(_private_RC4_set_key)} + private_RC4_set_key := @_private_RC4_set_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(private_RC4_set_key_allownil)} + if FuncLoadError then + AFailed.Add('private_RC4_set_key'); + {$ifend} + end; + + {allow_nil} + RC4 := LoadLibFunction(ADllHandle, RC4_procname); + FuncLoadError := not assigned(RC4); + if FuncLoadError then + begin + {$if not defined(RC4_allownil)} + RC4 := @ERR_RC4; + {$ifend} + {$if declared(RC4_introduced)} + if LibVersion < RC4_introduced then + begin + {$if declared(FC_RC4)} + RC4 := @FC_RC4; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RC4_removed)} + if RC4_removed <= LibVersion then + begin + {$if declared(_RC4)} + RC4 := @_RC4; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RC4_allownil)} + if FuncLoadError then + AFailed.Add('RC4'); + {$ifend} + end; + + {allow_nil} +end; + +procedure Unload; +begin + RC4_options := nil; {allow_nil} + RC4_set_key := nil; {allow_nil} + private_RC4_set_key := nil; {allow_nil} + RC4 := nil; {allow_nil} +end; +{$ELSE} +{$ENDIF} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +initialization + Register_SSLLoader(@Load,'LibCrypto'); + Register_SSLUnloader(@Unload); +{$ENDIF} +end. diff --git a/IdOpenSSLHeaders_rsa.pas b/IdOpenSSLHeaders_rsa.pas new file mode 100644 index 0000000..ad09b56 --- /dev/null +++ b/IdOpenSSLHeaders_rsa.pas @@ -0,0 +1,4730 @@ + (* This unit was generated using the script genOpenSSLHdrs.sh from the source file IdOpenSSLHeaders_rsa.h2pas + It should not be modified directly. All changes should be made to IdOpenSSLHeaders_rsa.h2pas + and this file regenerated. IdOpenSSLHeaders_rsa.h2pas is distributed with the full Indy + Distribution. + *) + +{$i IdCompilerDefines.inc} +{$i IdSSLOpenSSLDefines.inc} +{$IFNDEF USE_OPENSSL} + { error Should not compile if USE_OPENSSL is not defined!!!} +{$ENDIF} +{******************************************************************************} +{ } +{ Indy (Internet Direct) - Internet Protocols Simplified } +{ } +{ https://www.indyproject.org/ } +{ https://gitter.im/IndySockets/Indy } +{ } +{******************************************************************************} +{ } +{ This file is part of the Indy (Internet Direct) project, and is offered } +{ under the dual-licensing agreement described on the Indy website. } +{ (https://www.indyproject.org/license/) } +{ } +{ Copyright: } +{ (c) 1993-2020, Chad Z. Hower and the Indy Pit Crew. All rights reserved. } +{ } +{******************************************************************************} +{ } +{ } +{******************************************************************************} + +unit IdOpenSSLHeaders_rsa; + +interface + +// Headers for OpenSSL 1.1.1 +// rsa.h + + +uses + IdCTypes, + IdGlobal, + IdSSLOpenSSLConsts, + IdOpenSSLHeaders_ossl_typ, + IdOpenSSLHeaders_evp; + +(* The types RSA and RSA_METHOD are defined in ossl_typ.h *) + +const + OPENSSL_RSA_MAX_MODULUS_BITS = 16384; + OPENSSL_RSA_FIPS_MIN_MODULUS_BITS = 1024; + OPENSSL_RSA_SMALL_MODULUS_BITS = 3072; + (* exponent limit enforced for "large" modulus only *) + OPENSSL_RSA_MAX_PUBEXP_BITS = 64; + + RSA_3 = TIdC_Long($3); + RSA_F4 = TIdC_Long($10001); + + (* based on RFC 8017 appendix A.1.2 *) + RSA_ASN1_VERSION_DEFAULT = 0; + RSA_ASN1_VERSION_MULTI = 1; + RSA_DEFAULT_PRIME_NUM = 2; + + RSA_METHOD_FLAG_NO_CHECK = $0001; (* don't check pub/private match *) + RSA_FLAG_CACHE_PUBLIC = $0002; + RSA_FLAG_CACHE_PRIVATE = $0004; + RSA_FLAG_BLINDING = $0008; + RSA_FLAG_THREAD_SAFE = $0010; + (* + * This flag means the private key operations will be handled by rsa_mod_exp + * and that they do not depend on the private key components being present: + * for example a key stored in external hardware. Without this flag + * bn_mod_exp gets called when private key components are absent. + *) + RSA_FLAG_EXT_PKEY = $0020; + (* + * new with 0.9.6j and 0.9.7b; the built-in + * RSA implementation now uses blinding by + * default (ignoring RSA_FLAG_BLINDING), + * but other engines might not need it + *) + RSA_FLAG_NO_BLINDING = $0080; + (* + * Does nothing. Previously this switched off constant time behaviour. + *) + RSA_FLAG_NO_CONSTTIME = $0000; + + (* Salt length matches digest *) + RSA_PSS_SALTLEN_DIGEST = -1; + (* Verify only: auto detect salt length *) + RSA_PSS_SALTLEN_AUTO = -2; + (* Set salt length to maximum possible *) + RSA_PSS_SALTLEN_MAX = -3; + (* Old compatible max salt length for sign only *) + RSA_PSS_SALTLEN_MAX_SIGN = -2; + + EVP_PKEY_CTRL_RSA_PADDING = EVP_PKEY_ALG_CTRL + 1; + EVP_PKEY_CTRL_RSA_PSS_SALTLEN = EVP_PKEY_ALG_CTRL + 2; + + EVP_PKEY_CTRL_RSA_KEYGEN_BITS = EVP_PKEY_ALG_CTRL + 3; + EVP_PKEY_CTRL_RSA_KEYGEN_PUBEXP = EVP_PKEY_ALG_CTRL + 4; + EVP_PKEY_CTRL_RSA_MGF1_MD = EVP_PKEY_ALG_CTRL + 5; + + EVP_PKEY_CTRL_GET_RSA_PADDING = EVP_PKEY_ALG_CTRL + 6; + EVP_PKEY_CTRL_GET_RSA_PSS_SALTLEN = EVP_PKEY_ALG_CTRL + 7; + EVP_PKEY_CTRL_GET_RSA_MGF1_MD = EVP_PKEY_ALG_CTRL + 8; + + EVP_PKEY_CTRL_RSA_OAEP_MD = EVP_PKEY_ALG_CTRL + 9; + EVP_PKEY_CTRL_RSA_OAEP_LABEL = EVP_PKEY_ALG_CTRL + 10; + + EVP_PKEY_CTRL_GET_RSA_OAEP_MD = EVP_PKEY_ALG_CTRL + 11; + EVP_PKEY_CTRL_GET_RSA_OAEP_LABEL = EVP_PKEY_ALG_CTRL + 12; + + EVP_PKEY_CTRL_RSA_KEYGEN_PRIMES = EVP_PKEY_ALG_CTRL + 13; + + RSA_PKCS1_PADDING = 1; + RSA_SSLV23_PADDING = 2; + RSA_NO_PADDING = 3; + RSA_PKCS1_OAEP_PADDING = 4; + RSA_X931_PADDING = 5; + RSA_PKCS1_PSS_PADDING = 6; (* EVP_PKEY_ only *) + RSA_PKCS1_PADDING_SIZE = 11; + + (* + * If this flag is set the RSA method is FIPS compliant and can be used in + * FIPS mode. This is set in the validated module method. If an application + * sets this flag in its own methods it is its responsibility to ensure the + * result is compliant. + *) + RSA_FLAG_FIPS_METHOD = $0400; + (* + * If this flag is set the operations normally disabled in FIPS mode are + * permitted it is then the applications responsibility to ensure that the + * usage is compliant. + *) + RSA_FLAG_NON_FIPS_ALLOW = $0400; + (* + * Application has decided PRNG is good enough to generate a key: don't + * check. + *) + RSA_FLAG_CHECKED = $0800; + +type + rsa_pss_params_st = record + hashAlgorithm: PX509_ALGOR; + maskGenAlgorithm: PX509_ALGOR; + saltLength: PASN1_INTEGER; + trailerField: PASN1_INTEGER; + (* Decoded hash algorithm from maskGenAlgorithm *) + maskHash: PX509_ALGOR; + end; + RSA_PSS_PARAMS = rsa_pss_params_st; + // DECLARE_ASN1_FUNCTIONS(RSA_PSS_PARAMS) + + rsa_oaep_params_st = record + hashFunc: PX509_ALGOR; + maskGenFunc: PX509_ALGOR; + pSourceFunc: PX509_ALGOR; + (* Decoded hash algorithm from maskGenFunc *) + maskHash: PX509_ALGOR; + end; + RSA_OAEP_PARAMS = rsa_oaep_params_st; + //DECLARE_ASN1_FUNCTIONS(RSA_OAEP_PARAMS) + + //DECLARE_ASN1_ENCODE_FUNCTIONS_const(RSA, RSAPublicKey) + //DECLARE_ASN1_ENCODE_FUNCTIONS_const(RSA, RSAPrivateKey) + + RSA_meth_set_priv_dec_priv_dec = function(flen: TIdC_INT; const from: PByte; + to_: PByte; rsa: PRSA; padding: TIdC_INT): TIdC_INT; cdecl; + + RSA_meth_set_mod_exp_mod_exp = function(r0: PBIGNUM; const i: PBIGNUM; + rsa: PRSA; ctx: PBN_CTX): TIdC_INT; cdecl; + + RSA_meth_set_bn_mod_exp_bn_mod_exp = function(r: PBIGNUM; const a: PBIGNUM; + const p: PBIGNUM; const m: PBIGNUM; ctx: PBN_CTx; m_ctx: PBN_MONT_CTx): TIdC_INT; cdecl; + + RSA_meth_set_init_init = function(rsa: PRSA): TIdC_INT; cdecl; + + RSA_meth_set_finish_finish = function(rsa: PRSA): TIdC_INT; cdecl; + + RSA_meth_set_sign_sign = function(type_: TIdC_INT; const m: PByte; + m_length: TIdC_UINT; sigret: PByte; siglen: PIdC_UINT; const rsa: PRSA): TIdC_INT; cdecl; + + RSA_meth_set_verify_verify = function(dtype: TIdC_INT; const m: PByte; + m_length: TIdC_UINT; const sigbuf: PByte; siglen: TIdC_UINT; const rsa: PRSA): TIdC_INT; cdecl; + + RSA_meth_set_keygen_keygen = function(rsa: PRSA; bits: TIdC_INT; e: PBIGNUM; cb: PBN_GENCb): TIdC_INT; cdecl; + + RSA_meth_set_multi_prime_keygen_keygen = function(rsa: PRSA; bits: TIdC_INT; + primes: TIdC_INT; e: PBIGNUM; cb: PBN_GENCb): TIdC_INT; cdecl; + +//# define EVP_PKEY_CTX_set_rsa_padding(ctx, pad) \ +// RSA_pkey_ctx_ctrl(ctx, -1, EVP_PKEY_CTRL_RSA_PADDING, pad, NULL) +// +//# define EVP_PKEY_CTX_get_rsa_padding(ctx, ppad) \ +// RSA_pkey_ctx_ctrl(ctx, -1, EVP_PKEY_CTRL_GET_RSA_PADDING, 0, ppad) +// +//# define EVP_PKEY_CTX_set_rsa_pss_saltlen(ctx, len) \ +// RSA_pkey_ctx_ctrl(ctx, (EVP_PKEY_OP_SIGN|EVP_PKEY_OP_VERIFY), \ +// EVP_PKEY_CTRL_RSA_PSS_SALTLEN, len, NULL) + +//# define EVP_PKEY_CTX_set_rsa_pss_keygen_saltlen(ctx, len) \ +// EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA_PSS, EVP_PKEY_OP_KEYGEN, \ +// EVP_PKEY_CTRL_RSA_PSS_SALTLEN, len, NULL) +// +//# define EVP_PKEY_CTX_get_rsa_pss_saltlen(ctx, plen) \ +// RSA_pkey_ctx_ctrl(ctx, (EVP_PKEY_OP_SIGN|EVP_PKEY_OP_VERIFY), \ +// EVP_PKEY_CTRL_GET_RSA_PSS_SALTLEN, 0, plen) +// +//# define EVP_PKEY_CTX_set_rsa_keygen_bits(ctx, bits) \ +// RSA_pkey_ctx_ctrl(ctx, EVP_PKEY_OP_KEYGEN, \ +// EVP_PKEY_CTRL_RSA_KEYGEN_BITS, bits, NULL) +// +//# define EVP_PKEY_CTX_set_rsa_keygen_pubexp(ctx, pubexp) \ +// RSA_pkey_ctx_ctrl(ctx, EVP_PKEY_OP_KEYGEN, \ +// EVP_PKEY_CTRL_RSA_KEYGEN_PUBEXP, 0, pubexp) +// +//# define EVP_PKEY_CTX_set_rsa_keygen_primes(ctx, primes) \ +// RSA_pkey_ctx_ctrl(ctx, EVP_PKEY_OP_KEYGEN, \ +// EVP_PKEY_CTRL_RSA_KEYGEN_PRIMES, primes, NULL) +// +//# define EVP_PKEY_CTX_set_rsa_mgf1_md(ctx, md) \ +// RSA_pkey_ctx_ctrl(ctx, EVP_PKEY_OP_TYPE_SIG | EVP_PKEY_OP_TYPE_CRYPT, \ +// EVP_PKEY_CTRL_RSA_MGF1_MD, 0, (void *)(md)) +// +//# define EVP_PKEY_CTX_set_rsa_pss_keygen_mgf1_md(ctx, md) \ +// EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA_PSS, EVP_PKEY_OP_KEYGEN, \ +// EVP_PKEY_CTRL_RSA_MGF1_MD, 0, (void *)(md)) +// +//# define EVP_PKEY_CTX_set_rsa_oaep_md(ctx, md) \ +// EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, EVP_PKEY_OP_TYPE_CRYPT, \ +// EVP_PKEY_CTRL_RSA_OAEP_MD, 0, (void *)(md)) +// +//# define EVP_PKEY_CTX_get_rsa_mgf1_md(ctx, pmd) \ +// RSA_pkey_ctx_ctrl(ctx, EVP_PKEY_OP_TYPE_SIG | EVP_PKEY_OP_TYPE_CRYPT, \ +// EVP_PKEY_CTRL_GET_RSA_MGF1_MD, 0, (void *)(pmd)) +// +//# define EVP_PKEY_CTX_get_rsa_oaep_md(ctx, pmd) \ +// EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, EVP_PKEY_OP_TYPE_CRYPT, \ +// EVP_PKEY_CTRL_GET_RSA_OAEP_MD, 0, (void *)(pmd)) +// +//# define EVP_PKEY_CTX_set0_rsa_oaep_label(ctx, l, llen) \ +// EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, EVP_PKEY_OP_TYPE_CRYPT, \ +// EVP_PKEY_CTRL_RSA_OAEP_LABEL, llen, (void *)(l)) +// +//# define EVP_PKEY_CTX_get0_rsa_oaep_label(ctx, l) \ +// EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, EVP_PKEY_OP_TYPE_CRYPT, \ +// EVP_PKEY_CTRL_GET_RSA_OAEP_LABEL, 0, (void *)(l)) +// +//# define EVP_PKEY_CTX_set_rsa_pss_keygen_md(ctx, md) \ +// EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA_PSS, \ +// EVP_PKEY_OP_KEYGEN, EVP_PKEY_CTRL_MD, \ +// 0, (void *)(md)) + +//# define RSA_set_app_data(s,arg) RSA_set_ex_data(s,0,arg) +//# define RSA_get_app_data(s) RSA_get_ex_data(s,0) + + { The EXTERNALSYM directive is ignored by FPC, however, it is used by Delphi as follows: + + The EXTERNALSYM directive prevents the specified Delphi symbol from appearing in header + files generated for C++. } + + {$EXTERNALSYM RSA_new} + {$EXTERNALSYM RSA_new_method} + {$EXTERNALSYM RSA_bits} + {$EXTERNALSYM RSA_size} + {$EXTERNALSYM RSA_security_bits} + {$EXTERNALSYM RSA_set0_key} + {$EXTERNALSYM RSA_set0_factors} + {$EXTERNALSYM RSA_set0_crt_params} + {$EXTERNALSYM RSA_get0_key} + {$EXTERNALSYM RSA_get0_factors} + {$EXTERNALSYM RSA_get_multi_prime_extra_count} + {$EXTERNALSYM RSA_get0_crt_params} + {$EXTERNALSYM RSA_get0_n} + {$EXTERNALSYM RSA_get0_e} + {$EXTERNALSYM RSA_get0_d} + {$EXTERNALSYM RSA_get0_p} + {$EXTERNALSYM RSA_get0_q} + {$EXTERNALSYM RSA_get0_dmp1} + {$EXTERNALSYM RSA_get0_dmq1} + {$EXTERNALSYM RSA_get0_iqmp} + {$EXTERNALSYM RSA_clear_flags} + {$EXTERNALSYM RSA_test_flags} + {$EXTERNALSYM RSA_set_flags} + {$EXTERNALSYM RSA_get_version} + {$EXTERNALSYM RSA_get0_engine} + {$EXTERNALSYM RSA_generate_key_ex} + {$EXTERNALSYM RSA_generate_multi_prime_key} + {$EXTERNALSYM RSA_X931_derive_ex} + {$EXTERNALSYM RSA_X931_generate_key_ex} + {$EXTERNALSYM RSA_check_key} + {$EXTERNALSYM RSA_check_key_ex} + {$EXTERNALSYM RSA_public_encrypt} + {$EXTERNALSYM RSA_private_encrypt} + {$EXTERNALSYM RSA_public_decrypt} + {$EXTERNALSYM RSA_private_decrypt} + {$EXTERNALSYM RSA_free} + {$EXTERNALSYM RSA_up_ref} + {$EXTERNALSYM RSA_flags} + {$EXTERNALSYM RSA_set_default_method} + {$EXTERNALSYM RSA_get_default_method} + {$EXTERNALSYM RSA_null_method} + {$EXTERNALSYM RSA_get_method} + {$EXTERNALSYM RSA_set_method} + {$EXTERNALSYM RSA_PKCS1_OpenSSL} + {$EXTERNALSYM RSA_pkey_ctx_ctrl} + {$EXTERNALSYM RSA_print} + {$EXTERNALSYM RSA_sign} + {$EXTERNALSYM RSA_verify} + {$EXTERNALSYM RSA_sign_ASN1_OCTET_STRING} + {$EXTERNALSYM RSA_verify_ASN1_OCTET_STRING} + {$EXTERNALSYM RSA_blinding_on} + {$EXTERNALSYM RSA_blinding_off} + {$EXTERNALSYM RSA_setup_blinding} + {$EXTERNALSYM RSA_padding_add_PKCS1_type_1} + {$EXTERNALSYM RSA_padding_check_PKCS1_type_1} + {$EXTERNALSYM RSA_padding_add_PKCS1_type_2} + {$EXTERNALSYM RSA_padding_check_PKCS1_type_2} + {$EXTERNALSYM PKCS1_MGF1} + {$EXTERNALSYM RSA_padding_add_PKCS1_OAEP} + {$EXTERNALSYM RSA_padding_check_PKCS1_OAEP} + {$EXTERNALSYM RSA_padding_add_PKCS1_OAEP_mgf1} + {$EXTERNALSYM RSA_padding_check_PKCS1_OAEP_mgf1} +// {$EXTERNALSYM RSA_padding_add_SSLv23} +// {$EXTERNALSYM RSA_padding_check_SSLv23} + {$EXTERNALSYM RSA_padding_add_none} + {$EXTERNALSYM RSA_padding_check_none} + {$EXTERNALSYM RSA_padding_add_X931} + {$EXTERNALSYM RSA_padding_check_X931} + {$EXTERNALSYM RSA_X931_hash_id} + {$EXTERNALSYM RSA_verify_PKCS1_PSS} + {$EXTERNALSYM RSA_padding_add_PKCS1_PSS} + {$EXTERNALSYM RSA_verify_PKCS1_PSS_mgf1} + {$EXTERNALSYM RSA_padding_add_PKCS1_PSS_mgf1} + {$EXTERNALSYM RSA_set_ex_data} + {$EXTERNALSYM RSA_get_ex_data} + {$EXTERNALSYM RSAPublicKey_dup} + {$EXTERNALSYM RSAPrivateKey_dup} + {$EXTERNALSYM RSA_meth_new} + {$EXTERNALSYM RSA_meth_free} + {$EXTERNALSYM RSA_meth_dup} + {$EXTERNALSYM RSA_meth_get0_name} + {$EXTERNALSYM RSA_meth_set1_name} + {$EXTERNALSYM RSA_meth_get_flags} + {$EXTERNALSYM RSA_meth_set_flags} + {$EXTERNALSYM RSA_meth_get0_app_data} + {$EXTERNALSYM RSA_meth_set0_app_data} + {$EXTERNALSYM RSA_meth_set_priv_dec} + {$EXTERNALSYM RSA_meth_set_mod_exp} + {$EXTERNALSYM RSA_meth_set_bn_mod_exp} + {$EXTERNALSYM RSA_meth_set_init} + {$EXTERNALSYM RSA_meth_set_finish} + {$EXTERNALSYM RSA_meth_set_sign} + {$EXTERNALSYM RSA_meth_set_verify} + {$EXTERNALSYM RSA_meth_set_keygen} + {$EXTERNALSYM RSA_meth_set_multi_prime_keygen} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +var + RSA_new: function : PRSA; cdecl = nil; + RSA_new_method: function (engine: PENGINE): PRSA; cdecl = nil; + RSA_bits: function (const rsa: PRSA): TIdC_INT; cdecl = nil; + RSA_size: function (const rsa: PRSA): TIdC_INT; cdecl = nil; + RSA_security_bits: function (const rsa: PRSA): TIdC_INT; cdecl = nil; + + RSA_set0_key: function (r: PRSA; n: PBIGNUM; e: PBIGNUM; d: PBIGNUM): TIdC_INT; cdecl = nil; + RSA_set0_factors: function (r: PRSA; p: PBIGNUM; q: PBIGNUM): TIdC_INT; cdecl = nil; + RSA_set0_crt_params: function (r: PRSA; dmp1: PBIGNUM; dmq1: PBIGNUM; iqmp: PBIGNUM): TIdC_INT; cdecl = nil; + //function RSA_set0_multi_prime_params(r: PRSA; primes: array of PBIGNUM; exps: array of PBIGNUM; coeffs: array of PBIGNUM; pnum: TIdC_INT): TIdC_INT; + + RSA_get0_key: procedure (const r: PRSA; const n: PPBIGNUM; const e: PPBIGNUM; const d: PPBIGNUM); cdecl = nil; + RSA_get0_factors: procedure (const r: PRSA; const p: PPBIGNUM; const q: PPBIGNUM); cdecl = nil; + RSA_get_multi_prime_extra_count: function (const r: PRSA): TIdC_INT; cdecl = nil; + //function RSA_get0_multi_prime_factors(const r: PRSA; const primes: array of PBIGNUM): TIdC_INT; + RSA_get0_crt_params: procedure (const r: PRSA; const dmp1: PPBIGNUM; const dmq1: PPBIGNUM; const iqmp: PPBIGNUM); cdecl = nil; + + //function RSA_get0_multi_prime_crt_params(const r: PRSA; const exps: array of PBIGNUM; const coeffs: array of PBIGNUM): TIdC_INT; + + RSA_get0_n: function (const d: PRSA): PBIGNUM; cdecl = nil; + RSA_get0_e: function (const d: PRSA): PBIGNUM; cdecl = nil; + RSA_get0_d: function (const d: PRSA): PBIGNUM; cdecl = nil; + RSA_get0_p: function (const d: PRSA): PBIGNUM; cdecl = nil; + RSA_get0_q: function (const d: PRSA): PBIGNUM; cdecl = nil; + RSA_get0_dmp1: function (const r: PRSA): PBIGNUM; cdecl = nil; + RSA_get0_dmq1: function (const r: PRSA): PBIGNUM; cdecl = nil; + RSA_get0_iqmp: function (const r: PRSA): PBIGNUM; cdecl = nil; + + RSA_clear_flags: procedure (r: PRSA; flags: TIdC_INT); cdecl = nil; + RSA_test_flags: function (const r: PRSA; flags: TIdC_INT): TIdC_INT; cdecl = nil; + RSA_set_flags: procedure (r: PRSA; flags: TIdC_INT); cdecl = nil; + RSA_get_version: function (r: PRSA): TIdC_INT; cdecl = nil; + RSA_get0_engine: function (const r: PRSA): PENGINE; cdecl = nil; + + (* New version *) + RSA_generate_key_ex: function (rsa: PRSA; bits: TIdC_INT; e: PBIGNUM; cb: PBN_GENCB): TIdC_INT; cdecl = nil; + (* Multi-prime version *) + RSA_generate_multi_prime_key: function (rsa: PRSA; bits: TIdC_INT; primes: TIdC_INT; e: PBIGNUM; cb: PBN_GENCB): TIdC_INT; cdecl = nil; + RSA_X931_derive_ex: function (rsa: PRSA; p1: PBIGNUM; p2: PBIGNUM; q1: PBIGNUM; q2: PBIGNUM; const Xp1: PBIGNUM; const Xp2: PBIGNUM; const Xp: PBIGNUM; const Xq1: PBIGNUM; const Xq2: PBIGNUM; const Xq: PBIGNUM; const e: PBIGNUM; cb: PBN_GENCB): TIdC_INT; cdecl = nil; + RSA_X931_generate_key_ex: function (rsa: PRSA; bits: TIdC_INT; const e: PBIGNUM; cb: PBN_GENCB): TIdC_INT; cdecl = nil; + + RSA_check_key: function (const v1: PRSA): TIdC_INT; cdecl = nil; + RSA_check_key_ex: function (const v1: PRSA; cb: BN_GENCB): TIdC_INT; cdecl = nil; + (* next 4 return -1 on error *) + RSA_public_encrypt: function (flen: TIdC_INT; const from: PByte; to_: PByte; rsa: PRSA; padding: TIdC_INT): TIdC_INT; cdecl = nil; + RSA_private_encrypt: function (flen: TIdC_INT; const from: PByte; to_: PByte; rsa: PRSA; padding: TIdC_INT): TIdC_INT; cdecl = nil; + RSA_public_decrypt: function (flen: TIdC_INT; const from: PByte; to_: PByte; rsa: PRSA; padding: TIdC_INT): TIdC_INT; cdecl = nil; + RSA_private_decrypt: function (flen: TIdC_INT; const from: PByte; to_: PByte; rsa: PRSA; padding: TIdC_INT): TIdC_INT; cdecl = nil; + + RSA_free: procedure (r: PRSA); cdecl = nil; + (* "up" the RSA object's reference count *) + RSA_up_ref: function (r: PRSA): TIdC_INT; cdecl = nil; + + RSA_flags: function (const r: PRSA): TIdC_INT; cdecl = nil; + + RSA_set_default_method: procedure (const meth: PRSA_METHOD); cdecl = nil; + RSA_get_default_method: function : PRSA_METHOD; cdecl = nil; + RSA_null_method: function : PRSA_METHOD; cdecl = nil; + RSA_get_method: function (const rsa: PRSA): PRSA_METHOD; cdecl = nil; + RSA_set_method: function (rsa: PRSA; const meth: PRSA_METHOD): TIdC_INT; cdecl = nil; + + (* these are the actual RSA functions *) + RSA_PKCS1_OpenSSL: function : PRSA_METHOD; cdecl = nil; + + RSA_pkey_ctx_ctrl: function (ctx: PEVP_PKEY_CTX; optype: TIdC_INT; cmd: TIdC_INT; p1: TIdC_INT; p2: Pointer): TIdC_INT; cdecl = nil; + + RSA_print: function (bp: PBIO; const r: PRSA; offset: TIdC_INT): TIdC_INT; cdecl = nil; + + (* + * The following 2 functions sign and verify a X509_SIG ASN1 object inside + * PKCS#1 padded RSA encryption + *) + RSA_sign: function (type_: TIdC_INT; const m: PByte; m_length: TIdC_UINT; sigret: PByte; siglen: PIdC_UINT; rsa: PRSA): TIdC_INT; cdecl = nil; + RSA_verify: function (type_: TIdC_INT; const m: PByte; m_length: TIdC_UINT; const sigbuf: PByte; siglen: TIdC_UINT; rsa: PRSA): TIdC_INT; cdecl = nil; + + (* + * The following 2 function sign and verify a ASN1_OCTET_STRING object inside + * PKCS#1 padded RSA encryption + *) + RSA_sign_ASN1_OCTET_STRING: function (type_: TIdC_INT; const m: PByte; m_length: TIdC_UINT; sigret: PByte; siglen: PIdC_UINT; rsa: PRSA): TIdC_INT; cdecl = nil; + RSA_verify_ASN1_OCTET_STRING: function (type_: TIdC_INT; const m: PByte; m_length: TIdC_UINT; sigbuf: PByte; siglen: TIdC_UINT; rsa: PRSA): TIdC_INT; cdecl = nil; + + RSA_blinding_on: function (rsa: PRSA; ctx: PBN_CTX): TIdC_INT; cdecl = nil; + RSA_blinding_off: procedure (rsa: PRSA); cdecl = nil; + RSA_setup_blinding: function (rsa: PRSA; ctx: PBN_CTX): PBN_BLINDING; cdecl = nil; + RSA_padding_add_PKCS1_type_1: function (to_: PByte; tlen: TIdC_INT; const f: PByte; fl: TIdC_INT): TIdC_INT; cdecl = nil; + RSA_padding_check_PKCS1_type_1: function (to_: PByte; tlen: TIdC_INT; const f: PByte; fl: TIdC_INT; rsa_len: TIdC_INT): TIdC_INT; cdecl = nil; + RSA_padding_add_PKCS1_type_2: function (to_: PByte; tlen: TIdC_INT; const f: PByte; fl: TIdC_INT): TIdC_INT; cdecl = nil; + RSA_padding_check_PKCS1_type_2: function (to_: PByte; tlen: TIdC_INT; const f: PByte; fl: TIdC_INT; rsa_len: TIdC_INT): TIdC_INT; cdecl = nil; + PKCS1_MGF1: function (mask: PByte; len: TIdC_LONG; const seed: PByte; seedlen: TIdC_LONG; const dgst: PEVP_MD): TIdC_INT; cdecl = nil; + RSA_padding_add_PKCS1_OAEP: function (to_: PByte; tlen: TIdC_INT; const f: PByte; fl: TIdC_INT; const p: PByte; pl: TIdC_INT): TIdC_INT; cdecl = nil; + RSA_padding_check_PKCS1_OAEP: function (to_: PByte; tlen: TIdC_INT; const f: PByte; fl: TIdC_INT; rsa_len: TIdC_INT; const p: PByte; pl: TIdC_INT): TIdC_INT; cdecl = nil; + RSA_padding_add_PKCS1_OAEP_mgf1: function (to_: PByte; tlen: TIdC_INT; const from: PByte; flen: TIdC_INT; const param: PByte; plen: TIdC_INT; const md: PEVP_MD; const mgf1md: PEVP_MD): TIdC_INT; cdecl = nil; + RSA_padding_check_PKCS1_OAEP_mgf1: function (to_: PByte; tlen: TIdC_INT; const from: PByte; flen: TIdC_INT; num: TIdC_INT; const param: PByte; plen: TIdC_INT; const md: PEVP_MD; const mgf1md: PEVP_MD): TIdC_INT; cdecl = nil; +// RSA_padding_add_SSLv23: function (to_: PByte; tlen: TIdC_INT; const f: PByte; fl: TIdC_INT): TIdC_INT; cdecl = nil; //Discontinued in OpenSSL 3.x +// RSA_padding_check_SSLv23: function (to_: PByte; tlen: TIdC_INT; const f: PByte; fl: TIdC_INT; rsa_len: TIdC_INT): TIdC_INT; cdecl = nil; //Discontinued in OpenSSL 3.x + RSA_padding_add_none: function (to_: PByte; tlen: TIdC_INT; const f: PByte; fl: TIdC_INT): TIdC_INT; cdecl = nil; + RSA_padding_check_none: function (to_: PByte; tlen: TIdC_INT; const f: PByte; fl: TIdC_INT; rsa_len: TIdC_INT): TIdC_INT; cdecl = nil; + RSA_padding_add_X931: function (to_: PByte; tlen: TIdC_INT; const f: PByte; fl: TIdC_INT): TIdC_INT; cdecl = nil; + RSA_padding_check_X931: function (to_: PByte; tlen: TIdC_INT; const f: PByte; fl: TIdC_INT; rsa_len: TIdC_INT): TIdC_INT; cdecl = nil; + RSA_X931_hash_id: function (nid: TIdC_INT): TIdC_INT; cdecl = nil; + + RSA_verify_PKCS1_PSS: function (rsa: PRSA; const mHash: PByte; const Hash: PEVP_MD; const EM: PByte; sLen: TIdC_INT): TIdC_INT; cdecl = nil; + RSA_padding_add_PKCS1_PSS: function (rsa: PRSA; EM: PByte; const mHash: PByte; const Hash: PEVP_MD; sLen: TIdC_INT): TIdC_INT; cdecl = nil; + RSA_verify_PKCS1_PSS_mgf1: function (rsa: PRSA; const mHash: PByte; const Hash: PEVP_MD; const mgf1Hash: PEVP_MD; const EM: PByte; sLen: TIdC_INT): TIdC_INT; cdecl = nil; + RSA_padding_add_PKCS1_PSS_mgf1: function (rsa: PRSA; EM: PByte; const mHash: PByte; const Hash: PEVP_MD; const mgf1Hash: PEVP_MD; sLen: TIdC_INT): TIdC_INT; cdecl = nil; + + //#define RSA_get_ex_new_index(l, p, newf, dupf, freef) \ + // CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_RSA, l, p, newf, dupf, freef) + + RSA_set_ex_data: function (r: PRSA; idx: TIdC_INT; arg: Pointer): TIdC_INT; cdecl = nil; + RSA_get_ex_data: function (const r: PRSA; idx: TIdC_INT): Pointer; cdecl = nil; + RSAPublicKey_dup: function (rsa: PRSA): PRSA; cdecl = nil; + RSAPrivateKey_dup: function (rsa: PRSA): PRSA; cdecl = nil; + + RSA_meth_new: function (const name: PIdAnsiChar; flags: TIdC_INT): PRSA_METHOD; cdecl = nil; + RSA_meth_free: procedure (meth: PRSA_METHOD); cdecl = nil; + RSA_meth_dup: function (const meth: PRSA_METHOD): PRSA_METHOD; cdecl = nil; + RSA_meth_get0_name: function (const meth: PRSA_METHOD): PIdAnsiChar; cdecl = nil; + RSA_meth_set1_name: function (meth: PRSA_METHOD; const name: PIdAnsiChar): TIdC_INT; cdecl = nil; + RSA_meth_get_flags: function (const meth: PRSA_METHOD): TIdC_INT; cdecl = nil; + RSA_meth_set_flags: function (meth: PRSA_METHOD; flags: TIdC_INT): TIdC_INT; cdecl = nil; + RSA_meth_get0_app_data: function (const meth: PRSA_METHOD): Pointer; cdecl = nil; + RSA_meth_set0_app_data: function (meth: PRSA_METHOD; app_data: Pointer): TIdC_INT; cdecl = nil; + + //int (*RSA_meth_get_pub_enc(const RSA_METHOD *meth)) + // (int flen, const unsigned char *from, + // unsigned char *to_, RSA *rsa, int padding); + //int RSA_meth_set_pub_enc(RSA_METHOD *rsa, + // int (*pub_enc) (int flen, const unsigned char *from, + // unsigned char *to_, RSA *rsa, + // int padding)); + //int (*RSA_meth_get_pub_dec(const RSA_METHOD *meth)) + // (int flen, const unsigned char *from, + // unsigned char *to_, RSA *rsa, int padding); + //int RSA_meth_set_pub_dec(RSA_METHOD *rsa, + // int (*pub_dec) (int flen, const unsigned char *from, + // unsigned char *to_, RSA *rsa, + // int padding)); + //int (*RSA_meth_get_priv_enc(const RSA_METHOD *meth)) + // (int flen, const unsigned char *from, + // unsigned char *to_, RSA *rsa, int padding); + //int RSA_meth_set_priv_enc(RSA_METHOD *rsa, + // int (*priv_enc) (int flen, const unsigned char *from, + // unsigned char *to_, RSA *rsa, + // int padding)); + //int (*RSA_meth_get_priv_dec(const RSA_METHOD *meth)) + // (int flen, const unsigned char *from, + // unsigned char *to_, RSA *rsa, int padding); + RSA_meth_set_priv_dec: function (rsa: PRSA_METHOD; priv_dec: RSA_meth_set_priv_dec_priv_dec): TIdC_INT; cdecl = nil; + + //int (*RSA_meth_get_mod_exp(const RSA_METHOD *meth)) + // (BIGNUM *r0, const BIGNUM *i, RSA *rsa, BN_CTX *ctx); + RSA_meth_set_mod_exp: function (rsa: PRSA_METHOD; mod_exp: RSA_meth_set_mod_exp_mod_exp): TIdC_INT; cdecl = nil; + //int (*RSA_meth_get_bn_mod_exp(const RSA_METHOD *meth)) + // (BIGNUM *r, const BIGNUM *a, const BIGNUM *p, + // const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx); + RSA_meth_set_bn_mod_exp: function (rsa: PRSA_METHOD; bn_mod_exp: RSA_meth_set_bn_mod_exp_bn_mod_exp): TIdC_INT; cdecl = nil; + //int (*RSA_meth_get_init(const RSA_METHOD *meth)) (RSA *rsa); + RSA_meth_set_init: function (rsa: PRSA_METHOD; init: RSA_meth_set_init_init): TIdC_INT; cdecl = nil; + //int (*RSA_meth_get_finish(const RSA_METHOD *meth)) (RSA *rsa); + RSA_meth_set_finish: function (rsa: PRSA_METHOD; finish: RSA_meth_set_finish_finish): TIdC_INT; cdecl = nil; + //int (*RSA_meth_get_sign(const RSA_METHOD *meth)) + // (int type_, + // const unsigned char *m, unsigned int m_length, + // unsigned char *sigret, unsigned int *siglen, + // const RSA *rsa); + RSA_meth_set_sign: function (rsa: PRSA_METHOD; sign: RSA_meth_set_sign_sign): TIdC_INT; cdecl = nil; + //int (*RSA_meth_get_verify(const RSA_METHOD *meth)) + // (int dtype, const unsigned char *m, + // unsigned int m_length, const unsigned char *sigbuf, + // unsigned int siglen, const RSA *rsa); + RSA_meth_set_verify: function (rsa: PRSA_METHOD; verify: RSA_meth_set_verify_verify): TIdC_INT; cdecl = nil; + //int (*RSA_meth_get_keygen(const RSA_METHOD *meth)) + // (RSA *rsa, int bits, BIGNUM *e, BN_GENCB *cb); + RSA_meth_set_keygen: function (rsa: PRSA_METHOD; keygen: RSA_meth_set_keygen_keygen): TIdC_INT; cdecl = nil; + //int (*RSA_meth_get_multi_prime_keygen(const RSA_METHOD *meth)) + // (RSA *rsa, int bits, int primes, BIGNUM *e, BN_GENCB *cb); + RSA_meth_set_multi_prime_keygen: function (meth: PRSA_METHOD; keygen: RSA_meth_set_multi_prime_keygen_keygen): TIdC_INT; cdecl = nil; + +{$ELSE} + function RSA_new: PRSA cdecl; external CLibCrypto; + function RSA_new_method(engine: PENGINE): PRSA cdecl; external CLibCrypto; + function RSA_bits(const rsa: PRSA): TIdC_INT cdecl; external CLibCrypto; + function RSA_size(const rsa: PRSA): TIdC_INT cdecl; external CLibCrypto; + function RSA_security_bits(const rsa: PRSA): TIdC_INT cdecl; external CLibCrypto; + + function RSA_set0_key(r: PRSA; n: PBIGNUM; e: PBIGNUM; d: PBIGNUM): TIdC_INT cdecl; external CLibCrypto; + function RSA_set0_factors(r: PRSA; p: PBIGNUM; q: PBIGNUM): TIdC_INT cdecl; external CLibCrypto; + function RSA_set0_crt_params(r: PRSA; dmp1: PBIGNUM; dmq1: PBIGNUM; iqmp: PBIGNUM): TIdC_INT cdecl; external CLibCrypto; + //function RSA_set0_multi_prime_params(r: PRSA; primes: array of PBIGNUM; exps: array of PBIGNUM; coeffs: array of PBIGNUM; pnum: TIdC_INT): TIdC_INT; + + procedure RSA_get0_key(const r: PRSA; const n: PPBIGNUM; const e: PPBIGNUM; const d: PPBIGNUM) cdecl; external CLibCrypto; + procedure RSA_get0_factors(const r: PRSA; const p: PPBIGNUM; const q: PPBIGNUM) cdecl; external CLibCrypto; + function RSA_get_multi_prime_extra_count(const r: PRSA): TIdC_INT cdecl; external CLibCrypto; + //function RSA_get0_multi_prime_factors(const r: PRSA; const primes: array of PBIGNUM): TIdC_INT; + procedure RSA_get0_crt_params(const r: PRSA; const dmp1: PPBIGNUM; const dmq1: PPBIGNUM; const iqmp: PPBIGNUM) cdecl; external CLibCrypto; + + //function RSA_get0_multi_prime_crt_params(const r: PRSA; const exps: array of PBIGNUM; const coeffs: array of PBIGNUM): TIdC_INT; + + function RSA_get0_n(const d: PRSA): PBIGNUM cdecl; external CLibCrypto; + function RSA_get0_e(const d: PRSA): PBIGNUM cdecl; external CLibCrypto; + function RSA_get0_d(const d: PRSA): PBIGNUM cdecl; external CLibCrypto; + function RSA_get0_p(const d: PRSA): PBIGNUM cdecl; external CLibCrypto; + function RSA_get0_q(const d: PRSA): PBIGNUM cdecl; external CLibCrypto; + function RSA_get0_dmp1(const r: PRSA): PBIGNUM cdecl; external CLibCrypto; + function RSA_get0_dmq1(const r: PRSA): PBIGNUM cdecl; external CLibCrypto; + function RSA_get0_iqmp(const r: PRSA): PBIGNUM cdecl; external CLibCrypto; + + procedure RSA_clear_flags(r: PRSA; flags: TIdC_INT) cdecl; external CLibCrypto; + function RSA_test_flags(const r: PRSA; flags: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + procedure RSA_set_flags(r: PRSA; flags: TIdC_INT) cdecl; external CLibCrypto; + function RSA_get_version(r: PRSA): TIdC_INT cdecl; external CLibCrypto; + function RSA_get0_engine(const r: PRSA): PENGINE cdecl; external CLibCrypto; + + (* New version *) + function RSA_generate_key_ex(rsa: PRSA; bits: TIdC_INT; e: PBIGNUM; cb: PBN_GENCB): TIdC_INT cdecl; external CLibCrypto; + (* Multi-prime version *) + function RSA_generate_multi_prime_key(rsa: PRSA; bits: TIdC_INT; primes: TIdC_INT; e: PBIGNUM; cb: PBN_GENCB): TIdC_INT cdecl; external CLibCrypto; + function RSA_X931_derive_ex(rsa: PRSA; p1: PBIGNUM; p2: PBIGNUM; q1: PBIGNUM; q2: PBIGNUM; const Xp1: PBIGNUM; const Xp2: PBIGNUM; const Xp: PBIGNUM; const Xq1: PBIGNUM; const Xq2: PBIGNUM; const Xq: PBIGNUM; const e: PBIGNUM; cb: PBN_GENCB): TIdC_INT cdecl; external CLibCrypto; + function RSA_X931_generate_key_ex(rsa: PRSA; bits: TIdC_INT; const e: PBIGNUM; cb: PBN_GENCB): TIdC_INT cdecl; external CLibCrypto; + + function RSA_check_key(const v1: PRSA): TIdC_INT cdecl; external CLibCrypto; + function RSA_check_key_ex(const v1: PRSA; cb: BN_GENCB): TIdC_INT cdecl; external CLibCrypto; + (* next 4 return -1 on error *) + function RSA_public_encrypt(flen: TIdC_INT; const from: PByte; to_: PByte; rsa: PRSA; padding: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function RSA_private_encrypt(flen: TIdC_INT; const from: PByte; to_: PByte; rsa: PRSA; padding: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function RSA_public_decrypt(flen: TIdC_INT; const from: PByte; to_: PByte; rsa: PRSA; padding: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function RSA_private_decrypt(flen: TIdC_INT; const from: PByte; to_: PByte; rsa: PRSA; padding: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + + procedure RSA_free(r: PRSA) cdecl; external CLibCrypto; + (* "up" the RSA object's reference count *) + function RSA_up_ref(r: PRSA): TIdC_INT cdecl; external CLibCrypto; + + function RSA_flags(const r: PRSA): TIdC_INT cdecl; external CLibCrypto; + + procedure RSA_set_default_method(const meth: PRSA_METHOD) cdecl; external CLibCrypto; + function RSA_get_default_method: PRSA_METHOD cdecl; external CLibCrypto; + function RSA_null_method: PRSA_METHOD cdecl; external CLibCrypto; + function RSA_get_method(const rsa: PRSA): PRSA_METHOD cdecl; external CLibCrypto; + function RSA_set_method(rsa: PRSA; const meth: PRSA_METHOD): TIdC_INT cdecl; external CLibCrypto; + + (* these are the actual RSA functions *) + function RSA_PKCS1_OpenSSL: PRSA_METHOD cdecl; external CLibCrypto; + + function RSA_pkey_ctx_ctrl(ctx: PEVP_PKEY_CTX; optype: TIdC_INT; cmd: TIdC_INT; p1: TIdC_INT; p2: Pointer): TIdC_INT cdecl; external CLibCrypto; + + function RSA_print(bp: PBIO; const r: PRSA; offset: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + + (* + * The following 2 functions sign and verify a X509_SIG ASN1 object inside + * PKCS#1 padded RSA encryption + *) + function RSA_sign(type_: TIdC_INT; const m: PByte; m_length: TIdC_UINT; sigret: PByte; siglen: PIdC_UINT; rsa: PRSA): TIdC_INT cdecl; external CLibCrypto; + function RSA_verify(type_: TIdC_INT; const m: PByte; m_length: TIdC_UINT; const sigbuf: PByte; siglen: TIdC_UINT; rsa: PRSA): TIdC_INT cdecl; external CLibCrypto; + + (* + * The following 2 function sign and verify a ASN1_OCTET_STRING object inside + * PKCS#1 padded RSA encryption + *) + function RSA_sign_ASN1_OCTET_STRING(type_: TIdC_INT; const m: PByte; m_length: TIdC_UINT; sigret: PByte; siglen: PIdC_UINT; rsa: PRSA): TIdC_INT cdecl; external CLibCrypto; + function RSA_verify_ASN1_OCTET_STRING(type_: TIdC_INT; const m: PByte; m_length: TIdC_UINT; sigbuf: PByte; siglen: TIdC_UINT; rsa: PRSA): TIdC_INT cdecl; external CLibCrypto; + + function RSA_blinding_on(rsa: PRSA; ctx: PBN_CTX): TIdC_INT cdecl; external CLibCrypto; + procedure RSA_blinding_off(rsa: PRSA) cdecl; external CLibCrypto; + function RSA_setup_blinding(rsa: PRSA; ctx: PBN_CTX): PBN_BLINDING cdecl; external CLibCrypto; + function RSA_padding_add_PKCS1_type_1(to_: PByte; tlen: TIdC_INT; const f: PByte; fl: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function RSA_padding_check_PKCS1_type_1(to_: PByte; tlen: TIdC_INT; const f: PByte; fl: TIdC_INT; rsa_len: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function RSA_padding_add_PKCS1_type_2(to_: PByte; tlen: TIdC_INT; const f: PByte; fl: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function RSA_padding_check_PKCS1_type_2(to_: PByte; tlen: TIdC_INT; const f: PByte; fl: TIdC_INT; rsa_len: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function PKCS1_MGF1(mask: PByte; len: TIdC_LONG; const seed: PByte; seedlen: TIdC_LONG; const dgst: PEVP_MD): TIdC_INT cdecl; external CLibCrypto; + function RSA_padding_add_PKCS1_OAEP(to_: PByte; tlen: TIdC_INT; const f: PByte; fl: TIdC_INT; const p: PByte; pl: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function RSA_padding_check_PKCS1_OAEP(to_: PByte; tlen: TIdC_INT; const f: PByte; fl: TIdC_INT; rsa_len: TIdC_INT; const p: PByte; pl: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function RSA_padding_add_PKCS1_OAEP_mgf1(to_: PByte; tlen: TIdC_INT; const from: PByte; flen: TIdC_INT; const param: PByte; plen: TIdC_INT; const md: PEVP_MD; const mgf1md: PEVP_MD): TIdC_INT cdecl; external CLibCrypto; + function RSA_padding_check_PKCS1_OAEP_mgf1(to_: PByte; tlen: TIdC_INT; const from: PByte; flen: TIdC_INT; num: TIdC_INT; const param: PByte; plen: TIdC_INT; const md: PEVP_MD; const mgf1md: PEVP_MD): TIdC_INT cdecl; external CLibCrypto; +// function RSA_padding_add_SSLv23(to_: PByte; tlen: TIdC_INT; const f: PByte; fl: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; +// function RSA_padding_check_SSLv23(to_: PByte; tlen: TIdC_INT; const f: PByte; fl: TIdC_INT; rsa_len: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function RSA_padding_add_none(to_: PByte; tlen: TIdC_INT; const f: PByte; fl: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function RSA_padding_check_none(to_: PByte; tlen: TIdC_INT; const f: PByte; fl: TIdC_INT; rsa_len: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function RSA_padding_add_X931(to_: PByte; tlen: TIdC_INT; const f: PByte; fl: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function RSA_padding_check_X931(to_: PByte; tlen: TIdC_INT; const f: PByte; fl: TIdC_INT; rsa_len: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function RSA_X931_hash_id(nid: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + + function RSA_verify_PKCS1_PSS(rsa: PRSA; const mHash: PByte; const Hash: PEVP_MD; const EM: PByte; sLen: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function RSA_padding_add_PKCS1_PSS(rsa: PRSA; EM: PByte; const mHash: PByte; const Hash: PEVP_MD; sLen: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function RSA_verify_PKCS1_PSS_mgf1(rsa: PRSA; const mHash: PByte; const Hash: PEVP_MD; const mgf1Hash: PEVP_MD; const EM: PByte; sLen: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function RSA_padding_add_PKCS1_PSS_mgf1(rsa: PRSA; EM: PByte; const mHash: PByte; const Hash: PEVP_MD; const mgf1Hash: PEVP_MD; sLen: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + + //#define RSA_get_ex_new_index(l, p, newf, dupf, freef) \ + // CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_RSA, l, p, newf, dupf, freef) + + function RSA_set_ex_data(r: PRSA; idx: TIdC_INT; arg: Pointer): TIdC_INT cdecl; external CLibCrypto; + function RSA_get_ex_data(const r: PRSA; idx: TIdC_INT): Pointer cdecl; external CLibCrypto; + function RSAPublicKey_dup(rsa: PRSA): PRSA cdecl; external CLibCrypto; + function RSAPrivateKey_dup(rsa: PRSA): PRSA cdecl; external CLibCrypto; + + function RSA_meth_new(const name: PIdAnsiChar; flags: TIdC_INT): PRSA_METHOD cdecl; external CLibCrypto; + procedure RSA_meth_free(meth: PRSA_METHOD) cdecl; external CLibCrypto; + function RSA_meth_dup(const meth: PRSA_METHOD): PRSA_METHOD cdecl; external CLibCrypto; + function RSA_meth_get0_name(const meth: PRSA_METHOD): PIdAnsiChar cdecl; external CLibCrypto; + function RSA_meth_set1_name(meth: PRSA_METHOD; const name: PIdAnsiChar): TIdC_INT cdecl; external CLibCrypto; + function RSA_meth_get_flags(const meth: PRSA_METHOD): TIdC_INT cdecl; external CLibCrypto; + function RSA_meth_set_flags(meth: PRSA_METHOD; flags: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function RSA_meth_get0_app_data(const meth: PRSA_METHOD): Pointer cdecl; external CLibCrypto; + function RSA_meth_set0_app_data(meth: PRSA_METHOD; app_data: Pointer): TIdC_INT cdecl; external CLibCrypto; + + //int (*RSA_meth_get_pub_enc(const RSA_METHOD *meth)) + // (int flen, const unsigned char *from, + // unsigned char *to_, RSA *rsa, int padding); + //int RSA_meth_set_pub_enc(RSA_METHOD *rsa, + // int (*pub_enc) (int flen, const unsigned char *from, + // unsigned char *to_, RSA *rsa, + // int padding)); + //int (*RSA_meth_get_pub_dec(const RSA_METHOD *meth)) + // (int flen, const unsigned char *from, + // unsigned char *to_, RSA *rsa, int padding); + //int RSA_meth_set_pub_dec(RSA_METHOD *rsa, + // int (*pub_dec) (int flen, const unsigned char *from, + // unsigned char *to_, RSA *rsa, + // int padding)); + //int (*RSA_meth_get_priv_enc(const RSA_METHOD *meth)) + // (int flen, const unsigned char *from, + // unsigned char *to_, RSA *rsa, int padding); + //int RSA_meth_set_priv_enc(RSA_METHOD *rsa, + // int (*priv_enc) (int flen, const unsigned char *from, + // unsigned char *to_, RSA *rsa, + // int padding)); + //int (*RSA_meth_get_priv_dec(const RSA_METHOD *meth)) + // (int flen, const unsigned char *from, + // unsigned char *to_, RSA *rsa, int padding); + function RSA_meth_set_priv_dec(rsa: PRSA_METHOD; priv_dec: RSA_meth_set_priv_dec_priv_dec): TIdC_INT cdecl; external CLibCrypto; + + //int (*RSA_meth_get_mod_exp(const RSA_METHOD *meth)) + // (BIGNUM *r0, const BIGNUM *i, RSA *rsa, BN_CTX *ctx); + function RSA_meth_set_mod_exp(rsa: PRSA_METHOD; mod_exp: RSA_meth_set_mod_exp_mod_exp): TIdC_INT cdecl; external CLibCrypto; + //int (*RSA_meth_get_bn_mod_exp(const RSA_METHOD *meth)) + // (BIGNUM *r, const BIGNUM *a, const BIGNUM *p, + // const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx); + function RSA_meth_set_bn_mod_exp(rsa: PRSA_METHOD; bn_mod_exp: RSA_meth_set_bn_mod_exp_bn_mod_exp): TIdC_INT cdecl; external CLibCrypto; + //int (*RSA_meth_get_init(const RSA_METHOD *meth)) (RSA *rsa); + function RSA_meth_set_init(rsa: PRSA_METHOD; init: RSA_meth_set_init_init): TIdC_INT cdecl; external CLibCrypto; + //int (*RSA_meth_get_finish(const RSA_METHOD *meth)) (RSA *rsa); + function RSA_meth_set_finish(rsa: PRSA_METHOD; finish: RSA_meth_set_finish_finish): TIdC_INT cdecl; external CLibCrypto; + //int (*RSA_meth_get_sign(const RSA_METHOD *meth)) + // (int type_, + // const unsigned char *m, unsigned int m_length, + // unsigned char *sigret, unsigned int *siglen, + // const RSA *rsa); + function RSA_meth_set_sign(rsa: PRSA_METHOD; sign: RSA_meth_set_sign_sign): TIdC_INT cdecl; external CLibCrypto; + //int (*RSA_meth_get_verify(const RSA_METHOD *meth)) + // (int dtype, const unsigned char *m, + // unsigned int m_length, const unsigned char *sigbuf, + // unsigned int siglen, const RSA *rsa); + function RSA_meth_set_verify(rsa: PRSA_METHOD; verify: RSA_meth_set_verify_verify): TIdC_INT cdecl; external CLibCrypto; + //int (*RSA_meth_get_keygen(const RSA_METHOD *meth)) + // (RSA *rsa, int bits, BIGNUM *e, BN_GENCB *cb); + function RSA_meth_set_keygen(rsa: PRSA_METHOD; keygen: RSA_meth_set_keygen_keygen): TIdC_INT cdecl; external CLibCrypto; + //int (*RSA_meth_get_multi_prime_keygen(const RSA_METHOD *meth)) + // (RSA *rsa, int bits, int primes, BIGNUM *e, BN_GENCB *cb); + function RSA_meth_set_multi_prime_keygen(meth: PRSA_METHOD; keygen: RSA_meth_set_multi_prime_keygen_keygen): TIdC_INT cdecl; external CLibCrypto; + +{$ENDIF} + +implementation + + uses + classes, + IdSSLOpenSSLExceptionHandlers, + IdResourceStringsOpenSSL + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + ,IdSSLOpenSSLLoader + {$ENDIF}; + + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +const + RSA_new_procname = 'RSA_new'; + RSA_new_method_procname = 'RSA_new_method'; + RSA_bits_procname = 'RSA_bits'; + RSA_size_procname = 'RSA_size'; + RSA_security_bits_procname = 'RSA_security_bits'; + + RSA_set0_key_procname = 'RSA_set0_key'; + RSA_set0_factors_procname = 'RSA_set0_factors'; + RSA_set0_crt_params_procname = 'RSA_set0_crt_params'; + //function RSA_set0_multi_prime_params(r: PRSA; primes: array of PBIGNUM; exps: array of PBIGNUM; coeffs: array of PBIGNUM; pnum: TIdC_INT): TIdC_INT; + + RSA_get0_key_procname = 'RSA_get0_key'; + RSA_get0_factors_procname = 'RSA_get0_factors'; + RSA_get_multi_prime_extra_count_procname = 'RSA_get_multi_prime_extra_count'; + //function RSA_get0_multi_prime_factors(const r: PRSA; const primes: array of PBIGNUM): TIdC_INT; + RSA_get0_crt_params_procname = 'RSA_get0_crt_params'; + + //function RSA_get0_multi_prime_crt_params(const r: PRSA; const exps: array of PBIGNUM; const coeffs: array of PBIGNUM): TIdC_INT; + + RSA_get0_n_procname = 'RSA_get0_n'; + RSA_get0_e_procname = 'RSA_get0_e'; + RSA_get0_d_procname = 'RSA_get0_d'; + RSA_get0_p_procname = 'RSA_get0_p'; + RSA_get0_q_procname = 'RSA_get0_q'; + RSA_get0_dmp1_procname = 'RSA_get0_dmp1'; + RSA_get0_dmq1_procname = 'RSA_get0_dmq1'; + RSA_get0_iqmp_procname = 'RSA_get0_iqmp'; + + RSA_clear_flags_procname = 'RSA_clear_flags'; + RSA_test_flags_procname = 'RSA_test_flags'; + RSA_set_flags_procname = 'RSA_set_flags'; + RSA_get_version_procname = 'RSA_get_version'; + RSA_get0_engine_procname = 'RSA_get0_engine'; + + (* New version *) + RSA_generate_key_ex_procname = 'RSA_generate_key_ex'; + (* Multi-prime version *) + RSA_generate_multi_prime_key_procname = 'RSA_generate_multi_prime_key'; + RSA_X931_derive_ex_procname = 'RSA_X931_derive_ex'; + RSA_X931_generate_key_ex_procname = 'RSA_X931_generate_key_ex'; + + RSA_check_key_procname = 'RSA_check_key'; + RSA_check_key_ex_procname = 'RSA_check_key_ex'; + (* next 4 return -1 on error *) + RSA_public_encrypt_procname = 'RSA_public_encrypt'; + RSA_private_encrypt_procname = 'RSA_private_encrypt'; + RSA_public_decrypt_procname = 'RSA_public_decrypt'; + RSA_private_decrypt_procname = 'RSA_private_decrypt'; + + RSA_free_procname = 'RSA_free'; + (* "up" the RSA object's reference count *) + RSA_up_ref_procname = 'RSA_up_ref'; + + RSA_flags_procname = 'RSA_flags'; + + RSA_set_default_method_procname = 'RSA_set_default_method'; + RSA_get_default_method_procname = 'RSA_get_default_method'; + RSA_null_method_procname = 'RSA_null_method'; + RSA_get_method_procname = 'RSA_get_method'; + RSA_set_method_procname = 'RSA_set_method'; + + (* these are the actual RSA functions *) + RSA_PKCS1_OpenSSL_procname = 'RSA_PKCS1_OpenSSL'; + + RSA_pkey_ctx_ctrl_procname = 'RSA_pkey_ctx_ctrl'; + + RSA_print_procname = 'RSA_print'; + + (* + * The following 2 functions sign and verify a X509_SIG ASN1 object inside + * PKCS#1 padded RSA encryption + *) + RSA_sign_procname = 'RSA_sign'; + RSA_verify_procname = 'RSA_verify'; + + (* + * The following 2 function sign and verify a ASN1_OCTET_STRING object inside + * PKCS#1 padded RSA encryption + *) + RSA_sign_ASN1_OCTET_STRING_procname = 'RSA_sign_ASN1_OCTET_STRING'; + RSA_verify_ASN1_OCTET_STRING_procname = 'RSA_verify_ASN1_OCTET_STRING'; + + RSA_blinding_on_procname = 'RSA_blinding_on'; + RSA_blinding_off_procname = 'RSA_blinding_off'; + RSA_setup_blinding_procname = 'RSA_setup_blinding'; + RSA_padding_add_PKCS1_type_1_procname = 'RSA_padding_add_PKCS1_type_1'; + RSA_padding_check_PKCS1_type_1_procname = 'RSA_padding_check_PKCS1_type_1'; + RSA_padding_add_PKCS1_type_2_procname = 'RSA_padding_add_PKCS1_type_2'; + RSA_padding_check_PKCS1_type_2_procname = 'RSA_padding_check_PKCS1_type_2'; + PKCS1_MGF1_procname = 'PKCS1_MGF1'; + RSA_padding_add_PKCS1_OAEP_procname = 'RSA_padding_add_PKCS1_OAEP'; + RSA_padding_check_PKCS1_OAEP_procname = 'RSA_padding_check_PKCS1_OAEP'; + RSA_padding_add_PKCS1_OAEP_mgf1_procname = 'RSA_padding_add_PKCS1_OAEP_mgf1'; + RSA_padding_check_PKCS1_OAEP_mgf1_procname = 'RSA_padding_check_PKCS1_OAEP_mgf1'; +// RSA_padding_add_SSLv23_procname = 'RSA_padding_add_SSLv23'; +// RSA_padding_check_SSLv23_procname = 'RSA_padding_check_SSLv23'; + RSA_padding_add_none_procname = 'RSA_padding_add_none'; + RSA_padding_check_none_procname = 'RSA_padding_check_none'; + RSA_padding_add_X931_procname = 'RSA_padding_add_X931'; + RSA_padding_check_X931_procname = 'RSA_padding_check_X931'; + RSA_X931_hash_id_procname = 'RSA_X931_hash_id'; + + RSA_verify_PKCS1_PSS_procname = 'RSA_verify_PKCS1_PSS'; + RSA_padding_add_PKCS1_PSS_procname = 'RSA_padding_add_PKCS1_PSS'; + RSA_verify_PKCS1_PSS_mgf1_procname = 'RSA_verify_PKCS1_PSS_mgf1'; + RSA_padding_add_PKCS1_PSS_mgf1_procname = 'RSA_padding_add_PKCS1_PSS_mgf1'; + + //#define RSA_get_ex_new_index(l, p, newf, dupf, freef) \ + // CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_RSA, l, p, newf, dupf, freef) + + RSA_set_ex_data_procname = 'RSA_set_ex_data'; + RSA_get_ex_data_procname = 'RSA_get_ex_data'; + RSAPublicKey_dup_procname = 'RSAPublicKey_dup'; + RSAPrivateKey_dup_procname = 'RSAPrivateKey_dup'; + + RSA_meth_new_procname = 'RSA_meth_new'; + RSA_meth_free_procname = 'RSA_meth_free'; + RSA_meth_dup_procname = 'RSA_meth_dup'; + RSA_meth_get0_name_procname = 'RSA_meth_get0_name'; + RSA_meth_set1_name_procname = 'RSA_meth_set1_name'; + RSA_meth_get_flags_procname = 'RSA_meth_get_flags'; + RSA_meth_set_flags_procname = 'RSA_meth_set_flags'; + RSA_meth_get0_app_data_procname = 'RSA_meth_get0_app_data'; + RSA_meth_set0_app_data_procname = 'RSA_meth_set0_app_data'; + + //int (*RSA_meth_get_pub_enc(const RSA_METHOD *meth)) + // (int flen, const unsigned char *from, + // unsigned char *to_, RSA *rsa, int padding); + //int RSA_meth_set_pub_enc(RSA_METHOD *rsa, + // int (*pub_enc) (int flen, const unsigned char *from, + // unsigned char *to_, RSA *rsa, + // int padding)); + //int (*RSA_meth_get_pub_dec(const RSA_METHOD *meth)) + // (int flen, const unsigned char *from, + // unsigned char *to_, RSA *rsa, int padding); + //int RSA_meth_set_pub_dec(RSA_METHOD *rsa, + // int (*pub_dec) (int flen, const unsigned char *from, + // unsigned char *to_, RSA *rsa, + // int padding)); + //int (*RSA_meth_get_priv_enc(const RSA_METHOD *meth)) + // (int flen, const unsigned char *from, + // unsigned char *to_, RSA *rsa, int padding); + //int RSA_meth_set_priv_enc(RSA_METHOD *rsa, + // int (*priv_enc) (int flen, const unsigned char *from, + // unsigned char *to_, RSA *rsa, + // int padding)); + //int (*RSA_meth_get_priv_dec(const RSA_METHOD *meth)) + // (int flen, const unsigned char *from, + // unsigned char *to_, RSA *rsa, int padding); + RSA_meth_set_priv_dec_procname = 'RSA_meth_set_priv_dec'; + + //int (*RSA_meth_get_mod_exp(const RSA_METHOD *meth)) + // (BIGNUM *r0, const BIGNUM *i, RSA *rsa, BN_CTX *ctx); + RSA_meth_set_mod_exp_procname = 'RSA_meth_set_mod_exp'; + //int (*RSA_meth_get_bn_mod_exp(const RSA_METHOD *meth)) + // (BIGNUM *r, const BIGNUM *a, const BIGNUM *p, + // const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx); + RSA_meth_set_bn_mod_exp_procname = 'RSA_meth_set_bn_mod_exp'; + //int (*RSA_meth_get_init(const RSA_METHOD *meth)) (RSA *rsa); + RSA_meth_set_init_procname = 'RSA_meth_set_init'; + //int (*RSA_meth_get_finish(const RSA_METHOD *meth)) (RSA *rsa); + RSA_meth_set_finish_procname = 'RSA_meth_set_finish'; + //int (*RSA_meth_get_sign(const RSA_METHOD *meth)) + // (int type_, + // const unsigned char *m, unsigned int m_length, + // unsigned char *sigret, unsigned int *siglen, + // const RSA *rsa); + RSA_meth_set_sign_procname = 'RSA_meth_set_sign'; + //int (*RSA_meth_get_verify(const RSA_METHOD *meth)) + // (int dtype, const unsigned char *m, + // unsigned int m_length, const unsigned char *sigbuf, + // unsigned int siglen, const RSA *rsa); + RSA_meth_set_verify_procname = 'RSA_meth_set_verify'; + //int (*RSA_meth_get_keygen(const RSA_METHOD *meth)) + // (RSA *rsa, int bits, BIGNUM *e, BN_GENCB *cb); + RSA_meth_set_keygen_procname = 'RSA_meth_set_keygen'; + //int (*RSA_meth_get_multi_prime_keygen(const RSA_METHOD *meth)) + // (RSA *rsa, int bits, int primes, BIGNUM *e, BN_GENCB *cb); + RSA_meth_set_multi_prime_keygen_procname = 'RSA_meth_set_multi_prime_keygen'; + + +{$WARN NO_RETVAL OFF} +function ERR_RSA_new: PRSA; +begin + EIdAPIFunctionNotPresent.RaiseException(RSA_new_procname); +end; + + +function ERR_RSA_new_method(engine: PENGINE): PRSA; +begin + EIdAPIFunctionNotPresent.RaiseException(RSA_new_method_procname); +end; + + +function ERR_RSA_bits(const rsa: PRSA): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(RSA_bits_procname); +end; + + +function ERR_RSA_size(const rsa: PRSA): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(RSA_size_procname); +end; + + +function ERR_RSA_security_bits(const rsa: PRSA): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(RSA_security_bits_procname); +end; + + + +function ERR_RSA_set0_key(r: PRSA; n: PBIGNUM; e: PBIGNUM; d: PBIGNUM): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(RSA_set0_key_procname); +end; + + +function ERR_RSA_set0_factors(r: PRSA; p: PBIGNUM; q: PBIGNUM): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(RSA_set0_factors_procname); +end; + + +function ERR_RSA_set0_crt_params(r: PRSA; dmp1: PBIGNUM; dmq1: PBIGNUM; iqmp: PBIGNUM): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(RSA_set0_crt_params_procname); +end; + + + //function RSA_set0_multi_prime_params(r: PRSA; primes: array of PBIGNUM; exps: array of PBIGNUM; coeffs: array of PBIGNUM; pnum: TIdC_INT): TIdC_INT; + +procedure ERR_RSA_get0_key(const r: PRSA; const n: PPBIGNUM; const e: PPBIGNUM; const d: PPBIGNUM); +begin + EIdAPIFunctionNotPresent.RaiseException(RSA_get0_key_procname); +end; + + +procedure ERR_RSA_get0_factors(const r: PRSA; const p: PPBIGNUM; const q: PPBIGNUM); +begin + EIdAPIFunctionNotPresent.RaiseException(RSA_get0_factors_procname); +end; + + +function ERR_RSA_get_multi_prime_extra_count(const r: PRSA): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(RSA_get_multi_prime_extra_count_procname); +end; + + + //function RSA_get0_multi_prime_factors(const r: PRSA; const primes: array of PBIGNUM): TIdC_INT; +procedure ERR_RSA_get0_crt_params(const r: PRSA; const dmp1: PPBIGNUM; const dmq1: PPBIGNUM; const iqmp: PPBIGNUM); +begin + EIdAPIFunctionNotPresent.RaiseException(RSA_get0_crt_params_procname); +end; + + + + //function RSA_get0_multi_prime_crt_params(const r: PRSA; const exps: array of PBIGNUM; const coeffs: array of PBIGNUM): TIdC_INT; + +function ERR_RSA_get0_n(const d: PRSA): PBIGNUM; +begin + EIdAPIFunctionNotPresent.RaiseException(RSA_get0_n_procname); +end; + + +function ERR_RSA_get0_e(const d: PRSA): PBIGNUM; +begin + EIdAPIFunctionNotPresent.RaiseException(RSA_get0_e_procname); +end; + + +function ERR_RSA_get0_d(const d: PRSA): PBIGNUM; +begin + EIdAPIFunctionNotPresent.RaiseException(RSA_get0_d_procname); +end; + + +function ERR_RSA_get0_p(const d: PRSA): PBIGNUM; +begin + EIdAPIFunctionNotPresent.RaiseException(RSA_get0_p_procname); +end; + + +function ERR_RSA_get0_q(const d: PRSA): PBIGNUM; +begin + EIdAPIFunctionNotPresent.RaiseException(RSA_get0_q_procname); +end; + + +function ERR_RSA_get0_dmp1(const r: PRSA): PBIGNUM; +begin + EIdAPIFunctionNotPresent.RaiseException(RSA_get0_dmp1_procname); +end; + + +function ERR_RSA_get0_dmq1(const r: PRSA): PBIGNUM; +begin + EIdAPIFunctionNotPresent.RaiseException(RSA_get0_dmq1_procname); +end; + + +function ERR_RSA_get0_iqmp(const r: PRSA): PBIGNUM; +begin + EIdAPIFunctionNotPresent.RaiseException(RSA_get0_iqmp_procname); +end; + + + +procedure ERR_RSA_clear_flags(r: PRSA; flags: TIdC_INT); +begin + EIdAPIFunctionNotPresent.RaiseException(RSA_clear_flags_procname); +end; + + +function ERR_RSA_test_flags(const r: PRSA; flags: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(RSA_test_flags_procname); +end; + + +procedure ERR_RSA_set_flags(r: PRSA; flags: TIdC_INT); +begin + EIdAPIFunctionNotPresent.RaiseException(RSA_set_flags_procname); +end; + + +function ERR_RSA_get_version(r: PRSA): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(RSA_get_version_procname); +end; + + +function ERR_RSA_get0_engine(const r: PRSA): PENGINE; +begin + EIdAPIFunctionNotPresent.RaiseException(RSA_get0_engine_procname); +end; + + + + (* New version *) +function ERR_RSA_generate_key_ex(rsa: PRSA; bits: TIdC_INT; e: PBIGNUM; cb: PBN_GENCB): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(RSA_generate_key_ex_procname); +end; + + + (* Multi-prime version *) +function ERR_RSA_generate_multi_prime_key(rsa: PRSA; bits: TIdC_INT; primes: TIdC_INT; e: PBIGNUM; cb: PBN_GENCB): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(RSA_generate_multi_prime_key_procname); +end; + + +function ERR_RSA_X931_derive_ex(rsa: PRSA; p1: PBIGNUM; p2: PBIGNUM; q1: PBIGNUM; q2: PBIGNUM; const Xp1: PBIGNUM; const Xp2: PBIGNUM; const Xp: PBIGNUM; const Xq1: PBIGNUM; const Xq2: PBIGNUM; const Xq: PBIGNUM; const e: PBIGNUM; cb: PBN_GENCB): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(RSA_X931_derive_ex_procname); +end; + + +function ERR_RSA_X931_generate_key_ex(rsa: PRSA; bits: TIdC_INT; const e: PBIGNUM; cb: PBN_GENCB): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(RSA_X931_generate_key_ex_procname); +end; + + + +function ERR_RSA_check_key(const v1: PRSA): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(RSA_check_key_procname); +end; + + +function ERR_RSA_check_key_ex(const v1: PRSA; cb: BN_GENCB): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(RSA_check_key_ex_procname); +end; + + + (* next 4 return -1 on error *) +function ERR_RSA_public_encrypt(flen: TIdC_INT; const from: PByte; to_: PByte; rsa: PRSA; padding: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(RSA_public_encrypt_procname); +end; + + +function ERR_RSA_private_encrypt(flen: TIdC_INT; const from: PByte; to_: PByte; rsa: PRSA; padding: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(RSA_private_encrypt_procname); +end; + + +function ERR_RSA_public_decrypt(flen: TIdC_INT; const from: PByte; to_: PByte; rsa: PRSA; padding: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(RSA_public_decrypt_procname); +end; + + +function ERR_RSA_private_decrypt(flen: TIdC_INT; const from: PByte; to_: PByte; rsa: PRSA; padding: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(RSA_private_decrypt_procname); +end; + + + +procedure ERR_RSA_free(r: PRSA); +begin + EIdAPIFunctionNotPresent.RaiseException(RSA_free_procname); +end; + + + (* "up" the RSA object's reference count *) +function ERR_RSA_up_ref(r: PRSA): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(RSA_up_ref_procname); +end; + + + +function ERR_RSA_flags(const r: PRSA): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(RSA_flags_procname); +end; + + + +procedure ERR_RSA_set_default_method(const meth: PRSA_METHOD); +begin + EIdAPIFunctionNotPresent.RaiseException(RSA_set_default_method_procname); +end; + + +function ERR_RSA_get_default_method: PRSA_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(RSA_get_default_method_procname); +end; + + +function ERR_RSA_null_method: PRSA_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(RSA_null_method_procname); +end; + + +function ERR_RSA_get_method(const rsa: PRSA): PRSA_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(RSA_get_method_procname); +end; + + +function ERR_RSA_set_method(rsa: PRSA; const meth: PRSA_METHOD): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(RSA_set_method_procname); +end; + + + + (* these are the actual RSA functions *) +function ERR_RSA_PKCS1_OpenSSL: PRSA_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(RSA_PKCS1_OpenSSL_procname); +end; + + + +function ERR_RSA_pkey_ctx_ctrl(ctx: PEVP_PKEY_CTX; optype: TIdC_INT; cmd: TIdC_INT; p1: TIdC_INT; p2: Pointer): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(RSA_pkey_ctx_ctrl_procname); +end; + + + +function ERR_RSA_print(bp: PBIO; const r: PRSA; offset: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(RSA_print_procname); +end; + + + + (* + * The following 2 functions sign and verify a X509_SIG ASN1 object inside + * PKCS#1 padded RSA encryption + *) +function ERR_RSA_sign(type_: TIdC_INT; const m: PByte; m_length: TIdC_UINT; sigret: PByte; siglen: PIdC_UINT; rsa: PRSA): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(RSA_sign_procname); +end; + + +function ERR_RSA_verify(type_: TIdC_INT; const m: PByte; m_length: TIdC_UINT; const sigbuf: PByte; siglen: TIdC_UINT; rsa: PRSA): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(RSA_verify_procname); +end; + + + + (* + * The following 2 function sign and verify a ASN1_OCTET_STRING object inside + * PKCS#1 padded RSA encryption + *) +function ERR_RSA_sign_ASN1_OCTET_STRING(type_: TIdC_INT; const m: PByte; m_length: TIdC_UINT; sigret: PByte; siglen: PIdC_UINT; rsa: PRSA): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(RSA_sign_ASN1_OCTET_STRING_procname); +end; + + +function ERR_RSA_verify_ASN1_OCTET_STRING(type_: TIdC_INT; const m: PByte; m_length: TIdC_UINT; sigbuf: PByte; siglen: TIdC_UINT; rsa: PRSA): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(RSA_verify_ASN1_OCTET_STRING_procname); +end; + + + +function ERR_RSA_blinding_on(rsa: PRSA; ctx: PBN_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(RSA_blinding_on_procname); +end; + + +procedure ERR_RSA_blinding_off(rsa: PRSA); +begin + EIdAPIFunctionNotPresent.RaiseException(RSA_blinding_off_procname); +end; + + +function ERR_RSA_setup_blinding(rsa: PRSA; ctx: PBN_CTX): PBN_BLINDING; +begin + EIdAPIFunctionNotPresent.RaiseException(RSA_setup_blinding_procname); +end; + + +function ERR_RSA_padding_add_PKCS1_type_1(to_: PByte; tlen: TIdC_INT; const f: PByte; fl: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(RSA_padding_add_PKCS1_type_1_procname); +end; + + +function ERR_RSA_padding_check_PKCS1_type_1(to_: PByte; tlen: TIdC_INT; const f: PByte; fl: TIdC_INT; rsa_len: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(RSA_padding_check_PKCS1_type_1_procname); +end; + + +function ERR_RSA_padding_add_PKCS1_type_2(to_: PByte; tlen: TIdC_INT; const f: PByte; fl: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(RSA_padding_add_PKCS1_type_2_procname); +end; + + +function ERR_RSA_padding_check_PKCS1_type_2(to_: PByte; tlen: TIdC_INT; const f: PByte; fl: TIdC_INT; rsa_len: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(RSA_padding_check_PKCS1_type_2_procname); +end; + + +function ERR_PKCS1_MGF1(mask: PByte; len: TIdC_LONG; const seed: PByte; seedlen: TIdC_LONG; const dgst: PEVP_MD): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS1_MGF1_procname); +end; + + +function ERR_RSA_padding_add_PKCS1_OAEP(to_: PByte; tlen: TIdC_INT; const f: PByte; fl: TIdC_INT; const p: PByte; pl: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(RSA_padding_add_PKCS1_OAEP_procname); +end; + + +function ERR_RSA_padding_check_PKCS1_OAEP(to_: PByte; tlen: TIdC_INT; const f: PByte; fl: TIdC_INT; rsa_len: TIdC_INT; const p: PByte; pl: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(RSA_padding_check_PKCS1_OAEP_procname); +end; + + +function ERR_RSA_padding_add_PKCS1_OAEP_mgf1(to_: PByte; tlen: TIdC_INT; const from: PByte; flen: TIdC_INT; const param: PByte; plen: TIdC_INT; const md: PEVP_MD; const mgf1md: PEVP_MD): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(RSA_padding_add_PKCS1_OAEP_mgf1_procname); +end; + + +function ERR_RSA_padding_check_PKCS1_OAEP_mgf1(to_: PByte; tlen: TIdC_INT; const from: PByte; flen: TIdC_INT; num: TIdC_INT; const param: PByte; plen: TIdC_INT; const md: PEVP_MD; const mgf1md: PEVP_MD): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(RSA_padding_check_PKCS1_OAEP_mgf1_procname); +end; + +{ +function ERR_RSA_padding_add_SSLv23(to_: PByte; tlen: TIdC_INT; const f: PByte; fl: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(RSA_padding_add_SSLv23_procname); +end; +} +{ +function ERR_RSA_padding_check_SSLv23(to_: PByte; tlen: TIdC_INT; const f: PByte; fl: TIdC_INT; rsa_len: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(RSA_padding_check_SSLv23_procname); +end; } + + +function ERR_RSA_padding_add_none(to_: PByte; tlen: TIdC_INT; const f: PByte; fl: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(RSA_padding_add_none_procname); +end; + + +function ERR_RSA_padding_check_none(to_: PByte; tlen: TIdC_INT; const f: PByte; fl: TIdC_INT; rsa_len: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(RSA_padding_check_none_procname); +end; + + +function ERR_RSA_padding_add_X931(to_: PByte; tlen: TIdC_INT; const f: PByte; fl: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(RSA_padding_add_X931_procname); +end; + + +function ERR_RSA_padding_check_X931(to_: PByte; tlen: TIdC_INT; const f: PByte; fl: TIdC_INT; rsa_len: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(RSA_padding_check_X931_procname); +end; + + +function ERR_RSA_X931_hash_id(nid: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(RSA_X931_hash_id_procname); +end; + + + +function ERR_RSA_verify_PKCS1_PSS(rsa: PRSA; const mHash: PByte; const Hash: PEVP_MD; const EM: PByte; sLen: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(RSA_verify_PKCS1_PSS_procname); +end; + + +function ERR_RSA_padding_add_PKCS1_PSS(rsa: PRSA; EM: PByte; const mHash: PByte; const Hash: PEVP_MD; sLen: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(RSA_padding_add_PKCS1_PSS_procname); +end; + + +function ERR_RSA_verify_PKCS1_PSS_mgf1(rsa: PRSA; const mHash: PByte; const Hash: PEVP_MD; const mgf1Hash: PEVP_MD; const EM: PByte; sLen: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(RSA_verify_PKCS1_PSS_mgf1_procname); +end; + + +function ERR_RSA_padding_add_PKCS1_PSS_mgf1(rsa: PRSA; EM: PByte; const mHash: PByte; const Hash: PEVP_MD; const mgf1Hash: PEVP_MD; sLen: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(RSA_padding_add_PKCS1_PSS_mgf1_procname); +end; + + + + //#define RSA_get_ex_new_index(l, p, newf, dupf, freef) \ + // CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_RSA, l, p, newf, dupf, freef) + +function ERR_RSA_set_ex_data(r: PRSA; idx: TIdC_INT; arg: Pointer): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(RSA_set_ex_data_procname); +end; + + +function ERR_RSA_get_ex_data(const r: PRSA; idx: TIdC_INT): Pointer; +begin + EIdAPIFunctionNotPresent.RaiseException(RSA_get_ex_data_procname); +end; + + +function ERR_RSAPublicKey_dup(rsa: PRSA): PRSA; +begin + EIdAPIFunctionNotPresent.RaiseException(RSAPublicKey_dup_procname); +end; + + +function ERR_RSAPrivateKey_dup(rsa: PRSA): PRSA; +begin + EIdAPIFunctionNotPresent.RaiseException(RSAPrivateKey_dup_procname); +end; + + + +function ERR_RSA_meth_new(const name: PIdAnsiChar; flags: TIdC_INT): PRSA_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(RSA_meth_new_procname); +end; + + +procedure ERR_RSA_meth_free(meth: PRSA_METHOD); +begin + EIdAPIFunctionNotPresent.RaiseException(RSA_meth_free_procname); +end; + + +function ERR_RSA_meth_dup(const meth: PRSA_METHOD): PRSA_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(RSA_meth_dup_procname); +end; + + +function ERR_RSA_meth_get0_name(const meth: PRSA_METHOD): PIdAnsiChar; +begin + EIdAPIFunctionNotPresent.RaiseException(RSA_meth_get0_name_procname); +end; + + +function ERR_RSA_meth_set1_name(meth: PRSA_METHOD; const name: PIdAnsiChar): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(RSA_meth_set1_name_procname); +end; + + +function ERR_RSA_meth_get_flags(const meth: PRSA_METHOD): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(RSA_meth_get_flags_procname); +end; + + +function ERR_RSA_meth_set_flags(meth: PRSA_METHOD; flags: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(RSA_meth_set_flags_procname); +end; + + +function ERR_RSA_meth_get0_app_data(const meth: PRSA_METHOD): Pointer; +begin + EIdAPIFunctionNotPresent.RaiseException(RSA_meth_get0_app_data_procname); +end; + + +function ERR_RSA_meth_set0_app_data(meth: PRSA_METHOD; app_data: Pointer): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(RSA_meth_set0_app_data_procname); +end; + + + + //int (*RSA_meth_get_pub_enc(const RSA_METHOD *meth)) + // (int flen, const unsigned char *from, + // unsigned char *to_, RSA *rsa, int padding); + //int RSA_meth_set_pub_enc(RSA_METHOD *rsa, + // int (*pub_enc) (int flen, const unsigned char *from, + // unsigned char *to_, RSA *rsa, + // int padding)); + //int (*RSA_meth_get_pub_dec(const RSA_METHOD *meth)) + // (int flen, const unsigned char *from, + // unsigned char *to_, RSA *rsa, int padding); + //int RSA_meth_set_pub_dec(RSA_METHOD *rsa, + // int (*pub_dec) (int flen, const unsigned char *from, + // unsigned char *to_, RSA *rsa, + // int padding)); + //int (*RSA_meth_get_priv_enc(const RSA_METHOD *meth)) + // (int flen, const unsigned char *from, + // unsigned char *to_, RSA *rsa, int padding); + //int RSA_meth_set_priv_enc(RSA_METHOD *rsa, + // int (*priv_enc) (int flen, const unsigned char *from, + // unsigned char *to_, RSA *rsa, + // int padding)); + //int (*RSA_meth_get_priv_dec(const RSA_METHOD *meth)) + // (int flen, const unsigned char *from, + // unsigned char *to_, RSA *rsa, int padding); +function ERR_RSA_meth_set_priv_dec(rsa: PRSA_METHOD; priv_dec: RSA_meth_set_priv_dec_priv_dec): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(RSA_meth_set_priv_dec_procname); +end; + + + + //int (*RSA_meth_get_mod_exp(const RSA_METHOD *meth)) + // (BIGNUM *r0, const BIGNUM *i, RSA *rsa, BN_CTX *ctx); +function ERR_RSA_meth_set_mod_exp(rsa: PRSA_METHOD; mod_exp: RSA_meth_set_mod_exp_mod_exp): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(RSA_meth_set_mod_exp_procname); +end; + + + //int (*RSA_meth_get_bn_mod_exp(const RSA_METHOD *meth)) + // (BIGNUM *r, const BIGNUM *a, const BIGNUM *p, + // const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx); +function ERR_RSA_meth_set_bn_mod_exp(rsa: PRSA_METHOD; bn_mod_exp: RSA_meth_set_bn_mod_exp_bn_mod_exp): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(RSA_meth_set_bn_mod_exp_procname); +end; + + + //int (*RSA_meth_get_init(const RSA_METHOD *meth)) (RSA *rsa); +function ERR_RSA_meth_set_init(rsa: PRSA_METHOD; init: RSA_meth_set_init_init): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(RSA_meth_set_init_procname); +end; + + + //int (*RSA_meth_get_finish(const RSA_METHOD *meth)) (RSA *rsa); +function ERR_RSA_meth_set_finish(rsa: PRSA_METHOD; finish: RSA_meth_set_finish_finish): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(RSA_meth_set_finish_procname); +end; + + + //int (*RSA_meth_get_sign(const RSA_METHOD *meth)) + // (int type_, + // const unsigned char *m, unsigned int m_length, + // unsigned char *sigret, unsigned int *siglen, + // const RSA *rsa); +function ERR_RSA_meth_set_sign(rsa: PRSA_METHOD; sign: RSA_meth_set_sign_sign): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(RSA_meth_set_sign_procname); +end; + + + //int (*RSA_meth_get_verify(const RSA_METHOD *meth)) + // (int dtype, const unsigned char *m, + // unsigned int m_length, const unsigned char *sigbuf, + // unsigned int siglen, const RSA *rsa); +function ERR_RSA_meth_set_verify(rsa: PRSA_METHOD; verify: RSA_meth_set_verify_verify): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(RSA_meth_set_verify_procname); +end; + + + //int (*RSA_meth_get_keygen(const RSA_METHOD *meth)) + // (RSA *rsa, int bits, BIGNUM *e, BN_GENCB *cb); +function ERR_RSA_meth_set_keygen(rsa: PRSA_METHOD; keygen: RSA_meth_set_keygen_keygen): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(RSA_meth_set_keygen_procname); +end; + + + //int (*RSA_meth_get_multi_prime_keygen(const RSA_METHOD *meth)) + // (RSA *rsa, int bits, int primes, BIGNUM *e, BN_GENCB *cb); +function ERR_RSA_meth_set_multi_prime_keygen(meth: PRSA_METHOD; keygen: RSA_meth_set_multi_prime_keygen_keygen): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(RSA_meth_set_multi_prime_keygen_procname); +end; + + + +{$WARN NO_RETVAL ON} + +procedure Load(const ADllHandle: TIdLibHandle; LibVersion: TIdC_UINT; const AFailed: TStringList); + +var FuncLoadError: boolean; + +begin + RSA_new := LoadLibFunction(ADllHandle, RSA_new_procname); + FuncLoadError := not assigned(RSA_new); + if FuncLoadError then + begin + {$if not defined(RSA_new_allownil)} + RSA_new := @ERR_RSA_new; + {$ifend} + {$if declared(RSA_new_introduced)} + if LibVersion < RSA_new_introduced then + begin + {$if declared(FC_RSA_new)} + RSA_new := @FC_RSA_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RSA_new_removed)} + if RSA_new_removed <= LibVersion then + begin + {$if declared(_RSA_new)} + RSA_new := @_RSA_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RSA_new_allownil)} + if FuncLoadError then + AFailed.Add('RSA_new'); + {$ifend} + end; + + + RSA_new_method := LoadLibFunction(ADllHandle, RSA_new_method_procname); + FuncLoadError := not assigned(RSA_new_method); + if FuncLoadError then + begin + {$if not defined(RSA_new_method_allownil)} + RSA_new_method := @ERR_RSA_new_method; + {$ifend} + {$if declared(RSA_new_method_introduced)} + if LibVersion < RSA_new_method_introduced then + begin + {$if declared(FC_RSA_new_method)} + RSA_new_method := @FC_RSA_new_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RSA_new_method_removed)} + if RSA_new_method_removed <= LibVersion then + begin + {$if declared(_RSA_new_method)} + RSA_new_method := @_RSA_new_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RSA_new_method_allownil)} + if FuncLoadError then + AFailed.Add('RSA_new_method'); + {$ifend} + end; + + + RSA_bits := LoadLibFunction(ADllHandle, RSA_bits_procname); + FuncLoadError := not assigned(RSA_bits); + if FuncLoadError then + begin + {$if not defined(RSA_bits_allownil)} + RSA_bits := @ERR_RSA_bits; + {$ifend} + {$if declared(RSA_bits_introduced)} + if LibVersion < RSA_bits_introduced then + begin + {$if declared(FC_RSA_bits)} + RSA_bits := @FC_RSA_bits; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RSA_bits_removed)} + if RSA_bits_removed <= LibVersion then + begin + {$if declared(_RSA_bits)} + RSA_bits := @_RSA_bits; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RSA_bits_allownil)} + if FuncLoadError then + AFailed.Add('RSA_bits'); + {$ifend} + end; + + + RSA_size := LoadLibFunction(ADllHandle, RSA_size_procname); + FuncLoadError := not assigned(RSA_size); + if FuncLoadError then + begin + {$if not defined(RSA_size_allownil)} + RSA_size := @ERR_RSA_size; + {$ifend} + {$if declared(RSA_size_introduced)} + if LibVersion < RSA_size_introduced then + begin + {$if declared(FC_RSA_size)} + RSA_size := @FC_RSA_size; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RSA_size_removed)} + if RSA_size_removed <= LibVersion then + begin + {$if declared(_RSA_size)} + RSA_size := @_RSA_size; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RSA_size_allownil)} + if FuncLoadError then + AFailed.Add('RSA_size'); + {$ifend} + end; + + + RSA_security_bits := LoadLibFunction(ADllHandle, RSA_security_bits_procname); + FuncLoadError := not assigned(RSA_security_bits); + if FuncLoadError then + begin + {$if not defined(RSA_security_bits_allownil)} + RSA_security_bits := @ERR_RSA_security_bits; + {$ifend} + {$if declared(RSA_security_bits_introduced)} + if LibVersion < RSA_security_bits_introduced then + begin + {$if declared(FC_RSA_security_bits)} + RSA_security_bits := @FC_RSA_security_bits; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RSA_security_bits_removed)} + if RSA_security_bits_removed <= LibVersion then + begin + {$if declared(_RSA_security_bits)} + RSA_security_bits := @_RSA_security_bits; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RSA_security_bits_allownil)} + if FuncLoadError then + AFailed.Add('RSA_security_bits'); + {$ifend} + end; + + + RSA_set0_key := LoadLibFunction(ADllHandle, RSA_set0_key_procname); + FuncLoadError := not assigned(RSA_set0_key); + if FuncLoadError then + begin + {$if not defined(RSA_set0_key_allownil)} + RSA_set0_key := @ERR_RSA_set0_key; + {$ifend} + {$if declared(RSA_set0_key_introduced)} + if LibVersion < RSA_set0_key_introduced then + begin + {$if declared(FC_RSA_set0_key)} + RSA_set0_key := @FC_RSA_set0_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RSA_set0_key_removed)} + if RSA_set0_key_removed <= LibVersion then + begin + {$if declared(_RSA_set0_key)} + RSA_set0_key := @_RSA_set0_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RSA_set0_key_allownil)} + if FuncLoadError then + AFailed.Add('RSA_set0_key'); + {$ifend} + end; + + + RSA_set0_factors := LoadLibFunction(ADllHandle, RSA_set0_factors_procname); + FuncLoadError := not assigned(RSA_set0_factors); + if FuncLoadError then + begin + {$if not defined(RSA_set0_factors_allownil)} + RSA_set0_factors := @ERR_RSA_set0_factors; + {$ifend} + {$if declared(RSA_set0_factors_introduced)} + if LibVersion < RSA_set0_factors_introduced then + begin + {$if declared(FC_RSA_set0_factors)} + RSA_set0_factors := @FC_RSA_set0_factors; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RSA_set0_factors_removed)} + if RSA_set0_factors_removed <= LibVersion then + begin + {$if declared(_RSA_set0_factors)} + RSA_set0_factors := @_RSA_set0_factors; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RSA_set0_factors_allownil)} + if FuncLoadError then + AFailed.Add('RSA_set0_factors'); + {$ifend} + end; + + + RSA_set0_crt_params := LoadLibFunction(ADllHandle, RSA_set0_crt_params_procname); + FuncLoadError := not assigned(RSA_set0_crt_params); + if FuncLoadError then + begin + {$if not defined(RSA_set0_crt_params_allownil)} + RSA_set0_crt_params := @ERR_RSA_set0_crt_params; + {$ifend} + {$if declared(RSA_set0_crt_params_introduced)} + if LibVersion < RSA_set0_crt_params_introduced then + begin + {$if declared(FC_RSA_set0_crt_params)} + RSA_set0_crt_params := @FC_RSA_set0_crt_params; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RSA_set0_crt_params_removed)} + if RSA_set0_crt_params_removed <= LibVersion then + begin + {$if declared(_RSA_set0_crt_params)} + RSA_set0_crt_params := @_RSA_set0_crt_params; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RSA_set0_crt_params_allownil)} + if FuncLoadError then + AFailed.Add('RSA_set0_crt_params'); + {$ifend} + end; + + + RSA_get0_key := LoadLibFunction(ADllHandle, RSA_get0_key_procname); + FuncLoadError := not assigned(RSA_get0_key); + if FuncLoadError then + begin + {$if not defined(RSA_get0_key_allownil)} + RSA_get0_key := @ERR_RSA_get0_key; + {$ifend} + {$if declared(RSA_get0_key_introduced)} + if LibVersion < RSA_get0_key_introduced then + begin + {$if declared(FC_RSA_get0_key)} + RSA_get0_key := @FC_RSA_get0_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RSA_get0_key_removed)} + if RSA_get0_key_removed <= LibVersion then + begin + {$if declared(_RSA_get0_key)} + RSA_get0_key := @_RSA_get0_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RSA_get0_key_allownil)} + if FuncLoadError then + AFailed.Add('RSA_get0_key'); + {$ifend} + end; + + + RSA_get0_factors := LoadLibFunction(ADllHandle, RSA_get0_factors_procname); + FuncLoadError := not assigned(RSA_get0_factors); + if FuncLoadError then + begin + {$if not defined(RSA_get0_factors_allownil)} + RSA_get0_factors := @ERR_RSA_get0_factors; + {$ifend} + {$if declared(RSA_get0_factors_introduced)} + if LibVersion < RSA_get0_factors_introduced then + begin + {$if declared(FC_RSA_get0_factors)} + RSA_get0_factors := @FC_RSA_get0_factors; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RSA_get0_factors_removed)} + if RSA_get0_factors_removed <= LibVersion then + begin + {$if declared(_RSA_get0_factors)} + RSA_get0_factors := @_RSA_get0_factors; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RSA_get0_factors_allownil)} + if FuncLoadError then + AFailed.Add('RSA_get0_factors'); + {$ifend} + end; + + + RSA_get_multi_prime_extra_count := LoadLibFunction(ADllHandle, RSA_get_multi_prime_extra_count_procname); + FuncLoadError := not assigned(RSA_get_multi_prime_extra_count); + if FuncLoadError then + begin + {$if not defined(RSA_get_multi_prime_extra_count_allownil)} + RSA_get_multi_prime_extra_count := @ERR_RSA_get_multi_prime_extra_count; + {$ifend} + {$if declared(RSA_get_multi_prime_extra_count_introduced)} + if LibVersion < RSA_get_multi_prime_extra_count_introduced then + begin + {$if declared(FC_RSA_get_multi_prime_extra_count)} + RSA_get_multi_prime_extra_count := @FC_RSA_get_multi_prime_extra_count; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RSA_get_multi_prime_extra_count_removed)} + if RSA_get_multi_prime_extra_count_removed <= LibVersion then + begin + {$if declared(_RSA_get_multi_prime_extra_count)} + RSA_get_multi_prime_extra_count := @_RSA_get_multi_prime_extra_count; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RSA_get_multi_prime_extra_count_allownil)} + if FuncLoadError then + AFailed.Add('RSA_get_multi_prime_extra_count'); + {$ifend} + end; + + + RSA_get0_crt_params := LoadLibFunction(ADllHandle, RSA_get0_crt_params_procname); + FuncLoadError := not assigned(RSA_get0_crt_params); + if FuncLoadError then + begin + {$if not defined(RSA_get0_crt_params_allownil)} + RSA_get0_crt_params := @ERR_RSA_get0_crt_params; + {$ifend} + {$if declared(RSA_get0_crt_params_introduced)} + if LibVersion < RSA_get0_crt_params_introduced then + begin + {$if declared(FC_RSA_get0_crt_params)} + RSA_get0_crt_params := @FC_RSA_get0_crt_params; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RSA_get0_crt_params_removed)} + if RSA_get0_crt_params_removed <= LibVersion then + begin + {$if declared(_RSA_get0_crt_params)} + RSA_get0_crt_params := @_RSA_get0_crt_params; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RSA_get0_crt_params_allownil)} + if FuncLoadError then + AFailed.Add('RSA_get0_crt_params'); + {$ifend} + end; + + + RSA_get0_n := LoadLibFunction(ADllHandle, RSA_get0_n_procname); + FuncLoadError := not assigned(RSA_get0_n); + if FuncLoadError then + begin + {$if not defined(RSA_get0_n_allownil)} + RSA_get0_n := @ERR_RSA_get0_n; + {$ifend} + {$if declared(RSA_get0_n_introduced)} + if LibVersion < RSA_get0_n_introduced then + begin + {$if declared(FC_RSA_get0_n)} + RSA_get0_n := @FC_RSA_get0_n; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RSA_get0_n_removed)} + if RSA_get0_n_removed <= LibVersion then + begin + {$if declared(_RSA_get0_n)} + RSA_get0_n := @_RSA_get0_n; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RSA_get0_n_allownil)} + if FuncLoadError then + AFailed.Add('RSA_get0_n'); + {$ifend} + end; + + + RSA_get0_e := LoadLibFunction(ADllHandle, RSA_get0_e_procname); + FuncLoadError := not assigned(RSA_get0_e); + if FuncLoadError then + begin + {$if not defined(RSA_get0_e_allownil)} + RSA_get0_e := @ERR_RSA_get0_e; + {$ifend} + {$if declared(RSA_get0_e_introduced)} + if LibVersion < RSA_get0_e_introduced then + begin + {$if declared(FC_RSA_get0_e)} + RSA_get0_e := @FC_RSA_get0_e; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RSA_get0_e_removed)} + if RSA_get0_e_removed <= LibVersion then + begin + {$if declared(_RSA_get0_e)} + RSA_get0_e := @_RSA_get0_e; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RSA_get0_e_allownil)} + if FuncLoadError then + AFailed.Add('RSA_get0_e'); + {$ifend} + end; + + + RSA_get0_d := LoadLibFunction(ADllHandle, RSA_get0_d_procname); + FuncLoadError := not assigned(RSA_get0_d); + if FuncLoadError then + begin + {$if not defined(RSA_get0_d_allownil)} + RSA_get0_d := @ERR_RSA_get0_d; + {$ifend} + {$if declared(RSA_get0_d_introduced)} + if LibVersion < RSA_get0_d_introduced then + begin + {$if declared(FC_RSA_get0_d)} + RSA_get0_d := @FC_RSA_get0_d; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RSA_get0_d_removed)} + if RSA_get0_d_removed <= LibVersion then + begin + {$if declared(_RSA_get0_d)} + RSA_get0_d := @_RSA_get0_d; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RSA_get0_d_allownil)} + if FuncLoadError then + AFailed.Add('RSA_get0_d'); + {$ifend} + end; + + + RSA_get0_p := LoadLibFunction(ADllHandle, RSA_get0_p_procname); + FuncLoadError := not assigned(RSA_get0_p); + if FuncLoadError then + begin + {$if not defined(RSA_get0_p_allownil)} + RSA_get0_p := @ERR_RSA_get0_p; + {$ifend} + {$if declared(RSA_get0_p_introduced)} + if LibVersion < RSA_get0_p_introduced then + begin + {$if declared(FC_RSA_get0_p)} + RSA_get0_p := @FC_RSA_get0_p; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RSA_get0_p_removed)} + if RSA_get0_p_removed <= LibVersion then + begin + {$if declared(_RSA_get0_p)} + RSA_get0_p := @_RSA_get0_p; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RSA_get0_p_allownil)} + if FuncLoadError then + AFailed.Add('RSA_get0_p'); + {$ifend} + end; + + + RSA_get0_q := LoadLibFunction(ADllHandle, RSA_get0_q_procname); + FuncLoadError := not assigned(RSA_get0_q); + if FuncLoadError then + begin + {$if not defined(RSA_get0_q_allownil)} + RSA_get0_q := @ERR_RSA_get0_q; + {$ifend} + {$if declared(RSA_get0_q_introduced)} + if LibVersion < RSA_get0_q_introduced then + begin + {$if declared(FC_RSA_get0_q)} + RSA_get0_q := @FC_RSA_get0_q; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RSA_get0_q_removed)} + if RSA_get0_q_removed <= LibVersion then + begin + {$if declared(_RSA_get0_q)} + RSA_get0_q := @_RSA_get0_q; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RSA_get0_q_allownil)} + if FuncLoadError then + AFailed.Add('RSA_get0_q'); + {$ifend} + end; + + + RSA_get0_dmp1 := LoadLibFunction(ADllHandle, RSA_get0_dmp1_procname); + FuncLoadError := not assigned(RSA_get0_dmp1); + if FuncLoadError then + begin + {$if not defined(RSA_get0_dmp1_allownil)} + RSA_get0_dmp1 := @ERR_RSA_get0_dmp1; + {$ifend} + {$if declared(RSA_get0_dmp1_introduced)} + if LibVersion < RSA_get0_dmp1_introduced then + begin + {$if declared(FC_RSA_get0_dmp1)} + RSA_get0_dmp1 := @FC_RSA_get0_dmp1; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RSA_get0_dmp1_removed)} + if RSA_get0_dmp1_removed <= LibVersion then + begin + {$if declared(_RSA_get0_dmp1)} + RSA_get0_dmp1 := @_RSA_get0_dmp1; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RSA_get0_dmp1_allownil)} + if FuncLoadError then + AFailed.Add('RSA_get0_dmp1'); + {$ifend} + end; + + + RSA_get0_dmq1 := LoadLibFunction(ADllHandle, RSA_get0_dmq1_procname); + FuncLoadError := not assigned(RSA_get0_dmq1); + if FuncLoadError then + begin + {$if not defined(RSA_get0_dmq1_allownil)} + RSA_get0_dmq1 := @ERR_RSA_get0_dmq1; + {$ifend} + {$if declared(RSA_get0_dmq1_introduced)} + if LibVersion < RSA_get0_dmq1_introduced then + begin + {$if declared(FC_RSA_get0_dmq1)} + RSA_get0_dmq1 := @FC_RSA_get0_dmq1; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RSA_get0_dmq1_removed)} + if RSA_get0_dmq1_removed <= LibVersion then + begin + {$if declared(_RSA_get0_dmq1)} + RSA_get0_dmq1 := @_RSA_get0_dmq1; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RSA_get0_dmq1_allownil)} + if FuncLoadError then + AFailed.Add('RSA_get0_dmq1'); + {$ifend} + end; + + + RSA_get0_iqmp := LoadLibFunction(ADllHandle, RSA_get0_iqmp_procname); + FuncLoadError := not assigned(RSA_get0_iqmp); + if FuncLoadError then + begin + {$if not defined(RSA_get0_iqmp_allownil)} + RSA_get0_iqmp := @ERR_RSA_get0_iqmp; + {$ifend} + {$if declared(RSA_get0_iqmp_introduced)} + if LibVersion < RSA_get0_iqmp_introduced then + begin + {$if declared(FC_RSA_get0_iqmp)} + RSA_get0_iqmp := @FC_RSA_get0_iqmp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RSA_get0_iqmp_removed)} + if RSA_get0_iqmp_removed <= LibVersion then + begin + {$if declared(_RSA_get0_iqmp)} + RSA_get0_iqmp := @_RSA_get0_iqmp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RSA_get0_iqmp_allownil)} + if FuncLoadError then + AFailed.Add('RSA_get0_iqmp'); + {$ifend} + end; + + + RSA_clear_flags := LoadLibFunction(ADllHandle, RSA_clear_flags_procname); + FuncLoadError := not assigned(RSA_clear_flags); + if FuncLoadError then + begin + {$if not defined(RSA_clear_flags_allownil)} + RSA_clear_flags := @ERR_RSA_clear_flags; + {$ifend} + {$if declared(RSA_clear_flags_introduced)} + if LibVersion < RSA_clear_flags_introduced then + begin + {$if declared(FC_RSA_clear_flags)} + RSA_clear_flags := @FC_RSA_clear_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RSA_clear_flags_removed)} + if RSA_clear_flags_removed <= LibVersion then + begin + {$if declared(_RSA_clear_flags)} + RSA_clear_flags := @_RSA_clear_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RSA_clear_flags_allownil)} + if FuncLoadError then + AFailed.Add('RSA_clear_flags'); + {$ifend} + end; + + + RSA_test_flags := LoadLibFunction(ADllHandle, RSA_test_flags_procname); + FuncLoadError := not assigned(RSA_test_flags); + if FuncLoadError then + begin + {$if not defined(RSA_test_flags_allownil)} + RSA_test_flags := @ERR_RSA_test_flags; + {$ifend} + {$if declared(RSA_test_flags_introduced)} + if LibVersion < RSA_test_flags_introduced then + begin + {$if declared(FC_RSA_test_flags)} + RSA_test_flags := @FC_RSA_test_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RSA_test_flags_removed)} + if RSA_test_flags_removed <= LibVersion then + begin + {$if declared(_RSA_test_flags)} + RSA_test_flags := @_RSA_test_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RSA_test_flags_allownil)} + if FuncLoadError then + AFailed.Add('RSA_test_flags'); + {$ifend} + end; + + + RSA_set_flags := LoadLibFunction(ADllHandle, RSA_set_flags_procname); + FuncLoadError := not assigned(RSA_set_flags); + if FuncLoadError then + begin + {$if not defined(RSA_set_flags_allownil)} + RSA_set_flags := @ERR_RSA_set_flags; + {$ifend} + {$if declared(RSA_set_flags_introduced)} + if LibVersion < RSA_set_flags_introduced then + begin + {$if declared(FC_RSA_set_flags)} + RSA_set_flags := @FC_RSA_set_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RSA_set_flags_removed)} + if RSA_set_flags_removed <= LibVersion then + begin + {$if declared(_RSA_set_flags)} + RSA_set_flags := @_RSA_set_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RSA_set_flags_allownil)} + if FuncLoadError then + AFailed.Add('RSA_set_flags'); + {$ifend} + end; + + + RSA_get_version := LoadLibFunction(ADllHandle, RSA_get_version_procname); + FuncLoadError := not assigned(RSA_get_version); + if FuncLoadError then + begin + {$if not defined(RSA_get_version_allownil)} + RSA_get_version := @ERR_RSA_get_version; + {$ifend} + {$if declared(RSA_get_version_introduced)} + if LibVersion < RSA_get_version_introduced then + begin + {$if declared(FC_RSA_get_version)} + RSA_get_version := @FC_RSA_get_version; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RSA_get_version_removed)} + if RSA_get_version_removed <= LibVersion then + begin + {$if declared(_RSA_get_version)} + RSA_get_version := @_RSA_get_version; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RSA_get_version_allownil)} + if FuncLoadError then + AFailed.Add('RSA_get_version'); + {$ifend} + end; + + + RSA_get0_engine := LoadLibFunction(ADllHandle, RSA_get0_engine_procname); + FuncLoadError := not assigned(RSA_get0_engine); + if FuncLoadError then + begin + {$if not defined(RSA_get0_engine_allownil)} + RSA_get0_engine := @ERR_RSA_get0_engine; + {$ifend} + {$if declared(RSA_get0_engine_introduced)} + if LibVersion < RSA_get0_engine_introduced then + begin + {$if declared(FC_RSA_get0_engine)} + RSA_get0_engine := @FC_RSA_get0_engine; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RSA_get0_engine_removed)} + if RSA_get0_engine_removed <= LibVersion then + begin + {$if declared(_RSA_get0_engine)} + RSA_get0_engine := @_RSA_get0_engine; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RSA_get0_engine_allownil)} + if FuncLoadError then + AFailed.Add('RSA_get0_engine'); + {$ifend} + end; + + + RSA_generate_key_ex := LoadLibFunction(ADllHandle, RSA_generate_key_ex_procname); + FuncLoadError := not assigned(RSA_generate_key_ex); + if FuncLoadError then + begin + {$if not defined(RSA_generate_key_ex_allownil)} + RSA_generate_key_ex := @ERR_RSA_generate_key_ex; + {$ifend} + {$if declared(RSA_generate_key_ex_introduced)} + if LibVersion < RSA_generate_key_ex_introduced then + begin + {$if declared(FC_RSA_generate_key_ex)} + RSA_generate_key_ex := @FC_RSA_generate_key_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RSA_generate_key_ex_removed)} + if RSA_generate_key_ex_removed <= LibVersion then + begin + {$if declared(_RSA_generate_key_ex)} + RSA_generate_key_ex := @_RSA_generate_key_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RSA_generate_key_ex_allownil)} + if FuncLoadError then + AFailed.Add('RSA_generate_key_ex'); + {$ifend} + end; + + + RSA_generate_multi_prime_key := LoadLibFunction(ADllHandle, RSA_generate_multi_prime_key_procname); + FuncLoadError := not assigned(RSA_generate_multi_prime_key); + if FuncLoadError then + begin + {$if not defined(RSA_generate_multi_prime_key_allownil)} + RSA_generate_multi_prime_key := @ERR_RSA_generate_multi_prime_key; + {$ifend} + {$if declared(RSA_generate_multi_prime_key_introduced)} + if LibVersion < RSA_generate_multi_prime_key_introduced then + begin + {$if declared(FC_RSA_generate_multi_prime_key)} + RSA_generate_multi_prime_key := @FC_RSA_generate_multi_prime_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RSA_generate_multi_prime_key_removed)} + if RSA_generate_multi_prime_key_removed <= LibVersion then + begin + {$if declared(_RSA_generate_multi_prime_key)} + RSA_generate_multi_prime_key := @_RSA_generate_multi_prime_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RSA_generate_multi_prime_key_allownil)} + if FuncLoadError then + AFailed.Add('RSA_generate_multi_prime_key'); + {$ifend} + end; + + + RSA_X931_derive_ex := LoadLibFunction(ADllHandle, RSA_X931_derive_ex_procname); + FuncLoadError := not assigned(RSA_X931_derive_ex); + if FuncLoadError then + begin + {$if not defined(RSA_X931_derive_ex_allownil)} + RSA_X931_derive_ex := @ERR_RSA_X931_derive_ex; + {$ifend} + {$if declared(RSA_X931_derive_ex_introduced)} + if LibVersion < RSA_X931_derive_ex_introduced then + begin + {$if declared(FC_RSA_X931_derive_ex)} + RSA_X931_derive_ex := @FC_RSA_X931_derive_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RSA_X931_derive_ex_removed)} + if RSA_X931_derive_ex_removed <= LibVersion then + begin + {$if declared(_RSA_X931_derive_ex)} + RSA_X931_derive_ex := @_RSA_X931_derive_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RSA_X931_derive_ex_allownil)} + if FuncLoadError then + AFailed.Add('RSA_X931_derive_ex'); + {$ifend} + end; + + + RSA_X931_generate_key_ex := LoadLibFunction(ADllHandle, RSA_X931_generate_key_ex_procname); + FuncLoadError := not assigned(RSA_X931_generate_key_ex); + if FuncLoadError then + begin + {$if not defined(RSA_X931_generate_key_ex_allownil)} + RSA_X931_generate_key_ex := @ERR_RSA_X931_generate_key_ex; + {$ifend} + {$if declared(RSA_X931_generate_key_ex_introduced)} + if LibVersion < RSA_X931_generate_key_ex_introduced then + begin + {$if declared(FC_RSA_X931_generate_key_ex)} + RSA_X931_generate_key_ex := @FC_RSA_X931_generate_key_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RSA_X931_generate_key_ex_removed)} + if RSA_X931_generate_key_ex_removed <= LibVersion then + begin + {$if declared(_RSA_X931_generate_key_ex)} + RSA_X931_generate_key_ex := @_RSA_X931_generate_key_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RSA_X931_generate_key_ex_allownil)} + if FuncLoadError then + AFailed.Add('RSA_X931_generate_key_ex'); + {$ifend} + end; + + + RSA_check_key := LoadLibFunction(ADllHandle, RSA_check_key_procname); + FuncLoadError := not assigned(RSA_check_key); + if FuncLoadError then + begin + {$if not defined(RSA_check_key_allownil)} + RSA_check_key := @ERR_RSA_check_key; + {$ifend} + {$if declared(RSA_check_key_introduced)} + if LibVersion < RSA_check_key_introduced then + begin + {$if declared(FC_RSA_check_key)} + RSA_check_key := @FC_RSA_check_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RSA_check_key_removed)} + if RSA_check_key_removed <= LibVersion then + begin + {$if declared(_RSA_check_key)} + RSA_check_key := @_RSA_check_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RSA_check_key_allownil)} + if FuncLoadError then + AFailed.Add('RSA_check_key'); + {$ifend} + end; + + + RSA_check_key_ex := LoadLibFunction(ADllHandle, RSA_check_key_ex_procname); + FuncLoadError := not assigned(RSA_check_key_ex); + if FuncLoadError then + begin + {$if not defined(RSA_check_key_ex_allownil)} + RSA_check_key_ex := @ERR_RSA_check_key_ex; + {$ifend} + {$if declared(RSA_check_key_ex_introduced)} + if LibVersion < RSA_check_key_ex_introduced then + begin + {$if declared(FC_RSA_check_key_ex)} + RSA_check_key_ex := @FC_RSA_check_key_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RSA_check_key_ex_removed)} + if RSA_check_key_ex_removed <= LibVersion then + begin + {$if declared(_RSA_check_key_ex)} + RSA_check_key_ex := @_RSA_check_key_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RSA_check_key_ex_allownil)} + if FuncLoadError then + AFailed.Add('RSA_check_key_ex'); + {$ifend} + end; + + + RSA_public_encrypt := LoadLibFunction(ADllHandle, RSA_public_encrypt_procname); + FuncLoadError := not assigned(RSA_public_encrypt); + if FuncLoadError then + begin + {$if not defined(RSA_public_encrypt_allownil)} + RSA_public_encrypt := @ERR_RSA_public_encrypt; + {$ifend} + {$if declared(RSA_public_encrypt_introduced)} + if LibVersion < RSA_public_encrypt_introduced then + begin + {$if declared(FC_RSA_public_encrypt)} + RSA_public_encrypt := @FC_RSA_public_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RSA_public_encrypt_removed)} + if RSA_public_encrypt_removed <= LibVersion then + begin + {$if declared(_RSA_public_encrypt)} + RSA_public_encrypt := @_RSA_public_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RSA_public_encrypt_allownil)} + if FuncLoadError then + AFailed.Add('RSA_public_encrypt'); + {$ifend} + end; + + + RSA_private_encrypt := LoadLibFunction(ADllHandle, RSA_private_encrypt_procname); + FuncLoadError := not assigned(RSA_private_encrypt); + if FuncLoadError then + begin + {$if not defined(RSA_private_encrypt_allownil)} + RSA_private_encrypt := @ERR_RSA_private_encrypt; + {$ifend} + {$if declared(RSA_private_encrypt_introduced)} + if LibVersion < RSA_private_encrypt_introduced then + begin + {$if declared(FC_RSA_private_encrypt)} + RSA_private_encrypt := @FC_RSA_private_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RSA_private_encrypt_removed)} + if RSA_private_encrypt_removed <= LibVersion then + begin + {$if declared(_RSA_private_encrypt)} + RSA_private_encrypt := @_RSA_private_encrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RSA_private_encrypt_allownil)} + if FuncLoadError then + AFailed.Add('RSA_private_encrypt'); + {$ifend} + end; + + + RSA_public_decrypt := LoadLibFunction(ADllHandle, RSA_public_decrypt_procname); + FuncLoadError := not assigned(RSA_public_decrypt); + if FuncLoadError then + begin + {$if not defined(RSA_public_decrypt_allownil)} + RSA_public_decrypt := @ERR_RSA_public_decrypt; + {$ifend} + {$if declared(RSA_public_decrypt_introduced)} + if LibVersion < RSA_public_decrypt_introduced then + begin + {$if declared(FC_RSA_public_decrypt)} + RSA_public_decrypt := @FC_RSA_public_decrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RSA_public_decrypt_removed)} + if RSA_public_decrypt_removed <= LibVersion then + begin + {$if declared(_RSA_public_decrypt)} + RSA_public_decrypt := @_RSA_public_decrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RSA_public_decrypt_allownil)} + if FuncLoadError then + AFailed.Add('RSA_public_decrypt'); + {$ifend} + end; + + + RSA_private_decrypt := LoadLibFunction(ADllHandle, RSA_private_decrypt_procname); + FuncLoadError := not assigned(RSA_private_decrypt); + if FuncLoadError then + begin + {$if not defined(RSA_private_decrypt_allownil)} + RSA_private_decrypt := @ERR_RSA_private_decrypt; + {$ifend} + {$if declared(RSA_private_decrypt_introduced)} + if LibVersion < RSA_private_decrypt_introduced then + begin + {$if declared(FC_RSA_private_decrypt)} + RSA_private_decrypt := @FC_RSA_private_decrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RSA_private_decrypt_removed)} + if RSA_private_decrypt_removed <= LibVersion then + begin + {$if declared(_RSA_private_decrypt)} + RSA_private_decrypt := @_RSA_private_decrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RSA_private_decrypt_allownil)} + if FuncLoadError then + AFailed.Add('RSA_private_decrypt'); + {$ifend} + end; + + + RSA_free := LoadLibFunction(ADllHandle, RSA_free_procname); + FuncLoadError := not assigned(RSA_free); + if FuncLoadError then + begin + {$if not defined(RSA_free_allownil)} + RSA_free := @ERR_RSA_free; + {$ifend} + {$if declared(RSA_free_introduced)} + if LibVersion < RSA_free_introduced then + begin + {$if declared(FC_RSA_free)} + RSA_free := @FC_RSA_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RSA_free_removed)} + if RSA_free_removed <= LibVersion then + begin + {$if declared(_RSA_free)} + RSA_free := @_RSA_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RSA_free_allownil)} + if FuncLoadError then + AFailed.Add('RSA_free'); + {$ifend} + end; + + + RSA_up_ref := LoadLibFunction(ADllHandle, RSA_up_ref_procname); + FuncLoadError := not assigned(RSA_up_ref); + if FuncLoadError then + begin + {$if not defined(RSA_up_ref_allownil)} + RSA_up_ref := @ERR_RSA_up_ref; + {$ifend} + {$if declared(RSA_up_ref_introduced)} + if LibVersion < RSA_up_ref_introduced then + begin + {$if declared(FC_RSA_up_ref)} + RSA_up_ref := @FC_RSA_up_ref; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RSA_up_ref_removed)} + if RSA_up_ref_removed <= LibVersion then + begin + {$if declared(_RSA_up_ref)} + RSA_up_ref := @_RSA_up_ref; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RSA_up_ref_allownil)} + if FuncLoadError then + AFailed.Add('RSA_up_ref'); + {$ifend} + end; + + + RSA_flags := LoadLibFunction(ADllHandle, RSA_flags_procname); + FuncLoadError := not assigned(RSA_flags); + if FuncLoadError then + begin + {$if not defined(RSA_flags_allownil)} + RSA_flags := @ERR_RSA_flags; + {$ifend} + {$if declared(RSA_flags_introduced)} + if LibVersion < RSA_flags_introduced then + begin + {$if declared(FC_RSA_flags)} + RSA_flags := @FC_RSA_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RSA_flags_removed)} + if RSA_flags_removed <= LibVersion then + begin + {$if declared(_RSA_flags)} + RSA_flags := @_RSA_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RSA_flags_allownil)} + if FuncLoadError then + AFailed.Add('RSA_flags'); + {$ifend} + end; + + + RSA_set_default_method := LoadLibFunction(ADllHandle, RSA_set_default_method_procname); + FuncLoadError := not assigned(RSA_set_default_method); + if FuncLoadError then + begin + {$if not defined(RSA_set_default_method_allownil)} + RSA_set_default_method := @ERR_RSA_set_default_method; + {$ifend} + {$if declared(RSA_set_default_method_introduced)} + if LibVersion < RSA_set_default_method_introduced then + begin + {$if declared(FC_RSA_set_default_method)} + RSA_set_default_method := @FC_RSA_set_default_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RSA_set_default_method_removed)} + if RSA_set_default_method_removed <= LibVersion then + begin + {$if declared(_RSA_set_default_method)} + RSA_set_default_method := @_RSA_set_default_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RSA_set_default_method_allownil)} + if FuncLoadError then + AFailed.Add('RSA_set_default_method'); + {$ifend} + end; + + + RSA_get_default_method := LoadLibFunction(ADllHandle, RSA_get_default_method_procname); + FuncLoadError := not assigned(RSA_get_default_method); + if FuncLoadError then + begin + {$if not defined(RSA_get_default_method_allownil)} + RSA_get_default_method := @ERR_RSA_get_default_method; + {$ifend} + {$if declared(RSA_get_default_method_introduced)} + if LibVersion < RSA_get_default_method_introduced then + begin + {$if declared(FC_RSA_get_default_method)} + RSA_get_default_method := @FC_RSA_get_default_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RSA_get_default_method_removed)} + if RSA_get_default_method_removed <= LibVersion then + begin + {$if declared(_RSA_get_default_method)} + RSA_get_default_method := @_RSA_get_default_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RSA_get_default_method_allownil)} + if FuncLoadError then + AFailed.Add('RSA_get_default_method'); + {$ifend} + end; + + + RSA_null_method := LoadLibFunction(ADllHandle, RSA_null_method_procname); + FuncLoadError := not assigned(RSA_null_method); + if FuncLoadError then + begin + {$if not defined(RSA_null_method_allownil)} + RSA_null_method := @ERR_RSA_null_method; + {$ifend} + {$if declared(RSA_null_method_introduced)} + if LibVersion < RSA_null_method_introduced then + begin + {$if declared(FC_RSA_null_method)} + RSA_null_method := @FC_RSA_null_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RSA_null_method_removed)} + if RSA_null_method_removed <= LibVersion then + begin + {$if declared(_RSA_null_method)} + RSA_null_method := @_RSA_null_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RSA_null_method_allownil)} + if FuncLoadError then + AFailed.Add('RSA_null_method'); + {$ifend} + end; + + + RSA_get_method := LoadLibFunction(ADllHandle, RSA_get_method_procname); + FuncLoadError := not assigned(RSA_get_method); + if FuncLoadError then + begin + {$if not defined(RSA_get_method_allownil)} + RSA_get_method := @ERR_RSA_get_method; + {$ifend} + {$if declared(RSA_get_method_introduced)} + if LibVersion < RSA_get_method_introduced then + begin + {$if declared(FC_RSA_get_method)} + RSA_get_method := @FC_RSA_get_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RSA_get_method_removed)} + if RSA_get_method_removed <= LibVersion then + begin + {$if declared(_RSA_get_method)} + RSA_get_method := @_RSA_get_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RSA_get_method_allownil)} + if FuncLoadError then + AFailed.Add('RSA_get_method'); + {$ifend} + end; + + + RSA_set_method := LoadLibFunction(ADllHandle, RSA_set_method_procname); + FuncLoadError := not assigned(RSA_set_method); + if FuncLoadError then + begin + {$if not defined(RSA_set_method_allownil)} + RSA_set_method := @ERR_RSA_set_method; + {$ifend} + {$if declared(RSA_set_method_introduced)} + if LibVersion < RSA_set_method_introduced then + begin + {$if declared(FC_RSA_set_method)} + RSA_set_method := @FC_RSA_set_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RSA_set_method_removed)} + if RSA_set_method_removed <= LibVersion then + begin + {$if declared(_RSA_set_method)} + RSA_set_method := @_RSA_set_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RSA_set_method_allownil)} + if FuncLoadError then + AFailed.Add('RSA_set_method'); + {$ifend} + end; + + + RSA_PKCS1_OpenSSL := LoadLibFunction(ADllHandle, RSA_PKCS1_OpenSSL_procname); + FuncLoadError := not assigned(RSA_PKCS1_OpenSSL); + if FuncLoadError then + begin + {$if not defined(RSA_PKCS1_OpenSSL_allownil)} + RSA_PKCS1_OpenSSL := @ERR_RSA_PKCS1_OpenSSL; + {$ifend} + {$if declared(RSA_PKCS1_OpenSSL_introduced)} + if LibVersion < RSA_PKCS1_OpenSSL_introduced then + begin + {$if declared(FC_RSA_PKCS1_OpenSSL)} + RSA_PKCS1_OpenSSL := @FC_RSA_PKCS1_OpenSSL; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RSA_PKCS1_OpenSSL_removed)} + if RSA_PKCS1_OpenSSL_removed <= LibVersion then + begin + {$if declared(_RSA_PKCS1_OpenSSL)} + RSA_PKCS1_OpenSSL := @_RSA_PKCS1_OpenSSL; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RSA_PKCS1_OpenSSL_allownil)} + if FuncLoadError then + AFailed.Add('RSA_PKCS1_OpenSSL'); + {$ifend} + end; + + + RSA_pkey_ctx_ctrl := LoadLibFunction(ADllHandle, RSA_pkey_ctx_ctrl_procname); + FuncLoadError := not assigned(RSA_pkey_ctx_ctrl); + if FuncLoadError then + begin + {$if not defined(RSA_pkey_ctx_ctrl_allownil)} + RSA_pkey_ctx_ctrl := @ERR_RSA_pkey_ctx_ctrl; + {$ifend} + {$if declared(RSA_pkey_ctx_ctrl_introduced)} + if LibVersion < RSA_pkey_ctx_ctrl_introduced then + begin + {$if declared(FC_RSA_pkey_ctx_ctrl)} + RSA_pkey_ctx_ctrl := @FC_RSA_pkey_ctx_ctrl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RSA_pkey_ctx_ctrl_removed)} + if RSA_pkey_ctx_ctrl_removed <= LibVersion then + begin + {$if declared(_RSA_pkey_ctx_ctrl)} + RSA_pkey_ctx_ctrl := @_RSA_pkey_ctx_ctrl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RSA_pkey_ctx_ctrl_allownil)} + if FuncLoadError then + AFailed.Add('RSA_pkey_ctx_ctrl'); + {$ifend} + end; + + + RSA_print := LoadLibFunction(ADllHandle, RSA_print_procname); + FuncLoadError := not assigned(RSA_print); + if FuncLoadError then + begin + {$if not defined(RSA_print_allownil)} + RSA_print := @ERR_RSA_print; + {$ifend} + {$if declared(RSA_print_introduced)} + if LibVersion < RSA_print_introduced then + begin + {$if declared(FC_RSA_print)} + RSA_print := @FC_RSA_print; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RSA_print_removed)} + if RSA_print_removed <= LibVersion then + begin + {$if declared(_RSA_print)} + RSA_print := @_RSA_print; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RSA_print_allownil)} + if FuncLoadError then + AFailed.Add('RSA_print'); + {$ifend} + end; + + + RSA_sign := LoadLibFunction(ADllHandle, RSA_sign_procname); + FuncLoadError := not assigned(RSA_sign); + if FuncLoadError then + begin + {$if not defined(RSA_sign_allownil)} + RSA_sign := @ERR_RSA_sign; + {$ifend} + {$if declared(RSA_sign_introduced)} + if LibVersion < RSA_sign_introduced then + begin + {$if declared(FC_RSA_sign)} + RSA_sign := @FC_RSA_sign; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RSA_sign_removed)} + if RSA_sign_removed <= LibVersion then + begin + {$if declared(_RSA_sign)} + RSA_sign := @_RSA_sign; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RSA_sign_allownil)} + if FuncLoadError then + AFailed.Add('RSA_sign'); + {$ifend} + end; + + + RSA_verify := LoadLibFunction(ADllHandle, RSA_verify_procname); + FuncLoadError := not assigned(RSA_verify); + if FuncLoadError then + begin + {$if not defined(RSA_verify_allownil)} + RSA_verify := @ERR_RSA_verify; + {$ifend} + {$if declared(RSA_verify_introduced)} + if LibVersion < RSA_verify_introduced then + begin + {$if declared(FC_RSA_verify)} + RSA_verify := @FC_RSA_verify; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RSA_verify_removed)} + if RSA_verify_removed <= LibVersion then + begin + {$if declared(_RSA_verify)} + RSA_verify := @_RSA_verify; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RSA_verify_allownil)} + if FuncLoadError then + AFailed.Add('RSA_verify'); + {$ifend} + end; + + + RSA_sign_ASN1_OCTET_STRING := LoadLibFunction(ADllHandle, RSA_sign_ASN1_OCTET_STRING_procname); + FuncLoadError := not assigned(RSA_sign_ASN1_OCTET_STRING); + if FuncLoadError then + begin + {$if not defined(RSA_sign_ASN1_OCTET_STRING_allownil)} + RSA_sign_ASN1_OCTET_STRING := @ERR_RSA_sign_ASN1_OCTET_STRING; + {$ifend} + {$if declared(RSA_sign_ASN1_OCTET_STRING_introduced)} + if LibVersion < RSA_sign_ASN1_OCTET_STRING_introduced then + begin + {$if declared(FC_RSA_sign_ASN1_OCTET_STRING)} + RSA_sign_ASN1_OCTET_STRING := @FC_RSA_sign_ASN1_OCTET_STRING; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RSA_sign_ASN1_OCTET_STRING_removed)} + if RSA_sign_ASN1_OCTET_STRING_removed <= LibVersion then + begin + {$if declared(_RSA_sign_ASN1_OCTET_STRING)} + RSA_sign_ASN1_OCTET_STRING := @_RSA_sign_ASN1_OCTET_STRING; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RSA_sign_ASN1_OCTET_STRING_allownil)} + if FuncLoadError then + AFailed.Add('RSA_sign_ASN1_OCTET_STRING'); + {$ifend} + end; + + + RSA_verify_ASN1_OCTET_STRING := LoadLibFunction(ADllHandle, RSA_verify_ASN1_OCTET_STRING_procname); + FuncLoadError := not assigned(RSA_verify_ASN1_OCTET_STRING); + if FuncLoadError then + begin + {$if not defined(RSA_verify_ASN1_OCTET_STRING_allownil)} + RSA_verify_ASN1_OCTET_STRING := @ERR_RSA_verify_ASN1_OCTET_STRING; + {$ifend} + {$if declared(RSA_verify_ASN1_OCTET_STRING_introduced)} + if LibVersion < RSA_verify_ASN1_OCTET_STRING_introduced then + begin + {$if declared(FC_RSA_verify_ASN1_OCTET_STRING)} + RSA_verify_ASN1_OCTET_STRING := @FC_RSA_verify_ASN1_OCTET_STRING; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RSA_verify_ASN1_OCTET_STRING_removed)} + if RSA_verify_ASN1_OCTET_STRING_removed <= LibVersion then + begin + {$if declared(_RSA_verify_ASN1_OCTET_STRING)} + RSA_verify_ASN1_OCTET_STRING := @_RSA_verify_ASN1_OCTET_STRING; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RSA_verify_ASN1_OCTET_STRING_allownil)} + if FuncLoadError then + AFailed.Add('RSA_verify_ASN1_OCTET_STRING'); + {$ifend} + end; + + + RSA_blinding_on := LoadLibFunction(ADllHandle, RSA_blinding_on_procname); + FuncLoadError := not assigned(RSA_blinding_on); + if FuncLoadError then + begin + {$if not defined(RSA_blinding_on_allownil)} + RSA_blinding_on := @ERR_RSA_blinding_on; + {$ifend} + {$if declared(RSA_blinding_on_introduced)} + if LibVersion < RSA_blinding_on_introduced then + begin + {$if declared(FC_RSA_blinding_on)} + RSA_blinding_on := @FC_RSA_blinding_on; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RSA_blinding_on_removed)} + if RSA_blinding_on_removed <= LibVersion then + begin + {$if declared(_RSA_blinding_on)} + RSA_blinding_on := @_RSA_blinding_on; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RSA_blinding_on_allownil)} + if FuncLoadError then + AFailed.Add('RSA_blinding_on'); + {$ifend} + end; + + + RSA_blinding_off := LoadLibFunction(ADllHandle, RSA_blinding_off_procname); + FuncLoadError := not assigned(RSA_blinding_off); + if FuncLoadError then + begin + {$if not defined(RSA_blinding_off_allownil)} + RSA_blinding_off := @ERR_RSA_blinding_off; + {$ifend} + {$if declared(RSA_blinding_off_introduced)} + if LibVersion < RSA_blinding_off_introduced then + begin + {$if declared(FC_RSA_blinding_off)} + RSA_blinding_off := @FC_RSA_blinding_off; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RSA_blinding_off_removed)} + if RSA_blinding_off_removed <= LibVersion then + begin + {$if declared(_RSA_blinding_off)} + RSA_blinding_off := @_RSA_blinding_off; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RSA_blinding_off_allownil)} + if FuncLoadError then + AFailed.Add('RSA_blinding_off'); + {$ifend} + end; + + + RSA_setup_blinding := LoadLibFunction(ADllHandle, RSA_setup_blinding_procname); + FuncLoadError := not assigned(RSA_setup_blinding); + if FuncLoadError then + begin + {$if not defined(RSA_setup_blinding_allownil)} + RSA_setup_blinding := @ERR_RSA_setup_blinding; + {$ifend} + {$if declared(RSA_setup_blinding_introduced)} + if LibVersion < RSA_setup_blinding_introduced then + begin + {$if declared(FC_RSA_setup_blinding)} + RSA_setup_blinding := @FC_RSA_setup_blinding; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RSA_setup_blinding_removed)} + if RSA_setup_blinding_removed <= LibVersion then + begin + {$if declared(_RSA_setup_blinding)} + RSA_setup_blinding := @_RSA_setup_blinding; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RSA_setup_blinding_allownil)} + if FuncLoadError then + AFailed.Add('RSA_setup_blinding'); + {$ifend} + end; + + + RSA_padding_add_PKCS1_type_1 := LoadLibFunction(ADllHandle, RSA_padding_add_PKCS1_type_1_procname); + FuncLoadError := not assigned(RSA_padding_add_PKCS1_type_1); + if FuncLoadError then + begin + {$if not defined(RSA_padding_add_PKCS1_type_1_allownil)} + RSA_padding_add_PKCS1_type_1 := @ERR_RSA_padding_add_PKCS1_type_1; + {$ifend} + {$if declared(RSA_padding_add_PKCS1_type_1_introduced)} + if LibVersion < RSA_padding_add_PKCS1_type_1_introduced then + begin + {$if declared(FC_RSA_padding_add_PKCS1_type_1)} + RSA_padding_add_PKCS1_type_1 := @FC_RSA_padding_add_PKCS1_type_1; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RSA_padding_add_PKCS1_type_1_removed)} + if RSA_padding_add_PKCS1_type_1_removed <= LibVersion then + begin + {$if declared(_RSA_padding_add_PKCS1_type_1)} + RSA_padding_add_PKCS1_type_1 := @_RSA_padding_add_PKCS1_type_1; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RSA_padding_add_PKCS1_type_1_allownil)} + if FuncLoadError then + AFailed.Add('RSA_padding_add_PKCS1_type_1'); + {$ifend} + end; + + + RSA_padding_check_PKCS1_type_1 := LoadLibFunction(ADllHandle, RSA_padding_check_PKCS1_type_1_procname); + FuncLoadError := not assigned(RSA_padding_check_PKCS1_type_1); + if FuncLoadError then + begin + {$if not defined(RSA_padding_check_PKCS1_type_1_allownil)} + RSA_padding_check_PKCS1_type_1 := @ERR_RSA_padding_check_PKCS1_type_1; + {$ifend} + {$if declared(RSA_padding_check_PKCS1_type_1_introduced)} + if LibVersion < RSA_padding_check_PKCS1_type_1_introduced then + begin + {$if declared(FC_RSA_padding_check_PKCS1_type_1)} + RSA_padding_check_PKCS1_type_1 := @FC_RSA_padding_check_PKCS1_type_1; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RSA_padding_check_PKCS1_type_1_removed)} + if RSA_padding_check_PKCS1_type_1_removed <= LibVersion then + begin + {$if declared(_RSA_padding_check_PKCS1_type_1)} + RSA_padding_check_PKCS1_type_1 := @_RSA_padding_check_PKCS1_type_1; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RSA_padding_check_PKCS1_type_1_allownil)} + if FuncLoadError then + AFailed.Add('RSA_padding_check_PKCS1_type_1'); + {$ifend} + end; + + + RSA_padding_add_PKCS1_type_2 := LoadLibFunction(ADllHandle, RSA_padding_add_PKCS1_type_2_procname); + FuncLoadError := not assigned(RSA_padding_add_PKCS1_type_2); + if FuncLoadError then + begin + {$if not defined(RSA_padding_add_PKCS1_type_2_allownil)} + RSA_padding_add_PKCS1_type_2 := @ERR_RSA_padding_add_PKCS1_type_2; + {$ifend} + {$if declared(RSA_padding_add_PKCS1_type_2_introduced)} + if LibVersion < RSA_padding_add_PKCS1_type_2_introduced then + begin + {$if declared(FC_RSA_padding_add_PKCS1_type_2)} + RSA_padding_add_PKCS1_type_2 := @FC_RSA_padding_add_PKCS1_type_2; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RSA_padding_add_PKCS1_type_2_removed)} + if RSA_padding_add_PKCS1_type_2_removed <= LibVersion then + begin + {$if declared(_RSA_padding_add_PKCS1_type_2)} + RSA_padding_add_PKCS1_type_2 := @_RSA_padding_add_PKCS1_type_2; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RSA_padding_add_PKCS1_type_2_allownil)} + if FuncLoadError then + AFailed.Add('RSA_padding_add_PKCS1_type_2'); + {$ifend} + end; + + + RSA_padding_check_PKCS1_type_2 := LoadLibFunction(ADllHandle, RSA_padding_check_PKCS1_type_2_procname); + FuncLoadError := not assigned(RSA_padding_check_PKCS1_type_2); + if FuncLoadError then + begin + {$if not defined(RSA_padding_check_PKCS1_type_2_allownil)} + RSA_padding_check_PKCS1_type_2 := @ERR_RSA_padding_check_PKCS1_type_2; + {$ifend} + {$if declared(RSA_padding_check_PKCS1_type_2_introduced)} + if LibVersion < RSA_padding_check_PKCS1_type_2_introduced then + begin + {$if declared(FC_RSA_padding_check_PKCS1_type_2)} + RSA_padding_check_PKCS1_type_2 := @FC_RSA_padding_check_PKCS1_type_2; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RSA_padding_check_PKCS1_type_2_removed)} + if RSA_padding_check_PKCS1_type_2_removed <= LibVersion then + begin + {$if declared(_RSA_padding_check_PKCS1_type_2)} + RSA_padding_check_PKCS1_type_2 := @_RSA_padding_check_PKCS1_type_2; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RSA_padding_check_PKCS1_type_2_allownil)} + if FuncLoadError then + AFailed.Add('RSA_padding_check_PKCS1_type_2'); + {$ifend} + end; + + + PKCS1_MGF1 := LoadLibFunction(ADllHandle, PKCS1_MGF1_procname); + FuncLoadError := not assigned(PKCS1_MGF1); + if FuncLoadError then + begin + {$if not defined(PKCS1_MGF1_allownil)} + PKCS1_MGF1 := @ERR_PKCS1_MGF1; + {$ifend} + {$if declared(PKCS1_MGF1_introduced)} + if LibVersion < PKCS1_MGF1_introduced then + begin + {$if declared(FC_PKCS1_MGF1)} + PKCS1_MGF1 := @FC_PKCS1_MGF1; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS1_MGF1_removed)} + if PKCS1_MGF1_removed <= LibVersion then + begin + {$if declared(_PKCS1_MGF1)} + PKCS1_MGF1 := @_PKCS1_MGF1; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS1_MGF1_allownil)} + if FuncLoadError then + AFailed.Add('PKCS1_MGF1'); + {$ifend} + end; + + + RSA_padding_add_PKCS1_OAEP := LoadLibFunction(ADllHandle, RSA_padding_add_PKCS1_OAEP_procname); + FuncLoadError := not assigned(RSA_padding_add_PKCS1_OAEP); + if FuncLoadError then + begin + {$if not defined(RSA_padding_add_PKCS1_OAEP_allownil)} + RSA_padding_add_PKCS1_OAEP := @ERR_RSA_padding_add_PKCS1_OAEP; + {$ifend} + {$if declared(RSA_padding_add_PKCS1_OAEP_introduced)} + if LibVersion < RSA_padding_add_PKCS1_OAEP_introduced then + begin + {$if declared(FC_RSA_padding_add_PKCS1_OAEP)} + RSA_padding_add_PKCS1_OAEP := @FC_RSA_padding_add_PKCS1_OAEP; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RSA_padding_add_PKCS1_OAEP_removed)} + if RSA_padding_add_PKCS1_OAEP_removed <= LibVersion then + begin + {$if declared(_RSA_padding_add_PKCS1_OAEP)} + RSA_padding_add_PKCS1_OAEP := @_RSA_padding_add_PKCS1_OAEP; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RSA_padding_add_PKCS1_OAEP_allownil)} + if FuncLoadError then + AFailed.Add('RSA_padding_add_PKCS1_OAEP'); + {$ifend} + end; + + + RSA_padding_check_PKCS1_OAEP := LoadLibFunction(ADllHandle, RSA_padding_check_PKCS1_OAEP_procname); + FuncLoadError := not assigned(RSA_padding_check_PKCS1_OAEP); + if FuncLoadError then + begin + {$if not defined(RSA_padding_check_PKCS1_OAEP_allownil)} + RSA_padding_check_PKCS1_OAEP := @ERR_RSA_padding_check_PKCS1_OAEP; + {$ifend} + {$if declared(RSA_padding_check_PKCS1_OAEP_introduced)} + if LibVersion < RSA_padding_check_PKCS1_OAEP_introduced then + begin + {$if declared(FC_RSA_padding_check_PKCS1_OAEP)} + RSA_padding_check_PKCS1_OAEP := @FC_RSA_padding_check_PKCS1_OAEP; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RSA_padding_check_PKCS1_OAEP_removed)} + if RSA_padding_check_PKCS1_OAEP_removed <= LibVersion then + begin + {$if declared(_RSA_padding_check_PKCS1_OAEP)} + RSA_padding_check_PKCS1_OAEP := @_RSA_padding_check_PKCS1_OAEP; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RSA_padding_check_PKCS1_OAEP_allownil)} + if FuncLoadError then + AFailed.Add('RSA_padding_check_PKCS1_OAEP'); + {$ifend} + end; + + + RSA_padding_add_PKCS1_OAEP_mgf1 := LoadLibFunction(ADllHandle, RSA_padding_add_PKCS1_OAEP_mgf1_procname); + FuncLoadError := not assigned(RSA_padding_add_PKCS1_OAEP_mgf1); + if FuncLoadError then + begin + {$if not defined(RSA_padding_add_PKCS1_OAEP_mgf1_allownil)} + RSA_padding_add_PKCS1_OAEP_mgf1 := @ERR_RSA_padding_add_PKCS1_OAEP_mgf1; + {$ifend} + {$if declared(RSA_padding_add_PKCS1_OAEP_mgf1_introduced)} + if LibVersion < RSA_padding_add_PKCS1_OAEP_mgf1_introduced then + begin + {$if declared(FC_RSA_padding_add_PKCS1_OAEP_mgf1)} + RSA_padding_add_PKCS1_OAEP_mgf1 := @FC_RSA_padding_add_PKCS1_OAEP_mgf1; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RSA_padding_add_PKCS1_OAEP_mgf1_removed)} + if RSA_padding_add_PKCS1_OAEP_mgf1_removed <= LibVersion then + begin + {$if declared(_RSA_padding_add_PKCS1_OAEP_mgf1)} + RSA_padding_add_PKCS1_OAEP_mgf1 := @_RSA_padding_add_PKCS1_OAEP_mgf1; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RSA_padding_add_PKCS1_OAEP_mgf1_allownil)} + if FuncLoadError then + AFailed.Add('RSA_padding_add_PKCS1_OAEP_mgf1'); + {$ifend} + end; + + + RSA_padding_check_PKCS1_OAEP_mgf1 := LoadLibFunction(ADllHandle, RSA_padding_check_PKCS1_OAEP_mgf1_procname); + FuncLoadError := not assigned(RSA_padding_check_PKCS1_OAEP_mgf1); + if FuncLoadError then + begin + {$if not defined(RSA_padding_check_PKCS1_OAEP_mgf1_allownil)} + RSA_padding_check_PKCS1_OAEP_mgf1 := @ERR_RSA_padding_check_PKCS1_OAEP_mgf1; + {$ifend} + {$if declared(RSA_padding_check_PKCS1_OAEP_mgf1_introduced)} + if LibVersion < RSA_padding_check_PKCS1_OAEP_mgf1_introduced then + begin + {$if declared(FC_RSA_padding_check_PKCS1_OAEP_mgf1)} + RSA_padding_check_PKCS1_OAEP_mgf1 := @FC_RSA_padding_check_PKCS1_OAEP_mgf1; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RSA_padding_check_PKCS1_OAEP_mgf1_removed)} + if RSA_padding_check_PKCS1_OAEP_mgf1_removed <= LibVersion then + begin + {$if declared(_RSA_padding_check_PKCS1_OAEP_mgf1)} + RSA_padding_check_PKCS1_OAEP_mgf1 := @_RSA_padding_check_PKCS1_OAEP_mgf1; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RSA_padding_check_PKCS1_OAEP_mgf1_allownil)} + if FuncLoadError then + AFailed.Add('RSA_padding_check_PKCS1_OAEP_mgf1'); + {$ifend} + end; + + +// RSA_padding_add_SSLv23 := LoadLibFunction(ADllHandle, RSA_padding_add_SSLv23_procname); +// FuncLoadError := not assigned(RSA_padding_add_SSLv23); +// if FuncLoadError then +// begin +// {$if not defined(RSA_padding_add_SSLv23_allownil)} +// RSA_padding_add_SSLv23 := @ERR_RSA_padding_add_SSLv23; +// {$ifend} +// {$if declared(RSA_padding_add_SSLv23_introduced)} +// if LibVersion < RSA_padding_add_SSLv23_introduced then +// begin +// {$if declared(FC_RSA_padding_add_SSLv23)} +// RSA_padding_add_SSLv23 := @FC_RSA_padding_add_SSLv23; +// {$ifend} +// FuncLoadError := false; +// end; +// {$ifend} +// {$if declared(RSA_padding_add_SSLv23_removed)} +// if RSA_padding_add_SSLv23_removed <= LibVersion then +// begin +// {$if declared(_RSA_padding_add_SSLv23)} +// RSA_padding_add_SSLv23 := @_RSA_padding_add_SSLv23; +// {$ifend} +// FuncLoadError := false; +// end; +// {$ifend} +// {$if not defined(RSA_padding_add_SSLv23_allownil)} +// if FuncLoadError then +// AFailed.Add('RSA_padding_add_SSLv23'); +// {$ifend} +// end; + + +// RSA_padding_check_SSLv23 := LoadLibFunction(ADllHandle, RSA_padding_check_SSLv23_procname); +// FuncLoadError := not assigned(RSA_padding_check_SSLv23); +// if FuncLoadError then +// begin +// {$if not defined(RSA_padding_check_SSLv23_allownil)} +// RSA_padding_check_SSLv23 := @ERR_RSA_padding_check_SSLv23; +// {$ifend} +// {$if declared(RSA_padding_check_SSLv23_introduced)} +// if LibVersion < RSA_padding_check_SSLv23_introduced then +// begin +// {$if declared(FC_RSA_padding_check_SSLv23)} +// RSA_padding_check_SSLv23 := @FC_RSA_padding_check_SSLv23; +// {$ifend} +// FuncLoadError := false; +// end; +// {$ifend} +// {$if declared(RSA_padding_check_SSLv23_removed)} +// if RSA_padding_check_SSLv23_removed <= LibVersion then +// begin +// {$if declared(_RSA_padding_check_SSLv23)} +// RSA_padding_check_SSLv23 := @_RSA_padding_check_SSLv23; +// {$ifend} +// FuncLoadError := false; +// end; +// {$ifend} +// {$if not defined(RSA_padding_check_SSLv23_allownil)} +// if FuncLoadError then +// AFailed.Add('RSA_padding_check_SSLv23'); +// {$ifend} +// end; + + + RSA_padding_add_none := LoadLibFunction(ADllHandle, RSA_padding_add_none_procname); + FuncLoadError := not assigned(RSA_padding_add_none); + if FuncLoadError then + begin + {$if not defined(RSA_padding_add_none_allownil)} + RSA_padding_add_none := @ERR_RSA_padding_add_none; + {$ifend} + {$if declared(RSA_padding_add_none_introduced)} + if LibVersion < RSA_padding_add_none_introduced then + begin + {$if declared(FC_RSA_padding_add_none)} + RSA_padding_add_none := @FC_RSA_padding_add_none; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RSA_padding_add_none_removed)} + if RSA_padding_add_none_removed <= LibVersion then + begin + {$if declared(_RSA_padding_add_none)} + RSA_padding_add_none := @_RSA_padding_add_none; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RSA_padding_add_none_allownil)} + if FuncLoadError then + AFailed.Add('RSA_padding_add_none'); + {$ifend} + end; + + + RSA_padding_check_none := LoadLibFunction(ADllHandle, RSA_padding_check_none_procname); + FuncLoadError := not assigned(RSA_padding_check_none); + if FuncLoadError then + begin + {$if not defined(RSA_padding_check_none_allownil)} + RSA_padding_check_none := @ERR_RSA_padding_check_none; + {$ifend} + {$if declared(RSA_padding_check_none_introduced)} + if LibVersion < RSA_padding_check_none_introduced then + begin + {$if declared(FC_RSA_padding_check_none)} + RSA_padding_check_none := @FC_RSA_padding_check_none; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RSA_padding_check_none_removed)} + if RSA_padding_check_none_removed <= LibVersion then + begin + {$if declared(_RSA_padding_check_none)} + RSA_padding_check_none := @_RSA_padding_check_none; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RSA_padding_check_none_allownil)} + if FuncLoadError then + AFailed.Add('RSA_padding_check_none'); + {$ifend} + end; + + + RSA_padding_add_X931 := LoadLibFunction(ADllHandle, RSA_padding_add_X931_procname); + FuncLoadError := not assigned(RSA_padding_add_X931); + if FuncLoadError then + begin + {$if not defined(RSA_padding_add_X931_allownil)} + RSA_padding_add_X931 := @ERR_RSA_padding_add_X931; + {$ifend} + {$if declared(RSA_padding_add_X931_introduced)} + if LibVersion < RSA_padding_add_X931_introduced then + begin + {$if declared(FC_RSA_padding_add_X931)} + RSA_padding_add_X931 := @FC_RSA_padding_add_X931; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RSA_padding_add_X931_removed)} + if RSA_padding_add_X931_removed <= LibVersion then + begin + {$if declared(_RSA_padding_add_X931)} + RSA_padding_add_X931 := @_RSA_padding_add_X931; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RSA_padding_add_X931_allownil)} + if FuncLoadError then + AFailed.Add('RSA_padding_add_X931'); + {$ifend} + end; + + + RSA_padding_check_X931 := LoadLibFunction(ADllHandle, RSA_padding_check_X931_procname); + FuncLoadError := not assigned(RSA_padding_check_X931); + if FuncLoadError then + begin + {$if not defined(RSA_padding_check_X931_allownil)} + RSA_padding_check_X931 := @ERR_RSA_padding_check_X931; + {$ifend} + {$if declared(RSA_padding_check_X931_introduced)} + if LibVersion < RSA_padding_check_X931_introduced then + begin + {$if declared(FC_RSA_padding_check_X931)} + RSA_padding_check_X931 := @FC_RSA_padding_check_X931; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RSA_padding_check_X931_removed)} + if RSA_padding_check_X931_removed <= LibVersion then + begin + {$if declared(_RSA_padding_check_X931)} + RSA_padding_check_X931 := @_RSA_padding_check_X931; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RSA_padding_check_X931_allownil)} + if FuncLoadError then + AFailed.Add('RSA_padding_check_X931'); + {$ifend} + end; + + + RSA_X931_hash_id := LoadLibFunction(ADllHandle, RSA_X931_hash_id_procname); + FuncLoadError := not assigned(RSA_X931_hash_id); + if FuncLoadError then + begin + {$if not defined(RSA_X931_hash_id_allownil)} + RSA_X931_hash_id := @ERR_RSA_X931_hash_id; + {$ifend} + {$if declared(RSA_X931_hash_id_introduced)} + if LibVersion < RSA_X931_hash_id_introduced then + begin + {$if declared(FC_RSA_X931_hash_id)} + RSA_X931_hash_id := @FC_RSA_X931_hash_id; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RSA_X931_hash_id_removed)} + if RSA_X931_hash_id_removed <= LibVersion then + begin + {$if declared(_RSA_X931_hash_id)} + RSA_X931_hash_id := @_RSA_X931_hash_id; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RSA_X931_hash_id_allownil)} + if FuncLoadError then + AFailed.Add('RSA_X931_hash_id'); + {$ifend} + end; + + + RSA_verify_PKCS1_PSS := LoadLibFunction(ADllHandle, RSA_verify_PKCS1_PSS_procname); + FuncLoadError := not assigned(RSA_verify_PKCS1_PSS); + if FuncLoadError then + begin + {$if not defined(RSA_verify_PKCS1_PSS_allownil)} + RSA_verify_PKCS1_PSS := @ERR_RSA_verify_PKCS1_PSS; + {$ifend} + {$if declared(RSA_verify_PKCS1_PSS_introduced)} + if LibVersion < RSA_verify_PKCS1_PSS_introduced then + begin + {$if declared(FC_RSA_verify_PKCS1_PSS)} + RSA_verify_PKCS1_PSS := @FC_RSA_verify_PKCS1_PSS; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RSA_verify_PKCS1_PSS_removed)} + if RSA_verify_PKCS1_PSS_removed <= LibVersion then + begin + {$if declared(_RSA_verify_PKCS1_PSS)} + RSA_verify_PKCS1_PSS := @_RSA_verify_PKCS1_PSS; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RSA_verify_PKCS1_PSS_allownil)} + if FuncLoadError then + AFailed.Add('RSA_verify_PKCS1_PSS'); + {$ifend} + end; + + + RSA_padding_add_PKCS1_PSS := LoadLibFunction(ADllHandle, RSA_padding_add_PKCS1_PSS_procname); + FuncLoadError := not assigned(RSA_padding_add_PKCS1_PSS); + if FuncLoadError then + begin + {$if not defined(RSA_padding_add_PKCS1_PSS_allownil)} + RSA_padding_add_PKCS1_PSS := @ERR_RSA_padding_add_PKCS1_PSS; + {$ifend} + {$if declared(RSA_padding_add_PKCS1_PSS_introduced)} + if LibVersion < RSA_padding_add_PKCS1_PSS_introduced then + begin + {$if declared(FC_RSA_padding_add_PKCS1_PSS)} + RSA_padding_add_PKCS1_PSS := @FC_RSA_padding_add_PKCS1_PSS; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RSA_padding_add_PKCS1_PSS_removed)} + if RSA_padding_add_PKCS1_PSS_removed <= LibVersion then + begin + {$if declared(_RSA_padding_add_PKCS1_PSS)} + RSA_padding_add_PKCS1_PSS := @_RSA_padding_add_PKCS1_PSS; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RSA_padding_add_PKCS1_PSS_allownil)} + if FuncLoadError then + AFailed.Add('RSA_padding_add_PKCS1_PSS'); + {$ifend} + end; + + + RSA_verify_PKCS1_PSS_mgf1 := LoadLibFunction(ADllHandle, RSA_verify_PKCS1_PSS_mgf1_procname); + FuncLoadError := not assigned(RSA_verify_PKCS1_PSS_mgf1); + if FuncLoadError then + begin + {$if not defined(RSA_verify_PKCS1_PSS_mgf1_allownil)} + RSA_verify_PKCS1_PSS_mgf1 := @ERR_RSA_verify_PKCS1_PSS_mgf1; + {$ifend} + {$if declared(RSA_verify_PKCS1_PSS_mgf1_introduced)} + if LibVersion < RSA_verify_PKCS1_PSS_mgf1_introduced then + begin + {$if declared(FC_RSA_verify_PKCS1_PSS_mgf1)} + RSA_verify_PKCS1_PSS_mgf1 := @FC_RSA_verify_PKCS1_PSS_mgf1; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RSA_verify_PKCS1_PSS_mgf1_removed)} + if RSA_verify_PKCS1_PSS_mgf1_removed <= LibVersion then + begin + {$if declared(_RSA_verify_PKCS1_PSS_mgf1)} + RSA_verify_PKCS1_PSS_mgf1 := @_RSA_verify_PKCS1_PSS_mgf1; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RSA_verify_PKCS1_PSS_mgf1_allownil)} + if FuncLoadError then + AFailed.Add('RSA_verify_PKCS1_PSS_mgf1'); + {$ifend} + end; + + + RSA_padding_add_PKCS1_PSS_mgf1 := LoadLibFunction(ADllHandle, RSA_padding_add_PKCS1_PSS_mgf1_procname); + FuncLoadError := not assigned(RSA_padding_add_PKCS1_PSS_mgf1); + if FuncLoadError then + begin + {$if not defined(RSA_padding_add_PKCS1_PSS_mgf1_allownil)} + RSA_padding_add_PKCS1_PSS_mgf1 := @ERR_RSA_padding_add_PKCS1_PSS_mgf1; + {$ifend} + {$if declared(RSA_padding_add_PKCS1_PSS_mgf1_introduced)} + if LibVersion < RSA_padding_add_PKCS1_PSS_mgf1_introduced then + begin + {$if declared(FC_RSA_padding_add_PKCS1_PSS_mgf1)} + RSA_padding_add_PKCS1_PSS_mgf1 := @FC_RSA_padding_add_PKCS1_PSS_mgf1; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RSA_padding_add_PKCS1_PSS_mgf1_removed)} + if RSA_padding_add_PKCS1_PSS_mgf1_removed <= LibVersion then + begin + {$if declared(_RSA_padding_add_PKCS1_PSS_mgf1)} + RSA_padding_add_PKCS1_PSS_mgf1 := @_RSA_padding_add_PKCS1_PSS_mgf1; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RSA_padding_add_PKCS1_PSS_mgf1_allownil)} + if FuncLoadError then + AFailed.Add('RSA_padding_add_PKCS1_PSS_mgf1'); + {$ifend} + end; + + + RSA_set_ex_data := LoadLibFunction(ADllHandle, RSA_set_ex_data_procname); + FuncLoadError := not assigned(RSA_set_ex_data); + if FuncLoadError then + begin + {$if not defined(RSA_set_ex_data_allownil)} + RSA_set_ex_data := @ERR_RSA_set_ex_data; + {$ifend} + {$if declared(RSA_set_ex_data_introduced)} + if LibVersion < RSA_set_ex_data_introduced then + begin + {$if declared(FC_RSA_set_ex_data)} + RSA_set_ex_data := @FC_RSA_set_ex_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RSA_set_ex_data_removed)} + if RSA_set_ex_data_removed <= LibVersion then + begin + {$if declared(_RSA_set_ex_data)} + RSA_set_ex_data := @_RSA_set_ex_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RSA_set_ex_data_allownil)} + if FuncLoadError then + AFailed.Add('RSA_set_ex_data'); + {$ifend} + end; + + + RSA_get_ex_data := LoadLibFunction(ADllHandle, RSA_get_ex_data_procname); + FuncLoadError := not assigned(RSA_get_ex_data); + if FuncLoadError then + begin + {$if not defined(RSA_get_ex_data_allownil)} + RSA_get_ex_data := @ERR_RSA_get_ex_data; + {$ifend} + {$if declared(RSA_get_ex_data_introduced)} + if LibVersion < RSA_get_ex_data_introduced then + begin + {$if declared(FC_RSA_get_ex_data)} + RSA_get_ex_data := @FC_RSA_get_ex_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RSA_get_ex_data_removed)} + if RSA_get_ex_data_removed <= LibVersion then + begin + {$if declared(_RSA_get_ex_data)} + RSA_get_ex_data := @_RSA_get_ex_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RSA_get_ex_data_allownil)} + if FuncLoadError then + AFailed.Add('RSA_get_ex_data'); + {$ifend} + end; + + + RSAPublicKey_dup := LoadLibFunction(ADllHandle, RSAPublicKey_dup_procname); + FuncLoadError := not assigned(RSAPublicKey_dup); + if FuncLoadError then + begin + {$if not defined(RSAPublicKey_dup_allownil)} + RSAPublicKey_dup := @ERR_RSAPublicKey_dup; + {$ifend} + {$if declared(RSAPublicKey_dup_introduced)} + if LibVersion < RSAPublicKey_dup_introduced then + begin + {$if declared(FC_RSAPublicKey_dup)} + RSAPublicKey_dup := @FC_RSAPublicKey_dup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RSAPublicKey_dup_removed)} + if RSAPublicKey_dup_removed <= LibVersion then + begin + {$if declared(_RSAPublicKey_dup)} + RSAPublicKey_dup := @_RSAPublicKey_dup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RSAPublicKey_dup_allownil)} + if FuncLoadError then + AFailed.Add('RSAPublicKey_dup'); + {$ifend} + end; + + + RSAPrivateKey_dup := LoadLibFunction(ADllHandle, RSAPrivateKey_dup_procname); + FuncLoadError := not assigned(RSAPrivateKey_dup); + if FuncLoadError then + begin + {$if not defined(RSAPrivateKey_dup_allownil)} + RSAPrivateKey_dup := @ERR_RSAPrivateKey_dup; + {$ifend} + {$if declared(RSAPrivateKey_dup_introduced)} + if LibVersion < RSAPrivateKey_dup_introduced then + begin + {$if declared(FC_RSAPrivateKey_dup)} + RSAPrivateKey_dup := @FC_RSAPrivateKey_dup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RSAPrivateKey_dup_removed)} + if RSAPrivateKey_dup_removed <= LibVersion then + begin + {$if declared(_RSAPrivateKey_dup)} + RSAPrivateKey_dup := @_RSAPrivateKey_dup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RSAPrivateKey_dup_allownil)} + if FuncLoadError then + AFailed.Add('RSAPrivateKey_dup'); + {$ifend} + end; + + + RSA_meth_new := LoadLibFunction(ADllHandle, RSA_meth_new_procname); + FuncLoadError := not assigned(RSA_meth_new); + if FuncLoadError then + begin + {$if not defined(RSA_meth_new_allownil)} + RSA_meth_new := @ERR_RSA_meth_new; + {$ifend} + {$if declared(RSA_meth_new_introduced)} + if LibVersion < RSA_meth_new_introduced then + begin + {$if declared(FC_RSA_meth_new)} + RSA_meth_new := @FC_RSA_meth_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RSA_meth_new_removed)} + if RSA_meth_new_removed <= LibVersion then + begin + {$if declared(_RSA_meth_new)} + RSA_meth_new := @_RSA_meth_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RSA_meth_new_allownil)} + if FuncLoadError then + AFailed.Add('RSA_meth_new'); + {$ifend} + end; + + + RSA_meth_free := LoadLibFunction(ADllHandle, RSA_meth_free_procname); + FuncLoadError := not assigned(RSA_meth_free); + if FuncLoadError then + begin + {$if not defined(RSA_meth_free_allownil)} + RSA_meth_free := @ERR_RSA_meth_free; + {$ifend} + {$if declared(RSA_meth_free_introduced)} + if LibVersion < RSA_meth_free_introduced then + begin + {$if declared(FC_RSA_meth_free)} + RSA_meth_free := @FC_RSA_meth_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RSA_meth_free_removed)} + if RSA_meth_free_removed <= LibVersion then + begin + {$if declared(_RSA_meth_free)} + RSA_meth_free := @_RSA_meth_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RSA_meth_free_allownil)} + if FuncLoadError then + AFailed.Add('RSA_meth_free'); + {$ifend} + end; + + + RSA_meth_dup := LoadLibFunction(ADllHandle, RSA_meth_dup_procname); + FuncLoadError := not assigned(RSA_meth_dup); + if FuncLoadError then + begin + {$if not defined(RSA_meth_dup_allownil)} + RSA_meth_dup := @ERR_RSA_meth_dup; + {$ifend} + {$if declared(RSA_meth_dup_introduced)} + if LibVersion < RSA_meth_dup_introduced then + begin + {$if declared(FC_RSA_meth_dup)} + RSA_meth_dup := @FC_RSA_meth_dup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RSA_meth_dup_removed)} + if RSA_meth_dup_removed <= LibVersion then + begin + {$if declared(_RSA_meth_dup)} + RSA_meth_dup := @_RSA_meth_dup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RSA_meth_dup_allownil)} + if FuncLoadError then + AFailed.Add('RSA_meth_dup'); + {$ifend} + end; + + + RSA_meth_get0_name := LoadLibFunction(ADllHandle, RSA_meth_get0_name_procname); + FuncLoadError := not assigned(RSA_meth_get0_name); + if FuncLoadError then + begin + {$if not defined(RSA_meth_get0_name_allownil)} + RSA_meth_get0_name := @ERR_RSA_meth_get0_name; + {$ifend} + {$if declared(RSA_meth_get0_name_introduced)} + if LibVersion < RSA_meth_get0_name_introduced then + begin + {$if declared(FC_RSA_meth_get0_name)} + RSA_meth_get0_name := @FC_RSA_meth_get0_name; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RSA_meth_get0_name_removed)} + if RSA_meth_get0_name_removed <= LibVersion then + begin + {$if declared(_RSA_meth_get0_name)} + RSA_meth_get0_name := @_RSA_meth_get0_name; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RSA_meth_get0_name_allownil)} + if FuncLoadError then + AFailed.Add('RSA_meth_get0_name'); + {$ifend} + end; + + + RSA_meth_set1_name := LoadLibFunction(ADllHandle, RSA_meth_set1_name_procname); + FuncLoadError := not assigned(RSA_meth_set1_name); + if FuncLoadError then + begin + {$if not defined(RSA_meth_set1_name_allownil)} + RSA_meth_set1_name := @ERR_RSA_meth_set1_name; + {$ifend} + {$if declared(RSA_meth_set1_name_introduced)} + if LibVersion < RSA_meth_set1_name_introduced then + begin + {$if declared(FC_RSA_meth_set1_name)} + RSA_meth_set1_name := @FC_RSA_meth_set1_name; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RSA_meth_set1_name_removed)} + if RSA_meth_set1_name_removed <= LibVersion then + begin + {$if declared(_RSA_meth_set1_name)} + RSA_meth_set1_name := @_RSA_meth_set1_name; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RSA_meth_set1_name_allownil)} + if FuncLoadError then + AFailed.Add('RSA_meth_set1_name'); + {$ifend} + end; + + + RSA_meth_get_flags := LoadLibFunction(ADllHandle, RSA_meth_get_flags_procname); + FuncLoadError := not assigned(RSA_meth_get_flags); + if FuncLoadError then + begin + {$if not defined(RSA_meth_get_flags_allownil)} + RSA_meth_get_flags := @ERR_RSA_meth_get_flags; + {$ifend} + {$if declared(RSA_meth_get_flags_introduced)} + if LibVersion < RSA_meth_get_flags_introduced then + begin + {$if declared(FC_RSA_meth_get_flags)} + RSA_meth_get_flags := @FC_RSA_meth_get_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RSA_meth_get_flags_removed)} + if RSA_meth_get_flags_removed <= LibVersion then + begin + {$if declared(_RSA_meth_get_flags)} + RSA_meth_get_flags := @_RSA_meth_get_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RSA_meth_get_flags_allownil)} + if FuncLoadError then + AFailed.Add('RSA_meth_get_flags'); + {$ifend} + end; + + + RSA_meth_set_flags := LoadLibFunction(ADllHandle, RSA_meth_set_flags_procname); + FuncLoadError := not assigned(RSA_meth_set_flags); + if FuncLoadError then + begin + {$if not defined(RSA_meth_set_flags_allownil)} + RSA_meth_set_flags := @ERR_RSA_meth_set_flags; + {$ifend} + {$if declared(RSA_meth_set_flags_introduced)} + if LibVersion < RSA_meth_set_flags_introduced then + begin + {$if declared(FC_RSA_meth_set_flags)} + RSA_meth_set_flags := @FC_RSA_meth_set_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RSA_meth_set_flags_removed)} + if RSA_meth_set_flags_removed <= LibVersion then + begin + {$if declared(_RSA_meth_set_flags)} + RSA_meth_set_flags := @_RSA_meth_set_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RSA_meth_set_flags_allownil)} + if FuncLoadError then + AFailed.Add('RSA_meth_set_flags'); + {$ifend} + end; + + + RSA_meth_get0_app_data := LoadLibFunction(ADllHandle, RSA_meth_get0_app_data_procname); + FuncLoadError := not assigned(RSA_meth_get0_app_data); + if FuncLoadError then + begin + {$if not defined(RSA_meth_get0_app_data_allownil)} + RSA_meth_get0_app_data := @ERR_RSA_meth_get0_app_data; + {$ifend} + {$if declared(RSA_meth_get0_app_data_introduced)} + if LibVersion < RSA_meth_get0_app_data_introduced then + begin + {$if declared(FC_RSA_meth_get0_app_data)} + RSA_meth_get0_app_data := @FC_RSA_meth_get0_app_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RSA_meth_get0_app_data_removed)} + if RSA_meth_get0_app_data_removed <= LibVersion then + begin + {$if declared(_RSA_meth_get0_app_data)} + RSA_meth_get0_app_data := @_RSA_meth_get0_app_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RSA_meth_get0_app_data_allownil)} + if FuncLoadError then + AFailed.Add('RSA_meth_get0_app_data'); + {$ifend} + end; + + + RSA_meth_set0_app_data := LoadLibFunction(ADllHandle, RSA_meth_set0_app_data_procname); + FuncLoadError := not assigned(RSA_meth_set0_app_data); + if FuncLoadError then + begin + {$if not defined(RSA_meth_set0_app_data_allownil)} + RSA_meth_set0_app_data := @ERR_RSA_meth_set0_app_data; + {$ifend} + {$if declared(RSA_meth_set0_app_data_introduced)} + if LibVersion < RSA_meth_set0_app_data_introduced then + begin + {$if declared(FC_RSA_meth_set0_app_data)} + RSA_meth_set0_app_data := @FC_RSA_meth_set0_app_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RSA_meth_set0_app_data_removed)} + if RSA_meth_set0_app_data_removed <= LibVersion then + begin + {$if declared(_RSA_meth_set0_app_data)} + RSA_meth_set0_app_data := @_RSA_meth_set0_app_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RSA_meth_set0_app_data_allownil)} + if FuncLoadError then + AFailed.Add('RSA_meth_set0_app_data'); + {$ifend} + end; + + + RSA_meth_set_priv_dec := LoadLibFunction(ADllHandle, RSA_meth_set_priv_dec_procname); + FuncLoadError := not assigned(RSA_meth_set_priv_dec); + if FuncLoadError then + begin + {$if not defined(RSA_meth_set_priv_dec_allownil)} + RSA_meth_set_priv_dec := @ERR_RSA_meth_set_priv_dec; + {$ifend} + {$if declared(RSA_meth_set_priv_dec_introduced)} + if LibVersion < RSA_meth_set_priv_dec_introduced then + begin + {$if declared(FC_RSA_meth_set_priv_dec)} + RSA_meth_set_priv_dec := @FC_RSA_meth_set_priv_dec; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RSA_meth_set_priv_dec_removed)} + if RSA_meth_set_priv_dec_removed <= LibVersion then + begin + {$if declared(_RSA_meth_set_priv_dec)} + RSA_meth_set_priv_dec := @_RSA_meth_set_priv_dec; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RSA_meth_set_priv_dec_allownil)} + if FuncLoadError then + AFailed.Add('RSA_meth_set_priv_dec'); + {$ifend} + end; + + + RSA_meth_set_mod_exp := LoadLibFunction(ADllHandle, RSA_meth_set_mod_exp_procname); + FuncLoadError := not assigned(RSA_meth_set_mod_exp); + if FuncLoadError then + begin + {$if not defined(RSA_meth_set_mod_exp_allownil)} + RSA_meth_set_mod_exp := @ERR_RSA_meth_set_mod_exp; + {$ifend} + {$if declared(RSA_meth_set_mod_exp_introduced)} + if LibVersion < RSA_meth_set_mod_exp_introduced then + begin + {$if declared(FC_RSA_meth_set_mod_exp)} + RSA_meth_set_mod_exp := @FC_RSA_meth_set_mod_exp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RSA_meth_set_mod_exp_removed)} + if RSA_meth_set_mod_exp_removed <= LibVersion then + begin + {$if declared(_RSA_meth_set_mod_exp)} + RSA_meth_set_mod_exp := @_RSA_meth_set_mod_exp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RSA_meth_set_mod_exp_allownil)} + if FuncLoadError then + AFailed.Add('RSA_meth_set_mod_exp'); + {$ifend} + end; + + + RSA_meth_set_bn_mod_exp := LoadLibFunction(ADllHandle, RSA_meth_set_bn_mod_exp_procname); + FuncLoadError := not assigned(RSA_meth_set_bn_mod_exp); + if FuncLoadError then + begin + {$if not defined(RSA_meth_set_bn_mod_exp_allownil)} + RSA_meth_set_bn_mod_exp := @ERR_RSA_meth_set_bn_mod_exp; + {$ifend} + {$if declared(RSA_meth_set_bn_mod_exp_introduced)} + if LibVersion < RSA_meth_set_bn_mod_exp_introduced then + begin + {$if declared(FC_RSA_meth_set_bn_mod_exp)} + RSA_meth_set_bn_mod_exp := @FC_RSA_meth_set_bn_mod_exp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RSA_meth_set_bn_mod_exp_removed)} + if RSA_meth_set_bn_mod_exp_removed <= LibVersion then + begin + {$if declared(_RSA_meth_set_bn_mod_exp)} + RSA_meth_set_bn_mod_exp := @_RSA_meth_set_bn_mod_exp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RSA_meth_set_bn_mod_exp_allownil)} + if FuncLoadError then + AFailed.Add('RSA_meth_set_bn_mod_exp'); + {$ifend} + end; + + + RSA_meth_set_init := LoadLibFunction(ADllHandle, RSA_meth_set_init_procname); + FuncLoadError := not assigned(RSA_meth_set_init); + if FuncLoadError then + begin + {$if not defined(RSA_meth_set_init_allownil)} + RSA_meth_set_init := @ERR_RSA_meth_set_init; + {$ifend} + {$if declared(RSA_meth_set_init_introduced)} + if LibVersion < RSA_meth_set_init_introduced then + begin + {$if declared(FC_RSA_meth_set_init)} + RSA_meth_set_init := @FC_RSA_meth_set_init; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RSA_meth_set_init_removed)} + if RSA_meth_set_init_removed <= LibVersion then + begin + {$if declared(_RSA_meth_set_init)} + RSA_meth_set_init := @_RSA_meth_set_init; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RSA_meth_set_init_allownil)} + if FuncLoadError then + AFailed.Add('RSA_meth_set_init'); + {$ifend} + end; + + + RSA_meth_set_finish := LoadLibFunction(ADllHandle, RSA_meth_set_finish_procname); + FuncLoadError := not assigned(RSA_meth_set_finish); + if FuncLoadError then + begin + {$if not defined(RSA_meth_set_finish_allownil)} + RSA_meth_set_finish := @ERR_RSA_meth_set_finish; + {$ifend} + {$if declared(RSA_meth_set_finish_introduced)} + if LibVersion < RSA_meth_set_finish_introduced then + begin + {$if declared(FC_RSA_meth_set_finish)} + RSA_meth_set_finish := @FC_RSA_meth_set_finish; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RSA_meth_set_finish_removed)} + if RSA_meth_set_finish_removed <= LibVersion then + begin + {$if declared(_RSA_meth_set_finish)} + RSA_meth_set_finish := @_RSA_meth_set_finish; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RSA_meth_set_finish_allownil)} + if FuncLoadError then + AFailed.Add('RSA_meth_set_finish'); + {$ifend} + end; + + + RSA_meth_set_sign := LoadLibFunction(ADllHandle, RSA_meth_set_sign_procname); + FuncLoadError := not assigned(RSA_meth_set_sign); + if FuncLoadError then + begin + {$if not defined(RSA_meth_set_sign_allownil)} + RSA_meth_set_sign := @ERR_RSA_meth_set_sign; + {$ifend} + {$if declared(RSA_meth_set_sign_introduced)} + if LibVersion < RSA_meth_set_sign_introduced then + begin + {$if declared(FC_RSA_meth_set_sign)} + RSA_meth_set_sign := @FC_RSA_meth_set_sign; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RSA_meth_set_sign_removed)} + if RSA_meth_set_sign_removed <= LibVersion then + begin + {$if declared(_RSA_meth_set_sign)} + RSA_meth_set_sign := @_RSA_meth_set_sign; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RSA_meth_set_sign_allownil)} + if FuncLoadError then + AFailed.Add('RSA_meth_set_sign'); + {$ifend} + end; + + + RSA_meth_set_verify := LoadLibFunction(ADllHandle, RSA_meth_set_verify_procname); + FuncLoadError := not assigned(RSA_meth_set_verify); + if FuncLoadError then + begin + {$if not defined(RSA_meth_set_verify_allownil)} + RSA_meth_set_verify := @ERR_RSA_meth_set_verify; + {$ifend} + {$if declared(RSA_meth_set_verify_introduced)} + if LibVersion < RSA_meth_set_verify_introduced then + begin + {$if declared(FC_RSA_meth_set_verify)} + RSA_meth_set_verify := @FC_RSA_meth_set_verify; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RSA_meth_set_verify_removed)} + if RSA_meth_set_verify_removed <= LibVersion then + begin + {$if declared(_RSA_meth_set_verify)} + RSA_meth_set_verify := @_RSA_meth_set_verify; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RSA_meth_set_verify_allownil)} + if FuncLoadError then + AFailed.Add('RSA_meth_set_verify'); + {$ifend} + end; + + + RSA_meth_set_keygen := LoadLibFunction(ADllHandle, RSA_meth_set_keygen_procname); + FuncLoadError := not assigned(RSA_meth_set_keygen); + if FuncLoadError then + begin + {$if not defined(RSA_meth_set_keygen_allownil)} + RSA_meth_set_keygen := @ERR_RSA_meth_set_keygen; + {$ifend} + {$if declared(RSA_meth_set_keygen_introduced)} + if LibVersion < RSA_meth_set_keygen_introduced then + begin + {$if declared(FC_RSA_meth_set_keygen)} + RSA_meth_set_keygen := @FC_RSA_meth_set_keygen; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RSA_meth_set_keygen_removed)} + if RSA_meth_set_keygen_removed <= LibVersion then + begin + {$if declared(_RSA_meth_set_keygen)} + RSA_meth_set_keygen := @_RSA_meth_set_keygen; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RSA_meth_set_keygen_allownil)} + if FuncLoadError then + AFailed.Add('RSA_meth_set_keygen'); + {$ifend} + end; + + + RSA_meth_set_multi_prime_keygen := LoadLibFunction(ADllHandle, RSA_meth_set_multi_prime_keygen_procname); + FuncLoadError := not assigned(RSA_meth_set_multi_prime_keygen); + if FuncLoadError then + begin + {$if not defined(RSA_meth_set_multi_prime_keygen_allownil)} + RSA_meth_set_multi_prime_keygen := @ERR_RSA_meth_set_multi_prime_keygen; + {$ifend} + {$if declared(RSA_meth_set_multi_prime_keygen_introduced)} + if LibVersion < RSA_meth_set_multi_prime_keygen_introduced then + begin + {$if declared(FC_RSA_meth_set_multi_prime_keygen)} + RSA_meth_set_multi_prime_keygen := @FC_RSA_meth_set_multi_prime_keygen; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(RSA_meth_set_multi_prime_keygen_removed)} + if RSA_meth_set_multi_prime_keygen_removed <= LibVersion then + begin + {$if declared(_RSA_meth_set_multi_prime_keygen)} + RSA_meth_set_multi_prime_keygen := @_RSA_meth_set_multi_prime_keygen; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(RSA_meth_set_multi_prime_keygen_allownil)} + if FuncLoadError then + AFailed.Add('RSA_meth_set_multi_prime_keygen'); + {$ifend} + end; + + +end; + +procedure Unload; +begin + RSA_new := nil; + RSA_new_method := nil; + RSA_bits := nil; + RSA_size := nil; + RSA_security_bits := nil; + RSA_set0_key := nil; + RSA_set0_factors := nil; + RSA_set0_crt_params := nil; + RSA_get0_key := nil; + RSA_get0_factors := nil; + RSA_get_multi_prime_extra_count := nil; + RSA_get0_crt_params := nil; + RSA_get0_n := nil; + RSA_get0_e := nil; + RSA_get0_d := nil; + RSA_get0_p := nil; + RSA_get0_q := nil; + RSA_get0_dmp1 := nil; + RSA_get0_dmq1 := nil; + RSA_get0_iqmp := nil; + RSA_clear_flags := nil; + RSA_test_flags := nil; + RSA_set_flags := nil; + RSA_get_version := nil; + RSA_get0_engine := nil; + RSA_generate_key_ex := nil; + RSA_generate_multi_prime_key := nil; + RSA_X931_derive_ex := nil; + RSA_X931_generate_key_ex := nil; + RSA_check_key := nil; + RSA_check_key_ex := nil; + RSA_public_encrypt := nil; + RSA_private_encrypt := nil; + RSA_public_decrypt := nil; + RSA_private_decrypt := nil; + RSA_free := nil; + RSA_up_ref := nil; + RSA_flags := nil; + RSA_set_default_method := nil; + RSA_get_default_method := nil; + RSA_null_method := nil; + RSA_get_method := nil; + RSA_set_method := nil; + RSA_PKCS1_OpenSSL := nil; + RSA_pkey_ctx_ctrl := nil; + RSA_print := nil; + RSA_sign := nil; + RSA_verify := nil; + RSA_sign_ASN1_OCTET_STRING := nil; + RSA_verify_ASN1_OCTET_STRING := nil; + RSA_blinding_on := nil; + RSA_blinding_off := nil; + RSA_setup_blinding := nil; + RSA_padding_add_PKCS1_type_1 := nil; + RSA_padding_check_PKCS1_type_1 := nil; + RSA_padding_add_PKCS1_type_2 := nil; + RSA_padding_check_PKCS1_type_2 := nil; + PKCS1_MGF1 := nil; + RSA_padding_add_PKCS1_OAEP := nil; + RSA_padding_check_PKCS1_OAEP := nil; + RSA_padding_add_PKCS1_OAEP_mgf1 := nil; + RSA_padding_check_PKCS1_OAEP_mgf1 := nil; +// RSA_padding_add_SSLv23 := nil; +// RSA_padding_check_SSLv23 := nil; + RSA_padding_add_none := nil; + RSA_padding_check_none := nil; + RSA_padding_add_X931 := nil; + RSA_padding_check_X931 := nil; + RSA_X931_hash_id := nil; + RSA_verify_PKCS1_PSS := nil; + RSA_padding_add_PKCS1_PSS := nil; + RSA_verify_PKCS1_PSS_mgf1 := nil; + RSA_padding_add_PKCS1_PSS_mgf1 := nil; + RSA_set_ex_data := nil; + RSA_get_ex_data := nil; + RSAPublicKey_dup := nil; + RSAPrivateKey_dup := nil; + RSA_meth_new := nil; + RSA_meth_free := nil; + RSA_meth_dup := nil; + RSA_meth_get0_name := nil; + RSA_meth_set1_name := nil; + RSA_meth_get_flags := nil; + RSA_meth_set_flags := nil; + RSA_meth_get0_app_data := nil; + RSA_meth_set0_app_data := nil; + RSA_meth_set_priv_dec := nil; + RSA_meth_set_mod_exp := nil; + RSA_meth_set_bn_mod_exp := nil; + RSA_meth_set_init := nil; + RSA_meth_set_finish := nil; + RSA_meth_set_sign := nil; + RSA_meth_set_verify := nil; + RSA_meth_set_keygen := nil; + RSA_meth_set_multi_prime_keygen := nil; +end; +{$ELSE} +{$ENDIF} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +initialization + Register_SSLLoader(@Load,'LibCrypto'); + Register_SSLUnloader(@Unload); +{$ENDIF} +end. diff --git a/IdOpenSSLHeaders_rsaerr.pas b/IdOpenSSLHeaders_rsaerr.pas new file mode 100644 index 0000000..fbc3735 --- /dev/null +++ b/IdOpenSSLHeaders_rsaerr.pas @@ -0,0 +1,284 @@ + (* This unit was generated using the script genOpenSSLHdrs.sh from the source file IdOpenSSLHeaders_rsaerr.h2pas + It should not be modified directly. All changes should be made to IdOpenSSLHeaders_rsaerr.h2pas + and this file regenerated. IdOpenSSLHeaders_rsaerr.h2pas is distributed with the full Indy + Distribution. + *) + +{$i IdCompilerDefines.inc} +{$i IdSSLOpenSSLDefines.inc} +{$IFNDEF USE_OPENSSL} + { error Should not compile if USE_OPENSSL is not defined!!!} +{$ENDIF} +{******************************************************************************} +{ } +{ Indy (Internet Direct) - Internet Protocols Simplified } +{ } +{ https://www.indyproject.org/ } +{ https://gitter.im/IndySockets/Indy } +{ } +{******************************************************************************} +{ } +{ This file is part of the Indy (Internet Direct) project, and is offered } +{ under the dual-licensing agreement described on the Indy website. } +{ (https://www.indyproject.org/license/) } +{ } +{ Copyright: } +{ (c) 1993-2020, Chad Z. Hower and the Indy Pit Crew. All rights reserved. } +{ } +{******************************************************************************} +{ } +{ } +{******************************************************************************} + +unit IdOpenSSLHeaders_rsaerr; + +interface + +// Headers for OpenSSL 1.1.1 +// rsaerr.h + + +uses + IdCTypes, + IdGlobal, + IdSSLOpenSSLConsts; + +const + (* + * RSA function codes. + *) + RSA_F_CHECK_PADDING_MD = 140; + RSA_F_ENCODE_PKCS1 = 146; + RSA_F_INT_RSA_VERIFY = 145; + RSA_F_OLD_RSA_PRIV_DECODE = 147; + RSA_F_PKEY_PSS_INIT = 165; + RSA_F_PKEY_RSA_CTRL = 143; + RSA_F_PKEY_RSA_CTRL_STR = 144; + RSA_F_PKEY_RSA_SIGN = 142; + RSA_F_PKEY_RSA_VERIFY = 149; + RSA_F_PKEY_RSA_VERIFYRECOVER = 141; + RSA_F_RSA_ALGOR_TO_MD = 156; + RSA_F_RSA_BUILTIN_KEYGEN = 129; + RSA_F_RSA_CHECK_KEY = 123; + RSA_F_RSA_CHECK_KEY_EX = 160; + RSA_F_RSA_CMS_DECRYPT = 159; + RSA_F_RSA_CMS_VERIFY = 158; + RSA_F_RSA_ITEM_VERIFY = 148; + RSA_F_RSA_METH_DUP = 161; + RSA_F_RSA_METH_NEW = 162; + RSA_F_RSA_METH_SET1_NAME = 163; + RSA_F_RSA_MGF1_TO_MD = 157; + RSA_F_RSA_MULTIP_INFO_NEW = 166; + RSA_F_RSA_NEW_METHOD = 106; + RSA_F_RSA_NULL = 124; + RSA_F_RSA_NULL_PRIVATE_DECRYPT = 132; + RSA_F_RSA_NULL_PRIVATE_ENCRYPT = 133; + RSA_F_RSA_NULL_PUBLIC_DECRYPT = 134; + RSA_F_RSA_NULL_PUBLIC_ENCRYPT = 135; + RSA_F_RSA_OSSL_PRIVATE_DECRYPT = 101; + RSA_F_RSA_OSSL_PRIVATE_ENCRYPT = 102; + RSA_F_RSA_OSSL_PUBLIC_DECRYPT = 103; + RSA_F_RSA_OSSL_PUBLIC_ENCRYPT = 104; + RSA_F_RSA_PADDING_ADD_NONE = 107; + RSA_F_RSA_PADDING_ADD_PKCS1_OAEP = 121; + RSA_F_RSA_PADDING_ADD_PKCS1_OAEP_MGF1 = 154; + RSA_F_RSA_PADDING_ADD_PKCS1_PSS = 125; + RSA_F_RSA_PADDING_ADD_PKCS1_PSS_MGF1 = 152; + RSA_F_RSA_PADDING_ADD_PKCS1_TYPE_1 = 108; + RSA_F_RSA_PADDING_ADD_PKCS1_TYPE_2 = 109; + RSA_F_RSA_PADDING_ADD_SSLV23 = 110; + RSA_F_RSA_PADDING_ADD_X931 = 127; + RSA_F_RSA_PADDING_CHECK_NONE = 111; + RSA_F_RSA_PADDING_CHECK_PKCS1_OAEP = 122; + RSA_F_RSA_PADDING_CHECK_PKCS1_OAEP_MGF1 = 153; + RSA_F_RSA_PADDING_CHECK_PKCS1_TYPE_1 = 112; + RSA_F_RSA_PADDING_CHECK_PKCS1_TYPE_2 = 113; + RSA_F_RSA_PADDING_CHECK_SSLV23 = 114; + RSA_F_RSA_PADDING_CHECK_X931 = 128; + RSA_F_RSA_PARAM_DECODE = 164; + RSA_F_RSA_PRINT = 115; + RSA_F_RSA_PRINT_FP = 116; + RSA_F_RSA_PRIV_DECODE = 150; + RSA_F_RSA_PRIV_ENCODE = 138; + RSA_F_RSA_PSS_GET_PARAM = 151; + RSA_F_RSA_PSS_TO_CTX = 155; + RSA_F_RSA_PUB_DECODE = 139; + RSA_F_RSA_SETUP_BLINDING = 136; + RSA_F_RSA_SIGN = 117; + RSA_F_RSA_SIGN_ASN1_OCTET_STRING = 118; + RSA_F_RSA_VERIFY = 119; + RSA_F_RSA_VERIFY_ASN1_OCTET_STRING = 120; + RSA_F_RSA_VERIFY_PKCS1_PSS_MGF1 = 126; + RSA_F_SETUP_TBUF = 167; + + (* + * RSA reason codes. + *) + RSA_R_ALGORITHM_MISMATCH = 100; + RSA_R_BAD_E_VALUE = 101; + RSA_R_BAD_FIXED_HEADER_DECRYPT = 102; + RSA_R_BAD_PAD_BYTE_COUNT = 103; + RSA_R_BAD_SIGNATURE = 104; + RSA_R_BLOCK_TYPE_IS_NOT_01 = 106; + RSA_R_BLOCK_TYPE_IS_NOT_02 = 107; + RSA_R_DATA_GREATER_THAN_MOD_LEN = 108; + RSA_R_DATA_TOO_LARGE = 109; + RSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE = 110; + RSA_R_DATA_TOO_LARGE_FOR_MODULUS = 132; + RSA_R_DATA_TOO_SMALL = 111; + RSA_R_DATA_TOO_SMALL_FOR_KEY_SIZE = 122; + RSA_R_DIGEST_DOES_NOT_MATCH = 158; + RSA_R_DIGEST_NOT_ALLOWED = 145; + RSA_R_DIGEST_TOO_BIG_FOR_RSA_KEY = 112; + RSA_R_DMP1_NOT_CONGRUENT_TO_D = 124; + RSA_R_DMQ1_NOT_CONGRUENT_TO_D = 125; + RSA_R_D_E_NOT_CONGRUENT_TO_1 = 123; + RSA_R_FIRST_OCTET_INVALID = 133; + RSA_R_ILLEGAL_OR_UNSUPPORTED_PADDING_MODE = 144; + RSA_R_INVALID_DIGEST = 157; + RSA_R_INVALID_DIGEST_LENGTH = 143; + RSA_R_INVALID_HEADER = 137; + RSA_R_INVALID_LABEL = 160; + RSA_R_INVALID_MESSAGE_LENGTH = 131; + RSA_R_INVALID_MGF1_MD = 156; + RSA_R_INVALID_MULTI_PRIME_KEY = 167; + RSA_R_INVALID_OAEP_PARAMETERS = 161; + RSA_R_INVALID_PADDING = 138; + RSA_R_INVALID_PADDING_MODE = 141; + RSA_R_INVALID_PSS_PARAMETERS = 149; + RSA_R_INVALID_PSS_SALTLEN = 146; + RSA_R_INVALID_SALT_LENGTH = 150; + RSA_R_INVALID_TRAILER = 139; + RSA_R_INVALID_X931_DIGEST = 142; + RSA_R_IQMP_NOT_INVERSE_OF_Q = 126; + RSA_R_KEY_PRIME_NUM_INVALID = 165; + RSA_R_KEY_SIZE_TOO_SMALL = 120; + RSA_R_LAST_OCTET_INVALID = 134; + RSA_R_MISSING_PRIVATE_KEY = 179; + RSA_R_MGF1_DIGEST_NOT_ALLOWED = 152; + RSA_R_MODULUS_TOO_LARGE = 105; + RSA_R_MP_COEFFICIENT_NOT_INVERSE_OF_R = 168; + RSA_R_MP_EXPONENT_NOT_CONGRUENT_TO_D = 169; + RSA_R_MP_R_NOT_PRIME = 170; + RSA_R_NO_PUBLIC_EXPONENT = 140; + RSA_R_NULL_BEFORE_BLOCK_MISSING = 113; + RSA_R_N_DOES_NOT_EQUAL_PRODUCT_OF_PRIMES = 172; + RSA_R_N_DOES_NOT_EQUAL_P_Q = 127; + RSA_R_OAEP_DECODING_ERROR = 121; + RSA_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE = 148; + RSA_R_PADDING_CHECK_FAILED = 114; + RSA_R_PKCS_DECODING_ERROR = 159; + RSA_R_PSS_SALTLEN_TOO_SMALL = 164; + RSA_R_P_NOT_PRIME = 128; + RSA_R_Q_NOT_PRIME = 129; + RSA_R_RSA_OPERATIONS_NOT_SUPPORTED = 130; + RSA_R_SLEN_CHECK_FAILED = 136; + RSA_R_SLEN_RECOVERY_FAILED = 135; + RSA_R_SSLV3_ROLLBACK_ATTACK = 115; + RSA_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD = 116; + RSA_R_UNKNOWN_ALGORITHM_TYPE = 117; + RSA_R_UNKNOWN_DIGEST = 166; + RSA_R_UNKNOWN_MASK_DIGEST = 151; + RSA_R_UNKNOWN_PADDING_TYPE = 118; + RSA_R_UNSUPPORTED_ENCRYPTION_TYPE = 162; + RSA_R_UNSUPPORTED_LABEL_SOURCE = 163; + RSA_R_UNSUPPORTED_MASK_ALGORITHM = 153; + RSA_R_UNSUPPORTED_MASK_PARAMETER = 154; + RSA_R_UNSUPPORTED_SIGNATURE_TYPE = 155; + RSA_R_VALUE_MISSING = 147; + RSA_R_WRONG_SIGNATURE_LENGTH = 119; + + { The EXTERNALSYM directive is ignored by FPC, however, it is used by Delphi as follows: + + The EXTERNALSYM directive prevents the specified Delphi symbol from appearing in header + files generated for C++. } + + {$EXTERNALSYM ERR_load_RSA_strings} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +var + ERR_load_RSA_strings: function : TIdC_INT; cdecl = nil; + +{$ELSE} + function ERR_load_RSA_strings: TIdC_INT cdecl; external CLibCrypto; + +{$ENDIF} + +implementation + + uses + classes, + IdSSLOpenSSLExceptionHandlers, + IdResourceStringsOpenSSL + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + ,IdSSLOpenSSLLoader + {$ENDIF}; + + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +const + ERR_load_RSA_strings_procname = 'ERR_load_RSA_strings'; + + +{$WARN NO_RETVAL OFF} +function ERR_ERR_load_RSA_strings: TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ERR_load_RSA_strings_procname); +end; + + + +{$WARN NO_RETVAL ON} + +procedure Load(const ADllHandle: TIdLibHandle; LibVersion: TIdC_UINT; const AFailed: TStringList); + +var FuncLoadError: boolean; + +begin + ERR_load_RSA_strings := LoadLibFunction(ADllHandle, ERR_load_RSA_strings_procname); + FuncLoadError := not assigned(ERR_load_RSA_strings); + if FuncLoadError then + begin + {$if not defined(ERR_load_RSA_strings_allownil)} + ERR_load_RSA_strings := @ERR_ERR_load_RSA_strings; + {$ifend} + {$if declared(ERR_load_RSA_strings_introduced)} + if LibVersion < ERR_load_RSA_strings_introduced then + begin + {$if declared(FC_ERR_load_RSA_strings)} + ERR_load_RSA_strings := @FC_ERR_load_RSA_strings; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ERR_load_RSA_strings_removed)} + if ERR_load_RSA_strings_removed <= LibVersion then + begin + {$if declared(_ERR_load_RSA_strings)} + ERR_load_RSA_strings := @_ERR_load_RSA_strings; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ERR_load_RSA_strings_allownil)} + if FuncLoadError then + AFailed.Add('ERR_load_RSA_strings'); + {$ifend} + end; + + +end; + +procedure Unload; +begin + ERR_load_RSA_strings := nil; +end; +{$ELSE} +{$ENDIF} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +initialization + Register_SSLLoader(@Load,'LibCrypto'); + Register_SSLUnloader(@Unload); +{$ENDIF} +end. diff --git a/IdOpenSSLHeaders_safestack.pas b/IdOpenSSLHeaders_safestack.pas new file mode 100644 index 0000000..74c76d6 --- /dev/null +++ b/IdOpenSSLHeaders_safestack.pas @@ -0,0 +1,225 @@ +unit IdOpenSSLHeaders_safestack; + +{$i IdCompilerDefines.inc} +{$i IdSSLOpenSSLDefines.inc} + +{ ****************************************************************************** } +{ } +{ Indy (Internet Direct) - Internet Protocols Simplified } +{ } +{ https://www.indyproject.org/ } +{ https://gitter.im/IndySockets/Indy } +{ } +{ ****************************************************************************** } +{ } +{ This file is part of the Indy (Internet Direct) project, and is offered } +{ under the dual-licensing agreement described on the Indy website. } +{ (https://www.indyproject.org/license/) } +{ } +{ Copyright: } +{ (c) 1993-2020, Chad Z. Hower and the Indy Pit Crew. All rights reserved. } +{ } +{ ****************************************************************************** } +{ } +{ } +{ ****************************************************************************** } +interface + +uses + IdCTypes, + IdOpenSSLHeaders_stack; + +type + POPENSSL_STRING = PAnsiChar; + + PSTACK_OF_OPENSSL_STRING = pointer; + sk_OPENSSL_STRING_compfunc = function(a: PPAnsiChar; b: PPAnsiChar): TIdC_INT; + sk_OPENSSL_STRING_freefunc = procedure(a: PAnsiChar); + sk_OPENSSL_STRING_copyfunc = function(a: PAnsiChar): PAnsiChar; + +function sk_OPENSSL_STRING_num(sk: PSTACK_OF_OPENSSL_STRING): TIdC_INT; +{$IFDEF INLINE}inline; {$ENDIF} +function sk_OPENSSL_STRING_value(sk: PSTACK_OF_OPENSSL_STRING; idx: TIdC_INT) + : PAnsiChar; {$IFDEF INLINE}inline; {$ENDIF} +function sk_OPENSSL_STRING_new(compare: sk_OPENSSL_STRING_compfunc) + : PSTACK_OF_OPENSSL_STRING; {$IFDEF INLINE}inline; {$ENDIF} +function sk_OPENSSL_STRING_new_null: PSTACK_OF_OPENSSL_STRING; +{$IFDEF INLINE}inline; {$ENDIF} +procedure sk_OPENSSL_STRING_free(sk: PSTACK_OF_OPENSSL_STRING); +{$IFDEF INLINE}inline; {$ENDIF} +procedure sk_OPENSSL_STRING_zero(sk: PSTACK_OF_OPENSSL_STRING); +{$IFDEF INLINE}inline; {$ENDIF} +function sk_OPENSSL_STRING_delete(sk: PSTACK_OF_OPENSSL_STRING; i: TIdC_INT) + : PAnsiChar; {$IFDEF INLINE}inline; {$ENDIF} +function sk_OPENSSL_STRING_delete_ptr(sk: PSTACK_OF_OPENSSL_STRING; + ptr: PAnsiChar): PAnsiChar; {$IFDEF INLINE}inline; {$ENDIF} +function sk_OPENSSL_STRING_push(sk: PSTACK_OF_OPENSSL_STRING; ptr: PAnsiChar) + : TIdC_INT; {$IFDEF INLINE}inline; {$ENDIF} +function sk_OPENSSL_STRING_unshift(sk: PSTACK_OF_OPENSSL_STRING; ptr: PAnsiChar) + : TIdC_INT; {$IFDEF INLINE}inline; {$ENDIF} +function sk_OPENSSL_STRING_pop(sk: PSTACK_OF_OPENSSL_STRING): PAnsiChar; +{$IFDEF INLINE}inline; {$ENDIF} +function sk_OPENSSL_STRING_shift(sk: PSTACK_OF_OPENSSL_STRING): PAnsiChar; +{$IFDEF INLINE}inline; {$ENDIF} +procedure sk_OPENSSL_STRING_pop_free(sk: PSTACK_OF_OPENSSL_STRING; + freefunc: sk_OPENSSL_STRING_freefunc); {$IFDEF INLINE}inline; {$ENDIF} +function sk_OPENSSL_STRING_insert(sk: PSTACK_OF_OPENSSL_STRING; ptr: PAnsiChar; + idx: TIdC_INT): TIdC_INT; {$IFDEF INLINE}inline; {$ENDIF} +function sk_OPENSSL_STRING_set(sk: PSTACK_OF_OPENSSL_STRING; idx: TIdC_INT; + ptr: PAnsiChar): PAnsiChar; {$IFDEF INLINE}inline; {$ENDIF} +function sk_OPENSSL_STRING_find(sk: PSTACK_OF_OPENSSL_STRING; ptr: PAnsiChar) + : TIdC_INT; {$IFDEF INLINE}inline; {$ENDIF} +function sk_OPENSSL_STRING_find_ex(sk: PSTACK_OF_OPENSSL_STRING; ptr: PAnsiChar) + : TIdC_INT; {$IFDEF INLINE}inline; {$ENDIF} +procedure sk_OPENSSL_STRING_sort(sk: PSTACK_OF_OPENSSL_STRING); +{$IFDEF INLINE}inline; {$ENDIF} +function sk_OPENSSL_STRING_is_sorted(sk: PSTACK_OF_OPENSSL_STRING): TIdC_INT; +{$IFDEF INLINE}inline; {$ENDIF} +function sk_OPENSSL_STRING_dup(sk: PSTACK_OF_OPENSSL_STRING) + : PSTACK_OF_OPENSSL_STRING; {$IFDEF INLINE}inline; {$ENDIF} +function sk_OPENSSL_STRING_deep_copy(sk: PSTACK_OF_OPENSSL_STRING; + copyfunc: sk_OPENSSL_STRING_copyfunc; freefunc: sk_OPENSSL_STRING_freefunc) + : PSTACK_OF_OPENSSL_STRING; {$IFDEF INLINE}inline;{$ENDIF} +function sk_OPENSSL_STRING_set_cmp_func(sk: PSTACK_OF_OPENSSL_STRING; + compare: sk_OPENSSL_STRING_compfunc): sk_OPENSSL_STRING_compfunc; {$IFDEF INLINE}inline;{$ENDIF} + +implementation + +function sk_OPENSSL_STRING_num(sk: PSTACK_OF_OPENSSL_STRING): TIdC_INT; +{$IFDEF INLINE}inline; {$ENDIF} +begin + Result := OPENSSL_sk_num(POPENSSL_STACK(sk)); +end; + +function sk_OPENSSL_STRING_value(sk: PSTACK_OF_OPENSSL_STRING; idx: TIdC_INT) + : PAnsiChar; {$IFDEF INLINE}inline; {$ENDIF} +begin + Result := PAnsiChar(OPENSSL_sk_value(POPENSSL_STACK(sk), idx)); +end; + +function sk_OPENSSL_STRING_new(compare: sk_OPENSSL_STRING_compfunc) + : PSTACK_OF_OPENSSL_STRING; {$IFDEF INLINE}inline; {$ENDIF} +begin + Result := PSTACK_OF_OPENSSL_STRING + (OPENSSL_sk_new(TOPENSSL_sk_compfunc(compare))); +end; + +function sk_OPENSSL_STRING_new_null: PSTACK_OF_OPENSSL_STRING; +{$IFDEF INLINE}inline; {$ENDIF} +begin + Result := PSTACK_OF_OPENSSL_STRING(OPENSSL_sk_new_null); +end; + +procedure sk_OPENSSL_STRING_free(sk: PSTACK_OF_OPENSSL_STRING); +{$IFDEF INLINE}inline; {$ENDIF} +begin + OPENSSL_sk_free(POPENSSL_STACK(sk)); +end; + +procedure sk_OPENSSL_STRING_zero(sk: PSTACK_OF_OPENSSL_STRING); +{$IFDEF INLINE}inline; {$ENDIF} +begin + OPENSSL_sk_zero(POPENSSL_STACK(sk)); +end; + +function sk_OPENSSL_STRING_delete(sk: PSTACK_OF_OPENSSL_STRING; i: TIdC_INT) + : PAnsiChar; {$IFDEF INLINE}inline; {$ENDIF} +begin + Result := PAnsiChar(OPENSSL_sk_delete(POPENSSL_STACK(sk), i)); +end; + +function sk_OPENSSL_STRING_delete_ptr(sk: PSTACK_OF_OPENSSL_STRING; + ptr: PAnsiChar): PAnsiChar; {$IFDEF INLINE}inline; {$ENDIF} +begin + Result := PAnsiChar(OPENSSL_sk_delete_ptr(POPENSSL_STACK(sk), pointer(ptr))); +end; + +function sk_OPENSSL_STRING_push(sk: PSTACK_OF_OPENSSL_STRING; ptr: PAnsiChar) + : TIdC_INT; {$IFDEF INLINE}inline; {$ENDIF} +begin + Result := OPENSSL_sk_push(POPENSSL_STACK(sk), pointer(ptr)); +end; + +function sk_OPENSSL_STRING_unshift(sk: PSTACK_OF_OPENSSL_STRING; ptr: PAnsiChar) + : TIdC_INT; {$IFDEF INLINE}inline; {$ENDIF} +begin + Result := OPENSSL_sk_unshift(POPENSSL_STACK(sk), pointer(ptr)); +end; + +function sk_OPENSSL_STRING_pop(sk: PSTACK_OF_OPENSSL_STRING): PAnsiChar; +{$IFDEF INLINE}inline; {$ENDIF} +begin + Result := PAnsiChar(OPENSSL_sk_pop(POPENSSL_STACK(sk))); +end; + +function sk_OPENSSL_STRING_shift(sk: PSTACK_OF_OPENSSL_STRING): PAnsiChar; +{$IFDEF INLINE}inline; {$ENDIF} +begin + Result := PAnsiChar(OPENSSL_sk_shift(POPENSSL_STACK(sk))); +end; + +procedure sk_OPENSSL_STRING_pop_free(sk: PSTACK_OF_OPENSSL_STRING; + freefunc: sk_OPENSSL_STRING_freefunc); {$IFDEF INLINE}inline; {$ENDIF} +begin + OPENSSL_sk_pop_free(POPENSSL_STACK(sk), TOPENSSL_sk_freefunc(freefunc)); +end; + +function sk_OPENSSL_STRING_insert(sk: PSTACK_OF_OPENSSL_STRING; ptr: PAnsiChar; + idx: TIdC_INT): TIdC_INT; {$IFDEF INLINE}inline; {$ENDIF} +begin + Result := OPENSSL_sk_insert(POPENSSL_STACK(sk), pointer(ptr), idx); +end; + +function sk_OPENSSL_STRING_set(sk: PSTACK_OF_OPENSSL_STRING; idx: TIdC_INT; + ptr: PAnsiChar): PAnsiChar; {$IFDEF INLINE}inline; {$ENDIF} +begin + Result := PAnsiChar(OPENSSL_sk_set(POPENSSL_STACK(sk), idx, pointer(ptr))); +end; + +function sk_OPENSSL_STRING_find(sk: PSTACK_OF_OPENSSL_STRING; ptr: PAnsiChar) + : TIdC_INT; {$IFDEF INLINE}inline; {$ENDIF} +begin + Result := OPENSSL_sk_find(POPENSSL_STACK(sk), pointer(ptr)); +end; + +function sk_OPENSSL_STRING_find_ex(sk: PSTACK_OF_OPENSSL_STRING; ptr: PAnsiChar) + : TIdC_INT; {$IFDEF INLINE}inline; {$ENDIF} +begin + Result := OPENSSL_sk_find_ex(POPENSSL_STACK(sk), pointer(ptr)); +end; + +procedure sk_OPENSSL_STRING_sort(sk: PSTACK_OF_OPENSSL_STRING); +{$IFDEF INLINE}inline; {$ENDIF} +begin + OPENSSL_sk_sort(POPENSSL_STACK(sk)); +end; + +function sk_OPENSSL_STRING_is_sorted(sk: PSTACK_OF_OPENSSL_STRING): TIdC_INT; +{$IFDEF INLINE}inline; {$ENDIF} +begin + Result := OPENSSL_sk_is_sorted(POPENSSL_STACK(sk)); +end; + +function sk_OPENSSL_STRING_dup(sk: PSTACK_OF_OPENSSL_STRING) + : PSTACK_OF_OPENSSL_STRING; {$IFDEF INLINE}inline; {$ENDIF} +begin + Result := PSTACK_OF_OPENSSL_STRING(OPENSSL_sk_dup(POPENSSL_STACK(sk))); +end; + +function sk_OPENSSL_STRING_deep_copy(sk: PSTACK_OF_OPENSSL_STRING; + copyfunc: sk_OPENSSL_STRING_copyfunc; freefunc: sk_OPENSSL_STRING_freefunc) + : PSTACK_OF_OPENSSL_STRING; {$IFDEF INLINE}inline;{$ENDIF} +begin + Result := PSTACK_OF_OPENSSL_STRING(OPENSSL_sk_deep_copy(POPENSSL_STACK(sk), + TOPENSSL_sk_copyfunc(copyfunc), TOPENSSL_sk_freefunc(freefunc))); +end; + +function sk_OPENSSL_STRING_set_cmp_func(sk: PSTACK_OF_OPENSSL_STRING; + compare: sk_OPENSSL_STRING_compfunc): sk_OPENSSL_STRING_compfunc; {$IFDEF INLINE}inline;{$ENDIF} +begin + Result := sk_OPENSSL_STRING_compfunc + (OPENSSL_sk_set_cmp_func(POPENSSL_STACK(sk), + TOPENSSL_sk_compfunc(compare))); +end; + +end. diff --git a/IdOpenSSLHeaders_sha.pas b/IdOpenSSLHeaders_sha.pas new file mode 100644 index 0000000..577c361 --- /dev/null +++ b/IdOpenSSLHeaders_sha.pas @@ -0,0 +1,1155 @@ + (* This unit was generated using the script genOpenSSLHdrs.sh from the source file IdOpenSSLHeaders_sha.h2pas + It should not be modified directly. All changes should be made to IdOpenSSLHeaders_sha.h2pas + and this file regenerated. IdOpenSSLHeaders_sha.h2pas is distributed with the full Indy + Distribution. + *) + +{$i IdCompilerDefines.inc} +{$i IdSSLOpenSSLDefines.inc} +{$IFNDEF USE_OPENSSL} + { error Should not compile if USE_OPENSSL is not defined!!!} +{$ENDIF} +{******************************************************************************} +{ } +{ Indy (Internet Direct) - Internet Protocols Simplified } +{ } +{ https://www.indyproject.org/ } +{ https://gitter.im/IndySockets/Indy } +{ } +{******************************************************************************} +{ } +{ This file is part of the Indy (Internet Direct) project, and is offered } +{ under the dual-licensing agreement described on the Indy website. } +{ (https://www.indyproject.org/license/) } +{ } +{ Copyright: } +{ (c) 1993-2020, Chad Z. Hower and the Indy Pit Crew. All rights reserved. } +{ } +{******************************************************************************} +{ } +{ } +{******************************************************************************} + +unit IdOpenSSLHeaders_sha; + +interface + +// Headers for OpenSSL 1.1.1 +// sha.h + + +uses + IdCTypes, + IdGlobal, + IdSSLOpenSSLConsts; + +const + SHA_LBLOCK = 16; + SHA_CBLOCK = SHA_LBLOCK * 4; + + SHA_LAST_BLOCK = SHA_CBLOCK - 8; + SHA_DIGEST_LENGTH = 20; + + SHA256_CBLOCK = SHA_LBLOCK * 4; + + SHA224_DIGEST_LENGTH = 28; + SHA256_DIGEST_LENGTH = 32; + SHA384_DIGEST_LENGTH = 48; + SHA512_DIGEST_LENGTH = 64; + + SHA512_CBLOCK = SHA_LBLOCK * 8; + +type + SHA_LONG = TIdC_UINT; + + SHAstate_sf = record + h0, h1, h2, h3, h4: SHA_LONG; + Nl, Nh: SHA_LONG; + data: array[0 .. SHA_LAST_BLOCK - 1] of SHA_LONG; + num: TIdC_UINT; + end; + SHA_CTX = SHAstate_sf; + PSHA_CTX = ^SHA_CTX; + + SHAstate256_sf = record + h: array[0..7] of SHA_LONG; + Nl, Nh: SHA_LONG; + data: array[0 .. SHA_LAST_BLOCK - 1] of SHA_LONG; + num, md_len: TIdC_UINT; + end; + SHA256_CTX = SHAstate256_sf; + PSHA256_CTX = ^SHA256_CTX; + + SHA_LONG64 = TIdC_UINT64; + + SHA512state_st_u = record + case Integer of + 0: (d: array[0 .. SHA_LBLOCK - 1] of SHA_LONG64); + 1: (p: array[0 .. SHA512_CBLOCK - 1] of Byte); + end; + + SHA512state_st = record + h: array[0..7] of SHA_LONG64; + Nl, Nh: SHA_LONG64; + u: SHA512state_st_u; + num, md_len: TIdC_UINT; + end; + SHA512_CTX = SHA512state_st; + PSHA512_CTX = ^SHA512_CTX; + + { The EXTERNALSYM directive is ignored by FPC, however, it is used by Delphi as follows: + + The EXTERNALSYM directive prevents the specified Delphi symbol from appearing in header + files generated for C++. } + + {$EXTERNALSYM SHA1_Init} + {$EXTERNALSYM SHA1_Update} + {$EXTERNALSYM SHA1_Final} + {$EXTERNALSYM SHA1} + {$EXTERNALSYM SHA1_Transform} + {$EXTERNALSYM SHA224_Init} + {$EXTERNALSYM SHA224_Update} + {$EXTERNALSYM SHA224_Final} + {$EXTERNALSYM SHA224} + {$EXTERNALSYM SHA256_Init} + {$EXTERNALSYM SHA256_Update} + {$EXTERNALSYM SHA256_Final} + {$EXTERNALSYM SHA256} + {$EXTERNALSYM SHA256_Transform} + {$EXTERNALSYM SHA384_Init} + {$EXTERNALSYM SHA384_Update} + {$EXTERNALSYM SHA384_Final} + {$EXTERNALSYM SHA384} + {$EXTERNALSYM SHA512_Init} + {$EXTERNALSYM SHA512_Update} + {$EXTERNALSYM SHA512_Final} + {$EXTERNALSYM SHA512} + {$EXTERNALSYM SHA512_Transform} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +var + SHA1_Init: function (c: PSHA_CTX): TIdC_INT; cdecl = nil; + SHA1_Update: function (c: PSHA_CTX; const data: Pointer; len: TIdC_SIZET): TIdC_INT; cdecl = nil; + SHA1_Final: function (md: PByte; c: PSHA_CTX): TIdC_INT; cdecl = nil; + SHA1: function (const d: PByte; n: TIdC_SIZET; md: PByte): PByte; cdecl = nil; + SHA1_Transform: procedure (c: PSHA_CTX; const data: PByte); cdecl = nil; + + SHA224_Init: function (c: PSHA256_CTX): TIdC_INT; cdecl = nil; + SHA224_Update: function (c: PSHA256_CTX; const data: Pointer; len: TIdC_SIZET): TIdC_INT; cdecl = nil; + SHA224_Final: function (md: PByte; c: PSHA256_CTX): TIdC_INT; cdecl = nil; + SHA224: function (const d: PByte; n: TIdC_SIZET; md: PByte): PByte; cdecl = nil; + + SHA256_Init: function (c: PSHA256_CTX): TIdC_INT; cdecl = nil; + SHA256_Update: function (c: PSHA256_CTX; const data: Pointer; len: TIdC_SIZET): TIdC_INT; cdecl = nil; + SHA256_Final: function (md: PByte; c: PSHA256_CTX): TIdC_INT; cdecl = nil; + SHA256: function (const d: PByte; n: TIdC_SIZET; md: PByte): PByte; cdecl = nil; + SHA256_Transform: procedure (c: PSHA256_CTX; const data: PByte); cdecl = nil; + + SHA384_Init: function (c: PSHA512_CTX): TIdC_INT; cdecl = nil; + SHA384_Update: function (c: PSHA512_CTX; const data: Pointer; len: TIdC_SIZET): TIdC_INT; cdecl = nil; + SHA384_Final: function (md: PByte; c: PSHA512_CTX): TIdC_INT; cdecl = nil; + SHA384: function (const d: PByte; n: TIdC_SIZET; md: PByte): PByte; cdecl = nil; + + SHA512_Init: function (c: PSHA512_CTX): TIdC_INT; cdecl = nil; + SHA512_Update: function (c: PSHA512_CTX; const data: Pointer; len: TIdC_SIZET): TIdC_INT; cdecl = nil; + SHA512_Final: function (md: PByte; c: PSHA512_CTX): TIdC_INT; cdecl = nil; + SHA512: function (const d: PByte; n: TIdC_SIZET; md: PByte): PByte; cdecl = nil; + SHA512_Transform: procedure (c: PSHA512_CTX; const data: PByte); cdecl = nil; + +{$ELSE} + function SHA1_Init(c: PSHA_CTX): TIdC_INT cdecl; external CLibCrypto; + function SHA1_Update(c: PSHA_CTX; const data: Pointer; len: TIdC_SIZET): TIdC_INT cdecl; external CLibCrypto; + function SHA1_Final(md: PByte; c: PSHA_CTX): TIdC_INT cdecl; external CLibCrypto; + function SHA1(const d: PByte; n: TIdC_SIZET; md: PByte): PByte cdecl; external CLibCrypto; + procedure SHA1_Transform(c: PSHA_CTX; const data: PByte) cdecl; external CLibCrypto; + + function SHA224_Init(c: PSHA256_CTX): TIdC_INT cdecl; external CLibCrypto; + function SHA224_Update(c: PSHA256_CTX; const data: Pointer; len: TIdC_SIZET): TIdC_INT cdecl; external CLibCrypto; + function SHA224_Final(md: PByte; c: PSHA256_CTX): TIdC_INT cdecl; external CLibCrypto; + function SHA224(const d: PByte; n: TIdC_SIZET; md: PByte): PByte cdecl; external CLibCrypto; + + function SHA256_Init(c: PSHA256_CTX): TIdC_INT cdecl; external CLibCrypto; + function SHA256_Update(c: PSHA256_CTX; const data: Pointer; len: TIdC_SIZET): TIdC_INT cdecl; external CLibCrypto; + function SHA256_Final(md: PByte; c: PSHA256_CTX): TIdC_INT cdecl; external CLibCrypto; + function SHA256(const d: PByte; n: TIdC_SIZET; md: PByte): PByte cdecl; external CLibCrypto; + procedure SHA256_Transform(c: PSHA256_CTX; const data: PByte) cdecl; external CLibCrypto; + + function SHA384_Init(c: PSHA512_CTX): TIdC_INT cdecl; external CLibCrypto; + function SHA384_Update(c: PSHA512_CTX; const data: Pointer; len: TIdC_SIZET): TIdC_INT cdecl; external CLibCrypto; + function SHA384_Final(md: PByte; c: PSHA512_CTX): TIdC_INT cdecl; external CLibCrypto; + function SHA384(const d: PByte; n: TIdC_SIZET; md: PByte): PByte cdecl; external CLibCrypto; + + function SHA512_Init(c: PSHA512_CTX): TIdC_INT cdecl; external CLibCrypto; + function SHA512_Update(c: PSHA512_CTX; const data: Pointer; len: TIdC_SIZET): TIdC_INT cdecl; external CLibCrypto; + function SHA512_Final(md: PByte; c: PSHA512_CTX): TIdC_INT cdecl; external CLibCrypto; + function SHA512(const d: PByte; n: TIdC_SIZET; md: PByte): PByte cdecl; external CLibCrypto; + procedure SHA512_Transform(c: PSHA512_CTX; const data: PByte) cdecl; external CLibCrypto; + +{$ENDIF} + +implementation + + uses + classes, + IdSSLOpenSSLExceptionHandlers, + IdResourceStringsOpenSSL + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + ,IdSSLOpenSSLLoader + {$ENDIF}; + + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +const + SHA1_Init_procname = 'SHA1_Init'; + SHA1_Update_procname = 'SHA1_Update'; + SHA1_Final_procname = 'SHA1_Final'; + SHA1_procname = 'SHA1'; + SHA1_Transform_procname = 'SHA1_Transform'; + + SHA224_Init_procname = 'SHA224_Init'; + SHA224_Update_procname = 'SHA224_Update'; + SHA224_Final_procname = 'SHA224_Final'; + SHA224_procname = 'SHA224'; + + SHA256_Init_procname = 'SHA256_Init'; + SHA256_Update_procname = 'SHA256_Update'; + SHA256_Final_procname = 'SHA256_Final'; + SHA256_procname = 'SHA256'; + SHA256_Transform_procname = 'SHA256_Transform'; + + SHA384_Init_procname = 'SHA384_Init'; + SHA384_Update_procname = 'SHA384_Update'; + SHA384_Final_procname = 'SHA384_Final'; + SHA384_procname = 'SHA384'; + + SHA512_Init_procname = 'SHA512_Init'; + SHA512_Update_procname = 'SHA512_Update'; + SHA512_Final_procname = 'SHA512_Final'; + SHA512_procname = 'SHA512'; + SHA512_Transform_procname = 'SHA512_Transform'; + + +{$WARN NO_RETVAL OFF} +function ERR_SHA1_Init(c: PSHA_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SHA1_Init_procname); +end; + + +function ERR_SHA1_Update(c: PSHA_CTX; const data: Pointer; len: TIdC_SIZET): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SHA1_Update_procname); +end; + + +function ERR_SHA1_Final(md: PByte; c: PSHA_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SHA1_Final_procname); +end; + + +function ERR_SHA1(const d: PByte; n: TIdC_SIZET; md: PByte): PByte; +begin + EIdAPIFunctionNotPresent.RaiseException(SHA1_procname); +end; + + +procedure ERR_SHA1_Transform(c: PSHA_CTX; const data: PByte); +begin + EIdAPIFunctionNotPresent.RaiseException(SHA1_Transform_procname); +end; + + + +function ERR_SHA224_Init(c: PSHA256_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SHA224_Init_procname); +end; + + +function ERR_SHA224_Update(c: PSHA256_CTX; const data: Pointer; len: TIdC_SIZET): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SHA224_Update_procname); +end; + + +function ERR_SHA224_Final(md: PByte; c: PSHA256_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SHA224_Final_procname); +end; + + +function ERR_SHA224(const d: PByte; n: TIdC_SIZET; md: PByte): PByte; +begin + EIdAPIFunctionNotPresent.RaiseException(SHA224_procname); +end; + + + +function ERR_SHA256_Init(c: PSHA256_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SHA256_Init_procname); +end; + + +function ERR_SHA256_Update(c: PSHA256_CTX; const data: Pointer; len: TIdC_SIZET): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SHA256_Update_procname); +end; + + +function ERR_SHA256_Final(md: PByte; c: PSHA256_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SHA256_Final_procname); +end; + + +function ERR_SHA256(const d: PByte; n: TIdC_SIZET; md: PByte): PByte; +begin + EIdAPIFunctionNotPresent.RaiseException(SHA256_procname); +end; + + +procedure ERR_SHA256_Transform(c: PSHA256_CTX; const data: PByte); +begin + EIdAPIFunctionNotPresent.RaiseException(SHA256_Transform_procname); +end; + + + +function ERR_SHA384_Init(c: PSHA512_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SHA384_Init_procname); +end; + + +function ERR_SHA384_Update(c: PSHA512_CTX; const data: Pointer; len: TIdC_SIZET): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SHA384_Update_procname); +end; + + +function ERR_SHA384_Final(md: PByte; c: PSHA512_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SHA384_Final_procname); +end; + + +function ERR_SHA384(const d: PByte; n: TIdC_SIZET; md: PByte): PByte; +begin + EIdAPIFunctionNotPresent.RaiseException(SHA384_procname); +end; + + + +function ERR_SHA512_Init(c: PSHA512_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SHA512_Init_procname); +end; + + +function ERR_SHA512_Update(c: PSHA512_CTX; const data: Pointer; len: TIdC_SIZET): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SHA512_Update_procname); +end; + + +function ERR_SHA512_Final(md: PByte; c: PSHA512_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SHA512_Final_procname); +end; + + +function ERR_SHA512(const d: PByte; n: TIdC_SIZET; md: PByte): PByte; +begin + EIdAPIFunctionNotPresent.RaiseException(SHA512_procname); +end; + + +procedure ERR_SHA512_Transform(c: PSHA512_CTX; const data: PByte); +begin + EIdAPIFunctionNotPresent.RaiseException(SHA512_Transform_procname); +end; + + + +{$WARN NO_RETVAL ON} + +procedure Load(const ADllHandle: TIdLibHandle; LibVersion: TIdC_UINT; const AFailed: TStringList); + +var FuncLoadError: boolean; + +begin + SHA1_Init := LoadLibFunction(ADllHandle, SHA1_Init_procname); + FuncLoadError := not assigned(SHA1_Init); + if FuncLoadError then + begin + {$if not defined(SHA1_Init_allownil)} + SHA1_Init := @ERR_SHA1_Init; + {$ifend} + {$if declared(SHA1_Init_introduced)} + if LibVersion < SHA1_Init_introduced then + begin + {$if declared(FC_SHA1_Init)} + SHA1_Init := @FC_SHA1_Init; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SHA1_Init_removed)} + if SHA1_Init_removed <= LibVersion then + begin + {$if declared(_SHA1_Init)} + SHA1_Init := @_SHA1_Init; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SHA1_Init_allownil)} + if FuncLoadError then + AFailed.Add('SHA1_Init'); + {$ifend} + end; + + + SHA1_Update := LoadLibFunction(ADllHandle, SHA1_Update_procname); + FuncLoadError := not assigned(SHA1_Update); + if FuncLoadError then + begin + {$if not defined(SHA1_Update_allownil)} + SHA1_Update := @ERR_SHA1_Update; + {$ifend} + {$if declared(SHA1_Update_introduced)} + if LibVersion < SHA1_Update_introduced then + begin + {$if declared(FC_SHA1_Update)} + SHA1_Update := @FC_SHA1_Update; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SHA1_Update_removed)} + if SHA1_Update_removed <= LibVersion then + begin + {$if declared(_SHA1_Update)} + SHA1_Update := @_SHA1_Update; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SHA1_Update_allownil)} + if FuncLoadError then + AFailed.Add('SHA1_Update'); + {$ifend} + end; + + + SHA1_Final := LoadLibFunction(ADllHandle, SHA1_Final_procname); + FuncLoadError := not assigned(SHA1_Final); + if FuncLoadError then + begin + {$if not defined(SHA1_Final_allownil)} + SHA1_Final := @ERR_SHA1_Final; + {$ifend} + {$if declared(SHA1_Final_introduced)} + if LibVersion < SHA1_Final_introduced then + begin + {$if declared(FC_SHA1_Final)} + SHA1_Final := @FC_SHA1_Final; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SHA1_Final_removed)} + if SHA1_Final_removed <= LibVersion then + begin + {$if declared(_SHA1_Final)} + SHA1_Final := @_SHA1_Final; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SHA1_Final_allownil)} + if FuncLoadError then + AFailed.Add('SHA1_Final'); + {$ifend} + end; + + + SHA1 := LoadLibFunction(ADllHandle, SHA1_procname); + FuncLoadError := not assigned(SHA1); + if FuncLoadError then + begin + {$if not defined(SHA1_allownil)} + SHA1 := @ERR_SHA1; + {$ifend} + {$if declared(SHA1_introduced)} + if LibVersion < SHA1_introduced then + begin + {$if declared(FC_SHA1)} + SHA1 := @FC_SHA1; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SHA1_removed)} + if SHA1_removed <= LibVersion then + begin + {$if declared(_SHA1)} + SHA1 := @_SHA1; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SHA1_allownil)} + if FuncLoadError then + AFailed.Add('SHA1'); + {$ifend} + end; + + + SHA1_Transform := LoadLibFunction(ADllHandle, SHA1_Transform_procname); + FuncLoadError := not assigned(SHA1_Transform); + if FuncLoadError then + begin + {$if not defined(SHA1_Transform_allownil)} + SHA1_Transform := @ERR_SHA1_Transform; + {$ifend} + {$if declared(SHA1_Transform_introduced)} + if LibVersion < SHA1_Transform_introduced then + begin + {$if declared(FC_SHA1_Transform)} + SHA1_Transform := @FC_SHA1_Transform; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SHA1_Transform_removed)} + if SHA1_Transform_removed <= LibVersion then + begin + {$if declared(_SHA1_Transform)} + SHA1_Transform := @_SHA1_Transform; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SHA1_Transform_allownil)} + if FuncLoadError then + AFailed.Add('SHA1_Transform'); + {$ifend} + end; + + + SHA224_Init := LoadLibFunction(ADllHandle, SHA224_Init_procname); + FuncLoadError := not assigned(SHA224_Init); + if FuncLoadError then + begin + {$if not defined(SHA224_Init_allownil)} + SHA224_Init := @ERR_SHA224_Init; + {$ifend} + {$if declared(SHA224_Init_introduced)} + if LibVersion < SHA224_Init_introduced then + begin + {$if declared(FC_SHA224_Init)} + SHA224_Init := @FC_SHA224_Init; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SHA224_Init_removed)} + if SHA224_Init_removed <= LibVersion then + begin + {$if declared(_SHA224_Init)} + SHA224_Init := @_SHA224_Init; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SHA224_Init_allownil)} + if FuncLoadError then + AFailed.Add('SHA224_Init'); + {$ifend} + end; + + + SHA224_Update := LoadLibFunction(ADllHandle, SHA224_Update_procname); + FuncLoadError := not assigned(SHA224_Update); + if FuncLoadError then + begin + {$if not defined(SHA224_Update_allownil)} + SHA224_Update := @ERR_SHA224_Update; + {$ifend} + {$if declared(SHA224_Update_introduced)} + if LibVersion < SHA224_Update_introduced then + begin + {$if declared(FC_SHA224_Update)} + SHA224_Update := @FC_SHA224_Update; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SHA224_Update_removed)} + if SHA224_Update_removed <= LibVersion then + begin + {$if declared(_SHA224_Update)} + SHA224_Update := @_SHA224_Update; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SHA224_Update_allownil)} + if FuncLoadError then + AFailed.Add('SHA224_Update'); + {$ifend} + end; + + + SHA224_Final := LoadLibFunction(ADllHandle, SHA224_Final_procname); + FuncLoadError := not assigned(SHA224_Final); + if FuncLoadError then + begin + {$if not defined(SHA224_Final_allownil)} + SHA224_Final := @ERR_SHA224_Final; + {$ifend} + {$if declared(SHA224_Final_introduced)} + if LibVersion < SHA224_Final_introduced then + begin + {$if declared(FC_SHA224_Final)} + SHA224_Final := @FC_SHA224_Final; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SHA224_Final_removed)} + if SHA224_Final_removed <= LibVersion then + begin + {$if declared(_SHA224_Final)} + SHA224_Final := @_SHA224_Final; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SHA224_Final_allownil)} + if FuncLoadError then + AFailed.Add('SHA224_Final'); + {$ifend} + end; + + + SHA224 := LoadLibFunction(ADllHandle, SHA224_procname); + FuncLoadError := not assigned(SHA224); + if FuncLoadError then + begin + {$if not defined(SHA224_allownil)} + SHA224 := @ERR_SHA224; + {$ifend} + {$if declared(SHA224_introduced)} + if LibVersion < SHA224_introduced then + begin + {$if declared(FC_SHA224)} + SHA224 := @FC_SHA224; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SHA224_removed)} + if SHA224_removed <= LibVersion then + begin + {$if declared(_SHA224)} + SHA224 := @_SHA224; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SHA224_allownil)} + if FuncLoadError then + AFailed.Add('SHA224'); + {$ifend} + end; + + + SHA256_Init := LoadLibFunction(ADllHandle, SHA256_Init_procname); + FuncLoadError := not assigned(SHA256_Init); + if FuncLoadError then + begin + {$if not defined(SHA256_Init_allownil)} + SHA256_Init := @ERR_SHA256_Init; + {$ifend} + {$if declared(SHA256_Init_introduced)} + if LibVersion < SHA256_Init_introduced then + begin + {$if declared(FC_SHA256_Init)} + SHA256_Init := @FC_SHA256_Init; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SHA256_Init_removed)} + if SHA256_Init_removed <= LibVersion then + begin + {$if declared(_SHA256_Init)} + SHA256_Init := @_SHA256_Init; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SHA256_Init_allownil)} + if FuncLoadError then + AFailed.Add('SHA256_Init'); + {$ifend} + end; + + + SHA256_Update := LoadLibFunction(ADllHandle, SHA256_Update_procname); + FuncLoadError := not assigned(SHA256_Update); + if FuncLoadError then + begin + {$if not defined(SHA256_Update_allownil)} + SHA256_Update := @ERR_SHA256_Update; + {$ifend} + {$if declared(SHA256_Update_introduced)} + if LibVersion < SHA256_Update_introduced then + begin + {$if declared(FC_SHA256_Update)} + SHA256_Update := @FC_SHA256_Update; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SHA256_Update_removed)} + if SHA256_Update_removed <= LibVersion then + begin + {$if declared(_SHA256_Update)} + SHA256_Update := @_SHA256_Update; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SHA256_Update_allownil)} + if FuncLoadError then + AFailed.Add('SHA256_Update'); + {$ifend} + end; + + + SHA256_Final := LoadLibFunction(ADllHandle, SHA256_Final_procname); + FuncLoadError := not assigned(SHA256_Final); + if FuncLoadError then + begin + {$if not defined(SHA256_Final_allownil)} + SHA256_Final := @ERR_SHA256_Final; + {$ifend} + {$if declared(SHA256_Final_introduced)} + if LibVersion < SHA256_Final_introduced then + begin + {$if declared(FC_SHA256_Final)} + SHA256_Final := @FC_SHA256_Final; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SHA256_Final_removed)} + if SHA256_Final_removed <= LibVersion then + begin + {$if declared(_SHA256_Final)} + SHA256_Final := @_SHA256_Final; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SHA256_Final_allownil)} + if FuncLoadError then + AFailed.Add('SHA256_Final'); + {$ifend} + end; + + + SHA256 := LoadLibFunction(ADllHandle, SHA256_procname); + FuncLoadError := not assigned(SHA256); + if FuncLoadError then + begin + {$if not defined(SHA256_allownil)} + SHA256 := @ERR_SHA256; + {$ifend} + {$if declared(SHA256_introduced)} + if LibVersion < SHA256_introduced then + begin + {$if declared(FC_SHA256)} + SHA256 := @FC_SHA256; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SHA256_removed)} + if SHA256_removed <= LibVersion then + begin + {$if declared(_SHA256)} + SHA256 := @_SHA256; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SHA256_allownil)} + if FuncLoadError then + AFailed.Add('SHA256'); + {$ifend} + end; + + + SHA256_Transform := LoadLibFunction(ADllHandle, SHA256_Transform_procname); + FuncLoadError := not assigned(SHA256_Transform); + if FuncLoadError then + begin + {$if not defined(SHA256_Transform_allownil)} + SHA256_Transform := @ERR_SHA256_Transform; + {$ifend} + {$if declared(SHA256_Transform_introduced)} + if LibVersion < SHA256_Transform_introduced then + begin + {$if declared(FC_SHA256_Transform)} + SHA256_Transform := @FC_SHA256_Transform; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SHA256_Transform_removed)} + if SHA256_Transform_removed <= LibVersion then + begin + {$if declared(_SHA256_Transform)} + SHA256_Transform := @_SHA256_Transform; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SHA256_Transform_allownil)} + if FuncLoadError then + AFailed.Add('SHA256_Transform'); + {$ifend} + end; + + + SHA384_Init := LoadLibFunction(ADllHandle, SHA384_Init_procname); + FuncLoadError := not assigned(SHA384_Init); + if FuncLoadError then + begin + {$if not defined(SHA384_Init_allownil)} + SHA384_Init := @ERR_SHA384_Init; + {$ifend} + {$if declared(SHA384_Init_introduced)} + if LibVersion < SHA384_Init_introduced then + begin + {$if declared(FC_SHA384_Init)} + SHA384_Init := @FC_SHA384_Init; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SHA384_Init_removed)} + if SHA384_Init_removed <= LibVersion then + begin + {$if declared(_SHA384_Init)} + SHA384_Init := @_SHA384_Init; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SHA384_Init_allownil)} + if FuncLoadError then + AFailed.Add('SHA384_Init'); + {$ifend} + end; + + + SHA384_Update := LoadLibFunction(ADllHandle, SHA384_Update_procname); + FuncLoadError := not assigned(SHA384_Update); + if FuncLoadError then + begin + {$if not defined(SHA384_Update_allownil)} + SHA384_Update := @ERR_SHA384_Update; + {$ifend} + {$if declared(SHA384_Update_introduced)} + if LibVersion < SHA384_Update_introduced then + begin + {$if declared(FC_SHA384_Update)} + SHA384_Update := @FC_SHA384_Update; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SHA384_Update_removed)} + if SHA384_Update_removed <= LibVersion then + begin + {$if declared(_SHA384_Update)} + SHA384_Update := @_SHA384_Update; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SHA384_Update_allownil)} + if FuncLoadError then + AFailed.Add('SHA384_Update'); + {$ifend} + end; + + + SHA384_Final := LoadLibFunction(ADllHandle, SHA384_Final_procname); + FuncLoadError := not assigned(SHA384_Final); + if FuncLoadError then + begin + {$if not defined(SHA384_Final_allownil)} + SHA384_Final := @ERR_SHA384_Final; + {$ifend} + {$if declared(SHA384_Final_introduced)} + if LibVersion < SHA384_Final_introduced then + begin + {$if declared(FC_SHA384_Final)} + SHA384_Final := @FC_SHA384_Final; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SHA384_Final_removed)} + if SHA384_Final_removed <= LibVersion then + begin + {$if declared(_SHA384_Final)} + SHA384_Final := @_SHA384_Final; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SHA384_Final_allownil)} + if FuncLoadError then + AFailed.Add('SHA384_Final'); + {$ifend} + end; + + + SHA384 := LoadLibFunction(ADllHandle, SHA384_procname); + FuncLoadError := not assigned(SHA384); + if FuncLoadError then + begin + {$if not defined(SHA384_allownil)} + SHA384 := @ERR_SHA384; + {$ifend} + {$if declared(SHA384_introduced)} + if LibVersion < SHA384_introduced then + begin + {$if declared(FC_SHA384)} + SHA384 := @FC_SHA384; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SHA384_removed)} + if SHA384_removed <= LibVersion then + begin + {$if declared(_SHA384)} + SHA384 := @_SHA384; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SHA384_allownil)} + if FuncLoadError then + AFailed.Add('SHA384'); + {$ifend} + end; + + + SHA512_Init := LoadLibFunction(ADllHandle, SHA512_Init_procname); + FuncLoadError := not assigned(SHA512_Init); + if FuncLoadError then + begin + {$if not defined(SHA512_Init_allownil)} + SHA512_Init := @ERR_SHA512_Init; + {$ifend} + {$if declared(SHA512_Init_introduced)} + if LibVersion < SHA512_Init_introduced then + begin + {$if declared(FC_SHA512_Init)} + SHA512_Init := @FC_SHA512_Init; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SHA512_Init_removed)} + if SHA512_Init_removed <= LibVersion then + begin + {$if declared(_SHA512_Init)} + SHA512_Init := @_SHA512_Init; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SHA512_Init_allownil)} + if FuncLoadError then + AFailed.Add('SHA512_Init'); + {$ifend} + end; + + + SHA512_Update := LoadLibFunction(ADllHandle, SHA512_Update_procname); + FuncLoadError := not assigned(SHA512_Update); + if FuncLoadError then + begin + {$if not defined(SHA512_Update_allownil)} + SHA512_Update := @ERR_SHA512_Update; + {$ifend} + {$if declared(SHA512_Update_introduced)} + if LibVersion < SHA512_Update_introduced then + begin + {$if declared(FC_SHA512_Update)} + SHA512_Update := @FC_SHA512_Update; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SHA512_Update_removed)} + if SHA512_Update_removed <= LibVersion then + begin + {$if declared(_SHA512_Update)} + SHA512_Update := @_SHA512_Update; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SHA512_Update_allownil)} + if FuncLoadError then + AFailed.Add('SHA512_Update'); + {$ifend} + end; + + + SHA512_Final := LoadLibFunction(ADllHandle, SHA512_Final_procname); + FuncLoadError := not assigned(SHA512_Final); + if FuncLoadError then + begin + {$if not defined(SHA512_Final_allownil)} + SHA512_Final := @ERR_SHA512_Final; + {$ifend} + {$if declared(SHA512_Final_introduced)} + if LibVersion < SHA512_Final_introduced then + begin + {$if declared(FC_SHA512_Final)} + SHA512_Final := @FC_SHA512_Final; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SHA512_Final_removed)} + if SHA512_Final_removed <= LibVersion then + begin + {$if declared(_SHA512_Final)} + SHA512_Final := @_SHA512_Final; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SHA512_Final_allownil)} + if FuncLoadError then + AFailed.Add('SHA512_Final'); + {$ifend} + end; + + + SHA512 := LoadLibFunction(ADllHandle, SHA512_procname); + FuncLoadError := not assigned(SHA512); + if FuncLoadError then + begin + {$if not defined(SHA512_allownil)} + SHA512 := @ERR_SHA512; + {$ifend} + {$if declared(SHA512_introduced)} + if LibVersion < SHA512_introduced then + begin + {$if declared(FC_SHA512)} + SHA512 := @FC_SHA512; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SHA512_removed)} + if SHA512_removed <= LibVersion then + begin + {$if declared(_SHA512)} + SHA512 := @_SHA512; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SHA512_allownil)} + if FuncLoadError then + AFailed.Add('SHA512'); + {$ifend} + end; + + + SHA512_Transform := LoadLibFunction(ADllHandle, SHA512_Transform_procname); + FuncLoadError := not assigned(SHA512_Transform); + if FuncLoadError then + begin + {$if not defined(SHA512_Transform_allownil)} + SHA512_Transform := @ERR_SHA512_Transform; + {$ifend} + {$if declared(SHA512_Transform_introduced)} + if LibVersion < SHA512_Transform_introduced then + begin + {$if declared(FC_SHA512_Transform)} + SHA512_Transform := @FC_SHA512_Transform; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SHA512_Transform_removed)} + if SHA512_Transform_removed <= LibVersion then + begin + {$if declared(_SHA512_Transform)} + SHA512_Transform := @_SHA512_Transform; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SHA512_Transform_allownil)} + if FuncLoadError then + AFailed.Add('SHA512_Transform'); + {$ifend} + end; + + +end; + +procedure Unload; +begin + SHA1_Init := nil; + SHA1_Update := nil; + SHA1_Final := nil; + SHA1 := nil; + SHA1_Transform := nil; + SHA224_Init := nil; + SHA224_Update := nil; + SHA224_Final := nil; + SHA224 := nil; + SHA256_Init := nil; + SHA256_Update := nil; + SHA256_Final := nil; + SHA256 := nil; + SHA256_Transform := nil; + SHA384_Init := nil; + SHA384_Update := nil; + SHA384_Final := nil; + SHA384 := nil; + SHA512_Init := nil; + SHA512_Update := nil; + SHA512_Final := nil; + SHA512 := nil; + SHA512_Transform := nil; +end; +{$ELSE} +{$ENDIF} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +initialization + Register_SSLLoader(@Load,'LibCrypto'); + Register_SSLUnloader(@Unload); +{$ENDIF} +end. diff --git a/IdOpenSSLHeaders_srtp.pas b/IdOpenSSLHeaders_srtp.pas new file mode 100644 index 0000000..2d12a8c --- /dev/null +++ b/IdOpenSSLHeaders_srtp.pas @@ -0,0 +1,247 @@ + (* This unit was generated using the script genOpenSSLHdrs.sh from the source file IdOpenSSLHeaders_srtp.h2pas + It should not be modified directly. All changes should be made to IdOpenSSLHeaders_srtp.h2pas + and this file regenerated. IdOpenSSLHeaders_srtp.h2pas is distributed with the full Indy + Distribution. + *) + +{$i IdCompilerDefines.inc} +{$i IdSSLOpenSSLDefines.inc} +{$IFNDEF USE_OPENSSL} + { error Should not compile if USE_OPENSSL is not defined!!!} +{$ENDIF} +{******************************************************************************} +{ } +{ Indy (Internet Direct) - Internet Protocols Simplified } +{ } +{ https://www.indyproject.org/ } +{ https://gitter.im/IndySockets/Indy } +{ } +{******************************************************************************} +{ } +{ This file is part of the Indy (Internet Direct) project, and is offered } +{ under the dual-licensing agreement described on the Indy website. } +{ (https://www.indyproject.org/license/) } +{ } +{ Copyright: } +{ (c) 1993-2020, Chad Z. Hower and the Indy Pit Crew. All rights reserved. } +{ } +{******************************************************************************} +{ } +{ } +{******************************************************************************} + +unit IdOpenSSLHeaders_srtp; + +interface + +// Headers for OpenSSL 1.1.1 +// srtp.h + + +uses + IdCTypes, + IdGlobal, + IdSSLOpenSSLConsts, + IdOpenSSLHeaders_ossl_typ, + IdOpenSSLHeaders_ssl; + +const + SRTP_AES128_CM_SHA1_80 = $0001; + SRTP_AES128_CM_SHA1_32 = $0002; + SRTP_AES128_F8_SHA1_80 = $0003; + SRTP_AES128_F8_SHA1_32 = $0004; + SRTP_NULL_SHA1_80 = $0005; + SRTP_NULL_SHA1_32 = $0006; + + (* AEAD SRTP protection profiles from RFC 7714 *) + SRTP_AEAD_AES_128_GCM = $0007; + SRTP_AEAD_AES_256_GCM = $0008; + + { The EXTERNALSYM directive is ignored by FPC, however, it is used by Delphi as follows: + + The EXTERNALSYM directive prevents the specified Delphi symbol from appearing in header + files generated for C++. } + + {$EXTERNALSYM SSL_CTX_set_tlsext_use_srtp} + {$EXTERNALSYM SSL_set_tlsext_use_srtp} + {$EXTERNALSYM SSL_get_selected_srtp_profile} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +var + SSL_CTX_set_tlsext_use_srtp: function (ctx: PSSL_CTX; const profiles: PIdAnsiChar): TIdC_INT; cdecl = nil; + SSL_set_tlsext_use_srtp: function (ctx: PSSL_CTX; const profiles: PIdAnsiChar): TIdC_INT; cdecl = nil; + + //function SSL_get_srtp_profiles(s: PSSL): PSTACK_OF_SRTP_PROTECTION_PROFILE; + SSL_get_selected_srtp_profile: function (s: PSSL): PSRTP_PROTECTION_PROFILE; cdecl = nil; + +{$ELSE} + function SSL_CTX_set_tlsext_use_srtp(ctx: PSSL_CTX; const profiles: PIdAnsiChar): TIdC_INT cdecl; external CLibCrypto; + function SSL_set_tlsext_use_srtp(ctx: PSSL_CTX; const profiles: PIdAnsiChar): TIdC_INT cdecl; external CLibCrypto; + + //function SSL_get_srtp_profiles(s: PSSL): PSTACK_OF_SRTP_PROTECTION_PROFILE; + function SSL_get_selected_srtp_profile(s: PSSL): PSRTP_PROTECTION_PROFILE cdecl; external CLibCrypto; + +{$ENDIF} + +implementation + + uses + classes, + IdSSLOpenSSLExceptionHandlers, + IdResourceStringsOpenSSL + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + ,IdSSLOpenSSLLoader + {$ENDIF}; + + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +const + SSL_CTX_set_tlsext_use_srtp_procname = 'SSL_CTX_set_tlsext_use_srtp'; + SSL_set_tlsext_use_srtp_procname = 'SSL_set_tlsext_use_srtp'; + + //function SSL_get_srtp_profiles(s: PSSL): PSTACK_OF_SRTP_PROTECTION_PROFILE; + SSL_get_selected_srtp_profile_procname = 'SSL_get_selected_srtp_profile'; + + +{$WARN NO_RETVAL OFF} +function ERR_SSL_CTX_set_tlsext_use_srtp(ctx: PSSL_CTX; const profiles: PIdAnsiChar): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_set_tlsext_use_srtp_procname); +end; + + +function ERR_SSL_set_tlsext_use_srtp(ctx: PSSL_CTX; const profiles: PIdAnsiChar): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_set_tlsext_use_srtp_procname); +end; + + + + //function SSL_get_srtp_profiles(s: PSSL): PSTACK_OF_SRTP_PROTECTION_PROFILE; +function ERR_SSL_get_selected_srtp_profile(s: PSSL): PSRTP_PROTECTION_PROFILE; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_get_selected_srtp_profile_procname); +end; + + + +{$WARN NO_RETVAL ON} + +procedure Load(const ADllHandle: TIdLibHandle; LibVersion: TIdC_UINT; const AFailed: TStringList); + +var FuncLoadError: boolean; + +begin + SSL_CTX_set_tlsext_use_srtp := LoadLibFunction(ADllHandle, SSL_CTX_set_tlsext_use_srtp_procname); + FuncLoadError := not assigned(SSL_CTX_set_tlsext_use_srtp); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_set_tlsext_use_srtp_allownil)} + SSL_CTX_set_tlsext_use_srtp := @ERR_SSL_CTX_set_tlsext_use_srtp; + {$ifend} + {$if declared(SSL_CTX_set_tlsext_use_srtp_introduced)} + if LibVersion < SSL_CTX_set_tlsext_use_srtp_introduced then + begin + {$if declared(FC_SSL_CTX_set_tlsext_use_srtp)} + SSL_CTX_set_tlsext_use_srtp := @FC_SSL_CTX_set_tlsext_use_srtp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_set_tlsext_use_srtp_removed)} + if SSL_CTX_set_tlsext_use_srtp_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_set_tlsext_use_srtp)} + SSL_CTX_set_tlsext_use_srtp := @_SSL_CTX_set_tlsext_use_srtp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_set_tlsext_use_srtp_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_set_tlsext_use_srtp'); + {$ifend} + end; + + + SSL_set_tlsext_use_srtp := LoadLibFunction(ADllHandle, SSL_set_tlsext_use_srtp_procname); + FuncLoadError := not assigned(SSL_set_tlsext_use_srtp); + if FuncLoadError then + begin + {$if not defined(SSL_set_tlsext_use_srtp_allownil)} + SSL_set_tlsext_use_srtp := @ERR_SSL_set_tlsext_use_srtp; + {$ifend} + {$if declared(SSL_set_tlsext_use_srtp_introduced)} + if LibVersion < SSL_set_tlsext_use_srtp_introduced then + begin + {$if declared(FC_SSL_set_tlsext_use_srtp)} + SSL_set_tlsext_use_srtp := @FC_SSL_set_tlsext_use_srtp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_set_tlsext_use_srtp_removed)} + if SSL_set_tlsext_use_srtp_removed <= LibVersion then + begin + {$if declared(_SSL_set_tlsext_use_srtp)} + SSL_set_tlsext_use_srtp := @_SSL_set_tlsext_use_srtp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_set_tlsext_use_srtp_allownil)} + if FuncLoadError then + AFailed.Add('SSL_set_tlsext_use_srtp'); + {$ifend} + end; + + + SSL_get_selected_srtp_profile := LoadLibFunction(ADllHandle, SSL_get_selected_srtp_profile_procname); + FuncLoadError := not assigned(SSL_get_selected_srtp_profile); + if FuncLoadError then + begin + {$if not defined(SSL_get_selected_srtp_profile_allownil)} + SSL_get_selected_srtp_profile := @ERR_SSL_get_selected_srtp_profile; + {$ifend} + {$if declared(SSL_get_selected_srtp_profile_introduced)} + if LibVersion < SSL_get_selected_srtp_profile_introduced then + begin + {$if declared(FC_SSL_get_selected_srtp_profile)} + SSL_get_selected_srtp_profile := @FC_SSL_get_selected_srtp_profile; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_get_selected_srtp_profile_removed)} + if SSL_get_selected_srtp_profile_removed <= LibVersion then + begin + {$if declared(_SSL_get_selected_srtp_profile)} + SSL_get_selected_srtp_profile := @_SSL_get_selected_srtp_profile; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_get_selected_srtp_profile_allownil)} + if FuncLoadError then + AFailed.Add('SSL_get_selected_srtp_profile'); + {$ifend} + end; + + +end; + +procedure Unload; +begin + SSL_CTX_set_tlsext_use_srtp := nil; + SSL_set_tlsext_use_srtp := nil; + SSL_get_selected_srtp_profile := nil; +end; +{$ELSE} +{$ENDIF} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +initialization + Register_SSLLoader(@Load,'LibCrypto'); + Register_SSLUnloader(@Unload); +{$ENDIF} +end. diff --git a/IdOpenSSLHeaders_ssl.pas b/IdOpenSSLHeaders_ssl.pas new file mode 100644 index 0000000..f79b2b6 --- /dev/null +++ b/IdOpenSSLHeaders_ssl.pas @@ -0,0 +1,25437 @@ + (* This unit was generated using the script genOpenSSLHdrs.sh from the source file IdOpenSSLHeaders_ssl.h2pas + It should not be modified directly. All changes should be made to IdOpenSSLHeaders_ssl.h2pas + and this file regenerated. IdOpenSSLHeaders_ssl.h2pas is distributed with the full Indy + Distribution. + *) + +{$i IdCompilerDefines.inc} +{$i IdSSLOpenSSLDefines.inc} +{$IFNDEF USE_OPENSSL} + { error Should not compile if USE_OPENSSL is not defined!!!} +{$ENDIF} +{******************************************************************************} +{ } +{ Indy (Internet Direct) - Internet Protocols Simplified } +{ } +{ https://www.indyproject.org/ } +{ https://gitter.im/IndySockets/Indy } +{ } +{******************************************************************************} +{ } +{ This file is part of the Indy (Internet Direct) project, and is offered } +{ under the dual-licensing agreement described on the Indy website. } +{ (https://www.indyproject.org/license/) } +{ } +{ Copyright: } +{ (c) 1993-2020, Chad Z. Hower and the Indy Pit Crew. All rights reserved. } +{ } +{******************************************************************************} +{ } +{ } +{******************************************************************************} + +unit IdOpenSSLHeaders_ssl; + +interface + +// Headers for OpenSSL 1.1.1 +// ssl.h + + +uses + IdCTypes, + IdGlobal, + IdSSLOpenSSLConsts, + IdOpenSSLHeaders_ossl_typ, + IdOpenSSLHeaders_async, + IdOpenSSLHeaders_bio, + IdOpenSSLHeaders_crypto, + IdOpenSSLHeaders_pem, + IdOpenSSLHeaders_tls1, + IdOpenSSLHeaders_ssl3, + IdOpenSSLHeaders_x509; + +{$MINENUMSIZE 4} + +const + (* OpenSSL version number for ASN.1 encoding of the session information *) + (*- + * Version 0 - initial version + * Version 1 - added the optional peer certificate + *) + SSL_SESSION_ASN1_VERSION = $0001; + + SSL_MAX_SSL_SESSION_ID_LENGTH = 32; + SSL_MAX_SID_CTX_LENGTH = 32; + + SSL_MIN_RSA_MODULUS_LENGTH_IN_BYTES = 512/8; + SSL_MAX_KEY_ARG_LENGTH = 8; + SSL_MAX_MASTER_KEY_LENGTH = 48; + + (* The maximum number of encrypt/decrypt pipelines we can support *) + SSL_MAX_PIPELINES = 32; + + (* text strings for the ciphers *) + + (* These are used to specify which ciphers to use and not to use *) + + SSL_TXT_LOW = AnsiString('LOW'); + SSL_TXT_MEDIUM = AnsiString('MEDIUM'); + SSL_TXT_HIGH = AnsiString('HIGH'); + SSL_TXT_FIPS = AnsiString('FIPS'); + + SSL_TXT_aNULL = AnsiString('aNULL'); + SSL_TXT_eNULL = AnsiString('eNULL'); + SSL_TXT_NULL = AnsiString('NULL'); + + SSL_TXT_kRSA = AnsiString('kRSA'); + SSL_TXT_kDHr = AnsiString('kDHr'); + SSL_TXT_kDHd = AnsiString('kDHd'); + SSL_TXT_kDH = AnsiString('kDH'); + SSL_TXT_kEDH = AnsiString('kEDH'); + SSL_TXT_kDHE = AnsiString('kDHE'); + SSL_TXT_kECDHr = AnsiString('kECDHr'); +//const SSL_TXT_kECDHe = AnsiString('kECDHe'); + SSL_TXT_kECDH = AnsiString('kECDH'); + SSL_TXT_kEECDH = AnsiString('kEECDH'); + SSL_TXT_kECDHE = AnsiString('kECDHE'); + SSL_TXT_kPSK = AnsiString('kPSK'); + SSL_TXT_kRSAPSK = AnsiString('kRSAPSK'); + SSL_TXT_kECDHEPSK = AnsiString('kECDHEPSK'); + SSL_TXT_kDHEPSK = AnsiString('kDHEPSK'); + SSL_TXT_kGOST = AnsiString('kGOST'); + SSL_TXT_kSRP = AnsiString('kSRP'); + + SSL_TXT_aRSA = AnsiString('aRSA'); + SSL_TXT_aDSS = AnsiString('aDSS'); + SSL_TXT_aDH = AnsiString('aDH'); + SSL_TXT_aECDH = AnsiString('aECDH'); + SSL_TXT_aECDSA = AnsiString('aECDSA'); + SSL_TXT_aPSK = AnsiString('aPSK'); + SSL_TXT_aGOST94 = AnsiString('aGOST94'); + SSL_TXT_aGOST01 = AnsiString('aGOST01'); + SSL_TXT_aGOST12 = AnsiString('aGOST12'); + SSL_TXT_aGOST = AnsiString('aGOST'); + SSL_TXT_aSRP = AnsiString('aSRP'); + + SSL_TXT_DSS = AnsiString('DSS'); + SSL_TXT_DH = AnsiString('DH'); + SSL_TXT_DHE = AnsiString('DHE'); + SSL_TXT_EDH = AnsiString('EDH'); + //SSL_TXT_ADH = AnsiString('ADH'); + SSL_TXT_RSA = AnsiString('RSA'); + SSL_TXT_ECDH = AnsiString('ECDH'); + SSL_TXT_EECDH = AnsiString('EECDH'); + SSL_TXT_ECDHE = AnsiString('ECDHE'); + //SSL_TXT_AECDH = AnsiString('AECDH'); + SSL_TXT_ECDSA = AnsiString('ECDSA'); + SSL_TXT_PSK = AnsiString('PSK'); + SSL_TXT_SRP = AnsiString('SRP'); + + SSL_TXT_DES = AnsiString('DES'); + SSL_TXT_3DES = AnsiString('3DES'); + SSL_TXT_RC4 = AnsiString('RC4'); + SSL_TXT_RC2 = AnsiString('RC2'); + SSL_TXT_IDEA = AnsiString('IDEA'); + SSL_TXT_SEED = AnsiString('SEED'); + SSL_TXT_AES128 = AnsiString('AES128'); + SSL_TXT_AES256 = AnsiString('AES256'); + SSL_TXT_AES = AnsiString('AES'); + SSL_TXT_AES_GCM = AnsiString('AESGCM'); + SSL_TXT_AES_CCM = AnsiString('AESCCM'); + SSL_TXT_AES_CCM_8 = AnsiString('AESCCM8'); + SSL_TXT_CAMELLIA128 = AnsiString('CAMELLIA128'); + SSL_TXT_CAMELLIA256 = AnsiString('CAMELLIA256'); + SSL_TXT_CAMELLIA = AnsiString('CAMELLIA'); + SSL_TXT_CHACHA20 = AnsiString('CHACHA20'); + SSL_TXT_GOST = AnsiString('GOST89'); + SSL_TXT_ARIA = AnsiString('ARIA'); + SSL_TXT_ARIA_GCM = AnsiString('ARIAGCM'); + SSL_TXT_ARIA128 = AnsiString('ARIA128'); + SSL_TXT_ARIA256 = AnsiString('ARIA256'); + + SSL_TXT_MD5 = AnsiString('MD5'); + SSL_TXT_SHA1 = AnsiString('SHA1'); + SSL_TXT_SHA = AnsiString('SHA'); + SSL_TXT_GOST94 = AnsiString('GOST94'); + SSL_TXT_GOST89MAC = AnsiString('GOST89MAC'); + SSL_TXT_GOST12 = AnsiString('GOST12'); + SSL_TXT_GOST89MAC12 = AnsiString('GOST89MAC12'); + SSL_TXT_SHA256 = AnsiString('SHA256'); + SSL_TXT_SHA384 = AnsiString('SHA384'); + + SSL_TXT_SSLV3 = AnsiString('SSLv3'); + SSL_TXT_TLSV1 = AnsiString('TLSv1'); + SSL_TXT_TLSV1_1 = AnsiString('TLSv1.1'); + SSL_TXT_TLSV1_2 = AnsiString('TLSv1.2'); + + SSL_TXT_ALL = AnsiString('ALL'); + + (*- + * COMPLEMENTOF* definitions. These identifiers are used to (de-select) + * ciphers normally not being used. + * Example: "RC4" will activate all ciphers using RC4 including ciphers + * without authentication, which would normally disabled by DEFAULT (due + * the "!ADH" being part of default). Therefore "RC4:!COMPLEMENTOFDEFAULT" + * will make sure that it is also disabled in the specific selection. + * COMPLEMENTOF* identifiers are portable between version, as adjustments + * to the default cipher setup will also be included here. + * + * COMPLEMENTOFDEFAULT does not experience the same special treatment that + * DEFAULT gets, as only selection is being done and no sorting as needed + * for DEFAULT. + *) + SSL_TXT_CMPALL = AnsiString('COMPLEMENTOFALL'); + SSL_TXT_CMPDEF = AnsiString('COMPLEMENTOFDEFAULT'); + + (* + * The following cipher list is used by default. It also is substituted when + * an application-defined cipher list string starts with 'DEFAULT'. + * This applies to ciphersuites for TLSv1.2 and below. + *) + SSL_DEFAULT_CIPHER_LIST = AnsiString('ALL:!COMPLEMENTOFDEFAULT:!eNULL'); + (* This is the default set of TLSv1.3 ciphersuites *) + TLS_DEFAULT_CIPHERSUITES = AnsiString('TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_GCM_SHA256'); + + (* + * As of OpenSSL 1.0.0, ssl_create_cipher_list() in ssl/ssl_ciph.c always + * starts with a reasonable order, and all we have to do for DEFAULT is + * throwing out anonymous and unencrypted ciphersuites! (The latter are not + * actually enabled by ALL, but "ALL:RSA" would enable some of them.) + *) + + (* Used in SSL_set_shutdown()/SSL_get_shutdown(); *) + SSL_SENT_SHUTDOWN = 1; + SSL_RECEIVED_SHUTDOWN = 2; + + SSL_FILETYPE_ASN1 = X509_FILETYPE_ASN1; + SSL_FILETYPE_PEM = X509_FILETYPE_PEM; + + {Error codes for the SSL functions.} + SSL_F_SSL_CTX_USE_CERTIFICATE_CHAIN_FILE = 220; + + (* Extension context codes *) + (* This extension is only allowed in TLS *) + SSL_EXT_TLS_ONLY = $0001; + (* This extension is only allowed in DTLS *) + SSL_EXT_DTLS_ONLY = $0002; + (* Some extensions may be allowed in DTLS but we don't implement them for it *) + SSL_EXT_TLS_IMPLEMENTATION_ONLY = $0004; + (* Most extensions are not defined for SSLv3 but EXT_TYPE_renegotiate is *) + SSL_EXT_SSL3_ALLOWED = $0008; + (* Extension is only defined for TLS1.2 and below *) + SSL_EXT_TLS1_2_AND_BELOW_ONLY = $0010; + (* Extension is only defined for TLS1.3 and above *) + SSL_EXT_TLS1_3_ONLY = $0020; + (* Ignore this extension during parsing if we are resuming *) + SSL_EXT_IGNORE_ON_RESUMPTION = $0040; + SSL_EXT_CLIENT_HELLO = $0080; + (* Really means TLS1.2 or below *) + SSL_EXT_TLS1_2_SERVER_HELLO = $0100; + SSL_EXT_TLS1_3_SERVER_HELLO = $0200; + SSL_EXT_TLS1_3_ENCRYPTED_EXTENSIONS = $0400; + SSL_EXT_TLS1_3_HELLO_RETRY_REQUEST = $0800; + SSL_EXT_TLS1_3_CERTIFICATE = $1000; + SSL_EXT_TLS1_3_NEW_SESSION_TICKET = $2000; + SSL_EXT_TLS1_3_CERTIFICATE_REQUEST = $4000; + + (* + * Some values are reserved until OpenSSL 1.2.0 because they were previously + * included in SSL_OP_ALL in a 1.1.x release. + * + * Reserved value (until OpenSSL 1.2.0) $00000001U + * Reserved value (until OpenSSL 1.2.0) $00000002U + *) + (* Allow initial connection to servers that don't support RI *) + SSL_OP_LEGACY_SERVER_CONNECT = TIdC_UINT($00000004); + + (* Reserved value (until OpenSSL 1.2.0) $00000008U *) + SSL_OP_TLSEXT_PADDING = TIdC_UINT($00000010); + (* Reserved value (until OpenSSL 1.2.0) $00000020U *) + SSL_OP_SAFARI_ECDHE_ECDSA_BUG = TIdC_UINT($00000040); + (* + * Reserved value (until OpenSSL 1.2.0) $00000080U + * Reserved value (until OpenSSL 1.2.0) $00000100U + * Reserved value (until OpenSSL 1.2.0) $00000200U + *) + + (* In TLSv1.3 allow a non-(ec)dhe based kex_mode *) + SSL_OP_ALLOW_NO_DHE_KEX = TIdC_UINT($00000400); + + (* + * Disable SSL 3.0/TLS 1.0 CBC vulnerability workaround that was added in + * OpenSSL 0.9.6d. Usually (depending on the application protocol) the + * workaround is not needed. Unfortunately some broken SSL/TLS + * implementations cannot handle it at all, which is why we include it in + * SSL_OP_ALL. Added in 0.9.6e + *) + SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS = TIdC_UINT($00000800); + + (* DTLS options *) + SSL_OP_NO_QUERY_MTU = TIdC_UINT($00001000); + (* Turn on Cookie Exchange (on relevant for servers) *) + SSL_OP_COOKIE_EXCHANGE = TIdC_UINT($00002000); + (* Don't use RFC4507 ticket extension *) + SSL_OP_NO_TICKET = TIdC_UINT($00004000); + (* Use Cisco's "speshul" version of DTLS_BAD_VER + * (only with deprecated DTLSv1_client_method()) *) + SSL_OP_CISCO_ANYCONNECT = TIdC_UINT($00008000); + + (* As server, disallow session resumption on renegotiation *) + SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION = TIdC_UINT($00010000); + (* Don't use compression even if supported *) + SSL_OP_NO_COMPRESSION = TIdC_UINT($00020000); + (* Permit unsafe legacy renegotiation *) + SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION = TIdC_UINT($00040000); + (* Disable encrypt-then-mac *) + SSL_OP_NO_ENCRYPT_THEN_MAC = TIdC_UINT($00080000); + + (* + * Enable TLSv1.3 Compatibility mode. This is on by default. A future version + * of OpenSSL may have this disabled by default. + *) + SSL_OP_ENABLE_MIDDLEBOX_COMPAT = TIdC_UINT($00100000); + + (* Prioritize Chacha20Poly1305 when client does. + * Modifies SSL_OP_CIPHER_SERVER_PREFERENCE *) + SSL_OP_PRIORITIZE_CHACHA = TIdC_UINT($00200000); + + (* + * Set on servers to choose the cipher according to the server's preferences + *) + SSL_OP_CIPHER_SERVER_PREFERENCE = TIdC_UINT($00400000); + (* + * If set, a server will allow a client to issue a SSLv3.0 version number as + * latest version supported in the premaster secret, even when TLSv1.0 + * (version 3.1) was announced in the client hello. Normally this is + * forbidden to prevent version rollback attacks. + *) + SSL_OP_TLS_ROLLBACK_BUG = TIdC_UINT($00800000); + + (* + * Switches off automatic TLSv1.3 anti-replay protection for early data. This + * is a server-side option only (no effect on the client). + *) + SSL_OP_NO_ANTI_REPLAY = TIdC_UINT($01000000); + + SSL_OP_NO_SSLv3 = TIdC_UINT($02000000); + SSL_OP_NO_TLSv1 = TIdC_UINT($04000000); + SSL_OP_NO_TLSv1_2 = TIdC_UINT($08000000); + SSL_OP_NO_TLSv1_1 = TIdC_UINT($10000000); + SSL_OP_NO_TLSv1_3 = TIdC_UINT($20000000); + + SSL_OP_NO_DTLSv1 = TIdC_UINT($04000000); + SSL_OP_NO_DTLSv1_2 = TIdC_UINT($08000000); + + SSL_OP_NO_SSL_MASK = SSL_OP_NO_SSLv3 or SSL_OP_NO_TLSv1 or SSL_OP_NO_TLSv1_1 + or SSL_OP_NO_TLSv1_2 or SSL_OP_NO_TLSv1_3; + SSL_OP_NO_DTLS_MASK = SSL_OP_NO_DTLSv1 or SSL_OP_NO_DTLSv1_2; + + (* Disallow all renegotiation *) + SSL_OP_NO_RENEGOTIATION = TIdC_UINT($40000000); + + (* + * Make server add server-hello extension from early version of cryptopro + * draft, when GOST ciphersuite is negotiated. Required for interoperability + * with CryptoPro CSP 3.x + *) + SSL_OP_CRYPTOPRO_TLSEXT_BUG = TIdC_UINT($80000000); + + (* + * SSL_OP_ALL: various bug workarounds that should be rather harmless. + * This used to be $000FFFFFL before 0.9.7. + * This used to be $80000BFFU before 1.1.1. + *) + SSL_OP_ALL = SSL_OP_CRYPTOPRO_TLSEXT_BUG or SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS + or SSL_OP_LEGACY_SERVER_CONNECT or SSL_OP_TLSEXT_PADDING or SSL_OP_SAFARI_ECDHE_ECDSA_BUG; + + (* OBSOLETE OPTIONS: retained for compatibility *) + + (* Removed from OpenSSL 1.1.0. Was $00000001L *) + (* Related to removed SSLv2. *) + SSL_OP_MICROSOFT_SESS_ID_BUG = $0; + (* Removed from OpenSSL 1.1.0. Was $00000002L *) + (* Related to removed SSLv2. *) + SSL_OP_NETSCAPE_CHALLENGE_BUG = $0; + (* Removed from OpenSSL 0.9.8q and 1.0.0c. Was $00000008L *) + (* Dead forever, see CVE-2010-4180 *) + SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG = $0; + (* Removed from OpenSSL 1.0.1h and 1.0.2. Was $00000010L *) + (* Refers to ancient SSLREF and SSLv2. *) + SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG = $0; + (* Removed from OpenSSL 1.1.0. Was $00000020 *) + SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER = $0; + (* Removed from OpenSSL 0.9.7h and 0.9.8b. Was $00000040L *) + SSL_OP_MSIE_SSLV2_RSA_PADDING = $0; + (* Removed from OpenSSL 1.1.0. Was $00000080 *) + (* Ancient SSLeay version. *) + SSL_OP_SSLEAY_080_CLIENT_DH_BUG = $0; + (* Removed from OpenSSL 1.1.0. Was $00000100L *) + SSL_OP_TLS_D5_BUG = $0; + (* Removed from OpenSSL 1.1.0. Was $00000200L *) + SSL_OP_TLS_BLOCK_PADDING_BUG = $0; + (* Removed from OpenSSL 1.1.0. Was $00080000L *) + SSL_OP_SINGLE_ECDH_USE = $0; + (* Removed from OpenSSL 1.1.0. Was $00100000L *) + SSL_OP_SINGLE_DH_USE = $0; + (* Removed from OpenSSL 1.0.1k and 1.0.2. Was $00200000L *) + SSL_OP_EPHEMERAL_RSA = $0; + (* Removed from OpenSSL 1.1.0. Was $01000000L *) + SSL_OP_NO_SSLv2 = $0; + (* Removed from OpenSSL 1.0.1. Was $08000000L *) + SSL_OP_PKCS1_CHECK_1 = $0; + (* Removed from OpenSSL 1.0.1. Was $10000000L *) + SSL_OP_PKCS1_CHECK_2 = $0; + (* Removed from OpenSSL 1.1.0. Was $20000000L *) + SSL_OP_NETSCAPE_CA_DN_BUG = $0; + (* Removed from OpenSSL 1.1.0. Was $40000000L *) + SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG = $0; + + (* + * Allow SSL_write(..., n) to return r with 0 < r < n (i.e. report success + * when just a single record has been written): + *) + SSL_MODE_ENABLE_PARTIAL_WRITE = TIdC_UINT($00000001); + (* + * Make it possible to retry SSL_write() with changed buffer location (buffer + * contents must stay the same!); this is not the default to avoid the + * misconception that non-blocking SSL_write() behaves like non-blocking + * write(): + *) + SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER = TIdC_UINT($00000002); + (* + * Never bother the application with retries if the transport is blocking: + *) + SSL_MODE_AUTO_RETRY = TIdC_UINT($00000004); + (* Don't attempt to automatically build certificate chain *) + SSL_MODE_NO_AUTO_CHAIN = TIdC_UINT($00000008); + (* + * Save RAM by releasing read and write buffers when they're empty. (SSL3 and + * TLS only.) Released buffers are freed. + *) + SSL_MODE_RELEASE_BUFFERS = TIdC_UINT($00000010); + (* + * Send the current time in the Random fields of the ClientHello and + * ServerHello records for compatibility with hypothetical implementations + * that require it. + *) + SSL_MODE_SEND_CLIENTHELLO_TIME = TIdC_UINT($00000020); + SSL_MODE_SEND_SERVERHELLO_TIME = TIdC_UINT($00000040); + (* + * Send TLS_FALLBACK_SCSV in the ClientHello. To be set only by applications + * that reconnect with a downgraded protocol version; see + * draft-ietf-tls-downgrade-scsv-00 for details. DO NOT ENABLE THIS if your + * application attempts a normal handshake. Only use this in explicit + * fallback retries, following the guidance in + * draft-ietf-tls-downgrade-scsv-00. + *) + SSL_MODE_SEND_FALLBACK_SCSV = TIdC_UINT($00000080); + (* + * Support Asynchronous operation + *) + SSL_MODE_ASYNC = TIdC_UINT($00000100); + + (* + * When using DTLS/SCTP, include the terminating zero in the label + * used for computing the endpoint-pair shared secret. Required for + * interoperability with implementations having this bug like these + * older version of OpenSSL: + * - OpenSSL 1.0.0 series + * - OpenSSL 1.0.1 series + * - OpenSSL 1.0.2 series + * - OpenSSL 1.1.0 series + * - OpenSSL 1.1.1 and 1.1.1a + *) + SSL_MODE_DTLS_SCTP_LABEL_LENGTH_BUG = TIdC_UINT($00000400); + + (* Cert related flags *) + (* + * Many implementations ignore some aspects of the TLS standards such as + * enforcing certificate chain algorithms. When this is set we enforce them. + *) + SSL_CERT_FLAG_TLS_STRICT = TIdC_UINT($00000001); + (* Suite B modes, takes same values as certificate verify flags *) + SSL_CERT_FLAG_SUITEB_128_LOS_ONLY = $10000; + (* Suite B 192 bit only mode *) + SSL_CERT_FLAG_SUITEB_192_LOS = $20000; + (* Suite B 128 bit mode allowing 192 bit algorithms *) + SSL_CERT_FLAG_SUITEB_128_LOS = $30000; + + (* Perform all sorts of protocol violations for testing purposes *) + SSL_CERT_FLAG_BROKEN_PROTOCOL = $10000000; + + (* Flags for building certificate chains *) + (* Treat any existing certificates as untrusted CAs *) + SSL_BUILD_CHAIN_FLAG_UNTRUSTED = $1; + (* Don't include root CA in chain *) + SSL_BUILD_CHAIN_FLAG_NO_ROOT = $2; + (* Just check certificates already there *) + SSL_BUILD_CHAIN_FLAG_CHECK = $4; + (* Ignore verification errors *) + SSL_BUILD_CHAIN_FLAG_IGNORE_ERROR = $8; + (* Clear verification errors from queue *) + SSL_BUILD_CHAIN_FLAG_CLEAR_ERROR = $10; + + (* Flags returned by SSL_check_chain *) + (* Certificate can be used with this session *) + CERT_PKEY_VALID = $1; + (* Certificate can also be used for signing *) + CERT_PKEY_SIGN = $2; + (* EE certificate signing algorithm OK *) + CERT_PKEY_EE_SIGNATURE = $10; + (* CA signature algorithms OK *) + CERT_PKEY_CA_SIGNATURE = $20; + (* EE certificate parameters OK *) + CERT_PKEY_EE_PARAM = $40; + (* CA certificate parameters OK *) + CERT_PKEY_CA_PARAM = $80; + (* Signing explicitly allowed as opposed to SHA1 fallback *) + CERT_PKEY_EXPLICIT_SIGN = $100; + (* Client CA issuer names match (always set for server cert) *) + CERT_PKEY_ISSUER_NAME = $200; + (* Cert type matches client types (always set for server cert) *) + CERT_PKEY_CERT_TYPE = $400; + (* Cert chain suitable to Suite B *) + CERT_PKEY_SUITEB = $800; + + SSL_CONF_FLAG_CMDLINE = $1; + SSL_CONF_FLAG_FILE = $2; + SSL_CONF_FLAG_CLIENT = $4; + SSL_CONF_FLAG_SERVER = $8; + SSL_CONF_FLAG_SHOW_ERRORS = $10; + SSL_CONF_FLAG_CERTIFICATE = $20; + SSL_CONF_FLAG_REQUIRE_PRIVATE = $40; + (* Configuration value types *) + SSL_CONF_TYPE_UNKNOWN = $0; + SSL_CONF_TYPE_STRING = $1; + SSL_CONF_TYPE_FILE = $2; + SSL_CONF_TYPE_DIR = $3; + SSL_CONF_TYPE_NONE = $4; + + (* Maximum length of the application-controlled segment of a a TLSv1.3 cookie *) + SSL_COOKIE_LENGTH = 4096; + + (* 100k max cert list *) + SSL_MAX_CERT_LIST_DEFAULT = 1024 * 100; + SSL_SESSION_CACHE_MAX_SIZE_DEFAULT = 1024 * 20; + + SSL_SESS_CACHE_OFF = $0000; + SSL_SESS_CACHE_CLIENT = $0001; + SSL_SESS_CACHE_SERVER = $0002; + SSL_SESS_CACHE_BOTH = (SSL_SESS_CACHE_CLIENT or SSL_SESS_CACHE_SERVER); + SSL_SESS_CACHE_NO_AUTO_CLEAR = $0080; + (* enough comments already ... see SSL_CTX_set_session_cache_mode(3) *) + SSL_SESS_CACHE_NO_INTERNAL_LOOKUP = $0100; + SSL_SESS_CACHE_NO_INTERNAL_STORE = $0200; + SSL_SESS_CACHE_NO_INTERNAL = (SSL_SESS_CACHE_NO_INTERNAL_LOOKUP or SSL_SESS_CACHE_NO_INTERNAL_STORE); + + OPENSSL_NPN_UNSUPPORTED = 0; + OPENSSL_NPN_NEGOTIATED = 1; + OPENSSL_NPN_NO_OVERLAP = 2; + + (* + * the maximum length of the buffer given to callbacks containing the + * resulting identity/psk + *) + PSK_MAX_IDENTITY_LEN = 128; + PSK_MAX_PSK_LEN = 256; + + SSL_NOTHING = 1; + SSL_WRITING = 2; + SSL_READING = 3; + SSL_X509_LOOKUP = 4; + SSL_ASYNC_PAUSED = 5; + SSL_ASYNC_NO_JOBS = 6; + SSL_CLIENT_HELLO_CB = 7; + + SSL_MAC_FLAG_READ_MAC_STREAM = 1; + SSL_MAC_FLAG_WRITE_MAC_STREAM = 2; + + (* TLSv1.3 KeyUpdate message types *) + (* -1 used so that this is an invalid value for the on-the-wire protocol *) + SSL_KEY_UPDATE_NONE = -1; + (* Values as defined for the on-the-wire protocol *) + SSL_KEY_UPDATE_NOT_REQUESTED = 0; + SSL_KEY_UPDATE_REQUESTED = 1; + + (* + * Most of the following state values are no longer used and are defined to be + * the closest equivalent value in_ the current state machine code. Not all + * defines have an equivalent and are set to a dummy value (-1). SSL_ST_CONNECT + * and SSL_ST_ACCEPT are still in_ use in_ the definition of SSL_CB_ACCEPT_LOOP, + * SSL_CB_ACCEPT_EXIT, SSL_CB_CONNECT_LOOP and SSL_CB_CONNECT_EXIT. + *) + SSL_ST_CONNECT = $1000; + SSL_ST_ACCEPT = $2000; + + SSL_ST_MASK = $0FFF; + + SSL_CB_LOOP = $01; + SSL_CB_EXIT = $02; + SSL_CB_READ = $04; + SSL_CB_WRITE = $08; + SSL_CB_ALERT = $4000; + SSL_CB_READ_ALERT = SSL_CB_ALERT or SSL_CB_READ; + SSL_CB_WRITE_ALERT = SSL_CB_ALERT or SSL_CB_WRITE; + SSL_CB_ACCEPT_LOOP = SSL_ST_ACCEPT or SSL_CB_LOOP; + SSL_CB_ACCEPT_EXIT = SSL_ST_ACCEPT or SSL_CB_EXIT; + SSL_CB_CONNECT_LOOP = SSL_ST_CONNECT or SSL_CB_LOOP; + SSL_CB_CONNECT_EXIT = SSL_ST_CONNECT or SSL_CB_EXIT; + SSL_CB_HANDSHAKE_START = $10; + SSL_CB_HANDSHAKE_DONE = $20; + + (* + * The following 3 states are kept in ssl->rlayer.rstate when reads fail, you + * should not need these + *) + SSL_ST_READ_HEADER = $F0; + SSL_ST_READ_BODY = $F1; + SSL_ST_READ_DONE = $F2; + + (* + * use either SSL_VERIFY_NONE or SSL_VERIFY_PEER, the last 3 options are + * 'ored' with SSL_VERIFY_PEER if they are desired + *) + SSL_VERIFY_NONE = $00; + SSL_VERIFY_PEER = $01; + SSL_VERIFY_FAIL_IF_NO_PEER_CERT = $02; + SSL_VERIFY_CLIENT_ONCE = $04; + SSL_VERIFY_POST_HANDSHAKE = $08; + + SSL_AD_REASON_OFFSET = 1000; (* offset to get SSL_R_... value + * from SSL_AD_... *) + (* These alert types are for SSLv3 and TLSv1 *) + SSL_AD_CLOSE_NOTIFY = SSL3_AD_CLOSE_NOTIFY; + (* fatal *) + SSL_AD_UNEXPECTED_MESSAGE = SSL3_AD_UNEXPECTED_MESSAGE; + (* fatal *) + SSL_AD_BAD_RECORD_MAC = SSL3_AD_BAD_RECORD_MAC; + SSL_AD_DECRYPTION_FAILED = TLS1_AD_DECRYPTION_FAILED; + SSL_AD_RECORD_OVERFLOW = TLS1_AD_RECORD_OVERFLOW; + (* fatal *) + SSL_AD_DECOMPRESSION_FAILURE = SSL3_AD_DECOMPRESSION_FAILURE; + (* fatal *) + SSL_AD_HANDSHAKE_FAILURE = SSL3_AD_HANDSHAKE_FAILURE; + (* Not for TLS *) + SSL_AD_NO_CERTIFICATE = SSL3_AD_NO_CERTIFICATE; + SSL_AD_BAD_CERTIFICATE = SSL3_AD_BAD_CERTIFICATE; + SSL_AD_UNSUPPORTED_CERTIFICATE = SSL3_AD_UNSUPPORTED_CERTIFICATE; + SSL_AD_CERTIFICATE_REVOKED = SSL3_AD_CERTIFICATE_REVOKED; + SSL_AD_CERTIFICATE_EXPIRED = SSL3_AD_CERTIFICATE_EXPIRED; + SSL_AD_CERTIFICATE_UNKNOWN = SSL3_AD_CERTIFICATE_UNKNOWN; + (* fatal *) + SSL_AD_ILLEGAL_PARAMETER = SSL3_AD_ILLEGAL_PARAMETER; + (* fatal *) + SSL_AD_UNKNOWN_CA = TLS1_AD_UNKNOWN_CA; + (* fatal *) + SSL_AD_ACCESS_DENIED = TLS1_AD_ACCESS_DENIED; + (* fatal *) + SSL_AD_DECODE_ERROR = TLS1_AD_DECODE_ERROR; + SSL_AD_DECRYPT_ERROR = TLS1_AD_DECRYPT_ERROR; + (* fatal *) + SSL_AD_EXPORT_RESTRICTION = TLS1_AD_EXPORT_RESTRICTION; + (* fatal *) + SSL_AD_PROTOCOL_VERSION = TLS1_AD_PROTOCOL_VERSION; + (* fatal *) + SSL_AD_INSUFFICIENT_SECURITY = TLS1_AD_INSUFFICIENT_SECURITY; + (* fatal *) + SSL_AD_INTERNAL_ERROR = TLS1_AD_INTERNAL_ERROR; + SSL_AD_USER_CANCELLED = TLS1_AD_USER_CANCELLED; + SSL_AD_NO_RENEGOTIATION = TLS1_AD_NO_RENEGOTIATION; + SSL_AD_MISSING_EXTENSION = TLS13_AD_MISSING_EXTENSION; + SSL_AD_CERTIFICATE_REQUIRED = TLS13_AD_CERTIFICATE_REQUIRED; + SSL_AD_UNSUPPORTED_EXTENSION = TLS1_AD_UNSUPPORTED_EXTENSION; + SSL_AD_CERTIFICATE_UNOBTAINABLE = TLS1_AD_CERTIFICATE_UNOBTAINABLE; + SSL_AD_UNRECOGNIZED_NAME = TLS1_AD_UNRECOGNIZED_NAME; + SSL_AD_BAD_CERTIFICATE_STATUS_RESPONSE = TLS1_AD_BAD_CERTIFICATE_STATUS_RESPONSE; + SSL_AD_BAD_CERTIFICATE_HASH_VALUE = TLS1_AD_BAD_CERTIFICATE_HASH_VALUE; + (* fatal *) + SSL_AD_UNKNOWN_PSK_IDENTITY = TLS1_AD_UNKNOWN_PSK_IDENTITY; + (* fatal *) + SSL_AD_INAPPROPRIATE_FALLBACK = TLS1_AD_INAPPROPRIATE_FALLBACK; + SSL_AD_NO_APPLICATION_PROTOCOL = TLS1_AD_NO_APPLICATION_PROTOCOL; + SSL_ERROR_NONE = 0; + SSL_ERROR_SSL = 1; + SSL_ERROR_WANT_READ = 2; + SSL_ERROR_WANT_WRITE = 3; + SSL_ERROR_WANT_X509_LOOKUP = 4; + SSL_ERROR_SYSCALL = 5; (* look at error stack/return + * value/errno *) + SSL_ERROR_ZERO_RETURN = 6; + SSL_ERROR_WANT_CONNECT = 7; + SSL_ERROR_WANT_ACCEPT = 8; + SSL_ERROR_WANT_ASYNC = 9; + SSL_ERROR_WANT_ASYNC_JOB = 10; + SSL_ERROR_WANT_CLIENT_HELLO_CB = 11; + SSL_CTRL_SET_TMP_DH = 3; + SSL_CTRL_SET_TMP_ECDH = 4; + SSL_CTRL_SET_TMP_DH_CB = 6; + SSL_CTRL_GET_CLIENT_CERT_REQUEST = 9; + SSL_CTRL_GET_NUM_RENEGOTIATIONS = 10; + SSL_CTRL_CLEAR_NUM_RENEGOTIATIONS = 11; + SSL_CTRL_GET_TOTAL_RENEGOTIATIONS = 12; + SSL_CTRL_GET_FLAGS = 13; + SSL_CTRL_EXTRA_CHAIN_CERT = 14; + SSL_CTRL_SET_MSG_CALLBACK = 15; + SSL_CTRL_SET_MSG_CALLBACK_ARG = 16; + (* only applies to datagram connections *) + SSL_CTRL_SET_MTU = 17; + (* Stats *) + SSL_CTRL_SESS_NUMBER = 20; + SSL_CTRL_SESS_CONNECT = 21; + SSL_CTRL_SESS_CONNECT_GOOD = 22; + SSL_CTRL_SESS_CONNECT_RENEGOTIATE = 23; + SSL_CTRL_SESS_ACCEPT = 24; + SSL_CTRL_SESS_ACCEPT_GOOD = 25; + SSL_CTRL_SESS_ACCEPT_RENEGOTIATE = 26; + SSL_CTRL_SESS_HIT = 27; + SSL_CTRL_SESS_CB_HIT = 28; + SSL_CTRL_SESS_MISSES = 29; + SSL_CTRL_SESS_TIMEOUTS = 30; + SSL_CTRL_SESS_CACHE_FULL = 31; + SSL_CTRL_MODE = 33; + SSL_CTRL_GET_READ_AHEAD = 40; + SSL_CTRL_SET_READ_AHEAD = 41; + SSL_CTRL_SET_SESS_CACHE_SIZE = 42; + SSL_CTRL_GET_SESS_CACHE_SIZE = 43; + SSL_CTRL_SET_SESS_CACHE_MODE = 44; + SSL_CTRL_GET_SESS_CACHE_MODE = 45; + SSL_CTRL_GET_MAX_CERT_LIST = 50; + SSL_CTRL_SET_MAX_CERT_LIST = 51; + SSL_CTRL_SET_MAX_SEND_FRAGMENT = 52; + (* see tls1.h for macros based on these *) + SSL_CTRL_SET_TLSEXT_SERVERNAME_CB = 53; + SSL_CTRL_SET_TLSEXT_SERVERNAME_ARG = 54; + SSL_CTRL_SET_TLSEXT_HOSTNAME = 55; + SSL_CTRL_SET_TLSEXT_DEBUG_CB = 56; + SSL_CTRL_SET_TLSEXT_DEBUG_ARG = 57; + SSL_CTRL_GET_TLSEXT_TICKET_KEYS = 58; + SSL_CTRL_SET_TLSEXT_TICKET_KEYS = 59; + SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB = 63; + SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB_ARG = 64; + SSL_CTRL_SET_TLSEXT_STATUS_REQ_TYPE = 65; + SSL_CTRL_GET_TLSEXT_STATUS_REQ_EXTS = 66; + SSL_CTRL_SET_TLSEXT_STATUS_REQ_EXTS = 67; + SSL_CTRL_GET_TLSEXT_STATUS_REQ_IDS = 68; + SSL_CTRL_SET_TLSEXT_STATUS_REQ_IDS = 69; + SSL_CTRL_GET_TLSEXT_STATUS_REQ_OCSP_RESP = 70; + SSL_CTRL_SET_TLSEXT_STATUS_REQ_OCSP_RESP = 71; + SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB = 72; + SSL_CTRL_SET_TLS_EXT_SRP_USERNAME_CB = 75; + SSL_CTRL_SET_SRP_VERIFY_PARAM_CB = 76; + SSL_CTRL_SET_SRP_GIVE_CLIENT_PWD_CB = 77; + SSL_CTRL_SET_SRP_ARG = 78; + SSL_CTRL_SET_TLS_EXT_SRP_USERNAME = 79; + SSL_CTRL_SET_TLS_EXT_SRP_STRENGTH = 80; + SSL_CTRL_SET_TLS_EXT_SRP_PASSWORD = 81; + SSL_CTRL_DTLS_EXT_SEND_HEARTBEAT = 85; + SSL_CTRL_GET_DTLS_EXT_HEARTBEAT_PENDING = 86; + SSL_CTRL_SET_DTLS_EXT_HEARTBEAT_NO_REQUESTS = 87; + DTLS_CTRL_GET_TIMEOUT = 73; + DTLS_CTRL_HANDLE_TIMEOUT = 74; + SSL_CTRL_GET_RI_SUPPORT = 76; + SSL_CTRL_CLEAR_MODE = 78; + SSL_CTRL_SET_NOT_RESUMABLE_SESS_CB = 79; + SSL_CTRL_GET_EXTRA_CHAIN_CERTS = 82; + SSL_CTRL_CLEAR_EXTRA_CHAIN_CERTS = 83; + SSL_CTRL_CHAIN = 88; + SSL_CTRL_CHAIN_CERT = 89; + SSL_CTRL_GET_GROUPS = 90; + SSL_CTRL_SET_GROUPS = 91; + SSL_CTRL_SET_GROUPS_LIST = 92; + SSL_CTRL_GET_SHARED_GROUP = 93; + SSL_CTRL_SET_SIGALGS = 97; + SSL_CTRL_SET_SIGALGS_LIST = 98; + SSL_CTRL_CERT_FLAGS = 99; + SSL_CTRL_CLEAR_CERT_FLAGS = 100; + SSL_CTRL_SET_CLIENT_SIGALGS = 101; + SSL_CTRL_SET_CLIENT_SIGALGS_LIST = 102; + SSL_CTRL_GET_CLIENT_CERT_TYPES = 103; + SSL_CTRL_SET_CLIENT_CERT_TYPES = 104; + SSL_CTRL_BUILD_CERT_CHAIN = 105; + SSL_CTRL_SET_VERIFY_CERT_STORE = 106; + SSL_CTRL_SET_CHAIN_CERT_STORE = 107; + SSL_CTRL_GET_PEER_SIGNATURE_NID = 108; + SSL_CTRL_GET_PEER_TMP_KEY = 109; + SSL_CTRL_GET_RAW_CIPHERLIST = 110; + SSL_CTRL_GET_EC_POINT_FORMATS = 111; + SSL_CTRL_GET_CHAIN_CERTS = 115; + SSL_CTRL_SELECT_CURRENT_CERT = 116; + SSL_CTRL_SET_CURRENT_CERT = 117; + SSL_CTRL_SET_DH_AUTO = 118; + DTLS_CTRL_SET_LINK_MTU = 120; + DTLS_CTRL_GET_LINK_MIN_MTU = 121; + SSL_CTRL_GET_EXTMS_SUPPORT = 122; + SSL_CTRL_SET_MIN_PROTO_VERSION = 123; + SSL_CTRL_SET_MAX_PROTO_VERSION = 124; + SSL_CTRL_SET_SPLIT_SEND_FRAGMENT = 125; + SSL_CTRL_SET_MAX_PIPELINES = 126; + SSL_CTRL_GET_TLSEXT_STATUS_REQ_TYPE = 127; + SSL_CTRL_GET_TLSEXT_STATUS_REQ_CB = 128; + SSL_CTRL_GET_TLSEXT_STATUS_REQ_CB_ARG = 129; + SSL_CTRL_GET_MIN_PROTO_VERSION = 130; + SSL_CTRL_GET_MAX_PROTO_VERSION = 131; + SSL_CTRL_GET_SIGNATURE_NID = 132; + SSL_CTRL_GET_TMP_KEY = 133; + SSL_CERT_SET_FIRST = 1; + SSL_CERT_SET_NEXT = 2; + SSL_CERT_SET_SERVER = 3; + + (* + * The following symbol names are old and obsolete. They are kept + * for compatibility reasons only and should not be used anymore. + *) + SSL_CTRL_GET_CURVES = SSL_CTRL_GET_GROUPS; + SSL_CTRL_SET_CURVES = SSL_CTRL_SET_GROUPS; + SSL_CTRL_SET_CURVES_LIST = SSL_CTRL_SET_GROUPS_LIST; + SSL_CTRL_GET_SHARED_CURVE = SSL_CTRL_GET_SHARED_GROUP; + +// SSL_get1_curves = SSL_get1_groups; +// SSL_CTX_set1_curves = SSL_CTX_set1_groups; +// SSL_CTX_set1_curves_list = SSL_CTX_set1_groups_list; +// SSL_set1_curves = SSL_set1_groups; +// SSL_set1_curves_list = SSL_set1_groups_list; +// SSL_get_shared_curve = SSL_get_shared_group; + + (* serverinfo file format versions *) + SSL_SERVERINFOV1 = 1; + SSL_SERVERINFOV2 = 2; + + SSL_CLIENT_HELLO_SUCCESS = 1; + SSL_CLIENT_HELLO_ERROR = 0; + SSL_CLIENT_HELLO_RETRY = -1; + + SSL_READ_EARLY_DATA_ERROR = 0; + SSL_READ_EARLY_DATA_SUCCESS = 1; + SSL_READ_EARLY_DATA_FINISH = 2; + + SSL_EARLY_DATA_NOT_SENT = 0; + SSL_EARLY_DATA_REJECTED = 1; + SSL_EARLY_DATA_ACCEPTED = 2; + + //SSLv23_method = TLS_method; + //SSLv23_server_method = TLS_server_method; + //SSLv23_client_method = TLS_client_method; + + (* What the 'other' parameter contains in_ security callback *) + (* Mask for type *) + SSL_SECOP_OTHER_TYPE = $ffff0000; + SSL_SECOP_OTHER_NONE = 0; + SSL_SECOP_OTHER_CIPHER = (1 shl 16); + SSL_SECOP_OTHER_CURVE = (2 shl 16); + SSL_SECOP_OTHER_DH = (3 shl 16); + SSL_SECOP_OTHER_PKEY = (4 shl 16); + SSL_SECOP_OTHER_SIGALG = (5 shl 16); + SSL_SECOP_OTHER_CERT = (6 shl 16); + + (* Indicated operation refers to peer key or certificate *) + SSL_SECOP_PEER = $1000; + + (* Values for "op" parameter in security callback *) + + (* Called to filter ciphers *) + (* Ciphers client supports *) + SSL_SECOP_CIPHER_SUPPORTED = 1 or SSL_SECOP_OTHER_CIPHER; + (* Cipher shared by client/server *) + SSL_SECOP_CIPHER_SHARED = 2 or SSL_SECOP_OTHER_CIPHER; + (* Sanity check of cipher server selects *) + SSL_SECOP_CIPHER_CHECK = 3 or SSL_SECOP_OTHER_CIPHER; + (* Curves supported by client *) + SSL_SECOP_CURVE_SUPPORTED = 4 or SSL_SECOP_OTHER_CURVE; + (* Curves shared by client/server *) + SSL_SECOP_CURVE_SHARED = 5 or SSL_SECOP_OTHER_CURVE; + (* Sanity check of curve server selects *) + SSL_SECOP_CURVE_CHECK = 6 or SSL_SECOP_OTHER_CURVE; + (* Temporary DH key *) + SSL_SECOP_TMP_DH = 7 or SSL_SECOP_OTHER_PKEY; + (* SSL/TLS version *) + SSL_SECOP_VERSION = 9 or SSL_SECOP_OTHER_NONE; + (* Session tickets *) + SSL_SECOP_TICKET = 10 or SSL_SECOP_OTHER_NONE; + (* Supported signature algorithms sent to peer *) + SSL_SECOP_SIGALG_SUPPORTED = 11 or SSL_SECOP_OTHER_SIGALG; + (* Shared signature algorithm *) + SSL_SECOP_SIGALG_SHARED = 12 or SSL_SECOP_OTHER_SIGALG; + (* Sanity check signature algorithm allowed *) + SSL_SECOP_SIGALG_CHECK = 13 or SSL_SECOP_OTHER_SIGALG; + (* Used to get mask of supported public key signature algorithms *) + SSL_SECOP_SIGALG_MASK = 14 or SSL_SECOP_OTHER_SIGALG; + (* Use to see if compression is allowed *) + SSL_SECOP_COMPRESSION = 15 or SSL_SECOP_OTHER_NONE; + (* EE key in certificate *) + SSL_SECOP_EE_KEY = 16 or SSL_SECOP_OTHER_CERT; + (* CA key in certificate *) + SSL_SECOP_CA_KEY = 17 or SSL_SECOP_OTHER_CERT; + (* CA digest algorithm in certificate *) + SSL_SECOP_CA_MD = 18 or SSL_SECOP_OTHER_CERT; + (* Peer EE key in certificate *) + SSL_SECOP_PEER_EE_KEY = SSL_SECOP_EE_KEY or SSL_SECOP_PEER; + (* Peer CA key in certificate *) + SSL_SECOP_PEER_CA_KEY = SSL_SECOP_CA_KEY or SSL_SECOP_PEER; + (* Peer CA digest algorithm in certificate *) + SSL_SECOP_PEER_CA_MD = SSL_SECOP_CA_MD or SSL_SECOP_PEER; + + (* OPENSSL_INIT flag 0x010000 reserved for internal use *) + OPENSSL_INIT_NO_LOAD_SSL_STRINGS = TIdC_LONG($00100000); + OPENSSL_INIT_LOAD_SSL_STRINGS = TIdC_LONG($00200000); + OPENSSL_INIT_SSL_DEFAULT = OPENSSL_INIT_LOAD_SSL_STRINGS or OPENSSL_INIT_LOAD_CRYPTO_STRINGS; + + (* Support for ticket appdata *) + (* fatal error, malloc failure *) + SSL_TICKET_FATAL_ERR_MALLOC = 0; + (* fatal error, either from parsing or decrypting the ticket *) + SSL_TICKET_FATAL_ERR_OTHER = 1; + (* No ticket present *) + SSL_TICKET_NONE = 2; + (* Empty ticket present *) + SSL_TICKET_EMPTY = 3; + (* the ticket couldn't be decrypted *) + SSL_TICKET_NO_DECRYPT = 4; + (* a ticket was successfully decrypted *) + SSL_TICKET_SUCCESS = 5; + (* same as above but the ticket needs to be renewed *) + SSL_TICKET_SUCCESS_RENEW = 6; + + (* An error occurred *) + SSL_TICKET_RETURN_ABORT = 0; + (* Do not use the ticket, do not send a renewed ticket to the client *) + SSL_TICKET_RETURN_IGNORE = 1; + (* Do not use the ticket, send a renewed ticket to the client *) + SSL_TICKET_RETURN_IGNORE_RENEW = 2; + (* Use the ticket, do not send a renewed ticket to the client *) + SSL_TICKET_RETURN_USE = 3; + (* Use the ticket, send a renewed ticket to the client *) + SSL_TICKET_RETURN_USE_RENEW = 4; + +type + (* + * This is needed to stop compilers complaining about the 'struct ssl_st *' + * function parameters used to prototype callbacks in SSL_CTX. + *) + ssl_crock_st = ^ssl_st; + TLS_SESSION_TICKET_EXT = tls_session_ticket_ext_st; + ssl_method_st = type Pointer; + SSL_METHOD = ssl_method_st; + PSSL_METHOD = ^SSL_METHOD; + ssl_session_st = type Pointer; + SSL_CIPHER = ssl_session_st; + PSSL_CIPHER = ^SSL_CIPHER; + SSL_SESSION = ssl_session_st; + PSSL_SESSION = ^SSL_SESSION; + PPSSL_SESSION = ^PSSL_SESSION; + tls_sigalgs_st = type Pointer; + TLS_SIGALGS = tls_sigalgs_st; + ssl_conf_ctx_st = type Pointer; + SSL_CONF_CTX = ssl_conf_ctx_st; + PSSL_CONF_CTX = ^SSL_CONF_CTX; + ssl_comp_st = type Pointer; + SSL_COMP = ssl_comp_st; + + + //STACK_OF(SSL_CIPHER); + //STACK_OF(SSL_COMP); + + (* SRTP protection profiles for use with the use_srtp extension (RFC 5764)*) + srtp_protection_profile_st = record + name: PIdAnsiChar; + id: TIdC_ULONG; + end; + SRTP_PROTECTION_PROFILE = srtp_protection_profile_st; + PSRTP_PROTECTION_PROFILE = ^SRTP_PROTECTION_PROFILE; + + //DEFINE_STACK_OF(SRTP_PROTECTION_PROFILE) + + (* Typedefs for handling custom extensions *) + custom_ext_add_cb = function (s: PSSL; ext_type: TIdC_UINT; const out_: PByte; outlen: PIdC_SIZET; al: PIdC_INT; add_arg: Pointer): TIdC_INT; cdecl; + custom_ext_free_cb = procedure (s: PSSL; ext_type: TIdC_UINT; const out_: PByte; add_arg: Pointer); cdecl; + custom_ext_parse_cb = function (s: PSSL; ext_type: TIdC_UINT; const in_: PByte; inlen: TIdC_SIZET; al: PIdC_INT; parse_arg: Pointer): TIdC_INT; cdecl; + + SSL_custom_ext_add_cb_ex = function (s: PSSL; ext_type: TIdC_UINT; context: TIdC_UINT; const out_: PByte; outlen: PIdC_SIZET; x: Px509; chainidx: TIdC_SIZET; al: PIdC_INT; add_arg: Pointer): TIdC_INT; cdecl; + SSL_custom_ext_free_cb_ex = procedure (s: PSSL; ext_type: TIdC_UINT; context: TIdC_UINT; const out_: PByte; add_arg: Pointer); cdecl; + SSL_custom_ext_parse_cb_ex = function (s: PSSL; ext_type: TIdC_UINT; context: TIdC_UINT; const in_: PByte; inlen: TIdC_SIZET; x: Px509; chainidx: TIdC_SIZET; al: PIdC_INT; parse_arg: Pointer): TIdC_INT; cdecl; + + (* Typedef for verification callback *) + SSL_verify_cb = function (preverify_ok: TIdC_INT; x509_ctx: PX509_STORE_CTX): TIdC_INT; cdecl; + + tls_session_ticket_ext_cb_fn = function (s: PSSL; const data: PByte; len: TIdC_INT; arg: Pointer): TIdC_INT; cdecl; + + (* + * This callback type is used inside SSL_CTX, SSL, and in_ the functions that + * set them. It is used to override the generation of SSL/TLS session IDs in_ + * a server. Return value should be zero on an error, non-zero to proceed. + * Also, callbacks should themselves check if the id they generate is unique + * otherwise the SSL handshake will fail with an error - callbacks can do + * this using the 'ssl' value they're passed by; + * SSL_has_matching_session_id(ssl, id, *id_len) The length value passed in_ + * is set at the maximum size the session ID can be. in_ SSLv3/TLSv1 it is 32 + * bytes. The callback can alter this length to be less if desired. It is + * also an error for the callback to set the size to zero. + *) + GEN_SESSION_CB = function (ssl: PSSL; id: PByte; id_len: PIdC_UINT): TIdC_INT; cdecl; + + SSL_CTX_info_callback = procedure (const ssl: PSSL; type_: TIdC_INT; val: TIdC_INT); cdecl; + SSL_CTX_client_cert_cb = function (ssl: PSSL; x509: PPx509; pkey: PPEVP_PKEY): TIdC_INT; cdecl; + + SSL_CTX_cookie_verify_cb = function (ssl: PSSL; cookie: PByte; cookie_len: PIdC_UINT): TIdC_INT; cdecl; + SSL_CTX_set_cookie_verify_cb_app_verify_cookie_cb = function (ssl: PSSL; const cookie: PByte; cookie_len: TIdC_UINT): TIdC_INT; cdecl; + SSL_CTX_set_stateless_cookie_generate_cb_gen_stateless_cookie_cb = function (ssl: PSSL; cookie: PByte; cookie_len: PIdC_SIZET): TIdC_INT; cdecl; + SSL_CTX_set_stateless_cookie_verify_cb_verify_stateless_cookie_cb = function (ssl: PSSL; const cookie: PByte; cookie_len: TIdC_SIZET): TIdC_INT; cdecl; + + SSL_CTX_alpn_select_cb_func = function (ssl: PSSL; const out_: PPByte; outlen: PByte; const in_: PByte; inlen: TIdC_UINT; arg: Pointer): TIdC_INT; cdecl; + SSL_psk_client_cb_func = function (ssl: PSSL; const hint: PIdAnsiChar; identity: PIdAnsiChar; max_identity_len: TIdC_UINT; psk: PByte; max_psk_len: TIdC_UINT): TIdC_UINT; cdecl; + SSL_psk_server_cb_func = function (ssl: PSSL; const identity: PIdAnsiChar; psk: PByte; max_psk_len: TIdC_UINT): TIdC_UINT; cdecl; + SSL_psk_find_session_cb_func = function (ssl: PSSL; const identity: PByte; identity_len: TIdC_SIZET; sess: PPSSL_SESSION): TIdC_INT; cdecl; + SSL_psk_use_session_cb_func = function (ssl: PSSL; const md: PEVP_MD; const id: PPByte; idlen: PIdC_SIZET; sess: PPSSL_SESSION): TIdC_INT; cdecl; + + (* + * A callback for logging out TLS key material. This callback should log out + * |line| followed by a newline. + *) + SSL_CTX_keylog_cb_func = procedure(const ssl: PSSL; const line: PIdAnsiChar); cdecl; + + (* + * The valid handshake states (one for each type message sent and one for each + * type of message received). There are also two "special" states: + * TLS = TLS or DTLS state + * DTLS = DTLS specific state + * CR/SR = Client Read/Server Read + * CW/SW = Client Write/Server Write + * + * The "special" states are: + * TLS_ST_BEFORE = No handshake has been initiated yet + * TLS_ST_OK = A handshake has been successfully completed + *) + TLS_ST_OK = ( + DTLS_ST_CR_HELLO_VERIFY_REQUEST, + TLS_ST_CR_SRVR_HELLO, + TLS_ST_CR_CERT, + TLS_ST_CR_CERT_STATUS, + TLS_ST_CR_KEY_EXCH, + TLS_ST_CR_CERT_REQ, + TLS_ST_CR_SRVR_DONE, + TLS_ST_CR_SESSION_TICKET, + TLS_ST_CR_CHANGE, + TLS_ST_CR_FINISHED, + TLS_ST_CW_CLNT_HELLO, + TLS_ST_CW_CERT, + TLS_ST_CW_KEY_EXCH, + TLS_ST_CW_CERT_VRFY, + TLS_ST_CW_CHANGE, + TLS_ST_CW_NEXT_PROTO, + TLS_ST_CW_FINISHED, + TLS_ST_SW_HELLO_REQ, + TLS_ST_SR_CLNT_HELLO, + DTLS_ST_SW_HELLO_VERIFY_REQUEST, + TLS_ST_SW_SRVR_HELLO, + TLS_ST_SW_CERT, + TLS_ST_SW_KEY_EXCH, + TLS_ST_SW_CERT_REQ, + TLS_ST_SW_SRVR_DONE, + TLS_ST_SR_CERT, + TLS_ST_SR_KEY_EXCH, + TLS_ST_SR_CERT_VRFY, + TLS_ST_SR_NEXT_PROTO, + TLS_ST_SR_CHANGE, + TLS_ST_SR_FINISHED, + TLS_ST_SW_SESSION_TICKET, + TLS_ST_SW_CERT_STATUS, + TLS_ST_SW_CHANGE, + TLS_ST_SW_FINISHED, + TLS_ST_SW_ENCRYPTED_EXTENSIONS, + TLS_ST_CR_ENCRYPTED_EXTENSIONS, + TLS_ST_CR_CERT_VRFY, + TLS_ST_SW_CERT_VRFY, + TLS_ST_CR_HELLO_REQ, + TLS_ST_SW_KEY_UPDATE, + TLS_ST_CW_KEY_UPDATE, + TLS_ST_SR_KEY_UPDATE, + TLS_ST_CR_KEY_UPDATE, + TLS_ST_EARLY_DATA, + TLS_ST_PENDING_EARLY_DATA_END, + TLS_ST_CW_END_OF_EARLY_DATA + ); + OSSL_HANDSHAKE_STATE = TLS_ST_OK; + + SSL_CTX_set_cert_verify_callback_cb = function (v1: PX509_STORE_CTX; v2: Pointer): TIdC_INT; cdecl; + SSL_CTX_set_cert_cb_cb = function (ssl: PSSL; arg: Pointer): TIdC_INT; cdecl; + + SSL_CTX_set_srp_client_pwd_callback_cb = function (v1: PSSL; v2: Pointer): PIdAnsiChar; cdecl; + SSL_CTX_set_srp_verify_param_callback_cb = function (v1: PSSL; v2: Pointer): TIdC_INT; cdecl; + SSL_CTX_set_srp_username_callback_cb = function (v1: PSSL; v2: PIdC_INT; v3: Pointer): TIdC_INT; cdecl; + SSL_client_hello_cb_fn = function (s: PSSL; al: PIdC_INT; arg: Pointer): TIdC_INT; cdecl; + SSL_callback_ctrl_v3 = procedure; cdecl; + SSL_CTX_callback_ctrl_v3 = procedure; cdecl; + SSL_info_callback = procedure (const ssl: PSSL; type_: TIdC_INT; val: TIdC_INT); cdecl; + + (* NB: the |keylength| is only applicable when is_export is true *) + SSL_CTX_set_tmp_dh_callback_dh = function (ssl: PSSL; is_export: TIdC_INT; keylength: TIdC_INT): PDH; cdecl; + SSL_set_tmp_dh_callback_dh = function (ssl: PSSL; is_export: TIdC_INT; keylength: TIdC_INT): PDH; cdecl; + SSL_CTX_set_not_resumable_session_callback_cb = function (ssl: PSSL; is_forward_secure: TIdC_INT): TIdC_INT; cdecl; + SSL_set_not_resumable_session_callback_cb = function (ssl: PSSL; is_forward_secure: TIdC_INT): TIdC_INT; cdecl; + SSL_CTX_set_record_padding_callback_cb = function (ssl: PSSL; type_: TIdC_INT; len: TIdC_SIZET; arg: Pointer): TIdC_SIZET; cdecl; + SSL_set_record_padding_callback_cb = function (ssl: PSSL; type_: TIdC_INT; len: TIdC_SIZET; arg: Pointer): TIdC_SIZET; cdecl; + + (* + * The validation type enumerates the available behaviours of the built-in SSL + * CT validation callback selected via SSL_enable_ct() and SSL_CTX_enable_ct(). + * The underlying callback is a static function in libssl. + *) + SSL_CT_VALIDATION = ( + SSL_CT_VALIDATION_PERMISSIVE = 0, + SSL_CT_VALIDATION_STRICT + ); + SSL_security_callback = function (const s: PSSL; const ctx: PSSL_CTX; op: TIdC_INT; bits: TIdC_INT; nid: TIdC_INT; other: Pointer; ex: Pointer): TIdC_INT; cdecl; + + (* Status codes passed to the decrypt session ticket callback. Some of these + * are for internal use only and are never passed to the callback. *) + SSL_TICKET_STATUS = TIdC_INT; + SSL_TICKET_RETURN = TIdC_INT; + + SSL_CTX_generate_session_ticket_fn = function(s: PSSL; arg: Pointer): TIdC_INT; cdecl; + + SSL_CTX_decrypt_session_ticket_fn = function (s: PSSL; ss: PSSL_SESSION; const keyname: PByte; keyname_length: TIdC_SIZET; status: SSL_TICKET_STATUS; arg: Pointer): SSL_TICKET_RETURN; cdecl; + + DTLS_timer_cb = function(s: PSSL; timer_us: TIdC_UINT): TIdC_UINT; cdecl; + SSL_allow_early_data_cb_fn = function(s: PSSL; arg: Pointer): TIdC_INT; cdecl; + + SSL_CTX_sess_new_cb = function (ssl: PSSL; sess: PSSL_SESSION): TIdC_INT; cdecl; + + SSL_CTX_sess_remove_cb = procedure(ctx: PSSL_CTX; sess: PSSL_SESSION); cdecl; + + TSSL_CTX_set_verify_callback = function (ok : TIdC_INT; ctx : PX509_STORE_CTX) : TIdC_INT; cdecl; + + { The EXTERNALSYM directive is ignored by FPC, however, it is used by Delphi as follows: + + The EXTERNALSYM directive prevents the specified Delphi symbol from appearing in header + files generated for C++. } + + {$EXTERNALSYM SSL_CTX_get_options} {introduced 1.1.0} + {$EXTERNALSYM SSL_get_options} {introduced 1.1.0} + {$EXTERNALSYM SSL_CTX_clear_options} {introduced 1.1.0} + {$EXTERNALSYM SSL_clear_options} {introduced 1.1.0} + {$EXTERNALSYM SSL_CTX_set_options} {introduced 1.1.0} + {$EXTERNALSYM SSL_set_options} {introduced 1.1.0} + {$EXTERNALSYM SSL_CTX_sess_set_new_cb} + {$EXTERNALSYM SSL_CTX_sess_get_new_cb} + {$EXTERNALSYM SSL_CTX_sess_set_remove_cb} + {$EXTERNALSYM SSL_CTX_sess_get_remove_cb} + {$EXTERNALSYM SSL_CTX_set_info_callback} + {$EXTERNALSYM SSL_CTX_get_info_callback} + {$EXTERNALSYM SSL_CTX_set_client_cert_cb} + {$EXTERNALSYM SSL_CTX_get_client_cert_cb} + {$EXTERNALSYM SSL_CTX_set_client_cert_engine} + {$EXTERNALSYM SSL_CTX_set_cookie_generate_cb} + {$EXTERNALSYM SSL_CTX_set_cookie_verify_cb} + {$EXTERNALSYM SSL_CTX_set_stateless_cookie_generate_cb} {introduced 1.1.0} + {$EXTERNALSYM SSL_CTX_set_stateless_cookie_verify_cb} {introduced 1.1.0} + {$EXTERNALSYM SSL_CTX_set_alpn_select_cb} + {$EXTERNALSYM SSL_get0_alpn_selected} + {$EXTERNALSYM SSL_CTX_set_psk_client_callback} + {$EXTERNALSYM SSL_set_psk_client_callback} + {$EXTERNALSYM SSL_CTX_set_psk_server_callback} + {$EXTERNALSYM SSL_set_psk_server_callback} + {$EXTERNALSYM SSL_set_psk_find_session_callback} {introduced 1.1.0} + {$EXTERNALSYM SSL_CTX_set_psk_find_session_callback} {introduced 1.1.0} + {$EXTERNALSYM SSL_set_psk_use_session_callback} {introduced 1.1.0} + {$EXTERNALSYM SSL_CTX_set_psk_use_session_callback} {introduced 1.1.0} + {$EXTERNALSYM SSL_CTX_set_keylog_callback} {introduced 1.1.0} + {$EXTERNALSYM SSL_CTX_get_keylog_callback} {introduced 1.1.0} + {$EXTERNALSYM SSL_CTX_set_max_early_data} {introduced 1.1.0} + {$EXTERNALSYM SSL_CTX_get_max_early_data} {introduced 1.1.0} + {$EXTERNALSYM SSL_set_max_early_data} {introduced 1.1.0} + {$EXTERNALSYM SSL_get_max_early_data} {introduced 1.1.0} + {$EXTERNALSYM SSL_CTX_set_recv_max_early_data} {introduced 1.1.0} + {$EXTERNALSYM SSL_CTX_get_recv_max_early_data} {introduced 1.1.0} + {$EXTERNALSYM SSL_set_recv_max_early_data} {introduced 1.1.0} + {$EXTERNALSYM SSL_get_recv_max_early_data} {introduced 1.1.0} + {$EXTERNALSYM SSL_in_init} {introduced 1.1.0} + {$EXTERNALSYM SSL_in_before} {introduced 1.1.0} + {$EXTERNALSYM SSL_is_init_finished} {introduced 1.1.0} + {$EXTERNALSYM SSL_get_finished} + {$EXTERNALSYM SSL_get_peer_finished} + {$EXTERNALSYM BIO_f_ssl} + {$EXTERNALSYM BIO_new_ssl} + {$EXTERNALSYM BIO_new_ssl_connect} + {$EXTERNALSYM BIO_new_buffer_ssl_connect} + {$EXTERNALSYM BIO_ssl_copy_session_id} + {$EXTERNALSYM SSL_CTX_set_cipher_list} + {$EXTERNALSYM SSL_CTX_new} + {$EXTERNALSYM SSL_CTX_set_timeout} + {$EXTERNALSYM SSL_CTX_get_timeout} + {$EXTERNALSYM SSL_CTX_get_cert_store} + {$EXTERNALSYM SSL_want} + {$EXTERNALSYM SSL_clear} + {$EXTERNALSYM BIO_ssl_shutdown} + {$EXTERNALSYM SSL_CTX_up_ref} {introduced 1.1.0} + {$EXTERNALSYM SSL_CTX_free} + {$EXTERNALSYM SSL_CTX_set_cert_store} + {$EXTERNALSYM SSL_CTX_set1_cert_store} {introduced 1.1.0} + {$EXTERNALSYM SSL_CTX_flush_sessions} + {$EXTERNALSYM SSL_get_current_cipher} + {$EXTERNALSYM SSL_get_pending_cipher} {introduced 1.1.0} + {$EXTERNALSYM SSL_CIPHER_get_bits} + {$EXTERNALSYM SSL_CIPHER_get_version} + {$EXTERNALSYM SSL_CIPHER_get_name} + {$EXTERNALSYM SSL_CIPHER_standard_name} {introduced 1.1.0} + {$EXTERNALSYM OPENSSL_cipher_name} {introduced 1.1.0} + {$EXTERNALSYM SSL_CIPHER_get_id} + {$EXTERNALSYM SSL_CIPHER_get_protocol_id} {introduced 1.1.0} + {$EXTERNALSYM SSL_CIPHER_get_kx_nid} {introduced 1.1.0} + {$EXTERNALSYM SSL_CIPHER_get_auth_nid} {introduced 1.1.0} + {$EXTERNALSYM SSL_CIPHER_get_handshake_digest} {introduced 1.1.0} + {$EXTERNALSYM SSL_CIPHER_is_aead} {introduced 1.1.0} + {$EXTERNALSYM SSL_get_fd} + {$EXTERNALSYM SSL_get_rfd} + {$EXTERNALSYM SSL_get_wfd} + {$EXTERNALSYM SSL_get_cipher_list} + {$EXTERNALSYM SSL_get_shared_ciphers} + {$EXTERNALSYM SSL_get_read_ahead} + {$EXTERNALSYM SSL_pending} + {$EXTERNALSYM SSL_has_pending} {introduced 1.1.0} + {$EXTERNALSYM SSL_set_fd} + {$EXTERNALSYM SSL_set_rfd} + {$EXTERNALSYM SSL_set_wfd} + {$EXTERNALSYM SSL_set0_rbio} {introduced 1.1.0} + {$EXTERNALSYM SSL_set0_wbio} {introduced 1.1.0} + {$EXTERNALSYM SSL_set_bio} + {$EXTERNALSYM SSL_get_rbio} + {$EXTERNALSYM SSL_get_wbio} + {$EXTERNALSYM SSL_set_cipher_list} + {$EXTERNALSYM SSL_CTX_set_ciphersuites} {introduced 1.1.0} + {$EXTERNALSYM SSL_set_ciphersuites} {introduced 1.1.0} + {$EXTERNALSYM SSL_get_verify_mode} + {$EXTERNALSYM SSL_get_verify_depth} + {$EXTERNALSYM SSL_get_verify_callback} + {$EXTERNALSYM SSL_set_read_ahead} + {$EXTERNALSYM SSL_set_verify} + {$EXTERNALSYM SSL_set_verify_depth} + {$EXTERNALSYM SSL_use_RSAPrivateKey} + {$EXTERNALSYM SSL_use_RSAPrivateKey_ASN1} + {$EXTERNALSYM SSL_use_PrivateKey} + {$EXTERNALSYM SSL_use_PrivateKey_ASN1} + {$EXTERNALSYM SSL_use_certificate} + {$EXTERNALSYM SSL_use_certificate_ASN1} + {$EXTERNALSYM SSL_CTX_use_serverinfo} + {$EXTERNALSYM SSL_CTX_use_serverinfo_ex} {introduced 1.1.0} + {$EXTERNALSYM SSL_CTX_use_serverinfo_file} + {$EXTERNALSYM SSL_use_RSAPrivateKey_file} + {$EXTERNALSYM SSL_use_PrivateKey_file} + {$EXTERNALSYM SSL_use_certificate_file} + {$EXTERNALSYM SSL_CTX_use_RSAPrivateKey_file} + {$EXTERNALSYM SSL_CTX_use_PrivateKey_file} + {$EXTERNALSYM SSL_CTX_use_certificate_file} + {$EXTERNALSYM SSL_CTX_use_certificate_chain_file} + {$EXTERNALSYM SSL_use_certificate_chain_file} {introduced 1.1.0} + {$EXTERNALSYM SSL_load_client_CA_file} + {$EXTERNALSYM SSL_add_file_cert_subjects_to_stack} + {$EXTERNALSYM SSL_add_dir_cert_subjects_to_stack} + {$EXTERNALSYM SSL_state_string} + {$EXTERNALSYM SSL_rstate_string} + {$EXTERNALSYM SSL_state_string_long} + {$EXTERNALSYM SSL_rstate_string_long} + {$EXTERNALSYM SSL_SESSION_get_time} + {$EXTERNALSYM SSL_SESSION_set_time} + {$EXTERNALSYM SSL_SESSION_get_timeout} + {$EXTERNALSYM SSL_SESSION_set_timeout} + {$EXTERNALSYM SSL_SESSION_get_protocol_version} {introduced 1.1.0} + {$EXTERNALSYM SSL_SESSION_set_protocol_version} {introduced 1.1.0} + {$EXTERNALSYM SSL_SESSION_get0_hostname} {introduced 1.1.0} + {$EXTERNALSYM SSL_SESSION_set1_hostname} {introduced 1.1.0} + {$EXTERNALSYM SSL_SESSION_get0_alpn_selected} {introduced 1.1.0} + {$EXTERNALSYM SSL_SESSION_set1_alpn_selected} {introduced 1.1.0} + {$EXTERNALSYM SSL_SESSION_get0_cipher} {introduced 1.1.0} + {$EXTERNALSYM SSL_SESSION_set_cipher} {introduced 1.1.0} + {$EXTERNALSYM SSL_SESSION_has_ticket} {introduced 1.1.0} + {$EXTERNALSYM SSL_SESSION_get_ticket_lifetime_hint} {introduced 1.1.0} + {$EXTERNALSYM SSL_SESSION_get0_ticket} {introduced 1.1.0} + {$EXTERNALSYM SSL_SESSION_get_max_early_data} {introduced 1.1.0} + {$EXTERNALSYM SSL_SESSION_set_max_early_data} {introduced 1.1.0} + {$EXTERNALSYM SSL_copy_session_id} + {$EXTERNALSYM SSL_SESSION_get0_peer} + {$EXTERNALSYM SSL_SESSION_set1_id_context} + {$EXTERNALSYM SSL_SESSION_set1_id} {introduced 1.1.0} + {$EXTERNALSYM SSL_SESSION_is_resumable} {introduced 1.1.0} + {$EXTERNALSYM SSL_SESSION_new} + {$EXTERNALSYM SSL_SESSION_dup} {introduced 1.1.0} + {$EXTERNALSYM SSL_SESSION_get_id} + {$EXTERNALSYM SSL_SESSION_get0_id_context} {introduced 1.1.0} + {$EXTERNALSYM SSL_SESSION_get_compress_id} + {$EXTERNALSYM SSL_SESSION_print} + {$EXTERNALSYM SSL_SESSION_print_keylog} {introduced 1.1.0} + {$EXTERNALSYM SSL_SESSION_up_ref} {introduced 1.1.0} + {$EXTERNALSYM SSL_SESSION_free} + {$EXTERNALSYM SSL_set_session} + {$EXTERNALSYM SSL_CTX_add_session} + {$EXTERNALSYM SSL_CTX_remove_session} + {$EXTERNALSYM SSL_CTX_set_generate_session_id} + {$EXTERNALSYM SSL_set_generate_session_id} + {$EXTERNALSYM SSL_has_matching_session_id} + {$EXTERNALSYM d2i_SSL_SESSION} + {$EXTERNALSYM SSL_CTX_get_verify_mode} + {$EXTERNALSYM SSL_CTX_get_verify_depth} + {$EXTERNALSYM SSL_CTX_get_verify_callback} + {$EXTERNALSYM SSL_CTX_set_verify} + {$EXTERNALSYM SSL_CTX_set_verify_depth} + {$EXTERNALSYM SSL_CTX_set_cert_verify_callback} + {$EXTERNALSYM SSL_CTX_set_cert_cb} + {$EXTERNALSYM SSL_CTX_use_RSAPrivateKey} + {$EXTERNALSYM SSL_CTX_use_RSAPrivateKey_ASN1} + {$EXTERNALSYM SSL_CTX_use_PrivateKey} + {$EXTERNALSYM SSL_CTX_use_PrivateKey_ASN1} + {$EXTERNALSYM SSL_CTX_use_certificate} + {$EXTERNALSYM SSL_CTX_use_certificate_ASN1} + {$EXTERNALSYM SSL_CTX_set_default_passwd_cb} {introduced 1.1.0} + {$EXTERNALSYM SSL_CTX_set_default_passwd_cb_userdata} {introduced 1.1.0} + {$EXTERNALSYM SSL_CTX_get_default_passwd_cb} {introduced 1.1.0} + {$EXTERNALSYM SSL_CTX_get_default_passwd_cb_userdata} {introduced 1.1.0} + {$EXTERNALSYM SSL_set_default_passwd_cb} {introduced 1.1.0} + {$EXTERNALSYM SSL_set_default_passwd_cb_userdata} {introduced 1.1.0} + {$EXTERNALSYM SSL_get_default_passwd_cb} {introduced 1.1.0} + {$EXTERNALSYM SSL_get_default_passwd_cb_userdata} {introduced 1.1.0} + {$EXTERNALSYM SSL_CTX_check_private_key} + {$EXTERNALSYM SSL_check_private_key} + {$EXTERNALSYM SSL_CTX_set_session_id_context} + {$EXTERNALSYM SSL_new} + {$EXTERNALSYM SSL_up_ref} {introduced 1.1.0} + {$EXTERNALSYM SSL_is_dtls} {introduced 1.1.0} + {$EXTERNALSYM SSL_set_session_id_context} + {$EXTERNALSYM SSL_CTX_set_purpose} + {$EXTERNALSYM SSL_set_purpose} + {$EXTERNALSYM SSL_CTX_set_trust} + {$EXTERNALSYM SSL_set_trust} + {$EXTERNALSYM SSL_set1_host} {introduced 1.1.0} + {$EXTERNALSYM SSL_add1_host} {introduced 1.1.0} + {$EXTERNALSYM SSL_get0_peername} {introduced 1.1.0} + {$EXTERNALSYM SSL_set_hostflags} {introduced 1.1.0} + {$EXTERNALSYM SSL_CTX_dane_enable} {introduced 1.1.0} + {$EXTERNALSYM SSL_CTX_dane_mtype_set} {introduced 1.1.0} + {$EXTERNALSYM SSL_dane_enable} {introduced 1.1.0} + {$EXTERNALSYM SSL_dane_tlsa_add} {introduced 1.1.0} + {$EXTERNALSYM SSL_get0_dane_authority} {introduced 1.1.0} + {$EXTERNALSYM SSL_get0_dane_tlsa} {introduced 1.1.0} + {$EXTERNALSYM SSL_get0_dane} {introduced 1.1.0} + {$EXTERNALSYM SSL_CTX_dane_set_flags} {introduced 1.1.0} + {$EXTERNALSYM SSL_CTX_dane_clear_flags} {introduced 1.1.0} + {$EXTERNALSYM SSL_dane_set_flags} {introduced 1.1.0} + {$EXTERNALSYM SSL_dane_clear_flags} {introduced 1.1.0} + {$EXTERNALSYM SSL_CTX_set1_param} + {$EXTERNALSYM SSL_set1_param} + {$EXTERNALSYM SSL_CTX_get0_param} + {$EXTERNALSYM SSL_get0_param} + {$EXTERNALSYM SSL_CTX_set_srp_username} + {$EXTERNALSYM SSL_CTX_set_srp_password} + {$EXTERNALSYM SSL_CTX_set_srp_strength} + {$EXTERNALSYM SSL_CTX_set_srp_client_pwd_callback} + {$EXTERNALSYM SSL_CTX_set_srp_verify_param_callback} + {$EXTERNALSYM SSL_CTX_set_srp_username_callback} + {$EXTERNALSYM SSL_CTX_set_srp_cb_arg} + {$EXTERNALSYM SSL_set_srp_server_param} + {$EXTERNALSYM SSL_set_srp_server_param_pw} + {$EXTERNALSYM SSL_CTX_set_client_hello_cb} {introduced 1.1.0} + {$EXTERNALSYM SSL_client_hello_isv2} {introduced 1.1.0} + {$EXTERNALSYM SSL_client_hello_get0_legacy_version} {introduced 1.1.0} + {$EXTERNALSYM SSL_client_hello_get0_random} {introduced 1.1.0} + {$EXTERNALSYM SSL_client_hello_get0_session_id} {introduced 1.1.0} + {$EXTERNALSYM SSL_client_hello_get0_ciphers} {introduced 1.1.0} + {$EXTERNALSYM SSL_client_hello_get0_compression_methods} {introduced 1.1.0} + {$EXTERNALSYM SSL_client_hello_get1_extensions_present} {introduced 1.1.0} + {$EXTERNALSYM SSL_client_hello_get0_ext} {introduced 1.1.0} + {$EXTERNALSYM SSL_certs_clear} + {$EXTERNALSYM SSL_free} + {$EXTERNALSYM SSL_waiting_for_async} {introduced 1.1.0} + {$EXTERNALSYM SSL_get_all_async_fds} {introduced 1.1.0} + {$EXTERNALSYM SSL_get_changed_async_fds} {introduced 1.1.0} + {$EXTERNALSYM SSL_accept} + {$EXTERNALSYM SSL_stateless} {introduced 1.1.0} + {$EXTERNALSYM SSL_connect} + {$EXTERNALSYM SSL_read} + {$EXTERNALSYM SSL_read_ex} {introduced 1.1.0} + {$EXTERNALSYM SSL_read_early_data} {introduced 1.1.0} + {$EXTERNALSYM SSL_peek} + {$EXTERNALSYM SSL_peek_ex} {introduced 1.1.0} + {$EXTERNALSYM SSL_write} + {$EXTERNALSYM SSL_write_ex} {introduced 1.1.0} + {$EXTERNALSYM SSL_write_early_data} {introduced 1.1.0} + {$EXTERNALSYM SSL_callback_ctrl} + {$EXTERNALSYM SSL_ctrl} + {$EXTERNALSYM SSL_CTX_ctrl} + {$EXTERNALSYM SSL_CTX_callback_ctrl} + {$EXTERNALSYM SSL_get_early_data_status} {introduced 1.1.0} + {$EXTERNALSYM SSL_get_error} + {$EXTERNALSYM SSL_get_version} + {$EXTERNALSYM SSL_CTX_set_ssl_version} + {$EXTERNALSYM TLS_method} {introduced 1.1.0} + {$EXTERNALSYM TLS_server_method} {introduced 1.1.0} + {$EXTERNALSYM TLS_client_method} {introduced 1.1.0} + {$EXTERNALSYM SSL_key_update} {introduced 1.1.0} + {$EXTERNALSYM SSL_get_key_update_type} {introduced 1.1.0} + {$EXTERNALSYM SSL_renegotiate} + {$EXTERNALSYM SSL_renegotiate_abbreviated} + {$EXTERNALSYM SSL_shutdown} + {$EXTERNALSYM SSL_CTX_set_post_handshake_auth} {introduced 1.1.0} + {$EXTERNALSYM SSL_set_post_handshake_auth} {introduced 1.1.0} + {$EXTERNALSYM SSL_renegotiate_pending} + {$EXTERNALSYM SSL_verify_client_post_handshake} {introduced 1.1.0} + {$EXTERNALSYM SSL_CTX_get_ssl_method} + {$EXTERNALSYM SSL_get_ssl_method} + {$EXTERNALSYM SSL_set_ssl_method} + {$EXTERNALSYM SSL_alert_type_string_long} + {$EXTERNALSYM SSL_alert_type_string} + {$EXTERNALSYM SSL_alert_desc_string_long} + {$EXTERNALSYM SSL_alert_desc_string} + {$EXTERNALSYM SSL_CTX_set_client_CA_list} + {$EXTERNALSYM SSL_add_client_CA} + {$EXTERNALSYM SSL_CTX_add_client_CA} + {$EXTERNALSYM SSL_set_connect_state} + {$EXTERNALSYM SSL_set_accept_state} + {$EXTERNALSYM SSL_CIPHER_description} + {$EXTERNALSYM SSL_dup} + {$EXTERNALSYM SSL_get_certificate} + {$EXTERNALSYM SSL_get_privatekey} + {$EXTERNALSYM SSL_CTX_get0_certificate} + {$EXTERNALSYM SSL_CTX_get0_privatekey} + {$EXTERNALSYM SSL_CTX_set_quiet_shutdown} + {$EXTERNALSYM SSL_CTX_get_quiet_shutdown} + {$EXTERNALSYM SSL_set_quiet_shutdown} + {$EXTERNALSYM SSL_get_quiet_shutdown} + {$EXTERNALSYM SSL_set_shutdown} + {$EXTERNALSYM SSL_get_shutdown} + {$EXTERNALSYM SSL_version} + {$EXTERNALSYM SSL_client_version} {introduced 1.1.0} + {$EXTERNALSYM SSL_CTX_set_default_verify_paths} + {$EXTERNALSYM SSL_CTX_set_default_verify_dir} {introduced 1.1.0} + {$EXTERNALSYM SSL_CTX_set_default_verify_file} {introduced 1.1.0} + {$EXTERNALSYM SSL_CTX_load_verify_locations} + {$EXTERNALSYM SSL_get_session} + {$EXTERNALSYM SSL_get1_session} + {$EXTERNALSYM SSL_get_SSL_CTX} + {$EXTERNALSYM SSL_set_SSL_CTX} + {$EXTERNALSYM SSL_set_info_callback} + {$EXTERNALSYM SSL_get_info_callback} + {$EXTERNALSYM SSL_get_state} {introduced 1.1.0} + {$EXTERNALSYM SSL_set_verify_result} + {$EXTERNALSYM SSL_get_verify_result} + {$EXTERNALSYM SSL_get_client_random} {introduced 1.1.0} + {$EXTERNALSYM SSL_get_server_random} {introduced 1.1.0} + {$EXTERNALSYM SSL_SESSION_get_master_key} {introduced 1.1.0} + {$EXTERNALSYM SSL_SESSION_set1_master_key} {introduced 1.1.0} + {$EXTERNALSYM SSL_SESSION_get_max_fragment_length} {introduced 1.1.0} + {$EXTERNALSYM SSL_set_ex_data} + {$EXTERNALSYM SSL_get_ex_data} + {$EXTERNALSYM SSL_SESSION_set_ex_data} + {$EXTERNALSYM SSL_SESSION_get_ex_data} + {$EXTERNALSYM SSL_CTX_set_ex_data} + {$EXTERNALSYM SSL_CTX_get_ex_data} + {$EXTERNALSYM SSL_get_ex_data_X509_STORE_CTX_idx} + {$EXTERNALSYM SSL_CTX_set_default_read_buffer_len} {introduced 1.1.0} + {$EXTERNALSYM SSL_set_default_read_buffer_len} {introduced 1.1.0} + {$EXTERNALSYM SSL_CTX_set_tmp_dh_callback} + {$EXTERNALSYM SSL_set_tmp_dh_callback} + {$EXTERNALSYM SSL_CIPHER_find} + {$EXTERNALSYM SSL_CIPHER_get_cipher_nid} {introduced 1.1.0} + {$EXTERNALSYM SSL_CIPHER_get_digest_nid} {introduced 1.1.0} + {$EXTERNALSYM SSL_set_session_ticket_ext} + {$EXTERNALSYM SSL_set_session_ticket_ext_cb} + {$EXTERNALSYM SSL_CTX_set_not_resumable_session_callback} {introduced 1.1.0} + {$EXTERNALSYM SSL_set_not_resumable_session_callback} {introduced 1.1.0} + {$EXTERNALSYM SSL_CTX_set_record_padding_callback} {introduced 1.1.0} + {$EXTERNALSYM SSL_CTX_set_record_padding_callback_arg} {introduced 1.1.0} + {$EXTERNALSYM SSL_CTX_get_record_padding_callback_arg} {introduced 1.1.0} + {$EXTERNALSYM SSL_CTX_set_block_padding} {introduced 1.1.0} + {$EXTERNALSYM SSL_set_record_padding_callback} {introduced 1.1.0} + {$EXTERNALSYM SSL_set_record_padding_callback_arg} {introduced 1.1.0} + {$EXTERNALSYM SSL_get_record_padding_callback_arg} {introduced 1.1.0} + {$EXTERNALSYM SSL_set_block_padding} {introduced 1.1.0} + {$EXTERNALSYM SSL_set_num_tickets} {introduced 1.1.0} + {$EXTERNALSYM SSL_get_num_tickets} {introduced 1.1.0} + {$EXTERNALSYM SSL_CTX_set_num_tickets} {introduced 1.1.0} + {$EXTERNALSYM SSL_CTX_get_num_tickets} {introduced 1.1.0} + {$EXTERNALSYM SSL_session_reused} {introduced 1.1.0} + {$EXTERNALSYM SSL_is_server} + {$EXTERNALSYM SSL_CONF_CTX_new} + {$EXTERNALSYM SSL_CONF_CTX_finish} + {$EXTERNALSYM SSL_CONF_CTX_free} + {$EXTERNALSYM SSL_CONF_CTX_set_flags} + {$EXTERNALSYM SSL_CONF_CTX_clear_flags} + {$EXTERNALSYM SSL_CONF_CTX_set1_prefix} + {$EXTERNALSYM SSL_CONF_cmd} + {$EXTERNALSYM SSL_CONF_cmd_argv} + {$EXTERNALSYM SSL_CONF_cmd_value_type} + {$EXTERNALSYM SSL_CONF_CTX_set_ssl} + {$EXTERNALSYM SSL_CONF_CTX_set_ssl_ctx} + {$EXTERNALSYM SSL_add_ssl_module} {introduced 1.1.0} + {$EXTERNALSYM SSL_config} {introduced 1.1.0} + {$EXTERNALSYM SSL_CTX_config} {introduced 1.1.0} + {$EXTERNALSYM DTLSv1_listen} {introduced 1.1.0} + {$EXTERNALSYM SSL_enable_ct} {introduced 1.1.0} + {$EXTERNALSYM SSL_CTX_enable_ct} {introduced 1.1.0} + {$EXTERNALSYM SSL_ct_is_enabled} {introduced 1.1.0} + {$EXTERNALSYM SSL_CTX_ct_is_enabled} {introduced 1.1.0} + {$EXTERNALSYM SSL_CTX_set_default_ctlog_list_file} {introduced 1.1.0} + {$EXTERNALSYM SSL_CTX_set_ctlog_list_file} {introduced 1.1.0} + {$EXTERNALSYM SSL_CTX_set0_ctlog_store} {introduced 1.1.0} + {$EXTERNALSYM SSL_set_security_level} {introduced 1.1.0} + {$EXTERNALSYM SSL_set_security_callback} {introduced 1.1.0} + {$EXTERNALSYM SSL_get_security_callback} {introduced 1.1.0} + {$EXTERNALSYM SSL_set0_security_ex_data} {introduced 1.1.0} + {$EXTERNALSYM SSL_get0_security_ex_data} {introduced 1.1.0} + {$EXTERNALSYM SSL_CTX_set_security_level} {introduced 1.1.0} + {$EXTERNALSYM SSL_CTX_get_security_level} {introduced 1.1.0} + {$EXTERNALSYM SSL_CTX_get0_security_ex_data} {introduced 1.1.0} + {$EXTERNALSYM SSL_CTX_set0_security_ex_data} {introduced 1.1.0} + {$EXTERNALSYM OPENSSL_init_ssl} {introduced 1.1.0} + {$EXTERNALSYM SSL_free_buffers} {introduced 1.1.0} + {$EXTERNALSYM SSL_alloc_buffers} {introduced 1.1.0} + {$EXTERNALSYM SSL_CTX_set_session_ticket_cb} {introduced 1.1.0} + {$EXTERNALSYM SSL_SESSION_set1_ticket_appdata} {introduced 1.1.0} + {$EXTERNALSYM SSL_SESSION_get0_ticket_appdata} {introduced 1.1.0} + {$EXTERNALSYM DTLS_set_timer_cb} {introduced 1.1.0} + {$EXTERNALSYM SSL_CTX_set_allow_early_data_cb} {introduced 1.1.0} + {$EXTERNALSYM SSL_set_allow_early_data_cb} {introduced 1.1.0} + {$EXTERNALSYM SSL_get0_peer_certificate} {introduced 3.3.0} + {$EXTERNALSYM SSL_get1_peer_certificate} {introduced 3.3.0} +{helper_functions} + function IsOpenSSL_SSLv2_Available : Boolean; + function IsOpenSSL_SSLv3_Available : Boolean; + function IsOpenSSL_SSLv23_Available : Boolean; + function IsOpenSSL_TLSv1_0_Available : Boolean; + function IsOpenSSL_TLSv1_1_Available : Boolean; + function IsOpenSSL_TLSv1_2_Available : Boolean; + function HasTLS_method: boolean; + function SSL_CTX_set_min_proto_version(ctx: PSSL_CTX; version: TIdC_LONG): TIdC_LONG; + function SSL_CTX_set_max_proto_version(ctx: PSSL_CTX; version: TIdC_LONG): TIdC_LONG; + function SSL_CTX_get_min_proto_version(ctx: PSSL_CTX): TIdC_LONG; + function SSL_CTX_get_max_proto_version(ctx: PSSL_CTX): TIdC_LONG; + function SSL_set_min_proto_version(s: PSSL; version: TIdC_LONG): TIdC_LONG; + function SSL_set_max_proto_version(s: PSSL; version: TIdC_LONG): TIdC_LONG; + function SSL_get_min_proto_version(s: PSSL): TIdC_LONG; + function SSL_get_max_proto_version(s: PSSL): TIdC_LONG; +{/helper_functions} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +var + {$EXTERNALSYM SSL_CTX_set_mode} {removed 1.0.0} + {$EXTERNALSYM SSL_CTX_clear_mode} {removed 1.0.0} + {$EXTERNALSYM SSL_CTX_sess_set_cache_size} {removed 1.0.0} + {$EXTERNALSYM SSL_CTX_sess_get_cache_size} {removed 1.0.0} + {$EXTERNALSYM SSL_CTX_set_session_cache_mode} {removed 1.0.0} + {$EXTERNALSYM SSL_CTX_get_session_cache_mode} {removed 1.0.0} + {$EXTERNALSYM SSL_clear_num_renegotiations} {removed 1.0.0} + {$EXTERNALSYM SSL_total_renegotiations} {removed 1.0.0} + {$EXTERNALSYM SSL_CTX_set_tmp_dh} {removed 1.0.0} + {$EXTERNALSYM SSL_CTX_set_tmp_ecdh} {removed 1.0.0} + {$EXTERNALSYM SSL_CTX_set_dh_auto} {removed 1.0.0} + {$EXTERNALSYM SSL_set_dh_auto} {removed 1.0.0} + {$EXTERNALSYM SSL_set_tmp_dh} {removed 1.0.0} + {$EXTERNALSYM SSL_set_tmp_ecdh} {removed 1.0.0} + {$EXTERNALSYM SSL_CTX_add_extra_chain_cert} {removed 1.0.0} + {$EXTERNALSYM SSL_CTX_get_extra_chain_certs} {removed 1.0.0} + {$EXTERNALSYM SSL_CTX_get_extra_chain_certs_only} {removed 1.0.0} + {$EXTERNALSYM SSL_CTX_clear_extra_chain_certs} {removed 1.0.0} + {$EXTERNALSYM SSL_CTX_set0_chain} {removed 1.0.0} + {$EXTERNALSYM SSL_CTX_set1_chain} {removed 1.0.0} + {$EXTERNALSYM SSL_CTX_add0_chain_cert} {removed 1.0.0} + {$EXTERNALSYM SSL_CTX_add1_chain_cert} {removed 1.0.0} + {$EXTERNALSYM SSL_CTX_get0_chain_certs} {removed 1.0.0} + {$EXTERNALSYM SSL_CTX_clear_chain_certs} {removed 1.0.0} + {$EXTERNALSYM SSL_CTX_build_cert_chain} {removed 1.0.0} + {$EXTERNALSYM SSL_CTX_select_current_cert} {removed 1.0.0} + {$EXTERNALSYM SSL_CTX_set_current_cert} {removed 1.0.0} + {$EXTERNALSYM SSL_CTX_set0_verify_cert_store} {removed 1.0.0} + {$EXTERNALSYM SSL_CTX_set1_verify_cert_store} {removed 1.0.0} + {$EXTERNALSYM SSL_CTX_set0_chain_cert_store} {removed 1.0.0} + {$EXTERNALSYM SSL_CTX_set1_chain_cert_store} {removed 1.0.0} + {$EXTERNALSYM SSL_set0_chain} {removed 1.0.0} + {$EXTERNALSYM SSL_set1_chain} {removed 1.0.0} + {$EXTERNALSYM SSL_add0_chain_cert} {removed 1.0.0} + {$EXTERNALSYM SSL_add1_chain_cert} {removed 1.0.0} + {$EXTERNALSYM SSL_get0_chain_certs} {removed 1.0.0} + {$EXTERNALSYM SSL_clear_chain_certs} {removed 1.0.0} + {$EXTERNALSYM SSL_build_cert_chain} {removed 1.0.0} + {$EXTERNALSYM SSL_select_current_cert} {removed 1.0.0} + {$EXTERNALSYM SSL_set_current_cert} {removed 1.0.0} + {$EXTERNALSYM SSL_set0_verify_cert_store} {removed 1.0.0} + {$EXTERNALSYM SSL_set1_verify_cert_store} {removed 1.0.0} + {$EXTERNALSYM SSL_set0_chain_cert_store} {removed 1.0.0} + {$EXTERNALSYM SSL_set1_chain_cert_store} {removed 1.0.0} + {$EXTERNALSYM SSL_get1_groups} {removed 1.0.0} + {$EXTERNALSYM SSL_CTX_set1_groups} {removed 1.0.0} + {$EXTERNALSYM SSL_CTX_set1_groups_list} {removed 1.0.0} + {$EXTERNALSYM SSL_set1_groups} {removed 1.0.0} + {$EXTERNALSYM SSL_set1_groups_list} {removed 1.0.0} + {$EXTERNALSYM SSL_get_shared_group} {removed 1.0.0} + {$EXTERNALSYM SSL_CTX_set1_sigalgs} {removed 1.0.0} + {$EXTERNALSYM SSL_CTX_set1_sigalgs_list} {removed 1.0.0} + {$EXTERNALSYM SSL_set1_sigalgs} {removed 1.0.0} + {$EXTERNALSYM SSL_set1_sigalgs_list} {removed 1.0.0} + {$EXTERNALSYM SSL_CTX_set1_client_sigalgs} {removed 1.0.0} + {$EXTERNALSYM SSL_CTX_set1_client_sigalgs_list} {removed 1.0.0} + {$EXTERNALSYM SSL_set1_client_sigalgs} {removed 1.0.0} + {$EXTERNALSYM SSL_set1_client_sigalgs_list} {removed 1.0.0} + {$EXTERNALSYM SSL_get0_certificate_types} {removed 1.0.0} + {$EXTERNALSYM SSL_CTX_set1_client_certificate_types} {removed 1.0.0} + {$EXTERNALSYM SSL_set1_client_certificate_types} {removed 1.0.0} + {$EXTERNALSYM SSL_get_signature_nid} {removed 1.0.0} + {$EXTERNALSYM SSL_get_peer_signature_nid} {removed 1.0.0} + {$EXTERNALSYM SSL_get_peer_tmp_key} {removed 1.0.0} + {$EXTERNALSYM SSL_get_tmp_key} {removed 1.0.0} + {$EXTERNALSYM SSL_get0_raw_cipherlist} {removed 1.0.0} + {$EXTERNALSYM SSL_get0_ec_point_formats} {removed 1.0.0} + {$EXTERNALSYM SSL_get_app_data} {removed 1.0.0} + {$EXTERNALSYM SSL_set_app_data} {removed 1.0.0} + {$EXTERNALSYM SSLeay_add_ssl_algorithms} {removed 1.0.0} + {$EXTERNALSYM SSL_load_error_strings} {removed 1.1.0} + {$EXTERNALSYM SSL_get_peer_certificate} {removed 3.0.0} + {$EXTERNALSYM SSL_library_init} {removed 1.1.0} + {$EXTERNALSYM SSLv2_method} {removed 1.1.0 allow_nil} // SSLv2 + {$EXTERNALSYM SSLv2_server_method} {removed 1.1.0 allow_nil} // SSLv2 + {$EXTERNALSYM SSLv2_client_method} {removed 1.1.0 allow_nil} // SSLv2 + {$EXTERNALSYM SSLv3_method} {removed 1.1.0 allow_nil} // SSLv3 + {$EXTERNALSYM SSLv3_server_method} {removed 1.1.0 allow_nil} // SSLv3 + {$EXTERNALSYM SSLv3_client_method} {removed 1.1.0 allow_nil} // SSLv3 + {$EXTERNALSYM SSLv23_method} {removed 1.1.0 allow_nil} // SSLv3 but can rollback to v2 + {$EXTERNALSYM SSLv23_server_method} {removed 1.1.0 allow_nil} // SSLv3 but can rollback to v2 + {$EXTERNALSYM SSLv23_client_method} {removed 1.1.0 allow_nil} // SSLv3 but can rollback to v2 + {$EXTERNALSYM TLSv1_method} {removed 1.1.0 allow_nil} // TLSv1.0 + {$EXTERNALSYM TLSv1_server_method} {removed 1.1.0 allow_nil} // TLSv1.0 + {$EXTERNALSYM TLSv1_client_method} {removed 1.1.0 allow_nil} // TLSv1.0 + {$EXTERNALSYM TLSv1_1_method} {removed 1.1.0 allow_nil} //TLS1.1 + {$EXTERNALSYM TLSv1_1_server_method} {removed 1.1.0 allow_nil} //TLS1.1 + {$EXTERNALSYM TLSv1_1_client_method} {removed 1.1.0 allow_nil} //TLS1.1 + {$EXTERNALSYM TLSv1_2_method} {removed 1.1.0 allow_nil} // TLSv1.2 + {$EXTERNALSYM TLSv1_2_server_method} {removed 1.1.0 allow_nil} // TLSv1.2 + {$EXTERNALSYM TLSv1_2_client_method} {removed 1.1.0 allow_nil} // TLSv1.2 + SSL_CTX_set_mode: function (ctx: PSSL_CTX; op: TIdC_LONG): TIdC_LONG; cdecl = nil; {removed 1.0.0} + SSL_CTX_clear_mode: function (ctx: PSSL_CTX; op: TIdC_LONG): TIdC_LONG; cdecl = nil; {removed 1.0.0} + + SSL_CTX_sess_set_cache_size: function (ctx: PSSL_CTX; t: TIdC_LONG): TIdC_LONG; cdecl = nil; {removed 1.0.0} + SSL_CTX_sess_get_cache_size: function (ctx: PSSL_CTX): TIdC_LONG; cdecl = nil; {removed 1.0.0} + SSL_CTX_set_session_cache_mode: function (ctx: PSSL_CTX; m: TIdC_LONG): TIdC_LONG; cdecl = nil; {removed 1.0.0} + SSL_CTX_get_session_cache_mode: function (ctx: PSSL_CTX): TIdC_LONG; cdecl = nil; {removed 1.0.0} + + SSL_clear_num_renegotiations: function (ssl: PSSL): TIdC_LONG; cdecl = nil; {removed 1.0.0} + SSL_total_renegotiations: function (ssl: PSSL): TIdC_LONG; cdecl = nil; {removed 1.0.0} + SSL_CTX_set_tmp_dh: function (ctx: PSSL_CTX; dh: PDH): TIdC_LONG; cdecl = nil; {removed 1.0.0} + SSL_CTX_set_tmp_ecdh: function (ctx: PSSL_CTX; ecdh: PByte): TIdC_LONG; cdecl = nil; {removed 1.0.0} + SSL_CTX_set_dh_auto: function (ctx: PSSL_CTX; onoff: TIdC_LONG): TIdC_LONG; cdecl = nil; {removed 1.0.0} + SSL_set_dh_auto: function (s: PSSL; onoff: TIdC_LONG): TIdC_LONG; cdecl = nil; {removed 1.0.0} + SSL_set_tmp_dh: function (ssl: PSSL; dh: PDH): TIdC_LONG; cdecl = nil; {removed 1.0.0} + SSL_set_tmp_ecdh: function (ssl: PSSL; ecdh: PByte): TIdC_LONG; cdecl = nil; {removed 1.0.0} + SSL_CTX_add_extra_chain_cert: function (ctx: PSSL_CTX; x509: PByte): TIdC_LONG; cdecl = nil; {removed 1.0.0} + SSL_CTX_get_extra_chain_certs: function (ctx: PSSL_CTX; px509: Pointer): TIdC_LONG; cdecl = nil; {removed 1.0.0} + SSL_CTX_get_extra_chain_certs_only: function (ctx: PSSL_CTX; px509: Pointer): TIdC_LONG; cdecl = nil; {removed 1.0.0} + SSL_CTX_clear_extra_chain_certs: function (ctx: PSSL_CTX): TIdC_LONG; cdecl = nil; {removed 1.0.0} + SSL_CTX_set0_chain: function (ctx: PSSL_CTX; sk: PByte): TIdC_LONG; cdecl = nil; {removed 1.0.0} + SSL_CTX_set1_chain: function (ctx: PSSL_CTX; sk: PByte): TIdC_LONG; cdecl = nil; {removed 1.0.0} + SSL_CTX_add0_chain_cert: function (ctx: PSSL_CTX; x509: PX509): TIdC_LONG; cdecl = nil; {removed 1.0.0} + SSL_CTX_add1_chain_cert: function (ctx: PSSL_CTX; x509: PX509): TIdC_LONG; cdecl = nil; {removed 1.0.0} + SSL_CTX_get0_chain_certs: function (ctx: PSSL_CTX; px509: Pointer): TIdC_LONG; cdecl = nil; {removed 1.0.0} + SSL_CTX_clear_chain_certs: function (ctx: PSSL_CTX): TIdC_LONG; cdecl = nil; {removed 1.0.0} + SSL_CTX_build_cert_chain: function (ctx: PSSL_CTX; flags: TIdC_LONG): TIdC_LONG; cdecl = nil; {removed 1.0.0} + SSL_CTX_select_current_cert: function (ctx: PSSL_CTX; x509: PByte): TIdC_LONG; cdecl = nil; {removed 1.0.0} + SSL_CTX_set_current_cert: function (ctx: PSSL_CTX; op: TIdC_LONG): TIdC_LONG; cdecl = nil; {removed 1.0.0} + SSL_CTX_set0_verify_cert_store: function (ctx: PSSL_CTX; st: Pointer): TIdC_LONG; cdecl = nil; {removed 1.0.0} + SSL_CTX_set1_verify_cert_store: function (ctx: PSSL_CTX; st: Pointer): TIdC_LONG; cdecl = nil; {removed 1.0.0} + SSL_CTX_set0_chain_cert_store: function (ctx: PSSL_CTX; st: Pointer): TIdC_LONG; cdecl = nil; {removed 1.0.0} + SSL_CTX_set1_chain_cert_store: function (ctx: PSSL_CTX; st: Pointer): TIdC_LONG; cdecl = nil; {removed 1.0.0} + SSL_set0_chain: function (s: PSSL; sk: PByte): TIdC_LONG; cdecl = nil; {removed 1.0.0} + SSL_set1_chain: function (s: PSSL; sk: PByte): TIdC_LONG; cdecl = nil; {removed 1.0.0} + SSL_add0_chain_cert: function (s: PSSL; x509: PByte): TIdC_LONG; cdecl = nil; {removed 1.0.0} + SSL_add1_chain_cert: function (s: PSSL; x509: PByte): TIdC_LONG; cdecl = nil; {removed 1.0.0} + SSL_get0_chain_certs: function (s: PSSL; px509: Pointer): TIdC_LONG; cdecl = nil; {removed 1.0.0} + SSL_clear_chain_certs: function (s: PSSL): TIdC_LONG; cdecl = nil; {removed 1.0.0} + SSL_build_cert_chain: function (s: PSSL; flags: TIdC_LONG): TIdC_LONG; cdecl = nil; {removed 1.0.0} + SSL_select_current_cert: function (s: PSSL; x509: PByte): TIdC_LONG; cdecl = nil; {removed 1.0.0} + SSL_set_current_cert: function (s: PSSL; op: TIdC_LONG): TIdC_LONG; cdecl = nil; {removed 1.0.0} + SSL_set0_verify_cert_store: function (s: PSSL; st: PByte): TIdC_LONG; cdecl = nil; {removed 1.0.0} + SSL_set1_verify_cert_store: function (s: PSSL; st: PByte): TIdC_LONG; cdecl = nil; {removed 1.0.0} + SSL_set0_chain_cert_store: function (s: PSSL; st: PByte): TIdC_LONG; cdecl = nil; {removed 1.0.0} + SSL_set1_chain_cert_store: function (s: PSSL; st: PByte): TIdC_LONG; cdecl = nil; {removed 1.0.0} + SSL_get1_groups: function (s: PSSL; glist: PIdC_INT): TIdC_LONG; cdecl = nil; {removed 1.0.0} + SSL_CTX_set1_groups: function (ctx: PSSL_CTX; glist: PByte; glistlen: TIdC_LONG): TIdC_LONG; cdecl = nil; {removed 1.0.0} + SSL_CTX_set1_groups_list: function (ctx: PSSL_CTX; s: PByte): TIdC_LONG; cdecl = nil; {removed 1.0.0} + SSL_set1_groups: function (s: PSSL; glist: PByte; glistlen: TIdC_LONG): TIdC_LONG; cdecl = nil; {removed 1.0.0} + SSL_set1_groups_list: function (s: PSSL; str: PByte): TIdC_LONG; cdecl = nil; {removed 1.0.0} + SSL_get_shared_group: function (s: PSSL; n: TIdC_LONG): TIdC_LONG; cdecl = nil; {removed 1.0.0} + SSL_CTX_set1_sigalgs: function (ctx: PSSL_CTX; slist: PIdC_INT; slistlen: TIdC_LONG): TIdC_LONG; cdecl = nil; {removed 1.0.0} + SSL_CTX_set1_sigalgs_list: function (ctx: PSSL_CTX; s: PByte): TIdC_LONG; cdecl = nil; {removed 1.0.0} + SSL_set1_sigalgs: function (s: PSSL; slist: PIdC_INT; slistlen: TIdC_LONG): TIdC_LONG; cdecl = nil; {removed 1.0.0} + SSL_set1_sigalgs_list: function (s: PSSL; str: PByte): TIdC_LONG; cdecl = nil; {removed 1.0.0} + SSL_CTX_set1_client_sigalgs: function (ctx: PSSL_CTX; slist: PIdC_INT; slistlen: TIdC_LONG): TIdC_LONG; cdecl = nil; {removed 1.0.0} + SSL_CTX_set1_client_sigalgs_list: function (ctx: PSSL_CTX; s: PByte): TIdC_LONG; cdecl = nil; {removed 1.0.0} + SSL_set1_client_sigalgs: function (s: PSSL; slist: PIdC_INT; slistlen: TIdC_LONG): TIdC_LONG; cdecl = nil; {removed 1.0.0} + SSL_set1_client_sigalgs_list: function (s: PSSL; str: PByte): TIdC_LONG; cdecl = nil; {removed 1.0.0} + SSL_get0_certificate_types: function (s: PSSL; clist: PByte): TIdC_LONG; cdecl = nil; {removed 1.0.0} + SSL_CTX_set1_client_certificate_types: function (ctx: PSSL_CTX; clist: PByte; clistlen: TIdC_LONG): TIdC_LONG; cdecl = nil; {removed 1.0.0} + SSL_set1_client_certificate_types: function (s: PSSL; clist: PByte; clistlen: TIdC_LONG): TIdC_LONG; cdecl = nil; {removed 1.0.0} + SSL_get_signature_nid: function (s: PSSL; pn: Pointer): TIdC_LONG; cdecl = nil; {removed 1.0.0} + SSL_get_peer_signature_nid: function (s: PSSL; pn: Pointer): TIdC_LONG; cdecl = nil; {removed 1.0.0} + SSL_get_peer_tmp_key: function (s: PSSL; pk: Pointer): TIdC_LONG; cdecl = nil; {removed 1.0.0} + SSL_get_tmp_key: function (s: PSSL; pk: Pointer): TIdC_LONG; cdecl = nil; {removed 1.0.0} + SSL_get0_raw_cipherlist: function (s: PSSL; plst: Pointer): TIdC_LONG; cdecl = nil; {removed 1.0.0} + SSL_get0_ec_point_formats: function (s: PSSL; plst: Pointer): TIdC_LONG; cdecl = nil; {removed 1.0.0} + + //typedef TIdC_INT (*tls_session_secret_cb_fn)(s: PSSL, void *secret, TIdC_INT *secret_len, + // STACK_OF(SSL_CIPHER) *peer_ciphers, + // const SSL_CIPHER **cipher, void *arg); + + SSL_CTX_get_options: function (const ctx: PSSL_CTX): TIdC_ULONG; cdecl = nil; {introduced 1.1.0} + SSL_get_options: function (const s: PSSL): TIdC_ULONG; cdecl = nil; {introduced 1.1.0} + SSL_CTX_clear_options: function (ctx: PSSL_CTX; op: TIdC_ULONG): TIdC_ULONG; cdecl = nil; {introduced 1.1.0} + SSL_clear_options: function (s: PSSL; op: TIdC_ULONG): TIdC_ULONG; cdecl = nil; {introduced 1.1.0} + SSL_CTX_set_options: function (ctx: PSSL_CTX; op: TIdC_ULONG): TIdC_ULONG; cdecl = nil; {introduced 1.1.0} + SSL_set_options: function (s: PSSL; op: TIdC_ULONG): TIdC_ULONG; cdecl = nil; {introduced 1.1.0} + + //# define SSL_CTX_set_mode(ctx,op) \ + // SSL_CTX_ctrl((ctx),SSL_CTRL_MODE,(op),NULL) + //# define SSL_CTX_clear_mode(ctx,op) \ + // SSL_CTX_ctrl((ctx),SSL_CTRL_CLEAR_MODE,(op),NULL) + //# define SSL_CTX_get_mode(ctx) \ + // SSL_CTX_ctrl((ctx),SSL_CTRL_MODE,0,NULL) + //# define SSL_clear_mode(ssl,op) \ + // SSL_ctrl((ssl),SSL_CTRL_CLEAR_MODE,(op),NULL) + //# define SSL_set_mode(ssl,op) \ + // SSL_ctrl((ssl),SSL_CTRL_MODE,(op),NULL) + //# define SSL_get_mode(ssl) \ + // SSL_ctrl((ssl),SSL_CTRL_MODE,0,NULL) + //# define SSL_set_mtu(ssl, mtu) \ + // SSL_ctrl((ssl),SSL_CTRL_SET_MTU,(mtu),NULL) + //# define DTLS_set_link_mtu(ssl, mtu) \ + // SSL_ctrl((ssl),DTLS_CTRL_SET_LINK_MTU,(mtu),NULL) + //# define DTLS_get_link_min_mtu(ssl) \ + // SSL_ctrl((ssl),DTLS_CTRL_GET_LINK_MIN_MTU,0,NULL) + // + //# define SSL_get_secure_renegotiation_support(ssl) \ + // SSL_ctrl((ssl), SSL_CTRL_GET_RI_SUPPORT, 0, NULL) + // + //# ifndef OPENSSL_NO_HEARTBEATS + //# define SSL_heartbeat(ssl) \ + // SSL_ctrl((ssl),SSL_CTRL_DTLS_EXT_SEND_HEARTBEAT,0,NULL) + //# endif + // + //# define SSL_CTX_set_cert_flags(ctx,op) \ + // SSL_CTX_ctrl((ctx),SSL_CTRL_CERT_FLAGS,(op),NULL) + //# define SSL_set_cert_flags(s,op) \ + // SSL_ctrl((s),SSL_CTRL_CERT_FLAGS,(op),NULL) + //# define SSL_CTX_clear_cert_flags(ctx,op) \ + // SSL_CTX_ctrl((ctx),SSL_CTRL_CLEAR_CERT_FLAGS,(op),NULL) + //# define SSL_clear_cert_flags(s,op) \ + // SSL_ctrl((s),SSL_CTRL_CLEAR_CERT_FLAGS,(op),NULL) + // + //void SSL_CTX_set_msg_callback(ctx: PSSL_CTX, + // void (*cb) (TIdC_INT write_p, TIdC_INT version, + // TIdC_INT content_type, const void *buf, + // TIdC_SIZET len, ssl: PSSL, void *arg)); + //void SSL_set_msg_callback(ssl: PSSL, + // void (*cb) (TIdC_INT write_p, TIdC_INT version, + // TIdC_INT content_type, const void *buf, + // TIdC_SIZET len, ssl: PSSL, void *arg)); + //# define SSL_CTX_set_msg_callback_arg(ctx, arg) SSL_CTX_ctrl((ctx), SSL_CTRL_SET_MSG_CALLBACK_ARG, 0, (arg)) + //# define SSL_set_msg_callback_arg(ssl, arg) SSL_ctrl((ssl), SSL_CTRL_SET_MSG_CALLBACK_ARG, 0, (arg)) + // + //# define SSL_get_extms_support(s) \ + // SSL_ctrl((s),SSL_CTRL_GET_EXTMS_SUPPORT,0,NULL) + // + //# ifndef OPENSSL_NO_SRP + + ///* see tls_srp.c */ + //__owur TIdC_INT SSL_SRP_CTX_init(s: PSSL); + //__owur TIdC_INT SSL_CTX_SRP_CTX_init(ctx: PSSL_CTX); + //TIdC_INT SSL_SRP_CTX_free(SSL *ctx); + //TIdC_INT SSL_CTX_SRP_CTX_free(ctx: PSSL_CTX); + //__owur TIdC_INT SSL_srp_server_param_with_username(s: PSSL, TIdC_INT *ad); + //__owur TIdC_INT SRP_Calc_A_param(s: PSSL); + + // # endif + + // LHASH_OF(SSL_SESSION) *SSL_CTX_sessions(ctx: PSSL_CTX); + //# define SSL_CTX_sess_number(ctx) \ + // SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_NUMBER,0,NULL) + //# define SSL_CTX_sess_connect(ctx) \ + // SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_CONNECT,0,NULL) + //# define SSL_CTX_sess_connect_good(ctx) \ + // SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_CONNECT_GOOD,0,NULL) + //# define SSL_CTX_sess_connect_renegotiate(ctx) \ + // SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_CONNECT_RENEGOTIATE,0,NULL) + //# define SSL_CTX_sess_accept(ctx) \ + // SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_ACCEPT,0,NULL) + //# define SSL_CTX_sess_accept_renegotiate(ctx) \ + // SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_ACCEPT_RENEGOTIATE,0,NULL) + //# define SSL_CTX_sess_accept_good(ctx) \ + // SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_ACCEPT_GOOD,0,NULL) + //# define SSL_CTX_sess_hits(ctx) \ + // SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_HIT,0,NULL) + //# define SSL_CTX_sess_cb_hits(ctx) \ + // SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_CB_HIT,0,NULL) + //# define SSL_CTX_sess_misses(ctx) \ + // SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_MISSES,0,NULL) + //# define SSL_CTX_sess_timeouts(ctx) \ + // SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_TIMEOUTS,0,NULL) + //# define SSL_CTX_sess_cache_full(ctx) \ + // SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_CACHE_FULL,0,NULL) + + SSL_CTX_sess_set_new_cb: procedure (ctx: PSSL_CTX; new_session_cb: SSL_CTX_sess_new_cb); cdecl = nil; + SSL_CTX_sess_get_new_cb: function (ctx: PSSL_CTX): SSL_CTX_sess_new_cb; cdecl = nil; + SSL_CTX_sess_set_remove_cb: procedure (ctx: PSSL_CTX; remove_session_cb: SSL_CTX_sess_remove_cb); cdecl = nil; + SSL_CTX_sess_get_remove_cb: function (ctx: PSSL_CTX): SSL_CTX_sess_remove_cb; cdecl = nil; + + //void SSL_CTX_sess_set_get_cb(ctx: PSSL_CTX, + // SSL_SESSION *(*get_session_cb) (struct ssl_st + // *ssl, + // const Byte + // *data, TIdC_INT len, + // TIdC_INT *copy)); + //SSL_SESSION *(*SSL_CTX_sess_get_get_cb(ctx: PSSL_CTX)) (struct ssl_st *ssl, + // const d: PByteata, + // TIdC_INT len, TIdC_INT *copy); + SSL_CTX_set_info_callback: procedure (ctx: PSSL_CTX; cb: SSL_CTX_info_callback); cdecl = nil; + SSL_CTX_get_info_callback: function (ctx: PSSL_CTX): SSL_CTX_info_callback; cdecl = nil; + SSL_CTX_set_client_cert_cb: procedure (ctx: PSSL_CTX; client_cert_cb: SSL_CTX_client_cert_cb); cdecl = nil; + SSL_CTX_get_client_cert_cb: function (ctx: PSSL_CTX): SSL_CTX_client_cert_cb; cdecl = nil; + SSL_CTX_set_client_cert_engine: function (ctx: PSSL_CTX; e: PENGINE): TIdC_INT; cdecl = nil; + + SSL_CTX_set_cookie_generate_cb: procedure (ctx: PSSL_CTX; app_gen_cookie_cb: SSL_CTX_cookie_verify_cb); cdecl = nil; + SSL_CTX_set_cookie_verify_cb: procedure (ctx: PSSL_CTX; app_verify_cookie_cb: SSL_CTX_set_cookie_verify_cb_app_verify_cookie_cb); cdecl = nil; + SSL_CTX_set_stateless_cookie_generate_cb: procedure (ctx: PSSL_CTX; gen_stateless_cookie_cb: SSL_CTX_set_stateless_cookie_generate_cb_gen_stateless_cookie_cb); cdecl = nil; {introduced 1.1.0} + SSL_CTX_set_stateless_cookie_verify_cb: procedure (ctx: PSSL_CTX; verify_stateless_cookie_cb: SSL_CTX_set_stateless_cookie_verify_cb_verify_stateless_cookie_cb); cdecl = nil; {introduced 1.1.0} + + //__owur TIdC_INT SSL_CTX_set_alpn_protos(ctx: PSSL_CTX, const Byte *protos, + // TIdC_UINT protos_len); + //__owur TIdC_INT SSL_set_alpn_protos(ssl: PSSL, const Byte *protos, + // TIdC_UINT protos_len); + + SSL_CTX_set_alpn_select_cb: procedure (ctx: PSSL_CTX; cb: SSL_CTX_alpn_select_cb_func; arg: Pointer); cdecl = nil; + SSL_get0_alpn_selected: procedure (const ssl: PSSL; const data: PPByte; len: PIdC_UINT); cdecl = nil; + SSL_CTX_set_psk_client_callback: procedure (ctx: PSSL_CTX; cb: SSL_psk_client_cb_func); cdecl = nil; + SSL_set_psk_client_callback: procedure (ssl: PSSL; cb: SSL_psk_client_cb_func); cdecl = nil; + SSL_CTX_set_psk_server_callback: procedure (ctx: PSSL_CTX; cb: SSL_psk_server_cb_func); cdecl = nil; + SSL_set_psk_server_callback: procedure (ssl: PSSL; cb: SSL_psk_server_cb_func); cdecl = nil; + + //__owur TIdC_INT SSL_CTX_use_psk_identity_hint(ctx: PSSL_CTX, const PIdAnsiChar *identity_hint); + //__owur TIdC_INT SSL_use_psk_identity_hint(s: PSSL, const PIdAnsiChar *identity_hint); + //const PIdAnsiChar *SSL_get_psk_identity_hint(const s: PSSL); + //const PIdAnsiChar *SSL_get_psk_identity(const s: PSSL); + + SSL_set_psk_find_session_callback: procedure (s: PSSL; cb: SSL_psk_find_session_cb_func); cdecl = nil; {introduced 1.1.0} + SSL_CTX_set_psk_find_session_callback: procedure (ctx: PSSL_CTX; cb: SSL_psk_find_session_cb_func); cdecl = nil; {introduced 1.1.0} + SSL_set_psk_use_session_callback: procedure (s: PSSL; cb: SSL_psk_use_session_cb_func); cdecl = nil; {introduced 1.1.0} + SSL_CTX_set_psk_use_session_callback: procedure (ctx: PSSL_CTX; cb: SSL_psk_use_session_cb_func); cdecl = nil; {introduced 1.1.0} + + ///* Register callbacks to handle custom TLS Extensions for client or server. */ + + //__owur TIdC_INT SSL_CTX_has_client_custom_ext(const ctx: PSSL_CTX, + // TIdC_UINT ext_type); + // + //__owur TIdC_INT SSL_CTX_add_client_custom_ext(ctx: PSSL_CTX, + // TIdC_UINT ext_type, + // custom_ext_add_cb add_cb, + // custom_ext_free_cb free_cb, + // void *add_arg, + // custom_ext_parse_cb parse_cb, + // void *parse_arg); + // + //__owur TIdC_INT SSL_CTX_add_server_custom_ext(ctx: PSSL_CTX, + // TIdC_UINT ext_type, + // custom_ext_add_cb add_cb, + // custom_ext_free_cb free_cb, + // void *add_arg, + // custom_ext_parse_cb parse_cb, + // void *parse_arg); + // + //__owur TIdC_INT SSL_CTX_add_custom_ext(ctx: PSSL_CTX, TIdC_UINT ext_type, + // TIdC_UINT context, + // SSL_custom_ext_add_cb_ex add_cb, + // SSL_custom_ext_free_cb_ex free_cb, + // void *add_arg, + // SSL_custom_ext_parse_cb_ex parse_cb, + // void *parse_arg); + + //__owur TIdC_INT SSL_extension_supported(TIdC_UINT ext_type); + + + ///* These will only be used when doing non-blocking IO */ + //# define SSL_want_nothing(s) (SSL_want(s) == SSL_NOTHING) + //# define SSL_want_read(s) (SSL_want(s) == SSL_READING) + //# define SSL_want_write(s) (SSL_want(s) == SSL_WRITING) + //# define SSL_want_x509_lookup(s) (SSL_want(s) == SSL_X509_LOOKUP) + //# define SSL_want_async(s) (SSL_want(s) == SSL_ASYNC_PAUSED) + //# define SSL_want_async_job(s) (SSL_want(s) == SSL_ASYNC_NO_JOBS) + //# define SSL_want_client_hello_cb(s) (SSL_want(s) == SSL_CLIENT_HELLO_CB) + + (* + * SSL_CTX_set_keylog_callback configures a callback to log key material. This + * is intended for debugging use with tools like Wireshark. The cb function + * should log line followed by a newline. + *) + SSL_CTX_set_keylog_callback: procedure (ctx: PSSL_CTX; cb: SSL_CTX_keylog_cb_func); cdecl = nil; {introduced 1.1.0} + (* + * SSL_CTX_get_keylog_callback returns the callback configured by + * SSL_CTX_set_keylog_callback. + *) + SSL_CTX_get_keylog_callback: function (const ctx: PSSL_CTX): SSL_CTX_keylog_cb_func; cdecl = nil; {introduced 1.1.0} + SSL_CTX_set_max_early_data: function (ctx: PSSL_CTX; max_early_data: TIdC_UINT32): TIdC_INT; cdecl = nil; {introduced 1.1.0} + SSL_CTX_get_max_early_data: function (const ctx: PSSL_CTX): TIdC_UINT32; cdecl = nil; {introduced 1.1.0} + SSL_set_max_early_data: function (s: PSSL; max_early_data: TIdC_UINT32): TIdC_INT; cdecl = nil; {introduced 1.1.0} + SSL_get_max_early_data: function (const s: PSSL): TIdC_UINT32; cdecl = nil; {introduced 1.1.0} + SSL_CTX_set_recv_max_early_data: function (ctx: PSSL_CTX; recv_max_early_data: TIdC_UINT32): TIdC_INT; cdecl = nil; {introduced 1.1.0} + SSL_CTX_get_recv_max_early_data: function (const ctx: PSSL_CTX): TIdC_UINT32; cdecl = nil; {introduced 1.1.0} + SSL_set_recv_max_early_data: function (s: PSSL; recv_max_early_data: TIdC_UINT32): TIdC_INT; cdecl = nil; {introduced 1.1.0} + SSL_get_recv_max_early_data: function (const s: PSSL): TIdC_UINT32; cdecl = nil; {introduced 1.1.0} + + ///* + // * These need to be after the above set of includes due to a compiler bug + // * in_ VisualStudio 2015 + // */ + //DEFINE_STACK_OF_CONST(SSL_CIPHER) + //DEFINE_STACK_OF(SSL_COMP) + + ///* compatibility */ + //# define SSL_set_app_data(s,arg) (SSL_set_ex_data(s,0,(PIdAnsiChar *)(arg))) + //# define SSL_get_app_data(s) (SSL_get_ex_data(s,0)) + //# define SSL_SESSION_set_app_data(s,a) (SSL_SESSION_set_ex_data(s,0, \ + // (PIdAnsiChar *)(a))) + //# define SSL_SESSION_get_app_data(s) (SSL_SESSION_get_ex_data(s,0)) + //# define SSL_CTX_get_app_data(ctx) (SSL_CTX_get_ex_data(ctx,0)) + //# define SSL_CTX_set_app_data(ctx,arg) (SSL_CTX_set_ex_data(ctx,0, \ + // (PIdAnsiChar *)(arg))) + SSL_get_app_data: function (const ssl: PSSL): Pointer ; cdecl = nil; {removed 1.0.0} + SSL_set_app_data: function (ssl: PSSL; data: Pointer): TIdC_INT; cdecl = nil; {removed 1.0.0} + + ///* Is the SSL_connection established? */ + //# define SSL_in_connect_init(a) (SSL_in_init(a) && !SSL_is_server(a)) + //# define SSL_in_accept_init(a) (SSL_in_init(a) && SSL_is_server(a)) + SSL_in_init: function (const s: PSSL): TIdC_INT; cdecl = nil; {introduced 1.1.0} + SSL_in_before: function (const s: PSSL): TIdC_INT; cdecl = nil; {introduced 1.1.0} + SSL_is_init_finished: function (const s: PSSL): TIdC_INT; cdecl = nil; {introduced 1.1.0} + + (*- + * Obtain latest Finished message + * -- that we sent (SSL_get_finished) + * -- that we expected from peer (SSL_get_peer_finished). + * Returns length (0 == no Finished so far), copies up to 'count' bytes. + *) + SSL_get_finished: function (const s: PSSL; buf: Pointer; count: TIdC_SIZET): TIdC_SIZET; cdecl = nil; + SSL_get_peer_finished: function (const s: PSSL; buf: Pointer; count: TIdC_SIZET): TIdC_SIZET; cdecl = nil; + + //# if OPENSSL_API_COMPAT < 0x10100000L + //# define OpenSSL_add_ssl_algorithms() SSL_library_init() + //# define SSLeay_add_ssl_algorithms() SSL_library_init() + //# endif + SSLeay_add_ssl_algorithms: function : TIdC_INT; cdecl = nil; {removed 1.0.0} + + ///* More backward compatibility */ + //# define SSL_get_cipher(s) \ + // SSL_CIPHER_get_name(SSL_get_current_cipher(s)) + //# define SSL_get_cipher_bits(s,np) \ + // SSL_CIPHER_get_bits(SSL_get_current_cipher(s),np) + //# define SSL_get_cipher_version(s) \ + // SSL_CIPHER_get_version(SSL_get_current_cipher(s)) + //# define SSL_get_cipher_name(s) \ + // SSL_CIPHER_get_name(SSL_get_current_cipher(s)) + //# define SSL_get_time(a) SSL_SESSION_get_time(a) + //# define SSL_set_time(a,b) SSL_SESSION_set_time((a),(b)) + //# define SSL_get_timeout(a) SSL_SESSION_get_timeout(a) + //# define SSL_set_timeout(a,b) SSL_SESSION_set_timeout((a),(b)) + // + //# define d2i_SSL_SESSION_bio(bp,s_id) ASN1_d2i_bio_of(SSL_SESSION,SSL_SESSION_new,d2i_SSL_SESSION,bp,s_id) + //# define i2d_SSL_SESSION_bio(bp,s_id) ASN1_i2d_bio_of(SSL_SESSION,i2d_SSL_SESSION,bp,s_id) + + //DECLARE_PEM_rw(SSL_SESSION, SSL_SESSION) + + //# define DTLSv1_get_timeout(ssl, arg) \ + // SSL_ctrl(ssl,DTLS_CTRL_GET_TIMEOUT,0, (void *)(arg)) + //# define DTLSv1_handle_timeout(ssl) \ + // SSL_ctrl(ssl,DTLS_CTRL_HANDLE_TIMEOUT,0, NULL) + // + ///* Backwards compatibility, original 1.1.0 names */ + //# define SSL_CTRL_GET_SERVER_TMP_KEY \ + // SSL_CTRL_GET_PEER_TMP_KEY + //# define SSL_get_server_tmp_key(s, pk) \ + // SSL_get_peer_tmp_key(s, pk) + + //# if OPENSSL_API_COMPAT < 0x10100000L + //const SSL_CTX_need_tmp_RSA = (ctx) 0; + //const SSL_CTX_set_tmp_rsa = (ctx;rsa) 1; + //const SSL_need_tmp_RSA = (ssl) 0; + //const SSL_set_tmp_rsa = (ssl;rsa) 1; + + //# define SSL_CTX_set_ecdh_auto(dummy, onoff) ((onoff) != 0) + //# define SSL_set_ecdh_auto(dummy, onoff) ((onoff) != 0) + ///* + // * We 'pretend' to call the callback to avoid warnings about unused static + // * functions. + // */ + //# define SSL_CTX_set_tmp_rsa_callback(ctx, cb) while(0) (cb)(NULL, 0, 0) + //# define SSL_set_tmp_rsa_callback(ssl, cb) while(0) (cb)(NULL, 0, 0) + //# endif + // + BIO_f_ssl: function : PBIO_METHOD; cdecl = nil; + BIO_new_ssl: function (ctx: PSSL_CTX; client: TIdC_INT): PBIO; cdecl = nil; + BIO_new_ssl_connect: function (ctx: PSSL_CTX): PBIO; cdecl = nil; + BIO_new_buffer_ssl_connect: function (ctx: PSSL_CTX): PBIO; cdecl = nil; + BIO_ssl_copy_session_id: function (to_: PBIO; from: PBIO): TIdC_INT; cdecl = nil; + + SSL_CTX_set_cipher_list: function (v1: PSSL_CTX; const str: PIdAnsiChar): TIdC_INT; cdecl = nil; + SSL_CTX_new: function (const meth: PSSL_METHOD): PSSL_CTX; cdecl = nil; + SSL_CTX_set_timeout: function (ctx: PSSL_CTX; t: TIdC_LONG): TIdC_LONG; cdecl = nil; + SSL_CTX_get_timeout: function (const ctx: PSSL_CTX): TIdC_LONG; cdecl = nil; + SSL_CTX_get_cert_store: function (const v1: PSSL_CTX): PX509_STORE; cdecl = nil; + SSL_want: function (const s: PSSL): TIdC_INT; cdecl = nil; + SSL_clear: function (s: PSSL): TIdC_INT; cdecl = nil; + + BIO_ssl_shutdown: procedure (ssl_bio: PBIO); cdecl = nil; + SSL_CTX_up_ref: function (ctx: PSSL_CTX): TIdC_INT; cdecl = nil; {introduced 1.1.0} + SSL_CTX_free: procedure (v1: PSSL_CTX); cdecl = nil; + SSL_CTX_set_cert_store: procedure (v1: PSSL_CTX; v2: PX509_STORE); cdecl = nil; + SSL_CTX_set1_cert_store: procedure (v1: PSSL_CTX; v2: PX509_STORE); cdecl = nil; {introduced 1.1.0} + + SSL_CTX_flush_sessions: procedure (ctx: PSSL_CTX; tm: TIdC_LONG); cdecl = nil; + + SSL_get_current_cipher: function (const s: PSSL): PSSL_CIPHER; cdecl = nil; + SSL_get_pending_cipher: function (const s: PSSL): PSSL_CIPHER; cdecl = nil; {introduced 1.1.0} + SSL_CIPHER_get_bits: function (const c: PSSL_CIPHER; var alg_bits: TIdC_INT): TIdC_INT; cdecl = nil; + SSL_CIPHER_get_version: function (const c: PSSL_CIPHER): PIdAnsiChar; cdecl = nil; + SSL_CIPHER_get_name: function (const c: PSSL_CIPHER): PIdAnsiChar; cdecl = nil; + SSL_CIPHER_standard_name: function (const c: PSSL_CIPHER): PIdAnsiChar; cdecl = nil; {introduced 1.1.0} + OPENSSL_cipher_name: function (const rfc_name: PIdAnsiChar): PIdAnsiChar; cdecl = nil; {introduced 1.1.0} + SSL_CIPHER_get_id: function (const c: PSSL_CIPHER): TIdC_UINT32; cdecl = nil; + SSL_CIPHER_get_protocol_id: function (const c: PSSL_CIPHER): TIdC_UINT16; cdecl = nil; {introduced 1.1.0} + SSL_CIPHER_get_kx_nid: function (const c: PSSL_CIPHER): TIdC_INT; cdecl = nil; {introduced 1.1.0} + SSL_CIPHER_get_auth_nid: function (const c: PSSL_CIPHER): TIdC_INT; cdecl = nil; {introduced 1.1.0} + SSL_CIPHER_get_handshake_digest: function (const c: PSSL_CIPHER): PEVP_MD; cdecl = nil; {introduced 1.1.0} + SSL_CIPHER_is_aead: function (const c: PSSL_CIPHER): TIdC_INT; cdecl = nil; {introduced 1.1.0} + + SSL_get_fd: function (const s: PSSL): TIdC_INT; cdecl = nil; + SSL_get_rfd: function (const s: PSSL): TIdC_INT; cdecl = nil; + SSL_get_wfd: function (const s: PSSL): TIdC_INT; cdecl = nil; + SSL_get_cipher_list: function (const s: PSSL; n: TIdC_INT): PIdAnsiChar; cdecl = nil; + SSL_get_shared_ciphers: function (const s: PSSL; buf: PIdAnsiChar; size: TIdC_INT): PIdAnsiChar; cdecl = nil; + SSL_get_read_ahead: function (const s: PSSL): TIdC_INT; cdecl = nil; + SSL_pending: function (const s: PSSL): TIdC_INT; cdecl = nil; + SSL_has_pending: function (const s: PSSL): TIdC_INT; cdecl = nil; {introduced 1.1.0} + SSL_set_fd: function (s: PSSL; fd: TIdC_INT): TIdC_INT; cdecl = nil; + SSL_set_rfd: function (s: PSSL; fd: TIdC_INT): TIdC_INT; cdecl = nil; + SSL_set_wfd: function (s: PSSL; fd: TIdC_INT): TIdC_INT; cdecl = nil; + SSL_set0_rbio: procedure (s: PSSL; rbio: PBIO); cdecl = nil; {introduced 1.1.0} + SSL_set0_wbio: procedure (s: PSSL; wbio: PBIO); cdecl = nil; {introduced 1.1.0} + SSL_set_bio: procedure (s: PSSL; rbio: PBIO; wbio: PBIO); cdecl = nil; + SSL_get_rbio: function (const s: PSSL): PBIO; cdecl = nil; + SSL_get_wbio: function (const s: PSSL): PBIO; cdecl = nil; + SSL_set_cipher_list: function (s: PSSL; const str: PIdAnsiChar): TIdC_INT; cdecl = nil; + SSL_CTX_set_ciphersuites: function (ctx: PSSL_CTX; const str: PIdAnsiChar): TIdC_INT; cdecl = nil; {introduced 1.1.0} + SSL_set_ciphersuites: function (s: PSSL; const str: PIdAnsiChar): TIdC_INT; cdecl = nil; {introduced 1.1.0} + SSL_get_verify_mode: function (const s: PSSL): TIdC_INT; cdecl = nil; + SSL_get_verify_depth: function (const s: PSSL): TIdC_INT; cdecl = nil; + SSL_get_verify_callback: function (const s: PSSL): SSL_verify_cb; cdecl = nil; + SSL_set_read_ahead: procedure (s: PSSL; yes: TIdC_INT); cdecl = nil; + SSL_set_verify: procedure (s: PSSL; mode: TIdC_INT; callback: SSL_verify_cb); cdecl = nil; + SSL_set_verify_depth: procedure (s: PSSL; depth: TIdC_INT); cdecl = nil; + //void SSL_set_cert_cb(s: PSSL, TIdC_INT (*cb) (ssl: PSSL, void *arg), void *arg); + + SSL_use_RSAPrivateKey: function (ssl: PSSL; rsa: PRSA): TIdC_INT; cdecl = nil; + SSL_use_RSAPrivateKey_ASN1: function (ssl: PSSL; const d: PByte; len: TIdC_LONG): TIdC_INT; cdecl = nil; + SSL_use_PrivateKey: function (ssl: PSSL; pkey: PEVP_PKEY): TIdC_INT; cdecl = nil; + SSL_use_PrivateKey_ASN1: function (pk: TIdC_INT; ssl: PSSL; const d: PByte; len: TIdC_LONG): TIdC_INT; cdecl = nil; + SSL_use_certificate: function (ssl: PSSL; x: PX509): TIdC_INT; cdecl = nil; + SSL_use_certificate_ASN1: function (ssl: PSSL; const d: PByte; len: TIdC_INT): TIdC_INT; cdecl = nil; + //__owur TIdC_INT SSL_use_cert_and_key(ssl: PSSL, x509: PX509, EVP_PKEY *privatekey, + // STACK_OF(X509) *chain, TIdC_INT override); + + (* Set serverinfo data for the current active cert. *) + SSL_CTX_use_serverinfo: function (ctx: PSSL_CTX; const serverinfo: PByte; serverinfo_length: TIdC_SIZET): TIdC_INT; cdecl = nil; + SSL_CTX_use_serverinfo_ex: function (ctx: PSSL_CTX; version: TIdC_UINT; const serverinfo: PByte; serverinfo_length: TIdC_SIZET): TIdC_INT; cdecl = nil; {introduced 1.1.0} + SSL_CTX_use_serverinfo_file: function (ctx: PSSL_CTX; const file_: PIdAnsiChar): TIdC_INT; cdecl = nil; + + SSL_use_RSAPrivateKey_file: function (ssl: PSSL; const file_: PIdAnsiChar; type_: TIdC_INT): TIdC_INT; cdecl = nil; + + SSL_use_PrivateKey_file: function (ssl: PSSL; const file_: PIdAnsiChar; type_: TIdC_INT): TIdC_INT; cdecl = nil; + SSL_use_certificate_file: function (ssl: PSSL; const file_: PIdAnsiChar; type_: TIdC_INT): TIdC_INT; cdecl = nil; + + SSL_CTX_use_RSAPrivateKey_file: function (ctx: PSSL_CTX; const file_: PIdAnsiChar; type_: TIdC_INT): TIdC_INT; cdecl = nil; + + SSL_CTX_use_PrivateKey_file: function (ctx: PSSL_CTX; const file_: PIdAnsiChar; type_: TIdC_INT): TIdC_INT; cdecl = nil; + SSL_CTX_use_certificate_file: function (ctx: PSSL_CTX; const file_: PIdAnsiChar; type_: TIdC_INT): TIdC_INT; cdecl = nil; + (* PEM type *) + SSL_CTX_use_certificate_chain_file: function (ctx: PSSL_CTX; const file_: PIdAnsiChar): TIdC_INT; cdecl = nil; + SSL_use_certificate_chain_file: function (ssl: PSSL; const file_: PIdAnsiChar): TIdC_INT; cdecl = nil; {introduced 1.1.0} + SSL_load_client_CA_file: function (const file_: PIdAnsiChar): PSTACK_OF_X509_NAME; cdecl = nil; + SSL_add_file_cert_subjects_to_stack: function (stackCAs: PSTACK_OF_X509_NAME; const file_: PIdAnsiChar):TIdC_INT; cdecl = nil; + SSL_add_dir_cert_subjects_to_stack: function (stackCAs: PSTACK_OF_X509_NAME; const dir_: PIdAnsiChar): TIdC_INT; cdecl = nil; + + //# if OPENSSL_API_COMPAT < 0x10100000L + //# define SSL_load_error_strings() \ + // OPENSSL_init_ssl(OPENSSL_INIT_LOAD_SSL_STRINGS \ + // | OPENSSL_INIT_LOAD_CRYPTO_STRINGS, NULL) + //# endif + SSL_load_error_strings: procedure ; cdecl = nil; {removed 1.1.0} + + SSL_state_string: function (const s: PSSL): PIdAnsiChar; cdecl = nil; + SSL_rstate_string: function (const s: PSSL): PIdAnsiChar; cdecl = nil; + SSL_state_string_long: function (const s: PSSL): PIdAnsiChar; cdecl = nil; + SSL_rstate_string_long: function (const s: PSSL): PIdAnsiChar; cdecl = nil; + SSL_SESSION_get_time: function (const s: PSSL_SESSION): TIdC_LONG; cdecl = nil; + SSL_SESSION_set_time: function (s: PSSL_SESSION; t: TIdC_LONG): TIdC_LONG; cdecl = nil; + SSL_SESSION_get_timeout: function (const s: PSSL_SESSION): TIdC_LONG; cdecl = nil; + SSL_SESSION_set_timeout: function (s: PSSL_SESSION; t: TIdC_LONG): TIdC_LONG; cdecl = nil; + SSL_SESSION_get_protocol_version: function (const s: PSSL_SESSION): TIdC_INT; cdecl = nil; {introduced 1.1.0} + SSL_SESSION_set_protocol_version: function (s: PSSL_SESSION; version: TIdC_INT): TIdC_INT; cdecl = nil; {introduced 1.1.0} + + SSL_SESSION_get0_hostname: function (const s: PSSL_SESSION): PIdAnsiChar; cdecl = nil; {introduced 1.1.0} + SSL_SESSION_set1_hostname: function (s: PSSL_SESSION; const hostname: PIdAnsiChar): TIdC_INT; cdecl = nil; {introduced 1.1.0} + SSL_SESSION_get0_alpn_selected: procedure (const s: PSSL_SESSION; const alpn: PPByte; len: PIdC_SIZET); cdecl = nil; {introduced 1.1.0} + SSL_SESSION_set1_alpn_selected: function (s: PSSL_SESSION; const alpn: PByte; len: TIdC_SIZET): TIdC_INT; cdecl = nil; {introduced 1.1.0} + SSL_SESSION_get0_cipher: function (const s: PSSL_SESSION): PSSL_CIPHER; cdecl = nil; {introduced 1.1.0} + SSL_SESSION_set_cipher: function (s: PSSL_SESSION; const cipher: PSSL_CIPHER): TIdC_INT; cdecl = nil; {introduced 1.1.0} + SSL_SESSION_has_ticket: function (const s: PSSL_SESSION): TIdC_INT; cdecl = nil; {introduced 1.1.0} + SSL_SESSION_get_ticket_lifetime_hint: function (const s: PSSL_SESSION): TIdC_ULONG; cdecl = nil; {introduced 1.1.0} + SSL_SESSION_get0_ticket: procedure (const s: PSSL_SESSION; const tick: PPByte; len: PIdC_SIZET); cdecl = nil; {introduced 1.1.0} + SSL_SESSION_get_max_early_data: function (const s: PSSL_SESSION): TIdC_UINT32; cdecl = nil; {introduced 1.1.0} + SSL_SESSION_set_max_early_data: function (s: PSSL_SESSION; max_early_data: TIdC_UINT32): TIdC_INT; cdecl = nil; {introduced 1.1.0} + SSL_copy_session_id: function (to_: PSSL; const from: PSSL): TIdC_INT; cdecl = nil; + SSL_SESSION_get0_peer: function (s: PSSL_SESSION): PX509; cdecl = nil; + SSL_SESSION_set1_id_context: function (s: PSSL_SESSION; const sid_ctx: PByte; sid_ctx_len: TIdC_UINT): TIdC_INT; cdecl = nil; + SSL_SESSION_set1_id: function (s: PSSL_SESSION; const sid: PByte; sid_len: TIdC_UINT): TIdC_INT; cdecl = nil; {introduced 1.1.0} + SSL_SESSION_is_resumable: function (const s: PSSL_SESSION): TIdC_INT; cdecl = nil; {introduced 1.1.0} + + SSL_SESSION_new: function : PSSL_SESSION; cdecl = nil; + SSL_SESSION_dup: function (src: PSSL_SESSION): PSSL_SESSION; cdecl = nil; {introduced 1.1.0} + SSL_SESSION_get_id: function (const s: PSSL_SESSION; len: PIdC_UINT): PByte; cdecl = nil; + SSL_SESSION_get0_id_context: function (const s: PSSL_SESSION; len: PIdC_UINT): PByte; cdecl = nil; {introduced 1.1.0} + SSL_SESSION_get_compress_id: function (const s: PSSL_SESSION): TIdC_UINT; cdecl = nil; + SSL_SESSION_print: function (fp: PBIO; const ses: PSSL_SESSION): TIdC_INT; cdecl = nil; + SSL_SESSION_print_keylog: function (bp: PBIO; const x: PSSL_SESSION): TIdC_INT; cdecl = nil; {introduced 1.1.0} + SSL_SESSION_up_ref: function (ses: PSSL_SESSION): TIdC_INT; cdecl = nil; {introduced 1.1.0} + SSL_SESSION_free: procedure (ses: PSSL_SESSION); cdecl = nil; + //__owur TIdC_INT i2d_SSL_SESSION(SSL_SESSION *in_, Byte **pp); + SSL_set_session: function (to_: PSSL; session: PSSL_SESSION): TIdC_INT; cdecl = nil; + SSL_CTX_add_session: function (ctx: PSSL_CTX; session: PSSL_SESSION): TIdC_INT; cdecl = nil; + SSL_CTX_remove_session: function (ctx: PSSL_CTX; session: PSSL_SESSION): TIdC_INT; cdecl = nil; + SSL_CTX_set_generate_session_id: function (ctx: PSSL_CTX; cb: GEN_SESSION_CB): TIdC_INT; cdecl = nil; + SSL_set_generate_session_id: function (s: PSSL; cb: GEN_SESSION_CB): TIdC_INT; cdecl = nil; + SSL_has_matching_session_id: function (const s: PSSL; const id: PByte; id_len: TIdC_UINT): TIdC_INT; cdecl = nil; + d2i_SSL_SESSION: function (a: PPSSL_SESSION; const pp: PPByte; length: TIdC_LONG): PSSL_SESSION; cdecl = nil; + + SSL_get_peer_certificate: function (const s: PSSL): PX509; cdecl = nil; {removed 3.0.0} + + //__owur STACK_OF(X509) *SSL_get_peer_cert_chain(const s: PSSL); + // + SSL_CTX_get_verify_mode: function (const ctx: PSSL_CTX): TIdC_INT; cdecl = nil; + SSL_CTX_get_verify_depth: function (const ctx: PSSL_CTX): TIdC_INT; cdecl = nil; + SSL_CTX_get_verify_callback: function (const ctx: PSSL_CTX): SSL_verify_cb; cdecl = nil; + SSL_CTX_set_verify: procedure (ctx: PSSL_CTX; mode: TIdC_INT; callback: SSL_verify_cb); cdecl = nil; + SSL_CTX_set_verify_depth: procedure (ctx: PSSL_CTX; depth: TIdC_INT); cdecl = nil; + SSL_CTX_set_cert_verify_callback: procedure (ctx: PSSL_CTX; cb: SSL_CTX_set_cert_verify_callback_cb; arg: Pointer); cdecl = nil; + SSL_CTX_set_cert_cb: procedure (c: PSSL_CTX; cb: SSL_CTX_set_cert_cb_cb; arg: Pointer); cdecl = nil; + SSL_CTX_use_RSAPrivateKey: function (ctx: PSSL_CTX; rsa: PRSA): TIdC_INT; cdecl = nil; + SSL_CTX_use_RSAPrivateKey_ASN1: function (ctx: PSSL_CTX; const d: PByte; len: TIdC_LONG): TIdC_INT; cdecl = nil; + SSL_CTX_use_PrivateKey: function (ctx: PSSL_CTX; pkey: PEVP_PKEY): TIdC_INT; cdecl = nil; + SSL_CTX_use_PrivateKey_ASN1: function (pk: TIdC_INT; ctx: PSSL_CTX; const d: PByte; len: TIdC_LONG): TIdC_INT; cdecl = nil; + SSL_CTX_use_certificate: function (ctx: PSSL_CTX; x: X509): TIdC_INT; cdecl = nil; + SSL_CTX_use_certificate_ASN1: function (ctx: PSSL_CTX; len: TIdC_INT; const d: PByte): TIdC_INT; cdecl = nil; + //function TIdC_INT SSL_CTX_use_cert_and_key(ctx: PSSL_CTX; x509: PX509; EVP_PKEY *privatekey; STACK_OF(X509) *chain; TIdC_INT override); + + SSL_CTX_set_default_passwd_cb: procedure (ctx: PSSL_CTX; cb: pem_password_cb); cdecl = nil; {introduced 1.1.0} + SSL_CTX_set_default_passwd_cb_userdata: procedure (ctx: PSSL_CTX; u: Pointer); cdecl = nil; {introduced 1.1.0} + SSL_CTX_get_default_passwd_cb: function (ctx: PSSL_CTX): pem_password_cb; cdecl = nil; {introduced 1.1.0} + SSL_CTX_get_default_passwd_cb_userdata: function (ctx: PSSL_CTX): Pointer; cdecl = nil; {introduced 1.1.0} + SSL_set_default_passwd_cb: procedure (s: PSSL; cb: pem_password_cb); cdecl = nil; {introduced 1.1.0} + SSL_set_default_passwd_cb_userdata: procedure (s: PSSL; u: Pointer); cdecl = nil; {introduced 1.1.0} + SSL_get_default_passwd_cb: function (s: PSSL): pem_password_cb; cdecl = nil; {introduced 1.1.0} + SSL_get_default_passwd_cb_userdata: function (s: PSSL): Pointer; cdecl = nil; {introduced 1.1.0} + + SSL_CTX_check_private_key: function (const ctx: PSSL_CTX): TIdC_INT; cdecl = nil; + SSL_check_private_key: function (const ctx: PSSL): TIdC_INT; cdecl = nil; + + SSL_CTX_set_session_id_context: function (ctx: PSSL_CTX; const sid_ctx: PByte; sid_ctx_len: TIdC_UINT): TIdC_INT; cdecl = nil; + + SSL_new: function (ctx: PSSL_CTX): PSSL; cdecl = nil; + SSL_up_ref: function (s: PSSL): TIdC_INT; cdecl = nil; {introduced 1.1.0} + SSL_is_dtls: function (const s: PSSL): TIdC_INT; cdecl = nil; {introduced 1.1.0} + SSL_set_session_id_context: function (ssl: PSSL; const sid_ctx: PByte; sid_ctx_len: TIdC_UINT): TIdC_INT; cdecl = nil; + + SSL_CTX_set_purpose: function (ctx: PSSL_CTX; purpose: TIdC_INT): TIdC_INT; cdecl = nil; + SSL_set_purpose: function (ssl: PSSL; purpose: TIdC_INT): TIdC_INT; cdecl = nil; + SSL_CTX_set_trust: function (ctx: PSSL_CTX; trust: TIdC_INT): TIdC_INT; cdecl = nil; + SSL_set_trust: function (ssl: PSSL; trust: TIdC_INT): TIdC_INT; cdecl = nil; + + SSL_set1_host: function (s: PSSL; const hostname: PIdAnsiChar): TIdC_INT; cdecl = nil; {introduced 1.1.0} + SSL_add1_host: function (s: PSSL; const hostname: PIdAnsiChar): TIdC_INT; cdecl = nil; {introduced 1.1.0} + SSL_get0_peername: function (s: PSSL): PIdAnsiChar; cdecl = nil; {introduced 1.1.0} + SSL_set_hostflags: procedure (s: PSSL; flags: TIdC_UINT); cdecl = nil; {introduced 1.1.0} + + SSL_CTX_dane_enable: function (ctx: PSSL_CTX): TIdC_INT; cdecl = nil; {introduced 1.1.0} + SSL_CTX_dane_mtype_set: function (ctx: PSSL_CTX; const md: PEVP_MD; mtype: TIdC_UINT8; ord: TIdC_UINT8): TIdC_INT; cdecl = nil; {introduced 1.1.0} + SSL_dane_enable: function (s: PSSL; const basedomain: PIdAnsiChar): TIdC_INT; cdecl = nil; {introduced 1.1.0} + SSL_dane_tlsa_add: function (s: PSSL; usage: TIdC_UINT8; selector: TIdC_UINT8; mtype: TIdC_UINT8; const data: PByte; dlen: TIdC_SIZET): TIdC_INT; cdecl = nil; {introduced 1.1.0} + SSL_get0_dane_authority: function (s: PSSL; mcert: PPX509; mspki: PPEVP_PKEY): TIdC_INT; cdecl = nil; {introduced 1.1.0} + SSL_get0_dane_tlsa: function (s: PSSL; usage: PIdC_UINT8; selector: PIdC_UINT8; mtype: PIdC_UINT8; const data: PPByte; dlen: PIdC_SIZET): TIdC_INT; cdecl = nil; {introduced 1.1.0} + (* + * Bridge opacity barrier between libcrypt and libssl, also needed to support + * offline testing in test/danetest.c + *) + SSL_get0_dane: function (ssl: PSSL): PSSL_DANE; cdecl = nil; {introduced 1.1.0} + + (* + * DANE flags + *) + SSL_CTX_dane_set_flags: function (ctx: PSSL_CTX; flags: TIdC_ULONG): TIdC_ULONG; cdecl = nil; {introduced 1.1.0} + SSL_CTX_dane_clear_flags: function (ctx: PSSL_CTX; flags: TIdC_ULONG): TIdC_ULONG; cdecl = nil; {introduced 1.1.0} + SSL_dane_set_flags: function (ssl: PSSL; flags: TIdC_ULONG): TIdC_ULONG; cdecl = nil; {introduced 1.1.0} + SSL_dane_clear_flags: function (ssl: PSSL; flags: TIdC_ULONG): TIdC_ULONG; cdecl = nil; {introduced 1.1.0} + + SSL_CTX_set1_param: function (ctx: PSSL_CTX; vpm: PX509_VERIFY_PARAM): TIdC_INT; cdecl = nil; + SSL_set1_param: function (ssl: PSSL; vpm: PX509_VERIFY_PARAM): TIdC_INT; cdecl = nil; + + SSL_CTX_get0_param: function (ctx: PSSL_CTX): PX509_VERIFY_PARAM; cdecl = nil; + SSL_get0_param: function (ssl: PSSL): PX509_VERIFY_PARAM; cdecl = nil; + + SSL_CTX_set_srp_username: function (ctx: PSSL_CTX; name: PIdAnsiChar): TIdC_INT; cdecl = nil; + SSL_CTX_set_srp_password: function (ctx: PSSL_CTX; password: PIdAnsiChar): TIdC_INT; cdecl = nil; + SSL_CTX_set_srp_strength: function (ctx: PSSL_CTX; strength: TIdC_INT): TIdC_INT; cdecl = nil; + + SSL_CTX_set_srp_client_pwd_callback: function (ctx: PSSL_CTX; cb: SSL_CTX_set_srp_client_pwd_callback_cb): TIdC_INT; cdecl = nil; + SSL_CTX_set_srp_verify_param_callback: function (ctx: PSSL_CTX; cb: SSL_CTX_set_srp_verify_param_callback_cb): TIdC_INT; cdecl = nil; + SSL_CTX_set_srp_username_callback: function (ctx: PSSL_CTX; cb: SSL_CTX_set_srp_username_callback_cb): TIdC_INT; cdecl = nil; + + SSL_CTX_set_srp_cb_arg: function (ctx: PSSL_CTX; arg: Pointer): TIdC_INT; cdecl = nil; + SSL_set_srp_server_param: function (s: PSSL; const N: PBIGNUm; const g: PBIGNUm; sa: PBIGNUm; v: PBIGNUm; info: PIdAnsiChar): TIdC_INT; cdecl = nil; + SSL_set_srp_server_param_pw: function (s: PSSL; const user: PIdAnsiChar; const pass: PIdAnsiChar; const grp: PIdAnsiChar): TIdC_INT; cdecl = nil; + + //__owur BIGNUM *SSL_get_srp_g(s: PSSL); + //__owur BIGNUM *SSL_get_srp_N(s: PSSL); + // + //__owur PIdAnsiChar *SSL_get_srp_username(s: PSSL); + //__owur PIdAnsiChar *SSL_get_srp_userinfo(s: PSSL); + // + ///* + // * ClientHello callback and helpers. + // */ + SSL_CTX_set_client_hello_cb: procedure (c: PSSL_CTX; cb: SSL_client_hello_cb_fn; arg: Pointer); cdecl = nil; {introduced 1.1.0} + SSL_client_hello_isv2: function (s: PSSL): TIdC_INT; cdecl = nil; {introduced 1.1.0} + SSL_client_hello_get0_legacy_version: function (s: PSSL): TIdC_UINT; cdecl = nil; {introduced 1.1.0} + SSL_client_hello_get0_random: function (s: PSSL; const out_: PPByte): TIdC_SIZET; cdecl = nil; {introduced 1.1.0} + SSL_client_hello_get0_session_id: function (s: PSSL; const out_: PPByte): TIdC_SIZET; cdecl = nil; {introduced 1.1.0} + SSL_client_hello_get0_ciphers: function (s: PSSL; const out_: PPByte): TIdC_SIZET; cdecl = nil; {introduced 1.1.0} + SSL_client_hello_get0_compression_methods: function (s: PSSL; const out_: PPByte): TIdC_SIZET; cdecl = nil; {introduced 1.1.0} + SSL_client_hello_get1_extensions_present: function (s: PSSL; out_: PPIdC_INT; outlen: PIdC_SIZET): TIdC_INT; cdecl = nil; {introduced 1.1.0} + SSL_client_hello_get0_ext: function (s: PSSL; type_: TIdC_UINT; const out_: PPByte; outlen: PIdC_SIZET): TIdC_INT; cdecl = nil; {introduced 1.1.0} + SSL_certs_clear: procedure (s: PSSL); cdecl = nil; + SSL_free: procedure (ssl: PSSL); cdecl = nil; + + (* + * Windows application developer has to include windows.h to use these. + *) + SSL_waiting_for_async: function (s: PSSL): TIdC_INT; cdecl = nil; {introduced 1.1.0} + SSL_get_all_async_fds: function (s: PSSL; fds: POSSL_ASYNC_FD; numfds: PIdC_SIZET): TIdC_INT; cdecl = nil; {introduced 1.1.0} + SSL_get_changed_async_fds: function (s: PSSL; addfd: POSSL_ASYNC_FD; numaddfds: PIdC_SIZET; delfd: POSSL_ASYNC_FD; numdelfds: PIdC_SIZET): TIdC_INT; cdecl = nil; {introduced 1.1.0} + SSL_accept: function (ssl: PSSL): TIdC_INT; cdecl = nil; + SSL_stateless: function (s: PSSL): TIdC_INT; cdecl = nil; {introduced 1.1.0} + SSL_connect: function (ssl: PSSL): TIdC_INT; cdecl = nil; + SSL_read: function (ssl: PSSL; buf: Pointer; num: TIdC_INT): TIdC_INT; cdecl = nil; + SSL_read_ex: function (ssl: PSSL; buf: Pointer; num: TIdC_SIZET; readbytes: PIdC_SIZET): TIdC_INT; cdecl = nil; {introduced 1.1.0} + + SSL_read_early_data: function (s: PSSL; buf: Pointer; num: TIdC_SIZET; readbytes: PIdC_SIZET): TIdC_INT; cdecl = nil; {introduced 1.1.0} + SSL_peek: function (ssl: PSSL; buf: Pointer; num: TIdC_INT): TIdC_INT; cdecl = nil; + SSL_peek_ex: function (ssl: PSSL; buf: Pointer; num: TIdC_SIZET; readbytes: PIdC_SIZET): TIdC_INT; cdecl = nil; {introduced 1.1.0} + SSL_write: function (ssl: PSSL; const buf: Pointer; num: TIdC_INT): TIdC_INT; cdecl = nil; + SSL_write_ex: function (s: PSSL; const buf: Pointer; num: TIdC_SIZET; written: PIdC_SIZET): TIdC_INT; cdecl = nil; {introduced 1.1.0} + SSL_write_early_data: function (s: PSSL; const buf: Pointer; num: TIdC_SIZET; written: PIdC_SIZET): TIdC_INT; cdecl = nil; {introduced 1.1.0} + SSL_callback_ctrl: function (v1: PSSL; v2: TIdC_INT; v3: SSL_callback_ctrl_v3): TIdC_LONG; cdecl = nil; + + SSL_ctrl: function (ssl: PSSL; cmd: TIdC_INT; larg: TIdC_LONG; parg: Pointer): TIdC_LONG; cdecl = nil; + SSL_CTX_ctrl: function (ctx: PSSL_CTX; cmd: TIdC_INT; larg: TIdC_LONG; parg: Pointer): TIdC_LONG; cdecl = nil; + SSL_CTX_callback_ctrl: function (v1: PSSL_CTX; v2: TIdC_INT; v3: SSL_CTX_callback_ctrl_v3): TIdC_LONG; cdecl = nil; + + SSL_get_early_data_status: function (const s: PSSL): TIdC_INT; cdecl = nil; {introduced 1.1.0} + + SSL_get_error: function (const s: PSSL; ret_code: TIdC_INT): TIdC_INT; cdecl = nil; + SSL_get_version: function (const s: PSSL): PIdAnsiChar; cdecl = nil; + + (* This sets the 'default' SSL version that SSL_new() will create *) + SSL_CTX_set_ssl_version: function (ctx: PSSL_CTX; const meth: PSSL_METHOD): TIdC_INT; cdecl = nil; + + ///* Negotiate highest available SSL/TLS version */ + TLS_method: function : PSSL_METHOD; cdecl = nil; {introduced 1.1.0} + TLS_server_method: function : PSSL_METHOD; cdecl = nil; {introduced 1.1.0} + TLS_client_method: function : PSSL_METHOD; cdecl = nil; {introduced 1.1.0} + + //__owur const SSL_METHOD *DTLS_method(void); /* DTLS 1.0 and 1.2 */ + //__owur const SSL_METHOD *DTLS_server_method(void); /* DTLS 1.0 and 1.2 */ + //__owur const SSL_METHOD *DTLS_client_method(void); /* DTLS 1.0 and 1.2 */ + // + //__owur TIdC_SIZET DTLS_get_data_mtu(const s: PSSL); + // + //__owur STACK_OF(SSL_CIPHER) *SSL_get_ciphers(const s: PSSL); + //__owur STACK_OF(SSL_CIPHER) *SSL_CTX_get_ciphers(const ctx: PSSL_CTX); + //__owur STACK_OF(SSL_CIPHER) *SSL_get_client_ciphers(const s: PSSL); + //__owur STACK_OF(SSL_CIPHER) *SSL_get1_supported_ciphers(s: PSSL); + // + //__owur TIdC_INT SSL_do_handshake(s: PSSL); + SSL_key_update: function (s: PSSL; updatetype: TIdC_INT): TIdC_INT; cdecl = nil; {introduced 1.1.0} + SSL_get_key_update_type: function (const s: PSSL): TIdC_INT; cdecl = nil; {introduced 1.1.0} + SSL_renegotiate: function (s: PSSL): TIdC_INT; cdecl = nil; + SSL_renegotiate_abbreviated: function (s: PSSL): TIdC_INT; cdecl = nil; + SSL_shutdown: function (s: PSSL): TIdC_INT; cdecl = nil; + SSL_CTX_set_post_handshake_auth: procedure (ctx: PSSL_CTX; val: TIdC_INT); cdecl = nil; {introduced 1.1.0} + SSL_set_post_handshake_auth: procedure (s: PSSL; val: TIdC_INT); cdecl = nil; {introduced 1.1.0} + + SSL_renegotiate_pending: function (const s: PSSL): TIdC_INT; cdecl = nil; + SSL_verify_client_post_handshake: function (s: PSSL): TIdC_INT; cdecl = nil; {introduced 1.1.0} + + SSL_CTX_get_ssl_method: function (const ctx: PSSL_CTX): PSSL_METHOD; cdecl = nil; + SSL_get_ssl_method: function (const s: PSSL): PSSL_METHOD; cdecl = nil; + SSL_set_ssl_method: function (s: PSSL; const method: PSSL_METHOD): TIdC_INT; cdecl = nil; + SSL_alert_type_string_long: function (value: TIdC_INT): PIdAnsiChar; cdecl = nil; + SSL_alert_type_string: function (value: TIdC_INT): PIdAnsiChar; cdecl = nil; + SSL_alert_desc_string_long: function (value: TIdC_INT): PIdAnsiChar; cdecl = nil; + SSL_alert_desc_string: function (value: TIdC_INT): PIdAnsiChar; cdecl = nil; + + //void SSL_set0_CA_list(s: PSSL, STACK_OF(X509_NAME) *name_list); + //void SSL_CTX_set0_CA_list(ctx: PSSL_CTX, STACK_OF(X509_NAME) *name_list); + //__owur const STACK_OF(X509_NAME) *SSL_get0_CA_list(const s: PSSL); + //__owur const STACK_OF(X509_NAME) *SSL_CTX_get0_CA_list(const ctx: PSSL_CTX); + //__owur TIdC_INT SSL_add1_to_CA_list(ssl: PSSL, const X509 *x); + //__owur TIdC_INT SSL_CTX_add1_to_CA_list(ctx: PSSL_CTX, const X509 *x); + //__owur const STACK_OF(X509_NAME) *SSL_get0_peer_CA_list(const s: PSSL); + + //void SSL_set_client_CA_list(s: PSSL, STACK_OF(X509_NAME) *name_list); + //void SSL_CTX_set_client_CA_list(ctx: PSSL_CTX, STACK_OF(X509_NAME) *name_list); + //__owur STACK_OF(X509_NAME) *SSL_get_client_CA_list(const s: PSSL); + //__owur STACK_OF(X509_NAME) *SSL_CTX_get_client_CA_list(const SSL_CTX *s); + + SSL_CTX_set_client_CA_list: procedure (ctx: PSSL_CTX; name_list: PSTACK_OF_X509_NAME); cdecl = nil; + SSL_add_client_CA: function (ssl: PSSL; x: PX509): TIdC_INT; cdecl = nil; + SSL_CTX_add_client_CA: function (ctx: PSSL_CTX; x: PX509): TIdC_INT; cdecl = nil; + + SSL_set_connect_state: procedure (s: PSSL); cdecl = nil; + SSL_set_accept_state: procedure (s: PSSL); cdecl = nil; + + //__owur TIdC_LONG SSL_get_default_timeout(const s: PSSL); + // + //# if OPENSSL_API_COMPAT < 0x10100000L + //# define SSL_library_init() OPENSSL_init_ssl(0, NULL) + //# endif + SSL_library_init: function : TIdC_INT; cdecl = nil; {removed 1.1.0} + + //__owur PIdAnsiChar *SSL_CIPHER_description(const SSL_CIPHER *, PIdAnsiChar *buf, TIdC_INT size); + //__owur STACK_OF(X509_NAME) *SSL_dup_CA_list(const STACK_OF(X509_NAME) *sk); + SSL_CIPHER_description: function (cipher: PSSL_CIPHER; buf: PIdAnsiChar; size_ :TIdC_INT): PIdAnsiChar; cdecl = nil; + + SSL_dup: function (ssl: PSSL): PSSL; cdecl = nil; + + SSL_get_certificate: function (const ssl: PSSL): PX509; cdecl = nil; + (* + * EVP_PKEY + *) + SSL_get_privatekey: function (const ssl: PSSL): PEVP_PKEY; cdecl = nil; + + SSL_CTX_get0_certificate: function (const ctx: PSSL_CTX): PX509; cdecl = nil; + SSL_CTX_get0_privatekey: function (const ctx: PSSL_CTX): PEVP_PKEY; cdecl = nil; + + SSL_CTX_set_quiet_shutdown: procedure (ctx: PSSL_CTX; mode: TIdC_INT); cdecl = nil; + SSL_CTX_get_quiet_shutdown: function (const ctx: PSSL_CTX): TIdC_INT; cdecl = nil; + SSL_set_quiet_shutdown: procedure (ssl: PSSL; mode: TIdC_INT); cdecl = nil; + SSL_get_quiet_shutdown: function (const ssl: PSSL): TIdC_INT; cdecl = nil; + SSL_set_shutdown: procedure (ssl: PSSL; mode: TIdC_INT); cdecl = nil; + SSL_get_shutdown: function (const ssl: PSSL): TIdC_INT; cdecl = nil; + SSL_version: function (const ssl: PSSL): TIdC_INT; cdecl = nil; + SSL_client_version: function (const s: PSSL): TIdC_INT; cdecl = nil; {introduced 1.1.0} + SSL_CTX_set_default_verify_paths: function (ctx: PSSL_CTX): TIdC_INT; cdecl = nil; + SSL_CTX_set_default_verify_dir: function (ctx: PSSL_CTX): TIdC_INT; cdecl = nil; {introduced 1.1.0} + SSL_CTX_set_default_verify_file: function (ctx: PSSL_CTX): TIdC_INT; cdecl = nil; {introduced 1.1.0} + SSL_CTX_load_verify_locations: function (ctx: PSSL_CTX; const CAfile: PIdAnsiChar; const CApath: PIdAnsiChar): TIdC_INT; cdecl = nil; + //# define SSL_get0_session SSL_get_session/* just peek at pointer */ + SSL_get_session: function (const ssl: PSSL): PSSL_SESSION; cdecl = nil; + (* obtain a reference count *) + SSL_get1_session: function (ssl: PSSL): PSSL_SESSION; cdecl = nil; + SSL_get_SSL_CTX: function (const ssl: PSSL): PSSL_CTX; cdecl = nil; + SSL_set_SSL_CTX: function (ssl: PSSL; ctx: PSSL_CTX): PSSL_CTX; cdecl = nil; + SSL_set_info_callback: procedure (ssl: PSSL; cb: SSL_info_callback); cdecl = nil; + SSL_get_info_callback: function (const ssl: PSSL): SSL_info_callback; cdecl = nil; + SSL_get_state: function (const ssl: PSSL): OSSL_HANDSHAKE_STATE; cdecl = nil; {introduced 1.1.0} + + SSL_set_verify_result: procedure (ssl: PSSL; v: TIdC_LONG); cdecl = nil; + SSL_get_verify_result: function (const ssl: PSSL): TIdC_LONG; cdecl = nil; + //__owur STACK_OF(X509) *SSL_get0_verified_chain(const s: PSSL); + + SSL_get_client_random: function (const ssl: PSSL; out_: PByte; outlen: TIdC_SIZET): TIdC_SIZET; cdecl = nil; {introduced 1.1.0} + SSL_get_server_random: function (const ssl: PSSL; out_: PByte; outlen: TIdC_SIZET): TIdC_SIZET; cdecl = nil; {introduced 1.1.0} + SSL_SESSION_get_master_key: function (const sess: PSSL_SESSION; out_: PByte; outlen: TIdC_SIZET): TIdC_SIZET; cdecl = nil; {introduced 1.1.0} + SSL_SESSION_set1_master_key: function (sess: PSSL_SESSION; const in_: PByte; len: TIdC_SIZET): TIdC_INT; cdecl = nil; {introduced 1.1.0} + SSL_SESSION_get_max_fragment_length: function (const sess: PSSL_SESSION): TIdC_UINT8; cdecl = nil; {introduced 1.1.0} + + //#define SSL_get_ex_new_index(l, p, newf, dupf, freef) \ + // CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_SSL, l, p, newf, dupf, freef) + SSL_set_ex_data: function (ssl: PSSL; idx: TIdC_INT; data: Pointer): TIdC_INT; cdecl = nil; + SSL_get_ex_data: function (const ssl: PSSL; idx: TIdC_INT): Pointer; cdecl = nil; + //#define SSL_SESSION_get_ex_new_index(l, p, newf, dupf, freef) \ + // CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_SSL_SESSION, l, p, newf, dupf, freef) + SSL_SESSION_set_ex_data: function (ss: PSSL_SESSION; idx: TIdC_INT; data: Pointer): TIdC_INT; cdecl = nil; + SSL_SESSION_get_ex_data: function (const ss: PSSL_SESSION; idx: TIdC_INT): Pointer; cdecl = nil; + //#define SSL_CTX_get_ex_new_index(l, p, newf, dupf, freef) \ + // CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_SSL_CTX, l, p, newf, dupf, freef) + SSL_CTX_set_ex_data: function (ssl: PSSL_CTX; idx: TIdC_INT; data: Pointer): TIdC_INT; cdecl = nil; + SSL_CTX_get_ex_data: function (const ssl: PSSL_CTX; idx: TIdC_INT): Pointer; cdecl = nil; + + SSL_get_ex_data_X509_STORE_CTX_idx: function : TIdC_INT; cdecl = nil; + + //# define SSL_CTX_get_default_read_ahead(ctx) SSL_CTX_get_read_ahead(ctx) + //# define SSL_CTX_set_default_read_ahead(ctx,m) SSL_CTX_set_read_ahead(ctx,m) + //# define SSL_CTX_get_read_ahead(ctx) \ + // SSL_CTX_ctrl(ctx,SSL_CTRL_GET_READ_AHEAD,0,NULL) + //# define SSL_CTX_set_read_ahead(ctx,m) \ + // SSL_CTX_ctrl(ctx,SSL_CTRL_SET_READ_AHEAD,m,NULL) + //# define SSL_CTX_get_max_cert_list(ctx) \ + // SSL_CTX_ctrl(ctx,SSL_CTRL_GET_MAX_CERT_LIST,0,NULL) + //# define SSL_CTX_set_max_cert_list(ctx,m) \ + // SSL_CTX_ctrl(ctx,SSL_CTRL_SET_MAX_CERT_LIST,m,NULL) + //# define SSL_get_max_cert_list(ssl) \ + // SSL_ctrl(ssl,SSL_CTRL_GET_MAX_CERT_LIST,0,NULL) + //# define SSL_set_max_cert_list(ssl,m) \ + // SSL_ctrl(ssl,SSL_CTRL_SET_MAX_CERT_LIST,m,NULL) + // + //# define SSL_CTX_set_max_send_fragment(ctx,m) \ + // SSL_CTX_ctrl(ctx,SSL_CTRL_SET_MAX_SEND_FRAGMENT,m,NULL) + //# define SSL_set_max_send_fragment(ssl,m) \ + // SSL_ctrl(ssl,SSL_CTRL_SET_MAX_SEND_FRAGMENT,m,NULL) + //# define SSL_CTX_set_split_send_fragment(ctx,m) \ + // SSL_CTX_ctrl(ctx,SSL_CTRL_SET_SPLIT_SEND_FRAGMENT,m,NULL) + //# define SSL_set_split_send_fragment(ssl,m) \ + // SSL_ctrl(ssl,SSL_CTRL_SET_SPLIT_SEND_FRAGMENT,m,NULL) + //# define SSL_CTX_set_max_pipelines(ctx,m) \ + // SSL_CTX_ctrl(ctx,SSL_CTRL_SET_MAX_PIPELINES,m,NULL) + //# define SSL_set_max_pipelines(ssl,m) \ + // SSL_ctrl(ssl,SSL_CTRL_SET_MAX_PIPELINES,m,NULL) + + SSL_CTX_set_default_read_buffer_len: procedure (ctx: PSSL_CTX; len: TIdC_SIZET); cdecl = nil; {introduced 1.1.0} + SSL_set_default_read_buffer_len: procedure (s: PSSL; len: TIdC_SIZET); cdecl = nil; {introduced 1.1.0} + + SSL_CTX_set_tmp_dh_callback: procedure (ctx: PSSL_CTX; dh: SSL_CTX_set_tmp_dh_callback_dh); cdecl = nil; + SSL_set_tmp_dh_callback: procedure (ssl: PSSL; dh: SSL_set_tmp_dh_callback_dh); cdecl = nil; + + //__owur const COMP_METHOD *SSL_get_current_compression(const s: PSSL); + //__owur const COMP_METHOD *SSL_get_current_expansion(const s: PSSL); + //__owur const PIdAnsiChar *SSL_COMP_get_name(const COMP_METHOD *comp); + //__owur const PIdAnsiChar *SSL_COMP_get0_name(const SSL_COMP *comp); + //__owur TIdC_INT SSL_COMP_get_id(const SSL_COMP *comp); + //STACK_OF(SSL_COMP) *SSL_COMP_get_compression_methods(void); + //__owur STACK_OF(SSL_COMP) *SSL_COMP_set0_compression_methods(STACK_OF(SSL_COMP) + // *meths); + //# if OPENSSL_API_COMPAT < 0x10100000L + //# define SSL_COMP_free_compression_methods() while(0) continue + //# endif + //__owur TIdC_INT SSL_COMP_add_compression_method(TIdC_INT id, COMP_METHOD *cm); + + SSL_CIPHER_find: function (ssl: PSSL; const ptr: PByte): PSSL_CIPHER; cdecl = nil; + SSL_CIPHER_get_cipher_nid: function (const c: PSSL_CIPHEr): TIdC_INT; cdecl = nil; {introduced 1.1.0} + SSL_CIPHER_get_digest_nid: function (const c: PSSL_CIPHEr): TIdC_INT; cdecl = nil; {introduced 1.1.0} + //TIdC_INT SSL_bytes_to_cipher_list(s: PSSL, const Byte *bytes, TIdC_SIZET len, + // TIdC_INT isv2format, STACK_OF(SSL_CIPHER) **sk, + // STACK_OF(SSL_CIPHER) **scsvs); + + (* TLS extensions functions *) + SSL_set_session_ticket_ext: function (s: PSSL; ext_data: Pointer; ext_len: TIdC_INT): TIdC_INT; cdecl = nil; + // + SSL_set_session_ticket_ext_cb: function (s: PSSL; cb: tls_session_ticket_ext_cb_fn; arg: Pointer): TIdC_INT; cdecl = nil; + + ///* Pre-shared secret session resumption functions */ + //__owur TIdC_INT SSL_set_session_secret_cb(s: PSSL, + // tls_session_secret_cb_fn session_secret_cb, + // void *arg); + + SSL_CTX_set_not_resumable_session_callback: procedure (ctx: PSSL_CTX; cb: SSL_CTX_set_not_resumable_session_callback_cb); cdecl = nil; {introduced 1.1.0} + SSL_set_not_resumable_session_callback: procedure (ssl: PSSL; cb: SSL_set_not_resumable_session_callback_cb); cdecl = nil; {introduced 1.1.0} + SSL_CTX_set_record_padding_callback: procedure (ctx: PSSL_CTX; cb: SSL_CTX_set_record_padding_callback_cb); cdecl = nil; {introduced 1.1.0} + + SSL_CTX_set_record_padding_callback_arg: procedure (ctx: PSSL_CTX; arg: Pointer); cdecl = nil; {introduced 1.1.0} + SSL_CTX_get_record_padding_callback_arg: function (const ctx: PSSL_CTX): Pointer; cdecl = nil; {introduced 1.1.0} + SSL_CTX_set_block_padding: function (ctx: PSSL_CTX; block_size: TIdC_SIZET): TIdC_INT; cdecl = nil; {introduced 1.1.0} + + SSL_set_record_padding_callback: procedure (ssl: PSSL; cb: SSL_set_record_padding_callback_cb); cdecl = nil; {introduced 1.1.0} + + SSL_set_record_padding_callback_arg: procedure (ssl: PSSL; arg: Pointer); cdecl = nil; {introduced 1.1.0} + SSL_get_record_padding_callback_arg: function (const ssl: PSSL): Pointer; cdecl = nil; {introduced 1.1.0} + SSL_set_block_padding: function (ssl: PSSL; block_size: TIdC_SIZET): TIdC_INT; cdecl = nil; {introduced 1.1.0} + SSL_set_num_tickets: function (s: PSSL; num_tickets: TIdC_SIZET): TIdC_INT; cdecl = nil; {introduced 1.1.0} + SSL_get_num_tickets: function (const s: PSSL): TIdC_SIZET; cdecl = nil; {introduced 1.1.0} + SSL_CTX_set_num_tickets: function (ctx: PSSL_CTX; num_tickets: TIdC_SIZET): TIdC_INT; cdecl = nil; {introduced 1.1.0} + SSL_CTX_get_num_tickets: function (const ctx: PSSL_CTX): TIdC_SIZET; cdecl = nil; {introduced 1.1.0} + + //# if OPENSSL_API_COMPAT < 0x10100000L + //# define SSL_cache_hit(s) SSL_session_reused(s) + //# endif + + SSL_session_reused: function (const s: PSSL): TIdC_INT; cdecl = nil; {introduced 1.1.0} + SSL_is_server: function (const s: PSSL): TIdC_INT; cdecl = nil; + + SSL_CONF_CTX_new: function : PSSL_CONF_CTX; cdecl = nil; + SSL_CONF_CTX_finish: function (cctx: PSSL_CONF_CTX): TIdC_INT; cdecl = nil; + SSL_CONF_CTX_free: procedure (cctx: PSSL_CONF_CTX); cdecl = nil; + SSL_CONF_CTX_set_flags: function (cctx: PSSL_CONF_CTX; flags: TIdC_UINT): TIdC_UINT; cdecl = nil; + SSL_CONF_CTX_clear_flags: function (cctx: PSSL_CONF_CTX; flags: TIdC_UINT): TIdC_UINT; cdecl = nil; + SSL_CONF_CTX_set1_prefix: function (cctx: PSSL_CONF_CTX; const pre: PIdAnsiChar): TIdC_INT; cdecl = nil; + SSL_CONF_cmd: function (cctx: PSSL_CONF_CTX; const cmd: PIdAnsiChar; const value: PIdAnsiChar): TIdC_INT; cdecl = nil; + SSL_CONF_cmd_argv: function (cctx: PSSL_CONF_CTX; pargc: PIdC_INT; pargv: PPPIdAnsiChar): TIdC_INT; cdecl = nil; + SSL_CONF_cmd_value_type: function (cctx: PSSL_CONF_CTX; const cmd: PIdAnsiChar): TIdC_INT; cdecl = nil; + + SSL_CONF_CTX_set_ssl: procedure (cctx: PSSL_CONF_CTX; ssl: PSSL); cdecl = nil; + SSL_CONF_CTX_set_ssl_ctx: procedure (cctx: PSSL_CONF_CTX; ctx: PSSL_CTX); cdecl = nil; + SSL_add_ssl_module: procedure ; cdecl = nil; {introduced 1.1.0} + SSL_config: function (s: PSSL; const name: PIdAnsiChar): TIdC_INT; cdecl = nil; {introduced 1.1.0} + SSL_CTX_config: function (ctx: PSSL_CTX; const name: PIdAnsiChar): TIdC_INT; cdecl = nil; {introduced 1.1.0} + +// procedure SSL_trace(write_p: TIdC_INT; version: TIdC_INT; content_type: TIdC_INT; const buf: Pointer; len: TIdC_SIZET; ssl: PSSL; arg: Pointer); + + DTLSv1_listen: function (s: PSSL; client: PBIO_ADDr): TIdC_INT; cdecl = nil; {introduced 1.1.0} + + //# ifndef OPENSSL_NO_CT + // + ///* + // * A callback for verifying that the received SCTs are sufficient. + // * Expected to return 1 if they are sufficient, otherwise 0. + // * May return a negative integer if an error occurs. + // * A connection should be aborted if the SCTs are deemed insufficient. + // */ + //typedef TIdC_INT (*ssl_ct_validation_cb)(const CT_POLICY_EVAL_CTX *ctx, + // const STACK_OF(SCT) *scts, void *arg); + + ///* + // * Sets a |callback| that is invoked upon receipt of ServerHelloDone to validate + // * the received SCTs. + // * If the callback returns a non-positive result, the connection is terminated. + // * Call this function before beginning a handshake. + // * If a NULL |callback| is provided, SCT validation is disabled. + // * |arg| is arbitrary userdata that will be passed to the callback whenever it + // * is invoked. Ownership of |arg| remains with the caller. + // * + // * NOTE: A side-effect of setting a CT callback is that an OCSP stapled response + // * will be requested. + // */ + //function SSL_set_ct_validation_callback(s: PSSL; callback: ssl_ct_validation_cb; arg: Pointer): TIdC_INT; + //function SSL_CTX_set_ct_validation_callback(ctx: PSSL_CTX; callback: ssl_ct_validation_cb; arg: Pointer): TIdC_INT; + + //#define SSL_disable_ct(s) \ + // ((void) SSL_set_validation_callback((s), NULL, NULL)) + //#define SSL_CTX_disable_ct(ctx) \ + // ((void) SSL_CTX_set_validation_callback((ctx), NULL, NULL)) + + ///* + // * The validation type enumerates the available behaviours of the built-in SSL + // * CT validation callback selected via SSL_enable_ct() and SSL_CTX_enable_ct(). + // * The underlying callback is a static function in_ libssl. + // */ + + ///* + // * Enable CT by setting up a callback that implements one of the built-in + // * validation variants. The SSL_CT_VALIDATION_PERMISSIVE variant always + // * continues the handshake, the application can make appropriate decisions at + // * handshake completion. The SSL_CT_VALIDATION_STRICT variant requires at + // * least one valid SCT, or else handshake termination will be requested. The + // * handshake may continue anyway if SSL_VERIFY_NONE is in_ effect. + // */ + SSL_enable_ct: function (s: PSSL; validation_mode: TIdC_INT): TIdC_INT; cdecl = nil; {introduced 1.1.0} + SSL_CTX_enable_ct: function (ctx: PSSL_CTX; validation_mode: TIdC_INT): TIdC_INT; cdecl = nil; {introduced 1.1.0} + + ///* + // * Report whether a non-NULL callback is enabled. + // */ + SSL_ct_is_enabled: function (const s: PSSL): TIdC_INT; cdecl = nil; {introduced 1.1.0} + SSL_CTX_ct_is_enabled: function (const ctx: PSSL_CTX): TIdC_INT; cdecl = nil; {introduced 1.1.0} + + ///* Gets the SCTs received from a connection */ + //const STACK_OF(SCT) *SSL_get0_peer_scts(s: PSSL); + + SSL_CTX_set_default_ctlog_list_file: function (ctx: PSSL_CTX): TIdC_INT; cdecl = nil; {introduced 1.1.0} + SSL_CTX_set_ctlog_list_file: function (ctx: PSSL_CTX; const path: PIdAnsiChar): TIdC_INT; cdecl = nil; {introduced 1.1.0} + SSL_CTX_set0_ctlog_store: procedure (ctx: PSSL_CTX; logs: PCTLOG_STORE); cdecl = nil; {introduced 1.1.0} + + // const CTLOG_STORE *SSL_CTX_get0_ctlog_store(const ctx: PSSL_CTX); + + // # endif /* OPENSSL_NO_CT */ + + SSL_set_security_level: procedure (s: PSSL; level: TIdC_INT); cdecl = nil; {introduced 1.1.0} + + ////__owur TIdC_INT SSL_get_security_level(const s: PSSL); + SSL_set_security_callback: procedure (s: PSSL; cb: SSL_security_callback); cdecl = nil; {introduced 1.1.0} + SSL_get_security_callback: function (const s: PSSL): SSL_security_callback; cdecl = nil; {introduced 1.1.0} + SSL_set0_security_ex_data: procedure (s: PSSL; ex: Pointer); cdecl = nil; {introduced 1.1.0} + SSL_get0_security_ex_data: function (const s: PSSL): Pointer; cdecl = nil; {introduced 1.1.0} + SSL_CTX_set_security_level: procedure (ctx: PSSL_CTX; level: TIdC_INT); cdecl = nil; {introduced 1.1.0} + SSL_CTX_get_security_level: function (const ctx: PSSL_CTX): TIdC_INT; cdecl = nil; {introduced 1.1.0} + //void SSL_CTX_set_security_callback(ctx: PSSL_CTX, + // TIdC_INT (*cb) (const s: PSSL, const ctx: PSSL_CTX, + // TIdC_INT op, TIdC_INT bits, TIdC_INT nid, + // void *other, void *ex)); + //TIdC_INT (*SSL_CTX_get_security_callback(const ctx: PSSL_CTX)) (const s: PSSL, + // const ctx: PSSL_CTX, + // TIdC_INT op, TIdC_INT bits, + // TIdC_INT nid, + // void *other, + // void *ex); + + SSL_CTX_get0_security_ex_data: function (const ctx: PSSL_CTX): Pointer; cdecl = nil; {introduced 1.1.0} + + SSL_CTX_set0_security_ex_data: procedure (ctx: PSSL_CTX; ex: Pointer); cdecl = nil; {introduced 1.1.0} + + OPENSSL_init_ssl: function (opts: TIdC_UINT64; const settings: POPENSSL_INIT_SETTINGS): TIdC_INT; cdecl = nil; {introduced 1.1.0} + + //# ifndef OPENSSL_NO_UNIT_TEST + //__owur const struct openssl_ssl_test_functions *SSL_test_functions(void); + //# endif + + SSL_free_buffers: function (ssl: PSSL): TIdC_INT; cdecl = nil; {introduced 1.1.0} + SSL_alloc_buffers: function (ssl: PSSL): TIdC_INT; cdecl = nil; {introduced 1.1.0} + + SSL_CTX_set_session_ticket_cb: function (ctx: PSSL_CTX; gen_cb: SSL_CTX_generate_session_ticket_fn; dec_cb: SSL_CTX_decrypt_session_ticket_fn; arg: Pointer): TIdC_INT; cdecl = nil; {introduced 1.1.0} + + SSL_SESSION_set1_ticket_appdata: function (ss: PSSL_SESSION; const data: Pointer; len: TIdC_SIZET): TIdC_INT; cdecl = nil; {introduced 1.1.0} + SSL_SESSION_get0_ticket_appdata: function (ss: PSSL_SESSION; data: PPointer; len: PIdC_SIZET): TIdC_INT; cdecl = nil; {introduced 1.1.0} + + //extern const PIdAnsiChar SSL_version_str[]; + + DTLS_set_timer_cb: procedure (s: PSSL; cb: DTLS_timer_cb); cdecl = nil; {introduced 1.1.0} + SSL_CTX_set_allow_early_data_cb: procedure (ctx: PSSL_CTX; cb: SSL_allow_early_data_cb_fN; arg: Pointer); cdecl = nil; {introduced 1.1.0} + SSL_set_allow_early_data_cb: procedure (s: PSSL; cb: SSL_allow_early_data_cb_fN; arg: Pointer); cdecl = nil; {introduced 1.1.0} + + SSLv2_method: function : PSSL_METHOD; cdecl = nil; {removed 1.1.0 allow_nil} // SSLv2 + SSLv2_server_method: function : PSSL_METHOD; cdecl = nil; {removed 1.1.0 allow_nil} // SSLv2 + SSLv2_client_method: function : PSSL_METHOD; cdecl = nil; {removed 1.1.0 allow_nil} // SSLv2 + SSLv3_method: function : PSSL_METHOD; cdecl = nil; {removed 1.1.0 allow_nil} // SSLv3 + SSLv3_server_method: function : PSSL_METHOD; cdecl = nil; {removed 1.1.0 allow_nil} // SSLv3 + SSLv3_client_method: function : PSSL_METHOD; cdecl = nil; {removed 1.1.0 allow_nil} // SSLv3 + SSLv23_method: function : PSSL_METHOD; cdecl = nil; {removed 1.1.0 allow_nil} // SSLv3 but can rollback to v2 + SSLv23_server_method: function : PSSL_METHOD; cdecl = nil; {removed 1.1.0 allow_nil} // SSLv3 but can rollback to v2 + SSLv23_client_method: function : PSSL_METHOD; cdecl = nil; {removed 1.1.0 allow_nil} // SSLv3 but can rollback to v2 + TLSv1_method: function : PSSL_METHOD; cdecl = nil; {removed 1.1.0 allow_nil} // TLSv1.0 + TLSv1_server_method: function : PSSL_METHOD; cdecl = nil; {removed 1.1.0 allow_nil} // TLSv1.0 + TLSv1_client_method: function : PSSL_METHOD; cdecl = nil; {removed 1.1.0 allow_nil} // TLSv1.0 + TLSv1_1_method: function : PSSL_METHOD; cdecl = nil; {removed 1.1.0 allow_nil} //TLS1.1 + TLSv1_1_server_method: function : PSSL_METHOD; cdecl = nil; {removed 1.1.0 allow_nil} //TLS1.1 + TLSv1_1_client_method: function : PSSL_METHOD; cdecl = nil; {removed 1.1.0 allow_nil} //TLS1.1 + TLSv1_2_method: function : PSSL_METHOD; cdecl = nil; {removed 1.1.0 allow_nil} // TLSv1.2 + TLSv1_2_server_method: function : PSSL_METHOD; cdecl = nil; {removed 1.1.0 allow_nil} // TLSv1.2 + TLSv1_2_client_method: function : PSSL_METHOD; cdecl = nil; {removed 1.1.0 allow_nil} // TLSv1.2 + + //X509 *SSL_get0_peer_certificate(const SSL *s); + SSL_get0_peer_certificate: function (const s: PSSL): PX509; cdecl = nil; {introduced 3.3.0} + // X509 *SSL_get1_peer_certificate(const SSL *s); + SSL_get1_peer_certificate: function (const s: PSSL): PX509; cdecl = nil; {introduced 3.3.0} + + + +{$ELSE} + + + + //typedef TIdC_INT (*tls_session_secret_cb_fn)(s: PSSL, void *secret, TIdC_INT *secret_len, + // STACK_OF(SSL_CIPHER) *peer_ciphers, + // const SSL_CIPHER **cipher, void *arg); + + function SSL_CTX_get_options(const ctx: PSSL_CTX): TIdC_ULONG cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_get_options(const s: PSSL): TIdC_ULONG cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_CTX_clear_options(ctx: PSSL_CTX; op: TIdC_ULONG): TIdC_ULONG cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_clear_options(s: PSSL; op: TIdC_ULONG): TIdC_ULONG cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_CTX_set_options(ctx: PSSL_CTX; op: TIdC_ULONG): TIdC_ULONG cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_set_options(s: PSSL; op: TIdC_ULONG): TIdC_ULONG cdecl; external CLibSSL; {introduced 1.1.0} + + //# define SSL_CTX_set_mode(ctx,op) \ + // SSL_CTX_ctrl((ctx),SSL_CTRL_MODE,(op),NULL) + //# define SSL_CTX_clear_mode(ctx,op) \ + // SSL_CTX_ctrl((ctx),SSL_CTRL_CLEAR_MODE,(op),NULL) + //# define SSL_CTX_get_mode(ctx) \ + // SSL_CTX_ctrl((ctx),SSL_CTRL_MODE,0,NULL) + //# define SSL_clear_mode(ssl,op) \ + // SSL_ctrl((ssl),SSL_CTRL_CLEAR_MODE,(op),NULL) + //# define SSL_set_mode(ssl,op) \ + // SSL_ctrl((ssl),SSL_CTRL_MODE,(op),NULL) + //# define SSL_get_mode(ssl) \ + // SSL_ctrl((ssl),SSL_CTRL_MODE,0,NULL) + //# define SSL_set_mtu(ssl, mtu) \ + // SSL_ctrl((ssl),SSL_CTRL_SET_MTU,(mtu),NULL) + //# define DTLS_set_link_mtu(ssl, mtu) \ + // SSL_ctrl((ssl),DTLS_CTRL_SET_LINK_MTU,(mtu),NULL) + //# define DTLS_get_link_min_mtu(ssl) \ + // SSL_ctrl((ssl),DTLS_CTRL_GET_LINK_MIN_MTU,0,NULL) + // + //# define SSL_get_secure_renegotiation_support(ssl) \ + // SSL_ctrl((ssl), SSL_CTRL_GET_RI_SUPPORT, 0, NULL) + // + //# ifndef OPENSSL_NO_HEARTBEATS + //# define SSL_heartbeat(ssl) \ + // SSL_ctrl((ssl),SSL_CTRL_DTLS_EXT_SEND_HEARTBEAT,0,NULL) + //# endif + // + //# define SSL_CTX_set_cert_flags(ctx,op) \ + // SSL_CTX_ctrl((ctx),SSL_CTRL_CERT_FLAGS,(op),NULL) + //# define SSL_set_cert_flags(s,op) \ + // SSL_ctrl((s),SSL_CTRL_CERT_FLAGS,(op),NULL) + //# define SSL_CTX_clear_cert_flags(ctx,op) \ + // SSL_CTX_ctrl((ctx),SSL_CTRL_CLEAR_CERT_FLAGS,(op),NULL) + //# define SSL_clear_cert_flags(s,op) \ + // SSL_ctrl((s),SSL_CTRL_CLEAR_CERT_FLAGS,(op),NULL) + // + //void SSL_CTX_set_msg_callback(ctx: PSSL_CTX, + // void (*cb) (TIdC_INT write_p, TIdC_INT version, + // TIdC_INT content_type, const void *buf, + // TIdC_SIZET len, ssl: PSSL, void *arg)); + //void SSL_set_msg_callback(ssl: PSSL, + // void (*cb) (TIdC_INT write_p, TIdC_INT version, + // TIdC_INT content_type, const void *buf, + // TIdC_SIZET len, ssl: PSSL, void *arg)); + //# define SSL_CTX_set_msg_callback_arg(ctx, arg) SSL_CTX_ctrl((ctx), SSL_CTRL_SET_MSG_CALLBACK_ARG, 0, (arg)) + //# define SSL_set_msg_callback_arg(ssl, arg) SSL_ctrl((ssl), SSL_CTRL_SET_MSG_CALLBACK_ARG, 0, (arg)) + // + //# define SSL_get_extms_support(s) \ + // SSL_ctrl((s),SSL_CTRL_GET_EXTMS_SUPPORT,0,NULL) + // + //# ifndef OPENSSL_NO_SRP + + ///* see tls_srp.c */ + //__owur TIdC_INT SSL_SRP_CTX_init(s: PSSL); + //__owur TIdC_INT SSL_CTX_SRP_CTX_init(ctx: PSSL_CTX); + //TIdC_INT SSL_SRP_CTX_free(SSL *ctx); + //TIdC_INT SSL_CTX_SRP_CTX_free(ctx: PSSL_CTX); + //__owur TIdC_INT SSL_srp_server_param_with_username(s: PSSL, TIdC_INT *ad); + //__owur TIdC_INT SRP_Calc_A_param(s: PSSL); + + // # endif + + // LHASH_OF(SSL_SESSION) *SSL_CTX_sessions(ctx: PSSL_CTX); + //# define SSL_CTX_sess_number(ctx) \ + // SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_NUMBER,0,NULL) + //# define SSL_CTX_sess_connect(ctx) \ + // SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_CONNECT,0,NULL) + //# define SSL_CTX_sess_connect_good(ctx) \ + // SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_CONNECT_GOOD,0,NULL) + //# define SSL_CTX_sess_connect_renegotiate(ctx) \ + // SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_CONNECT_RENEGOTIATE,0,NULL) + //# define SSL_CTX_sess_accept(ctx) \ + // SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_ACCEPT,0,NULL) + //# define SSL_CTX_sess_accept_renegotiate(ctx) \ + // SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_ACCEPT_RENEGOTIATE,0,NULL) + //# define SSL_CTX_sess_accept_good(ctx) \ + // SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_ACCEPT_GOOD,0,NULL) + //# define SSL_CTX_sess_hits(ctx) \ + // SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_HIT,0,NULL) + //# define SSL_CTX_sess_cb_hits(ctx) \ + // SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_CB_HIT,0,NULL) + //# define SSL_CTX_sess_misses(ctx) \ + // SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_MISSES,0,NULL) + //# define SSL_CTX_sess_timeouts(ctx) \ + // SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_TIMEOUTS,0,NULL) + //# define SSL_CTX_sess_cache_full(ctx) \ + // SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_CACHE_FULL,0,NULL) + + procedure SSL_CTX_sess_set_new_cb(ctx: PSSL_CTX; new_session_cb: SSL_CTX_sess_new_cb) cdecl; external CLibSSL; + function SSL_CTX_sess_get_new_cb(ctx: PSSL_CTX): SSL_CTX_sess_new_cb cdecl; external CLibSSL; + procedure SSL_CTX_sess_set_remove_cb(ctx: PSSL_CTX; remove_session_cb: SSL_CTX_sess_remove_cb) cdecl; external CLibSSL; + function SSL_CTX_sess_get_remove_cb(ctx: PSSL_CTX): SSL_CTX_sess_remove_cb cdecl; external CLibSSL; + + //void SSL_CTX_sess_set_get_cb(ctx: PSSL_CTX, + // SSL_SESSION *(*get_session_cb) (struct ssl_st + // *ssl, + // const Byte + // *data, TIdC_INT len, + // TIdC_INT *copy)); + //SSL_SESSION *(*SSL_CTX_sess_get_get_cb(ctx: PSSL_CTX)) (struct ssl_st *ssl, + // const d: PByteata, + // TIdC_INT len, TIdC_INT *copy); + procedure SSL_CTX_set_info_callback(ctx: PSSL_CTX; cb: SSL_CTX_info_callback) cdecl; external CLibSSL; + function SSL_CTX_get_info_callback(ctx: PSSL_CTX): SSL_CTX_info_callback cdecl; external CLibSSL; + procedure SSL_CTX_set_client_cert_cb(ctx: PSSL_CTX; client_cert_cb: SSL_CTX_client_cert_cb) cdecl; external CLibSSL; + function SSL_CTX_get_client_cert_cb(ctx: PSSL_CTX): SSL_CTX_client_cert_cb cdecl; external CLibSSL; + function SSL_CTX_set_client_cert_engine(ctx: PSSL_CTX; e: PENGINE): TIdC_INT cdecl; external CLibSSL; + + procedure SSL_CTX_set_cookie_generate_cb(ctx: PSSL_CTX; app_gen_cookie_cb: SSL_CTX_cookie_verify_cb) cdecl; external CLibSSL; + procedure SSL_CTX_set_cookie_verify_cb(ctx: PSSL_CTX; app_verify_cookie_cb: SSL_CTX_set_cookie_verify_cb_app_verify_cookie_cb) cdecl; external CLibSSL; + procedure SSL_CTX_set_stateless_cookie_generate_cb(ctx: PSSL_CTX; gen_stateless_cookie_cb: SSL_CTX_set_stateless_cookie_generate_cb_gen_stateless_cookie_cb) cdecl; external CLibSSL; {introduced 1.1.0} + procedure SSL_CTX_set_stateless_cookie_verify_cb(ctx: PSSL_CTX; verify_stateless_cookie_cb: SSL_CTX_set_stateless_cookie_verify_cb_verify_stateless_cookie_cb) cdecl; external CLibSSL; {introduced 1.1.0} + + //__owur TIdC_INT SSL_CTX_set_alpn_protos(ctx: PSSL_CTX, const Byte *protos, + // TIdC_UINT protos_len); + //__owur TIdC_INT SSL_set_alpn_protos(ssl: PSSL, const Byte *protos, + // TIdC_UINT protos_len); + + procedure SSL_CTX_set_alpn_select_cb(ctx: PSSL_CTX; cb: SSL_CTX_alpn_select_cb_func; arg: Pointer) cdecl; external CLibSSL; + procedure SSL_get0_alpn_selected(const ssl: PSSL; const data: PPByte; len: PIdC_UINT) cdecl; external CLibSSL; + procedure SSL_CTX_set_psk_client_callback(ctx: PSSL_CTX; cb: SSL_psk_client_cb_func) cdecl; external CLibSSL; + procedure SSL_set_psk_client_callback(ssl: PSSL; cb: SSL_psk_client_cb_func) cdecl; external CLibSSL; + procedure SSL_CTX_set_psk_server_callback(ctx: PSSL_CTX; cb: SSL_psk_server_cb_func) cdecl; external CLibSSL; + procedure SSL_set_psk_server_callback(ssl: PSSL; cb: SSL_psk_server_cb_func) cdecl; external CLibSSL; + + //__owur TIdC_INT SSL_CTX_use_psk_identity_hint(ctx: PSSL_CTX, const PIdAnsiChar *identity_hint); + //__owur TIdC_INT SSL_use_psk_identity_hint(s: PSSL, const PIdAnsiChar *identity_hint); + //const PIdAnsiChar *SSL_get_psk_identity_hint(const s: PSSL); + //const PIdAnsiChar *SSL_get_psk_identity(const s: PSSL); + + procedure SSL_set_psk_find_session_callback(s: PSSL; cb: SSL_psk_find_session_cb_func) cdecl; external CLibSSL; {introduced 1.1.0} + procedure SSL_CTX_set_psk_find_session_callback(ctx: PSSL_CTX; cb: SSL_psk_find_session_cb_func) cdecl; external CLibSSL; {introduced 1.1.0} + procedure SSL_set_psk_use_session_callback(s: PSSL; cb: SSL_psk_use_session_cb_func) cdecl; external CLibSSL; {introduced 1.1.0} + procedure SSL_CTX_set_psk_use_session_callback(ctx: PSSL_CTX; cb: SSL_psk_use_session_cb_func) cdecl; external CLibSSL; {introduced 1.1.0} + + ///* Register callbacks to handle custom TLS Extensions for client or server. */ + + //__owur TIdC_INT SSL_CTX_has_client_custom_ext(const ctx: PSSL_CTX, + // TIdC_UINT ext_type); + // + //__owur TIdC_INT SSL_CTX_add_client_custom_ext(ctx: PSSL_CTX, + // TIdC_UINT ext_type, + // custom_ext_add_cb add_cb, + // custom_ext_free_cb free_cb, + // void *add_arg, + // custom_ext_parse_cb parse_cb, + // void *parse_arg); + // + //__owur TIdC_INT SSL_CTX_add_server_custom_ext(ctx: PSSL_CTX, + // TIdC_UINT ext_type, + // custom_ext_add_cb add_cb, + // custom_ext_free_cb free_cb, + // void *add_arg, + // custom_ext_parse_cb parse_cb, + // void *parse_arg); + // + //__owur TIdC_INT SSL_CTX_add_custom_ext(ctx: PSSL_CTX, TIdC_UINT ext_type, + // TIdC_UINT context, + // SSL_custom_ext_add_cb_ex add_cb, + // SSL_custom_ext_free_cb_ex free_cb, + // void *add_arg, + // SSL_custom_ext_parse_cb_ex parse_cb, + // void *parse_arg); + + //__owur TIdC_INT SSL_extension_supported(TIdC_UINT ext_type); + + + ///* These will only be used when doing non-blocking IO */ + //# define SSL_want_nothing(s) (SSL_want(s) == SSL_NOTHING) + //# define SSL_want_read(s) (SSL_want(s) == SSL_READING) + //# define SSL_want_write(s) (SSL_want(s) == SSL_WRITING) + //# define SSL_want_x509_lookup(s) (SSL_want(s) == SSL_X509_LOOKUP) + //# define SSL_want_async(s) (SSL_want(s) == SSL_ASYNC_PAUSED) + //# define SSL_want_async_job(s) (SSL_want(s) == SSL_ASYNC_NO_JOBS) + //# define SSL_want_client_hello_cb(s) (SSL_want(s) == SSL_CLIENT_HELLO_CB) + + (* + * SSL_CTX_set_keylog_callback configures a callback to log key material. This + * is intended for debugging use with tools like Wireshark. The cb function + * should log line followed by a newline. + *) + procedure SSL_CTX_set_keylog_callback(ctx: PSSL_CTX; cb: SSL_CTX_keylog_cb_func) cdecl; external CLibSSL; {introduced 1.1.0} + (* + * SSL_CTX_get_keylog_callback returns the callback configured by + * SSL_CTX_set_keylog_callback. + *) + function SSL_CTX_get_keylog_callback(const ctx: PSSL_CTX): SSL_CTX_keylog_cb_func cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_CTX_set_max_early_data(ctx: PSSL_CTX; max_early_data: TIdC_UINT32): TIdC_INT cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_CTX_get_max_early_data(const ctx: PSSL_CTX): TIdC_UINT32 cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_set_max_early_data(s: PSSL; max_early_data: TIdC_UINT32): TIdC_INT cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_get_max_early_data(const s: PSSL): TIdC_UINT32 cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_CTX_set_recv_max_early_data(ctx: PSSL_CTX; recv_max_early_data: TIdC_UINT32): TIdC_INT cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_CTX_get_recv_max_early_data(const ctx: PSSL_CTX): TIdC_UINT32 cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_set_recv_max_early_data(s: PSSL; recv_max_early_data: TIdC_UINT32): TIdC_INT cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_get_recv_max_early_data(const s: PSSL): TIdC_UINT32 cdecl; external CLibSSL; {introduced 1.1.0} + + ///* + // * These need to be after the above set of includes due to a compiler bug + // * in_ VisualStudio 2015 + // */ + //DEFINE_STACK_OF_CONST(SSL_CIPHER) + //DEFINE_STACK_OF(SSL_COMP) + + ///* compatibility */ + //# define SSL_set_app_data(s,arg) (SSL_set_ex_data(s,0,(PIdAnsiChar *)(arg))) + //# define SSL_get_app_data(s) (SSL_get_ex_data(s,0)) + //# define SSL_SESSION_set_app_data(s,a) (SSL_SESSION_set_ex_data(s,0, \ + // (PIdAnsiChar *)(a))) + //# define SSL_SESSION_get_app_data(s) (SSL_SESSION_get_ex_data(s,0)) + //# define SSL_CTX_get_app_data(ctx) (SSL_CTX_get_ex_data(ctx,0)) + //# define SSL_CTX_set_app_data(ctx,arg) (SSL_CTX_set_ex_data(ctx,0, \ + // (PIdAnsiChar *)(arg))) + + ///* Is the SSL_connection established? */ + //# define SSL_in_connect_init(a) (SSL_in_init(a) && !SSL_is_server(a)) + //# define SSL_in_accept_init(a) (SSL_in_init(a) && SSL_is_server(a)) + function SSL_in_init(const s: PSSL): TIdC_INT cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_in_before(const s: PSSL): TIdC_INT cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_is_init_finished(const s: PSSL): TIdC_INT cdecl; external CLibSSL; {introduced 1.1.0} + + (*- + * Obtain latest Finished message + * -- that we sent (SSL_get_finished) + * -- that we expected from peer (SSL_get_peer_finished). + * Returns length (0 == no Finished so far), copies up to 'count' bytes. + *) + function SSL_get_finished(const s: PSSL; buf: Pointer; count: TIdC_SIZET): TIdC_SIZET cdecl; external CLibSSL; + function SSL_get_peer_finished(const s: PSSL; buf: Pointer; count: TIdC_SIZET): TIdC_SIZET cdecl; external CLibSSL; + + //# if OPENSSL_API_COMPAT < 0x10100000L + //# define OpenSSL_add_ssl_algorithms() SSL_library_init() + //# define SSLeay_add_ssl_algorithms() SSL_library_init() + //# endif + + ///* More backward compatibility */ + //# define SSL_get_cipher(s) \ + // SSL_CIPHER_get_name(SSL_get_current_cipher(s)) + //# define SSL_get_cipher_bits(s,np) \ + // SSL_CIPHER_get_bits(SSL_get_current_cipher(s),np) + //# define SSL_get_cipher_version(s) \ + // SSL_CIPHER_get_version(SSL_get_current_cipher(s)) + //# define SSL_get_cipher_name(s) \ + // SSL_CIPHER_get_name(SSL_get_current_cipher(s)) + //# define SSL_get_time(a) SSL_SESSION_get_time(a) + //# define SSL_set_time(a,b) SSL_SESSION_set_time((a),(b)) + //# define SSL_get_timeout(a) SSL_SESSION_get_timeout(a) + //# define SSL_set_timeout(a,b) SSL_SESSION_set_timeout((a),(b)) + // + //# define d2i_SSL_SESSION_bio(bp,s_id) ASN1_d2i_bio_of(SSL_SESSION,SSL_SESSION_new,d2i_SSL_SESSION,bp,s_id) + //# define i2d_SSL_SESSION_bio(bp,s_id) ASN1_i2d_bio_of(SSL_SESSION,i2d_SSL_SESSION,bp,s_id) + + //DECLARE_PEM_rw(SSL_SESSION, SSL_SESSION) + + //# define DTLSv1_get_timeout(ssl, arg) \ + // SSL_ctrl(ssl,DTLS_CTRL_GET_TIMEOUT,0, (void *)(arg)) + //# define DTLSv1_handle_timeout(ssl) \ + // SSL_ctrl(ssl,DTLS_CTRL_HANDLE_TIMEOUT,0, NULL) + // + ///* Backwards compatibility, original 1.1.0 names */ + //# define SSL_CTRL_GET_SERVER_TMP_KEY \ + // SSL_CTRL_GET_PEER_TMP_KEY + //# define SSL_get_server_tmp_key(s, pk) \ + // SSL_get_peer_tmp_key(s, pk) + + //# if OPENSSL_API_COMPAT < 0x10100000L + //const SSL_CTX_need_tmp_RSA = (ctx) 0; + //const SSL_CTX_set_tmp_rsa = (ctx;rsa) 1; + //const SSL_need_tmp_RSA = (ssl) 0; + //const SSL_set_tmp_rsa = (ssl;rsa) 1; + + //# define SSL_CTX_set_ecdh_auto(dummy, onoff) ((onoff) != 0) + //# define SSL_set_ecdh_auto(dummy, onoff) ((onoff) != 0) + ///* + // * We 'pretend' to call the callback to avoid warnings about unused static + // * functions. + // */ + //# define SSL_CTX_set_tmp_rsa_callback(ctx, cb) while(0) (cb)(NULL, 0, 0) + //# define SSL_set_tmp_rsa_callback(ssl, cb) while(0) (cb)(NULL, 0, 0) + //# endif + // + function BIO_f_ssl: PBIO_METHOD cdecl; external CLibSSL; + function BIO_new_ssl(ctx: PSSL_CTX; client: TIdC_INT): PBIO cdecl; external CLibSSL; + function BIO_new_ssl_connect(ctx: PSSL_CTX): PBIO cdecl; external CLibSSL; + function BIO_new_buffer_ssl_connect(ctx: PSSL_CTX): PBIO cdecl; external CLibSSL; + function BIO_ssl_copy_session_id(to_: PBIO; from: PBIO): TIdC_INT cdecl; external CLibSSL; + + function SSL_CTX_set_cipher_list(v1: PSSL_CTX; const str: PIdAnsiChar): TIdC_INT cdecl; external CLibSSL; + function SSL_CTX_new(const meth: PSSL_METHOD): PSSL_CTX cdecl; external CLibSSL; + function SSL_CTX_set_timeout(ctx: PSSL_CTX; t: TIdC_LONG): TIdC_LONG cdecl; external CLibSSL; + function SSL_CTX_get_timeout(const ctx: PSSL_CTX): TIdC_LONG cdecl; external CLibSSL; + function SSL_CTX_get_cert_store(const v1: PSSL_CTX): PX509_STORE cdecl; external CLibSSL; + function SSL_want(const s: PSSL): TIdC_INT cdecl; external CLibSSL; + function SSL_clear(s: PSSL): TIdC_INT cdecl; external CLibSSL; + + procedure BIO_ssl_shutdown(ssl_bio: PBIO) cdecl; external CLibSSL; + function SSL_CTX_up_ref(ctx: PSSL_CTX): TIdC_INT cdecl; external CLibSSL; {introduced 1.1.0} + procedure SSL_CTX_free(v1: PSSL_CTX) cdecl; external CLibSSL; + procedure SSL_CTX_set_cert_store(v1: PSSL_CTX; v2: PX509_STORE) cdecl; external CLibSSL; + procedure SSL_CTX_set1_cert_store(v1: PSSL_CTX; v2: PX509_STORE) cdecl; external CLibSSL; {introduced 1.1.0} + + procedure SSL_CTX_flush_sessions(ctx: PSSL_CTX; tm: TIdC_LONG) cdecl; external CLibSSL; + + function SSL_get_current_cipher(const s: PSSL): PSSL_CIPHER cdecl; external CLibSSL; + function SSL_get_pending_cipher(const s: PSSL): PSSL_CIPHER cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_CIPHER_get_bits(const c: PSSL_CIPHER; var alg_bits: TIdC_INT): TIdC_INT cdecl; external CLibSSL; + function SSL_CIPHER_get_version(const c: PSSL_CIPHER): PIdAnsiChar cdecl; external CLibSSL; + function SSL_CIPHER_get_name(const c: PSSL_CIPHER): PIdAnsiChar cdecl; external CLibSSL; + function SSL_CIPHER_standard_name(const c: PSSL_CIPHER): PIdAnsiChar cdecl; external CLibSSL; {introduced 1.1.0} + function OPENSSL_cipher_name(const rfc_name: PIdAnsiChar): PIdAnsiChar cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_CIPHER_get_id(const c: PSSL_CIPHER): TIdC_UINT32 cdecl; external CLibSSL; + function SSL_CIPHER_get_protocol_id(const c: PSSL_CIPHER): TIdC_UINT16 cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_CIPHER_get_kx_nid(const c: PSSL_CIPHER): TIdC_INT cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_CIPHER_get_auth_nid(const c: PSSL_CIPHER): TIdC_INT cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_CIPHER_get_handshake_digest(const c: PSSL_CIPHER): PEVP_MD cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_CIPHER_is_aead(const c: PSSL_CIPHER): TIdC_INT cdecl; external CLibSSL; {introduced 1.1.0} + + function SSL_get_fd(const s: PSSL): TIdC_INT cdecl; external CLibSSL; + function SSL_get_rfd(const s: PSSL): TIdC_INT cdecl; external CLibSSL; + function SSL_get_wfd(const s: PSSL): TIdC_INT cdecl; external CLibSSL; + function SSL_get_cipher_list(const s: PSSL; n: TIdC_INT): PIdAnsiChar cdecl; external CLibSSL; + function SSL_get_shared_ciphers(const s: PSSL; buf: PIdAnsiChar; size: TIdC_INT): PIdAnsiChar cdecl; external CLibSSL; + function SSL_get_read_ahead(const s: PSSL): TIdC_INT cdecl; external CLibSSL; + function SSL_pending(const s: PSSL): TIdC_INT cdecl; external CLibSSL; + function SSL_has_pending(const s: PSSL): TIdC_INT cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_set_fd(s: PSSL; fd: TIdC_INT): TIdC_INT cdecl; external CLibSSL; + function SSL_set_rfd(s: PSSL; fd: TIdC_INT): TIdC_INT cdecl; external CLibSSL; + function SSL_set_wfd(s: PSSL; fd: TIdC_INT): TIdC_INT cdecl; external CLibSSL; + procedure SSL_set0_rbio(s: PSSL; rbio: PBIO) cdecl; external CLibSSL; {introduced 1.1.0} + procedure SSL_set0_wbio(s: PSSL; wbio: PBIO) cdecl; external CLibSSL; {introduced 1.1.0} + procedure SSL_set_bio(s: PSSL; rbio: PBIO; wbio: PBIO) cdecl; external CLibSSL; + function SSL_get_rbio(const s: PSSL): PBIO cdecl; external CLibSSL; + function SSL_get_wbio(const s: PSSL): PBIO cdecl; external CLibSSL; + function SSL_set_cipher_list(s: PSSL; const str: PIdAnsiChar): TIdC_INT cdecl; external CLibSSL; + function SSL_CTX_set_ciphersuites(ctx: PSSL_CTX; const str: PIdAnsiChar): TIdC_INT cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_set_ciphersuites(s: PSSL; const str: PIdAnsiChar): TIdC_INT cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_get_verify_mode(const s: PSSL): TIdC_INT cdecl; external CLibSSL; + function SSL_get_verify_depth(const s: PSSL): TIdC_INT cdecl; external CLibSSL; + function SSL_get_verify_callback(const s: PSSL): SSL_verify_cb cdecl; external CLibSSL; + procedure SSL_set_read_ahead(s: PSSL; yes: TIdC_INT) cdecl; external CLibSSL; + procedure SSL_set_verify(s: PSSL; mode: TIdC_INT; callback: SSL_verify_cb) cdecl; external CLibSSL; + procedure SSL_set_verify_depth(s: PSSL; depth: TIdC_INT) cdecl; external CLibSSL; + //void SSL_set_cert_cb(s: PSSL, TIdC_INT (*cb) (ssl: PSSL, void *arg), void *arg); + + function SSL_use_RSAPrivateKey(ssl: PSSL; rsa: PRSA): TIdC_INT cdecl; external CLibSSL; + function SSL_use_RSAPrivateKey_ASN1(ssl: PSSL; const d: PByte; len: TIdC_LONG): TIdC_INT cdecl; external CLibSSL; + function SSL_use_PrivateKey(ssl: PSSL; pkey: PEVP_PKEY): TIdC_INT cdecl; external CLibSSL; + function SSL_use_PrivateKey_ASN1(pk: TIdC_INT; ssl: PSSL; const d: PByte; len: TIdC_LONG): TIdC_INT cdecl; external CLibSSL; + function SSL_use_certificate(ssl: PSSL; x: PX509): TIdC_INT cdecl; external CLibSSL; + function SSL_use_certificate_ASN1(ssl: PSSL; const d: PByte; len: TIdC_INT): TIdC_INT cdecl; external CLibSSL; + //__owur TIdC_INT SSL_use_cert_and_key(ssl: PSSL, x509: PX509, EVP_PKEY *privatekey, + // STACK_OF(X509) *chain, TIdC_INT override); + + (* Set serverinfo data for the current active cert. *) + function SSL_CTX_use_serverinfo(ctx: PSSL_CTX; const serverinfo: PByte; serverinfo_length: TIdC_SIZET): TIdC_INT cdecl; external CLibSSL; + function SSL_CTX_use_serverinfo_ex(ctx: PSSL_CTX; version: TIdC_UINT; const serverinfo: PByte; serverinfo_length: TIdC_SIZET): TIdC_INT cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_CTX_use_serverinfo_file(ctx: PSSL_CTX; const file_: PIdAnsiChar): TIdC_INT cdecl; external CLibSSL; + + function SSL_use_RSAPrivateKey_file(ssl: PSSL; const file_: PIdAnsiChar; type_: TIdC_INT): TIdC_INT cdecl; external CLibSSL; + + function SSL_use_PrivateKey_file(ssl: PSSL; const file_: PIdAnsiChar; type_: TIdC_INT): TIdC_INT cdecl; external CLibSSL; + function SSL_use_certificate_file(ssl: PSSL; const file_: PIdAnsiChar; type_: TIdC_INT): TIdC_INT cdecl; external CLibSSL; + + function SSL_CTX_use_RSAPrivateKey_file(ctx: PSSL_CTX; const file_: PIdAnsiChar; type_: TIdC_INT): TIdC_INT cdecl; external CLibSSL; + + function SSL_CTX_use_PrivateKey_file(ctx: PSSL_CTX; const file_: PIdAnsiChar; type_: TIdC_INT): TIdC_INT cdecl; external CLibSSL; + function SSL_CTX_use_certificate_file(ctx: PSSL_CTX; const file_: PIdAnsiChar; type_: TIdC_INT): TIdC_INT cdecl; external CLibSSL; + (* PEM type *) + function SSL_CTX_use_certificate_chain_file(ctx: PSSL_CTX; const file_: PIdAnsiChar): TIdC_INT cdecl; external CLibSSL; + function SSL_use_certificate_chain_file(ssl: PSSL; const file_: PIdAnsiChar): TIdC_INT cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_load_client_CA_file(const file_: PIdAnsiChar): PSTACK_OF_X509_NAME cdecl; external CLibSSL; + function SSL_add_file_cert_subjects_to_stack(stackCAs: PSTACK_OF_X509_NAME; const file_: PIdAnsiChar):TIdC_INT cdecl; external CLibSSL; + function SSL_add_dir_cert_subjects_to_stack(stackCAs: PSTACK_OF_X509_NAME; const dir_: PIdAnsiChar): TIdC_INT cdecl; external CLibSSL; + + //# if OPENSSL_API_COMPAT < 0x10100000L + //# define SSL_load_error_strings() \ + // OPENSSL_init_ssl(OPENSSL_INIT_LOAD_SSL_STRINGS \ + // | OPENSSL_INIT_LOAD_CRYPTO_STRINGS, NULL) + //# endif + + function SSL_state_string(const s: PSSL): PIdAnsiChar cdecl; external CLibSSL; + function SSL_rstate_string(const s: PSSL): PIdAnsiChar cdecl; external CLibSSL; + function SSL_state_string_long(const s: PSSL): PIdAnsiChar cdecl; external CLibSSL; + function SSL_rstate_string_long(const s: PSSL): PIdAnsiChar cdecl; external CLibSSL; + function SSL_SESSION_get_time(const s: PSSL_SESSION): TIdC_LONG cdecl; external CLibSSL; + function SSL_SESSION_set_time(s: PSSL_SESSION; t: TIdC_LONG): TIdC_LONG cdecl; external CLibSSL; + function SSL_SESSION_get_timeout(const s: PSSL_SESSION): TIdC_LONG cdecl; external CLibSSL; + function SSL_SESSION_set_timeout(s: PSSL_SESSION; t: TIdC_LONG): TIdC_LONG cdecl; external CLibSSL; + function SSL_SESSION_get_protocol_version(const s: PSSL_SESSION): TIdC_INT cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_SESSION_set_protocol_version(s: PSSL_SESSION; version: TIdC_INT): TIdC_INT cdecl; external CLibSSL; {introduced 1.1.0} + + function SSL_SESSION_get0_hostname(const s: PSSL_SESSION): PIdAnsiChar cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_SESSION_set1_hostname(s: PSSL_SESSION; const hostname: PIdAnsiChar): TIdC_INT cdecl; external CLibSSL; {introduced 1.1.0} + procedure SSL_SESSION_get0_alpn_selected(const s: PSSL_SESSION; const alpn: PPByte; len: PIdC_SIZET) cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_SESSION_set1_alpn_selected(s: PSSL_SESSION; const alpn: PByte; len: TIdC_SIZET): TIdC_INT cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_SESSION_get0_cipher(const s: PSSL_SESSION): PSSL_CIPHER cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_SESSION_set_cipher(s: PSSL_SESSION; const cipher: PSSL_CIPHER): TIdC_INT cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_SESSION_has_ticket(const s: PSSL_SESSION): TIdC_INT cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_SESSION_get_ticket_lifetime_hint(const s: PSSL_SESSION): TIdC_ULONG cdecl; external CLibSSL; {introduced 1.1.0} + procedure SSL_SESSION_get0_ticket(const s: PSSL_SESSION; const tick: PPByte; len: PIdC_SIZET) cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_SESSION_get_max_early_data(const s: PSSL_SESSION): TIdC_UINT32 cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_SESSION_set_max_early_data(s: PSSL_SESSION; max_early_data: TIdC_UINT32): TIdC_INT cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_copy_session_id(to_: PSSL; const from: PSSL): TIdC_INT cdecl; external CLibSSL; + function SSL_SESSION_get0_peer(s: PSSL_SESSION): PX509 cdecl; external CLibSSL; + function SSL_SESSION_set1_id_context(s: PSSL_SESSION; const sid_ctx: PByte; sid_ctx_len: TIdC_UINT): TIdC_INT cdecl; external CLibSSL; + function SSL_SESSION_set1_id(s: PSSL_SESSION; const sid: PByte; sid_len: TIdC_UINT): TIdC_INT cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_SESSION_is_resumable(const s: PSSL_SESSION): TIdC_INT cdecl; external CLibSSL; {introduced 1.1.0} + + function SSL_SESSION_new: PSSL_SESSION cdecl; external CLibSSL; + function SSL_SESSION_dup(src: PSSL_SESSION): PSSL_SESSION cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_SESSION_get_id(const s: PSSL_SESSION; len: PIdC_UINT): PByte cdecl; external CLibSSL; + function SSL_SESSION_get0_id_context(const s: PSSL_SESSION; len: PIdC_UINT): PByte cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_SESSION_get_compress_id(const s: PSSL_SESSION): TIdC_UINT cdecl; external CLibSSL; + function SSL_SESSION_print(fp: PBIO; const ses: PSSL_SESSION): TIdC_INT cdecl; external CLibSSL; + function SSL_SESSION_print_keylog(bp: PBIO; const x: PSSL_SESSION): TIdC_INT cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_SESSION_up_ref(ses: PSSL_SESSION): TIdC_INT cdecl; external CLibSSL; {introduced 1.1.0} + procedure SSL_SESSION_free(ses: PSSL_SESSION) cdecl; external CLibSSL; + //__owur TIdC_INT i2d_SSL_SESSION(SSL_SESSION *in_, Byte **pp); + function SSL_set_session(to_: PSSL; session: PSSL_SESSION): TIdC_INT cdecl; external CLibSSL; + function SSL_CTX_add_session(ctx: PSSL_CTX; session: PSSL_SESSION): TIdC_INT cdecl; external CLibSSL; + function SSL_CTX_remove_session(ctx: PSSL_CTX; session: PSSL_SESSION): TIdC_INT cdecl; external CLibSSL; + function SSL_CTX_set_generate_session_id(ctx: PSSL_CTX; cb: GEN_SESSION_CB): TIdC_INT cdecl; external CLibSSL; + function SSL_set_generate_session_id(s: PSSL; cb: GEN_SESSION_CB): TIdC_INT cdecl; external CLibSSL; + function SSL_has_matching_session_id(const s: PSSL; const id: PByte; id_len: TIdC_UINT): TIdC_INT cdecl; external CLibSSL; + function d2i_SSL_SESSION(a: PPSSL_SESSION; const pp: PPByte; length: TIdC_LONG): PSSL_SESSION cdecl; external CLibSSL; + + + //__owur STACK_OF(X509) *SSL_get_peer_cert_chain(const s: PSSL); + // + function SSL_CTX_get_verify_mode(const ctx: PSSL_CTX): TIdC_INT cdecl; external CLibSSL; + function SSL_CTX_get_verify_depth(const ctx: PSSL_CTX): TIdC_INT cdecl; external CLibSSL; + function SSL_CTX_get_verify_callback(const ctx: PSSL_CTX): SSL_verify_cb cdecl; external CLibSSL; + procedure SSL_CTX_set_verify(ctx: PSSL_CTX; mode: TIdC_INT; callback: SSL_verify_cb) cdecl; external CLibSSL; + procedure SSL_CTX_set_verify_depth(ctx: PSSL_CTX; depth: TIdC_INT) cdecl; external CLibSSL; + procedure SSL_CTX_set_cert_verify_callback(ctx: PSSL_CTX; cb: SSL_CTX_set_cert_verify_callback_cb; arg: Pointer) cdecl; external CLibSSL; + procedure SSL_CTX_set_cert_cb(c: PSSL_CTX; cb: SSL_CTX_set_cert_cb_cb; arg: Pointer) cdecl; external CLibSSL; + function SSL_CTX_use_RSAPrivateKey(ctx: PSSL_CTX; rsa: PRSA): TIdC_INT cdecl; external CLibSSL; + function SSL_CTX_use_RSAPrivateKey_ASN1(ctx: PSSL_CTX; const d: PByte; len: TIdC_LONG): TIdC_INT cdecl; external CLibSSL; + function SSL_CTX_use_PrivateKey(ctx: PSSL_CTX; pkey: PEVP_PKEY): TIdC_INT cdecl; external CLibSSL; + function SSL_CTX_use_PrivateKey_ASN1(pk: TIdC_INT; ctx: PSSL_CTX; const d: PByte; len: TIdC_LONG): TIdC_INT cdecl; external CLibSSL; + function SSL_CTX_use_certificate(ctx: PSSL_CTX; x: X509): TIdC_INT cdecl; external CLibSSL; + function SSL_CTX_use_certificate_ASN1(ctx: PSSL_CTX; len: TIdC_INT; const d: PByte): TIdC_INT cdecl; external CLibSSL; + //function TIdC_INT SSL_CTX_use_cert_and_key(ctx: PSSL_CTX; x509: PX509; EVP_PKEY *privatekey; STACK_OF(X509) *chain; TIdC_INT override); + + procedure SSL_CTX_set_default_passwd_cb(ctx: PSSL_CTX; cb: pem_password_cb) cdecl; external CLibSSL; {introduced 1.1.0} + procedure SSL_CTX_set_default_passwd_cb_userdata(ctx: PSSL_CTX; u: Pointer) cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_CTX_get_default_passwd_cb(ctx: PSSL_CTX): pem_password_cb cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_CTX_get_default_passwd_cb_userdata(ctx: PSSL_CTX): Pointer cdecl; external CLibSSL; {introduced 1.1.0} + procedure SSL_set_default_passwd_cb(s: PSSL; cb: pem_password_cb) cdecl; external CLibSSL; {introduced 1.1.0} + procedure SSL_set_default_passwd_cb_userdata(s: PSSL; u: Pointer) cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_get_default_passwd_cb(s: PSSL): pem_password_cb cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_get_default_passwd_cb_userdata(s: PSSL): Pointer cdecl; external CLibSSL; {introduced 1.1.0} + + function SSL_CTX_check_private_key(const ctx: PSSL_CTX): TIdC_INT cdecl; external CLibSSL; + function SSL_check_private_key(const ctx: PSSL): TIdC_INT cdecl; external CLibSSL; + + function SSL_CTX_set_session_id_context(ctx: PSSL_CTX; const sid_ctx: PByte; sid_ctx_len: TIdC_UINT): TIdC_INT cdecl; external CLibSSL; + + function SSL_new(ctx: PSSL_CTX): PSSL cdecl; external CLibSSL; + function SSL_up_ref(s: PSSL): TIdC_INT cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_is_dtls(const s: PSSL): TIdC_INT cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_set_session_id_context(ssl: PSSL; const sid_ctx: PByte; sid_ctx_len: TIdC_UINT): TIdC_INT cdecl; external CLibSSL; + + function SSL_CTX_set_purpose(ctx: PSSL_CTX; purpose: TIdC_INT): TIdC_INT cdecl; external CLibSSL; + function SSL_set_purpose(ssl: PSSL; purpose: TIdC_INT): TIdC_INT cdecl; external CLibSSL; + function SSL_CTX_set_trust(ctx: PSSL_CTX; trust: TIdC_INT): TIdC_INT cdecl; external CLibSSL; + function SSL_set_trust(ssl: PSSL; trust: TIdC_INT): TIdC_INT cdecl; external CLibSSL; + + function SSL_set1_host(s: PSSL; const hostname: PIdAnsiChar): TIdC_INT cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_add1_host(s: PSSL; const hostname: PIdAnsiChar): TIdC_INT cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_get0_peername(s: PSSL): PIdAnsiChar cdecl; external CLibSSL; {introduced 1.1.0} + procedure SSL_set_hostflags(s: PSSL; flags: TIdC_UINT) cdecl; external CLibSSL; {introduced 1.1.0} + + function SSL_CTX_dane_enable(ctx: PSSL_CTX): TIdC_INT cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_CTX_dane_mtype_set(ctx: PSSL_CTX; const md: PEVP_MD; mtype: TIdC_UINT8; ord: TIdC_UINT8): TIdC_INT cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_dane_enable(s: PSSL; const basedomain: PIdAnsiChar): TIdC_INT cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_dane_tlsa_add(s: PSSL; usage: TIdC_UINT8; selector: TIdC_UINT8; mtype: TIdC_UINT8; const data: PByte; dlen: TIdC_SIZET): TIdC_INT cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_get0_dane_authority(s: PSSL; mcert: PPX509; mspki: PPEVP_PKEY): TIdC_INT cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_get0_dane_tlsa(s: PSSL; usage: PIdC_UINT8; selector: PIdC_UINT8; mtype: PIdC_UINT8; const data: PPByte; dlen: PIdC_SIZET): TIdC_INT cdecl; external CLibSSL; {introduced 1.1.0} + (* + * Bridge opacity barrier between libcrypt and libssl, also needed to support + * offline testing in test/danetest.c + *) + function SSL_get0_dane(ssl: PSSL): PSSL_DANE cdecl; external CLibSSL; {introduced 1.1.0} + + (* + * DANE flags + *) + function SSL_CTX_dane_set_flags(ctx: PSSL_CTX; flags: TIdC_ULONG): TIdC_ULONG cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_CTX_dane_clear_flags(ctx: PSSL_CTX; flags: TIdC_ULONG): TIdC_ULONG cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_dane_set_flags(ssl: PSSL; flags: TIdC_ULONG): TIdC_ULONG cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_dane_clear_flags(ssl: PSSL; flags: TIdC_ULONG): TIdC_ULONG cdecl; external CLibSSL; {introduced 1.1.0} + + function SSL_CTX_set1_param(ctx: PSSL_CTX; vpm: PX509_VERIFY_PARAM): TIdC_INT cdecl; external CLibSSL; + function SSL_set1_param(ssl: PSSL; vpm: PX509_VERIFY_PARAM): TIdC_INT cdecl; external CLibSSL; + + function SSL_CTX_get0_param(ctx: PSSL_CTX): PX509_VERIFY_PARAM cdecl; external CLibSSL; + function SSL_get0_param(ssl: PSSL): PX509_VERIFY_PARAM cdecl; external CLibSSL; + + function SSL_CTX_set_srp_username(ctx: PSSL_CTX; name: PIdAnsiChar): TIdC_INT cdecl; external CLibSSL; + function SSL_CTX_set_srp_password(ctx: PSSL_CTX; password: PIdAnsiChar): TIdC_INT cdecl; external CLibSSL; + function SSL_CTX_set_srp_strength(ctx: PSSL_CTX; strength: TIdC_INT): TIdC_INT cdecl; external CLibSSL; + + function SSL_CTX_set_srp_client_pwd_callback(ctx: PSSL_CTX; cb: SSL_CTX_set_srp_client_pwd_callback_cb): TIdC_INT cdecl; external CLibSSL; + function SSL_CTX_set_srp_verify_param_callback(ctx: PSSL_CTX; cb: SSL_CTX_set_srp_verify_param_callback_cb): TIdC_INT cdecl; external CLibSSL; + function SSL_CTX_set_srp_username_callback(ctx: PSSL_CTX; cb: SSL_CTX_set_srp_username_callback_cb): TIdC_INT cdecl; external CLibSSL; + + function SSL_CTX_set_srp_cb_arg(ctx: PSSL_CTX; arg: Pointer): TIdC_INT cdecl; external CLibSSL; + function SSL_set_srp_server_param(s: PSSL; const N: PBIGNUm; const g: PBIGNUm; sa: PBIGNUm; v: PBIGNUm; info: PIdAnsiChar): TIdC_INT cdecl; external CLibSSL; + function SSL_set_srp_server_param_pw(s: PSSL; const user: PIdAnsiChar; const pass: PIdAnsiChar; const grp: PIdAnsiChar): TIdC_INT cdecl; external CLibSSL; + + //__owur BIGNUM *SSL_get_srp_g(s: PSSL); + //__owur BIGNUM *SSL_get_srp_N(s: PSSL); + // + //__owur PIdAnsiChar *SSL_get_srp_username(s: PSSL); + //__owur PIdAnsiChar *SSL_get_srp_userinfo(s: PSSL); + // + ///* + // * ClientHello callback and helpers. + // */ + procedure SSL_CTX_set_client_hello_cb(c: PSSL_CTX; cb: SSL_client_hello_cb_fn; arg: Pointer) cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_client_hello_isv2(s: PSSL): TIdC_INT cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_client_hello_get0_legacy_version(s: PSSL): TIdC_UINT cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_client_hello_get0_random(s: PSSL; const out_: PPByte): TIdC_SIZET cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_client_hello_get0_session_id(s: PSSL; const out_: PPByte): TIdC_SIZET cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_client_hello_get0_ciphers(s: PSSL; const out_: PPByte): TIdC_SIZET cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_client_hello_get0_compression_methods(s: PSSL; const out_: PPByte): TIdC_SIZET cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_client_hello_get1_extensions_present(s: PSSL; out_: PPIdC_INT; outlen: PIdC_SIZET): TIdC_INT cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_client_hello_get0_ext(s: PSSL; type_: TIdC_UINT; const out_: PPByte; outlen: PIdC_SIZET): TIdC_INT cdecl; external CLibSSL; {introduced 1.1.0} + procedure SSL_certs_clear(s: PSSL) cdecl; external CLibSSL; + procedure SSL_free(ssl: PSSL) cdecl; external CLibSSL; + + (* + * Windows application developer has to include windows.h to use these. + *) + function SSL_waiting_for_async(s: PSSL): TIdC_INT cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_get_all_async_fds(s: PSSL; fds: POSSL_ASYNC_FD; numfds: PIdC_SIZET): TIdC_INT cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_get_changed_async_fds(s: PSSL; addfd: POSSL_ASYNC_FD; numaddfds: PIdC_SIZET; delfd: POSSL_ASYNC_FD; numdelfds: PIdC_SIZET): TIdC_INT cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_accept(ssl: PSSL): TIdC_INT cdecl; external CLibSSL; + function SSL_stateless(s: PSSL): TIdC_INT cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_connect(ssl: PSSL): TIdC_INT cdecl; external CLibSSL; + function SSL_read(ssl: PSSL; buf: Pointer; num: TIdC_INT): TIdC_INT cdecl; external CLibSSL; + function SSL_read_ex(ssl: PSSL; buf: Pointer; num: TIdC_SIZET; readbytes: PIdC_SIZET): TIdC_INT cdecl; external CLibSSL; {introduced 1.1.0} + + function SSL_read_early_data(s: PSSL; buf: Pointer; num: TIdC_SIZET; readbytes: PIdC_SIZET): TIdC_INT cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_peek(ssl: PSSL; buf: Pointer; num: TIdC_INT): TIdC_INT cdecl; external CLibSSL; + function SSL_peek_ex(ssl: PSSL; buf: Pointer; num: TIdC_SIZET; readbytes: PIdC_SIZET): TIdC_INT cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_write(ssl: PSSL; const buf: Pointer; num: TIdC_INT): TIdC_INT cdecl; external CLibSSL; + function SSL_write_ex(s: PSSL; const buf: Pointer; num: TIdC_SIZET; written: PIdC_SIZET): TIdC_INT cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_write_early_data(s: PSSL; const buf: Pointer; num: TIdC_SIZET; written: PIdC_SIZET): TIdC_INT cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_callback_ctrl(v1: PSSL; v2: TIdC_INT; v3: SSL_callback_ctrl_v3): TIdC_LONG cdecl; external CLibSSL; + + function SSL_ctrl(ssl: PSSL; cmd: TIdC_INT; larg: TIdC_LONG; parg: Pointer): TIdC_LONG cdecl; external CLibSSL; + function SSL_CTX_ctrl(ctx: PSSL_CTX; cmd: TIdC_INT; larg: TIdC_LONG; parg: Pointer): TIdC_LONG cdecl; external CLibSSL; + function SSL_CTX_callback_ctrl(v1: PSSL_CTX; v2: TIdC_INT; v3: SSL_CTX_callback_ctrl_v3): TIdC_LONG cdecl; external CLibSSL; + + function SSL_get_early_data_status(const s: PSSL): TIdC_INT cdecl; external CLibSSL; {introduced 1.1.0} + + function SSL_get_error(const s: PSSL; ret_code: TIdC_INT): TIdC_INT cdecl; external CLibSSL; + function SSL_get_version(const s: PSSL): PIdAnsiChar cdecl; external CLibSSL; + + (* This sets the 'default' SSL version that SSL_new() will create *) + function SSL_CTX_set_ssl_version(ctx: PSSL_CTX; const meth: PSSL_METHOD): TIdC_INT cdecl; external CLibSSL; + + ///* Negotiate highest available SSL/TLS version */ + function TLS_method: PSSL_METHOD cdecl; external CLibSSL; {introduced 1.1.0} + function TLS_server_method: PSSL_METHOD cdecl; external CLibSSL; {introduced 1.1.0} + function TLS_client_method: PSSL_METHOD cdecl; external CLibSSL; {introduced 1.1.0} + + //__owur const SSL_METHOD *DTLS_method(void); /* DTLS 1.0 and 1.2 */ + //__owur const SSL_METHOD *DTLS_server_method(void); /* DTLS 1.0 and 1.2 */ + //__owur const SSL_METHOD *DTLS_client_method(void); /* DTLS 1.0 and 1.2 */ + // + //__owur TIdC_SIZET DTLS_get_data_mtu(const s: PSSL); + // + //__owur STACK_OF(SSL_CIPHER) *SSL_get_ciphers(const s: PSSL); + //__owur STACK_OF(SSL_CIPHER) *SSL_CTX_get_ciphers(const ctx: PSSL_CTX); + //__owur STACK_OF(SSL_CIPHER) *SSL_get_client_ciphers(const s: PSSL); + //__owur STACK_OF(SSL_CIPHER) *SSL_get1_supported_ciphers(s: PSSL); + // + //__owur TIdC_INT SSL_do_handshake(s: PSSL); + function SSL_key_update(s: PSSL; updatetype: TIdC_INT): TIdC_INT cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_get_key_update_type(const s: PSSL): TIdC_INT cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_renegotiate(s: PSSL): TIdC_INT cdecl; external CLibSSL; + function SSL_renegotiate_abbreviated(s: PSSL): TIdC_INT cdecl; external CLibSSL; + function SSL_shutdown(s: PSSL): TIdC_INT cdecl; external CLibSSL; + procedure SSL_CTX_set_post_handshake_auth(ctx: PSSL_CTX; val: TIdC_INT) cdecl; external CLibSSL; {introduced 1.1.0} + procedure SSL_set_post_handshake_auth(s: PSSL; val: TIdC_INT) cdecl; external CLibSSL; {introduced 1.1.0} + + function SSL_renegotiate_pending(const s: PSSL): TIdC_INT cdecl; external CLibSSL; + function SSL_verify_client_post_handshake(s: PSSL): TIdC_INT cdecl; external CLibSSL; {introduced 1.1.0} + + function SSL_CTX_get_ssl_method(const ctx: PSSL_CTX): PSSL_METHOD cdecl; external CLibSSL; + function SSL_get_ssl_method(const s: PSSL): PSSL_METHOD cdecl; external CLibSSL; + function SSL_set_ssl_method(s: PSSL; const method: PSSL_METHOD): TIdC_INT cdecl; external CLibSSL; + function SSL_alert_type_string_long(value: TIdC_INT): PIdAnsiChar cdecl; external CLibSSL; + function SSL_alert_type_string(value: TIdC_INT): PIdAnsiChar cdecl; external CLibSSL; + function SSL_alert_desc_string_long(value: TIdC_INT): PIdAnsiChar cdecl; external CLibSSL; + function SSL_alert_desc_string(value: TIdC_INT): PIdAnsiChar cdecl; external CLibSSL; + + //void SSL_set0_CA_list(s: PSSL, STACK_OF(X509_NAME) *name_list); + //void SSL_CTX_set0_CA_list(ctx: PSSL_CTX, STACK_OF(X509_NAME) *name_list); + //__owur const STACK_OF(X509_NAME) *SSL_get0_CA_list(const s: PSSL); + //__owur const STACK_OF(X509_NAME) *SSL_CTX_get0_CA_list(const ctx: PSSL_CTX); + //__owur TIdC_INT SSL_add1_to_CA_list(ssl: PSSL, const X509 *x); + //__owur TIdC_INT SSL_CTX_add1_to_CA_list(ctx: PSSL_CTX, const X509 *x); + //__owur const STACK_OF(X509_NAME) *SSL_get0_peer_CA_list(const s: PSSL); + + //void SSL_set_client_CA_list(s: PSSL, STACK_OF(X509_NAME) *name_list); + //void SSL_CTX_set_client_CA_list(ctx: PSSL_CTX, STACK_OF(X509_NAME) *name_list); + //__owur STACK_OF(X509_NAME) *SSL_get_client_CA_list(const s: PSSL); + //__owur STACK_OF(X509_NAME) *SSL_CTX_get_client_CA_list(const SSL_CTX *s); + + procedure SSL_CTX_set_client_CA_list(ctx: PSSL_CTX; name_list: PSTACK_OF_X509_NAME) cdecl; external CLibSSL; + function SSL_add_client_CA(ssl: PSSL; x: PX509): TIdC_INT cdecl; external CLibSSL; + function SSL_CTX_add_client_CA(ctx: PSSL_CTX; x: PX509): TIdC_INT cdecl; external CLibSSL; + + procedure SSL_set_connect_state(s: PSSL) cdecl; external CLibSSL; + procedure SSL_set_accept_state(s: PSSL) cdecl; external CLibSSL; + + //__owur TIdC_LONG SSL_get_default_timeout(const s: PSSL); + // + //# if OPENSSL_API_COMPAT < 0x10100000L + //# define SSL_library_init() OPENSSL_init_ssl(0, NULL) + //# endif + + //__owur PIdAnsiChar *SSL_CIPHER_description(const SSL_CIPHER *, PIdAnsiChar *buf, TIdC_INT size); + //__owur STACK_OF(X509_NAME) *SSL_dup_CA_list(const STACK_OF(X509_NAME) *sk); + function SSL_CIPHER_description(cipher: PSSL_CIPHER; buf: PIdAnsiChar; size_ :TIdC_INT): PIdAnsiChar cdecl; external CLibSSL; + + function SSL_dup(ssl: PSSL): PSSL cdecl; external CLibSSL; + + function SSL_get_certificate(const ssl: PSSL): PX509 cdecl; external CLibSSL; + (* + * EVP_PKEY + *) + function SSL_get_privatekey(const ssl: PSSL): PEVP_PKEY cdecl; external CLibSSL; + + function SSL_CTX_get0_certificate(const ctx: PSSL_CTX): PX509 cdecl; external CLibSSL; + function SSL_CTX_get0_privatekey(const ctx: PSSL_CTX): PEVP_PKEY cdecl; external CLibSSL; + + procedure SSL_CTX_set_quiet_shutdown(ctx: PSSL_CTX; mode: TIdC_INT) cdecl; external CLibSSL; + function SSL_CTX_get_quiet_shutdown(const ctx: PSSL_CTX): TIdC_INT cdecl; external CLibSSL; + procedure SSL_set_quiet_shutdown(ssl: PSSL; mode: TIdC_INT) cdecl; external CLibSSL; + function SSL_get_quiet_shutdown(const ssl: PSSL): TIdC_INT cdecl; external CLibSSL; + procedure SSL_set_shutdown(ssl: PSSL; mode: TIdC_INT) cdecl; external CLibSSL; + function SSL_get_shutdown(const ssl: PSSL): TIdC_INT cdecl; external CLibSSL; + function SSL_version(const ssl: PSSL): TIdC_INT cdecl; external CLibSSL; + function SSL_client_version(const s: PSSL): TIdC_INT cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_CTX_set_default_verify_paths(ctx: PSSL_CTX): TIdC_INT cdecl; external CLibSSL; + function SSL_CTX_set_default_verify_dir(ctx: PSSL_CTX): TIdC_INT cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_CTX_set_default_verify_file(ctx: PSSL_CTX): TIdC_INT cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_CTX_load_verify_locations(ctx: PSSL_CTX; const CAfile: PIdAnsiChar; const CApath: PIdAnsiChar): TIdC_INT cdecl; external CLibSSL; + //# define SSL_get0_session SSL_get_session/* just peek at pointer */ + function SSL_get_session(const ssl: PSSL): PSSL_SESSION cdecl; external CLibSSL; + (* obtain a reference count *) + function SSL_get1_session(ssl: PSSL): PSSL_SESSION cdecl; external CLibSSL; + function SSL_get_SSL_CTX(const ssl: PSSL): PSSL_CTX cdecl; external CLibSSL; + function SSL_set_SSL_CTX(ssl: PSSL; ctx: PSSL_CTX): PSSL_CTX cdecl; external CLibSSL; + procedure SSL_set_info_callback(ssl: PSSL; cb: SSL_info_callback) cdecl; external CLibSSL; + function SSL_get_info_callback(const ssl: PSSL): SSL_info_callback cdecl; external CLibSSL; + function SSL_get_state(const ssl: PSSL): OSSL_HANDSHAKE_STATE cdecl; external CLibSSL; {introduced 1.1.0} + + procedure SSL_set_verify_result(ssl: PSSL; v: TIdC_LONG) cdecl; external CLibSSL; + function SSL_get_verify_result(const ssl: PSSL): TIdC_LONG cdecl; external CLibSSL; + //__owur STACK_OF(X509) *SSL_get0_verified_chain(const s: PSSL); + + function SSL_get_client_random(const ssl: PSSL; out_: PByte; outlen: TIdC_SIZET): TIdC_SIZET cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_get_server_random(const ssl: PSSL; out_: PByte; outlen: TIdC_SIZET): TIdC_SIZET cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_SESSION_get_master_key(const sess: PSSL_SESSION; out_: PByte; outlen: TIdC_SIZET): TIdC_SIZET cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_SESSION_set1_master_key(sess: PSSL_SESSION; const in_: PByte; len: TIdC_SIZET): TIdC_INT cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_SESSION_get_max_fragment_length(const sess: PSSL_SESSION): TIdC_UINT8 cdecl; external CLibSSL; {introduced 1.1.0} + + //#define SSL_get_ex_new_index(l, p, newf, dupf, freef) \ + // CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_SSL, l, p, newf, dupf, freef) + function SSL_set_ex_data(ssl: PSSL; idx: TIdC_INT; data: Pointer): TIdC_INT cdecl; external CLibSSL; + function SSL_get_ex_data(const ssl: PSSL; idx: TIdC_INT): Pointer cdecl; external CLibSSL; + //#define SSL_SESSION_get_ex_new_index(l, p, newf, dupf, freef) \ + // CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_SSL_SESSION, l, p, newf, dupf, freef) + function SSL_SESSION_set_ex_data(ss: PSSL_SESSION; idx: TIdC_INT; data: Pointer): TIdC_INT cdecl; external CLibSSL; + function SSL_SESSION_get_ex_data(const ss: PSSL_SESSION; idx: TIdC_INT): Pointer cdecl; external CLibSSL; + //#define SSL_CTX_get_ex_new_index(l, p, newf, dupf, freef) \ + // CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_SSL_CTX, l, p, newf, dupf, freef) + function SSL_CTX_set_ex_data(ssl: PSSL_CTX; idx: TIdC_INT; data: Pointer): TIdC_INT cdecl; external CLibSSL; + function SSL_CTX_get_ex_data(const ssl: PSSL_CTX; idx: TIdC_INT): Pointer cdecl; external CLibSSL; + + function SSL_get_ex_data_X509_STORE_CTX_idx: TIdC_INT cdecl; external CLibSSL; + + //# define SSL_CTX_get_default_read_ahead(ctx) SSL_CTX_get_read_ahead(ctx) + //# define SSL_CTX_set_default_read_ahead(ctx,m) SSL_CTX_set_read_ahead(ctx,m) + //# define SSL_CTX_get_read_ahead(ctx) \ + // SSL_CTX_ctrl(ctx,SSL_CTRL_GET_READ_AHEAD,0,NULL) + //# define SSL_CTX_set_read_ahead(ctx,m) \ + // SSL_CTX_ctrl(ctx,SSL_CTRL_SET_READ_AHEAD,m,NULL) + //# define SSL_CTX_get_max_cert_list(ctx) \ + // SSL_CTX_ctrl(ctx,SSL_CTRL_GET_MAX_CERT_LIST,0,NULL) + //# define SSL_CTX_set_max_cert_list(ctx,m) \ + // SSL_CTX_ctrl(ctx,SSL_CTRL_SET_MAX_CERT_LIST,m,NULL) + //# define SSL_get_max_cert_list(ssl) \ + // SSL_ctrl(ssl,SSL_CTRL_GET_MAX_CERT_LIST,0,NULL) + //# define SSL_set_max_cert_list(ssl,m) \ + // SSL_ctrl(ssl,SSL_CTRL_SET_MAX_CERT_LIST,m,NULL) + // + //# define SSL_CTX_set_max_send_fragment(ctx,m) \ + // SSL_CTX_ctrl(ctx,SSL_CTRL_SET_MAX_SEND_FRAGMENT,m,NULL) + //# define SSL_set_max_send_fragment(ssl,m) \ + // SSL_ctrl(ssl,SSL_CTRL_SET_MAX_SEND_FRAGMENT,m,NULL) + //# define SSL_CTX_set_split_send_fragment(ctx,m) \ + // SSL_CTX_ctrl(ctx,SSL_CTRL_SET_SPLIT_SEND_FRAGMENT,m,NULL) + //# define SSL_set_split_send_fragment(ssl,m) \ + // SSL_ctrl(ssl,SSL_CTRL_SET_SPLIT_SEND_FRAGMENT,m,NULL) + //# define SSL_CTX_set_max_pipelines(ctx,m) \ + // SSL_CTX_ctrl(ctx,SSL_CTRL_SET_MAX_PIPELINES,m,NULL) + //# define SSL_set_max_pipelines(ssl,m) \ + // SSL_ctrl(ssl,SSL_CTRL_SET_MAX_PIPELINES,m,NULL) + + procedure SSL_CTX_set_default_read_buffer_len(ctx: PSSL_CTX; len: TIdC_SIZET) cdecl; external CLibSSL; {introduced 1.1.0} + procedure SSL_set_default_read_buffer_len(s: PSSL; len: TIdC_SIZET) cdecl; external CLibSSL; {introduced 1.1.0} + + procedure SSL_CTX_set_tmp_dh_callback(ctx: PSSL_CTX; dh: SSL_CTX_set_tmp_dh_callback_dh) cdecl; external CLibSSL; + procedure SSL_set_tmp_dh_callback(ssl: PSSL; dh: SSL_set_tmp_dh_callback_dh) cdecl; external CLibSSL; + + //__owur const COMP_METHOD *SSL_get_current_compression(const s: PSSL); + //__owur const COMP_METHOD *SSL_get_current_expansion(const s: PSSL); + //__owur const PIdAnsiChar *SSL_COMP_get_name(const COMP_METHOD *comp); + //__owur const PIdAnsiChar *SSL_COMP_get0_name(const SSL_COMP *comp); + //__owur TIdC_INT SSL_COMP_get_id(const SSL_COMP *comp); + //STACK_OF(SSL_COMP) *SSL_COMP_get_compression_methods(void); + //__owur STACK_OF(SSL_COMP) *SSL_COMP_set0_compression_methods(STACK_OF(SSL_COMP) + // *meths); + //# if OPENSSL_API_COMPAT < 0x10100000L + //# define SSL_COMP_free_compression_methods() while(0) continue + //# endif + //__owur TIdC_INT SSL_COMP_add_compression_method(TIdC_INT id, COMP_METHOD *cm); + + function SSL_CIPHER_find(ssl: PSSL; const ptr: PByte): PSSL_CIPHER cdecl; external CLibSSL; + function SSL_CIPHER_get_cipher_nid(const c: PSSL_CIPHEr): TIdC_INT cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_CIPHER_get_digest_nid(const c: PSSL_CIPHEr): TIdC_INT cdecl; external CLibSSL; {introduced 1.1.0} + //TIdC_INT SSL_bytes_to_cipher_list(s: PSSL, const Byte *bytes, TIdC_SIZET len, + // TIdC_INT isv2format, STACK_OF(SSL_CIPHER) **sk, + // STACK_OF(SSL_CIPHER) **scsvs); + + (* TLS extensions functions *) + function SSL_set_session_ticket_ext(s: PSSL; ext_data: Pointer; ext_len: TIdC_INT): TIdC_INT cdecl; external CLibSSL; + // + function SSL_set_session_ticket_ext_cb(s: PSSL; cb: tls_session_ticket_ext_cb_fn; arg: Pointer): TIdC_INT cdecl; external CLibSSL; + + ///* Pre-shared secret session resumption functions */ + //__owur TIdC_INT SSL_set_session_secret_cb(s: PSSL, + // tls_session_secret_cb_fn session_secret_cb, + // void *arg); + + procedure SSL_CTX_set_not_resumable_session_callback(ctx: PSSL_CTX; cb: SSL_CTX_set_not_resumable_session_callback_cb) cdecl; external CLibSSL; {introduced 1.1.0} + procedure SSL_set_not_resumable_session_callback(ssl: PSSL; cb: SSL_set_not_resumable_session_callback_cb) cdecl; external CLibSSL; {introduced 1.1.0} + procedure SSL_CTX_set_record_padding_callback(ctx: PSSL_CTX; cb: SSL_CTX_set_record_padding_callback_cb) cdecl; external CLibSSL; {introduced 1.1.0} + + procedure SSL_CTX_set_record_padding_callback_arg(ctx: PSSL_CTX; arg: Pointer) cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_CTX_get_record_padding_callback_arg(const ctx: PSSL_CTX): Pointer cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_CTX_set_block_padding(ctx: PSSL_CTX; block_size: TIdC_SIZET): TIdC_INT cdecl; external CLibSSL; {introduced 1.1.0} + + procedure SSL_set_record_padding_callback(ssl: PSSL; cb: SSL_set_record_padding_callback_cb) cdecl; external CLibSSL; {introduced 1.1.0} + + procedure SSL_set_record_padding_callback_arg(ssl: PSSL; arg: Pointer) cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_get_record_padding_callback_arg(const ssl: PSSL): Pointer cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_set_block_padding(ssl: PSSL; block_size: TIdC_SIZET): TIdC_INT cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_set_num_tickets(s: PSSL; num_tickets: TIdC_SIZET): TIdC_INT cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_get_num_tickets(const s: PSSL): TIdC_SIZET cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_CTX_set_num_tickets(ctx: PSSL_CTX; num_tickets: TIdC_SIZET): TIdC_INT cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_CTX_get_num_tickets(const ctx: PSSL_CTX): TIdC_SIZET cdecl; external CLibSSL; {introduced 1.1.0} + + //# if OPENSSL_API_COMPAT < 0x10100000L + //# define SSL_cache_hit(s) SSL_session_reused(s) + //# endif + + function SSL_session_reused(const s: PSSL): TIdC_INT cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_is_server(const s: PSSL): TIdC_INT cdecl; external CLibSSL; + + function SSL_CONF_CTX_new: PSSL_CONF_CTX cdecl; external CLibSSL; + function SSL_CONF_CTX_finish(cctx: PSSL_CONF_CTX): TIdC_INT cdecl; external CLibSSL; + procedure SSL_CONF_CTX_free(cctx: PSSL_CONF_CTX) cdecl; external CLibSSL; + function SSL_CONF_CTX_set_flags(cctx: PSSL_CONF_CTX; flags: TIdC_UINT): TIdC_UINT cdecl; external CLibSSL; + function SSL_CONF_CTX_clear_flags(cctx: PSSL_CONF_CTX; flags: TIdC_UINT): TIdC_UINT cdecl; external CLibSSL; + function SSL_CONF_CTX_set1_prefix(cctx: PSSL_CONF_CTX; const pre: PIdAnsiChar): TIdC_INT cdecl; external CLibSSL; + function SSL_CONF_cmd(cctx: PSSL_CONF_CTX; const cmd: PIdAnsiChar; const value: PIdAnsiChar): TIdC_INT cdecl; external CLibSSL; + function SSL_CONF_cmd_argv(cctx: PSSL_CONF_CTX; pargc: PIdC_INT; pargv: PPPIdAnsiChar): TIdC_INT cdecl; external CLibSSL; + function SSL_CONF_cmd_value_type(cctx: PSSL_CONF_CTX; const cmd: PIdAnsiChar): TIdC_INT cdecl; external CLibSSL; + + procedure SSL_CONF_CTX_set_ssl(cctx: PSSL_CONF_CTX; ssl: PSSL) cdecl; external CLibSSL; + procedure SSL_CONF_CTX_set_ssl_ctx(cctx: PSSL_CONF_CTX; ctx: PSSL_CTX) cdecl; external CLibSSL; + procedure SSL_add_ssl_module cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_config(s: PSSL; const name: PIdAnsiChar): TIdC_INT cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_CTX_config(ctx: PSSL_CTX; const name: PIdAnsiChar): TIdC_INT cdecl; external CLibSSL; {introduced 1.1.0} + +// procedure SSL_trace(write_p: TIdC_INT; version: TIdC_INT; content_type: TIdC_INT; const buf: Pointer; len: TIdC_SIZET; ssl: PSSL; arg: Pointer); + + function DTLSv1_listen(s: PSSL; client: PBIO_ADDr): TIdC_INT cdecl; external CLibSSL; {introduced 1.1.0} + + //# ifndef OPENSSL_NO_CT + // + ///* + // * A callback for verifying that the received SCTs are sufficient. + // * Expected to return 1 if they are sufficient, otherwise 0. + // * May return a negative integer if an error occurs. + // * A connection should be aborted if the SCTs are deemed insufficient. + // */ + //typedef TIdC_INT (*ssl_ct_validation_cb)(const CT_POLICY_EVAL_CTX *ctx, + // const STACK_OF(SCT) *scts, void *arg); + + ///* + // * Sets a |callback| that is invoked upon receipt of ServerHelloDone to validate + // * the received SCTs. + // * If the callback returns a non-positive result, the connection is terminated. + // * Call this function before beginning a handshake. + // * If a NULL |callback| is provided, SCT validation is disabled. + // * |arg| is arbitrary userdata that will be passed to the callback whenever it + // * is invoked. Ownership of |arg| remains with the caller. + // * + // * NOTE: A side-effect of setting a CT callback is that an OCSP stapled response + // * will be requested. + // */ + //function SSL_set_ct_validation_callback(s: PSSL; callback: ssl_ct_validation_cb; arg: Pointer): TIdC_INT; + //function SSL_CTX_set_ct_validation_callback(ctx: PSSL_CTX; callback: ssl_ct_validation_cb; arg: Pointer): TIdC_INT; + + //#define SSL_disable_ct(s) \ + // ((void) SSL_set_validation_callback((s), NULL, NULL)) + //#define SSL_CTX_disable_ct(ctx) \ + // ((void) SSL_CTX_set_validation_callback((ctx), NULL, NULL)) + + ///* + // * The validation type enumerates the available behaviours of the built-in SSL + // * CT validation callback selected via SSL_enable_ct() and SSL_CTX_enable_ct(). + // * The underlying callback is a static function in_ libssl. + // */ + + ///* + // * Enable CT by setting up a callback that implements one of the built-in + // * validation variants. The SSL_CT_VALIDATION_PERMISSIVE variant always + // * continues the handshake, the application can make appropriate decisions at + // * handshake completion. The SSL_CT_VALIDATION_STRICT variant requires at + // * least one valid SCT, or else handshake termination will be requested. The + // * handshake may continue anyway if SSL_VERIFY_NONE is in_ effect. + // */ + function SSL_enable_ct(s: PSSL; validation_mode: TIdC_INT): TIdC_INT cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_CTX_enable_ct(ctx: PSSL_CTX; validation_mode: TIdC_INT): TIdC_INT cdecl; external CLibSSL; {introduced 1.1.0} + + ///* + // * Report whether a non-NULL callback is enabled. + // */ + function SSL_ct_is_enabled(const s: PSSL): TIdC_INT cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_CTX_ct_is_enabled(const ctx: PSSL_CTX): TIdC_INT cdecl; external CLibSSL; {introduced 1.1.0} + + ///* Gets the SCTs received from a connection */ + //const STACK_OF(SCT) *SSL_get0_peer_scts(s: PSSL); + + function SSL_CTX_set_default_ctlog_list_file(ctx: PSSL_CTX): TIdC_INT cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_CTX_set_ctlog_list_file(ctx: PSSL_CTX; const path: PIdAnsiChar): TIdC_INT cdecl; external CLibSSL; {introduced 1.1.0} + procedure SSL_CTX_set0_ctlog_store(ctx: PSSL_CTX; logs: PCTLOG_STORE) cdecl; external CLibSSL; {introduced 1.1.0} + + // const CTLOG_STORE *SSL_CTX_get0_ctlog_store(const ctx: PSSL_CTX); + + // # endif /* OPENSSL_NO_CT */ + + procedure SSL_set_security_level(s: PSSL; level: TIdC_INT) cdecl; external CLibSSL; {introduced 1.1.0} + + ////__owur TIdC_INT SSL_get_security_level(const s: PSSL); + procedure SSL_set_security_callback(s: PSSL; cb: SSL_security_callback) cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_get_security_callback(const s: PSSL): SSL_security_callback cdecl; external CLibSSL; {introduced 1.1.0} + procedure SSL_set0_security_ex_data(s: PSSL; ex: Pointer) cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_get0_security_ex_data(const s: PSSL): Pointer cdecl; external CLibSSL; {introduced 1.1.0} + procedure SSL_CTX_set_security_level(ctx: PSSL_CTX; level: TIdC_INT) cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_CTX_get_security_level(const ctx: PSSL_CTX): TIdC_INT cdecl; external CLibSSL; {introduced 1.1.0} + //void SSL_CTX_set_security_callback(ctx: PSSL_CTX, + // TIdC_INT (*cb) (const s: PSSL, const ctx: PSSL_CTX, + // TIdC_INT op, TIdC_INT bits, TIdC_INT nid, + // void *other, void *ex)); + //TIdC_INT (*SSL_CTX_get_security_callback(const ctx: PSSL_CTX)) (const s: PSSL, + // const ctx: PSSL_CTX, + // TIdC_INT op, TIdC_INT bits, + // TIdC_INT nid, + // void *other, + // void *ex); + + function SSL_CTX_get0_security_ex_data(const ctx: PSSL_CTX): Pointer cdecl; external CLibSSL; {introduced 1.1.0} + + procedure SSL_CTX_set0_security_ex_data(ctx: PSSL_CTX; ex: Pointer) cdecl; external CLibSSL; {introduced 1.1.0} + + function OPENSSL_init_ssl(opts: TIdC_UINT64; const settings: POPENSSL_INIT_SETTINGS): TIdC_INT cdecl; external CLibSSL; {introduced 1.1.0} + + //# ifndef OPENSSL_NO_UNIT_TEST + //__owur const struct openssl_ssl_test_functions *SSL_test_functions(void); + //# endif + + function SSL_free_buffers(ssl: PSSL): TIdC_INT cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_alloc_buffers(ssl: PSSL): TIdC_INT cdecl; external CLibSSL; {introduced 1.1.0} + + function SSL_CTX_set_session_ticket_cb(ctx: PSSL_CTX; gen_cb: SSL_CTX_generate_session_ticket_fn; dec_cb: SSL_CTX_decrypt_session_ticket_fn; arg: Pointer): TIdC_INT cdecl; external CLibSSL; {introduced 1.1.0} + + function SSL_SESSION_set1_ticket_appdata(ss: PSSL_SESSION; const data: Pointer; len: TIdC_SIZET): TIdC_INT cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_SESSION_get0_ticket_appdata(ss: PSSL_SESSION; data: PPointer; len: PIdC_SIZET): TIdC_INT cdecl; external CLibSSL; {introduced 1.1.0} + + //extern const PIdAnsiChar SSL_version_str[]; + + procedure DTLS_set_timer_cb(s: PSSL; cb: DTLS_timer_cb) cdecl; external CLibSSL; {introduced 1.1.0} + procedure SSL_CTX_set_allow_early_data_cb(ctx: PSSL_CTX; cb: SSL_allow_early_data_cb_fN; arg: Pointer) cdecl; external CLibSSL; {introduced 1.1.0} + procedure SSL_set_allow_early_data_cb(s: PSSL; cb: SSL_allow_early_data_cb_fN; arg: Pointer) cdecl; external CLibSSL; {introduced 1.1.0} + + + //X509 *SSL_get0_peer_certificate(const SSL *s); + function SSL_get0_peer_certificate(const s: PSSL): PX509 cdecl; external CLibSSL; {introduced 3.3.0} + // X509 *SSL_get1_peer_certificate(const SSL *s); + function SSL_get1_peer_certificate(const s: PSSL): PX509 cdecl; external CLibSSL; {introduced 3.3.0} + + + +function SSL_CTX_set_mode(ctx: PSSL_CTX; op: TIdC_LONG): TIdC_LONG; {removed 1.0.0} +function SSL_CTX_clear_mode(ctx: PSSL_CTX; op: TIdC_LONG): TIdC_LONG; {removed 1.0.0} +function SSL_CTX_sess_set_cache_size(ctx: PSSL_CTX; t: TIdC_LONG): TIdC_LONG; {removed 1.0.0} +function SSL_CTX_sess_get_cache_size(ctx: PSSL_CTX): TIdC_LONG; {removed 1.0.0} +function SSL_CTX_set_session_cache_mode(ctx: PSSL_CTX; m: TIdC_LONG): TIdC_LONG; {removed 1.0.0} +function SSL_CTX_get_session_cache_mode(ctx: PSSL_CTX): TIdC_LONG; {removed 1.0.0} +function SSL_clear_num_renegotiations(ssl: PSSL): TIdC_LONG; {removed 1.0.0} +function SSL_total_renegotiations(ssl: PSSL): TIdC_LONG; {removed 1.0.0} +function SSL_CTX_set_tmp_dh(ctx: PSSL_CTX; dh: PDH): TIdC_LONG; {removed 1.0.0} +function SSL_CTX_set_tmp_ecdh(ctx: PSSL_CTX; ecdh: PByte): TIdC_LONG; {removed 1.0.0} +function SSL_CTX_set_dh_auto(ctx: PSSL_CTX; onoff: TIdC_LONG): TIdC_LONG; {removed 1.0.0} +function SSL_set_dh_auto(s: PSSL; onoff: TIdC_LONG): TIdC_LONG; {removed 1.0.0} +function SSL_set_tmp_dh(ssl: PSSL; dh: PDH): TIdC_LONG; {removed 1.0.0} +function SSL_set_tmp_ecdh(ssl: PSSL; ecdh: PByte): TIdC_LONG; {removed 1.0.0} +function SSL_CTX_add_extra_chain_cert(ctx: PSSL_CTX; x509: PByte): TIdC_LONG; {removed 1.0.0} +function SSL_CTX_get_extra_chain_certs(ctx: PSSL_CTX; px509: Pointer): TIdC_LONG; {removed 1.0.0} +function SSL_CTX_get_extra_chain_certs_only(ctx: PSSL_CTX; px509: Pointer): TIdC_LONG; {removed 1.0.0} +function SSL_CTX_clear_extra_chain_certs(ctx: PSSL_CTX): TIdC_LONG; {removed 1.0.0} +function SSL_CTX_set0_chain(ctx: PSSL_CTX; sk: PByte): TIdC_LONG; {removed 1.0.0} +function SSL_CTX_set1_chain(ctx: PSSL_CTX; sk: PByte): TIdC_LONG; {removed 1.0.0} +function SSL_CTX_add0_chain_cert(ctx: PSSL_CTX; x509: PX509): TIdC_LONG; {removed 1.0.0} +function SSL_CTX_add1_chain_cert(ctx: PSSL_CTX; x509: PX509): TIdC_LONG; {removed 1.0.0} +function SSL_CTX_get0_chain_certs(ctx: PSSL_CTX; px509: Pointer): TIdC_LONG; {removed 1.0.0} +function SSL_CTX_clear_chain_certs(ctx: PSSL_CTX): TIdC_LONG; {removed 1.0.0} +function SSL_CTX_build_cert_chain(ctx: PSSL_CTX; flags: TIdC_LONG): TIdC_LONG; {removed 1.0.0} +function SSL_CTX_select_current_cert(ctx: PSSL_CTX; x509: PByte): TIdC_LONG; {removed 1.0.0} +function SSL_CTX_set_current_cert(ctx: PSSL_CTX; op: TIdC_LONG): TIdC_LONG; {removed 1.0.0} +function SSL_CTX_set0_verify_cert_store(ctx: PSSL_CTX; st: Pointer): TIdC_LONG; {removed 1.0.0} +function SSL_CTX_set1_verify_cert_store(ctx: PSSL_CTX; st: Pointer): TIdC_LONG; {removed 1.0.0} +function SSL_CTX_set0_chain_cert_store(ctx: PSSL_CTX; st: Pointer): TIdC_LONG; {removed 1.0.0} +function SSL_CTX_set1_chain_cert_store(ctx: PSSL_CTX; st: Pointer): TIdC_LONG; {removed 1.0.0} +function SSL_set0_chain(s: PSSL; sk: PByte): TIdC_LONG; {removed 1.0.0} +function SSL_set1_chain(s: PSSL; sk: PByte): TIdC_LONG; {removed 1.0.0} +function SSL_add0_chain_cert(s: PSSL; x509: PByte): TIdC_LONG; {removed 1.0.0} +function SSL_add1_chain_cert(s: PSSL; x509: PByte): TIdC_LONG; {removed 1.0.0} +function SSL_get0_chain_certs(s: PSSL; px509: Pointer): TIdC_LONG; {removed 1.0.0} +function SSL_clear_chain_certs(s: PSSL): TIdC_LONG; {removed 1.0.0} +function SSL_build_cert_chain(s: PSSL; flags: TIdC_LONG): TIdC_LONG; {removed 1.0.0} +function SSL_select_current_cert(s: PSSL; x509: PByte): TIdC_LONG; {removed 1.0.0} +function SSL_set_current_cert(s: PSSL; op: TIdC_LONG): TIdC_LONG; {removed 1.0.0} +function SSL_set0_verify_cert_store(s: PSSL; st: PByte): TIdC_LONG; {removed 1.0.0} +function SSL_set1_verify_cert_store(s: PSSL; st: PByte): TIdC_LONG; {removed 1.0.0} +function SSL_set0_chain_cert_store(s: PSSL; st: PByte): TIdC_LONG; {removed 1.0.0} +function SSL_set1_chain_cert_store(s: PSSL; st: PByte): TIdC_LONG; {removed 1.0.0} +function SSL_get1_groups(s: PSSL; glist: PIdC_INT): TIdC_LONG; {removed 1.0.0} +function SSL_CTX_set1_groups(ctx: PSSL_CTX; glist: PByte; glistlen: TIdC_LONG): TIdC_LONG; {removed 1.0.0} +function SSL_CTX_set1_groups_list(ctx: PSSL_CTX; s: PByte): TIdC_LONG; {removed 1.0.0} +function SSL_set1_groups(s: PSSL; glist: PByte; glistlen: TIdC_LONG): TIdC_LONG; {removed 1.0.0} +function SSL_set1_groups_list(s: PSSL; str: PByte): TIdC_LONG; {removed 1.0.0} +function SSL_get_shared_group(s: PSSL; n: TIdC_LONG): TIdC_LONG; {removed 1.0.0} +function SSL_CTX_set1_sigalgs(ctx: PSSL_CTX; slist: PIdC_INT; slistlen: TIdC_LONG): TIdC_LONG; {removed 1.0.0} +function SSL_CTX_set1_sigalgs_list(ctx: PSSL_CTX; s: PByte): TIdC_LONG; {removed 1.0.0} +function SSL_set1_sigalgs(s: PSSL; slist: PIdC_INT; slistlen: TIdC_LONG): TIdC_LONG; {removed 1.0.0} +function SSL_set1_sigalgs_list(s: PSSL; str: PByte): TIdC_LONG; {removed 1.0.0} +function SSL_CTX_set1_client_sigalgs(ctx: PSSL_CTX; slist: PIdC_INT; slistlen: TIdC_LONG): TIdC_LONG; {removed 1.0.0} +function SSL_CTX_set1_client_sigalgs_list(ctx: PSSL_CTX; s: PByte): TIdC_LONG; {removed 1.0.0} +function SSL_set1_client_sigalgs(s: PSSL; slist: PIdC_INT; slistlen: TIdC_LONG): TIdC_LONG; {removed 1.0.0} +function SSL_set1_client_sigalgs_list(s: PSSL; str: PByte): TIdC_LONG; {removed 1.0.0} +function SSL_get0_certificate_types(s: PSSL; clist: PByte): TIdC_LONG; {removed 1.0.0} +function SSL_CTX_set1_client_certificate_types(ctx: PSSL_CTX; clist: PByte; clistlen: TIdC_LONG): TIdC_LONG; {removed 1.0.0} +function SSL_set1_client_certificate_types(s: PSSL; clist: PByte; clistlen: TIdC_LONG): TIdC_LONG; {removed 1.0.0} +function SSL_get_signature_nid(s: PSSL; pn: Pointer): TIdC_LONG; {removed 1.0.0} +function SSL_get_peer_signature_nid(s: PSSL; pn: Pointer): TIdC_LONG; {removed 1.0.0} +function SSL_get_peer_tmp_key(s: PSSL; pk: Pointer): TIdC_LONG; {removed 1.0.0} +function SSL_get_tmp_key(s: PSSL; pk: Pointer): TIdC_LONG; {removed 1.0.0} +function SSL_get0_raw_cipherlist(s: PSSL; plst: Pointer): TIdC_LONG; {removed 1.0.0} +function SSL_get0_ec_point_formats(s: PSSL; plst: Pointer): TIdC_LONG; {removed 1.0.0} + function SSL_get_app_data(const ssl: PSSL): Pointer ; {removed 1.0.0} + function SSL_set_app_data(ssl: PSSL; data: Pointer): TIdC_INT; {removed 1.0.0} + function SSLeay_add_ssl_algorithms: TIdC_INT; {removed 1.0.0} + procedure SSL_load_error_strings; {removed 1.1.0} + function SSL_get_peer_certificate(const s: PSSL): PX509; {removed 3.0.0} + function SSL_library_init: TIdC_INT; {removed 1.1.0} +{$ENDIF} + +implementation + + uses + classes, + IdSSLOpenSSLExceptionHandlers, + IdResourceStringsOpenSSL + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + ,IdSSLOpenSSLLoader + {$ENDIF}; + +const + SSL_CTX_get_options_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_get_options_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_CTX_clear_options_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_clear_options_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_CTX_set_options_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_set_options_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_CTX_set_stateless_cookie_generate_cb_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_CTX_set_stateless_cookie_verify_cb_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_set_psk_find_session_callback_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_CTX_set_psk_find_session_callback_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_set_psk_use_session_callback_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_CTX_set_psk_use_session_callback_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_CTX_set_keylog_callback_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_CTX_get_keylog_callback_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_CTX_set_max_early_data_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_CTX_get_max_early_data_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_set_max_early_data_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_get_max_early_data_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_CTX_set_recv_max_early_data_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_CTX_get_recv_max_early_data_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_set_recv_max_early_data_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_get_recv_max_early_data_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_in_init_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_in_before_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_is_init_finished_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_CTX_up_ref_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_CTX_set1_cert_store_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_get_pending_cipher_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_CIPHER_standard_name_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + OPENSSL_cipher_name_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_CIPHER_get_protocol_id_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_CIPHER_get_kx_nid_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_CIPHER_get_auth_nid_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_CIPHER_get_handshake_digest_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_CIPHER_is_aead_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_has_pending_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_set0_rbio_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_set0_wbio_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_CTX_set_ciphersuites_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_set_ciphersuites_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_CTX_use_serverinfo_ex_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_use_certificate_chain_file_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_SESSION_get_protocol_version_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_SESSION_set_protocol_version_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_SESSION_get0_hostname_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_SESSION_set1_hostname_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_SESSION_get0_alpn_selected_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_SESSION_set1_alpn_selected_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_SESSION_get0_cipher_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_SESSION_set_cipher_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_SESSION_has_ticket_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_SESSION_get_ticket_lifetime_hint_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_SESSION_get0_ticket_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_SESSION_get_max_early_data_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_SESSION_set_max_early_data_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_SESSION_set1_id_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_SESSION_is_resumable_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_SESSION_dup_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_SESSION_get0_id_context_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_SESSION_print_keylog_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_SESSION_up_ref_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_CTX_set_default_passwd_cb_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_CTX_set_default_passwd_cb_userdata_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_CTX_get_default_passwd_cb_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_CTX_get_default_passwd_cb_userdata_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_set_default_passwd_cb_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_set_default_passwd_cb_userdata_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_get_default_passwd_cb_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_get_default_passwd_cb_userdata_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_up_ref_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_is_dtls_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_set1_host_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_add1_host_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_get0_peername_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_set_hostflags_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_CTX_dane_enable_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_CTX_dane_mtype_set_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_dane_enable_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_dane_tlsa_add_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_get0_dane_authority_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_get0_dane_tlsa_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_get0_dane_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_CTX_dane_set_flags_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_CTX_dane_clear_flags_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_dane_set_flags_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_dane_clear_flags_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_CTX_set_client_hello_cb_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_client_hello_isv2_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_client_hello_get0_legacy_version_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_client_hello_get0_random_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_client_hello_get0_session_id_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_client_hello_get0_ciphers_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_client_hello_get0_compression_methods_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_client_hello_get1_extensions_present_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_client_hello_get0_ext_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_waiting_for_async_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_get_all_async_fds_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_get_changed_async_fds_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_stateless_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_read_ex_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_read_early_data_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_peek_ex_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_write_ex_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_write_early_data_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_get_early_data_status_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + TLS_method_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + TLS_server_method_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + TLS_client_method_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_key_update_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_get_key_update_type_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_CTX_set_post_handshake_auth_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_set_post_handshake_auth_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_verify_client_post_handshake_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_client_version_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_CTX_set_default_verify_dir_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_CTX_set_default_verify_file_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_get_state_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_get_client_random_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_get_server_random_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_SESSION_get_master_key_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_SESSION_set1_master_key_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_SESSION_get_max_fragment_length_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_CTX_set_default_read_buffer_len_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_set_default_read_buffer_len_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_CIPHER_get_cipher_nid_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_CIPHER_get_digest_nid_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_CTX_set_not_resumable_session_callback_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_set_not_resumable_session_callback_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_CTX_set_record_padding_callback_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_CTX_set_record_padding_callback_arg_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_CTX_get_record_padding_callback_arg_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_CTX_set_block_padding_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_set_record_padding_callback_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_set_record_padding_callback_arg_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_get_record_padding_callback_arg_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_set_block_padding_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_set_num_tickets_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_get_num_tickets_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_CTX_set_num_tickets_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_CTX_get_num_tickets_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_session_reused_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_add_ssl_module_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_config_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_CTX_config_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + DTLSv1_listen_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_enable_ct_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_CTX_enable_ct_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_ct_is_enabled_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_CTX_ct_is_enabled_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_CTX_set_default_ctlog_list_file_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_CTX_set_ctlog_list_file_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_CTX_set0_ctlog_store_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_set_security_level_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_set_security_callback_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_get_security_callback_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_set0_security_ex_data_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_get0_security_ex_data_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_CTX_set_security_level_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_CTX_get_security_level_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_CTX_get0_security_ex_data_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_CTX_set0_security_ex_data_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + OPENSSL_init_ssl_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_free_buffers_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_alloc_buffers_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_CTX_set_session_ticket_cb_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_SESSION_set1_ticket_appdata_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_SESSION_get0_ticket_appdata_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + DTLS_set_timer_cb_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_CTX_set_allow_early_data_cb_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_set_allow_early_data_cb_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_get0_peer_certificate_introduced = (byte(3) shl 8 or byte(3)) shl 8 or byte(0); + SSL_get1_peer_certificate_introduced = (byte(3) shl 8 or byte(3)) shl 8 or byte(0); + SSL_CTX_set_mode_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + SSL_CTX_clear_mode_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + SSL_CTX_sess_set_cache_size_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + SSL_CTX_sess_get_cache_size_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + SSL_CTX_set_session_cache_mode_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + SSL_CTX_get_session_cache_mode_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + SSL_clear_num_renegotiations_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + SSL_total_renegotiations_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + SSL_CTX_set_tmp_dh_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + SSL_CTX_set_tmp_ecdh_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + SSL_CTX_set_dh_auto_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + SSL_set_dh_auto_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + SSL_set_tmp_dh_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + SSL_set_tmp_ecdh_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + SSL_CTX_add_extra_chain_cert_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + SSL_CTX_get_extra_chain_certs_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + SSL_CTX_get_extra_chain_certs_only_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + SSL_CTX_clear_extra_chain_certs_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + SSL_CTX_set0_chain_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + SSL_CTX_set1_chain_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + SSL_CTX_add0_chain_cert_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + SSL_CTX_add1_chain_cert_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + SSL_CTX_get0_chain_certs_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + SSL_CTX_clear_chain_certs_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + SSL_CTX_build_cert_chain_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + SSL_CTX_select_current_cert_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + SSL_CTX_set_current_cert_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + SSL_CTX_set0_verify_cert_store_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + SSL_CTX_set1_verify_cert_store_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + SSL_CTX_set0_chain_cert_store_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + SSL_CTX_set1_chain_cert_store_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + SSL_set0_chain_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + SSL_set1_chain_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + SSL_add0_chain_cert_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + SSL_add1_chain_cert_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + SSL_get0_chain_certs_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + SSL_clear_chain_certs_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + SSL_build_cert_chain_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + SSL_select_current_cert_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + SSL_set_current_cert_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + SSL_set0_verify_cert_store_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + SSL_set1_verify_cert_store_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + SSL_set0_chain_cert_store_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + SSL_set1_chain_cert_store_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + SSL_get1_groups_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + SSL_CTX_set1_groups_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + SSL_CTX_set1_groups_list_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + SSL_set1_groups_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + SSL_set1_groups_list_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + SSL_get_shared_group_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + SSL_CTX_set1_sigalgs_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + SSL_CTX_set1_sigalgs_list_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + SSL_set1_sigalgs_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + SSL_set1_sigalgs_list_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + SSL_CTX_set1_client_sigalgs_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + SSL_CTX_set1_client_sigalgs_list_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + SSL_set1_client_sigalgs_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + SSL_set1_client_sigalgs_list_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + SSL_get0_certificate_types_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + SSL_CTX_set1_client_certificate_types_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + SSL_set1_client_certificate_types_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + SSL_get_signature_nid_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + SSL_get_peer_signature_nid_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + SSL_get_peer_tmp_key_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + SSL_get_tmp_key_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + SSL_get0_raw_cipherlist_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + SSL_get0_ec_point_formats_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + SSL_get_app_data_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + SSL_set_app_data_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + SSLeay_add_ssl_algorithms_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + SSL_load_error_strings_removed = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_get_peer_certificate_removed = (byte(3) shl 8 or byte(0)) shl 8 or byte(0); + SSL_library_init_removed = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSLv2_method_removed = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); // SSLv2 + SSLv2_server_method_removed = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); // SSLv2 + SSLv2_client_method_removed = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); // SSLv2 + SSLv3_method_removed = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); // SSLv3 + SSLv3_server_method_removed = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); // SSLv3 + SSLv3_client_method_removed = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); // SSLv3 + SSLv23_method_removed = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); // SSLv3 but can rollback to v2 + SSLv23_server_method_removed = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); // SSLv3 but can rollback to v2 + SSLv23_client_method_removed = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); // SSLv3 but can rollback to v2 + TLSv1_method_removed = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); // TLSv1.0 + TLSv1_server_method_removed = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); // TLSv1.0 + TLSv1_client_method_removed = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); // TLSv1.0 + TLSv1_1_method_removed = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); //TLS1.1 + TLSv1_1_server_method_removed = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); //TLS1.1 + TLSv1_1_client_method_removed = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); //TLS1.1 + TLSv1_2_method_removed = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); // TLSv1.2 + TLSv1_2_server_method_removed = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); // TLSv1.2 + TLSv1_2_client_method_removed = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); // TLSv1.2 + +//# define SSL_get_peer_certificate SSL_get1_peer_certificate +{helper_functions} + +function IsOpenSSL_SSLv2_Available : Boolean; + begin + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + Result := Assigned(SSLv2_method) and + Assigned(SSLv2_server_method) and + Assigned(SSLv2_client_method); + {$ELSE} + Result := false; + {$ENDIF} + end; + + function IsOpenSSL_SSLv3_Available : Boolean; + begin + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + Result := Assigned(SSLv3_method) and + Assigned(SSLv3_server_method) and + Assigned(SSLv3_client_method); + {$ELSE} + Result := true; + {$ENDIF} + end; + + function IsOpenSSL_SSLv23_Available : Boolean; + begin + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + Result := Assigned(SSLv23_method) and + Assigned(SSLv23_server_method) and + Assigned(SSLv23_client_method); + {$ELSE} + Result := false; + {$ENDIF} + end; + + function IsOpenSSL_TLSv1_0_Available : Boolean; + begin + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + Result := Assigned(TLSv1_method) and + Assigned(TLSv1_server_method) and + Assigned(TLSv1_client_method); + {$ELSE} + Result := true; + {$ENDIF} + end; + + function IsOpenSSL_TLSv1_1_Available : Boolean; + begin + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + Result := Assigned(TLSv1_1_method) and + Assigned(TLSv1_1_server_method) and + Assigned(TLSv1_1_client_method); + {$ELSE} + Result := true; + {$ENDIF} + end; + + function IsOpenSSL_TLSv1_2_Available : Boolean; + begin + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + Result := Assigned(TLSv1_2_method) and + Assigned(TLSv1_2_server_method) and + Assigned(TLSv1_2_client_method); + {$ELSE} + Result := true; + {$ENDIF} + end; + +function HasTLS_method: boolean; +begin + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + if Assigned(SSLeay) then + Result := TLS_method_introduced <= (SSLeay shr 12); + {$ELSE} + Result := true; + {$ENDIF} +end; + + +//# define SSL_CTX_set_min_proto_version(ctx, version) SSL_CTX_ctrl(ctx, SSL_CTRL_SET_MIN_PROTO_VERSION, version, NULL) +function SSL_CTX_set_min_proto_version(ctx: PSSL_CTX; version: TIdC_LONG): TIdC_LONG; +begin + Result := SSL_CTX_ctrl(ctx, SSL_CTRL_SET_MIN_PROTO_VERSION, version, nil); +end; + +//# define SSL_CTX_set_max_proto_version(ctx, version) SSL_CTX_ctrl(ctx, SSL_CTRL_SET_MAX_PROTO_VERSION, version, NULL) +function SSL_CTX_set_max_proto_version(ctx: PSSL_CTX; version: TIdC_LONG): TIdC_LONG; +begin + Result := SSL_CTX_ctrl(ctx, SSL_CTRL_SET_MAX_PROTO_VERSION, version, nil); +end; + +//# define SSL_CTX_get_min_proto_version(ctx) SSL_CTX_ctrl(ctx, SSL_CTRL_GET_MIN_PROTO_VERSION, 0, NULL) +function SSL_CTX_get_min_proto_version(ctx: PSSL_CTX): TIdC_LONG; +begin + Result := SSL_CTX_ctrl(ctx, SSL_CTRL_GET_MIN_PROTO_VERSION, 0, nil); +end; + +//# define SSL_CTX_get_max_proto_version(ctx) SSL_CTX_ctrl(ctx, SSL_CTRL_GET_MAX_PROTO_VERSION, 0, NULL) +function SSL_CTX_get_max_proto_version(ctx: PSSL_CTX): TIdC_LONG; +begin + Result := SSL_CTX_ctrl(ctx, SSL_CTRL_GET_MAX_PROTO_VERSION, 0, nil); +end; + +//# define SSL_set_min_proto_version(s, version) SSL_ctrl(s, SSL_CTRL_SET_MIN_PROTO_VERSION, version, NULL) +function SSL_set_min_proto_version(s: PSSL; version: TIdC_LONG): TIdC_LONG; +begin + Result := SSL_ctrl(s, SSL_CTRL_SET_MIN_PROTO_VERSION, version, nil); +end; + +//# define SSL_set_max_proto_version(s, version) SSL_ctrl(s, SSL_CTRL_SET_MAX_PROTO_VERSION, version, NULL) +function SSL_set_max_proto_version(s: PSSL; version: TIdC_LONG): TIdC_LONG; +begin + Result := SSL_ctrl(s, SSL_CTRL_SET_MAX_PROTO_VERSION, version, nil); +end; + +//# define SSL_get_min_proto_version(s) SSL_ctrl(s, SSL_CTRL_GET_MIN_PROTO_VERSION, 0, NULL) +function SSL_get_min_proto_version(s: PSSL): TIdC_LONG; +begin + Result := SSL_ctrl(s, SSL_CTRL_GET_MIN_PROTO_VERSION, 0, nil); +end; + +//# define SSL_get_max_proto_version(s) SSL_ctrl(s, SSL_CTRL_GET_MAX_PROTO_VERSION, 0, NULL) +function SSL_get_max_proto_version(s: PSSL): TIdC_LONG; +begin + Result := SSL_ctrl(s, SSL_CTRL_GET_MAX_PROTO_VERSION, 0, nil); +end; +{/helper_functions} +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +const + SSL_CTX_set_mode_procname = 'SSL_CTX_set_mode'; {removed 1.0.0} + SSL_CTX_clear_mode_procname = 'SSL_CTX_clear_mode'; {removed 1.0.0} + + SSL_CTX_sess_set_cache_size_procname = 'SSL_CTX_sess_set_cache_size'; {removed 1.0.0} + SSL_CTX_sess_get_cache_size_procname = 'SSL_CTX_sess_get_cache_size'; {removed 1.0.0} + SSL_CTX_set_session_cache_mode_procname = 'SSL_CTX_set_session_cache_mode'; {removed 1.0.0} + SSL_CTX_get_session_cache_mode_procname = 'SSL_CTX_get_session_cache_mode'; {removed 1.0.0} + + SSL_clear_num_renegotiations_procname = 'SSL_clear_num_renegotiations'; {removed 1.0.0} + SSL_total_renegotiations_procname = 'SSL_total_renegotiations'; {removed 1.0.0} + SSL_CTX_set_tmp_dh_procname = 'SSL_CTX_set_tmp_dh'; {removed 1.0.0} + SSL_CTX_set_tmp_ecdh_procname = 'SSL_CTX_set_tmp_ecdh'; {removed 1.0.0} + SSL_CTX_set_dh_auto_procname = 'SSL_CTX_set_dh_auto'; {removed 1.0.0} + SSL_set_dh_auto_procname = 'SSL_set_dh_auto'; {removed 1.0.0} + SSL_set_tmp_dh_procname = 'SSL_set_tmp_dh'; {removed 1.0.0} + SSL_set_tmp_ecdh_procname = 'SSL_set_tmp_ecdh'; {removed 1.0.0} + SSL_CTX_add_extra_chain_cert_procname = 'SSL_CTX_add_extra_chain_cert'; {removed 1.0.0} + SSL_CTX_get_extra_chain_certs_procname = 'SSL_CTX_get_extra_chain_certs'; {removed 1.0.0} + SSL_CTX_get_extra_chain_certs_only_procname = 'SSL_CTX_get_extra_chain_certs_only'; {removed 1.0.0} + SSL_CTX_clear_extra_chain_certs_procname = 'SSL_CTX_clear_extra_chain_certs'; {removed 1.0.0} + SSL_CTX_set0_chain_procname = 'SSL_CTX_set0_chain'; {removed 1.0.0} + SSL_CTX_set1_chain_procname = 'SSL_CTX_set1_chain'; {removed 1.0.0} + SSL_CTX_add0_chain_cert_procname = 'SSL_CTX_add0_chain_cert'; {removed 1.0.0} + SSL_CTX_add1_chain_cert_procname = 'SSL_CTX_add1_chain_cert'; {removed 1.0.0} + SSL_CTX_get0_chain_certs_procname = 'SSL_CTX_get0_chain_certs'; {removed 1.0.0} + SSL_CTX_clear_chain_certs_procname = 'SSL_CTX_clear_chain_certs'; {removed 1.0.0} + SSL_CTX_build_cert_chain_procname = 'SSL_CTX_build_cert_chain'; {removed 1.0.0} + SSL_CTX_select_current_cert_procname = 'SSL_CTX_select_current_cert'; {removed 1.0.0} + SSL_CTX_set_current_cert_procname = 'SSL_CTX_set_current_cert'; {removed 1.0.0} + SSL_CTX_set0_verify_cert_store_procname = 'SSL_CTX_set0_verify_cert_store'; {removed 1.0.0} + SSL_CTX_set1_verify_cert_store_procname = 'SSL_CTX_set1_verify_cert_store'; {removed 1.0.0} + SSL_CTX_set0_chain_cert_store_procname = 'SSL_CTX_set0_chain_cert_store'; {removed 1.0.0} + SSL_CTX_set1_chain_cert_store_procname = 'SSL_CTX_set1_chain_cert_store'; {removed 1.0.0} + SSL_set0_chain_procname = 'SSL_set0_chain'; {removed 1.0.0} + SSL_set1_chain_procname = 'SSL_set1_chain'; {removed 1.0.0} + SSL_add0_chain_cert_procname = 'SSL_add0_chain_cert'; {removed 1.0.0} + SSL_add1_chain_cert_procname = 'SSL_add1_chain_cert'; {removed 1.0.0} + SSL_get0_chain_certs_procname = 'SSL_get0_chain_certs'; {removed 1.0.0} + SSL_clear_chain_certs_procname = 'SSL_clear_chain_certs'; {removed 1.0.0} + SSL_build_cert_chain_procname = 'SSL_build_cert_chain'; {removed 1.0.0} + SSL_select_current_cert_procname = 'SSL_select_current_cert'; {removed 1.0.0} + SSL_set_current_cert_procname = 'SSL_set_current_cert'; {removed 1.0.0} + SSL_set0_verify_cert_store_procname = 'SSL_set0_verify_cert_store'; {removed 1.0.0} + SSL_set1_verify_cert_store_procname = 'SSL_set1_verify_cert_store'; {removed 1.0.0} + SSL_set0_chain_cert_store_procname = 'SSL_set0_chain_cert_store'; {removed 1.0.0} + SSL_set1_chain_cert_store_procname = 'SSL_set1_chain_cert_store'; {removed 1.0.0} + SSL_get1_groups_procname = 'SSL_get1_groups'; {removed 1.0.0} + SSL_CTX_set1_groups_procname = 'SSL_CTX_set1_groups'; {removed 1.0.0} + SSL_CTX_set1_groups_list_procname = 'SSL_CTX_set1_groups_list'; {removed 1.0.0} + SSL_set1_groups_procname = 'SSL_set1_groups'; {removed 1.0.0} + SSL_set1_groups_list_procname = 'SSL_set1_groups_list'; {removed 1.0.0} + SSL_get_shared_group_procname = 'SSL_get_shared_group'; {removed 1.0.0} + SSL_CTX_set1_sigalgs_procname = 'SSL_CTX_set1_sigalgs'; {removed 1.0.0} + SSL_CTX_set1_sigalgs_list_procname = 'SSL_CTX_set1_sigalgs_list'; {removed 1.0.0} + SSL_set1_sigalgs_procname = 'SSL_set1_sigalgs'; {removed 1.0.0} + SSL_set1_sigalgs_list_procname = 'SSL_set1_sigalgs_list'; {removed 1.0.0} + SSL_CTX_set1_client_sigalgs_procname = 'SSL_CTX_set1_client_sigalgs'; {removed 1.0.0} + SSL_CTX_set1_client_sigalgs_list_procname = 'SSL_CTX_set1_client_sigalgs_list'; {removed 1.0.0} + SSL_set1_client_sigalgs_procname = 'SSL_set1_client_sigalgs'; {removed 1.0.0} + SSL_set1_client_sigalgs_list_procname = 'SSL_set1_client_sigalgs_list'; {removed 1.0.0} + SSL_get0_certificate_types_procname = 'SSL_get0_certificate_types'; {removed 1.0.0} + SSL_CTX_set1_client_certificate_types_procname = 'SSL_CTX_set1_client_certificate_types'; {removed 1.0.0} + SSL_set1_client_certificate_types_procname = 'SSL_set1_client_certificate_types'; {removed 1.0.0} + SSL_get_signature_nid_procname = 'SSL_get_signature_nid'; {removed 1.0.0} + SSL_get_peer_signature_nid_procname = 'SSL_get_peer_signature_nid'; {removed 1.0.0} + SSL_get_peer_tmp_key_procname = 'SSL_get_peer_tmp_key'; {removed 1.0.0} + SSL_get_tmp_key_procname = 'SSL_get_tmp_key'; {removed 1.0.0} + SSL_get0_raw_cipherlist_procname = 'SSL_get0_raw_cipherlist'; {removed 1.0.0} + SSL_get0_ec_point_formats_procname = 'SSL_get0_ec_point_formats'; {removed 1.0.0} + + //typedef TIdC_INT (*tls_session_secret_cb_fn)(s: PSSL, void *secret, TIdC_INT *secret_len, + // STACK_OF(SSL_CIPHER) *peer_ciphers, + // const SSL_CIPHER **cipher, void *arg); + + SSL_CTX_get_options_procname = 'SSL_CTX_get_options'; {introduced 1.1.0} + SSL_get_options_procname = 'SSL_get_options'; {introduced 1.1.0} + SSL_CTX_clear_options_procname = 'SSL_CTX_clear_options'; {introduced 1.1.0} + SSL_clear_options_procname = 'SSL_clear_options'; {introduced 1.1.0} + SSL_CTX_set_options_procname = 'SSL_CTX_set_options'; {introduced 1.1.0} + SSL_set_options_procname = 'SSL_set_options'; {introduced 1.1.0} + + //# define SSL_CTX_set_mode(ctx,op) \ + // SSL_CTX_ctrl((ctx),SSL_CTRL_MODE,(op),NULL) + //# define SSL_CTX_clear_mode(ctx,op) \ + // SSL_CTX_ctrl((ctx),SSL_CTRL_CLEAR_MODE,(op),NULL) + //# define SSL_CTX_get_mode(ctx) \ + // SSL_CTX_ctrl((ctx),SSL_CTRL_MODE,0,NULL) + //# define SSL_clear_mode(ssl,op) \ + // SSL_ctrl((ssl),SSL_CTRL_CLEAR_MODE,(op),NULL) + //# define SSL_set_mode(ssl,op) \ + // SSL_ctrl((ssl),SSL_CTRL_MODE,(op),NULL) + //# define SSL_get_mode(ssl) \ + // SSL_ctrl((ssl),SSL_CTRL_MODE,0,NULL) + //# define SSL_set_mtu(ssl, mtu) \ + // SSL_ctrl((ssl),SSL_CTRL_SET_MTU,(mtu),NULL) + //# define DTLS_set_link_mtu(ssl, mtu) \ + // SSL_ctrl((ssl),DTLS_CTRL_SET_LINK_MTU,(mtu),NULL) + //# define DTLS_get_link_min_mtu(ssl) \ + // SSL_ctrl((ssl),DTLS_CTRL_GET_LINK_MIN_MTU,0,NULL) + // + //# define SSL_get_secure_renegotiation_support(ssl) \ + // SSL_ctrl((ssl), SSL_CTRL_GET_RI_SUPPORT, 0, NULL) + // + //# ifndef OPENSSL_NO_HEARTBEATS + //# define SSL_heartbeat(ssl) \ + // SSL_ctrl((ssl),SSL_CTRL_DTLS_EXT_SEND_HEARTBEAT,0,NULL) + //# endif + // + //# define SSL_CTX_set_cert_flags(ctx,op) \ + // SSL_CTX_ctrl((ctx),SSL_CTRL_CERT_FLAGS,(op),NULL) + //# define SSL_set_cert_flags(s,op) \ + // SSL_ctrl((s),SSL_CTRL_CERT_FLAGS,(op),NULL) + //# define SSL_CTX_clear_cert_flags(ctx,op) \ + // SSL_CTX_ctrl((ctx),SSL_CTRL_CLEAR_CERT_FLAGS,(op),NULL) + //# define SSL_clear_cert_flags(s,op) \ + // SSL_ctrl((s),SSL_CTRL_CLEAR_CERT_FLAGS,(op),NULL) + // + //void SSL_CTX_set_msg_callback(ctx: PSSL_CTX, + // void (*cb) (TIdC_INT write_p, TIdC_INT version, + // TIdC_INT content_type, const void *buf, + // TIdC_SIZET len, ssl: PSSL, void *arg)); + //void SSL_set_msg_callback(ssl: PSSL, + // void (*cb) (TIdC_INT write_p, TIdC_INT version, + // TIdC_INT content_type, const void *buf, + // TIdC_SIZET len, ssl: PSSL, void *arg)); + //# define SSL_CTX_set_msg_callback_arg(ctx, arg) SSL_CTX_ctrl((ctx), SSL_CTRL_SET_MSG_CALLBACK_ARG, 0, (arg)) + //# define SSL_set_msg_callback_arg(ssl, arg) SSL_ctrl((ssl), SSL_CTRL_SET_MSG_CALLBACK_ARG, 0, (arg)) + // + //# define SSL_get_extms_support(s) \ + // SSL_ctrl((s),SSL_CTRL_GET_EXTMS_SUPPORT,0,NULL) + // + //# ifndef OPENSSL_NO_SRP + + ///* see tls_srp.c */ + //__owur TIdC_INT SSL_SRP_CTX_init(s: PSSL); + //__owur TIdC_INT SSL_CTX_SRP_CTX_init(ctx: PSSL_CTX); + //TIdC_INT SSL_SRP_CTX_free(SSL *ctx); + //TIdC_INT SSL_CTX_SRP_CTX_free(ctx: PSSL_CTX); + //__owur TIdC_INT SSL_srp_server_param_with_username(s: PSSL, TIdC_INT *ad); + //__owur TIdC_INT SRP_Calc_A_param(s: PSSL); + + // # endif + + // LHASH_OF(SSL_SESSION) *SSL_CTX_sessions(ctx: PSSL_CTX); + //# define SSL_CTX_sess_number(ctx) \ + // SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_NUMBER,0,NULL) + //# define SSL_CTX_sess_connect(ctx) \ + // SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_CONNECT,0,NULL) + //# define SSL_CTX_sess_connect_good(ctx) \ + // SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_CONNECT_GOOD,0,NULL) + //# define SSL_CTX_sess_connect_renegotiate(ctx) \ + // SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_CONNECT_RENEGOTIATE,0,NULL) + //# define SSL_CTX_sess_accept(ctx) \ + // SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_ACCEPT,0,NULL) + //# define SSL_CTX_sess_accept_renegotiate(ctx) \ + // SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_ACCEPT_RENEGOTIATE,0,NULL) + //# define SSL_CTX_sess_accept_good(ctx) \ + // SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_ACCEPT_GOOD,0,NULL) + //# define SSL_CTX_sess_hits(ctx) \ + // SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_HIT,0,NULL) + //# define SSL_CTX_sess_cb_hits(ctx) \ + // SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_CB_HIT,0,NULL) + //# define SSL_CTX_sess_misses(ctx) \ + // SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_MISSES,0,NULL) + //# define SSL_CTX_sess_timeouts(ctx) \ + // SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_TIMEOUTS,0,NULL) + //# define SSL_CTX_sess_cache_full(ctx) \ + // SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_CACHE_FULL,0,NULL) + + SSL_CTX_sess_set_new_cb_procname = 'SSL_CTX_sess_set_new_cb'; + SSL_CTX_sess_get_new_cb_procname = 'SSL_CTX_sess_get_new_cb'; + SSL_CTX_sess_set_remove_cb_procname = 'SSL_CTX_sess_set_remove_cb'; + SSL_CTX_sess_get_remove_cb_procname = 'SSL_CTX_sess_get_remove_cb'; + + //void SSL_CTX_sess_set_get_cb(ctx: PSSL_CTX, + // SSL_SESSION *(*get_session_cb) (struct ssl_st + // *ssl, + // const Byte + // *data, TIdC_INT len, + // TIdC_INT *copy)); + //SSL_SESSION *(*SSL_CTX_sess_get_get_cb(ctx: PSSL_CTX)) (struct ssl_st *ssl, + // const d: PByteata, + // TIdC_INT len, TIdC_INT *copy); + SSL_CTX_set_info_callback_procname = 'SSL_CTX_set_info_callback'; + SSL_CTX_get_info_callback_procname = 'SSL_CTX_get_info_callback'; + SSL_CTX_set_client_cert_cb_procname = 'SSL_CTX_set_client_cert_cb'; + SSL_CTX_get_client_cert_cb_procname = 'SSL_CTX_get_client_cert_cb'; + SSL_CTX_set_client_cert_engine_procname = 'SSL_CTX_set_client_cert_engine'; + + SSL_CTX_set_cookie_generate_cb_procname = 'SSL_CTX_set_cookie_generate_cb'; + SSL_CTX_set_cookie_verify_cb_procname = 'SSL_CTX_set_cookie_verify_cb'; + SSL_CTX_set_stateless_cookie_generate_cb_procname = 'SSL_CTX_set_stateless_cookie_generate_cb'; {introduced 1.1.0} + SSL_CTX_set_stateless_cookie_verify_cb_procname = 'SSL_CTX_set_stateless_cookie_verify_cb'; {introduced 1.1.0} + + //__owur TIdC_INT SSL_CTX_set_alpn_protos(ctx: PSSL_CTX, const Byte *protos, + // TIdC_UINT protos_len); + //__owur TIdC_INT SSL_set_alpn_protos(ssl: PSSL, const Byte *protos, + // TIdC_UINT protos_len); + + SSL_CTX_set_alpn_select_cb_procname = 'SSL_CTX_set_alpn_select_cb'; + SSL_get0_alpn_selected_procname = 'SSL_get0_alpn_selected'; + SSL_CTX_set_psk_client_callback_procname = 'SSL_CTX_set_psk_client_callback'; + SSL_set_psk_client_callback_procname = 'SSL_set_psk_client_callback'; + SSL_CTX_set_psk_server_callback_procname = 'SSL_CTX_set_psk_server_callback'; + SSL_set_psk_server_callback_procname = 'SSL_set_psk_server_callback'; + + //__owur TIdC_INT SSL_CTX_use_psk_identity_hint(ctx: PSSL_CTX, const PIdAnsiChar *identity_hint); + //__owur TIdC_INT SSL_use_psk_identity_hint(s: PSSL, const PIdAnsiChar *identity_hint); + //const PIdAnsiChar *SSL_get_psk_identity_hint(const s: PSSL); + //const PIdAnsiChar *SSL_get_psk_identity(const s: PSSL); + + SSL_set_psk_find_session_callback_procname = 'SSL_set_psk_find_session_callback'; {introduced 1.1.0} + SSL_CTX_set_psk_find_session_callback_procname = 'SSL_CTX_set_psk_find_session_callback'; {introduced 1.1.0} + SSL_set_psk_use_session_callback_procname = 'SSL_set_psk_use_session_callback'; {introduced 1.1.0} + SSL_CTX_set_psk_use_session_callback_procname = 'SSL_CTX_set_psk_use_session_callback'; {introduced 1.1.0} + + ///* Register callbacks to handle custom TLS Extensions for client or server. */ + + //__owur TIdC_INT SSL_CTX_has_client_custom_ext(const ctx: PSSL_CTX, + // TIdC_UINT ext_type); + // + //__owur TIdC_INT SSL_CTX_add_client_custom_ext(ctx: PSSL_CTX, + // TIdC_UINT ext_type, + // custom_ext_add_cb add_cb, + // custom_ext_free_cb free_cb, + // void *add_arg, + // custom_ext_parse_cb parse_cb, + // void *parse_arg); + // + //__owur TIdC_INT SSL_CTX_add_server_custom_ext(ctx: PSSL_CTX, + // TIdC_UINT ext_type, + // custom_ext_add_cb add_cb, + // custom_ext_free_cb free_cb, + // void *add_arg, + // custom_ext_parse_cb parse_cb, + // void *parse_arg); + // + //__owur TIdC_INT SSL_CTX_add_custom_ext(ctx: PSSL_CTX, TIdC_UINT ext_type, + // TIdC_UINT context, + // SSL_custom_ext_add_cb_ex add_cb, + // SSL_custom_ext_free_cb_ex free_cb, + // void *add_arg, + // SSL_custom_ext_parse_cb_ex parse_cb, + // void *parse_arg); + + //__owur TIdC_INT SSL_extension_supported(TIdC_UINT ext_type); + + + ///* These will only be used when doing non-blocking IO */ + //# define SSL_want_nothing(s) (SSL_want(s) == SSL_NOTHING) + //# define SSL_want_read(s) (SSL_want(s) == SSL_READING) + //# define SSL_want_write(s) (SSL_want(s) == SSL_WRITING) + //# define SSL_want_x509_lookup(s) (SSL_want(s) == SSL_X509_LOOKUP) + //# define SSL_want_async(s) (SSL_want(s) == SSL_ASYNC_PAUSED) + //# define SSL_want_async_job(s) (SSL_want(s) == SSL_ASYNC_NO_JOBS) + //# define SSL_want_client_hello_cb(s) (SSL_want(s) == SSL_CLIENT_HELLO_CB) + + (* + * SSL_CTX_set_keylog_callback configures a callback to log key material. This + * is intended for debugging use with tools like Wireshark. The cb function + * should log line followed by a newline. + *) + SSL_CTX_set_keylog_callback_procname = 'SSL_CTX_set_keylog_callback'; {introduced 1.1.0} + (* + * SSL_CTX_get_keylog_callback returns the callback configured by + * SSL_CTX_set_keylog_callback. + *) + SSL_CTX_get_keylog_callback_procname = 'SSL_CTX_get_keylog_callback'; {introduced 1.1.0} + SSL_CTX_set_max_early_data_procname = 'SSL_CTX_set_max_early_data'; {introduced 1.1.0} + SSL_CTX_get_max_early_data_procname = 'SSL_CTX_get_max_early_data'; {introduced 1.1.0} + SSL_set_max_early_data_procname = 'SSL_set_max_early_data'; {introduced 1.1.0} + SSL_get_max_early_data_procname = 'SSL_get_max_early_data'; {introduced 1.1.0} + SSL_CTX_set_recv_max_early_data_procname = 'SSL_CTX_set_recv_max_early_data'; {introduced 1.1.0} + SSL_CTX_get_recv_max_early_data_procname = 'SSL_CTX_get_recv_max_early_data'; {introduced 1.1.0} + SSL_set_recv_max_early_data_procname = 'SSL_set_recv_max_early_data'; {introduced 1.1.0} + SSL_get_recv_max_early_data_procname = 'SSL_get_recv_max_early_data'; {introduced 1.1.0} + + ///* + // * These need to be after the above set of includes due to a compiler bug + // * in_ VisualStudio 2015 + // */ + //DEFINE_STACK_OF_CONST(SSL_CIPHER) + //DEFINE_STACK_OF(SSL_COMP) + + ///* compatibility */ + //# define SSL_set_app_data(s,arg) (SSL_set_ex_data(s,0,(PIdAnsiChar *)(arg))) + //# define SSL_get_app_data(s) (SSL_get_ex_data(s,0)) + //# define SSL_SESSION_set_app_data(s,a) (SSL_SESSION_set_ex_data(s,0, \ + // (PIdAnsiChar *)(a))) + //# define SSL_SESSION_get_app_data(s) (SSL_SESSION_get_ex_data(s,0)) + //# define SSL_CTX_get_app_data(ctx) (SSL_CTX_get_ex_data(ctx,0)) + //# define SSL_CTX_set_app_data(ctx,arg) (SSL_CTX_set_ex_data(ctx,0, \ + // (PIdAnsiChar *)(arg))) + SSL_get_app_data_procname = 'SSL_get_app_data'; {removed 1.0.0} + SSL_set_app_data_procname = 'SSL_set_app_data'; {removed 1.0.0} + + ///* Is the SSL_connection established? */ + //# define SSL_in_connect_init(a) (SSL_in_init(a) && !SSL_is_server(a)) + //# define SSL_in_accept_init(a) (SSL_in_init(a) && SSL_is_server(a)) + SSL_in_init_procname = 'SSL_in_init'; {introduced 1.1.0} + SSL_in_before_procname = 'SSL_in_before'; {introduced 1.1.0} + SSL_is_init_finished_procname = 'SSL_is_init_finished'; {introduced 1.1.0} + + (*- + * Obtain latest Finished message + * -- that we sent (SSL_get_finished) + * -- that we expected from peer (SSL_get_peer_finished). + * Returns length (0 == no Finished so far), copies up to 'count' bytes. + *) + SSL_get_finished_procname = 'SSL_get_finished'; + SSL_get_peer_finished_procname = 'SSL_get_peer_finished'; + + //# if OPENSSL_API_COMPAT < 0x10100000L + //# define OpenSSL_add_ssl_algorithms() SSL_library_init() + //# define SSLeay_add_ssl_algorithms() SSL_library_init() + //# endif + SSLeay_add_ssl_algorithms_procname = 'SSLeay_add_ssl_algorithms'; {removed 1.0.0} + + ///* More backward compatibility */ + //# define SSL_get_cipher(s) \ + // SSL_CIPHER_get_name(SSL_get_current_cipher(s)) + //# define SSL_get_cipher_bits(s,np) \ + // SSL_CIPHER_get_bits(SSL_get_current_cipher(s),np) + //# define SSL_get_cipher_version(s) \ + // SSL_CIPHER_get_version(SSL_get_current_cipher(s)) + //# define SSL_get_cipher_name(s) \ + // SSL_CIPHER_get_name(SSL_get_current_cipher(s)) + //# define SSL_get_time(a) SSL_SESSION_get_time(a) + //# define SSL_set_time(a,b) SSL_SESSION_set_time((a),(b)) + //# define SSL_get_timeout(a) SSL_SESSION_get_timeout(a) + //# define SSL_set_timeout(a,b) SSL_SESSION_set_timeout((a),(b)) + // + //# define d2i_SSL_SESSION_bio(bp,s_id) ASN1_d2i_bio_of(SSL_SESSION,SSL_SESSION_new,d2i_SSL_SESSION,bp,s_id) + //# define i2d_SSL_SESSION_bio(bp,s_id) ASN1_i2d_bio_of(SSL_SESSION,i2d_SSL_SESSION,bp,s_id) + + //DECLARE_PEM_rw(SSL_SESSION, SSL_SESSION) + + //# define DTLSv1_get_timeout(ssl, arg) \ + // SSL_ctrl(ssl,DTLS_CTRL_GET_TIMEOUT,0, (void *)(arg)) + //# define DTLSv1_handle_timeout(ssl) \ + // SSL_ctrl(ssl,DTLS_CTRL_HANDLE_TIMEOUT,0, NULL) + // + ///* Backwards compatibility, original 1.1.0 names */ + //# define SSL_CTRL_GET_SERVER_TMP_KEY \ + // SSL_CTRL_GET_PEER_TMP_KEY + //# define SSL_get_server_tmp_key(s, pk) \ + // SSL_get_peer_tmp_key(s, pk) + + //# if OPENSSL_API_COMPAT < 0x10100000L + //const SSL_CTX_need_tmp_RSA = (ctx) 0; + //const SSL_CTX_set_tmp_rsa = (ctx;rsa) 1; + //const SSL_need_tmp_RSA = (ssl) 0; + //const SSL_set_tmp_rsa = (ssl;rsa) 1; + + //# define SSL_CTX_set_ecdh_auto(dummy, onoff) ((onoff) != 0) + //# define SSL_set_ecdh_auto(dummy, onoff) ((onoff) != 0) + ///* + // * We 'pretend' to call the callback to avoid warnings about unused static + // * functions. + // */ + //# define SSL_CTX_set_tmp_rsa_callback(ctx, cb) while(0) (cb)(NULL, 0, 0) + //# define SSL_set_tmp_rsa_callback(ssl, cb) while(0) (cb)(NULL, 0, 0) + //# endif + // + BIO_f_ssl_procname = 'BIO_f_ssl'; + BIO_new_ssl_procname = 'BIO_new_ssl'; + BIO_new_ssl_connect_procname = 'BIO_new_ssl_connect'; + BIO_new_buffer_ssl_connect_procname = 'BIO_new_buffer_ssl_connect'; + BIO_ssl_copy_session_id_procname = 'BIO_ssl_copy_session_id'; + + SSL_CTX_set_cipher_list_procname = 'SSL_CTX_set_cipher_list'; + SSL_CTX_new_procname = 'SSL_CTX_new'; + SSL_CTX_set_timeout_procname = 'SSL_CTX_set_timeout'; + SSL_CTX_get_timeout_procname = 'SSL_CTX_get_timeout'; + SSL_CTX_get_cert_store_procname = 'SSL_CTX_get_cert_store'; + SSL_want_procname = 'SSL_want'; + SSL_clear_procname = 'SSL_clear'; + + BIO_ssl_shutdown_procname = 'BIO_ssl_shutdown'; + SSL_CTX_up_ref_procname = 'SSL_CTX_up_ref'; {introduced 1.1.0} + SSL_CTX_free_procname = 'SSL_CTX_free'; + SSL_CTX_set_cert_store_procname = 'SSL_CTX_set_cert_store'; + SSL_CTX_set1_cert_store_procname = 'SSL_CTX_set1_cert_store'; {introduced 1.1.0} + + SSL_CTX_flush_sessions_procname = 'SSL_CTX_flush_sessions'; + + SSL_get_current_cipher_procname = 'SSL_get_current_cipher'; + SSL_get_pending_cipher_procname = 'SSL_get_pending_cipher'; {introduced 1.1.0} + SSL_CIPHER_get_bits_procname = 'SSL_CIPHER_get_bits'; + SSL_CIPHER_get_version_procname = 'SSL_CIPHER_get_version'; + SSL_CIPHER_get_name_procname = 'SSL_CIPHER_get_name'; + SSL_CIPHER_standard_name_procname = 'SSL_CIPHER_standard_name'; {introduced 1.1.0} + OPENSSL_cipher_name_procname = 'OPENSSL_cipher_name'; {introduced 1.1.0} + SSL_CIPHER_get_id_procname = 'SSL_CIPHER_get_id'; + SSL_CIPHER_get_protocol_id_procname = 'SSL_CIPHER_get_protocol_id'; {introduced 1.1.0} + SSL_CIPHER_get_kx_nid_procname = 'SSL_CIPHER_get_kx_nid'; {introduced 1.1.0} + SSL_CIPHER_get_auth_nid_procname = 'SSL_CIPHER_get_auth_nid'; {introduced 1.1.0} + SSL_CIPHER_get_handshake_digest_procname = 'SSL_CIPHER_get_handshake_digest'; {introduced 1.1.0} + SSL_CIPHER_is_aead_procname = 'SSL_CIPHER_is_aead'; {introduced 1.1.0} + + SSL_get_fd_procname = 'SSL_get_fd'; + SSL_get_rfd_procname = 'SSL_get_rfd'; + SSL_get_wfd_procname = 'SSL_get_wfd'; + SSL_get_cipher_list_procname = 'SSL_get_cipher_list'; + SSL_get_shared_ciphers_procname = 'SSL_get_shared_ciphers'; + SSL_get_read_ahead_procname = 'SSL_get_read_ahead'; + SSL_pending_procname = 'SSL_pending'; + SSL_has_pending_procname = 'SSL_has_pending'; {introduced 1.1.0} + SSL_set_fd_procname = 'SSL_set_fd'; + SSL_set_rfd_procname = 'SSL_set_rfd'; + SSL_set_wfd_procname = 'SSL_set_wfd'; + SSL_set0_rbio_procname = 'SSL_set0_rbio'; {introduced 1.1.0} + SSL_set0_wbio_procname = 'SSL_set0_wbio'; {introduced 1.1.0} + SSL_set_bio_procname = 'SSL_set_bio'; + SSL_get_rbio_procname = 'SSL_get_rbio'; + SSL_get_wbio_procname = 'SSL_get_wbio'; + SSL_set_cipher_list_procname = 'SSL_set_cipher_list'; + SSL_CTX_set_ciphersuites_procname = 'SSL_CTX_set_ciphersuites'; {introduced 1.1.0} + SSL_set_ciphersuites_procname = 'SSL_set_ciphersuites'; {introduced 1.1.0} + SSL_get_verify_mode_procname = 'SSL_get_verify_mode'; + SSL_get_verify_depth_procname = 'SSL_get_verify_depth'; + SSL_get_verify_callback_procname = 'SSL_get_verify_callback'; + SSL_set_read_ahead_procname = 'SSL_set_read_ahead'; + SSL_set_verify_procname = 'SSL_set_verify'; + SSL_set_verify_depth_procname = 'SSL_set_verify_depth'; + //void SSL_set_cert_cb(s: PSSL, TIdC_INT (*cb) (ssl: PSSL, void *arg), void *arg); + + SSL_use_RSAPrivateKey_procname = 'SSL_use_RSAPrivateKey'; + SSL_use_RSAPrivateKey_ASN1_procname = 'SSL_use_RSAPrivateKey_ASN1'; + SSL_use_PrivateKey_procname = 'SSL_use_PrivateKey'; + SSL_use_PrivateKey_ASN1_procname = 'SSL_use_PrivateKey_ASN1'; + SSL_use_certificate_procname = 'SSL_use_certificate'; + SSL_use_certificate_ASN1_procname = 'SSL_use_certificate_ASN1'; + //__owur TIdC_INT SSL_use_cert_and_key(ssl: PSSL, x509: PX509, EVP_PKEY *privatekey, + // STACK_OF(X509) *chain, TIdC_INT override); + + (* Set serverinfo data for the current active cert. *) + SSL_CTX_use_serverinfo_procname = 'SSL_CTX_use_serverinfo'; + SSL_CTX_use_serverinfo_ex_procname = 'SSL_CTX_use_serverinfo_ex'; {introduced 1.1.0} + SSL_CTX_use_serverinfo_file_procname = 'SSL_CTX_use_serverinfo_file'; + + SSL_use_RSAPrivateKey_file_procname = 'SSL_use_RSAPrivateKey_file'; + + SSL_use_PrivateKey_file_procname = 'SSL_use_PrivateKey_file'; + SSL_use_certificate_file_procname = 'SSL_use_certificate_file'; + + SSL_CTX_use_RSAPrivateKey_file_procname = 'SSL_CTX_use_RSAPrivateKey_file'; + + SSL_CTX_use_PrivateKey_file_procname = 'SSL_CTX_use_PrivateKey_file'; + SSL_CTX_use_certificate_file_procname = 'SSL_CTX_use_certificate_file'; + (* PEM type *) + SSL_CTX_use_certificate_chain_file_procname = 'SSL_CTX_use_certificate_chain_file'; + SSL_use_certificate_chain_file_procname = 'SSL_use_certificate_chain_file'; {introduced 1.1.0} + SSL_load_client_CA_file_procname = 'SSL_load_client_CA_file'; + SSL_add_file_cert_subjects_to_stack_procname = 'SSL_add_file_cert_subjects_to_stack'; + SSL_add_dir_cert_subjects_to_stack_procname = 'SSL_add_dir_cert_subjects_to_stack'; + + //# if OPENSSL_API_COMPAT < 0x10100000L + //# define SSL_load_error_strings() \ + // OPENSSL_init_ssl(OPENSSL_INIT_LOAD_SSL_STRINGS \ + // | OPENSSL_INIT_LOAD_CRYPTO_STRINGS, NULL) + //# endif + SSL_load_error_strings_procname = 'SSL_load_error_strings'; {removed 1.1.0} + + SSL_state_string_procname = 'SSL_state_string'; + SSL_rstate_string_procname = 'SSL_rstate_string'; + SSL_state_string_long_procname = 'SSL_state_string_long'; + SSL_rstate_string_long_procname = 'SSL_rstate_string_long'; + SSL_SESSION_get_time_procname = 'SSL_SESSION_get_time'; + SSL_SESSION_set_time_procname = 'SSL_SESSION_set_time'; + SSL_SESSION_get_timeout_procname = 'SSL_SESSION_get_timeout'; + SSL_SESSION_set_timeout_procname = 'SSL_SESSION_set_timeout'; + SSL_SESSION_get_protocol_version_procname = 'SSL_SESSION_get_protocol_version'; {introduced 1.1.0} + SSL_SESSION_set_protocol_version_procname = 'SSL_SESSION_set_protocol_version'; {introduced 1.1.0} + + SSL_SESSION_get0_hostname_procname = 'SSL_SESSION_get0_hostname'; {introduced 1.1.0} + SSL_SESSION_set1_hostname_procname = 'SSL_SESSION_set1_hostname'; {introduced 1.1.0} + SSL_SESSION_get0_alpn_selected_procname = 'SSL_SESSION_get0_alpn_selected'; {introduced 1.1.0} + SSL_SESSION_set1_alpn_selected_procname = 'SSL_SESSION_set1_alpn_selected'; {introduced 1.1.0} + SSL_SESSION_get0_cipher_procname = 'SSL_SESSION_get0_cipher'; {introduced 1.1.0} + SSL_SESSION_set_cipher_procname = 'SSL_SESSION_set_cipher'; {introduced 1.1.0} + SSL_SESSION_has_ticket_procname = 'SSL_SESSION_has_ticket'; {introduced 1.1.0} + SSL_SESSION_get_ticket_lifetime_hint_procname = 'SSL_SESSION_get_ticket_lifetime_hint'; {introduced 1.1.0} + SSL_SESSION_get0_ticket_procname = 'SSL_SESSION_get0_ticket'; {introduced 1.1.0} + SSL_SESSION_get_max_early_data_procname = 'SSL_SESSION_get_max_early_data'; {introduced 1.1.0} + SSL_SESSION_set_max_early_data_procname = 'SSL_SESSION_set_max_early_data'; {introduced 1.1.0} + SSL_copy_session_id_procname = 'SSL_copy_session_id'; + SSL_SESSION_get0_peer_procname = 'SSL_SESSION_get0_peer'; + SSL_SESSION_set1_id_context_procname = 'SSL_SESSION_set1_id_context'; + SSL_SESSION_set1_id_procname = 'SSL_SESSION_set1_id'; {introduced 1.1.0} + SSL_SESSION_is_resumable_procname = 'SSL_SESSION_is_resumable'; {introduced 1.1.0} + + SSL_SESSION_new_procname = 'SSL_SESSION_new'; + SSL_SESSION_dup_procname = 'SSL_SESSION_dup'; {introduced 1.1.0} + SSL_SESSION_get_id_procname = 'SSL_SESSION_get_id'; + SSL_SESSION_get0_id_context_procname = 'SSL_SESSION_get0_id_context'; {introduced 1.1.0} + SSL_SESSION_get_compress_id_procname = 'SSL_SESSION_get_compress_id'; + SSL_SESSION_print_procname = 'SSL_SESSION_print'; + SSL_SESSION_print_keylog_procname = 'SSL_SESSION_print_keylog'; {introduced 1.1.0} + SSL_SESSION_up_ref_procname = 'SSL_SESSION_up_ref'; {introduced 1.1.0} + SSL_SESSION_free_procname = 'SSL_SESSION_free'; + //__owur TIdC_INT i2d_SSL_SESSION(SSL_SESSION *in_, Byte **pp); + SSL_set_session_procname = 'SSL_set_session'; + SSL_CTX_add_session_procname = 'SSL_CTX_add_session'; + SSL_CTX_remove_session_procname = 'SSL_CTX_remove_session'; + SSL_CTX_set_generate_session_id_procname = 'SSL_CTX_set_generate_session_id'; + SSL_set_generate_session_id_procname = 'SSL_set_generate_session_id'; + SSL_has_matching_session_id_procname = 'SSL_has_matching_session_id'; + d2i_SSL_SESSION_procname = 'd2i_SSL_SESSION'; + + SSL_get_peer_certificate_procname = 'SSL_get_peer_certificate'; {removed 3.0.0} + + //__owur STACK_OF(X509) *SSL_get_peer_cert_chain(const s: PSSL); + // + SSL_CTX_get_verify_mode_procname = 'SSL_CTX_get_verify_mode'; + SSL_CTX_get_verify_depth_procname = 'SSL_CTX_get_verify_depth'; + SSL_CTX_get_verify_callback_procname = 'SSL_CTX_get_verify_callback'; + SSL_CTX_set_verify_procname = 'SSL_CTX_set_verify'; + SSL_CTX_set_verify_depth_procname = 'SSL_CTX_set_verify_depth'; + SSL_CTX_set_cert_verify_callback_procname = 'SSL_CTX_set_cert_verify_callback'; + SSL_CTX_set_cert_cb_procname = 'SSL_CTX_set_cert_cb'; + SSL_CTX_use_RSAPrivateKey_procname = 'SSL_CTX_use_RSAPrivateKey'; + SSL_CTX_use_RSAPrivateKey_ASN1_procname = 'SSL_CTX_use_RSAPrivateKey_ASN1'; + SSL_CTX_use_PrivateKey_procname = 'SSL_CTX_use_PrivateKey'; + SSL_CTX_use_PrivateKey_ASN1_procname = 'SSL_CTX_use_PrivateKey_ASN1'; + SSL_CTX_use_certificate_procname = 'SSL_CTX_use_certificate'; + SSL_CTX_use_certificate_ASN1_procname = 'SSL_CTX_use_certificate_ASN1'; + //function TIdC_INT SSL_CTX_use_cert_and_key(ctx: PSSL_CTX; x509: PX509; EVP_PKEY *privatekey; STACK_OF(X509) *chain; TIdC_INT override); + + SSL_CTX_set_default_passwd_cb_procname = 'SSL_CTX_set_default_passwd_cb'; {introduced 1.1.0} + SSL_CTX_set_default_passwd_cb_userdata_procname = 'SSL_CTX_set_default_passwd_cb_userdata'; {introduced 1.1.0} + SSL_CTX_get_default_passwd_cb_procname = 'SSL_CTX_get_default_passwd_cb'; {introduced 1.1.0} + SSL_CTX_get_default_passwd_cb_userdata_procname = 'SSL_CTX_get_default_passwd_cb_userdata'; {introduced 1.1.0} + SSL_set_default_passwd_cb_procname = 'SSL_set_default_passwd_cb'; {introduced 1.1.0} + SSL_set_default_passwd_cb_userdata_procname = 'SSL_set_default_passwd_cb_userdata'; {introduced 1.1.0} + SSL_get_default_passwd_cb_procname = 'SSL_get_default_passwd_cb'; {introduced 1.1.0} + SSL_get_default_passwd_cb_userdata_procname = 'SSL_get_default_passwd_cb_userdata'; {introduced 1.1.0} + + SSL_CTX_check_private_key_procname = 'SSL_CTX_check_private_key'; + SSL_check_private_key_procname = 'SSL_check_private_key'; + + SSL_CTX_set_session_id_context_procname = 'SSL_CTX_set_session_id_context'; + + SSL_new_procname = 'SSL_new'; + SSL_up_ref_procname = 'SSL_up_ref'; {introduced 1.1.0} + SSL_is_dtls_procname = 'SSL_is_dtls'; {introduced 1.1.0} + SSL_set_session_id_context_procname = 'SSL_set_session_id_context'; + + SSL_CTX_set_purpose_procname = 'SSL_CTX_set_purpose'; + SSL_set_purpose_procname = 'SSL_set_purpose'; + SSL_CTX_set_trust_procname = 'SSL_CTX_set_trust'; + SSL_set_trust_procname = 'SSL_set_trust'; + + SSL_set1_host_procname = 'SSL_set1_host'; {introduced 1.1.0} + SSL_add1_host_procname = 'SSL_add1_host'; {introduced 1.1.0} + SSL_get0_peername_procname = 'SSL_get0_peername'; {introduced 1.1.0} + SSL_set_hostflags_procname = 'SSL_set_hostflags'; {introduced 1.1.0} + + SSL_CTX_dane_enable_procname = 'SSL_CTX_dane_enable'; {introduced 1.1.0} + SSL_CTX_dane_mtype_set_procname = 'SSL_CTX_dane_mtype_set'; {introduced 1.1.0} + SSL_dane_enable_procname = 'SSL_dane_enable'; {introduced 1.1.0} + SSL_dane_tlsa_add_procname = 'SSL_dane_tlsa_add'; {introduced 1.1.0} + SSL_get0_dane_authority_procname = 'SSL_get0_dane_authority'; {introduced 1.1.0} + SSL_get0_dane_tlsa_procname = 'SSL_get0_dane_tlsa'; {introduced 1.1.0} + (* + * Bridge opacity barrier between libcrypt and libssl, also needed to support + * offline testing in test/danetest.c + *) + SSL_get0_dane_procname = 'SSL_get0_dane'; {introduced 1.1.0} + + (* + * DANE flags + *) + SSL_CTX_dane_set_flags_procname = 'SSL_CTX_dane_set_flags'; {introduced 1.1.0} + SSL_CTX_dane_clear_flags_procname = 'SSL_CTX_dane_clear_flags'; {introduced 1.1.0} + SSL_dane_set_flags_procname = 'SSL_dane_set_flags'; {introduced 1.1.0} + SSL_dane_clear_flags_procname = 'SSL_dane_clear_flags'; {introduced 1.1.0} + + SSL_CTX_set1_param_procname = 'SSL_CTX_set1_param'; + SSL_set1_param_procname = 'SSL_set1_param'; + + SSL_CTX_get0_param_procname = 'SSL_CTX_get0_param'; + SSL_get0_param_procname = 'SSL_get0_param'; + + SSL_CTX_set_srp_username_procname = 'SSL_CTX_set_srp_username'; + SSL_CTX_set_srp_password_procname = 'SSL_CTX_set_srp_password'; + SSL_CTX_set_srp_strength_procname = 'SSL_CTX_set_srp_strength'; + + SSL_CTX_set_srp_client_pwd_callback_procname = 'SSL_CTX_set_srp_client_pwd_callback'; + SSL_CTX_set_srp_verify_param_callback_procname = 'SSL_CTX_set_srp_verify_param_callback'; + SSL_CTX_set_srp_username_callback_procname = 'SSL_CTX_set_srp_username_callback'; + + SSL_CTX_set_srp_cb_arg_procname = 'SSL_CTX_set_srp_cb_arg'; + SSL_set_srp_server_param_procname = 'SSL_set_srp_server_param'; + SSL_set_srp_server_param_pw_procname = 'SSL_set_srp_server_param_pw'; + + //__owur BIGNUM *SSL_get_srp_g(s: PSSL); + //__owur BIGNUM *SSL_get_srp_N(s: PSSL); + // + //__owur PIdAnsiChar *SSL_get_srp_username(s: PSSL); + //__owur PIdAnsiChar *SSL_get_srp_userinfo(s: PSSL); + // + ///* + // * ClientHello callback and helpers. + // */ + SSL_CTX_set_client_hello_cb_procname = 'SSL_CTX_set_client_hello_cb'; {introduced 1.1.0} + SSL_client_hello_isv2_procname = 'SSL_client_hello_isv2'; {introduced 1.1.0} + SSL_client_hello_get0_legacy_version_procname = 'SSL_client_hello_get0_legacy_version'; {introduced 1.1.0} + SSL_client_hello_get0_random_procname = 'SSL_client_hello_get0_random'; {introduced 1.1.0} + SSL_client_hello_get0_session_id_procname = 'SSL_client_hello_get0_session_id'; {introduced 1.1.0} + SSL_client_hello_get0_ciphers_procname = 'SSL_client_hello_get0_ciphers'; {introduced 1.1.0} + SSL_client_hello_get0_compression_methods_procname = 'SSL_client_hello_get0_compression_methods'; {introduced 1.1.0} + SSL_client_hello_get1_extensions_present_procname = 'SSL_client_hello_get1_extensions_present'; {introduced 1.1.0} + SSL_client_hello_get0_ext_procname = 'SSL_client_hello_get0_ext'; {introduced 1.1.0} + SSL_certs_clear_procname = 'SSL_certs_clear'; + SSL_free_procname = 'SSL_free'; + + (* + * Windows application developer has to include windows.h to use these. + *) + SSL_waiting_for_async_procname = 'SSL_waiting_for_async'; {introduced 1.1.0} + SSL_get_all_async_fds_procname = 'SSL_get_all_async_fds'; {introduced 1.1.0} + SSL_get_changed_async_fds_procname = 'SSL_get_changed_async_fds'; {introduced 1.1.0} + SSL_accept_procname = 'SSL_accept'; + SSL_stateless_procname = 'SSL_stateless'; {introduced 1.1.0} + SSL_connect_procname = 'SSL_connect'; + SSL_read_procname = 'SSL_read'; + SSL_read_ex_procname = 'SSL_read_ex'; {introduced 1.1.0} + + SSL_read_early_data_procname = 'SSL_read_early_data'; {introduced 1.1.0} + SSL_peek_procname = 'SSL_peek'; + SSL_peek_ex_procname = 'SSL_peek_ex'; {introduced 1.1.0} + SSL_write_procname = 'SSL_write'; + SSL_write_ex_procname = 'SSL_write_ex'; {introduced 1.1.0} + SSL_write_early_data_procname = 'SSL_write_early_data'; {introduced 1.1.0} + SSL_callback_ctrl_procname = 'SSL_callback_ctrl'; + + SSL_ctrl_procname = 'SSL_ctrl'; + SSL_CTX_ctrl_procname = 'SSL_CTX_ctrl'; + SSL_CTX_callback_ctrl_procname = 'SSL_CTX_callback_ctrl'; + + SSL_get_early_data_status_procname = 'SSL_get_early_data_status'; {introduced 1.1.0} + + SSL_get_error_procname = 'SSL_get_error'; + SSL_get_version_procname = 'SSL_get_version'; + + (* This sets the 'default' SSL version that SSL_new() will create *) + SSL_CTX_set_ssl_version_procname = 'SSL_CTX_set_ssl_version'; + + ///* Negotiate highest available SSL/TLS version */ + TLS_method_procname = 'TLS_method'; {introduced 1.1.0} + TLS_server_method_procname = 'TLS_server_method'; {introduced 1.1.0} + TLS_client_method_procname = 'TLS_client_method'; {introduced 1.1.0} + + //__owur const SSL_METHOD *DTLS_method(void); /* DTLS 1.0 and 1.2 */ + //__owur const SSL_METHOD *DTLS_server_method(void); /* DTLS 1.0 and 1.2 */ + //__owur const SSL_METHOD *DTLS_client_method(void); /* DTLS 1.0 and 1.2 */ + // + //__owur TIdC_SIZET DTLS_get_data_mtu(const s: PSSL); + // + //__owur STACK_OF(SSL_CIPHER) *SSL_get_ciphers(const s: PSSL); + //__owur STACK_OF(SSL_CIPHER) *SSL_CTX_get_ciphers(const ctx: PSSL_CTX); + //__owur STACK_OF(SSL_CIPHER) *SSL_get_client_ciphers(const s: PSSL); + //__owur STACK_OF(SSL_CIPHER) *SSL_get1_supported_ciphers(s: PSSL); + // + //__owur TIdC_INT SSL_do_handshake(s: PSSL); + SSL_key_update_procname = 'SSL_key_update'; {introduced 1.1.0} + SSL_get_key_update_type_procname = 'SSL_get_key_update_type'; {introduced 1.1.0} + SSL_renegotiate_procname = 'SSL_renegotiate'; + SSL_renegotiate_abbreviated_procname = 'SSL_renegotiate_abbreviated'; + SSL_shutdown_procname = 'SSL_shutdown'; + SSL_CTX_set_post_handshake_auth_procname = 'SSL_CTX_set_post_handshake_auth'; {introduced 1.1.0} + SSL_set_post_handshake_auth_procname = 'SSL_set_post_handshake_auth'; {introduced 1.1.0} + + SSL_renegotiate_pending_procname = 'SSL_renegotiate_pending'; + SSL_verify_client_post_handshake_procname = 'SSL_verify_client_post_handshake'; {introduced 1.1.0} + + SSL_CTX_get_ssl_method_procname = 'SSL_CTX_get_ssl_method'; + SSL_get_ssl_method_procname = 'SSL_get_ssl_method'; + SSL_set_ssl_method_procname = 'SSL_set_ssl_method'; + SSL_alert_type_string_long_procname = 'SSL_alert_type_string_long'; + SSL_alert_type_string_procname = 'SSL_alert_type_string'; + SSL_alert_desc_string_long_procname = 'SSL_alert_desc_string_long'; + SSL_alert_desc_string_procname = 'SSL_alert_desc_string'; + + //void SSL_set0_CA_list(s: PSSL, STACK_OF(X509_NAME) *name_list); + //void SSL_CTX_set0_CA_list(ctx: PSSL_CTX, STACK_OF(X509_NAME) *name_list); + //__owur const STACK_OF(X509_NAME) *SSL_get0_CA_list(const s: PSSL); + //__owur const STACK_OF(X509_NAME) *SSL_CTX_get0_CA_list(const ctx: PSSL_CTX); + //__owur TIdC_INT SSL_add1_to_CA_list(ssl: PSSL, const X509 *x); + //__owur TIdC_INT SSL_CTX_add1_to_CA_list(ctx: PSSL_CTX, const X509 *x); + //__owur const STACK_OF(X509_NAME) *SSL_get0_peer_CA_list(const s: PSSL); + + //void SSL_set_client_CA_list(s: PSSL, STACK_OF(X509_NAME) *name_list); + //void SSL_CTX_set_client_CA_list(ctx: PSSL_CTX, STACK_OF(X509_NAME) *name_list); + //__owur STACK_OF(X509_NAME) *SSL_get_client_CA_list(const s: PSSL); + //__owur STACK_OF(X509_NAME) *SSL_CTX_get_client_CA_list(const SSL_CTX *s); + + SSL_CTX_set_client_CA_list_procname = 'SSL_CTX_set_client_CA_list'; + SSL_add_client_CA_procname = 'SSL_add_client_CA'; + SSL_CTX_add_client_CA_procname = 'SSL_CTX_add_client_CA'; + + SSL_set_connect_state_procname = 'SSL_set_connect_state'; + SSL_set_accept_state_procname = 'SSL_set_accept_state'; + + //__owur TIdC_LONG SSL_get_default_timeout(const s: PSSL); + // + //# if OPENSSL_API_COMPAT < 0x10100000L + //# define SSL_library_init() OPENSSL_init_ssl(0, NULL) + //# endif + SSL_library_init_procname = 'SSL_library_init'; {removed 1.1.0} + + //__owur PIdAnsiChar *SSL_CIPHER_description(const SSL_CIPHER *, PIdAnsiChar *buf, TIdC_INT size); + //__owur STACK_OF(X509_NAME) *SSL_dup_CA_list(const STACK_OF(X509_NAME) *sk); + SSL_CIPHER_description_procname = 'SSL_CIPHER_description'; + + SSL_dup_procname = 'SSL_dup'; + + SSL_get_certificate_procname = 'SSL_get_certificate'; + (* + * EVP_PKEY + *) + SSL_get_privatekey_procname = 'SSL_get_privatekey'; + + SSL_CTX_get0_certificate_procname = 'SSL_CTX_get0_certificate'; + SSL_CTX_get0_privatekey_procname = 'SSL_CTX_get0_privatekey'; + + SSL_CTX_set_quiet_shutdown_procname = 'SSL_CTX_set_quiet_shutdown'; + SSL_CTX_get_quiet_shutdown_procname = 'SSL_CTX_get_quiet_shutdown'; + SSL_set_quiet_shutdown_procname = 'SSL_set_quiet_shutdown'; + SSL_get_quiet_shutdown_procname = 'SSL_get_quiet_shutdown'; + SSL_set_shutdown_procname = 'SSL_set_shutdown'; + SSL_get_shutdown_procname = 'SSL_get_shutdown'; + SSL_version_procname = 'SSL_version'; + SSL_client_version_procname = 'SSL_client_version'; {introduced 1.1.0} + SSL_CTX_set_default_verify_paths_procname = 'SSL_CTX_set_default_verify_paths'; + SSL_CTX_set_default_verify_dir_procname = 'SSL_CTX_set_default_verify_dir'; {introduced 1.1.0} + SSL_CTX_set_default_verify_file_procname = 'SSL_CTX_set_default_verify_file'; {introduced 1.1.0} + SSL_CTX_load_verify_locations_procname = 'SSL_CTX_load_verify_locations'; + //# define SSL_get0_session SSL_get_session/* just peek at pointer */ + SSL_get_session_procname = 'SSL_get_session'; + (* obtain a reference count *) + SSL_get1_session_procname = 'SSL_get1_session'; + SSL_get_SSL_CTX_procname = 'SSL_get_SSL_CTX'; + SSL_set_SSL_CTX_procname = 'SSL_set_SSL_CTX'; + SSL_set_info_callback_procname = 'SSL_set_info_callback'; + SSL_get_info_callback_procname = 'SSL_get_info_callback'; + SSL_get_state_procname = 'SSL_get_state'; {introduced 1.1.0} + + SSL_set_verify_result_procname = 'SSL_set_verify_result'; + SSL_get_verify_result_procname = 'SSL_get_verify_result'; + //__owur STACK_OF(X509) *SSL_get0_verified_chain(const s: PSSL); + + SSL_get_client_random_procname = 'SSL_get_client_random'; {introduced 1.1.0} + SSL_get_server_random_procname = 'SSL_get_server_random'; {introduced 1.1.0} + SSL_SESSION_get_master_key_procname = 'SSL_SESSION_get_master_key'; {introduced 1.1.0} + SSL_SESSION_set1_master_key_procname = 'SSL_SESSION_set1_master_key'; {introduced 1.1.0} + SSL_SESSION_get_max_fragment_length_procname = 'SSL_SESSION_get_max_fragment_length'; {introduced 1.1.0} + + //#define SSL_get_ex_new_index(l, p, newf, dupf, freef) \ + // CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_SSL, l, p, newf, dupf, freef) + SSL_set_ex_data_procname = 'SSL_set_ex_data'; + SSL_get_ex_data_procname = 'SSL_get_ex_data'; + //#define SSL_SESSION_get_ex_new_index(l, p, newf, dupf, freef) \ + // CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_SSL_SESSION, l, p, newf, dupf, freef) + SSL_SESSION_set_ex_data_procname = 'SSL_SESSION_set_ex_data'; + SSL_SESSION_get_ex_data_procname = 'SSL_SESSION_get_ex_data'; + //#define SSL_CTX_get_ex_new_index(l, p, newf, dupf, freef) \ + // CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_SSL_CTX, l, p, newf, dupf, freef) + SSL_CTX_set_ex_data_procname = 'SSL_CTX_set_ex_data'; + SSL_CTX_get_ex_data_procname = 'SSL_CTX_get_ex_data'; + + SSL_get_ex_data_X509_STORE_CTX_idx_procname = 'SSL_get_ex_data_X509_STORE_CTX_idx'; + + //# define SSL_CTX_get_default_read_ahead(ctx) SSL_CTX_get_read_ahead(ctx) + //# define SSL_CTX_set_default_read_ahead(ctx,m) SSL_CTX_set_read_ahead(ctx,m) + //# define SSL_CTX_get_read_ahead(ctx) \ + // SSL_CTX_ctrl(ctx,SSL_CTRL_GET_READ_AHEAD,0,NULL) + //# define SSL_CTX_set_read_ahead(ctx,m) \ + // SSL_CTX_ctrl(ctx,SSL_CTRL_SET_READ_AHEAD,m,NULL) + //# define SSL_CTX_get_max_cert_list(ctx) \ + // SSL_CTX_ctrl(ctx,SSL_CTRL_GET_MAX_CERT_LIST,0,NULL) + //# define SSL_CTX_set_max_cert_list(ctx,m) \ + // SSL_CTX_ctrl(ctx,SSL_CTRL_SET_MAX_CERT_LIST,m,NULL) + //# define SSL_get_max_cert_list(ssl) \ + // SSL_ctrl(ssl,SSL_CTRL_GET_MAX_CERT_LIST,0,NULL) + //# define SSL_set_max_cert_list(ssl,m) \ + // SSL_ctrl(ssl,SSL_CTRL_SET_MAX_CERT_LIST,m,NULL) + // + //# define SSL_CTX_set_max_send_fragment(ctx,m) \ + // SSL_CTX_ctrl(ctx,SSL_CTRL_SET_MAX_SEND_FRAGMENT,m,NULL) + //# define SSL_set_max_send_fragment(ssl,m) \ + // SSL_ctrl(ssl,SSL_CTRL_SET_MAX_SEND_FRAGMENT,m,NULL) + //# define SSL_CTX_set_split_send_fragment(ctx,m) \ + // SSL_CTX_ctrl(ctx,SSL_CTRL_SET_SPLIT_SEND_FRAGMENT,m,NULL) + //# define SSL_set_split_send_fragment(ssl,m) \ + // SSL_ctrl(ssl,SSL_CTRL_SET_SPLIT_SEND_FRAGMENT,m,NULL) + //# define SSL_CTX_set_max_pipelines(ctx,m) \ + // SSL_CTX_ctrl(ctx,SSL_CTRL_SET_MAX_PIPELINES,m,NULL) + //# define SSL_set_max_pipelines(ssl,m) \ + // SSL_ctrl(ssl,SSL_CTRL_SET_MAX_PIPELINES,m,NULL) + + SSL_CTX_set_default_read_buffer_len_procname = 'SSL_CTX_set_default_read_buffer_len'; {introduced 1.1.0} + SSL_set_default_read_buffer_len_procname = 'SSL_set_default_read_buffer_len'; {introduced 1.1.0} + + SSL_CTX_set_tmp_dh_callback_procname = 'SSL_CTX_set_tmp_dh_callback'; + SSL_set_tmp_dh_callback_procname = 'SSL_set_tmp_dh_callback'; + + //__owur const COMP_METHOD *SSL_get_current_compression(const s: PSSL); + //__owur const COMP_METHOD *SSL_get_current_expansion(const s: PSSL); + //__owur const PIdAnsiChar *SSL_COMP_get_name(const COMP_METHOD *comp); + //__owur const PIdAnsiChar *SSL_COMP_get0_name(const SSL_COMP *comp); + //__owur TIdC_INT SSL_COMP_get_id(const SSL_COMP *comp); + //STACK_OF(SSL_COMP) *SSL_COMP_get_compression_methods(void); + //__owur STACK_OF(SSL_COMP) *SSL_COMP_set0_compression_methods(STACK_OF(SSL_COMP) + // *meths); + //# if OPENSSL_API_COMPAT < 0x10100000L + //# define SSL_COMP_free_compression_methods() while(0) continue + //# endif + //__owur TIdC_INT SSL_COMP_add_compression_method(TIdC_INT id, COMP_METHOD *cm); + + SSL_CIPHER_find_procname = 'SSL_CIPHER_find'; + SSL_CIPHER_get_cipher_nid_procname = 'SSL_CIPHER_get_cipher_nid'; {introduced 1.1.0} + SSL_CIPHER_get_digest_nid_procname = 'SSL_CIPHER_get_digest_nid'; {introduced 1.1.0} + //TIdC_INT SSL_bytes_to_cipher_list(s: PSSL, const Byte *bytes, TIdC_SIZET len, + // TIdC_INT isv2format, STACK_OF(SSL_CIPHER) **sk, + // STACK_OF(SSL_CIPHER) **scsvs); + + (* TLS extensions functions *) + SSL_set_session_ticket_ext_procname = 'SSL_set_session_ticket_ext'; + // + SSL_set_session_ticket_ext_cb_procname = 'SSL_set_session_ticket_ext_cb'; + + ///* Pre-shared secret session resumption functions */ + //__owur TIdC_INT SSL_set_session_secret_cb(s: PSSL, + // tls_session_secret_cb_fn session_secret_cb, + // void *arg); + + SSL_CTX_set_not_resumable_session_callback_procname = 'SSL_CTX_set_not_resumable_session_callback'; {introduced 1.1.0} + SSL_set_not_resumable_session_callback_procname = 'SSL_set_not_resumable_session_callback'; {introduced 1.1.0} + SSL_CTX_set_record_padding_callback_procname = 'SSL_CTX_set_record_padding_callback'; {introduced 1.1.0} + + SSL_CTX_set_record_padding_callback_arg_procname = 'SSL_CTX_set_record_padding_callback_arg'; {introduced 1.1.0} + SSL_CTX_get_record_padding_callback_arg_procname = 'SSL_CTX_get_record_padding_callback_arg'; {introduced 1.1.0} + SSL_CTX_set_block_padding_procname = 'SSL_CTX_set_block_padding'; {introduced 1.1.0} + + SSL_set_record_padding_callback_procname = 'SSL_set_record_padding_callback'; {introduced 1.1.0} + + SSL_set_record_padding_callback_arg_procname = 'SSL_set_record_padding_callback_arg'; {introduced 1.1.0} + SSL_get_record_padding_callback_arg_procname = 'SSL_get_record_padding_callback_arg'; {introduced 1.1.0} + SSL_set_block_padding_procname = 'SSL_set_block_padding'; {introduced 1.1.0} + SSL_set_num_tickets_procname = 'SSL_set_num_tickets'; {introduced 1.1.0} + SSL_get_num_tickets_procname = 'SSL_get_num_tickets'; {introduced 1.1.0} + SSL_CTX_set_num_tickets_procname = 'SSL_CTX_set_num_tickets'; {introduced 1.1.0} + SSL_CTX_get_num_tickets_procname = 'SSL_CTX_get_num_tickets'; {introduced 1.1.0} + + //# if OPENSSL_API_COMPAT < 0x10100000L + //# define SSL_cache_hit(s) SSL_session_reused(s) + //# endif + + SSL_session_reused_procname = 'SSL_session_reused'; {introduced 1.1.0} + SSL_is_server_procname = 'SSL_is_server'; + + SSL_CONF_CTX_new_procname = 'SSL_CONF_CTX_new'; + SSL_CONF_CTX_finish_procname = 'SSL_CONF_CTX_finish'; + SSL_CONF_CTX_free_procname = 'SSL_CONF_CTX_free'; + SSL_CONF_CTX_set_flags_procname = 'SSL_CONF_CTX_set_flags'; + SSL_CONF_CTX_clear_flags_procname = 'SSL_CONF_CTX_clear_flags'; + SSL_CONF_CTX_set1_prefix_procname = 'SSL_CONF_CTX_set1_prefix'; + SSL_CONF_cmd_procname = 'SSL_CONF_cmd'; + SSL_CONF_cmd_argv_procname = 'SSL_CONF_cmd_argv'; + SSL_CONF_cmd_value_type_procname = 'SSL_CONF_cmd_value_type'; + + SSL_CONF_CTX_set_ssl_procname = 'SSL_CONF_CTX_set_ssl'; + SSL_CONF_CTX_set_ssl_ctx_procname = 'SSL_CONF_CTX_set_ssl_ctx'; + SSL_add_ssl_module_procname = 'SSL_add_ssl_module'; {introduced 1.1.0} + SSL_config_procname = 'SSL_config'; {introduced 1.1.0} + SSL_CTX_config_procname = 'SSL_CTX_config'; {introduced 1.1.0} + +// procedure SSL_trace(write_p: TIdC_INT; version: TIdC_INT; content_type: TIdC_INT; const buf: Pointer; len: TIdC_SIZET; ssl: PSSL; arg: Pointer); + + DTLSv1_listen_procname = 'DTLSv1_listen'; {introduced 1.1.0} + + //# ifndef OPENSSL_NO_CT + // + ///* + // * A callback for verifying that the received SCTs are sufficient. + // * Expected to return 1 if they are sufficient, otherwise 0. + // * May return a negative integer if an error occurs. + // * A connection should be aborted if the SCTs are deemed insufficient. + // */ + //typedef TIdC_INT (*ssl_ct_validation_cb)(const CT_POLICY_EVAL_CTX *ctx, + // const STACK_OF(SCT) *scts, void *arg); + + ///* + // * Sets a |callback| that is invoked upon receipt of ServerHelloDone to validate + // * the received SCTs. + // * If the callback returns a non-positive result, the connection is terminated. + // * Call this function before beginning a handshake. + // * If a NULL |callback| is provided, SCT validation is disabled. + // * |arg| is arbitrary userdata that will be passed to the callback whenever it + // * is invoked. Ownership of |arg| remains with the caller. + // * + // * NOTE: A side-effect of setting a CT callback is that an OCSP stapled response + // * will be requested. + // */ + //function SSL_set_ct_validation_callback(s: PSSL; callback: ssl_ct_validation_cb; arg: Pointer): TIdC_INT; + //function SSL_CTX_set_ct_validation_callback(ctx: PSSL_CTX; callback: ssl_ct_validation_cb; arg: Pointer): TIdC_INT; + + //#define SSL_disable_ct(s) \ + // ((void) SSL_set_validation_callback((s), NULL, NULL)) + //#define SSL_CTX_disable_ct(ctx) \ + // ((void) SSL_CTX_set_validation_callback((ctx), NULL, NULL)) + + ///* + // * The validation type enumerates the available behaviours of the built-in SSL + // * CT validation callback selected via SSL_enable_ct() and SSL_CTX_enable_ct(). + // * The underlying callback is a static function in_ libssl. + // */ + + ///* + // * Enable CT by setting up a callback that implements one of the built-in + // * validation variants. The SSL_CT_VALIDATION_PERMISSIVE variant always + // * continues the handshake, the application can make appropriate decisions at + // * handshake completion. The SSL_CT_VALIDATION_STRICT variant requires at + // * least one valid SCT, or else handshake termination will be requested. The + // * handshake may continue anyway if SSL_VERIFY_NONE is in_ effect. + // */ + SSL_enable_ct_procname = 'SSL_enable_ct'; {introduced 1.1.0} + SSL_CTX_enable_ct_procname = 'SSL_CTX_enable_ct'; {introduced 1.1.0} + + ///* + // * Report whether a non-NULL callback is enabled. + // */ + SSL_ct_is_enabled_procname = 'SSL_ct_is_enabled'; {introduced 1.1.0} + SSL_CTX_ct_is_enabled_procname = 'SSL_CTX_ct_is_enabled'; {introduced 1.1.0} + + ///* Gets the SCTs received from a connection */ + //const STACK_OF(SCT) *SSL_get0_peer_scts(s: PSSL); + + SSL_CTX_set_default_ctlog_list_file_procname = 'SSL_CTX_set_default_ctlog_list_file'; {introduced 1.1.0} + SSL_CTX_set_ctlog_list_file_procname = 'SSL_CTX_set_ctlog_list_file'; {introduced 1.1.0} + SSL_CTX_set0_ctlog_store_procname = 'SSL_CTX_set0_ctlog_store'; {introduced 1.1.0} + + // const CTLOG_STORE *SSL_CTX_get0_ctlog_store(const ctx: PSSL_CTX); + + // # endif /* OPENSSL_NO_CT */ + + SSL_set_security_level_procname = 'SSL_set_security_level'; {introduced 1.1.0} + + ////__owur TIdC_INT SSL_get_security_level(const s: PSSL); + SSL_set_security_callback_procname = 'SSL_set_security_callback'; {introduced 1.1.0} + SSL_get_security_callback_procname = 'SSL_get_security_callback'; {introduced 1.1.0} + SSL_set0_security_ex_data_procname = 'SSL_set0_security_ex_data'; {introduced 1.1.0} + SSL_get0_security_ex_data_procname = 'SSL_get0_security_ex_data'; {introduced 1.1.0} + SSL_CTX_set_security_level_procname = 'SSL_CTX_set_security_level'; {introduced 1.1.0} + SSL_CTX_get_security_level_procname = 'SSL_CTX_get_security_level'; {introduced 1.1.0} + //void SSL_CTX_set_security_callback(ctx: PSSL_CTX, + // TIdC_INT (*cb) (const s: PSSL, const ctx: PSSL_CTX, + // TIdC_INT op, TIdC_INT bits, TIdC_INT nid, + // void *other, void *ex)); + //TIdC_INT (*SSL_CTX_get_security_callback(const ctx: PSSL_CTX)) (const s: PSSL, + // const ctx: PSSL_CTX, + // TIdC_INT op, TIdC_INT bits, + // TIdC_INT nid, + // void *other, + // void *ex); + + SSL_CTX_get0_security_ex_data_procname = 'SSL_CTX_get0_security_ex_data'; {introduced 1.1.0} + + SSL_CTX_set0_security_ex_data_procname = 'SSL_CTX_set0_security_ex_data'; {introduced 1.1.0} + + OPENSSL_init_ssl_procname = 'OPENSSL_init_ssl'; {introduced 1.1.0} + + //# ifndef OPENSSL_NO_UNIT_TEST + //__owur const struct openssl_ssl_test_functions *SSL_test_functions(void); + //# endif + + SSL_free_buffers_procname = 'SSL_free_buffers'; {introduced 1.1.0} + SSL_alloc_buffers_procname = 'SSL_alloc_buffers'; {introduced 1.1.0} + + SSL_CTX_set_session_ticket_cb_procname = 'SSL_CTX_set_session_ticket_cb'; {introduced 1.1.0} + + SSL_SESSION_set1_ticket_appdata_procname = 'SSL_SESSION_set1_ticket_appdata'; {introduced 1.1.0} + SSL_SESSION_get0_ticket_appdata_procname = 'SSL_SESSION_get0_ticket_appdata'; {introduced 1.1.0} + + //extern const PIdAnsiChar SSL_version_str[]; + + DTLS_set_timer_cb_procname = 'DTLS_set_timer_cb'; {introduced 1.1.0} + SSL_CTX_set_allow_early_data_cb_procname = 'SSL_CTX_set_allow_early_data_cb'; {introduced 1.1.0} + SSL_set_allow_early_data_cb_procname = 'SSL_set_allow_early_data_cb'; {introduced 1.1.0} + + SSLv2_method_procname = 'SSLv2_method'; {removed 1.1.0 allow_nil} // SSLv2 + SSLv2_server_method_procname = 'SSLv2_server_method'; {removed 1.1.0 allow_nil} // SSLv2 + SSLv2_client_method_procname = 'SSLv2_client_method'; {removed 1.1.0 allow_nil} // SSLv2 + SSLv3_method_procname = 'SSLv3_method'; {removed 1.1.0 allow_nil} // SSLv3 + SSLv3_server_method_procname = 'SSLv3_server_method'; {removed 1.1.0 allow_nil} // SSLv3 + SSLv3_client_method_procname = 'SSLv3_client_method'; {removed 1.1.0 allow_nil} // SSLv3 + SSLv23_method_procname = 'SSLv23_method'; {removed 1.1.0 allow_nil} // SSLv3 but can rollback to v2 + SSLv23_server_method_procname = 'SSLv23_server_method'; {removed 1.1.0 allow_nil} // SSLv3 but can rollback to v2 + SSLv23_client_method_procname = 'SSLv23_client_method'; {removed 1.1.0 allow_nil} // SSLv3 but can rollback to v2 + TLSv1_method_procname = 'TLSv1_method'; {removed 1.1.0 allow_nil} // TLSv1.0 + TLSv1_server_method_procname = 'TLSv1_server_method'; {removed 1.1.0 allow_nil} // TLSv1.0 + TLSv1_client_method_procname = 'TLSv1_client_method'; {removed 1.1.0 allow_nil} // TLSv1.0 + TLSv1_1_method_procname = 'TLSv1_1_method'; {removed 1.1.0 allow_nil} //TLS1.1 + TLSv1_1_server_method_procname = 'TLSv1_1_server_method'; {removed 1.1.0 allow_nil} //TLS1.1 + TLSv1_1_client_method_procname = 'TLSv1_1_client_method'; {removed 1.1.0 allow_nil} //TLS1.1 + TLSv1_2_method_procname = 'TLSv1_2_method'; {removed 1.1.0 allow_nil} // TLSv1.2 + TLSv1_2_server_method_procname = 'TLSv1_2_server_method'; {removed 1.1.0 allow_nil} // TLSv1.2 + TLSv1_2_client_method_procname = 'TLSv1_2_client_method'; {removed 1.1.0 allow_nil} // TLSv1.2 + + //X509 *SSL_get0_peer_certificate(const SSL *s); + SSL_get0_peer_certificate_procname = 'SSL_get0_peer_certificate'; {introduced 3.3.0} + // X509 *SSL_get1_peer_certificate(const SSL *s); + SSL_get1_peer_certificate_procname = 'SSL_get1_peer_certificate'; {introduced 3.3.0} + + + +{$DEFINE SSLv2_method_allownil} {removed 1.1.0 allow_nil} // SSLv2 +{$DEFINE SSLv2_server_method_allownil} {removed 1.1.0 allow_nil} // SSLv2 +{$DEFINE SSLv2_client_method_allownil} {removed 1.1.0 allow_nil} // SSLv2 +{$DEFINE SSLv3_method_allownil} {removed 1.1.0 allow_nil} // SSLv3 +{$DEFINE SSLv3_server_method_allownil} {removed 1.1.0 allow_nil} // SSLv3 +{$DEFINE SSLv3_client_method_allownil} {removed 1.1.0 allow_nil} // SSLv3 +{$DEFINE SSLv23_method_allownil} {removed 1.1.0 allow_nil} // SSLv3 but can rollback to v2 +{$DEFINE SSLv23_server_method_allownil} {removed 1.1.0 allow_nil} // SSLv3 but can rollback to v2 +{$DEFINE SSLv23_client_method_allownil} {removed 1.1.0 allow_nil} // SSLv3 but can rollback to v2 +{$DEFINE TLSv1_method_allownil} {removed 1.1.0 allow_nil} // TLSv1.0 +{$DEFINE TLSv1_server_method_allownil} {removed 1.1.0 allow_nil} // TLSv1.0 +{$DEFINE TLSv1_client_method_allownil} {removed 1.1.0 allow_nil} // TLSv1.0 +{$DEFINE TLSv1_1_method_allownil} {removed 1.1.0 allow_nil} //TLS1.1 +{$DEFINE TLSv1_1_server_method_allownil} {removed 1.1.0 allow_nil} //TLS1.1 +{$DEFINE TLSv1_1_client_method_allownil} {removed 1.1.0 allow_nil} //TLS1.1 +{$DEFINE TLSv1_2_method_allownil} {removed 1.1.0 allow_nil} // TLSv1.2 +{$DEFINE TLSv1_2_server_method_allownil} {removed 1.1.0 allow_nil} // TLSv1.2 +{$DEFINE TLSv1_2_client_method_allownil} {removed 1.1.0 allow_nil} // TLSv1.2 + +//# define SSL_get_peer_certificate SSL_get1_peer_certificate +function _SSL_get_peer_certificate(const s: PSSL): PX509; cdecl; +begin + Result := SSL_get1_peer_certificate(s); +end; + + +//# define SSL_CTX_set_mode(ctx,op) SSL_CTX_ctrl((ctx),SSL_CTRL_MODE,(op),NULL) +function _SSL_CTX_set_mode(ctx: PSSL_CTX; op: TIdC_LONG): TIdC_LONG; cdecl; +begin + Result := SSL_CTX_ctrl(ctx, SSL_CTRL_MODE, op, nil); +end; + +//# define SSL_CTX_clear_mode(ctx,op) SSL_CTX_ctrl((ctx),SSL_CTRL_CLEAR_MODE,(op),NULL) +function _SSL_CTX_clear_mode(ctx: PSSL_CTX; op: TIdC_LONG): TIdC_LONG; cdecl; +begin + Result := SSL_CTX_ctrl(ctx, SSL_CTRL_CLEAR_MODE, op, nil); +end; + +//# define SSL_CTX_sess_set_cache_size(ctx,t) SSL_CTX_ctrl(ctx,SSL_CTRL_SET_SESS_CACHE_SIZE,t,NULL) +function _SSL_CTX_sess_set_cache_size(ctx: PSSL_CTX; t: TIdC_LONG): TIdC_LONG; cdecl; +begin + Result := SSL_CTX_ctrl(ctx, SSL_CTRL_SET_SESS_CACHE_SIZE, t, nil); +end; + +//# define SSL_CTX_sess_get_cache_size(ctx) SSL_CTX_ctrl(ctx,SSL_CTRL_GET_SESS_CACHE_SIZE,0,NULL) +function _SSL_CTX_sess_get_cache_size(ctx: PSSL_CTX): TIdC_LONG; cdecl; +begin + Result := SSL_CTX_ctrl(ctx, SSL_CTRL_GET_SESS_CACHE_SIZE, 0, nil); +end; + +//# define SSL_CTX_set_session_cache_mode(ctx,m) SSL_CTX_ctrl(ctx,SSL_CTRL_SET_SESS_CACHE_MODE,m,NULL) +function _SSL_CTX_set_session_cache_mode(ctx: PSSL_CTX; m: TIdC_LONG): TIdC_LONG; cdecl; +begin + Result := SSL_CTX_ctrl(ctx, SSL_CTRL_SET_SESS_CACHE_MODE, m, nil); +end; + +//# define SSL_CTX_get_session_cache_mode(ctx) SSL_CTX_ctrl(ctx,SSL_CTRL_GET_SESS_CACHE_MODE,0,NULL) +function _SSL_CTX_get_session_cache_mode(ctx: PSSL_CTX): TIdC_LONG; cdecl; +begin + Result := SSL_CTX_ctrl(ctx, SSL_CTRL_GET_SESS_CACHE_MODE, 0, nil); +end; + +//# define SSL_num_renegotiations(ssl) SSL_ctrl((ssl),SSL_CTRL_GET_NUM_RENEGOTIATIONS,0,NULL) +function _SSL_num_renegotiations(ssl: PSSL): TIdC_LONG; cdecl; +begin + Result := SSL_ctrl(ssl, SSL_CTRL_GET_NUM_RENEGOTIATIONS, 0, nil); +end; + +//# define SSL_clear_num_renegotiations(ssl) SSL_ctrl((ssl),SSL_CTRL_CLEAR_NUM_RENEGOTIATIONS,0,NULL) +function _SSL_clear_num_renegotiations(ssl: PSSL): TIdC_LONG; cdecl; +begin + Result := SSL_ctrl(ssl, SSL_CTRL_CLEAR_NUM_RENEGOTIATIONS, 0, nil); +end; + +//# define SSL_total_renegotiations(ssl) SSL_ctrl((ssl),SSL_CTRL_GET_TOTAL_RENEGOTIATIONS,0,NULL) +function _SSL_total_renegotiations(ssl: PSSL): TIdC_LONG; cdecl; +begin + Result := SSL_ctrl(ssl, SSL_CTRL_GET_TOTAL_RENEGOTIATIONS, 0, nil); +end; + +//# define SSL_CTX_set_tmp_dh(ctx,dh) SSL_CTX_ctrl(ctx,SSL_CTRL_SET_TMP_DH,0,(char *)(dh)) +function _SSL_CTX_set_tmp_dh(ctx: PSSL_CTX; dh: PDH): TIdC_LONG; cdecl; +begin + Result := SSL_CTX_ctrl(ctx, SSL_CTRL_SET_TMP_DH, 0, dh); +end; + +//# define SSL_CTX_set_tmp_ecdh(ctx,ecdh) SSL_CTX_ctrl(ctx,SSL_CTRL_SET_TMP_ECDH,0,(char *)(ecdh)) +function _SSL_CTX_set_tmp_ecdh(ctx: PSSL_CTX; ecdh: PByte): TIdC_LONG; cdecl; +begin + Result := SSL_CTX_ctrl(ctx, SSL_CTRL_SET_TMP_ECDH, 0, ecdh); +end; + +//# define SSL_CTX_set_dh_auto(ctx, onoff) SSL_CTX_ctrl(ctx,SSL_CTRL_SET_DH_AUTO,onoff,NULL) +function _SSL_CTX_set_dh_auto(ctx: PSSL_CTX; onoff: TIdC_LONG): TIdC_LONG; cdecl; +begin + Result := SSL_CTX_ctrl(ctx, SSL_CTRL_SET_DH_AUTO, onoff, nil); +end; + +//# define SSL_set_dh_auto(s, onoff) SSL_ctrl(s,SSL_CTRL_SET_DH_AUTO,onoff,NULL) +function _SSL_set_dh_auto(s: PSSL; onoff: TIdC_LONG): TIdC_LONG; cdecl; +begin + Result := SSL_ctrl(s, SSL_CTRL_SET_DH_AUTO, onoff, nil); +end; + +//# define SSL_set_tmp_dh(ssl,dh) SSL_ctrl(ssl,SSL_CTRL_SET_TMP_DH,0,(char *)(dh)) +function _SSL_set_tmp_dh(ssl: PSSL; dh: PDH): TIdC_LONG; cdecl; +begin + Result := SSL_ctrl(ssl, SSL_CTRL_SET_TMP_DH, 0, dh); +end; + +//# define SSL_set_tmp_ecdh(ssl,ecdh) SSL_ctrl(ssl,SSL_CTRL_SET_TMP_ECDH,0,(char *)(ecdh)) +function _SSL_set_tmp_ecdh(ssl: PSSL; ecdh: PByte): TIdC_LONG; cdecl; +begin + Result := SSL_ctrl(ssl, SSL_CTRL_SET_TMP_ECDH, 0, ecdh); +end; + +//# define SSL_CTX_add_extra_chain_cert(ctx,x509) SSL_CTX_ctrl(ctx,SSL_CTRL_EXTRA_CHAIN_CERT,0,(char *)(x509)) +function _SSL_CTX_add_extra_chain_cert(ctx: PSSL_CTX; x509: PByte): TIdC_LONG; cdecl; +begin + Result := SSL_CTX_ctrl(ctx, SSL_CTRL_EXTRA_CHAIN_CERT, 0, x509); +end; + +//# define SSL_CTX_get_extra_chain_certs(ctx,px509) SSL_CTX_ctrl(ctx,SSL_CTRL_GET_EXTRA_CHAIN_CERTS,0,px509) +function _SSL_CTX_get_extra_chain_certs(ctx: PSSL_CTX; px509: Pointer): TIdC_LONG; cdecl; +begin + Result := SSL_CTX_ctrl(ctx, SSL_CTRL_GET_EXTRA_CHAIN_CERTS, 0, px509); +end; + +//# define SSL_CTX_get_extra_chain_certs_only(ctx,px509) SSL_CTX_ctrl(ctx,SSL_CTRL_GET_EXTRA_CHAIN_CERTS,1,px509) +function _SSL_CTX_get_extra_chain_certs_only(ctx: PSSL_CTX; px509: Pointer): TIdC_LONG; cdecl; +begin + Result := SSL_CTX_ctrl(ctx, SSL_CTRL_GET_EXTRA_CHAIN_CERTS, 1, px509); +end; + +//# define SSL_CTX_clear_extra_chain_certs(ctx) SSL_CTX_ctrl(ctx,SSL_CTRL_CLEAR_EXTRA_CHAIN_CERTS,0,NULL) +function _SSL_CTX_clear_extra_chain_certs(ctx: PSSL_CTX): TIdC_LONG; cdecl; +begin + Result := SSL_CTX_ctrl(ctx, SSL_CTRL_CLEAR_EXTRA_CHAIN_CERTS, 0, nil); +end; + +//# define SSL_CTX_set0_chain(ctx,sk) SSL_CTX_ctrl(ctx,SSL_CTRL_CHAIN,0,(char *)(sk)) +function _SSL_CTX_set0_chain(ctx: PSSL_CTX; sk: PByte): TIdC_LONG; cdecl; +begin + Result := SSL_CTX_ctrl(ctx, SSL_CTRL_CHAIN, 0, sk); +end; + +//# define SSL_CTX_set1_chain(ctx,sk) SSL_CTX_ctrl(ctx,SSL_CTRL_CHAIN,1,(char *)(sk)) +function _SSL_CTX_set1_chain(ctx: PSSL_CTX; sk: PByte): TIdC_LONG; cdecl; +begin + Result := SSL_CTX_ctrl(ctx, SSL_CTRL_CHAIN, 1, sk); +end; + +//# define SSL_CTX_add0_chain_cert(ctx,x509) SSL_CTX_ctrl(ctx,SSL_CTRL_CHAIN_CERT,0,(char *)(x509)) +function _SSL_CTX_add0_chain_cert(ctx: PSSL_CTX; x509: PX509): TIdC_LONG; cdecl; +begin + Result := SSL_CTX_ctrl(ctx, SSL_CTRL_CHAIN_CERT, 0, x509); +end; + +//# define SSL_CTX_add1_chain_cert(ctx,x509) SSL_CTX_ctrl(ctx,SSL_CTRL_CHAIN_CERT,1,(char *)(x509)) +function _SSL_CTX_add1_chain_cert(ctx: PSSL_CTX; x509: PX509): TIdC_LONG; cdecl; +begin + Result := SSL_CTX_ctrl(ctx, SSL_CTRL_CHAIN_CERT, 1, x509); +end; + +//# define SSL_CTX_get0_chain_certs(ctx,px509) SSL_CTX_ctrl(ctx,SSL_CTRL_GET_CHAIN_CERTS,0,px509) +function _SSL_CTX_get0_chain_certs(ctx: PSSL_CTX; px509: Pointer): TIdC_LONG; cdecl; +begin + Result := SSL_CTX_ctrl(ctx, SSL_CTRL_GET_CHAIN_CERTS, 0, px509); +end; + +//# define SSL_CTX_clear_chain_certs(ctx) SSL_CTX_set0_chain(ctx,NULL) +function _SSL_CTX_clear_chain_certs(ctx: PSSL_CTX): TIdC_LONG; cdecl; +begin + Result := SSL_CTX_set0_chain(ctx, nil); +end; + +//# define SSL_CTX_build_cert_chain(ctx, flags) SSL_CTX_ctrl(ctx,SSL_CTRL_BUILD_CERT_CHAIN, flags, NULL) +function _SSL_CTX_build_cert_chain(ctx: PSSL_CTX; flags: TIdC_LONG): TIdC_LONG; cdecl; +begin + Result := SSL_CTX_ctrl(ctx, SSL_CTRL_BUILD_CERT_CHAIN, flags, nil); +end; + +//# define SSL_CTX_select_current_cert(ctx,x509) SSL_CTX_ctrl(ctx,SSL_CTRL_SELECT_CURRENT_CERT,0,(char *)(x509)) +function _SSL_CTX_select_current_cert(ctx: PSSL_CTX; x509: PByte): TIdC_LONG; cdecl; +begin + Result := SSL_CTX_ctrl(ctx, SSL_CTRL_SELECT_CURRENT_CERT, 0, x509); +end; + +//# define SSL_CTX_set_current_cert(ctx, op) SSL_CTX_ctrl(ctx,SSL_CTRL_SET_CURRENT_CERT, op, NULL) +function _SSL_CTX_set_current_cert(ctx: PSSL_CTX; op: TIdC_LONG): TIdC_LONG; cdecl; +begin + Result := SSL_CTX_ctrl(ctx, SSL_CTRL_SET_CURRENT_CERT, op, nil); +end; + +//# define SSL_CTX_set0_verify_cert_store(ctx,st) SSL_CTX_ctrl(ctx,SSL_CTRL_SET_VERIFY_CERT_STORE,0,(char *)(st)) +function _SSL_CTX_set0_verify_cert_store(ctx: PSSL_CTX; st: Pointer): TIdC_LONG; cdecl; +begin + Result := SSL_CTX_ctrl(ctx, SSL_CTRL_SET_VERIFY_CERT_STORE, 0, st); +end; + +//# define SSL_CTX_set1_verify_cert_store(ctx,st) SSL_CTX_ctrl(ctx,SSL_CTRL_SET_VERIFY_CERT_STORE,1,(char *)(st)) +function _SSL_CTX_set1_verify_cert_store(ctx: PSSL_CTX; st: Pointer): TIdC_LONG; cdecl; +begin + Result := SSL_CTX_ctrl(ctx, SSL_CTRL_SET_VERIFY_CERT_STORE, 1, st); +end; + +//# define SSL_CTX_set0_chain_cert_store(ctx,st) SSL_CTX_ctrl(ctx,SSL_CTRL_SET_CHAIN_CERT_STORE,0,(char *)(st)) +function _SSL_CTX_set0_chain_cert_store(ctx: PSSL_CTX; st: Pointer): TIdC_LONG; cdecl; +begin + Result := SSL_CTX_ctrl(ctx, SSL_CTRL_SET_CHAIN_CERT_STORE, 0, st); +end; + +//# define SSL_CTX_set1_chain_cert_store(ctx,st) SSL_CTX_ctrl(ctx,SSL_CTRL_SET_CHAIN_CERT_STORE,1,(char *)(st)) +function _SSL_CTX_set1_chain_cert_store(ctx: PSSL_CTX; st: Pointer): TIdC_LONG; cdecl; +begin + Result := SSL_CTX_ctrl(ctx, SSL_CTRL_SET_CHAIN_CERT_STORE, 1, st); +end; + +//# define SSL_set0_chain(s,sk) SSL_ctrl(s,SSL_CTRL_CHAIN,0,(char *)(sk)) +function _SSL_set0_chain(s: PSSL; sk: PByte): TIdC_LONG; cdecl; +begin + Result := SSL_ctrl(s, SSL_CTRL_CHAIN, 0, sk); +end; + +//# define SSL_set1_chain(s,sk) SSL_ctrl(s,SSL_CTRL_CHAIN,1,(char *)(sk)) +function _SSL_set1_chain(s: PSSL; sk: PByte): TIdC_LONG; cdecl; +begin + Result := SSL_ctrl(s, SSL_CTRL_CHAIN, 1, sk); +end; + +//# define SSL_add0_chain_cert(s,x509) SSL_ctrl(s,SSL_CTRL_CHAIN_CERT,0,(char *)(x509)) +function _SSL_add0_chain_cert(s: PSSL; x509: PByte): TIdC_LONG; cdecl; +begin + Result := SSL_ctrl(s, SSL_CTRL_CHAIN_CERT, 0, x509); +end; + +//# define SSL_add1_chain_cert(s,x509) SSL_ctrl(s,SSL_CTRL_CHAIN_CERT,1,(char *)(x509)) +function _SSL_add1_chain_cert(s: PSSL; x509: PByte): TIdC_LONG; cdecl; +begin + Result := SSL_ctrl(s, SSL_CTRL_CHAIN_CERT, 1, x509); +end; + +//# define SSL_get0_chain_certs(s,px509) SSL_ctrl(s,SSL_CTRL_GET_CHAIN_CERTS,0,px509) +function _SSL_get0_chain_certs(s: PSSL; px509: Pointer): TIdC_LONG; cdecl; +begin + Result := SSL_ctrl(s, SSL_CTRL_GET_CHAIN_CERTS, 0, px509); +end; + +//# define SSL_clear_chain_certs(s) SSL_set0_chain(s,NULL) +function _SSL_clear_chain_certs(s: PSSL): TIdC_LONG; cdecl; +begin + Result := SSL_set0_chain(s, nil); +end; + +//# define SSL_build_cert_chain(s, flags) SSL_ctrl(s,SSL_CTRL_BUILD_CERT_CHAIN, flags, NULL) +function _SSL_build_cert_chain(s: PSSL; flags: TIdC_LONG): TIdC_LONG; cdecl; +begin + Result := SSL_ctrl(s, SSL_CTRL_BUILD_CERT_CHAIN, flags, nil); +end; + +//# define SSL_select_current_cert(s,x509) SSL_ctrl(s,SSL_CTRL_SELECT_CURRENT_CERT,0,(char *)(x509)) +function _SSL_select_current_cert(s: PSSL; x509: PByte): TIdC_LONG; cdecl; +begin + Result := SSL_ctrl(s, SSL_CTRL_SELECT_CURRENT_CERT, 0, x509); +end; + +//# define SSL_set_current_cert(s,op) SSL_ctrl(s,SSL_CTRL_SET_CURRENT_CERT, op, NULL) +function _SSL_set_current_cert(s: PSSL; op: TIdC_LONG): TIdC_LONG; cdecl; +begin + Result := SSL_ctrl(s, SSL_CTRL_SET_CURRENT_CERT, op, nil); +end; + +//# define SSL_set0_verify_cert_store(s,st) SSL_ctrl(s,SSL_CTRL_SET_VERIFY_CERT_STORE,0,(char *)(st)) +function _SSL_set0_verify_cert_store(s: PSSL; st: PByte): TIdC_LONG; cdecl; +begin + Result := SSL_ctrl(s, SSL_CTRL_SET_VERIFY_CERT_STORE, 0, st); +end; + +//# define SSL_set1_verify_cert_store(s,st) SSL_ctrl(s,SSL_CTRL_SET_VERIFY_CERT_STORE,1,(char *)(st)) +function _SSL_set1_verify_cert_store(s: PSSL; st: PByte): TIdC_LONG; cdecl; +begin + Result := SSL_ctrl(s, SSL_CTRL_SET_VERIFY_CERT_STORE, 1, st); +end; + +//# define SSL_set0_chain_cert_store(s,st) SSL_ctrl(s,SSL_CTRL_SET_CHAIN_CERT_STORE,0,(char *)(st)) +function _SSL_set0_chain_cert_store(s: PSSL; st: PByte): TIdC_LONG; cdecl; +begin + Result := SSL_ctrl(s, SSL_CTRL_SET_CHAIN_CERT_STORE, 0, st); +end; + +//# define SSL_set1_chain_cert_store(s,st) SSL_ctrl(s,SSL_CTRL_SET_CHAIN_CERT_STORE,1,(char *)(st)) +function _SSL_set1_chain_cert_store(s: PSSL; st: PByte): TIdC_LONG; cdecl; +begin + Result := SSL_ctrl(s, SSL_CTRL_SET_CHAIN_CERT_STORE, 1, st); +end; + +//# define SSL_get1_groups(s, glist) SSL_ctrl(s,SSL_CTRL_GET_GROUPS,0,(TIdC_INT*)(glist)) +function _SSL_get1_groups(s: PSSL; glist: PIdC_INT): TIdC_LONG; cdecl; +begin + Result := SSL_ctrl(s, SSL_CTRL_GET_GROUPS, 0, glist); +end; + +//# define SSL_CTX_set1_groups(ctx, glist, glistlen) SSL_CTX_ctrl(ctx,SSL_CTRL_SET_GROUPS,glistlen,(char *)(glist)) +function _SSL_CTX_set1_groups(ctx: PSSL_CTX; glist: PByte; glistlen: TIdC_LONG): TIdC_LONG; cdecl; +begin + Result := SSL_CTX_ctrl(ctx, SSL_CTRL_SET_GROUPS, glistlen, glist); +end; + +//# define SSL_CTX_set1_groups_list(ctx, s) SSL_CTX_ctrl(ctx,SSL_CTRL_SET_GROUPS_LIST,0,(char *)(s)) +function _SSL_CTX_set1_groups_list(ctx: PSSL_CTX; s: PByte): TIdC_LONG; cdecl; +begin + Result := SSL_CTX_ctrl(ctx, SSL_CTRL_SET_GROUPS_LIST, 0, s); +end; + +//# define SSL_set1_groups(s, glist, glistlen) SSL_ctrl(s,SSL_CTRL_SET_GROUPS,glistlen,(char *)(glist)) +function _SSL_set1_groups(s: PSSL; glist: PByte; glistlen: TIdC_LONG): TIdC_LONG; cdecl; +begin + Result := SSL_ctrl(s, SSL_CTRL_SET_GROUPS, glistlen, glist); +end; + +//# define SSL_set1_groups_list(s, str) SSL_ctrl(s,SSL_CTRL_SET_GROUPS_LIST,0,(char *)(str)) +function _SSL_set1_groups_list(s: PSSL; str: PByte): TIdC_LONG; cdecl; +begin + Result := SSL_ctrl(s, SSL_CTRL_SET_GROUPS_LIST, 0, str); +end; + +//# define SSL_get_shared_group(s, n) SSL_ctrl(s,SSL_CTRL_GET_SHARED_GROUP,n,NULL) +function _SSL_get_shared_group(s: PSSL; n: TIdC_LONG): TIdC_LONG; cdecl; +begin + Result := SSL_ctrl(s, SSL_CTRL_GET_SHARED_GROUP, n, nil); +end; + +//# define SSL_CTX_set1_sigalgs(ctx, slist, slistlen) SSL_CTX_ctrl(ctx,SSL_CTRL_SET_SIGALGS,slistlen,(TIdC_INT *)(slist)) +function _SSL_CTX_set1_sigalgs(ctx: PSSL_CTX; slist: PIdC_INT; slistlen: TIdC_LONG): TIdC_LONG; cdecl; +begin + Result := SSL_CTX_ctrl(ctx, SSL_CTRL_SET_SIGALGS, slistlen, slist); +end; + +//# define SSL_CTX_set1_sigalgs_list(ctx, s) SSL_CTX_ctrl(ctx,SSL_CTRL_SET_SIGALGS_LIST,0,(char *)(s)) +function _SSL_CTX_set1_sigalgs_list(ctx: PSSL_CTX; s: PByte): TIdC_LONG; cdecl; +begin + Result := SSL_CTX_ctrl(ctx, SSL_CTRL_SET_SIGALGS_LIST, 0, s); +end; + +//# define SSL_set1_sigalgs(s, slist, slistlen) SSL_ctrl(s,SSL_CTRL_SET_SIGALGS,slistlen,(TIdC_INT *)(slist)) +function _SSL_set1_sigalgs(s: PSSL; slist: PIdC_INT; slistlen: TIdC_LONG): TIdC_LONG; cdecl; +begin + Result := SSL_ctrl(s, SSL_CTRL_SET_SIGALGS, slistlen, slist); +end; + +//# define SSL_set1_sigalgs_list(s, str) SSL_ctrl(s,SSL_CTRL_SET_SIGALGS_LIST,0,(char *)(str)) +function _SSL_set1_sigalgs_list(s: PSSL; str: PByte): TIdC_LONG; cdecl; +begin + Result := SSL_ctrl(s, SSL_CTRL_SET_SIGALGS_LIST, 0, str); +end; + +//# define SSL_CTX_set1_client_sigalgs(ctx, slist, slistlen) SSL_CTX_ctrl(ctx,SSL_CTRL_SET_CLIENT_SIGALGS,slistlen,(TIdC_INT *)(slist)) +function _SSL_CTX_set1_client_sigalgs(ctx: PSSL_CTX; slist: PIdC_INT; slistlen: TIdC_LONG): TIdC_LONG; cdecl; +begin + Result := SSL_CTX_ctrl(ctx, SSL_CTRL_SET_CLIENT_SIGALGS, slistlen, slist); +end; + +//# define SSL_CTX_set1_client_sigalgs_list(ctx, s) SSL_CTX_ctrl(ctx,SSL_CTRL_SET_CLIENT_SIGALGS_LIST,0,(char *)(s)) +function _SSL_CTX_set1_client_sigalgs_list(ctx: PSSL_CTX; s: PByte): TIdC_LONG; cdecl; +begin + Result := SSL_CTX_ctrl(ctx, SSL_CTRL_SET_CLIENT_SIGALGS_LIST, 0, s); +end; + +//# define SSL_set1_client_sigalgs(s, slist, slistlen) SSL_ctrl(s,SSL_CTRL_SET_CLIENT_SIGALGS,slistlen,(TIdC_INT *)(slist)) +function _SSL_set1_client_sigalgs(s: PSSL; slist: PIdC_INT; slistlen: TIdC_LONG): TIdC_LONG; cdecl; +begin + Result := SSL_ctrl(s, SSL_CTRL_SET_CLIENT_SIGALGS, slistlen, slist); +end; + +//# define SSL_set1_client_sigalgs_list(s, str) SSL_ctrl(s,SSL_CTRL_SET_CLIENT_SIGALGS_LIST,0,(char *)(str)) +function _SSL_set1_client_sigalgs_list(s: PSSL; str: PByte): TIdC_LONG; cdecl; +begin + Result := SSL_ctrl(s, SSL_CTRL_SET_CLIENT_SIGALGS_LIST, 0, str); +end; + +//# define SSL_get0_certificate_types(s, clist) SSL_ctrl(s, SSL_CTRL_GET_CLIENT_CERT_TYPES, 0, (char *)(clist)) +function _SSL_get0_certificate_types(s: PSSL; clist: PByte): TIdC_LONG; cdecl; +begin + Result := SSL_ctrl(s, SSL_CTRL_GET_CLIENT_CERT_TYPES, 0, clist); +end; + +//# define SSL_CTX_set1_client_certificate_types(ctx, clist, clistlen) SSL_CTX_ctrl(ctx,SSL_CTRL_SET_CLIENT_CERT_TYPES,clistlen, (char *)(clist)) +function _SSL_CTX_set1_client_certificate_types(ctx: PSSL_CTX; clist: PByte; clistlen: TIdC_LONG): TIdC_LONG; cdecl; +begin + Result := SSL_CTX_ctrl(ctx, SSL_CTRL_SET_CLIENT_CERT_TYPES, clistlen, clist); +end; + +//# define SSL_set1_client_certificate_types(s, clist, clistlen) SSL_ctrl(s,SSL_CTRL_SET_CLIENT_CERT_TYPES,clistlen,(char *)(clist)) +function _SSL_set1_client_certificate_types(s: PSSL; clist: PByte; clistlen: TIdC_LONG): TIdC_LONG; cdecl; +begin + Result := SSL_ctrl(s, SSL_CTRL_SET_CLIENT_CERT_TYPES, clistlen, clist); +end; + +//# define SSL_get_signature_nid(s, pn) SSL_ctrl(s,SSL_CTRL_GET_SIGNATURE_NID,0,pn) +function _SSL_get_signature_nid(s: PSSL; pn: Pointer): TIdC_LONG; cdecl; +begin + Result := SSL_ctrl(s, SSL_CTRL_GET_SIGNATURE_NID, 0, pn); +end; + +//# define SSL_get_peer_signature_nid(s, pn) SSL_ctrl(s,SSL_CTRL_GET_PEER_SIGNATURE_NID,0,pn) +function _SSL_get_peer_signature_nid(s: PSSL; pn: Pointer): TIdC_LONG; cdecl; +begin + Result := SSL_ctrl(s, SSL_CTRL_GET_PEER_SIGNATURE_NID, 0, pn); +end; + +//# define SSL_get_peer_tmp_key(s, pk) SSL_ctrl(s,SSL_CTRL_GET_PEER_TMP_KEY,0,pk) +function _SSL_get_peer_tmp_key(s: PSSL; pk: Pointer): TIdC_LONG; cdecl; +begin + Result := SSL_ctrl(s, SSL_CTRL_GET_PEER_TMP_KEY, 0, pk); +end; + +//# define SSL_get_tmp_key(s, pk) SSL_ctrl(s,SSL_CTRL_GET_TMP_KEY,0,pk) +function _SSL_get_tmp_key(s: PSSL; pk: Pointer): TIdC_LONG; cdecl; +begin + Result := SSL_ctrl(s, SSL_CTRL_GET_TMP_KEY, 0, pk); +end; + +//# define SSL_get0_raw_cipherlist(s, plst) SSL_ctrl(s,SSL_CTRL_GET_RAW_CIPHERLIST,0,plst) +function _SSL_get0_raw_cipherlist(s: PSSL; plst: Pointer): TIdC_LONG; cdecl; +begin + Result := SSL_ctrl(s, SSL_CTRL_GET_RAW_CIPHERLIST, 0, plst); +end; + +//# define SSL_get0_ec_point_formats(s, plst) SSL_ctrl(s,SSL_CTRL_GET_EC_POINT_FORMATS,0,plst) +function _SSL_get0_ec_point_formats(s: PSSL; plst: Pointer): TIdC_LONG; cdecl; +begin + Result := SSL_ctrl(s, SSL_CTRL_GET_EC_POINT_FORMATS, 0, plst); +end; + + +function _SSL_get_app_data(const ssl: PSSL): Pointer ; cdecl; +begin + Result := SSL_get_ex_data(ssl,0); +end; + +procedure _SSL_load_error_strings; cdecl; +begin + OPENSSL_init_ssl(OPENSSL_INIT_LOAD_SSL_STRINGS or OPENSSL_INIT_LOAD_CRYPTO_STRINGS,nil); +end; + +function _SSL_library_init: TIdC_INT; cdecl; +begin + Result := OPENSSL_init_ssl(0, nil); +end; + +function _SSLeay_add_ssl_algorithms: TIdC_INT; cdecl; +begin + Result := SSL_library_init; +end; + +function _SSL_set_app_data(ssl: PSSL; data: Pointer): TIdC_INT; cdecl; +begin + Result := SSL_set_ex_data(ssl,0,data); +end; + + +{forward_compatibility} + +type + PSTACK_OF_SSL_CIPHER = pointer; + Plash_of_SSL_SESSION = pointer; + SSL_CTX_stats = record + sess_connect: TIdC_INT; // SSL new conn - started + sess_connect_renegotiate: TIdC_INT; // SSL reneg - requested + sess_connect_good: TIdC_INT; // SSL new conne/reneg - finished + sess_accept: TIdC_INT; // SSL new accept - started + sess_accept_renegotiate: TIdC_INT; // SSL reneg - requested + sess_accept_good: TIdC_INT; // SSL accept/reneg - finished + sess_miss: TIdC_INT; // session lookup misses + sess_timeout: TIdC_INT; // reuse attempt on timeouted session + sess_cache_full: TIdC_INT; // session removed due to full cache + sess_hit: TIdC_INT; // session reuse actually done + sess_cb_hit: TIdC_INT; // session-id that was not + // in the cache was + // passed back via the callback. This + // indicates that the application is + // supplying session-id's from other + // processes - spooky :-) + end; + PSTACK_OF_COMP = pointer; + PSSL_CTX_info_callback = pointer; + PX509_VERIFY_PARAM = pointer; + PCERT = pointer; + size_t = type integer; + PGEN_SESSION_CB = pointer; + PSSL_CTEX_tlsext_servername_callback = pointer; + Ptlsext_status_cb = pointer; + Ptlsext_ticket_key_cb = pointer; + Pssl3_buf_freelist_st = pointer; + PSRP_CTX = ^SRP_CTX; + SRP_CTX = record + //* param for all the callbacks */ + SRP_cb_arg : Pointer; + //* set client Hello login callback */ + TLS_ext_srp_username_callback : function(para1 : PSSL; para2 : TIdC_INT; para3 : Pointer) : TIdC_INT cdecl; + //int (*TLS_ext_srp_username_callback)(SSL *, int *, void *); + //* set SRP N/g param callback for verification */ + SRP_verify_param_callback : function(para1 : PSSL; para2 : Pointer) : TIdC_INT cdecl; +// int (*SRP_verify_param_callback)(SSL *, void *); + //* set SRP client passwd callback */ + SRP_give_srp_client_pwd_callback : function(para1 : PSSL; para2 : Pointer) : PIdAnsiChar cdecl; + // char *(*SRP_give_srp_client_pwd_callback)(SSL *, void *); + login : PIdAnsiChar; + N, g, s, B, A : PBIGNUM; + _a, _b, v : PBIGNUM; + info : PIdAnsiChar; + strength : TIdC_INT; + srp_Mask : TIdC_ULONG; + end; + PSTACK_OF_SRTP_PROTECTION_PROFILE = pointer; + + _PSSL_CTX = ^SSL_CTX; + SSL_CTX = record + method: PSSL_METHOD; + cipher_list: PSTACK_OF_SSL_CIPHER; + // same as above but sorted for lookup + cipher_list_by_id: PSTACK_OF_SSL_CIPHER; + cert_store: PX509_STORE; + sessions: Plash_of_SSL_SESSION; + // a set of SSL_SESSIONs + // Most session-ids that will be cached, default is + // SSL_SESSION_CACHE_MAX_SIZE_DEFAULT. 0 is unlimited. + session_cache_size: TIdC_ULONG; + session_cache_head: PSSL_SESSION; + session_cache_tail: PSSL_SESSION; + // This can have one of 2 values, ored together, + // SSL_SESS_CACHE_CLIENT, + // SSL_SESS_CACHE_SERVER, + // Default is SSL_SESSION_CACHE_SERVER, which means only + // SSL_accept which cache SSL_SESSIONS. + session_cache_mode: TIdC_INT; + session_timeout: TIdC_LONG; + // If this callback is not null, it will be called each + // time a session id is added to the cache. If this function + // returns 1, it means that the callback will do a + // SSL_SESSION_free() when it has finished using it. Otherwise, + // on 0, it means the callback has finished with it. + // If remove_session_cb is not null, it will be called when + // a session-id is removed from the cache. After the call, + // OpenSSL will SSL_SESSION_free() it. + new_session_cb: function (ssl : PSSL; sess: PSSL_SESSION): TIdC_INT; cdecl; + remove_session_cb: procedure (ctx : PSSL_CTX; sess : PSSL_SESSION); cdecl; + get_session_cb: function (ssl : PSSL; data : PByte; len: TIdC_INT; copy : PIdC_INT) : PSSL_SESSION; cdecl; + stats : SSL_CTX_stats; + + references: TIdC_INT; + // if defined, these override the X509_verify_cert() calls + app_verify_callback: function (_para1 : PX509_STORE_CTX; _para2 : Pointer) : TIdC_INT; cdecl; + app_verify_arg: Pointer; + // before OpenSSL 0.9.7, 'app_verify_arg' was ignored + // ('app_verify_callback' was called with just one argument) + // Default password callback. + default_passwd_callback: pem_password_cb; + // Default password callback user data. + default_passwd_callback_userdata: Pointer; + // get client cert callback + client_cert_cb: function (SSL : PSSL; x509 : PPX509; pkey : PPEVP_PKEY) : TIdC_INT; cdecl; + // verify cookie callback + app_gen_cookie_cb: function (ssl : PSSL; cookie : PByte; cookie_len : TIdC_UINT) : TIdC_INT; cdecl; + app_verify_cookie_cb: Pointer; + ex_data : CRYPTO_EX_DATA; + rsa_md5 : PEVP_MD; // For SSLv2 - name is 'ssl2-md5' + md5: PEVP_MD; // For SSLv3/TLSv1 'ssl3-md5' + sha1: PEVP_MD; // For SSLv3/TLSv1 'ssl3->sha1' + extra_certs: PSTACK_OF_X509; + comp_methods: PSTACK_OF_COMP; // stack of SSL_COMP, SSLv3/TLSv1 + // Default values used when no per-SSL value is defined follow + info_callback: PSSL_CTX_info_callback; // used if SSL's info_callback is NULL + // what we put in client cert requests + client_CA : PSTACK_OF_X509_NAME; + // Default values to use in SSL structures follow (these are copied by SSL_new) + options : TIdC_ULONG; + mode : TIdC_ULONG; + max_cert_list : TIdC_LONG; + cert : PCERT; + read_ahead : TIdC_INT; + // callback that allows applications to peek at protocol messages + msg_callback : procedure (write_p, version, content_type : TIdC_INT; const buf : Pointer; len : size_t; ssl : PSSL; arg : Pointer); cdecl; + msg_callback_arg : Pointer; + verify_mode : TIdC_INT; + sid_ctx_length : TIdC_UINT; + sid_ctx : array[0..SSL_MAX_SID_CTX_LENGTH - 1] of TIdAnsiChar; + default_verify_callback : function(ok : TIdC_INT; ctx : PX509_STORE_CTX) : TIdC_INT; cdecl; // called 'verify_callback' in the SSL + // Default generate session ID callback. + generate_session_id : PGEN_SESSION_CB; + param : PX509_VERIFY_PARAM; + {$IFDEF OMIT_THIS} + purpose : TIdC_INT; // Purpose setting + trust : TIdC_INT; // Trust setting + {$ENDIF} + + quiet_shutdown : TIdC_INT; + //* Maximum amount of data to send in one fragment. + // * actual record size can be more than this due to + // * padding and MAC overheads. + // */ + max_send_fragment : TIdC_UINT; + {$IFNDEF OPENSSL_ENGINE} + ///* Engine to pass requests for client certs to + // */ + client_cert_engine : PENGINE; + {$ENDIF} + {$IFNDEF OPENSSL_NO_TLSEXT} +//* TLS extensions servername callback */ + tlsext_servername_callback : PSSL_CTEX_tlsext_servername_callback; + tlsext_servername_arg : Pointer; + //* RFC 4507 session ticket keys */ + tlsext_tick_key_name : array [0..(16-1)] of TIdAnsiChar; + tlsext_tick_hmac_key : array [0..(16-1)] of TIdAnsiChar; + tlsext_tick_aes_key : array [0..(16-1)] of TIdAnsiChar; + //* Callback to support customisation of ticket key setting */ + // int (*tlsext_ticket_key_cb)(SSL *ssl, + // unsigned char *name, unsigned char *iv, + // EVP_CIPHER_CTX *ectx, + // HMAC_CTX *hctx, int enc); + tlsext_ticket_key_cb : Ptlsext_ticket_key_cb; + //* certificate status request info */ + //* Callback for status request */ + //int (*tlsext_status_cb)(SSL *ssl, void *arg); + tlsext_status_cb : Ptlsext_status_cb; + tlsext_status_arg : Pointer; + {$ENDIF} + //* draft-rescorla-tls-opaque-prf-input-00.txt information */ + tlsext_opaque_prf_input_callback : function(para1 : PSSL; peerinput : Pointer; len : size_t; arg : Pointer ) : TIdC_INT cdecl; + //int (*tlsext_opaque_prf_input_callback)(SSL *, void *peerinput, size_t len, void *arg); + tlsext_opaque_prf_input_callback_arg : Pointer; + +{$ifndef OPENSSL_NO_PSK} + psk_identity_hint : PIdAnsiChar; + psk_client_callback : function (ssl : PSSL; hint : PIdAnsiChar; + identity : PIdAnsiChar; max_identity_len : TIdC_UINT; + psk : PIdAnsiChar; max_psk_len : TIdC_UINT ) : TIdC_UINT cdecl; + // unsigned int (*psk_client_callback)(SSL *ssl, const char *hint, char *identity, +// unsigned int max_identity_len, unsigned char *psk, +// unsigned int max_psk_len); + psk_server_callback : function (ssl : PSSL; identity, psk : PIdAnsiChar; max_psk_len : TIdC_UINT) : TIdC_UINT cdecl; +// unsigned int (*psk_server_callback)(SSL *ssl, const char *identity, +// unsigned char *psk, unsigned int max_psk_len); +{$endif} + +{$ifndef OPENSSL_NO_BUF_FREELISTS} + freelist_max_len : TIdC_UINT; + wbuf_freelist : Pssl3_buf_freelist_st; + rbuf_freelist : Pssl3_buf_freelist_st; +{$endif} +{$ifndef OPENSSL_NO_SRP} + srp_ctx : SRP_CTX; //* ctx for SRP authentication */ +{$endif} + +{$ifndef OPENSSL_NO_TLSEXT} +//# ifndef OPENSSL_NO_NEXTPROTONEG + //* Next protocol negotiation information */ + //* (for experimental NPN extension). */ + + //* For a server, this contains a callback function by which the set of + // * advertised protocols can be provided. */ + next_protos_advertised_cb : function(s : PSSL; out but : PIdAnsiChar; + out len : TIdC_UINT; arg : Pointer) : TIdC_INT cdecl; +// int (*next_protos_advertised_cb)(SSL *s, const unsigned char **buf, +// unsigned int *len, void *arg); + next_protos_advertised_cb_arg : Pointer; + //* For a client, this contains a callback function that selects the + // * next protocol from the list provided by the server. */ + next_proto_select_cb : function(s : PSSL; out _out : PIdAnsiChar; + outlen : PIdAnsiChar; + _in : PIdAnsiChar; + inlen : TIdC_UINT; + arg : Pointer) : TIdC_INT cdecl; +// int (*next_proto_select_cb)(SSL *s, unsigned char **out, +// unsigned char *outlen, +// const unsigned char *in, +// unsigned int inlen, +// void *arg); + next_proto_select_cb_arg : Pointer; +//# endif + //* SRTP profiles we are willing to do from RFC 5764 */ + srtp_profiles : PSTACK_OF_SRTP_PROTECTION_PROFILE; +{$endif} + end; + +const + SSL_CTRL_OPTIONS = 32; + SSL_CTRL_CLEAR_OPTIONS = 77; + +function FC_SSL_CTX_get_default_passwd_cb(ctx: PSSL_CTX): pem_password_cb; cdecl; +begin + Result := _PSSL_CTX(ctx)^.default_passwd_callback; +end; + +function FC_SSL_CTX_get_default_passwd_cb_userdata(ctx: PSSL_CTX): Pointer; cdecl; +begin + Result := _PSSL_CTX(ctx)^.default_passwd_callback_userdata; +end; + +procedure FC_SSL_CTX_set_default_passwd_cb(ctx: PSSL_CTX; cb: pem_password_cb); cdecl; +begin + _PSSL_CTX(ctx)^.default_passwd_callback := cb; +end; + +procedure FC_SSL_CTX_set_default_passwd_cb_userdata(ctx: PSSL_CTX; u: Pointer); cdecl; +begin + _PSSL_CTX(ctx)^.default_passwd_callback_userdata := u; +end; + +//* Note: SSL[_CTX]_set_{options,mode} use |= op on the previous value, +// * they cannot be used to clear bits. */ + +function FC_SSL_CTX_set_options(ctx: PSSL_CTX; op: TIdC_LONG):TIdC_LONG; cdecl; +begin + Result := SSL_CTX_ctrl(ctx, SSL_CTRL_OPTIONS, op, nil); +end; + +function FC_SSL_CTX_clear_options(ctx : PSSL_CTX; op : TIdC_LONG):TIdC_LONG; cdecl; +begin + Result := SSL_CTX_ctrl(ctx,SSL_CTRL_CLEAR_OPTIONS,op,nil); +end; + +function FC_SSL_CTX_get_options(ctx: PSSL_CTX) : TIdC_LONG; cdecl; +begin + Result := SSL_CTX_ctrl(ctx, SSL_CTRL_OPTIONS,0,nil); +end; + +function FC_SSL_CTX_get_cert_store(const ctx: PSSL_CTX): PX509_STORE; cdecl; +begin + Result := _PSSL_CTX(ctx)^.cert_store; +end; + +const + SSL_MAX_KRB5_PRINCIPAL_LENGTH = 256; + +type + PSESS_CERT = pointer; + _PSSL_SESSION = ^_SSL_SESSION; + _SSL_SESSION = record + ssl_version : TIdC_INT; // what ssl version session info is being kept in here? + // only really used in SSLv2 + key_arg_length: TIdC_UINT; + key_arg: Array[0..SSL_MAX_KEY_ARG_LENGTH-1] of Byte; + master_key_length: TIdC_INT; + master_key: Array[0..SSL_MAX_MASTER_KEY_LENGTH-1] of Byte; + // session_id - valid? + session_id_length: TIdC_UINT; + session_id: Array[0..SSL_MAX_SSL_SESSION_ID_LENGTH-1] of Byte; + // this is used to determine whether the session is being reused in + // the appropriate context. It is up to the application to set this, + // via SSL_new + sid_ctx_length: TIdC_UINT; + sid_ctx: array[0..SSL_MAX_SID_CTX_LENGTH-1] of Byte; + {$IFNDEF OPENSSL_NO_KRB5} + krb5_client_princ_len: TIdC_UINT; + krb5_client_princ: array[0..SSL_MAX_KRB5_PRINCIPAL_LENGTH-1] of Byte; + {$ENDIF} +{$ifndef OPENSSL_NO_PSK} + psk_identity_hint : PIdAnsiChar; + psk_identity : PIdAnsiChar; +{$endif} + not_resumable: TIdC_INT; + // The cert is the certificate used to establish this connection + sess_cert : PSESS_CERT; + + //* This is the cert for the other end. + // * On clients, it will be the same as sess_cert->peer_key->x509 + // * (the latter is not enough as sess_cert is not retained + // * in the external representation of sessions, see ssl_asn1.c). */ + peer : PX509; + //* when app_verify_callback accepts a session where the peer's certificate + // * is not ok, we must remember the error for session reuse: */ + verify_result : TIdC_LONG; //* only for servers */ + references : TIdC_INT; + timeout : TIdC_LONG; + time : TIdC_LONG; + compress_meth : TIdC_UINT; //* Need to lookup the method */ + + cipher : PSSL_CIPHER; + cipher_id : TIdC_ULONG; //* when ASN.1 loaded, this + // * needs to be used to load + // * the 'cipher' structure */ + ciphers : PSTACK_OF_SSL_CIPHER; //* shared ciphers? */ + ex_data : CRYPTO_EX_DATA; // application specific data */ + //* These are used to make removal of session-ids more + // * efficient and to implement a maximum cache size. */ + prev, next : PSSL_SESSION; + + {$IFNDEF OPENSSL_NO_TLSEXT} + tlsext_hostname : PIdAnsiChar; + {$IFDEF OPENSSL_NO_EC} + tlsext_ecpointformatlist_length : size_t; + tlsext_ecpointformatlist : PIdAnsiChar; //* peer's list */ + tlsext_ellipticcurvelist_length : size_t; + tlsext_ellipticcurvelist : PIdAnsiChar; //* peer's list */ + {$ENDIF} //* OPENSSL_NO_EC */ + + //* RFC4507 info */ + tlsext_tick : PIdAnsiChar;//* Session ticket */ + tlsext_ticklen : size_t;//* Session ticket length */ + tlsext_tick_lifetime_hint : TIdC_LONG;//* Session lifetime hint in seconds */ + {$ENDIF} +{$ifndef OPENSSL_NO_SRP} + srp_username : PIdAnsiChar; +{$endif} + end; + +function FC_SSL_SESSION_get_protocol_version(const s: PSSL_SESSION): TIdC_INT; cdecl; +begin + Result := _PSSL_SESSION(s).ssl_version; +end; + +function FC_OPENSSL_init_ssl(opts: TIdC_UINT64; const settings: POPENSSL_INIT_SETTINGS): TIdC_INT; cdecl; +begin + if opts and OPENSSL_INIT_LOAD_SSL_STRINGS <> 0 then + SSL_load_error_strings; + SSL_library_init; + Result := OPENSSL_init_crypto(opts,settings); +end; + +{/forward_compatibility} +{$WARN NO_RETVAL OFF} +function ERR_SSL_CTX_set_mode(ctx: PSSL_CTX; op: TIdC_LONG): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_set_mode_procname); +end; + + +function ERR_SSL_CTX_clear_mode(ctx: PSSL_CTX; op: TIdC_LONG): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_clear_mode_procname); +end; + + + +function ERR_SSL_CTX_sess_set_cache_size(ctx: PSSL_CTX; t: TIdC_LONG): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_sess_set_cache_size_procname); +end; + + +function ERR_SSL_CTX_sess_get_cache_size(ctx: PSSL_CTX): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_sess_get_cache_size_procname); +end; + + +function ERR_SSL_CTX_set_session_cache_mode(ctx: PSSL_CTX; m: TIdC_LONG): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_set_session_cache_mode_procname); +end; + + +function ERR_SSL_CTX_get_session_cache_mode(ctx: PSSL_CTX): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_get_session_cache_mode_procname); +end; + + + +function ERR_SSL_clear_num_renegotiations(ssl: PSSL): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_clear_num_renegotiations_procname); +end; + + +function ERR_SSL_total_renegotiations(ssl: PSSL): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_total_renegotiations_procname); +end; + + +function ERR_SSL_CTX_set_tmp_dh(ctx: PSSL_CTX; dh: PDH): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_set_tmp_dh_procname); +end; + + +function ERR_SSL_CTX_set_tmp_ecdh(ctx: PSSL_CTX; ecdh: PByte): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_set_tmp_ecdh_procname); +end; + + +function ERR_SSL_CTX_set_dh_auto(ctx: PSSL_CTX; onoff: TIdC_LONG): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_set_dh_auto_procname); +end; + + +function ERR_SSL_set_dh_auto(s: PSSL; onoff: TIdC_LONG): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_set_dh_auto_procname); +end; + + +function ERR_SSL_set_tmp_dh(ssl: PSSL; dh: PDH): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_set_tmp_dh_procname); +end; + + +function ERR_SSL_set_tmp_ecdh(ssl: PSSL; ecdh: PByte): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_set_tmp_ecdh_procname); +end; + + +function ERR_SSL_CTX_add_extra_chain_cert(ctx: PSSL_CTX; x509: PByte): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_add_extra_chain_cert_procname); +end; + + +function ERR_SSL_CTX_get_extra_chain_certs(ctx: PSSL_CTX; px509: Pointer): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_get_extra_chain_certs_procname); +end; + + +function ERR_SSL_CTX_get_extra_chain_certs_only(ctx: PSSL_CTX; px509: Pointer): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_get_extra_chain_certs_only_procname); +end; + + +function ERR_SSL_CTX_clear_extra_chain_certs(ctx: PSSL_CTX): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_clear_extra_chain_certs_procname); +end; + + +function ERR_SSL_CTX_set0_chain(ctx: PSSL_CTX; sk: PByte): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_set0_chain_procname); +end; + + +function ERR_SSL_CTX_set1_chain(ctx: PSSL_CTX; sk: PByte): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_set1_chain_procname); +end; + + +function ERR_SSL_CTX_add0_chain_cert(ctx: PSSL_CTX; x509: PX509): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_add0_chain_cert_procname); +end; + + +function ERR_SSL_CTX_add1_chain_cert(ctx: PSSL_CTX; x509: PX509): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_add1_chain_cert_procname); +end; + + +function ERR_SSL_CTX_get0_chain_certs(ctx: PSSL_CTX; px509: Pointer): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_get0_chain_certs_procname); +end; + + +function ERR_SSL_CTX_clear_chain_certs(ctx: PSSL_CTX): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_clear_chain_certs_procname); +end; + + +function ERR_SSL_CTX_build_cert_chain(ctx: PSSL_CTX; flags: TIdC_LONG): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_build_cert_chain_procname); +end; + + +function ERR_SSL_CTX_select_current_cert(ctx: PSSL_CTX; x509: PByte): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_select_current_cert_procname); +end; + + +function ERR_SSL_CTX_set_current_cert(ctx: PSSL_CTX; op: TIdC_LONG): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_set_current_cert_procname); +end; + + +function ERR_SSL_CTX_set0_verify_cert_store(ctx: PSSL_CTX; st: Pointer): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_set0_verify_cert_store_procname); +end; + + +function ERR_SSL_CTX_set1_verify_cert_store(ctx: PSSL_CTX; st: Pointer): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_set1_verify_cert_store_procname); +end; + + +function ERR_SSL_CTX_set0_chain_cert_store(ctx: PSSL_CTX; st: Pointer): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_set0_chain_cert_store_procname); +end; + + +function ERR_SSL_CTX_set1_chain_cert_store(ctx: PSSL_CTX; st: Pointer): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_set1_chain_cert_store_procname); +end; + + +function ERR_SSL_set0_chain(s: PSSL; sk: PByte): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_set0_chain_procname); +end; + + +function ERR_SSL_set1_chain(s: PSSL; sk: PByte): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_set1_chain_procname); +end; + + +function ERR_SSL_add0_chain_cert(s: PSSL; x509: PByte): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_add0_chain_cert_procname); +end; + + +function ERR_SSL_add1_chain_cert(s: PSSL; x509: PByte): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_add1_chain_cert_procname); +end; + + +function ERR_SSL_get0_chain_certs(s: PSSL; px509: Pointer): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_get0_chain_certs_procname); +end; + + +function ERR_SSL_clear_chain_certs(s: PSSL): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_clear_chain_certs_procname); +end; + + +function ERR_SSL_build_cert_chain(s: PSSL; flags: TIdC_LONG): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_build_cert_chain_procname); +end; + + +function ERR_SSL_select_current_cert(s: PSSL; x509: PByte): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_select_current_cert_procname); +end; + + +function ERR_SSL_set_current_cert(s: PSSL; op: TIdC_LONG): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_set_current_cert_procname); +end; + + +function ERR_SSL_set0_verify_cert_store(s: PSSL; st: PByte): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_set0_verify_cert_store_procname); +end; + + +function ERR_SSL_set1_verify_cert_store(s: PSSL; st: PByte): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_set1_verify_cert_store_procname); +end; + + +function ERR_SSL_set0_chain_cert_store(s: PSSL; st: PByte): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_set0_chain_cert_store_procname); +end; + + +function ERR_SSL_set1_chain_cert_store(s: PSSL; st: PByte): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_set1_chain_cert_store_procname); +end; + + +function ERR_SSL_get1_groups(s: PSSL; glist: PIdC_INT): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_get1_groups_procname); +end; + + +function ERR_SSL_CTX_set1_groups(ctx: PSSL_CTX; glist: PByte; glistlen: TIdC_LONG): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_set1_groups_procname); +end; + + +function ERR_SSL_CTX_set1_groups_list(ctx: PSSL_CTX; s: PByte): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_set1_groups_list_procname); +end; + + +function ERR_SSL_set1_groups(s: PSSL; glist: PByte; glistlen: TIdC_LONG): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_set1_groups_procname); +end; + + +function ERR_SSL_set1_groups_list(s: PSSL; str: PByte): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_set1_groups_list_procname); +end; + + +function ERR_SSL_get_shared_group(s: PSSL; n: TIdC_LONG): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_get_shared_group_procname); +end; + + +function ERR_SSL_CTX_set1_sigalgs(ctx: PSSL_CTX; slist: PIdC_INT; slistlen: TIdC_LONG): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_set1_sigalgs_procname); +end; + + +function ERR_SSL_CTX_set1_sigalgs_list(ctx: PSSL_CTX; s: PByte): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_set1_sigalgs_list_procname); +end; + + +function ERR_SSL_set1_sigalgs(s: PSSL; slist: PIdC_INT; slistlen: TIdC_LONG): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_set1_sigalgs_procname); +end; + + +function ERR_SSL_set1_sigalgs_list(s: PSSL; str: PByte): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_set1_sigalgs_list_procname); +end; + + +function ERR_SSL_CTX_set1_client_sigalgs(ctx: PSSL_CTX; slist: PIdC_INT; slistlen: TIdC_LONG): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_set1_client_sigalgs_procname); +end; + + +function ERR_SSL_CTX_set1_client_sigalgs_list(ctx: PSSL_CTX; s: PByte): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_set1_client_sigalgs_list_procname); +end; + + +function ERR_SSL_set1_client_sigalgs(s: PSSL; slist: PIdC_INT; slistlen: TIdC_LONG): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_set1_client_sigalgs_procname); +end; + + +function ERR_SSL_set1_client_sigalgs_list(s: PSSL; str: PByte): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_set1_client_sigalgs_list_procname); +end; + + +function ERR_SSL_get0_certificate_types(s: PSSL; clist: PByte): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_get0_certificate_types_procname); +end; + + +function ERR_SSL_CTX_set1_client_certificate_types(ctx: PSSL_CTX; clist: PByte; clistlen: TIdC_LONG): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_set1_client_certificate_types_procname); +end; + + +function ERR_SSL_set1_client_certificate_types(s: PSSL; clist: PByte; clistlen: TIdC_LONG): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_set1_client_certificate_types_procname); +end; + + +function ERR_SSL_get_signature_nid(s: PSSL; pn: Pointer): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_get_signature_nid_procname); +end; + + +function ERR_SSL_get_peer_signature_nid(s: PSSL; pn: Pointer): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_get_peer_signature_nid_procname); +end; + + +function ERR_SSL_get_peer_tmp_key(s: PSSL; pk: Pointer): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_get_peer_tmp_key_procname); +end; + + +function ERR_SSL_get_tmp_key(s: PSSL; pk: Pointer): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_get_tmp_key_procname); +end; + + +function ERR_SSL_get0_raw_cipherlist(s: PSSL; plst: Pointer): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_get0_raw_cipherlist_procname); +end; + + +function ERR_SSL_get0_ec_point_formats(s: PSSL; plst: Pointer): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_get0_ec_point_formats_procname); +end; + + + + //typedef TIdC_INT (*tls_session_secret_cb_fn)(s: PSSL, void *secret, TIdC_INT *secret_len, + // STACK_OF(SSL_CIPHER) *peer_ciphers, + // const SSL_CIPHER **cipher, void *arg); + +function ERR_SSL_CTX_get_options(const ctx: PSSL_CTX): TIdC_ULONG; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_get_options_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_get_options(const s: PSSL): TIdC_ULONG; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_get_options_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_CTX_clear_options(ctx: PSSL_CTX; op: TIdC_ULONG): TIdC_ULONG; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_clear_options_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_clear_options(s: PSSL; op: TIdC_ULONG): TIdC_ULONG; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_clear_options_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_CTX_set_options(ctx: PSSL_CTX; op: TIdC_ULONG): TIdC_ULONG; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_set_options_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_set_options(s: PSSL; op: TIdC_ULONG): TIdC_ULONG; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_set_options_procname); +end; + + {introduced 1.1.0} + + //# define SSL_CTX_set_mode(ctx,op) \ + // SSL_CTX_ctrl((ctx),SSL_CTRL_MODE,(op),NULL) + //# define SSL_CTX_clear_mode(ctx,op) \ + // SSL_CTX_ctrl((ctx),SSL_CTRL_CLEAR_MODE,(op),NULL) + //# define SSL_CTX_get_mode(ctx) \ + // SSL_CTX_ctrl((ctx),SSL_CTRL_MODE,0,NULL) + //# define SSL_clear_mode(ssl,op) \ + // SSL_ctrl((ssl),SSL_CTRL_CLEAR_MODE,(op),NULL) + //# define SSL_set_mode(ssl,op) \ + // SSL_ctrl((ssl),SSL_CTRL_MODE,(op),NULL) + //# define SSL_get_mode(ssl) \ + // SSL_ctrl((ssl),SSL_CTRL_MODE,0,NULL) + //# define SSL_set_mtu(ssl, mtu) \ + // SSL_ctrl((ssl),SSL_CTRL_SET_MTU,(mtu),NULL) + //# define DTLS_set_link_mtu(ssl, mtu) \ + // SSL_ctrl((ssl),DTLS_CTRL_SET_LINK_MTU,(mtu),NULL) + //# define DTLS_get_link_min_mtu(ssl) \ + // SSL_ctrl((ssl),DTLS_CTRL_GET_LINK_MIN_MTU,0,NULL) + // + //# define SSL_get_secure_renegotiation_support(ssl) \ + // SSL_ctrl((ssl), SSL_CTRL_GET_RI_SUPPORT, 0, NULL) + // + //# ifndef OPENSSL_NO_HEARTBEATS + //# define SSL_heartbeat(ssl) \ + // SSL_ctrl((ssl),SSL_CTRL_DTLS_EXT_SEND_HEARTBEAT,0,NULL) + //# endif + // + //# define SSL_CTX_set_cert_flags(ctx,op) \ + // SSL_CTX_ctrl((ctx),SSL_CTRL_CERT_FLAGS,(op),NULL) + //# define SSL_set_cert_flags(s,op) \ + // SSL_ctrl((s),SSL_CTRL_CERT_FLAGS,(op),NULL) + //# define SSL_CTX_clear_cert_flags(ctx,op) \ + // SSL_CTX_ctrl((ctx),SSL_CTRL_CLEAR_CERT_FLAGS,(op),NULL) + //# define SSL_clear_cert_flags(s,op) \ + // SSL_ctrl((s),SSL_CTRL_CLEAR_CERT_FLAGS,(op),NULL) + // + //void SSL_CTX_set_msg_callback(ctx: PSSL_CTX, + // void (*cb) (TIdC_INT write_p, TIdC_INT version, + // TIdC_INT content_type, const void *buf, + // TIdC_SIZET len, ssl: PSSL, void *arg)); + //void SSL_set_msg_callback(ssl: PSSL, + // void (*cb) (TIdC_INT write_p, TIdC_INT version, + // TIdC_INT content_type, const void *buf, + // TIdC_SIZET len, ssl: PSSL, void *arg)); + //# define SSL_CTX_set_msg_callback_arg(ctx, arg) SSL_CTX_ctrl((ctx), SSL_CTRL_SET_MSG_CALLBACK_ARG, 0, (arg)) + //# define SSL_set_msg_callback_arg(ssl, arg) SSL_ctrl((ssl), SSL_CTRL_SET_MSG_CALLBACK_ARG, 0, (arg)) + // + //# define SSL_get_extms_support(s) \ + // SSL_ctrl((s),SSL_CTRL_GET_EXTMS_SUPPORT,0,NULL) + // + //# ifndef OPENSSL_NO_SRP + + ///* see tls_srp.c */ + //__owur TIdC_INT SSL_SRP_CTX_init(s: PSSL); + //__owur TIdC_INT SSL_CTX_SRP_CTX_init(ctx: PSSL_CTX); + //TIdC_INT SSL_SRP_CTX_free(SSL *ctx); + //TIdC_INT SSL_CTX_SRP_CTX_free(ctx: PSSL_CTX); + //__owur TIdC_INT SSL_srp_server_param_with_username(s: PSSL, TIdC_INT *ad); + //__owur TIdC_INT SRP_Calc_A_param(s: PSSL); + + // # endif + + // LHASH_OF(SSL_SESSION) *SSL_CTX_sessions(ctx: PSSL_CTX); + //# define SSL_CTX_sess_number(ctx) \ + // SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_NUMBER,0,NULL) + //# define SSL_CTX_sess_connect(ctx) \ + // SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_CONNECT,0,NULL) + //# define SSL_CTX_sess_connect_good(ctx) \ + // SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_CONNECT_GOOD,0,NULL) + //# define SSL_CTX_sess_connect_renegotiate(ctx) \ + // SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_CONNECT_RENEGOTIATE,0,NULL) + //# define SSL_CTX_sess_accept(ctx) \ + // SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_ACCEPT,0,NULL) + //# define SSL_CTX_sess_accept_renegotiate(ctx) \ + // SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_ACCEPT_RENEGOTIATE,0,NULL) + //# define SSL_CTX_sess_accept_good(ctx) \ + // SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_ACCEPT_GOOD,0,NULL) + //# define SSL_CTX_sess_hits(ctx) \ + // SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_HIT,0,NULL) + //# define SSL_CTX_sess_cb_hits(ctx) \ + // SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_CB_HIT,0,NULL) + //# define SSL_CTX_sess_misses(ctx) \ + // SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_MISSES,0,NULL) + //# define SSL_CTX_sess_timeouts(ctx) \ + // SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_TIMEOUTS,0,NULL) + //# define SSL_CTX_sess_cache_full(ctx) \ + // SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_CACHE_FULL,0,NULL) + +procedure ERR_SSL_CTX_sess_set_new_cb(ctx: PSSL_CTX; new_session_cb: SSL_CTX_sess_new_cb); +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_sess_set_new_cb_procname); +end; + + +function ERR_SSL_CTX_sess_get_new_cb(ctx: PSSL_CTX): SSL_CTX_sess_new_cb; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_sess_get_new_cb_procname); +end; + + +procedure ERR_SSL_CTX_sess_set_remove_cb(ctx: PSSL_CTX; remove_session_cb: SSL_CTX_sess_remove_cb); +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_sess_set_remove_cb_procname); +end; + + +function ERR_SSL_CTX_sess_get_remove_cb(ctx: PSSL_CTX): SSL_CTX_sess_remove_cb; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_sess_get_remove_cb_procname); +end; + + + + //void SSL_CTX_sess_set_get_cb(ctx: PSSL_CTX, + // SSL_SESSION *(*get_session_cb) (struct ssl_st + // *ssl, + // const Byte + // *data, TIdC_INT len, + // TIdC_INT *copy)); + //SSL_SESSION *(*SSL_CTX_sess_get_get_cb(ctx: PSSL_CTX)) (struct ssl_st *ssl, + // const d: PByteata, + // TIdC_INT len, TIdC_INT *copy); +procedure ERR_SSL_CTX_set_info_callback(ctx: PSSL_CTX; cb: SSL_CTX_info_callback); +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_set_info_callback_procname); +end; + + +function ERR_SSL_CTX_get_info_callback(ctx: PSSL_CTX): SSL_CTX_info_callback; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_get_info_callback_procname); +end; + + +procedure ERR_SSL_CTX_set_client_cert_cb(ctx: PSSL_CTX; client_cert_cb: SSL_CTX_client_cert_cb); +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_set_client_cert_cb_procname); +end; + + +function ERR_SSL_CTX_get_client_cert_cb(ctx: PSSL_CTX): SSL_CTX_client_cert_cb; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_get_client_cert_cb_procname); +end; + + +function ERR_SSL_CTX_set_client_cert_engine(ctx: PSSL_CTX; e: PENGINE): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_set_client_cert_engine_procname); +end; + + + +procedure ERR_SSL_CTX_set_cookie_generate_cb(ctx: PSSL_CTX; app_gen_cookie_cb: SSL_CTX_cookie_verify_cb); +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_set_cookie_generate_cb_procname); +end; + + +procedure ERR_SSL_CTX_set_cookie_verify_cb(ctx: PSSL_CTX; app_verify_cookie_cb: SSL_CTX_set_cookie_verify_cb_app_verify_cookie_cb); +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_set_cookie_verify_cb_procname); +end; + + +procedure ERR_SSL_CTX_set_stateless_cookie_generate_cb(ctx: PSSL_CTX; gen_stateless_cookie_cb: SSL_CTX_set_stateless_cookie_generate_cb_gen_stateless_cookie_cb); +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_set_stateless_cookie_generate_cb_procname); +end; + + {introduced 1.1.0} +procedure ERR_SSL_CTX_set_stateless_cookie_verify_cb(ctx: PSSL_CTX; verify_stateless_cookie_cb: SSL_CTX_set_stateless_cookie_verify_cb_verify_stateless_cookie_cb); +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_set_stateless_cookie_verify_cb_procname); +end; + + {introduced 1.1.0} + + //__owur TIdC_INT SSL_CTX_set_alpn_protos(ctx: PSSL_CTX, const Byte *protos, + // TIdC_UINT protos_len); + //__owur TIdC_INT SSL_set_alpn_protos(ssl: PSSL, const Byte *protos, + // TIdC_UINT protos_len); + +procedure ERR_SSL_CTX_set_alpn_select_cb(ctx: PSSL_CTX; cb: SSL_CTX_alpn_select_cb_func; arg: Pointer); +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_set_alpn_select_cb_procname); +end; + + +procedure ERR_SSL_get0_alpn_selected(const ssl: PSSL; const data: PPByte; len: PIdC_UINT); +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_get0_alpn_selected_procname); +end; + + +procedure ERR_SSL_CTX_set_psk_client_callback(ctx: PSSL_CTX; cb: SSL_psk_client_cb_func); +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_set_psk_client_callback_procname); +end; + + +procedure ERR_SSL_set_psk_client_callback(ssl: PSSL; cb: SSL_psk_client_cb_func); +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_set_psk_client_callback_procname); +end; + + +procedure ERR_SSL_CTX_set_psk_server_callback(ctx: PSSL_CTX; cb: SSL_psk_server_cb_func); +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_set_psk_server_callback_procname); +end; + + +procedure ERR_SSL_set_psk_server_callback(ssl: PSSL; cb: SSL_psk_server_cb_func); +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_set_psk_server_callback_procname); +end; + + + + //__owur TIdC_INT SSL_CTX_use_psk_identity_hint(ctx: PSSL_CTX, const PIdAnsiChar *identity_hint); + //__owur TIdC_INT SSL_use_psk_identity_hint(s: PSSL, const PIdAnsiChar *identity_hint); + //const PIdAnsiChar *SSL_get_psk_identity_hint(const s: PSSL); + //const PIdAnsiChar *SSL_get_psk_identity(const s: PSSL); + +procedure ERR_SSL_set_psk_find_session_callback(s: PSSL; cb: SSL_psk_find_session_cb_func); +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_set_psk_find_session_callback_procname); +end; + + {introduced 1.1.0} +procedure ERR_SSL_CTX_set_psk_find_session_callback(ctx: PSSL_CTX; cb: SSL_psk_find_session_cb_func); +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_set_psk_find_session_callback_procname); +end; + + {introduced 1.1.0} +procedure ERR_SSL_set_psk_use_session_callback(s: PSSL; cb: SSL_psk_use_session_cb_func); +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_set_psk_use_session_callback_procname); +end; + + {introduced 1.1.0} +procedure ERR_SSL_CTX_set_psk_use_session_callback(ctx: PSSL_CTX; cb: SSL_psk_use_session_cb_func); +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_set_psk_use_session_callback_procname); +end; + + {introduced 1.1.0} + + ///* Register callbacks to handle custom TLS Extensions for client or server. */ + + //__owur TIdC_INT SSL_CTX_has_client_custom_ext(const ctx: PSSL_CTX, + // TIdC_UINT ext_type); + // + //__owur TIdC_INT SSL_CTX_add_client_custom_ext(ctx: PSSL_CTX, + // TIdC_UINT ext_type, + // custom_ext_add_cb add_cb, + // custom_ext_free_cb free_cb, + // void *add_arg, + // custom_ext_parse_cb parse_cb, + // void *parse_arg); + // + //__owur TIdC_INT SSL_CTX_add_server_custom_ext(ctx: PSSL_CTX, + // TIdC_UINT ext_type, + // custom_ext_add_cb add_cb, + // custom_ext_free_cb free_cb, + // void *add_arg, + // custom_ext_parse_cb parse_cb, + // void *parse_arg); + // + //__owur TIdC_INT SSL_CTX_add_custom_ext(ctx: PSSL_CTX, TIdC_UINT ext_type, + // TIdC_UINT context, + // SSL_custom_ext_add_cb_ex add_cb, + // SSL_custom_ext_free_cb_ex free_cb, + // void *add_arg, + // SSL_custom_ext_parse_cb_ex parse_cb, + // void *parse_arg); + + //__owur TIdC_INT SSL_extension_supported(TIdC_UINT ext_type); + + + ///* These will only be used when doing non-blocking IO */ + //# define SSL_want_nothing(s) (SSL_want(s) == SSL_NOTHING) + //# define SSL_want_read(s) (SSL_want(s) == SSL_READING) + //# define SSL_want_write(s) (SSL_want(s) == SSL_WRITING) + //# define SSL_want_x509_lookup(s) (SSL_want(s) == SSL_X509_LOOKUP) + //# define SSL_want_async(s) (SSL_want(s) == SSL_ASYNC_PAUSED) + //# define SSL_want_async_job(s) (SSL_want(s) == SSL_ASYNC_NO_JOBS) + //# define SSL_want_client_hello_cb(s) (SSL_want(s) == SSL_CLIENT_HELLO_CB) + + (* + * SSL_CTX_set_keylog_callback configures a callback to log key material. This + * is intended for debugging use with tools like Wireshark. The cb function + * should log line followed by a newline. + *) +procedure ERR_SSL_CTX_set_keylog_callback(ctx: PSSL_CTX; cb: SSL_CTX_keylog_cb_func); +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_set_keylog_callback_procname); +end; + + {introduced 1.1.0} + (* + * SSL_CTX_get_keylog_callback returns the callback configured by + * SSL_CTX_set_keylog_callback. + *) +function ERR_SSL_CTX_get_keylog_callback(const ctx: PSSL_CTX): SSL_CTX_keylog_cb_func; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_get_keylog_callback_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_CTX_set_max_early_data(ctx: PSSL_CTX; max_early_data: TIdC_UINT32): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_set_max_early_data_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_CTX_get_max_early_data(const ctx: PSSL_CTX): TIdC_UINT32; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_get_max_early_data_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_set_max_early_data(s: PSSL; max_early_data: TIdC_UINT32): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_set_max_early_data_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_get_max_early_data(const s: PSSL): TIdC_UINT32; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_get_max_early_data_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_CTX_set_recv_max_early_data(ctx: PSSL_CTX; recv_max_early_data: TIdC_UINT32): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_set_recv_max_early_data_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_CTX_get_recv_max_early_data(const ctx: PSSL_CTX): TIdC_UINT32; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_get_recv_max_early_data_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_set_recv_max_early_data(s: PSSL; recv_max_early_data: TIdC_UINT32): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_set_recv_max_early_data_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_get_recv_max_early_data(const s: PSSL): TIdC_UINT32; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_get_recv_max_early_data_procname); +end; + + {introduced 1.1.0} + + ///* + // * These need to be after the above set of includes due to a compiler bug + // * in_ VisualStudio 2015 + // */ + //DEFINE_STACK_OF_CONST(SSL_CIPHER) + //DEFINE_STACK_OF(SSL_COMP) + + ///* compatibility */ + //# define SSL_set_app_data(s,arg) (SSL_set_ex_data(s,0,(PIdAnsiChar *)(arg))) + //# define SSL_get_app_data(s) (SSL_get_ex_data(s,0)) + //# define SSL_SESSION_set_app_data(s,a) (SSL_SESSION_set_ex_data(s,0, \ + // (PIdAnsiChar *)(a))) + //# define SSL_SESSION_get_app_data(s) (SSL_SESSION_get_ex_data(s,0)) + //# define SSL_CTX_get_app_data(ctx) (SSL_CTX_get_ex_data(ctx,0)) + //# define SSL_CTX_set_app_data(ctx,arg) (SSL_CTX_set_ex_data(ctx,0, \ + // (PIdAnsiChar *)(arg))) +function ERR_SSL_get_app_data(const ssl: PSSL): Pointer ; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_get_app_data_procname); +end; + + +function ERR_SSL_set_app_data(ssl: PSSL; data: Pointer): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_set_app_data_procname); +end; + + + + ///* Is the SSL_connection established? */ + //# define SSL_in_connect_init(a) (SSL_in_init(a) && !SSL_is_server(a)) + //# define SSL_in_accept_init(a) (SSL_in_init(a) && SSL_is_server(a)) +function ERR_SSL_in_init(const s: PSSL): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_in_init_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_in_before(const s: PSSL): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_in_before_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_is_init_finished(const s: PSSL): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_is_init_finished_procname); +end; + + {introduced 1.1.0} + + (*- + * Obtain latest Finished message + * -- that we sent (SSL_get_finished) + * -- that we expected from peer (SSL_get_peer_finished). + * Returns length (0 == no Finished so far), copies up to 'count' bytes. + *) +function ERR_SSL_get_finished(const s: PSSL; buf: Pointer; count: TIdC_SIZET): TIdC_SIZET; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_get_finished_procname); +end; + + +function ERR_SSL_get_peer_finished(const s: PSSL; buf: Pointer; count: TIdC_SIZET): TIdC_SIZET; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_get_peer_finished_procname); +end; + + + + //# if OPENSSL_API_COMPAT < 0x10100000L + //# define OpenSSL_add_ssl_algorithms() SSL_library_init() + //# define SSLeay_add_ssl_algorithms() SSL_library_init() + //# endif +function ERR_SSLeay_add_ssl_algorithms: TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSLeay_add_ssl_algorithms_procname); +end; + + + + ///* More backward compatibility */ + //# define SSL_get_cipher(s) \ + // SSL_CIPHER_get_name(SSL_get_current_cipher(s)) + //# define SSL_get_cipher_bits(s,np) \ + // SSL_CIPHER_get_bits(SSL_get_current_cipher(s),np) + //# define SSL_get_cipher_version(s) \ + // SSL_CIPHER_get_version(SSL_get_current_cipher(s)) + //# define SSL_get_cipher_name(s) \ + // SSL_CIPHER_get_name(SSL_get_current_cipher(s)) + //# define SSL_get_time(a) SSL_SESSION_get_time(a) + //# define SSL_set_time(a,b) SSL_SESSION_set_time((a),(b)) + //# define SSL_get_timeout(a) SSL_SESSION_get_timeout(a) + //# define SSL_set_timeout(a,b) SSL_SESSION_set_timeout((a),(b)) + // + //# define d2i_SSL_SESSION_bio(bp,s_id) ASN1_d2i_bio_of(SSL_SESSION,SSL_SESSION_new,d2i_SSL_SESSION,bp,s_id) + //# define i2d_SSL_SESSION_bio(bp,s_id) ASN1_i2d_bio_of(SSL_SESSION,i2d_SSL_SESSION,bp,s_id) + + //DECLARE_PEM_rw(SSL_SESSION, SSL_SESSION) + + //# define DTLSv1_get_timeout(ssl, arg) \ + // SSL_ctrl(ssl,DTLS_CTRL_GET_TIMEOUT,0, (void *)(arg)) + //# define DTLSv1_handle_timeout(ssl) \ + // SSL_ctrl(ssl,DTLS_CTRL_HANDLE_TIMEOUT,0, NULL) + // + ///* Backwards compatibility, original 1.1.0 names */ + //# define SSL_CTRL_GET_SERVER_TMP_KEY \ + // SSL_CTRL_GET_PEER_TMP_KEY + //# define SSL_get_server_tmp_key(s, pk) \ + // SSL_get_peer_tmp_key(s, pk) + + //# if OPENSSL_API_COMPAT < 0x10100000L + //const SSL_CTX_need_tmp_RSA = (ctx) 0; + //const SSL_CTX_set_tmp_rsa = (ctx;rsa) 1; + //const SSL_need_tmp_RSA = (ssl) 0; + //const SSL_set_tmp_rsa = (ssl;rsa) 1; + + //# define SSL_CTX_set_ecdh_auto(dummy, onoff) ((onoff) != 0) + //# define SSL_set_ecdh_auto(dummy, onoff) ((onoff) != 0) + ///* + // * We 'pretend' to call the callback to avoid warnings about unused static + // * functions. + // */ + //# define SSL_CTX_set_tmp_rsa_callback(ctx, cb) while(0) (cb)(NULL, 0, 0) + //# define SSL_set_tmp_rsa_callback(ssl, cb) while(0) (cb)(NULL, 0, 0) + //# endif + // +function ERR_BIO_f_ssl: PBIO_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_f_ssl_procname); +end; + + +function ERR_BIO_new_ssl(ctx: PSSL_CTX; client: TIdC_INT): PBIO; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_new_ssl_procname); +end; + + +function ERR_BIO_new_ssl_connect(ctx: PSSL_CTX): PBIO; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_new_ssl_connect_procname); +end; + + +function ERR_BIO_new_buffer_ssl_connect(ctx: PSSL_CTX): PBIO; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_new_buffer_ssl_connect_procname); +end; + + +function ERR_BIO_ssl_copy_session_id(to_: PBIO; from: PBIO): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_ssl_copy_session_id_procname); +end; + + + +function ERR_SSL_CTX_set_cipher_list(v1: PSSL_CTX; const str: PIdAnsiChar): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_set_cipher_list_procname); +end; + + +function ERR_SSL_CTX_new(const meth: PSSL_METHOD): PSSL_CTX; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_new_procname); +end; + + +function ERR_SSL_CTX_set_timeout(ctx: PSSL_CTX; t: TIdC_LONG): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_set_timeout_procname); +end; + + +function ERR_SSL_CTX_get_timeout(const ctx: PSSL_CTX): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_get_timeout_procname); +end; + + +function ERR_SSL_CTX_get_cert_store(const v1: PSSL_CTX): PX509_STORE; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_get_cert_store_procname); +end; + + +function ERR_SSL_want(const s: PSSL): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_want_procname); +end; + + +function ERR_SSL_clear(s: PSSL): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_clear_procname); +end; + + + +procedure ERR_BIO_ssl_shutdown(ssl_bio: PBIO); +begin + EIdAPIFunctionNotPresent.RaiseException(BIO_ssl_shutdown_procname); +end; + + +function ERR_SSL_CTX_up_ref(ctx: PSSL_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_up_ref_procname); +end; + + {introduced 1.1.0} +procedure ERR_SSL_CTX_free(v1: PSSL_CTX); +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_free_procname); +end; + + +procedure ERR_SSL_CTX_set_cert_store(v1: PSSL_CTX; v2: PX509_STORE); +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_set_cert_store_procname); +end; + + +procedure ERR_SSL_CTX_set1_cert_store(v1: PSSL_CTX; v2: PX509_STORE); +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_set1_cert_store_procname); +end; + + {introduced 1.1.0} + +procedure ERR_SSL_CTX_flush_sessions(ctx: PSSL_CTX; tm: TIdC_LONG); +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_flush_sessions_procname); +end; + + + +function ERR_SSL_get_current_cipher(const s: PSSL): PSSL_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_get_current_cipher_procname); +end; + + +function ERR_SSL_get_pending_cipher(const s: PSSL): PSSL_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_get_pending_cipher_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_CIPHER_get_bits(const c: PSSL_CIPHER; var alg_bits: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CIPHER_get_bits_procname); +end; + + +function ERR_SSL_CIPHER_get_version(const c: PSSL_CIPHER): PIdAnsiChar; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CIPHER_get_version_procname); +end; + + +function ERR_SSL_CIPHER_get_name(const c: PSSL_CIPHER): PIdAnsiChar; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CIPHER_get_name_procname); +end; + + +function ERR_SSL_CIPHER_standard_name(const c: PSSL_CIPHER): PIdAnsiChar; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CIPHER_standard_name_procname); +end; + + {introduced 1.1.0} +function ERR_OPENSSL_cipher_name(const rfc_name: PIdAnsiChar): PIdAnsiChar; +begin + EIdAPIFunctionNotPresent.RaiseException(OPENSSL_cipher_name_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_CIPHER_get_id(const c: PSSL_CIPHER): TIdC_UINT32; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CIPHER_get_id_procname); +end; + + +function ERR_SSL_CIPHER_get_protocol_id(const c: PSSL_CIPHER): TIdC_UINT16; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CIPHER_get_protocol_id_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_CIPHER_get_kx_nid(const c: PSSL_CIPHER): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CIPHER_get_kx_nid_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_CIPHER_get_auth_nid(const c: PSSL_CIPHER): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CIPHER_get_auth_nid_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_CIPHER_get_handshake_digest(const c: PSSL_CIPHER): PEVP_MD; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CIPHER_get_handshake_digest_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_CIPHER_is_aead(const c: PSSL_CIPHER): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CIPHER_is_aead_procname); +end; + + {introduced 1.1.0} + +function ERR_SSL_get_fd(const s: PSSL): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_get_fd_procname); +end; + + +function ERR_SSL_get_rfd(const s: PSSL): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_get_rfd_procname); +end; + + +function ERR_SSL_get_wfd(const s: PSSL): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_get_wfd_procname); +end; + + +function ERR_SSL_get_cipher_list(const s: PSSL; n: TIdC_INT): PIdAnsiChar; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_get_cipher_list_procname); +end; + + +function ERR_SSL_get_shared_ciphers(const s: PSSL; buf: PIdAnsiChar; size: TIdC_INT): PIdAnsiChar; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_get_shared_ciphers_procname); +end; + + +function ERR_SSL_get_read_ahead(const s: PSSL): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_get_read_ahead_procname); +end; + + +function ERR_SSL_pending(const s: PSSL): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_pending_procname); +end; + + +function ERR_SSL_has_pending(const s: PSSL): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_has_pending_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_set_fd(s: PSSL; fd: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_set_fd_procname); +end; + + +function ERR_SSL_set_rfd(s: PSSL; fd: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_set_rfd_procname); +end; + + +function ERR_SSL_set_wfd(s: PSSL; fd: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_set_wfd_procname); +end; + + +procedure ERR_SSL_set0_rbio(s: PSSL; rbio: PBIO); +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_set0_rbio_procname); +end; + + {introduced 1.1.0} +procedure ERR_SSL_set0_wbio(s: PSSL; wbio: PBIO); +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_set0_wbio_procname); +end; + + {introduced 1.1.0} +procedure ERR_SSL_set_bio(s: PSSL; rbio: PBIO; wbio: PBIO); +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_set_bio_procname); +end; + + +function ERR_SSL_get_rbio(const s: PSSL): PBIO; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_get_rbio_procname); +end; + + +function ERR_SSL_get_wbio(const s: PSSL): PBIO; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_get_wbio_procname); +end; + + +function ERR_SSL_set_cipher_list(s: PSSL; const str: PIdAnsiChar): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_set_cipher_list_procname); +end; + + +function ERR_SSL_CTX_set_ciphersuites(ctx: PSSL_CTX; const str: PIdAnsiChar): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_set_ciphersuites_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_set_ciphersuites(s: PSSL; const str: PIdAnsiChar): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_set_ciphersuites_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_get_verify_mode(const s: PSSL): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_get_verify_mode_procname); +end; + + +function ERR_SSL_get_verify_depth(const s: PSSL): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_get_verify_depth_procname); +end; + + +function ERR_SSL_get_verify_callback(const s: PSSL): SSL_verify_cb; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_get_verify_callback_procname); +end; + + +procedure ERR_SSL_set_read_ahead(s: PSSL; yes: TIdC_INT); +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_set_read_ahead_procname); +end; + + +procedure ERR_SSL_set_verify(s: PSSL; mode: TIdC_INT; callback: SSL_verify_cb); +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_set_verify_procname); +end; + + +procedure ERR_SSL_set_verify_depth(s: PSSL; depth: TIdC_INT); +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_set_verify_depth_procname); +end; + + + //void SSL_set_cert_cb(s: PSSL, TIdC_INT (*cb) (ssl: PSSL, void *arg), void *arg); + +function ERR_SSL_use_RSAPrivateKey(ssl: PSSL; rsa: PRSA): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_use_RSAPrivateKey_procname); +end; + + +function ERR_SSL_use_RSAPrivateKey_ASN1(ssl: PSSL; const d: PByte; len: TIdC_LONG): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_use_RSAPrivateKey_ASN1_procname); +end; + + +function ERR_SSL_use_PrivateKey(ssl: PSSL; pkey: PEVP_PKEY): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_use_PrivateKey_procname); +end; + + +function ERR_SSL_use_PrivateKey_ASN1(pk: TIdC_INT; ssl: PSSL; const d: PByte; len: TIdC_LONG): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_use_PrivateKey_ASN1_procname); +end; + + +function ERR_SSL_use_certificate(ssl: PSSL; x: PX509): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_use_certificate_procname); +end; + + +function ERR_SSL_use_certificate_ASN1(ssl: PSSL; const d: PByte; len: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_use_certificate_ASN1_procname); +end; + + + //__owur TIdC_INT SSL_use_cert_and_key(ssl: PSSL, x509: PX509, EVP_PKEY *privatekey, + // STACK_OF(X509) *chain, TIdC_INT override); + + (* Set serverinfo data for the current active cert. *) +function ERR_SSL_CTX_use_serverinfo(ctx: PSSL_CTX; const serverinfo: PByte; serverinfo_length: TIdC_SIZET): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_use_serverinfo_procname); +end; + + +function ERR_SSL_CTX_use_serverinfo_ex(ctx: PSSL_CTX; version: TIdC_UINT; const serverinfo: PByte; serverinfo_length: TIdC_SIZET): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_use_serverinfo_ex_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_CTX_use_serverinfo_file(ctx: PSSL_CTX; const file_: PIdAnsiChar): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_use_serverinfo_file_procname); +end; + + + +function ERR_SSL_use_RSAPrivateKey_file(ssl: PSSL; const file_: PIdAnsiChar; type_: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_use_RSAPrivateKey_file_procname); +end; + + + +function ERR_SSL_use_PrivateKey_file(ssl: PSSL; const file_: PIdAnsiChar; type_: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_use_PrivateKey_file_procname); +end; + + +function ERR_SSL_use_certificate_file(ssl: PSSL; const file_: PIdAnsiChar; type_: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_use_certificate_file_procname); +end; + + + +function ERR_SSL_CTX_use_RSAPrivateKey_file(ctx: PSSL_CTX; const file_: PIdAnsiChar; type_: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_use_RSAPrivateKey_file_procname); +end; + + + +function ERR_SSL_CTX_use_PrivateKey_file(ctx: PSSL_CTX; const file_: PIdAnsiChar; type_: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_use_PrivateKey_file_procname); +end; + + +function ERR_SSL_CTX_use_certificate_file(ctx: PSSL_CTX; const file_: PIdAnsiChar; type_: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_use_certificate_file_procname); +end; + + + (* PEM type *) +function ERR_SSL_CTX_use_certificate_chain_file(ctx: PSSL_CTX; const file_: PIdAnsiChar): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_use_certificate_chain_file_procname); +end; + + +function ERR_SSL_use_certificate_chain_file(ssl: PSSL; const file_: PIdAnsiChar): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_use_certificate_chain_file_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_load_client_CA_file(const file_: PIdAnsiChar): PSTACK_OF_X509_NAME; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_load_client_CA_file_procname); +end; + + +function ERR_SSL_add_file_cert_subjects_to_stack(stackCAs: PSTACK_OF_X509_NAME; const file_: PIdAnsiChar):TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_add_file_cert_subjects_to_stack_procname); +end; + + +function ERR_SSL_add_dir_cert_subjects_to_stack(stackCAs: PSTACK_OF_X509_NAME; const dir_: PIdAnsiChar): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_add_dir_cert_subjects_to_stack_procname); +end; + + + + //# if OPENSSL_API_COMPAT < 0x10100000L + //# define SSL_load_error_strings() \ + // OPENSSL_init_ssl(OPENSSL_INIT_LOAD_SSL_STRINGS \ + // | OPENSSL_INIT_LOAD_CRYPTO_STRINGS, NULL) + //# endif +procedure ERR_SSL_load_error_strings; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_load_error_strings_procname); +end; + + + +function ERR_SSL_state_string(const s: PSSL): PIdAnsiChar; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_state_string_procname); +end; + + +function ERR_SSL_rstate_string(const s: PSSL): PIdAnsiChar; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_rstate_string_procname); +end; + + +function ERR_SSL_state_string_long(const s: PSSL): PIdAnsiChar; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_state_string_long_procname); +end; + + +function ERR_SSL_rstate_string_long(const s: PSSL): PIdAnsiChar; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_rstate_string_long_procname); +end; + + +function ERR_SSL_SESSION_get_time(const s: PSSL_SESSION): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_SESSION_get_time_procname); +end; + + +function ERR_SSL_SESSION_set_time(s: PSSL_SESSION; t: TIdC_LONG): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_SESSION_set_time_procname); +end; + + +function ERR_SSL_SESSION_get_timeout(const s: PSSL_SESSION): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_SESSION_get_timeout_procname); +end; + + +function ERR_SSL_SESSION_set_timeout(s: PSSL_SESSION; t: TIdC_LONG): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_SESSION_set_timeout_procname); +end; + + +function ERR_SSL_SESSION_get_protocol_version(const s: PSSL_SESSION): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_SESSION_get_protocol_version_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_SESSION_set_protocol_version(s: PSSL_SESSION; version: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_SESSION_set_protocol_version_procname); +end; + + {introduced 1.1.0} + +function ERR_SSL_SESSION_get0_hostname(const s: PSSL_SESSION): PIdAnsiChar; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_SESSION_get0_hostname_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_SESSION_set1_hostname(s: PSSL_SESSION; const hostname: PIdAnsiChar): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_SESSION_set1_hostname_procname); +end; + + {introduced 1.1.0} +procedure ERR_SSL_SESSION_get0_alpn_selected(const s: PSSL_SESSION; const alpn: PPByte; len: PIdC_SIZET); +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_SESSION_get0_alpn_selected_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_SESSION_set1_alpn_selected(s: PSSL_SESSION; const alpn: PByte; len: TIdC_SIZET): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_SESSION_set1_alpn_selected_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_SESSION_get0_cipher(const s: PSSL_SESSION): PSSL_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_SESSION_get0_cipher_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_SESSION_set_cipher(s: PSSL_SESSION; const cipher: PSSL_CIPHER): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_SESSION_set_cipher_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_SESSION_has_ticket(const s: PSSL_SESSION): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_SESSION_has_ticket_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_SESSION_get_ticket_lifetime_hint(const s: PSSL_SESSION): TIdC_ULONG; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_SESSION_get_ticket_lifetime_hint_procname); +end; + + {introduced 1.1.0} +procedure ERR_SSL_SESSION_get0_ticket(const s: PSSL_SESSION; const tick: PPByte; len: PIdC_SIZET); +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_SESSION_get0_ticket_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_SESSION_get_max_early_data(const s: PSSL_SESSION): TIdC_UINT32; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_SESSION_get_max_early_data_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_SESSION_set_max_early_data(s: PSSL_SESSION; max_early_data: TIdC_UINT32): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_SESSION_set_max_early_data_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_copy_session_id(to_: PSSL; const from: PSSL): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_copy_session_id_procname); +end; + + +function ERR_SSL_SESSION_get0_peer(s: PSSL_SESSION): PX509; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_SESSION_get0_peer_procname); +end; + + +function ERR_SSL_SESSION_set1_id_context(s: PSSL_SESSION; const sid_ctx: PByte; sid_ctx_len: TIdC_UINT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_SESSION_set1_id_context_procname); +end; + + +function ERR_SSL_SESSION_set1_id(s: PSSL_SESSION; const sid: PByte; sid_len: TIdC_UINT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_SESSION_set1_id_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_SESSION_is_resumable(const s: PSSL_SESSION): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_SESSION_is_resumable_procname); +end; + + {introduced 1.1.0} + +function ERR_SSL_SESSION_new: PSSL_SESSION; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_SESSION_new_procname); +end; + + +function ERR_SSL_SESSION_dup(src: PSSL_SESSION): PSSL_SESSION; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_SESSION_dup_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_SESSION_get_id(const s: PSSL_SESSION; len: PIdC_UINT): PByte; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_SESSION_get_id_procname); +end; + + +function ERR_SSL_SESSION_get0_id_context(const s: PSSL_SESSION; len: PIdC_UINT): PByte; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_SESSION_get0_id_context_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_SESSION_get_compress_id(const s: PSSL_SESSION): TIdC_UINT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_SESSION_get_compress_id_procname); +end; + + +function ERR_SSL_SESSION_print(fp: PBIO; const ses: PSSL_SESSION): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_SESSION_print_procname); +end; + + +function ERR_SSL_SESSION_print_keylog(bp: PBIO; const x: PSSL_SESSION): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_SESSION_print_keylog_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_SESSION_up_ref(ses: PSSL_SESSION): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_SESSION_up_ref_procname); +end; + + {introduced 1.1.0} +procedure ERR_SSL_SESSION_free(ses: PSSL_SESSION); +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_SESSION_free_procname); +end; + + + //__owur TIdC_INT i2d_SSL_SESSION(SSL_SESSION *in_, Byte **pp); +function ERR_SSL_set_session(to_: PSSL; session: PSSL_SESSION): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_set_session_procname); +end; + + +function ERR_SSL_CTX_add_session(ctx: PSSL_CTX; session: PSSL_SESSION): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_add_session_procname); +end; + + +function ERR_SSL_CTX_remove_session(ctx: PSSL_CTX; session: PSSL_SESSION): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_remove_session_procname); +end; + + +function ERR_SSL_CTX_set_generate_session_id(ctx: PSSL_CTX; cb: GEN_SESSION_CB): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_set_generate_session_id_procname); +end; + + +function ERR_SSL_set_generate_session_id(s: PSSL; cb: GEN_SESSION_CB): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_set_generate_session_id_procname); +end; + + +function ERR_SSL_has_matching_session_id(const s: PSSL; const id: PByte; id_len: TIdC_UINT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_has_matching_session_id_procname); +end; + + +function ERR_d2i_SSL_SESSION(a: PPSSL_SESSION; const pp: PPByte; length: TIdC_LONG): PSSL_SESSION; +begin + EIdAPIFunctionNotPresent.RaiseException(d2i_SSL_SESSION_procname); +end; + + + +function ERR_SSL_get_peer_certificate(const s: PSSL): PX509; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_get_peer_certificate_procname); +end; + + + + //__owur STACK_OF(X509) *SSL_get_peer_cert_chain(const s: PSSL); + // +function ERR_SSL_CTX_get_verify_mode(const ctx: PSSL_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_get_verify_mode_procname); +end; + + +function ERR_SSL_CTX_get_verify_depth(const ctx: PSSL_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_get_verify_depth_procname); +end; + + +function ERR_SSL_CTX_get_verify_callback(const ctx: PSSL_CTX): SSL_verify_cb; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_get_verify_callback_procname); +end; + + +procedure ERR_SSL_CTX_set_verify(ctx: PSSL_CTX; mode: TIdC_INT; callback: SSL_verify_cb); +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_set_verify_procname); +end; + + +procedure ERR_SSL_CTX_set_verify_depth(ctx: PSSL_CTX; depth: TIdC_INT); +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_set_verify_depth_procname); +end; + + +procedure ERR_SSL_CTX_set_cert_verify_callback(ctx: PSSL_CTX; cb: SSL_CTX_set_cert_verify_callback_cb; arg: Pointer); +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_set_cert_verify_callback_procname); +end; + + +procedure ERR_SSL_CTX_set_cert_cb(c: PSSL_CTX; cb: SSL_CTX_set_cert_cb_cb; arg: Pointer); +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_set_cert_cb_procname); +end; + + +function ERR_SSL_CTX_use_RSAPrivateKey(ctx: PSSL_CTX; rsa: PRSA): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_use_RSAPrivateKey_procname); +end; + + +function ERR_SSL_CTX_use_RSAPrivateKey_ASN1(ctx: PSSL_CTX; const d: PByte; len: TIdC_LONG): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_use_RSAPrivateKey_ASN1_procname); +end; + + +function ERR_SSL_CTX_use_PrivateKey(ctx: PSSL_CTX; pkey: PEVP_PKEY): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_use_PrivateKey_procname); +end; + + +function ERR_SSL_CTX_use_PrivateKey_ASN1(pk: TIdC_INT; ctx: PSSL_CTX; const d: PByte; len: TIdC_LONG): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_use_PrivateKey_ASN1_procname); +end; + + +function ERR_SSL_CTX_use_certificate(ctx: PSSL_CTX; x: X509): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_use_certificate_procname); +end; + + +function ERR_SSL_CTX_use_certificate_ASN1(ctx: PSSL_CTX; len: TIdC_INT; const d: PByte): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_use_certificate_ASN1_procname); +end; + + + //function TIdC_INT SSL_CTX_use_cert_and_key(ctx: PSSL_CTX; x509: PX509; EVP_PKEY *privatekey; STACK_OF(X509) *chain; TIdC_INT override); + +procedure ERR_SSL_CTX_set_default_passwd_cb(ctx: PSSL_CTX; cb: pem_password_cb); +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_set_default_passwd_cb_procname); +end; + + {introduced 1.1.0} +procedure ERR_SSL_CTX_set_default_passwd_cb_userdata(ctx: PSSL_CTX; u: Pointer); +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_set_default_passwd_cb_userdata_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_CTX_get_default_passwd_cb(ctx: PSSL_CTX): pem_password_cb; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_get_default_passwd_cb_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_CTX_get_default_passwd_cb_userdata(ctx: PSSL_CTX): Pointer; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_get_default_passwd_cb_userdata_procname); +end; + + {introduced 1.1.0} +procedure ERR_SSL_set_default_passwd_cb(s: PSSL; cb: pem_password_cb); +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_set_default_passwd_cb_procname); +end; + + {introduced 1.1.0} +procedure ERR_SSL_set_default_passwd_cb_userdata(s: PSSL; u: Pointer); +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_set_default_passwd_cb_userdata_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_get_default_passwd_cb(s: PSSL): pem_password_cb; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_get_default_passwd_cb_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_get_default_passwd_cb_userdata(s: PSSL): Pointer; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_get_default_passwd_cb_userdata_procname); +end; + + {introduced 1.1.0} + +function ERR_SSL_CTX_check_private_key(const ctx: PSSL_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_check_private_key_procname); +end; + + +function ERR_SSL_check_private_key(const ctx: PSSL): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_check_private_key_procname); +end; + + + +function ERR_SSL_CTX_set_session_id_context(ctx: PSSL_CTX; const sid_ctx: PByte; sid_ctx_len: TIdC_UINT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_set_session_id_context_procname); +end; + + + +function ERR_SSL_new(ctx: PSSL_CTX): PSSL; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_new_procname); +end; + + +function ERR_SSL_up_ref(s: PSSL): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_up_ref_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_is_dtls(const s: PSSL): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_is_dtls_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_set_session_id_context(ssl: PSSL; const sid_ctx: PByte; sid_ctx_len: TIdC_UINT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_set_session_id_context_procname); +end; + + + +function ERR_SSL_CTX_set_purpose(ctx: PSSL_CTX; purpose: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_set_purpose_procname); +end; + + +function ERR_SSL_set_purpose(ssl: PSSL; purpose: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_set_purpose_procname); +end; + + +function ERR_SSL_CTX_set_trust(ctx: PSSL_CTX; trust: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_set_trust_procname); +end; + + +function ERR_SSL_set_trust(ssl: PSSL; trust: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_set_trust_procname); +end; + + + +function ERR_SSL_set1_host(s: PSSL; const hostname: PIdAnsiChar): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_set1_host_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_add1_host(s: PSSL; const hostname: PIdAnsiChar): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_add1_host_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_get0_peername(s: PSSL): PIdAnsiChar; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_get0_peername_procname); +end; + + {introduced 1.1.0} +procedure ERR_SSL_set_hostflags(s: PSSL; flags: TIdC_UINT); +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_set_hostflags_procname); +end; + + {introduced 1.1.0} + +function ERR_SSL_CTX_dane_enable(ctx: PSSL_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_dane_enable_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_CTX_dane_mtype_set(ctx: PSSL_CTX; const md: PEVP_MD; mtype: TIdC_UINT8; ord: TIdC_UINT8): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_dane_mtype_set_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_dane_enable(s: PSSL; const basedomain: PIdAnsiChar): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_dane_enable_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_dane_tlsa_add(s: PSSL; usage: TIdC_UINT8; selector: TIdC_UINT8; mtype: TIdC_UINT8; const data: PByte; dlen: TIdC_SIZET): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_dane_tlsa_add_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_get0_dane_authority(s: PSSL; mcert: PPX509; mspki: PPEVP_PKEY): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_get0_dane_authority_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_get0_dane_tlsa(s: PSSL; usage: PIdC_UINT8; selector: PIdC_UINT8; mtype: PIdC_UINT8; const data: PPByte; dlen: PIdC_SIZET): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_get0_dane_tlsa_procname); +end; + + {introduced 1.1.0} + (* + * Bridge opacity barrier between libcrypt and libssl, also needed to support + * offline testing in test/danetest.c + *) +function ERR_SSL_get0_dane(ssl: PSSL): PSSL_DANE; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_get0_dane_procname); +end; + + {introduced 1.1.0} + + (* + * DANE flags + *) +function ERR_SSL_CTX_dane_set_flags(ctx: PSSL_CTX; flags: TIdC_ULONG): TIdC_ULONG; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_dane_set_flags_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_CTX_dane_clear_flags(ctx: PSSL_CTX; flags: TIdC_ULONG): TIdC_ULONG; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_dane_clear_flags_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_dane_set_flags(ssl: PSSL; flags: TIdC_ULONG): TIdC_ULONG; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_dane_set_flags_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_dane_clear_flags(ssl: PSSL; flags: TIdC_ULONG): TIdC_ULONG; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_dane_clear_flags_procname); +end; + + {introduced 1.1.0} + +function ERR_SSL_CTX_set1_param(ctx: PSSL_CTX; vpm: PX509_VERIFY_PARAM): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_set1_param_procname); +end; + + +function ERR_SSL_set1_param(ssl: PSSL; vpm: PX509_VERIFY_PARAM): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_set1_param_procname); +end; + + + +function ERR_SSL_CTX_get0_param(ctx: PSSL_CTX): PX509_VERIFY_PARAM; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_get0_param_procname); +end; + + +function ERR_SSL_get0_param(ssl: PSSL): PX509_VERIFY_PARAM; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_get0_param_procname); +end; + + + +function ERR_SSL_CTX_set_srp_username(ctx: PSSL_CTX; name: PIdAnsiChar): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_set_srp_username_procname); +end; + + +function ERR_SSL_CTX_set_srp_password(ctx: PSSL_CTX; password: PIdAnsiChar): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_set_srp_password_procname); +end; + + +function ERR_SSL_CTX_set_srp_strength(ctx: PSSL_CTX; strength: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_set_srp_strength_procname); +end; + + + +function ERR_SSL_CTX_set_srp_client_pwd_callback(ctx: PSSL_CTX; cb: SSL_CTX_set_srp_client_pwd_callback_cb): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_set_srp_client_pwd_callback_procname); +end; + + +function ERR_SSL_CTX_set_srp_verify_param_callback(ctx: PSSL_CTX; cb: SSL_CTX_set_srp_verify_param_callback_cb): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_set_srp_verify_param_callback_procname); +end; + + +function ERR_SSL_CTX_set_srp_username_callback(ctx: PSSL_CTX; cb: SSL_CTX_set_srp_username_callback_cb): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_set_srp_username_callback_procname); +end; + + + +function ERR_SSL_CTX_set_srp_cb_arg(ctx: PSSL_CTX; arg: Pointer): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_set_srp_cb_arg_procname); +end; + + +function ERR_SSL_set_srp_server_param(s: PSSL; const N: PBIGNUm; const g: PBIGNUm; sa: PBIGNUm; v: PBIGNUm; info: PIdAnsiChar): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_set_srp_server_param_procname); +end; + + +function ERR_SSL_set_srp_server_param_pw(s: PSSL; const user: PIdAnsiChar; const pass: PIdAnsiChar; const grp: PIdAnsiChar): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_set_srp_server_param_pw_procname); +end; + + + + //__owur BIGNUM *SSL_get_srp_g(s: PSSL); + //__owur BIGNUM *SSL_get_srp_N(s: PSSL); + // + //__owur PIdAnsiChar *SSL_get_srp_username(s: PSSL); + //__owur PIdAnsiChar *SSL_get_srp_userinfo(s: PSSL); + // + ///* + // * ClientHello callback and helpers. + // */ +procedure ERR_SSL_CTX_set_client_hello_cb(c: PSSL_CTX; cb: SSL_client_hello_cb_fn; arg: Pointer); +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_set_client_hello_cb_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_client_hello_isv2(s: PSSL): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_client_hello_isv2_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_client_hello_get0_legacy_version(s: PSSL): TIdC_UINT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_client_hello_get0_legacy_version_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_client_hello_get0_random(s: PSSL; const out_: PPByte): TIdC_SIZET; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_client_hello_get0_random_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_client_hello_get0_session_id(s: PSSL; const out_: PPByte): TIdC_SIZET; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_client_hello_get0_session_id_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_client_hello_get0_ciphers(s: PSSL; const out_: PPByte): TIdC_SIZET; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_client_hello_get0_ciphers_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_client_hello_get0_compression_methods(s: PSSL; const out_: PPByte): TIdC_SIZET; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_client_hello_get0_compression_methods_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_client_hello_get1_extensions_present(s: PSSL; out_: PPIdC_INT; outlen: PIdC_SIZET): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_client_hello_get1_extensions_present_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_client_hello_get0_ext(s: PSSL; type_: TIdC_UINT; const out_: PPByte; outlen: PIdC_SIZET): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_client_hello_get0_ext_procname); +end; + + {introduced 1.1.0} +procedure ERR_SSL_certs_clear(s: PSSL); +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_certs_clear_procname); +end; + + +procedure ERR_SSL_free(ssl: PSSL); +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_free_procname); +end; + + + + (* + * Windows application developer has to include windows.h to use these. + *) +function ERR_SSL_waiting_for_async(s: PSSL): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_waiting_for_async_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_get_all_async_fds(s: PSSL; fds: POSSL_ASYNC_FD; numfds: PIdC_SIZET): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_get_all_async_fds_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_get_changed_async_fds(s: PSSL; addfd: POSSL_ASYNC_FD; numaddfds: PIdC_SIZET; delfd: POSSL_ASYNC_FD; numdelfds: PIdC_SIZET): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_get_changed_async_fds_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_accept(ssl: PSSL): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_accept_procname); +end; + + +function ERR_SSL_stateless(s: PSSL): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_stateless_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_connect(ssl: PSSL): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_connect_procname); +end; + + +function ERR_SSL_read(ssl: PSSL; buf: Pointer; num: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_read_procname); +end; + + +function ERR_SSL_read_ex(ssl: PSSL; buf: Pointer; num: TIdC_SIZET; readbytes: PIdC_SIZET): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_read_ex_procname); +end; + + {introduced 1.1.0} + +function ERR_SSL_read_early_data(s: PSSL; buf: Pointer; num: TIdC_SIZET; readbytes: PIdC_SIZET): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_read_early_data_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_peek(ssl: PSSL; buf: Pointer; num: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_peek_procname); +end; + + +function ERR_SSL_peek_ex(ssl: PSSL; buf: Pointer; num: TIdC_SIZET; readbytes: PIdC_SIZET): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_peek_ex_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_write(ssl: PSSL; const buf: Pointer; num: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_write_procname); +end; + + +function ERR_SSL_write_ex(s: PSSL; const buf: Pointer; num: TIdC_SIZET; written: PIdC_SIZET): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_write_ex_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_write_early_data(s: PSSL; const buf: Pointer; num: TIdC_SIZET; written: PIdC_SIZET): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_write_early_data_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_callback_ctrl(v1: PSSL; v2: TIdC_INT; v3: SSL_callback_ctrl_v3): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_callback_ctrl_procname); +end; + + + +function ERR_SSL_ctrl(ssl: PSSL; cmd: TIdC_INT; larg: TIdC_LONG; parg: Pointer): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_ctrl_procname); +end; + + +function ERR_SSL_CTX_ctrl(ctx: PSSL_CTX; cmd: TIdC_INT; larg: TIdC_LONG; parg: Pointer): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_ctrl_procname); +end; + + +function ERR_SSL_CTX_callback_ctrl(v1: PSSL_CTX; v2: TIdC_INT; v3: SSL_CTX_callback_ctrl_v3): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_callback_ctrl_procname); +end; + + + +function ERR_SSL_get_early_data_status(const s: PSSL): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_get_early_data_status_procname); +end; + + {introduced 1.1.0} + +function ERR_SSL_get_error(const s: PSSL; ret_code: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_get_error_procname); +end; + + +function ERR_SSL_get_version(const s: PSSL): PIdAnsiChar; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_get_version_procname); +end; + + + + (* This sets the 'default' SSL version that SSL_new() will create *) +function ERR_SSL_CTX_set_ssl_version(ctx: PSSL_CTX; const meth: PSSL_METHOD): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_set_ssl_version_procname); +end; + + + + ///* Negotiate highest available SSL/TLS version */ +function ERR_TLS_method: PSSL_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(TLS_method_procname); +end; + + {introduced 1.1.0} +function ERR_TLS_server_method: PSSL_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(TLS_server_method_procname); +end; + + {introduced 1.1.0} +function ERR_TLS_client_method: PSSL_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(TLS_client_method_procname); +end; + + {introduced 1.1.0} + + //__owur const SSL_METHOD *DTLS_method(void); /* DTLS 1.0 and 1.2 */ + //__owur const SSL_METHOD *DTLS_server_method(void); /* DTLS 1.0 and 1.2 */ + //__owur const SSL_METHOD *DTLS_client_method(void); /* DTLS 1.0 and 1.2 */ + // + //__owur TIdC_SIZET DTLS_get_data_mtu(const s: PSSL); + // + //__owur STACK_OF(SSL_CIPHER) *SSL_get_ciphers(const s: PSSL); + //__owur STACK_OF(SSL_CIPHER) *SSL_CTX_get_ciphers(const ctx: PSSL_CTX); + //__owur STACK_OF(SSL_CIPHER) *SSL_get_client_ciphers(const s: PSSL); + //__owur STACK_OF(SSL_CIPHER) *SSL_get1_supported_ciphers(s: PSSL); + // + //__owur TIdC_INT SSL_do_handshake(s: PSSL); +function ERR_SSL_key_update(s: PSSL; updatetype: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_key_update_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_get_key_update_type(const s: PSSL): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_get_key_update_type_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_renegotiate(s: PSSL): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_renegotiate_procname); +end; + + +function ERR_SSL_renegotiate_abbreviated(s: PSSL): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_renegotiate_abbreviated_procname); +end; + + +function ERR_SSL_shutdown(s: PSSL): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_shutdown_procname); +end; + + +procedure ERR_SSL_CTX_set_post_handshake_auth(ctx: PSSL_CTX; val: TIdC_INT); +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_set_post_handshake_auth_procname); +end; + + {introduced 1.1.0} +procedure ERR_SSL_set_post_handshake_auth(s: PSSL; val: TIdC_INT); +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_set_post_handshake_auth_procname); +end; + + {introduced 1.1.0} + +function ERR_SSL_renegotiate_pending(const s: PSSL): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_renegotiate_pending_procname); +end; + + +function ERR_SSL_verify_client_post_handshake(s: PSSL): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_verify_client_post_handshake_procname); +end; + + {introduced 1.1.0} + +function ERR_SSL_CTX_get_ssl_method(const ctx: PSSL_CTX): PSSL_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_get_ssl_method_procname); +end; + + +function ERR_SSL_get_ssl_method(const s: PSSL): PSSL_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_get_ssl_method_procname); +end; + + +function ERR_SSL_set_ssl_method(s: PSSL; const method: PSSL_METHOD): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_set_ssl_method_procname); +end; + + +function ERR_SSL_alert_type_string_long(value: TIdC_INT): PIdAnsiChar; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_alert_type_string_long_procname); +end; + + +function ERR_SSL_alert_type_string(value: TIdC_INT): PIdAnsiChar; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_alert_type_string_procname); +end; + + +function ERR_SSL_alert_desc_string_long(value: TIdC_INT): PIdAnsiChar; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_alert_desc_string_long_procname); +end; + + +function ERR_SSL_alert_desc_string(value: TIdC_INT): PIdAnsiChar; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_alert_desc_string_procname); +end; + + + + //void SSL_set0_CA_list(s: PSSL, STACK_OF(X509_NAME) *name_list); + //void SSL_CTX_set0_CA_list(ctx: PSSL_CTX, STACK_OF(X509_NAME) *name_list); + //__owur const STACK_OF(X509_NAME) *SSL_get0_CA_list(const s: PSSL); + //__owur const STACK_OF(X509_NAME) *SSL_CTX_get0_CA_list(const ctx: PSSL_CTX); + //__owur TIdC_INT SSL_add1_to_CA_list(ssl: PSSL, const X509 *x); + //__owur TIdC_INT SSL_CTX_add1_to_CA_list(ctx: PSSL_CTX, const X509 *x); + //__owur const STACK_OF(X509_NAME) *SSL_get0_peer_CA_list(const s: PSSL); + + //void SSL_set_client_CA_list(s: PSSL, STACK_OF(X509_NAME) *name_list); + //void SSL_CTX_set_client_CA_list(ctx: PSSL_CTX, STACK_OF(X509_NAME) *name_list); + //__owur STACK_OF(X509_NAME) *SSL_get_client_CA_list(const s: PSSL); + //__owur STACK_OF(X509_NAME) *SSL_CTX_get_client_CA_list(const SSL_CTX *s); + +procedure ERR_SSL_CTX_set_client_CA_list(ctx: PSSL_CTX; name_list: PSTACK_OF_X509_NAME); +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_set_client_CA_list_procname); +end; + + +function ERR_SSL_add_client_CA(ssl: PSSL; x: PX509): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_add_client_CA_procname); +end; + + +function ERR_SSL_CTX_add_client_CA(ctx: PSSL_CTX; x: PX509): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_add_client_CA_procname); +end; + + + +procedure ERR_SSL_set_connect_state(s: PSSL); +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_set_connect_state_procname); +end; + + +procedure ERR_SSL_set_accept_state(s: PSSL); +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_set_accept_state_procname); +end; + + + + //__owur TIdC_LONG SSL_get_default_timeout(const s: PSSL); + // + //# if OPENSSL_API_COMPAT < 0x10100000L + //# define SSL_library_init() OPENSSL_init_ssl(0, NULL) + //# endif +function ERR_SSL_library_init: TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_library_init_procname); +end; + + + + //__owur PIdAnsiChar *SSL_CIPHER_description(const SSL_CIPHER *, PIdAnsiChar *buf, TIdC_INT size); + //__owur STACK_OF(X509_NAME) *SSL_dup_CA_list(const STACK_OF(X509_NAME) *sk); +function ERR_SSL_CIPHER_description(cipher: PSSL_CIPHER; buf: PIdAnsiChar; size_ :TIdC_INT): PIdAnsiChar; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CIPHER_description_procname); +end; + + + +function ERR_SSL_dup(ssl: PSSL): PSSL; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_dup_procname); +end; + + + +function ERR_SSL_get_certificate(const ssl: PSSL): PX509; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_get_certificate_procname); +end; + + + (* + * EVP_PKEY + *) +function ERR_SSL_get_privatekey(const ssl: PSSL): PEVP_PKEY; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_get_privatekey_procname); +end; + + + +function ERR_SSL_CTX_get0_certificate(const ctx: PSSL_CTX): PX509; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_get0_certificate_procname); +end; + + +function ERR_SSL_CTX_get0_privatekey(const ctx: PSSL_CTX): PEVP_PKEY; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_get0_privatekey_procname); +end; + + + +procedure ERR_SSL_CTX_set_quiet_shutdown(ctx: PSSL_CTX; mode: TIdC_INT); +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_set_quiet_shutdown_procname); +end; + + +function ERR_SSL_CTX_get_quiet_shutdown(const ctx: PSSL_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_get_quiet_shutdown_procname); +end; + + +procedure ERR_SSL_set_quiet_shutdown(ssl: PSSL; mode: TIdC_INT); +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_set_quiet_shutdown_procname); +end; + + +function ERR_SSL_get_quiet_shutdown(const ssl: PSSL): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_get_quiet_shutdown_procname); +end; + + +procedure ERR_SSL_set_shutdown(ssl: PSSL; mode: TIdC_INT); +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_set_shutdown_procname); +end; + + +function ERR_SSL_get_shutdown(const ssl: PSSL): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_get_shutdown_procname); +end; + + +function ERR_SSL_version(const ssl: PSSL): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_version_procname); +end; + + +function ERR_SSL_client_version(const s: PSSL): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_client_version_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_CTX_set_default_verify_paths(ctx: PSSL_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_set_default_verify_paths_procname); +end; + + +function ERR_SSL_CTX_set_default_verify_dir(ctx: PSSL_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_set_default_verify_dir_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_CTX_set_default_verify_file(ctx: PSSL_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_set_default_verify_file_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_CTX_load_verify_locations(ctx: PSSL_CTX; const CAfile: PIdAnsiChar; const CApath: PIdAnsiChar): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_load_verify_locations_procname); +end; + + + //# define SSL_get0_session SSL_get_session/* just peek at pointer */ +function ERR_SSL_get_session(const ssl: PSSL): PSSL_SESSION; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_get_session_procname); +end; + + + (* obtain a reference count *) +function ERR_SSL_get1_session(ssl: PSSL): PSSL_SESSION; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_get1_session_procname); +end; + + +function ERR_SSL_get_SSL_CTX(const ssl: PSSL): PSSL_CTX; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_get_SSL_CTX_procname); +end; + + +function ERR_SSL_set_SSL_CTX(ssl: PSSL; ctx: PSSL_CTX): PSSL_CTX; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_set_SSL_CTX_procname); +end; + + +procedure ERR_SSL_set_info_callback(ssl: PSSL; cb: SSL_info_callback); +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_set_info_callback_procname); +end; + + +function ERR_SSL_get_info_callback(const ssl: PSSL): SSL_info_callback; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_get_info_callback_procname); +end; + + +function ERR_SSL_get_state(const ssl: PSSL): OSSL_HANDSHAKE_STATE; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_get_state_procname); +end; + + {introduced 1.1.0} + +procedure ERR_SSL_set_verify_result(ssl: PSSL; v: TIdC_LONG); +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_set_verify_result_procname); +end; + + +function ERR_SSL_get_verify_result(const ssl: PSSL): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_get_verify_result_procname); +end; + + + //__owur STACK_OF(X509) *SSL_get0_verified_chain(const s: PSSL); + +function ERR_SSL_get_client_random(const ssl: PSSL; out_: PByte; outlen: TIdC_SIZET): TIdC_SIZET; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_get_client_random_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_get_server_random(const ssl: PSSL; out_: PByte; outlen: TIdC_SIZET): TIdC_SIZET; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_get_server_random_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_SESSION_get_master_key(const sess: PSSL_SESSION; out_: PByte; outlen: TIdC_SIZET): TIdC_SIZET; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_SESSION_get_master_key_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_SESSION_set1_master_key(sess: PSSL_SESSION; const in_: PByte; len: TIdC_SIZET): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_SESSION_set1_master_key_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_SESSION_get_max_fragment_length(const sess: PSSL_SESSION): TIdC_UINT8; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_SESSION_get_max_fragment_length_procname); +end; + + {introduced 1.1.0} + + //#define SSL_get_ex_new_index(l, p, newf, dupf, freef) \ + // CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_SSL, l, p, newf, dupf, freef) +function ERR_SSL_set_ex_data(ssl: PSSL; idx: TIdC_INT; data: Pointer): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_set_ex_data_procname); +end; + + +function ERR_SSL_get_ex_data(const ssl: PSSL; idx: TIdC_INT): Pointer; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_get_ex_data_procname); +end; + + + //#define SSL_SESSION_get_ex_new_index(l, p, newf, dupf, freef) \ + // CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_SSL_SESSION, l, p, newf, dupf, freef) +function ERR_SSL_SESSION_set_ex_data(ss: PSSL_SESSION; idx: TIdC_INT; data: Pointer): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_SESSION_set_ex_data_procname); +end; + + +function ERR_SSL_SESSION_get_ex_data(const ss: PSSL_SESSION; idx: TIdC_INT): Pointer; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_SESSION_get_ex_data_procname); +end; + + + //#define SSL_CTX_get_ex_new_index(l, p, newf, dupf, freef) \ + // CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_SSL_CTX, l, p, newf, dupf, freef) +function ERR_SSL_CTX_set_ex_data(ssl: PSSL_CTX; idx: TIdC_INT; data: Pointer): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_set_ex_data_procname); +end; + + +function ERR_SSL_CTX_get_ex_data(const ssl: PSSL_CTX; idx: TIdC_INT): Pointer; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_get_ex_data_procname); +end; + + + +function ERR_SSL_get_ex_data_X509_STORE_CTX_idx: TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_get_ex_data_X509_STORE_CTX_idx_procname); +end; + + + + //# define SSL_CTX_get_default_read_ahead(ctx) SSL_CTX_get_read_ahead(ctx) + //# define SSL_CTX_set_default_read_ahead(ctx,m) SSL_CTX_set_read_ahead(ctx,m) + //# define SSL_CTX_get_read_ahead(ctx) \ + // SSL_CTX_ctrl(ctx,SSL_CTRL_GET_READ_AHEAD,0,NULL) + //# define SSL_CTX_set_read_ahead(ctx,m) \ + // SSL_CTX_ctrl(ctx,SSL_CTRL_SET_READ_AHEAD,m,NULL) + //# define SSL_CTX_get_max_cert_list(ctx) \ + // SSL_CTX_ctrl(ctx,SSL_CTRL_GET_MAX_CERT_LIST,0,NULL) + //# define SSL_CTX_set_max_cert_list(ctx,m) \ + // SSL_CTX_ctrl(ctx,SSL_CTRL_SET_MAX_CERT_LIST,m,NULL) + //# define SSL_get_max_cert_list(ssl) \ + // SSL_ctrl(ssl,SSL_CTRL_GET_MAX_CERT_LIST,0,NULL) + //# define SSL_set_max_cert_list(ssl,m) \ + // SSL_ctrl(ssl,SSL_CTRL_SET_MAX_CERT_LIST,m,NULL) + // + //# define SSL_CTX_set_max_send_fragment(ctx,m) \ + // SSL_CTX_ctrl(ctx,SSL_CTRL_SET_MAX_SEND_FRAGMENT,m,NULL) + //# define SSL_set_max_send_fragment(ssl,m) \ + // SSL_ctrl(ssl,SSL_CTRL_SET_MAX_SEND_FRAGMENT,m,NULL) + //# define SSL_CTX_set_split_send_fragment(ctx,m) \ + // SSL_CTX_ctrl(ctx,SSL_CTRL_SET_SPLIT_SEND_FRAGMENT,m,NULL) + //# define SSL_set_split_send_fragment(ssl,m) \ + // SSL_ctrl(ssl,SSL_CTRL_SET_SPLIT_SEND_FRAGMENT,m,NULL) + //# define SSL_CTX_set_max_pipelines(ctx,m) \ + // SSL_CTX_ctrl(ctx,SSL_CTRL_SET_MAX_PIPELINES,m,NULL) + //# define SSL_set_max_pipelines(ssl,m) \ + // SSL_ctrl(ssl,SSL_CTRL_SET_MAX_PIPELINES,m,NULL) + +procedure ERR_SSL_CTX_set_default_read_buffer_len(ctx: PSSL_CTX; len: TIdC_SIZET); +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_set_default_read_buffer_len_procname); +end; + + {introduced 1.1.0} +procedure ERR_SSL_set_default_read_buffer_len(s: PSSL; len: TIdC_SIZET); +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_set_default_read_buffer_len_procname); +end; + + {introduced 1.1.0} + +procedure ERR_SSL_CTX_set_tmp_dh_callback(ctx: PSSL_CTX; dh: SSL_CTX_set_tmp_dh_callback_dh); +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_set_tmp_dh_callback_procname); +end; + + +procedure ERR_SSL_set_tmp_dh_callback(ssl: PSSL; dh: SSL_set_tmp_dh_callback_dh); +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_set_tmp_dh_callback_procname); +end; + + + + //__owur const COMP_METHOD *SSL_get_current_compression(const s: PSSL); + //__owur const COMP_METHOD *SSL_get_current_expansion(const s: PSSL); + //__owur const PIdAnsiChar *SSL_COMP_get_name(const COMP_METHOD *comp); + //__owur const PIdAnsiChar *SSL_COMP_get0_name(const SSL_COMP *comp); + //__owur TIdC_INT SSL_COMP_get_id(const SSL_COMP *comp); + //STACK_OF(SSL_COMP) *SSL_COMP_get_compression_methods(void); + //__owur STACK_OF(SSL_COMP) *SSL_COMP_set0_compression_methods(STACK_OF(SSL_COMP) + // *meths); + //# if OPENSSL_API_COMPAT < 0x10100000L + //# define SSL_COMP_free_compression_methods() while(0) continue + //# endif + //__owur TIdC_INT SSL_COMP_add_compression_method(TIdC_INT id, COMP_METHOD *cm); + +function ERR_SSL_CIPHER_find(ssl: PSSL; const ptr: PByte): PSSL_CIPHER; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CIPHER_find_procname); +end; + + +function ERR_SSL_CIPHER_get_cipher_nid(const c: PSSL_CIPHEr): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CIPHER_get_cipher_nid_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_CIPHER_get_digest_nid(const c: PSSL_CIPHEr): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CIPHER_get_digest_nid_procname); +end; + + {introduced 1.1.0} + //TIdC_INT SSL_bytes_to_cipher_list(s: PSSL, const Byte *bytes, TIdC_SIZET len, + // TIdC_INT isv2format, STACK_OF(SSL_CIPHER) **sk, + // STACK_OF(SSL_CIPHER) **scsvs); + + (* TLS extensions functions *) +function ERR_SSL_set_session_ticket_ext(s: PSSL; ext_data: Pointer; ext_len: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_set_session_ticket_ext_procname); +end; + + + // +function ERR_SSL_set_session_ticket_ext_cb(s: PSSL; cb: tls_session_ticket_ext_cb_fn; arg: Pointer): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_set_session_ticket_ext_cb_procname); +end; + + + + ///* Pre-shared secret session resumption functions */ + //__owur TIdC_INT SSL_set_session_secret_cb(s: PSSL, + // tls_session_secret_cb_fn session_secret_cb, + // void *arg); + +procedure ERR_SSL_CTX_set_not_resumable_session_callback(ctx: PSSL_CTX; cb: SSL_CTX_set_not_resumable_session_callback_cb); +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_set_not_resumable_session_callback_procname); +end; + + {introduced 1.1.0} +procedure ERR_SSL_set_not_resumable_session_callback(ssl: PSSL; cb: SSL_set_not_resumable_session_callback_cb); +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_set_not_resumable_session_callback_procname); +end; + + {introduced 1.1.0} +procedure ERR_SSL_CTX_set_record_padding_callback(ctx: PSSL_CTX; cb: SSL_CTX_set_record_padding_callback_cb); +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_set_record_padding_callback_procname); +end; + + {introduced 1.1.0} + +procedure ERR_SSL_CTX_set_record_padding_callback_arg(ctx: PSSL_CTX; arg: Pointer); +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_set_record_padding_callback_arg_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_CTX_get_record_padding_callback_arg(const ctx: PSSL_CTX): Pointer; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_get_record_padding_callback_arg_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_CTX_set_block_padding(ctx: PSSL_CTX; block_size: TIdC_SIZET): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_set_block_padding_procname); +end; + + {introduced 1.1.0} + +procedure ERR_SSL_set_record_padding_callback(ssl: PSSL; cb: SSL_set_record_padding_callback_cb); +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_set_record_padding_callback_procname); +end; + + {introduced 1.1.0} + +procedure ERR_SSL_set_record_padding_callback_arg(ssl: PSSL; arg: Pointer); +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_set_record_padding_callback_arg_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_get_record_padding_callback_arg(const ssl: PSSL): Pointer; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_get_record_padding_callback_arg_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_set_block_padding(ssl: PSSL; block_size: TIdC_SIZET): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_set_block_padding_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_set_num_tickets(s: PSSL; num_tickets: TIdC_SIZET): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_set_num_tickets_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_get_num_tickets(const s: PSSL): TIdC_SIZET; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_get_num_tickets_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_CTX_set_num_tickets(ctx: PSSL_CTX; num_tickets: TIdC_SIZET): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_set_num_tickets_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_CTX_get_num_tickets(const ctx: PSSL_CTX): TIdC_SIZET; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_get_num_tickets_procname); +end; + + {introduced 1.1.0} + + //# if OPENSSL_API_COMPAT < 0x10100000L + //# define SSL_cache_hit(s) SSL_session_reused(s) + //# endif + +function ERR_SSL_session_reused(const s: PSSL): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_session_reused_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_is_server(const s: PSSL): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_is_server_procname); +end; + + + +function ERR_SSL_CONF_CTX_new: PSSL_CONF_CTX; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CONF_CTX_new_procname); +end; + + +function ERR_SSL_CONF_CTX_finish(cctx: PSSL_CONF_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CONF_CTX_finish_procname); +end; + + +procedure ERR_SSL_CONF_CTX_free(cctx: PSSL_CONF_CTX); +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CONF_CTX_free_procname); +end; + + +function ERR_SSL_CONF_CTX_set_flags(cctx: PSSL_CONF_CTX; flags: TIdC_UINT): TIdC_UINT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CONF_CTX_set_flags_procname); +end; + + +function ERR_SSL_CONF_CTX_clear_flags(cctx: PSSL_CONF_CTX; flags: TIdC_UINT): TIdC_UINT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CONF_CTX_clear_flags_procname); +end; + + +function ERR_SSL_CONF_CTX_set1_prefix(cctx: PSSL_CONF_CTX; const pre: PIdAnsiChar): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CONF_CTX_set1_prefix_procname); +end; + + +function ERR_SSL_CONF_cmd(cctx: PSSL_CONF_CTX; const cmd: PIdAnsiChar; const value: PIdAnsiChar): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CONF_cmd_procname); +end; + + +function ERR_SSL_CONF_cmd_argv(cctx: PSSL_CONF_CTX; pargc: PIdC_INT; pargv: PPPIdAnsiChar): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CONF_cmd_argv_procname); +end; + + +function ERR_SSL_CONF_cmd_value_type(cctx: PSSL_CONF_CTX; const cmd: PIdAnsiChar): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CONF_cmd_value_type_procname); +end; + + + +procedure ERR_SSL_CONF_CTX_set_ssl(cctx: PSSL_CONF_CTX; ssl: PSSL); +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CONF_CTX_set_ssl_procname); +end; + + +procedure ERR_SSL_CONF_CTX_set_ssl_ctx(cctx: PSSL_CONF_CTX; ctx: PSSL_CTX); +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CONF_CTX_set_ssl_ctx_procname); +end; + + +procedure ERR_SSL_add_ssl_module; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_add_ssl_module_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_config(s: PSSL; const name: PIdAnsiChar): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_config_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_CTX_config(ctx: PSSL_CTX; const name: PIdAnsiChar): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_config_procname); +end; + + {introduced 1.1.0} + +// procedure SSL_trace(write_p: TIdC_INT; version: TIdC_INT; content_type: TIdC_INT; const buf: Pointer; len: TIdC_SIZET; ssl: PSSL; arg: Pointer); + +function ERR_DTLSv1_listen(s: PSSL; client: PBIO_ADDr): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(DTLSv1_listen_procname); +end; + + {introduced 1.1.0} + + //# ifndef OPENSSL_NO_CT + // + ///* + // * A callback for verifying that the received SCTs are sufficient. + // * Expected to return 1 if they are sufficient, otherwise 0. + // * May return a negative integer if an error occurs. + // * A connection should be aborted if the SCTs are deemed insufficient. + // */ + //typedef TIdC_INT (*ssl_ct_validation_cb)(const CT_POLICY_EVAL_CTX *ctx, + // const STACK_OF(SCT) *scts, void *arg); + + ///* + // * Sets a |callback| that is invoked upon receipt of ServerHelloDone to validate + // * the received SCTs. + // * If the callback returns a non-positive result, the connection is terminated. + // * Call this function before beginning a handshake. + // * If a NULL |callback| is provided, SCT validation is disabled. + // * |arg| is arbitrary userdata that will be passed to the callback whenever it + // * is invoked. Ownership of |arg| remains with the caller. + // * + // * NOTE: A side-effect of setting a CT callback is that an OCSP stapled response + // * will be requested. + // */ + //function SSL_set_ct_validation_callback(s: PSSL; callback: ssl_ct_validation_cb; arg: Pointer): TIdC_INT; + //function SSL_CTX_set_ct_validation_callback(ctx: PSSL_CTX; callback: ssl_ct_validation_cb; arg: Pointer): TIdC_INT; + + //#define SSL_disable_ct(s) \ + // ((void) SSL_set_validation_callback((s), NULL, NULL)) + //#define SSL_CTX_disable_ct(ctx) \ + // ((void) SSL_CTX_set_validation_callback((ctx), NULL, NULL)) + + ///* + // * The validation type enumerates the available behaviours of the built-in SSL + // * CT validation callback selected via SSL_enable_ct() and SSL_CTX_enable_ct(). + // * The underlying callback is a static function in_ libssl. + // */ + + ///* + // * Enable CT by setting up a callback that implements one of the built-in + // * validation variants. The SSL_CT_VALIDATION_PERMISSIVE variant always + // * continues the handshake, the application can make appropriate decisions at + // * handshake completion. The SSL_CT_VALIDATION_STRICT variant requires at + // * least one valid SCT, or else handshake termination will be requested. The + // * handshake may continue anyway if SSL_VERIFY_NONE is in_ effect. + // */ +function ERR_SSL_enable_ct(s: PSSL; validation_mode: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_enable_ct_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_CTX_enable_ct(ctx: PSSL_CTX; validation_mode: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_enable_ct_procname); +end; + + {introduced 1.1.0} + + ///* + // * Report whether a non-NULL callback is enabled. + // */ +function ERR_SSL_ct_is_enabled(const s: PSSL): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_ct_is_enabled_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_CTX_ct_is_enabled(const ctx: PSSL_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_ct_is_enabled_procname); +end; + + {introduced 1.1.0} + + ///* Gets the SCTs received from a connection */ + //const STACK_OF(SCT) *SSL_get0_peer_scts(s: PSSL); + +function ERR_SSL_CTX_set_default_ctlog_list_file(ctx: PSSL_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_set_default_ctlog_list_file_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_CTX_set_ctlog_list_file(ctx: PSSL_CTX; const path: PIdAnsiChar): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_set_ctlog_list_file_procname); +end; + + {introduced 1.1.0} +procedure ERR_SSL_CTX_set0_ctlog_store(ctx: PSSL_CTX; logs: PCTLOG_STORE); +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_set0_ctlog_store_procname); +end; + + {introduced 1.1.0} + + // const CTLOG_STORE *SSL_CTX_get0_ctlog_store(const ctx: PSSL_CTX); + + // # endif /* OPENSSL_NO_CT */ + +procedure ERR_SSL_set_security_level(s: PSSL; level: TIdC_INT); +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_set_security_level_procname); +end; + + {introduced 1.1.0} + + ////__owur TIdC_INT SSL_get_security_level(const s: PSSL); +procedure ERR_SSL_set_security_callback(s: PSSL; cb: SSL_security_callback); +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_set_security_callback_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_get_security_callback(const s: PSSL): SSL_security_callback; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_get_security_callback_procname); +end; + + {introduced 1.1.0} +procedure ERR_SSL_set0_security_ex_data(s: PSSL; ex: Pointer); +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_set0_security_ex_data_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_get0_security_ex_data(const s: PSSL): Pointer; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_get0_security_ex_data_procname); +end; + + {introduced 1.1.0} +procedure ERR_SSL_CTX_set_security_level(ctx: PSSL_CTX; level: TIdC_INT); +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_set_security_level_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_CTX_get_security_level(const ctx: PSSL_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_get_security_level_procname); +end; + + {introduced 1.1.0} + //void SSL_CTX_set_security_callback(ctx: PSSL_CTX, + // TIdC_INT (*cb) (const s: PSSL, const ctx: PSSL_CTX, + // TIdC_INT op, TIdC_INT bits, TIdC_INT nid, + // void *other, void *ex)); + //TIdC_INT (*SSL_CTX_get_security_callback(const ctx: PSSL_CTX)) (const s: PSSL, + // const ctx: PSSL_CTX, + // TIdC_INT op, TIdC_INT bits, + // TIdC_INT nid, + // void *other, + // void *ex); + +function ERR_SSL_CTX_get0_security_ex_data(const ctx: PSSL_CTX): Pointer; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_get0_security_ex_data_procname); +end; + + {introduced 1.1.0} + +procedure ERR_SSL_CTX_set0_security_ex_data(ctx: PSSL_CTX; ex: Pointer); +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_set0_security_ex_data_procname); +end; + + {introduced 1.1.0} + +function ERR_OPENSSL_init_ssl(opts: TIdC_UINT64; const settings: POPENSSL_INIT_SETTINGS): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(OPENSSL_init_ssl_procname); +end; + + {introduced 1.1.0} + + //# ifndef OPENSSL_NO_UNIT_TEST + //__owur const struct openssl_ssl_test_functions *SSL_test_functions(void); + //# endif + +function ERR_SSL_free_buffers(ssl: PSSL): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_free_buffers_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_alloc_buffers(ssl: PSSL): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_alloc_buffers_procname); +end; + + {introduced 1.1.0} + +function ERR_SSL_CTX_set_session_ticket_cb(ctx: PSSL_CTX; gen_cb: SSL_CTX_generate_session_ticket_fn; dec_cb: SSL_CTX_decrypt_session_ticket_fn; arg: Pointer): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_set_session_ticket_cb_procname); +end; + + {introduced 1.1.0} + +function ERR_SSL_SESSION_set1_ticket_appdata(ss: PSSL_SESSION; const data: Pointer; len: TIdC_SIZET): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_SESSION_set1_ticket_appdata_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_SESSION_get0_ticket_appdata(ss: PSSL_SESSION; data: PPointer; len: PIdC_SIZET): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_SESSION_get0_ticket_appdata_procname); +end; + + {introduced 1.1.0} + + //extern const PIdAnsiChar SSL_version_str[]; + +procedure ERR_DTLS_set_timer_cb(s: PSSL; cb: DTLS_timer_cb); +begin + EIdAPIFunctionNotPresent.RaiseException(DTLS_set_timer_cb_procname); +end; + + {introduced 1.1.0} +procedure ERR_SSL_CTX_set_allow_early_data_cb(ctx: PSSL_CTX; cb: SSL_allow_early_data_cb_fN; arg: Pointer); +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_set_allow_early_data_cb_procname); +end; + + {introduced 1.1.0} +procedure ERR_SSL_set_allow_early_data_cb(s: PSSL; cb: SSL_allow_early_data_cb_fN; arg: Pointer); +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_set_allow_early_data_cb_procname); +end; + + {introduced 1.1.0} + +function ERR_SSLv2_method: PSSL_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(SSLv2_method_procname); +end; + + {removed 1.1.0 allow_nil} // SSLv2 +function ERR_SSLv2_server_method: PSSL_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(SSLv2_server_method_procname); +end; + + {removed 1.1.0 allow_nil} // SSLv2 +function ERR_SSLv2_client_method: PSSL_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(SSLv2_client_method_procname); +end; + + {removed 1.1.0 allow_nil} // SSLv2 +function ERR_SSLv3_method: PSSL_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(SSLv3_method_procname); +end; + + {removed 1.1.0 allow_nil} // SSLv3 +function ERR_SSLv3_server_method: PSSL_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(SSLv3_server_method_procname); +end; + + {removed 1.1.0 allow_nil} // SSLv3 +function ERR_SSLv3_client_method: PSSL_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(SSLv3_client_method_procname); +end; + + {removed 1.1.0 allow_nil} // SSLv3 +function ERR_SSLv23_method: PSSL_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(SSLv23_method_procname); +end; + + {removed 1.1.0 allow_nil} // SSLv3 but can rollback to v2 +function ERR_SSLv23_server_method: PSSL_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(SSLv23_server_method_procname); +end; + + {removed 1.1.0 allow_nil} // SSLv3 but can rollback to v2 +function ERR_SSLv23_client_method: PSSL_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(SSLv23_client_method_procname); +end; + + {removed 1.1.0 allow_nil} // SSLv3 but can rollback to v2 +function ERR_TLSv1_method: PSSL_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(TLSv1_method_procname); +end; + + {removed 1.1.0 allow_nil} // TLSv1.0 +function ERR_TLSv1_server_method: PSSL_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(TLSv1_server_method_procname); +end; + + {removed 1.1.0 allow_nil} // TLSv1.0 +function ERR_TLSv1_client_method: PSSL_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(TLSv1_client_method_procname); +end; + + {removed 1.1.0 allow_nil} // TLSv1.0 +function ERR_TLSv1_1_method: PSSL_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(TLSv1_1_method_procname); +end; + + {removed 1.1.0 allow_nil} //TLS1.1 +function ERR_TLSv1_1_server_method: PSSL_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(TLSv1_1_server_method_procname); +end; + + {removed 1.1.0 allow_nil} //TLS1.1 +function ERR_TLSv1_1_client_method: PSSL_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(TLSv1_1_client_method_procname); +end; + + {removed 1.1.0 allow_nil} //TLS1.1 +function ERR_TLSv1_2_method: PSSL_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(TLSv1_2_method_procname); +end; + + {removed 1.1.0 allow_nil} // TLSv1.2 +function ERR_TLSv1_2_server_method: PSSL_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(TLSv1_2_server_method_procname); +end; + + {removed 1.1.0 allow_nil} // TLSv1.2 +function ERR_TLSv1_2_client_method: PSSL_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(TLSv1_2_client_method_procname); +end; + + {removed 1.1.0 allow_nil} // TLSv1.2 + + //X509 *SSL_get0_peer_certificate(const SSL *s); +function ERR_SSL_get0_peer_certificate(const s: PSSL): PX509; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_get0_peer_certificate_procname); +end; + + {introduced 3.3.0} + // X509 *SSL_get1_peer_certificate(const SSL *s); +function ERR_SSL_get1_peer_certificate(const s: PSSL): PX509; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_get1_peer_certificate_procname); +end; + + {introduced 3.3.0} + + + +{$WARN NO_RETVAL ON} + +procedure Load(const ADllHandle: TIdLibHandle; LibVersion: TIdC_UINT; const AFailed: TStringList); + +var FuncLoadError: boolean; + +begin + SSL_CTX_set_mode := LoadLibFunction(ADllHandle, SSL_CTX_set_mode_procname); + FuncLoadError := not assigned(SSL_CTX_set_mode); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_set_mode_allownil)} + SSL_CTX_set_mode := @ERR_SSL_CTX_set_mode; + {$ifend} + {$if declared(SSL_CTX_set_mode_introduced)} + if LibVersion < SSL_CTX_set_mode_introduced then + begin + {$if declared(FC_SSL_CTX_set_mode)} + SSL_CTX_set_mode := @FC_SSL_CTX_set_mode; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_set_mode_removed)} + if SSL_CTX_set_mode_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_set_mode)} + SSL_CTX_set_mode := @_SSL_CTX_set_mode; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_set_mode_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_set_mode'); + {$ifend} + end; + + + SSL_CTX_clear_mode := LoadLibFunction(ADllHandle, SSL_CTX_clear_mode_procname); + FuncLoadError := not assigned(SSL_CTX_clear_mode); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_clear_mode_allownil)} + SSL_CTX_clear_mode := @ERR_SSL_CTX_clear_mode; + {$ifend} + {$if declared(SSL_CTX_clear_mode_introduced)} + if LibVersion < SSL_CTX_clear_mode_introduced then + begin + {$if declared(FC_SSL_CTX_clear_mode)} + SSL_CTX_clear_mode := @FC_SSL_CTX_clear_mode; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_clear_mode_removed)} + if SSL_CTX_clear_mode_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_clear_mode)} + SSL_CTX_clear_mode := @_SSL_CTX_clear_mode; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_clear_mode_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_clear_mode'); + {$ifend} + end; + + + SSL_CTX_sess_set_cache_size := LoadLibFunction(ADllHandle, SSL_CTX_sess_set_cache_size_procname); + FuncLoadError := not assigned(SSL_CTX_sess_set_cache_size); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_sess_set_cache_size_allownil)} + SSL_CTX_sess_set_cache_size := @ERR_SSL_CTX_sess_set_cache_size; + {$ifend} + {$if declared(SSL_CTX_sess_set_cache_size_introduced)} + if LibVersion < SSL_CTX_sess_set_cache_size_introduced then + begin + {$if declared(FC_SSL_CTX_sess_set_cache_size)} + SSL_CTX_sess_set_cache_size := @FC_SSL_CTX_sess_set_cache_size; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_sess_set_cache_size_removed)} + if SSL_CTX_sess_set_cache_size_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_sess_set_cache_size)} + SSL_CTX_sess_set_cache_size := @_SSL_CTX_sess_set_cache_size; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_sess_set_cache_size_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_sess_set_cache_size'); + {$ifend} + end; + + + SSL_CTX_sess_get_cache_size := LoadLibFunction(ADllHandle, SSL_CTX_sess_get_cache_size_procname); + FuncLoadError := not assigned(SSL_CTX_sess_get_cache_size); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_sess_get_cache_size_allownil)} + SSL_CTX_sess_get_cache_size := @ERR_SSL_CTX_sess_get_cache_size; + {$ifend} + {$if declared(SSL_CTX_sess_get_cache_size_introduced)} + if LibVersion < SSL_CTX_sess_get_cache_size_introduced then + begin + {$if declared(FC_SSL_CTX_sess_get_cache_size)} + SSL_CTX_sess_get_cache_size := @FC_SSL_CTX_sess_get_cache_size; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_sess_get_cache_size_removed)} + if SSL_CTX_sess_get_cache_size_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_sess_get_cache_size)} + SSL_CTX_sess_get_cache_size := @_SSL_CTX_sess_get_cache_size; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_sess_get_cache_size_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_sess_get_cache_size'); + {$ifend} + end; + + + SSL_CTX_set_session_cache_mode := LoadLibFunction(ADllHandle, SSL_CTX_set_session_cache_mode_procname); + FuncLoadError := not assigned(SSL_CTX_set_session_cache_mode); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_set_session_cache_mode_allownil)} + SSL_CTX_set_session_cache_mode := @ERR_SSL_CTX_set_session_cache_mode; + {$ifend} + {$if declared(SSL_CTX_set_session_cache_mode_introduced)} + if LibVersion < SSL_CTX_set_session_cache_mode_introduced then + begin + {$if declared(FC_SSL_CTX_set_session_cache_mode)} + SSL_CTX_set_session_cache_mode := @FC_SSL_CTX_set_session_cache_mode; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_set_session_cache_mode_removed)} + if SSL_CTX_set_session_cache_mode_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_set_session_cache_mode)} + SSL_CTX_set_session_cache_mode := @_SSL_CTX_set_session_cache_mode; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_set_session_cache_mode_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_set_session_cache_mode'); + {$ifend} + end; + + + SSL_CTX_get_session_cache_mode := LoadLibFunction(ADllHandle, SSL_CTX_get_session_cache_mode_procname); + FuncLoadError := not assigned(SSL_CTX_get_session_cache_mode); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_get_session_cache_mode_allownil)} + SSL_CTX_get_session_cache_mode := @ERR_SSL_CTX_get_session_cache_mode; + {$ifend} + {$if declared(SSL_CTX_get_session_cache_mode_introduced)} + if LibVersion < SSL_CTX_get_session_cache_mode_introduced then + begin + {$if declared(FC_SSL_CTX_get_session_cache_mode)} + SSL_CTX_get_session_cache_mode := @FC_SSL_CTX_get_session_cache_mode; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_get_session_cache_mode_removed)} + if SSL_CTX_get_session_cache_mode_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_get_session_cache_mode)} + SSL_CTX_get_session_cache_mode := @_SSL_CTX_get_session_cache_mode; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_get_session_cache_mode_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_get_session_cache_mode'); + {$ifend} + end; + + + SSL_clear_num_renegotiations := LoadLibFunction(ADllHandle, SSL_clear_num_renegotiations_procname); + FuncLoadError := not assigned(SSL_clear_num_renegotiations); + if FuncLoadError then + begin + {$if not defined(SSL_clear_num_renegotiations_allownil)} + SSL_clear_num_renegotiations := @ERR_SSL_clear_num_renegotiations; + {$ifend} + {$if declared(SSL_clear_num_renegotiations_introduced)} + if LibVersion < SSL_clear_num_renegotiations_introduced then + begin + {$if declared(FC_SSL_clear_num_renegotiations)} + SSL_clear_num_renegotiations := @FC_SSL_clear_num_renegotiations; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_clear_num_renegotiations_removed)} + if SSL_clear_num_renegotiations_removed <= LibVersion then + begin + {$if declared(_SSL_clear_num_renegotiations)} + SSL_clear_num_renegotiations := @_SSL_clear_num_renegotiations; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_clear_num_renegotiations_allownil)} + if FuncLoadError then + AFailed.Add('SSL_clear_num_renegotiations'); + {$ifend} + end; + + + SSL_total_renegotiations := LoadLibFunction(ADllHandle, SSL_total_renegotiations_procname); + FuncLoadError := not assigned(SSL_total_renegotiations); + if FuncLoadError then + begin + {$if not defined(SSL_total_renegotiations_allownil)} + SSL_total_renegotiations := @ERR_SSL_total_renegotiations; + {$ifend} + {$if declared(SSL_total_renegotiations_introduced)} + if LibVersion < SSL_total_renegotiations_introduced then + begin + {$if declared(FC_SSL_total_renegotiations)} + SSL_total_renegotiations := @FC_SSL_total_renegotiations; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_total_renegotiations_removed)} + if SSL_total_renegotiations_removed <= LibVersion then + begin + {$if declared(_SSL_total_renegotiations)} + SSL_total_renegotiations := @_SSL_total_renegotiations; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_total_renegotiations_allownil)} + if FuncLoadError then + AFailed.Add('SSL_total_renegotiations'); + {$ifend} + end; + + + SSL_CTX_set_tmp_dh := LoadLibFunction(ADllHandle, SSL_CTX_set_tmp_dh_procname); + FuncLoadError := not assigned(SSL_CTX_set_tmp_dh); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_set_tmp_dh_allownil)} + SSL_CTX_set_tmp_dh := @ERR_SSL_CTX_set_tmp_dh; + {$ifend} + {$if declared(SSL_CTX_set_tmp_dh_introduced)} + if LibVersion < SSL_CTX_set_tmp_dh_introduced then + begin + {$if declared(FC_SSL_CTX_set_tmp_dh)} + SSL_CTX_set_tmp_dh := @FC_SSL_CTX_set_tmp_dh; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_set_tmp_dh_removed)} + if SSL_CTX_set_tmp_dh_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_set_tmp_dh)} + SSL_CTX_set_tmp_dh := @_SSL_CTX_set_tmp_dh; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_set_tmp_dh_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_set_tmp_dh'); + {$ifend} + end; + + + SSL_CTX_set_tmp_ecdh := LoadLibFunction(ADllHandle, SSL_CTX_set_tmp_ecdh_procname); + FuncLoadError := not assigned(SSL_CTX_set_tmp_ecdh); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_set_tmp_ecdh_allownil)} + SSL_CTX_set_tmp_ecdh := @ERR_SSL_CTX_set_tmp_ecdh; + {$ifend} + {$if declared(SSL_CTX_set_tmp_ecdh_introduced)} + if LibVersion < SSL_CTX_set_tmp_ecdh_introduced then + begin + {$if declared(FC_SSL_CTX_set_tmp_ecdh)} + SSL_CTX_set_tmp_ecdh := @FC_SSL_CTX_set_tmp_ecdh; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_set_tmp_ecdh_removed)} + if SSL_CTX_set_tmp_ecdh_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_set_tmp_ecdh)} + SSL_CTX_set_tmp_ecdh := @_SSL_CTX_set_tmp_ecdh; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_set_tmp_ecdh_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_set_tmp_ecdh'); + {$ifend} + end; + + + SSL_CTX_set_dh_auto := LoadLibFunction(ADllHandle, SSL_CTX_set_dh_auto_procname); + FuncLoadError := not assigned(SSL_CTX_set_dh_auto); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_set_dh_auto_allownil)} + SSL_CTX_set_dh_auto := @ERR_SSL_CTX_set_dh_auto; + {$ifend} + {$if declared(SSL_CTX_set_dh_auto_introduced)} + if LibVersion < SSL_CTX_set_dh_auto_introduced then + begin + {$if declared(FC_SSL_CTX_set_dh_auto)} + SSL_CTX_set_dh_auto := @FC_SSL_CTX_set_dh_auto; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_set_dh_auto_removed)} + if SSL_CTX_set_dh_auto_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_set_dh_auto)} + SSL_CTX_set_dh_auto := @_SSL_CTX_set_dh_auto; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_set_dh_auto_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_set_dh_auto'); + {$ifend} + end; + + + SSL_set_dh_auto := LoadLibFunction(ADllHandle, SSL_set_dh_auto_procname); + FuncLoadError := not assigned(SSL_set_dh_auto); + if FuncLoadError then + begin + {$if not defined(SSL_set_dh_auto_allownil)} + SSL_set_dh_auto := @ERR_SSL_set_dh_auto; + {$ifend} + {$if declared(SSL_set_dh_auto_introduced)} + if LibVersion < SSL_set_dh_auto_introduced then + begin + {$if declared(FC_SSL_set_dh_auto)} + SSL_set_dh_auto := @FC_SSL_set_dh_auto; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_set_dh_auto_removed)} + if SSL_set_dh_auto_removed <= LibVersion then + begin + {$if declared(_SSL_set_dh_auto)} + SSL_set_dh_auto := @_SSL_set_dh_auto; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_set_dh_auto_allownil)} + if FuncLoadError then + AFailed.Add('SSL_set_dh_auto'); + {$ifend} + end; + + + SSL_set_tmp_dh := LoadLibFunction(ADllHandle, SSL_set_tmp_dh_procname); + FuncLoadError := not assigned(SSL_set_tmp_dh); + if FuncLoadError then + begin + {$if not defined(SSL_set_tmp_dh_allownil)} + SSL_set_tmp_dh := @ERR_SSL_set_tmp_dh; + {$ifend} + {$if declared(SSL_set_tmp_dh_introduced)} + if LibVersion < SSL_set_tmp_dh_introduced then + begin + {$if declared(FC_SSL_set_tmp_dh)} + SSL_set_tmp_dh := @FC_SSL_set_tmp_dh; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_set_tmp_dh_removed)} + if SSL_set_tmp_dh_removed <= LibVersion then + begin + {$if declared(_SSL_set_tmp_dh)} + SSL_set_tmp_dh := @_SSL_set_tmp_dh; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_set_tmp_dh_allownil)} + if FuncLoadError then + AFailed.Add('SSL_set_tmp_dh'); + {$ifend} + end; + + + SSL_set_tmp_ecdh := LoadLibFunction(ADllHandle, SSL_set_tmp_ecdh_procname); + FuncLoadError := not assigned(SSL_set_tmp_ecdh); + if FuncLoadError then + begin + {$if not defined(SSL_set_tmp_ecdh_allownil)} + SSL_set_tmp_ecdh := @ERR_SSL_set_tmp_ecdh; + {$ifend} + {$if declared(SSL_set_tmp_ecdh_introduced)} + if LibVersion < SSL_set_tmp_ecdh_introduced then + begin + {$if declared(FC_SSL_set_tmp_ecdh)} + SSL_set_tmp_ecdh := @FC_SSL_set_tmp_ecdh; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_set_tmp_ecdh_removed)} + if SSL_set_tmp_ecdh_removed <= LibVersion then + begin + {$if declared(_SSL_set_tmp_ecdh)} + SSL_set_tmp_ecdh := @_SSL_set_tmp_ecdh; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_set_tmp_ecdh_allownil)} + if FuncLoadError then + AFailed.Add('SSL_set_tmp_ecdh'); + {$ifend} + end; + + + SSL_CTX_add_extra_chain_cert := LoadLibFunction(ADllHandle, SSL_CTX_add_extra_chain_cert_procname); + FuncLoadError := not assigned(SSL_CTX_add_extra_chain_cert); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_add_extra_chain_cert_allownil)} + SSL_CTX_add_extra_chain_cert := @ERR_SSL_CTX_add_extra_chain_cert; + {$ifend} + {$if declared(SSL_CTX_add_extra_chain_cert_introduced)} + if LibVersion < SSL_CTX_add_extra_chain_cert_introduced then + begin + {$if declared(FC_SSL_CTX_add_extra_chain_cert)} + SSL_CTX_add_extra_chain_cert := @FC_SSL_CTX_add_extra_chain_cert; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_add_extra_chain_cert_removed)} + if SSL_CTX_add_extra_chain_cert_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_add_extra_chain_cert)} + SSL_CTX_add_extra_chain_cert := @_SSL_CTX_add_extra_chain_cert; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_add_extra_chain_cert_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_add_extra_chain_cert'); + {$ifend} + end; + + + SSL_CTX_get_extra_chain_certs := LoadLibFunction(ADllHandle, SSL_CTX_get_extra_chain_certs_procname); + FuncLoadError := not assigned(SSL_CTX_get_extra_chain_certs); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_get_extra_chain_certs_allownil)} + SSL_CTX_get_extra_chain_certs := @ERR_SSL_CTX_get_extra_chain_certs; + {$ifend} + {$if declared(SSL_CTX_get_extra_chain_certs_introduced)} + if LibVersion < SSL_CTX_get_extra_chain_certs_introduced then + begin + {$if declared(FC_SSL_CTX_get_extra_chain_certs)} + SSL_CTX_get_extra_chain_certs := @FC_SSL_CTX_get_extra_chain_certs; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_get_extra_chain_certs_removed)} + if SSL_CTX_get_extra_chain_certs_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_get_extra_chain_certs)} + SSL_CTX_get_extra_chain_certs := @_SSL_CTX_get_extra_chain_certs; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_get_extra_chain_certs_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_get_extra_chain_certs'); + {$ifend} + end; + + + SSL_CTX_get_extra_chain_certs_only := LoadLibFunction(ADllHandle, SSL_CTX_get_extra_chain_certs_only_procname); + FuncLoadError := not assigned(SSL_CTX_get_extra_chain_certs_only); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_get_extra_chain_certs_only_allownil)} + SSL_CTX_get_extra_chain_certs_only := @ERR_SSL_CTX_get_extra_chain_certs_only; + {$ifend} + {$if declared(SSL_CTX_get_extra_chain_certs_only_introduced)} + if LibVersion < SSL_CTX_get_extra_chain_certs_only_introduced then + begin + {$if declared(FC_SSL_CTX_get_extra_chain_certs_only)} + SSL_CTX_get_extra_chain_certs_only := @FC_SSL_CTX_get_extra_chain_certs_only; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_get_extra_chain_certs_only_removed)} + if SSL_CTX_get_extra_chain_certs_only_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_get_extra_chain_certs_only)} + SSL_CTX_get_extra_chain_certs_only := @_SSL_CTX_get_extra_chain_certs_only; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_get_extra_chain_certs_only_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_get_extra_chain_certs_only'); + {$ifend} + end; + + + SSL_CTX_clear_extra_chain_certs := LoadLibFunction(ADllHandle, SSL_CTX_clear_extra_chain_certs_procname); + FuncLoadError := not assigned(SSL_CTX_clear_extra_chain_certs); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_clear_extra_chain_certs_allownil)} + SSL_CTX_clear_extra_chain_certs := @ERR_SSL_CTX_clear_extra_chain_certs; + {$ifend} + {$if declared(SSL_CTX_clear_extra_chain_certs_introduced)} + if LibVersion < SSL_CTX_clear_extra_chain_certs_introduced then + begin + {$if declared(FC_SSL_CTX_clear_extra_chain_certs)} + SSL_CTX_clear_extra_chain_certs := @FC_SSL_CTX_clear_extra_chain_certs; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_clear_extra_chain_certs_removed)} + if SSL_CTX_clear_extra_chain_certs_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_clear_extra_chain_certs)} + SSL_CTX_clear_extra_chain_certs := @_SSL_CTX_clear_extra_chain_certs; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_clear_extra_chain_certs_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_clear_extra_chain_certs'); + {$ifend} + end; + + + SSL_CTX_set0_chain := LoadLibFunction(ADllHandle, SSL_CTX_set0_chain_procname); + FuncLoadError := not assigned(SSL_CTX_set0_chain); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_set0_chain_allownil)} + SSL_CTX_set0_chain := @ERR_SSL_CTX_set0_chain; + {$ifend} + {$if declared(SSL_CTX_set0_chain_introduced)} + if LibVersion < SSL_CTX_set0_chain_introduced then + begin + {$if declared(FC_SSL_CTX_set0_chain)} + SSL_CTX_set0_chain := @FC_SSL_CTX_set0_chain; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_set0_chain_removed)} + if SSL_CTX_set0_chain_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_set0_chain)} + SSL_CTX_set0_chain := @_SSL_CTX_set0_chain; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_set0_chain_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_set0_chain'); + {$ifend} + end; + + + SSL_CTX_set1_chain := LoadLibFunction(ADllHandle, SSL_CTX_set1_chain_procname); + FuncLoadError := not assigned(SSL_CTX_set1_chain); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_set1_chain_allownil)} + SSL_CTX_set1_chain := @ERR_SSL_CTX_set1_chain; + {$ifend} + {$if declared(SSL_CTX_set1_chain_introduced)} + if LibVersion < SSL_CTX_set1_chain_introduced then + begin + {$if declared(FC_SSL_CTX_set1_chain)} + SSL_CTX_set1_chain := @FC_SSL_CTX_set1_chain; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_set1_chain_removed)} + if SSL_CTX_set1_chain_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_set1_chain)} + SSL_CTX_set1_chain := @_SSL_CTX_set1_chain; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_set1_chain_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_set1_chain'); + {$ifend} + end; + + + SSL_CTX_add0_chain_cert := LoadLibFunction(ADllHandle, SSL_CTX_add0_chain_cert_procname); + FuncLoadError := not assigned(SSL_CTX_add0_chain_cert); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_add0_chain_cert_allownil)} + SSL_CTX_add0_chain_cert := @ERR_SSL_CTX_add0_chain_cert; + {$ifend} + {$if declared(SSL_CTX_add0_chain_cert_introduced)} + if LibVersion < SSL_CTX_add0_chain_cert_introduced then + begin + {$if declared(FC_SSL_CTX_add0_chain_cert)} + SSL_CTX_add0_chain_cert := @FC_SSL_CTX_add0_chain_cert; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_add0_chain_cert_removed)} + if SSL_CTX_add0_chain_cert_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_add0_chain_cert)} + SSL_CTX_add0_chain_cert := @_SSL_CTX_add0_chain_cert; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_add0_chain_cert_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_add0_chain_cert'); + {$ifend} + end; + + + SSL_CTX_add1_chain_cert := LoadLibFunction(ADllHandle, SSL_CTX_add1_chain_cert_procname); + FuncLoadError := not assigned(SSL_CTX_add1_chain_cert); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_add1_chain_cert_allownil)} + SSL_CTX_add1_chain_cert := @ERR_SSL_CTX_add1_chain_cert; + {$ifend} + {$if declared(SSL_CTX_add1_chain_cert_introduced)} + if LibVersion < SSL_CTX_add1_chain_cert_introduced then + begin + {$if declared(FC_SSL_CTX_add1_chain_cert)} + SSL_CTX_add1_chain_cert := @FC_SSL_CTX_add1_chain_cert; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_add1_chain_cert_removed)} + if SSL_CTX_add1_chain_cert_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_add1_chain_cert)} + SSL_CTX_add1_chain_cert := @_SSL_CTX_add1_chain_cert; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_add1_chain_cert_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_add1_chain_cert'); + {$ifend} + end; + + + SSL_CTX_get0_chain_certs := LoadLibFunction(ADllHandle, SSL_CTX_get0_chain_certs_procname); + FuncLoadError := not assigned(SSL_CTX_get0_chain_certs); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_get0_chain_certs_allownil)} + SSL_CTX_get0_chain_certs := @ERR_SSL_CTX_get0_chain_certs; + {$ifend} + {$if declared(SSL_CTX_get0_chain_certs_introduced)} + if LibVersion < SSL_CTX_get0_chain_certs_introduced then + begin + {$if declared(FC_SSL_CTX_get0_chain_certs)} + SSL_CTX_get0_chain_certs := @FC_SSL_CTX_get0_chain_certs; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_get0_chain_certs_removed)} + if SSL_CTX_get0_chain_certs_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_get0_chain_certs)} + SSL_CTX_get0_chain_certs := @_SSL_CTX_get0_chain_certs; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_get0_chain_certs_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_get0_chain_certs'); + {$ifend} + end; + + + SSL_CTX_clear_chain_certs := LoadLibFunction(ADllHandle, SSL_CTX_clear_chain_certs_procname); + FuncLoadError := not assigned(SSL_CTX_clear_chain_certs); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_clear_chain_certs_allownil)} + SSL_CTX_clear_chain_certs := @ERR_SSL_CTX_clear_chain_certs; + {$ifend} + {$if declared(SSL_CTX_clear_chain_certs_introduced)} + if LibVersion < SSL_CTX_clear_chain_certs_introduced then + begin + {$if declared(FC_SSL_CTX_clear_chain_certs)} + SSL_CTX_clear_chain_certs := @FC_SSL_CTX_clear_chain_certs; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_clear_chain_certs_removed)} + if SSL_CTX_clear_chain_certs_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_clear_chain_certs)} + SSL_CTX_clear_chain_certs := @_SSL_CTX_clear_chain_certs; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_clear_chain_certs_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_clear_chain_certs'); + {$ifend} + end; + + + SSL_CTX_build_cert_chain := LoadLibFunction(ADllHandle, SSL_CTX_build_cert_chain_procname); + FuncLoadError := not assigned(SSL_CTX_build_cert_chain); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_build_cert_chain_allownil)} + SSL_CTX_build_cert_chain := @ERR_SSL_CTX_build_cert_chain; + {$ifend} + {$if declared(SSL_CTX_build_cert_chain_introduced)} + if LibVersion < SSL_CTX_build_cert_chain_introduced then + begin + {$if declared(FC_SSL_CTX_build_cert_chain)} + SSL_CTX_build_cert_chain := @FC_SSL_CTX_build_cert_chain; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_build_cert_chain_removed)} + if SSL_CTX_build_cert_chain_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_build_cert_chain)} + SSL_CTX_build_cert_chain := @_SSL_CTX_build_cert_chain; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_build_cert_chain_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_build_cert_chain'); + {$ifend} + end; + + + SSL_CTX_select_current_cert := LoadLibFunction(ADllHandle, SSL_CTX_select_current_cert_procname); + FuncLoadError := not assigned(SSL_CTX_select_current_cert); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_select_current_cert_allownil)} + SSL_CTX_select_current_cert := @ERR_SSL_CTX_select_current_cert; + {$ifend} + {$if declared(SSL_CTX_select_current_cert_introduced)} + if LibVersion < SSL_CTX_select_current_cert_introduced then + begin + {$if declared(FC_SSL_CTX_select_current_cert)} + SSL_CTX_select_current_cert := @FC_SSL_CTX_select_current_cert; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_select_current_cert_removed)} + if SSL_CTX_select_current_cert_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_select_current_cert)} + SSL_CTX_select_current_cert := @_SSL_CTX_select_current_cert; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_select_current_cert_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_select_current_cert'); + {$ifend} + end; + + + SSL_CTX_set_current_cert := LoadLibFunction(ADllHandle, SSL_CTX_set_current_cert_procname); + FuncLoadError := not assigned(SSL_CTX_set_current_cert); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_set_current_cert_allownil)} + SSL_CTX_set_current_cert := @ERR_SSL_CTX_set_current_cert; + {$ifend} + {$if declared(SSL_CTX_set_current_cert_introduced)} + if LibVersion < SSL_CTX_set_current_cert_introduced then + begin + {$if declared(FC_SSL_CTX_set_current_cert)} + SSL_CTX_set_current_cert := @FC_SSL_CTX_set_current_cert; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_set_current_cert_removed)} + if SSL_CTX_set_current_cert_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_set_current_cert)} + SSL_CTX_set_current_cert := @_SSL_CTX_set_current_cert; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_set_current_cert_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_set_current_cert'); + {$ifend} + end; + + + SSL_CTX_set0_verify_cert_store := LoadLibFunction(ADllHandle, SSL_CTX_set0_verify_cert_store_procname); + FuncLoadError := not assigned(SSL_CTX_set0_verify_cert_store); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_set0_verify_cert_store_allownil)} + SSL_CTX_set0_verify_cert_store := @ERR_SSL_CTX_set0_verify_cert_store; + {$ifend} + {$if declared(SSL_CTX_set0_verify_cert_store_introduced)} + if LibVersion < SSL_CTX_set0_verify_cert_store_introduced then + begin + {$if declared(FC_SSL_CTX_set0_verify_cert_store)} + SSL_CTX_set0_verify_cert_store := @FC_SSL_CTX_set0_verify_cert_store; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_set0_verify_cert_store_removed)} + if SSL_CTX_set0_verify_cert_store_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_set0_verify_cert_store)} + SSL_CTX_set0_verify_cert_store := @_SSL_CTX_set0_verify_cert_store; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_set0_verify_cert_store_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_set0_verify_cert_store'); + {$ifend} + end; + + + SSL_CTX_set1_verify_cert_store := LoadLibFunction(ADllHandle, SSL_CTX_set1_verify_cert_store_procname); + FuncLoadError := not assigned(SSL_CTX_set1_verify_cert_store); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_set1_verify_cert_store_allownil)} + SSL_CTX_set1_verify_cert_store := @ERR_SSL_CTX_set1_verify_cert_store; + {$ifend} + {$if declared(SSL_CTX_set1_verify_cert_store_introduced)} + if LibVersion < SSL_CTX_set1_verify_cert_store_introduced then + begin + {$if declared(FC_SSL_CTX_set1_verify_cert_store)} + SSL_CTX_set1_verify_cert_store := @FC_SSL_CTX_set1_verify_cert_store; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_set1_verify_cert_store_removed)} + if SSL_CTX_set1_verify_cert_store_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_set1_verify_cert_store)} + SSL_CTX_set1_verify_cert_store := @_SSL_CTX_set1_verify_cert_store; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_set1_verify_cert_store_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_set1_verify_cert_store'); + {$ifend} + end; + + + SSL_CTX_set0_chain_cert_store := LoadLibFunction(ADllHandle, SSL_CTX_set0_chain_cert_store_procname); + FuncLoadError := not assigned(SSL_CTX_set0_chain_cert_store); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_set0_chain_cert_store_allownil)} + SSL_CTX_set0_chain_cert_store := @ERR_SSL_CTX_set0_chain_cert_store; + {$ifend} + {$if declared(SSL_CTX_set0_chain_cert_store_introduced)} + if LibVersion < SSL_CTX_set0_chain_cert_store_introduced then + begin + {$if declared(FC_SSL_CTX_set0_chain_cert_store)} + SSL_CTX_set0_chain_cert_store := @FC_SSL_CTX_set0_chain_cert_store; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_set0_chain_cert_store_removed)} + if SSL_CTX_set0_chain_cert_store_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_set0_chain_cert_store)} + SSL_CTX_set0_chain_cert_store := @_SSL_CTX_set0_chain_cert_store; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_set0_chain_cert_store_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_set0_chain_cert_store'); + {$ifend} + end; + + + SSL_CTX_set1_chain_cert_store := LoadLibFunction(ADllHandle, SSL_CTX_set1_chain_cert_store_procname); + FuncLoadError := not assigned(SSL_CTX_set1_chain_cert_store); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_set1_chain_cert_store_allownil)} + SSL_CTX_set1_chain_cert_store := @ERR_SSL_CTX_set1_chain_cert_store; + {$ifend} + {$if declared(SSL_CTX_set1_chain_cert_store_introduced)} + if LibVersion < SSL_CTX_set1_chain_cert_store_introduced then + begin + {$if declared(FC_SSL_CTX_set1_chain_cert_store)} + SSL_CTX_set1_chain_cert_store := @FC_SSL_CTX_set1_chain_cert_store; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_set1_chain_cert_store_removed)} + if SSL_CTX_set1_chain_cert_store_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_set1_chain_cert_store)} + SSL_CTX_set1_chain_cert_store := @_SSL_CTX_set1_chain_cert_store; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_set1_chain_cert_store_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_set1_chain_cert_store'); + {$ifend} + end; + + + SSL_set0_chain := LoadLibFunction(ADllHandle, SSL_set0_chain_procname); + FuncLoadError := not assigned(SSL_set0_chain); + if FuncLoadError then + begin + {$if not defined(SSL_set0_chain_allownil)} + SSL_set0_chain := @ERR_SSL_set0_chain; + {$ifend} + {$if declared(SSL_set0_chain_introduced)} + if LibVersion < SSL_set0_chain_introduced then + begin + {$if declared(FC_SSL_set0_chain)} + SSL_set0_chain := @FC_SSL_set0_chain; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_set0_chain_removed)} + if SSL_set0_chain_removed <= LibVersion then + begin + {$if declared(_SSL_set0_chain)} + SSL_set0_chain := @_SSL_set0_chain; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_set0_chain_allownil)} + if FuncLoadError then + AFailed.Add('SSL_set0_chain'); + {$ifend} + end; + + + SSL_set1_chain := LoadLibFunction(ADllHandle, SSL_set1_chain_procname); + FuncLoadError := not assigned(SSL_set1_chain); + if FuncLoadError then + begin + {$if not defined(SSL_set1_chain_allownil)} + SSL_set1_chain := @ERR_SSL_set1_chain; + {$ifend} + {$if declared(SSL_set1_chain_introduced)} + if LibVersion < SSL_set1_chain_introduced then + begin + {$if declared(FC_SSL_set1_chain)} + SSL_set1_chain := @FC_SSL_set1_chain; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_set1_chain_removed)} + if SSL_set1_chain_removed <= LibVersion then + begin + {$if declared(_SSL_set1_chain)} + SSL_set1_chain := @_SSL_set1_chain; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_set1_chain_allownil)} + if FuncLoadError then + AFailed.Add('SSL_set1_chain'); + {$ifend} + end; + + + SSL_add0_chain_cert := LoadLibFunction(ADllHandle, SSL_add0_chain_cert_procname); + FuncLoadError := not assigned(SSL_add0_chain_cert); + if FuncLoadError then + begin + {$if not defined(SSL_add0_chain_cert_allownil)} + SSL_add0_chain_cert := @ERR_SSL_add0_chain_cert; + {$ifend} + {$if declared(SSL_add0_chain_cert_introduced)} + if LibVersion < SSL_add0_chain_cert_introduced then + begin + {$if declared(FC_SSL_add0_chain_cert)} + SSL_add0_chain_cert := @FC_SSL_add0_chain_cert; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_add0_chain_cert_removed)} + if SSL_add0_chain_cert_removed <= LibVersion then + begin + {$if declared(_SSL_add0_chain_cert)} + SSL_add0_chain_cert := @_SSL_add0_chain_cert; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_add0_chain_cert_allownil)} + if FuncLoadError then + AFailed.Add('SSL_add0_chain_cert'); + {$ifend} + end; + + + SSL_add1_chain_cert := LoadLibFunction(ADllHandle, SSL_add1_chain_cert_procname); + FuncLoadError := not assigned(SSL_add1_chain_cert); + if FuncLoadError then + begin + {$if not defined(SSL_add1_chain_cert_allownil)} + SSL_add1_chain_cert := @ERR_SSL_add1_chain_cert; + {$ifend} + {$if declared(SSL_add1_chain_cert_introduced)} + if LibVersion < SSL_add1_chain_cert_introduced then + begin + {$if declared(FC_SSL_add1_chain_cert)} + SSL_add1_chain_cert := @FC_SSL_add1_chain_cert; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_add1_chain_cert_removed)} + if SSL_add1_chain_cert_removed <= LibVersion then + begin + {$if declared(_SSL_add1_chain_cert)} + SSL_add1_chain_cert := @_SSL_add1_chain_cert; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_add1_chain_cert_allownil)} + if FuncLoadError then + AFailed.Add('SSL_add1_chain_cert'); + {$ifend} + end; + + + SSL_get0_chain_certs := LoadLibFunction(ADllHandle, SSL_get0_chain_certs_procname); + FuncLoadError := not assigned(SSL_get0_chain_certs); + if FuncLoadError then + begin + {$if not defined(SSL_get0_chain_certs_allownil)} + SSL_get0_chain_certs := @ERR_SSL_get0_chain_certs; + {$ifend} + {$if declared(SSL_get0_chain_certs_introduced)} + if LibVersion < SSL_get0_chain_certs_introduced then + begin + {$if declared(FC_SSL_get0_chain_certs)} + SSL_get0_chain_certs := @FC_SSL_get0_chain_certs; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_get0_chain_certs_removed)} + if SSL_get0_chain_certs_removed <= LibVersion then + begin + {$if declared(_SSL_get0_chain_certs)} + SSL_get0_chain_certs := @_SSL_get0_chain_certs; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_get0_chain_certs_allownil)} + if FuncLoadError then + AFailed.Add('SSL_get0_chain_certs'); + {$ifend} + end; + + + SSL_clear_chain_certs := LoadLibFunction(ADllHandle, SSL_clear_chain_certs_procname); + FuncLoadError := not assigned(SSL_clear_chain_certs); + if FuncLoadError then + begin + {$if not defined(SSL_clear_chain_certs_allownil)} + SSL_clear_chain_certs := @ERR_SSL_clear_chain_certs; + {$ifend} + {$if declared(SSL_clear_chain_certs_introduced)} + if LibVersion < SSL_clear_chain_certs_introduced then + begin + {$if declared(FC_SSL_clear_chain_certs)} + SSL_clear_chain_certs := @FC_SSL_clear_chain_certs; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_clear_chain_certs_removed)} + if SSL_clear_chain_certs_removed <= LibVersion then + begin + {$if declared(_SSL_clear_chain_certs)} + SSL_clear_chain_certs := @_SSL_clear_chain_certs; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_clear_chain_certs_allownil)} + if FuncLoadError then + AFailed.Add('SSL_clear_chain_certs'); + {$ifend} + end; + + + SSL_build_cert_chain := LoadLibFunction(ADllHandle, SSL_build_cert_chain_procname); + FuncLoadError := not assigned(SSL_build_cert_chain); + if FuncLoadError then + begin + {$if not defined(SSL_build_cert_chain_allownil)} + SSL_build_cert_chain := @ERR_SSL_build_cert_chain; + {$ifend} + {$if declared(SSL_build_cert_chain_introduced)} + if LibVersion < SSL_build_cert_chain_introduced then + begin + {$if declared(FC_SSL_build_cert_chain)} + SSL_build_cert_chain := @FC_SSL_build_cert_chain; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_build_cert_chain_removed)} + if SSL_build_cert_chain_removed <= LibVersion then + begin + {$if declared(_SSL_build_cert_chain)} + SSL_build_cert_chain := @_SSL_build_cert_chain; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_build_cert_chain_allownil)} + if FuncLoadError then + AFailed.Add('SSL_build_cert_chain'); + {$ifend} + end; + + + SSL_select_current_cert := LoadLibFunction(ADllHandle, SSL_select_current_cert_procname); + FuncLoadError := not assigned(SSL_select_current_cert); + if FuncLoadError then + begin + {$if not defined(SSL_select_current_cert_allownil)} + SSL_select_current_cert := @ERR_SSL_select_current_cert; + {$ifend} + {$if declared(SSL_select_current_cert_introduced)} + if LibVersion < SSL_select_current_cert_introduced then + begin + {$if declared(FC_SSL_select_current_cert)} + SSL_select_current_cert := @FC_SSL_select_current_cert; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_select_current_cert_removed)} + if SSL_select_current_cert_removed <= LibVersion then + begin + {$if declared(_SSL_select_current_cert)} + SSL_select_current_cert := @_SSL_select_current_cert; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_select_current_cert_allownil)} + if FuncLoadError then + AFailed.Add('SSL_select_current_cert'); + {$ifend} + end; + + + SSL_set_current_cert := LoadLibFunction(ADllHandle, SSL_set_current_cert_procname); + FuncLoadError := not assigned(SSL_set_current_cert); + if FuncLoadError then + begin + {$if not defined(SSL_set_current_cert_allownil)} + SSL_set_current_cert := @ERR_SSL_set_current_cert; + {$ifend} + {$if declared(SSL_set_current_cert_introduced)} + if LibVersion < SSL_set_current_cert_introduced then + begin + {$if declared(FC_SSL_set_current_cert)} + SSL_set_current_cert := @FC_SSL_set_current_cert; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_set_current_cert_removed)} + if SSL_set_current_cert_removed <= LibVersion then + begin + {$if declared(_SSL_set_current_cert)} + SSL_set_current_cert := @_SSL_set_current_cert; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_set_current_cert_allownil)} + if FuncLoadError then + AFailed.Add('SSL_set_current_cert'); + {$ifend} + end; + + + SSL_set0_verify_cert_store := LoadLibFunction(ADllHandle, SSL_set0_verify_cert_store_procname); + FuncLoadError := not assigned(SSL_set0_verify_cert_store); + if FuncLoadError then + begin + {$if not defined(SSL_set0_verify_cert_store_allownil)} + SSL_set0_verify_cert_store := @ERR_SSL_set0_verify_cert_store; + {$ifend} + {$if declared(SSL_set0_verify_cert_store_introduced)} + if LibVersion < SSL_set0_verify_cert_store_introduced then + begin + {$if declared(FC_SSL_set0_verify_cert_store)} + SSL_set0_verify_cert_store := @FC_SSL_set0_verify_cert_store; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_set0_verify_cert_store_removed)} + if SSL_set0_verify_cert_store_removed <= LibVersion then + begin + {$if declared(_SSL_set0_verify_cert_store)} + SSL_set0_verify_cert_store := @_SSL_set0_verify_cert_store; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_set0_verify_cert_store_allownil)} + if FuncLoadError then + AFailed.Add('SSL_set0_verify_cert_store'); + {$ifend} + end; + + + SSL_set1_verify_cert_store := LoadLibFunction(ADllHandle, SSL_set1_verify_cert_store_procname); + FuncLoadError := not assigned(SSL_set1_verify_cert_store); + if FuncLoadError then + begin + {$if not defined(SSL_set1_verify_cert_store_allownil)} + SSL_set1_verify_cert_store := @ERR_SSL_set1_verify_cert_store; + {$ifend} + {$if declared(SSL_set1_verify_cert_store_introduced)} + if LibVersion < SSL_set1_verify_cert_store_introduced then + begin + {$if declared(FC_SSL_set1_verify_cert_store)} + SSL_set1_verify_cert_store := @FC_SSL_set1_verify_cert_store; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_set1_verify_cert_store_removed)} + if SSL_set1_verify_cert_store_removed <= LibVersion then + begin + {$if declared(_SSL_set1_verify_cert_store)} + SSL_set1_verify_cert_store := @_SSL_set1_verify_cert_store; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_set1_verify_cert_store_allownil)} + if FuncLoadError then + AFailed.Add('SSL_set1_verify_cert_store'); + {$ifend} + end; + + + SSL_set0_chain_cert_store := LoadLibFunction(ADllHandle, SSL_set0_chain_cert_store_procname); + FuncLoadError := not assigned(SSL_set0_chain_cert_store); + if FuncLoadError then + begin + {$if not defined(SSL_set0_chain_cert_store_allownil)} + SSL_set0_chain_cert_store := @ERR_SSL_set0_chain_cert_store; + {$ifend} + {$if declared(SSL_set0_chain_cert_store_introduced)} + if LibVersion < SSL_set0_chain_cert_store_introduced then + begin + {$if declared(FC_SSL_set0_chain_cert_store)} + SSL_set0_chain_cert_store := @FC_SSL_set0_chain_cert_store; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_set0_chain_cert_store_removed)} + if SSL_set0_chain_cert_store_removed <= LibVersion then + begin + {$if declared(_SSL_set0_chain_cert_store)} + SSL_set0_chain_cert_store := @_SSL_set0_chain_cert_store; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_set0_chain_cert_store_allownil)} + if FuncLoadError then + AFailed.Add('SSL_set0_chain_cert_store'); + {$ifend} + end; + + + SSL_set1_chain_cert_store := LoadLibFunction(ADllHandle, SSL_set1_chain_cert_store_procname); + FuncLoadError := not assigned(SSL_set1_chain_cert_store); + if FuncLoadError then + begin + {$if not defined(SSL_set1_chain_cert_store_allownil)} + SSL_set1_chain_cert_store := @ERR_SSL_set1_chain_cert_store; + {$ifend} + {$if declared(SSL_set1_chain_cert_store_introduced)} + if LibVersion < SSL_set1_chain_cert_store_introduced then + begin + {$if declared(FC_SSL_set1_chain_cert_store)} + SSL_set1_chain_cert_store := @FC_SSL_set1_chain_cert_store; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_set1_chain_cert_store_removed)} + if SSL_set1_chain_cert_store_removed <= LibVersion then + begin + {$if declared(_SSL_set1_chain_cert_store)} + SSL_set1_chain_cert_store := @_SSL_set1_chain_cert_store; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_set1_chain_cert_store_allownil)} + if FuncLoadError then + AFailed.Add('SSL_set1_chain_cert_store'); + {$ifend} + end; + + + SSL_get1_groups := LoadLibFunction(ADllHandle, SSL_get1_groups_procname); + FuncLoadError := not assigned(SSL_get1_groups); + if FuncLoadError then + begin + {$if not defined(SSL_get1_groups_allownil)} + SSL_get1_groups := @ERR_SSL_get1_groups; + {$ifend} + {$if declared(SSL_get1_groups_introduced)} + if LibVersion < SSL_get1_groups_introduced then + begin + {$if declared(FC_SSL_get1_groups)} + SSL_get1_groups := @FC_SSL_get1_groups; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_get1_groups_removed)} + if SSL_get1_groups_removed <= LibVersion then + begin + {$if declared(_SSL_get1_groups)} + SSL_get1_groups := @_SSL_get1_groups; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_get1_groups_allownil)} + if FuncLoadError then + AFailed.Add('SSL_get1_groups'); + {$ifend} + end; + + + SSL_CTX_set1_groups := LoadLibFunction(ADllHandle, SSL_CTX_set1_groups_procname); + FuncLoadError := not assigned(SSL_CTX_set1_groups); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_set1_groups_allownil)} + SSL_CTX_set1_groups := @ERR_SSL_CTX_set1_groups; + {$ifend} + {$if declared(SSL_CTX_set1_groups_introduced)} + if LibVersion < SSL_CTX_set1_groups_introduced then + begin + {$if declared(FC_SSL_CTX_set1_groups)} + SSL_CTX_set1_groups := @FC_SSL_CTX_set1_groups; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_set1_groups_removed)} + if SSL_CTX_set1_groups_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_set1_groups)} + SSL_CTX_set1_groups := @_SSL_CTX_set1_groups; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_set1_groups_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_set1_groups'); + {$ifend} + end; + + + SSL_CTX_set1_groups_list := LoadLibFunction(ADllHandle, SSL_CTX_set1_groups_list_procname); + FuncLoadError := not assigned(SSL_CTX_set1_groups_list); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_set1_groups_list_allownil)} + SSL_CTX_set1_groups_list := @ERR_SSL_CTX_set1_groups_list; + {$ifend} + {$if declared(SSL_CTX_set1_groups_list_introduced)} + if LibVersion < SSL_CTX_set1_groups_list_introduced then + begin + {$if declared(FC_SSL_CTX_set1_groups_list)} + SSL_CTX_set1_groups_list := @FC_SSL_CTX_set1_groups_list; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_set1_groups_list_removed)} + if SSL_CTX_set1_groups_list_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_set1_groups_list)} + SSL_CTX_set1_groups_list := @_SSL_CTX_set1_groups_list; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_set1_groups_list_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_set1_groups_list'); + {$ifend} + end; + + + SSL_set1_groups := LoadLibFunction(ADllHandle, SSL_set1_groups_procname); + FuncLoadError := not assigned(SSL_set1_groups); + if FuncLoadError then + begin + {$if not defined(SSL_set1_groups_allownil)} + SSL_set1_groups := @ERR_SSL_set1_groups; + {$ifend} + {$if declared(SSL_set1_groups_introduced)} + if LibVersion < SSL_set1_groups_introduced then + begin + {$if declared(FC_SSL_set1_groups)} + SSL_set1_groups := @FC_SSL_set1_groups; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_set1_groups_removed)} + if SSL_set1_groups_removed <= LibVersion then + begin + {$if declared(_SSL_set1_groups)} + SSL_set1_groups := @_SSL_set1_groups; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_set1_groups_allownil)} + if FuncLoadError then + AFailed.Add('SSL_set1_groups'); + {$ifend} + end; + + + SSL_set1_groups_list := LoadLibFunction(ADllHandle, SSL_set1_groups_list_procname); + FuncLoadError := not assigned(SSL_set1_groups_list); + if FuncLoadError then + begin + {$if not defined(SSL_set1_groups_list_allownil)} + SSL_set1_groups_list := @ERR_SSL_set1_groups_list; + {$ifend} + {$if declared(SSL_set1_groups_list_introduced)} + if LibVersion < SSL_set1_groups_list_introduced then + begin + {$if declared(FC_SSL_set1_groups_list)} + SSL_set1_groups_list := @FC_SSL_set1_groups_list; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_set1_groups_list_removed)} + if SSL_set1_groups_list_removed <= LibVersion then + begin + {$if declared(_SSL_set1_groups_list)} + SSL_set1_groups_list := @_SSL_set1_groups_list; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_set1_groups_list_allownil)} + if FuncLoadError then + AFailed.Add('SSL_set1_groups_list'); + {$ifend} + end; + + + SSL_get_shared_group := LoadLibFunction(ADllHandle, SSL_get_shared_group_procname); + FuncLoadError := not assigned(SSL_get_shared_group); + if FuncLoadError then + begin + {$if not defined(SSL_get_shared_group_allownil)} + SSL_get_shared_group := @ERR_SSL_get_shared_group; + {$ifend} + {$if declared(SSL_get_shared_group_introduced)} + if LibVersion < SSL_get_shared_group_introduced then + begin + {$if declared(FC_SSL_get_shared_group)} + SSL_get_shared_group := @FC_SSL_get_shared_group; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_get_shared_group_removed)} + if SSL_get_shared_group_removed <= LibVersion then + begin + {$if declared(_SSL_get_shared_group)} + SSL_get_shared_group := @_SSL_get_shared_group; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_get_shared_group_allownil)} + if FuncLoadError then + AFailed.Add('SSL_get_shared_group'); + {$ifend} + end; + + + SSL_CTX_set1_sigalgs := LoadLibFunction(ADllHandle, SSL_CTX_set1_sigalgs_procname); + FuncLoadError := not assigned(SSL_CTX_set1_sigalgs); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_set1_sigalgs_allownil)} + SSL_CTX_set1_sigalgs := @ERR_SSL_CTX_set1_sigalgs; + {$ifend} + {$if declared(SSL_CTX_set1_sigalgs_introduced)} + if LibVersion < SSL_CTX_set1_sigalgs_introduced then + begin + {$if declared(FC_SSL_CTX_set1_sigalgs)} + SSL_CTX_set1_sigalgs := @FC_SSL_CTX_set1_sigalgs; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_set1_sigalgs_removed)} + if SSL_CTX_set1_sigalgs_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_set1_sigalgs)} + SSL_CTX_set1_sigalgs := @_SSL_CTX_set1_sigalgs; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_set1_sigalgs_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_set1_sigalgs'); + {$ifend} + end; + + + SSL_CTX_set1_sigalgs_list := LoadLibFunction(ADllHandle, SSL_CTX_set1_sigalgs_list_procname); + FuncLoadError := not assigned(SSL_CTX_set1_sigalgs_list); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_set1_sigalgs_list_allownil)} + SSL_CTX_set1_sigalgs_list := @ERR_SSL_CTX_set1_sigalgs_list; + {$ifend} + {$if declared(SSL_CTX_set1_sigalgs_list_introduced)} + if LibVersion < SSL_CTX_set1_sigalgs_list_introduced then + begin + {$if declared(FC_SSL_CTX_set1_sigalgs_list)} + SSL_CTX_set1_sigalgs_list := @FC_SSL_CTX_set1_sigalgs_list; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_set1_sigalgs_list_removed)} + if SSL_CTX_set1_sigalgs_list_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_set1_sigalgs_list)} + SSL_CTX_set1_sigalgs_list := @_SSL_CTX_set1_sigalgs_list; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_set1_sigalgs_list_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_set1_sigalgs_list'); + {$ifend} + end; + + + SSL_set1_sigalgs := LoadLibFunction(ADllHandle, SSL_set1_sigalgs_procname); + FuncLoadError := not assigned(SSL_set1_sigalgs); + if FuncLoadError then + begin + {$if not defined(SSL_set1_sigalgs_allownil)} + SSL_set1_sigalgs := @ERR_SSL_set1_sigalgs; + {$ifend} + {$if declared(SSL_set1_sigalgs_introduced)} + if LibVersion < SSL_set1_sigalgs_introduced then + begin + {$if declared(FC_SSL_set1_sigalgs)} + SSL_set1_sigalgs := @FC_SSL_set1_sigalgs; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_set1_sigalgs_removed)} + if SSL_set1_sigalgs_removed <= LibVersion then + begin + {$if declared(_SSL_set1_sigalgs)} + SSL_set1_sigalgs := @_SSL_set1_sigalgs; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_set1_sigalgs_allownil)} + if FuncLoadError then + AFailed.Add('SSL_set1_sigalgs'); + {$ifend} + end; + + + SSL_set1_sigalgs_list := LoadLibFunction(ADllHandle, SSL_set1_sigalgs_list_procname); + FuncLoadError := not assigned(SSL_set1_sigalgs_list); + if FuncLoadError then + begin + {$if not defined(SSL_set1_sigalgs_list_allownil)} + SSL_set1_sigalgs_list := @ERR_SSL_set1_sigalgs_list; + {$ifend} + {$if declared(SSL_set1_sigalgs_list_introduced)} + if LibVersion < SSL_set1_sigalgs_list_introduced then + begin + {$if declared(FC_SSL_set1_sigalgs_list)} + SSL_set1_sigalgs_list := @FC_SSL_set1_sigalgs_list; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_set1_sigalgs_list_removed)} + if SSL_set1_sigalgs_list_removed <= LibVersion then + begin + {$if declared(_SSL_set1_sigalgs_list)} + SSL_set1_sigalgs_list := @_SSL_set1_sigalgs_list; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_set1_sigalgs_list_allownil)} + if FuncLoadError then + AFailed.Add('SSL_set1_sigalgs_list'); + {$ifend} + end; + + + SSL_CTX_set1_client_sigalgs := LoadLibFunction(ADllHandle, SSL_CTX_set1_client_sigalgs_procname); + FuncLoadError := not assigned(SSL_CTX_set1_client_sigalgs); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_set1_client_sigalgs_allownil)} + SSL_CTX_set1_client_sigalgs := @ERR_SSL_CTX_set1_client_sigalgs; + {$ifend} + {$if declared(SSL_CTX_set1_client_sigalgs_introduced)} + if LibVersion < SSL_CTX_set1_client_sigalgs_introduced then + begin + {$if declared(FC_SSL_CTX_set1_client_sigalgs)} + SSL_CTX_set1_client_sigalgs := @FC_SSL_CTX_set1_client_sigalgs; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_set1_client_sigalgs_removed)} + if SSL_CTX_set1_client_sigalgs_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_set1_client_sigalgs)} + SSL_CTX_set1_client_sigalgs := @_SSL_CTX_set1_client_sigalgs; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_set1_client_sigalgs_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_set1_client_sigalgs'); + {$ifend} + end; + + + SSL_CTX_set1_client_sigalgs_list := LoadLibFunction(ADllHandle, SSL_CTX_set1_client_sigalgs_list_procname); + FuncLoadError := not assigned(SSL_CTX_set1_client_sigalgs_list); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_set1_client_sigalgs_list_allownil)} + SSL_CTX_set1_client_sigalgs_list := @ERR_SSL_CTX_set1_client_sigalgs_list; + {$ifend} + {$if declared(SSL_CTX_set1_client_sigalgs_list_introduced)} + if LibVersion < SSL_CTX_set1_client_sigalgs_list_introduced then + begin + {$if declared(FC_SSL_CTX_set1_client_sigalgs_list)} + SSL_CTX_set1_client_sigalgs_list := @FC_SSL_CTX_set1_client_sigalgs_list; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_set1_client_sigalgs_list_removed)} + if SSL_CTX_set1_client_sigalgs_list_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_set1_client_sigalgs_list)} + SSL_CTX_set1_client_sigalgs_list := @_SSL_CTX_set1_client_sigalgs_list; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_set1_client_sigalgs_list_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_set1_client_sigalgs_list'); + {$ifend} + end; + + + SSL_set1_client_sigalgs := LoadLibFunction(ADllHandle, SSL_set1_client_sigalgs_procname); + FuncLoadError := not assigned(SSL_set1_client_sigalgs); + if FuncLoadError then + begin + {$if not defined(SSL_set1_client_sigalgs_allownil)} + SSL_set1_client_sigalgs := @ERR_SSL_set1_client_sigalgs; + {$ifend} + {$if declared(SSL_set1_client_sigalgs_introduced)} + if LibVersion < SSL_set1_client_sigalgs_introduced then + begin + {$if declared(FC_SSL_set1_client_sigalgs)} + SSL_set1_client_sigalgs := @FC_SSL_set1_client_sigalgs; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_set1_client_sigalgs_removed)} + if SSL_set1_client_sigalgs_removed <= LibVersion then + begin + {$if declared(_SSL_set1_client_sigalgs)} + SSL_set1_client_sigalgs := @_SSL_set1_client_sigalgs; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_set1_client_sigalgs_allownil)} + if FuncLoadError then + AFailed.Add('SSL_set1_client_sigalgs'); + {$ifend} + end; + + + SSL_set1_client_sigalgs_list := LoadLibFunction(ADllHandle, SSL_set1_client_sigalgs_list_procname); + FuncLoadError := not assigned(SSL_set1_client_sigalgs_list); + if FuncLoadError then + begin + {$if not defined(SSL_set1_client_sigalgs_list_allownil)} + SSL_set1_client_sigalgs_list := @ERR_SSL_set1_client_sigalgs_list; + {$ifend} + {$if declared(SSL_set1_client_sigalgs_list_introduced)} + if LibVersion < SSL_set1_client_sigalgs_list_introduced then + begin + {$if declared(FC_SSL_set1_client_sigalgs_list)} + SSL_set1_client_sigalgs_list := @FC_SSL_set1_client_sigalgs_list; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_set1_client_sigalgs_list_removed)} + if SSL_set1_client_sigalgs_list_removed <= LibVersion then + begin + {$if declared(_SSL_set1_client_sigalgs_list)} + SSL_set1_client_sigalgs_list := @_SSL_set1_client_sigalgs_list; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_set1_client_sigalgs_list_allownil)} + if FuncLoadError then + AFailed.Add('SSL_set1_client_sigalgs_list'); + {$ifend} + end; + + + SSL_get0_certificate_types := LoadLibFunction(ADllHandle, SSL_get0_certificate_types_procname); + FuncLoadError := not assigned(SSL_get0_certificate_types); + if FuncLoadError then + begin + {$if not defined(SSL_get0_certificate_types_allownil)} + SSL_get0_certificate_types := @ERR_SSL_get0_certificate_types; + {$ifend} + {$if declared(SSL_get0_certificate_types_introduced)} + if LibVersion < SSL_get0_certificate_types_introduced then + begin + {$if declared(FC_SSL_get0_certificate_types)} + SSL_get0_certificate_types := @FC_SSL_get0_certificate_types; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_get0_certificate_types_removed)} + if SSL_get0_certificate_types_removed <= LibVersion then + begin + {$if declared(_SSL_get0_certificate_types)} + SSL_get0_certificate_types := @_SSL_get0_certificate_types; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_get0_certificate_types_allownil)} + if FuncLoadError then + AFailed.Add('SSL_get0_certificate_types'); + {$ifend} + end; + + + SSL_CTX_set1_client_certificate_types := LoadLibFunction(ADllHandle, SSL_CTX_set1_client_certificate_types_procname); + FuncLoadError := not assigned(SSL_CTX_set1_client_certificate_types); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_set1_client_certificate_types_allownil)} + SSL_CTX_set1_client_certificate_types := @ERR_SSL_CTX_set1_client_certificate_types; + {$ifend} + {$if declared(SSL_CTX_set1_client_certificate_types_introduced)} + if LibVersion < SSL_CTX_set1_client_certificate_types_introduced then + begin + {$if declared(FC_SSL_CTX_set1_client_certificate_types)} + SSL_CTX_set1_client_certificate_types := @FC_SSL_CTX_set1_client_certificate_types; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_set1_client_certificate_types_removed)} + if SSL_CTX_set1_client_certificate_types_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_set1_client_certificate_types)} + SSL_CTX_set1_client_certificate_types := @_SSL_CTX_set1_client_certificate_types; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_set1_client_certificate_types_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_set1_client_certificate_types'); + {$ifend} + end; + + + SSL_set1_client_certificate_types := LoadLibFunction(ADllHandle, SSL_set1_client_certificate_types_procname); + FuncLoadError := not assigned(SSL_set1_client_certificate_types); + if FuncLoadError then + begin + {$if not defined(SSL_set1_client_certificate_types_allownil)} + SSL_set1_client_certificate_types := @ERR_SSL_set1_client_certificate_types; + {$ifend} + {$if declared(SSL_set1_client_certificate_types_introduced)} + if LibVersion < SSL_set1_client_certificate_types_introduced then + begin + {$if declared(FC_SSL_set1_client_certificate_types)} + SSL_set1_client_certificate_types := @FC_SSL_set1_client_certificate_types; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_set1_client_certificate_types_removed)} + if SSL_set1_client_certificate_types_removed <= LibVersion then + begin + {$if declared(_SSL_set1_client_certificate_types)} + SSL_set1_client_certificate_types := @_SSL_set1_client_certificate_types; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_set1_client_certificate_types_allownil)} + if FuncLoadError then + AFailed.Add('SSL_set1_client_certificate_types'); + {$ifend} + end; + + + SSL_get_signature_nid := LoadLibFunction(ADllHandle, SSL_get_signature_nid_procname); + FuncLoadError := not assigned(SSL_get_signature_nid); + if FuncLoadError then + begin + {$if not defined(SSL_get_signature_nid_allownil)} + SSL_get_signature_nid := @ERR_SSL_get_signature_nid; + {$ifend} + {$if declared(SSL_get_signature_nid_introduced)} + if LibVersion < SSL_get_signature_nid_introduced then + begin + {$if declared(FC_SSL_get_signature_nid)} + SSL_get_signature_nid := @FC_SSL_get_signature_nid; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_get_signature_nid_removed)} + if SSL_get_signature_nid_removed <= LibVersion then + begin + {$if declared(_SSL_get_signature_nid)} + SSL_get_signature_nid := @_SSL_get_signature_nid; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_get_signature_nid_allownil)} + if FuncLoadError then + AFailed.Add('SSL_get_signature_nid'); + {$ifend} + end; + + + SSL_get_peer_signature_nid := LoadLibFunction(ADllHandle, SSL_get_peer_signature_nid_procname); + FuncLoadError := not assigned(SSL_get_peer_signature_nid); + if FuncLoadError then + begin + {$if not defined(SSL_get_peer_signature_nid_allownil)} + SSL_get_peer_signature_nid := @ERR_SSL_get_peer_signature_nid; + {$ifend} + {$if declared(SSL_get_peer_signature_nid_introduced)} + if LibVersion < SSL_get_peer_signature_nid_introduced then + begin + {$if declared(FC_SSL_get_peer_signature_nid)} + SSL_get_peer_signature_nid := @FC_SSL_get_peer_signature_nid; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_get_peer_signature_nid_removed)} + if SSL_get_peer_signature_nid_removed <= LibVersion then + begin + {$if declared(_SSL_get_peer_signature_nid)} + SSL_get_peer_signature_nid := @_SSL_get_peer_signature_nid; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_get_peer_signature_nid_allownil)} + if FuncLoadError then + AFailed.Add('SSL_get_peer_signature_nid'); + {$ifend} + end; + + + SSL_get_peer_tmp_key := LoadLibFunction(ADllHandle, SSL_get_peer_tmp_key_procname); + FuncLoadError := not assigned(SSL_get_peer_tmp_key); + if FuncLoadError then + begin + {$if not defined(SSL_get_peer_tmp_key_allownil)} + SSL_get_peer_tmp_key := @ERR_SSL_get_peer_tmp_key; + {$ifend} + {$if declared(SSL_get_peer_tmp_key_introduced)} + if LibVersion < SSL_get_peer_tmp_key_introduced then + begin + {$if declared(FC_SSL_get_peer_tmp_key)} + SSL_get_peer_tmp_key := @FC_SSL_get_peer_tmp_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_get_peer_tmp_key_removed)} + if SSL_get_peer_tmp_key_removed <= LibVersion then + begin + {$if declared(_SSL_get_peer_tmp_key)} + SSL_get_peer_tmp_key := @_SSL_get_peer_tmp_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_get_peer_tmp_key_allownil)} + if FuncLoadError then + AFailed.Add('SSL_get_peer_tmp_key'); + {$ifend} + end; + + + SSL_get_tmp_key := LoadLibFunction(ADllHandle, SSL_get_tmp_key_procname); + FuncLoadError := not assigned(SSL_get_tmp_key); + if FuncLoadError then + begin + {$if not defined(SSL_get_tmp_key_allownil)} + SSL_get_tmp_key := @ERR_SSL_get_tmp_key; + {$ifend} + {$if declared(SSL_get_tmp_key_introduced)} + if LibVersion < SSL_get_tmp_key_introduced then + begin + {$if declared(FC_SSL_get_tmp_key)} + SSL_get_tmp_key := @FC_SSL_get_tmp_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_get_tmp_key_removed)} + if SSL_get_tmp_key_removed <= LibVersion then + begin + {$if declared(_SSL_get_tmp_key)} + SSL_get_tmp_key := @_SSL_get_tmp_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_get_tmp_key_allownil)} + if FuncLoadError then + AFailed.Add('SSL_get_tmp_key'); + {$ifend} + end; + + + SSL_get0_raw_cipherlist := LoadLibFunction(ADllHandle, SSL_get0_raw_cipherlist_procname); + FuncLoadError := not assigned(SSL_get0_raw_cipherlist); + if FuncLoadError then + begin + {$if not defined(SSL_get0_raw_cipherlist_allownil)} + SSL_get0_raw_cipherlist := @ERR_SSL_get0_raw_cipherlist; + {$ifend} + {$if declared(SSL_get0_raw_cipherlist_introduced)} + if LibVersion < SSL_get0_raw_cipherlist_introduced then + begin + {$if declared(FC_SSL_get0_raw_cipherlist)} + SSL_get0_raw_cipherlist := @FC_SSL_get0_raw_cipherlist; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_get0_raw_cipherlist_removed)} + if SSL_get0_raw_cipherlist_removed <= LibVersion then + begin + {$if declared(_SSL_get0_raw_cipherlist)} + SSL_get0_raw_cipherlist := @_SSL_get0_raw_cipherlist; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_get0_raw_cipherlist_allownil)} + if FuncLoadError then + AFailed.Add('SSL_get0_raw_cipherlist'); + {$ifend} + end; + + + SSL_get0_ec_point_formats := LoadLibFunction(ADllHandle, SSL_get0_ec_point_formats_procname); + FuncLoadError := not assigned(SSL_get0_ec_point_formats); + if FuncLoadError then + begin + {$if not defined(SSL_get0_ec_point_formats_allownil)} + SSL_get0_ec_point_formats := @ERR_SSL_get0_ec_point_formats; + {$ifend} + {$if declared(SSL_get0_ec_point_formats_introduced)} + if LibVersion < SSL_get0_ec_point_formats_introduced then + begin + {$if declared(FC_SSL_get0_ec_point_formats)} + SSL_get0_ec_point_formats := @FC_SSL_get0_ec_point_formats; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_get0_ec_point_formats_removed)} + if SSL_get0_ec_point_formats_removed <= LibVersion then + begin + {$if declared(_SSL_get0_ec_point_formats)} + SSL_get0_ec_point_formats := @_SSL_get0_ec_point_formats; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_get0_ec_point_formats_allownil)} + if FuncLoadError then + AFailed.Add('SSL_get0_ec_point_formats'); + {$ifend} + end; + + + SSL_CTX_get_options := LoadLibFunction(ADllHandle, SSL_CTX_get_options_procname); + FuncLoadError := not assigned(SSL_CTX_get_options); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_get_options_allownil)} + SSL_CTX_get_options := @ERR_SSL_CTX_get_options; + {$ifend} + {$if declared(SSL_CTX_get_options_introduced)} + if LibVersion < SSL_CTX_get_options_introduced then + begin + {$if declared(FC_SSL_CTX_get_options)} + SSL_CTX_get_options := @FC_SSL_CTX_get_options; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_get_options_removed)} + if SSL_CTX_get_options_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_get_options)} + SSL_CTX_get_options := @_SSL_CTX_get_options; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_get_options_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_get_options'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_get_options := LoadLibFunction(ADllHandle, SSL_get_options_procname); + FuncLoadError := not assigned(SSL_get_options); + if FuncLoadError then + begin + {$if not defined(SSL_get_options_allownil)} + SSL_get_options := @ERR_SSL_get_options; + {$ifend} + {$if declared(SSL_get_options_introduced)} + if LibVersion < SSL_get_options_introduced then + begin + {$if declared(FC_SSL_get_options)} + SSL_get_options := @FC_SSL_get_options; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_get_options_removed)} + if SSL_get_options_removed <= LibVersion then + begin + {$if declared(_SSL_get_options)} + SSL_get_options := @_SSL_get_options; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_get_options_allownil)} + if FuncLoadError then + AFailed.Add('SSL_get_options'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_CTX_clear_options := LoadLibFunction(ADllHandle, SSL_CTX_clear_options_procname); + FuncLoadError := not assigned(SSL_CTX_clear_options); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_clear_options_allownil)} + SSL_CTX_clear_options := @ERR_SSL_CTX_clear_options; + {$ifend} + {$if declared(SSL_CTX_clear_options_introduced)} + if LibVersion < SSL_CTX_clear_options_introduced then + begin + {$if declared(FC_SSL_CTX_clear_options)} + SSL_CTX_clear_options := @FC_SSL_CTX_clear_options; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_clear_options_removed)} + if SSL_CTX_clear_options_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_clear_options)} + SSL_CTX_clear_options := @_SSL_CTX_clear_options; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_clear_options_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_clear_options'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_clear_options := LoadLibFunction(ADllHandle, SSL_clear_options_procname); + FuncLoadError := not assigned(SSL_clear_options); + if FuncLoadError then + begin + {$if not defined(SSL_clear_options_allownil)} + SSL_clear_options := @ERR_SSL_clear_options; + {$ifend} + {$if declared(SSL_clear_options_introduced)} + if LibVersion < SSL_clear_options_introduced then + begin + {$if declared(FC_SSL_clear_options)} + SSL_clear_options := @FC_SSL_clear_options; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_clear_options_removed)} + if SSL_clear_options_removed <= LibVersion then + begin + {$if declared(_SSL_clear_options)} + SSL_clear_options := @_SSL_clear_options; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_clear_options_allownil)} + if FuncLoadError then + AFailed.Add('SSL_clear_options'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_CTX_set_options := LoadLibFunction(ADllHandle, SSL_CTX_set_options_procname); + FuncLoadError := not assigned(SSL_CTX_set_options); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_set_options_allownil)} + SSL_CTX_set_options := @ERR_SSL_CTX_set_options; + {$ifend} + {$if declared(SSL_CTX_set_options_introduced)} + if LibVersion < SSL_CTX_set_options_introduced then + begin + {$if declared(FC_SSL_CTX_set_options)} + SSL_CTX_set_options := @FC_SSL_CTX_set_options; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_set_options_removed)} + if SSL_CTX_set_options_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_set_options)} + SSL_CTX_set_options := @_SSL_CTX_set_options; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_set_options_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_set_options'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_set_options := LoadLibFunction(ADllHandle, SSL_set_options_procname); + FuncLoadError := not assigned(SSL_set_options); + if FuncLoadError then + begin + {$if not defined(SSL_set_options_allownil)} + SSL_set_options := @ERR_SSL_set_options; + {$ifend} + {$if declared(SSL_set_options_introduced)} + if LibVersion < SSL_set_options_introduced then + begin + {$if declared(FC_SSL_set_options)} + SSL_set_options := @FC_SSL_set_options; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_set_options_removed)} + if SSL_set_options_removed <= LibVersion then + begin + {$if declared(_SSL_set_options)} + SSL_set_options := @_SSL_set_options; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_set_options_allownil)} + if FuncLoadError then + AFailed.Add('SSL_set_options'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_CTX_sess_set_new_cb := LoadLibFunction(ADllHandle, SSL_CTX_sess_set_new_cb_procname); + FuncLoadError := not assigned(SSL_CTX_sess_set_new_cb); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_sess_set_new_cb_allownil)} + SSL_CTX_sess_set_new_cb := @ERR_SSL_CTX_sess_set_new_cb; + {$ifend} + {$if declared(SSL_CTX_sess_set_new_cb_introduced)} + if LibVersion < SSL_CTX_sess_set_new_cb_introduced then + begin + {$if declared(FC_SSL_CTX_sess_set_new_cb)} + SSL_CTX_sess_set_new_cb := @FC_SSL_CTX_sess_set_new_cb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_sess_set_new_cb_removed)} + if SSL_CTX_sess_set_new_cb_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_sess_set_new_cb)} + SSL_CTX_sess_set_new_cb := @_SSL_CTX_sess_set_new_cb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_sess_set_new_cb_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_sess_set_new_cb'); + {$ifend} + end; + + + SSL_CTX_sess_get_new_cb := LoadLibFunction(ADllHandle, SSL_CTX_sess_get_new_cb_procname); + FuncLoadError := not assigned(SSL_CTX_sess_get_new_cb); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_sess_get_new_cb_allownil)} + SSL_CTX_sess_get_new_cb := @ERR_SSL_CTX_sess_get_new_cb; + {$ifend} + {$if declared(SSL_CTX_sess_get_new_cb_introduced)} + if LibVersion < SSL_CTX_sess_get_new_cb_introduced then + begin + {$if declared(FC_SSL_CTX_sess_get_new_cb)} + SSL_CTX_sess_get_new_cb := @FC_SSL_CTX_sess_get_new_cb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_sess_get_new_cb_removed)} + if SSL_CTX_sess_get_new_cb_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_sess_get_new_cb)} + SSL_CTX_sess_get_new_cb := @_SSL_CTX_sess_get_new_cb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_sess_get_new_cb_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_sess_get_new_cb'); + {$ifend} + end; + + + SSL_CTX_sess_set_remove_cb := LoadLibFunction(ADllHandle, SSL_CTX_sess_set_remove_cb_procname); + FuncLoadError := not assigned(SSL_CTX_sess_set_remove_cb); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_sess_set_remove_cb_allownil)} + SSL_CTX_sess_set_remove_cb := @ERR_SSL_CTX_sess_set_remove_cb; + {$ifend} + {$if declared(SSL_CTX_sess_set_remove_cb_introduced)} + if LibVersion < SSL_CTX_sess_set_remove_cb_introduced then + begin + {$if declared(FC_SSL_CTX_sess_set_remove_cb)} + SSL_CTX_sess_set_remove_cb := @FC_SSL_CTX_sess_set_remove_cb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_sess_set_remove_cb_removed)} + if SSL_CTX_sess_set_remove_cb_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_sess_set_remove_cb)} + SSL_CTX_sess_set_remove_cb := @_SSL_CTX_sess_set_remove_cb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_sess_set_remove_cb_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_sess_set_remove_cb'); + {$ifend} + end; + + + SSL_CTX_sess_get_remove_cb := LoadLibFunction(ADllHandle, SSL_CTX_sess_get_remove_cb_procname); + FuncLoadError := not assigned(SSL_CTX_sess_get_remove_cb); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_sess_get_remove_cb_allownil)} + SSL_CTX_sess_get_remove_cb := @ERR_SSL_CTX_sess_get_remove_cb; + {$ifend} + {$if declared(SSL_CTX_sess_get_remove_cb_introduced)} + if LibVersion < SSL_CTX_sess_get_remove_cb_introduced then + begin + {$if declared(FC_SSL_CTX_sess_get_remove_cb)} + SSL_CTX_sess_get_remove_cb := @FC_SSL_CTX_sess_get_remove_cb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_sess_get_remove_cb_removed)} + if SSL_CTX_sess_get_remove_cb_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_sess_get_remove_cb)} + SSL_CTX_sess_get_remove_cb := @_SSL_CTX_sess_get_remove_cb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_sess_get_remove_cb_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_sess_get_remove_cb'); + {$ifend} + end; + + + SSL_CTX_set_info_callback := LoadLibFunction(ADllHandle, SSL_CTX_set_info_callback_procname); + FuncLoadError := not assigned(SSL_CTX_set_info_callback); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_set_info_callback_allownil)} + SSL_CTX_set_info_callback := @ERR_SSL_CTX_set_info_callback; + {$ifend} + {$if declared(SSL_CTX_set_info_callback_introduced)} + if LibVersion < SSL_CTX_set_info_callback_introduced then + begin + {$if declared(FC_SSL_CTX_set_info_callback)} + SSL_CTX_set_info_callback := @FC_SSL_CTX_set_info_callback; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_set_info_callback_removed)} + if SSL_CTX_set_info_callback_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_set_info_callback)} + SSL_CTX_set_info_callback := @_SSL_CTX_set_info_callback; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_set_info_callback_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_set_info_callback'); + {$ifend} + end; + + + SSL_CTX_get_info_callback := LoadLibFunction(ADllHandle, SSL_CTX_get_info_callback_procname); + FuncLoadError := not assigned(SSL_CTX_get_info_callback); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_get_info_callback_allownil)} + SSL_CTX_get_info_callback := @ERR_SSL_CTX_get_info_callback; + {$ifend} + {$if declared(SSL_CTX_get_info_callback_introduced)} + if LibVersion < SSL_CTX_get_info_callback_introduced then + begin + {$if declared(FC_SSL_CTX_get_info_callback)} + SSL_CTX_get_info_callback := @FC_SSL_CTX_get_info_callback; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_get_info_callback_removed)} + if SSL_CTX_get_info_callback_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_get_info_callback)} + SSL_CTX_get_info_callback := @_SSL_CTX_get_info_callback; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_get_info_callback_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_get_info_callback'); + {$ifend} + end; + + + SSL_CTX_set_client_cert_cb := LoadLibFunction(ADllHandle, SSL_CTX_set_client_cert_cb_procname); + FuncLoadError := not assigned(SSL_CTX_set_client_cert_cb); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_set_client_cert_cb_allownil)} + SSL_CTX_set_client_cert_cb := @ERR_SSL_CTX_set_client_cert_cb; + {$ifend} + {$if declared(SSL_CTX_set_client_cert_cb_introduced)} + if LibVersion < SSL_CTX_set_client_cert_cb_introduced then + begin + {$if declared(FC_SSL_CTX_set_client_cert_cb)} + SSL_CTX_set_client_cert_cb := @FC_SSL_CTX_set_client_cert_cb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_set_client_cert_cb_removed)} + if SSL_CTX_set_client_cert_cb_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_set_client_cert_cb)} + SSL_CTX_set_client_cert_cb := @_SSL_CTX_set_client_cert_cb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_set_client_cert_cb_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_set_client_cert_cb'); + {$ifend} + end; + + + SSL_CTX_get_client_cert_cb := LoadLibFunction(ADllHandle, SSL_CTX_get_client_cert_cb_procname); + FuncLoadError := not assigned(SSL_CTX_get_client_cert_cb); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_get_client_cert_cb_allownil)} + SSL_CTX_get_client_cert_cb := @ERR_SSL_CTX_get_client_cert_cb; + {$ifend} + {$if declared(SSL_CTX_get_client_cert_cb_introduced)} + if LibVersion < SSL_CTX_get_client_cert_cb_introduced then + begin + {$if declared(FC_SSL_CTX_get_client_cert_cb)} + SSL_CTX_get_client_cert_cb := @FC_SSL_CTX_get_client_cert_cb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_get_client_cert_cb_removed)} + if SSL_CTX_get_client_cert_cb_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_get_client_cert_cb)} + SSL_CTX_get_client_cert_cb := @_SSL_CTX_get_client_cert_cb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_get_client_cert_cb_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_get_client_cert_cb'); + {$ifend} + end; + + + SSL_CTX_set_client_cert_engine := LoadLibFunction(ADllHandle, SSL_CTX_set_client_cert_engine_procname); + FuncLoadError := not assigned(SSL_CTX_set_client_cert_engine); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_set_client_cert_engine_allownil)} + SSL_CTX_set_client_cert_engine := @ERR_SSL_CTX_set_client_cert_engine; + {$ifend} + {$if declared(SSL_CTX_set_client_cert_engine_introduced)} + if LibVersion < SSL_CTX_set_client_cert_engine_introduced then + begin + {$if declared(FC_SSL_CTX_set_client_cert_engine)} + SSL_CTX_set_client_cert_engine := @FC_SSL_CTX_set_client_cert_engine; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_set_client_cert_engine_removed)} + if SSL_CTX_set_client_cert_engine_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_set_client_cert_engine)} + SSL_CTX_set_client_cert_engine := @_SSL_CTX_set_client_cert_engine; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_set_client_cert_engine_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_set_client_cert_engine'); + {$ifend} + end; + + + SSL_CTX_set_cookie_generate_cb := LoadLibFunction(ADllHandle, SSL_CTX_set_cookie_generate_cb_procname); + FuncLoadError := not assigned(SSL_CTX_set_cookie_generate_cb); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_set_cookie_generate_cb_allownil)} + SSL_CTX_set_cookie_generate_cb := @ERR_SSL_CTX_set_cookie_generate_cb; + {$ifend} + {$if declared(SSL_CTX_set_cookie_generate_cb_introduced)} + if LibVersion < SSL_CTX_set_cookie_generate_cb_introduced then + begin + {$if declared(FC_SSL_CTX_set_cookie_generate_cb)} + SSL_CTX_set_cookie_generate_cb := @FC_SSL_CTX_set_cookie_generate_cb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_set_cookie_generate_cb_removed)} + if SSL_CTX_set_cookie_generate_cb_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_set_cookie_generate_cb)} + SSL_CTX_set_cookie_generate_cb := @_SSL_CTX_set_cookie_generate_cb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_set_cookie_generate_cb_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_set_cookie_generate_cb'); + {$ifend} + end; + + + SSL_CTX_set_cookie_verify_cb := LoadLibFunction(ADllHandle, SSL_CTX_set_cookie_verify_cb_procname); + FuncLoadError := not assigned(SSL_CTX_set_cookie_verify_cb); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_set_cookie_verify_cb_allownil)} + SSL_CTX_set_cookie_verify_cb := @ERR_SSL_CTX_set_cookie_verify_cb; + {$ifend} + {$if declared(SSL_CTX_set_cookie_verify_cb_introduced)} + if LibVersion < SSL_CTX_set_cookie_verify_cb_introduced then + begin + {$if declared(FC_SSL_CTX_set_cookie_verify_cb)} + SSL_CTX_set_cookie_verify_cb := @FC_SSL_CTX_set_cookie_verify_cb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_set_cookie_verify_cb_removed)} + if SSL_CTX_set_cookie_verify_cb_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_set_cookie_verify_cb)} + SSL_CTX_set_cookie_verify_cb := @_SSL_CTX_set_cookie_verify_cb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_set_cookie_verify_cb_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_set_cookie_verify_cb'); + {$ifend} + end; + + + SSL_CTX_set_stateless_cookie_generate_cb := LoadLibFunction(ADllHandle, SSL_CTX_set_stateless_cookie_generate_cb_procname); + FuncLoadError := not assigned(SSL_CTX_set_stateless_cookie_generate_cb); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_set_stateless_cookie_generate_cb_allownil)} + SSL_CTX_set_stateless_cookie_generate_cb := @ERR_SSL_CTX_set_stateless_cookie_generate_cb; + {$ifend} + {$if declared(SSL_CTX_set_stateless_cookie_generate_cb_introduced)} + if LibVersion < SSL_CTX_set_stateless_cookie_generate_cb_introduced then + begin + {$if declared(FC_SSL_CTX_set_stateless_cookie_generate_cb)} + SSL_CTX_set_stateless_cookie_generate_cb := @FC_SSL_CTX_set_stateless_cookie_generate_cb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_set_stateless_cookie_generate_cb_removed)} + if SSL_CTX_set_stateless_cookie_generate_cb_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_set_stateless_cookie_generate_cb)} + SSL_CTX_set_stateless_cookie_generate_cb := @_SSL_CTX_set_stateless_cookie_generate_cb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_set_stateless_cookie_generate_cb_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_set_stateless_cookie_generate_cb'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_CTX_set_stateless_cookie_verify_cb := LoadLibFunction(ADllHandle, SSL_CTX_set_stateless_cookie_verify_cb_procname); + FuncLoadError := not assigned(SSL_CTX_set_stateless_cookie_verify_cb); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_set_stateless_cookie_verify_cb_allownil)} + SSL_CTX_set_stateless_cookie_verify_cb := @ERR_SSL_CTX_set_stateless_cookie_verify_cb; + {$ifend} + {$if declared(SSL_CTX_set_stateless_cookie_verify_cb_introduced)} + if LibVersion < SSL_CTX_set_stateless_cookie_verify_cb_introduced then + begin + {$if declared(FC_SSL_CTX_set_stateless_cookie_verify_cb)} + SSL_CTX_set_stateless_cookie_verify_cb := @FC_SSL_CTX_set_stateless_cookie_verify_cb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_set_stateless_cookie_verify_cb_removed)} + if SSL_CTX_set_stateless_cookie_verify_cb_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_set_stateless_cookie_verify_cb)} + SSL_CTX_set_stateless_cookie_verify_cb := @_SSL_CTX_set_stateless_cookie_verify_cb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_set_stateless_cookie_verify_cb_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_set_stateless_cookie_verify_cb'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_CTX_set_alpn_select_cb := LoadLibFunction(ADllHandle, SSL_CTX_set_alpn_select_cb_procname); + FuncLoadError := not assigned(SSL_CTX_set_alpn_select_cb); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_set_alpn_select_cb_allownil)} + SSL_CTX_set_alpn_select_cb := @ERR_SSL_CTX_set_alpn_select_cb; + {$ifend} + {$if declared(SSL_CTX_set_alpn_select_cb_introduced)} + if LibVersion < SSL_CTX_set_alpn_select_cb_introduced then + begin + {$if declared(FC_SSL_CTX_set_alpn_select_cb)} + SSL_CTX_set_alpn_select_cb := @FC_SSL_CTX_set_alpn_select_cb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_set_alpn_select_cb_removed)} + if SSL_CTX_set_alpn_select_cb_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_set_alpn_select_cb)} + SSL_CTX_set_alpn_select_cb := @_SSL_CTX_set_alpn_select_cb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_set_alpn_select_cb_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_set_alpn_select_cb'); + {$ifend} + end; + + + SSL_get0_alpn_selected := LoadLibFunction(ADllHandle, SSL_get0_alpn_selected_procname); + FuncLoadError := not assigned(SSL_get0_alpn_selected); + if FuncLoadError then + begin + {$if not defined(SSL_get0_alpn_selected_allownil)} + SSL_get0_alpn_selected := @ERR_SSL_get0_alpn_selected; + {$ifend} + {$if declared(SSL_get0_alpn_selected_introduced)} + if LibVersion < SSL_get0_alpn_selected_introduced then + begin + {$if declared(FC_SSL_get0_alpn_selected)} + SSL_get0_alpn_selected := @FC_SSL_get0_alpn_selected; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_get0_alpn_selected_removed)} + if SSL_get0_alpn_selected_removed <= LibVersion then + begin + {$if declared(_SSL_get0_alpn_selected)} + SSL_get0_alpn_selected := @_SSL_get0_alpn_selected; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_get0_alpn_selected_allownil)} + if FuncLoadError then + AFailed.Add('SSL_get0_alpn_selected'); + {$ifend} + end; + + + SSL_CTX_set_psk_client_callback := LoadLibFunction(ADllHandle, SSL_CTX_set_psk_client_callback_procname); + FuncLoadError := not assigned(SSL_CTX_set_psk_client_callback); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_set_psk_client_callback_allownil)} + SSL_CTX_set_psk_client_callback := @ERR_SSL_CTX_set_psk_client_callback; + {$ifend} + {$if declared(SSL_CTX_set_psk_client_callback_introduced)} + if LibVersion < SSL_CTX_set_psk_client_callback_introduced then + begin + {$if declared(FC_SSL_CTX_set_psk_client_callback)} + SSL_CTX_set_psk_client_callback := @FC_SSL_CTX_set_psk_client_callback; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_set_psk_client_callback_removed)} + if SSL_CTX_set_psk_client_callback_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_set_psk_client_callback)} + SSL_CTX_set_psk_client_callback := @_SSL_CTX_set_psk_client_callback; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_set_psk_client_callback_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_set_psk_client_callback'); + {$ifend} + end; + + + SSL_set_psk_client_callback := LoadLibFunction(ADllHandle, SSL_set_psk_client_callback_procname); + FuncLoadError := not assigned(SSL_set_psk_client_callback); + if FuncLoadError then + begin + {$if not defined(SSL_set_psk_client_callback_allownil)} + SSL_set_psk_client_callback := @ERR_SSL_set_psk_client_callback; + {$ifend} + {$if declared(SSL_set_psk_client_callback_introduced)} + if LibVersion < SSL_set_psk_client_callback_introduced then + begin + {$if declared(FC_SSL_set_psk_client_callback)} + SSL_set_psk_client_callback := @FC_SSL_set_psk_client_callback; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_set_psk_client_callback_removed)} + if SSL_set_psk_client_callback_removed <= LibVersion then + begin + {$if declared(_SSL_set_psk_client_callback)} + SSL_set_psk_client_callback := @_SSL_set_psk_client_callback; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_set_psk_client_callback_allownil)} + if FuncLoadError then + AFailed.Add('SSL_set_psk_client_callback'); + {$ifend} + end; + + + SSL_CTX_set_psk_server_callback := LoadLibFunction(ADllHandle, SSL_CTX_set_psk_server_callback_procname); + FuncLoadError := not assigned(SSL_CTX_set_psk_server_callback); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_set_psk_server_callback_allownil)} + SSL_CTX_set_psk_server_callback := @ERR_SSL_CTX_set_psk_server_callback; + {$ifend} + {$if declared(SSL_CTX_set_psk_server_callback_introduced)} + if LibVersion < SSL_CTX_set_psk_server_callback_introduced then + begin + {$if declared(FC_SSL_CTX_set_psk_server_callback)} + SSL_CTX_set_psk_server_callback := @FC_SSL_CTX_set_psk_server_callback; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_set_psk_server_callback_removed)} + if SSL_CTX_set_psk_server_callback_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_set_psk_server_callback)} + SSL_CTX_set_psk_server_callback := @_SSL_CTX_set_psk_server_callback; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_set_psk_server_callback_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_set_psk_server_callback'); + {$ifend} + end; + + + SSL_set_psk_server_callback := LoadLibFunction(ADllHandle, SSL_set_psk_server_callback_procname); + FuncLoadError := not assigned(SSL_set_psk_server_callback); + if FuncLoadError then + begin + {$if not defined(SSL_set_psk_server_callback_allownil)} + SSL_set_psk_server_callback := @ERR_SSL_set_psk_server_callback; + {$ifend} + {$if declared(SSL_set_psk_server_callback_introduced)} + if LibVersion < SSL_set_psk_server_callback_introduced then + begin + {$if declared(FC_SSL_set_psk_server_callback)} + SSL_set_psk_server_callback := @FC_SSL_set_psk_server_callback; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_set_psk_server_callback_removed)} + if SSL_set_psk_server_callback_removed <= LibVersion then + begin + {$if declared(_SSL_set_psk_server_callback)} + SSL_set_psk_server_callback := @_SSL_set_psk_server_callback; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_set_psk_server_callback_allownil)} + if FuncLoadError then + AFailed.Add('SSL_set_psk_server_callback'); + {$ifend} + end; + + + SSL_set_psk_find_session_callback := LoadLibFunction(ADllHandle, SSL_set_psk_find_session_callback_procname); + FuncLoadError := not assigned(SSL_set_psk_find_session_callback); + if FuncLoadError then + begin + {$if not defined(SSL_set_psk_find_session_callback_allownil)} + SSL_set_psk_find_session_callback := @ERR_SSL_set_psk_find_session_callback; + {$ifend} + {$if declared(SSL_set_psk_find_session_callback_introduced)} + if LibVersion < SSL_set_psk_find_session_callback_introduced then + begin + {$if declared(FC_SSL_set_psk_find_session_callback)} + SSL_set_psk_find_session_callback := @FC_SSL_set_psk_find_session_callback; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_set_psk_find_session_callback_removed)} + if SSL_set_psk_find_session_callback_removed <= LibVersion then + begin + {$if declared(_SSL_set_psk_find_session_callback)} + SSL_set_psk_find_session_callback := @_SSL_set_psk_find_session_callback; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_set_psk_find_session_callback_allownil)} + if FuncLoadError then + AFailed.Add('SSL_set_psk_find_session_callback'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_CTX_set_psk_find_session_callback := LoadLibFunction(ADllHandle, SSL_CTX_set_psk_find_session_callback_procname); + FuncLoadError := not assigned(SSL_CTX_set_psk_find_session_callback); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_set_psk_find_session_callback_allownil)} + SSL_CTX_set_psk_find_session_callback := @ERR_SSL_CTX_set_psk_find_session_callback; + {$ifend} + {$if declared(SSL_CTX_set_psk_find_session_callback_introduced)} + if LibVersion < SSL_CTX_set_psk_find_session_callback_introduced then + begin + {$if declared(FC_SSL_CTX_set_psk_find_session_callback)} + SSL_CTX_set_psk_find_session_callback := @FC_SSL_CTX_set_psk_find_session_callback; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_set_psk_find_session_callback_removed)} + if SSL_CTX_set_psk_find_session_callback_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_set_psk_find_session_callback)} + SSL_CTX_set_psk_find_session_callback := @_SSL_CTX_set_psk_find_session_callback; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_set_psk_find_session_callback_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_set_psk_find_session_callback'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_set_psk_use_session_callback := LoadLibFunction(ADllHandle, SSL_set_psk_use_session_callback_procname); + FuncLoadError := not assigned(SSL_set_psk_use_session_callback); + if FuncLoadError then + begin + {$if not defined(SSL_set_psk_use_session_callback_allownil)} + SSL_set_psk_use_session_callback := @ERR_SSL_set_psk_use_session_callback; + {$ifend} + {$if declared(SSL_set_psk_use_session_callback_introduced)} + if LibVersion < SSL_set_psk_use_session_callback_introduced then + begin + {$if declared(FC_SSL_set_psk_use_session_callback)} + SSL_set_psk_use_session_callback := @FC_SSL_set_psk_use_session_callback; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_set_psk_use_session_callback_removed)} + if SSL_set_psk_use_session_callback_removed <= LibVersion then + begin + {$if declared(_SSL_set_psk_use_session_callback)} + SSL_set_psk_use_session_callback := @_SSL_set_psk_use_session_callback; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_set_psk_use_session_callback_allownil)} + if FuncLoadError then + AFailed.Add('SSL_set_psk_use_session_callback'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_CTX_set_psk_use_session_callback := LoadLibFunction(ADllHandle, SSL_CTX_set_psk_use_session_callback_procname); + FuncLoadError := not assigned(SSL_CTX_set_psk_use_session_callback); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_set_psk_use_session_callback_allownil)} + SSL_CTX_set_psk_use_session_callback := @ERR_SSL_CTX_set_psk_use_session_callback; + {$ifend} + {$if declared(SSL_CTX_set_psk_use_session_callback_introduced)} + if LibVersion < SSL_CTX_set_psk_use_session_callback_introduced then + begin + {$if declared(FC_SSL_CTX_set_psk_use_session_callback)} + SSL_CTX_set_psk_use_session_callback := @FC_SSL_CTX_set_psk_use_session_callback; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_set_psk_use_session_callback_removed)} + if SSL_CTX_set_psk_use_session_callback_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_set_psk_use_session_callback)} + SSL_CTX_set_psk_use_session_callback := @_SSL_CTX_set_psk_use_session_callback; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_set_psk_use_session_callback_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_set_psk_use_session_callback'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_CTX_set_keylog_callback := LoadLibFunction(ADllHandle, SSL_CTX_set_keylog_callback_procname); + FuncLoadError := not assigned(SSL_CTX_set_keylog_callback); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_set_keylog_callback_allownil)} + SSL_CTX_set_keylog_callback := @ERR_SSL_CTX_set_keylog_callback; + {$ifend} + {$if declared(SSL_CTX_set_keylog_callback_introduced)} + if LibVersion < SSL_CTX_set_keylog_callback_introduced then + begin + {$if declared(FC_SSL_CTX_set_keylog_callback)} + SSL_CTX_set_keylog_callback := @FC_SSL_CTX_set_keylog_callback; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_set_keylog_callback_removed)} + if SSL_CTX_set_keylog_callback_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_set_keylog_callback)} + SSL_CTX_set_keylog_callback := @_SSL_CTX_set_keylog_callback; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_set_keylog_callback_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_set_keylog_callback'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_CTX_get_keylog_callback := LoadLibFunction(ADllHandle, SSL_CTX_get_keylog_callback_procname); + FuncLoadError := not assigned(SSL_CTX_get_keylog_callback); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_get_keylog_callback_allownil)} + SSL_CTX_get_keylog_callback := @ERR_SSL_CTX_get_keylog_callback; + {$ifend} + {$if declared(SSL_CTX_get_keylog_callback_introduced)} + if LibVersion < SSL_CTX_get_keylog_callback_introduced then + begin + {$if declared(FC_SSL_CTX_get_keylog_callback)} + SSL_CTX_get_keylog_callback := @FC_SSL_CTX_get_keylog_callback; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_get_keylog_callback_removed)} + if SSL_CTX_get_keylog_callback_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_get_keylog_callback)} + SSL_CTX_get_keylog_callback := @_SSL_CTX_get_keylog_callback; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_get_keylog_callback_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_get_keylog_callback'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_CTX_set_max_early_data := LoadLibFunction(ADllHandle, SSL_CTX_set_max_early_data_procname); + FuncLoadError := not assigned(SSL_CTX_set_max_early_data); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_set_max_early_data_allownil)} + SSL_CTX_set_max_early_data := @ERR_SSL_CTX_set_max_early_data; + {$ifend} + {$if declared(SSL_CTX_set_max_early_data_introduced)} + if LibVersion < SSL_CTX_set_max_early_data_introduced then + begin + {$if declared(FC_SSL_CTX_set_max_early_data)} + SSL_CTX_set_max_early_data := @FC_SSL_CTX_set_max_early_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_set_max_early_data_removed)} + if SSL_CTX_set_max_early_data_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_set_max_early_data)} + SSL_CTX_set_max_early_data := @_SSL_CTX_set_max_early_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_set_max_early_data_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_set_max_early_data'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_CTX_get_max_early_data := LoadLibFunction(ADllHandle, SSL_CTX_get_max_early_data_procname); + FuncLoadError := not assigned(SSL_CTX_get_max_early_data); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_get_max_early_data_allownil)} + SSL_CTX_get_max_early_data := @ERR_SSL_CTX_get_max_early_data; + {$ifend} + {$if declared(SSL_CTX_get_max_early_data_introduced)} + if LibVersion < SSL_CTX_get_max_early_data_introduced then + begin + {$if declared(FC_SSL_CTX_get_max_early_data)} + SSL_CTX_get_max_early_data := @FC_SSL_CTX_get_max_early_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_get_max_early_data_removed)} + if SSL_CTX_get_max_early_data_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_get_max_early_data)} + SSL_CTX_get_max_early_data := @_SSL_CTX_get_max_early_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_get_max_early_data_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_get_max_early_data'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_set_max_early_data := LoadLibFunction(ADllHandle, SSL_set_max_early_data_procname); + FuncLoadError := not assigned(SSL_set_max_early_data); + if FuncLoadError then + begin + {$if not defined(SSL_set_max_early_data_allownil)} + SSL_set_max_early_data := @ERR_SSL_set_max_early_data; + {$ifend} + {$if declared(SSL_set_max_early_data_introduced)} + if LibVersion < SSL_set_max_early_data_introduced then + begin + {$if declared(FC_SSL_set_max_early_data)} + SSL_set_max_early_data := @FC_SSL_set_max_early_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_set_max_early_data_removed)} + if SSL_set_max_early_data_removed <= LibVersion then + begin + {$if declared(_SSL_set_max_early_data)} + SSL_set_max_early_data := @_SSL_set_max_early_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_set_max_early_data_allownil)} + if FuncLoadError then + AFailed.Add('SSL_set_max_early_data'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_get_max_early_data := LoadLibFunction(ADllHandle, SSL_get_max_early_data_procname); + FuncLoadError := not assigned(SSL_get_max_early_data); + if FuncLoadError then + begin + {$if not defined(SSL_get_max_early_data_allownil)} + SSL_get_max_early_data := @ERR_SSL_get_max_early_data; + {$ifend} + {$if declared(SSL_get_max_early_data_introduced)} + if LibVersion < SSL_get_max_early_data_introduced then + begin + {$if declared(FC_SSL_get_max_early_data)} + SSL_get_max_early_data := @FC_SSL_get_max_early_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_get_max_early_data_removed)} + if SSL_get_max_early_data_removed <= LibVersion then + begin + {$if declared(_SSL_get_max_early_data)} + SSL_get_max_early_data := @_SSL_get_max_early_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_get_max_early_data_allownil)} + if FuncLoadError then + AFailed.Add('SSL_get_max_early_data'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_CTX_set_recv_max_early_data := LoadLibFunction(ADllHandle, SSL_CTX_set_recv_max_early_data_procname); + FuncLoadError := not assigned(SSL_CTX_set_recv_max_early_data); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_set_recv_max_early_data_allownil)} + SSL_CTX_set_recv_max_early_data := @ERR_SSL_CTX_set_recv_max_early_data; + {$ifend} + {$if declared(SSL_CTX_set_recv_max_early_data_introduced)} + if LibVersion < SSL_CTX_set_recv_max_early_data_introduced then + begin + {$if declared(FC_SSL_CTX_set_recv_max_early_data)} + SSL_CTX_set_recv_max_early_data := @FC_SSL_CTX_set_recv_max_early_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_set_recv_max_early_data_removed)} + if SSL_CTX_set_recv_max_early_data_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_set_recv_max_early_data)} + SSL_CTX_set_recv_max_early_data := @_SSL_CTX_set_recv_max_early_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_set_recv_max_early_data_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_set_recv_max_early_data'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_CTX_get_recv_max_early_data := LoadLibFunction(ADllHandle, SSL_CTX_get_recv_max_early_data_procname); + FuncLoadError := not assigned(SSL_CTX_get_recv_max_early_data); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_get_recv_max_early_data_allownil)} + SSL_CTX_get_recv_max_early_data := @ERR_SSL_CTX_get_recv_max_early_data; + {$ifend} + {$if declared(SSL_CTX_get_recv_max_early_data_introduced)} + if LibVersion < SSL_CTX_get_recv_max_early_data_introduced then + begin + {$if declared(FC_SSL_CTX_get_recv_max_early_data)} + SSL_CTX_get_recv_max_early_data := @FC_SSL_CTX_get_recv_max_early_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_get_recv_max_early_data_removed)} + if SSL_CTX_get_recv_max_early_data_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_get_recv_max_early_data)} + SSL_CTX_get_recv_max_early_data := @_SSL_CTX_get_recv_max_early_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_get_recv_max_early_data_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_get_recv_max_early_data'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_set_recv_max_early_data := LoadLibFunction(ADllHandle, SSL_set_recv_max_early_data_procname); + FuncLoadError := not assigned(SSL_set_recv_max_early_data); + if FuncLoadError then + begin + {$if not defined(SSL_set_recv_max_early_data_allownil)} + SSL_set_recv_max_early_data := @ERR_SSL_set_recv_max_early_data; + {$ifend} + {$if declared(SSL_set_recv_max_early_data_introduced)} + if LibVersion < SSL_set_recv_max_early_data_introduced then + begin + {$if declared(FC_SSL_set_recv_max_early_data)} + SSL_set_recv_max_early_data := @FC_SSL_set_recv_max_early_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_set_recv_max_early_data_removed)} + if SSL_set_recv_max_early_data_removed <= LibVersion then + begin + {$if declared(_SSL_set_recv_max_early_data)} + SSL_set_recv_max_early_data := @_SSL_set_recv_max_early_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_set_recv_max_early_data_allownil)} + if FuncLoadError then + AFailed.Add('SSL_set_recv_max_early_data'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_get_recv_max_early_data := LoadLibFunction(ADllHandle, SSL_get_recv_max_early_data_procname); + FuncLoadError := not assigned(SSL_get_recv_max_early_data); + if FuncLoadError then + begin + {$if not defined(SSL_get_recv_max_early_data_allownil)} + SSL_get_recv_max_early_data := @ERR_SSL_get_recv_max_early_data; + {$ifend} + {$if declared(SSL_get_recv_max_early_data_introduced)} + if LibVersion < SSL_get_recv_max_early_data_introduced then + begin + {$if declared(FC_SSL_get_recv_max_early_data)} + SSL_get_recv_max_early_data := @FC_SSL_get_recv_max_early_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_get_recv_max_early_data_removed)} + if SSL_get_recv_max_early_data_removed <= LibVersion then + begin + {$if declared(_SSL_get_recv_max_early_data)} + SSL_get_recv_max_early_data := @_SSL_get_recv_max_early_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_get_recv_max_early_data_allownil)} + if FuncLoadError then + AFailed.Add('SSL_get_recv_max_early_data'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_get_app_data := LoadLibFunction(ADllHandle, SSL_get_app_data_procname); + FuncLoadError := not assigned(SSL_get_app_data); + if FuncLoadError then + begin + {$if not defined(SSL_get_app_data_allownil)} + SSL_get_app_data := @ERR_SSL_get_app_data; + {$ifend} + {$if declared(SSL_get_app_data_introduced)} + if LibVersion < SSL_get_app_data_introduced then + begin + {$if declared(FC_SSL_get_app_data)} + SSL_get_app_data := @FC_SSL_get_app_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_get_app_data_removed)} + if SSL_get_app_data_removed <= LibVersion then + begin + {$if declared(_SSL_get_app_data)} + SSL_get_app_data := @_SSL_get_app_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_get_app_data_allownil)} + if FuncLoadError then + AFailed.Add('SSL_get_app_data'); + {$ifend} + end; + + + SSL_set_app_data := LoadLibFunction(ADllHandle, SSL_set_app_data_procname); + FuncLoadError := not assigned(SSL_set_app_data); + if FuncLoadError then + begin + {$if not defined(SSL_set_app_data_allownil)} + SSL_set_app_data := @ERR_SSL_set_app_data; + {$ifend} + {$if declared(SSL_set_app_data_introduced)} + if LibVersion < SSL_set_app_data_introduced then + begin + {$if declared(FC_SSL_set_app_data)} + SSL_set_app_data := @FC_SSL_set_app_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_set_app_data_removed)} + if SSL_set_app_data_removed <= LibVersion then + begin + {$if declared(_SSL_set_app_data)} + SSL_set_app_data := @_SSL_set_app_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_set_app_data_allownil)} + if FuncLoadError then + AFailed.Add('SSL_set_app_data'); + {$ifend} + end; + + + SSL_in_init := LoadLibFunction(ADllHandle, SSL_in_init_procname); + FuncLoadError := not assigned(SSL_in_init); + if FuncLoadError then + begin + {$if not defined(SSL_in_init_allownil)} + SSL_in_init := @ERR_SSL_in_init; + {$ifend} + {$if declared(SSL_in_init_introduced)} + if LibVersion < SSL_in_init_introduced then + begin + {$if declared(FC_SSL_in_init)} + SSL_in_init := @FC_SSL_in_init; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_in_init_removed)} + if SSL_in_init_removed <= LibVersion then + begin + {$if declared(_SSL_in_init)} + SSL_in_init := @_SSL_in_init; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_in_init_allownil)} + if FuncLoadError then + AFailed.Add('SSL_in_init'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_in_before := LoadLibFunction(ADllHandle, SSL_in_before_procname); + FuncLoadError := not assigned(SSL_in_before); + if FuncLoadError then + begin + {$if not defined(SSL_in_before_allownil)} + SSL_in_before := @ERR_SSL_in_before; + {$ifend} + {$if declared(SSL_in_before_introduced)} + if LibVersion < SSL_in_before_introduced then + begin + {$if declared(FC_SSL_in_before)} + SSL_in_before := @FC_SSL_in_before; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_in_before_removed)} + if SSL_in_before_removed <= LibVersion then + begin + {$if declared(_SSL_in_before)} + SSL_in_before := @_SSL_in_before; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_in_before_allownil)} + if FuncLoadError then + AFailed.Add('SSL_in_before'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_is_init_finished := LoadLibFunction(ADllHandle, SSL_is_init_finished_procname); + FuncLoadError := not assigned(SSL_is_init_finished); + if FuncLoadError then + begin + {$if not defined(SSL_is_init_finished_allownil)} + SSL_is_init_finished := @ERR_SSL_is_init_finished; + {$ifend} + {$if declared(SSL_is_init_finished_introduced)} + if LibVersion < SSL_is_init_finished_introduced then + begin + {$if declared(FC_SSL_is_init_finished)} + SSL_is_init_finished := @FC_SSL_is_init_finished; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_is_init_finished_removed)} + if SSL_is_init_finished_removed <= LibVersion then + begin + {$if declared(_SSL_is_init_finished)} + SSL_is_init_finished := @_SSL_is_init_finished; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_is_init_finished_allownil)} + if FuncLoadError then + AFailed.Add('SSL_is_init_finished'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_get_finished := LoadLibFunction(ADllHandle, SSL_get_finished_procname); + FuncLoadError := not assigned(SSL_get_finished); + if FuncLoadError then + begin + {$if not defined(SSL_get_finished_allownil)} + SSL_get_finished := @ERR_SSL_get_finished; + {$ifend} + {$if declared(SSL_get_finished_introduced)} + if LibVersion < SSL_get_finished_introduced then + begin + {$if declared(FC_SSL_get_finished)} + SSL_get_finished := @FC_SSL_get_finished; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_get_finished_removed)} + if SSL_get_finished_removed <= LibVersion then + begin + {$if declared(_SSL_get_finished)} + SSL_get_finished := @_SSL_get_finished; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_get_finished_allownil)} + if FuncLoadError then + AFailed.Add('SSL_get_finished'); + {$ifend} + end; + + + SSL_get_peer_finished := LoadLibFunction(ADllHandle, SSL_get_peer_finished_procname); + FuncLoadError := not assigned(SSL_get_peer_finished); + if FuncLoadError then + begin + {$if not defined(SSL_get_peer_finished_allownil)} + SSL_get_peer_finished := @ERR_SSL_get_peer_finished; + {$ifend} + {$if declared(SSL_get_peer_finished_introduced)} + if LibVersion < SSL_get_peer_finished_introduced then + begin + {$if declared(FC_SSL_get_peer_finished)} + SSL_get_peer_finished := @FC_SSL_get_peer_finished; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_get_peer_finished_removed)} + if SSL_get_peer_finished_removed <= LibVersion then + begin + {$if declared(_SSL_get_peer_finished)} + SSL_get_peer_finished := @_SSL_get_peer_finished; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_get_peer_finished_allownil)} + if FuncLoadError then + AFailed.Add('SSL_get_peer_finished'); + {$ifend} + end; + + + SSLeay_add_ssl_algorithms := LoadLibFunction(ADllHandle, SSLeay_add_ssl_algorithms_procname); + FuncLoadError := not assigned(SSLeay_add_ssl_algorithms); + if FuncLoadError then + begin + {$if not defined(SSLeay_add_ssl_algorithms_allownil)} + SSLeay_add_ssl_algorithms := @ERR_SSLeay_add_ssl_algorithms; + {$ifend} + {$if declared(SSLeay_add_ssl_algorithms_introduced)} + if LibVersion < SSLeay_add_ssl_algorithms_introduced then + begin + {$if declared(FC_SSLeay_add_ssl_algorithms)} + SSLeay_add_ssl_algorithms := @FC_SSLeay_add_ssl_algorithms; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSLeay_add_ssl_algorithms_removed)} + if SSLeay_add_ssl_algorithms_removed <= LibVersion then + begin + {$if declared(_SSLeay_add_ssl_algorithms)} + SSLeay_add_ssl_algorithms := @_SSLeay_add_ssl_algorithms; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSLeay_add_ssl_algorithms_allownil)} + if FuncLoadError then + AFailed.Add('SSLeay_add_ssl_algorithms'); + {$ifend} + end; + + + BIO_f_ssl := LoadLibFunction(ADllHandle, BIO_f_ssl_procname); + FuncLoadError := not assigned(BIO_f_ssl); + if FuncLoadError then + begin + {$if not defined(BIO_f_ssl_allownil)} + BIO_f_ssl := @ERR_BIO_f_ssl; + {$ifend} + {$if declared(BIO_f_ssl_introduced)} + if LibVersion < BIO_f_ssl_introduced then + begin + {$if declared(FC_BIO_f_ssl)} + BIO_f_ssl := @FC_BIO_f_ssl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_f_ssl_removed)} + if BIO_f_ssl_removed <= LibVersion then + begin + {$if declared(_BIO_f_ssl)} + BIO_f_ssl := @_BIO_f_ssl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_f_ssl_allownil)} + if FuncLoadError then + AFailed.Add('BIO_f_ssl'); + {$ifend} + end; + + + BIO_new_ssl := LoadLibFunction(ADllHandle, BIO_new_ssl_procname); + FuncLoadError := not assigned(BIO_new_ssl); + if FuncLoadError then + begin + {$if not defined(BIO_new_ssl_allownil)} + BIO_new_ssl := @ERR_BIO_new_ssl; + {$ifend} + {$if declared(BIO_new_ssl_introduced)} + if LibVersion < BIO_new_ssl_introduced then + begin + {$if declared(FC_BIO_new_ssl)} + BIO_new_ssl := @FC_BIO_new_ssl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_new_ssl_removed)} + if BIO_new_ssl_removed <= LibVersion then + begin + {$if declared(_BIO_new_ssl)} + BIO_new_ssl := @_BIO_new_ssl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_new_ssl_allownil)} + if FuncLoadError then + AFailed.Add('BIO_new_ssl'); + {$ifend} + end; + + + BIO_new_ssl_connect := LoadLibFunction(ADllHandle, BIO_new_ssl_connect_procname); + FuncLoadError := not assigned(BIO_new_ssl_connect); + if FuncLoadError then + begin + {$if not defined(BIO_new_ssl_connect_allownil)} + BIO_new_ssl_connect := @ERR_BIO_new_ssl_connect; + {$ifend} + {$if declared(BIO_new_ssl_connect_introduced)} + if LibVersion < BIO_new_ssl_connect_introduced then + begin + {$if declared(FC_BIO_new_ssl_connect)} + BIO_new_ssl_connect := @FC_BIO_new_ssl_connect; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_new_ssl_connect_removed)} + if BIO_new_ssl_connect_removed <= LibVersion then + begin + {$if declared(_BIO_new_ssl_connect)} + BIO_new_ssl_connect := @_BIO_new_ssl_connect; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_new_ssl_connect_allownil)} + if FuncLoadError then + AFailed.Add('BIO_new_ssl_connect'); + {$ifend} + end; + + + BIO_new_buffer_ssl_connect := LoadLibFunction(ADllHandle, BIO_new_buffer_ssl_connect_procname); + FuncLoadError := not assigned(BIO_new_buffer_ssl_connect); + if FuncLoadError then + begin + {$if not defined(BIO_new_buffer_ssl_connect_allownil)} + BIO_new_buffer_ssl_connect := @ERR_BIO_new_buffer_ssl_connect; + {$ifend} + {$if declared(BIO_new_buffer_ssl_connect_introduced)} + if LibVersion < BIO_new_buffer_ssl_connect_introduced then + begin + {$if declared(FC_BIO_new_buffer_ssl_connect)} + BIO_new_buffer_ssl_connect := @FC_BIO_new_buffer_ssl_connect; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_new_buffer_ssl_connect_removed)} + if BIO_new_buffer_ssl_connect_removed <= LibVersion then + begin + {$if declared(_BIO_new_buffer_ssl_connect)} + BIO_new_buffer_ssl_connect := @_BIO_new_buffer_ssl_connect; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_new_buffer_ssl_connect_allownil)} + if FuncLoadError then + AFailed.Add('BIO_new_buffer_ssl_connect'); + {$ifend} + end; + + + BIO_ssl_copy_session_id := LoadLibFunction(ADllHandle, BIO_ssl_copy_session_id_procname); + FuncLoadError := not assigned(BIO_ssl_copy_session_id); + if FuncLoadError then + begin + {$if not defined(BIO_ssl_copy_session_id_allownil)} + BIO_ssl_copy_session_id := @ERR_BIO_ssl_copy_session_id; + {$ifend} + {$if declared(BIO_ssl_copy_session_id_introduced)} + if LibVersion < BIO_ssl_copy_session_id_introduced then + begin + {$if declared(FC_BIO_ssl_copy_session_id)} + BIO_ssl_copy_session_id := @FC_BIO_ssl_copy_session_id; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_ssl_copy_session_id_removed)} + if BIO_ssl_copy_session_id_removed <= LibVersion then + begin + {$if declared(_BIO_ssl_copy_session_id)} + BIO_ssl_copy_session_id := @_BIO_ssl_copy_session_id; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_ssl_copy_session_id_allownil)} + if FuncLoadError then + AFailed.Add('BIO_ssl_copy_session_id'); + {$ifend} + end; + + + SSL_CTX_set_cipher_list := LoadLibFunction(ADllHandle, SSL_CTX_set_cipher_list_procname); + FuncLoadError := not assigned(SSL_CTX_set_cipher_list); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_set_cipher_list_allownil)} + SSL_CTX_set_cipher_list := @ERR_SSL_CTX_set_cipher_list; + {$ifend} + {$if declared(SSL_CTX_set_cipher_list_introduced)} + if LibVersion < SSL_CTX_set_cipher_list_introduced then + begin + {$if declared(FC_SSL_CTX_set_cipher_list)} + SSL_CTX_set_cipher_list := @FC_SSL_CTX_set_cipher_list; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_set_cipher_list_removed)} + if SSL_CTX_set_cipher_list_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_set_cipher_list)} + SSL_CTX_set_cipher_list := @_SSL_CTX_set_cipher_list; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_set_cipher_list_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_set_cipher_list'); + {$ifend} + end; + + + SSL_CTX_new := LoadLibFunction(ADllHandle, SSL_CTX_new_procname); + FuncLoadError := not assigned(SSL_CTX_new); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_new_allownil)} + SSL_CTX_new := @ERR_SSL_CTX_new; + {$ifend} + {$if declared(SSL_CTX_new_introduced)} + if LibVersion < SSL_CTX_new_introduced then + begin + {$if declared(FC_SSL_CTX_new)} + SSL_CTX_new := @FC_SSL_CTX_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_new_removed)} + if SSL_CTX_new_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_new)} + SSL_CTX_new := @_SSL_CTX_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_new_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_new'); + {$ifend} + end; + + + SSL_CTX_set_timeout := LoadLibFunction(ADllHandle, SSL_CTX_set_timeout_procname); + FuncLoadError := not assigned(SSL_CTX_set_timeout); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_set_timeout_allownil)} + SSL_CTX_set_timeout := @ERR_SSL_CTX_set_timeout; + {$ifend} + {$if declared(SSL_CTX_set_timeout_introduced)} + if LibVersion < SSL_CTX_set_timeout_introduced then + begin + {$if declared(FC_SSL_CTX_set_timeout)} + SSL_CTX_set_timeout := @FC_SSL_CTX_set_timeout; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_set_timeout_removed)} + if SSL_CTX_set_timeout_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_set_timeout)} + SSL_CTX_set_timeout := @_SSL_CTX_set_timeout; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_set_timeout_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_set_timeout'); + {$ifend} + end; + + + SSL_CTX_get_timeout := LoadLibFunction(ADllHandle, SSL_CTX_get_timeout_procname); + FuncLoadError := not assigned(SSL_CTX_get_timeout); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_get_timeout_allownil)} + SSL_CTX_get_timeout := @ERR_SSL_CTX_get_timeout; + {$ifend} + {$if declared(SSL_CTX_get_timeout_introduced)} + if LibVersion < SSL_CTX_get_timeout_introduced then + begin + {$if declared(FC_SSL_CTX_get_timeout)} + SSL_CTX_get_timeout := @FC_SSL_CTX_get_timeout; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_get_timeout_removed)} + if SSL_CTX_get_timeout_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_get_timeout)} + SSL_CTX_get_timeout := @_SSL_CTX_get_timeout; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_get_timeout_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_get_timeout'); + {$ifend} + end; + + + SSL_CTX_get_cert_store := LoadLibFunction(ADllHandle, SSL_CTX_get_cert_store_procname); + FuncLoadError := not assigned(SSL_CTX_get_cert_store); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_get_cert_store_allownil)} + SSL_CTX_get_cert_store := @ERR_SSL_CTX_get_cert_store; + {$ifend} + {$if declared(SSL_CTX_get_cert_store_introduced)} + if LibVersion < SSL_CTX_get_cert_store_introduced then + begin + {$if declared(FC_SSL_CTX_get_cert_store)} + SSL_CTX_get_cert_store := @FC_SSL_CTX_get_cert_store; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_get_cert_store_removed)} + if SSL_CTX_get_cert_store_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_get_cert_store)} + SSL_CTX_get_cert_store := @_SSL_CTX_get_cert_store; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_get_cert_store_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_get_cert_store'); + {$ifend} + end; + + + SSL_want := LoadLibFunction(ADllHandle, SSL_want_procname); + FuncLoadError := not assigned(SSL_want); + if FuncLoadError then + begin + {$if not defined(SSL_want_allownil)} + SSL_want := @ERR_SSL_want; + {$ifend} + {$if declared(SSL_want_introduced)} + if LibVersion < SSL_want_introduced then + begin + {$if declared(FC_SSL_want)} + SSL_want := @FC_SSL_want; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_want_removed)} + if SSL_want_removed <= LibVersion then + begin + {$if declared(_SSL_want)} + SSL_want := @_SSL_want; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_want_allownil)} + if FuncLoadError then + AFailed.Add('SSL_want'); + {$ifend} + end; + + + SSL_clear := LoadLibFunction(ADllHandle, SSL_clear_procname); + FuncLoadError := not assigned(SSL_clear); + if FuncLoadError then + begin + {$if not defined(SSL_clear_allownil)} + SSL_clear := @ERR_SSL_clear; + {$ifend} + {$if declared(SSL_clear_introduced)} + if LibVersion < SSL_clear_introduced then + begin + {$if declared(FC_SSL_clear)} + SSL_clear := @FC_SSL_clear; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_clear_removed)} + if SSL_clear_removed <= LibVersion then + begin + {$if declared(_SSL_clear)} + SSL_clear := @_SSL_clear; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_clear_allownil)} + if FuncLoadError then + AFailed.Add('SSL_clear'); + {$ifend} + end; + + + BIO_ssl_shutdown := LoadLibFunction(ADllHandle, BIO_ssl_shutdown_procname); + FuncLoadError := not assigned(BIO_ssl_shutdown); + if FuncLoadError then + begin + {$if not defined(BIO_ssl_shutdown_allownil)} + BIO_ssl_shutdown := @ERR_BIO_ssl_shutdown; + {$ifend} + {$if declared(BIO_ssl_shutdown_introduced)} + if LibVersion < BIO_ssl_shutdown_introduced then + begin + {$if declared(FC_BIO_ssl_shutdown)} + BIO_ssl_shutdown := @FC_BIO_ssl_shutdown; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BIO_ssl_shutdown_removed)} + if BIO_ssl_shutdown_removed <= LibVersion then + begin + {$if declared(_BIO_ssl_shutdown)} + BIO_ssl_shutdown := @_BIO_ssl_shutdown; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BIO_ssl_shutdown_allownil)} + if FuncLoadError then + AFailed.Add('BIO_ssl_shutdown'); + {$ifend} + end; + + + SSL_CTX_up_ref := LoadLibFunction(ADllHandle, SSL_CTX_up_ref_procname); + FuncLoadError := not assigned(SSL_CTX_up_ref); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_up_ref_allownil)} + SSL_CTX_up_ref := @ERR_SSL_CTX_up_ref; + {$ifend} + {$if declared(SSL_CTX_up_ref_introduced)} + if LibVersion < SSL_CTX_up_ref_introduced then + begin + {$if declared(FC_SSL_CTX_up_ref)} + SSL_CTX_up_ref := @FC_SSL_CTX_up_ref; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_up_ref_removed)} + if SSL_CTX_up_ref_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_up_ref)} + SSL_CTX_up_ref := @_SSL_CTX_up_ref; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_up_ref_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_up_ref'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_CTX_free := LoadLibFunction(ADllHandle, SSL_CTX_free_procname); + FuncLoadError := not assigned(SSL_CTX_free); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_free_allownil)} + SSL_CTX_free := @ERR_SSL_CTX_free; + {$ifend} + {$if declared(SSL_CTX_free_introduced)} + if LibVersion < SSL_CTX_free_introduced then + begin + {$if declared(FC_SSL_CTX_free)} + SSL_CTX_free := @FC_SSL_CTX_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_free_removed)} + if SSL_CTX_free_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_free)} + SSL_CTX_free := @_SSL_CTX_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_free_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_free'); + {$ifend} + end; + + + SSL_CTX_set_cert_store := LoadLibFunction(ADllHandle, SSL_CTX_set_cert_store_procname); + FuncLoadError := not assigned(SSL_CTX_set_cert_store); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_set_cert_store_allownil)} + SSL_CTX_set_cert_store := @ERR_SSL_CTX_set_cert_store; + {$ifend} + {$if declared(SSL_CTX_set_cert_store_introduced)} + if LibVersion < SSL_CTX_set_cert_store_introduced then + begin + {$if declared(FC_SSL_CTX_set_cert_store)} + SSL_CTX_set_cert_store := @FC_SSL_CTX_set_cert_store; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_set_cert_store_removed)} + if SSL_CTX_set_cert_store_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_set_cert_store)} + SSL_CTX_set_cert_store := @_SSL_CTX_set_cert_store; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_set_cert_store_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_set_cert_store'); + {$ifend} + end; + + + SSL_CTX_set1_cert_store := LoadLibFunction(ADllHandle, SSL_CTX_set1_cert_store_procname); + FuncLoadError := not assigned(SSL_CTX_set1_cert_store); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_set1_cert_store_allownil)} + SSL_CTX_set1_cert_store := @ERR_SSL_CTX_set1_cert_store; + {$ifend} + {$if declared(SSL_CTX_set1_cert_store_introduced)} + if LibVersion < SSL_CTX_set1_cert_store_introduced then + begin + {$if declared(FC_SSL_CTX_set1_cert_store)} + SSL_CTX_set1_cert_store := @FC_SSL_CTX_set1_cert_store; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_set1_cert_store_removed)} + if SSL_CTX_set1_cert_store_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_set1_cert_store)} + SSL_CTX_set1_cert_store := @_SSL_CTX_set1_cert_store; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_set1_cert_store_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_set1_cert_store'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_CTX_flush_sessions := LoadLibFunction(ADllHandle, SSL_CTX_flush_sessions_procname); + FuncLoadError := not assigned(SSL_CTX_flush_sessions); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_flush_sessions_allownil)} + SSL_CTX_flush_sessions := @ERR_SSL_CTX_flush_sessions; + {$ifend} + {$if declared(SSL_CTX_flush_sessions_introduced)} + if LibVersion < SSL_CTX_flush_sessions_introduced then + begin + {$if declared(FC_SSL_CTX_flush_sessions)} + SSL_CTX_flush_sessions := @FC_SSL_CTX_flush_sessions; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_flush_sessions_removed)} + if SSL_CTX_flush_sessions_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_flush_sessions)} + SSL_CTX_flush_sessions := @_SSL_CTX_flush_sessions; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_flush_sessions_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_flush_sessions'); + {$ifend} + end; + + + SSL_get_current_cipher := LoadLibFunction(ADllHandle, SSL_get_current_cipher_procname); + FuncLoadError := not assigned(SSL_get_current_cipher); + if FuncLoadError then + begin + {$if not defined(SSL_get_current_cipher_allownil)} + SSL_get_current_cipher := @ERR_SSL_get_current_cipher; + {$ifend} + {$if declared(SSL_get_current_cipher_introduced)} + if LibVersion < SSL_get_current_cipher_introduced then + begin + {$if declared(FC_SSL_get_current_cipher)} + SSL_get_current_cipher := @FC_SSL_get_current_cipher; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_get_current_cipher_removed)} + if SSL_get_current_cipher_removed <= LibVersion then + begin + {$if declared(_SSL_get_current_cipher)} + SSL_get_current_cipher := @_SSL_get_current_cipher; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_get_current_cipher_allownil)} + if FuncLoadError then + AFailed.Add('SSL_get_current_cipher'); + {$ifend} + end; + + + SSL_get_pending_cipher := LoadLibFunction(ADllHandle, SSL_get_pending_cipher_procname); + FuncLoadError := not assigned(SSL_get_pending_cipher); + if FuncLoadError then + begin + {$if not defined(SSL_get_pending_cipher_allownil)} + SSL_get_pending_cipher := @ERR_SSL_get_pending_cipher; + {$ifend} + {$if declared(SSL_get_pending_cipher_introduced)} + if LibVersion < SSL_get_pending_cipher_introduced then + begin + {$if declared(FC_SSL_get_pending_cipher)} + SSL_get_pending_cipher := @FC_SSL_get_pending_cipher; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_get_pending_cipher_removed)} + if SSL_get_pending_cipher_removed <= LibVersion then + begin + {$if declared(_SSL_get_pending_cipher)} + SSL_get_pending_cipher := @_SSL_get_pending_cipher; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_get_pending_cipher_allownil)} + if FuncLoadError then + AFailed.Add('SSL_get_pending_cipher'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_CIPHER_get_bits := LoadLibFunction(ADllHandle, SSL_CIPHER_get_bits_procname); + FuncLoadError := not assigned(SSL_CIPHER_get_bits); + if FuncLoadError then + begin + {$if not defined(SSL_CIPHER_get_bits_allownil)} + SSL_CIPHER_get_bits := @ERR_SSL_CIPHER_get_bits; + {$ifend} + {$if declared(SSL_CIPHER_get_bits_introduced)} + if LibVersion < SSL_CIPHER_get_bits_introduced then + begin + {$if declared(FC_SSL_CIPHER_get_bits)} + SSL_CIPHER_get_bits := @FC_SSL_CIPHER_get_bits; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CIPHER_get_bits_removed)} + if SSL_CIPHER_get_bits_removed <= LibVersion then + begin + {$if declared(_SSL_CIPHER_get_bits)} + SSL_CIPHER_get_bits := @_SSL_CIPHER_get_bits; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CIPHER_get_bits_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CIPHER_get_bits'); + {$ifend} + end; + + + SSL_CIPHER_get_version := LoadLibFunction(ADllHandle, SSL_CIPHER_get_version_procname); + FuncLoadError := not assigned(SSL_CIPHER_get_version); + if FuncLoadError then + begin + {$if not defined(SSL_CIPHER_get_version_allownil)} + SSL_CIPHER_get_version := @ERR_SSL_CIPHER_get_version; + {$ifend} + {$if declared(SSL_CIPHER_get_version_introduced)} + if LibVersion < SSL_CIPHER_get_version_introduced then + begin + {$if declared(FC_SSL_CIPHER_get_version)} + SSL_CIPHER_get_version := @FC_SSL_CIPHER_get_version; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CIPHER_get_version_removed)} + if SSL_CIPHER_get_version_removed <= LibVersion then + begin + {$if declared(_SSL_CIPHER_get_version)} + SSL_CIPHER_get_version := @_SSL_CIPHER_get_version; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CIPHER_get_version_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CIPHER_get_version'); + {$ifend} + end; + + + SSL_CIPHER_get_name := LoadLibFunction(ADllHandle, SSL_CIPHER_get_name_procname); + FuncLoadError := not assigned(SSL_CIPHER_get_name); + if FuncLoadError then + begin + {$if not defined(SSL_CIPHER_get_name_allownil)} + SSL_CIPHER_get_name := @ERR_SSL_CIPHER_get_name; + {$ifend} + {$if declared(SSL_CIPHER_get_name_introduced)} + if LibVersion < SSL_CIPHER_get_name_introduced then + begin + {$if declared(FC_SSL_CIPHER_get_name)} + SSL_CIPHER_get_name := @FC_SSL_CIPHER_get_name; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CIPHER_get_name_removed)} + if SSL_CIPHER_get_name_removed <= LibVersion then + begin + {$if declared(_SSL_CIPHER_get_name)} + SSL_CIPHER_get_name := @_SSL_CIPHER_get_name; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CIPHER_get_name_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CIPHER_get_name'); + {$ifend} + end; + + + SSL_CIPHER_standard_name := LoadLibFunction(ADllHandle, SSL_CIPHER_standard_name_procname); + FuncLoadError := not assigned(SSL_CIPHER_standard_name); + if FuncLoadError then + begin + {$if not defined(SSL_CIPHER_standard_name_allownil)} + SSL_CIPHER_standard_name := @ERR_SSL_CIPHER_standard_name; + {$ifend} + {$if declared(SSL_CIPHER_standard_name_introduced)} + if LibVersion < SSL_CIPHER_standard_name_introduced then + begin + {$if declared(FC_SSL_CIPHER_standard_name)} + SSL_CIPHER_standard_name := @FC_SSL_CIPHER_standard_name; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CIPHER_standard_name_removed)} + if SSL_CIPHER_standard_name_removed <= LibVersion then + begin + {$if declared(_SSL_CIPHER_standard_name)} + SSL_CIPHER_standard_name := @_SSL_CIPHER_standard_name; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CIPHER_standard_name_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CIPHER_standard_name'); + {$ifend} + end; + + {introduced 1.1.0} + OPENSSL_cipher_name := LoadLibFunction(ADllHandle, OPENSSL_cipher_name_procname); + FuncLoadError := not assigned(OPENSSL_cipher_name); + if FuncLoadError then + begin + {$if not defined(OPENSSL_cipher_name_allownil)} + OPENSSL_cipher_name := @ERR_OPENSSL_cipher_name; + {$ifend} + {$if declared(OPENSSL_cipher_name_introduced)} + if LibVersion < OPENSSL_cipher_name_introduced then + begin + {$if declared(FC_OPENSSL_cipher_name)} + OPENSSL_cipher_name := @FC_OPENSSL_cipher_name; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OPENSSL_cipher_name_removed)} + if OPENSSL_cipher_name_removed <= LibVersion then + begin + {$if declared(_OPENSSL_cipher_name)} + OPENSSL_cipher_name := @_OPENSSL_cipher_name; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OPENSSL_cipher_name_allownil)} + if FuncLoadError then + AFailed.Add('OPENSSL_cipher_name'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_CIPHER_get_id := LoadLibFunction(ADllHandle, SSL_CIPHER_get_id_procname); + FuncLoadError := not assigned(SSL_CIPHER_get_id); + if FuncLoadError then + begin + {$if not defined(SSL_CIPHER_get_id_allownil)} + SSL_CIPHER_get_id := @ERR_SSL_CIPHER_get_id; + {$ifend} + {$if declared(SSL_CIPHER_get_id_introduced)} + if LibVersion < SSL_CIPHER_get_id_introduced then + begin + {$if declared(FC_SSL_CIPHER_get_id)} + SSL_CIPHER_get_id := @FC_SSL_CIPHER_get_id; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CIPHER_get_id_removed)} + if SSL_CIPHER_get_id_removed <= LibVersion then + begin + {$if declared(_SSL_CIPHER_get_id)} + SSL_CIPHER_get_id := @_SSL_CIPHER_get_id; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CIPHER_get_id_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CIPHER_get_id'); + {$ifend} + end; + + + SSL_CIPHER_get_protocol_id := LoadLibFunction(ADllHandle, SSL_CIPHER_get_protocol_id_procname); + FuncLoadError := not assigned(SSL_CIPHER_get_protocol_id); + if FuncLoadError then + begin + {$if not defined(SSL_CIPHER_get_protocol_id_allownil)} + SSL_CIPHER_get_protocol_id := @ERR_SSL_CIPHER_get_protocol_id; + {$ifend} + {$if declared(SSL_CIPHER_get_protocol_id_introduced)} + if LibVersion < SSL_CIPHER_get_protocol_id_introduced then + begin + {$if declared(FC_SSL_CIPHER_get_protocol_id)} + SSL_CIPHER_get_protocol_id := @FC_SSL_CIPHER_get_protocol_id; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CIPHER_get_protocol_id_removed)} + if SSL_CIPHER_get_protocol_id_removed <= LibVersion then + begin + {$if declared(_SSL_CIPHER_get_protocol_id)} + SSL_CIPHER_get_protocol_id := @_SSL_CIPHER_get_protocol_id; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CIPHER_get_protocol_id_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CIPHER_get_protocol_id'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_CIPHER_get_kx_nid := LoadLibFunction(ADllHandle, SSL_CIPHER_get_kx_nid_procname); + FuncLoadError := not assigned(SSL_CIPHER_get_kx_nid); + if FuncLoadError then + begin + {$if not defined(SSL_CIPHER_get_kx_nid_allownil)} + SSL_CIPHER_get_kx_nid := @ERR_SSL_CIPHER_get_kx_nid; + {$ifend} + {$if declared(SSL_CIPHER_get_kx_nid_introduced)} + if LibVersion < SSL_CIPHER_get_kx_nid_introduced then + begin + {$if declared(FC_SSL_CIPHER_get_kx_nid)} + SSL_CIPHER_get_kx_nid := @FC_SSL_CIPHER_get_kx_nid; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CIPHER_get_kx_nid_removed)} + if SSL_CIPHER_get_kx_nid_removed <= LibVersion then + begin + {$if declared(_SSL_CIPHER_get_kx_nid)} + SSL_CIPHER_get_kx_nid := @_SSL_CIPHER_get_kx_nid; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CIPHER_get_kx_nid_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CIPHER_get_kx_nid'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_CIPHER_get_auth_nid := LoadLibFunction(ADllHandle, SSL_CIPHER_get_auth_nid_procname); + FuncLoadError := not assigned(SSL_CIPHER_get_auth_nid); + if FuncLoadError then + begin + {$if not defined(SSL_CIPHER_get_auth_nid_allownil)} + SSL_CIPHER_get_auth_nid := @ERR_SSL_CIPHER_get_auth_nid; + {$ifend} + {$if declared(SSL_CIPHER_get_auth_nid_introduced)} + if LibVersion < SSL_CIPHER_get_auth_nid_introduced then + begin + {$if declared(FC_SSL_CIPHER_get_auth_nid)} + SSL_CIPHER_get_auth_nid := @FC_SSL_CIPHER_get_auth_nid; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CIPHER_get_auth_nid_removed)} + if SSL_CIPHER_get_auth_nid_removed <= LibVersion then + begin + {$if declared(_SSL_CIPHER_get_auth_nid)} + SSL_CIPHER_get_auth_nid := @_SSL_CIPHER_get_auth_nid; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CIPHER_get_auth_nid_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CIPHER_get_auth_nid'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_CIPHER_get_handshake_digest := LoadLibFunction(ADllHandle, SSL_CIPHER_get_handshake_digest_procname); + FuncLoadError := not assigned(SSL_CIPHER_get_handshake_digest); + if FuncLoadError then + begin + {$if not defined(SSL_CIPHER_get_handshake_digest_allownil)} + SSL_CIPHER_get_handshake_digest := @ERR_SSL_CIPHER_get_handshake_digest; + {$ifend} + {$if declared(SSL_CIPHER_get_handshake_digest_introduced)} + if LibVersion < SSL_CIPHER_get_handshake_digest_introduced then + begin + {$if declared(FC_SSL_CIPHER_get_handshake_digest)} + SSL_CIPHER_get_handshake_digest := @FC_SSL_CIPHER_get_handshake_digest; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CIPHER_get_handshake_digest_removed)} + if SSL_CIPHER_get_handshake_digest_removed <= LibVersion then + begin + {$if declared(_SSL_CIPHER_get_handshake_digest)} + SSL_CIPHER_get_handshake_digest := @_SSL_CIPHER_get_handshake_digest; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CIPHER_get_handshake_digest_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CIPHER_get_handshake_digest'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_CIPHER_is_aead := LoadLibFunction(ADllHandle, SSL_CIPHER_is_aead_procname); + FuncLoadError := not assigned(SSL_CIPHER_is_aead); + if FuncLoadError then + begin + {$if not defined(SSL_CIPHER_is_aead_allownil)} + SSL_CIPHER_is_aead := @ERR_SSL_CIPHER_is_aead; + {$ifend} + {$if declared(SSL_CIPHER_is_aead_introduced)} + if LibVersion < SSL_CIPHER_is_aead_introduced then + begin + {$if declared(FC_SSL_CIPHER_is_aead)} + SSL_CIPHER_is_aead := @FC_SSL_CIPHER_is_aead; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CIPHER_is_aead_removed)} + if SSL_CIPHER_is_aead_removed <= LibVersion then + begin + {$if declared(_SSL_CIPHER_is_aead)} + SSL_CIPHER_is_aead := @_SSL_CIPHER_is_aead; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CIPHER_is_aead_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CIPHER_is_aead'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_get_fd := LoadLibFunction(ADllHandle, SSL_get_fd_procname); + FuncLoadError := not assigned(SSL_get_fd); + if FuncLoadError then + begin + {$if not defined(SSL_get_fd_allownil)} + SSL_get_fd := @ERR_SSL_get_fd; + {$ifend} + {$if declared(SSL_get_fd_introduced)} + if LibVersion < SSL_get_fd_introduced then + begin + {$if declared(FC_SSL_get_fd)} + SSL_get_fd := @FC_SSL_get_fd; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_get_fd_removed)} + if SSL_get_fd_removed <= LibVersion then + begin + {$if declared(_SSL_get_fd)} + SSL_get_fd := @_SSL_get_fd; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_get_fd_allownil)} + if FuncLoadError then + AFailed.Add('SSL_get_fd'); + {$ifend} + end; + + + SSL_get_rfd := LoadLibFunction(ADllHandle, SSL_get_rfd_procname); + FuncLoadError := not assigned(SSL_get_rfd); + if FuncLoadError then + begin + {$if not defined(SSL_get_rfd_allownil)} + SSL_get_rfd := @ERR_SSL_get_rfd; + {$ifend} + {$if declared(SSL_get_rfd_introduced)} + if LibVersion < SSL_get_rfd_introduced then + begin + {$if declared(FC_SSL_get_rfd)} + SSL_get_rfd := @FC_SSL_get_rfd; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_get_rfd_removed)} + if SSL_get_rfd_removed <= LibVersion then + begin + {$if declared(_SSL_get_rfd)} + SSL_get_rfd := @_SSL_get_rfd; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_get_rfd_allownil)} + if FuncLoadError then + AFailed.Add('SSL_get_rfd'); + {$ifend} + end; + + + SSL_get_wfd := LoadLibFunction(ADllHandle, SSL_get_wfd_procname); + FuncLoadError := not assigned(SSL_get_wfd); + if FuncLoadError then + begin + {$if not defined(SSL_get_wfd_allownil)} + SSL_get_wfd := @ERR_SSL_get_wfd; + {$ifend} + {$if declared(SSL_get_wfd_introduced)} + if LibVersion < SSL_get_wfd_introduced then + begin + {$if declared(FC_SSL_get_wfd)} + SSL_get_wfd := @FC_SSL_get_wfd; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_get_wfd_removed)} + if SSL_get_wfd_removed <= LibVersion then + begin + {$if declared(_SSL_get_wfd)} + SSL_get_wfd := @_SSL_get_wfd; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_get_wfd_allownil)} + if FuncLoadError then + AFailed.Add('SSL_get_wfd'); + {$ifend} + end; + + + SSL_get_cipher_list := LoadLibFunction(ADllHandle, SSL_get_cipher_list_procname); + FuncLoadError := not assigned(SSL_get_cipher_list); + if FuncLoadError then + begin + {$if not defined(SSL_get_cipher_list_allownil)} + SSL_get_cipher_list := @ERR_SSL_get_cipher_list; + {$ifend} + {$if declared(SSL_get_cipher_list_introduced)} + if LibVersion < SSL_get_cipher_list_introduced then + begin + {$if declared(FC_SSL_get_cipher_list)} + SSL_get_cipher_list := @FC_SSL_get_cipher_list; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_get_cipher_list_removed)} + if SSL_get_cipher_list_removed <= LibVersion then + begin + {$if declared(_SSL_get_cipher_list)} + SSL_get_cipher_list := @_SSL_get_cipher_list; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_get_cipher_list_allownil)} + if FuncLoadError then + AFailed.Add('SSL_get_cipher_list'); + {$ifend} + end; + + + SSL_get_shared_ciphers := LoadLibFunction(ADllHandle, SSL_get_shared_ciphers_procname); + FuncLoadError := not assigned(SSL_get_shared_ciphers); + if FuncLoadError then + begin + {$if not defined(SSL_get_shared_ciphers_allownil)} + SSL_get_shared_ciphers := @ERR_SSL_get_shared_ciphers; + {$ifend} + {$if declared(SSL_get_shared_ciphers_introduced)} + if LibVersion < SSL_get_shared_ciphers_introduced then + begin + {$if declared(FC_SSL_get_shared_ciphers)} + SSL_get_shared_ciphers := @FC_SSL_get_shared_ciphers; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_get_shared_ciphers_removed)} + if SSL_get_shared_ciphers_removed <= LibVersion then + begin + {$if declared(_SSL_get_shared_ciphers)} + SSL_get_shared_ciphers := @_SSL_get_shared_ciphers; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_get_shared_ciphers_allownil)} + if FuncLoadError then + AFailed.Add('SSL_get_shared_ciphers'); + {$ifend} + end; + + + SSL_get_read_ahead := LoadLibFunction(ADllHandle, SSL_get_read_ahead_procname); + FuncLoadError := not assigned(SSL_get_read_ahead); + if FuncLoadError then + begin + {$if not defined(SSL_get_read_ahead_allownil)} + SSL_get_read_ahead := @ERR_SSL_get_read_ahead; + {$ifend} + {$if declared(SSL_get_read_ahead_introduced)} + if LibVersion < SSL_get_read_ahead_introduced then + begin + {$if declared(FC_SSL_get_read_ahead)} + SSL_get_read_ahead := @FC_SSL_get_read_ahead; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_get_read_ahead_removed)} + if SSL_get_read_ahead_removed <= LibVersion then + begin + {$if declared(_SSL_get_read_ahead)} + SSL_get_read_ahead := @_SSL_get_read_ahead; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_get_read_ahead_allownil)} + if FuncLoadError then + AFailed.Add('SSL_get_read_ahead'); + {$ifend} + end; + + + SSL_pending := LoadLibFunction(ADllHandle, SSL_pending_procname); + FuncLoadError := not assigned(SSL_pending); + if FuncLoadError then + begin + {$if not defined(SSL_pending_allownil)} + SSL_pending := @ERR_SSL_pending; + {$ifend} + {$if declared(SSL_pending_introduced)} + if LibVersion < SSL_pending_introduced then + begin + {$if declared(FC_SSL_pending)} + SSL_pending := @FC_SSL_pending; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_pending_removed)} + if SSL_pending_removed <= LibVersion then + begin + {$if declared(_SSL_pending)} + SSL_pending := @_SSL_pending; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_pending_allownil)} + if FuncLoadError then + AFailed.Add('SSL_pending'); + {$ifend} + end; + + + SSL_has_pending := LoadLibFunction(ADllHandle, SSL_has_pending_procname); + FuncLoadError := not assigned(SSL_has_pending); + if FuncLoadError then + begin + {$if not defined(SSL_has_pending_allownil)} + SSL_has_pending := @ERR_SSL_has_pending; + {$ifend} + {$if declared(SSL_has_pending_introduced)} + if LibVersion < SSL_has_pending_introduced then + begin + {$if declared(FC_SSL_has_pending)} + SSL_has_pending := @FC_SSL_has_pending; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_has_pending_removed)} + if SSL_has_pending_removed <= LibVersion then + begin + {$if declared(_SSL_has_pending)} + SSL_has_pending := @_SSL_has_pending; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_has_pending_allownil)} + if FuncLoadError then + AFailed.Add('SSL_has_pending'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_set_fd := LoadLibFunction(ADllHandle, SSL_set_fd_procname); + FuncLoadError := not assigned(SSL_set_fd); + if FuncLoadError then + begin + {$if not defined(SSL_set_fd_allownil)} + SSL_set_fd := @ERR_SSL_set_fd; + {$ifend} + {$if declared(SSL_set_fd_introduced)} + if LibVersion < SSL_set_fd_introduced then + begin + {$if declared(FC_SSL_set_fd)} + SSL_set_fd := @FC_SSL_set_fd; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_set_fd_removed)} + if SSL_set_fd_removed <= LibVersion then + begin + {$if declared(_SSL_set_fd)} + SSL_set_fd := @_SSL_set_fd; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_set_fd_allownil)} + if FuncLoadError then + AFailed.Add('SSL_set_fd'); + {$ifend} + end; + + + SSL_set_rfd := LoadLibFunction(ADllHandle, SSL_set_rfd_procname); + FuncLoadError := not assigned(SSL_set_rfd); + if FuncLoadError then + begin + {$if not defined(SSL_set_rfd_allownil)} + SSL_set_rfd := @ERR_SSL_set_rfd; + {$ifend} + {$if declared(SSL_set_rfd_introduced)} + if LibVersion < SSL_set_rfd_introduced then + begin + {$if declared(FC_SSL_set_rfd)} + SSL_set_rfd := @FC_SSL_set_rfd; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_set_rfd_removed)} + if SSL_set_rfd_removed <= LibVersion then + begin + {$if declared(_SSL_set_rfd)} + SSL_set_rfd := @_SSL_set_rfd; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_set_rfd_allownil)} + if FuncLoadError then + AFailed.Add('SSL_set_rfd'); + {$ifend} + end; + + + SSL_set_wfd := LoadLibFunction(ADllHandle, SSL_set_wfd_procname); + FuncLoadError := not assigned(SSL_set_wfd); + if FuncLoadError then + begin + {$if not defined(SSL_set_wfd_allownil)} + SSL_set_wfd := @ERR_SSL_set_wfd; + {$ifend} + {$if declared(SSL_set_wfd_introduced)} + if LibVersion < SSL_set_wfd_introduced then + begin + {$if declared(FC_SSL_set_wfd)} + SSL_set_wfd := @FC_SSL_set_wfd; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_set_wfd_removed)} + if SSL_set_wfd_removed <= LibVersion then + begin + {$if declared(_SSL_set_wfd)} + SSL_set_wfd := @_SSL_set_wfd; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_set_wfd_allownil)} + if FuncLoadError then + AFailed.Add('SSL_set_wfd'); + {$ifend} + end; + + + SSL_set0_rbio := LoadLibFunction(ADllHandle, SSL_set0_rbio_procname); + FuncLoadError := not assigned(SSL_set0_rbio); + if FuncLoadError then + begin + {$if not defined(SSL_set0_rbio_allownil)} + SSL_set0_rbio := @ERR_SSL_set0_rbio; + {$ifend} + {$if declared(SSL_set0_rbio_introduced)} + if LibVersion < SSL_set0_rbio_introduced then + begin + {$if declared(FC_SSL_set0_rbio)} + SSL_set0_rbio := @FC_SSL_set0_rbio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_set0_rbio_removed)} + if SSL_set0_rbio_removed <= LibVersion then + begin + {$if declared(_SSL_set0_rbio)} + SSL_set0_rbio := @_SSL_set0_rbio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_set0_rbio_allownil)} + if FuncLoadError then + AFailed.Add('SSL_set0_rbio'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_set0_wbio := LoadLibFunction(ADllHandle, SSL_set0_wbio_procname); + FuncLoadError := not assigned(SSL_set0_wbio); + if FuncLoadError then + begin + {$if not defined(SSL_set0_wbio_allownil)} + SSL_set0_wbio := @ERR_SSL_set0_wbio; + {$ifend} + {$if declared(SSL_set0_wbio_introduced)} + if LibVersion < SSL_set0_wbio_introduced then + begin + {$if declared(FC_SSL_set0_wbio)} + SSL_set0_wbio := @FC_SSL_set0_wbio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_set0_wbio_removed)} + if SSL_set0_wbio_removed <= LibVersion then + begin + {$if declared(_SSL_set0_wbio)} + SSL_set0_wbio := @_SSL_set0_wbio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_set0_wbio_allownil)} + if FuncLoadError then + AFailed.Add('SSL_set0_wbio'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_set_bio := LoadLibFunction(ADllHandle, SSL_set_bio_procname); + FuncLoadError := not assigned(SSL_set_bio); + if FuncLoadError then + begin + {$if not defined(SSL_set_bio_allownil)} + SSL_set_bio := @ERR_SSL_set_bio; + {$ifend} + {$if declared(SSL_set_bio_introduced)} + if LibVersion < SSL_set_bio_introduced then + begin + {$if declared(FC_SSL_set_bio)} + SSL_set_bio := @FC_SSL_set_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_set_bio_removed)} + if SSL_set_bio_removed <= LibVersion then + begin + {$if declared(_SSL_set_bio)} + SSL_set_bio := @_SSL_set_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_set_bio_allownil)} + if FuncLoadError then + AFailed.Add('SSL_set_bio'); + {$ifend} + end; + + + SSL_get_rbio := LoadLibFunction(ADllHandle, SSL_get_rbio_procname); + FuncLoadError := not assigned(SSL_get_rbio); + if FuncLoadError then + begin + {$if not defined(SSL_get_rbio_allownil)} + SSL_get_rbio := @ERR_SSL_get_rbio; + {$ifend} + {$if declared(SSL_get_rbio_introduced)} + if LibVersion < SSL_get_rbio_introduced then + begin + {$if declared(FC_SSL_get_rbio)} + SSL_get_rbio := @FC_SSL_get_rbio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_get_rbio_removed)} + if SSL_get_rbio_removed <= LibVersion then + begin + {$if declared(_SSL_get_rbio)} + SSL_get_rbio := @_SSL_get_rbio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_get_rbio_allownil)} + if FuncLoadError then + AFailed.Add('SSL_get_rbio'); + {$ifend} + end; + + + SSL_get_wbio := LoadLibFunction(ADllHandle, SSL_get_wbio_procname); + FuncLoadError := not assigned(SSL_get_wbio); + if FuncLoadError then + begin + {$if not defined(SSL_get_wbio_allownil)} + SSL_get_wbio := @ERR_SSL_get_wbio; + {$ifend} + {$if declared(SSL_get_wbio_introduced)} + if LibVersion < SSL_get_wbio_introduced then + begin + {$if declared(FC_SSL_get_wbio)} + SSL_get_wbio := @FC_SSL_get_wbio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_get_wbio_removed)} + if SSL_get_wbio_removed <= LibVersion then + begin + {$if declared(_SSL_get_wbio)} + SSL_get_wbio := @_SSL_get_wbio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_get_wbio_allownil)} + if FuncLoadError then + AFailed.Add('SSL_get_wbio'); + {$ifend} + end; + + + SSL_set_cipher_list := LoadLibFunction(ADllHandle, SSL_set_cipher_list_procname); + FuncLoadError := not assigned(SSL_set_cipher_list); + if FuncLoadError then + begin + {$if not defined(SSL_set_cipher_list_allownil)} + SSL_set_cipher_list := @ERR_SSL_set_cipher_list; + {$ifend} + {$if declared(SSL_set_cipher_list_introduced)} + if LibVersion < SSL_set_cipher_list_introduced then + begin + {$if declared(FC_SSL_set_cipher_list)} + SSL_set_cipher_list := @FC_SSL_set_cipher_list; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_set_cipher_list_removed)} + if SSL_set_cipher_list_removed <= LibVersion then + begin + {$if declared(_SSL_set_cipher_list)} + SSL_set_cipher_list := @_SSL_set_cipher_list; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_set_cipher_list_allownil)} + if FuncLoadError then + AFailed.Add('SSL_set_cipher_list'); + {$ifend} + end; + + + SSL_CTX_set_ciphersuites := LoadLibFunction(ADllHandle, SSL_CTX_set_ciphersuites_procname); + FuncLoadError := not assigned(SSL_CTX_set_ciphersuites); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_set_ciphersuites_allownil)} + SSL_CTX_set_ciphersuites := @ERR_SSL_CTX_set_ciphersuites; + {$ifend} + {$if declared(SSL_CTX_set_ciphersuites_introduced)} + if LibVersion < SSL_CTX_set_ciphersuites_introduced then + begin + {$if declared(FC_SSL_CTX_set_ciphersuites)} + SSL_CTX_set_ciphersuites := @FC_SSL_CTX_set_ciphersuites; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_set_ciphersuites_removed)} + if SSL_CTX_set_ciphersuites_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_set_ciphersuites)} + SSL_CTX_set_ciphersuites := @_SSL_CTX_set_ciphersuites; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_set_ciphersuites_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_set_ciphersuites'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_set_ciphersuites := LoadLibFunction(ADllHandle, SSL_set_ciphersuites_procname); + FuncLoadError := not assigned(SSL_set_ciphersuites); + if FuncLoadError then + begin + {$if not defined(SSL_set_ciphersuites_allownil)} + SSL_set_ciphersuites := @ERR_SSL_set_ciphersuites; + {$ifend} + {$if declared(SSL_set_ciphersuites_introduced)} + if LibVersion < SSL_set_ciphersuites_introduced then + begin + {$if declared(FC_SSL_set_ciphersuites)} + SSL_set_ciphersuites := @FC_SSL_set_ciphersuites; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_set_ciphersuites_removed)} + if SSL_set_ciphersuites_removed <= LibVersion then + begin + {$if declared(_SSL_set_ciphersuites)} + SSL_set_ciphersuites := @_SSL_set_ciphersuites; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_set_ciphersuites_allownil)} + if FuncLoadError then + AFailed.Add('SSL_set_ciphersuites'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_get_verify_mode := LoadLibFunction(ADllHandle, SSL_get_verify_mode_procname); + FuncLoadError := not assigned(SSL_get_verify_mode); + if FuncLoadError then + begin + {$if not defined(SSL_get_verify_mode_allownil)} + SSL_get_verify_mode := @ERR_SSL_get_verify_mode; + {$ifend} + {$if declared(SSL_get_verify_mode_introduced)} + if LibVersion < SSL_get_verify_mode_introduced then + begin + {$if declared(FC_SSL_get_verify_mode)} + SSL_get_verify_mode := @FC_SSL_get_verify_mode; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_get_verify_mode_removed)} + if SSL_get_verify_mode_removed <= LibVersion then + begin + {$if declared(_SSL_get_verify_mode)} + SSL_get_verify_mode := @_SSL_get_verify_mode; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_get_verify_mode_allownil)} + if FuncLoadError then + AFailed.Add('SSL_get_verify_mode'); + {$ifend} + end; + + + SSL_get_verify_depth := LoadLibFunction(ADllHandle, SSL_get_verify_depth_procname); + FuncLoadError := not assigned(SSL_get_verify_depth); + if FuncLoadError then + begin + {$if not defined(SSL_get_verify_depth_allownil)} + SSL_get_verify_depth := @ERR_SSL_get_verify_depth; + {$ifend} + {$if declared(SSL_get_verify_depth_introduced)} + if LibVersion < SSL_get_verify_depth_introduced then + begin + {$if declared(FC_SSL_get_verify_depth)} + SSL_get_verify_depth := @FC_SSL_get_verify_depth; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_get_verify_depth_removed)} + if SSL_get_verify_depth_removed <= LibVersion then + begin + {$if declared(_SSL_get_verify_depth)} + SSL_get_verify_depth := @_SSL_get_verify_depth; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_get_verify_depth_allownil)} + if FuncLoadError then + AFailed.Add('SSL_get_verify_depth'); + {$ifend} + end; + + + SSL_get_verify_callback := LoadLibFunction(ADllHandle, SSL_get_verify_callback_procname); + FuncLoadError := not assigned(SSL_get_verify_callback); + if FuncLoadError then + begin + {$if not defined(SSL_get_verify_callback_allownil)} + SSL_get_verify_callback := @ERR_SSL_get_verify_callback; + {$ifend} + {$if declared(SSL_get_verify_callback_introduced)} + if LibVersion < SSL_get_verify_callback_introduced then + begin + {$if declared(FC_SSL_get_verify_callback)} + SSL_get_verify_callback := @FC_SSL_get_verify_callback; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_get_verify_callback_removed)} + if SSL_get_verify_callback_removed <= LibVersion then + begin + {$if declared(_SSL_get_verify_callback)} + SSL_get_verify_callback := @_SSL_get_verify_callback; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_get_verify_callback_allownil)} + if FuncLoadError then + AFailed.Add('SSL_get_verify_callback'); + {$ifend} + end; + + + SSL_set_read_ahead := LoadLibFunction(ADllHandle, SSL_set_read_ahead_procname); + FuncLoadError := not assigned(SSL_set_read_ahead); + if FuncLoadError then + begin + {$if not defined(SSL_set_read_ahead_allownil)} + SSL_set_read_ahead := @ERR_SSL_set_read_ahead; + {$ifend} + {$if declared(SSL_set_read_ahead_introduced)} + if LibVersion < SSL_set_read_ahead_introduced then + begin + {$if declared(FC_SSL_set_read_ahead)} + SSL_set_read_ahead := @FC_SSL_set_read_ahead; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_set_read_ahead_removed)} + if SSL_set_read_ahead_removed <= LibVersion then + begin + {$if declared(_SSL_set_read_ahead)} + SSL_set_read_ahead := @_SSL_set_read_ahead; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_set_read_ahead_allownil)} + if FuncLoadError then + AFailed.Add('SSL_set_read_ahead'); + {$ifend} + end; + + + SSL_set_verify := LoadLibFunction(ADllHandle, SSL_set_verify_procname); + FuncLoadError := not assigned(SSL_set_verify); + if FuncLoadError then + begin + {$if not defined(SSL_set_verify_allownil)} + SSL_set_verify := @ERR_SSL_set_verify; + {$ifend} + {$if declared(SSL_set_verify_introduced)} + if LibVersion < SSL_set_verify_introduced then + begin + {$if declared(FC_SSL_set_verify)} + SSL_set_verify := @FC_SSL_set_verify; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_set_verify_removed)} + if SSL_set_verify_removed <= LibVersion then + begin + {$if declared(_SSL_set_verify)} + SSL_set_verify := @_SSL_set_verify; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_set_verify_allownil)} + if FuncLoadError then + AFailed.Add('SSL_set_verify'); + {$ifend} + end; + + + SSL_set_verify_depth := LoadLibFunction(ADllHandle, SSL_set_verify_depth_procname); + FuncLoadError := not assigned(SSL_set_verify_depth); + if FuncLoadError then + begin + {$if not defined(SSL_set_verify_depth_allownil)} + SSL_set_verify_depth := @ERR_SSL_set_verify_depth; + {$ifend} + {$if declared(SSL_set_verify_depth_introduced)} + if LibVersion < SSL_set_verify_depth_introduced then + begin + {$if declared(FC_SSL_set_verify_depth)} + SSL_set_verify_depth := @FC_SSL_set_verify_depth; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_set_verify_depth_removed)} + if SSL_set_verify_depth_removed <= LibVersion then + begin + {$if declared(_SSL_set_verify_depth)} + SSL_set_verify_depth := @_SSL_set_verify_depth; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_set_verify_depth_allownil)} + if FuncLoadError then + AFailed.Add('SSL_set_verify_depth'); + {$ifend} + end; + + + SSL_use_RSAPrivateKey := LoadLibFunction(ADllHandle, SSL_use_RSAPrivateKey_procname); + FuncLoadError := not assigned(SSL_use_RSAPrivateKey); + if FuncLoadError then + begin + {$if not defined(SSL_use_RSAPrivateKey_allownil)} + SSL_use_RSAPrivateKey := @ERR_SSL_use_RSAPrivateKey; + {$ifend} + {$if declared(SSL_use_RSAPrivateKey_introduced)} + if LibVersion < SSL_use_RSAPrivateKey_introduced then + begin + {$if declared(FC_SSL_use_RSAPrivateKey)} + SSL_use_RSAPrivateKey := @FC_SSL_use_RSAPrivateKey; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_use_RSAPrivateKey_removed)} + if SSL_use_RSAPrivateKey_removed <= LibVersion then + begin + {$if declared(_SSL_use_RSAPrivateKey)} + SSL_use_RSAPrivateKey := @_SSL_use_RSAPrivateKey; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_use_RSAPrivateKey_allownil)} + if FuncLoadError then + AFailed.Add('SSL_use_RSAPrivateKey'); + {$ifend} + end; + + + SSL_use_RSAPrivateKey_ASN1 := LoadLibFunction(ADllHandle, SSL_use_RSAPrivateKey_ASN1_procname); + FuncLoadError := not assigned(SSL_use_RSAPrivateKey_ASN1); + if FuncLoadError then + begin + {$if not defined(SSL_use_RSAPrivateKey_ASN1_allownil)} + SSL_use_RSAPrivateKey_ASN1 := @ERR_SSL_use_RSAPrivateKey_ASN1; + {$ifend} + {$if declared(SSL_use_RSAPrivateKey_ASN1_introduced)} + if LibVersion < SSL_use_RSAPrivateKey_ASN1_introduced then + begin + {$if declared(FC_SSL_use_RSAPrivateKey_ASN1)} + SSL_use_RSAPrivateKey_ASN1 := @FC_SSL_use_RSAPrivateKey_ASN1; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_use_RSAPrivateKey_ASN1_removed)} + if SSL_use_RSAPrivateKey_ASN1_removed <= LibVersion then + begin + {$if declared(_SSL_use_RSAPrivateKey_ASN1)} + SSL_use_RSAPrivateKey_ASN1 := @_SSL_use_RSAPrivateKey_ASN1; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_use_RSAPrivateKey_ASN1_allownil)} + if FuncLoadError then + AFailed.Add('SSL_use_RSAPrivateKey_ASN1'); + {$ifend} + end; + + + SSL_use_PrivateKey := LoadLibFunction(ADllHandle, SSL_use_PrivateKey_procname); + FuncLoadError := not assigned(SSL_use_PrivateKey); + if FuncLoadError then + begin + {$if not defined(SSL_use_PrivateKey_allownil)} + SSL_use_PrivateKey := @ERR_SSL_use_PrivateKey; + {$ifend} + {$if declared(SSL_use_PrivateKey_introduced)} + if LibVersion < SSL_use_PrivateKey_introduced then + begin + {$if declared(FC_SSL_use_PrivateKey)} + SSL_use_PrivateKey := @FC_SSL_use_PrivateKey; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_use_PrivateKey_removed)} + if SSL_use_PrivateKey_removed <= LibVersion then + begin + {$if declared(_SSL_use_PrivateKey)} + SSL_use_PrivateKey := @_SSL_use_PrivateKey; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_use_PrivateKey_allownil)} + if FuncLoadError then + AFailed.Add('SSL_use_PrivateKey'); + {$ifend} + end; + + + SSL_use_PrivateKey_ASN1 := LoadLibFunction(ADllHandle, SSL_use_PrivateKey_ASN1_procname); + FuncLoadError := not assigned(SSL_use_PrivateKey_ASN1); + if FuncLoadError then + begin + {$if not defined(SSL_use_PrivateKey_ASN1_allownil)} + SSL_use_PrivateKey_ASN1 := @ERR_SSL_use_PrivateKey_ASN1; + {$ifend} + {$if declared(SSL_use_PrivateKey_ASN1_introduced)} + if LibVersion < SSL_use_PrivateKey_ASN1_introduced then + begin + {$if declared(FC_SSL_use_PrivateKey_ASN1)} + SSL_use_PrivateKey_ASN1 := @FC_SSL_use_PrivateKey_ASN1; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_use_PrivateKey_ASN1_removed)} + if SSL_use_PrivateKey_ASN1_removed <= LibVersion then + begin + {$if declared(_SSL_use_PrivateKey_ASN1)} + SSL_use_PrivateKey_ASN1 := @_SSL_use_PrivateKey_ASN1; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_use_PrivateKey_ASN1_allownil)} + if FuncLoadError then + AFailed.Add('SSL_use_PrivateKey_ASN1'); + {$ifend} + end; + + + SSL_use_certificate := LoadLibFunction(ADllHandle, SSL_use_certificate_procname); + FuncLoadError := not assigned(SSL_use_certificate); + if FuncLoadError then + begin + {$if not defined(SSL_use_certificate_allownil)} + SSL_use_certificate := @ERR_SSL_use_certificate; + {$ifend} + {$if declared(SSL_use_certificate_introduced)} + if LibVersion < SSL_use_certificate_introduced then + begin + {$if declared(FC_SSL_use_certificate)} + SSL_use_certificate := @FC_SSL_use_certificate; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_use_certificate_removed)} + if SSL_use_certificate_removed <= LibVersion then + begin + {$if declared(_SSL_use_certificate)} + SSL_use_certificate := @_SSL_use_certificate; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_use_certificate_allownil)} + if FuncLoadError then + AFailed.Add('SSL_use_certificate'); + {$ifend} + end; + + + SSL_use_certificate_ASN1 := LoadLibFunction(ADllHandle, SSL_use_certificate_ASN1_procname); + FuncLoadError := not assigned(SSL_use_certificate_ASN1); + if FuncLoadError then + begin + {$if not defined(SSL_use_certificate_ASN1_allownil)} + SSL_use_certificate_ASN1 := @ERR_SSL_use_certificate_ASN1; + {$ifend} + {$if declared(SSL_use_certificate_ASN1_introduced)} + if LibVersion < SSL_use_certificate_ASN1_introduced then + begin + {$if declared(FC_SSL_use_certificate_ASN1)} + SSL_use_certificate_ASN1 := @FC_SSL_use_certificate_ASN1; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_use_certificate_ASN1_removed)} + if SSL_use_certificate_ASN1_removed <= LibVersion then + begin + {$if declared(_SSL_use_certificate_ASN1)} + SSL_use_certificate_ASN1 := @_SSL_use_certificate_ASN1; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_use_certificate_ASN1_allownil)} + if FuncLoadError then + AFailed.Add('SSL_use_certificate_ASN1'); + {$ifend} + end; + + + SSL_CTX_use_serverinfo := LoadLibFunction(ADllHandle, SSL_CTX_use_serverinfo_procname); + FuncLoadError := not assigned(SSL_CTX_use_serverinfo); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_use_serverinfo_allownil)} + SSL_CTX_use_serverinfo := @ERR_SSL_CTX_use_serverinfo; + {$ifend} + {$if declared(SSL_CTX_use_serverinfo_introduced)} + if LibVersion < SSL_CTX_use_serverinfo_introduced then + begin + {$if declared(FC_SSL_CTX_use_serverinfo)} + SSL_CTX_use_serverinfo := @FC_SSL_CTX_use_serverinfo; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_use_serverinfo_removed)} + if SSL_CTX_use_serverinfo_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_use_serverinfo)} + SSL_CTX_use_serverinfo := @_SSL_CTX_use_serverinfo; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_use_serverinfo_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_use_serverinfo'); + {$ifend} + end; + + + SSL_CTX_use_serverinfo_ex := LoadLibFunction(ADllHandle, SSL_CTX_use_serverinfo_ex_procname); + FuncLoadError := not assigned(SSL_CTX_use_serverinfo_ex); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_use_serverinfo_ex_allownil)} + SSL_CTX_use_serverinfo_ex := @ERR_SSL_CTX_use_serverinfo_ex; + {$ifend} + {$if declared(SSL_CTX_use_serverinfo_ex_introduced)} + if LibVersion < SSL_CTX_use_serverinfo_ex_introduced then + begin + {$if declared(FC_SSL_CTX_use_serverinfo_ex)} + SSL_CTX_use_serverinfo_ex := @FC_SSL_CTX_use_serverinfo_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_use_serverinfo_ex_removed)} + if SSL_CTX_use_serverinfo_ex_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_use_serverinfo_ex)} + SSL_CTX_use_serverinfo_ex := @_SSL_CTX_use_serverinfo_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_use_serverinfo_ex_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_use_serverinfo_ex'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_CTX_use_serverinfo_file := LoadLibFunction(ADllHandle, SSL_CTX_use_serverinfo_file_procname); + FuncLoadError := not assigned(SSL_CTX_use_serverinfo_file); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_use_serverinfo_file_allownil)} + SSL_CTX_use_serverinfo_file := @ERR_SSL_CTX_use_serverinfo_file; + {$ifend} + {$if declared(SSL_CTX_use_serverinfo_file_introduced)} + if LibVersion < SSL_CTX_use_serverinfo_file_introduced then + begin + {$if declared(FC_SSL_CTX_use_serverinfo_file)} + SSL_CTX_use_serverinfo_file := @FC_SSL_CTX_use_serverinfo_file; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_use_serverinfo_file_removed)} + if SSL_CTX_use_serverinfo_file_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_use_serverinfo_file)} + SSL_CTX_use_serverinfo_file := @_SSL_CTX_use_serverinfo_file; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_use_serverinfo_file_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_use_serverinfo_file'); + {$ifend} + end; + + + SSL_use_RSAPrivateKey_file := LoadLibFunction(ADllHandle, SSL_use_RSAPrivateKey_file_procname); + FuncLoadError := not assigned(SSL_use_RSAPrivateKey_file); + if FuncLoadError then + begin + {$if not defined(SSL_use_RSAPrivateKey_file_allownil)} + SSL_use_RSAPrivateKey_file := @ERR_SSL_use_RSAPrivateKey_file; + {$ifend} + {$if declared(SSL_use_RSAPrivateKey_file_introduced)} + if LibVersion < SSL_use_RSAPrivateKey_file_introduced then + begin + {$if declared(FC_SSL_use_RSAPrivateKey_file)} + SSL_use_RSAPrivateKey_file := @FC_SSL_use_RSAPrivateKey_file; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_use_RSAPrivateKey_file_removed)} + if SSL_use_RSAPrivateKey_file_removed <= LibVersion then + begin + {$if declared(_SSL_use_RSAPrivateKey_file)} + SSL_use_RSAPrivateKey_file := @_SSL_use_RSAPrivateKey_file; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_use_RSAPrivateKey_file_allownil)} + if FuncLoadError then + AFailed.Add('SSL_use_RSAPrivateKey_file'); + {$ifend} + end; + + + SSL_use_PrivateKey_file := LoadLibFunction(ADllHandle, SSL_use_PrivateKey_file_procname); + FuncLoadError := not assigned(SSL_use_PrivateKey_file); + if FuncLoadError then + begin + {$if not defined(SSL_use_PrivateKey_file_allownil)} + SSL_use_PrivateKey_file := @ERR_SSL_use_PrivateKey_file; + {$ifend} + {$if declared(SSL_use_PrivateKey_file_introduced)} + if LibVersion < SSL_use_PrivateKey_file_introduced then + begin + {$if declared(FC_SSL_use_PrivateKey_file)} + SSL_use_PrivateKey_file := @FC_SSL_use_PrivateKey_file; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_use_PrivateKey_file_removed)} + if SSL_use_PrivateKey_file_removed <= LibVersion then + begin + {$if declared(_SSL_use_PrivateKey_file)} + SSL_use_PrivateKey_file := @_SSL_use_PrivateKey_file; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_use_PrivateKey_file_allownil)} + if FuncLoadError then + AFailed.Add('SSL_use_PrivateKey_file'); + {$ifend} + end; + + + SSL_use_certificate_file := LoadLibFunction(ADllHandle, SSL_use_certificate_file_procname); + FuncLoadError := not assigned(SSL_use_certificate_file); + if FuncLoadError then + begin + {$if not defined(SSL_use_certificate_file_allownil)} + SSL_use_certificate_file := @ERR_SSL_use_certificate_file; + {$ifend} + {$if declared(SSL_use_certificate_file_introduced)} + if LibVersion < SSL_use_certificate_file_introduced then + begin + {$if declared(FC_SSL_use_certificate_file)} + SSL_use_certificate_file := @FC_SSL_use_certificate_file; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_use_certificate_file_removed)} + if SSL_use_certificate_file_removed <= LibVersion then + begin + {$if declared(_SSL_use_certificate_file)} + SSL_use_certificate_file := @_SSL_use_certificate_file; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_use_certificate_file_allownil)} + if FuncLoadError then + AFailed.Add('SSL_use_certificate_file'); + {$ifend} + end; + + + SSL_CTX_use_RSAPrivateKey_file := LoadLibFunction(ADllHandle, SSL_CTX_use_RSAPrivateKey_file_procname); + FuncLoadError := not assigned(SSL_CTX_use_RSAPrivateKey_file); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_use_RSAPrivateKey_file_allownil)} + SSL_CTX_use_RSAPrivateKey_file := @ERR_SSL_CTX_use_RSAPrivateKey_file; + {$ifend} + {$if declared(SSL_CTX_use_RSAPrivateKey_file_introduced)} + if LibVersion < SSL_CTX_use_RSAPrivateKey_file_introduced then + begin + {$if declared(FC_SSL_CTX_use_RSAPrivateKey_file)} + SSL_CTX_use_RSAPrivateKey_file := @FC_SSL_CTX_use_RSAPrivateKey_file; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_use_RSAPrivateKey_file_removed)} + if SSL_CTX_use_RSAPrivateKey_file_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_use_RSAPrivateKey_file)} + SSL_CTX_use_RSAPrivateKey_file := @_SSL_CTX_use_RSAPrivateKey_file; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_use_RSAPrivateKey_file_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_use_RSAPrivateKey_file'); + {$ifend} + end; + + + SSL_CTX_use_PrivateKey_file := LoadLibFunction(ADllHandle, SSL_CTX_use_PrivateKey_file_procname); + FuncLoadError := not assigned(SSL_CTX_use_PrivateKey_file); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_use_PrivateKey_file_allownil)} + SSL_CTX_use_PrivateKey_file := @ERR_SSL_CTX_use_PrivateKey_file; + {$ifend} + {$if declared(SSL_CTX_use_PrivateKey_file_introduced)} + if LibVersion < SSL_CTX_use_PrivateKey_file_introduced then + begin + {$if declared(FC_SSL_CTX_use_PrivateKey_file)} + SSL_CTX_use_PrivateKey_file := @FC_SSL_CTX_use_PrivateKey_file; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_use_PrivateKey_file_removed)} + if SSL_CTX_use_PrivateKey_file_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_use_PrivateKey_file)} + SSL_CTX_use_PrivateKey_file := @_SSL_CTX_use_PrivateKey_file; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_use_PrivateKey_file_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_use_PrivateKey_file'); + {$ifend} + end; + + + SSL_CTX_use_certificate_file := LoadLibFunction(ADllHandle, SSL_CTX_use_certificate_file_procname); + FuncLoadError := not assigned(SSL_CTX_use_certificate_file); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_use_certificate_file_allownil)} + SSL_CTX_use_certificate_file := @ERR_SSL_CTX_use_certificate_file; + {$ifend} + {$if declared(SSL_CTX_use_certificate_file_introduced)} + if LibVersion < SSL_CTX_use_certificate_file_introduced then + begin + {$if declared(FC_SSL_CTX_use_certificate_file)} + SSL_CTX_use_certificate_file := @FC_SSL_CTX_use_certificate_file; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_use_certificate_file_removed)} + if SSL_CTX_use_certificate_file_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_use_certificate_file)} + SSL_CTX_use_certificate_file := @_SSL_CTX_use_certificate_file; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_use_certificate_file_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_use_certificate_file'); + {$ifend} + end; + + + SSL_CTX_use_certificate_chain_file := LoadLibFunction(ADllHandle, SSL_CTX_use_certificate_chain_file_procname); + FuncLoadError := not assigned(SSL_CTX_use_certificate_chain_file); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_use_certificate_chain_file_allownil)} + SSL_CTX_use_certificate_chain_file := @ERR_SSL_CTX_use_certificate_chain_file; + {$ifend} + {$if declared(SSL_CTX_use_certificate_chain_file_introduced)} + if LibVersion < SSL_CTX_use_certificate_chain_file_introduced then + begin + {$if declared(FC_SSL_CTX_use_certificate_chain_file)} + SSL_CTX_use_certificate_chain_file := @FC_SSL_CTX_use_certificate_chain_file; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_use_certificate_chain_file_removed)} + if SSL_CTX_use_certificate_chain_file_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_use_certificate_chain_file)} + SSL_CTX_use_certificate_chain_file := @_SSL_CTX_use_certificate_chain_file; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_use_certificate_chain_file_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_use_certificate_chain_file'); + {$ifend} + end; + + + SSL_use_certificate_chain_file := LoadLibFunction(ADllHandle, SSL_use_certificate_chain_file_procname); + FuncLoadError := not assigned(SSL_use_certificate_chain_file); + if FuncLoadError then + begin + {$if not defined(SSL_use_certificate_chain_file_allownil)} + SSL_use_certificate_chain_file := @ERR_SSL_use_certificate_chain_file; + {$ifend} + {$if declared(SSL_use_certificate_chain_file_introduced)} + if LibVersion < SSL_use_certificate_chain_file_introduced then + begin + {$if declared(FC_SSL_use_certificate_chain_file)} + SSL_use_certificate_chain_file := @FC_SSL_use_certificate_chain_file; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_use_certificate_chain_file_removed)} + if SSL_use_certificate_chain_file_removed <= LibVersion then + begin + {$if declared(_SSL_use_certificate_chain_file)} + SSL_use_certificate_chain_file := @_SSL_use_certificate_chain_file; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_use_certificate_chain_file_allownil)} + if FuncLoadError then + AFailed.Add('SSL_use_certificate_chain_file'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_load_client_CA_file := LoadLibFunction(ADllHandle, SSL_load_client_CA_file_procname); + FuncLoadError := not assigned(SSL_load_client_CA_file); + if FuncLoadError then + begin + {$if not defined(SSL_load_client_CA_file_allownil)} + SSL_load_client_CA_file := @ERR_SSL_load_client_CA_file; + {$ifend} + {$if declared(SSL_load_client_CA_file_introduced)} + if LibVersion < SSL_load_client_CA_file_introduced then + begin + {$if declared(FC_SSL_load_client_CA_file)} + SSL_load_client_CA_file := @FC_SSL_load_client_CA_file; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_load_client_CA_file_removed)} + if SSL_load_client_CA_file_removed <= LibVersion then + begin + {$if declared(_SSL_load_client_CA_file)} + SSL_load_client_CA_file := @_SSL_load_client_CA_file; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_load_client_CA_file_allownil)} + if FuncLoadError then + AFailed.Add('SSL_load_client_CA_file'); + {$ifend} + end; + + + SSL_add_file_cert_subjects_to_stack := LoadLibFunction(ADllHandle, SSL_add_file_cert_subjects_to_stack_procname); + FuncLoadError := not assigned(SSL_add_file_cert_subjects_to_stack); + if FuncLoadError then + begin + {$if not defined(SSL_add_file_cert_subjects_to_stack_allownil)} + SSL_add_file_cert_subjects_to_stack := @ERR_SSL_add_file_cert_subjects_to_stack; + {$ifend} + {$if declared(SSL_add_file_cert_subjects_to_stack_introduced)} + if LibVersion < SSL_add_file_cert_subjects_to_stack_introduced then + begin + {$if declared(FC_SSL_add_file_cert_subjects_to_stack)} + SSL_add_file_cert_subjects_to_stack := @FC_SSL_add_file_cert_subjects_to_stack; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_add_file_cert_subjects_to_stack_removed)} + if SSL_add_file_cert_subjects_to_stack_removed <= LibVersion then + begin + {$if declared(_SSL_add_file_cert_subjects_to_stack)} + SSL_add_file_cert_subjects_to_stack := @_SSL_add_file_cert_subjects_to_stack; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_add_file_cert_subjects_to_stack_allownil)} + if FuncLoadError then + AFailed.Add('SSL_add_file_cert_subjects_to_stack'); + {$ifend} + end; + + + SSL_add_dir_cert_subjects_to_stack := LoadLibFunction(ADllHandle, SSL_add_dir_cert_subjects_to_stack_procname); + FuncLoadError := not assigned(SSL_add_dir_cert_subjects_to_stack); + if FuncLoadError then + begin + {$if not defined(SSL_add_dir_cert_subjects_to_stack_allownil)} + SSL_add_dir_cert_subjects_to_stack := @ERR_SSL_add_dir_cert_subjects_to_stack; + {$ifend} + {$if declared(SSL_add_dir_cert_subjects_to_stack_introduced)} + if LibVersion < SSL_add_dir_cert_subjects_to_stack_introduced then + begin + {$if declared(FC_SSL_add_dir_cert_subjects_to_stack)} + SSL_add_dir_cert_subjects_to_stack := @FC_SSL_add_dir_cert_subjects_to_stack; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_add_dir_cert_subjects_to_stack_removed)} + if SSL_add_dir_cert_subjects_to_stack_removed <= LibVersion then + begin + {$if declared(_SSL_add_dir_cert_subjects_to_stack)} + SSL_add_dir_cert_subjects_to_stack := @_SSL_add_dir_cert_subjects_to_stack; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_add_dir_cert_subjects_to_stack_allownil)} + if FuncLoadError then + AFailed.Add('SSL_add_dir_cert_subjects_to_stack'); + {$ifend} + end; + + + SSL_load_error_strings := LoadLibFunction(ADllHandle, SSL_load_error_strings_procname); + FuncLoadError := not assigned(SSL_load_error_strings); + if FuncLoadError then + begin + {$if not defined(SSL_load_error_strings_allownil)} + SSL_load_error_strings := @ERR_SSL_load_error_strings; + {$ifend} + {$if declared(SSL_load_error_strings_introduced)} + if LibVersion < SSL_load_error_strings_introduced then + begin + {$if declared(FC_SSL_load_error_strings)} + SSL_load_error_strings := @FC_SSL_load_error_strings; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_load_error_strings_removed)} + if SSL_load_error_strings_removed <= LibVersion then + begin + {$if declared(_SSL_load_error_strings)} + SSL_load_error_strings := @_SSL_load_error_strings; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_load_error_strings_allownil)} + if FuncLoadError then + AFailed.Add('SSL_load_error_strings'); + {$ifend} + end; + + + SSL_state_string := LoadLibFunction(ADllHandle, SSL_state_string_procname); + FuncLoadError := not assigned(SSL_state_string); + if FuncLoadError then + begin + {$if not defined(SSL_state_string_allownil)} + SSL_state_string := @ERR_SSL_state_string; + {$ifend} + {$if declared(SSL_state_string_introduced)} + if LibVersion < SSL_state_string_introduced then + begin + {$if declared(FC_SSL_state_string)} + SSL_state_string := @FC_SSL_state_string; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_state_string_removed)} + if SSL_state_string_removed <= LibVersion then + begin + {$if declared(_SSL_state_string)} + SSL_state_string := @_SSL_state_string; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_state_string_allownil)} + if FuncLoadError then + AFailed.Add('SSL_state_string'); + {$ifend} + end; + + + SSL_rstate_string := LoadLibFunction(ADllHandle, SSL_rstate_string_procname); + FuncLoadError := not assigned(SSL_rstate_string); + if FuncLoadError then + begin + {$if not defined(SSL_rstate_string_allownil)} + SSL_rstate_string := @ERR_SSL_rstate_string; + {$ifend} + {$if declared(SSL_rstate_string_introduced)} + if LibVersion < SSL_rstate_string_introduced then + begin + {$if declared(FC_SSL_rstate_string)} + SSL_rstate_string := @FC_SSL_rstate_string; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_rstate_string_removed)} + if SSL_rstate_string_removed <= LibVersion then + begin + {$if declared(_SSL_rstate_string)} + SSL_rstate_string := @_SSL_rstate_string; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_rstate_string_allownil)} + if FuncLoadError then + AFailed.Add('SSL_rstate_string'); + {$ifend} + end; + + + SSL_state_string_long := LoadLibFunction(ADllHandle, SSL_state_string_long_procname); + FuncLoadError := not assigned(SSL_state_string_long); + if FuncLoadError then + begin + {$if not defined(SSL_state_string_long_allownil)} + SSL_state_string_long := @ERR_SSL_state_string_long; + {$ifend} + {$if declared(SSL_state_string_long_introduced)} + if LibVersion < SSL_state_string_long_introduced then + begin + {$if declared(FC_SSL_state_string_long)} + SSL_state_string_long := @FC_SSL_state_string_long; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_state_string_long_removed)} + if SSL_state_string_long_removed <= LibVersion then + begin + {$if declared(_SSL_state_string_long)} + SSL_state_string_long := @_SSL_state_string_long; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_state_string_long_allownil)} + if FuncLoadError then + AFailed.Add('SSL_state_string_long'); + {$ifend} + end; + + + SSL_rstate_string_long := LoadLibFunction(ADllHandle, SSL_rstate_string_long_procname); + FuncLoadError := not assigned(SSL_rstate_string_long); + if FuncLoadError then + begin + {$if not defined(SSL_rstate_string_long_allownil)} + SSL_rstate_string_long := @ERR_SSL_rstate_string_long; + {$ifend} + {$if declared(SSL_rstate_string_long_introduced)} + if LibVersion < SSL_rstate_string_long_introduced then + begin + {$if declared(FC_SSL_rstate_string_long)} + SSL_rstate_string_long := @FC_SSL_rstate_string_long; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_rstate_string_long_removed)} + if SSL_rstate_string_long_removed <= LibVersion then + begin + {$if declared(_SSL_rstate_string_long)} + SSL_rstate_string_long := @_SSL_rstate_string_long; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_rstate_string_long_allownil)} + if FuncLoadError then + AFailed.Add('SSL_rstate_string_long'); + {$ifend} + end; + + + SSL_SESSION_get_time := LoadLibFunction(ADllHandle, SSL_SESSION_get_time_procname); + FuncLoadError := not assigned(SSL_SESSION_get_time); + if FuncLoadError then + begin + {$if not defined(SSL_SESSION_get_time_allownil)} + SSL_SESSION_get_time := @ERR_SSL_SESSION_get_time; + {$ifend} + {$if declared(SSL_SESSION_get_time_introduced)} + if LibVersion < SSL_SESSION_get_time_introduced then + begin + {$if declared(FC_SSL_SESSION_get_time)} + SSL_SESSION_get_time := @FC_SSL_SESSION_get_time; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_SESSION_get_time_removed)} + if SSL_SESSION_get_time_removed <= LibVersion then + begin + {$if declared(_SSL_SESSION_get_time)} + SSL_SESSION_get_time := @_SSL_SESSION_get_time; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_SESSION_get_time_allownil)} + if FuncLoadError then + AFailed.Add('SSL_SESSION_get_time'); + {$ifend} + end; + + + SSL_SESSION_set_time := LoadLibFunction(ADllHandle, SSL_SESSION_set_time_procname); + FuncLoadError := not assigned(SSL_SESSION_set_time); + if FuncLoadError then + begin + {$if not defined(SSL_SESSION_set_time_allownil)} + SSL_SESSION_set_time := @ERR_SSL_SESSION_set_time; + {$ifend} + {$if declared(SSL_SESSION_set_time_introduced)} + if LibVersion < SSL_SESSION_set_time_introduced then + begin + {$if declared(FC_SSL_SESSION_set_time)} + SSL_SESSION_set_time := @FC_SSL_SESSION_set_time; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_SESSION_set_time_removed)} + if SSL_SESSION_set_time_removed <= LibVersion then + begin + {$if declared(_SSL_SESSION_set_time)} + SSL_SESSION_set_time := @_SSL_SESSION_set_time; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_SESSION_set_time_allownil)} + if FuncLoadError then + AFailed.Add('SSL_SESSION_set_time'); + {$ifend} + end; + + + SSL_SESSION_get_timeout := LoadLibFunction(ADllHandle, SSL_SESSION_get_timeout_procname); + FuncLoadError := not assigned(SSL_SESSION_get_timeout); + if FuncLoadError then + begin + {$if not defined(SSL_SESSION_get_timeout_allownil)} + SSL_SESSION_get_timeout := @ERR_SSL_SESSION_get_timeout; + {$ifend} + {$if declared(SSL_SESSION_get_timeout_introduced)} + if LibVersion < SSL_SESSION_get_timeout_introduced then + begin + {$if declared(FC_SSL_SESSION_get_timeout)} + SSL_SESSION_get_timeout := @FC_SSL_SESSION_get_timeout; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_SESSION_get_timeout_removed)} + if SSL_SESSION_get_timeout_removed <= LibVersion then + begin + {$if declared(_SSL_SESSION_get_timeout)} + SSL_SESSION_get_timeout := @_SSL_SESSION_get_timeout; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_SESSION_get_timeout_allownil)} + if FuncLoadError then + AFailed.Add('SSL_SESSION_get_timeout'); + {$ifend} + end; + + + SSL_SESSION_set_timeout := LoadLibFunction(ADllHandle, SSL_SESSION_set_timeout_procname); + FuncLoadError := not assigned(SSL_SESSION_set_timeout); + if FuncLoadError then + begin + {$if not defined(SSL_SESSION_set_timeout_allownil)} + SSL_SESSION_set_timeout := @ERR_SSL_SESSION_set_timeout; + {$ifend} + {$if declared(SSL_SESSION_set_timeout_introduced)} + if LibVersion < SSL_SESSION_set_timeout_introduced then + begin + {$if declared(FC_SSL_SESSION_set_timeout)} + SSL_SESSION_set_timeout := @FC_SSL_SESSION_set_timeout; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_SESSION_set_timeout_removed)} + if SSL_SESSION_set_timeout_removed <= LibVersion then + begin + {$if declared(_SSL_SESSION_set_timeout)} + SSL_SESSION_set_timeout := @_SSL_SESSION_set_timeout; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_SESSION_set_timeout_allownil)} + if FuncLoadError then + AFailed.Add('SSL_SESSION_set_timeout'); + {$ifend} + end; + + + SSL_SESSION_get_protocol_version := LoadLibFunction(ADllHandle, SSL_SESSION_get_protocol_version_procname); + FuncLoadError := not assigned(SSL_SESSION_get_protocol_version); + if FuncLoadError then + begin + {$if not defined(SSL_SESSION_get_protocol_version_allownil)} + SSL_SESSION_get_protocol_version := @ERR_SSL_SESSION_get_protocol_version; + {$ifend} + {$if declared(SSL_SESSION_get_protocol_version_introduced)} + if LibVersion < SSL_SESSION_get_protocol_version_introduced then + begin + {$if declared(FC_SSL_SESSION_get_protocol_version)} + SSL_SESSION_get_protocol_version := @FC_SSL_SESSION_get_protocol_version; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_SESSION_get_protocol_version_removed)} + if SSL_SESSION_get_protocol_version_removed <= LibVersion then + begin + {$if declared(_SSL_SESSION_get_protocol_version)} + SSL_SESSION_get_protocol_version := @_SSL_SESSION_get_protocol_version; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_SESSION_get_protocol_version_allownil)} + if FuncLoadError then + AFailed.Add('SSL_SESSION_get_protocol_version'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_SESSION_set_protocol_version := LoadLibFunction(ADllHandle, SSL_SESSION_set_protocol_version_procname); + FuncLoadError := not assigned(SSL_SESSION_set_protocol_version); + if FuncLoadError then + begin + {$if not defined(SSL_SESSION_set_protocol_version_allownil)} + SSL_SESSION_set_protocol_version := @ERR_SSL_SESSION_set_protocol_version; + {$ifend} + {$if declared(SSL_SESSION_set_protocol_version_introduced)} + if LibVersion < SSL_SESSION_set_protocol_version_introduced then + begin + {$if declared(FC_SSL_SESSION_set_protocol_version)} + SSL_SESSION_set_protocol_version := @FC_SSL_SESSION_set_protocol_version; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_SESSION_set_protocol_version_removed)} + if SSL_SESSION_set_protocol_version_removed <= LibVersion then + begin + {$if declared(_SSL_SESSION_set_protocol_version)} + SSL_SESSION_set_protocol_version := @_SSL_SESSION_set_protocol_version; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_SESSION_set_protocol_version_allownil)} + if FuncLoadError then + AFailed.Add('SSL_SESSION_set_protocol_version'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_SESSION_get0_hostname := LoadLibFunction(ADllHandle, SSL_SESSION_get0_hostname_procname); + FuncLoadError := not assigned(SSL_SESSION_get0_hostname); + if FuncLoadError then + begin + {$if not defined(SSL_SESSION_get0_hostname_allownil)} + SSL_SESSION_get0_hostname := @ERR_SSL_SESSION_get0_hostname; + {$ifend} + {$if declared(SSL_SESSION_get0_hostname_introduced)} + if LibVersion < SSL_SESSION_get0_hostname_introduced then + begin + {$if declared(FC_SSL_SESSION_get0_hostname)} + SSL_SESSION_get0_hostname := @FC_SSL_SESSION_get0_hostname; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_SESSION_get0_hostname_removed)} + if SSL_SESSION_get0_hostname_removed <= LibVersion then + begin + {$if declared(_SSL_SESSION_get0_hostname)} + SSL_SESSION_get0_hostname := @_SSL_SESSION_get0_hostname; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_SESSION_get0_hostname_allownil)} + if FuncLoadError then + AFailed.Add('SSL_SESSION_get0_hostname'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_SESSION_set1_hostname := LoadLibFunction(ADllHandle, SSL_SESSION_set1_hostname_procname); + FuncLoadError := not assigned(SSL_SESSION_set1_hostname); + if FuncLoadError then + begin + {$if not defined(SSL_SESSION_set1_hostname_allownil)} + SSL_SESSION_set1_hostname := @ERR_SSL_SESSION_set1_hostname; + {$ifend} + {$if declared(SSL_SESSION_set1_hostname_introduced)} + if LibVersion < SSL_SESSION_set1_hostname_introduced then + begin + {$if declared(FC_SSL_SESSION_set1_hostname)} + SSL_SESSION_set1_hostname := @FC_SSL_SESSION_set1_hostname; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_SESSION_set1_hostname_removed)} + if SSL_SESSION_set1_hostname_removed <= LibVersion then + begin + {$if declared(_SSL_SESSION_set1_hostname)} + SSL_SESSION_set1_hostname := @_SSL_SESSION_set1_hostname; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_SESSION_set1_hostname_allownil)} + if FuncLoadError then + AFailed.Add('SSL_SESSION_set1_hostname'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_SESSION_get0_alpn_selected := LoadLibFunction(ADllHandle, SSL_SESSION_get0_alpn_selected_procname); + FuncLoadError := not assigned(SSL_SESSION_get0_alpn_selected); + if FuncLoadError then + begin + {$if not defined(SSL_SESSION_get0_alpn_selected_allownil)} + SSL_SESSION_get0_alpn_selected := @ERR_SSL_SESSION_get0_alpn_selected; + {$ifend} + {$if declared(SSL_SESSION_get0_alpn_selected_introduced)} + if LibVersion < SSL_SESSION_get0_alpn_selected_introduced then + begin + {$if declared(FC_SSL_SESSION_get0_alpn_selected)} + SSL_SESSION_get0_alpn_selected := @FC_SSL_SESSION_get0_alpn_selected; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_SESSION_get0_alpn_selected_removed)} + if SSL_SESSION_get0_alpn_selected_removed <= LibVersion then + begin + {$if declared(_SSL_SESSION_get0_alpn_selected)} + SSL_SESSION_get0_alpn_selected := @_SSL_SESSION_get0_alpn_selected; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_SESSION_get0_alpn_selected_allownil)} + if FuncLoadError then + AFailed.Add('SSL_SESSION_get0_alpn_selected'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_SESSION_set1_alpn_selected := LoadLibFunction(ADllHandle, SSL_SESSION_set1_alpn_selected_procname); + FuncLoadError := not assigned(SSL_SESSION_set1_alpn_selected); + if FuncLoadError then + begin + {$if not defined(SSL_SESSION_set1_alpn_selected_allownil)} + SSL_SESSION_set1_alpn_selected := @ERR_SSL_SESSION_set1_alpn_selected; + {$ifend} + {$if declared(SSL_SESSION_set1_alpn_selected_introduced)} + if LibVersion < SSL_SESSION_set1_alpn_selected_introduced then + begin + {$if declared(FC_SSL_SESSION_set1_alpn_selected)} + SSL_SESSION_set1_alpn_selected := @FC_SSL_SESSION_set1_alpn_selected; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_SESSION_set1_alpn_selected_removed)} + if SSL_SESSION_set1_alpn_selected_removed <= LibVersion then + begin + {$if declared(_SSL_SESSION_set1_alpn_selected)} + SSL_SESSION_set1_alpn_selected := @_SSL_SESSION_set1_alpn_selected; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_SESSION_set1_alpn_selected_allownil)} + if FuncLoadError then + AFailed.Add('SSL_SESSION_set1_alpn_selected'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_SESSION_get0_cipher := LoadLibFunction(ADllHandle, SSL_SESSION_get0_cipher_procname); + FuncLoadError := not assigned(SSL_SESSION_get0_cipher); + if FuncLoadError then + begin + {$if not defined(SSL_SESSION_get0_cipher_allownil)} + SSL_SESSION_get0_cipher := @ERR_SSL_SESSION_get0_cipher; + {$ifend} + {$if declared(SSL_SESSION_get0_cipher_introduced)} + if LibVersion < SSL_SESSION_get0_cipher_introduced then + begin + {$if declared(FC_SSL_SESSION_get0_cipher)} + SSL_SESSION_get0_cipher := @FC_SSL_SESSION_get0_cipher; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_SESSION_get0_cipher_removed)} + if SSL_SESSION_get0_cipher_removed <= LibVersion then + begin + {$if declared(_SSL_SESSION_get0_cipher)} + SSL_SESSION_get0_cipher := @_SSL_SESSION_get0_cipher; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_SESSION_get0_cipher_allownil)} + if FuncLoadError then + AFailed.Add('SSL_SESSION_get0_cipher'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_SESSION_set_cipher := LoadLibFunction(ADllHandle, SSL_SESSION_set_cipher_procname); + FuncLoadError := not assigned(SSL_SESSION_set_cipher); + if FuncLoadError then + begin + {$if not defined(SSL_SESSION_set_cipher_allownil)} + SSL_SESSION_set_cipher := @ERR_SSL_SESSION_set_cipher; + {$ifend} + {$if declared(SSL_SESSION_set_cipher_introduced)} + if LibVersion < SSL_SESSION_set_cipher_introduced then + begin + {$if declared(FC_SSL_SESSION_set_cipher)} + SSL_SESSION_set_cipher := @FC_SSL_SESSION_set_cipher; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_SESSION_set_cipher_removed)} + if SSL_SESSION_set_cipher_removed <= LibVersion then + begin + {$if declared(_SSL_SESSION_set_cipher)} + SSL_SESSION_set_cipher := @_SSL_SESSION_set_cipher; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_SESSION_set_cipher_allownil)} + if FuncLoadError then + AFailed.Add('SSL_SESSION_set_cipher'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_SESSION_has_ticket := LoadLibFunction(ADllHandle, SSL_SESSION_has_ticket_procname); + FuncLoadError := not assigned(SSL_SESSION_has_ticket); + if FuncLoadError then + begin + {$if not defined(SSL_SESSION_has_ticket_allownil)} + SSL_SESSION_has_ticket := @ERR_SSL_SESSION_has_ticket; + {$ifend} + {$if declared(SSL_SESSION_has_ticket_introduced)} + if LibVersion < SSL_SESSION_has_ticket_introduced then + begin + {$if declared(FC_SSL_SESSION_has_ticket)} + SSL_SESSION_has_ticket := @FC_SSL_SESSION_has_ticket; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_SESSION_has_ticket_removed)} + if SSL_SESSION_has_ticket_removed <= LibVersion then + begin + {$if declared(_SSL_SESSION_has_ticket)} + SSL_SESSION_has_ticket := @_SSL_SESSION_has_ticket; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_SESSION_has_ticket_allownil)} + if FuncLoadError then + AFailed.Add('SSL_SESSION_has_ticket'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_SESSION_get_ticket_lifetime_hint := LoadLibFunction(ADllHandle, SSL_SESSION_get_ticket_lifetime_hint_procname); + FuncLoadError := not assigned(SSL_SESSION_get_ticket_lifetime_hint); + if FuncLoadError then + begin + {$if not defined(SSL_SESSION_get_ticket_lifetime_hint_allownil)} + SSL_SESSION_get_ticket_lifetime_hint := @ERR_SSL_SESSION_get_ticket_lifetime_hint; + {$ifend} + {$if declared(SSL_SESSION_get_ticket_lifetime_hint_introduced)} + if LibVersion < SSL_SESSION_get_ticket_lifetime_hint_introduced then + begin + {$if declared(FC_SSL_SESSION_get_ticket_lifetime_hint)} + SSL_SESSION_get_ticket_lifetime_hint := @FC_SSL_SESSION_get_ticket_lifetime_hint; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_SESSION_get_ticket_lifetime_hint_removed)} + if SSL_SESSION_get_ticket_lifetime_hint_removed <= LibVersion then + begin + {$if declared(_SSL_SESSION_get_ticket_lifetime_hint)} + SSL_SESSION_get_ticket_lifetime_hint := @_SSL_SESSION_get_ticket_lifetime_hint; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_SESSION_get_ticket_lifetime_hint_allownil)} + if FuncLoadError then + AFailed.Add('SSL_SESSION_get_ticket_lifetime_hint'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_SESSION_get0_ticket := LoadLibFunction(ADllHandle, SSL_SESSION_get0_ticket_procname); + FuncLoadError := not assigned(SSL_SESSION_get0_ticket); + if FuncLoadError then + begin + {$if not defined(SSL_SESSION_get0_ticket_allownil)} + SSL_SESSION_get0_ticket := @ERR_SSL_SESSION_get0_ticket; + {$ifend} + {$if declared(SSL_SESSION_get0_ticket_introduced)} + if LibVersion < SSL_SESSION_get0_ticket_introduced then + begin + {$if declared(FC_SSL_SESSION_get0_ticket)} + SSL_SESSION_get0_ticket := @FC_SSL_SESSION_get0_ticket; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_SESSION_get0_ticket_removed)} + if SSL_SESSION_get0_ticket_removed <= LibVersion then + begin + {$if declared(_SSL_SESSION_get0_ticket)} + SSL_SESSION_get0_ticket := @_SSL_SESSION_get0_ticket; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_SESSION_get0_ticket_allownil)} + if FuncLoadError then + AFailed.Add('SSL_SESSION_get0_ticket'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_SESSION_get_max_early_data := LoadLibFunction(ADllHandle, SSL_SESSION_get_max_early_data_procname); + FuncLoadError := not assigned(SSL_SESSION_get_max_early_data); + if FuncLoadError then + begin + {$if not defined(SSL_SESSION_get_max_early_data_allownil)} + SSL_SESSION_get_max_early_data := @ERR_SSL_SESSION_get_max_early_data; + {$ifend} + {$if declared(SSL_SESSION_get_max_early_data_introduced)} + if LibVersion < SSL_SESSION_get_max_early_data_introduced then + begin + {$if declared(FC_SSL_SESSION_get_max_early_data)} + SSL_SESSION_get_max_early_data := @FC_SSL_SESSION_get_max_early_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_SESSION_get_max_early_data_removed)} + if SSL_SESSION_get_max_early_data_removed <= LibVersion then + begin + {$if declared(_SSL_SESSION_get_max_early_data)} + SSL_SESSION_get_max_early_data := @_SSL_SESSION_get_max_early_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_SESSION_get_max_early_data_allownil)} + if FuncLoadError then + AFailed.Add('SSL_SESSION_get_max_early_data'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_SESSION_set_max_early_data := LoadLibFunction(ADllHandle, SSL_SESSION_set_max_early_data_procname); + FuncLoadError := not assigned(SSL_SESSION_set_max_early_data); + if FuncLoadError then + begin + {$if not defined(SSL_SESSION_set_max_early_data_allownil)} + SSL_SESSION_set_max_early_data := @ERR_SSL_SESSION_set_max_early_data; + {$ifend} + {$if declared(SSL_SESSION_set_max_early_data_introduced)} + if LibVersion < SSL_SESSION_set_max_early_data_introduced then + begin + {$if declared(FC_SSL_SESSION_set_max_early_data)} + SSL_SESSION_set_max_early_data := @FC_SSL_SESSION_set_max_early_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_SESSION_set_max_early_data_removed)} + if SSL_SESSION_set_max_early_data_removed <= LibVersion then + begin + {$if declared(_SSL_SESSION_set_max_early_data)} + SSL_SESSION_set_max_early_data := @_SSL_SESSION_set_max_early_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_SESSION_set_max_early_data_allownil)} + if FuncLoadError then + AFailed.Add('SSL_SESSION_set_max_early_data'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_copy_session_id := LoadLibFunction(ADllHandle, SSL_copy_session_id_procname); + FuncLoadError := not assigned(SSL_copy_session_id); + if FuncLoadError then + begin + {$if not defined(SSL_copy_session_id_allownil)} + SSL_copy_session_id := @ERR_SSL_copy_session_id; + {$ifend} + {$if declared(SSL_copy_session_id_introduced)} + if LibVersion < SSL_copy_session_id_introduced then + begin + {$if declared(FC_SSL_copy_session_id)} + SSL_copy_session_id := @FC_SSL_copy_session_id; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_copy_session_id_removed)} + if SSL_copy_session_id_removed <= LibVersion then + begin + {$if declared(_SSL_copy_session_id)} + SSL_copy_session_id := @_SSL_copy_session_id; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_copy_session_id_allownil)} + if FuncLoadError then + AFailed.Add('SSL_copy_session_id'); + {$ifend} + end; + + + SSL_SESSION_get0_peer := LoadLibFunction(ADllHandle, SSL_SESSION_get0_peer_procname); + FuncLoadError := not assigned(SSL_SESSION_get0_peer); + if FuncLoadError then + begin + {$if not defined(SSL_SESSION_get0_peer_allownil)} + SSL_SESSION_get0_peer := @ERR_SSL_SESSION_get0_peer; + {$ifend} + {$if declared(SSL_SESSION_get0_peer_introduced)} + if LibVersion < SSL_SESSION_get0_peer_introduced then + begin + {$if declared(FC_SSL_SESSION_get0_peer)} + SSL_SESSION_get0_peer := @FC_SSL_SESSION_get0_peer; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_SESSION_get0_peer_removed)} + if SSL_SESSION_get0_peer_removed <= LibVersion then + begin + {$if declared(_SSL_SESSION_get0_peer)} + SSL_SESSION_get0_peer := @_SSL_SESSION_get0_peer; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_SESSION_get0_peer_allownil)} + if FuncLoadError then + AFailed.Add('SSL_SESSION_get0_peer'); + {$ifend} + end; + + + SSL_SESSION_set1_id_context := LoadLibFunction(ADllHandle, SSL_SESSION_set1_id_context_procname); + FuncLoadError := not assigned(SSL_SESSION_set1_id_context); + if FuncLoadError then + begin + {$if not defined(SSL_SESSION_set1_id_context_allownil)} + SSL_SESSION_set1_id_context := @ERR_SSL_SESSION_set1_id_context; + {$ifend} + {$if declared(SSL_SESSION_set1_id_context_introduced)} + if LibVersion < SSL_SESSION_set1_id_context_introduced then + begin + {$if declared(FC_SSL_SESSION_set1_id_context)} + SSL_SESSION_set1_id_context := @FC_SSL_SESSION_set1_id_context; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_SESSION_set1_id_context_removed)} + if SSL_SESSION_set1_id_context_removed <= LibVersion then + begin + {$if declared(_SSL_SESSION_set1_id_context)} + SSL_SESSION_set1_id_context := @_SSL_SESSION_set1_id_context; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_SESSION_set1_id_context_allownil)} + if FuncLoadError then + AFailed.Add('SSL_SESSION_set1_id_context'); + {$ifend} + end; + + + SSL_SESSION_set1_id := LoadLibFunction(ADllHandle, SSL_SESSION_set1_id_procname); + FuncLoadError := not assigned(SSL_SESSION_set1_id); + if FuncLoadError then + begin + {$if not defined(SSL_SESSION_set1_id_allownil)} + SSL_SESSION_set1_id := @ERR_SSL_SESSION_set1_id; + {$ifend} + {$if declared(SSL_SESSION_set1_id_introduced)} + if LibVersion < SSL_SESSION_set1_id_introduced then + begin + {$if declared(FC_SSL_SESSION_set1_id)} + SSL_SESSION_set1_id := @FC_SSL_SESSION_set1_id; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_SESSION_set1_id_removed)} + if SSL_SESSION_set1_id_removed <= LibVersion then + begin + {$if declared(_SSL_SESSION_set1_id)} + SSL_SESSION_set1_id := @_SSL_SESSION_set1_id; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_SESSION_set1_id_allownil)} + if FuncLoadError then + AFailed.Add('SSL_SESSION_set1_id'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_SESSION_is_resumable := LoadLibFunction(ADllHandle, SSL_SESSION_is_resumable_procname); + FuncLoadError := not assigned(SSL_SESSION_is_resumable); + if FuncLoadError then + begin + {$if not defined(SSL_SESSION_is_resumable_allownil)} + SSL_SESSION_is_resumable := @ERR_SSL_SESSION_is_resumable; + {$ifend} + {$if declared(SSL_SESSION_is_resumable_introduced)} + if LibVersion < SSL_SESSION_is_resumable_introduced then + begin + {$if declared(FC_SSL_SESSION_is_resumable)} + SSL_SESSION_is_resumable := @FC_SSL_SESSION_is_resumable; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_SESSION_is_resumable_removed)} + if SSL_SESSION_is_resumable_removed <= LibVersion then + begin + {$if declared(_SSL_SESSION_is_resumable)} + SSL_SESSION_is_resumable := @_SSL_SESSION_is_resumable; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_SESSION_is_resumable_allownil)} + if FuncLoadError then + AFailed.Add('SSL_SESSION_is_resumable'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_SESSION_new := LoadLibFunction(ADllHandle, SSL_SESSION_new_procname); + FuncLoadError := not assigned(SSL_SESSION_new); + if FuncLoadError then + begin + {$if not defined(SSL_SESSION_new_allownil)} + SSL_SESSION_new := @ERR_SSL_SESSION_new; + {$ifend} + {$if declared(SSL_SESSION_new_introduced)} + if LibVersion < SSL_SESSION_new_introduced then + begin + {$if declared(FC_SSL_SESSION_new)} + SSL_SESSION_new := @FC_SSL_SESSION_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_SESSION_new_removed)} + if SSL_SESSION_new_removed <= LibVersion then + begin + {$if declared(_SSL_SESSION_new)} + SSL_SESSION_new := @_SSL_SESSION_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_SESSION_new_allownil)} + if FuncLoadError then + AFailed.Add('SSL_SESSION_new'); + {$ifend} + end; + + + SSL_SESSION_dup := LoadLibFunction(ADllHandle, SSL_SESSION_dup_procname); + FuncLoadError := not assigned(SSL_SESSION_dup); + if FuncLoadError then + begin + {$if not defined(SSL_SESSION_dup_allownil)} + SSL_SESSION_dup := @ERR_SSL_SESSION_dup; + {$ifend} + {$if declared(SSL_SESSION_dup_introduced)} + if LibVersion < SSL_SESSION_dup_introduced then + begin + {$if declared(FC_SSL_SESSION_dup)} + SSL_SESSION_dup := @FC_SSL_SESSION_dup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_SESSION_dup_removed)} + if SSL_SESSION_dup_removed <= LibVersion then + begin + {$if declared(_SSL_SESSION_dup)} + SSL_SESSION_dup := @_SSL_SESSION_dup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_SESSION_dup_allownil)} + if FuncLoadError then + AFailed.Add('SSL_SESSION_dup'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_SESSION_get_id := LoadLibFunction(ADllHandle, SSL_SESSION_get_id_procname); + FuncLoadError := not assigned(SSL_SESSION_get_id); + if FuncLoadError then + begin + {$if not defined(SSL_SESSION_get_id_allownil)} + SSL_SESSION_get_id := @ERR_SSL_SESSION_get_id; + {$ifend} + {$if declared(SSL_SESSION_get_id_introduced)} + if LibVersion < SSL_SESSION_get_id_introduced then + begin + {$if declared(FC_SSL_SESSION_get_id)} + SSL_SESSION_get_id := @FC_SSL_SESSION_get_id; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_SESSION_get_id_removed)} + if SSL_SESSION_get_id_removed <= LibVersion then + begin + {$if declared(_SSL_SESSION_get_id)} + SSL_SESSION_get_id := @_SSL_SESSION_get_id; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_SESSION_get_id_allownil)} + if FuncLoadError then + AFailed.Add('SSL_SESSION_get_id'); + {$ifend} + end; + + + SSL_SESSION_get0_id_context := LoadLibFunction(ADllHandle, SSL_SESSION_get0_id_context_procname); + FuncLoadError := not assigned(SSL_SESSION_get0_id_context); + if FuncLoadError then + begin + {$if not defined(SSL_SESSION_get0_id_context_allownil)} + SSL_SESSION_get0_id_context := @ERR_SSL_SESSION_get0_id_context; + {$ifend} + {$if declared(SSL_SESSION_get0_id_context_introduced)} + if LibVersion < SSL_SESSION_get0_id_context_introduced then + begin + {$if declared(FC_SSL_SESSION_get0_id_context)} + SSL_SESSION_get0_id_context := @FC_SSL_SESSION_get0_id_context; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_SESSION_get0_id_context_removed)} + if SSL_SESSION_get0_id_context_removed <= LibVersion then + begin + {$if declared(_SSL_SESSION_get0_id_context)} + SSL_SESSION_get0_id_context := @_SSL_SESSION_get0_id_context; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_SESSION_get0_id_context_allownil)} + if FuncLoadError then + AFailed.Add('SSL_SESSION_get0_id_context'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_SESSION_get_compress_id := LoadLibFunction(ADllHandle, SSL_SESSION_get_compress_id_procname); + FuncLoadError := not assigned(SSL_SESSION_get_compress_id); + if FuncLoadError then + begin + {$if not defined(SSL_SESSION_get_compress_id_allownil)} + SSL_SESSION_get_compress_id := @ERR_SSL_SESSION_get_compress_id; + {$ifend} + {$if declared(SSL_SESSION_get_compress_id_introduced)} + if LibVersion < SSL_SESSION_get_compress_id_introduced then + begin + {$if declared(FC_SSL_SESSION_get_compress_id)} + SSL_SESSION_get_compress_id := @FC_SSL_SESSION_get_compress_id; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_SESSION_get_compress_id_removed)} + if SSL_SESSION_get_compress_id_removed <= LibVersion then + begin + {$if declared(_SSL_SESSION_get_compress_id)} + SSL_SESSION_get_compress_id := @_SSL_SESSION_get_compress_id; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_SESSION_get_compress_id_allownil)} + if FuncLoadError then + AFailed.Add('SSL_SESSION_get_compress_id'); + {$ifend} + end; + + + SSL_SESSION_print := LoadLibFunction(ADllHandle, SSL_SESSION_print_procname); + FuncLoadError := not assigned(SSL_SESSION_print); + if FuncLoadError then + begin + {$if not defined(SSL_SESSION_print_allownil)} + SSL_SESSION_print := @ERR_SSL_SESSION_print; + {$ifend} + {$if declared(SSL_SESSION_print_introduced)} + if LibVersion < SSL_SESSION_print_introduced then + begin + {$if declared(FC_SSL_SESSION_print)} + SSL_SESSION_print := @FC_SSL_SESSION_print; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_SESSION_print_removed)} + if SSL_SESSION_print_removed <= LibVersion then + begin + {$if declared(_SSL_SESSION_print)} + SSL_SESSION_print := @_SSL_SESSION_print; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_SESSION_print_allownil)} + if FuncLoadError then + AFailed.Add('SSL_SESSION_print'); + {$ifend} + end; + + + SSL_SESSION_print_keylog := LoadLibFunction(ADllHandle, SSL_SESSION_print_keylog_procname); + FuncLoadError := not assigned(SSL_SESSION_print_keylog); + if FuncLoadError then + begin + {$if not defined(SSL_SESSION_print_keylog_allownil)} + SSL_SESSION_print_keylog := @ERR_SSL_SESSION_print_keylog; + {$ifend} + {$if declared(SSL_SESSION_print_keylog_introduced)} + if LibVersion < SSL_SESSION_print_keylog_introduced then + begin + {$if declared(FC_SSL_SESSION_print_keylog)} + SSL_SESSION_print_keylog := @FC_SSL_SESSION_print_keylog; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_SESSION_print_keylog_removed)} + if SSL_SESSION_print_keylog_removed <= LibVersion then + begin + {$if declared(_SSL_SESSION_print_keylog)} + SSL_SESSION_print_keylog := @_SSL_SESSION_print_keylog; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_SESSION_print_keylog_allownil)} + if FuncLoadError then + AFailed.Add('SSL_SESSION_print_keylog'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_SESSION_up_ref := LoadLibFunction(ADllHandle, SSL_SESSION_up_ref_procname); + FuncLoadError := not assigned(SSL_SESSION_up_ref); + if FuncLoadError then + begin + {$if not defined(SSL_SESSION_up_ref_allownil)} + SSL_SESSION_up_ref := @ERR_SSL_SESSION_up_ref; + {$ifend} + {$if declared(SSL_SESSION_up_ref_introduced)} + if LibVersion < SSL_SESSION_up_ref_introduced then + begin + {$if declared(FC_SSL_SESSION_up_ref)} + SSL_SESSION_up_ref := @FC_SSL_SESSION_up_ref; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_SESSION_up_ref_removed)} + if SSL_SESSION_up_ref_removed <= LibVersion then + begin + {$if declared(_SSL_SESSION_up_ref)} + SSL_SESSION_up_ref := @_SSL_SESSION_up_ref; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_SESSION_up_ref_allownil)} + if FuncLoadError then + AFailed.Add('SSL_SESSION_up_ref'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_SESSION_free := LoadLibFunction(ADllHandle, SSL_SESSION_free_procname); + FuncLoadError := not assigned(SSL_SESSION_free); + if FuncLoadError then + begin + {$if not defined(SSL_SESSION_free_allownil)} + SSL_SESSION_free := @ERR_SSL_SESSION_free; + {$ifend} + {$if declared(SSL_SESSION_free_introduced)} + if LibVersion < SSL_SESSION_free_introduced then + begin + {$if declared(FC_SSL_SESSION_free)} + SSL_SESSION_free := @FC_SSL_SESSION_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_SESSION_free_removed)} + if SSL_SESSION_free_removed <= LibVersion then + begin + {$if declared(_SSL_SESSION_free)} + SSL_SESSION_free := @_SSL_SESSION_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_SESSION_free_allownil)} + if FuncLoadError then + AFailed.Add('SSL_SESSION_free'); + {$ifend} + end; + + + SSL_set_session := LoadLibFunction(ADllHandle, SSL_set_session_procname); + FuncLoadError := not assigned(SSL_set_session); + if FuncLoadError then + begin + {$if not defined(SSL_set_session_allownil)} + SSL_set_session := @ERR_SSL_set_session; + {$ifend} + {$if declared(SSL_set_session_introduced)} + if LibVersion < SSL_set_session_introduced then + begin + {$if declared(FC_SSL_set_session)} + SSL_set_session := @FC_SSL_set_session; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_set_session_removed)} + if SSL_set_session_removed <= LibVersion then + begin + {$if declared(_SSL_set_session)} + SSL_set_session := @_SSL_set_session; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_set_session_allownil)} + if FuncLoadError then + AFailed.Add('SSL_set_session'); + {$ifend} + end; + + + SSL_CTX_add_session := LoadLibFunction(ADllHandle, SSL_CTX_add_session_procname); + FuncLoadError := not assigned(SSL_CTX_add_session); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_add_session_allownil)} + SSL_CTX_add_session := @ERR_SSL_CTX_add_session; + {$ifend} + {$if declared(SSL_CTX_add_session_introduced)} + if LibVersion < SSL_CTX_add_session_introduced then + begin + {$if declared(FC_SSL_CTX_add_session)} + SSL_CTX_add_session := @FC_SSL_CTX_add_session; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_add_session_removed)} + if SSL_CTX_add_session_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_add_session)} + SSL_CTX_add_session := @_SSL_CTX_add_session; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_add_session_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_add_session'); + {$ifend} + end; + + + SSL_CTX_remove_session := LoadLibFunction(ADllHandle, SSL_CTX_remove_session_procname); + FuncLoadError := not assigned(SSL_CTX_remove_session); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_remove_session_allownil)} + SSL_CTX_remove_session := @ERR_SSL_CTX_remove_session; + {$ifend} + {$if declared(SSL_CTX_remove_session_introduced)} + if LibVersion < SSL_CTX_remove_session_introduced then + begin + {$if declared(FC_SSL_CTX_remove_session)} + SSL_CTX_remove_session := @FC_SSL_CTX_remove_session; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_remove_session_removed)} + if SSL_CTX_remove_session_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_remove_session)} + SSL_CTX_remove_session := @_SSL_CTX_remove_session; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_remove_session_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_remove_session'); + {$ifend} + end; + + + SSL_CTX_set_generate_session_id := LoadLibFunction(ADllHandle, SSL_CTX_set_generate_session_id_procname); + FuncLoadError := not assigned(SSL_CTX_set_generate_session_id); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_set_generate_session_id_allownil)} + SSL_CTX_set_generate_session_id := @ERR_SSL_CTX_set_generate_session_id; + {$ifend} + {$if declared(SSL_CTX_set_generate_session_id_introduced)} + if LibVersion < SSL_CTX_set_generate_session_id_introduced then + begin + {$if declared(FC_SSL_CTX_set_generate_session_id)} + SSL_CTX_set_generate_session_id := @FC_SSL_CTX_set_generate_session_id; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_set_generate_session_id_removed)} + if SSL_CTX_set_generate_session_id_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_set_generate_session_id)} + SSL_CTX_set_generate_session_id := @_SSL_CTX_set_generate_session_id; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_set_generate_session_id_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_set_generate_session_id'); + {$ifend} + end; + + + SSL_set_generate_session_id := LoadLibFunction(ADllHandle, SSL_set_generate_session_id_procname); + FuncLoadError := not assigned(SSL_set_generate_session_id); + if FuncLoadError then + begin + {$if not defined(SSL_set_generate_session_id_allownil)} + SSL_set_generate_session_id := @ERR_SSL_set_generate_session_id; + {$ifend} + {$if declared(SSL_set_generate_session_id_introduced)} + if LibVersion < SSL_set_generate_session_id_introduced then + begin + {$if declared(FC_SSL_set_generate_session_id)} + SSL_set_generate_session_id := @FC_SSL_set_generate_session_id; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_set_generate_session_id_removed)} + if SSL_set_generate_session_id_removed <= LibVersion then + begin + {$if declared(_SSL_set_generate_session_id)} + SSL_set_generate_session_id := @_SSL_set_generate_session_id; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_set_generate_session_id_allownil)} + if FuncLoadError then + AFailed.Add('SSL_set_generate_session_id'); + {$ifend} + end; + + + SSL_has_matching_session_id := LoadLibFunction(ADllHandle, SSL_has_matching_session_id_procname); + FuncLoadError := not assigned(SSL_has_matching_session_id); + if FuncLoadError then + begin + {$if not defined(SSL_has_matching_session_id_allownil)} + SSL_has_matching_session_id := @ERR_SSL_has_matching_session_id; + {$ifend} + {$if declared(SSL_has_matching_session_id_introduced)} + if LibVersion < SSL_has_matching_session_id_introduced then + begin + {$if declared(FC_SSL_has_matching_session_id)} + SSL_has_matching_session_id := @FC_SSL_has_matching_session_id; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_has_matching_session_id_removed)} + if SSL_has_matching_session_id_removed <= LibVersion then + begin + {$if declared(_SSL_has_matching_session_id)} + SSL_has_matching_session_id := @_SSL_has_matching_session_id; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_has_matching_session_id_allownil)} + if FuncLoadError then + AFailed.Add('SSL_has_matching_session_id'); + {$ifend} + end; + + + d2i_SSL_SESSION := LoadLibFunction(ADllHandle, d2i_SSL_SESSION_procname); + FuncLoadError := not assigned(d2i_SSL_SESSION); + if FuncLoadError then + begin + {$if not defined(d2i_SSL_SESSION_allownil)} + d2i_SSL_SESSION := @ERR_d2i_SSL_SESSION; + {$ifend} + {$if declared(d2i_SSL_SESSION_introduced)} + if LibVersion < d2i_SSL_SESSION_introduced then + begin + {$if declared(FC_d2i_SSL_SESSION)} + d2i_SSL_SESSION := @FC_d2i_SSL_SESSION; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(d2i_SSL_SESSION_removed)} + if d2i_SSL_SESSION_removed <= LibVersion then + begin + {$if declared(_d2i_SSL_SESSION)} + d2i_SSL_SESSION := @_d2i_SSL_SESSION; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(d2i_SSL_SESSION_allownil)} + if FuncLoadError then + AFailed.Add('d2i_SSL_SESSION'); + {$ifend} + end; + + + SSL_get_peer_certificate := LoadLibFunction(ADllHandle, SSL_get_peer_certificate_procname); + FuncLoadError := not assigned(SSL_get_peer_certificate); + if FuncLoadError then + begin + {$if not defined(SSL_get_peer_certificate_allownil)} + SSL_get_peer_certificate := @ERR_SSL_get_peer_certificate; + {$ifend} + {$if declared(SSL_get_peer_certificate_introduced)} + if LibVersion < SSL_get_peer_certificate_introduced then + begin + {$if declared(FC_SSL_get_peer_certificate)} + SSL_get_peer_certificate := @FC_SSL_get_peer_certificate; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_get_peer_certificate_removed)} + if SSL_get_peer_certificate_removed <= LibVersion then + begin + {$if declared(_SSL_get_peer_certificate)} + SSL_get_peer_certificate := @_SSL_get_peer_certificate; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_get_peer_certificate_allownil)} + if FuncLoadError then + AFailed.Add('SSL_get_peer_certificate'); + {$ifend} + end; + + + SSL_CTX_get_verify_mode := LoadLibFunction(ADllHandle, SSL_CTX_get_verify_mode_procname); + FuncLoadError := not assigned(SSL_CTX_get_verify_mode); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_get_verify_mode_allownil)} + SSL_CTX_get_verify_mode := @ERR_SSL_CTX_get_verify_mode; + {$ifend} + {$if declared(SSL_CTX_get_verify_mode_introduced)} + if LibVersion < SSL_CTX_get_verify_mode_introduced then + begin + {$if declared(FC_SSL_CTX_get_verify_mode)} + SSL_CTX_get_verify_mode := @FC_SSL_CTX_get_verify_mode; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_get_verify_mode_removed)} + if SSL_CTX_get_verify_mode_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_get_verify_mode)} + SSL_CTX_get_verify_mode := @_SSL_CTX_get_verify_mode; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_get_verify_mode_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_get_verify_mode'); + {$ifend} + end; + + + SSL_CTX_get_verify_depth := LoadLibFunction(ADllHandle, SSL_CTX_get_verify_depth_procname); + FuncLoadError := not assigned(SSL_CTX_get_verify_depth); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_get_verify_depth_allownil)} + SSL_CTX_get_verify_depth := @ERR_SSL_CTX_get_verify_depth; + {$ifend} + {$if declared(SSL_CTX_get_verify_depth_introduced)} + if LibVersion < SSL_CTX_get_verify_depth_introduced then + begin + {$if declared(FC_SSL_CTX_get_verify_depth)} + SSL_CTX_get_verify_depth := @FC_SSL_CTX_get_verify_depth; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_get_verify_depth_removed)} + if SSL_CTX_get_verify_depth_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_get_verify_depth)} + SSL_CTX_get_verify_depth := @_SSL_CTX_get_verify_depth; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_get_verify_depth_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_get_verify_depth'); + {$ifend} + end; + + + SSL_CTX_get_verify_callback := LoadLibFunction(ADllHandle, SSL_CTX_get_verify_callback_procname); + FuncLoadError := not assigned(SSL_CTX_get_verify_callback); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_get_verify_callback_allownil)} + SSL_CTX_get_verify_callback := @ERR_SSL_CTX_get_verify_callback; + {$ifend} + {$if declared(SSL_CTX_get_verify_callback_introduced)} + if LibVersion < SSL_CTX_get_verify_callback_introduced then + begin + {$if declared(FC_SSL_CTX_get_verify_callback)} + SSL_CTX_get_verify_callback := @FC_SSL_CTX_get_verify_callback; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_get_verify_callback_removed)} + if SSL_CTX_get_verify_callback_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_get_verify_callback)} + SSL_CTX_get_verify_callback := @_SSL_CTX_get_verify_callback; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_get_verify_callback_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_get_verify_callback'); + {$ifend} + end; + + + SSL_CTX_set_verify := LoadLibFunction(ADllHandle, SSL_CTX_set_verify_procname); + FuncLoadError := not assigned(SSL_CTX_set_verify); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_set_verify_allownil)} + SSL_CTX_set_verify := @ERR_SSL_CTX_set_verify; + {$ifend} + {$if declared(SSL_CTX_set_verify_introduced)} + if LibVersion < SSL_CTX_set_verify_introduced then + begin + {$if declared(FC_SSL_CTX_set_verify)} + SSL_CTX_set_verify := @FC_SSL_CTX_set_verify; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_set_verify_removed)} + if SSL_CTX_set_verify_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_set_verify)} + SSL_CTX_set_verify := @_SSL_CTX_set_verify; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_set_verify_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_set_verify'); + {$ifend} + end; + + + SSL_CTX_set_verify_depth := LoadLibFunction(ADllHandle, SSL_CTX_set_verify_depth_procname); + FuncLoadError := not assigned(SSL_CTX_set_verify_depth); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_set_verify_depth_allownil)} + SSL_CTX_set_verify_depth := @ERR_SSL_CTX_set_verify_depth; + {$ifend} + {$if declared(SSL_CTX_set_verify_depth_introduced)} + if LibVersion < SSL_CTX_set_verify_depth_introduced then + begin + {$if declared(FC_SSL_CTX_set_verify_depth)} + SSL_CTX_set_verify_depth := @FC_SSL_CTX_set_verify_depth; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_set_verify_depth_removed)} + if SSL_CTX_set_verify_depth_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_set_verify_depth)} + SSL_CTX_set_verify_depth := @_SSL_CTX_set_verify_depth; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_set_verify_depth_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_set_verify_depth'); + {$ifend} + end; + + + SSL_CTX_set_cert_verify_callback := LoadLibFunction(ADllHandle, SSL_CTX_set_cert_verify_callback_procname); + FuncLoadError := not assigned(SSL_CTX_set_cert_verify_callback); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_set_cert_verify_callback_allownil)} + SSL_CTX_set_cert_verify_callback := @ERR_SSL_CTX_set_cert_verify_callback; + {$ifend} + {$if declared(SSL_CTX_set_cert_verify_callback_introduced)} + if LibVersion < SSL_CTX_set_cert_verify_callback_introduced then + begin + {$if declared(FC_SSL_CTX_set_cert_verify_callback)} + SSL_CTX_set_cert_verify_callback := @FC_SSL_CTX_set_cert_verify_callback; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_set_cert_verify_callback_removed)} + if SSL_CTX_set_cert_verify_callback_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_set_cert_verify_callback)} + SSL_CTX_set_cert_verify_callback := @_SSL_CTX_set_cert_verify_callback; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_set_cert_verify_callback_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_set_cert_verify_callback'); + {$ifend} + end; + + + SSL_CTX_set_cert_cb := LoadLibFunction(ADllHandle, SSL_CTX_set_cert_cb_procname); + FuncLoadError := not assigned(SSL_CTX_set_cert_cb); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_set_cert_cb_allownil)} + SSL_CTX_set_cert_cb := @ERR_SSL_CTX_set_cert_cb; + {$ifend} + {$if declared(SSL_CTX_set_cert_cb_introduced)} + if LibVersion < SSL_CTX_set_cert_cb_introduced then + begin + {$if declared(FC_SSL_CTX_set_cert_cb)} + SSL_CTX_set_cert_cb := @FC_SSL_CTX_set_cert_cb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_set_cert_cb_removed)} + if SSL_CTX_set_cert_cb_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_set_cert_cb)} + SSL_CTX_set_cert_cb := @_SSL_CTX_set_cert_cb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_set_cert_cb_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_set_cert_cb'); + {$ifend} + end; + + + SSL_CTX_use_RSAPrivateKey := LoadLibFunction(ADllHandle, SSL_CTX_use_RSAPrivateKey_procname); + FuncLoadError := not assigned(SSL_CTX_use_RSAPrivateKey); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_use_RSAPrivateKey_allownil)} + SSL_CTX_use_RSAPrivateKey := @ERR_SSL_CTX_use_RSAPrivateKey; + {$ifend} + {$if declared(SSL_CTX_use_RSAPrivateKey_introduced)} + if LibVersion < SSL_CTX_use_RSAPrivateKey_introduced then + begin + {$if declared(FC_SSL_CTX_use_RSAPrivateKey)} + SSL_CTX_use_RSAPrivateKey := @FC_SSL_CTX_use_RSAPrivateKey; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_use_RSAPrivateKey_removed)} + if SSL_CTX_use_RSAPrivateKey_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_use_RSAPrivateKey)} + SSL_CTX_use_RSAPrivateKey := @_SSL_CTX_use_RSAPrivateKey; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_use_RSAPrivateKey_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_use_RSAPrivateKey'); + {$ifend} + end; + + + SSL_CTX_use_RSAPrivateKey_ASN1 := LoadLibFunction(ADllHandle, SSL_CTX_use_RSAPrivateKey_ASN1_procname); + FuncLoadError := not assigned(SSL_CTX_use_RSAPrivateKey_ASN1); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_use_RSAPrivateKey_ASN1_allownil)} + SSL_CTX_use_RSAPrivateKey_ASN1 := @ERR_SSL_CTX_use_RSAPrivateKey_ASN1; + {$ifend} + {$if declared(SSL_CTX_use_RSAPrivateKey_ASN1_introduced)} + if LibVersion < SSL_CTX_use_RSAPrivateKey_ASN1_introduced then + begin + {$if declared(FC_SSL_CTX_use_RSAPrivateKey_ASN1)} + SSL_CTX_use_RSAPrivateKey_ASN1 := @FC_SSL_CTX_use_RSAPrivateKey_ASN1; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_use_RSAPrivateKey_ASN1_removed)} + if SSL_CTX_use_RSAPrivateKey_ASN1_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_use_RSAPrivateKey_ASN1)} + SSL_CTX_use_RSAPrivateKey_ASN1 := @_SSL_CTX_use_RSAPrivateKey_ASN1; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_use_RSAPrivateKey_ASN1_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_use_RSAPrivateKey_ASN1'); + {$ifend} + end; + + + SSL_CTX_use_PrivateKey := LoadLibFunction(ADllHandle, SSL_CTX_use_PrivateKey_procname); + FuncLoadError := not assigned(SSL_CTX_use_PrivateKey); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_use_PrivateKey_allownil)} + SSL_CTX_use_PrivateKey := @ERR_SSL_CTX_use_PrivateKey; + {$ifend} + {$if declared(SSL_CTX_use_PrivateKey_introduced)} + if LibVersion < SSL_CTX_use_PrivateKey_introduced then + begin + {$if declared(FC_SSL_CTX_use_PrivateKey)} + SSL_CTX_use_PrivateKey := @FC_SSL_CTX_use_PrivateKey; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_use_PrivateKey_removed)} + if SSL_CTX_use_PrivateKey_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_use_PrivateKey)} + SSL_CTX_use_PrivateKey := @_SSL_CTX_use_PrivateKey; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_use_PrivateKey_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_use_PrivateKey'); + {$ifend} + end; + + + SSL_CTX_use_PrivateKey_ASN1 := LoadLibFunction(ADllHandle, SSL_CTX_use_PrivateKey_ASN1_procname); + FuncLoadError := not assigned(SSL_CTX_use_PrivateKey_ASN1); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_use_PrivateKey_ASN1_allownil)} + SSL_CTX_use_PrivateKey_ASN1 := @ERR_SSL_CTX_use_PrivateKey_ASN1; + {$ifend} + {$if declared(SSL_CTX_use_PrivateKey_ASN1_introduced)} + if LibVersion < SSL_CTX_use_PrivateKey_ASN1_introduced then + begin + {$if declared(FC_SSL_CTX_use_PrivateKey_ASN1)} + SSL_CTX_use_PrivateKey_ASN1 := @FC_SSL_CTX_use_PrivateKey_ASN1; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_use_PrivateKey_ASN1_removed)} + if SSL_CTX_use_PrivateKey_ASN1_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_use_PrivateKey_ASN1)} + SSL_CTX_use_PrivateKey_ASN1 := @_SSL_CTX_use_PrivateKey_ASN1; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_use_PrivateKey_ASN1_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_use_PrivateKey_ASN1'); + {$ifend} + end; + + + SSL_CTX_use_certificate := LoadLibFunction(ADllHandle, SSL_CTX_use_certificate_procname); + FuncLoadError := not assigned(SSL_CTX_use_certificate); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_use_certificate_allownil)} + SSL_CTX_use_certificate := @ERR_SSL_CTX_use_certificate; + {$ifend} + {$if declared(SSL_CTX_use_certificate_introduced)} + if LibVersion < SSL_CTX_use_certificate_introduced then + begin + {$if declared(FC_SSL_CTX_use_certificate)} + SSL_CTX_use_certificate := @FC_SSL_CTX_use_certificate; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_use_certificate_removed)} + if SSL_CTX_use_certificate_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_use_certificate)} + SSL_CTX_use_certificate := @_SSL_CTX_use_certificate; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_use_certificate_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_use_certificate'); + {$ifend} + end; + + + SSL_CTX_use_certificate_ASN1 := LoadLibFunction(ADllHandle, SSL_CTX_use_certificate_ASN1_procname); + FuncLoadError := not assigned(SSL_CTX_use_certificate_ASN1); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_use_certificate_ASN1_allownil)} + SSL_CTX_use_certificate_ASN1 := @ERR_SSL_CTX_use_certificate_ASN1; + {$ifend} + {$if declared(SSL_CTX_use_certificate_ASN1_introduced)} + if LibVersion < SSL_CTX_use_certificate_ASN1_introduced then + begin + {$if declared(FC_SSL_CTX_use_certificate_ASN1)} + SSL_CTX_use_certificate_ASN1 := @FC_SSL_CTX_use_certificate_ASN1; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_use_certificate_ASN1_removed)} + if SSL_CTX_use_certificate_ASN1_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_use_certificate_ASN1)} + SSL_CTX_use_certificate_ASN1 := @_SSL_CTX_use_certificate_ASN1; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_use_certificate_ASN1_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_use_certificate_ASN1'); + {$ifend} + end; + + + SSL_CTX_set_default_passwd_cb := LoadLibFunction(ADllHandle, SSL_CTX_set_default_passwd_cb_procname); + FuncLoadError := not assigned(SSL_CTX_set_default_passwd_cb); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_set_default_passwd_cb_allownil)} + SSL_CTX_set_default_passwd_cb := @ERR_SSL_CTX_set_default_passwd_cb; + {$ifend} + {$if declared(SSL_CTX_set_default_passwd_cb_introduced)} + if LibVersion < SSL_CTX_set_default_passwd_cb_introduced then + begin + {$if declared(FC_SSL_CTX_set_default_passwd_cb)} + SSL_CTX_set_default_passwd_cb := @FC_SSL_CTX_set_default_passwd_cb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_set_default_passwd_cb_removed)} + if SSL_CTX_set_default_passwd_cb_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_set_default_passwd_cb)} + SSL_CTX_set_default_passwd_cb := @_SSL_CTX_set_default_passwd_cb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_set_default_passwd_cb_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_set_default_passwd_cb'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_CTX_set_default_passwd_cb_userdata := LoadLibFunction(ADllHandle, SSL_CTX_set_default_passwd_cb_userdata_procname); + FuncLoadError := not assigned(SSL_CTX_set_default_passwd_cb_userdata); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_set_default_passwd_cb_userdata_allownil)} + SSL_CTX_set_default_passwd_cb_userdata := @ERR_SSL_CTX_set_default_passwd_cb_userdata; + {$ifend} + {$if declared(SSL_CTX_set_default_passwd_cb_userdata_introduced)} + if LibVersion < SSL_CTX_set_default_passwd_cb_userdata_introduced then + begin + {$if declared(FC_SSL_CTX_set_default_passwd_cb_userdata)} + SSL_CTX_set_default_passwd_cb_userdata := @FC_SSL_CTX_set_default_passwd_cb_userdata; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_set_default_passwd_cb_userdata_removed)} + if SSL_CTX_set_default_passwd_cb_userdata_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_set_default_passwd_cb_userdata)} + SSL_CTX_set_default_passwd_cb_userdata := @_SSL_CTX_set_default_passwd_cb_userdata; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_set_default_passwd_cb_userdata_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_set_default_passwd_cb_userdata'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_CTX_get_default_passwd_cb := LoadLibFunction(ADllHandle, SSL_CTX_get_default_passwd_cb_procname); + FuncLoadError := not assigned(SSL_CTX_get_default_passwd_cb); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_get_default_passwd_cb_allownil)} + SSL_CTX_get_default_passwd_cb := @ERR_SSL_CTX_get_default_passwd_cb; + {$ifend} + {$if declared(SSL_CTX_get_default_passwd_cb_introduced)} + if LibVersion < SSL_CTX_get_default_passwd_cb_introduced then + begin + {$if declared(FC_SSL_CTX_get_default_passwd_cb)} + SSL_CTX_get_default_passwd_cb := @FC_SSL_CTX_get_default_passwd_cb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_get_default_passwd_cb_removed)} + if SSL_CTX_get_default_passwd_cb_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_get_default_passwd_cb)} + SSL_CTX_get_default_passwd_cb := @_SSL_CTX_get_default_passwd_cb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_get_default_passwd_cb_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_get_default_passwd_cb'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_CTX_get_default_passwd_cb_userdata := LoadLibFunction(ADllHandle, SSL_CTX_get_default_passwd_cb_userdata_procname); + FuncLoadError := not assigned(SSL_CTX_get_default_passwd_cb_userdata); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_get_default_passwd_cb_userdata_allownil)} + SSL_CTX_get_default_passwd_cb_userdata := @ERR_SSL_CTX_get_default_passwd_cb_userdata; + {$ifend} + {$if declared(SSL_CTX_get_default_passwd_cb_userdata_introduced)} + if LibVersion < SSL_CTX_get_default_passwd_cb_userdata_introduced then + begin + {$if declared(FC_SSL_CTX_get_default_passwd_cb_userdata)} + SSL_CTX_get_default_passwd_cb_userdata := @FC_SSL_CTX_get_default_passwd_cb_userdata; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_get_default_passwd_cb_userdata_removed)} + if SSL_CTX_get_default_passwd_cb_userdata_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_get_default_passwd_cb_userdata)} + SSL_CTX_get_default_passwd_cb_userdata := @_SSL_CTX_get_default_passwd_cb_userdata; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_get_default_passwd_cb_userdata_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_get_default_passwd_cb_userdata'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_set_default_passwd_cb := LoadLibFunction(ADllHandle, SSL_set_default_passwd_cb_procname); + FuncLoadError := not assigned(SSL_set_default_passwd_cb); + if FuncLoadError then + begin + {$if not defined(SSL_set_default_passwd_cb_allownil)} + SSL_set_default_passwd_cb := @ERR_SSL_set_default_passwd_cb; + {$ifend} + {$if declared(SSL_set_default_passwd_cb_introduced)} + if LibVersion < SSL_set_default_passwd_cb_introduced then + begin + {$if declared(FC_SSL_set_default_passwd_cb)} + SSL_set_default_passwd_cb := @FC_SSL_set_default_passwd_cb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_set_default_passwd_cb_removed)} + if SSL_set_default_passwd_cb_removed <= LibVersion then + begin + {$if declared(_SSL_set_default_passwd_cb)} + SSL_set_default_passwd_cb := @_SSL_set_default_passwd_cb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_set_default_passwd_cb_allownil)} + if FuncLoadError then + AFailed.Add('SSL_set_default_passwd_cb'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_set_default_passwd_cb_userdata := LoadLibFunction(ADllHandle, SSL_set_default_passwd_cb_userdata_procname); + FuncLoadError := not assigned(SSL_set_default_passwd_cb_userdata); + if FuncLoadError then + begin + {$if not defined(SSL_set_default_passwd_cb_userdata_allownil)} + SSL_set_default_passwd_cb_userdata := @ERR_SSL_set_default_passwd_cb_userdata; + {$ifend} + {$if declared(SSL_set_default_passwd_cb_userdata_introduced)} + if LibVersion < SSL_set_default_passwd_cb_userdata_introduced then + begin + {$if declared(FC_SSL_set_default_passwd_cb_userdata)} + SSL_set_default_passwd_cb_userdata := @FC_SSL_set_default_passwd_cb_userdata; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_set_default_passwd_cb_userdata_removed)} + if SSL_set_default_passwd_cb_userdata_removed <= LibVersion then + begin + {$if declared(_SSL_set_default_passwd_cb_userdata)} + SSL_set_default_passwd_cb_userdata := @_SSL_set_default_passwd_cb_userdata; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_set_default_passwd_cb_userdata_allownil)} + if FuncLoadError then + AFailed.Add('SSL_set_default_passwd_cb_userdata'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_get_default_passwd_cb := LoadLibFunction(ADllHandle, SSL_get_default_passwd_cb_procname); + FuncLoadError := not assigned(SSL_get_default_passwd_cb); + if FuncLoadError then + begin + {$if not defined(SSL_get_default_passwd_cb_allownil)} + SSL_get_default_passwd_cb := @ERR_SSL_get_default_passwd_cb; + {$ifend} + {$if declared(SSL_get_default_passwd_cb_introduced)} + if LibVersion < SSL_get_default_passwd_cb_introduced then + begin + {$if declared(FC_SSL_get_default_passwd_cb)} + SSL_get_default_passwd_cb := @FC_SSL_get_default_passwd_cb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_get_default_passwd_cb_removed)} + if SSL_get_default_passwd_cb_removed <= LibVersion then + begin + {$if declared(_SSL_get_default_passwd_cb)} + SSL_get_default_passwd_cb := @_SSL_get_default_passwd_cb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_get_default_passwd_cb_allownil)} + if FuncLoadError then + AFailed.Add('SSL_get_default_passwd_cb'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_get_default_passwd_cb_userdata := LoadLibFunction(ADllHandle, SSL_get_default_passwd_cb_userdata_procname); + FuncLoadError := not assigned(SSL_get_default_passwd_cb_userdata); + if FuncLoadError then + begin + {$if not defined(SSL_get_default_passwd_cb_userdata_allownil)} + SSL_get_default_passwd_cb_userdata := @ERR_SSL_get_default_passwd_cb_userdata; + {$ifend} + {$if declared(SSL_get_default_passwd_cb_userdata_introduced)} + if LibVersion < SSL_get_default_passwd_cb_userdata_introduced then + begin + {$if declared(FC_SSL_get_default_passwd_cb_userdata)} + SSL_get_default_passwd_cb_userdata := @FC_SSL_get_default_passwd_cb_userdata; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_get_default_passwd_cb_userdata_removed)} + if SSL_get_default_passwd_cb_userdata_removed <= LibVersion then + begin + {$if declared(_SSL_get_default_passwd_cb_userdata)} + SSL_get_default_passwd_cb_userdata := @_SSL_get_default_passwd_cb_userdata; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_get_default_passwd_cb_userdata_allownil)} + if FuncLoadError then + AFailed.Add('SSL_get_default_passwd_cb_userdata'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_CTX_check_private_key := LoadLibFunction(ADllHandle, SSL_CTX_check_private_key_procname); + FuncLoadError := not assigned(SSL_CTX_check_private_key); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_check_private_key_allownil)} + SSL_CTX_check_private_key := @ERR_SSL_CTX_check_private_key; + {$ifend} + {$if declared(SSL_CTX_check_private_key_introduced)} + if LibVersion < SSL_CTX_check_private_key_introduced then + begin + {$if declared(FC_SSL_CTX_check_private_key)} + SSL_CTX_check_private_key := @FC_SSL_CTX_check_private_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_check_private_key_removed)} + if SSL_CTX_check_private_key_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_check_private_key)} + SSL_CTX_check_private_key := @_SSL_CTX_check_private_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_check_private_key_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_check_private_key'); + {$ifend} + end; + + + SSL_check_private_key := LoadLibFunction(ADllHandle, SSL_check_private_key_procname); + FuncLoadError := not assigned(SSL_check_private_key); + if FuncLoadError then + begin + {$if not defined(SSL_check_private_key_allownil)} + SSL_check_private_key := @ERR_SSL_check_private_key; + {$ifend} + {$if declared(SSL_check_private_key_introduced)} + if LibVersion < SSL_check_private_key_introduced then + begin + {$if declared(FC_SSL_check_private_key)} + SSL_check_private_key := @FC_SSL_check_private_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_check_private_key_removed)} + if SSL_check_private_key_removed <= LibVersion then + begin + {$if declared(_SSL_check_private_key)} + SSL_check_private_key := @_SSL_check_private_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_check_private_key_allownil)} + if FuncLoadError then + AFailed.Add('SSL_check_private_key'); + {$ifend} + end; + + + SSL_CTX_set_session_id_context := LoadLibFunction(ADllHandle, SSL_CTX_set_session_id_context_procname); + FuncLoadError := not assigned(SSL_CTX_set_session_id_context); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_set_session_id_context_allownil)} + SSL_CTX_set_session_id_context := @ERR_SSL_CTX_set_session_id_context; + {$ifend} + {$if declared(SSL_CTX_set_session_id_context_introduced)} + if LibVersion < SSL_CTX_set_session_id_context_introduced then + begin + {$if declared(FC_SSL_CTX_set_session_id_context)} + SSL_CTX_set_session_id_context := @FC_SSL_CTX_set_session_id_context; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_set_session_id_context_removed)} + if SSL_CTX_set_session_id_context_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_set_session_id_context)} + SSL_CTX_set_session_id_context := @_SSL_CTX_set_session_id_context; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_set_session_id_context_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_set_session_id_context'); + {$ifend} + end; + + + SSL_new := LoadLibFunction(ADllHandle, SSL_new_procname); + FuncLoadError := not assigned(SSL_new); + if FuncLoadError then + begin + {$if not defined(SSL_new_allownil)} + SSL_new := @ERR_SSL_new; + {$ifend} + {$if declared(SSL_new_introduced)} + if LibVersion < SSL_new_introduced then + begin + {$if declared(FC_SSL_new)} + SSL_new := @FC_SSL_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_new_removed)} + if SSL_new_removed <= LibVersion then + begin + {$if declared(_SSL_new)} + SSL_new := @_SSL_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_new_allownil)} + if FuncLoadError then + AFailed.Add('SSL_new'); + {$ifend} + end; + + + SSL_up_ref := LoadLibFunction(ADllHandle, SSL_up_ref_procname); + FuncLoadError := not assigned(SSL_up_ref); + if FuncLoadError then + begin + {$if not defined(SSL_up_ref_allownil)} + SSL_up_ref := @ERR_SSL_up_ref; + {$ifend} + {$if declared(SSL_up_ref_introduced)} + if LibVersion < SSL_up_ref_introduced then + begin + {$if declared(FC_SSL_up_ref)} + SSL_up_ref := @FC_SSL_up_ref; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_up_ref_removed)} + if SSL_up_ref_removed <= LibVersion then + begin + {$if declared(_SSL_up_ref)} + SSL_up_ref := @_SSL_up_ref; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_up_ref_allownil)} + if FuncLoadError then + AFailed.Add('SSL_up_ref'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_is_dtls := LoadLibFunction(ADllHandle, SSL_is_dtls_procname); + FuncLoadError := not assigned(SSL_is_dtls); + if FuncLoadError then + begin + {$if not defined(SSL_is_dtls_allownil)} + SSL_is_dtls := @ERR_SSL_is_dtls; + {$ifend} + {$if declared(SSL_is_dtls_introduced)} + if LibVersion < SSL_is_dtls_introduced then + begin + {$if declared(FC_SSL_is_dtls)} + SSL_is_dtls := @FC_SSL_is_dtls; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_is_dtls_removed)} + if SSL_is_dtls_removed <= LibVersion then + begin + {$if declared(_SSL_is_dtls)} + SSL_is_dtls := @_SSL_is_dtls; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_is_dtls_allownil)} + if FuncLoadError then + AFailed.Add('SSL_is_dtls'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_set_session_id_context := LoadLibFunction(ADllHandle, SSL_set_session_id_context_procname); + FuncLoadError := not assigned(SSL_set_session_id_context); + if FuncLoadError then + begin + {$if not defined(SSL_set_session_id_context_allownil)} + SSL_set_session_id_context := @ERR_SSL_set_session_id_context; + {$ifend} + {$if declared(SSL_set_session_id_context_introduced)} + if LibVersion < SSL_set_session_id_context_introduced then + begin + {$if declared(FC_SSL_set_session_id_context)} + SSL_set_session_id_context := @FC_SSL_set_session_id_context; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_set_session_id_context_removed)} + if SSL_set_session_id_context_removed <= LibVersion then + begin + {$if declared(_SSL_set_session_id_context)} + SSL_set_session_id_context := @_SSL_set_session_id_context; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_set_session_id_context_allownil)} + if FuncLoadError then + AFailed.Add('SSL_set_session_id_context'); + {$ifend} + end; + + + SSL_CTX_set_purpose := LoadLibFunction(ADllHandle, SSL_CTX_set_purpose_procname); + FuncLoadError := not assigned(SSL_CTX_set_purpose); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_set_purpose_allownil)} + SSL_CTX_set_purpose := @ERR_SSL_CTX_set_purpose; + {$ifend} + {$if declared(SSL_CTX_set_purpose_introduced)} + if LibVersion < SSL_CTX_set_purpose_introduced then + begin + {$if declared(FC_SSL_CTX_set_purpose)} + SSL_CTX_set_purpose := @FC_SSL_CTX_set_purpose; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_set_purpose_removed)} + if SSL_CTX_set_purpose_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_set_purpose)} + SSL_CTX_set_purpose := @_SSL_CTX_set_purpose; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_set_purpose_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_set_purpose'); + {$ifend} + end; + + + SSL_set_purpose := LoadLibFunction(ADllHandle, SSL_set_purpose_procname); + FuncLoadError := not assigned(SSL_set_purpose); + if FuncLoadError then + begin + {$if not defined(SSL_set_purpose_allownil)} + SSL_set_purpose := @ERR_SSL_set_purpose; + {$ifend} + {$if declared(SSL_set_purpose_introduced)} + if LibVersion < SSL_set_purpose_introduced then + begin + {$if declared(FC_SSL_set_purpose)} + SSL_set_purpose := @FC_SSL_set_purpose; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_set_purpose_removed)} + if SSL_set_purpose_removed <= LibVersion then + begin + {$if declared(_SSL_set_purpose)} + SSL_set_purpose := @_SSL_set_purpose; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_set_purpose_allownil)} + if FuncLoadError then + AFailed.Add('SSL_set_purpose'); + {$ifend} + end; + + + SSL_CTX_set_trust := LoadLibFunction(ADllHandle, SSL_CTX_set_trust_procname); + FuncLoadError := not assigned(SSL_CTX_set_trust); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_set_trust_allownil)} + SSL_CTX_set_trust := @ERR_SSL_CTX_set_trust; + {$ifend} + {$if declared(SSL_CTX_set_trust_introduced)} + if LibVersion < SSL_CTX_set_trust_introduced then + begin + {$if declared(FC_SSL_CTX_set_trust)} + SSL_CTX_set_trust := @FC_SSL_CTX_set_trust; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_set_trust_removed)} + if SSL_CTX_set_trust_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_set_trust)} + SSL_CTX_set_trust := @_SSL_CTX_set_trust; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_set_trust_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_set_trust'); + {$ifend} + end; + + + SSL_set_trust := LoadLibFunction(ADllHandle, SSL_set_trust_procname); + FuncLoadError := not assigned(SSL_set_trust); + if FuncLoadError then + begin + {$if not defined(SSL_set_trust_allownil)} + SSL_set_trust := @ERR_SSL_set_trust; + {$ifend} + {$if declared(SSL_set_trust_introduced)} + if LibVersion < SSL_set_trust_introduced then + begin + {$if declared(FC_SSL_set_trust)} + SSL_set_trust := @FC_SSL_set_trust; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_set_trust_removed)} + if SSL_set_trust_removed <= LibVersion then + begin + {$if declared(_SSL_set_trust)} + SSL_set_trust := @_SSL_set_trust; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_set_trust_allownil)} + if FuncLoadError then + AFailed.Add('SSL_set_trust'); + {$ifend} + end; + + + SSL_set1_host := LoadLibFunction(ADllHandle, SSL_set1_host_procname); + FuncLoadError := not assigned(SSL_set1_host); + if FuncLoadError then + begin + {$if not defined(SSL_set1_host_allownil)} + SSL_set1_host := @ERR_SSL_set1_host; + {$ifend} + {$if declared(SSL_set1_host_introduced)} + if LibVersion < SSL_set1_host_introduced then + begin + {$if declared(FC_SSL_set1_host)} + SSL_set1_host := @FC_SSL_set1_host; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_set1_host_removed)} + if SSL_set1_host_removed <= LibVersion then + begin + {$if declared(_SSL_set1_host)} + SSL_set1_host := @_SSL_set1_host; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_set1_host_allownil)} + if FuncLoadError then + AFailed.Add('SSL_set1_host'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_add1_host := LoadLibFunction(ADllHandle, SSL_add1_host_procname); + FuncLoadError := not assigned(SSL_add1_host); + if FuncLoadError then + begin + {$if not defined(SSL_add1_host_allownil)} + SSL_add1_host := @ERR_SSL_add1_host; + {$ifend} + {$if declared(SSL_add1_host_introduced)} + if LibVersion < SSL_add1_host_introduced then + begin + {$if declared(FC_SSL_add1_host)} + SSL_add1_host := @FC_SSL_add1_host; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_add1_host_removed)} + if SSL_add1_host_removed <= LibVersion then + begin + {$if declared(_SSL_add1_host)} + SSL_add1_host := @_SSL_add1_host; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_add1_host_allownil)} + if FuncLoadError then + AFailed.Add('SSL_add1_host'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_get0_peername := LoadLibFunction(ADllHandle, SSL_get0_peername_procname); + FuncLoadError := not assigned(SSL_get0_peername); + if FuncLoadError then + begin + {$if not defined(SSL_get0_peername_allownil)} + SSL_get0_peername := @ERR_SSL_get0_peername; + {$ifend} + {$if declared(SSL_get0_peername_introduced)} + if LibVersion < SSL_get0_peername_introduced then + begin + {$if declared(FC_SSL_get0_peername)} + SSL_get0_peername := @FC_SSL_get0_peername; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_get0_peername_removed)} + if SSL_get0_peername_removed <= LibVersion then + begin + {$if declared(_SSL_get0_peername)} + SSL_get0_peername := @_SSL_get0_peername; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_get0_peername_allownil)} + if FuncLoadError then + AFailed.Add('SSL_get0_peername'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_set_hostflags := LoadLibFunction(ADllHandle, SSL_set_hostflags_procname); + FuncLoadError := not assigned(SSL_set_hostflags); + if FuncLoadError then + begin + {$if not defined(SSL_set_hostflags_allownil)} + SSL_set_hostflags := @ERR_SSL_set_hostflags; + {$ifend} + {$if declared(SSL_set_hostflags_introduced)} + if LibVersion < SSL_set_hostflags_introduced then + begin + {$if declared(FC_SSL_set_hostflags)} + SSL_set_hostflags := @FC_SSL_set_hostflags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_set_hostflags_removed)} + if SSL_set_hostflags_removed <= LibVersion then + begin + {$if declared(_SSL_set_hostflags)} + SSL_set_hostflags := @_SSL_set_hostflags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_set_hostflags_allownil)} + if FuncLoadError then + AFailed.Add('SSL_set_hostflags'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_CTX_dane_enable := LoadLibFunction(ADllHandle, SSL_CTX_dane_enable_procname); + FuncLoadError := not assigned(SSL_CTX_dane_enable); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_dane_enable_allownil)} + SSL_CTX_dane_enable := @ERR_SSL_CTX_dane_enable; + {$ifend} + {$if declared(SSL_CTX_dane_enable_introduced)} + if LibVersion < SSL_CTX_dane_enable_introduced then + begin + {$if declared(FC_SSL_CTX_dane_enable)} + SSL_CTX_dane_enable := @FC_SSL_CTX_dane_enable; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_dane_enable_removed)} + if SSL_CTX_dane_enable_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_dane_enable)} + SSL_CTX_dane_enable := @_SSL_CTX_dane_enable; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_dane_enable_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_dane_enable'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_CTX_dane_mtype_set := LoadLibFunction(ADllHandle, SSL_CTX_dane_mtype_set_procname); + FuncLoadError := not assigned(SSL_CTX_dane_mtype_set); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_dane_mtype_set_allownil)} + SSL_CTX_dane_mtype_set := @ERR_SSL_CTX_dane_mtype_set; + {$ifend} + {$if declared(SSL_CTX_dane_mtype_set_introduced)} + if LibVersion < SSL_CTX_dane_mtype_set_introduced then + begin + {$if declared(FC_SSL_CTX_dane_mtype_set)} + SSL_CTX_dane_mtype_set := @FC_SSL_CTX_dane_mtype_set; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_dane_mtype_set_removed)} + if SSL_CTX_dane_mtype_set_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_dane_mtype_set)} + SSL_CTX_dane_mtype_set := @_SSL_CTX_dane_mtype_set; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_dane_mtype_set_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_dane_mtype_set'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_dane_enable := LoadLibFunction(ADllHandle, SSL_dane_enable_procname); + FuncLoadError := not assigned(SSL_dane_enable); + if FuncLoadError then + begin + {$if not defined(SSL_dane_enable_allownil)} + SSL_dane_enable := @ERR_SSL_dane_enable; + {$ifend} + {$if declared(SSL_dane_enable_introduced)} + if LibVersion < SSL_dane_enable_introduced then + begin + {$if declared(FC_SSL_dane_enable)} + SSL_dane_enable := @FC_SSL_dane_enable; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_dane_enable_removed)} + if SSL_dane_enable_removed <= LibVersion then + begin + {$if declared(_SSL_dane_enable)} + SSL_dane_enable := @_SSL_dane_enable; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_dane_enable_allownil)} + if FuncLoadError then + AFailed.Add('SSL_dane_enable'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_dane_tlsa_add := LoadLibFunction(ADllHandle, SSL_dane_tlsa_add_procname); + FuncLoadError := not assigned(SSL_dane_tlsa_add); + if FuncLoadError then + begin + {$if not defined(SSL_dane_tlsa_add_allownil)} + SSL_dane_tlsa_add := @ERR_SSL_dane_tlsa_add; + {$ifend} + {$if declared(SSL_dane_tlsa_add_introduced)} + if LibVersion < SSL_dane_tlsa_add_introduced then + begin + {$if declared(FC_SSL_dane_tlsa_add)} + SSL_dane_tlsa_add := @FC_SSL_dane_tlsa_add; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_dane_tlsa_add_removed)} + if SSL_dane_tlsa_add_removed <= LibVersion then + begin + {$if declared(_SSL_dane_tlsa_add)} + SSL_dane_tlsa_add := @_SSL_dane_tlsa_add; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_dane_tlsa_add_allownil)} + if FuncLoadError then + AFailed.Add('SSL_dane_tlsa_add'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_get0_dane_authority := LoadLibFunction(ADllHandle, SSL_get0_dane_authority_procname); + FuncLoadError := not assigned(SSL_get0_dane_authority); + if FuncLoadError then + begin + {$if not defined(SSL_get0_dane_authority_allownil)} + SSL_get0_dane_authority := @ERR_SSL_get0_dane_authority; + {$ifend} + {$if declared(SSL_get0_dane_authority_introduced)} + if LibVersion < SSL_get0_dane_authority_introduced then + begin + {$if declared(FC_SSL_get0_dane_authority)} + SSL_get0_dane_authority := @FC_SSL_get0_dane_authority; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_get0_dane_authority_removed)} + if SSL_get0_dane_authority_removed <= LibVersion then + begin + {$if declared(_SSL_get0_dane_authority)} + SSL_get0_dane_authority := @_SSL_get0_dane_authority; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_get0_dane_authority_allownil)} + if FuncLoadError then + AFailed.Add('SSL_get0_dane_authority'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_get0_dane_tlsa := LoadLibFunction(ADllHandle, SSL_get0_dane_tlsa_procname); + FuncLoadError := not assigned(SSL_get0_dane_tlsa); + if FuncLoadError then + begin + {$if not defined(SSL_get0_dane_tlsa_allownil)} + SSL_get0_dane_tlsa := @ERR_SSL_get0_dane_tlsa; + {$ifend} + {$if declared(SSL_get0_dane_tlsa_introduced)} + if LibVersion < SSL_get0_dane_tlsa_introduced then + begin + {$if declared(FC_SSL_get0_dane_tlsa)} + SSL_get0_dane_tlsa := @FC_SSL_get0_dane_tlsa; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_get0_dane_tlsa_removed)} + if SSL_get0_dane_tlsa_removed <= LibVersion then + begin + {$if declared(_SSL_get0_dane_tlsa)} + SSL_get0_dane_tlsa := @_SSL_get0_dane_tlsa; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_get0_dane_tlsa_allownil)} + if FuncLoadError then + AFailed.Add('SSL_get0_dane_tlsa'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_get0_dane := LoadLibFunction(ADllHandle, SSL_get0_dane_procname); + FuncLoadError := not assigned(SSL_get0_dane); + if FuncLoadError then + begin + {$if not defined(SSL_get0_dane_allownil)} + SSL_get0_dane := @ERR_SSL_get0_dane; + {$ifend} + {$if declared(SSL_get0_dane_introduced)} + if LibVersion < SSL_get0_dane_introduced then + begin + {$if declared(FC_SSL_get0_dane)} + SSL_get0_dane := @FC_SSL_get0_dane; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_get0_dane_removed)} + if SSL_get0_dane_removed <= LibVersion then + begin + {$if declared(_SSL_get0_dane)} + SSL_get0_dane := @_SSL_get0_dane; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_get0_dane_allownil)} + if FuncLoadError then + AFailed.Add('SSL_get0_dane'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_CTX_dane_set_flags := LoadLibFunction(ADllHandle, SSL_CTX_dane_set_flags_procname); + FuncLoadError := not assigned(SSL_CTX_dane_set_flags); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_dane_set_flags_allownil)} + SSL_CTX_dane_set_flags := @ERR_SSL_CTX_dane_set_flags; + {$ifend} + {$if declared(SSL_CTX_dane_set_flags_introduced)} + if LibVersion < SSL_CTX_dane_set_flags_introduced then + begin + {$if declared(FC_SSL_CTX_dane_set_flags)} + SSL_CTX_dane_set_flags := @FC_SSL_CTX_dane_set_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_dane_set_flags_removed)} + if SSL_CTX_dane_set_flags_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_dane_set_flags)} + SSL_CTX_dane_set_flags := @_SSL_CTX_dane_set_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_dane_set_flags_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_dane_set_flags'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_CTX_dane_clear_flags := LoadLibFunction(ADllHandle, SSL_CTX_dane_clear_flags_procname); + FuncLoadError := not assigned(SSL_CTX_dane_clear_flags); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_dane_clear_flags_allownil)} + SSL_CTX_dane_clear_flags := @ERR_SSL_CTX_dane_clear_flags; + {$ifend} + {$if declared(SSL_CTX_dane_clear_flags_introduced)} + if LibVersion < SSL_CTX_dane_clear_flags_introduced then + begin + {$if declared(FC_SSL_CTX_dane_clear_flags)} + SSL_CTX_dane_clear_flags := @FC_SSL_CTX_dane_clear_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_dane_clear_flags_removed)} + if SSL_CTX_dane_clear_flags_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_dane_clear_flags)} + SSL_CTX_dane_clear_flags := @_SSL_CTX_dane_clear_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_dane_clear_flags_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_dane_clear_flags'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_dane_set_flags := LoadLibFunction(ADllHandle, SSL_dane_set_flags_procname); + FuncLoadError := not assigned(SSL_dane_set_flags); + if FuncLoadError then + begin + {$if not defined(SSL_dane_set_flags_allownil)} + SSL_dane_set_flags := @ERR_SSL_dane_set_flags; + {$ifend} + {$if declared(SSL_dane_set_flags_introduced)} + if LibVersion < SSL_dane_set_flags_introduced then + begin + {$if declared(FC_SSL_dane_set_flags)} + SSL_dane_set_flags := @FC_SSL_dane_set_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_dane_set_flags_removed)} + if SSL_dane_set_flags_removed <= LibVersion then + begin + {$if declared(_SSL_dane_set_flags)} + SSL_dane_set_flags := @_SSL_dane_set_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_dane_set_flags_allownil)} + if FuncLoadError then + AFailed.Add('SSL_dane_set_flags'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_dane_clear_flags := LoadLibFunction(ADllHandle, SSL_dane_clear_flags_procname); + FuncLoadError := not assigned(SSL_dane_clear_flags); + if FuncLoadError then + begin + {$if not defined(SSL_dane_clear_flags_allownil)} + SSL_dane_clear_flags := @ERR_SSL_dane_clear_flags; + {$ifend} + {$if declared(SSL_dane_clear_flags_introduced)} + if LibVersion < SSL_dane_clear_flags_introduced then + begin + {$if declared(FC_SSL_dane_clear_flags)} + SSL_dane_clear_flags := @FC_SSL_dane_clear_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_dane_clear_flags_removed)} + if SSL_dane_clear_flags_removed <= LibVersion then + begin + {$if declared(_SSL_dane_clear_flags)} + SSL_dane_clear_flags := @_SSL_dane_clear_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_dane_clear_flags_allownil)} + if FuncLoadError then + AFailed.Add('SSL_dane_clear_flags'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_CTX_set1_param := LoadLibFunction(ADllHandle, SSL_CTX_set1_param_procname); + FuncLoadError := not assigned(SSL_CTX_set1_param); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_set1_param_allownil)} + SSL_CTX_set1_param := @ERR_SSL_CTX_set1_param; + {$ifend} + {$if declared(SSL_CTX_set1_param_introduced)} + if LibVersion < SSL_CTX_set1_param_introduced then + begin + {$if declared(FC_SSL_CTX_set1_param)} + SSL_CTX_set1_param := @FC_SSL_CTX_set1_param; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_set1_param_removed)} + if SSL_CTX_set1_param_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_set1_param)} + SSL_CTX_set1_param := @_SSL_CTX_set1_param; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_set1_param_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_set1_param'); + {$ifend} + end; + + + SSL_set1_param := LoadLibFunction(ADllHandle, SSL_set1_param_procname); + FuncLoadError := not assigned(SSL_set1_param); + if FuncLoadError then + begin + {$if not defined(SSL_set1_param_allownil)} + SSL_set1_param := @ERR_SSL_set1_param; + {$ifend} + {$if declared(SSL_set1_param_introduced)} + if LibVersion < SSL_set1_param_introduced then + begin + {$if declared(FC_SSL_set1_param)} + SSL_set1_param := @FC_SSL_set1_param; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_set1_param_removed)} + if SSL_set1_param_removed <= LibVersion then + begin + {$if declared(_SSL_set1_param)} + SSL_set1_param := @_SSL_set1_param; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_set1_param_allownil)} + if FuncLoadError then + AFailed.Add('SSL_set1_param'); + {$ifend} + end; + + + SSL_CTX_get0_param := LoadLibFunction(ADllHandle, SSL_CTX_get0_param_procname); + FuncLoadError := not assigned(SSL_CTX_get0_param); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_get0_param_allownil)} + SSL_CTX_get0_param := @ERR_SSL_CTX_get0_param; + {$ifend} + {$if declared(SSL_CTX_get0_param_introduced)} + if LibVersion < SSL_CTX_get0_param_introduced then + begin + {$if declared(FC_SSL_CTX_get0_param)} + SSL_CTX_get0_param := @FC_SSL_CTX_get0_param; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_get0_param_removed)} + if SSL_CTX_get0_param_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_get0_param)} + SSL_CTX_get0_param := @_SSL_CTX_get0_param; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_get0_param_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_get0_param'); + {$ifend} + end; + + + SSL_get0_param := LoadLibFunction(ADllHandle, SSL_get0_param_procname); + FuncLoadError := not assigned(SSL_get0_param); + if FuncLoadError then + begin + {$if not defined(SSL_get0_param_allownil)} + SSL_get0_param := @ERR_SSL_get0_param; + {$ifend} + {$if declared(SSL_get0_param_introduced)} + if LibVersion < SSL_get0_param_introduced then + begin + {$if declared(FC_SSL_get0_param)} + SSL_get0_param := @FC_SSL_get0_param; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_get0_param_removed)} + if SSL_get0_param_removed <= LibVersion then + begin + {$if declared(_SSL_get0_param)} + SSL_get0_param := @_SSL_get0_param; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_get0_param_allownil)} + if FuncLoadError then + AFailed.Add('SSL_get0_param'); + {$ifend} + end; + + + SSL_CTX_set_srp_username := LoadLibFunction(ADllHandle, SSL_CTX_set_srp_username_procname); + FuncLoadError := not assigned(SSL_CTX_set_srp_username); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_set_srp_username_allownil)} + SSL_CTX_set_srp_username := @ERR_SSL_CTX_set_srp_username; + {$ifend} + {$if declared(SSL_CTX_set_srp_username_introduced)} + if LibVersion < SSL_CTX_set_srp_username_introduced then + begin + {$if declared(FC_SSL_CTX_set_srp_username)} + SSL_CTX_set_srp_username := @FC_SSL_CTX_set_srp_username; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_set_srp_username_removed)} + if SSL_CTX_set_srp_username_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_set_srp_username)} + SSL_CTX_set_srp_username := @_SSL_CTX_set_srp_username; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_set_srp_username_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_set_srp_username'); + {$ifend} + end; + + + SSL_CTX_set_srp_password := LoadLibFunction(ADllHandle, SSL_CTX_set_srp_password_procname); + FuncLoadError := not assigned(SSL_CTX_set_srp_password); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_set_srp_password_allownil)} + SSL_CTX_set_srp_password := @ERR_SSL_CTX_set_srp_password; + {$ifend} + {$if declared(SSL_CTX_set_srp_password_introduced)} + if LibVersion < SSL_CTX_set_srp_password_introduced then + begin + {$if declared(FC_SSL_CTX_set_srp_password)} + SSL_CTX_set_srp_password := @FC_SSL_CTX_set_srp_password; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_set_srp_password_removed)} + if SSL_CTX_set_srp_password_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_set_srp_password)} + SSL_CTX_set_srp_password := @_SSL_CTX_set_srp_password; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_set_srp_password_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_set_srp_password'); + {$ifend} + end; + + + SSL_CTX_set_srp_strength := LoadLibFunction(ADllHandle, SSL_CTX_set_srp_strength_procname); + FuncLoadError := not assigned(SSL_CTX_set_srp_strength); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_set_srp_strength_allownil)} + SSL_CTX_set_srp_strength := @ERR_SSL_CTX_set_srp_strength; + {$ifend} + {$if declared(SSL_CTX_set_srp_strength_introduced)} + if LibVersion < SSL_CTX_set_srp_strength_introduced then + begin + {$if declared(FC_SSL_CTX_set_srp_strength)} + SSL_CTX_set_srp_strength := @FC_SSL_CTX_set_srp_strength; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_set_srp_strength_removed)} + if SSL_CTX_set_srp_strength_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_set_srp_strength)} + SSL_CTX_set_srp_strength := @_SSL_CTX_set_srp_strength; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_set_srp_strength_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_set_srp_strength'); + {$ifend} + end; + + + SSL_CTX_set_srp_client_pwd_callback := LoadLibFunction(ADllHandle, SSL_CTX_set_srp_client_pwd_callback_procname); + FuncLoadError := not assigned(SSL_CTX_set_srp_client_pwd_callback); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_set_srp_client_pwd_callback_allownil)} + SSL_CTX_set_srp_client_pwd_callback := @ERR_SSL_CTX_set_srp_client_pwd_callback; + {$ifend} + {$if declared(SSL_CTX_set_srp_client_pwd_callback_introduced)} + if LibVersion < SSL_CTX_set_srp_client_pwd_callback_introduced then + begin + {$if declared(FC_SSL_CTX_set_srp_client_pwd_callback)} + SSL_CTX_set_srp_client_pwd_callback := @FC_SSL_CTX_set_srp_client_pwd_callback; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_set_srp_client_pwd_callback_removed)} + if SSL_CTX_set_srp_client_pwd_callback_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_set_srp_client_pwd_callback)} + SSL_CTX_set_srp_client_pwd_callback := @_SSL_CTX_set_srp_client_pwd_callback; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_set_srp_client_pwd_callback_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_set_srp_client_pwd_callback'); + {$ifend} + end; + + + SSL_CTX_set_srp_verify_param_callback := LoadLibFunction(ADllHandle, SSL_CTX_set_srp_verify_param_callback_procname); + FuncLoadError := not assigned(SSL_CTX_set_srp_verify_param_callback); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_set_srp_verify_param_callback_allownil)} + SSL_CTX_set_srp_verify_param_callback := @ERR_SSL_CTX_set_srp_verify_param_callback; + {$ifend} + {$if declared(SSL_CTX_set_srp_verify_param_callback_introduced)} + if LibVersion < SSL_CTX_set_srp_verify_param_callback_introduced then + begin + {$if declared(FC_SSL_CTX_set_srp_verify_param_callback)} + SSL_CTX_set_srp_verify_param_callback := @FC_SSL_CTX_set_srp_verify_param_callback; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_set_srp_verify_param_callback_removed)} + if SSL_CTX_set_srp_verify_param_callback_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_set_srp_verify_param_callback)} + SSL_CTX_set_srp_verify_param_callback := @_SSL_CTX_set_srp_verify_param_callback; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_set_srp_verify_param_callback_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_set_srp_verify_param_callback'); + {$ifend} + end; + + + SSL_CTX_set_srp_username_callback := LoadLibFunction(ADllHandle, SSL_CTX_set_srp_username_callback_procname); + FuncLoadError := not assigned(SSL_CTX_set_srp_username_callback); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_set_srp_username_callback_allownil)} + SSL_CTX_set_srp_username_callback := @ERR_SSL_CTX_set_srp_username_callback; + {$ifend} + {$if declared(SSL_CTX_set_srp_username_callback_introduced)} + if LibVersion < SSL_CTX_set_srp_username_callback_introduced then + begin + {$if declared(FC_SSL_CTX_set_srp_username_callback)} + SSL_CTX_set_srp_username_callback := @FC_SSL_CTX_set_srp_username_callback; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_set_srp_username_callback_removed)} + if SSL_CTX_set_srp_username_callback_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_set_srp_username_callback)} + SSL_CTX_set_srp_username_callback := @_SSL_CTX_set_srp_username_callback; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_set_srp_username_callback_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_set_srp_username_callback'); + {$ifend} + end; + + + SSL_CTX_set_srp_cb_arg := LoadLibFunction(ADllHandle, SSL_CTX_set_srp_cb_arg_procname); + FuncLoadError := not assigned(SSL_CTX_set_srp_cb_arg); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_set_srp_cb_arg_allownil)} + SSL_CTX_set_srp_cb_arg := @ERR_SSL_CTX_set_srp_cb_arg; + {$ifend} + {$if declared(SSL_CTX_set_srp_cb_arg_introduced)} + if LibVersion < SSL_CTX_set_srp_cb_arg_introduced then + begin + {$if declared(FC_SSL_CTX_set_srp_cb_arg)} + SSL_CTX_set_srp_cb_arg := @FC_SSL_CTX_set_srp_cb_arg; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_set_srp_cb_arg_removed)} + if SSL_CTX_set_srp_cb_arg_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_set_srp_cb_arg)} + SSL_CTX_set_srp_cb_arg := @_SSL_CTX_set_srp_cb_arg; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_set_srp_cb_arg_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_set_srp_cb_arg'); + {$ifend} + end; + + + SSL_set_srp_server_param := LoadLibFunction(ADllHandle, SSL_set_srp_server_param_procname); + FuncLoadError := not assigned(SSL_set_srp_server_param); + if FuncLoadError then + begin + {$if not defined(SSL_set_srp_server_param_allownil)} + SSL_set_srp_server_param := @ERR_SSL_set_srp_server_param; + {$ifend} + {$if declared(SSL_set_srp_server_param_introduced)} + if LibVersion < SSL_set_srp_server_param_introduced then + begin + {$if declared(FC_SSL_set_srp_server_param)} + SSL_set_srp_server_param := @FC_SSL_set_srp_server_param; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_set_srp_server_param_removed)} + if SSL_set_srp_server_param_removed <= LibVersion then + begin + {$if declared(_SSL_set_srp_server_param)} + SSL_set_srp_server_param := @_SSL_set_srp_server_param; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_set_srp_server_param_allownil)} + if FuncLoadError then + AFailed.Add('SSL_set_srp_server_param'); + {$ifend} + end; + + + SSL_set_srp_server_param_pw := LoadLibFunction(ADllHandle, SSL_set_srp_server_param_pw_procname); + FuncLoadError := not assigned(SSL_set_srp_server_param_pw); + if FuncLoadError then + begin + {$if not defined(SSL_set_srp_server_param_pw_allownil)} + SSL_set_srp_server_param_pw := @ERR_SSL_set_srp_server_param_pw; + {$ifend} + {$if declared(SSL_set_srp_server_param_pw_introduced)} + if LibVersion < SSL_set_srp_server_param_pw_introduced then + begin + {$if declared(FC_SSL_set_srp_server_param_pw)} + SSL_set_srp_server_param_pw := @FC_SSL_set_srp_server_param_pw; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_set_srp_server_param_pw_removed)} + if SSL_set_srp_server_param_pw_removed <= LibVersion then + begin + {$if declared(_SSL_set_srp_server_param_pw)} + SSL_set_srp_server_param_pw := @_SSL_set_srp_server_param_pw; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_set_srp_server_param_pw_allownil)} + if FuncLoadError then + AFailed.Add('SSL_set_srp_server_param_pw'); + {$ifend} + end; + + + SSL_CTX_set_client_hello_cb := LoadLibFunction(ADllHandle, SSL_CTX_set_client_hello_cb_procname); + FuncLoadError := not assigned(SSL_CTX_set_client_hello_cb); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_set_client_hello_cb_allownil)} + SSL_CTX_set_client_hello_cb := @ERR_SSL_CTX_set_client_hello_cb; + {$ifend} + {$if declared(SSL_CTX_set_client_hello_cb_introduced)} + if LibVersion < SSL_CTX_set_client_hello_cb_introduced then + begin + {$if declared(FC_SSL_CTX_set_client_hello_cb)} + SSL_CTX_set_client_hello_cb := @FC_SSL_CTX_set_client_hello_cb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_set_client_hello_cb_removed)} + if SSL_CTX_set_client_hello_cb_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_set_client_hello_cb)} + SSL_CTX_set_client_hello_cb := @_SSL_CTX_set_client_hello_cb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_set_client_hello_cb_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_set_client_hello_cb'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_client_hello_isv2 := LoadLibFunction(ADllHandle, SSL_client_hello_isv2_procname); + FuncLoadError := not assigned(SSL_client_hello_isv2); + if FuncLoadError then + begin + {$if not defined(SSL_client_hello_isv2_allownil)} + SSL_client_hello_isv2 := @ERR_SSL_client_hello_isv2; + {$ifend} + {$if declared(SSL_client_hello_isv2_introduced)} + if LibVersion < SSL_client_hello_isv2_introduced then + begin + {$if declared(FC_SSL_client_hello_isv2)} + SSL_client_hello_isv2 := @FC_SSL_client_hello_isv2; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_client_hello_isv2_removed)} + if SSL_client_hello_isv2_removed <= LibVersion then + begin + {$if declared(_SSL_client_hello_isv2)} + SSL_client_hello_isv2 := @_SSL_client_hello_isv2; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_client_hello_isv2_allownil)} + if FuncLoadError then + AFailed.Add('SSL_client_hello_isv2'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_client_hello_get0_legacy_version := LoadLibFunction(ADllHandle, SSL_client_hello_get0_legacy_version_procname); + FuncLoadError := not assigned(SSL_client_hello_get0_legacy_version); + if FuncLoadError then + begin + {$if not defined(SSL_client_hello_get0_legacy_version_allownil)} + SSL_client_hello_get0_legacy_version := @ERR_SSL_client_hello_get0_legacy_version; + {$ifend} + {$if declared(SSL_client_hello_get0_legacy_version_introduced)} + if LibVersion < SSL_client_hello_get0_legacy_version_introduced then + begin + {$if declared(FC_SSL_client_hello_get0_legacy_version)} + SSL_client_hello_get0_legacy_version := @FC_SSL_client_hello_get0_legacy_version; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_client_hello_get0_legacy_version_removed)} + if SSL_client_hello_get0_legacy_version_removed <= LibVersion then + begin + {$if declared(_SSL_client_hello_get0_legacy_version)} + SSL_client_hello_get0_legacy_version := @_SSL_client_hello_get0_legacy_version; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_client_hello_get0_legacy_version_allownil)} + if FuncLoadError then + AFailed.Add('SSL_client_hello_get0_legacy_version'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_client_hello_get0_random := LoadLibFunction(ADllHandle, SSL_client_hello_get0_random_procname); + FuncLoadError := not assigned(SSL_client_hello_get0_random); + if FuncLoadError then + begin + {$if not defined(SSL_client_hello_get0_random_allownil)} + SSL_client_hello_get0_random := @ERR_SSL_client_hello_get0_random; + {$ifend} + {$if declared(SSL_client_hello_get0_random_introduced)} + if LibVersion < SSL_client_hello_get0_random_introduced then + begin + {$if declared(FC_SSL_client_hello_get0_random)} + SSL_client_hello_get0_random := @FC_SSL_client_hello_get0_random; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_client_hello_get0_random_removed)} + if SSL_client_hello_get0_random_removed <= LibVersion then + begin + {$if declared(_SSL_client_hello_get0_random)} + SSL_client_hello_get0_random := @_SSL_client_hello_get0_random; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_client_hello_get0_random_allownil)} + if FuncLoadError then + AFailed.Add('SSL_client_hello_get0_random'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_client_hello_get0_session_id := LoadLibFunction(ADllHandle, SSL_client_hello_get0_session_id_procname); + FuncLoadError := not assigned(SSL_client_hello_get0_session_id); + if FuncLoadError then + begin + {$if not defined(SSL_client_hello_get0_session_id_allownil)} + SSL_client_hello_get0_session_id := @ERR_SSL_client_hello_get0_session_id; + {$ifend} + {$if declared(SSL_client_hello_get0_session_id_introduced)} + if LibVersion < SSL_client_hello_get0_session_id_introduced then + begin + {$if declared(FC_SSL_client_hello_get0_session_id)} + SSL_client_hello_get0_session_id := @FC_SSL_client_hello_get0_session_id; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_client_hello_get0_session_id_removed)} + if SSL_client_hello_get0_session_id_removed <= LibVersion then + begin + {$if declared(_SSL_client_hello_get0_session_id)} + SSL_client_hello_get0_session_id := @_SSL_client_hello_get0_session_id; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_client_hello_get0_session_id_allownil)} + if FuncLoadError then + AFailed.Add('SSL_client_hello_get0_session_id'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_client_hello_get0_ciphers := LoadLibFunction(ADllHandle, SSL_client_hello_get0_ciphers_procname); + FuncLoadError := not assigned(SSL_client_hello_get0_ciphers); + if FuncLoadError then + begin + {$if not defined(SSL_client_hello_get0_ciphers_allownil)} + SSL_client_hello_get0_ciphers := @ERR_SSL_client_hello_get0_ciphers; + {$ifend} + {$if declared(SSL_client_hello_get0_ciphers_introduced)} + if LibVersion < SSL_client_hello_get0_ciphers_introduced then + begin + {$if declared(FC_SSL_client_hello_get0_ciphers)} + SSL_client_hello_get0_ciphers := @FC_SSL_client_hello_get0_ciphers; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_client_hello_get0_ciphers_removed)} + if SSL_client_hello_get0_ciphers_removed <= LibVersion then + begin + {$if declared(_SSL_client_hello_get0_ciphers)} + SSL_client_hello_get0_ciphers := @_SSL_client_hello_get0_ciphers; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_client_hello_get0_ciphers_allownil)} + if FuncLoadError then + AFailed.Add('SSL_client_hello_get0_ciphers'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_client_hello_get0_compression_methods := LoadLibFunction(ADllHandle, SSL_client_hello_get0_compression_methods_procname); + FuncLoadError := not assigned(SSL_client_hello_get0_compression_methods); + if FuncLoadError then + begin + {$if not defined(SSL_client_hello_get0_compression_methods_allownil)} + SSL_client_hello_get0_compression_methods := @ERR_SSL_client_hello_get0_compression_methods; + {$ifend} + {$if declared(SSL_client_hello_get0_compression_methods_introduced)} + if LibVersion < SSL_client_hello_get0_compression_methods_introduced then + begin + {$if declared(FC_SSL_client_hello_get0_compression_methods)} + SSL_client_hello_get0_compression_methods := @FC_SSL_client_hello_get0_compression_methods; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_client_hello_get0_compression_methods_removed)} + if SSL_client_hello_get0_compression_methods_removed <= LibVersion then + begin + {$if declared(_SSL_client_hello_get0_compression_methods)} + SSL_client_hello_get0_compression_methods := @_SSL_client_hello_get0_compression_methods; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_client_hello_get0_compression_methods_allownil)} + if FuncLoadError then + AFailed.Add('SSL_client_hello_get0_compression_methods'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_client_hello_get1_extensions_present := LoadLibFunction(ADllHandle, SSL_client_hello_get1_extensions_present_procname); + FuncLoadError := not assigned(SSL_client_hello_get1_extensions_present); + if FuncLoadError then + begin + {$if not defined(SSL_client_hello_get1_extensions_present_allownil)} + SSL_client_hello_get1_extensions_present := @ERR_SSL_client_hello_get1_extensions_present; + {$ifend} + {$if declared(SSL_client_hello_get1_extensions_present_introduced)} + if LibVersion < SSL_client_hello_get1_extensions_present_introduced then + begin + {$if declared(FC_SSL_client_hello_get1_extensions_present)} + SSL_client_hello_get1_extensions_present := @FC_SSL_client_hello_get1_extensions_present; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_client_hello_get1_extensions_present_removed)} + if SSL_client_hello_get1_extensions_present_removed <= LibVersion then + begin + {$if declared(_SSL_client_hello_get1_extensions_present)} + SSL_client_hello_get1_extensions_present := @_SSL_client_hello_get1_extensions_present; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_client_hello_get1_extensions_present_allownil)} + if FuncLoadError then + AFailed.Add('SSL_client_hello_get1_extensions_present'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_client_hello_get0_ext := LoadLibFunction(ADllHandle, SSL_client_hello_get0_ext_procname); + FuncLoadError := not assigned(SSL_client_hello_get0_ext); + if FuncLoadError then + begin + {$if not defined(SSL_client_hello_get0_ext_allownil)} + SSL_client_hello_get0_ext := @ERR_SSL_client_hello_get0_ext; + {$ifend} + {$if declared(SSL_client_hello_get0_ext_introduced)} + if LibVersion < SSL_client_hello_get0_ext_introduced then + begin + {$if declared(FC_SSL_client_hello_get0_ext)} + SSL_client_hello_get0_ext := @FC_SSL_client_hello_get0_ext; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_client_hello_get0_ext_removed)} + if SSL_client_hello_get0_ext_removed <= LibVersion then + begin + {$if declared(_SSL_client_hello_get0_ext)} + SSL_client_hello_get0_ext := @_SSL_client_hello_get0_ext; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_client_hello_get0_ext_allownil)} + if FuncLoadError then + AFailed.Add('SSL_client_hello_get0_ext'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_certs_clear := LoadLibFunction(ADllHandle, SSL_certs_clear_procname); + FuncLoadError := not assigned(SSL_certs_clear); + if FuncLoadError then + begin + {$if not defined(SSL_certs_clear_allownil)} + SSL_certs_clear := @ERR_SSL_certs_clear; + {$ifend} + {$if declared(SSL_certs_clear_introduced)} + if LibVersion < SSL_certs_clear_introduced then + begin + {$if declared(FC_SSL_certs_clear)} + SSL_certs_clear := @FC_SSL_certs_clear; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_certs_clear_removed)} + if SSL_certs_clear_removed <= LibVersion then + begin + {$if declared(_SSL_certs_clear)} + SSL_certs_clear := @_SSL_certs_clear; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_certs_clear_allownil)} + if FuncLoadError then + AFailed.Add('SSL_certs_clear'); + {$ifend} + end; + + + SSL_free := LoadLibFunction(ADllHandle, SSL_free_procname); + FuncLoadError := not assigned(SSL_free); + if FuncLoadError then + begin + {$if not defined(SSL_free_allownil)} + SSL_free := @ERR_SSL_free; + {$ifend} + {$if declared(SSL_free_introduced)} + if LibVersion < SSL_free_introduced then + begin + {$if declared(FC_SSL_free)} + SSL_free := @FC_SSL_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_free_removed)} + if SSL_free_removed <= LibVersion then + begin + {$if declared(_SSL_free)} + SSL_free := @_SSL_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_free_allownil)} + if FuncLoadError then + AFailed.Add('SSL_free'); + {$ifend} + end; + + + SSL_waiting_for_async := LoadLibFunction(ADllHandle, SSL_waiting_for_async_procname); + FuncLoadError := not assigned(SSL_waiting_for_async); + if FuncLoadError then + begin + {$if not defined(SSL_waiting_for_async_allownil)} + SSL_waiting_for_async := @ERR_SSL_waiting_for_async; + {$ifend} + {$if declared(SSL_waiting_for_async_introduced)} + if LibVersion < SSL_waiting_for_async_introduced then + begin + {$if declared(FC_SSL_waiting_for_async)} + SSL_waiting_for_async := @FC_SSL_waiting_for_async; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_waiting_for_async_removed)} + if SSL_waiting_for_async_removed <= LibVersion then + begin + {$if declared(_SSL_waiting_for_async)} + SSL_waiting_for_async := @_SSL_waiting_for_async; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_waiting_for_async_allownil)} + if FuncLoadError then + AFailed.Add('SSL_waiting_for_async'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_get_all_async_fds := LoadLibFunction(ADllHandle, SSL_get_all_async_fds_procname); + FuncLoadError := not assigned(SSL_get_all_async_fds); + if FuncLoadError then + begin + {$if not defined(SSL_get_all_async_fds_allownil)} + SSL_get_all_async_fds := @ERR_SSL_get_all_async_fds; + {$ifend} + {$if declared(SSL_get_all_async_fds_introduced)} + if LibVersion < SSL_get_all_async_fds_introduced then + begin + {$if declared(FC_SSL_get_all_async_fds)} + SSL_get_all_async_fds := @FC_SSL_get_all_async_fds; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_get_all_async_fds_removed)} + if SSL_get_all_async_fds_removed <= LibVersion then + begin + {$if declared(_SSL_get_all_async_fds)} + SSL_get_all_async_fds := @_SSL_get_all_async_fds; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_get_all_async_fds_allownil)} + if FuncLoadError then + AFailed.Add('SSL_get_all_async_fds'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_get_changed_async_fds := LoadLibFunction(ADllHandle, SSL_get_changed_async_fds_procname); + FuncLoadError := not assigned(SSL_get_changed_async_fds); + if FuncLoadError then + begin + {$if not defined(SSL_get_changed_async_fds_allownil)} + SSL_get_changed_async_fds := @ERR_SSL_get_changed_async_fds; + {$ifend} + {$if declared(SSL_get_changed_async_fds_introduced)} + if LibVersion < SSL_get_changed_async_fds_introduced then + begin + {$if declared(FC_SSL_get_changed_async_fds)} + SSL_get_changed_async_fds := @FC_SSL_get_changed_async_fds; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_get_changed_async_fds_removed)} + if SSL_get_changed_async_fds_removed <= LibVersion then + begin + {$if declared(_SSL_get_changed_async_fds)} + SSL_get_changed_async_fds := @_SSL_get_changed_async_fds; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_get_changed_async_fds_allownil)} + if FuncLoadError then + AFailed.Add('SSL_get_changed_async_fds'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_accept := LoadLibFunction(ADllHandle, SSL_accept_procname); + FuncLoadError := not assigned(SSL_accept); + if FuncLoadError then + begin + {$if not defined(SSL_accept_allownil)} + SSL_accept := @ERR_SSL_accept; + {$ifend} + {$if declared(SSL_accept_introduced)} + if LibVersion < SSL_accept_introduced then + begin + {$if declared(FC_SSL_accept)} + SSL_accept := @FC_SSL_accept; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_accept_removed)} + if SSL_accept_removed <= LibVersion then + begin + {$if declared(_SSL_accept)} + SSL_accept := @_SSL_accept; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_accept_allownil)} + if FuncLoadError then + AFailed.Add('SSL_accept'); + {$ifend} + end; + + + SSL_stateless := LoadLibFunction(ADllHandle, SSL_stateless_procname); + FuncLoadError := not assigned(SSL_stateless); + if FuncLoadError then + begin + {$if not defined(SSL_stateless_allownil)} + SSL_stateless := @ERR_SSL_stateless; + {$ifend} + {$if declared(SSL_stateless_introduced)} + if LibVersion < SSL_stateless_introduced then + begin + {$if declared(FC_SSL_stateless)} + SSL_stateless := @FC_SSL_stateless; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_stateless_removed)} + if SSL_stateless_removed <= LibVersion then + begin + {$if declared(_SSL_stateless)} + SSL_stateless := @_SSL_stateless; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_stateless_allownil)} + if FuncLoadError then + AFailed.Add('SSL_stateless'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_connect := LoadLibFunction(ADllHandle, SSL_connect_procname); + FuncLoadError := not assigned(SSL_connect); + if FuncLoadError then + begin + {$if not defined(SSL_connect_allownil)} + SSL_connect := @ERR_SSL_connect; + {$ifend} + {$if declared(SSL_connect_introduced)} + if LibVersion < SSL_connect_introduced then + begin + {$if declared(FC_SSL_connect)} + SSL_connect := @FC_SSL_connect; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_connect_removed)} + if SSL_connect_removed <= LibVersion then + begin + {$if declared(_SSL_connect)} + SSL_connect := @_SSL_connect; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_connect_allownil)} + if FuncLoadError then + AFailed.Add('SSL_connect'); + {$ifend} + end; + + + SSL_read := LoadLibFunction(ADllHandle, SSL_read_procname); + FuncLoadError := not assigned(SSL_read); + if FuncLoadError then + begin + {$if not defined(SSL_read_allownil)} + SSL_read := @ERR_SSL_read; + {$ifend} + {$if declared(SSL_read_introduced)} + if LibVersion < SSL_read_introduced then + begin + {$if declared(FC_SSL_read)} + SSL_read := @FC_SSL_read; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_read_removed)} + if SSL_read_removed <= LibVersion then + begin + {$if declared(_SSL_read)} + SSL_read := @_SSL_read; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_read_allownil)} + if FuncLoadError then + AFailed.Add('SSL_read'); + {$ifend} + end; + + + SSL_read_ex := LoadLibFunction(ADllHandle, SSL_read_ex_procname); + FuncLoadError := not assigned(SSL_read_ex); + if FuncLoadError then + begin + {$if not defined(SSL_read_ex_allownil)} + SSL_read_ex := @ERR_SSL_read_ex; + {$ifend} + {$if declared(SSL_read_ex_introduced)} + if LibVersion < SSL_read_ex_introduced then + begin + {$if declared(FC_SSL_read_ex)} + SSL_read_ex := @FC_SSL_read_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_read_ex_removed)} + if SSL_read_ex_removed <= LibVersion then + begin + {$if declared(_SSL_read_ex)} + SSL_read_ex := @_SSL_read_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_read_ex_allownil)} + if FuncLoadError then + AFailed.Add('SSL_read_ex'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_read_early_data := LoadLibFunction(ADllHandle, SSL_read_early_data_procname); + FuncLoadError := not assigned(SSL_read_early_data); + if FuncLoadError then + begin + {$if not defined(SSL_read_early_data_allownil)} + SSL_read_early_data := @ERR_SSL_read_early_data; + {$ifend} + {$if declared(SSL_read_early_data_introduced)} + if LibVersion < SSL_read_early_data_introduced then + begin + {$if declared(FC_SSL_read_early_data)} + SSL_read_early_data := @FC_SSL_read_early_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_read_early_data_removed)} + if SSL_read_early_data_removed <= LibVersion then + begin + {$if declared(_SSL_read_early_data)} + SSL_read_early_data := @_SSL_read_early_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_read_early_data_allownil)} + if FuncLoadError then + AFailed.Add('SSL_read_early_data'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_peek := LoadLibFunction(ADllHandle, SSL_peek_procname); + FuncLoadError := not assigned(SSL_peek); + if FuncLoadError then + begin + {$if not defined(SSL_peek_allownil)} + SSL_peek := @ERR_SSL_peek; + {$ifend} + {$if declared(SSL_peek_introduced)} + if LibVersion < SSL_peek_introduced then + begin + {$if declared(FC_SSL_peek)} + SSL_peek := @FC_SSL_peek; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_peek_removed)} + if SSL_peek_removed <= LibVersion then + begin + {$if declared(_SSL_peek)} + SSL_peek := @_SSL_peek; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_peek_allownil)} + if FuncLoadError then + AFailed.Add('SSL_peek'); + {$ifend} + end; + + + SSL_peek_ex := LoadLibFunction(ADllHandle, SSL_peek_ex_procname); + FuncLoadError := not assigned(SSL_peek_ex); + if FuncLoadError then + begin + {$if not defined(SSL_peek_ex_allownil)} + SSL_peek_ex := @ERR_SSL_peek_ex; + {$ifend} + {$if declared(SSL_peek_ex_introduced)} + if LibVersion < SSL_peek_ex_introduced then + begin + {$if declared(FC_SSL_peek_ex)} + SSL_peek_ex := @FC_SSL_peek_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_peek_ex_removed)} + if SSL_peek_ex_removed <= LibVersion then + begin + {$if declared(_SSL_peek_ex)} + SSL_peek_ex := @_SSL_peek_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_peek_ex_allownil)} + if FuncLoadError then + AFailed.Add('SSL_peek_ex'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_write := LoadLibFunction(ADllHandle, SSL_write_procname); + FuncLoadError := not assigned(SSL_write); + if FuncLoadError then + begin + {$if not defined(SSL_write_allownil)} + SSL_write := @ERR_SSL_write; + {$ifend} + {$if declared(SSL_write_introduced)} + if LibVersion < SSL_write_introduced then + begin + {$if declared(FC_SSL_write)} + SSL_write := @FC_SSL_write; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_write_removed)} + if SSL_write_removed <= LibVersion then + begin + {$if declared(_SSL_write)} + SSL_write := @_SSL_write; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_write_allownil)} + if FuncLoadError then + AFailed.Add('SSL_write'); + {$ifend} + end; + + + SSL_write_ex := LoadLibFunction(ADllHandle, SSL_write_ex_procname); + FuncLoadError := not assigned(SSL_write_ex); + if FuncLoadError then + begin + {$if not defined(SSL_write_ex_allownil)} + SSL_write_ex := @ERR_SSL_write_ex; + {$ifend} + {$if declared(SSL_write_ex_introduced)} + if LibVersion < SSL_write_ex_introduced then + begin + {$if declared(FC_SSL_write_ex)} + SSL_write_ex := @FC_SSL_write_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_write_ex_removed)} + if SSL_write_ex_removed <= LibVersion then + begin + {$if declared(_SSL_write_ex)} + SSL_write_ex := @_SSL_write_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_write_ex_allownil)} + if FuncLoadError then + AFailed.Add('SSL_write_ex'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_write_early_data := LoadLibFunction(ADllHandle, SSL_write_early_data_procname); + FuncLoadError := not assigned(SSL_write_early_data); + if FuncLoadError then + begin + {$if not defined(SSL_write_early_data_allownil)} + SSL_write_early_data := @ERR_SSL_write_early_data; + {$ifend} + {$if declared(SSL_write_early_data_introduced)} + if LibVersion < SSL_write_early_data_introduced then + begin + {$if declared(FC_SSL_write_early_data)} + SSL_write_early_data := @FC_SSL_write_early_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_write_early_data_removed)} + if SSL_write_early_data_removed <= LibVersion then + begin + {$if declared(_SSL_write_early_data)} + SSL_write_early_data := @_SSL_write_early_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_write_early_data_allownil)} + if FuncLoadError then + AFailed.Add('SSL_write_early_data'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_callback_ctrl := LoadLibFunction(ADllHandle, SSL_callback_ctrl_procname); + FuncLoadError := not assigned(SSL_callback_ctrl); + if FuncLoadError then + begin + {$if not defined(SSL_callback_ctrl_allownil)} + SSL_callback_ctrl := @ERR_SSL_callback_ctrl; + {$ifend} + {$if declared(SSL_callback_ctrl_introduced)} + if LibVersion < SSL_callback_ctrl_introduced then + begin + {$if declared(FC_SSL_callback_ctrl)} + SSL_callback_ctrl := @FC_SSL_callback_ctrl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_callback_ctrl_removed)} + if SSL_callback_ctrl_removed <= LibVersion then + begin + {$if declared(_SSL_callback_ctrl)} + SSL_callback_ctrl := @_SSL_callback_ctrl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_callback_ctrl_allownil)} + if FuncLoadError then + AFailed.Add('SSL_callback_ctrl'); + {$ifend} + end; + + + SSL_ctrl := LoadLibFunction(ADllHandle, SSL_ctrl_procname); + FuncLoadError := not assigned(SSL_ctrl); + if FuncLoadError then + begin + {$if not defined(SSL_ctrl_allownil)} + SSL_ctrl := @ERR_SSL_ctrl; + {$ifend} + {$if declared(SSL_ctrl_introduced)} + if LibVersion < SSL_ctrl_introduced then + begin + {$if declared(FC_SSL_ctrl)} + SSL_ctrl := @FC_SSL_ctrl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_ctrl_removed)} + if SSL_ctrl_removed <= LibVersion then + begin + {$if declared(_SSL_ctrl)} + SSL_ctrl := @_SSL_ctrl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_ctrl_allownil)} + if FuncLoadError then + AFailed.Add('SSL_ctrl'); + {$ifend} + end; + + + SSL_CTX_ctrl := LoadLibFunction(ADllHandle, SSL_CTX_ctrl_procname); + FuncLoadError := not assigned(SSL_CTX_ctrl); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_ctrl_allownil)} + SSL_CTX_ctrl := @ERR_SSL_CTX_ctrl; + {$ifend} + {$if declared(SSL_CTX_ctrl_introduced)} + if LibVersion < SSL_CTX_ctrl_introduced then + begin + {$if declared(FC_SSL_CTX_ctrl)} + SSL_CTX_ctrl := @FC_SSL_CTX_ctrl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_ctrl_removed)} + if SSL_CTX_ctrl_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_ctrl)} + SSL_CTX_ctrl := @_SSL_CTX_ctrl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_ctrl_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_ctrl'); + {$ifend} + end; + + + SSL_CTX_callback_ctrl := LoadLibFunction(ADllHandle, SSL_CTX_callback_ctrl_procname); + FuncLoadError := not assigned(SSL_CTX_callback_ctrl); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_callback_ctrl_allownil)} + SSL_CTX_callback_ctrl := @ERR_SSL_CTX_callback_ctrl; + {$ifend} + {$if declared(SSL_CTX_callback_ctrl_introduced)} + if LibVersion < SSL_CTX_callback_ctrl_introduced then + begin + {$if declared(FC_SSL_CTX_callback_ctrl)} + SSL_CTX_callback_ctrl := @FC_SSL_CTX_callback_ctrl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_callback_ctrl_removed)} + if SSL_CTX_callback_ctrl_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_callback_ctrl)} + SSL_CTX_callback_ctrl := @_SSL_CTX_callback_ctrl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_callback_ctrl_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_callback_ctrl'); + {$ifend} + end; + + + SSL_get_early_data_status := LoadLibFunction(ADllHandle, SSL_get_early_data_status_procname); + FuncLoadError := not assigned(SSL_get_early_data_status); + if FuncLoadError then + begin + {$if not defined(SSL_get_early_data_status_allownil)} + SSL_get_early_data_status := @ERR_SSL_get_early_data_status; + {$ifend} + {$if declared(SSL_get_early_data_status_introduced)} + if LibVersion < SSL_get_early_data_status_introduced then + begin + {$if declared(FC_SSL_get_early_data_status)} + SSL_get_early_data_status := @FC_SSL_get_early_data_status; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_get_early_data_status_removed)} + if SSL_get_early_data_status_removed <= LibVersion then + begin + {$if declared(_SSL_get_early_data_status)} + SSL_get_early_data_status := @_SSL_get_early_data_status; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_get_early_data_status_allownil)} + if FuncLoadError then + AFailed.Add('SSL_get_early_data_status'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_get_error := LoadLibFunction(ADllHandle, SSL_get_error_procname); + FuncLoadError := not assigned(SSL_get_error); + if FuncLoadError then + begin + {$if not defined(SSL_get_error_allownil)} + SSL_get_error := @ERR_SSL_get_error; + {$ifend} + {$if declared(SSL_get_error_introduced)} + if LibVersion < SSL_get_error_introduced then + begin + {$if declared(FC_SSL_get_error)} + SSL_get_error := @FC_SSL_get_error; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_get_error_removed)} + if SSL_get_error_removed <= LibVersion then + begin + {$if declared(_SSL_get_error)} + SSL_get_error := @_SSL_get_error; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_get_error_allownil)} + if FuncLoadError then + AFailed.Add('SSL_get_error'); + {$ifend} + end; + + + SSL_get_version := LoadLibFunction(ADllHandle, SSL_get_version_procname); + FuncLoadError := not assigned(SSL_get_version); + if FuncLoadError then + begin + {$if not defined(SSL_get_version_allownil)} + SSL_get_version := @ERR_SSL_get_version; + {$ifend} + {$if declared(SSL_get_version_introduced)} + if LibVersion < SSL_get_version_introduced then + begin + {$if declared(FC_SSL_get_version)} + SSL_get_version := @FC_SSL_get_version; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_get_version_removed)} + if SSL_get_version_removed <= LibVersion then + begin + {$if declared(_SSL_get_version)} + SSL_get_version := @_SSL_get_version; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_get_version_allownil)} + if FuncLoadError then + AFailed.Add('SSL_get_version'); + {$ifend} + end; + + + SSL_CTX_set_ssl_version := LoadLibFunction(ADllHandle, SSL_CTX_set_ssl_version_procname); + FuncLoadError := not assigned(SSL_CTX_set_ssl_version); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_set_ssl_version_allownil)} + SSL_CTX_set_ssl_version := @ERR_SSL_CTX_set_ssl_version; + {$ifend} + {$if declared(SSL_CTX_set_ssl_version_introduced)} + if LibVersion < SSL_CTX_set_ssl_version_introduced then + begin + {$if declared(FC_SSL_CTX_set_ssl_version)} + SSL_CTX_set_ssl_version := @FC_SSL_CTX_set_ssl_version; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_set_ssl_version_removed)} + if SSL_CTX_set_ssl_version_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_set_ssl_version)} + SSL_CTX_set_ssl_version := @_SSL_CTX_set_ssl_version; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_set_ssl_version_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_set_ssl_version'); + {$ifend} + end; + + + TLS_method := LoadLibFunction(ADllHandle, TLS_method_procname); + FuncLoadError := not assigned(TLS_method); + if FuncLoadError then + begin + {$if not defined(TLS_method_allownil)} + TLS_method := @ERR_TLS_method; + {$ifend} + {$if declared(TLS_method_introduced)} + if LibVersion < TLS_method_introduced then + begin + {$if declared(FC_TLS_method)} + TLS_method := @FC_TLS_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TLS_method_removed)} + if TLS_method_removed <= LibVersion then + begin + {$if declared(_TLS_method)} + TLS_method := @_TLS_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TLS_method_allownil)} + if FuncLoadError then + AFailed.Add('TLS_method'); + {$ifend} + end; + + {introduced 1.1.0} + TLS_server_method := LoadLibFunction(ADllHandle, TLS_server_method_procname); + FuncLoadError := not assigned(TLS_server_method); + if FuncLoadError then + begin + {$if not defined(TLS_server_method_allownil)} + TLS_server_method := @ERR_TLS_server_method; + {$ifend} + {$if declared(TLS_server_method_introduced)} + if LibVersion < TLS_server_method_introduced then + begin + {$if declared(FC_TLS_server_method)} + TLS_server_method := @FC_TLS_server_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TLS_server_method_removed)} + if TLS_server_method_removed <= LibVersion then + begin + {$if declared(_TLS_server_method)} + TLS_server_method := @_TLS_server_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TLS_server_method_allownil)} + if FuncLoadError then + AFailed.Add('TLS_server_method'); + {$ifend} + end; + + {introduced 1.1.0} + TLS_client_method := LoadLibFunction(ADllHandle, TLS_client_method_procname); + FuncLoadError := not assigned(TLS_client_method); + if FuncLoadError then + begin + {$if not defined(TLS_client_method_allownil)} + TLS_client_method := @ERR_TLS_client_method; + {$ifend} + {$if declared(TLS_client_method_introduced)} + if LibVersion < TLS_client_method_introduced then + begin + {$if declared(FC_TLS_client_method)} + TLS_client_method := @FC_TLS_client_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TLS_client_method_removed)} + if TLS_client_method_removed <= LibVersion then + begin + {$if declared(_TLS_client_method)} + TLS_client_method := @_TLS_client_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TLS_client_method_allownil)} + if FuncLoadError then + AFailed.Add('TLS_client_method'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_key_update := LoadLibFunction(ADllHandle, SSL_key_update_procname); + FuncLoadError := not assigned(SSL_key_update); + if FuncLoadError then + begin + {$if not defined(SSL_key_update_allownil)} + SSL_key_update := @ERR_SSL_key_update; + {$ifend} + {$if declared(SSL_key_update_introduced)} + if LibVersion < SSL_key_update_introduced then + begin + {$if declared(FC_SSL_key_update)} + SSL_key_update := @FC_SSL_key_update; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_key_update_removed)} + if SSL_key_update_removed <= LibVersion then + begin + {$if declared(_SSL_key_update)} + SSL_key_update := @_SSL_key_update; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_key_update_allownil)} + if FuncLoadError then + AFailed.Add('SSL_key_update'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_get_key_update_type := LoadLibFunction(ADllHandle, SSL_get_key_update_type_procname); + FuncLoadError := not assigned(SSL_get_key_update_type); + if FuncLoadError then + begin + {$if not defined(SSL_get_key_update_type_allownil)} + SSL_get_key_update_type := @ERR_SSL_get_key_update_type; + {$ifend} + {$if declared(SSL_get_key_update_type_introduced)} + if LibVersion < SSL_get_key_update_type_introduced then + begin + {$if declared(FC_SSL_get_key_update_type)} + SSL_get_key_update_type := @FC_SSL_get_key_update_type; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_get_key_update_type_removed)} + if SSL_get_key_update_type_removed <= LibVersion then + begin + {$if declared(_SSL_get_key_update_type)} + SSL_get_key_update_type := @_SSL_get_key_update_type; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_get_key_update_type_allownil)} + if FuncLoadError then + AFailed.Add('SSL_get_key_update_type'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_renegotiate := LoadLibFunction(ADllHandle, SSL_renegotiate_procname); + FuncLoadError := not assigned(SSL_renegotiate); + if FuncLoadError then + begin + {$if not defined(SSL_renegotiate_allownil)} + SSL_renegotiate := @ERR_SSL_renegotiate; + {$ifend} + {$if declared(SSL_renegotiate_introduced)} + if LibVersion < SSL_renegotiate_introduced then + begin + {$if declared(FC_SSL_renegotiate)} + SSL_renegotiate := @FC_SSL_renegotiate; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_renegotiate_removed)} + if SSL_renegotiate_removed <= LibVersion then + begin + {$if declared(_SSL_renegotiate)} + SSL_renegotiate := @_SSL_renegotiate; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_renegotiate_allownil)} + if FuncLoadError then + AFailed.Add('SSL_renegotiate'); + {$ifend} + end; + + + SSL_renegotiate_abbreviated := LoadLibFunction(ADllHandle, SSL_renegotiate_abbreviated_procname); + FuncLoadError := not assigned(SSL_renegotiate_abbreviated); + if FuncLoadError then + begin + {$if not defined(SSL_renegotiate_abbreviated_allownil)} + SSL_renegotiate_abbreviated := @ERR_SSL_renegotiate_abbreviated; + {$ifend} + {$if declared(SSL_renegotiate_abbreviated_introduced)} + if LibVersion < SSL_renegotiate_abbreviated_introduced then + begin + {$if declared(FC_SSL_renegotiate_abbreviated)} + SSL_renegotiate_abbreviated := @FC_SSL_renegotiate_abbreviated; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_renegotiate_abbreviated_removed)} + if SSL_renegotiate_abbreviated_removed <= LibVersion then + begin + {$if declared(_SSL_renegotiate_abbreviated)} + SSL_renegotiate_abbreviated := @_SSL_renegotiate_abbreviated; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_renegotiate_abbreviated_allownil)} + if FuncLoadError then + AFailed.Add('SSL_renegotiate_abbreviated'); + {$ifend} + end; + + + SSL_shutdown := LoadLibFunction(ADllHandle, SSL_shutdown_procname); + FuncLoadError := not assigned(SSL_shutdown); + if FuncLoadError then + begin + {$if not defined(SSL_shutdown_allownil)} + SSL_shutdown := @ERR_SSL_shutdown; + {$ifend} + {$if declared(SSL_shutdown_introduced)} + if LibVersion < SSL_shutdown_introduced then + begin + {$if declared(FC_SSL_shutdown)} + SSL_shutdown := @FC_SSL_shutdown; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_shutdown_removed)} + if SSL_shutdown_removed <= LibVersion then + begin + {$if declared(_SSL_shutdown)} + SSL_shutdown := @_SSL_shutdown; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_shutdown_allownil)} + if FuncLoadError then + AFailed.Add('SSL_shutdown'); + {$ifend} + end; + + + SSL_CTX_set_post_handshake_auth := LoadLibFunction(ADllHandle, SSL_CTX_set_post_handshake_auth_procname); + FuncLoadError := not assigned(SSL_CTX_set_post_handshake_auth); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_set_post_handshake_auth_allownil)} + SSL_CTX_set_post_handshake_auth := @ERR_SSL_CTX_set_post_handshake_auth; + {$ifend} + {$if declared(SSL_CTX_set_post_handshake_auth_introduced)} + if LibVersion < SSL_CTX_set_post_handshake_auth_introduced then + begin + {$if declared(FC_SSL_CTX_set_post_handshake_auth)} + SSL_CTX_set_post_handshake_auth := @FC_SSL_CTX_set_post_handshake_auth; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_set_post_handshake_auth_removed)} + if SSL_CTX_set_post_handshake_auth_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_set_post_handshake_auth)} + SSL_CTX_set_post_handshake_auth := @_SSL_CTX_set_post_handshake_auth; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_set_post_handshake_auth_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_set_post_handshake_auth'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_set_post_handshake_auth := LoadLibFunction(ADllHandle, SSL_set_post_handshake_auth_procname); + FuncLoadError := not assigned(SSL_set_post_handshake_auth); + if FuncLoadError then + begin + {$if not defined(SSL_set_post_handshake_auth_allownil)} + SSL_set_post_handshake_auth := @ERR_SSL_set_post_handshake_auth; + {$ifend} + {$if declared(SSL_set_post_handshake_auth_introduced)} + if LibVersion < SSL_set_post_handshake_auth_introduced then + begin + {$if declared(FC_SSL_set_post_handshake_auth)} + SSL_set_post_handshake_auth := @FC_SSL_set_post_handshake_auth; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_set_post_handshake_auth_removed)} + if SSL_set_post_handshake_auth_removed <= LibVersion then + begin + {$if declared(_SSL_set_post_handshake_auth)} + SSL_set_post_handshake_auth := @_SSL_set_post_handshake_auth; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_set_post_handshake_auth_allownil)} + if FuncLoadError then + AFailed.Add('SSL_set_post_handshake_auth'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_renegotiate_pending := LoadLibFunction(ADllHandle, SSL_renegotiate_pending_procname); + FuncLoadError := not assigned(SSL_renegotiate_pending); + if FuncLoadError then + begin + {$if not defined(SSL_renegotiate_pending_allownil)} + SSL_renegotiate_pending := @ERR_SSL_renegotiate_pending; + {$ifend} + {$if declared(SSL_renegotiate_pending_introduced)} + if LibVersion < SSL_renegotiate_pending_introduced then + begin + {$if declared(FC_SSL_renegotiate_pending)} + SSL_renegotiate_pending := @FC_SSL_renegotiate_pending; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_renegotiate_pending_removed)} + if SSL_renegotiate_pending_removed <= LibVersion then + begin + {$if declared(_SSL_renegotiate_pending)} + SSL_renegotiate_pending := @_SSL_renegotiate_pending; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_renegotiate_pending_allownil)} + if FuncLoadError then + AFailed.Add('SSL_renegotiate_pending'); + {$ifend} + end; + + + SSL_verify_client_post_handshake := LoadLibFunction(ADllHandle, SSL_verify_client_post_handshake_procname); + FuncLoadError := not assigned(SSL_verify_client_post_handshake); + if FuncLoadError then + begin + {$if not defined(SSL_verify_client_post_handshake_allownil)} + SSL_verify_client_post_handshake := @ERR_SSL_verify_client_post_handshake; + {$ifend} + {$if declared(SSL_verify_client_post_handshake_introduced)} + if LibVersion < SSL_verify_client_post_handshake_introduced then + begin + {$if declared(FC_SSL_verify_client_post_handshake)} + SSL_verify_client_post_handshake := @FC_SSL_verify_client_post_handshake; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_verify_client_post_handshake_removed)} + if SSL_verify_client_post_handshake_removed <= LibVersion then + begin + {$if declared(_SSL_verify_client_post_handshake)} + SSL_verify_client_post_handshake := @_SSL_verify_client_post_handshake; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_verify_client_post_handshake_allownil)} + if FuncLoadError then + AFailed.Add('SSL_verify_client_post_handshake'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_CTX_get_ssl_method := LoadLibFunction(ADllHandle, SSL_CTX_get_ssl_method_procname); + FuncLoadError := not assigned(SSL_CTX_get_ssl_method); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_get_ssl_method_allownil)} + SSL_CTX_get_ssl_method := @ERR_SSL_CTX_get_ssl_method; + {$ifend} + {$if declared(SSL_CTX_get_ssl_method_introduced)} + if LibVersion < SSL_CTX_get_ssl_method_introduced then + begin + {$if declared(FC_SSL_CTX_get_ssl_method)} + SSL_CTX_get_ssl_method := @FC_SSL_CTX_get_ssl_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_get_ssl_method_removed)} + if SSL_CTX_get_ssl_method_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_get_ssl_method)} + SSL_CTX_get_ssl_method := @_SSL_CTX_get_ssl_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_get_ssl_method_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_get_ssl_method'); + {$ifend} + end; + + + SSL_get_ssl_method := LoadLibFunction(ADllHandle, SSL_get_ssl_method_procname); + FuncLoadError := not assigned(SSL_get_ssl_method); + if FuncLoadError then + begin + {$if not defined(SSL_get_ssl_method_allownil)} + SSL_get_ssl_method := @ERR_SSL_get_ssl_method; + {$ifend} + {$if declared(SSL_get_ssl_method_introduced)} + if LibVersion < SSL_get_ssl_method_introduced then + begin + {$if declared(FC_SSL_get_ssl_method)} + SSL_get_ssl_method := @FC_SSL_get_ssl_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_get_ssl_method_removed)} + if SSL_get_ssl_method_removed <= LibVersion then + begin + {$if declared(_SSL_get_ssl_method)} + SSL_get_ssl_method := @_SSL_get_ssl_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_get_ssl_method_allownil)} + if FuncLoadError then + AFailed.Add('SSL_get_ssl_method'); + {$ifend} + end; + + + SSL_set_ssl_method := LoadLibFunction(ADllHandle, SSL_set_ssl_method_procname); + FuncLoadError := not assigned(SSL_set_ssl_method); + if FuncLoadError then + begin + {$if not defined(SSL_set_ssl_method_allownil)} + SSL_set_ssl_method := @ERR_SSL_set_ssl_method; + {$ifend} + {$if declared(SSL_set_ssl_method_introduced)} + if LibVersion < SSL_set_ssl_method_introduced then + begin + {$if declared(FC_SSL_set_ssl_method)} + SSL_set_ssl_method := @FC_SSL_set_ssl_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_set_ssl_method_removed)} + if SSL_set_ssl_method_removed <= LibVersion then + begin + {$if declared(_SSL_set_ssl_method)} + SSL_set_ssl_method := @_SSL_set_ssl_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_set_ssl_method_allownil)} + if FuncLoadError then + AFailed.Add('SSL_set_ssl_method'); + {$ifend} + end; + + + SSL_alert_type_string_long := LoadLibFunction(ADllHandle, SSL_alert_type_string_long_procname); + FuncLoadError := not assigned(SSL_alert_type_string_long); + if FuncLoadError then + begin + {$if not defined(SSL_alert_type_string_long_allownil)} + SSL_alert_type_string_long := @ERR_SSL_alert_type_string_long; + {$ifend} + {$if declared(SSL_alert_type_string_long_introduced)} + if LibVersion < SSL_alert_type_string_long_introduced then + begin + {$if declared(FC_SSL_alert_type_string_long)} + SSL_alert_type_string_long := @FC_SSL_alert_type_string_long; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_alert_type_string_long_removed)} + if SSL_alert_type_string_long_removed <= LibVersion then + begin + {$if declared(_SSL_alert_type_string_long)} + SSL_alert_type_string_long := @_SSL_alert_type_string_long; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_alert_type_string_long_allownil)} + if FuncLoadError then + AFailed.Add('SSL_alert_type_string_long'); + {$ifend} + end; + + + SSL_alert_type_string := LoadLibFunction(ADllHandle, SSL_alert_type_string_procname); + FuncLoadError := not assigned(SSL_alert_type_string); + if FuncLoadError then + begin + {$if not defined(SSL_alert_type_string_allownil)} + SSL_alert_type_string := @ERR_SSL_alert_type_string; + {$ifend} + {$if declared(SSL_alert_type_string_introduced)} + if LibVersion < SSL_alert_type_string_introduced then + begin + {$if declared(FC_SSL_alert_type_string)} + SSL_alert_type_string := @FC_SSL_alert_type_string; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_alert_type_string_removed)} + if SSL_alert_type_string_removed <= LibVersion then + begin + {$if declared(_SSL_alert_type_string)} + SSL_alert_type_string := @_SSL_alert_type_string; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_alert_type_string_allownil)} + if FuncLoadError then + AFailed.Add('SSL_alert_type_string'); + {$ifend} + end; + + + SSL_alert_desc_string_long := LoadLibFunction(ADllHandle, SSL_alert_desc_string_long_procname); + FuncLoadError := not assigned(SSL_alert_desc_string_long); + if FuncLoadError then + begin + {$if not defined(SSL_alert_desc_string_long_allownil)} + SSL_alert_desc_string_long := @ERR_SSL_alert_desc_string_long; + {$ifend} + {$if declared(SSL_alert_desc_string_long_introduced)} + if LibVersion < SSL_alert_desc_string_long_introduced then + begin + {$if declared(FC_SSL_alert_desc_string_long)} + SSL_alert_desc_string_long := @FC_SSL_alert_desc_string_long; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_alert_desc_string_long_removed)} + if SSL_alert_desc_string_long_removed <= LibVersion then + begin + {$if declared(_SSL_alert_desc_string_long)} + SSL_alert_desc_string_long := @_SSL_alert_desc_string_long; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_alert_desc_string_long_allownil)} + if FuncLoadError then + AFailed.Add('SSL_alert_desc_string_long'); + {$ifend} + end; + + + SSL_alert_desc_string := LoadLibFunction(ADllHandle, SSL_alert_desc_string_procname); + FuncLoadError := not assigned(SSL_alert_desc_string); + if FuncLoadError then + begin + {$if not defined(SSL_alert_desc_string_allownil)} + SSL_alert_desc_string := @ERR_SSL_alert_desc_string; + {$ifend} + {$if declared(SSL_alert_desc_string_introduced)} + if LibVersion < SSL_alert_desc_string_introduced then + begin + {$if declared(FC_SSL_alert_desc_string)} + SSL_alert_desc_string := @FC_SSL_alert_desc_string; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_alert_desc_string_removed)} + if SSL_alert_desc_string_removed <= LibVersion then + begin + {$if declared(_SSL_alert_desc_string)} + SSL_alert_desc_string := @_SSL_alert_desc_string; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_alert_desc_string_allownil)} + if FuncLoadError then + AFailed.Add('SSL_alert_desc_string'); + {$ifend} + end; + + + SSL_CTX_set_client_CA_list := LoadLibFunction(ADllHandle, SSL_CTX_set_client_CA_list_procname); + FuncLoadError := not assigned(SSL_CTX_set_client_CA_list); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_set_client_CA_list_allownil)} + SSL_CTX_set_client_CA_list := @ERR_SSL_CTX_set_client_CA_list; + {$ifend} + {$if declared(SSL_CTX_set_client_CA_list_introduced)} + if LibVersion < SSL_CTX_set_client_CA_list_introduced then + begin + {$if declared(FC_SSL_CTX_set_client_CA_list)} + SSL_CTX_set_client_CA_list := @FC_SSL_CTX_set_client_CA_list; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_set_client_CA_list_removed)} + if SSL_CTX_set_client_CA_list_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_set_client_CA_list)} + SSL_CTX_set_client_CA_list := @_SSL_CTX_set_client_CA_list; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_set_client_CA_list_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_set_client_CA_list'); + {$ifend} + end; + + + SSL_add_client_CA := LoadLibFunction(ADllHandle, SSL_add_client_CA_procname); + FuncLoadError := not assigned(SSL_add_client_CA); + if FuncLoadError then + begin + {$if not defined(SSL_add_client_CA_allownil)} + SSL_add_client_CA := @ERR_SSL_add_client_CA; + {$ifend} + {$if declared(SSL_add_client_CA_introduced)} + if LibVersion < SSL_add_client_CA_introduced then + begin + {$if declared(FC_SSL_add_client_CA)} + SSL_add_client_CA := @FC_SSL_add_client_CA; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_add_client_CA_removed)} + if SSL_add_client_CA_removed <= LibVersion then + begin + {$if declared(_SSL_add_client_CA)} + SSL_add_client_CA := @_SSL_add_client_CA; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_add_client_CA_allownil)} + if FuncLoadError then + AFailed.Add('SSL_add_client_CA'); + {$ifend} + end; + + + SSL_CTX_add_client_CA := LoadLibFunction(ADllHandle, SSL_CTX_add_client_CA_procname); + FuncLoadError := not assigned(SSL_CTX_add_client_CA); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_add_client_CA_allownil)} + SSL_CTX_add_client_CA := @ERR_SSL_CTX_add_client_CA; + {$ifend} + {$if declared(SSL_CTX_add_client_CA_introduced)} + if LibVersion < SSL_CTX_add_client_CA_introduced then + begin + {$if declared(FC_SSL_CTX_add_client_CA)} + SSL_CTX_add_client_CA := @FC_SSL_CTX_add_client_CA; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_add_client_CA_removed)} + if SSL_CTX_add_client_CA_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_add_client_CA)} + SSL_CTX_add_client_CA := @_SSL_CTX_add_client_CA; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_add_client_CA_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_add_client_CA'); + {$ifend} + end; + + + SSL_set_connect_state := LoadLibFunction(ADllHandle, SSL_set_connect_state_procname); + FuncLoadError := not assigned(SSL_set_connect_state); + if FuncLoadError then + begin + {$if not defined(SSL_set_connect_state_allownil)} + SSL_set_connect_state := @ERR_SSL_set_connect_state; + {$ifend} + {$if declared(SSL_set_connect_state_introduced)} + if LibVersion < SSL_set_connect_state_introduced then + begin + {$if declared(FC_SSL_set_connect_state)} + SSL_set_connect_state := @FC_SSL_set_connect_state; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_set_connect_state_removed)} + if SSL_set_connect_state_removed <= LibVersion then + begin + {$if declared(_SSL_set_connect_state)} + SSL_set_connect_state := @_SSL_set_connect_state; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_set_connect_state_allownil)} + if FuncLoadError then + AFailed.Add('SSL_set_connect_state'); + {$ifend} + end; + + + SSL_set_accept_state := LoadLibFunction(ADllHandle, SSL_set_accept_state_procname); + FuncLoadError := not assigned(SSL_set_accept_state); + if FuncLoadError then + begin + {$if not defined(SSL_set_accept_state_allownil)} + SSL_set_accept_state := @ERR_SSL_set_accept_state; + {$ifend} + {$if declared(SSL_set_accept_state_introduced)} + if LibVersion < SSL_set_accept_state_introduced then + begin + {$if declared(FC_SSL_set_accept_state)} + SSL_set_accept_state := @FC_SSL_set_accept_state; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_set_accept_state_removed)} + if SSL_set_accept_state_removed <= LibVersion then + begin + {$if declared(_SSL_set_accept_state)} + SSL_set_accept_state := @_SSL_set_accept_state; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_set_accept_state_allownil)} + if FuncLoadError then + AFailed.Add('SSL_set_accept_state'); + {$ifend} + end; + + + SSL_library_init := LoadLibFunction(ADllHandle, SSL_library_init_procname); + FuncLoadError := not assigned(SSL_library_init); + if FuncLoadError then + begin + {$if not defined(SSL_library_init_allownil)} + SSL_library_init := @ERR_SSL_library_init; + {$ifend} + {$if declared(SSL_library_init_introduced)} + if LibVersion < SSL_library_init_introduced then + begin + {$if declared(FC_SSL_library_init)} + SSL_library_init := @FC_SSL_library_init; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_library_init_removed)} + if SSL_library_init_removed <= LibVersion then + begin + {$if declared(_SSL_library_init)} + SSL_library_init := @_SSL_library_init; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_library_init_allownil)} + if FuncLoadError then + AFailed.Add('SSL_library_init'); + {$ifend} + end; + + + SSL_CIPHER_description := LoadLibFunction(ADllHandle, SSL_CIPHER_description_procname); + FuncLoadError := not assigned(SSL_CIPHER_description); + if FuncLoadError then + begin + {$if not defined(SSL_CIPHER_description_allownil)} + SSL_CIPHER_description := @ERR_SSL_CIPHER_description; + {$ifend} + {$if declared(SSL_CIPHER_description_introduced)} + if LibVersion < SSL_CIPHER_description_introduced then + begin + {$if declared(FC_SSL_CIPHER_description)} + SSL_CIPHER_description := @FC_SSL_CIPHER_description; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CIPHER_description_removed)} + if SSL_CIPHER_description_removed <= LibVersion then + begin + {$if declared(_SSL_CIPHER_description)} + SSL_CIPHER_description := @_SSL_CIPHER_description; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CIPHER_description_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CIPHER_description'); + {$ifend} + end; + + + SSL_dup := LoadLibFunction(ADllHandle, SSL_dup_procname); + FuncLoadError := not assigned(SSL_dup); + if FuncLoadError then + begin + {$if not defined(SSL_dup_allownil)} + SSL_dup := @ERR_SSL_dup; + {$ifend} + {$if declared(SSL_dup_introduced)} + if LibVersion < SSL_dup_introduced then + begin + {$if declared(FC_SSL_dup)} + SSL_dup := @FC_SSL_dup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_dup_removed)} + if SSL_dup_removed <= LibVersion then + begin + {$if declared(_SSL_dup)} + SSL_dup := @_SSL_dup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_dup_allownil)} + if FuncLoadError then + AFailed.Add('SSL_dup'); + {$ifend} + end; + + + SSL_get_certificate := LoadLibFunction(ADllHandle, SSL_get_certificate_procname); + FuncLoadError := not assigned(SSL_get_certificate); + if FuncLoadError then + begin + {$if not defined(SSL_get_certificate_allownil)} + SSL_get_certificate := @ERR_SSL_get_certificate; + {$ifend} + {$if declared(SSL_get_certificate_introduced)} + if LibVersion < SSL_get_certificate_introduced then + begin + {$if declared(FC_SSL_get_certificate)} + SSL_get_certificate := @FC_SSL_get_certificate; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_get_certificate_removed)} + if SSL_get_certificate_removed <= LibVersion then + begin + {$if declared(_SSL_get_certificate)} + SSL_get_certificate := @_SSL_get_certificate; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_get_certificate_allownil)} + if FuncLoadError then + AFailed.Add('SSL_get_certificate'); + {$ifend} + end; + + + SSL_get_privatekey := LoadLibFunction(ADllHandle, SSL_get_privatekey_procname); + FuncLoadError := not assigned(SSL_get_privatekey); + if FuncLoadError then + begin + {$if not defined(SSL_get_privatekey_allownil)} + SSL_get_privatekey := @ERR_SSL_get_privatekey; + {$ifend} + {$if declared(SSL_get_privatekey_introduced)} + if LibVersion < SSL_get_privatekey_introduced then + begin + {$if declared(FC_SSL_get_privatekey)} + SSL_get_privatekey := @FC_SSL_get_privatekey; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_get_privatekey_removed)} + if SSL_get_privatekey_removed <= LibVersion then + begin + {$if declared(_SSL_get_privatekey)} + SSL_get_privatekey := @_SSL_get_privatekey; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_get_privatekey_allownil)} + if FuncLoadError then + AFailed.Add('SSL_get_privatekey'); + {$ifend} + end; + + + SSL_CTX_get0_certificate := LoadLibFunction(ADllHandle, SSL_CTX_get0_certificate_procname); + FuncLoadError := not assigned(SSL_CTX_get0_certificate); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_get0_certificate_allownil)} + SSL_CTX_get0_certificate := @ERR_SSL_CTX_get0_certificate; + {$ifend} + {$if declared(SSL_CTX_get0_certificate_introduced)} + if LibVersion < SSL_CTX_get0_certificate_introduced then + begin + {$if declared(FC_SSL_CTX_get0_certificate)} + SSL_CTX_get0_certificate := @FC_SSL_CTX_get0_certificate; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_get0_certificate_removed)} + if SSL_CTX_get0_certificate_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_get0_certificate)} + SSL_CTX_get0_certificate := @_SSL_CTX_get0_certificate; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_get0_certificate_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_get0_certificate'); + {$ifend} + end; + + + SSL_CTX_get0_privatekey := LoadLibFunction(ADllHandle, SSL_CTX_get0_privatekey_procname); + FuncLoadError := not assigned(SSL_CTX_get0_privatekey); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_get0_privatekey_allownil)} + SSL_CTX_get0_privatekey := @ERR_SSL_CTX_get0_privatekey; + {$ifend} + {$if declared(SSL_CTX_get0_privatekey_introduced)} + if LibVersion < SSL_CTX_get0_privatekey_introduced then + begin + {$if declared(FC_SSL_CTX_get0_privatekey)} + SSL_CTX_get0_privatekey := @FC_SSL_CTX_get0_privatekey; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_get0_privatekey_removed)} + if SSL_CTX_get0_privatekey_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_get0_privatekey)} + SSL_CTX_get0_privatekey := @_SSL_CTX_get0_privatekey; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_get0_privatekey_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_get0_privatekey'); + {$ifend} + end; + + + SSL_CTX_set_quiet_shutdown := LoadLibFunction(ADllHandle, SSL_CTX_set_quiet_shutdown_procname); + FuncLoadError := not assigned(SSL_CTX_set_quiet_shutdown); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_set_quiet_shutdown_allownil)} + SSL_CTX_set_quiet_shutdown := @ERR_SSL_CTX_set_quiet_shutdown; + {$ifend} + {$if declared(SSL_CTX_set_quiet_shutdown_introduced)} + if LibVersion < SSL_CTX_set_quiet_shutdown_introduced then + begin + {$if declared(FC_SSL_CTX_set_quiet_shutdown)} + SSL_CTX_set_quiet_shutdown := @FC_SSL_CTX_set_quiet_shutdown; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_set_quiet_shutdown_removed)} + if SSL_CTX_set_quiet_shutdown_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_set_quiet_shutdown)} + SSL_CTX_set_quiet_shutdown := @_SSL_CTX_set_quiet_shutdown; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_set_quiet_shutdown_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_set_quiet_shutdown'); + {$ifend} + end; + + + SSL_CTX_get_quiet_shutdown := LoadLibFunction(ADllHandle, SSL_CTX_get_quiet_shutdown_procname); + FuncLoadError := not assigned(SSL_CTX_get_quiet_shutdown); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_get_quiet_shutdown_allownil)} + SSL_CTX_get_quiet_shutdown := @ERR_SSL_CTX_get_quiet_shutdown; + {$ifend} + {$if declared(SSL_CTX_get_quiet_shutdown_introduced)} + if LibVersion < SSL_CTX_get_quiet_shutdown_introduced then + begin + {$if declared(FC_SSL_CTX_get_quiet_shutdown)} + SSL_CTX_get_quiet_shutdown := @FC_SSL_CTX_get_quiet_shutdown; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_get_quiet_shutdown_removed)} + if SSL_CTX_get_quiet_shutdown_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_get_quiet_shutdown)} + SSL_CTX_get_quiet_shutdown := @_SSL_CTX_get_quiet_shutdown; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_get_quiet_shutdown_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_get_quiet_shutdown'); + {$ifend} + end; + + + SSL_set_quiet_shutdown := LoadLibFunction(ADllHandle, SSL_set_quiet_shutdown_procname); + FuncLoadError := not assigned(SSL_set_quiet_shutdown); + if FuncLoadError then + begin + {$if not defined(SSL_set_quiet_shutdown_allownil)} + SSL_set_quiet_shutdown := @ERR_SSL_set_quiet_shutdown; + {$ifend} + {$if declared(SSL_set_quiet_shutdown_introduced)} + if LibVersion < SSL_set_quiet_shutdown_introduced then + begin + {$if declared(FC_SSL_set_quiet_shutdown)} + SSL_set_quiet_shutdown := @FC_SSL_set_quiet_shutdown; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_set_quiet_shutdown_removed)} + if SSL_set_quiet_shutdown_removed <= LibVersion then + begin + {$if declared(_SSL_set_quiet_shutdown)} + SSL_set_quiet_shutdown := @_SSL_set_quiet_shutdown; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_set_quiet_shutdown_allownil)} + if FuncLoadError then + AFailed.Add('SSL_set_quiet_shutdown'); + {$ifend} + end; + + + SSL_get_quiet_shutdown := LoadLibFunction(ADllHandle, SSL_get_quiet_shutdown_procname); + FuncLoadError := not assigned(SSL_get_quiet_shutdown); + if FuncLoadError then + begin + {$if not defined(SSL_get_quiet_shutdown_allownil)} + SSL_get_quiet_shutdown := @ERR_SSL_get_quiet_shutdown; + {$ifend} + {$if declared(SSL_get_quiet_shutdown_introduced)} + if LibVersion < SSL_get_quiet_shutdown_introduced then + begin + {$if declared(FC_SSL_get_quiet_shutdown)} + SSL_get_quiet_shutdown := @FC_SSL_get_quiet_shutdown; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_get_quiet_shutdown_removed)} + if SSL_get_quiet_shutdown_removed <= LibVersion then + begin + {$if declared(_SSL_get_quiet_shutdown)} + SSL_get_quiet_shutdown := @_SSL_get_quiet_shutdown; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_get_quiet_shutdown_allownil)} + if FuncLoadError then + AFailed.Add('SSL_get_quiet_shutdown'); + {$ifend} + end; + + + SSL_set_shutdown := LoadLibFunction(ADllHandle, SSL_set_shutdown_procname); + FuncLoadError := not assigned(SSL_set_shutdown); + if FuncLoadError then + begin + {$if not defined(SSL_set_shutdown_allownil)} + SSL_set_shutdown := @ERR_SSL_set_shutdown; + {$ifend} + {$if declared(SSL_set_shutdown_introduced)} + if LibVersion < SSL_set_shutdown_introduced then + begin + {$if declared(FC_SSL_set_shutdown)} + SSL_set_shutdown := @FC_SSL_set_shutdown; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_set_shutdown_removed)} + if SSL_set_shutdown_removed <= LibVersion then + begin + {$if declared(_SSL_set_shutdown)} + SSL_set_shutdown := @_SSL_set_shutdown; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_set_shutdown_allownil)} + if FuncLoadError then + AFailed.Add('SSL_set_shutdown'); + {$ifend} + end; + + + SSL_get_shutdown := LoadLibFunction(ADllHandle, SSL_get_shutdown_procname); + FuncLoadError := not assigned(SSL_get_shutdown); + if FuncLoadError then + begin + {$if not defined(SSL_get_shutdown_allownil)} + SSL_get_shutdown := @ERR_SSL_get_shutdown; + {$ifend} + {$if declared(SSL_get_shutdown_introduced)} + if LibVersion < SSL_get_shutdown_introduced then + begin + {$if declared(FC_SSL_get_shutdown)} + SSL_get_shutdown := @FC_SSL_get_shutdown; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_get_shutdown_removed)} + if SSL_get_shutdown_removed <= LibVersion then + begin + {$if declared(_SSL_get_shutdown)} + SSL_get_shutdown := @_SSL_get_shutdown; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_get_shutdown_allownil)} + if FuncLoadError then + AFailed.Add('SSL_get_shutdown'); + {$ifend} + end; + + + SSL_version := LoadLibFunction(ADllHandle, SSL_version_procname); + FuncLoadError := not assigned(SSL_version); + if FuncLoadError then + begin + {$if not defined(SSL_version_allownil)} + SSL_version := @ERR_SSL_version; + {$ifend} + {$if declared(SSL_version_introduced)} + if LibVersion < SSL_version_introduced then + begin + {$if declared(FC_SSL_version)} + SSL_version := @FC_SSL_version; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_version_removed)} + if SSL_version_removed <= LibVersion then + begin + {$if declared(_SSL_version)} + SSL_version := @_SSL_version; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_version_allownil)} + if FuncLoadError then + AFailed.Add('SSL_version'); + {$ifend} + end; + + + SSL_client_version := LoadLibFunction(ADllHandle, SSL_client_version_procname); + FuncLoadError := not assigned(SSL_client_version); + if FuncLoadError then + begin + {$if not defined(SSL_client_version_allownil)} + SSL_client_version := @ERR_SSL_client_version; + {$ifend} + {$if declared(SSL_client_version_introduced)} + if LibVersion < SSL_client_version_introduced then + begin + {$if declared(FC_SSL_client_version)} + SSL_client_version := @FC_SSL_client_version; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_client_version_removed)} + if SSL_client_version_removed <= LibVersion then + begin + {$if declared(_SSL_client_version)} + SSL_client_version := @_SSL_client_version; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_client_version_allownil)} + if FuncLoadError then + AFailed.Add('SSL_client_version'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_CTX_set_default_verify_paths := LoadLibFunction(ADllHandle, SSL_CTX_set_default_verify_paths_procname); + FuncLoadError := not assigned(SSL_CTX_set_default_verify_paths); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_set_default_verify_paths_allownil)} + SSL_CTX_set_default_verify_paths := @ERR_SSL_CTX_set_default_verify_paths; + {$ifend} + {$if declared(SSL_CTX_set_default_verify_paths_introduced)} + if LibVersion < SSL_CTX_set_default_verify_paths_introduced then + begin + {$if declared(FC_SSL_CTX_set_default_verify_paths)} + SSL_CTX_set_default_verify_paths := @FC_SSL_CTX_set_default_verify_paths; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_set_default_verify_paths_removed)} + if SSL_CTX_set_default_verify_paths_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_set_default_verify_paths)} + SSL_CTX_set_default_verify_paths := @_SSL_CTX_set_default_verify_paths; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_set_default_verify_paths_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_set_default_verify_paths'); + {$ifend} + end; + + + SSL_CTX_set_default_verify_dir := LoadLibFunction(ADllHandle, SSL_CTX_set_default_verify_dir_procname); + FuncLoadError := not assigned(SSL_CTX_set_default_verify_dir); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_set_default_verify_dir_allownil)} + SSL_CTX_set_default_verify_dir := @ERR_SSL_CTX_set_default_verify_dir; + {$ifend} + {$if declared(SSL_CTX_set_default_verify_dir_introduced)} + if LibVersion < SSL_CTX_set_default_verify_dir_introduced then + begin + {$if declared(FC_SSL_CTX_set_default_verify_dir)} + SSL_CTX_set_default_verify_dir := @FC_SSL_CTX_set_default_verify_dir; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_set_default_verify_dir_removed)} + if SSL_CTX_set_default_verify_dir_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_set_default_verify_dir)} + SSL_CTX_set_default_verify_dir := @_SSL_CTX_set_default_verify_dir; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_set_default_verify_dir_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_set_default_verify_dir'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_CTX_set_default_verify_file := LoadLibFunction(ADllHandle, SSL_CTX_set_default_verify_file_procname); + FuncLoadError := not assigned(SSL_CTX_set_default_verify_file); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_set_default_verify_file_allownil)} + SSL_CTX_set_default_verify_file := @ERR_SSL_CTX_set_default_verify_file; + {$ifend} + {$if declared(SSL_CTX_set_default_verify_file_introduced)} + if LibVersion < SSL_CTX_set_default_verify_file_introduced then + begin + {$if declared(FC_SSL_CTX_set_default_verify_file)} + SSL_CTX_set_default_verify_file := @FC_SSL_CTX_set_default_verify_file; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_set_default_verify_file_removed)} + if SSL_CTX_set_default_verify_file_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_set_default_verify_file)} + SSL_CTX_set_default_verify_file := @_SSL_CTX_set_default_verify_file; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_set_default_verify_file_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_set_default_verify_file'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_CTX_load_verify_locations := LoadLibFunction(ADllHandle, SSL_CTX_load_verify_locations_procname); + FuncLoadError := not assigned(SSL_CTX_load_verify_locations); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_load_verify_locations_allownil)} + SSL_CTX_load_verify_locations := @ERR_SSL_CTX_load_verify_locations; + {$ifend} + {$if declared(SSL_CTX_load_verify_locations_introduced)} + if LibVersion < SSL_CTX_load_verify_locations_introduced then + begin + {$if declared(FC_SSL_CTX_load_verify_locations)} + SSL_CTX_load_verify_locations := @FC_SSL_CTX_load_verify_locations; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_load_verify_locations_removed)} + if SSL_CTX_load_verify_locations_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_load_verify_locations)} + SSL_CTX_load_verify_locations := @_SSL_CTX_load_verify_locations; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_load_verify_locations_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_load_verify_locations'); + {$ifend} + end; + + + SSL_get_session := LoadLibFunction(ADllHandle, SSL_get_session_procname); + FuncLoadError := not assigned(SSL_get_session); + if FuncLoadError then + begin + {$if not defined(SSL_get_session_allownil)} + SSL_get_session := @ERR_SSL_get_session; + {$ifend} + {$if declared(SSL_get_session_introduced)} + if LibVersion < SSL_get_session_introduced then + begin + {$if declared(FC_SSL_get_session)} + SSL_get_session := @FC_SSL_get_session; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_get_session_removed)} + if SSL_get_session_removed <= LibVersion then + begin + {$if declared(_SSL_get_session)} + SSL_get_session := @_SSL_get_session; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_get_session_allownil)} + if FuncLoadError then + AFailed.Add('SSL_get_session'); + {$ifend} + end; + + + SSL_get1_session := LoadLibFunction(ADllHandle, SSL_get1_session_procname); + FuncLoadError := not assigned(SSL_get1_session); + if FuncLoadError then + begin + {$if not defined(SSL_get1_session_allownil)} + SSL_get1_session := @ERR_SSL_get1_session; + {$ifend} + {$if declared(SSL_get1_session_introduced)} + if LibVersion < SSL_get1_session_introduced then + begin + {$if declared(FC_SSL_get1_session)} + SSL_get1_session := @FC_SSL_get1_session; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_get1_session_removed)} + if SSL_get1_session_removed <= LibVersion then + begin + {$if declared(_SSL_get1_session)} + SSL_get1_session := @_SSL_get1_session; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_get1_session_allownil)} + if FuncLoadError then + AFailed.Add('SSL_get1_session'); + {$ifend} + end; + + + SSL_get_SSL_CTX := LoadLibFunction(ADllHandle, SSL_get_SSL_CTX_procname); + FuncLoadError := not assigned(SSL_get_SSL_CTX); + if FuncLoadError then + begin + {$if not defined(SSL_get_SSL_CTX_allownil)} + SSL_get_SSL_CTX := @ERR_SSL_get_SSL_CTX; + {$ifend} + {$if declared(SSL_get_SSL_CTX_introduced)} + if LibVersion < SSL_get_SSL_CTX_introduced then + begin + {$if declared(FC_SSL_get_SSL_CTX)} + SSL_get_SSL_CTX := @FC_SSL_get_SSL_CTX; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_get_SSL_CTX_removed)} + if SSL_get_SSL_CTX_removed <= LibVersion then + begin + {$if declared(_SSL_get_SSL_CTX)} + SSL_get_SSL_CTX := @_SSL_get_SSL_CTX; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_get_SSL_CTX_allownil)} + if FuncLoadError then + AFailed.Add('SSL_get_SSL_CTX'); + {$ifend} + end; + + + SSL_set_SSL_CTX := LoadLibFunction(ADllHandle, SSL_set_SSL_CTX_procname); + FuncLoadError := not assigned(SSL_set_SSL_CTX); + if FuncLoadError then + begin + {$if not defined(SSL_set_SSL_CTX_allownil)} + SSL_set_SSL_CTX := @ERR_SSL_set_SSL_CTX; + {$ifend} + {$if declared(SSL_set_SSL_CTX_introduced)} + if LibVersion < SSL_set_SSL_CTX_introduced then + begin + {$if declared(FC_SSL_set_SSL_CTX)} + SSL_set_SSL_CTX := @FC_SSL_set_SSL_CTX; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_set_SSL_CTX_removed)} + if SSL_set_SSL_CTX_removed <= LibVersion then + begin + {$if declared(_SSL_set_SSL_CTX)} + SSL_set_SSL_CTX := @_SSL_set_SSL_CTX; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_set_SSL_CTX_allownil)} + if FuncLoadError then + AFailed.Add('SSL_set_SSL_CTX'); + {$ifend} + end; + + + SSL_set_info_callback := LoadLibFunction(ADllHandle, SSL_set_info_callback_procname); + FuncLoadError := not assigned(SSL_set_info_callback); + if FuncLoadError then + begin + {$if not defined(SSL_set_info_callback_allownil)} + SSL_set_info_callback := @ERR_SSL_set_info_callback; + {$ifend} + {$if declared(SSL_set_info_callback_introduced)} + if LibVersion < SSL_set_info_callback_introduced then + begin + {$if declared(FC_SSL_set_info_callback)} + SSL_set_info_callback := @FC_SSL_set_info_callback; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_set_info_callback_removed)} + if SSL_set_info_callback_removed <= LibVersion then + begin + {$if declared(_SSL_set_info_callback)} + SSL_set_info_callback := @_SSL_set_info_callback; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_set_info_callback_allownil)} + if FuncLoadError then + AFailed.Add('SSL_set_info_callback'); + {$ifend} + end; + + + SSL_get_info_callback := LoadLibFunction(ADllHandle, SSL_get_info_callback_procname); + FuncLoadError := not assigned(SSL_get_info_callback); + if FuncLoadError then + begin + {$if not defined(SSL_get_info_callback_allownil)} + SSL_get_info_callback := @ERR_SSL_get_info_callback; + {$ifend} + {$if declared(SSL_get_info_callback_introduced)} + if LibVersion < SSL_get_info_callback_introduced then + begin + {$if declared(FC_SSL_get_info_callback)} + SSL_get_info_callback := @FC_SSL_get_info_callback; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_get_info_callback_removed)} + if SSL_get_info_callback_removed <= LibVersion then + begin + {$if declared(_SSL_get_info_callback)} + SSL_get_info_callback := @_SSL_get_info_callback; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_get_info_callback_allownil)} + if FuncLoadError then + AFailed.Add('SSL_get_info_callback'); + {$ifend} + end; + + + SSL_get_state := LoadLibFunction(ADllHandle, SSL_get_state_procname); + FuncLoadError := not assigned(SSL_get_state); + if FuncLoadError then + begin + {$if not defined(SSL_get_state_allownil)} + SSL_get_state := @ERR_SSL_get_state; + {$ifend} + {$if declared(SSL_get_state_introduced)} + if LibVersion < SSL_get_state_introduced then + begin + {$if declared(FC_SSL_get_state)} + SSL_get_state := @FC_SSL_get_state; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_get_state_removed)} + if SSL_get_state_removed <= LibVersion then + begin + {$if declared(_SSL_get_state)} + SSL_get_state := @_SSL_get_state; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_get_state_allownil)} + if FuncLoadError then + AFailed.Add('SSL_get_state'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_set_verify_result := LoadLibFunction(ADllHandle, SSL_set_verify_result_procname); + FuncLoadError := not assigned(SSL_set_verify_result); + if FuncLoadError then + begin + {$if not defined(SSL_set_verify_result_allownil)} + SSL_set_verify_result := @ERR_SSL_set_verify_result; + {$ifend} + {$if declared(SSL_set_verify_result_introduced)} + if LibVersion < SSL_set_verify_result_introduced then + begin + {$if declared(FC_SSL_set_verify_result)} + SSL_set_verify_result := @FC_SSL_set_verify_result; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_set_verify_result_removed)} + if SSL_set_verify_result_removed <= LibVersion then + begin + {$if declared(_SSL_set_verify_result)} + SSL_set_verify_result := @_SSL_set_verify_result; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_set_verify_result_allownil)} + if FuncLoadError then + AFailed.Add('SSL_set_verify_result'); + {$ifend} + end; + + + SSL_get_verify_result := LoadLibFunction(ADllHandle, SSL_get_verify_result_procname); + FuncLoadError := not assigned(SSL_get_verify_result); + if FuncLoadError then + begin + {$if not defined(SSL_get_verify_result_allownil)} + SSL_get_verify_result := @ERR_SSL_get_verify_result; + {$ifend} + {$if declared(SSL_get_verify_result_introduced)} + if LibVersion < SSL_get_verify_result_introduced then + begin + {$if declared(FC_SSL_get_verify_result)} + SSL_get_verify_result := @FC_SSL_get_verify_result; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_get_verify_result_removed)} + if SSL_get_verify_result_removed <= LibVersion then + begin + {$if declared(_SSL_get_verify_result)} + SSL_get_verify_result := @_SSL_get_verify_result; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_get_verify_result_allownil)} + if FuncLoadError then + AFailed.Add('SSL_get_verify_result'); + {$ifend} + end; + + + SSL_get_client_random := LoadLibFunction(ADllHandle, SSL_get_client_random_procname); + FuncLoadError := not assigned(SSL_get_client_random); + if FuncLoadError then + begin + {$if not defined(SSL_get_client_random_allownil)} + SSL_get_client_random := @ERR_SSL_get_client_random; + {$ifend} + {$if declared(SSL_get_client_random_introduced)} + if LibVersion < SSL_get_client_random_introduced then + begin + {$if declared(FC_SSL_get_client_random)} + SSL_get_client_random := @FC_SSL_get_client_random; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_get_client_random_removed)} + if SSL_get_client_random_removed <= LibVersion then + begin + {$if declared(_SSL_get_client_random)} + SSL_get_client_random := @_SSL_get_client_random; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_get_client_random_allownil)} + if FuncLoadError then + AFailed.Add('SSL_get_client_random'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_get_server_random := LoadLibFunction(ADllHandle, SSL_get_server_random_procname); + FuncLoadError := not assigned(SSL_get_server_random); + if FuncLoadError then + begin + {$if not defined(SSL_get_server_random_allownil)} + SSL_get_server_random := @ERR_SSL_get_server_random; + {$ifend} + {$if declared(SSL_get_server_random_introduced)} + if LibVersion < SSL_get_server_random_introduced then + begin + {$if declared(FC_SSL_get_server_random)} + SSL_get_server_random := @FC_SSL_get_server_random; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_get_server_random_removed)} + if SSL_get_server_random_removed <= LibVersion then + begin + {$if declared(_SSL_get_server_random)} + SSL_get_server_random := @_SSL_get_server_random; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_get_server_random_allownil)} + if FuncLoadError then + AFailed.Add('SSL_get_server_random'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_SESSION_get_master_key := LoadLibFunction(ADllHandle, SSL_SESSION_get_master_key_procname); + FuncLoadError := not assigned(SSL_SESSION_get_master_key); + if FuncLoadError then + begin + {$if not defined(SSL_SESSION_get_master_key_allownil)} + SSL_SESSION_get_master_key := @ERR_SSL_SESSION_get_master_key; + {$ifend} + {$if declared(SSL_SESSION_get_master_key_introduced)} + if LibVersion < SSL_SESSION_get_master_key_introduced then + begin + {$if declared(FC_SSL_SESSION_get_master_key)} + SSL_SESSION_get_master_key := @FC_SSL_SESSION_get_master_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_SESSION_get_master_key_removed)} + if SSL_SESSION_get_master_key_removed <= LibVersion then + begin + {$if declared(_SSL_SESSION_get_master_key)} + SSL_SESSION_get_master_key := @_SSL_SESSION_get_master_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_SESSION_get_master_key_allownil)} + if FuncLoadError then + AFailed.Add('SSL_SESSION_get_master_key'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_SESSION_set1_master_key := LoadLibFunction(ADllHandle, SSL_SESSION_set1_master_key_procname); + FuncLoadError := not assigned(SSL_SESSION_set1_master_key); + if FuncLoadError then + begin + {$if not defined(SSL_SESSION_set1_master_key_allownil)} + SSL_SESSION_set1_master_key := @ERR_SSL_SESSION_set1_master_key; + {$ifend} + {$if declared(SSL_SESSION_set1_master_key_introduced)} + if LibVersion < SSL_SESSION_set1_master_key_introduced then + begin + {$if declared(FC_SSL_SESSION_set1_master_key)} + SSL_SESSION_set1_master_key := @FC_SSL_SESSION_set1_master_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_SESSION_set1_master_key_removed)} + if SSL_SESSION_set1_master_key_removed <= LibVersion then + begin + {$if declared(_SSL_SESSION_set1_master_key)} + SSL_SESSION_set1_master_key := @_SSL_SESSION_set1_master_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_SESSION_set1_master_key_allownil)} + if FuncLoadError then + AFailed.Add('SSL_SESSION_set1_master_key'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_SESSION_get_max_fragment_length := LoadLibFunction(ADllHandle, SSL_SESSION_get_max_fragment_length_procname); + FuncLoadError := not assigned(SSL_SESSION_get_max_fragment_length); + if FuncLoadError then + begin + {$if not defined(SSL_SESSION_get_max_fragment_length_allownil)} + SSL_SESSION_get_max_fragment_length := @ERR_SSL_SESSION_get_max_fragment_length; + {$ifend} + {$if declared(SSL_SESSION_get_max_fragment_length_introduced)} + if LibVersion < SSL_SESSION_get_max_fragment_length_introduced then + begin + {$if declared(FC_SSL_SESSION_get_max_fragment_length)} + SSL_SESSION_get_max_fragment_length := @FC_SSL_SESSION_get_max_fragment_length; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_SESSION_get_max_fragment_length_removed)} + if SSL_SESSION_get_max_fragment_length_removed <= LibVersion then + begin + {$if declared(_SSL_SESSION_get_max_fragment_length)} + SSL_SESSION_get_max_fragment_length := @_SSL_SESSION_get_max_fragment_length; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_SESSION_get_max_fragment_length_allownil)} + if FuncLoadError then + AFailed.Add('SSL_SESSION_get_max_fragment_length'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_set_ex_data := LoadLibFunction(ADllHandle, SSL_set_ex_data_procname); + FuncLoadError := not assigned(SSL_set_ex_data); + if FuncLoadError then + begin + {$if not defined(SSL_set_ex_data_allownil)} + SSL_set_ex_data := @ERR_SSL_set_ex_data; + {$ifend} + {$if declared(SSL_set_ex_data_introduced)} + if LibVersion < SSL_set_ex_data_introduced then + begin + {$if declared(FC_SSL_set_ex_data)} + SSL_set_ex_data := @FC_SSL_set_ex_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_set_ex_data_removed)} + if SSL_set_ex_data_removed <= LibVersion then + begin + {$if declared(_SSL_set_ex_data)} + SSL_set_ex_data := @_SSL_set_ex_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_set_ex_data_allownil)} + if FuncLoadError then + AFailed.Add('SSL_set_ex_data'); + {$ifend} + end; + + + SSL_get_ex_data := LoadLibFunction(ADllHandle, SSL_get_ex_data_procname); + FuncLoadError := not assigned(SSL_get_ex_data); + if FuncLoadError then + begin + {$if not defined(SSL_get_ex_data_allownil)} + SSL_get_ex_data := @ERR_SSL_get_ex_data; + {$ifend} + {$if declared(SSL_get_ex_data_introduced)} + if LibVersion < SSL_get_ex_data_introduced then + begin + {$if declared(FC_SSL_get_ex_data)} + SSL_get_ex_data := @FC_SSL_get_ex_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_get_ex_data_removed)} + if SSL_get_ex_data_removed <= LibVersion then + begin + {$if declared(_SSL_get_ex_data)} + SSL_get_ex_data := @_SSL_get_ex_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_get_ex_data_allownil)} + if FuncLoadError then + AFailed.Add('SSL_get_ex_data'); + {$ifend} + end; + + + SSL_SESSION_set_ex_data := LoadLibFunction(ADllHandle, SSL_SESSION_set_ex_data_procname); + FuncLoadError := not assigned(SSL_SESSION_set_ex_data); + if FuncLoadError then + begin + {$if not defined(SSL_SESSION_set_ex_data_allownil)} + SSL_SESSION_set_ex_data := @ERR_SSL_SESSION_set_ex_data; + {$ifend} + {$if declared(SSL_SESSION_set_ex_data_introduced)} + if LibVersion < SSL_SESSION_set_ex_data_introduced then + begin + {$if declared(FC_SSL_SESSION_set_ex_data)} + SSL_SESSION_set_ex_data := @FC_SSL_SESSION_set_ex_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_SESSION_set_ex_data_removed)} + if SSL_SESSION_set_ex_data_removed <= LibVersion then + begin + {$if declared(_SSL_SESSION_set_ex_data)} + SSL_SESSION_set_ex_data := @_SSL_SESSION_set_ex_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_SESSION_set_ex_data_allownil)} + if FuncLoadError then + AFailed.Add('SSL_SESSION_set_ex_data'); + {$ifend} + end; + + + SSL_SESSION_get_ex_data := LoadLibFunction(ADllHandle, SSL_SESSION_get_ex_data_procname); + FuncLoadError := not assigned(SSL_SESSION_get_ex_data); + if FuncLoadError then + begin + {$if not defined(SSL_SESSION_get_ex_data_allownil)} + SSL_SESSION_get_ex_data := @ERR_SSL_SESSION_get_ex_data; + {$ifend} + {$if declared(SSL_SESSION_get_ex_data_introduced)} + if LibVersion < SSL_SESSION_get_ex_data_introduced then + begin + {$if declared(FC_SSL_SESSION_get_ex_data)} + SSL_SESSION_get_ex_data := @FC_SSL_SESSION_get_ex_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_SESSION_get_ex_data_removed)} + if SSL_SESSION_get_ex_data_removed <= LibVersion then + begin + {$if declared(_SSL_SESSION_get_ex_data)} + SSL_SESSION_get_ex_data := @_SSL_SESSION_get_ex_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_SESSION_get_ex_data_allownil)} + if FuncLoadError then + AFailed.Add('SSL_SESSION_get_ex_data'); + {$ifend} + end; + + + SSL_CTX_set_ex_data := LoadLibFunction(ADllHandle, SSL_CTX_set_ex_data_procname); + FuncLoadError := not assigned(SSL_CTX_set_ex_data); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_set_ex_data_allownil)} + SSL_CTX_set_ex_data := @ERR_SSL_CTX_set_ex_data; + {$ifend} + {$if declared(SSL_CTX_set_ex_data_introduced)} + if LibVersion < SSL_CTX_set_ex_data_introduced then + begin + {$if declared(FC_SSL_CTX_set_ex_data)} + SSL_CTX_set_ex_data := @FC_SSL_CTX_set_ex_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_set_ex_data_removed)} + if SSL_CTX_set_ex_data_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_set_ex_data)} + SSL_CTX_set_ex_data := @_SSL_CTX_set_ex_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_set_ex_data_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_set_ex_data'); + {$ifend} + end; + + + SSL_CTX_get_ex_data := LoadLibFunction(ADllHandle, SSL_CTX_get_ex_data_procname); + FuncLoadError := not assigned(SSL_CTX_get_ex_data); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_get_ex_data_allownil)} + SSL_CTX_get_ex_data := @ERR_SSL_CTX_get_ex_data; + {$ifend} + {$if declared(SSL_CTX_get_ex_data_introduced)} + if LibVersion < SSL_CTX_get_ex_data_introduced then + begin + {$if declared(FC_SSL_CTX_get_ex_data)} + SSL_CTX_get_ex_data := @FC_SSL_CTX_get_ex_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_get_ex_data_removed)} + if SSL_CTX_get_ex_data_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_get_ex_data)} + SSL_CTX_get_ex_data := @_SSL_CTX_get_ex_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_get_ex_data_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_get_ex_data'); + {$ifend} + end; + + + SSL_get_ex_data_X509_STORE_CTX_idx := LoadLibFunction(ADllHandle, SSL_get_ex_data_X509_STORE_CTX_idx_procname); + FuncLoadError := not assigned(SSL_get_ex_data_X509_STORE_CTX_idx); + if FuncLoadError then + begin + {$if not defined(SSL_get_ex_data_X509_STORE_CTX_idx_allownil)} + SSL_get_ex_data_X509_STORE_CTX_idx := @ERR_SSL_get_ex_data_X509_STORE_CTX_idx; + {$ifend} + {$if declared(SSL_get_ex_data_X509_STORE_CTX_idx_introduced)} + if LibVersion < SSL_get_ex_data_X509_STORE_CTX_idx_introduced then + begin + {$if declared(FC_SSL_get_ex_data_X509_STORE_CTX_idx)} + SSL_get_ex_data_X509_STORE_CTX_idx := @FC_SSL_get_ex_data_X509_STORE_CTX_idx; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_get_ex_data_X509_STORE_CTX_idx_removed)} + if SSL_get_ex_data_X509_STORE_CTX_idx_removed <= LibVersion then + begin + {$if declared(_SSL_get_ex_data_X509_STORE_CTX_idx)} + SSL_get_ex_data_X509_STORE_CTX_idx := @_SSL_get_ex_data_X509_STORE_CTX_idx; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_get_ex_data_X509_STORE_CTX_idx_allownil)} + if FuncLoadError then + AFailed.Add('SSL_get_ex_data_X509_STORE_CTX_idx'); + {$ifend} + end; + + + SSL_CTX_set_default_read_buffer_len := LoadLibFunction(ADllHandle, SSL_CTX_set_default_read_buffer_len_procname); + FuncLoadError := not assigned(SSL_CTX_set_default_read_buffer_len); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_set_default_read_buffer_len_allownil)} + SSL_CTX_set_default_read_buffer_len := @ERR_SSL_CTX_set_default_read_buffer_len; + {$ifend} + {$if declared(SSL_CTX_set_default_read_buffer_len_introduced)} + if LibVersion < SSL_CTX_set_default_read_buffer_len_introduced then + begin + {$if declared(FC_SSL_CTX_set_default_read_buffer_len)} + SSL_CTX_set_default_read_buffer_len := @FC_SSL_CTX_set_default_read_buffer_len; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_set_default_read_buffer_len_removed)} + if SSL_CTX_set_default_read_buffer_len_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_set_default_read_buffer_len)} + SSL_CTX_set_default_read_buffer_len := @_SSL_CTX_set_default_read_buffer_len; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_set_default_read_buffer_len_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_set_default_read_buffer_len'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_set_default_read_buffer_len := LoadLibFunction(ADllHandle, SSL_set_default_read_buffer_len_procname); + FuncLoadError := not assigned(SSL_set_default_read_buffer_len); + if FuncLoadError then + begin + {$if not defined(SSL_set_default_read_buffer_len_allownil)} + SSL_set_default_read_buffer_len := @ERR_SSL_set_default_read_buffer_len; + {$ifend} + {$if declared(SSL_set_default_read_buffer_len_introduced)} + if LibVersion < SSL_set_default_read_buffer_len_introduced then + begin + {$if declared(FC_SSL_set_default_read_buffer_len)} + SSL_set_default_read_buffer_len := @FC_SSL_set_default_read_buffer_len; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_set_default_read_buffer_len_removed)} + if SSL_set_default_read_buffer_len_removed <= LibVersion then + begin + {$if declared(_SSL_set_default_read_buffer_len)} + SSL_set_default_read_buffer_len := @_SSL_set_default_read_buffer_len; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_set_default_read_buffer_len_allownil)} + if FuncLoadError then + AFailed.Add('SSL_set_default_read_buffer_len'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_CTX_set_tmp_dh_callback := LoadLibFunction(ADllHandle, SSL_CTX_set_tmp_dh_callback_procname); + FuncLoadError := not assigned(SSL_CTX_set_tmp_dh_callback); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_set_tmp_dh_callback_allownil)} + SSL_CTX_set_tmp_dh_callback := @ERR_SSL_CTX_set_tmp_dh_callback; + {$ifend} + {$if declared(SSL_CTX_set_tmp_dh_callback_introduced)} + if LibVersion < SSL_CTX_set_tmp_dh_callback_introduced then + begin + {$if declared(FC_SSL_CTX_set_tmp_dh_callback)} + SSL_CTX_set_tmp_dh_callback := @FC_SSL_CTX_set_tmp_dh_callback; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_set_tmp_dh_callback_removed)} + if SSL_CTX_set_tmp_dh_callback_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_set_tmp_dh_callback)} + SSL_CTX_set_tmp_dh_callback := @_SSL_CTX_set_tmp_dh_callback; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_set_tmp_dh_callback_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_set_tmp_dh_callback'); + {$ifend} + end; + + + SSL_set_tmp_dh_callback := LoadLibFunction(ADllHandle, SSL_set_tmp_dh_callback_procname); + FuncLoadError := not assigned(SSL_set_tmp_dh_callback); + if FuncLoadError then + begin + {$if not defined(SSL_set_tmp_dh_callback_allownil)} + SSL_set_tmp_dh_callback := @ERR_SSL_set_tmp_dh_callback; + {$ifend} + {$if declared(SSL_set_tmp_dh_callback_introduced)} + if LibVersion < SSL_set_tmp_dh_callback_introduced then + begin + {$if declared(FC_SSL_set_tmp_dh_callback)} + SSL_set_tmp_dh_callback := @FC_SSL_set_tmp_dh_callback; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_set_tmp_dh_callback_removed)} + if SSL_set_tmp_dh_callback_removed <= LibVersion then + begin + {$if declared(_SSL_set_tmp_dh_callback)} + SSL_set_tmp_dh_callback := @_SSL_set_tmp_dh_callback; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_set_tmp_dh_callback_allownil)} + if FuncLoadError then + AFailed.Add('SSL_set_tmp_dh_callback'); + {$ifend} + end; + + + SSL_CIPHER_find := LoadLibFunction(ADllHandle, SSL_CIPHER_find_procname); + FuncLoadError := not assigned(SSL_CIPHER_find); + if FuncLoadError then + begin + {$if not defined(SSL_CIPHER_find_allownil)} + SSL_CIPHER_find := @ERR_SSL_CIPHER_find; + {$ifend} + {$if declared(SSL_CIPHER_find_introduced)} + if LibVersion < SSL_CIPHER_find_introduced then + begin + {$if declared(FC_SSL_CIPHER_find)} + SSL_CIPHER_find := @FC_SSL_CIPHER_find; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CIPHER_find_removed)} + if SSL_CIPHER_find_removed <= LibVersion then + begin + {$if declared(_SSL_CIPHER_find)} + SSL_CIPHER_find := @_SSL_CIPHER_find; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CIPHER_find_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CIPHER_find'); + {$ifend} + end; + + + SSL_CIPHER_get_cipher_nid := LoadLibFunction(ADllHandle, SSL_CIPHER_get_cipher_nid_procname); + FuncLoadError := not assigned(SSL_CIPHER_get_cipher_nid); + if FuncLoadError then + begin + {$if not defined(SSL_CIPHER_get_cipher_nid_allownil)} + SSL_CIPHER_get_cipher_nid := @ERR_SSL_CIPHER_get_cipher_nid; + {$ifend} + {$if declared(SSL_CIPHER_get_cipher_nid_introduced)} + if LibVersion < SSL_CIPHER_get_cipher_nid_introduced then + begin + {$if declared(FC_SSL_CIPHER_get_cipher_nid)} + SSL_CIPHER_get_cipher_nid := @FC_SSL_CIPHER_get_cipher_nid; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CIPHER_get_cipher_nid_removed)} + if SSL_CIPHER_get_cipher_nid_removed <= LibVersion then + begin + {$if declared(_SSL_CIPHER_get_cipher_nid)} + SSL_CIPHER_get_cipher_nid := @_SSL_CIPHER_get_cipher_nid; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CIPHER_get_cipher_nid_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CIPHER_get_cipher_nid'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_CIPHER_get_digest_nid := LoadLibFunction(ADllHandle, SSL_CIPHER_get_digest_nid_procname); + FuncLoadError := not assigned(SSL_CIPHER_get_digest_nid); + if FuncLoadError then + begin + {$if not defined(SSL_CIPHER_get_digest_nid_allownil)} + SSL_CIPHER_get_digest_nid := @ERR_SSL_CIPHER_get_digest_nid; + {$ifend} + {$if declared(SSL_CIPHER_get_digest_nid_introduced)} + if LibVersion < SSL_CIPHER_get_digest_nid_introduced then + begin + {$if declared(FC_SSL_CIPHER_get_digest_nid)} + SSL_CIPHER_get_digest_nid := @FC_SSL_CIPHER_get_digest_nid; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CIPHER_get_digest_nid_removed)} + if SSL_CIPHER_get_digest_nid_removed <= LibVersion then + begin + {$if declared(_SSL_CIPHER_get_digest_nid)} + SSL_CIPHER_get_digest_nid := @_SSL_CIPHER_get_digest_nid; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CIPHER_get_digest_nid_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CIPHER_get_digest_nid'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_set_session_ticket_ext := LoadLibFunction(ADllHandle, SSL_set_session_ticket_ext_procname); + FuncLoadError := not assigned(SSL_set_session_ticket_ext); + if FuncLoadError then + begin + {$if not defined(SSL_set_session_ticket_ext_allownil)} + SSL_set_session_ticket_ext := @ERR_SSL_set_session_ticket_ext; + {$ifend} + {$if declared(SSL_set_session_ticket_ext_introduced)} + if LibVersion < SSL_set_session_ticket_ext_introduced then + begin + {$if declared(FC_SSL_set_session_ticket_ext)} + SSL_set_session_ticket_ext := @FC_SSL_set_session_ticket_ext; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_set_session_ticket_ext_removed)} + if SSL_set_session_ticket_ext_removed <= LibVersion then + begin + {$if declared(_SSL_set_session_ticket_ext)} + SSL_set_session_ticket_ext := @_SSL_set_session_ticket_ext; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_set_session_ticket_ext_allownil)} + if FuncLoadError then + AFailed.Add('SSL_set_session_ticket_ext'); + {$ifend} + end; + + + SSL_set_session_ticket_ext_cb := LoadLibFunction(ADllHandle, SSL_set_session_ticket_ext_cb_procname); + FuncLoadError := not assigned(SSL_set_session_ticket_ext_cb); + if FuncLoadError then + begin + {$if not defined(SSL_set_session_ticket_ext_cb_allownil)} + SSL_set_session_ticket_ext_cb := @ERR_SSL_set_session_ticket_ext_cb; + {$ifend} + {$if declared(SSL_set_session_ticket_ext_cb_introduced)} + if LibVersion < SSL_set_session_ticket_ext_cb_introduced then + begin + {$if declared(FC_SSL_set_session_ticket_ext_cb)} + SSL_set_session_ticket_ext_cb := @FC_SSL_set_session_ticket_ext_cb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_set_session_ticket_ext_cb_removed)} + if SSL_set_session_ticket_ext_cb_removed <= LibVersion then + begin + {$if declared(_SSL_set_session_ticket_ext_cb)} + SSL_set_session_ticket_ext_cb := @_SSL_set_session_ticket_ext_cb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_set_session_ticket_ext_cb_allownil)} + if FuncLoadError then + AFailed.Add('SSL_set_session_ticket_ext_cb'); + {$ifend} + end; + + + SSL_CTX_set_not_resumable_session_callback := LoadLibFunction(ADllHandle, SSL_CTX_set_not_resumable_session_callback_procname); + FuncLoadError := not assigned(SSL_CTX_set_not_resumable_session_callback); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_set_not_resumable_session_callback_allownil)} + SSL_CTX_set_not_resumable_session_callback := @ERR_SSL_CTX_set_not_resumable_session_callback; + {$ifend} + {$if declared(SSL_CTX_set_not_resumable_session_callback_introduced)} + if LibVersion < SSL_CTX_set_not_resumable_session_callback_introduced then + begin + {$if declared(FC_SSL_CTX_set_not_resumable_session_callback)} + SSL_CTX_set_not_resumable_session_callback := @FC_SSL_CTX_set_not_resumable_session_callback; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_set_not_resumable_session_callback_removed)} + if SSL_CTX_set_not_resumable_session_callback_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_set_not_resumable_session_callback)} + SSL_CTX_set_not_resumable_session_callback := @_SSL_CTX_set_not_resumable_session_callback; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_set_not_resumable_session_callback_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_set_not_resumable_session_callback'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_set_not_resumable_session_callback := LoadLibFunction(ADllHandle, SSL_set_not_resumable_session_callback_procname); + FuncLoadError := not assigned(SSL_set_not_resumable_session_callback); + if FuncLoadError then + begin + {$if not defined(SSL_set_not_resumable_session_callback_allownil)} + SSL_set_not_resumable_session_callback := @ERR_SSL_set_not_resumable_session_callback; + {$ifend} + {$if declared(SSL_set_not_resumable_session_callback_introduced)} + if LibVersion < SSL_set_not_resumable_session_callback_introduced then + begin + {$if declared(FC_SSL_set_not_resumable_session_callback)} + SSL_set_not_resumable_session_callback := @FC_SSL_set_not_resumable_session_callback; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_set_not_resumable_session_callback_removed)} + if SSL_set_not_resumable_session_callback_removed <= LibVersion then + begin + {$if declared(_SSL_set_not_resumable_session_callback)} + SSL_set_not_resumable_session_callback := @_SSL_set_not_resumable_session_callback; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_set_not_resumable_session_callback_allownil)} + if FuncLoadError then + AFailed.Add('SSL_set_not_resumable_session_callback'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_CTX_set_record_padding_callback := LoadLibFunction(ADllHandle, SSL_CTX_set_record_padding_callback_procname); + FuncLoadError := not assigned(SSL_CTX_set_record_padding_callback); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_set_record_padding_callback_allownil)} + SSL_CTX_set_record_padding_callback := @ERR_SSL_CTX_set_record_padding_callback; + {$ifend} + {$if declared(SSL_CTX_set_record_padding_callback_introduced)} + if LibVersion < SSL_CTX_set_record_padding_callback_introduced then + begin + {$if declared(FC_SSL_CTX_set_record_padding_callback)} + SSL_CTX_set_record_padding_callback := @FC_SSL_CTX_set_record_padding_callback; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_set_record_padding_callback_removed)} + if SSL_CTX_set_record_padding_callback_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_set_record_padding_callback)} + SSL_CTX_set_record_padding_callback := @_SSL_CTX_set_record_padding_callback; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_set_record_padding_callback_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_set_record_padding_callback'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_CTX_set_record_padding_callback_arg := LoadLibFunction(ADllHandle, SSL_CTX_set_record_padding_callback_arg_procname); + FuncLoadError := not assigned(SSL_CTX_set_record_padding_callback_arg); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_set_record_padding_callback_arg_allownil)} + SSL_CTX_set_record_padding_callback_arg := @ERR_SSL_CTX_set_record_padding_callback_arg; + {$ifend} + {$if declared(SSL_CTX_set_record_padding_callback_arg_introduced)} + if LibVersion < SSL_CTX_set_record_padding_callback_arg_introduced then + begin + {$if declared(FC_SSL_CTX_set_record_padding_callback_arg)} + SSL_CTX_set_record_padding_callback_arg := @FC_SSL_CTX_set_record_padding_callback_arg; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_set_record_padding_callback_arg_removed)} + if SSL_CTX_set_record_padding_callback_arg_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_set_record_padding_callback_arg)} + SSL_CTX_set_record_padding_callback_arg := @_SSL_CTX_set_record_padding_callback_arg; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_set_record_padding_callback_arg_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_set_record_padding_callback_arg'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_CTX_get_record_padding_callback_arg := LoadLibFunction(ADllHandle, SSL_CTX_get_record_padding_callback_arg_procname); + FuncLoadError := not assigned(SSL_CTX_get_record_padding_callback_arg); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_get_record_padding_callback_arg_allownil)} + SSL_CTX_get_record_padding_callback_arg := @ERR_SSL_CTX_get_record_padding_callback_arg; + {$ifend} + {$if declared(SSL_CTX_get_record_padding_callback_arg_introduced)} + if LibVersion < SSL_CTX_get_record_padding_callback_arg_introduced then + begin + {$if declared(FC_SSL_CTX_get_record_padding_callback_arg)} + SSL_CTX_get_record_padding_callback_arg := @FC_SSL_CTX_get_record_padding_callback_arg; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_get_record_padding_callback_arg_removed)} + if SSL_CTX_get_record_padding_callback_arg_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_get_record_padding_callback_arg)} + SSL_CTX_get_record_padding_callback_arg := @_SSL_CTX_get_record_padding_callback_arg; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_get_record_padding_callback_arg_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_get_record_padding_callback_arg'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_CTX_set_block_padding := LoadLibFunction(ADllHandle, SSL_CTX_set_block_padding_procname); + FuncLoadError := not assigned(SSL_CTX_set_block_padding); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_set_block_padding_allownil)} + SSL_CTX_set_block_padding := @ERR_SSL_CTX_set_block_padding; + {$ifend} + {$if declared(SSL_CTX_set_block_padding_introduced)} + if LibVersion < SSL_CTX_set_block_padding_introduced then + begin + {$if declared(FC_SSL_CTX_set_block_padding)} + SSL_CTX_set_block_padding := @FC_SSL_CTX_set_block_padding; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_set_block_padding_removed)} + if SSL_CTX_set_block_padding_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_set_block_padding)} + SSL_CTX_set_block_padding := @_SSL_CTX_set_block_padding; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_set_block_padding_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_set_block_padding'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_set_record_padding_callback := LoadLibFunction(ADllHandle, SSL_set_record_padding_callback_procname); + FuncLoadError := not assigned(SSL_set_record_padding_callback); + if FuncLoadError then + begin + {$if not defined(SSL_set_record_padding_callback_allownil)} + SSL_set_record_padding_callback := @ERR_SSL_set_record_padding_callback; + {$ifend} + {$if declared(SSL_set_record_padding_callback_introduced)} + if LibVersion < SSL_set_record_padding_callback_introduced then + begin + {$if declared(FC_SSL_set_record_padding_callback)} + SSL_set_record_padding_callback := @FC_SSL_set_record_padding_callback; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_set_record_padding_callback_removed)} + if SSL_set_record_padding_callback_removed <= LibVersion then + begin + {$if declared(_SSL_set_record_padding_callback)} + SSL_set_record_padding_callback := @_SSL_set_record_padding_callback; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_set_record_padding_callback_allownil)} + if FuncLoadError then + AFailed.Add('SSL_set_record_padding_callback'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_set_record_padding_callback_arg := LoadLibFunction(ADllHandle, SSL_set_record_padding_callback_arg_procname); + FuncLoadError := not assigned(SSL_set_record_padding_callback_arg); + if FuncLoadError then + begin + {$if not defined(SSL_set_record_padding_callback_arg_allownil)} + SSL_set_record_padding_callback_arg := @ERR_SSL_set_record_padding_callback_arg; + {$ifend} + {$if declared(SSL_set_record_padding_callback_arg_introduced)} + if LibVersion < SSL_set_record_padding_callback_arg_introduced then + begin + {$if declared(FC_SSL_set_record_padding_callback_arg)} + SSL_set_record_padding_callback_arg := @FC_SSL_set_record_padding_callback_arg; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_set_record_padding_callback_arg_removed)} + if SSL_set_record_padding_callback_arg_removed <= LibVersion then + begin + {$if declared(_SSL_set_record_padding_callback_arg)} + SSL_set_record_padding_callback_arg := @_SSL_set_record_padding_callback_arg; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_set_record_padding_callback_arg_allownil)} + if FuncLoadError then + AFailed.Add('SSL_set_record_padding_callback_arg'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_get_record_padding_callback_arg := LoadLibFunction(ADllHandle, SSL_get_record_padding_callback_arg_procname); + FuncLoadError := not assigned(SSL_get_record_padding_callback_arg); + if FuncLoadError then + begin + {$if not defined(SSL_get_record_padding_callback_arg_allownil)} + SSL_get_record_padding_callback_arg := @ERR_SSL_get_record_padding_callback_arg; + {$ifend} + {$if declared(SSL_get_record_padding_callback_arg_introduced)} + if LibVersion < SSL_get_record_padding_callback_arg_introduced then + begin + {$if declared(FC_SSL_get_record_padding_callback_arg)} + SSL_get_record_padding_callback_arg := @FC_SSL_get_record_padding_callback_arg; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_get_record_padding_callback_arg_removed)} + if SSL_get_record_padding_callback_arg_removed <= LibVersion then + begin + {$if declared(_SSL_get_record_padding_callback_arg)} + SSL_get_record_padding_callback_arg := @_SSL_get_record_padding_callback_arg; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_get_record_padding_callback_arg_allownil)} + if FuncLoadError then + AFailed.Add('SSL_get_record_padding_callback_arg'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_set_block_padding := LoadLibFunction(ADllHandle, SSL_set_block_padding_procname); + FuncLoadError := not assigned(SSL_set_block_padding); + if FuncLoadError then + begin + {$if not defined(SSL_set_block_padding_allownil)} + SSL_set_block_padding := @ERR_SSL_set_block_padding; + {$ifend} + {$if declared(SSL_set_block_padding_introduced)} + if LibVersion < SSL_set_block_padding_introduced then + begin + {$if declared(FC_SSL_set_block_padding)} + SSL_set_block_padding := @FC_SSL_set_block_padding; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_set_block_padding_removed)} + if SSL_set_block_padding_removed <= LibVersion then + begin + {$if declared(_SSL_set_block_padding)} + SSL_set_block_padding := @_SSL_set_block_padding; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_set_block_padding_allownil)} + if FuncLoadError then + AFailed.Add('SSL_set_block_padding'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_set_num_tickets := LoadLibFunction(ADllHandle, SSL_set_num_tickets_procname); + FuncLoadError := not assigned(SSL_set_num_tickets); + if FuncLoadError then + begin + {$if not defined(SSL_set_num_tickets_allownil)} + SSL_set_num_tickets := @ERR_SSL_set_num_tickets; + {$ifend} + {$if declared(SSL_set_num_tickets_introduced)} + if LibVersion < SSL_set_num_tickets_introduced then + begin + {$if declared(FC_SSL_set_num_tickets)} + SSL_set_num_tickets := @FC_SSL_set_num_tickets; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_set_num_tickets_removed)} + if SSL_set_num_tickets_removed <= LibVersion then + begin + {$if declared(_SSL_set_num_tickets)} + SSL_set_num_tickets := @_SSL_set_num_tickets; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_set_num_tickets_allownil)} + if FuncLoadError then + AFailed.Add('SSL_set_num_tickets'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_get_num_tickets := LoadLibFunction(ADllHandle, SSL_get_num_tickets_procname); + FuncLoadError := not assigned(SSL_get_num_tickets); + if FuncLoadError then + begin + {$if not defined(SSL_get_num_tickets_allownil)} + SSL_get_num_tickets := @ERR_SSL_get_num_tickets; + {$ifend} + {$if declared(SSL_get_num_tickets_introduced)} + if LibVersion < SSL_get_num_tickets_introduced then + begin + {$if declared(FC_SSL_get_num_tickets)} + SSL_get_num_tickets := @FC_SSL_get_num_tickets; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_get_num_tickets_removed)} + if SSL_get_num_tickets_removed <= LibVersion then + begin + {$if declared(_SSL_get_num_tickets)} + SSL_get_num_tickets := @_SSL_get_num_tickets; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_get_num_tickets_allownil)} + if FuncLoadError then + AFailed.Add('SSL_get_num_tickets'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_CTX_set_num_tickets := LoadLibFunction(ADllHandle, SSL_CTX_set_num_tickets_procname); + FuncLoadError := not assigned(SSL_CTX_set_num_tickets); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_set_num_tickets_allownil)} + SSL_CTX_set_num_tickets := @ERR_SSL_CTX_set_num_tickets; + {$ifend} + {$if declared(SSL_CTX_set_num_tickets_introduced)} + if LibVersion < SSL_CTX_set_num_tickets_introduced then + begin + {$if declared(FC_SSL_CTX_set_num_tickets)} + SSL_CTX_set_num_tickets := @FC_SSL_CTX_set_num_tickets; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_set_num_tickets_removed)} + if SSL_CTX_set_num_tickets_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_set_num_tickets)} + SSL_CTX_set_num_tickets := @_SSL_CTX_set_num_tickets; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_set_num_tickets_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_set_num_tickets'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_CTX_get_num_tickets := LoadLibFunction(ADllHandle, SSL_CTX_get_num_tickets_procname); + FuncLoadError := not assigned(SSL_CTX_get_num_tickets); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_get_num_tickets_allownil)} + SSL_CTX_get_num_tickets := @ERR_SSL_CTX_get_num_tickets; + {$ifend} + {$if declared(SSL_CTX_get_num_tickets_introduced)} + if LibVersion < SSL_CTX_get_num_tickets_introduced then + begin + {$if declared(FC_SSL_CTX_get_num_tickets)} + SSL_CTX_get_num_tickets := @FC_SSL_CTX_get_num_tickets; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_get_num_tickets_removed)} + if SSL_CTX_get_num_tickets_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_get_num_tickets)} + SSL_CTX_get_num_tickets := @_SSL_CTX_get_num_tickets; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_get_num_tickets_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_get_num_tickets'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_session_reused := LoadLibFunction(ADllHandle, SSL_session_reused_procname); + FuncLoadError := not assigned(SSL_session_reused); + if FuncLoadError then + begin + {$if not defined(SSL_session_reused_allownil)} + SSL_session_reused := @ERR_SSL_session_reused; + {$ifend} + {$if declared(SSL_session_reused_introduced)} + if LibVersion < SSL_session_reused_introduced then + begin + {$if declared(FC_SSL_session_reused)} + SSL_session_reused := @FC_SSL_session_reused; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_session_reused_removed)} + if SSL_session_reused_removed <= LibVersion then + begin + {$if declared(_SSL_session_reused)} + SSL_session_reused := @_SSL_session_reused; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_session_reused_allownil)} + if FuncLoadError then + AFailed.Add('SSL_session_reused'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_is_server := LoadLibFunction(ADllHandle, SSL_is_server_procname); + FuncLoadError := not assigned(SSL_is_server); + if FuncLoadError then + begin + {$if not defined(SSL_is_server_allownil)} + SSL_is_server := @ERR_SSL_is_server; + {$ifend} + {$if declared(SSL_is_server_introduced)} + if LibVersion < SSL_is_server_introduced then + begin + {$if declared(FC_SSL_is_server)} + SSL_is_server := @FC_SSL_is_server; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_is_server_removed)} + if SSL_is_server_removed <= LibVersion then + begin + {$if declared(_SSL_is_server)} + SSL_is_server := @_SSL_is_server; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_is_server_allownil)} + if FuncLoadError then + AFailed.Add('SSL_is_server'); + {$ifend} + end; + + + SSL_CONF_CTX_new := LoadLibFunction(ADllHandle, SSL_CONF_CTX_new_procname); + FuncLoadError := not assigned(SSL_CONF_CTX_new); + if FuncLoadError then + begin + {$if not defined(SSL_CONF_CTX_new_allownil)} + SSL_CONF_CTX_new := @ERR_SSL_CONF_CTX_new; + {$ifend} + {$if declared(SSL_CONF_CTX_new_introduced)} + if LibVersion < SSL_CONF_CTX_new_introduced then + begin + {$if declared(FC_SSL_CONF_CTX_new)} + SSL_CONF_CTX_new := @FC_SSL_CONF_CTX_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CONF_CTX_new_removed)} + if SSL_CONF_CTX_new_removed <= LibVersion then + begin + {$if declared(_SSL_CONF_CTX_new)} + SSL_CONF_CTX_new := @_SSL_CONF_CTX_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CONF_CTX_new_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CONF_CTX_new'); + {$ifend} + end; + + + SSL_CONF_CTX_finish := LoadLibFunction(ADllHandle, SSL_CONF_CTX_finish_procname); + FuncLoadError := not assigned(SSL_CONF_CTX_finish); + if FuncLoadError then + begin + {$if not defined(SSL_CONF_CTX_finish_allownil)} + SSL_CONF_CTX_finish := @ERR_SSL_CONF_CTX_finish; + {$ifend} + {$if declared(SSL_CONF_CTX_finish_introduced)} + if LibVersion < SSL_CONF_CTX_finish_introduced then + begin + {$if declared(FC_SSL_CONF_CTX_finish)} + SSL_CONF_CTX_finish := @FC_SSL_CONF_CTX_finish; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CONF_CTX_finish_removed)} + if SSL_CONF_CTX_finish_removed <= LibVersion then + begin + {$if declared(_SSL_CONF_CTX_finish)} + SSL_CONF_CTX_finish := @_SSL_CONF_CTX_finish; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CONF_CTX_finish_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CONF_CTX_finish'); + {$ifend} + end; + + + SSL_CONF_CTX_free := LoadLibFunction(ADllHandle, SSL_CONF_CTX_free_procname); + FuncLoadError := not assigned(SSL_CONF_CTX_free); + if FuncLoadError then + begin + {$if not defined(SSL_CONF_CTX_free_allownil)} + SSL_CONF_CTX_free := @ERR_SSL_CONF_CTX_free; + {$ifend} + {$if declared(SSL_CONF_CTX_free_introduced)} + if LibVersion < SSL_CONF_CTX_free_introduced then + begin + {$if declared(FC_SSL_CONF_CTX_free)} + SSL_CONF_CTX_free := @FC_SSL_CONF_CTX_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CONF_CTX_free_removed)} + if SSL_CONF_CTX_free_removed <= LibVersion then + begin + {$if declared(_SSL_CONF_CTX_free)} + SSL_CONF_CTX_free := @_SSL_CONF_CTX_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CONF_CTX_free_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CONF_CTX_free'); + {$ifend} + end; + + + SSL_CONF_CTX_set_flags := LoadLibFunction(ADllHandle, SSL_CONF_CTX_set_flags_procname); + FuncLoadError := not assigned(SSL_CONF_CTX_set_flags); + if FuncLoadError then + begin + {$if not defined(SSL_CONF_CTX_set_flags_allownil)} + SSL_CONF_CTX_set_flags := @ERR_SSL_CONF_CTX_set_flags; + {$ifend} + {$if declared(SSL_CONF_CTX_set_flags_introduced)} + if LibVersion < SSL_CONF_CTX_set_flags_introduced then + begin + {$if declared(FC_SSL_CONF_CTX_set_flags)} + SSL_CONF_CTX_set_flags := @FC_SSL_CONF_CTX_set_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CONF_CTX_set_flags_removed)} + if SSL_CONF_CTX_set_flags_removed <= LibVersion then + begin + {$if declared(_SSL_CONF_CTX_set_flags)} + SSL_CONF_CTX_set_flags := @_SSL_CONF_CTX_set_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CONF_CTX_set_flags_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CONF_CTX_set_flags'); + {$ifend} + end; + + + SSL_CONF_CTX_clear_flags := LoadLibFunction(ADllHandle, SSL_CONF_CTX_clear_flags_procname); + FuncLoadError := not assigned(SSL_CONF_CTX_clear_flags); + if FuncLoadError then + begin + {$if not defined(SSL_CONF_CTX_clear_flags_allownil)} + SSL_CONF_CTX_clear_flags := @ERR_SSL_CONF_CTX_clear_flags; + {$ifend} + {$if declared(SSL_CONF_CTX_clear_flags_introduced)} + if LibVersion < SSL_CONF_CTX_clear_flags_introduced then + begin + {$if declared(FC_SSL_CONF_CTX_clear_flags)} + SSL_CONF_CTX_clear_flags := @FC_SSL_CONF_CTX_clear_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CONF_CTX_clear_flags_removed)} + if SSL_CONF_CTX_clear_flags_removed <= LibVersion then + begin + {$if declared(_SSL_CONF_CTX_clear_flags)} + SSL_CONF_CTX_clear_flags := @_SSL_CONF_CTX_clear_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CONF_CTX_clear_flags_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CONF_CTX_clear_flags'); + {$ifend} + end; + + + SSL_CONF_CTX_set1_prefix := LoadLibFunction(ADllHandle, SSL_CONF_CTX_set1_prefix_procname); + FuncLoadError := not assigned(SSL_CONF_CTX_set1_prefix); + if FuncLoadError then + begin + {$if not defined(SSL_CONF_CTX_set1_prefix_allownil)} + SSL_CONF_CTX_set1_prefix := @ERR_SSL_CONF_CTX_set1_prefix; + {$ifend} + {$if declared(SSL_CONF_CTX_set1_prefix_introduced)} + if LibVersion < SSL_CONF_CTX_set1_prefix_introduced then + begin + {$if declared(FC_SSL_CONF_CTX_set1_prefix)} + SSL_CONF_CTX_set1_prefix := @FC_SSL_CONF_CTX_set1_prefix; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CONF_CTX_set1_prefix_removed)} + if SSL_CONF_CTX_set1_prefix_removed <= LibVersion then + begin + {$if declared(_SSL_CONF_CTX_set1_prefix)} + SSL_CONF_CTX_set1_prefix := @_SSL_CONF_CTX_set1_prefix; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CONF_CTX_set1_prefix_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CONF_CTX_set1_prefix'); + {$ifend} + end; + + + SSL_CONF_cmd := LoadLibFunction(ADllHandle, SSL_CONF_cmd_procname); + FuncLoadError := not assigned(SSL_CONF_cmd); + if FuncLoadError then + begin + {$if not defined(SSL_CONF_cmd_allownil)} + SSL_CONF_cmd := @ERR_SSL_CONF_cmd; + {$ifend} + {$if declared(SSL_CONF_cmd_introduced)} + if LibVersion < SSL_CONF_cmd_introduced then + begin + {$if declared(FC_SSL_CONF_cmd)} + SSL_CONF_cmd := @FC_SSL_CONF_cmd; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CONF_cmd_removed)} + if SSL_CONF_cmd_removed <= LibVersion then + begin + {$if declared(_SSL_CONF_cmd)} + SSL_CONF_cmd := @_SSL_CONF_cmd; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CONF_cmd_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CONF_cmd'); + {$ifend} + end; + + + SSL_CONF_cmd_argv := LoadLibFunction(ADllHandle, SSL_CONF_cmd_argv_procname); + FuncLoadError := not assigned(SSL_CONF_cmd_argv); + if FuncLoadError then + begin + {$if not defined(SSL_CONF_cmd_argv_allownil)} + SSL_CONF_cmd_argv := @ERR_SSL_CONF_cmd_argv; + {$ifend} + {$if declared(SSL_CONF_cmd_argv_introduced)} + if LibVersion < SSL_CONF_cmd_argv_introduced then + begin + {$if declared(FC_SSL_CONF_cmd_argv)} + SSL_CONF_cmd_argv := @FC_SSL_CONF_cmd_argv; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CONF_cmd_argv_removed)} + if SSL_CONF_cmd_argv_removed <= LibVersion then + begin + {$if declared(_SSL_CONF_cmd_argv)} + SSL_CONF_cmd_argv := @_SSL_CONF_cmd_argv; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CONF_cmd_argv_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CONF_cmd_argv'); + {$ifend} + end; + + + SSL_CONF_cmd_value_type := LoadLibFunction(ADllHandle, SSL_CONF_cmd_value_type_procname); + FuncLoadError := not assigned(SSL_CONF_cmd_value_type); + if FuncLoadError then + begin + {$if not defined(SSL_CONF_cmd_value_type_allownil)} + SSL_CONF_cmd_value_type := @ERR_SSL_CONF_cmd_value_type; + {$ifend} + {$if declared(SSL_CONF_cmd_value_type_introduced)} + if LibVersion < SSL_CONF_cmd_value_type_introduced then + begin + {$if declared(FC_SSL_CONF_cmd_value_type)} + SSL_CONF_cmd_value_type := @FC_SSL_CONF_cmd_value_type; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CONF_cmd_value_type_removed)} + if SSL_CONF_cmd_value_type_removed <= LibVersion then + begin + {$if declared(_SSL_CONF_cmd_value_type)} + SSL_CONF_cmd_value_type := @_SSL_CONF_cmd_value_type; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CONF_cmd_value_type_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CONF_cmd_value_type'); + {$ifend} + end; + + + SSL_CONF_CTX_set_ssl := LoadLibFunction(ADllHandle, SSL_CONF_CTX_set_ssl_procname); + FuncLoadError := not assigned(SSL_CONF_CTX_set_ssl); + if FuncLoadError then + begin + {$if not defined(SSL_CONF_CTX_set_ssl_allownil)} + SSL_CONF_CTX_set_ssl := @ERR_SSL_CONF_CTX_set_ssl; + {$ifend} + {$if declared(SSL_CONF_CTX_set_ssl_introduced)} + if LibVersion < SSL_CONF_CTX_set_ssl_introduced then + begin + {$if declared(FC_SSL_CONF_CTX_set_ssl)} + SSL_CONF_CTX_set_ssl := @FC_SSL_CONF_CTX_set_ssl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CONF_CTX_set_ssl_removed)} + if SSL_CONF_CTX_set_ssl_removed <= LibVersion then + begin + {$if declared(_SSL_CONF_CTX_set_ssl)} + SSL_CONF_CTX_set_ssl := @_SSL_CONF_CTX_set_ssl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CONF_CTX_set_ssl_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CONF_CTX_set_ssl'); + {$ifend} + end; + + + SSL_CONF_CTX_set_ssl_ctx := LoadLibFunction(ADllHandle, SSL_CONF_CTX_set_ssl_ctx_procname); + FuncLoadError := not assigned(SSL_CONF_CTX_set_ssl_ctx); + if FuncLoadError then + begin + {$if not defined(SSL_CONF_CTX_set_ssl_ctx_allownil)} + SSL_CONF_CTX_set_ssl_ctx := @ERR_SSL_CONF_CTX_set_ssl_ctx; + {$ifend} + {$if declared(SSL_CONF_CTX_set_ssl_ctx_introduced)} + if LibVersion < SSL_CONF_CTX_set_ssl_ctx_introduced then + begin + {$if declared(FC_SSL_CONF_CTX_set_ssl_ctx)} + SSL_CONF_CTX_set_ssl_ctx := @FC_SSL_CONF_CTX_set_ssl_ctx; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CONF_CTX_set_ssl_ctx_removed)} + if SSL_CONF_CTX_set_ssl_ctx_removed <= LibVersion then + begin + {$if declared(_SSL_CONF_CTX_set_ssl_ctx)} + SSL_CONF_CTX_set_ssl_ctx := @_SSL_CONF_CTX_set_ssl_ctx; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CONF_CTX_set_ssl_ctx_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CONF_CTX_set_ssl_ctx'); + {$ifend} + end; + + + SSL_add_ssl_module := LoadLibFunction(ADllHandle, SSL_add_ssl_module_procname); + FuncLoadError := not assigned(SSL_add_ssl_module); + if FuncLoadError then + begin + {$if not defined(SSL_add_ssl_module_allownil)} + SSL_add_ssl_module := @ERR_SSL_add_ssl_module; + {$ifend} + {$if declared(SSL_add_ssl_module_introduced)} + if LibVersion < SSL_add_ssl_module_introduced then + begin + {$if declared(FC_SSL_add_ssl_module)} + SSL_add_ssl_module := @FC_SSL_add_ssl_module; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_add_ssl_module_removed)} + if SSL_add_ssl_module_removed <= LibVersion then + begin + {$if declared(_SSL_add_ssl_module)} + SSL_add_ssl_module := @_SSL_add_ssl_module; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_add_ssl_module_allownil)} + if FuncLoadError then + AFailed.Add('SSL_add_ssl_module'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_config := LoadLibFunction(ADllHandle, SSL_config_procname); + FuncLoadError := not assigned(SSL_config); + if FuncLoadError then + begin + {$if not defined(SSL_config_allownil)} + SSL_config := @ERR_SSL_config; + {$ifend} + {$if declared(SSL_config_introduced)} + if LibVersion < SSL_config_introduced then + begin + {$if declared(FC_SSL_config)} + SSL_config := @FC_SSL_config; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_config_removed)} + if SSL_config_removed <= LibVersion then + begin + {$if declared(_SSL_config)} + SSL_config := @_SSL_config; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_config_allownil)} + if FuncLoadError then + AFailed.Add('SSL_config'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_CTX_config := LoadLibFunction(ADllHandle, SSL_CTX_config_procname); + FuncLoadError := not assigned(SSL_CTX_config); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_config_allownil)} + SSL_CTX_config := @ERR_SSL_CTX_config; + {$ifend} + {$if declared(SSL_CTX_config_introduced)} + if LibVersion < SSL_CTX_config_introduced then + begin + {$if declared(FC_SSL_CTX_config)} + SSL_CTX_config := @FC_SSL_CTX_config; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_config_removed)} + if SSL_CTX_config_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_config)} + SSL_CTX_config := @_SSL_CTX_config; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_config_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_config'); + {$ifend} + end; + + {introduced 1.1.0} + DTLSv1_listen := LoadLibFunction(ADllHandle, DTLSv1_listen_procname); + FuncLoadError := not assigned(DTLSv1_listen); + if FuncLoadError then + begin + {$if not defined(DTLSv1_listen_allownil)} + DTLSv1_listen := @ERR_DTLSv1_listen; + {$ifend} + {$if declared(DTLSv1_listen_introduced)} + if LibVersion < DTLSv1_listen_introduced then + begin + {$if declared(FC_DTLSv1_listen)} + DTLSv1_listen := @FC_DTLSv1_listen; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DTLSv1_listen_removed)} + if DTLSv1_listen_removed <= LibVersion then + begin + {$if declared(_DTLSv1_listen)} + DTLSv1_listen := @_DTLSv1_listen; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DTLSv1_listen_allownil)} + if FuncLoadError then + AFailed.Add('DTLSv1_listen'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_enable_ct := LoadLibFunction(ADllHandle, SSL_enable_ct_procname); + FuncLoadError := not assigned(SSL_enable_ct); + if FuncLoadError then + begin + {$if not defined(SSL_enable_ct_allownil)} + SSL_enable_ct := @ERR_SSL_enable_ct; + {$ifend} + {$if declared(SSL_enable_ct_introduced)} + if LibVersion < SSL_enable_ct_introduced then + begin + {$if declared(FC_SSL_enable_ct)} + SSL_enable_ct := @FC_SSL_enable_ct; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_enable_ct_removed)} + if SSL_enable_ct_removed <= LibVersion then + begin + {$if declared(_SSL_enable_ct)} + SSL_enable_ct := @_SSL_enable_ct; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_enable_ct_allownil)} + if FuncLoadError then + AFailed.Add('SSL_enable_ct'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_CTX_enable_ct := LoadLibFunction(ADllHandle, SSL_CTX_enable_ct_procname); + FuncLoadError := not assigned(SSL_CTX_enable_ct); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_enable_ct_allownil)} + SSL_CTX_enable_ct := @ERR_SSL_CTX_enable_ct; + {$ifend} + {$if declared(SSL_CTX_enable_ct_introduced)} + if LibVersion < SSL_CTX_enable_ct_introduced then + begin + {$if declared(FC_SSL_CTX_enable_ct)} + SSL_CTX_enable_ct := @FC_SSL_CTX_enable_ct; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_enable_ct_removed)} + if SSL_CTX_enable_ct_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_enable_ct)} + SSL_CTX_enable_ct := @_SSL_CTX_enable_ct; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_enable_ct_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_enable_ct'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_ct_is_enabled := LoadLibFunction(ADllHandle, SSL_ct_is_enabled_procname); + FuncLoadError := not assigned(SSL_ct_is_enabled); + if FuncLoadError then + begin + {$if not defined(SSL_ct_is_enabled_allownil)} + SSL_ct_is_enabled := @ERR_SSL_ct_is_enabled; + {$ifend} + {$if declared(SSL_ct_is_enabled_introduced)} + if LibVersion < SSL_ct_is_enabled_introduced then + begin + {$if declared(FC_SSL_ct_is_enabled)} + SSL_ct_is_enabled := @FC_SSL_ct_is_enabled; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_ct_is_enabled_removed)} + if SSL_ct_is_enabled_removed <= LibVersion then + begin + {$if declared(_SSL_ct_is_enabled)} + SSL_ct_is_enabled := @_SSL_ct_is_enabled; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_ct_is_enabled_allownil)} + if FuncLoadError then + AFailed.Add('SSL_ct_is_enabled'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_CTX_ct_is_enabled := LoadLibFunction(ADllHandle, SSL_CTX_ct_is_enabled_procname); + FuncLoadError := not assigned(SSL_CTX_ct_is_enabled); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_ct_is_enabled_allownil)} + SSL_CTX_ct_is_enabled := @ERR_SSL_CTX_ct_is_enabled; + {$ifend} + {$if declared(SSL_CTX_ct_is_enabled_introduced)} + if LibVersion < SSL_CTX_ct_is_enabled_introduced then + begin + {$if declared(FC_SSL_CTX_ct_is_enabled)} + SSL_CTX_ct_is_enabled := @FC_SSL_CTX_ct_is_enabled; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_ct_is_enabled_removed)} + if SSL_CTX_ct_is_enabled_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_ct_is_enabled)} + SSL_CTX_ct_is_enabled := @_SSL_CTX_ct_is_enabled; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_ct_is_enabled_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_ct_is_enabled'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_CTX_set_default_ctlog_list_file := LoadLibFunction(ADllHandle, SSL_CTX_set_default_ctlog_list_file_procname); + FuncLoadError := not assigned(SSL_CTX_set_default_ctlog_list_file); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_set_default_ctlog_list_file_allownil)} + SSL_CTX_set_default_ctlog_list_file := @ERR_SSL_CTX_set_default_ctlog_list_file; + {$ifend} + {$if declared(SSL_CTX_set_default_ctlog_list_file_introduced)} + if LibVersion < SSL_CTX_set_default_ctlog_list_file_introduced then + begin + {$if declared(FC_SSL_CTX_set_default_ctlog_list_file)} + SSL_CTX_set_default_ctlog_list_file := @FC_SSL_CTX_set_default_ctlog_list_file; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_set_default_ctlog_list_file_removed)} + if SSL_CTX_set_default_ctlog_list_file_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_set_default_ctlog_list_file)} + SSL_CTX_set_default_ctlog_list_file := @_SSL_CTX_set_default_ctlog_list_file; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_set_default_ctlog_list_file_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_set_default_ctlog_list_file'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_CTX_set_ctlog_list_file := LoadLibFunction(ADllHandle, SSL_CTX_set_ctlog_list_file_procname); + FuncLoadError := not assigned(SSL_CTX_set_ctlog_list_file); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_set_ctlog_list_file_allownil)} + SSL_CTX_set_ctlog_list_file := @ERR_SSL_CTX_set_ctlog_list_file; + {$ifend} + {$if declared(SSL_CTX_set_ctlog_list_file_introduced)} + if LibVersion < SSL_CTX_set_ctlog_list_file_introduced then + begin + {$if declared(FC_SSL_CTX_set_ctlog_list_file)} + SSL_CTX_set_ctlog_list_file := @FC_SSL_CTX_set_ctlog_list_file; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_set_ctlog_list_file_removed)} + if SSL_CTX_set_ctlog_list_file_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_set_ctlog_list_file)} + SSL_CTX_set_ctlog_list_file := @_SSL_CTX_set_ctlog_list_file; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_set_ctlog_list_file_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_set_ctlog_list_file'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_CTX_set0_ctlog_store := LoadLibFunction(ADllHandle, SSL_CTX_set0_ctlog_store_procname); + FuncLoadError := not assigned(SSL_CTX_set0_ctlog_store); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_set0_ctlog_store_allownil)} + SSL_CTX_set0_ctlog_store := @ERR_SSL_CTX_set0_ctlog_store; + {$ifend} + {$if declared(SSL_CTX_set0_ctlog_store_introduced)} + if LibVersion < SSL_CTX_set0_ctlog_store_introduced then + begin + {$if declared(FC_SSL_CTX_set0_ctlog_store)} + SSL_CTX_set0_ctlog_store := @FC_SSL_CTX_set0_ctlog_store; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_set0_ctlog_store_removed)} + if SSL_CTX_set0_ctlog_store_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_set0_ctlog_store)} + SSL_CTX_set0_ctlog_store := @_SSL_CTX_set0_ctlog_store; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_set0_ctlog_store_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_set0_ctlog_store'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_set_security_level := LoadLibFunction(ADllHandle, SSL_set_security_level_procname); + FuncLoadError := not assigned(SSL_set_security_level); + if FuncLoadError then + begin + {$if not defined(SSL_set_security_level_allownil)} + SSL_set_security_level := @ERR_SSL_set_security_level; + {$ifend} + {$if declared(SSL_set_security_level_introduced)} + if LibVersion < SSL_set_security_level_introduced then + begin + {$if declared(FC_SSL_set_security_level)} + SSL_set_security_level := @FC_SSL_set_security_level; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_set_security_level_removed)} + if SSL_set_security_level_removed <= LibVersion then + begin + {$if declared(_SSL_set_security_level)} + SSL_set_security_level := @_SSL_set_security_level; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_set_security_level_allownil)} + if FuncLoadError then + AFailed.Add('SSL_set_security_level'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_set_security_callback := LoadLibFunction(ADllHandle, SSL_set_security_callback_procname); + FuncLoadError := not assigned(SSL_set_security_callback); + if FuncLoadError then + begin + {$if not defined(SSL_set_security_callback_allownil)} + SSL_set_security_callback := @ERR_SSL_set_security_callback; + {$ifend} + {$if declared(SSL_set_security_callback_introduced)} + if LibVersion < SSL_set_security_callback_introduced then + begin + {$if declared(FC_SSL_set_security_callback)} + SSL_set_security_callback := @FC_SSL_set_security_callback; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_set_security_callback_removed)} + if SSL_set_security_callback_removed <= LibVersion then + begin + {$if declared(_SSL_set_security_callback)} + SSL_set_security_callback := @_SSL_set_security_callback; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_set_security_callback_allownil)} + if FuncLoadError then + AFailed.Add('SSL_set_security_callback'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_get_security_callback := LoadLibFunction(ADllHandle, SSL_get_security_callback_procname); + FuncLoadError := not assigned(SSL_get_security_callback); + if FuncLoadError then + begin + {$if not defined(SSL_get_security_callback_allownil)} + SSL_get_security_callback := @ERR_SSL_get_security_callback; + {$ifend} + {$if declared(SSL_get_security_callback_introduced)} + if LibVersion < SSL_get_security_callback_introduced then + begin + {$if declared(FC_SSL_get_security_callback)} + SSL_get_security_callback := @FC_SSL_get_security_callback; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_get_security_callback_removed)} + if SSL_get_security_callback_removed <= LibVersion then + begin + {$if declared(_SSL_get_security_callback)} + SSL_get_security_callback := @_SSL_get_security_callback; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_get_security_callback_allownil)} + if FuncLoadError then + AFailed.Add('SSL_get_security_callback'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_set0_security_ex_data := LoadLibFunction(ADllHandle, SSL_set0_security_ex_data_procname); + FuncLoadError := not assigned(SSL_set0_security_ex_data); + if FuncLoadError then + begin + {$if not defined(SSL_set0_security_ex_data_allownil)} + SSL_set0_security_ex_data := @ERR_SSL_set0_security_ex_data; + {$ifend} + {$if declared(SSL_set0_security_ex_data_introduced)} + if LibVersion < SSL_set0_security_ex_data_introduced then + begin + {$if declared(FC_SSL_set0_security_ex_data)} + SSL_set0_security_ex_data := @FC_SSL_set0_security_ex_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_set0_security_ex_data_removed)} + if SSL_set0_security_ex_data_removed <= LibVersion then + begin + {$if declared(_SSL_set0_security_ex_data)} + SSL_set0_security_ex_data := @_SSL_set0_security_ex_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_set0_security_ex_data_allownil)} + if FuncLoadError then + AFailed.Add('SSL_set0_security_ex_data'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_get0_security_ex_data := LoadLibFunction(ADllHandle, SSL_get0_security_ex_data_procname); + FuncLoadError := not assigned(SSL_get0_security_ex_data); + if FuncLoadError then + begin + {$if not defined(SSL_get0_security_ex_data_allownil)} + SSL_get0_security_ex_data := @ERR_SSL_get0_security_ex_data; + {$ifend} + {$if declared(SSL_get0_security_ex_data_introduced)} + if LibVersion < SSL_get0_security_ex_data_introduced then + begin + {$if declared(FC_SSL_get0_security_ex_data)} + SSL_get0_security_ex_data := @FC_SSL_get0_security_ex_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_get0_security_ex_data_removed)} + if SSL_get0_security_ex_data_removed <= LibVersion then + begin + {$if declared(_SSL_get0_security_ex_data)} + SSL_get0_security_ex_data := @_SSL_get0_security_ex_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_get0_security_ex_data_allownil)} + if FuncLoadError then + AFailed.Add('SSL_get0_security_ex_data'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_CTX_set_security_level := LoadLibFunction(ADllHandle, SSL_CTX_set_security_level_procname); + FuncLoadError := not assigned(SSL_CTX_set_security_level); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_set_security_level_allownil)} + SSL_CTX_set_security_level := @ERR_SSL_CTX_set_security_level; + {$ifend} + {$if declared(SSL_CTX_set_security_level_introduced)} + if LibVersion < SSL_CTX_set_security_level_introduced then + begin + {$if declared(FC_SSL_CTX_set_security_level)} + SSL_CTX_set_security_level := @FC_SSL_CTX_set_security_level; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_set_security_level_removed)} + if SSL_CTX_set_security_level_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_set_security_level)} + SSL_CTX_set_security_level := @_SSL_CTX_set_security_level; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_set_security_level_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_set_security_level'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_CTX_get_security_level := LoadLibFunction(ADllHandle, SSL_CTX_get_security_level_procname); + FuncLoadError := not assigned(SSL_CTX_get_security_level); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_get_security_level_allownil)} + SSL_CTX_get_security_level := @ERR_SSL_CTX_get_security_level; + {$ifend} + {$if declared(SSL_CTX_get_security_level_introduced)} + if LibVersion < SSL_CTX_get_security_level_introduced then + begin + {$if declared(FC_SSL_CTX_get_security_level)} + SSL_CTX_get_security_level := @FC_SSL_CTX_get_security_level; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_get_security_level_removed)} + if SSL_CTX_get_security_level_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_get_security_level)} + SSL_CTX_get_security_level := @_SSL_CTX_get_security_level; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_get_security_level_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_get_security_level'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_CTX_get0_security_ex_data := LoadLibFunction(ADllHandle, SSL_CTX_get0_security_ex_data_procname); + FuncLoadError := not assigned(SSL_CTX_get0_security_ex_data); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_get0_security_ex_data_allownil)} + SSL_CTX_get0_security_ex_data := @ERR_SSL_CTX_get0_security_ex_data; + {$ifend} + {$if declared(SSL_CTX_get0_security_ex_data_introduced)} + if LibVersion < SSL_CTX_get0_security_ex_data_introduced then + begin + {$if declared(FC_SSL_CTX_get0_security_ex_data)} + SSL_CTX_get0_security_ex_data := @FC_SSL_CTX_get0_security_ex_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_get0_security_ex_data_removed)} + if SSL_CTX_get0_security_ex_data_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_get0_security_ex_data)} + SSL_CTX_get0_security_ex_data := @_SSL_CTX_get0_security_ex_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_get0_security_ex_data_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_get0_security_ex_data'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_CTX_set0_security_ex_data := LoadLibFunction(ADllHandle, SSL_CTX_set0_security_ex_data_procname); + FuncLoadError := not assigned(SSL_CTX_set0_security_ex_data); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_set0_security_ex_data_allownil)} + SSL_CTX_set0_security_ex_data := @ERR_SSL_CTX_set0_security_ex_data; + {$ifend} + {$if declared(SSL_CTX_set0_security_ex_data_introduced)} + if LibVersion < SSL_CTX_set0_security_ex_data_introduced then + begin + {$if declared(FC_SSL_CTX_set0_security_ex_data)} + SSL_CTX_set0_security_ex_data := @FC_SSL_CTX_set0_security_ex_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_set0_security_ex_data_removed)} + if SSL_CTX_set0_security_ex_data_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_set0_security_ex_data)} + SSL_CTX_set0_security_ex_data := @_SSL_CTX_set0_security_ex_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_set0_security_ex_data_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_set0_security_ex_data'); + {$ifend} + end; + + {introduced 1.1.0} + OPENSSL_init_ssl := LoadLibFunction(ADllHandle, OPENSSL_init_ssl_procname); + FuncLoadError := not assigned(OPENSSL_init_ssl); + if FuncLoadError then + begin + {$if not defined(OPENSSL_init_ssl_allownil)} + OPENSSL_init_ssl := @ERR_OPENSSL_init_ssl; + {$ifend} + {$if declared(OPENSSL_init_ssl_introduced)} + if LibVersion < OPENSSL_init_ssl_introduced then + begin + {$if declared(FC_OPENSSL_init_ssl)} + OPENSSL_init_ssl := @FC_OPENSSL_init_ssl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OPENSSL_init_ssl_removed)} + if OPENSSL_init_ssl_removed <= LibVersion then + begin + {$if declared(_OPENSSL_init_ssl)} + OPENSSL_init_ssl := @_OPENSSL_init_ssl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OPENSSL_init_ssl_allownil)} + if FuncLoadError then + AFailed.Add('OPENSSL_init_ssl'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_free_buffers := LoadLibFunction(ADllHandle, SSL_free_buffers_procname); + FuncLoadError := not assigned(SSL_free_buffers); + if FuncLoadError then + begin + {$if not defined(SSL_free_buffers_allownil)} + SSL_free_buffers := @ERR_SSL_free_buffers; + {$ifend} + {$if declared(SSL_free_buffers_introduced)} + if LibVersion < SSL_free_buffers_introduced then + begin + {$if declared(FC_SSL_free_buffers)} + SSL_free_buffers := @FC_SSL_free_buffers; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_free_buffers_removed)} + if SSL_free_buffers_removed <= LibVersion then + begin + {$if declared(_SSL_free_buffers)} + SSL_free_buffers := @_SSL_free_buffers; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_free_buffers_allownil)} + if FuncLoadError then + AFailed.Add('SSL_free_buffers'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_alloc_buffers := LoadLibFunction(ADllHandle, SSL_alloc_buffers_procname); + FuncLoadError := not assigned(SSL_alloc_buffers); + if FuncLoadError then + begin + {$if not defined(SSL_alloc_buffers_allownil)} + SSL_alloc_buffers := @ERR_SSL_alloc_buffers; + {$ifend} + {$if declared(SSL_alloc_buffers_introduced)} + if LibVersion < SSL_alloc_buffers_introduced then + begin + {$if declared(FC_SSL_alloc_buffers)} + SSL_alloc_buffers := @FC_SSL_alloc_buffers; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_alloc_buffers_removed)} + if SSL_alloc_buffers_removed <= LibVersion then + begin + {$if declared(_SSL_alloc_buffers)} + SSL_alloc_buffers := @_SSL_alloc_buffers; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_alloc_buffers_allownil)} + if FuncLoadError then + AFailed.Add('SSL_alloc_buffers'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_CTX_set_session_ticket_cb := LoadLibFunction(ADllHandle, SSL_CTX_set_session_ticket_cb_procname); + FuncLoadError := not assigned(SSL_CTX_set_session_ticket_cb); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_set_session_ticket_cb_allownil)} + SSL_CTX_set_session_ticket_cb := @ERR_SSL_CTX_set_session_ticket_cb; + {$ifend} + {$if declared(SSL_CTX_set_session_ticket_cb_introduced)} + if LibVersion < SSL_CTX_set_session_ticket_cb_introduced then + begin + {$if declared(FC_SSL_CTX_set_session_ticket_cb)} + SSL_CTX_set_session_ticket_cb := @FC_SSL_CTX_set_session_ticket_cb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_set_session_ticket_cb_removed)} + if SSL_CTX_set_session_ticket_cb_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_set_session_ticket_cb)} + SSL_CTX_set_session_ticket_cb := @_SSL_CTX_set_session_ticket_cb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_set_session_ticket_cb_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_set_session_ticket_cb'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_SESSION_set1_ticket_appdata := LoadLibFunction(ADllHandle, SSL_SESSION_set1_ticket_appdata_procname); + FuncLoadError := not assigned(SSL_SESSION_set1_ticket_appdata); + if FuncLoadError then + begin + {$if not defined(SSL_SESSION_set1_ticket_appdata_allownil)} + SSL_SESSION_set1_ticket_appdata := @ERR_SSL_SESSION_set1_ticket_appdata; + {$ifend} + {$if declared(SSL_SESSION_set1_ticket_appdata_introduced)} + if LibVersion < SSL_SESSION_set1_ticket_appdata_introduced then + begin + {$if declared(FC_SSL_SESSION_set1_ticket_appdata)} + SSL_SESSION_set1_ticket_appdata := @FC_SSL_SESSION_set1_ticket_appdata; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_SESSION_set1_ticket_appdata_removed)} + if SSL_SESSION_set1_ticket_appdata_removed <= LibVersion then + begin + {$if declared(_SSL_SESSION_set1_ticket_appdata)} + SSL_SESSION_set1_ticket_appdata := @_SSL_SESSION_set1_ticket_appdata; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_SESSION_set1_ticket_appdata_allownil)} + if FuncLoadError then + AFailed.Add('SSL_SESSION_set1_ticket_appdata'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_SESSION_get0_ticket_appdata := LoadLibFunction(ADllHandle, SSL_SESSION_get0_ticket_appdata_procname); + FuncLoadError := not assigned(SSL_SESSION_get0_ticket_appdata); + if FuncLoadError then + begin + {$if not defined(SSL_SESSION_get0_ticket_appdata_allownil)} + SSL_SESSION_get0_ticket_appdata := @ERR_SSL_SESSION_get0_ticket_appdata; + {$ifend} + {$if declared(SSL_SESSION_get0_ticket_appdata_introduced)} + if LibVersion < SSL_SESSION_get0_ticket_appdata_introduced then + begin + {$if declared(FC_SSL_SESSION_get0_ticket_appdata)} + SSL_SESSION_get0_ticket_appdata := @FC_SSL_SESSION_get0_ticket_appdata; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_SESSION_get0_ticket_appdata_removed)} + if SSL_SESSION_get0_ticket_appdata_removed <= LibVersion then + begin + {$if declared(_SSL_SESSION_get0_ticket_appdata)} + SSL_SESSION_get0_ticket_appdata := @_SSL_SESSION_get0_ticket_appdata; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_SESSION_get0_ticket_appdata_allownil)} + if FuncLoadError then + AFailed.Add('SSL_SESSION_get0_ticket_appdata'); + {$ifend} + end; + + {introduced 1.1.0} + DTLS_set_timer_cb := LoadLibFunction(ADllHandle, DTLS_set_timer_cb_procname); + FuncLoadError := not assigned(DTLS_set_timer_cb); + if FuncLoadError then + begin + {$if not defined(DTLS_set_timer_cb_allownil)} + DTLS_set_timer_cb := @ERR_DTLS_set_timer_cb; + {$ifend} + {$if declared(DTLS_set_timer_cb_introduced)} + if LibVersion < DTLS_set_timer_cb_introduced then + begin + {$if declared(FC_DTLS_set_timer_cb)} + DTLS_set_timer_cb := @FC_DTLS_set_timer_cb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DTLS_set_timer_cb_removed)} + if DTLS_set_timer_cb_removed <= LibVersion then + begin + {$if declared(_DTLS_set_timer_cb)} + DTLS_set_timer_cb := @_DTLS_set_timer_cb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DTLS_set_timer_cb_allownil)} + if FuncLoadError then + AFailed.Add('DTLS_set_timer_cb'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_CTX_set_allow_early_data_cb := LoadLibFunction(ADllHandle, SSL_CTX_set_allow_early_data_cb_procname); + FuncLoadError := not assigned(SSL_CTX_set_allow_early_data_cb); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_set_allow_early_data_cb_allownil)} + SSL_CTX_set_allow_early_data_cb := @ERR_SSL_CTX_set_allow_early_data_cb; + {$ifend} + {$if declared(SSL_CTX_set_allow_early_data_cb_introduced)} + if LibVersion < SSL_CTX_set_allow_early_data_cb_introduced then + begin + {$if declared(FC_SSL_CTX_set_allow_early_data_cb)} + SSL_CTX_set_allow_early_data_cb := @FC_SSL_CTX_set_allow_early_data_cb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_set_allow_early_data_cb_removed)} + if SSL_CTX_set_allow_early_data_cb_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_set_allow_early_data_cb)} + SSL_CTX_set_allow_early_data_cb := @_SSL_CTX_set_allow_early_data_cb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_set_allow_early_data_cb_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_set_allow_early_data_cb'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_set_allow_early_data_cb := LoadLibFunction(ADllHandle, SSL_set_allow_early_data_cb_procname); + FuncLoadError := not assigned(SSL_set_allow_early_data_cb); + if FuncLoadError then + begin + {$if not defined(SSL_set_allow_early_data_cb_allownil)} + SSL_set_allow_early_data_cb := @ERR_SSL_set_allow_early_data_cb; + {$ifend} + {$if declared(SSL_set_allow_early_data_cb_introduced)} + if LibVersion < SSL_set_allow_early_data_cb_introduced then + begin + {$if declared(FC_SSL_set_allow_early_data_cb)} + SSL_set_allow_early_data_cb := @FC_SSL_set_allow_early_data_cb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_set_allow_early_data_cb_removed)} + if SSL_set_allow_early_data_cb_removed <= LibVersion then + begin + {$if declared(_SSL_set_allow_early_data_cb)} + SSL_set_allow_early_data_cb := @_SSL_set_allow_early_data_cb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_set_allow_early_data_cb_allownil)} + if FuncLoadError then + AFailed.Add('SSL_set_allow_early_data_cb'); + {$ifend} + end; + + {introduced 1.1.0} + SSLv2_method := LoadLibFunction(ADllHandle, SSLv2_method_procname); + FuncLoadError := not assigned(SSLv2_method); + if FuncLoadError then + begin + {$if not defined(SSLv2_method_allownil)} + SSLv2_method := @ERR_SSLv2_method; + {$ifend} + {$if declared(SSLv2_method_introduced)} + if LibVersion < SSLv2_method_introduced then + begin + {$if declared(FC_SSLv2_method)} + SSLv2_method := @FC_SSLv2_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSLv2_method_removed)} + if SSLv2_method_removed <= LibVersion then + begin + {$if declared(_SSLv2_method)} + SSLv2_method := @_SSLv2_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSLv2_method_allownil)} + if FuncLoadError then + AFailed.Add('SSLv2_method'); + {$ifend} + end; + + {removed 1.1.0 allow_nil} // SSLv2 + SSLv2_server_method := LoadLibFunction(ADllHandle, SSLv2_server_method_procname); + FuncLoadError := not assigned(SSLv2_server_method); + if FuncLoadError then + begin + {$if not defined(SSLv2_server_method_allownil)} + SSLv2_server_method := @ERR_SSLv2_server_method; + {$ifend} + {$if declared(SSLv2_server_method_introduced)} + if LibVersion < SSLv2_server_method_introduced then + begin + {$if declared(FC_SSLv2_server_method)} + SSLv2_server_method := @FC_SSLv2_server_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSLv2_server_method_removed)} + if SSLv2_server_method_removed <= LibVersion then + begin + {$if declared(_SSLv2_server_method)} + SSLv2_server_method := @_SSLv2_server_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSLv2_server_method_allownil)} + if FuncLoadError then + AFailed.Add('SSLv2_server_method'); + {$ifend} + end; + + {removed 1.1.0 allow_nil} // SSLv2 + SSLv2_client_method := LoadLibFunction(ADllHandle, SSLv2_client_method_procname); + FuncLoadError := not assigned(SSLv2_client_method); + if FuncLoadError then + begin + {$if not defined(SSLv2_client_method_allownil)} + SSLv2_client_method := @ERR_SSLv2_client_method; + {$ifend} + {$if declared(SSLv2_client_method_introduced)} + if LibVersion < SSLv2_client_method_introduced then + begin + {$if declared(FC_SSLv2_client_method)} + SSLv2_client_method := @FC_SSLv2_client_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSLv2_client_method_removed)} + if SSLv2_client_method_removed <= LibVersion then + begin + {$if declared(_SSLv2_client_method)} + SSLv2_client_method := @_SSLv2_client_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSLv2_client_method_allownil)} + if FuncLoadError then + AFailed.Add('SSLv2_client_method'); + {$ifend} + end; + + {removed 1.1.0 allow_nil} // SSLv2 + SSLv3_method := LoadLibFunction(ADllHandle, SSLv3_method_procname); + FuncLoadError := not assigned(SSLv3_method); + if FuncLoadError then + begin + {$if not defined(SSLv3_method_allownil)} + SSLv3_method := @ERR_SSLv3_method; + {$ifend} + {$if declared(SSLv3_method_introduced)} + if LibVersion < SSLv3_method_introduced then + begin + {$if declared(FC_SSLv3_method)} + SSLv3_method := @FC_SSLv3_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSLv3_method_removed)} + if SSLv3_method_removed <= LibVersion then + begin + {$if declared(_SSLv3_method)} + SSLv3_method := @_SSLv3_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSLv3_method_allownil)} + if FuncLoadError then + AFailed.Add('SSLv3_method'); + {$ifend} + end; + + {removed 1.1.0 allow_nil} // SSLv3 + SSLv3_server_method := LoadLibFunction(ADllHandle, SSLv3_server_method_procname); + FuncLoadError := not assigned(SSLv3_server_method); + if FuncLoadError then + begin + {$if not defined(SSLv3_server_method_allownil)} + SSLv3_server_method := @ERR_SSLv3_server_method; + {$ifend} + {$if declared(SSLv3_server_method_introduced)} + if LibVersion < SSLv3_server_method_introduced then + begin + {$if declared(FC_SSLv3_server_method)} + SSLv3_server_method := @FC_SSLv3_server_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSLv3_server_method_removed)} + if SSLv3_server_method_removed <= LibVersion then + begin + {$if declared(_SSLv3_server_method)} + SSLv3_server_method := @_SSLv3_server_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSLv3_server_method_allownil)} + if FuncLoadError then + AFailed.Add('SSLv3_server_method'); + {$ifend} + end; + + {removed 1.1.0 allow_nil} // SSLv3 + SSLv3_client_method := LoadLibFunction(ADllHandle, SSLv3_client_method_procname); + FuncLoadError := not assigned(SSLv3_client_method); + if FuncLoadError then + begin + {$if not defined(SSLv3_client_method_allownil)} + SSLv3_client_method := @ERR_SSLv3_client_method; + {$ifend} + {$if declared(SSLv3_client_method_introduced)} + if LibVersion < SSLv3_client_method_introduced then + begin + {$if declared(FC_SSLv3_client_method)} + SSLv3_client_method := @FC_SSLv3_client_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSLv3_client_method_removed)} + if SSLv3_client_method_removed <= LibVersion then + begin + {$if declared(_SSLv3_client_method)} + SSLv3_client_method := @_SSLv3_client_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSLv3_client_method_allownil)} + if FuncLoadError then + AFailed.Add('SSLv3_client_method'); + {$ifend} + end; + + {removed 1.1.0 allow_nil} // SSLv3 + SSLv23_method := LoadLibFunction(ADllHandle, SSLv23_method_procname); + FuncLoadError := not assigned(SSLv23_method); + if FuncLoadError then + begin + {$if not defined(SSLv23_method_allownil)} + SSLv23_method := @ERR_SSLv23_method; + {$ifend} + {$if declared(SSLv23_method_introduced)} + if LibVersion < SSLv23_method_introduced then + begin + {$if declared(FC_SSLv23_method)} + SSLv23_method := @FC_SSLv23_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSLv23_method_removed)} + if SSLv23_method_removed <= LibVersion then + begin + {$if declared(_SSLv23_method)} + SSLv23_method := @_SSLv23_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSLv23_method_allownil)} + if FuncLoadError then + AFailed.Add('SSLv23_method'); + {$ifend} + end; + + {removed 1.1.0 allow_nil} // SSLv3 but can rollback to v2 + SSLv23_server_method := LoadLibFunction(ADllHandle, SSLv23_server_method_procname); + FuncLoadError := not assigned(SSLv23_server_method); + if FuncLoadError then + begin + {$if not defined(SSLv23_server_method_allownil)} + SSLv23_server_method := @ERR_SSLv23_server_method; + {$ifend} + {$if declared(SSLv23_server_method_introduced)} + if LibVersion < SSLv23_server_method_introduced then + begin + {$if declared(FC_SSLv23_server_method)} + SSLv23_server_method := @FC_SSLv23_server_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSLv23_server_method_removed)} + if SSLv23_server_method_removed <= LibVersion then + begin + {$if declared(_SSLv23_server_method)} + SSLv23_server_method := @_SSLv23_server_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSLv23_server_method_allownil)} + if FuncLoadError then + AFailed.Add('SSLv23_server_method'); + {$ifend} + end; + + {removed 1.1.0 allow_nil} // SSLv3 but can rollback to v2 + SSLv23_client_method := LoadLibFunction(ADllHandle, SSLv23_client_method_procname); + FuncLoadError := not assigned(SSLv23_client_method); + if FuncLoadError then + begin + {$if not defined(SSLv23_client_method_allownil)} + SSLv23_client_method := @ERR_SSLv23_client_method; + {$ifend} + {$if declared(SSLv23_client_method_introduced)} + if LibVersion < SSLv23_client_method_introduced then + begin + {$if declared(FC_SSLv23_client_method)} + SSLv23_client_method := @FC_SSLv23_client_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSLv23_client_method_removed)} + if SSLv23_client_method_removed <= LibVersion then + begin + {$if declared(_SSLv23_client_method)} + SSLv23_client_method := @_SSLv23_client_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSLv23_client_method_allownil)} + if FuncLoadError then + AFailed.Add('SSLv23_client_method'); + {$ifend} + end; + + {removed 1.1.0 allow_nil} // SSLv3 but can rollback to v2 + TLSv1_method := LoadLibFunction(ADllHandle, TLSv1_method_procname); + FuncLoadError := not assigned(TLSv1_method); + if FuncLoadError then + begin + {$if not defined(TLSv1_method_allownil)} + TLSv1_method := @ERR_TLSv1_method; + {$ifend} + {$if declared(TLSv1_method_introduced)} + if LibVersion < TLSv1_method_introduced then + begin + {$if declared(FC_TLSv1_method)} + TLSv1_method := @FC_TLSv1_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TLSv1_method_removed)} + if TLSv1_method_removed <= LibVersion then + begin + {$if declared(_TLSv1_method)} + TLSv1_method := @_TLSv1_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TLSv1_method_allownil)} + if FuncLoadError then + AFailed.Add('TLSv1_method'); + {$ifend} + end; + + {removed 1.1.0 allow_nil} // TLSv1.0 + TLSv1_server_method := LoadLibFunction(ADllHandle, TLSv1_server_method_procname); + FuncLoadError := not assigned(TLSv1_server_method); + if FuncLoadError then + begin + {$if not defined(TLSv1_server_method_allownil)} + TLSv1_server_method := @ERR_TLSv1_server_method; + {$ifend} + {$if declared(TLSv1_server_method_introduced)} + if LibVersion < TLSv1_server_method_introduced then + begin + {$if declared(FC_TLSv1_server_method)} + TLSv1_server_method := @FC_TLSv1_server_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TLSv1_server_method_removed)} + if TLSv1_server_method_removed <= LibVersion then + begin + {$if declared(_TLSv1_server_method)} + TLSv1_server_method := @_TLSv1_server_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TLSv1_server_method_allownil)} + if FuncLoadError then + AFailed.Add('TLSv1_server_method'); + {$ifend} + end; + + {removed 1.1.0 allow_nil} // TLSv1.0 + TLSv1_client_method := LoadLibFunction(ADllHandle, TLSv1_client_method_procname); + FuncLoadError := not assigned(TLSv1_client_method); + if FuncLoadError then + begin + {$if not defined(TLSv1_client_method_allownil)} + TLSv1_client_method := @ERR_TLSv1_client_method; + {$ifend} + {$if declared(TLSv1_client_method_introduced)} + if LibVersion < TLSv1_client_method_introduced then + begin + {$if declared(FC_TLSv1_client_method)} + TLSv1_client_method := @FC_TLSv1_client_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TLSv1_client_method_removed)} + if TLSv1_client_method_removed <= LibVersion then + begin + {$if declared(_TLSv1_client_method)} + TLSv1_client_method := @_TLSv1_client_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TLSv1_client_method_allownil)} + if FuncLoadError then + AFailed.Add('TLSv1_client_method'); + {$ifend} + end; + + {removed 1.1.0 allow_nil} // TLSv1.0 + TLSv1_1_method := LoadLibFunction(ADllHandle, TLSv1_1_method_procname); + FuncLoadError := not assigned(TLSv1_1_method); + if FuncLoadError then + begin + {$if not defined(TLSv1_1_method_allownil)} + TLSv1_1_method := @ERR_TLSv1_1_method; + {$ifend} + {$if declared(TLSv1_1_method_introduced)} + if LibVersion < TLSv1_1_method_introduced then + begin + {$if declared(FC_TLSv1_1_method)} + TLSv1_1_method := @FC_TLSv1_1_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TLSv1_1_method_removed)} + if TLSv1_1_method_removed <= LibVersion then + begin + {$if declared(_TLSv1_1_method)} + TLSv1_1_method := @_TLSv1_1_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TLSv1_1_method_allownil)} + if FuncLoadError then + AFailed.Add('TLSv1_1_method'); + {$ifend} + end; + + {removed 1.1.0 allow_nil} //TLS1.1 + TLSv1_1_server_method := LoadLibFunction(ADllHandle, TLSv1_1_server_method_procname); + FuncLoadError := not assigned(TLSv1_1_server_method); + if FuncLoadError then + begin + {$if not defined(TLSv1_1_server_method_allownil)} + TLSv1_1_server_method := @ERR_TLSv1_1_server_method; + {$ifend} + {$if declared(TLSv1_1_server_method_introduced)} + if LibVersion < TLSv1_1_server_method_introduced then + begin + {$if declared(FC_TLSv1_1_server_method)} + TLSv1_1_server_method := @FC_TLSv1_1_server_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TLSv1_1_server_method_removed)} + if TLSv1_1_server_method_removed <= LibVersion then + begin + {$if declared(_TLSv1_1_server_method)} + TLSv1_1_server_method := @_TLSv1_1_server_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TLSv1_1_server_method_allownil)} + if FuncLoadError then + AFailed.Add('TLSv1_1_server_method'); + {$ifend} + end; + + {removed 1.1.0 allow_nil} //TLS1.1 + TLSv1_1_client_method := LoadLibFunction(ADllHandle, TLSv1_1_client_method_procname); + FuncLoadError := not assigned(TLSv1_1_client_method); + if FuncLoadError then + begin + {$if not defined(TLSv1_1_client_method_allownil)} + TLSv1_1_client_method := @ERR_TLSv1_1_client_method; + {$ifend} + {$if declared(TLSv1_1_client_method_introduced)} + if LibVersion < TLSv1_1_client_method_introduced then + begin + {$if declared(FC_TLSv1_1_client_method)} + TLSv1_1_client_method := @FC_TLSv1_1_client_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TLSv1_1_client_method_removed)} + if TLSv1_1_client_method_removed <= LibVersion then + begin + {$if declared(_TLSv1_1_client_method)} + TLSv1_1_client_method := @_TLSv1_1_client_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TLSv1_1_client_method_allownil)} + if FuncLoadError then + AFailed.Add('TLSv1_1_client_method'); + {$ifend} + end; + + {removed 1.1.0 allow_nil} //TLS1.1 + TLSv1_2_method := LoadLibFunction(ADllHandle, TLSv1_2_method_procname); + FuncLoadError := not assigned(TLSv1_2_method); + if FuncLoadError then + begin + {$if not defined(TLSv1_2_method_allownil)} + TLSv1_2_method := @ERR_TLSv1_2_method; + {$ifend} + {$if declared(TLSv1_2_method_introduced)} + if LibVersion < TLSv1_2_method_introduced then + begin + {$if declared(FC_TLSv1_2_method)} + TLSv1_2_method := @FC_TLSv1_2_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TLSv1_2_method_removed)} + if TLSv1_2_method_removed <= LibVersion then + begin + {$if declared(_TLSv1_2_method)} + TLSv1_2_method := @_TLSv1_2_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TLSv1_2_method_allownil)} + if FuncLoadError then + AFailed.Add('TLSv1_2_method'); + {$ifend} + end; + + {removed 1.1.0 allow_nil} // TLSv1.2 + TLSv1_2_server_method := LoadLibFunction(ADllHandle, TLSv1_2_server_method_procname); + FuncLoadError := not assigned(TLSv1_2_server_method); + if FuncLoadError then + begin + {$if not defined(TLSv1_2_server_method_allownil)} + TLSv1_2_server_method := @ERR_TLSv1_2_server_method; + {$ifend} + {$if declared(TLSv1_2_server_method_introduced)} + if LibVersion < TLSv1_2_server_method_introduced then + begin + {$if declared(FC_TLSv1_2_server_method)} + TLSv1_2_server_method := @FC_TLSv1_2_server_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TLSv1_2_server_method_removed)} + if TLSv1_2_server_method_removed <= LibVersion then + begin + {$if declared(_TLSv1_2_server_method)} + TLSv1_2_server_method := @_TLSv1_2_server_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TLSv1_2_server_method_allownil)} + if FuncLoadError then + AFailed.Add('TLSv1_2_server_method'); + {$ifend} + end; + + {removed 1.1.0 allow_nil} // TLSv1.2 + TLSv1_2_client_method := LoadLibFunction(ADllHandle, TLSv1_2_client_method_procname); + FuncLoadError := not assigned(TLSv1_2_client_method); + if FuncLoadError then + begin + {$if not defined(TLSv1_2_client_method_allownil)} + TLSv1_2_client_method := @ERR_TLSv1_2_client_method; + {$ifend} + {$if declared(TLSv1_2_client_method_introduced)} + if LibVersion < TLSv1_2_client_method_introduced then + begin + {$if declared(FC_TLSv1_2_client_method)} + TLSv1_2_client_method := @FC_TLSv1_2_client_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TLSv1_2_client_method_removed)} + if TLSv1_2_client_method_removed <= LibVersion then + begin + {$if declared(_TLSv1_2_client_method)} + TLSv1_2_client_method := @_TLSv1_2_client_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TLSv1_2_client_method_allownil)} + if FuncLoadError then + AFailed.Add('TLSv1_2_client_method'); + {$ifend} + end; + + {removed 1.1.0 allow_nil} // TLSv1.2 + SSL_get0_peer_certificate := LoadLibFunction(ADllHandle, SSL_get0_peer_certificate_procname); + FuncLoadError := not assigned(SSL_get0_peer_certificate); + if FuncLoadError then + begin + {$if not defined(SSL_get0_peer_certificate_allownil)} + SSL_get0_peer_certificate := @ERR_SSL_get0_peer_certificate; + {$ifend} + {$if declared(SSL_get0_peer_certificate_introduced)} + if LibVersion < SSL_get0_peer_certificate_introduced then + begin + {$if declared(FC_SSL_get0_peer_certificate)} + SSL_get0_peer_certificate := @FC_SSL_get0_peer_certificate; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_get0_peer_certificate_removed)} + if SSL_get0_peer_certificate_removed <= LibVersion then + begin + {$if declared(_SSL_get0_peer_certificate)} + SSL_get0_peer_certificate := @_SSL_get0_peer_certificate; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_get0_peer_certificate_allownil)} + if FuncLoadError then + AFailed.Add('SSL_get0_peer_certificate'); + {$ifend} + end; + + {introduced 3.3.0} + SSL_get1_peer_certificate := LoadLibFunction(ADllHandle, SSL_get1_peer_certificate_procname); + FuncLoadError := not assigned(SSL_get1_peer_certificate); + if FuncLoadError then + begin + {$if not defined(SSL_get1_peer_certificate_allownil)} + SSL_get1_peer_certificate := @ERR_SSL_get1_peer_certificate; + {$ifend} + {$if declared(SSL_get1_peer_certificate_introduced)} + if LibVersion < SSL_get1_peer_certificate_introduced then + begin + {$if declared(FC_SSL_get1_peer_certificate)} + SSL_get1_peer_certificate := @FC_SSL_get1_peer_certificate; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_get1_peer_certificate_removed)} + if SSL_get1_peer_certificate_removed <= LibVersion then + begin + {$if declared(_SSL_get1_peer_certificate)} + SSL_get1_peer_certificate := @_SSL_get1_peer_certificate; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_get1_peer_certificate_allownil)} + if FuncLoadError then + AFailed.Add('SSL_get1_peer_certificate'); + {$ifend} + end; + + {introduced 3.3.0} +end; + +procedure Unload; +begin + SSL_CTX_set_mode := nil; {removed 1.0.0} + SSL_CTX_clear_mode := nil; {removed 1.0.0} + SSL_CTX_sess_set_cache_size := nil; {removed 1.0.0} + SSL_CTX_sess_get_cache_size := nil; {removed 1.0.0} + SSL_CTX_set_session_cache_mode := nil; {removed 1.0.0} + SSL_CTX_get_session_cache_mode := nil; {removed 1.0.0} + SSL_clear_num_renegotiations := nil; {removed 1.0.0} + SSL_total_renegotiations := nil; {removed 1.0.0} + SSL_CTX_set_tmp_dh := nil; {removed 1.0.0} + SSL_CTX_set_tmp_ecdh := nil; {removed 1.0.0} + SSL_CTX_set_dh_auto := nil; {removed 1.0.0} + SSL_set_dh_auto := nil; {removed 1.0.0} + SSL_set_tmp_dh := nil; {removed 1.0.0} + SSL_set_tmp_ecdh := nil; {removed 1.0.0} + SSL_CTX_add_extra_chain_cert := nil; {removed 1.0.0} + SSL_CTX_get_extra_chain_certs := nil; {removed 1.0.0} + SSL_CTX_get_extra_chain_certs_only := nil; {removed 1.0.0} + SSL_CTX_clear_extra_chain_certs := nil; {removed 1.0.0} + SSL_CTX_set0_chain := nil; {removed 1.0.0} + SSL_CTX_set1_chain := nil; {removed 1.0.0} + SSL_CTX_add0_chain_cert := nil; {removed 1.0.0} + SSL_CTX_add1_chain_cert := nil; {removed 1.0.0} + SSL_CTX_get0_chain_certs := nil; {removed 1.0.0} + SSL_CTX_clear_chain_certs := nil; {removed 1.0.0} + SSL_CTX_build_cert_chain := nil; {removed 1.0.0} + SSL_CTX_select_current_cert := nil; {removed 1.0.0} + SSL_CTX_set_current_cert := nil; {removed 1.0.0} + SSL_CTX_set0_verify_cert_store := nil; {removed 1.0.0} + SSL_CTX_set1_verify_cert_store := nil; {removed 1.0.0} + SSL_CTX_set0_chain_cert_store := nil; {removed 1.0.0} + SSL_CTX_set1_chain_cert_store := nil; {removed 1.0.0} + SSL_set0_chain := nil; {removed 1.0.0} + SSL_set1_chain := nil; {removed 1.0.0} + SSL_add0_chain_cert := nil; {removed 1.0.0} + SSL_add1_chain_cert := nil; {removed 1.0.0} + SSL_get0_chain_certs := nil; {removed 1.0.0} + SSL_clear_chain_certs := nil; {removed 1.0.0} + SSL_build_cert_chain := nil; {removed 1.0.0} + SSL_select_current_cert := nil; {removed 1.0.0} + SSL_set_current_cert := nil; {removed 1.0.0} + SSL_set0_verify_cert_store := nil; {removed 1.0.0} + SSL_set1_verify_cert_store := nil; {removed 1.0.0} + SSL_set0_chain_cert_store := nil; {removed 1.0.0} + SSL_set1_chain_cert_store := nil; {removed 1.0.0} + SSL_get1_groups := nil; {removed 1.0.0} + SSL_CTX_set1_groups := nil; {removed 1.0.0} + SSL_CTX_set1_groups_list := nil; {removed 1.0.0} + SSL_set1_groups := nil; {removed 1.0.0} + SSL_set1_groups_list := nil; {removed 1.0.0} + SSL_get_shared_group := nil; {removed 1.0.0} + SSL_CTX_set1_sigalgs := nil; {removed 1.0.0} + SSL_CTX_set1_sigalgs_list := nil; {removed 1.0.0} + SSL_set1_sigalgs := nil; {removed 1.0.0} + SSL_set1_sigalgs_list := nil; {removed 1.0.0} + SSL_CTX_set1_client_sigalgs := nil; {removed 1.0.0} + SSL_CTX_set1_client_sigalgs_list := nil; {removed 1.0.0} + SSL_set1_client_sigalgs := nil; {removed 1.0.0} + SSL_set1_client_sigalgs_list := nil; {removed 1.0.0} + SSL_get0_certificate_types := nil; {removed 1.0.0} + SSL_CTX_set1_client_certificate_types := nil; {removed 1.0.0} + SSL_set1_client_certificate_types := nil; {removed 1.0.0} + SSL_get_signature_nid := nil; {removed 1.0.0} + SSL_get_peer_signature_nid := nil; {removed 1.0.0} + SSL_get_peer_tmp_key := nil; {removed 1.0.0} + SSL_get_tmp_key := nil; {removed 1.0.0} + SSL_get0_raw_cipherlist := nil; {removed 1.0.0} + SSL_get0_ec_point_formats := nil; {removed 1.0.0} + SSL_CTX_get_options := nil; {introduced 1.1.0} + SSL_get_options := nil; {introduced 1.1.0} + SSL_CTX_clear_options := nil; {introduced 1.1.0} + SSL_clear_options := nil; {introduced 1.1.0} + SSL_CTX_set_options := nil; {introduced 1.1.0} + SSL_set_options := nil; {introduced 1.1.0} + SSL_CTX_sess_set_new_cb := nil; + SSL_CTX_sess_get_new_cb := nil; + SSL_CTX_sess_set_remove_cb := nil; + SSL_CTX_sess_get_remove_cb := nil; + SSL_CTX_set_info_callback := nil; + SSL_CTX_get_info_callback := nil; + SSL_CTX_set_client_cert_cb := nil; + SSL_CTX_get_client_cert_cb := nil; + SSL_CTX_set_client_cert_engine := nil; + SSL_CTX_set_cookie_generate_cb := nil; + SSL_CTX_set_cookie_verify_cb := nil; + SSL_CTX_set_stateless_cookie_generate_cb := nil; {introduced 1.1.0} + SSL_CTX_set_stateless_cookie_verify_cb := nil; {introduced 1.1.0} + SSL_CTX_set_alpn_select_cb := nil; + SSL_get0_alpn_selected := nil; + SSL_CTX_set_psk_client_callback := nil; + SSL_set_psk_client_callback := nil; + SSL_CTX_set_psk_server_callback := nil; + SSL_set_psk_server_callback := nil; + SSL_set_psk_find_session_callback := nil; {introduced 1.1.0} + SSL_CTX_set_psk_find_session_callback := nil; {introduced 1.1.0} + SSL_set_psk_use_session_callback := nil; {introduced 1.1.0} + SSL_CTX_set_psk_use_session_callback := nil; {introduced 1.1.0} + SSL_CTX_set_keylog_callback := nil; {introduced 1.1.0} + SSL_CTX_get_keylog_callback := nil; {introduced 1.1.0} + SSL_CTX_set_max_early_data := nil; {introduced 1.1.0} + SSL_CTX_get_max_early_data := nil; {introduced 1.1.0} + SSL_set_max_early_data := nil; {introduced 1.1.0} + SSL_get_max_early_data := nil; {introduced 1.1.0} + SSL_CTX_set_recv_max_early_data := nil; {introduced 1.1.0} + SSL_CTX_get_recv_max_early_data := nil; {introduced 1.1.0} + SSL_set_recv_max_early_data := nil; {introduced 1.1.0} + SSL_get_recv_max_early_data := nil; {introduced 1.1.0} + SSL_get_app_data := nil; {removed 1.0.0} + SSL_set_app_data := nil; {removed 1.0.0} + SSL_in_init := nil; {introduced 1.1.0} + SSL_in_before := nil; {introduced 1.1.0} + SSL_is_init_finished := nil; {introduced 1.1.0} + SSL_get_finished := nil; + SSL_get_peer_finished := nil; + SSLeay_add_ssl_algorithms := nil; {removed 1.0.0} + BIO_f_ssl := nil; + BIO_new_ssl := nil; + BIO_new_ssl_connect := nil; + BIO_new_buffer_ssl_connect := nil; + BIO_ssl_copy_session_id := nil; + SSL_CTX_set_cipher_list := nil; + SSL_CTX_new := nil; + SSL_CTX_set_timeout := nil; + SSL_CTX_get_timeout := nil; + SSL_CTX_get_cert_store := nil; + SSL_want := nil; + SSL_clear := nil; + BIO_ssl_shutdown := nil; + SSL_CTX_up_ref := nil; {introduced 1.1.0} + SSL_CTX_free := nil; + SSL_CTX_set_cert_store := nil; + SSL_CTX_set1_cert_store := nil; {introduced 1.1.0} + SSL_CTX_flush_sessions := nil; + SSL_get_current_cipher := nil; + SSL_get_pending_cipher := nil; {introduced 1.1.0} + SSL_CIPHER_get_bits := nil; + SSL_CIPHER_get_version := nil; + SSL_CIPHER_get_name := nil; + SSL_CIPHER_standard_name := nil; {introduced 1.1.0} + OPENSSL_cipher_name := nil; {introduced 1.1.0} + SSL_CIPHER_get_id := nil; + SSL_CIPHER_get_protocol_id := nil; {introduced 1.1.0} + SSL_CIPHER_get_kx_nid := nil; {introduced 1.1.0} + SSL_CIPHER_get_auth_nid := nil; {introduced 1.1.0} + SSL_CIPHER_get_handshake_digest := nil; {introduced 1.1.0} + SSL_CIPHER_is_aead := nil; {introduced 1.1.0} + SSL_get_fd := nil; + SSL_get_rfd := nil; + SSL_get_wfd := nil; + SSL_get_cipher_list := nil; + SSL_get_shared_ciphers := nil; + SSL_get_read_ahead := nil; + SSL_pending := nil; + SSL_has_pending := nil; {introduced 1.1.0} + SSL_set_fd := nil; + SSL_set_rfd := nil; + SSL_set_wfd := nil; + SSL_set0_rbio := nil; {introduced 1.1.0} + SSL_set0_wbio := nil; {introduced 1.1.0} + SSL_set_bio := nil; + SSL_get_rbio := nil; + SSL_get_wbio := nil; + SSL_set_cipher_list := nil; + SSL_CTX_set_ciphersuites := nil; {introduced 1.1.0} + SSL_set_ciphersuites := nil; {introduced 1.1.0} + SSL_get_verify_mode := nil; + SSL_get_verify_depth := nil; + SSL_get_verify_callback := nil; + SSL_set_read_ahead := nil; + SSL_set_verify := nil; + SSL_set_verify_depth := nil; + SSL_use_RSAPrivateKey := nil; + SSL_use_RSAPrivateKey_ASN1 := nil; + SSL_use_PrivateKey := nil; + SSL_use_PrivateKey_ASN1 := nil; + SSL_use_certificate := nil; + SSL_use_certificate_ASN1 := nil; + SSL_CTX_use_serverinfo := nil; + SSL_CTX_use_serverinfo_ex := nil; {introduced 1.1.0} + SSL_CTX_use_serverinfo_file := nil; + SSL_use_RSAPrivateKey_file := nil; + SSL_use_PrivateKey_file := nil; + SSL_use_certificate_file := nil; + SSL_CTX_use_RSAPrivateKey_file := nil; + SSL_CTX_use_PrivateKey_file := nil; + SSL_CTX_use_certificate_file := nil; + SSL_CTX_use_certificate_chain_file := nil; + SSL_use_certificate_chain_file := nil; {introduced 1.1.0} + SSL_load_client_CA_file := nil; + SSL_add_file_cert_subjects_to_stack := nil; + SSL_add_dir_cert_subjects_to_stack := nil; + SSL_load_error_strings := nil; {removed 1.1.0} + SSL_state_string := nil; + SSL_rstate_string := nil; + SSL_state_string_long := nil; + SSL_rstate_string_long := nil; + SSL_SESSION_get_time := nil; + SSL_SESSION_set_time := nil; + SSL_SESSION_get_timeout := nil; + SSL_SESSION_set_timeout := nil; + SSL_SESSION_get_protocol_version := nil; {introduced 1.1.0} + SSL_SESSION_set_protocol_version := nil; {introduced 1.1.0} + SSL_SESSION_get0_hostname := nil; {introduced 1.1.0} + SSL_SESSION_set1_hostname := nil; {introduced 1.1.0} + SSL_SESSION_get0_alpn_selected := nil; {introduced 1.1.0} + SSL_SESSION_set1_alpn_selected := nil; {introduced 1.1.0} + SSL_SESSION_get0_cipher := nil; {introduced 1.1.0} + SSL_SESSION_set_cipher := nil; {introduced 1.1.0} + SSL_SESSION_has_ticket := nil; {introduced 1.1.0} + SSL_SESSION_get_ticket_lifetime_hint := nil; {introduced 1.1.0} + SSL_SESSION_get0_ticket := nil; {introduced 1.1.0} + SSL_SESSION_get_max_early_data := nil; {introduced 1.1.0} + SSL_SESSION_set_max_early_data := nil; {introduced 1.1.0} + SSL_copy_session_id := nil; + SSL_SESSION_get0_peer := nil; + SSL_SESSION_set1_id_context := nil; + SSL_SESSION_set1_id := nil; {introduced 1.1.0} + SSL_SESSION_is_resumable := nil; {introduced 1.1.0} + SSL_SESSION_new := nil; + SSL_SESSION_dup := nil; {introduced 1.1.0} + SSL_SESSION_get_id := nil; + SSL_SESSION_get0_id_context := nil; {introduced 1.1.0} + SSL_SESSION_get_compress_id := nil; + SSL_SESSION_print := nil; + SSL_SESSION_print_keylog := nil; {introduced 1.1.0} + SSL_SESSION_up_ref := nil; {introduced 1.1.0} + SSL_SESSION_free := nil; + SSL_set_session := nil; + SSL_CTX_add_session := nil; + SSL_CTX_remove_session := nil; + SSL_CTX_set_generate_session_id := nil; + SSL_set_generate_session_id := nil; + SSL_has_matching_session_id := nil; + d2i_SSL_SESSION := nil; + SSL_get_peer_certificate := nil; {removed 3.0.0} + SSL_CTX_get_verify_mode := nil; + SSL_CTX_get_verify_depth := nil; + SSL_CTX_get_verify_callback := nil; + SSL_CTX_set_verify := nil; + SSL_CTX_set_verify_depth := nil; + SSL_CTX_set_cert_verify_callback := nil; + SSL_CTX_set_cert_cb := nil; + SSL_CTX_use_RSAPrivateKey := nil; + SSL_CTX_use_RSAPrivateKey_ASN1 := nil; + SSL_CTX_use_PrivateKey := nil; + SSL_CTX_use_PrivateKey_ASN1 := nil; + SSL_CTX_use_certificate := nil; + SSL_CTX_use_certificate_ASN1 := nil; + SSL_CTX_set_default_passwd_cb := nil; {introduced 1.1.0} + SSL_CTX_set_default_passwd_cb_userdata := nil; {introduced 1.1.0} + SSL_CTX_get_default_passwd_cb := nil; {introduced 1.1.0} + SSL_CTX_get_default_passwd_cb_userdata := nil; {introduced 1.1.0} + SSL_set_default_passwd_cb := nil; {introduced 1.1.0} + SSL_set_default_passwd_cb_userdata := nil; {introduced 1.1.0} + SSL_get_default_passwd_cb := nil; {introduced 1.1.0} + SSL_get_default_passwd_cb_userdata := nil; {introduced 1.1.0} + SSL_CTX_check_private_key := nil; + SSL_check_private_key := nil; + SSL_CTX_set_session_id_context := nil; + SSL_new := nil; + SSL_up_ref := nil; {introduced 1.1.0} + SSL_is_dtls := nil; {introduced 1.1.0} + SSL_set_session_id_context := nil; + SSL_CTX_set_purpose := nil; + SSL_set_purpose := nil; + SSL_CTX_set_trust := nil; + SSL_set_trust := nil; + SSL_set1_host := nil; {introduced 1.1.0} + SSL_add1_host := nil; {introduced 1.1.0} + SSL_get0_peername := nil; {introduced 1.1.0} + SSL_set_hostflags := nil; {introduced 1.1.0} + SSL_CTX_dane_enable := nil; {introduced 1.1.0} + SSL_CTX_dane_mtype_set := nil; {introduced 1.1.0} + SSL_dane_enable := nil; {introduced 1.1.0} + SSL_dane_tlsa_add := nil; {introduced 1.1.0} + SSL_get0_dane_authority := nil; {introduced 1.1.0} + SSL_get0_dane_tlsa := nil; {introduced 1.1.0} + SSL_get0_dane := nil; {introduced 1.1.0} + SSL_CTX_dane_set_flags := nil; {introduced 1.1.0} + SSL_CTX_dane_clear_flags := nil; {introduced 1.1.0} + SSL_dane_set_flags := nil; {introduced 1.1.0} + SSL_dane_clear_flags := nil; {introduced 1.1.0} + SSL_CTX_set1_param := nil; + SSL_set1_param := nil; + SSL_CTX_get0_param := nil; + SSL_get0_param := nil; + SSL_CTX_set_srp_username := nil; + SSL_CTX_set_srp_password := nil; + SSL_CTX_set_srp_strength := nil; + SSL_CTX_set_srp_client_pwd_callback := nil; + SSL_CTX_set_srp_verify_param_callback := nil; + SSL_CTX_set_srp_username_callback := nil; + SSL_CTX_set_srp_cb_arg := nil; + SSL_set_srp_server_param := nil; + SSL_set_srp_server_param_pw := nil; + SSL_CTX_set_client_hello_cb := nil; {introduced 1.1.0} + SSL_client_hello_isv2 := nil; {introduced 1.1.0} + SSL_client_hello_get0_legacy_version := nil; {introduced 1.1.0} + SSL_client_hello_get0_random := nil; {introduced 1.1.0} + SSL_client_hello_get0_session_id := nil; {introduced 1.1.0} + SSL_client_hello_get0_ciphers := nil; {introduced 1.1.0} + SSL_client_hello_get0_compression_methods := nil; {introduced 1.1.0} + SSL_client_hello_get1_extensions_present := nil; {introduced 1.1.0} + SSL_client_hello_get0_ext := nil; {introduced 1.1.0} + SSL_certs_clear := nil; + SSL_free := nil; + SSL_waiting_for_async := nil; {introduced 1.1.0} + SSL_get_all_async_fds := nil; {introduced 1.1.0} + SSL_get_changed_async_fds := nil; {introduced 1.1.0} + SSL_accept := nil; + SSL_stateless := nil; {introduced 1.1.0} + SSL_connect := nil; + SSL_read := nil; + SSL_read_ex := nil; {introduced 1.1.0} + SSL_read_early_data := nil; {introduced 1.1.0} + SSL_peek := nil; + SSL_peek_ex := nil; {introduced 1.1.0} + SSL_write := nil; + SSL_write_ex := nil; {introduced 1.1.0} + SSL_write_early_data := nil; {introduced 1.1.0} + SSL_callback_ctrl := nil; + SSL_ctrl := nil; + SSL_CTX_ctrl := nil; + SSL_CTX_callback_ctrl := nil; + SSL_get_early_data_status := nil; {introduced 1.1.0} + SSL_get_error := nil; + SSL_get_version := nil; + SSL_CTX_set_ssl_version := nil; + TLS_method := nil; {introduced 1.1.0} + TLS_server_method := nil; {introduced 1.1.0} + TLS_client_method := nil; {introduced 1.1.0} + SSL_key_update := nil; {introduced 1.1.0} + SSL_get_key_update_type := nil; {introduced 1.1.0} + SSL_renegotiate := nil; + SSL_renegotiate_abbreviated := nil; + SSL_shutdown := nil; + SSL_CTX_set_post_handshake_auth := nil; {introduced 1.1.0} + SSL_set_post_handshake_auth := nil; {introduced 1.1.0} + SSL_renegotiate_pending := nil; + SSL_verify_client_post_handshake := nil; {introduced 1.1.0} + SSL_CTX_get_ssl_method := nil; + SSL_get_ssl_method := nil; + SSL_set_ssl_method := nil; + SSL_alert_type_string_long := nil; + SSL_alert_type_string := nil; + SSL_alert_desc_string_long := nil; + SSL_alert_desc_string := nil; + SSL_CTX_set_client_CA_list := nil; + SSL_add_client_CA := nil; + SSL_CTX_add_client_CA := nil; + SSL_set_connect_state := nil; + SSL_set_accept_state := nil; + SSL_library_init := nil; {removed 1.1.0} + SSL_CIPHER_description := nil; + SSL_dup := nil; + SSL_get_certificate := nil; + SSL_get_privatekey := nil; + SSL_CTX_get0_certificate := nil; + SSL_CTX_get0_privatekey := nil; + SSL_CTX_set_quiet_shutdown := nil; + SSL_CTX_get_quiet_shutdown := nil; + SSL_set_quiet_shutdown := nil; + SSL_get_quiet_shutdown := nil; + SSL_set_shutdown := nil; + SSL_get_shutdown := nil; + SSL_version := nil; + SSL_client_version := nil; {introduced 1.1.0} + SSL_CTX_set_default_verify_paths := nil; + SSL_CTX_set_default_verify_dir := nil; {introduced 1.1.0} + SSL_CTX_set_default_verify_file := nil; {introduced 1.1.0} + SSL_CTX_load_verify_locations := nil; + SSL_get_session := nil; + SSL_get1_session := nil; + SSL_get_SSL_CTX := nil; + SSL_set_SSL_CTX := nil; + SSL_set_info_callback := nil; + SSL_get_info_callback := nil; + SSL_get_state := nil; {introduced 1.1.0} + SSL_set_verify_result := nil; + SSL_get_verify_result := nil; + SSL_get_client_random := nil; {introduced 1.1.0} + SSL_get_server_random := nil; {introduced 1.1.0} + SSL_SESSION_get_master_key := nil; {introduced 1.1.0} + SSL_SESSION_set1_master_key := nil; {introduced 1.1.0} + SSL_SESSION_get_max_fragment_length := nil; {introduced 1.1.0} + SSL_set_ex_data := nil; + SSL_get_ex_data := nil; + SSL_SESSION_set_ex_data := nil; + SSL_SESSION_get_ex_data := nil; + SSL_CTX_set_ex_data := nil; + SSL_CTX_get_ex_data := nil; + SSL_get_ex_data_X509_STORE_CTX_idx := nil; + SSL_CTX_set_default_read_buffer_len := nil; {introduced 1.1.0} + SSL_set_default_read_buffer_len := nil; {introduced 1.1.0} + SSL_CTX_set_tmp_dh_callback := nil; + SSL_set_tmp_dh_callback := nil; + SSL_CIPHER_find := nil; + SSL_CIPHER_get_cipher_nid := nil; {introduced 1.1.0} + SSL_CIPHER_get_digest_nid := nil; {introduced 1.1.0} + SSL_set_session_ticket_ext := nil; + SSL_set_session_ticket_ext_cb := nil; + SSL_CTX_set_not_resumable_session_callback := nil; {introduced 1.1.0} + SSL_set_not_resumable_session_callback := nil; {introduced 1.1.0} + SSL_CTX_set_record_padding_callback := nil; {introduced 1.1.0} + SSL_CTX_set_record_padding_callback_arg := nil; {introduced 1.1.0} + SSL_CTX_get_record_padding_callback_arg := nil; {introduced 1.1.0} + SSL_CTX_set_block_padding := nil; {introduced 1.1.0} + SSL_set_record_padding_callback := nil; {introduced 1.1.0} + SSL_set_record_padding_callback_arg := nil; {introduced 1.1.0} + SSL_get_record_padding_callback_arg := nil; {introduced 1.1.0} + SSL_set_block_padding := nil; {introduced 1.1.0} + SSL_set_num_tickets := nil; {introduced 1.1.0} + SSL_get_num_tickets := nil; {introduced 1.1.0} + SSL_CTX_set_num_tickets := nil; {introduced 1.1.0} + SSL_CTX_get_num_tickets := nil; {introduced 1.1.0} + SSL_session_reused := nil; {introduced 1.1.0} + SSL_is_server := nil; + SSL_CONF_CTX_new := nil; + SSL_CONF_CTX_finish := nil; + SSL_CONF_CTX_free := nil; + SSL_CONF_CTX_set_flags := nil; + SSL_CONF_CTX_clear_flags := nil; + SSL_CONF_CTX_set1_prefix := nil; + SSL_CONF_cmd := nil; + SSL_CONF_cmd_argv := nil; + SSL_CONF_cmd_value_type := nil; + SSL_CONF_CTX_set_ssl := nil; + SSL_CONF_CTX_set_ssl_ctx := nil; + SSL_add_ssl_module := nil; {introduced 1.1.0} + SSL_config := nil; {introduced 1.1.0} + SSL_CTX_config := nil; {introduced 1.1.0} + DTLSv1_listen := nil; {introduced 1.1.0} + SSL_enable_ct := nil; {introduced 1.1.0} + SSL_CTX_enable_ct := nil; {introduced 1.1.0} + SSL_ct_is_enabled := nil; {introduced 1.1.0} + SSL_CTX_ct_is_enabled := nil; {introduced 1.1.0} + SSL_CTX_set_default_ctlog_list_file := nil; {introduced 1.1.0} + SSL_CTX_set_ctlog_list_file := nil; {introduced 1.1.0} + SSL_CTX_set0_ctlog_store := nil; {introduced 1.1.0} + SSL_set_security_level := nil; {introduced 1.1.0} + SSL_set_security_callback := nil; {introduced 1.1.0} + SSL_get_security_callback := nil; {introduced 1.1.0} + SSL_set0_security_ex_data := nil; {introduced 1.1.0} + SSL_get0_security_ex_data := nil; {introduced 1.1.0} + SSL_CTX_set_security_level := nil; {introduced 1.1.0} + SSL_CTX_get_security_level := nil; {introduced 1.1.0} + SSL_CTX_get0_security_ex_data := nil; {introduced 1.1.0} + SSL_CTX_set0_security_ex_data := nil; {introduced 1.1.0} + OPENSSL_init_ssl := nil; {introduced 1.1.0} + SSL_free_buffers := nil; {introduced 1.1.0} + SSL_alloc_buffers := nil; {introduced 1.1.0} + SSL_CTX_set_session_ticket_cb := nil; {introduced 1.1.0} + SSL_SESSION_set1_ticket_appdata := nil; {introduced 1.1.0} + SSL_SESSION_get0_ticket_appdata := nil; {introduced 1.1.0} + DTLS_set_timer_cb := nil; {introduced 1.1.0} + SSL_CTX_set_allow_early_data_cb := nil; {introduced 1.1.0} + SSL_set_allow_early_data_cb := nil; {introduced 1.1.0} + SSLv2_method := nil; {removed 1.1.0 allow_nil} // SSLv2 + SSLv2_server_method := nil; {removed 1.1.0 allow_nil} // SSLv2 + SSLv2_client_method := nil; {removed 1.1.0 allow_nil} // SSLv2 + SSLv3_method := nil; {removed 1.1.0 allow_nil} // SSLv3 + SSLv3_server_method := nil; {removed 1.1.0 allow_nil} // SSLv3 + SSLv3_client_method := nil; {removed 1.1.0 allow_nil} // SSLv3 + SSLv23_method := nil; {removed 1.1.0 allow_nil} // SSLv3 but can rollback to v2 + SSLv23_server_method := nil; {removed 1.1.0 allow_nil} // SSLv3 but can rollback to v2 + SSLv23_client_method := nil; {removed 1.1.0 allow_nil} // SSLv3 but can rollback to v2 + TLSv1_method := nil; {removed 1.1.0 allow_nil} // TLSv1.0 + TLSv1_server_method := nil; {removed 1.1.0 allow_nil} // TLSv1.0 + TLSv1_client_method := nil; {removed 1.1.0 allow_nil} // TLSv1.0 + TLSv1_1_method := nil; {removed 1.1.0 allow_nil} //TLS1.1 + TLSv1_1_server_method := nil; {removed 1.1.0 allow_nil} //TLS1.1 + TLSv1_1_client_method := nil; {removed 1.1.0 allow_nil} //TLS1.1 + TLSv1_2_method := nil; {removed 1.1.0 allow_nil} // TLSv1.2 + TLSv1_2_server_method := nil; {removed 1.1.0 allow_nil} // TLSv1.2 + TLSv1_2_client_method := nil; {removed 1.1.0 allow_nil} // TLSv1.2 + SSL_get0_peer_certificate := nil; {introduced 3.3.0} + SSL_get1_peer_certificate := nil; {introduced 3.3.0} +end; +{$ELSE} +function SSL_get_peer_certificate(const s: PSSL): PX509; +begin + Result := SSL_get1_peer_certificate(s); +end; + + +//# define SSL_CTX_set_mode(ctx,op) SSL_CTX_ctrl((ctx),SSL_CTRL_MODE,(op),NULL) +function SSL_CTX_set_mode(ctx: PSSL_CTX; op: TIdC_LONG): TIdC_LONG; +begin + Result := SSL_CTX_ctrl(ctx, SSL_CTRL_MODE, op, nil); +end; + +//# define SSL_CTX_clear_mode(ctx,op) SSL_CTX_ctrl((ctx),SSL_CTRL_CLEAR_MODE,(op),NULL) +function SSL_CTX_clear_mode(ctx: PSSL_CTX; op: TIdC_LONG): TIdC_LONG; +begin + Result := SSL_CTX_ctrl(ctx, SSL_CTRL_CLEAR_MODE, op, nil); +end; + +//# define SSL_CTX_sess_set_cache_size(ctx,t) SSL_CTX_ctrl(ctx,SSL_CTRL_SET_SESS_CACHE_SIZE,t,NULL) +function SSL_CTX_sess_set_cache_size(ctx: PSSL_CTX; t: TIdC_LONG): TIdC_LONG; +begin + Result := SSL_CTX_ctrl(ctx, SSL_CTRL_SET_SESS_CACHE_SIZE, t, nil); +end; + +//# define SSL_CTX_sess_get_cache_size(ctx) SSL_CTX_ctrl(ctx,SSL_CTRL_GET_SESS_CACHE_SIZE,0,NULL) +function SSL_CTX_sess_get_cache_size(ctx: PSSL_CTX): TIdC_LONG; +begin + Result := SSL_CTX_ctrl(ctx, SSL_CTRL_GET_SESS_CACHE_SIZE, 0, nil); +end; + +//# define SSL_CTX_set_session_cache_mode(ctx,m) SSL_CTX_ctrl(ctx,SSL_CTRL_SET_SESS_CACHE_MODE,m,NULL) +function SSL_CTX_set_session_cache_mode(ctx: PSSL_CTX; m: TIdC_LONG): TIdC_LONG; +begin + Result := SSL_CTX_ctrl(ctx, SSL_CTRL_SET_SESS_CACHE_MODE, m, nil); +end; + +//# define SSL_CTX_get_session_cache_mode(ctx) SSL_CTX_ctrl(ctx,SSL_CTRL_GET_SESS_CACHE_MODE,0,NULL) +function SSL_CTX_get_session_cache_mode(ctx: PSSL_CTX): TIdC_LONG; +begin + Result := SSL_CTX_ctrl(ctx, SSL_CTRL_GET_SESS_CACHE_MODE, 0, nil); +end; + +//# define SSL_num_renegotiations(ssl) SSL_ctrl((ssl),SSL_CTRL_GET_NUM_RENEGOTIATIONS,0,NULL) +function SSL_num_renegotiations(ssl: PSSL): TIdC_LONG; +begin + Result := SSL_ctrl(ssl, SSL_CTRL_GET_NUM_RENEGOTIATIONS, 0, nil); +end; + +//# define SSL_clear_num_renegotiations(ssl) SSL_ctrl((ssl),SSL_CTRL_CLEAR_NUM_RENEGOTIATIONS,0,NULL) +function SSL_clear_num_renegotiations(ssl: PSSL): TIdC_LONG; +begin + Result := SSL_ctrl(ssl, SSL_CTRL_CLEAR_NUM_RENEGOTIATIONS, 0, nil); +end; + +//# define SSL_total_renegotiations(ssl) SSL_ctrl((ssl),SSL_CTRL_GET_TOTAL_RENEGOTIATIONS,0,NULL) +function SSL_total_renegotiations(ssl: PSSL): TIdC_LONG; +begin + Result := SSL_ctrl(ssl, SSL_CTRL_GET_TOTAL_RENEGOTIATIONS, 0, nil); +end; + +//# define SSL_CTX_set_tmp_dh(ctx,dh) SSL_CTX_ctrl(ctx,SSL_CTRL_SET_TMP_DH,0,(char *)(dh)) +function SSL_CTX_set_tmp_dh(ctx: PSSL_CTX; dh: PDH): TIdC_LONG; +begin + Result := SSL_CTX_ctrl(ctx, SSL_CTRL_SET_TMP_DH, 0, dh); +end; + +//# define SSL_CTX_set_tmp_ecdh(ctx,ecdh) SSL_CTX_ctrl(ctx,SSL_CTRL_SET_TMP_ECDH,0,(char *)(ecdh)) +function SSL_CTX_set_tmp_ecdh(ctx: PSSL_CTX; ecdh: PByte): TIdC_LONG; +begin + Result := SSL_CTX_ctrl(ctx, SSL_CTRL_SET_TMP_ECDH, 0, ecdh); +end; + +//# define SSL_CTX_set_dh_auto(ctx, onoff) SSL_CTX_ctrl(ctx,SSL_CTRL_SET_DH_AUTO,onoff,NULL) +function SSL_CTX_set_dh_auto(ctx: PSSL_CTX; onoff: TIdC_LONG): TIdC_LONG; +begin + Result := SSL_CTX_ctrl(ctx, SSL_CTRL_SET_DH_AUTO, onoff, nil); +end; + +//# define SSL_set_dh_auto(s, onoff) SSL_ctrl(s,SSL_CTRL_SET_DH_AUTO,onoff,NULL) +function SSL_set_dh_auto(s: PSSL; onoff: TIdC_LONG): TIdC_LONG; +begin + Result := SSL_ctrl(s, SSL_CTRL_SET_DH_AUTO, onoff, nil); +end; + +//# define SSL_set_tmp_dh(ssl,dh) SSL_ctrl(ssl,SSL_CTRL_SET_TMP_DH,0,(char *)(dh)) +function SSL_set_tmp_dh(ssl: PSSL; dh: PDH): TIdC_LONG; +begin + Result := SSL_ctrl(ssl, SSL_CTRL_SET_TMP_DH, 0, dh); +end; + +//# define SSL_set_tmp_ecdh(ssl,ecdh) SSL_ctrl(ssl,SSL_CTRL_SET_TMP_ECDH,0,(char *)(ecdh)) +function SSL_set_tmp_ecdh(ssl: PSSL; ecdh: PByte): TIdC_LONG; +begin + Result := SSL_ctrl(ssl, SSL_CTRL_SET_TMP_ECDH, 0, ecdh); +end; + +//# define SSL_CTX_add_extra_chain_cert(ctx,x509) SSL_CTX_ctrl(ctx,SSL_CTRL_EXTRA_CHAIN_CERT,0,(char *)(x509)) +function SSL_CTX_add_extra_chain_cert(ctx: PSSL_CTX; x509: PByte): TIdC_LONG; +begin + Result := SSL_CTX_ctrl(ctx, SSL_CTRL_EXTRA_CHAIN_CERT, 0, x509); +end; + +//# define SSL_CTX_get_extra_chain_certs(ctx,px509) SSL_CTX_ctrl(ctx,SSL_CTRL_GET_EXTRA_CHAIN_CERTS,0,px509) +function SSL_CTX_get_extra_chain_certs(ctx: PSSL_CTX; px509: Pointer): TIdC_LONG; +begin + Result := SSL_CTX_ctrl(ctx, SSL_CTRL_GET_EXTRA_CHAIN_CERTS, 0, px509); +end; + +//# define SSL_CTX_get_extra_chain_certs_only(ctx,px509) SSL_CTX_ctrl(ctx,SSL_CTRL_GET_EXTRA_CHAIN_CERTS,1,px509) +function SSL_CTX_get_extra_chain_certs_only(ctx: PSSL_CTX; px509: Pointer): TIdC_LONG; +begin + Result := SSL_CTX_ctrl(ctx, SSL_CTRL_GET_EXTRA_CHAIN_CERTS, 1, px509); +end; + +//# define SSL_CTX_clear_extra_chain_certs(ctx) SSL_CTX_ctrl(ctx,SSL_CTRL_CLEAR_EXTRA_CHAIN_CERTS,0,NULL) +function SSL_CTX_clear_extra_chain_certs(ctx: PSSL_CTX): TIdC_LONG; +begin + Result := SSL_CTX_ctrl(ctx, SSL_CTRL_CLEAR_EXTRA_CHAIN_CERTS, 0, nil); +end; + +//# define SSL_CTX_set0_chain(ctx,sk) SSL_CTX_ctrl(ctx,SSL_CTRL_CHAIN,0,(char *)(sk)) +function SSL_CTX_set0_chain(ctx: PSSL_CTX; sk: PByte): TIdC_LONG; +begin + Result := SSL_CTX_ctrl(ctx, SSL_CTRL_CHAIN, 0, sk); +end; + +//# define SSL_CTX_set1_chain(ctx,sk) SSL_CTX_ctrl(ctx,SSL_CTRL_CHAIN,1,(char *)(sk)) +function SSL_CTX_set1_chain(ctx: PSSL_CTX; sk: PByte): TIdC_LONG; +begin + Result := SSL_CTX_ctrl(ctx, SSL_CTRL_CHAIN, 1, sk); +end; + +//# define SSL_CTX_add0_chain_cert(ctx,x509) SSL_CTX_ctrl(ctx,SSL_CTRL_CHAIN_CERT,0,(char *)(x509)) +function SSL_CTX_add0_chain_cert(ctx: PSSL_CTX; x509: PX509): TIdC_LONG; +begin + Result := SSL_CTX_ctrl(ctx, SSL_CTRL_CHAIN_CERT, 0, x509); +end; + +//# define SSL_CTX_add1_chain_cert(ctx,x509) SSL_CTX_ctrl(ctx,SSL_CTRL_CHAIN_CERT,1,(char *)(x509)) +function SSL_CTX_add1_chain_cert(ctx: PSSL_CTX; x509: PX509): TIdC_LONG; +begin + Result := SSL_CTX_ctrl(ctx, SSL_CTRL_CHAIN_CERT, 1, x509); +end; + +//# define SSL_CTX_get0_chain_certs(ctx,px509) SSL_CTX_ctrl(ctx,SSL_CTRL_GET_CHAIN_CERTS,0,px509) +function SSL_CTX_get0_chain_certs(ctx: PSSL_CTX; px509: Pointer): TIdC_LONG; +begin + Result := SSL_CTX_ctrl(ctx, SSL_CTRL_GET_CHAIN_CERTS, 0, px509); +end; + +//# define SSL_CTX_clear_chain_certs(ctx) SSL_CTX_set0_chain(ctx,NULL) +function SSL_CTX_clear_chain_certs(ctx: PSSL_CTX): TIdC_LONG; +begin + Result := SSL_CTX_set0_chain(ctx, nil); +end; + +//# define SSL_CTX_build_cert_chain(ctx, flags) SSL_CTX_ctrl(ctx,SSL_CTRL_BUILD_CERT_CHAIN, flags, NULL) +function SSL_CTX_build_cert_chain(ctx: PSSL_CTX; flags: TIdC_LONG): TIdC_LONG; +begin + Result := SSL_CTX_ctrl(ctx, SSL_CTRL_BUILD_CERT_CHAIN, flags, nil); +end; + +//# define SSL_CTX_select_current_cert(ctx,x509) SSL_CTX_ctrl(ctx,SSL_CTRL_SELECT_CURRENT_CERT,0,(char *)(x509)) +function SSL_CTX_select_current_cert(ctx: PSSL_CTX; x509: PByte): TIdC_LONG; +begin + Result := SSL_CTX_ctrl(ctx, SSL_CTRL_SELECT_CURRENT_CERT, 0, x509); +end; + +//# define SSL_CTX_set_current_cert(ctx, op) SSL_CTX_ctrl(ctx,SSL_CTRL_SET_CURRENT_CERT, op, NULL) +function SSL_CTX_set_current_cert(ctx: PSSL_CTX; op: TIdC_LONG): TIdC_LONG; +begin + Result := SSL_CTX_ctrl(ctx, SSL_CTRL_SET_CURRENT_CERT, op, nil); +end; + +//# define SSL_CTX_set0_verify_cert_store(ctx,st) SSL_CTX_ctrl(ctx,SSL_CTRL_SET_VERIFY_CERT_STORE,0,(char *)(st)) +function SSL_CTX_set0_verify_cert_store(ctx: PSSL_CTX; st: Pointer): TIdC_LONG; +begin + Result := SSL_CTX_ctrl(ctx, SSL_CTRL_SET_VERIFY_CERT_STORE, 0, st); +end; + +//# define SSL_CTX_set1_verify_cert_store(ctx,st) SSL_CTX_ctrl(ctx,SSL_CTRL_SET_VERIFY_CERT_STORE,1,(char *)(st)) +function SSL_CTX_set1_verify_cert_store(ctx: PSSL_CTX; st: Pointer): TIdC_LONG; +begin + Result := SSL_CTX_ctrl(ctx, SSL_CTRL_SET_VERIFY_CERT_STORE, 1, st); +end; + +//# define SSL_CTX_set0_chain_cert_store(ctx,st) SSL_CTX_ctrl(ctx,SSL_CTRL_SET_CHAIN_CERT_STORE,0,(char *)(st)) +function SSL_CTX_set0_chain_cert_store(ctx: PSSL_CTX; st: Pointer): TIdC_LONG; +begin + Result := SSL_CTX_ctrl(ctx, SSL_CTRL_SET_CHAIN_CERT_STORE, 0, st); +end; + +//# define SSL_CTX_set1_chain_cert_store(ctx,st) SSL_CTX_ctrl(ctx,SSL_CTRL_SET_CHAIN_CERT_STORE,1,(char *)(st)) +function SSL_CTX_set1_chain_cert_store(ctx: PSSL_CTX; st: Pointer): TIdC_LONG; +begin + Result := SSL_CTX_ctrl(ctx, SSL_CTRL_SET_CHAIN_CERT_STORE, 1, st); +end; + +//# define SSL_set0_chain(s,sk) SSL_ctrl(s,SSL_CTRL_CHAIN,0,(char *)(sk)) +function SSL_set0_chain(s: PSSL; sk: PByte): TIdC_LONG; +begin + Result := SSL_ctrl(s, SSL_CTRL_CHAIN, 0, sk); +end; + +//# define SSL_set1_chain(s,sk) SSL_ctrl(s,SSL_CTRL_CHAIN,1,(char *)(sk)) +function SSL_set1_chain(s: PSSL; sk: PByte): TIdC_LONG; +begin + Result := SSL_ctrl(s, SSL_CTRL_CHAIN, 1, sk); +end; + +//# define SSL_add0_chain_cert(s,x509) SSL_ctrl(s,SSL_CTRL_CHAIN_CERT,0,(char *)(x509)) +function SSL_add0_chain_cert(s: PSSL; x509: PByte): TIdC_LONG; +begin + Result := SSL_ctrl(s, SSL_CTRL_CHAIN_CERT, 0, x509); +end; + +//# define SSL_add1_chain_cert(s,x509) SSL_ctrl(s,SSL_CTRL_CHAIN_CERT,1,(char *)(x509)) +function SSL_add1_chain_cert(s: PSSL; x509: PByte): TIdC_LONG; +begin + Result := SSL_ctrl(s, SSL_CTRL_CHAIN_CERT, 1, x509); +end; + +//# define SSL_get0_chain_certs(s,px509) SSL_ctrl(s,SSL_CTRL_GET_CHAIN_CERTS,0,px509) +function SSL_get0_chain_certs(s: PSSL; px509: Pointer): TIdC_LONG; +begin + Result := SSL_ctrl(s, SSL_CTRL_GET_CHAIN_CERTS, 0, px509); +end; + +//# define SSL_clear_chain_certs(s) SSL_set0_chain(s,NULL) +function SSL_clear_chain_certs(s: PSSL): TIdC_LONG; +begin + Result := SSL_set0_chain(s, nil); +end; + +//# define SSL_build_cert_chain(s, flags) SSL_ctrl(s,SSL_CTRL_BUILD_CERT_CHAIN, flags, NULL) +function SSL_build_cert_chain(s: PSSL; flags: TIdC_LONG): TIdC_LONG; +begin + Result := SSL_ctrl(s, SSL_CTRL_BUILD_CERT_CHAIN, flags, nil); +end; + +//# define SSL_select_current_cert(s,x509) SSL_ctrl(s,SSL_CTRL_SELECT_CURRENT_CERT,0,(char *)(x509)) +function SSL_select_current_cert(s: PSSL; x509: PByte): TIdC_LONG; +begin + Result := SSL_ctrl(s, SSL_CTRL_SELECT_CURRENT_CERT, 0, x509); +end; + +//# define SSL_set_current_cert(s,op) SSL_ctrl(s,SSL_CTRL_SET_CURRENT_CERT, op, NULL) +function SSL_set_current_cert(s: PSSL; op: TIdC_LONG): TIdC_LONG; +begin + Result := SSL_ctrl(s, SSL_CTRL_SET_CURRENT_CERT, op, nil); +end; + +//# define SSL_set0_verify_cert_store(s,st) SSL_ctrl(s,SSL_CTRL_SET_VERIFY_CERT_STORE,0,(char *)(st)) +function SSL_set0_verify_cert_store(s: PSSL; st: PByte): TIdC_LONG; +begin + Result := SSL_ctrl(s, SSL_CTRL_SET_VERIFY_CERT_STORE, 0, st); +end; + +//# define SSL_set1_verify_cert_store(s,st) SSL_ctrl(s,SSL_CTRL_SET_VERIFY_CERT_STORE,1,(char *)(st)) +function SSL_set1_verify_cert_store(s: PSSL; st: PByte): TIdC_LONG; +begin + Result := SSL_ctrl(s, SSL_CTRL_SET_VERIFY_CERT_STORE, 1, st); +end; + +//# define SSL_set0_chain_cert_store(s,st) SSL_ctrl(s,SSL_CTRL_SET_CHAIN_CERT_STORE,0,(char *)(st)) +function SSL_set0_chain_cert_store(s: PSSL; st: PByte): TIdC_LONG; +begin + Result := SSL_ctrl(s, SSL_CTRL_SET_CHAIN_CERT_STORE, 0, st); +end; + +//# define SSL_set1_chain_cert_store(s,st) SSL_ctrl(s,SSL_CTRL_SET_CHAIN_CERT_STORE,1,(char *)(st)) +function SSL_set1_chain_cert_store(s: PSSL; st: PByte): TIdC_LONG; +begin + Result := SSL_ctrl(s, SSL_CTRL_SET_CHAIN_CERT_STORE, 1, st); +end; + +//# define SSL_get1_groups(s, glist) SSL_ctrl(s,SSL_CTRL_GET_GROUPS,0,(TIdC_INT*)(glist)) +function SSL_get1_groups(s: PSSL; glist: PIdC_INT): TIdC_LONG; +begin + Result := SSL_ctrl(s, SSL_CTRL_GET_GROUPS, 0, glist); +end; + +//# define SSL_CTX_set1_groups(ctx, glist, glistlen) SSL_CTX_ctrl(ctx,SSL_CTRL_SET_GROUPS,glistlen,(char *)(glist)) +function SSL_CTX_set1_groups(ctx: PSSL_CTX; glist: PByte; glistlen: TIdC_LONG): TIdC_LONG; +begin + Result := SSL_CTX_ctrl(ctx, SSL_CTRL_SET_GROUPS, glistlen, glist); +end; + +//# define SSL_CTX_set1_groups_list(ctx, s) SSL_CTX_ctrl(ctx,SSL_CTRL_SET_GROUPS_LIST,0,(char *)(s)) +function SSL_CTX_set1_groups_list(ctx: PSSL_CTX; s: PByte): TIdC_LONG; +begin + Result := SSL_CTX_ctrl(ctx, SSL_CTRL_SET_GROUPS_LIST, 0, s); +end; + +//# define SSL_set1_groups(s, glist, glistlen) SSL_ctrl(s,SSL_CTRL_SET_GROUPS,glistlen,(char *)(glist)) +function SSL_set1_groups(s: PSSL; glist: PByte; glistlen: TIdC_LONG): TIdC_LONG; +begin + Result := SSL_ctrl(s, SSL_CTRL_SET_GROUPS, glistlen, glist); +end; + +//# define SSL_set1_groups_list(s, str) SSL_ctrl(s,SSL_CTRL_SET_GROUPS_LIST,0,(char *)(str)) +function SSL_set1_groups_list(s: PSSL; str: PByte): TIdC_LONG; +begin + Result := SSL_ctrl(s, SSL_CTRL_SET_GROUPS_LIST, 0, str); +end; + +//# define SSL_get_shared_group(s, n) SSL_ctrl(s,SSL_CTRL_GET_SHARED_GROUP,n,NULL) +function SSL_get_shared_group(s: PSSL; n: TIdC_LONG): TIdC_LONG; +begin + Result := SSL_ctrl(s, SSL_CTRL_GET_SHARED_GROUP, n, nil); +end; + +//# define SSL_CTX_set1_sigalgs(ctx, slist, slistlen) SSL_CTX_ctrl(ctx,SSL_CTRL_SET_SIGALGS,slistlen,(TIdC_INT *)(slist)) +function SSL_CTX_set1_sigalgs(ctx: PSSL_CTX; slist: PIdC_INT; slistlen: TIdC_LONG): TIdC_LONG; +begin + Result := SSL_CTX_ctrl(ctx, SSL_CTRL_SET_SIGALGS, slistlen, slist); +end; + +//# define SSL_CTX_set1_sigalgs_list(ctx, s) SSL_CTX_ctrl(ctx,SSL_CTRL_SET_SIGALGS_LIST,0,(char *)(s)) +function SSL_CTX_set1_sigalgs_list(ctx: PSSL_CTX; s: PByte): TIdC_LONG; +begin + Result := SSL_CTX_ctrl(ctx, SSL_CTRL_SET_SIGALGS_LIST, 0, s); +end; + +//# define SSL_set1_sigalgs(s, slist, slistlen) SSL_ctrl(s,SSL_CTRL_SET_SIGALGS,slistlen,(TIdC_INT *)(slist)) +function SSL_set1_sigalgs(s: PSSL; slist: PIdC_INT; slistlen: TIdC_LONG): TIdC_LONG; +begin + Result := SSL_ctrl(s, SSL_CTRL_SET_SIGALGS, slistlen, slist); +end; + +//# define SSL_set1_sigalgs_list(s, str) SSL_ctrl(s,SSL_CTRL_SET_SIGALGS_LIST,0,(char *)(str)) +function SSL_set1_sigalgs_list(s: PSSL; str: PByte): TIdC_LONG; +begin + Result := SSL_ctrl(s, SSL_CTRL_SET_SIGALGS_LIST, 0, str); +end; + +//# define SSL_CTX_set1_client_sigalgs(ctx, slist, slistlen) SSL_CTX_ctrl(ctx,SSL_CTRL_SET_CLIENT_SIGALGS,slistlen,(TIdC_INT *)(slist)) +function SSL_CTX_set1_client_sigalgs(ctx: PSSL_CTX; slist: PIdC_INT; slistlen: TIdC_LONG): TIdC_LONG; +begin + Result := SSL_CTX_ctrl(ctx, SSL_CTRL_SET_CLIENT_SIGALGS, slistlen, slist); +end; + +//# define SSL_CTX_set1_client_sigalgs_list(ctx, s) SSL_CTX_ctrl(ctx,SSL_CTRL_SET_CLIENT_SIGALGS_LIST,0,(char *)(s)) +function SSL_CTX_set1_client_sigalgs_list(ctx: PSSL_CTX; s: PByte): TIdC_LONG; +begin + Result := SSL_CTX_ctrl(ctx, SSL_CTRL_SET_CLIENT_SIGALGS_LIST, 0, s); +end; + +//# define SSL_set1_client_sigalgs(s, slist, slistlen) SSL_ctrl(s,SSL_CTRL_SET_CLIENT_SIGALGS,slistlen,(TIdC_INT *)(slist)) +function SSL_set1_client_sigalgs(s: PSSL; slist: PIdC_INT; slistlen: TIdC_LONG): TIdC_LONG; +begin + Result := SSL_ctrl(s, SSL_CTRL_SET_CLIENT_SIGALGS, slistlen, slist); +end; + +//# define SSL_set1_client_sigalgs_list(s, str) SSL_ctrl(s,SSL_CTRL_SET_CLIENT_SIGALGS_LIST,0,(char *)(str)) +function SSL_set1_client_sigalgs_list(s: PSSL; str: PByte): TIdC_LONG; +begin + Result := SSL_ctrl(s, SSL_CTRL_SET_CLIENT_SIGALGS_LIST, 0, str); +end; + +//# define SSL_get0_certificate_types(s, clist) SSL_ctrl(s, SSL_CTRL_GET_CLIENT_CERT_TYPES, 0, (char *)(clist)) +function SSL_get0_certificate_types(s: PSSL; clist: PByte): TIdC_LONG; +begin + Result := SSL_ctrl(s, SSL_CTRL_GET_CLIENT_CERT_TYPES, 0, clist); +end; + +//# define SSL_CTX_set1_client_certificate_types(ctx, clist, clistlen) SSL_CTX_ctrl(ctx,SSL_CTRL_SET_CLIENT_CERT_TYPES,clistlen, (char *)(clist)) +function SSL_CTX_set1_client_certificate_types(ctx: PSSL_CTX; clist: PByte; clistlen: TIdC_LONG): TIdC_LONG; +begin + Result := SSL_CTX_ctrl(ctx, SSL_CTRL_SET_CLIENT_CERT_TYPES, clistlen, clist); +end; + +//# define SSL_set1_client_certificate_types(s, clist, clistlen) SSL_ctrl(s,SSL_CTRL_SET_CLIENT_CERT_TYPES,clistlen,(char *)(clist)) +function SSL_set1_client_certificate_types(s: PSSL; clist: PByte; clistlen: TIdC_LONG): TIdC_LONG; +begin + Result := SSL_ctrl(s, SSL_CTRL_SET_CLIENT_CERT_TYPES, clistlen, clist); +end; + +//# define SSL_get_signature_nid(s, pn) SSL_ctrl(s,SSL_CTRL_GET_SIGNATURE_NID,0,pn) +function SSL_get_signature_nid(s: PSSL; pn: Pointer): TIdC_LONG; +begin + Result := SSL_ctrl(s, SSL_CTRL_GET_SIGNATURE_NID, 0, pn); +end; + +//# define SSL_get_peer_signature_nid(s, pn) SSL_ctrl(s,SSL_CTRL_GET_PEER_SIGNATURE_NID,0,pn) +function SSL_get_peer_signature_nid(s: PSSL; pn: Pointer): TIdC_LONG; +begin + Result := SSL_ctrl(s, SSL_CTRL_GET_PEER_SIGNATURE_NID, 0, pn); +end; + +//# define SSL_get_peer_tmp_key(s, pk) SSL_ctrl(s,SSL_CTRL_GET_PEER_TMP_KEY,0,pk) +function SSL_get_peer_tmp_key(s: PSSL; pk: Pointer): TIdC_LONG; +begin + Result := SSL_ctrl(s, SSL_CTRL_GET_PEER_TMP_KEY, 0, pk); +end; + +//# define SSL_get_tmp_key(s, pk) SSL_ctrl(s,SSL_CTRL_GET_TMP_KEY,0,pk) +function SSL_get_tmp_key(s: PSSL; pk: Pointer): TIdC_LONG; +begin + Result := SSL_ctrl(s, SSL_CTRL_GET_TMP_KEY, 0, pk); +end; + +//# define SSL_get0_raw_cipherlist(s, plst) SSL_ctrl(s,SSL_CTRL_GET_RAW_CIPHERLIST,0,plst) +function SSL_get0_raw_cipherlist(s: PSSL; plst: Pointer): TIdC_LONG; +begin + Result := SSL_ctrl(s, SSL_CTRL_GET_RAW_CIPHERLIST, 0, plst); +end; + +//# define SSL_get0_ec_point_formats(s, plst) SSL_ctrl(s,SSL_CTRL_GET_EC_POINT_FORMATS,0,plst) +function SSL_get0_ec_point_formats(s: PSSL; plst: Pointer): TIdC_LONG; +begin + Result := SSL_ctrl(s, SSL_CTRL_GET_EC_POINT_FORMATS, 0, plst); +end; + + +function SSL_get_app_data(const ssl: PSSL): Pointer ; +begin + Result := SSL_get_ex_data(ssl,0); +end; + +procedure SSL_load_error_strings; +begin + OPENSSL_init_ssl(OPENSSL_INIT_LOAD_SSL_STRINGS or OPENSSL_INIT_LOAD_CRYPTO_STRINGS,nil); +end; + +function SSL_library_init: TIdC_INT; +begin + Result := OPENSSL_init_ssl(0, nil); +end; + +function SSLeay_add_ssl_algorithms: TIdC_INT; +begin + Result := SSL_library_init; +end; + +function SSL_set_app_data(ssl: PSSL; data: Pointer): TIdC_INT; +begin + Result := SSL_set_ex_data(ssl,0,data); +end; + + +{$ENDIF} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +initialization + Register_SSLLoader(@Load,'LibSSL'); + Register_SSLUnloader(@Unload); +{$ENDIF} +end. diff --git a/IdOpenSSLHeaders_ssl3.pas b/IdOpenSSLHeaders_ssl3.pas new file mode 100644 index 0000000..da20bde --- /dev/null +++ b/IdOpenSSLHeaders_ssl3.pas @@ -0,0 +1,334 @@ + (* This unit was generated using the script genOpenSSLHdrs.sh from the source file IdOpenSSLHeaders_ssl3.h2pas + It should not be modified directly. All changes should be made to IdOpenSSLHeaders_ssl3.h2pas + and this file regenerated. IdOpenSSLHeaders_ssl3.h2pas is distributed with the full Indy + Distribution. + *) + +{$i IdCompilerDefines.inc} +{$i IdSSLOpenSSLDefines.inc} +{$IFNDEF USE_OPENSSL} + { error Should not compile if USE_OPENSSL is not defined!!!} +{$ENDIF} +{******************************************************************************} +{ } +{ Indy (Internet Direct) - Internet Protocols Simplified } +{ } +{ https://www.indyproject.org/ } +{ https://gitter.im/IndySockets/Indy } +{ } +{******************************************************************************} +{ } +{ This file is part of the Indy (Internet Direct) project, and is offered } +{ under the dual-licensing agreement described on the Indy website. } +{ (https://www.indyproject.org/license/) } +{ } +{ Copyright: } +{ (c) 1993-2020, Chad Z. Hower and the Indy Pit Crew. All rights reserved. } +{ } +{******************************************************************************} +{ } +{ } +{******************************************************************************} + +unit IdOpenSSLHeaders_ssl3; + +interface + +// Headers for OpenSSL 1.1.1 +// ssl3.h + + +uses + IdGlobal; + +const + (* + * Signalling cipher suite value from RFC 5746 + * (TLS_EMPTY_RENEGOTIATION_INFO_SCSV) + *) + SSL3_CK_SCSV = $030000FF; + + (* + * Signalling cipher suite value from draft-ietf-tls-downgrade-scsv-00 + * (TLS_FALLBACK_SCSV) + *) + SSL3_CK_FALLBACK_SCSV = $03005600; + + SSL3_CK_RSA_NULL_MD5 = $03000001; + SSL3_CK_RSA_NULL_SHA = $03000002; + SSL3_CK_RSA_RC4_40_MD5 = $03000003; + SSL3_CK_RSA_RC4_128_MD5 = $03000004; + SSL3_CK_RSA_RC4_128_SHA = $03000005; + SSL3_CK_RSA_RC2_40_MD5 = $03000006; + SSL3_CK_RSA_IDEA_128_SHA = $03000007; + SSL3_CK_RSA_DES_40_CBC_SHA = $03000008; + SSL3_CK_RSA_DES_64_CBC_SHA = $03000009; + SSL3_CK_RSA_DES_192_CBC3_SHA = $0300000A; + + SSL3_CK_DH_DSS_DES_40_CBC_SHA = $0300000B; + SSL3_CK_DH_DSS_DES_64_CBC_SHA = $0300000C; + SSL3_CK_DH_DSS_DES_192_CBC3_SHA = $0300000D; + SSL3_CK_DH_RSA_DES_40_CBC_SHA = $0300000E; + SSL3_CK_DH_RSA_DES_64_CBC_SHA = $0300000F; + SSL3_CK_DH_RSA_DES_192_CBC3_SHA = $03000010; + + SSL3_CK_DHE_DSS_DES_40_CBC_SHA = $03000011; + SSL3_CK_EDH_DSS_DES_40_CBC_SHA = SSL3_CK_DHE_DSS_DES_40_CBC_SHA; + SSL3_CK_DHE_DSS_DES_64_CBC_SHA = $03000012; + SSL3_CK_EDH_DSS_DES_64_CBC_SHA = SSL3_CK_DHE_DSS_DES_64_CBC_SHA; + SSL3_CK_DHE_DSS_DES_192_CBC3_SHA = $03000013; + SSL3_CK_EDH_DSS_DES_192_CBC3_SHA = SSL3_CK_DHE_DSS_DES_192_CBC3_SHA; + SSL3_CK_DHE_RSA_DES_40_CBC_SHA = $03000014; + SSL3_CK_EDH_RSA_DES_40_CBC_SHA = SSL3_CK_DHE_RSA_DES_40_CBC_SHA; + SSL3_CK_DHE_RSA_DES_64_CBC_SHA = $03000015; + SSL3_CK_EDH_RSA_DES_64_CBC_SHA = SSL3_CK_DHE_RSA_DES_64_CBC_SHA; + SSL3_CK_DHE_RSA_DES_192_CBC3_SHA = $03000016; + SSL3_CK_EDH_RSA_DES_192_CBC3_SHA = SSL3_CK_DHE_RSA_DES_192_CBC3_SHA; + + SSL3_CK_ADH_RC4_40_MD5 = $03000017; + SSL3_CK_ADH_RC4_128_MD5 = $03000018; + SSL3_CK_ADH_DES_40_CBC_SHA = $03000019; + SSL3_CK_ADH_DES_64_CBC_SHA = $0300001A; + SSL3_CK_ADH_DES_192_CBC_SHA = $0300001B; + + (* a bundle of RFC standard cipher names, generated from ssl3_ciphers[] *) + SSL3_RFC_RSA_NULL_MD5 = AnsiString('TLS_RSA_WITH_NULL_MD5'); + SSL3_RFC_RSA_NULL_SHA = AnsiString('TLS_RSA_WITH_NULL_SHA'); + SSL3_RFC_RSA_DES_192_CBC3_SHA = AnsiString('TLS_RSA_WITH_3DES_EDE_CBC_SHA'); + SSL3_RFC_DHE_DSS_DES_192_CBC3_SHA = AnsiString('TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA'); + SSL3_RFC_DHE_RSA_DES_192_CBC3_SHA = AnsiString('TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA'); + SSL3_RFC_ADH_DES_192_CBC_SHA = AnsiString('TLS_DH_anon_WITH_3DES_EDE_CBC_SHA'); + SSL3_RFC_RSA_IDEA_128_SHA = AnsiString('TLS_RSA_WITH_IDEA_CBC_SHA'); + SSL3_RFC_RSA_RC4_128_MD5 = AnsiString('TLS_RSA_WITH_RC4_128_MD5'); + SSL3_RFC_RSA_RC4_128_SHA = AnsiString('TLS_RSA_WITH_RC4_128_SHA'); + SSL3_RFC_ADH_RC4_128_MD5 = AnsiString('TLS_DH_anon_WITH_RC4_128_MD5'); + + SSL3_TXT_RSA_NULL_MD5 = AnsiString('NULL-MD5'); + SSL3_TXT_RSA_NULL_SHA = AnsiString('NULL-SHA'); + SSL3_TXT_RSA_RC4_40_MD5 = AnsiString('EXP-RC4-MD5'); + SSL3_TXT_RSA_RC4_128_MD5 = AnsiString('RC4-MD5'); + SSL3_TXT_RSA_RC4_128_SHA = AnsiString('RC4-SHA'); + SSL3_TXT_RSA_RC2_40_MD5 = AnsiString('EXP-RC2-CBC-MD5'); + SSL3_TXT_RSA_IDEA_128_SHA = AnsiString('IDEA-CBC-SHA'); + SSL3_TXT_RSA_DES_40_CBC_SHA = AnsiString('EXP-DES-CBC-SHA'); + SSL3_TXT_RSA_DES_64_CBC_SHA = AnsiString('DES-CBC-SHA'); + SSL3_TXT_RSA_DES_192_CBC3_SHA = AnsiString('DES-CBC3-SHA'); + + SSL3_TXT_DH_DSS_DES_40_CBC_SHA = AnsiString('EXP-DH-DSS-DES-CBC-SHA'); + SSL3_TXT_DH_DSS_DES_64_CBC_SHA = AnsiString('DH-DSS-DES-CBC-SHA'); + SSL3_TXT_DH_DSS_DES_192_CBC3_SHA = AnsiString('DH-DSS-DES-CBC3-SHA'); + SSL3_TXT_DH_RSA_DES_40_CBC_SHA = AnsiString('EXP-DH-RSA-DES-CBC-SHA'); + SSL3_TXT_DH_RSA_DES_64_CBC_SHA = AnsiString('DH-RSA-DES-CBC-SHA'); + SSL3_TXT_DH_RSA_DES_192_CBC3_SHA = AnsiString('DH-RSA-DES-CBC3-SHA'); + + SSL3_TXT_DHE_DSS_DES_40_CBC_SHA = AnsiString('EXP-DHE-DSS-DES-CBC-SHA'); + SSL3_TXT_DHE_DSS_DES_64_CBC_SHA = AnsiString('DHE-DSS-DES-CBC-SHA'); + SSL3_TXT_DHE_DSS_DES_192_CBC3_SHA = AnsiString('DHE-DSS-DES-CBC3-SHA'); + SSL3_TXT_DHE_RSA_DES_40_CBC_SHA = AnsiString('EXP-DHE-RSA-DES-CBC-SHA'); + SSL3_TXT_DHE_RSA_DES_64_CBC_SHA = AnsiString('DHE-RSA-DES-CBC-SHA'); + SSL3_TXT_DHE_RSA_DES_192_CBC3_SHA = AnsiString('DHE-RSA-DES-CBC3-SHA'); + + (* + * This next block of six 'EDH' labels is for backward compatibility with + * older versions of OpenSSL. New code should use the six 'DHE' labels above + * instead: + *) + SSL3_TXT_EDH_DSS_DES_40_CBC_SHA = AnsiString('EXP-EDH-DSS-DES-CBC-SHA'); + SSL3_TXT_EDH_DSS_DES_64_CBC_SHA = AnsiString('EDH-DSS-DES-CBC-SHA'); + SSL3_TXT_EDH_DSS_DES_192_CBC3_SHA = AnsiString('EDH-DSS-DES-CBC3-SHA'); + SSL3_TXT_EDH_RSA_DES_40_CBC_SHA = AnsiString('EXP-EDH-RSA-DES-CBC-SHA'); + SSL3_TXT_EDH_RSA_DES_64_CBC_SHA = AnsiString('EDH-RSA-DES-CBC-SHA'); + SSL3_TXT_EDH_RSA_DES_192_CBC3_SHA = AnsiString('EDH-RSA-DES-CBC3-SHA'); + + SSL3_TXT_ADH_RC4_40_MD5 = AnsiString('EXP-ADH-RC4-MD5'); + SSL3_TXT_ADH_RC4_128_MD5 = AnsiString('ADH-RC4-MD5'); + SSL3_TXT_ADH_DES_40_CBC_SHA = AnsiString('EXP-ADH-DES-CBC-SHA'); + SSL3_TXT_ADH_DES_64_CBC_SHA = AnsiString('ADH-DES-CBC-SHA'); + SSL3_TXT_ADH_DES_192_CBC_SHA = AnsiString('ADH-DES-CBC3-SHA'); + + SSL3_SSL_SESSION_ID_LENGTH = 32; + SSL3_MAX_SSL_SESSION_ID_LENGTH = 32; + + SSL3_MASTER_SECRET_SIZE = 48; + SSL3_RANDOM_SIZE = 32; + SSL3_SESSION_ID_SIZE = 32; + SSL3_RT_HEADER_LENGTH = 5; + + SSL3_HM_HEADER_LENGTH = 4; + + (* + * Some will argue that this increases memory footprint, but it's not + * actually true. Point is that malloc has to return at least 64-bit aligned + * pointers, meaning that allocating 5 bytes wastes 3 bytes in either case. + * Suggested pre-gaping simply moves these wasted bytes from the end of + * allocated region to its front, but makes data payload aligned, which + * improves performance:-) + *) + SSL3_ALIGN_PAYLOAD = 8; + + + (* + * This is the maximum MAC (digest) size used by the SSL library. Currently + * maximum of 20 is used by SHA1, but we reserve for future extension for + * 512-bit hashes. + *) + SSL3_RT_MAX_MD_SIZE = 64; + + (* + * Maximum block size used in all ciphersuites. Currently 16 for AES. + *) + SSL_RT_MAX_CIPHER_BLOCK_SIZE = 16; + SSL3_RT_MAX_EXTRA = 16384; + + (* Maximum plaintext length: defined by SSL/TLS standards *) + SSL3_RT_MAX_PLAIN_LENGTH = 16384; + (* Maximum compression overhead: defined by SSL/TLS standards *) + SSL3_RT_MAX_COMPRESSED_OVERHEAD = 1024; + + (* + * The standards give a maximum encryption overhead of 1024 bytes. In + * practice the value is lower than this. The overhead is the maximum number + * of padding bytes (256) plus the mac size. + *) + SSL3_RT_MAX_ENCRYPTED_OVERHEAD = 256 + SSL3_RT_MAX_MD_SIZE; + SSL3_RT_MAX_TLS13_ENCRYPTED_OVERHEAD = 256; + + (* + * OpenSSL currently only uses a padding length of at most one block so the + * send overhead is smaller. + *) + SSL3_RT_SEND_MAX_ENCRYPTED_OVERHEAD = SSL_RT_MAX_CIPHER_BLOCK_SIZE + SSL3_RT_MAX_MD_SIZE; + + (* If compression isn't used don't include the compression overhead *) + SSL3_RT_MAX_COMPRESSED_LENGTH = SSL3_RT_MAX_PLAIN_LENGTH; +// SSL3_RT_MAX_COMPRESSED_LENGTH = (SSL3_RT_MAX_PLAIN_LENGTH + SSL3_RT_MAX_COMPRESSED_OVERHEAD); + + SSL3_RT_MAX_ENCRYPTED_LENGTH = SSL3_RT_MAX_ENCRYPTED_OVERHEAD + SSL3_RT_MAX_COMPRESSED_LENGTH; + SSL3_RT_MAX_TLS13_ENCRYPTED_LENGTH = SSL3_RT_MAX_PLAIN_LENGTH + SSL3_RT_MAX_TLS13_ENCRYPTED_OVERHEAD; + SSL3_RT_MAX_PACKET_SIZE = SSL3_RT_MAX_ENCRYPTED_LENGTH + SSL3_RT_HEADER_LENGTH; + + SSL3_MD_CLIENT_FINISHED_= TIdAnsiChar($43) + TIdAnsiChar($4C) + TIdAnsiChar($4E) + TIdAnsiChar($54); + SSL3_MD_SERVER_FINISHED_= TIdAnsiChar($53) + TIdAnsiChar($52) + TIdAnsiChar($56) + TIdAnsiChar($52); + + SSL3_VERSION = $0300; + SSL3_VERSION_MAJOR = $03; + SSL3_VERSION_MINOR = $00; + + SSL3_RT_CHANGE_CIPHER_SPEC = 20; + SSL3_RT_ALERT = 21; + SSL3_RT_HANDSHAKE = 22; + SSL3_RT_APPLICATION_DATA = 23; + DTLS1_RT_HEARTBEAT = 24; + + (* Pseudo content types to indicate additional parameters *) + TLS1_RT_CRYPTO = $1000; + TLS1_RT_CRYPTO_PREMASTER = TLS1_RT_CRYPTO or $1; + TLS1_RT_CRYPTO_CLIENT_RANDOM = TLS1_RT_CRYPTO or $2; + TLS1_RT_CRYPTO_SERVER_RANDOM = TLS1_RT_CRYPTO or $3; + TLS1_RT_CRYPTO_MASTER = TLS1_RT_CRYPTO or $4; + + TLS1_RT_CRYPTO_READ = $0000; + TLS1_RT_CRYPTO_WRITE = $0100; + TLS1_RT_CRYPTO_MAC = TLS1_RT_CRYPTO or $5; + TLS1_RT_CRYPTO_KEY = TLS1_RT_CRYPTO or $6; + TLS1_RT_CRYPTO_IV = TLS1_RT_CRYPTO or $7; + TLS1_RT_CRYPTO_FIXED_IV = TLS1_RT_CRYPTO or $8; + + (* Pseudo content types for SSL/TLS header info *) + SSL3_RT_HEADER = $100; + SSL3_RT_INNER_CONTENT_TYPE = $101; + + SSL3_AL_WARNING = 1; + SSL3_AL_FATAL = 2; + + SSL3_AD_CLOSE_NOTIFY = 0; + SSL3_AD_UNEXPECTED_MESSAGE = 10; (* fatal *) + SSL3_AD_BAD_RECORD_MAC = 20; (* fatal *) + SSL3_AD_DECOMPRESSION_FAILURE = 30; (* fatal *) + SSL3_AD_HANDSHAKE_FAILURE = 40; (* fatal *) + SSL3_AD_NO_CERTIFICATE = 41; + SSL3_AD_BAD_CERTIFICATE = 42; + SSL3_AD_UNSUPPORTED_CERTIFICATE = 43; + SSL3_AD_CERTIFICATE_REVOKED = 44; + SSL3_AD_CERTIFICATE_EXPIRED = 45; + SSL3_AD_CERTIFICATE_UNKNOWN = 46; + SSL3_AD_ILLEGAL_PARAMETER = 47; (* fatal *) + + TLS1_HB_REQUEST = 1; + TLS1_HB_RESPONSE = 2; + + SSL3_CT_RSA_SIGN = 1; + SSL3_CT_DSS_SIGN = 2; + SSL3_CT_RSA_FIXED_DH = 3; + SSL3_CT_DSS_FIXED_DH = 4; + SSL3_CT_RSA_EPHEMERAL_DH = 5; + SSL3_CT_DSS_EPHEMERAL_DH = 6; + SSL3_CT_FORTEZZA_DMS = 20; + + (* + * SSL3_CT_NUMBER is used to size arrays and it must be large enough to + * contain all of the cert types defined for *either* SSLv3 and TLSv1. + *) + SSL3_CT_NUMBER = 10; + + (* No longer used as of OpenSSL 1.1.1 *) + SSL3_FLAGS_NO_RENEGOTIATE_CIPHERS = $0001; + + (* Removed from OpenSSL 1.1.0 *) + TLS1_FLAGS_TLS_PADDING_BUG = $0; + TLS1_FLAGS_SKIP_CERT_VERIFY = $0010; + + (* Set if we encrypt then mac instead of usual mac then encrypt *) + TLS1_FLAGS_ENCRYPT_THEN_MAC_READ = $0100; + TLS1_FLAGS_ENCRYPT_THEN_MAC = TLS1_FLAGS_ENCRYPT_THEN_MAC_READ; + + + (* Set if extended master secret extension received from peer *) + TLS1_FLAGS_RECEIVED_EXTMS = $0200; + + TLS1_FLAGS_ENCRYPT_THEN_MAC_WRITE = $0400; + + TLS1_FLAGS_STATELESS = $0800; + + SSL3_MT_HELLO_REQUEST = 0; + SSL3_MT_CLIENT_HELLO = 1; + SSL3_MT_SERVER_HELLO = 2; + SSL3_MT_NEWSESSION_TICKET = 4; + SSL3_MT_END_OF_EARLY_DATA = 5; + SSL3_MT_ENCRYPTED_EXTENSIONS = 8; + SSL3_MT_CERTIFICATE = 11; + SSL3_MT_SERVER_KEY_EXCHANGE = 12; + SSL3_MT_CERTIFICATE_REQUEST = 13; + SSL3_MT_SERVER_DONE = 14; + SSL3_MT_CERTIFICATE_VERIFY = 15; + SSL3_MT_CLIENT_KEY_EXCHANGE = 16; + SSL3_MT_FINISHED = 20; + SSL3_MT_CERTIFICATE_URL = 21; + SSL3_MT_CERTIFICATE_STATUS = 22; + SSL3_MT_SUPPLEMENTAL_DATA = 23; + SSL3_MT_KEY_UPDATE = 24; + SSL3_MT_NEXT_PROTO = 67; + SSL3_MT_MESSAGE_HASH = 254; + DTLS1_MT_HELLO_VERIFY_REQUEST = 3; + + (* Dummy message type for handling CCS like a normal handshake message *) + SSL3_MT_CHANGE_CIPHER_SPEC = $0101; + + SSL3_MT_CCS = 1; + + (* These are used when changing over to a new cipher *) + SSL3_CC_READ = $001; + SSL3_CC_WRITE = $002; + SSL3_CC_CLIENT = $010; + SSL3_CC_SERVER = $020; + SSL3_CC_EARLY = $040; + SSL3_CC_HANDSHAKE = $080; + SSL3_CC_APPLICATION = $100; + SSL3_CHANGE_CIPHER_CLIENT_WRITE = SSL3_CC_CLIENT or SSL3_CC_WRITE; + SSL3_CHANGE_CIPHER_SERVER_READ = SSL3_CC_SERVER or SSL3_CC_READ; + SSL3_CHANGE_CIPHER_CLIENT_READ = SSL3_CC_CLIENT or SSL3_CC_READ; + SSL3_CHANGE_CIPHER_SERVER_WRITE = SSL3_CC_SERVER or SSL3_CC_WRITE; + +implementation + +end. diff --git a/IdOpenSSLHeaders_sslerr.pas b/IdOpenSSLHeaders_sslerr.pas new file mode 100644 index 0000000..fb68df9 --- /dev/null +++ b/IdOpenSSLHeaders_sslerr.pas @@ -0,0 +1,885 @@ + (* This unit was generated using the script genOpenSSLHdrs.sh from the source file IdOpenSSLHeaders_sslerr.h2pas + It should not be modified directly. All changes should be made to IdOpenSSLHeaders_sslerr.h2pas + and this file regenerated. IdOpenSSLHeaders_sslerr.h2pas is distributed with the full Indy + Distribution. + *) + +{$i IdCompilerDefines.inc} +{$i IdSSLOpenSSLDefines.inc} +{$IFNDEF USE_OPENSSL} + { error Should not compile if USE_OPENSSL is not defined!!!} +{$ENDIF} +{******************************************************************************} +{ } +{ Indy (Internet Direct) - Internet Protocols Simplified } +{ } +{ https://www.indyproject.org/ } +{ https://gitter.im/IndySockets/Indy } +{ } +{******************************************************************************} +{ } +{ This file is part of the Indy (Internet Direct) project, and is offered } +{ under the dual-licensing agreement described on the Indy website. } +{ (https://www.indyproject.org/license/) } +{ } +{ Copyright: } +{ (c) 1993-2020, Chad Z. Hower and the Indy Pit Crew. All rights reserved. } +{ } +{******************************************************************************} +{ } +{ } +{******************************************************************************} + +unit IdOpenSSLHeaders_sslerr; + +interface + +// Headers for OpenSSL 1.1.1 +// sslerr.h + + +uses + IdCTypes, + IdGlobal, + IdSSLOpenSSLConsts; + +(* + * SSL function codes. + *) +const + SSL_F_ADD_CLIENT_KEY_SHARE_EXT = 438; + SSL_F_ADD_KEY_SHARE = 512; + SSL_F_BYTES_TO_CIPHER_LIST = 519; + SSL_F_CHECK_SUITEB_CIPHER_LIST = 331; + SSL_F_CIPHERSUITE_CB = 622; + SSL_F_CONSTRUCT_CA_NAMES = 552; + SSL_F_CONSTRUCT_KEY_EXCHANGE_TBS = 553; + SSL_F_CONSTRUCT_STATEFUL_TICKET = 636; + SSL_F_CONSTRUCT_STATELESS_TICKET = 637; + SSL_F_CREATE_SYNTHETIC_MESSAGE_HASH = 539; + SSL_F_CREATE_TICKET_PREQUEL = 638; + SSL_F_CT_MOVE_SCTS = 345; + SSL_F_CT_STRICT = 349; + SSL_F_CUSTOM_EXT_ADD = 554; + SSL_F_CUSTOM_EXT_PARSE = 555; + SSL_F_D2I_SSL_SESSION = 103; + SSL_F_DANE_CTX_ENABLE = 347; + SSL_F_DANE_MTYPE_SET = 393; + SSL_F_DANE_TLSA_ADD = 394; + SSL_F_DERIVE_SECRET_KEY_AND_IV = 514; + SSL_F_DO_DTLS1_WRITE = 245; + SSL_F_DO_SSL3_WRITE = 104; + SSL_F_DTLS1_BUFFER_RECORD = 247; + SSL_F_DTLS1_CHECK_TIMEOUT_NUM = 318; + SSL_F_DTLS1_HEARTBEAT = 305; + SSL_F_DTLS1_HM_FRAGMENT_NEW = 623; + SSL_F_DTLS1_PREPROCESS_FRAGMENT = 288; + SSL_F_DTLS1_PROCESS_BUFFERED_RECORDS = 424; + SSL_F_DTLS1_PROCESS_RECORD = 257; + SSL_F_DTLS1_READ_BYTES = 258; + SSL_F_DTLS1_READ_FAILED = 339; + SSL_F_DTLS1_RETRANSMIT_MESSAGE = 390; + SSL_F_DTLS1_WRITE_APP_DATA_BYTES = 268; + SSL_F_DTLS1_WRITE_BYTES = 545; + SSL_F_DTLSV1_LISTEN = 350; + SSL_F_DTLS_CONSTRUCT_CHANGE_CIPHER_SPEC = 371; + SSL_F_DTLS_CONSTRUCT_HELLO_VERIFY_REQUEST = 385; + SSL_F_DTLS_GET_REASSEMBLED_MESSAGE = 370; + SSL_F_DTLS_PROCESS_HELLO_VERIFY = 386; + SSL_F_DTLS_RECORD_LAYER_NEW = 635; + SSL_F_DTLS_WAIT_FOR_DRY = 592; + SSL_F_EARLY_DATA_COUNT_OK = 532; + SSL_F_FINAL_EARLY_DATA = 556; + SSL_F_FINAL_EC_PT_FORMATS = 485; + SSL_F_FINAL_EMS = 486; + SSL_F_FINAL_KEY_SHARE = 503; + SSL_F_FINAL_MAXFRAGMENTLEN = 557; + SSL_F_FINAL_RENEGOTIATE = 483; + SSL_F_FINAL_SERVER_NAME = 558; + SSL_F_FINAL_SIG_ALGS = 497; + SSL_F_GET_CERT_VERIFY_TBS_DATA = 588; + SSL_F_NSS_KEYLOG_INT = 500; + SSL_F_OPENSSL_INIT_SSL = 342; + SSL_F_OSSL_STATEM_CLIENT13_READ_TRANSITION = 436; + SSL_F_OSSL_STATEM_CLIENT13_WRITE_TRANSITION = 598; + SSL_F_OSSL_STATEM_CLIENT_CONSTRUCT_MESSAGE = 430; + SSL_F_OSSL_STATEM_CLIENT_POST_PROCESS_MESSAGE = 593; + SSL_F_OSSL_STATEM_CLIENT_PROCESS_MESSAGE = 594; + SSL_F_OSSL_STATEM_CLIENT_READ_TRANSITION = 417; + SSL_F_OSSL_STATEM_CLIENT_WRITE_TRANSITION = 599; + SSL_F_OSSL_STATEM_SERVER13_READ_TRANSITION = 437; + SSL_F_OSSL_STATEM_SERVER13_WRITE_TRANSITION = 600; + SSL_F_OSSL_STATEM_SERVER_CONSTRUCT_MESSAGE = 431; + SSL_F_OSSL_STATEM_SERVER_POST_PROCESS_MESSAGE = 601; + SSL_F_OSSL_STATEM_SERVER_POST_WORK = 602; + SSL_F_OSSL_STATEM_SERVER_PROCESS_MESSAGE = 603; + SSL_F_OSSL_STATEM_SERVER_READ_TRANSITION = 418; + SSL_F_OSSL_STATEM_SERVER_WRITE_TRANSITION = 604; + SSL_F_PARSE_CA_NAMES = 541; + SSL_F_PITEM_NEW = 624; + SSL_F_PQUEUE_NEW = 625; + SSL_F_PROCESS_KEY_SHARE_EXT = 439; + SSL_F_READ_STATE_MACHINE = 352; + SSL_F_SET_CLIENT_CIPHERSUITE = 540; + SSL_F_SRP_GENERATE_CLIENT_MASTER_SECRET = 595; + SSL_F_SRP_GENERATE_SERVER_MASTER_SECRET = 589; + SSL_F_SRP_VERIFY_SERVER_PARAM = 596; + SSL_F_SSL3_CHANGE_CIPHER_STATE = 129; + SSL_F_SSL3_CHECK_CERT_AND_ALGORITHM = 130; + SSL_F_SSL3_CTRL = 213; + SSL_F_SSL3_CTX_CTRL = 133; + SSL_F_SSL3_DIGEST_CACHED_RECORDS = 293; + SSL_F_SSL3_DO_CHANGE_CIPHER_SPEC = 292; + SSL_F_SSL3_ENC = 608; + SSL_F_SSL3_FINAL_FINISH_MAC = 285; + SSL_F_SSL3_FINISH_MAC = 587; + SSL_F_SSL3_GENERATE_KEY_BLOCK = 238; + SSL_F_SSL3_GENERATE_MASTER_SECRET = 388; + SSL_F_SSL3_GET_RECORD = 143; + SSL_F_SSL3_INIT_FINISHED_MAC = 397; + SSL_F_SSL3_OUTPUT_CERT_CHAIN = 147; + SSL_F_SSL3_READ_BYTES = 148; + SSL_F_SSL3_READ_N = 149; + SSL_F_SSL3_SETUP_KEY_BLOCK = 157; + SSL_F_SSL3_SETUP_READ_BUFFER = 156; + SSL_F_SSL3_SETUP_WRITE_BUFFER = 291; + SSL_F_SSL3_WRITE_BYTES = 158; + SSL_F_SSL3_WRITE_PENDING = 159; + SSL_F_SSL_ADD_CERT_CHAIN = 316; + SSL_F_SSL_ADD_CERT_TO_BUF = 319; + SSL_F_SSL_ADD_CERT_TO_WPACKET = 493; + SSL_F_SSL_ADD_CLIENTHELLO_RENEGOTIATE_EXT = 298; + SSL_F_SSL_ADD_CLIENTHELLO_TLSEXT = 277; + SSL_F_SSL_ADD_CLIENTHELLO_USE_SRTP_EXT = 307; + SSL_F_SSL_ADD_DIR_CERT_SUBJECTS_TO_STACK = 215; + SSL_F_SSL_ADD_FILE_CERT_SUBJECTS_TO_STACK = 216; + SSL_F_SSL_ADD_SERVERHELLO_RENEGOTIATE_EXT = 299; + SSL_F_SSL_ADD_SERVERHELLO_TLSEXT = 278; + SSL_F_SSL_ADD_SERVERHELLO_USE_SRTP_EXT = 308; + SSL_F_SSL_BAD_METHOD = 160; + SSL_F_SSL_BUILD_CERT_CHAIN = 332; + SSL_F_SSL_BYTES_TO_CIPHER_LIST = 161; + SSL_F_SSL_CACHE_CIPHERLIST = 520; + SSL_F_SSL_CERT_ADD0_CHAIN_CERT = 346; + SSL_F_SSL_CERT_DUP = 221; + SSL_F_SSL_CERT_NEW = 162; + SSL_F_SSL_CERT_SET0_CHAIN = 340; + SSL_F_SSL_CHECK_PRIVATE_KEY = 163; + SSL_F_SSL_CHECK_SERVERHELLO_TLSEXT = 280; + SSL_F_SSL_CHECK_SRP_EXT_CLIENTHELLO = 606; + SSL_F_SSL_CHECK_SRVR_ECC_CERT_AND_ALG = 279; + SSL_F_SSL_CHOOSE_CLIENT_VERSION = 607; + SSL_F_SSL_CIPHER_DESCRIPTION = 626; + SSL_F_SSL_CIPHER_LIST_TO_BYTES = 425; + SSL_F_SSL_CIPHER_PROCESS_RULESTR = 230; + SSL_F_SSL_CIPHER_STRENGTH_SORT = 231; + SSL_F_SSL_CLEAR = 164; + SSL_F_SSL_CLIENT_HELLO_GET1_EXTENSIONS_PRESENT = 627; + SSL_F_SSL_COMP_ADD_COMPRESSION_METHOD = 165; + SSL_F_SSL_CONF_CMD = 334; + SSL_F_SSL_CREATE_CIPHER_LIST = 166; + SSL_F_SSL_CTRL = 232; + SSL_F_SSL_CTX_CHECK_PRIVATE_KEY = 168; + SSL_F_SSL_CTX_ENABLE_CT = 398; + SSL_F_SSL_CTX_MAKE_PROFILES = 309; + SSL_F_SSL_CTX_NEW = 169; + SSL_F_SSL_CTX_SET_ALPN_PROTOS = 343; + SSL_F_SSL_CTX_SET_CIPHER_LIST = 269; + SSL_F_SSL_CTX_SET_CLIENT_CERT_ENGINE = 290; + SSL_F_SSL_CTX_SET_CT_VALIDATION_CALLBACK = 396; + SSL_F_SSL_CTX_SET_SESSION_ID_CONTEXT = 219; + SSL_F_SSL_CTX_SET_SSL_VERSION = 170; + SSL_F_SSL_CTX_SET_TLSEXT_MAX_FRAGMENT_LENGTH = 551; + SSL_F_SSL_CTX_USE_CERTIFICATE = 171; + SSL_F_SSL_CTX_USE_CERTIFICATE_ASN1 = 172; + SSL_F_SSL_CTX_USE_CERTIFICATE_FILE = 173; + SSL_F_SSL_CTX_USE_PRIVATEKEY = 174; + SSL_F_SSL_CTX_USE_PRIVATEKEY_ASN1 = 175; + SSL_F_SSL_CTX_USE_PRIVATEKEY_FILE = 176; + SSL_F_SSL_CTX_USE_PSK_IDENTITY_HINT = 272; + SSL_F_SSL_CTX_USE_RSAPRIVATEKEY = 177; + SSL_F_SSL_CTX_USE_RSAPRIVATEKEY_ASN1 = 178; + SSL_F_SSL_CTX_USE_RSAPRIVATEKEY_FILE = 179; + SSL_F_SSL_CTX_USE_SERVERINFO = 336; + SSL_F_SSL_CTX_USE_SERVERINFO_EX = 543; + SSL_F_SSL_CTX_USE_SERVERINFO_FILE = 337; + SSL_F_SSL_DANE_DUP = 403; + SSL_F_SSL_DANE_ENABLE = 395; + SSL_F_SSL_DERIVE = 590; + SSL_F_SSL_DO_CONFIG = 391; + SSL_F_SSL_DO_HANDSHAKE = 180; + SSL_F_SSL_DUP_CA_LIST = 408; + SSL_F_SSL_ENABLE_CT = 402; + SSL_F_SSL_GENERATE_PKEY_GROUP = 559; + SSL_F_SSL_GENERATE_SESSION_ID = 547; + SSL_F_SSL_GET_NEW_SESSION = 181; + SSL_F_SSL_GET_PREV_SESSION = 217; + SSL_F_SSL_GET_SERVER_CERT_INDEX = 322; + SSL_F_SSL_GET_SIGN_PKEY = 183; + SSL_F_SSL_HANDSHAKE_HASH = 560; + SSL_F_SSL_INIT_WBIO_BUFFER = 184; + SSL_F_SSL_KEY_UPDATE = 515; + SSL_F_SSL_LOAD_CLIENT_CA_FILE = 185; + SSL_F_SSL_LOG_MASTER_SECRET = 498; + SSL_F_SSL_LOG_RSA_CLIENT_KEY_EXCHANGE = 499; + SSL_F_SSL_MODULE_INIT = 392; + SSL_F_SSL_NEW = 186; + SSL_F_SSL_NEXT_PROTO_VALIDATE = 565; + SSL_F_SSL_PARSE_CLIENTHELLO_RENEGOTIATE_EXT = 300; + SSL_F_SSL_PARSE_CLIENTHELLO_TLSEXT = 302; + SSL_F_SSL_PARSE_CLIENTHELLO_USE_SRTP_EXT = 310; + SSL_F_SSL_PARSE_SERVERHELLO_RENEGOTIATE_EXT = 301; + SSL_F_SSL_PARSE_SERVERHELLO_TLSEXT = 303; + SSL_F_SSL_PARSE_SERVERHELLO_USE_SRTP_EXT = 311; + SSL_F_SSL_PEEK = 270; + SSL_F_SSL_PEEK_EX = 432; + SSL_F_SSL_PEEK_INTERNAL = 522; + SSL_F_SSL_READ = 223; + SSL_F_SSL_READ_EARLY_DATA = 529; + SSL_F_SSL_READ_EX = 434; + SSL_F_SSL_READ_INTERNAL = 523; + SSL_F_SSL_RENEGOTIATE = 516; + SSL_F_SSL_RENEGOTIATE_ABBREVIATED = 546; + SSL_F_SSL_SCAN_CLIENTHELLO_TLSEXT = 320; + SSL_F_SSL_SCAN_SERVERHELLO_TLSEXT = 321; + SSL_F_SSL_SESSION_DUP = 348; + SSL_F_SSL_SESSION_NEW = 189; + SSL_F_SSL_SESSION_PRINT_FP = 190; + SSL_F_SSL_SESSION_SET1_ID = 423; + SSL_F_SSL_SESSION_SET1_ID_CONTEXT = 312; + SSL_F_SSL_SET_ALPN_PROTOS = 344; + SSL_F_SSL_SET_CERT = 191; + SSL_F_SSL_SET_CERT_AND_KEY = 621; + SSL_F_SSL_SET_CIPHER_LIST = 271; + SSL_F_SSL_SET_CT_VALIDATION_CALLBACK = 399; + SSL_F_SSL_SET_FD = 192; + SSL_F_SSL_SET_PKEY = 193; + SSL_F_SSL_SET_RFD = 194; + SSL_F_SSL_SET_SESSION = 195; + SSL_F_SSL_SET_SESSION_ID_CONTEXT = 218; + SSL_F_SSL_SET_SESSION_TICKET_EXT = 294; + SSL_F_SSL_SET_TLSEXT_MAX_FRAGMENT_LENGTH = 550; + SSL_F_SSL_SET_WFD = 196; + SSL_F_SSL_SHUTDOWN = 224; + SSL_F_SSL_SRP_CTX_INIT = 313; + SSL_F_SSL_START_ASYNC_JOB = 389; + SSL_F_SSL_UNDEFINED_FUNCTION = 197; + SSL_F_SSL_UNDEFINED_VOID_FUNCTION = 244; + SSL_F_SSL_USE_CERTIFICATE = 198; + SSL_F_SSL_USE_CERTIFICATE_ASN1 = 199; + SSL_F_SSL_USE_CERTIFICATE_FILE = 200; + SSL_F_SSL_USE_PRIVATEKEY = 201; + SSL_F_SSL_USE_PRIVATEKEY_ASN1 = 202; + SSL_F_SSL_USE_PRIVATEKEY_FILE = 203; + SSL_F_SSL_USE_PSK_IDENTITY_HINT = 273; + SSL_F_SSL_USE_RSAPRIVATEKEY = 204; + SSL_F_SSL_USE_RSAPRIVATEKEY_ASN1 = 205; + SSL_F_SSL_USE_RSAPRIVATEKEY_FILE = 206; + SSL_F_SSL_VALIDATE_CT = 400; + SSL_F_SSL_VERIFY_CERT_CHAIN = 207; + SSL_F_SSL_VERIFY_CLIENT_POST_HANDSHAKE = 616; + SSL_F_SSL_WRITE = 208; + SSL_F_SSL_WRITE_EARLY_DATA = 526; + SSL_F_SSL_WRITE_EARLY_FINISH = 527; + SSL_F_SSL_WRITE_EX = 433; + SSL_F_SSL_WRITE_INTERNAL = 524; + SSL_F_STATE_MACHINE = 353; + SSL_F_TLS12_CHECK_PEER_SIGALG = 333; + SSL_F_TLS12_COPY_SIGALGS = 533; + SSL_F_TLS13_CHANGE_CIPHER_STATE = 440; + SSL_F_TLS13_ENC = 609; + SSL_F_TLS13_FINAL_FINISH_MAC = 605; + SSL_F_TLS13_GENERATE_SECRET = 591; + SSL_F_TLS13_HKDF_EXPAND = 561; + SSL_F_TLS13_RESTORE_HANDSHAKE_DIGEST_FOR_PHA = 617; + SSL_F_TLS13_SAVE_HANDSHAKE_DIGEST_FOR_PHA = 618; + SSL_F_TLS13_SETUP_KEY_BLOCK = 441; + SSL_F_TLS1_CHANGE_CIPHER_STATE = 209; + SSL_F_TLS1_CHECK_DUPLICATE_EXTENSIONS = 341; + SSL_F_TLS1_ENC = 401; + SSL_F_TLS1_EXPORT_KEYING_MATERIAL = 314; + SSL_F_TLS1_GET_CURVELIST = 338; + SSL_F_TLS1_PRF = 284; + SSL_F_TLS1_SAVE_U16 = 628; + SSL_F_TLS1_SETUP_KEY_BLOCK = 211; + SSL_F_TLS1_SET_GROUPS = 629; + SSL_F_TLS1_SET_RAW_SIGALGS = 630; + SSL_F_TLS1_SET_SERVER_SIGALGS = 335; + SSL_F_TLS1_SET_SHARED_SIGALGS = 631; + SSL_F_TLS1_SET_SIGALGS = 632; + SSL_F_TLS_CHOOSE_SIGALG = 513; + SSL_F_TLS_CLIENT_KEY_EXCHANGE_POST_WORK = 354; + SSL_F_TLS_COLLECT_EXTENSIONS = 435; + SSL_F_TLS_CONSTRUCT_CERTIFICATE_AUTHORITIES = 542; + SSL_F_TLS_CONSTRUCT_CERTIFICATE_REQUEST = 372; + SSL_F_TLS_CONSTRUCT_CERT_STATUS = 429; + SSL_F_TLS_CONSTRUCT_CERT_STATUS_BODY = 494; + SSL_F_TLS_CONSTRUCT_CERT_VERIFY = 496; + SSL_F_TLS_CONSTRUCT_CHANGE_CIPHER_SPEC = 427; + SSL_F_TLS_CONSTRUCT_CKE_DHE = 404; + SSL_F_TLS_CONSTRUCT_CKE_ECDHE = 405; + SSL_F_TLS_CONSTRUCT_CKE_GOST = 406; + SSL_F_TLS_CONSTRUCT_CKE_PSK_PREAMBLE = 407; + SSL_F_TLS_CONSTRUCT_CKE_RSA = 409; + SSL_F_TLS_CONSTRUCT_CKE_SRP = 410; + SSL_F_TLS_CONSTRUCT_CLIENT_CERTIFICATE = 484; + SSL_F_TLS_CONSTRUCT_CLIENT_HELLO = 487; + SSL_F_TLS_CONSTRUCT_CLIENT_KEY_EXCHANGE = 488; + SSL_F_TLS_CONSTRUCT_CLIENT_VERIFY = 489; + SSL_F_TLS_CONSTRUCT_CTOS_ALPN = 466; + SSL_F_TLS_CONSTRUCT_CTOS_CERTIFICATE = 355; + SSL_F_TLS_CONSTRUCT_CTOS_COOKIE = 535; + SSL_F_TLS_CONSTRUCT_CTOS_EARLY_DATA = 530; + SSL_F_TLS_CONSTRUCT_CTOS_EC_PT_FORMATS = 467; + SSL_F_TLS_CONSTRUCT_CTOS_EMS = 468; + SSL_F_TLS_CONSTRUCT_CTOS_ETM = 469; + SSL_F_TLS_CONSTRUCT_CTOS_HELLO = 356; + SSL_F_TLS_CONSTRUCT_CTOS_KEY_EXCHANGE = 357; + SSL_F_TLS_CONSTRUCT_CTOS_KEY_SHARE = 470; + SSL_F_TLS_CONSTRUCT_CTOS_MAXFRAGMENTLEN = 549; + SSL_F_TLS_CONSTRUCT_CTOS_NPN = 471; + SSL_F_TLS_CONSTRUCT_CTOS_PADDING = 472; + SSL_F_TLS_CONSTRUCT_CTOS_POST_HANDSHAKE_AUTH = 619; + SSL_F_TLS_CONSTRUCT_CTOS_PSK = 501; + SSL_F_TLS_CONSTRUCT_CTOS_PSK_KEX_MODES = 509; + SSL_F_TLS_CONSTRUCT_CTOS_RENEGOTIATE = 473; + SSL_F_TLS_CONSTRUCT_CTOS_SCT = 474; + SSL_F_TLS_CONSTRUCT_CTOS_SERVER_NAME = 475; + SSL_F_TLS_CONSTRUCT_CTOS_SESSION_TICKET = 476; + SSL_F_TLS_CONSTRUCT_CTOS_SIG_ALGS = 477; + SSL_F_TLS_CONSTRUCT_CTOS_SRP = 478; + SSL_F_TLS_CONSTRUCT_CTOS_STATUS_REQUEST = 479; + SSL_F_TLS_CONSTRUCT_CTOS_SUPPORTED_GROUPS = 480; + SSL_F_TLS_CONSTRUCT_CTOS_SUPPORTED_VERSIONS = 481; + SSL_F_TLS_CONSTRUCT_CTOS_USE_SRTP = 482; + SSL_F_TLS_CONSTRUCT_CTOS_VERIFY = 358; + SSL_F_TLS_CONSTRUCT_ENCRYPTED_EXTENSIONS = 443; + SSL_F_TLS_CONSTRUCT_END_OF_EARLY_DATA = 536; + SSL_F_TLS_CONSTRUCT_EXTENSIONS = 447; + SSL_F_TLS_CONSTRUCT_FINISHED = 359; + SSL_F_TLS_CONSTRUCT_HELLO_REQUEST = 373; + SSL_F_TLS_CONSTRUCT_HELLO_RETRY_REQUEST = 510; + SSL_F_TLS_CONSTRUCT_KEY_UPDATE = 517; + SSL_F_TLS_CONSTRUCT_NEW_SESSION_TICKET = 428; + SSL_F_TLS_CONSTRUCT_NEXT_PROTO = 426; + SSL_F_TLS_CONSTRUCT_SERVER_CERTIFICATE = 490; + SSL_F_TLS_CONSTRUCT_SERVER_HELLO = 491; + SSL_F_TLS_CONSTRUCT_SERVER_KEY_EXCHANGE = 492; + SSL_F_TLS_CONSTRUCT_STOC_ALPN = 451; + SSL_F_TLS_CONSTRUCT_STOC_CERTIFICATE = 374; + SSL_F_TLS_CONSTRUCT_STOC_COOKIE = 613; + SSL_F_TLS_CONSTRUCT_STOC_CRYPTOPRO_BUG = 452; + SSL_F_TLS_CONSTRUCT_STOC_DONE = 375; + SSL_F_TLS_CONSTRUCT_STOC_EARLY_DATA = 531; + SSL_F_TLS_CONSTRUCT_STOC_EARLY_DATA_INFO = 525; + SSL_F_TLS_CONSTRUCT_STOC_EC_PT_FORMATS = 453; + SSL_F_TLS_CONSTRUCT_STOC_EMS = 454; + SSL_F_TLS_CONSTRUCT_STOC_ETM = 455; + SSL_F_TLS_CONSTRUCT_STOC_HELLO = 376; + SSL_F_TLS_CONSTRUCT_STOC_KEY_EXCHANGE = 377; + SSL_F_TLS_CONSTRUCT_STOC_KEY_SHARE = 456; + SSL_F_TLS_CONSTRUCT_STOC_MAXFRAGMENTLEN = 548; + SSL_F_TLS_CONSTRUCT_STOC_NEXT_PROTO_NEG = 457; + SSL_F_TLS_CONSTRUCT_STOC_PSK = 504; + SSL_F_TLS_CONSTRUCT_STOC_RENEGOTIATE = 458; + SSL_F_TLS_CONSTRUCT_STOC_SERVER_NAME = 459; + SSL_F_TLS_CONSTRUCT_STOC_SESSION_TICKET = 460; + SSL_F_TLS_CONSTRUCT_STOC_STATUS_REQUEST = 461; + SSL_F_TLS_CONSTRUCT_STOC_SUPPORTED_GROUPS = 544; + SSL_F_TLS_CONSTRUCT_STOC_SUPPORTED_VERSIONS = 611; + SSL_F_TLS_CONSTRUCT_STOC_USE_SRTP = 462; + SSL_F_TLS_EARLY_POST_PROCESS_CLIENT_HELLO = 521; + SSL_F_TLS_FINISH_HANDSHAKE = 597; + SSL_F_TLS_GET_MESSAGE_BODY = 351; + SSL_F_TLS_GET_MESSAGE_HEADER = 387; + SSL_F_TLS_HANDLE_ALPN = 562; + SSL_F_TLS_HANDLE_STATUS_REQUEST = 563; + SSL_F_TLS_PARSE_CERTIFICATE_AUTHORITIES = 566; + SSL_F_TLS_PARSE_CLIENTHELLO_TLSEXT = 449; + SSL_F_TLS_PARSE_CTOS_ALPN = 567; + SSL_F_TLS_PARSE_CTOS_COOKIE = 614; + SSL_F_TLS_PARSE_CTOS_EARLY_DATA = 568; + SSL_F_TLS_PARSE_CTOS_EC_PT_FORMATS = 569; + SSL_F_TLS_PARSE_CTOS_EMS = 570; + SSL_F_TLS_PARSE_CTOS_KEY_SHARE = 463; + SSL_F_TLS_PARSE_CTOS_MAXFRAGMENTLEN = 571; + SSL_F_TLS_PARSE_CTOS_POST_HANDSHAKE_AUTH = 620; + SSL_F_TLS_PARSE_CTOS_PSK = 505; + SSL_F_TLS_PARSE_CTOS_PSK_KEX_MODES = 572; + SSL_F_TLS_PARSE_CTOS_RENEGOTIATE = 464; + SSL_F_TLS_PARSE_CTOS_SERVER_NAME = 573; + SSL_F_TLS_PARSE_CTOS_SESSION_TICKET = 574; + SSL_F_TLS_PARSE_CTOS_SIG_ALGS = 575; + SSL_F_TLS_PARSE_CTOS_SIG_ALGS_CERT = 615; + SSL_F_TLS_PARSE_CTOS_SRP = 576; + SSL_F_TLS_PARSE_CTOS_STATUS_REQUEST = 577; + SSL_F_TLS_PARSE_CTOS_SUPPORTED_GROUPS = 578; + SSL_F_TLS_PARSE_CTOS_USE_SRTP = 465; + SSL_F_TLS_PARSE_STOC_ALPN = 579; + SSL_F_TLS_PARSE_STOC_COOKIE = 534; + SSL_F_TLS_PARSE_STOC_EARLY_DATA = 538; + SSL_F_TLS_PARSE_STOC_EARLY_DATA_INFO = 528; + SSL_F_TLS_PARSE_STOC_EC_PT_FORMATS = 580; + SSL_F_TLS_PARSE_STOC_KEY_SHARE = 445; + SSL_F_TLS_PARSE_STOC_MAXFRAGMENTLEN = 581; + SSL_F_TLS_PARSE_STOC_NPN = 582; + SSL_F_TLS_PARSE_STOC_PSK = 502; + SSL_F_TLS_PARSE_STOC_RENEGOTIATE = 448; + SSL_F_TLS_PARSE_STOC_SCT = 564; + SSL_F_TLS_PARSE_STOC_SERVER_NAME = 583; + SSL_F_TLS_PARSE_STOC_SESSION_TICKET = 584; + SSL_F_TLS_PARSE_STOC_STATUS_REQUEST = 585; + SSL_F_TLS_PARSE_STOC_SUPPORTED_VERSIONS = 612; + SSL_F_TLS_PARSE_STOC_USE_SRTP = 446; + SSL_F_TLS_POST_PROCESS_CLIENT_HELLO = 378; + SSL_F_TLS_POST_PROCESS_CLIENT_KEY_EXCHANGE = 384; + SSL_F_TLS_PREPARE_CLIENT_CERTIFICATE = 360; + SSL_F_TLS_PROCESS_AS_HELLO_RETRY_REQUEST = 610; + SSL_F_TLS_PROCESS_CERTIFICATE_REQUEST = 361; + SSL_F_TLS_PROCESS_CERT_STATUS = 362; + SSL_F_TLS_PROCESS_CERT_STATUS_BODY = 495; + SSL_F_TLS_PROCESS_CERT_VERIFY = 379; + SSL_F_TLS_PROCESS_CHANGE_CIPHER_SPEC = 363; + SSL_F_TLS_PROCESS_CKE_DHE = 411; + SSL_F_TLS_PROCESS_CKE_ECDHE = 412; + SSL_F_TLS_PROCESS_CKE_GOST = 413; + SSL_F_TLS_PROCESS_CKE_PSK_PREAMBLE = 414; + SSL_F_TLS_PROCESS_CKE_RSA = 415; + SSL_F_TLS_PROCESS_CKE_SRP = 416; + SSL_F_TLS_PROCESS_CLIENT_CERTIFICATE = 380; + SSL_F_TLS_PROCESS_CLIENT_HELLO = 381; + SSL_F_TLS_PROCESS_CLIENT_KEY_EXCHANGE = 382; + SSL_F_TLS_PROCESS_ENCRYPTED_EXTENSIONS = 444; + SSL_F_TLS_PROCESS_END_OF_EARLY_DATA = 537; + SSL_F_TLS_PROCESS_FINISHED = 364; + SSL_F_TLS_PROCESS_HELLO_REQ = 507; + SSL_F_TLS_PROCESS_HELLO_RETRY_REQUEST = 511; + SSL_F_TLS_PROCESS_INITIAL_SERVER_FLIGHT = 442; + SSL_F_TLS_PROCESS_KEY_EXCHANGE = 365; + SSL_F_TLS_PROCESS_KEY_UPDATE = 518; + SSL_F_TLS_PROCESS_NEW_SESSION_TICKET = 366; + SSL_F_TLS_PROCESS_NEXT_PROTO = 383; + SSL_F_TLS_PROCESS_SERVER_CERTIFICATE = 367; + SSL_F_TLS_PROCESS_SERVER_DONE = 368; + SSL_F_TLS_PROCESS_SERVER_HELLO = 369; + SSL_F_TLS_PROCESS_SKE_DHE = 419; + SSL_F_TLS_PROCESS_SKE_ECDHE = 420; + SSL_F_TLS_PROCESS_SKE_PSK_PREAMBLE = 421; + SSL_F_TLS_PROCESS_SKE_SRP = 422; + SSL_F_TLS_PSK_DO_BINDER = 506; + SSL_F_TLS_SCAN_CLIENTHELLO_TLSEXT = 450; + SSL_F_TLS_SETUP_HANDSHAKE = 508; + SSL_F_USE_CERTIFICATE_CHAIN_FILE = 220; + SSL_F_WPACKET_INTERN_INIT_LEN = 633; + SSL_F_WPACKET_START_SUB_PACKET_LEN__ = 634; + SSL_F_WRITE_STATE_MACHINE = 586; + SSL_R_APPLICATION_DATA_AFTER_CLOSE_NOTIFY = 291; + SSL_R_APP_DATA_IN_HANDSHAKE = 100; + SSL_R_ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT = 272; + SSL_R_AT_LEAST_TLS_1_0_NEEDED_IN_FIPS_MODE = 143; + SSL_R_AT_LEAST_TLS_1_2_NEEDED_IN_SUITEB_MODE = 158; + SSL_R_BAD_CHANGE_CIPHER_SPEC = 103; + SSL_R_BAD_CIPHER = 186; + SSL_R_BAD_DATA = 390; + SSL_R_BAD_DATA_RETURNED_BY_CALLBACK = 106; + SSL_R_BAD_DECOMPRESSION = 107; + SSL_R_BAD_DH_VALUE = 102; + SSL_R_BAD_DIGEST_LENGTH = 111; + SSL_R_BAD_EARLY_DATA = 233; + SSL_R_BAD_ECC_CERT = 304; + SSL_R_BAD_ECPOINT = 306; + SSL_R_BAD_EXTENSION = 110; + SSL_R_BAD_HANDSHAKE_LENGTH = 332; + SSL_R_BAD_HANDSHAKE_STATE = 236; + SSL_R_BAD_HELLO_REQUEST = 105; + SSL_R_BAD_HRR_VERSION = 263; + SSL_R_BAD_KEY_SHARE = 108; + SSL_R_BAD_KEY_UPDATE = 122; + SSL_R_BAD_LEGACY_VERSION = 292; + SSL_R_BAD_LENGTH = 271; + SSL_R_BAD_PACKET = 240; + SSL_R_BAD_PACKET_LENGTH = 115; + SSL_R_BAD_PROTOCOL_VERSION_NUMBER = 116; + SSL_R_BAD_PSK = 219; + SSL_R_BAD_PSK_IDENTITY = 114; + SSL_R_BAD_RECORD_TYPE = 443; + SSL_R_BAD_RSA_ENCRYPT = 119; + SSL_R_BAD_SIGNATURE = 123; + SSL_R_BAD_SRP_A_LENGTH = 347; + SSL_R_BAD_SRP_PARAMETERS = 371; + SSL_R_BAD_SRTP_MKI_VALUE = 352; + SSL_R_BAD_SRTP_PROTECTION_PROFILE_LIST = 353; + SSL_R_BAD_SSL_FILETYPE = 124; + SSL_R_BAD_VALUE = 384; + SSL_R_BAD_WRITE_RETRY = 127; + SSL_R_BINDER_DOES_NOT_VERIFY = 253; + SSL_R_BIO_NOT_SET = 128; + SSL_R_BLOCK_CIPHER_PAD_IS_WRONG = 129; + SSL_R_BN_LIB = 130; + SSL_R_CALLBACK_FAILED = 234; + SSL_R_CANNOT_CHANGE_CIPHER = 109; + SSL_R_CA_DN_LENGTH_MISMATCH = 131; + SSL_R_CA_KEY_TOO_SMALL = 397; + SSL_R_CA_MD_TOO_WEAK = 398; + SSL_R_CCS_RECEIVED_EARLY = 133; + SSL_R_CERTIFICATE_VERIFY_FAILED = 134; + SSL_R_CERT_CB_ERROR = 377; + SSL_R_CERT_LENGTH_MISMATCH = 135; + SSL_R_CIPHERSUITE_DIGEST_HAS_CHANGED = 218; + SSL_R_CIPHER_CODE_WRONG_LENGTH = 137; + SSL_R_CIPHER_OR_HASH_UNAVAILABLE = 138; + SSL_R_CLIENTHELLO_TLSEXT = 226; + SSL_R_COMPRESSED_LENGTH_TOO_LONG = 140; + SSL_R_COMPRESSION_DISABLED = 343; + SSL_R_COMPRESSION_FAILURE = 141; + SSL_R_COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE = 307; + SSL_R_COMPRESSION_LIBRARY_ERROR = 142; + SSL_R_CONNECTION_TYPE_NOT_SET = 144; + SSL_R_CONTEXT_NOT_DANE_ENABLED = 167; + SSL_R_COOKIE_GEN_CALLBACK_FAILURE = 400; + SSL_R_COOKIE_MISMATCH = 308; + SSL_R_CUSTOM_EXT_HANDLER_ALREADY_INSTALLED = 206; + SSL_R_DANE_ALREADY_ENABLED = 172; + SSL_R_DANE_CANNOT_OVERRIDE_MTYPE_FULL = 173; + SSL_R_DANE_NOT_ENABLED = 175; + SSL_R_DANE_TLSA_BAD_CERTIFICATE = 180; + SSL_R_DANE_TLSA_BAD_CERTIFICATE_USAGE = 184; + SSL_R_DANE_TLSA_BAD_DATA_LENGTH = 189; + SSL_R_DANE_TLSA_BAD_DIGEST_LENGTH = 192; + SSL_R_DANE_TLSA_BAD_MATCHING_TYPE = 200; + SSL_R_DANE_TLSA_BAD_PUBLIC_KEY = 201; + SSL_R_DANE_TLSA_BAD_SELECTOR = 202; + SSL_R_DANE_TLSA_NULL_DATA = 203; + SSL_R_DATA_BETWEEN_CCS_AND_FINISHED = 145; + SSL_R_DATA_LENGTH_TOO_LONG = 146; + SSL_R_DECRYPTION_FAILED = 147; + SSL_R_DECRYPTION_FAILED_OR_BAD_RECORD_MAC = 281; + SSL_R_DH_KEY_TOO_SMALL = 394; + SSL_R_DH_PUBLIC_VALUE_LENGTH_IS_WRONG = 148; + SSL_R_DIGEST_CHECK_FAILED = 149; + SSL_R_DTLS_MESSAGE_TOO_BIG = 334; + SSL_R_DUPLICATE_COMPRESSION_ID = 309; + SSL_R_ECC_CERT_NOT_FOR_SIGNING = 318; + SSL_R_ECDH_REQUIRED_FOR_SUITEB_MODE = 374; + SSL_R_EE_KEY_TOO_SMALL = 399; + SSL_R_EMPTY_SRTP_PROTECTION_PROFILE_LIST = 354; + SSL_R_ENCRYPTED_LENGTH_TOO_LONG = 150; + SSL_R_ERROR_IN_RECEIVED_CIPHER_LIST = 151; + SSL_R_ERROR_SETTING_TLSA_BASE_DOMAIN = 204; + SSL_R_EXCEEDS_MAX_FRAGMENT_SIZE = 194; + SSL_R_EXCESSIVE_MESSAGE_SIZE = 152; + SSL_R_EXTENSION_NOT_RECEIVED = 279; + SSL_R_EXTRA_DATA_IN_MESSAGE = 153; + SSL_R_EXT_LENGTH_MISMATCH = 163; + SSL_R_FAILED_TO_INIT_ASYNC = 405; + SSL_R_FRAGMENTED_CLIENT_HELLO = 401; + SSL_R_GOT_A_FIN_BEFORE_A_CCS = 154; + SSL_R_HTTPS_PROXY_REQUEST = 155; + SSL_R_HTTP_REQUEST = 156; + SSL_R_ILLEGAL_POINT_COMPRESSION = 162; + SSL_R_ILLEGAL_SUITEB_DIGEST = 380; + SSL_R_INAPPROPRIATE_FALLBACK = 373; + SSL_R_INCONSISTENT_COMPRESSION = 340; + SSL_R_INCONSISTENT_EARLY_DATA_ALPN = 222; + SSL_R_INCONSISTENT_EARLY_DATA_SNI = 231; + SSL_R_INCONSISTENT_EXTMS = 104; + SSL_R_INSUFFICIENT_SECURITY = 241; + SSL_R_INVALID_ALERT = 205; + SSL_R_INVALID_CCS_MESSAGE = 260; + SSL_R_INVALID_CERTIFICATE_OR_ALG = 238; + SSL_R_INVALID_COMMAND = 280; + SSL_R_INVALID_COMPRESSION_ALGORITHM = 341; + SSL_R_INVALID_CONFIG = 283; + SSL_R_INVALID_CONFIGURATION_NAME = 113; + SSL_R_INVALID_CONTEXT = 282; + SSL_R_INVALID_CT_VALIDATION_TYPE = 212; + SSL_R_INVALID_KEY_UPDATE_TYPE = 120; + SSL_R_INVALID_MAX_EARLY_DATA = 174; + SSL_R_INVALID_NULL_CMD_NAME = 385; + SSL_R_INVALID_SEQUENCE_NUMBER = 402; + SSL_R_INVALID_SERVERINFO_DATA = 388; + SSL_R_INVALID_SESSION_ID = 999; + SSL_R_INVALID_SRP_USERNAME = 357; + SSL_R_INVALID_STATUS_RESPONSE = 328; + SSL_R_INVALID_TICKET_KEYS_LENGTH = 325; + SSL_R_LENGTH_MISMATCH = 159; + SSL_R_LENGTH_TOO_LONG = 404; + SSL_R_LENGTH_TOO_SHORT = 160; + SSL_R_LIBRARY_BUG = 274; + SSL_R_LIBRARY_HAS_NO_CIPHERS = 161; + SSL_R_MISSING_DSA_SIGNING_CERT = 165; + SSL_R_MISSING_ECDSA_SIGNING_CERT = 381; + SSL_R_MISSING_FATAL = 256; + SSL_R_MISSING_PARAMETERS = 290; + SSL_R_MISSING_RSA_CERTIFICATE = 168; + SSL_R_MISSING_RSA_ENCRYPTING_CERT = 169; + SSL_R_MISSING_RSA_SIGNING_CERT = 170; + SSL_R_MISSING_SIGALGS_EXTENSION = 112; + SSL_R_MISSING_SIGNING_CERT = 221; + SSL_R_MISSING_SRP_PARAM = 358; + SSL_R_MISSING_SUPPORTED_GROUPS_EXTENSION = 209; + SSL_R_MISSING_TMP_DH_KEY = 171; + SSL_R_MISSING_TMP_ECDH_KEY = 311; + SSL_R_MIXED_HANDSHAKE_AND_NON_HANDSHAKE_DATA = 293; + SSL_R_NOT_ON_RECORD_BOUNDARY = 182; + SSL_R_NOT_REPLACING_CERTIFICATE = 289; + SSL_R_NOT_SERVER = 284; + SSL_R_NO_APPLICATION_PROTOCOL = 235; + SSL_R_NO_CERTIFICATES_RETURNED = 176; + SSL_R_NO_CERTIFICATE_ASSIGNED = 177; + SSL_R_NO_CERTIFICATE_SET = 179; + SSL_R_NO_CHANGE_FOLLOWING_HRR = 214; + SSL_R_NO_CIPHERS_AVAILABLE = 181; + SSL_R_NO_CIPHERS_SPECIFIED = 183; + SSL_R_NO_CIPHER_MATCH = 185; + SSL_R_NO_CLIENT_CERT_METHOD = 331; + SSL_R_NO_COMPRESSION_SPECIFIED = 187; + SSL_R_NO_COOKIE_CALLBACK_SET = 287; + SSL_R_NO_GOST_CERTIFICATE_SENT_BY_PEER = 330; + SSL_R_NO_METHOD_SPECIFIED = 188; + SSL_R_NO_PEM_EXTENSIONS = 389; + SSL_R_NO_PRIVATE_KEY_ASSIGNED = 190; + SSL_R_NO_PROTOCOLS_AVAILABLE = 191; + SSL_R_NO_RENEGOTIATION = 339; + SSL_R_NO_REQUIRED_DIGEST = 324; + SSL_R_NO_SHARED_CIPHER = 193; + SSL_R_NO_SHARED_GROUPS = 410; + SSL_R_NO_SHARED_SIGNATURE_ALGORITHMS = 376; + SSL_R_NO_SRTP_PROFILES = 359; + SSL_R_NO_SUITABLE_KEY_SHARE = 101; + SSL_R_NO_SUITABLE_SIGNATURE_ALGORITHM = 118; + SSL_R_NO_VALID_SCTS = 216; + SSL_R_NO_VERIFY_COOKIE_CALLBACK = 403; + SSL_R_NULL_SSL_CTX = 195; + SSL_R_NULL_SSL_METHOD_PASSED = 196; + SSL_R_OLD_SESSION_CIPHER_NOT_RETURNED = 197; + SSL_R_OLD_SESSION_COMPRESSION_ALGORITHM_NOT_RETURNED = 344; + SSL_R_OVERFLOW_ERROR = 237; + SSL_R_PACKET_LENGTH_TOO_LONG = 198; + SSL_R_PARSE_TLSEXT = 227; + SSL_R_PATH_TOO_LONG = 270; + SSL_R_PEER_DID_NOT_RETURN_A_CERTIFICATE = 199; + SSL_R_PEM_NAME_BAD_PREFIX = 391; + SSL_R_PEM_NAME_TOO_SHORT = 392; + SSL_R_PIPELINE_FAILURE = 406; + SSL_R_POST_HANDSHAKE_AUTH_ENCODING_ERR = 278; + SSL_R_PRIVATE_KEY_MISMATCH = 288; + SSL_R_PROTOCOL_IS_SHUTDOWN = 207; + SSL_R_PSK_IDENTITY_NOT_FOUND = 223; + SSL_R_PSK_NO_CLIENT_CB = 224; + SSL_R_PSK_NO_SERVER_CB = 225; + SSL_R_READ_BIO_NOT_SET = 211; + SSL_R_READ_TIMEOUT_EXPIRED = 312; + SSL_R_RECORD_LENGTH_MISMATCH = 213; + SSL_R_RECORD_TOO_SMALL = 298; + SSL_R_RENEGOTIATE_EXT_TOO_LONG = 335; + SSL_R_RENEGOTIATION_ENCODING_ERR = 336; + SSL_R_RENEGOTIATION_MISMATCH = 337; + SSL_R_REQUEST_PENDING = 285; + SSL_R_REQUEST_SENT = 286; + SSL_R_REQUIRED_CIPHER_MISSING = 215; + SSL_R_REQUIRED_COMPRESSION_ALGORITHM_MISSING = 342; + SSL_R_SCSV_RECEIVED_WHEN_RENEGOTIATING = 345; + SSL_R_SCT_VERIFICATION_FAILED = 208; + SSL_R_SERVERHELLO_TLSEXT = 275; + SSL_R_SESSION_ID_CONTEXT_UNINITIALIZED = 277; + SSL_R_SHUTDOWN_WHILE_IN_INIT = 407; + SSL_R_SIGNATURE_ALGORITHMS_ERROR = 360; + SSL_R_SIGNATURE_FOR_NON_SIGNING_CERTIFICATE = 220; + SSL_R_SRP_A_CALC = 361; + SSL_R_SRTP_COULD_NOT_ALLOCATE_PROFILES = 362; + SSL_R_SRTP_PROTECTION_PROFILE_LIST_TOO_LONG = 363; + SSL_R_SRTP_UNKNOWN_PROTECTION_PROFILE = 364; + SSL_R_SSL3_EXT_INVALID_MAX_FRAGMENT_LENGTH = 232; + SSL_R_SSL3_EXT_INVALID_SERVERNAME = 319; + SSL_R_SSL3_EXT_INVALID_SERVERNAME_TYPE = 320; + SSL_R_SSL3_SESSION_ID_TOO_LONG = 300; + SSL_R_SSLV3_ALERT_BAD_CERTIFICATE = 1042; + SSL_R_SSLV3_ALERT_BAD_RECORD_MAC = 1020; + SSL_R_SSLV3_ALERT_CERTIFICATE_EXPIRED = 1045; + SSL_R_SSLV3_ALERT_CERTIFICATE_REVOKED = 1044; + SSL_R_SSLV3_ALERT_CERTIFICATE_UNKNOWN = 1046; + SSL_R_SSLV3_ALERT_DECOMPRESSION_FAILURE = 1030; + SSL_R_SSLV3_ALERT_HANDSHAKE_FAILURE = 1040; + SSL_R_SSLV3_ALERT_ILLEGAL_PARAMETER = 1047; + SSL_R_SSLV3_ALERT_NO_CERTIFICATE = 1041; + SSL_R_SSLV3_ALERT_UNEXPECTED_MESSAGE = 1010; + SSL_R_SSLV3_ALERT_UNSUPPORTED_CERTIFICATE = 1043; + SSL_R_SSL_COMMAND_SECTION_EMPTY = 117; + SSL_R_SSL_COMMAND_SECTION_NOT_FOUND = 125; + SSL_R_SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION = 228; + SSL_R_SSL_HANDSHAKE_FAILURE = 229; + SSL_R_SSL_LIBRARY_HAS_NO_CIPHERS = 230; + SSL_R_SSL_NEGATIVE_LENGTH = 372; + SSL_R_SSL_SECTION_EMPTY = 126; + SSL_R_SSL_SECTION_NOT_FOUND = 136; + SSL_R_SSL_SESSION_ID_CALLBACK_FAILED = 301; + SSL_R_SSL_SESSION_ID_CONFLICT = 302; + SSL_R_SSL_SESSION_ID_CONTEXT_TOO_LONG = 273; + SSL_R_SSL_SESSION_ID_HAS_BAD_LENGTH = 303; + SSL_R_SSL_SESSION_ID_TOO_LONG = 408; + SSL_R_SSL_SESSION_VERSION_MISMATCH = 210; + SSL_R_STILL_IN_INIT = 121; + SSL_R_TLSV13_ALERT_CERTIFICATE_REQUIRED = 1116; + SSL_R_TLSV13_ALERT_MISSING_EXTENSION = 1109; + SSL_R_TLSV1_ALERT_ACCESS_DENIED = 1049; + SSL_R_TLSV1_ALERT_DECODE_ERROR = 1050; + SSL_R_TLSV1_ALERT_DECRYPTION_FAILED = 1021; + SSL_R_TLSV1_ALERT_DECRYPT_ERROR = 1051; + SSL_R_TLSV1_ALERT_EXPORT_RESTRICTION = 1060; + SSL_R_TLSV1_ALERT_INAPPROPRIATE_FALLBACK = 1086; + SSL_R_TLSV1_ALERT_INSUFFICIENT_SECURITY = 1071; + SSL_R_TLSV1_ALERT_INTERNAL_ERROR = 1080; + SSL_R_TLSV1_ALERT_NO_RENEGOTIATION = 1100; + SSL_R_TLSV1_ALERT_PROTOCOL_VERSION = 1070; + SSL_R_TLSV1_ALERT_RECORD_OVERFLOW = 1022; + SSL_R_TLSV1_ALERT_UNKNOWN_CA = 1048; + SSL_R_TLSV1_ALERT_USER_CANCELLED = 1090; + SSL_R_TLSV1_BAD_CERTIFICATE_HASH_VALUE = 1114; + SSL_R_TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE = 1113; + SSL_R_TLSV1_CERTIFICATE_UNOBTAINABLE = 1111; + SSL_R_TLSV1_UNRECOGNIZED_NAME = 1112; + SSL_R_TLSV1_UNSUPPORTED_EXTENSION = 1110; + SSL_R_TLS_HEARTBEAT_PEER_DOESNT_ACCEPT = 365; + SSL_R_TLS_HEARTBEAT_PENDING = 366; + SSL_R_TLS_ILLEGAL_EXPORTER_LABEL = 367; + SSL_R_TLS_INVALID_ECPOINTFORMAT_LIST = 157; + SSL_R_TOO_MANY_KEY_UPDATES = 132; + SSL_R_TOO_MANY_WARN_ALERTS = 409; + SSL_R_TOO_MUCH_EARLY_DATA = 164; + SSL_R_UNABLE_TO_FIND_ECDH_PARAMETERS = 314; + SSL_R_UNABLE_TO_FIND_PUBLIC_KEY_PARAMETERS = 239; + SSL_R_UNABLE_TO_LOAD_SSL3_MD5_ROUTINES = 242; + SSL_R_UNABLE_TO_LOAD_SSL3_SHA1_ROUTINES = 243; + SSL_R_UNEXPECTED_CCS_MESSAGE = 262; + SSL_R_UNEXPECTED_END_OF_EARLY_DATA = 178; + SSL_R_UNEXPECTED_MESSAGE = 244; + SSL_R_UNEXPECTED_RECORD = 245; + SSL_R_UNINITIALIZED = 276; + SSL_R_UNKNOWN_ALERT_TYPE = 246; + SSL_R_UNKNOWN_CERTIFICATE_TYPE = 247; + SSL_R_UNKNOWN_CIPHER_RETURNED = 248; + SSL_R_UNKNOWN_CIPHER_TYPE = 249; + SSL_R_UNKNOWN_CMD_NAME = 386; + SSL_R_UNKNOWN_COMMAND = 139; + SSL_R_UNKNOWN_DIGEST = 368; + SSL_R_UNKNOWN_KEY_EXCHANGE_TYPE = 250; + SSL_R_UNKNOWN_PKEY_TYPE = 251; + SSL_R_UNKNOWN_PROTOCOL = 252; + SSL_R_UNKNOWN_SSL_VERSION = 254; + SSL_R_UNKNOWN_STATE = 255; + SSL_R_UNSAFE_LEGACY_RENEGOTIATION_DISABLED = 338; + SSL_R_UNSOLICITED_EXTENSION = 217; + SSL_R_UNSUPPORTED_COMPRESSION_ALGORITHM = 257; + SSL_R_UNSUPPORTED_ELLIPTIC_CURVE = 315; + SSL_R_UNSUPPORTED_PROTOCOL = 258; + SSL_R_UNSUPPORTED_SSL_VERSION = 259; + SSL_R_UNSUPPORTED_STATUS_TYPE = 329; + SSL_R_USE_SRTP_NOT_NEGOTIATED = 369; + SSL_R_VERSION_TOO_HIGH = 166; + SSL_R_VERSION_TOO_LOW = 396; + SSL_R_WRONG_CERTIFICATE_TYPE = 383; + SSL_R_WRONG_CIPHER_RETURNED = 261; + SSL_R_WRONG_CURVE = 378; + SSL_R_WRONG_SIGNATURE_LENGTH = 264; + SSL_R_WRONG_SIGNATURE_SIZE = 265; + SSL_R_WRONG_SIGNATURE_TYPE = 370; + SSL_R_WRONG_SSL_VERSION = 266; + SSL_R_WRONG_VERSION_NUMBER = 267; + SSL_R_X509_LIB = 268; + SSL_R_X509_VERIFICATION_SETUP_PROBLEMS = 269; + + { The EXTERNALSYM directive is ignored by FPC, however, it is used by Delphi as follows: + + The EXTERNALSYM directive prevents the specified Delphi symbol from appearing in header + files generated for C++. } + + {$EXTERNALSYM ERR_load_SSL_strings} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +var + ERR_load_SSL_strings: function : TIdC_INT; cdecl = nil; + +{$ELSE} + function ERR_load_SSL_strings: TIdC_INT cdecl; external CLibSSL; + +{$ENDIF} + +implementation + + uses + classes, + IdSSLOpenSSLExceptionHandlers, + IdResourceStringsOpenSSL + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + ,IdSSLOpenSSLLoader + {$ENDIF}; + + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +const + ERR_load_SSL_strings_procname = 'ERR_load_SSL_strings'; + + +{$WARN NO_RETVAL OFF} +function ERR_ERR_load_SSL_strings: TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ERR_load_SSL_strings_procname); +end; + + + +{$WARN NO_RETVAL ON} + +procedure Load(const ADllHandle: TIdLibHandle; LibVersion: TIdC_UINT; const AFailed: TStringList); + +var FuncLoadError: boolean; + +begin + ERR_load_SSL_strings := LoadLibFunction(ADllHandle, ERR_load_SSL_strings_procname); + FuncLoadError := not assigned(ERR_load_SSL_strings); + if FuncLoadError then + begin + {$if not defined(ERR_load_SSL_strings_allownil)} + ERR_load_SSL_strings := @ERR_ERR_load_SSL_strings; + {$ifend} + {$if declared(ERR_load_SSL_strings_introduced)} + if LibVersion < ERR_load_SSL_strings_introduced then + begin + {$if declared(FC_ERR_load_SSL_strings)} + ERR_load_SSL_strings := @FC_ERR_load_SSL_strings; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ERR_load_SSL_strings_removed)} + if ERR_load_SSL_strings_removed <= LibVersion then + begin + {$if declared(_ERR_load_SSL_strings)} + ERR_load_SSL_strings := @_ERR_load_SSL_strings; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ERR_load_SSL_strings_allownil)} + if FuncLoadError then + AFailed.Add('ERR_load_SSL_strings'); + {$ifend} + end; + + +end; + +procedure Unload; +begin + ERR_load_SSL_strings := nil; +end; +{$ELSE} +{$ENDIF} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +initialization + Register_SSLLoader(@Load,'LibSSL'); + Register_SSLUnloader(@Unload); +{$ENDIF} +end. diff --git a/IdOpenSSLHeaders_stack.pas b/IdOpenSSLHeaders_stack.pas new file mode 100644 index 0000000..6b57da6 --- /dev/null +++ b/IdOpenSSLHeaders_stack.pas @@ -0,0 +1,2477 @@ + (* This unit was generated using the script genOpenSSLHdrs.sh from the source file IdOpenSSLHeaders_stack.h2pas + It should not be modified directly. All changes should be made to IdOpenSSLHeaders_stack.h2pas + and this file regenerated. IdOpenSSLHeaders_stack.h2pas is distributed with the full Indy + Distribution. + *) + +{$i IdCompilerDefines.inc} +{$i IdSSLOpenSSLDefines.inc} +{$IFNDEF USE_OPENSSL} + { error Should not compile if USE_OPENSSL is not defined!!!} +{$ENDIF} +{******************************************************************************} +{ } +{ Indy (Internet Direct) - Internet Protocols Simplified } +{ } +{ https://www.indyproject.org/ } +{ https://gitter.im/IndySockets/Indy } +{ } +{******************************************************************************} +{ } +{ This file is part of the Indy (Internet Direct) project, and is offered } +{ under the dual-licensing agreement described on the Indy website. } +{ (https://www.indyproject.org/license/) } +{ } +{ Copyright: } +{ (c) 1993-2020, Chad Z. Hower and the Indy Pit Crew. All rights reserved. } +{ } +{******************************************************************************} +{ } +{ } +{******************************************************************************} +unit IdOpenSSLHeaders_stack; + +interface + +uses + IdCTypes, + IdGlobal, + IdSSLOpenSSLConsts; + + +{ + Automatically converted by H2Pas 1.0.0 from stack.h + The following command line parameters were used: + -p + -t + stack.h +} + + { + * Copyright 1995-2017 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the OpenSSL license (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + } + + type + POPENSSL_STACK = pointer; + + TOPENSSL_sk_compfunc = function (_para1:pointer; _para2:pointer):longint;cdecl; + TOPENSSL_sk_freefunc = procedure (_para1:pointer);cdecl; + TOPENSSL_sk_copyfunc = function (_para1:pointer):pointer;cdecl; + + { The EXTERNALSYM directive is ignored by FPC, however, it is used by Delphi as follows: + + The EXTERNALSYM directive prevents the specified Delphi symbol from appearing in header + files generated for C++. } + + {$EXTERNALSYM OPENSSL_sk_num} {introduced 1.1.0} + {$EXTERNALSYM OPENSSL_sk_value} {introduced 1.1.0} + {$EXTERNALSYM OPENSSL_sk_set} {introduced 1.1.0} + {$EXTERNALSYM OPENSSL_sk_new} {introduced 1.1.0} + {$EXTERNALSYM OPENSSL_sk_new_null} {introduced 1.1.0} + {$EXTERNALSYM OPENSSL_sk_new_reserve} {introduced 1.1.0} + {$EXTERNALSYM OPENSSL_sk_reserve} {introduced 1.1.0} + {$EXTERNALSYM OPENSSL_sk_free} {introduced 1.1.0} + {$EXTERNALSYM OPENSSL_sk_pop_free} {introduced 1.1.0} + {$EXTERNALSYM OPENSSL_sk_deep_copy} {introduced 1.1.0} + {$EXTERNALSYM OPENSSL_sk_insert} {introduced 1.1.0} + {$EXTERNALSYM OPENSSL_sk_delete} {introduced 1.1.0} + {$EXTERNALSYM OPENSSL_sk_delete_ptr} {introduced 1.1.0} + {$EXTERNALSYM OPENSSL_sk_find} {introduced 1.1.0} + {$EXTERNALSYM OPENSSL_sk_find_ex} {introduced 1.1.0} + {$EXTERNALSYM OPENSSL_sk_push} {introduced 1.1.0} + {$EXTERNALSYM OPENSSL_sk_unshift} {introduced 1.1.0} + {$EXTERNALSYM OPENSSL_sk_shift} {introduced 1.1.0} + {$EXTERNALSYM OPENSSL_sk_pop} {introduced 1.1.0} + {$EXTERNALSYM OPENSSL_sk_zero} {introduced 1.1.0} + {$EXTERNALSYM OPENSSL_sk_set_cmp_func} {introduced 1.1.0} + {$EXTERNALSYM OPENSSL_sk_dup} {introduced 1.1.0} + {$EXTERNALSYM OPENSSL_sk_sort} {introduced 1.1.0} + {$EXTERNALSYM OPENSSL_sk_is_sorted} {introduced 1.1.0} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +var + {$EXTERNALSYM sk_num} {removed 1.1.0} + {$EXTERNALSYM sk_value} {removed 1.1.0} + {$EXTERNALSYM sk_set} {removed 1.1.0} + {$EXTERNALSYM sk_new} {removed 1.1.0} + {$EXTERNALSYM sk_new_null} {removed 1.1.0} + {$EXTERNALSYM sk_new_reserve} {removed 1.0.0} + {$EXTERNALSYM sk_reserve} {removed 1.0.0} + {$EXTERNALSYM sk_free} {removed 1.1.0} + {$EXTERNALSYM sk_pop_free} {removed 1.1.0} + {$EXTERNALSYM sk_deep_copy} {removed 1.1.0} + {$EXTERNALSYM sk_insert} {removed 1.1.0} + {$EXTERNALSYM sk_delete} {removed 1.1.0} + {$EXTERNALSYM sk_delete_ptr} {removed 1.1.0} + {$EXTERNALSYM sk_find} {removed 1.1.0} + {$EXTERNALSYM sk_find_ex} {removed 1.1.0} + {$EXTERNALSYM sk_push} {removed 1.1.0} + {$EXTERNALSYM sk_unshift} {removed 1.1.0} + {$EXTERNALSYM sk_shift} {removed 1.1.0} + {$EXTERNALSYM sk_pop} {removed 1.1.0} + {$EXTERNALSYM sk_zero} {removed 1.1.0} + {$EXTERNALSYM sk_set_cmp_func} {removed 1.1.0} + {$EXTERNALSYM sk_dup} {removed 1.1.0} + {$EXTERNALSYM sk_sort} {removed 1.1.0} + {$EXTERNALSYM sk_is_sorted} {removed 1.1.0} + OPENSSL_sk_num: function (_para1:POPENSSL_STACK):longint; cdecl = nil; {introduced 1.1.0} + OPENSSL_sk_value: function (_para1:POPENSSL_STACK; _para2:longint):pointer; cdecl = nil; {introduced 1.1.0} + OPENSSL_sk_set: function (st:POPENSSL_STACK; i:longint; data:pointer):pointer; cdecl = nil; {introduced 1.1.0} + OPENSSL_sk_new: function (cmp:TOPENSSL_sk_compfunc):POPENSSL_STACK; cdecl = nil; {introduced 1.1.0} + OPENSSL_sk_new_null: function :POPENSSL_STACK; cdecl = nil; {introduced 1.1.0} + OPENSSL_sk_new_reserve: function (c:TOPENSSL_sk_compfunc; n:longint):POPENSSL_STACK; cdecl = nil; {introduced 1.1.0} + OPENSSL_sk_reserve: function (st:POPENSSL_STACK; n:longint):longint; cdecl = nil; {introduced 1.1.0} + OPENSSL_sk_free: procedure (_para1:POPENSSL_STACK); cdecl = nil; {introduced 1.1.0} + OPENSSL_sk_pop_free: procedure (st:POPENSSL_STACK; func:TOPENSSL_sk_freefunc); cdecl = nil; {introduced 1.1.0} + OPENSSL_sk_deep_copy: function (_para1:POPENSSL_STACK; c:TOPENSSL_sk_copyfunc; f:TOPENSSL_sk_freefunc):POPENSSL_STACK; cdecl = nil; {introduced 1.1.0} + OPENSSL_sk_insert: function (sk:POPENSSL_STACK; data:pointer; where:longint):longint; cdecl = nil; {introduced 1.1.0} + OPENSSL_sk_delete: function (st:POPENSSL_STACK; loc:longint):pointer; cdecl = nil; {introduced 1.1.0} + OPENSSL_sk_delete_ptr: function (st:POPENSSL_STACK; p:pointer):pointer; cdecl = nil; {introduced 1.1.0} + OPENSSL_sk_find: function (st:POPENSSL_STACK; data:pointer):longint; cdecl = nil; {introduced 1.1.0} + OPENSSL_sk_find_ex: function (st:POPENSSL_STACK; data:pointer):longint; cdecl = nil; {introduced 1.1.0} + OPENSSL_sk_push: function (st:POPENSSL_STACK; data:pointer):longint; cdecl = nil; {introduced 1.1.0} + OPENSSL_sk_unshift: function (st:POPENSSL_STACK; data:pointer):longint; cdecl = nil; {introduced 1.1.0} + OPENSSL_sk_shift: function (st:POPENSSL_STACK):pointer; cdecl = nil; {introduced 1.1.0} + OPENSSL_sk_pop: function (st:POPENSSL_STACK):pointer; cdecl = nil; {introduced 1.1.0} + OPENSSL_sk_zero: procedure (st:POPENSSL_STACK); cdecl = nil; {introduced 1.1.0} + OPENSSL_sk_set_cmp_func: function (sk:POPENSSL_STACK; cmp:TOPENSSL_sk_compfunc):TOPENSSL_sk_compfunc; cdecl = nil; {introduced 1.1.0} + OPENSSL_sk_dup: function (st:POPENSSL_STACK):POPENSSL_STACK; cdecl = nil; {introduced 1.1.0} + OPENSSL_sk_sort: procedure (st:POPENSSL_STACK); cdecl = nil; {introduced 1.1.0} + OPENSSL_sk_is_sorted: function (st:POPENSSL_STACK):longint; cdecl = nil; {introduced 1.1.0} + + sk_num: function (_para1:POPENSSL_STACK):longint; cdecl = nil; {removed 1.1.0} + sk_value: function (_para1:POPENSSL_STACK; _para2:longint):pointer; cdecl = nil; {removed 1.1.0} + sk_set: function (st:POPENSSL_STACK; i:longint; data:pointer):pointer; cdecl = nil; {removed 1.1.0} + sk_new: function (cmp:TOPENSSL_sk_compfunc):POPENSSL_STACK; cdecl = nil; {removed 1.1.0} + sk_new_null: function :POPENSSL_STACK; cdecl = nil; {removed 1.1.0} + sk_new_reserve: function (c:TOPENSSL_sk_compfunc; n:longint):POPENSSL_STACK; cdecl = nil; {removed 1.0.0} + sk_reserve: function (st:POPENSSL_STACK; n:longint):longint; cdecl = nil; {removed 1.0.0} + sk_free: procedure (_para1:POPENSSL_STACK); cdecl = nil; {removed 1.1.0} + sk_pop_free: procedure (st:POPENSSL_STACK; func:TOPENSSL_sk_freefunc); cdecl = nil; {removed 1.1.0} + sk_deep_copy: function (_para1:POPENSSL_STACK; c:TOPENSSL_sk_copyfunc; f:TOPENSSL_sk_freefunc):POPENSSL_STACK; cdecl = nil; {removed 1.1.0} + sk_insert: function (sk:POPENSSL_STACK; data:pointer; where:longint):longint; cdecl = nil; {removed 1.1.0} + sk_delete: function (st:POPENSSL_STACK; loc:longint):pointer; cdecl = nil; {removed 1.1.0} + sk_delete_ptr: function (st:POPENSSL_STACK; p:pointer):pointer; cdecl = nil; {removed 1.1.0} + sk_find: function (st:POPENSSL_STACK; data:pointer):longint; cdecl = nil; {removed 1.1.0} + sk_find_ex: function (st:POPENSSL_STACK; data:pointer):longint; cdecl = nil; {removed 1.1.0} + sk_push: function (st:POPENSSL_STACK; data:pointer):longint; cdecl = nil; {removed 1.1.0} + sk_unshift: function (st:POPENSSL_STACK; data:pointer):longint; cdecl = nil; {removed 1.1.0} + sk_shift: function (st:POPENSSL_STACK):pointer; cdecl = nil; {removed 1.1.0} + sk_pop: function (st:POPENSSL_STACK):pointer; cdecl = nil; {removed 1.1.0} + sk_zero: procedure (st:POPENSSL_STACK); cdecl = nil; {removed 1.1.0} + sk_set_cmp_func: function (sk:POPENSSL_STACK; cmp:TOPENSSL_sk_compfunc):TOPENSSL_sk_compfunc; cdecl = nil; {removed 1.1.0} + sk_dup: function (st:POPENSSL_STACK):POPENSSL_STACK; cdecl = nil; {removed 1.1.0} + sk_sort: procedure (st:POPENSSL_STACK); cdecl = nil; {removed 1.1.0} + sk_is_sorted: function (st:POPENSSL_STACK):longint; cdecl = nil; {removed 1.1.0} + +{$ELSE} + function OPENSSL_sk_num(_para1:POPENSSL_STACK):longint cdecl; external CLibCrypto; {introduced 1.1.0} + function OPENSSL_sk_value(_para1:POPENSSL_STACK; _para2:longint):pointer cdecl; external CLibCrypto; {introduced 1.1.0} + function OPENSSL_sk_set(st:POPENSSL_STACK; i:longint; data:pointer):pointer cdecl; external CLibCrypto; {introduced 1.1.0} + function OPENSSL_sk_new(cmp:TOPENSSL_sk_compfunc):POPENSSL_STACK cdecl; external CLibCrypto; {introduced 1.1.0} + function OPENSSL_sk_new_null:POPENSSL_STACK cdecl; external CLibCrypto; {introduced 1.1.0} + function OPENSSL_sk_new_reserve(c:TOPENSSL_sk_compfunc; n:longint):POPENSSL_STACK cdecl; external CLibCrypto; {introduced 1.1.0} + function OPENSSL_sk_reserve(st:POPENSSL_STACK; n:longint):longint cdecl; external CLibCrypto; {introduced 1.1.0} + procedure OPENSSL_sk_free(_para1:POPENSSL_STACK) cdecl; external CLibCrypto; {introduced 1.1.0} + procedure OPENSSL_sk_pop_free(st:POPENSSL_STACK; func:TOPENSSL_sk_freefunc) cdecl; external CLibCrypto; {introduced 1.1.0} + function OPENSSL_sk_deep_copy(_para1:POPENSSL_STACK; c:TOPENSSL_sk_copyfunc; f:TOPENSSL_sk_freefunc):POPENSSL_STACK cdecl; external CLibCrypto; {introduced 1.1.0} + function OPENSSL_sk_insert(sk:POPENSSL_STACK; data:pointer; where:longint):longint cdecl; external CLibCrypto; {introduced 1.1.0} + function OPENSSL_sk_delete(st:POPENSSL_STACK; loc:longint):pointer cdecl; external CLibCrypto; {introduced 1.1.0} + function OPENSSL_sk_delete_ptr(st:POPENSSL_STACK; p:pointer):pointer cdecl; external CLibCrypto; {introduced 1.1.0} + function OPENSSL_sk_find(st:POPENSSL_STACK; data:pointer):longint cdecl; external CLibCrypto; {introduced 1.1.0} + function OPENSSL_sk_find_ex(st:POPENSSL_STACK; data:pointer):longint cdecl; external CLibCrypto; {introduced 1.1.0} + function OPENSSL_sk_push(st:POPENSSL_STACK; data:pointer):longint cdecl; external CLibCrypto; {introduced 1.1.0} + function OPENSSL_sk_unshift(st:POPENSSL_STACK; data:pointer):longint cdecl; external CLibCrypto; {introduced 1.1.0} + function OPENSSL_sk_shift(st:POPENSSL_STACK):pointer cdecl; external CLibCrypto; {introduced 1.1.0} + function OPENSSL_sk_pop(st:POPENSSL_STACK):pointer cdecl; external CLibCrypto; {introduced 1.1.0} + procedure OPENSSL_sk_zero(st:POPENSSL_STACK) cdecl; external CLibCrypto; {introduced 1.1.0} + function OPENSSL_sk_set_cmp_func(sk:POPENSSL_STACK; cmp:TOPENSSL_sk_compfunc):TOPENSSL_sk_compfunc cdecl; external CLibCrypto; {introduced 1.1.0} + function OPENSSL_sk_dup(st:POPENSSL_STACK):POPENSSL_STACK cdecl; external CLibCrypto; {introduced 1.1.0} + procedure OPENSSL_sk_sort(st:POPENSSL_STACK) cdecl; external CLibCrypto; {introduced 1.1.0} + function OPENSSL_sk_is_sorted(st:POPENSSL_STACK):longint cdecl; external CLibCrypto; {introduced 1.1.0} + + + function sk_num(_para1:POPENSSL_STACK):longint; {removed 1.1.0} + function sk_value(_para1:POPENSSL_STACK; _para2:longint):pointer; {removed 1.1.0} + function sk_set(st:POPENSSL_STACK; i:longint; data:pointer):pointer; {removed 1.1.0} + function sk_new(cmp:TOPENSSL_sk_compfunc):POPENSSL_STACK; {removed 1.1.0} + function sk_new_null:POPENSSL_STACK; {removed 1.1.0} + function sk_new_reserve(c:TOPENSSL_sk_compfunc; n:longint):POPENSSL_STACK; {removed 1.0.0} + function sk_reserve(st:POPENSSL_STACK; n:longint):longint; {removed 1.0.0} + procedure sk_free(_para1:POPENSSL_STACK); {removed 1.1.0} + procedure sk_pop_free(st:POPENSSL_STACK; func:TOPENSSL_sk_freefunc); {removed 1.1.0} + function sk_deep_copy(_para1:POPENSSL_STACK; c:TOPENSSL_sk_copyfunc; f:TOPENSSL_sk_freefunc):POPENSSL_STACK; {removed 1.1.0} + function sk_insert(sk:POPENSSL_STACK; data:pointer; where:longint):longint; {removed 1.1.0} + function sk_delete(st:POPENSSL_STACK; loc:longint):pointer; {removed 1.1.0} + function sk_delete_ptr(st:POPENSSL_STACK; p:pointer):pointer; {removed 1.1.0} + function sk_find(st:POPENSSL_STACK; data:pointer):longint; {removed 1.1.0} + function sk_find_ex(st:POPENSSL_STACK; data:pointer):longint; {removed 1.1.0} + function sk_push(st:POPENSSL_STACK; data:pointer):longint; {removed 1.1.0} + function sk_unshift(st:POPENSSL_STACK; data:pointer):longint; {removed 1.1.0} + function sk_shift(st:POPENSSL_STACK):pointer; {removed 1.1.0} + function sk_pop(st:POPENSSL_STACK):pointer; {removed 1.1.0} + procedure sk_zero(st:POPENSSL_STACK); {removed 1.1.0} + function sk_set_cmp_func(sk:POPENSSL_STACK; cmp:TOPENSSL_sk_compfunc):TOPENSSL_sk_compfunc; {removed 1.1.0} + function sk_dup(st:POPENSSL_STACK):POPENSSL_STACK; {removed 1.1.0} + procedure sk_sort(st:POPENSSL_STACK); {removed 1.1.0} + function sk_is_sorted(st:POPENSSL_STACK):longint; {removed 1.1.0} +{$ENDIF} + +implementation + + uses + classes, + IdSSLOpenSSLExceptionHandlers, + IdResourceStringsOpenSSL + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + ,IdSSLOpenSSLLoader + {$ENDIF}; + +const + OPENSSL_sk_num_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + OPENSSL_sk_value_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + OPENSSL_sk_set_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + OPENSSL_sk_new_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + OPENSSL_sk_new_null_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + OPENSSL_sk_new_reserve_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + OPENSSL_sk_reserve_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + OPENSSL_sk_free_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + OPENSSL_sk_pop_free_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + OPENSSL_sk_deep_copy_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + OPENSSL_sk_insert_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + OPENSSL_sk_delete_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + OPENSSL_sk_delete_ptr_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + OPENSSL_sk_find_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + OPENSSL_sk_find_ex_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + OPENSSL_sk_push_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + OPENSSL_sk_unshift_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + OPENSSL_sk_shift_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + OPENSSL_sk_pop_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + OPENSSL_sk_zero_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + OPENSSL_sk_set_cmp_func_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + OPENSSL_sk_dup_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + OPENSSL_sk_sort_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + OPENSSL_sk_is_sorted_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + sk_num_removed = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + sk_value_removed = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + sk_set_removed = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + sk_new_removed = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + sk_new_null_removed = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + sk_new_reserve_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + sk_reserve_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + sk_free_removed = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + sk_pop_free_removed = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + sk_deep_copy_removed = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + sk_insert_removed = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + sk_delete_removed = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + sk_delete_ptr_removed = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + sk_find_removed = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + sk_find_ex_removed = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + sk_push_removed = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + sk_unshift_removed = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + sk_shift_removed = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + sk_pop_removed = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + sk_zero_removed = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + sk_set_cmp_func_removed = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + sk_dup_removed = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + sk_sort_removed = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + sk_is_sorted_removed = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +const + OPENSSL_sk_num_procname = 'OPENSSL_sk_num'; {introduced 1.1.0} + OPENSSL_sk_value_procname = 'OPENSSL_sk_value'; {introduced 1.1.0} + OPENSSL_sk_set_procname = 'OPENSSL_sk_set'; {introduced 1.1.0} + OPENSSL_sk_new_procname = 'OPENSSL_sk_new'; {introduced 1.1.0} + OPENSSL_sk_new_null_procname = 'OPENSSL_sk_new_null'; {introduced 1.1.0} + OPENSSL_sk_new_reserve_procname = 'OPENSSL_sk_new_reserve'; {introduced 1.1.0} + OPENSSL_sk_reserve_procname = 'OPENSSL_sk_reserve'; {introduced 1.1.0} + OPENSSL_sk_free_procname = 'OPENSSL_sk_free'; {introduced 1.1.0} + OPENSSL_sk_pop_free_procname = 'OPENSSL_sk_pop_free'; {introduced 1.1.0} + OPENSSL_sk_deep_copy_procname = 'OPENSSL_sk_deep_copy'; {introduced 1.1.0} + OPENSSL_sk_insert_procname = 'OPENSSL_sk_insert'; {introduced 1.1.0} + OPENSSL_sk_delete_procname = 'OPENSSL_sk_delete'; {introduced 1.1.0} + OPENSSL_sk_delete_ptr_procname = 'OPENSSL_sk_delete_ptr'; {introduced 1.1.0} + OPENSSL_sk_find_procname = 'OPENSSL_sk_find'; {introduced 1.1.0} + OPENSSL_sk_find_ex_procname = 'OPENSSL_sk_find_ex'; {introduced 1.1.0} + OPENSSL_sk_push_procname = 'OPENSSL_sk_push'; {introduced 1.1.0} + OPENSSL_sk_unshift_procname = 'OPENSSL_sk_unshift'; {introduced 1.1.0} + OPENSSL_sk_shift_procname = 'OPENSSL_sk_shift'; {introduced 1.1.0} + OPENSSL_sk_pop_procname = 'OPENSSL_sk_pop'; {introduced 1.1.0} + OPENSSL_sk_zero_procname = 'OPENSSL_sk_zero'; {introduced 1.1.0} + OPENSSL_sk_set_cmp_func_procname = 'OPENSSL_sk_set_cmp_func'; {introduced 1.1.0} + OPENSSL_sk_dup_procname = 'OPENSSL_sk_dup'; {introduced 1.1.0} + OPENSSL_sk_sort_procname = 'OPENSSL_sk_sort'; {introduced 1.1.0} + OPENSSL_sk_is_sorted_procname = 'OPENSSL_sk_is_sorted'; {introduced 1.1.0} + + sk_num_procname = 'sk_num'; {removed 1.1.0} + sk_value_procname = 'sk_value'; {removed 1.1.0} + sk_set_procname = 'sk_set'; {removed 1.1.0} + sk_new_procname = 'sk_new'; {removed 1.1.0} + sk_new_null_procname = 'sk_new_null'; {removed 1.1.0} + sk_new_reserve_procname = 'sk_new_reserve'; {removed 1.0.0} + sk_reserve_procname = 'sk_reserve'; {removed 1.0.0} + sk_free_procname = 'sk_free'; {removed 1.1.0} + sk_pop_free_procname = 'sk_pop_free'; {removed 1.1.0} + sk_deep_copy_procname = 'sk_deep_copy'; {removed 1.1.0} + sk_insert_procname = 'sk_insert'; {removed 1.1.0} + sk_delete_procname = 'sk_delete'; {removed 1.1.0} + sk_delete_ptr_procname = 'sk_delete_ptr'; {removed 1.1.0} + sk_find_procname = 'sk_find'; {removed 1.1.0} + sk_find_ex_procname = 'sk_find_ex'; {removed 1.1.0} + sk_push_procname = 'sk_push'; {removed 1.1.0} + sk_unshift_procname = 'sk_unshift'; {removed 1.1.0} + sk_shift_procname = 'sk_shift'; {removed 1.1.0} + sk_pop_procname = 'sk_pop'; {removed 1.1.0} + sk_zero_procname = 'sk_zero'; {removed 1.1.0} + sk_set_cmp_func_procname = 'sk_set_cmp_func'; {removed 1.1.0} + sk_dup_procname = 'sk_dup'; {removed 1.1.0} + sk_sort_procname = 'sk_sort'; {removed 1.1.0} + sk_is_sorted_procname = 'sk_is_sorted'; {removed 1.1.0} + + +function _sk_num(_para1:POPENSSL_STACK):longint; cdecl; +begin + Result := OPENSSL_sk_num(_para1); +end; + +function _sk_value(_para1:POPENSSL_STACK; _para2:longint):pointer; cdecl; +begin + Result := OPENSSL_sk_value(_para1,_para2); +end; + +function _sk_set(st:POPENSSL_STACK; i:longint; data:pointer):pointer; cdecl; +begin + Result := OPENSSL_sk_set(st,i,data); +end; + +function _sk_new(cmp:TOPENSSL_sk_compfunc):POPENSSL_STACK; cdecl; +begin + Result := OPENSSL_sk_new(cmp); +end; + +function _sk_new_null:POPENSSL_STACK; cdecl; +begin + Result := OPENSSL_sk_new_null; +end; + +function _sk_new_reserve(c:TOPENSSL_sk_compfunc; n:longint):POPENSSL_STACK; cdecl; +begin + Result := OPENSSL_sk_new_reserve(c,n); +end; + +function _sk_reserve(st:POPENSSL_STACK; n:longint):longint; cdecl; +begin + Result := OPENSSL_sk_reserve(st,n); +end; + +procedure _sk_free(_para1:POPENSSL_STACK); cdecl; +begin + OPENSSL_sk_free(_para1); +end; + +procedure _sk_pop_free(st:POPENSSL_STACK; func:TOPENSSL_sk_freefunc); cdecl; +begin + OPENSSL_sk_pop_free(st, func); +end; + +function _sk_deep_copy(_para1:POPENSSL_STACK; c:TOPENSSL_sk_copyfunc; f:TOPENSSL_sk_freefunc):POPENSSL_STACK; cdecl; +begin + Result := OPENSSL_sk_deep_copy(_para1,c,f); +end; + +function _sk_insert(sk:POPENSSL_STACK; data:pointer; where:longint):longint; cdecl; +begin + Result := OPENSSL_sk_insert(sk,data,where); +end; + +function _sk_delete(st:POPENSSL_STACK; loc:longint):pointer; cdecl; +begin + Result := OPENSSL_sk_delete(st,loc); +end; + +function _sk_delete_ptr(st:POPENSSL_STACK; p:pointer):pointer; cdecl; +begin + Result := OPENSSL_sk_delete_ptr(st,p); +end; + +function _sk_find(st:POPENSSL_STACK; data:pointer):longint; cdecl; +begin + Result := OPENSSL_sk_find(st,data); +end; + +function _sk_find_ex(st:POPENSSL_STACK; data:pointer):longint; cdecl; +begin + Result := OPENSSL_sk_find_ex(st,data); +end; + +function _sk_push(st:POPENSSL_STACK; data:pointer):longint; cdecl; +begin + Result := OPENSSL_sk_push(st,data); +end; + +function _sk_unshift(st:POPENSSL_STACK; data:pointer):longint; cdecl; +begin + Result := OPENSSL_sk_unshift(st,data); +end; + +function _sk_shift(st:POPENSSL_STACK):pointer; cdecl; +begin + Result := OPENSSL_sk_shift(st); +end; + +function _sk_pop(st:POPENSSL_STACK):pointer; cdecl; +begin + Result := OPENSSL_sk_pop(st); +end; + +procedure _sk_zero(st:POPENSSL_STACK); cdecl; +begin + OPENSSL_sk_zero(st); +end; + +function _sk_set_cmp_func(sk:POPENSSL_STACK; cmp:TOPENSSL_sk_compfunc):TOPENSSL_sk_compfunc; cdecl; +begin + Result := OPENSSL_sk_set_cmp_func(sk,cmp); +end; + +function _sk_dup(st:POPENSSL_STACK):POPENSSL_STACK; cdecl; +begin + Result := OPENSSL_sk_dup(st); +end; + +procedure _sk_sort(st:POPENSSL_STACK); cdecl; +begin + OPENSSL_sk_sort(st); +end; + +function _sk_is_sorted(st:POPENSSL_STACK):longint; cdecl; +begin + Result := OPENSSL_sk_is_sorted(st); +end; + + + +{$WARN NO_RETVAL OFF} +function ERR_OPENSSL_sk_num(_para1:POPENSSL_STACK):longint; +begin + EIdAPIFunctionNotPresent.RaiseException(OPENSSL_sk_num_procname); +end; + + {introduced 1.1.0} +function ERR_OPENSSL_sk_value(_para1:POPENSSL_STACK; _para2:longint):pointer; +begin + EIdAPIFunctionNotPresent.RaiseException(OPENSSL_sk_value_procname); +end; + + {introduced 1.1.0} +function ERR_OPENSSL_sk_set(st:POPENSSL_STACK; i:longint; data:pointer):pointer; +begin + EIdAPIFunctionNotPresent.RaiseException(OPENSSL_sk_set_procname); +end; + + {introduced 1.1.0} +function ERR_OPENSSL_sk_new(cmp:TOPENSSL_sk_compfunc):POPENSSL_STACK; +begin + EIdAPIFunctionNotPresent.RaiseException(OPENSSL_sk_new_procname); +end; + + {introduced 1.1.0} +function ERR_OPENSSL_sk_new_null:POPENSSL_STACK; +begin + EIdAPIFunctionNotPresent.RaiseException(OPENSSL_sk_new_null_procname); +end; + + {introduced 1.1.0} +function ERR_OPENSSL_sk_new_reserve(c:TOPENSSL_sk_compfunc; n:longint):POPENSSL_STACK; +begin + EIdAPIFunctionNotPresent.RaiseException(OPENSSL_sk_new_reserve_procname); +end; + + {introduced 1.1.0} +function ERR_OPENSSL_sk_reserve(st:POPENSSL_STACK; n:longint):longint; +begin + EIdAPIFunctionNotPresent.RaiseException(OPENSSL_sk_reserve_procname); +end; + + {introduced 1.1.0} +procedure ERR_OPENSSL_sk_free(_para1:POPENSSL_STACK); +begin + EIdAPIFunctionNotPresent.RaiseException(OPENSSL_sk_free_procname); +end; + + {introduced 1.1.0} +procedure ERR_OPENSSL_sk_pop_free(st:POPENSSL_STACK; func:TOPENSSL_sk_freefunc); +begin + EIdAPIFunctionNotPresent.RaiseException(OPENSSL_sk_pop_free_procname); +end; + + {introduced 1.1.0} +function ERR_OPENSSL_sk_deep_copy(_para1:POPENSSL_STACK; c:TOPENSSL_sk_copyfunc; f:TOPENSSL_sk_freefunc):POPENSSL_STACK; +begin + EIdAPIFunctionNotPresent.RaiseException(OPENSSL_sk_deep_copy_procname); +end; + + {introduced 1.1.0} +function ERR_OPENSSL_sk_insert(sk:POPENSSL_STACK; data:pointer; where:longint):longint; +begin + EIdAPIFunctionNotPresent.RaiseException(OPENSSL_sk_insert_procname); +end; + + {introduced 1.1.0} +function ERR_OPENSSL_sk_delete(st:POPENSSL_STACK; loc:longint):pointer; +begin + EIdAPIFunctionNotPresent.RaiseException(OPENSSL_sk_delete_procname); +end; + + {introduced 1.1.0} +function ERR_OPENSSL_sk_delete_ptr(st:POPENSSL_STACK; p:pointer):pointer; +begin + EIdAPIFunctionNotPresent.RaiseException(OPENSSL_sk_delete_ptr_procname); +end; + + {introduced 1.1.0} +function ERR_OPENSSL_sk_find(st:POPENSSL_STACK; data:pointer):longint; +begin + EIdAPIFunctionNotPresent.RaiseException(OPENSSL_sk_find_procname); +end; + + {introduced 1.1.0} +function ERR_OPENSSL_sk_find_ex(st:POPENSSL_STACK; data:pointer):longint; +begin + EIdAPIFunctionNotPresent.RaiseException(OPENSSL_sk_find_ex_procname); +end; + + {introduced 1.1.0} +function ERR_OPENSSL_sk_push(st:POPENSSL_STACK; data:pointer):longint; +begin + EIdAPIFunctionNotPresent.RaiseException(OPENSSL_sk_push_procname); +end; + + {introduced 1.1.0} +function ERR_OPENSSL_sk_unshift(st:POPENSSL_STACK; data:pointer):longint; +begin + EIdAPIFunctionNotPresent.RaiseException(OPENSSL_sk_unshift_procname); +end; + + {introduced 1.1.0} +function ERR_OPENSSL_sk_shift(st:POPENSSL_STACK):pointer; +begin + EIdAPIFunctionNotPresent.RaiseException(OPENSSL_sk_shift_procname); +end; + + {introduced 1.1.0} +function ERR_OPENSSL_sk_pop(st:POPENSSL_STACK):pointer; +begin + EIdAPIFunctionNotPresent.RaiseException(OPENSSL_sk_pop_procname); +end; + + {introduced 1.1.0} +procedure ERR_OPENSSL_sk_zero(st:POPENSSL_STACK); +begin + EIdAPIFunctionNotPresent.RaiseException(OPENSSL_sk_zero_procname); +end; + + {introduced 1.1.0} +function ERR_OPENSSL_sk_set_cmp_func(sk:POPENSSL_STACK; cmp:TOPENSSL_sk_compfunc):TOPENSSL_sk_compfunc; +begin + EIdAPIFunctionNotPresent.RaiseException(OPENSSL_sk_set_cmp_func_procname); +end; + + {introduced 1.1.0} +function ERR_OPENSSL_sk_dup(st:POPENSSL_STACK):POPENSSL_STACK; +begin + EIdAPIFunctionNotPresent.RaiseException(OPENSSL_sk_dup_procname); +end; + + {introduced 1.1.0} +procedure ERR_OPENSSL_sk_sort(st:POPENSSL_STACK); +begin + EIdAPIFunctionNotPresent.RaiseException(OPENSSL_sk_sort_procname); +end; + + {introduced 1.1.0} +function ERR_OPENSSL_sk_is_sorted(st:POPENSSL_STACK):longint; +begin + EIdAPIFunctionNotPresent.RaiseException(OPENSSL_sk_is_sorted_procname); +end; + + {introduced 1.1.0} + +function ERR_sk_num(_para1:POPENSSL_STACK):longint; +begin + EIdAPIFunctionNotPresent.RaiseException(sk_num_procname); +end; + + +function ERR_sk_value(_para1:POPENSSL_STACK; _para2:longint):pointer; +begin + EIdAPIFunctionNotPresent.RaiseException(sk_value_procname); +end; + + +function ERR_sk_set(st:POPENSSL_STACK; i:longint; data:pointer):pointer; +begin + EIdAPIFunctionNotPresent.RaiseException(sk_set_procname); +end; + + +function ERR_sk_new(cmp:TOPENSSL_sk_compfunc):POPENSSL_STACK; +begin + EIdAPIFunctionNotPresent.RaiseException(sk_new_procname); +end; + + +function ERR_sk_new_null:POPENSSL_STACK; +begin + EIdAPIFunctionNotPresent.RaiseException(sk_new_null_procname); +end; + + +function ERR_sk_new_reserve(c:TOPENSSL_sk_compfunc; n:longint):POPENSSL_STACK; +begin + EIdAPIFunctionNotPresent.RaiseException(sk_new_reserve_procname); +end; + + +function ERR_sk_reserve(st:POPENSSL_STACK; n:longint):longint; +begin + EIdAPIFunctionNotPresent.RaiseException(sk_reserve_procname); +end; + + +procedure ERR_sk_free(_para1:POPENSSL_STACK); +begin + EIdAPIFunctionNotPresent.RaiseException(sk_free_procname); +end; + + +procedure ERR_sk_pop_free(st:POPENSSL_STACK; func:TOPENSSL_sk_freefunc); +begin + EIdAPIFunctionNotPresent.RaiseException(sk_pop_free_procname); +end; + + +function ERR_sk_deep_copy(_para1:POPENSSL_STACK; c:TOPENSSL_sk_copyfunc; f:TOPENSSL_sk_freefunc):POPENSSL_STACK; +begin + EIdAPIFunctionNotPresent.RaiseException(sk_deep_copy_procname); +end; + + +function ERR_sk_insert(sk:POPENSSL_STACK; data:pointer; where:longint):longint; +begin + EIdAPIFunctionNotPresent.RaiseException(sk_insert_procname); +end; + + +function ERR_sk_delete(st:POPENSSL_STACK; loc:longint):pointer; +begin + EIdAPIFunctionNotPresent.RaiseException(sk_delete_procname); +end; + + +function ERR_sk_delete_ptr(st:POPENSSL_STACK; p:pointer):pointer; +begin + EIdAPIFunctionNotPresent.RaiseException(sk_delete_ptr_procname); +end; + + +function ERR_sk_find(st:POPENSSL_STACK; data:pointer):longint; +begin + EIdAPIFunctionNotPresent.RaiseException(sk_find_procname); +end; + + +function ERR_sk_find_ex(st:POPENSSL_STACK; data:pointer):longint; +begin + EIdAPIFunctionNotPresent.RaiseException(sk_find_ex_procname); +end; + + +function ERR_sk_push(st:POPENSSL_STACK; data:pointer):longint; +begin + EIdAPIFunctionNotPresent.RaiseException(sk_push_procname); +end; + + +function ERR_sk_unshift(st:POPENSSL_STACK; data:pointer):longint; +begin + EIdAPIFunctionNotPresent.RaiseException(sk_unshift_procname); +end; + + +function ERR_sk_shift(st:POPENSSL_STACK):pointer; +begin + EIdAPIFunctionNotPresent.RaiseException(sk_shift_procname); +end; + + +function ERR_sk_pop(st:POPENSSL_STACK):pointer; +begin + EIdAPIFunctionNotPresent.RaiseException(sk_pop_procname); +end; + + +procedure ERR_sk_zero(st:POPENSSL_STACK); +begin + EIdAPIFunctionNotPresent.RaiseException(sk_zero_procname); +end; + + +function ERR_sk_set_cmp_func(sk:POPENSSL_STACK; cmp:TOPENSSL_sk_compfunc):TOPENSSL_sk_compfunc; +begin + EIdAPIFunctionNotPresent.RaiseException(sk_set_cmp_func_procname); +end; + + +function ERR_sk_dup(st:POPENSSL_STACK):POPENSSL_STACK; +begin + EIdAPIFunctionNotPresent.RaiseException(sk_dup_procname); +end; + + +procedure ERR_sk_sort(st:POPENSSL_STACK); +begin + EIdAPIFunctionNotPresent.RaiseException(sk_sort_procname); +end; + + +function ERR_sk_is_sorted(st:POPENSSL_STACK):longint; +begin + EIdAPIFunctionNotPresent.RaiseException(sk_is_sorted_procname); +end; + + + +{$WARN NO_RETVAL ON} + +procedure Load(const ADllHandle: TIdLibHandle; LibVersion: TIdC_UINT; const AFailed: TStringList); + +var FuncLoadError: boolean; + +begin + OPENSSL_sk_num := LoadLibFunction(ADllHandle, OPENSSL_sk_num_procname); + FuncLoadError := not assigned(OPENSSL_sk_num); + if FuncLoadError then + begin + {$if not defined(OPENSSL_sk_num_allownil)} + OPENSSL_sk_num := @ERR_OPENSSL_sk_num; + {$ifend} + {$if declared(OPENSSL_sk_num_introduced)} + if LibVersion < OPENSSL_sk_num_introduced then + begin + {$if declared(FC_OPENSSL_sk_num)} + OPENSSL_sk_num := @FC_OPENSSL_sk_num; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OPENSSL_sk_num_removed)} + if OPENSSL_sk_num_removed <= LibVersion then + begin + {$if declared(_OPENSSL_sk_num)} + OPENSSL_sk_num := @_OPENSSL_sk_num; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OPENSSL_sk_num_allownil)} + if FuncLoadError then + AFailed.Add('OPENSSL_sk_num'); + {$ifend} + end; + + {introduced 1.1.0} + OPENSSL_sk_value := LoadLibFunction(ADllHandle, OPENSSL_sk_value_procname); + FuncLoadError := not assigned(OPENSSL_sk_value); + if FuncLoadError then + begin + {$if not defined(OPENSSL_sk_value_allownil)} + OPENSSL_sk_value := @ERR_OPENSSL_sk_value; + {$ifend} + {$if declared(OPENSSL_sk_value_introduced)} + if LibVersion < OPENSSL_sk_value_introduced then + begin + {$if declared(FC_OPENSSL_sk_value)} + OPENSSL_sk_value := @FC_OPENSSL_sk_value; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OPENSSL_sk_value_removed)} + if OPENSSL_sk_value_removed <= LibVersion then + begin + {$if declared(_OPENSSL_sk_value)} + OPENSSL_sk_value := @_OPENSSL_sk_value; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OPENSSL_sk_value_allownil)} + if FuncLoadError then + AFailed.Add('OPENSSL_sk_value'); + {$ifend} + end; + + {introduced 1.1.0} + OPENSSL_sk_set := LoadLibFunction(ADllHandle, OPENSSL_sk_set_procname); + FuncLoadError := not assigned(OPENSSL_sk_set); + if FuncLoadError then + begin + {$if not defined(OPENSSL_sk_set_allownil)} + OPENSSL_sk_set := @ERR_OPENSSL_sk_set; + {$ifend} + {$if declared(OPENSSL_sk_set_introduced)} + if LibVersion < OPENSSL_sk_set_introduced then + begin + {$if declared(FC_OPENSSL_sk_set)} + OPENSSL_sk_set := @FC_OPENSSL_sk_set; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OPENSSL_sk_set_removed)} + if OPENSSL_sk_set_removed <= LibVersion then + begin + {$if declared(_OPENSSL_sk_set)} + OPENSSL_sk_set := @_OPENSSL_sk_set; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OPENSSL_sk_set_allownil)} + if FuncLoadError then + AFailed.Add('OPENSSL_sk_set'); + {$ifend} + end; + + {introduced 1.1.0} + OPENSSL_sk_new := LoadLibFunction(ADllHandle, OPENSSL_sk_new_procname); + FuncLoadError := not assigned(OPENSSL_sk_new); + if FuncLoadError then + begin + {$if not defined(OPENSSL_sk_new_allownil)} + OPENSSL_sk_new := @ERR_OPENSSL_sk_new; + {$ifend} + {$if declared(OPENSSL_sk_new_introduced)} + if LibVersion < OPENSSL_sk_new_introduced then + begin + {$if declared(FC_OPENSSL_sk_new)} + OPENSSL_sk_new := @FC_OPENSSL_sk_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OPENSSL_sk_new_removed)} + if OPENSSL_sk_new_removed <= LibVersion then + begin + {$if declared(_OPENSSL_sk_new)} + OPENSSL_sk_new := @_OPENSSL_sk_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OPENSSL_sk_new_allownil)} + if FuncLoadError then + AFailed.Add('OPENSSL_sk_new'); + {$ifend} + end; + + {introduced 1.1.0} + OPENSSL_sk_new_null := LoadLibFunction(ADllHandle, OPENSSL_sk_new_null_procname); + FuncLoadError := not assigned(OPENSSL_sk_new_null); + if FuncLoadError then + begin + {$if not defined(OPENSSL_sk_new_null_allownil)} + OPENSSL_sk_new_null := @ERR_OPENSSL_sk_new_null; + {$ifend} + {$if declared(OPENSSL_sk_new_null_introduced)} + if LibVersion < OPENSSL_sk_new_null_introduced then + begin + {$if declared(FC_OPENSSL_sk_new_null)} + OPENSSL_sk_new_null := @FC_OPENSSL_sk_new_null; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OPENSSL_sk_new_null_removed)} + if OPENSSL_sk_new_null_removed <= LibVersion then + begin + {$if declared(_OPENSSL_sk_new_null)} + OPENSSL_sk_new_null := @_OPENSSL_sk_new_null; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OPENSSL_sk_new_null_allownil)} + if FuncLoadError then + AFailed.Add('OPENSSL_sk_new_null'); + {$ifend} + end; + + {introduced 1.1.0} + OPENSSL_sk_new_reserve := LoadLibFunction(ADllHandle, OPENSSL_sk_new_reserve_procname); + FuncLoadError := not assigned(OPENSSL_sk_new_reserve); + if FuncLoadError then + begin + {$if not defined(OPENSSL_sk_new_reserve_allownil)} + OPENSSL_sk_new_reserve := @ERR_OPENSSL_sk_new_reserve; + {$ifend} + {$if declared(OPENSSL_sk_new_reserve_introduced)} + if LibVersion < OPENSSL_sk_new_reserve_introduced then + begin + {$if declared(FC_OPENSSL_sk_new_reserve)} + OPENSSL_sk_new_reserve := @FC_OPENSSL_sk_new_reserve; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OPENSSL_sk_new_reserve_removed)} + if OPENSSL_sk_new_reserve_removed <= LibVersion then + begin + {$if declared(_OPENSSL_sk_new_reserve)} + OPENSSL_sk_new_reserve := @_OPENSSL_sk_new_reserve; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OPENSSL_sk_new_reserve_allownil)} + if FuncLoadError then + AFailed.Add('OPENSSL_sk_new_reserve'); + {$ifend} + end; + + {introduced 1.1.0} + OPENSSL_sk_reserve := LoadLibFunction(ADllHandle, OPENSSL_sk_reserve_procname); + FuncLoadError := not assigned(OPENSSL_sk_reserve); + if FuncLoadError then + begin + {$if not defined(OPENSSL_sk_reserve_allownil)} + OPENSSL_sk_reserve := @ERR_OPENSSL_sk_reserve; + {$ifend} + {$if declared(OPENSSL_sk_reserve_introduced)} + if LibVersion < OPENSSL_sk_reserve_introduced then + begin + {$if declared(FC_OPENSSL_sk_reserve)} + OPENSSL_sk_reserve := @FC_OPENSSL_sk_reserve; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OPENSSL_sk_reserve_removed)} + if OPENSSL_sk_reserve_removed <= LibVersion then + begin + {$if declared(_OPENSSL_sk_reserve)} + OPENSSL_sk_reserve := @_OPENSSL_sk_reserve; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OPENSSL_sk_reserve_allownil)} + if FuncLoadError then + AFailed.Add('OPENSSL_sk_reserve'); + {$ifend} + end; + + {introduced 1.1.0} + OPENSSL_sk_free := LoadLibFunction(ADllHandle, OPENSSL_sk_free_procname); + FuncLoadError := not assigned(OPENSSL_sk_free); + if FuncLoadError then + begin + {$if not defined(OPENSSL_sk_free_allownil)} + OPENSSL_sk_free := @ERR_OPENSSL_sk_free; + {$ifend} + {$if declared(OPENSSL_sk_free_introduced)} + if LibVersion < OPENSSL_sk_free_introduced then + begin + {$if declared(FC_OPENSSL_sk_free)} + OPENSSL_sk_free := @FC_OPENSSL_sk_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OPENSSL_sk_free_removed)} + if OPENSSL_sk_free_removed <= LibVersion then + begin + {$if declared(_OPENSSL_sk_free)} + OPENSSL_sk_free := @_OPENSSL_sk_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OPENSSL_sk_free_allownil)} + if FuncLoadError then + AFailed.Add('OPENSSL_sk_free'); + {$ifend} + end; + + {introduced 1.1.0} + OPENSSL_sk_pop_free := LoadLibFunction(ADllHandle, OPENSSL_sk_pop_free_procname); + FuncLoadError := not assigned(OPENSSL_sk_pop_free); + if FuncLoadError then + begin + {$if not defined(OPENSSL_sk_pop_free_allownil)} + OPENSSL_sk_pop_free := @ERR_OPENSSL_sk_pop_free; + {$ifend} + {$if declared(OPENSSL_sk_pop_free_introduced)} + if LibVersion < OPENSSL_sk_pop_free_introduced then + begin + {$if declared(FC_OPENSSL_sk_pop_free)} + OPENSSL_sk_pop_free := @FC_OPENSSL_sk_pop_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OPENSSL_sk_pop_free_removed)} + if OPENSSL_sk_pop_free_removed <= LibVersion then + begin + {$if declared(_OPENSSL_sk_pop_free)} + OPENSSL_sk_pop_free := @_OPENSSL_sk_pop_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OPENSSL_sk_pop_free_allownil)} + if FuncLoadError then + AFailed.Add('OPENSSL_sk_pop_free'); + {$ifend} + end; + + {introduced 1.1.0} + OPENSSL_sk_deep_copy := LoadLibFunction(ADllHandle, OPENSSL_sk_deep_copy_procname); + FuncLoadError := not assigned(OPENSSL_sk_deep_copy); + if FuncLoadError then + begin + {$if not defined(OPENSSL_sk_deep_copy_allownil)} + OPENSSL_sk_deep_copy := @ERR_OPENSSL_sk_deep_copy; + {$ifend} + {$if declared(OPENSSL_sk_deep_copy_introduced)} + if LibVersion < OPENSSL_sk_deep_copy_introduced then + begin + {$if declared(FC_OPENSSL_sk_deep_copy)} + OPENSSL_sk_deep_copy := @FC_OPENSSL_sk_deep_copy; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OPENSSL_sk_deep_copy_removed)} + if OPENSSL_sk_deep_copy_removed <= LibVersion then + begin + {$if declared(_OPENSSL_sk_deep_copy)} + OPENSSL_sk_deep_copy := @_OPENSSL_sk_deep_copy; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OPENSSL_sk_deep_copy_allownil)} + if FuncLoadError then + AFailed.Add('OPENSSL_sk_deep_copy'); + {$ifend} + end; + + {introduced 1.1.0} + OPENSSL_sk_insert := LoadLibFunction(ADllHandle, OPENSSL_sk_insert_procname); + FuncLoadError := not assigned(OPENSSL_sk_insert); + if FuncLoadError then + begin + {$if not defined(OPENSSL_sk_insert_allownil)} + OPENSSL_sk_insert := @ERR_OPENSSL_sk_insert; + {$ifend} + {$if declared(OPENSSL_sk_insert_introduced)} + if LibVersion < OPENSSL_sk_insert_introduced then + begin + {$if declared(FC_OPENSSL_sk_insert)} + OPENSSL_sk_insert := @FC_OPENSSL_sk_insert; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OPENSSL_sk_insert_removed)} + if OPENSSL_sk_insert_removed <= LibVersion then + begin + {$if declared(_OPENSSL_sk_insert)} + OPENSSL_sk_insert := @_OPENSSL_sk_insert; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OPENSSL_sk_insert_allownil)} + if FuncLoadError then + AFailed.Add('OPENSSL_sk_insert'); + {$ifend} + end; + + {introduced 1.1.0} + OPENSSL_sk_delete := LoadLibFunction(ADllHandle, OPENSSL_sk_delete_procname); + FuncLoadError := not assigned(OPENSSL_sk_delete); + if FuncLoadError then + begin + {$if not defined(OPENSSL_sk_delete_allownil)} + OPENSSL_sk_delete := @ERR_OPENSSL_sk_delete; + {$ifend} + {$if declared(OPENSSL_sk_delete_introduced)} + if LibVersion < OPENSSL_sk_delete_introduced then + begin + {$if declared(FC_OPENSSL_sk_delete)} + OPENSSL_sk_delete := @FC_OPENSSL_sk_delete; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OPENSSL_sk_delete_removed)} + if OPENSSL_sk_delete_removed <= LibVersion then + begin + {$if declared(_OPENSSL_sk_delete)} + OPENSSL_sk_delete := @_OPENSSL_sk_delete; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OPENSSL_sk_delete_allownil)} + if FuncLoadError then + AFailed.Add('OPENSSL_sk_delete'); + {$ifend} + end; + + {introduced 1.1.0} + OPENSSL_sk_delete_ptr := LoadLibFunction(ADllHandle, OPENSSL_sk_delete_ptr_procname); + FuncLoadError := not assigned(OPENSSL_sk_delete_ptr); + if FuncLoadError then + begin + {$if not defined(OPENSSL_sk_delete_ptr_allownil)} + OPENSSL_sk_delete_ptr := @ERR_OPENSSL_sk_delete_ptr; + {$ifend} + {$if declared(OPENSSL_sk_delete_ptr_introduced)} + if LibVersion < OPENSSL_sk_delete_ptr_introduced then + begin + {$if declared(FC_OPENSSL_sk_delete_ptr)} + OPENSSL_sk_delete_ptr := @FC_OPENSSL_sk_delete_ptr; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OPENSSL_sk_delete_ptr_removed)} + if OPENSSL_sk_delete_ptr_removed <= LibVersion then + begin + {$if declared(_OPENSSL_sk_delete_ptr)} + OPENSSL_sk_delete_ptr := @_OPENSSL_sk_delete_ptr; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OPENSSL_sk_delete_ptr_allownil)} + if FuncLoadError then + AFailed.Add('OPENSSL_sk_delete_ptr'); + {$ifend} + end; + + {introduced 1.1.0} + OPENSSL_sk_find := LoadLibFunction(ADllHandle, OPENSSL_sk_find_procname); + FuncLoadError := not assigned(OPENSSL_sk_find); + if FuncLoadError then + begin + {$if not defined(OPENSSL_sk_find_allownil)} + OPENSSL_sk_find := @ERR_OPENSSL_sk_find; + {$ifend} + {$if declared(OPENSSL_sk_find_introduced)} + if LibVersion < OPENSSL_sk_find_introduced then + begin + {$if declared(FC_OPENSSL_sk_find)} + OPENSSL_sk_find := @FC_OPENSSL_sk_find; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OPENSSL_sk_find_removed)} + if OPENSSL_sk_find_removed <= LibVersion then + begin + {$if declared(_OPENSSL_sk_find)} + OPENSSL_sk_find := @_OPENSSL_sk_find; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OPENSSL_sk_find_allownil)} + if FuncLoadError then + AFailed.Add('OPENSSL_sk_find'); + {$ifend} + end; + + {introduced 1.1.0} + OPENSSL_sk_find_ex := LoadLibFunction(ADllHandle, OPENSSL_sk_find_ex_procname); + FuncLoadError := not assigned(OPENSSL_sk_find_ex); + if FuncLoadError then + begin + {$if not defined(OPENSSL_sk_find_ex_allownil)} + OPENSSL_sk_find_ex := @ERR_OPENSSL_sk_find_ex; + {$ifend} + {$if declared(OPENSSL_sk_find_ex_introduced)} + if LibVersion < OPENSSL_sk_find_ex_introduced then + begin + {$if declared(FC_OPENSSL_sk_find_ex)} + OPENSSL_sk_find_ex := @FC_OPENSSL_sk_find_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OPENSSL_sk_find_ex_removed)} + if OPENSSL_sk_find_ex_removed <= LibVersion then + begin + {$if declared(_OPENSSL_sk_find_ex)} + OPENSSL_sk_find_ex := @_OPENSSL_sk_find_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OPENSSL_sk_find_ex_allownil)} + if FuncLoadError then + AFailed.Add('OPENSSL_sk_find_ex'); + {$ifend} + end; + + {introduced 1.1.0} + OPENSSL_sk_push := LoadLibFunction(ADllHandle, OPENSSL_sk_push_procname); + FuncLoadError := not assigned(OPENSSL_sk_push); + if FuncLoadError then + begin + {$if not defined(OPENSSL_sk_push_allownil)} + OPENSSL_sk_push := @ERR_OPENSSL_sk_push; + {$ifend} + {$if declared(OPENSSL_sk_push_introduced)} + if LibVersion < OPENSSL_sk_push_introduced then + begin + {$if declared(FC_OPENSSL_sk_push)} + OPENSSL_sk_push := @FC_OPENSSL_sk_push; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OPENSSL_sk_push_removed)} + if OPENSSL_sk_push_removed <= LibVersion then + begin + {$if declared(_OPENSSL_sk_push)} + OPENSSL_sk_push := @_OPENSSL_sk_push; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OPENSSL_sk_push_allownil)} + if FuncLoadError then + AFailed.Add('OPENSSL_sk_push'); + {$ifend} + end; + + {introduced 1.1.0} + OPENSSL_sk_unshift := LoadLibFunction(ADllHandle, OPENSSL_sk_unshift_procname); + FuncLoadError := not assigned(OPENSSL_sk_unshift); + if FuncLoadError then + begin + {$if not defined(OPENSSL_sk_unshift_allownil)} + OPENSSL_sk_unshift := @ERR_OPENSSL_sk_unshift; + {$ifend} + {$if declared(OPENSSL_sk_unshift_introduced)} + if LibVersion < OPENSSL_sk_unshift_introduced then + begin + {$if declared(FC_OPENSSL_sk_unshift)} + OPENSSL_sk_unshift := @FC_OPENSSL_sk_unshift; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OPENSSL_sk_unshift_removed)} + if OPENSSL_sk_unshift_removed <= LibVersion then + begin + {$if declared(_OPENSSL_sk_unshift)} + OPENSSL_sk_unshift := @_OPENSSL_sk_unshift; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OPENSSL_sk_unshift_allownil)} + if FuncLoadError then + AFailed.Add('OPENSSL_sk_unshift'); + {$ifend} + end; + + {introduced 1.1.0} + OPENSSL_sk_shift := LoadLibFunction(ADllHandle, OPENSSL_sk_shift_procname); + FuncLoadError := not assigned(OPENSSL_sk_shift); + if FuncLoadError then + begin + {$if not defined(OPENSSL_sk_shift_allownil)} + OPENSSL_sk_shift := @ERR_OPENSSL_sk_shift; + {$ifend} + {$if declared(OPENSSL_sk_shift_introduced)} + if LibVersion < OPENSSL_sk_shift_introduced then + begin + {$if declared(FC_OPENSSL_sk_shift)} + OPENSSL_sk_shift := @FC_OPENSSL_sk_shift; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OPENSSL_sk_shift_removed)} + if OPENSSL_sk_shift_removed <= LibVersion then + begin + {$if declared(_OPENSSL_sk_shift)} + OPENSSL_sk_shift := @_OPENSSL_sk_shift; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OPENSSL_sk_shift_allownil)} + if FuncLoadError then + AFailed.Add('OPENSSL_sk_shift'); + {$ifend} + end; + + {introduced 1.1.0} + OPENSSL_sk_pop := LoadLibFunction(ADllHandle, OPENSSL_sk_pop_procname); + FuncLoadError := not assigned(OPENSSL_sk_pop); + if FuncLoadError then + begin + {$if not defined(OPENSSL_sk_pop_allownil)} + OPENSSL_sk_pop := @ERR_OPENSSL_sk_pop; + {$ifend} + {$if declared(OPENSSL_sk_pop_introduced)} + if LibVersion < OPENSSL_sk_pop_introduced then + begin + {$if declared(FC_OPENSSL_sk_pop)} + OPENSSL_sk_pop := @FC_OPENSSL_sk_pop; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OPENSSL_sk_pop_removed)} + if OPENSSL_sk_pop_removed <= LibVersion then + begin + {$if declared(_OPENSSL_sk_pop)} + OPENSSL_sk_pop := @_OPENSSL_sk_pop; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OPENSSL_sk_pop_allownil)} + if FuncLoadError then + AFailed.Add('OPENSSL_sk_pop'); + {$ifend} + end; + + {introduced 1.1.0} + OPENSSL_sk_zero := LoadLibFunction(ADllHandle, OPENSSL_sk_zero_procname); + FuncLoadError := not assigned(OPENSSL_sk_zero); + if FuncLoadError then + begin + {$if not defined(OPENSSL_sk_zero_allownil)} + OPENSSL_sk_zero := @ERR_OPENSSL_sk_zero; + {$ifend} + {$if declared(OPENSSL_sk_zero_introduced)} + if LibVersion < OPENSSL_sk_zero_introduced then + begin + {$if declared(FC_OPENSSL_sk_zero)} + OPENSSL_sk_zero := @FC_OPENSSL_sk_zero; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OPENSSL_sk_zero_removed)} + if OPENSSL_sk_zero_removed <= LibVersion then + begin + {$if declared(_OPENSSL_sk_zero)} + OPENSSL_sk_zero := @_OPENSSL_sk_zero; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OPENSSL_sk_zero_allownil)} + if FuncLoadError then + AFailed.Add('OPENSSL_sk_zero'); + {$ifend} + end; + + {introduced 1.1.0} + OPENSSL_sk_set_cmp_func := LoadLibFunction(ADllHandle, OPENSSL_sk_set_cmp_func_procname); + FuncLoadError := not assigned(OPENSSL_sk_set_cmp_func); + if FuncLoadError then + begin + {$if not defined(OPENSSL_sk_set_cmp_func_allownil)} + OPENSSL_sk_set_cmp_func := @ERR_OPENSSL_sk_set_cmp_func; + {$ifend} + {$if declared(OPENSSL_sk_set_cmp_func_introduced)} + if LibVersion < OPENSSL_sk_set_cmp_func_introduced then + begin + {$if declared(FC_OPENSSL_sk_set_cmp_func)} + OPENSSL_sk_set_cmp_func := @FC_OPENSSL_sk_set_cmp_func; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OPENSSL_sk_set_cmp_func_removed)} + if OPENSSL_sk_set_cmp_func_removed <= LibVersion then + begin + {$if declared(_OPENSSL_sk_set_cmp_func)} + OPENSSL_sk_set_cmp_func := @_OPENSSL_sk_set_cmp_func; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OPENSSL_sk_set_cmp_func_allownil)} + if FuncLoadError then + AFailed.Add('OPENSSL_sk_set_cmp_func'); + {$ifend} + end; + + {introduced 1.1.0} + OPENSSL_sk_dup := LoadLibFunction(ADllHandle, OPENSSL_sk_dup_procname); + FuncLoadError := not assigned(OPENSSL_sk_dup); + if FuncLoadError then + begin + {$if not defined(OPENSSL_sk_dup_allownil)} + OPENSSL_sk_dup := @ERR_OPENSSL_sk_dup; + {$ifend} + {$if declared(OPENSSL_sk_dup_introduced)} + if LibVersion < OPENSSL_sk_dup_introduced then + begin + {$if declared(FC_OPENSSL_sk_dup)} + OPENSSL_sk_dup := @FC_OPENSSL_sk_dup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OPENSSL_sk_dup_removed)} + if OPENSSL_sk_dup_removed <= LibVersion then + begin + {$if declared(_OPENSSL_sk_dup)} + OPENSSL_sk_dup := @_OPENSSL_sk_dup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OPENSSL_sk_dup_allownil)} + if FuncLoadError then + AFailed.Add('OPENSSL_sk_dup'); + {$ifend} + end; + + {introduced 1.1.0} + OPENSSL_sk_sort := LoadLibFunction(ADllHandle, OPENSSL_sk_sort_procname); + FuncLoadError := not assigned(OPENSSL_sk_sort); + if FuncLoadError then + begin + {$if not defined(OPENSSL_sk_sort_allownil)} + OPENSSL_sk_sort := @ERR_OPENSSL_sk_sort; + {$ifend} + {$if declared(OPENSSL_sk_sort_introduced)} + if LibVersion < OPENSSL_sk_sort_introduced then + begin + {$if declared(FC_OPENSSL_sk_sort)} + OPENSSL_sk_sort := @FC_OPENSSL_sk_sort; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OPENSSL_sk_sort_removed)} + if OPENSSL_sk_sort_removed <= LibVersion then + begin + {$if declared(_OPENSSL_sk_sort)} + OPENSSL_sk_sort := @_OPENSSL_sk_sort; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OPENSSL_sk_sort_allownil)} + if FuncLoadError then + AFailed.Add('OPENSSL_sk_sort'); + {$ifend} + end; + + {introduced 1.1.0} + OPENSSL_sk_is_sorted := LoadLibFunction(ADllHandle, OPENSSL_sk_is_sorted_procname); + FuncLoadError := not assigned(OPENSSL_sk_is_sorted); + if FuncLoadError then + begin + {$if not defined(OPENSSL_sk_is_sorted_allownil)} + OPENSSL_sk_is_sorted := @ERR_OPENSSL_sk_is_sorted; + {$ifend} + {$if declared(OPENSSL_sk_is_sorted_introduced)} + if LibVersion < OPENSSL_sk_is_sorted_introduced then + begin + {$if declared(FC_OPENSSL_sk_is_sorted)} + OPENSSL_sk_is_sorted := @FC_OPENSSL_sk_is_sorted; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OPENSSL_sk_is_sorted_removed)} + if OPENSSL_sk_is_sorted_removed <= LibVersion then + begin + {$if declared(_OPENSSL_sk_is_sorted)} + OPENSSL_sk_is_sorted := @_OPENSSL_sk_is_sorted; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OPENSSL_sk_is_sorted_allownil)} + if FuncLoadError then + AFailed.Add('OPENSSL_sk_is_sorted'); + {$ifend} + end; + + {introduced 1.1.0} + sk_num := LoadLibFunction(ADllHandle, sk_num_procname); + FuncLoadError := not assigned(sk_num); + if FuncLoadError then + begin + {$if not defined(sk_num_allownil)} + sk_num := @ERR_sk_num; + {$ifend} + {$if declared(sk_num_introduced)} + if LibVersion < sk_num_introduced then + begin + {$if declared(FC_sk_num)} + sk_num := @FC_sk_num; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(sk_num_removed)} + if sk_num_removed <= LibVersion then + begin + {$if declared(_sk_num)} + sk_num := @_sk_num; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(sk_num_allownil)} + if FuncLoadError then + AFailed.Add('sk_num'); + {$ifend} + end; + + + sk_value := LoadLibFunction(ADllHandle, sk_value_procname); + FuncLoadError := not assigned(sk_value); + if FuncLoadError then + begin + {$if not defined(sk_value_allownil)} + sk_value := @ERR_sk_value; + {$ifend} + {$if declared(sk_value_introduced)} + if LibVersion < sk_value_introduced then + begin + {$if declared(FC_sk_value)} + sk_value := @FC_sk_value; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(sk_value_removed)} + if sk_value_removed <= LibVersion then + begin + {$if declared(_sk_value)} + sk_value := @_sk_value; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(sk_value_allownil)} + if FuncLoadError then + AFailed.Add('sk_value'); + {$ifend} + end; + + + sk_set := LoadLibFunction(ADllHandle, sk_set_procname); + FuncLoadError := not assigned(sk_set); + if FuncLoadError then + begin + {$if not defined(sk_set_allownil)} + sk_set := @ERR_sk_set; + {$ifend} + {$if declared(sk_set_introduced)} + if LibVersion < sk_set_introduced then + begin + {$if declared(FC_sk_set)} + sk_set := @FC_sk_set; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(sk_set_removed)} + if sk_set_removed <= LibVersion then + begin + {$if declared(_sk_set)} + sk_set := @_sk_set; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(sk_set_allownil)} + if FuncLoadError then + AFailed.Add('sk_set'); + {$ifend} + end; + + + sk_new := LoadLibFunction(ADllHandle, sk_new_procname); + FuncLoadError := not assigned(sk_new); + if FuncLoadError then + begin + {$if not defined(sk_new_allownil)} + sk_new := @ERR_sk_new; + {$ifend} + {$if declared(sk_new_introduced)} + if LibVersion < sk_new_introduced then + begin + {$if declared(FC_sk_new)} + sk_new := @FC_sk_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(sk_new_removed)} + if sk_new_removed <= LibVersion then + begin + {$if declared(_sk_new)} + sk_new := @_sk_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(sk_new_allownil)} + if FuncLoadError then + AFailed.Add('sk_new'); + {$ifend} + end; + + + sk_new_null := LoadLibFunction(ADllHandle, sk_new_null_procname); + FuncLoadError := not assigned(sk_new_null); + if FuncLoadError then + begin + {$if not defined(sk_new_null_allownil)} + sk_new_null := @ERR_sk_new_null; + {$ifend} + {$if declared(sk_new_null_introduced)} + if LibVersion < sk_new_null_introduced then + begin + {$if declared(FC_sk_new_null)} + sk_new_null := @FC_sk_new_null; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(sk_new_null_removed)} + if sk_new_null_removed <= LibVersion then + begin + {$if declared(_sk_new_null)} + sk_new_null := @_sk_new_null; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(sk_new_null_allownil)} + if FuncLoadError then + AFailed.Add('sk_new_null'); + {$ifend} + end; + + + sk_new_reserve := LoadLibFunction(ADllHandle, sk_new_reserve_procname); + FuncLoadError := not assigned(sk_new_reserve); + if FuncLoadError then + begin + {$if not defined(sk_new_reserve_allownil)} + sk_new_reserve := @ERR_sk_new_reserve; + {$ifend} + {$if declared(sk_new_reserve_introduced)} + if LibVersion < sk_new_reserve_introduced then + begin + {$if declared(FC_sk_new_reserve)} + sk_new_reserve := @FC_sk_new_reserve; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(sk_new_reserve_removed)} + if sk_new_reserve_removed <= LibVersion then + begin + {$if declared(_sk_new_reserve)} + sk_new_reserve := @_sk_new_reserve; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(sk_new_reserve_allownil)} + if FuncLoadError then + AFailed.Add('sk_new_reserve'); + {$ifend} + end; + + + sk_reserve := LoadLibFunction(ADllHandle, sk_reserve_procname); + FuncLoadError := not assigned(sk_reserve); + if FuncLoadError then + begin + {$if not defined(sk_reserve_allownil)} + sk_reserve := @ERR_sk_reserve; + {$ifend} + {$if declared(sk_reserve_introduced)} + if LibVersion < sk_reserve_introduced then + begin + {$if declared(FC_sk_reserve)} + sk_reserve := @FC_sk_reserve; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(sk_reserve_removed)} + if sk_reserve_removed <= LibVersion then + begin + {$if declared(_sk_reserve)} + sk_reserve := @_sk_reserve; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(sk_reserve_allownil)} + if FuncLoadError then + AFailed.Add('sk_reserve'); + {$ifend} + end; + + + sk_free := LoadLibFunction(ADllHandle, sk_free_procname); + FuncLoadError := not assigned(sk_free); + if FuncLoadError then + begin + {$if not defined(sk_free_allownil)} + sk_free := @ERR_sk_free; + {$ifend} + {$if declared(sk_free_introduced)} + if LibVersion < sk_free_introduced then + begin + {$if declared(FC_sk_free)} + sk_free := @FC_sk_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(sk_free_removed)} + if sk_free_removed <= LibVersion then + begin + {$if declared(_sk_free)} + sk_free := @_sk_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(sk_free_allownil)} + if FuncLoadError then + AFailed.Add('sk_free'); + {$ifend} + end; + + + sk_pop_free := LoadLibFunction(ADllHandle, sk_pop_free_procname); + FuncLoadError := not assigned(sk_pop_free); + if FuncLoadError then + begin + {$if not defined(sk_pop_free_allownil)} + sk_pop_free := @ERR_sk_pop_free; + {$ifend} + {$if declared(sk_pop_free_introduced)} + if LibVersion < sk_pop_free_introduced then + begin + {$if declared(FC_sk_pop_free)} + sk_pop_free := @FC_sk_pop_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(sk_pop_free_removed)} + if sk_pop_free_removed <= LibVersion then + begin + {$if declared(_sk_pop_free)} + sk_pop_free := @_sk_pop_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(sk_pop_free_allownil)} + if FuncLoadError then + AFailed.Add('sk_pop_free'); + {$ifend} + end; + + + sk_deep_copy := LoadLibFunction(ADllHandle, sk_deep_copy_procname); + FuncLoadError := not assigned(sk_deep_copy); + if FuncLoadError then + begin + {$if not defined(sk_deep_copy_allownil)} + sk_deep_copy := @ERR_sk_deep_copy; + {$ifend} + {$if declared(sk_deep_copy_introduced)} + if LibVersion < sk_deep_copy_introduced then + begin + {$if declared(FC_sk_deep_copy)} + sk_deep_copy := @FC_sk_deep_copy; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(sk_deep_copy_removed)} + if sk_deep_copy_removed <= LibVersion then + begin + {$if declared(_sk_deep_copy)} + sk_deep_copy := @_sk_deep_copy; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(sk_deep_copy_allownil)} + if FuncLoadError then + AFailed.Add('sk_deep_copy'); + {$ifend} + end; + + + sk_insert := LoadLibFunction(ADllHandle, sk_insert_procname); + FuncLoadError := not assigned(sk_insert); + if FuncLoadError then + begin + {$if not defined(sk_insert_allownil)} + sk_insert := @ERR_sk_insert; + {$ifend} + {$if declared(sk_insert_introduced)} + if LibVersion < sk_insert_introduced then + begin + {$if declared(FC_sk_insert)} + sk_insert := @FC_sk_insert; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(sk_insert_removed)} + if sk_insert_removed <= LibVersion then + begin + {$if declared(_sk_insert)} + sk_insert := @_sk_insert; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(sk_insert_allownil)} + if FuncLoadError then + AFailed.Add('sk_insert'); + {$ifend} + end; + + + sk_delete := LoadLibFunction(ADllHandle, sk_delete_procname); + FuncLoadError := not assigned(sk_delete); + if FuncLoadError then + begin + {$if not defined(sk_delete_allownil)} + sk_delete := @ERR_sk_delete; + {$ifend} + {$if declared(sk_delete_introduced)} + if LibVersion < sk_delete_introduced then + begin + {$if declared(FC_sk_delete)} + sk_delete := @FC_sk_delete; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(sk_delete_removed)} + if sk_delete_removed <= LibVersion then + begin + {$if declared(_sk_delete)} + sk_delete := @_sk_delete; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(sk_delete_allownil)} + if FuncLoadError then + AFailed.Add('sk_delete'); + {$ifend} + end; + + + sk_delete_ptr := LoadLibFunction(ADllHandle, sk_delete_ptr_procname); + FuncLoadError := not assigned(sk_delete_ptr); + if FuncLoadError then + begin + {$if not defined(sk_delete_ptr_allownil)} + sk_delete_ptr := @ERR_sk_delete_ptr; + {$ifend} + {$if declared(sk_delete_ptr_introduced)} + if LibVersion < sk_delete_ptr_introduced then + begin + {$if declared(FC_sk_delete_ptr)} + sk_delete_ptr := @FC_sk_delete_ptr; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(sk_delete_ptr_removed)} + if sk_delete_ptr_removed <= LibVersion then + begin + {$if declared(_sk_delete_ptr)} + sk_delete_ptr := @_sk_delete_ptr; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(sk_delete_ptr_allownil)} + if FuncLoadError then + AFailed.Add('sk_delete_ptr'); + {$ifend} + end; + + + sk_find := LoadLibFunction(ADllHandle, sk_find_procname); + FuncLoadError := not assigned(sk_find); + if FuncLoadError then + begin + {$if not defined(sk_find_allownil)} + sk_find := @ERR_sk_find; + {$ifend} + {$if declared(sk_find_introduced)} + if LibVersion < sk_find_introduced then + begin + {$if declared(FC_sk_find)} + sk_find := @FC_sk_find; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(sk_find_removed)} + if sk_find_removed <= LibVersion then + begin + {$if declared(_sk_find)} + sk_find := @_sk_find; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(sk_find_allownil)} + if FuncLoadError then + AFailed.Add('sk_find'); + {$ifend} + end; + + + sk_find_ex := LoadLibFunction(ADllHandle, sk_find_ex_procname); + FuncLoadError := not assigned(sk_find_ex); + if FuncLoadError then + begin + {$if not defined(sk_find_ex_allownil)} + sk_find_ex := @ERR_sk_find_ex; + {$ifend} + {$if declared(sk_find_ex_introduced)} + if LibVersion < sk_find_ex_introduced then + begin + {$if declared(FC_sk_find_ex)} + sk_find_ex := @FC_sk_find_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(sk_find_ex_removed)} + if sk_find_ex_removed <= LibVersion then + begin + {$if declared(_sk_find_ex)} + sk_find_ex := @_sk_find_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(sk_find_ex_allownil)} + if FuncLoadError then + AFailed.Add('sk_find_ex'); + {$ifend} + end; + + + sk_push := LoadLibFunction(ADllHandle, sk_push_procname); + FuncLoadError := not assigned(sk_push); + if FuncLoadError then + begin + {$if not defined(sk_push_allownil)} + sk_push := @ERR_sk_push; + {$ifend} + {$if declared(sk_push_introduced)} + if LibVersion < sk_push_introduced then + begin + {$if declared(FC_sk_push)} + sk_push := @FC_sk_push; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(sk_push_removed)} + if sk_push_removed <= LibVersion then + begin + {$if declared(_sk_push)} + sk_push := @_sk_push; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(sk_push_allownil)} + if FuncLoadError then + AFailed.Add('sk_push'); + {$ifend} + end; + + + sk_unshift := LoadLibFunction(ADllHandle, sk_unshift_procname); + FuncLoadError := not assigned(sk_unshift); + if FuncLoadError then + begin + {$if not defined(sk_unshift_allownil)} + sk_unshift := @ERR_sk_unshift; + {$ifend} + {$if declared(sk_unshift_introduced)} + if LibVersion < sk_unshift_introduced then + begin + {$if declared(FC_sk_unshift)} + sk_unshift := @FC_sk_unshift; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(sk_unshift_removed)} + if sk_unshift_removed <= LibVersion then + begin + {$if declared(_sk_unshift)} + sk_unshift := @_sk_unshift; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(sk_unshift_allownil)} + if FuncLoadError then + AFailed.Add('sk_unshift'); + {$ifend} + end; + + + sk_shift := LoadLibFunction(ADllHandle, sk_shift_procname); + FuncLoadError := not assigned(sk_shift); + if FuncLoadError then + begin + {$if not defined(sk_shift_allownil)} + sk_shift := @ERR_sk_shift; + {$ifend} + {$if declared(sk_shift_introduced)} + if LibVersion < sk_shift_introduced then + begin + {$if declared(FC_sk_shift)} + sk_shift := @FC_sk_shift; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(sk_shift_removed)} + if sk_shift_removed <= LibVersion then + begin + {$if declared(_sk_shift)} + sk_shift := @_sk_shift; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(sk_shift_allownil)} + if FuncLoadError then + AFailed.Add('sk_shift'); + {$ifend} + end; + + + sk_pop := LoadLibFunction(ADllHandle, sk_pop_procname); + FuncLoadError := not assigned(sk_pop); + if FuncLoadError then + begin + {$if not defined(sk_pop_allownil)} + sk_pop := @ERR_sk_pop; + {$ifend} + {$if declared(sk_pop_introduced)} + if LibVersion < sk_pop_introduced then + begin + {$if declared(FC_sk_pop)} + sk_pop := @FC_sk_pop; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(sk_pop_removed)} + if sk_pop_removed <= LibVersion then + begin + {$if declared(_sk_pop)} + sk_pop := @_sk_pop; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(sk_pop_allownil)} + if FuncLoadError then + AFailed.Add('sk_pop'); + {$ifend} + end; + + + sk_zero := LoadLibFunction(ADllHandle, sk_zero_procname); + FuncLoadError := not assigned(sk_zero); + if FuncLoadError then + begin + {$if not defined(sk_zero_allownil)} + sk_zero := @ERR_sk_zero; + {$ifend} + {$if declared(sk_zero_introduced)} + if LibVersion < sk_zero_introduced then + begin + {$if declared(FC_sk_zero)} + sk_zero := @FC_sk_zero; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(sk_zero_removed)} + if sk_zero_removed <= LibVersion then + begin + {$if declared(_sk_zero)} + sk_zero := @_sk_zero; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(sk_zero_allownil)} + if FuncLoadError then + AFailed.Add('sk_zero'); + {$ifend} + end; + + + sk_set_cmp_func := LoadLibFunction(ADllHandle, sk_set_cmp_func_procname); + FuncLoadError := not assigned(sk_set_cmp_func); + if FuncLoadError then + begin + {$if not defined(sk_set_cmp_func_allownil)} + sk_set_cmp_func := @ERR_sk_set_cmp_func; + {$ifend} + {$if declared(sk_set_cmp_func_introduced)} + if LibVersion < sk_set_cmp_func_introduced then + begin + {$if declared(FC_sk_set_cmp_func)} + sk_set_cmp_func := @FC_sk_set_cmp_func; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(sk_set_cmp_func_removed)} + if sk_set_cmp_func_removed <= LibVersion then + begin + {$if declared(_sk_set_cmp_func)} + sk_set_cmp_func := @_sk_set_cmp_func; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(sk_set_cmp_func_allownil)} + if FuncLoadError then + AFailed.Add('sk_set_cmp_func'); + {$ifend} + end; + + + sk_dup := LoadLibFunction(ADllHandle, sk_dup_procname); + FuncLoadError := not assigned(sk_dup); + if FuncLoadError then + begin + {$if not defined(sk_dup_allownil)} + sk_dup := @ERR_sk_dup; + {$ifend} + {$if declared(sk_dup_introduced)} + if LibVersion < sk_dup_introduced then + begin + {$if declared(FC_sk_dup)} + sk_dup := @FC_sk_dup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(sk_dup_removed)} + if sk_dup_removed <= LibVersion then + begin + {$if declared(_sk_dup)} + sk_dup := @_sk_dup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(sk_dup_allownil)} + if FuncLoadError then + AFailed.Add('sk_dup'); + {$ifend} + end; + + + sk_sort := LoadLibFunction(ADllHandle, sk_sort_procname); + FuncLoadError := not assigned(sk_sort); + if FuncLoadError then + begin + {$if not defined(sk_sort_allownil)} + sk_sort := @ERR_sk_sort; + {$ifend} + {$if declared(sk_sort_introduced)} + if LibVersion < sk_sort_introduced then + begin + {$if declared(FC_sk_sort)} + sk_sort := @FC_sk_sort; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(sk_sort_removed)} + if sk_sort_removed <= LibVersion then + begin + {$if declared(_sk_sort)} + sk_sort := @_sk_sort; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(sk_sort_allownil)} + if FuncLoadError then + AFailed.Add('sk_sort'); + {$ifend} + end; + + + sk_is_sorted := LoadLibFunction(ADllHandle, sk_is_sorted_procname); + FuncLoadError := not assigned(sk_is_sorted); + if FuncLoadError then + begin + {$if not defined(sk_is_sorted_allownil)} + sk_is_sorted := @ERR_sk_is_sorted; + {$ifend} + {$if declared(sk_is_sorted_introduced)} + if LibVersion < sk_is_sorted_introduced then + begin + {$if declared(FC_sk_is_sorted)} + sk_is_sorted := @FC_sk_is_sorted; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(sk_is_sorted_removed)} + if sk_is_sorted_removed <= LibVersion then + begin + {$if declared(_sk_is_sorted)} + sk_is_sorted := @_sk_is_sorted; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(sk_is_sorted_allownil)} + if FuncLoadError then + AFailed.Add('sk_is_sorted'); + {$ifend} + end; + + +end; + +procedure Unload; +begin + OPENSSL_sk_num := nil; {introduced 1.1.0} + OPENSSL_sk_value := nil; {introduced 1.1.0} + OPENSSL_sk_set := nil; {introduced 1.1.0} + OPENSSL_sk_new := nil; {introduced 1.1.0} + OPENSSL_sk_new_null := nil; {introduced 1.1.0} + OPENSSL_sk_new_reserve := nil; {introduced 1.1.0} + OPENSSL_sk_reserve := nil; {introduced 1.1.0} + OPENSSL_sk_free := nil; {introduced 1.1.0} + OPENSSL_sk_pop_free := nil; {introduced 1.1.0} + OPENSSL_sk_deep_copy := nil; {introduced 1.1.0} + OPENSSL_sk_insert := nil; {introduced 1.1.0} + OPENSSL_sk_delete := nil; {introduced 1.1.0} + OPENSSL_sk_delete_ptr := nil; {introduced 1.1.0} + OPENSSL_sk_find := nil; {introduced 1.1.0} + OPENSSL_sk_find_ex := nil; {introduced 1.1.0} + OPENSSL_sk_push := nil; {introduced 1.1.0} + OPENSSL_sk_unshift := nil; {introduced 1.1.0} + OPENSSL_sk_shift := nil; {introduced 1.1.0} + OPENSSL_sk_pop := nil; {introduced 1.1.0} + OPENSSL_sk_zero := nil; {introduced 1.1.0} + OPENSSL_sk_set_cmp_func := nil; {introduced 1.1.0} + OPENSSL_sk_dup := nil; {introduced 1.1.0} + OPENSSL_sk_sort := nil; {introduced 1.1.0} + OPENSSL_sk_is_sorted := nil; {introduced 1.1.0} + sk_num := nil; {removed 1.1.0} + sk_value := nil; {removed 1.1.0} + sk_set := nil; {removed 1.1.0} + sk_new := nil; {removed 1.1.0} + sk_new_null := nil; {removed 1.1.0} + sk_new_reserve := nil; {removed 1.0.0} + sk_reserve := nil; {removed 1.0.0} + sk_free := nil; {removed 1.1.0} + sk_pop_free := nil; {removed 1.1.0} + sk_deep_copy := nil; {removed 1.1.0} + sk_insert := nil; {removed 1.1.0} + sk_delete := nil; {removed 1.1.0} + sk_delete_ptr := nil; {removed 1.1.0} + sk_find := nil; {removed 1.1.0} + sk_find_ex := nil; {removed 1.1.0} + sk_push := nil; {removed 1.1.0} + sk_unshift := nil; {removed 1.1.0} + sk_shift := nil; {removed 1.1.0} + sk_pop := nil; {removed 1.1.0} + sk_zero := nil; {removed 1.1.0} + sk_set_cmp_func := nil; {removed 1.1.0} + sk_dup := nil; {removed 1.1.0} + sk_sort := nil; {removed 1.1.0} + sk_is_sorted := nil; {removed 1.1.0} +end; +{$ELSE} +function sk_num(_para1:POPENSSL_STACK):longint; +begin + Result := OPENSSL_sk_num(_para1); +end; + +function sk_value(_para1:POPENSSL_STACK; _para2:longint):pointer; +begin + Result := OPENSSL_sk_value(_para1,_para2); +end; + +function sk_set(st:POPENSSL_STACK; i:longint; data:pointer):pointer; +begin + Result := OPENSSL_sk_set(st,i,data); +end; + +function sk_new(cmp:TOPENSSL_sk_compfunc):POPENSSL_STACK; +begin + Result := OPENSSL_sk_new(cmp); +end; + +function sk_new_null:POPENSSL_STACK; +begin + Result := OPENSSL_sk_new_null; +end; + +function sk_new_reserve(c:TOPENSSL_sk_compfunc; n:longint):POPENSSL_STACK; +begin + Result := OPENSSL_sk_new_reserve(c,n); +end; + +function sk_reserve(st:POPENSSL_STACK; n:longint):longint; +begin + Result := OPENSSL_sk_reserve(st,n); +end; + +procedure sk_free(_para1:POPENSSL_STACK); +begin + OPENSSL_sk_free(_para1); +end; + +procedure sk_pop_free(st:POPENSSL_STACK; func:TOPENSSL_sk_freefunc); +begin + OPENSSL_sk_pop_free(st, func); +end; + +function sk_deep_copy(_para1:POPENSSL_STACK; c:TOPENSSL_sk_copyfunc; f:TOPENSSL_sk_freefunc):POPENSSL_STACK; +begin + Result := OPENSSL_sk_deep_copy(_para1,c,f); +end; + +function sk_insert(sk:POPENSSL_STACK; data:pointer; where:longint):longint; +begin + Result := OPENSSL_sk_insert(sk,data,where); +end; + +function sk_delete(st:POPENSSL_STACK; loc:longint):pointer; +begin + Result := OPENSSL_sk_delete(st,loc); +end; + +function sk_delete_ptr(st:POPENSSL_STACK; p:pointer):pointer; +begin + Result := OPENSSL_sk_delete_ptr(st,p); +end; + +function sk_find(st:POPENSSL_STACK; data:pointer):longint; +begin + Result := OPENSSL_sk_find(st,data); +end; + +function sk_find_ex(st:POPENSSL_STACK; data:pointer):longint; +begin + Result := OPENSSL_sk_find_ex(st,data); +end; + +function sk_push(st:POPENSSL_STACK; data:pointer):longint; +begin + Result := OPENSSL_sk_push(st,data); +end; + +function sk_unshift(st:POPENSSL_STACK; data:pointer):longint; +begin + Result := OPENSSL_sk_unshift(st,data); +end; + +function sk_shift(st:POPENSSL_STACK):pointer; +begin + Result := OPENSSL_sk_shift(st); +end; + +function sk_pop(st:POPENSSL_STACK):pointer; +begin + Result := OPENSSL_sk_pop(st); +end; + +procedure sk_zero(st:POPENSSL_STACK); +begin + OPENSSL_sk_zero(st); +end; + +function sk_set_cmp_func(sk:POPENSSL_STACK; cmp:TOPENSSL_sk_compfunc):TOPENSSL_sk_compfunc; +begin + Result := OPENSSL_sk_set_cmp_func(sk,cmp); +end; + +function sk_dup(st:POPENSSL_STACK):POPENSSL_STACK; +begin + Result := OPENSSL_sk_dup(st); +end; + +procedure sk_sort(st:POPENSSL_STACK); +begin + OPENSSL_sk_sort(st); +end; + +function sk_is_sorted(st:POPENSSL_STACK):longint; +begin + Result := OPENSSL_sk_is_sorted(st); +end; + + + +{$ENDIF} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +initialization + Register_SSLLoader(@Load,'LibCrypto'); + Register_SSLUnloader(@Unload); +{$ENDIF} +end. diff --git a/IdOpenSSLHeaders_storeerr.pas b/IdOpenSSLHeaders_storeerr.pas new file mode 100644 index 0000000..96b9067 --- /dev/null +++ b/IdOpenSSLHeaders_storeerr.pas @@ -0,0 +1,209 @@ + (* This unit was generated using the script genOpenSSLHdrs.sh from the source file IdOpenSSLHeaders_storeerr.h2pas + It should not be modified directly. All changes should be made to IdOpenSSLHeaders_storeerr.h2pas + and this file regenerated. IdOpenSSLHeaders_storeerr.h2pas is distributed with the full Indy + Distribution. + *) + +{$i IdCompilerDefines.inc} +{$i IdSSLOpenSSLDefines.inc} +{$IFNDEF USE_OPENSSL} + { error Should not compile if USE_OPENSSL is not defined!!!} +{$ENDIF} +{******************************************************************************} +{ } +{ Indy (Internet Direct) - Internet Protocols Simplified } +{ } +{ https://www.indyproject.org/ } +{ https://gitter.im/IndySockets/Indy } +{ } +{******************************************************************************} +{ } +{ This file is part of the Indy (Internet Direct) project, and is offered } +{ under the dual-licensing agreement described on the Indy website. } +{ (https://www.indyproject.org/license/) } +{ } +{ Copyright: } +{ (c) 1993-2020, Chad Z. Hower and the Indy Pit Crew. All rights reserved. } +{ } +{******************************************************************************} +{ } +{ } +{******************************************************************************} + +unit IdOpenSSLHeaders_storeerr; + +interface + +// Headers for OpenSSL 1.1.1 +// storeerr.h + + +uses + IdCTypes, + IdGlobal, + IdSSLOpenSSLConsts; + +const + (* + * OSSL_STORE function codes. + *) + OSSL_STORE_F_FILE_CTRL = 129; + OSSL_STORE_F_FILE_FIND = 138; + OSSL_STORE_F_FILE_GET_PASS = 118; + OSSL_STORE_F_FILE_LOAD = 119; + OSSL_STORE_F_FILE_LOAD_TRY_DECODE = 124; + OSSL_STORE_F_FILE_NAME_TO_URI = 126; + OSSL_STORE_F_FILE_OPEN = 120; + OSSL_STORE_F_OSSL_STORE_ATTACH_PEM_BIO = 127; + OSSL_STORE_F_OSSL_STORE_EXPECT = 130; + OSSL_STORE_F_OSSL_STORE_FILE_ATTACH_PEM_BIO_INT = 128; + OSSL_STORE_F_OSSL_STORE_FIND = 131; + OSSL_STORE_F_OSSL_STORE_GET0_LOADER_INT = 100; + OSSL_STORE_F_OSSL_STORE_INFO_GET1_CERT = 101; + OSSL_STORE_F_OSSL_STORE_INFO_GET1_CRL = 102; + OSSL_STORE_F_OSSL_STORE_INFO_GET1_NAME = 103; + OSSL_STORE_F_OSSL_STORE_INFO_GET1_NAME_DESCRIPTION = 135; + OSSL_STORE_F_OSSL_STORE_INFO_GET1_PARAMS = 104; + OSSL_STORE_F_OSSL_STORE_INFO_GET1_PKEY = 105; + OSSL_STORE_F_OSSL_STORE_INFO_NEW_CERT = 106; + OSSL_STORE_F_OSSL_STORE_INFO_NEW_CRL = 107; + OSSL_STORE_F_OSSL_STORE_INFO_NEW_EMBEDDED = 123; + OSSL_STORE_F_OSSL_STORE_INFO_NEW_NAME = 109; + OSSL_STORE_F_OSSL_STORE_INFO_NEW_PARAMS = 110; + OSSL_STORE_F_OSSL_STORE_INFO_NEW_PKEY = 111; + OSSL_STORE_F_OSSL_STORE_INFO_SET0_NAME_DESCRIPTION = 134; + OSSL_STORE_F_OSSL_STORE_INIT_ONCE = 112; + OSSL_STORE_F_OSSL_STORE_LOADER_NEW = 113; + OSSL_STORE_F_OSSL_STORE_OPEN = 114; + OSSL_STORE_F_OSSL_STORE_OPEN_INT = 115; + OSSL_STORE_F_OSSL_STORE_REGISTER_LOADER_INT = 117; + OSSL_STORE_F_OSSL_STORE_SEARCH_BY_ALIAS = 132; + OSSL_STORE_F_OSSL_STORE_SEARCH_BY_ISSUER_SERIAL = 133; + OSSL_STORE_F_OSSL_STORE_SEARCH_BY_KEY_FINGERPRINT = 136; + OSSL_STORE_F_OSSL_STORE_SEARCH_BY_NAME = 137; + OSSL_STORE_F_OSSL_STORE_UNREGISTER_LOADER_INT = 116; + OSSL_STORE_F_TRY_DECODE_PARAMS = 121; + OSSL_STORE_F_TRY_DECODE_PKCS12 = 122; + OSSL_STORE_F_TRY_DECODE_PKCS8ENCRYPTED = 125; + + + (* + * OSSL_STORE reason codes. + *) + OSSL_STORE_R_AMBIGUOUS_CONTENT_TYPE = 107; + OSSL_STORE_R_BAD_PASSWORD_READ = 115; + OSSL_STORE_R_ERROR_VERIFYING_PKCS12_MAC = 113; + OSSL_STORE_R_FINGERPRINT_SIZE_DOES_NOT_MATCH_DIGEST = 121; + OSSL_STORE_R_INVALID_SCHEME = 106; + OSSL_STORE_R_IS_NOT_A = 112; + OSSL_STORE_R_LOADER_INCOMPLETE = 116; + OSSL_STORE_R_LOADING_STARTED = 117; + OSSL_STORE_R_NOT_A_CERTIFICATE = 100; + OSSL_STORE_R_NOT_A_CRL = 101; + OSSL_STORE_R_NOT_A_KEY = 102; + OSSL_STORE_R_NOT_A_NAME = 103; + OSSL_STORE_R_NOT_PARAMETERS = 104; + OSSL_STORE_R_PASSPHRASE_CALLBACK_ERROR = 114; + OSSL_STORE_R_PATH_MUST_BE_ABSOLUTE = 108; + OSSL_STORE_R_SEARCH_ONLY_SUPPORTED_FOR_DIRECTORIES = 119; + OSSL_STORE_R_UI_PROCESS_INTERRUPTED_OR_CANCELLED = 109; + OSSL_STORE_R_UNREGISTERED_SCHEME = 105; + OSSL_STORE_R_UNSUPPORTED_CONTENT_TYPE = 110; + OSSL_STORE_R_UNSUPPORTED_OPERATION = 118; + OSSL_STORE_R_UNSUPPORTED_SEARCH_TYPE = 120; + OSSL_STORE_R_URI_AUTHORITY_UNSUPPORTED = 111; + + { The EXTERNALSYM directive is ignored by FPC, however, it is used by Delphi as follows: + + The EXTERNALSYM directive prevents the specified Delphi symbol from appearing in header + files generated for C++. } + + {$EXTERNALSYM ERR_load_OSSL_STORE_strings} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +var + ERR_load_OSSL_STORE_strings: function : TIdC_INT; cdecl = nil; + +{$ELSE} + function ERR_load_OSSL_STORE_strings: TIdC_INT cdecl; external CLibCrypto; + +{$ENDIF} + +implementation + + uses + classes, + IdSSLOpenSSLExceptionHandlers, + IdResourceStringsOpenSSL + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + ,IdSSLOpenSSLLoader + {$ENDIF}; + + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +const + ERR_load_OSSL_STORE_strings_procname = 'ERR_load_OSSL_STORE_strings'; + + +{$WARN NO_RETVAL OFF} +function ERR_ERR_load_OSSL_STORE_strings: TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ERR_load_OSSL_STORE_strings_procname); +end; + + + +{$WARN NO_RETVAL ON} + +procedure Load(const ADllHandle: TIdLibHandle; LibVersion: TIdC_UINT; const AFailed: TStringList); + +var FuncLoadError: boolean; + +begin + ERR_load_OSSL_STORE_strings := LoadLibFunction(ADllHandle, ERR_load_OSSL_STORE_strings_procname); + FuncLoadError := not assigned(ERR_load_OSSL_STORE_strings); + if FuncLoadError then + begin + {$if not defined(ERR_load_OSSL_STORE_strings_allownil)} + ERR_load_OSSL_STORE_strings := @ERR_ERR_load_OSSL_STORE_strings; + {$ifend} + {$if declared(ERR_load_OSSL_STORE_strings_introduced)} + if LibVersion < ERR_load_OSSL_STORE_strings_introduced then + begin + {$if declared(FC_ERR_load_OSSL_STORE_strings)} + ERR_load_OSSL_STORE_strings := @FC_ERR_load_OSSL_STORE_strings; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ERR_load_OSSL_STORE_strings_removed)} + if ERR_load_OSSL_STORE_strings_removed <= LibVersion then + begin + {$if declared(_ERR_load_OSSL_STORE_strings)} + ERR_load_OSSL_STORE_strings := @_ERR_load_OSSL_STORE_strings; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ERR_load_OSSL_STORE_strings_allownil)} + if FuncLoadError then + AFailed.Add('ERR_load_OSSL_STORE_strings'); + {$ifend} + end; + + +end; + +procedure Unload; +begin + ERR_load_OSSL_STORE_strings := nil; +end; +{$ELSE} +{$ENDIF} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +initialization + Register_SSLLoader(@Load,'LibCrypto'); + Register_SSLUnloader(@Unload); +{$ENDIF} +end. diff --git a/IdOpenSSLHeaders_tls1.pas b/IdOpenSSLHeaders_tls1.pas new file mode 100644 index 0000000..c7df37c --- /dev/null +++ b/IdOpenSSLHeaders_tls1.pas @@ -0,0 +1,1981 @@ + (* This unit was generated using the script genOpenSSLHdrs.sh from the source file IdOpenSSLHeaders_tls1.h2pas + It should not be modified directly. All changes should be made to IdOpenSSLHeaders_tls1.h2pas + and this file regenerated. IdOpenSSLHeaders_tls1.h2pas is distributed with the full Indy + Distribution. + *) + +{$i IdCompilerDefines.inc} +{$i IdSSLOpenSSLDefines.inc} +{$IFNDEF USE_OPENSSL} + { error Should not compile if USE_OPENSSL is not defined!!!} +{$ENDIF} +{******************************************************************************} +{ } +{ Indy (Internet Direct) - Internet Protocols Simplified } +{ } +{ https://www.indyproject.org/ } +{ https://gitter.im/IndySockets/Indy } +{ } +{******************************************************************************} +{ } +{ This file is part of the Indy (Internet Direct) project, and is offered } +{ under the dual-licensing agreement described on the Indy website. } +{ (https://www.indyproject.org/license/) } +{ } +{ Copyright: } +{ (c) 1993-2020, Chad Z. Hower and the Indy Pit Crew. All rights reserved. } +{ } +{******************************************************************************} +{ } +{ } +{******************************************************************************} + +unit IdOpenSSLHeaders_tls1; + +interface + +// Headers for OpenSSL 1.1.1 +// tls1.h + + +uses + IdCTypes, + IdGlobal, + IdSSLOpenSSLConsts, + IdOpenSSLHeaders_ossl_typ; + +const + (* Default security level if not overridden at config time *) + OPENSSL_TLS_SECURITY_LEVEL = 1; + + TLS1_VERSION = $0301; + TLS1_1_VERSION = $0302; + TLS1_2_VERSION = $0303; + TLS1_3_VERSION = $0304; + TLS_MAX_VERSION = TLS1_3_VERSION; + + (* Special value for method supporting multiple versions *) + TLS_ANY_VERSION = $10000; + + TLS1_VERSION_MAJOR = $03; + TLS1_VERSION_MINOR = $01; + + TLS1_1_VERSION_MAJOR = $03; + TLS1_1_VERSION_MINOR = $02; + + TLS1_2_VERSION_MAJOR = $03; + TLS1_2_VERSION_MINOR = $03; + + +//# define TLS1_get_version(s) \ +// ((SSL_version(s) >> 8) == TLS1_VERSION_MAJOR ? SSL_version(s) : 0) +// +//# define TLS1_get_client_version(s) \ +// ((SSL_client_version(s) >> 8) == TLS1_VERSION_MAJOR ? SSL_client_version(s) : 0) + + TLS1_AD_DECRYPTION_FAILED = 21; + TLS1_AD_RECORD_OVERFLOW = 22; + TLS1_AD_UNKNOWN_CA = 48; (* fatal *) + TLS1_AD_ACCESS_DENIED = 49; (* fatal *) + TLS1_AD_DECODE_ERROR = 50; (* fatal *) + TLS1_AD_DECRYPT_ERROR = 51; + TLS1_AD_EXPORT_RESTRICTION = 60; (* fatal *) + TLS1_AD_PROTOCOL_VERSION = 70; (* fatal *) + TLS1_AD_INSUFFICIENT_SECURITY = 71; (* fatal *) + TLS1_AD_INTERNAL_ERROR = 80; (* fatal *) + TLS1_AD_INAPPROPRIATE_FALLBACK = 86; (* fatal *) + TLS1_AD_USER_CANCELLED = 90; + TLS1_AD_NO_RENEGOTIATION = 100; + (* TLSv1.3 alerts *) + TLS13_AD_MISSING_EXTENSION = 109; (* fatal *) + TLS13_AD_CERTIFICATE_REQUIRED = 116; (* fatal *) + (* codes 110-114 are from RFC3546 *) + TLS1_AD_UNSUPPORTED_EXTENSION = 110; + TLS1_AD_CERTIFICATE_UNOBTAINABLE = 111; + TLS1_AD_UNRECOGNIZED_NAME = 112; + TLS1_AD_BAD_CERTIFICATE_STATUS_RESPONSE = 113; + TLS1_AD_BAD_CERTIFICATE_HASH_VALUE = 114; + TLS1_AD_UNKNOWN_PSK_IDENTITY = 115; (* fatal *) + TLS1_AD_NO_APPLICATION_PROTOCOL = 120; (* fatal *) + + (* ExtensionType values from RFC3546 / RFC4366 / RFC6066 *) + TLSEXT_TYPE_server_name = 0; + TLSEXT_TYPE_max_fragment_length = 1; + TLSEXT_TYPE_client_certificate_url = 2; + TLSEXT_TYPE_trusted_ca_keys = 3; + TLSEXT_TYPE_truncated_hmac = 4; + TLSEXT_TYPE_status_request = 5; + (* ExtensionType values from RFC4681 *) + TLSEXT_TYPE_user_mapping = 6; + (* ExtensionType values from RFC5878 *) + TLSEXT_TYPE_client_authz = 7; + TLSEXT_TYPE_server_authz = 8; + (* ExtensionType values from RFC6091 *) + TLSEXT_TYPE_cert_type = 9; + + (* ExtensionType values from RFC4492 *) + (* + * Prior to TLSv1.3 the supported_groups extension was known as + * elliptic_curves + *) + TLSEXT_TYPE_supported_groups = 10; + TLSEXT_TYPE_elliptic_curves = TLSEXT_TYPE_supported_groups; + TLSEXT_TYPE_ec_poTIdC_INT_formats = 11; + + (* ExtensionType value from RFC5054 *) + TLSEXT_TYPE_srp = 12; + (* ExtensionType values from RFC5246 *) + TLSEXT_TYPE_signature_algorithms = 13; + + (* ExtensionType value from RFC5764 *) + TLSEXT_TYPE_use_srtp = 14; + + (* ExtensionType value from RFC5620 *) + TLSEXT_TYPE_heartbeat = 15; + + (* ExtensionType value from RFC7301 *) + TLSEXT_TYPE_application_layer_protocol_negotiation = 16; + + (* + * Extension type for Certificate Transparency + * https://tools.ietf.org/html/rfc6962#section-3.3.1 + *) + TLSEXT_TYPE_signed_certificate_timestamp = 18; + + (* + * ExtensionType value for TLS padding extension. + * http://tools.ietf.org/html/draft-agl-tls-padding + *) + TLSEXT_TYPE_padding = 21; + + (* ExtensionType value from RFC7366 *) + TLSEXT_TYPE_encrypt_then_mac = 22; + + (* ExtensionType value from RFC7627 *) + TLSEXT_TYPE_extended_master_secret = 23; + + (* ExtensionType value from RFC4507 *) + TLSEXT_TYPE_session_ticket = 35; + + (* As defined for TLS1.3 *) + TLSEXT_TYPE_psk = 41; + TLSEXT_TYPE_early_data = 42; + TLSEXT_TYPE_supported_versions = 43; + TLSEXT_TYPE_cookie = 44; + TLSEXT_TYPE_psk_kex_modes = 45; + TLSEXT_TYPE_certificate_authorities = 47; + TLSEXT_TYPE_post_handshake_auth = 49; + TLSEXT_TYPE_signature_algorithms_cert = 50; + TLSEXT_TYPE_key_share = 51; + + (* Temporary extension type *) + TLSEXT_TYPE_renegotiate = $ff01; + + (* This is not an IANA defined extension number *) + TLSEXT_TYPE_next_proto_neg = 13172; + + (* NameType value from RFC3546 *) + TLSEXT_NAMETYPE_host_name = 0; + (* status request value from RFC3546 *) + TLSEXT_STATUSTYPE_ocsp = 1; + + (* ECPoTIdC_INTFormat values from RFC4492 *) + TLSEXT_ECPOTIdC_INTFORMAT_first = 0; + TLSEXT_ECPOTIdC_INTFORMAT_uncompressed = 0; + TLSEXT_ECPOTIdC_INTFORMAT_ansiX962_compressed_prime = 1; + TLSEXT_ECPOTIdC_INTFORMAT_ansiX962_compressed_PIdAnsiChar2 = 2; + TLSEXT_ECPOTIdC_INTFORMAT_last = 2; + + (* Signature and hash algorithms from RFC5246 *) + TLSEXT_signature_anonymous = 0; + TLSEXT_signature_rsa = 1; + TLSEXT_signature_dsa = 2; + TLSEXT_signature_ecdsa = 3; + TLSEXT_signature_gostr34102001 = 237; + TLSEXT_signature_gostr34102012_256 = 238; + TLSEXT_signature_gostr34102012_512 = 239; + + (* Total number of different signature algorithms *) + TLSEXT_signature_num = 7; + + TLSEXT_hash_none = 0; + TLSEXT_hash_md5 = 1; + TLSEXT_hash_sha1 = 2; + TLSEXT_hash_sha224 = 3; + TLSEXT_hash_sha256 = 4; + TLSEXT_hash_sha384 = 5; + TLSEXT_hash_sha512 = 6; + TLSEXT_hash_gostr3411 = 237; + TLSEXT_hash_gostr34112012_256 = 238; + TLSEXT_hash_gostr34112012_512 = 239; + + (* Total number of different digest algorithms *) + TLSEXT_hash_num = 10; + + (* Flag set for unrecognised algorithms *) + TLSEXT_nid_unknown = $1000000; + + (* ECC curves *) + TLSEXT_curve_P_256 = 23; + TLSEXT_curve_P_384 = 24; + + (* OpenSSL value to disable maximum fragment length extension *) + TLSEXT_max_fragment_length_DISABLED = 0; + (* Allowed values for max fragment length extension *) + TLSEXT_max_fragment_length_512 = 1; + TLSEXT_max_fragment_length_1024 = 2; + TLSEXT_max_fragment_length_2048 = 3; + TLSEXT_max_fragment_length_4096 = 4; + + TLSEXT_MAXLEN_host_name = 255; + + SSL_TLSEXT_ERR_OK = 0; + SSL_TLSEXT_ERR_ALERT_WARNING = 1; + SSL_TLSEXT_ERR_ALERT_FATAL = 2; + SSL_TLSEXT_ERR_NOACK = 3; + + SSL_DTLSEXT_HB_ENABLED = $01; + SSL_DTLSEXT_HB_DONT_SEND_REQUESTS = $02; + SSL_DTLSEXT_HB_DONT_RECV_REQUESTS = $04; + + (* PSK ciphersuites from 4279 *) + TLS1_CK_PSK_WITH_RC4_128_SHA = $0300008A; + TLS1_CK_PSK_WITH_3DES_EDE_CBC_SHA = $0300008B; + TLS1_CK_PSK_WITH_AES_128_CBC_SHA = $0300008C; + TLS1_CK_PSK_WITH_AES_256_CBC_SHA = $0300008D; + TLS1_CK_DHE_PSK_WITH_RC4_128_SHA = $0300008E; + TLS1_CK_DHE_PSK_WITH_3DES_EDE_CBC_SHA = $0300008F; + TLS1_CK_DHE_PSK_WITH_AES_128_CBC_SHA = $03000090; + TLS1_CK_DHE_PSK_WITH_AES_256_CBC_SHA = $03000091; + TLS1_CK_RSA_PSK_WITH_RC4_128_SHA = $03000092; + TLS1_CK_RSA_PSK_WITH_3DES_EDE_CBC_SHA = $03000093; + TLS1_CK_RSA_PSK_WITH_AES_128_CBC_SHA = $03000094; + TLS1_CK_RSA_PSK_WITH_AES_256_CBC_SHA = $03000095; + + (* PSK ciphersuites from 5487 *) + TLS1_CK_PSK_WITH_AES_128_GCM_SHA256 = $030000A8; + TLS1_CK_PSK_WITH_AES_256_GCM_SHA384 = $030000A9; + TLS1_CK_DHE_PSK_WITH_AES_128_GCM_SHA256 = $030000AA; + TLS1_CK_DHE_PSK_WITH_AES_256_GCM_SHA384 = $030000AB; + TLS1_CK_RSA_PSK_WITH_AES_128_GCM_SHA256 = $030000AC; + TLS1_CK_RSA_PSK_WITH_AES_256_GCM_SHA384 = $030000AD; + TLS1_CK_PSK_WITH_AES_128_CBC_SHA256 = $030000AE; + TLS1_CK_PSK_WITH_AES_256_CBC_SHA384 = $030000AF; + TLS1_CK_PSK_WITH_NULL_SHA256 = $030000B0; + TLS1_CK_PSK_WITH_NULL_SHA384 = $030000B1; + TLS1_CK_DHE_PSK_WITH_AES_128_CBC_SHA256 = $030000B2; + TLS1_CK_DHE_PSK_WITH_AES_256_CBC_SHA384 = $030000B3; + TLS1_CK_DHE_PSK_WITH_NULL_SHA256 = $030000B4; + TLS1_CK_DHE_PSK_WITH_NULL_SHA384 = $030000B5; + TLS1_CK_RSA_PSK_WITH_AES_128_CBC_SHA256 = $030000B6; + TLS1_CK_RSA_PSK_WITH_AES_256_CBC_SHA384 = $030000B7; + TLS1_CK_RSA_PSK_WITH_NULL_SHA256 = $030000B8; + TLS1_CK_RSA_PSK_WITH_NULL_SHA384 = $030000B9; + + (* NULL PSK ciphersuites from RFC4785 *) + TLS1_CK_PSK_WITH_NULL_SHA = $0300002C; + TLS1_CK_DHE_PSK_WITH_NULL_SHA = $0300002D; + TLS1_CK_RSA_PSK_WITH_NULL_SHA = $0300002E; + + (* AES ciphersuites from RFC3268 *) + TLS1_CK_RSA_WITH_AES_128_SHA = $0300002F; + TLS1_CK_DH_DSS_WITH_AES_128_SHA = $03000030; + TLS1_CK_DH_RSA_WITH_AES_128_SHA = $03000031; + TLS1_CK_DHE_DSS_WITH_AES_128_SHA = $03000032; + TLS1_CK_DHE_RSA_WITH_AES_128_SHA = $03000033; + TLS1_CK_ADH_WITH_AES_128_SHA = $03000034; + TLS1_CK_RSA_WITH_AES_256_SHA = $03000035; + TLS1_CK_DH_DSS_WITH_AES_256_SHA = $03000036; + TLS1_CK_DH_RSA_WITH_AES_256_SHA = $03000037; + TLS1_CK_DHE_DSS_WITH_AES_256_SHA = $03000038; + TLS1_CK_DHE_RSA_WITH_AES_256_SHA = $03000039; + TLS1_CK_ADH_WITH_AES_256_SHA = $0300003A; + + (* TLS v1.2 ciphersuites *) + TLS1_CK_RSA_WITH_NULL_SHA256 = $0300003B; + TLS1_CK_RSA_WITH_AES_128_SHA256 = $0300003C; + TLS1_CK_RSA_WITH_AES_256_SHA256 = $0300003D; + TLS1_CK_DH_DSS_WITH_AES_128_SHA256 = $0300003E; + TLS1_CK_DH_RSA_WITH_AES_128_SHA256 = $0300003F; + TLS1_CK_DHE_DSS_WITH_AES_128_SHA256 = $03000040; + + (* Camellia ciphersuites from RFC4132 *) + TLS1_CK_RSA_WITH_CAMELLIA_128_CBC_SHA = $03000041; + TLS1_CK_DH_DSS_WITH_CAMELLIA_128_CBC_SHA = $03000042; + TLS1_CK_DH_RSA_WITH_CAMELLIA_128_CBC_SHA = $03000043; + TLS1_CK_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA = $03000044; + TLS1_CK_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA = $03000045; + TLS1_CK_ADH_WITH_CAMELLIA_128_CBC_SHA = $03000046; + + (* TLS v1.2 ciphersuites *) + TLS1_CK_DHE_RSA_WITH_AES_128_SHA256 = $03000067; + TLS1_CK_DH_DSS_WITH_AES_256_SHA256 = $03000068; + TLS1_CK_DH_RSA_WITH_AES_256_SHA256 = $03000069; + TLS1_CK_DHE_DSS_WITH_AES_256_SHA256 = $0300006A; + TLS1_CK_DHE_RSA_WITH_AES_256_SHA256 = $0300006B; + TLS1_CK_ADH_WITH_AES_128_SHA256 = $0300006C; + TLS1_CK_ADH_WITH_AES_256_SHA256 = $0300006D; + + (* Camellia ciphersuites from RFC4132 *) + TLS1_CK_RSA_WITH_CAMELLIA_256_CBC_SHA = $03000084; + TLS1_CK_DH_DSS_WITH_CAMELLIA_256_CBC_SHA = $03000085; + TLS1_CK_DH_RSA_WITH_CAMELLIA_256_CBC_SHA = $03000086; + TLS1_CK_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA = $03000087; + TLS1_CK_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA = $03000088; + TLS1_CK_ADH_WITH_CAMELLIA_256_CBC_SHA = $03000089; + + (* SEED ciphersuites from RFC4162 *) + TLS1_CK_RSA_WITH_SEED_SHA = $03000096; + TLS1_CK_DH_DSS_WITH_SEED_SHA = $03000097; + TLS1_CK_DH_RSA_WITH_SEED_SHA = $03000098; + TLS1_CK_DHE_DSS_WITH_SEED_SHA = $03000099; + TLS1_CK_DHE_RSA_WITH_SEED_SHA = $0300009A; + TLS1_CK_ADH_WITH_SEED_SHA = $0300009B; + + (* TLS v1.2 GCM ciphersuites from RFC5288 *) + TLS1_CK_RSA_WITH_AES_128_GCM_SHA256 = $0300009C; + TLS1_CK_RSA_WITH_AES_256_GCM_SHA384 = $0300009D; + TLS1_CK_DHE_RSA_WITH_AES_128_GCM_SHA256 = $0300009E; + TLS1_CK_DHE_RSA_WITH_AES_256_GCM_SHA384 = $0300009F; + TLS1_CK_DH_RSA_WITH_AES_128_GCM_SHA256 = $030000A0; + TLS1_CK_DH_RSA_WITH_AES_256_GCM_SHA384 = $030000A1; + TLS1_CK_DHE_DSS_WITH_AES_128_GCM_SHA256 = $030000A2; + TLS1_CK_DHE_DSS_WITH_AES_256_GCM_SHA384 = $030000A3; + TLS1_CK_DH_DSS_WITH_AES_128_GCM_SHA256 = $030000A4; + TLS1_CK_DH_DSS_WITH_AES_256_GCM_SHA384 = $030000A5; + TLS1_CK_ADH_WITH_AES_128_GCM_SHA256 = $030000A6; + TLS1_CK_ADH_WITH_AES_256_GCM_SHA384 = $030000A7; + + (* CCM ciphersuites from RFC6655 *) + TLS1_CK_RSA_WITH_AES_128_CCM = $0300C09C; + TLS1_CK_RSA_WITH_AES_256_CCM = $0300C09D; + TLS1_CK_DHE_RSA_WITH_AES_128_CCM = $0300C09E; + TLS1_CK_DHE_RSA_WITH_AES_256_CCM = $0300C09F; + TLS1_CK_RSA_WITH_AES_128_CCM_8 = $0300C0A0; + TLS1_CK_RSA_WITH_AES_256_CCM_8 = $0300C0A1; + TLS1_CK_DHE_RSA_WITH_AES_128_CCM_8 = $0300C0A2; + TLS1_CK_DHE_RSA_WITH_AES_256_CCM_8 = $0300C0A3; + TLS1_CK_PSK_WITH_AES_128_CCM = $0300C0A4; + TLS1_CK_PSK_WITH_AES_256_CCM = $0300C0A5; + TLS1_CK_DHE_PSK_WITH_AES_128_CCM = $0300C0A6; + TLS1_CK_DHE_PSK_WITH_AES_256_CCM = $0300C0A7; + TLS1_CK_PSK_WITH_AES_128_CCM_8 = $0300C0A8; + TLS1_CK_PSK_WITH_AES_256_CCM_8 = $0300C0A9; + TLS1_CK_DHE_PSK_WITH_AES_128_CCM_8 = $0300C0AA; + TLS1_CK_DHE_PSK_WITH_AES_256_CCM_8 = $0300C0AB; + + (* CCM ciphersuites from RFC7251 *) + TLS1_CK_ECDHE_ECDSA_WITH_AES_128_CCM = $0300C0AC; + TLS1_CK_ECDHE_ECDSA_WITH_AES_256_CCM = $0300C0AD; + TLS1_CK_ECDHE_ECDSA_WITH_AES_128_CCM_8 = $0300C0AE; + TLS1_CK_ECDHE_ECDSA_WITH_AES_256_CCM_8 = $0300C0AF; + + (* TLS 1.2 Camellia SHA-256 ciphersuites from RFC5932 *) + TLS1_CK_RSA_WITH_CAMELLIA_128_CBC_SHA256 = $030000BA; + TLS1_CK_DH_DSS_WITH_CAMELLIA_128_CBC_SHA256 = $030000BB; + TLS1_CK_DH_RSA_WITH_CAMELLIA_128_CBC_SHA256 = $030000BC; + TLS1_CK_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA256 = $030000BD; + TLS1_CK_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 = $030000BE; + TLS1_CK_ADH_WITH_CAMELLIA_128_CBC_SHA256 = $030000BF; + + TLS1_CK_RSA_WITH_CAMELLIA_256_CBC_SHA256 = $030000C0; + TLS1_CK_DH_DSS_WITH_CAMELLIA_256_CBC_SHA256 = $030000C1; + TLS1_CK_DH_RSA_WITH_CAMELLIA_256_CBC_SHA256 = $030000C2; + TLS1_CK_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA256 = $030000C3; + TLS1_CK_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256 = $030000C4; + TLS1_CK_ADH_WITH_CAMELLIA_256_CBC_SHA256 = $030000C5; + + (* ECC ciphersuites from RFC4492 *) + TLS1_CK_ECDH_ECDSA_WITH_NULL_SHA = $0300C001; + TLS1_CK_ECDH_ECDSA_WITH_RC4_128_SHA = $0300C002; + TLS1_CK_ECDH_ECDSA_WITH_DES_192_CBC3_SHA = $0300C003; + TLS1_CK_ECDH_ECDSA_WITH_AES_128_CBC_SHA = $0300C004; + TLS1_CK_ECDH_ECDSA_WITH_AES_256_CBC_SHA = $0300C005; + + TLS1_CK_ECDHE_ECDSA_WITH_NULL_SHA = $0300C006; + TLS1_CK_ECDHE_ECDSA_WITH_RC4_128_SHA = $0300C007; + TLS1_CK_ECDHE_ECDSA_WITH_DES_192_CBC3_SHA = $0300C008; + TLS1_CK_ECDHE_ECDSA_WITH_AES_128_CBC_SHA = $0300C009; + TLS1_CK_ECDHE_ECDSA_WITH_AES_256_CBC_SHA = $0300C00A; + + TLS1_CK_ECDH_RSA_WITH_NULL_SHA = $0300C00B; + TLS1_CK_ECDH_RSA_WITH_RC4_128_SHA = $0300C00C; + TLS1_CK_ECDH_RSA_WITH_DES_192_CBC3_SHA = $0300C00D; + TLS1_CK_ECDH_RSA_WITH_AES_128_CBC_SHA = $0300C00E; + TLS1_CK_ECDH_RSA_WITH_AES_256_CBC_SHA = $0300C00F; + + TLS1_CK_ECDHE_RSA_WITH_NULL_SHA = $0300C010; + TLS1_CK_ECDHE_RSA_WITH_RC4_128_SHA = $0300C011; + TLS1_CK_ECDHE_RSA_WITH_DES_192_CBC3_SHA = $0300C012; + TLS1_CK_ECDHE_RSA_WITH_AES_128_CBC_SHA = $0300C013; + TLS1_CK_ECDHE_RSA_WITH_AES_256_CBC_SHA = $0300C014; + + TLS1_CK_ECDH_anon_WITH_NULL_SHA = $0300C015; + TLS1_CK_ECDH_anon_WITH_RC4_128_SHA = $0300C016; + TLS1_CK_ECDH_anon_WITH_DES_192_CBC3_SHA = $0300C017; + TLS1_CK_ECDH_anon_WITH_AES_128_CBC_SHA = $0300C018; + TLS1_CK_ECDH_anon_WITH_AES_256_CBC_SHA = $0300C019; + + (* SRP ciphersuites from RFC 5054 *) + TLS1_CK_SRP_SHA_WITH_3DES_EDE_CBC_SHA = $0300C01A; + TLS1_CK_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA = $0300C01B; + TLS1_CK_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA = $0300C01C; + TLS1_CK_SRP_SHA_WITH_AES_128_CBC_SHA = $0300C01D; + TLS1_CK_SRP_SHA_RSA_WITH_AES_128_CBC_SHA = $0300C01E; + TLS1_CK_SRP_SHA_DSS_WITH_AES_128_CBC_SHA = $0300C01F; + TLS1_CK_SRP_SHA_WITH_AES_256_CBC_SHA = $0300C020; + TLS1_CK_SRP_SHA_RSA_WITH_AES_256_CBC_SHA = $0300C021; + TLS1_CK_SRP_SHA_DSS_WITH_AES_256_CBC_SHA = $0300C022; + + (* ECDH HMAC based ciphersuites from RFC5289 *) + TLS1_CK_ECDHE_ECDSA_WITH_AES_128_SHA256 = $0300C023; + TLS1_CK_ECDHE_ECDSA_WITH_AES_256_SHA384 = $0300C024; + TLS1_CK_ECDH_ECDSA_WITH_AES_128_SHA256 = $0300C025; + TLS1_CK_ECDH_ECDSA_WITH_AES_256_SHA384 = $0300C026; + TLS1_CK_ECDHE_RSA_WITH_AES_128_SHA256 = $0300C027; + TLS1_CK_ECDHE_RSA_WITH_AES_256_SHA384 = $0300C028; + TLS1_CK_ECDH_RSA_WITH_AES_128_SHA256 = $0300C029; + TLS1_CK_ECDH_RSA_WITH_AES_256_SHA384 = $0300C02A; + + (* ECDH GCM based ciphersuites from RFC5289 *) + TLS1_CK_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 = $0300C02B; + TLS1_CK_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 = $0300C02C; + TLS1_CK_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 = $0300C02D; + TLS1_CK_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 = $0300C02E; + TLS1_CK_ECDHE_RSA_WITH_AES_128_GCM_SHA256 = $0300C02F; + TLS1_CK_ECDHE_RSA_WITH_AES_256_GCM_SHA384 = $0300C030; + TLS1_CK_ECDH_RSA_WITH_AES_128_GCM_SHA256 = $0300C031; + TLS1_CK_ECDH_RSA_WITH_AES_256_GCM_SHA384 = $0300C032; + + (* ECDHE PSK ciphersuites from RFC5489 *) + TLS1_CK_ECDHE_PSK_WITH_RC4_128_SHA = $0300C033; + TLS1_CK_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA = $0300C034; + TLS1_CK_ECDHE_PSK_WITH_AES_128_CBC_SHA = $0300C035; + TLS1_CK_ECDHE_PSK_WITH_AES_256_CBC_SHA = $0300C036; + TLS1_CK_ECDHE_PSK_WITH_AES_128_CBC_SHA256 = $0300C037; + TLS1_CK_ECDHE_PSK_WITH_AES_256_CBC_SHA384 = $0300C038; + TLS1_CK_ECDHE_PSK_WITH_NULL_SHA = $0300C039; + + TLS1_CK_ECDHE_PSK_WITH_NULL_SHA256 = $0300C03A; + TLS1_CK_ECDHE_PSK_WITH_NULL_SHA384 = $0300C03B; + + (* Camellia-CBC ciphersuites from RFC6367 *) + TLS1_CK_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256 = $0300C072; + TLS1_CK_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384 = $0300C073; + TLS1_CK_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256 = $0300C074; + TLS1_CK_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384 = $0300C075; + TLS1_CK_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 = $0300C076; + TLS1_CK_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384 = $0300C077; + TLS1_CK_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256 = $0300C078; + TLS1_CK_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384 = $0300C079; + + TLS1_CK_PSK_WITH_CAMELLIA_128_CBC_SHA256 = $0300C094; + TLS1_CK_PSK_WITH_CAMELLIA_256_CBC_SHA384 = $0300C095; + TLS1_CK_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 = $0300C096; + TLS1_CK_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384 = $0300C097; + TLS1_CK_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256 = $0300C098; + TLS1_CK_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384 = $0300C099; + TLS1_CK_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 = $0300C09A; + TLS1_CK_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384 = $0300C09B; + + (* draft-ietf-tls-chacha20-poly1305-03 *) + TLS1_CK_ECDHE_RSA_WITH_CHACHA20_POLY1305 = $0300CCA8; + TLS1_CK_ECDHE_ECDSA_WITH_CHACHA20_POLY1305 = $0300CCA9; + TLS1_CK_DHE_RSA_WITH_CHACHA20_POLY1305 = $0300CCAA; + TLS1_CK_PSK_WITH_CHACHA20_POLY1305 = $0300CCAB; + TLS1_CK_ECDHE_PSK_WITH_CHACHA20_POLY1305 = $0300CCAC; + TLS1_CK_DHE_PSK_WITH_CHACHA20_POLY1305 = $0300CCAD; + TLS1_CK_RSA_PSK_WITH_CHACHA20_POLY1305 = $0300CCAE; + + (* TLS v1.3 ciphersuites *) + TLS1_3_CK_AES_128_GCM_SHA256 = $03001301; + TLS1_3_CK_AES_256_GCM_SHA384 = $03001302; + TLS1_3_CK_CHACHA20_POLY1305_SHA256 = $03001303; + TLS1_3_CK_AES_128_CCM_SHA256 = $03001304; + TLS1_3_CK_AES_128_CCM_8_SHA256 = $03001305; + + (* Aria ciphersuites from RFC6209 *) + TLS1_CK_RSA_WITH_ARIA_128_GCM_SHA256 = $0300C050; + TLS1_CK_RSA_WITH_ARIA_256_GCM_SHA384 = $0300C051; + TLS1_CK_DHE_RSA_WITH_ARIA_128_GCM_SHA256 = $0300C052; + TLS1_CK_DHE_RSA_WITH_ARIA_256_GCM_SHA384 = $0300C053; + TLS1_CK_DH_RSA_WITH_ARIA_128_GCM_SHA256 = $0300C054; + TLS1_CK_DH_RSA_WITH_ARIA_256_GCM_SHA384 = $0300C055; + TLS1_CK_DHE_DSS_WITH_ARIA_128_GCM_SHA256 = $0300C056; + TLS1_CK_DHE_DSS_WITH_ARIA_256_GCM_SHA384 = $0300C057; + TLS1_CK_DH_DSS_WITH_ARIA_128_GCM_SHA256 = $0300C058; + TLS1_CK_DH_DSS_WITH_ARIA_256_GCM_SHA384 = $0300C059; + TLS1_CK_DH_anon_WITH_ARIA_128_GCM_SHA256 = $0300C05A; + TLS1_CK_DH_anon_WITH_ARIA_256_GCM_SHA384 = $0300C05B; + TLS1_CK_ECDHE_ECDSA_WITH_ARIA_128_GCM_SHA256 = $0300C05C; + TLS1_CK_ECDHE_ECDSA_WITH_ARIA_256_GCM_SHA384 = $0300C05D; + TLS1_CK_ECDH_ECDSA_WITH_ARIA_128_GCM_SHA256 = $0300C05E; + TLS1_CK_ECDH_ECDSA_WITH_ARIA_256_GCM_SHA384 = $0300C05F; + TLS1_CK_ECDHE_RSA_WITH_ARIA_128_GCM_SHA256 = $0300C060; + TLS1_CK_ECDHE_RSA_WITH_ARIA_256_GCM_SHA384 = $0300C061; + TLS1_CK_ECDH_RSA_WITH_ARIA_128_GCM_SHA256 = $0300C062; + TLS1_CK_ECDH_RSA_WITH_ARIA_256_GCM_SHA384 = $0300C063; + TLS1_CK_PSK_WITH_ARIA_128_GCM_SHA256 = $0300C06A; + TLS1_CK_PSK_WITH_ARIA_256_GCM_SHA384 = $0300C06B; + TLS1_CK_DHE_PSK_WITH_ARIA_128_GCM_SHA256 = $0300C06C; + TLS1_CK_DHE_PSK_WITH_ARIA_256_GCM_SHA384 = $0300C06D; + TLS1_CK_RSA_PSK_WITH_ARIA_128_GCM_SHA256 = $0300C06E; + TLS1_CK_RSA_PSK_WITH_ARIA_256_GCM_SHA384 = $0300C06F; + + (* a bundle of RFC standard cipher names, generated from ssl3_ciphers[] *) + TLS1_RFC_RSA_WITH_AES_128_SHA = AnsiString('TLS_RSA_WITH_AES_128_CBC_SHA'); + TLS1_RFC_DHE_DSS_WITH_AES_128_SHA = AnsiString('TLS_DHE_DSS_WITH_AES_128_CBC_SHA'); + TLS1_RFC_DHE_RSA_WITH_AES_128_SHA = AnsiString('TLS_DHE_RSA_WITH_AES_128_CBC_SHA'); + TLS1_RFC_ADH_WITH_AES_128_SHA = AnsiString('TLS_DH_anon_WITH_AES_128_CBC_SHA'); + TLS1_RFC_RSA_WITH_AES_256_SHA = AnsiString('TLS_RSA_WITH_AES_256_CBC_SHA'); + TLS1_RFC_DHE_DSS_WITH_AES_256_SHA = AnsiString('TLS_DHE_DSS_WITH_AES_256_CBC_SHA'); + TLS1_RFC_DHE_RSA_WITH_AES_256_SHA = AnsiString('TLS_DHE_RSA_WITH_AES_256_CBC_SHA'); + TLS1_RFC_ADH_WITH_AES_256_SHA = AnsiString('TLS_DH_anon_WITH_AES_256_CBC_SHA'); + TLS1_RFC_RSA_WITH_NULL_SHA256 = AnsiString('TLS_RSA_WITH_NULL_SHA256'); + TLS1_RFC_RSA_WITH_AES_128_SHA256 = AnsiString('TLS_RSA_WITH_AES_128_CBC_SHA256'); + TLS1_RFC_RSA_WITH_AES_256_SHA256 = AnsiString('TLS_RSA_WITH_AES_256_CBC_SHA256'); + TLS1_RFC_DHE_DSS_WITH_AES_128_SHA256 = AnsiString('TLS_DHE_DSS_WITH_AES_128_CBC_SHA256'); + TLS1_RFC_DHE_RSA_WITH_AES_128_SHA256 = AnsiString('TLS_DHE_RSA_WITH_AES_128_CBC_SHA256'); + TLS1_RFC_DHE_DSS_WITH_AES_256_SHA256 = AnsiString('TLS_DHE_DSS_WITH_AES_256_CBC_SHA256'); + TLS1_RFC_DHE_RSA_WITH_AES_256_SHA256 = AnsiString('TLS_DHE_RSA_WITH_AES_256_CBC_SHA256'); + TLS1_RFC_ADH_WITH_AES_128_SHA256 = AnsiString('TLS_DH_anon_WITH_AES_128_CBC_SHA256'); + TLS1_RFC_ADH_WITH_AES_256_SHA256 = AnsiString('TLS_DH_anon_WITH_AES_256_CBC_SHA256'); + TLS1_RFC_RSA_WITH_AES_128_GCM_SHA256 = AnsiString('TLS_RSA_WITH_AES_128_GCM_SHA256'); + TLS1_RFC_RSA_WITH_AES_256_GCM_SHA384 = AnsiString('TLS_RSA_WITH_AES_256_GCM_SHA384'); + TLS1_RFC_DHE_RSA_WITH_AES_128_GCM_SHA256 = AnsiString('TLS_DHE_RSA_WITH_AES_128_GCM_SHA256'); + TLS1_RFC_DHE_RSA_WITH_AES_256_GCM_SHA384 = AnsiString('TLS_DHE_RSA_WITH_AES_256_GCM_SHA384'); + TLS1_RFC_DHE_DSS_WITH_AES_128_GCM_SHA256 = AnsiString('TLS_DHE_DSS_WITH_AES_128_GCM_SHA256'); + TLS1_RFC_DHE_DSS_WITH_AES_256_GCM_SHA384 = AnsiString('TLS_DHE_DSS_WITH_AES_256_GCM_SHA384'); + TLS1_RFC_ADH_WITH_AES_128_GCM_SHA256 = AnsiString('TLS_DH_anon_WITH_AES_128_GCM_SHA256'); + TLS1_RFC_ADH_WITH_AES_256_GCM_SHA384 = AnsiString('TLS_DH_anon_WITH_AES_256_GCM_SHA384'); + TLS1_RFC_RSA_WITH_AES_128_CCM = AnsiString('TLS_RSA_WITH_AES_128_CCM'); + TLS1_RFC_RSA_WITH_AES_256_CCM = AnsiString('TLS_RSA_WITH_AES_256_CCM'); + TLS1_RFC_DHE_RSA_WITH_AES_128_CCM = AnsiString('TLS_DHE_RSA_WITH_AES_128_CCM'); + TLS1_RFC_DHE_RSA_WITH_AES_256_CCM = AnsiString('TLS_DHE_RSA_WITH_AES_256_CCM'); + TLS1_RFC_RSA_WITH_AES_128_CCM_8 = AnsiString('TLS_RSA_WITH_AES_128_CCM_8'); + TLS1_RFC_RSA_WITH_AES_256_CCM_8 = AnsiString('TLS_RSA_WITH_AES_256_CCM_8'); + TLS1_RFC_DHE_RSA_WITH_AES_128_CCM_8 = AnsiString('TLS_DHE_RSA_WITH_AES_128_CCM_8'); + TLS1_RFC_DHE_RSA_WITH_AES_256_CCM_8 = AnsiString('TLS_DHE_RSA_WITH_AES_256_CCM_8'); + TLS1_RFC_PSK_WITH_AES_128_CCM = AnsiString('TLS_PSK_WITH_AES_128_CCM'); + TLS1_RFC_PSK_WITH_AES_256_CCM = AnsiString('TLS_PSK_WITH_AES_256_CCM'); + TLS1_RFC_DHE_PSK_WITH_AES_128_CCM = AnsiString('TLS_DHE_PSK_WITH_AES_128_CCM'); + TLS1_RFC_DHE_PSK_WITH_AES_256_CCM = AnsiString('TLS_DHE_PSK_WITH_AES_256_CCM'); + TLS1_RFC_PSK_WITH_AES_128_CCM_8 = AnsiString('TLS_PSK_WITH_AES_128_CCM_8'); + TLS1_RFC_PSK_WITH_AES_256_CCM_8 = AnsiString('TLS_PSK_WITH_AES_256_CCM_8'); + TLS1_RFC_DHE_PSK_WITH_AES_128_CCM_8 = AnsiString('TLS_PSK_DHE_WITH_AES_128_CCM_8'); + TLS1_RFC_DHE_PSK_WITH_AES_256_CCM_8 = AnsiString('TLS_PSK_DHE_WITH_AES_256_CCM_8'); + TLS1_RFC_ECDHE_ECDSA_WITH_AES_128_CCM = AnsiString('TLS_ECDHE_ECDSA_WITH_AES_128_CCM'); + TLS1_RFC_ECDHE_ECDSA_WITH_AES_256_CCM = AnsiString('TLS_ECDHE_ECDSA_WITH_AES_256_CCM'); + TLS1_RFC_ECDHE_ECDSA_WITH_AES_128_CCM_8 = AnsiString('TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8'); + TLS1_RFC_ECDHE_ECDSA_WITH_AES_256_CCM_8 = AnsiString('TLS_ECDHE_ECDSA_WITH_AES_256_CCM_8'); + TLS1_3_RFC_AES_128_GCM_SHA256 = AnsiString('TLS_AES_128_GCM_SHA256'); + TLS1_3_RFC_AES_256_GCM_SHA384 = AnsiString('TLS_AES_256_GCM_SHA384'); + TLS1_3_RFC_CHACHA20_POLY1305_SHA256 = AnsiString('TLS_CHACHA20_POLY1305_SHA256'); + TLS1_3_RFC_AES_128_CCM_SHA256 = AnsiString('TLS_AES_128_CCM_SHA256'); + TLS1_3_RFC_AES_128_CCM_8_SHA256 = AnsiString('TLS_AES_128_CCM_8_SHA256'); + TLS1_RFC_ECDHE_ECDSA_WITH_NULL_SHA = AnsiString('TLS_ECDHE_ECDSA_WITH_NULL_SHA'); + TLS1_RFC_ECDHE_ECDSA_WITH_DES_192_CBC3_SHA = AnsiString('TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA'); + TLS1_RFC_ECDHE_ECDSA_WITH_AES_128_CBC_SHA = AnsiString('TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA'); + TLS1_RFC_ECDHE_ECDSA_WITH_AES_256_CBC_SHA = AnsiString('TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA'); + TLS1_RFC_ECDHE_RSA_WITH_NULL_SHA = AnsiString('TLS_ECDHE_RSA_WITH_NULL_SHA'); + TLS1_RFC_ECDHE_RSA_WITH_DES_192_CBC3_SHA = AnsiString('TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA'); + TLS1_RFC_ECDHE_RSA_WITH_AES_128_CBC_SHA = AnsiString('TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA'); + TLS1_RFC_ECDHE_RSA_WITH_AES_256_CBC_SHA = AnsiString('TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA'); + TLS1_RFC_ECDH_anon_WITH_NULL_SHA = AnsiString('TLS_ECDH_anon_WITH_NULL_SHA'); + TLS1_RFC_ECDH_anon_WITH_DES_192_CBC3_SHA = AnsiString('TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA'); + TLS1_RFC_ECDH_anon_WITH_AES_128_CBC_SHA = AnsiString('TLS_ECDH_anon_WITH_AES_128_CBC_SHA'); + TLS1_RFC_ECDH_anon_WITH_AES_256_CBC_SHA = AnsiString('TLS_ECDH_anon_WITH_AES_256_CBC_SHA'); + TLS1_RFC_ECDHE_ECDSA_WITH_AES_128_SHA256 = AnsiString('TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256'); + TLS1_RFC_ECDHE_ECDSA_WITH_AES_256_SHA384 = AnsiString('TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384'); + TLS1_RFC_ECDHE_RSA_WITH_AES_128_SHA256 = AnsiString('TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256'); + TLS1_RFC_ECDHE_RSA_WITH_AES_256_SHA384 = AnsiString('TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384'); + TLS1_RFC_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 = AnsiString('TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256'); + TLS1_RFC_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 = AnsiString('TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384'); + TLS1_RFC_ECDHE_RSA_WITH_AES_128_GCM_SHA256 = AnsiString('TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256'); + TLS1_RFC_ECDHE_RSA_WITH_AES_256_GCM_SHA384 = AnsiString('TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384'); + TLS1_RFC_PSK_WITH_NULL_SHA = AnsiString('TLS_PSK_WITH_NULL_SHA'); + TLS1_RFC_DHE_PSK_WITH_NULL_SHA = AnsiString('TLS_DHE_PSK_WITH_NULL_SHA'); + TLS1_RFC_RSA_PSK_WITH_NULL_SHA = AnsiString('TLS_RSA_PSK_WITH_NULL_SHA'); + TLS1_RFC_PSK_WITH_3DES_EDE_CBC_SHA = AnsiString('TLS_PSK_WITH_3DES_EDE_CBC_SHA'); + TLS1_RFC_PSK_WITH_AES_128_CBC_SHA = AnsiString('TLS_PSK_WITH_AES_128_CBC_SHA'); + TLS1_RFC_PSK_WITH_AES_256_CBC_SHA = AnsiString('TLS_PSK_WITH_AES_256_CBC_SHA'); + TLS1_RFC_DHE_PSK_WITH_3DES_EDE_CBC_SHA = AnsiString('TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA'); + TLS1_RFC_DHE_PSK_WITH_AES_128_CBC_SHA = AnsiString('TLS_DHE_PSK_WITH_AES_128_CBC_SHA'); + TLS1_RFC_DHE_PSK_WITH_AES_256_CBC_SHA = AnsiString('TLS_DHE_PSK_WITH_AES_256_CBC_SHA'); + TLS1_RFC_RSA_PSK_WITH_3DES_EDE_CBC_SHA = AnsiString('TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA'); + TLS1_RFC_RSA_PSK_WITH_AES_128_CBC_SHA = AnsiString('TLS_RSA_PSK_WITH_AES_128_CBC_SHA'); + TLS1_RFC_RSA_PSK_WITH_AES_256_CBC_SHA = AnsiString('TLS_RSA_PSK_WITH_AES_256_CBC_SHA'); + TLS1_RFC_PSK_WITH_AES_128_GCM_SHA256 = AnsiString('TLS_PSK_WITH_AES_128_GCM_SHA256'); + TLS1_RFC_PSK_WITH_AES_256_GCM_SHA384 = AnsiString('TLS_PSK_WITH_AES_256_GCM_SHA384'); + TLS1_RFC_DHE_PSK_WITH_AES_128_GCM_SHA256 = AnsiString('TLS_DHE_PSK_WITH_AES_128_GCM_SHA256'); + TLS1_RFC_DHE_PSK_WITH_AES_256_GCM_SHA384 = AnsiString('TLS_DHE_PSK_WITH_AES_256_GCM_SHA384'); + TLS1_RFC_RSA_PSK_WITH_AES_128_GCM_SHA256 = AnsiString('TLS_RSA_PSK_WITH_AES_128_GCM_SHA256'); + TLS1_RFC_RSA_PSK_WITH_AES_256_GCM_SHA384 = AnsiString('TLS_RSA_PSK_WITH_AES_256_GCM_SHA384'); + TLS1_RFC_PSK_WITH_AES_128_CBC_SHA256 = AnsiString('TLS_PSK_WITH_AES_128_CBC_SHA256'); + TLS1_RFC_PSK_WITH_AES_256_CBC_SHA384 = AnsiString('TLS_PSK_WITH_AES_256_CBC_SHA384'); + TLS1_RFC_PSK_WITH_NULL_SHA256 = AnsiString('TLS_PSK_WITH_NULL_SHA256'); + TLS1_RFC_PSK_WITH_NULL_SHA384 = AnsiString('TLS_PSK_WITH_NULL_SHA384'); + TLS1_RFC_DHE_PSK_WITH_AES_128_CBC_SHA256 = AnsiString('TLS_DHE_PSK_WITH_AES_128_CBC_SHA256'); + TLS1_RFC_DHE_PSK_WITH_AES_256_CBC_SHA384 = AnsiString('TLS_DHE_PSK_WITH_AES_256_CBC_SHA384'); + TLS1_RFC_DHE_PSK_WITH_NULL_SHA256 = AnsiString('TLS_DHE_PSK_WITH_NULL_SHA256'); + TLS1_RFC_DHE_PSK_WITH_NULL_SHA384 = AnsiString('TLS_DHE_PSK_WITH_NULL_SHA384'); + TLS1_RFC_RSA_PSK_WITH_AES_128_CBC_SHA256 = AnsiString('TLS_RSA_PSK_WITH_AES_128_CBC_SHA256'); + TLS1_RFC_RSA_PSK_WITH_AES_256_CBC_SHA384 = AnsiString('TLS_RSA_PSK_WITH_AES_256_CBC_SHA384'); + TLS1_RFC_RSA_PSK_WITH_NULL_SHA256 = AnsiString('TLS_RSA_PSK_WITH_NULL_SHA256'); + TLS1_RFC_RSA_PSK_WITH_NULL_SHA384 = AnsiString('TLS_RSA_PSK_WITH_NULL_SHA384'); + TLS1_RFC_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA = AnsiString('TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA'); + TLS1_RFC_ECDHE_PSK_WITH_AES_128_CBC_SHA = AnsiString('TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA'); + TLS1_RFC_ECDHE_PSK_WITH_AES_256_CBC_SHA = AnsiString('TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA'); + TLS1_RFC_ECDHE_PSK_WITH_AES_128_CBC_SHA256 = AnsiString('TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256'); + TLS1_RFC_ECDHE_PSK_WITH_AES_256_CBC_SHA384 = AnsiString('TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384'); + TLS1_RFC_ECDHE_PSK_WITH_NULL_SHA = AnsiString('TLS_ECDHE_PSK_WITH_NULL_SHA'); + TLS1_RFC_ECDHE_PSK_WITH_NULL_SHA256 = AnsiString('TLS_ECDHE_PSK_WITH_NULL_SHA256'); + TLS1_RFC_ECDHE_PSK_WITH_NULL_SHA384 = AnsiString('TLS_ECDHE_PSK_WITH_NULL_SHA384'); + TLS1_RFC_SRP_SHA_WITH_3DES_EDE_CBC_SHA = AnsiString('TLS_SRP_SHA_WITH_3DES_EDE_CBC_SHA'); + TLS1_RFC_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA = AnsiString('TLS_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA'); + TLS1_RFC_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA = AnsiString('TLS_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA'); + TLS1_RFC_SRP_SHA_WITH_AES_128_CBC_SHA = AnsiString('TLS_SRP_SHA_WITH_AES_128_CBC_SHA'); + TLS1_RFC_SRP_SHA_RSA_WITH_AES_128_CBC_SHA = AnsiString('TLS_SRP_SHA_RSA_WITH_AES_128_CBC_SHA'); + TLS1_RFC_SRP_SHA_DSS_WITH_AES_128_CBC_SHA = AnsiString('TLS_SRP_SHA_DSS_WITH_AES_128_CBC_SHA'); + TLS1_RFC_SRP_SHA_WITH_AES_256_CBC_SHA = AnsiString('TLS_SRP_SHA_WITH_AES_256_CBC_SHA'); + TLS1_RFC_SRP_SHA_RSA_WITH_AES_256_CBC_SHA = AnsiString('TLS_SRP_SHA_RSA_WITH_AES_256_CBC_SHA'); + TLS1_RFC_SRP_SHA_DSS_WITH_AES_256_CBC_SHA = AnsiString('TLS_SRP_SHA_DSS_WITH_AES_256_CBC_SHA'); + TLS1_RFC_DHE_RSA_WITH_CHACHA20_POLY1305 = AnsiString('TLS_DHE_RSA_WITH_CHACHA20_POLY1305_SHA256'); + TLS1_RFC_ECDHE_RSA_WITH_CHACHA20_POLY1305 = AnsiString('TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256'); + TLS1_RFC_ECDHE_ECDSA_WITH_CHACHA20_POLY1305 = AnsiString('TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256'); + TLS1_RFC_PSK_WITH_CHACHA20_POLY1305 = AnsiString('TLS_PSK_WITH_CHACHA20_POLY1305_SHA256'); + TLS1_RFC_ECDHE_PSK_WITH_CHACHA20_POLY1305 = AnsiString('TLS_ECDHE_PSK_WITH_CHACHA20_POLY1305_SHA256'); + TLS1_RFC_DHE_PSK_WITH_CHACHA20_POLY1305 = AnsiString('TLS_DHE_PSK_WITH_CHACHA20_POLY1305_SHA256'); + TLS1_RFC_RSA_PSK_WITH_CHACHA20_POLY1305 = AnsiString('TLS_RSA_PSK_WITH_CHACHA20_POLY1305_SHA256'); + TLS1_RFC_RSA_WITH_CAMELLIA_128_CBC_SHA256 = AnsiString('TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256'); + TLS1_RFC_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA256 = AnsiString('TLS_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA256'); + TLS1_RFC_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 = AnsiString('TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256'); + TLS1_RFC_ADH_WITH_CAMELLIA_128_CBC_SHA256 = AnsiString('TLS_DH_anon_WITH_CAMELLIA_128_CBC_SHA256'); + TLS1_RFC_RSA_WITH_CAMELLIA_256_CBC_SHA256 = AnsiString('TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256'); + TLS1_RFC_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA256 = AnsiString('TLS_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA256'); + TLS1_RFC_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256 = AnsiString('TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256'); + TLS1_RFC_ADH_WITH_CAMELLIA_256_CBC_SHA256 = AnsiString('TLS_DH_anon_WITH_CAMELLIA_256_CBC_SHA256'); + TLS1_RFC_RSA_WITH_CAMELLIA_256_CBC_SHA = AnsiString('TLS_RSA_WITH_CAMELLIA_256_CBC_SHA'); + TLS1_RFC_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA = AnsiString('TLS_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA'); + TLS1_RFC_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA = AnsiString('TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA'); + TLS1_RFC_ADH_WITH_CAMELLIA_256_CBC_SHA = AnsiString('TLS_DH_anon_WITH_CAMELLIA_256_CBC_SHA'); + TLS1_RFC_RSA_WITH_CAMELLIA_128_CBC_SHA = AnsiString('TLS_RSA_WITH_CAMELLIA_128_CBC_SHA'); + TLS1_RFC_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA = AnsiString('TLS_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA'); + TLS1_RFC_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA = AnsiString('TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA'); + TLS1_RFC_ADH_WITH_CAMELLIA_128_CBC_SHA = AnsiString('TLS_DH_anon_WITH_CAMELLIA_128_CBC_SHA'); + TLS1_RFC_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256 = AnsiString('TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256'); + TLS1_RFC_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384 = AnsiString('TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384'); + TLS1_RFC_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 = AnsiString('TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256'); + TLS1_RFC_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384 = AnsiString('TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384'); + TLS1_RFC_PSK_WITH_CAMELLIA_128_CBC_SHA256 = AnsiString('TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256'); + TLS1_RFC_PSK_WITH_CAMELLIA_256_CBC_SHA384 = AnsiString('TLS_PSK_WITH_CAMELLIA_256_CBC_SHA384'); + TLS1_RFC_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 = AnsiString('TLS_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256'); + TLS1_RFC_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384 = AnsiString('TLS_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384'); + TLS1_RFC_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256 = AnsiString('TLS_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256'); + TLS1_RFC_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384 = AnsiString('TLS_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384'); + TLS1_RFC_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 = AnsiString('TLS_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256'); + TLS1_RFC_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384 = AnsiString('TLS_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384'); + TLS1_RFC_RSA_WITH_SEED_SHA = AnsiString('TLS_RSA_WITH_SEED_CBC_SHA'); + TLS1_RFC_DHE_DSS_WITH_SEED_SHA = AnsiString('TLS_DHE_DSS_WITH_SEED_CBC_SHA'); + TLS1_RFC_DHE_RSA_WITH_SEED_SHA = AnsiString('TLS_DHE_RSA_WITH_SEED_CBC_SHA'); + TLS1_RFC_ADH_WITH_SEED_SHA = AnsiString('TLS_DH_anon_WITH_SEED_CBC_SHA'); + TLS1_RFC_ECDHE_PSK_WITH_RC4_128_SHA = AnsiString('TLS_ECDHE_PSK_WITH_RC4_128_SHA'); + TLS1_RFC_ECDH_anon_WITH_RC4_128_SHA = AnsiString('TLS_ECDH_anon_WITH_RC4_128_SHA'); + TLS1_RFC_ECDHE_ECDSA_WITH_RC4_128_SHA = AnsiString('TLS_ECDHE_ECDSA_WITH_RC4_128_SHA'); + TLS1_RFC_ECDHE_RSA_WITH_RC4_128_SHA = AnsiString('TLS_ECDHE_RSA_WITH_RC4_128_SHA'); + TLS1_RFC_PSK_WITH_RC4_128_SHA = AnsiString('TLS_PSK_WITH_RC4_128_SHA'); + TLS1_RFC_RSA_PSK_WITH_RC4_128_SHA = AnsiString('TLS_RSA_PSK_WITH_RC4_128_SHA'); + TLS1_RFC_DHE_PSK_WITH_RC4_128_SHA = AnsiString('TLS_DHE_PSK_WITH_RC4_128_SHA'); + TLS1_RFC_RSA_WITH_ARIA_128_GCM_SHA256 = AnsiString('TLS_RSA_WITH_ARIA_128_GCM_SHA256'); + TLS1_RFC_RSA_WITH_ARIA_256_GCM_SHA384 = AnsiString('TLS_RSA_WITH_ARIA_256_GCM_SHA384'); + TLS1_RFC_DHE_RSA_WITH_ARIA_128_GCM_SHA256 = AnsiString('TLS_DHE_RSA_WITH_ARIA_128_GCM_SHA256'); + TLS1_RFC_DHE_RSA_WITH_ARIA_256_GCM_SHA384 = AnsiString('TLS_DHE_RSA_WITH_ARIA_256_GCM_SHA384'); + TLS1_RFC_DH_RSA_WITH_ARIA_128_GCM_SHA256 = AnsiString('TLS_DH_RSA_WITH_ARIA_128_GCM_SHA256'); + TLS1_RFC_DH_RSA_WITH_ARIA_256_GCM_SHA384 = AnsiString('TLS_DH_RSA_WITH_ARIA_256_GCM_SHA384'); + TLS1_RFC_DHE_DSS_WITH_ARIA_128_GCM_SHA256 = AnsiString('TLS_DHE_DSS_WITH_ARIA_128_GCM_SHA256'); + TLS1_RFC_DHE_DSS_WITH_ARIA_256_GCM_SHA384 = AnsiString('TLS_DHE_DSS_WITH_ARIA_256_GCM_SHA384'); + TLS1_RFC_DH_DSS_WITH_ARIA_128_GCM_SHA256 = AnsiString('TLS_DH_DSS_WITH_ARIA_128_GCM_SHA256'); + TLS1_RFC_DH_DSS_WITH_ARIA_256_GCM_SHA384 = AnsiString('TLS_DH_DSS_WITH_ARIA_256_GCM_SHA384'); + TLS1_RFC_DH_anon_WITH_ARIA_128_GCM_SHA256 = AnsiString('TLS_DH_anon_WITH_ARIA_128_GCM_SHA256'); + TLS1_RFC_DH_anon_WITH_ARIA_256_GCM_SHA384 = AnsiString('TLS_DH_anon_WITH_ARIA_256_GCM_SHA384'); + TLS1_RFC_ECDHE_ECDSA_WITH_ARIA_128_GCM_SHA256 = AnsiString('TLS_ECDHE_ECDSA_WITH_ARIA_128_GCM_SHA256'); + TLS1_RFC_ECDHE_ECDSA_WITH_ARIA_256_GCM_SHA384 = AnsiString('TLS_ECDHE_ECDSA_WITH_ARIA_256_GCM_SHA384'); + TLS1_RFC_ECDH_ECDSA_WITH_ARIA_128_GCM_SHA256 = AnsiString('TLS_ECDH_ECDSA_WITH_ARIA_128_GCM_SHA256'); + TLS1_RFC_ECDH_ECDSA_WITH_ARIA_256_GCM_SHA384 = AnsiString('TLS_ECDH_ECDSA_WITH_ARIA_256_GCM_SHA384'); + TLS1_RFC_ECDHE_RSA_WITH_ARIA_128_GCM_SHA256 = AnsiString('TLS_ECDHE_RSA_WITH_ARIA_128_GCM_SHA256'); + TLS1_RFC_ECDHE_RSA_WITH_ARIA_256_GCM_SHA384 = AnsiString('TLS_ECDHE_RSA_WITH_ARIA_256_GCM_SHA384'); + TLS1_RFC_ECDH_RSA_WITH_ARIA_128_GCM_SHA256 = AnsiString('TLS_ECDH_RSA_WITH_ARIA_128_GCM_SHA256'); + TLS1_RFC_ECDH_RSA_WITH_ARIA_256_GCM_SHA384 = AnsiString('TLS_ECDH_RSA_WITH_ARIA_256_GCM_SHA384'); + TLS1_RFC_PSK_WITH_ARIA_128_GCM_SHA256 = AnsiString('TLS_PSK_WITH_ARIA_128_GCM_SHA256'); + TLS1_RFC_PSK_WITH_ARIA_256_GCM_SHA384 = AnsiString('TLS_PSK_WITH_ARIA_256_GCM_SHA384'); + TLS1_RFC_DHE_PSK_WITH_ARIA_128_GCM_SHA256 = AnsiString('TLS_DHE_PSK_WITH_ARIA_128_GCM_SHA256'); + TLS1_RFC_DHE_PSK_WITH_ARIA_256_GCM_SHA384 = AnsiString('TLS_DHE_PSK_WITH_ARIA_256_GCM_SHA384'); + TLS1_RFC_RSA_PSK_WITH_ARIA_128_GCM_SHA256 = AnsiString('TLS_RSA_PSK_WITH_ARIA_128_GCM_SHA256'); + TLS1_RFC_RSA_PSK_WITH_ARIA_256_GCM_SHA384 = AnsiString('TLS_RSA_PSK_WITH_ARIA_256_GCM_SHA384'); + + (* + * XXX Backward compatibility alert: Older versions of OpenSSL gave some DHE + * ciphers names with "EDH" instead of "DHE". Going forward, we should be + * using DHE everywhere, though we may indefinitely maTIdC_INTain aliases for + * users or configurations that used "EDH" + *) + TLS1_TXT_DHE_DSS_WITH_RC4_128_SHA = AnsiString('DHE-DSS-RC4-SHA'); + + TLS1_TXT_PSK_WITH_NULL_SHA = AnsiString('PSK-NULL-SHA'); + TLS1_TXT_DHE_PSK_WITH_NULL_SHA = AnsiString('DHE-PSK-NULL-SHA'); + TLS1_TXT_RSA_PSK_WITH_NULL_SHA = AnsiString('RSA-PSK-NULL-SHA'); + + (* AES ciphersuites from RFC3268 *) + TLS1_TXT_RSA_WITH_AES_128_SHA = AnsiString('AES128-SHA'); + TLS1_TXT_DH_DSS_WITH_AES_128_SHA = AnsiString('DH-DSS-AES128-SHA'); + TLS1_TXT_DH_RSA_WITH_AES_128_SHA = AnsiString('DH-RSA-AES128-SHA'); + TLS1_TXT_DHE_DSS_WITH_AES_128_SHA = AnsiString('DHE-DSS-AES128-SHA'); + TLS1_TXT_DHE_RSA_WITH_AES_128_SHA = AnsiString('DHE-RSA-AES128-SHA'); + TLS1_TXT_ADH_WITH_AES_128_SHA = AnsiString('ADH-AES128-SHA'); + + TLS1_TXT_RSA_WITH_AES_256_SHA = AnsiString('AES256-SHA'); + TLS1_TXT_DH_DSS_WITH_AES_256_SHA = AnsiString('DH-DSS-AES256-SHA'); + TLS1_TXT_DH_RSA_WITH_AES_256_SHA = AnsiString('DH-RSA-AES256-SHA'); + TLS1_TXT_DHE_DSS_WITH_AES_256_SHA = AnsiString('DHE-DSS-AES256-SHA'); + TLS1_TXT_DHE_RSA_WITH_AES_256_SHA = AnsiString('DHE-RSA-AES256-SHA'); + TLS1_TXT_ADH_WITH_AES_256_SHA = AnsiString('ADH-AES256-SHA'); + + (* ECC ciphersuites from RFC4492 *) + TLS1_TXT_ECDH_ECDSA_WITH_NULL_SHA = AnsiString('ECDH-ECDSA-NULL-SHA'); + TLS1_TXT_ECDH_ECDSA_WITH_RC4_128_SHA = AnsiString('ECDH-ECDSA-RC4-SHA'); + TLS1_TXT_ECDH_ECDSA_WITH_DES_192_CBC3_SHA = AnsiString('ECDH-ECDSA-DES-CBC3-SHA'); + TLS1_TXT_ECDH_ECDSA_WITH_AES_128_CBC_SHA = AnsiString('ECDH-ECDSA-AES128-SHA'); + TLS1_TXT_ECDH_ECDSA_WITH_AES_256_CBC_SHA = AnsiString('ECDH-ECDSA-AES256-SHA'); + + TLS1_TXT_ECDHE_ECDSA_WITH_NULL_SHA = AnsiString('ECDHE-ECDSA-NULL-SHA'); + TLS1_TXT_ECDHE_ECDSA_WITH_RC4_128_SHA = AnsiString('ECDHE-ECDSA-RC4-SHA'); + TLS1_TXT_ECDHE_ECDSA_WITH_DES_192_CBC3_SHA = AnsiString('ECDHE-ECDSA-DES-CBC3-SHA'); + TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_CBC_SHA = AnsiString('ECDHE-ECDSA-AES128-SHA'); + TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_CBC_SHA = AnsiString('ECDHE-ECDSA-AES256-SHA'); + + TLS1_TXT_ECDH_RSA_WITH_NULL_SHA = AnsiString('ECDH-RSA-NULL-SHA'); + TLS1_TXT_ECDH_RSA_WITH_RC4_128_SHA = AnsiString('ECDH-RSA-RC4-SHA'); + TLS1_TXT_ECDH_RSA_WITH_DES_192_CBC3_SHA = AnsiString('ECDH-RSA-DES-CBC3-SHA'); + TLS1_TXT_ECDH_RSA_WITH_AES_128_CBC_SHA = AnsiString('ECDH-RSA-AES128-SHA'); + TLS1_TXT_ECDH_RSA_WITH_AES_256_CBC_SHA = AnsiString('ECDH-RSA-AES256-SHA'); + + TLS1_TXT_ECDHE_RSA_WITH_NULL_SHA = AnsiString('ECDHE-RSA-NULL-SHA'); + TLS1_TXT_ECDHE_RSA_WITH_RC4_128_SHA = AnsiString('ECDHE-RSA-RC4-SHA'); + TLS1_TXT_ECDHE_RSA_WITH_DES_192_CBC3_SHA = AnsiString('ECDHE-RSA-DES-CBC3-SHA'); + TLS1_TXT_ECDHE_RSA_WITH_AES_128_CBC_SHA = AnsiString('ECDHE-RSA-AES128-SHA'); + TLS1_TXT_ECDHE_RSA_WITH_AES_256_CBC_SHA = AnsiString('ECDHE-RSA-AES256-SHA'); + + TLS1_TXT_ECDH_anon_WITH_NULL_SHA = AnsiString('AECDH-NULL-SHA'); + TLS1_TXT_ECDH_anon_WITH_RC4_128_SHA = AnsiString('AECDH-RC4-SHA'); + TLS1_TXT_ECDH_anon_WITH_DES_192_CBC3_SHA = AnsiString('AECDH-DES-CBC3-SHA'); + TLS1_TXT_ECDH_anon_WITH_AES_128_CBC_SHA = AnsiString('AECDH-AES128-SHA'); + TLS1_TXT_ECDH_anon_WITH_AES_256_CBC_SHA = AnsiString('AECDH-AES256-SHA'); + + (* PSK ciphersuites from RFC 4279 *) + TLS1_TXT_PSK_WITH_RC4_128_SHA = AnsiString('PSK-RC4-SHA'); + TLS1_TXT_PSK_WITH_3DES_EDE_CBC_SHA = AnsiString('PSK-3DES-EDE-CBC-SHA'); + TLS1_TXT_PSK_WITH_AES_128_CBC_SHA = AnsiString('PSK-AES128-CBC-SHA'); + TLS1_TXT_PSK_WITH_AES_256_CBC_SHA = AnsiString('PSK-AES256-CBC-SHA'); + + TLS1_TXT_DHE_PSK_WITH_RC4_128_SHA = AnsiString('DHE-PSK-RC4-SHA'); + TLS1_TXT_DHE_PSK_WITH_3DES_EDE_CBC_SHA = AnsiString('DHE-PSK-3DES-EDE-CBC-SHA'); + TLS1_TXT_DHE_PSK_WITH_AES_128_CBC_SHA = AnsiString('DHE-PSK-AES128-CBC-SHA'); + TLS1_TXT_DHE_PSK_WITH_AES_256_CBC_SHA = AnsiString('DHE-PSK-AES256-CBC-SHA'); + TLS1_TXT_RSA_PSK_WITH_RC4_128_SHA = AnsiString('RSA-PSK-RC4-SHA'); + TLS1_TXT_RSA_PSK_WITH_3DES_EDE_CBC_SHA = AnsiString('RSA-PSK-3DES-EDE-CBC-SHA'); + TLS1_TXT_RSA_PSK_WITH_AES_128_CBC_SHA = AnsiString('RSA-PSK-AES128-CBC-SHA'); + TLS1_TXT_RSA_PSK_WITH_AES_256_CBC_SHA = AnsiString('RSA-PSK-AES256-CBC-SHA'); + + (* PSK ciphersuites from RFC 5487 *) + TLS1_TXT_PSK_WITH_AES_128_GCM_SHA256 = AnsiString('PSK-AES128-GCM-SHA256'); + TLS1_TXT_PSK_WITH_AES_256_GCM_SHA384 = AnsiString('PSK-AES256-GCM-SHA384'); + TLS1_TXT_DHE_PSK_WITH_AES_128_GCM_SHA256 = AnsiString('DHE-PSK-AES128-GCM-SHA256'); + TLS1_TXT_DHE_PSK_WITH_AES_256_GCM_SHA384 = AnsiString('DHE-PSK-AES256-GCM-SHA384'); + TLS1_TXT_RSA_PSK_WITH_AES_128_GCM_SHA256 = AnsiString('RSA-PSK-AES128-GCM-SHA256'); + TLS1_TXT_RSA_PSK_WITH_AES_256_GCM_SHA384 = AnsiString('RSA-PSK-AES256-GCM-SHA384'); + + TLS1_TXT_PSK_WITH_AES_128_CBC_SHA256 = AnsiString('PSK-AES128-CBC-SHA256'); + TLS1_TXT_PSK_WITH_AES_256_CBC_SHA384 = AnsiString('PSK-AES256-CBC-SHA384'); + TLS1_TXT_PSK_WITH_NULL_SHA256 = AnsiString('PSK-NULL-SHA256'); + TLS1_TXT_PSK_WITH_NULL_SHA384 = AnsiString('PSK-NULL-SHA384'); + + TLS1_TXT_DHE_PSK_WITH_AES_128_CBC_SHA256 = AnsiString('DHE-PSK-AES128-CBC-SHA256'); + TLS1_TXT_DHE_PSK_WITH_AES_256_CBC_SHA384 = AnsiString('DHE-PSK-AES256-CBC-SHA384'); + TLS1_TXT_DHE_PSK_WITH_NULL_SHA256 = AnsiString('DHE-PSK-NULL-SHA256'); + TLS1_TXT_DHE_PSK_WITH_NULL_SHA384 = AnsiString('DHE-PSK-NULL-SHA384'); + + TLS1_TXT_RSA_PSK_WITH_AES_128_CBC_SHA256 = AnsiString('RSA-PSK-AES128-CBC-SHA256'); + TLS1_TXT_RSA_PSK_WITH_AES_256_CBC_SHA384 = AnsiString('RSA-PSK-AES256-CBC-SHA384'); + TLS1_TXT_RSA_PSK_WITH_NULL_SHA256 = AnsiString('RSA-PSK-NULL-SHA256'); + TLS1_TXT_RSA_PSK_WITH_NULL_SHA384 = AnsiString('RSA-PSK-NULL-SHA384'); + + (* SRP ciphersuite from RFC 5054 *) + TLS1_TXT_SRP_SHA_WITH_3DES_EDE_CBC_SHA = AnsiString('SRP-3DES-EDE-CBC-SHA'); + TLS1_TXT_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA = AnsiString('SRP-RSA-3DES-EDE-CBC-SHA'); + TLS1_TXT_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA = AnsiString('SRP-DSS-3DES-EDE-CBC-SHA'); + TLS1_TXT_SRP_SHA_WITH_AES_128_CBC_SHA = AnsiString('SRP-AES-128-CBC-SHA'); + TLS1_TXT_SRP_SHA_RSA_WITH_AES_128_CBC_SHA = AnsiString('SRP-RSA-AES-128-CBC-SHA'); + TLS1_TXT_SRP_SHA_DSS_WITH_AES_128_CBC_SHA = AnsiString('SRP-DSS-AES-128-CBC-SHA'); + TLS1_TXT_SRP_SHA_WITH_AES_256_CBC_SHA = AnsiString('SRP-AES-256-CBC-SHA'); + TLS1_TXT_SRP_SHA_RSA_WITH_AES_256_CBC_SHA = AnsiString('SRP-RSA-AES-256-CBC-SHA'); + TLS1_TXT_SRP_SHA_DSS_WITH_AES_256_CBC_SHA = AnsiString('SRP-DSS-AES-256-CBC-SHA'); + + (* Camellia ciphersuites from RFC4132 *) + TLS1_TXT_RSA_WITH_CAMELLIA_128_CBC_SHA = AnsiString('CAMELLIA128-SHA'); + TLS1_TXT_DH_DSS_WITH_CAMELLIA_128_CBC_SHA = AnsiString('DH-DSS-CAMELLIA128-SHA'); + TLS1_TXT_DH_RSA_WITH_CAMELLIA_128_CBC_SHA = AnsiString('DH-RSA-CAMELLIA128-SHA'); + TLS1_TXT_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA = AnsiString('DHE-DSS-CAMELLIA128-SHA'); + TLS1_TXT_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA = AnsiString('DHE-RSA-CAMELLIA128-SHA'); + TLS1_TXT_ADH_WITH_CAMELLIA_128_CBC_SHA = AnsiString('ADH-CAMELLIA128-SHA'); + + TLS1_TXT_RSA_WITH_CAMELLIA_256_CBC_SHA = AnsiString('CAMELLIA256-SHA'); + TLS1_TXT_DH_DSS_WITH_CAMELLIA_256_CBC_SHA = AnsiString('DH-DSS-CAMELLIA256-SHA'); + TLS1_TXT_DH_RSA_WITH_CAMELLIA_256_CBC_SHA = AnsiString('DH-RSA-CAMELLIA256-SHA'); + TLS1_TXT_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA = AnsiString('DHE-DSS-CAMELLIA256-SHA'); + TLS1_TXT_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA = AnsiString('DHE-RSA-CAMELLIA256-SHA'); + TLS1_TXT_ADH_WITH_CAMELLIA_256_CBC_SHA = AnsiString('ADH-CAMELLIA256-SHA'); + + (* TLS 1.2 Camellia SHA-256 ciphersuites from RFC5932 *) + TLS1_TXT_RSA_WITH_CAMELLIA_128_CBC_SHA256 = AnsiString('CAMELLIA128-SHA256'); + TLS1_TXT_DH_DSS_WITH_CAMELLIA_128_CBC_SHA256 = AnsiString('DH-DSS-CAMELLIA128-SHA256'); + TLS1_TXT_DH_RSA_WITH_CAMELLIA_128_CBC_SHA256 = AnsiString('DH-RSA-CAMELLIA128-SHA256'); + TLS1_TXT_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA256 = AnsiString('DHE-DSS-CAMELLIA128-SHA256'); + TLS1_TXT_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 = AnsiString('DHE-RSA-CAMELLIA128-SHA256'); + TLS1_TXT_ADH_WITH_CAMELLIA_128_CBC_SHA256 = AnsiString('ADH-CAMELLIA128-SHA256'); + + TLS1_TXT_RSA_WITH_CAMELLIA_256_CBC_SHA256 = AnsiString('CAMELLIA256-SHA256'); + TLS1_TXT_DH_DSS_WITH_CAMELLIA_256_CBC_SHA256 = AnsiString('DH-DSS-CAMELLIA256-SHA256'); + TLS1_TXT_DH_RSA_WITH_CAMELLIA_256_CBC_SHA256 = AnsiString('DH-RSA-CAMELLIA256-SHA256'); + TLS1_TXT_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA256 = AnsiString('DHE-DSS-CAMELLIA256-SHA256'); + TLS1_TXT_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256 = AnsiString('DHE-RSA-CAMELLIA256-SHA256'); + TLS1_TXT_ADH_WITH_CAMELLIA_256_CBC_SHA256 = AnsiString('ADH-CAMELLIA256-SHA256'); + + TLS1_TXT_PSK_WITH_CAMELLIA_128_CBC_SHA256 = AnsiString('PSK-CAMELLIA128-SHA256'); + TLS1_TXT_PSK_WITH_CAMELLIA_256_CBC_SHA384 = AnsiString('PSK-CAMELLIA256-SHA384'); + TLS1_TXT_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 = AnsiString('DHE-PSK-CAMELLIA128-SHA256'); + TLS1_TXT_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384 = AnsiString('DHE-PSK-CAMELLIA256-SHA384'); + TLS1_TXT_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256 = AnsiString('RSA-PSK-CAMELLIA128-SHA256'); + TLS1_TXT_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384 = AnsiString('RSA-PSK-CAMELLIA256-SHA384'); + TLS1_TXT_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 = AnsiString('ECDHE-PSK-CAMELLIA128-SHA256'); + TLS1_TXT_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384 = AnsiString('ECDHE-PSK-CAMELLIA256-SHA384'); + + (* SEED ciphersuites from RFC4162 *) + TLS1_TXT_RSA_WITH_SEED_SHA = AnsiString('SEED-SHA'); + TLS1_TXT_DH_DSS_WITH_SEED_SHA = AnsiString('DH-DSS-SEED-SHA'); + TLS1_TXT_DH_RSA_WITH_SEED_SHA = AnsiString('DH-RSA-SEED-SHA'); + TLS1_TXT_DHE_DSS_WITH_SEED_SHA = AnsiString('DHE-DSS-SEED-SHA'); + TLS1_TXT_DHE_RSA_WITH_SEED_SHA = AnsiString('DHE-RSA-SEED-SHA'); + TLS1_TXT_ADH_WITH_SEED_SHA = AnsiString('ADH-SEED-SHA'); + + (* TLS v1.2 ciphersuites *) + TLS1_TXT_RSA_WITH_NULL_SHA256 = AnsiString('NULL-SHA256'); + TLS1_TXT_RSA_WITH_AES_128_SHA256 = AnsiString('AES128-SHA256'); + TLS1_TXT_RSA_WITH_AES_256_SHA256 = AnsiString('AES256-SHA256'); + TLS1_TXT_DH_DSS_WITH_AES_128_SHA256 = AnsiString('DH-DSS-AES128-SHA256'); + TLS1_TXT_DH_RSA_WITH_AES_128_SHA256 = AnsiString('DH-RSA-AES128-SHA256'); + TLS1_TXT_DHE_DSS_WITH_AES_128_SHA256 = AnsiString('DHE-DSS-AES128-SHA256'); + TLS1_TXT_DHE_RSA_WITH_AES_128_SHA256 = AnsiString('DHE-RSA-AES128-SHA256'); + TLS1_TXT_DH_DSS_WITH_AES_256_SHA256 = AnsiString('DH-DSS-AES256-SHA256'); + TLS1_TXT_DH_RSA_WITH_AES_256_SHA256 = AnsiString('DH-RSA-AES256-SHA256'); + TLS1_TXT_DHE_DSS_WITH_AES_256_SHA256 = AnsiString('DHE-DSS-AES256-SHA256'); + TLS1_TXT_DHE_RSA_WITH_AES_256_SHA256 = AnsiString('DHE-RSA-AES256-SHA256'); + TLS1_TXT_ADH_WITH_AES_128_SHA256 = AnsiString('ADH-AES128-SHA256'); + TLS1_TXT_ADH_WITH_AES_256_SHA256 = AnsiString('ADH-AES256-SHA256'); + + (* TLS v1.2 GCM ciphersuites from RFC5288 *) + TLS1_TXT_RSA_WITH_AES_128_GCM_SHA256 = AnsiString('AES128-GCM-SHA256'); + TLS1_TXT_RSA_WITH_AES_256_GCM_SHA384 = AnsiString('AES256-GCM-SHA384'); + TLS1_TXT_DHE_RSA_WITH_AES_128_GCM_SHA256 = AnsiString('DHE-RSA-AES128-GCM-SHA256'); + TLS1_TXT_DHE_RSA_WITH_AES_256_GCM_SHA384 = AnsiString('DHE-RSA-AES256-GCM-SHA384'); + TLS1_TXT_DH_RSA_WITH_AES_128_GCM_SHA256 = AnsiString('DH-RSA-AES128-GCM-SHA256'); + TLS1_TXT_DH_RSA_WITH_AES_256_GCM_SHA384 = AnsiString('DH-RSA-AES256-GCM-SHA384'); + TLS1_TXT_DHE_DSS_WITH_AES_128_GCM_SHA256 = AnsiString('DHE-DSS-AES128-GCM-SHA256'); + TLS1_TXT_DHE_DSS_WITH_AES_256_GCM_SHA384 = AnsiString('DHE-DSS-AES256-GCM-SHA384'); + TLS1_TXT_DH_DSS_WITH_AES_128_GCM_SHA256 = AnsiString('DH-DSS-AES128-GCM-SHA256'); + TLS1_TXT_DH_DSS_WITH_AES_256_GCM_SHA384 = AnsiString('DH-DSS-AES256-GCM-SHA384'); + TLS1_TXT_ADH_WITH_AES_128_GCM_SHA256 = AnsiString('ADH-AES128-GCM-SHA256'); + TLS1_TXT_ADH_WITH_AES_256_GCM_SHA384 = AnsiString('ADH-AES256-GCM-SHA384'); + + (* CCM ciphersuites from RFC6655 *) + TLS1_TXT_RSA_WITH_AES_128_CCM = AnsiString('AES128-CCM'); + TLS1_TXT_RSA_WITH_AES_256_CCM = AnsiString('AES256-CCM'); + TLS1_TXT_DHE_RSA_WITH_AES_128_CCM = AnsiString('DHE-RSA-AES128-CCM'); + TLS1_TXT_DHE_RSA_WITH_AES_256_CCM = AnsiString('DHE-RSA-AES256-CCM'); + + TLS1_TXT_RSA_WITH_AES_128_CCM_8 = AnsiString('AES128-CCM8'); + TLS1_TXT_RSA_WITH_AES_256_CCM_8 = AnsiString('AES256-CCM8'); + TLS1_TXT_DHE_RSA_WITH_AES_128_CCM_8 = AnsiString('DHE-RSA-AES128-CCM8'); + TLS1_TXT_DHE_RSA_WITH_AES_256_CCM_8 = AnsiString('DHE-RSA-AES256-CCM8'); + + TLS1_TXT_PSK_WITH_AES_128_CCM = AnsiString('PSK-AES128-CCM'); + TLS1_TXT_PSK_WITH_AES_256_CCM = AnsiString('PSK-AES256-CCM'); + TLS1_TXT_DHE_PSK_WITH_AES_128_CCM = AnsiString('DHE-PSK-AES128-CCM'); + TLS1_TXT_DHE_PSK_WITH_AES_256_CCM = AnsiString('DHE-PSK-AES256-CCM'); + + TLS1_TXT_PSK_WITH_AES_128_CCM_8 = AnsiString('PSK-AES128-CCM8'); + TLS1_TXT_PSK_WITH_AES_256_CCM_8 = AnsiString('PSK-AES256-CCM8'); + TLS1_TXT_DHE_PSK_WITH_AES_128_CCM_8 = AnsiString('DHE-PSK-AES128-CCM8'); + TLS1_TXT_DHE_PSK_WITH_AES_256_CCM_8 = AnsiString('DHE-PSK-AES256-CCM8'); + + (* CCM ciphersuites from RFC7251 *) + TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_CCM = AnsiString('ECDHE-ECDSA-AES128-CCM'); + TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_CCM = AnsiString('ECDHE-ECDSA-AES256-CCM'); + TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_CCM_8 = AnsiString('ECDHE-ECDSA-AES128-CCM8'); + TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_CCM_8 = AnsiString('ECDHE-ECDSA-AES256-CCM8'); + + (* ECDH HMAC based ciphersuites from RFC5289 *) + TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_SHA256 = AnsiString('ECDHE-ECDSA-AES128-SHA256'); + TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_SHA384 = AnsiString('ECDHE-ECDSA-AES256-SHA384'); + TLS1_TXT_ECDH_ECDSA_WITH_AES_128_SHA256 = AnsiString('ECDH-ECDSA-AES128-SHA256'); + TLS1_TXT_ECDH_ECDSA_WITH_AES_256_SHA384 = AnsiString('ECDH-ECDSA-AES256-SHA384'); + TLS1_TXT_ECDHE_RSA_WITH_AES_128_SHA256 = AnsiString('ECDHE-RSA-AES128-SHA256'); + TLS1_TXT_ECDHE_RSA_WITH_AES_256_SHA384 = AnsiString('ECDHE-RSA-AES256-SHA384'); + TLS1_TXT_ECDH_RSA_WITH_AES_128_SHA256 = AnsiString('ECDH-RSA-AES128-SHA256'); + TLS1_TXT_ECDH_RSA_WITH_AES_256_SHA384 = AnsiString('ECDH-RSA-AES256-SHA384'); + + (* ECDH GCM based ciphersuites from RFC5289 *) + TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 = AnsiString('ECDHE-ECDSA-AES128-GCM-SHA256'); + TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 = AnsiString('ECDHE-ECDSA-AES256-GCM-SHA384'); + TLS1_TXT_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 = AnsiString('ECDH-ECDSA-AES128-GCM-SHA256'); + TLS1_TXT_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 = AnsiString('ECDH-ECDSA-AES256-GCM-SHA384'); + TLS1_TXT_ECDHE_RSA_WITH_AES_128_GCM_SHA256 = AnsiString('ECDHE-RSA-AES128-GCM-SHA256'); + TLS1_TXT_ECDHE_RSA_WITH_AES_256_GCM_SHA384 = AnsiString('ECDHE-RSA-AES256-GCM-SHA384'); + TLS1_TXT_ECDH_RSA_WITH_AES_128_GCM_SHA256 = AnsiString('ECDH-RSA-AES128-GCM-SHA256'); + TLS1_TXT_ECDH_RSA_WITH_AES_256_GCM_SHA384 = AnsiString('ECDH-RSA-AES256-GCM-SHA384'); + + (* TLS v1.2 PSK GCM ciphersuites from RFC5487 *) + //TLS1_TXT_PSK_WITH_AES_128_GCM_SHA256 = AnsiString('PSK-AES128-GCM-SHA256'); + //TLS1_TXT_PSK_WITH_AES_256_GCM_SHA384 = AnsiString('PSK-AES256-GCM-SHA384'); + + (* ECDHE PSK ciphersuites from RFC 5489 *) + TLS1_TXT_ECDHE_PSK_WITH_RC4_128_SHA = AnsiString('ECDHE-PSK-RC4-SHA'); + TLS1_TXT_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA = AnsiString('ECDHE-PSK-3DES-EDE-CBC-SHA'); + TLS1_TXT_ECDHE_PSK_WITH_AES_128_CBC_SHA = AnsiString('ECDHE-PSK-AES128-CBC-SHA'); + TLS1_TXT_ECDHE_PSK_WITH_AES_256_CBC_SHA = AnsiString('ECDHE-PSK-AES256-CBC-SHA'); + + TLS1_TXT_ECDHE_PSK_WITH_AES_128_CBC_SHA256 = AnsiString('ECDHE-PSK-AES128-CBC-SHA256'); + TLS1_TXT_ECDHE_PSK_WITH_AES_256_CBC_SHA384 = AnsiString('ECDHE-PSK-AES256-CBC-SHA384'); + + TLS1_TXT_ECDHE_PSK_WITH_NULL_SHA = AnsiString('ECDHE-PSK-NULL-SHA'); + TLS1_TXT_ECDHE_PSK_WITH_NULL_SHA256 = AnsiString('ECDHE-PSK-NULL-SHA256'); + TLS1_TXT_ECDHE_PSK_WITH_NULL_SHA384 = AnsiString('ECDHE-PSK-NULL-SHA384'); + + (* Camellia-CBC ciphersuites from RFC6367 *) + TLS1_TXT_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256 = AnsiString('ECDHE-ECDSA-CAMELLIA128-SHA256'); + TLS1_TXT_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384 = AnsiString('ECDHE-ECDSA-CAMELLIA256-SHA384'); + TLS1_TXT_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256 = AnsiString('ECDH-ECDSA-CAMELLIA128-SHA256'); + TLS1_TXT_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384 = AnsiString('ECDH-ECDSA-CAMELLIA256-SHA384'); + TLS1_TXT_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 = AnsiString('ECDHE-RSA-CAMELLIA128-SHA256'); + TLS1_TXT_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384 = AnsiString('ECDHE-RSA-CAMELLIA256-SHA384'); + TLS1_TXT_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256 = AnsiString('ECDH-RSA-CAMELLIA128-SHA256'); + TLS1_TXT_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384 = AnsiString('ECDH-RSA-CAMELLIA256-SHA384'); + + (* draft-ietf-tls-chacha20-poly1305-03 *) + TLS1_TXT_ECDHE_RSA_WITH_CHACHA20_POLY1305 = AnsiString('ECDHE-RSA-CHACHA20-POLY1305'); + TLS1_TXT_ECDHE_ECDSA_WITH_CHACHA20_POLY1305 = AnsiString('ECDHE-ECDSA-CHACHA20-POLY1305'); + TLS1_TXT_DHE_RSA_WITH_CHACHA20_POLY1305 = AnsiString('DHE-RSA-CHACHA20-POLY1305'); + TLS1_TXT_PSK_WITH_CHACHA20_POLY1305 = AnsiString('PSK-CHACHA20-POLY1305'); + TLS1_TXT_ECDHE_PSK_WITH_CHACHA20_POLY1305 = AnsiString('ECDHE-PSK-CHACHA20-POLY1305'); + TLS1_TXT_DHE_PSK_WITH_CHACHA20_POLY1305 = AnsiString('DHE-PSK-CHACHA20-POLY1305'); + TLS1_TXT_RSA_PSK_WITH_CHACHA20_POLY1305 = AnsiString('RSA-PSK-CHACHA20-POLY1305'); + + (* Aria ciphersuites from RFC6209 *) + TLS1_TXT_RSA_WITH_ARIA_128_GCM_SHA256 = AnsiString('ARIA128-GCM-SHA256'); + TLS1_TXT_RSA_WITH_ARIA_256_GCM_SHA384 = AnsiString('ARIA256-GCM-SHA384'); + TLS1_TXT_DHE_RSA_WITH_ARIA_128_GCM_SHA256 = AnsiString('DHE-RSA-ARIA128-GCM-SHA256'); + TLS1_TXT_DHE_RSA_WITH_ARIA_256_GCM_SHA384 = AnsiString('DHE-RSA-ARIA256-GCM-SHA384'); + TLS1_TXT_DH_RSA_WITH_ARIA_128_GCM_SHA256 = AnsiString('DH-RSA-ARIA128-GCM-SHA256'); + TLS1_TXT_DH_RSA_WITH_ARIA_256_GCM_SHA384 = AnsiString('DH-RSA-ARIA256-GCM-SHA384'); + TLS1_TXT_DHE_DSS_WITH_ARIA_128_GCM_SHA256 = AnsiString('DHE-DSS-ARIA128-GCM-SHA256'); + TLS1_TXT_DHE_DSS_WITH_ARIA_256_GCM_SHA384 = AnsiString('DHE-DSS-ARIA256-GCM-SHA384'); + TLS1_TXT_DH_DSS_WITH_ARIA_128_GCM_SHA256 = AnsiString('DH-DSS-ARIA128-GCM-SHA256'); + TLS1_TXT_DH_DSS_WITH_ARIA_256_GCM_SHA384 = AnsiString('DH-DSS-ARIA256-GCM-SHA384'); + TLS1_TXT_DH_anon_WITH_ARIA_128_GCM_SHA256 = AnsiString('ADH-ARIA128-GCM-SHA256'); + TLS1_TXT_DH_anon_WITH_ARIA_256_GCM_SHA384 = AnsiString('ADH-ARIA256-GCM-SHA384'); + TLS1_TXT_ECDHE_ECDSA_WITH_ARIA_128_GCM_SHA256 = AnsiString('ECDHE-ECDSA-ARIA128-GCM-SHA256'); + TLS1_TXT_ECDHE_ECDSA_WITH_ARIA_256_GCM_SHA384 = AnsiString('ECDHE-ECDSA-ARIA256-GCM-SHA384'); + TLS1_TXT_ECDH_ECDSA_WITH_ARIA_128_GCM_SHA256 = AnsiString('ECDH-ECDSA-ARIA128-GCM-SHA256'); + TLS1_TXT_ECDH_ECDSA_WITH_ARIA_256_GCM_SHA384 = AnsiString('ECDH-ECDSA-ARIA256-GCM-SHA384'); + TLS1_TXT_ECDHE_RSA_WITH_ARIA_128_GCM_SHA256 = AnsiString('ECDHE-ARIA128-GCM-SHA256'); + TLS1_TXT_ECDHE_RSA_WITH_ARIA_256_GCM_SHA384 = AnsiString('ECDHE-ARIA256-GCM-SHA384'); + TLS1_TXT_ECDH_RSA_WITH_ARIA_128_GCM_SHA256 = AnsiString('ECDH-ARIA128-GCM-SHA256'); + TLS1_TXT_ECDH_RSA_WITH_ARIA_256_GCM_SHA384 = AnsiString('ECDH-ARIA256-GCM-SHA384'); + TLS1_TXT_PSK_WITH_ARIA_128_GCM_SHA256 = AnsiString('PSK-ARIA128-GCM-SHA256'); + TLS1_TXT_PSK_WITH_ARIA_256_GCM_SHA384 = AnsiString('PSK-ARIA256-GCM-SHA384'); + TLS1_TXT_DHE_PSK_WITH_ARIA_128_GCM_SHA256 = AnsiString('DHE-PSK-ARIA128-GCM-SHA256'); + TLS1_TXT_DHE_PSK_WITH_ARIA_256_GCM_SHA384 = AnsiString('DHE-PSK-ARIA256-GCM-SHA384'); + TLS1_TXT_RSA_PSK_WITH_ARIA_128_GCM_SHA256 = AnsiString('RSA-PSK-ARIA128-GCM-SHA256'); + TLS1_TXT_RSA_PSK_WITH_ARIA_256_GCM_SHA384 = AnsiString('RSA-PSK-ARIA256-GCM-SHA384'); + + TLS_CT_RSA_SIGN = 1; + TLS_CT_DSS_SIGN = 2; + TLS_CT_RSA_FIXED_DH = 3; + TLS_CT_DSS_FIXED_DH = 4; + TLS_CT_ECDSA_SIGN = 64; + TLS_CT_RSA_FIXED_ECDH = 65; + TLS_CT_ECDSA_FIXED_ECDH = 66; + TLS_CT_GOST01_SIGN = 22; + TLS_CT_GOST12_SIGN = 238; + TLS_CT_GOST12_512_SIGN = 239; + + (* + * when correcting this number, correct also SSL3_CT_NUMBER in ssl3.h (see + * comment there) + *) + TLS_CT_NUMBER = 10; + + TLS1_FINISH_MAC_LENGTH = 12; + + TLS_MD_MAX_CONST_SIZE = 22; + TLS_MD_CLIENT_FINISH_CONST = AnsiString('client finished'); + TLS_MD_CLIENT_FINISH_CONST_SIZE = 15; + TLS_MD_SERVER_FINISH_CONST = AnsiString('server finished'); + TLS_MD_SERVER_FINISH_CONST_SIZE = 15; + TLS_MD_KEY_EXPANSION_CONST = AnsiString('key expansion'); + TLS_MD_KEY_EXPANSION_CONST_SIZE = 13; + TLS_MD_CLIENT_WRITE_KEY_CONST = AnsiString('client write key'); + TLS_MD_CLIENT_WRITE_KEY_CONST_SIZE = 16; + TLS_MD_SERVER_WRITE_KEY_CONST = AnsiString('server write key'); + TLS_MD_SERVER_WRITE_KEY_CONST_SIZE = 16; + TLS_MD_IV_BLOCK_CONST = AnsiString('IV block'); + TLS_MD_IV_BLOCK_CONST_SIZE = 8; + TLS_MD_MASTER_SECRET_CONST = AnsiString('master secret'); + TLS_MD_MASTER_SECRET_CONST_SIZE = 13; + TLS_MD_EXTENDED_MASTER_SECRET_CONST = AnsiString('extended master secret'); + TLS_MD_EXTENDED_MASTER_SECRET_CONST_SIZE = 22; + +// (* +// * client finished +// *) +// TLS_MD_CLIENT_FINISH_CONST = TIdAnsiChar($63) + TIdAnsiChar($6c) + TIdAnsiChar($69) + TIdAnsiChar($65) + TIdAnsiChar($6e) + TIdAnsiChar($74) + TIdAnsiChar($20) + TIdAnsiChar($66) + TIdAnsiChar($69) + TIdAnsiChar($6e) + TIdAnsiChar($69) + TIdAnsiChar($73) + TIdAnsiChar($68) + TIdAnsiChar($65) + TIdAnsiChar($64); +// +// (* +// * server finished +// *) +// TLS_MD_SERVER_FINISH_CONST = TIdAnsiChar($73) + TIdAnsiChar($65) + TIdAnsiChar($72) + TIdAnsiChar($76) + TIdAnsiChar($65) + TIdAnsiChar($72) + TIdAnsiChar($20) + TIdAnsiChar($66) + TIdAnsiChar($69) + TIdAnsiChar($6e) + TIdAnsiChar($69) + TIdAnsiChar($73) + TIdAnsiChar($68) + TIdAnsiChar($65) + TIdAnsiChar($64); +// +// (* +// * server write key +// *) +// TLS_MD_SERVER_WRITE_KEY_CONST = TIdAnsiChar($73) + TIdAnsiChar($65) + TIdAnsiChar($72) + TIdAnsiChar($76) + TIdAnsiChar($65) + TIdAnsiChar($72) + TIdAnsiChar($20) + TIdAnsiChar($77) + TIdAnsiChar($72) + TIdAnsiChar($69) + TIdAnsiChar($74) + TIdAnsiChar($65) + TIdAnsiChar($20) + TIdAnsiChar($6b) + TIdAnsiChar($65) + TIdAnsiChar($79); +// +// (* +// * key expansion +// *) +// TLS_MD_KEY_EXPANSION_CONST = TIdAnsiChar($6b) + TIdAnsiChar($65) + TIdAnsiChar($79) + TIdAnsiChar($20) + TIdAnsiChar($65) + TIdAnsiChar($78) + TIdAnsiChar($70) + TIdAnsiChar($61) + TIdAnsiChar($6e) + TIdAnsiChar($73) + TIdAnsiChar($69) + TIdAnsiChar($6f) + TIdAnsiChar($6e); +// +// (* +// * client write key +// *) +// TLS_MD_CLIENT_WRITE_KEY_CONST = TIdAnsiChar($63) + TIdAnsiChar($6c) + TIdAnsiChar($69) + TIdAnsiChar($65) + TIdAnsiChar($6e) + TIdAnsiChar($74) + TIdAnsiChar($20) + TIdAnsiChar($77) + TIdAnsiChar($72) + TIdAnsiChar($69) + TIdAnsiChar($74) + TIdAnsiChar($65) + TIdAnsiChar($20) + TIdAnsiChar($6b) + TIdAnsiChar($65) + TIdAnsiChar($79); +// +// (* +// * server write key +// *) +// TLS_MD_SERVER_WRITE_KEY_CONST = TIdAnsiChar($73) + TIdAnsiChar($65) + TIdAnsiChar($72) + TIdAnsiChar($76) + TIdAnsiChar($65) + TIdAnsiChar($72) + TIdAnsiChar($20) + TIdAnsiChar($77) + TIdAnsiChar($72) + TIdAnsiChar($69) + TIdAnsiChar($74) + TIdAnsiChar($65) + TIdAnsiChar($20) + TIdAnsiChar($6b) + TIdAnsiChar($65) + TIdAnsiChar($79); +// +// (* +// * IV block +// *) +// TLS_MD_IV_BLOCK_CONST = TIdAnsiChar($49) + TIdAnsiChar($56) + TIdAnsiChar($20) + TIdAnsiChar($62) + TIdAnsiChar($6c) + TIdAnsiChar($6f) + TIdAnsiChar($63) + TIdAnsiChar($6b); +// +// (* +// * master secret +// *) +// TLS_MD_MASTER_SECRET_CONST = TIdAnsiChar($6d) + TIdAnsiChar($61) + TIdAnsiChar($73) + TIdAnsiChar($74) + TIdAnsiChar($65) + TIdAnsiChar($72) + TIdAnsiChar($20) + TIdAnsiChar($73) + TIdAnsiChar($65) + TIdAnsiChar($63) + TIdAnsiChar($72) + TIdAnsiChar($65) + TIdAnsiChar($74); +// +// (* +// * extended master secret +// *) +// TLS_MD_EXTENDED_MASTER_SECRET_CONST = TIdAnsiChar($65) + TIdAnsiChar($78) + TIdAnsiChar($74) + TIdAnsiChar($65) + TIdAnsiChar($6e) + TIdAnsiChar($64) + TIdAnsiChar($65) + TIdAnsiChar($64) + TIdAnsiChar($20) + TIdAnsiChar($6d) + TIdAnsiChar($61) + TIdAnsiChar($73) + TIdAnsiChar($74) + TIdAnsiChar($65) + TIdAnsiChar($72) + TIdAnsiChar($20) + TIdAnsiChar($73) + TIdAnsiChar($65) + TIdAnsiChar($63) + TIdAnsiChar($72) + TIdAnsiChar($65) + TIdAnsiChar($74); + +type + (* TLS Session Ticket extension struct *) + tls_session_ticket_ext_st = record + length: TIdC_USHORT; + data: Pointer; + end; + + { The EXTERNALSYM directive is ignored by FPC, however, it is used by Delphi as follows: + + The EXTERNALSYM directive prevents the specified Delphi symbol from appearing in header + files generated for C++. } + + {$EXTERNALSYM SSL_CTX_set_tlsext_max_fragment_length} {introduced 1.1.0} + {$EXTERNALSYM SSL_set_tlsext_max_fragment_length} {introduced 1.1.0} + {$EXTERNALSYM SSL_get_servername} + {$EXTERNALSYM SSL_get_servername_type} + {$EXTERNALSYM SSL_export_keying_material} + {$EXTERNALSYM SSL_export_keying_material_early} {introduced 1.1.0} + {$EXTERNALSYM SSL_get_peer_signature_type_nid} {introduced 1.1.0} + {$EXTERNALSYM SSL_get_signature_type_nid} {introduced 1.1.0} + {$EXTERNALSYM SSL_get_sigalgs} + {$EXTERNALSYM SSL_get_shared_sigalgs} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +var + {$EXTERNALSYM SSL_set_tlsext_host_name} {removed 1.0.0} + SSL_set_tlsext_host_name: function (s: PSSL; const name: PIdAnsiChar): TIdC_LONG; cdecl = nil; {removed 1.0.0} + + SSL_CTX_set_tlsext_max_fragment_length: function (ctx: PSSL_CTx; mode: TIdC_UINT8): TIdC_INT; cdecl = nil; {introduced 1.1.0} + SSL_set_tlsext_max_fragment_length: function (ssl: PSSL; mode: TIdC_UINT8): TIdC_INT; cdecl = nil; {introduced 1.1.0} + + SSL_get_servername: function (const s: PSSL; const type_: TIdC_INT): PIdAnsiChar; cdecl = nil; + SSL_get_servername_type: function (const s: PSSL): TIdC_INT; cdecl = nil; + (* + * SSL_export_keying_material exports a value derived from the master secret, + * as specified in RFC 5705. It writes |olen| bytes to |out| given a label and + * optional context. (Since a zero length context is allowed, the |use_context| + * flag controls whether a context is included.) It returns 1 on success and + * 0 or -1 otherwise. + *) + SSL_export_keying_material: function (s: PSSL; out_: PByte; olen: TIdC_SIZET; const label_: PIdAnsiChar; llen: TIdC_SIZET; const context: PByte; contextlen: TIdC_SIZET; use_context: TIdC_INT): TIdC_INT; cdecl = nil; + + (* + * SSL_export_keying_material_early exports a value derived from the + * early exporter master secret, as specified in + * https://tools.ietf.org/html/draft-ietf-tls-tls13-23. It writes + * |olen| bytes to |out| given a label and optional context. It + * returns 1 on success and 0 otherwise. + *) + SSL_export_keying_material_early: function (s: PSSL; out_: PByte; olen: TIdC_SIZET; const label_: PIdAnsiChar; llen: TIdC_SIZET; const context: PByte; contextlen: TIdC_SIZET): TIdC_INT; cdecl = nil; {introduced 1.1.0} + + SSL_get_peer_signature_type_nid: function (const s: PSSl; pnid: PIdC_INT): TIdC_INT; cdecl = nil; {introduced 1.1.0} + SSL_get_signature_type_nid: function (const s: PSSl; pnid: PIdC_INT): TIdC_INT; cdecl = nil; {introduced 1.1.0} + SSL_get_sigalgs: function (s: PSSl; idx: TIdC_INT; psign: PIdC_INT; phash: PIdC_INT; psignandhash: PIdC_INT; rsig: PByte; rhash: PByte): TIdC_INT; cdecl = nil; + SSL_get_shared_sigalgs: function (s: PSSl; idx: TIdC_INT; psign: PIdC_INT; phash: PIdC_INT; psignandhash: PIdC_INT; rsig: PByte; rhash: PByte): TIdC_INT; cdecl = nil; + + //__owur TIdC_INT SSL_check_chain(s: PSSL, X509 *x, EVP_PKEY *pk, STACK_OF(X509) *chain); + + //# define SSL_set_tlsext_debug_callback(ssl, cb) \ + // SSL_callback_ctrl(ssl,SSL_CTRL_SET_TLSEXT_DEBUG_CB,\ + // (void (*)(void))cb) + + //# define SSL_set_tlsext_debug_arg(ssl, arg) \ + // SSL_ctrl(ssl,SSL_CTRL_SET_TLSEXT_DEBUG_ARG,0,arg) + // + //# define SSL_get_tlsext_status_type(ssl) \ + // SSL_ctrl(ssl,SSL_CTRL_GET_TLSEXT_STATUS_REQ_TYPE,0,NULL) + // + //# define SSL_set_tlsext_status_type(ssl, type) \ + // SSL_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_TYPE,type,NULL) + // + //# define SSL_get_tlsext_status_exts(ssl, arg) \ + // SSL_ctrl(ssl,SSL_CTRL_GET_TLSEXT_STATUS_REQ_EXTS,0,arg) + // + //# define SSL_set_tlsext_status_exts(ssl, arg) \ + // SSL_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_EXTS,0,arg) + // + //# define SSL_get_tlsext_status_ids(ssl, arg) \ + // SSL_ctrl(ssl,SSL_CTRL_GET_TLSEXT_STATUS_REQ_IDS,0,arg) + // + //# define SSL_set_tlsext_status_ids(ssl, arg) \ + // SSL_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_IDS,0,arg) + // + //# define SSL_get_tlsext_status_ocsp_resp(ssl, arg) \ + // SSL_ctrl(ssl,SSL_CTRL_GET_TLSEXT_STATUS_REQ_OCSP_RESP,0,arg) + // + //# define SSL_set_tlsext_status_ocsp_resp(ssl, arg, arglen) \ + // SSL_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_OCSP_RESP,arglen,arg) + // + //# define SSL_CTX_set_tlsext_servername_callback(ctx, cb) \ + // SSL_CTX_callback_ctrl(ctx,SSL_CTRL_SET_TLSEXT_SERVERNAME_CB,\ + // (void (*)(void))cb) + + //# define SSL_CTX_set_tlsext_servername_arg(ctx, arg) \ + // SSL_CTX_ctrl(ctx,SSL_CTRL_SET_TLSEXT_SERVERNAME_ARG,0,arg) + // + //# define SSL_CTX_get_tlsext_ticket_keys(ctx, keys, keylen) \ + // SSL_CTX_ctrl(ctx,SSL_CTRL_GET_TLSEXT_TICKET_KEYS,keylen,keys) + //# define SSL_CTX_set_tlsext_ticket_keys(ctx, keys, keylen) \ + // SSL_CTX_ctrl(ctx,SSL_CTRL_SET_TLSEXT_TICKET_KEYS,keylen,keys) + // + //# define SSL_CTX_get_tlsext_status_cb(ssl, cb) \ + // SSL_CTX_ctrl(ssl,SSL_CTRL_GET_TLSEXT_STATUS_REQ_CB,0,(void *)cb) + //# define SSL_CTX_set_tlsext_status_cb(ssl, cb) \ + // SSL_CTX_callback_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB,\ + // (void (*)(void))cb) + + //# define SSL_CTX_get_tlsext_status_arg(ssl, arg) \ + // SSL_CTX_ctrl(ssl,SSL_CTRL_GET_TLSEXT_STATUS_REQ_CB_ARG,0,arg) + //# define SSL_CTX_set_tlsext_status_arg(ssl, arg) \ + // SSL_CTX_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB_ARG,0,arg) + // + //# define SSL_CTX_set_tlsext_status_type(ssl, type) \ + // SSL_CTX_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_TYPE,type,NULL) + // + //# define SSL_CTX_get_tlsext_status_type(ssl) \ + // SSL_CTX_ctrl(ssl,SSL_CTRL_GET_TLSEXT_STATUS_REQ_TYPE,0,NULL) + // + //# define SSL_CTX_set_tlsext_ticket_key_cb(ssl, cb) \ + // SSL_CTX_callback_ctrl(ssl,SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB,\ + // (void (*)(void))cb) + +{$ELSE} + + function SSL_CTX_set_tlsext_max_fragment_length(ctx: PSSL_CTx; mode: TIdC_UINT8): TIdC_INT cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_set_tlsext_max_fragment_length(ssl: PSSL; mode: TIdC_UINT8): TIdC_INT cdecl; external CLibSSL; {introduced 1.1.0} + + function SSL_get_servername(const s: PSSL; const type_: TIdC_INT): PIdAnsiChar cdecl; external CLibSSL; + function SSL_get_servername_type(const s: PSSL): TIdC_INT cdecl; external CLibSSL; + (* + * SSL_export_keying_material exports a value derived from the master secret, + * as specified in RFC 5705. It writes |olen| bytes to |out| given a label and + * optional context. (Since a zero length context is allowed, the |use_context| + * flag controls whether a context is included.) It returns 1 on success and + * 0 or -1 otherwise. + *) + function SSL_export_keying_material(s: PSSL; out_: PByte; olen: TIdC_SIZET; const label_: PIdAnsiChar; llen: TIdC_SIZET; const context: PByte; contextlen: TIdC_SIZET; use_context: TIdC_INT): TIdC_INT cdecl; external CLibSSL; + + (* + * SSL_export_keying_material_early exports a value derived from the + * early exporter master secret, as specified in + * https://tools.ietf.org/html/draft-ietf-tls-tls13-23. It writes + * |olen| bytes to |out| given a label and optional context. It + * returns 1 on success and 0 otherwise. + *) + function SSL_export_keying_material_early(s: PSSL; out_: PByte; olen: TIdC_SIZET; const label_: PIdAnsiChar; llen: TIdC_SIZET; const context: PByte; contextlen: TIdC_SIZET): TIdC_INT cdecl; external CLibSSL; {introduced 1.1.0} + + function SSL_get_peer_signature_type_nid(const s: PSSl; pnid: PIdC_INT): TIdC_INT cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_get_signature_type_nid(const s: PSSl; pnid: PIdC_INT): TIdC_INT cdecl; external CLibSSL; {introduced 1.1.0} + function SSL_get_sigalgs(s: PSSl; idx: TIdC_INT; psign: PIdC_INT; phash: PIdC_INT; psignandhash: PIdC_INT; rsig: PByte; rhash: PByte): TIdC_INT cdecl; external CLibSSL; + function SSL_get_shared_sigalgs(s: PSSl; idx: TIdC_INT; psign: PIdC_INT; phash: PIdC_INT; psignandhash: PIdC_INT; rsig: PByte; rhash: PByte): TIdC_INT cdecl; external CLibSSL; + + //__owur TIdC_INT SSL_check_chain(s: PSSL, X509 *x, EVP_PKEY *pk, STACK_OF(X509) *chain); + + //# define SSL_set_tlsext_debug_callback(ssl, cb) \ + // SSL_callback_ctrl(ssl,SSL_CTRL_SET_TLSEXT_DEBUG_CB,\ + // (void (*)(void))cb) + + //# define SSL_set_tlsext_debug_arg(ssl, arg) \ + // SSL_ctrl(ssl,SSL_CTRL_SET_TLSEXT_DEBUG_ARG,0,arg) + // + //# define SSL_get_tlsext_status_type(ssl) \ + // SSL_ctrl(ssl,SSL_CTRL_GET_TLSEXT_STATUS_REQ_TYPE,0,NULL) + // + //# define SSL_set_tlsext_status_type(ssl, type) \ + // SSL_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_TYPE,type,NULL) + // + //# define SSL_get_tlsext_status_exts(ssl, arg) \ + // SSL_ctrl(ssl,SSL_CTRL_GET_TLSEXT_STATUS_REQ_EXTS,0,arg) + // + //# define SSL_set_tlsext_status_exts(ssl, arg) \ + // SSL_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_EXTS,0,arg) + // + //# define SSL_get_tlsext_status_ids(ssl, arg) \ + // SSL_ctrl(ssl,SSL_CTRL_GET_TLSEXT_STATUS_REQ_IDS,0,arg) + // + //# define SSL_set_tlsext_status_ids(ssl, arg) \ + // SSL_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_IDS,0,arg) + // + //# define SSL_get_tlsext_status_ocsp_resp(ssl, arg) \ + // SSL_ctrl(ssl,SSL_CTRL_GET_TLSEXT_STATUS_REQ_OCSP_RESP,0,arg) + // + //# define SSL_set_tlsext_status_ocsp_resp(ssl, arg, arglen) \ + // SSL_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_OCSP_RESP,arglen,arg) + // + //# define SSL_CTX_set_tlsext_servername_callback(ctx, cb) \ + // SSL_CTX_callback_ctrl(ctx,SSL_CTRL_SET_TLSEXT_SERVERNAME_CB,\ + // (void (*)(void))cb) + + //# define SSL_CTX_set_tlsext_servername_arg(ctx, arg) \ + // SSL_CTX_ctrl(ctx,SSL_CTRL_SET_TLSEXT_SERVERNAME_ARG,0,arg) + // + //# define SSL_CTX_get_tlsext_ticket_keys(ctx, keys, keylen) \ + // SSL_CTX_ctrl(ctx,SSL_CTRL_GET_TLSEXT_TICKET_KEYS,keylen,keys) + //# define SSL_CTX_set_tlsext_ticket_keys(ctx, keys, keylen) \ + // SSL_CTX_ctrl(ctx,SSL_CTRL_SET_TLSEXT_TICKET_KEYS,keylen,keys) + // + //# define SSL_CTX_get_tlsext_status_cb(ssl, cb) \ + // SSL_CTX_ctrl(ssl,SSL_CTRL_GET_TLSEXT_STATUS_REQ_CB,0,(void *)cb) + //# define SSL_CTX_set_tlsext_status_cb(ssl, cb) \ + // SSL_CTX_callback_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB,\ + // (void (*)(void))cb) + + //# define SSL_CTX_get_tlsext_status_arg(ssl, arg) \ + // SSL_CTX_ctrl(ssl,SSL_CTRL_GET_TLSEXT_STATUS_REQ_CB_ARG,0,arg) + //# define SSL_CTX_set_tlsext_status_arg(ssl, arg) \ + // SSL_CTX_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB_ARG,0,arg) + // + //# define SSL_CTX_set_tlsext_status_type(ssl, type) \ + // SSL_CTX_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_TYPE,type,NULL) + // + //# define SSL_CTX_get_tlsext_status_type(ssl) \ + // SSL_CTX_ctrl(ssl,SSL_CTRL_GET_TLSEXT_STATUS_REQ_TYPE,0,NULL) + // + //# define SSL_CTX_set_tlsext_ticket_key_cb(ssl, cb) \ + // SSL_CTX_callback_ctrl(ssl,SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB,\ + // (void (*)(void))cb) + +function SSL_set_tlsext_host_name(s: PSSL; const name: PIdAnsiChar): TIdC_LONG; {removed 1.0.0} +{$ENDIF} + +implementation + +uses + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + classes, + IdSSLOpenSSLLoader, + {$ENDIF} + IdSSLOpenSSLExceptionHandlers, + IdResourceStringsOpenSSL, + + IdOpenSSLHeaders_ssl; + +const + SSL_CTX_set_tlsext_max_fragment_length_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_set_tlsext_max_fragment_length_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_export_keying_material_early_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_get_peer_signature_type_nid_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_get_signature_type_nid_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + SSL_set_tlsext_host_name_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + + +//# define SSL_set_tlsext_host_name(s,name) SSL_ctrl(s,SSL_CTRL_SET_TLSEXT_HOSTNAME,TLSEXT_NAMETYPE_host_name, (void *)name) +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +const + SSL_set_tlsext_host_name_procname = 'SSL_set_tlsext_host_name'; {removed 1.0.0} + + SSL_CTX_set_tlsext_max_fragment_length_procname = 'SSL_CTX_set_tlsext_max_fragment_length'; {introduced 1.1.0} + SSL_set_tlsext_max_fragment_length_procname = 'SSL_set_tlsext_max_fragment_length'; {introduced 1.1.0} + + SSL_get_servername_procname = 'SSL_get_servername'; + SSL_get_servername_type_procname = 'SSL_get_servername_type'; + (* + * SSL_export_keying_material exports a value derived from the master secret, + * as specified in RFC 5705. It writes |olen| bytes to |out| given a label and + * optional context. (Since a zero length context is allowed, the |use_context| + * flag controls whether a context is included.) It returns 1 on success and + * 0 or -1 otherwise. + *) + SSL_export_keying_material_procname = 'SSL_export_keying_material'; + + (* + * SSL_export_keying_material_early exports a value derived from the + * early exporter master secret, as specified in + * https://tools.ietf.org/html/draft-ietf-tls-tls13-23. It writes + * |olen| bytes to |out| given a label and optional context. It + * returns 1 on success and 0 otherwise. + *) + SSL_export_keying_material_early_procname = 'SSL_export_keying_material_early'; {introduced 1.1.0} + + SSL_get_peer_signature_type_nid_procname = 'SSL_get_peer_signature_type_nid'; {introduced 1.1.0} + SSL_get_signature_type_nid_procname = 'SSL_get_signature_type_nid'; {introduced 1.1.0} + SSL_get_sigalgs_procname = 'SSL_get_sigalgs'; + SSL_get_shared_sigalgs_procname = 'SSL_get_shared_sigalgs'; + + //__owur TIdC_INT SSL_check_chain(s: PSSL, X509 *x, EVP_PKEY *pk, STACK_OF(X509) *chain); + + //# define SSL_set_tlsext_debug_callback(ssl, cb) \ + // SSL_callback_ctrl(ssl,SSL_CTRL_SET_TLSEXT_DEBUG_CB,\ + // (void (*)(void))cb) + + //# define SSL_set_tlsext_debug_arg(ssl, arg) \ + // SSL_ctrl(ssl,SSL_CTRL_SET_TLSEXT_DEBUG_ARG,0,arg) + // + //# define SSL_get_tlsext_status_type(ssl) \ + // SSL_ctrl(ssl,SSL_CTRL_GET_TLSEXT_STATUS_REQ_TYPE,0,NULL) + // + //# define SSL_set_tlsext_status_type(ssl, type) \ + // SSL_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_TYPE,type,NULL) + // + //# define SSL_get_tlsext_status_exts(ssl, arg) \ + // SSL_ctrl(ssl,SSL_CTRL_GET_TLSEXT_STATUS_REQ_EXTS,0,arg) + // + //# define SSL_set_tlsext_status_exts(ssl, arg) \ + // SSL_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_EXTS,0,arg) + // + //# define SSL_get_tlsext_status_ids(ssl, arg) \ + // SSL_ctrl(ssl,SSL_CTRL_GET_TLSEXT_STATUS_REQ_IDS,0,arg) + // + //# define SSL_set_tlsext_status_ids(ssl, arg) \ + // SSL_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_IDS,0,arg) + // + //# define SSL_get_tlsext_status_ocsp_resp(ssl, arg) \ + // SSL_ctrl(ssl,SSL_CTRL_GET_TLSEXT_STATUS_REQ_OCSP_RESP,0,arg) + // + //# define SSL_set_tlsext_status_ocsp_resp(ssl, arg, arglen) \ + // SSL_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_OCSP_RESP,arglen,arg) + // + //# define SSL_CTX_set_tlsext_servername_callback(ctx, cb) \ + // SSL_CTX_callback_ctrl(ctx,SSL_CTRL_SET_TLSEXT_SERVERNAME_CB,\ + // (void (*)(void))cb) + + //# define SSL_CTX_set_tlsext_servername_arg(ctx, arg) \ + // SSL_CTX_ctrl(ctx,SSL_CTRL_SET_TLSEXT_SERVERNAME_ARG,0,arg) + // + //# define SSL_CTX_get_tlsext_ticket_keys(ctx, keys, keylen) \ + // SSL_CTX_ctrl(ctx,SSL_CTRL_GET_TLSEXT_TICKET_KEYS,keylen,keys) + //# define SSL_CTX_set_tlsext_ticket_keys(ctx, keys, keylen) \ + // SSL_CTX_ctrl(ctx,SSL_CTRL_SET_TLSEXT_TICKET_KEYS,keylen,keys) + // + //# define SSL_CTX_get_tlsext_status_cb(ssl, cb) \ + // SSL_CTX_ctrl(ssl,SSL_CTRL_GET_TLSEXT_STATUS_REQ_CB,0,(void *)cb) + //# define SSL_CTX_set_tlsext_status_cb(ssl, cb) \ + // SSL_CTX_callback_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB,\ + // (void (*)(void))cb) + + //# define SSL_CTX_get_tlsext_status_arg(ssl, arg) \ + // SSL_CTX_ctrl(ssl,SSL_CTRL_GET_TLSEXT_STATUS_REQ_CB_ARG,0,arg) + //# define SSL_CTX_set_tlsext_status_arg(ssl, arg) \ + // SSL_CTX_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB_ARG,0,arg) + // + //# define SSL_CTX_set_tlsext_status_type(ssl, type) \ + // SSL_CTX_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_TYPE,type,NULL) + // + //# define SSL_CTX_get_tlsext_status_type(ssl) \ + // SSL_CTX_ctrl(ssl,SSL_CTRL_GET_TLSEXT_STATUS_REQ_TYPE,0,NULL) + // + //# define SSL_CTX_set_tlsext_ticket_key_cb(ssl, cb) \ + // SSL_CTX_callback_ctrl(ssl,SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB,\ + // (void (*)(void))cb) + + + +//# define SSL_set_tlsext_host_name(s,name) SSL_ctrl(s,SSL_CTRL_SET_TLSEXT_HOSTNAME,TLSEXT_NAMETYPE_host_name, (void *)name) +function _SSL_set_tlsext_host_name(s: PSSL; const name: PIdAnsiChar): TIdC_LONG; cdecl; +begin + Result := SSL_ctrl(s, SSL_CTRL_SET_TLSEXT_HOSTNAME, TLSEXT_NAMETYPE_host_name, Pointer(name)); +end; + +{$WARN NO_RETVAL OFF} +function ERR_SSL_set_tlsext_host_name(s: PSSL; const name: PIdAnsiChar): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_set_tlsext_host_name_procname); +end; + + + +function ERR_SSL_CTX_set_tlsext_max_fragment_length(ctx: PSSL_CTx; mode: TIdC_UINT8): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_CTX_set_tlsext_max_fragment_length_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_set_tlsext_max_fragment_length(ssl: PSSL; mode: TIdC_UINT8): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_set_tlsext_max_fragment_length_procname); +end; + + {introduced 1.1.0} + +function ERR_SSL_get_servername(const s: PSSL; const type_: TIdC_INT): PIdAnsiChar; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_get_servername_procname); +end; + + +function ERR_SSL_get_servername_type(const s: PSSL): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_get_servername_type_procname); +end; + + + (* + * SSL_export_keying_material exports a value derived from the master secret, + * as specified in RFC 5705. It writes |olen| bytes to |out| given a label and + * optional context. (Since a zero length context is allowed, the |use_context| + * flag controls whether a context is included.) It returns 1 on success and + * 0 or -1 otherwise. + *) +function ERR_SSL_export_keying_material(s: PSSL; out_: PByte; olen: TIdC_SIZET; const label_: PIdAnsiChar; llen: TIdC_SIZET; const context: PByte; contextlen: TIdC_SIZET; use_context: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_export_keying_material_procname); +end; + + + + (* + * SSL_export_keying_material_early exports a value derived from the + * early exporter master secret, as specified in + * https://tools.ietf.org/html/draft-ietf-tls-tls13-23. It writes + * |olen| bytes to |out| given a label and optional context. It + * returns 1 on success and 0 otherwise. + *) +function ERR_SSL_export_keying_material_early(s: PSSL; out_: PByte; olen: TIdC_SIZET; const label_: PIdAnsiChar; llen: TIdC_SIZET; const context: PByte; contextlen: TIdC_SIZET): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_export_keying_material_early_procname); +end; + + {introduced 1.1.0} + +function ERR_SSL_get_peer_signature_type_nid(const s: PSSl; pnid: PIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_get_peer_signature_type_nid_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_get_signature_type_nid(const s: PSSl; pnid: PIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_get_signature_type_nid_procname); +end; + + {introduced 1.1.0} +function ERR_SSL_get_sigalgs(s: PSSl; idx: TIdC_INT; psign: PIdC_INT; phash: PIdC_INT; psignandhash: PIdC_INT; rsig: PByte; rhash: PByte): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_get_sigalgs_procname); +end; + + +function ERR_SSL_get_shared_sigalgs(s: PSSl; idx: TIdC_INT; psign: PIdC_INT; phash: PIdC_INT; psignandhash: PIdC_INT; rsig: PByte; rhash: PByte): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(SSL_get_shared_sigalgs_procname); +end; + + + + //__owur TIdC_INT SSL_check_chain(s: PSSL, X509 *x, EVP_PKEY *pk, STACK_OF(X509) *chain); + + //# define SSL_set_tlsext_debug_callback(ssl, cb) \ + // SSL_callback_ctrl(ssl,SSL_CTRL_SET_TLSEXT_DEBUG_CB,\ + // (void (*)(void))cb) + + //# define SSL_set_tlsext_debug_arg(ssl, arg) \ + // SSL_ctrl(ssl,SSL_CTRL_SET_TLSEXT_DEBUG_ARG,0,arg) + // + //# define SSL_get_tlsext_status_type(ssl) \ + // SSL_ctrl(ssl,SSL_CTRL_GET_TLSEXT_STATUS_REQ_TYPE,0,NULL) + // + //# define SSL_set_tlsext_status_type(ssl, type) \ + // SSL_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_TYPE,type,NULL) + // + //# define SSL_get_tlsext_status_exts(ssl, arg) \ + // SSL_ctrl(ssl,SSL_CTRL_GET_TLSEXT_STATUS_REQ_EXTS,0,arg) + // + //# define SSL_set_tlsext_status_exts(ssl, arg) \ + // SSL_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_EXTS,0,arg) + // + //# define SSL_get_tlsext_status_ids(ssl, arg) \ + // SSL_ctrl(ssl,SSL_CTRL_GET_TLSEXT_STATUS_REQ_IDS,0,arg) + // + //# define SSL_set_tlsext_status_ids(ssl, arg) \ + // SSL_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_IDS,0,arg) + // + //# define SSL_get_tlsext_status_ocsp_resp(ssl, arg) \ + // SSL_ctrl(ssl,SSL_CTRL_GET_TLSEXT_STATUS_REQ_OCSP_RESP,0,arg) + // + //# define SSL_set_tlsext_status_ocsp_resp(ssl, arg, arglen) \ + // SSL_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_OCSP_RESP,arglen,arg) + // + //# define SSL_CTX_set_tlsext_servername_callback(ctx, cb) \ + // SSL_CTX_callback_ctrl(ctx,SSL_CTRL_SET_TLSEXT_SERVERNAME_CB,\ + // (void (*)(void))cb) + + //# define SSL_CTX_set_tlsext_servername_arg(ctx, arg) \ + // SSL_CTX_ctrl(ctx,SSL_CTRL_SET_TLSEXT_SERVERNAME_ARG,0,arg) + // + //# define SSL_CTX_get_tlsext_ticket_keys(ctx, keys, keylen) \ + // SSL_CTX_ctrl(ctx,SSL_CTRL_GET_TLSEXT_TICKET_KEYS,keylen,keys) + //# define SSL_CTX_set_tlsext_ticket_keys(ctx, keys, keylen) \ + // SSL_CTX_ctrl(ctx,SSL_CTRL_SET_TLSEXT_TICKET_KEYS,keylen,keys) + // + //# define SSL_CTX_get_tlsext_status_cb(ssl, cb) \ + // SSL_CTX_ctrl(ssl,SSL_CTRL_GET_TLSEXT_STATUS_REQ_CB,0,(void *)cb) + //# define SSL_CTX_set_tlsext_status_cb(ssl, cb) \ + // SSL_CTX_callback_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB,\ + // (void (*)(void))cb) + + //# define SSL_CTX_get_tlsext_status_arg(ssl, arg) \ + // SSL_CTX_ctrl(ssl,SSL_CTRL_GET_TLSEXT_STATUS_REQ_CB_ARG,0,arg) + //# define SSL_CTX_set_tlsext_status_arg(ssl, arg) \ + // SSL_CTX_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB_ARG,0,arg) + // + //# define SSL_CTX_set_tlsext_status_type(ssl, type) \ + // SSL_CTX_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_TYPE,type,NULL) + // + //# define SSL_CTX_get_tlsext_status_type(ssl) \ + // SSL_CTX_ctrl(ssl,SSL_CTRL_GET_TLSEXT_STATUS_REQ_TYPE,0,NULL) + // + //# define SSL_CTX_set_tlsext_ticket_key_cb(ssl, cb) \ + // SSL_CTX_callback_ctrl(ssl,SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB,\ + // (void (*)(void))cb) + +{$WARN NO_RETVAL ON} + +procedure Load(const ADllHandle: TIdLibHandle; LibVersion: TIdC_UINT; const AFailed: TStringList); + +var FuncLoadError: boolean; + +begin + SSL_set_tlsext_host_name := LoadLibFunction(ADllHandle, SSL_set_tlsext_host_name_procname); + FuncLoadError := not assigned(SSL_set_tlsext_host_name); + if FuncLoadError then + begin + {$if not defined(SSL_set_tlsext_host_name_allownil)} + SSL_set_tlsext_host_name := @ERR_SSL_set_tlsext_host_name; + {$ifend} + {$if declared(SSL_set_tlsext_host_name_introduced)} + if LibVersion < SSL_set_tlsext_host_name_introduced then + begin + {$if declared(FC_SSL_set_tlsext_host_name)} + SSL_set_tlsext_host_name := @FC_SSL_set_tlsext_host_name; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_set_tlsext_host_name_removed)} + if SSL_set_tlsext_host_name_removed <= LibVersion then + begin + {$if declared(_SSL_set_tlsext_host_name)} + SSL_set_tlsext_host_name := @_SSL_set_tlsext_host_name; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_set_tlsext_host_name_allownil)} + if FuncLoadError then + AFailed.Add('SSL_set_tlsext_host_name'); + {$ifend} + end; + + + SSL_CTX_set_tlsext_max_fragment_length := LoadLibFunction(ADllHandle, SSL_CTX_set_tlsext_max_fragment_length_procname); + FuncLoadError := not assigned(SSL_CTX_set_tlsext_max_fragment_length); + if FuncLoadError then + begin + {$if not defined(SSL_CTX_set_tlsext_max_fragment_length_allownil)} + SSL_CTX_set_tlsext_max_fragment_length := @ERR_SSL_CTX_set_tlsext_max_fragment_length; + {$ifend} + {$if declared(SSL_CTX_set_tlsext_max_fragment_length_introduced)} + if LibVersion < SSL_CTX_set_tlsext_max_fragment_length_introduced then + begin + {$if declared(FC_SSL_CTX_set_tlsext_max_fragment_length)} + SSL_CTX_set_tlsext_max_fragment_length := @FC_SSL_CTX_set_tlsext_max_fragment_length; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_CTX_set_tlsext_max_fragment_length_removed)} + if SSL_CTX_set_tlsext_max_fragment_length_removed <= LibVersion then + begin + {$if declared(_SSL_CTX_set_tlsext_max_fragment_length)} + SSL_CTX_set_tlsext_max_fragment_length := @_SSL_CTX_set_tlsext_max_fragment_length; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_CTX_set_tlsext_max_fragment_length_allownil)} + if FuncLoadError then + AFailed.Add('SSL_CTX_set_tlsext_max_fragment_length'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_set_tlsext_max_fragment_length := LoadLibFunction(ADllHandle, SSL_set_tlsext_max_fragment_length_procname); + FuncLoadError := not assigned(SSL_set_tlsext_max_fragment_length); + if FuncLoadError then + begin + {$if not defined(SSL_set_tlsext_max_fragment_length_allownil)} + SSL_set_tlsext_max_fragment_length := @ERR_SSL_set_tlsext_max_fragment_length; + {$ifend} + {$if declared(SSL_set_tlsext_max_fragment_length_introduced)} + if LibVersion < SSL_set_tlsext_max_fragment_length_introduced then + begin + {$if declared(FC_SSL_set_tlsext_max_fragment_length)} + SSL_set_tlsext_max_fragment_length := @FC_SSL_set_tlsext_max_fragment_length; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_set_tlsext_max_fragment_length_removed)} + if SSL_set_tlsext_max_fragment_length_removed <= LibVersion then + begin + {$if declared(_SSL_set_tlsext_max_fragment_length)} + SSL_set_tlsext_max_fragment_length := @_SSL_set_tlsext_max_fragment_length; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_set_tlsext_max_fragment_length_allownil)} + if FuncLoadError then + AFailed.Add('SSL_set_tlsext_max_fragment_length'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_get_servername := LoadLibFunction(ADllHandle, SSL_get_servername_procname); + FuncLoadError := not assigned(SSL_get_servername); + if FuncLoadError then + begin + {$if not defined(SSL_get_servername_allownil)} + SSL_get_servername := @ERR_SSL_get_servername; + {$ifend} + {$if declared(SSL_get_servername_introduced)} + if LibVersion < SSL_get_servername_introduced then + begin + {$if declared(FC_SSL_get_servername)} + SSL_get_servername := @FC_SSL_get_servername; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_get_servername_removed)} + if SSL_get_servername_removed <= LibVersion then + begin + {$if declared(_SSL_get_servername)} + SSL_get_servername := @_SSL_get_servername; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_get_servername_allownil)} + if FuncLoadError then + AFailed.Add('SSL_get_servername'); + {$ifend} + end; + + + SSL_get_servername_type := LoadLibFunction(ADllHandle, SSL_get_servername_type_procname); + FuncLoadError := not assigned(SSL_get_servername_type); + if FuncLoadError then + begin + {$if not defined(SSL_get_servername_type_allownil)} + SSL_get_servername_type := @ERR_SSL_get_servername_type; + {$ifend} + {$if declared(SSL_get_servername_type_introduced)} + if LibVersion < SSL_get_servername_type_introduced then + begin + {$if declared(FC_SSL_get_servername_type)} + SSL_get_servername_type := @FC_SSL_get_servername_type; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_get_servername_type_removed)} + if SSL_get_servername_type_removed <= LibVersion then + begin + {$if declared(_SSL_get_servername_type)} + SSL_get_servername_type := @_SSL_get_servername_type; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_get_servername_type_allownil)} + if FuncLoadError then + AFailed.Add('SSL_get_servername_type'); + {$ifend} + end; + + + SSL_export_keying_material := LoadLibFunction(ADllHandle, SSL_export_keying_material_procname); + FuncLoadError := not assigned(SSL_export_keying_material); + if FuncLoadError then + begin + {$if not defined(SSL_export_keying_material_allownil)} + SSL_export_keying_material := @ERR_SSL_export_keying_material; + {$ifend} + {$if declared(SSL_export_keying_material_introduced)} + if LibVersion < SSL_export_keying_material_introduced then + begin + {$if declared(FC_SSL_export_keying_material)} + SSL_export_keying_material := @FC_SSL_export_keying_material; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_export_keying_material_removed)} + if SSL_export_keying_material_removed <= LibVersion then + begin + {$if declared(_SSL_export_keying_material)} + SSL_export_keying_material := @_SSL_export_keying_material; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_export_keying_material_allownil)} + if FuncLoadError then + AFailed.Add('SSL_export_keying_material'); + {$ifend} + end; + + + SSL_export_keying_material_early := LoadLibFunction(ADllHandle, SSL_export_keying_material_early_procname); + FuncLoadError := not assigned(SSL_export_keying_material_early); + if FuncLoadError then + begin + {$if not defined(SSL_export_keying_material_early_allownil)} + SSL_export_keying_material_early := @ERR_SSL_export_keying_material_early; + {$ifend} + {$if declared(SSL_export_keying_material_early_introduced)} + if LibVersion < SSL_export_keying_material_early_introduced then + begin + {$if declared(FC_SSL_export_keying_material_early)} + SSL_export_keying_material_early := @FC_SSL_export_keying_material_early; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_export_keying_material_early_removed)} + if SSL_export_keying_material_early_removed <= LibVersion then + begin + {$if declared(_SSL_export_keying_material_early)} + SSL_export_keying_material_early := @_SSL_export_keying_material_early; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_export_keying_material_early_allownil)} + if FuncLoadError then + AFailed.Add('SSL_export_keying_material_early'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_get_peer_signature_type_nid := LoadLibFunction(ADllHandle, SSL_get_peer_signature_type_nid_procname); + FuncLoadError := not assigned(SSL_get_peer_signature_type_nid); + if FuncLoadError then + begin + {$if not defined(SSL_get_peer_signature_type_nid_allownil)} + SSL_get_peer_signature_type_nid := @ERR_SSL_get_peer_signature_type_nid; + {$ifend} + {$if declared(SSL_get_peer_signature_type_nid_introduced)} + if LibVersion < SSL_get_peer_signature_type_nid_introduced then + begin + {$if declared(FC_SSL_get_peer_signature_type_nid)} + SSL_get_peer_signature_type_nid := @FC_SSL_get_peer_signature_type_nid; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_get_peer_signature_type_nid_removed)} + if SSL_get_peer_signature_type_nid_removed <= LibVersion then + begin + {$if declared(_SSL_get_peer_signature_type_nid)} + SSL_get_peer_signature_type_nid := @_SSL_get_peer_signature_type_nid; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_get_peer_signature_type_nid_allownil)} + if FuncLoadError then + AFailed.Add('SSL_get_peer_signature_type_nid'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_get_signature_type_nid := LoadLibFunction(ADllHandle, SSL_get_signature_type_nid_procname); + FuncLoadError := not assigned(SSL_get_signature_type_nid); + if FuncLoadError then + begin + {$if not defined(SSL_get_signature_type_nid_allownil)} + SSL_get_signature_type_nid := @ERR_SSL_get_signature_type_nid; + {$ifend} + {$if declared(SSL_get_signature_type_nid_introduced)} + if LibVersion < SSL_get_signature_type_nid_introduced then + begin + {$if declared(FC_SSL_get_signature_type_nid)} + SSL_get_signature_type_nid := @FC_SSL_get_signature_type_nid; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_get_signature_type_nid_removed)} + if SSL_get_signature_type_nid_removed <= LibVersion then + begin + {$if declared(_SSL_get_signature_type_nid)} + SSL_get_signature_type_nid := @_SSL_get_signature_type_nid; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_get_signature_type_nid_allownil)} + if FuncLoadError then + AFailed.Add('SSL_get_signature_type_nid'); + {$ifend} + end; + + {introduced 1.1.0} + SSL_get_sigalgs := LoadLibFunction(ADllHandle, SSL_get_sigalgs_procname); + FuncLoadError := not assigned(SSL_get_sigalgs); + if FuncLoadError then + begin + {$if not defined(SSL_get_sigalgs_allownil)} + SSL_get_sigalgs := @ERR_SSL_get_sigalgs; + {$ifend} + {$if declared(SSL_get_sigalgs_introduced)} + if LibVersion < SSL_get_sigalgs_introduced then + begin + {$if declared(FC_SSL_get_sigalgs)} + SSL_get_sigalgs := @FC_SSL_get_sigalgs; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_get_sigalgs_removed)} + if SSL_get_sigalgs_removed <= LibVersion then + begin + {$if declared(_SSL_get_sigalgs)} + SSL_get_sigalgs := @_SSL_get_sigalgs; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_get_sigalgs_allownil)} + if FuncLoadError then + AFailed.Add('SSL_get_sigalgs'); + {$ifend} + end; + + + SSL_get_shared_sigalgs := LoadLibFunction(ADllHandle, SSL_get_shared_sigalgs_procname); + FuncLoadError := not assigned(SSL_get_shared_sigalgs); + if FuncLoadError then + begin + {$if not defined(SSL_get_shared_sigalgs_allownil)} + SSL_get_shared_sigalgs := @ERR_SSL_get_shared_sigalgs; + {$ifend} + {$if declared(SSL_get_shared_sigalgs_introduced)} + if LibVersion < SSL_get_shared_sigalgs_introduced then + begin + {$if declared(FC_SSL_get_shared_sigalgs)} + SSL_get_shared_sigalgs := @FC_SSL_get_shared_sigalgs; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(SSL_get_shared_sigalgs_removed)} + if SSL_get_shared_sigalgs_removed <= LibVersion then + begin + {$if declared(_SSL_get_shared_sigalgs)} + SSL_get_shared_sigalgs := @_SSL_get_shared_sigalgs; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(SSL_get_shared_sigalgs_allownil)} + if FuncLoadError then + AFailed.Add('SSL_get_shared_sigalgs'); + {$ifend} + end; + + +end; + +procedure Unload; +begin + SSL_set_tlsext_host_name := nil; {removed 1.0.0} + SSL_CTX_set_tlsext_max_fragment_length := nil; {introduced 1.1.0} + SSL_set_tlsext_max_fragment_length := nil; {introduced 1.1.0} + SSL_get_servername := nil; + SSL_get_servername_type := nil; + SSL_export_keying_material := nil; + SSL_export_keying_material_early := nil; {introduced 1.1.0} + SSL_get_peer_signature_type_nid := nil; {introduced 1.1.0} + SSL_get_signature_type_nid := nil; {introduced 1.1.0} + SSL_get_sigalgs := nil; + SSL_get_shared_sigalgs := nil; +end; +{$ELSE} +function SSL_set_tlsext_host_name(s: PSSL; const name: PIdAnsiChar): TIdC_LONG; +begin + Result := SSL_ctrl(s, SSL_CTRL_SET_TLSEXT_HOSTNAME, TLSEXT_NAMETYPE_host_name, Pointer(name)); +end; + +{$ENDIF} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +initialization + Register_SSLLoader(@Load,'LibSSL'); + Register_SSLUnloader(@Unload); +{$ENDIF} +end. diff --git a/IdOpenSSLHeaders_ts.pas b/IdOpenSSLHeaders_ts.pas new file mode 100644 index 0000000..3d8ce03 --- /dev/null +++ b/IdOpenSSLHeaders_ts.pas @@ -0,0 +1,8944 @@ + (* This unit was generated using the script genOpenSSLHdrs.sh from the source file IdOpenSSLHeaders_ts.h2pas + It should not be modified directly. All changes should be made to IdOpenSSLHeaders_ts.h2pas + and this file regenerated. IdOpenSSLHeaders_ts.h2pas is distributed with the full Indy + Distribution. + *) + +{$i IdCompilerDefines.inc} +{$i IdSSLOpenSSLDefines.inc} +{$IFNDEF USE_OPENSSL} + { error Should not compile if USE_OPENSSL is not defined!!!} +{$ENDIF} +{******************************************************************************} +{ } +{ Indy (Internet Direct) - Internet Protocols Simplified } +{ } +{ https://www.indyproject.org/ } +{ https://gitter.im/IndySockets/Indy } +{ } +{******************************************************************************} +{ } +{ This file is part of the Indy (Internet Direct) project, and is offered } +{ under the dual-licensing agreement described on the Indy website. } +{ (https://www.indyproject.org/license/) } +{ } +{ Copyright: } +{ (c) 1993-2020, Chad Z. Hower and the Indy Pit Crew. All rights reserved. } +{ } +{******************************************************************************} +{ } +{ } +{******************************************************************************} + +unit IdOpenSSLHeaders_ts; + +interface + +// Headers for OpenSSL 1.1.1 +// ts.h + + +uses + IdCTypes, + IdGlobal, + IdSSLOpenSSLConsts, + IdOpenSSLHeaders_asn1, + IdOpenSSLHeaders_bio, + IdOpenSSLHeaders_ossl_typ, + IdOpenSSLHeaders_pkcs7, + IdOpenSSLHeaders_rsa, + IdOpenSSLHeaders_tserr, + IdOpenSSLHeaders_x509, + IdOpenSSLHeaders_x509v3; + +const + (* Possible values for status. *) + TS_STATUS_GRANTED = 0; + TS_STATUS_GRANTED_WITH_MODS = 1; + TS_STATUS_REJECTION = 2; + TS_STATUS_WAITING = 3; + TS_STATUS_REVOCATION_WARNING = 4; + TS_STATUS_REVOCATION_NOTIFICATION = 5; + + + (* Possible values for failure_info. *) + TS_INFO_BAD_ALG = 0; + TS_INFO_BAD_REQUEST = 2; + TS_INFO_BAD_DATA_FORMAT = 5; + TS_INFO_TIME_NOT_AVAILABLE = 14; + TS_INFO_UNACCEPTED_POLICY = 15; + TS_INFO_UNACCEPTED_EXTENSION = 16; + TS_INFO_ADD_INFO_NOT_AVAILABLE = 17; + TS_INFO_SYSTEM_FAILURE = 25; + + (* Optional flags for response generation. *) + + (* Don't include the TSA name in response. *) + TS_TSA_NAME = $01; + + (* Set ordering to true in response. *) + TS_ORDERING = $02; + + (* + * Include the signer certificate and the other specified certificates in + * the ESS signing certificate attribute beside the PKCS7 signed data. + * Only the signer certificates is included by default. + *) + TS_ESS_CERT_ID_CHAIN = $04; + + (* At most we accept usec precision. *) + TS_MAX_CLOCK_PRECISION_DIGITS = 6; + + (* Maximum status message length *) + TS_MAX_STATUS_LENGTH = 1024 * 1024; + + (* Verify the signer's certificate and the signature of the response. *) + TS_VFY_SIGNATURE = TIdC_UINT(1) shl 0; + (* Verify the version number of the response. *) + TS_VFY_VERSION = TIdC_UINT(1) shl 1; + (* Verify if the policy supplied by the user matches the policy of the TSA. *) + TS_VFY_POLICY = TIdC_UINT(1) shl 2; + (* + * Verify the message imprint provided by the user. This flag should not be + * specified with TS_VFY_DATA. + *) + TS_VFY_IMPRINT = TIdC_UINT(1) shl 3; + (* + * Verify the message imprint computed by the verify method from the user + * provided data and the MD algorithm of the response. This flag should not + * be specified with TS_VFY_IMPRINT. + *) + TS_VFY_DATA = TIdC_UINT(1) shl 4; + (* Verify the nonce value. *) + TS_VFY_NONCE = TIdC_UINT(1) shl 5; + (* Verify if the TSA name field matches the signer certificate. *) + TS_VFY_SIGNER = TIdC_UINT(1) shl 6; + (* Verify if the TSA name field equals to the user provided name. *) + TS_VFY_TSA_NAME = TIdC_UINT(1) shl 7; + + (* You can use the following convenience constants. *) + TS_VFY_ALL_IMPRINT = TS_VFY_SIGNATURE or TS_VFY_VERSION or TS_VFY_POLICY + or TS_VFY_IMPRINT or TS_VFY_NONCE or TS_VFY_SIGNER or TS_VFY_TSA_NAME; + + TS_VFY_ALL_DATA = TS_VFY_SIGNATURE or TS_VFY_VERSION or TS_VFY_POLICY + or TS_VFY_DATA or TS_VFY_NONCE or TS_VFY_SIGNER or TS_VFY_TSA_NAME; + +type + TS_msg_imprint_st = type Pointer; + TS_req_st = type Pointer; + TS_accuracy_st = type Pointer; + TS_tst_info_st = type Pointer; + + TS_MSG_IMPRINT = TS_msg_imprint_st; + PTS_MSG_IMPRINT = ^TS_MSG_IMPRINT; + PPTS_MSG_IMPRINT = ^PTS_MSG_IMPRINT; + + TS_REQ = TS_req_st; + PTS_REQ = ^TS_REQ; + PPTS_REQ = ^PTS_REQ; + + TS_ACCURACY = TS_accuracy_st; + PTS_ACCURACY = ^TS_ACCURACY; + PPTS_ACCURACY = ^PTS_ACCURACY; + + TS_TST_INFO = TS_tst_info_st; + PTS_TST_INFO = ^TS_TST_INFO; + PPTS_TST_INFO = ^PTS_TST_INFO; + + TS_status_info_st = type Pointer; + ESS_issuer_serial_st = type Pointer; + ESS_cert_id_st = type Pointer; + ESS_signing_cert_st = type Pointer; + ESS_cert_id_v2_st = type Pointer; + ESS_signing_cert_v2_st = type Pointer; + + TS_STATUS_INFO = TS_status_info_st; + PTS_STATUS_INFO = ^TS_STATUS_INFO; + PPTS_STATUS_INFO = ^PTS_STATUS_INFO; + + ESS_ISSUER_SERIAL = ESS_issuer_serial_st; + PESS_ISSUER_SERIAL = ^ESS_ISSUER_SERIAL; + PPESS_ISSUER_SERIAL = ^PESS_ISSUER_SERIAL; + + ESS_CERT_ID = ESS_cert_id_st; + PESS_CERT_ID = ^ESS_CERT_ID; + PPESS_CERT_ID = ^PESS_CERT_ID; + + ESS_SIGNING_CERT = ESS_signing_cert_st; + PESS_SIGNING_CERT = ^ESS_SIGNING_CERT; + PPESS_SIGNING_CERT = ^PESS_SIGNING_CERT; + +// DEFINE_STACK_OF(ESS_CERT_ID) + + ESS_CERT_ID_V2 = ESS_cert_id_v2_st; + PESS_CERT_ID_V2 = ^ESS_CERT_ID_V2; + PPESS_CERT_ID_V2 = ^PESS_CERT_ID_V2; + + ESS_SIGNING_CERT_V2 = ESS_signing_cert_v2_st; + PESS_SIGNING_CERT_V2 = ^ESS_SIGNING_CERT_V2; + PPESS_SIGNING_CERT_V2 = ^PESS_SIGNING_CERT_V2; + +// DEFINE_STACK_OF(ESS_CERT_ID_V2) + TS_resp_st = type Pointer; + TS_RESP = TS_resp_st; + PTS_RESP = ^TS_RESP; + PPTS_RESP = ^PTS_RESP; + + (* Forward declaration. *) + TS_resp_ctx = type Pointer; + PTS_resp_ctx = ^TS_resp_ctx; + PPTS_resp_ctx = ^PTS_resp_ctx; + + (* This must return a unique number less than 160 bits long. *) + TS_serial_cb = function({struct} v1: PTS_resp_ctx; v2: Pointer): PASN1_INTEGER; + + (* + * This must return the seconds and microseconds since Jan 1, 1970 in the sec + * and usec variables allocated by the caller. Return non-zero for success + * and zero for failure. + *) + TS_time_cb = function({struct} v1: PTS_resp_ctx; v2: Pointer; sec: PIdC_LONG; usec: PIdC_LONG): TIdC_INT; + + (* + * This must process the given extension. It can modify the TS_TST_INFO + * object of the context. Return values: !0 (processed), 0 (error, it must + * set the status info/failure info of the response). + *) + TS_extension_cb = function({struct} v1: PTS_resp_ctx; v2: PX509_Extension; v3: Pointer): TIdC_INT; + +// TS_VERIFY_CTX = TS_verify_ctx; + TS_VERIFY_CTX = type Pointer; + PTS_VERIFY_CTX = ^TS_VERIFY_CTX; + + { The EXTERNALSYM directive is ignored by FPC, however, it is used by Delphi as follows: + + The EXTERNALSYM directive prevents the specified Delphi symbol from appearing in header + files generated for C++. } + + {$EXTERNALSYM TS_REQ_new} + {$EXTERNALSYM TS_REQ_free} + {$EXTERNALSYM i2d_TS_REQ} + {$EXTERNALSYM d2i_TS_REQ} + {$EXTERNALSYM TS_REQ_dup} + {$EXTERNALSYM d2i_TS_REQ_bio} + {$EXTERNALSYM i2d_TS_REQ_bio} + {$EXTERNALSYM TS_MSG_IMPRINT_new} + {$EXTERNALSYM TS_MSG_IMPRINT_free} + {$EXTERNALSYM i2d_TS_MSG_IMPRINT} + {$EXTERNALSYM d2i_TS_MSG_IMPRINT} + {$EXTERNALSYM TS_MSG_IMPRINT_dup} + {$EXTERNALSYM d2i_TS_MSG_IMPRINT_bio} + {$EXTERNALSYM i2d_TS_MSG_IMPRINT_bio} + {$EXTERNALSYM TS_RESP_new} + {$EXTERNALSYM TS_RESP_free} + {$EXTERNALSYM i2d_TS_RESP} + {$EXTERNALSYM d2i_TS_RESP} + {$EXTERNALSYM PKCS7_to_TS_TST_INFO} + {$EXTERNALSYM TS_RESP_dup} + {$EXTERNALSYM d2i_TS_RESP_bio} + {$EXTERNALSYM i2d_TS_RESP_bio} + {$EXTERNALSYM TS_STATUS_INFO_new} + {$EXTERNALSYM TS_STATUS_INFO_free} + {$EXTERNALSYM i2d_TS_STATUS_INFO} + {$EXTERNALSYM d2i_TS_STATUS_INFO} + {$EXTERNALSYM TS_STATUS_INFO_dup} + {$EXTERNALSYM TS_TST_INFO_new} + {$EXTERNALSYM TS_TST_INFO_free} + {$EXTERNALSYM i2d_TS_TST_INFO} + {$EXTERNALSYM d2i_TS_TST_INFO} + {$EXTERNALSYM TS_TST_INFO_dup} + {$EXTERNALSYM d2i_TS_TST_INFO_bio} + {$EXTERNALSYM i2d_TS_TST_INFO_bio} + {$EXTERNALSYM TS_ACCURACY_new} + {$EXTERNALSYM TS_ACCURACY_free} + {$EXTERNALSYM i2d_TS_ACCURACY} + {$EXTERNALSYM d2i_TS_ACCURACY} + {$EXTERNALSYM TS_ACCURACY_dup} + {$EXTERNALSYM ESS_ISSUER_SERIAL_new} + {$EXTERNALSYM ESS_ISSUER_SERIAL_free} + {$EXTERNALSYM i2d_ESS_ISSUER_SERIAL} + {$EXTERNALSYM d2i_ESS_ISSUER_SERIAL} + {$EXTERNALSYM ESS_ISSUER_SERIAL_dup} + {$EXTERNALSYM ESS_CERT_ID_new} + {$EXTERNALSYM ESS_CERT_ID_free} + {$EXTERNALSYM i2d_ESS_CERT_ID} + {$EXTERNALSYM d2i_ESS_CERT_ID} + {$EXTERNALSYM ESS_CERT_ID_dup} + {$EXTERNALSYM ESS_SIGNING_CERT_new} + {$EXTERNALSYM ESS_SIGNING_CERT_free} + {$EXTERNALSYM i2d_ESS_SIGNING_CERT} + {$EXTERNALSYM d2i_ESS_SIGNING_CERT} + {$EXTERNALSYM ESS_SIGNING_CERT_dup} + {$EXTERNALSYM ESS_CERT_ID_V2_new} + {$EXTERNALSYM ESS_CERT_ID_V2_free} + {$EXTERNALSYM i2d_ESS_CERT_ID_V2} + {$EXTERNALSYM d2i_ESS_CERT_ID_V2} + {$EXTERNALSYM ESS_CERT_ID_V2_dup} + {$EXTERNALSYM ESS_SIGNING_CERT_V2_new} + {$EXTERNALSYM ESS_SIGNING_CERT_V2_free} + {$EXTERNALSYM i2d_ESS_SIGNING_CERT_V2} + {$EXTERNALSYM d2i_ESS_SIGNING_CERT_V2} + {$EXTERNALSYM ESS_SIGNING_CERT_V2_dup} + {$EXTERNALSYM TS_REQ_set_version} + {$EXTERNALSYM TS_REQ_get_version} + {$EXTERNALSYM TS_STATUS_INFO_set_status} + {$EXTERNALSYM TS_STATUS_INFO_get0_status} + {$EXTERNALSYM TS_REQ_set_msg_imprint} + {$EXTERNALSYM TS_REQ_get_msg_imprint} + {$EXTERNALSYM TS_MSG_IMPRINT_set_algo} + {$EXTERNALSYM TS_MSG_IMPRINT_get_algo} + {$EXTERNALSYM TS_MSG_IMPRINT_set_msg} + {$EXTERNALSYM TS_MSG_IMPRINT_get_msg} + {$EXTERNALSYM TS_REQ_set_policy_id} + {$EXTERNALSYM TS_REQ_get_policy_id} + {$EXTERNALSYM TS_REQ_set_nonce} + {$EXTERNALSYM TS_REQ_get_nonce} + {$EXTERNALSYM TS_REQ_set_cert_req} + {$EXTERNALSYM TS_REQ_get_cert_req} + {$EXTERNALSYM TS_REQ_ext_free} + {$EXTERNALSYM TS_REQ_get_ext_count} + {$EXTERNALSYM TS_REQ_get_ext_by_NID} + {$EXTERNALSYM TS_REQ_get_ext_by_OBJ} + {$EXTERNALSYM TS_REQ_get_ext_by_critical} + {$EXTERNALSYM TS_REQ_get_ext} + {$EXTERNALSYM TS_REQ_delete_ext} + {$EXTERNALSYM TS_REQ_add_ext} + {$EXTERNALSYM TS_REQ_get_ext_d2i} + {$EXTERNALSYM TS_REQ_print_bio} + {$EXTERNALSYM TS_RESP_set_status_info} + {$EXTERNALSYM TS_RESP_get_status_info} + {$EXTERNALSYM TS_RESP_set_tst_info} + {$EXTERNALSYM TS_RESP_get_token} + {$EXTERNALSYM TS_RESP_get_tst_info} + {$EXTERNALSYM TS_TST_INFO_set_version} + {$EXTERNALSYM TS_TST_INFO_get_version} + {$EXTERNALSYM TS_TST_INFO_set_policy_id} + {$EXTERNALSYM TS_TST_INFO_get_policy_id} + {$EXTERNALSYM TS_TST_INFO_set_msg_imprint} + {$EXTERNALSYM TS_TST_INFO_get_msg_imprint} + {$EXTERNALSYM TS_TST_INFO_set_serial} + {$EXTERNALSYM TS_TST_INFO_get_serial} + {$EXTERNALSYM TS_TST_INFO_set_time} + {$EXTERNALSYM TS_TST_INFO_get_time} + {$EXTERNALSYM TS_TST_INFO_set_accuracy} + {$EXTERNALSYM TS_TST_INFO_get_accuracy} + {$EXTERNALSYM TS_ACCURACY_set_seconds} + {$EXTERNALSYM TS_ACCURACY_get_seconds} + {$EXTERNALSYM TS_ACCURACY_set_millis} + {$EXTERNALSYM TS_ACCURACY_get_millis} + {$EXTERNALSYM TS_ACCURACY_set_micros} + {$EXTERNALSYM TS_ACCURACY_get_micros} + {$EXTERNALSYM TS_TST_INFO_set_ordering} + {$EXTERNALSYM TS_TST_INFO_get_ordering} + {$EXTERNALSYM TS_TST_INFO_set_nonce} + {$EXTERNALSYM TS_TST_INFO_get_nonce} + {$EXTERNALSYM TS_TST_INFO_set_tsa} + {$EXTERNALSYM TS_TST_INFO_get_tsa} + {$EXTERNALSYM TS_TST_INFO_ext_free} + {$EXTERNALSYM TS_TST_INFO_get_ext_count} + {$EXTERNALSYM TS_TST_INFO_get_ext_by_NID} + {$EXTERNALSYM TS_TST_INFO_get_ext_by_OBJ} + {$EXTERNALSYM TS_TST_INFO_get_ext_by_critical} + {$EXTERNALSYM TS_TST_INFO_get_ext} + {$EXTERNALSYM TS_TST_INFO_delete_ext} + {$EXTERNALSYM TS_TST_INFO_add_ext} + {$EXTERNALSYM TS_TST_INFO_get_ext_d2i} + {$EXTERNALSYM TS_RESP_CTX_new} + {$EXTERNALSYM TS_RESP_CTX_free} + {$EXTERNALSYM TS_RESP_CTX_set_signer_cert} + {$EXTERNALSYM TS_RESP_CTX_set_signer_key} + {$EXTERNALSYM TS_RESP_CTX_set_signer_digest} + {$EXTERNALSYM TS_RESP_CTX_set_ess_cert_id_digest} + {$EXTERNALSYM TS_RESP_CTX_set_def_policy} + {$EXTERNALSYM TS_RESP_CTX_add_policy} + {$EXTERNALSYM TS_RESP_CTX_add_md} + {$EXTERNALSYM TS_RESP_CTX_set_accuracy} + {$EXTERNALSYM TS_RESP_CTX_set_clock_precision_digits} + {$EXTERNALSYM TS_RESP_CTX_add_flags} + {$EXTERNALSYM TS_RESP_CTX_set_serial_cb} + {$EXTERNALSYM TS_RESP_CTX_set_time_cb} + {$EXTERNALSYM TS_RESP_CTX_set_extension_cb} + {$EXTERNALSYM TS_RESP_CTX_set_status_info} + {$EXTERNALSYM TS_RESP_CTX_set_status_info_cond} + {$EXTERNALSYM TS_RESP_CTX_add_failure_info} + {$EXTERNALSYM TS_RESP_CTX_get_request} + {$EXTERNALSYM TS_RESP_CTX_get_tst_info} + {$EXTERNALSYM TS_RESP_create_response} + {$EXTERNALSYM TS_RESP_verify_response} + {$EXTERNALSYM TS_RESP_verify_token} + {$EXTERNALSYM TS_VERIFY_CTX_new} + {$EXTERNALSYM TS_VERIFY_CTX_init} + {$EXTERNALSYM TS_VERIFY_CTX_free} + {$EXTERNALSYM TS_VERIFY_CTX_cleanup} + {$EXTERNALSYM TS_VERIFY_CTX_set_flags} + {$EXTERNALSYM TS_VERIFY_CTX_add_flags} + {$EXTERNALSYM TS_VERIFY_CTX_set_data} + {$EXTERNALSYM TS_VERIFY_CTX_set_imprint} + {$EXTERNALSYM TS_VERIFY_CTX_set_store} + {$EXTERNALSYM TS_REQ_to_TS_VERIFY_CTX} + {$EXTERNALSYM TS_RESP_print_bio} + {$EXTERNALSYM TS_STATUS_INFO_print_bio} + {$EXTERNALSYM TS_TST_INFO_print_bio} + {$EXTERNALSYM TS_ASN1_INTEGER_print_bio} + {$EXTERNALSYM TS_OBJ_print_bio} + {$EXTERNALSYM TS_X509_ALGOR_print_bio} + {$EXTERNALSYM TS_MSG_IMPRINT_print_bio} + {$EXTERNALSYM TS_CONF_load_cert} + {$EXTERNALSYM TS_CONF_load_key} + {$EXTERNALSYM TS_CONF_set_serial} + {$EXTERNALSYM TS_CONF_get_tsa_section} + {$EXTERNALSYM TS_CONF_set_crypto_device} + {$EXTERNALSYM TS_CONF_set_default_engine} + {$EXTERNALSYM TS_CONF_set_signer_cert} + {$EXTERNALSYM TS_CONF_set_certs} + {$EXTERNALSYM TS_CONF_set_signer_key} + {$EXTERNALSYM TS_CONF_set_signer_digest} + {$EXTERNALSYM TS_CONF_set_def_policy} + {$EXTERNALSYM TS_CONF_set_policies} + {$EXTERNALSYM TS_CONF_set_digests} + {$EXTERNALSYM TS_CONF_set_accuracy} + {$EXTERNALSYM TS_CONF_set_clock_precision_digits} + {$EXTERNALSYM TS_CONF_set_ordering} + {$EXTERNALSYM TS_CONF_set_tsa_name} + {$EXTERNALSYM TS_CONF_set_ess_cert_id_chain} + {$EXTERNALSYM TS_CONF_set_ess_cert_id_digest} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +var + TS_REQ_new: function : PTS_REQ; cdecl = nil; + TS_REQ_free: procedure (a: PTS_REQ); cdecl = nil; + i2d_TS_REQ: function (a: PTS_REQ; pp: PPByte): TIdC_INT; cdecl = nil; + d2i_TS_REQ: function (a: PPTS_REQ; pp: PPByte; length: TIdC_LONG): PTS_REQ; cdecl = nil; + + TS_REQ_dup: function (a: PTS_REQ): PTS_REQ; cdecl = nil; + + d2i_TS_REQ_bio: function (fp: PBIO; a: PPTS_REQ): PTS_REQ; cdecl = nil; + i2d_TS_REQ_bio: function (fp: PBIO; a: PTS_REQ): TIdC_INT; cdecl = nil; + + TS_MSG_IMPRINT_new: function : PTS_MSG_IMPRINT; cdecl = nil; + TS_MSG_IMPRINT_free: procedure (a: PTS_MSG_IMPRINT); cdecl = nil; + i2d_TS_MSG_IMPRINT: function (a: PTS_MSG_IMPRINT; pp: PPByte): TIdC_INT; cdecl = nil; + d2i_TS_MSG_IMPRINT: function (a: PPTS_MSG_IMPRINT; pp: PPByte; length: TIdC_LONG): PTS_MSG_IMPRINT; cdecl = nil; + + TS_MSG_IMPRINT_dup: function (a: PTS_MSG_IMPRINT): PTS_MSG_IMPRINT; cdecl = nil; + + d2i_TS_MSG_IMPRINT_bio: function (bio: PBIO; a: PPTS_MSG_IMPRINT): PTS_MSG_IMPRINT; cdecl = nil; + i2d_TS_MSG_IMPRINT_bio: function (bio: PBIO; a: PTS_MSG_IMPRINT): TIdC_INT; cdecl = nil; + + TS_RESP_new: function : PTS_RESP; cdecl = nil; + TS_RESP_free: procedure (a: PTS_RESP); cdecl = nil; + i2d_TS_RESP: function (a: PTS_RESP; pp: PPByte): TIdC_INT; cdecl = nil; + d2i_TS_RESP: function (a: PPTS_RESP; pp: PPByte; length: TIdC_LONG): PTS_RESP; cdecl = nil; + PKCS7_to_TS_TST_INFO: function (token: PPKCS7): PTS_TST_Info; cdecl = nil; + TS_RESP_dup: function (a: PTS_RESP): PTS_RESP; cdecl = nil; + + d2i_TS_RESP_bio: function (bio: PBIO; a: PPTS_RESP): PTS_RESP; cdecl = nil; + i2d_TS_RESP_bio: function (bio: PBIO; a: PTS_RESP): TIdC_INT; cdecl = nil; + + TS_STATUS_INFO_new: function : PTS_STATUS_INFO; cdecl = nil; + TS_STATUS_INFO_free: procedure (a: PTS_STATUS_INFO); cdecl = nil; + i2d_TS_STATUS_INFO: function (a: PTS_STATUS_INFO; pp: PPByte): TIdC_INT; cdecl = nil; + d2i_TS_STATUS_INFO: function (a: PPTS_STATUS_INFO; pp: PPByte; length: TIdC_LONG): PTS_STATUS_INFO; cdecl = nil; + TS_STATUS_INFO_dup: function (a: PTS_STATUS_INFO): PTS_STATUS_INFO; cdecl = nil; + + TS_TST_INFO_new: function : PTS_TST_Info; cdecl = nil; + TS_TST_INFO_free: procedure (a: PTS_TST_Info); cdecl = nil; + i2d_TS_TST_INFO: function (a: PTS_TST_Info; pp: PPByte): TIdC_INT; cdecl = nil; + d2i_TS_TST_INFO: function (a: PPTS_TST_Info; pp: PPByte; length: TIdC_LONG): PTS_TST_Info; cdecl = nil; + TS_TST_INFO_dup: function (a: PTS_TST_Info): PTS_TST_Info; cdecl = nil; + + d2i_TS_TST_INFO_bio: function (bio: PBIO; a: PPTS_TST_Info): PTS_TST_Info; cdecl = nil; + i2d_TS_TST_INFO_bio: function (bio: PBIO; a: PTS_TST_Info): TIdC_INT; cdecl = nil; + + TS_ACCURACY_new: function : PTS_ACCURACY; cdecl = nil; + TS_ACCURACY_free: procedure (a: PTS_ACCURACY); cdecl = nil; + i2d_TS_ACCURACY: function (a: PTS_ACCURACY; pp: PPByte): TIdC_INT; cdecl = nil; + d2i_TS_ACCURACY: function (a: PPTS_ACCURACY; pp: PPByte; length: TIdC_LONG): PTS_ACCURACY; cdecl = nil; + TS_ACCURACY_dup: function (a: PTS_ACCURACY): PTS_ACCURACY; cdecl = nil; + + ESS_ISSUER_SERIAL_new: function : PESS_ISSUER_SERIAL; cdecl = nil; + ESS_ISSUER_SERIAL_free: procedure (a: PESS_ISSUER_SERIAL); cdecl = nil; + i2d_ESS_ISSUER_SERIAL: function ( a: PESS_ISSUER_SERIAL; pp: PPByte): TIdC_INT; cdecl = nil; + d2i_ESS_ISSUER_SERIAL: function (a: PPESS_ISSUER_SERIAL; pp: PPByte; length: TIdC_LONG): PESS_ISSUER_SERIAL; cdecl = nil; + ESS_ISSUER_SERIAL_dup: function (a: PESS_ISSUER_SERIAL): PESS_ISSUER_SERIAL; cdecl = nil; + + ESS_CERT_ID_new: function : PESS_CERT_ID; cdecl = nil; + ESS_CERT_ID_free: procedure (a: PESS_CERT_ID); cdecl = nil; + i2d_ESS_CERT_ID: function (a: PESS_CERT_ID; pp: PPByte): TIdC_INT; cdecl = nil; + d2i_ESS_CERT_ID: function (a: PPESS_CERT_ID; pp: PPByte; length: TIdC_LONG): PESS_CERT_ID; cdecl = nil; + ESS_CERT_ID_dup: function (a: PESS_CERT_ID): PESS_CERT_ID; cdecl = nil; + + ESS_SIGNING_CERT_new: function : PESS_SIGNING_Cert; cdecl = nil; + ESS_SIGNING_CERT_free: procedure (a: PESS_SIGNING_Cert); cdecl = nil; + i2d_ESS_SIGNING_CERT: function ( a: PESS_SIGNING_Cert; pp: PPByte): TIdC_INT; cdecl = nil; + d2i_ESS_SIGNING_CERT: function (a: PPESS_SIGNING_Cert; pp: PPByte; length: TIdC_LONG): PESS_SIGNING_Cert; cdecl = nil; + ESS_SIGNING_CERT_dup: function (a: PESS_SIGNING_Cert): PESS_SIGNING_Cert; cdecl = nil; + + ESS_CERT_ID_V2_new: function : PESS_CERT_ID_V2; cdecl = nil; + ESS_CERT_ID_V2_free: procedure (a: PESS_CERT_ID_V2); cdecl = nil; + i2d_ESS_CERT_ID_V2: function ( a: PESS_CERT_ID_V2; pp: PPByte): TIdC_INT; cdecl = nil; + d2i_ESS_CERT_ID_V2: function (a: PPESS_CERT_ID_V2; pp: PPByte; length: TIdC_LONG): PESS_CERT_ID_V2; cdecl = nil; + ESS_CERT_ID_V2_dup: function (a: PESS_CERT_ID_V2): PESS_CERT_ID_V2; cdecl = nil; + + ESS_SIGNING_CERT_V2_new: function : PESS_SIGNING_CERT_V2; cdecl = nil; + ESS_SIGNING_CERT_V2_free: procedure (a: PESS_SIGNING_CERT_V2); cdecl = nil; + i2d_ESS_SIGNING_CERT_V2: function (a: PESS_SIGNING_CERT_V2; pp: PPByte): TIdC_INT; cdecl = nil; + d2i_ESS_SIGNING_CERT_V2: function (a: PPESS_SIGNING_CERT_V2; pp: PPByte; length: TIdC_LONG): PESS_SIGNING_CERT_V2; cdecl = nil; + ESS_SIGNING_CERT_V2_dup: function (a: PESS_SIGNING_CERT_V2): PESS_SIGNING_CERT_V2; cdecl = nil; + + TS_REQ_set_version: function (a: PTS_REQ; version: TIdC_LONG): TIdC_INT; cdecl = nil; + TS_REQ_get_version: function (a: PTS_REQ): TIdC_LONG; cdecl = nil; + + TS_STATUS_INFO_set_status: function (a: PTS_STATUS_INFO; i: TIdC_INT): TIdC_INT; cdecl = nil; + TS_STATUS_INFO_get0_status: function (const a: PTS_STATUS_INFO): PASN1_INTEGER; cdecl = nil; + + // const STACK_OF(ASN1_UTF8STRING) *TS_STATUS_INFO_get0_text(const TS_STATUS_INFO *a); + + // const ASN1_BIT_STRING *TS_STATUS_INFO_get0_failure_info(const TS_STATUS_INFO *a); + + TS_REQ_set_msg_imprint: function (a: PTS_REQ; msg_imprint: PTS_MSG_IMPRINT): TIdC_INT; cdecl = nil; + TS_REQ_get_msg_imprint: function (a: PTS_REQ): PTS_MSG_IMPRINT; cdecl = nil; + + TS_MSG_IMPRINT_set_algo: function (a: PTS_MSG_IMPRINT; alg: PX509_ALGOr): TIdC_INT; cdecl = nil; + TS_MSG_IMPRINT_get_algo: function (a: PTS_MSG_IMPRINT): PX509_ALGOr; cdecl = nil; + + TS_MSG_IMPRINT_set_msg: function (a: PTS_MSG_IMPRINT; d: PByte; len: TIdC_INT): TIdC_INT; cdecl = nil; + TS_MSG_IMPRINT_get_msg: function (a: PTS_MSG_IMPRINT): PASN1_OCTET_STRING; cdecl = nil; + + TS_REQ_set_policy_id: function (a: PTS_REQ; policy: PASN1_OBJECT): TIdC_INT; cdecl = nil; + TS_REQ_get_policy_id: function (a: PTS_REQ): PASN1_OBJECT; cdecl = nil; + + TS_REQ_set_nonce: function (a: PTS_REQ; nonce: PASN1_INTEGER): TIdC_INT; cdecl = nil; + TS_REQ_get_nonce: function (const a: PTS_REQ): PASN1_INTEGER; cdecl = nil; + + TS_REQ_set_cert_req: function (a: PTS_REQ; cert_req: TIdC_INT): TIdC_INT; cdecl = nil; + TS_REQ_get_cert_req: function (a: PTS_REQ): TIdC_INT; cdecl = nil; + + //STACK_OF(X509_EXTENSION) *TS_REQ_get_exts(TS_REQ *a); + TS_REQ_ext_free: procedure (a: PTS_REQ); cdecl = nil; + TS_REQ_get_ext_count: function (a: PTS_REQ): TIdC_INT; cdecl = nil; + TS_REQ_get_ext_by_NID: function (a: PTS_REQ; nid: TIdC_INT; lastpos: TIdC_INT): TIdC_INT; cdecl = nil; + TS_REQ_get_ext_by_OBJ: function (a: PTS_REQ; obj: PASN1_Object; lastpos: TIdC_INT): TIdC_INT; cdecl = nil; + TS_REQ_get_ext_by_critical: function (a: PTS_REQ; crit: TIdC_INT; lastpos: TIdC_INT): TIdC_INT; cdecl = nil; + TS_REQ_get_ext: function (a: PTS_REQ; loc: TIdC_INT): PX509_Extension; cdecl = nil; + TS_REQ_delete_ext: function (a: PTS_REQ; loc: TIdC_INT): PX509_Extension; cdecl = nil; + TS_REQ_add_ext: function (a: PTS_REQ; ex: PX509_Extension; loc: TIdC_INT): TIdC_INT; cdecl = nil; + TS_REQ_get_ext_d2i: function (a: PTS_REQ; nid: TIdC_INT; crit: PIdC_INT; idx: PIdC_INT): Pointer; cdecl = nil; + + //* Function declarations for TS_REQ defined in ts/ts_req_print.c */ + + TS_REQ_print_bio: function (bio: PBIO; a: PTS_REQ): TIdC_INT; cdecl = nil; + + //* Function declarations for TS_RESP defined in ts/ts_resp_utils.c */ + + TS_RESP_set_status_info: function (a: PTS_RESP; info: PTS_STATUS_INFO): TIdC_INT; cdecl = nil; + TS_RESP_get_status_info: function (a: PTS_RESP): PTS_STATUS_INFO; cdecl = nil; + + //* Caller loses ownership of PKCS7 and TS_TST_INFO objects. */ + TS_RESP_set_tst_info: procedure (a: PTS_RESP; p7: PPKCS7; tst_info: PTS_TST_Info); cdecl = nil; + TS_RESP_get_token: function (a: PTS_RESP): PPKCS7; cdecl = nil; + TS_RESP_get_tst_info: function (a: PTS_RESP): PTS_TST_Info; cdecl = nil; + + TS_TST_INFO_set_version: function (a: PTS_TST_Info; version: TIdC_LONG): TIdC_INT; cdecl = nil; + TS_TST_INFO_get_version: function (const a: PTS_TST_Info): TIdC_LONG; cdecl = nil; + + TS_TST_INFO_set_policy_id: function (a: PTS_TST_Info; policy_id: PASN1_Object): TIdC_INT; cdecl = nil; + TS_TST_INFO_get_policy_id: function (a: PTS_TST_Info): PASN1_Object; cdecl = nil; + + TS_TST_INFO_set_msg_imprint: function (a: PTS_TST_Info; msg_imprint: PTS_MSG_IMPRINT): TIdC_INT; cdecl = nil; + TS_TST_INFO_get_msg_imprint: function (a: PTS_TST_Info): PTS_MSG_IMPRINT; cdecl = nil; + + TS_TST_INFO_set_serial: function (a: PTS_TST_Info; const serial: PASN1_INTEGER): TIdC_INT; cdecl = nil; + TS_TST_INFO_get_serial: function (const a: PTS_TST_INFO): PASN1_INTEGER; cdecl = nil; + + TS_TST_INFO_set_time: function (a: PTS_TST_Info; gtime: PASN1_GENERALIZEDTIME): TIdC_INT; cdecl = nil; + TS_TST_INFO_get_time: function (const a: PTS_TST_INFO): PASN1_GENERALIZEDTIME; cdecl = nil; + + TS_TST_INFO_set_accuracy: function (a: PTS_TST_Info; accuracy: PTS_ACCURACY): TIdC_INT; cdecl = nil; + TS_TST_INFO_get_accuracy: function (a: PTS_TST_Info): PTS_ACCURACY; cdecl = nil; + + TS_ACCURACY_set_seconds: function (a: PTS_ACCURACY; const seconds: PASN1_INTEGER): TIdC_INT; cdecl = nil; + TS_ACCURACY_get_seconds: function (const a: PTS_ACCURACY): PASN1_INTEGER; cdecl = nil; + + TS_ACCURACY_set_millis: function (a: PTS_ACCURACY; const millis: PASN1_INTEGER): TIdC_INT; cdecl = nil; + TS_ACCURACY_get_millis: function (const a: PTS_ACCURACY): PASN1_INTEGER; cdecl = nil; + + TS_ACCURACY_set_micros: function (a: PTS_ACCURACY; const micros: PASN1_INTEGER): TIdC_INT; cdecl = nil; + TS_ACCURACY_get_micros: function (const a: PTS_ACCURACY): PASN1_INTEGER; cdecl = nil; + + TS_TST_INFO_set_ordering: function (a: PTS_TST_Info; ordering: TIdC_INT): TIdC_INT; cdecl = nil; + TS_TST_INFO_get_ordering: function (const a: PTS_TST_Info): TIdC_INT; cdecl = nil; + + TS_TST_INFO_set_nonce: function (a: PTS_TST_Info; const nonce: PASN1_INTEGER): TIdC_INT; cdecl = nil; + TS_TST_INFO_get_nonce: function (const a: PTS_TST_INFO): PASN1_INTEGER; cdecl = nil; + + TS_TST_INFO_set_tsa: function (a: PTS_TST_Info; tsa: PGENERAL_NAME): TIdC_INT; cdecl = nil; + TS_TST_INFO_get_tsa: function (a: PTS_TST_Info): PGENERAL_NAME; cdecl = nil; + + //STACK_OF(X509_EXTENSION) *TS_TST_INFO_get_exts(TS_TST_INFO *a); + TS_TST_INFO_ext_free: procedure (a: PTS_TST_Info); cdecl = nil; + TS_TST_INFO_get_ext_count: function (a: PTS_TST_Info): TIdC_INT; cdecl = nil; + TS_TST_INFO_get_ext_by_NID: function (a: PTS_TST_Info; nid: TIdC_INT; lastpos: TIdC_INT): TIdC_INT; cdecl = nil; + TS_TST_INFO_get_ext_by_OBJ: function (a: PTS_TST_Info; const obj: PASN1_Object; lastpos: TIdC_INT): TIdC_INT; cdecl = nil; + TS_TST_INFO_get_ext_by_critical: function (a: PTS_TST_Info; crit: TIdC_INT; lastpos: TIdC_INT): TIdC_INT; cdecl = nil; + TS_TST_INFO_get_ext: function (a: PTS_TST_Info; loc: TIdC_INT): PX509_Extension; cdecl = nil; + TS_TST_INFO_delete_ext: function (a: PTS_TST_Info; loc: TIdC_INT): PX509_Extension; cdecl = nil; + TS_TST_INFO_add_ext: function (a: PTS_TST_Info; ex: PX509_Extension; loc: TIdC_INT): TIdC_INT; cdecl = nil; + TS_TST_INFO_get_ext_d2i: function (a: PTS_TST_Info; nid: TIdC_INT; crit: PIdC_INT; idx: PIdC_INT): Pointer; cdecl = nil; + + (* + * Declarations related to response generation, defined in ts/ts_resp_sign.c. + *) + + //DEFINE_STACK_OF_CONST(EVP_MD) + + (* Creates a response context that can be used for generating responses. *) + TS_RESP_CTX_new: function : PTS_RESP_CTX; cdecl = nil; + TS_RESP_CTX_free: procedure (ctx: PTS_RESP_CTX); cdecl = nil; + + (* This parameter must be set. *) + TS_RESP_CTX_set_signer_cert: function (ctx: PTS_RESP_CTX; signer: PX509): TIdC_INT; cdecl = nil; + + (* This parameter must be set. *) + TS_RESP_CTX_set_signer_key: function (ctx: PTS_RESP_CTX; key: PEVP_PKEY): TIdC_INT; cdecl = nil; + + TS_RESP_CTX_set_signer_digest: function (ctx: PTS_RESP_CTX; signer_digest: PEVP_MD): TIdC_INT; cdecl = nil; + TS_RESP_CTX_set_ess_cert_id_digest: function (ctx: PTS_RESP_CTX; md: PEVP_MD): TIdC_INT; cdecl = nil; + + (* This parameter must be set. *) + TS_RESP_CTX_set_def_policy: function (ctx: PTS_RESP_CTX; def_policy: PASN1_Object): TIdC_INT; cdecl = nil; + + (* No additional certs are included in the response by default. *) + // int TS_RESP_CTX_set_certs(TS_RESP_CTX *ctx, STACK_OF(X509) *certs); + + (* + * Adds a new acceptable policy, only the default policy is accepted by + * default. + *) + TS_RESP_CTX_add_policy: function (ctx: PTS_RESP_CTX; const policy: PASN1_Object): TIdC_INT; cdecl = nil; + + (* + * Adds a new acceptable message digest. Note that no message digests are + * accepted by default. The md argument is shared with the caller. + *) + TS_RESP_CTX_add_md: function (ctx: PTS_RESP_CTX; const md: PEVP_MD): TIdC_INT; cdecl = nil; + + (* Accuracy is not included by default. *) + TS_RESP_CTX_set_accuracy: function (ctx: PTS_RESP_CTX; secs: TIdC_INT; millis: TIdC_INT; micros: TIdC_INT): TIdC_INT; cdecl = nil; + + (* + * Clock precision digits, i.e. the number of decimal digits: '0' means sec, + * '3' msec, '6' usec, and so on. Default is 0. + *) + TS_RESP_CTX_set_clock_precision_digits: function (ctx: PTS_RESP_CTX; clock_precision_digits: TIdC_UINT): TIdC_INT; cdecl = nil; + + (* No flags are set by default. *) + TS_RESP_CTX_add_flags: procedure (ctx: PTS_RESP_CTX; flags: TIdC_INT); cdecl = nil; + + (* Default callback always returns a constant. *) + TS_RESP_CTX_set_serial_cb: procedure (ctx: PTS_RESP_CTX; cb: TS_serial_cb; data: Pointer); cdecl = nil; + + (* Default callback uses the gettimeofday() and gmtime() system calls. *) + TS_RESP_CTX_set_time_cb: procedure (ctx: PTS_RESP_CTX; cb: TS_time_cb; data: Pointer); cdecl = nil; + + (* + * Default callback rejects all extensions. The extension callback is called + * when the TS_TST_INFO object is already set up and not signed yet. + *) + (* FIXME: extension handling is not tested yet. *) + TS_RESP_CTX_set_extension_cb: procedure (ctx: PTS_RESP_CTX; cb: TS_extension_cb; data: Pointer); cdecl = nil; + + (* The following methods can be used in the callbacks. *) + TS_RESP_CTX_set_status_info: function (ctx: PTS_RESP_CTX; status: TIdC_INT; text: PIdAnsiChar): TIdC_INT; cdecl = nil; + + (* Sets the status info only if it is still TS_STATUS_GRANTED. *) + TS_RESP_CTX_set_status_info_cond: function (ctx: PTS_RESP_CTX; status: TIdC_INT; text: PIdAnsiChar): TIdC_INT; cdecl = nil; + + TS_RESP_CTX_add_failure_info: function (ctx: PTS_RESP_CTX; failure: TIdC_INT): TIdC_INT; cdecl = nil; + + (* The get methods below can be used in the extension callback. *) + TS_RESP_CTX_get_request: function (ctx: PTS_RESP_CTX): PTS_REQ; cdecl = nil; + + TS_RESP_CTX_get_tst_info: function (ctx: PTS_RESP_CTX): PTS_TST_Info; cdecl = nil; + + (* + * Creates the signed TS_TST_INFO and puts it in TS_RESP. + * In case of errors it sets the status info properly. + * Returns NULL only in case of memory allocation/fatal error. + *) + TS_RESP_create_response: function (ctx: PTS_RESP_CTX; req_bio: PBIO): PTS_RESP; cdecl = nil; + + (* + * Declarations related to response verification, + * they are defined in ts/ts_resp_verify.c. + *) + + //int TS_RESP_verify_signature(PKCS7 *token, STACK_OF(X509) *certs, + // X509_STORE *store, X509 **signer_out); + + (* Context structure for the generic verify method. *) + + TS_RESP_verify_response: function (ctx: PTS_VERIFY_CTX; response: PTS_RESP): TIdC_INT; cdecl = nil; + TS_RESP_verify_token: function (ctx: PTS_VERIFY_CTX; token: PPKCS7): TIdC_INT; cdecl = nil; + + (* + * Declarations related to response verification context, + *) + TS_VERIFY_CTX_new: function : PTS_VERIFY_CTX; cdecl = nil; + TS_VERIFY_CTX_init: procedure (ctx: PTS_VERIFY_CTX); cdecl = nil; + TS_VERIFY_CTX_free: procedure (ctx: PTS_VERIFY_CTX); cdecl = nil; + TS_VERIFY_CTX_cleanup: procedure (ctx: PTS_VERIFY_CTX); cdecl = nil; + TS_VERIFY_CTX_set_flags: function (ctx: PTS_VERIFY_CTX; f: TIdC_INT): TIdC_INT; cdecl = nil; + TS_VERIFY_CTX_add_flags: function (ctx: PTS_VERIFY_CTX; f: TIdC_INT): TIdC_INT; cdecl = nil; + TS_VERIFY_CTX_set_data: function (ctx: PTS_VERIFY_CTX; b: PBIO): PBIO; cdecl = nil; + TS_VERIFY_CTX_set_imprint: function (ctx: PTS_VERIFY_CTX; hexstr: PByte; len: TIdC_LONG): PByte; cdecl = nil; + TS_VERIFY_CTX_set_store: function (ctx: PTS_VERIFY_CTX; s: PX509_Store): PX509_Store; cdecl = nil; + // STACK_OF(X509) *TS_VERIFY_CTS_set_certs(TS_VERIFY_CTX *ctx, STACK_OF(X509) *certs); + + (*- + * If ctx is NULL, it allocates and returns a new object, otherwise + * it returns ctx. It initialises all the members as follows: + * flags = TS_VFY_ALL_IMPRINT & ~(TS_VFY_TSA_NAME | TS_VFY_SIGNATURE) + * certs = NULL + * store = NULL + * policy = policy from the request or NULL if absent (in this case + * TS_VFY_POLICY is cleared from flags as well) + * md_alg = MD algorithm from request + * imprint, imprint_len = imprint from request + * data = NULL + * nonce, nonce_len = nonce from the request or NULL if absent (in this case + * TS_VFY_NONCE is cleared from flags as well) + * tsa_name = NULL + * Important: after calling this method TS_VFY_SIGNATURE should be added! + *) + TS_REQ_to_TS_VERIFY_CTX: function (req: PTS_REQ; ctx: PTS_VERIFY_CTX): PTS_VERIFY_CTX; cdecl = nil; + + (* Function declarations for TS_RESP defined in ts/ts_resp_print.c *) + + TS_RESP_print_bio: function (bio: PBIO; a: PTS_RESP): TIdC_INT; cdecl = nil; + TS_STATUS_INFO_print_bio: function (bio: PBIO; a: PTS_STATUS_INFO): TIdC_INT; cdecl = nil; + TS_TST_INFO_print_bio: function (bio: PBIO; a: PTS_TST_Info): TIdC_INT; cdecl = nil; + + (* Common utility functions defined in ts/ts_lib.c *) + + TS_ASN1_INTEGER_print_bio: function (bio: PBIO; const num: PASN1_INTEGER): TIdC_INT; cdecl = nil; + TS_OBJ_print_bio: function (bio: PBIO; const obj: PASN1_Object): TIdC_INT; cdecl = nil; + //function TS_ext_print_bio(bio: PBIO; const STACK_OF(): X509_Extension * extensions): TIdC_INT; + TS_X509_ALGOR_print_bio: function (bio: PBIO; const alg: PX509_ALGOr): TIdC_INT; cdecl = nil; + TS_MSG_IMPRINT_print_bio: function (bio: PBIO; msg: PTS_MSG_IMPRINT): TIdC_INT; cdecl = nil; + + (* + * Function declarations for handling configuration options, defined in + * ts/ts_conf.c + *) + + TS_CONF_load_cert: function (file_: PIdAnsiChar): PX509; cdecl = nil; + TS_CONF_load_key: function ( file_: PIdAnsiChar; pass: PIdAnsiChar): PEVP_PKey; cdecl = nil; + TS_CONF_set_serial: function (conf: PCONF; section: PIdAnsiChar; cb: TS_serial_cb; ctx: PTS_RESP_CTX): TIdC_INT; cdecl = nil; + //STACK_OF(X509) *TS_CONF_load_certs(const char *file); + TS_CONF_get_tsa_section: function (conf: PCONF; const section: PIdAnsiChar): PIdAnsiChar; cdecl = nil; + TS_CONF_set_crypto_device: function (conf: PCONF; section: PIdAnsiChar; device: PIdAnsiChar): TIdC_INT; cdecl = nil; + TS_CONF_set_default_engine: function (name: PIdAnsiChar): TIdC_INT; cdecl = nil; + TS_CONF_set_signer_cert: function (conf: PCONF; section: PIdAnsiChar; cert: PIdAnsiChar; ctx: PTS_RESP_CTX): TIdC_INT; cdecl = nil; + TS_CONF_set_certs: function (conf: PCONF; section: PIdAnsiChar; certs: PIdAnsiChar; ctx: PTS_RESP_CTX): TIdC_INT; cdecl = nil; + TS_CONF_set_signer_key: function (conf: PCONF; const section: PIdAnsiChar; key: PIdAnsiChar; pass: PIdAnsiChar; ctx: PTS_RESP_CTX): TIdC_INT; cdecl = nil; + TS_CONF_set_signer_digest: function (conf: PCONF; section: PIdAnsiChar; md: PIdAnsiChar; ctx: PTS_RESP_CTX): TIdC_INT; cdecl = nil; + TS_CONF_set_def_policy: function (conf: PCONF; section: PIdAnsiChar; policy: PIdAnsiChar; ctx: PTS_RESP_CTX): TIdC_INT; cdecl = nil; + TS_CONF_set_policies: function (conf: PCONF; section: PIdAnsiChar; ctx: PTS_RESP_CTX): TIdC_INT; cdecl = nil; + TS_CONF_set_digests: function (conf: PCONF; section: PIdAnsiChar; ctx: PTS_RESP_CTX): TIdC_INT; cdecl = nil; + TS_CONF_set_accuracy: function (conf: PCONF; section: PIdAnsiChar; ctx: PTS_RESP_CTX): TIdC_INT; cdecl = nil; + TS_CONF_set_clock_precision_digits: function (conf: PCONF; section: PIdAnsiChar; ctx: PTS_RESP_CTX): TIdC_INT; cdecl = nil; + TS_CONF_set_ordering: function (conf: PCONF; section: PIdAnsiChar; ctx: PTS_RESP_CTX): TIdC_INT; cdecl = nil; + TS_CONF_set_tsa_name: function (conf: PCONF; section: PIdAnsiChar; ctx: PTS_RESP_CTX): TIdC_INT; cdecl = nil; + TS_CONF_set_ess_cert_id_chain: function (conf: PCONF; section: PIdAnsiChar; ctx: PTS_RESP_CTX): TIdC_INT; cdecl = nil; + TS_CONF_set_ess_cert_id_digest: function (conf: PCONF; section: PIdAnsiChar; ctx: PTS_RESP_CTX): TIdC_INT; cdecl = nil; + +{$ELSE} + function TS_REQ_new: PTS_REQ cdecl; external CLibCrypto; + procedure TS_REQ_free(a: PTS_REQ) cdecl; external CLibCrypto; + function i2d_TS_REQ(a: PTS_REQ; pp: PPByte): TIdC_INT cdecl; external CLibCrypto; + function d2i_TS_REQ(a: PPTS_REQ; pp: PPByte; length: TIdC_LONG): PTS_REQ cdecl; external CLibCrypto; + + function TS_REQ_dup(a: PTS_REQ): PTS_REQ cdecl; external CLibCrypto; + + function d2i_TS_REQ_bio(fp: PBIO; a: PPTS_REQ): PTS_REQ cdecl; external CLibCrypto; + function i2d_TS_REQ_bio(fp: PBIO; a: PTS_REQ): TIdC_INT cdecl; external CLibCrypto; + + function TS_MSG_IMPRINT_new: PTS_MSG_IMPRINT cdecl; external CLibCrypto; + procedure TS_MSG_IMPRINT_free(a: PTS_MSG_IMPRINT) cdecl; external CLibCrypto; + function i2d_TS_MSG_IMPRINT(a: PTS_MSG_IMPRINT; pp: PPByte): TIdC_INT cdecl; external CLibCrypto; + function d2i_TS_MSG_IMPRINT(a: PPTS_MSG_IMPRINT; pp: PPByte; length: TIdC_LONG): PTS_MSG_IMPRINT cdecl; external CLibCrypto; + + function TS_MSG_IMPRINT_dup(a: PTS_MSG_IMPRINT): PTS_MSG_IMPRINT cdecl; external CLibCrypto; + + function d2i_TS_MSG_IMPRINT_bio(bio: PBIO; a: PPTS_MSG_IMPRINT): PTS_MSG_IMPRINT cdecl; external CLibCrypto; + function i2d_TS_MSG_IMPRINT_bio(bio: PBIO; a: PTS_MSG_IMPRINT): TIdC_INT cdecl; external CLibCrypto; + + function TS_RESP_new: PTS_RESP cdecl; external CLibCrypto; + procedure TS_RESP_free(a: PTS_RESP) cdecl; external CLibCrypto; + function i2d_TS_RESP(a: PTS_RESP; pp: PPByte): TIdC_INT cdecl; external CLibCrypto; + function d2i_TS_RESP(a: PPTS_RESP; pp: PPByte; length: TIdC_LONG): PTS_RESP cdecl; external CLibCrypto; + function PKCS7_to_TS_TST_INFO(token: PPKCS7): PTS_TST_Info cdecl; external CLibCrypto; + function TS_RESP_dup(a: PTS_RESP): PTS_RESP cdecl; external CLibCrypto; + + function d2i_TS_RESP_bio(bio: PBIO; a: PPTS_RESP): PTS_RESP cdecl; external CLibCrypto; + function i2d_TS_RESP_bio(bio: PBIO; a: PTS_RESP): TIdC_INT cdecl; external CLibCrypto; + + function TS_STATUS_INFO_new: PTS_STATUS_INFO cdecl; external CLibCrypto; + procedure TS_STATUS_INFO_free(a: PTS_STATUS_INFO) cdecl; external CLibCrypto; + function i2d_TS_STATUS_INFO(a: PTS_STATUS_INFO; pp: PPByte): TIdC_INT cdecl; external CLibCrypto; + function d2i_TS_STATUS_INFO(a: PPTS_STATUS_INFO; pp: PPByte; length: TIdC_LONG): PTS_STATUS_INFO cdecl; external CLibCrypto; + function TS_STATUS_INFO_dup(a: PTS_STATUS_INFO): PTS_STATUS_INFO cdecl; external CLibCrypto; + + function TS_TST_INFO_new: PTS_TST_Info cdecl; external CLibCrypto; + procedure TS_TST_INFO_free(a: PTS_TST_Info) cdecl; external CLibCrypto; + function i2d_TS_TST_INFO(a: PTS_TST_Info; pp: PPByte): TIdC_INT cdecl; external CLibCrypto; + function d2i_TS_TST_INFO(a: PPTS_TST_Info; pp: PPByte; length: TIdC_LONG): PTS_TST_Info cdecl; external CLibCrypto; + function TS_TST_INFO_dup(a: PTS_TST_Info): PTS_TST_Info cdecl; external CLibCrypto; + + function d2i_TS_TST_INFO_bio(bio: PBIO; a: PPTS_TST_Info): PTS_TST_Info cdecl; external CLibCrypto; + function i2d_TS_TST_INFO_bio(bio: PBIO; a: PTS_TST_Info): TIdC_INT cdecl; external CLibCrypto; + + function TS_ACCURACY_new: PTS_ACCURACY cdecl; external CLibCrypto; + procedure TS_ACCURACY_free(a: PTS_ACCURACY) cdecl; external CLibCrypto; + function i2d_TS_ACCURACY(a: PTS_ACCURACY; pp: PPByte): TIdC_INT cdecl; external CLibCrypto; + function d2i_TS_ACCURACY(a: PPTS_ACCURACY; pp: PPByte; length: TIdC_LONG): PTS_ACCURACY cdecl; external CLibCrypto; + function TS_ACCURACY_dup(a: PTS_ACCURACY): PTS_ACCURACY cdecl; external CLibCrypto; + + function ESS_ISSUER_SERIAL_new: PESS_ISSUER_SERIAL cdecl; external CLibCrypto; + procedure ESS_ISSUER_SERIAL_free(a: PESS_ISSUER_SERIAL) cdecl; external CLibCrypto; + function i2d_ESS_ISSUER_SERIAL( a: PESS_ISSUER_SERIAL; pp: PPByte): TIdC_INT cdecl; external CLibCrypto; + function d2i_ESS_ISSUER_SERIAL(a: PPESS_ISSUER_SERIAL; pp: PPByte; length: TIdC_LONG): PESS_ISSUER_SERIAL cdecl; external CLibCrypto; + function ESS_ISSUER_SERIAL_dup(a: PESS_ISSUER_SERIAL): PESS_ISSUER_SERIAL cdecl; external CLibCrypto; + + function ESS_CERT_ID_new: PESS_CERT_ID cdecl; external CLibCrypto; + procedure ESS_CERT_ID_free(a: PESS_CERT_ID) cdecl; external CLibCrypto; + function i2d_ESS_CERT_ID(a: PESS_CERT_ID; pp: PPByte): TIdC_INT cdecl; external CLibCrypto; + function d2i_ESS_CERT_ID(a: PPESS_CERT_ID; pp: PPByte; length: TIdC_LONG): PESS_CERT_ID cdecl; external CLibCrypto; + function ESS_CERT_ID_dup(a: PESS_CERT_ID): PESS_CERT_ID cdecl; external CLibCrypto; + + function ESS_SIGNING_CERT_new: PESS_SIGNING_Cert cdecl; external CLibCrypto; + procedure ESS_SIGNING_CERT_free(a: PESS_SIGNING_Cert) cdecl; external CLibCrypto; + function i2d_ESS_SIGNING_CERT( a: PESS_SIGNING_Cert; pp: PPByte): TIdC_INT cdecl; external CLibCrypto; + function d2i_ESS_SIGNING_CERT(a: PPESS_SIGNING_Cert; pp: PPByte; length: TIdC_LONG): PESS_SIGNING_Cert cdecl; external CLibCrypto; + function ESS_SIGNING_CERT_dup(a: PESS_SIGNING_Cert): PESS_SIGNING_Cert cdecl; external CLibCrypto; + + function ESS_CERT_ID_V2_new: PESS_CERT_ID_V2 cdecl; external CLibCrypto; + procedure ESS_CERT_ID_V2_free(a: PESS_CERT_ID_V2) cdecl; external CLibCrypto; + function i2d_ESS_CERT_ID_V2( a: PESS_CERT_ID_V2; pp: PPByte): TIdC_INT cdecl; external CLibCrypto; + function d2i_ESS_CERT_ID_V2(a: PPESS_CERT_ID_V2; pp: PPByte; length: TIdC_LONG): PESS_CERT_ID_V2 cdecl; external CLibCrypto; + function ESS_CERT_ID_V2_dup(a: PESS_CERT_ID_V2): PESS_CERT_ID_V2 cdecl; external CLibCrypto; + + function ESS_SIGNING_CERT_V2_new: PESS_SIGNING_CERT_V2 cdecl; external CLibCrypto; + procedure ESS_SIGNING_CERT_V2_free(a: PESS_SIGNING_CERT_V2) cdecl; external CLibCrypto; + function i2d_ESS_SIGNING_CERT_V2(a: PESS_SIGNING_CERT_V2; pp: PPByte): TIdC_INT cdecl; external CLibCrypto; + function d2i_ESS_SIGNING_CERT_V2(a: PPESS_SIGNING_CERT_V2; pp: PPByte; length: TIdC_LONG): PESS_SIGNING_CERT_V2 cdecl; external CLibCrypto; + function ESS_SIGNING_CERT_V2_dup(a: PESS_SIGNING_CERT_V2): PESS_SIGNING_CERT_V2 cdecl; external CLibCrypto; + + function TS_REQ_set_version(a: PTS_REQ; version: TIdC_LONG): TIdC_INT cdecl; external CLibCrypto; + function TS_REQ_get_version(a: PTS_REQ): TIdC_LONG cdecl; external CLibCrypto; + + function TS_STATUS_INFO_set_status(a: PTS_STATUS_INFO; i: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function TS_STATUS_INFO_get0_status(const a: PTS_STATUS_INFO): PASN1_INTEGER cdecl; external CLibCrypto; + + // const STACK_OF(ASN1_UTF8STRING) *TS_STATUS_INFO_get0_text(const TS_STATUS_INFO *a); + + // const ASN1_BIT_STRING *TS_STATUS_INFO_get0_failure_info(const TS_STATUS_INFO *a); + + function TS_REQ_set_msg_imprint(a: PTS_REQ; msg_imprint: PTS_MSG_IMPRINT): TIdC_INT cdecl; external CLibCrypto; + function TS_REQ_get_msg_imprint(a: PTS_REQ): PTS_MSG_IMPRINT cdecl; external CLibCrypto; + + function TS_MSG_IMPRINT_set_algo(a: PTS_MSG_IMPRINT; alg: PX509_ALGOr): TIdC_INT cdecl; external CLibCrypto; + function TS_MSG_IMPRINT_get_algo(a: PTS_MSG_IMPRINT): PX509_ALGOr cdecl; external CLibCrypto; + + function TS_MSG_IMPRINT_set_msg(a: PTS_MSG_IMPRINT; d: PByte; len: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function TS_MSG_IMPRINT_get_msg(a: PTS_MSG_IMPRINT): PASN1_OCTET_STRING cdecl; external CLibCrypto; + + function TS_REQ_set_policy_id(a: PTS_REQ; policy: PASN1_OBJECT): TIdC_INT cdecl; external CLibCrypto; + function TS_REQ_get_policy_id(a: PTS_REQ): PASN1_OBJECT cdecl; external CLibCrypto; + + function TS_REQ_set_nonce(a: PTS_REQ; nonce: PASN1_INTEGER): TIdC_INT cdecl; external CLibCrypto; + function TS_REQ_get_nonce(const a: PTS_REQ): PASN1_INTEGER cdecl; external CLibCrypto; + + function TS_REQ_set_cert_req(a: PTS_REQ; cert_req: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function TS_REQ_get_cert_req(a: PTS_REQ): TIdC_INT cdecl; external CLibCrypto; + + //STACK_OF(X509_EXTENSION) *TS_REQ_get_exts(TS_REQ *a); + procedure TS_REQ_ext_free(a: PTS_REQ) cdecl; external CLibCrypto; + function TS_REQ_get_ext_count(a: PTS_REQ): TIdC_INT cdecl; external CLibCrypto; + function TS_REQ_get_ext_by_NID(a: PTS_REQ; nid: TIdC_INT; lastpos: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function TS_REQ_get_ext_by_OBJ(a: PTS_REQ; obj: PASN1_Object; lastpos: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function TS_REQ_get_ext_by_critical(a: PTS_REQ; crit: TIdC_INT; lastpos: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function TS_REQ_get_ext(a: PTS_REQ; loc: TIdC_INT): PX509_Extension cdecl; external CLibCrypto; + function TS_REQ_delete_ext(a: PTS_REQ; loc: TIdC_INT): PX509_Extension cdecl; external CLibCrypto; + function TS_REQ_add_ext(a: PTS_REQ; ex: PX509_Extension; loc: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function TS_REQ_get_ext_d2i(a: PTS_REQ; nid: TIdC_INT; crit: PIdC_INT; idx: PIdC_INT): Pointer cdecl; external CLibCrypto; + + //* Function declarations for TS_REQ defined in ts/ts_req_print.c */ + + function TS_REQ_print_bio(bio: PBIO; a: PTS_REQ): TIdC_INT cdecl; external CLibCrypto; + + //* Function declarations for TS_RESP defined in ts/ts_resp_utils.c */ + + function TS_RESP_set_status_info(a: PTS_RESP; info: PTS_STATUS_INFO): TIdC_INT cdecl; external CLibCrypto; + function TS_RESP_get_status_info(a: PTS_RESP): PTS_STATUS_INFO cdecl; external CLibCrypto; + + //* Caller loses ownership of PKCS7 and TS_TST_INFO objects. */ + procedure TS_RESP_set_tst_info(a: PTS_RESP; p7: PPKCS7; tst_info: PTS_TST_Info) cdecl; external CLibCrypto; + function TS_RESP_get_token(a: PTS_RESP): PPKCS7 cdecl; external CLibCrypto; + function TS_RESP_get_tst_info(a: PTS_RESP): PTS_TST_Info cdecl; external CLibCrypto; + + function TS_TST_INFO_set_version(a: PTS_TST_Info; version: TIdC_LONG): TIdC_INT cdecl; external CLibCrypto; + function TS_TST_INFO_get_version(const a: PTS_TST_Info): TIdC_LONG cdecl; external CLibCrypto; + + function TS_TST_INFO_set_policy_id(a: PTS_TST_Info; policy_id: PASN1_Object): TIdC_INT cdecl; external CLibCrypto; + function TS_TST_INFO_get_policy_id(a: PTS_TST_Info): PASN1_Object cdecl; external CLibCrypto; + + function TS_TST_INFO_set_msg_imprint(a: PTS_TST_Info; msg_imprint: PTS_MSG_IMPRINT): TIdC_INT cdecl; external CLibCrypto; + function TS_TST_INFO_get_msg_imprint(a: PTS_TST_Info): PTS_MSG_IMPRINT cdecl; external CLibCrypto; + + function TS_TST_INFO_set_serial(a: PTS_TST_Info; const serial: PASN1_INTEGER): TIdC_INT cdecl; external CLibCrypto; + function TS_TST_INFO_get_serial(const a: PTS_TST_INFO): PASN1_INTEGER cdecl; external CLibCrypto; + + function TS_TST_INFO_set_time(a: PTS_TST_Info; gtime: PASN1_GENERALIZEDTIME): TIdC_INT cdecl; external CLibCrypto; + function TS_TST_INFO_get_time(const a: PTS_TST_INFO): PASN1_GENERALIZEDTIME cdecl; external CLibCrypto; + + function TS_TST_INFO_set_accuracy(a: PTS_TST_Info; accuracy: PTS_ACCURACY): TIdC_INT cdecl; external CLibCrypto; + function TS_TST_INFO_get_accuracy(a: PTS_TST_Info): PTS_ACCURACY cdecl; external CLibCrypto; + + function TS_ACCURACY_set_seconds(a: PTS_ACCURACY; const seconds: PASN1_INTEGER): TIdC_INT cdecl; external CLibCrypto; + function TS_ACCURACY_get_seconds(const a: PTS_ACCURACY): PASN1_INTEGER cdecl; external CLibCrypto; + + function TS_ACCURACY_set_millis(a: PTS_ACCURACY; const millis: PASN1_INTEGER): TIdC_INT cdecl; external CLibCrypto; + function TS_ACCURACY_get_millis(const a: PTS_ACCURACY): PASN1_INTEGER cdecl; external CLibCrypto; + + function TS_ACCURACY_set_micros(a: PTS_ACCURACY; const micros: PASN1_INTEGER): TIdC_INT cdecl; external CLibCrypto; + function TS_ACCURACY_get_micros(const a: PTS_ACCURACY): PASN1_INTEGER cdecl; external CLibCrypto; + + function TS_TST_INFO_set_ordering(a: PTS_TST_Info; ordering: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function TS_TST_INFO_get_ordering(const a: PTS_TST_Info): TIdC_INT cdecl; external CLibCrypto; + + function TS_TST_INFO_set_nonce(a: PTS_TST_Info; const nonce: PASN1_INTEGER): TIdC_INT cdecl; external CLibCrypto; + function TS_TST_INFO_get_nonce(const a: PTS_TST_INFO): PASN1_INTEGER cdecl; external CLibCrypto; + + function TS_TST_INFO_set_tsa(a: PTS_TST_Info; tsa: PGENERAL_NAME): TIdC_INT cdecl; external CLibCrypto; + function TS_TST_INFO_get_tsa(a: PTS_TST_Info): PGENERAL_NAME cdecl; external CLibCrypto; + + //STACK_OF(X509_EXTENSION) *TS_TST_INFO_get_exts(TS_TST_INFO *a); + procedure TS_TST_INFO_ext_free(a: PTS_TST_Info) cdecl; external CLibCrypto; + function TS_TST_INFO_get_ext_count(a: PTS_TST_Info): TIdC_INT cdecl; external CLibCrypto; + function TS_TST_INFO_get_ext_by_NID(a: PTS_TST_Info; nid: TIdC_INT; lastpos: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function TS_TST_INFO_get_ext_by_OBJ(a: PTS_TST_Info; const obj: PASN1_Object; lastpos: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function TS_TST_INFO_get_ext_by_critical(a: PTS_TST_Info; crit: TIdC_INT; lastpos: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function TS_TST_INFO_get_ext(a: PTS_TST_Info; loc: TIdC_INT): PX509_Extension cdecl; external CLibCrypto; + function TS_TST_INFO_delete_ext(a: PTS_TST_Info; loc: TIdC_INT): PX509_Extension cdecl; external CLibCrypto; + function TS_TST_INFO_add_ext(a: PTS_TST_Info; ex: PX509_Extension; loc: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function TS_TST_INFO_get_ext_d2i(a: PTS_TST_Info; nid: TIdC_INT; crit: PIdC_INT; idx: PIdC_INT): Pointer cdecl; external CLibCrypto; + + (* + * Declarations related to response generation, defined in ts/ts_resp_sign.c. + *) + + //DEFINE_STACK_OF_CONST(EVP_MD) + + (* Creates a response context that can be used for generating responses. *) + function TS_RESP_CTX_new: PTS_RESP_CTX cdecl; external CLibCrypto; + procedure TS_RESP_CTX_free(ctx: PTS_RESP_CTX) cdecl; external CLibCrypto; + + (* This parameter must be set. *) + function TS_RESP_CTX_set_signer_cert(ctx: PTS_RESP_CTX; signer: PX509): TIdC_INT cdecl; external CLibCrypto; + + (* This parameter must be set. *) + function TS_RESP_CTX_set_signer_key(ctx: PTS_RESP_CTX; key: PEVP_PKEY): TIdC_INT cdecl; external CLibCrypto; + + function TS_RESP_CTX_set_signer_digest(ctx: PTS_RESP_CTX; signer_digest: PEVP_MD): TIdC_INT cdecl; external CLibCrypto; + function TS_RESP_CTX_set_ess_cert_id_digest(ctx: PTS_RESP_CTX; md: PEVP_MD): TIdC_INT cdecl; external CLibCrypto; + + (* This parameter must be set. *) + function TS_RESP_CTX_set_def_policy(ctx: PTS_RESP_CTX; def_policy: PASN1_Object): TIdC_INT cdecl; external CLibCrypto; + + (* No additional certs are included in the response by default. *) + // int TS_RESP_CTX_set_certs(TS_RESP_CTX *ctx, STACK_OF(X509) *certs); + + (* + * Adds a new acceptable policy, only the default policy is accepted by + * default. + *) + function TS_RESP_CTX_add_policy(ctx: PTS_RESP_CTX; const policy: PASN1_Object): TIdC_INT cdecl; external CLibCrypto; + + (* + * Adds a new acceptable message digest. Note that no message digests are + * accepted by default. The md argument is shared with the caller. + *) + function TS_RESP_CTX_add_md(ctx: PTS_RESP_CTX; const md: PEVP_MD): TIdC_INT cdecl; external CLibCrypto; + + (* Accuracy is not included by default. *) + function TS_RESP_CTX_set_accuracy(ctx: PTS_RESP_CTX; secs: TIdC_INT; millis: TIdC_INT; micros: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + + (* + * Clock precision digits, i.e. the number of decimal digits: '0' means sec, + * '3' msec, '6' usec, and so on. Default is 0. + *) + function TS_RESP_CTX_set_clock_precision_digits(ctx: PTS_RESP_CTX; clock_precision_digits: TIdC_UINT): TIdC_INT cdecl; external CLibCrypto; + + (* No flags are set by default. *) + procedure TS_RESP_CTX_add_flags(ctx: PTS_RESP_CTX; flags: TIdC_INT) cdecl; external CLibCrypto; + + (* Default callback always returns a constant. *) + procedure TS_RESP_CTX_set_serial_cb(ctx: PTS_RESP_CTX; cb: TS_serial_cb; data: Pointer) cdecl; external CLibCrypto; + + (* Default callback uses the gettimeofday() and gmtime() system calls. *) + procedure TS_RESP_CTX_set_time_cb(ctx: PTS_RESP_CTX; cb: TS_time_cb; data: Pointer) cdecl; external CLibCrypto; + + (* + * Default callback rejects all extensions. The extension callback is called + * when the TS_TST_INFO object is already set up and not signed yet. + *) + (* FIXME: extension handling is not tested yet. *) + procedure TS_RESP_CTX_set_extension_cb(ctx: PTS_RESP_CTX; cb: TS_extension_cb; data: Pointer) cdecl; external CLibCrypto; + + (* The following methods can be used in the callbacks. *) + function TS_RESP_CTX_set_status_info(ctx: PTS_RESP_CTX; status: TIdC_INT; text: PIdAnsiChar): TIdC_INT cdecl; external CLibCrypto; + + (* Sets the status info only if it is still TS_STATUS_GRANTED. *) + function TS_RESP_CTX_set_status_info_cond(ctx: PTS_RESP_CTX; status: TIdC_INT; text: PIdAnsiChar): TIdC_INT cdecl; external CLibCrypto; + + function TS_RESP_CTX_add_failure_info(ctx: PTS_RESP_CTX; failure: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + + (* The get methods below can be used in the extension callback. *) + function TS_RESP_CTX_get_request(ctx: PTS_RESP_CTX): PTS_REQ cdecl; external CLibCrypto; + + function TS_RESP_CTX_get_tst_info(ctx: PTS_RESP_CTX): PTS_TST_Info cdecl; external CLibCrypto; + + (* + * Creates the signed TS_TST_INFO and puts it in TS_RESP. + * In case of errors it sets the status info properly. + * Returns NULL only in case of memory allocation/fatal error. + *) + function TS_RESP_create_response(ctx: PTS_RESP_CTX; req_bio: PBIO): PTS_RESP cdecl; external CLibCrypto; + + (* + * Declarations related to response verification, + * they are defined in ts/ts_resp_verify.c. + *) + + //int TS_RESP_verify_signature(PKCS7 *token, STACK_OF(X509) *certs, + // X509_STORE *store, X509 **signer_out); + + (* Context structure for the generic verify method. *) + + function TS_RESP_verify_response(ctx: PTS_VERIFY_CTX; response: PTS_RESP): TIdC_INT cdecl; external CLibCrypto; + function TS_RESP_verify_token(ctx: PTS_VERIFY_CTX; token: PPKCS7): TIdC_INT cdecl; external CLibCrypto; + + (* + * Declarations related to response verification context, + *) + function TS_VERIFY_CTX_new: PTS_VERIFY_CTX cdecl; external CLibCrypto; + procedure TS_VERIFY_CTX_init(ctx: PTS_VERIFY_CTX) cdecl; external CLibCrypto; + procedure TS_VERIFY_CTX_free(ctx: PTS_VERIFY_CTX) cdecl; external CLibCrypto; + procedure TS_VERIFY_CTX_cleanup(ctx: PTS_VERIFY_CTX) cdecl; external CLibCrypto; + function TS_VERIFY_CTX_set_flags(ctx: PTS_VERIFY_CTX; f: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function TS_VERIFY_CTX_add_flags(ctx: PTS_VERIFY_CTX; f: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function TS_VERIFY_CTX_set_data(ctx: PTS_VERIFY_CTX; b: PBIO): PBIO cdecl; external CLibCrypto; + function TS_VERIFY_CTX_set_imprint(ctx: PTS_VERIFY_CTX; hexstr: PByte; len: TIdC_LONG): PByte cdecl; external CLibCrypto; + function TS_VERIFY_CTX_set_store(ctx: PTS_VERIFY_CTX; s: PX509_Store): PX509_Store cdecl; external CLibCrypto; + // STACK_OF(X509) *TS_VERIFY_CTS_set_certs(TS_VERIFY_CTX *ctx, STACK_OF(X509) *certs); + + (*- + * If ctx is NULL, it allocates and returns a new object, otherwise + * it returns ctx. It initialises all the members as follows: + * flags = TS_VFY_ALL_IMPRINT & ~(TS_VFY_TSA_NAME | TS_VFY_SIGNATURE) + * certs = NULL + * store = NULL + * policy = policy from the request or NULL if absent (in this case + * TS_VFY_POLICY is cleared from flags as well) + * md_alg = MD algorithm from request + * imprint, imprint_len = imprint from request + * data = NULL + * nonce, nonce_len = nonce from the request or NULL if absent (in this case + * TS_VFY_NONCE is cleared from flags as well) + * tsa_name = NULL + * Important: after calling this method TS_VFY_SIGNATURE should be added! + *) + function TS_REQ_to_TS_VERIFY_CTX(req: PTS_REQ; ctx: PTS_VERIFY_CTX): PTS_VERIFY_CTX cdecl; external CLibCrypto; + + (* Function declarations for TS_RESP defined in ts/ts_resp_print.c *) + + function TS_RESP_print_bio(bio: PBIO; a: PTS_RESP): TIdC_INT cdecl; external CLibCrypto; + function TS_STATUS_INFO_print_bio(bio: PBIO; a: PTS_STATUS_INFO): TIdC_INT cdecl; external CLibCrypto; + function TS_TST_INFO_print_bio(bio: PBIO; a: PTS_TST_Info): TIdC_INT cdecl; external CLibCrypto; + + (* Common utility functions defined in ts/ts_lib.c *) + + function TS_ASN1_INTEGER_print_bio(bio: PBIO; const num: PASN1_INTEGER): TIdC_INT cdecl; external CLibCrypto; + function TS_OBJ_print_bio(bio: PBIO; const obj: PASN1_Object): TIdC_INT cdecl; external CLibCrypto; + //function TS_ext_print_bio(bio: PBIO; const STACK_OF(): X509_Extension * extensions): TIdC_INT; + function TS_X509_ALGOR_print_bio(bio: PBIO; const alg: PX509_ALGOr): TIdC_INT cdecl; external CLibCrypto; + function TS_MSG_IMPRINT_print_bio(bio: PBIO; msg: PTS_MSG_IMPRINT): TIdC_INT cdecl; external CLibCrypto; + + (* + * Function declarations for handling configuration options, defined in + * ts/ts_conf.c + *) + + function TS_CONF_load_cert(file_: PIdAnsiChar): PX509 cdecl; external CLibCrypto; + function TS_CONF_load_key( file_: PIdAnsiChar; pass: PIdAnsiChar): PEVP_PKey cdecl; external CLibCrypto; + function TS_CONF_set_serial(conf: PCONF; section: PIdAnsiChar; cb: TS_serial_cb; ctx: PTS_RESP_CTX): TIdC_INT cdecl; external CLibCrypto; + //STACK_OF(X509) *TS_CONF_load_certs(const char *file); + function TS_CONF_get_tsa_section(conf: PCONF; const section: PIdAnsiChar): PIdAnsiChar cdecl; external CLibCrypto; + function TS_CONF_set_crypto_device(conf: PCONF; section: PIdAnsiChar; device: PIdAnsiChar): TIdC_INT cdecl; external CLibCrypto; + function TS_CONF_set_default_engine(name: PIdAnsiChar): TIdC_INT cdecl; external CLibCrypto; + function TS_CONF_set_signer_cert(conf: PCONF; section: PIdAnsiChar; cert: PIdAnsiChar; ctx: PTS_RESP_CTX): TIdC_INT cdecl; external CLibCrypto; + function TS_CONF_set_certs(conf: PCONF; section: PIdAnsiChar; certs: PIdAnsiChar; ctx: PTS_RESP_CTX): TIdC_INT cdecl; external CLibCrypto; + function TS_CONF_set_signer_key(conf: PCONF; const section: PIdAnsiChar; key: PIdAnsiChar; pass: PIdAnsiChar; ctx: PTS_RESP_CTX): TIdC_INT cdecl; external CLibCrypto; + function TS_CONF_set_signer_digest(conf: PCONF; section: PIdAnsiChar; md: PIdAnsiChar; ctx: PTS_RESP_CTX): TIdC_INT cdecl; external CLibCrypto; + function TS_CONF_set_def_policy(conf: PCONF; section: PIdAnsiChar; policy: PIdAnsiChar; ctx: PTS_RESP_CTX): TIdC_INT cdecl; external CLibCrypto; + function TS_CONF_set_policies(conf: PCONF; section: PIdAnsiChar; ctx: PTS_RESP_CTX): TIdC_INT cdecl; external CLibCrypto; + function TS_CONF_set_digests(conf: PCONF; section: PIdAnsiChar; ctx: PTS_RESP_CTX): TIdC_INT cdecl; external CLibCrypto; + function TS_CONF_set_accuracy(conf: PCONF; section: PIdAnsiChar; ctx: PTS_RESP_CTX): TIdC_INT cdecl; external CLibCrypto; + function TS_CONF_set_clock_precision_digits(conf: PCONF; section: PIdAnsiChar; ctx: PTS_RESP_CTX): TIdC_INT cdecl; external CLibCrypto; + function TS_CONF_set_ordering(conf: PCONF; section: PIdAnsiChar; ctx: PTS_RESP_CTX): TIdC_INT cdecl; external CLibCrypto; + function TS_CONF_set_tsa_name(conf: PCONF; section: PIdAnsiChar; ctx: PTS_RESP_CTX): TIdC_INT cdecl; external CLibCrypto; + function TS_CONF_set_ess_cert_id_chain(conf: PCONF; section: PIdAnsiChar; ctx: PTS_RESP_CTX): TIdC_INT cdecl; external CLibCrypto; + function TS_CONF_set_ess_cert_id_digest(conf: PCONF; section: PIdAnsiChar; ctx: PTS_RESP_CTX): TIdC_INT cdecl; external CLibCrypto; + +{$ENDIF} + +implementation + + uses + classes, + IdSSLOpenSSLExceptionHandlers, + IdResourceStringsOpenSSL + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + ,IdSSLOpenSSLLoader + {$ENDIF}; + + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +const + TS_REQ_new_procname = 'TS_REQ_new'; + TS_REQ_free_procname = 'TS_REQ_free'; + i2d_TS_REQ_procname = 'i2d_TS_REQ'; + d2i_TS_REQ_procname = 'd2i_TS_REQ'; + + TS_REQ_dup_procname = 'TS_REQ_dup'; + + d2i_TS_REQ_bio_procname = 'd2i_TS_REQ_bio'; + i2d_TS_REQ_bio_procname = 'i2d_TS_REQ_bio'; + + TS_MSG_IMPRINT_new_procname = 'TS_MSG_IMPRINT_new'; + TS_MSG_IMPRINT_free_procname = 'TS_MSG_IMPRINT_free'; + i2d_TS_MSG_IMPRINT_procname = 'i2d_TS_MSG_IMPRINT'; + d2i_TS_MSG_IMPRINT_procname = 'd2i_TS_MSG_IMPRINT'; + + TS_MSG_IMPRINT_dup_procname = 'TS_MSG_IMPRINT_dup'; + + d2i_TS_MSG_IMPRINT_bio_procname = 'd2i_TS_MSG_IMPRINT_bio'; + i2d_TS_MSG_IMPRINT_bio_procname = 'i2d_TS_MSG_IMPRINT_bio'; + + TS_RESP_new_procname = 'TS_RESP_new'; + TS_RESP_free_procname = 'TS_RESP_free'; + i2d_TS_RESP_procname = 'i2d_TS_RESP'; + d2i_TS_RESP_procname = 'd2i_TS_RESP'; + PKCS7_to_TS_TST_INFO_procname = 'PKCS7_to_TS_TST_INFO'; + TS_RESP_dup_procname = 'TS_RESP_dup'; + + d2i_TS_RESP_bio_procname = 'd2i_TS_RESP_bio'; + i2d_TS_RESP_bio_procname = 'i2d_TS_RESP_bio'; + + TS_STATUS_INFO_new_procname = 'TS_STATUS_INFO_new'; + TS_STATUS_INFO_free_procname = 'TS_STATUS_INFO_free'; + i2d_TS_STATUS_INFO_procname = 'i2d_TS_STATUS_INFO'; + d2i_TS_STATUS_INFO_procname = 'd2i_TS_STATUS_INFO'; + TS_STATUS_INFO_dup_procname = 'TS_STATUS_INFO_dup'; + + TS_TST_INFO_new_procname = 'TS_TST_INFO_new'; + TS_TST_INFO_free_procname = 'TS_TST_INFO_free'; + i2d_TS_TST_INFO_procname = 'i2d_TS_TST_INFO'; + d2i_TS_TST_INFO_procname = 'd2i_TS_TST_INFO'; + TS_TST_INFO_dup_procname = 'TS_TST_INFO_dup'; + + d2i_TS_TST_INFO_bio_procname = 'd2i_TS_TST_INFO_bio'; + i2d_TS_TST_INFO_bio_procname = 'i2d_TS_TST_INFO_bio'; + + TS_ACCURACY_new_procname = 'TS_ACCURACY_new'; + TS_ACCURACY_free_procname = 'TS_ACCURACY_free'; + i2d_TS_ACCURACY_procname = 'i2d_TS_ACCURACY'; + d2i_TS_ACCURACY_procname = 'd2i_TS_ACCURACY'; + TS_ACCURACY_dup_procname = 'TS_ACCURACY_dup'; + + ESS_ISSUER_SERIAL_new_procname = 'ESS_ISSUER_SERIAL_new'; + ESS_ISSUER_SERIAL_free_procname = 'ESS_ISSUER_SERIAL_free'; + i2d_ESS_ISSUER_SERIAL_procname = 'i2d_ESS_ISSUER_SERIAL'; + d2i_ESS_ISSUER_SERIAL_procname = 'd2i_ESS_ISSUER_SERIAL'; + ESS_ISSUER_SERIAL_dup_procname = 'ESS_ISSUER_SERIAL_dup'; + + ESS_CERT_ID_new_procname = 'ESS_CERT_ID_new'; + ESS_CERT_ID_free_procname = 'ESS_CERT_ID_free'; + i2d_ESS_CERT_ID_procname = 'i2d_ESS_CERT_ID'; + d2i_ESS_CERT_ID_procname = 'd2i_ESS_CERT_ID'; + ESS_CERT_ID_dup_procname = 'ESS_CERT_ID_dup'; + + ESS_SIGNING_CERT_new_procname = 'ESS_SIGNING_CERT_new'; + ESS_SIGNING_CERT_free_procname = 'ESS_SIGNING_CERT_free'; + i2d_ESS_SIGNING_CERT_procname = 'i2d_ESS_SIGNING_CERT'; + d2i_ESS_SIGNING_CERT_procname = 'd2i_ESS_SIGNING_CERT'; + ESS_SIGNING_CERT_dup_procname = 'ESS_SIGNING_CERT_dup'; + + ESS_CERT_ID_V2_new_procname = 'ESS_CERT_ID_V2_new'; + ESS_CERT_ID_V2_free_procname = 'ESS_CERT_ID_V2_free'; + i2d_ESS_CERT_ID_V2_procname = 'i2d_ESS_CERT_ID_V2'; + d2i_ESS_CERT_ID_V2_procname = 'd2i_ESS_CERT_ID_V2'; + ESS_CERT_ID_V2_dup_procname = 'ESS_CERT_ID_V2_dup'; + + ESS_SIGNING_CERT_V2_new_procname = 'ESS_SIGNING_CERT_V2_new'; + ESS_SIGNING_CERT_V2_free_procname = 'ESS_SIGNING_CERT_V2_free'; + i2d_ESS_SIGNING_CERT_V2_procname = 'i2d_ESS_SIGNING_CERT_V2'; + d2i_ESS_SIGNING_CERT_V2_procname = 'd2i_ESS_SIGNING_CERT_V2'; + ESS_SIGNING_CERT_V2_dup_procname = 'ESS_SIGNING_CERT_V2_dup'; + + TS_REQ_set_version_procname = 'TS_REQ_set_version'; + TS_REQ_get_version_procname = 'TS_REQ_get_version'; + + TS_STATUS_INFO_set_status_procname = 'TS_STATUS_INFO_set_status'; + TS_STATUS_INFO_get0_status_procname = 'TS_STATUS_INFO_get0_status'; + + // const STACK_OF(ASN1_UTF8STRING) *TS_STATUS_INFO_get0_text(const TS_STATUS_INFO *a); + + // const ASN1_BIT_STRING *TS_STATUS_INFO_get0_failure_info(const TS_STATUS_INFO *a); + + TS_REQ_set_msg_imprint_procname = 'TS_REQ_set_msg_imprint'; + TS_REQ_get_msg_imprint_procname = 'TS_REQ_get_msg_imprint'; + + TS_MSG_IMPRINT_set_algo_procname = 'TS_MSG_IMPRINT_set_algo'; + TS_MSG_IMPRINT_get_algo_procname = 'TS_MSG_IMPRINT_get_algo'; + + TS_MSG_IMPRINT_set_msg_procname = 'TS_MSG_IMPRINT_set_msg'; + TS_MSG_IMPRINT_get_msg_procname = 'TS_MSG_IMPRINT_get_msg'; + + TS_REQ_set_policy_id_procname = 'TS_REQ_set_policy_id'; + TS_REQ_get_policy_id_procname = 'TS_REQ_get_policy_id'; + + TS_REQ_set_nonce_procname = 'TS_REQ_set_nonce'; + TS_REQ_get_nonce_procname = 'TS_REQ_get_nonce'; + + TS_REQ_set_cert_req_procname = 'TS_REQ_set_cert_req'; + TS_REQ_get_cert_req_procname = 'TS_REQ_get_cert_req'; + + //STACK_OF(X509_EXTENSION) *TS_REQ_get_exts(TS_REQ *a); + TS_REQ_ext_free_procname = 'TS_REQ_ext_free'; + TS_REQ_get_ext_count_procname = 'TS_REQ_get_ext_count'; + TS_REQ_get_ext_by_NID_procname = 'TS_REQ_get_ext_by_NID'; + TS_REQ_get_ext_by_OBJ_procname = 'TS_REQ_get_ext_by_OBJ'; + TS_REQ_get_ext_by_critical_procname = 'TS_REQ_get_ext_by_critical'; + TS_REQ_get_ext_procname = 'TS_REQ_get_ext'; + TS_REQ_delete_ext_procname = 'TS_REQ_delete_ext'; + TS_REQ_add_ext_procname = 'TS_REQ_add_ext'; + TS_REQ_get_ext_d2i_procname = 'TS_REQ_get_ext_d2i'; + + //* Function declarations for TS_REQ defined in ts/ts_req_print.c */ + + TS_REQ_print_bio_procname = 'TS_REQ_print_bio'; + + //* Function declarations for TS_RESP defined in ts/ts_resp_utils.c */ + + TS_RESP_set_status_info_procname = 'TS_RESP_set_status_info'; + TS_RESP_get_status_info_procname = 'TS_RESP_get_status_info'; + + //* Caller loses ownership of PKCS7 and TS_TST_INFO objects. */ + TS_RESP_set_tst_info_procname = 'TS_RESP_set_tst_info'; + TS_RESP_get_token_procname = 'TS_RESP_get_token'; + TS_RESP_get_tst_info_procname = 'TS_RESP_get_tst_info'; + + TS_TST_INFO_set_version_procname = 'TS_TST_INFO_set_version'; + TS_TST_INFO_get_version_procname = 'TS_TST_INFO_get_version'; + + TS_TST_INFO_set_policy_id_procname = 'TS_TST_INFO_set_policy_id'; + TS_TST_INFO_get_policy_id_procname = 'TS_TST_INFO_get_policy_id'; + + TS_TST_INFO_set_msg_imprint_procname = 'TS_TST_INFO_set_msg_imprint'; + TS_TST_INFO_get_msg_imprint_procname = 'TS_TST_INFO_get_msg_imprint'; + + TS_TST_INFO_set_serial_procname = 'TS_TST_INFO_set_serial'; + TS_TST_INFO_get_serial_procname = 'TS_TST_INFO_get_serial'; + + TS_TST_INFO_set_time_procname = 'TS_TST_INFO_set_time'; + TS_TST_INFO_get_time_procname = 'TS_TST_INFO_get_time'; + + TS_TST_INFO_set_accuracy_procname = 'TS_TST_INFO_set_accuracy'; + TS_TST_INFO_get_accuracy_procname = 'TS_TST_INFO_get_accuracy'; + + TS_ACCURACY_set_seconds_procname = 'TS_ACCURACY_set_seconds'; + TS_ACCURACY_get_seconds_procname = 'TS_ACCURACY_get_seconds'; + + TS_ACCURACY_set_millis_procname = 'TS_ACCURACY_set_millis'; + TS_ACCURACY_get_millis_procname = 'TS_ACCURACY_get_millis'; + + TS_ACCURACY_set_micros_procname = 'TS_ACCURACY_set_micros'; + TS_ACCURACY_get_micros_procname = 'TS_ACCURACY_get_micros'; + + TS_TST_INFO_set_ordering_procname = 'TS_TST_INFO_set_ordering'; + TS_TST_INFO_get_ordering_procname = 'TS_TST_INFO_get_ordering'; + + TS_TST_INFO_set_nonce_procname = 'TS_TST_INFO_set_nonce'; + TS_TST_INFO_get_nonce_procname = 'TS_TST_INFO_get_nonce'; + + TS_TST_INFO_set_tsa_procname = 'TS_TST_INFO_set_tsa'; + TS_TST_INFO_get_tsa_procname = 'TS_TST_INFO_get_tsa'; + + //STACK_OF(X509_EXTENSION) *TS_TST_INFO_get_exts(TS_TST_INFO *a); + TS_TST_INFO_ext_free_procname = 'TS_TST_INFO_ext_free'; + TS_TST_INFO_get_ext_count_procname = 'TS_TST_INFO_get_ext_count'; + TS_TST_INFO_get_ext_by_NID_procname = 'TS_TST_INFO_get_ext_by_NID'; + TS_TST_INFO_get_ext_by_OBJ_procname = 'TS_TST_INFO_get_ext_by_OBJ'; + TS_TST_INFO_get_ext_by_critical_procname = 'TS_TST_INFO_get_ext_by_critical'; + TS_TST_INFO_get_ext_procname = 'TS_TST_INFO_get_ext'; + TS_TST_INFO_delete_ext_procname = 'TS_TST_INFO_delete_ext'; + TS_TST_INFO_add_ext_procname = 'TS_TST_INFO_add_ext'; + TS_TST_INFO_get_ext_d2i_procname = 'TS_TST_INFO_get_ext_d2i'; + + (* + * Declarations related to response generation, defined in ts/ts_resp_sign.c. + *) + + //DEFINE_STACK_OF_CONST(EVP_MD) + + (* Creates a response context that can be used for generating responses. *) + TS_RESP_CTX_new_procname = 'TS_RESP_CTX_new'; + TS_RESP_CTX_free_procname = 'TS_RESP_CTX_free'; + + (* This parameter must be set. *) + TS_RESP_CTX_set_signer_cert_procname = 'TS_RESP_CTX_set_signer_cert'; + + (* This parameter must be set. *) + TS_RESP_CTX_set_signer_key_procname = 'TS_RESP_CTX_set_signer_key'; + + TS_RESP_CTX_set_signer_digest_procname = 'TS_RESP_CTX_set_signer_digest'; + TS_RESP_CTX_set_ess_cert_id_digest_procname = 'TS_RESP_CTX_set_ess_cert_id_digest'; + + (* This parameter must be set. *) + TS_RESP_CTX_set_def_policy_procname = 'TS_RESP_CTX_set_def_policy'; + + (* No additional certs are included in the response by default. *) + // int TS_RESP_CTX_set_certs(TS_RESP_CTX *ctx, STACK_OF(X509) *certs); + + (* + * Adds a new acceptable policy, only the default policy is accepted by + * default. + *) + TS_RESP_CTX_add_policy_procname = 'TS_RESP_CTX_add_policy'; + + (* + * Adds a new acceptable message digest. Note that no message digests are + * accepted by default. The md argument is shared with the caller. + *) + TS_RESP_CTX_add_md_procname = 'TS_RESP_CTX_add_md'; + + (* Accuracy is not included by default. *) + TS_RESP_CTX_set_accuracy_procname = 'TS_RESP_CTX_set_accuracy'; + + (* + * Clock precision digits, i.e. the number of decimal digits: '0' means sec, + * '3' msec, '6' usec, and so on. Default is 0. + *) + TS_RESP_CTX_set_clock_precision_digits_procname = 'TS_RESP_CTX_set_clock_precision_digits'; + + (* No flags are set by default. *) + TS_RESP_CTX_add_flags_procname = 'TS_RESP_CTX_add_flags'; + + (* Default callback always returns a constant. *) + TS_RESP_CTX_set_serial_cb_procname = 'TS_RESP_CTX_set_serial_cb'; + + (* Default callback uses the gettimeofday() and gmtime() system calls. *) + TS_RESP_CTX_set_time_cb_procname = 'TS_RESP_CTX_set_time_cb'; + + (* + * Default callback rejects all extensions. The extension callback is called + * when the TS_TST_INFO object is already set up and not signed yet. + *) + (* FIXME: extension handling is not tested yet. *) + TS_RESP_CTX_set_extension_cb_procname = 'TS_RESP_CTX_set_extension_cb'; + + (* The following methods can be used in the callbacks. *) + TS_RESP_CTX_set_status_info_procname = 'TS_RESP_CTX_set_status_info'; + + (* Sets the status info only if it is still TS_STATUS_GRANTED. *) + TS_RESP_CTX_set_status_info_cond_procname = 'TS_RESP_CTX_set_status_info_cond'; + + TS_RESP_CTX_add_failure_info_procname = 'TS_RESP_CTX_add_failure_info'; + + (* The get methods below can be used in the extension callback. *) + TS_RESP_CTX_get_request_procname = 'TS_RESP_CTX_get_request'; + + TS_RESP_CTX_get_tst_info_procname = 'TS_RESP_CTX_get_tst_info'; + + (* + * Creates the signed TS_TST_INFO and puts it in TS_RESP. + * In case of errors it sets the status info properly. + * Returns NULL only in case of memory allocation/fatal error. + *) + TS_RESP_create_response_procname = 'TS_RESP_create_response'; + + (* + * Declarations related to response verification, + * they are defined in ts/ts_resp_verify.c. + *) + + //int TS_RESP_verify_signature(PKCS7 *token, STACK_OF(X509) *certs, + // X509_STORE *store, X509 **signer_out); + + (* Context structure for the generic verify method. *) + + TS_RESP_verify_response_procname = 'TS_RESP_verify_response'; + TS_RESP_verify_token_procname = 'TS_RESP_verify_token'; + + (* + * Declarations related to response verification context, + *) + TS_VERIFY_CTX_new_procname = 'TS_VERIFY_CTX_new'; + TS_VERIFY_CTX_init_procname = 'TS_VERIFY_CTX_init'; + TS_VERIFY_CTX_free_procname = 'TS_VERIFY_CTX_free'; + TS_VERIFY_CTX_cleanup_procname = 'TS_VERIFY_CTX_cleanup'; + TS_VERIFY_CTX_set_flags_procname = 'TS_VERIFY_CTX_set_flags'; + TS_VERIFY_CTX_add_flags_procname = 'TS_VERIFY_CTX_add_flags'; + TS_VERIFY_CTX_set_data_procname = 'TS_VERIFY_CTX_set_data'; + TS_VERIFY_CTX_set_imprint_procname = 'TS_VERIFY_CTX_set_imprint'; + TS_VERIFY_CTX_set_store_procname = 'TS_VERIFY_CTX_set_store'; + // STACK_OF(X509) *TS_VERIFY_CTS_set_certs(TS_VERIFY_CTX *ctx, STACK_OF(X509) *certs); + + (*- + * If ctx is NULL, it allocates and returns a new object, otherwise + * it returns ctx. It initialises all the members as follows: + * flags = TS_VFY_ALL_IMPRINT & ~(TS_VFY_TSA_NAME | TS_VFY_SIGNATURE) + * certs = NULL + * store = NULL + * policy = policy from the request or NULL if absent (in this case + * TS_VFY_POLICY is cleared from flags as well) + * md_alg = MD algorithm from request + * imprint, imprint_len = imprint from request + * data = NULL + * nonce, nonce_len = nonce from the request or NULL if absent (in this case + * TS_VFY_NONCE is cleared from flags as well) + * tsa_name = NULL + * Important: after calling this method TS_VFY_SIGNATURE should be added! + *) + TS_REQ_to_TS_VERIFY_CTX_procname = 'TS_REQ_to_TS_VERIFY_CTX'; + + (* Function declarations for TS_RESP defined in ts/ts_resp_print.c *) + + TS_RESP_print_bio_procname = 'TS_RESP_print_bio'; + TS_STATUS_INFO_print_bio_procname = 'TS_STATUS_INFO_print_bio'; + TS_TST_INFO_print_bio_procname = 'TS_TST_INFO_print_bio'; + + (* Common utility functions defined in ts/ts_lib.c *) + + TS_ASN1_INTEGER_print_bio_procname = 'TS_ASN1_INTEGER_print_bio'; + TS_OBJ_print_bio_procname = 'TS_OBJ_print_bio'; + //function TS_ext_print_bio(bio: PBIO; const STACK_OF(): X509_Extension * extensions): TIdC_INT; + TS_X509_ALGOR_print_bio_procname = 'TS_X509_ALGOR_print_bio'; + TS_MSG_IMPRINT_print_bio_procname = 'TS_MSG_IMPRINT_print_bio'; + + (* + * Function declarations for handling configuration options, defined in + * ts/ts_conf.c + *) + + TS_CONF_load_cert_procname = 'TS_CONF_load_cert'; + TS_CONF_load_key_procname = 'TS_CONF_load_key'; + TS_CONF_set_serial_procname = 'TS_CONF_set_serial'; + //STACK_OF(X509) *TS_CONF_load_certs(const char *file); + TS_CONF_get_tsa_section_procname = 'TS_CONF_get_tsa_section'; + TS_CONF_set_crypto_device_procname = 'TS_CONF_set_crypto_device'; + TS_CONF_set_default_engine_procname = 'TS_CONF_set_default_engine'; + TS_CONF_set_signer_cert_procname = 'TS_CONF_set_signer_cert'; + TS_CONF_set_certs_procname = 'TS_CONF_set_certs'; + TS_CONF_set_signer_key_procname = 'TS_CONF_set_signer_key'; + TS_CONF_set_signer_digest_procname = 'TS_CONF_set_signer_digest'; + TS_CONF_set_def_policy_procname = 'TS_CONF_set_def_policy'; + TS_CONF_set_policies_procname = 'TS_CONF_set_policies'; + TS_CONF_set_digests_procname = 'TS_CONF_set_digests'; + TS_CONF_set_accuracy_procname = 'TS_CONF_set_accuracy'; + TS_CONF_set_clock_precision_digits_procname = 'TS_CONF_set_clock_precision_digits'; + TS_CONF_set_ordering_procname = 'TS_CONF_set_ordering'; + TS_CONF_set_tsa_name_procname = 'TS_CONF_set_tsa_name'; + TS_CONF_set_ess_cert_id_chain_procname = 'TS_CONF_set_ess_cert_id_chain'; + TS_CONF_set_ess_cert_id_digest_procname = 'TS_CONF_set_ess_cert_id_digest'; + + +{$WARN NO_RETVAL OFF} +function ERR_TS_REQ_new: PTS_REQ; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_REQ_new_procname); +end; + + +procedure ERR_TS_REQ_free(a: PTS_REQ); +begin + EIdAPIFunctionNotPresent.RaiseException(TS_REQ_free_procname); +end; + + +function ERR_i2d_TS_REQ(a: PTS_REQ; pp: PPByte): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(i2d_TS_REQ_procname); +end; + + +function ERR_d2i_TS_REQ(a: PPTS_REQ; pp: PPByte; length: TIdC_LONG): PTS_REQ; +begin + EIdAPIFunctionNotPresent.RaiseException(d2i_TS_REQ_procname); +end; + + + +function ERR_TS_REQ_dup(a: PTS_REQ): PTS_REQ; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_REQ_dup_procname); +end; + + + +function ERR_d2i_TS_REQ_bio(fp: PBIO; a: PPTS_REQ): PTS_REQ; +begin + EIdAPIFunctionNotPresent.RaiseException(d2i_TS_REQ_bio_procname); +end; + + +function ERR_i2d_TS_REQ_bio(fp: PBIO; a: PTS_REQ): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(i2d_TS_REQ_bio_procname); +end; + + + +function ERR_TS_MSG_IMPRINT_new: PTS_MSG_IMPRINT; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_MSG_IMPRINT_new_procname); +end; + + +procedure ERR_TS_MSG_IMPRINT_free(a: PTS_MSG_IMPRINT); +begin + EIdAPIFunctionNotPresent.RaiseException(TS_MSG_IMPRINT_free_procname); +end; + + +function ERR_i2d_TS_MSG_IMPRINT(a: PTS_MSG_IMPRINT; pp: PPByte): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(i2d_TS_MSG_IMPRINT_procname); +end; + + +function ERR_d2i_TS_MSG_IMPRINT(a: PPTS_MSG_IMPRINT; pp: PPByte; length: TIdC_LONG): PTS_MSG_IMPRINT; +begin + EIdAPIFunctionNotPresent.RaiseException(d2i_TS_MSG_IMPRINT_procname); +end; + + + +function ERR_TS_MSG_IMPRINT_dup(a: PTS_MSG_IMPRINT): PTS_MSG_IMPRINT; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_MSG_IMPRINT_dup_procname); +end; + + + +function ERR_d2i_TS_MSG_IMPRINT_bio(bio: PBIO; a: PPTS_MSG_IMPRINT): PTS_MSG_IMPRINT; +begin + EIdAPIFunctionNotPresent.RaiseException(d2i_TS_MSG_IMPRINT_bio_procname); +end; + + +function ERR_i2d_TS_MSG_IMPRINT_bio(bio: PBIO; a: PTS_MSG_IMPRINT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(i2d_TS_MSG_IMPRINT_bio_procname); +end; + + + +function ERR_TS_RESP_new: PTS_RESP; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_RESP_new_procname); +end; + + +procedure ERR_TS_RESP_free(a: PTS_RESP); +begin + EIdAPIFunctionNotPresent.RaiseException(TS_RESP_free_procname); +end; + + +function ERR_i2d_TS_RESP(a: PTS_RESP; pp: PPByte): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(i2d_TS_RESP_procname); +end; + + +function ERR_d2i_TS_RESP(a: PPTS_RESP; pp: PPByte; length: TIdC_LONG): PTS_RESP; +begin + EIdAPIFunctionNotPresent.RaiseException(d2i_TS_RESP_procname); +end; + + +function ERR_PKCS7_to_TS_TST_INFO(token: PPKCS7): PTS_TST_Info; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS7_to_TS_TST_INFO_procname); +end; + + +function ERR_TS_RESP_dup(a: PTS_RESP): PTS_RESP; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_RESP_dup_procname); +end; + + + +function ERR_d2i_TS_RESP_bio(bio: PBIO; a: PPTS_RESP): PTS_RESP; +begin + EIdAPIFunctionNotPresent.RaiseException(d2i_TS_RESP_bio_procname); +end; + + +function ERR_i2d_TS_RESP_bio(bio: PBIO; a: PTS_RESP): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(i2d_TS_RESP_bio_procname); +end; + + + +function ERR_TS_STATUS_INFO_new: PTS_STATUS_INFO; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_STATUS_INFO_new_procname); +end; + + +procedure ERR_TS_STATUS_INFO_free(a: PTS_STATUS_INFO); +begin + EIdAPIFunctionNotPresent.RaiseException(TS_STATUS_INFO_free_procname); +end; + + +function ERR_i2d_TS_STATUS_INFO(a: PTS_STATUS_INFO; pp: PPByte): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(i2d_TS_STATUS_INFO_procname); +end; + + +function ERR_d2i_TS_STATUS_INFO(a: PPTS_STATUS_INFO; pp: PPByte; length: TIdC_LONG): PTS_STATUS_INFO; +begin + EIdAPIFunctionNotPresent.RaiseException(d2i_TS_STATUS_INFO_procname); +end; + + +function ERR_TS_STATUS_INFO_dup(a: PTS_STATUS_INFO): PTS_STATUS_INFO; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_STATUS_INFO_dup_procname); +end; + + + +function ERR_TS_TST_INFO_new: PTS_TST_Info; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_TST_INFO_new_procname); +end; + + +procedure ERR_TS_TST_INFO_free(a: PTS_TST_Info); +begin + EIdAPIFunctionNotPresent.RaiseException(TS_TST_INFO_free_procname); +end; + + +function ERR_i2d_TS_TST_INFO(a: PTS_TST_Info; pp: PPByte): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(i2d_TS_TST_INFO_procname); +end; + + +function ERR_d2i_TS_TST_INFO(a: PPTS_TST_Info; pp: PPByte; length: TIdC_LONG): PTS_TST_Info; +begin + EIdAPIFunctionNotPresent.RaiseException(d2i_TS_TST_INFO_procname); +end; + + +function ERR_TS_TST_INFO_dup(a: PTS_TST_Info): PTS_TST_Info; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_TST_INFO_dup_procname); +end; + + + +function ERR_d2i_TS_TST_INFO_bio(bio: PBIO; a: PPTS_TST_Info): PTS_TST_Info; +begin + EIdAPIFunctionNotPresent.RaiseException(d2i_TS_TST_INFO_bio_procname); +end; + + +function ERR_i2d_TS_TST_INFO_bio(bio: PBIO; a: PTS_TST_Info): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(i2d_TS_TST_INFO_bio_procname); +end; + + + +function ERR_TS_ACCURACY_new: PTS_ACCURACY; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_ACCURACY_new_procname); +end; + + +procedure ERR_TS_ACCURACY_free(a: PTS_ACCURACY); +begin + EIdAPIFunctionNotPresent.RaiseException(TS_ACCURACY_free_procname); +end; + + +function ERR_i2d_TS_ACCURACY(a: PTS_ACCURACY; pp: PPByte): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(i2d_TS_ACCURACY_procname); +end; + + +function ERR_d2i_TS_ACCURACY(a: PPTS_ACCURACY; pp: PPByte; length: TIdC_LONG): PTS_ACCURACY; +begin + EIdAPIFunctionNotPresent.RaiseException(d2i_TS_ACCURACY_procname); +end; + + +function ERR_TS_ACCURACY_dup(a: PTS_ACCURACY): PTS_ACCURACY; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_ACCURACY_dup_procname); +end; + + + +function ERR_ESS_ISSUER_SERIAL_new: PESS_ISSUER_SERIAL; +begin + EIdAPIFunctionNotPresent.RaiseException(ESS_ISSUER_SERIAL_new_procname); +end; + + +procedure ERR_ESS_ISSUER_SERIAL_free(a: PESS_ISSUER_SERIAL); +begin + EIdAPIFunctionNotPresent.RaiseException(ESS_ISSUER_SERIAL_free_procname); +end; + + +function ERR_i2d_ESS_ISSUER_SERIAL( a: PESS_ISSUER_SERIAL; pp: PPByte): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(i2d_ESS_ISSUER_SERIAL_procname); +end; + + +function ERR_d2i_ESS_ISSUER_SERIAL(a: PPESS_ISSUER_SERIAL; pp: PPByte; length: TIdC_LONG): PESS_ISSUER_SERIAL; +begin + EIdAPIFunctionNotPresent.RaiseException(d2i_ESS_ISSUER_SERIAL_procname); +end; + + +function ERR_ESS_ISSUER_SERIAL_dup(a: PESS_ISSUER_SERIAL): PESS_ISSUER_SERIAL; +begin + EIdAPIFunctionNotPresent.RaiseException(ESS_ISSUER_SERIAL_dup_procname); +end; + + + +function ERR_ESS_CERT_ID_new: PESS_CERT_ID; +begin + EIdAPIFunctionNotPresent.RaiseException(ESS_CERT_ID_new_procname); +end; + + +procedure ERR_ESS_CERT_ID_free(a: PESS_CERT_ID); +begin + EIdAPIFunctionNotPresent.RaiseException(ESS_CERT_ID_free_procname); +end; + + +function ERR_i2d_ESS_CERT_ID(a: PESS_CERT_ID; pp: PPByte): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(i2d_ESS_CERT_ID_procname); +end; + + +function ERR_d2i_ESS_CERT_ID(a: PPESS_CERT_ID; pp: PPByte; length: TIdC_LONG): PESS_CERT_ID; +begin + EIdAPIFunctionNotPresent.RaiseException(d2i_ESS_CERT_ID_procname); +end; + + +function ERR_ESS_CERT_ID_dup(a: PESS_CERT_ID): PESS_CERT_ID; +begin + EIdAPIFunctionNotPresent.RaiseException(ESS_CERT_ID_dup_procname); +end; + + + +function ERR_ESS_SIGNING_CERT_new: PESS_SIGNING_Cert; +begin + EIdAPIFunctionNotPresent.RaiseException(ESS_SIGNING_CERT_new_procname); +end; + + +procedure ERR_ESS_SIGNING_CERT_free(a: PESS_SIGNING_Cert); +begin + EIdAPIFunctionNotPresent.RaiseException(ESS_SIGNING_CERT_free_procname); +end; + + +function ERR_i2d_ESS_SIGNING_CERT( a: PESS_SIGNING_Cert; pp: PPByte): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(i2d_ESS_SIGNING_CERT_procname); +end; + + +function ERR_d2i_ESS_SIGNING_CERT(a: PPESS_SIGNING_Cert; pp: PPByte; length: TIdC_LONG): PESS_SIGNING_Cert; +begin + EIdAPIFunctionNotPresent.RaiseException(d2i_ESS_SIGNING_CERT_procname); +end; + + +function ERR_ESS_SIGNING_CERT_dup(a: PESS_SIGNING_Cert): PESS_SIGNING_Cert; +begin + EIdAPIFunctionNotPresent.RaiseException(ESS_SIGNING_CERT_dup_procname); +end; + + + +function ERR_ESS_CERT_ID_V2_new: PESS_CERT_ID_V2; +begin + EIdAPIFunctionNotPresent.RaiseException(ESS_CERT_ID_V2_new_procname); +end; + + +procedure ERR_ESS_CERT_ID_V2_free(a: PESS_CERT_ID_V2); +begin + EIdAPIFunctionNotPresent.RaiseException(ESS_CERT_ID_V2_free_procname); +end; + + +function ERR_i2d_ESS_CERT_ID_V2( a: PESS_CERT_ID_V2; pp: PPByte): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(i2d_ESS_CERT_ID_V2_procname); +end; + + +function ERR_d2i_ESS_CERT_ID_V2(a: PPESS_CERT_ID_V2; pp: PPByte; length: TIdC_LONG): PESS_CERT_ID_V2; +begin + EIdAPIFunctionNotPresent.RaiseException(d2i_ESS_CERT_ID_V2_procname); +end; + + +function ERR_ESS_CERT_ID_V2_dup(a: PESS_CERT_ID_V2): PESS_CERT_ID_V2; +begin + EIdAPIFunctionNotPresent.RaiseException(ESS_CERT_ID_V2_dup_procname); +end; + + + +function ERR_ESS_SIGNING_CERT_V2_new: PESS_SIGNING_CERT_V2; +begin + EIdAPIFunctionNotPresent.RaiseException(ESS_SIGNING_CERT_V2_new_procname); +end; + + +procedure ERR_ESS_SIGNING_CERT_V2_free(a: PESS_SIGNING_CERT_V2); +begin + EIdAPIFunctionNotPresent.RaiseException(ESS_SIGNING_CERT_V2_free_procname); +end; + + +function ERR_i2d_ESS_SIGNING_CERT_V2(a: PESS_SIGNING_CERT_V2; pp: PPByte): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(i2d_ESS_SIGNING_CERT_V2_procname); +end; + + +function ERR_d2i_ESS_SIGNING_CERT_V2(a: PPESS_SIGNING_CERT_V2; pp: PPByte; length: TIdC_LONG): PESS_SIGNING_CERT_V2; +begin + EIdAPIFunctionNotPresent.RaiseException(d2i_ESS_SIGNING_CERT_V2_procname); +end; + + +function ERR_ESS_SIGNING_CERT_V2_dup(a: PESS_SIGNING_CERT_V2): PESS_SIGNING_CERT_V2; +begin + EIdAPIFunctionNotPresent.RaiseException(ESS_SIGNING_CERT_V2_dup_procname); +end; + + + +function ERR_TS_REQ_set_version(a: PTS_REQ; version: TIdC_LONG): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_REQ_set_version_procname); +end; + + +function ERR_TS_REQ_get_version(a: PTS_REQ): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_REQ_get_version_procname); +end; + + + +function ERR_TS_STATUS_INFO_set_status(a: PTS_STATUS_INFO; i: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_STATUS_INFO_set_status_procname); +end; + + +function ERR_TS_STATUS_INFO_get0_status(const a: PTS_STATUS_INFO): PASN1_INTEGER; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_STATUS_INFO_get0_status_procname); +end; + + + + // const STACK_OF(ASN1_UTF8STRING) *TS_STATUS_INFO_get0_text(const TS_STATUS_INFO *a); + + // const ASN1_BIT_STRING *TS_STATUS_INFO_get0_failure_info(const TS_STATUS_INFO *a); + +function ERR_TS_REQ_set_msg_imprint(a: PTS_REQ; msg_imprint: PTS_MSG_IMPRINT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_REQ_set_msg_imprint_procname); +end; + + +function ERR_TS_REQ_get_msg_imprint(a: PTS_REQ): PTS_MSG_IMPRINT; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_REQ_get_msg_imprint_procname); +end; + + + +function ERR_TS_MSG_IMPRINT_set_algo(a: PTS_MSG_IMPRINT; alg: PX509_ALGOr): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_MSG_IMPRINT_set_algo_procname); +end; + + +function ERR_TS_MSG_IMPRINT_get_algo(a: PTS_MSG_IMPRINT): PX509_ALGOr; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_MSG_IMPRINT_get_algo_procname); +end; + + + +function ERR_TS_MSG_IMPRINT_set_msg(a: PTS_MSG_IMPRINT; d: PByte; len: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_MSG_IMPRINT_set_msg_procname); +end; + + +function ERR_TS_MSG_IMPRINT_get_msg(a: PTS_MSG_IMPRINT): PASN1_OCTET_STRING; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_MSG_IMPRINT_get_msg_procname); +end; + + + +function ERR_TS_REQ_set_policy_id(a: PTS_REQ; policy: PASN1_OBJECT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_REQ_set_policy_id_procname); +end; + + +function ERR_TS_REQ_get_policy_id(a: PTS_REQ): PASN1_OBJECT; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_REQ_get_policy_id_procname); +end; + + + +function ERR_TS_REQ_set_nonce(a: PTS_REQ; nonce: PASN1_INTEGER): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_REQ_set_nonce_procname); +end; + + +function ERR_TS_REQ_get_nonce(const a: PTS_REQ): PASN1_INTEGER; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_REQ_get_nonce_procname); +end; + + + +function ERR_TS_REQ_set_cert_req(a: PTS_REQ; cert_req: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_REQ_set_cert_req_procname); +end; + + +function ERR_TS_REQ_get_cert_req(a: PTS_REQ): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_REQ_get_cert_req_procname); +end; + + + + //STACK_OF(X509_EXTENSION) *TS_REQ_get_exts(TS_REQ *a); +procedure ERR_TS_REQ_ext_free(a: PTS_REQ); +begin + EIdAPIFunctionNotPresent.RaiseException(TS_REQ_ext_free_procname); +end; + + +function ERR_TS_REQ_get_ext_count(a: PTS_REQ): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_REQ_get_ext_count_procname); +end; + + +function ERR_TS_REQ_get_ext_by_NID(a: PTS_REQ; nid: TIdC_INT; lastpos: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_REQ_get_ext_by_NID_procname); +end; + + +function ERR_TS_REQ_get_ext_by_OBJ(a: PTS_REQ; obj: PASN1_Object; lastpos: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_REQ_get_ext_by_OBJ_procname); +end; + + +function ERR_TS_REQ_get_ext_by_critical(a: PTS_REQ; crit: TIdC_INT; lastpos: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_REQ_get_ext_by_critical_procname); +end; + + +function ERR_TS_REQ_get_ext(a: PTS_REQ; loc: TIdC_INT): PX509_Extension; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_REQ_get_ext_procname); +end; + + +function ERR_TS_REQ_delete_ext(a: PTS_REQ; loc: TIdC_INT): PX509_Extension; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_REQ_delete_ext_procname); +end; + + +function ERR_TS_REQ_add_ext(a: PTS_REQ; ex: PX509_Extension; loc: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_REQ_add_ext_procname); +end; + + +function ERR_TS_REQ_get_ext_d2i(a: PTS_REQ; nid: TIdC_INT; crit: PIdC_INT; idx: PIdC_INT): Pointer; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_REQ_get_ext_d2i_procname); +end; + + + + //* Function declarations for TS_REQ defined in ts/ts_req_print.c */ + +function ERR_TS_REQ_print_bio(bio: PBIO; a: PTS_REQ): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_REQ_print_bio_procname); +end; + + + + //* Function declarations for TS_RESP defined in ts/ts_resp_utils.c */ + +function ERR_TS_RESP_set_status_info(a: PTS_RESP; info: PTS_STATUS_INFO): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_RESP_set_status_info_procname); +end; + + +function ERR_TS_RESP_get_status_info(a: PTS_RESP): PTS_STATUS_INFO; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_RESP_get_status_info_procname); +end; + + + + //* Caller loses ownership of PKCS7 and TS_TST_INFO objects. */ +procedure ERR_TS_RESP_set_tst_info(a: PTS_RESP; p7: PPKCS7; tst_info: PTS_TST_Info); +begin + EIdAPIFunctionNotPresent.RaiseException(TS_RESP_set_tst_info_procname); +end; + + +function ERR_TS_RESP_get_token(a: PTS_RESP): PPKCS7; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_RESP_get_token_procname); +end; + + +function ERR_TS_RESP_get_tst_info(a: PTS_RESP): PTS_TST_Info; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_RESP_get_tst_info_procname); +end; + + + +function ERR_TS_TST_INFO_set_version(a: PTS_TST_Info; version: TIdC_LONG): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_TST_INFO_set_version_procname); +end; + + +function ERR_TS_TST_INFO_get_version(const a: PTS_TST_Info): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_TST_INFO_get_version_procname); +end; + + + +function ERR_TS_TST_INFO_set_policy_id(a: PTS_TST_Info; policy_id: PASN1_Object): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_TST_INFO_set_policy_id_procname); +end; + + +function ERR_TS_TST_INFO_get_policy_id(a: PTS_TST_Info): PASN1_Object; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_TST_INFO_get_policy_id_procname); +end; + + + +function ERR_TS_TST_INFO_set_msg_imprint(a: PTS_TST_Info; msg_imprint: PTS_MSG_IMPRINT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_TST_INFO_set_msg_imprint_procname); +end; + + +function ERR_TS_TST_INFO_get_msg_imprint(a: PTS_TST_Info): PTS_MSG_IMPRINT; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_TST_INFO_get_msg_imprint_procname); +end; + + + +function ERR_TS_TST_INFO_set_serial(a: PTS_TST_Info; const serial: PASN1_INTEGER): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_TST_INFO_set_serial_procname); +end; + + +function ERR_TS_TST_INFO_get_serial(const a: PTS_TST_INFO): PASN1_INTEGER; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_TST_INFO_get_serial_procname); +end; + + + +function ERR_TS_TST_INFO_set_time(a: PTS_TST_Info; gtime: PASN1_GENERALIZEDTIME): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_TST_INFO_set_time_procname); +end; + + +function ERR_TS_TST_INFO_get_time(const a: PTS_TST_INFO): PASN1_GENERALIZEDTIME; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_TST_INFO_get_time_procname); +end; + + + +function ERR_TS_TST_INFO_set_accuracy(a: PTS_TST_Info; accuracy: PTS_ACCURACY): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_TST_INFO_set_accuracy_procname); +end; + + +function ERR_TS_TST_INFO_get_accuracy(a: PTS_TST_Info): PTS_ACCURACY; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_TST_INFO_get_accuracy_procname); +end; + + + +function ERR_TS_ACCURACY_set_seconds(a: PTS_ACCURACY; const seconds: PASN1_INTEGER): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_ACCURACY_set_seconds_procname); +end; + + +function ERR_TS_ACCURACY_get_seconds(const a: PTS_ACCURACY): PASN1_INTEGER; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_ACCURACY_get_seconds_procname); +end; + + + +function ERR_TS_ACCURACY_set_millis(a: PTS_ACCURACY; const millis: PASN1_INTEGER): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_ACCURACY_set_millis_procname); +end; + + +function ERR_TS_ACCURACY_get_millis(const a: PTS_ACCURACY): PASN1_INTEGER; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_ACCURACY_get_millis_procname); +end; + + + +function ERR_TS_ACCURACY_set_micros(a: PTS_ACCURACY; const micros: PASN1_INTEGER): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_ACCURACY_set_micros_procname); +end; + + +function ERR_TS_ACCURACY_get_micros(const a: PTS_ACCURACY): PASN1_INTEGER; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_ACCURACY_get_micros_procname); +end; + + + +function ERR_TS_TST_INFO_set_ordering(a: PTS_TST_Info; ordering: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_TST_INFO_set_ordering_procname); +end; + + +function ERR_TS_TST_INFO_get_ordering(const a: PTS_TST_Info): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_TST_INFO_get_ordering_procname); +end; + + + +function ERR_TS_TST_INFO_set_nonce(a: PTS_TST_Info; const nonce: PASN1_INTEGER): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_TST_INFO_set_nonce_procname); +end; + + +function ERR_TS_TST_INFO_get_nonce(const a: PTS_TST_INFO): PASN1_INTEGER; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_TST_INFO_get_nonce_procname); +end; + + + +function ERR_TS_TST_INFO_set_tsa(a: PTS_TST_Info; tsa: PGENERAL_NAME): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_TST_INFO_set_tsa_procname); +end; + + +function ERR_TS_TST_INFO_get_tsa(a: PTS_TST_Info): PGENERAL_NAME; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_TST_INFO_get_tsa_procname); +end; + + + + //STACK_OF(X509_EXTENSION) *TS_TST_INFO_get_exts(TS_TST_INFO *a); +procedure ERR_TS_TST_INFO_ext_free(a: PTS_TST_Info); +begin + EIdAPIFunctionNotPresent.RaiseException(TS_TST_INFO_ext_free_procname); +end; + + +function ERR_TS_TST_INFO_get_ext_count(a: PTS_TST_Info): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_TST_INFO_get_ext_count_procname); +end; + + +function ERR_TS_TST_INFO_get_ext_by_NID(a: PTS_TST_Info; nid: TIdC_INT; lastpos: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_TST_INFO_get_ext_by_NID_procname); +end; + + +function ERR_TS_TST_INFO_get_ext_by_OBJ(a: PTS_TST_Info; const obj: PASN1_Object; lastpos: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_TST_INFO_get_ext_by_OBJ_procname); +end; + + +function ERR_TS_TST_INFO_get_ext_by_critical(a: PTS_TST_Info; crit: TIdC_INT; lastpos: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_TST_INFO_get_ext_by_critical_procname); +end; + + +function ERR_TS_TST_INFO_get_ext(a: PTS_TST_Info; loc: TIdC_INT): PX509_Extension; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_TST_INFO_get_ext_procname); +end; + + +function ERR_TS_TST_INFO_delete_ext(a: PTS_TST_Info; loc: TIdC_INT): PX509_Extension; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_TST_INFO_delete_ext_procname); +end; + + +function ERR_TS_TST_INFO_add_ext(a: PTS_TST_Info; ex: PX509_Extension; loc: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_TST_INFO_add_ext_procname); +end; + + +function ERR_TS_TST_INFO_get_ext_d2i(a: PTS_TST_Info; nid: TIdC_INT; crit: PIdC_INT; idx: PIdC_INT): Pointer; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_TST_INFO_get_ext_d2i_procname); +end; + + + + (* + * Declarations related to response generation, defined in ts/ts_resp_sign.c. + *) + + //DEFINE_STACK_OF_CONST(EVP_MD) + + (* Creates a response context that can be used for generating responses. *) +function ERR_TS_RESP_CTX_new: PTS_RESP_CTX; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_RESP_CTX_new_procname); +end; + + +procedure ERR_TS_RESP_CTX_free(ctx: PTS_RESP_CTX); +begin + EIdAPIFunctionNotPresent.RaiseException(TS_RESP_CTX_free_procname); +end; + + + + (* This parameter must be set. *) +function ERR_TS_RESP_CTX_set_signer_cert(ctx: PTS_RESP_CTX; signer: PX509): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_RESP_CTX_set_signer_cert_procname); +end; + + + + (* This parameter must be set. *) +function ERR_TS_RESP_CTX_set_signer_key(ctx: PTS_RESP_CTX; key: PEVP_PKEY): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_RESP_CTX_set_signer_key_procname); +end; + + + +function ERR_TS_RESP_CTX_set_signer_digest(ctx: PTS_RESP_CTX; signer_digest: PEVP_MD): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_RESP_CTX_set_signer_digest_procname); +end; + + +function ERR_TS_RESP_CTX_set_ess_cert_id_digest(ctx: PTS_RESP_CTX; md: PEVP_MD): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_RESP_CTX_set_ess_cert_id_digest_procname); +end; + + + + (* This parameter must be set. *) +function ERR_TS_RESP_CTX_set_def_policy(ctx: PTS_RESP_CTX; def_policy: PASN1_Object): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_RESP_CTX_set_def_policy_procname); +end; + + + + (* No additional certs are included in the response by default. *) + // int TS_RESP_CTX_set_certs(TS_RESP_CTX *ctx, STACK_OF(X509) *certs); + + (* + * Adds a new acceptable policy, only the default policy is accepted by + * default. + *) +function ERR_TS_RESP_CTX_add_policy(ctx: PTS_RESP_CTX; const policy: PASN1_Object): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_RESP_CTX_add_policy_procname); +end; + + + + (* + * Adds a new acceptable message digest. Note that no message digests are + * accepted by default. The md argument is shared with the caller. + *) +function ERR_TS_RESP_CTX_add_md(ctx: PTS_RESP_CTX; const md: PEVP_MD): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_RESP_CTX_add_md_procname); +end; + + + + (* Accuracy is not included by default. *) +function ERR_TS_RESP_CTX_set_accuracy(ctx: PTS_RESP_CTX; secs: TIdC_INT; millis: TIdC_INT; micros: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_RESP_CTX_set_accuracy_procname); +end; + + + + (* + * Clock precision digits, i.e. the number of decimal digits: '0' means sec, + * '3' msec, '6' usec, and so on. Default is 0. + *) +function ERR_TS_RESP_CTX_set_clock_precision_digits(ctx: PTS_RESP_CTX; clock_precision_digits: TIdC_UINT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_RESP_CTX_set_clock_precision_digits_procname); +end; + + + + (* No flags are set by default. *) +procedure ERR_TS_RESP_CTX_add_flags(ctx: PTS_RESP_CTX; flags: TIdC_INT); +begin + EIdAPIFunctionNotPresent.RaiseException(TS_RESP_CTX_add_flags_procname); +end; + + + + (* Default callback always returns a constant. *) +procedure ERR_TS_RESP_CTX_set_serial_cb(ctx: PTS_RESP_CTX; cb: TS_serial_cb; data: Pointer); +begin + EIdAPIFunctionNotPresent.RaiseException(TS_RESP_CTX_set_serial_cb_procname); +end; + + + + (* Default callback uses the gettimeofday() and gmtime() system calls. *) +procedure ERR_TS_RESP_CTX_set_time_cb(ctx: PTS_RESP_CTX; cb: TS_time_cb; data: Pointer); +begin + EIdAPIFunctionNotPresent.RaiseException(TS_RESP_CTX_set_time_cb_procname); +end; + + + + (* + * Default callback rejects all extensions. The extension callback is called + * when the TS_TST_INFO object is already set up and not signed yet. + *) + (* FIXME: extension handling is not tested yet. *) +procedure ERR_TS_RESP_CTX_set_extension_cb(ctx: PTS_RESP_CTX; cb: TS_extension_cb; data: Pointer); +begin + EIdAPIFunctionNotPresent.RaiseException(TS_RESP_CTX_set_extension_cb_procname); +end; + + + + (* The following methods can be used in the callbacks. *) +function ERR_TS_RESP_CTX_set_status_info(ctx: PTS_RESP_CTX; status: TIdC_INT; text: PIdAnsiChar): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_RESP_CTX_set_status_info_procname); +end; + + + + (* Sets the status info only if it is still TS_STATUS_GRANTED. *) +function ERR_TS_RESP_CTX_set_status_info_cond(ctx: PTS_RESP_CTX; status: TIdC_INT; text: PIdAnsiChar): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_RESP_CTX_set_status_info_cond_procname); +end; + + + +function ERR_TS_RESP_CTX_add_failure_info(ctx: PTS_RESP_CTX; failure: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_RESP_CTX_add_failure_info_procname); +end; + + + + (* The get methods below can be used in the extension callback. *) +function ERR_TS_RESP_CTX_get_request(ctx: PTS_RESP_CTX): PTS_REQ; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_RESP_CTX_get_request_procname); +end; + + + +function ERR_TS_RESP_CTX_get_tst_info(ctx: PTS_RESP_CTX): PTS_TST_Info; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_RESP_CTX_get_tst_info_procname); +end; + + + + (* + * Creates the signed TS_TST_INFO and puts it in TS_RESP. + * In case of errors it sets the status info properly. + * Returns NULL only in case of memory allocation/fatal error. + *) +function ERR_TS_RESP_create_response(ctx: PTS_RESP_CTX; req_bio: PBIO): PTS_RESP; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_RESP_create_response_procname); +end; + + + + (* + * Declarations related to response verification, + * they are defined in ts/ts_resp_verify.c. + *) + + //int TS_RESP_verify_signature(PKCS7 *token, STACK_OF(X509) *certs, + // X509_STORE *store, X509 **signer_out); + + (* Context structure for the generic verify method. *) + +function ERR_TS_RESP_verify_response(ctx: PTS_VERIFY_CTX; response: PTS_RESP): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_RESP_verify_response_procname); +end; + + +function ERR_TS_RESP_verify_token(ctx: PTS_VERIFY_CTX; token: PPKCS7): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_RESP_verify_token_procname); +end; + + + + (* + * Declarations related to response verification context, + *) +function ERR_TS_VERIFY_CTX_new: PTS_VERIFY_CTX; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_VERIFY_CTX_new_procname); +end; + + +procedure ERR_TS_VERIFY_CTX_init(ctx: PTS_VERIFY_CTX); +begin + EIdAPIFunctionNotPresent.RaiseException(TS_VERIFY_CTX_init_procname); +end; + + +procedure ERR_TS_VERIFY_CTX_free(ctx: PTS_VERIFY_CTX); +begin + EIdAPIFunctionNotPresent.RaiseException(TS_VERIFY_CTX_free_procname); +end; + + +procedure ERR_TS_VERIFY_CTX_cleanup(ctx: PTS_VERIFY_CTX); +begin + EIdAPIFunctionNotPresent.RaiseException(TS_VERIFY_CTX_cleanup_procname); +end; + + +function ERR_TS_VERIFY_CTX_set_flags(ctx: PTS_VERIFY_CTX; f: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_VERIFY_CTX_set_flags_procname); +end; + + +function ERR_TS_VERIFY_CTX_add_flags(ctx: PTS_VERIFY_CTX; f: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_VERIFY_CTX_add_flags_procname); +end; + + +function ERR_TS_VERIFY_CTX_set_data(ctx: PTS_VERIFY_CTX; b: PBIO): PBIO; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_VERIFY_CTX_set_data_procname); +end; + + +function ERR_TS_VERIFY_CTX_set_imprint(ctx: PTS_VERIFY_CTX; hexstr: PByte; len: TIdC_LONG): PByte; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_VERIFY_CTX_set_imprint_procname); +end; + + +function ERR_TS_VERIFY_CTX_set_store(ctx: PTS_VERIFY_CTX; s: PX509_Store): PX509_Store; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_VERIFY_CTX_set_store_procname); +end; + + + // STACK_OF(X509) *TS_VERIFY_CTS_set_certs(TS_VERIFY_CTX *ctx, STACK_OF(X509) *certs); + + (*- + * If ctx is NULL, it allocates and returns a new object, otherwise + * it returns ctx. It initialises all the members as follows: + * flags = TS_VFY_ALL_IMPRINT & ~(TS_VFY_TSA_NAME | TS_VFY_SIGNATURE) + * certs = NULL + * store = NULL + * policy = policy from the request or NULL if absent (in this case + * TS_VFY_POLICY is cleared from flags as well) + * md_alg = MD algorithm from request + * imprint, imprint_len = imprint from request + * data = NULL + * nonce, nonce_len = nonce from the request or NULL if absent (in this case + * TS_VFY_NONCE is cleared from flags as well) + * tsa_name = NULL + * Important: after calling this method TS_VFY_SIGNATURE should be added! + *) +function ERR_TS_REQ_to_TS_VERIFY_CTX(req: PTS_REQ; ctx: PTS_VERIFY_CTX): PTS_VERIFY_CTX; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_REQ_to_TS_VERIFY_CTX_procname); +end; + + + + (* Function declarations for TS_RESP defined in ts/ts_resp_print.c *) + +function ERR_TS_RESP_print_bio(bio: PBIO; a: PTS_RESP): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_RESP_print_bio_procname); +end; + + +function ERR_TS_STATUS_INFO_print_bio(bio: PBIO; a: PTS_STATUS_INFO): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_STATUS_INFO_print_bio_procname); +end; + + +function ERR_TS_TST_INFO_print_bio(bio: PBIO; a: PTS_TST_Info): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_TST_INFO_print_bio_procname); +end; + + + + (* Common utility functions defined in ts/ts_lib.c *) + +function ERR_TS_ASN1_INTEGER_print_bio(bio: PBIO; const num: PASN1_INTEGER): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_ASN1_INTEGER_print_bio_procname); +end; + + +function ERR_TS_OBJ_print_bio(bio: PBIO; const obj: PASN1_Object): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_OBJ_print_bio_procname); +end; + + + //function TS_ext_print_bio(bio: PBIO; const STACK_OF(): X509_Extension * extensions): TIdC_INT; +function ERR_TS_X509_ALGOR_print_bio(bio: PBIO; const alg: PX509_ALGOr): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_X509_ALGOR_print_bio_procname); +end; + + +function ERR_TS_MSG_IMPRINT_print_bio(bio: PBIO; msg: PTS_MSG_IMPRINT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_MSG_IMPRINT_print_bio_procname); +end; + + + + (* + * Function declarations for handling configuration options, defined in + * ts/ts_conf.c + *) + +function ERR_TS_CONF_load_cert(file_: PIdAnsiChar): PX509; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_CONF_load_cert_procname); +end; + + +function ERR_TS_CONF_load_key( file_: PIdAnsiChar; pass: PIdAnsiChar): PEVP_PKey; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_CONF_load_key_procname); +end; + + +function ERR_TS_CONF_set_serial(conf: PCONF; section: PIdAnsiChar; cb: TS_serial_cb; ctx: PTS_RESP_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_CONF_set_serial_procname); +end; + + + //STACK_OF(X509) *TS_CONF_load_certs(const char *file); +function ERR_TS_CONF_get_tsa_section(conf: PCONF; const section: PIdAnsiChar): PIdAnsiChar; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_CONF_get_tsa_section_procname); +end; + + +function ERR_TS_CONF_set_crypto_device(conf: PCONF; section: PIdAnsiChar; device: PIdAnsiChar): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_CONF_set_crypto_device_procname); +end; + + +function ERR_TS_CONF_set_default_engine(name: PIdAnsiChar): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_CONF_set_default_engine_procname); +end; + + +function ERR_TS_CONF_set_signer_cert(conf: PCONF; section: PIdAnsiChar; cert: PIdAnsiChar; ctx: PTS_RESP_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_CONF_set_signer_cert_procname); +end; + + +function ERR_TS_CONF_set_certs(conf: PCONF; section: PIdAnsiChar; certs: PIdAnsiChar; ctx: PTS_RESP_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_CONF_set_certs_procname); +end; + + +function ERR_TS_CONF_set_signer_key(conf: PCONF; const section: PIdAnsiChar; key: PIdAnsiChar; pass: PIdAnsiChar; ctx: PTS_RESP_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_CONF_set_signer_key_procname); +end; + + +function ERR_TS_CONF_set_signer_digest(conf: PCONF; section: PIdAnsiChar; md: PIdAnsiChar; ctx: PTS_RESP_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_CONF_set_signer_digest_procname); +end; + + +function ERR_TS_CONF_set_def_policy(conf: PCONF; section: PIdAnsiChar; policy: PIdAnsiChar; ctx: PTS_RESP_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_CONF_set_def_policy_procname); +end; + + +function ERR_TS_CONF_set_policies(conf: PCONF; section: PIdAnsiChar; ctx: PTS_RESP_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_CONF_set_policies_procname); +end; + + +function ERR_TS_CONF_set_digests(conf: PCONF; section: PIdAnsiChar; ctx: PTS_RESP_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_CONF_set_digests_procname); +end; + + +function ERR_TS_CONF_set_accuracy(conf: PCONF; section: PIdAnsiChar; ctx: PTS_RESP_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_CONF_set_accuracy_procname); +end; + + +function ERR_TS_CONF_set_clock_precision_digits(conf: PCONF; section: PIdAnsiChar; ctx: PTS_RESP_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_CONF_set_clock_precision_digits_procname); +end; + + +function ERR_TS_CONF_set_ordering(conf: PCONF; section: PIdAnsiChar; ctx: PTS_RESP_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_CONF_set_ordering_procname); +end; + + +function ERR_TS_CONF_set_tsa_name(conf: PCONF; section: PIdAnsiChar; ctx: PTS_RESP_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_CONF_set_tsa_name_procname); +end; + + +function ERR_TS_CONF_set_ess_cert_id_chain(conf: PCONF; section: PIdAnsiChar; ctx: PTS_RESP_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_CONF_set_ess_cert_id_chain_procname); +end; + + +function ERR_TS_CONF_set_ess_cert_id_digest(conf: PCONF; section: PIdAnsiChar; ctx: PTS_RESP_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(TS_CONF_set_ess_cert_id_digest_procname); +end; + + + +{$WARN NO_RETVAL ON} + +procedure Load(const ADllHandle: TIdLibHandle; LibVersion: TIdC_UINT; const AFailed: TStringList); + +var FuncLoadError: boolean; + +begin + TS_REQ_new := LoadLibFunction(ADllHandle, TS_REQ_new_procname); + FuncLoadError := not assigned(TS_REQ_new); + if FuncLoadError then + begin + {$if not defined(TS_REQ_new_allownil)} + TS_REQ_new := @ERR_TS_REQ_new; + {$ifend} + {$if declared(TS_REQ_new_introduced)} + if LibVersion < TS_REQ_new_introduced then + begin + {$if declared(FC_TS_REQ_new)} + TS_REQ_new := @FC_TS_REQ_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_REQ_new_removed)} + if TS_REQ_new_removed <= LibVersion then + begin + {$if declared(_TS_REQ_new)} + TS_REQ_new := @_TS_REQ_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_REQ_new_allownil)} + if FuncLoadError then + AFailed.Add('TS_REQ_new'); + {$ifend} + end; + + + TS_REQ_free := LoadLibFunction(ADllHandle, TS_REQ_free_procname); + FuncLoadError := not assigned(TS_REQ_free); + if FuncLoadError then + begin + {$if not defined(TS_REQ_free_allownil)} + TS_REQ_free := @ERR_TS_REQ_free; + {$ifend} + {$if declared(TS_REQ_free_introduced)} + if LibVersion < TS_REQ_free_introduced then + begin + {$if declared(FC_TS_REQ_free)} + TS_REQ_free := @FC_TS_REQ_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_REQ_free_removed)} + if TS_REQ_free_removed <= LibVersion then + begin + {$if declared(_TS_REQ_free)} + TS_REQ_free := @_TS_REQ_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_REQ_free_allownil)} + if FuncLoadError then + AFailed.Add('TS_REQ_free'); + {$ifend} + end; + + + i2d_TS_REQ := LoadLibFunction(ADllHandle, i2d_TS_REQ_procname); + FuncLoadError := not assigned(i2d_TS_REQ); + if FuncLoadError then + begin + {$if not defined(i2d_TS_REQ_allownil)} + i2d_TS_REQ := @ERR_i2d_TS_REQ; + {$ifend} + {$if declared(i2d_TS_REQ_introduced)} + if LibVersion < i2d_TS_REQ_introduced then + begin + {$if declared(FC_i2d_TS_REQ)} + i2d_TS_REQ := @FC_i2d_TS_REQ; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(i2d_TS_REQ_removed)} + if i2d_TS_REQ_removed <= LibVersion then + begin + {$if declared(_i2d_TS_REQ)} + i2d_TS_REQ := @_i2d_TS_REQ; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(i2d_TS_REQ_allownil)} + if FuncLoadError then + AFailed.Add('i2d_TS_REQ'); + {$ifend} + end; + + + d2i_TS_REQ := LoadLibFunction(ADllHandle, d2i_TS_REQ_procname); + FuncLoadError := not assigned(d2i_TS_REQ); + if FuncLoadError then + begin + {$if not defined(d2i_TS_REQ_allownil)} + d2i_TS_REQ := @ERR_d2i_TS_REQ; + {$ifend} + {$if declared(d2i_TS_REQ_introduced)} + if LibVersion < d2i_TS_REQ_introduced then + begin + {$if declared(FC_d2i_TS_REQ)} + d2i_TS_REQ := @FC_d2i_TS_REQ; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(d2i_TS_REQ_removed)} + if d2i_TS_REQ_removed <= LibVersion then + begin + {$if declared(_d2i_TS_REQ)} + d2i_TS_REQ := @_d2i_TS_REQ; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(d2i_TS_REQ_allownil)} + if FuncLoadError then + AFailed.Add('d2i_TS_REQ'); + {$ifend} + end; + + + TS_REQ_dup := LoadLibFunction(ADllHandle, TS_REQ_dup_procname); + FuncLoadError := not assigned(TS_REQ_dup); + if FuncLoadError then + begin + {$if not defined(TS_REQ_dup_allownil)} + TS_REQ_dup := @ERR_TS_REQ_dup; + {$ifend} + {$if declared(TS_REQ_dup_introduced)} + if LibVersion < TS_REQ_dup_introduced then + begin + {$if declared(FC_TS_REQ_dup)} + TS_REQ_dup := @FC_TS_REQ_dup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_REQ_dup_removed)} + if TS_REQ_dup_removed <= LibVersion then + begin + {$if declared(_TS_REQ_dup)} + TS_REQ_dup := @_TS_REQ_dup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_REQ_dup_allownil)} + if FuncLoadError then + AFailed.Add('TS_REQ_dup'); + {$ifend} + end; + + + d2i_TS_REQ_bio := LoadLibFunction(ADllHandle, d2i_TS_REQ_bio_procname); + FuncLoadError := not assigned(d2i_TS_REQ_bio); + if FuncLoadError then + begin + {$if not defined(d2i_TS_REQ_bio_allownil)} + d2i_TS_REQ_bio := @ERR_d2i_TS_REQ_bio; + {$ifend} + {$if declared(d2i_TS_REQ_bio_introduced)} + if LibVersion < d2i_TS_REQ_bio_introduced then + begin + {$if declared(FC_d2i_TS_REQ_bio)} + d2i_TS_REQ_bio := @FC_d2i_TS_REQ_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(d2i_TS_REQ_bio_removed)} + if d2i_TS_REQ_bio_removed <= LibVersion then + begin + {$if declared(_d2i_TS_REQ_bio)} + d2i_TS_REQ_bio := @_d2i_TS_REQ_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(d2i_TS_REQ_bio_allownil)} + if FuncLoadError then + AFailed.Add('d2i_TS_REQ_bio'); + {$ifend} + end; + + + i2d_TS_REQ_bio := LoadLibFunction(ADllHandle, i2d_TS_REQ_bio_procname); + FuncLoadError := not assigned(i2d_TS_REQ_bio); + if FuncLoadError then + begin + {$if not defined(i2d_TS_REQ_bio_allownil)} + i2d_TS_REQ_bio := @ERR_i2d_TS_REQ_bio; + {$ifend} + {$if declared(i2d_TS_REQ_bio_introduced)} + if LibVersion < i2d_TS_REQ_bio_introduced then + begin + {$if declared(FC_i2d_TS_REQ_bio)} + i2d_TS_REQ_bio := @FC_i2d_TS_REQ_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(i2d_TS_REQ_bio_removed)} + if i2d_TS_REQ_bio_removed <= LibVersion then + begin + {$if declared(_i2d_TS_REQ_bio)} + i2d_TS_REQ_bio := @_i2d_TS_REQ_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(i2d_TS_REQ_bio_allownil)} + if FuncLoadError then + AFailed.Add('i2d_TS_REQ_bio'); + {$ifend} + end; + + + TS_MSG_IMPRINT_new := LoadLibFunction(ADllHandle, TS_MSG_IMPRINT_new_procname); + FuncLoadError := not assigned(TS_MSG_IMPRINT_new); + if FuncLoadError then + begin + {$if not defined(TS_MSG_IMPRINT_new_allownil)} + TS_MSG_IMPRINT_new := @ERR_TS_MSG_IMPRINT_new; + {$ifend} + {$if declared(TS_MSG_IMPRINT_new_introduced)} + if LibVersion < TS_MSG_IMPRINT_new_introduced then + begin + {$if declared(FC_TS_MSG_IMPRINT_new)} + TS_MSG_IMPRINT_new := @FC_TS_MSG_IMPRINT_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_MSG_IMPRINT_new_removed)} + if TS_MSG_IMPRINT_new_removed <= LibVersion then + begin + {$if declared(_TS_MSG_IMPRINT_new)} + TS_MSG_IMPRINT_new := @_TS_MSG_IMPRINT_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_MSG_IMPRINT_new_allownil)} + if FuncLoadError then + AFailed.Add('TS_MSG_IMPRINT_new'); + {$ifend} + end; + + + TS_MSG_IMPRINT_free := LoadLibFunction(ADllHandle, TS_MSG_IMPRINT_free_procname); + FuncLoadError := not assigned(TS_MSG_IMPRINT_free); + if FuncLoadError then + begin + {$if not defined(TS_MSG_IMPRINT_free_allownil)} + TS_MSG_IMPRINT_free := @ERR_TS_MSG_IMPRINT_free; + {$ifend} + {$if declared(TS_MSG_IMPRINT_free_introduced)} + if LibVersion < TS_MSG_IMPRINT_free_introduced then + begin + {$if declared(FC_TS_MSG_IMPRINT_free)} + TS_MSG_IMPRINT_free := @FC_TS_MSG_IMPRINT_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_MSG_IMPRINT_free_removed)} + if TS_MSG_IMPRINT_free_removed <= LibVersion then + begin + {$if declared(_TS_MSG_IMPRINT_free)} + TS_MSG_IMPRINT_free := @_TS_MSG_IMPRINT_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_MSG_IMPRINT_free_allownil)} + if FuncLoadError then + AFailed.Add('TS_MSG_IMPRINT_free'); + {$ifend} + end; + + + i2d_TS_MSG_IMPRINT := LoadLibFunction(ADllHandle, i2d_TS_MSG_IMPRINT_procname); + FuncLoadError := not assigned(i2d_TS_MSG_IMPRINT); + if FuncLoadError then + begin + {$if not defined(i2d_TS_MSG_IMPRINT_allownil)} + i2d_TS_MSG_IMPRINT := @ERR_i2d_TS_MSG_IMPRINT; + {$ifend} + {$if declared(i2d_TS_MSG_IMPRINT_introduced)} + if LibVersion < i2d_TS_MSG_IMPRINT_introduced then + begin + {$if declared(FC_i2d_TS_MSG_IMPRINT)} + i2d_TS_MSG_IMPRINT := @FC_i2d_TS_MSG_IMPRINT; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(i2d_TS_MSG_IMPRINT_removed)} + if i2d_TS_MSG_IMPRINT_removed <= LibVersion then + begin + {$if declared(_i2d_TS_MSG_IMPRINT)} + i2d_TS_MSG_IMPRINT := @_i2d_TS_MSG_IMPRINT; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(i2d_TS_MSG_IMPRINT_allownil)} + if FuncLoadError then + AFailed.Add('i2d_TS_MSG_IMPRINT'); + {$ifend} + end; + + + d2i_TS_MSG_IMPRINT := LoadLibFunction(ADllHandle, d2i_TS_MSG_IMPRINT_procname); + FuncLoadError := not assigned(d2i_TS_MSG_IMPRINT); + if FuncLoadError then + begin + {$if not defined(d2i_TS_MSG_IMPRINT_allownil)} + d2i_TS_MSG_IMPRINT := @ERR_d2i_TS_MSG_IMPRINT; + {$ifend} + {$if declared(d2i_TS_MSG_IMPRINT_introduced)} + if LibVersion < d2i_TS_MSG_IMPRINT_introduced then + begin + {$if declared(FC_d2i_TS_MSG_IMPRINT)} + d2i_TS_MSG_IMPRINT := @FC_d2i_TS_MSG_IMPRINT; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(d2i_TS_MSG_IMPRINT_removed)} + if d2i_TS_MSG_IMPRINT_removed <= LibVersion then + begin + {$if declared(_d2i_TS_MSG_IMPRINT)} + d2i_TS_MSG_IMPRINT := @_d2i_TS_MSG_IMPRINT; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(d2i_TS_MSG_IMPRINT_allownil)} + if FuncLoadError then + AFailed.Add('d2i_TS_MSG_IMPRINT'); + {$ifend} + end; + + + TS_MSG_IMPRINT_dup := LoadLibFunction(ADllHandle, TS_MSG_IMPRINT_dup_procname); + FuncLoadError := not assigned(TS_MSG_IMPRINT_dup); + if FuncLoadError then + begin + {$if not defined(TS_MSG_IMPRINT_dup_allownil)} + TS_MSG_IMPRINT_dup := @ERR_TS_MSG_IMPRINT_dup; + {$ifend} + {$if declared(TS_MSG_IMPRINT_dup_introduced)} + if LibVersion < TS_MSG_IMPRINT_dup_introduced then + begin + {$if declared(FC_TS_MSG_IMPRINT_dup)} + TS_MSG_IMPRINT_dup := @FC_TS_MSG_IMPRINT_dup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_MSG_IMPRINT_dup_removed)} + if TS_MSG_IMPRINT_dup_removed <= LibVersion then + begin + {$if declared(_TS_MSG_IMPRINT_dup)} + TS_MSG_IMPRINT_dup := @_TS_MSG_IMPRINT_dup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_MSG_IMPRINT_dup_allownil)} + if FuncLoadError then + AFailed.Add('TS_MSG_IMPRINT_dup'); + {$ifend} + end; + + + d2i_TS_MSG_IMPRINT_bio := LoadLibFunction(ADllHandle, d2i_TS_MSG_IMPRINT_bio_procname); + FuncLoadError := not assigned(d2i_TS_MSG_IMPRINT_bio); + if FuncLoadError then + begin + {$if not defined(d2i_TS_MSG_IMPRINT_bio_allownil)} + d2i_TS_MSG_IMPRINT_bio := @ERR_d2i_TS_MSG_IMPRINT_bio; + {$ifend} + {$if declared(d2i_TS_MSG_IMPRINT_bio_introduced)} + if LibVersion < d2i_TS_MSG_IMPRINT_bio_introduced then + begin + {$if declared(FC_d2i_TS_MSG_IMPRINT_bio)} + d2i_TS_MSG_IMPRINT_bio := @FC_d2i_TS_MSG_IMPRINT_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(d2i_TS_MSG_IMPRINT_bio_removed)} + if d2i_TS_MSG_IMPRINT_bio_removed <= LibVersion then + begin + {$if declared(_d2i_TS_MSG_IMPRINT_bio)} + d2i_TS_MSG_IMPRINT_bio := @_d2i_TS_MSG_IMPRINT_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(d2i_TS_MSG_IMPRINT_bio_allownil)} + if FuncLoadError then + AFailed.Add('d2i_TS_MSG_IMPRINT_bio'); + {$ifend} + end; + + + i2d_TS_MSG_IMPRINT_bio := LoadLibFunction(ADllHandle, i2d_TS_MSG_IMPRINT_bio_procname); + FuncLoadError := not assigned(i2d_TS_MSG_IMPRINT_bio); + if FuncLoadError then + begin + {$if not defined(i2d_TS_MSG_IMPRINT_bio_allownil)} + i2d_TS_MSG_IMPRINT_bio := @ERR_i2d_TS_MSG_IMPRINT_bio; + {$ifend} + {$if declared(i2d_TS_MSG_IMPRINT_bio_introduced)} + if LibVersion < i2d_TS_MSG_IMPRINT_bio_introduced then + begin + {$if declared(FC_i2d_TS_MSG_IMPRINT_bio)} + i2d_TS_MSG_IMPRINT_bio := @FC_i2d_TS_MSG_IMPRINT_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(i2d_TS_MSG_IMPRINT_bio_removed)} + if i2d_TS_MSG_IMPRINT_bio_removed <= LibVersion then + begin + {$if declared(_i2d_TS_MSG_IMPRINT_bio)} + i2d_TS_MSG_IMPRINT_bio := @_i2d_TS_MSG_IMPRINT_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(i2d_TS_MSG_IMPRINT_bio_allownil)} + if FuncLoadError then + AFailed.Add('i2d_TS_MSG_IMPRINT_bio'); + {$ifend} + end; + + + TS_RESP_new := LoadLibFunction(ADllHandle, TS_RESP_new_procname); + FuncLoadError := not assigned(TS_RESP_new); + if FuncLoadError then + begin + {$if not defined(TS_RESP_new_allownil)} + TS_RESP_new := @ERR_TS_RESP_new; + {$ifend} + {$if declared(TS_RESP_new_introduced)} + if LibVersion < TS_RESP_new_introduced then + begin + {$if declared(FC_TS_RESP_new)} + TS_RESP_new := @FC_TS_RESP_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_RESP_new_removed)} + if TS_RESP_new_removed <= LibVersion then + begin + {$if declared(_TS_RESP_new)} + TS_RESP_new := @_TS_RESP_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_RESP_new_allownil)} + if FuncLoadError then + AFailed.Add('TS_RESP_new'); + {$ifend} + end; + + + TS_RESP_free := LoadLibFunction(ADllHandle, TS_RESP_free_procname); + FuncLoadError := not assigned(TS_RESP_free); + if FuncLoadError then + begin + {$if not defined(TS_RESP_free_allownil)} + TS_RESP_free := @ERR_TS_RESP_free; + {$ifend} + {$if declared(TS_RESP_free_introduced)} + if LibVersion < TS_RESP_free_introduced then + begin + {$if declared(FC_TS_RESP_free)} + TS_RESP_free := @FC_TS_RESP_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_RESP_free_removed)} + if TS_RESP_free_removed <= LibVersion then + begin + {$if declared(_TS_RESP_free)} + TS_RESP_free := @_TS_RESP_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_RESP_free_allownil)} + if FuncLoadError then + AFailed.Add('TS_RESP_free'); + {$ifend} + end; + + + i2d_TS_RESP := LoadLibFunction(ADllHandle, i2d_TS_RESP_procname); + FuncLoadError := not assigned(i2d_TS_RESP); + if FuncLoadError then + begin + {$if not defined(i2d_TS_RESP_allownil)} + i2d_TS_RESP := @ERR_i2d_TS_RESP; + {$ifend} + {$if declared(i2d_TS_RESP_introduced)} + if LibVersion < i2d_TS_RESP_introduced then + begin + {$if declared(FC_i2d_TS_RESP)} + i2d_TS_RESP := @FC_i2d_TS_RESP; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(i2d_TS_RESP_removed)} + if i2d_TS_RESP_removed <= LibVersion then + begin + {$if declared(_i2d_TS_RESP)} + i2d_TS_RESP := @_i2d_TS_RESP; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(i2d_TS_RESP_allownil)} + if FuncLoadError then + AFailed.Add('i2d_TS_RESP'); + {$ifend} + end; + + + d2i_TS_RESP := LoadLibFunction(ADllHandle, d2i_TS_RESP_procname); + FuncLoadError := not assigned(d2i_TS_RESP); + if FuncLoadError then + begin + {$if not defined(d2i_TS_RESP_allownil)} + d2i_TS_RESP := @ERR_d2i_TS_RESP; + {$ifend} + {$if declared(d2i_TS_RESP_introduced)} + if LibVersion < d2i_TS_RESP_introduced then + begin + {$if declared(FC_d2i_TS_RESP)} + d2i_TS_RESP := @FC_d2i_TS_RESP; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(d2i_TS_RESP_removed)} + if d2i_TS_RESP_removed <= LibVersion then + begin + {$if declared(_d2i_TS_RESP)} + d2i_TS_RESP := @_d2i_TS_RESP; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(d2i_TS_RESP_allownil)} + if FuncLoadError then + AFailed.Add('d2i_TS_RESP'); + {$ifend} + end; + + + PKCS7_to_TS_TST_INFO := LoadLibFunction(ADllHandle, PKCS7_to_TS_TST_INFO_procname); + FuncLoadError := not assigned(PKCS7_to_TS_TST_INFO); + if FuncLoadError then + begin + {$if not defined(PKCS7_to_TS_TST_INFO_allownil)} + PKCS7_to_TS_TST_INFO := @ERR_PKCS7_to_TS_TST_INFO; + {$ifend} + {$if declared(PKCS7_to_TS_TST_INFO_introduced)} + if LibVersion < PKCS7_to_TS_TST_INFO_introduced then + begin + {$if declared(FC_PKCS7_to_TS_TST_INFO)} + PKCS7_to_TS_TST_INFO := @FC_PKCS7_to_TS_TST_INFO; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS7_to_TS_TST_INFO_removed)} + if PKCS7_to_TS_TST_INFO_removed <= LibVersion then + begin + {$if declared(_PKCS7_to_TS_TST_INFO)} + PKCS7_to_TS_TST_INFO := @_PKCS7_to_TS_TST_INFO; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS7_to_TS_TST_INFO_allownil)} + if FuncLoadError then + AFailed.Add('PKCS7_to_TS_TST_INFO'); + {$ifend} + end; + + + TS_RESP_dup := LoadLibFunction(ADllHandle, TS_RESP_dup_procname); + FuncLoadError := not assigned(TS_RESP_dup); + if FuncLoadError then + begin + {$if not defined(TS_RESP_dup_allownil)} + TS_RESP_dup := @ERR_TS_RESP_dup; + {$ifend} + {$if declared(TS_RESP_dup_introduced)} + if LibVersion < TS_RESP_dup_introduced then + begin + {$if declared(FC_TS_RESP_dup)} + TS_RESP_dup := @FC_TS_RESP_dup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_RESP_dup_removed)} + if TS_RESP_dup_removed <= LibVersion then + begin + {$if declared(_TS_RESP_dup)} + TS_RESP_dup := @_TS_RESP_dup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_RESP_dup_allownil)} + if FuncLoadError then + AFailed.Add('TS_RESP_dup'); + {$ifend} + end; + + + d2i_TS_RESP_bio := LoadLibFunction(ADllHandle, d2i_TS_RESP_bio_procname); + FuncLoadError := not assigned(d2i_TS_RESP_bio); + if FuncLoadError then + begin + {$if not defined(d2i_TS_RESP_bio_allownil)} + d2i_TS_RESP_bio := @ERR_d2i_TS_RESP_bio; + {$ifend} + {$if declared(d2i_TS_RESP_bio_introduced)} + if LibVersion < d2i_TS_RESP_bio_introduced then + begin + {$if declared(FC_d2i_TS_RESP_bio)} + d2i_TS_RESP_bio := @FC_d2i_TS_RESP_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(d2i_TS_RESP_bio_removed)} + if d2i_TS_RESP_bio_removed <= LibVersion then + begin + {$if declared(_d2i_TS_RESP_bio)} + d2i_TS_RESP_bio := @_d2i_TS_RESP_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(d2i_TS_RESP_bio_allownil)} + if FuncLoadError then + AFailed.Add('d2i_TS_RESP_bio'); + {$ifend} + end; + + + i2d_TS_RESP_bio := LoadLibFunction(ADllHandle, i2d_TS_RESP_bio_procname); + FuncLoadError := not assigned(i2d_TS_RESP_bio); + if FuncLoadError then + begin + {$if not defined(i2d_TS_RESP_bio_allownil)} + i2d_TS_RESP_bio := @ERR_i2d_TS_RESP_bio; + {$ifend} + {$if declared(i2d_TS_RESP_bio_introduced)} + if LibVersion < i2d_TS_RESP_bio_introduced then + begin + {$if declared(FC_i2d_TS_RESP_bio)} + i2d_TS_RESP_bio := @FC_i2d_TS_RESP_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(i2d_TS_RESP_bio_removed)} + if i2d_TS_RESP_bio_removed <= LibVersion then + begin + {$if declared(_i2d_TS_RESP_bio)} + i2d_TS_RESP_bio := @_i2d_TS_RESP_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(i2d_TS_RESP_bio_allownil)} + if FuncLoadError then + AFailed.Add('i2d_TS_RESP_bio'); + {$ifend} + end; + + + TS_STATUS_INFO_new := LoadLibFunction(ADllHandle, TS_STATUS_INFO_new_procname); + FuncLoadError := not assigned(TS_STATUS_INFO_new); + if FuncLoadError then + begin + {$if not defined(TS_STATUS_INFO_new_allownil)} + TS_STATUS_INFO_new := @ERR_TS_STATUS_INFO_new; + {$ifend} + {$if declared(TS_STATUS_INFO_new_introduced)} + if LibVersion < TS_STATUS_INFO_new_introduced then + begin + {$if declared(FC_TS_STATUS_INFO_new)} + TS_STATUS_INFO_new := @FC_TS_STATUS_INFO_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_STATUS_INFO_new_removed)} + if TS_STATUS_INFO_new_removed <= LibVersion then + begin + {$if declared(_TS_STATUS_INFO_new)} + TS_STATUS_INFO_new := @_TS_STATUS_INFO_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_STATUS_INFO_new_allownil)} + if FuncLoadError then + AFailed.Add('TS_STATUS_INFO_new'); + {$ifend} + end; + + + TS_STATUS_INFO_free := LoadLibFunction(ADllHandle, TS_STATUS_INFO_free_procname); + FuncLoadError := not assigned(TS_STATUS_INFO_free); + if FuncLoadError then + begin + {$if not defined(TS_STATUS_INFO_free_allownil)} + TS_STATUS_INFO_free := @ERR_TS_STATUS_INFO_free; + {$ifend} + {$if declared(TS_STATUS_INFO_free_introduced)} + if LibVersion < TS_STATUS_INFO_free_introduced then + begin + {$if declared(FC_TS_STATUS_INFO_free)} + TS_STATUS_INFO_free := @FC_TS_STATUS_INFO_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_STATUS_INFO_free_removed)} + if TS_STATUS_INFO_free_removed <= LibVersion then + begin + {$if declared(_TS_STATUS_INFO_free)} + TS_STATUS_INFO_free := @_TS_STATUS_INFO_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_STATUS_INFO_free_allownil)} + if FuncLoadError then + AFailed.Add('TS_STATUS_INFO_free'); + {$ifend} + end; + + + i2d_TS_STATUS_INFO := LoadLibFunction(ADllHandle, i2d_TS_STATUS_INFO_procname); + FuncLoadError := not assigned(i2d_TS_STATUS_INFO); + if FuncLoadError then + begin + {$if not defined(i2d_TS_STATUS_INFO_allownil)} + i2d_TS_STATUS_INFO := @ERR_i2d_TS_STATUS_INFO; + {$ifend} + {$if declared(i2d_TS_STATUS_INFO_introduced)} + if LibVersion < i2d_TS_STATUS_INFO_introduced then + begin + {$if declared(FC_i2d_TS_STATUS_INFO)} + i2d_TS_STATUS_INFO := @FC_i2d_TS_STATUS_INFO; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(i2d_TS_STATUS_INFO_removed)} + if i2d_TS_STATUS_INFO_removed <= LibVersion then + begin + {$if declared(_i2d_TS_STATUS_INFO)} + i2d_TS_STATUS_INFO := @_i2d_TS_STATUS_INFO; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(i2d_TS_STATUS_INFO_allownil)} + if FuncLoadError then + AFailed.Add('i2d_TS_STATUS_INFO'); + {$ifend} + end; + + + d2i_TS_STATUS_INFO := LoadLibFunction(ADllHandle, d2i_TS_STATUS_INFO_procname); + FuncLoadError := not assigned(d2i_TS_STATUS_INFO); + if FuncLoadError then + begin + {$if not defined(d2i_TS_STATUS_INFO_allownil)} + d2i_TS_STATUS_INFO := @ERR_d2i_TS_STATUS_INFO; + {$ifend} + {$if declared(d2i_TS_STATUS_INFO_introduced)} + if LibVersion < d2i_TS_STATUS_INFO_introduced then + begin + {$if declared(FC_d2i_TS_STATUS_INFO)} + d2i_TS_STATUS_INFO := @FC_d2i_TS_STATUS_INFO; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(d2i_TS_STATUS_INFO_removed)} + if d2i_TS_STATUS_INFO_removed <= LibVersion then + begin + {$if declared(_d2i_TS_STATUS_INFO)} + d2i_TS_STATUS_INFO := @_d2i_TS_STATUS_INFO; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(d2i_TS_STATUS_INFO_allownil)} + if FuncLoadError then + AFailed.Add('d2i_TS_STATUS_INFO'); + {$ifend} + end; + + + TS_STATUS_INFO_dup := LoadLibFunction(ADllHandle, TS_STATUS_INFO_dup_procname); + FuncLoadError := not assigned(TS_STATUS_INFO_dup); + if FuncLoadError then + begin + {$if not defined(TS_STATUS_INFO_dup_allownil)} + TS_STATUS_INFO_dup := @ERR_TS_STATUS_INFO_dup; + {$ifend} + {$if declared(TS_STATUS_INFO_dup_introduced)} + if LibVersion < TS_STATUS_INFO_dup_introduced then + begin + {$if declared(FC_TS_STATUS_INFO_dup)} + TS_STATUS_INFO_dup := @FC_TS_STATUS_INFO_dup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_STATUS_INFO_dup_removed)} + if TS_STATUS_INFO_dup_removed <= LibVersion then + begin + {$if declared(_TS_STATUS_INFO_dup)} + TS_STATUS_INFO_dup := @_TS_STATUS_INFO_dup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_STATUS_INFO_dup_allownil)} + if FuncLoadError then + AFailed.Add('TS_STATUS_INFO_dup'); + {$ifend} + end; + + + TS_TST_INFO_new := LoadLibFunction(ADllHandle, TS_TST_INFO_new_procname); + FuncLoadError := not assigned(TS_TST_INFO_new); + if FuncLoadError then + begin + {$if not defined(TS_TST_INFO_new_allownil)} + TS_TST_INFO_new := @ERR_TS_TST_INFO_new; + {$ifend} + {$if declared(TS_TST_INFO_new_introduced)} + if LibVersion < TS_TST_INFO_new_introduced then + begin + {$if declared(FC_TS_TST_INFO_new)} + TS_TST_INFO_new := @FC_TS_TST_INFO_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_TST_INFO_new_removed)} + if TS_TST_INFO_new_removed <= LibVersion then + begin + {$if declared(_TS_TST_INFO_new)} + TS_TST_INFO_new := @_TS_TST_INFO_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_TST_INFO_new_allownil)} + if FuncLoadError then + AFailed.Add('TS_TST_INFO_new'); + {$ifend} + end; + + + TS_TST_INFO_free := LoadLibFunction(ADllHandle, TS_TST_INFO_free_procname); + FuncLoadError := not assigned(TS_TST_INFO_free); + if FuncLoadError then + begin + {$if not defined(TS_TST_INFO_free_allownil)} + TS_TST_INFO_free := @ERR_TS_TST_INFO_free; + {$ifend} + {$if declared(TS_TST_INFO_free_introduced)} + if LibVersion < TS_TST_INFO_free_introduced then + begin + {$if declared(FC_TS_TST_INFO_free)} + TS_TST_INFO_free := @FC_TS_TST_INFO_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_TST_INFO_free_removed)} + if TS_TST_INFO_free_removed <= LibVersion then + begin + {$if declared(_TS_TST_INFO_free)} + TS_TST_INFO_free := @_TS_TST_INFO_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_TST_INFO_free_allownil)} + if FuncLoadError then + AFailed.Add('TS_TST_INFO_free'); + {$ifend} + end; + + + i2d_TS_TST_INFO := LoadLibFunction(ADllHandle, i2d_TS_TST_INFO_procname); + FuncLoadError := not assigned(i2d_TS_TST_INFO); + if FuncLoadError then + begin + {$if not defined(i2d_TS_TST_INFO_allownil)} + i2d_TS_TST_INFO := @ERR_i2d_TS_TST_INFO; + {$ifend} + {$if declared(i2d_TS_TST_INFO_introduced)} + if LibVersion < i2d_TS_TST_INFO_introduced then + begin + {$if declared(FC_i2d_TS_TST_INFO)} + i2d_TS_TST_INFO := @FC_i2d_TS_TST_INFO; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(i2d_TS_TST_INFO_removed)} + if i2d_TS_TST_INFO_removed <= LibVersion then + begin + {$if declared(_i2d_TS_TST_INFO)} + i2d_TS_TST_INFO := @_i2d_TS_TST_INFO; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(i2d_TS_TST_INFO_allownil)} + if FuncLoadError then + AFailed.Add('i2d_TS_TST_INFO'); + {$ifend} + end; + + + d2i_TS_TST_INFO := LoadLibFunction(ADllHandle, d2i_TS_TST_INFO_procname); + FuncLoadError := not assigned(d2i_TS_TST_INFO); + if FuncLoadError then + begin + {$if not defined(d2i_TS_TST_INFO_allownil)} + d2i_TS_TST_INFO := @ERR_d2i_TS_TST_INFO; + {$ifend} + {$if declared(d2i_TS_TST_INFO_introduced)} + if LibVersion < d2i_TS_TST_INFO_introduced then + begin + {$if declared(FC_d2i_TS_TST_INFO)} + d2i_TS_TST_INFO := @FC_d2i_TS_TST_INFO; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(d2i_TS_TST_INFO_removed)} + if d2i_TS_TST_INFO_removed <= LibVersion then + begin + {$if declared(_d2i_TS_TST_INFO)} + d2i_TS_TST_INFO := @_d2i_TS_TST_INFO; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(d2i_TS_TST_INFO_allownil)} + if FuncLoadError then + AFailed.Add('d2i_TS_TST_INFO'); + {$ifend} + end; + + + TS_TST_INFO_dup := LoadLibFunction(ADllHandle, TS_TST_INFO_dup_procname); + FuncLoadError := not assigned(TS_TST_INFO_dup); + if FuncLoadError then + begin + {$if not defined(TS_TST_INFO_dup_allownil)} + TS_TST_INFO_dup := @ERR_TS_TST_INFO_dup; + {$ifend} + {$if declared(TS_TST_INFO_dup_introduced)} + if LibVersion < TS_TST_INFO_dup_introduced then + begin + {$if declared(FC_TS_TST_INFO_dup)} + TS_TST_INFO_dup := @FC_TS_TST_INFO_dup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_TST_INFO_dup_removed)} + if TS_TST_INFO_dup_removed <= LibVersion then + begin + {$if declared(_TS_TST_INFO_dup)} + TS_TST_INFO_dup := @_TS_TST_INFO_dup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_TST_INFO_dup_allownil)} + if FuncLoadError then + AFailed.Add('TS_TST_INFO_dup'); + {$ifend} + end; + + + d2i_TS_TST_INFO_bio := LoadLibFunction(ADllHandle, d2i_TS_TST_INFO_bio_procname); + FuncLoadError := not assigned(d2i_TS_TST_INFO_bio); + if FuncLoadError then + begin + {$if not defined(d2i_TS_TST_INFO_bio_allownil)} + d2i_TS_TST_INFO_bio := @ERR_d2i_TS_TST_INFO_bio; + {$ifend} + {$if declared(d2i_TS_TST_INFO_bio_introduced)} + if LibVersion < d2i_TS_TST_INFO_bio_introduced then + begin + {$if declared(FC_d2i_TS_TST_INFO_bio)} + d2i_TS_TST_INFO_bio := @FC_d2i_TS_TST_INFO_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(d2i_TS_TST_INFO_bio_removed)} + if d2i_TS_TST_INFO_bio_removed <= LibVersion then + begin + {$if declared(_d2i_TS_TST_INFO_bio)} + d2i_TS_TST_INFO_bio := @_d2i_TS_TST_INFO_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(d2i_TS_TST_INFO_bio_allownil)} + if FuncLoadError then + AFailed.Add('d2i_TS_TST_INFO_bio'); + {$ifend} + end; + + + i2d_TS_TST_INFO_bio := LoadLibFunction(ADllHandle, i2d_TS_TST_INFO_bio_procname); + FuncLoadError := not assigned(i2d_TS_TST_INFO_bio); + if FuncLoadError then + begin + {$if not defined(i2d_TS_TST_INFO_bio_allownil)} + i2d_TS_TST_INFO_bio := @ERR_i2d_TS_TST_INFO_bio; + {$ifend} + {$if declared(i2d_TS_TST_INFO_bio_introduced)} + if LibVersion < i2d_TS_TST_INFO_bio_introduced then + begin + {$if declared(FC_i2d_TS_TST_INFO_bio)} + i2d_TS_TST_INFO_bio := @FC_i2d_TS_TST_INFO_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(i2d_TS_TST_INFO_bio_removed)} + if i2d_TS_TST_INFO_bio_removed <= LibVersion then + begin + {$if declared(_i2d_TS_TST_INFO_bio)} + i2d_TS_TST_INFO_bio := @_i2d_TS_TST_INFO_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(i2d_TS_TST_INFO_bio_allownil)} + if FuncLoadError then + AFailed.Add('i2d_TS_TST_INFO_bio'); + {$ifend} + end; + + + TS_ACCURACY_new := LoadLibFunction(ADllHandle, TS_ACCURACY_new_procname); + FuncLoadError := not assigned(TS_ACCURACY_new); + if FuncLoadError then + begin + {$if not defined(TS_ACCURACY_new_allownil)} + TS_ACCURACY_new := @ERR_TS_ACCURACY_new; + {$ifend} + {$if declared(TS_ACCURACY_new_introduced)} + if LibVersion < TS_ACCURACY_new_introduced then + begin + {$if declared(FC_TS_ACCURACY_new)} + TS_ACCURACY_new := @FC_TS_ACCURACY_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_ACCURACY_new_removed)} + if TS_ACCURACY_new_removed <= LibVersion then + begin + {$if declared(_TS_ACCURACY_new)} + TS_ACCURACY_new := @_TS_ACCURACY_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_ACCURACY_new_allownil)} + if FuncLoadError then + AFailed.Add('TS_ACCURACY_new'); + {$ifend} + end; + + + TS_ACCURACY_free := LoadLibFunction(ADllHandle, TS_ACCURACY_free_procname); + FuncLoadError := not assigned(TS_ACCURACY_free); + if FuncLoadError then + begin + {$if not defined(TS_ACCURACY_free_allownil)} + TS_ACCURACY_free := @ERR_TS_ACCURACY_free; + {$ifend} + {$if declared(TS_ACCURACY_free_introduced)} + if LibVersion < TS_ACCURACY_free_introduced then + begin + {$if declared(FC_TS_ACCURACY_free)} + TS_ACCURACY_free := @FC_TS_ACCURACY_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_ACCURACY_free_removed)} + if TS_ACCURACY_free_removed <= LibVersion then + begin + {$if declared(_TS_ACCURACY_free)} + TS_ACCURACY_free := @_TS_ACCURACY_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_ACCURACY_free_allownil)} + if FuncLoadError then + AFailed.Add('TS_ACCURACY_free'); + {$ifend} + end; + + + i2d_TS_ACCURACY := LoadLibFunction(ADllHandle, i2d_TS_ACCURACY_procname); + FuncLoadError := not assigned(i2d_TS_ACCURACY); + if FuncLoadError then + begin + {$if not defined(i2d_TS_ACCURACY_allownil)} + i2d_TS_ACCURACY := @ERR_i2d_TS_ACCURACY; + {$ifend} + {$if declared(i2d_TS_ACCURACY_introduced)} + if LibVersion < i2d_TS_ACCURACY_introduced then + begin + {$if declared(FC_i2d_TS_ACCURACY)} + i2d_TS_ACCURACY := @FC_i2d_TS_ACCURACY; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(i2d_TS_ACCURACY_removed)} + if i2d_TS_ACCURACY_removed <= LibVersion then + begin + {$if declared(_i2d_TS_ACCURACY)} + i2d_TS_ACCURACY := @_i2d_TS_ACCURACY; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(i2d_TS_ACCURACY_allownil)} + if FuncLoadError then + AFailed.Add('i2d_TS_ACCURACY'); + {$ifend} + end; + + + d2i_TS_ACCURACY := LoadLibFunction(ADllHandle, d2i_TS_ACCURACY_procname); + FuncLoadError := not assigned(d2i_TS_ACCURACY); + if FuncLoadError then + begin + {$if not defined(d2i_TS_ACCURACY_allownil)} + d2i_TS_ACCURACY := @ERR_d2i_TS_ACCURACY; + {$ifend} + {$if declared(d2i_TS_ACCURACY_introduced)} + if LibVersion < d2i_TS_ACCURACY_introduced then + begin + {$if declared(FC_d2i_TS_ACCURACY)} + d2i_TS_ACCURACY := @FC_d2i_TS_ACCURACY; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(d2i_TS_ACCURACY_removed)} + if d2i_TS_ACCURACY_removed <= LibVersion then + begin + {$if declared(_d2i_TS_ACCURACY)} + d2i_TS_ACCURACY := @_d2i_TS_ACCURACY; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(d2i_TS_ACCURACY_allownil)} + if FuncLoadError then + AFailed.Add('d2i_TS_ACCURACY'); + {$ifend} + end; + + + TS_ACCURACY_dup := LoadLibFunction(ADllHandle, TS_ACCURACY_dup_procname); + FuncLoadError := not assigned(TS_ACCURACY_dup); + if FuncLoadError then + begin + {$if not defined(TS_ACCURACY_dup_allownil)} + TS_ACCURACY_dup := @ERR_TS_ACCURACY_dup; + {$ifend} + {$if declared(TS_ACCURACY_dup_introduced)} + if LibVersion < TS_ACCURACY_dup_introduced then + begin + {$if declared(FC_TS_ACCURACY_dup)} + TS_ACCURACY_dup := @FC_TS_ACCURACY_dup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_ACCURACY_dup_removed)} + if TS_ACCURACY_dup_removed <= LibVersion then + begin + {$if declared(_TS_ACCURACY_dup)} + TS_ACCURACY_dup := @_TS_ACCURACY_dup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_ACCURACY_dup_allownil)} + if FuncLoadError then + AFailed.Add('TS_ACCURACY_dup'); + {$ifend} + end; + + + ESS_ISSUER_SERIAL_new := LoadLibFunction(ADllHandle, ESS_ISSUER_SERIAL_new_procname); + FuncLoadError := not assigned(ESS_ISSUER_SERIAL_new); + if FuncLoadError then + begin + {$if not defined(ESS_ISSUER_SERIAL_new_allownil)} + ESS_ISSUER_SERIAL_new := @ERR_ESS_ISSUER_SERIAL_new; + {$ifend} + {$if declared(ESS_ISSUER_SERIAL_new_introduced)} + if LibVersion < ESS_ISSUER_SERIAL_new_introduced then + begin + {$if declared(FC_ESS_ISSUER_SERIAL_new)} + ESS_ISSUER_SERIAL_new := @FC_ESS_ISSUER_SERIAL_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ESS_ISSUER_SERIAL_new_removed)} + if ESS_ISSUER_SERIAL_new_removed <= LibVersion then + begin + {$if declared(_ESS_ISSUER_SERIAL_new)} + ESS_ISSUER_SERIAL_new := @_ESS_ISSUER_SERIAL_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ESS_ISSUER_SERIAL_new_allownil)} + if FuncLoadError then + AFailed.Add('ESS_ISSUER_SERIAL_new'); + {$ifend} + end; + + + ESS_ISSUER_SERIAL_free := LoadLibFunction(ADllHandle, ESS_ISSUER_SERIAL_free_procname); + FuncLoadError := not assigned(ESS_ISSUER_SERIAL_free); + if FuncLoadError then + begin + {$if not defined(ESS_ISSUER_SERIAL_free_allownil)} + ESS_ISSUER_SERIAL_free := @ERR_ESS_ISSUER_SERIAL_free; + {$ifend} + {$if declared(ESS_ISSUER_SERIAL_free_introduced)} + if LibVersion < ESS_ISSUER_SERIAL_free_introduced then + begin + {$if declared(FC_ESS_ISSUER_SERIAL_free)} + ESS_ISSUER_SERIAL_free := @FC_ESS_ISSUER_SERIAL_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ESS_ISSUER_SERIAL_free_removed)} + if ESS_ISSUER_SERIAL_free_removed <= LibVersion then + begin + {$if declared(_ESS_ISSUER_SERIAL_free)} + ESS_ISSUER_SERIAL_free := @_ESS_ISSUER_SERIAL_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ESS_ISSUER_SERIAL_free_allownil)} + if FuncLoadError then + AFailed.Add('ESS_ISSUER_SERIAL_free'); + {$ifend} + end; + + + i2d_ESS_ISSUER_SERIAL := LoadLibFunction(ADllHandle, i2d_ESS_ISSUER_SERIAL_procname); + FuncLoadError := not assigned(i2d_ESS_ISSUER_SERIAL); + if FuncLoadError then + begin + {$if not defined(i2d_ESS_ISSUER_SERIAL_allownil)} + i2d_ESS_ISSUER_SERIAL := @ERR_i2d_ESS_ISSUER_SERIAL; + {$ifend} + {$if declared(i2d_ESS_ISSUER_SERIAL_introduced)} + if LibVersion < i2d_ESS_ISSUER_SERIAL_introduced then + begin + {$if declared(FC_i2d_ESS_ISSUER_SERIAL)} + i2d_ESS_ISSUER_SERIAL := @FC_i2d_ESS_ISSUER_SERIAL; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(i2d_ESS_ISSUER_SERIAL_removed)} + if i2d_ESS_ISSUER_SERIAL_removed <= LibVersion then + begin + {$if declared(_i2d_ESS_ISSUER_SERIAL)} + i2d_ESS_ISSUER_SERIAL := @_i2d_ESS_ISSUER_SERIAL; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(i2d_ESS_ISSUER_SERIAL_allownil)} + if FuncLoadError then + AFailed.Add('i2d_ESS_ISSUER_SERIAL'); + {$ifend} + end; + + + d2i_ESS_ISSUER_SERIAL := LoadLibFunction(ADllHandle, d2i_ESS_ISSUER_SERIAL_procname); + FuncLoadError := not assigned(d2i_ESS_ISSUER_SERIAL); + if FuncLoadError then + begin + {$if not defined(d2i_ESS_ISSUER_SERIAL_allownil)} + d2i_ESS_ISSUER_SERIAL := @ERR_d2i_ESS_ISSUER_SERIAL; + {$ifend} + {$if declared(d2i_ESS_ISSUER_SERIAL_introduced)} + if LibVersion < d2i_ESS_ISSUER_SERIAL_introduced then + begin + {$if declared(FC_d2i_ESS_ISSUER_SERIAL)} + d2i_ESS_ISSUER_SERIAL := @FC_d2i_ESS_ISSUER_SERIAL; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(d2i_ESS_ISSUER_SERIAL_removed)} + if d2i_ESS_ISSUER_SERIAL_removed <= LibVersion then + begin + {$if declared(_d2i_ESS_ISSUER_SERIAL)} + d2i_ESS_ISSUER_SERIAL := @_d2i_ESS_ISSUER_SERIAL; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(d2i_ESS_ISSUER_SERIAL_allownil)} + if FuncLoadError then + AFailed.Add('d2i_ESS_ISSUER_SERIAL'); + {$ifend} + end; + + + ESS_ISSUER_SERIAL_dup := LoadLibFunction(ADllHandle, ESS_ISSUER_SERIAL_dup_procname); + FuncLoadError := not assigned(ESS_ISSUER_SERIAL_dup); + if FuncLoadError then + begin + {$if not defined(ESS_ISSUER_SERIAL_dup_allownil)} + ESS_ISSUER_SERIAL_dup := @ERR_ESS_ISSUER_SERIAL_dup; + {$ifend} + {$if declared(ESS_ISSUER_SERIAL_dup_introduced)} + if LibVersion < ESS_ISSUER_SERIAL_dup_introduced then + begin + {$if declared(FC_ESS_ISSUER_SERIAL_dup)} + ESS_ISSUER_SERIAL_dup := @FC_ESS_ISSUER_SERIAL_dup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ESS_ISSUER_SERIAL_dup_removed)} + if ESS_ISSUER_SERIAL_dup_removed <= LibVersion then + begin + {$if declared(_ESS_ISSUER_SERIAL_dup)} + ESS_ISSUER_SERIAL_dup := @_ESS_ISSUER_SERIAL_dup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ESS_ISSUER_SERIAL_dup_allownil)} + if FuncLoadError then + AFailed.Add('ESS_ISSUER_SERIAL_dup'); + {$ifend} + end; + + + ESS_CERT_ID_new := LoadLibFunction(ADllHandle, ESS_CERT_ID_new_procname); + FuncLoadError := not assigned(ESS_CERT_ID_new); + if FuncLoadError then + begin + {$if not defined(ESS_CERT_ID_new_allownil)} + ESS_CERT_ID_new := @ERR_ESS_CERT_ID_new; + {$ifend} + {$if declared(ESS_CERT_ID_new_introduced)} + if LibVersion < ESS_CERT_ID_new_introduced then + begin + {$if declared(FC_ESS_CERT_ID_new)} + ESS_CERT_ID_new := @FC_ESS_CERT_ID_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ESS_CERT_ID_new_removed)} + if ESS_CERT_ID_new_removed <= LibVersion then + begin + {$if declared(_ESS_CERT_ID_new)} + ESS_CERT_ID_new := @_ESS_CERT_ID_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ESS_CERT_ID_new_allownil)} + if FuncLoadError then + AFailed.Add('ESS_CERT_ID_new'); + {$ifend} + end; + + + ESS_CERT_ID_free := LoadLibFunction(ADllHandle, ESS_CERT_ID_free_procname); + FuncLoadError := not assigned(ESS_CERT_ID_free); + if FuncLoadError then + begin + {$if not defined(ESS_CERT_ID_free_allownil)} + ESS_CERT_ID_free := @ERR_ESS_CERT_ID_free; + {$ifend} + {$if declared(ESS_CERT_ID_free_introduced)} + if LibVersion < ESS_CERT_ID_free_introduced then + begin + {$if declared(FC_ESS_CERT_ID_free)} + ESS_CERT_ID_free := @FC_ESS_CERT_ID_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ESS_CERT_ID_free_removed)} + if ESS_CERT_ID_free_removed <= LibVersion then + begin + {$if declared(_ESS_CERT_ID_free)} + ESS_CERT_ID_free := @_ESS_CERT_ID_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ESS_CERT_ID_free_allownil)} + if FuncLoadError then + AFailed.Add('ESS_CERT_ID_free'); + {$ifend} + end; + + + i2d_ESS_CERT_ID := LoadLibFunction(ADllHandle, i2d_ESS_CERT_ID_procname); + FuncLoadError := not assigned(i2d_ESS_CERT_ID); + if FuncLoadError then + begin + {$if not defined(i2d_ESS_CERT_ID_allownil)} + i2d_ESS_CERT_ID := @ERR_i2d_ESS_CERT_ID; + {$ifend} + {$if declared(i2d_ESS_CERT_ID_introduced)} + if LibVersion < i2d_ESS_CERT_ID_introduced then + begin + {$if declared(FC_i2d_ESS_CERT_ID)} + i2d_ESS_CERT_ID := @FC_i2d_ESS_CERT_ID; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(i2d_ESS_CERT_ID_removed)} + if i2d_ESS_CERT_ID_removed <= LibVersion then + begin + {$if declared(_i2d_ESS_CERT_ID)} + i2d_ESS_CERT_ID := @_i2d_ESS_CERT_ID; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(i2d_ESS_CERT_ID_allownil)} + if FuncLoadError then + AFailed.Add('i2d_ESS_CERT_ID'); + {$ifend} + end; + + + d2i_ESS_CERT_ID := LoadLibFunction(ADllHandle, d2i_ESS_CERT_ID_procname); + FuncLoadError := not assigned(d2i_ESS_CERT_ID); + if FuncLoadError then + begin + {$if not defined(d2i_ESS_CERT_ID_allownil)} + d2i_ESS_CERT_ID := @ERR_d2i_ESS_CERT_ID; + {$ifend} + {$if declared(d2i_ESS_CERT_ID_introduced)} + if LibVersion < d2i_ESS_CERT_ID_introduced then + begin + {$if declared(FC_d2i_ESS_CERT_ID)} + d2i_ESS_CERT_ID := @FC_d2i_ESS_CERT_ID; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(d2i_ESS_CERT_ID_removed)} + if d2i_ESS_CERT_ID_removed <= LibVersion then + begin + {$if declared(_d2i_ESS_CERT_ID)} + d2i_ESS_CERT_ID := @_d2i_ESS_CERT_ID; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(d2i_ESS_CERT_ID_allownil)} + if FuncLoadError then + AFailed.Add('d2i_ESS_CERT_ID'); + {$ifend} + end; + + + ESS_CERT_ID_dup := LoadLibFunction(ADllHandle, ESS_CERT_ID_dup_procname); + FuncLoadError := not assigned(ESS_CERT_ID_dup); + if FuncLoadError then + begin + {$if not defined(ESS_CERT_ID_dup_allownil)} + ESS_CERT_ID_dup := @ERR_ESS_CERT_ID_dup; + {$ifend} + {$if declared(ESS_CERT_ID_dup_introduced)} + if LibVersion < ESS_CERT_ID_dup_introduced then + begin + {$if declared(FC_ESS_CERT_ID_dup)} + ESS_CERT_ID_dup := @FC_ESS_CERT_ID_dup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ESS_CERT_ID_dup_removed)} + if ESS_CERT_ID_dup_removed <= LibVersion then + begin + {$if declared(_ESS_CERT_ID_dup)} + ESS_CERT_ID_dup := @_ESS_CERT_ID_dup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ESS_CERT_ID_dup_allownil)} + if FuncLoadError then + AFailed.Add('ESS_CERT_ID_dup'); + {$ifend} + end; + + + ESS_SIGNING_CERT_new := LoadLibFunction(ADllHandle, ESS_SIGNING_CERT_new_procname); + FuncLoadError := not assigned(ESS_SIGNING_CERT_new); + if FuncLoadError then + begin + {$if not defined(ESS_SIGNING_CERT_new_allownil)} + ESS_SIGNING_CERT_new := @ERR_ESS_SIGNING_CERT_new; + {$ifend} + {$if declared(ESS_SIGNING_CERT_new_introduced)} + if LibVersion < ESS_SIGNING_CERT_new_introduced then + begin + {$if declared(FC_ESS_SIGNING_CERT_new)} + ESS_SIGNING_CERT_new := @FC_ESS_SIGNING_CERT_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ESS_SIGNING_CERT_new_removed)} + if ESS_SIGNING_CERT_new_removed <= LibVersion then + begin + {$if declared(_ESS_SIGNING_CERT_new)} + ESS_SIGNING_CERT_new := @_ESS_SIGNING_CERT_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ESS_SIGNING_CERT_new_allownil)} + if FuncLoadError then + AFailed.Add('ESS_SIGNING_CERT_new'); + {$ifend} + end; + + + ESS_SIGNING_CERT_free := LoadLibFunction(ADllHandle, ESS_SIGNING_CERT_free_procname); + FuncLoadError := not assigned(ESS_SIGNING_CERT_free); + if FuncLoadError then + begin + {$if not defined(ESS_SIGNING_CERT_free_allownil)} + ESS_SIGNING_CERT_free := @ERR_ESS_SIGNING_CERT_free; + {$ifend} + {$if declared(ESS_SIGNING_CERT_free_introduced)} + if LibVersion < ESS_SIGNING_CERT_free_introduced then + begin + {$if declared(FC_ESS_SIGNING_CERT_free)} + ESS_SIGNING_CERT_free := @FC_ESS_SIGNING_CERT_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ESS_SIGNING_CERT_free_removed)} + if ESS_SIGNING_CERT_free_removed <= LibVersion then + begin + {$if declared(_ESS_SIGNING_CERT_free)} + ESS_SIGNING_CERT_free := @_ESS_SIGNING_CERT_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ESS_SIGNING_CERT_free_allownil)} + if FuncLoadError then + AFailed.Add('ESS_SIGNING_CERT_free'); + {$ifend} + end; + + + i2d_ESS_SIGNING_CERT := LoadLibFunction(ADllHandle, i2d_ESS_SIGNING_CERT_procname); + FuncLoadError := not assigned(i2d_ESS_SIGNING_CERT); + if FuncLoadError then + begin + {$if not defined(i2d_ESS_SIGNING_CERT_allownil)} + i2d_ESS_SIGNING_CERT := @ERR_i2d_ESS_SIGNING_CERT; + {$ifend} + {$if declared(i2d_ESS_SIGNING_CERT_introduced)} + if LibVersion < i2d_ESS_SIGNING_CERT_introduced then + begin + {$if declared(FC_i2d_ESS_SIGNING_CERT)} + i2d_ESS_SIGNING_CERT := @FC_i2d_ESS_SIGNING_CERT; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(i2d_ESS_SIGNING_CERT_removed)} + if i2d_ESS_SIGNING_CERT_removed <= LibVersion then + begin + {$if declared(_i2d_ESS_SIGNING_CERT)} + i2d_ESS_SIGNING_CERT := @_i2d_ESS_SIGNING_CERT; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(i2d_ESS_SIGNING_CERT_allownil)} + if FuncLoadError then + AFailed.Add('i2d_ESS_SIGNING_CERT'); + {$ifend} + end; + + + d2i_ESS_SIGNING_CERT := LoadLibFunction(ADllHandle, d2i_ESS_SIGNING_CERT_procname); + FuncLoadError := not assigned(d2i_ESS_SIGNING_CERT); + if FuncLoadError then + begin + {$if not defined(d2i_ESS_SIGNING_CERT_allownil)} + d2i_ESS_SIGNING_CERT := @ERR_d2i_ESS_SIGNING_CERT; + {$ifend} + {$if declared(d2i_ESS_SIGNING_CERT_introduced)} + if LibVersion < d2i_ESS_SIGNING_CERT_introduced then + begin + {$if declared(FC_d2i_ESS_SIGNING_CERT)} + d2i_ESS_SIGNING_CERT := @FC_d2i_ESS_SIGNING_CERT; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(d2i_ESS_SIGNING_CERT_removed)} + if d2i_ESS_SIGNING_CERT_removed <= LibVersion then + begin + {$if declared(_d2i_ESS_SIGNING_CERT)} + d2i_ESS_SIGNING_CERT := @_d2i_ESS_SIGNING_CERT; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(d2i_ESS_SIGNING_CERT_allownil)} + if FuncLoadError then + AFailed.Add('d2i_ESS_SIGNING_CERT'); + {$ifend} + end; + + + ESS_SIGNING_CERT_dup := LoadLibFunction(ADllHandle, ESS_SIGNING_CERT_dup_procname); + FuncLoadError := not assigned(ESS_SIGNING_CERT_dup); + if FuncLoadError then + begin + {$if not defined(ESS_SIGNING_CERT_dup_allownil)} + ESS_SIGNING_CERT_dup := @ERR_ESS_SIGNING_CERT_dup; + {$ifend} + {$if declared(ESS_SIGNING_CERT_dup_introduced)} + if LibVersion < ESS_SIGNING_CERT_dup_introduced then + begin + {$if declared(FC_ESS_SIGNING_CERT_dup)} + ESS_SIGNING_CERT_dup := @FC_ESS_SIGNING_CERT_dup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ESS_SIGNING_CERT_dup_removed)} + if ESS_SIGNING_CERT_dup_removed <= LibVersion then + begin + {$if declared(_ESS_SIGNING_CERT_dup)} + ESS_SIGNING_CERT_dup := @_ESS_SIGNING_CERT_dup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ESS_SIGNING_CERT_dup_allownil)} + if FuncLoadError then + AFailed.Add('ESS_SIGNING_CERT_dup'); + {$ifend} + end; + + + ESS_CERT_ID_V2_new := LoadLibFunction(ADllHandle, ESS_CERT_ID_V2_new_procname); + FuncLoadError := not assigned(ESS_CERT_ID_V2_new); + if FuncLoadError then + begin + {$if not defined(ESS_CERT_ID_V2_new_allownil)} + ESS_CERT_ID_V2_new := @ERR_ESS_CERT_ID_V2_new; + {$ifend} + {$if declared(ESS_CERT_ID_V2_new_introduced)} + if LibVersion < ESS_CERT_ID_V2_new_introduced then + begin + {$if declared(FC_ESS_CERT_ID_V2_new)} + ESS_CERT_ID_V2_new := @FC_ESS_CERT_ID_V2_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ESS_CERT_ID_V2_new_removed)} + if ESS_CERT_ID_V2_new_removed <= LibVersion then + begin + {$if declared(_ESS_CERT_ID_V2_new)} + ESS_CERT_ID_V2_new := @_ESS_CERT_ID_V2_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ESS_CERT_ID_V2_new_allownil)} + if FuncLoadError then + AFailed.Add('ESS_CERT_ID_V2_new'); + {$ifend} + end; + + + ESS_CERT_ID_V2_free := LoadLibFunction(ADllHandle, ESS_CERT_ID_V2_free_procname); + FuncLoadError := not assigned(ESS_CERT_ID_V2_free); + if FuncLoadError then + begin + {$if not defined(ESS_CERT_ID_V2_free_allownil)} + ESS_CERT_ID_V2_free := @ERR_ESS_CERT_ID_V2_free; + {$ifend} + {$if declared(ESS_CERT_ID_V2_free_introduced)} + if LibVersion < ESS_CERT_ID_V2_free_introduced then + begin + {$if declared(FC_ESS_CERT_ID_V2_free)} + ESS_CERT_ID_V2_free := @FC_ESS_CERT_ID_V2_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ESS_CERT_ID_V2_free_removed)} + if ESS_CERT_ID_V2_free_removed <= LibVersion then + begin + {$if declared(_ESS_CERT_ID_V2_free)} + ESS_CERT_ID_V2_free := @_ESS_CERT_ID_V2_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ESS_CERT_ID_V2_free_allownil)} + if FuncLoadError then + AFailed.Add('ESS_CERT_ID_V2_free'); + {$ifend} + end; + + + i2d_ESS_CERT_ID_V2 := LoadLibFunction(ADllHandle, i2d_ESS_CERT_ID_V2_procname); + FuncLoadError := not assigned(i2d_ESS_CERT_ID_V2); + if FuncLoadError then + begin + {$if not defined(i2d_ESS_CERT_ID_V2_allownil)} + i2d_ESS_CERT_ID_V2 := @ERR_i2d_ESS_CERT_ID_V2; + {$ifend} + {$if declared(i2d_ESS_CERT_ID_V2_introduced)} + if LibVersion < i2d_ESS_CERT_ID_V2_introduced then + begin + {$if declared(FC_i2d_ESS_CERT_ID_V2)} + i2d_ESS_CERT_ID_V2 := @FC_i2d_ESS_CERT_ID_V2; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(i2d_ESS_CERT_ID_V2_removed)} + if i2d_ESS_CERT_ID_V2_removed <= LibVersion then + begin + {$if declared(_i2d_ESS_CERT_ID_V2)} + i2d_ESS_CERT_ID_V2 := @_i2d_ESS_CERT_ID_V2; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(i2d_ESS_CERT_ID_V2_allownil)} + if FuncLoadError then + AFailed.Add('i2d_ESS_CERT_ID_V2'); + {$ifend} + end; + + + d2i_ESS_CERT_ID_V2 := LoadLibFunction(ADllHandle, d2i_ESS_CERT_ID_V2_procname); + FuncLoadError := not assigned(d2i_ESS_CERT_ID_V2); + if FuncLoadError then + begin + {$if not defined(d2i_ESS_CERT_ID_V2_allownil)} + d2i_ESS_CERT_ID_V2 := @ERR_d2i_ESS_CERT_ID_V2; + {$ifend} + {$if declared(d2i_ESS_CERT_ID_V2_introduced)} + if LibVersion < d2i_ESS_CERT_ID_V2_introduced then + begin + {$if declared(FC_d2i_ESS_CERT_ID_V2)} + d2i_ESS_CERT_ID_V2 := @FC_d2i_ESS_CERT_ID_V2; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(d2i_ESS_CERT_ID_V2_removed)} + if d2i_ESS_CERT_ID_V2_removed <= LibVersion then + begin + {$if declared(_d2i_ESS_CERT_ID_V2)} + d2i_ESS_CERT_ID_V2 := @_d2i_ESS_CERT_ID_V2; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(d2i_ESS_CERT_ID_V2_allownil)} + if FuncLoadError then + AFailed.Add('d2i_ESS_CERT_ID_V2'); + {$ifend} + end; + + + ESS_CERT_ID_V2_dup := LoadLibFunction(ADllHandle, ESS_CERT_ID_V2_dup_procname); + FuncLoadError := not assigned(ESS_CERT_ID_V2_dup); + if FuncLoadError then + begin + {$if not defined(ESS_CERT_ID_V2_dup_allownil)} + ESS_CERT_ID_V2_dup := @ERR_ESS_CERT_ID_V2_dup; + {$ifend} + {$if declared(ESS_CERT_ID_V2_dup_introduced)} + if LibVersion < ESS_CERT_ID_V2_dup_introduced then + begin + {$if declared(FC_ESS_CERT_ID_V2_dup)} + ESS_CERT_ID_V2_dup := @FC_ESS_CERT_ID_V2_dup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ESS_CERT_ID_V2_dup_removed)} + if ESS_CERT_ID_V2_dup_removed <= LibVersion then + begin + {$if declared(_ESS_CERT_ID_V2_dup)} + ESS_CERT_ID_V2_dup := @_ESS_CERT_ID_V2_dup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ESS_CERT_ID_V2_dup_allownil)} + if FuncLoadError then + AFailed.Add('ESS_CERT_ID_V2_dup'); + {$ifend} + end; + + + ESS_SIGNING_CERT_V2_new := LoadLibFunction(ADllHandle, ESS_SIGNING_CERT_V2_new_procname); + FuncLoadError := not assigned(ESS_SIGNING_CERT_V2_new); + if FuncLoadError then + begin + {$if not defined(ESS_SIGNING_CERT_V2_new_allownil)} + ESS_SIGNING_CERT_V2_new := @ERR_ESS_SIGNING_CERT_V2_new; + {$ifend} + {$if declared(ESS_SIGNING_CERT_V2_new_introduced)} + if LibVersion < ESS_SIGNING_CERT_V2_new_introduced then + begin + {$if declared(FC_ESS_SIGNING_CERT_V2_new)} + ESS_SIGNING_CERT_V2_new := @FC_ESS_SIGNING_CERT_V2_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ESS_SIGNING_CERT_V2_new_removed)} + if ESS_SIGNING_CERT_V2_new_removed <= LibVersion then + begin + {$if declared(_ESS_SIGNING_CERT_V2_new)} + ESS_SIGNING_CERT_V2_new := @_ESS_SIGNING_CERT_V2_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ESS_SIGNING_CERT_V2_new_allownil)} + if FuncLoadError then + AFailed.Add('ESS_SIGNING_CERT_V2_new'); + {$ifend} + end; + + + ESS_SIGNING_CERT_V2_free := LoadLibFunction(ADllHandle, ESS_SIGNING_CERT_V2_free_procname); + FuncLoadError := not assigned(ESS_SIGNING_CERT_V2_free); + if FuncLoadError then + begin + {$if not defined(ESS_SIGNING_CERT_V2_free_allownil)} + ESS_SIGNING_CERT_V2_free := @ERR_ESS_SIGNING_CERT_V2_free; + {$ifend} + {$if declared(ESS_SIGNING_CERT_V2_free_introduced)} + if LibVersion < ESS_SIGNING_CERT_V2_free_introduced then + begin + {$if declared(FC_ESS_SIGNING_CERT_V2_free)} + ESS_SIGNING_CERT_V2_free := @FC_ESS_SIGNING_CERT_V2_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ESS_SIGNING_CERT_V2_free_removed)} + if ESS_SIGNING_CERT_V2_free_removed <= LibVersion then + begin + {$if declared(_ESS_SIGNING_CERT_V2_free)} + ESS_SIGNING_CERT_V2_free := @_ESS_SIGNING_CERT_V2_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ESS_SIGNING_CERT_V2_free_allownil)} + if FuncLoadError then + AFailed.Add('ESS_SIGNING_CERT_V2_free'); + {$ifend} + end; + + + i2d_ESS_SIGNING_CERT_V2 := LoadLibFunction(ADllHandle, i2d_ESS_SIGNING_CERT_V2_procname); + FuncLoadError := not assigned(i2d_ESS_SIGNING_CERT_V2); + if FuncLoadError then + begin + {$if not defined(i2d_ESS_SIGNING_CERT_V2_allownil)} + i2d_ESS_SIGNING_CERT_V2 := @ERR_i2d_ESS_SIGNING_CERT_V2; + {$ifend} + {$if declared(i2d_ESS_SIGNING_CERT_V2_introduced)} + if LibVersion < i2d_ESS_SIGNING_CERT_V2_introduced then + begin + {$if declared(FC_i2d_ESS_SIGNING_CERT_V2)} + i2d_ESS_SIGNING_CERT_V2 := @FC_i2d_ESS_SIGNING_CERT_V2; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(i2d_ESS_SIGNING_CERT_V2_removed)} + if i2d_ESS_SIGNING_CERT_V2_removed <= LibVersion then + begin + {$if declared(_i2d_ESS_SIGNING_CERT_V2)} + i2d_ESS_SIGNING_CERT_V2 := @_i2d_ESS_SIGNING_CERT_V2; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(i2d_ESS_SIGNING_CERT_V2_allownil)} + if FuncLoadError then + AFailed.Add('i2d_ESS_SIGNING_CERT_V2'); + {$ifend} + end; + + + d2i_ESS_SIGNING_CERT_V2 := LoadLibFunction(ADllHandle, d2i_ESS_SIGNING_CERT_V2_procname); + FuncLoadError := not assigned(d2i_ESS_SIGNING_CERT_V2); + if FuncLoadError then + begin + {$if not defined(d2i_ESS_SIGNING_CERT_V2_allownil)} + d2i_ESS_SIGNING_CERT_V2 := @ERR_d2i_ESS_SIGNING_CERT_V2; + {$ifend} + {$if declared(d2i_ESS_SIGNING_CERT_V2_introduced)} + if LibVersion < d2i_ESS_SIGNING_CERT_V2_introduced then + begin + {$if declared(FC_d2i_ESS_SIGNING_CERT_V2)} + d2i_ESS_SIGNING_CERT_V2 := @FC_d2i_ESS_SIGNING_CERT_V2; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(d2i_ESS_SIGNING_CERT_V2_removed)} + if d2i_ESS_SIGNING_CERT_V2_removed <= LibVersion then + begin + {$if declared(_d2i_ESS_SIGNING_CERT_V2)} + d2i_ESS_SIGNING_CERT_V2 := @_d2i_ESS_SIGNING_CERT_V2; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(d2i_ESS_SIGNING_CERT_V2_allownil)} + if FuncLoadError then + AFailed.Add('d2i_ESS_SIGNING_CERT_V2'); + {$ifend} + end; + + + ESS_SIGNING_CERT_V2_dup := LoadLibFunction(ADllHandle, ESS_SIGNING_CERT_V2_dup_procname); + FuncLoadError := not assigned(ESS_SIGNING_CERT_V2_dup); + if FuncLoadError then + begin + {$if not defined(ESS_SIGNING_CERT_V2_dup_allownil)} + ESS_SIGNING_CERT_V2_dup := @ERR_ESS_SIGNING_CERT_V2_dup; + {$ifend} + {$if declared(ESS_SIGNING_CERT_V2_dup_introduced)} + if LibVersion < ESS_SIGNING_CERT_V2_dup_introduced then + begin + {$if declared(FC_ESS_SIGNING_CERT_V2_dup)} + ESS_SIGNING_CERT_V2_dup := @FC_ESS_SIGNING_CERT_V2_dup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ESS_SIGNING_CERT_V2_dup_removed)} + if ESS_SIGNING_CERT_V2_dup_removed <= LibVersion then + begin + {$if declared(_ESS_SIGNING_CERT_V2_dup)} + ESS_SIGNING_CERT_V2_dup := @_ESS_SIGNING_CERT_V2_dup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ESS_SIGNING_CERT_V2_dup_allownil)} + if FuncLoadError then + AFailed.Add('ESS_SIGNING_CERT_V2_dup'); + {$ifend} + end; + + + TS_REQ_set_version := LoadLibFunction(ADllHandle, TS_REQ_set_version_procname); + FuncLoadError := not assigned(TS_REQ_set_version); + if FuncLoadError then + begin + {$if not defined(TS_REQ_set_version_allownil)} + TS_REQ_set_version := @ERR_TS_REQ_set_version; + {$ifend} + {$if declared(TS_REQ_set_version_introduced)} + if LibVersion < TS_REQ_set_version_introduced then + begin + {$if declared(FC_TS_REQ_set_version)} + TS_REQ_set_version := @FC_TS_REQ_set_version; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_REQ_set_version_removed)} + if TS_REQ_set_version_removed <= LibVersion then + begin + {$if declared(_TS_REQ_set_version)} + TS_REQ_set_version := @_TS_REQ_set_version; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_REQ_set_version_allownil)} + if FuncLoadError then + AFailed.Add('TS_REQ_set_version'); + {$ifend} + end; + + + TS_REQ_get_version := LoadLibFunction(ADllHandle, TS_REQ_get_version_procname); + FuncLoadError := not assigned(TS_REQ_get_version); + if FuncLoadError then + begin + {$if not defined(TS_REQ_get_version_allownil)} + TS_REQ_get_version := @ERR_TS_REQ_get_version; + {$ifend} + {$if declared(TS_REQ_get_version_introduced)} + if LibVersion < TS_REQ_get_version_introduced then + begin + {$if declared(FC_TS_REQ_get_version)} + TS_REQ_get_version := @FC_TS_REQ_get_version; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_REQ_get_version_removed)} + if TS_REQ_get_version_removed <= LibVersion then + begin + {$if declared(_TS_REQ_get_version)} + TS_REQ_get_version := @_TS_REQ_get_version; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_REQ_get_version_allownil)} + if FuncLoadError then + AFailed.Add('TS_REQ_get_version'); + {$ifend} + end; + + + TS_STATUS_INFO_set_status := LoadLibFunction(ADllHandle, TS_STATUS_INFO_set_status_procname); + FuncLoadError := not assigned(TS_STATUS_INFO_set_status); + if FuncLoadError then + begin + {$if not defined(TS_STATUS_INFO_set_status_allownil)} + TS_STATUS_INFO_set_status := @ERR_TS_STATUS_INFO_set_status; + {$ifend} + {$if declared(TS_STATUS_INFO_set_status_introduced)} + if LibVersion < TS_STATUS_INFO_set_status_introduced then + begin + {$if declared(FC_TS_STATUS_INFO_set_status)} + TS_STATUS_INFO_set_status := @FC_TS_STATUS_INFO_set_status; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_STATUS_INFO_set_status_removed)} + if TS_STATUS_INFO_set_status_removed <= LibVersion then + begin + {$if declared(_TS_STATUS_INFO_set_status)} + TS_STATUS_INFO_set_status := @_TS_STATUS_INFO_set_status; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_STATUS_INFO_set_status_allownil)} + if FuncLoadError then + AFailed.Add('TS_STATUS_INFO_set_status'); + {$ifend} + end; + + + TS_STATUS_INFO_get0_status := LoadLibFunction(ADllHandle, TS_STATUS_INFO_get0_status_procname); + FuncLoadError := not assigned(TS_STATUS_INFO_get0_status); + if FuncLoadError then + begin + {$if not defined(TS_STATUS_INFO_get0_status_allownil)} + TS_STATUS_INFO_get0_status := @ERR_TS_STATUS_INFO_get0_status; + {$ifend} + {$if declared(TS_STATUS_INFO_get0_status_introduced)} + if LibVersion < TS_STATUS_INFO_get0_status_introduced then + begin + {$if declared(FC_TS_STATUS_INFO_get0_status)} + TS_STATUS_INFO_get0_status := @FC_TS_STATUS_INFO_get0_status; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_STATUS_INFO_get0_status_removed)} + if TS_STATUS_INFO_get0_status_removed <= LibVersion then + begin + {$if declared(_TS_STATUS_INFO_get0_status)} + TS_STATUS_INFO_get0_status := @_TS_STATUS_INFO_get0_status; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_STATUS_INFO_get0_status_allownil)} + if FuncLoadError then + AFailed.Add('TS_STATUS_INFO_get0_status'); + {$ifend} + end; + + + TS_REQ_set_msg_imprint := LoadLibFunction(ADllHandle, TS_REQ_set_msg_imprint_procname); + FuncLoadError := not assigned(TS_REQ_set_msg_imprint); + if FuncLoadError then + begin + {$if not defined(TS_REQ_set_msg_imprint_allownil)} + TS_REQ_set_msg_imprint := @ERR_TS_REQ_set_msg_imprint; + {$ifend} + {$if declared(TS_REQ_set_msg_imprint_introduced)} + if LibVersion < TS_REQ_set_msg_imprint_introduced then + begin + {$if declared(FC_TS_REQ_set_msg_imprint)} + TS_REQ_set_msg_imprint := @FC_TS_REQ_set_msg_imprint; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_REQ_set_msg_imprint_removed)} + if TS_REQ_set_msg_imprint_removed <= LibVersion then + begin + {$if declared(_TS_REQ_set_msg_imprint)} + TS_REQ_set_msg_imprint := @_TS_REQ_set_msg_imprint; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_REQ_set_msg_imprint_allownil)} + if FuncLoadError then + AFailed.Add('TS_REQ_set_msg_imprint'); + {$ifend} + end; + + + TS_REQ_get_msg_imprint := LoadLibFunction(ADllHandle, TS_REQ_get_msg_imprint_procname); + FuncLoadError := not assigned(TS_REQ_get_msg_imprint); + if FuncLoadError then + begin + {$if not defined(TS_REQ_get_msg_imprint_allownil)} + TS_REQ_get_msg_imprint := @ERR_TS_REQ_get_msg_imprint; + {$ifend} + {$if declared(TS_REQ_get_msg_imprint_introduced)} + if LibVersion < TS_REQ_get_msg_imprint_introduced then + begin + {$if declared(FC_TS_REQ_get_msg_imprint)} + TS_REQ_get_msg_imprint := @FC_TS_REQ_get_msg_imprint; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_REQ_get_msg_imprint_removed)} + if TS_REQ_get_msg_imprint_removed <= LibVersion then + begin + {$if declared(_TS_REQ_get_msg_imprint)} + TS_REQ_get_msg_imprint := @_TS_REQ_get_msg_imprint; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_REQ_get_msg_imprint_allownil)} + if FuncLoadError then + AFailed.Add('TS_REQ_get_msg_imprint'); + {$ifend} + end; + + + TS_MSG_IMPRINT_set_algo := LoadLibFunction(ADllHandle, TS_MSG_IMPRINT_set_algo_procname); + FuncLoadError := not assigned(TS_MSG_IMPRINT_set_algo); + if FuncLoadError then + begin + {$if not defined(TS_MSG_IMPRINT_set_algo_allownil)} + TS_MSG_IMPRINT_set_algo := @ERR_TS_MSG_IMPRINT_set_algo; + {$ifend} + {$if declared(TS_MSG_IMPRINT_set_algo_introduced)} + if LibVersion < TS_MSG_IMPRINT_set_algo_introduced then + begin + {$if declared(FC_TS_MSG_IMPRINT_set_algo)} + TS_MSG_IMPRINT_set_algo := @FC_TS_MSG_IMPRINT_set_algo; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_MSG_IMPRINT_set_algo_removed)} + if TS_MSG_IMPRINT_set_algo_removed <= LibVersion then + begin + {$if declared(_TS_MSG_IMPRINT_set_algo)} + TS_MSG_IMPRINT_set_algo := @_TS_MSG_IMPRINT_set_algo; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_MSG_IMPRINT_set_algo_allownil)} + if FuncLoadError then + AFailed.Add('TS_MSG_IMPRINT_set_algo'); + {$ifend} + end; + + + TS_MSG_IMPRINT_get_algo := LoadLibFunction(ADllHandle, TS_MSG_IMPRINT_get_algo_procname); + FuncLoadError := not assigned(TS_MSG_IMPRINT_get_algo); + if FuncLoadError then + begin + {$if not defined(TS_MSG_IMPRINT_get_algo_allownil)} + TS_MSG_IMPRINT_get_algo := @ERR_TS_MSG_IMPRINT_get_algo; + {$ifend} + {$if declared(TS_MSG_IMPRINT_get_algo_introduced)} + if LibVersion < TS_MSG_IMPRINT_get_algo_introduced then + begin + {$if declared(FC_TS_MSG_IMPRINT_get_algo)} + TS_MSG_IMPRINT_get_algo := @FC_TS_MSG_IMPRINT_get_algo; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_MSG_IMPRINT_get_algo_removed)} + if TS_MSG_IMPRINT_get_algo_removed <= LibVersion then + begin + {$if declared(_TS_MSG_IMPRINT_get_algo)} + TS_MSG_IMPRINT_get_algo := @_TS_MSG_IMPRINT_get_algo; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_MSG_IMPRINT_get_algo_allownil)} + if FuncLoadError then + AFailed.Add('TS_MSG_IMPRINT_get_algo'); + {$ifend} + end; + + + TS_MSG_IMPRINT_set_msg := LoadLibFunction(ADllHandle, TS_MSG_IMPRINT_set_msg_procname); + FuncLoadError := not assigned(TS_MSG_IMPRINT_set_msg); + if FuncLoadError then + begin + {$if not defined(TS_MSG_IMPRINT_set_msg_allownil)} + TS_MSG_IMPRINT_set_msg := @ERR_TS_MSG_IMPRINT_set_msg; + {$ifend} + {$if declared(TS_MSG_IMPRINT_set_msg_introduced)} + if LibVersion < TS_MSG_IMPRINT_set_msg_introduced then + begin + {$if declared(FC_TS_MSG_IMPRINT_set_msg)} + TS_MSG_IMPRINT_set_msg := @FC_TS_MSG_IMPRINT_set_msg; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_MSG_IMPRINT_set_msg_removed)} + if TS_MSG_IMPRINT_set_msg_removed <= LibVersion then + begin + {$if declared(_TS_MSG_IMPRINT_set_msg)} + TS_MSG_IMPRINT_set_msg := @_TS_MSG_IMPRINT_set_msg; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_MSG_IMPRINT_set_msg_allownil)} + if FuncLoadError then + AFailed.Add('TS_MSG_IMPRINT_set_msg'); + {$ifend} + end; + + + TS_MSG_IMPRINT_get_msg := LoadLibFunction(ADllHandle, TS_MSG_IMPRINT_get_msg_procname); + FuncLoadError := not assigned(TS_MSG_IMPRINT_get_msg); + if FuncLoadError then + begin + {$if not defined(TS_MSG_IMPRINT_get_msg_allownil)} + TS_MSG_IMPRINT_get_msg := @ERR_TS_MSG_IMPRINT_get_msg; + {$ifend} + {$if declared(TS_MSG_IMPRINT_get_msg_introduced)} + if LibVersion < TS_MSG_IMPRINT_get_msg_introduced then + begin + {$if declared(FC_TS_MSG_IMPRINT_get_msg)} + TS_MSG_IMPRINT_get_msg := @FC_TS_MSG_IMPRINT_get_msg; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_MSG_IMPRINT_get_msg_removed)} + if TS_MSG_IMPRINT_get_msg_removed <= LibVersion then + begin + {$if declared(_TS_MSG_IMPRINT_get_msg)} + TS_MSG_IMPRINT_get_msg := @_TS_MSG_IMPRINT_get_msg; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_MSG_IMPRINT_get_msg_allownil)} + if FuncLoadError then + AFailed.Add('TS_MSG_IMPRINT_get_msg'); + {$ifend} + end; + + + TS_REQ_set_policy_id := LoadLibFunction(ADllHandle, TS_REQ_set_policy_id_procname); + FuncLoadError := not assigned(TS_REQ_set_policy_id); + if FuncLoadError then + begin + {$if not defined(TS_REQ_set_policy_id_allownil)} + TS_REQ_set_policy_id := @ERR_TS_REQ_set_policy_id; + {$ifend} + {$if declared(TS_REQ_set_policy_id_introduced)} + if LibVersion < TS_REQ_set_policy_id_introduced then + begin + {$if declared(FC_TS_REQ_set_policy_id)} + TS_REQ_set_policy_id := @FC_TS_REQ_set_policy_id; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_REQ_set_policy_id_removed)} + if TS_REQ_set_policy_id_removed <= LibVersion then + begin + {$if declared(_TS_REQ_set_policy_id)} + TS_REQ_set_policy_id := @_TS_REQ_set_policy_id; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_REQ_set_policy_id_allownil)} + if FuncLoadError then + AFailed.Add('TS_REQ_set_policy_id'); + {$ifend} + end; + + + TS_REQ_get_policy_id := LoadLibFunction(ADllHandle, TS_REQ_get_policy_id_procname); + FuncLoadError := not assigned(TS_REQ_get_policy_id); + if FuncLoadError then + begin + {$if not defined(TS_REQ_get_policy_id_allownil)} + TS_REQ_get_policy_id := @ERR_TS_REQ_get_policy_id; + {$ifend} + {$if declared(TS_REQ_get_policy_id_introduced)} + if LibVersion < TS_REQ_get_policy_id_introduced then + begin + {$if declared(FC_TS_REQ_get_policy_id)} + TS_REQ_get_policy_id := @FC_TS_REQ_get_policy_id; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_REQ_get_policy_id_removed)} + if TS_REQ_get_policy_id_removed <= LibVersion then + begin + {$if declared(_TS_REQ_get_policy_id)} + TS_REQ_get_policy_id := @_TS_REQ_get_policy_id; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_REQ_get_policy_id_allownil)} + if FuncLoadError then + AFailed.Add('TS_REQ_get_policy_id'); + {$ifend} + end; + + + TS_REQ_set_nonce := LoadLibFunction(ADllHandle, TS_REQ_set_nonce_procname); + FuncLoadError := not assigned(TS_REQ_set_nonce); + if FuncLoadError then + begin + {$if not defined(TS_REQ_set_nonce_allownil)} + TS_REQ_set_nonce := @ERR_TS_REQ_set_nonce; + {$ifend} + {$if declared(TS_REQ_set_nonce_introduced)} + if LibVersion < TS_REQ_set_nonce_introduced then + begin + {$if declared(FC_TS_REQ_set_nonce)} + TS_REQ_set_nonce := @FC_TS_REQ_set_nonce; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_REQ_set_nonce_removed)} + if TS_REQ_set_nonce_removed <= LibVersion then + begin + {$if declared(_TS_REQ_set_nonce)} + TS_REQ_set_nonce := @_TS_REQ_set_nonce; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_REQ_set_nonce_allownil)} + if FuncLoadError then + AFailed.Add('TS_REQ_set_nonce'); + {$ifend} + end; + + + TS_REQ_get_nonce := LoadLibFunction(ADllHandle, TS_REQ_get_nonce_procname); + FuncLoadError := not assigned(TS_REQ_get_nonce); + if FuncLoadError then + begin + {$if not defined(TS_REQ_get_nonce_allownil)} + TS_REQ_get_nonce := @ERR_TS_REQ_get_nonce; + {$ifend} + {$if declared(TS_REQ_get_nonce_introduced)} + if LibVersion < TS_REQ_get_nonce_introduced then + begin + {$if declared(FC_TS_REQ_get_nonce)} + TS_REQ_get_nonce := @FC_TS_REQ_get_nonce; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_REQ_get_nonce_removed)} + if TS_REQ_get_nonce_removed <= LibVersion then + begin + {$if declared(_TS_REQ_get_nonce)} + TS_REQ_get_nonce := @_TS_REQ_get_nonce; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_REQ_get_nonce_allownil)} + if FuncLoadError then + AFailed.Add('TS_REQ_get_nonce'); + {$ifend} + end; + + + TS_REQ_set_cert_req := LoadLibFunction(ADllHandle, TS_REQ_set_cert_req_procname); + FuncLoadError := not assigned(TS_REQ_set_cert_req); + if FuncLoadError then + begin + {$if not defined(TS_REQ_set_cert_req_allownil)} + TS_REQ_set_cert_req := @ERR_TS_REQ_set_cert_req; + {$ifend} + {$if declared(TS_REQ_set_cert_req_introduced)} + if LibVersion < TS_REQ_set_cert_req_introduced then + begin + {$if declared(FC_TS_REQ_set_cert_req)} + TS_REQ_set_cert_req := @FC_TS_REQ_set_cert_req; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_REQ_set_cert_req_removed)} + if TS_REQ_set_cert_req_removed <= LibVersion then + begin + {$if declared(_TS_REQ_set_cert_req)} + TS_REQ_set_cert_req := @_TS_REQ_set_cert_req; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_REQ_set_cert_req_allownil)} + if FuncLoadError then + AFailed.Add('TS_REQ_set_cert_req'); + {$ifend} + end; + + + TS_REQ_get_cert_req := LoadLibFunction(ADllHandle, TS_REQ_get_cert_req_procname); + FuncLoadError := not assigned(TS_REQ_get_cert_req); + if FuncLoadError then + begin + {$if not defined(TS_REQ_get_cert_req_allownil)} + TS_REQ_get_cert_req := @ERR_TS_REQ_get_cert_req; + {$ifend} + {$if declared(TS_REQ_get_cert_req_introduced)} + if LibVersion < TS_REQ_get_cert_req_introduced then + begin + {$if declared(FC_TS_REQ_get_cert_req)} + TS_REQ_get_cert_req := @FC_TS_REQ_get_cert_req; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_REQ_get_cert_req_removed)} + if TS_REQ_get_cert_req_removed <= LibVersion then + begin + {$if declared(_TS_REQ_get_cert_req)} + TS_REQ_get_cert_req := @_TS_REQ_get_cert_req; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_REQ_get_cert_req_allownil)} + if FuncLoadError then + AFailed.Add('TS_REQ_get_cert_req'); + {$ifend} + end; + + + TS_REQ_ext_free := LoadLibFunction(ADllHandle, TS_REQ_ext_free_procname); + FuncLoadError := not assigned(TS_REQ_ext_free); + if FuncLoadError then + begin + {$if not defined(TS_REQ_ext_free_allownil)} + TS_REQ_ext_free := @ERR_TS_REQ_ext_free; + {$ifend} + {$if declared(TS_REQ_ext_free_introduced)} + if LibVersion < TS_REQ_ext_free_introduced then + begin + {$if declared(FC_TS_REQ_ext_free)} + TS_REQ_ext_free := @FC_TS_REQ_ext_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_REQ_ext_free_removed)} + if TS_REQ_ext_free_removed <= LibVersion then + begin + {$if declared(_TS_REQ_ext_free)} + TS_REQ_ext_free := @_TS_REQ_ext_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_REQ_ext_free_allownil)} + if FuncLoadError then + AFailed.Add('TS_REQ_ext_free'); + {$ifend} + end; + + + TS_REQ_get_ext_count := LoadLibFunction(ADllHandle, TS_REQ_get_ext_count_procname); + FuncLoadError := not assigned(TS_REQ_get_ext_count); + if FuncLoadError then + begin + {$if not defined(TS_REQ_get_ext_count_allownil)} + TS_REQ_get_ext_count := @ERR_TS_REQ_get_ext_count; + {$ifend} + {$if declared(TS_REQ_get_ext_count_introduced)} + if LibVersion < TS_REQ_get_ext_count_introduced then + begin + {$if declared(FC_TS_REQ_get_ext_count)} + TS_REQ_get_ext_count := @FC_TS_REQ_get_ext_count; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_REQ_get_ext_count_removed)} + if TS_REQ_get_ext_count_removed <= LibVersion then + begin + {$if declared(_TS_REQ_get_ext_count)} + TS_REQ_get_ext_count := @_TS_REQ_get_ext_count; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_REQ_get_ext_count_allownil)} + if FuncLoadError then + AFailed.Add('TS_REQ_get_ext_count'); + {$ifend} + end; + + + TS_REQ_get_ext_by_NID := LoadLibFunction(ADllHandle, TS_REQ_get_ext_by_NID_procname); + FuncLoadError := not assigned(TS_REQ_get_ext_by_NID); + if FuncLoadError then + begin + {$if not defined(TS_REQ_get_ext_by_NID_allownil)} + TS_REQ_get_ext_by_NID := @ERR_TS_REQ_get_ext_by_NID; + {$ifend} + {$if declared(TS_REQ_get_ext_by_NID_introduced)} + if LibVersion < TS_REQ_get_ext_by_NID_introduced then + begin + {$if declared(FC_TS_REQ_get_ext_by_NID)} + TS_REQ_get_ext_by_NID := @FC_TS_REQ_get_ext_by_NID; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_REQ_get_ext_by_NID_removed)} + if TS_REQ_get_ext_by_NID_removed <= LibVersion then + begin + {$if declared(_TS_REQ_get_ext_by_NID)} + TS_REQ_get_ext_by_NID := @_TS_REQ_get_ext_by_NID; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_REQ_get_ext_by_NID_allownil)} + if FuncLoadError then + AFailed.Add('TS_REQ_get_ext_by_NID'); + {$ifend} + end; + + + TS_REQ_get_ext_by_OBJ := LoadLibFunction(ADllHandle, TS_REQ_get_ext_by_OBJ_procname); + FuncLoadError := not assigned(TS_REQ_get_ext_by_OBJ); + if FuncLoadError then + begin + {$if not defined(TS_REQ_get_ext_by_OBJ_allownil)} + TS_REQ_get_ext_by_OBJ := @ERR_TS_REQ_get_ext_by_OBJ; + {$ifend} + {$if declared(TS_REQ_get_ext_by_OBJ_introduced)} + if LibVersion < TS_REQ_get_ext_by_OBJ_introduced then + begin + {$if declared(FC_TS_REQ_get_ext_by_OBJ)} + TS_REQ_get_ext_by_OBJ := @FC_TS_REQ_get_ext_by_OBJ; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_REQ_get_ext_by_OBJ_removed)} + if TS_REQ_get_ext_by_OBJ_removed <= LibVersion then + begin + {$if declared(_TS_REQ_get_ext_by_OBJ)} + TS_REQ_get_ext_by_OBJ := @_TS_REQ_get_ext_by_OBJ; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_REQ_get_ext_by_OBJ_allownil)} + if FuncLoadError then + AFailed.Add('TS_REQ_get_ext_by_OBJ'); + {$ifend} + end; + + + TS_REQ_get_ext_by_critical := LoadLibFunction(ADllHandle, TS_REQ_get_ext_by_critical_procname); + FuncLoadError := not assigned(TS_REQ_get_ext_by_critical); + if FuncLoadError then + begin + {$if not defined(TS_REQ_get_ext_by_critical_allownil)} + TS_REQ_get_ext_by_critical := @ERR_TS_REQ_get_ext_by_critical; + {$ifend} + {$if declared(TS_REQ_get_ext_by_critical_introduced)} + if LibVersion < TS_REQ_get_ext_by_critical_introduced then + begin + {$if declared(FC_TS_REQ_get_ext_by_critical)} + TS_REQ_get_ext_by_critical := @FC_TS_REQ_get_ext_by_critical; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_REQ_get_ext_by_critical_removed)} + if TS_REQ_get_ext_by_critical_removed <= LibVersion then + begin + {$if declared(_TS_REQ_get_ext_by_critical)} + TS_REQ_get_ext_by_critical := @_TS_REQ_get_ext_by_critical; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_REQ_get_ext_by_critical_allownil)} + if FuncLoadError then + AFailed.Add('TS_REQ_get_ext_by_critical'); + {$ifend} + end; + + + TS_REQ_get_ext := LoadLibFunction(ADllHandle, TS_REQ_get_ext_procname); + FuncLoadError := not assigned(TS_REQ_get_ext); + if FuncLoadError then + begin + {$if not defined(TS_REQ_get_ext_allownil)} + TS_REQ_get_ext := @ERR_TS_REQ_get_ext; + {$ifend} + {$if declared(TS_REQ_get_ext_introduced)} + if LibVersion < TS_REQ_get_ext_introduced then + begin + {$if declared(FC_TS_REQ_get_ext)} + TS_REQ_get_ext := @FC_TS_REQ_get_ext; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_REQ_get_ext_removed)} + if TS_REQ_get_ext_removed <= LibVersion then + begin + {$if declared(_TS_REQ_get_ext)} + TS_REQ_get_ext := @_TS_REQ_get_ext; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_REQ_get_ext_allownil)} + if FuncLoadError then + AFailed.Add('TS_REQ_get_ext'); + {$ifend} + end; + + + TS_REQ_delete_ext := LoadLibFunction(ADllHandle, TS_REQ_delete_ext_procname); + FuncLoadError := not assigned(TS_REQ_delete_ext); + if FuncLoadError then + begin + {$if not defined(TS_REQ_delete_ext_allownil)} + TS_REQ_delete_ext := @ERR_TS_REQ_delete_ext; + {$ifend} + {$if declared(TS_REQ_delete_ext_introduced)} + if LibVersion < TS_REQ_delete_ext_introduced then + begin + {$if declared(FC_TS_REQ_delete_ext)} + TS_REQ_delete_ext := @FC_TS_REQ_delete_ext; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_REQ_delete_ext_removed)} + if TS_REQ_delete_ext_removed <= LibVersion then + begin + {$if declared(_TS_REQ_delete_ext)} + TS_REQ_delete_ext := @_TS_REQ_delete_ext; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_REQ_delete_ext_allownil)} + if FuncLoadError then + AFailed.Add('TS_REQ_delete_ext'); + {$ifend} + end; + + + TS_REQ_add_ext := LoadLibFunction(ADllHandle, TS_REQ_add_ext_procname); + FuncLoadError := not assigned(TS_REQ_add_ext); + if FuncLoadError then + begin + {$if not defined(TS_REQ_add_ext_allownil)} + TS_REQ_add_ext := @ERR_TS_REQ_add_ext; + {$ifend} + {$if declared(TS_REQ_add_ext_introduced)} + if LibVersion < TS_REQ_add_ext_introduced then + begin + {$if declared(FC_TS_REQ_add_ext)} + TS_REQ_add_ext := @FC_TS_REQ_add_ext; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_REQ_add_ext_removed)} + if TS_REQ_add_ext_removed <= LibVersion then + begin + {$if declared(_TS_REQ_add_ext)} + TS_REQ_add_ext := @_TS_REQ_add_ext; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_REQ_add_ext_allownil)} + if FuncLoadError then + AFailed.Add('TS_REQ_add_ext'); + {$ifend} + end; + + + TS_REQ_get_ext_d2i := LoadLibFunction(ADllHandle, TS_REQ_get_ext_d2i_procname); + FuncLoadError := not assigned(TS_REQ_get_ext_d2i); + if FuncLoadError then + begin + {$if not defined(TS_REQ_get_ext_d2i_allownil)} + TS_REQ_get_ext_d2i := @ERR_TS_REQ_get_ext_d2i; + {$ifend} + {$if declared(TS_REQ_get_ext_d2i_introduced)} + if LibVersion < TS_REQ_get_ext_d2i_introduced then + begin + {$if declared(FC_TS_REQ_get_ext_d2i)} + TS_REQ_get_ext_d2i := @FC_TS_REQ_get_ext_d2i; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_REQ_get_ext_d2i_removed)} + if TS_REQ_get_ext_d2i_removed <= LibVersion then + begin + {$if declared(_TS_REQ_get_ext_d2i)} + TS_REQ_get_ext_d2i := @_TS_REQ_get_ext_d2i; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_REQ_get_ext_d2i_allownil)} + if FuncLoadError then + AFailed.Add('TS_REQ_get_ext_d2i'); + {$ifend} + end; + + + TS_REQ_print_bio := LoadLibFunction(ADllHandle, TS_REQ_print_bio_procname); + FuncLoadError := not assigned(TS_REQ_print_bio); + if FuncLoadError then + begin + {$if not defined(TS_REQ_print_bio_allownil)} + TS_REQ_print_bio := @ERR_TS_REQ_print_bio; + {$ifend} + {$if declared(TS_REQ_print_bio_introduced)} + if LibVersion < TS_REQ_print_bio_introduced then + begin + {$if declared(FC_TS_REQ_print_bio)} + TS_REQ_print_bio := @FC_TS_REQ_print_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_REQ_print_bio_removed)} + if TS_REQ_print_bio_removed <= LibVersion then + begin + {$if declared(_TS_REQ_print_bio)} + TS_REQ_print_bio := @_TS_REQ_print_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_REQ_print_bio_allownil)} + if FuncLoadError then + AFailed.Add('TS_REQ_print_bio'); + {$ifend} + end; + + + TS_RESP_set_status_info := LoadLibFunction(ADllHandle, TS_RESP_set_status_info_procname); + FuncLoadError := not assigned(TS_RESP_set_status_info); + if FuncLoadError then + begin + {$if not defined(TS_RESP_set_status_info_allownil)} + TS_RESP_set_status_info := @ERR_TS_RESP_set_status_info; + {$ifend} + {$if declared(TS_RESP_set_status_info_introduced)} + if LibVersion < TS_RESP_set_status_info_introduced then + begin + {$if declared(FC_TS_RESP_set_status_info)} + TS_RESP_set_status_info := @FC_TS_RESP_set_status_info; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_RESP_set_status_info_removed)} + if TS_RESP_set_status_info_removed <= LibVersion then + begin + {$if declared(_TS_RESP_set_status_info)} + TS_RESP_set_status_info := @_TS_RESP_set_status_info; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_RESP_set_status_info_allownil)} + if FuncLoadError then + AFailed.Add('TS_RESP_set_status_info'); + {$ifend} + end; + + + TS_RESP_get_status_info := LoadLibFunction(ADllHandle, TS_RESP_get_status_info_procname); + FuncLoadError := not assigned(TS_RESP_get_status_info); + if FuncLoadError then + begin + {$if not defined(TS_RESP_get_status_info_allownil)} + TS_RESP_get_status_info := @ERR_TS_RESP_get_status_info; + {$ifend} + {$if declared(TS_RESP_get_status_info_introduced)} + if LibVersion < TS_RESP_get_status_info_introduced then + begin + {$if declared(FC_TS_RESP_get_status_info)} + TS_RESP_get_status_info := @FC_TS_RESP_get_status_info; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_RESP_get_status_info_removed)} + if TS_RESP_get_status_info_removed <= LibVersion then + begin + {$if declared(_TS_RESP_get_status_info)} + TS_RESP_get_status_info := @_TS_RESP_get_status_info; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_RESP_get_status_info_allownil)} + if FuncLoadError then + AFailed.Add('TS_RESP_get_status_info'); + {$ifend} + end; + + + TS_RESP_set_tst_info := LoadLibFunction(ADllHandle, TS_RESP_set_tst_info_procname); + FuncLoadError := not assigned(TS_RESP_set_tst_info); + if FuncLoadError then + begin + {$if not defined(TS_RESP_set_tst_info_allownil)} + TS_RESP_set_tst_info := @ERR_TS_RESP_set_tst_info; + {$ifend} + {$if declared(TS_RESP_set_tst_info_introduced)} + if LibVersion < TS_RESP_set_tst_info_introduced then + begin + {$if declared(FC_TS_RESP_set_tst_info)} + TS_RESP_set_tst_info := @FC_TS_RESP_set_tst_info; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_RESP_set_tst_info_removed)} + if TS_RESP_set_tst_info_removed <= LibVersion then + begin + {$if declared(_TS_RESP_set_tst_info)} + TS_RESP_set_tst_info := @_TS_RESP_set_tst_info; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_RESP_set_tst_info_allownil)} + if FuncLoadError then + AFailed.Add('TS_RESP_set_tst_info'); + {$ifend} + end; + + + TS_RESP_get_token := LoadLibFunction(ADllHandle, TS_RESP_get_token_procname); + FuncLoadError := not assigned(TS_RESP_get_token); + if FuncLoadError then + begin + {$if not defined(TS_RESP_get_token_allownil)} + TS_RESP_get_token := @ERR_TS_RESP_get_token; + {$ifend} + {$if declared(TS_RESP_get_token_introduced)} + if LibVersion < TS_RESP_get_token_introduced then + begin + {$if declared(FC_TS_RESP_get_token)} + TS_RESP_get_token := @FC_TS_RESP_get_token; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_RESP_get_token_removed)} + if TS_RESP_get_token_removed <= LibVersion then + begin + {$if declared(_TS_RESP_get_token)} + TS_RESP_get_token := @_TS_RESP_get_token; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_RESP_get_token_allownil)} + if FuncLoadError then + AFailed.Add('TS_RESP_get_token'); + {$ifend} + end; + + + TS_RESP_get_tst_info := LoadLibFunction(ADllHandle, TS_RESP_get_tst_info_procname); + FuncLoadError := not assigned(TS_RESP_get_tst_info); + if FuncLoadError then + begin + {$if not defined(TS_RESP_get_tst_info_allownil)} + TS_RESP_get_tst_info := @ERR_TS_RESP_get_tst_info; + {$ifend} + {$if declared(TS_RESP_get_tst_info_introduced)} + if LibVersion < TS_RESP_get_tst_info_introduced then + begin + {$if declared(FC_TS_RESP_get_tst_info)} + TS_RESP_get_tst_info := @FC_TS_RESP_get_tst_info; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_RESP_get_tst_info_removed)} + if TS_RESP_get_tst_info_removed <= LibVersion then + begin + {$if declared(_TS_RESP_get_tst_info)} + TS_RESP_get_tst_info := @_TS_RESP_get_tst_info; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_RESP_get_tst_info_allownil)} + if FuncLoadError then + AFailed.Add('TS_RESP_get_tst_info'); + {$ifend} + end; + + + TS_TST_INFO_set_version := LoadLibFunction(ADllHandle, TS_TST_INFO_set_version_procname); + FuncLoadError := not assigned(TS_TST_INFO_set_version); + if FuncLoadError then + begin + {$if not defined(TS_TST_INFO_set_version_allownil)} + TS_TST_INFO_set_version := @ERR_TS_TST_INFO_set_version; + {$ifend} + {$if declared(TS_TST_INFO_set_version_introduced)} + if LibVersion < TS_TST_INFO_set_version_introduced then + begin + {$if declared(FC_TS_TST_INFO_set_version)} + TS_TST_INFO_set_version := @FC_TS_TST_INFO_set_version; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_TST_INFO_set_version_removed)} + if TS_TST_INFO_set_version_removed <= LibVersion then + begin + {$if declared(_TS_TST_INFO_set_version)} + TS_TST_INFO_set_version := @_TS_TST_INFO_set_version; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_TST_INFO_set_version_allownil)} + if FuncLoadError then + AFailed.Add('TS_TST_INFO_set_version'); + {$ifend} + end; + + + TS_TST_INFO_get_version := LoadLibFunction(ADllHandle, TS_TST_INFO_get_version_procname); + FuncLoadError := not assigned(TS_TST_INFO_get_version); + if FuncLoadError then + begin + {$if not defined(TS_TST_INFO_get_version_allownil)} + TS_TST_INFO_get_version := @ERR_TS_TST_INFO_get_version; + {$ifend} + {$if declared(TS_TST_INFO_get_version_introduced)} + if LibVersion < TS_TST_INFO_get_version_introduced then + begin + {$if declared(FC_TS_TST_INFO_get_version)} + TS_TST_INFO_get_version := @FC_TS_TST_INFO_get_version; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_TST_INFO_get_version_removed)} + if TS_TST_INFO_get_version_removed <= LibVersion then + begin + {$if declared(_TS_TST_INFO_get_version)} + TS_TST_INFO_get_version := @_TS_TST_INFO_get_version; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_TST_INFO_get_version_allownil)} + if FuncLoadError then + AFailed.Add('TS_TST_INFO_get_version'); + {$ifend} + end; + + + TS_TST_INFO_set_policy_id := LoadLibFunction(ADllHandle, TS_TST_INFO_set_policy_id_procname); + FuncLoadError := not assigned(TS_TST_INFO_set_policy_id); + if FuncLoadError then + begin + {$if not defined(TS_TST_INFO_set_policy_id_allownil)} + TS_TST_INFO_set_policy_id := @ERR_TS_TST_INFO_set_policy_id; + {$ifend} + {$if declared(TS_TST_INFO_set_policy_id_introduced)} + if LibVersion < TS_TST_INFO_set_policy_id_introduced then + begin + {$if declared(FC_TS_TST_INFO_set_policy_id)} + TS_TST_INFO_set_policy_id := @FC_TS_TST_INFO_set_policy_id; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_TST_INFO_set_policy_id_removed)} + if TS_TST_INFO_set_policy_id_removed <= LibVersion then + begin + {$if declared(_TS_TST_INFO_set_policy_id)} + TS_TST_INFO_set_policy_id := @_TS_TST_INFO_set_policy_id; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_TST_INFO_set_policy_id_allownil)} + if FuncLoadError then + AFailed.Add('TS_TST_INFO_set_policy_id'); + {$ifend} + end; + + + TS_TST_INFO_get_policy_id := LoadLibFunction(ADllHandle, TS_TST_INFO_get_policy_id_procname); + FuncLoadError := not assigned(TS_TST_INFO_get_policy_id); + if FuncLoadError then + begin + {$if not defined(TS_TST_INFO_get_policy_id_allownil)} + TS_TST_INFO_get_policy_id := @ERR_TS_TST_INFO_get_policy_id; + {$ifend} + {$if declared(TS_TST_INFO_get_policy_id_introduced)} + if LibVersion < TS_TST_INFO_get_policy_id_introduced then + begin + {$if declared(FC_TS_TST_INFO_get_policy_id)} + TS_TST_INFO_get_policy_id := @FC_TS_TST_INFO_get_policy_id; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_TST_INFO_get_policy_id_removed)} + if TS_TST_INFO_get_policy_id_removed <= LibVersion then + begin + {$if declared(_TS_TST_INFO_get_policy_id)} + TS_TST_INFO_get_policy_id := @_TS_TST_INFO_get_policy_id; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_TST_INFO_get_policy_id_allownil)} + if FuncLoadError then + AFailed.Add('TS_TST_INFO_get_policy_id'); + {$ifend} + end; + + + TS_TST_INFO_set_msg_imprint := LoadLibFunction(ADllHandle, TS_TST_INFO_set_msg_imprint_procname); + FuncLoadError := not assigned(TS_TST_INFO_set_msg_imprint); + if FuncLoadError then + begin + {$if not defined(TS_TST_INFO_set_msg_imprint_allownil)} + TS_TST_INFO_set_msg_imprint := @ERR_TS_TST_INFO_set_msg_imprint; + {$ifend} + {$if declared(TS_TST_INFO_set_msg_imprint_introduced)} + if LibVersion < TS_TST_INFO_set_msg_imprint_introduced then + begin + {$if declared(FC_TS_TST_INFO_set_msg_imprint)} + TS_TST_INFO_set_msg_imprint := @FC_TS_TST_INFO_set_msg_imprint; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_TST_INFO_set_msg_imprint_removed)} + if TS_TST_INFO_set_msg_imprint_removed <= LibVersion then + begin + {$if declared(_TS_TST_INFO_set_msg_imprint)} + TS_TST_INFO_set_msg_imprint := @_TS_TST_INFO_set_msg_imprint; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_TST_INFO_set_msg_imprint_allownil)} + if FuncLoadError then + AFailed.Add('TS_TST_INFO_set_msg_imprint'); + {$ifend} + end; + + + TS_TST_INFO_get_msg_imprint := LoadLibFunction(ADllHandle, TS_TST_INFO_get_msg_imprint_procname); + FuncLoadError := not assigned(TS_TST_INFO_get_msg_imprint); + if FuncLoadError then + begin + {$if not defined(TS_TST_INFO_get_msg_imprint_allownil)} + TS_TST_INFO_get_msg_imprint := @ERR_TS_TST_INFO_get_msg_imprint; + {$ifend} + {$if declared(TS_TST_INFO_get_msg_imprint_introduced)} + if LibVersion < TS_TST_INFO_get_msg_imprint_introduced then + begin + {$if declared(FC_TS_TST_INFO_get_msg_imprint)} + TS_TST_INFO_get_msg_imprint := @FC_TS_TST_INFO_get_msg_imprint; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_TST_INFO_get_msg_imprint_removed)} + if TS_TST_INFO_get_msg_imprint_removed <= LibVersion then + begin + {$if declared(_TS_TST_INFO_get_msg_imprint)} + TS_TST_INFO_get_msg_imprint := @_TS_TST_INFO_get_msg_imprint; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_TST_INFO_get_msg_imprint_allownil)} + if FuncLoadError then + AFailed.Add('TS_TST_INFO_get_msg_imprint'); + {$ifend} + end; + + + TS_TST_INFO_set_serial := LoadLibFunction(ADllHandle, TS_TST_INFO_set_serial_procname); + FuncLoadError := not assigned(TS_TST_INFO_set_serial); + if FuncLoadError then + begin + {$if not defined(TS_TST_INFO_set_serial_allownil)} + TS_TST_INFO_set_serial := @ERR_TS_TST_INFO_set_serial; + {$ifend} + {$if declared(TS_TST_INFO_set_serial_introduced)} + if LibVersion < TS_TST_INFO_set_serial_introduced then + begin + {$if declared(FC_TS_TST_INFO_set_serial)} + TS_TST_INFO_set_serial := @FC_TS_TST_INFO_set_serial; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_TST_INFO_set_serial_removed)} + if TS_TST_INFO_set_serial_removed <= LibVersion then + begin + {$if declared(_TS_TST_INFO_set_serial)} + TS_TST_INFO_set_serial := @_TS_TST_INFO_set_serial; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_TST_INFO_set_serial_allownil)} + if FuncLoadError then + AFailed.Add('TS_TST_INFO_set_serial'); + {$ifend} + end; + + + TS_TST_INFO_get_serial := LoadLibFunction(ADllHandle, TS_TST_INFO_get_serial_procname); + FuncLoadError := not assigned(TS_TST_INFO_get_serial); + if FuncLoadError then + begin + {$if not defined(TS_TST_INFO_get_serial_allownil)} + TS_TST_INFO_get_serial := @ERR_TS_TST_INFO_get_serial; + {$ifend} + {$if declared(TS_TST_INFO_get_serial_introduced)} + if LibVersion < TS_TST_INFO_get_serial_introduced then + begin + {$if declared(FC_TS_TST_INFO_get_serial)} + TS_TST_INFO_get_serial := @FC_TS_TST_INFO_get_serial; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_TST_INFO_get_serial_removed)} + if TS_TST_INFO_get_serial_removed <= LibVersion then + begin + {$if declared(_TS_TST_INFO_get_serial)} + TS_TST_INFO_get_serial := @_TS_TST_INFO_get_serial; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_TST_INFO_get_serial_allownil)} + if FuncLoadError then + AFailed.Add('TS_TST_INFO_get_serial'); + {$ifend} + end; + + + TS_TST_INFO_set_time := LoadLibFunction(ADllHandle, TS_TST_INFO_set_time_procname); + FuncLoadError := not assigned(TS_TST_INFO_set_time); + if FuncLoadError then + begin + {$if not defined(TS_TST_INFO_set_time_allownil)} + TS_TST_INFO_set_time := @ERR_TS_TST_INFO_set_time; + {$ifend} + {$if declared(TS_TST_INFO_set_time_introduced)} + if LibVersion < TS_TST_INFO_set_time_introduced then + begin + {$if declared(FC_TS_TST_INFO_set_time)} + TS_TST_INFO_set_time := @FC_TS_TST_INFO_set_time; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_TST_INFO_set_time_removed)} + if TS_TST_INFO_set_time_removed <= LibVersion then + begin + {$if declared(_TS_TST_INFO_set_time)} + TS_TST_INFO_set_time := @_TS_TST_INFO_set_time; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_TST_INFO_set_time_allownil)} + if FuncLoadError then + AFailed.Add('TS_TST_INFO_set_time'); + {$ifend} + end; + + + TS_TST_INFO_get_time := LoadLibFunction(ADllHandle, TS_TST_INFO_get_time_procname); + FuncLoadError := not assigned(TS_TST_INFO_get_time); + if FuncLoadError then + begin + {$if not defined(TS_TST_INFO_get_time_allownil)} + TS_TST_INFO_get_time := @ERR_TS_TST_INFO_get_time; + {$ifend} + {$if declared(TS_TST_INFO_get_time_introduced)} + if LibVersion < TS_TST_INFO_get_time_introduced then + begin + {$if declared(FC_TS_TST_INFO_get_time)} + TS_TST_INFO_get_time := @FC_TS_TST_INFO_get_time; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_TST_INFO_get_time_removed)} + if TS_TST_INFO_get_time_removed <= LibVersion then + begin + {$if declared(_TS_TST_INFO_get_time)} + TS_TST_INFO_get_time := @_TS_TST_INFO_get_time; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_TST_INFO_get_time_allownil)} + if FuncLoadError then + AFailed.Add('TS_TST_INFO_get_time'); + {$ifend} + end; + + + TS_TST_INFO_set_accuracy := LoadLibFunction(ADllHandle, TS_TST_INFO_set_accuracy_procname); + FuncLoadError := not assigned(TS_TST_INFO_set_accuracy); + if FuncLoadError then + begin + {$if not defined(TS_TST_INFO_set_accuracy_allownil)} + TS_TST_INFO_set_accuracy := @ERR_TS_TST_INFO_set_accuracy; + {$ifend} + {$if declared(TS_TST_INFO_set_accuracy_introduced)} + if LibVersion < TS_TST_INFO_set_accuracy_introduced then + begin + {$if declared(FC_TS_TST_INFO_set_accuracy)} + TS_TST_INFO_set_accuracy := @FC_TS_TST_INFO_set_accuracy; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_TST_INFO_set_accuracy_removed)} + if TS_TST_INFO_set_accuracy_removed <= LibVersion then + begin + {$if declared(_TS_TST_INFO_set_accuracy)} + TS_TST_INFO_set_accuracy := @_TS_TST_INFO_set_accuracy; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_TST_INFO_set_accuracy_allownil)} + if FuncLoadError then + AFailed.Add('TS_TST_INFO_set_accuracy'); + {$ifend} + end; + + + TS_TST_INFO_get_accuracy := LoadLibFunction(ADllHandle, TS_TST_INFO_get_accuracy_procname); + FuncLoadError := not assigned(TS_TST_INFO_get_accuracy); + if FuncLoadError then + begin + {$if not defined(TS_TST_INFO_get_accuracy_allownil)} + TS_TST_INFO_get_accuracy := @ERR_TS_TST_INFO_get_accuracy; + {$ifend} + {$if declared(TS_TST_INFO_get_accuracy_introduced)} + if LibVersion < TS_TST_INFO_get_accuracy_introduced then + begin + {$if declared(FC_TS_TST_INFO_get_accuracy)} + TS_TST_INFO_get_accuracy := @FC_TS_TST_INFO_get_accuracy; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_TST_INFO_get_accuracy_removed)} + if TS_TST_INFO_get_accuracy_removed <= LibVersion then + begin + {$if declared(_TS_TST_INFO_get_accuracy)} + TS_TST_INFO_get_accuracy := @_TS_TST_INFO_get_accuracy; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_TST_INFO_get_accuracy_allownil)} + if FuncLoadError then + AFailed.Add('TS_TST_INFO_get_accuracy'); + {$ifend} + end; + + + TS_ACCURACY_set_seconds := LoadLibFunction(ADllHandle, TS_ACCURACY_set_seconds_procname); + FuncLoadError := not assigned(TS_ACCURACY_set_seconds); + if FuncLoadError then + begin + {$if not defined(TS_ACCURACY_set_seconds_allownil)} + TS_ACCURACY_set_seconds := @ERR_TS_ACCURACY_set_seconds; + {$ifend} + {$if declared(TS_ACCURACY_set_seconds_introduced)} + if LibVersion < TS_ACCURACY_set_seconds_introduced then + begin + {$if declared(FC_TS_ACCURACY_set_seconds)} + TS_ACCURACY_set_seconds := @FC_TS_ACCURACY_set_seconds; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_ACCURACY_set_seconds_removed)} + if TS_ACCURACY_set_seconds_removed <= LibVersion then + begin + {$if declared(_TS_ACCURACY_set_seconds)} + TS_ACCURACY_set_seconds := @_TS_ACCURACY_set_seconds; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_ACCURACY_set_seconds_allownil)} + if FuncLoadError then + AFailed.Add('TS_ACCURACY_set_seconds'); + {$ifend} + end; + + + TS_ACCURACY_get_seconds := LoadLibFunction(ADllHandle, TS_ACCURACY_get_seconds_procname); + FuncLoadError := not assigned(TS_ACCURACY_get_seconds); + if FuncLoadError then + begin + {$if not defined(TS_ACCURACY_get_seconds_allownil)} + TS_ACCURACY_get_seconds := @ERR_TS_ACCURACY_get_seconds; + {$ifend} + {$if declared(TS_ACCURACY_get_seconds_introduced)} + if LibVersion < TS_ACCURACY_get_seconds_introduced then + begin + {$if declared(FC_TS_ACCURACY_get_seconds)} + TS_ACCURACY_get_seconds := @FC_TS_ACCURACY_get_seconds; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_ACCURACY_get_seconds_removed)} + if TS_ACCURACY_get_seconds_removed <= LibVersion then + begin + {$if declared(_TS_ACCURACY_get_seconds)} + TS_ACCURACY_get_seconds := @_TS_ACCURACY_get_seconds; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_ACCURACY_get_seconds_allownil)} + if FuncLoadError then + AFailed.Add('TS_ACCURACY_get_seconds'); + {$ifend} + end; + + + TS_ACCURACY_set_millis := LoadLibFunction(ADllHandle, TS_ACCURACY_set_millis_procname); + FuncLoadError := not assigned(TS_ACCURACY_set_millis); + if FuncLoadError then + begin + {$if not defined(TS_ACCURACY_set_millis_allownil)} + TS_ACCURACY_set_millis := @ERR_TS_ACCURACY_set_millis; + {$ifend} + {$if declared(TS_ACCURACY_set_millis_introduced)} + if LibVersion < TS_ACCURACY_set_millis_introduced then + begin + {$if declared(FC_TS_ACCURACY_set_millis)} + TS_ACCURACY_set_millis := @FC_TS_ACCURACY_set_millis; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_ACCURACY_set_millis_removed)} + if TS_ACCURACY_set_millis_removed <= LibVersion then + begin + {$if declared(_TS_ACCURACY_set_millis)} + TS_ACCURACY_set_millis := @_TS_ACCURACY_set_millis; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_ACCURACY_set_millis_allownil)} + if FuncLoadError then + AFailed.Add('TS_ACCURACY_set_millis'); + {$ifend} + end; + + + TS_ACCURACY_get_millis := LoadLibFunction(ADllHandle, TS_ACCURACY_get_millis_procname); + FuncLoadError := not assigned(TS_ACCURACY_get_millis); + if FuncLoadError then + begin + {$if not defined(TS_ACCURACY_get_millis_allownil)} + TS_ACCURACY_get_millis := @ERR_TS_ACCURACY_get_millis; + {$ifend} + {$if declared(TS_ACCURACY_get_millis_introduced)} + if LibVersion < TS_ACCURACY_get_millis_introduced then + begin + {$if declared(FC_TS_ACCURACY_get_millis)} + TS_ACCURACY_get_millis := @FC_TS_ACCURACY_get_millis; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_ACCURACY_get_millis_removed)} + if TS_ACCURACY_get_millis_removed <= LibVersion then + begin + {$if declared(_TS_ACCURACY_get_millis)} + TS_ACCURACY_get_millis := @_TS_ACCURACY_get_millis; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_ACCURACY_get_millis_allownil)} + if FuncLoadError then + AFailed.Add('TS_ACCURACY_get_millis'); + {$ifend} + end; + + + TS_ACCURACY_set_micros := LoadLibFunction(ADllHandle, TS_ACCURACY_set_micros_procname); + FuncLoadError := not assigned(TS_ACCURACY_set_micros); + if FuncLoadError then + begin + {$if not defined(TS_ACCURACY_set_micros_allownil)} + TS_ACCURACY_set_micros := @ERR_TS_ACCURACY_set_micros; + {$ifend} + {$if declared(TS_ACCURACY_set_micros_introduced)} + if LibVersion < TS_ACCURACY_set_micros_introduced then + begin + {$if declared(FC_TS_ACCURACY_set_micros)} + TS_ACCURACY_set_micros := @FC_TS_ACCURACY_set_micros; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_ACCURACY_set_micros_removed)} + if TS_ACCURACY_set_micros_removed <= LibVersion then + begin + {$if declared(_TS_ACCURACY_set_micros)} + TS_ACCURACY_set_micros := @_TS_ACCURACY_set_micros; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_ACCURACY_set_micros_allownil)} + if FuncLoadError then + AFailed.Add('TS_ACCURACY_set_micros'); + {$ifend} + end; + + + TS_ACCURACY_get_micros := LoadLibFunction(ADllHandle, TS_ACCURACY_get_micros_procname); + FuncLoadError := not assigned(TS_ACCURACY_get_micros); + if FuncLoadError then + begin + {$if not defined(TS_ACCURACY_get_micros_allownil)} + TS_ACCURACY_get_micros := @ERR_TS_ACCURACY_get_micros; + {$ifend} + {$if declared(TS_ACCURACY_get_micros_introduced)} + if LibVersion < TS_ACCURACY_get_micros_introduced then + begin + {$if declared(FC_TS_ACCURACY_get_micros)} + TS_ACCURACY_get_micros := @FC_TS_ACCURACY_get_micros; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_ACCURACY_get_micros_removed)} + if TS_ACCURACY_get_micros_removed <= LibVersion then + begin + {$if declared(_TS_ACCURACY_get_micros)} + TS_ACCURACY_get_micros := @_TS_ACCURACY_get_micros; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_ACCURACY_get_micros_allownil)} + if FuncLoadError then + AFailed.Add('TS_ACCURACY_get_micros'); + {$ifend} + end; + + + TS_TST_INFO_set_ordering := LoadLibFunction(ADllHandle, TS_TST_INFO_set_ordering_procname); + FuncLoadError := not assigned(TS_TST_INFO_set_ordering); + if FuncLoadError then + begin + {$if not defined(TS_TST_INFO_set_ordering_allownil)} + TS_TST_INFO_set_ordering := @ERR_TS_TST_INFO_set_ordering; + {$ifend} + {$if declared(TS_TST_INFO_set_ordering_introduced)} + if LibVersion < TS_TST_INFO_set_ordering_introduced then + begin + {$if declared(FC_TS_TST_INFO_set_ordering)} + TS_TST_INFO_set_ordering := @FC_TS_TST_INFO_set_ordering; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_TST_INFO_set_ordering_removed)} + if TS_TST_INFO_set_ordering_removed <= LibVersion then + begin + {$if declared(_TS_TST_INFO_set_ordering)} + TS_TST_INFO_set_ordering := @_TS_TST_INFO_set_ordering; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_TST_INFO_set_ordering_allownil)} + if FuncLoadError then + AFailed.Add('TS_TST_INFO_set_ordering'); + {$ifend} + end; + + + TS_TST_INFO_get_ordering := LoadLibFunction(ADllHandle, TS_TST_INFO_get_ordering_procname); + FuncLoadError := not assigned(TS_TST_INFO_get_ordering); + if FuncLoadError then + begin + {$if not defined(TS_TST_INFO_get_ordering_allownil)} + TS_TST_INFO_get_ordering := @ERR_TS_TST_INFO_get_ordering; + {$ifend} + {$if declared(TS_TST_INFO_get_ordering_introduced)} + if LibVersion < TS_TST_INFO_get_ordering_introduced then + begin + {$if declared(FC_TS_TST_INFO_get_ordering)} + TS_TST_INFO_get_ordering := @FC_TS_TST_INFO_get_ordering; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_TST_INFO_get_ordering_removed)} + if TS_TST_INFO_get_ordering_removed <= LibVersion then + begin + {$if declared(_TS_TST_INFO_get_ordering)} + TS_TST_INFO_get_ordering := @_TS_TST_INFO_get_ordering; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_TST_INFO_get_ordering_allownil)} + if FuncLoadError then + AFailed.Add('TS_TST_INFO_get_ordering'); + {$ifend} + end; + + + TS_TST_INFO_set_nonce := LoadLibFunction(ADllHandle, TS_TST_INFO_set_nonce_procname); + FuncLoadError := not assigned(TS_TST_INFO_set_nonce); + if FuncLoadError then + begin + {$if not defined(TS_TST_INFO_set_nonce_allownil)} + TS_TST_INFO_set_nonce := @ERR_TS_TST_INFO_set_nonce; + {$ifend} + {$if declared(TS_TST_INFO_set_nonce_introduced)} + if LibVersion < TS_TST_INFO_set_nonce_introduced then + begin + {$if declared(FC_TS_TST_INFO_set_nonce)} + TS_TST_INFO_set_nonce := @FC_TS_TST_INFO_set_nonce; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_TST_INFO_set_nonce_removed)} + if TS_TST_INFO_set_nonce_removed <= LibVersion then + begin + {$if declared(_TS_TST_INFO_set_nonce)} + TS_TST_INFO_set_nonce := @_TS_TST_INFO_set_nonce; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_TST_INFO_set_nonce_allownil)} + if FuncLoadError then + AFailed.Add('TS_TST_INFO_set_nonce'); + {$ifend} + end; + + + TS_TST_INFO_get_nonce := LoadLibFunction(ADllHandle, TS_TST_INFO_get_nonce_procname); + FuncLoadError := not assigned(TS_TST_INFO_get_nonce); + if FuncLoadError then + begin + {$if not defined(TS_TST_INFO_get_nonce_allownil)} + TS_TST_INFO_get_nonce := @ERR_TS_TST_INFO_get_nonce; + {$ifend} + {$if declared(TS_TST_INFO_get_nonce_introduced)} + if LibVersion < TS_TST_INFO_get_nonce_introduced then + begin + {$if declared(FC_TS_TST_INFO_get_nonce)} + TS_TST_INFO_get_nonce := @FC_TS_TST_INFO_get_nonce; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_TST_INFO_get_nonce_removed)} + if TS_TST_INFO_get_nonce_removed <= LibVersion then + begin + {$if declared(_TS_TST_INFO_get_nonce)} + TS_TST_INFO_get_nonce := @_TS_TST_INFO_get_nonce; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_TST_INFO_get_nonce_allownil)} + if FuncLoadError then + AFailed.Add('TS_TST_INFO_get_nonce'); + {$ifend} + end; + + + TS_TST_INFO_set_tsa := LoadLibFunction(ADllHandle, TS_TST_INFO_set_tsa_procname); + FuncLoadError := not assigned(TS_TST_INFO_set_tsa); + if FuncLoadError then + begin + {$if not defined(TS_TST_INFO_set_tsa_allownil)} + TS_TST_INFO_set_tsa := @ERR_TS_TST_INFO_set_tsa; + {$ifend} + {$if declared(TS_TST_INFO_set_tsa_introduced)} + if LibVersion < TS_TST_INFO_set_tsa_introduced then + begin + {$if declared(FC_TS_TST_INFO_set_tsa)} + TS_TST_INFO_set_tsa := @FC_TS_TST_INFO_set_tsa; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_TST_INFO_set_tsa_removed)} + if TS_TST_INFO_set_tsa_removed <= LibVersion then + begin + {$if declared(_TS_TST_INFO_set_tsa)} + TS_TST_INFO_set_tsa := @_TS_TST_INFO_set_tsa; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_TST_INFO_set_tsa_allownil)} + if FuncLoadError then + AFailed.Add('TS_TST_INFO_set_tsa'); + {$ifend} + end; + + + TS_TST_INFO_get_tsa := LoadLibFunction(ADllHandle, TS_TST_INFO_get_tsa_procname); + FuncLoadError := not assigned(TS_TST_INFO_get_tsa); + if FuncLoadError then + begin + {$if not defined(TS_TST_INFO_get_tsa_allownil)} + TS_TST_INFO_get_tsa := @ERR_TS_TST_INFO_get_tsa; + {$ifend} + {$if declared(TS_TST_INFO_get_tsa_introduced)} + if LibVersion < TS_TST_INFO_get_tsa_introduced then + begin + {$if declared(FC_TS_TST_INFO_get_tsa)} + TS_TST_INFO_get_tsa := @FC_TS_TST_INFO_get_tsa; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_TST_INFO_get_tsa_removed)} + if TS_TST_INFO_get_tsa_removed <= LibVersion then + begin + {$if declared(_TS_TST_INFO_get_tsa)} + TS_TST_INFO_get_tsa := @_TS_TST_INFO_get_tsa; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_TST_INFO_get_tsa_allownil)} + if FuncLoadError then + AFailed.Add('TS_TST_INFO_get_tsa'); + {$ifend} + end; + + + TS_TST_INFO_ext_free := LoadLibFunction(ADllHandle, TS_TST_INFO_ext_free_procname); + FuncLoadError := not assigned(TS_TST_INFO_ext_free); + if FuncLoadError then + begin + {$if not defined(TS_TST_INFO_ext_free_allownil)} + TS_TST_INFO_ext_free := @ERR_TS_TST_INFO_ext_free; + {$ifend} + {$if declared(TS_TST_INFO_ext_free_introduced)} + if LibVersion < TS_TST_INFO_ext_free_introduced then + begin + {$if declared(FC_TS_TST_INFO_ext_free)} + TS_TST_INFO_ext_free := @FC_TS_TST_INFO_ext_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_TST_INFO_ext_free_removed)} + if TS_TST_INFO_ext_free_removed <= LibVersion then + begin + {$if declared(_TS_TST_INFO_ext_free)} + TS_TST_INFO_ext_free := @_TS_TST_INFO_ext_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_TST_INFO_ext_free_allownil)} + if FuncLoadError then + AFailed.Add('TS_TST_INFO_ext_free'); + {$ifend} + end; + + + TS_TST_INFO_get_ext_count := LoadLibFunction(ADllHandle, TS_TST_INFO_get_ext_count_procname); + FuncLoadError := not assigned(TS_TST_INFO_get_ext_count); + if FuncLoadError then + begin + {$if not defined(TS_TST_INFO_get_ext_count_allownil)} + TS_TST_INFO_get_ext_count := @ERR_TS_TST_INFO_get_ext_count; + {$ifend} + {$if declared(TS_TST_INFO_get_ext_count_introduced)} + if LibVersion < TS_TST_INFO_get_ext_count_introduced then + begin + {$if declared(FC_TS_TST_INFO_get_ext_count)} + TS_TST_INFO_get_ext_count := @FC_TS_TST_INFO_get_ext_count; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_TST_INFO_get_ext_count_removed)} + if TS_TST_INFO_get_ext_count_removed <= LibVersion then + begin + {$if declared(_TS_TST_INFO_get_ext_count)} + TS_TST_INFO_get_ext_count := @_TS_TST_INFO_get_ext_count; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_TST_INFO_get_ext_count_allownil)} + if FuncLoadError then + AFailed.Add('TS_TST_INFO_get_ext_count'); + {$ifend} + end; + + + TS_TST_INFO_get_ext_by_NID := LoadLibFunction(ADllHandle, TS_TST_INFO_get_ext_by_NID_procname); + FuncLoadError := not assigned(TS_TST_INFO_get_ext_by_NID); + if FuncLoadError then + begin + {$if not defined(TS_TST_INFO_get_ext_by_NID_allownil)} + TS_TST_INFO_get_ext_by_NID := @ERR_TS_TST_INFO_get_ext_by_NID; + {$ifend} + {$if declared(TS_TST_INFO_get_ext_by_NID_introduced)} + if LibVersion < TS_TST_INFO_get_ext_by_NID_introduced then + begin + {$if declared(FC_TS_TST_INFO_get_ext_by_NID)} + TS_TST_INFO_get_ext_by_NID := @FC_TS_TST_INFO_get_ext_by_NID; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_TST_INFO_get_ext_by_NID_removed)} + if TS_TST_INFO_get_ext_by_NID_removed <= LibVersion then + begin + {$if declared(_TS_TST_INFO_get_ext_by_NID)} + TS_TST_INFO_get_ext_by_NID := @_TS_TST_INFO_get_ext_by_NID; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_TST_INFO_get_ext_by_NID_allownil)} + if FuncLoadError then + AFailed.Add('TS_TST_INFO_get_ext_by_NID'); + {$ifend} + end; + + + TS_TST_INFO_get_ext_by_OBJ := LoadLibFunction(ADllHandle, TS_TST_INFO_get_ext_by_OBJ_procname); + FuncLoadError := not assigned(TS_TST_INFO_get_ext_by_OBJ); + if FuncLoadError then + begin + {$if not defined(TS_TST_INFO_get_ext_by_OBJ_allownil)} + TS_TST_INFO_get_ext_by_OBJ := @ERR_TS_TST_INFO_get_ext_by_OBJ; + {$ifend} + {$if declared(TS_TST_INFO_get_ext_by_OBJ_introduced)} + if LibVersion < TS_TST_INFO_get_ext_by_OBJ_introduced then + begin + {$if declared(FC_TS_TST_INFO_get_ext_by_OBJ)} + TS_TST_INFO_get_ext_by_OBJ := @FC_TS_TST_INFO_get_ext_by_OBJ; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_TST_INFO_get_ext_by_OBJ_removed)} + if TS_TST_INFO_get_ext_by_OBJ_removed <= LibVersion then + begin + {$if declared(_TS_TST_INFO_get_ext_by_OBJ)} + TS_TST_INFO_get_ext_by_OBJ := @_TS_TST_INFO_get_ext_by_OBJ; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_TST_INFO_get_ext_by_OBJ_allownil)} + if FuncLoadError then + AFailed.Add('TS_TST_INFO_get_ext_by_OBJ'); + {$ifend} + end; + + + TS_TST_INFO_get_ext_by_critical := LoadLibFunction(ADllHandle, TS_TST_INFO_get_ext_by_critical_procname); + FuncLoadError := not assigned(TS_TST_INFO_get_ext_by_critical); + if FuncLoadError then + begin + {$if not defined(TS_TST_INFO_get_ext_by_critical_allownil)} + TS_TST_INFO_get_ext_by_critical := @ERR_TS_TST_INFO_get_ext_by_critical; + {$ifend} + {$if declared(TS_TST_INFO_get_ext_by_critical_introduced)} + if LibVersion < TS_TST_INFO_get_ext_by_critical_introduced then + begin + {$if declared(FC_TS_TST_INFO_get_ext_by_critical)} + TS_TST_INFO_get_ext_by_critical := @FC_TS_TST_INFO_get_ext_by_critical; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_TST_INFO_get_ext_by_critical_removed)} + if TS_TST_INFO_get_ext_by_critical_removed <= LibVersion then + begin + {$if declared(_TS_TST_INFO_get_ext_by_critical)} + TS_TST_INFO_get_ext_by_critical := @_TS_TST_INFO_get_ext_by_critical; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_TST_INFO_get_ext_by_critical_allownil)} + if FuncLoadError then + AFailed.Add('TS_TST_INFO_get_ext_by_critical'); + {$ifend} + end; + + + TS_TST_INFO_get_ext := LoadLibFunction(ADllHandle, TS_TST_INFO_get_ext_procname); + FuncLoadError := not assigned(TS_TST_INFO_get_ext); + if FuncLoadError then + begin + {$if not defined(TS_TST_INFO_get_ext_allownil)} + TS_TST_INFO_get_ext := @ERR_TS_TST_INFO_get_ext; + {$ifend} + {$if declared(TS_TST_INFO_get_ext_introduced)} + if LibVersion < TS_TST_INFO_get_ext_introduced then + begin + {$if declared(FC_TS_TST_INFO_get_ext)} + TS_TST_INFO_get_ext := @FC_TS_TST_INFO_get_ext; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_TST_INFO_get_ext_removed)} + if TS_TST_INFO_get_ext_removed <= LibVersion then + begin + {$if declared(_TS_TST_INFO_get_ext)} + TS_TST_INFO_get_ext := @_TS_TST_INFO_get_ext; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_TST_INFO_get_ext_allownil)} + if FuncLoadError then + AFailed.Add('TS_TST_INFO_get_ext'); + {$ifend} + end; + + + TS_TST_INFO_delete_ext := LoadLibFunction(ADllHandle, TS_TST_INFO_delete_ext_procname); + FuncLoadError := not assigned(TS_TST_INFO_delete_ext); + if FuncLoadError then + begin + {$if not defined(TS_TST_INFO_delete_ext_allownil)} + TS_TST_INFO_delete_ext := @ERR_TS_TST_INFO_delete_ext; + {$ifend} + {$if declared(TS_TST_INFO_delete_ext_introduced)} + if LibVersion < TS_TST_INFO_delete_ext_introduced then + begin + {$if declared(FC_TS_TST_INFO_delete_ext)} + TS_TST_INFO_delete_ext := @FC_TS_TST_INFO_delete_ext; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_TST_INFO_delete_ext_removed)} + if TS_TST_INFO_delete_ext_removed <= LibVersion then + begin + {$if declared(_TS_TST_INFO_delete_ext)} + TS_TST_INFO_delete_ext := @_TS_TST_INFO_delete_ext; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_TST_INFO_delete_ext_allownil)} + if FuncLoadError then + AFailed.Add('TS_TST_INFO_delete_ext'); + {$ifend} + end; + + + TS_TST_INFO_add_ext := LoadLibFunction(ADllHandle, TS_TST_INFO_add_ext_procname); + FuncLoadError := not assigned(TS_TST_INFO_add_ext); + if FuncLoadError then + begin + {$if not defined(TS_TST_INFO_add_ext_allownil)} + TS_TST_INFO_add_ext := @ERR_TS_TST_INFO_add_ext; + {$ifend} + {$if declared(TS_TST_INFO_add_ext_introduced)} + if LibVersion < TS_TST_INFO_add_ext_introduced then + begin + {$if declared(FC_TS_TST_INFO_add_ext)} + TS_TST_INFO_add_ext := @FC_TS_TST_INFO_add_ext; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_TST_INFO_add_ext_removed)} + if TS_TST_INFO_add_ext_removed <= LibVersion then + begin + {$if declared(_TS_TST_INFO_add_ext)} + TS_TST_INFO_add_ext := @_TS_TST_INFO_add_ext; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_TST_INFO_add_ext_allownil)} + if FuncLoadError then + AFailed.Add('TS_TST_INFO_add_ext'); + {$ifend} + end; + + + TS_TST_INFO_get_ext_d2i := LoadLibFunction(ADllHandle, TS_TST_INFO_get_ext_d2i_procname); + FuncLoadError := not assigned(TS_TST_INFO_get_ext_d2i); + if FuncLoadError then + begin + {$if not defined(TS_TST_INFO_get_ext_d2i_allownil)} + TS_TST_INFO_get_ext_d2i := @ERR_TS_TST_INFO_get_ext_d2i; + {$ifend} + {$if declared(TS_TST_INFO_get_ext_d2i_introduced)} + if LibVersion < TS_TST_INFO_get_ext_d2i_introduced then + begin + {$if declared(FC_TS_TST_INFO_get_ext_d2i)} + TS_TST_INFO_get_ext_d2i := @FC_TS_TST_INFO_get_ext_d2i; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_TST_INFO_get_ext_d2i_removed)} + if TS_TST_INFO_get_ext_d2i_removed <= LibVersion then + begin + {$if declared(_TS_TST_INFO_get_ext_d2i)} + TS_TST_INFO_get_ext_d2i := @_TS_TST_INFO_get_ext_d2i; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_TST_INFO_get_ext_d2i_allownil)} + if FuncLoadError then + AFailed.Add('TS_TST_INFO_get_ext_d2i'); + {$ifend} + end; + + + TS_RESP_CTX_new := LoadLibFunction(ADllHandle, TS_RESP_CTX_new_procname); + FuncLoadError := not assigned(TS_RESP_CTX_new); + if FuncLoadError then + begin + {$if not defined(TS_RESP_CTX_new_allownil)} + TS_RESP_CTX_new := @ERR_TS_RESP_CTX_new; + {$ifend} + {$if declared(TS_RESP_CTX_new_introduced)} + if LibVersion < TS_RESP_CTX_new_introduced then + begin + {$if declared(FC_TS_RESP_CTX_new)} + TS_RESP_CTX_new := @FC_TS_RESP_CTX_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_RESP_CTX_new_removed)} + if TS_RESP_CTX_new_removed <= LibVersion then + begin + {$if declared(_TS_RESP_CTX_new)} + TS_RESP_CTX_new := @_TS_RESP_CTX_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_RESP_CTX_new_allownil)} + if FuncLoadError then + AFailed.Add('TS_RESP_CTX_new'); + {$ifend} + end; + + + TS_RESP_CTX_free := LoadLibFunction(ADllHandle, TS_RESP_CTX_free_procname); + FuncLoadError := not assigned(TS_RESP_CTX_free); + if FuncLoadError then + begin + {$if not defined(TS_RESP_CTX_free_allownil)} + TS_RESP_CTX_free := @ERR_TS_RESP_CTX_free; + {$ifend} + {$if declared(TS_RESP_CTX_free_introduced)} + if LibVersion < TS_RESP_CTX_free_introduced then + begin + {$if declared(FC_TS_RESP_CTX_free)} + TS_RESP_CTX_free := @FC_TS_RESP_CTX_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_RESP_CTX_free_removed)} + if TS_RESP_CTX_free_removed <= LibVersion then + begin + {$if declared(_TS_RESP_CTX_free)} + TS_RESP_CTX_free := @_TS_RESP_CTX_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_RESP_CTX_free_allownil)} + if FuncLoadError then + AFailed.Add('TS_RESP_CTX_free'); + {$ifend} + end; + + + TS_RESP_CTX_set_signer_cert := LoadLibFunction(ADllHandle, TS_RESP_CTX_set_signer_cert_procname); + FuncLoadError := not assigned(TS_RESP_CTX_set_signer_cert); + if FuncLoadError then + begin + {$if not defined(TS_RESP_CTX_set_signer_cert_allownil)} + TS_RESP_CTX_set_signer_cert := @ERR_TS_RESP_CTX_set_signer_cert; + {$ifend} + {$if declared(TS_RESP_CTX_set_signer_cert_introduced)} + if LibVersion < TS_RESP_CTX_set_signer_cert_introduced then + begin + {$if declared(FC_TS_RESP_CTX_set_signer_cert)} + TS_RESP_CTX_set_signer_cert := @FC_TS_RESP_CTX_set_signer_cert; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_RESP_CTX_set_signer_cert_removed)} + if TS_RESP_CTX_set_signer_cert_removed <= LibVersion then + begin + {$if declared(_TS_RESP_CTX_set_signer_cert)} + TS_RESP_CTX_set_signer_cert := @_TS_RESP_CTX_set_signer_cert; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_RESP_CTX_set_signer_cert_allownil)} + if FuncLoadError then + AFailed.Add('TS_RESP_CTX_set_signer_cert'); + {$ifend} + end; + + + TS_RESP_CTX_set_signer_key := LoadLibFunction(ADllHandle, TS_RESP_CTX_set_signer_key_procname); + FuncLoadError := not assigned(TS_RESP_CTX_set_signer_key); + if FuncLoadError then + begin + {$if not defined(TS_RESP_CTX_set_signer_key_allownil)} + TS_RESP_CTX_set_signer_key := @ERR_TS_RESP_CTX_set_signer_key; + {$ifend} + {$if declared(TS_RESP_CTX_set_signer_key_introduced)} + if LibVersion < TS_RESP_CTX_set_signer_key_introduced then + begin + {$if declared(FC_TS_RESP_CTX_set_signer_key)} + TS_RESP_CTX_set_signer_key := @FC_TS_RESP_CTX_set_signer_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_RESP_CTX_set_signer_key_removed)} + if TS_RESP_CTX_set_signer_key_removed <= LibVersion then + begin + {$if declared(_TS_RESP_CTX_set_signer_key)} + TS_RESP_CTX_set_signer_key := @_TS_RESP_CTX_set_signer_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_RESP_CTX_set_signer_key_allownil)} + if FuncLoadError then + AFailed.Add('TS_RESP_CTX_set_signer_key'); + {$ifend} + end; + + + TS_RESP_CTX_set_signer_digest := LoadLibFunction(ADllHandle, TS_RESP_CTX_set_signer_digest_procname); + FuncLoadError := not assigned(TS_RESP_CTX_set_signer_digest); + if FuncLoadError then + begin + {$if not defined(TS_RESP_CTX_set_signer_digest_allownil)} + TS_RESP_CTX_set_signer_digest := @ERR_TS_RESP_CTX_set_signer_digest; + {$ifend} + {$if declared(TS_RESP_CTX_set_signer_digest_introduced)} + if LibVersion < TS_RESP_CTX_set_signer_digest_introduced then + begin + {$if declared(FC_TS_RESP_CTX_set_signer_digest)} + TS_RESP_CTX_set_signer_digest := @FC_TS_RESP_CTX_set_signer_digest; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_RESP_CTX_set_signer_digest_removed)} + if TS_RESP_CTX_set_signer_digest_removed <= LibVersion then + begin + {$if declared(_TS_RESP_CTX_set_signer_digest)} + TS_RESP_CTX_set_signer_digest := @_TS_RESP_CTX_set_signer_digest; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_RESP_CTX_set_signer_digest_allownil)} + if FuncLoadError then + AFailed.Add('TS_RESP_CTX_set_signer_digest'); + {$ifend} + end; + + + TS_RESP_CTX_set_ess_cert_id_digest := LoadLibFunction(ADllHandle, TS_RESP_CTX_set_ess_cert_id_digest_procname); + FuncLoadError := not assigned(TS_RESP_CTX_set_ess_cert_id_digest); + if FuncLoadError then + begin + {$if not defined(TS_RESP_CTX_set_ess_cert_id_digest_allownil)} + TS_RESP_CTX_set_ess_cert_id_digest := @ERR_TS_RESP_CTX_set_ess_cert_id_digest; + {$ifend} + {$if declared(TS_RESP_CTX_set_ess_cert_id_digest_introduced)} + if LibVersion < TS_RESP_CTX_set_ess_cert_id_digest_introduced then + begin + {$if declared(FC_TS_RESP_CTX_set_ess_cert_id_digest)} + TS_RESP_CTX_set_ess_cert_id_digest := @FC_TS_RESP_CTX_set_ess_cert_id_digest; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_RESP_CTX_set_ess_cert_id_digest_removed)} + if TS_RESP_CTX_set_ess_cert_id_digest_removed <= LibVersion then + begin + {$if declared(_TS_RESP_CTX_set_ess_cert_id_digest)} + TS_RESP_CTX_set_ess_cert_id_digest := @_TS_RESP_CTX_set_ess_cert_id_digest; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_RESP_CTX_set_ess_cert_id_digest_allownil)} + if FuncLoadError then + AFailed.Add('TS_RESP_CTX_set_ess_cert_id_digest'); + {$ifend} + end; + + + TS_RESP_CTX_set_def_policy := LoadLibFunction(ADllHandle, TS_RESP_CTX_set_def_policy_procname); + FuncLoadError := not assigned(TS_RESP_CTX_set_def_policy); + if FuncLoadError then + begin + {$if not defined(TS_RESP_CTX_set_def_policy_allownil)} + TS_RESP_CTX_set_def_policy := @ERR_TS_RESP_CTX_set_def_policy; + {$ifend} + {$if declared(TS_RESP_CTX_set_def_policy_introduced)} + if LibVersion < TS_RESP_CTX_set_def_policy_introduced then + begin + {$if declared(FC_TS_RESP_CTX_set_def_policy)} + TS_RESP_CTX_set_def_policy := @FC_TS_RESP_CTX_set_def_policy; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_RESP_CTX_set_def_policy_removed)} + if TS_RESP_CTX_set_def_policy_removed <= LibVersion then + begin + {$if declared(_TS_RESP_CTX_set_def_policy)} + TS_RESP_CTX_set_def_policy := @_TS_RESP_CTX_set_def_policy; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_RESP_CTX_set_def_policy_allownil)} + if FuncLoadError then + AFailed.Add('TS_RESP_CTX_set_def_policy'); + {$ifend} + end; + + + TS_RESP_CTX_add_policy := LoadLibFunction(ADllHandle, TS_RESP_CTX_add_policy_procname); + FuncLoadError := not assigned(TS_RESP_CTX_add_policy); + if FuncLoadError then + begin + {$if not defined(TS_RESP_CTX_add_policy_allownil)} + TS_RESP_CTX_add_policy := @ERR_TS_RESP_CTX_add_policy; + {$ifend} + {$if declared(TS_RESP_CTX_add_policy_introduced)} + if LibVersion < TS_RESP_CTX_add_policy_introduced then + begin + {$if declared(FC_TS_RESP_CTX_add_policy)} + TS_RESP_CTX_add_policy := @FC_TS_RESP_CTX_add_policy; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_RESP_CTX_add_policy_removed)} + if TS_RESP_CTX_add_policy_removed <= LibVersion then + begin + {$if declared(_TS_RESP_CTX_add_policy)} + TS_RESP_CTX_add_policy := @_TS_RESP_CTX_add_policy; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_RESP_CTX_add_policy_allownil)} + if FuncLoadError then + AFailed.Add('TS_RESP_CTX_add_policy'); + {$ifend} + end; + + + TS_RESP_CTX_add_md := LoadLibFunction(ADllHandle, TS_RESP_CTX_add_md_procname); + FuncLoadError := not assigned(TS_RESP_CTX_add_md); + if FuncLoadError then + begin + {$if not defined(TS_RESP_CTX_add_md_allownil)} + TS_RESP_CTX_add_md := @ERR_TS_RESP_CTX_add_md; + {$ifend} + {$if declared(TS_RESP_CTX_add_md_introduced)} + if LibVersion < TS_RESP_CTX_add_md_introduced then + begin + {$if declared(FC_TS_RESP_CTX_add_md)} + TS_RESP_CTX_add_md := @FC_TS_RESP_CTX_add_md; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_RESP_CTX_add_md_removed)} + if TS_RESP_CTX_add_md_removed <= LibVersion then + begin + {$if declared(_TS_RESP_CTX_add_md)} + TS_RESP_CTX_add_md := @_TS_RESP_CTX_add_md; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_RESP_CTX_add_md_allownil)} + if FuncLoadError then + AFailed.Add('TS_RESP_CTX_add_md'); + {$ifend} + end; + + + TS_RESP_CTX_set_accuracy := LoadLibFunction(ADllHandle, TS_RESP_CTX_set_accuracy_procname); + FuncLoadError := not assigned(TS_RESP_CTX_set_accuracy); + if FuncLoadError then + begin + {$if not defined(TS_RESP_CTX_set_accuracy_allownil)} + TS_RESP_CTX_set_accuracy := @ERR_TS_RESP_CTX_set_accuracy; + {$ifend} + {$if declared(TS_RESP_CTX_set_accuracy_introduced)} + if LibVersion < TS_RESP_CTX_set_accuracy_introduced then + begin + {$if declared(FC_TS_RESP_CTX_set_accuracy)} + TS_RESP_CTX_set_accuracy := @FC_TS_RESP_CTX_set_accuracy; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_RESP_CTX_set_accuracy_removed)} + if TS_RESP_CTX_set_accuracy_removed <= LibVersion then + begin + {$if declared(_TS_RESP_CTX_set_accuracy)} + TS_RESP_CTX_set_accuracy := @_TS_RESP_CTX_set_accuracy; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_RESP_CTX_set_accuracy_allownil)} + if FuncLoadError then + AFailed.Add('TS_RESP_CTX_set_accuracy'); + {$ifend} + end; + + + TS_RESP_CTX_set_clock_precision_digits := LoadLibFunction(ADllHandle, TS_RESP_CTX_set_clock_precision_digits_procname); + FuncLoadError := not assigned(TS_RESP_CTX_set_clock_precision_digits); + if FuncLoadError then + begin + {$if not defined(TS_RESP_CTX_set_clock_precision_digits_allownil)} + TS_RESP_CTX_set_clock_precision_digits := @ERR_TS_RESP_CTX_set_clock_precision_digits; + {$ifend} + {$if declared(TS_RESP_CTX_set_clock_precision_digits_introduced)} + if LibVersion < TS_RESP_CTX_set_clock_precision_digits_introduced then + begin + {$if declared(FC_TS_RESP_CTX_set_clock_precision_digits)} + TS_RESP_CTX_set_clock_precision_digits := @FC_TS_RESP_CTX_set_clock_precision_digits; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_RESP_CTX_set_clock_precision_digits_removed)} + if TS_RESP_CTX_set_clock_precision_digits_removed <= LibVersion then + begin + {$if declared(_TS_RESP_CTX_set_clock_precision_digits)} + TS_RESP_CTX_set_clock_precision_digits := @_TS_RESP_CTX_set_clock_precision_digits; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_RESP_CTX_set_clock_precision_digits_allownil)} + if FuncLoadError then + AFailed.Add('TS_RESP_CTX_set_clock_precision_digits'); + {$ifend} + end; + + + TS_RESP_CTX_add_flags := LoadLibFunction(ADllHandle, TS_RESP_CTX_add_flags_procname); + FuncLoadError := not assigned(TS_RESP_CTX_add_flags); + if FuncLoadError then + begin + {$if not defined(TS_RESP_CTX_add_flags_allownil)} + TS_RESP_CTX_add_flags := @ERR_TS_RESP_CTX_add_flags; + {$ifend} + {$if declared(TS_RESP_CTX_add_flags_introduced)} + if LibVersion < TS_RESP_CTX_add_flags_introduced then + begin + {$if declared(FC_TS_RESP_CTX_add_flags)} + TS_RESP_CTX_add_flags := @FC_TS_RESP_CTX_add_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_RESP_CTX_add_flags_removed)} + if TS_RESP_CTX_add_flags_removed <= LibVersion then + begin + {$if declared(_TS_RESP_CTX_add_flags)} + TS_RESP_CTX_add_flags := @_TS_RESP_CTX_add_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_RESP_CTX_add_flags_allownil)} + if FuncLoadError then + AFailed.Add('TS_RESP_CTX_add_flags'); + {$ifend} + end; + + + TS_RESP_CTX_set_serial_cb := LoadLibFunction(ADllHandle, TS_RESP_CTX_set_serial_cb_procname); + FuncLoadError := not assigned(TS_RESP_CTX_set_serial_cb); + if FuncLoadError then + begin + {$if not defined(TS_RESP_CTX_set_serial_cb_allownil)} + TS_RESP_CTX_set_serial_cb := @ERR_TS_RESP_CTX_set_serial_cb; + {$ifend} + {$if declared(TS_RESP_CTX_set_serial_cb_introduced)} + if LibVersion < TS_RESP_CTX_set_serial_cb_introduced then + begin + {$if declared(FC_TS_RESP_CTX_set_serial_cb)} + TS_RESP_CTX_set_serial_cb := @FC_TS_RESP_CTX_set_serial_cb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_RESP_CTX_set_serial_cb_removed)} + if TS_RESP_CTX_set_serial_cb_removed <= LibVersion then + begin + {$if declared(_TS_RESP_CTX_set_serial_cb)} + TS_RESP_CTX_set_serial_cb := @_TS_RESP_CTX_set_serial_cb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_RESP_CTX_set_serial_cb_allownil)} + if FuncLoadError then + AFailed.Add('TS_RESP_CTX_set_serial_cb'); + {$ifend} + end; + + + TS_RESP_CTX_set_time_cb := LoadLibFunction(ADllHandle, TS_RESP_CTX_set_time_cb_procname); + FuncLoadError := not assigned(TS_RESP_CTX_set_time_cb); + if FuncLoadError then + begin + {$if not defined(TS_RESP_CTX_set_time_cb_allownil)} + TS_RESP_CTX_set_time_cb := @ERR_TS_RESP_CTX_set_time_cb; + {$ifend} + {$if declared(TS_RESP_CTX_set_time_cb_introduced)} + if LibVersion < TS_RESP_CTX_set_time_cb_introduced then + begin + {$if declared(FC_TS_RESP_CTX_set_time_cb)} + TS_RESP_CTX_set_time_cb := @FC_TS_RESP_CTX_set_time_cb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_RESP_CTX_set_time_cb_removed)} + if TS_RESP_CTX_set_time_cb_removed <= LibVersion then + begin + {$if declared(_TS_RESP_CTX_set_time_cb)} + TS_RESP_CTX_set_time_cb := @_TS_RESP_CTX_set_time_cb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_RESP_CTX_set_time_cb_allownil)} + if FuncLoadError then + AFailed.Add('TS_RESP_CTX_set_time_cb'); + {$ifend} + end; + + + TS_RESP_CTX_set_extension_cb := LoadLibFunction(ADllHandle, TS_RESP_CTX_set_extension_cb_procname); + FuncLoadError := not assigned(TS_RESP_CTX_set_extension_cb); + if FuncLoadError then + begin + {$if not defined(TS_RESP_CTX_set_extension_cb_allownil)} + TS_RESP_CTX_set_extension_cb := @ERR_TS_RESP_CTX_set_extension_cb; + {$ifend} + {$if declared(TS_RESP_CTX_set_extension_cb_introduced)} + if LibVersion < TS_RESP_CTX_set_extension_cb_introduced then + begin + {$if declared(FC_TS_RESP_CTX_set_extension_cb)} + TS_RESP_CTX_set_extension_cb := @FC_TS_RESP_CTX_set_extension_cb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_RESP_CTX_set_extension_cb_removed)} + if TS_RESP_CTX_set_extension_cb_removed <= LibVersion then + begin + {$if declared(_TS_RESP_CTX_set_extension_cb)} + TS_RESP_CTX_set_extension_cb := @_TS_RESP_CTX_set_extension_cb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_RESP_CTX_set_extension_cb_allownil)} + if FuncLoadError then + AFailed.Add('TS_RESP_CTX_set_extension_cb'); + {$ifend} + end; + + + TS_RESP_CTX_set_status_info := LoadLibFunction(ADllHandle, TS_RESP_CTX_set_status_info_procname); + FuncLoadError := not assigned(TS_RESP_CTX_set_status_info); + if FuncLoadError then + begin + {$if not defined(TS_RESP_CTX_set_status_info_allownil)} + TS_RESP_CTX_set_status_info := @ERR_TS_RESP_CTX_set_status_info; + {$ifend} + {$if declared(TS_RESP_CTX_set_status_info_introduced)} + if LibVersion < TS_RESP_CTX_set_status_info_introduced then + begin + {$if declared(FC_TS_RESP_CTX_set_status_info)} + TS_RESP_CTX_set_status_info := @FC_TS_RESP_CTX_set_status_info; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_RESP_CTX_set_status_info_removed)} + if TS_RESP_CTX_set_status_info_removed <= LibVersion then + begin + {$if declared(_TS_RESP_CTX_set_status_info)} + TS_RESP_CTX_set_status_info := @_TS_RESP_CTX_set_status_info; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_RESP_CTX_set_status_info_allownil)} + if FuncLoadError then + AFailed.Add('TS_RESP_CTX_set_status_info'); + {$ifend} + end; + + + TS_RESP_CTX_set_status_info_cond := LoadLibFunction(ADllHandle, TS_RESP_CTX_set_status_info_cond_procname); + FuncLoadError := not assigned(TS_RESP_CTX_set_status_info_cond); + if FuncLoadError then + begin + {$if not defined(TS_RESP_CTX_set_status_info_cond_allownil)} + TS_RESP_CTX_set_status_info_cond := @ERR_TS_RESP_CTX_set_status_info_cond; + {$ifend} + {$if declared(TS_RESP_CTX_set_status_info_cond_introduced)} + if LibVersion < TS_RESP_CTX_set_status_info_cond_introduced then + begin + {$if declared(FC_TS_RESP_CTX_set_status_info_cond)} + TS_RESP_CTX_set_status_info_cond := @FC_TS_RESP_CTX_set_status_info_cond; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_RESP_CTX_set_status_info_cond_removed)} + if TS_RESP_CTX_set_status_info_cond_removed <= LibVersion then + begin + {$if declared(_TS_RESP_CTX_set_status_info_cond)} + TS_RESP_CTX_set_status_info_cond := @_TS_RESP_CTX_set_status_info_cond; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_RESP_CTX_set_status_info_cond_allownil)} + if FuncLoadError then + AFailed.Add('TS_RESP_CTX_set_status_info_cond'); + {$ifend} + end; + + + TS_RESP_CTX_add_failure_info := LoadLibFunction(ADllHandle, TS_RESP_CTX_add_failure_info_procname); + FuncLoadError := not assigned(TS_RESP_CTX_add_failure_info); + if FuncLoadError then + begin + {$if not defined(TS_RESP_CTX_add_failure_info_allownil)} + TS_RESP_CTX_add_failure_info := @ERR_TS_RESP_CTX_add_failure_info; + {$ifend} + {$if declared(TS_RESP_CTX_add_failure_info_introduced)} + if LibVersion < TS_RESP_CTX_add_failure_info_introduced then + begin + {$if declared(FC_TS_RESP_CTX_add_failure_info)} + TS_RESP_CTX_add_failure_info := @FC_TS_RESP_CTX_add_failure_info; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_RESP_CTX_add_failure_info_removed)} + if TS_RESP_CTX_add_failure_info_removed <= LibVersion then + begin + {$if declared(_TS_RESP_CTX_add_failure_info)} + TS_RESP_CTX_add_failure_info := @_TS_RESP_CTX_add_failure_info; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_RESP_CTX_add_failure_info_allownil)} + if FuncLoadError then + AFailed.Add('TS_RESP_CTX_add_failure_info'); + {$ifend} + end; + + + TS_RESP_CTX_get_request := LoadLibFunction(ADllHandle, TS_RESP_CTX_get_request_procname); + FuncLoadError := not assigned(TS_RESP_CTX_get_request); + if FuncLoadError then + begin + {$if not defined(TS_RESP_CTX_get_request_allownil)} + TS_RESP_CTX_get_request := @ERR_TS_RESP_CTX_get_request; + {$ifend} + {$if declared(TS_RESP_CTX_get_request_introduced)} + if LibVersion < TS_RESP_CTX_get_request_introduced then + begin + {$if declared(FC_TS_RESP_CTX_get_request)} + TS_RESP_CTX_get_request := @FC_TS_RESP_CTX_get_request; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_RESP_CTX_get_request_removed)} + if TS_RESP_CTX_get_request_removed <= LibVersion then + begin + {$if declared(_TS_RESP_CTX_get_request)} + TS_RESP_CTX_get_request := @_TS_RESP_CTX_get_request; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_RESP_CTX_get_request_allownil)} + if FuncLoadError then + AFailed.Add('TS_RESP_CTX_get_request'); + {$ifend} + end; + + + TS_RESP_CTX_get_tst_info := LoadLibFunction(ADllHandle, TS_RESP_CTX_get_tst_info_procname); + FuncLoadError := not assigned(TS_RESP_CTX_get_tst_info); + if FuncLoadError then + begin + {$if not defined(TS_RESP_CTX_get_tst_info_allownil)} + TS_RESP_CTX_get_tst_info := @ERR_TS_RESP_CTX_get_tst_info; + {$ifend} + {$if declared(TS_RESP_CTX_get_tst_info_introduced)} + if LibVersion < TS_RESP_CTX_get_tst_info_introduced then + begin + {$if declared(FC_TS_RESP_CTX_get_tst_info)} + TS_RESP_CTX_get_tst_info := @FC_TS_RESP_CTX_get_tst_info; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_RESP_CTX_get_tst_info_removed)} + if TS_RESP_CTX_get_tst_info_removed <= LibVersion then + begin + {$if declared(_TS_RESP_CTX_get_tst_info)} + TS_RESP_CTX_get_tst_info := @_TS_RESP_CTX_get_tst_info; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_RESP_CTX_get_tst_info_allownil)} + if FuncLoadError then + AFailed.Add('TS_RESP_CTX_get_tst_info'); + {$ifend} + end; + + + TS_RESP_create_response := LoadLibFunction(ADllHandle, TS_RESP_create_response_procname); + FuncLoadError := not assigned(TS_RESP_create_response); + if FuncLoadError then + begin + {$if not defined(TS_RESP_create_response_allownil)} + TS_RESP_create_response := @ERR_TS_RESP_create_response; + {$ifend} + {$if declared(TS_RESP_create_response_introduced)} + if LibVersion < TS_RESP_create_response_introduced then + begin + {$if declared(FC_TS_RESP_create_response)} + TS_RESP_create_response := @FC_TS_RESP_create_response; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_RESP_create_response_removed)} + if TS_RESP_create_response_removed <= LibVersion then + begin + {$if declared(_TS_RESP_create_response)} + TS_RESP_create_response := @_TS_RESP_create_response; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_RESP_create_response_allownil)} + if FuncLoadError then + AFailed.Add('TS_RESP_create_response'); + {$ifend} + end; + + + TS_RESP_verify_response := LoadLibFunction(ADllHandle, TS_RESP_verify_response_procname); + FuncLoadError := not assigned(TS_RESP_verify_response); + if FuncLoadError then + begin + {$if not defined(TS_RESP_verify_response_allownil)} + TS_RESP_verify_response := @ERR_TS_RESP_verify_response; + {$ifend} + {$if declared(TS_RESP_verify_response_introduced)} + if LibVersion < TS_RESP_verify_response_introduced then + begin + {$if declared(FC_TS_RESP_verify_response)} + TS_RESP_verify_response := @FC_TS_RESP_verify_response; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_RESP_verify_response_removed)} + if TS_RESP_verify_response_removed <= LibVersion then + begin + {$if declared(_TS_RESP_verify_response)} + TS_RESP_verify_response := @_TS_RESP_verify_response; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_RESP_verify_response_allownil)} + if FuncLoadError then + AFailed.Add('TS_RESP_verify_response'); + {$ifend} + end; + + + TS_RESP_verify_token := LoadLibFunction(ADllHandle, TS_RESP_verify_token_procname); + FuncLoadError := not assigned(TS_RESP_verify_token); + if FuncLoadError then + begin + {$if not defined(TS_RESP_verify_token_allownil)} + TS_RESP_verify_token := @ERR_TS_RESP_verify_token; + {$ifend} + {$if declared(TS_RESP_verify_token_introduced)} + if LibVersion < TS_RESP_verify_token_introduced then + begin + {$if declared(FC_TS_RESP_verify_token)} + TS_RESP_verify_token := @FC_TS_RESP_verify_token; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_RESP_verify_token_removed)} + if TS_RESP_verify_token_removed <= LibVersion then + begin + {$if declared(_TS_RESP_verify_token)} + TS_RESP_verify_token := @_TS_RESP_verify_token; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_RESP_verify_token_allownil)} + if FuncLoadError then + AFailed.Add('TS_RESP_verify_token'); + {$ifend} + end; + + + TS_VERIFY_CTX_new := LoadLibFunction(ADllHandle, TS_VERIFY_CTX_new_procname); + FuncLoadError := not assigned(TS_VERIFY_CTX_new); + if FuncLoadError then + begin + {$if not defined(TS_VERIFY_CTX_new_allownil)} + TS_VERIFY_CTX_new := @ERR_TS_VERIFY_CTX_new; + {$ifend} + {$if declared(TS_VERIFY_CTX_new_introduced)} + if LibVersion < TS_VERIFY_CTX_new_introduced then + begin + {$if declared(FC_TS_VERIFY_CTX_new)} + TS_VERIFY_CTX_new := @FC_TS_VERIFY_CTX_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_VERIFY_CTX_new_removed)} + if TS_VERIFY_CTX_new_removed <= LibVersion then + begin + {$if declared(_TS_VERIFY_CTX_new)} + TS_VERIFY_CTX_new := @_TS_VERIFY_CTX_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_VERIFY_CTX_new_allownil)} + if FuncLoadError then + AFailed.Add('TS_VERIFY_CTX_new'); + {$ifend} + end; + + + TS_VERIFY_CTX_init := LoadLibFunction(ADllHandle, TS_VERIFY_CTX_init_procname); + FuncLoadError := not assigned(TS_VERIFY_CTX_init); + if FuncLoadError then + begin + {$if not defined(TS_VERIFY_CTX_init_allownil)} + TS_VERIFY_CTX_init := @ERR_TS_VERIFY_CTX_init; + {$ifend} + {$if declared(TS_VERIFY_CTX_init_introduced)} + if LibVersion < TS_VERIFY_CTX_init_introduced then + begin + {$if declared(FC_TS_VERIFY_CTX_init)} + TS_VERIFY_CTX_init := @FC_TS_VERIFY_CTX_init; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_VERIFY_CTX_init_removed)} + if TS_VERIFY_CTX_init_removed <= LibVersion then + begin + {$if declared(_TS_VERIFY_CTX_init)} + TS_VERIFY_CTX_init := @_TS_VERIFY_CTX_init; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_VERIFY_CTX_init_allownil)} + if FuncLoadError then + AFailed.Add('TS_VERIFY_CTX_init'); + {$ifend} + end; + + + TS_VERIFY_CTX_free := LoadLibFunction(ADllHandle, TS_VERIFY_CTX_free_procname); + FuncLoadError := not assigned(TS_VERIFY_CTX_free); + if FuncLoadError then + begin + {$if not defined(TS_VERIFY_CTX_free_allownil)} + TS_VERIFY_CTX_free := @ERR_TS_VERIFY_CTX_free; + {$ifend} + {$if declared(TS_VERIFY_CTX_free_introduced)} + if LibVersion < TS_VERIFY_CTX_free_introduced then + begin + {$if declared(FC_TS_VERIFY_CTX_free)} + TS_VERIFY_CTX_free := @FC_TS_VERIFY_CTX_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_VERIFY_CTX_free_removed)} + if TS_VERIFY_CTX_free_removed <= LibVersion then + begin + {$if declared(_TS_VERIFY_CTX_free)} + TS_VERIFY_CTX_free := @_TS_VERIFY_CTX_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_VERIFY_CTX_free_allownil)} + if FuncLoadError then + AFailed.Add('TS_VERIFY_CTX_free'); + {$ifend} + end; + + + TS_VERIFY_CTX_cleanup := LoadLibFunction(ADllHandle, TS_VERIFY_CTX_cleanup_procname); + FuncLoadError := not assigned(TS_VERIFY_CTX_cleanup); + if FuncLoadError then + begin + {$if not defined(TS_VERIFY_CTX_cleanup_allownil)} + TS_VERIFY_CTX_cleanup := @ERR_TS_VERIFY_CTX_cleanup; + {$ifend} + {$if declared(TS_VERIFY_CTX_cleanup_introduced)} + if LibVersion < TS_VERIFY_CTX_cleanup_introduced then + begin + {$if declared(FC_TS_VERIFY_CTX_cleanup)} + TS_VERIFY_CTX_cleanup := @FC_TS_VERIFY_CTX_cleanup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_VERIFY_CTX_cleanup_removed)} + if TS_VERIFY_CTX_cleanup_removed <= LibVersion then + begin + {$if declared(_TS_VERIFY_CTX_cleanup)} + TS_VERIFY_CTX_cleanup := @_TS_VERIFY_CTX_cleanup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_VERIFY_CTX_cleanup_allownil)} + if FuncLoadError then + AFailed.Add('TS_VERIFY_CTX_cleanup'); + {$ifend} + end; + + + TS_VERIFY_CTX_set_flags := LoadLibFunction(ADllHandle, TS_VERIFY_CTX_set_flags_procname); + FuncLoadError := not assigned(TS_VERIFY_CTX_set_flags); + if FuncLoadError then + begin + {$if not defined(TS_VERIFY_CTX_set_flags_allownil)} + TS_VERIFY_CTX_set_flags := @ERR_TS_VERIFY_CTX_set_flags; + {$ifend} + {$if declared(TS_VERIFY_CTX_set_flags_introduced)} + if LibVersion < TS_VERIFY_CTX_set_flags_introduced then + begin + {$if declared(FC_TS_VERIFY_CTX_set_flags)} + TS_VERIFY_CTX_set_flags := @FC_TS_VERIFY_CTX_set_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_VERIFY_CTX_set_flags_removed)} + if TS_VERIFY_CTX_set_flags_removed <= LibVersion then + begin + {$if declared(_TS_VERIFY_CTX_set_flags)} + TS_VERIFY_CTX_set_flags := @_TS_VERIFY_CTX_set_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_VERIFY_CTX_set_flags_allownil)} + if FuncLoadError then + AFailed.Add('TS_VERIFY_CTX_set_flags'); + {$ifend} + end; + + + TS_VERIFY_CTX_add_flags := LoadLibFunction(ADllHandle, TS_VERIFY_CTX_add_flags_procname); + FuncLoadError := not assigned(TS_VERIFY_CTX_add_flags); + if FuncLoadError then + begin + {$if not defined(TS_VERIFY_CTX_add_flags_allownil)} + TS_VERIFY_CTX_add_flags := @ERR_TS_VERIFY_CTX_add_flags; + {$ifend} + {$if declared(TS_VERIFY_CTX_add_flags_introduced)} + if LibVersion < TS_VERIFY_CTX_add_flags_introduced then + begin + {$if declared(FC_TS_VERIFY_CTX_add_flags)} + TS_VERIFY_CTX_add_flags := @FC_TS_VERIFY_CTX_add_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_VERIFY_CTX_add_flags_removed)} + if TS_VERIFY_CTX_add_flags_removed <= LibVersion then + begin + {$if declared(_TS_VERIFY_CTX_add_flags)} + TS_VERIFY_CTX_add_flags := @_TS_VERIFY_CTX_add_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_VERIFY_CTX_add_flags_allownil)} + if FuncLoadError then + AFailed.Add('TS_VERIFY_CTX_add_flags'); + {$ifend} + end; + + + TS_VERIFY_CTX_set_data := LoadLibFunction(ADllHandle, TS_VERIFY_CTX_set_data_procname); + FuncLoadError := not assigned(TS_VERIFY_CTX_set_data); + if FuncLoadError then + begin + {$if not defined(TS_VERIFY_CTX_set_data_allownil)} + TS_VERIFY_CTX_set_data := @ERR_TS_VERIFY_CTX_set_data; + {$ifend} + {$if declared(TS_VERIFY_CTX_set_data_introduced)} + if LibVersion < TS_VERIFY_CTX_set_data_introduced then + begin + {$if declared(FC_TS_VERIFY_CTX_set_data)} + TS_VERIFY_CTX_set_data := @FC_TS_VERIFY_CTX_set_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_VERIFY_CTX_set_data_removed)} + if TS_VERIFY_CTX_set_data_removed <= LibVersion then + begin + {$if declared(_TS_VERIFY_CTX_set_data)} + TS_VERIFY_CTX_set_data := @_TS_VERIFY_CTX_set_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_VERIFY_CTX_set_data_allownil)} + if FuncLoadError then + AFailed.Add('TS_VERIFY_CTX_set_data'); + {$ifend} + end; + + + TS_VERIFY_CTX_set_imprint := LoadLibFunction(ADllHandle, TS_VERIFY_CTX_set_imprint_procname); + FuncLoadError := not assigned(TS_VERIFY_CTX_set_imprint); + if FuncLoadError then + begin + {$if not defined(TS_VERIFY_CTX_set_imprint_allownil)} + TS_VERIFY_CTX_set_imprint := @ERR_TS_VERIFY_CTX_set_imprint; + {$ifend} + {$if declared(TS_VERIFY_CTX_set_imprint_introduced)} + if LibVersion < TS_VERIFY_CTX_set_imprint_introduced then + begin + {$if declared(FC_TS_VERIFY_CTX_set_imprint)} + TS_VERIFY_CTX_set_imprint := @FC_TS_VERIFY_CTX_set_imprint; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_VERIFY_CTX_set_imprint_removed)} + if TS_VERIFY_CTX_set_imprint_removed <= LibVersion then + begin + {$if declared(_TS_VERIFY_CTX_set_imprint)} + TS_VERIFY_CTX_set_imprint := @_TS_VERIFY_CTX_set_imprint; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_VERIFY_CTX_set_imprint_allownil)} + if FuncLoadError then + AFailed.Add('TS_VERIFY_CTX_set_imprint'); + {$ifend} + end; + + + TS_VERIFY_CTX_set_store := LoadLibFunction(ADllHandle, TS_VERIFY_CTX_set_store_procname); + FuncLoadError := not assigned(TS_VERIFY_CTX_set_store); + if FuncLoadError then + begin + {$if not defined(TS_VERIFY_CTX_set_store_allownil)} + TS_VERIFY_CTX_set_store := @ERR_TS_VERIFY_CTX_set_store; + {$ifend} + {$if declared(TS_VERIFY_CTX_set_store_introduced)} + if LibVersion < TS_VERIFY_CTX_set_store_introduced then + begin + {$if declared(FC_TS_VERIFY_CTX_set_store)} + TS_VERIFY_CTX_set_store := @FC_TS_VERIFY_CTX_set_store; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_VERIFY_CTX_set_store_removed)} + if TS_VERIFY_CTX_set_store_removed <= LibVersion then + begin + {$if declared(_TS_VERIFY_CTX_set_store)} + TS_VERIFY_CTX_set_store := @_TS_VERIFY_CTX_set_store; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_VERIFY_CTX_set_store_allownil)} + if FuncLoadError then + AFailed.Add('TS_VERIFY_CTX_set_store'); + {$ifend} + end; + + + TS_REQ_to_TS_VERIFY_CTX := LoadLibFunction(ADllHandle, TS_REQ_to_TS_VERIFY_CTX_procname); + FuncLoadError := not assigned(TS_REQ_to_TS_VERIFY_CTX); + if FuncLoadError then + begin + {$if not defined(TS_REQ_to_TS_VERIFY_CTX_allownil)} + TS_REQ_to_TS_VERIFY_CTX := @ERR_TS_REQ_to_TS_VERIFY_CTX; + {$ifend} + {$if declared(TS_REQ_to_TS_VERIFY_CTX_introduced)} + if LibVersion < TS_REQ_to_TS_VERIFY_CTX_introduced then + begin + {$if declared(FC_TS_REQ_to_TS_VERIFY_CTX)} + TS_REQ_to_TS_VERIFY_CTX := @FC_TS_REQ_to_TS_VERIFY_CTX; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_REQ_to_TS_VERIFY_CTX_removed)} + if TS_REQ_to_TS_VERIFY_CTX_removed <= LibVersion then + begin + {$if declared(_TS_REQ_to_TS_VERIFY_CTX)} + TS_REQ_to_TS_VERIFY_CTX := @_TS_REQ_to_TS_VERIFY_CTX; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_REQ_to_TS_VERIFY_CTX_allownil)} + if FuncLoadError then + AFailed.Add('TS_REQ_to_TS_VERIFY_CTX'); + {$ifend} + end; + + + TS_RESP_print_bio := LoadLibFunction(ADllHandle, TS_RESP_print_bio_procname); + FuncLoadError := not assigned(TS_RESP_print_bio); + if FuncLoadError then + begin + {$if not defined(TS_RESP_print_bio_allownil)} + TS_RESP_print_bio := @ERR_TS_RESP_print_bio; + {$ifend} + {$if declared(TS_RESP_print_bio_introduced)} + if LibVersion < TS_RESP_print_bio_introduced then + begin + {$if declared(FC_TS_RESP_print_bio)} + TS_RESP_print_bio := @FC_TS_RESP_print_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_RESP_print_bio_removed)} + if TS_RESP_print_bio_removed <= LibVersion then + begin + {$if declared(_TS_RESP_print_bio)} + TS_RESP_print_bio := @_TS_RESP_print_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_RESP_print_bio_allownil)} + if FuncLoadError then + AFailed.Add('TS_RESP_print_bio'); + {$ifend} + end; + + + TS_STATUS_INFO_print_bio := LoadLibFunction(ADllHandle, TS_STATUS_INFO_print_bio_procname); + FuncLoadError := not assigned(TS_STATUS_INFO_print_bio); + if FuncLoadError then + begin + {$if not defined(TS_STATUS_INFO_print_bio_allownil)} + TS_STATUS_INFO_print_bio := @ERR_TS_STATUS_INFO_print_bio; + {$ifend} + {$if declared(TS_STATUS_INFO_print_bio_introduced)} + if LibVersion < TS_STATUS_INFO_print_bio_introduced then + begin + {$if declared(FC_TS_STATUS_INFO_print_bio)} + TS_STATUS_INFO_print_bio := @FC_TS_STATUS_INFO_print_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_STATUS_INFO_print_bio_removed)} + if TS_STATUS_INFO_print_bio_removed <= LibVersion then + begin + {$if declared(_TS_STATUS_INFO_print_bio)} + TS_STATUS_INFO_print_bio := @_TS_STATUS_INFO_print_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_STATUS_INFO_print_bio_allownil)} + if FuncLoadError then + AFailed.Add('TS_STATUS_INFO_print_bio'); + {$ifend} + end; + + + TS_TST_INFO_print_bio := LoadLibFunction(ADllHandle, TS_TST_INFO_print_bio_procname); + FuncLoadError := not assigned(TS_TST_INFO_print_bio); + if FuncLoadError then + begin + {$if not defined(TS_TST_INFO_print_bio_allownil)} + TS_TST_INFO_print_bio := @ERR_TS_TST_INFO_print_bio; + {$ifend} + {$if declared(TS_TST_INFO_print_bio_introduced)} + if LibVersion < TS_TST_INFO_print_bio_introduced then + begin + {$if declared(FC_TS_TST_INFO_print_bio)} + TS_TST_INFO_print_bio := @FC_TS_TST_INFO_print_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_TST_INFO_print_bio_removed)} + if TS_TST_INFO_print_bio_removed <= LibVersion then + begin + {$if declared(_TS_TST_INFO_print_bio)} + TS_TST_INFO_print_bio := @_TS_TST_INFO_print_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_TST_INFO_print_bio_allownil)} + if FuncLoadError then + AFailed.Add('TS_TST_INFO_print_bio'); + {$ifend} + end; + + + TS_ASN1_INTEGER_print_bio := LoadLibFunction(ADllHandle, TS_ASN1_INTEGER_print_bio_procname); + FuncLoadError := not assigned(TS_ASN1_INTEGER_print_bio); + if FuncLoadError then + begin + {$if not defined(TS_ASN1_INTEGER_print_bio_allownil)} + TS_ASN1_INTEGER_print_bio := @ERR_TS_ASN1_INTEGER_print_bio; + {$ifend} + {$if declared(TS_ASN1_INTEGER_print_bio_introduced)} + if LibVersion < TS_ASN1_INTEGER_print_bio_introduced then + begin + {$if declared(FC_TS_ASN1_INTEGER_print_bio)} + TS_ASN1_INTEGER_print_bio := @FC_TS_ASN1_INTEGER_print_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_ASN1_INTEGER_print_bio_removed)} + if TS_ASN1_INTEGER_print_bio_removed <= LibVersion then + begin + {$if declared(_TS_ASN1_INTEGER_print_bio)} + TS_ASN1_INTEGER_print_bio := @_TS_ASN1_INTEGER_print_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_ASN1_INTEGER_print_bio_allownil)} + if FuncLoadError then + AFailed.Add('TS_ASN1_INTEGER_print_bio'); + {$ifend} + end; + + + TS_OBJ_print_bio := LoadLibFunction(ADllHandle, TS_OBJ_print_bio_procname); + FuncLoadError := not assigned(TS_OBJ_print_bio); + if FuncLoadError then + begin + {$if not defined(TS_OBJ_print_bio_allownil)} + TS_OBJ_print_bio := @ERR_TS_OBJ_print_bio; + {$ifend} + {$if declared(TS_OBJ_print_bio_introduced)} + if LibVersion < TS_OBJ_print_bio_introduced then + begin + {$if declared(FC_TS_OBJ_print_bio)} + TS_OBJ_print_bio := @FC_TS_OBJ_print_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_OBJ_print_bio_removed)} + if TS_OBJ_print_bio_removed <= LibVersion then + begin + {$if declared(_TS_OBJ_print_bio)} + TS_OBJ_print_bio := @_TS_OBJ_print_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_OBJ_print_bio_allownil)} + if FuncLoadError then + AFailed.Add('TS_OBJ_print_bio'); + {$ifend} + end; + + + TS_X509_ALGOR_print_bio := LoadLibFunction(ADllHandle, TS_X509_ALGOR_print_bio_procname); + FuncLoadError := not assigned(TS_X509_ALGOR_print_bio); + if FuncLoadError then + begin + {$if not defined(TS_X509_ALGOR_print_bio_allownil)} + TS_X509_ALGOR_print_bio := @ERR_TS_X509_ALGOR_print_bio; + {$ifend} + {$if declared(TS_X509_ALGOR_print_bio_introduced)} + if LibVersion < TS_X509_ALGOR_print_bio_introduced then + begin + {$if declared(FC_TS_X509_ALGOR_print_bio)} + TS_X509_ALGOR_print_bio := @FC_TS_X509_ALGOR_print_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_X509_ALGOR_print_bio_removed)} + if TS_X509_ALGOR_print_bio_removed <= LibVersion then + begin + {$if declared(_TS_X509_ALGOR_print_bio)} + TS_X509_ALGOR_print_bio := @_TS_X509_ALGOR_print_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_X509_ALGOR_print_bio_allownil)} + if FuncLoadError then + AFailed.Add('TS_X509_ALGOR_print_bio'); + {$ifend} + end; + + + TS_MSG_IMPRINT_print_bio := LoadLibFunction(ADllHandle, TS_MSG_IMPRINT_print_bio_procname); + FuncLoadError := not assigned(TS_MSG_IMPRINT_print_bio); + if FuncLoadError then + begin + {$if not defined(TS_MSG_IMPRINT_print_bio_allownil)} + TS_MSG_IMPRINT_print_bio := @ERR_TS_MSG_IMPRINT_print_bio; + {$ifend} + {$if declared(TS_MSG_IMPRINT_print_bio_introduced)} + if LibVersion < TS_MSG_IMPRINT_print_bio_introduced then + begin + {$if declared(FC_TS_MSG_IMPRINT_print_bio)} + TS_MSG_IMPRINT_print_bio := @FC_TS_MSG_IMPRINT_print_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_MSG_IMPRINT_print_bio_removed)} + if TS_MSG_IMPRINT_print_bio_removed <= LibVersion then + begin + {$if declared(_TS_MSG_IMPRINT_print_bio)} + TS_MSG_IMPRINT_print_bio := @_TS_MSG_IMPRINT_print_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_MSG_IMPRINT_print_bio_allownil)} + if FuncLoadError then + AFailed.Add('TS_MSG_IMPRINT_print_bio'); + {$ifend} + end; + + + TS_CONF_load_cert := LoadLibFunction(ADllHandle, TS_CONF_load_cert_procname); + FuncLoadError := not assigned(TS_CONF_load_cert); + if FuncLoadError then + begin + {$if not defined(TS_CONF_load_cert_allownil)} + TS_CONF_load_cert := @ERR_TS_CONF_load_cert; + {$ifend} + {$if declared(TS_CONF_load_cert_introduced)} + if LibVersion < TS_CONF_load_cert_introduced then + begin + {$if declared(FC_TS_CONF_load_cert)} + TS_CONF_load_cert := @FC_TS_CONF_load_cert; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_CONF_load_cert_removed)} + if TS_CONF_load_cert_removed <= LibVersion then + begin + {$if declared(_TS_CONF_load_cert)} + TS_CONF_load_cert := @_TS_CONF_load_cert; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_CONF_load_cert_allownil)} + if FuncLoadError then + AFailed.Add('TS_CONF_load_cert'); + {$ifend} + end; + + + TS_CONF_load_key := LoadLibFunction(ADllHandle, TS_CONF_load_key_procname); + FuncLoadError := not assigned(TS_CONF_load_key); + if FuncLoadError then + begin + {$if not defined(TS_CONF_load_key_allownil)} + TS_CONF_load_key := @ERR_TS_CONF_load_key; + {$ifend} + {$if declared(TS_CONF_load_key_introduced)} + if LibVersion < TS_CONF_load_key_introduced then + begin + {$if declared(FC_TS_CONF_load_key)} + TS_CONF_load_key := @FC_TS_CONF_load_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_CONF_load_key_removed)} + if TS_CONF_load_key_removed <= LibVersion then + begin + {$if declared(_TS_CONF_load_key)} + TS_CONF_load_key := @_TS_CONF_load_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_CONF_load_key_allownil)} + if FuncLoadError then + AFailed.Add('TS_CONF_load_key'); + {$ifend} + end; + + + TS_CONF_set_serial := LoadLibFunction(ADllHandle, TS_CONF_set_serial_procname); + FuncLoadError := not assigned(TS_CONF_set_serial); + if FuncLoadError then + begin + {$if not defined(TS_CONF_set_serial_allownil)} + TS_CONF_set_serial := @ERR_TS_CONF_set_serial; + {$ifend} + {$if declared(TS_CONF_set_serial_introduced)} + if LibVersion < TS_CONF_set_serial_introduced then + begin + {$if declared(FC_TS_CONF_set_serial)} + TS_CONF_set_serial := @FC_TS_CONF_set_serial; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_CONF_set_serial_removed)} + if TS_CONF_set_serial_removed <= LibVersion then + begin + {$if declared(_TS_CONF_set_serial)} + TS_CONF_set_serial := @_TS_CONF_set_serial; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_CONF_set_serial_allownil)} + if FuncLoadError then + AFailed.Add('TS_CONF_set_serial'); + {$ifend} + end; + + + TS_CONF_get_tsa_section := LoadLibFunction(ADllHandle, TS_CONF_get_tsa_section_procname); + FuncLoadError := not assigned(TS_CONF_get_tsa_section); + if FuncLoadError then + begin + {$if not defined(TS_CONF_get_tsa_section_allownil)} + TS_CONF_get_tsa_section := @ERR_TS_CONF_get_tsa_section; + {$ifend} + {$if declared(TS_CONF_get_tsa_section_introduced)} + if LibVersion < TS_CONF_get_tsa_section_introduced then + begin + {$if declared(FC_TS_CONF_get_tsa_section)} + TS_CONF_get_tsa_section := @FC_TS_CONF_get_tsa_section; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_CONF_get_tsa_section_removed)} + if TS_CONF_get_tsa_section_removed <= LibVersion then + begin + {$if declared(_TS_CONF_get_tsa_section)} + TS_CONF_get_tsa_section := @_TS_CONF_get_tsa_section; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_CONF_get_tsa_section_allownil)} + if FuncLoadError then + AFailed.Add('TS_CONF_get_tsa_section'); + {$ifend} + end; + + + TS_CONF_set_crypto_device := LoadLibFunction(ADllHandle, TS_CONF_set_crypto_device_procname); + FuncLoadError := not assigned(TS_CONF_set_crypto_device); + if FuncLoadError then + begin + {$if not defined(TS_CONF_set_crypto_device_allownil)} + TS_CONF_set_crypto_device := @ERR_TS_CONF_set_crypto_device; + {$ifend} + {$if declared(TS_CONF_set_crypto_device_introduced)} + if LibVersion < TS_CONF_set_crypto_device_introduced then + begin + {$if declared(FC_TS_CONF_set_crypto_device)} + TS_CONF_set_crypto_device := @FC_TS_CONF_set_crypto_device; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_CONF_set_crypto_device_removed)} + if TS_CONF_set_crypto_device_removed <= LibVersion then + begin + {$if declared(_TS_CONF_set_crypto_device)} + TS_CONF_set_crypto_device := @_TS_CONF_set_crypto_device; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_CONF_set_crypto_device_allownil)} + if FuncLoadError then + AFailed.Add('TS_CONF_set_crypto_device'); + {$ifend} + end; + + + TS_CONF_set_default_engine := LoadLibFunction(ADllHandle, TS_CONF_set_default_engine_procname); + FuncLoadError := not assigned(TS_CONF_set_default_engine); + if FuncLoadError then + begin + {$if not defined(TS_CONF_set_default_engine_allownil)} + TS_CONF_set_default_engine := @ERR_TS_CONF_set_default_engine; + {$ifend} + {$if declared(TS_CONF_set_default_engine_introduced)} + if LibVersion < TS_CONF_set_default_engine_introduced then + begin + {$if declared(FC_TS_CONF_set_default_engine)} + TS_CONF_set_default_engine := @FC_TS_CONF_set_default_engine; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_CONF_set_default_engine_removed)} + if TS_CONF_set_default_engine_removed <= LibVersion then + begin + {$if declared(_TS_CONF_set_default_engine)} + TS_CONF_set_default_engine := @_TS_CONF_set_default_engine; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_CONF_set_default_engine_allownil)} + if FuncLoadError then + AFailed.Add('TS_CONF_set_default_engine'); + {$ifend} + end; + + + TS_CONF_set_signer_cert := LoadLibFunction(ADllHandle, TS_CONF_set_signer_cert_procname); + FuncLoadError := not assigned(TS_CONF_set_signer_cert); + if FuncLoadError then + begin + {$if not defined(TS_CONF_set_signer_cert_allownil)} + TS_CONF_set_signer_cert := @ERR_TS_CONF_set_signer_cert; + {$ifend} + {$if declared(TS_CONF_set_signer_cert_introduced)} + if LibVersion < TS_CONF_set_signer_cert_introduced then + begin + {$if declared(FC_TS_CONF_set_signer_cert)} + TS_CONF_set_signer_cert := @FC_TS_CONF_set_signer_cert; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_CONF_set_signer_cert_removed)} + if TS_CONF_set_signer_cert_removed <= LibVersion then + begin + {$if declared(_TS_CONF_set_signer_cert)} + TS_CONF_set_signer_cert := @_TS_CONF_set_signer_cert; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_CONF_set_signer_cert_allownil)} + if FuncLoadError then + AFailed.Add('TS_CONF_set_signer_cert'); + {$ifend} + end; + + + TS_CONF_set_certs := LoadLibFunction(ADllHandle, TS_CONF_set_certs_procname); + FuncLoadError := not assigned(TS_CONF_set_certs); + if FuncLoadError then + begin + {$if not defined(TS_CONF_set_certs_allownil)} + TS_CONF_set_certs := @ERR_TS_CONF_set_certs; + {$ifend} + {$if declared(TS_CONF_set_certs_introduced)} + if LibVersion < TS_CONF_set_certs_introduced then + begin + {$if declared(FC_TS_CONF_set_certs)} + TS_CONF_set_certs := @FC_TS_CONF_set_certs; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_CONF_set_certs_removed)} + if TS_CONF_set_certs_removed <= LibVersion then + begin + {$if declared(_TS_CONF_set_certs)} + TS_CONF_set_certs := @_TS_CONF_set_certs; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_CONF_set_certs_allownil)} + if FuncLoadError then + AFailed.Add('TS_CONF_set_certs'); + {$ifend} + end; + + + TS_CONF_set_signer_key := LoadLibFunction(ADllHandle, TS_CONF_set_signer_key_procname); + FuncLoadError := not assigned(TS_CONF_set_signer_key); + if FuncLoadError then + begin + {$if not defined(TS_CONF_set_signer_key_allownil)} + TS_CONF_set_signer_key := @ERR_TS_CONF_set_signer_key; + {$ifend} + {$if declared(TS_CONF_set_signer_key_introduced)} + if LibVersion < TS_CONF_set_signer_key_introduced then + begin + {$if declared(FC_TS_CONF_set_signer_key)} + TS_CONF_set_signer_key := @FC_TS_CONF_set_signer_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_CONF_set_signer_key_removed)} + if TS_CONF_set_signer_key_removed <= LibVersion then + begin + {$if declared(_TS_CONF_set_signer_key)} + TS_CONF_set_signer_key := @_TS_CONF_set_signer_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_CONF_set_signer_key_allownil)} + if FuncLoadError then + AFailed.Add('TS_CONF_set_signer_key'); + {$ifend} + end; + + + TS_CONF_set_signer_digest := LoadLibFunction(ADllHandle, TS_CONF_set_signer_digest_procname); + FuncLoadError := not assigned(TS_CONF_set_signer_digest); + if FuncLoadError then + begin + {$if not defined(TS_CONF_set_signer_digest_allownil)} + TS_CONF_set_signer_digest := @ERR_TS_CONF_set_signer_digest; + {$ifend} + {$if declared(TS_CONF_set_signer_digest_introduced)} + if LibVersion < TS_CONF_set_signer_digest_introduced then + begin + {$if declared(FC_TS_CONF_set_signer_digest)} + TS_CONF_set_signer_digest := @FC_TS_CONF_set_signer_digest; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_CONF_set_signer_digest_removed)} + if TS_CONF_set_signer_digest_removed <= LibVersion then + begin + {$if declared(_TS_CONF_set_signer_digest)} + TS_CONF_set_signer_digest := @_TS_CONF_set_signer_digest; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_CONF_set_signer_digest_allownil)} + if FuncLoadError then + AFailed.Add('TS_CONF_set_signer_digest'); + {$ifend} + end; + + + TS_CONF_set_def_policy := LoadLibFunction(ADllHandle, TS_CONF_set_def_policy_procname); + FuncLoadError := not assigned(TS_CONF_set_def_policy); + if FuncLoadError then + begin + {$if not defined(TS_CONF_set_def_policy_allownil)} + TS_CONF_set_def_policy := @ERR_TS_CONF_set_def_policy; + {$ifend} + {$if declared(TS_CONF_set_def_policy_introduced)} + if LibVersion < TS_CONF_set_def_policy_introduced then + begin + {$if declared(FC_TS_CONF_set_def_policy)} + TS_CONF_set_def_policy := @FC_TS_CONF_set_def_policy; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_CONF_set_def_policy_removed)} + if TS_CONF_set_def_policy_removed <= LibVersion then + begin + {$if declared(_TS_CONF_set_def_policy)} + TS_CONF_set_def_policy := @_TS_CONF_set_def_policy; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_CONF_set_def_policy_allownil)} + if FuncLoadError then + AFailed.Add('TS_CONF_set_def_policy'); + {$ifend} + end; + + + TS_CONF_set_policies := LoadLibFunction(ADllHandle, TS_CONF_set_policies_procname); + FuncLoadError := not assigned(TS_CONF_set_policies); + if FuncLoadError then + begin + {$if not defined(TS_CONF_set_policies_allownil)} + TS_CONF_set_policies := @ERR_TS_CONF_set_policies; + {$ifend} + {$if declared(TS_CONF_set_policies_introduced)} + if LibVersion < TS_CONF_set_policies_introduced then + begin + {$if declared(FC_TS_CONF_set_policies)} + TS_CONF_set_policies := @FC_TS_CONF_set_policies; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_CONF_set_policies_removed)} + if TS_CONF_set_policies_removed <= LibVersion then + begin + {$if declared(_TS_CONF_set_policies)} + TS_CONF_set_policies := @_TS_CONF_set_policies; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_CONF_set_policies_allownil)} + if FuncLoadError then + AFailed.Add('TS_CONF_set_policies'); + {$ifend} + end; + + + TS_CONF_set_digests := LoadLibFunction(ADllHandle, TS_CONF_set_digests_procname); + FuncLoadError := not assigned(TS_CONF_set_digests); + if FuncLoadError then + begin + {$if not defined(TS_CONF_set_digests_allownil)} + TS_CONF_set_digests := @ERR_TS_CONF_set_digests; + {$ifend} + {$if declared(TS_CONF_set_digests_introduced)} + if LibVersion < TS_CONF_set_digests_introduced then + begin + {$if declared(FC_TS_CONF_set_digests)} + TS_CONF_set_digests := @FC_TS_CONF_set_digests; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_CONF_set_digests_removed)} + if TS_CONF_set_digests_removed <= LibVersion then + begin + {$if declared(_TS_CONF_set_digests)} + TS_CONF_set_digests := @_TS_CONF_set_digests; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_CONF_set_digests_allownil)} + if FuncLoadError then + AFailed.Add('TS_CONF_set_digests'); + {$ifend} + end; + + + TS_CONF_set_accuracy := LoadLibFunction(ADllHandle, TS_CONF_set_accuracy_procname); + FuncLoadError := not assigned(TS_CONF_set_accuracy); + if FuncLoadError then + begin + {$if not defined(TS_CONF_set_accuracy_allownil)} + TS_CONF_set_accuracy := @ERR_TS_CONF_set_accuracy; + {$ifend} + {$if declared(TS_CONF_set_accuracy_introduced)} + if LibVersion < TS_CONF_set_accuracy_introduced then + begin + {$if declared(FC_TS_CONF_set_accuracy)} + TS_CONF_set_accuracy := @FC_TS_CONF_set_accuracy; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_CONF_set_accuracy_removed)} + if TS_CONF_set_accuracy_removed <= LibVersion then + begin + {$if declared(_TS_CONF_set_accuracy)} + TS_CONF_set_accuracy := @_TS_CONF_set_accuracy; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_CONF_set_accuracy_allownil)} + if FuncLoadError then + AFailed.Add('TS_CONF_set_accuracy'); + {$ifend} + end; + + + TS_CONF_set_clock_precision_digits := LoadLibFunction(ADllHandle, TS_CONF_set_clock_precision_digits_procname); + FuncLoadError := not assigned(TS_CONF_set_clock_precision_digits); + if FuncLoadError then + begin + {$if not defined(TS_CONF_set_clock_precision_digits_allownil)} + TS_CONF_set_clock_precision_digits := @ERR_TS_CONF_set_clock_precision_digits; + {$ifend} + {$if declared(TS_CONF_set_clock_precision_digits_introduced)} + if LibVersion < TS_CONF_set_clock_precision_digits_introduced then + begin + {$if declared(FC_TS_CONF_set_clock_precision_digits)} + TS_CONF_set_clock_precision_digits := @FC_TS_CONF_set_clock_precision_digits; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_CONF_set_clock_precision_digits_removed)} + if TS_CONF_set_clock_precision_digits_removed <= LibVersion then + begin + {$if declared(_TS_CONF_set_clock_precision_digits)} + TS_CONF_set_clock_precision_digits := @_TS_CONF_set_clock_precision_digits; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_CONF_set_clock_precision_digits_allownil)} + if FuncLoadError then + AFailed.Add('TS_CONF_set_clock_precision_digits'); + {$ifend} + end; + + + TS_CONF_set_ordering := LoadLibFunction(ADllHandle, TS_CONF_set_ordering_procname); + FuncLoadError := not assigned(TS_CONF_set_ordering); + if FuncLoadError then + begin + {$if not defined(TS_CONF_set_ordering_allownil)} + TS_CONF_set_ordering := @ERR_TS_CONF_set_ordering; + {$ifend} + {$if declared(TS_CONF_set_ordering_introduced)} + if LibVersion < TS_CONF_set_ordering_introduced then + begin + {$if declared(FC_TS_CONF_set_ordering)} + TS_CONF_set_ordering := @FC_TS_CONF_set_ordering; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_CONF_set_ordering_removed)} + if TS_CONF_set_ordering_removed <= LibVersion then + begin + {$if declared(_TS_CONF_set_ordering)} + TS_CONF_set_ordering := @_TS_CONF_set_ordering; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_CONF_set_ordering_allownil)} + if FuncLoadError then + AFailed.Add('TS_CONF_set_ordering'); + {$ifend} + end; + + + TS_CONF_set_tsa_name := LoadLibFunction(ADllHandle, TS_CONF_set_tsa_name_procname); + FuncLoadError := not assigned(TS_CONF_set_tsa_name); + if FuncLoadError then + begin + {$if not defined(TS_CONF_set_tsa_name_allownil)} + TS_CONF_set_tsa_name := @ERR_TS_CONF_set_tsa_name; + {$ifend} + {$if declared(TS_CONF_set_tsa_name_introduced)} + if LibVersion < TS_CONF_set_tsa_name_introduced then + begin + {$if declared(FC_TS_CONF_set_tsa_name)} + TS_CONF_set_tsa_name := @FC_TS_CONF_set_tsa_name; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_CONF_set_tsa_name_removed)} + if TS_CONF_set_tsa_name_removed <= LibVersion then + begin + {$if declared(_TS_CONF_set_tsa_name)} + TS_CONF_set_tsa_name := @_TS_CONF_set_tsa_name; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_CONF_set_tsa_name_allownil)} + if FuncLoadError then + AFailed.Add('TS_CONF_set_tsa_name'); + {$ifend} + end; + + + TS_CONF_set_ess_cert_id_chain := LoadLibFunction(ADllHandle, TS_CONF_set_ess_cert_id_chain_procname); + FuncLoadError := not assigned(TS_CONF_set_ess_cert_id_chain); + if FuncLoadError then + begin + {$if not defined(TS_CONF_set_ess_cert_id_chain_allownil)} + TS_CONF_set_ess_cert_id_chain := @ERR_TS_CONF_set_ess_cert_id_chain; + {$ifend} + {$if declared(TS_CONF_set_ess_cert_id_chain_introduced)} + if LibVersion < TS_CONF_set_ess_cert_id_chain_introduced then + begin + {$if declared(FC_TS_CONF_set_ess_cert_id_chain)} + TS_CONF_set_ess_cert_id_chain := @FC_TS_CONF_set_ess_cert_id_chain; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_CONF_set_ess_cert_id_chain_removed)} + if TS_CONF_set_ess_cert_id_chain_removed <= LibVersion then + begin + {$if declared(_TS_CONF_set_ess_cert_id_chain)} + TS_CONF_set_ess_cert_id_chain := @_TS_CONF_set_ess_cert_id_chain; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_CONF_set_ess_cert_id_chain_allownil)} + if FuncLoadError then + AFailed.Add('TS_CONF_set_ess_cert_id_chain'); + {$ifend} + end; + + + TS_CONF_set_ess_cert_id_digest := LoadLibFunction(ADllHandle, TS_CONF_set_ess_cert_id_digest_procname); + FuncLoadError := not assigned(TS_CONF_set_ess_cert_id_digest); + if FuncLoadError then + begin + {$if not defined(TS_CONF_set_ess_cert_id_digest_allownil)} + TS_CONF_set_ess_cert_id_digest := @ERR_TS_CONF_set_ess_cert_id_digest; + {$ifend} + {$if declared(TS_CONF_set_ess_cert_id_digest_introduced)} + if LibVersion < TS_CONF_set_ess_cert_id_digest_introduced then + begin + {$if declared(FC_TS_CONF_set_ess_cert_id_digest)} + TS_CONF_set_ess_cert_id_digest := @FC_TS_CONF_set_ess_cert_id_digest; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TS_CONF_set_ess_cert_id_digest_removed)} + if TS_CONF_set_ess_cert_id_digest_removed <= LibVersion then + begin + {$if declared(_TS_CONF_set_ess_cert_id_digest)} + TS_CONF_set_ess_cert_id_digest := @_TS_CONF_set_ess_cert_id_digest; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TS_CONF_set_ess_cert_id_digest_allownil)} + if FuncLoadError then + AFailed.Add('TS_CONF_set_ess_cert_id_digest'); + {$ifend} + end; + + +end; + +procedure Unload; +begin + TS_REQ_new := nil; + TS_REQ_free := nil; + i2d_TS_REQ := nil; + d2i_TS_REQ := nil; + TS_REQ_dup := nil; + d2i_TS_REQ_bio := nil; + i2d_TS_REQ_bio := nil; + TS_MSG_IMPRINT_new := nil; + TS_MSG_IMPRINT_free := nil; + i2d_TS_MSG_IMPRINT := nil; + d2i_TS_MSG_IMPRINT := nil; + TS_MSG_IMPRINT_dup := nil; + d2i_TS_MSG_IMPRINT_bio := nil; + i2d_TS_MSG_IMPRINT_bio := nil; + TS_RESP_new := nil; + TS_RESP_free := nil; + i2d_TS_RESP := nil; + d2i_TS_RESP := nil; + PKCS7_to_TS_TST_INFO := nil; + TS_RESP_dup := nil; + d2i_TS_RESP_bio := nil; + i2d_TS_RESP_bio := nil; + TS_STATUS_INFO_new := nil; + TS_STATUS_INFO_free := nil; + i2d_TS_STATUS_INFO := nil; + d2i_TS_STATUS_INFO := nil; + TS_STATUS_INFO_dup := nil; + TS_TST_INFO_new := nil; + TS_TST_INFO_free := nil; + i2d_TS_TST_INFO := nil; + d2i_TS_TST_INFO := nil; + TS_TST_INFO_dup := nil; + d2i_TS_TST_INFO_bio := nil; + i2d_TS_TST_INFO_bio := nil; + TS_ACCURACY_new := nil; + TS_ACCURACY_free := nil; + i2d_TS_ACCURACY := nil; + d2i_TS_ACCURACY := nil; + TS_ACCURACY_dup := nil; + ESS_ISSUER_SERIAL_new := nil; + ESS_ISSUER_SERIAL_free := nil; + i2d_ESS_ISSUER_SERIAL := nil; + d2i_ESS_ISSUER_SERIAL := nil; + ESS_ISSUER_SERIAL_dup := nil; + ESS_CERT_ID_new := nil; + ESS_CERT_ID_free := nil; + i2d_ESS_CERT_ID := nil; + d2i_ESS_CERT_ID := nil; + ESS_CERT_ID_dup := nil; + ESS_SIGNING_CERT_new := nil; + ESS_SIGNING_CERT_free := nil; + i2d_ESS_SIGNING_CERT := nil; + d2i_ESS_SIGNING_CERT := nil; + ESS_SIGNING_CERT_dup := nil; + ESS_CERT_ID_V2_new := nil; + ESS_CERT_ID_V2_free := nil; + i2d_ESS_CERT_ID_V2 := nil; + d2i_ESS_CERT_ID_V2 := nil; + ESS_CERT_ID_V2_dup := nil; + ESS_SIGNING_CERT_V2_new := nil; + ESS_SIGNING_CERT_V2_free := nil; + i2d_ESS_SIGNING_CERT_V2 := nil; + d2i_ESS_SIGNING_CERT_V2 := nil; + ESS_SIGNING_CERT_V2_dup := nil; + TS_REQ_set_version := nil; + TS_REQ_get_version := nil; + TS_STATUS_INFO_set_status := nil; + TS_STATUS_INFO_get0_status := nil; + TS_REQ_set_msg_imprint := nil; + TS_REQ_get_msg_imprint := nil; + TS_MSG_IMPRINT_set_algo := nil; + TS_MSG_IMPRINT_get_algo := nil; + TS_MSG_IMPRINT_set_msg := nil; + TS_MSG_IMPRINT_get_msg := nil; + TS_REQ_set_policy_id := nil; + TS_REQ_get_policy_id := nil; + TS_REQ_set_nonce := nil; + TS_REQ_get_nonce := nil; + TS_REQ_set_cert_req := nil; + TS_REQ_get_cert_req := nil; + TS_REQ_ext_free := nil; + TS_REQ_get_ext_count := nil; + TS_REQ_get_ext_by_NID := nil; + TS_REQ_get_ext_by_OBJ := nil; + TS_REQ_get_ext_by_critical := nil; + TS_REQ_get_ext := nil; + TS_REQ_delete_ext := nil; + TS_REQ_add_ext := nil; + TS_REQ_get_ext_d2i := nil; + TS_REQ_print_bio := nil; + TS_RESP_set_status_info := nil; + TS_RESP_get_status_info := nil; + TS_RESP_set_tst_info := nil; + TS_RESP_get_token := nil; + TS_RESP_get_tst_info := nil; + TS_TST_INFO_set_version := nil; + TS_TST_INFO_get_version := nil; + TS_TST_INFO_set_policy_id := nil; + TS_TST_INFO_get_policy_id := nil; + TS_TST_INFO_set_msg_imprint := nil; + TS_TST_INFO_get_msg_imprint := nil; + TS_TST_INFO_set_serial := nil; + TS_TST_INFO_get_serial := nil; + TS_TST_INFO_set_time := nil; + TS_TST_INFO_get_time := nil; + TS_TST_INFO_set_accuracy := nil; + TS_TST_INFO_get_accuracy := nil; + TS_ACCURACY_set_seconds := nil; + TS_ACCURACY_get_seconds := nil; + TS_ACCURACY_set_millis := nil; + TS_ACCURACY_get_millis := nil; + TS_ACCURACY_set_micros := nil; + TS_ACCURACY_get_micros := nil; + TS_TST_INFO_set_ordering := nil; + TS_TST_INFO_get_ordering := nil; + TS_TST_INFO_set_nonce := nil; + TS_TST_INFO_get_nonce := nil; + TS_TST_INFO_set_tsa := nil; + TS_TST_INFO_get_tsa := nil; + TS_TST_INFO_ext_free := nil; + TS_TST_INFO_get_ext_count := nil; + TS_TST_INFO_get_ext_by_NID := nil; + TS_TST_INFO_get_ext_by_OBJ := nil; + TS_TST_INFO_get_ext_by_critical := nil; + TS_TST_INFO_get_ext := nil; + TS_TST_INFO_delete_ext := nil; + TS_TST_INFO_add_ext := nil; + TS_TST_INFO_get_ext_d2i := nil; + TS_RESP_CTX_new := nil; + TS_RESP_CTX_free := nil; + TS_RESP_CTX_set_signer_cert := nil; + TS_RESP_CTX_set_signer_key := nil; + TS_RESP_CTX_set_signer_digest := nil; + TS_RESP_CTX_set_ess_cert_id_digest := nil; + TS_RESP_CTX_set_def_policy := nil; + TS_RESP_CTX_add_policy := nil; + TS_RESP_CTX_add_md := nil; + TS_RESP_CTX_set_accuracy := nil; + TS_RESP_CTX_set_clock_precision_digits := nil; + TS_RESP_CTX_add_flags := nil; + TS_RESP_CTX_set_serial_cb := nil; + TS_RESP_CTX_set_time_cb := nil; + TS_RESP_CTX_set_extension_cb := nil; + TS_RESP_CTX_set_status_info := nil; + TS_RESP_CTX_set_status_info_cond := nil; + TS_RESP_CTX_add_failure_info := nil; + TS_RESP_CTX_get_request := nil; + TS_RESP_CTX_get_tst_info := nil; + TS_RESP_create_response := nil; + TS_RESP_verify_response := nil; + TS_RESP_verify_token := nil; + TS_VERIFY_CTX_new := nil; + TS_VERIFY_CTX_init := nil; + TS_VERIFY_CTX_free := nil; + TS_VERIFY_CTX_cleanup := nil; + TS_VERIFY_CTX_set_flags := nil; + TS_VERIFY_CTX_add_flags := nil; + TS_VERIFY_CTX_set_data := nil; + TS_VERIFY_CTX_set_imprint := nil; + TS_VERIFY_CTX_set_store := nil; + TS_REQ_to_TS_VERIFY_CTX := nil; + TS_RESP_print_bio := nil; + TS_STATUS_INFO_print_bio := nil; + TS_TST_INFO_print_bio := nil; + TS_ASN1_INTEGER_print_bio := nil; + TS_OBJ_print_bio := nil; + TS_X509_ALGOR_print_bio := nil; + TS_MSG_IMPRINT_print_bio := nil; + TS_CONF_load_cert := nil; + TS_CONF_load_key := nil; + TS_CONF_set_serial := nil; + TS_CONF_get_tsa_section := nil; + TS_CONF_set_crypto_device := nil; + TS_CONF_set_default_engine := nil; + TS_CONF_set_signer_cert := nil; + TS_CONF_set_certs := nil; + TS_CONF_set_signer_key := nil; + TS_CONF_set_signer_digest := nil; + TS_CONF_set_def_policy := nil; + TS_CONF_set_policies := nil; + TS_CONF_set_digests := nil; + TS_CONF_set_accuracy := nil; + TS_CONF_set_clock_precision_digits := nil; + TS_CONF_set_ordering := nil; + TS_CONF_set_tsa_name := nil; + TS_CONF_set_ess_cert_id_chain := nil; + TS_CONF_set_ess_cert_id_digest := nil; +end; +{$ELSE} +{$ENDIF} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +initialization + Register_SSLLoader(@Load,'LibCrypto'); + Register_SSLUnloader(@Unload); +{$ENDIF} +end. diff --git a/IdOpenSSLHeaders_tserr.pas b/IdOpenSSLHeaders_tserr.pas new file mode 100644 index 0000000..2270dba --- /dev/null +++ b/IdOpenSSLHeaders_tserr.pas @@ -0,0 +1,244 @@ + (* This unit was generated using the script genOpenSSLHdrs.sh from the source file IdOpenSSLHeaders_tserr.h2pas + It should not be modified directly. All changes should be made to IdOpenSSLHeaders_tserr.h2pas + and this file regenerated. IdOpenSSLHeaders_tserr.h2pas is distributed with the full Indy + Distribution. + *) + +{$i IdCompilerDefines.inc} +{$i IdSSLOpenSSLDefines.inc} +{$IFNDEF USE_OPENSSL} + { error Should not compile if USE_OPENSSL is not defined!!!} +{$ENDIF} +{******************************************************************************} +{ } +{ Indy (Internet Direct) - Internet Protocols Simplified } +{ } +{ https://www.indyproject.org/ } +{ https://gitter.im/IndySockets/Indy } +{ } +{******************************************************************************} +{ } +{ This file is part of the Indy (Internet Direct) project, and is offered } +{ under the dual-licensing agreement described on the Indy website. } +{ (https://www.indyproject.org/license/) } +{ } +{ Copyright: } +{ (c) 1993-2020, Chad Z. Hower and the Indy Pit Crew. All rights reserved. } +{ } +{******************************************************************************} +{ } +{ } +{******************************************************************************} + +unit IdOpenSSLHeaders_tserr; + +interface + +// Headers for OpenSSL 1.1.1 +// tserr.h + + +uses + IdCTypes, + IdGlobal, + IdSSLOpenSSLConsts; + +const + (* + * TS function codes. + *) + TS_F_DEF_SERIAL_CB = 110; + TS_F_DEF_TIME_CB = 111; + TS_F_ESS_ADD_SIGNING_CERT = 112; + TS_F_ESS_ADD_SIGNING_CERT_V2 = 147; + TS_F_ESS_CERT_ID_NEW_INIT = 113; + TS_F_ESS_CERT_ID_V2_NEW_INIT = 156; + TS_F_ESS_SIGNING_CERT_NEW_INIT = 114; + TS_F_ESS_SIGNING_CERT_V2_NEW_INIT = 157; + TS_F_INT_TS_RESP_VERIFY_TOKEN = 149; + TS_F_PKCS7_TO_TS_TST_INFO = 148; + TS_F_TS_ACCURACY_SET_MICROS = 115; + TS_F_TS_ACCURACY_SET_MILLIS = 116; + TS_F_TS_ACCURACY_SET_SECONDS = 117; + TS_F_TS_CHECK_IMPRINTS = 100; + TS_F_TS_CHECK_NONCES = 101; + TS_F_TS_CHECK_POLICY = 102; + TS_F_TS_CHECK_SIGNING_CERTS = 103; + TS_F_TS_CHECK_STATUS_INFO = 104; + TS_F_TS_COMPUTE_IMPRINT = 145; + TS_F_TS_CONF_INVALID = 151; + TS_F_TS_CONF_LOAD_CERT = 153; + TS_F_TS_CONF_LOAD_CERTS = 154; + TS_F_TS_CONF_LOAD_KEY = 155; + TS_F_TS_CONF_LOOKUP_FAIL = 152; + TS_F_TS_CONF_SET_DEFAULT_ENGINE = 146; + TS_F_TS_GET_STATUS_TEXT = 105; + TS_F_TS_MSG_IMPRINT_SET_ALGO = 118; + TS_F_TS_REQ_SET_MSG_IMPRINT = 119; + TS_F_TS_REQ_SET_NONCE = 120; + TS_F_TS_REQ_SET_POLICY_ID = 121; + TS_F_TS_RESP_CREATE_RESPONSE = 122; + TS_F_TS_RESP_CREATE_TST_INFO = 123; + TS_F_TS_RESP_CTX_ADD_FAILURE_INFO = 124; + TS_F_TS_RESP_CTX_ADD_MD = 125; + TS_F_TS_RESP_CTX_ADD_POLICY = 126; + TS_F_TS_RESP_CTX_NEW = 127; + TS_F_TS_RESP_CTX_SET_ACCURACY = 128; + TS_F_TS_RESP_CTX_SET_CERTS = 129; + TS_F_TS_RESP_CTX_SET_DEF_POLICY = 130; + TS_F_TS_RESP_CTX_SET_SIGNER_CERT = 131; + TS_F_TS_RESP_CTX_SET_STATUS_INFO = 132; + TS_F_TS_RESP_GET_POLICY = 133; + TS_F_TS_RESP_SET_GENTIME_WITH_PRECISION = 134; + TS_F_TS_RESP_SET_STATUS_INFO = 135; + TS_F_TS_RESP_SET_TST_INFO = 150; + TS_F_TS_RESP_SIGN = 136; + TS_F_TS_RESP_VERIFY_SIGNATURE = 106; + TS_F_TS_TST_INFO_SET_ACCURACY = 137; + TS_F_TS_TST_INFO_SET_MSG_IMPRINT = 138; + TS_F_TS_TST_INFO_SET_NONCE = 139; + TS_F_TS_TST_INFO_SET_POLICY_ID = 140; + TS_F_TS_TST_INFO_SET_SERIAL = 141; + TS_F_TS_TST_INFO_SET_TIME = 142; + TS_F_TS_TST_INFO_SET_TSA = 143; + TS_F_TS_VERIFY = 108; + TS_F_TS_VERIFY_CERT = 109; + TS_F_TS_VERIFY_CTX_NEW = 144; + + (* + * TS reason codes. + *) + TS_R_BAD_PKCS7_TYPE = 132; + TS_R_BAD_TYPE = 133; + TS_R_CANNOT_LOAD_CERT = 137; + TS_R_CANNOT_LOAD_KEY = 138; + TS_R_CERTIFICATE_VERIFY_ERROR = 100; + TS_R_COULD_NOT_SET_ENGINE = 127; + TS_R_COULD_NOT_SET_TIME = 115; + TS_R_DETACHED_CONTENT = 134; + TS_R_ESS_ADD_SIGNING_CERT_ERROR = 116; + TS_R_ESS_ADD_SIGNING_CERT_V2_ERROR = 139; + TS_R_ESS_SIGNING_CERTIFICATE_ERROR = 101; + TS_R_INVALID_NULL_POINTER = 102; + TS_R_INVALID_SIGNER_CERTIFICATE_PURPOSE = 117; + TS_R_MESSAGE_IMPRINT_MISMATCH = 103; + TS_R_NONCE_MISMATCH = 104; + TS_R_NONCE_NOT_RETURNED = 105; + TS_R_NO_CONTENT = 106; + TS_R_NO_TIME_STAMP_TOKEN = 107; + TS_R_PKCS7_ADD_SIGNATURE_ERROR = 118; + TS_R_PKCS7_ADD_SIGNED_ATTR_ERROR = 119; + TS_R_PKCS7_TO_TS_TST_INFO_FAILED = 129; + TS_R_POLICY_MISMATCH = 108; + TS_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE = 120; + TS_R_RESPONSE_SETUP_ERROR = 121; + TS_R_SIGNATURE_FAILURE = 109; + TS_R_THERE_MUST_BE_ONE_SIGNER = 110; + TS_R_TIME_SYSCALL_ERROR = 122; + TS_R_TOKEN_NOT_PRESENT = 130; + TS_R_TOKEN_PRESENT = 131; + TS_R_TSA_NAME_MISMATCH = 111; + TS_R_TSA_UNTRUSTED = 112; + TS_R_TST_INFO_SETUP_ERROR = 123; + TS_R_TS_DATASIGN = 124; + TS_R_UNACCEPTABLE_POLICY = 125; + TS_R_UNSUPPORTED_MD_ALGORITHM = 126; + TS_R_UNSUPPORTED_VERSION = 113; + TS_R_VAR_BAD_VALUE = 135; + TS_R_VAR_LOOKUP_FAILURE = 136; + TS_R_WRONG_CONTENT_TYPE = 114; + + { The EXTERNALSYM directive is ignored by FPC, however, it is used by Delphi as follows: + + The EXTERNALSYM directive prevents the specified Delphi symbol from appearing in header + files generated for C++. } + + {$EXTERNALSYM ERR_load_TS_strings} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +var + ERR_load_TS_strings: function : TIdC_INT; cdecl = nil; + +{$ELSE} + function ERR_load_TS_strings: TIdC_INT cdecl; external CLibCrypto; + +{$ENDIF} + +implementation + + uses + classes, + IdSSLOpenSSLExceptionHandlers, + IdResourceStringsOpenSSL + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + ,IdSSLOpenSSLLoader + {$ENDIF}; + + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +const + ERR_load_TS_strings_procname = 'ERR_load_TS_strings'; + + +{$WARN NO_RETVAL OFF} +function ERR_ERR_load_TS_strings: TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ERR_load_TS_strings_procname); +end; + + + +{$WARN NO_RETVAL ON} + +procedure Load(const ADllHandle: TIdLibHandle; LibVersion: TIdC_UINT; const AFailed: TStringList); + +var FuncLoadError: boolean; + +begin + ERR_load_TS_strings := LoadLibFunction(ADllHandle, ERR_load_TS_strings_procname); + FuncLoadError := not assigned(ERR_load_TS_strings); + if FuncLoadError then + begin + {$if not defined(ERR_load_TS_strings_allownil)} + ERR_load_TS_strings := @ERR_ERR_load_TS_strings; + {$ifend} + {$if declared(ERR_load_TS_strings_introduced)} + if LibVersion < ERR_load_TS_strings_introduced then + begin + {$if declared(FC_ERR_load_TS_strings)} + ERR_load_TS_strings := @FC_ERR_load_TS_strings; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ERR_load_TS_strings_removed)} + if ERR_load_TS_strings_removed <= LibVersion then + begin + {$if declared(_ERR_load_TS_strings)} + ERR_load_TS_strings := @_ERR_load_TS_strings; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ERR_load_TS_strings_allownil)} + if FuncLoadError then + AFailed.Add('ERR_load_TS_strings'); + {$ifend} + end; + + +end; + +procedure Unload; +begin + ERR_load_TS_strings := nil; +end; +{$ELSE} +{$ENDIF} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +initialization + Register_SSLLoader(@Load,'LibCrypto'); + Register_SSLUnloader(@Unload); +{$ENDIF} +end. diff --git a/IdOpenSSLHeaders_txt_db.pas b/IdOpenSSLHeaders_txt_db.pas new file mode 100644 index 0000000..4c2d63e --- /dev/null +++ b/IdOpenSSLHeaders_txt_db.pas @@ -0,0 +1,345 @@ + (* This unit was generated using the script genOpenSSLHdrs.sh from the source file IdOpenSSLHeaders_txt_db.h2pas + It should not be modified directly. All changes should be made to IdOpenSSLHeaders_txt_db.h2pas + and this file regenerated. IdOpenSSLHeaders_txt_db.h2pas is distributed with the full Indy + Distribution. + *) + +{$i IdCompilerDefines.inc} +{$i IdSSLOpenSSLDefines.inc} +{$IFNDEF USE_OPENSSL} + { error Should not compile if USE_OPENSSL is not defined!!!} +{$ENDIF} +{******************************************************************************} +{ } +{ Indy (Internet Direct) - Internet Protocols Simplified } +{ } +{ https://www.indyproject.org/ } +{ https://gitter.im/IndySockets/Indy } +{ } +{******************************************************************************} +{ } +{ This file is part of the Indy (Internet Direct) project, and is offered } +{ under the dual-licensing agreement described on the Indy website. } +{ (https://www.indyproject.org/license/) } +{ } +{ Copyright: } +{ (c) 1993-2020, Chad Z. Hower and the Indy Pit Crew. All rights reserved. } +{ } +{******************************************************************************} +{ } +{ } +{******************************************************************************} + +unit IdOpenSSLHeaders_txt_db; + +interface + +// Headers for OpenSSL 1.1.1 +// txt_db.h + + +uses + IdCTypes, + IdGlobal, + IdSSLOpenSSLConsts, + IdOpenSSLHeaders_safestack, + IdOpenSSLHeaders_ossl_typ; + +const + DB_ERROR_OK = 0; + DB_ERROR_MALLOC = 1; + DB_ERROR_INDEX_CLASH = 2; + DB_ERROR_INDEX_OUT_OF_RANGE = 3; + DB_ERROR_NO_INDEX = 4; + DB_ERROR_INSERT_INDEX_CLASH = 5; + DB_ERROR_WRONG_NUM_FIELDS = 6; + +type +// DEFINE_SPECIAL_STACK_OF(OPENSSL_PSTRING, OPENSSL_STRING) + + qual_func = function (v1: POPENSSL_STRING): TIdC_INT; + txt_db_st = record + num_fields: TIdC_INT; + data: Pointer; // STACK_OF(OPENSSL_PSTRING) * + index: Pointer; // LHASH_OF(OPENSSL_STRING) ** + qual: qual_func; + error: TIdC_LONG; + arg1: TIdC_LONG; + arg2: TIdC_LONG; + arg_row: POPENSSL_STRING; + end; + TXT_DB = txt_db_st; + PTXT_DB = ^TXT_DB; + + TXT_DB_create_index_qual = function(v1: POPENSSL_STRING): TIdC_INT; + + { The EXTERNALSYM directive is ignored by FPC, however, it is used by Delphi as follows: + + The EXTERNALSYM directive prevents the specified Delphi symbol from appearing in header + files generated for C++. } + + {$EXTERNALSYM TXT_DB_read} + {$EXTERNALSYM TXT_DB_write} + {$EXTERNALSYM TXT_DB_free} + {$EXTERNALSYM TXT_DB_get_by_index} + {$EXTERNALSYM TXT_DB_insert} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +var + TXT_DB_read: function (in_: PBIO; num: TIdC_INT): PTXT_DB; cdecl = nil; + TXT_DB_write: function (out_: PBIO; db: PTXT_DB): TIdC_LONG; cdecl = nil; + //function TXT_DB_create_index(db: PTXT_DB; field: TIdC_INT; qual: TXT_DB_create_index_qual; hash: OPENSSL_LH_HashFunc; cmp: OPENSSL_LH_COMPFUNC): TIdC_INT; + TXT_DB_free: procedure (db: PTXT_DB); cdecl = nil; + TXT_DB_get_by_index: function (db: PTXT_DB; idx: TIdC_INT; value: POPENSSL_STRING): POPENSSL_STRING; cdecl = nil; + TXT_DB_insert: function (db: PTXT_DB; value: POPENSSL_STRING): TIdC_INT; cdecl = nil; + +{$ELSE} + function TXT_DB_read(in_: PBIO; num: TIdC_INT): PTXT_DB cdecl; external CLibCrypto; + function TXT_DB_write(out_: PBIO; db: PTXT_DB): TIdC_LONG cdecl; external CLibCrypto; + //function TXT_DB_create_index(db: PTXT_DB; field: TIdC_INT; qual: TXT_DB_create_index_qual; hash: OPENSSL_LH_HashFunc; cmp: OPENSSL_LH_COMPFUNC): TIdC_INT; + procedure TXT_DB_free(db: PTXT_DB) cdecl; external CLibCrypto; + function TXT_DB_get_by_index(db: PTXT_DB; idx: TIdC_INT; value: POPENSSL_STRING): POPENSSL_STRING cdecl; external CLibCrypto; + function TXT_DB_insert(db: PTXT_DB; value: POPENSSL_STRING): TIdC_INT cdecl; external CLibCrypto; + +{$ENDIF} + +implementation + + uses + classes, + IdSSLOpenSSLExceptionHandlers, + IdResourceStringsOpenSSL + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + ,IdSSLOpenSSLLoader + {$ENDIF}; + + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +const + TXT_DB_read_procname = 'TXT_DB_read'; + TXT_DB_write_procname = 'TXT_DB_write'; + //function TXT_DB_create_index(db: PTXT_DB; field: TIdC_INT; qual: TXT_DB_create_index_qual; hash: OPENSSL_LH_HashFunc; cmp: OPENSSL_LH_COMPFUNC): TIdC_INT; + TXT_DB_free_procname = 'TXT_DB_free'; + TXT_DB_get_by_index_procname = 'TXT_DB_get_by_index'; + TXT_DB_insert_procname = 'TXT_DB_insert'; + + +{$WARN NO_RETVAL OFF} +function ERR_TXT_DB_read(in_: PBIO; num: TIdC_INT): PTXT_DB; +begin + EIdAPIFunctionNotPresent.RaiseException(TXT_DB_read_procname); +end; + + +function ERR_TXT_DB_write(out_: PBIO; db: PTXT_DB): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(TXT_DB_write_procname); +end; + + + //function TXT_DB_create_index(db: PTXT_DB; field: TIdC_INT; qual: TXT_DB_create_index_qual; hash: OPENSSL_LH_HashFunc; cmp: OPENSSL_LH_COMPFUNC): TIdC_INT; +procedure ERR_TXT_DB_free(db: PTXT_DB); +begin + EIdAPIFunctionNotPresent.RaiseException(TXT_DB_free_procname); +end; + + +function ERR_TXT_DB_get_by_index(db: PTXT_DB; idx: TIdC_INT; value: POPENSSL_STRING): POPENSSL_STRING; +begin + EIdAPIFunctionNotPresent.RaiseException(TXT_DB_get_by_index_procname); +end; + + +function ERR_TXT_DB_insert(db: PTXT_DB; value: POPENSSL_STRING): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(TXT_DB_insert_procname); +end; + + + +{$WARN NO_RETVAL ON} + +procedure Load(const ADllHandle: TIdLibHandle; LibVersion: TIdC_UINT; const AFailed: TStringList); + +var FuncLoadError: boolean; + +begin + TXT_DB_read := LoadLibFunction(ADllHandle, TXT_DB_read_procname); + FuncLoadError := not assigned(TXT_DB_read); + if FuncLoadError then + begin + {$if not defined(TXT_DB_read_allownil)} + TXT_DB_read := @ERR_TXT_DB_read; + {$ifend} + {$if declared(TXT_DB_read_introduced)} + if LibVersion < TXT_DB_read_introduced then + begin + {$if declared(FC_TXT_DB_read)} + TXT_DB_read := @FC_TXT_DB_read; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TXT_DB_read_removed)} + if TXT_DB_read_removed <= LibVersion then + begin + {$if declared(_TXT_DB_read)} + TXT_DB_read := @_TXT_DB_read; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TXT_DB_read_allownil)} + if FuncLoadError then + AFailed.Add('TXT_DB_read'); + {$ifend} + end; + + + TXT_DB_write := LoadLibFunction(ADllHandle, TXT_DB_write_procname); + FuncLoadError := not assigned(TXT_DB_write); + if FuncLoadError then + begin + {$if not defined(TXT_DB_write_allownil)} + TXT_DB_write := @ERR_TXT_DB_write; + {$ifend} + {$if declared(TXT_DB_write_introduced)} + if LibVersion < TXT_DB_write_introduced then + begin + {$if declared(FC_TXT_DB_write)} + TXT_DB_write := @FC_TXT_DB_write; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TXT_DB_write_removed)} + if TXT_DB_write_removed <= LibVersion then + begin + {$if declared(_TXT_DB_write)} + TXT_DB_write := @_TXT_DB_write; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TXT_DB_write_allownil)} + if FuncLoadError then + AFailed.Add('TXT_DB_write'); + {$ifend} + end; + + + TXT_DB_free := LoadLibFunction(ADllHandle, TXT_DB_free_procname); + FuncLoadError := not assigned(TXT_DB_free); + if FuncLoadError then + begin + {$if not defined(TXT_DB_free_allownil)} + TXT_DB_free := @ERR_TXT_DB_free; + {$ifend} + {$if declared(TXT_DB_free_introduced)} + if LibVersion < TXT_DB_free_introduced then + begin + {$if declared(FC_TXT_DB_free)} + TXT_DB_free := @FC_TXT_DB_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TXT_DB_free_removed)} + if TXT_DB_free_removed <= LibVersion then + begin + {$if declared(_TXT_DB_free)} + TXT_DB_free := @_TXT_DB_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TXT_DB_free_allownil)} + if FuncLoadError then + AFailed.Add('TXT_DB_free'); + {$ifend} + end; + + + TXT_DB_get_by_index := LoadLibFunction(ADllHandle, TXT_DB_get_by_index_procname); + FuncLoadError := not assigned(TXT_DB_get_by_index); + if FuncLoadError then + begin + {$if not defined(TXT_DB_get_by_index_allownil)} + TXT_DB_get_by_index := @ERR_TXT_DB_get_by_index; + {$ifend} + {$if declared(TXT_DB_get_by_index_introduced)} + if LibVersion < TXT_DB_get_by_index_introduced then + begin + {$if declared(FC_TXT_DB_get_by_index)} + TXT_DB_get_by_index := @FC_TXT_DB_get_by_index; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TXT_DB_get_by_index_removed)} + if TXT_DB_get_by_index_removed <= LibVersion then + begin + {$if declared(_TXT_DB_get_by_index)} + TXT_DB_get_by_index := @_TXT_DB_get_by_index; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TXT_DB_get_by_index_allownil)} + if FuncLoadError then + AFailed.Add('TXT_DB_get_by_index'); + {$ifend} + end; + + + TXT_DB_insert := LoadLibFunction(ADllHandle, TXT_DB_insert_procname); + FuncLoadError := not assigned(TXT_DB_insert); + if FuncLoadError then + begin + {$if not defined(TXT_DB_insert_allownil)} + TXT_DB_insert := @ERR_TXT_DB_insert; + {$ifend} + {$if declared(TXT_DB_insert_introduced)} + if LibVersion < TXT_DB_insert_introduced then + begin + {$if declared(FC_TXT_DB_insert)} + TXT_DB_insert := @FC_TXT_DB_insert; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(TXT_DB_insert_removed)} + if TXT_DB_insert_removed <= LibVersion then + begin + {$if declared(_TXT_DB_insert)} + TXT_DB_insert := @_TXT_DB_insert; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(TXT_DB_insert_allownil)} + if FuncLoadError then + AFailed.Add('TXT_DB_insert'); + {$ifend} + end; + + +end; + +procedure Unload; +begin + TXT_DB_read := nil; + TXT_DB_write := nil; + TXT_DB_free := nil; + TXT_DB_get_by_index := nil; + TXT_DB_insert := nil; +end; +{$ELSE} +{$ENDIF} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +initialization + Register_SSLLoader(@Load,'LibCrypto'); + Register_SSLUnloader(@Unload); +{$ENDIF} +end. diff --git a/IdOpenSSLHeaders_ui.pas b/IdOpenSSLHeaders_ui.pas new file mode 100644 index 0000000..79be4bd --- /dev/null +++ b/IdOpenSSLHeaders_ui.pas @@ -0,0 +1,3564 @@ + (* This unit was generated using the script genOpenSSLHdrs.sh from the source file IdOpenSSLHeaders_ui.h2pas + It should not be modified directly. All changes should be made to IdOpenSSLHeaders_ui.h2pas + and this file regenerated. IdOpenSSLHeaders_ui.h2pas is distributed with the full Indy + Distribution. + *) + +{$i IdCompilerDefines.inc} +{$i IdSSLOpenSSLDefines.inc} +{$IFNDEF USE_OPENSSL} + { error Should not compile if USE_OPENSSL is not defined!!!} +{$ENDIF} +{******************************************************************************} +{ } +{ Indy (Internet Direct) - Internet Protocols Simplified } +{ } +{ https://www.indyproject.org/ } +{ https://gitter.im/IndySockets/Indy } +{ } +{******************************************************************************} +{ } +{ This file is part of the Indy (Internet Direct) project, and is offered } +{ under the dual-licensing agreement described on the Indy website. } +{ (https://www.indyproject.org/license/) } +{ } +{ Copyright: } +{ (c) 1993-2020, Chad Z. Hower and the Indy Pit Crew. All rights reserved. } +{ } +{******************************************************************************} +{ } +{ } +{******************************************************************************} + +unit IdOpenSSLHeaders_ui; + +interface + +// Headers for OpenSSL 1.1.1 +// ui.h + + +uses + IdCTypes, + IdGlobal, + IdSSLOpenSSLConsts, + IdOpenSSLHeaders_ossl_typ, + IdOpenSSLHeaders_crypto, + IdOpenSSLHeaders_pem, + IdOpenSSLHeaders_uierr; + +{$MINENUMSIZE 4} + +const + (* These are the possible flags. They can be or'ed together. *) + (* Use to have echoing of input *) + UI_INPUT_FLAG_ECHO = $01; + (* + * Use a default password. Where that password is found is completely up to + * the application, it might for example be in the user data set with + * UI_add_user_data(). It is not recommended to have more than one input in + * each UI being marked with this flag, or the application might get + * confused. + *) + UI_INPUT_FLAG_DEFAULT_PWD = $02; + + + (* + * The user of these routines may want to define flags of their own. The core + * UI won't look at those, but will pass them on to the method routines. They + * must use higher bits so they don't get confused with the UI bits above. + * UI_INPUT_FLAG_USER_BASE tells which is the lowest bit to use. A good + * example of use is this: + * + * #define MY_UI_FLAG1 (0x01 << UI_INPUT_FLAG_USER_BASE) + * + *) + UI_INPUT_FLAG_USER_BASE = 16; + + (* The commands *) + (* + * Use UI_CONTROL_PRINT_ERRORS with the value 1 to have UI_process print the + * OpenSSL error stack before printing any info or added error messages and + * before any prompting. + *) + UI_CTRL_PRINT_ERRORS = 1; + (* + * Check if a UI_process() is possible to do again with the same instance of + * a user interface. This makes UI_ctrl() return 1 if it is redoable, and 0 + * if not. + *) + UI_CTRL_IS_REDOABLE = 2; + +type + (* + * Give a user interface parameterised control commands. This can be used to + * send down an integer, a data pointer or a function pointer, as well as be + * used to get information from a UI. + *) + UI_ctrl_f = procedure; + + (* + * The UI_STRING type is the data structure that contains all the needed info + * about a string or a prompt, including test data for a verification prompt. + *) + ui_string_st = type Pointer; + UI_STRING = ui_string_st; + PUI_STRING = ^UI_STRING; +// DEFINE_STACK_OF(UI_STRING) + + (* + * The different types of strings that are currently supported. This is only + * needed by method authors. + *) + UI_string_types = ( + UIT_NONE = 0, + UIT_PROMPT, (* Prompt for a string *) + UIT_VERIFY, (* Prompt for a string and verify *) + UIT_BOOLEAN, (* Prompt for a yes/no response *) + UIT_INFO, (* Send info to the user *) + UIT_ERROR (* Send an error message to the user *) + ); + + (* Create and manipulate methods *) + UI_method_opener_cb = function(ui: PUI): TIdC_INT; + UI_method_writer_cb = function(ui: PUI; uis: PUI_String): TIdC_INT; + UI_method_flusher_cb = function(ui: PUI): TIdC_INT; + UI_method_reader_cb = function(ui: PUI; uis: PUI_String): TIdC_INT; + UI_method_closer_cb = function(ui: PUI): TIdC_INT; + UI_method_data_duplicator_cb = function(ui: PUI; ui_data: Pointer): Pointer; + UI_method_data_destructor_cb = procedure(ui: PUI; ui_data: Pointer); + UI_method_prompt_constructor_cb = function(ui: PUI; const object_desc: PIdAnsiChar; const object_name: PIdAnsiChar): PIdAnsiChar; + + (* + * All the following functions return -1 or NULL on error and in some cases + * (UI_process()) -2 if interrupted or in some other way cancelled. When + * everything is fine, they return 0, a positive value or a non-NULL pointer, + * all depending on their purpose. + *) + + (* Creators and destructor. *) + { The EXTERNALSYM directive is ignored by FPC, however, it is used by Delphi as follows: + + The EXTERNALSYM directive prevents the specified Delphi symbol from appearing in header + files generated for C++. } + + {$EXTERNALSYM UI_new} + {$EXTERNALSYM UI_new_method} + {$EXTERNALSYM UI_free} + {$EXTERNALSYM UI_add_input_string} + {$EXTERNALSYM UI_dup_input_string} + {$EXTERNALSYM UI_add_verify_string} + {$EXTERNALSYM UI_dup_verify_string} + {$EXTERNALSYM UI_add_input_boolean} + {$EXTERNALSYM UI_dup_input_boolean} + {$EXTERNALSYM UI_add_info_string} + {$EXTERNALSYM UI_dup_info_string} + {$EXTERNALSYM UI_add_error_string} + {$EXTERNALSYM UI_dup_error_string} + {$EXTERNALSYM UI_construct_prompt} + {$EXTERNALSYM UI_add_user_data} + {$EXTERNALSYM UI_dup_user_data} + {$EXTERNALSYM UI_get0_user_data} + {$EXTERNALSYM UI_get0_result} + {$EXTERNALSYM UI_get_result_length} + {$EXTERNALSYM UI_process} + {$EXTERNALSYM UI_ctrl} + {$EXTERNALSYM UI_set_ex_data} + {$EXTERNALSYM UI_get_ex_data} + {$EXTERNALSYM UI_set_default_method} + {$EXTERNALSYM UI_get_default_method} + {$EXTERNALSYM UI_get_method} + {$EXTERNALSYM UI_set_method} + {$EXTERNALSYM UI_OpenSSL} + {$EXTERNALSYM UI_null} + {$EXTERNALSYM UI_create_method} + {$EXTERNALSYM UI_destroy_method} + {$EXTERNALSYM UI_method_set_opener} + {$EXTERNALSYM UI_method_set_writer} + {$EXTERNALSYM UI_method_set_flusher} + {$EXTERNALSYM UI_method_set_reader} + {$EXTERNALSYM UI_method_set_closer} + {$EXTERNALSYM UI_method_set_data_duplicator} + {$EXTERNALSYM UI_method_set_prompt_constructor} + {$EXTERNALSYM UI_method_set_ex_data} + {$EXTERNALSYM UI_method_get_opener} + {$EXTERNALSYM UI_method_get_writer} + {$EXTERNALSYM UI_method_get_flusher} + {$EXTERNALSYM UI_method_get_reader} + {$EXTERNALSYM UI_method_get_closer} + {$EXTERNALSYM UI_method_get_prompt_constructor} + {$EXTERNALSYM UI_method_get_data_duplicator} + {$EXTERNALSYM UI_method_get_data_destructor} + {$EXTERNALSYM UI_method_get_ex_data} + {$EXTERNALSYM UI_get_string_type} + {$EXTERNALSYM UI_get_input_flags} + {$EXTERNALSYM UI_get0_output_string} + {$EXTERNALSYM UI_get0_action_string} + {$EXTERNALSYM UI_get0_result_string} + {$EXTERNALSYM UI_get_result_string_length} + {$EXTERNALSYM UI_get0_test_string} + {$EXTERNALSYM UI_get_result_minsize} + {$EXTERNALSYM UI_get_result_maxsize} + {$EXTERNALSYM UI_set_result} + {$EXTERNALSYM UI_set_result_ex} + {$EXTERNALSYM UI_UTIL_read_pw_string} + {$EXTERNALSYM UI_UTIL_read_pw} + {$EXTERNALSYM UI_UTIL_wrap_read_pem_callback} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +var + UI_new: function : PUI; cdecl = nil; + UI_new_method: function (const method: PUI_Method): PUI; cdecl = nil; + UI_free: procedure (ui: PUI); cdecl = nil; + + (* + * The following functions are used to add strings to be printed and prompt + * strings to prompt for data. The names are UI_{add,dup}__string + * and UI_{add,dup}_input_boolean. + * + * UI_{add,dup}__string have the following meanings: + * add add a text or prompt string. The pointers given to these + * functions are used verbatim, no copying is done. + * dup make a copy of the text or prompt string, then add the copy + * to the collection of strings in the user interface. + * + * The function is a name for the functionality that the given + * string shall be used for. It can be one of: + * input use the string as data prompt. + * verify use the string as verification prompt. This + * is used to verify a previous input. + * info use the string for informational output. + * error use the string for error output. + * Honestly, there's currently no difference between info and error for the + * moment. + * + * UI_{add,dup}_input_boolean have the same semantics for "add" and "dup", + * and are typically used when one wants to prompt for a yes/no response. + * + * All of the functions in this group take a UI and a prompt string. + * The string input and verify addition functions also take a flag argument, + * a buffer for the result to end up with, a minimum input size and a maximum + * input size (the result buffer MUST be large enough to be able to contain + * the maximum number of characters). Additionally, the verify addition + * functions takes another buffer to compare the result against. + * The boolean input functions take an action description string (which should + * be safe to ignore if the expected user action is obvious, for example with + * a dialog box with an OK button and a Cancel button), a string of acceptable + * characters to mean OK and to mean Cancel. The two last strings are checked + * to make sure they don't have common characters. Additionally, the same + * flag argument as for the string input is taken, as well as a result buffer. + * The result buffer is required to be at least one byte long. Depending on + * the answer, the first character from the OK or the Cancel character strings + * will be stored in the first byte of the result buffer. No NUL will be + * added, so the result is *not* a string. + * + * On success, the all return an index of the added information. That index + * is useful when retrieving results with UI_get0_result(). *) + + UI_add_input_string: function (ui: PUI; const prompt: PIdAnsiChar; flags: TIdC_INT; result_buf: PIdAnsiChar; minsize: TIdC_INT; maxsize: TIdC_INT): TIdC_INT; cdecl = nil; + UI_dup_input_string: function (ui: PUI; const prompt: PIdAnsiChar; flags: TIdC_INT; result_buf: PIdAnsiChar; minsize: TIdC_INT; maxsize: TIdC_INT): TIdC_INT; cdecl = nil; + UI_add_verify_string: function (ui: PUI; const prompt: PIdAnsiChar; flags: TIdC_INT; result_buf: PIdAnsiChar; minsize: TIdC_INT; maxsize: TIdC_INT; const test_buf: PIdAnsiChar): TIdC_INT; cdecl = nil; + UI_dup_verify_string: function (ui: PUI; const prompt: PIdAnsiChar; flags: TIdC_INT; result_buf: PIdAnsiChar; minsize: TIdC_INT; maxsize: TIdC_INT; const test_buf: PIdAnsiChar): TIdC_INT; cdecl = nil; + UI_add_input_boolean: function (ui: PUI; const prompt: PIdAnsiChar; const action_desc: PIdAnsiChar; const ok_chars: PIdAnsiChar; const cancel_chars: PIdAnsiChar; flags: TIdC_INT; result_buf: PIdAnsiChar): TIdC_INT; cdecl = nil; + UI_dup_input_boolean: function (ui: PUI; const prompt: PIdAnsiChar; const action_desc: PIdAnsiChar; const ok_chars: PIdAnsiChar; const cancel_chars: PIdAnsiChar; flags: TIdC_INT; result_buf: PIdAnsiChar): TIdC_INT; cdecl = nil; + UI_add_info_string: function (ui: PUI; const text: PIdAnsiChar): TIdC_INT; cdecl = nil; + UI_dup_info_string: function (ui: PUI; const text: PIdAnsiChar): TIdC_INT; cdecl = nil; + UI_add_error_string: function (ui: PUI; const text: PIdAnsiChar): TIdC_INT; cdecl = nil; + UI_dup_error_string: function (ui: PUI; const text: PIdAnsiChar): TIdC_INT; cdecl = nil; + + (* + * The following function helps construct a prompt. object_desc is a + * textual short description of the object, for example "pass phrase", + * and object_name is the name of the object (might be a card name or + * a file name. + * The returned string shall always be allocated on the heap with + * OPENSSL_malloc(), and need to be free'd with OPENSSL_free(). + * + * If the ui_method doesn't contain a pointer to a user-defined prompt + * constructor, a default string is built, looking like this: + * + * "Enter {object_desc} for {object_name}:" + * + * So, if object_desc has the value "pass phrase" and object_name has + * the value "foo.key", the resulting string is: + * + * "Enter pass phrase for foo.key:" + *) + UI_construct_prompt: function (ui_method: PUI; const object_desc: PIdAnsiChar; const object_name: PIdAnsiChar): PIdAnsiChar; cdecl = nil; + + (* + * The following function is used to store a pointer to user-specific data. + * Any previous such pointer will be returned and replaced. + * + * For callback purposes, this function makes a lot more sense than using + * ex_data, since the latter requires that different parts of OpenSSL or + * applications share the same ex_data index. + * + * Note that the UI_OpenSSL() method completely ignores the user data. Other + * methods may not, however. + *) + UI_add_user_data: function (ui: PUI; user_data: Pointer): Pointer; cdecl = nil; + (* + * Alternatively, this function is used to duplicate the user data. + * This uses the duplicator method function. The destroy function will + * be used to free the user data in this case. + *) + UI_dup_user_data: function (ui: PUI; user_data: Pointer): TIdC_INT; cdecl = nil; + (* We need a user data retrieving function as well. *) + UI_get0_user_data: function (ui: PUI): Pointer; cdecl = nil; + + (* Return the result associated with a prompt given with the index i. *) + UI_get0_result: function (ui: PUI; i: TIdC_INT): PIdAnsiChar; cdecl = nil; + UI_get_result_length: function (ui: PUI; i: TIdC_INT): TIdC_INT; cdecl = nil; + + (* When all strings have been added, process the whole thing. *) + UI_process: function (ui: PUI): TIdC_INT; cdecl = nil; + + (* + * Give a user interface parameterised control commands. This can be used to + * send down an integer, a data pointer or a function pointer, as well as be + * used to get information from a UI. + *) + UI_ctrl: function (ui: PUI; cmd: TIdC_INT; i: TIdC_LONG; p: Pointer; f: UI_ctrl_f): TIdC_INT; cdecl = nil; + + + (* Some methods may use extra data *) + //# define UI_set_app_data(s,arg) UI_set_ex_data(s,0,arg) + //# define UI_get_app_data(s) UI_get_ex_data(s,0) + + //# define UI_get_ex_new_index(l, p, newf, dupf, freef) \ + // CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_UI, l, p, newf, dupf, freef) + UI_set_ex_data: function (r: PUI; idx: TIdC_INT; arg: Pointer): TIdC_INT; cdecl = nil; + UI_get_ex_data: function (r: PUI; idx: TIdC_INT): Pointer; cdecl = nil; + + (* Use specific methods instead of the built-in one *) + UI_set_default_method: procedure (const meth: PUI_Method); cdecl = nil; + UI_get_default_method: function : PUI_METHOD; cdecl = nil; + UI_get_method: function (ui: PUI): PUI_METHOD; cdecl = nil; + UI_set_method: function (ui: PUI; const meth: PUI_METHOD): PUI_METHOD; cdecl = nil; + + (* The method with all the built-in thingies *) + UI_OpenSSL: function : PUI_Method; cdecl = nil; + + (* + * NULL method. Literally does nothing, but may serve as a placeholder + * to avoid internal default. + *) + UI_null: function : PUI_METHOD; cdecl = nil; + + (* ---------- For method writers ---------- *) + (* + A method contains a number of functions that implement the low level + of the User Interface. The functions are: + + an opener This function starts a session, maybe by opening + a channel to a tty, or by opening a window. + a writer This function is called to write a given string, + maybe to the tty, maybe as a field label in a + window. + a flusher This function is called to flush everything that + has been output so far. It can be used to actually + display a dialog box after it has been built. + a reader This function is called to read a given prompt, + maybe from the tty, maybe from a field in a + window. Note that it's called with all string + structures, not only the prompt ones, so it must + check such things itself. + a closer This function closes the session, maybe by closing + the channel to the tty, or closing the window. + + All these functions are expected to return: + + 0 on error. + 1 on success. + -1 on out-of-band events, for example if some prompting has + been canceled (by pressing Ctrl-C, for example). This is + only checked when returned by the flusher or the reader. + + The way this is used, the opener is first called, then the writer for all + strings, then the flusher, then the reader for all strings and finally the + closer. Note that if you want to prompt from a terminal or other command + line interface, the best is to have the reader also write the prompts + instead of having the writer do it. If you want to prompt from a dialog + box, the writer can be used to build up the contents of the box, and the + flusher to actually display the box and run the event loop until all data + has been given, after which the reader only grabs the given data and puts + them back into the UI strings. + + All method functions take a UI as argument. Additionally, the writer and + the reader take a UI_STRING. + *) + + UI_create_method: function (const name: PIdAnsiChar): PUI_Method; cdecl = nil; + UI_destroy_method: procedure (ui_method: PUI_Method); cdecl = nil; + + UI_method_set_opener: function (method: PUI_Method; opener: UI_method_opener_cb): TIdC_INT; cdecl = nil; + UI_method_set_writer: function (method: PUI_Method; writer: UI_method_writer_cb): TIdC_INT; cdecl = nil; + UI_method_set_flusher: function (method: PUI_Method; flusher: UI_method_flusher_cb): TIdC_INT; cdecl = nil; + UI_method_set_reader: function (method: PUI_Method; reader: UI_method_reader_cb): TIdC_INT; cdecl = nil; + UI_method_set_closer: function (method: PUI_Method; closer: UI_method_closer_cb): TIdC_INT; cdecl = nil; + UI_method_set_data_duplicator: function (method: PUI_Method; duplicator: UI_method_data_duplicator_cb; destructor_: UI_method_data_destructor_cb): TIdC_INT; cdecl = nil; + UI_method_set_prompt_constructor: function (method: PUI_Method; prompt_constructor: UI_method_prompt_constructor_cb): TIdC_INT; cdecl = nil; + UI_method_set_ex_data: function (method: PUI_Method; idx: TIdC_INT; data: Pointer): TIdC_INT; cdecl = nil; + + UI_method_get_opener: function (const method: PUI_METHOD): UI_method_opener_cb; cdecl = nil; + UI_method_get_writer: function (const method: PUI_METHOD): UI_method_writer_cb; cdecl = nil; + UI_method_get_flusher: function (const method: PUI_METHOD): UI_method_flusher_cb; cdecl = nil; + UI_method_get_reader: function (const method: PUI_METHOD): UI_method_reader_cb; cdecl = nil; + UI_method_get_closer: function (const method: PUI_METHOD): UI_method_closer_cb; cdecl = nil; + UI_method_get_prompt_constructor: function (const method: PUI_METHOD): UI_method_prompt_constructor_cb; cdecl = nil; + UI_method_get_data_duplicator: function (const method: PUI_METHOD): UI_method_data_duplicator_cb; cdecl = nil; + UI_method_get_data_destructor: function (const method: PUI_METHOD): UI_method_data_destructor_cb; cdecl = nil; + UI_method_get_ex_data: function (const method: PUI_METHOD; idx: TIdC_INT): Pointer; cdecl = nil; + + (* + * The following functions are helpers for method writers to access relevant + * data from a UI_STRING. + *) + + (* Return type of the UI_STRING *) + UI_get_string_type: function (uis: PUI_String): UI_string_types; cdecl = nil; + (* Return input flags of the UI_STRING *) + UI_get_input_flags: function (uis: PUI_String): TIdC_INT; cdecl = nil; + (* Return the actual string to output (the prompt, info or error) *) + UI_get0_output_string: function (uis: PUI_String): PIdAnsiChar; cdecl = nil; + (* + * Return the optional action string to output (the boolean prompt + * instruction) + *) + UI_get0_action_string: function (uis: PUI_String): PIdAnsiChar; cdecl = nil; + (* Return the result of a prompt *) + UI_get0_result_string: function (uis: PUI_String): PIdAnsiChar; cdecl = nil; + UI_get_result_string_length: function (uis: PUI_String): TIdC_INT; cdecl = nil; + (* + * Return the string to test the result against. Only useful with verifies. + *) + UI_get0_test_string: function (uis: PUI_String): PIdAnsiChar; cdecl = nil; + (* Return the required minimum size of the result *) + UI_get_result_minsize: function (uis: PUI_String): TIdC_INT; cdecl = nil; + (* Return the required maximum size of the result *) + UI_get_result_maxsize: function (uis: PUI_String): TIdC_INT; cdecl = nil; + (* Set the result of a UI_STRING. *) + UI_set_result: function (ui: PUI; uis: PUI_String; const result: PIdAnsiChar): TIdC_INT; cdecl = nil; + UI_set_result_ex: function (ui: PUI; uis: PUI_String; const result: PIdAnsiChar; len: TIdC_INT): TIdC_INT; cdecl = nil; + + (* A couple of popular utility functions *) + UI_UTIL_read_pw_string: function (buf: PIdAnsiChar; length: TIdC_INT; const prompt: PIdAnsiChar; verify: TIdC_INT): TIdC_INT; cdecl = nil; + UI_UTIL_read_pw: function (buf: PIdAnsiChar; buff: PIdAnsiChar; size: TIdC_INT; const prompt: PIdAnsiChar; verify: TIdC_INT): TIdC_INT; cdecl = nil; + UI_UTIL_wrap_read_pem_callback: function (cb: pem_password_cb; rwflag: TIdC_INT): PUI_Method; cdecl = nil; + +{$ELSE} + function UI_new: PUI cdecl; external CLibCrypto; + function UI_new_method(const method: PUI_Method): PUI cdecl; external CLibCrypto; + procedure UI_free(ui: PUI) cdecl; external CLibCrypto; + + (* + * The following functions are used to add strings to be printed and prompt + * strings to prompt for data. The names are UI_{add,dup}__string + * and UI_{add,dup}_input_boolean. + * + * UI_{add,dup}__string have the following meanings: + * add add a text or prompt string. The pointers given to these + * functions are used verbatim, no copying is done. + * dup make a copy of the text or prompt string, then add the copy + * to the collection of strings in the user interface. + * + * The function is a name for the functionality that the given + * string shall be used for. It can be one of: + * input use the string as data prompt. + * verify use the string as verification prompt. This + * is used to verify a previous input. + * info use the string for informational output. + * error use the string for error output. + * Honestly, there's currently no difference between info and error for the + * moment. + * + * UI_{add,dup}_input_boolean have the same semantics for "add" and "dup", + * and are typically used when one wants to prompt for a yes/no response. + * + * All of the functions in this group take a UI and a prompt string. + * The string input and verify addition functions also take a flag argument, + * a buffer for the result to end up with, a minimum input size and a maximum + * input size (the result buffer MUST be large enough to be able to contain + * the maximum number of characters). Additionally, the verify addition + * functions takes another buffer to compare the result against. + * The boolean input functions take an action description string (which should + * be safe to ignore if the expected user action is obvious, for example with + * a dialog box with an OK button and a Cancel button), a string of acceptable + * characters to mean OK and to mean Cancel. The two last strings are checked + * to make sure they don't have common characters. Additionally, the same + * flag argument as for the string input is taken, as well as a result buffer. + * The result buffer is required to be at least one byte long. Depending on + * the answer, the first character from the OK or the Cancel character strings + * will be stored in the first byte of the result buffer. No NUL will be + * added, so the result is *not* a string. + * + * On success, the all return an index of the added information. That index + * is useful when retrieving results with UI_get0_result(). *) + + function UI_add_input_string(ui: PUI; const prompt: PIdAnsiChar; flags: TIdC_INT; result_buf: PIdAnsiChar; minsize: TIdC_INT; maxsize: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function UI_dup_input_string(ui: PUI; const prompt: PIdAnsiChar; flags: TIdC_INT; result_buf: PIdAnsiChar; minsize: TIdC_INT; maxsize: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function UI_add_verify_string(ui: PUI; const prompt: PIdAnsiChar; flags: TIdC_INT; result_buf: PIdAnsiChar; minsize: TIdC_INT; maxsize: TIdC_INT; const test_buf: PIdAnsiChar): TIdC_INT cdecl; external CLibCrypto; + function UI_dup_verify_string(ui: PUI; const prompt: PIdAnsiChar; flags: TIdC_INT; result_buf: PIdAnsiChar; minsize: TIdC_INT; maxsize: TIdC_INT; const test_buf: PIdAnsiChar): TIdC_INT cdecl; external CLibCrypto; + function UI_add_input_boolean(ui: PUI; const prompt: PIdAnsiChar; const action_desc: PIdAnsiChar; const ok_chars: PIdAnsiChar; const cancel_chars: PIdAnsiChar; flags: TIdC_INT; result_buf: PIdAnsiChar): TIdC_INT cdecl; external CLibCrypto; + function UI_dup_input_boolean(ui: PUI; const prompt: PIdAnsiChar; const action_desc: PIdAnsiChar; const ok_chars: PIdAnsiChar; const cancel_chars: PIdAnsiChar; flags: TIdC_INT; result_buf: PIdAnsiChar): TIdC_INT cdecl; external CLibCrypto; + function UI_add_info_string(ui: PUI; const text: PIdAnsiChar): TIdC_INT cdecl; external CLibCrypto; + function UI_dup_info_string(ui: PUI; const text: PIdAnsiChar): TIdC_INT cdecl; external CLibCrypto; + function UI_add_error_string(ui: PUI; const text: PIdAnsiChar): TIdC_INT cdecl; external CLibCrypto; + function UI_dup_error_string(ui: PUI; const text: PIdAnsiChar): TIdC_INT cdecl; external CLibCrypto; + + (* + * The following function helps construct a prompt. object_desc is a + * textual short description of the object, for example "pass phrase", + * and object_name is the name of the object (might be a card name or + * a file name. + * The returned string shall always be allocated on the heap with + * OPENSSL_malloc(), and need to be free'd with OPENSSL_free(). + * + * If the ui_method doesn't contain a pointer to a user-defined prompt + * constructor, a default string is built, looking like this: + * + * "Enter {object_desc} for {object_name}:" + * + * So, if object_desc has the value "pass phrase" and object_name has + * the value "foo.key", the resulting string is: + * + * "Enter pass phrase for foo.key:" + *) + function UI_construct_prompt(ui_method: PUI; const object_desc: PIdAnsiChar; const object_name: PIdAnsiChar): PIdAnsiChar cdecl; external CLibCrypto; + + (* + * The following function is used to store a pointer to user-specific data. + * Any previous such pointer will be returned and replaced. + * + * For callback purposes, this function makes a lot more sense than using + * ex_data, since the latter requires that different parts of OpenSSL or + * applications share the same ex_data index. + * + * Note that the UI_OpenSSL() method completely ignores the user data. Other + * methods may not, however. + *) + function UI_add_user_data(ui: PUI; user_data: Pointer): Pointer cdecl; external CLibCrypto; + (* + * Alternatively, this function is used to duplicate the user data. + * This uses the duplicator method function. The destroy function will + * be used to free the user data in this case. + *) + function UI_dup_user_data(ui: PUI; user_data: Pointer): TIdC_INT cdecl; external CLibCrypto; + (* We need a user data retrieving function as well. *) + function UI_get0_user_data(ui: PUI): Pointer cdecl; external CLibCrypto; + + (* Return the result associated with a prompt given with the index i. *) + function UI_get0_result(ui: PUI; i: TIdC_INT): PIdAnsiChar cdecl; external CLibCrypto; + function UI_get_result_length(ui: PUI; i: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + + (* When all strings have been added, process the whole thing. *) + function UI_process(ui: PUI): TIdC_INT cdecl; external CLibCrypto; + + (* + * Give a user interface parameterised control commands. This can be used to + * send down an integer, a data pointer or a function pointer, as well as be + * used to get information from a UI. + *) + function UI_ctrl(ui: PUI; cmd: TIdC_INT; i: TIdC_LONG; p: Pointer; f: UI_ctrl_f): TIdC_INT cdecl; external CLibCrypto; + + + (* Some methods may use extra data *) + //# define UI_set_app_data(s,arg) UI_set_ex_data(s,0,arg) + //# define UI_get_app_data(s) UI_get_ex_data(s,0) + + //# define UI_get_ex_new_index(l, p, newf, dupf, freef) \ + // CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_UI, l, p, newf, dupf, freef) + function UI_set_ex_data(r: PUI; idx: TIdC_INT; arg: Pointer): TIdC_INT cdecl; external CLibCrypto; + function UI_get_ex_data(r: PUI; idx: TIdC_INT): Pointer cdecl; external CLibCrypto; + + (* Use specific methods instead of the built-in one *) + procedure UI_set_default_method(const meth: PUI_Method) cdecl; external CLibCrypto; + function UI_get_default_method: PUI_METHOD cdecl; external CLibCrypto; + function UI_get_method(ui: PUI): PUI_METHOD cdecl; external CLibCrypto; + function UI_set_method(ui: PUI; const meth: PUI_METHOD): PUI_METHOD cdecl; external CLibCrypto; + + (* The method with all the built-in thingies *) + function UI_OpenSSL: PUI_Method cdecl; external CLibCrypto; + + (* + * NULL method. Literally does nothing, but may serve as a placeholder + * to avoid internal default. + *) + function UI_null: PUI_METHOD cdecl; external CLibCrypto; + + (* ---------- For method writers ---------- *) + (* + A method contains a number of functions that implement the low level + of the User Interface. The functions are: + + an opener This function starts a session, maybe by opening + a channel to a tty, or by opening a window. + a writer This function is called to write a given string, + maybe to the tty, maybe as a field label in a + window. + a flusher This function is called to flush everything that + has been output so far. It can be used to actually + display a dialog box after it has been built. + a reader This function is called to read a given prompt, + maybe from the tty, maybe from a field in a + window. Note that it's called with all string + structures, not only the prompt ones, so it must + check such things itself. + a closer This function closes the session, maybe by closing + the channel to the tty, or closing the window. + + All these functions are expected to return: + + 0 on error. + 1 on success. + -1 on out-of-band events, for example if some prompting has + been canceled (by pressing Ctrl-C, for example). This is + only checked when returned by the flusher or the reader. + + The way this is used, the opener is first called, then the writer for all + strings, then the flusher, then the reader for all strings and finally the + closer. Note that if you want to prompt from a terminal or other command + line interface, the best is to have the reader also write the prompts + instead of having the writer do it. If you want to prompt from a dialog + box, the writer can be used to build up the contents of the box, and the + flusher to actually display the box and run the event loop until all data + has been given, after which the reader only grabs the given data and puts + them back into the UI strings. + + All method functions take a UI as argument. Additionally, the writer and + the reader take a UI_STRING. + *) + + function UI_create_method(const name: PIdAnsiChar): PUI_Method cdecl; external CLibCrypto; + procedure UI_destroy_method(ui_method: PUI_Method) cdecl; external CLibCrypto; + + function UI_method_set_opener(method: PUI_Method; opener: UI_method_opener_cb): TIdC_INT cdecl; external CLibCrypto; + function UI_method_set_writer(method: PUI_Method; writer: UI_method_writer_cb): TIdC_INT cdecl; external CLibCrypto; + function UI_method_set_flusher(method: PUI_Method; flusher: UI_method_flusher_cb): TIdC_INT cdecl; external CLibCrypto; + function UI_method_set_reader(method: PUI_Method; reader: UI_method_reader_cb): TIdC_INT cdecl; external CLibCrypto; + function UI_method_set_closer(method: PUI_Method; closer: UI_method_closer_cb): TIdC_INT cdecl; external CLibCrypto; + function UI_method_set_data_duplicator(method: PUI_Method; duplicator: UI_method_data_duplicator_cb; destructor_: UI_method_data_destructor_cb): TIdC_INT cdecl; external CLibCrypto; + function UI_method_set_prompt_constructor(method: PUI_Method; prompt_constructor: UI_method_prompt_constructor_cb): TIdC_INT cdecl; external CLibCrypto; + function UI_method_set_ex_data(method: PUI_Method; idx: TIdC_INT; data: Pointer): TIdC_INT cdecl; external CLibCrypto; + + function UI_method_get_opener(const method: PUI_METHOD): UI_method_opener_cb cdecl; external CLibCrypto; + function UI_method_get_writer(const method: PUI_METHOD): UI_method_writer_cb cdecl; external CLibCrypto; + function UI_method_get_flusher(const method: PUI_METHOD): UI_method_flusher_cb cdecl; external CLibCrypto; + function UI_method_get_reader(const method: PUI_METHOD): UI_method_reader_cb cdecl; external CLibCrypto; + function UI_method_get_closer(const method: PUI_METHOD): UI_method_closer_cb cdecl; external CLibCrypto; + function UI_method_get_prompt_constructor(const method: PUI_METHOD): UI_method_prompt_constructor_cb cdecl; external CLibCrypto; + function UI_method_get_data_duplicator(const method: PUI_METHOD): UI_method_data_duplicator_cb cdecl; external CLibCrypto; + function UI_method_get_data_destructor(const method: PUI_METHOD): UI_method_data_destructor_cb cdecl; external CLibCrypto; + function UI_method_get_ex_data(const method: PUI_METHOD; idx: TIdC_INT): Pointer cdecl; external CLibCrypto; + + (* + * The following functions are helpers for method writers to access relevant + * data from a UI_STRING. + *) + + (* Return type of the UI_STRING *) + function UI_get_string_type(uis: PUI_String): UI_string_types cdecl; external CLibCrypto; + (* Return input flags of the UI_STRING *) + function UI_get_input_flags(uis: PUI_String): TIdC_INT cdecl; external CLibCrypto; + (* Return the actual string to output (the prompt, info or error) *) + function UI_get0_output_string(uis: PUI_String): PIdAnsiChar cdecl; external CLibCrypto; + (* + * Return the optional action string to output (the boolean prompt + * instruction) + *) + function UI_get0_action_string(uis: PUI_String): PIdAnsiChar cdecl; external CLibCrypto; + (* Return the result of a prompt *) + function UI_get0_result_string(uis: PUI_String): PIdAnsiChar cdecl; external CLibCrypto; + function UI_get_result_string_length(uis: PUI_String): TIdC_INT cdecl; external CLibCrypto; + (* + * Return the string to test the result against. Only useful with verifies. + *) + function UI_get0_test_string(uis: PUI_String): PIdAnsiChar cdecl; external CLibCrypto; + (* Return the required minimum size of the result *) + function UI_get_result_minsize(uis: PUI_String): TIdC_INT cdecl; external CLibCrypto; + (* Return the required maximum size of the result *) + function UI_get_result_maxsize(uis: PUI_String): TIdC_INT cdecl; external CLibCrypto; + (* Set the result of a UI_STRING. *) + function UI_set_result(ui: PUI; uis: PUI_String; const result: PIdAnsiChar): TIdC_INT cdecl; external CLibCrypto; + function UI_set_result_ex(ui: PUI; uis: PUI_String; const result: PIdAnsiChar; len: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + + (* A couple of popular utility functions *) + function UI_UTIL_read_pw_string(buf: PIdAnsiChar; length: TIdC_INT; const prompt: PIdAnsiChar; verify: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function UI_UTIL_read_pw(buf: PIdAnsiChar; buff: PIdAnsiChar; size: TIdC_INT; const prompt: PIdAnsiChar; verify: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function UI_UTIL_wrap_read_pem_callback(cb: pem_password_cb; rwflag: TIdC_INT): PUI_Method cdecl; external CLibCrypto; + +{$ENDIF} + +implementation + + uses + classes, + IdSSLOpenSSLExceptionHandlers, + IdResourceStringsOpenSSL + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + ,IdSSLOpenSSLLoader + {$ENDIF}; + + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +const + UI_new_procname = 'UI_new'; + UI_new_method_procname = 'UI_new_method'; + UI_free_procname = 'UI_free'; + + (* + * The following functions are used to add strings to be printed and prompt + * strings to prompt for data. The names are UI_{add,dup}__string + * and UI_{add,dup}_input_boolean. + * + * UI_{add,dup}__string have the following meanings: + * add add a text or prompt string. The pointers given to these + * functions are used verbatim, no copying is done. + * dup make a copy of the text or prompt string, then add the copy + * to the collection of strings in the user interface. + * + * The function is a name for the functionality that the given + * string shall be used for. It can be one of: + * input use the string as data prompt. + * verify use the string as verification prompt. This + * is used to verify a previous input. + * info use the string for informational output. + * error use the string for error output. + * Honestly, there's currently no difference between info and error for the + * moment. + * + * UI_{add,dup}_input_boolean have the same semantics for "add" and "dup", + * and are typically used when one wants to prompt for a yes/no response. + * + * All of the functions in this group take a UI and a prompt string. + * The string input and verify addition functions also take a flag argument, + * a buffer for the result to end up with, a minimum input size and a maximum + * input size (the result buffer MUST be large enough to be able to contain + * the maximum number of characters). Additionally, the verify addition + * functions takes another buffer to compare the result against. + * The boolean input functions take an action description string (which should + * be safe to ignore if the expected user action is obvious, for example with + * a dialog box with an OK button and a Cancel button), a string of acceptable + * characters to mean OK and to mean Cancel. The two last strings are checked + * to make sure they don't have common characters. Additionally, the same + * flag argument as for the string input is taken, as well as a result buffer. + * The result buffer is required to be at least one byte long. Depending on + * the answer, the first character from the OK or the Cancel character strings + * will be stored in the first byte of the result buffer. No NUL will be + * added, so the result is *not* a string. + * + * On success, the all return an index of the added information. That index + * is useful when retrieving results with UI_get0_result(). *) + + UI_add_input_string_procname = 'UI_add_input_string'; + UI_dup_input_string_procname = 'UI_dup_input_string'; + UI_add_verify_string_procname = 'UI_add_verify_string'; + UI_dup_verify_string_procname = 'UI_dup_verify_string'; + UI_add_input_boolean_procname = 'UI_add_input_boolean'; + UI_dup_input_boolean_procname = 'UI_dup_input_boolean'; + UI_add_info_string_procname = 'UI_add_info_string'; + UI_dup_info_string_procname = 'UI_dup_info_string'; + UI_add_error_string_procname = 'UI_add_error_string'; + UI_dup_error_string_procname = 'UI_dup_error_string'; + + (* + * The following function helps construct a prompt. object_desc is a + * textual short description of the object, for example "pass phrase", + * and object_name is the name of the object (might be a card name or + * a file name. + * The returned string shall always be allocated on the heap with + * OPENSSL_malloc(), and need to be free'd with OPENSSL_free(). + * + * If the ui_method doesn't contain a pointer to a user-defined prompt + * constructor, a default string is built, looking like this: + * + * "Enter {object_desc} for {object_name}:" + * + * So, if object_desc has the value "pass phrase" and object_name has + * the value "foo.key", the resulting string is: + * + * "Enter pass phrase for foo.key:" + *) + UI_construct_prompt_procname = 'UI_construct_prompt'; + + (* + * The following function is used to store a pointer to user-specific data. + * Any previous such pointer will be returned and replaced. + * + * For callback purposes, this function makes a lot more sense than using + * ex_data, since the latter requires that different parts of OpenSSL or + * applications share the same ex_data index. + * + * Note that the UI_OpenSSL() method completely ignores the user data. Other + * methods may not, however. + *) + UI_add_user_data_procname = 'UI_add_user_data'; + (* + * Alternatively, this function is used to duplicate the user data. + * This uses the duplicator method function. The destroy function will + * be used to free the user data in this case. + *) + UI_dup_user_data_procname = 'UI_dup_user_data'; + (* We need a user data retrieving function as well. *) + UI_get0_user_data_procname = 'UI_get0_user_data'; + + (* Return the result associated with a prompt given with the index i. *) + UI_get0_result_procname = 'UI_get0_result'; + UI_get_result_length_procname = 'UI_get_result_length'; + + (* When all strings have been added, process the whole thing. *) + UI_process_procname = 'UI_process'; + + (* + * Give a user interface parameterised control commands. This can be used to + * send down an integer, a data pointer or a function pointer, as well as be + * used to get information from a UI. + *) + UI_ctrl_procname = 'UI_ctrl'; + + + (* Some methods may use extra data *) + //# define UI_set_app_data(s,arg) UI_set_ex_data(s,0,arg) + //# define UI_get_app_data(s) UI_get_ex_data(s,0) + + //# define UI_get_ex_new_index(l, p, newf, dupf, freef) \ + // CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_UI, l, p, newf, dupf, freef) + UI_set_ex_data_procname = 'UI_set_ex_data'; + UI_get_ex_data_procname = 'UI_get_ex_data'; + + (* Use specific methods instead of the built-in one *) + UI_set_default_method_procname = 'UI_set_default_method'; + UI_get_default_method_procname = 'UI_get_default_method'; + UI_get_method_procname = 'UI_get_method'; + UI_set_method_procname = 'UI_set_method'; + + (* The method with all the built-in thingies *) + UI_OpenSSL_procname = 'UI_OpenSSL'; + + (* + * NULL method. Literally does nothing, but may serve as a placeholder + * to avoid internal default. + *) + UI_null_procname = 'UI_null'; + + (* ---------- For method writers ---------- *) + (* + A method contains a number of functions that implement the low level + of the User Interface. The functions are: + + an opener This function starts a session, maybe by opening + a channel to a tty, or by opening a window. + a writer This function is called to write a given string, + maybe to the tty, maybe as a field label in a + window. + a flusher This function is called to flush everything that + has been output so far. It can be used to actually + display a dialog box after it has been built. + a reader This function is called to read a given prompt, + maybe from the tty, maybe from a field in a + window. Note that it's called with all string + structures, not only the prompt ones, so it must + check such things itself. + a closer This function closes the session, maybe by closing + the channel to the tty, or closing the window. + + All these functions are expected to return: + + 0 on error. + 1 on success. + -1 on out-of-band events, for example if some prompting has + been canceled (by pressing Ctrl-C, for example). This is + only checked when returned by the flusher or the reader. + + The way this is used, the opener is first called, then the writer for all + strings, then the flusher, then the reader for all strings and finally the + closer. Note that if you want to prompt from a terminal or other command + line interface, the best is to have the reader also write the prompts + instead of having the writer do it. If you want to prompt from a dialog + box, the writer can be used to build up the contents of the box, and the + flusher to actually display the box and run the event loop until all data + has been given, after which the reader only grabs the given data and puts + them back into the UI strings. + + All method functions take a UI as argument. Additionally, the writer and + the reader take a UI_STRING. + *) + + UI_create_method_procname = 'UI_create_method'; + UI_destroy_method_procname = 'UI_destroy_method'; + + UI_method_set_opener_procname = 'UI_method_set_opener'; + UI_method_set_writer_procname = 'UI_method_set_writer'; + UI_method_set_flusher_procname = 'UI_method_set_flusher'; + UI_method_set_reader_procname = 'UI_method_set_reader'; + UI_method_set_closer_procname = 'UI_method_set_closer'; + UI_method_set_data_duplicator_procname = 'UI_method_set_data_duplicator'; + UI_method_set_prompt_constructor_procname = 'UI_method_set_prompt_constructor'; + UI_method_set_ex_data_procname = 'UI_method_set_ex_data'; + + UI_method_get_opener_procname = 'UI_method_get_opener'; + UI_method_get_writer_procname = 'UI_method_get_writer'; + UI_method_get_flusher_procname = 'UI_method_get_flusher'; + UI_method_get_reader_procname = 'UI_method_get_reader'; + UI_method_get_closer_procname = 'UI_method_get_closer'; + UI_method_get_prompt_constructor_procname = 'UI_method_get_prompt_constructor'; + UI_method_get_data_duplicator_procname = 'UI_method_get_data_duplicator'; + UI_method_get_data_destructor_procname = 'UI_method_get_data_destructor'; + UI_method_get_ex_data_procname = 'UI_method_get_ex_data'; + + (* + * The following functions are helpers for method writers to access relevant + * data from a UI_STRING. + *) + + (* Return type of the UI_STRING *) + UI_get_string_type_procname = 'UI_get_string_type'; + (* Return input flags of the UI_STRING *) + UI_get_input_flags_procname = 'UI_get_input_flags'; + (* Return the actual string to output (the prompt, info or error) *) + UI_get0_output_string_procname = 'UI_get0_output_string'; + (* + * Return the optional action string to output (the boolean prompt + * instruction) + *) + UI_get0_action_string_procname = 'UI_get0_action_string'; + (* Return the result of a prompt *) + UI_get0_result_string_procname = 'UI_get0_result_string'; + UI_get_result_string_length_procname = 'UI_get_result_string_length'; + (* + * Return the string to test the result against. Only useful with verifies. + *) + UI_get0_test_string_procname = 'UI_get0_test_string'; + (* Return the required minimum size of the result *) + UI_get_result_minsize_procname = 'UI_get_result_minsize'; + (* Return the required maximum size of the result *) + UI_get_result_maxsize_procname = 'UI_get_result_maxsize'; + (* Set the result of a UI_STRING. *) + UI_set_result_procname = 'UI_set_result'; + UI_set_result_ex_procname = 'UI_set_result_ex'; + + (* A couple of popular utility functions *) + UI_UTIL_read_pw_string_procname = 'UI_UTIL_read_pw_string'; + UI_UTIL_read_pw_procname = 'UI_UTIL_read_pw'; + UI_UTIL_wrap_read_pem_callback_procname = 'UI_UTIL_wrap_read_pem_callback'; + + +{$WARN NO_RETVAL OFF} +function ERR_UI_new: PUI; +begin + EIdAPIFunctionNotPresent.RaiseException(UI_new_procname); +end; + + +function ERR_UI_new_method(const method: PUI_Method): PUI; +begin + EIdAPIFunctionNotPresent.RaiseException(UI_new_method_procname); +end; + + +procedure ERR_UI_free(ui: PUI); +begin + EIdAPIFunctionNotPresent.RaiseException(UI_free_procname); +end; + + + + (* + * The following functions are used to add strings to be printed and prompt + * strings to prompt for data. The names are UI_{add,dup}__string + * and UI_{add,dup}_input_boolean. + * + * UI_{add,dup}__string have the following meanings: + * add add a text or prompt string. The pointers given to these + * functions are used verbatim, no copying is done. + * dup make a copy of the text or prompt string, then add the copy + * to the collection of strings in the user interface. + * + * The function is a name for the functionality that the given + * string shall be used for. It can be one of: + * input use the string as data prompt. + * verify use the string as verification prompt. This + * is used to verify a previous input. + * info use the string for informational output. + * error use the string for error output. + * Honestly, there's currently no difference between info and error for the + * moment. + * + * UI_{add,dup}_input_boolean have the same semantics for "add" and "dup", + * and are typically used when one wants to prompt for a yes/no response. + * + * All of the functions in this group take a UI and a prompt string. + * The string input and verify addition functions also take a flag argument, + * a buffer for the result to end up with, a minimum input size and a maximum + * input size (the result buffer MUST be large enough to be able to contain + * the maximum number of characters). Additionally, the verify addition + * functions takes another buffer to compare the result against. + * The boolean input functions take an action description string (which should + * be safe to ignore if the expected user action is obvious, for example with + * a dialog box with an OK button and a Cancel button), a string of acceptable + * characters to mean OK and to mean Cancel. The two last strings are checked + * to make sure they don't have common characters. Additionally, the same + * flag argument as for the string input is taken, as well as a result buffer. + * The result buffer is required to be at least one byte long. Depending on + * the answer, the first character from the OK or the Cancel character strings + * will be stored in the first byte of the result buffer. No NUL will be + * added, so the result is *not* a string. + * + * On success, the all return an index of the added information. That index + * is useful when retrieving results with UI_get0_result(). *) + +function ERR_UI_add_input_string(ui: PUI; const prompt: PIdAnsiChar; flags: TIdC_INT; result_buf: PIdAnsiChar; minsize: TIdC_INT; maxsize: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(UI_add_input_string_procname); +end; + + +function ERR_UI_dup_input_string(ui: PUI; const prompt: PIdAnsiChar; flags: TIdC_INT; result_buf: PIdAnsiChar; minsize: TIdC_INT; maxsize: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(UI_dup_input_string_procname); +end; + + +function ERR_UI_add_verify_string(ui: PUI; const prompt: PIdAnsiChar; flags: TIdC_INT; result_buf: PIdAnsiChar; minsize: TIdC_INT; maxsize: TIdC_INT; const test_buf: PIdAnsiChar): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(UI_add_verify_string_procname); +end; + + +function ERR_UI_dup_verify_string(ui: PUI; const prompt: PIdAnsiChar; flags: TIdC_INT; result_buf: PIdAnsiChar; minsize: TIdC_INT; maxsize: TIdC_INT; const test_buf: PIdAnsiChar): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(UI_dup_verify_string_procname); +end; + + +function ERR_UI_add_input_boolean(ui: PUI; const prompt: PIdAnsiChar; const action_desc: PIdAnsiChar; const ok_chars: PIdAnsiChar; const cancel_chars: PIdAnsiChar; flags: TIdC_INT; result_buf: PIdAnsiChar): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(UI_add_input_boolean_procname); +end; + + +function ERR_UI_dup_input_boolean(ui: PUI; const prompt: PIdAnsiChar; const action_desc: PIdAnsiChar; const ok_chars: PIdAnsiChar; const cancel_chars: PIdAnsiChar; flags: TIdC_INT; result_buf: PIdAnsiChar): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(UI_dup_input_boolean_procname); +end; + + +function ERR_UI_add_info_string(ui: PUI; const text: PIdAnsiChar): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(UI_add_info_string_procname); +end; + + +function ERR_UI_dup_info_string(ui: PUI; const text: PIdAnsiChar): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(UI_dup_info_string_procname); +end; + + +function ERR_UI_add_error_string(ui: PUI; const text: PIdAnsiChar): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(UI_add_error_string_procname); +end; + + +function ERR_UI_dup_error_string(ui: PUI; const text: PIdAnsiChar): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(UI_dup_error_string_procname); +end; + + + + (* + * The following function helps construct a prompt. object_desc is a + * textual short description of the object, for example "pass phrase", + * and object_name is the name of the object (might be a card name or + * a file name. + * The returned string shall always be allocated on the heap with + * OPENSSL_malloc(), and need to be free'd with OPENSSL_free(). + * + * If the ui_method doesn't contain a pointer to a user-defined prompt + * constructor, a default string is built, looking like this: + * + * "Enter {object_desc} for {object_name}:" + * + * So, if object_desc has the value "pass phrase" and object_name has + * the value "foo.key", the resulting string is: + * + * "Enter pass phrase for foo.key:" + *) +function ERR_UI_construct_prompt(ui_method: PUI; const object_desc: PIdAnsiChar; const object_name: PIdAnsiChar): PIdAnsiChar; +begin + EIdAPIFunctionNotPresent.RaiseException(UI_construct_prompt_procname); +end; + + + + (* + * The following function is used to store a pointer to user-specific data. + * Any previous such pointer will be returned and replaced. + * + * For callback purposes, this function makes a lot more sense than using + * ex_data, since the latter requires that different parts of OpenSSL or + * applications share the same ex_data index. + * + * Note that the UI_OpenSSL() method completely ignores the user data. Other + * methods may not, however. + *) +function ERR_UI_add_user_data(ui: PUI; user_data: Pointer): Pointer; +begin + EIdAPIFunctionNotPresent.RaiseException(UI_add_user_data_procname); +end; + + + (* + * Alternatively, this function is used to duplicate the user data. + * This uses the duplicator method function. The destroy function will + * be used to free the user data in this case. + *) +function ERR_UI_dup_user_data(ui: PUI; user_data: Pointer): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(UI_dup_user_data_procname); +end; + + + (* We need a user data retrieving function as well. *) +function ERR_UI_get0_user_data(ui: PUI): Pointer; +begin + EIdAPIFunctionNotPresent.RaiseException(UI_get0_user_data_procname); +end; + + + + (* Return the result associated with a prompt given with the index i. *) +function ERR_UI_get0_result(ui: PUI; i: TIdC_INT): PIdAnsiChar; +begin + EIdAPIFunctionNotPresent.RaiseException(UI_get0_result_procname); +end; + + +function ERR_UI_get_result_length(ui: PUI; i: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(UI_get_result_length_procname); +end; + + + + (* When all strings have been added, process the whole thing. *) +function ERR_UI_process(ui: PUI): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(UI_process_procname); +end; + + + + (* + * Give a user interface parameterised control commands. This can be used to + * send down an integer, a data pointer or a function pointer, as well as be + * used to get information from a UI. + *) +function ERR_UI_ctrl(ui: PUI; cmd: TIdC_INT; i: TIdC_LONG; p: Pointer; f: UI_ctrl_f): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(UI_ctrl_procname); +end; + + + + + (* Some methods may use extra data *) + //# define UI_set_app_data(s,arg) UI_set_ex_data(s,0,arg) + //# define UI_get_app_data(s) UI_get_ex_data(s,0) + + //# define UI_get_ex_new_index(l, p, newf, dupf, freef) \ + // CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_UI, l, p, newf, dupf, freef) +function ERR_UI_set_ex_data(r: PUI; idx: TIdC_INT; arg: Pointer): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(UI_set_ex_data_procname); +end; + + +function ERR_UI_get_ex_data(r: PUI; idx: TIdC_INT): Pointer; +begin + EIdAPIFunctionNotPresent.RaiseException(UI_get_ex_data_procname); +end; + + + + (* Use specific methods instead of the built-in one *) +procedure ERR_UI_set_default_method(const meth: PUI_Method); +begin + EIdAPIFunctionNotPresent.RaiseException(UI_set_default_method_procname); +end; + + +function ERR_UI_get_default_method: PUI_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(UI_get_default_method_procname); +end; + + +function ERR_UI_get_method(ui: PUI): PUI_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(UI_get_method_procname); +end; + + +function ERR_UI_set_method(ui: PUI; const meth: PUI_METHOD): PUI_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(UI_set_method_procname); +end; + + + + (* The method with all the built-in thingies *) +function ERR_UI_OpenSSL: PUI_Method; +begin + EIdAPIFunctionNotPresent.RaiseException(UI_OpenSSL_procname); +end; + + + + (* + * NULL method. Literally does nothing, but may serve as a placeholder + * to avoid internal default. + *) +function ERR_UI_null: PUI_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(UI_null_procname); +end; + + + + (* ---------- For method writers ---------- *) + (* + A method contains a number of functions that implement the low level + of the User Interface. The functions are: + + an opener This function starts a session, maybe by opening + a channel to a tty, or by opening a window. + a writer This function is called to write a given string, + maybe to the tty, maybe as a field label in a + window. + a flusher This function is called to flush everything that + has been output so far. It can be used to actually + display a dialog box after it has been built. + a reader This function is called to read a given prompt, + maybe from the tty, maybe from a field in a + window. Note that it's called with all string + structures, not only the prompt ones, so it must + check such things itself. + a closer This function closes the session, maybe by closing + the channel to the tty, or closing the window. + + All these functions are expected to return: + + 0 on error. + 1 on success. + -1 on out-of-band events, for example if some prompting has + been canceled (by pressing Ctrl-C, for example). This is + only checked when returned by the flusher or the reader. + + The way this is used, the opener is first called, then the writer for all + strings, then the flusher, then the reader for all strings and finally the + closer. Note that if you want to prompt from a terminal or other command + line interface, the best is to have the reader also write the prompts + instead of having the writer do it. If you want to prompt from a dialog + box, the writer can be used to build up the contents of the box, and the + flusher to actually display the box and run the event loop until all data + has been given, after which the reader only grabs the given data and puts + them back into the UI strings. + + All method functions take a UI as argument. Additionally, the writer and + the reader take a UI_STRING. + *) + +function ERR_UI_create_method(const name: PIdAnsiChar): PUI_Method; +begin + EIdAPIFunctionNotPresent.RaiseException(UI_create_method_procname); +end; + + +procedure ERR_UI_destroy_method(ui_method: PUI_Method); +begin + EIdAPIFunctionNotPresent.RaiseException(UI_destroy_method_procname); +end; + + + +function ERR_UI_method_set_opener(method: PUI_Method; opener: UI_method_opener_cb): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(UI_method_set_opener_procname); +end; + + +function ERR_UI_method_set_writer(method: PUI_Method; writer: UI_method_writer_cb): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(UI_method_set_writer_procname); +end; + + +function ERR_UI_method_set_flusher(method: PUI_Method; flusher: UI_method_flusher_cb): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(UI_method_set_flusher_procname); +end; + + +function ERR_UI_method_set_reader(method: PUI_Method; reader: UI_method_reader_cb): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(UI_method_set_reader_procname); +end; + + +function ERR_UI_method_set_closer(method: PUI_Method; closer: UI_method_closer_cb): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(UI_method_set_closer_procname); +end; + + +function ERR_UI_method_set_data_duplicator(method: PUI_Method; duplicator: UI_method_data_duplicator_cb; destructor_: UI_method_data_destructor_cb): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(UI_method_set_data_duplicator_procname); +end; + + +function ERR_UI_method_set_prompt_constructor(method: PUI_Method; prompt_constructor: UI_method_prompt_constructor_cb): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(UI_method_set_prompt_constructor_procname); +end; + + +function ERR_UI_method_set_ex_data(method: PUI_Method; idx: TIdC_INT; data: Pointer): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(UI_method_set_ex_data_procname); +end; + + + +function ERR_UI_method_get_opener(const method: PUI_METHOD): UI_method_opener_cb; +begin + EIdAPIFunctionNotPresent.RaiseException(UI_method_get_opener_procname); +end; + + +function ERR_UI_method_get_writer(const method: PUI_METHOD): UI_method_writer_cb; +begin + EIdAPIFunctionNotPresent.RaiseException(UI_method_get_writer_procname); +end; + + +function ERR_UI_method_get_flusher(const method: PUI_METHOD): UI_method_flusher_cb; +begin + EIdAPIFunctionNotPresent.RaiseException(UI_method_get_flusher_procname); +end; + + +function ERR_UI_method_get_reader(const method: PUI_METHOD): UI_method_reader_cb; +begin + EIdAPIFunctionNotPresent.RaiseException(UI_method_get_reader_procname); +end; + + +function ERR_UI_method_get_closer(const method: PUI_METHOD): UI_method_closer_cb; +begin + EIdAPIFunctionNotPresent.RaiseException(UI_method_get_closer_procname); +end; + + +function ERR_UI_method_get_prompt_constructor(const method: PUI_METHOD): UI_method_prompt_constructor_cb; +begin + EIdAPIFunctionNotPresent.RaiseException(UI_method_get_prompt_constructor_procname); +end; + + +function ERR_UI_method_get_data_duplicator(const method: PUI_METHOD): UI_method_data_duplicator_cb; +begin + EIdAPIFunctionNotPresent.RaiseException(UI_method_get_data_duplicator_procname); +end; + + +function ERR_UI_method_get_data_destructor(const method: PUI_METHOD): UI_method_data_destructor_cb; +begin + EIdAPIFunctionNotPresent.RaiseException(UI_method_get_data_destructor_procname); +end; + + +function ERR_UI_method_get_ex_data(const method: PUI_METHOD; idx: TIdC_INT): Pointer; +begin + EIdAPIFunctionNotPresent.RaiseException(UI_method_get_ex_data_procname); +end; + + + + (* + * The following functions are helpers for method writers to access relevant + * data from a UI_STRING. + *) + + (* Return type of the UI_STRING *) +function ERR_UI_get_string_type(uis: PUI_String): UI_string_types; +begin + EIdAPIFunctionNotPresent.RaiseException(UI_get_string_type_procname); +end; + + + (* Return input flags of the UI_STRING *) +function ERR_UI_get_input_flags(uis: PUI_String): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(UI_get_input_flags_procname); +end; + + + (* Return the actual string to output (the prompt, info or error) *) +function ERR_UI_get0_output_string(uis: PUI_String): PIdAnsiChar; +begin + EIdAPIFunctionNotPresent.RaiseException(UI_get0_output_string_procname); +end; + + + (* + * Return the optional action string to output (the boolean prompt + * instruction) + *) +function ERR_UI_get0_action_string(uis: PUI_String): PIdAnsiChar; +begin + EIdAPIFunctionNotPresent.RaiseException(UI_get0_action_string_procname); +end; + + + (* Return the result of a prompt *) +function ERR_UI_get0_result_string(uis: PUI_String): PIdAnsiChar; +begin + EIdAPIFunctionNotPresent.RaiseException(UI_get0_result_string_procname); +end; + + +function ERR_UI_get_result_string_length(uis: PUI_String): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(UI_get_result_string_length_procname); +end; + + + (* + * Return the string to test the result against. Only useful with verifies. + *) +function ERR_UI_get0_test_string(uis: PUI_String): PIdAnsiChar; +begin + EIdAPIFunctionNotPresent.RaiseException(UI_get0_test_string_procname); +end; + + + (* Return the required minimum size of the result *) +function ERR_UI_get_result_minsize(uis: PUI_String): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(UI_get_result_minsize_procname); +end; + + + (* Return the required maximum size of the result *) +function ERR_UI_get_result_maxsize(uis: PUI_String): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(UI_get_result_maxsize_procname); +end; + + + (* Set the result of a UI_STRING. *) +function ERR_UI_set_result(ui: PUI; uis: PUI_String; const _result: PIdAnsiChar): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(UI_set_result_procname); +end; + + +function ERR_UI_set_result_ex(ui: PUI; uis: PUI_String; const _result: PIdAnsiChar; len: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(UI_set_result_ex_procname); +end; + + + + (* A couple of popular utility functions *) +function ERR_UI_UTIL_read_pw_string(buf: PIdAnsiChar; length: TIdC_INT; const prompt: PIdAnsiChar; verify: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(UI_UTIL_read_pw_string_procname); +end; + + +function ERR_UI_UTIL_read_pw(buf: PIdAnsiChar; buff: PIdAnsiChar; size: TIdC_INT; const prompt: PIdAnsiChar; verify: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(UI_UTIL_read_pw_procname); +end; + + +function ERR_UI_UTIL_wrap_read_pem_callback(cb: pem_password_cb; rwflag: TIdC_INT): PUI_Method; +begin + EIdAPIFunctionNotPresent.RaiseException(UI_UTIL_wrap_read_pem_callback_procname); +end; + + + +{$WARN NO_RETVAL ON} + +procedure Load(const ADllHandle: TIdLibHandle; LibVersion: TIdC_UINT; const AFailed: TStringList); + +var FuncLoadError: boolean; + +begin + UI_new := LoadLibFunction(ADllHandle, UI_new_procname); + FuncLoadError := not assigned(UI_new); + if FuncLoadError then + begin + {$if not defined(UI_new_allownil)} + UI_new := @ERR_UI_new; + {$ifend} + {$if declared(UI_new_introduced)} + if LibVersion < UI_new_introduced then + begin + {$if declared(FC_UI_new)} + UI_new := @FC_UI_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(UI_new_removed)} + if UI_new_removed <= LibVersion then + begin + {$if declared(_UI_new)} + UI_new := @_UI_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(UI_new_allownil)} + if FuncLoadError then + AFailed.Add('UI_new'); + {$ifend} + end; + + + UI_new_method := LoadLibFunction(ADllHandle, UI_new_method_procname); + FuncLoadError := not assigned(UI_new_method); + if FuncLoadError then + begin + {$if not defined(UI_new_method_allownil)} + UI_new_method := @ERR_UI_new_method; + {$ifend} + {$if declared(UI_new_method_introduced)} + if LibVersion < UI_new_method_introduced then + begin + {$if declared(FC_UI_new_method)} + UI_new_method := @FC_UI_new_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(UI_new_method_removed)} + if UI_new_method_removed <= LibVersion then + begin + {$if declared(_UI_new_method)} + UI_new_method := @_UI_new_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(UI_new_method_allownil)} + if FuncLoadError then + AFailed.Add('UI_new_method'); + {$ifend} + end; + + + UI_free := LoadLibFunction(ADllHandle, UI_free_procname); + FuncLoadError := not assigned(UI_free); + if FuncLoadError then + begin + {$if not defined(UI_free_allownil)} + UI_free := @ERR_UI_free; + {$ifend} + {$if declared(UI_free_introduced)} + if LibVersion < UI_free_introduced then + begin + {$if declared(FC_UI_free)} + UI_free := @FC_UI_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(UI_free_removed)} + if UI_free_removed <= LibVersion then + begin + {$if declared(_UI_free)} + UI_free := @_UI_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(UI_free_allownil)} + if FuncLoadError then + AFailed.Add('UI_free'); + {$ifend} + end; + + + UI_add_input_string := LoadLibFunction(ADllHandle, UI_add_input_string_procname); + FuncLoadError := not assigned(UI_add_input_string); + if FuncLoadError then + begin + {$if not defined(UI_add_input_string_allownil)} + UI_add_input_string := @ERR_UI_add_input_string; + {$ifend} + {$if declared(UI_add_input_string_introduced)} + if LibVersion < UI_add_input_string_introduced then + begin + {$if declared(FC_UI_add_input_string)} + UI_add_input_string := @FC_UI_add_input_string; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(UI_add_input_string_removed)} + if UI_add_input_string_removed <= LibVersion then + begin + {$if declared(_UI_add_input_string)} + UI_add_input_string := @_UI_add_input_string; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(UI_add_input_string_allownil)} + if FuncLoadError then + AFailed.Add('UI_add_input_string'); + {$ifend} + end; + + + UI_dup_input_string := LoadLibFunction(ADllHandle, UI_dup_input_string_procname); + FuncLoadError := not assigned(UI_dup_input_string); + if FuncLoadError then + begin + {$if not defined(UI_dup_input_string_allownil)} + UI_dup_input_string := @ERR_UI_dup_input_string; + {$ifend} + {$if declared(UI_dup_input_string_introduced)} + if LibVersion < UI_dup_input_string_introduced then + begin + {$if declared(FC_UI_dup_input_string)} + UI_dup_input_string := @FC_UI_dup_input_string; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(UI_dup_input_string_removed)} + if UI_dup_input_string_removed <= LibVersion then + begin + {$if declared(_UI_dup_input_string)} + UI_dup_input_string := @_UI_dup_input_string; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(UI_dup_input_string_allownil)} + if FuncLoadError then + AFailed.Add('UI_dup_input_string'); + {$ifend} + end; + + + UI_add_verify_string := LoadLibFunction(ADllHandle, UI_add_verify_string_procname); + FuncLoadError := not assigned(UI_add_verify_string); + if FuncLoadError then + begin + {$if not defined(UI_add_verify_string_allownil)} + UI_add_verify_string := @ERR_UI_add_verify_string; + {$ifend} + {$if declared(UI_add_verify_string_introduced)} + if LibVersion < UI_add_verify_string_introduced then + begin + {$if declared(FC_UI_add_verify_string)} + UI_add_verify_string := @FC_UI_add_verify_string; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(UI_add_verify_string_removed)} + if UI_add_verify_string_removed <= LibVersion then + begin + {$if declared(_UI_add_verify_string)} + UI_add_verify_string := @_UI_add_verify_string; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(UI_add_verify_string_allownil)} + if FuncLoadError then + AFailed.Add('UI_add_verify_string'); + {$ifend} + end; + + + UI_dup_verify_string := LoadLibFunction(ADllHandle, UI_dup_verify_string_procname); + FuncLoadError := not assigned(UI_dup_verify_string); + if FuncLoadError then + begin + {$if not defined(UI_dup_verify_string_allownil)} + UI_dup_verify_string := @ERR_UI_dup_verify_string; + {$ifend} + {$if declared(UI_dup_verify_string_introduced)} + if LibVersion < UI_dup_verify_string_introduced then + begin + {$if declared(FC_UI_dup_verify_string)} + UI_dup_verify_string := @FC_UI_dup_verify_string; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(UI_dup_verify_string_removed)} + if UI_dup_verify_string_removed <= LibVersion then + begin + {$if declared(_UI_dup_verify_string)} + UI_dup_verify_string := @_UI_dup_verify_string; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(UI_dup_verify_string_allownil)} + if FuncLoadError then + AFailed.Add('UI_dup_verify_string'); + {$ifend} + end; + + + UI_add_input_boolean := LoadLibFunction(ADllHandle, UI_add_input_boolean_procname); + FuncLoadError := not assigned(UI_add_input_boolean); + if FuncLoadError then + begin + {$if not defined(UI_add_input_boolean_allownil)} + UI_add_input_boolean := @ERR_UI_add_input_boolean; + {$ifend} + {$if declared(UI_add_input_boolean_introduced)} + if LibVersion < UI_add_input_boolean_introduced then + begin + {$if declared(FC_UI_add_input_boolean)} + UI_add_input_boolean := @FC_UI_add_input_boolean; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(UI_add_input_boolean_removed)} + if UI_add_input_boolean_removed <= LibVersion then + begin + {$if declared(_UI_add_input_boolean)} + UI_add_input_boolean := @_UI_add_input_boolean; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(UI_add_input_boolean_allownil)} + if FuncLoadError then + AFailed.Add('UI_add_input_boolean'); + {$ifend} + end; + + + UI_dup_input_boolean := LoadLibFunction(ADllHandle, UI_dup_input_boolean_procname); + FuncLoadError := not assigned(UI_dup_input_boolean); + if FuncLoadError then + begin + {$if not defined(UI_dup_input_boolean_allownil)} + UI_dup_input_boolean := @ERR_UI_dup_input_boolean; + {$ifend} + {$if declared(UI_dup_input_boolean_introduced)} + if LibVersion < UI_dup_input_boolean_introduced then + begin + {$if declared(FC_UI_dup_input_boolean)} + UI_dup_input_boolean := @FC_UI_dup_input_boolean; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(UI_dup_input_boolean_removed)} + if UI_dup_input_boolean_removed <= LibVersion then + begin + {$if declared(_UI_dup_input_boolean)} + UI_dup_input_boolean := @_UI_dup_input_boolean; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(UI_dup_input_boolean_allownil)} + if FuncLoadError then + AFailed.Add('UI_dup_input_boolean'); + {$ifend} + end; + + + UI_add_info_string := LoadLibFunction(ADllHandle, UI_add_info_string_procname); + FuncLoadError := not assigned(UI_add_info_string); + if FuncLoadError then + begin + {$if not defined(UI_add_info_string_allownil)} + UI_add_info_string := @ERR_UI_add_info_string; + {$ifend} + {$if declared(UI_add_info_string_introduced)} + if LibVersion < UI_add_info_string_introduced then + begin + {$if declared(FC_UI_add_info_string)} + UI_add_info_string := @FC_UI_add_info_string; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(UI_add_info_string_removed)} + if UI_add_info_string_removed <= LibVersion then + begin + {$if declared(_UI_add_info_string)} + UI_add_info_string := @_UI_add_info_string; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(UI_add_info_string_allownil)} + if FuncLoadError then + AFailed.Add('UI_add_info_string'); + {$ifend} + end; + + + UI_dup_info_string := LoadLibFunction(ADllHandle, UI_dup_info_string_procname); + FuncLoadError := not assigned(UI_dup_info_string); + if FuncLoadError then + begin + {$if not defined(UI_dup_info_string_allownil)} + UI_dup_info_string := @ERR_UI_dup_info_string; + {$ifend} + {$if declared(UI_dup_info_string_introduced)} + if LibVersion < UI_dup_info_string_introduced then + begin + {$if declared(FC_UI_dup_info_string)} + UI_dup_info_string := @FC_UI_dup_info_string; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(UI_dup_info_string_removed)} + if UI_dup_info_string_removed <= LibVersion then + begin + {$if declared(_UI_dup_info_string)} + UI_dup_info_string := @_UI_dup_info_string; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(UI_dup_info_string_allownil)} + if FuncLoadError then + AFailed.Add('UI_dup_info_string'); + {$ifend} + end; + + + UI_add_error_string := LoadLibFunction(ADllHandle, UI_add_error_string_procname); + FuncLoadError := not assigned(UI_add_error_string); + if FuncLoadError then + begin + {$if not defined(UI_add_error_string_allownil)} + UI_add_error_string := @ERR_UI_add_error_string; + {$ifend} + {$if declared(UI_add_error_string_introduced)} + if LibVersion < UI_add_error_string_introduced then + begin + {$if declared(FC_UI_add_error_string)} + UI_add_error_string := @FC_UI_add_error_string; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(UI_add_error_string_removed)} + if UI_add_error_string_removed <= LibVersion then + begin + {$if declared(_UI_add_error_string)} + UI_add_error_string := @_UI_add_error_string; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(UI_add_error_string_allownil)} + if FuncLoadError then + AFailed.Add('UI_add_error_string'); + {$ifend} + end; + + + UI_dup_error_string := LoadLibFunction(ADllHandle, UI_dup_error_string_procname); + FuncLoadError := not assigned(UI_dup_error_string); + if FuncLoadError then + begin + {$if not defined(UI_dup_error_string_allownil)} + UI_dup_error_string := @ERR_UI_dup_error_string; + {$ifend} + {$if declared(UI_dup_error_string_introduced)} + if LibVersion < UI_dup_error_string_introduced then + begin + {$if declared(FC_UI_dup_error_string)} + UI_dup_error_string := @FC_UI_dup_error_string; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(UI_dup_error_string_removed)} + if UI_dup_error_string_removed <= LibVersion then + begin + {$if declared(_UI_dup_error_string)} + UI_dup_error_string := @_UI_dup_error_string; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(UI_dup_error_string_allownil)} + if FuncLoadError then + AFailed.Add('UI_dup_error_string'); + {$ifend} + end; + + + UI_construct_prompt := LoadLibFunction(ADllHandle, UI_construct_prompt_procname); + FuncLoadError := not assigned(UI_construct_prompt); + if FuncLoadError then + begin + {$if not defined(UI_construct_prompt_allownil)} + UI_construct_prompt := @ERR_UI_construct_prompt; + {$ifend} + {$if declared(UI_construct_prompt_introduced)} + if LibVersion < UI_construct_prompt_introduced then + begin + {$if declared(FC_UI_construct_prompt)} + UI_construct_prompt := @FC_UI_construct_prompt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(UI_construct_prompt_removed)} + if UI_construct_prompt_removed <= LibVersion then + begin + {$if declared(_UI_construct_prompt)} + UI_construct_prompt := @_UI_construct_prompt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(UI_construct_prompt_allownil)} + if FuncLoadError then + AFailed.Add('UI_construct_prompt'); + {$ifend} + end; + + + UI_add_user_data := LoadLibFunction(ADllHandle, UI_add_user_data_procname); + FuncLoadError := not assigned(UI_add_user_data); + if FuncLoadError then + begin + {$if not defined(UI_add_user_data_allownil)} + UI_add_user_data := @ERR_UI_add_user_data; + {$ifend} + {$if declared(UI_add_user_data_introduced)} + if LibVersion < UI_add_user_data_introduced then + begin + {$if declared(FC_UI_add_user_data)} + UI_add_user_data := @FC_UI_add_user_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(UI_add_user_data_removed)} + if UI_add_user_data_removed <= LibVersion then + begin + {$if declared(_UI_add_user_data)} + UI_add_user_data := @_UI_add_user_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(UI_add_user_data_allownil)} + if FuncLoadError then + AFailed.Add('UI_add_user_data'); + {$ifend} + end; + + + UI_dup_user_data := LoadLibFunction(ADllHandle, UI_dup_user_data_procname); + FuncLoadError := not assigned(UI_dup_user_data); + if FuncLoadError then + begin + {$if not defined(UI_dup_user_data_allownil)} + UI_dup_user_data := @ERR_UI_dup_user_data; + {$ifend} + {$if declared(UI_dup_user_data_introduced)} + if LibVersion < UI_dup_user_data_introduced then + begin + {$if declared(FC_UI_dup_user_data)} + UI_dup_user_data := @FC_UI_dup_user_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(UI_dup_user_data_removed)} + if UI_dup_user_data_removed <= LibVersion then + begin + {$if declared(_UI_dup_user_data)} + UI_dup_user_data := @_UI_dup_user_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(UI_dup_user_data_allownil)} + if FuncLoadError then + AFailed.Add('UI_dup_user_data'); + {$ifend} + end; + + + UI_get0_user_data := LoadLibFunction(ADllHandle, UI_get0_user_data_procname); + FuncLoadError := not assigned(UI_get0_user_data); + if FuncLoadError then + begin + {$if not defined(UI_get0_user_data_allownil)} + UI_get0_user_data := @ERR_UI_get0_user_data; + {$ifend} + {$if declared(UI_get0_user_data_introduced)} + if LibVersion < UI_get0_user_data_introduced then + begin + {$if declared(FC_UI_get0_user_data)} + UI_get0_user_data := @FC_UI_get0_user_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(UI_get0_user_data_removed)} + if UI_get0_user_data_removed <= LibVersion then + begin + {$if declared(_UI_get0_user_data)} + UI_get0_user_data := @_UI_get0_user_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(UI_get0_user_data_allownil)} + if FuncLoadError then + AFailed.Add('UI_get0_user_data'); + {$ifend} + end; + + + UI_get0_result := LoadLibFunction(ADllHandle, UI_get0_result_procname); + FuncLoadError := not assigned(UI_get0_result); + if FuncLoadError then + begin + {$if not defined(UI_get0_result_allownil)} + UI_get0_result := @ERR_UI_get0_result; + {$ifend} + {$if declared(UI_get0_result_introduced)} + if LibVersion < UI_get0_result_introduced then + begin + {$if declared(FC_UI_get0_result)} + UI_get0_result := @FC_UI_get0_result; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(UI_get0_result_removed)} + if UI_get0_result_removed <= LibVersion then + begin + {$if declared(_UI_get0_result)} + UI_get0_result := @_UI_get0_result; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(UI_get0_result_allownil)} + if FuncLoadError then + AFailed.Add('UI_get0_result'); + {$ifend} + end; + + + UI_get_result_length := LoadLibFunction(ADllHandle, UI_get_result_length_procname); + FuncLoadError := not assigned(UI_get_result_length); + if FuncLoadError then + begin + {$if not defined(UI_get_result_length_allownil)} + UI_get_result_length := @ERR_UI_get_result_length; + {$ifend} + {$if declared(UI_get_result_length_introduced)} + if LibVersion < UI_get_result_length_introduced then + begin + {$if declared(FC_UI_get_result_length)} + UI_get_result_length := @FC_UI_get_result_length; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(UI_get_result_length_removed)} + if UI_get_result_length_removed <= LibVersion then + begin + {$if declared(_UI_get_result_length)} + UI_get_result_length := @_UI_get_result_length; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(UI_get_result_length_allownil)} + if FuncLoadError then + AFailed.Add('UI_get_result_length'); + {$ifend} + end; + + + UI_process := LoadLibFunction(ADllHandle, UI_process_procname); + FuncLoadError := not assigned(UI_process); + if FuncLoadError then + begin + {$if not defined(UI_process_allownil)} + UI_process := @ERR_UI_process; + {$ifend} + {$if declared(UI_process_introduced)} + if LibVersion < UI_process_introduced then + begin + {$if declared(FC_UI_process)} + UI_process := @FC_UI_process; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(UI_process_removed)} + if UI_process_removed <= LibVersion then + begin + {$if declared(_UI_process)} + UI_process := @_UI_process; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(UI_process_allownil)} + if FuncLoadError then + AFailed.Add('UI_process'); + {$ifend} + end; + + + UI_ctrl := LoadLibFunction(ADllHandle, UI_ctrl_procname); + FuncLoadError := not assigned(UI_ctrl); + if FuncLoadError then + begin + {$if not defined(UI_ctrl_allownil)} + UI_ctrl := @ERR_UI_ctrl; + {$ifend} + {$if declared(UI_ctrl_introduced)} + if LibVersion < UI_ctrl_introduced then + begin + {$if declared(FC_UI_ctrl)} + UI_ctrl := @FC_UI_ctrl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(UI_ctrl_removed)} + if UI_ctrl_removed <= LibVersion then + begin + {$if declared(_UI_ctrl)} + UI_ctrl := @_UI_ctrl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(UI_ctrl_allownil)} + if FuncLoadError then + AFailed.Add('UI_ctrl'); + {$ifend} + end; + + + UI_set_ex_data := LoadLibFunction(ADllHandle, UI_set_ex_data_procname); + FuncLoadError := not assigned(UI_set_ex_data); + if FuncLoadError then + begin + {$if not defined(UI_set_ex_data_allownil)} + UI_set_ex_data := @ERR_UI_set_ex_data; + {$ifend} + {$if declared(UI_set_ex_data_introduced)} + if LibVersion < UI_set_ex_data_introduced then + begin + {$if declared(FC_UI_set_ex_data)} + UI_set_ex_data := @FC_UI_set_ex_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(UI_set_ex_data_removed)} + if UI_set_ex_data_removed <= LibVersion then + begin + {$if declared(_UI_set_ex_data)} + UI_set_ex_data := @_UI_set_ex_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(UI_set_ex_data_allownil)} + if FuncLoadError then + AFailed.Add('UI_set_ex_data'); + {$ifend} + end; + + + UI_get_ex_data := LoadLibFunction(ADllHandle, UI_get_ex_data_procname); + FuncLoadError := not assigned(UI_get_ex_data); + if FuncLoadError then + begin + {$if not defined(UI_get_ex_data_allownil)} + UI_get_ex_data := @ERR_UI_get_ex_data; + {$ifend} + {$if declared(UI_get_ex_data_introduced)} + if LibVersion < UI_get_ex_data_introduced then + begin + {$if declared(FC_UI_get_ex_data)} + UI_get_ex_data := @FC_UI_get_ex_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(UI_get_ex_data_removed)} + if UI_get_ex_data_removed <= LibVersion then + begin + {$if declared(_UI_get_ex_data)} + UI_get_ex_data := @_UI_get_ex_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(UI_get_ex_data_allownil)} + if FuncLoadError then + AFailed.Add('UI_get_ex_data'); + {$ifend} + end; + + + UI_set_default_method := LoadLibFunction(ADllHandle, UI_set_default_method_procname); + FuncLoadError := not assigned(UI_set_default_method); + if FuncLoadError then + begin + {$if not defined(UI_set_default_method_allownil)} + UI_set_default_method := @ERR_UI_set_default_method; + {$ifend} + {$if declared(UI_set_default_method_introduced)} + if LibVersion < UI_set_default_method_introduced then + begin + {$if declared(FC_UI_set_default_method)} + UI_set_default_method := @FC_UI_set_default_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(UI_set_default_method_removed)} + if UI_set_default_method_removed <= LibVersion then + begin + {$if declared(_UI_set_default_method)} + UI_set_default_method := @_UI_set_default_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(UI_set_default_method_allownil)} + if FuncLoadError then + AFailed.Add('UI_set_default_method'); + {$ifend} + end; + + + UI_get_default_method := LoadLibFunction(ADllHandle, UI_get_default_method_procname); + FuncLoadError := not assigned(UI_get_default_method); + if FuncLoadError then + begin + {$if not defined(UI_get_default_method_allownil)} + UI_get_default_method := @ERR_UI_get_default_method; + {$ifend} + {$if declared(UI_get_default_method_introduced)} + if LibVersion < UI_get_default_method_introduced then + begin + {$if declared(FC_UI_get_default_method)} + UI_get_default_method := @FC_UI_get_default_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(UI_get_default_method_removed)} + if UI_get_default_method_removed <= LibVersion then + begin + {$if declared(_UI_get_default_method)} + UI_get_default_method := @_UI_get_default_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(UI_get_default_method_allownil)} + if FuncLoadError then + AFailed.Add('UI_get_default_method'); + {$ifend} + end; + + + UI_get_method := LoadLibFunction(ADllHandle, UI_get_method_procname); + FuncLoadError := not assigned(UI_get_method); + if FuncLoadError then + begin + {$if not defined(UI_get_method_allownil)} + UI_get_method := @ERR_UI_get_method; + {$ifend} + {$if declared(UI_get_method_introduced)} + if LibVersion < UI_get_method_introduced then + begin + {$if declared(FC_UI_get_method)} + UI_get_method := @FC_UI_get_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(UI_get_method_removed)} + if UI_get_method_removed <= LibVersion then + begin + {$if declared(_UI_get_method)} + UI_get_method := @_UI_get_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(UI_get_method_allownil)} + if FuncLoadError then + AFailed.Add('UI_get_method'); + {$ifend} + end; + + + UI_set_method := LoadLibFunction(ADllHandle, UI_set_method_procname); + FuncLoadError := not assigned(UI_set_method); + if FuncLoadError then + begin + {$if not defined(UI_set_method_allownil)} + UI_set_method := @ERR_UI_set_method; + {$ifend} + {$if declared(UI_set_method_introduced)} + if LibVersion < UI_set_method_introduced then + begin + {$if declared(FC_UI_set_method)} + UI_set_method := @FC_UI_set_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(UI_set_method_removed)} + if UI_set_method_removed <= LibVersion then + begin + {$if declared(_UI_set_method)} + UI_set_method := @_UI_set_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(UI_set_method_allownil)} + if FuncLoadError then + AFailed.Add('UI_set_method'); + {$ifend} + end; + + + UI_OpenSSL := LoadLibFunction(ADllHandle, UI_OpenSSL_procname); + FuncLoadError := not assigned(UI_OpenSSL); + if FuncLoadError then + begin + {$if not defined(UI_OpenSSL_allownil)} + UI_OpenSSL := @ERR_UI_OpenSSL; + {$ifend} + {$if declared(UI_OpenSSL_introduced)} + if LibVersion < UI_OpenSSL_introduced then + begin + {$if declared(FC_UI_OpenSSL)} + UI_OpenSSL := @FC_UI_OpenSSL; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(UI_OpenSSL_removed)} + if UI_OpenSSL_removed <= LibVersion then + begin + {$if declared(_UI_OpenSSL)} + UI_OpenSSL := @_UI_OpenSSL; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(UI_OpenSSL_allownil)} + if FuncLoadError then + AFailed.Add('UI_OpenSSL'); + {$ifend} + end; + + + UI_null := LoadLibFunction(ADllHandle, UI_null_procname); + FuncLoadError := not assigned(UI_null); + if FuncLoadError then + begin + {$if not defined(UI_null_allownil)} + UI_null := @ERR_UI_null; + {$ifend} + {$if declared(UI_null_introduced)} + if LibVersion < UI_null_introduced then + begin + {$if declared(FC_UI_null)} + UI_null := @FC_UI_null; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(UI_null_removed)} + if UI_null_removed <= LibVersion then + begin + {$if declared(_UI_null)} + UI_null := @_UI_null; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(UI_null_allownil)} + if FuncLoadError then + AFailed.Add('UI_null'); + {$ifend} + end; + + + UI_create_method := LoadLibFunction(ADllHandle, UI_create_method_procname); + FuncLoadError := not assigned(UI_create_method); + if FuncLoadError then + begin + {$if not defined(UI_create_method_allownil)} + UI_create_method := @ERR_UI_create_method; + {$ifend} + {$if declared(UI_create_method_introduced)} + if LibVersion < UI_create_method_introduced then + begin + {$if declared(FC_UI_create_method)} + UI_create_method := @FC_UI_create_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(UI_create_method_removed)} + if UI_create_method_removed <= LibVersion then + begin + {$if declared(_UI_create_method)} + UI_create_method := @_UI_create_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(UI_create_method_allownil)} + if FuncLoadError then + AFailed.Add('UI_create_method'); + {$ifend} + end; + + + UI_destroy_method := LoadLibFunction(ADllHandle, UI_destroy_method_procname); + FuncLoadError := not assigned(UI_destroy_method); + if FuncLoadError then + begin + {$if not defined(UI_destroy_method_allownil)} + UI_destroy_method := @ERR_UI_destroy_method; + {$ifend} + {$if declared(UI_destroy_method_introduced)} + if LibVersion < UI_destroy_method_introduced then + begin + {$if declared(FC_UI_destroy_method)} + UI_destroy_method := @FC_UI_destroy_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(UI_destroy_method_removed)} + if UI_destroy_method_removed <= LibVersion then + begin + {$if declared(_UI_destroy_method)} + UI_destroy_method := @_UI_destroy_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(UI_destroy_method_allownil)} + if FuncLoadError then + AFailed.Add('UI_destroy_method'); + {$ifend} + end; + + + UI_method_set_opener := LoadLibFunction(ADllHandle, UI_method_set_opener_procname); + FuncLoadError := not assigned(UI_method_set_opener); + if FuncLoadError then + begin + {$if not defined(UI_method_set_opener_allownil)} + UI_method_set_opener := @ERR_UI_method_set_opener; + {$ifend} + {$if declared(UI_method_set_opener_introduced)} + if LibVersion < UI_method_set_opener_introduced then + begin + {$if declared(FC_UI_method_set_opener)} + UI_method_set_opener := @FC_UI_method_set_opener; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(UI_method_set_opener_removed)} + if UI_method_set_opener_removed <= LibVersion then + begin + {$if declared(_UI_method_set_opener)} + UI_method_set_opener := @_UI_method_set_opener; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(UI_method_set_opener_allownil)} + if FuncLoadError then + AFailed.Add('UI_method_set_opener'); + {$ifend} + end; + + + UI_method_set_writer := LoadLibFunction(ADllHandle, UI_method_set_writer_procname); + FuncLoadError := not assigned(UI_method_set_writer); + if FuncLoadError then + begin + {$if not defined(UI_method_set_writer_allownil)} + UI_method_set_writer := @ERR_UI_method_set_writer; + {$ifend} + {$if declared(UI_method_set_writer_introduced)} + if LibVersion < UI_method_set_writer_introduced then + begin + {$if declared(FC_UI_method_set_writer)} + UI_method_set_writer := @FC_UI_method_set_writer; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(UI_method_set_writer_removed)} + if UI_method_set_writer_removed <= LibVersion then + begin + {$if declared(_UI_method_set_writer)} + UI_method_set_writer := @_UI_method_set_writer; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(UI_method_set_writer_allownil)} + if FuncLoadError then + AFailed.Add('UI_method_set_writer'); + {$ifend} + end; + + + UI_method_set_flusher := LoadLibFunction(ADllHandle, UI_method_set_flusher_procname); + FuncLoadError := not assigned(UI_method_set_flusher); + if FuncLoadError then + begin + {$if not defined(UI_method_set_flusher_allownil)} + UI_method_set_flusher := @ERR_UI_method_set_flusher; + {$ifend} + {$if declared(UI_method_set_flusher_introduced)} + if LibVersion < UI_method_set_flusher_introduced then + begin + {$if declared(FC_UI_method_set_flusher)} + UI_method_set_flusher := @FC_UI_method_set_flusher; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(UI_method_set_flusher_removed)} + if UI_method_set_flusher_removed <= LibVersion then + begin + {$if declared(_UI_method_set_flusher)} + UI_method_set_flusher := @_UI_method_set_flusher; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(UI_method_set_flusher_allownil)} + if FuncLoadError then + AFailed.Add('UI_method_set_flusher'); + {$ifend} + end; + + + UI_method_set_reader := LoadLibFunction(ADllHandle, UI_method_set_reader_procname); + FuncLoadError := not assigned(UI_method_set_reader); + if FuncLoadError then + begin + {$if not defined(UI_method_set_reader_allownil)} + UI_method_set_reader := @ERR_UI_method_set_reader; + {$ifend} + {$if declared(UI_method_set_reader_introduced)} + if LibVersion < UI_method_set_reader_introduced then + begin + {$if declared(FC_UI_method_set_reader)} + UI_method_set_reader := @FC_UI_method_set_reader; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(UI_method_set_reader_removed)} + if UI_method_set_reader_removed <= LibVersion then + begin + {$if declared(_UI_method_set_reader)} + UI_method_set_reader := @_UI_method_set_reader; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(UI_method_set_reader_allownil)} + if FuncLoadError then + AFailed.Add('UI_method_set_reader'); + {$ifend} + end; + + + UI_method_set_closer := LoadLibFunction(ADllHandle, UI_method_set_closer_procname); + FuncLoadError := not assigned(UI_method_set_closer); + if FuncLoadError then + begin + {$if not defined(UI_method_set_closer_allownil)} + UI_method_set_closer := @ERR_UI_method_set_closer; + {$ifend} + {$if declared(UI_method_set_closer_introduced)} + if LibVersion < UI_method_set_closer_introduced then + begin + {$if declared(FC_UI_method_set_closer)} + UI_method_set_closer := @FC_UI_method_set_closer; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(UI_method_set_closer_removed)} + if UI_method_set_closer_removed <= LibVersion then + begin + {$if declared(_UI_method_set_closer)} + UI_method_set_closer := @_UI_method_set_closer; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(UI_method_set_closer_allownil)} + if FuncLoadError then + AFailed.Add('UI_method_set_closer'); + {$ifend} + end; + + + UI_method_set_data_duplicator := LoadLibFunction(ADllHandle, UI_method_set_data_duplicator_procname); + FuncLoadError := not assigned(UI_method_set_data_duplicator); + if FuncLoadError then + begin + {$if not defined(UI_method_set_data_duplicator_allownil)} + UI_method_set_data_duplicator := @ERR_UI_method_set_data_duplicator; + {$ifend} + {$if declared(UI_method_set_data_duplicator_introduced)} + if LibVersion < UI_method_set_data_duplicator_introduced then + begin + {$if declared(FC_UI_method_set_data_duplicator)} + UI_method_set_data_duplicator := @FC_UI_method_set_data_duplicator; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(UI_method_set_data_duplicator_removed)} + if UI_method_set_data_duplicator_removed <= LibVersion then + begin + {$if declared(_UI_method_set_data_duplicator)} + UI_method_set_data_duplicator := @_UI_method_set_data_duplicator; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(UI_method_set_data_duplicator_allownil)} + if FuncLoadError then + AFailed.Add('UI_method_set_data_duplicator'); + {$ifend} + end; + + + UI_method_set_prompt_constructor := LoadLibFunction(ADllHandle, UI_method_set_prompt_constructor_procname); + FuncLoadError := not assigned(UI_method_set_prompt_constructor); + if FuncLoadError then + begin + {$if not defined(UI_method_set_prompt_constructor_allownil)} + UI_method_set_prompt_constructor := @ERR_UI_method_set_prompt_constructor; + {$ifend} + {$if declared(UI_method_set_prompt_constructor_introduced)} + if LibVersion < UI_method_set_prompt_constructor_introduced then + begin + {$if declared(FC_UI_method_set_prompt_constructor)} + UI_method_set_prompt_constructor := @FC_UI_method_set_prompt_constructor; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(UI_method_set_prompt_constructor_removed)} + if UI_method_set_prompt_constructor_removed <= LibVersion then + begin + {$if declared(_UI_method_set_prompt_constructor)} + UI_method_set_prompt_constructor := @_UI_method_set_prompt_constructor; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(UI_method_set_prompt_constructor_allownil)} + if FuncLoadError then + AFailed.Add('UI_method_set_prompt_constructor'); + {$ifend} + end; + + + UI_method_set_ex_data := LoadLibFunction(ADllHandle, UI_method_set_ex_data_procname); + FuncLoadError := not assigned(UI_method_set_ex_data); + if FuncLoadError then + begin + {$if not defined(UI_method_set_ex_data_allownil)} + UI_method_set_ex_data := @ERR_UI_method_set_ex_data; + {$ifend} + {$if declared(UI_method_set_ex_data_introduced)} + if LibVersion < UI_method_set_ex_data_introduced then + begin + {$if declared(FC_UI_method_set_ex_data)} + UI_method_set_ex_data := @FC_UI_method_set_ex_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(UI_method_set_ex_data_removed)} + if UI_method_set_ex_data_removed <= LibVersion then + begin + {$if declared(_UI_method_set_ex_data)} + UI_method_set_ex_data := @_UI_method_set_ex_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(UI_method_set_ex_data_allownil)} + if FuncLoadError then + AFailed.Add('UI_method_set_ex_data'); + {$ifend} + end; + + + UI_method_get_opener := LoadLibFunction(ADllHandle, UI_method_get_opener_procname); + FuncLoadError := not assigned(UI_method_get_opener); + if FuncLoadError then + begin + {$if not defined(UI_method_get_opener_allownil)} + UI_method_get_opener := @ERR_UI_method_get_opener; + {$ifend} + {$if declared(UI_method_get_opener_introduced)} + if LibVersion < UI_method_get_opener_introduced then + begin + {$if declared(FC_UI_method_get_opener)} + UI_method_get_opener := @FC_UI_method_get_opener; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(UI_method_get_opener_removed)} + if UI_method_get_opener_removed <= LibVersion then + begin + {$if declared(_UI_method_get_opener)} + UI_method_get_opener := @_UI_method_get_opener; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(UI_method_get_opener_allownil)} + if FuncLoadError then + AFailed.Add('UI_method_get_opener'); + {$ifend} + end; + + + UI_method_get_writer := LoadLibFunction(ADllHandle, UI_method_get_writer_procname); + FuncLoadError := not assigned(UI_method_get_writer); + if FuncLoadError then + begin + {$if not defined(UI_method_get_writer_allownil)} + UI_method_get_writer := @ERR_UI_method_get_writer; + {$ifend} + {$if declared(UI_method_get_writer_introduced)} + if LibVersion < UI_method_get_writer_introduced then + begin + {$if declared(FC_UI_method_get_writer)} + UI_method_get_writer := @FC_UI_method_get_writer; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(UI_method_get_writer_removed)} + if UI_method_get_writer_removed <= LibVersion then + begin + {$if declared(_UI_method_get_writer)} + UI_method_get_writer := @_UI_method_get_writer; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(UI_method_get_writer_allownil)} + if FuncLoadError then + AFailed.Add('UI_method_get_writer'); + {$ifend} + end; + + + UI_method_get_flusher := LoadLibFunction(ADllHandle, UI_method_get_flusher_procname); + FuncLoadError := not assigned(UI_method_get_flusher); + if FuncLoadError then + begin + {$if not defined(UI_method_get_flusher_allownil)} + UI_method_get_flusher := @ERR_UI_method_get_flusher; + {$ifend} + {$if declared(UI_method_get_flusher_introduced)} + if LibVersion < UI_method_get_flusher_introduced then + begin + {$if declared(FC_UI_method_get_flusher)} + UI_method_get_flusher := @FC_UI_method_get_flusher; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(UI_method_get_flusher_removed)} + if UI_method_get_flusher_removed <= LibVersion then + begin + {$if declared(_UI_method_get_flusher)} + UI_method_get_flusher := @_UI_method_get_flusher; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(UI_method_get_flusher_allownil)} + if FuncLoadError then + AFailed.Add('UI_method_get_flusher'); + {$ifend} + end; + + + UI_method_get_reader := LoadLibFunction(ADllHandle, UI_method_get_reader_procname); + FuncLoadError := not assigned(UI_method_get_reader); + if FuncLoadError then + begin + {$if not defined(UI_method_get_reader_allownil)} + UI_method_get_reader := @ERR_UI_method_get_reader; + {$ifend} + {$if declared(UI_method_get_reader_introduced)} + if LibVersion < UI_method_get_reader_introduced then + begin + {$if declared(FC_UI_method_get_reader)} + UI_method_get_reader := @FC_UI_method_get_reader; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(UI_method_get_reader_removed)} + if UI_method_get_reader_removed <= LibVersion then + begin + {$if declared(_UI_method_get_reader)} + UI_method_get_reader := @_UI_method_get_reader; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(UI_method_get_reader_allownil)} + if FuncLoadError then + AFailed.Add('UI_method_get_reader'); + {$ifend} + end; + + + UI_method_get_closer := LoadLibFunction(ADllHandle, UI_method_get_closer_procname); + FuncLoadError := not assigned(UI_method_get_closer); + if FuncLoadError then + begin + {$if not defined(UI_method_get_closer_allownil)} + UI_method_get_closer := @ERR_UI_method_get_closer; + {$ifend} + {$if declared(UI_method_get_closer_introduced)} + if LibVersion < UI_method_get_closer_introduced then + begin + {$if declared(FC_UI_method_get_closer)} + UI_method_get_closer := @FC_UI_method_get_closer; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(UI_method_get_closer_removed)} + if UI_method_get_closer_removed <= LibVersion then + begin + {$if declared(_UI_method_get_closer)} + UI_method_get_closer := @_UI_method_get_closer; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(UI_method_get_closer_allownil)} + if FuncLoadError then + AFailed.Add('UI_method_get_closer'); + {$ifend} + end; + + + UI_method_get_prompt_constructor := LoadLibFunction(ADllHandle, UI_method_get_prompt_constructor_procname); + FuncLoadError := not assigned(UI_method_get_prompt_constructor); + if FuncLoadError then + begin + {$if not defined(UI_method_get_prompt_constructor_allownil)} + UI_method_get_prompt_constructor := @ERR_UI_method_get_prompt_constructor; + {$ifend} + {$if declared(UI_method_get_prompt_constructor_introduced)} + if LibVersion < UI_method_get_prompt_constructor_introduced then + begin + {$if declared(FC_UI_method_get_prompt_constructor)} + UI_method_get_prompt_constructor := @FC_UI_method_get_prompt_constructor; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(UI_method_get_prompt_constructor_removed)} + if UI_method_get_prompt_constructor_removed <= LibVersion then + begin + {$if declared(_UI_method_get_prompt_constructor)} + UI_method_get_prompt_constructor := @_UI_method_get_prompt_constructor; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(UI_method_get_prompt_constructor_allownil)} + if FuncLoadError then + AFailed.Add('UI_method_get_prompt_constructor'); + {$ifend} + end; + + + UI_method_get_data_duplicator := LoadLibFunction(ADllHandle, UI_method_get_data_duplicator_procname); + FuncLoadError := not assigned(UI_method_get_data_duplicator); + if FuncLoadError then + begin + {$if not defined(UI_method_get_data_duplicator_allownil)} + UI_method_get_data_duplicator := @ERR_UI_method_get_data_duplicator; + {$ifend} + {$if declared(UI_method_get_data_duplicator_introduced)} + if LibVersion < UI_method_get_data_duplicator_introduced then + begin + {$if declared(FC_UI_method_get_data_duplicator)} + UI_method_get_data_duplicator := @FC_UI_method_get_data_duplicator; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(UI_method_get_data_duplicator_removed)} + if UI_method_get_data_duplicator_removed <= LibVersion then + begin + {$if declared(_UI_method_get_data_duplicator)} + UI_method_get_data_duplicator := @_UI_method_get_data_duplicator; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(UI_method_get_data_duplicator_allownil)} + if FuncLoadError then + AFailed.Add('UI_method_get_data_duplicator'); + {$ifend} + end; + + + UI_method_get_data_destructor := LoadLibFunction(ADllHandle, UI_method_get_data_destructor_procname); + FuncLoadError := not assigned(UI_method_get_data_destructor); + if FuncLoadError then + begin + {$if not defined(UI_method_get_data_destructor_allownil)} + UI_method_get_data_destructor := @ERR_UI_method_get_data_destructor; + {$ifend} + {$if declared(UI_method_get_data_destructor_introduced)} + if LibVersion < UI_method_get_data_destructor_introduced then + begin + {$if declared(FC_UI_method_get_data_destructor)} + UI_method_get_data_destructor := @FC_UI_method_get_data_destructor; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(UI_method_get_data_destructor_removed)} + if UI_method_get_data_destructor_removed <= LibVersion then + begin + {$if declared(_UI_method_get_data_destructor)} + UI_method_get_data_destructor := @_UI_method_get_data_destructor; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(UI_method_get_data_destructor_allownil)} + if FuncLoadError then + AFailed.Add('UI_method_get_data_destructor'); + {$ifend} + end; + + + UI_method_get_ex_data := LoadLibFunction(ADllHandle, UI_method_get_ex_data_procname); + FuncLoadError := not assigned(UI_method_get_ex_data); + if FuncLoadError then + begin + {$if not defined(UI_method_get_ex_data_allownil)} + UI_method_get_ex_data := @ERR_UI_method_get_ex_data; + {$ifend} + {$if declared(UI_method_get_ex_data_introduced)} + if LibVersion < UI_method_get_ex_data_introduced then + begin + {$if declared(FC_UI_method_get_ex_data)} + UI_method_get_ex_data := @FC_UI_method_get_ex_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(UI_method_get_ex_data_removed)} + if UI_method_get_ex_data_removed <= LibVersion then + begin + {$if declared(_UI_method_get_ex_data)} + UI_method_get_ex_data := @_UI_method_get_ex_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(UI_method_get_ex_data_allownil)} + if FuncLoadError then + AFailed.Add('UI_method_get_ex_data'); + {$ifend} + end; + + + UI_get_string_type := LoadLibFunction(ADllHandle, UI_get_string_type_procname); + FuncLoadError := not assigned(UI_get_string_type); + if FuncLoadError then + begin + {$if not defined(UI_get_string_type_allownil)} + UI_get_string_type := @ERR_UI_get_string_type; + {$ifend} + {$if declared(UI_get_string_type_introduced)} + if LibVersion < UI_get_string_type_introduced then + begin + {$if declared(FC_UI_get_string_type)} + UI_get_string_type := @FC_UI_get_string_type; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(UI_get_string_type_removed)} + if UI_get_string_type_removed <= LibVersion then + begin + {$if declared(_UI_get_string_type)} + UI_get_string_type := @_UI_get_string_type; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(UI_get_string_type_allownil)} + if FuncLoadError then + AFailed.Add('UI_get_string_type'); + {$ifend} + end; + + + UI_get_input_flags := LoadLibFunction(ADllHandle, UI_get_input_flags_procname); + FuncLoadError := not assigned(UI_get_input_flags); + if FuncLoadError then + begin + {$if not defined(UI_get_input_flags_allownil)} + UI_get_input_flags := @ERR_UI_get_input_flags; + {$ifend} + {$if declared(UI_get_input_flags_introduced)} + if LibVersion < UI_get_input_flags_introduced then + begin + {$if declared(FC_UI_get_input_flags)} + UI_get_input_flags := @FC_UI_get_input_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(UI_get_input_flags_removed)} + if UI_get_input_flags_removed <= LibVersion then + begin + {$if declared(_UI_get_input_flags)} + UI_get_input_flags := @_UI_get_input_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(UI_get_input_flags_allownil)} + if FuncLoadError then + AFailed.Add('UI_get_input_flags'); + {$ifend} + end; + + + UI_get0_output_string := LoadLibFunction(ADllHandle, UI_get0_output_string_procname); + FuncLoadError := not assigned(UI_get0_output_string); + if FuncLoadError then + begin + {$if not defined(UI_get0_output_string_allownil)} + UI_get0_output_string := @ERR_UI_get0_output_string; + {$ifend} + {$if declared(UI_get0_output_string_introduced)} + if LibVersion < UI_get0_output_string_introduced then + begin + {$if declared(FC_UI_get0_output_string)} + UI_get0_output_string := @FC_UI_get0_output_string; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(UI_get0_output_string_removed)} + if UI_get0_output_string_removed <= LibVersion then + begin + {$if declared(_UI_get0_output_string)} + UI_get0_output_string := @_UI_get0_output_string; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(UI_get0_output_string_allownil)} + if FuncLoadError then + AFailed.Add('UI_get0_output_string'); + {$ifend} + end; + + + UI_get0_action_string := LoadLibFunction(ADllHandle, UI_get0_action_string_procname); + FuncLoadError := not assigned(UI_get0_action_string); + if FuncLoadError then + begin + {$if not defined(UI_get0_action_string_allownil)} + UI_get0_action_string := @ERR_UI_get0_action_string; + {$ifend} + {$if declared(UI_get0_action_string_introduced)} + if LibVersion < UI_get0_action_string_introduced then + begin + {$if declared(FC_UI_get0_action_string)} + UI_get0_action_string := @FC_UI_get0_action_string; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(UI_get0_action_string_removed)} + if UI_get0_action_string_removed <= LibVersion then + begin + {$if declared(_UI_get0_action_string)} + UI_get0_action_string := @_UI_get0_action_string; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(UI_get0_action_string_allownil)} + if FuncLoadError then + AFailed.Add('UI_get0_action_string'); + {$ifend} + end; + + + UI_get0_result_string := LoadLibFunction(ADllHandle, UI_get0_result_string_procname); + FuncLoadError := not assigned(UI_get0_result_string); + if FuncLoadError then + begin + {$if not defined(UI_get0_result_string_allownil)} + UI_get0_result_string := @ERR_UI_get0_result_string; + {$ifend} + {$if declared(UI_get0_result_string_introduced)} + if LibVersion < UI_get0_result_string_introduced then + begin + {$if declared(FC_UI_get0_result_string)} + UI_get0_result_string := @FC_UI_get0_result_string; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(UI_get0_result_string_removed)} + if UI_get0_result_string_removed <= LibVersion then + begin + {$if declared(_UI_get0_result_string)} + UI_get0_result_string := @_UI_get0_result_string; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(UI_get0_result_string_allownil)} + if FuncLoadError then + AFailed.Add('UI_get0_result_string'); + {$ifend} + end; + + + UI_get_result_string_length := LoadLibFunction(ADllHandle, UI_get_result_string_length_procname); + FuncLoadError := not assigned(UI_get_result_string_length); + if FuncLoadError then + begin + {$if not defined(UI_get_result_string_length_allownil)} + UI_get_result_string_length := @ERR_UI_get_result_string_length; + {$ifend} + {$if declared(UI_get_result_string_length_introduced)} + if LibVersion < UI_get_result_string_length_introduced then + begin + {$if declared(FC_UI_get_result_string_length)} + UI_get_result_string_length := @FC_UI_get_result_string_length; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(UI_get_result_string_length_removed)} + if UI_get_result_string_length_removed <= LibVersion then + begin + {$if declared(_UI_get_result_string_length)} + UI_get_result_string_length := @_UI_get_result_string_length; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(UI_get_result_string_length_allownil)} + if FuncLoadError then + AFailed.Add('UI_get_result_string_length'); + {$ifend} + end; + + + UI_get0_test_string := LoadLibFunction(ADllHandle, UI_get0_test_string_procname); + FuncLoadError := not assigned(UI_get0_test_string); + if FuncLoadError then + begin + {$if not defined(UI_get0_test_string_allownil)} + UI_get0_test_string := @ERR_UI_get0_test_string; + {$ifend} + {$if declared(UI_get0_test_string_introduced)} + if LibVersion < UI_get0_test_string_introduced then + begin + {$if declared(FC_UI_get0_test_string)} + UI_get0_test_string := @FC_UI_get0_test_string; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(UI_get0_test_string_removed)} + if UI_get0_test_string_removed <= LibVersion then + begin + {$if declared(_UI_get0_test_string)} + UI_get0_test_string := @_UI_get0_test_string; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(UI_get0_test_string_allownil)} + if FuncLoadError then + AFailed.Add('UI_get0_test_string'); + {$ifend} + end; + + + UI_get_result_minsize := LoadLibFunction(ADllHandle, UI_get_result_minsize_procname); + FuncLoadError := not assigned(UI_get_result_minsize); + if FuncLoadError then + begin + {$if not defined(UI_get_result_minsize_allownil)} + UI_get_result_minsize := @ERR_UI_get_result_minsize; + {$ifend} + {$if declared(UI_get_result_minsize_introduced)} + if LibVersion < UI_get_result_minsize_introduced then + begin + {$if declared(FC_UI_get_result_minsize)} + UI_get_result_minsize := @FC_UI_get_result_minsize; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(UI_get_result_minsize_removed)} + if UI_get_result_minsize_removed <= LibVersion then + begin + {$if declared(_UI_get_result_minsize)} + UI_get_result_minsize := @_UI_get_result_minsize; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(UI_get_result_minsize_allownil)} + if FuncLoadError then + AFailed.Add('UI_get_result_minsize'); + {$ifend} + end; + + + UI_get_result_maxsize := LoadLibFunction(ADllHandle, UI_get_result_maxsize_procname); + FuncLoadError := not assigned(UI_get_result_maxsize); + if FuncLoadError then + begin + {$if not defined(UI_get_result_maxsize_allownil)} + UI_get_result_maxsize := @ERR_UI_get_result_maxsize; + {$ifend} + {$if declared(UI_get_result_maxsize_introduced)} + if LibVersion < UI_get_result_maxsize_introduced then + begin + {$if declared(FC_UI_get_result_maxsize)} + UI_get_result_maxsize := @FC_UI_get_result_maxsize; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(UI_get_result_maxsize_removed)} + if UI_get_result_maxsize_removed <= LibVersion then + begin + {$if declared(_UI_get_result_maxsize)} + UI_get_result_maxsize := @_UI_get_result_maxsize; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(UI_get_result_maxsize_allownil)} + if FuncLoadError then + AFailed.Add('UI_get_result_maxsize'); + {$ifend} + end; + + + UI_set_result := LoadLibFunction(ADllHandle, UI_set_result_procname); + FuncLoadError := not assigned(UI_set_result); + if FuncLoadError then + begin + {$if not defined(UI_set_result_allownil)} + UI_set_result := @ERR_UI_set_result; + {$ifend} + {$if declared(UI_set_result_introduced)} + if LibVersion < UI_set_result_introduced then + begin + {$if declared(FC_UI_set_result)} + UI_set_result := @FC_UI_set_result; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(UI_set_result_removed)} + if UI_set_result_removed <= LibVersion then + begin + {$if declared(_UI_set_result)} + UI_set_result := @_UI_set_result; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(UI_set_result_allownil)} + if FuncLoadError then + AFailed.Add('UI_set_result'); + {$ifend} + end; + + + UI_set_result_ex := LoadLibFunction(ADllHandle, UI_set_result_ex_procname); + FuncLoadError := not assigned(UI_set_result_ex); + if FuncLoadError then + begin + {$if not defined(UI_set_result_ex_allownil)} + UI_set_result_ex := @ERR_UI_set_result_ex; + {$ifend} + {$if declared(UI_set_result_ex_introduced)} + if LibVersion < UI_set_result_ex_introduced then + begin + {$if declared(FC_UI_set_result_ex)} + UI_set_result_ex := @FC_UI_set_result_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(UI_set_result_ex_removed)} + if UI_set_result_ex_removed <= LibVersion then + begin + {$if declared(_UI_set_result_ex)} + UI_set_result_ex := @_UI_set_result_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(UI_set_result_ex_allownil)} + if FuncLoadError then + AFailed.Add('UI_set_result_ex'); + {$ifend} + end; + + + UI_UTIL_read_pw_string := LoadLibFunction(ADllHandle, UI_UTIL_read_pw_string_procname); + FuncLoadError := not assigned(UI_UTIL_read_pw_string); + if FuncLoadError then + begin + {$if not defined(UI_UTIL_read_pw_string_allownil)} + UI_UTIL_read_pw_string := @ERR_UI_UTIL_read_pw_string; + {$ifend} + {$if declared(UI_UTIL_read_pw_string_introduced)} + if LibVersion < UI_UTIL_read_pw_string_introduced then + begin + {$if declared(FC_UI_UTIL_read_pw_string)} + UI_UTIL_read_pw_string := @FC_UI_UTIL_read_pw_string; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(UI_UTIL_read_pw_string_removed)} + if UI_UTIL_read_pw_string_removed <= LibVersion then + begin + {$if declared(_UI_UTIL_read_pw_string)} + UI_UTIL_read_pw_string := @_UI_UTIL_read_pw_string; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(UI_UTIL_read_pw_string_allownil)} + if FuncLoadError then + AFailed.Add('UI_UTIL_read_pw_string'); + {$ifend} + end; + + + UI_UTIL_read_pw := LoadLibFunction(ADllHandle, UI_UTIL_read_pw_procname); + FuncLoadError := not assigned(UI_UTIL_read_pw); + if FuncLoadError then + begin + {$if not defined(UI_UTIL_read_pw_allownil)} + UI_UTIL_read_pw := @ERR_UI_UTIL_read_pw; + {$ifend} + {$if declared(UI_UTIL_read_pw_introduced)} + if LibVersion < UI_UTIL_read_pw_introduced then + begin + {$if declared(FC_UI_UTIL_read_pw)} + UI_UTIL_read_pw := @FC_UI_UTIL_read_pw; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(UI_UTIL_read_pw_removed)} + if UI_UTIL_read_pw_removed <= LibVersion then + begin + {$if declared(_UI_UTIL_read_pw)} + UI_UTIL_read_pw := @_UI_UTIL_read_pw; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(UI_UTIL_read_pw_allownil)} + if FuncLoadError then + AFailed.Add('UI_UTIL_read_pw'); + {$ifend} + end; + + + UI_UTIL_wrap_read_pem_callback := LoadLibFunction(ADllHandle, UI_UTIL_wrap_read_pem_callback_procname); + FuncLoadError := not assigned(UI_UTIL_wrap_read_pem_callback); + if FuncLoadError then + begin + {$if not defined(UI_UTIL_wrap_read_pem_callback_allownil)} + UI_UTIL_wrap_read_pem_callback := @ERR_UI_UTIL_wrap_read_pem_callback; + {$ifend} + {$if declared(UI_UTIL_wrap_read_pem_callback_introduced)} + if LibVersion < UI_UTIL_wrap_read_pem_callback_introduced then + begin + {$if declared(FC_UI_UTIL_wrap_read_pem_callback)} + UI_UTIL_wrap_read_pem_callback := @FC_UI_UTIL_wrap_read_pem_callback; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(UI_UTIL_wrap_read_pem_callback_removed)} + if UI_UTIL_wrap_read_pem_callback_removed <= LibVersion then + begin + {$if declared(_UI_UTIL_wrap_read_pem_callback)} + UI_UTIL_wrap_read_pem_callback := @_UI_UTIL_wrap_read_pem_callback; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(UI_UTIL_wrap_read_pem_callback_allownil)} + if FuncLoadError then + AFailed.Add('UI_UTIL_wrap_read_pem_callback'); + {$ifend} + end; + + +end; + +procedure Unload; +begin + UI_new := nil; + UI_new_method := nil; + UI_free := nil; + UI_add_input_string := nil; + UI_dup_input_string := nil; + UI_add_verify_string := nil; + UI_dup_verify_string := nil; + UI_add_input_boolean := nil; + UI_dup_input_boolean := nil; + UI_add_info_string := nil; + UI_dup_info_string := nil; + UI_add_error_string := nil; + UI_dup_error_string := nil; + UI_construct_prompt := nil; + UI_add_user_data := nil; + UI_dup_user_data := nil; + UI_get0_user_data := nil; + UI_get0_result := nil; + UI_get_result_length := nil; + UI_process := nil; + UI_ctrl := nil; + UI_set_ex_data := nil; + UI_get_ex_data := nil; + UI_set_default_method := nil; + UI_get_default_method := nil; + UI_get_method := nil; + UI_set_method := nil; + UI_OpenSSL := nil; + UI_null := nil; + UI_create_method := nil; + UI_destroy_method := nil; + UI_method_set_opener := nil; + UI_method_set_writer := nil; + UI_method_set_flusher := nil; + UI_method_set_reader := nil; + UI_method_set_closer := nil; + UI_method_set_data_duplicator := nil; + UI_method_set_prompt_constructor := nil; + UI_method_set_ex_data := nil; + UI_method_get_opener := nil; + UI_method_get_writer := nil; + UI_method_get_flusher := nil; + UI_method_get_reader := nil; + UI_method_get_closer := nil; + UI_method_get_prompt_constructor := nil; + UI_method_get_data_duplicator := nil; + UI_method_get_data_destructor := nil; + UI_method_get_ex_data := nil; + UI_get_string_type := nil; + UI_get_input_flags := nil; + UI_get0_output_string := nil; + UI_get0_action_string := nil; + UI_get0_result_string := nil; + UI_get_result_string_length := nil; + UI_get0_test_string := nil; + UI_get_result_minsize := nil; + UI_get_result_maxsize := nil; + UI_set_result := nil; + UI_set_result_ex := nil; + UI_UTIL_read_pw_string := nil; + UI_UTIL_read_pw := nil; + UI_UTIL_wrap_read_pem_callback := nil; +end; +{$ELSE} +{$ENDIF} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +initialization + Register_SSLLoader(@Load,'LibCrypto'); + Register_SSLUnloader(@Unload); +{$ENDIF} +end. diff --git a/IdOpenSSLHeaders_uierr.pas b/IdOpenSSLHeaders_uierr.pas new file mode 100644 index 0000000..094df74 --- /dev/null +++ b/IdOpenSSLHeaders_uierr.pas @@ -0,0 +1,182 @@ + (* This unit was generated using the script genOpenSSLHdrs.sh from the source file IdOpenSSLHeaders_uierr.h2pas + It should not be modified directly. All changes should be made to IdOpenSSLHeaders_uierr.h2pas + and this file regenerated. IdOpenSSLHeaders_uierr.h2pas is distributed with the full Indy + Distribution. + *) + +{$i IdCompilerDefines.inc} +{$i IdSSLOpenSSLDefines.inc} +{$IFNDEF USE_OPENSSL} + { error Should not compile if USE_OPENSSL is not defined!!!} +{$ENDIF} +{******************************************************************************} +{ } +{ Indy (Internet Direct) - Internet Protocols Simplified } +{ } +{ https://www.indyproject.org/ } +{ https://gitter.im/IndySockets/Indy } +{ } +{******************************************************************************} +{ } +{ This file is part of the Indy (Internet Direct) project, and is offered } +{ under the dual-licensing agreement described on the Indy website. } +{ (https://www.indyproject.org/license/) } +{ } +{ Copyright: } +{ (c) 1993-2020, Chad Z. Hower and the Indy Pit Crew. All rights reserved. } +{ } +{******************************************************************************} +{ } +{ } +{******************************************************************************} + +unit IdOpenSSLHeaders_uierr; + +interface + +// Headers for OpenSSL 1.1.1 +// uierr.h + + +uses + IdCTypes, + IdGlobal, + IdSSLOpenSSLConsts; + +const + (* + * UI function codes. + *) + UI_F_CLOSE_CONSOLE = 115; + UI_F_ECHO_CONSOLE = 116; + UI_F_GENERAL_ALLOCATE_BOOLEAN = 108; + UI_F_GENERAL_ALLOCATE_PROMPT = 109; + UI_F_NOECHO_CONSOLE = 117; + UI_F_OPEN_CONSOLE = 114; + UI_F_UI_CONSTRUCT_PROMPT = 121; + UI_F_UI_CREATE_METHOD = 112; + UI_F_UI_CTRL = 111; + UI_F_UI_DUP_ERROR_STRING = 101; + UI_F_UI_DUP_INFO_STRING = 102; + UI_F_UI_DUP_INPUT_BOOLEAN = 110; + UI_F_UI_DUP_INPUT_STRING = 103; + UI_F_UI_DUP_USER_DATA = 118; + UI_F_UI_DUP_VERIFY_STRING = 106; + UI_F_UI_GET0_RESULT = 107; + UI_F_UI_GET_RESULT_LENGTH = 119; + UI_F_UI_NEW_METHOD = 104; + UI_F_UI_PROCESS = 113; + UI_F_UI_SET_RESULT = 105; + UI_F_UI_SET_RESULT_EX = 120; + + (* + * UI reason codes. + *) + UI_R_COMMON_OK_AND_CANCEL_CHARACTERS = 104; + UI_R_INDEX_TOO_LARGE = 102; + UI_R_INDEX_TOO_SMALL = 103; + UI_R_NO_RESULT_BUFFER = 105; + UI_R_PROCESSING_ERROR = 107; + UI_R_RESULT_TOO_LARGE = 100; + UI_R_RESULT_TOO_SMALL = 101; + UI_R_SYSASSIGN_ERROR = 109; + UI_R_SYSDASSGN_ERROR = 110; + UI_R_SYSQIOW_ERROR = 111; + UI_R_UNKNOWN_CONTROL_COMMAND = 106; + UI_R_UNKNOWN_TTYGET_ERRNO_VALUE = 108; + UI_R_USER_DATA_DUPLICATION_UNSUPPORTED = 112; + + { The EXTERNALSYM directive is ignored by FPC, however, it is used by Delphi as follows: + + The EXTERNALSYM directive prevents the specified Delphi symbol from appearing in header + files generated for C++. } + + {$EXTERNALSYM ERR_load_UI_strings} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +var + ERR_load_UI_strings: function : TIdC_INT; cdecl = nil; + +{$ELSE} + function ERR_load_UI_strings: TIdC_INT cdecl; external CLibCrypto; + +{$ENDIF} + +implementation + + uses + classes, + IdSSLOpenSSLExceptionHandlers, + IdResourceStringsOpenSSL + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + ,IdSSLOpenSSLLoader + {$ENDIF}; + + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +const + ERR_load_UI_strings_procname = 'ERR_load_UI_strings'; + + +{$WARN NO_RETVAL OFF} +function ERR_ERR_load_UI_strings: TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ERR_load_UI_strings_procname); +end; + + + +{$WARN NO_RETVAL ON} + +procedure Load(const ADllHandle: TIdLibHandle; LibVersion: TIdC_UINT; const AFailed: TStringList); + +var FuncLoadError: boolean; + +begin + ERR_load_UI_strings := LoadLibFunction(ADllHandle, ERR_load_UI_strings_procname); + FuncLoadError := not assigned(ERR_load_UI_strings); + if FuncLoadError then + begin + {$if not defined(ERR_load_UI_strings_allownil)} + ERR_load_UI_strings := @ERR_ERR_load_UI_strings; + {$ifend} + {$if declared(ERR_load_UI_strings_introduced)} + if LibVersion < ERR_load_UI_strings_introduced then + begin + {$if declared(FC_ERR_load_UI_strings)} + ERR_load_UI_strings := @FC_ERR_load_UI_strings; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ERR_load_UI_strings_removed)} + if ERR_load_UI_strings_removed <= LibVersion then + begin + {$if declared(_ERR_load_UI_strings)} + ERR_load_UI_strings := @_ERR_load_UI_strings; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ERR_load_UI_strings_allownil)} + if FuncLoadError then + AFailed.Add('ERR_load_UI_strings'); + {$ifend} + end; + + +end; + +procedure Unload; +begin + ERR_load_UI_strings := nil; +end; +{$ELSE} +{$ENDIF} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +initialization + Register_SSLLoader(@Load,'LibCrypto'); + Register_SSLUnloader(@Unload); +{$ENDIF} +end. diff --git a/IdOpenSSLHeaders_whrlpool.pas b/IdOpenSSLHeaders_whrlpool.pas new file mode 100644 index 0000000..307840c --- /dev/null +++ b/IdOpenSSLHeaders_whrlpool.pas @@ -0,0 +1,331 @@ + (* This unit was generated using the script genOpenSSLHdrs.sh from the source file IdOpenSSLHeaders_whrlpool.h2pas + It should not be modified directly. All changes should be made to IdOpenSSLHeaders_whrlpool.h2pas + and this file regenerated. IdOpenSSLHeaders_whrlpool.h2pas is distributed with the full Indy + Distribution. + *) + +{$i IdCompilerDefines.inc} +{$i IdSSLOpenSSLDefines.inc} +{$IFNDEF USE_OPENSSL} + { error Should not compile if USE_OPENSSL is not defined!!!} +{$ENDIF} +{******************************************************************************} +{ } +{ Indy (Internet Direct) - Internet Protocols Simplified } +{ } +{ https://www.indyproject.org/ } +{ https://gitter.im/IndySockets/Indy } +{ } +{******************************************************************************} +{ } +{ This file is part of the Indy (Internet Direct) project, and is offered } +{ under the dual-licensing agreement described on the Indy website. } +{ (https://www.indyproject.org/license/) } +{ } +{ Copyright: } +{ (c) 1993-2020, Chad Z. Hower and the Indy Pit Crew. All rights reserved. } +{ } +{******************************************************************************} +{ } +{ } +{******************************************************************************} + +unit IdOpenSSLHeaders_whrlpool; + +interface + +// Headers for OpenSSL 1.1.1 +// whrlpool.h + + +uses + IdCTypes, + IdGlobal, + IdSSLOpenSSLConsts; + +const + WHIRLPOOL_DIGEST_LENGTH = 512 div 8; + WHIRLPOOL_BBLOCK = 512; + WHIRLPOOL_COUNTER = 256 div 8; + +type + WHIRLPOOL_CTX_union = record + case Byte of + 0: (c: array[0 .. WHIRLPOOL_DIGEST_LENGTH -1] of Byte); + (* double q is here to ensure 64-bit alignment *) + 1: (q: array[0 .. (WHIRLPOOL_DIGEST_LENGTH div SizeOf(TIdC_DOUBLE)) -1] of TIdC_DOUBLE); + end; + WHIRLPOOL_CTX = record + H: WHIRLPOOL_CTX_union; + data: array[0 .. (WHIRLPOOL_BBLOCK div 8) -1] of Byte; + bitoff: TIdC_UINT; + bitlen: array[0 .. (WHIRLPOOL_COUNTER div SizeOf(TIdC_SIZET)) -1] of TIdC_SIZET; + end; + PWHIRLPOOL_CTX = ^WHIRLPOOL_CTX; + + { The EXTERNALSYM directive is ignored by FPC, however, it is used by Delphi as follows: + + The EXTERNALSYM directive prevents the specified Delphi symbol from appearing in header + files generated for C++. } + + {$EXTERNALSYM WHIRLPOOL_Init} + {$EXTERNALSYM WHIRLPOOL_Update} + {$EXTERNALSYM WHIRLPOOL_BitUpdate} + {$EXTERNALSYM WHIRLPOOL_Final} + {$EXTERNALSYM WHIRLPOOL} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +var + WHIRLPOOL_Init: function (c: PWHIRLPOOL_CTX): TIdC_INT; cdecl = nil; + WHIRLPOOL_Update: function (c: PWHIRLPOOL_CTX; inp: Pointer; bytes: TIdC_SIZET): TIdC_INT; cdecl = nil; + WHIRLPOOL_BitUpdate: procedure (c: PWHIRLPOOL_CTX; inp: Pointer; bits: TIdC_SIZET); cdecl = nil; + WHIRLPOOL_Final: function (md: PByte; c: PWHIRLPOOL_CTX): TIdC_INT; cdecl = nil; + WHIRLPOOL: function (inp: Pointer; bytes: TIdC_SIZET; md: PByte): PByte; cdecl = nil; + +{$ELSE} + function WHIRLPOOL_Init(c: PWHIRLPOOL_CTX): TIdC_INT cdecl; external CLibCrypto; + function WHIRLPOOL_Update(c: PWHIRLPOOL_CTX; inp: Pointer; bytes: TIdC_SIZET): TIdC_INT cdecl; external CLibCrypto; + procedure WHIRLPOOL_BitUpdate(c: PWHIRLPOOL_CTX; inp: Pointer; bits: TIdC_SIZET) cdecl; external CLibCrypto; + function WHIRLPOOL_Final(md: PByte; c: PWHIRLPOOL_CTX): TIdC_INT cdecl; external CLibCrypto; + function WHIRLPOOL(inp: Pointer; bytes: TIdC_SIZET; md: PByte): PByte cdecl; external CLibCrypto; + +{$ENDIF} + +implementation + + uses + classes, + IdSSLOpenSSLExceptionHandlers, + IdResourceStringsOpenSSL + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + ,IdSSLOpenSSLLoader + {$ENDIF}; + + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +const + WHIRLPOOL_Init_procname = 'WHIRLPOOL_Init'; + WHIRLPOOL_Update_procname = 'WHIRLPOOL_Update'; + WHIRLPOOL_BitUpdate_procname = 'WHIRLPOOL_BitUpdate'; + WHIRLPOOL_Final_procname = 'WHIRLPOOL_Final'; + WHIRLPOOL_procname = 'WHIRLPOOL'; + + +{$WARN NO_RETVAL OFF} +function ERR_WHIRLPOOL_Init(c: PWHIRLPOOL_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(WHIRLPOOL_Init_procname); +end; + + +function ERR_WHIRLPOOL_Update(c: PWHIRLPOOL_CTX; inp: Pointer; bytes: TIdC_SIZET): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(WHIRLPOOL_Update_procname); +end; + + +procedure ERR_WHIRLPOOL_BitUpdate(c: PWHIRLPOOL_CTX; inp: Pointer; bits: TIdC_SIZET); +begin + EIdAPIFunctionNotPresent.RaiseException(WHIRLPOOL_BitUpdate_procname); +end; + + +function ERR_WHIRLPOOL_Final(md: PByte; c: PWHIRLPOOL_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(WHIRLPOOL_Final_procname); +end; + + +function ERR_WHIRLPOOL(inp: Pointer; bytes: TIdC_SIZET; md: PByte): PByte; +begin + EIdAPIFunctionNotPresent.RaiseException(WHIRLPOOL_procname); +end; + + + +{$WARN NO_RETVAL ON} + +procedure Load(const ADllHandle: TIdLibHandle; LibVersion: TIdC_UINT; const AFailed: TStringList); + +var FuncLoadError: boolean; + +begin + WHIRLPOOL_Init := LoadLibFunction(ADllHandle, WHIRLPOOL_Init_procname); + FuncLoadError := not assigned(WHIRLPOOL_Init); + if FuncLoadError then + begin + {$if not defined(WHIRLPOOL_Init_allownil)} + WHIRLPOOL_Init := @ERR_WHIRLPOOL_Init; + {$ifend} + {$if declared(WHIRLPOOL_Init_introduced)} + if LibVersion < WHIRLPOOL_Init_introduced then + begin + {$if declared(FC_WHIRLPOOL_Init)} + WHIRLPOOL_Init := @FC_WHIRLPOOL_Init; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(WHIRLPOOL_Init_removed)} + if WHIRLPOOL_Init_removed <= LibVersion then + begin + {$if declared(_WHIRLPOOL_Init)} + WHIRLPOOL_Init := @_WHIRLPOOL_Init; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(WHIRLPOOL_Init_allownil)} + if FuncLoadError then + AFailed.Add('WHIRLPOOL_Init'); + {$ifend} + end; + + + WHIRLPOOL_Update := LoadLibFunction(ADllHandle, WHIRLPOOL_Update_procname); + FuncLoadError := not assigned(WHIRLPOOL_Update); + if FuncLoadError then + begin + {$if not defined(WHIRLPOOL_Update_allownil)} + WHIRLPOOL_Update := @ERR_WHIRLPOOL_Update; + {$ifend} + {$if declared(WHIRLPOOL_Update_introduced)} + if LibVersion < WHIRLPOOL_Update_introduced then + begin + {$if declared(FC_WHIRLPOOL_Update)} + WHIRLPOOL_Update := @FC_WHIRLPOOL_Update; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(WHIRLPOOL_Update_removed)} + if WHIRLPOOL_Update_removed <= LibVersion then + begin + {$if declared(_WHIRLPOOL_Update)} + WHIRLPOOL_Update := @_WHIRLPOOL_Update; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(WHIRLPOOL_Update_allownil)} + if FuncLoadError then + AFailed.Add('WHIRLPOOL_Update'); + {$ifend} + end; + + + WHIRLPOOL_BitUpdate := LoadLibFunction(ADllHandle, WHIRLPOOL_BitUpdate_procname); + FuncLoadError := not assigned(WHIRLPOOL_BitUpdate); + if FuncLoadError then + begin + {$if not defined(WHIRLPOOL_BitUpdate_allownil)} + WHIRLPOOL_BitUpdate := @ERR_WHIRLPOOL_BitUpdate; + {$ifend} + {$if declared(WHIRLPOOL_BitUpdate_introduced)} + if LibVersion < WHIRLPOOL_BitUpdate_introduced then + begin + {$if declared(FC_WHIRLPOOL_BitUpdate)} + WHIRLPOOL_BitUpdate := @FC_WHIRLPOOL_BitUpdate; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(WHIRLPOOL_BitUpdate_removed)} + if WHIRLPOOL_BitUpdate_removed <= LibVersion then + begin + {$if declared(_WHIRLPOOL_BitUpdate)} + WHIRLPOOL_BitUpdate := @_WHIRLPOOL_BitUpdate; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(WHIRLPOOL_BitUpdate_allownil)} + if FuncLoadError then + AFailed.Add('WHIRLPOOL_BitUpdate'); + {$ifend} + end; + + + WHIRLPOOL_Final := LoadLibFunction(ADllHandle, WHIRLPOOL_Final_procname); + FuncLoadError := not assigned(WHIRLPOOL_Final); + if FuncLoadError then + begin + {$if not defined(WHIRLPOOL_Final_allownil)} + WHIRLPOOL_Final := @ERR_WHIRLPOOL_Final; + {$ifend} + {$if declared(WHIRLPOOL_Final_introduced)} + if LibVersion < WHIRLPOOL_Final_introduced then + begin + {$if declared(FC_WHIRLPOOL_Final)} + WHIRLPOOL_Final := @FC_WHIRLPOOL_Final; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(WHIRLPOOL_Final_removed)} + if WHIRLPOOL_Final_removed <= LibVersion then + begin + {$if declared(_WHIRLPOOL_Final)} + WHIRLPOOL_Final := @_WHIRLPOOL_Final; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(WHIRLPOOL_Final_allownil)} + if FuncLoadError then + AFailed.Add('WHIRLPOOL_Final'); + {$ifend} + end; + + + WHIRLPOOL := LoadLibFunction(ADllHandle, WHIRLPOOL_procname); + FuncLoadError := not assigned(WHIRLPOOL); + if FuncLoadError then + begin + {$if not defined(WHIRLPOOL_allownil)} + WHIRLPOOL := @ERR_WHIRLPOOL; + {$ifend} + {$if declared(WHIRLPOOL_introduced)} + if LibVersion < WHIRLPOOL_introduced then + begin + {$if declared(FC_WHIRLPOOL)} + WHIRLPOOL := @FC_WHIRLPOOL; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(WHIRLPOOL_removed)} + if WHIRLPOOL_removed <= LibVersion then + begin + {$if declared(_WHIRLPOOL)} + WHIRLPOOL := @_WHIRLPOOL; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(WHIRLPOOL_allownil)} + if FuncLoadError then + AFailed.Add('WHIRLPOOL'); + {$ifend} + end; + + +end; + +procedure Unload; +begin + WHIRLPOOL_Init := nil; + WHIRLPOOL_Update := nil; + WHIRLPOOL_BitUpdate := nil; + WHIRLPOOL_Final := nil; + WHIRLPOOL := nil; +end; +{$ELSE} +{$ENDIF} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +initialization + Register_SSLLoader(@Load,'LibCrypto'); + Register_SSLUnloader(@Unload); +{$ENDIF} +end. diff --git a/IdOpenSSLHeaders_x509.pas b/IdOpenSSLHeaders_x509.pas new file mode 100644 index 0000000..83a265b --- /dev/null +++ b/IdOpenSSLHeaders_x509.pas @@ -0,0 +1,17925 @@ + (* This unit was generated using the script genOpenSSLHdrs.sh from the source file IdOpenSSLHeaders_x509.h2pas + It should not be modified directly. All changes should be made to IdOpenSSLHeaders_x509.h2pas + and this file regenerated. IdOpenSSLHeaders_x509.h2pas is distributed with the full Indy + Distribution. + *) + +{$i IdCompilerDefines.inc} +{$i IdSSLOpenSSLDefines.inc} +{$IFNDEF USE_OPENSSL} + { error Should not compile if USE_OPENSSL is not defined!!!} +{$ENDIF} +{******************************************************************************} +{ } +{ Indy (Internet Direct) - Internet Protocols Simplified } +{ } +{ https://www.indyproject.org/ } +{ https://gitter.im/IndySockets/Indy } +{ } +{******************************************************************************} +{ } +{ This file is part of the Indy (Internet Direct) project, and is offered } +{ under the dual-licensing agreement described on the Indy website. } +{ (https://www.indyproject.org/license/) } +{ } +{ Copyright: } +{ (c) 1993-2020, Chad Z. Hower and the Indy Pit Crew. All rights reserved. } +{ } +{******************************************************************************} +{ } +{ } +{******************************************************************************} + +unit IdOpenSSLHeaders_x509; + +interface + +// Headers for OpenSSL 1.1.1 +// x509.h + + +uses + IdCTypes, + IdGlobal, + IdSSLOpenSSLConsts, + IdOpenSSLHeaders_asn1, + IdOpenSSLHeaders_bio, + IdOpenSSLHeaders_evp, + IdOpenSSLHeaders_stack, + IdOpenSSLHeaders_objects, + IdOpenSSLHeaders_ossl_typ; + +type + X509_ALGORS = type Pointer; + +const + (* Flags for X509_get_signature_info() *) + (* Signature info is valid *) + X509_SIG_INFO_VALID = $1; + (* Signature is suitable for TLS use *) + X509_SIG_INFO_TLS = $2; + + X509_FILETYPE_PEM = 1; + X509_FILETYPE_ASN1 = 2; + X509_FILETYPE_DEFAULT = 3; + + X509v3_KU_DIGITAL_SIGNATURE = $0080; + X509v3_KU_NON_REPUDIATION = $0040; + X509v3_KU_KEY_ENCIPHERMENT = $0020; + X509v3_KU_DATA_ENCIPHERMENT = $0010; + X509v3_KU_KEY_AGREEMENT = $0008; + X509v3_KU_KEY_CERT_SIGN = $0004; + X509v3_KU_CRL_SIGN = $0002; + X509v3_KU_ENCIPHER_ONLY = $0001; + X509v3_KU_DECIPHER_ONLY = $8000; + X509v3_KU_UNDEF = $ffff; + + X509_EX_V_NETSCAPE_HACK = $8000; + X509_EX_V_INIT = $0001; + + + (* standard trust ids *) + + X509_TRUST_DEFAULT = 0; (* Only valid in purpose settings *) + + X509_TRUST_COMPAT = 1; + X509_TRUST_SSL_CLIENT = 2; + X509_TRUST_SSL_SERVER = 3; + X509_TRUST_EMAIL = 4; + X509_TRUST_OBJECT_SIGN = 5; + X509_TRUST_OCSP_SIGN = 6; + X509_TRUST_OCSP_REQUEST = 7; + X509_TRUST_TSA = 8; + + (* Keep these up to date! *) + X509_TRUST_MIN = 1; + X509_TRUST_MAX = 8; + + (* trust_flags values *) + X509_TRUST_DYNAMIC = TIdC_UINT(1) shl 0; + X509_TRUST_DYNAMIC_NAME = TIdC_UINT(1) shl 1; + (* No compat trust if self-signed, preempts "DO_SS" *) + X509_TRUST_NO_SS_COMPAT = TIdC_UINT(1) shl 2; + (* Compat trust if no explicit accepted trust EKUs *) + X509_TRUST_DO_SS_COMPAT = TIdC_UINT(1) shl 3; + (* Accept "anyEKU" as a wildcard trust OID *) + X509_TRUST_OK_ANY_EKU = TIdC_UINT(1) shl 4; + + (* check_trust return codes *) + + X509_TRUST_TRUSTED = 1; + X509_TRUST_REJECTED = 2; + X509_TRUST_UNTRUSTED = 3; + + (* Flags for X509_print_ex() *) + + X509_FLAG_COMPAT = 0; + X509_FLAG_NO_HEADER = TIdC_LONG(1); + X509_FLAG_NO_VERSION = TIdC_LONG(1) shl 1; + X509_FLAG_NO_SERIAL = TIdC_LONG(1) shl 2; + X509_FLAG_NO_SIGNAME = TIdC_LONG(1) shl 3; + X509_FLAG_NO_ISSUER = TIdC_LONG(1) shl 4; + X509_FLAG_NO_VALIDITY = TIdC_LONG(1) shl 5; + X509_FLAG_NO_SUBJECT = TIdC_LONG(1) shl 6; + X509_FLAG_NO_PUBKEY = TIdC_LONG(1) shl 7; + X509_FLAG_NO_EXTENSIONS = TIdC_LONG(1) shl 8; + X509_FLAG_NO_SIGDUMP = TIdC_LONG(1) shl 9; + X509_FLAG_NO_AUX = TIdC_LONG(1) shl 10; + X509_FLAG_NO_ATTRIBUTES = TIdC_LONG(1) shl 11; + X509_FLAG_NO_IDS = TIdC_LONG(1) shl 12; + + (* Flags specific to X509_NAME_print_ex() *) + + (* The field separator information *) + + XN_FLAG_SEP_MASK = $f shl 16; + + XN_FLAG_COMPAT = 0;(* Traditional; use old X509_NAME_print *) + XN_FLAG_SEP_COMMA_PLUS = 1 shl 16;(* RFC2253 ,+ *) + XN_FLAG_SEP_CPLUS_SPC = 2 shl 16;(* ,+ spaced: more readable *) + XN_FLAG_SEP_SPLUS_SPC = 3 shl 16;(* ;+ spaced *) + XN_FLAG_SEP_MULTILINE = 4 shl 16;(* One line per field *) + + XN_FLAG_DN_REV = 1 shl 20;(* Reverse DN order *) + + (* How the field name is shown *) + + XN_FLAG_FN_MASK = $3 shl 21; + + XN_FLAG_FN_SN = 0;(* Object short name *) + XN_FLAG_FN_LN = 1 shl 21;(* Object long name *) + XN_FLAG_FN_OID = 2 shl 21;(* Always use OIDs *) + XN_FLAG_FN_NONE = 3 shl 21;(* No field names *) + + XN_FLAG_SPC_EQ = 1 shl 23;(* Put spaces round '=' *) + + {function codes} + X509_F_ADD_CERT_DIR = 100; + X509_F_BY_FILE_CTRL = 101; + X509_F_CHECK_NAME_CONSTRAINTS = 106; + X509_F_CHECK_POLICY = 145; + X509_F_DIR_CTRL = 102; + X509_F_GET_CERT_BY_SUBJECT = 103; + X509_F_NETSCAPE_SPKI_B64_DECODE = 129; + X509_F_NETSCAPE_SPKI_B64_ENCODE = 130; + X509_F_X509AT_ADD1_ATTR = 135; + X509_F_X509V3_ADD_EXT = 104; + X509_F_X509_ATTRIBUTE_CREATE_BY_NID = 136; + X509_F_X509_ATTRIBUTE_CREATE_BY_OBJ = 137; + X509_F_X509_ATTRIBUTE_CREATE_BY_TXT = 140; + X509_F_X509_ATTRIBUTE_GET0_DATA = 139; + X509_F_X509_ATTRIBUTE_SET1_DATA = 138; + X509_F_X509_CHECK_PRIVATE_KEY = 128; + X509_F_X509_CRL_DIFF = 105; + X509_F_X509_CRL_PRINT_FP = 147; + X509_F_X509_EXTENSION_CREATE_BY_NID = 108; + X509_F_X509_EXTENSION_CREATE_BY_OBJ = 109; + X509_F_X509_GET_PUBKEY_PARAMETERS = 110; + X509_F_X509_LOAD_CERT_CRL_FILE = 132; + X509_F_X509_LOAD_CERT_FILE = 111; + X509_F_X509_LOAD_CRL_FILE = 112; + X509_F_X509_NAME_ADD_ENTRY = 113; + X509_F_X509_NAME_ENTRY_CREATE_BY_NID = 114; + X509_F_X509_NAME_ENTRY_CREATE_BY_TXT = 131; + X509_F_X509_NAME_ENTRY_SET_OBJECT = 115; + X509_F_X509_NAME_ONELINE = 116; + X509_F_X509_NAME_PRINT = 117; + X509_F_X509_PRINT_EX_FP = 118; + X509_F_X509_PUBKEY_GET = 119; + X509_F_X509_PUBKEY_SET = 120; + X509_F_X509_REQ_CHECK_PRIVATE_KEY = 144; + X509_F_X509_REQ_PRINT_EX = 121; + X509_F_X509_REQ_PRINT_FP = 122; + X509_F_X509_REQ_TO_X509 = 123; + X509_F_X509_STORE_ADD_CERT = 124; + X509_F_X509_STORE_ADD_CRL = 125; + X509_F_X509_STORE_CTX_GET1_ISSUER = 146; + X509_F_X509_STORE_CTX_INIT = 143; + X509_F_X509_STORE_CTX_NEW = 142; + X509_F_X509_STORE_CTX_PURPOSE_INHERIT = 134; + X509_F_X509_TO_X509_REQ = 126; + X509_F_X509_TRUST_ADD = 133; + X509_F_X509_TRUST_SET = 141; + X509_F_X509_VERIFY_CERT = 127; + + {Reason Codes} + X509_R_AKID_MISMATCH = 110; + X509_R_BAD_X509_FILETYPE = 100; + X509_R_BASE64_DECODE_ERROR = 118; + X509_R_CANT_CHECK_DH_KEY = 114; + X509_R_CERT_ALREADY_IN_HASH_TABLE = 101; + X509_R_CRL_ALREADY_DELTA = 127; + X509_R_CRL_VERIFY_FAILURE = 131; + X509_R_ERR_ASN1_LIB = 102; + X509_R_IDP_MISMATCH = 128; + X509_R_INVALID_DIRECTORY = 113; + X509_R_INVALID_FIELD_NAME = 119; + X509_R_INVALID_TRUST = 123; + X509_R_ISSUER_MISMATCH = 129; + X509_R_KEY_TYPE_MISMATCH = 115; + X509_R_KEY_VALUES_MISMATCH = 116; + X509_R_LOADING_CERT_DIR = 103; + X509_R_LOADING_DEFAULTS = 104; + X509_R_METHOD_NOT_SUPPORTED = 124; + X509_R_NAME_TOO_LONG = 134; + X509_R_NEWER_CRL_NOT_NEWER = 132; + X509_R_NO_CERT_SET_FOR_US_TO_VERIFY = 105; + X509_R_NO_CRL_NUMBER = 130; + X509_R_PUBLIC_KEY_DECODE_ERROR = 125; + X509_R_PUBLIC_KEY_ENCODE_ERROR = 126; + X509_R_SHOULD_RETRY = 106; + X509_R_UNABLE_TO_FIND_PARAMETERS_IN_CHAIN = 107; + X509_R_UNABLE_TO_GET_CERTS_PUBLIC_KEY = 108; + X509_R_UNKNOWN_KEY_TYPE = 117; + X509_R_UNKNOWN_NID = 109; + X509_R_UNKNOWN_PURPOSE_ID = 121; + X509_R_UNKNOWN_TRUST_ID = 120; + X509_R_UNSUPPORTED_ALGORITHM = 111; + X509_R_WRONG_LOOKUP_TYPE = 112; + X509_R_WRONG_TYPE = 122; + + (* + * This determines if we dump fields we don't recognise: RFC2253 requires + * this. + *) + + XN_FLAG_DUMP_UNKNOWN_FIELDS = 1 shl 24; + + XN_FLAG_FN_ALIGN = 1 shl 25;(* Align field names to 20 + * characters *) + + (* Complete set of RFC2253 flags *) + + XN_FLAG_RFC2253 = ASN1_STRFLGS_RFC2253 or XN_FLAG_SEP_COMMA_PLUS + or XN_FLAG_DN_REV or XN_FLAG_FN_SN or XN_FLAG_DUMP_UNKNOWN_FIELDS; + + (* readable oneline form *) + + XN_FLAG_ONELINE = ASN1_STRFLGS_RFC2253 or ASN1_STRFLGS_ESC_QUOTE + or XN_FLAG_SEP_CPLUS_SPC or XN_FLAG_SPC_EQ or XN_FLAG_FN_SN; + + (* readable multiline form *) + + XN_FLAG_MULTILINE = ASN1_STRFLGS_ESC_CTRL or ASN1_STRFLGS_ESC_MSB + or XN_FLAG_SEP_MULTILINE or XN_FLAG_SPC_EQ or XN_FLAG_FN_LN or XN_FLAG_FN_ALIGN; + + X509_EXT_PACK_UNKNOWN = 1; + X509_EXT_PACK_STRING = 2; + +type + + X509_val_st = record + notBefore: PASN1_TIME; + notAfter: PASN1_TIME; + end; + X509_VAL = X509_val_st; + PX509_VAL = ^X509_VAL; + PPX509_VAL = ^PX509_VAL; + + X509_SIG = type Pointer; // X509_sig_st + PX509_SIG = ^X509_SIG; + PPX509_SIG = ^PX509_SIG; + + X509_NAME_ENTRY = type Pointer; // X509_name_entry_st + PX509_NAME_ENTRY = ^X509_NAME_ENTRY; + PPX509_NAME_ENTRY = ^PX509_NAME_ENTRY; + + //DEFINE_STACK_OF(X509_NAME_ENTRY) + PSTACK_OF_X509_NAME_ENTRY = type pointer; + // + //DEFINE_STACK_OF(X509_NAME) + PSTACK_OF_X509_NAME = type pointer; + + X509_EXTENSION = type Pointer; // X509_extension_st + PX509_EXTENSION = ^X509_EXTENSION; + PPX509_EXTENSION = ^PX509_EXTENSION; + + //typedef STACK_OF(X509_EXTENSION) X509_EXTENSIONS; + // + //DEFINE_STACK_OF(X509_EXTENSION) + + X509_ATTRIBUTE = type Pointer; // x509_attributes_st + PX509_ATTRIBUTE = ^X509_ATTRIBUTE; + PPX509_ATTRIBUTE = ^PX509_ATTRIBUTE; + + //DEFINE_STACK_OF(X509_ATTRIBUTE) + + X509_REQ_INFO = type Pointer; // X509_req_info_st + PX509_REQ_INFO = ^X509_REQ_INFO; + PPX509_REQ_INFO = ^PX509_REQ_INFO; + + X509_CERT_AUX = type Pointer; // x509_cert_aux_st + + X509_CINF = type Pointer; // x509_cinf_st + + //DEFINE_STACK_OF(X509) + + (* This is used for a table of trust checking functions *) + + Px509_trust_st = ^x509_trust_st; + x509_trust_st = record + trust: TIdC_INT; + flags: TIdC_INT; + check_trust: function(v1: Px509_trust_st; v2: PX509; v3: TIdC_INT): TIdC_INT; cdecl; + name: PIdAnsiChar; + arg1: TIdC_INT; + arg2: Pointer; + end; + X509_TRUST = x509_trust_st; + PX509_TRUST = ^X509_TRUST; + + //DEFINE_STACK_OF(X509_TRUST) + + //DEFINE_STACK_OF(X509_REVOKED) + X509_CRL_INFO = type Pointer; // X509_crl_info_st + PX509_CRL_INFO = ^X509_CRL_INFO; + PPX509_CRL_INFO = ^PX509_CRL_INFO; + + //DEFINE_STACK_OF(X509_CRL) + + private_key_st = record + version: TIdC_INT; + (* The PKCS#8 data types *) + enc_algor: PX509_ALGOR; + enc_pkey: PASN1_OCTET_STRING; (* encrypted pub key *) + (* When decrypted, the following will not be NULL *) + dec_pkey: PEVP_PKEY; + (* used to encrypt and decrypt *) + key_length: TIdC_INT; + key_data: PIdAnsiChar; + key_free: TIdC_INT; (* true if we should auto free key_data *) + (* expanded version of 'enc_algor' *) + cipher: EVP_CIPHER_INFO; + end; + X509_PKEY = private_key_st; + PX509_PKEY = ^X509_PKEY; + + X509_info_st = record + x509: PX509; + crl: PX509_CRL; + x_pkey: PX509_PKEY; + enc_cipher: EVP_CIPHER_INFO; + enc_len: TIdC_INT; + enc_data: PIdAnsiChar; + end; + X509_INFO = X509_info_st; + PX509_INFO = ^X509_INFO; + + //DEFINE_STACK_OF(X509_INFO) + + (* + * The next 2 structures and their 8 routines are used to manipulate Netscape's + * spki structures - useful if you are writing a CA web page + *) + Netscape_spkac_st = record + pubkey: PX509_PUBKEY; + challenge: PASN1_IA5STRING; (* challenge sent in atlas >= PR2 *) + end; + NETSCAPE_SPKAC = Netscape_spkac_st; + PNETSCAPE_SPKAC = ^NETSCAPE_SPKAC; + + Netscape_spki_st = record + spkac: PNETSCAPE_SPKAC; (* signed public key and challenge *) + sig_algor: X509_ALGOR; + signature: PASN1_BIT_STRING; + end; + NETSCAPE_SPKI = Netscape_spki_st; + PNETSCAPE_SPKI = ^NETSCAPE_SPKI; + + (* Netscape certificate sequence structure *) +// Netscape_certificate_sequence: record +// type_: PASN1_OBJECT; +// certs: P --> STACK_OF(X509) <--; +// end; +// NETSCAPE_CERT_SEQUENCE = Netscape_certificate_sequence; + + (*- Unused (and iv length is wrong) + typedef struct CBCParameter_st + { + unsigned char iv[8]; + } CBC_PARAM; + *) + + (* Password based encryption structure *) + PBEPARAM_st = record + salt: PASN1_OCTET_STRING; + iter: PASN1_INTEGER; + end; + PBEPARAM = PBEPARAM_st; + + (* Password based encryption V2 structures *) + PBE2PARAM_st = record + keyfunc: PX509_ALGOR; + encryption: X509_ALGOR; + end; + PBE2PARAM = PBE2PARAM_st; + + PBKDF2PARAM_st = record + (* Usually OCTET STRING but could be anything *) + salt: PASN1_TYPE; + iter: PASN1_INTEGER; + keylength: PASN1_INTEGER; + prf: X509_ALGOR; + end; + PBKDF2PARAM = PBKDF2PARAM_st; + + SCRYPT_PARAMS_st = record + salt: PASN1_OCTET_STRING; + costParameter: PASN1_INTEGER; + blockSize: PASN1_INTEGER; + parallelizationParameter: PASN1_INTEGER; + keyLength: ASN1_INTEGER; + end; + SCRYPT_PARAMS = SCRYPT_PARAMS_st; + + //# define X509_extract_key(x) X509_get_pubkey(x)(*****) + //# define X509_REQ_extract_key(a) X509_REQ_get_pubkey(a) + //# define X509_name_cmp(a,b) X509_NAME_cmp((a),(b)) + // + + { The EXTERNALSYM directive is ignored by FPC, however, it is used by Delphi as follows: + + The EXTERNALSYM directive prevents the specified Delphi symbol from appearing in header + files generated for C++. } + + {$EXTERNALSYM X509_CRL_set_default_method} + {$EXTERNALSYM X509_CRL_METHOD_free} + {$EXTERNALSYM X509_CRL_set_meth_data} + {$EXTERNALSYM X509_CRL_get_meth_data} + {$EXTERNALSYM X509_verify_cert_error_string} + {$EXTERNALSYM X509_verify} + {$EXTERNALSYM X509_REQ_verify} + {$EXTERNALSYM X509_CRL_verify} + {$EXTERNALSYM NETSCAPE_SPKI_verify} + {$EXTERNALSYM NETSCAPE_SPKI_b64_decode} + {$EXTERNALSYM NETSCAPE_SPKI_b64_encode} + {$EXTERNALSYM NETSCAPE_SPKI_get_pubkey} + {$EXTERNALSYM NETSCAPE_SPKI_set_pubkey} + {$EXTERNALSYM NETSCAPE_SPKI_print} + {$EXTERNALSYM X509_signature_dump} + {$EXTERNALSYM X509_signature_print} + {$EXTERNALSYM X509_sign} + {$EXTERNALSYM X509_sign_ctx} + {$EXTERNALSYM X509_REQ_sign} + {$EXTERNALSYM X509_REQ_sign_ctx} + {$EXTERNALSYM X509_CRL_sign} + {$EXTERNALSYM X509_CRL_sign_ctx} + {$EXTERNALSYM NETSCAPE_SPKI_sign} + {$EXTERNALSYM X509_pubkey_digest} + {$EXTERNALSYM X509_digest} + {$EXTERNALSYM X509_CRL_digest} + {$EXTERNALSYM X509_REQ_digest} + {$EXTERNALSYM X509_NAME_digest} + {$EXTERNALSYM d2i_X509_bio} + {$EXTERNALSYM i2d_X509_bio} + {$EXTERNALSYM d2i_X509_CRL_bio} + {$EXTERNALSYM i2d_X509_CRL_bio} + {$EXTERNALSYM d2i_X509_REQ_bio} + {$EXTERNALSYM i2d_X509_REQ_bio} + {$EXTERNALSYM d2i_RSAPrivateKey_bio} + {$EXTERNALSYM i2d_RSAPrivateKey_bio} + {$EXTERNALSYM d2i_RSAPublicKey_bio} + {$EXTERNALSYM i2d_RSAPublicKey_bio} + {$EXTERNALSYM d2i_RSA_PUBKEY_bio} + {$EXTERNALSYM i2d_RSA_PUBKEY_bio} + {$EXTERNALSYM d2i_DSA_PUBKEY_bio} + {$EXTERNALSYM i2d_DSA_PUBKEY_bio} + {$EXTERNALSYM d2i_DSAPrivateKey_bio} + {$EXTERNALSYM i2d_DSAPrivateKey_bio} + {$EXTERNALSYM d2i_EC_PUBKEY_bio} + {$EXTERNALSYM i2d_EC_PUBKEY_bio} + {$EXTERNALSYM d2i_ECPrivateKey_bio} + {$EXTERNALSYM i2d_ECPrivateKey_bio} + {$EXTERNALSYM d2i_PKCS8_bio} + {$EXTERNALSYM i2d_PKCS8_bio} + {$EXTERNALSYM d2i_PKCS8_PRIV_KEY_INFO_bio} + {$EXTERNALSYM i2d_PKCS8_PRIV_KEY_INFO_bio} + {$EXTERNALSYM i2d_PKCS8PrivateKeyInfo_bio} + {$EXTERNALSYM i2d_PrivateKey_bio} + {$EXTERNALSYM d2i_PrivateKey_bio} + {$EXTERNALSYM i2d_PUBKEY_bio} + {$EXTERNALSYM d2i_PUBKEY_bio} + {$EXTERNALSYM X509_dup} + {$EXTERNALSYM X509_ATTRIBUTE_dup} + {$EXTERNALSYM X509_EXTENSION_dup} + {$EXTERNALSYM X509_CRL_dup} + {$EXTERNALSYM X509_REVOKED_dup} + {$EXTERNALSYM X509_REQ_dup} + {$EXTERNALSYM X509_ALGOR_dup} + {$EXTERNALSYM X509_ALGOR_set0} + {$EXTERNALSYM X509_ALGOR_get0} + {$EXTERNALSYM X509_ALGOR_set_md} + {$EXTERNALSYM X509_ALGOR_cmp} + {$EXTERNALSYM X509_NAME_dup} + {$EXTERNALSYM X509_NAME_ENTRY_dup} + {$EXTERNALSYM X509_cmp_time} + {$EXTERNALSYM X509_cmp_current_time} + {$EXTERNALSYM X509_time_adj} + {$EXTERNALSYM X509_time_adj_ex} + {$EXTERNALSYM X509_gmtime_adj} + {$EXTERNALSYM X509_get_default_cert_area} + {$EXTERNALSYM X509_get_default_cert_dir} + {$EXTERNALSYM X509_get_default_cert_file} + {$EXTERNALSYM X509_get_default_cert_dir_env} + {$EXTERNALSYM X509_get_default_cert_file_env} + {$EXTERNALSYM X509_get_default_private_dir} + {$EXTERNALSYM X509_to_X509_REQ} + {$EXTERNALSYM X509_REQ_to_X509} + {$EXTERNALSYM X509_ALGOR_new} + {$EXTERNALSYM X509_ALGOR_free} + {$EXTERNALSYM d2i_X509_ALGOR} + {$EXTERNALSYM i2d_X509_ALGOR} + {$EXTERNALSYM X509_VAL_new} + {$EXTERNALSYM X509_VAL_free} + {$EXTERNALSYM d2i_X509_VAL} + {$EXTERNALSYM i2d_X509_VAL} + {$EXTERNALSYM X509_PUBKEY_new} + {$EXTERNALSYM X509_PUBKEY_free} + {$EXTERNALSYM d2i_X509_PUBKEY} + {$EXTERNALSYM i2d_X509_PUBKEY} + {$EXTERNALSYM X509_PUBKEY_set} + {$EXTERNALSYM X509_PUBKEY_get0} {introduced 1.1.0} + {$EXTERNALSYM X509_PUBKEY_get} + {$EXTERNALSYM X509_get_pathlen} {introduced 1.1.0} + {$EXTERNALSYM i2d_PUBKEY} + {$EXTERNALSYM d2i_PUBKEY} + {$EXTERNALSYM i2d_RSA_PUBKEY} + {$EXTERNALSYM d2i_RSA_PUBKEY} + {$EXTERNALSYM i2d_DSA_PUBKEY} + {$EXTERNALSYM d2i_DSA_PUBKEY} + {$EXTERNALSYM i2d_EC_PUBKEY} + {$EXTERNALSYM d2i_EC_PUBKEY} + {$EXTERNALSYM X509_SIG_new} + {$EXTERNALSYM X509_SIG_free} + {$EXTERNALSYM d2i_X509_SIG} + {$EXTERNALSYM i2d_X509_SIG} + {$EXTERNALSYM X509_SIG_get0} {introduced 1.1.0} + {$EXTERNALSYM X509_SIG_getm} {introduced 1.1.0} + {$EXTERNALSYM X509_REQ_INFO_new} + {$EXTERNALSYM X509_REQ_INFO_free} + {$EXTERNALSYM d2i_X509_REQ_INFO} + {$EXTERNALSYM i2d_X509_REQ_INFO} + {$EXTERNALSYM X509_REQ_new} + {$EXTERNALSYM X509_REQ_free} + {$EXTERNALSYM d2i_X509_REQ} + {$EXTERNALSYM i2d_X509_REQ} + {$EXTERNALSYM X509_ATTRIBUTE_new} + {$EXTERNALSYM X509_ATTRIBUTE_free} + {$EXTERNALSYM d2i_X509_ATTRIBUTE} + {$EXTERNALSYM i2d_X509_ATTRIBUTE} + {$EXTERNALSYM X509_ATTRIBUTE_create} + {$EXTERNALSYM X509_EXTENSION_new} + {$EXTERNALSYM X509_EXTENSION_free} + {$EXTERNALSYM d2i_X509_EXTENSION} + {$EXTERNALSYM i2d_X509_EXTENSION} + {$EXTERNALSYM X509_NAME_ENTRY_new} + {$EXTERNALSYM X509_NAME_ENTRY_free} + {$EXTERNALSYM d2i_X509_NAME_ENTRY} + {$EXTERNALSYM i2d_X509_NAME_ENTRY} + {$EXTERNALSYM X509_NAME_new} + {$EXTERNALSYM X509_NAME_free} + {$EXTERNALSYM d2i_X509_NAME} + {$EXTERNALSYM i2d_X509_NAME} + {$EXTERNALSYM X509_NAME_set} + {$EXTERNALSYM X509_new} + {$EXTERNALSYM X509_free} + {$EXTERNALSYM d2i_X509} + {$EXTERNALSYM i2d_X509} + {$EXTERNALSYM X509_set_ex_data} + {$EXTERNALSYM X509_get_ex_data} + {$EXTERNALSYM i2d_X509_AUX} + {$EXTERNALSYM d2i_X509_AUX} + {$EXTERNALSYM i2d_re_X509_tbs} + {$EXTERNALSYM X509_SIG_INFO_get} {introduced 1.1.0} + {$EXTERNALSYM X509_SIG_INFO_set} {introduced 1.1.0} + {$EXTERNALSYM X509_get_signature_info} {introduced 1.1.0} + {$EXTERNALSYM X509_get0_signature} {introduced 1.1.0} + {$EXTERNALSYM X509_get_signature_nid} + {$EXTERNALSYM X509_trusted} {introduced 1.1.0} + {$EXTERNALSYM X509_alias_set1} + {$EXTERNALSYM X509_keyid_set1} + {$EXTERNALSYM X509_alias_get0} + {$EXTERNALSYM X509_keyid_get0} + {$EXTERNALSYM X509_TRUST_set} + {$EXTERNALSYM X509_add1_trust_object} + {$EXTERNALSYM X509_add1_reject_object} + {$EXTERNALSYM X509_trust_clear} + {$EXTERNALSYM X509_reject_clear} + {$EXTERNALSYM X509_REVOKED_new} + {$EXTERNALSYM X509_REVOKED_free} + {$EXTERNALSYM d2i_X509_REVOKED} + {$EXTERNALSYM i2d_X509_REVOKED} + {$EXTERNALSYM X509_CRL_INFO_new} + {$EXTERNALSYM X509_CRL_INFO_free} + {$EXTERNALSYM d2i_X509_CRL_INFO} + {$EXTERNALSYM i2d_X509_CRL_INFO} + {$EXTERNALSYM X509_CRL_new} + {$EXTERNALSYM X509_CRL_free} + {$EXTERNALSYM d2i_X509_CRL} + {$EXTERNALSYM i2d_X509_CRL} + {$EXTERNALSYM X509_CRL_add0_revoked} + {$EXTERNALSYM X509_CRL_get0_by_serial} + {$EXTERNALSYM X509_CRL_get0_by_cert} + {$EXTERNALSYM X509_PKEY_new} + {$EXTERNALSYM X509_PKEY_free} + {$EXTERNALSYM X509_INFO_new} + {$EXTERNALSYM X509_INFO_free} + {$EXTERNALSYM X509_NAME_oneline} + {$EXTERNALSYM ASN1_item_digest} + {$EXTERNALSYM ASN1_item_verify} + {$EXTERNALSYM ASN1_item_sign} + {$EXTERNALSYM ASN1_item_sign_ctx} + {$EXTERNALSYM X509_get_version} {introduced 1.1.0} + {$EXTERNALSYM X509_set_version} + {$EXTERNALSYM X509_set_serialNumber} + {$EXTERNALSYM X509_get_serialNumber} + {$EXTERNALSYM X509_get0_serialNumber} {introduced 1.1.0} + {$EXTERNALSYM X509_set_issuer_name} + {$EXTERNALSYM X509_get_issuer_name} + {$EXTERNALSYM X509_set_subject_name} + {$EXTERNALSYM X509_get_subject_name} + {$EXTERNALSYM X509_get0_notBefore} {introduced 1.1.0} + {$EXTERNALSYM X509_getm_notBefore} {introduced 1.1.0} + {$EXTERNALSYM X509_set1_notBefore} {introduced 1.1.0} + {$EXTERNALSYM X509_get0_notAfter} {introduced 1.1.0} + {$EXTERNALSYM X509_getm_notAfter} {introduced 1.1.0} + {$EXTERNALSYM X509_set1_notAfter} {introduced 1.1.0} + {$EXTERNALSYM X509_set_pubkey} + {$EXTERNALSYM X509_up_ref} {introduced 1.1.0} + {$EXTERNALSYM X509_get_signature_type} {introduced 1.1.0} + {$EXTERNALSYM X509_get_X509_PUBKEY} {introduced 1.1.0} + {$EXTERNALSYM X509_get0_uids} {introduced 1.1.0} + {$EXTERNALSYM X509_get0_tbs_sigalg} {introduced 1.1.0} + {$EXTERNALSYM X509_get0_pubkey} {introduced 1.1.0} + {$EXTERNALSYM X509_get_pubkey} + {$EXTERNALSYM X509_get0_pubkey_bitstr} + {$EXTERNALSYM X509_certificate_type} + {$EXTERNALSYM X509_REQ_get_version} {introduced 1.1.0} + {$EXTERNALSYM X509_REQ_set_version} + {$EXTERNALSYM X509_REQ_get_subject_name} {introduced 1.1.0} + {$EXTERNALSYM X509_REQ_set_subject_name} + {$EXTERNALSYM X509_REQ_get0_signature} {introduced 1.1.0} + {$EXTERNALSYM X509_REQ_get_signature_nid} {introduced 1.1.0} + {$EXTERNALSYM i2d_re_X509_REQ_tbs} {introduced 1.1.0} + {$EXTERNALSYM X509_REQ_set_pubkey} + {$EXTERNALSYM X509_REQ_get_pubkey} + {$EXTERNALSYM X509_REQ_get0_pubkey} {introduced 1.1.0} + {$EXTERNALSYM X509_REQ_get_X509_PUBKEY} {introduced 1.1.0} + {$EXTERNALSYM X509_REQ_extension_nid} + {$EXTERNALSYM X509_REQ_get_extension_nids} + {$EXTERNALSYM X509_REQ_set_extension_nids} + {$EXTERNALSYM X509_REQ_get_attr_count} + {$EXTERNALSYM X509_REQ_get_attr_by_NID} + {$EXTERNALSYM X509_REQ_get_attr_by_OBJ} + {$EXTERNALSYM X509_REQ_get_attr} + {$EXTERNALSYM X509_REQ_delete_attr} + {$EXTERNALSYM X509_REQ_add1_attr} + {$EXTERNALSYM X509_REQ_add1_attr_by_OBJ} + {$EXTERNALSYM X509_REQ_add1_attr_by_NID} + {$EXTERNALSYM X509_REQ_add1_attr_by_txt} + {$EXTERNALSYM X509_CRL_set_version} + {$EXTERNALSYM X509_CRL_set_issuer_name} + {$EXTERNALSYM X509_CRL_set1_lastUpdate} {introduced 1.1.0} + {$EXTERNALSYM X509_CRL_set1_nextUpdate} {introduced 1.1.0} + {$EXTERNALSYM X509_CRL_sort} + {$EXTERNALSYM X509_CRL_up_ref} {introduced 1.1.0} + {$EXTERNALSYM X509_CRL_get_version} {introduced 1.1.0} + {$EXTERNALSYM X509_CRL_get0_lastUpdate} {introduced 1.1.0} + {$EXTERNALSYM X509_CRL_get0_nextUpdate} {introduced 1.1.0} + {$EXTERNALSYM X509_CRL_get_issuer} {introduced 1.1.0} + {$EXTERNALSYM X509_CRL_get0_signature} {introduced 1.1.0} + {$EXTERNALSYM X509_CRL_get_signature_nid} {introduced 1.1.0} + {$EXTERNALSYM i2d_re_X509_CRL_tbs} {introduced 1.1.0} + {$EXTERNALSYM X509_REVOKED_get0_serialNumber} {introduced 1.1.0} + {$EXTERNALSYM X509_REVOKED_set_serialNumber} + {$EXTERNALSYM X509_REVOKED_get0_revocationDate} {introduced 1.1.0} + {$EXTERNALSYM X509_REVOKED_set_revocationDate} + {$EXTERNALSYM X509_CRL_diff} + {$EXTERNALSYM X509_REQ_check_private_key} + {$EXTERNALSYM X509_check_private_key} + {$EXTERNALSYM X509_CRL_check_suiteb} + {$EXTERNALSYM X509_issuer_and_serial_cmp} + {$EXTERNALSYM X509_issuer_and_serial_hash} + {$EXTERNALSYM X509_issuer_name_cmp} + {$EXTERNALSYM X509_issuer_name_hash} + {$EXTERNALSYM X509_subject_name_cmp} + {$EXTERNALSYM X509_subject_name_hash} + {$EXTERNALSYM X509_cmp} + {$EXTERNALSYM X509_NAME_cmp} + {$EXTERNALSYM X509_NAME_hash_old} + {$EXTERNALSYM X509_CRL_cmp} + {$EXTERNALSYM X509_CRL_match} + {$EXTERNALSYM X509_aux_print} {introduced 1.1.0} + {$EXTERNALSYM X509_NAME_print} + {$EXTERNALSYM X509_NAME_print_ex} + {$EXTERNALSYM X509_print_ex} + {$EXTERNALSYM X509_print} + {$EXTERNALSYM X509_ocspid_print} + {$EXTERNALSYM X509_CRL_print_ex} {introduced 1.1.0} + {$EXTERNALSYM X509_CRL_print} + {$EXTERNALSYM X509_REQ_print_ex} + {$EXTERNALSYM X509_REQ_print} + {$EXTERNALSYM X509_NAME_entry_count} + {$EXTERNALSYM X509_NAME_get_text_by_NID} + {$EXTERNALSYM X509_NAME_get_text_by_OBJ} + {$EXTERNALSYM X509_NAME_get_index_by_NID} + {$EXTERNALSYM X509_NAME_get_index_by_OBJ} + {$EXTERNALSYM X509_NAME_get_entry} + {$EXTERNALSYM X509_NAME_delete_entry} + {$EXTERNALSYM X509_NAME_add_entry} + {$EXTERNALSYM X509_NAME_add_entry_by_OBJ} + {$EXTERNALSYM X509_NAME_add_entry_by_NID} + {$EXTERNALSYM X509_NAME_ENTRY_create_by_txt} + {$EXTERNALSYM X509_NAME_ENTRY_create_by_NID} + {$EXTERNALSYM X509_NAME_add_entry_by_txt} + {$EXTERNALSYM X509_NAME_ENTRY_create_by_OBJ} + {$EXTERNALSYM X509_NAME_ENTRY_set_object} + {$EXTERNALSYM X509_NAME_ENTRY_set_data} + {$EXTERNALSYM X509_NAME_ENTRY_get_object} + {$EXTERNALSYM X509_NAME_ENTRY_get_data} + {$EXTERNALSYM X509_NAME_ENTRY_set} {introduced 1.1.0} + {$EXTERNALSYM X509_NAME_get0_der} {introduced 1.1.0} + {$EXTERNALSYM X509_get_ext_count} + {$EXTERNALSYM X509_get_ext_by_NID} + {$EXTERNALSYM X509_get_ext_by_OBJ} + {$EXTERNALSYM X509_get_ext_by_critical} + {$EXTERNALSYM X509_get_ext} + {$EXTERNALSYM X509_delete_ext} + {$EXTERNALSYM X509_add_ext} + {$EXTERNALSYM X509_get_ext_d2i} + {$EXTERNALSYM X509_add1_ext_i2d} + {$EXTERNALSYM X509_CRL_get_ext_count} + {$EXTERNALSYM X509_CRL_get_ext_by_NID} + {$EXTERNALSYM X509_CRL_get_ext_by_OBJ} + {$EXTERNALSYM X509_CRL_get_ext_by_critical} + {$EXTERNALSYM X509_CRL_get_ext} + {$EXTERNALSYM X509_CRL_delete_ext} + {$EXTERNALSYM X509_CRL_add_ext} + {$EXTERNALSYM X509_CRL_get_ext_d2i} + {$EXTERNALSYM X509_CRL_add1_ext_i2d} + {$EXTERNALSYM X509_REVOKED_get_ext_count} + {$EXTERNALSYM X509_REVOKED_get_ext_by_NID} + {$EXTERNALSYM X509_REVOKED_get_ext_by_OBJ} + {$EXTERNALSYM X509_REVOKED_get_ext_by_critical} + {$EXTERNALSYM X509_REVOKED_get_ext} + {$EXTERNALSYM X509_REVOKED_delete_ext} + {$EXTERNALSYM X509_REVOKED_add_ext} + {$EXTERNALSYM X509_REVOKED_get_ext_d2i} + {$EXTERNALSYM X509_REVOKED_add1_ext_i2d} + {$EXTERNALSYM X509_EXTENSION_create_by_NID} + {$EXTERNALSYM X509_EXTENSION_create_by_OBJ} + {$EXTERNALSYM X509_EXTENSION_set_object} + {$EXTERNALSYM X509_EXTENSION_set_critical} + {$EXTERNALSYM X509_EXTENSION_set_data} + {$EXTERNALSYM X509_EXTENSION_get_object} + {$EXTERNALSYM X509_EXTENSION_get_data} + {$EXTERNALSYM X509_EXTENSION_get_critical} + {$EXTERNALSYM X509_ATTRIBUTE_create_by_NID} + {$EXTERNALSYM X509_ATTRIBUTE_create_by_OBJ} + {$EXTERNALSYM X509_ATTRIBUTE_create_by_txt} + {$EXTERNALSYM X509_ATTRIBUTE_set1_object} + {$EXTERNALSYM X509_ATTRIBUTE_set1_data} + {$EXTERNALSYM X509_ATTRIBUTE_get0_data} + {$EXTERNALSYM X509_ATTRIBUTE_count} + {$EXTERNALSYM X509_ATTRIBUTE_get0_object} + {$EXTERNALSYM X509_ATTRIBUTE_get0_type} + {$EXTERNALSYM EVP_PKEY_get_attr_count} + {$EXTERNALSYM EVP_PKEY_get_attr_by_NID} + {$EXTERNALSYM EVP_PKEY_get_attr_by_OBJ} + {$EXTERNALSYM EVP_PKEY_get_attr} + {$EXTERNALSYM EVP_PKEY_delete_attr} + {$EXTERNALSYM EVP_PKEY_add1_attr} + {$EXTERNALSYM EVP_PKEY_add1_attr_by_OBJ} + {$EXTERNALSYM EVP_PKEY_add1_attr_by_NID} + {$EXTERNALSYM EVP_PKEY_add1_attr_by_txt} + {$EXTERNALSYM X509_verify_cert} + {$EXTERNALSYM PKCS5_pbe_set0_algor} + {$EXTERNALSYM PKCS5_pbe_set} + {$EXTERNALSYM PKCS5_pbe2_set} + {$EXTERNALSYM PKCS5_pbe2_set_iv} + {$EXTERNALSYM PKCS5_pbe2_set_scrypt} {introduced 1.1.0} + {$EXTERNALSYM PKCS5_pbkdf2_set} + {$EXTERNALSYM EVP_PKCS82PKEY} + {$EXTERNALSYM EVP_PKEY2PKCS8} + {$EXTERNALSYM PKCS8_pkey_set0} + {$EXTERNALSYM PKCS8_pkey_get0} + {$EXTERNALSYM PKCS8_pkey_add1_attr_by_NID} {introduced 1.1.0} + {$EXTERNALSYM X509_PUBKEY_set0_param} + {$EXTERNALSYM X509_PUBKEY_get0_param} + {$EXTERNALSYM X509_check_trust} + {$EXTERNALSYM X509_TRUST_get_count} + {$EXTERNALSYM X509_TRUST_get0} + {$EXTERNALSYM X509_TRUST_get_by_id} + {$EXTERNALSYM X509_TRUST_cleanup} + {$EXTERNALSYM X509_TRUST_get_flags} + {$EXTERNALSYM X509_TRUST_get0_name} + {$EXTERNALSYM X509_TRUST_get_trust} + {$EXTERNALSYM X509_NAME_hash_ex} {introduced 3.0.0} +{helper_functions} +type +{$EXTERNALSYM Tsk_pop_free_func} +{$EXTERNALSYM Tsk_new_cmp} +{$EXTERNALSYM PSTACK_OF_X509_INFO} + Tsk_new_cmp = function (const a, b : PIdAnsiChar; const c : PIdAnsiChar) : TIdC_INT cdecl; + Tsk_pop_free_func = procedure (p : Pointer); cdecl; + PSTACK_OF_X509_INFO = pointer; + {$EXTERNALSYM sk_X509_NAME_new} + {$EXTERNALSYM sk_X509_NAME_new_null} + {$EXTERNALSYM sk_X509_NAME_free} + {$EXTERNALSYM sk_X509_NAME_num} + {$EXTERNALSYM sk_X509_NAME_value} + {$EXTERNALSYM sk_X509_NAME_push} + {$EXTERNALSYM sk_X509_NAME_dup} + {$EXTERNALSYM sk_X509_NAME_find} + {$EXTERNALSYM sk_X509_NAME_pop_free} + {$EXTERNALSYM sk_X509_INFO_num} + {$EXTERNALSYM sk_X509_INFO_value} + {$EXTERNALSYM sk_X509_INFO_push} + {$EXTERNALSYM sk_X509_INFO_dup} + {$EXTERNALSYM sk_X509_INFO_find} + {$EXTERNALSYM sk_X509_INFO_pop_free} + + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} +{$EXTERNALSYM Tsk_X509_NAME_new} +{$EXTERNALSYM Tsk_X509_NAME_new_null} +{$EXTERNALSYM Tsk_X509_NAME_free} +{$EXTERNALSYM Tsk_X509_NAME_num} +{$EXTERNALSYM Tsk_X509_NAME_value} +{$EXTERNALSYM Tsk_X509_NAME_push} +{$EXTERNALSYM Tsk_X509_NAME_dup} +{$EXTERNALSYM Tsk_X509_NAME_find} +{$EXTERNALSYM Tsk_X509_NAME_pop_free} +{$EXTERNALSYM Tsk_X509_INFO_num} +{$EXTERNALSYM Tsk_X509_INFO_value} +{$EXTERNALSYM Tsk_X509_INFO_push} +{$EXTERNALSYM Tsk_X509_INFO_dup} +{$EXTERNALSYM Tsk_X509_INFO_find} +{$EXTERNALSYM Tsk_X509_INFO_pop_free} +{$EXTERNALSYM Tsk_new_cmp} +type + Tsk_X509_NAME_new = function(cmp : Tsk_new_cmp) : PSTACK_OF_X509_NAME cdecl; + Tsk_X509_NAME_new_null = function : PSTACK_OF_X509_NAME cdecl; + Tsk_X509_NAME_free = procedure(st : PSTACK_OF_X509_NAME) cdecl; + Tsk_X509_NAME_num = function (const sk : PSTACK_OF_X509_NAME) : TIdC_INT cdecl; + Tsk_X509_NAME_value = function (const sk : PSTACK_OF_X509_NAME; i : TIdC_INT) : PX509_NAME cdecl; + Tsk_X509_NAME_push = function (sk : PSTACK_OF_X509_NAME; st : PX509_NAME) : TIdC_INT cdecl; + Tsk_X509_NAME_dup = function (sk : PSTACK_OF_X509_NAME) : PSTACK_OF_X509_NAME cdecl; + Tsk_X509_NAME_find = function (sk : PSTACK_OF_X509_NAME; val : PX509_NAME) : TIdC_INT cdecl; + Tsk_X509_NAME_pop_free = procedure (sk : PSTACK_OF_X509_NAME; func: Tsk_pop_free_func) cdecl; + Tsk_X509_INFO_num = function (const sk : PSTACK_OF_X509_INFO) : TIdC_INT cdecl; + Tsk_X509_INFO_value = function (const sk : PSTACK_OF_X509_INFO; i : TIdC_INT) : PX509_INFO cdecl; + Tsk_X509_INFO_push = function (sk : PSTACK_OF_X509_INFO; st : PX509_INFO) : TIdC_INT cdecl; + Tsk_X509_INFO_dup = function (sk : PSTACK_OF_X509_INFO) : PSTACK_OF_X509_INFO cdecl; + Tsk_X509_INFO_find = function (sk : PSTACK_OF_X509_INFO; val : PX509_INFO) : TIdC_INT cdecl; + Tsk_X509_INFO_pop_free = procedure (sk : PSTACK_OF_X509_INFO; func: Tsk_pop_free_func) cdecl; + +var + sk_X509_NAME_new: Tsk_X509_NAME_new absolute sk_new; + sk_X509_NAME_new_null : Tsk_X509_NAME_new_null absolute sk_new_null; + sk_X509_NAME_free : Tsk_X509_NAME_free absolute sk_free; + sk_X509_NAME_num : Tsk_X509_NAME_num absolute sk_num; + sk_X509_NAME_value : Tsk_X509_NAME_value absolute sk_value; + sk_X509_NAME_push : Tsk_X509_NAME_push absolute sk_push; + sk_X509_NAME_dup : Tsk_X509_NAME_dup absolute sk_dup; + sk_X509_NAME_find : Tsk_X509_NAME_find absolute sk_find; + sk_X509_NAME_pop_free : Tsk_X509_NAME_pop_free absolute sk_pop_free; + sk_X509_INFO_num : Tsk_X509_INFO_num absolute sk_num; + sk_X509_INFO_value : Tsk_X509_INFO_value absolute sk_value; + sk_X509_INFO_push : Tsk_X509_INFO_push absolute sk_push; + sk_X509_INFO_dup : Tsk_X509_INFO_dup absolute sk_dup; + sk_X509_INFO_find : Tsk_X509_INFO_find absolute sk_find; + sk_X509_INFO_pop_free : Tsk_X509_INFO_pop_free absolute sk_pop_free; +{$ELSE} + function sk_X509_NAME_new(cmp : Tsk_new_cmp) : PSTACK_OF_X509_NAME cdecl; external CLibCrypto name 'OPENSSL_sk_new'; + function sk_X509_NAME_new_null : PSTACK_OF_X509_NAME cdecl; external CLibCrypto name 'OPENSSL_sk_new_null'; + procedure sk_X509_NAME_free(st : PSTACK_OF_X509_NAME) cdecl; external CLibCrypto name 'OPENSSL_sk_free'; + function sk_X509_NAME_num (const sk : PSTACK_OF_X509_NAME) : TIdC_INT cdecl; external CLibCrypto name 'OPENSSL_sk_num'; + function sk_X509_NAME_value (const sk : PSTACK_OF_X509_NAME; i : TIdC_INT): PX509_NAME cdecl; external CLibCrypto name 'OPENSSL_sk_value'; + function sk_X509_NAME_push (sk : PSTACK_OF_X509_NAME; st : PX509_NAME): TIdC_INT cdecl; external CLibCrypto name 'OPENSSL_sk_push'; + function sk_X509_NAME_dup (sk : PSTACK_OF_X509_NAME) : PSTACK_OF_X509_NAME cdecl; external CLibCrypto name 'OPENSSL_sk_dup'; + function sk_X509_NAME_find (sk : PSTACK_OF_X509_NAME; val : PX509_NAME) : TIdC_INT cdecl; external CLibCrypto name 'OPENSSL_sk_find'; + procedure sk_X509_NAME_pop_free (sk : PSTACK_OF_X509_NAME; func: Tsk_pop_free_func) cdecl; external CLibCrypto name 'OPENSSL_sk_pop_free'; + function sk_X509_INFO_num (const sk : PSTACK_OF_X509_INFO) : TIdC_INT cdecl; external CLibCrypto name 'OPENSSL_sk_num'; + function sk_X509_INFO_value (const sk : PSTACK_OF_X509_INFO; i : TIdC_INT) : PX509_INFO cdecl; external CLibCrypto name 'OPENSSL_sk_value'; + function sk_X509_INFO_push (sk : PSTACK_OF_X509_INFO; st : PX509_INFO) : TIdC_INT cdecl; external CLibCrypto name 'OPENSSL_sk_push'; + function sk_X509_INFO_dup (sk : PSTACK_OF_X509_INFO) : PSTACK_OF_X509_INFO cdecl; external CLibCrypto name 'OPENSSL_sk_dup'; + function sk_X509_INFO_find (sk : PSTACK_OF_X509_INFO; val : PX509_INFO) : TIdC_INT cdecl; external CLibCrypto name 'OPENSSL_sk_find'; + procedure sk_X509_INFO_pop_free (sk : PSTACK_OF_X509_INFO; func: Tsk_pop_free_func) cdecl; external CLibCrypto name 'OPENSSL_sk_pop_free'; + +{$ENDIF} +{/helper_functions} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +var + {$EXTERNALSYM X509_http_nbio} {removed 3.0.0} + {$EXTERNALSYM X509_CRL_http_nbio} {removed 3.0.0} + {$EXTERNALSYM X509_NAME_hash} {removed 3.0.0} + X509_CRL_set_default_method: procedure (const meth: PX509_CRL_METHOD); cdecl = nil; +// function X509_CRL_METHOD_new(crl_init: function(crl: X509_CRL): TIdC_INT; +// crl_free: function(crl: PX509_CRL): TIdC_INT; +// crl_lookup: function(crl: PX509_CRL; ret: PPX509_REVOKED; ser: PASN1_INTEGER; issuer: PX509_NAME): TIdC_INT; +// crl_verify: function(crl: PX509_CRL, pk: PEVP_PKEY): TIdC_INT): PX509_CRL_METHOD; + X509_CRL_METHOD_free: procedure (m: PX509_CRL_METHOD); cdecl = nil; + + X509_CRL_set_meth_data: procedure (crl: PX509_CRL; dat: Pointer); cdecl = nil; + X509_CRL_get_meth_data: function (crl: PX509_CRL): Pointer; cdecl = nil; + + X509_verify_cert_error_string: function (n: TIdC_LONG): PIdAnsiChar; cdecl = nil; + + X509_verify: function (a: PX509; r: PEVP_PKEY): TIdC_INT; cdecl = nil; + + X509_REQ_verify: function (a: PX509_REQ; r: PEVP_PKEY): TIdC_INT; cdecl = nil; + X509_CRL_verify: function (a: PX509_CRL; r: PEVP_PKEY): TIdC_INT; cdecl = nil; + NETSCAPE_SPKI_verify: function (a: PNETSCAPE_SPKI; r: PEVP_PKEY): TIdC_INT; cdecl = nil; + + NETSCAPE_SPKI_b64_decode: function (const str: PIdAnsiChar; len: TIdC_INT): PNETSCAPE_SPKI; cdecl = nil; + NETSCAPE_SPKI_b64_encode: function (x: PNETSCAPE_SPKI): PIdAnsiChar; cdecl = nil; + NETSCAPE_SPKI_get_pubkey: function (x: PNETSCAPE_SPKI): PEVP_PKEY; cdecl = nil; + NETSCAPE_SPKI_set_pubkey: function (x: PNETSCAPE_SPKI; pkey: PEVP_PKEY): TIdC_INT; cdecl = nil; + + NETSCAPE_SPKI_print: function (out_: PBIO; spki: PNETSCAPE_SPKI): TIdC_INT; cdecl = nil; + + X509_signature_dump: function (bp: PBIO; const sig: PASN1_STRING; indent: TIdC_INT): TIdC_INT; cdecl = nil; + X509_signature_print: function (bp: PBIO; const alg: PX509_ALGOR; const sig: PASN1_STRING): TIdC_INT; cdecl = nil; + + X509_sign: function (x: PX509; pkey: PEVP_PKEY; const md: PEVP_MD): TIdC_INT; cdecl = nil; + X509_sign_ctx: function (x: PX509; ctx: PEVP_MD_CTX): TIdC_INT; cdecl = nil; + + X509_http_nbio: function (rctx: POCSP_REQ_CTX; pcert: PPX509): TIdC_INT; cdecl = nil; {removed 3.0.0} + + X509_REQ_sign: function (x: PX509_REQ; pkey: PEVP_PKEY; const md: PEVP_MD): TIdC_INT; cdecl = nil; + X509_REQ_sign_ctx: function (x: PX509_REQ; ctx: PEVP_MD_CTX): TIdC_INT; cdecl = nil; + X509_CRL_sign: function (x: PX509_CRL; pkey: PEVP_PKEY; const md: PEVP_MD): TIdC_INT; cdecl = nil; + X509_CRL_sign_ctx: function (x: PX509_CRL; ctx: PEVP_MD_CTX): TIdC_INT; cdecl = nil; + + X509_CRL_http_nbio: function (rctx: POCSP_REQ_CTX; pcrl: PPX509_CRL): TIdC_INT; cdecl = nil; {removed 3.0.0} + + NETSCAPE_SPKI_sign: function (x: PNETSCAPE_SPKI; pkey: PEVP_PKEY; const md: PEVP_MD): TIdC_INT; cdecl = nil; + + X509_pubkey_digest: function (const data: PX509; const type_: PEVP_MD; md: PByte; len: PIdC_UINT): TIdC_INT; cdecl = nil; + X509_digest: function (const data: PX509; const type_: PEVP_MD; md: PByte; var len: TIdC_UINT): TIdC_INT; cdecl = nil; + X509_CRL_digest: function (const data: PX509_CRL; const type_: PEVP_MD; md: PByte; var len: TIdC_UINT): TIdC_INT; cdecl = nil; + X509_REQ_digest: function (const data: PX509_REQ; const type_: PEVP_MD; md: PByte; var len: TIdC_UINT): TIdC_INT; cdecl = nil; + X509_NAME_digest: function (const data: PX509_NAME; const type_: PEVP_MD; md: PByte; var len: TIdC_UINT): TIdC_INT; cdecl = nil; + + //# ifndef OPENSSL_NO_STDIO + //X509 *d2i_X509_fp(FILE *fp, X509 **x509); + //TIdC_INT i2d_X509_fp(FILE *fp, X509 *x509); + //X509_CRL *d2i_X509_CRL_fp(FILE *fp, X509_CRL **crl); + //TIdC_INT i2d_X509_CRL_fp(FILE *fp, X509_CRL *crl); + //X509_REQ *d2i_X509_REQ_fp(FILE *fp, X509_REQ **req); + //TIdC_INT i2d_X509_REQ_fp(FILE *fp, X509_REQ *req); + //# ifndef OPENSSL_NO_RSA + //RSA *d2i_RSAPrivateKey_fp(FILE *fp, RSA **rsa); + //TIdC_INT i2d_RSAPrivateKey_fp(FILE *fp, RSA *rsa); + //RSA *d2i_RSAPublicKey_fp(FILE *fp, RSA **rsa); + //TIdC_INT i2d_RSAPublicKey_fp(FILE *fp, RSA *rsa); + //RSA *d2i_RSA_PUBKEY_fp(FILE *fp, RSA **rsa); + //TIdC_INT i2d_RSA_PUBKEY_fp(FILE *fp, RSA *rsa); + //# endif + //# ifndef OPENSSL_NO_DSA + //DSA *d2i_DSA_PUBKEY_fp(FILE *fp, DSA **dsa); + //TIdC_INT i2d_DSA_PUBKEY_fp(FILE *fp, DSA *dsa); + //DSA *d2i_DSAPrivateKey_fp(FILE *fp, DSA **dsa); + //TIdC_INT i2d_DSAPrivateKey_fp(FILE *fp, DSA *dsa); + //# endif + //# ifndef OPENSSL_NO_EC + //EC_KEY *d2i_EC_PUBKEY_fp(FILE *fp, EC_KEY **eckey); + //TIdC_INT i2d_EC_PUBKEY_fp(FILE *fp, EC_KEY *eckey); + //EC_KEY *d2i_ECPrivateKey_fp(FILE *fp, EC_KEY **eckey); + //TIdC_INT i2d_ECPrivateKey_fp(FILE *fp, EC_KEY *eckey); + //# endif + //X509_SIG *d2i_PKCS8_fp(FILE *fp, X509_SIG **p8); + //TIdC_INT i2d_PKCS8_fp(FILE *fp, X509_SIG *p8); + //PKCS8_PRIV_KEY_INFO *d2i_PKCS8_PRIV_KEY_INFO_fp(FILE *fp, + // PKCS8_PRIV_KEY_INFO **p8inf); + //TIdC_INT i2d_PKCS8_PRIV_KEY_INFO_fp(FILE *fp, PKCS8_PRIV_KEY_INFO *p8inf); + //TIdC_INT i2d_PKCS8PrivateKeyInfo_fp(FILE *fp, EVP_PKEY *key); + //TIdC_INT i2d_PrivateKey_fp(FILE *fp, EVP_PKEY *pkey); + //EVP_PKEY *d2i_PrivateKey_fp(FILE *fp, EVP_PKEY **a); + //TIdC_INT i2d_PUBKEY_fp(FILE *fp, EVP_PKEY *pkey); + //EVP_PKEY *d2i_PUBKEY_fp(FILE *fp, EVP_PKEY **a); + //# endif + + d2i_X509_bio: function (bp: PBIO; x509: PPX509): PX509; cdecl = nil; + i2d_X509_bio: function (bp: PBIO; x509: PX509): TIdC_INT; cdecl = nil; + d2i_X509_CRL_bio: function (bp: PBIO; crl: PPX509_CRL): PX509_CRL; cdecl = nil; + i2d_X509_CRL_bio: function (bp: PBIO; crl: PX509_CRL): TIdC_INT; cdecl = nil; + d2i_X509_REQ_bio: function (bp: PBIO; req: PPX509_REQ): PX509_REQ; cdecl = nil; + i2d_X509_REQ_bio: function (bp: PBIO; req: PX509_REQ): TIdC_INT; cdecl = nil; + + d2i_RSAPrivateKey_bio: function (bp: PBIO; rsa: PPRSA): PRSA; cdecl = nil; + i2d_RSAPrivateKey_bio: function (bp: PBIO; rsa: PRSA): TIdC_INT; cdecl = nil; + d2i_RSAPublicKey_bio: function (bp: PBIO; rsa: PPRSA): PRSA; cdecl = nil; + i2d_RSAPublicKey_bio: function (bp: PBIO; rsa: PRSA): TIdC_INT; cdecl = nil; + d2i_RSA_PUBKEY_bio: function (bp: PBIO; rsa: PPRSA): PRSA; cdecl = nil; + i2d_RSA_PUBKEY_bio: function (bp: PBIO; rsa: PRSA): TIdC_INT; cdecl = nil; + + d2i_DSA_PUBKEY_bio: function (bp: PBIO; dsa: PPDSA): DSA; cdecl = nil; + i2d_DSA_PUBKEY_bio: function (bp: PBIO; dsa: PDSA): TIdC_INT; cdecl = nil; + d2i_DSAPrivateKey_bio: function (bp: PBIO; dsa: PPDSA): PDSA; cdecl = nil; + i2d_DSAPrivateKey_bio: function (bp: PBIO; dsa: PDSA): TIdC_INT; cdecl = nil; + + d2i_EC_PUBKEY_bio: function (bp: PBIO; eckey: PPEC_KEY): PEC_KEY; cdecl = nil; + i2d_EC_PUBKEY_bio: function (bp: PBIO; eckey: PEC_KEY): TIdC_INT; cdecl = nil; + d2i_ECPrivateKey_bio: function (bp: PBIO; eckey: PPEC_KEY): EC_KEY; cdecl = nil; + i2d_ECPrivateKey_bio: function (bp: PBIO; eckey: PEC_KEY): TIdC_INT; cdecl = nil; + + d2i_PKCS8_bio: function (bp: PBIO; p8: PPX509_SIG): PX509_SIG; cdecl = nil; + i2d_PKCS8_bio: function (bp: PBIO; p8: PX509_SIG): TIdC_INT; cdecl = nil; + d2i_PKCS8_PRIV_KEY_INFO_bio: function (bp: PBIO; p8inf: PPPKCS8_PRIV_KEY_INFO): PPKCS8_PRIV_KEY_INFO; cdecl = nil; + i2d_PKCS8_PRIV_KEY_INFO_bio: function (bp: PBIO; p8inf: PPKCS8_PRIV_KEY_INFO): TIdC_INT; cdecl = nil; + i2d_PKCS8PrivateKeyInfo_bio: function (bp: PBIO; key: PEVP_PKEY): TIdC_INT; cdecl = nil; + i2d_PrivateKey_bio: function (bp: PBIO; pkey: PEVP_PKEY): TIdC_INT; cdecl = nil; + d2i_PrivateKey_bio: function (bp: PBIO; a: PPEVP_PKEY): PEVP_PKEY; cdecl = nil; + i2d_PUBKEY_bio: function (bp: PBIO; pkey: PEVP_PKEY): TIdC_INT; cdecl = nil; + d2i_PUBKEY_bio: function (bp: PBIO; a: PPEVP_PKEY): PEVP_PKEY; cdecl = nil; + + X509_dup: function (x509: PX509): PX509; cdecl = nil; + X509_ATTRIBUTE_dup: function (xa: PX509_ATTRIBUTE): PX509_ATTRIBUTE; cdecl = nil; + X509_EXTENSION_dup: function (ex: PX509_EXTENSION): PX509_EXTENSION; cdecl = nil; + X509_CRL_dup: function (crl: PX509_CRL): PX509_CRL; cdecl = nil; + X509_REVOKED_dup: function (rev: PX509_REVOKED): PX509_REVOKED; cdecl = nil; + X509_REQ_dup: function (req: PX509_REQ): PX509_REQ; cdecl = nil; + X509_ALGOR_dup: function (xn: PX509_ALGOR): PX509_ALGOR; cdecl = nil; + X509_ALGOR_set0: function (alg: PX509_ALGOR; aobj: PASN1_OBJECT; ptype: TIdC_INT; pval: Pointer): TIdC_INT; cdecl = nil; + X509_ALGOR_get0: procedure (const paobj: PPASN1_OBJECT; pptype: PIdC_INT; const ppval: PPointer; const algor: PX509_ALGOR); cdecl = nil; + X509_ALGOR_set_md: procedure (alg: PX509_ALGOR; const md: PEVP_MD); cdecl = nil; + X509_ALGOR_cmp: function (const a: PX509_ALGOR; const b: PX509_ALGOR): TIdC_INT; cdecl = nil; + + X509_NAME_dup: function (xn: PX509_NAME): PX509_NAME; cdecl = nil; + X509_NAME_ENTRY_dup: function (ne: PX509_NAME_ENTRY): PX509_NAME_ENTRY; cdecl = nil; + + X509_cmp_time: function (const s: PASN1_TIME; t: PIdC_TIMET): TIdC_INT; cdecl = nil; + X509_cmp_current_time: function (const s: PASN1_TIME): TIdC_INT; cdecl = nil; + X509_time_adj: function (s: PASN1_TIME; adj: TIdC_LONG; t: PIdC_TIMET): PASN1_TIME; cdecl = nil; + X509_time_adj_ex: function (s: PASN1_TIME; offset_day: TIdC_INT; offset_sec: TIdC_LONG; t: PIdC_TIMET): PASN1_TIME; cdecl = nil; + X509_gmtime_adj: function (s: PASN1_TIME; adj: TIdC_LONG): PASN1_TIME; cdecl = nil; + + X509_get_default_cert_area: function : PIdAnsiChar; cdecl = nil; + X509_get_default_cert_dir: function : PIdAnsiChar; cdecl = nil; + X509_get_default_cert_file: function : PIdAnsiChar; cdecl = nil; + X509_get_default_cert_dir_env: function : PIdAnsiChar; cdecl = nil; + X509_get_default_cert_file_env: function : PIdAnsiChar; cdecl = nil; + X509_get_default_private_dir: function : PIdAnsiChar; cdecl = nil; + + X509_to_X509_REQ: function (x: PX509; pkey: PEVP_PKEY; const md: PEVP_MD): PX509_REQ; cdecl = nil; + X509_REQ_to_X509: function (r: PX509_REQ; days: TIdC_INT; pkey: PEVP_PKEY): PX509; cdecl = nil; + + X509_ALGOR_new: function : PX509_ALGOR; cdecl = nil; + X509_ALGOR_free: procedure (v1: PX509_ALGOR); cdecl = nil; + d2i_X509_ALGOR: function (a: PPX509_ALGOR; const in_: PPByte; len: TIdC_LONG): PX509_ALGOR; cdecl = nil; + i2d_X509_ALGOR: function (a: PX509_ALGOR; out_: PPByte): TIdC_INT; cdecl = nil; + //DECLARE_ASN1_ENCODE_FUNCTIONS(X509_ALGORS, X509_ALGORS, X509_ALGORS) + X509_VAL_new: function : PX509_VAL; cdecl = nil; + X509_VAL_free: procedure (v1: PX509_VAL); cdecl = nil; + d2i_X509_VAL: function (a: PPX509_VAL; const in_: PPByte; len: TIdC_LONG): PX509_VAL; cdecl = nil; + i2d_X509_VAL: function (a: PX509_VAL; out_: PPByte): TIdC_INT; cdecl = nil; + + X509_PUBKEY_new: function : PX509_PUBKEY; cdecl = nil; + X509_PUBKEY_free: procedure (v1: PX509_PUBKEY); cdecl = nil; + d2i_X509_PUBKEY: function (a: PPX509_PUBKEY; const in_: PPByte; len: TIdC_LONG): PX509_PUBKEY; cdecl = nil; + i2d_X509_PUBKEY: function (a: PX509_PUBKEY; out_: PPByte): TIdC_INT; cdecl = nil; + + X509_PUBKEY_set: function (x: PPX509_PUBKEY; pkey: PEVP_PKEY): TIdC_INT; cdecl = nil; + X509_PUBKEY_get0: function (key: PX509_PUBKEY): PEVP_PKEY; cdecl = nil; {introduced 1.1.0} + X509_PUBKEY_get: function (key: PX509_PUBKEY): PEVP_PKEY; cdecl = nil; +// function X509_get_pubkey_parameters(pkey: PEVP_PKEY; chain: P STACK_OF(X509)): TIdC_INT; + X509_get_pathlen: function (x: PX509): TIdC_LONG; cdecl = nil; {introduced 1.1.0} + i2d_PUBKEY: function (a: PEVP_PKEY; pp: PPByte): TIdC_INT; cdecl = nil; + d2i_PUBKEY: function (a: PPEVP_PKEY; const pp: PPByte; length: TIdC_LONG): PEVP_PKEY; cdecl = nil; + + i2d_RSA_PUBKEY: function (a: PRSA; pp: PPByte): TIdC_INT; cdecl = nil; + d2i_RSA_PUBKEY: function (a: PPRSA; const pp: PPByte; length: TIdC_LONG): PRSA; cdecl = nil; + + i2d_DSA_PUBKEY: function (a: PDSA; pp: PPByte): TIdC_INT; cdecl = nil; + d2i_DSA_PUBKEY: function (a: PPDSA; const pp: PPByte; length: TIdC_LONG): PDSA; cdecl = nil; + + i2d_EC_PUBKEY: function (a: EC_KEY; pp: PPByte): TIdC_INT; cdecl = nil; + d2i_EC_PUBKEY: function (a: PPEC_KEY; const pp: PPByte; length: TIdC_LONG): PEC_KEY; cdecl = nil; + + X509_SIG_new: function : PX509_SIG; cdecl = nil; + X509_SIG_free: procedure (v1: PX509_SIG); cdecl = nil; + d2i_X509_SIG: function (a: PPX509_SIG; const in_: PPByte; len: TIdC_LONG): PX509_SIG; cdecl = nil; + i2d_X509_SIG: function (a: PX509_SIG; out_: PPByte): TIdC_INT; cdecl = nil; + X509_SIG_get0: procedure (const sig: PX509_SIG; const palg: PPX509_ALGOR; const pdigest: PPASN1_OCTET_STRING); cdecl = nil; {introduced 1.1.0} + X509_SIG_getm: procedure (sig: X509_SIG; palg: PPX509_ALGOR; pdigest: PPASN1_OCTET_STRING); cdecl = nil; {introduced 1.1.0} + + X509_REQ_INFO_new: function : PX509_REQ_INFO; cdecl = nil; + X509_REQ_INFO_free: procedure (v1: PX509_REQ_INFO); cdecl = nil; + d2i_X509_REQ_INFO: function (a: PPX509_REQ_INFO; const in_: PPByte; len: TIdC_LONG): PX509_REQ_INFO; cdecl = nil; + i2d_X509_REQ_INFO: function (a: PX509_REQ_INFO; out_: PPByte): TIdC_INT; cdecl = nil; + + X509_REQ_new: function : PX509_REQ; cdecl = nil; + X509_REQ_free: procedure (v1: PX509_REQ); cdecl = nil; + d2i_X509_REQ: function (a: PPX509_REQ; const in_: PPByte; len: TIdC_LONG): PX509_REQ; cdecl = nil; + i2d_X509_REQ: function (a: PX509_REQ; out_: PPByte): TIdC_INT; cdecl = nil; + + X509_ATTRIBUTE_new: function : PX509_ATTRIBUTE; cdecl = nil; + X509_ATTRIBUTE_free: procedure (v1: PX509_ATTRIBUTE); cdecl = nil; + d2i_X509_ATTRIBUTE: function (a: PPX509_ATTRIBUTE; const in_: PPByte; len: TIdC_LONG): PX509_ATTRIBUTE; cdecl = nil; + i2d_X509_ATTRIBUTE: function (a: PX509_ATTRIBUTE; out_: PPByte): TIdC_INT; cdecl = nil; + X509_ATTRIBUTE_create: function (nid: TIdC_INT; trtype: TIdC_INT; value: Pointer): PX509_ATTRIBUTE; cdecl = nil; + + X509_EXTENSION_new: function : PX509_EXTENSION; cdecl = nil; + X509_EXTENSION_free: procedure (v1: PX509_EXTENSION); cdecl = nil; + d2i_X509_EXTENSION: function (a: PPX509_EXTENSION; const in_: PPByte; len: TIdC_LONG): PX509_EXTENSION; cdecl = nil; + i2d_X509_EXTENSION: function (a: PX509_EXTENSION; out_: PPByte): TIdC_INT; cdecl = nil; + //DECLARE_ASN1_ENCODE_FUNCTIONS(X509_EXTENSIONS, X509_EXTENSIONS, X509_EXTENSIONS) + + X509_NAME_ENTRY_new: function : PX509_NAME_ENTRY; cdecl = nil; + X509_NAME_ENTRY_free: procedure (v1: PX509_NAME_ENTRY); cdecl = nil; + d2i_X509_NAME_ENTRY: function (a: PPX509_NAME_ENTRY; const in_: PPByte; len: TIdC_LONG): PX509_NAME_ENTRY; cdecl = nil; + i2d_X509_NAME_ENTRY: function (a: PX509_NAME_ENTRY; out_: PPByte): TIdC_INT; cdecl = nil; + + X509_NAME_new: function : PX509_NAME; cdecl = nil; + X509_NAME_free: procedure (v1: PX509_NAME); cdecl = nil; + d2i_X509_NAME: function (a: PPX509_NAME; const in_: PPByte; len: TIdC_LONG): PX509_NAME; cdecl = nil; + i2d_X509_NAME: function (a: PX509_NAME; out_: PPByte): TIdC_INT; cdecl = nil; + + X509_NAME_set: function (xn: PPX509_NAME; name: PX509_NAME): TIdC_INT; cdecl = nil; + + //DECLARE_ASN1_FUNCTIONS(X509_CINF) + + X509_new: function : PX509; cdecl = nil; + X509_free: procedure (v1: PX509); cdecl = nil; + d2i_X509: function (a: PPX509; const in_: PPByte; len: TIdC_LONG): PX509; cdecl = nil; + i2d_X509: function (a: PX509; out_: PPByte): TIdC_INT; cdecl = nil; + + //DECLARE_ASN1_FUNCTIONS(X509_CERT_AUX) + // + //#define X509_get_ex_new_index(l, p, newf, dupf, freef) \ + // CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_X509, l, p, newf, dupf, freef) + X509_set_ex_data: function (r: PX509; idx: TIdC_INT; arg: Pointer): TIdC_INT; cdecl = nil; + X509_get_ex_data: function (r: PX509; idx: TIdC_INT): Pointer; cdecl = nil; + i2d_X509_AUX: function (a: PX509; pp: PPByte): TIdC_INT; cdecl = nil; + d2i_X509_AUX: function (a: PPX509; const pp: PPByte; length: TIdC_LONG): PX509; cdecl = nil; + + i2d_re_X509_tbs: function (x: PX509; pp: PPByte): TIdC_INT; cdecl = nil; + + X509_SIG_INFO_get: function (const siginf: PX509_SIG_INFO; mdnid: PIdC_INT; pknid: PIdC_INT; secbits: PIdC_INT; flags: PIdC_UINT32): TIdC_INT; cdecl = nil; {introduced 1.1.0} + X509_SIG_INFO_set: procedure (siginf: PX509_SIG_INFO; mdnid: TIdC_INT; pknid: TIdC_INT; secbits: TIdC_INT; flags: TIdC_UINT32); cdecl = nil; {introduced 1.1.0} + + X509_get_signature_info: function (x: PX509; mdnid: PIdC_INT; pknid: PIdC_INT; secbits: PIdC_INT; flags: PIdC_UINT32): TIdC_INT; cdecl = nil; {introduced 1.1.0} + + X509_get0_signature: procedure (var sig: PASN1_BIT_STRING; var alg: PX509_ALGOR; const x: PX509); cdecl = nil; {introduced 1.1.0} + X509_get_signature_nid: function (const x: PX509): TIdC_INT; cdecl = nil; + + X509_trusted: function (const x: PX509): TIdC_INT; cdecl = nil; {introduced 1.1.0} + X509_alias_set1: function (x: PX509; const name: PByte; len: TIdC_INT): TIdC_INT; cdecl = nil; + X509_keyid_set1: function (x: PX509; const id: PByte; len: TIdC_INT): TIdC_INT; cdecl = nil; + X509_alias_get0: function (x: PX509; len: PIdC_INT): PByte; cdecl = nil; + X509_keyid_get0: function (x: PX509; len: PIdC_INT): PByte; cdecl = nil; +// TIdC_INT (*X509_TRUST_set_default(TIdC_INT (*trust) (TIdC_INT, X509 *, TIdC_INT))) (TIdC_INT, X509 *, +// TIdC_INT); + X509_TRUST_set: function (t: PIdC_INT; trust: TIdC_INT): TIdC_INT; cdecl = nil; + X509_add1_trust_object: function (x: PX509; const obj: PASN1_OBJECT): TIdC_INT; cdecl = nil; + X509_add1_reject_object: function (x: PX509; const obj: PASN1_OBJECT): TIdC_INT; cdecl = nil; + X509_trust_clear: procedure (x: PX509); cdecl = nil; + X509_reject_clear: procedure (x: PX509); cdecl = nil; + + //STACK_OF(ASN1_OBJECT) *X509_get0_trust_objects(X509 *x); + //STACK_OF(ASN1_OBJECT) *X509_get0_reject_objects(X509 *x); + // + X509_REVOKED_new: function : PX509_REVOKED; cdecl = nil; + X509_REVOKED_free: procedure (v1: PX509_REVOKED); cdecl = nil; + d2i_X509_REVOKED: function (a: PPX509_REVOKED; const in_: PPByte; len: TIdC_LONG): PX509_REVOKED; cdecl = nil; + i2d_X509_REVOKED: function (a: PX509_REVOKED; out_: PPByte): TIdC_INT; cdecl = nil; + X509_CRL_INFO_new: function : PX509_CRL_INFO; cdecl = nil; + X509_CRL_INFO_free: procedure (v1: PX509_CRL_INFO); cdecl = nil; + d2i_X509_CRL_INFO: function (a: PPX509_CRL_INFO; const in_: PPByte; len: TIdC_LONG): PX509_CRL_INFO; cdecl = nil; + i2d_X509_CRL_INFO: function (a: PX509_CRL_INFO; out_: PPByte): TIdC_INT; cdecl = nil; + X509_CRL_new: function : PX509_CRL; cdecl = nil; + X509_CRL_free: procedure (v1: PX509_CRL); cdecl = nil; + d2i_X509_CRL: function (a: PPX509_CRL; const in_: PPByte; len: TIdC_LONG): PX509_CRL; cdecl = nil; + i2d_X509_CRL: function (a: PX509_CRL; out_: PPByte): TIdC_INT; cdecl = nil; + + X509_CRL_add0_revoked: function (crl: PX509_CRL; rev: PX509_REVOKED): TIdC_INT; cdecl = nil; + X509_CRL_get0_by_serial: function (crl: PX509_CRL; ret: PPX509_REVOKED; serial: PASN1_INTEGER): TIdC_INT; cdecl = nil; + X509_CRL_get0_by_cert: function (crl: PX509_CRL; ret: PPX509_REVOKED; x: PX509): TIdC_INT; cdecl = nil; + + X509_PKEY_new: function : PX509_PKEY; cdecl = nil; + X509_PKEY_free: procedure (a: PX509_PKEY); cdecl = nil; + + //DECLARE_ASN1_FUNCTIONS(NETSCAPE_SPKI) + //DECLARE_ASN1_FUNCTIONS(NETSCAPE_SPKAC) + //DECLARE_ASN1_FUNCTIONS(NETSCAPE_CERT_SEQUENCE) + + X509_INFO_new: function : PX509_INFO; cdecl = nil; + X509_INFO_free: procedure (a: PX509_INFO); cdecl = nil; + X509_NAME_oneline: function (const a: PX509_NAME; buf: PIdAnsiChar; size: TIdC_INT): PIdAnsiChar; cdecl = nil; + +// function ASN1_verify(i2d: Pi2d_of_void; algor1: PX509_ALGOR; +// signature: PASN1_BIT_STRING; data: PIdAnsiChar; pkey: PEVP_PKEY): TIdC_INT; + +// TIdC_INT ASN1_digest(i2d_of_void *i2d, const EVP_MD *type, char *data, +// unsigned char *md, unsigned TIdC_INT *len); + +// TIdC_INT ASN1_sign(i2d_of_void *i2d, X509_ALGOR *algor1, +// X509_ALGOR *algor2, ASN1_BIT_STRING *signature, +// char *data, EVP_PKEY *pkey, const EVP_MD *type); + + ASN1_item_digest: function (const it: PASN1_ITEM; const type_: PEVP_MD; data: Pointer; md: PByte; len: PIdC_UINT): TIdC_INT; cdecl = nil; + + ASN1_item_verify: function (const it: PASN1_ITEM; algor1: PX509_ALGOR; signature: PASN1_BIT_STRING; data: Pointer; pkey: PEVP_PKEY): TIdC_INT; cdecl = nil; + + ASN1_item_sign: function (const it: PASN1_ITEM; algor1: PX509_ALGOR; algor2: PX509_ALGOR; signature: PASN1_BIT_STRING; data: Pointer; pkey: PEVP_PKEY; const type_: PEVP_MD): TIdC_INT; cdecl = nil; + ASN1_item_sign_ctx: function (const it: PASN1_ITEM; algor1: PX509_ALGOR; algor2: PX509_ALGOR; signature: PASN1_BIT_STRING; asn: Pointer; ctx: PEVP_MD_CTX): TIdC_INT; cdecl = nil; + + X509_get_version: function (const x: PX509): TIdC_LONG; cdecl = nil; {introduced 1.1.0} + X509_set_version: function (x: PX509; version: TIdC_LONG): TIdC_INT; cdecl = nil; + X509_set_serialNumber: function (x: PX509; serial: PASN1_INTEGER): TIdC_INT; cdecl = nil; + X509_get_serialNumber: function (x: PX509): PASN1_INTEGER; cdecl = nil; + X509_get0_serialNumber: function (const x: PX509): PASN1_INTEGER; cdecl = nil; {introduced 1.1.0} + X509_set_issuer_name: function (x: PX509; name: PX509_NAME): TIdC_INT; cdecl = nil; + X509_get_issuer_name: function (const a: PX509): PX509_NAME; cdecl = nil; + X509_set_subject_name: function (x: PX509; name: PX509_NAME): TIdC_INT; cdecl = nil; + X509_get_subject_name: function (const a: PX509): PX509_NAME; cdecl = nil; + X509_get0_notBefore: function (const x: PX509): PASN1_TIME; cdecl = nil; {introduced 1.1.0} + X509_getm_notBefore: function (const x: PX509): PASN1_TIME; cdecl = nil; {introduced 1.1.0} + X509_set1_notBefore: function (x: PX509; const tm: PASN1_TIME): TIdC_INT; cdecl = nil; {introduced 1.1.0} + X509_get0_notAfter: function (const x: PX509): PASN1_TIME; cdecl = nil; {introduced 1.1.0} + X509_getm_notAfter: function (const x: PX509): PASN1_TIME; cdecl = nil; {introduced 1.1.0} + X509_set1_notAfter: function (x: PX509; const tm: PASN1_TIME): TIdC_INT; cdecl = nil; {introduced 1.1.0} + X509_set_pubkey: function (x: PX509; pkey: PEVP_PKEY): TIdC_INT; cdecl = nil; + X509_up_ref: function (x: PX509): TIdC_INT; cdecl = nil; {introduced 1.1.0} + X509_get_signature_type: function (const x: PX509): TIdC_INT; cdecl = nil; {introduced 1.1.0} + + (* + * This one is only used so that a binary form can output, as in + * i2d_X509_PUBKEY(X509_get_X509_PUBKEY(x), &buf) + *) + X509_get_X509_PUBKEY: function (const x: PX509): PX509_PUBKEY; cdecl = nil; {introduced 1.1.0} +// const STACK_OF(X509_EXTENSION) *X509_get0_extensions(const X509 *x); + X509_get0_uids: procedure (const x: PX509; const piuid: PPASN1_BIT_STRING; const psuid: PPASN1_BIT_STRING); cdecl = nil; {introduced 1.1.0} + X509_get0_tbs_sigalg: function (const x: PX509): PX509_ALGOR; cdecl = nil; {introduced 1.1.0} + + X509_get0_pubkey: function (const x: PX509): PEVP_PKEY; cdecl = nil; {introduced 1.1.0} + X509_get_pubkey: function (x: PX509): PEVP_PKEY; cdecl = nil; + X509_get0_pubkey_bitstr: function (const x: PX509): PASN1_BIT_STRING; cdecl = nil; + X509_certificate_type: function (const x: PX509; const pubkey: PEVP_PKEY): TIdC_INT; cdecl = nil; + + X509_REQ_get_version: function (const req: PX509_REQ): TIdC_LONG; cdecl = nil; {introduced 1.1.0} + X509_REQ_set_version: function (x: PX509_REQ; version: TIdC_LONG): TIdC_INT; cdecl = nil; + X509_REQ_get_subject_name: function (const req: PX509_REQ): PX509_NAME; cdecl = nil; {introduced 1.1.0} + X509_REQ_set_subject_name: function (req: PX509_REQ; name: PX509_NAME): TIdC_INT; cdecl = nil; + X509_REQ_get0_signature: procedure (const req: PX509_REQ; const psig: PPASN1_BIT_STRING; const palg: PPX509_ALGOR); cdecl = nil; {introduced 1.1.0} + X509_REQ_get_signature_nid: function (const req: PX509_REQ): TIdC_INT; cdecl = nil; {introduced 1.1.0} + i2d_re_X509_REQ_tbs: function (req: PX509_REQ; pp: PPByte): TIdC_INT; cdecl = nil; {introduced 1.1.0} + X509_REQ_set_pubkey: function (x: PX509_REQ; pkey: PEVP_PKEY): TIdC_INT; cdecl = nil; + X509_REQ_get_pubkey: function (req: PX509_REQ): PEVP_PKEY; cdecl = nil; + X509_REQ_get0_pubkey: function (req: PX509_REQ): PEVP_PKEY; cdecl = nil; {introduced 1.1.0} + X509_REQ_get_X509_PUBKEY: function (req: PX509_REQ): PX509_PUBKEY; cdecl = nil; {introduced 1.1.0} + X509_REQ_extension_nid: function (nid: TIdC_INT): TIdC_INT; cdecl = nil; + X509_REQ_get_extension_nids: function : PIdC_INT; cdecl = nil; + X509_REQ_set_extension_nids: procedure (nids: PIdC_INT); cdecl = nil; +// STACK_OF(X509_EXTENSION) *X509_REQ_get_extensions(X509_REQ *req); + //TIdC_INT X509_REQ_add_extensions_nid(X509_REQ *req, STACK_OF(X509_EXTENSION) *exts, + // TIdC_INT nid); + //TIdC_INT X509_REQ_add_extensions(X509_REQ *req, STACK_OF(X509_EXTENSION) *exts); + X509_REQ_get_attr_count: function (const req: PX509_REQ): TIdC_INT; cdecl = nil; + X509_REQ_get_attr_by_NID: function (const req: PX509_REQ; nid: TIdC_INT; lastpos: TIdC_INT): TIdC_INT; cdecl = nil; + X509_REQ_get_attr_by_OBJ: function (const req: PX509_REQ; const obj: ASN1_OBJECT; lastpos: TIdC_INT): TIdC_INT; cdecl = nil; + X509_REQ_get_attr: function (const req: PX509_REQ; loc: TIdC_INT): PX509_ATTRIBUTE; cdecl = nil; + X509_REQ_delete_attr: function (req: PX509_REQ; loc: TIdC_INT): PX509_ATTRIBUTE; cdecl = nil; + X509_REQ_add1_attr: function (req: PX509_REQ; attr: PX509_ATTRIBUTE): TIdC_INT; cdecl = nil; + X509_REQ_add1_attr_by_OBJ: function (req: PX509_REQ; const obj: PASN1_OBJECT; type_: TIdC_INT; const bytes: PByte; len: TIdC_INT): TIdC_INT; cdecl = nil; + X509_REQ_add1_attr_by_NID: function (req: PX509_REQ; nid: TIdC_INT; type_: TIdC_INT; const bytes: PByte; len: TIdC_INT): TIdC_INT; cdecl = nil; + X509_REQ_add1_attr_by_txt: function (req: PX509_REQ; const attrname: PIdAnsiChar; type_: TIdC_INT; const bytes: PByte; len: TIdC_INT): TIdC_INT; cdecl = nil; + + X509_CRL_set_version: function (x: PX509_CRL; version: TIdC_LONG): TIdC_INT; cdecl = nil; + X509_CRL_set_issuer_name: function (x: PX509_CRL; name: PX509_NAME): TIdC_INT; cdecl = nil; + X509_CRL_set1_lastUpdate: function (x: PX509_CRL; const tm: PASN1_TIME): TIdC_INT; cdecl = nil; {introduced 1.1.0} + X509_CRL_set1_nextUpdate: function (x: PX509_CRL; const tm: PASN1_TIME): TIdC_INT; cdecl = nil; {introduced 1.1.0} + X509_CRL_sort: function (crl: PX509_CRL): TIdC_INT; cdecl = nil; + X509_CRL_up_ref: function (crl: PX509_CRL): TIdC_INT; cdecl = nil; {introduced 1.1.0} + + X509_CRL_get_version: function (const crl: PX509_CRL): TIdC_LONG; cdecl = nil; {introduced 1.1.0} + X509_CRL_get0_lastUpdate: function (const crl: PX509_CRL): PASN1_TIME; cdecl = nil; {introduced 1.1.0} + X509_CRL_get0_nextUpdate: function (const crl: PX509_CRL): PASN1_TIME; cdecl = nil; {introduced 1.1.0} + X509_CRL_get_issuer: function (const crl: PX509_CRL): PX509_NAME; cdecl = nil; {introduced 1.1.0} + //const STACK_OF(X509_EXTENSION) *X509_CRL_get0_extensions(const X509_CRL *crl); + //STACK_OF(X509_REVOKED) *X509_CRL_get_REVOKED(X509_CRL *crl); + X509_CRL_get0_signature: procedure (const crl: PX509_CRL; const psig: PPASN1_BIT_STRING; const palg: PPX509_ALGOR); cdecl = nil; {introduced 1.1.0} + X509_CRL_get_signature_nid: function (const crl: PX509_CRL): TIdC_INT; cdecl = nil; {introduced 1.1.0} + i2d_re_X509_CRL_tbs: function (req: PX509_CRL; pp: PPByte): TIdC_INT; cdecl = nil; {introduced 1.1.0} + + X509_REVOKED_get0_serialNumber: function (const x: PX509_REVOKED): PASN1_INTEGER; cdecl = nil; {introduced 1.1.0} + X509_REVOKED_set_serialNumber: function (x: PX509_REVOKED; serial: PASN1_INTEGER): TIdC_INT; cdecl = nil; + X509_REVOKED_get0_revocationDate: function (const x: PX509_REVOKED): PASN1_TIME; cdecl = nil; {introduced 1.1.0} + X509_REVOKED_set_revocationDate: function (r: PX509_REVOKED; tm: PASN1_TIME): TIdC_INT; cdecl = nil; + //const STACK_OF(X509_EXTENSION) * + //X509_REVOKED_get0_extensions(const X509_REVOKED *r); + + X509_CRL_diff: function (base: PX509_CRL; newer: PX509_CRL; skey: PEVP_PKEY; const md: PEVP_MD; flags: TIdC_UINT): PX509_CRL; cdecl = nil; + + X509_REQ_check_private_key: function (x509: PX509_REQ; pkey: PEVP_PKEY): TIdC_INT; cdecl = nil; + + X509_check_private_key: function (const x509: PX509; const pkey: PEVP_PKEY): TIdC_INT; cdecl = nil; + //TIdC_INT X509_chain_check_suiteb(TIdC_INT *perror_depth, + // X509 *x, STACK_OF(X509) *chain, + // unsigned TIdC_LONG flags); + X509_CRL_check_suiteb: function (crl: PX509_CRL; pk: PEVP_PKEY; flags: TIdC_ULONG): TIdC_INT; cdecl = nil; + //STACK_OF(X509) *X509_chain_up_ref(STACK_OF(X509) *chain); + + X509_issuer_and_serial_cmp: function (const a: PX509; const b: PX509): TIdC_INT; cdecl = nil; + X509_issuer_and_serial_hash: function (a: PX509): TIdC_ULONG; cdecl = nil; + + X509_issuer_name_cmp: function (const a: PX509; const b: PX509): TIdC_INT; cdecl = nil; + X509_issuer_name_hash: function (a: PX509): TIdC_uLONG; cdecl = nil; + + X509_subject_name_cmp: function (const a: PX509; const b: PX509): TIdC_INT; cdecl = nil; + X509_subject_name_hash: function (x: PX509): TIdC_ULONG; cdecl = nil; + + X509_cmp: function (const a: PX509; const b: PX509): TIdC_INT; cdecl = nil; + X509_NAME_cmp: function (const a: PX509_NAME; const b: PX509_NAME): TIdC_INT; cdecl = nil; + X509_NAME_hash: function (x: PX509_NAME): TIdC_ULONG; cdecl = nil; {removed 3.0.0} + X509_NAME_hash_old: function (x: PX509_NAME): TIdC_ULONG; cdecl = nil; + + X509_CRL_cmp: function (const a: PX509_CRL; const b: PX509_CRL): TIdC_INT; cdecl = nil; + X509_CRL_match: function (const a: PX509_CRL; const b: PX509_CRL): TIdC_INT; cdecl = nil; + X509_aux_print: function (out_: PBIO; x: PX509; indent: TIdC_INT): TIdC_INT; cdecl = nil; {introduced 1.1.0} + //# ifndef OPENSSL_NO_STDIO + //TIdC_INT X509_print_ex_fp(FILE *bp, X509 *x, unsigned TIdC_LONG nmflag, + // unsigned TIdC_LONG cflag); + //TIdC_INT X509_print_fp(FILE *bp, X509 *x); + //TIdC_INT X509_CRL_print_fp(FILE *bp, X509_CRL *x); + //TIdC_INT X509_REQ_print_fp(FILE *bp, X509_REQ *req); + //TIdC_INT X509_NAME_print_ex_fp(FILE *fp, const X509_NAME *nm, TIdC_INT indent, + // unsigned TIdC_LONG flags); + //# endif + + X509_NAME_print: function (bp: PBIO; const name: PX509_NAME; obase: TIdC_INT): TIdC_INT; cdecl = nil; + X509_NAME_print_ex: function (out_: PBIO; const nm: PX509_NAME; indent: TIdC_INT; flags: TIdC_ULONG): TIdC_INT; cdecl = nil; + X509_print_ex: function (bp: PBIO; x: PX509; nmflag: TIdC_ULONG; cflag: TIdC_ULONG): TIdC_INT; cdecl = nil; + X509_print: function (bp: PBIO; x: PX509): TIdC_INT; cdecl = nil; + X509_ocspid_print: function (bp: PBIO; x: PX509): TIdC_INT; cdecl = nil; + X509_CRL_print_ex: function (out_: PBIO; x: PX509_CRL; nmflag: TIdC_ULONG): TIdC_INT; cdecl = nil; {introduced 1.1.0} + X509_CRL_print: function (bp: PBIO; x: PX509_CRL): TIdC_INT; cdecl = nil; + X509_REQ_print_ex: function (bp: PBIO; x: PX509_REQ; nmflag: TIdC_ULONG; cflag: TIdC_ULONG): TIdC_INT; cdecl = nil; + X509_REQ_print: function (bp: PBIO; req: PX509_REQ): TIdC_INT; cdecl = nil; + + X509_NAME_entry_count: function (const name: PX509_NAME): TIdC_INT; cdecl = nil; + X509_NAME_get_text_by_NID: function (name: PX509_NAME; nid: TIdC_INT; buf: PIdAnsiChar; len: TIdC_INT): TIdC_INT; cdecl = nil; + X509_NAME_get_text_by_OBJ: function (name: PX509_NAME; const obj: PASN1_OBJECT; buf: PIdAnsiChar; len: TIdC_INT): TIdC_INT; cdecl = nil; + + (* + * NOTE: you should be passing -1, not 0 as lastpos. The functions that use + * lastpos, search after that position on. + *) + X509_NAME_get_index_by_NID: function (name: PX509_NAME; nid: TIdC_INT; lastpos: TIdC_INT): TIdC_INT; cdecl = nil; + X509_NAME_get_index_by_OBJ: function (name: PX509_NAME; const obj: PASN1_OBJECT; lastpos: TIdC_INT): TIdC_INT; cdecl = nil; + X509_NAME_get_entry: function (const name: PX509_NAME; loc: TIdC_INT): PX509_NAME_ENTRY; cdecl = nil; + X509_NAME_delete_entry: function (name: PX509_NAME; loc: TIdC_INT): pX509_NAME_ENTRY; cdecl = nil; + X509_NAME_add_entry: function (name: PX509_NAME; const ne: PX509_NAME_ENTRY; loc: TIdC_INT; set_: TIdC_INT): TIdC_INT; cdecl = nil; + X509_NAME_add_entry_by_OBJ: function (name: PX509_NAME; const obj: PASN1_OBJECT; type_: TIdC_INT; const bytes: PByte; len: TIdC_INT; loc: TIdC_INT; set_: TIdC_INT): TIdC_INT; cdecl = nil; + X509_NAME_add_entry_by_NID: function (name: PX509_NAME; nid: TIdC_INT; type_: TIdC_INT; const bytes: PByte; len: TIdC_INT; loc: TIdC_INT; set_: TIdC_INT): TIdC_INT; cdecl = nil; + X509_NAME_ENTRY_create_by_txt: function (ne: PPX509_NAME_ENTRY; const field: PIdAnsiChar; type_: TIdC_INT; const bytes: PByte; len: TIdC_INT): PX509_NAME_ENTRY; cdecl = nil; + X509_NAME_ENTRY_create_by_NID: function (ne: PPX509_NAME_ENTRY; nid: TIdC_INT; type_: TIdC_INT; const bytes: PByte; len: TIdC_INT): PX509_NAME_ENTRY; cdecl = nil; + X509_NAME_add_entry_by_txt: function (name: PX509_NAME; const field: PIdAnsiChar; type_: TIdC_INT; const bytes: PByte; len: TIdC_INT; loc: TIdC_INT; set_: TIdC_INT): TIdC_INT; cdecl = nil; + X509_NAME_ENTRY_create_by_OBJ: function (ne: PPX509_NAME_ENTRY; const obj: PASN1_OBJECT; type_: TIdC_INT; const bytes: PByte; len: TIdC_INT): PX509_NAME_ENTRY; cdecl = nil; + X509_NAME_ENTRY_set_object: function (ne: PX509_NAME_ENTRY; const obj: PASN1_OBJECT): TIdC_INT; cdecl = nil; + X509_NAME_ENTRY_set_data: function (ne: PX509_NAME_ENTRY; type_: TIdC_INT; const bytes: PByte; len: TIdC_INT): TIdC_INT; cdecl = nil; + X509_NAME_ENTRY_get_object: function (const ne: PX509_NAME_ENTRY): PASN1_OBJECT; cdecl = nil; + X509_NAME_ENTRY_get_data: function (const ne: PX509_NAME_ENTRY): PASN1_STRING; cdecl = nil; + X509_NAME_ENTRY_set: function (const ne: PX509_NAME_ENTRY): TIdC_INT; cdecl = nil; {introduced 1.1.0} + + X509_NAME_get0_der: function (nm: PX509_NAME; const pder: PPByte; pderlen: PIdC_SIZET): TIdC_INT; cdecl = nil; {introduced 1.1.0} + + //TIdC_INT X509v3_get_ext_count(const STACK_OF(X509_EXTENSION) *x); + //TIdC_INT X509v3_get_ext_by_NID(const STACK_OF(X509_EXTENSION) *x, + // TIdC_INT nid, TIdC_INT lastpos); + //TIdC_INT X509v3_get_ext_by_OBJ(const STACK_OF(X509_EXTENSION) *x, + // const ASN1_OBJECT *obj, TIdC_INT lastpos); + //TIdC_INT X509v3_get_ext_by_critical(const STACK_OF(X509_EXTENSION) *x, + // TIdC_INT crit, TIdC_INT lastpos); + //X509_EXTENSION *X509v3_get_ext(const STACK_OF(X509_EXTENSION) *x, TIdC_INT loc); + //X509_EXTENSION *X509v3_delete_ext(STACK_OF(X509_EXTENSION) *x, TIdC_INT loc); + //STACK_OF(X509_EXTENSION) *X509v3_add_ext(STACK_OF(X509_EXTENSION) **x, + // X509_EXTENSION *ex, TIdC_INT loc); + + X509_get_ext_count: function (const x: PX509): TIdC_INT; cdecl = nil; + X509_get_ext_by_NID: function (const x: PX509; nid: TIdC_INT; lastpos: TIdC_INT): TIdC_INT; cdecl = nil; + X509_get_ext_by_OBJ: function (const x: PX509; const obj: PASN1_OBJECT; lastpos: TIdC_INT): TIdC_INT; cdecl = nil; + X509_get_ext_by_critical: function (const x: PX509; crit: TIdC_INT; lastpos: TIdC_INT): TIdC_INT; cdecl = nil; + X509_get_ext: function (const x: PX509; loc: TIdC_INT): PX509_EXTENSION; cdecl = nil; + X509_delete_ext: function (x: PX509; loc: TIdC_INT): PX509_EXTENSION; cdecl = nil; + X509_add_ext: function (x: PX509; ex: PX509_EXTENSION; loc: TIdC_INT): TIdC_INT; cdecl = nil; + X509_get_ext_d2i: function (const x: PX509; nid: TIdC_INT; crit: PIdC_INT; idx: PIdC_INT): Pointer; cdecl = nil; + X509_add1_ext_i2d: function (x: PX509; nid: TIdC_INT; value: Pointer; crit: TIdC_INT; flags: TIdC_ULONG): TIdC_INT; cdecl = nil; + + X509_CRL_get_ext_count: function (const x: PX509_CRL): TIdC_INT; cdecl = nil; + X509_CRL_get_ext_by_NID: function (const x: PX509_CRL; nid: TIdC_INT; lastpos: TIdC_INT): TIdC_INT; cdecl = nil; + X509_CRL_get_ext_by_OBJ: function (const x: X509_CRL; const obj: PASN1_OBJECT; lastpos: TIdC_INT): TIdC_INT; cdecl = nil; + X509_CRL_get_ext_by_critical: function (const x: PX509_CRL; crit: TIdC_INT; lastpos: TIdC_INT): TIdC_INT; cdecl = nil; + X509_CRL_get_ext: function (const x: PX509_CRL; loc: TIdC_INT): PX509_EXTENSION; cdecl = nil; + X509_CRL_delete_ext: function (x: PX509_CRL; loc: TIdC_INT): PX509_EXTENSION; cdecl = nil; + X509_CRL_add_ext: function (x: PX509_CRL; ex: PX509_EXTENSION; loc: TIdC_INT): TIdC_INT; cdecl = nil; + X509_CRL_get_ext_d2i: function (const x: PX509_CRL; nid: TIdC_INT; crit: PIdC_INT; idx: PIdC_INT): Pointer; cdecl = nil; + X509_CRL_add1_ext_i2d: function (x: PX509_CRL; nid: TIdC_INT; value: Pointer; crit: TIdC_INT; flags: TIdC_ULONG): TIdC_INT; cdecl = nil; + + X509_REVOKED_get_ext_count: function (const x: PX509_REVOKED): TIdC_INT; cdecl = nil; + X509_REVOKED_get_ext_by_NID: function (const x: PX509_REVOKED; nid: TIdC_INT; lastpos: TIdC_INT): TIdC_INT; cdecl = nil; + X509_REVOKED_get_ext_by_OBJ: function (const x: PX509_REVOKED; const obj: PASN1_OBJECT; lastpos: TIdC_INT): TIdC_INT; cdecl = nil; + X509_REVOKED_get_ext_by_critical: function (const x: PX509_REVOKED; crit: TIdC_INT; lastpos: TIdC_INT): TIdC_INT; cdecl = nil; + X509_REVOKED_get_ext: function (const x: PX509_REVOKED; loc: TIdC_INT): PX509_EXTENSION; cdecl = nil; + X509_REVOKED_delete_ext: function (x: PX509_REVOKED; loc: TIdC_INT): PX509_EXTENSION; cdecl = nil; + X509_REVOKED_add_ext: function (x: PX509_REVOKED; ex: PX509_EXTENSION; loc: TIdC_INT): TIdC_INT; cdecl = nil; + X509_REVOKED_get_ext_d2i: function (const x: PX509_REVOKED; nid: TIdC_INT; crit: PIdC_INT; idx: PIdC_INT): Pointer; cdecl = nil; + X509_REVOKED_add1_ext_i2d: function (x: PX509_REVOKED; nid: TIdC_INT; value: Pointer; crit: TIdC_INT; flags: TIdC_ULONG): TIdC_INT; cdecl = nil; + + X509_EXTENSION_create_by_NID: function (ex: PPX509_EXTENSION; nid: TIdC_INT; crit: TIdC_INT; data: PASN1_OCTET_STRING): PX509_EXTENSION; cdecl = nil; + X509_EXTENSION_create_by_OBJ: function (ex: PPX509_EXTENSION; const obj: PASN1_OBJECT; crit: TIdC_INT; data: PASN1_OCTET_STRING): PX509_EXTENSION; cdecl = nil; + X509_EXTENSION_set_object: function (ex: PX509_EXTENSION; const obj: PASN1_OBJECT): TIdC_INT; cdecl = nil; + X509_EXTENSION_set_critical: function (ex: PX509_EXTENSION; crit: TIdC_INT): TIdC_INT; cdecl = nil; + X509_EXTENSION_set_data: function (ex: PX509_EXTENSION; data: PASN1_OCTET_STRING): TIdC_INT; cdecl = nil; + X509_EXTENSION_get_object: function (ex: PX509_EXTENSION): PASN1_OBJECT; cdecl = nil; + X509_EXTENSION_get_data: function (ne: PX509_EXTENSION): PASN1_OCTET_STRING; cdecl = nil; + X509_EXTENSION_get_critical: function (const ex: PX509_EXTENSION): TIdC_INT; cdecl = nil; + + //TIdC_INT X509at_get_attr_count(const STACK_OF(X509_ATTRIBUTE) *x); + //TIdC_INT X509at_get_attr_by_NID(const STACK_OF(X509_ATTRIBUTE) *x, TIdC_INT nid, + // TIdC_INT lastpos); + //TIdC_INT X509at_get_attr_by_OBJ(const STACK_OF(X509_ATTRIBUTE) *sk, + // const ASN1_OBJECT *obj, TIdC_INT lastpos); + //X509_ATTRIBUTE *X509at_get_attr(const STACK_OF(X509_ATTRIBUTE) *x, TIdC_INT loc); + //X509_ATTRIBUTE *X509at_delete_attr(STACK_OF(X509_ATTRIBUTE) *x, TIdC_INT loc); + //STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr(STACK_OF(X509_ATTRIBUTE) **x, + // X509_ATTRIBUTE *attr); + //STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_OBJ(STACK_OF(X509_ATTRIBUTE) + // **x, const ASN1_OBJECT *obj, + // TIdC_INT type, + // const unsigned char *bytes, + // TIdC_INT len); + //STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_NID(STACK_OF(X509_ATTRIBUTE) + // **x, TIdC_INT nid, TIdC_INT type, + // const unsigned char *bytes, + // TIdC_INT len); + //STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_txt(STACK_OF(X509_ATTRIBUTE) + // **x, const PIdAnsiChar *attrname, + // TIdC_INT type, + // const unsigned char *bytes, + // TIdC_INT len); + //void *X509at_get0_data_by_OBJ(STACK_OF(X509_ATTRIBUTE) *x, + // const ASN1_OBJECT *obj, TIdC_INT lastpos, TIdC_INT type); + X509_ATTRIBUTE_create_by_NID: function (attr: PPX509_ATTRIBUTE; nid: TIdC_INT; atrtype: TIdC_INT; const data: Pointer; len: TIdC_INT): PX509_ATTRIBUTE; cdecl = nil; + X509_ATTRIBUTE_create_by_OBJ: function (attr: PPX509_ATTRIBUTE; const obj: PASN1_OBJECT; atrtype: TIdC_INT; const data: Pointer; len: TIdC_INT): PX509_ATTRIBUTE; cdecl = nil; + X509_ATTRIBUTE_create_by_txt: function (attr: PPX509_ATTRIBUTE; const atrname: PIdAnsiChar; type_: TIdC_INT; const bytes: PByte; len: TIdC_INT): PX509_ATTRIBUTE; cdecl = nil; + X509_ATTRIBUTE_set1_object: function (attr: PX509_ATTRIBUTE; const obj: PASN1_OBJECT): TIdC_INT; cdecl = nil; + X509_ATTRIBUTE_set1_data: function (attr: PX509_ATTRIBUTE; attrtype: TIdC_INT; const data: Pointer; len: TIdC_INT): TIdC_INT; cdecl = nil; + X509_ATTRIBUTE_get0_data: function (attr: PX509_ATTRIBUTE; idx: TIdC_INT; atrtype: TIdC_INT; data: Pointer): Pointer; cdecl = nil; + X509_ATTRIBUTE_count: function (const attr: PX509_ATTRIBUTE): TIdC_INT; cdecl = nil; + X509_ATTRIBUTE_get0_object: function (attr: PX509_ATTRIBUTE): PASN1_OBJECT; cdecl = nil; + X509_ATTRIBUTE_get0_type: function (attr: PX509_ATTRIBUTE; idx: TIdC_INT): PASN1_TYPE; cdecl = nil; + + EVP_PKEY_get_attr_count: function (const key: PEVP_PKEY): TIdC_INT; cdecl = nil; + EVP_PKEY_get_attr_by_NID: function (const key: PEVP_PKEY; nid: TIdC_INT; lastpos: TIdC_INT): TIdC_INT; cdecl = nil; + EVP_PKEY_get_attr_by_OBJ: function (const key: PEVP_PKEY; const obj: PASN1_OBJECT; lastpos: TIdC_INT): TIdC_INT; cdecl = nil; + EVP_PKEY_get_attr: function (const key: PEVP_PKEY; loc: TIdC_INT): PX509_ATTRIBUTE; cdecl = nil; + EVP_PKEY_delete_attr: function (key: PEVP_PKEY; loc: TIdC_INT): PX509_ATTRIBUTE; cdecl = nil; + EVP_PKEY_add1_attr: function (key: PEVP_PKEY; attr: PX509_ATTRIBUTE): TIdC_INT; cdecl = nil; + EVP_PKEY_add1_attr_by_OBJ: function (key: PEVP_PKEY; const obj: PASN1_OBJECT; type_: TIdC_INT; const bytes: PByte; len: TIdC_INT): TIdC_INT; cdecl = nil; + EVP_PKEY_add1_attr_by_NID: function (key: PEVP_PKEY; nid: TIdC_INT; type_: TIdC_INT; const bytes: PByte; len: TIdC_INT): TIdC_INT; cdecl = nil; + EVP_PKEY_add1_attr_by_txt: function (key: PEVP_PKEY; const attrname: PIdAnsiChar; type_: TIdC_INT; const bytes: PByte; len: TIdC_INT): TIdC_INT; cdecl = nil; + + X509_verify_cert: function (ctx: PX509_STORE_CTX): TIdC_INT; cdecl = nil; + + (* lookup a cert from a X509 STACK *) +// function X509_find_by_issuer_and_serial(sk: P STACK_OF(X509); name: PX509_NAME; serial: PASN1_INTEGER): PX509; +// X509 *X509_find_by_subject(STACK_OF(X509) *sk, X509_NAME *name); + + //DECLARE_ASN1_FUNCTIONS(PBEPARAM) + //DECLARE_ASN1_FUNCTIONS(PBE2PARAM) + //DECLARE_ASN1_FUNCTIONS(PBKDF2PARAM) + //#ifndef OPENSSL_NO_SCRYPT + //DECLARE_ASN1_FUNCTIONS(SCRYPT_PARAMS) + //#endif + + PKCS5_pbe_set0_algor: function (algor: PX509_ALGOR; alg: TIdC_INT; iter: TIdC_INT; const salt: PByte; saltlen: TIdC_INT): TIdC_INT; cdecl = nil; + + PKCS5_pbe_set: function (alg: TIdC_INT; iter: TIdC_INT; const salt: PByte; saltlen: TIdC_INT): PX509_ALGOR; cdecl = nil; + PKCS5_pbe2_set: function (const cipher: PEVP_CIPHER; iter: TIdC_INT; salt: PByte; saltlen: TIdC_INT): PX509_ALGOR; cdecl = nil; + PKCS5_pbe2_set_iv: function (const cipher: PEVP_CIPHER; iter: TIdC_INT; salt: PByte; saltlen: TIdC_INT; aiv: PByte; prf_nid: TIdC_INT): PX509_ALGOR; cdecl = nil; + + PKCS5_pbe2_set_scrypt: function (const cipher: PEVP_CIPHER; const salt: PByte; saltlen: TIdC_INT; aiv: PByte; N: TIdC_UINT64; r: TIdC_UINT64; p: TIdC_UINT64): PX509_ALGOR; cdecl = nil; {introduced 1.1.0} + + PKCS5_pbkdf2_set: function (iter: TIdC_INT; salt: PByte; saltlen: TIdC_INT; prf_nid: TIdC_INT; keylen: TIdC_INT): PX509_ALGOR; cdecl = nil; + + (* PKCS#8 utilities *) + + //DECLARE_ASN1_FUNCTIONS(PKCS8_PRIV_KEY_INFO) + + EVP_PKCS82PKEY: function (const p8: PPKCS8_PRIV_KEY_INFO): PEVP_PKEY; cdecl = nil; + EVP_PKEY2PKCS8: function (pkey: PEVP_PKEY): PKCS8_PRIV_KEY_INFO; cdecl = nil; + + PKCS8_pkey_set0: function (priv: PPKCS8_PRIV_KEY_INFO; aobj: PASN1_OBJECT; version: TIdC_INT; ptype: TIdC_INT; pval: Pointer; penc: PByte; penclen: TIdC_INT): TIdC_INT; cdecl = nil; + PKCS8_pkey_get0: function (const ppkalg: PPASN1_OBJECT; const pk: PPByte; ppklen: PIdC_INT; const pa: PPX509_ALGOR; const p8: PPKCS8_PRIV_KEY_INFO): TIdC_INT; cdecl = nil; + + //const STACK_OF(X509_ATTRIBUTE) * + //PKCS8_pkey_get0_attrs(const PKCS8_PRIV_KEY_INFO *p8); + PKCS8_pkey_add1_attr_by_NID: function (p8: PPKCS8_PRIV_KEY_INFO; nid: TIdC_INT; type_: TIdC_INT; const bytes: PByte; len: TIdC_INT): TIdC_INT; cdecl = nil; {introduced 1.1.0} + + X509_PUBKEY_set0_param: function (pub: PX509_PUBKEY; aobj: PASN1_OBJECT; ptype: TIdC_INT; pval: Pointer; penc: PByte; penclen: TIdC_INT): TIdC_INT; cdecl = nil; + X509_PUBKEY_get0_param: function (ppkalg: PPASN1_OBJECT; const pk: PPByte; ppklen: PIdC_INT; pa: PPX509_ALGOR; pub: PX509_PUBKEY): TIdC_INT; cdecl = nil; + + X509_check_trust: function (x: PX509; id: TIdC_INT; flags: TIdC_INT): TIdC_INT; cdecl = nil; + X509_TRUST_get_count: function : TIdC_INT; cdecl = nil; + X509_TRUST_get0: function (idx: TIdC_INT): PX509_TRUST; cdecl = nil; + X509_TRUST_get_by_id: function (id: TIdC_INT): TIdC_INT; cdecl = nil; +// TIdC_INT X509_TRUST_add(TIdC_INT id, TIdC_INT flags, TIdC_INT (*ck) (X509_TRUST *, X509 *, TIdC_INT), +// const PIdAnsiChar *name, TIdC_INT arg1, void *arg2); + X509_TRUST_cleanup: procedure ; cdecl = nil; + X509_TRUST_get_flags: function (const xp: PX509_TRUST): TIdC_INT; cdecl = nil; + X509_TRUST_get0_name: function (const xp: PX509_TRUST): PIdAnsiChar; cdecl = nil; + X509_TRUST_get_trust: function (const xp: PX509_TRUST): TIdC_INT; cdecl = nil; + +// unsigned long X509_NAME_hash_ex(const X509_NAME *x, OSSL_LIB_CTX *libctx, +// const char *propq, int *ok); + X509_NAME_hash_ex: function (const x: PX509_NAME; libctx: POSSL_LIB_CTX; const propq: PIdAnsiChar; ok: PIdC_INT): TIdC_ULONG; cdecl = nil; {introduced 3.0.0} + + +{$ELSE} + procedure X509_CRL_set_default_method(const meth: PX509_CRL_METHOD) cdecl; external CLibCrypto; +// function X509_CRL_METHOD_new(crl_init: function(crl: X509_CRL): TIdC_INT; +// crl_free: function(crl: PX509_CRL): TIdC_INT; +// crl_lookup: function(crl: PX509_CRL; ret: PPX509_REVOKED; ser: PASN1_INTEGER; issuer: PX509_NAME): TIdC_INT; +// crl_verify: function(crl: PX509_CRL, pk: PEVP_PKEY): TIdC_INT): PX509_CRL_METHOD; + procedure X509_CRL_METHOD_free(m: PX509_CRL_METHOD) cdecl; external CLibCrypto; + + procedure X509_CRL_set_meth_data(crl: PX509_CRL; dat: Pointer) cdecl; external CLibCrypto; + function X509_CRL_get_meth_data(crl: PX509_CRL): Pointer cdecl; external CLibCrypto; + + function X509_verify_cert_error_string(n: TIdC_LONG): PIdAnsiChar cdecl; external CLibCrypto; + + function X509_verify(a: PX509; r: PEVP_PKEY): TIdC_INT cdecl; external CLibCrypto; + + function X509_REQ_verify(a: PX509_REQ; r: PEVP_PKEY): TIdC_INT cdecl; external CLibCrypto; + function X509_CRL_verify(a: PX509_CRL; r: PEVP_PKEY): TIdC_INT cdecl; external CLibCrypto; + function NETSCAPE_SPKI_verify(a: PNETSCAPE_SPKI; r: PEVP_PKEY): TIdC_INT cdecl; external CLibCrypto; + + function NETSCAPE_SPKI_b64_decode(const str: PIdAnsiChar; len: TIdC_INT): PNETSCAPE_SPKI cdecl; external CLibCrypto; + function NETSCAPE_SPKI_b64_encode(x: PNETSCAPE_SPKI): PIdAnsiChar cdecl; external CLibCrypto; + function NETSCAPE_SPKI_get_pubkey(x: PNETSCAPE_SPKI): PEVP_PKEY cdecl; external CLibCrypto; + function NETSCAPE_SPKI_set_pubkey(x: PNETSCAPE_SPKI; pkey: PEVP_PKEY): TIdC_INT cdecl; external CLibCrypto; + + function NETSCAPE_SPKI_print(out_: PBIO; spki: PNETSCAPE_SPKI): TIdC_INT cdecl; external CLibCrypto; + + function X509_signature_dump(bp: PBIO; const sig: PASN1_STRING; indent: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function X509_signature_print(bp: PBIO; const alg: PX509_ALGOR; const sig: PASN1_STRING): TIdC_INT cdecl; external CLibCrypto; + + function X509_sign(x: PX509; pkey: PEVP_PKEY; const md: PEVP_MD): TIdC_INT cdecl; external CLibCrypto; + function X509_sign_ctx(x: PX509; ctx: PEVP_MD_CTX): TIdC_INT cdecl; external CLibCrypto; + + + function X509_REQ_sign(x: PX509_REQ; pkey: PEVP_PKEY; const md: PEVP_MD): TIdC_INT cdecl; external CLibCrypto; + function X509_REQ_sign_ctx(x: PX509_REQ; ctx: PEVP_MD_CTX): TIdC_INT cdecl; external CLibCrypto; + function X509_CRL_sign(x: PX509_CRL; pkey: PEVP_PKEY; const md: PEVP_MD): TIdC_INT cdecl; external CLibCrypto; + function X509_CRL_sign_ctx(x: PX509_CRL; ctx: PEVP_MD_CTX): TIdC_INT cdecl; external CLibCrypto; + + + function NETSCAPE_SPKI_sign(x: PNETSCAPE_SPKI; pkey: PEVP_PKEY; const md: PEVP_MD): TIdC_INT cdecl; external CLibCrypto; + + function X509_pubkey_digest(const data: PX509; const type_: PEVP_MD; md: PByte; len: PIdC_UINT): TIdC_INT cdecl; external CLibCrypto; + function X509_digest(const data: PX509; const type_: PEVP_MD; md: PByte; var len: TIdC_UINT): TIdC_INT cdecl; external CLibCrypto; + function X509_CRL_digest(const data: PX509_CRL; const type_: PEVP_MD; md: PByte; var len: TIdC_UINT): TIdC_INT cdecl; external CLibCrypto; + function X509_REQ_digest(const data: PX509_REQ; const type_: PEVP_MD; md: PByte; var len: TIdC_UINT): TIdC_INT cdecl; external CLibCrypto; + function X509_NAME_digest(const data: PX509_NAME; const type_: PEVP_MD; md: PByte; var len: TIdC_UINT): TIdC_INT cdecl; external CLibCrypto; + + //# ifndef OPENSSL_NO_STDIO + //X509 *d2i_X509_fp(FILE *fp, X509 **x509); + //TIdC_INT i2d_X509_fp(FILE *fp, X509 *x509); + //X509_CRL *d2i_X509_CRL_fp(FILE *fp, X509_CRL **crl); + //TIdC_INT i2d_X509_CRL_fp(FILE *fp, X509_CRL *crl); + //X509_REQ *d2i_X509_REQ_fp(FILE *fp, X509_REQ **req); + //TIdC_INT i2d_X509_REQ_fp(FILE *fp, X509_REQ *req); + //# ifndef OPENSSL_NO_RSA + //RSA *d2i_RSAPrivateKey_fp(FILE *fp, RSA **rsa); + //TIdC_INT i2d_RSAPrivateKey_fp(FILE *fp, RSA *rsa); + //RSA *d2i_RSAPublicKey_fp(FILE *fp, RSA **rsa); + //TIdC_INT i2d_RSAPublicKey_fp(FILE *fp, RSA *rsa); + //RSA *d2i_RSA_PUBKEY_fp(FILE *fp, RSA **rsa); + //TIdC_INT i2d_RSA_PUBKEY_fp(FILE *fp, RSA *rsa); + //# endif + //# ifndef OPENSSL_NO_DSA + //DSA *d2i_DSA_PUBKEY_fp(FILE *fp, DSA **dsa); + //TIdC_INT i2d_DSA_PUBKEY_fp(FILE *fp, DSA *dsa); + //DSA *d2i_DSAPrivateKey_fp(FILE *fp, DSA **dsa); + //TIdC_INT i2d_DSAPrivateKey_fp(FILE *fp, DSA *dsa); + //# endif + //# ifndef OPENSSL_NO_EC + //EC_KEY *d2i_EC_PUBKEY_fp(FILE *fp, EC_KEY **eckey); + //TIdC_INT i2d_EC_PUBKEY_fp(FILE *fp, EC_KEY *eckey); + //EC_KEY *d2i_ECPrivateKey_fp(FILE *fp, EC_KEY **eckey); + //TIdC_INT i2d_ECPrivateKey_fp(FILE *fp, EC_KEY *eckey); + //# endif + //X509_SIG *d2i_PKCS8_fp(FILE *fp, X509_SIG **p8); + //TIdC_INT i2d_PKCS8_fp(FILE *fp, X509_SIG *p8); + //PKCS8_PRIV_KEY_INFO *d2i_PKCS8_PRIV_KEY_INFO_fp(FILE *fp, + // PKCS8_PRIV_KEY_INFO **p8inf); + //TIdC_INT i2d_PKCS8_PRIV_KEY_INFO_fp(FILE *fp, PKCS8_PRIV_KEY_INFO *p8inf); + //TIdC_INT i2d_PKCS8PrivateKeyInfo_fp(FILE *fp, EVP_PKEY *key); + //TIdC_INT i2d_PrivateKey_fp(FILE *fp, EVP_PKEY *pkey); + //EVP_PKEY *d2i_PrivateKey_fp(FILE *fp, EVP_PKEY **a); + //TIdC_INT i2d_PUBKEY_fp(FILE *fp, EVP_PKEY *pkey); + //EVP_PKEY *d2i_PUBKEY_fp(FILE *fp, EVP_PKEY **a); + //# endif + + function d2i_X509_bio(bp: PBIO; x509: PPX509): PX509 cdecl; external CLibCrypto; + function i2d_X509_bio(bp: PBIO; x509: PX509): TIdC_INT cdecl; external CLibCrypto; + function d2i_X509_CRL_bio(bp: PBIO; crl: PPX509_CRL): PX509_CRL cdecl; external CLibCrypto; + function i2d_X509_CRL_bio(bp: PBIO; crl: PX509_CRL): TIdC_INT cdecl; external CLibCrypto; + function d2i_X509_REQ_bio(bp: PBIO; req: PPX509_REQ): PX509_REQ cdecl; external CLibCrypto; + function i2d_X509_REQ_bio(bp: PBIO; req: PX509_REQ): TIdC_INT cdecl; external CLibCrypto; + + function d2i_RSAPrivateKey_bio(bp: PBIO; rsa: PPRSA): PRSA cdecl; external CLibCrypto; + function i2d_RSAPrivateKey_bio(bp: PBIO; rsa: PRSA): TIdC_INT cdecl; external CLibCrypto; + function d2i_RSAPublicKey_bio(bp: PBIO; rsa: PPRSA): PRSA cdecl; external CLibCrypto; + function i2d_RSAPublicKey_bio(bp: PBIO; rsa: PRSA): TIdC_INT cdecl; external CLibCrypto; + function d2i_RSA_PUBKEY_bio(bp: PBIO; rsa: PPRSA): PRSA cdecl; external CLibCrypto; + function i2d_RSA_PUBKEY_bio(bp: PBIO; rsa: PRSA): TIdC_INT cdecl; external CLibCrypto; + + function d2i_DSA_PUBKEY_bio(bp: PBIO; dsa: PPDSA): DSA cdecl; external CLibCrypto; + function i2d_DSA_PUBKEY_bio(bp: PBIO; dsa: PDSA): TIdC_INT cdecl; external CLibCrypto; + function d2i_DSAPrivateKey_bio(bp: PBIO; dsa: PPDSA): PDSA cdecl; external CLibCrypto; + function i2d_DSAPrivateKey_bio(bp: PBIO; dsa: PDSA): TIdC_INT cdecl; external CLibCrypto; + + function d2i_EC_PUBKEY_bio(bp: PBIO; eckey: PPEC_KEY): PEC_KEY cdecl; external CLibCrypto; + function i2d_EC_PUBKEY_bio(bp: PBIO; eckey: PEC_KEY): TIdC_INT cdecl; external CLibCrypto; + function d2i_ECPrivateKey_bio(bp: PBIO; eckey: PPEC_KEY): EC_KEY cdecl; external CLibCrypto; + function i2d_ECPrivateKey_bio(bp: PBIO; eckey: PEC_KEY): TIdC_INT cdecl; external CLibCrypto; + + function d2i_PKCS8_bio(bp: PBIO; p8: PPX509_SIG): PX509_SIG cdecl; external CLibCrypto; + function i2d_PKCS8_bio(bp: PBIO; p8: PX509_SIG): TIdC_INT cdecl; external CLibCrypto; + function d2i_PKCS8_PRIV_KEY_INFO_bio(bp: PBIO; p8inf: PPPKCS8_PRIV_KEY_INFO): PPKCS8_PRIV_KEY_INFO cdecl; external CLibCrypto; + function i2d_PKCS8_PRIV_KEY_INFO_bio(bp: PBIO; p8inf: PPKCS8_PRIV_KEY_INFO): TIdC_INT cdecl; external CLibCrypto; + function i2d_PKCS8PrivateKeyInfo_bio(bp: PBIO; key: PEVP_PKEY): TIdC_INT cdecl; external CLibCrypto; + function i2d_PrivateKey_bio(bp: PBIO; pkey: PEVP_PKEY): TIdC_INT cdecl; external CLibCrypto; + function d2i_PrivateKey_bio(bp: PBIO; a: PPEVP_PKEY): PEVP_PKEY cdecl; external CLibCrypto; + function i2d_PUBKEY_bio(bp: PBIO; pkey: PEVP_PKEY): TIdC_INT cdecl; external CLibCrypto; + function d2i_PUBKEY_bio(bp: PBIO; a: PPEVP_PKEY): PEVP_PKEY cdecl; external CLibCrypto; + + function X509_dup(x509: PX509): PX509 cdecl; external CLibCrypto; + function X509_ATTRIBUTE_dup(xa: PX509_ATTRIBUTE): PX509_ATTRIBUTE cdecl; external CLibCrypto; + function X509_EXTENSION_dup(ex: PX509_EXTENSION): PX509_EXTENSION cdecl; external CLibCrypto; + function X509_CRL_dup(crl: PX509_CRL): PX509_CRL cdecl; external CLibCrypto; + function X509_REVOKED_dup(rev: PX509_REVOKED): PX509_REVOKED cdecl; external CLibCrypto; + function X509_REQ_dup(req: PX509_REQ): PX509_REQ cdecl; external CLibCrypto; + function X509_ALGOR_dup(xn: PX509_ALGOR): PX509_ALGOR cdecl; external CLibCrypto; + function X509_ALGOR_set0(alg: PX509_ALGOR; aobj: PASN1_OBJECT; ptype: TIdC_INT; pval: Pointer): TIdC_INT cdecl; external CLibCrypto; + procedure X509_ALGOR_get0(const paobj: PPASN1_OBJECT; pptype: PIdC_INT; const ppval: PPointer; const algor: PX509_ALGOR) cdecl; external CLibCrypto; + procedure X509_ALGOR_set_md(alg: PX509_ALGOR; const md: PEVP_MD) cdecl; external CLibCrypto; + function X509_ALGOR_cmp(const a: PX509_ALGOR; const b: PX509_ALGOR): TIdC_INT cdecl; external CLibCrypto; + + function X509_NAME_dup(xn: PX509_NAME): PX509_NAME cdecl; external CLibCrypto; + function X509_NAME_ENTRY_dup(ne: PX509_NAME_ENTRY): PX509_NAME_ENTRY cdecl; external CLibCrypto; + + function X509_cmp_time(const s: PASN1_TIME; t: PIdC_TIMET): TIdC_INT cdecl; external CLibCrypto; + function X509_cmp_current_time(const s: PASN1_TIME): TIdC_INT cdecl; external CLibCrypto; + function X509_time_adj(s: PASN1_TIME; adj: TIdC_LONG; t: PIdC_TIMET): PASN1_TIME cdecl; external CLibCrypto; + function X509_time_adj_ex(s: PASN1_TIME; offset_day: TIdC_INT; offset_sec: TIdC_LONG; t: PIdC_TIMET): PASN1_TIME cdecl; external CLibCrypto; + function X509_gmtime_adj(s: PASN1_TIME; adj: TIdC_LONG): PASN1_TIME cdecl; external CLibCrypto; + + function X509_get_default_cert_area: PIdAnsiChar cdecl; external CLibCrypto; + function X509_get_default_cert_dir: PIdAnsiChar cdecl; external CLibCrypto; + function X509_get_default_cert_file: PIdAnsiChar cdecl; external CLibCrypto; + function X509_get_default_cert_dir_env: PIdAnsiChar cdecl; external CLibCrypto; + function X509_get_default_cert_file_env: PIdAnsiChar cdecl; external CLibCrypto; + function X509_get_default_private_dir: PIdAnsiChar cdecl; external CLibCrypto; + + function X509_to_X509_REQ(x: PX509; pkey: PEVP_PKEY; const md: PEVP_MD): PX509_REQ cdecl; external CLibCrypto; + function X509_REQ_to_X509(r: PX509_REQ; days: TIdC_INT; pkey: PEVP_PKEY): PX509 cdecl; external CLibCrypto; + + function X509_ALGOR_new: PX509_ALGOR cdecl; external CLibCrypto; + procedure X509_ALGOR_free(v1: PX509_ALGOR) cdecl; external CLibCrypto; + function d2i_X509_ALGOR(a: PPX509_ALGOR; const in_: PPByte; len: TIdC_LONG): PX509_ALGOR cdecl; external CLibCrypto; + function i2d_X509_ALGOR(a: PX509_ALGOR; out_: PPByte): TIdC_INT cdecl; external CLibCrypto; + //DECLARE_ASN1_ENCODE_FUNCTIONS(X509_ALGORS, X509_ALGORS, X509_ALGORS) + function X509_VAL_new: PX509_VAL cdecl; external CLibCrypto; + procedure X509_VAL_free(v1: PX509_VAL) cdecl; external CLibCrypto; + function d2i_X509_VAL(a: PPX509_VAL; const in_: PPByte; len: TIdC_LONG): PX509_VAL cdecl; external CLibCrypto; + function i2d_X509_VAL(a: PX509_VAL; out_: PPByte): TIdC_INT cdecl; external CLibCrypto; + + function X509_PUBKEY_new: PX509_PUBKEY cdecl; external CLibCrypto; + procedure X509_PUBKEY_free(v1: PX509_PUBKEY) cdecl; external CLibCrypto; + function d2i_X509_PUBKEY(a: PPX509_PUBKEY; const in_: PPByte; len: TIdC_LONG): PX509_PUBKEY cdecl; external CLibCrypto; + function i2d_X509_PUBKEY(a: PX509_PUBKEY; out_: PPByte): TIdC_INT cdecl; external CLibCrypto; + + function X509_PUBKEY_set(x: PPX509_PUBKEY; pkey: PEVP_PKEY): TIdC_INT cdecl; external CLibCrypto; + function X509_PUBKEY_get0(key: PX509_PUBKEY): PEVP_PKEY cdecl; external CLibCrypto; {introduced 1.1.0} + function X509_PUBKEY_get(key: PX509_PUBKEY): PEVP_PKEY cdecl; external CLibCrypto; +// function X509_get_pubkey_parameters(pkey: PEVP_PKEY; chain: P STACK_OF(X509)): TIdC_INT; + function X509_get_pathlen(x: PX509): TIdC_LONG cdecl; external CLibCrypto; {introduced 1.1.0} + function i2d_PUBKEY(a: PEVP_PKEY; pp: PPByte): TIdC_INT cdecl; external CLibCrypto; + function d2i_PUBKEY(a: PPEVP_PKEY; const pp: PPByte; length: TIdC_LONG): PEVP_PKEY cdecl; external CLibCrypto; + + function i2d_RSA_PUBKEY(a: PRSA; pp: PPByte): TIdC_INT cdecl; external CLibCrypto; + function d2i_RSA_PUBKEY(a: PPRSA; const pp: PPByte; length: TIdC_LONG): PRSA cdecl; external CLibCrypto; + + function i2d_DSA_PUBKEY(a: PDSA; pp: PPByte): TIdC_INT cdecl; external CLibCrypto; + function d2i_DSA_PUBKEY(a: PPDSA; const pp: PPByte; length: TIdC_LONG): PDSA cdecl; external CLibCrypto; + + function i2d_EC_PUBKEY(a: EC_KEY; pp: PPByte): TIdC_INT cdecl; external CLibCrypto; + function d2i_EC_PUBKEY(a: PPEC_KEY; const pp: PPByte; length: TIdC_LONG): PEC_KEY cdecl; external CLibCrypto; + + function X509_SIG_new: PX509_SIG cdecl; external CLibCrypto; + procedure X509_SIG_free(v1: PX509_SIG) cdecl; external CLibCrypto; + function d2i_X509_SIG(a: PPX509_SIG; const in_: PPByte; len: TIdC_LONG): PX509_SIG cdecl; external CLibCrypto; + function i2d_X509_SIG(a: PX509_SIG; out_: PPByte): TIdC_INT cdecl; external CLibCrypto; + procedure X509_SIG_get0(const sig: PX509_SIG; const palg: PPX509_ALGOR; const pdigest: PPASN1_OCTET_STRING) cdecl; external CLibCrypto; {introduced 1.1.0} + procedure X509_SIG_getm(sig: X509_SIG; palg: PPX509_ALGOR; pdigest: PPASN1_OCTET_STRING) cdecl; external CLibCrypto; {introduced 1.1.0} + + function X509_REQ_INFO_new: PX509_REQ_INFO cdecl; external CLibCrypto; + procedure X509_REQ_INFO_free(v1: PX509_REQ_INFO) cdecl; external CLibCrypto; + function d2i_X509_REQ_INFO(a: PPX509_REQ_INFO; const in_: PPByte; len: TIdC_LONG): PX509_REQ_INFO cdecl; external CLibCrypto; + function i2d_X509_REQ_INFO(a: PX509_REQ_INFO; out_: PPByte): TIdC_INT cdecl; external CLibCrypto; + + function X509_REQ_new: PX509_REQ cdecl; external CLibCrypto; + procedure X509_REQ_free(v1: PX509_REQ) cdecl; external CLibCrypto; + function d2i_X509_REQ(a: PPX509_REQ; const in_: PPByte; len: TIdC_LONG): PX509_REQ cdecl; external CLibCrypto; + function i2d_X509_REQ(a: PX509_REQ; out_: PPByte): TIdC_INT cdecl; external CLibCrypto; + + function X509_ATTRIBUTE_new: PX509_ATTRIBUTE cdecl; external CLibCrypto; + procedure X509_ATTRIBUTE_free(v1: PX509_ATTRIBUTE) cdecl; external CLibCrypto; + function d2i_X509_ATTRIBUTE(a: PPX509_ATTRIBUTE; const in_: PPByte; len: TIdC_LONG): PX509_ATTRIBUTE cdecl; external CLibCrypto; + function i2d_X509_ATTRIBUTE(a: PX509_ATTRIBUTE; out_: PPByte): TIdC_INT cdecl; external CLibCrypto; + function X509_ATTRIBUTE_create(nid: TIdC_INT; trtype: TIdC_INT; value: Pointer): PX509_ATTRIBUTE cdecl; external CLibCrypto; + + function X509_EXTENSION_new: PX509_EXTENSION cdecl; external CLibCrypto; + procedure X509_EXTENSION_free(v1: PX509_EXTENSION) cdecl; external CLibCrypto; + function d2i_X509_EXTENSION(a: PPX509_EXTENSION; const in_: PPByte; len: TIdC_LONG): PX509_EXTENSION cdecl; external CLibCrypto; + function i2d_X509_EXTENSION(a: PX509_EXTENSION; out_: PPByte): TIdC_INT cdecl; external CLibCrypto; + //DECLARE_ASN1_ENCODE_FUNCTIONS(X509_EXTENSIONS, X509_EXTENSIONS, X509_EXTENSIONS) + + function X509_NAME_ENTRY_new: PX509_NAME_ENTRY cdecl; external CLibCrypto; + procedure X509_NAME_ENTRY_free(v1: PX509_NAME_ENTRY) cdecl; external CLibCrypto; + function d2i_X509_NAME_ENTRY(a: PPX509_NAME_ENTRY; const in_: PPByte; len: TIdC_LONG): PX509_NAME_ENTRY cdecl; external CLibCrypto; + function i2d_X509_NAME_ENTRY(a: PX509_NAME_ENTRY; out_: PPByte): TIdC_INT cdecl; external CLibCrypto; + + function X509_NAME_new: PX509_NAME cdecl; external CLibCrypto; + procedure X509_NAME_free(v1: PX509_NAME) cdecl; external CLibCrypto; + function d2i_X509_NAME(a: PPX509_NAME; const in_: PPByte; len: TIdC_LONG): PX509_NAME cdecl; external CLibCrypto; + function i2d_X509_NAME(a: PX509_NAME; out_: PPByte): TIdC_INT cdecl; external CLibCrypto; + + function X509_NAME_set(xn: PPX509_NAME; name: PX509_NAME): TIdC_INT cdecl; external CLibCrypto; + + //DECLARE_ASN1_FUNCTIONS(X509_CINF) + + function X509_new: PX509 cdecl; external CLibCrypto; + procedure X509_free(v1: PX509) cdecl; external CLibCrypto; + function d2i_X509(a: PPX509; const in_: PPByte; len: TIdC_LONG): PX509 cdecl; external CLibCrypto; + function i2d_X509(a: PX509; out_: PPByte): TIdC_INT cdecl; external CLibCrypto; + + //DECLARE_ASN1_FUNCTIONS(X509_CERT_AUX) + // + //#define X509_get_ex_new_index(l, p, newf, dupf, freef) \ + // CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_X509, l, p, newf, dupf, freef) + function X509_set_ex_data(r: PX509; idx: TIdC_INT; arg: Pointer): TIdC_INT cdecl; external CLibCrypto; + function X509_get_ex_data(r: PX509; idx: TIdC_INT): Pointer cdecl; external CLibCrypto; + function i2d_X509_AUX(a: PX509; pp: PPByte): TIdC_INT cdecl; external CLibCrypto; + function d2i_X509_AUX(a: PPX509; const pp: PPByte; length: TIdC_LONG): PX509 cdecl; external CLibCrypto; + + function i2d_re_X509_tbs(x: PX509; pp: PPByte): TIdC_INT cdecl; external CLibCrypto; + + function X509_SIG_INFO_get(const siginf: PX509_SIG_INFO; mdnid: PIdC_INT; pknid: PIdC_INT; secbits: PIdC_INT; flags: PIdC_UINT32): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + procedure X509_SIG_INFO_set(siginf: PX509_SIG_INFO; mdnid: TIdC_INT; pknid: TIdC_INT; secbits: TIdC_INT; flags: TIdC_UINT32) cdecl; external CLibCrypto; {introduced 1.1.0} + + function X509_get_signature_info(x: PX509; mdnid: PIdC_INT; pknid: PIdC_INT; secbits: PIdC_INT; flags: PIdC_UINT32): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + + procedure X509_get0_signature(var sig: PASN1_BIT_STRING; var alg: PX509_ALGOR; const x: PX509) cdecl; external CLibCrypto; {introduced 1.1.0} + function X509_get_signature_nid(const x: PX509): TIdC_INT cdecl; external CLibCrypto; + + function X509_trusted(const x: PX509): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function X509_alias_set1(x: PX509; const name: PByte; len: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function X509_keyid_set1(x: PX509; const id: PByte; len: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function X509_alias_get0(x: PX509; len: PIdC_INT): PByte cdecl; external CLibCrypto; + function X509_keyid_get0(x: PX509; len: PIdC_INT): PByte cdecl; external CLibCrypto; +// TIdC_INT (*X509_TRUST_set_default(TIdC_INT (*trust) (TIdC_INT, X509 *, TIdC_INT))) (TIdC_INT, X509 *, +// TIdC_INT); + function X509_TRUST_set(t: PIdC_INT; trust: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function X509_add1_trust_object(x: PX509; const obj: PASN1_OBJECT): TIdC_INT cdecl; external CLibCrypto; + function X509_add1_reject_object(x: PX509; const obj: PASN1_OBJECT): TIdC_INT cdecl; external CLibCrypto; + procedure X509_trust_clear(x: PX509) cdecl; external CLibCrypto; + procedure X509_reject_clear(x: PX509) cdecl; external CLibCrypto; + + //STACK_OF(ASN1_OBJECT) *X509_get0_trust_objects(X509 *x); + //STACK_OF(ASN1_OBJECT) *X509_get0_reject_objects(X509 *x); + // + function X509_REVOKED_new: PX509_REVOKED cdecl; external CLibCrypto; + procedure X509_REVOKED_free(v1: PX509_REVOKED) cdecl; external CLibCrypto; + function d2i_X509_REVOKED(a: PPX509_REVOKED; const in_: PPByte; len: TIdC_LONG): PX509_REVOKED cdecl; external CLibCrypto; + function i2d_X509_REVOKED(a: PX509_REVOKED; out_: PPByte): TIdC_INT cdecl; external CLibCrypto; + function X509_CRL_INFO_new: PX509_CRL_INFO cdecl; external CLibCrypto; + procedure X509_CRL_INFO_free(v1: PX509_CRL_INFO) cdecl; external CLibCrypto; + function d2i_X509_CRL_INFO(a: PPX509_CRL_INFO; const in_: PPByte; len: TIdC_LONG): PX509_CRL_INFO cdecl; external CLibCrypto; + function i2d_X509_CRL_INFO(a: PX509_CRL_INFO; out_: PPByte): TIdC_INT cdecl; external CLibCrypto; + function X509_CRL_new: PX509_CRL cdecl; external CLibCrypto; + procedure X509_CRL_free(v1: PX509_CRL) cdecl; external CLibCrypto; + function d2i_X509_CRL(a: PPX509_CRL; const in_: PPByte; len: TIdC_LONG): PX509_CRL cdecl; external CLibCrypto; + function i2d_X509_CRL(a: PX509_CRL; out_: PPByte): TIdC_INT cdecl; external CLibCrypto; + + function X509_CRL_add0_revoked(crl: PX509_CRL; rev: PX509_REVOKED): TIdC_INT cdecl; external CLibCrypto; + function X509_CRL_get0_by_serial(crl: PX509_CRL; ret: PPX509_REVOKED; serial: PASN1_INTEGER): TIdC_INT cdecl; external CLibCrypto; + function X509_CRL_get0_by_cert(crl: PX509_CRL; ret: PPX509_REVOKED; x: PX509): TIdC_INT cdecl; external CLibCrypto; + + function X509_PKEY_new: PX509_PKEY cdecl; external CLibCrypto; + procedure X509_PKEY_free(a: PX509_PKEY) cdecl; external CLibCrypto; + + //DECLARE_ASN1_FUNCTIONS(NETSCAPE_SPKI) + //DECLARE_ASN1_FUNCTIONS(NETSCAPE_SPKAC) + //DECLARE_ASN1_FUNCTIONS(NETSCAPE_CERT_SEQUENCE) + + function X509_INFO_new: PX509_INFO cdecl; external CLibCrypto; + procedure X509_INFO_free(a: PX509_INFO) cdecl; external CLibCrypto; + function X509_NAME_oneline(const a: PX509_NAME; buf: PIdAnsiChar; size: TIdC_INT): PIdAnsiChar cdecl; external CLibCrypto; + +// function ASN1_verify(i2d: Pi2d_of_void; algor1: PX509_ALGOR; +// signature: PASN1_BIT_STRING; data: PIdAnsiChar; pkey: PEVP_PKEY): TIdC_INT; + +// TIdC_INT ASN1_digest(i2d_of_void *i2d, const EVP_MD *type, char *data, +// unsigned char *md, unsigned TIdC_INT *len); + +// TIdC_INT ASN1_sign(i2d_of_void *i2d, X509_ALGOR *algor1, +// X509_ALGOR *algor2, ASN1_BIT_STRING *signature, +// char *data, EVP_PKEY *pkey, const EVP_MD *type); + + function ASN1_item_digest(const it: PASN1_ITEM; const type_: PEVP_MD; data: Pointer; md: PByte; len: PIdC_UINT): TIdC_INT cdecl; external CLibCrypto; + + function ASN1_item_verify(const it: PASN1_ITEM; algor1: PX509_ALGOR; signature: PASN1_BIT_STRING; data: Pointer; pkey: PEVP_PKEY): TIdC_INT cdecl; external CLibCrypto; + + function ASN1_item_sign(const it: PASN1_ITEM; algor1: PX509_ALGOR; algor2: PX509_ALGOR; signature: PASN1_BIT_STRING; data: Pointer; pkey: PEVP_PKEY; const type_: PEVP_MD): TIdC_INT cdecl; external CLibCrypto; + function ASN1_item_sign_ctx(const it: PASN1_ITEM; algor1: PX509_ALGOR; algor2: PX509_ALGOR; signature: PASN1_BIT_STRING; asn: Pointer; ctx: PEVP_MD_CTX): TIdC_INT cdecl; external CLibCrypto; + + function X509_get_version(const x: PX509): TIdC_LONG cdecl; external CLibCrypto; {introduced 1.1.0} + function X509_set_version(x: PX509; version: TIdC_LONG): TIdC_INT cdecl; external CLibCrypto; + function X509_set_serialNumber(x: PX509; serial: PASN1_INTEGER): TIdC_INT cdecl; external CLibCrypto; + function X509_get_serialNumber(x: PX509): PASN1_INTEGER cdecl; external CLibCrypto; + function X509_get0_serialNumber(const x: PX509): PASN1_INTEGER cdecl; external CLibCrypto; {introduced 1.1.0} + function X509_set_issuer_name(x: PX509; name: PX509_NAME): TIdC_INT cdecl; external CLibCrypto; + function X509_get_issuer_name(const a: PX509): PX509_NAME cdecl; external CLibCrypto; + function X509_set_subject_name(x: PX509; name: PX509_NAME): TIdC_INT cdecl; external CLibCrypto; + function X509_get_subject_name(const a: PX509): PX509_NAME cdecl; external CLibCrypto; + function X509_get0_notBefore(const x: PX509): PASN1_TIME cdecl; external CLibCrypto; {introduced 1.1.0} + function X509_getm_notBefore(const x: PX509): PASN1_TIME cdecl; external CLibCrypto; {introduced 1.1.0} + function X509_set1_notBefore(x: PX509; const tm: PASN1_TIME): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function X509_get0_notAfter(const x: PX509): PASN1_TIME cdecl; external CLibCrypto; {introduced 1.1.0} + function X509_getm_notAfter(const x: PX509): PASN1_TIME cdecl; external CLibCrypto; {introduced 1.1.0} + function X509_set1_notAfter(x: PX509; const tm: PASN1_TIME): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function X509_set_pubkey(x: PX509; pkey: PEVP_PKEY): TIdC_INT cdecl; external CLibCrypto; + function X509_up_ref(x: PX509): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function X509_get_signature_type(const x: PX509): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + + (* + * This one is only used so that a binary form can output, as in + * i2d_X509_PUBKEY(X509_get_X509_PUBKEY(x), &buf) + *) + function X509_get_X509_PUBKEY(const x: PX509): PX509_PUBKEY cdecl; external CLibCrypto; {introduced 1.1.0} +// const STACK_OF(X509_EXTENSION) *X509_get0_extensions(const X509 *x); + procedure X509_get0_uids(const x: PX509; const piuid: PPASN1_BIT_STRING; const psuid: PPASN1_BIT_STRING) cdecl; external CLibCrypto; {introduced 1.1.0} + function X509_get0_tbs_sigalg(const x: PX509): PX509_ALGOR cdecl; external CLibCrypto; {introduced 1.1.0} + + function X509_get0_pubkey(const x: PX509): PEVP_PKEY cdecl; external CLibCrypto; {introduced 1.1.0} + function X509_get_pubkey(x: PX509): PEVP_PKEY cdecl; external CLibCrypto; + function X509_get0_pubkey_bitstr(const x: PX509): PASN1_BIT_STRING cdecl; external CLibCrypto; + function X509_certificate_type(const x: PX509; const pubkey: PEVP_PKEY): TIdC_INT cdecl; external CLibCrypto; + + function X509_REQ_get_version(const req: PX509_REQ): TIdC_LONG cdecl; external CLibCrypto; {introduced 1.1.0} + function X509_REQ_set_version(x: PX509_REQ; version: TIdC_LONG): TIdC_INT cdecl; external CLibCrypto; + function X509_REQ_get_subject_name(const req: PX509_REQ): PX509_NAME cdecl; external CLibCrypto; {introduced 1.1.0} + function X509_REQ_set_subject_name(req: PX509_REQ; name: PX509_NAME): TIdC_INT cdecl; external CLibCrypto; + procedure X509_REQ_get0_signature(const req: PX509_REQ; const psig: PPASN1_BIT_STRING; const palg: PPX509_ALGOR) cdecl; external CLibCrypto; {introduced 1.1.0} + function X509_REQ_get_signature_nid(const req: PX509_REQ): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function i2d_re_X509_REQ_tbs(req: PX509_REQ; pp: PPByte): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function X509_REQ_set_pubkey(x: PX509_REQ; pkey: PEVP_PKEY): TIdC_INT cdecl; external CLibCrypto; + function X509_REQ_get_pubkey(req: PX509_REQ): PEVP_PKEY cdecl; external CLibCrypto; + function X509_REQ_get0_pubkey(req: PX509_REQ): PEVP_PKEY cdecl; external CLibCrypto; {introduced 1.1.0} + function X509_REQ_get_X509_PUBKEY(req: PX509_REQ): PX509_PUBKEY cdecl; external CLibCrypto; {introduced 1.1.0} + function X509_REQ_extension_nid(nid: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function X509_REQ_get_extension_nids: PIdC_INT cdecl; external CLibCrypto; + procedure X509_REQ_set_extension_nids(nids: PIdC_INT) cdecl; external CLibCrypto; +// STACK_OF(X509_EXTENSION) *X509_REQ_get_extensions(X509_REQ *req); + //TIdC_INT X509_REQ_add_extensions_nid(X509_REQ *req, STACK_OF(X509_EXTENSION) *exts, + // TIdC_INT nid); + //TIdC_INT X509_REQ_add_extensions(X509_REQ *req, STACK_OF(X509_EXTENSION) *exts); + function X509_REQ_get_attr_count(const req: PX509_REQ): TIdC_INT cdecl; external CLibCrypto; + function X509_REQ_get_attr_by_NID(const req: PX509_REQ; nid: TIdC_INT; lastpos: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function X509_REQ_get_attr_by_OBJ(const req: PX509_REQ; const obj: ASN1_OBJECT; lastpos: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function X509_REQ_get_attr(const req: PX509_REQ; loc: TIdC_INT): PX509_ATTRIBUTE cdecl; external CLibCrypto; + function X509_REQ_delete_attr(req: PX509_REQ; loc: TIdC_INT): PX509_ATTRIBUTE cdecl; external CLibCrypto; + function X509_REQ_add1_attr(req: PX509_REQ; attr: PX509_ATTRIBUTE): TIdC_INT cdecl; external CLibCrypto; + function X509_REQ_add1_attr_by_OBJ(req: PX509_REQ; const obj: PASN1_OBJECT; type_: TIdC_INT; const bytes: PByte; len: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function X509_REQ_add1_attr_by_NID(req: PX509_REQ; nid: TIdC_INT; type_: TIdC_INT; const bytes: PByte; len: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function X509_REQ_add1_attr_by_txt(req: PX509_REQ; const attrname: PIdAnsiChar; type_: TIdC_INT; const bytes: PByte; len: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + + function X509_CRL_set_version(x: PX509_CRL; version: TIdC_LONG): TIdC_INT cdecl; external CLibCrypto; + function X509_CRL_set_issuer_name(x: PX509_CRL; name: PX509_NAME): TIdC_INT cdecl; external CLibCrypto; + function X509_CRL_set1_lastUpdate(x: PX509_CRL; const tm: PASN1_TIME): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function X509_CRL_set1_nextUpdate(x: PX509_CRL; const tm: PASN1_TIME): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function X509_CRL_sort(crl: PX509_CRL): TIdC_INT cdecl; external CLibCrypto; + function X509_CRL_up_ref(crl: PX509_CRL): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + + function X509_CRL_get_version(const crl: PX509_CRL): TIdC_LONG cdecl; external CLibCrypto; {introduced 1.1.0} + function X509_CRL_get0_lastUpdate(const crl: PX509_CRL): PASN1_TIME cdecl; external CLibCrypto; {introduced 1.1.0} + function X509_CRL_get0_nextUpdate(const crl: PX509_CRL): PASN1_TIME cdecl; external CLibCrypto; {introduced 1.1.0} + function X509_CRL_get_issuer(const crl: PX509_CRL): PX509_NAME cdecl; external CLibCrypto; {introduced 1.1.0} + //const STACK_OF(X509_EXTENSION) *X509_CRL_get0_extensions(const X509_CRL *crl); + //STACK_OF(X509_REVOKED) *X509_CRL_get_REVOKED(X509_CRL *crl); + procedure X509_CRL_get0_signature(const crl: PX509_CRL; const psig: PPASN1_BIT_STRING; const palg: PPX509_ALGOR) cdecl; external CLibCrypto; {introduced 1.1.0} + function X509_CRL_get_signature_nid(const crl: PX509_CRL): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function i2d_re_X509_CRL_tbs(req: PX509_CRL; pp: PPByte): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + + function X509_REVOKED_get0_serialNumber(const x: PX509_REVOKED): PASN1_INTEGER cdecl; external CLibCrypto; {introduced 1.1.0} + function X509_REVOKED_set_serialNumber(x: PX509_REVOKED; serial: PASN1_INTEGER): TIdC_INT cdecl; external CLibCrypto; + function X509_REVOKED_get0_revocationDate(const x: PX509_REVOKED): PASN1_TIME cdecl; external CLibCrypto; {introduced 1.1.0} + function X509_REVOKED_set_revocationDate(r: PX509_REVOKED; tm: PASN1_TIME): TIdC_INT cdecl; external CLibCrypto; + //const STACK_OF(X509_EXTENSION) * + //X509_REVOKED_get0_extensions(const X509_REVOKED *r); + + function X509_CRL_diff(base: PX509_CRL; newer: PX509_CRL; skey: PEVP_PKEY; const md: PEVP_MD; flags: TIdC_UINT): PX509_CRL cdecl; external CLibCrypto; + + function X509_REQ_check_private_key(x509: PX509_REQ; pkey: PEVP_PKEY): TIdC_INT cdecl; external CLibCrypto; + + function X509_check_private_key(const x509: PX509; const pkey: PEVP_PKEY): TIdC_INT cdecl; external CLibCrypto; + //TIdC_INT X509_chain_check_suiteb(TIdC_INT *perror_depth, + // X509 *x, STACK_OF(X509) *chain, + // unsigned TIdC_LONG flags); + function X509_CRL_check_suiteb(crl: PX509_CRL; pk: PEVP_PKEY; flags: TIdC_ULONG): TIdC_INT cdecl; external CLibCrypto; + //STACK_OF(X509) *X509_chain_up_ref(STACK_OF(X509) *chain); + + function X509_issuer_and_serial_cmp(const a: PX509; const b: PX509): TIdC_INT cdecl; external CLibCrypto; + function X509_issuer_and_serial_hash(a: PX509): TIdC_ULONG cdecl; external CLibCrypto; + + function X509_issuer_name_cmp(const a: PX509; const b: PX509): TIdC_INT cdecl; external CLibCrypto; + function X509_issuer_name_hash(a: PX509): TIdC_uLONG cdecl; external CLibCrypto; + + function X509_subject_name_cmp(const a: PX509; const b: PX509): TIdC_INT cdecl; external CLibCrypto; + function X509_subject_name_hash(x: PX509): TIdC_ULONG cdecl; external CLibCrypto; + + function X509_cmp(const a: PX509; const b: PX509): TIdC_INT cdecl; external CLibCrypto; + function X509_NAME_cmp(const a: PX509_NAME; const b: PX509_NAME): TIdC_INT cdecl; external CLibCrypto; + function X509_NAME_hash_old(x: PX509_NAME): TIdC_ULONG cdecl; external CLibCrypto; + + function X509_CRL_cmp(const a: PX509_CRL; const b: PX509_CRL): TIdC_INT cdecl; external CLibCrypto; + function X509_CRL_match(const a: PX509_CRL; const b: PX509_CRL): TIdC_INT cdecl; external CLibCrypto; + function X509_aux_print(out_: PBIO; x: PX509; indent: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + //# ifndef OPENSSL_NO_STDIO + //TIdC_INT X509_print_ex_fp(FILE *bp, X509 *x, unsigned TIdC_LONG nmflag, + // unsigned TIdC_LONG cflag); + //TIdC_INT X509_print_fp(FILE *bp, X509 *x); + //TIdC_INT X509_CRL_print_fp(FILE *bp, X509_CRL *x); + //TIdC_INT X509_REQ_print_fp(FILE *bp, X509_REQ *req); + //TIdC_INT X509_NAME_print_ex_fp(FILE *fp, const X509_NAME *nm, TIdC_INT indent, + // unsigned TIdC_LONG flags); + //# endif + + function X509_NAME_print(bp: PBIO; const name: PX509_NAME; obase: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function X509_NAME_print_ex(out_: PBIO; const nm: PX509_NAME; indent: TIdC_INT; flags: TIdC_ULONG): TIdC_INT cdecl; external CLibCrypto; + function X509_print_ex(bp: PBIO; x: PX509; nmflag: TIdC_ULONG; cflag: TIdC_ULONG): TIdC_INT cdecl; external CLibCrypto; + function X509_print(bp: PBIO; x: PX509): TIdC_INT cdecl; external CLibCrypto; + function X509_ocspid_print(bp: PBIO; x: PX509): TIdC_INT cdecl; external CLibCrypto; + function X509_CRL_print_ex(out_: PBIO; x: PX509_CRL; nmflag: TIdC_ULONG): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function X509_CRL_print(bp: PBIO; x: PX509_CRL): TIdC_INT cdecl; external CLibCrypto; + function X509_REQ_print_ex(bp: PBIO; x: PX509_REQ; nmflag: TIdC_ULONG; cflag: TIdC_ULONG): TIdC_INT cdecl; external CLibCrypto; + function X509_REQ_print(bp: PBIO; req: PX509_REQ): TIdC_INT cdecl; external CLibCrypto; + + function X509_NAME_entry_count(const name: PX509_NAME): TIdC_INT cdecl; external CLibCrypto; + function X509_NAME_get_text_by_NID(name: PX509_NAME; nid: TIdC_INT; buf: PIdAnsiChar; len: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function X509_NAME_get_text_by_OBJ(name: PX509_NAME; const obj: PASN1_OBJECT; buf: PIdAnsiChar; len: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + + (* + * NOTE: you should be passing -1, not 0 as lastpos. The functions that use + * lastpos, search after that position on. + *) + function X509_NAME_get_index_by_NID(name: PX509_NAME; nid: TIdC_INT; lastpos: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function X509_NAME_get_index_by_OBJ(name: PX509_NAME; const obj: PASN1_OBJECT; lastpos: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function X509_NAME_get_entry(const name: PX509_NAME; loc: TIdC_INT): PX509_NAME_ENTRY cdecl; external CLibCrypto; + function X509_NAME_delete_entry(name: PX509_NAME; loc: TIdC_INT): pX509_NAME_ENTRY cdecl; external CLibCrypto; + function X509_NAME_add_entry(name: PX509_NAME; const ne: PX509_NAME_ENTRY; loc: TIdC_INT; set_: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function X509_NAME_add_entry_by_OBJ(name: PX509_NAME; const obj: PASN1_OBJECT; type_: TIdC_INT; const bytes: PByte; len: TIdC_INT; loc: TIdC_INT; set_: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function X509_NAME_add_entry_by_NID(name: PX509_NAME; nid: TIdC_INT; type_: TIdC_INT; const bytes: PByte; len: TIdC_INT; loc: TIdC_INT; set_: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function X509_NAME_ENTRY_create_by_txt(ne: PPX509_NAME_ENTRY; const field: PIdAnsiChar; type_: TIdC_INT; const bytes: PByte; len: TIdC_INT): PX509_NAME_ENTRY cdecl; external CLibCrypto; + function X509_NAME_ENTRY_create_by_NID(ne: PPX509_NAME_ENTRY; nid: TIdC_INT; type_: TIdC_INT; const bytes: PByte; len: TIdC_INT): PX509_NAME_ENTRY cdecl; external CLibCrypto; + function X509_NAME_add_entry_by_txt(name: PX509_NAME; const field: PIdAnsiChar; type_: TIdC_INT; const bytes: PByte; len: TIdC_INT; loc: TIdC_INT; set_: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function X509_NAME_ENTRY_create_by_OBJ(ne: PPX509_NAME_ENTRY; const obj: PASN1_OBJECT; type_: TIdC_INT; const bytes: PByte; len: TIdC_INT): PX509_NAME_ENTRY cdecl; external CLibCrypto; + function X509_NAME_ENTRY_set_object(ne: PX509_NAME_ENTRY; const obj: PASN1_OBJECT): TIdC_INT cdecl; external CLibCrypto; + function X509_NAME_ENTRY_set_data(ne: PX509_NAME_ENTRY; type_: TIdC_INT; const bytes: PByte; len: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function X509_NAME_ENTRY_get_object(const ne: PX509_NAME_ENTRY): PASN1_OBJECT cdecl; external CLibCrypto; + function X509_NAME_ENTRY_get_data(const ne: PX509_NAME_ENTRY): PASN1_STRING cdecl; external CLibCrypto; + function X509_NAME_ENTRY_set(const ne: PX509_NAME_ENTRY): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + + function X509_NAME_get0_der(nm: PX509_NAME; const pder: PPByte; pderlen: PIdC_SIZET): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + + //TIdC_INT X509v3_get_ext_count(const STACK_OF(X509_EXTENSION) *x); + //TIdC_INT X509v3_get_ext_by_NID(const STACK_OF(X509_EXTENSION) *x, + // TIdC_INT nid, TIdC_INT lastpos); + //TIdC_INT X509v3_get_ext_by_OBJ(const STACK_OF(X509_EXTENSION) *x, + // const ASN1_OBJECT *obj, TIdC_INT lastpos); + //TIdC_INT X509v3_get_ext_by_critical(const STACK_OF(X509_EXTENSION) *x, + // TIdC_INT crit, TIdC_INT lastpos); + //X509_EXTENSION *X509v3_get_ext(const STACK_OF(X509_EXTENSION) *x, TIdC_INT loc); + //X509_EXTENSION *X509v3_delete_ext(STACK_OF(X509_EXTENSION) *x, TIdC_INT loc); + //STACK_OF(X509_EXTENSION) *X509v3_add_ext(STACK_OF(X509_EXTENSION) **x, + // X509_EXTENSION *ex, TIdC_INT loc); + + function X509_get_ext_count(const x: PX509): TIdC_INT cdecl; external CLibCrypto; + function X509_get_ext_by_NID(const x: PX509; nid: TIdC_INT; lastpos: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function X509_get_ext_by_OBJ(const x: PX509; const obj: PASN1_OBJECT; lastpos: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function X509_get_ext_by_critical(const x: PX509; crit: TIdC_INT; lastpos: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function X509_get_ext(const x: PX509; loc: TIdC_INT): PX509_EXTENSION cdecl; external CLibCrypto; + function X509_delete_ext(x: PX509; loc: TIdC_INT): PX509_EXTENSION cdecl; external CLibCrypto; + function X509_add_ext(x: PX509; ex: PX509_EXTENSION; loc: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function X509_get_ext_d2i(const x: PX509; nid: TIdC_INT; crit: PIdC_INT; idx: PIdC_INT): Pointer cdecl; external CLibCrypto; + function X509_add1_ext_i2d(x: PX509; nid: TIdC_INT; value: Pointer; crit: TIdC_INT; flags: TIdC_ULONG): TIdC_INT cdecl; external CLibCrypto; + + function X509_CRL_get_ext_count(const x: PX509_CRL): TIdC_INT cdecl; external CLibCrypto; + function X509_CRL_get_ext_by_NID(const x: PX509_CRL; nid: TIdC_INT; lastpos: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function X509_CRL_get_ext_by_OBJ(const x: X509_CRL; const obj: PASN1_OBJECT; lastpos: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function X509_CRL_get_ext_by_critical(const x: PX509_CRL; crit: TIdC_INT; lastpos: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function X509_CRL_get_ext(const x: PX509_CRL; loc: TIdC_INT): PX509_EXTENSION cdecl; external CLibCrypto; + function X509_CRL_delete_ext(x: PX509_CRL; loc: TIdC_INT): PX509_EXTENSION cdecl; external CLibCrypto; + function X509_CRL_add_ext(x: PX509_CRL; ex: PX509_EXTENSION; loc: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function X509_CRL_get_ext_d2i(const x: PX509_CRL; nid: TIdC_INT; crit: PIdC_INT; idx: PIdC_INT): Pointer cdecl; external CLibCrypto; + function X509_CRL_add1_ext_i2d(x: PX509_CRL; nid: TIdC_INT; value: Pointer; crit: TIdC_INT; flags: TIdC_ULONG): TIdC_INT cdecl; external CLibCrypto; + + function X509_REVOKED_get_ext_count(const x: PX509_REVOKED): TIdC_INT cdecl; external CLibCrypto; + function X509_REVOKED_get_ext_by_NID(const x: PX509_REVOKED; nid: TIdC_INT; lastpos: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function X509_REVOKED_get_ext_by_OBJ(const x: PX509_REVOKED; const obj: PASN1_OBJECT; lastpos: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function X509_REVOKED_get_ext_by_critical(const x: PX509_REVOKED; crit: TIdC_INT; lastpos: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function X509_REVOKED_get_ext(const x: PX509_REVOKED; loc: TIdC_INT): PX509_EXTENSION cdecl; external CLibCrypto; + function X509_REVOKED_delete_ext(x: PX509_REVOKED; loc: TIdC_INT): PX509_EXTENSION cdecl; external CLibCrypto; + function X509_REVOKED_add_ext(x: PX509_REVOKED; ex: PX509_EXTENSION; loc: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function X509_REVOKED_get_ext_d2i(const x: PX509_REVOKED; nid: TIdC_INT; crit: PIdC_INT; idx: PIdC_INT): Pointer cdecl; external CLibCrypto; + function X509_REVOKED_add1_ext_i2d(x: PX509_REVOKED; nid: TIdC_INT; value: Pointer; crit: TIdC_INT; flags: TIdC_ULONG): TIdC_INT cdecl; external CLibCrypto; + + function X509_EXTENSION_create_by_NID(ex: PPX509_EXTENSION; nid: TIdC_INT; crit: TIdC_INT; data: PASN1_OCTET_STRING): PX509_EXTENSION cdecl; external CLibCrypto; + function X509_EXTENSION_create_by_OBJ(ex: PPX509_EXTENSION; const obj: PASN1_OBJECT; crit: TIdC_INT; data: PASN1_OCTET_STRING): PX509_EXTENSION cdecl; external CLibCrypto; + function X509_EXTENSION_set_object(ex: PX509_EXTENSION; const obj: PASN1_OBJECT): TIdC_INT cdecl; external CLibCrypto; + function X509_EXTENSION_set_critical(ex: PX509_EXTENSION; crit: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function X509_EXTENSION_set_data(ex: PX509_EXTENSION; data: PASN1_OCTET_STRING): TIdC_INT cdecl; external CLibCrypto; + function X509_EXTENSION_get_object(ex: PX509_EXTENSION): PASN1_OBJECT cdecl; external CLibCrypto; + function X509_EXTENSION_get_data(ne: PX509_EXTENSION): PASN1_OCTET_STRING cdecl; external CLibCrypto; + function X509_EXTENSION_get_critical(const ex: PX509_EXTENSION): TIdC_INT cdecl; external CLibCrypto; + + //TIdC_INT X509at_get_attr_count(const STACK_OF(X509_ATTRIBUTE) *x); + //TIdC_INT X509at_get_attr_by_NID(const STACK_OF(X509_ATTRIBUTE) *x, TIdC_INT nid, + // TIdC_INT lastpos); + //TIdC_INT X509at_get_attr_by_OBJ(const STACK_OF(X509_ATTRIBUTE) *sk, + // const ASN1_OBJECT *obj, TIdC_INT lastpos); + //X509_ATTRIBUTE *X509at_get_attr(const STACK_OF(X509_ATTRIBUTE) *x, TIdC_INT loc); + //X509_ATTRIBUTE *X509at_delete_attr(STACK_OF(X509_ATTRIBUTE) *x, TIdC_INT loc); + //STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr(STACK_OF(X509_ATTRIBUTE) **x, + // X509_ATTRIBUTE *attr); + //STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_OBJ(STACK_OF(X509_ATTRIBUTE) + // **x, const ASN1_OBJECT *obj, + // TIdC_INT type, + // const unsigned char *bytes, + // TIdC_INT len); + //STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_NID(STACK_OF(X509_ATTRIBUTE) + // **x, TIdC_INT nid, TIdC_INT type, + // const unsigned char *bytes, + // TIdC_INT len); + //STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_txt(STACK_OF(X509_ATTRIBUTE) + // **x, const PIdAnsiChar *attrname, + // TIdC_INT type, + // const unsigned char *bytes, + // TIdC_INT len); + //void *X509at_get0_data_by_OBJ(STACK_OF(X509_ATTRIBUTE) *x, + // const ASN1_OBJECT *obj, TIdC_INT lastpos, TIdC_INT type); + function X509_ATTRIBUTE_create_by_NID(attr: PPX509_ATTRIBUTE; nid: TIdC_INT; atrtype: TIdC_INT; const data: Pointer; len: TIdC_INT): PX509_ATTRIBUTE cdecl; external CLibCrypto; + function X509_ATTRIBUTE_create_by_OBJ(attr: PPX509_ATTRIBUTE; const obj: PASN1_OBJECT; atrtype: TIdC_INT; const data: Pointer; len: TIdC_INT): PX509_ATTRIBUTE cdecl; external CLibCrypto; + function X509_ATTRIBUTE_create_by_txt(attr: PPX509_ATTRIBUTE; const atrname: PIdAnsiChar; type_: TIdC_INT; const bytes: PByte; len: TIdC_INT): PX509_ATTRIBUTE cdecl; external CLibCrypto; + function X509_ATTRIBUTE_set1_object(attr: PX509_ATTRIBUTE; const obj: PASN1_OBJECT): TIdC_INT cdecl; external CLibCrypto; + function X509_ATTRIBUTE_set1_data(attr: PX509_ATTRIBUTE; attrtype: TIdC_INT; const data: Pointer; len: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function X509_ATTRIBUTE_get0_data(attr: PX509_ATTRIBUTE; idx: TIdC_INT; atrtype: TIdC_INT; data: Pointer): Pointer cdecl; external CLibCrypto; + function X509_ATTRIBUTE_count(const attr: PX509_ATTRIBUTE): TIdC_INT cdecl; external CLibCrypto; + function X509_ATTRIBUTE_get0_object(attr: PX509_ATTRIBUTE): PASN1_OBJECT cdecl; external CLibCrypto; + function X509_ATTRIBUTE_get0_type(attr: PX509_ATTRIBUTE; idx: TIdC_INT): PASN1_TYPE cdecl; external CLibCrypto; + + function EVP_PKEY_get_attr_count(const key: PEVP_PKEY): TIdC_INT cdecl; external CLibCrypto; + function EVP_PKEY_get_attr_by_NID(const key: PEVP_PKEY; nid: TIdC_INT; lastpos: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function EVP_PKEY_get_attr_by_OBJ(const key: PEVP_PKEY; const obj: PASN1_OBJECT; lastpos: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function EVP_PKEY_get_attr(const key: PEVP_PKEY; loc: TIdC_INT): PX509_ATTRIBUTE cdecl; external CLibCrypto; + function EVP_PKEY_delete_attr(key: PEVP_PKEY; loc: TIdC_INT): PX509_ATTRIBUTE cdecl; external CLibCrypto; + function EVP_PKEY_add1_attr(key: PEVP_PKEY; attr: PX509_ATTRIBUTE): TIdC_INT cdecl; external CLibCrypto; + function EVP_PKEY_add1_attr_by_OBJ(key: PEVP_PKEY; const obj: PASN1_OBJECT; type_: TIdC_INT; const bytes: PByte; len: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function EVP_PKEY_add1_attr_by_NID(key: PEVP_PKEY; nid: TIdC_INT; type_: TIdC_INT; const bytes: PByte; len: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function EVP_PKEY_add1_attr_by_txt(key: PEVP_PKEY; const attrname: PIdAnsiChar; type_: TIdC_INT; const bytes: PByte; len: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + + function X509_verify_cert(ctx: PX509_STORE_CTX): TIdC_INT cdecl; external CLibCrypto; + + (* lookup a cert from a X509 STACK *) +// function X509_find_by_issuer_and_serial(sk: P STACK_OF(X509); name: PX509_NAME; serial: PASN1_INTEGER): PX509; +// X509 *X509_find_by_subject(STACK_OF(X509) *sk, X509_NAME *name); + + //DECLARE_ASN1_FUNCTIONS(PBEPARAM) + //DECLARE_ASN1_FUNCTIONS(PBE2PARAM) + //DECLARE_ASN1_FUNCTIONS(PBKDF2PARAM) + //#ifndef OPENSSL_NO_SCRYPT + //DECLARE_ASN1_FUNCTIONS(SCRYPT_PARAMS) + //#endif + + function PKCS5_pbe_set0_algor(algor: PX509_ALGOR; alg: TIdC_INT; iter: TIdC_INT; const salt: PByte; saltlen: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + + function PKCS5_pbe_set(alg: TIdC_INT; iter: TIdC_INT; const salt: PByte; saltlen: TIdC_INT): PX509_ALGOR cdecl; external CLibCrypto; + function PKCS5_pbe2_set(const cipher: PEVP_CIPHER; iter: TIdC_INT; salt: PByte; saltlen: TIdC_INT): PX509_ALGOR cdecl; external CLibCrypto; + function PKCS5_pbe2_set_iv(const cipher: PEVP_CIPHER; iter: TIdC_INT; salt: PByte; saltlen: TIdC_INT; aiv: PByte; prf_nid: TIdC_INT): PX509_ALGOR cdecl; external CLibCrypto; + + function PKCS5_pbe2_set_scrypt(const cipher: PEVP_CIPHER; const salt: PByte; saltlen: TIdC_INT; aiv: PByte; N: TIdC_UINT64; r: TIdC_UINT64; p: TIdC_UINT64): PX509_ALGOR cdecl; external CLibCrypto; {introduced 1.1.0} + + function PKCS5_pbkdf2_set(iter: TIdC_INT; salt: PByte; saltlen: TIdC_INT; prf_nid: TIdC_INT; keylen: TIdC_INT): PX509_ALGOR cdecl; external CLibCrypto; + + (* PKCS#8 utilities *) + + //DECLARE_ASN1_FUNCTIONS(PKCS8_PRIV_KEY_INFO) + + function EVP_PKCS82PKEY(const p8: PPKCS8_PRIV_KEY_INFO): PEVP_PKEY cdecl; external CLibCrypto; + function EVP_PKEY2PKCS8(pkey: PEVP_PKEY): PKCS8_PRIV_KEY_INFO cdecl; external CLibCrypto; + + function PKCS8_pkey_set0(priv: PPKCS8_PRIV_KEY_INFO; aobj: PASN1_OBJECT; version: TIdC_INT; ptype: TIdC_INT; pval: Pointer; penc: PByte; penclen: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function PKCS8_pkey_get0(const ppkalg: PPASN1_OBJECT; const pk: PPByte; ppklen: PIdC_INT; const pa: PPX509_ALGOR; const p8: PPKCS8_PRIV_KEY_INFO): TIdC_INT cdecl; external CLibCrypto; + + //const STACK_OF(X509_ATTRIBUTE) * + //PKCS8_pkey_get0_attrs(const PKCS8_PRIV_KEY_INFO *p8); + function PKCS8_pkey_add1_attr_by_NID(p8: PPKCS8_PRIV_KEY_INFO; nid: TIdC_INT; type_: TIdC_INT; const bytes: PByte; len: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + + function X509_PUBKEY_set0_param(pub: PX509_PUBKEY; aobj: PASN1_OBJECT; ptype: TIdC_INT; pval: Pointer; penc: PByte; penclen: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function X509_PUBKEY_get0_param(ppkalg: PPASN1_OBJECT; const pk: PPByte; ppklen: PIdC_INT; pa: PPX509_ALGOR; pub: PX509_PUBKEY): TIdC_INT cdecl; external CLibCrypto; + + function X509_check_trust(x: PX509; id: TIdC_INT; flags: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function X509_TRUST_get_count: TIdC_INT cdecl; external CLibCrypto; + function X509_TRUST_get0(idx: TIdC_INT): PX509_TRUST cdecl; external CLibCrypto; + function X509_TRUST_get_by_id(id: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; +// TIdC_INT X509_TRUST_add(TIdC_INT id, TIdC_INT flags, TIdC_INT (*ck) (X509_TRUST *, X509 *, TIdC_INT), +// const PIdAnsiChar *name, TIdC_INT arg1, void *arg2); + procedure X509_TRUST_cleanup cdecl; external CLibCrypto; + function X509_TRUST_get_flags(const xp: PX509_TRUST): TIdC_INT cdecl; external CLibCrypto; + function X509_TRUST_get0_name(const xp: PX509_TRUST): PIdAnsiChar cdecl; external CLibCrypto; + function X509_TRUST_get_trust(const xp: PX509_TRUST): TIdC_INT cdecl; external CLibCrypto; + +// unsigned long X509_NAME_hash_ex(const X509_NAME *x, OSSL_LIB_CTX *libctx, +// const char *propq, int *ok); + function X509_NAME_hash_ex(const x: PX509_NAME; libctx: POSSL_LIB_CTX; const propq: PIdAnsiChar; ok: PIdC_INT): TIdC_ULONG cdecl; external CLibCrypto; {introduced 3.0.0} + + + function X509_NAME_hash(x: PX509_NAME): TIdC_ULONG; {removed 3.0.0} +{$ENDIF} + +implementation + + uses + classes, + IdSSLOpenSSLExceptionHandlers, + IdResourceStringsOpenSSL + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + ,IdSSLOpenSSLLoader + {$ENDIF}; + +const + X509_PUBKEY_get0_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_get_pathlen_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_SIG_get0_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_SIG_getm_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_SIG_INFO_get_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_SIG_INFO_set_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_get_signature_info_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_get0_signature_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_trusted_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_get_version_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_get0_serialNumber_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_get0_notBefore_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_getm_notBefore_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_set1_notBefore_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_get0_notAfter_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_getm_notAfter_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_set1_notAfter_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_up_ref_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_get_signature_type_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_get_X509_PUBKEY_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_get0_uids_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_get0_tbs_sigalg_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_get0_pubkey_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_REQ_get_version_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_REQ_get_subject_name_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_REQ_get0_signature_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_REQ_get_signature_nid_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + i2d_re_X509_REQ_tbs_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_REQ_get0_pubkey_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_REQ_get_X509_PUBKEY_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_CRL_set1_lastUpdate_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_CRL_set1_nextUpdate_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_CRL_up_ref_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_CRL_get_version_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_CRL_get0_lastUpdate_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_CRL_get0_nextUpdate_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_CRL_get_issuer_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_CRL_get0_signature_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_CRL_get_signature_nid_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + i2d_re_X509_CRL_tbs_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_REVOKED_get0_serialNumber_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_REVOKED_get0_revocationDate_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_aux_print_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_CRL_print_ex_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_NAME_ENTRY_set_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_NAME_get0_der_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + PKCS5_pbe2_set_scrypt_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + PKCS8_pkey_add1_attr_by_NID_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_NAME_hash_ex_introduced = (byte(3) shl 8 or byte(0)) shl 8 or byte(0); + X509_http_nbio_removed = (byte(3) shl 8 or byte(0)) shl 8 or byte(0); + X509_CRL_http_nbio_removed = (byte(3) shl 8 or byte(0)) shl 8 or byte(0); + X509_NAME_hash_removed = (byte(3) shl 8 or byte(0)) shl 8 or byte(0); + + +//# define X509_NAME_hash(x) X509_NAME_hash_ex(x, NULL, NULL, NULL) +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +const + X509_CRL_set_default_method_procname = 'X509_CRL_set_default_method'; +// function X509_CRL_METHOD_new(crl_init: function(crl: X509_CRL): TIdC_INT; +// crl_free: function(crl: PX509_CRL): TIdC_INT; +// crl_lookup: function(crl: PX509_CRL; ret: PPX509_REVOKED; ser: PASN1_INTEGER; issuer: PX509_NAME): TIdC_INT; +// crl_verify: function(crl: PX509_CRL, pk: PEVP_PKEY): TIdC_INT): PX509_CRL_METHOD; + X509_CRL_METHOD_free_procname = 'X509_CRL_METHOD_free'; + + X509_CRL_set_meth_data_procname = 'X509_CRL_set_meth_data'; + X509_CRL_get_meth_data_procname = 'X509_CRL_get_meth_data'; + + X509_verify_cert_error_string_procname = 'X509_verify_cert_error_string'; + + X509_verify_procname = 'X509_verify'; + + X509_REQ_verify_procname = 'X509_REQ_verify'; + X509_CRL_verify_procname = 'X509_CRL_verify'; + NETSCAPE_SPKI_verify_procname = 'NETSCAPE_SPKI_verify'; + + NETSCAPE_SPKI_b64_decode_procname = 'NETSCAPE_SPKI_b64_decode'; + NETSCAPE_SPKI_b64_encode_procname = 'NETSCAPE_SPKI_b64_encode'; + NETSCAPE_SPKI_get_pubkey_procname = 'NETSCAPE_SPKI_get_pubkey'; + NETSCAPE_SPKI_set_pubkey_procname = 'NETSCAPE_SPKI_set_pubkey'; + + NETSCAPE_SPKI_print_procname = 'NETSCAPE_SPKI_print'; + + X509_signature_dump_procname = 'X509_signature_dump'; + X509_signature_print_procname = 'X509_signature_print'; + + X509_sign_procname = 'X509_sign'; + X509_sign_ctx_procname = 'X509_sign_ctx'; + + X509_http_nbio_procname = 'X509_http_nbio'; {removed 3.0.0} + + X509_REQ_sign_procname = 'X509_REQ_sign'; + X509_REQ_sign_ctx_procname = 'X509_REQ_sign_ctx'; + X509_CRL_sign_procname = 'X509_CRL_sign'; + X509_CRL_sign_ctx_procname = 'X509_CRL_sign_ctx'; + + X509_CRL_http_nbio_procname = 'X509_CRL_http_nbio'; {removed 3.0.0} + + NETSCAPE_SPKI_sign_procname = 'NETSCAPE_SPKI_sign'; + + X509_pubkey_digest_procname = 'X509_pubkey_digest'; + X509_digest_procname = 'X509_digest'; + X509_CRL_digest_procname = 'X509_CRL_digest'; + X509_REQ_digest_procname = 'X509_REQ_digest'; + X509_NAME_digest_procname = 'X509_NAME_digest'; + + //# ifndef OPENSSL_NO_STDIO + //X509 *d2i_X509_fp(FILE *fp, X509 **x509); + //TIdC_INT i2d_X509_fp(FILE *fp, X509 *x509); + //X509_CRL *d2i_X509_CRL_fp(FILE *fp, X509_CRL **crl); + //TIdC_INT i2d_X509_CRL_fp(FILE *fp, X509_CRL *crl); + //X509_REQ *d2i_X509_REQ_fp(FILE *fp, X509_REQ **req); + //TIdC_INT i2d_X509_REQ_fp(FILE *fp, X509_REQ *req); + //# ifndef OPENSSL_NO_RSA + //RSA *d2i_RSAPrivateKey_fp(FILE *fp, RSA **rsa); + //TIdC_INT i2d_RSAPrivateKey_fp(FILE *fp, RSA *rsa); + //RSA *d2i_RSAPublicKey_fp(FILE *fp, RSA **rsa); + //TIdC_INT i2d_RSAPublicKey_fp(FILE *fp, RSA *rsa); + //RSA *d2i_RSA_PUBKEY_fp(FILE *fp, RSA **rsa); + //TIdC_INT i2d_RSA_PUBKEY_fp(FILE *fp, RSA *rsa); + //# endif + //# ifndef OPENSSL_NO_DSA + //DSA *d2i_DSA_PUBKEY_fp(FILE *fp, DSA **dsa); + //TIdC_INT i2d_DSA_PUBKEY_fp(FILE *fp, DSA *dsa); + //DSA *d2i_DSAPrivateKey_fp(FILE *fp, DSA **dsa); + //TIdC_INT i2d_DSAPrivateKey_fp(FILE *fp, DSA *dsa); + //# endif + //# ifndef OPENSSL_NO_EC + //EC_KEY *d2i_EC_PUBKEY_fp(FILE *fp, EC_KEY **eckey); + //TIdC_INT i2d_EC_PUBKEY_fp(FILE *fp, EC_KEY *eckey); + //EC_KEY *d2i_ECPrivateKey_fp(FILE *fp, EC_KEY **eckey); + //TIdC_INT i2d_ECPrivateKey_fp(FILE *fp, EC_KEY *eckey); + //# endif + //X509_SIG *d2i_PKCS8_fp(FILE *fp, X509_SIG **p8); + //TIdC_INT i2d_PKCS8_fp(FILE *fp, X509_SIG *p8); + //PKCS8_PRIV_KEY_INFO *d2i_PKCS8_PRIV_KEY_INFO_fp(FILE *fp, + // PKCS8_PRIV_KEY_INFO **p8inf); + //TIdC_INT i2d_PKCS8_PRIV_KEY_INFO_fp(FILE *fp, PKCS8_PRIV_KEY_INFO *p8inf); + //TIdC_INT i2d_PKCS8PrivateKeyInfo_fp(FILE *fp, EVP_PKEY *key); + //TIdC_INT i2d_PrivateKey_fp(FILE *fp, EVP_PKEY *pkey); + //EVP_PKEY *d2i_PrivateKey_fp(FILE *fp, EVP_PKEY **a); + //TIdC_INT i2d_PUBKEY_fp(FILE *fp, EVP_PKEY *pkey); + //EVP_PKEY *d2i_PUBKEY_fp(FILE *fp, EVP_PKEY **a); + //# endif + + d2i_X509_bio_procname = 'd2i_X509_bio'; + i2d_X509_bio_procname = 'i2d_X509_bio'; + d2i_X509_CRL_bio_procname = 'd2i_X509_CRL_bio'; + i2d_X509_CRL_bio_procname = 'i2d_X509_CRL_bio'; + d2i_X509_REQ_bio_procname = 'd2i_X509_REQ_bio'; + i2d_X509_REQ_bio_procname = 'i2d_X509_REQ_bio'; + + d2i_RSAPrivateKey_bio_procname = 'd2i_RSAPrivateKey_bio'; + i2d_RSAPrivateKey_bio_procname = 'i2d_RSAPrivateKey_bio'; + d2i_RSAPublicKey_bio_procname = 'd2i_RSAPublicKey_bio'; + i2d_RSAPublicKey_bio_procname = 'i2d_RSAPublicKey_bio'; + d2i_RSA_PUBKEY_bio_procname = 'd2i_RSA_PUBKEY_bio'; + i2d_RSA_PUBKEY_bio_procname = 'i2d_RSA_PUBKEY_bio'; + + d2i_DSA_PUBKEY_bio_procname = 'd2i_DSA_PUBKEY_bio'; + i2d_DSA_PUBKEY_bio_procname = 'i2d_DSA_PUBKEY_bio'; + d2i_DSAPrivateKey_bio_procname = 'd2i_DSAPrivateKey_bio'; + i2d_DSAPrivateKey_bio_procname = 'i2d_DSAPrivateKey_bio'; + + d2i_EC_PUBKEY_bio_procname = 'd2i_EC_PUBKEY_bio'; + i2d_EC_PUBKEY_bio_procname = 'i2d_EC_PUBKEY_bio'; + d2i_ECPrivateKey_bio_procname = 'd2i_ECPrivateKey_bio'; + i2d_ECPrivateKey_bio_procname = 'i2d_ECPrivateKey_bio'; + + d2i_PKCS8_bio_procname = 'd2i_PKCS8_bio'; + i2d_PKCS8_bio_procname = 'i2d_PKCS8_bio'; + d2i_PKCS8_PRIV_KEY_INFO_bio_procname = 'd2i_PKCS8_PRIV_KEY_INFO_bio'; + i2d_PKCS8_PRIV_KEY_INFO_bio_procname = 'i2d_PKCS8_PRIV_KEY_INFO_bio'; + i2d_PKCS8PrivateKeyInfo_bio_procname = 'i2d_PKCS8PrivateKeyInfo_bio'; + i2d_PrivateKey_bio_procname = 'i2d_PrivateKey_bio'; + d2i_PrivateKey_bio_procname = 'd2i_PrivateKey_bio'; + i2d_PUBKEY_bio_procname = 'i2d_PUBKEY_bio'; + d2i_PUBKEY_bio_procname = 'd2i_PUBKEY_bio'; + + X509_dup_procname = 'X509_dup'; + X509_ATTRIBUTE_dup_procname = 'X509_ATTRIBUTE_dup'; + X509_EXTENSION_dup_procname = 'X509_EXTENSION_dup'; + X509_CRL_dup_procname = 'X509_CRL_dup'; + X509_REVOKED_dup_procname = 'X509_REVOKED_dup'; + X509_REQ_dup_procname = 'X509_REQ_dup'; + X509_ALGOR_dup_procname = 'X509_ALGOR_dup'; + X509_ALGOR_set0_procname = 'X509_ALGOR_set0'; + X509_ALGOR_get0_procname = 'X509_ALGOR_get0'; + X509_ALGOR_set_md_procname = 'X509_ALGOR_set_md'; + X509_ALGOR_cmp_procname = 'X509_ALGOR_cmp'; + + X509_NAME_dup_procname = 'X509_NAME_dup'; + X509_NAME_ENTRY_dup_procname = 'X509_NAME_ENTRY_dup'; + + X509_cmp_time_procname = 'X509_cmp_time'; + X509_cmp_current_time_procname = 'X509_cmp_current_time'; + X509_time_adj_procname = 'X509_time_adj'; + X509_time_adj_ex_procname = 'X509_time_adj_ex'; + X509_gmtime_adj_procname = 'X509_gmtime_adj'; + + X509_get_default_cert_area_procname = 'X509_get_default_cert_area'; + X509_get_default_cert_dir_procname = 'X509_get_default_cert_dir'; + X509_get_default_cert_file_procname = 'X509_get_default_cert_file'; + X509_get_default_cert_dir_env_procname = 'X509_get_default_cert_dir_env'; + X509_get_default_cert_file_env_procname = 'X509_get_default_cert_file_env'; + X509_get_default_private_dir_procname = 'X509_get_default_private_dir'; + + X509_to_X509_REQ_procname = 'X509_to_X509_REQ'; + X509_REQ_to_X509_procname = 'X509_REQ_to_X509'; + + X509_ALGOR_new_procname = 'X509_ALGOR_new'; + X509_ALGOR_free_procname = 'X509_ALGOR_free'; + d2i_X509_ALGOR_procname = 'd2i_X509_ALGOR'; + i2d_X509_ALGOR_procname = 'i2d_X509_ALGOR'; + //DECLARE_ASN1_ENCODE_FUNCTIONS(X509_ALGORS, X509_ALGORS, X509_ALGORS) + X509_VAL_new_procname = 'X509_VAL_new'; + X509_VAL_free_procname = 'X509_VAL_free'; + d2i_X509_VAL_procname = 'd2i_X509_VAL'; + i2d_X509_VAL_procname = 'i2d_X509_VAL'; + + X509_PUBKEY_new_procname = 'X509_PUBKEY_new'; + X509_PUBKEY_free_procname = 'X509_PUBKEY_free'; + d2i_X509_PUBKEY_procname = 'd2i_X509_PUBKEY'; + i2d_X509_PUBKEY_procname = 'i2d_X509_PUBKEY'; + + X509_PUBKEY_set_procname = 'X509_PUBKEY_set'; + X509_PUBKEY_get0_procname = 'X509_PUBKEY_get0'; {introduced 1.1.0} + X509_PUBKEY_get_procname = 'X509_PUBKEY_get'; +// function X509_get_pubkey_parameters(pkey: PEVP_PKEY; chain: P STACK_OF(X509)): TIdC_INT; + X509_get_pathlen_procname = 'X509_get_pathlen'; {introduced 1.1.0} + i2d_PUBKEY_procname = 'i2d_PUBKEY'; + d2i_PUBKEY_procname = 'd2i_PUBKEY'; + + i2d_RSA_PUBKEY_procname = 'i2d_RSA_PUBKEY'; + d2i_RSA_PUBKEY_procname = 'd2i_RSA_PUBKEY'; + + i2d_DSA_PUBKEY_procname = 'i2d_DSA_PUBKEY'; + d2i_DSA_PUBKEY_procname = 'd2i_DSA_PUBKEY'; + + i2d_EC_PUBKEY_procname = 'i2d_EC_PUBKEY'; + d2i_EC_PUBKEY_procname = 'd2i_EC_PUBKEY'; + + X509_SIG_new_procname = 'X509_SIG_new'; + X509_SIG_free_procname = 'X509_SIG_free'; + d2i_X509_SIG_procname = 'd2i_X509_SIG'; + i2d_X509_SIG_procname = 'i2d_X509_SIG'; + X509_SIG_get0_procname = 'X509_SIG_get0'; {introduced 1.1.0} + X509_SIG_getm_procname = 'X509_SIG_getm'; {introduced 1.1.0} + + X509_REQ_INFO_new_procname = 'X509_REQ_INFO_new'; + X509_REQ_INFO_free_procname = 'X509_REQ_INFO_free'; + d2i_X509_REQ_INFO_procname = 'd2i_X509_REQ_INFO'; + i2d_X509_REQ_INFO_procname = 'i2d_X509_REQ_INFO'; + + X509_REQ_new_procname = 'X509_REQ_new'; + X509_REQ_free_procname = 'X509_REQ_free'; + d2i_X509_REQ_procname = 'd2i_X509_REQ'; + i2d_X509_REQ_procname = 'i2d_X509_REQ'; + + X509_ATTRIBUTE_new_procname = 'X509_ATTRIBUTE_new'; + X509_ATTRIBUTE_free_procname = 'X509_ATTRIBUTE_free'; + d2i_X509_ATTRIBUTE_procname = 'd2i_X509_ATTRIBUTE'; + i2d_X509_ATTRIBUTE_procname = 'i2d_X509_ATTRIBUTE'; + X509_ATTRIBUTE_create_procname = 'X509_ATTRIBUTE_create'; + + X509_EXTENSION_new_procname = 'X509_EXTENSION_new'; + X509_EXTENSION_free_procname = 'X509_EXTENSION_free'; + d2i_X509_EXTENSION_procname = 'd2i_X509_EXTENSION'; + i2d_X509_EXTENSION_procname = 'i2d_X509_EXTENSION'; + //DECLARE_ASN1_ENCODE_FUNCTIONS(X509_EXTENSIONS, X509_EXTENSIONS, X509_EXTENSIONS) + + X509_NAME_ENTRY_new_procname = 'X509_NAME_ENTRY_new'; + X509_NAME_ENTRY_free_procname = 'X509_NAME_ENTRY_free'; + d2i_X509_NAME_ENTRY_procname = 'd2i_X509_NAME_ENTRY'; + i2d_X509_NAME_ENTRY_procname = 'i2d_X509_NAME_ENTRY'; + + X509_NAME_new_procname = 'X509_NAME_new'; + X509_NAME_free_procname = 'X509_NAME_free'; + d2i_X509_NAME_procname = 'd2i_X509_NAME'; + i2d_X509_NAME_procname = 'i2d_X509_NAME'; + + X509_NAME_set_procname = 'X509_NAME_set'; + + //DECLARE_ASN1_FUNCTIONS(X509_CINF) + + X509_new_procname = 'X509_new'; + X509_free_procname = 'X509_free'; + d2i_X509_procname = 'd2i_X509'; + i2d_X509_procname = 'i2d_X509'; + + //DECLARE_ASN1_FUNCTIONS(X509_CERT_AUX) + // + //#define X509_get_ex_new_index(l, p, newf, dupf, freef) \ + // CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_X509, l, p, newf, dupf, freef) + X509_set_ex_data_procname = 'X509_set_ex_data'; + X509_get_ex_data_procname = 'X509_get_ex_data'; + i2d_X509_AUX_procname = 'i2d_X509_AUX'; + d2i_X509_AUX_procname = 'd2i_X509_AUX'; + + i2d_re_X509_tbs_procname = 'i2d_re_X509_tbs'; + + X509_SIG_INFO_get_procname = 'X509_SIG_INFO_get'; {introduced 1.1.0} + X509_SIG_INFO_set_procname = 'X509_SIG_INFO_set'; {introduced 1.1.0} + + X509_get_signature_info_procname = 'X509_get_signature_info'; {introduced 1.1.0} + + X509_get0_signature_procname = 'X509_get0_signature'; {introduced 1.1.0} + X509_get_signature_nid_procname = 'X509_get_signature_nid'; + + X509_trusted_procname = 'X509_trusted'; {introduced 1.1.0} + X509_alias_set1_procname = 'X509_alias_set1'; + X509_keyid_set1_procname = 'X509_keyid_set1'; + X509_alias_get0_procname = 'X509_alias_get0'; + X509_keyid_get0_procname = 'X509_keyid_get0'; +// TIdC_INT (*X509_TRUST_set_default(TIdC_INT (*trust) (TIdC_INT, X509 *, TIdC_INT))) (TIdC_INT, X509 *, +// TIdC_INT); + X509_TRUST_set_procname = 'X509_TRUST_set'; + X509_add1_trust_object_procname = 'X509_add1_trust_object'; + X509_add1_reject_object_procname = 'X509_add1_reject_object'; + X509_trust_clear_procname = 'X509_trust_clear'; + X509_reject_clear_procname = 'X509_reject_clear'; + + //STACK_OF(ASN1_OBJECT) *X509_get0_trust_objects(X509 *x); + //STACK_OF(ASN1_OBJECT) *X509_get0_reject_objects(X509 *x); + // + X509_REVOKED_new_procname = 'X509_REVOKED_new'; + X509_REVOKED_free_procname = 'X509_REVOKED_free'; + d2i_X509_REVOKED_procname = 'd2i_X509_REVOKED'; + i2d_X509_REVOKED_procname = 'i2d_X509_REVOKED'; + X509_CRL_INFO_new_procname = 'X509_CRL_INFO_new'; + X509_CRL_INFO_free_procname = 'X509_CRL_INFO_free'; + d2i_X509_CRL_INFO_procname = 'd2i_X509_CRL_INFO'; + i2d_X509_CRL_INFO_procname = 'i2d_X509_CRL_INFO'; + X509_CRL_new_procname = 'X509_CRL_new'; + X509_CRL_free_procname = 'X509_CRL_free'; + d2i_X509_CRL_procname = 'd2i_X509_CRL'; + i2d_X509_CRL_procname = 'i2d_X509_CRL'; + + X509_CRL_add0_revoked_procname = 'X509_CRL_add0_revoked'; + X509_CRL_get0_by_serial_procname = 'X509_CRL_get0_by_serial'; + X509_CRL_get0_by_cert_procname = 'X509_CRL_get0_by_cert'; + + X509_PKEY_new_procname = 'X509_PKEY_new'; + X509_PKEY_free_procname = 'X509_PKEY_free'; + + //DECLARE_ASN1_FUNCTIONS(NETSCAPE_SPKI) + //DECLARE_ASN1_FUNCTIONS(NETSCAPE_SPKAC) + //DECLARE_ASN1_FUNCTIONS(NETSCAPE_CERT_SEQUENCE) + + X509_INFO_new_procname = 'X509_INFO_new'; + X509_INFO_free_procname = 'X509_INFO_free'; + X509_NAME_oneline_procname = 'X509_NAME_oneline'; + +// function ASN1_verify(i2d: Pi2d_of_void; algor1: PX509_ALGOR; +// signature: PASN1_BIT_STRING; data: PIdAnsiChar; pkey: PEVP_PKEY): TIdC_INT; + +// TIdC_INT ASN1_digest(i2d_of_void *i2d, const EVP_MD *type, char *data, +// unsigned char *md, unsigned TIdC_INT *len); + +// TIdC_INT ASN1_sign(i2d_of_void *i2d, X509_ALGOR *algor1, +// X509_ALGOR *algor2, ASN1_BIT_STRING *signature, +// char *data, EVP_PKEY *pkey, const EVP_MD *type); + + ASN1_item_digest_procname = 'ASN1_item_digest'; + + ASN1_item_verify_procname = 'ASN1_item_verify'; + + ASN1_item_sign_procname = 'ASN1_item_sign'; + ASN1_item_sign_ctx_procname = 'ASN1_item_sign_ctx'; + + X509_get_version_procname = 'X509_get_version'; {introduced 1.1.0} + X509_set_version_procname = 'X509_set_version'; + X509_set_serialNumber_procname = 'X509_set_serialNumber'; + X509_get_serialNumber_procname = 'X509_get_serialNumber'; + X509_get0_serialNumber_procname = 'X509_get0_serialNumber'; {introduced 1.1.0} + X509_set_issuer_name_procname = 'X509_set_issuer_name'; + X509_get_issuer_name_procname = 'X509_get_issuer_name'; + X509_set_subject_name_procname = 'X509_set_subject_name'; + X509_get_subject_name_procname = 'X509_get_subject_name'; + X509_get0_notBefore_procname = 'X509_get0_notBefore'; {introduced 1.1.0} + X509_getm_notBefore_procname = 'X509_getm_notBefore'; {introduced 1.1.0} + X509_set1_notBefore_procname = 'X509_set1_notBefore'; {introduced 1.1.0} + X509_get0_notAfter_procname = 'X509_get0_notAfter'; {introduced 1.1.0} + X509_getm_notAfter_procname = 'X509_getm_notAfter'; {introduced 1.1.0} + X509_set1_notAfter_procname = 'X509_set1_notAfter'; {introduced 1.1.0} + X509_set_pubkey_procname = 'X509_set_pubkey'; + X509_up_ref_procname = 'X509_up_ref'; {introduced 1.1.0} + X509_get_signature_type_procname = 'X509_get_signature_type'; {introduced 1.1.0} + + (* + * This one is only used so that a binary form can output, as in + * i2d_X509_PUBKEY(X509_get_X509_PUBKEY(x), &buf) + *) + X509_get_X509_PUBKEY_procname = 'X509_get_X509_PUBKEY'; {introduced 1.1.0} +// const STACK_OF(X509_EXTENSION) *X509_get0_extensions(const X509 *x); + X509_get0_uids_procname = 'X509_get0_uids'; {introduced 1.1.0} + X509_get0_tbs_sigalg_procname = 'X509_get0_tbs_sigalg'; {introduced 1.1.0} + + X509_get0_pubkey_procname = 'X509_get0_pubkey'; {introduced 1.1.0} + X509_get_pubkey_procname = 'X509_get_pubkey'; + X509_get0_pubkey_bitstr_procname = 'X509_get0_pubkey_bitstr'; + X509_certificate_type_procname = 'X509_certificate_type'; + + X509_REQ_get_version_procname = 'X509_REQ_get_version'; {introduced 1.1.0} + X509_REQ_set_version_procname = 'X509_REQ_set_version'; + X509_REQ_get_subject_name_procname = 'X509_REQ_get_subject_name'; {introduced 1.1.0} + X509_REQ_set_subject_name_procname = 'X509_REQ_set_subject_name'; + X509_REQ_get0_signature_procname = 'X509_REQ_get0_signature'; {introduced 1.1.0} + X509_REQ_get_signature_nid_procname = 'X509_REQ_get_signature_nid'; {introduced 1.1.0} + i2d_re_X509_REQ_tbs_procname = 'i2d_re_X509_REQ_tbs'; {introduced 1.1.0} + X509_REQ_set_pubkey_procname = 'X509_REQ_set_pubkey'; + X509_REQ_get_pubkey_procname = 'X509_REQ_get_pubkey'; + X509_REQ_get0_pubkey_procname = 'X509_REQ_get0_pubkey'; {introduced 1.1.0} + X509_REQ_get_X509_PUBKEY_procname = 'X509_REQ_get_X509_PUBKEY'; {introduced 1.1.0} + X509_REQ_extension_nid_procname = 'X509_REQ_extension_nid'; + X509_REQ_get_extension_nids_procname = 'X509_REQ_get_extension_nids'; + X509_REQ_set_extension_nids_procname = 'X509_REQ_set_extension_nids'; +// STACK_OF(X509_EXTENSION) *X509_REQ_get_extensions(X509_REQ *req); + //TIdC_INT X509_REQ_add_extensions_nid(X509_REQ *req, STACK_OF(X509_EXTENSION) *exts, + // TIdC_INT nid); + //TIdC_INT X509_REQ_add_extensions(X509_REQ *req, STACK_OF(X509_EXTENSION) *exts); + X509_REQ_get_attr_count_procname = 'X509_REQ_get_attr_count'; + X509_REQ_get_attr_by_NID_procname = 'X509_REQ_get_attr_by_NID'; + X509_REQ_get_attr_by_OBJ_procname = 'X509_REQ_get_attr_by_OBJ'; + X509_REQ_get_attr_procname = 'X509_REQ_get_attr'; + X509_REQ_delete_attr_procname = 'X509_REQ_delete_attr'; + X509_REQ_add1_attr_procname = 'X509_REQ_add1_attr'; + X509_REQ_add1_attr_by_OBJ_procname = 'X509_REQ_add1_attr_by_OBJ'; + X509_REQ_add1_attr_by_NID_procname = 'X509_REQ_add1_attr_by_NID'; + X509_REQ_add1_attr_by_txt_procname = 'X509_REQ_add1_attr_by_txt'; + + X509_CRL_set_version_procname = 'X509_CRL_set_version'; + X509_CRL_set_issuer_name_procname = 'X509_CRL_set_issuer_name'; + X509_CRL_set1_lastUpdate_procname = 'X509_CRL_set1_lastUpdate'; {introduced 1.1.0} + X509_CRL_set1_nextUpdate_procname = 'X509_CRL_set1_nextUpdate'; {introduced 1.1.0} + X509_CRL_sort_procname = 'X509_CRL_sort'; + X509_CRL_up_ref_procname = 'X509_CRL_up_ref'; {introduced 1.1.0} + + X509_CRL_get_version_procname = 'X509_CRL_get_version'; {introduced 1.1.0} + X509_CRL_get0_lastUpdate_procname = 'X509_CRL_get0_lastUpdate'; {introduced 1.1.0} + X509_CRL_get0_nextUpdate_procname = 'X509_CRL_get0_nextUpdate'; {introduced 1.1.0} + X509_CRL_get_issuer_procname = 'X509_CRL_get_issuer'; {introduced 1.1.0} + //const STACK_OF(X509_EXTENSION) *X509_CRL_get0_extensions(const X509_CRL *crl); + //STACK_OF(X509_REVOKED) *X509_CRL_get_REVOKED(X509_CRL *crl); + X509_CRL_get0_signature_procname = 'X509_CRL_get0_signature'; {introduced 1.1.0} + X509_CRL_get_signature_nid_procname = 'X509_CRL_get_signature_nid'; {introduced 1.1.0} + i2d_re_X509_CRL_tbs_procname = 'i2d_re_X509_CRL_tbs'; {introduced 1.1.0} + + X509_REVOKED_get0_serialNumber_procname = 'X509_REVOKED_get0_serialNumber'; {introduced 1.1.0} + X509_REVOKED_set_serialNumber_procname = 'X509_REVOKED_set_serialNumber'; + X509_REVOKED_get0_revocationDate_procname = 'X509_REVOKED_get0_revocationDate'; {introduced 1.1.0} + X509_REVOKED_set_revocationDate_procname = 'X509_REVOKED_set_revocationDate'; + //const STACK_OF(X509_EXTENSION) * + //X509_REVOKED_get0_extensions(const X509_REVOKED *r); + + X509_CRL_diff_procname = 'X509_CRL_diff'; + + X509_REQ_check_private_key_procname = 'X509_REQ_check_private_key'; + + X509_check_private_key_procname = 'X509_check_private_key'; + //TIdC_INT X509_chain_check_suiteb(TIdC_INT *perror_depth, + // X509 *x, STACK_OF(X509) *chain, + // unsigned TIdC_LONG flags); + X509_CRL_check_suiteb_procname = 'X509_CRL_check_suiteb'; + //STACK_OF(X509) *X509_chain_up_ref(STACK_OF(X509) *chain); + + X509_issuer_and_serial_cmp_procname = 'X509_issuer_and_serial_cmp'; + X509_issuer_and_serial_hash_procname = 'X509_issuer_and_serial_hash'; + + X509_issuer_name_cmp_procname = 'X509_issuer_name_cmp'; + X509_issuer_name_hash_procname = 'X509_issuer_name_hash'; + + X509_subject_name_cmp_procname = 'X509_subject_name_cmp'; + X509_subject_name_hash_procname = 'X509_subject_name_hash'; + + X509_cmp_procname = 'X509_cmp'; + X509_NAME_cmp_procname = 'X509_NAME_cmp'; + X509_NAME_hash_procname = 'X509_NAME_hash'; {removed 3.0.0} + X509_NAME_hash_old_procname = 'X509_NAME_hash_old'; + + X509_CRL_cmp_procname = 'X509_CRL_cmp'; + X509_CRL_match_procname = 'X509_CRL_match'; + X509_aux_print_procname = 'X509_aux_print'; {introduced 1.1.0} + //# ifndef OPENSSL_NO_STDIO + //TIdC_INT X509_print_ex_fp(FILE *bp, X509 *x, unsigned TIdC_LONG nmflag, + // unsigned TIdC_LONG cflag); + //TIdC_INT X509_print_fp(FILE *bp, X509 *x); + //TIdC_INT X509_CRL_print_fp(FILE *bp, X509_CRL *x); + //TIdC_INT X509_REQ_print_fp(FILE *bp, X509_REQ *req); + //TIdC_INT X509_NAME_print_ex_fp(FILE *fp, const X509_NAME *nm, TIdC_INT indent, + // unsigned TIdC_LONG flags); + //# endif + + X509_NAME_print_procname = 'X509_NAME_print'; + X509_NAME_print_ex_procname = 'X509_NAME_print_ex'; + X509_print_ex_procname = 'X509_print_ex'; + X509_print_procname = 'X509_print'; + X509_ocspid_print_procname = 'X509_ocspid_print'; + X509_CRL_print_ex_procname = 'X509_CRL_print_ex'; {introduced 1.1.0} + X509_CRL_print_procname = 'X509_CRL_print'; + X509_REQ_print_ex_procname = 'X509_REQ_print_ex'; + X509_REQ_print_procname = 'X509_REQ_print'; + + X509_NAME_entry_count_procname = 'X509_NAME_entry_count'; + X509_NAME_get_text_by_NID_procname = 'X509_NAME_get_text_by_NID'; + X509_NAME_get_text_by_OBJ_procname = 'X509_NAME_get_text_by_OBJ'; + + (* + * NOTE: you should be passing -1, not 0 as lastpos. The functions that use + * lastpos, search after that position on. + *) + X509_NAME_get_index_by_NID_procname = 'X509_NAME_get_index_by_NID'; + X509_NAME_get_index_by_OBJ_procname = 'X509_NAME_get_index_by_OBJ'; + X509_NAME_get_entry_procname = 'X509_NAME_get_entry'; + X509_NAME_delete_entry_procname = 'X509_NAME_delete_entry'; + X509_NAME_add_entry_procname = 'X509_NAME_add_entry'; + X509_NAME_add_entry_by_OBJ_procname = 'X509_NAME_add_entry_by_OBJ'; + X509_NAME_add_entry_by_NID_procname = 'X509_NAME_add_entry_by_NID'; + X509_NAME_ENTRY_create_by_txt_procname = 'X509_NAME_ENTRY_create_by_txt'; + X509_NAME_ENTRY_create_by_NID_procname = 'X509_NAME_ENTRY_create_by_NID'; + X509_NAME_add_entry_by_txt_procname = 'X509_NAME_add_entry_by_txt'; + X509_NAME_ENTRY_create_by_OBJ_procname = 'X509_NAME_ENTRY_create_by_OBJ'; + X509_NAME_ENTRY_set_object_procname = 'X509_NAME_ENTRY_set_object'; + X509_NAME_ENTRY_set_data_procname = 'X509_NAME_ENTRY_set_data'; + X509_NAME_ENTRY_get_object_procname = 'X509_NAME_ENTRY_get_object'; + X509_NAME_ENTRY_get_data_procname = 'X509_NAME_ENTRY_get_data'; + X509_NAME_ENTRY_set_procname = 'X509_NAME_ENTRY_set'; {introduced 1.1.0} + + X509_NAME_get0_der_procname = 'X509_NAME_get0_der'; {introduced 1.1.0} + + //TIdC_INT X509v3_get_ext_count(const STACK_OF(X509_EXTENSION) *x); + //TIdC_INT X509v3_get_ext_by_NID(const STACK_OF(X509_EXTENSION) *x, + // TIdC_INT nid, TIdC_INT lastpos); + //TIdC_INT X509v3_get_ext_by_OBJ(const STACK_OF(X509_EXTENSION) *x, + // const ASN1_OBJECT *obj, TIdC_INT lastpos); + //TIdC_INT X509v3_get_ext_by_critical(const STACK_OF(X509_EXTENSION) *x, + // TIdC_INT crit, TIdC_INT lastpos); + //X509_EXTENSION *X509v3_get_ext(const STACK_OF(X509_EXTENSION) *x, TIdC_INT loc); + //X509_EXTENSION *X509v3_delete_ext(STACK_OF(X509_EXTENSION) *x, TIdC_INT loc); + //STACK_OF(X509_EXTENSION) *X509v3_add_ext(STACK_OF(X509_EXTENSION) **x, + // X509_EXTENSION *ex, TIdC_INT loc); + + X509_get_ext_count_procname = 'X509_get_ext_count'; + X509_get_ext_by_NID_procname = 'X509_get_ext_by_NID'; + X509_get_ext_by_OBJ_procname = 'X509_get_ext_by_OBJ'; + X509_get_ext_by_critical_procname = 'X509_get_ext_by_critical'; + X509_get_ext_procname = 'X509_get_ext'; + X509_delete_ext_procname = 'X509_delete_ext'; + X509_add_ext_procname = 'X509_add_ext'; + X509_get_ext_d2i_procname = 'X509_get_ext_d2i'; + X509_add1_ext_i2d_procname = 'X509_add1_ext_i2d'; + + X509_CRL_get_ext_count_procname = 'X509_CRL_get_ext_count'; + X509_CRL_get_ext_by_NID_procname = 'X509_CRL_get_ext_by_NID'; + X509_CRL_get_ext_by_OBJ_procname = 'X509_CRL_get_ext_by_OBJ'; + X509_CRL_get_ext_by_critical_procname = 'X509_CRL_get_ext_by_critical'; + X509_CRL_get_ext_procname = 'X509_CRL_get_ext'; + X509_CRL_delete_ext_procname = 'X509_CRL_delete_ext'; + X509_CRL_add_ext_procname = 'X509_CRL_add_ext'; + X509_CRL_get_ext_d2i_procname = 'X509_CRL_get_ext_d2i'; + X509_CRL_add1_ext_i2d_procname = 'X509_CRL_add1_ext_i2d'; + + X509_REVOKED_get_ext_count_procname = 'X509_REVOKED_get_ext_count'; + X509_REVOKED_get_ext_by_NID_procname = 'X509_REVOKED_get_ext_by_NID'; + X509_REVOKED_get_ext_by_OBJ_procname = 'X509_REVOKED_get_ext_by_OBJ'; + X509_REVOKED_get_ext_by_critical_procname = 'X509_REVOKED_get_ext_by_critical'; + X509_REVOKED_get_ext_procname = 'X509_REVOKED_get_ext'; + X509_REVOKED_delete_ext_procname = 'X509_REVOKED_delete_ext'; + X509_REVOKED_add_ext_procname = 'X509_REVOKED_add_ext'; + X509_REVOKED_get_ext_d2i_procname = 'X509_REVOKED_get_ext_d2i'; + X509_REVOKED_add1_ext_i2d_procname = 'X509_REVOKED_add1_ext_i2d'; + + X509_EXTENSION_create_by_NID_procname = 'X509_EXTENSION_create_by_NID'; + X509_EXTENSION_create_by_OBJ_procname = 'X509_EXTENSION_create_by_OBJ'; + X509_EXTENSION_set_object_procname = 'X509_EXTENSION_set_object'; + X509_EXTENSION_set_critical_procname = 'X509_EXTENSION_set_critical'; + X509_EXTENSION_set_data_procname = 'X509_EXTENSION_set_data'; + X509_EXTENSION_get_object_procname = 'X509_EXTENSION_get_object'; + X509_EXTENSION_get_data_procname = 'X509_EXTENSION_get_data'; + X509_EXTENSION_get_critical_procname = 'X509_EXTENSION_get_critical'; + + //TIdC_INT X509at_get_attr_count(const STACK_OF(X509_ATTRIBUTE) *x); + //TIdC_INT X509at_get_attr_by_NID(const STACK_OF(X509_ATTRIBUTE) *x, TIdC_INT nid, + // TIdC_INT lastpos); + //TIdC_INT X509at_get_attr_by_OBJ(const STACK_OF(X509_ATTRIBUTE) *sk, + // const ASN1_OBJECT *obj, TIdC_INT lastpos); + //X509_ATTRIBUTE *X509at_get_attr(const STACK_OF(X509_ATTRIBUTE) *x, TIdC_INT loc); + //X509_ATTRIBUTE *X509at_delete_attr(STACK_OF(X509_ATTRIBUTE) *x, TIdC_INT loc); + //STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr(STACK_OF(X509_ATTRIBUTE) **x, + // X509_ATTRIBUTE *attr); + //STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_OBJ(STACK_OF(X509_ATTRIBUTE) + // **x, const ASN1_OBJECT *obj, + // TIdC_INT type, + // const unsigned char *bytes, + // TIdC_INT len); + //STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_NID(STACK_OF(X509_ATTRIBUTE) + // **x, TIdC_INT nid, TIdC_INT type, + // const unsigned char *bytes, + // TIdC_INT len); + //STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_txt(STACK_OF(X509_ATTRIBUTE) + // **x, const PIdAnsiChar *attrname, + // TIdC_INT type, + // const unsigned char *bytes, + // TIdC_INT len); + //void *X509at_get0_data_by_OBJ(STACK_OF(X509_ATTRIBUTE) *x, + // const ASN1_OBJECT *obj, TIdC_INT lastpos, TIdC_INT type); + X509_ATTRIBUTE_create_by_NID_procname = 'X509_ATTRIBUTE_create_by_NID'; + X509_ATTRIBUTE_create_by_OBJ_procname = 'X509_ATTRIBUTE_create_by_OBJ'; + X509_ATTRIBUTE_create_by_txt_procname = 'X509_ATTRIBUTE_create_by_txt'; + X509_ATTRIBUTE_set1_object_procname = 'X509_ATTRIBUTE_set1_object'; + X509_ATTRIBUTE_set1_data_procname = 'X509_ATTRIBUTE_set1_data'; + X509_ATTRIBUTE_get0_data_procname = 'X509_ATTRIBUTE_get0_data'; + X509_ATTRIBUTE_count_procname = 'X509_ATTRIBUTE_count'; + X509_ATTRIBUTE_get0_object_procname = 'X509_ATTRIBUTE_get0_object'; + X509_ATTRIBUTE_get0_type_procname = 'X509_ATTRIBUTE_get0_type'; + + EVP_PKEY_get_attr_count_procname = 'EVP_PKEY_get_attr_count'; + EVP_PKEY_get_attr_by_NID_procname = 'EVP_PKEY_get_attr_by_NID'; + EVP_PKEY_get_attr_by_OBJ_procname = 'EVP_PKEY_get_attr_by_OBJ'; + EVP_PKEY_get_attr_procname = 'EVP_PKEY_get_attr'; + EVP_PKEY_delete_attr_procname = 'EVP_PKEY_delete_attr'; + EVP_PKEY_add1_attr_procname = 'EVP_PKEY_add1_attr'; + EVP_PKEY_add1_attr_by_OBJ_procname = 'EVP_PKEY_add1_attr_by_OBJ'; + EVP_PKEY_add1_attr_by_NID_procname = 'EVP_PKEY_add1_attr_by_NID'; + EVP_PKEY_add1_attr_by_txt_procname = 'EVP_PKEY_add1_attr_by_txt'; + + X509_verify_cert_procname = 'X509_verify_cert'; + + (* lookup a cert from a X509 STACK *) +// function X509_find_by_issuer_and_serial(sk: P STACK_OF(X509); name: PX509_NAME; serial: PASN1_INTEGER): PX509; +// X509 *X509_find_by_subject(STACK_OF(X509) *sk, X509_NAME *name); + + //DECLARE_ASN1_FUNCTIONS(PBEPARAM) + //DECLARE_ASN1_FUNCTIONS(PBE2PARAM) + //DECLARE_ASN1_FUNCTIONS(PBKDF2PARAM) + //#ifndef OPENSSL_NO_SCRYPT + //DECLARE_ASN1_FUNCTIONS(SCRYPT_PARAMS) + //#endif + + PKCS5_pbe_set0_algor_procname = 'PKCS5_pbe_set0_algor'; + + PKCS5_pbe_set_procname = 'PKCS5_pbe_set'; + PKCS5_pbe2_set_procname = 'PKCS5_pbe2_set'; + PKCS5_pbe2_set_iv_procname = 'PKCS5_pbe2_set_iv'; + + PKCS5_pbe2_set_scrypt_procname = 'PKCS5_pbe2_set_scrypt'; {introduced 1.1.0} + + PKCS5_pbkdf2_set_procname = 'PKCS5_pbkdf2_set'; + + (* PKCS#8 utilities *) + + //DECLARE_ASN1_FUNCTIONS(PKCS8_PRIV_KEY_INFO) + + EVP_PKCS82PKEY_procname = 'EVP_PKCS82PKEY'; + EVP_PKEY2PKCS8_procname = 'EVP_PKEY2PKCS8'; + + PKCS8_pkey_set0_procname = 'PKCS8_pkey_set0'; + PKCS8_pkey_get0_procname = 'PKCS8_pkey_get0'; + + //const STACK_OF(X509_ATTRIBUTE) * + //PKCS8_pkey_get0_attrs(const PKCS8_PRIV_KEY_INFO *p8); + PKCS8_pkey_add1_attr_by_NID_procname = 'PKCS8_pkey_add1_attr_by_NID'; {introduced 1.1.0} + + X509_PUBKEY_set0_param_procname = 'X509_PUBKEY_set0_param'; + X509_PUBKEY_get0_param_procname = 'X509_PUBKEY_get0_param'; + + X509_check_trust_procname = 'X509_check_trust'; + X509_TRUST_get_count_procname = 'X509_TRUST_get_count'; + X509_TRUST_get0_procname = 'X509_TRUST_get0'; + X509_TRUST_get_by_id_procname = 'X509_TRUST_get_by_id'; +// TIdC_INT X509_TRUST_add(TIdC_INT id, TIdC_INT flags, TIdC_INT (*ck) (X509_TRUST *, X509 *, TIdC_INT), +// const PIdAnsiChar *name, TIdC_INT arg1, void *arg2); + X509_TRUST_cleanup_procname = 'X509_TRUST_cleanup'; + X509_TRUST_get_flags_procname = 'X509_TRUST_get_flags'; + X509_TRUST_get0_name_procname = 'X509_TRUST_get0_name'; + X509_TRUST_get_trust_procname = 'X509_TRUST_get_trust'; + +// unsigned long X509_NAME_hash_ex(const X509_NAME *x, OSSL_LIB_CTX *libctx, +// const char *propq, int *ok); + X509_NAME_hash_ex_procname = 'X509_NAME_hash_ex'; {introduced 3.0.0} + + + + +//# define X509_NAME_hash(x) X509_NAME_hash_ex(x, NULL, NULL, NULL) +function _X509_NAME_hash(x: PX509_NAME): TIdC_ULONG; cdecl; +begin + Result := X509_NAME_hash_ex(x,nil,nil,nil); +end; + + + + + +{forward_compatibility} + +const + ASIdentifierChoice_inherit = 0; + ASIdentifierChoice_asIdsOrRanges = 1; + SHA_DIGEST_LENGTH = 20; + +type + PSTACK= type pointer; + PSTACK_OF_X509_EXTENSION = PSTACK; + PX509_CINF = ^_X509_CINF; + _X509_CINF = record + version: PASN1_INTEGER; + serialNumber: PASN1_INTEGER; + signature: PX509_ALGOR; + issuer: PX509_NAME; + validity: PX509_VAL; + subject: PX509_NAME; + key: PX509_PUBKEY; + issuerUID: PASN1_BIT_STRING; // [ 1 ] optional in v2 + subjectUID: PASN1_BIT_STRING; // [ 2 ] optional in v2 + extensions: PSTACK_OF_X509_EXTENSION; + enc : ASN1_ENCODING; + end; + + PX509_ALGOR = ^X509_ALGOR; + X509_ALGOR = record + algorithm : PASN1_OBJECT; + parameter : PASN1_TYPE; + end; + + PSTACK_OF_ASIdOrRange = PSTACK; + + PSTACK_OF_DIST_POINT = PSTACK; + PSTACK_OF_GENERAL_NAME = PSTACK; + PSTACK_OF_IPAddressFamily = PSTACK; + PASIdOrRanges = PSTACK_OF_ASIdOrRange; + + ASIdentifierChoice_union = record + case byte of + ASIdentifierChoice_inherit : (inherit : PASN1_NULL); + ASIdentifierChoice_asIdsOrRanges : (asIdsOrRanges : PASIdOrRanges); + end; + + PASIdentifierChoice = ^ASIdentifierChoice; + ASIdentifierChoice = record + _type : TIdC_INT; + u : ASIdentifierChoice_union; + end; + + PASIdentifiers = ^ASIdentifiers; + ASIdentifiers = record + asnum : PASIdentifierChoice; + rdi : PASIdentifierChoice; + end; + + PX509_CERT_AUX = pointer; + + _PX509 = ^X509; + +X509 = record + cert_info: PX509_CINF; + sig_alg : PX509_ALGOR; + signature : PASN1_BIT_STRING; + valid : TIdC_INT; + references : TIdC_INT; + name : PIdAnsiChar; + ex_data : CRYPTO_EX_DATA; + // These contain copies of various extension values + ex_pathlen : TIdC_LONG; + ex_pcpathlen : TIdC_LONG; + ex_flags : TIdC_ULONG; + ex_kusage : TIdC_ULONG; + ex_xkusage : TIdC_ULONG; + ex_nscert : TIdC_ULONG; + skid : PASN1_OCTET_STRING; + akid : PAUTHORITY_KEYID; + policy_cache : PX509_POLICY_CACHE; + crldp : PSTACK_OF_DIST_POINT; + altname : PSTACK_OF_GENERAL_NAME; + nc : PNAME_CONSTRAINTS; + {$IFNDEF OPENSSL_NO_RFC3779} + rfc3779_addr : PSTACK_OF_IPAddressFamily; + rfc3779_asid : PASIdentifiers; + {$ENDIF} + {$IFNDEF OPENSSL_NO_SHA} + sha1_hash : array [0..SHA_DIGEST_LENGTH-1] of TIdAnsiChar; + {$ENDIF} + aux : PX509_CERT_AUX; + end; + +procedure FC_X509_get0_signature(var sig: PASN1_BIT_STRING; var alg: PX509_ALGOR; const x: PX509); cdecl; +begin + sig := _PX509(x)^.signature; + alg := _PX509(x)^.sig_alg; +end; + +function FC_X509_get0_notBefore(const x: PX509): PASN1_TIME; cdecl; +begin + Result := _PX509(x)^.cert_info.validity.notBefore; +end; + +function FC_X509_get0_notAfter(const x: PX509): PASN1_TIME; cdecl; +begin + Result := _PX509(x)^.cert_info.validity.notAfter; +end; + +function FC_X509_get_signature_type(const x: PX509): TIdC_INT; cdecl; +begin + Result := EVP_PKEY_type(OBJ_obj2nid(_PX509(x)^.sig_alg^.algorithm)); +end; + +{/forward_compatibility} +{$WARN NO_RETVAL OFF} +procedure ERR_X509_CRL_set_default_method(const meth: PX509_CRL_METHOD); +begin + EIdAPIFunctionNotPresent.RaiseException(X509_CRL_set_default_method_procname); +end; + + +// function X509_CRL_METHOD_new(crl_init: function(crl: X509_CRL): TIdC_INT; +// crl_free: function(crl: PX509_CRL): TIdC_INT; +// crl_lookup: function(crl: PX509_CRL; ret: PPX509_REVOKED; ser: PASN1_INTEGER; issuer: PX509_NAME): TIdC_INT; +// crl_verify: function(crl: PX509_CRL, pk: PEVP_PKEY): TIdC_INT): PX509_CRL_METHOD; +procedure ERR_X509_CRL_METHOD_free(m: PX509_CRL_METHOD); +begin + EIdAPIFunctionNotPresent.RaiseException(X509_CRL_METHOD_free_procname); +end; + + + +procedure ERR_X509_CRL_set_meth_data(crl: PX509_CRL; dat: Pointer); +begin + EIdAPIFunctionNotPresent.RaiseException(X509_CRL_set_meth_data_procname); +end; + + +function ERR_X509_CRL_get_meth_data(crl: PX509_CRL): Pointer; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_CRL_get_meth_data_procname); +end; + + + +function ERR_X509_verify_cert_error_string(n: TIdC_LONG): PIdAnsiChar; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_verify_cert_error_string_procname); +end; + + + +function ERR_X509_verify(a: PX509; r: PEVP_PKEY): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_verify_procname); +end; + + + +function ERR_X509_REQ_verify(a: PX509_REQ; r: PEVP_PKEY): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_REQ_verify_procname); +end; + + +function ERR_X509_CRL_verify(a: PX509_CRL; r: PEVP_PKEY): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_CRL_verify_procname); +end; + + +function ERR_NETSCAPE_SPKI_verify(a: PNETSCAPE_SPKI; r: PEVP_PKEY): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(NETSCAPE_SPKI_verify_procname); +end; + + + +function ERR_NETSCAPE_SPKI_b64_decode(const str: PIdAnsiChar; len: TIdC_INT): PNETSCAPE_SPKI; +begin + EIdAPIFunctionNotPresent.RaiseException(NETSCAPE_SPKI_b64_decode_procname); +end; + + +function ERR_NETSCAPE_SPKI_b64_encode(x: PNETSCAPE_SPKI): PIdAnsiChar; +begin + EIdAPIFunctionNotPresent.RaiseException(NETSCAPE_SPKI_b64_encode_procname); +end; + + +function ERR_NETSCAPE_SPKI_get_pubkey(x: PNETSCAPE_SPKI): PEVP_PKEY; +begin + EIdAPIFunctionNotPresent.RaiseException(NETSCAPE_SPKI_get_pubkey_procname); +end; + + +function ERR_NETSCAPE_SPKI_set_pubkey(x: PNETSCAPE_SPKI; pkey: PEVP_PKEY): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(NETSCAPE_SPKI_set_pubkey_procname); +end; + + + +function ERR_NETSCAPE_SPKI_print(out_: PBIO; spki: PNETSCAPE_SPKI): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(NETSCAPE_SPKI_print_procname); +end; + + + +function ERR_X509_signature_dump(bp: PBIO; const sig: PASN1_STRING; indent: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_signature_dump_procname); +end; + + +function ERR_X509_signature_print(bp: PBIO; const alg: PX509_ALGOR; const sig: PASN1_STRING): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_signature_print_procname); +end; + + + +function ERR_X509_sign(x: PX509; pkey: PEVP_PKEY; const md: PEVP_MD): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_sign_procname); +end; + + +function ERR_X509_sign_ctx(x: PX509; ctx: PEVP_MD_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_sign_ctx_procname); +end; + + + +function ERR_X509_http_nbio(rctx: POCSP_REQ_CTX; pcert: PPX509): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_http_nbio_procname); +end; + + + +function ERR_X509_REQ_sign(x: PX509_REQ; pkey: PEVP_PKEY; const md: PEVP_MD): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_REQ_sign_procname); +end; + + +function ERR_X509_REQ_sign_ctx(x: PX509_REQ; ctx: PEVP_MD_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_REQ_sign_ctx_procname); +end; + + +function ERR_X509_CRL_sign(x: PX509_CRL; pkey: PEVP_PKEY; const md: PEVP_MD): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_CRL_sign_procname); +end; + + +function ERR_X509_CRL_sign_ctx(x: PX509_CRL; ctx: PEVP_MD_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_CRL_sign_ctx_procname); +end; + + + +function ERR_X509_CRL_http_nbio(rctx: POCSP_REQ_CTX; pcrl: PPX509_CRL): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_CRL_http_nbio_procname); +end; + + + +function ERR_NETSCAPE_SPKI_sign(x: PNETSCAPE_SPKI; pkey: PEVP_PKEY; const md: PEVP_MD): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(NETSCAPE_SPKI_sign_procname); +end; + + + +function ERR_X509_pubkey_digest(const data: PX509; const type_: PEVP_MD; md: PByte; len: PIdC_UINT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_pubkey_digest_procname); +end; + + +function ERR_X509_digest(const data: PX509; const type_: PEVP_MD; md: PByte; var len: TIdC_UINT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_digest_procname); +end; + + +function ERR_X509_CRL_digest(const data: PX509_CRL; const type_: PEVP_MD; md: PByte; var len: TIdC_UINT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_CRL_digest_procname); +end; + + +function ERR_X509_REQ_digest(const data: PX509_REQ; const type_: PEVP_MD; md: PByte; var len: TIdC_UINT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_REQ_digest_procname); +end; + + +function ERR_X509_NAME_digest(const data: PX509_NAME; const type_: PEVP_MD; md: PByte; var len: TIdC_UINT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_NAME_digest_procname); +end; + + + + //# ifndef OPENSSL_NO_STDIO + //X509 *d2i_X509_fp(FILE *fp, X509 **x509); + //TIdC_INT i2d_X509_fp(FILE *fp, X509 *x509); + //X509_CRL *d2i_X509_CRL_fp(FILE *fp, X509_CRL **crl); + //TIdC_INT i2d_X509_CRL_fp(FILE *fp, X509_CRL *crl); + //X509_REQ *d2i_X509_REQ_fp(FILE *fp, X509_REQ **req); + //TIdC_INT i2d_X509_REQ_fp(FILE *fp, X509_REQ *req); + //# ifndef OPENSSL_NO_RSA + //RSA *d2i_RSAPrivateKey_fp(FILE *fp, RSA **rsa); + //TIdC_INT i2d_RSAPrivateKey_fp(FILE *fp, RSA *rsa); + //RSA *d2i_RSAPublicKey_fp(FILE *fp, RSA **rsa); + //TIdC_INT i2d_RSAPublicKey_fp(FILE *fp, RSA *rsa); + //RSA *d2i_RSA_PUBKEY_fp(FILE *fp, RSA **rsa); + //TIdC_INT i2d_RSA_PUBKEY_fp(FILE *fp, RSA *rsa); + //# endif + //# ifndef OPENSSL_NO_DSA + //DSA *d2i_DSA_PUBKEY_fp(FILE *fp, DSA **dsa); + //TIdC_INT i2d_DSA_PUBKEY_fp(FILE *fp, DSA *dsa); + //DSA *d2i_DSAPrivateKey_fp(FILE *fp, DSA **dsa); + //TIdC_INT i2d_DSAPrivateKey_fp(FILE *fp, DSA *dsa); + //# endif + //# ifndef OPENSSL_NO_EC + //EC_KEY *d2i_EC_PUBKEY_fp(FILE *fp, EC_KEY **eckey); + //TIdC_INT i2d_EC_PUBKEY_fp(FILE *fp, EC_KEY *eckey); + //EC_KEY *d2i_ECPrivateKey_fp(FILE *fp, EC_KEY **eckey); + //TIdC_INT i2d_ECPrivateKey_fp(FILE *fp, EC_KEY *eckey); + //# endif + //X509_SIG *d2i_PKCS8_fp(FILE *fp, X509_SIG **p8); + //TIdC_INT i2d_PKCS8_fp(FILE *fp, X509_SIG *p8); + //PKCS8_PRIV_KEY_INFO *d2i_PKCS8_PRIV_KEY_INFO_fp(FILE *fp, + // PKCS8_PRIV_KEY_INFO **p8inf); + //TIdC_INT i2d_PKCS8_PRIV_KEY_INFO_fp(FILE *fp, PKCS8_PRIV_KEY_INFO *p8inf); + //TIdC_INT i2d_PKCS8PrivateKeyInfo_fp(FILE *fp, EVP_PKEY *key); + //TIdC_INT i2d_PrivateKey_fp(FILE *fp, EVP_PKEY *pkey); + //EVP_PKEY *d2i_PrivateKey_fp(FILE *fp, EVP_PKEY **a); + //TIdC_INT i2d_PUBKEY_fp(FILE *fp, EVP_PKEY *pkey); + //EVP_PKEY *d2i_PUBKEY_fp(FILE *fp, EVP_PKEY **a); + //# endif + +function ERR_d2i_X509_bio(bp: PBIO; x509: PPX509): PX509; +begin + EIdAPIFunctionNotPresent.RaiseException(d2i_X509_bio_procname); +end; + + +function ERR_i2d_X509_bio(bp: PBIO; x509: PX509): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(i2d_X509_bio_procname); +end; + + +function ERR_d2i_X509_CRL_bio(bp: PBIO; crl: PPX509_CRL): PX509_CRL; +begin + EIdAPIFunctionNotPresent.RaiseException(d2i_X509_CRL_bio_procname); +end; + + +function ERR_i2d_X509_CRL_bio(bp: PBIO; crl: PX509_CRL): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(i2d_X509_CRL_bio_procname); +end; + + +function ERR_d2i_X509_REQ_bio(bp: PBIO; req: PPX509_REQ): PX509_REQ; +begin + EIdAPIFunctionNotPresent.RaiseException(d2i_X509_REQ_bio_procname); +end; + + +function ERR_i2d_X509_REQ_bio(bp: PBIO; req: PX509_REQ): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(i2d_X509_REQ_bio_procname); +end; + + + +function ERR_d2i_RSAPrivateKey_bio(bp: PBIO; rsa: PPRSA): PRSA; +begin + EIdAPIFunctionNotPresent.RaiseException(d2i_RSAPrivateKey_bio_procname); +end; + + +function ERR_i2d_RSAPrivateKey_bio(bp: PBIO; rsa: PRSA): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(i2d_RSAPrivateKey_bio_procname); +end; + + +function ERR_d2i_RSAPublicKey_bio(bp: PBIO; rsa: PPRSA): PRSA; +begin + EIdAPIFunctionNotPresent.RaiseException(d2i_RSAPublicKey_bio_procname); +end; + + +function ERR_i2d_RSAPublicKey_bio(bp: PBIO; rsa: PRSA): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(i2d_RSAPublicKey_bio_procname); +end; + + +function ERR_d2i_RSA_PUBKEY_bio(bp: PBIO; rsa: PPRSA): PRSA; +begin + EIdAPIFunctionNotPresent.RaiseException(d2i_RSA_PUBKEY_bio_procname); +end; + + +function ERR_i2d_RSA_PUBKEY_bio(bp: PBIO; rsa: PRSA): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(i2d_RSA_PUBKEY_bio_procname); +end; + + + +function ERR_d2i_DSA_PUBKEY_bio(bp: PBIO; dsa: PPDSA): DSA; +begin + EIdAPIFunctionNotPresent.RaiseException(d2i_DSA_PUBKEY_bio_procname); +end; + + +function ERR_i2d_DSA_PUBKEY_bio(bp: PBIO; dsa: PDSA): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(i2d_DSA_PUBKEY_bio_procname); +end; + + +function ERR_d2i_DSAPrivateKey_bio(bp: PBIO; dsa: PPDSA): PDSA; +begin + EIdAPIFunctionNotPresent.RaiseException(d2i_DSAPrivateKey_bio_procname); +end; + + +function ERR_i2d_DSAPrivateKey_bio(bp: PBIO; dsa: PDSA): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(i2d_DSAPrivateKey_bio_procname); +end; + + + +function ERR_d2i_EC_PUBKEY_bio(bp: PBIO; eckey: PPEC_KEY): PEC_KEY; +begin + EIdAPIFunctionNotPresent.RaiseException(d2i_EC_PUBKEY_bio_procname); +end; + + +function ERR_i2d_EC_PUBKEY_bio(bp: PBIO; eckey: PEC_KEY): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(i2d_EC_PUBKEY_bio_procname); +end; + + +function ERR_d2i_ECPrivateKey_bio(bp: PBIO; eckey: PPEC_KEY): EC_KEY; +begin + EIdAPIFunctionNotPresent.RaiseException(d2i_ECPrivateKey_bio_procname); +end; + + +function ERR_i2d_ECPrivateKey_bio(bp: PBIO; eckey: PEC_KEY): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(i2d_ECPrivateKey_bio_procname); +end; + + + +function ERR_d2i_PKCS8_bio(bp: PBIO; p8: PPX509_SIG): PX509_SIG; +begin + EIdAPIFunctionNotPresent.RaiseException(d2i_PKCS8_bio_procname); +end; + + +function ERR_i2d_PKCS8_bio(bp: PBIO; p8: PX509_SIG): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(i2d_PKCS8_bio_procname); +end; + + +function ERR_d2i_PKCS8_PRIV_KEY_INFO_bio(bp: PBIO; p8inf: PPPKCS8_PRIV_KEY_INFO): PPKCS8_PRIV_KEY_INFO; +begin + EIdAPIFunctionNotPresent.RaiseException(d2i_PKCS8_PRIV_KEY_INFO_bio_procname); +end; + + +function ERR_i2d_PKCS8_PRIV_KEY_INFO_bio(bp: PBIO; p8inf: PPKCS8_PRIV_KEY_INFO): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(i2d_PKCS8_PRIV_KEY_INFO_bio_procname); +end; + + +function ERR_i2d_PKCS8PrivateKeyInfo_bio(bp: PBIO; key: PEVP_PKEY): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(i2d_PKCS8PrivateKeyInfo_bio_procname); +end; + + +function ERR_i2d_PrivateKey_bio(bp: PBIO; pkey: PEVP_PKEY): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(i2d_PrivateKey_bio_procname); +end; + + +function ERR_d2i_PrivateKey_bio(bp: PBIO; a: PPEVP_PKEY): PEVP_PKEY; +begin + EIdAPIFunctionNotPresent.RaiseException(d2i_PrivateKey_bio_procname); +end; + + +function ERR_i2d_PUBKEY_bio(bp: PBIO; pkey: PEVP_PKEY): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(i2d_PUBKEY_bio_procname); +end; + + +function ERR_d2i_PUBKEY_bio(bp: PBIO; a: PPEVP_PKEY): PEVP_PKEY; +begin + EIdAPIFunctionNotPresent.RaiseException(d2i_PUBKEY_bio_procname); +end; + + + +function ERR_X509_dup(x509: PX509): PX509; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_dup_procname); +end; + + +function ERR_X509_ATTRIBUTE_dup(xa: PX509_ATTRIBUTE): PX509_ATTRIBUTE; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_ATTRIBUTE_dup_procname); +end; + + +function ERR_X509_EXTENSION_dup(ex: PX509_EXTENSION): PX509_EXTENSION; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_EXTENSION_dup_procname); +end; + + +function ERR_X509_CRL_dup(crl: PX509_CRL): PX509_CRL; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_CRL_dup_procname); +end; + + +function ERR_X509_REVOKED_dup(rev: PX509_REVOKED): PX509_REVOKED; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_REVOKED_dup_procname); +end; + + +function ERR_X509_REQ_dup(req: PX509_REQ): PX509_REQ; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_REQ_dup_procname); +end; + + +function ERR_X509_ALGOR_dup(xn: PX509_ALGOR): PX509_ALGOR; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_ALGOR_dup_procname); +end; + + +function ERR_X509_ALGOR_set0(alg: PX509_ALGOR; aobj: PASN1_OBJECT; ptype: TIdC_INT; pval: Pointer): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_ALGOR_set0_procname); +end; + + +procedure ERR_X509_ALGOR_get0(const paobj: PPASN1_OBJECT; pptype: PIdC_INT; const ppval: PPointer; const algor: PX509_ALGOR); +begin + EIdAPIFunctionNotPresent.RaiseException(X509_ALGOR_get0_procname); +end; + + +procedure ERR_X509_ALGOR_set_md(alg: PX509_ALGOR; const md: PEVP_MD); +begin + EIdAPIFunctionNotPresent.RaiseException(X509_ALGOR_set_md_procname); +end; + + +function ERR_X509_ALGOR_cmp(const a: PX509_ALGOR; const b: PX509_ALGOR): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_ALGOR_cmp_procname); +end; + + + +function ERR_X509_NAME_dup(xn: PX509_NAME): PX509_NAME; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_NAME_dup_procname); +end; + + +function ERR_X509_NAME_ENTRY_dup(ne: PX509_NAME_ENTRY): PX509_NAME_ENTRY; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_NAME_ENTRY_dup_procname); +end; + + + +function ERR_X509_cmp_time(const s: PASN1_TIME; t: PIdC_TIMET): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_cmp_time_procname); +end; + + +function ERR_X509_cmp_current_time(const s: PASN1_TIME): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_cmp_current_time_procname); +end; + + +function ERR_X509_time_adj(s: PASN1_TIME; adj: TIdC_LONG; t: PIdC_TIMET): PASN1_TIME; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_time_adj_procname); +end; + + +function ERR_X509_time_adj_ex(s: PASN1_TIME; offset_day: TIdC_INT; offset_sec: TIdC_LONG; t: PIdC_TIMET): PASN1_TIME; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_time_adj_ex_procname); +end; + + +function ERR_X509_gmtime_adj(s: PASN1_TIME; adj: TIdC_LONG): PASN1_TIME; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_gmtime_adj_procname); +end; + + + +function ERR_X509_get_default_cert_area: PIdAnsiChar; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_get_default_cert_area_procname); +end; + + +function ERR_X509_get_default_cert_dir: PIdAnsiChar; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_get_default_cert_dir_procname); +end; + + +function ERR_X509_get_default_cert_file: PIdAnsiChar; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_get_default_cert_file_procname); +end; + + +function ERR_X509_get_default_cert_dir_env: PIdAnsiChar; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_get_default_cert_dir_env_procname); +end; + + +function ERR_X509_get_default_cert_file_env: PIdAnsiChar; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_get_default_cert_file_env_procname); +end; + + +function ERR_X509_get_default_private_dir: PIdAnsiChar; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_get_default_private_dir_procname); +end; + + + +function ERR_X509_to_X509_REQ(x: PX509; pkey: PEVP_PKEY; const md: PEVP_MD): PX509_REQ; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_to_X509_REQ_procname); +end; + + +function ERR_X509_REQ_to_X509(r: PX509_REQ; days: TIdC_INT; pkey: PEVP_PKEY): PX509; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_REQ_to_X509_procname); +end; + + + +function ERR_X509_ALGOR_new: PX509_ALGOR; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_ALGOR_new_procname); +end; + + +procedure ERR_X509_ALGOR_free(v1: PX509_ALGOR); +begin + EIdAPIFunctionNotPresent.RaiseException(X509_ALGOR_free_procname); +end; + + +function ERR_d2i_X509_ALGOR(a: PPX509_ALGOR; const in_: PPByte; len: TIdC_LONG): PX509_ALGOR; +begin + EIdAPIFunctionNotPresent.RaiseException(d2i_X509_ALGOR_procname); +end; + + +function ERR_i2d_X509_ALGOR(a: PX509_ALGOR; out_: PPByte): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(i2d_X509_ALGOR_procname); +end; + + + //DECLARE_ASN1_ENCODE_FUNCTIONS(X509_ALGORS, X509_ALGORS, X509_ALGORS) +function ERR_X509_VAL_new: PX509_VAL; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_VAL_new_procname); +end; + + +procedure ERR_X509_VAL_free(v1: PX509_VAL); +begin + EIdAPIFunctionNotPresent.RaiseException(X509_VAL_free_procname); +end; + + +function ERR_d2i_X509_VAL(a: PPX509_VAL; const in_: PPByte; len: TIdC_LONG): PX509_VAL; +begin + EIdAPIFunctionNotPresent.RaiseException(d2i_X509_VAL_procname); +end; + + +function ERR_i2d_X509_VAL(a: PX509_VAL; out_: PPByte): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(i2d_X509_VAL_procname); +end; + + + +function ERR_X509_PUBKEY_new: PX509_PUBKEY; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_PUBKEY_new_procname); +end; + + +procedure ERR_X509_PUBKEY_free(v1: PX509_PUBKEY); +begin + EIdAPIFunctionNotPresent.RaiseException(X509_PUBKEY_free_procname); +end; + + +function ERR_d2i_X509_PUBKEY(a: PPX509_PUBKEY; const in_: PPByte; len: TIdC_LONG): PX509_PUBKEY; +begin + EIdAPIFunctionNotPresent.RaiseException(d2i_X509_PUBKEY_procname); +end; + + +function ERR_i2d_X509_PUBKEY(a: PX509_PUBKEY; out_: PPByte): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(i2d_X509_PUBKEY_procname); +end; + + + +function ERR_X509_PUBKEY_set(x: PPX509_PUBKEY; pkey: PEVP_PKEY): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_PUBKEY_set_procname); +end; + + +function ERR_X509_PUBKEY_get0(key: PX509_PUBKEY): PEVP_PKEY; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_PUBKEY_get0_procname); +end; + + {introduced 1.1.0} +function ERR_X509_PUBKEY_get(key: PX509_PUBKEY): PEVP_PKEY; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_PUBKEY_get_procname); +end; + + +// function X509_get_pubkey_parameters(pkey: PEVP_PKEY; chain: P STACK_OF(X509)): TIdC_INT; +function ERR_X509_get_pathlen(x: PX509): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_get_pathlen_procname); +end; + + {introduced 1.1.0} +function ERR_i2d_PUBKEY(a: PEVP_PKEY; pp: PPByte): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(i2d_PUBKEY_procname); +end; + + +function ERR_d2i_PUBKEY(a: PPEVP_PKEY; const pp: PPByte; length: TIdC_LONG): PEVP_PKEY; +begin + EIdAPIFunctionNotPresent.RaiseException(d2i_PUBKEY_procname); +end; + + + +function ERR_i2d_RSA_PUBKEY(a: PRSA; pp: PPByte): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(i2d_RSA_PUBKEY_procname); +end; + + +function ERR_d2i_RSA_PUBKEY(a: PPRSA; const pp: PPByte; length: TIdC_LONG): PRSA; +begin + EIdAPIFunctionNotPresent.RaiseException(d2i_RSA_PUBKEY_procname); +end; + + + +function ERR_i2d_DSA_PUBKEY(a: PDSA; pp: PPByte): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(i2d_DSA_PUBKEY_procname); +end; + + +function ERR_d2i_DSA_PUBKEY(a: PPDSA; const pp: PPByte; length: TIdC_LONG): PDSA; +begin + EIdAPIFunctionNotPresent.RaiseException(d2i_DSA_PUBKEY_procname); +end; + + + +function ERR_i2d_EC_PUBKEY(a: EC_KEY; pp: PPByte): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(i2d_EC_PUBKEY_procname); +end; + + +function ERR_d2i_EC_PUBKEY(a: PPEC_KEY; const pp: PPByte; length: TIdC_LONG): PEC_KEY; +begin + EIdAPIFunctionNotPresent.RaiseException(d2i_EC_PUBKEY_procname); +end; + + + +function ERR_X509_SIG_new: PX509_SIG; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_SIG_new_procname); +end; + + +procedure ERR_X509_SIG_free(v1: PX509_SIG); +begin + EIdAPIFunctionNotPresent.RaiseException(X509_SIG_free_procname); +end; + + +function ERR_d2i_X509_SIG(a: PPX509_SIG; const in_: PPByte; len: TIdC_LONG): PX509_SIG; +begin + EIdAPIFunctionNotPresent.RaiseException(d2i_X509_SIG_procname); +end; + + +function ERR_i2d_X509_SIG(a: PX509_SIG; out_: PPByte): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(i2d_X509_SIG_procname); +end; + + +procedure ERR_X509_SIG_get0(const sig: PX509_SIG; const palg: PPX509_ALGOR; const pdigest: PPASN1_OCTET_STRING); +begin + EIdAPIFunctionNotPresent.RaiseException(X509_SIG_get0_procname); +end; + + {introduced 1.1.0} +procedure ERR_X509_SIG_getm(sig: X509_SIG; palg: PPX509_ALGOR; pdigest: PPASN1_OCTET_STRING); +begin + EIdAPIFunctionNotPresent.RaiseException(X509_SIG_getm_procname); +end; + + {introduced 1.1.0} + +function ERR_X509_REQ_INFO_new: PX509_REQ_INFO; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_REQ_INFO_new_procname); +end; + + +procedure ERR_X509_REQ_INFO_free(v1: PX509_REQ_INFO); +begin + EIdAPIFunctionNotPresent.RaiseException(X509_REQ_INFO_free_procname); +end; + + +function ERR_d2i_X509_REQ_INFO(a: PPX509_REQ_INFO; const in_: PPByte; len: TIdC_LONG): PX509_REQ_INFO; +begin + EIdAPIFunctionNotPresent.RaiseException(d2i_X509_REQ_INFO_procname); +end; + + +function ERR_i2d_X509_REQ_INFO(a: PX509_REQ_INFO; out_: PPByte): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(i2d_X509_REQ_INFO_procname); +end; + + + +function ERR_X509_REQ_new: PX509_REQ; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_REQ_new_procname); +end; + + +procedure ERR_X509_REQ_free(v1: PX509_REQ); +begin + EIdAPIFunctionNotPresent.RaiseException(X509_REQ_free_procname); +end; + + +function ERR_d2i_X509_REQ(a: PPX509_REQ; const in_: PPByte; len: TIdC_LONG): PX509_REQ; +begin + EIdAPIFunctionNotPresent.RaiseException(d2i_X509_REQ_procname); +end; + + +function ERR_i2d_X509_REQ(a: PX509_REQ; out_: PPByte): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(i2d_X509_REQ_procname); +end; + + + +function ERR_X509_ATTRIBUTE_new: PX509_ATTRIBUTE; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_ATTRIBUTE_new_procname); +end; + + +procedure ERR_X509_ATTRIBUTE_free(v1: PX509_ATTRIBUTE); +begin + EIdAPIFunctionNotPresent.RaiseException(X509_ATTRIBUTE_free_procname); +end; + + +function ERR_d2i_X509_ATTRIBUTE(a: PPX509_ATTRIBUTE; const in_: PPByte; len: TIdC_LONG): PX509_ATTRIBUTE; +begin + EIdAPIFunctionNotPresent.RaiseException(d2i_X509_ATTRIBUTE_procname); +end; + + +function ERR_i2d_X509_ATTRIBUTE(a: PX509_ATTRIBUTE; out_: PPByte): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(i2d_X509_ATTRIBUTE_procname); +end; + + +function ERR_X509_ATTRIBUTE_create(nid: TIdC_INT; trtype: TIdC_INT; value: Pointer): PX509_ATTRIBUTE; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_ATTRIBUTE_create_procname); +end; + + + +function ERR_X509_EXTENSION_new: PX509_EXTENSION; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_EXTENSION_new_procname); +end; + + +procedure ERR_X509_EXTENSION_free(v1: PX509_EXTENSION); +begin + EIdAPIFunctionNotPresent.RaiseException(X509_EXTENSION_free_procname); +end; + + +function ERR_d2i_X509_EXTENSION(a: PPX509_EXTENSION; const in_: PPByte; len: TIdC_LONG): PX509_EXTENSION; +begin + EIdAPIFunctionNotPresent.RaiseException(d2i_X509_EXTENSION_procname); +end; + + +function ERR_i2d_X509_EXTENSION(a: PX509_EXTENSION; out_: PPByte): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(i2d_X509_EXTENSION_procname); +end; + + + //DECLARE_ASN1_ENCODE_FUNCTIONS(X509_EXTENSIONS, X509_EXTENSIONS, X509_EXTENSIONS) + +function ERR_X509_NAME_ENTRY_new: PX509_NAME_ENTRY; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_NAME_ENTRY_new_procname); +end; + + +procedure ERR_X509_NAME_ENTRY_free(v1: PX509_NAME_ENTRY); +begin + EIdAPIFunctionNotPresent.RaiseException(X509_NAME_ENTRY_free_procname); +end; + + +function ERR_d2i_X509_NAME_ENTRY(a: PPX509_NAME_ENTRY; const in_: PPByte; len: TIdC_LONG): PX509_NAME_ENTRY; +begin + EIdAPIFunctionNotPresent.RaiseException(d2i_X509_NAME_ENTRY_procname); +end; + + +function ERR_i2d_X509_NAME_ENTRY(a: PX509_NAME_ENTRY; out_: PPByte): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(i2d_X509_NAME_ENTRY_procname); +end; + + + +function ERR_X509_NAME_new: PX509_NAME; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_NAME_new_procname); +end; + + +procedure ERR_X509_NAME_free(v1: PX509_NAME); +begin + EIdAPIFunctionNotPresent.RaiseException(X509_NAME_free_procname); +end; + + +function ERR_d2i_X509_NAME(a: PPX509_NAME; const in_: PPByte; len: TIdC_LONG): PX509_NAME; +begin + EIdAPIFunctionNotPresent.RaiseException(d2i_X509_NAME_procname); +end; + + +function ERR_i2d_X509_NAME(a: PX509_NAME; out_: PPByte): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(i2d_X509_NAME_procname); +end; + + + +function ERR_X509_NAME_set(xn: PPX509_NAME; name: PX509_NAME): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_NAME_set_procname); +end; + + + + //DECLARE_ASN1_FUNCTIONS(X509_CINF) + +function ERR_X509_new: PX509; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_new_procname); +end; + + +procedure ERR_X509_free(v1: PX509); +begin + EIdAPIFunctionNotPresent.RaiseException(X509_free_procname); +end; + + +function ERR_d2i_X509(a: PPX509; const in_: PPByte; len: TIdC_LONG): PX509; +begin + EIdAPIFunctionNotPresent.RaiseException(d2i_X509_procname); +end; + + +function ERR_i2d_X509(a: PX509; out_: PPByte): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(i2d_X509_procname); +end; + + + + //DECLARE_ASN1_FUNCTIONS(X509_CERT_AUX) + // + //#define X509_get_ex_new_index(l, p, newf, dupf, freef) \ + // CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_X509, l, p, newf, dupf, freef) +function ERR_X509_set_ex_data(r: PX509; idx: TIdC_INT; arg: Pointer): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_set_ex_data_procname); +end; + + +function ERR_X509_get_ex_data(r: PX509; idx: TIdC_INT): Pointer; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_get_ex_data_procname); +end; + + +function ERR_i2d_X509_AUX(a: PX509; pp: PPByte): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(i2d_X509_AUX_procname); +end; + + +function ERR_d2i_X509_AUX(a: PPX509; const pp: PPByte; length: TIdC_LONG): PX509; +begin + EIdAPIFunctionNotPresent.RaiseException(d2i_X509_AUX_procname); +end; + + + +function ERR_i2d_re_X509_tbs(x: PX509; pp: PPByte): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(i2d_re_X509_tbs_procname); +end; + + + +function ERR_X509_SIG_INFO_get(const siginf: PX509_SIG_INFO; mdnid: PIdC_INT; pknid: PIdC_INT; secbits: PIdC_INT; flags: PIdC_UINT32): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_SIG_INFO_get_procname); +end; + + {introduced 1.1.0} +procedure ERR_X509_SIG_INFO_set(siginf: PX509_SIG_INFO; mdnid: TIdC_INT; pknid: TIdC_INT; secbits: TIdC_INT; flags: TIdC_UINT32); +begin + EIdAPIFunctionNotPresent.RaiseException(X509_SIG_INFO_set_procname); +end; + + {introduced 1.1.0} + +function ERR_X509_get_signature_info(x: PX509; mdnid: PIdC_INT; pknid: PIdC_INT; secbits: PIdC_INT; flags: PIdC_UINT32): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_get_signature_info_procname); +end; + + {introduced 1.1.0} + +procedure ERR_X509_get0_signature(var sig: PASN1_BIT_STRING; var alg: PX509_ALGOR; const x: PX509); +begin + EIdAPIFunctionNotPresent.RaiseException(X509_get0_signature_procname); +end; + + {introduced 1.1.0} +function ERR_X509_get_signature_nid(const x: PX509): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_get_signature_nid_procname); +end; + + + +function ERR_X509_trusted(const x: PX509): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_trusted_procname); +end; + + {introduced 1.1.0} +function ERR_X509_alias_set1(x: PX509; const name: PByte; len: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_alias_set1_procname); +end; + + +function ERR_X509_keyid_set1(x: PX509; const id: PByte; len: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_keyid_set1_procname); +end; + + +function ERR_X509_alias_get0(x: PX509; len: PIdC_INT): PByte; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_alias_get0_procname); +end; + + +function ERR_X509_keyid_get0(x: PX509; len: PIdC_INT): PByte; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_keyid_get0_procname); +end; + + +// TIdC_INT (*X509_TRUST_set_default(TIdC_INT (*trust) (TIdC_INT, X509 *, TIdC_INT))) (TIdC_INT, X509 *, +// TIdC_INT); +function ERR_X509_TRUST_set(t: PIdC_INT; trust: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_TRUST_set_procname); +end; + + +function ERR_X509_add1_trust_object(x: PX509; const obj: PASN1_OBJECT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_add1_trust_object_procname); +end; + + +function ERR_X509_add1_reject_object(x: PX509; const obj: PASN1_OBJECT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_add1_reject_object_procname); +end; + + +procedure ERR_X509_trust_clear(x: PX509); +begin + EIdAPIFunctionNotPresent.RaiseException(X509_trust_clear_procname); +end; + + +procedure ERR_X509_reject_clear(x: PX509); +begin + EIdAPIFunctionNotPresent.RaiseException(X509_reject_clear_procname); +end; + + + + //STACK_OF(ASN1_OBJECT) *X509_get0_trust_objects(X509 *x); + //STACK_OF(ASN1_OBJECT) *X509_get0_reject_objects(X509 *x); + // +function ERR_X509_REVOKED_new: PX509_REVOKED; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_REVOKED_new_procname); +end; + + +procedure ERR_X509_REVOKED_free(v1: PX509_REVOKED); +begin + EIdAPIFunctionNotPresent.RaiseException(X509_REVOKED_free_procname); +end; + + +function ERR_d2i_X509_REVOKED(a: PPX509_REVOKED; const in_: PPByte; len: TIdC_LONG): PX509_REVOKED; +begin + EIdAPIFunctionNotPresent.RaiseException(d2i_X509_REVOKED_procname); +end; + + +function ERR_i2d_X509_REVOKED(a: PX509_REVOKED; out_: PPByte): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(i2d_X509_REVOKED_procname); +end; + + +function ERR_X509_CRL_INFO_new: PX509_CRL_INFO; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_CRL_INFO_new_procname); +end; + + +procedure ERR_X509_CRL_INFO_free(v1: PX509_CRL_INFO); +begin + EIdAPIFunctionNotPresent.RaiseException(X509_CRL_INFO_free_procname); +end; + + +function ERR_d2i_X509_CRL_INFO(a: PPX509_CRL_INFO; const in_: PPByte; len: TIdC_LONG): PX509_CRL_INFO; +begin + EIdAPIFunctionNotPresent.RaiseException(d2i_X509_CRL_INFO_procname); +end; + + +function ERR_i2d_X509_CRL_INFO(a: PX509_CRL_INFO; out_: PPByte): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(i2d_X509_CRL_INFO_procname); +end; + + +function ERR_X509_CRL_new: PX509_CRL; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_CRL_new_procname); +end; + + +procedure ERR_X509_CRL_free(v1: PX509_CRL); +begin + EIdAPIFunctionNotPresent.RaiseException(X509_CRL_free_procname); +end; + + +function ERR_d2i_X509_CRL(a: PPX509_CRL; const in_: PPByte; len: TIdC_LONG): PX509_CRL; +begin + EIdAPIFunctionNotPresent.RaiseException(d2i_X509_CRL_procname); +end; + + +function ERR_i2d_X509_CRL(a: PX509_CRL; out_: PPByte): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(i2d_X509_CRL_procname); +end; + + + +function ERR_X509_CRL_add0_revoked(crl: PX509_CRL; rev: PX509_REVOKED): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_CRL_add0_revoked_procname); +end; + + +function ERR_X509_CRL_get0_by_serial(crl: PX509_CRL; ret: PPX509_REVOKED; serial: PASN1_INTEGER): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_CRL_get0_by_serial_procname); +end; + + +function ERR_X509_CRL_get0_by_cert(crl: PX509_CRL; ret: PPX509_REVOKED; x: PX509): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_CRL_get0_by_cert_procname); +end; + + + +function ERR_X509_PKEY_new: PX509_PKEY; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_PKEY_new_procname); +end; + + +procedure ERR_X509_PKEY_free(a: PX509_PKEY); +begin + EIdAPIFunctionNotPresent.RaiseException(X509_PKEY_free_procname); +end; + + + + //DECLARE_ASN1_FUNCTIONS(NETSCAPE_SPKI) + //DECLARE_ASN1_FUNCTIONS(NETSCAPE_SPKAC) + //DECLARE_ASN1_FUNCTIONS(NETSCAPE_CERT_SEQUENCE) + +function ERR_X509_INFO_new: PX509_INFO; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_INFO_new_procname); +end; + + +procedure ERR_X509_INFO_free(a: PX509_INFO); +begin + EIdAPIFunctionNotPresent.RaiseException(X509_INFO_free_procname); +end; + + +function ERR_X509_NAME_oneline(const a: PX509_NAME; buf: PIdAnsiChar; size: TIdC_INT): PIdAnsiChar; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_NAME_oneline_procname); +end; + + + +// function ASN1_verify(i2d: Pi2d_of_void; algor1: PX509_ALGOR; +// signature: PASN1_BIT_STRING; data: PIdAnsiChar; pkey: PEVP_PKEY): TIdC_INT; + +// TIdC_INT ASN1_digest(i2d_of_void *i2d, const EVP_MD *type, char *data, +// unsigned char *md, unsigned TIdC_INT *len); + +// TIdC_INT ASN1_sign(i2d_of_void *i2d, X509_ALGOR *algor1, +// X509_ALGOR *algor2, ASN1_BIT_STRING *signature, +// char *data, EVP_PKEY *pkey, const EVP_MD *type); + +function ERR_ASN1_item_digest(const it: PASN1_ITEM; const type_: PEVP_MD; data: Pointer; md: PByte; len: PIdC_UINT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_item_digest_procname); +end; + + + +function ERR_ASN1_item_verify(const it: PASN1_ITEM; algor1: PX509_ALGOR; signature: PASN1_BIT_STRING; data: Pointer; pkey: PEVP_PKEY): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_item_verify_procname); +end; + + + +function ERR_ASN1_item_sign(const it: PASN1_ITEM; algor1: PX509_ALGOR; algor2: PX509_ALGOR; signature: PASN1_BIT_STRING; data: Pointer; pkey: PEVP_PKEY; const type_: PEVP_MD): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_item_sign_procname); +end; + + +function ERR_ASN1_item_sign_ctx(const it: PASN1_ITEM; algor1: PX509_ALGOR; algor2: PX509_ALGOR; signature: PASN1_BIT_STRING; asn: Pointer; ctx: PEVP_MD_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ASN1_item_sign_ctx_procname); +end; + + + +function ERR_X509_get_version(const x: PX509): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_get_version_procname); +end; + + {introduced 1.1.0} +function ERR_X509_set_version(x: PX509; version: TIdC_LONG): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_set_version_procname); +end; + + +function ERR_X509_set_serialNumber(x: PX509; serial: PASN1_INTEGER): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_set_serialNumber_procname); +end; + + +function ERR_X509_get_serialNumber(x: PX509): PASN1_INTEGER; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_get_serialNumber_procname); +end; + + +function ERR_X509_get0_serialNumber(const x: PX509): PASN1_INTEGER; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_get0_serialNumber_procname); +end; + + {introduced 1.1.0} +function ERR_X509_set_issuer_name(x: PX509; name: PX509_NAME): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_set_issuer_name_procname); +end; + + +function ERR_X509_get_issuer_name(const a: PX509): PX509_NAME; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_get_issuer_name_procname); +end; + + +function ERR_X509_set_subject_name(x: PX509; name: PX509_NAME): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_set_subject_name_procname); +end; + + +function ERR_X509_get_subject_name(const a: PX509): PX509_NAME; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_get_subject_name_procname); +end; + + +function ERR_X509_get0_notBefore(const x: PX509): PASN1_TIME; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_get0_notBefore_procname); +end; + + {introduced 1.1.0} +function ERR_X509_getm_notBefore(const x: PX509): PASN1_TIME; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_getm_notBefore_procname); +end; + + {introduced 1.1.0} +function ERR_X509_set1_notBefore(x: PX509; const tm: PASN1_TIME): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_set1_notBefore_procname); +end; + + {introduced 1.1.0} +function ERR_X509_get0_notAfter(const x: PX509): PASN1_TIME; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_get0_notAfter_procname); +end; + + {introduced 1.1.0} +function ERR_X509_getm_notAfter(const x: PX509): PASN1_TIME; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_getm_notAfter_procname); +end; + + {introduced 1.1.0} +function ERR_X509_set1_notAfter(x: PX509; const tm: PASN1_TIME): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_set1_notAfter_procname); +end; + + {introduced 1.1.0} +function ERR_X509_set_pubkey(x: PX509; pkey: PEVP_PKEY): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_set_pubkey_procname); +end; + + +function ERR_X509_up_ref(x: PX509): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_up_ref_procname); +end; + + {introduced 1.1.0} +function ERR_X509_get_signature_type(const x: PX509): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_get_signature_type_procname); +end; + + {introduced 1.1.0} + + (* + * This one is only used so that a binary form can output, as in + * i2d_X509_PUBKEY(X509_get_X509_PUBKEY(x), &buf) + *) +function ERR_X509_get_X509_PUBKEY(const x: PX509): PX509_PUBKEY; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_get_X509_PUBKEY_procname); +end; + + {introduced 1.1.0} +// const STACK_OF(X509_EXTENSION) *X509_get0_extensions(const X509 *x); +procedure ERR_X509_get0_uids(const x: PX509; const piuid: PPASN1_BIT_STRING; const psuid: PPASN1_BIT_STRING); +begin + EIdAPIFunctionNotPresent.RaiseException(X509_get0_uids_procname); +end; + + {introduced 1.1.0} +function ERR_X509_get0_tbs_sigalg(const x: PX509): PX509_ALGOR; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_get0_tbs_sigalg_procname); +end; + + {introduced 1.1.0} + +function ERR_X509_get0_pubkey(const x: PX509): PEVP_PKEY; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_get0_pubkey_procname); +end; + + {introduced 1.1.0} +function ERR_X509_get_pubkey(x: PX509): PEVP_PKEY; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_get_pubkey_procname); +end; + + +function ERR_X509_get0_pubkey_bitstr(const x: PX509): PASN1_BIT_STRING; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_get0_pubkey_bitstr_procname); +end; + + +function ERR_X509_certificate_type(const x: PX509; const pubkey: PEVP_PKEY): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_certificate_type_procname); +end; + + + +function ERR_X509_REQ_get_version(const req: PX509_REQ): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_REQ_get_version_procname); +end; + + {introduced 1.1.0} +function ERR_X509_REQ_set_version(x: PX509_REQ; version: TIdC_LONG): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_REQ_set_version_procname); +end; + + +function ERR_X509_REQ_get_subject_name(const req: PX509_REQ): PX509_NAME; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_REQ_get_subject_name_procname); +end; + + {introduced 1.1.0} +function ERR_X509_REQ_set_subject_name(req: PX509_REQ; name: PX509_NAME): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_REQ_set_subject_name_procname); +end; + + +procedure ERR_X509_REQ_get0_signature(const req: PX509_REQ; const psig: PPASN1_BIT_STRING; const palg: PPX509_ALGOR); +begin + EIdAPIFunctionNotPresent.RaiseException(X509_REQ_get0_signature_procname); +end; + + {introduced 1.1.0} +function ERR_X509_REQ_get_signature_nid(const req: PX509_REQ): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_REQ_get_signature_nid_procname); +end; + + {introduced 1.1.0} +function ERR_i2d_re_X509_REQ_tbs(req: PX509_REQ; pp: PPByte): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(i2d_re_X509_REQ_tbs_procname); +end; + + {introduced 1.1.0} +function ERR_X509_REQ_set_pubkey(x: PX509_REQ; pkey: PEVP_PKEY): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_REQ_set_pubkey_procname); +end; + + +function ERR_X509_REQ_get_pubkey(req: PX509_REQ): PEVP_PKEY; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_REQ_get_pubkey_procname); +end; + + +function ERR_X509_REQ_get0_pubkey(req: PX509_REQ): PEVP_PKEY; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_REQ_get0_pubkey_procname); +end; + + {introduced 1.1.0} +function ERR_X509_REQ_get_X509_PUBKEY(req: PX509_REQ): PX509_PUBKEY; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_REQ_get_X509_PUBKEY_procname); +end; + + {introduced 1.1.0} +function ERR_X509_REQ_extension_nid(nid: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_REQ_extension_nid_procname); +end; + + +function ERR_X509_REQ_get_extension_nids: PIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_REQ_get_extension_nids_procname); +end; + + +procedure ERR_X509_REQ_set_extension_nids(nids: PIdC_INT); +begin + EIdAPIFunctionNotPresent.RaiseException(X509_REQ_set_extension_nids_procname); +end; + + +// STACK_OF(X509_EXTENSION) *X509_REQ_get_extensions(X509_REQ *req); + //TIdC_INT X509_REQ_add_extensions_nid(X509_REQ *req, STACK_OF(X509_EXTENSION) *exts, + // TIdC_INT nid); + //TIdC_INT X509_REQ_add_extensions(X509_REQ *req, STACK_OF(X509_EXTENSION) *exts); +function ERR_X509_REQ_get_attr_count(const req: PX509_REQ): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_REQ_get_attr_count_procname); +end; + + +function ERR_X509_REQ_get_attr_by_NID(const req: PX509_REQ; nid: TIdC_INT; lastpos: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_REQ_get_attr_by_NID_procname); +end; + + +function ERR_X509_REQ_get_attr_by_OBJ(const req: PX509_REQ; const obj: ASN1_OBJECT; lastpos: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_REQ_get_attr_by_OBJ_procname); +end; + + +function ERR_X509_REQ_get_attr(const req: PX509_REQ; loc: TIdC_INT): PX509_ATTRIBUTE; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_REQ_get_attr_procname); +end; + + +function ERR_X509_REQ_delete_attr(req: PX509_REQ; loc: TIdC_INT): PX509_ATTRIBUTE; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_REQ_delete_attr_procname); +end; + + +function ERR_X509_REQ_add1_attr(req: PX509_REQ; attr: PX509_ATTRIBUTE): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_REQ_add1_attr_procname); +end; + + +function ERR_X509_REQ_add1_attr_by_OBJ(req: PX509_REQ; const obj: PASN1_OBJECT; type_: TIdC_INT; const bytes: PByte; len: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_REQ_add1_attr_by_OBJ_procname); +end; + + +function ERR_X509_REQ_add1_attr_by_NID(req: PX509_REQ; nid: TIdC_INT; type_: TIdC_INT; const bytes: PByte; len: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_REQ_add1_attr_by_NID_procname); +end; + + +function ERR_X509_REQ_add1_attr_by_txt(req: PX509_REQ; const attrname: PIdAnsiChar; type_: TIdC_INT; const bytes: PByte; len: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_REQ_add1_attr_by_txt_procname); +end; + + + +function ERR_X509_CRL_set_version(x: PX509_CRL; version: TIdC_LONG): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_CRL_set_version_procname); +end; + + +function ERR_X509_CRL_set_issuer_name(x: PX509_CRL; name: PX509_NAME): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_CRL_set_issuer_name_procname); +end; + + +function ERR_X509_CRL_set1_lastUpdate(x: PX509_CRL; const tm: PASN1_TIME): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_CRL_set1_lastUpdate_procname); +end; + + {introduced 1.1.0} +function ERR_X509_CRL_set1_nextUpdate(x: PX509_CRL; const tm: PASN1_TIME): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_CRL_set1_nextUpdate_procname); +end; + + {introduced 1.1.0} +function ERR_X509_CRL_sort(crl: PX509_CRL): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_CRL_sort_procname); +end; + + +function ERR_X509_CRL_up_ref(crl: PX509_CRL): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_CRL_up_ref_procname); +end; + + {introduced 1.1.0} + +function ERR_X509_CRL_get_version(const crl: PX509_CRL): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_CRL_get_version_procname); +end; + + {introduced 1.1.0} +function ERR_X509_CRL_get0_lastUpdate(const crl: PX509_CRL): PASN1_TIME; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_CRL_get0_lastUpdate_procname); +end; + + {introduced 1.1.0} +function ERR_X509_CRL_get0_nextUpdate(const crl: PX509_CRL): PASN1_TIME; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_CRL_get0_nextUpdate_procname); +end; + + {introduced 1.1.0} +function ERR_X509_CRL_get_issuer(const crl: PX509_CRL): PX509_NAME; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_CRL_get_issuer_procname); +end; + + {introduced 1.1.0} + //const STACK_OF(X509_EXTENSION) *X509_CRL_get0_extensions(const X509_CRL *crl); + //STACK_OF(X509_REVOKED) *X509_CRL_get_REVOKED(X509_CRL *crl); +procedure ERR_X509_CRL_get0_signature(const crl: PX509_CRL; const psig: PPASN1_BIT_STRING; const palg: PPX509_ALGOR); +begin + EIdAPIFunctionNotPresent.RaiseException(X509_CRL_get0_signature_procname); +end; + + {introduced 1.1.0} +function ERR_X509_CRL_get_signature_nid(const crl: PX509_CRL): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_CRL_get_signature_nid_procname); +end; + + {introduced 1.1.0} +function ERR_i2d_re_X509_CRL_tbs(req: PX509_CRL; pp: PPByte): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(i2d_re_X509_CRL_tbs_procname); +end; + + {introduced 1.1.0} + +function ERR_X509_REVOKED_get0_serialNumber(const x: PX509_REVOKED): PASN1_INTEGER; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_REVOKED_get0_serialNumber_procname); +end; + + {introduced 1.1.0} +function ERR_X509_REVOKED_set_serialNumber(x: PX509_REVOKED; serial: PASN1_INTEGER): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_REVOKED_set_serialNumber_procname); +end; + + +function ERR_X509_REVOKED_get0_revocationDate(const x: PX509_REVOKED): PASN1_TIME; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_REVOKED_get0_revocationDate_procname); +end; + + {introduced 1.1.0} +function ERR_X509_REVOKED_set_revocationDate(r: PX509_REVOKED; tm: PASN1_TIME): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_REVOKED_set_revocationDate_procname); +end; + + + //const STACK_OF(X509_EXTENSION) * + //X509_REVOKED_get0_extensions(const X509_REVOKED *r); + +function ERR_X509_CRL_diff(base: PX509_CRL; newer: PX509_CRL; skey: PEVP_PKEY; const md: PEVP_MD; flags: TIdC_UINT): PX509_CRL; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_CRL_diff_procname); +end; + + + +function ERR_X509_REQ_check_private_key(x509: PX509_REQ; pkey: PEVP_PKEY): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_REQ_check_private_key_procname); +end; + + + +function ERR_X509_check_private_key(const x509: PX509; const pkey: PEVP_PKEY): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_check_private_key_procname); +end; + + + //TIdC_INT X509_chain_check_suiteb(TIdC_INT *perror_depth, + // X509 *x, STACK_OF(X509) *chain, + // unsigned TIdC_LONG flags); +function ERR_X509_CRL_check_suiteb(crl: PX509_CRL; pk: PEVP_PKEY; flags: TIdC_ULONG): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_CRL_check_suiteb_procname); +end; + + + //STACK_OF(X509) *X509_chain_up_ref(STACK_OF(X509) *chain); + +function ERR_X509_issuer_and_serial_cmp(const a: PX509; const b: PX509): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_issuer_and_serial_cmp_procname); +end; + + +function ERR_X509_issuer_and_serial_hash(a: PX509): TIdC_ULONG; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_issuer_and_serial_hash_procname); +end; + + + +function ERR_X509_issuer_name_cmp(const a: PX509; const b: PX509): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_issuer_name_cmp_procname); +end; + + +function ERR_X509_issuer_name_hash(a: PX509): TIdC_uLONG; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_issuer_name_hash_procname); +end; + + + +function ERR_X509_subject_name_cmp(const a: PX509; const b: PX509): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_subject_name_cmp_procname); +end; + + +function ERR_X509_subject_name_hash(x: PX509): TIdC_ULONG; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_subject_name_hash_procname); +end; + + + +function ERR_X509_cmp(const a: PX509; const b: PX509): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_cmp_procname); +end; + + +function ERR_X509_NAME_cmp(const a: PX509_NAME; const b: PX509_NAME): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_NAME_cmp_procname); +end; + + +function ERR_X509_NAME_hash(x: PX509_NAME): TIdC_ULONG; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_NAME_hash_procname); +end; + + +function ERR_X509_NAME_hash_old(x: PX509_NAME): TIdC_ULONG; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_NAME_hash_old_procname); +end; + + + +function ERR_X509_CRL_cmp(const a: PX509_CRL; const b: PX509_CRL): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_CRL_cmp_procname); +end; + + +function ERR_X509_CRL_match(const a: PX509_CRL; const b: PX509_CRL): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_CRL_match_procname); +end; + + +function ERR_X509_aux_print(out_: PBIO; x: PX509; indent: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_aux_print_procname); +end; + + {introduced 1.1.0} + //# ifndef OPENSSL_NO_STDIO + //TIdC_INT X509_print_ex_fp(FILE *bp, X509 *x, unsigned TIdC_LONG nmflag, + // unsigned TIdC_LONG cflag); + //TIdC_INT X509_print_fp(FILE *bp, X509 *x); + //TIdC_INT X509_CRL_print_fp(FILE *bp, X509_CRL *x); + //TIdC_INT X509_REQ_print_fp(FILE *bp, X509_REQ *req); + //TIdC_INT X509_NAME_print_ex_fp(FILE *fp, const X509_NAME *nm, TIdC_INT indent, + // unsigned TIdC_LONG flags); + //# endif + +function ERR_X509_NAME_print(bp: PBIO; const name: PX509_NAME; obase: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_NAME_print_procname); +end; + + +function ERR_X509_NAME_print_ex(out_: PBIO; const nm: PX509_NAME; indent: TIdC_INT; flags: TIdC_ULONG): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_NAME_print_ex_procname); +end; + + +function ERR_X509_print_ex(bp: PBIO; x: PX509; nmflag: TIdC_ULONG; cflag: TIdC_ULONG): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_print_ex_procname); +end; + + +function ERR_X509_print(bp: PBIO; x: PX509): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_print_procname); +end; + + +function ERR_X509_ocspid_print(bp: PBIO; x: PX509): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_ocspid_print_procname); +end; + + +function ERR_X509_CRL_print_ex(out_: PBIO; x: PX509_CRL; nmflag: TIdC_ULONG): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_CRL_print_ex_procname); +end; + + {introduced 1.1.0} +function ERR_X509_CRL_print(bp: PBIO; x: PX509_CRL): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_CRL_print_procname); +end; + + +function ERR_X509_REQ_print_ex(bp: PBIO; x: PX509_REQ; nmflag: TIdC_ULONG; cflag: TIdC_ULONG): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_REQ_print_ex_procname); +end; + + +function ERR_X509_REQ_print(bp: PBIO; req: PX509_REQ): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_REQ_print_procname); +end; + + + +function ERR_X509_NAME_entry_count(const name: PX509_NAME): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_NAME_entry_count_procname); +end; + + +function ERR_X509_NAME_get_text_by_NID(name: PX509_NAME; nid: TIdC_INT; buf: PIdAnsiChar; len: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_NAME_get_text_by_NID_procname); +end; + + +function ERR_X509_NAME_get_text_by_OBJ(name: PX509_NAME; const obj: PASN1_OBJECT; buf: PIdAnsiChar; len: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_NAME_get_text_by_OBJ_procname); +end; + + + + (* + * NOTE: you should be passing -1, not 0 as lastpos. The functions that use + * lastpos, search after that position on. + *) +function ERR_X509_NAME_get_index_by_NID(name: PX509_NAME; nid: TIdC_INT; lastpos: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_NAME_get_index_by_NID_procname); +end; + + +function ERR_X509_NAME_get_index_by_OBJ(name: PX509_NAME; const obj: PASN1_OBJECT; lastpos: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_NAME_get_index_by_OBJ_procname); +end; + + +function ERR_X509_NAME_get_entry(const name: PX509_NAME; loc: TIdC_INT): PX509_NAME_ENTRY; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_NAME_get_entry_procname); +end; + + +function ERR_X509_NAME_delete_entry(name: PX509_NAME; loc: TIdC_INT): pX509_NAME_ENTRY; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_NAME_delete_entry_procname); +end; + + +function ERR_X509_NAME_add_entry(name: PX509_NAME; const ne: PX509_NAME_ENTRY; loc: TIdC_INT; set_: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_NAME_add_entry_procname); +end; + + +function ERR_X509_NAME_add_entry_by_OBJ(name: PX509_NAME; const obj: PASN1_OBJECT; type_: TIdC_INT; const bytes: PByte; len: TIdC_INT; loc: TIdC_INT; set_: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_NAME_add_entry_by_OBJ_procname); +end; + + +function ERR_X509_NAME_add_entry_by_NID(name: PX509_NAME; nid: TIdC_INT; type_: TIdC_INT; const bytes: PByte; len: TIdC_INT; loc: TIdC_INT; set_: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_NAME_add_entry_by_NID_procname); +end; + + +function ERR_X509_NAME_ENTRY_create_by_txt(ne: PPX509_NAME_ENTRY; const field: PIdAnsiChar; type_: TIdC_INT; const bytes: PByte; len: TIdC_INT): PX509_NAME_ENTRY; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_NAME_ENTRY_create_by_txt_procname); +end; + + +function ERR_X509_NAME_ENTRY_create_by_NID(ne: PPX509_NAME_ENTRY; nid: TIdC_INT; type_: TIdC_INT; const bytes: PByte; len: TIdC_INT): PX509_NAME_ENTRY; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_NAME_ENTRY_create_by_NID_procname); +end; + + +function ERR_X509_NAME_add_entry_by_txt(name: PX509_NAME; const field: PIdAnsiChar; type_: TIdC_INT; const bytes: PByte; len: TIdC_INT; loc: TIdC_INT; set_: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_NAME_add_entry_by_txt_procname); +end; + + +function ERR_X509_NAME_ENTRY_create_by_OBJ(ne: PPX509_NAME_ENTRY; const obj: PASN1_OBJECT; type_: TIdC_INT; const bytes: PByte; len: TIdC_INT): PX509_NAME_ENTRY; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_NAME_ENTRY_create_by_OBJ_procname); +end; + + +function ERR_X509_NAME_ENTRY_set_object(ne: PX509_NAME_ENTRY; const obj: PASN1_OBJECT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_NAME_ENTRY_set_object_procname); +end; + + +function ERR_X509_NAME_ENTRY_set_data(ne: PX509_NAME_ENTRY; type_: TIdC_INT; const bytes: PByte; len: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_NAME_ENTRY_set_data_procname); +end; + + +function ERR_X509_NAME_ENTRY_get_object(const ne: PX509_NAME_ENTRY): PASN1_OBJECT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_NAME_ENTRY_get_object_procname); +end; + + +function ERR_X509_NAME_ENTRY_get_data(const ne: PX509_NAME_ENTRY): PASN1_STRING; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_NAME_ENTRY_get_data_procname); +end; + + +function ERR_X509_NAME_ENTRY_set(const ne: PX509_NAME_ENTRY): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_NAME_ENTRY_set_procname); +end; + + {introduced 1.1.0} + +function ERR_X509_NAME_get0_der(nm: PX509_NAME; const pder: PPByte; pderlen: PIdC_SIZET): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_NAME_get0_der_procname); +end; + + {introduced 1.1.0} + + //TIdC_INT X509v3_get_ext_count(const STACK_OF(X509_EXTENSION) *x); + //TIdC_INT X509v3_get_ext_by_NID(const STACK_OF(X509_EXTENSION) *x, + // TIdC_INT nid, TIdC_INT lastpos); + //TIdC_INT X509v3_get_ext_by_OBJ(const STACK_OF(X509_EXTENSION) *x, + // const ASN1_OBJECT *obj, TIdC_INT lastpos); + //TIdC_INT X509v3_get_ext_by_critical(const STACK_OF(X509_EXTENSION) *x, + // TIdC_INT crit, TIdC_INT lastpos); + //X509_EXTENSION *X509v3_get_ext(const STACK_OF(X509_EXTENSION) *x, TIdC_INT loc); + //X509_EXTENSION *X509v3_delete_ext(STACK_OF(X509_EXTENSION) *x, TIdC_INT loc); + //STACK_OF(X509_EXTENSION) *X509v3_add_ext(STACK_OF(X509_EXTENSION) **x, + // X509_EXTENSION *ex, TIdC_INT loc); + +function ERR_X509_get_ext_count(const x: PX509): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_get_ext_count_procname); +end; + + +function ERR_X509_get_ext_by_NID(const x: PX509; nid: TIdC_INT; lastpos: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_get_ext_by_NID_procname); +end; + + +function ERR_X509_get_ext_by_OBJ(const x: PX509; const obj: PASN1_OBJECT; lastpos: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_get_ext_by_OBJ_procname); +end; + + +function ERR_X509_get_ext_by_critical(const x: PX509; crit: TIdC_INT; lastpos: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_get_ext_by_critical_procname); +end; + + +function ERR_X509_get_ext(const x: PX509; loc: TIdC_INT): PX509_EXTENSION; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_get_ext_procname); +end; + + +function ERR_X509_delete_ext(x: PX509; loc: TIdC_INT): PX509_EXTENSION; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_delete_ext_procname); +end; + + +function ERR_X509_add_ext(x: PX509; ex: PX509_EXTENSION; loc: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_add_ext_procname); +end; + + +function ERR_X509_get_ext_d2i(const x: PX509; nid: TIdC_INT; crit: PIdC_INT; idx: PIdC_INT): Pointer; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_get_ext_d2i_procname); +end; + + +function ERR_X509_add1_ext_i2d(x: PX509; nid: TIdC_INT; value: Pointer; crit: TIdC_INT; flags: TIdC_ULONG): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_add1_ext_i2d_procname); +end; + + + +function ERR_X509_CRL_get_ext_count(const x: PX509_CRL): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_CRL_get_ext_count_procname); +end; + + +function ERR_X509_CRL_get_ext_by_NID(const x: PX509_CRL; nid: TIdC_INT; lastpos: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_CRL_get_ext_by_NID_procname); +end; + + +function ERR_X509_CRL_get_ext_by_OBJ(const x: X509_CRL; const obj: PASN1_OBJECT; lastpos: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_CRL_get_ext_by_OBJ_procname); +end; + + +function ERR_X509_CRL_get_ext_by_critical(const x: PX509_CRL; crit: TIdC_INT; lastpos: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_CRL_get_ext_by_critical_procname); +end; + + +function ERR_X509_CRL_get_ext(const x: PX509_CRL; loc: TIdC_INT): PX509_EXTENSION; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_CRL_get_ext_procname); +end; + + +function ERR_X509_CRL_delete_ext(x: PX509_CRL; loc: TIdC_INT): PX509_EXTENSION; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_CRL_delete_ext_procname); +end; + + +function ERR_X509_CRL_add_ext(x: PX509_CRL; ex: PX509_EXTENSION; loc: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_CRL_add_ext_procname); +end; + + +function ERR_X509_CRL_get_ext_d2i(const x: PX509_CRL; nid: TIdC_INT; crit: PIdC_INT; idx: PIdC_INT): Pointer; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_CRL_get_ext_d2i_procname); +end; + + +function ERR_X509_CRL_add1_ext_i2d(x: PX509_CRL; nid: TIdC_INT; value: Pointer; crit: TIdC_INT; flags: TIdC_ULONG): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_CRL_add1_ext_i2d_procname); +end; + + + +function ERR_X509_REVOKED_get_ext_count(const x: PX509_REVOKED): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_REVOKED_get_ext_count_procname); +end; + + +function ERR_X509_REVOKED_get_ext_by_NID(const x: PX509_REVOKED; nid: TIdC_INT; lastpos: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_REVOKED_get_ext_by_NID_procname); +end; + + +function ERR_X509_REVOKED_get_ext_by_OBJ(const x: PX509_REVOKED; const obj: PASN1_OBJECT; lastpos: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_REVOKED_get_ext_by_OBJ_procname); +end; + + +function ERR_X509_REVOKED_get_ext_by_critical(const x: PX509_REVOKED; crit: TIdC_INT; lastpos: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_REVOKED_get_ext_by_critical_procname); +end; + + +function ERR_X509_REVOKED_get_ext(const x: PX509_REVOKED; loc: TIdC_INT): PX509_EXTENSION; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_REVOKED_get_ext_procname); +end; + + +function ERR_X509_REVOKED_delete_ext(x: PX509_REVOKED; loc: TIdC_INT): PX509_EXTENSION; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_REVOKED_delete_ext_procname); +end; + + +function ERR_X509_REVOKED_add_ext(x: PX509_REVOKED; ex: PX509_EXTENSION; loc: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_REVOKED_add_ext_procname); +end; + + +function ERR_X509_REVOKED_get_ext_d2i(const x: PX509_REVOKED; nid: TIdC_INT; crit: PIdC_INT; idx: PIdC_INT): Pointer; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_REVOKED_get_ext_d2i_procname); +end; + + +function ERR_X509_REVOKED_add1_ext_i2d(x: PX509_REVOKED; nid: TIdC_INT; value: Pointer; crit: TIdC_INT; flags: TIdC_ULONG): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_REVOKED_add1_ext_i2d_procname); +end; + + + +function ERR_X509_EXTENSION_create_by_NID(ex: PPX509_EXTENSION; nid: TIdC_INT; crit: TIdC_INT; data: PASN1_OCTET_STRING): PX509_EXTENSION; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_EXTENSION_create_by_NID_procname); +end; + + +function ERR_X509_EXTENSION_create_by_OBJ(ex: PPX509_EXTENSION; const obj: PASN1_OBJECT; crit: TIdC_INT; data: PASN1_OCTET_STRING): PX509_EXTENSION; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_EXTENSION_create_by_OBJ_procname); +end; + + +function ERR_X509_EXTENSION_set_object(ex: PX509_EXTENSION; const obj: PASN1_OBJECT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_EXTENSION_set_object_procname); +end; + + +function ERR_X509_EXTENSION_set_critical(ex: PX509_EXTENSION; crit: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_EXTENSION_set_critical_procname); +end; + + +function ERR_X509_EXTENSION_set_data(ex: PX509_EXTENSION; data: PASN1_OCTET_STRING): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_EXTENSION_set_data_procname); +end; + + +function ERR_X509_EXTENSION_get_object(ex: PX509_EXTENSION): PASN1_OBJECT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_EXTENSION_get_object_procname); +end; + + +function ERR_X509_EXTENSION_get_data(ne: PX509_EXTENSION): PASN1_OCTET_STRING; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_EXTENSION_get_data_procname); +end; + + +function ERR_X509_EXTENSION_get_critical(const ex: PX509_EXTENSION): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_EXTENSION_get_critical_procname); +end; + + + + //TIdC_INT X509at_get_attr_count(const STACK_OF(X509_ATTRIBUTE) *x); + //TIdC_INT X509at_get_attr_by_NID(const STACK_OF(X509_ATTRIBUTE) *x, TIdC_INT nid, + // TIdC_INT lastpos); + //TIdC_INT X509at_get_attr_by_OBJ(const STACK_OF(X509_ATTRIBUTE) *sk, + // const ASN1_OBJECT *obj, TIdC_INT lastpos); + //X509_ATTRIBUTE *X509at_get_attr(const STACK_OF(X509_ATTRIBUTE) *x, TIdC_INT loc); + //X509_ATTRIBUTE *X509at_delete_attr(STACK_OF(X509_ATTRIBUTE) *x, TIdC_INT loc); + //STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr(STACK_OF(X509_ATTRIBUTE) **x, + // X509_ATTRIBUTE *attr); + //STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_OBJ(STACK_OF(X509_ATTRIBUTE) + // **x, const ASN1_OBJECT *obj, + // TIdC_INT type, + // const unsigned char *bytes, + // TIdC_INT len); + //STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_NID(STACK_OF(X509_ATTRIBUTE) + // **x, TIdC_INT nid, TIdC_INT type, + // const unsigned char *bytes, + // TIdC_INT len); + //STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_txt(STACK_OF(X509_ATTRIBUTE) + // **x, const PIdAnsiChar *attrname, + // TIdC_INT type, + // const unsigned char *bytes, + // TIdC_INT len); + //void *X509at_get0_data_by_OBJ(STACK_OF(X509_ATTRIBUTE) *x, + // const ASN1_OBJECT *obj, TIdC_INT lastpos, TIdC_INT type); +function ERR_X509_ATTRIBUTE_create_by_NID(attr: PPX509_ATTRIBUTE; nid: TIdC_INT; atrtype: TIdC_INT; const data: Pointer; len: TIdC_INT): PX509_ATTRIBUTE; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_ATTRIBUTE_create_by_NID_procname); +end; + + +function ERR_X509_ATTRIBUTE_create_by_OBJ(attr: PPX509_ATTRIBUTE; const obj: PASN1_OBJECT; atrtype: TIdC_INT; const data: Pointer; len: TIdC_INT): PX509_ATTRIBUTE; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_ATTRIBUTE_create_by_OBJ_procname); +end; + + +function ERR_X509_ATTRIBUTE_create_by_txt(attr: PPX509_ATTRIBUTE; const atrname: PIdAnsiChar; type_: TIdC_INT; const bytes: PByte; len: TIdC_INT): PX509_ATTRIBUTE; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_ATTRIBUTE_create_by_txt_procname); +end; + + +function ERR_X509_ATTRIBUTE_set1_object(attr: PX509_ATTRIBUTE; const obj: PASN1_OBJECT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_ATTRIBUTE_set1_object_procname); +end; + + +function ERR_X509_ATTRIBUTE_set1_data(attr: PX509_ATTRIBUTE; attrtype: TIdC_INT; const data: Pointer; len: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_ATTRIBUTE_set1_data_procname); +end; + + +function ERR_X509_ATTRIBUTE_get0_data(attr: PX509_ATTRIBUTE; idx: TIdC_INT; atrtype: TIdC_INT; data: Pointer): Pointer; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_ATTRIBUTE_get0_data_procname); +end; + + +function ERR_X509_ATTRIBUTE_count(const attr: PX509_ATTRIBUTE): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_ATTRIBUTE_count_procname); +end; + + +function ERR_X509_ATTRIBUTE_get0_object(attr: PX509_ATTRIBUTE): PASN1_OBJECT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_ATTRIBUTE_get0_object_procname); +end; + + +function ERR_X509_ATTRIBUTE_get0_type(attr: PX509_ATTRIBUTE; idx: TIdC_INT): PASN1_TYPE; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_ATTRIBUTE_get0_type_procname); +end; + + + +function ERR_EVP_PKEY_get_attr_count(const key: PEVP_PKEY): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_get_attr_count_procname); +end; + + +function ERR_EVP_PKEY_get_attr_by_NID(const key: PEVP_PKEY; nid: TIdC_INT; lastpos: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_get_attr_by_NID_procname); +end; + + +function ERR_EVP_PKEY_get_attr_by_OBJ(const key: PEVP_PKEY; const obj: PASN1_OBJECT; lastpos: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_get_attr_by_OBJ_procname); +end; + + +function ERR_EVP_PKEY_get_attr(const key: PEVP_PKEY; loc: TIdC_INT): PX509_ATTRIBUTE; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_get_attr_procname); +end; + + +function ERR_EVP_PKEY_delete_attr(key: PEVP_PKEY; loc: TIdC_INT): PX509_ATTRIBUTE; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_delete_attr_procname); +end; + + +function ERR_EVP_PKEY_add1_attr(key: PEVP_PKEY; attr: PX509_ATTRIBUTE): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_add1_attr_procname); +end; + + +function ERR_EVP_PKEY_add1_attr_by_OBJ(key: PEVP_PKEY; const obj: PASN1_OBJECT; type_: TIdC_INT; const bytes: PByte; len: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_add1_attr_by_OBJ_procname); +end; + + +function ERR_EVP_PKEY_add1_attr_by_NID(key: PEVP_PKEY; nid: TIdC_INT; type_: TIdC_INT; const bytes: PByte; len: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_add1_attr_by_NID_procname); +end; + + +function ERR_EVP_PKEY_add1_attr_by_txt(key: PEVP_PKEY; const attrname: PIdAnsiChar; type_: TIdC_INT; const bytes: PByte; len: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY_add1_attr_by_txt_procname); +end; + + + +function ERR_X509_verify_cert(ctx: PX509_STORE_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_verify_cert_procname); +end; + + + + (* lookup a cert from a X509 STACK *) +// function X509_find_by_issuer_and_serial(sk: P STACK_OF(X509); name: PX509_NAME; serial: PASN1_INTEGER): PX509; +// X509 *X509_find_by_subject(STACK_OF(X509) *sk, X509_NAME *name); + + //DECLARE_ASN1_FUNCTIONS(PBEPARAM) + //DECLARE_ASN1_FUNCTIONS(PBE2PARAM) + //DECLARE_ASN1_FUNCTIONS(PBKDF2PARAM) + //#ifndef OPENSSL_NO_SCRYPT + //DECLARE_ASN1_FUNCTIONS(SCRYPT_PARAMS) + //#endif + +function ERR_PKCS5_pbe_set0_algor(algor: PX509_ALGOR; alg: TIdC_INT; iter: TIdC_INT; const salt: PByte; saltlen: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS5_pbe_set0_algor_procname); +end; + + + +function ERR_PKCS5_pbe_set(alg: TIdC_INT; iter: TIdC_INT; const salt: PByte; saltlen: TIdC_INT): PX509_ALGOR; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS5_pbe_set_procname); +end; + + +function ERR_PKCS5_pbe2_set(const cipher: PEVP_CIPHER; iter: TIdC_INT; salt: PByte; saltlen: TIdC_INT): PX509_ALGOR; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS5_pbe2_set_procname); +end; + + +function ERR_PKCS5_pbe2_set_iv(const cipher: PEVP_CIPHER; iter: TIdC_INT; salt: PByte; saltlen: TIdC_INT; aiv: PByte; prf_nid: TIdC_INT): PX509_ALGOR; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS5_pbe2_set_iv_procname); +end; + + + +function ERR_PKCS5_pbe2_set_scrypt(const cipher: PEVP_CIPHER; const salt: PByte; saltlen: TIdC_INT; aiv: PByte; N: TIdC_UINT64; r: TIdC_UINT64; p: TIdC_UINT64): PX509_ALGOR; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS5_pbe2_set_scrypt_procname); +end; + + {introduced 1.1.0} + +function ERR_PKCS5_pbkdf2_set(iter: TIdC_INT; salt: PByte; saltlen: TIdC_INT; prf_nid: TIdC_INT; keylen: TIdC_INT): PX509_ALGOR; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS5_pbkdf2_set_procname); +end; + + + + (* PKCS#8 utilities *) + + //DECLARE_ASN1_FUNCTIONS(PKCS8_PRIV_KEY_INFO) + +function ERR_EVP_PKCS82PKEY(const p8: PPKCS8_PRIV_KEY_INFO): PEVP_PKEY; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKCS82PKEY_procname); +end; + + +function ERR_EVP_PKEY2PKCS8(pkey: PEVP_PKEY): PKCS8_PRIV_KEY_INFO; +begin + EIdAPIFunctionNotPresent.RaiseException(EVP_PKEY2PKCS8_procname); +end; + + + +function ERR_PKCS8_pkey_set0(priv: PPKCS8_PRIV_KEY_INFO; aobj: PASN1_OBJECT; version: TIdC_INT; ptype: TIdC_INT; pval: Pointer; penc: PByte; penclen: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS8_pkey_set0_procname); +end; + + +function ERR_PKCS8_pkey_get0(const ppkalg: PPASN1_OBJECT; const pk: PPByte; ppklen: PIdC_INT; const pa: PPX509_ALGOR; const p8: PPKCS8_PRIV_KEY_INFO): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS8_pkey_get0_procname); +end; + + + + //const STACK_OF(X509_ATTRIBUTE) * + //PKCS8_pkey_get0_attrs(const PKCS8_PRIV_KEY_INFO *p8); +function ERR_PKCS8_pkey_add1_attr_by_NID(p8: PPKCS8_PRIV_KEY_INFO; nid: TIdC_INT; type_: TIdC_INT; const bytes: PByte; len: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(PKCS8_pkey_add1_attr_by_NID_procname); +end; + + {introduced 1.1.0} + +function ERR_X509_PUBKEY_set0_param(pub: PX509_PUBKEY; aobj: PASN1_OBJECT; ptype: TIdC_INT; pval: Pointer; penc: PByte; penclen: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_PUBKEY_set0_param_procname); +end; + + +function ERR_X509_PUBKEY_get0_param(ppkalg: PPASN1_OBJECT; const pk: PPByte; ppklen: PIdC_INT; pa: PPX509_ALGOR; pub: PX509_PUBKEY): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_PUBKEY_get0_param_procname); +end; + + + +function ERR_X509_check_trust(x: PX509; id: TIdC_INT; flags: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_check_trust_procname); +end; + + +function ERR_X509_TRUST_get_count: TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_TRUST_get_count_procname); +end; + + +function ERR_X509_TRUST_get0(idx: TIdC_INT): PX509_TRUST; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_TRUST_get0_procname); +end; + + +function ERR_X509_TRUST_get_by_id(id: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_TRUST_get_by_id_procname); +end; + + +// TIdC_INT X509_TRUST_add(TIdC_INT id, TIdC_INT flags, TIdC_INT (*ck) (X509_TRUST *, X509 *, TIdC_INT), +// const PIdAnsiChar *name, TIdC_INT arg1, void *arg2); +procedure ERR_X509_TRUST_cleanup; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_TRUST_cleanup_procname); +end; + + +function ERR_X509_TRUST_get_flags(const xp: PX509_TRUST): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_TRUST_get_flags_procname); +end; + + +function ERR_X509_TRUST_get0_name(const xp: PX509_TRUST): PIdAnsiChar; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_TRUST_get0_name_procname); +end; + + +function ERR_X509_TRUST_get_trust(const xp: PX509_TRUST): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_TRUST_get_trust_procname); +end; + + + +// unsigned long X509_NAME_hash_ex(const X509_NAME *x, OSSL_LIB_CTX *libctx, +// const char *propq, int *ok); +function ERR_X509_NAME_hash_ex(const x: PX509_NAME; libctx: POSSL_LIB_CTX; const propq: PIdAnsiChar; ok: PIdC_INT): TIdC_ULONG; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_NAME_hash_ex_procname); +end; + + {introduced 3.0.0} + + +{$WARN NO_RETVAL ON} + +procedure Load(const ADllHandle: TIdLibHandle; LibVersion: TIdC_UINT; const AFailed: TStringList); + +var FuncLoadError: boolean; + +begin + X509_CRL_set_default_method := LoadLibFunction(ADllHandle, X509_CRL_set_default_method_procname); + FuncLoadError := not assigned(X509_CRL_set_default_method); + if FuncLoadError then + begin + {$if not defined(X509_CRL_set_default_method_allownil)} + X509_CRL_set_default_method := @ERR_X509_CRL_set_default_method; + {$ifend} + {$if declared(X509_CRL_set_default_method_introduced)} + if LibVersion < X509_CRL_set_default_method_introduced then + begin + {$if declared(FC_X509_CRL_set_default_method)} + X509_CRL_set_default_method := @FC_X509_CRL_set_default_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_CRL_set_default_method_removed)} + if X509_CRL_set_default_method_removed <= LibVersion then + begin + {$if declared(_X509_CRL_set_default_method)} + X509_CRL_set_default_method := @_X509_CRL_set_default_method; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_CRL_set_default_method_allownil)} + if FuncLoadError then + AFailed.Add('X509_CRL_set_default_method'); + {$ifend} + end; + + + X509_CRL_METHOD_free := LoadLibFunction(ADllHandle, X509_CRL_METHOD_free_procname); + FuncLoadError := not assigned(X509_CRL_METHOD_free); + if FuncLoadError then + begin + {$if not defined(X509_CRL_METHOD_free_allownil)} + X509_CRL_METHOD_free := @ERR_X509_CRL_METHOD_free; + {$ifend} + {$if declared(X509_CRL_METHOD_free_introduced)} + if LibVersion < X509_CRL_METHOD_free_introduced then + begin + {$if declared(FC_X509_CRL_METHOD_free)} + X509_CRL_METHOD_free := @FC_X509_CRL_METHOD_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_CRL_METHOD_free_removed)} + if X509_CRL_METHOD_free_removed <= LibVersion then + begin + {$if declared(_X509_CRL_METHOD_free)} + X509_CRL_METHOD_free := @_X509_CRL_METHOD_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_CRL_METHOD_free_allownil)} + if FuncLoadError then + AFailed.Add('X509_CRL_METHOD_free'); + {$ifend} + end; + + + X509_CRL_set_meth_data := LoadLibFunction(ADllHandle, X509_CRL_set_meth_data_procname); + FuncLoadError := not assigned(X509_CRL_set_meth_data); + if FuncLoadError then + begin + {$if not defined(X509_CRL_set_meth_data_allownil)} + X509_CRL_set_meth_data := @ERR_X509_CRL_set_meth_data; + {$ifend} + {$if declared(X509_CRL_set_meth_data_introduced)} + if LibVersion < X509_CRL_set_meth_data_introduced then + begin + {$if declared(FC_X509_CRL_set_meth_data)} + X509_CRL_set_meth_data := @FC_X509_CRL_set_meth_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_CRL_set_meth_data_removed)} + if X509_CRL_set_meth_data_removed <= LibVersion then + begin + {$if declared(_X509_CRL_set_meth_data)} + X509_CRL_set_meth_data := @_X509_CRL_set_meth_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_CRL_set_meth_data_allownil)} + if FuncLoadError then + AFailed.Add('X509_CRL_set_meth_data'); + {$ifend} + end; + + + X509_CRL_get_meth_data := LoadLibFunction(ADllHandle, X509_CRL_get_meth_data_procname); + FuncLoadError := not assigned(X509_CRL_get_meth_data); + if FuncLoadError then + begin + {$if not defined(X509_CRL_get_meth_data_allownil)} + X509_CRL_get_meth_data := @ERR_X509_CRL_get_meth_data; + {$ifend} + {$if declared(X509_CRL_get_meth_data_introduced)} + if LibVersion < X509_CRL_get_meth_data_introduced then + begin + {$if declared(FC_X509_CRL_get_meth_data)} + X509_CRL_get_meth_data := @FC_X509_CRL_get_meth_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_CRL_get_meth_data_removed)} + if X509_CRL_get_meth_data_removed <= LibVersion then + begin + {$if declared(_X509_CRL_get_meth_data)} + X509_CRL_get_meth_data := @_X509_CRL_get_meth_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_CRL_get_meth_data_allownil)} + if FuncLoadError then + AFailed.Add('X509_CRL_get_meth_data'); + {$ifend} + end; + + + X509_verify_cert_error_string := LoadLibFunction(ADllHandle, X509_verify_cert_error_string_procname); + FuncLoadError := not assigned(X509_verify_cert_error_string); + if FuncLoadError then + begin + {$if not defined(X509_verify_cert_error_string_allownil)} + X509_verify_cert_error_string := @ERR_X509_verify_cert_error_string; + {$ifend} + {$if declared(X509_verify_cert_error_string_introduced)} + if LibVersion < X509_verify_cert_error_string_introduced then + begin + {$if declared(FC_X509_verify_cert_error_string)} + X509_verify_cert_error_string := @FC_X509_verify_cert_error_string; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_verify_cert_error_string_removed)} + if X509_verify_cert_error_string_removed <= LibVersion then + begin + {$if declared(_X509_verify_cert_error_string)} + X509_verify_cert_error_string := @_X509_verify_cert_error_string; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_verify_cert_error_string_allownil)} + if FuncLoadError then + AFailed.Add('X509_verify_cert_error_string'); + {$ifend} + end; + + + X509_verify := LoadLibFunction(ADllHandle, X509_verify_procname); + FuncLoadError := not assigned(X509_verify); + if FuncLoadError then + begin + {$if not defined(X509_verify_allownil)} + X509_verify := @ERR_X509_verify; + {$ifend} + {$if declared(X509_verify_introduced)} + if LibVersion < X509_verify_introduced then + begin + {$if declared(FC_X509_verify)} + X509_verify := @FC_X509_verify; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_verify_removed)} + if X509_verify_removed <= LibVersion then + begin + {$if declared(_X509_verify)} + X509_verify := @_X509_verify; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_verify_allownil)} + if FuncLoadError then + AFailed.Add('X509_verify'); + {$ifend} + end; + + + X509_REQ_verify := LoadLibFunction(ADllHandle, X509_REQ_verify_procname); + FuncLoadError := not assigned(X509_REQ_verify); + if FuncLoadError then + begin + {$if not defined(X509_REQ_verify_allownil)} + X509_REQ_verify := @ERR_X509_REQ_verify; + {$ifend} + {$if declared(X509_REQ_verify_introduced)} + if LibVersion < X509_REQ_verify_introduced then + begin + {$if declared(FC_X509_REQ_verify)} + X509_REQ_verify := @FC_X509_REQ_verify; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_REQ_verify_removed)} + if X509_REQ_verify_removed <= LibVersion then + begin + {$if declared(_X509_REQ_verify)} + X509_REQ_verify := @_X509_REQ_verify; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_REQ_verify_allownil)} + if FuncLoadError then + AFailed.Add('X509_REQ_verify'); + {$ifend} + end; + + + X509_CRL_verify := LoadLibFunction(ADllHandle, X509_CRL_verify_procname); + FuncLoadError := not assigned(X509_CRL_verify); + if FuncLoadError then + begin + {$if not defined(X509_CRL_verify_allownil)} + X509_CRL_verify := @ERR_X509_CRL_verify; + {$ifend} + {$if declared(X509_CRL_verify_introduced)} + if LibVersion < X509_CRL_verify_introduced then + begin + {$if declared(FC_X509_CRL_verify)} + X509_CRL_verify := @FC_X509_CRL_verify; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_CRL_verify_removed)} + if X509_CRL_verify_removed <= LibVersion then + begin + {$if declared(_X509_CRL_verify)} + X509_CRL_verify := @_X509_CRL_verify; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_CRL_verify_allownil)} + if FuncLoadError then + AFailed.Add('X509_CRL_verify'); + {$ifend} + end; + + + NETSCAPE_SPKI_verify := LoadLibFunction(ADllHandle, NETSCAPE_SPKI_verify_procname); + FuncLoadError := not assigned(NETSCAPE_SPKI_verify); + if FuncLoadError then + begin + {$if not defined(NETSCAPE_SPKI_verify_allownil)} + NETSCAPE_SPKI_verify := @ERR_NETSCAPE_SPKI_verify; + {$ifend} + {$if declared(NETSCAPE_SPKI_verify_introduced)} + if LibVersion < NETSCAPE_SPKI_verify_introduced then + begin + {$if declared(FC_NETSCAPE_SPKI_verify)} + NETSCAPE_SPKI_verify := @FC_NETSCAPE_SPKI_verify; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(NETSCAPE_SPKI_verify_removed)} + if NETSCAPE_SPKI_verify_removed <= LibVersion then + begin + {$if declared(_NETSCAPE_SPKI_verify)} + NETSCAPE_SPKI_verify := @_NETSCAPE_SPKI_verify; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(NETSCAPE_SPKI_verify_allownil)} + if FuncLoadError then + AFailed.Add('NETSCAPE_SPKI_verify'); + {$ifend} + end; + + + NETSCAPE_SPKI_b64_decode := LoadLibFunction(ADllHandle, NETSCAPE_SPKI_b64_decode_procname); + FuncLoadError := not assigned(NETSCAPE_SPKI_b64_decode); + if FuncLoadError then + begin + {$if not defined(NETSCAPE_SPKI_b64_decode_allownil)} + NETSCAPE_SPKI_b64_decode := @ERR_NETSCAPE_SPKI_b64_decode; + {$ifend} + {$if declared(NETSCAPE_SPKI_b64_decode_introduced)} + if LibVersion < NETSCAPE_SPKI_b64_decode_introduced then + begin + {$if declared(FC_NETSCAPE_SPKI_b64_decode)} + NETSCAPE_SPKI_b64_decode := @FC_NETSCAPE_SPKI_b64_decode; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(NETSCAPE_SPKI_b64_decode_removed)} + if NETSCAPE_SPKI_b64_decode_removed <= LibVersion then + begin + {$if declared(_NETSCAPE_SPKI_b64_decode)} + NETSCAPE_SPKI_b64_decode := @_NETSCAPE_SPKI_b64_decode; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(NETSCAPE_SPKI_b64_decode_allownil)} + if FuncLoadError then + AFailed.Add('NETSCAPE_SPKI_b64_decode'); + {$ifend} + end; + + + NETSCAPE_SPKI_b64_encode := LoadLibFunction(ADllHandle, NETSCAPE_SPKI_b64_encode_procname); + FuncLoadError := not assigned(NETSCAPE_SPKI_b64_encode); + if FuncLoadError then + begin + {$if not defined(NETSCAPE_SPKI_b64_encode_allownil)} + NETSCAPE_SPKI_b64_encode := @ERR_NETSCAPE_SPKI_b64_encode; + {$ifend} + {$if declared(NETSCAPE_SPKI_b64_encode_introduced)} + if LibVersion < NETSCAPE_SPKI_b64_encode_introduced then + begin + {$if declared(FC_NETSCAPE_SPKI_b64_encode)} + NETSCAPE_SPKI_b64_encode := @FC_NETSCAPE_SPKI_b64_encode; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(NETSCAPE_SPKI_b64_encode_removed)} + if NETSCAPE_SPKI_b64_encode_removed <= LibVersion then + begin + {$if declared(_NETSCAPE_SPKI_b64_encode)} + NETSCAPE_SPKI_b64_encode := @_NETSCAPE_SPKI_b64_encode; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(NETSCAPE_SPKI_b64_encode_allownil)} + if FuncLoadError then + AFailed.Add('NETSCAPE_SPKI_b64_encode'); + {$ifend} + end; + + + NETSCAPE_SPKI_get_pubkey := LoadLibFunction(ADllHandle, NETSCAPE_SPKI_get_pubkey_procname); + FuncLoadError := not assigned(NETSCAPE_SPKI_get_pubkey); + if FuncLoadError then + begin + {$if not defined(NETSCAPE_SPKI_get_pubkey_allownil)} + NETSCAPE_SPKI_get_pubkey := @ERR_NETSCAPE_SPKI_get_pubkey; + {$ifend} + {$if declared(NETSCAPE_SPKI_get_pubkey_introduced)} + if LibVersion < NETSCAPE_SPKI_get_pubkey_introduced then + begin + {$if declared(FC_NETSCAPE_SPKI_get_pubkey)} + NETSCAPE_SPKI_get_pubkey := @FC_NETSCAPE_SPKI_get_pubkey; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(NETSCAPE_SPKI_get_pubkey_removed)} + if NETSCAPE_SPKI_get_pubkey_removed <= LibVersion then + begin + {$if declared(_NETSCAPE_SPKI_get_pubkey)} + NETSCAPE_SPKI_get_pubkey := @_NETSCAPE_SPKI_get_pubkey; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(NETSCAPE_SPKI_get_pubkey_allownil)} + if FuncLoadError then + AFailed.Add('NETSCAPE_SPKI_get_pubkey'); + {$ifend} + end; + + + NETSCAPE_SPKI_set_pubkey := LoadLibFunction(ADllHandle, NETSCAPE_SPKI_set_pubkey_procname); + FuncLoadError := not assigned(NETSCAPE_SPKI_set_pubkey); + if FuncLoadError then + begin + {$if not defined(NETSCAPE_SPKI_set_pubkey_allownil)} + NETSCAPE_SPKI_set_pubkey := @ERR_NETSCAPE_SPKI_set_pubkey; + {$ifend} + {$if declared(NETSCAPE_SPKI_set_pubkey_introduced)} + if LibVersion < NETSCAPE_SPKI_set_pubkey_introduced then + begin + {$if declared(FC_NETSCAPE_SPKI_set_pubkey)} + NETSCAPE_SPKI_set_pubkey := @FC_NETSCAPE_SPKI_set_pubkey; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(NETSCAPE_SPKI_set_pubkey_removed)} + if NETSCAPE_SPKI_set_pubkey_removed <= LibVersion then + begin + {$if declared(_NETSCAPE_SPKI_set_pubkey)} + NETSCAPE_SPKI_set_pubkey := @_NETSCAPE_SPKI_set_pubkey; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(NETSCAPE_SPKI_set_pubkey_allownil)} + if FuncLoadError then + AFailed.Add('NETSCAPE_SPKI_set_pubkey'); + {$ifend} + end; + + + NETSCAPE_SPKI_print := LoadLibFunction(ADllHandle, NETSCAPE_SPKI_print_procname); + FuncLoadError := not assigned(NETSCAPE_SPKI_print); + if FuncLoadError then + begin + {$if not defined(NETSCAPE_SPKI_print_allownil)} + NETSCAPE_SPKI_print := @ERR_NETSCAPE_SPKI_print; + {$ifend} + {$if declared(NETSCAPE_SPKI_print_introduced)} + if LibVersion < NETSCAPE_SPKI_print_introduced then + begin + {$if declared(FC_NETSCAPE_SPKI_print)} + NETSCAPE_SPKI_print := @FC_NETSCAPE_SPKI_print; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(NETSCAPE_SPKI_print_removed)} + if NETSCAPE_SPKI_print_removed <= LibVersion then + begin + {$if declared(_NETSCAPE_SPKI_print)} + NETSCAPE_SPKI_print := @_NETSCAPE_SPKI_print; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(NETSCAPE_SPKI_print_allownil)} + if FuncLoadError then + AFailed.Add('NETSCAPE_SPKI_print'); + {$ifend} + end; + + + X509_signature_dump := LoadLibFunction(ADllHandle, X509_signature_dump_procname); + FuncLoadError := not assigned(X509_signature_dump); + if FuncLoadError then + begin + {$if not defined(X509_signature_dump_allownil)} + X509_signature_dump := @ERR_X509_signature_dump; + {$ifend} + {$if declared(X509_signature_dump_introduced)} + if LibVersion < X509_signature_dump_introduced then + begin + {$if declared(FC_X509_signature_dump)} + X509_signature_dump := @FC_X509_signature_dump; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_signature_dump_removed)} + if X509_signature_dump_removed <= LibVersion then + begin + {$if declared(_X509_signature_dump)} + X509_signature_dump := @_X509_signature_dump; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_signature_dump_allownil)} + if FuncLoadError then + AFailed.Add('X509_signature_dump'); + {$ifend} + end; + + + X509_signature_print := LoadLibFunction(ADllHandle, X509_signature_print_procname); + FuncLoadError := not assigned(X509_signature_print); + if FuncLoadError then + begin + {$if not defined(X509_signature_print_allownil)} + X509_signature_print := @ERR_X509_signature_print; + {$ifend} + {$if declared(X509_signature_print_introduced)} + if LibVersion < X509_signature_print_introduced then + begin + {$if declared(FC_X509_signature_print)} + X509_signature_print := @FC_X509_signature_print; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_signature_print_removed)} + if X509_signature_print_removed <= LibVersion then + begin + {$if declared(_X509_signature_print)} + X509_signature_print := @_X509_signature_print; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_signature_print_allownil)} + if FuncLoadError then + AFailed.Add('X509_signature_print'); + {$ifend} + end; + + + X509_sign := LoadLibFunction(ADllHandle, X509_sign_procname); + FuncLoadError := not assigned(X509_sign); + if FuncLoadError then + begin + {$if not defined(X509_sign_allownil)} + X509_sign := @ERR_X509_sign; + {$ifend} + {$if declared(X509_sign_introduced)} + if LibVersion < X509_sign_introduced then + begin + {$if declared(FC_X509_sign)} + X509_sign := @FC_X509_sign; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_sign_removed)} + if X509_sign_removed <= LibVersion then + begin + {$if declared(_X509_sign)} + X509_sign := @_X509_sign; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_sign_allownil)} + if FuncLoadError then + AFailed.Add('X509_sign'); + {$ifend} + end; + + + X509_sign_ctx := LoadLibFunction(ADllHandle, X509_sign_ctx_procname); + FuncLoadError := not assigned(X509_sign_ctx); + if FuncLoadError then + begin + {$if not defined(X509_sign_ctx_allownil)} + X509_sign_ctx := @ERR_X509_sign_ctx; + {$ifend} + {$if declared(X509_sign_ctx_introduced)} + if LibVersion < X509_sign_ctx_introduced then + begin + {$if declared(FC_X509_sign_ctx)} + X509_sign_ctx := @FC_X509_sign_ctx; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_sign_ctx_removed)} + if X509_sign_ctx_removed <= LibVersion then + begin + {$if declared(_X509_sign_ctx)} + X509_sign_ctx := @_X509_sign_ctx; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_sign_ctx_allownil)} + if FuncLoadError then + AFailed.Add('X509_sign_ctx'); + {$ifend} + end; + + + X509_http_nbio := LoadLibFunction(ADllHandle, X509_http_nbio_procname); + FuncLoadError := not assigned(X509_http_nbio); + if FuncLoadError then + begin + {$if not defined(X509_http_nbio_allownil)} + X509_http_nbio := @ERR_X509_http_nbio; + {$ifend} + {$if declared(X509_http_nbio_introduced)} + if LibVersion < X509_http_nbio_introduced then + begin + {$if declared(FC_X509_http_nbio)} + X509_http_nbio := @FC_X509_http_nbio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_http_nbio_removed)} + if X509_http_nbio_removed <= LibVersion then + begin + {$if declared(_X509_http_nbio)} + X509_http_nbio := @_X509_http_nbio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_http_nbio_allownil)} + if FuncLoadError then + AFailed.Add('X509_http_nbio'); + {$ifend} + end; + + + X509_REQ_sign := LoadLibFunction(ADllHandle, X509_REQ_sign_procname); + FuncLoadError := not assigned(X509_REQ_sign); + if FuncLoadError then + begin + {$if not defined(X509_REQ_sign_allownil)} + X509_REQ_sign := @ERR_X509_REQ_sign; + {$ifend} + {$if declared(X509_REQ_sign_introduced)} + if LibVersion < X509_REQ_sign_introduced then + begin + {$if declared(FC_X509_REQ_sign)} + X509_REQ_sign := @FC_X509_REQ_sign; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_REQ_sign_removed)} + if X509_REQ_sign_removed <= LibVersion then + begin + {$if declared(_X509_REQ_sign)} + X509_REQ_sign := @_X509_REQ_sign; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_REQ_sign_allownil)} + if FuncLoadError then + AFailed.Add('X509_REQ_sign'); + {$ifend} + end; + + + X509_REQ_sign_ctx := LoadLibFunction(ADllHandle, X509_REQ_sign_ctx_procname); + FuncLoadError := not assigned(X509_REQ_sign_ctx); + if FuncLoadError then + begin + {$if not defined(X509_REQ_sign_ctx_allownil)} + X509_REQ_sign_ctx := @ERR_X509_REQ_sign_ctx; + {$ifend} + {$if declared(X509_REQ_sign_ctx_introduced)} + if LibVersion < X509_REQ_sign_ctx_introduced then + begin + {$if declared(FC_X509_REQ_sign_ctx)} + X509_REQ_sign_ctx := @FC_X509_REQ_sign_ctx; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_REQ_sign_ctx_removed)} + if X509_REQ_sign_ctx_removed <= LibVersion then + begin + {$if declared(_X509_REQ_sign_ctx)} + X509_REQ_sign_ctx := @_X509_REQ_sign_ctx; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_REQ_sign_ctx_allownil)} + if FuncLoadError then + AFailed.Add('X509_REQ_sign_ctx'); + {$ifend} + end; + + + X509_CRL_sign := LoadLibFunction(ADllHandle, X509_CRL_sign_procname); + FuncLoadError := not assigned(X509_CRL_sign); + if FuncLoadError then + begin + {$if not defined(X509_CRL_sign_allownil)} + X509_CRL_sign := @ERR_X509_CRL_sign; + {$ifend} + {$if declared(X509_CRL_sign_introduced)} + if LibVersion < X509_CRL_sign_introduced then + begin + {$if declared(FC_X509_CRL_sign)} + X509_CRL_sign := @FC_X509_CRL_sign; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_CRL_sign_removed)} + if X509_CRL_sign_removed <= LibVersion then + begin + {$if declared(_X509_CRL_sign)} + X509_CRL_sign := @_X509_CRL_sign; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_CRL_sign_allownil)} + if FuncLoadError then + AFailed.Add('X509_CRL_sign'); + {$ifend} + end; + + + X509_CRL_sign_ctx := LoadLibFunction(ADllHandle, X509_CRL_sign_ctx_procname); + FuncLoadError := not assigned(X509_CRL_sign_ctx); + if FuncLoadError then + begin + {$if not defined(X509_CRL_sign_ctx_allownil)} + X509_CRL_sign_ctx := @ERR_X509_CRL_sign_ctx; + {$ifend} + {$if declared(X509_CRL_sign_ctx_introduced)} + if LibVersion < X509_CRL_sign_ctx_introduced then + begin + {$if declared(FC_X509_CRL_sign_ctx)} + X509_CRL_sign_ctx := @FC_X509_CRL_sign_ctx; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_CRL_sign_ctx_removed)} + if X509_CRL_sign_ctx_removed <= LibVersion then + begin + {$if declared(_X509_CRL_sign_ctx)} + X509_CRL_sign_ctx := @_X509_CRL_sign_ctx; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_CRL_sign_ctx_allownil)} + if FuncLoadError then + AFailed.Add('X509_CRL_sign_ctx'); + {$ifend} + end; + + + X509_CRL_http_nbio := LoadLibFunction(ADllHandle, X509_CRL_http_nbio_procname); + FuncLoadError := not assigned(X509_CRL_http_nbio); + if FuncLoadError then + begin + {$if not defined(X509_CRL_http_nbio_allownil)} + X509_CRL_http_nbio := @ERR_X509_CRL_http_nbio; + {$ifend} + {$if declared(X509_CRL_http_nbio_introduced)} + if LibVersion < X509_CRL_http_nbio_introduced then + begin + {$if declared(FC_X509_CRL_http_nbio)} + X509_CRL_http_nbio := @FC_X509_CRL_http_nbio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_CRL_http_nbio_removed)} + if X509_CRL_http_nbio_removed <= LibVersion then + begin + {$if declared(_X509_CRL_http_nbio)} + X509_CRL_http_nbio := @_X509_CRL_http_nbio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_CRL_http_nbio_allownil)} + if FuncLoadError then + AFailed.Add('X509_CRL_http_nbio'); + {$ifend} + end; + + + NETSCAPE_SPKI_sign := LoadLibFunction(ADllHandle, NETSCAPE_SPKI_sign_procname); + FuncLoadError := not assigned(NETSCAPE_SPKI_sign); + if FuncLoadError then + begin + {$if not defined(NETSCAPE_SPKI_sign_allownil)} + NETSCAPE_SPKI_sign := @ERR_NETSCAPE_SPKI_sign; + {$ifend} + {$if declared(NETSCAPE_SPKI_sign_introduced)} + if LibVersion < NETSCAPE_SPKI_sign_introduced then + begin + {$if declared(FC_NETSCAPE_SPKI_sign)} + NETSCAPE_SPKI_sign := @FC_NETSCAPE_SPKI_sign; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(NETSCAPE_SPKI_sign_removed)} + if NETSCAPE_SPKI_sign_removed <= LibVersion then + begin + {$if declared(_NETSCAPE_SPKI_sign)} + NETSCAPE_SPKI_sign := @_NETSCAPE_SPKI_sign; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(NETSCAPE_SPKI_sign_allownil)} + if FuncLoadError then + AFailed.Add('NETSCAPE_SPKI_sign'); + {$ifend} + end; + + + X509_pubkey_digest := LoadLibFunction(ADllHandle, X509_pubkey_digest_procname); + FuncLoadError := not assigned(X509_pubkey_digest); + if FuncLoadError then + begin + {$if not defined(X509_pubkey_digest_allownil)} + X509_pubkey_digest := @ERR_X509_pubkey_digest; + {$ifend} + {$if declared(X509_pubkey_digest_introduced)} + if LibVersion < X509_pubkey_digest_introduced then + begin + {$if declared(FC_X509_pubkey_digest)} + X509_pubkey_digest := @FC_X509_pubkey_digest; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_pubkey_digest_removed)} + if X509_pubkey_digest_removed <= LibVersion then + begin + {$if declared(_X509_pubkey_digest)} + X509_pubkey_digest := @_X509_pubkey_digest; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_pubkey_digest_allownil)} + if FuncLoadError then + AFailed.Add('X509_pubkey_digest'); + {$ifend} + end; + + + X509_digest := LoadLibFunction(ADllHandle, X509_digest_procname); + FuncLoadError := not assigned(X509_digest); + if FuncLoadError then + begin + {$if not defined(X509_digest_allownil)} + X509_digest := @ERR_X509_digest; + {$ifend} + {$if declared(X509_digest_introduced)} + if LibVersion < X509_digest_introduced then + begin + {$if declared(FC_X509_digest)} + X509_digest := @FC_X509_digest; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_digest_removed)} + if X509_digest_removed <= LibVersion then + begin + {$if declared(_X509_digest)} + X509_digest := @_X509_digest; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_digest_allownil)} + if FuncLoadError then + AFailed.Add('X509_digest'); + {$ifend} + end; + + + X509_CRL_digest := LoadLibFunction(ADllHandle, X509_CRL_digest_procname); + FuncLoadError := not assigned(X509_CRL_digest); + if FuncLoadError then + begin + {$if not defined(X509_CRL_digest_allownil)} + X509_CRL_digest := @ERR_X509_CRL_digest; + {$ifend} + {$if declared(X509_CRL_digest_introduced)} + if LibVersion < X509_CRL_digest_introduced then + begin + {$if declared(FC_X509_CRL_digest)} + X509_CRL_digest := @FC_X509_CRL_digest; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_CRL_digest_removed)} + if X509_CRL_digest_removed <= LibVersion then + begin + {$if declared(_X509_CRL_digest)} + X509_CRL_digest := @_X509_CRL_digest; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_CRL_digest_allownil)} + if FuncLoadError then + AFailed.Add('X509_CRL_digest'); + {$ifend} + end; + + + X509_REQ_digest := LoadLibFunction(ADllHandle, X509_REQ_digest_procname); + FuncLoadError := not assigned(X509_REQ_digest); + if FuncLoadError then + begin + {$if not defined(X509_REQ_digest_allownil)} + X509_REQ_digest := @ERR_X509_REQ_digest; + {$ifend} + {$if declared(X509_REQ_digest_introduced)} + if LibVersion < X509_REQ_digest_introduced then + begin + {$if declared(FC_X509_REQ_digest)} + X509_REQ_digest := @FC_X509_REQ_digest; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_REQ_digest_removed)} + if X509_REQ_digest_removed <= LibVersion then + begin + {$if declared(_X509_REQ_digest)} + X509_REQ_digest := @_X509_REQ_digest; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_REQ_digest_allownil)} + if FuncLoadError then + AFailed.Add('X509_REQ_digest'); + {$ifend} + end; + + + X509_NAME_digest := LoadLibFunction(ADllHandle, X509_NAME_digest_procname); + FuncLoadError := not assigned(X509_NAME_digest); + if FuncLoadError then + begin + {$if not defined(X509_NAME_digest_allownil)} + X509_NAME_digest := @ERR_X509_NAME_digest; + {$ifend} + {$if declared(X509_NAME_digest_introduced)} + if LibVersion < X509_NAME_digest_introduced then + begin + {$if declared(FC_X509_NAME_digest)} + X509_NAME_digest := @FC_X509_NAME_digest; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_NAME_digest_removed)} + if X509_NAME_digest_removed <= LibVersion then + begin + {$if declared(_X509_NAME_digest)} + X509_NAME_digest := @_X509_NAME_digest; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_NAME_digest_allownil)} + if FuncLoadError then + AFailed.Add('X509_NAME_digest'); + {$ifend} + end; + + + d2i_X509_bio := LoadLibFunction(ADllHandle, d2i_X509_bio_procname); + FuncLoadError := not assigned(d2i_X509_bio); + if FuncLoadError then + begin + {$if not defined(d2i_X509_bio_allownil)} + d2i_X509_bio := @ERR_d2i_X509_bio; + {$ifend} + {$if declared(d2i_X509_bio_introduced)} + if LibVersion < d2i_X509_bio_introduced then + begin + {$if declared(FC_d2i_X509_bio)} + d2i_X509_bio := @FC_d2i_X509_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(d2i_X509_bio_removed)} + if d2i_X509_bio_removed <= LibVersion then + begin + {$if declared(_d2i_X509_bio)} + d2i_X509_bio := @_d2i_X509_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(d2i_X509_bio_allownil)} + if FuncLoadError then + AFailed.Add('d2i_X509_bio'); + {$ifend} + end; + + + i2d_X509_bio := LoadLibFunction(ADllHandle, i2d_X509_bio_procname); + FuncLoadError := not assigned(i2d_X509_bio); + if FuncLoadError then + begin + {$if not defined(i2d_X509_bio_allownil)} + i2d_X509_bio := @ERR_i2d_X509_bio; + {$ifend} + {$if declared(i2d_X509_bio_introduced)} + if LibVersion < i2d_X509_bio_introduced then + begin + {$if declared(FC_i2d_X509_bio)} + i2d_X509_bio := @FC_i2d_X509_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(i2d_X509_bio_removed)} + if i2d_X509_bio_removed <= LibVersion then + begin + {$if declared(_i2d_X509_bio)} + i2d_X509_bio := @_i2d_X509_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(i2d_X509_bio_allownil)} + if FuncLoadError then + AFailed.Add('i2d_X509_bio'); + {$ifend} + end; + + + d2i_X509_CRL_bio := LoadLibFunction(ADllHandle, d2i_X509_CRL_bio_procname); + FuncLoadError := not assigned(d2i_X509_CRL_bio); + if FuncLoadError then + begin + {$if not defined(d2i_X509_CRL_bio_allownil)} + d2i_X509_CRL_bio := @ERR_d2i_X509_CRL_bio; + {$ifend} + {$if declared(d2i_X509_CRL_bio_introduced)} + if LibVersion < d2i_X509_CRL_bio_introduced then + begin + {$if declared(FC_d2i_X509_CRL_bio)} + d2i_X509_CRL_bio := @FC_d2i_X509_CRL_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(d2i_X509_CRL_bio_removed)} + if d2i_X509_CRL_bio_removed <= LibVersion then + begin + {$if declared(_d2i_X509_CRL_bio)} + d2i_X509_CRL_bio := @_d2i_X509_CRL_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(d2i_X509_CRL_bio_allownil)} + if FuncLoadError then + AFailed.Add('d2i_X509_CRL_bio'); + {$ifend} + end; + + + i2d_X509_CRL_bio := LoadLibFunction(ADllHandle, i2d_X509_CRL_bio_procname); + FuncLoadError := not assigned(i2d_X509_CRL_bio); + if FuncLoadError then + begin + {$if not defined(i2d_X509_CRL_bio_allownil)} + i2d_X509_CRL_bio := @ERR_i2d_X509_CRL_bio; + {$ifend} + {$if declared(i2d_X509_CRL_bio_introduced)} + if LibVersion < i2d_X509_CRL_bio_introduced then + begin + {$if declared(FC_i2d_X509_CRL_bio)} + i2d_X509_CRL_bio := @FC_i2d_X509_CRL_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(i2d_X509_CRL_bio_removed)} + if i2d_X509_CRL_bio_removed <= LibVersion then + begin + {$if declared(_i2d_X509_CRL_bio)} + i2d_X509_CRL_bio := @_i2d_X509_CRL_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(i2d_X509_CRL_bio_allownil)} + if FuncLoadError then + AFailed.Add('i2d_X509_CRL_bio'); + {$ifend} + end; + + + d2i_X509_REQ_bio := LoadLibFunction(ADllHandle, d2i_X509_REQ_bio_procname); + FuncLoadError := not assigned(d2i_X509_REQ_bio); + if FuncLoadError then + begin + {$if not defined(d2i_X509_REQ_bio_allownil)} + d2i_X509_REQ_bio := @ERR_d2i_X509_REQ_bio; + {$ifend} + {$if declared(d2i_X509_REQ_bio_introduced)} + if LibVersion < d2i_X509_REQ_bio_introduced then + begin + {$if declared(FC_d2i_X509_REQ_bio)} + d2i_X509_REQ_bio := @FC_d2i_X509_REQ_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(d2i_X509_REQ_bio_removed)} + if d2i_X509_REQ_bio_removed <= LibVersion then + begin + {$if declared(_d2i_X509_REQ_bio)} + d2i_X509_REQ_bio := @_d2i_X509_REQ_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(d2i_X509_REQ_bio_allownil)} + if FuncLoadError then + AFailed.Add('d2i_X509_REQ_bio'); + {$ifend} + end; + + + i2d_X509_REQ_bio := LoadLibFunction(ADllHandle, i2d_X509_REQ_bio_procname); + FuncLoadError := not assigned(i2d_X509_REQ_bio); + if FuncLoadError then + begin + {$if not defined(i2d_X509_REQ_bio_allownil)} + i2d_X509_REQ_bio := @ERR_i2d_X509_REQ_bio; + {$ifend} + {$if declared(i2d_X509_REQ_bio_introduced)} + if LibVersion < i2d_X509_REQ_bio_introduced then + begin + {$if declared(FC_i2d_X509_REQ_bio)} + i2d_X509_REQ_bio := @FC_i2d_X509_REQ_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(i2d_X509_REQ_bio_removed)} + if i2d_X509_REQ_bio_removed <= LibVersion then + begin + {$if declared(_i2d_X509_REQ_bio)} + i2d_X509_REQ_bio := @_i2d_X509_REQ_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(i2d_X509_REQ_bio_allownil)} + if FuncLoadError then + AFailed.Add('i2d_X509_REQ_bio'); + {$ifend} + end; + + + d2i_RSAPrivateKey_bio := LoadLibFunction(ADllHandle, d2i_RSAPrivateKey_bio_procname); + FuncLoadError := not assigned(d2i_RSAPrivateKey_bio); + if FuncLoadError then + begin + {$if not defined(d2i_RSAPrivateKey_bio_allownil)} + d2i_RSAPrivateKey_bio := @ERR_d2i_RSAPrivateKey_bio; + {$ifend} + {$if declared(d2i_RSAPrivateKey_bio_introduced)} + if LibVersion < d2i_RSAPrivateKey_bio_introduced then + begin + {$if declared(FC_d2i_RSAPrivateKey_bio)} + d2i_RSAPrivateKey_bio := @FC_d2i_RSAPrivateKey_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(d2i_RSAPrivateKey_bio_removed)} + if d2i_RSAPrivateKey_bio_removed <= LibVersion then + begin + {$if declared(_d2i_RSAPrivateKey_bio)} + d2i_RSAPrivateKey_bio := @_d2i_RSAPrivateKey_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(d2i_RSAPrivateKey_bio_allownil)} + if FuncLoadError then + AFailed.Add('d2i_RSAPrivateKey_bio'); + {$ifend} + end; + + + i2d_RSAPrivateKey_bio := LoadLibFunction(ADllHandle, i2d_RSAPrivateKey_bio_procname); + FuncLoadError := not assigned(i2d_RSAPrivateKey_bio); + if FuncLoadError then + begin + {$if not defined(i2d_RSAPrivateKey_bio_allownil)} + i2d_RSAPrivateKey_bio := @ERR_i2d_RSAPrivateKey_bio; + {$ifend} + {$if declared(i2d_RSAPrivateKey_bio_introduced)} + if LibVersion < i2d_RSAPrivateKey_bio_introduced then + begin + {$if declared(FC_i2d_RSAPrivateKey_bio)} + i2d_RSAPrivateKey_bio := @FC_i2d_RSAPrivateKey_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(i2d_RSAPrivateKey_bio_removed)} + if i2d_RSAPrivateKey_bio_removed <= LibVersion then + begin + {$if declared(_i2d_RSAPrivateKey_bio)} + i2d_RSAPrivateKey_bio := @_i2d_RSAPrivateKey_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(i2d_RSAPrivateKey_bio_allownil)} + if FuncLoadError then + AFailed.Add('i2d_RSAPrivateKey_bio'); + {$ifend} + end; + + + d2i_RSAPublicKey_bio := LoadLibFunction(ADllHandle, d2i_RSAPublicKey_bio_procname); + FuncLoadError := not assigned(d2i_RSAPublicKey_bio); + if FuncLoadError then + begin + {$if not defined(d2i_RSAPublicKey_bio_allownil)} + d2i_RSAPublicKey_bio := @ERR_d2i_RSAPublicKey_bio; + {$ifend} + {$if declared(d2i_RSAPublicKey_bio_introduced)} + if LibVersion < d2i_RSAPublicKey_bio_introduced then + begin + {$if declared(FC_d2i_RSAPublicKey_bio)} + d2i_RSAPublicKey_bio := @FC_d2i_RSAPublicKey_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(d2i_RSAPublicKey_bio_removed)} + if d2i_RSAPublicKey_bio_removed <= LibVersion then + begin + {$if declared(_d2i_RSAPublicKey_bio)} + d2i_RSAPublicKey_bio := @_d2i_RSAPublicKey_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(d2i_RSAPublicKey_bio_allownil)} + if FuncLoadError then + AFailed.Add('d2i_RSAPublicKey_bio'); + {$ifend} + end; + + + i2d_RSAPublicKey_bio := LoadLibFunction(ADllHandle, i2d_RSAPublicKey_bio_procname); + FuncLoadError := not assigned(i2d_RSAPublicKey_bio); + if FuncLoadError then + begin + {$if not defined(i2d_RSAPublicKey_bio_allownil)} + i2d_RSAPublicKey_bio := @ERR_i2d_RSAPublicKey_bio; + {$ifend} + {$if declared(i2d_RSAPublicKey_bio_introduced)} + if LibVersion < i2d_RSAPublicKey_bio_introduced then + begin + {$if declared(FC_i2d_RSAPublicKey_bio)} + i2d_RSAPublicKey_bio := @FC_i2d_RSAPublicKey_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(i2d_RSAPublicKey_bio_removed)} + if i2d_RSAPublicKey_bio_removed <= LibVersion then + begin + {$if declared(_i2d_RSAPublicKey_bio)} + i2d_RSAPublicKey_bio := @_i2d_RSAPublicKey_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(i2d_RSAPublicKey_bio_allownil)} + if FuncLoadError then + AFailed.Add('i2d_RSAPublicKey_bio'); + {$ifend} + end; + + + d2i_RSA_PUBKEY_bio := LoadLibFunction(ADllHandle, d2i_RSA_PUBKEY_bio_procname); + FuncLoadError := not assigned(d2i_RSA_PUBKEY_bio); + if FuncLoadError then + begin + {$if not defined(d2i_RSA_PUBKEY_bio_allownil)} + d2i_RSA_PUBKEY_bio := @ERR_d2i_RSA_PUBKEY_bio; + {$ifend} + {$if declared(d2i_RSA_PUBKEY_bio_introduced)} + if LibVersion < d2i_RSA_PUBKEY_bio_introduced then + begin + {$if declared(FC_d2i_RSA_PUBKEY_bio)} + d2i_RSA_PUBKEY_bio := @FC_d2i_RSA_PUBKEY_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(d2i_RSA_PUBKEY_bio_removed)} + if d2i_RSA_PUBKEY_bio_removed <= LibVersion then + begin + {$if declared(_d2i_RSA_PUBKEY_bio)} + d2i_RSA_PUBKEY_bio := @_d2i_RSA_PUBKEY_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(d2i_RSA_PUBKEY_bio_allownil)} + if FuncLoadError then + AFailed.Add('d2i_RSA_PUBKEY_bio'); + {$ifend} + end; + + + i2d_RSA_PUBKEY_bio := LoadLibFunction(ADllHandle, i2d_RSA_PUBKEY_bio_procname); + FuncLoadError := not assigned(i2d_RSA_PUBKEY_bio); + if FuncLoadError then + begin + {$if not defined(i2d_RSA_PUBKEY_bio_allownil)} + i2d_RSA_PUBKEY_bio := @ERR_i2d_RSA_PUBKEY_bio; + {$ifend} + {$if declared(i2d_RSA_PUBKEY_bio_introduced)} + if LibVersion < i2d_RSA_PUBKEY_bio_introduced then + begin + {$if declared(FC_i2d_RSA_PUBKEY_bio)} + i2d_RSA_PUBKEY_bio := @FC_i2d_RSA_PUBKEY_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(i2d_RSA_PUBKEY_bio_removed)} + if i2d_RSA_PUBKEY_bio_removed <= LibVersion then + begin + {$if declared(_i2d_RSA_PUBKEY_bio)} + i2d_RSA_PUBKEY_bio := @_i2d_RSA_PUBKEY_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(i2d_RSA_PUBKEY_bio_allownil)} + if FuncLoadError then + AFailed.Add('i2d_RSA_PUBKEY_bio'); + {$ifend} + end; + + + d2i_DSA_PUBKEY_bio := LoadLibFunction(ADllHandle, d2i_DSA_PUBKEY_bio_procname); + FuncLoadError := not assigned(d2i_DSA_PUBKEY_bio); + if FuncLoadError then + begin + {$if not defined(d2i_DSA_PUBKEY_bio_allownil)} + d2i_DSA_PUBKEY_bio := @ERR_d2i_DSA_PUBKEY_bio; + {$ifend} + {$if declared(d2i_DSA_PUBKEY_bio_introduced)} + if LibVersion < d2i_DSA_PUBKEY_bio_introduced then + begin + {$if declared(FC_d2i_DSA_PUBKEY_bio)} + d2i_DSA_PUBKEY_bio := @FC_d2i_DSA_PUBKEY_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(d2i_DSA_PUBKEY_bio_removed)} + if d2i_DSA_PUBKEY_bio_removed <= LibVersion then + begin + {$if declared(_d2i_DSA_PUBKEY_bio)} + d2i_DSA_PUBKEY_bio := @_d2i_DSA_PUBKEY_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(d2i_DSA_PUBKEY_bio_allownil)} + if FuncLoadError then + AFailed.Add('d2i_DSA_PUBKEY_bio'); + {$ifend} + end; + + + i2d_DSA_PUBKEY_bio := LoadLibFunction(ADllHandle, i2d_DSA_PUBKEY_bio_procname); + FuncLoadError := not assigned(i2d_DSA_PUBKEY_bio); + if FuncLoadError then + begin + {$if not defined(i2d_DSA_PUBKEY_bio_allownil)} + i2d_DSA_PUBKEY_bio := @ERR_i2d_DSA_PUBKEY_bio; + {$ifend} + {$if declared(i2d_DSA_PUBKEY_bio_introduced)} + if LibVersion < i2d_DSA_PUBKEY_bio_introduced then + begin + {$if declared(FC_i2d_DSA_PUBKEY_bio)} + i2d_DSA_PUBKEY_bio := @FC_i2d_DSA_PUBKEY_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(i2d_DSA_PUBKEY_bio_removed)} + if i2d_DSA_PUBKEY_bio_removed <= LibVersion then + begin + {$if declared(_i2d_DSA_PUBKEY_bio)} + i2d_DSA_PUBKEY_bio := @_i2d_DSA_PUBKEY_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(i2d_DSA_PUBKEY_bio_allownil)} + if FuncLoadError then + AFailed.Add('i2d_DSA_PUBKEY_bio'); + {$ifend} + end; + + + d2i_DSAPrivateKey_bio := LoadLibFunction(ADllHandle, d2i_DSAPrivateKey_bio_procname); + FuncLoadError := not assigned(d2i_DSAPrivateKey_bio); + if FuncLoadError then + begin + {$if not defined(d2i_DSAPrivateKey_bio_allownil)} + d2i_DSAPrivateKey_bio := @ERR_d2i_DSAPrivateKey_bio; + {$ifend} + {$if declared(d2i_DSAPrivateKey_bio_introduced)} + if LibVersion < d2i_DSAPrivateKey_bio_introduced then + begin + {$if declared(FC_d2i_DSAPrivateKey_bio)} + d2i_DSAPrivateKey_bio := @FC_d2i_DSAPrivateKey_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(d2i_DSAPrivateKey_bio_removed)} + if d2i_DSAPrivateKey_bio_removed <= LibVersion then + begin + {$if declared(_d2i_DSAPrivateKey_bio)} + d2i_DSAPrivateKey_bio := @_d2i_DSAPrivateKey_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(d2i_DSAPrivateKey_bio_allownil)} + if FuncLoadError then + AFailed.Add('d2i_DSAPrivateKey_bio'); + {$ifend} + end; + + + i2d_DSAPrivateKey_bio := LoadLibFunction(ADllHandle, i2d_DSAPrivateKey_bio_procname); + FuncLoadError := not assigned(i2d_DSAPrivateKey_bio); + if FuncLoadError then + begin + {$if not defined(i2d_DSAPrivateKey_bio_allownil)} + i2d_DSAPrivateKey_bio := @ERR_i2d_DSAPrivateKey_bio; + {$ifend} + {$if declared(i2d_DSAPrivateKey_bio_introduced)} + if LibVersion < i2d_DSAPrivateKey_bio_introduced then + begin + {$if declared(FC_i2d_DSAPrivateKey_bio)} + i2d_DSAPrivateKey_bio := @FC_i2d_DSAPrivateKey_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(i2d_DSAPrivateKey_bio_removed)} + if i2d_DSAPrivateKey_bio_removed <= LibVersion then + begin + {$if declared(_i2d_DSAPrivateKey_bio)} + i2d_DSAPrivateKey_bio := @_i2d_DSAPrivateKey_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(i2d_DSAPrivateKey_bio_allownil)} + if FuncLoadError then + AFailed.Add('i2d_DSAPrivateKey_bio'); + {$ifend} + end; + + + d2i_EC_PUBKEY_bio := LoadLibFunction(ADllHandle, d2i_EC_PUBKEY_bio_procname); + FuncLoadError := not assigned(d2i_EC_PUBKEY_bio); + if FuncLoadError then + begin + {$if not defined(d2i_EC_PUBKEY_bio_allownil)} + d2i_EC_PUBKEY_bio := @ERR_d2i_EC_PUBKEY_bio; + {$ifend} + {$if declared(d2i_EC_PUBKEY_bio_introduced)} + if LibVersion < d2i_EC_PUBKEY_bio_introduced then + begin + {$if declared(FC_d2i_EC_PUBKEY_bio)} + d2i_EC_PUBKEY_bio := @FC_d2i_EC_PUBKEY_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(d2i_EC_PUBKEY_bio_removed)} + if d2i_EC_PUBKEY_bio_removed <= LibVersion then + begin + {$if declared(_d2i_EC_PUBKEY_bio)} + d2i_EC_PUBKEY_bio := @_d2i_EC_PUBKEY_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(d2i_EC_PUBKEY_bio_allownil)} + if FuncLoadError then + AFailed.Add('d2i_EC_PUBKEY_bio'); + {$ifend} + end; + + + i2d_EC_PUBKEY_bio := LoadLibFunction(ADllHandle, i2d_EC_PUBKEY_bio_procname); + FuncLoadError := not assigned(i2d_EC_PUBKEY_bio); + if FuncLoadError then + begin + {$if not defined(i2d_EC_PUBKEY_bio_allownil)} + i2d_EC_PUBKEY_bio := @ERR_i2d_EC_PUBKEY_bio; + {$ifend} + {$if declared(i2d_EC_PUBKEY_bio_introduced)} + if LibVersion < i2d_EC_PUBKEY_bio_introduced then + begin + {$if declared(FC_i2d_EC_PUBKEY_bio)} + i2d_EC_PUBKEY_bio := @FC_i2d_EC_PUBKEY_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(i2d_EC_PUBKEY_bio_removed)} + if i2d_EC_PUBKEY_bio_removed <= LibVersion then + begin + {$if declared(_i2d_EC_PUBKEY_bio)} + i2d_EC_PUBKEY_bio := @_i2d_EC_PUBKEY_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(i2d_EC_PUBKEY_bio_allownil)} + if FuncLoadError then + AFailed.Add('i2d_EC_PUBKEY_bio'); + {$ifend} + end; + + + d2i_ECPrivateKey_bio := LoadLibFunction(ADllHandle, d2i_ECPrivateKey_bio_procname); + FuncLoadError := not assigned(d2i_ECPrivateKey_bio); + if FuncLoadError then + begin + {$if not defined(d2i_ECPrivateKey_bio_allownil)} + d2i_ECPrivateKey_bio := @ERR_d2i_ECPrivateKey_bio; + {$ifend} + {$if declared(d2i_ECPrivateKey_bio_introduced)} + if LibVersion < d2i_ECPrivateKey_bio_introduced then + begin + {$if declared(FC_d2i_ECPrivateKey_bio)} + d2i_ECPrivateKey_bio := @FC_d2i_ECPrivateKey_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(d2i_ECPrivateKey_bio_removed)} + if d2i_ECPrivateKey_bio_removed <= LibVersion then + begin + {$if declared(_d2i_ECPrivateKey_bio)} + d2i_ECPrivateKey_bio := @_d2i_ECPrivateKey_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(d2i_ECPrivateKey_bio_allownil)} + if FuncLoadError then + AFailed.Add('d2i_ECPrivateKey_bio'); + {$ifend} + end; + + + i2d_ECPrivateKey_bio := LoadLibFunction(ADllHandle, i2d_ECPrivateKey_bio_procname); + FuncLoadError := not assigned(i2d_ECPrivateKey_bio); + if FuncLoadError then + begin + {$if not defined(i2d_ECPrivateKey_bio_allownil)} + i2d_ECPrivateKey_bio := @ERR_i2d_ECPrivateKey_bio; + {$ifend} + {$if declared(i2d_ECPrivateKey_bio_introduced)} + if LibVersion < i2d_ECPrivateKey_bio_introduced then + begin + {$if declared(FC_i2d_ECPrivateKey_bio)} + i2d_ECPrivateKey_bio := @FC_i2d_ECPrivateKey_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(i2d_ECPrivateKey_bio_removed)} + if i2d_ECPrivateKey_bio_removed <= LibVersion then + begin + {$if declared(_i2d_ECPrivateKey_bio)} + i2d_ECPrivateKey_bio := @_i2d_ECPrivateKey_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(i2d_ECPrivateKey_bio_allownil)} + if FuncLoadError then + AFailed.Add('i2d_ECPrivateKey_bio'); + {$ifend} + end; + + + d2i_PKCS8_bio := LoadLibFunction(ADllHandle, d2i_PKCS8_bio_procname); + FuncLoadError := not assigned(d2i_PKCS8_bio); + if FuncLoadError then + begin + {$if not defined(d2i_PKCS8_bio_allownil)} + d2i_PKCS8_bio := @ERR_d2i_PKCS8_bio; + {$ifend} + {$if declared(d2i_PKCS8_bio_introduced)} + if LibVersion < d2i_PKCS8_bio_introduced then + begin + {$if declared(FC_d2i_PKCS8_bio)} + d2i_PKCS8_bio := @FC_d2i_PKCS8_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(d2i_PKCS8_bio_removed)} + if d2i_PKCS8_bio_removed <= LibVersion then + begin + {$if declared(_d2i_PKCS8_bio)} + d2i_PKCS8_bio := @_d2i_PKCS8_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(d2i_PKCS8_bio_allownil)} + if FuncLoadError then + AFailed.Add('d2i_PKCS8_bio'); + {$ifend} + end; + + + i2d_PKCS8_bio := LoadLibFunction(ADllHandle, i2d_PKCS8_bio_procname); + FuncLoadError := not assigned(i2d_PKCS8_bio); + if FuncLoadError then + begin + {$if not defined(i2d_PKCS8_bio_allownil)} + i2d_PKCS8_bio := @ERR_i2d_PKCS8_bio; + {$ifend} + {$if declared(i2d_PKCS8_bio_introduced)} + if LibVersion < i2d_PKCS8_bio_introduced then + begin + {$if declared(FC_i2d_PKCS8_bio)} + i2d_PKCS8_bio := @FC_i2d_PKCS8_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(i2d_PKCS8_bio_removed)} + if i2d_PKCS8_bio_removed <= LibVersion then + begin + {$if declared(_i2d_PKCS8_bio)} + i2d_PKCS8_bio := @_i2d_PKCS8_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(i2d_PKCS8_bio_allownil)} + if FuncLoadError then + AFailed.Add('i2d_PKCS8_bio'); + {$ifend} + end; + + + d2i_PKCS8_PRIV_KEY_INFO_bio := LoadLibFunction(ADllHandle, d2i_PKCS8_PRIV_KEY_INFO_bio_procname); + FuncLoadError := not assigned(d2i_PKCS8_PRIV_KEY_INFO_bio); + if FuncLoadError then + begin + {$if not defined(d2i_PKCS8_PRIV_KEY_INFO_bio_allownil)} + d2i_PKCS8_PRIV_KEY_INFO_bio := @ERR_d2i_PKCS8_PRIV_KEY_INFO_bio; + {$ifend} + {$if declared(d2i_PKCS8_PRIV_KEY_INFO_bio_introduced)} + if LibVersion < d2i_PKCS8_PRIV_KEY_INFO_bio_introduced then + begin + {$if declared(FC_d2i_PKCS8_PRIV_KEY_INFO_bio)} + d2i_PKCS8_PRIV_KEY_INFO_bio := @FC_d2i_PKCS8_PRIV_KEY_INFO_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(d2i_PKCS8_PRIV_KEY_INFO_bio_removed)} + if d2i_PKCS8_PRIV_KEY_INFO_bio_removed <= LibVersion then + begin + {$if declared(_d2i_PKCS8_PRIV_KEY_INFO_bio)} + d2i_PKCS8_PRIV_KEY_INFO_bio := @_d2i_PKCS8_PRIV_KEY_INFO_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(d2i_PKCS8_PRIV_KEY_INFO_bio_allownil)} + if FuncLoadError then + AFailed.Add('d2i_PKCS8_PRIV_KEY_INFO_bio'); + {$ifend} + end; + + + i2d_PKCS8_PRIV_KEY_INFO_bio := LoadLibFunction(ADllHandle, i2d_PKCS8_PRIV_KEY_INFO_bio_procname); + FuncLoadError := not assigned(i2d_PKCS8_PRIV_KEY_INFO_bio); + if FuncLoadError then + begin + {$if not defined(i2d_PKCS8_PRIV_KEY_INFO_bio_allownil)} + i2d_PKCS8_PRIV_KEY_INFO_bio := @ERR_i2d_PKCS8_PRIV_KEY_INFO_bio; + {$ifend} + {$if declared(i2d_PKCS8_PRIV_KEY_INFO_bio_introduced)} + if LibVersion < i2d_PKCS8_PRIV_KEY_INFO_bio_introduced then + begin + {$if declared(FC_i2d_PKCS8_PRIV_KEY_INFO_bio)} + i2d_PKCS8_PRIV_KEY_INFO_bio := @FC_i2d_PKCS8_PRIV_KEY_INFO_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(i2d_PKCS8_PRIV_KEY_INFO_bio_removed)} + if i2d_PKCS8_PRIV_KEY_INFO_bio_removed <= LibVersion then + begin + {$if declared(_i2d_PKCS8_PRIV_KEY_INFO_bio)} + i2d_PKCS8_PRIV_KEY_INFO_bio := @_i2d_PKCS8_PRIV_KEY_INFO_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(i2d_PKCS8_PRIV_KEY_INFO_bio_allownil)} + if FuncLoadError then + AFailed.Add('i2d_PKCS8_PRIV_KEY_INFO_bio'); + {$ifend} + end; + + + i2d_PKCS8PrivateKeyInfo_bio := LoadLibFunction(ADllHandle, i2d_PKCS8PrivateKeyInfo_bio_procname); + FuncLoadError := not assigned(i2d_PKCS8PrivateKeyInfo_bio); + if FuncLoadError then + begin + {$if not defined(i2d_PKCS8PrivateKeyInfo_bio_allownil)} + i2d_PKCS8PrivateKeyInfo_bio := @ERR_i2d_PKCS8PrivateKeyInfo_bio; + {$ifend} + {$if declared(i2d_PKCS8PrivateKeyInfo_bio_introduced)} + if LibVersion < i2d_PKCS8PrivateKeyInfo_bio_introduced then + begin + {$if declared(FC_i2d_PKCS8PrivateKeyInfo_bio)} + i2d_PKCS8PrivateKeyInfo_bio := @FC_i2d_PKCS8PrivateKeyInfo_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(i2d_PKCS8PrivateKeyInfo_bio_removed)} + if i2d_PKCS8PrivateKeyInfo_bio_removed <= LibVersion then + begin + {$if declared(_i2d_PKCS8PrivateKeyInfo_bio)} + i2d_PKCS8PrivateKeyInfo_bio := @_i2d_PKCS8PrivateKeyInfo_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(i2d_PKCS8PrivateKeyInfo_bio_allownil)} + if FuncLoadError then + AFailed.Add('i2d_PKCS8PrivateKeyInfo_bio'); + {$ifend} + end; + + + i2d_PrivateKey_bio := LoadLibFunction(ADllHandle, i2d_PrivateKey_bio_procname); + FuncLoadError := not assigned(i2d_PrivateKey_bio); + if FuncLoadError then + begin + {$if not defined(i2d_PrivateKey_bio_allownil)} + i2d_PrivateKey_bio := @ERR_i2d_PrivateKey_bio; + {$ifend} + {$if declared(i2d_PrivateKey_bio_introduced)} + if LibVersion < i2d_PrivateKey_bio_introduced then + begin + {$if declared(FC_i2d_PrivateKey_bio)} + i2d_PrivateKey_bio := @FC_i2d_PrivateKey_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(i2d_PrivateKey_bio_removed)} + if i2d_PrivateKey_bio_removed <= LibVersion then + begin + {$if declared(_i2d_PrivateKey_bio)} + i2d_PrivateKey_bio := @_i2d_PrivateKey_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(i2d_PrivateKey_bio_allownil)} + if FuncLoadError then + AFailed.Add('i2d_PrivateKey_bio'); + {$ifend} + end; + + + d2i_PrivateKey_bio := LoadLibFunction(ADllHandle, d2i_PrivateKey_bio_procname); + FuncLoadError := not assigned(d2i_PrivateKey_bio); + if FuncLoadError then + begin + {$if not defined(d2i_PrivateKey_bio_allownil)} + d2i_PrivateKey_bio := @ERR_d2i_PrivateKey_bio; + {$ifend} + {$if declared(d2i_PrivateKey_bio_introduced)} + if LibVersion < d2i_PrivateKey_bio_introduced then + begin + {$if declared(FC_d2i_PrivateKey_bio)} + d2i_PrivateKey_bio := @FC_d2i_PrivateKey_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(d2i_PrivateKey_bio_removed)} + if d2i_PrivateKey_bio_removed <= LibVersion then + begin + {$if declared(_d2i_PrivateKey_bio)} + d2i_PrivateKey_bio := @_d2i_PrivateKey_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(d2i_PrivateKey_bio_allownil)} + if FuncLoadError then + AFailed.Add('d2i_PrivateKey_bio'); + {$ifend} + end; + + + i2d_PUBKEY_bio := LoadLibFunction(ADllHandle, i2d_PUBKEY_bio_procname); + FuncLoadError := not assigned(i2d_PUBKEY_bio); + if FuncLoadError then + begin + {$if not defined(i2d_PUBKEY_bio_allownil)} + i2d_PUBKEY_bio := @ERR_i2d_PUBKEY_bio; + {$ifend} + {$if declared(i2d_PUBKEY_bio_introduced)} + if LibVersion < i2d_PUBKEY_bio_introduced then + begin + {$if declared(FC_i2d_PUBKEY_bio)} + i2d_PUBKEY_bio := @FC_i2d_PUBKEY_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(i2d_PUBKEY_bio_removed)} + if i2d_PUBKEY_bio_removed <= LibVersion then + begin + {$if declared(_i2d_PUBKEY_bio)} + i2d_PUBKEY_bio := @_i2d_PUBKEY_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(i2d_PUBKEY_bio_allownil)} + if FuncLoadError then + AFailed.Add('i2d_PUBKEY_bio'); + {$ifend} + end; + + + d2i_PUBKEY_bio := LoadLibFunction(ADllHandle, d2i_PUBKEY_bio_procname); + FuncLoadError := not assigned(d2i_PUBKEY_bio); + if FuncLoadError then + begin + {$if not defined(d2i_PUBKEY_bio_allownil)} + d2i_PUBKEY_bio := @ERR_d2i_PUBKEY_bio; + {$ifend} + {$if declared(d2i_PUBKEY_bio_introduced)} + if LibVersion < d2i_PUBKEY_bio_introduced then + begin + {$if declared(FC_d2i_PUBKEY_bio)} + d2i_PUBKEY_bio := @FC_d2i_PUBKEY_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(d2i_PUBKEY_bio_removed)} + if d2i_PUBKEY_bio_removed <= LibVersion then + begin + {$if declared(_d2i_PUBKEY_bio)} + d2i_PUBKEY_bio := @_d2i_PUBKEY_bio; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(d2i_PUBKEY_bio_allownil)} + if FuncLoadError then + AFailed.Add('d2i_PUBKEY_bio'); + {$ifend} + end; + + + X509_dup := LoadLibFunction(ADllHandle, X509_dup_procname); + FuncLoadError := not assigned(X509_dup); + if FuncLoadError then + begin + {$if not defined(X509_dup_allownil)} + X509_dup := @ERR_X509_dup; + {$ifend} + {$if declared(X509_dup_introduced)} + if LibVersion < X509_dup_introduced then + begin + {$if declared(FC_X509_dup)} + X509_dup := @FC_X509_dup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_dup_removed)} + if X509_dup_removed <= LibVersion then + begin + {$if declared(_X509_dup)} + X509_dup := @_X509_dup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_dup_allownil)} + if FuncLoadError then + AFailed.Add('X509_dup'); + {$ifend} + end; + + + X509_ATTRIBUTE_dup := LoadLibFunction(ADllHandle, X509_ATTRIBUTE_dup_procname); + FuncLoadError := not assigned(X509_ATTRIBUTE_dup); + if FuncLoadError then + begin + {$if not defined(X509_ATTRIBUTE_dup_allownil)} + X509_ATTRIBUTE_dup := @ERR_X509_ATTRIBUTE_dup; + {$ifend} + {$if declared(X509_ATTRIBUTE_dup_introduced)} + if LibVersion < X509_ATTRIBUTE_dup_introduced then + begin + {$if declared(FC_X509_ATTRIBUTE_dup)} + X509_ATTRIBUTE_dup := @FC_X509_ATTRIBUTE_dup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_ATTRIBUTE_dup_removed)} + if X509_ATTRIBUTE_dup_removed <= LibVersion then + begin + {$if declared(_X509_ATTRIBUTE_dup)} + X509_ATTRIBUTE_dup := @_X509_ATTRIBUTE_dup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_ATTRIBUTE_dup_allownil)} + if FuncLoadError then + AFailed.Add('X509_ATTRIBUTE_dup'); + {$ifend} + end; + + + X509_EXTENSION_dup := LoadLibFunction(ADllHandle, X509_EXTENSION_dup_procname); + FuncLoadError := not assigned(X509_EXTENSION_dup); + if FuncLoadError then + begin + {$if not defined(X509_EXTENSION_dup_allownil)} + X509_EXTENSION_dup := @ERR_X509_EXTENSION_dup; + {$ifend} + {$if declared(X509_EXTENSION_dup_introduced)} + if LibVersion < X509_EXTENSION_dup_introduced then + begin + {$if declared(FC_X509_EXTENSION_dup)} + X509_EXTENSION_dup := @FC_X509_EXTENSION_dup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_EXTENSION_dup_removed)} + if X509_EXTENSION_dup_removed <= LibVersion then + begin + {$if declared(_X509_EXTENSION_dup)} + X509_EXTENSION_dup := @_X509_EXTENSION_dup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_EXTENSION_dup_allownil)} + if FuncLoadError then + AFailed.Add('X509_EXTENSION_dup'); + {$ifend} + end; + + + X509_CRL_dup := LoadLibFunction(ADllHandle, X509_CRL_dup_procname); + FuncLoadError := not assigned(X509_CRL_dup); + if FuncLoadError then + begin + {$if not defined(X509_CRL_dup_allownil)} + X509_CRL_dup := @ERR_X509_CRL_dup; + {$ifend} + {$if declared(X509_CRL_dup_introduced)} + if LibVersion < X509_CRL_dup_introduced then + begin + {$if declared(FC_X509_CRL_dup)} + X509_CRL_dup := @FC_X509_CRL_dup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_CRL_dup_removed)} + if X509_CRL_dup_removed <= LibVersion then + begin + {$if declared(_X509_CRL_dup)} + X509_CRL_dup := @_X509_CRL_dup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_CRL_dup_allownil)} + if FuncLoadError then + AFailed.Add('X509_CRL_dup'); + {$ifend} + end; + + + X509_REVOKED_dup := LoadLibFunction(ADllHandle, X509_REVOKED_dup_procname); + FuncLoadError := not assigned(X509_REVOKED_dup); + if FuncLoadError then + begin + {$if not defined(X509_REVOKED_dup_allownil)} + X509_REVOKED_dup := @ERR_X509_REVOKED_dup; + {$ifend} + {$if declared(X509_REVOKED_dup_introduced)} + if LibVersion < X509_REVOKED_dup_introduced then + begin + {$if declared(FC_X509_REVOKED_dup)} + X509_REVOKED_dup := @FC_X509_REVOKED_dup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_REVOKED_dup_removed)} + if X509_REVOKED_dup_removed <= LibVersion then + begin + {$if declared(_X509_REVOKED_dup)} + X509_REVOKED_dup := @_X509_REVOKED_dup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_REVOKED_dup_allownil)} + if FuncLoadError then + AFailed.Add('X509_REVOKED_dup'); + {$ifend} + end; + + + X509_REQ_dup := LoadLibFunction(ADllHandle, X509_REQ_dup_procname); + FuncLoadError := not assigned(X509_REQ_dup); + if FuncLoadError then + begin + {$if not defined(X509_REQ_dup_allownil)} + X509_REQ_dup := @ERR_X509_REQ_dup; + {$ifend} + {$if declared(X509_REQ_dup_introduced)} + if LibVersion < X509_REQ_dup_introduced then + begin + {$if declared(FC_X509_REQ_dup)} + X509_REQ_dup := @FC_X509_REQ_dup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_REQ_dup_removed)} + if X509_REQ_dup_removed <= LibVersion then + begin + {$if declared(_X509_REQ_dup)} + X509_REQ_dup := @_X509_REQ_dup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_REQ_dup_allownil)} + if FuncLoadError then + AFailed.Add('X509_REQ_dup'); + {$ifend} + end; + + + X509_ALGOR_dup := LoadLibFunction(ADllHandle, X509_ALGOR_dup_procname); + FuncLoadError := not assigned(X509_ALGOR_dup); + if FuncLoadError then + begin + {$if not defined(X509_ALGOR_dup_allownil)} + X509_ALGOR_dup := @ERR_X509_ALGOR_dup; + {$ifend} + {$if declared(X509_ALGOR_dup_introduced)} + if LibVersion < X509_ALGOR_dup_introduced then + begin + {$if declared(FC_X509_ALGOR_dup)} + X509_ALGOR_dup := @FC_X509_ALGOR_dup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_ALGOR_dup_removed)} + if X509_ALGOR_dup_removed <= LibVersion then + begin + {$if declared(_X509_ALGOR_dup)} + X509_ALGOR_dup := @_X509_ALGOR_dup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_ALGOR_dup_allownil)} + if FuncLoadError then + AFailed.Add('X509_ALGOR_dup'); + {$ifend} + end; + + + X509_ALGOR_set0 := LoadLibFunction(ADllHandle, X509_ALGOR_set0_procname); + FuncLoadError := not assigned(X509_ALGOR_set0); + if FuncLoadError then + begin + {$if not defined(X509_ALGOR_set0_allownil)} + X509_ALGOR_set0 := @ERR_X509_ALGOR_set0; + {$ifend} + {$if declared(X509_ALGOR_set0_introduced)} + if LibVersion < X509_ALGOR_set0_introduced then + begin + {$if declared(FC_X509_ALGOR_set0)} + X509_ALGOR_set0 := @FC_X509_ALGOR_set0; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_ALGOR_set0_removed)} + if X509_ALGOR_set0_removed <= LibVersion then + begin + {$if declared(_X509_ALGOR_set0)} + X509_ALGOR_set0 := @_X509_ALGOR_set0; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_ALGOR_set0_allownil)} + if FuncLoadError then + AFailed.Add('X509_ALGOR_set0'); + {$ifend} + end; + + + X509_ALGOR_get0 := LoadLibFunction(ADllHandle, X509_ALGOR_get0_procname); + FuncLoadError := not assigned(X509_ALGOR_get0); + if FuncLoadError then + begin + {$if not defined(X509_ALGOR_get0_allownil)} + X509_ALGOR_get0 := @ERR_X509_ALGOR_get0; + {$ifend} + {$if declared(X509_ALGOR_get0_introduced)} + if LibVersion < X509_ALGOR_get0_introduced then + begin + {$if declared(FC_X509_ALGOR_get0)} + X509_ALGOR_get0 := @FC_X509_ALGOR_get0; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_ALGOR_get0_removed)} + if X509_ALGOR_get0_removed <= LibVersion then + begin + {$if declared(_X509_ALGOR_get0)} + X509_ALGOR_get0 := @_X509_ALGOR_get0; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_ALGOR_get0_allownil)} + if FuncLoadError then + AFailed.Add('X509_ALGOR_get0'); + {$ifend} + end; + + + X509_ALGOR_set_md := LoadLibFunction(ADllHandle, X509_ALGOR_set_md_procname); + FuncLoadError := not assigned(X509_ALGOR_set_md); + if FuncLoadError then + begin + {$if not defined(X509_ALGOR_set_md_allownil)} + X509_ALGOR_set_md := @ERR_X509_ALGOR_set_md; + {$ifend} + {$if declared(X509_ALGOR_set_md_introduced)} + if LibVersion < X509_ALGOR_set_md_introduced then + begin + {$if declared(FC_X509_ALGOR_set_md)} + X509_ALGOR_set_md := @FC_X509_ALGOR_set_md; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_ALGOR_set_md_removed)} + if X509_ALGOR_set_md_removed <= LibVersion then + begin + {$if declared(_X509_ALGOR_set_md)} + X509_ALGOR_set_md := @_X509_ALGOR_set_md; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_ALGOR_set_md_allownil)} + if FuncLoadError then + AFailed.Add('X509_ALGOR_set_md'); + {$ifend} + end; + + + X509_ALGOR_cmp := LoadLibFunction(ADllHandle, X509_ALGOR_cmp_procname); + FuncLoadError := not assigned(X509_ALGOR_cmp); + if FuncLoadError then + begin + {$if not defined(X509_ALGOR_cmp_allownil)} + X509_ALGOR_cmp := @ERR_X509_ALGOR_cmp; + {$ifend} + {$if declared(X509_ALGOR_cmp_introduced)} + if LibVersion < X509_ALGOR_cmp_introduced then + begin + {$if declared(FC_X509_ALGOR_cmp)} + X509_ALGOR_cmp := @FC_X509_ALGOR_cmp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_ALGOR_cmp_removed)} + if X509_ALGOR_cmp_removed <= LibVersion then + begin + {$if declared(_X509_ALGOR_cmp)} + X509_ALGOR_cmp := @_X509_ALGOR_cmp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_ALGOR_cmp_allownil)} + if FuncLoadError then + AFailed.Add('X509_ALGOR_cmp'); + {$ifend} + end; + + + X509_NAME_dup := LoadLibFunction(ADllHandle, X509_NAME_dup_procname); + FuncLoadError := not assigned(X509_NAME_dup); + if FuncLoadError then + begin + {$if not defined(X509_NAME_dup_allownil)} + X509_NAME_dup := @ERR_X509_NAME_dup; + {$ifend} + {$if declared(X509_NAME_dup_introduced)} + if LibVersion < X509_NAME_dup_introduced then + begin + {$if declared(FC_X509_NAME_dup)} + X509_NAME_dup := @FC_X509_NAME_dup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_NAME_dup_removed)} + if X509_NAME_dup_removed <= LibVersion then + begin + {$if declared(_X509_NAME_dup)} + X509_NAME_dup := @_X509_NAME_dup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_NAME_dup_allownil)} + if FuncLoadError then + AFailed.Add('X509_NAME_dup'); + {$ifend} + end; + + + X509_NAME_ENTRY_dup := LoadLibFunction(ADllHandle, X509_NAME_ENTRY_dup_procname); + FuncLoadError := not assigned(X509_NAME_ENTRY_dup); + if FuncLoadError then + begin + {$if not defined(X509_NAME_ENTRY_dup_allownil)} + X509_NAME_ENTRY_dup := @ERR_X509_NAME_ENTRY_dup; + {$ifend} + {$if declared(X509_NAME_ENTRY_dup_introduced)} + if LibVersion < X509_NAME_ENTRY_dup_introduced then + begin + {$if declared(FC_X509_NAME_ENTRY_dup)} + X509_NAME_ENTRY_dup := @FC_X509_NAME_ENTRY_dup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_NAME_ENTRY_dup_removed)} + if X509_NAME_ENTRY_dup_removed <= LibVersion then + begin + {$if declared(_X509_NAME_ENTRY_dup)} + X509_NAME_ENTRY_dup := @_X509_NAME_ENTRY_dup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_NAME_ENTRY_dup_allownil)} + if FuncLoadError then + AFailed.Add('X509_NAME_ENTRY_dup'); + {$ifend} + end; + + + X509_cmp_time := LoadLibFunction(ADllHandle, X509_cmp_time_procname); + FuncLoadError := not assigned(X509_cmp_time); + if FuncLoadError then + begin + {$if not defined(X509_cmp_time_allownil)} + X509_cmp_time := @ERR_X509_cmp_time; + {$ifend} + {$if declared(X509_cmp_time_introduced)} + if LibVersion < X509_cmp_time_introduced then + begin + {$if declared(FC_X509_cmp_time)} + X509_cmp_time := @FC_X509_cmp_time; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_cmp_time_removed)} + if X509_cmp_time_removed <= LibVersion then + begin + {$if declared(_X509_cmp_time)} + X509_cmp_time := @_X509_cmp_time; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_cmp_time_allownil)} + if FuncLoadError then + AFailed.Add('X509_cmp_time'); + {$ifend} + end; + + + X509_cmp_current_time := LoadLibFunction(ADllHandle, X509_cmp_current_time_procname); + FuncLoadError := not assigned(X509_cmp_current_time); + if FuncLoadError then + begin + {$if not defined(X509_cmp_current_time_allownil)} + X509_cmp_current_time := @ERR_X509_cmp_current_time; + {$ifend} + {$if declared(X509_cmp_current_time_introduced)} + if LibVersion < X509_cmp_current_time_introduced then + begin + {$if declared(FC_X509_cmp_current_time)} + X509_cmp_current_time := @FC_X509_cmp_current_time; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_cmp_current_time_removed)} + if X509_cmp_current_time_removed <= LibVersion then + begin + {$if declared(_X509_cmp_current_time)} + X509_cmp_current_time := @_X509_cmp_current_time; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_cmp_current_time_allownil)} + if FuncLoadError then + AFailed.Add('X509_cmp_current_time'); + {$ifend} + end; + + + X509_time_adj := LoadLibFunction(ADllHandle, X509_time_adj_procname); + FuncLoadError := not assigned(X509_time_adj); + if FuncLoadError then + begin + {$if not defined(X509_time_adj_allownil)} + X509_time_adj := @ERR_X509_time_adj; + {$ifend} + {$if declared(X509_time_adj_introduced)} + if LibVersion < X509_time_adj_introduced then + begin + {$if declared(FC_X509_time_adj)} + X509_time_adj := @FC_X509_time_adj; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_time_adj_removed)} + if X509_time_adj_removed <= LibVersion then + begin + {$if declared(_X509_time_adj)} + X509_time_adj := @_X509_time_adj; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_time_adj_allownil)} + if FuncLoadError then + AFailed.Add('X509_time_adj'); + {$ifend} + end; + + + X509_time_adj_ex := LoadLibFunction(ADllHandle, X509_time_adj_ex_procname); + FuncLoadError := not assigned(X509_time_adj_ex); + if FuncLoadError then + begin + {$if not defined(X509_time_adj_ex_allownil)} + X509_time_adj_ex := @ERR_X509_time_adj_ex; + {$ifend} + {$if declared(X509_time_adj_ex_introduced)} + if LibVersion < X509_time_adj_ex_introduced then + begin + {$if declared(FC_X509_time_adj_ex)} + X509_time_adj_ex := @FC_X509_time_adj_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_time_adj_ex_removed)} + if X509_time_adj_ex_removed <= LibVersion then + begin + {$if declared(_X509_time_adj_ex)} + X509_time_adj_ex := @_X509_time_adj_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_time_adj_ex_allownil)} + if FuncLoadError then + AFailed.Add('X509_time_adj_ex'); + {$ifend} + end; + + + X509_gmtime_adj := LoadLibFunction(ADllHandle, X509_gmtime_adj_procname); + FuncLoadError := not assigned(X509_gmtime_adj); + if FuncLoadError then + begin + {$if not defined(X509_gmtime_adj_allownil)} + X509_gmtime_adj := @ERR_X509_gmtime_adj; + {$ifend} + {$if declared(X509_gmtime_adj_introduced)} + if LibVersion < X509_gmtime_adj_introduced then + begin + {$if declared(FC_X509_gmtime_adj)} + X509_gmtime_adj := @FC_X509_gmtime_adj; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_gmtime_adj_removed)} + if X509_gmtime_adj_removed <= LibVersion then + begin + {$if declared(_X509_gmtime_adj)} + X509_gmtime_adj := @_X509_gmtime_adj; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_gmtime_adj_allownil)} + if FuncLoadError then + AFailed.Add('X509_gmtime_adj'); + {$ifend} + end; + + + X509_get_default_cert_area := LoadLibFunction(ADllHandle, X509_get_default_cert_area_procname); + FuncLoadError := not assigned(X509_get_default_cert_area); + if FuncLoadError then + begin + {$if not defined(X509_get_default_cert_area_allownil)} + X509_get_default_cert_area := @ERR_X509_get_default_cert_area; + {$ifend} + {$if declared(X509_get_default_cert_area_introduced)} + if LibVersion < X509_get_default_cert_area_introduced then + begin + {$if declared(FC_X509_get_default_cert_area)} + X509_get_default_cert_area := @FC_X509_get_default_cert_area; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_get_default_cert_area_removed)} + if X509_get_default_cert_area_removed <= LibVersion then + begin + {$if declared(_X509_get_default_cert_area)} + X509_get_default_cert_area := @_X509_get_default_cert_area; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_get_default_cert_area_allownil)} + if FuncLoadError then + AFailed.Add('X509_get_default_cert_area'); + {$ifend} + end; + + + X509_get_default_cert_dir := LoadLibFunction(ADllHandle, X509_get_default_cert_dir_procname); + FuncLoadError := not assigned(X509_get_default_cert_dir); + if FuncLoadError then + begin + {$if not defined(X509_get_default_cert_dir_allownil)} + X509_get_default_cert_dir := @ERR_X509_get_default_cert_dir; + {$ifend} + {$if declared(X509_get_default_cert_dir_introduced)} + if LibVersion < X509_get_default_cert_dir_introduced then + begin + {$if declared(FC_X509_get_default_cert_dir)} + X509_get_default_cert_dir := @FC_X509_get_default_cert_dir; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_get_default_cert_dir_removed)} + if X509_get_default_cert_dir_removed <= LibVersion then + begin + {$if declared(_X509_get_default_cert_dir)} + X509_get_default_cert_dir := @_X509_get_default_cert_dir; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_get_default_cert_dir_allownil)} + if FuncLoadError then + AFailed.Add('X509_get_default_cert_dir'); + {$ifend} + end; + + + X509_get_default_cert_file := LoadLibFunction(ADllHandle, X509_get_default_cert_file_procname); + FuncLoadError := not assigned(X509_get_default_cert_file); + if FuncLoadError then + begin + {$if not defined(X509_get_default_cert_file_allownil)} + X509_get_default_cert_file := @ERR_X509_get_default_cert_file; + {$ifend} + {$if declared(X509_get_default_cert_file_introduced)} + if LibVersion < X509_get_default_cert_file_introduced then + begin + {$if declared(FC_X509_get_default_cert_file)} + X509_get_default_cert_file := @FC_X509_get_default_cert_file; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_get_default_cert_file_removed)} + if X509_get_default_cert_file_removed <= LibVersion then + begin + {$if declared(_X509_get_default_cert_file)} + X509_get_default_cert_file := @_X509_get_default_cert_file; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_get_default_cert_file_allownil)} + if FuncLoadError then + AFailed.Add('X509_get_default_cert_file'); + {$ifend} + end; + + + X509_get_default_cert_dir_env := LoadLibFunction(ADllHandle, X509_get_default_cert_dir_env_procname); + FuncLoadError := not assigned(X509_get_default_cert_dir_env); + if FuncLoadError then + begin + {$if not defined(X509_get_default_cert_dir_env_allownil)} + X509_get_default_cert_dir_env := @ERR_X509_get_default_cert_dir_env; + {$ifend} + {$if declared(X509_get_default_cert_dir_env_introduced)} + if LibVersion < X509_get_default_cert_dir_env_introduced then + begin + {$if declared(FC_X509_get_default_cert_dir_env)} + X509_get_default_cert_dir_env := @FC_X509_get_default_cert_dir_env; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_get_default_cert_dir_env_removed)} + if X509_get_default_cert_dir_env_removed <= LibVersion then + begin + {$if declared(_X509_get_default_cert_dir_env)} + X509_get_default_cert_dir_env := @_X509_get_default_cert_dir_env; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_get_default_cert_dir_env_allownil)} + if FuncLoadError then + AFailed.Add('X509_get_default_cert_dir_env'); + {$ifend} + end; + + + X509_get_default_cert_file_env := LoadLibFunction(ADllHandle, X509_get_default_cert_file_env_procname); + FuncLoadError := not assigned(X509_get_default_cert_file_env); + if FuncLoadError then + begin + {$if not defined(X509_get_default_cert_file_env_allownil)} + X509_get_default_cert_file_env := @ERR_X509_get_default_cert_file_env; + {$ifend} + {$if declared(X509_get_default_cert_file_env_introduced)} + if LibVersion < X509_get_default_cert_file_env_introduced then + begin + {$if declared(FC_X509_get_default_cert_file_env)} + X509_get_default_cert_file_env := @FC_X509_get_default_cert_file_env; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_get_default_cert_file_env_removed)} + if X509_get_default_cert_file_env_removed <= LibVersion then + begin + {$if declared(_X509_get_default_cert_file_env)} + X509_get_default_cert_file_env := @_X509_get_default_cert_file_env; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_get_default_cert_file_env_allownil)} + if FuncLoadError then + AFailed.Add('X509_get_default_cert_file_env'); + {$ifend} + end; + + + X509_get_default_private_dir := LoadLibFunction(ADllHandle, X509_get_default_private_dir_procname); + FuncLoadError := not assigned(X509_get_default_private_dir); + if FuncLoadError then + begin + {$if not defined(X509_get_default_private_dir_allownil)} + X509_get_default_private_dir := @ERR_X509_get_default_private_dir; + {$ifend} + {$if declared(X509_get_default_private_dir_introduced)} + if LibVersion < X509_get_default_private_dir_introduced then + begin + {$if declared(FC_X509_get_default_private_dir)} + X509_get_default_private_dir := @FC_X509_get_default_private_dir; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_get_default_private_dir_removed)} + if X509_get_default_private_dir_removed <= LibVersion then + begin + {$if declared(_X509_get_default_private_dir)} + X509_get_default_private_dir := @_X509_get_default_private_dir; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_get_default_private_dir_allownil)} + if FuncLoadError then + AFailed.Add('X509_get_default_private_dir'); + {$ifend} + end; + + + X509_to_X509_REQ := LoadLibFunction(ADllHandle, X509_to_X509_REQ_procname); + FuncLoadError := not assigned(X509_to_X509_REQ); + if FuncLoadError then + begin + {$if not defined(X509_to_X509_REQ_allownil)} + X509_to_X509_REQ := @ERR_X509_to_X509_REQ; + {$ifend} + {$if declared(X509_to_X509_REQ_introduced)} + if LibVersion < X509_to_X509_REQ_introduced then + begin + {$if declared(FC_X509_to_X509_REQ)} + X509_to_X509_REQ := @FC_X509_to_X509_REQ; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_to_X509_REQ_removed)} + if X509_to_X509_REQ_removed <= LibVersion then + begin + {$if declared(_X509_to_X509_REQ)} + X509_to_X509_REQ := @_X509_to_X509_REQ; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_to_X509_REQ_allownil)} + if FuncLoadError then + AFailed.Add('X509_to_X509_REQ'); + {$ifend} + end; + + + X509_REQ_to_X509 := LoadLibFunction(ADllHandle, X509_REQ_to_X509_procname); + FuncLoadError := not assigned(X509_REQ_to_X509); + if FuncLoadError then + begin + {$if not defined(X509_REQ_to_X509_allownil)} + X509_REQ_to_X509 := @ERR_X509_REQ_to_X509; + {$ifend} + {$if declared(X509_REQ_to_X509_introduced)} + if LibVersion < X509_REQ_to_X509_introduced then + begin + {$if declared(FC_X509_REQ_to_X509)} + X509_REQ_to_X509 := @FC_X509_REQ_to_X509; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_REQ_to_X509_removed)} + if X509_REQ_to_X509_removed <= LibVersion then + begin + {$if declared(_X509_REQ_to_X509)} + X509_REQ_to_X509 := @_X509_REQ_to_X509; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_REQ_to_X509_allownil)} + if FuncLoadError then + AFailed.Add('X509_REQ_to_X509'); + {$ifend} + end; + + + X509_ALGOR_new := LoadLibFunction(ADllHandle, X509_ALGOR_new_procname); + FuncLoadError := not assigned(X509_ALGOR_new); + if FuncLoadError then + begin + {$if not defined(X509_ALGOR_new_allownil)} + X509_ALGOR_new := @ERR_X509_ALGOR_new; + {$ifend} + {$if declared(X509_ALGOR_new_introduced)} + if LibVersion < X509_ALGOR_new_introduced then + begin + {$if declared(FC_X509_ALGOR_new)} + X509_ALGOR_new := @FC_X509_ALGOR_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_ALGOR_new_removed)} + if X509_ALGOR_new_removed <= LibVersion then + begin + {$if declared(_X509_ALGOR_new)} + X509_ALGOR_new := @_X509_ALGOR_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_ALGOR_new_allownil)} + if FuncLoadError then + AFailed.Add('X509_ALGOR_new'); + {$ifend} + end; + + + X509_ALGOR_free := LoadLibFunction(ADllHandle, X509_ALGOR_free_procname); + FuncLoadError := not assigned(X509_ALGOR_free); + if FuncLoadError then + begin + {$if not defined(X509_ALGOR_free_allownil)} + X509_ALGOR_free := @ERR_X509_ALGOR_free; + {$ifend} + {$if declared(X509_ALGOR_free_introduced)} + if LibVersion < X509_ALGOR_free_introduced then + begin + {$if declared(FC_X509_ALGOR_free)} + X509_ALGOR_free := @FC_X509_ALGOR_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_ALGOR_free_removed)} + if X509_ALGOR_free_removed <= LibVersion then + begin + {$if declared(_X509_ALGOR_free)} + X509_ALGOR_free := @_X509_ALGOR_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_ALGOR_free_allownil)} + if FuncLoadError then + AFailed.Add('X509_ALGOR_free'); + {$ifend} + end; + + + d2i_X509_ALGOR := LoadLibFunction(ADllHandle, d2i_X509_ALGOR_procname); + FuncLoadError := not assigned(d2i_X509_ALGOR); + if FuncLoadError then + begin + {$if not defined(d2i_X509_ALGOR_allownil)} + d2i_X509_ALGOR := @ERR_d2i_X509_ALGOR; + {$ifend} + {$if declared(d2i_X509_ALGOR_introduced)} + if LibVersion < d2i_X509_ALGOR_introduced then + begin + {$if declared(FC_d2i_X509_ALGOR)} + d2i_X509_ALGOR := @FC_d2i_X509_ALGOR; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(d2i_X509_ALGOR_removed)} + if d2i_X509_ALGOR_removed <= LibVersion then + begin + {$if declared(_d2i_X509_ALGOR)} + d2i_X509_ALGOR := @_d2i_X509_ALGOR; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(d2i_X509_ALGOR_allownil)} + if FuncLoadError then + AFailed.Add('d2i_X509_ALGOR'); + {$ifend} + end; + + + i2d_X509_ALGOR := LoadLibFunction(ADllHandle, i2d_X509_ALGOR_procname); + FuncLoadError := not assigned(i2d_X509_ALGOR); + if FuncLoadError then + begin + {$if not defined(i2d_X509_ALGOR_allownil)} + i2d_X509_ALGOR := @ERR_i2d_X509_ALGOR; + {$ifend} + {$if declared(i2d_X509_ALGOR_introduced)} + if LibVersion < i2d_X509_ALGOR_introduced then + begin + {$if declared(FC_i2d_X509_ALGOR)} + i2d_X509_ALGOR := @FC_i2d_X509_ALGOR; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(i2d_X509_ALGOR_removed)} + if i2d_X509_ALGOR_removed <= LibVersion then + begin + {$if declared(_i2d_X509_ALGOR)} + i2d_X509_ALGOR := @_i2d_X509_ALGOR; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(i2d_X509_ALGOR_allownil)} + if FuncLoadError then + AFailed.Add('i2d_X509_ALGOR'); + {$ifend} + end; + + + X509_VAL_new := LoadLibFunction(ADllHandle, X509_VAL_new_procname); + FuncLoadError := not assigned(X509_VAL_new); + if FuncLoadError then + begin + {$if not defined(X509_VAL_new_allownil)} + X509_VAL_new := @ERR_X509_VAL_new; + {$ifend} + {$if declared(X509_VAL_new_introduced)} + if LibVersion < X509_VAL_new_introduced then + begin + {$if declared(FC_X509_VAL_new)} + X509_VAL_new := @FC_X509_VAL_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_VAL_new_removed)} + if X509_VAL_new_removed <= LibVersion then + begin + {$if declared(_X509_VAL_new)} + X509_VAL_new := @_X509_VAL_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_VAL_new_allownil)} + if FuncLoadError then + AFailed.Add('X509_VAL_new'); + {$ifend} + end; + + + X509_VAL_free := LoadLibFunction(ADllHandle, X509_VAL_free_procname); + FuncLoadError := not assigned(X509_VAL_free); + if FuncLoadError then + begin + {$if not defined(X509_VAL_free_allownil)} + X509_VAL_free := @ERR_X509_VAL_free; + {$ifend} + {$if declared(X509_VAL_free_introduced)} + if LibVersion < X509_VAL_free_introduced then + begin + {$if declared(FC_X509_VAL_free)} + X509_VAL_free := @FC_X509_VAL_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_VAL_free_removed)} + if X509_VAL_free_removed <= LibVersion then + begin + {$if declared(_X509_VAL_free)} + X509_VAL_free := @_X509_VAL_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_VAL_free_allownil)} + if FuncLoadError then + AFailed.Add('X509_VAL_free'); + {$ifend} + end; + + + d2i_X509_VAL := LoadLibFunction(ADllHandle, d2i_X509_VAL_procname); + FuncLoadError := not assigned(d2i_X509_VAL); + if FuncLoadError then + begin + {$if not defined(d2i_X509_VAL_allownil)} + d2i_X509_VAL := @ERR_d2i_X509_VAL; + {$ifend} + {$if declared(d2i_X509_VAL_introduced)} + if LibVersion < d2i_X509_VAL_introduced then + begin + {$if declared(FC_d2i_X509_VAL)} + d2i_X509_VAL := @FC_d2i_X509_VAL; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(d2i_X509_VAL_removed)} + if d2i_X509_VAL_removed <= LibVersion then + begin + {$if declared(_d2i_X509_VAL)} + d2i_X509_VAL := @_d2i_X509_VAL; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(d2i_X509_VAL_allownil)} + if FuncLoadError then + AFailed.Add('d2i_X509_VAL'); + {$ifend} + end; + + + i2d_X509_VAL := LoadLibFunction(ADllHandle, i2d_X509_VAL_procname); + FuncLoadError := not assigned(i2d_X509_VAL); + if FuncLoadError then + begin + {$if not defined(i2d_X509_VAL_allownil)} + i2d_X509_VAL := @ERR_i2d_X509_VAL; + {$ifend} + {$if declared(i2d_X509_VAL_introduced)} + if LibVersion < i2d_X509_VAL_introduced then + begin + {$if declared(FC_i2d_X509_VAL)} + i2d_X509_VAL := @FC_i2d_X509_VAL; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(i2d_X509_VAL_removed)} + if i2d_X509_VAL_removed <= LibVersion then + begin + {$if declared(_i2d_X509_VAL)} + i2d_X509_VAL := @_i2d_X509_VAL; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(i2d_X509_VAL_allownil)} + if FuncLoadError then + AFailed.Add('i2d_X509_VAL'); + {$ifend} + end; + + + X509_PUBKEY_new := LoadLibFunction(ADllHandle, X509_PUBKEY_new_procname); + FuncLoadError := not assigned(X509_PUBKEY_new); + if FuncLoadError then + begin + {$if not defined(X509_PUBKEY_new_allownil)} + X509_PUBKEY_new := @ERR_X509_PUBKEY_new; + {$ifend} + {$if declared(X509_PUBKEY_new_introduced)} + if LibVersion < X509_PUBKEY_new_introduced then + begin + {$if declared(FC_X509_PUBKEY_new)} + X509_PUBKEY_new := @FC_X509_PUBKEY_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_PUBKEY_new_removed)} + if X509_PUBKEY_new_removed <= LibVersion then + begin + {$if declared(_X509_PUBKEY_new)} + X509_PUBKEY_new := @_X509_PUBKEY_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_PUBKEY_new_allownil)} + if FuncLoadError then + AFailed.Add('X509_PUBKEY_new'); + {$ifend} + end; + + + X509_PUBKEY_free := LoadLibFunction(ADllHandle, X509_PUBKEY_free_procname); + FuncLoadError := not assigned(X509_PUBKEY_free); + if FuncLoadError then + begin + {$if not defined(X509_PUBKEY_free_allownil)} + X509_PUBKEY_free := @ERR_X509_PUBKEY_free; + {$ifend} + {$if declared(X509_PUBKEY_free_introduced)} + if LibVersion < X509_PUBKEY_free_introduced then + begin + {$if declared(FC_X509_PUBKEY_free)} + X509_PUBKEY_free := @FC_X509_PUBKEY_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_PUBKEY_free_removed)} + if X509_PUBKEY_free_removed <= LibVersion then + begin + {$if declared(_X509_PUBKEY_free)} + X509_PUBKEY_free := @_X509_PUBKEY_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_PUBKEY_free_allownil)} + if FuncLoadError then + AFailed.Add('X509_PUBKEY_free'); + {$ifend} + end; + + + d2i_X509_PUBKEY := LoadLibFunction(ADllHandle, d2i_X509_PUBKEY_procname); + FuncLoadError := not assigned(d2i_X509_PUBKEY); + if FuncLoadError then + begin + {$if not defined(d2i_X509_PUBKEY_allownil)} + d2i_X509_PUBKEY := @ERR_d2i_X509_PUBKEY; + {$ifend} + {$if declared(d2i_X509_PUBKEY_introduced)} + if LibVersion < d2i_X509_PUBKEY_introduced then + begin + {$if declared(FC_d2i_X509_PUBKEY)} + d2i_X509_PUBKEY := @FC_d2i_X509_PUBKEY; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(d2i_X509_PUBKEY_removed)} + if d2i_X509_PUBKEY_removed <= LibVersion then + begin + {$if declared(_d2i_X509_PUBKEY)} + d2i_X509_PUBKEY := @_d2i_X509_PUBKEY; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(d2i_X509_PUBKEY_allownil)} + if FuncLoadError then + AFailed.Add('d2i_X509_PUBKEY'); + {$ifend} + end; + + + i2d_X509_PUBKEY := LoadLibFunction(ADllHandle, i2d_X509_PUBKEY_procname); + FuncLoadError := not assigned(i2d_X509_PUBKEY); + if FuncLoadError then + begin + {$if not defined(i2d_X509_PUBKEY_allownil)} + i2d_X509_PUBKEY := @ERR_i2d_X509_PUBKEY; + {$ifend} + {$if declared(i2d_X509_PUBKEY_introduced)} + if LibVersion < i2d_X509_PUBKEY_introduced then + begin + {$if declared(FC_i2d_X509_PUBKEY)} + i2d_X509_PUBKEY := @FC_i2d_X509_PUBKEY; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(i2d_X509_PUBKEY_removed)} + if i2d_X509_PUBKEY_removed <= LibVersion then + begin + {$if declared(_i2d_X509_PUBKEY)} + i2d_X509_PUBKEY := @_i2d_X509_PUBKEY; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(i2d_X509_PUBKEY_allownil)} + if FuncLoadError then + AFailed.Add('i2d_X509_PUBKEY'); + {$ifend} + end; + + + X509_PUBKEY_set := LoadLibFunction(ADllHandle, X509_PUBKEY_set_procname); + FuncLoadError := not assigned(X509_PUBKEY_set); + if FuncLoadError then + begin + {$if not defined(X509_PUBKEY_set_allownil)} + X509_PUBKEY_set := @ERR_X509_PUBKEY_set; + {$ifend} + {$if declared(X509_PUBKEY_set_introduced)} + if LibVersion < X509_PUBKEY_set_introduced then + begin + {$if declared(FC_X509_PUBKEY_set)} + X509_PUBKEY_set := @FC_X509_PUBKEY_set; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_PUBKEY_set_removed)} + if X509_PUBKEY_set_removed <= LibVersion then + begin + {$if declared(_X509_PUBKEY_set)} + X509_PUBKEY_set := @_X509_PUBKEY_set; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_PUBKEY_set_allownil)} + if FuncLoadError then + AFailed.Add('X509_PUBKEY_set'); + {$ifend} + end; + + + X509_PUBKEY_get0 := LoadLibFunction(ADllHandle, X509_PUBKEY_get0_procname); + FuncLoadError := not assigned(X509_PUBKEY_get0); + if FuncLoadError then + begin + {$if not defined(X509_PUBKEY_get0_allownil)} + X509_PUBKEY_get0 := @ERR_X509_PUBKEY_get0; + {$ifend} + {$if declared(X509_PUBKEY_get0_introduced)} + if LibVersion < X509_PUBKEY_get0_introduced then + begin + {$if declared(FC_X509_PUBKEY_get0)} + X509_PUBKEY_get0 := @FC_X509_PUBKEY_get0; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_PUBKEY_get0_removed)} + if X509_PUBKEY_get0_removed <= LibVersion then + begin + {$if declared(_X509_PUBKEY_get0)} + X509_PUBKEY_get0 := @_X509_PUBKEY_get0; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_PUBKEY_get0_allownil)} + if FuncLoadError then + AFailed.Add('X509_PUBKEY_get0'); + {$ifend} + end; + + {introduced 1.1.0} + X509_PUBKEY_get := LoadLibFunction(ADllHandle, X509_PUBKEY_get_procname); + FuncLoadError := not assigned(X509_PUBKEY_get); + if FuncLoadError then + begin + {$if not defined(X509_PUBKEY_get_allownil)} + X509_PUBKEY_get := @ERR_X509_PUBKEY_get; + {$ifend} + {$if declared(X509_PUBKEY_get_introduced)} + if LibVersion < X509_PUBKEY_get_introduced then + begin + {$if declared(FC_X509_PUBKEY_get)} + X509_PUBKEY_get := @FC_X509_PUBKEY_get; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_PUBKEY_get_removed)} + if X509_PUBKEY_get_removed <= LibVersion then + begin + {$if declared(_X509_PUBKEY_get)} + X509_PUBKEY_get := @_X509_PUBKEY_get; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_PUBKEY_get_allownil)} + if FuncLoadError then + AFailed.Add('X509_PUBKEY_get'); + {$ifend} + end; + + + X509_get_pathlen := LoadLibFunction(ADllHandle, X509_get_pathlen_procname); + FuncLoadError := not assigned(X509_get_pathlen); + if FuncLoadError then + begin + {$if not defined(X509_get_pathlen_allownil)} + X509_get_pathlen := @ERR_X509_get_pathlen; + {$ifend} + {$if declared(X509_get_pathlen_introduced)} + if LibVersion < X509_get_pathlen_introduced then + begin + {$if declared(FC_X509_get_pathlen)} + X509_get_pathlen := @FC_X509_get_pathlen; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_get_pathlen_removed)} + if X509_get_pathlen_removed <= LibVersion then + begin + {$if declared(_X509_get_pathlen)} + X509_get_pathlen := @_X509_get_pathlen; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_get_pathlen_allownil)} + if FuncLoadError then + AFailed.Add('X509_get_pathlen'); + {$ifend} + end; + + {introduced 1.1.0} + i2d_PUBKEY := LoadLibFunction(ADllHandle, i2d_PUBKEY_procname); + FuncLoadError := not assigned(i2d_PUBKEY); + if FuncLoadError then + begin + {$if not defined(i2d_PUBKEY_allownil)} + i2d_PUBKEY := @ERR_i2d_PUBKEY; + {$ifend} + {$if declared(i2d_PUBKEY_introduced)} + if LibVersion < i2d_PUBKEY_introduced then + begin + {$if declared(FC_i2d_PUBKEY)} + i2d_PUBKEY := @FC_i2d_PUBKEY; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(i2d_PUBKEY_removed)} + if i2d_PUBKEY_removed <= LibVersion then + begin + {$if declared(_i2d_PUBKEY)} + i2d_PUBKEY := @_i2d_PUBKEY; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(i2d_PUBKEY_allownil)} + if FuncLoadError then + AFailed.Add('i2d_PUBKEY'); + {$ifend} + end; + + + d2i_PUBKEY := LoadLibFunction(ADllHandle, d2i_PUBKEY_procname); + FuncLoadError := not assigned(d2i_PUBKEY); + if FuncLoadError then + begin + {$if not defined(d2i_PUBKEY_allownil)} + d2i_PUBKEY := @ERR_d2i_PUBKEY; + {$ifend} + {$if declared(d2i_PUBKEY_introduced)} + if LibVersion < d2i_PUBKEY_introduced then + begin + {$if declared(FC_d2i_PUBKEY)} + d2i_PUBKEY := @FC_d2i_PUBKEY; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(d2i_PUBKEY_removed)} + if d2i_PUBKEY_removed <= LibVersion then + begin + {$if declared(_d2i_PUBKEY)} + d2i_PUBKEY := @_d2i_PUBKEY; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(d2i_PUBKEY_allownil)} + if FuncLoadError then + AFailed.Add('d2i_PUBKEY'); + {$ifend} + end; + + + i2d_RSA_PUBKEY := LoadLibFunction(ADllHandle, i2d_RSA_PUBKEY_procname); + FuncLoadError := not assigned(i2d_RSA_PUBKEY); + if FuncLoadError then + begin + {$if not defined(i2d_RSA_PUBKEY_allownil)} + i2d_RSA_PUBKEY := @ERR_i2d_RSA_PUBKEY; + {$ifend} + {$if declared(i2d_RSA_PUBKEY_introduced)} + if LibVersion < i2d_RSA_PUBKEY_introduced then + begin + {$if declared(FC_i2d_RSA_PUBKEY)} + i2d_RSA_PUBKEY := @FC_i2d_RSA_PUBKEY; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(i2d_RSA_PUBKEY_removed)} + if i2d_RSA_PUBKEY_removed <= LibVersion then + begin + {$if declared(_i2d_RSA_PUBKEY)} + i2d_RSA_PUBKEY := @_i2d_RSA_PUBKEY; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(i2d_RSA_PUBKEY_allownil)} + if FuncLoadError then + AFailed.Add('i2d_RSA_PUBKEY'); + {$ifend} + end; + + + d2i_RSA_PUBKEY := LoadLibFunction(ADllHandle, d2i_RSA_PUBKEY_procname); + FuncLoadError := not assigned(d2i_RSA_PUBKEY); + if FuncLoadError then + begin + {$if not defined(d2i_RSA_PUBKEY_allownil)} + d2i_RSA_PUBKEY := @ERR_d2i_RSA_PUBKEY; + {$ifend} + {$if declared(d2i_RSA_PUBKEY_introduced)} + if LibVersion < d2i_RSA_PUBKEY_introduced then + begin + {$if declared(FC_d2i_RSA_PUBKEY)} + d2i_RSA_PUBKEY := @FC_d2i_RSA_PUBKEY; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(d2i_RSA_PUBKEY_removed)} + if d2i_RSA_PUBKEY_removed <= LibVersion then + begin + {$if declared(_d2i_RSA_PUBKEY)} + d2i_RSA_PUBKEY := @_d2i_RSA_PUBKEY; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(d2i_RSA_PUBKEY_allownil)} + if FuncLoadError then + AFailed.Add('d2i_RSA_PUBKEY'); + {$ifend} + end; + + + i2d_DSA_PUBKEY := LoadLibFunction(ADllHandle, i2d_DSA_PUBKEY_procname); + FuncLoadError := not assigned(i2d_DSA_PUBKEY); + if FuncLoadError then + begin + {$if not defined(i2d_DSA_PUBKEY_allownil)} + i2d_DSA_PUBKEY := @ERR_i2d_DSA_PUBKEY; + {$ifend} + {$if declared(i2d_DSA_PUBKEY_introduced)} + if LibVersion < i2d_DSA_PUBKEY_introduced then + begin + {$if declared(FC_i2d_DSA_PUBKEY)} + i2d_DSA_PUBKEY := @FC_i2d_DSA_PUBKEY; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(i2d_DSA_PUBKEY_removed)} + if i2d_DSA_PUBKEY_removed <= LibVersion then + begin + {$if declared(_i2d_DSA_PUBKEY)} + i2d_DSA_PUBKEY := @_i2d_DSA_PUBKEY; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(i2d_DSA_PUBKEY_allownil)} + if FuncLoadError then + AFailed.Add('i2d_DSA_PUBKEY'); + {$ifend} + end; + + + d2i_DSA_PUBKEY := LoadLibFunction(ADllHandle, d2i_DSA_PUBKEY_procname); + FuncLoadError := not assigned(d2i_DSA_PUBKEY); + if FuncLoadError then + begin + {$if not defined(d2i_DSA_PUBKEY_allownil)} + d2i_DSA_PUBKEY := @ERR_d2i_DSA_PUBKEY; + {$ifend} + {$if declared(d2i_DSA_PUBKEY_introduced)} + if LibVersion < d2i_DSA_PUBKEY_introduced then + begin + {$if declared(FC_d2i_DSA_PUBKEY)} + d2i_DSA_PUBKEY := @FC_d2i_DSA_PUBKEY; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(d2i_DSA_PUBKEY_removed)} + if d2i_DSA_PUBKEY_removed <= LibVersion then + begin + {$if declared(_d2i_DSA_PUBKEY)} + d2i_DSA_PUBKEY := @_d2i_DSA_PUBKEY; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(d2i_DSA_PUBKEY_allownil)} + if FuncLoadError then + AFailed.Add('d2i_DSA_PUBKEY'); + {$ifend} + end; + + + i2d_EC_PUBKEY := LoadLibFunction(ADllHandle, i2d_EC_PUBKEY_procname); + FuncLoadError := not assigned(i2d_EC_PUBKEY); + if FuncLoadError then + begin + {$if not defined(i2d_EC_PUBKEY_allownil)} + i2d_EC_PUBKEY := @ERR_i2d_EC_PUBKEY; + {$ifend} + {$if declared(i2d_EC_PUBKEY_introduced)} + if LibVersion < i2d_EC_PUBKEY_introduced then + begin + {$if declared(FC_i2d_EC_PUBKEY)} + i2d_EC_PUBKEY := @FC_i2d_EC_PUBKEY; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(i2d_EC_PUBKEY_removed)} + if i2d_EC_PUBKEY_removed <= LibVersion then + begin + {$if declared(_i2d_EC_PUBKEY)} + i2d_EC_PUBKEY := @_i2d_EC_PUBKEY; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(i2d_EC_PUBKEY_allownil)} + if FuncLoadError then + AFailed.Add('i2d_EC_PUBKEY'); + {$ifend} + end; + + + d2i_EC_PUBKEY := LoadLibFunction(ADllHandle, d2i_EC_PUBKEY_procname); + FuncLoadError := not assigned(d2i_EC_PUBKEY); + if FuncLoadError then + begin + {$if not defined(d2i_EC_PUBKEY_allownil)} + d2i_EC_PUBKEY := @ERR_d2i_EC_PUBKEY; + {$ifend} + {$if declared(d2i_EC_PUBKEY_introduced)} + if LibVersion < d2i_EC_PUBKEY_introduced then + begin + {$if declared(FC_d2i_EC_PUBKEY)} + d2i_EC_PUBKEY := @FC_d2i_EC_PUBKEY; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(d2i_EC_PUBKEY_removed)} + if d2i_EC_PUBKEY_removed <= LibVersion then + begin + {$if declared(_d2i_EC_PUBKEY)} + d2i_EC_PUBKEY := @_d2i_EC_PUBKEY; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(d2i_EC_PUBKEY_allownil)} + if FuncLoadError then + AFailed.Add('d2i_EC_PUBKEY'); + {$ifend} + end; + + + X509_SIG_new := LoadLibFunction(ADllHandle, X509_SIG_new_procname); + FuncLoadError := not assigned(X509_SIG_new); + if FuncLoadError then + begin + {$if not defined(X509_SIG_new_allownil)} + X509_SIG_new := @ERR_X509_SIG_new; + {$ifend} + {$if declared(X509_SIG_new_introduced)} + if LibVersion < X509_SIG_new_introduced then + begin + {$if declared(FC_X509_SIG_new)} + X509_SIG_new := @FC_X509_SIG_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_SIG_new_removed)} + if X509_SIG_new_removed <= LibVersion then + begin + {$if declared(_X509_SIG_new)} + X509_SIG_new := @_X509_SIG_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_SIG_new_allownil)} + if FuncLoadError then + AFailed.Add('X509_SIG_new'); + {$ifend} + end; + + + X509_SIG_free := LoadLibFunction(ADllHandle, X509_SIG_free_procname); + FuncLoadError := not assigned(X509_SIG_free); + if FuncLoadError then + begin + {$if not defined(X509_SIG_free_allownil)} + X509_SIG_free := @ERR_X509_SIG_free; + {$ifend} + {$if declared(X509_SIG_free_introduced)} + if LibVersion < X509_SIG_free_introduced then + begin + {$if declared(FC_X509_SIG_free)} + X509_SIG_free := @FC_X509_SIG_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_SIG_free_removed)} + if X509_SIG_free_removed <= LibVersion then + begin + {$if declared(_X509_SIG_free)} + X509_SIG_free := @_X509_SIG_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_SIG_free_allownil)} + if FuncLoadError then + AFailed.Add('X509_SIG_free'); + {$ifend} + end; + + + d2i_X509_SIG := LoadLibFunction(ADllHandle, d2i_X509_SIG_procname); + FuncLoadError := not assigned(d2i_X509_SIG); + if FuncLoadError then + begin + {$if not defined(d2i_X509_SIG_allownil)} + d2i_X509_SIG := @ERR_d2i_X509_SIG; + {$ifend} + {$if declared(d2i_X509_SIG_introduced)} + if LibVersion < d2i_X509_SIG_introduced then + begin + {$if declared(FC_d2i_X509_SIG)} + d2i_X509_SIG := @FC_d2i_X509_SIG; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(d2i_X509_SIG_removed)} + if d2i_X509_SIG_removed <= LibVersion then + begin + {$if declared(_d2i_X509_SIG)} + d2i_X509_SIG := @_d2i_X509_SIG; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(d2i_X509_SIG_allownil)} + if FuncLoadError then + AFailed.Add('d2i_X509_SIG'); + {$ifend} + end; + + + i2d_X509_SIG := LoadLibFunction(ADllHandle, i2d_X509_SIG_procname); + FuncLoadError := not assigned(i2d_X509_SIG); + if FuncLoadError then + begin + {$if not defined(i2d_X509_SIG_allownil)} + i2d_X509_SIG := @ERR_i2d_X509_SIG; + {$ifend} + {$if declared(i2d_X509_SIG_introduced)} + if LibVersion < i2d_X509_SIG_introduced then + begin + {$if declared(FC_i2d_X509_SIG)} + i2d_X509_SIG := @FC_i2d_X509_SIG; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(i2d_X509_SIG_removed)} + if i2d_X509_SIG_removed <= LibVersion then + begin + {$if declared(_i2d_X509_SIG)} + i2d_X509_SIG := @_i2d_X509_SIG; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(i2d_X509_SIG_allownil)} + if FuncLoadError then + AFailed.Add('i2d_X509_SIG'); + {$ifend} + end; + + + X509_SIG_get0 := LoadLibFunction(ADllHandle, X509_SIG_get0_procname); + FuncLoadError := not assigned(X509_SIG_get0); + if FuncLoadError then + begin + {$if not defined(X509_SIG_get0_allownil)} + X509_SIG_get0 := @ERR_X509_SIG_get0; + {$ifend} + {$if declared(X509_SIG_get0_introduced)} + if LibVersion < X509_SIG_get0_introduced then + begin + {$if declared(FC_X509_SIG_get0)} + X509_SIG_get0 := @FC_X509_SIG_get0; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_SIG_get0_removed)} + if X509_SIG_get0_removed <= LibVersion then + begin + {$if declared(_X509_SIG_get0)} + X509_SIG_get0 := @_X509_SIG_get0; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_SIG_get0_allownil)} + if FuncLoadError then + AFailed.Add('X509_SIG_get0'); + {$ifend} + end; + + {introduced 1.1.0} + X509_SIG_getm := LoadLibFunction(ADllHandle, X509_SIG_getm_procname); + FuncLoadError := not assigned(X509_SIG_getm); + if FuncLoadError then + begin + {$if not defined(X509_SIG_getm_allownil)} + X509_SIG_getm := @ERR_X509_SIG_getm; + {$ifend} + {$if declared(X509_SIG_getm_introduced)} + if LibVersion < X509_SIG_getm_introduced then + begin + {$if declared(FC_X509_SIG_getm)} + X509_SIG_getm := @FC_X509_SIG_getm; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_SIG_getm_removed)} + if X509_SIG_getm_removed <= LibVersion then + begin + {$if declared(_X509_SIG_getm)} + X509_SIG_getm := @_X509_SIG_getm; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_SIG_getm_allownil)} + if FuncLoadError then + AFailed.Add('X509_SIG_getm'); + {$ifend} + end; + + {introduced 1.1.0} + X509_REQ_INFO_new := LoadLibFunction(ADllHandle, X509_REQ_INFO_new_procname); + FuncLoadError := not assigned(X509_REQ_INFO_new); + if FuncLoadError then + begin + {$if not defined(X509_REQ_INFO_new_allownil)} + X509_REQ_INFO_new := @ERR_X509_REQ_INFO_new; + {$ifend} + {$if declared(X509_REQ_INFO_new_introduced)} + if LibVersion < X509_REQ_INFO_new_introduced then + begin + {$if declared(FC_X509_REQ_INFO_new)} + X509_REQ_INFO_new := @FC_X509_REQ_INFO_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_REQ_INFO_new_removed)} + if X509_REQ_INFO_new_removed <= LibVersion then + begin + {$if declared(_X509_REQ_INFO_new)} + X509_REQ_INFO_new := @_X509_REQ_INFO_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_REQ_INFO_new_allownil)} + if FuncLoadError then + AFailed.Add('X509_REQ_INFO_new'); + {$ifend} + end; + + + X509_REQ_INFO_free := LoadLibFunction(ADllHandle, X509_REQ_INFO_free_procname); + FuncLoadError := not assigned(X509_REQ_INFO_free); + if FuncLoadError then + begin + {$if not defined(X509_REQ_INFO_free_allownil)} + X509_REQ_INFO_free := @ERR_X509_REQ_INFO_free; + {$ifend} + {$if declared(X509_REQ_INFO_free_introduced)} + if LibVersion < X509_REQ_INFO_free_introduced then + begin + {$if declared(FC_X509_REQ_INFO_free)} + X509_REQ_INFO_free := @FC_X509_REQ_INFO_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_REQ_INFO_free_removed)} + if X509_REQ_INFO_free_removed <= LibVersion then + begin + {$if declared(_X509_REQ_INFO_free)} + X509_REQ_INFO_free := @_X509_REQ_INFO_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_REQ_INFO_free_allownil)} + if FuncLoadError then + AFailed.Add('X509_REQ_INFO_free'); + {$ifend} + end; + + + d2i_X509_REQ_INFO := LoadLibFunction(ADllHandle, d2i_X509_REQ_INFO_procname); + FuncLoadError := not assigned(d2i_X509_REQ_INFO); + if FuncLoadError then + begin + {$if not defined(d2i_X509_REQ_INFO_allownil)} + d2i_X509_REQ_INFO := @ERR_d2i_X509_REQ_INFO; + {$ifend} + {$if declared(d2i_X509_REQ_INFO_introduced)} + if LibVersion < d2i_X509_REQ_INFO_introduced then + begin + {$if declared(FC_d2i_X509_REQ_INFO)} + d2i_X509_REQ_INFO := @FC_d2i_X509_REQ_INFO; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(d2i_X509_REQ_INFO_removed)} + if d2i_X509_REQ_INFO_removed <= LibVersion then + begin + {$if declared(_d2i_X509_REQ_INFO)} + d2i_X509_REQ_INFO := @_d2i_X509_REQ_INFO; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(d2i_X509_REQ_INFO_allownil)} + if FuncLoadError then + AFailed.Add('d2i_X509_REQ_INFO'); + {$ifend} + end; + + + i2d_X509_REQ_INFO := LoadLibFunction(ADllHandle, i2d_X509_REQ_INFO_procname); + FuncLoadError := not assigned(i2d_X509_REQ_INFO); + if FuncLoadError then + begin + {$if not defined(i2d_X509_REQ_INFO_allownil)} + i2d_X509_REQ_INFO := @ERR_i2d_X509_REQ_INFO; + {$ifend} + {$if declared(i2d_X509_REQ_INFO_introduced)} + if LibVersion < i2d_X509_REQ_INFO_introduced then + begin + {$if declared(FC_i2d_X509_REQ_INFO)} + i2d_X509_REQ_INFO := @FC_i2d_X509_REQ_INFO; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(i2d_X509_REQ_INFO_removed)} + if i2d_X509_REQ_INFO_removed <= LibVersion then + begin + {$if declared(_i2d_X509_REQ_INFO)} + i2d_X509_REQ_INFO := @_i2d_X509_REQ_INFO; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(i2d_X509_REQ_INFO_allownil)} + if FuncLoadError then + AFailed.Add('i2d_X509_REQ_INFO'); + {$ifend} + end; + + + X509_REQ_new := LoadLibFunction(ADllHandle, X509_REQ_new_procname); + FuncLoadError := not assigned(X509_REQ_new); + if FuncLoadError then + begin + {$if not defined(X509_REQ_new_allownil)} + X509_REQ_new := @ERR_X509_REQ_new; + {$ifend} + {$if declared(X509_REQ_new_introduced)} + if LibVersion < X509_REQ_new_introduced then + begin + {$if declared(FC_X509_REQ_new)} + X509_REQ_new := @FC_X509_REQ_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_REQ_new_removed)} + if X509_REQ_new_removed <= LibVersion then + begin + {$if declared(_X509_REQ_new)} + X509_REQ_new := @_X509_REQ_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_REQ_new_allownil)} + if FuncLoadError then + AFailed.Add('X509_REQ_new'); + {$ifend} + end; + + + X509_REQ_free := LoadLibFunction(ADllHandle, X509_REQ_free_procname); + FuncLoadError := not assigned(X509_REQ_free); + if FuncLoadError then + begin + {$if not defined(X509_REQ_free_allownil)} + X509_REQ_free := @ERR_X509_REQ_free; + {$ifend} + {$if declared(X509_REQ_free_introduced)} + if LibVersion < X509_REQ_free_introduced then + begin + {$if declared(FC_X509_REQ_free)} + X509_REQ_free := @FC_X509_REQ_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_REQ_free_removed)} + if X509_REQ_free_removed <= LibVersion then + begin + {$if declared(_X509_REQ_free)} + X509_REQ_free := @_X509_REQ_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_REQ_free_allownil)} + if FuncLoadError then + AFailed.Add('X509_REQ_free'); + {$ifend} + end; + + + d2i_X509_REQ := LoadLibFunction(ADllHandle, d2i_X509_REQ_procname); + FuncLoadError := not assigned(d2i_X509_REQ); + if FuncLoadError then + begin + {$if not defined(d2i_X509_REQ_allownil)} + d2i_X509_REQ := @ERR_d2i_X509_REQ; + {$ifend} + {$if declared(d2i_X509_REQ_introduced)} + if LibVersion < d2i_X509_REQ_introduced then + begin + {$if declared(FC_d2i_X509_REQ)} + d2i_X509_REQ := @FC_d2i_X509_REQ; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(d2i_X509_REQ_removed)} + if d2i_X509_REQ_removed <= LibVersion then + begin + {$if declared(_d2i_X509_REQ)} + d2i_X509_REQ := @_d2i_X509_REQ; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(d2i_X509_REQ_allownil)} + if FuncLoadError then + AFailed.Add('d2i_X509_REQ'); + {$ifend} + end; + + + i2d_X509_REQ := LoadLibFunction(ADllHandle, i2d_X509_REQ_procname); + FuncLoadError := not assigned(i2d_X509_REQ); + if FuncLoadError then + begin + {$if not defined(i2d_X509_REQ_allownil)} + i2d_X509_REQ := @ERR_i2d_X509_REQ; + {$ifend} + {$if declared(i2d_X509_REQ_introduced)} + if LibVersion < i2d_X509_REQ_introduced then + begin + {$if declared(FC_i2d_X509_REQ)} + i2d_X509_REQ := @FC_i2d_X509_REQ; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(i2d_X509_REQ_removed)} + if i2d_X509_REQ_removed <= LibVersion then + begin + {$if declared(_i2d_X509_REQ)} + i2d_X509_REQ := @_i2d_X509_REQ; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(i2d_X509_REQ_allownil)} + if FuncLoadError then + AFailed.Add('i2d_X509_REQ'); + {$ifend} + end; + + + X509_ATTRIBUTE_new := LoadLibFunction(ADllHandle, X509_ATTRIBUTE_new_procname); + FuncLoadError := not assigned(X509_ATTRIBUTE_new); + if FuncLoadError then + begin + {$if not defined(X509_ATTRIBUTE_new_allownil)} + X509_ATTRIBUTE_new := @ERR_X509_ATTRIBUTE_new; + {$ifend} + {$if declared(X509_ATTRIBUTE_new_introduced)} + if LibVersion < X509_ATTRIBUTE_new_introduced then + begin + {$if declared(FC_X509_ATTRIBUTE_new)} + X509_ATTRIBUTE_new := @FC_X509_ATTRIBUTE_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_ATTRIBUTE_new_removed)} + if X509_ATTRIBUTE_new_removed <= LibVersion then + begin + {$if declared(_X509_ATTRIBUTE_new)} + X509_ATTRIBUTE_new := @_X509_ATTRIBUTE_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_ATTRIBUTE_new_allownil)} + if FuncLoadError then + AFailed.Add('X509_ATTRIBUTE_new'); + {$ifend} + end; + + + X509_ATTRIBUTE_free := LoadLibFunction(ADllHandle, X509_ATTRIBUTE_free_procname); + FuncLoadError := not assigned(X509_ATTRIBUTE_free); + if FuncLoadError then + begin + {$if not defined(X509_ATTRIBUTE_free_allownil)} + X509_ATTRIBUTE_free := @ERR_X509_ATTRIBUTE_free; + {$ifend} + {$if declared(X509_ATTRIBUTE_free_introduced)} + if LibVersion < X509_ATTRIBUTE_free_introduced then + begin + {$if declared(FC_X509_ATTRIBUTE_free)} + X509_ATTRIBUTE_free := @FC_X509_ATTRIBUTE_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_ATTRIBUTE_free_removed)} + if X509_ATTRIBUTE_free_removed <= LibVersion then + begin + {$if declared(_X509_ATTRIBUTE_free)} + X509_ATTRIBUTE_free := @_X509_ATTRIBUTE_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_ATTRIBUTE_free_allownil)} + if FuncLoadError then + AFailed.Add('X509_ATTRIBUTE_free'); + {$ifend} + end; + + + d2i_X509_ATTRIBUTE := LoadLibFunction(ADllHandle, d2i_X509_ATTRIBUTE_procname); + FuncLoadError := not assigned(d2i_X509_ATTRIBUTE); + if FuncLoadError then + begin + {$if not defined(d2i_X509_ATTRIBUTE_allownil)} + d2i_X509_ATTRIBUTE := @ERR_d2i_X509_ATTRIBUTE; + {$ifend} + {$if declared(d2i_X509_ATTRIBUTE_introduced)} + if LibVersion < d2i_X509_ATTRIBUTE_introduced then + begin + {$if declared(FC_d2i_X509_ATTRIBUTE)} + d2i_X509_ATTRIBUTE := @FC_d2i_X509_ATTRIBUTE; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(d2i_X509_ATTRIBUTE_removed)} + if d2i_X509_ATTRIBUTE_removed <= LibVersion then + begin + {$if declared(_d2i_X509_ATTRIBUTE)} + d2i_X509_ATTRIBUTE := @_d2i_X509_ATTRIBUTE; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(d2i_X509_ATTRIBUTE_allownil)} + if FuncLoadError then + AFailed.Add('d2i_X509_ATTRIBUTE'); + {$ifend} + end; + + + i2d_X509_ATTRIBUTE := LoadLibFunction(ADllHandle, i2d_X509_ATTRIBUTE_procname); + FuncLoadError := not assigned(i2d_X509_ATTRIBUTE); + if FuncLoadError then + begin + {$if not defined(i2d_X509_ATTRIBUTE_allownil)} + i2d_X509_ATTRIBUTE := @ERR_i2d_X509_ATTRIBUTE; + {$ifend} + {$if declared(i2d_X509_ATTRIBUTE_introduced)} + if LibVersion < i2d_X509_ATTRIBUTE_introduced then + begin + {$if declared(FC_i2d_X509_ATTRIBUTE)} + i2d_X509_ATTRIBUTE := @FC_i2d_X509_ATTRIBUTE; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(i2d_X509_ATTRIBUTE_removed)} + if i2d_X509_ATTRIBUTE_removed <= LibVersion then + begin + {$if declared(_i2d_X509_ATTRIBUTE)} + i2d_X509_ATTRIBUTE := @_i2d_X509_ATTRIBUTE; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(i2d_X509_ATTRIBUTE_allownil)} + if FuncLoadError then + AFailed.Add('i2d_X509_ATTRIBUTE'); + {$ifend} + end; + + + X509_ATTRIBUTE_create := LoadLibFunction(ADllHandle, X509_ATTRIBUTE_create_procname); + FuncLoadError := not assigned(X509_ATTRIBUTE_create); + if FuncLoadError then + begin + {$if not defined(X509_ATTRIBUTE_create_allownil)} + X509_ATTRIBUTE_create := @ERR_X509_ATTRIBUTE_create; + {$ifend} + {$if declared(X509_ATTRIBUTE_create_introduced)} + if LibVersion < X509_ATTRIBUTE_create_introduced then + begin + {$if declared(FC_X509_ATTRIBUTE_create)} + X509_ATTRIBUTE_create := @FC_X509_ATTRIBUTE_create; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_ATTRIBUTE_create_removed)} + if X509_ATTRIBUTE_create_removed <= LibVersion then + begin + {$if declared(_X509_ATTRIBUTE_create)} + X509_ATTRIBUTE_create := @_X509_ATTRIBUTE_create; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_ATTRIBUTE_create_allownil)} + if FuncLoadError then + AFailed.Add('X509_ATTRIBUTE_create'); + {$ifend} + end; + + + X509_EXTENSION_new := LoadLibFunction(ADllHandle, X509_EXTENSION_new_procname); + FuncLoadError := not assigned(X509_EXTENSION_new); + if FuncLoadError then + begin + {$if not defined(X509_EXTENSION_new_allownil)} + X509_EXTENSION_new := @ERR_X509_EXTENSION_new; + {$ifend} + {$if declared(X509_EXTENSION_new_introduced)} + if LibVersion < X509_EXTENSION_new_introduced then + begin + {$if declared(FC_X509_EXTENSION_new)} + X509_EXTENSION_new := @FC_X509_EXTENSION_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_EXTENSION_new_removed)} + if X509_EXTENSION_new_removed <= LibVersion then + begin + {$if declared(_X509_EXTENSION_new)} + X509_EXTENSION_new := @_X509_EXTENSION_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_EXTENSION_new_allownil)} + if FuncLoadError then + AFailed.Add('X509_EXTENSION_new'); + {$ifend} + end; + + + X509_EXTENSION_free := LoadLibFunction(ADllHandle, X509_EXTENSION_free_procname); + FuncLoadError := not assigned(X509_EXTENSION_free); + if FuncLoadError then + begin + {$if not defined(X509_EXTENSION_free_allownil)} + X509_EXTENSION_free := @ERR_X509_EXTENSION_free; + {$ifend} + {$if declared(X509_EXTENSION_free_introduced)} + if LibVersion < X509_EXTENSION_free_introduced then + begin + {$if declared(FC_X509_EXTENSION_free)} + X509_EXTENSION_free := @FC_X509_EXTENSION_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_EXTENSION_free_removed)} + if X509_EXTENSION_free_removed <= LibVersion then + begin + {$if declared(_X509_EXTENSION_free)} + X509_EXTENSION_free := @_X509_EXTENSION_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_EXTENSION_free_allownil)} + if FuncLoadError then + AFailed.Add('X509_EXTENSION_free'); + {$ifend} + end; + + + d2i_X509_EXTENSION := LoadLibFunction(ADllHandle, d2i_X509_EXTENSION_procname); + FuncLoadError := not assigned(d2i_X509_EXTENSION); + if FuncLoadError then + begin + {$if not defined(d2i_X509_EXTENSION_allownil)} + d2i_X509_EXTENSION := @ERR_d2i_X509_EXTENSION; + {$ifend} + {$if declared(d2i_X509_EXTENSION_introduced)} + if LibVersion < d2i_X509_EXTENSION_introduced then + begin + {$if declared(FC_d2i_X509_EXTENSION)} + d2i_X509_EXTENSION := @FC_d2i_X509_EXTENSION; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(d2i_X509_EXTENSION_removed)} + if d2i_X509_EXTENSION_removed <= LibVersion then + begin + {$if declared(_d2i_X509_EXTENSION)} + d2i_X509_EXTENSION := @_d2i_X509_EXTENSION; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(d2i_X509_EXTENSION_allownil)} + if FuncLoadError then + AFailed.Add('d2i_X509_EXTENSION'); + {$ifend} + end; + + + i2d_X509_EXTENSION := LoadLibFunction(ADllHandle, i2d_X509_EXTENSION_procname); + FuncLoadError := not assigned(i2d_X509_EXTENSION); + if FuncLoadError then + begin + {$if not defined(i2d_X509_EXTENSION_allownil)} + i2d_X509_EXTENSION := @ERR_i2d_X509_EXTENSION; + {$ifend} + {$if declared(i2d_X509_EXTENSION_introduced)} + if LibVersion < i2d_X509_EXTENSION_introduced then + begin + {$if declared(FC_i2d_X509_EXTENSION)} + i2d_X509_EXTENSION := @FC_i2d_X509_EXTENSION; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(i2d_X509_EXTENSION_removed)} + if i2d_X509_EXTENSION_removed <= LibVersion then + begin + {$if declared(_i2d_X509_EXTENSION)} + i2d_X509_EXTENSION := @_i2d_X509_EXTENSION; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(i2d_X509_EXTENSION_allownil)} + if FuncLoadError then + AFailed.Add('i2d_X509_EXTENSION'); + {$ifend} + end; + + + X509_NAME_ENTRY_new := LoadLibFunction(ADllHandle, X509_NAME_ENTRY_new_procname); + FuncLoadError := not assigned(X509_NAME_ENTRY_new); + if FuncLoadError then + begin + {$if not defined(X509_NAME_ENTRY_new_allownil)} + X509_NAME_ENTRY_new := @ERR_X509_NAME_ENTRY_new; + {$ifend} + {$if declared(X509_NAME_ENTRY_new_introduced)} + if LibVersion < X509_NAME_ENTRY_new_introduced then + begin + {$if declared(FC_X509_NAME_ENTRY_new)} + X509_NAME_ENTRY_new := @FC_X509_NAME_ENTRY_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_NAME_ENTRY_new_removed)} + if X509_NAME_ENTRY_new_removed <= LibVersion then + begin + {$if declared(_X509_NAME_ENTRY_new)} + X509_NAME_ENTRY_new := @_X509_NAME_ENTRY_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_NAME_ENTRY_new_allownil)} + if FuncLoadError then + AFailed.Add('X509_NAME_ENTRY_new'); + {$ifend} + end; + + + X509_NAME_ENTRY_free := LoadLibFunction(ADllHandle, X509_NAME_ENTRY_free_procname); + FuncLoadError := not assigned(X509_NAME_ENTRY_free); + if FuncLoadError then + begin + {$if not defined(X509_NAME_ENTRY_free_allownil)} + X509_NAME_ENTRY_free := @ERR_X509_NAME_ENTRY_free; + {$ifend} + {$if declared(X509_NAME_ENTRY_free_introduced)} + if LibVersion < X509_NAME_ENTRY_free_introduced then + begin + {$if declared(FC_X509_NAME_ENTRY_free)} + X509_NAME_ENTRY_free := @FC_X509_NAME_ENTRY_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_NAME_ENTRY_free_removed)} + if X509_NAME_ENTRY_free_removed <= LibVersion then + begin + {$if declared(_X509_NAME_ENTRY_free)} + X509_NAME_ENTRY_free := @_X509_NAME_ENTRY_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_NAME_ENTRY_free_allownil)} + if FuncLoadError then + AFailed.Add('X509_NAME_ENTRY_free'); + {$ifend} + end; + + + d2i_X509_NAME_ENTRY := LoadLibFunction(ADllHandle, d2i_X509_NAME_ENTRY_procname); + FuncLoadError := not assigned(d2i_X509_NAME_ENTRY); + if FuncLoadError then + begin + {$if not defined(d2i_X509_NAME_ENTRY_allownil)} + d2i_X509_NAME_ENTRY := @ERR_d2i_X509_NAME_ENTRY; + {$ifend} + {$if declared(d2i_X509_NAME_ENTRY_introduced)} + if LibVersion < d2i_X509_NAME_ENTRY_introduced then + begin + {$if declared(FC_d2i_X509_NAME_ENTRY)} + d2i_X509_NAME_ENTRY := @FC_d2i_X509_NAME_ENTRY; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(d2i_X509_NAME_ENTRY_removed)} + if d2i_X509_NAME_ENTRY_removed <= LibVersion then + begin + {$if declared(_d2i_X509_NAME_ENTRY)} + d2i_X509_NAME_ENTRY := @_d2i_X509_NAME_ENTRY; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(d2i_X509_NAME_ENTRY_allownil)} + if FuncLoadError then + AFailed.Add('d2i_X509_NAME_ENTRY'); + {$ifend} + end; + + + i2d_X509_NAME_ENTRY := LoadLibFunction(ADllHandle, i2d_X509_NAME_ENTRY_procname); + FuncLoadError := not assigned(i2d_X509_NAME_ENTRY); + if FuncLoadError then + begin + {$if not defined(i2d_X509_NAME_ENTRY_allownil)} + i2d_X509_NAME_ENTRY := @ERR_i2d_X509_NAME_ENTRY; + {$ifend} + {$if declared(i2d_X509_NAME_ENTRY_introduced)} + if LibVersion < i2d_X509_NAME_ENTRY_introduced then + begin + {$if declared(FC_i2d_X509_NAME_ENTRY)} + i2d_X509_NAME_ENTRY := @FC_i2d_X509_NAME_ENTRY; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(i2d_X509_NAME_ENTRY_removed)} + if i2d_X509_NAME_ENTRY_removed <= LibVersion then + begin + {$if declared(_i2d_X509_NAME_ENTRY)} + i2d_X509_NAME_ENTRY := @_i2d_X509_NAME_ENTRY; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(i2d_X509_NAME_ENTRY_allownil)} + if FuncLoadError then + AFailed.Add('i2d_X509_NAME_ENTRY'); + {$ifend} + end; + + + X509_NAME_new := LoadLibFunction(ADllHandle, X509_NAME_new_procname); + FuncLoadError := not assigned(X509_NAME_new); + if FuncLoadError then + begin + {$if not defined(X509_NAME_new_allownil)} + X509_NAME_new := @ERR_X509_NAME_new; + {$ifend} + {$if declared(X509_NAME_new_introduced)} + if LibVersion < X509_NAME_new_introduced then + begin + {$if declared(FC_X509_NAME_new)} + X509_NAME_new := @FC_X509_NAME_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_NAME_new_removed)} + if X509_NAME_new_removed <= LibVersion then + begin + {$if declared(_X509_NAME_new)} + X509_NAME_new := @_X509_NAME_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_NAME_new_allownil)} + if FuncLoadError then + AFailed.Add('X509_NAME_new'); + {$ifend} + end; + + + X509_NAME_free := LoadLibFunction(ADllHandle, X509_NAME_free_procname); + FuncLoadError := not assigned(X509_NAME_free); + if FuncLoadError then + begin + {$if not defined(X509_NAME_free_allownil)} + X509_NAME_free := @ERR_X509_NAME_free; + {$ifend} + {$if declared(X509_NAME_free_introduced)} + if LibVersion < X509_NAME_free_introduced then + begin + {$if declared(FC_X509_NAME_free)} + X509_NAME_free := @FC_X509_NAME_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_NAME_free_removed)} + if X509_NAME_free_removed <= LibVersion then + begin + {$if declared(_X509_NAME_free)} + X509_NAME_free := @_X509_NAME_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_NAME_free_allownil)} + if FuncLoadError then + AFailed.Add('X509_NAME_free'); + {$ifend} + end; + + + d2i_X509_NAME := LoadLibFunction(ADllHandle, d2i_X509_NAME_procname); + FuncLoadError := not assigned(d2i_X509_NAME); + if FuncLoadError then + begin + {$if not defined(d2i_X509_NAME_allownil)} + d2i_X509_NAME := @ERR_d2i_X509_NAME; + {$ifend} + {$if declared(d2i_X509_NAME_introduced)} + if LibVersion < d2i_X509_NAME_introduced then + begin + {$if declared(FC_d2i_X509_NAME)} + d2i_X509_NAME := @FC_d2i_X509_NAME; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(d2i_X509_NAME_removed)} + if d2i_X509_NAME_removed <= LibVersion then + begin + {$if declared(_d2i_X509_NAME)} + d2i_X509_NAME := @_d2i_X509_NAME; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(d2i_X509_NAME_allownil)} + if FuncLoadError then + AFailed.Add('d2i_X509_NAME'); + {$ifend} + end; + + + i2d_X509_NAME := LoadLibFunction(ADllHandle, i2d_X509_NAME_procname); + FuncLoadError := not assigned(i2d_X509_NAME); + if FuncLoadError then + begin + {$if not defined(i2d_X509_NAME_allownil)} + i2d_X509_NAME := @ERR_i2d_X509_NAME; + {$ifend} + {$if declared(i2d_X509_NAME_introduced)} + if LibVersion < i2d_X509_NAME_introduced then + begin + {$if declared(FC_i2d_X509_NAME)} + i2d_X509_NAME := @FC_i2d_X509_NAME; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(i2d_X509_NAME_removed)} + if i2d_X509_NAME_removed <= LibVersion then + begin + {$if declared(_i2d_X509_NAME)} + i2d_X509_NAME := @_i2d_X509_NAME; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(i2d_X509_NAME_allownil)} + if FuncLoadError then + AFailed.Add('i2d_X509_NAME'); + {$ifend} + end; + + + X509_NAME_set := LoadLibFunction(ADllHandle, X509_NAME_set_procname); + FuncLoadError := not assigned(X509_NAME_set); + if FuncLoadError then + begin + {$if not defined(X509_NAME_set_allownil)} + X509_NAME_set := @ERR_X509_NAME_set; + {$ifend} + {$if declared(X509_NAME_set_introduced)} + if LibVersion < X509_NAME_set_introduced then + begin + {$if declared(FC_X509_NAME_set)} + X509_NAME_set := @FC_X509_NAME_set; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_NAME_set_removed)} + if X509_NAME_set_removed <= LibVersion then + begin + {$if declared(_X509_NAME_set)} + X509_NAME_set := @_X509_NAME_set; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_NAME_set_allownil)} + if FuncLoadError then + AFailed.Add('X509_NAME_set'); + {$ifend} + end; + + + X509_new := LoadLibFunction(ADllHandle, X509_new_procname); + FuncLoadError := not assigned(X509_new); + if FuncLoadError then + begin + {$if not defined(X509_new_allownil)} + X509_new := @ERR_X509_new; + {$ifend} + {$if declared(X509_new_introduced)} + if LibVersion < X509_new_introduced then + begin + {$if declared(FC_X509_new)} + X509_new := @FC_X509_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_new_removed)} + if X509_new_removed <= LibVersion then + begin + {$if declared(_X509_new)} + X509_new := @_X509_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_new_allownil)} + if FuncLoadError then + AFailed.Add('X509_new'); + {$ifend} + end; + + + X509_free := LoadLibFunction(ADllHandle, X509_free_procname); + FuncLoadError := not assigned(X509_free); + if FuncLoadError then + begin + {$if not defined(X509_free_allownil)} + X509_free := @ERR_X509_free; + {$ifend} + {$if declared(X509_free_introduced)} + if LibVersion < X509_free_introduced then + begin + {$if declared(FC_X509_free)} + X509_free := @FC_X509_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_free_removed)} + if X509_free_removed <= LibVersion then + begin + {$if declared(_X509_free)} + X509_free := @_X509_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_free_allownil)} + if FuncLoadError then + AFailed.Add('X509_free'); + {$ifend} + end; + + + d2i_X509 := LoadLibFunction(ADllHandle, d2i_X509_procname); + FuncLoadError := not assigned(d2i_X509); + if FuncLoadError then + begin + {$if not defined(d2i_X509_allownil)} + d2i_X509 := @ERR_d2i_X509; + {$ifend} + {$if declared(d2i_X509_introduced)} + if LibVersion < d2i_X509_introduced then + begin + {$if declared(FC_d2i_X509)} + d2i_X509 := @FC_d2i_X509; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(d2i_X509_removed)} + if d2i_X509_removed <= LibVersion then + begin + {$if declared(_d2i_X509)} + d2i_X509 := @_d2i_X509; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(d2i_X509_allownil)} + if FuncLoadError then + AFailed.Add('d2i_X509'); + {$ifend} + end; + + + i2d_X509 := LoadLibFunction(ADllHandle, i2d_X509_procname); + FuncLoadError := not assigned(i2d_X509); + if FuncLoadError then + begin + {$if not defined(i2d_X509_allownil)} + i2d_X509 := @ERR_i2d_X509; + {$ifend} + {$if declared(i2d_X509_introduced)} + if LibVersion < i2d_X509_introduced then + begin + {$if declared(FC_i2d_X509)} + i2d_X509 := @FC_i2d_X509; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(i2d_X509_removed)} + if i2d_X509_removed <= LibVersion then + begin + {$if declared(_i2d_X509)} + i2d_X509 := @_i2d_X509; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(i2d_X509_allownil)} + if FuncLoadError then + AFailed.Add('i2d_X509'); + {$ifend} + end; + + + X509_set_ex_data := LoadLibFunction(ADllHandle, X509_set_ex_data_procname); + FuncLoadError := not assigned(X509_set_ex_data); + if FuncLoadError then + begin + {$if not defined(X509_set_ex_data_allownil)} + X509_set_ex_data := @ERR_X509_set_ex_data; + {$ifend} + {$if declared(X509_set_ex_data_introduced)} + if LibVersion < X509_set_ex_data_introduced then + begin + {$if declared(FC_X509_set_ex_data)} + X509_set_ex_data := @FC_X509_set_ex_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_set_ex_data_removed)} + if X509_set_ex_data_removed <= LibVersion then + begin + {$if declared(_X509_set_ex_data)} + X509_set_ex_data := @_X509_set_ex_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_set_ex_data_allownil)} + if FuncLoadError then + AFailed.Add('X509_set_ex_data'); + {$ifend} + end; + + + X509_get_ex_data := LoadLibFunction(ADllHandle, X509_get_ex_data_procname); + FuncLoadError := not assigned(X509_get_ex_data); + if FuncLoadError then + begin + {$if not defined(X509_get_ex_data_allownil)} + X509_get_ex_data := @ERR_X509_get_ex_data; + {$ifend} + {$if declared(X509_get_ex_data_introduced)} + if LibVersion < X509_get_ex_data_introduced then + begin + {$if declared(FC_X509_get_ex_data)} + X509_get_ex_data := @FC_X509_get_ex_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_get_ex_data_removed)} + if X509_get_ex_data_removed <= LibVersion then + begin + {$if declared(_X509_get_ex_data)} + X509_get_ex_data := @_X509_get_ex_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_get_ex_data_allownil)} + if FuncLoadError then + AFailed.Add('X509_get_ex_data'); + {$ifend} + end; + + + i2d_X509_AUX := LoadLibFunction(ADllHandle, i2d_X509_AUX_procname); + FuncLoadError := not assigned(i2d_X509_AUX); + if FuncLoadError then + begin + {$if not defined(i2d_X509_AUX_allownil)} + i2d_X509_AUX := @ERR_i2d_X509_AUX; + {$ifend} + {$if declared(i2d_X509_AUX_introduced)} + if LibVersion < i2d_X509_AUX_introduced then + begin + {$if declared(FC_i2d_X509_AUX)} + i2d_X509_AUX := @FC_i2d_X509_AUX; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(i2d_X509_AUX_removed)} + if i2d_X509_AUX_removed <= LibVersion then + begin + {$if declared(_i2d_X509_AUX)} + i2d_X509_AUX := @_i2d_X509_AUX; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(i2d_X509_AUX_allownil)} + if FuncLoadError then + AFailed.Add('i2d_X509_AUX'); + {$ifend} + end; + + + d2i_X509_AUX := LoadLibFunction(ADllHandle, d2i_X509_AUX_procname); + FuncLoadError := not assigned(d2i_X509_AUX); + if FuncLoadError then + begin + {$if not defined(d2i_X509_AUX_allownil)} + d2i_X509_AUX := @ERR_d2i_X509_AUX; + {$ifend} + {$if declared(d2i_X509_AUX_introduced)} + if LibVersion < d2i_X509_AUX_introduced then + begin + {$if declared(FC_d2i_X509_AUX)} + d2i_X509_AUX := @FC_d2i_X509_AUX; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(d2i_X509_AUX_removed)} + if d2i_X509_AUX_removed <= LibVersion then + begin + {$if declared(_d2i_X509_AUX)} + d2i_X509_AUX := @_d2i_X509_AUX; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(d2i_X509_AUX_allownil)} + if FuncLoadError then + AFailed.Add('d2i_X509_AUX'); + {$ifend} + end; + + + i2d_re_X509_tbs := LoadLibFunction(ADllHandle, i2d_re_X509_tbs_procname); + FuncLoadError := not assigned(i2d_re_X509_tbs); + if FuncLoadError then + begin + {$if not defined(i2d_re_X509_tbs_allownil)} + i2d_re_X509_tbs := @ERR_i2d_re_X509_tbs; + {$ifend} + {$if declared(i2d_re_X509_tbs_introduced)} + if LibVersion < i2d_re_X509_tbs_introduced then + begin + {$if declared(FC_i2d_re_X509_tbs)} + i2d_re_X509_tbs := @FC_i2d_re_X509_tbs; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(i2d_re_X509_tbs_removed)} + if i2d_re_X509_tbs_removed <= LibVersion then + begin + {$if declared(_i2d_re_X509_tbs)} + i2d_re_X509_tbs := @_i2d_re_X509_tbs; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(i2d_re_X509_tbs_allownil)} + if FuncLoadError then + AFailed.Add('i2d_re_X509_tbs'); + {$ifend} + end; + + + X509_SIG_INFO_get := LoadLibFunction(ADllHandle, X509_SIG_INFO_get_procname); + FuncLoadError := not assigned(X509_SIG_INFO_get); + if FuncLoadError then + begin + {$if not defined(X509_SIG_INFO_get_allownil)} + X509_SIG_INFO_get := @ERR_X509_SIG_INFO_get; + {$ifend} + {$if declared(X509_SIG_INFO_get_introduced)} + if LibVersion < X509_SIG_INFO_get_introduced then + begin + {$if declared(FC_X509_SIG_INFO_get)} + X509_SIG_INFO_get := @FC_X509_SIG_INFO_get; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_SIG_INFO_get_removed)} + if X509_SIG_INFO_get_removed <= LibVersion then + begin + {$if declared(_X509_SIG_INFO_get)} + X509_SIG_INFO_get := @_X509_SIG_INFO_get; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_SIG_INFO_get_allownil)} + if FuncLoadError then + AFailed.Add('X509_SIG_INFO_get'); + {$ifend} + end; + + {introduced 1.1.0} + X509_SIG_INFO_set := LoadLibFunction(ADllHandle, X509_SIG_INFO_set_procname); + FuncLoadError := not assigned(X509_SIG_INFO_set); + if FuncLoadError then + begin + {$if not defined(X509_SIG_INFO_set_allownil)} + X509_SIG_INFO_set := @ERR_X509_SIG_INFO_set; + {$ifend} + {$if declared(X509_SIG_INFO_set_introduced)} + if LibVersion < X509_SIG_INFO_set_introduced then + begin + {$if declared(FC_X509_SIG_INFO_set)} + X509_SIG_INFO_set := @FC_X509_SIG_INFO_set; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_SIG_INFO_set_removed)} + if X509_SIG_INFO_set_removed <= LibVersion then + begin + {$if declared(_X509_SIG_INFO_set)} + X509_SIG_INFO_set := @_X509_SIG_INFO_set; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_SIG_INFO_set_allownil)} + if FuncLoadError then + AFailed.Add('X509_SIG_INFO_set'); + {$ifend} + end; + + {introduced 1.1.0} + X509_get_signature_info := LoadLibFunction(ADllHandle, X509_get_signature_info_procname); + FuncLoadError := not assigned(X509_get_signature_info); + if FuncLoadError then + begin + {$if not defined(X509_get_signature_info_allownil)} + X509_get_signature_info := @ERR_X509_get_signature_info; + {$ifend} + {$if declared(X509_get_signature_info_introduced)} + if LibVersion < X509_get_signature_info_introduced then + begin + {$if declared(FC_X509_get_signature_info)} + X509_get_signature_info := @FC_X509_get_signature_info; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_get_signature_info_removed)} + if X509_get_signature_info_removed <= LibVersion then + begin + {$if declared(_X509_get_signature_info)} + X509_get_signature_info := @_X509_get_signature_info; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_get_signature_info_allownil)} + if FuncLoadError then + AFailed.Add('X509_get_signature_info'); + {$ifend} + end; + + {introduced 1.1.0} + X509_get0_signature := LoadLibFunction(ADllHandle, X509_get0_signature_procname); + FuncLoadError := not assigned(X509_get0_signature); + if FuncLoadError then + begin + {$if not defined(X509_get0_signature_allownil)} + X509_get0_signature := @ERR_X509_get0_signature; + {$ifend} + {$if declared(X509_get0_signature_introduced)} + if LibVersion < X509_get0_signature_introduced then + begin + {$if declared(FC_X509_get0_signature)} + X509_get0_signature := @FC_X509_get0_signature; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_get0_signature_removed)} + if X509_get0_signature_removed <= LibVersion then + begin + {$if declared(_X509_get0_signature)} + X509_get0_signature := @_X509_get0_signature; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_get0_signature_allownil)} + if FuncLoadError then + AFailed.Add('X509_get0_signature'); + {$ifend} + end; + + {introduced 1.1.0} + X509_get_signature_nid := LoadLibFunction(ADllHandle, X509_get_signature_nid_procname); + FuncLoadError := not assigned(X509_get_signature_nid); + if FuncLoadError then + begin + {$if not defined(X509_get_signature_nid_allownil)} + X509_get_signature_nid := @ERR_X509_get_signature_nid; + {$ifend} + {$if declared(X509_get_signature_nid_introduced)} + if LibVersion < X509_get_signature_nid_introduced then + begin + {$if declared(FC_X509_get_signature_nid)} + X509_get_signature_nid := @FC_X509_get_signature_nid; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_get_signature_nid_removed)} + if X509_get_signature_nid_removed <= LibVersion then + begin + {$if declared(_X509_get_signature_nid)} + X509_get_signature_nid := @_X509_get_signature_nid; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_get_signature_nid_allownil)} + if FuncLoadError then + AFailed.Add('X509_get_signature_nid'); + {$ifend} + end; + + + X509_trusted := LoadLibFunction(ADllHandle, X509_trusted_procname); + FuncLoadError := not assigned(X509_trusted); + if FuncLoadError then + begin + {$if not defined(X509_trusted_allownil)} + X509_trusted := @ERR_X509_trusted; + {$ifend} + {$if declared(X509_trusted_introduced)} + if LibVersion < X509_trusted_introduced then + begin + {$if declared(FC_X509_trusted)} + X509_trusted := @FC_X509_trusted; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_trusted_removed)} + if X509_trusted_removed <= LibVersion then + begin + {$if declared(_X509_trusted)} + X509_trusted := @_X509_trusted; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_trusted_allownil)} + if FuncLoadError then + AFailed.Add('X509_trusted'); + {$ifend} + end; + + {introduced 1.1.0} + X509_alias_set1 := LoadLibFunction(ADllHandle, X509_alias_set1_procname); + FuncLoadError := not assigned(X509_alias_set1); + if FuncLoadError then + begin + {$if not defined(X509_alias_set1_allownil)} + X509_alias_set1 := @ERR_X509_alias_set1; + {$ifend} + {$if declared(X509_alias_set1_introduced)} + if LibVersion < X509_alias_set1_introduced then + begin + {$if declared(FC_X509_alias_set1)} + X509_alias_set1 := @FC_X509_alias_set1; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_alias_set1_removed)} + if X509_alias_set1_removed <= LibVersion then + begin + {$if declared(_X509_alias_set1)} + X509_alias_set1 := @_X509_alias_set1; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_alias_set1_allownil)} + if FuncLoadError then + AFailed.Add('X509_alias_set1'); + {$ifend} + end; + + + X509_keyid_set1 := LoadLibFunction(ADllHandle, X509_keyid_set1_procname); + FuncLoadError := not assigned(X509_keyid_set1); + if FuncLoadError then + begin + {$if not defined(X509_keyid_set1_allownil)} + X509_keyid_set1 := @ERR_X509_keyid_set1; + {$ifend} + {$if declared(X509_keyid_set1_introduced)} + if LibVersion < X509_keyid_set1_introduced then + begin + {$if declared(FC_X509_keyid_set1)} + X509_keyid_set1 := @FC_X509_keyid_set1; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_keyid_set1_removed)} + if X509_keyid_set1_removed <= LibVersion then + begin + {$if declared(_X509_keyid_set1)} + X509_keyid_set1 := @_X509_keyid_set1; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_keyid_set1_allownil)} + if FuncLoadError then + AFailed.Add('X509_keyid_set1'); + {$ifend} + end; + + + X509_alias_get0 := LoadLibFunction(ADllHandle, X509_alias_get0_procname); + FuncLoadError := not assigned(X509_alias_get0); + if FuncLoadError then + begin + {$if not defined(X509_alias_get0_allownil)} + X509_alias_get0 := @ERR_X509_alias_get0; + {$ifend} + {$if declared(X509_alias_get0_introduced)} + if LibVersion < X509_alias_get0_introduced then + begin + {$if declared(FC_X509_alias_get0)} + X509_alias_get0 := @FC_X509_alias_get0; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_alias_get0_removed)} + if X509_alias_get0_removed <= LibVersion then + begin + {$if declared(_X509_alias_get0)} + X509_alias_get0 := @_X509_alias_get0; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_alias_get0_allownil)} + if FuncLoadError then + AFailed.Add('X509_alias_get0'); + {$ifend} + end; + + + X509_keyid_get0 := LoadLibFunction(ADllHandle, X509_keyid_get0_procname); + FuncLoadError := not assigned(X509_keyid_get0); + if FuncLoadError then + begin + {$if not defined(X509_keyid_get0_allownil)} + X509_keyid_get0 := @ERR_X509_keyid_get0; + {$ifend} + {$if declared(X509_keyid_get0_introduced)} + if LibVersion < X509_keyid_get0_introduced then + begin + {$if declared(FC_X509_keyid_get0)} + X509_keyid_get0 := @FC_X509_keyid_get0; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_keyid_get0_removed)} + if X509_keyid_get0_removed <= LibVersion then + begin + {$if declared(_X509_keyid_get0)} + X509_keyid_get0 := @_X509_keyid_get0; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_keyid_get0_allownil)} + if FuncLoadError then + AFailed.Add('X509_keyid_get0'); + {$ifend} + end; + + + X509_TRUST_set := LoadLibFunction(ADllHandle, X509_TRUST_set_procname); + FuncLoadError := not assigned(X509_TRUST_set); + if FuncLoadError then + begin + {$if not defined(X509_TRUST_set_allownil)} + X509_TRUST_set := @ERR_X509_TRUST_set; + {$ifend} + {$if declared(X509_TRUST_set_introduced)} + if LibVersion < X509_TRUST_set_introduced then + begin + {$if declared(FC_X509_TRUST_set)} + X509_TRUST_set := @FC_X509_TRUST_set; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_TRUST_set_removed)} + if X509_TRUST_set_removed <= LibVersion then + begin + {$if declared(_X509_TRUST_set)} + X509_TRUST_set := @_X509_TRUST_set; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_TRUST_set_allownil)} + if FuncLoadError then + AFailed.Add('X509_TRUST_set'); + {$ifend} + end; + + + X509_add1_trust_object := LoadLibFunction(ADllHandle, X509_add1_trust_object_procname); + FuncLoadError := not assigned(X509_add1_trust_object); + if FuncLoadError then + begin + {$if not defined(X509_add1_trust_object_allownil)} + X509_add1_trust_object := @ERR_X509_add1_trust_object; + {$ifend} + {$if declared(X509_add1_trust_object_introduced)} + if LibVersion < X509_add1_trust_object_introduced then + begin + {$if declared(FC_X509_add1_trust_object)} + X509_add1_trust_object := @FC_X509_add1_trust_object; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_add1_trust_object_removed)} + if X509_add1_trust_object_removed <= LibVersion then + begin + {$if declared(_X509_add1_trust_object)} + X509_add1_trust_object := @_X509_add1_trust_object; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_add1_trust_object_allownil)} + if FuncLoadError then + AFailed.Add('X509_add1_trust_object'); + {$ifend} + end; + + + X509_add1_reject_object := LoadLibFunction(ADllHandle, X509_add1_reject_object_procname); + FuncLoadError := not assigned(X509_add1_reject_object); + if FuncLoadError then + begin + {$if not defined(X509_add1_reject_object_allownil)} + X509_add1_reject_object := @ERR_X509_add1_reject_object; + {$ifend} + {$if declared(X509_add1_reject_object_introduced)} + if LibVersion < X509_add1_reject_object_introduced then + begin + {$if declared(FC_X509_add1_reject_object)} + X509_add1_reject_object := @FC_X509_add1_reject_object; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_add1_reject_object_removed)} + if X509_add1_reject_object_removed <= LibVersion then + begin + {$if declared(_X509_add1_reject_object)} + X509_add1_reject_object := @_X509_add1_reject_object; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_add1_reject_object_allownil)} + if FuncLoadError then + AFailed.Add('X509_add1_reject_object'); + {$ifend} + end; + + + X509_trust_clear := LoadLibFunction(ADllHandle, X509_trust_clear_procname); + FuncLoadError := not assigned(X509_trust_clear); + if FuncLoadError then + begin + {$if not defined(X509_trust_clear_allownil)} + X509_trust_clear := @ERR_X509_trust_clear; + {$ifend} + {$if declared(X509_trust_clear_introduced)} + if LibVersion < X509_trust_clear_introduced then + begin + {$if declared(FC_X509_trust_clear)} + X509_trust_clear := @FC_X509_trust_clear; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_trust_clear_removed)} + if X509_trust_clear_removed <= LibVersion then + begin + {$if declared(_X509_trust_clear)} + X509_trust_clear := @_X509_trust_clear; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_trust_clear_allownil)} + if FuncLoadError then + AFailed.Add('X509_trust_clear'); + {$ifend} + end; + + + X509_reject_clear := LoadLibFunction(ADllHandle, X509_reject_clear_procname); + FuncLoadError := not assigned(X509_reject_clear); + if FuncLoadError then + begin + {$if not defined(X509_reject_clear_allownil)} + X509_reject_clear := @ERR_X509_reject_clear; + {$ifend} + {$if declared(X509_reject_clear_introduced)} + if LibVersion < X509_reject_clear_introduced then + begin + {$if declared(FC_X509_reject_clear)} + X509_reject_clear := @FC_X509_reject_clear; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_reject_clear_removed)} + if X509_reject_clear_removed <= LibVersion then + begin + {$if declared(_X509_reject_clear)} + X509_reject_clear := @_X509_reject_clear; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_reject_clear_allownil)} + if FuncLoadError then + AFailed.Add('X509_reject_clear'); + {$ifend} + end; + + + X509_REVOKED_new := LoadLibFunction(ADllHandle, X509_REVOKED_new_procname); + FuncLoadError := not assigned(X509_REVOKED_new); + if FuncLoadError then + begin + {$if not defined(X509_REVOKED_new_allownil)} + X509_REVOKED_new := @ERR_X509_REVOKED_new; + {$ifend} + {$if declared(X509_REVOKED_new_introduced)} + if LibVersion < X509_REVOKED_new_introduced then + begin + {$if declared(FC_X509_REVOKED_new)} + X509_REVOKED_new := @FC_X509_REVOKED_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_REVOKED_new_removed)} + if X509_REVOKED_new_removed <= LibVersion then + begin + {$if declared(_X509_REVOKED_new)} + X509_REVOKED_new := @_X509_REVOKED_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_REVOKED_new_allownil)} + if FuncLoadError then + AFailed.Add('X509_REVOKED_new'); + {$ifend} + end; + + + X509_REVOKED_free := LoadLibFunction(ADllHandle, X509_REVOKED_free_procname); + FuncLoadError := not assigned(X509_REVOKED_free); + if FuncLoadError then + begin + {$if not defined(X509_REVOKED_free_allownil)} + X509_REVOKED_free := @ERR_X509_REVOKED_free; + {$ifend} + {$if declared(X509_REVOKED_free_introduced)} + if LibVersion < X509_REVOKED_free_introduced then + begin + {$if declared(FC_X509_REVOKED_free)} + X509_REVOKED_free := @FC_X509_REVOKED_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_REVOKED_free_removed)} + if X509_REVOKED_free_removed <= LibVersion then + begin + {$if declared(_X509_REVOKED_free)} + X509_REVOKED_free := @_X509_REVOKED_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_REVOKED_free_allownil)} + if FuncLoadError then + AFailed.Add('X509_REVOKED_free'); + {$ifend} + end; + + + d2i_X509_REVOKED := LoadLibFunction(ADllHandle, d2i_X509_REVOKED_procname); + FuncLoadError := not assigned(d2i_X509_REVOKED); + if FuncLoadError then + begin + {$if not defined(d2i_X509_REVOKED_allownil)} + d2i_X509_REVOKED := @ERR_d2i_X509_REVOKED; + {$ifend} + {$if declared(d2i_X509_REVOKED_introduced)} + if LibVersion < d2i_X509_REVOKED_introduced then + begin + {$if declared(FC_d2i_X509_REVOKED)} + d2i_X509_REVOKED := @FC_d2i_X509_REVOKED; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(d2i_X509_REVOKED_removed)} + if d2i_X509_REVOKED_removed <= LibVersion then + begin + {$if declared(_d2i_X509_REVOKED)} + d2i_X509_REVOKED := @_d2i_X509_REVOKED; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(d2i_X509_REVOKED_allownil)} + if FuncLoadError then + AFailed.Add('d2i_X509_REVOKED'); + {$ifend} + end; + + + i2d_X509_REVOKED := LoadLibFunction(ADllHandle, i2d_X509_REVOKED_procname); + FuncLoadError := not assigned(i2d_X509_REVOKED); + if FuncLoadError then + begin + {$if not defined(i2d_X509_REVOKED_allownil)} + i2d_X509_REVOKED := @ERR_i2d_X509_REVOKED; + {$ifend} + {$if declared(i2d_X509_REVOKED_introduced)} + if LibVersion < i2d_X509_REVOKED_introduced then + begin + {$if declared(FC_i2d_X509_REVOKED)} + i2d_X509_REVOKED := @FC_i2d_X509_REVOKED; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(i2d_X509_REVOKED_removed)} + if i2d_X509_REVOKED_removed <= LibVersion then + begin + {$if declared(_i2d_X509_REVOKED)} + i2d_X509_REVOKED := @_i2d_X509_REVOKED; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(i2d_X509_REVOKED_allownil)} + if FuncLoadError then + AFailed.Add('i2d_X509_REVOKED'); + {$ifend} + end; + + + X509_CRL_INFO_new := LoadLibFunction(ADllHandle, X509_CRL_INFO_new_procname); + FuncLoadError := not assigned(X509_CRL_INFO_new); + if FuncLoadError then + begin + {$if not defined(X509_CRL_INFO_new_allownil)} + X509_CRL_INFO_new := @ERR_X509_CRL_INFO_new; + {$ifend} + {$if declared(X509_CRL_INFO_new_introduced)} + if LibVersion < X509_CRL_INFO_new_introduced then + begin + {$if declared(FC_X509_CRL_INFO_new)} + X509_CRL_INFO_new := @FC_X509_CRL_INFO_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_CRL_INFO_new_removed)} + if X509_CRL_INFO_new_removed <= LibVersion then + begin + {$if declared(_X509_CRL_INFO_new)} + X509_CRL_INFO_new := @_X509_CRL_INFO_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_CRL_INFO_new_allownil)} + if FuncLoadError then + AFailed.Add('X509_CRL_INFO_new'); + {$ifend} + end; + + + X509_CRL_INFO_free := LoadLibFunction(ADllHandle, X509_CRL_INFO_free_procname); + FuncLoadError := not assigned(X509_CRL_INFO_free); + if FuncLoadError then + begin + {$if not defined(X509_CRL_INFO_free_allownil)} + X509_CRL_INFO_free := @ERR_X509_CRL_INFO_free; + {$ifend} + {$if declared(X509_CRL_INFO_free_introduced)} + if LibVersion < X509_CRL_INFO_free_introduced then + begin + {$if declared(FC_X509_CRL_INFO_free)} + X509_CRL_INFO_free := @FC_X509_CRL_INFO_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_CRL_INFO_free_removed)} + if X509_CRL_INFO_free_removed <= LibVersion then + begin + {$if declared(_X509_CRL_INFO_free)} + X509_CRL_INFO_free := @_X509_CRL_INFO_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_CRL_INFO_free_allownil)} + if FuncLoadError then + AFailed.Add('X509_CRL_INFO_free'); + {$ifend} + end; + + + d2i_X509_CRL_INFO := LoadLibFunction(ADllHandle, d2i_X509_CRL_INFO_procname); + FuncLoadError := not assigned(d2i_X509_CRL_INFO); + if FuncLoadError then + begin + {$if not defined(d2i_X509_CRL_INFO_allownil)} + d2i_X509_CRL_INFO := @ERR_d2i_X509_CRL_INFO; + {$ifend} + {$if declared(d2i_X509_CRL_INFO_introduced)} + if LibVersion < d2i_X509_CRL_INFO_introduced then + begin + {$if declared(FC_d2i_X509_CRL_INFO)} + d2i_X509_CRL_INFO := @FC_d2i_X509_CRL_INFO; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(d2i_X509_CRL_INFO_removed)} + if d2i_X509_CRL_INFO_removed <= LibVersion then + begin + {$if declared(_d2i_X509_CRL_INFO)} + d2i_X509_CRL_INFO := @_d2i_X509_CRL_INFO; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(d2i_X509_CRL_INFO_allownil)} + if FuncLoadError then + AFailed.Add('d2i_X509_CRL_INFO'); + {$ifend} + end; + + + i2d_X509_CRL_INFO := LoadLibFunction(ADllHandle, i2d_X509_CRL_INFO_procname); + FuncLoadError := not assigned(i2d_X509_CRL_INFO); + if FuncLoadError then + begin + {$if not defined(i2d_X509_CRL_INFO_allownil)} + i2d_X509_CRL_INFO := @ERR_i2d_X509_CRL_INFO; + {$ifend} + {$if declared(i2d_X509_CRL_INFO_introduced)} + if LibVersion < i2d_X509_CRL_INFO_introduced then + begin + {$if declared(FC_i2d_X509_CRL_INFO)} + i2d_X509_CRL_INFO := @FC_i2d_X509_CRL_INFO; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(i2d_X509_CRL_INFO_removed)} + if i2d_X509_CRL_INFO_removed <= LibVersion then + begin + {$if declared(_i2d_X509_CRL_INFO)} + i2d_X509_CRL_INFO := @_i2d_X509_CRL_INFO; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(i2d_X509_CRL_INFO_allownil)} + if FuncLoadError then + AFailed.Add('i2d_X509_CRL_INFO'); + {$ifend} + end; + + + X509_CRL_new := LoadLibFunction(ADllHandle, X509_CRL_new_procname); + FuncLoadError := not assigned(X509_CRL_new); + if FuncLoadError then + begin + {$if not defined(X509_CRL_new_allownil)} + X509_CRL_new := @ERR_X509_CRL_new; + {$ifend} + {$if declared(X509_CRL_new_introduced)} + if LibVersion < X509_CRL_new_introduced then + begin + {$if declared(FC_X509_CRL_new)} + X509_CRL_new := @FC_X509_CRL_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_CRL_new_removed)} + if X509_CRL_new_removed <= LibVersion then + begin + {$if declared(_X509_CRL_new)} + X509_CRL_new := @_X509_CRL_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_CRL_new_allownil)} + if FuncLoadError then + AFailed.Add('X509_CRL_new'); + {$ifend} + end; + + + X509_CRL_free := LoadLibFunction(ADllHandle, X509_CRL_free_procname); + FuncLoadError := not assigned(X509_CRL_free); + if FuncLoadError then + begin + {$if not defined(X509_CRL_free_allownil)} + X509_CRL_free := @ERR_X509_CRL_free; + {$ifend} + {$if declared(X509_CRL_free_introduced)} + if LibVersion < X509_CRL_free_introduced then + begin + {$if declared(FC_X509_CRL_free)} + X509_CRL_free := @FC_X509_CRL_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_CRL_free_removed)} + if X509_CRL_free_removed <= LibVersion then + begin + {$if declared(_X509_CRL_free)} + X509_CRL_free := @_X509_CRL_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_CRL_free_allownil)} + if FuncLoadError then + AFailed.Add('X509_CRL_free'); + {$ifend} + end; + + + d2i_X509_CRL := LoadLibFunction(ADllHandle, d2i_X509_CRL_procname); + FuncLoadError := not assigned(d2i_X509_CRL); + if FuncLoadError then + begin + {$if not defined(d2i_X509_CRL_allownil)} + d2i_X509_CRL := @ERR_d2i_X509_CRL; + {$ifend} + {$if declared(d2i_X509_CRL_introduced)} + if LibVersion < d2i_X509_CRL_introduced then + begin + {$if declared(FC_d2i_X509_CRL)} + d2i_X509_CRL := @FC_d2i_X509_CRL; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(d2i_X509_CRL_removed)} + if d2i_X509_CRL_removed <= LibVersion then + begin + {$if declared(_d2i_X509_CRL)} + d2i_X509_CRL := @_d2i_X509_CRL; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(d2i_X509_CRL_allownil)} + if FuncLoadError then + AFailed.Add('d2i_X509_CRL'); + {$ifend} + end; + + + i2d_X509_CRL := LoadLibFunction(ADllHandle, i2d_X509_CRL_procname); + FuncLoadError := not assigned(i2d_X509_CRL); + if FuncLoadError then + begin + {$if not defined(i2d_X509_CRL_allownil)} + i2d_X509_CRL := @ERR_i2d_X509_CRL; + {$ifend} + {$if declared(i2d_X509_CRL_introduced)} + if LibVersion < i2d_X509_CRL_introduced then + begin + {$if declared(FC_i2d_X509_CRL)} + i2d_X509_CRL := @FC_i2d_X509_CRL; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(i2d_X509_CRL_removed)} + if i2d_X509_CRL_removed <= LibVersion then + begin + {$if declared(_i2d_X509_CRL)} + i2d_X509_CRL := @_i2d_X509_CRL; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(i2d_X509_CRL_allownil)} + if FuncLoadError then + AFailed.Add('i2d_X509_CRL'); + {$ifend} + end; + + + X509_CRL_add0_revoked := LoadLibFunction(ADllHandle, X509_CRL_add0_revoked_procname); + FuncLoadError := not assigned(X509_CRL_add0_revoked); + if FuncLoadError then + begin + {$if not defined(X509_CRL_add0_revoked_allownil)} + X509_CRL_add0_revoked := @ERR_X509_CRL_add0_revoked; + {$ifend} + {$if declared(X509_CRL_add0_revoked_introduced)} + if LibVersion < X509_CRL_add0_revoked_introduced then + begin + {$if declared(FC_X509_CRL_add0_revoked)} + X509_CRL_add0_revoked := @FC_X509_CRL_add0_revoked; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_CRL_add0_revoked_removed)} + if X509_CRL_add0_revoked_removed <= LibVersion then + begin + {$if declared(_X509_CRL_add0_revoked)} + X509_CRL_add0_revoked := @_X509_CRL_add0_revoked; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_CRL_add0_revoked_allownil)} + if FuncLoadError then + AFailed.Add('X509_CRL_add0_revoked'); + {$ifend} + end; + + + X509_CRL_get0_by_serial := LoadLibFunction(ADllHandle, X509_CRL_get0_by_serial_procname); + FuncLoadError := not assigned(X509_CRL_get0_by_serial); + if FuncLoadError then + begin + {$if not defined(X509_CRL_get0_by_serial_allownil)} + X509_CRL_get0_by_serial := @ERR_X509_CRL_get0_by_serial; + {$ifend} + {$if declared(X509_CRL_get0_by_serial_introduced)} + if LibVersion < X509_CRL_get0_by_serial_introduced then + begin + {$if declared(FC_X509_CRL_get0_by_serial)} + X509_CRL_get0_by_serial := @FC_X509_CRL_get0_by_serial; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_CRL_get0_by_serial_removed)} + if X509_CRL_get0_by_serial_removed <= LibVersion then + begin + {$if declared(_X509_CRL_get0_by_serial)} + X509_CRL_get0_by_serial := @_X509_CRL_get0_by_serial; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_CRL_get0_by_serial_allownil)} + if FuncLoadError then + AFailed.Add('X509_CRL_get0_by_serial'); + {$ifend} + end; + + + X509_CRL_get0_by_cert := LoadLibFunction(ADllHandle, X509_CRL_get0_by_cert_procname); + FuncLoadError := not assigned(X509_CRL_get0_by_cert); + if FuncLoadError then + begin + {$if not defined(X509_CRL_get0_by_cert_allownil)} + X509_CRL_get0_by_cert := @ERR_X509_CRL_get0_by_cert; + {$ifend} + {$if declared(X509_CRL_get0_by_cert_introduced)} + if LibVersion < X509_CRL_get0_by_cert_introduced then + begin + {$if declared(FC_X509_CRL_get0_by_cert)} + X509_CRL_get0_by_cert := @FC_X509_CRL_get0_by_cert; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_CRL_get0_by_cert_removed)} + if X509_CRL_get0_by_cert_removed <= LibVersion then + begin + {$if declared(_X509_CRL_get0_by_cert)} + X509_CRL_get0_by_cert := @_X509_CRL_get0_by_cert; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_CRL_get0_by_cert_allownil)} + if FuncLoadError then + AFailed.Add('X509_CRL_get0_by_cert'); + {$ifend} + end; + + + X509_PKEY_new := LoadLibFunction(ADllHandle, X509_PKEY_new_procname); + FuncLoadError := not assigned(X509_PKEY_new); + if FuncLoadError then + begin + {$if not defined(X509_PKEY_new_allownil)} + X509_PKEY_new := @ERR_X509_PKEY_new; + {$ifend} + {$if declared(X509_PKEY_new_introduced)} + if LibVersion < X509_PKEY_new_introduced then + begin + {$if declared(FC_X509_PKEY_new)} + X509_PKEY_new := @FC_X509_PKEY_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_PKEY_new_removed)} + if X509_PKEY_new_removed <= LibVersion then + begin + {$if declared(_X509_PKEY_new)} + X509_PKEY_new := @_X509_PKEY_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_PKEY_new_allownil)} + if FuncLoadError then + AFailed.Add('X509_PKEY_new'); + {$ifend} + end; + + + X509_PKEY_free := LoadLibFunction(ADllHandle, X509_PKEY_free_procname); + FuncLoadError := not assigned(X509_PKEY_free); + if FuncLoadError then + begin + {$if not defined(X509_PKEY_free_allownil)} + X509_PKEY_free := @ERR_X509_PKEY_free; + {$ifend} + {$if declared(X509_PKEY_free_introduced)} + if LibVersion < X509_PKEY_free_introduced then + begin + {$if declared(FC_X509_PKEY_free)} + X509_PKEY_free := @FC_X509_PKEY_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_PKEY_free_removed)} + if X509_PKEY_free_removed <= LibVersion then + begin + {$if declared(_X509_PKEY_free)} + X509_PKEY_free := @_X509_PKEY_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_PKEY_free_allownil)} + if FuncLoadError then + AFailed.Add('X509_PKEY_free'); + {$ifend} + end; + + + X509_INFO_new := LoadLibFunction(ADllHandle, X509_INFO_new_procname); + FuncLoadError := not assigned(X509_INFO_new); + if FuncLoadError then + begin + {$if not defined(X509_INFO_new_allownil)} + X509_INFO_new := @ERR_X509_INFO_new; + {$ifend} + {$if declared(X509_INFO_new_introduced)} + if LibVersion < X509_INFO_new_introduced then + begin + {$if declared(FC_X509_INFO_new)} + X509_INFO_new := @FC_X509_INFO_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_INFO_new_removed)} + if X509_INFO_new_removed <= LibVersion then + begin + {$if declared(_X509_INFO_new)} + X509_INFO_new := @_X509_INFO_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_INFO_new_allownil)} + if FuncLoadError then + AFailed.Add('X509_INFO_new'); + {$ifend} + end; + + + X509_INFO_free := LoadLibFunction(ADllHandle, X509_INFO_free_procname); + FuncLoadError := not assigned(X509_INFO_free); + if FuncLoadError then + begin + {$if not defined(X509_INFO_free_allownil)} + X509_INFO_free := @ERR_X509_INFO_free; + {$ifend} + {$if declared(X509_INFO_free_introduced)} + if LibVersion < X509_INFO_free_introduced then + begin + {$if declared(FC_X509_INFO_free)} + X509_INFO_free := @FC_X509_INFO_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_INFO_free_removed)} + if X509_INFO_free_removed <= LibVersion then + begin + {$if declared(_X509_INFO_free)} + X509_INFO_free := @_X509_INFO_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_INFO_free_allownil)} + if FuncLoadError then + AFailed.Add('X509_INFO_free'); + {$ifend} + end; + + + X509_NAME_oneline := LoadLibFunction(ADllHandle, X509_NAME_oneline_procname); + FuncLoadError := not assigned(X509_NAME_oneline); + if FuncLoadError then + begin + {$if not defined(X509_NAME_oneline_allownil)} + X509_NAME_oneline := @ERR_X509_NAME_oneline; + {$ifend} + {$if declared(X509_NAME_oneline_introduced)} + if LibVersion < X509_NAME_oneline_introduced then + begin + {$if declared(FC_X509_NAME_oneline)} + X509_NAME_oneline := @FC_X509_NAME_oneline; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_NAME_oneline_removed)} + if X509_NAME_oneline_removed <= LibVersion then + begin + {$if declared(_X509_NAME_oneline)} + X509_NAME_oneline := @_X509_NAME_oneline; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_NAME_oneline_allownil)} + if FuncLoadError then + AFailed.Add('X509_NAME_oneline'); + {$ifend} + end; + + + ASN1_item_digest := LoadLibFunction(ADllHandle, ASN1_item_digest_procname); + FuncLoadError := not assigned(ASN1_item_digest); + if FuncLoadError then + begin + {$if not defined(ASN1_item_digest_allownil)} + ASN1_item_digest := @ERR_ASN1_item_digest; + {$ifend} + {$if declared(ASN1_item_digest_introduced)} + if LibVersion < ASN1_item_digest_introduced then + begin + {$if declared(FC_ASN1_item_digest)} + ASN1_item_digest := @FC_ASN1_item_digest; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_item_digest_removed)} + if ASN1_item_digest_removed <= LibVersion then + begin + {$if declared(_ASN1_item_digest)} + ASN1_item_digest := @_ASN1_item_digest; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_item_digest_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_item_digest'); + {$ifend} + end; + + + ASN1_item_verify := LoadLibFunction(ADllHandle, ASN1_item_verify_procname); + FuncLoadError := not assigned(ASN1_item_verify); + if FuncLoadError then + begin + {$if not defined(ASN1_item_verify_allownil)} + ASN1_item_verify := @ERR_ASN1_item_verify; + {$ifend} + {$if declared(ASN1_item_verify_introduced)} + if LibVersion < ASN1_item_verify_introduced then + begin + {$if declared(FC_ASN1_item_verify)} + ASN1_item_verify := @FC_ASN1_item_verify; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_item_verify_removed)} + if ASN1_item_verify_removed <= LibVersion then + begin + {$if declared(_ASN1_item_verify)} + ASN1_item_verify := @_ASN1_item_verify; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_item_verify_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_item_verify'); + {$ifend} + end; + + + ASN1_item_sign := LoadLibFunction(ADllHandle, ASN1_item_sign_procname); + FuncLoadError := not assigned(ASN1_item_sign); + if FuncLoadError then + begin + {$if not defined(ASN1_item_sign_allownil)} + ASN1_item_sign := @ERR_ASN1_item_sign; + {$ifend} + {$if declared(ASN1_item_sign_introduced)} + if LibVersion < ASN1_item_sign_introduced then + begin + {$if declared(FC_ASN1_item_sign)} + ASN1_item_sign := @FC_ASN1_item_sign; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_item_sign_removed)} + if ASN1_item_sign_removed <= LibVersion then + begin + {$if declared(_ASN1_item_sign)} + ASN1_item_sign := @_ASN1_item_sign; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_item_sign_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_item_sign'); + {$ifend} + end; + + + ASN1_item_sign_ctx := LoadLibFunction(ADllHandle, ASN1_item_sign_ctx_procname); + FuncLoadError := not assigned(ASN1_item_sign_ctx); + if FuncLoadError then + begin + {$if not defined(ASN1_item_sign_ctx_allownil)} + ASN1_item_sign_ctx := @ERR_ASN1_item_sign_ctx; + {$ifend} + {$if declared(ASN1_item_sign_ctx_introduced)} + if LibVersion < ASN1_item_sign_ctx_introduced then + begin + {$if declared(FC_ASN1_item_sign_ctx)} + ASN1_item_sign_ctx := @FC_ASN1_item_sign_ctx; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ASN1_item_sign_ctx_removed)} + if ASN1_item_sign_ctx_removed <= LibVersion then + begin + {$if declared(_ASN1_item_sign_ctx)} + ASN1_item_sign_ctx := @_ASN1_item_sign_ctx; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ASN1_item_sign_ctx_allownil)} + if FuncLoadError then + AFailed.Add('ASN1_item_sign_ctx'); + {$ifend} + end; + + + X509_get_version := LoadLibFunction(ADllHandle, X509_get_version_procname); + FuncLoadError := not assigned(X509_get_version); + if FuncLoadError then + begin + {$if not defined(X509_get_version_allownil)} + X509_get_version := @ERR_X509_get_version; + {$ifend} + {$if declared(X509_get_version_introduced)} + if LibVersion < X509_get_version_introduced then + begin + {$if declared(FC_X509_get_version)} + X509_get_version := @FC_X509_get_version; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_get_version_removed)} + if X509_get_version_removed <= LibVersion then + begin + {$if declared(_X509_get_version)} + X509_get_version := @_X509_get_version; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_get_version_allownil)} + if FuncLoadError then + AFailed.Add('X509_get_version'); + {$ifend} + end; + + {introduced 1.1.0} + X509_set_version := LoadLibFunction(ADllHandle, X509_set_version_procname); + FuncLoadError := not assigned(X509_set_version); + if FuncLoadError then + begin + {$if not defined(X509_set_version_allownil)} + X509_set_version := @ERR_X509_set_version; + {$ifend} + {$if declared(X509_set_version_introduced)} + if LibVersion < X509_set_version_introduced then + begin + {$if declared(FC_X509_set_version)} + X509_set_version := @FC_X509_set_version; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_set_version_removed)} + if X509_set_version_removed <= LibVersion then + begin + {$if declared(_X509_set_version)} + X509_set_version := @_X509_set_version; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_set_version_allownil)} + if FuncLoadError then + AFailed.Add('X509_set_version'); + {$ifend} + end; + + + X509_set_serialNumber := LoadLibFunction(ADllHandle, X509_set_serialNumber_procname); + FuncLoadError := not assigned(X509_set_serialNumber); + if FuncLoadError then + begin + {$if not defined(X509_set_serialNumber_allownil)} + X509_set_serialNumber := @ERR_X509_set_serialNumber; + {$ifend} + {$if declared(X509_set_serialNumber_introduced)} + if LibVersion < X509_set_serialNumber_introduced then + begin + {$if declared(FC_X509_set_serialNumber)} + X509_set_serialNumber := @FC_X509_set_serialNumber; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_set_serialNumber_removed)} + if X509_set_serialNumber_removed <= LibVersion then + begin + {$if declared(_X509_set_serialNumber)} + X509_set_serialNumber := @_X509_set_serialNumber; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_set_serialNumber_allownil)} + if FuncLoadError then + AFailed.Add('X509_set_serialNumber'); + {$ifend} + end; + + + X509_get_serialNumber := LoadLibFunction(ADllHandle, X509_get_serialNumber_procname); + FuncLoadError := not assigned(X509_get_serialNumber); + if FuncLoadError then + begin + {$if not defined(X509_get_serialNumber_allownil)} + X509_get_serialNumber := @ERR_X509_get_serialNumber; + {$ifend} + {$if declared(X509_get_serialNumber_introduced)} + if LibVersion < X509_get_serialNumber_introduced then + begin + {$if declared(FC_X509_get_serialNumber)} + X509_get_serialNumber := @FC_X509_get_serialNumber; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_get_serialNumber_removed)} + if X509_get_serialNumber_removed <= LibVersion then + begin + {$if declared(_X509_get_serialNumber)} + X509_get_serialNumber := @_X509_get_serialNumber; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_get_serialNumber_allownil)} + if FuncLoadError then + AFailed.Add('X509_get_serialNumber'); + {$ifend} + end; + + + X509_get0_serialNumber := LoadLibFunction(ADllHandle, X509_get0_serialNumber_procname); + FuncLoadError := not assigned(X509_get0_serialNumber); + if FuncLoadError then + begin + {$if not defined(X509_get0_serialNumber_allownil)} + X509_get0_serialNumber := @ERR_X509_get0_serialNumber; + {$ifend} + {$if declared(X509_get0_serialNumber_introduced)} + if LibVersion < X509_get0_serialNumber_introduced then + begin + {$if declared(FC_X509_get0_serialNumber)} + X509_get0_serialNumber := @FC_X509_get0_serialNumber; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_get0_serialNumber_removed)} + if X509_get0_serialNumber_removed <= LibVersion then + begin + {$if declared(_X509_get0_serialNumber)} + X509_get0_serialNumber := @_X509_get0_serialNumber; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_get0_serialNumber_allownil)} + if FuncLoadError then + AFailed.Add('X509_get0_serialNumber'); + {$ifend} + end; + + {introduced 1.1.0} + X509_set_issuer_name := LoadLibFunction(ADllHandle, X509_set_issuer_name_procname); + FuncLoadError := not assigned(X509_set_issuer_name); + if FuncLoadError then + begin + {$if not defined(X509_set_issuer_name_allownil)} + X509_set_issuer_name := @ERR_X509_set_issuer_name; + {$ifend} + {$if declared(X509_set_issuer_name_introduced)} + if LibVersion < X509_set_issuer_name_introduced then + begin + {$if declared(FC_X509_set_issuer_name)} + X509_set_issuer_name := @FC_X509_set_issuer_name; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_set_issuer_name_removed)} + if X509_set_issuer_name_removed <= LibVersion then + begin + {$if declared(_X509_set_issuer_name)} + X509_set_issuer_name := @_X509_set_issuer_name; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_set_issuer_name_allownil)} + if FuncLoadError then + AFailed.Add('X509_set_issuer_name'); + {$ifend} + end; + + + X509_get_issuer_name := LoadLibFunction(ADllHandle, X509_get_issuer_name_procname); + FuncLoadError := not assigned(X509_get_issuer_name); + if FuncLoadError then + begin + {$if not defined(X509_get_issuer_name_allownil)} + X509_get_issuer_name := @ERR_X509_get_issuer_name; + {$ifend} + {$if declared(X509_get_issuer_name_introduced)} + if LibVersion < X509_get_issuer_name_introduced then + begin + {$if declared(FC_X509_get_issuer_name)} + X509_get_issuer_name := @FC_X509_get_issuer_name; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_get_issuer_name_removed)} + if X509_get_issuer_name_removed <= LibVersion then + begin + {$if declared(_X509_get_issuer_name)} + X509_get_issuer_name := @_X509_get_issuer_name; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_get_issuer_name_allownil)} + if FuncLoadError then + AFailed.Add('X509_get_issuer_name'); + {$ifend} + end; + + + X509_set_subject_name := LoadLibFunction(ADllHandle, X509_set_subject_name_procname); + FuncLoadError := not assigned(X509_set_subject_name); + if FuncLoadError then + begin + {$if not defined(X509_set_subject_name_allownil)} + X509_set_subject_name := @ERR_X509_set_subject_name; + {$ifend} + {$if declared(X509_set_subject_name_introduced)} + if LibVersion < X509_set_subject_name_introduced then + begin + {$if declared(FC_X509_set_subject_name)} + X509_set_subject_name := @FC_X509_set_subject_name; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_set_subject_name_removed)} + if X509_set_subject_name_removed <= LibVersion then + begin + {$if declared(_X509_set_subject_name)} + X509_set_subject_name := @_X509_set_subject_name; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_set_subject_name_allownil)} + if FuncLoadError then + AFailed.Add('X509_set_subject_name'); + {$ifend} + end; + + + X509_get_subject_name := LoadLibFunction(ADllHandle, X509_get_subject_name_procname); + FuncLoadError := not assigned(X509_get_subject_name); + if FuncLoadError then + begin + {$if not defined(X509_get_subject_name_allownil)} + X509_get_subject_name := @ERR_X509_get_subject_name; + {$ifend} + {$if declared(X509_get_subject_name_introduced)} + if LibVersion < X509_get_subject_name_introduced then + begin + {$if declared(FC_X509_get_subject_name)} + X509_get_subject_name := @FC_X509_get_subject_name; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_get_subject_name_removed)} + if X509_get_subject_name_removed <= LibVersion then + begin + {$if declared(_X509_get_subject_name)} + X509_get_subject_name := @_X509_get_subject_name; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_get_subject_name_allownil)} + if FuncLoadError then + AFailed.Add('X509_get_subject_name'); + {$ifend} + end; + + + X509_get0_notBefore := LoadLibFunction(ADllHandle, X509_get0_notBefore_procname); + FuncLoadError := not assigned(X509_get0_notBefore); + if FuncLoadError then + begin + {$if not defined(X509_get0_notBefore_allownil)} + X509_get0_notBefore := @ERR_X509_get0_notBefore; + {$ifend} + {$if declared(X509_get0_notBefore_introduced)} + if LibVersion < X509_get0_notBefore_introduced then + begin + {$if declared(FC_X509_get0_notBefore)} + X509_get0_notBefore := @FC_X509_get0_notBefore; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_get0_notBefore_removed)} + if X509_get0_notBefore_removed <= LibVersion then + begin + {$if declared(_X509_get0_notBefore)} + X509_get0_notBefore := @_X509_get0_notBefore; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_get0_notBefore_allownil)} + if FuncLoadError then + AFailed.Add('X509_get0_notBefore'); + {$ifend} + end; + + {introduced 1.1.0} + X509_getm_notBefore := LoadLibFunction(ADllHandle, X509_getm_notBefore_procname); + FuncLoadError := not assigned(X509_getm_notBefore); + if FuncLoadError then + begin + {$if not defined(X509_getm_notBefore_allownil)} + X509_getm_notBefore := @ERR_X509_getm_notBefore; + {$ifend} + {$if declared(X509_getm_notBefore_introduced)} + if LibVersion < X509_getm_notBefore_introduced then + begin + {$if declared(FC_X509_getm_notBefore)} + X509_getm_notBefore := @FC_X509_getm_notBefore; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_getm_notBefore_removed)} + if X509_getm_notBefore_removed <= LibVersion then + begin + {$if declared(_X509_getm_notBefore)} + X509_getm_notBefore := @_X509_getm_notBefore; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_getm_notBefore_allownil)} + if FuncLoadError then + AFailed.Add('X509_getm_notBefore'); + {$ifend} + end; + + {introduced 1.1.0} + X509_set1_notBefore := LoadLibFunction(ADllHandle, X509_set1_notBefore_procname); + FuncLoadError := not assigned(X509_set1_notBefore); + if FuncLoadError then + begin + {$if not defined(X509_set1_notBefore_allownil)} + X509_set1_notBefore := @ERR_X509_set1_notBefore; + {$ifend} + {$if declared(X509_set1_notBefore_introduced)} + if LibVersion < X509_set1_notBefore_introduced then + begin + {$if declared(FC_X509_set1_notBefore)} + X509_set1_notBefore := @FC_X509_set1_notBefore; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_set1_notBefore_removed)} + if X509_set1_notBefore_removed <= LibVersion then + begin + {$if declared(_X509_set1_notBefore)} + X509_set1_notBefore := @_X509_set1_notBefore; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_set1_notBefore_allownil)} + if FuncLoadError then + AFailed.Add('X509_set1_notBefore'); + {$ifend} + end; + + {introduced 1.1.0} + X509_get0_notAfter := LoadLibFunction(ADllHandle, X509_get0_notAfter_procname); + FuncLoadError := not assigned(X509_get0_notAfter); + if FuncLoadError then + begin + {$if not defined(X509_get0_notAfter_allownil)} + X509_get0_notAfter := @ERR_X509_get0_notAfter; + {$ifend} + {$if declared(X509_get0_notAfter_introduced)} + if LibVersion < X509_get0_notAfter_introduced then + begin + {$if declared(FC_X509_get0_notAfter)} + X509_get0_notAfter := @FC_X509_get0_notAfter; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_get0_notAfter_removed)} + if X509_get0_notAfter_removed <= LibVersion then + begin + {$if declared(_X509_get0_notAfter)} + X509_get0_notAfter := @_X509_get0_notAfter; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_get0_notAfter_allownil)} + if FuncLoadError then + AFailed.Add('X509_get0_notAfter'); + {$ifend} + end; + + {introduced 1.1.0} + X509_getm_notAfter := LoadLibFunction(ADllHandle, X509_getm_notAfter_procname); + FuncLoadError := not assigned(X509_getm_notAfter); + if FuncLoadError then + begin + {$if not defined(X509_getm_notAfter_allownil)} + X509_getm_notAfter := @ERR_X509_getm_notAfter; + {$ifend} + {$if declared(X509_getm_notAfter_introduced)} + if LibVersion < X509_getm_notAfter_introduced then + begin + {$if declared(FC_X509_getm_notAfter)} + X509_getm_notAfter := @FC_X509_getm_notAfter; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_getm_notAfter_removed)} + if X509_getm_notAfter_removed <= LibVersion then + begin + {$if declared(_X509_getm_notAfter)} + X509_getm_notAfter := @_X509_getm_notAfter; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_getm_notAfter_allownil)} + if FuncLoadError then + AFailed.Add('X509_getm_notAfter'); + {$ifend} + end; + + {introduced 1.1.0} + X509_set1_notAfter := LoadLibFunction(ADllHandle, X509_set1_notAfter_procname); + FuncLoadError := not assigned(X509_set1_notAfter); + if FuncLoadError then + begin + {$if not defined(X509_set1_notAfter_allownil)} + X509_set1_notAfter := @ERR_X509_set1_notAfter; + {$ifend} + {$if declared(X509_set1_notAfter_introduced)} + if LibVersion < X509_set1_notAfter_introduced then + begin + {$if declared(FC_X509_set1_notAfter)} + X509_set1_notAfter := @FC_X509_set1_notAfter; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_set1_notAfter_removed)} + if X509_set1_notAfter_removed <= LibVersion then + begin + {$if declared(_X509_set1_notAfter)} + X509_set1_notAfter := @_X509_set1_notAfter; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_set1_notAfter_allownil)} + if FuncLoadError then + AFailed.Add('X509_set1_notAfter'); + {$ifend} + end; + + {introduced 1.1.0} + X509_set_pubkey := LoadLibFunction(ADllHandle, X509_set_pubkey_procname); + FuncLoadError := not assigned(X509_set_pubkey); + if FuncLoadError then + begin + {$if not defined(X509_set_pubkey_allownil)} + X509_set_pubkey := @ERR_X509_set_pubkey; + {$ifend} + {$if declared(X509_set_pubkey_introduced)} + if LibVersion < X509_set_pubkey_introduced then + begin + {$if declared(FC_X509_set_pubkey)} + X509_set_pubkey := @FC_X509_set_pubkey; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_set_pubkey_removed)} + if X509_set_pubkey_removed <= LibVersion then + begin + {$if declared(_X509_set_pubkey)} + X509_set_pubkey := @_X509_set_pubkey; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_set_pubkey_allownil)} + if FuncLoadError then + AFailed.Add('X509_set_pubkey'); + {$ifend} + end; + + + X509_up_ref := LoadLibFunction(ADllHandle, X509_up_ref_procname); + FuncLoadError := not assigned(X509_up_ref); + if FuncLoadError then + begin + {$if not defined(X509_up_ref_allownil)} + X509_up_ref := @ERR_X509_up_ref; + {$ifend} + {$if declared(X509_up_ref_introduced)} + if LibVersion < X509_up_ref_introduced then + begin + {$if declared(FC_X509_up_ref)} + X509_up_ref := @FC_X509_up_ref; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_up_ref_removed)} + if X509_up_ref_removed <= LibVersion then + begin + {$if declared(_X509_up_ref)} + X509_up_ref := @_X509_up_ref; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_up_ref_allownil)} + if FuncLoadError then + AFailed.Add('X509_up_ref'); + {$ifend} + end; + + {introduced 1.1.0} + X509_get_signature_type := LoadLibFunction(ADllHandle, X509_get_signature_type_procname); + FuncLoadError := not assigned(X509_get_signature_type); + if FuncLoadError then + begin + {$if not defined(X509_get_signature_type_allownil)} + X509_get_signature_type := @ERR_X509_get_signature_type; + {$ifend} + {$if declared(X509_get_signature_type_introduced)} + if LibVersion < X509_get_signature_type_introduced then + begin + {$if declared(FC_X509_get_signature_type)} + X509_get_signature_type := @FC_X509_get_signature_type; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_get_signature_type_removed)} + if X509_get_signature_type_removed <= LibVersion then + begin + {$if declared(_X509_get_signature_type)} + X509_get_signature_type := @_X509_get_signature_type; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_get_signature_type_allownil)} + if FuncLoadError then + AFailed.Add('X509_get_signature_type'); + {$ifend} + end; + + {introduced 1.1.0} + X509_get_X509_PUBKEY := LoadLibFunction(ADllHandle, X509_get_X509_PUBKEY_procname); + FuncLoadError := not assigned(X509_get_X509_PUBKEY); + if FuncLoadError then + begin + {$if not defined(X509_get_X509_PUBKEY_allownil)} + X509_get_X509_PUBKEY := @ERR_X509_get_X509_PUBKEY; + {$ifend} + {$if declared(X509_get_X509_PUBKEY_introduced)} + if LibVersion < X509_get_X509_PUBKEY_introduced then + begin + {$if declared(FC_X509_get_X509_PUBKEY)} + X509_get_X509_PUBKEY := @FC_X509_get_X509_PUBKEY; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_get_X509_PUBKEY_removed)} + if X509_get_X509_PUBKEY_removed <= LibVersion then + begin + {$if declared(_X509_get_X509_PUBKEY)} + X509_get_X509_PUBKEY := @_X509_get_X509_PUBKEY; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_get_X509_PUBKEY_allownil)} + if FuncLoadError then + AFailed.Add('X509_get_X509_PUBKEY'); + {$ifend} + end; + + {introduced 1.1.0} + X509_get0_uids := LoadLibFunction(ADllHandle, X509_get0_uids_procname); + FuncLoadError := not assigned(X509_get0_uids); + if FuncLoadError then + begin + {$if not defined(X509_get0_uids_allownil)} + X509_get0_uids := @ERR_X509_get0_uids; + {$ifend} + {$if declared(X509_get0_uids_introduced)} + if LibVersion < X509_get0_uids_introduced then + begin + {$if declared(FC_X509_get0_uids)} + X509_get0_uids := @FC_X509_get0_uids; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_get0_uids_removed)} + if X509_get0_uids_removed <= LibVersion then + begin + {$if declared(_X509_get0_uids)} + X509_get0_uids := @_X509_get0_uids; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_get0_uids_allownil)} + if FuncLoadError then + AFailed.Add('X509_get0_uids'); + {$ifend} + end; + + {introduced 1.1.0} + X509_get0_tbs_sigalg := LoadLibFunction(ADllHandle, X509_get0_tbs_sigalg_procname); + FuncLoadError := not assigned(X509_get0_tbs_sigalg); + if FuncLoadError then + begin + {$if not defined(X509_get0_tbs_sigalg_allownil)} + X509_get0_tbs_sigalg := @ERR_X509_get0_tbs_sigalg; + {$ifend} + {$if declared(X509_get0_tbs_sigalg_introduced)} + if LibVersion < X509_get0_tbs_sigalg_introduced then + begin + {$if declared(FC_X509_get0_tbs_sigalg)} + X509_get0_tbs_sigalg := @FC_X509_get0_tbs_sigalg; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_get0_tbs_sigalg_removed)} + if X509_get0_tbs_sigalg_removed <= LibVersion then + begin + {$if declared(_X509_get0_tbs_sigalg)} + X509_get0_tbs_sigalg := @_X509_get0_tbs_sigalg; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_get0_tbs_sigalg_allownil)} + if FuncLoadError then + AFailed.Add('X509_get0_tbs_sigalg'); + {$ifend} + end; + + {introduced 1.1.0} + X509_get0_pubkey := LoadLibFunction(ADllHandle, X509_get0_pubkey_procname); + FuncLoadError := not assigned(X509_get0_pubkey); + if FuncLoadError then + begin + {$if not defined(X509_get0_pubkey_allownil)} + X509_get0_pubkey := @ERR_X509_get0_pubkey; + {$ifend} + {$if declared(X509_get0_pubkey_introduced)} + if LibVersion < X509_get0_pubkey_introduced then + begin + {$if declared(FC_X509_get0_pubkey)} + X509_get0_pubkey := @FC_X509_get0_pubkey; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_get0_pubkey_removed)} + if X509_get0_pubkey_removed <= LibVersion then + begin + {$if declared(_X509_get0_pubkey)} + X509_get0_pubkey := @_X509_get0_pubkey; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_get0_pubkey_allownil)} + if FuncLoadError then + AFailed.Add('X509_get0_pubkey'); + {$ifend} + end; + + {introduced 1.1.0} + X509_get_pubkey := LoadLibFunction(ADllHandle, X509_get_pubkey_procname); + FuncLoadError := not assigned(X509_get_pubkey); + if FuncLoadError then + begin + {$if not defined(X509_get_pubkey_allownil)} + X509_get_pubkey := @ERR_X509_get_pubkey; + {$ifend} + {$if declared(X509_get_pubkey_introduced)} + if LibVersion < X509_get_pubkey_introduced then + begin + {$if declared(FC_X509_get_pubkey)} + X509_get_pubkey := @FC_X509_get_pubkey; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_get_pubkey_removed)} + if X509_get_pubkey_removed <= LibVersion then + begin + {$if declared(_X509_get_pubkey)} + X509_get_pubkey := @_X509_get_pubkey; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_get_pubkey_allownil)} + if FuncLoadError then + AFailed.Add('X509_get_pubkey'); + {$ifend} + end; + + + X509_get0_pubkey_bitstr := LoadLibFunction(ADllHandle, X509_get0_pubkey_bitstr_procname); + FuncLoadError := not assigned(X509_get0_pubkey_bitstr); + if FuncLoadError then + begin + {$if not defined(X509_get0_pubkey_bitstr_allownil)} + X509_get0_pubkey_bitstr := @ERR_X509_get0_pubkey_bitstr; + {$ifend} + {$if declared(X509_get0_pubkey_bitstr_introduced)} + if LibVersion < X509_get0_pubkey_bitstr_introduced then + begin + {$if declared(FC_X509_get0_pubkey_bitstr)} + X509_get0_pubkey_bitstr := @FC_X509_get0_pubkey_bitstr; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_get0_pubkey_bitstr_removed)} + if X509_get0_pubkey_bitstr_removed <= LibVersion then + begin + {$if declared(_X509_get0_pubkey_bitstr)} + X509_get0_pubkey_bitstr := @_X509_get0_pubkey_bitstr; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_get0_pubkey_bitstr_allownil)} + if FuncLoadError then + AFailed.Add('X509_get0_pubkey_bitstr'); + {$ifend} + end; + + + X509_certificate_type := LoadLibFunction(ADllHandle, X509_certificate_type_procname); + FuncLoadError := not assigned(X509_certificate_type); + if FuncLoadError then + begin + {$if not defined(X509_certificate_type_allownil)} + X509_certificate_type := @ERR_X509_certificate_type; + {$ifend} + {$if declared(X509_certificate_type_introduced)} + if LibVersion < X509_certificate_type_introduced then + begin + {$if declared(FC_X509_certificate_type)} + X509_certificate_type := @FC_X509_certificate_type; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_certificate_type_removed)} + if X509_certificate_type_removed <= LibVersion then + begin + {$if declared(_X509_certificate_type)} + X509_certificate_type := @_X509_certificate_type; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_certificate_type_allownil)} + if FuncLoadError then + AFailed.Add('X509_certificate_type'); + {$ifend} + end; + + + X509_REQ_get_version := LoadLibFunction(ADllHandle, X509_REQ_get_version_procname); + FuncLoadError := not assigned(X509_REQ_get_version); + if FuncLoadError then + begin + {$if not defined(X509_REQ_get_version_allownil)} + X509_REQ_get_version := @ERR_X509_REQ_get_version; + {$ifend} + {$if declared(X509_REQ_get_version_introduced)} + if LibVersion < X509_REQ_get_version_introduced then + begin + {$if declared(FC_X509_REQ_get_version)} + X509_REQ_get_version := @FC_X509_REQ_get_version; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_REQ_get_version_removed)} + if X509_REQ_get_version_removed <= LibVersion then + begin + {$if declared(_X509_REQ_get_version)} + X509_REQ_get_version := @_X509_REQ_get_version; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_REQ_get_version_allownil)} + if FuncLoadError then + AFailed.Add('X509_REQ_get_version'); + {$ifend} + end; + + {introduced 1.1.0} + X509_REQ_set_version := LoadLibFunction(ADllHandle, X509_REQ_set_version_procname); + FuncLoadError := not assigned(X509_REQ_set_version); + if FuncLoadError then + begin + {$if not defined(X509_REQ_set_version_allownil)} + X509_REQ_set_version := @ERR_X509_REQ_set_version; + {$ifend} + {$if declared(X509_REQ_set_version_introduced)} + if LibVersion < X509_REQ_set_version_introduced then + begin + {$if declared(FC_X509_REQ_set_version)} + X509_REQ_set_version := @FC_X509_REQ_set_version; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_REQ_set_version_removed)} + if X509_REQ_set_version_removed <= LibVersion then + begin + {$if declared(_X509_REQ_set_version)} + X509_REQ_set_version := @_X509_REQ_set_version; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_REQ_set_version_allownil)} + if FuncLoadError then + AFailed.Add('X509_REQ_set_version'); + {$ifend} + end; + + + X509_REQ_get_subject_name := LoadLibFunction(ADllHandle, X509_REQ_get_subject_name_procname); + FuncLoadError := not assigned(X509_REQ_get_subject_name); + if FuncLoadError then + begin + {$if not defined(X509_REQ_get_subject_name_allownil)} + X509_REQ_get_subject_name := @ERR_X509_REQ_get_subject_name; + {$ifend} + {$if declared(X509_REQ_get_subject_name_introduced)} + if LibVersion < X509_REQ_get_subject_name_introduced then + begin + {$if declared(FC_X509_REQ_get_subject_name)} + X509_REQ_get_subject_name := @FC_X509_REQ_get_subject_name; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_REQ_get_subject_name_removed)} + if X509_REQ_get_subject_name_removed <= LibVersion then + begin + {$if declared(_X509_REQ_get_subject_name)} + X509_REQ_get_subject_name := @_X509_REQ_get_subject_name; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_REQ_get_subject_name_allownil)} + if FuncLoadError then + AFailed.Add('X509_REQ_get_subject_name'); + {$ifend} + end; + + {introduced 1.1.0} + X509_REQ_set_subject_name := LoadLibFunction(ADllHandle, X509_REQ_set_subject_name_procname); + FuncLoadError := not assigned(X509_REQ_set_subject_name); + if FuncLoadError then + begin + {$if not defined(X509_REQ_set_subject_name_allownil)} + X509_REQ_set_subject_name := @ERR_X509_REQ_set_subject_name; + {$ifend} + {$if declared(X509_REQ_set_subject_name_introduced)} + if LibVersion < X509_REQ_set_subject_name_introduced then + begin + {$if declared(FC_X509_REQ_set_subject_name)} + X509_REQ_set_subject_name := @FC_X509_REQ_set_subject_name; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_REQ_set_subject_name_removed)} + if X509_REQ_set_subject_name_removed <= LibVersion then + begin + {$if declared(_X509_REQ_set_subject_name)} + X509_REQ_set_subject_name := @_X509_REQ_set_subject_name; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_REQ_set_subject_name_allownil)} + if FuncLoadError then + AFailed.Add('X509_REQ_set_subject_name'); + {$ifend} + end; + + + X509_REQ_get0_signature := LoadLibFunction(ADllHandle, X509_REQ_get0_signature_procname); + FuncLoadError := not assigned(X509_REQ_get0_signature); + if FuncLoadError then + begin + {$if not defined(X509_REQ_get0_signature_allownil)} + X509_REQ_get0_signature := @ERR_X509_REQ_get0_signature; + {$ifend} + {$if declared(X509_REQ_get0_signature_introduced)} + if LibVersion < X509_REQ_get0_signature_introduced then + begin + {$if declared(FC_X509_REQ_get0_signature)} + X509_REQ_get0_signature := @FC_X509_REQ_get0_signature; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_REQ_get0_signature_removed)} + if X509_REQ_get0_signature_removed <= LibVersion then + begin + {$if declared(_X509_REQ_get0_signature)} + X509_REQ_get0_signature := @_X509_REQ_get0_signature; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_REQ_get0_signature_allownil)} + if FuncLoadError then + AFailed.Add('X509_REQ_get0_signature'); + {$ifend} + end; + + {introduced 1.1.0} + X509_REQ_get_signature_nid := LoadLibFunction(ADllHandle, X509_REQ_get_signature_nid_procname); + FuncLoadError := not assigned(X509_REQ_get_signature_nid); + if FuncLoadError then + begin + {$if not defined(X509_REQ_get_signature_nid_allownil)} + X509_REQ_get_signature_nid := @ERR_X509_REQ_get_signature_nid; + {$ifend} + {$if declared(X509_REQ_get_signature_nid_introduced)} + if LibVersion < X509_REQ_get_signature_nid_introduced then + begin + {$if declared(FC_X509_REQ_get_signature_nid)} + X509_REQ_get_signature_nid := @FC_X509_REQ_get_signature_nid; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_REQ_get_signature_nid_removed)} + if X509_REQ_get_signature_nid_removed <= LibVersion then + begin + {$if declared(_X509_REQ_get_signature_nid)} + X509_REQ_get_signature_nid := @_X509_REQ_get_signature_nid; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_REQ_get_signature_nid_allownil)} + if FuncLoadError then + AFailed.Add('X509_REQ_get_signature_nid'); + {$ifend} + end; + + {introduced 1.1.0} + i2d_re_X509_REQ_tbs := LoadLibFunction(ADllHandle, i2d_re_X509_REQ_tbs_procname); + FuncLoadError := not assigned(i2d_re_X509_REQ_tbs); + if FuncLoadError then + begin + {$if not defined(i2d_re_X509_REQ_tbs_allownil)} + i2d_re_X509_REQ_tbs := @ERR_i2d_re_X509_REQ_tbs; + {$ifend} + {$if declared(i2d_re_X509_REQ_tbs_introduced)} + if LibVersion < i2d_re_X509_REQ_tbs_introduced then + begin + {$if declared(FC_i2d_re_X509_REQ_tbs)} + i2d_re_X509_REQ_tbs := @FC_i2d_re_X509_REQ_tbs; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(i2d_re_X509_REQ_tbs_removed)} + if i2d_re_X509_REQ_tbs_removed <= LibVersion then + begin + {$if declared(_i2d_re_X509_REQ_tbs)} + i2d_re_X509_REQ_tbs := @_i2d_re_X509_REQ_tbs; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(i2d_re_X509_REQ_tbs_allownil)} + if FuncLoadError then + AFailed.Add('i2d_re_X509_REQ_tbs'); + {$ifend} + end; + + {introduced 1.1.0} + X509_REQ_set_pubkey := LoadLibFunction(ADllHandle, X509_REQ_set_pubkey_procname); + FuncLoadError := not assigned(X509_REQ_set_pubkey); + if FuncLoadError then + begin + {$if not defined(X509_REQ_set_pubkey_allownil)} + X509_REQ_set_pubkey := @ERR_X509_REQ_set_pubkey; + {$ifend} + {$if declared(X509_REQ_set_pubkey_introduced)} + if LibVersion < X509_REQ_set_pubkey_introduced then + begin + {$if declared(FC_X509_REQ_set_pubkey)} + X509_REQ_set_pubkey := @FC_X509_REQ_set_pubkey; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_REQ_set_pubkey_removed)} + if X509_REQ_set_pubkey_removed <= LibVersion then + begin + {$if declared(_X509_REQ_set_pubkey)} + X509_REQ_set_pubkey := @_X509_REQ_set_pubkey; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_REQ_set_pubkey_allownil)} + if FuncLoadError then + AFailed.Add('X509_REQ_set_pubkey'); + {$ifend} + end; + + + X509_REQ_get_pubkey := LoadLibFunction(ADllHandle, X509_REQ_get_pubkey_procname); + FuncLoadError := not assigned(X509_REQ_get_pubkey); + if FuncLoadError then + begin + {$if not defined(X509_REQ_get_pubkey_allownil)} + X509_REQ_get_pubkey := @ERR_X509_REQ_get_pubkey; + {$ifend} + {$if declared(X509_REQ_get_pubkey_introduced)} + if LibVersion < X509_REQ_get_pubkey_introduced then + begin + {$if declared(FC_X509_REQ_get_pubkey)} + X509_REQ_get_pubkey := @FC_X509_REQ_get_pubkey; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_REQ_get_pubkey_removed)} + if X509_REQ_get_pubkey_removed <= LibVersion then + begin + {$if declared(_X509_REQ_get_pubkey)} + X509_REQ_get_pubkey := @_X509_REQ_get_pubkey; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_REQ_get_pubkey_allownil)} + if FuncLoadError then + AFailed.Add('X509_REQ_get_pubkey'); + {$ifend} + end; + + + X509_REQ_get0_pubkey := LoadLibFunction(ADllHandle, X509_REQ_get0_pubkey_procname); + FuncLoadError := not assigned(X509_REQ_get0_pubkey); + if FuncLoadError then + begin + {$if not defined(X509_REQ_get0_pubkey_allownil)} + X509_REQ_get0_pubkey := @ERR_X509_REQ_get0_pubkey; + {$ifend} + {$if declared(X509_REQ_get0_pubkey_introduced)} + if LibVersion < X509_REQ_get0_pubkey_introduced then + begin + {$if declared(FC_X509_REQ_get0_pubkey)} + X509_REQ_get0_pubkey := @FC_X509_REQ_get0_pubkey; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_REQ_get0_pubkey_removed)} + if X509_REQ_get0_pubkey_removed <= LibVersion then + begin + {$if declared(_X509_REQ_get0_pubkey)} + X509_REQ_get0_pubkey := @_X509_REQ_get0_pubkey; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_REQ_get0_pubkey_allownil)} + if FuncLoadError then + AFailed.Add('X509_REQ_get0_pubkey'); + {$ifend} + end; + + {introduced 1.1.0} + X509_REQ_get_X509_PUBKEY := LoadLibFunction(ADllHandle, X509_REQ_get_X509_PUBKEY_procname); + FuncLoadError := not assigned(X509_REQ_get_X509_PUBKEY); + if FuncLoadError then + begin + {$if not defined(X509_REQ_get_X509_PUBKEY_allownil)} + X509_REQ_get_X509_PUBKEY := @ERR_X509_REQ_get_X509_PUBKEY; + {$ifend} + {$if declared(X509_REQ_get_X509_PUBKEY_introduced)} + if LibVersion < X509_REQ_get_X509_PUBKEY_introduced then + begin + {$if declared(FC_X509_REQ_get_X509_PUBKEY)} + X509_REQ_get_X509_PUBKEY := @FC_X509_REQ_get_X509_PUBKEY; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_REQ_get_X509_PUBKEY_removed)} + if X509_REQ_get_X509_PUBKEY_removed <= LibVersion then + begin + {$if declared(_X509_REQ_get_X509_PUBKEY)} + X509_REQ_get_X509_PUBKEY := @_X509_REQ_get_X509_PUBKEY; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_REQ_get_X509_PUBKEY_allownil)} + if FuncLoadError then + AFailed.Add('X509_REQ_get_X509_PUBKEY'); + {$ifend} + end; + + {introduced 1.1.0} + X509_REQ_extension_nid := LoadLibFunction(ADllHandle, X509_REQ_extension_nid_procname); + FuncLoadError := not assigned(X509_REQ_extension_nid); + if FuncLoadError then + begin + {$if not defined(X509_REQ_extension_nid_allownil)} + X509_REQ_extension_nid := @ERR_X509_REQ_extension_nid; + {$ifend} + {$if declared(X509_REQ_extension_nid_introduced)} + if LibVersion < X509_REQ_extension_nid_introduced then + begin + {$if declared(FC_X509_REQ_extension_nid)} + X509_REQ_extension_nid := @FC_X509_REQ_extension_nid; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_REQ_extension_nid_removed)} + if X509_REQ_extension_nid_removed <= LibVersion then + begin + {$if declared(_X509_REQ_extension_nid)} + X509_REQ_extension_nid := @_X509_REQ_extension_nid; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_REQ_extension_nid_allownil)} + if FuncLoadError then + AFailed.Add('X509_REQ_extension_nid'); + {$ifend} + end; + + + X509_REQ_get_extension_nids := LoadLibFunction(ADllHandle, X509_REQ_get_extension_nids_procname); + FuncLoadError := not assigned(X509_REQ_get_extension_nids); + if FuncLoadError then + begin + {$if not defined(X509_REQ_get_extension_nids_allownil)} + X509_REQ_get_extension_nids := @ERR_X509_REQ_get_extension_nids; + {$ifend} + {$if declared(X509_REQ_get_extension_nids_introduced)} + if LibVersion < X509_REQ_get_extension_nids_introduced then + begin + {$if declared(FC_X509_REQ_get_extension_nids)} + X509_REQ_get_extension_nids := @FC_X509_REQ_get_extension_nids; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_REQ_get_extension_nids_removed)} + if X509_REQ_get_extension_nids_removed <= LibVersion then + begin + {$if declared(_X509_REQ_get_extension_nids)} + X509_REQ_get_extension_nids := @_X509_REQ_get_extension_nids; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_REQ_get_extension_nids_allownil)} + if FuncLoadError then + AFailed.Add('X509_REQ_get_extension_nids'); + {$ifend} + end; + + + X509_REQ_set_extension_nids := LoadLibFunction(ADllHandle, X509_REQ_set_extension_nids_procname); + FuncLoadError := not assigned(X509_REQ_set_extension_nids); + if FuncLoadError then + begin + {$if not defined(X509_REQ_set_extension_nids_allownil)} + X509_REQ_set_extension_nids := @ERR_X509_REQ_set_extension_nids; + {$ifend} + {$if declared(X509_REQ_set_extension_nids_introduced)} + if LibVersion < X509_REQ_set_extension_nids_introduced then + begin + {$if declared(FC_X509_REQ_set_extension_nids)} + X509_REQ_set_extension_nids := @FC_X509_REQ_set_extension_nids; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_REQ_set_extension_nids_removed)} + if X509_REQ_set_extension_nids_removed <= LibVersion then + begin + {$if declared(_X509_REQ_set_extension_nids)} + X509_REQ_set_extension_nids := @_X509_REQ_set_extension_nids; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_REQ_set_extension_nids_allownil)} + if FuncLoadError then + AFailed.Add('X509_REQ_set_extension_nids'); + {$ifend} + end; + + + X509_REQ_get_attr_count := LoadLibFunction(ADllHandle, X509_REQ_get_attr_count_procname); + FuncLoadError := not assigned(X509_REQ_get_attr_count); + if FuncLoadError then + begin + {$if not defined(X509_REQ_get_attr_count_allownil)} + X509_REQ_get_attr_count := @ERR_X509_REQ_get_attr_count; + {$ifend} + {$if declared(X509_REQ_get_attr_count_introduced)} + if LibVersion < X509_REQ_get_attr_count_introduced then + begin + {$if declared(FC_X509_REQ_get_attr_count)} + X509_REQ_get_attr_count := @FC_X509_REQ_get_attr_count; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_REQ_get_attr_count_removed)} + if X509_REQ_get_attr_count_removed <= LibVersion then + begin + {$if declared(_X509_REQ_get_attr_count)} + X509_REQ_get_attr_count := @_X509_REQ_get_attr_count; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_REQ_get_attr_count_allownil)} + if FuncLoadError then + AFailed.Add('X509_REQ_get_attr_count'); + {$ifend} + end; + + + X509_REQ_get_attr_by_NID := LoadLibFunction(ADllHandle, X509_REQ_get_attr_by_NID_procname); + FuncLoadError := not assigned(X509_REQ_get_attr_by_NID); + if FuncLoadError then + begin + {$if not defined(X509_REQ_get_attr_by_NID_allownil)} + X509_REQ_get_attr_by_NID := @ERR_X509_REQ_get_attr_by_NID; + {$ifend} + {$if declared(X509_REQ_get_attr_by_NID_introduced)} + if LibVersion < X509_REQ_get_attr_by_NID_introduced then + begin + {$if declared(FC_X509_REQ_get_attr_by_NID)} + X509_REQ_get_attr_by_NID := @FC_X509_REQ_get_attr_by_NID; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_REQ_get_attr_by_NID_removed)} + if X509_REQ_get_attr_by_NID_removed <= LibVersion then + begin + {$if declared(_X509_REQ_get_attr_by_NID)} + X509_REQ_get_attr_by_NID := @_X509_REQ_get_attr_by_NID; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_REQ_get_attr_by_NID_allownil)} + if FuncLoadError then + AFailed.Add('X509_REQ_get_attr_by_NID'); + {$ifend} + end; + + + X509_REQ_get_attr_by_OBJ := LoadLibFunction(ADllHandle, X509_REQ_get_attr_by_OBJ_procname); + FuncLoadError := not assigned(X509_REQ_get_attr_by_OBJ); + if FuncLoadError then + begin + {$if not defined(X509_REQ_get_attr_by_OBJ_allownil)} + X509_REQ_get_attr_by_OBJ := @ERR_X509_REQ_get_attr_by_OBJ; + {$ifend} + {$if declared(X509_REQ_get_attr_by_OBJ_introduced)} + if LibVersion < X509_REQ_get_attr_by_OBJ_introduced then + begin + {$if declared(FC_X509_REQ_get_attr_by_OBJ)} + X509_REQ_get_attr_by_OBJ := @FC_X509_REQ_get_attr_by_OBJ; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_REQ_get_attr_by_OBJ_removed)} + if X509_REQ_get_attr_by_OBJ_removed <= LibVersion then + begin + {$if declared(_X509_REQ_get_attr_by_OBJ)} + X509_REQ_get_attr_by_OBJ := @_X509_REQ_get_attr_by_OBJ; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_REQ_get_attr_by_OBJ_allownil)} + if FuncLoadError then + AFailed.Add('X509_REQ_get_attr_by_OBJ'); + {$ifend} + end; + + + X509_REQ_get_attr := LoadLibFunction(ADllHandle, X509_REQ_get_attr_procname); + FuncLoadError := not assigned(X509_REQ_get_attr); + if FuncLoadError then + begin + {$if not defined(X509_REQ_get_attr_allownil)} + X509_REQ_get_attr := @ERR_X509_REQ_get_attr; + {$ifend} + {$if declared(X509_REQ_get_attr_introduced)} + if LibVersion < X509_REQ_get_attr_introduced then + begin + {$if declared(FC_X509_REQ_get_attr)} + X509_REQ_get_attr := @FC_X509_REQ_get_attr; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_REQ_get_attr_removed)} + if X509_REQ_get_attr_removed <= LibVersion then + begin + {$if declared(_X509_REQ_get_attr)} + X509_REQ_get_attr := @_X509_REQ_get_attr; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_REQ_get_attr_allownil)} + if FuncLoadError then + AFailed.Add('X509_REQ_get_attr'); + {$ifend} + end; + + + X509_REQ_delete_attr := LoadLibFunction(ADllHandle, X509_REQ_delete_attr_procname); + FuncLoadError := not assigned(X509_REQ_delete_attr); + if FuncLoadError then + begin + {$if not defined(X509_REQ_delete_attr_allownil)} + X509_REQ_delete_attr := @ERR_X509_REQ_delete_attr; + {$ifend} + {$if declared(X509_REQ_delete_attr_introduced)} + if LibVersion < X509_REQ_delete_attr_introduced then + begin + {$if declared(FC_X509_REQ_delete_attr)} + X509_REQ_delete_attr := @FC_X509_REQ_delete_attr; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_REQ_delete_attr_removed)} + if X509_REQ_delete_attr_removed <= LibVersion then + begin + {$if declared(_X509_REQ_delete_attr)} + X509_REQ_delete_attr := @_X509_REQ_delete_attr; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_REQ_delete_attr_allownil)} + if FuncLoadError then + AFailed.Add('X509_REQ_delete_attr'); + {$ifend} + end; + + + X509_REQ_add1_attr := LoadLibFunction(ADllHandle, X509_REQ_add1_attr_procname); + FuncLoadError := not assigned(X509_REQ_add1_attr); + if FuncLoadError then + begin + {$if not defined(X509_REQ_add1_attr_allownil)} + X509_REQ_add1_attr := @ERR_X509_REQ_add1_attr; + {$ifend} + {$if declared(X509_REQ_add1_attr_introduced)} + if LibVersion < X509_REQ_add1_attr_introduced then + begin + {$if declared(FC_X509_REQ_add1_attr)} + X509_REQ_add1_attr := @FC_X509_REQ_add1_attr; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_REQ_add1_attr_removed)} + if X509_REQ_add1_attr_removed <= LibVersion then + begin + {$if declared(_X509_REQ_add1_attr)} + X509_REQ_add1_attr := @_X509_REQ_add1_attr; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_REQ_add1_attr_allownil)} + if FuncLoadError then + AFailed.Add('X509_REQ_add1_attr'); + {$ifend} + end; + + + X509_REQ_add1_attr_by_OBJ := LoadLibFunction(ADllHandle, X509_REQ_add1_attr_by_OBJ_procname); + FuncLoadError := not assigned(X509_REQ_add1_attr_by_OBJ); + if FuncLoadError then + begin + {$if not defined(X509_REQ_add1_attr_by_OBJ_allownil)} + X509_REQ_add1_attr_by_OBJ := @ERR_X509_REQ_add1_attr_by_OBJ; + {$ifend} + {$if declared(X509_REQ_add1_attr_by_OBJ_introduced)} + if LibVersion < X509_REQ_add1_attr_by_OBJ_introduced then + begin + {$if declared(FC_X509_REQ_add1_attr_by_OBJ)} + X509_REQ_add1_attr_by_OBJ := @FC_X509_REQ_add1_attr_by_OBJ; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_REQ_add1_attr_by_OBJ_removed)} + if X509_REQ_add1_attr_by_OBJ_removed <= LibVersion then + begin + {$if declared(_X509_REQ_add1_attr_by_OBJ)} + X509_REQ_add1_attr_by_OBJ := @_X509_REQ_add1_attr_by_OBJ; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_REQ_add1_attr_by_OBJ_allownil)} + if FuncLoadError then + AFailed.Add('X509_REQ_add1_attr_by_OBJ'); + {$ifend} + end; + + + X509_REQ_add1_attr_by_NID := LoadLibFunction(ADllHandle, X509_REQ_add1_attr_by_NID_procname); + FuncLoadError := not assigned(X509_REQ_add1_attr_by_NID); + if FuncLoadError then + begin + {$if not defined(X509_REQ_add1_attr_by_NID_allownil)} + X509_REQ_add1_attr_by_NID := @ERR_X509_REQ_add1_attr_by_NID; + {$ifend} + {$if declared(X509_REQ_add1_attr_by_NID_introduced)} + if LibVersion < X509_REQ_add1_attr_by_NID_introduced then + begin + {$if declared(FC_X509_REQ_add1_attr_by_NID)} + X509_REQ_add1_attr_by_NID := @FC_X509_REQ_add1_attr_by_NID; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_REQ_add1_attr_by_NID_removed)} + if X509_REQ_add1_attr_by_NID_removed <= LibVersion then + begin + {$if declared(_X509_REQ_add1_attr_by_NID)} + X509_REQ_add1_attr_by_NID := @_X509_REQ_add1_attr_by_NID; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_REQ_add1_attr_by_NID_allownil)} + if FuncLoadError then + AFailed.Add('X509_REQ_add1_attr_by_NID'); + {$ifend} + end; + + + X509_REQ_add1_attr_by_txt := LoadLibFunction(ADllHandle, X509_REQ_add1_attr_by_txt_procname); + FuncLoadError := not assigned(X509_REQ_add1_attr_by_txt); + if FuncLoadError then + begin + {$if not defined(X509_REQ_add1_attr_by_txt_allownil)} + X509_REQ_add1_attr_by_txt := @ERR_X509_REQ_add1_attr_by_txt; + {$ifend} + {$if declared(X509_REQ_add1_attr_by_txt_introduced)} + if LibVersion < X509_REQ_add1_attr_by_txt_introduced then + begin + {$if declared(FC_X509_REQ_add1_attr_by_txt)} + X509_REQ_add1_attr_by_txt := @FC_X509_REQ_add1_attr_by_txt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_REQ_add1_attr_by_txt_removed)} + if X509_REQ_add1_attr_by_txt_removed <= LibVersion then + begin + {$if declared(_X509_REQ_add1_attr_by_txt)} + X509_REQ_add1_attr_by_txt := @_X509_REQ_add1_attr_by_txt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_REQ_add1_attr_by_txt_allownil)} + if FuncLoadError then + AFailed.Add('X509_REQ_add1_attr_by_txt'); + {$ifend} + end; + + + X509_CRL_set_version := LoadLibFunction(ADllHandle, X509_CRL_set_version_procname); + FuncLoadError := not assigned(X509_CRL_set_version); + if FuncLoadError then + begin + {$if not defined(X509_CRL_set_version_allownil)} + X509_CRL_set_version := @ERR_X509_CRL_set_version; + {$ifend} + {$if declared(X509_CRL_set_version_introduced)} + if LibVersion < X509_CRL_set_version_introduced then + begin + {$if declared(FC_X509_CRL_set_version)} + X509_CRL_set_version := @FC_X509_CRL_set_version; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_CRL_set_version_removed)} + if X509_CRL_set_version_removed <= LibVersion then + begin + {$if declared(_X509_CRL_set_version)} + X509_CRL_set_version := @_X509_CRL_set_version; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_CRL_set_version_allownil)} + if FuncLoadError then + AFailed.Add('X509_CRL_set_version'); + {$ifend} + end; + + + X509_CRL_set_issuer_name := LoadLibFunction(ADllHandle, X509_CRL_set_issuer_name_procname); + FuncLoadError := not assigned(X509_CRL_set_issuer_name); + if FuncLoadError then + begin + {$if not defined(X509_CRL_set_issuer_name_allownil)} + X509_CRL_set_issuer_name := @ERR_X509_CRL_set_issuer_name; + {$ifend} + {$if declared(X509_CRL_set_issuer_name_introduced)} + if LibVersion < X509_CRL_set_issuer_name_introduced then + begin + {$if declared(FC_X509_CRL_set_issuer_name)} + X509_CRL_set_issuer_name := @FC_X509_CRL_set_issuer_name; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_CRL_set_issuer_name_removed)} + if X509_CRL_set_issuer_name_removed <= LibVersion then + begin + {$if declared(_X509_CRL_set_issuer_name)} + X509_CRL_set_issuer_name := @_X509_CRL_set_issuer_name; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_CRL_set_issuer_name_allownil)} + if FuncLoadError then + AFailed.Add('X509_CRL_set_issuer_name'); + {$ifend} + end; + + + X509_CRL_set1_lastUpdate := LoadLibFunction(ADllHandle, X509_CRL_set1_lastUpdate_procname); + FuncLoadError := not assigned(X509_CRL_set1_lastUpdate); + if FuncLoadError then + begin + {$if not defined(X509_CRL_set1_lastUpdate_allownil)} + X509_CRL_set1_lastUpdate := @ERR_X509_CRL_set1_lastUpdate; + {$ifend} + {$if declared(X509_CRL_set1_lastUpdate_introduced)} + if LibVersion < X509_CRL_set1_lastUpdate_introduced then + begin + {$if declared(FC_X509_CRL_set1_lastUpdate)} + X509_CRL_set1_lastUpdate := @FC_X509_CRL_set1_lastUpdate; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_CRL_set1_lastUpdate_removed)} + if X509_CRL_set1_lastUpdate_removed <= LibVersion then + begin + {$if declared(_X509_CRL_set1_lastUpdate)} + X509_CRL_set1_lastUpdate := @_X509_CRL_set1_lastUpdate; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_CRL_set1_lastUpdate_allownil)} + if FuncLoadError then + AFailed.Add('X509_CRL_set1_lastUpdate'); + {$ifend} + end; + + {introduced 1.1.0} + X509_CRL_set1_nextUpdate := LoadLibFunction(ADllHandle, X509_CRL_set1_nextUpdate_procname); + FuncLoadError := not assigned(X509_CRL_set1_nextUpdate); + if FuncLoadError then + begin + {$if not defined(X509_CRL_set1_nextUpdate_allownil)} + X509_CRL_set1_nextUpdate := @ERR_X509_CRL_set1_nextUpdate; + {$ifend} + {$if declared(X509_CRL_set1_nextUpdate_introduced)} + if LibVersion < X509_CRL_set1_nextUpdate_introduced then + begin + {$if declared(FC_X509_CRL_set1_nextUpdate)} + X509_CRL_set1_nextUpdate := @FC_X509_CRL_set1_nextUpdate; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_CRL_set1_nextUpdate_removed)} + if X509_CRL_set1_nextUpdate_removed <= LibVersion then + begin + {$if declared(_X509_CRL_set1_nextUpdate)} + X509_CRL_set1_nextUpdate := @_X509_CRL_set1_nextUpdate; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_CRL_set1_nextUpdate_allownil)} + if FuncLoadError then + AFailed.Add('X509_CRL_set1_nextUpdate'); + {$ifend} + end; + + {introduced 1.1.0} + X509_CRL_sort := LoadLibFunction(ADllHandle, X509_CRL_sort_procname); + FuncLoadError := not assigned(X509_CRL_sort); + if FuncLoadError then + begin + {$if not defined(X509_CRL_sort_allownil)} + X509_CRL_sort := @ERR_X509_CRL_sort; + {$ifend} + {$if declared(X509_CRL_sort_introduced)} + if LibVersion < X509_CRL_sort_introduced then + begin + {$if declared(FC_X509_CRL_sort)} + X509_CRL_sort := @FC_X509_CRL_sort; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_CRL_sort_removed)} + if X509_CRL_sort_removed <= LibVersion then + begin + {$if declared(_X509_CRL_sort)} + X509_CRL_sort := @_X509_CRL_sort; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_CRL_sort_allownil)} + if FuncLoadError then + AFailed.Add('X509_CRL_sort'); + {$ifend} + end; + + + X509_CRL_up_ref := LoadLibFunction(ADllHandle, X509_CRL_up_ref_procname); + FuncLoadError := not assigned(X509_CRL_up_ref); + if FuncLoadError then + begin + {$if not defined(X509_CRL_up_ref_allownil)} + X509_CRL_up_ref := @ERR_X509_CRL_up_ref; + {$ifend} + {$if declared(X509_CRL_up_ref_introduced)} + if LibVersion < X509_CRL_up_ref_introduced then + begin + {$if declared(FC_X509_CRL_up_ref)} + X509_CRL_up_ref := @FC_X509_CRL_up_ref; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_CRL_up_ref_removed)} + if X509_CRL_up_ref_removed <= LibVersion then + begin + {$if declared(_X509_CRL_up_ref)} + X509_CRL_up_ref := @_X509_CRL_up_ref; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_CRL_up_ref_allownil)} + if FuncLoadError then + AFailed.Add('X509_CRL_up_ref'); + {$ifend} + end; + + {introduced 1.1.0} + X509_CRL_get_version := LoadLibFunction(ADllHandle, X509_CRL_get_version_procname); + FuncLoadError := not assigned(X509_CRL_get_version); + if FuncLoadError then + begin + {$if not defined(X509_CRL_get_version_allownil)} + X509_CRL_get_version := @ERR_X509_CRL_get_version; + {$ifend} + {$if declared(X509_CRL_get_version_introduced)} + if LibVersion < X509_CRL_get_version_introduced then + begin + {$if declared(FC_X509_CRL_get_version)} + X509_CRL_get_version := @FC_X509_CRL_get_version; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_CRL_get_version_removed)} + if X509_CRL_get_version_removed <= LibVersion then + begin + {$if declared(_X509_CRL_get_version)} + X509_CRL_get_version := @_X509_CRL_get_version; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_CRL_get_version_allownil)} + if FuncLoadError then + AFailed.Add('X509_CRL_get_version'); + {$ifend} + end; + + {introduced 1.1.0} + X509_CRL_get0_lastUpdate := LoadLibFunction(ADllHandle, X509_CRL_get0_lastUpdate_procname); + FuncLoadError := not assigned(X509_CRL_get0_lastUpdate); + if FuncLoadError then + begin + {$if not defined(X509_CRL_get0_lastUpdate_allownil)} + X509_CRL_get0_lastUpdate := @ERR_X509_CRL_get0_lastUpdate; + {$ifend} + {$if declared(X509_CRL_get0_lastUpdate_introduced)} + if LibVersion < X509_CRL_get0_lastUpdate_introduced then + begin + {$if declared(FC_X509_CRL_get0_lastUpdate)} + X509_CRL_get0_lastUpdate := @FC_X509_CRL_get0_lastUpdate; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_CRL_get0_lastUpdate_removed)} + if X509_CRL_get0_lastUpdate_removed <= LibVersion then + begin + {$if declared(_X509_CRL_get0_lastUpdate)} + X509_CRL_get0_lastUpdate := @_X509_CRL_get0_lastUpdate; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_CRL_get0_lastUpdate_allownil)} + if FuncLoadError then + AFailed.Add('X509_CRL_get0_lastUpdate'); + {$ifend} + end; + + {introduced 1.1.0} + X509_CRL_get0_nextUpdate := LoadLibFunction(ADllHandle, X509_CRL_get0_nextUpdate_procname); + FuncLoadError := not assigned(X509_CRL_get0_nextUpdate); + if FuncLoadError then + begin + {$if not defined(X509_CRL_get0_nextUpdate_allownil)} + X509_CRL_get0_nextUpdate := @ERR_X509_CRL_get0_nextUpdate; + {$ifend} + {$if declared(X509_CRL_get0_nextUpdate_introduced)} + if LibVersion < X509_CRL_get0_nextUpdate_introduced then + begin + {$if declared(FC_X509_CRL_get0_nextUpdate)} + X509_CRL_get0_nextUpdate := @FC_X509_CRL_get0_nextUpdate; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_CRL_get0_nextUpdate_removed)} + if X509_CRL_get0_nextUpdate_removed <= LibVersion then + begin + {$if declared(_X509_CRL_get0_nextUpdate)} + X509_CRL_get0_nextUpdate := @_X509_CRL_get0_nextUpdate; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_CRL_get0_nextUpdate_allownil)} + if FuncLoadError then + AFailed.Add('X509_CRL_get0_nextUpdate'); + {$ifend} + end; + + {introduced 1.1.0} + X509_CRL_get_issuer := LoadLibFunction(ADllHandle, X509_CRL_get_issuer_procname); + FuncLoadError := not assigned(X509_CRL_get_issuer); + if FuncLoadError then + begin + {$if not defined(X509_CRL_get_issuer_allownil)} + X509_CRL_get_issuer := @ERR_X509_CRL_get_issuer; + {$ifend} + {$if declared(X509_CRL_get_issuer_introduced)} + if LibVersion < X509_CRL_get_issuer_introduced then + begin + {$if declared(FC_X509_CRL_get_issuer)} + X509_CRL_get_issuer := @FC_X509_CRL_get_issuer; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_CRL_get_issuer_removed)} + if X509_CRL_get_issuer_removed <= LibVersion then + begin + {$if declared(_X509_CRL_get_issuer)} + X509_CRL_get_issuer := @_X509_CRL_get_issuer; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_CRL_get_issuer_allownil)} + if FuncLoadError then + AFailed.Add('X509_CRL_get_issuer'); + {$ifend} + end; + + {introduced 1.1.0} + X509_CRL_get0_signature := LoadLibFunction(ADllHandle, X509_CRL_get0_signature_procname); + FuncLoadError := not assigned(X509_CRL_get0_signature); + if FuncLoadError then + begin + {$if not defined(X509_CRL_get0_signature_allownil)} + X509_CRL_get0_signature := @ERR_X509_CRL_get0_signature; + {$ifend} + {$if declared(X509_CRL_get0_signature_introduced)} + if LibVersion < X509_CRL_get0_signature_introduced then + begin + {$if declared(FC_X509_CRL_get0_signature)} + X509_CRL_get0_signature := @FC_X509_CRL_get0_signature; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_CRL_get0_signature_removed)} + if X509_CRL_get0_signature_removed <= LibVersion then + begin + {$if declared(_X509_CRL_get0_signature)} + X509_CRL_get0_signature := @_X509_CRL_get0_signature; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_CRL_get0_signature_allownil)} + if FuncLoadError then + AFailed.Add('X509_CRL_get0_signature'); + {$ifend} + end; + + {introduced 1.1.0} + X509_CRL_get_signature_nid := LoadLibFunction(ADllHandle, X509_CRL_get_signature_nid_procname); + FuncLoadError := not assigned(X509_CRL_get_signature_nid); + if FuncLoadError then + begin + {$if not defined(X509_CRL_get_signature_nid_allownil)} + X509_CRL_get_signature_nid := @ERR_X509_CRL_get_signature_nid; + {$ifend} + {$if declared(X509_CRL_get_signature_nid_introduced)} + if LibVersion < X509_CRL_get_signature_nid_introduced then + begin + {$if declared(FC_X509_CRL_get_signature_nid)} + X509_CRL_get_signature_nid := @FC_X509_CRL_get_signature_nid; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_CRL_get_signature_nid_removed)} + if X509_CRL_get_signature_nid_removed <= LibVersion then + begin + {$if declared(_X509_CRL_get_signature_nid)} + X509_CRL_get_signature_nid := @_X509_CRL_get_signature_nid; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_CRL_get_signature_nid_allownil)} + if FuncLoadError then + AFailed.Add('X509_CRL_get_signature_nid'); + {$ifend} + end; + + {introduced 1.1.0} + i2d_re_X509_CRL_tbs := LoadLibFunction(ADllHandle, i2d_re_X509_CRL_tbs_procname); + FuncLoadError := not assigned(i2d_re_X509_CRL_tbs); + if FuncLoadError then + begin + {$if not defined(i2d_re_X509_CRL_tbs_allownil)} + i2d_re_X509_CRL_tbs := @ERR_i2d_re_X509_CRL_tbs; + {$ifend} + {$if declared(i2d_re_X509_CRL_tbs_introduced)} + if LibVersion < i2d_re_X509_CRL_tbs_introduced then + begin + {$if declared(FC_i2d_re_X509_CRL_tbs)} + i2d_re_X509_CRL_tbs := @FC_i2d_re_X509_CRL_tbs; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(i2d_re_X509_CRL_tbs_removed)} + if i2d_re_X509_CRL_tbs_removed <= LibVersion then + begin + {$if declared(_i2d_re_X509_CRL_tbs)} + i2d_re_X509_CRL_tbs := @_i2d_re_X509_CRL_tbs; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(i2d_re_X509_CRL_tbs_allownil)} + if FuncLoadError then + AFailed.Add('i2d_re_X509_CRL_tbs'); + {$ifend} + end; + + {introduced 1.1.0} + X509_REVOKED_get0_serialNumber := LoadLibFunction(ADllHandle, X509_REVOKED_get0_serialNumber_procname); + FuncLoadError := not assigned(X509_REVOKED_get0_serialNumber); + if FuncLoadError then + begin + {$if not defined(X509_REVOKED_get0_serialNumber_allownil)} + X509_REVOKED_get0_serialNumber := @ERR_X509_REVOKED_get0_serialNumber; + {$ifend} + {$if declared(X509_REVOKED_get0_serialNumber_introduced)} + if LibVersion < X509_REVOKED_get0_serialNumber_introduced then + begin + {$if declared(FC_X509_REVOKED_get0_serialNumber)} + X509_REVOKED_get0_serialNumber := @FC_X509_REVOKED_get0_serialNumber; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_REVOKED_get0_serialNumber_removed)} + if X509_REVOKED_get0_serialNumber_removed <= LibVersion then + begin + {$if declared(_X509_REVOKED_get0_serialNumber)} + X509_REVOKED_get0_serialNumber := @_X509_REVOKED_get0_serialNumber; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_REVOKED_get0_serialNumber_allownil)} + if FuncLoadError then + AFailed.Add('X509_REVOKED_get0_serialNumber'); + {$ifend} + end; + + {introduced 1.1.0} + X509_REVOKED_set_serialNumber := LoadLibFunction(ADllHandle, X509_REVOKED_set_serialNumber_procname); + FuncLoadError := not assigned(X509_REVOKED_set_serialNumber); + if FuncLoadError then + begin + {$if not defined(X509_REVOKED_set_serialNumber_allownil)} + X509_REVOKED_set_serialNumber := @ERR_X509_REVOKED_set_serialNumber; + {$ifend} + {$if declared(X509_REVOKED_set_serialNumber_introduced)} + if LibVersion < X509_REVOKED_set_serialNumber_introduced then + begin + {$if declared(FC_X509_REVOKED_set_serialNumber)} + X509_REVOKED_set_serialNumber := @FC_X509_REVOKED_set_serialNumber; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_REVOKED_set_serialNumber_removed)} + if X509_REVOKED_set_serialNumber_removed <= LibVersion then + begin + {$if declared(_X509_REVOKED_set_serialNumber)} + X509_REVOKED_set_serialNumber := @_X509_REVOKED_set_serialNumber; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_REVOKED_set_serialNumber_allownil)} + if FuncLoadError then + AFailed.Add('X509_REVOKED_set_serialNumber'); + {$ifend} + end; + + + X509_REVOKED_get0_revocationDate := LoadLibFunction(ADllHandle, X509_REVOKED_get0_revocationDate_procname); + FuncLoadError := not assigned(X509_REVOKED_get0_revocationDate); + if FuncLoadError then + begin + {$if not defined(X509_REVOKED_get0_revocationDate_allownil)} + X509_REVOKED_get0_revocationDate := @ERR_X509_REVOKED_get0_revocationDate; + {$ifend} + {$if declared(X509_REVOKED_get0_revocationDate_introduced)} + if LibVersion < X509_REVOKED_get0_revocationDate_introduced then + begin + {$if declared(FC_X509_REVOKED_get0_revocationDate)} + X509_REVOKED_get0_revocationDate := @FC_X509_REVOKED_get0_revocationDate; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_REVOKED_get0_revocationDate_removed)} + if X509_REVOKED_get0_revocationDate_removed <= LibVersion then + begin + {$if declared(_X509_REVOKED_get0_revocationDate)} + X509_REVOKED_get0_revocationDate := @_X509_REVOKED_get0_revocationDate; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_REVOKED_get0_revocationDate_allownil)} + if FuncLoadError then + AFailed.Add('X509_REVOKED_get0_revocationDate'); + {$ifend} + end; + + {introduced 1.1.0} + X509_REVOKED_set_revocationDate := LoadLibFunction(ADllHandle, X509_REVOKED_set_revocationDate_procname); + FuncLoadError := not assigned(X509_REVOKED_set_revocationDate); + if FuncLoadError then + begin + {$if not defined(X509_REVOKED_set_revocationDate_allownil)} + X509_REVOKED_set_revocationDate := @ERR_X509_REVOKED_set_revocationDate; + {$ifend} + {$if declared(X509_REVOKED_set_revocationDate_introduced)} + if LibVersion < X509_REVOKED_set_revocationDate_introduced then + begin + {$if declared(FC_X509_REVOKED_set_revocationDate)} + X509_REVOKED_set_revocationDate := @FC_X509_REVOKED_set_revocationDate; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_REVOKED_set_revocationDate_removed)} + if X509_REVOKED_set_revocationDate_removed <= LibVersion then + begin + {$if declared(_X509_REVOKED_set_revocationDate)} + X509_REVOKED_set_revocationDate := @_X509_REVOKED_set_revocationDate; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_REVOKED_set_revocationDate_allownil)} + if FuncLoadError then + AFailed.Add('X509_REVOKED_set_revocationDate'); + {$ifend} + end; + + + X509_CRL_diff := LoadLibFunction(ADllHandle, X509_CRL_diff_procname); + FuncLoadError := not assigned(X509_CRL_diff); + if FuncLoadError then + begin + {$if not defined(X509_CRL_diff_allownil)} + X509_CRL_diff := @ERR_X509_CRL_diff; + {$ifend} + {$if declared(X509_CRL_diff_introduced)} + if LibVersion < X509_CRL_diff_introduced then + begin + {$if declared(FC_X509_CRL_diff)} + X509_CRL_diff := @FC_X509_CRL_diff; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_CRL_diff_removed)} + if X509_CRL_diff_removed <= LibVersion then + begin + {$if declared(_X509_CRL_diff)} + X509_CRL_diff := @_X509_CRL_diff; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_CRL_diff_allownil)} + if FuncLoadError then + AFailed.Add('X509_CRL_diff'); + {$ifend} + end; + + + X509_REQ_check_private_key := LoadLibFunction(ADllHandle, X509_REQ_check_private_key_procname); + FuncLoadError := not assigned(X509_REQ_check_private_key); + if FuncLoadError then + begin + {$if not defined(X509_REQ_check_private_key_allownil)} + X509_REQ_check_private_key := @ERR_X509_REQ_check_private_key; + {$ifend} + {$if declared(X509_REQ_check_private_key_introduced)} + if LibVersion < X509_REQ_check_private_key_introduced then + begin + {$if declared(FC_X509_REQ_check_private_key)} + X509_REQ_check_private_key := @FC_X509_REQ_check_private_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_REQ_check_private_key_removed)} + if X509_REQ_check_private_key_removed <= LibVersion then + begin + {$if declared(_X509_REQ_check_private_key)} + X509_REQ_check_private_key := @_X509_REQ_check_private_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_REQ_check_private_key_allownil)} + if FuncLoadError then + AFailed.Add('X509_REQ_check_private_key'); + {$ifend} + end; + + + X509_check_private_key := LoadLibFunction(ADllHandle, X509_check_private_key_procname); + FuncLoadError := not assigned(X509_check_private_key); + if FuncLoadError then + begin + {$if not defined(X509_check_private_key_allownil)} + X509_check_private_key := @ERR_X509_check_private_key; + {$ifend} + {$if declared(X509_check_private_key_introduced)} + if LibVersion < X509_check_private_key_introduced then + begin + {$if declared(FC_X509_check_private_key)} + X509_check_private_key := @FC_X509_check_private_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_check_private_key_removed)} + if X509_check_private_key_removed <= LibVersion then + begin + {$if declared(_X509_check_private_key)} + X509_check_private_key := @_X509_check_private_key; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_check_private_key_allownil)} + if FuncLoadError then + AFailed.Add('X509_check_private_key'); + {$ifend} + end; + + + X509_CRL_check_suiteb := LoadLibFunction(ADllHandle, X509_CRL_check_suiteb_procname); + FuncLoadError := not assigned(X509_CRL_check_suiteb); + if FuncLoadError then + begin + {$if not defined(X509_CRL_check_suiteb_allownil)} + X509_CRL_check_suiteb := @ERR_X509_CRL_check_suiteb; + {$ifend} + {$if declared(X509_CRL_check_suiteb_introduced)} + if LibVersion < X509_CRL_check_suiteb_introduced then + begin + {$if declared(FC_X509_CRL_check_suiteb)} + X509_CRL_check_suiteb := @FC_X509_CRL_check_suiteb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_CRL_check_suiteb_removed)} + if X509_CRL_check_suiteb_removed <= LibVersion then + begin + {$if declared(_X509_CRL_check_suiteb)} + X509_CRL_check_suiteb := @_X509_CRL_check_suiteb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_CRL_check_suiteb_allownil)} + if FuncLoadError then + AFailed.Add('X509_CRL_check_suiteb'); + {$ifend} + end; + + + X509_issuer_and_serial_cmp := LoadLibFunction(ADllHandle, X509_issuer_and_serial_cmp_procname); + FuncLoadError := not assigned(X509_issuer_and_serial_cmp); + if FuncLoadError then + begin + {$if not defined(X509_issuer_and_serial_cmp_allownil)} + X509_issuer_and_serial_cmp := @ERR_X509_issuer_and_serial_cmp; + {$ifend} + {$if declared(X509_issuer_and_serial_cmp_introduced)} + if LibVersion < X509_issuer_and_serial_cmp_introduced then + begin + {$if declared(FC_X509_issuer_and_serial_cmp)} + X509_issuer_and_serial_cmp := @FC_X509_issuer_and_serial_cmp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_issuer_and_serial_cmp_removed)} + if X509_issuer_and_serial_cmp_removed <= LibVersion then + begin + {$if declared(_X509_issuer_and_serial_cmp)} + X509_issuer_and_serial_cmp := @_X509_issuer_and_serial_cmp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_issuer_and_serial_cmp_allownil)} + if FuncLoadError then + AFailed.Add('X509_issuer_and_serial_cmp'); + {$ifend} + end; + + + X509_issuer_and_serial_hash := LoadLibFunction(ADllHandle, X509_issuer_and_serial_hash_procname); + FuncLoadError := not assigned(X509_issuer_and_serial_hash); + if FuncLoadError then + begin + {$if not defined(X509_issuer_and_serial_hash_allownil)} + X509_issuer_and_serial_hash := @ERR_X509_issuer_and_serial_hash; + {$ifend} + {$if declared(X509_issuer_and_serial_hash_introduced)} + if LibVersion < X509_issuer_and_serial_hash_introduced then + begin + {$if declared(FC_X509_issuer_and_serial_hash)} + X509_issuer_and_serial_hash := @FC_X509_issuer_and_serial_hash; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_issuer_and_serial_hash_removed)} + if X509_issuer_and_serial_hash_removed <= LibVersion then + begin + {$if declared(_X509_issuer_and_serial_hash)} + X509_issuer_and_serial_hash := @_X509_issuer_and_serial_hash; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_issuer_and_serial_hash_allownil)} + if FuncLoadError then + AFailed.Add('X509_issuer_and_serial_hash'); + {$ifend} + end; + + + X509_issuer_name_cmp := LoadLibFunction(ADllHandle, X509_issuer_name_cmp_procname); + FuncLoadError := not assigned(X509_issuer_name_cmp); + if FuncLoadError then + begin + {$if not defined(X509_issuer_name_cmp_allownil)} + X509_issuer_name_cmp := @ERR_X509_issuer_name_cmp; + {$ifend} + {$if declared(X509_issuer_name_cmp_introduced)} + if LibVersion < X509_issuer_name_cmp_introduced then + begin + {$if declared(FC_X509_issuer_name_cmp)} + X509_issuer_name_cmp := @FC_X509_issuer_name_cmp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_issuer_name_cmp_removed)} + if X509_issuer_name_cmp_removed <= LibVersion then + begin + {$if declared(_X509_issuer_name_cmp)} + X509_issuer_name_cmp := @_X509_issuer_name_cmp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_issuer_name_cmp_allownil)} + if FuncLoadError then + AFailed.Add('X509_issuer_name_cmp'); + {$ifend} + end; + + + X509_issuer_name_hash := LoadLibFunction(ADllHandle, X509_issuer_name_hash_procname); + FuncLoadError := not assigned(X509_issuer_name_hash); + if FuncLoadError then + begin + {$if not defined(X509_issuer_name_hash_allownil)} + X509_issuer_name_hash := @ERR_X509_issuer_name_hash; + {$ifend} + {$if declared(X509_issuer_name_hash_introduced)} + if LibVersion < X509_issuer_name_hash_introduced then + begin + {$if declared(FC_X509_issuer_name_hash)} + X509_issuer_name_hash := @FC_X509_issuer_name_hash; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_issuer_name_hash_removed)} + if X509_issuer_name_hash_removed <= LibVersion then + begin + {$if declared(_X509_issuer_name_hash)} + X509_issuer_name_hash := @_X509_issuer_name_hash; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_issuer_name_hash_allownil)} + if FuncLoadError then + AFailed.Add('X509_issuer_name_hash'); + {$ifend} + end; + + + X509_subject_name_cmp := LoadLibFunction(ADllHandle, X509_subject_name_cmp_procname); + FuncLoadError := not assigned(X509_subject_name_cmp); + if FuncLoadError then + begin + {$if not defined(X509_subject_name_cmp_allownil)} + X509_subject_name_cmp := @ERR_X509_subject_name_cmp; + {$ifend} + {$if declared(X509_subject_name_cmp_introduced)} + if LibVersion < X509_subject_name_cmp_introduced then + begin + {$if declared(FC_X509_subject_name_cmp)} + X509_subject_name_cmp := @FC_X509_subject_name_cmp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_subject_name_cmp_removed)} + if X509_subject_name_cmp_removed <= LibVersion then + begin + {$if declared(_X509_subject_name_cmp)} + X509_subject_name_cmp := @_X509_subject_name_cmp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_subject_name_cmp_allownil)} + if FuncLoadError then + AFailed.Add('X509_subject_name_cmp'); + {$ifend} + end; + + + X509_subject_name_hash := LoadLibFunction(ADllHandle, X509_subject_name_hash_procname); + FuncLoadError := not assigned(X509_subject_name_hash); + if FuncLoadError then + begin + {$if not defined(X509_subject_name_hash_allownil)} + X509_subject_name_hash := @ERR_X509_subject_name_hash; + {$ifend} + {$if declared(X509_subject_name_hash_introduced)} + if LibVersion < X509_subject_name_hash_introduced then + begin + {$if declared(FC_X509_subject_name_hash)} + X509_subject_name_hash := @FC_X509_subject_name_hash; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_subject_name_hash_removed)} + if X509_subject_name_hash_removed <= LibVersion then + begin + {$if declared(_X509_subject_name_hash)} + X509_subject_name_hash := @_X509_subject_name_hash; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_subject_name_hash_allownil)} + if FuncLoadError then + AFailed.Add('X509_subject_name_hash'); + {$ifend} + end; + + + X509_cmp := LoadLibFunction(ADllHandle, X509_cmp_procname); + FuncLoadError := not assigned(X509_cmp); + if FuncLoadError then + begin + {$if not defined(X509_cmp_allownil)} + X509_cmp := @ERR_X509_cmp; + {$ifend} + {$if declared(X509_cmp_introduced)} + if LibVersion < X509_cmp_introduced then + begin + {$if declared(FC_X509_cmp)} + X509_cmp := @FC_X509_cmp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_cmp_removed)} + if X509_cmp_removed <= LibVersion then + begin + {$if declared(_X509_cmp)} + X509_cmp := @_X509_cmp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_cmp_allownil)} + if FuncLoadError then + AFailed.Add('X509_cmp'); + {$ifend} + end; + + + X509_NAME_cmp := LoadLibFunction(ADllHandle, X509_NAME_cmp_procname); + FuncLoadError := not assigned(X509_NAME_cmp); + if FuncLoadError then + begin + {$if not defined(X509_NAME_cmp_allownil)} + X509_NAME_cmp := @ERR_X509_NAME_cmp; + {$ifend} + {$if declared(X509_NAME_cmp_introduced)} + if LibVersion < X509_NAME_cmp_introduced then + begin + {$if declared(FC_X509_NAME_cmp)} + X509_NAME_cmp := @FC_X509_NAME_cmp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_NAME_cmp_removed)} + if X509_NAME_cmp_removed <= LibVersion then + begin + {$if declared(_X509_NAME_cmp)} + X509_NAME_cmp := @_X509_NAME_cmp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_NAME_cmp_allownil)} + if FuncLoadError then + AFailed.Add('X509_NAME_cmp'); + {$ifend} + end; + + + X509_NAME_hash := LoadLibFunction(ADllHandle, X509_NAME_hash_procname); + FuncLoadError := not assigned(X509_NAME_hash); + if FuncLoadError then + begin + {$if not defined(X509_NAME_hash_allownil)} + X509_NAME_hash := @ERR_X509_NAME_hash; + {$ifend} + {$if declared(X509_NAME_hash_introduced)} + if LibVersion < X509_NAME_hash_introduced then + begin + {$if declared(FC_X509_NAME_hash)} + X509_NAME_hash := @FC_X509_NAME_hash; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_NAME_hash_removed)} + if X509_NAME_hash_removed <= LibVersion then + begin + {$if declared(_X509_NAME_hash)} + X509_NAME_hash := @_X509_NAME_hash; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_NAME_hash_allownil)} + if FuncLoadError then + AFailed.Add('X509_NAME_hash'); + {$ifend} + end; + + + X509_NAME_hash_old := LoadLibFunction(ADllHandle, X509_NAME_hash_old_procname); + FuncLoadError := not assigned(X509_NAME_hash_old); + if FuncLoadError then + begin + {$if not defined(X509_NAME_hash_old_allownil)} + X509_NAME_hash_old := @ERR_X509_NAME_hash_old; + {$ifend} + {$if declared(X509_NAME_hash_old_introduced)} + if LibVersion < X509_NAME_hash_old_introduced then + begin + {$if declared(FC_X509_NAME_hash_old)} + X509_NAME_hash_old := @FC_X509_NAME_hash_old; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_NAME_hash_old_removed)} + if X509_NAME_hash_old_removed <= LibVersion then + begin + {$if declared(_X509_NAME_hash_old)} + X509_NAME_hash_old := @_X509_NAME_hash_old; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_NAME_hash_old_allownil)} + if FuncLoadError then + AFailed.Add('X509_NAME_hash_old'); + {$ifend} + end; + + + X509_CRL_cmp := LoadLibFunction(ADllHandle, X509_CRL_cmp_procname); + FuncLoadError := not assigned(X509_CRL_cmp); + if FuncLoadError then + begin + {$if not defined(X509_CRL_cmp_allownil)} + X509_CRL_cmp := @ERR_X509_CRL_cmp; + {$ifend} + {$if declared(X509_CRL_cmp_introduced)} + if LibVersion < X509_CRL_cmp_introduced then + begin + {$if declared(FC_X509_CRL_cmp)} + X509_CRL_cmp := @FC_X509_CRL_cmp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_CRL_cmp_removed)} + if X509_CRL_cmp_removed <= LibVersion then + begin + {$if declared(_X509_CRL_cmp)} + X509_CRL_cmp := @_X509_CRL_cmp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_CRL_cmp_allownil)} + if FuncLoadError then + AFailed.Add('X509_CRL_cmp'); + {$ifend} + end; + + + X509_CRL_match := LoadLibFunction(ADllHandle, X509_CRL_match_procname); + FuncLoadError := not assigned(X509_CRL_match); + if FuncLoadError then + begin + {$if not defined(X509_CRL_match_allownil)} + X509_CRL_match := @ERR_X509_CRL_match; + {$ifend} + {$if declared(X509_CRL_match_introduced)} + if LibVersion < X509_CRL_match_introduced then + begin + {$if declared(FC_X509_CRL_match)} + X509_CRL_match := @FC_X509_CRL_match; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_CRL_match_removed)} + if X509_CRL_match_removed <= LibVersion then + begin + {$if declared(_X509_CRL_match)} + X509_CRL_match := @_X509_CRL_match; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_CRL_match_allownil)} + if FuncLoadError then + AFailed.Add('X509_CRL_match'); + {$ifend} + end; + + + X509_aux_print := LoadLibFunction(ADllHandle, X509_aux_print_procname); + FuncLoadError := not assigned(X509_aux_print); + if FuncLoadError then + begin + {$if not defined(X509_aux_print_allownil)} + X509_aux_print := @ERR_X509_aux_print; + {$ifend} + {$if declared(X509_aux_print_introduced)} + if LibVersion < X509_aux_print_introduced then + begin + {$if declared(FC_X509_aux_print)} + X509_aux_print := @FC_X509_aux_print; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_aux_print_removed)} + if X509_aux_print_removed <= LibVersion then + begin + {$if declared(_X509_aux_print)} + X509_aux_print := @_X509_aux_print; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_aux_print_allownil)} + if FuncLoadError then + AFailed.Add('X509_aux_print'); + {$ifend} + end; + + {introduced 1.1.0} + X509_NAME_print := LoadLibFunction(ADllHandle, X509_NAME_print_procname); + FuncLoadError := not assigned(X509_NAME_print); + if FuncLoadError then + begin + {$if not defined(X509_NAME_print_allownil)} + X509_NAME_print := @ERR_X509_NAME_print; + {$ifend} + {$if declared(X509_NAME_print_introduced)} + if LibVersion < X509_NAME_print_introduced then + begin + {$if declared(FC_X509_NAME_print)} + X509_NAME_print := @FC_X509_NAME_print; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_NAME_print_removed)} + if X509_NAME_print_removed <= LibVersion then + begin + {$if declared(_X509_NAME_print)} + X509_NAME_print := @_X509_NAME_print; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_NAME_print_allownil)} + if FuncLoadError then + AFailed.Add('X509_NAME_print'); + {$ifend} + end; + + + X509_NAME_print_ex := LoadLibFunction(ADllHandle, X509_NAME_print_ex_procname); + FuncLoadError := not assigned(X509_NAME_print_ex); + if FuncLoadError then + begin + {$if not defined(X509_NAME_print_ex_allownil)} + X509_NAME_print_ex := @ERR_X509_NAME_print_ex; + {$ifend} + {$if declared(X509_NAME_print_ex_introduced)} + if LibVersion < X509_NAME_print_ex_introduced then + begin + {$if declared(FC_X509_NAME_print_ex)} + X509_NAME_print_ex := @FC_X509_NAME_print_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_NAME_print_ex_removed)} + if X509_NAME_print_ex_removed <= LibVersion then + begin + {$if declared(_X509_NAME_print_ex)} + X509_NAME_print_ex := @_X509_NAME_print_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_NAME_print_ex_allownil)} + if FuncLoadError then + AFailed.Add('X509_NAME_print_ex'); + {$ifend} + end; + + + X509_print_ex := LoadLibFunction(ADllHandle, X509_print_ex_procname); + FuncLoadError := not assigned(X509_print_ex); + if FuncLoadError then + begin + {$if not defined(X509_print_ex_allownil)} + X509_print_ex := @ERR_X509_print_ex; + {$ifend} + {$if declared(X509_print_ex_introduced)} + if LibVersion < X509_print_ex_introduced then + begin + {$if declared(FC_X509_print_ex)} + X509_print_ex := @FC_X509_print_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_print_ex_removed)} + if X509_print_ex_removed <= LibVersion then + begin + {$if declared(_X509_print_ex)} + X509_print_ex := @_X509_print_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_print_ex_allownil)} + if FuncLoadError then + AFailed.Add('X509_print_ex'); + {$ifend} + end; + + + X509_print := LoadLibFunction(ADllHandle, X509_print_procname); + FuncLoadError := not assigned(X509_print); + if FuncLoadError then + begin + {$if not defined(X509_print_allownil)} + X509_print := @ERR_X509_print; + {$ifend} + {$if declared(X509_print_introduced)} + if LibVersion < X509_print_introduced then + begin + {$if declared(FC_X509_print)} + X509_print := @FC_X509_print; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_print_removed)} + if X509_print_removed <= LibVersion then + begin + {$if declared(_X509_print)} + X509_print := @_X509_print; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_print_allownil)} + if FuncLoadError then + AFailed.Add('X509_print'); + {$ifend} + end; + + + X509_ocspid_print := LoadLibFunction(ADllHandle, X509_ocspid_print_procname); + FuncLoadError := not assigned(X509_ocspid_print); + if FuncLoadError then + begin + {$if not defined(X509_ocspid_print_allownil)} + X509_ocspid_print := @ERR_X509_ocspid_print; + {$ifend} + {$if declared(X509_ocspid_print_introduced)} + if LibVersion < X509_ocspid_print_introduced then + begin + {$if declared(FC_X509_ocspid_print)} + X509_ocspid_print := @FC_X509_ocspid_print; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_ocspid_print_removed)} + if X509_ocspid_print_removed <= LibVersion then + begin + {$if declared(_X509_ocspid_print)} + X509_ocspid_print := @_X509_ocspid_print; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_ocspid_print_allownil)} + if FuncLoadError then + AFailed.Add('X509_ocspid_print'); + {$ifend} + end; + + + X509_CRL_print_ex := LoadLibFunction(ADllHandle, X509_CRL_print_ex_procname); + FuncLoadError := not assigned(X509_CRL_print_ex); + if FuncLoadError then + begin + {$if not defined(X509_CRL_print_ex_allownil)} + X509_CRL_print_ex := @ERR_X509_CRL_print_ex; + {$ifend} + {$if declared(X509_CRL_print_ex_introduced)} + if LibVersion < X509_CRL_print_ex_introduced then + begin + {$if declared(FC_X509_CRL_print_ex)} + X509_CRL_print_ex := @FC_X509_CRL_print_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_CRL_print_ex_removed)} + if X509_CRL_print_ex_removed <= LibVersion then + begin + {$if declared(_X509_CRL_print_ex)} + X509_CRL_print_ex := @_X509_CRL_print_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_CRL_print_ex_allownil)} + if FuncLoadError then + AFailed.Add('X509_CRL_print_ex'); + {$ifend} + end; + + {introduced 1.1.0} + X509_CRL_print := LoadLibFunction(ADllHandle, X509_CRL_print_procname); + FuncLoadError := not assigned(X509_CRL_print); + if FuncLoadError then + begin + {$if not defined(X509_CRL_print_allownil)} + X509_CRL_print := @ERR_X509_CRL_print; + {$ifend} + {$if declared(X509_CRL_print_introduced)} + if LibVersion < X509_CRL_print_introduced then + begin + {$if declared(FC_X509_CRL_print)} + X509_CRL_print := @FC_X509_CRL_print; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_CRL_print_removed)} + if X509_CRL_print_removed <= LibVersion then + begin + {$if declared(_X509_CRL_print)} + X509_CRL_print := @_X509_CRL_print; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_CRL_print_allownil)} + if FuncLoadError then + AFailed.Add('X509_CRL_print'); + {$ifend} + end; + + + X509_REQ_print_ex := LoadLibFunction(ADllHandle, X509_REQ_print_ex_procname); + FuncLoadError := not assigned(X509_REQ_print_ex); + if FuncLoadError then + begin + {$if not defined(X509_REQ_print_ex_allownil)} + X509_REQ_print_ex := @ERR_X509_REQ_print_ex; + {$ifend} + {$if declared(X509_REQ_print_ex_introduced)} + if LibVersion < X509_REQ_print_ex_introduced then + begin + {$if declared(FC_X509_REQ_print_ex)} + X509_REQ_print_ex := @FC_X509_REQ_print_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_REQ_print_ex_removed)} + if X509_REQ_print_ex_removed <= LibVersion then + begin + {$if declared(_X509_REQ_print_ex)} + X509_REQ_print_ex := @_X509_REQ_print_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_REQ_print_ex_allownil)} + if FuncLoadError then + AFailed.Add('X509_REQ_print_ex'); + {$ifend} + end; + + + X509_REQ_print := LoadLibFunction(ADllHandle, X509_REQ_print_procname); + FuncLoadError := not assigned(X509_REQ_print); + if FuncLoadError then + begin + {$if not defined(X509_REQ_print_allownil)} + X509_REQ_print := @ERR_X509_REQ_print; + {$ifend} + {$if declared(X509_REQ_print_introduced)} + if LibVersion < X509_REQ_print_introduced then + begin + {$if declared(FC_X509_REQ_print)} + X509_REQ_print := @FC_X509_REQ_print; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_REQ_print_removed)} + if X509_REQ_print_removed <= LibVersion then + begin + {$if declared(_X509_REQ_print)} + X509_REQ_print := @_X509_REQ_print; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_REQ_print_allownil)} + if FuncLoadError then + AFailed.Add('X509_REQ_print'); + {$ifend} + end; + + + X509_NAME_entry_count := LoadLibFunction(ADllHandle, X509_NAME_entry_count_procname); + FuncLoadError := not assigned(X509_NAME_entry_count); + if FuncLoadError then + begin + {$if not defined(X509_NAME_entry_count_allownil)} + X509_NAME_entry_count := @ERR_X509_NAME_entry_count; + {$ifend} + {$if declared(X509_NAME_entry_count_introduced)} + if LibVersion < X509_NAME_entry_count_introduced then + begin + {$if declared(FC_X509_NAME_entry_count)} + X509_NAME_entry_count := @FC_X509_NAME_entry_count; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_NAME_entry_count_removed)} + if X509_NAME_entry_count_removed <= LibVersion then + begin + {$if declared(_X509_NAME_entry_count)} + X509_NAME_entry_count := @_X509_NAME_entry_count; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_NAME_entry_count_allownil)} + if FuncLoadError then + AFailed.Add('X509_NAME_entry_count'); + {$ifend} + end; + + + X509_NAME_get_text_by_NID := LoadLibFunction(ADllHandle, X509_NAME_get_text_by_NID_procname); + FuncLoadError := not assigned(X509_NAME_get_text_by_NID); + if FuncLoadError then + begin + {$if not defined(X509_NAME_get_text_by_NID_allownil)} + X509_NAME_get_text_by_NID := @ERR_X509_NAME_get_text_by_NID; + {$ifend} + {$if declared(X509_NAME_get_text_by_NID_introduced)} + if LibVersion < X509_NAME_get_text_by_NID_introduced then + begin + {$if declared(FC_X509_NAME_get_text_by_NID)} + X509_NAME_get_text_by_NID := @FC_X509_NAME_get_text_by_NID; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_NAME_get_text_by_NID_removed)} + if X509_NAME_get_text_by_NID_removed <= LibVersion then + begin + {$if declared(_X509_NAME_get_text_by_NID)} + X509_NAME_get_text_by_NID := @_X509_NAME_get_text_by_NID; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_NAME_get_text_by_NID_allownil)} + if FuncLoadError then + AFailed.Add('X509_NAME_get_text_by_NID'); + {$ifend} + end; + + + X509_NAME_get_text_by_OBJ := LoadLibFunction(ADllHandle, X509_NAME_get_text_by_OBJ_procname); + FuncLoadError := not assigned(X509_NAME_get_text_by_OBJ); + if FuncLoadError then + begin + {$if not defined(X509_NAME_get_text_by_OBJ_allownil)} + X509_NAME_get_text_by_OBJ := @ERR_X509_NAME_get_text_by_OBJ; + {$ifend} + {$if declared(X509_NAME_get_text_by_OBJ_introduced)} + if LibVersion < X509_NAME_get_text_by_OBJ_introduced then + begin + {$if declared(FC_X509_NAME_get_text_by_OBJ)} + X509_NAME_get_text_by_OBJ := @FC_X509_NAME_get_text_by_OBJ; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_NAME_get_text_by_OBJ_removed)} + if X509_NAME_get_text_by_OBJ_removed <= LibVersion then + begin + {$if declared(_X509_NAME_get_text_by_OBJ)} + X509_NAME_get_text_by_OBJ := @_X509_NAME_get_text_by_OBJ; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_NAME_get_text_by_OBJ_allownil)} + if FuncLoadError then + AFailed.Add('X509_NAME_get_text_by_OBJ'); + {$ifend} + end; + + + X509_NAME_get_index_by_NID := LoadLibFunction(ADllHandle, X509_NAME_get_index_by_NID_procname); + FuncLoadError := not assigned(X509_NAME_get_index_by_NID); + if FuncLoadError then + begin + {$if not defined(X509_NAME_get_index_by_NID_allownil)} + X509_NAME_get_index_by_NID := @ERR_X509_NAME_get_index_by_NID; + {$ifend} + {$if declared(X509_NAME_get_index_by_NID_introduced)} + if LibVersion < X509_NAME_get_index_by_NID_introduced then + begin + {$if declared(FC_X509_NAME_get_index_by_NID)} + X509_NAME_get_index_by_NID := @FC_X509_NAME_get_index_by_NID; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_NAME_get_index_by_NID_removed)} + if X509_NAME_get_index_by_NID_removed <= LibVersion then + begin + {$if declared(_X509_NAME_get_index_by_NID)} + X509_NAME_get_index_by_NID := @_X509_NAME_get_index_by_NID; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_NAME_get_index_by_NID_allownil)} + if FuncLoadError then + AFailed.Add('X509_NAME_get_index_by_NID'); + {$ifend} + end; + + + X509_NAME_get_index_by_OBJ := LoadLibFunction(ADllHandle, X509_NAME_get_index_by_OBJ_procname); + FuncLoadError := not assigned(X509_NAME_get_index_by_OBJ); + if FuncLoadError then + begin + {$if not defined(X509_NAME_get_index_by_OBJ_allownil)} + X509_NAME_get_index_by_OBJ := @ERR_X509_NAME_get_index_by_OBJ; + {$ifend} + {$if declared(X509_NAME_get_index_by_OBJ_introduced)} + if LibVersion < X509_NAME_get_index_by_OBJ_introduced then + begin + {$if declared(FC_X509_NAME_get_index_by_OBJ)} + X509_NAME_get_index_by_OBJ := @FC_X509_NAME_get_index_by_OBJ; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_NAME_get_index_by_OBJ_removed)} + if X509_NAME_get_index_by_OBJ_removed <= LibVersion then + begin + {$if declared(_X509_NAME_get_index_by_OBJ)} + X509_NAME_get_index_by_OBJ := @_X509_NAME_get_index_by_OBJ; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_NAME_get_index_by_OBJ_allownil)} + if FuncLoadError then + AFailed.Add('X509_NAME_get_index_by_OBJ'); + {$ifend} + end; + + + X509_NAME_get_entry := LoadLibFunction(ADllHandle, X509_NAME_get_entry_procname); + FuncLoadError := not assigned(X509_NAME_get_entry); + if FuncLoadError then + begin + {$if not defined(X509_NAME_get_entry_allownil)} + X509_NAME_get_entry := @ERR_X509_NAME_get_entry; + {$ifend} + {$if declared(X509_NAME_get_entry_introduced)} + if LibVersion < X509_NAME_get_entry_introduced then + begin + {$if declared(FC_X509_NAME_get_entry)} + X509_NAME_get_entry := @FC_X509_NAME_get_entry; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_NAME_get_entry_removed)} + if X509_NAME_get_entry_removed <= LibVersion then + begin + {$if declared(_X509_NAME_get_entry)} + X509_NAME_get_entry := @_X509_NAME_get_entry; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_NAME_get_entry_allownil)} + if FuncLoadError then + AFailed.Add('X509_NAME_get_entry'); + {$ifend} + end; + + + X509_NAME_delete_entry := LoadLibFunction(ADllHandle, X509_NAME_delete_entry_procname); + FuncLoadError := not assigned(X509_NAME_delete_entry); + if FuncLoadError then + begin + {$if not defined(X509_NAME_delete_entry_allownil)} + X509_NAME_delete_entry := @ERR_X509_NAME_delete_entry; + {$ifend} + {$if declared(X509_NAME_delete_entry_introduced)} + if LibVersion < X509_NAME_delete_entry_introduced then + begin + {$if declared(FC_X509_NAME_delete_entry)} + X509_NAME_delete_entry := @FC_X509_NAME_delete_entry; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_NAME_delete_entry_removed)} + if X509_NAME_delete_entry_removed <= LibVersion then + begin + {$if declared(_X509_NAME_delete_entry)} + X509_NAME_delete_entry := @_X509_NAME_delete_entry; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_NAME_delete_entry_allownil)} + if FuncLoadError then + AFailed.Add('X509_NAME_delete_entry'); + {$ifend} + end; + + + X509_NAME_add_entry := LoadLibFunction(ADllHandle, X509_NAME_add_entry_procname); + FuncLoadError := not assigned(X509_NAME_add_entry); + if FuncLoadError then + begin + {$if not defined(X509_NAME_add_entry_allownil)} + X509_NAME_add_entry := @ERR_X509_NAME_add_entry; + {$ifend} + {$if declared(X509_NAME_add_entry_introduced)} + if LibVersion < X509_NAME_add_entry_introduced then + begin + {$if declared(FC_X509_NAME_add_entry)} + X509_NAME_add_entry := @FC_X509_NAME_add_entry; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_NAME_add_entry_removed)} + if X509_NAME_add_entry_removed <= LibVersion then + begin + {$if declared(_X509_NAME_add_entry)} + X509_NAME_add_entry := @_X509_NAME_add_entry; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_NAME_add_entry_allownil)} + if FuncLoadError then + AFailed.Add('X509_NAME_add_entry'); + {$ifend} + end; + + + X509_NAME_add_entry_by_OBJ := LoadLibFunction(ADllHandle, X509_NAME_add_entry_by_OBJ_procname); + FuncLoadError := not assigned(X509_NAME_add_entry_by_OBJ); + if FuncLoadError then + begin + {$if not defined(X509_NAME_add_entry_by_OBJ_allownil)} + X509_NAME_add_entry_by_OBJ := @ERR_X509_NAME_add_entry_by_OBJ; + {$ifend} + {$if declared(X509_NAME_add_entry_by_OBJ_introduced)} + if LibVersion < X509_NAME_add_entry_by_OBJ_introduced then + begin + {$if declared(FC_X509_NAME_add_entry_by_OBJ)} + X509_NAME_add_entry_by_OBJ := @FC_X509_NAME_add_entry_by_OBJ; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_NAME_add_entry_by_OBJ_removed)} + if X509_NAME_add_entry_by_OBJ_removed <= LibVersion then + begin + {$if declared(_X509_NAME_add_entry_by_OBJ)} + X509_NAME_add_entry_by_OBJ := @_X509_NAME_add_entry_by_OBJ; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_NAME_add_entry_by_OBJ_allownil)} + if FuncLoadError then + AFailed.Add('X509_NAME_add_entry_by_OBJ'); + {$ifend} + end; + + + X509_NAME_add_entry_by_NID := LoadLibFunction(ADllHandle, X509_NAME_add_entry_by_NID_procname); + FuncLoadError := not assigned(X509_NAME_add_entry_by_NID); + if FuncLoadError then + begin + {$if not defined(X509_NAME_add_entry_by_NID_allownil)} + X509_NAME_add_entry_by_NID := @ERR_X509_NAME_add_entry_by_NID; + {$ifend} + {$if declared(X509_NAME_add_entry_by_NID_introduced)} + if LibVersion < X509_NAME_add_entry_by_NID_introduced then + begin + {$if declared(FC_X509_NAME_add_entry_by_NID)} + X509_NAME_add_entry_by_NID := @FC_X509_NAME_add_entry_by_NID; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_NAME_add_entry_by_NID_removed)} + if X509_NAME_add_entry_by_NID_removed <= LibVersion then + begin + {$if declared(_X509_NAME_add_entry_by_NID)} + X509_NAME_add_entry_by_NID := @_X509_NAME_add_entry_by_NID; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_NAME_add_entry_by_NID_allownil)} + if FuncLoadError then + AFailed.Add('X509_NAME_add_entry_by_NID'); + {$ifend} + end; + + + X509_NAME_ENTRY_create_by_txt := LoadLibFunction(ADllHandle, X509_NAME_ENTRY_create_by_txt_procname); + FuncLoadError := not assigned(X509_NAME_ENTRY_create_by_txt); + if FuncLoadError then + begin + {$if not defined(X509_NAME_ENTRY_create_by_txt_allownil)} + X509_NAME_ENTRY_create_by_txt := @ERR_X509_NAME_ENTRY_create_by_txt; + {$ifend} + {$if declared(X509_NAME_ENTRY_create_by_txt_introduced)} + if LibVersion < X509_NAME_ENTRY_create_by_txt_introduced then + begin + {$if declared(FC_X509_NAME_ENTRY_create_by_txt)} + X509_NAME_ENTRY_create_by_txt := @FC_X509_NAME_ENTRY_create_by_txt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_NAME_ENTRY_create_by_txt_removed)} + if X509_NAME_ENTRY_create_by_txt_removed <= LibVersion then + begin + {$if declared(_X509_NAME_ENTRY_create_by_txt)} + X509_NAME_ENTRY_create_by_txt := @_X509_NAME_ENTRY_create_by_txt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_NAME_ENTRY_create_by_txt_allownil)} + if FuncLoadError then + AFailed.Add('X509_NAME_ENTRY_create_by_txt'); + {$ifend} + end; + + + X509_NAME_ENTRY_create_by_NID := LoadLibFunction(ADllHandle, X509_NAME_ENTRY_create_by_NID_procname); + FuncLoadError := not assigned(X509_NAME_ENTRY_create_by_NID); + if FuncLoadError then + begin + {$if not defined(X509_NAME_ENTRY_create_by_NID_allownil)} + X509_NAME_ENTRY_create_by_NID := @ERR_X509_NAME_ENTRY_create_by_NID; + {$ifend} + {$if declared(X509_NAME_ENTRY_create_by_NID_introduced)} + if LibVersion < X509_NAME_ENTRY_create_by_NID_introduced then + begin + {$if declared(FC_X509_NAME_ENTRY_create_by_NID)} + X509_NAME_ENTRY_create_by_NID := @FC_X509_NAME_ENTRY_create_by_NID; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_NAME_ENTRY_create_by_NID_removed)} + if X509_NAME_ENTRY_create_by_NID_removed <= LibVersion then + begin + {$if declared(_X509_NAME_ENTRY_create_by_NID)} + X509_NAME_ENTRY_create_by_NID := @_X509_NAME_ENTRY_create_by_NID; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_NAME_ENTRY_create_by_NID_allownil)} + if FuncLoadError then + AFailed.Add('X509_NAME_ENTRY_create_by_NID'); + {$ifend} + end; + + + X509_NAME_add_entry_by_txt := LoadLibFunction(ADllHandle, X509_NAME_add_entry_by_txt_procname); + FuncLoadError := not assigned(X509_NAME_add_entry_by_txt); + if FuncLoadError then + begin + {$if not defined(X509_NAME_add_entry_by_txt_allownil)} + X509_NAME_add_entry_by_txt := @ERR_X509_NAME_add_entry_by_txt; + {$ifend} + {$if declared(X509_NAME_add_entry_by_txt_introduced)} + if LibVersion < X509_NAME_add_entry_by_txt_introduced then + begin + {$if declared(FC_X509_NAME_add_entry_by_txt)} + X509_NAME_add_entry_by_txt := @FC_X509_NAME_add_entry_by_txt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_NAME_add_entry_by_txt_removed)} + if X509_NAME_add_entry_by_txt_removed <= LibVersion then + begin + {$if declared(_X509_NAME_add_entry_by_txt)} + X509_NAME_add_entry_by_txt := @_X509_NAME_add_entry_by_txt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_NAME_add_entry_by_txt_allownil)} + if FuncLoadError then + AFailed.Add('X509_NAME_add_entry_by_txt'); + {$ifend} + end; + + + X509_NAME_ENTRY_create_by_OBJ := LoadLibFunction(ADllHandle, X509_NAME_ENTRY_create_by_OBJ_procname); + FuncLoadError := not assigned(X509_NAME_ENTRY_create_by_OBJ); + if FuncLoadError then + begin + {$if not defined(X509_NAME_ENTRY_create_by_OBJ_allownil)} + X509_NAME_ENTRY_create_by_OBJ := @ERR_X509_NAME_ENTRY_create_by_OBJ; + {$ifend} + {$if declared(X509_NAME_ENTRY_create_by_OBJ_introduced)} + if LibVersion < X509_NAME_ENTRY_create_by_OBJ_introduced then + begin + {$if declared(FC_X509_NAME_ENTRY_create_by_OBJ)} + X509_NAME_ENTRY_create_by_OBJ := @FC_X509_NAME_ENTRY_create_by_OBJ; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_NAME_ENTRY_create_by_OBJ_removed)} + if X509_NAME_ENTRY_create_by_OBJ_removed <= LibVersion then + begin + {$if declared(_X509_NAME_ENTRY_create_by_OBJ)} + X509_NAME_ENTRY_create_by_OBJ := @_X509_NAME_ENTRY_create_by_OBJ; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_NAME_ENTRY_create_by_OBJ_allownil)} + if FuncLoadError then + AFailed.Add('X509_NAME_ENTRY_create_by_OBJ'); + {$ifend} + end; + + + X509_NAME_ENTRY_set_object := LoadLibFunction(ADllHandle, X509_NAME_ENTRY_set_object_procname); + FuncLoadError := not assigned(X509_NAME_ENTRY_set_object); + if FuncLoadError then + begin + {$if not defined(X509_NAME_ENTRY_set_object_allownil)} + X509_NAME_ENTRY_set_object := @ERR_X509_NAME_ENTRY_set_object; + {$ifend} + {$if declared(X509_NAME_ENTRY_set_object_introduced)} + if LibVersion < X509_NAME_ENTRY_set_object_introduced then + begin + {$if declared(FC_X509_NAME_ENTRY_set_object)} + X509_NAME_ENTRY_set_object := @FC_X509_NAME_ENTRY_set_object; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_NAME_ENTRY_set_object_removed)} + if X509_NAME_ENTRY_set_object_removed <= LibVersion then + begin + {$if declared(_X509_NAME_ENTRY_set_object)} + X509_NAME_ENTRY_set_object := @_X509_NAME_ENTRY_set_object; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_NAME_ENTRY_set_object_allownil)} + if FuncLoadError then + AFailed.Add('X509_NAME_ENTRY_set_object'); + {$ifend} + end; + + + X509_NAME_ENTRY_set_data := LoadLibFunction(ADllHandle, X509_NAME_ENTRY_set_data_procname); + FuncLoadError := not assigned(X509_NAME_ENTRY_set_data); + if FuncLoadError then + begin + {$if not defined(X509_NAME_ENTRY_set_data_allownil)} + X509_NAME_ENTRY_set_data := @ERR_X509_NAME_ENTRY_set_data; + {$ifend} + {$if declared(X509_NAME_ENTRY_set_data_introduced)} + if LibVersion < X509_NAME_ENTRY_set_data_introduced then + begin + {$if declared(FC_X509_NAME_ENTRY_set_data)} + X509_NAME_ENTRY_set_data := @FC_X509_NAME_ENTRY_set_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_NAME_ENTRY_set_data_removed)} + if X509_NAME_ENTRY_set_data_removed <= LibVersion then + begin + {$if declared(_X509_NAME_ENTRY_set_data)} + X509_NAME_ENTRY_set_data := @_X509_NAME_ENTRY_set_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_NAME_ENTRY_set_data_allownil)} + if FuncLoadError then + AFailed.Add('X509_NAME_ENTRY_set_data'); + {$ifend} + end; + + + X509_NAME_ENTRY_get_object := LoadLibFunction(ADllHandle, X509_NAME_ENTRY_get_object_procname); + FuncLoadError := not assigned(X509_NAME_ENTRY_get_object); + if FuncLoadError then + begin + {$if not defined(X509_NAME_ENTRY_get_object_allownil)} + X509_NAME_ENTRY_get_object := @ERR_X509_NAME_ENTRY_get_object; + {$ifend} + {$if declared(X509_NAME_ENTRY_get_object_introduced)} + if LibVersion < X509_NAME_ENTRY_get_object_introduced then + begin + {$if declared(FC_X509_NAME_ENTRY_get_object)} + X509_NAME_ENTRY_get_object := @FC_X509_NAME_ENTRY_get_object; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_NAME_ENTRY_get_object_removed)} + if X509_NAME_ENTRY_get_object_removed <= LibVersion then + begin + {$if declared(_X509_NAME_ENTRY_get_object)} + X509_NAME_ENTRY_get_object := @_X509_NAME_ENTRY_get_object; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_NAME_ENTRY_get_object_allownil)} + if FuncLoadError then + AFailed.Add('X509_NAME_ENTRY_get_object'); + {$ifend} + end; + + + X509_NAME_ENTRY_get_data := LoadLibFunction(ADllHandle, X509_NAME_ENTRY_get_data_procname); + FuncLoadError := not assigned(X509_NAME_ENTRY_get_data); + if FuncLoadError then + begin + {$if not defined(X509_NAME_ENTRY_get_data_allownil)} + X509_NAME_ENTRY_get_data := @ERR_X509_NAME_ENTRY_get_data; + {$ifend} + {$if declared(X509_NAME_ENTRY_get_data_introduced)} + if LibVersion < X509_NAME_ENTRY_get_data_introduced then + begin + {$if declared(FC_X509_NAME_ENTRY_get_data)} + X509_NAME_ENTRY_get_data := @FC_X509_NAME_ENTRY_get_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_NAME_ENTRY_get_data_removed)} + if X509_NAME_ENTRY_get_data_removed <= LibVersion then + begin + {$if declared(_X509_NAME_ENTRY_get_data)} + X509_NAME_ENTRY_get_data := @_X509_NAME_ENTRY_get_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_NAME_ENTRY_get_data_allownil)} + if FuncLoadError then + AFailed.Add('X509_NAME_ENTRY_get_data'); + {$ifend} + end; + + + X509_NAME_ENTRY_set := LoadLibFunction(ADllHandle, X509_NAME_ENTRY_set_procname); + FuncLoadError := not assigned(X509_NAME_ENTRY_set); + if FuncLoadError then + begin + {$if not defined(X509_NAME_ENTRY_set_allownil)} + X509_NAME_ENTRY_set := @ERR_X509_NAME_ENTRY_set; + {$ifend} + {$if declared(X509_NAME_ENTRY_set_introduced)} + if LibVersion < X509_NAME_ENTRY_set_introduced then + begin + {$if declared(FC_X509_NAME_ENTRY_set)} + X509_NAME_ENTRY_set := @FC_X509_NAME_ENTRY_set; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_NAME_ENTRY_set_removed)} + if X509_NAME_ENTRY_set_removed <= LibVersion then + begin + {$if declared(_X509_NAME_ENTRY_set)} + X509_NAME_ENTRY_set := @_X509_NAME_ENTRY_set; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_NAME_ENTRY_set_allownil)} + if FuncLoadError then + AFailed.Add('X509_NAME_ENTRY_set'); + {$ifend} + end; + + {introduced 1.1.0} + X509_NAME_get0_der := LoadLibFunction(ADllHandle, X509_NAME_get0_der_procname); + FuncLoadError := not assigned(X509_NAME_get0_der); + if FuncLoadError then + begin + {$if not defined(X509_NAME_get0_der_allownil)} + X509_NAME_get0_der := @ERR_X509_NAME_get0_der; + {$ifend} + {$if declared(X509_NAME_get0_der_introduced)} + if LibVersion < X509_NAME_get0_der_introduced then + begin + {$if declared(FC_X509_NAME_get0_der)} + X509_NAME_get0_der := @FC_X509_NAME_get0_der; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_NAME_get0_der_removed)} + if X509_NAME_get0_der_removed <= LibVersion then + begin + {$if declared(_X509_NAME_get0_der)} + X509_NAME_get0_der := @_X509_NAME_get0_der; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_NAME_get0_der_allownil)} + if FuncLoadError then + AFailed.Add('X509_NAME_get0_der'); + {$ifend} + end; + + {introduced 1.1.0} + X509_get_ext_count := LoadLibFunction(ADllHandle, X509_get_ext_count_procname); + FuncLoadError := not assigned(X509_get_ext_count); + if FuncLoadError then + begin + {$if not defined(X509_get_ext_count_allownil)} + X509_get_ext_count := @ERR_X509_get_ext_count; + {$ifend} + {$if declared(X509_get_ext_count_introduced)} + if LibVersion < X509_get_ext_count_introduced then + begin + {$if declared(FC_X509_get_ext_count)} + X509_get_ext_count := @FC_X509_get_ext_count; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_get_ext_count_removed)} + if X509_get_ext_count_removed <= LibVersion then + begin + {$if declared(_X509_get_ext_count)} + X509_get_ext_count := @_X509_get_ext_count; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_get_ext_count_allownil)} + if FuncLoadError then + AFailed.Add('X509_get_ext_count'); + {$ifend} + end; + + + X509_get_ext_by_NID := LoadLibFunction(ADllHandle, X509_get_ext_by_NID_procname); + FuncLoadError := not assigned(X509_get_ext_by_NID); + if FuncLoadError then + begin + {$if not defined(X509_get_ext_by_NID_allownil)} + X509_get_ext_by_NID := @ERR_X509_get_ext_by_NID; + {$ifend} + {$if declared(X509_get_ext_by_NID_introduced)} + if LibVersion < X509_get_ext_by_NID_introduced then + begin + {$if declared(FC_X509_get_ext_by_NID)} + X509_get_ext_by_NID := @FC_X509_get_ext_by_NID; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_get_ext_by_NID_removed)} + if X509_get_ext_by_NID_removed <= LibVersion then + begin + {$if declared(_X509_get_ext_by_NID)} + X509_get_ext_by_NID := @_X509_get_ext_by_NID; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_get_ext_by_NID_allownil)} + if FuncLoadError then + AFailed.Add('X509_get_ext_by_NID'); + {$ifend} + end; + + + X509_get_ext_by_OBJ := LoadLibFunction(ADllHandle, X509_get_ext_by_OBJ_procname); + FuncLoadError := not assigned(X509_get_ext_by_OBJ); + if FuncLoadError then + begin + {$if not defined(X509_get_ext_by_OBJ_allownil)} + X509_get_ext_by_OBJ := @ERR_X509_get_ext_by_OBJ; + {$ifend} + {$if declared(X509_get_ext_by_OBJ_introduced)} + if LibVersion < X509_get_ext_by_OBJ_introduced then + begin + {$if declared(FC_X509_get_ext_by_OBJ)} + X509_get_ext_by_OBJ := @FC_X509_get_ext_by_OBJ; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_get_ext_by_OBJ_removed)} + if X509_get_ext_by_OBJ_removed <= LibVersion then + begin + {$if declared(_X509_get_ext_by_OBJ)} + X509_get_ext_by_OBJ := @_X509_get_ext_by_OBJ; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_get_ext_by_OBJ_allownil)} + if FuncLoadError then + AFailed.Add('X509_get_ext_by_OBJ'); + {$ifend} + end; + + + X509_get_ext_by_critical := LoadLibFunction(ADllHandle, X509_get_ext_by_critical_procname); + FuncLoadError := not assigned(X509_get_ext_by_critical); + if FuncLoadError then + begin + {$if not defined(X509_get_ext_by_critical_allownil)} + X509_get_ext_by_critical := @ERR_X509_get_ext_by_critical; + {$ifend} + {$if declared(X509_get_ext_by_critical_introduced)} + if LibVersion < X509_get_ext_by_critical_introduced then + begin + {$if declared(FC_X509_get_ext_by_critical)} + X509_get_ext_by_critical := @FC_X509_get_ext_by_critical; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_get_ext_by_critical_removed)} + if X509_get_ext_by_critical_removed <= LibVersion then + begin + {$if declared(_X509_get_ext_by_critical)} + X509_get_ext_by_critical := @_X509_get_ext_by_critical; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_get_ext_by_critical_allownil)} + if FuncLoadError then + AFailed.Add('X509_get_ext_by_critical'); + {$ifend} + end; + + + X509_get_ext := LoadLibFunction(ADllHandle, X509_get_ext_procname); + FuncLoadError := not assigned(X509_get_ext); + if FuncLoadError then + begin + {$if not defined(X509_get_ext_allownil)} + X509_get_ext := @ERR_X509_get_ext; + {$ifend} + {$if declared(X509_get_ext_introduced)} + if LibVersion < X509_get_ext_introduced then + begin + {$if declared(FC_X509_get_ext)} + X509_get_ext := @FC_X509_get_ext; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_get_ext_removed)} + if X509_get_ext_removed <= LibVersion then + begin + {$if declared(_X509_get_ext)} + X509_get_ext := @_X509_get_ext; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_get_ext_allownil)} + if FuncLoadError then + AFailed.Add('X509_get_ext'); + {$ifend} + end; + + + X509_delete_ext := LoadLibFunction(ADllHandle, X509_delete_ext_procname); + FuncLoadError := not assigned(X509_delete_ext); + if FuncLoadError then + begin + {$if not defined(X509_delete_ext_allownil)} + X509_delete_ext := @ERR_X509_delete_ext; + {$ifend} + {$if declared(X509_delete_ext_introduced)} + if LibVersion < X509_delete_ext_introduced then + begin + {$if declared(FC_X509_delete_ext)} + X509_delete_ext := @FC_X509_delete_ext; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_delete_ext_removed)} + if X509_delete_ext_removed <= LibVersion then + begin + {$if declared(_X509_delete_ext)} + X509_delete_ext := @_X509_delete_ext; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_delete_ext_allownil)} + if FuncLoadError then + AFailed.Add('X509_delete_ext'); + {$ifend} + end; + + + X509_add_ext := LoadLibFunction(ADllHandle, X509_add_ext_procname); + FuncLoadError := not assigned(X509_add_ext); + if FuncLoadError then + begin + {$if not defined(X509_add_ext_allownil)} + X509_add_ext := @ERR_X509_add_ext; + {$ifend} + {$if declared(X509_add_ext_introduced)} + if LibVersion < X509_add_ext_introduced then + begin + {$if declared(FC_X509_add_ext)} + X509_add_ext := @FC_X509_add_ext; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_add_ext_removed)} + if X509_add_ext_removed <= LibVersion then + begin + {$if declared(_X509_add_ext)} + X509_add_ext := @_X509_add_ext; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_add_ext_allownil)} + if FuncLoadError then + AFailed.Add('X509_add_ext'); + {$ifend} + end; + + + X509_get_ext_d2i := LoadLibFunction(ADllHandle, X509_get_ext_d2i_procname); + FuncLoadError := not assigned(X509_get_ext_d2i); + if FuncLoadError then + begin + {$if not defined(X509_get_ext_d2i_allownil)} + X509_get_ext_d2i := @ERR_X509_get_ext_d2i; + {$ifend} + {$if declared(X509_get_ext_d2i_introduced)} + if LibVersion < X509_get_ext_d2i_introduced then + begin + {$if declared(FC_X509_get_ext_d2i)} + X509_get_ext_d2i := @FC_X509_get_ext_d2i; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_get_ext_d2i_removed)} + if X509_get_ext_d2i_removed <= LibVersion then + begin + {$if declared(_X509_get_ext_d2i)} + X509_get_ext_d2i := @_X509_get_ext_d2i; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_get_ext_d2i_allownil)} + if FuncLoadError then + AFailed.Add('X509_get_ext_d2i'); + {$ifend} + end; + + + X509_add1_ext_i2d := LoadLibFunction(ADllHandle, X509_add1_ext_i2d_procname); + FuncLoadError := not assigned(X509_add1_ext_i2d); + if FuncLoadError then + begin + {$if not defined(X509_add1_ext_i2d_allownil)} + X509_add1_ext_i2d := @ERR_X509_add1_ext_i2d; + {$ifend} + {$if declared(X509_add1_ext_i2d_introduced)} + if LibVersion < X509_add1_ext_i2d_introduced then + begin + {$if declared(FC_X509_add1_ext_i2d)} + X509_add1_ext_i2d := @FC_X509_add1_ext_i2d; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_add1_ext_i2d_removed)} + if X509_add1_ext_i2d_removed <= LibVersion then + begin + {$if declared(_X509_add1_ext_i2d)} + X509_add1_ext_i2d := @_X509_add1_ext_i2d; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_add1_ext_i2d_allownil)} + if FuncLoadError then + AFailed.Add('X509_add1_ext_i2d'); + {$ifend} + end; + + + X509_CRL_get_ext_count := LoadLibFunction(ADllHandle, X509_CRL_get_ext_count_procname); + FuncLoadError := not assigned(X509_CRL_get_ext_count); + if FuncLoadError then + begin + {$if not defined(X509_CRL_get_ext_count_allownil)} + X509_CRL_get_ext_count := @ERR_X509_CRL_get_ext_count; + {$ifend} + {$if declared(X509_CRL_get_ext_count_introduced)} + if LibVersion < X509_CRL_get_ext_count_introduced then + begin + {$if declared(FC_X509_CRL_get_ext_count)} + X509_CRL_get_ext_count := @FC_X509_CRL_get_ext_count; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_CRL_get_ext_count_removed)} + if X509_CRL_get_ext_count_removed <= LibVersion then + begin + {$if declared(_X509_CRL_get_ext_count)} + X509_CRL_get_ext_count := @_X509_CRL_get_ext_count; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_CRL_get_ext_count_allownil)} + if FuncLoadError then + AFailed.Add('X509_CRL_get_ext_count'); + {$ifend} + end; + + + X509_CRL_get_ext_by_NID := LoadLibFunction(ADllHandle, X509_CRL_get_ext_by_NID_procname); + FuncLoadError := not assigned(X509_CRL_get_ext_by_NID); + if FuncLoadError then + begin + {$if not defined(X509_CRL_get_ext_by_NID_allownil)} + X509_CRL_get_ext_by_NID := @ERR_X509_CRL_get_ext_by_NID; + {$ifend} + {$if declared(X509_CRL_get_ext_by_NID_introduced)} + if LibVersion < X509_CRL_get_ext_by_NID_introduced then + begin + {$if declared(FC_X509_CRL_get_ext_by_NID)} + X509_CRL_get_ext_by_NID := @FC_X509_CRL_get_ext_by_NID; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_CRL_get_ext_by_NID_removed)} + if X509_CRL_get_ext_by_NID_removed <= LibVersion then + begin + {$if declared(_X509_CRL_get_ext_by_NID)} + X509_CRL_get_ext_by_NID := @_X509_CRL_get_ext_by_NID; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_CRL_get_ext_by_NID_allownil)} + if FuncLoadError then + AFailed.Add('X509_CRL_get_ext_by_NID'); + {$ifend} + end; + + + X509_CRL_get_ext_by_OBJ := LoadLibFunction(ADllHandle, X509_CRL_get_ext_by_OBJ_procname); + FuncLoadError := not assigned(X509_CRL_get_ext_by_OBJ); + if FuncLoadError then + begin + {$if not defined(X509_CRL_get_ext_by_OBJ_allownil)} + X509_CRL_get_ext_by_OBJ := @ERR_X509_CRL_get_ext_by_OBJ; + {$ifend} + {$if declared(X509_CRL_get_ext_by_OBJ_introduced)} + if LibVersion < X509_CRL_get_ext_by_OBJ_introduced then + begin + {$if declared(FC_X509_CRL_get_ext_by_OBJ)} + X509_CRL_get_ext_by_OBJ := @FC_X509_CRL_get_ext_by_OBJ; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_CRL_get_ext_by_OBJ_removed)} + if X509_CRL_get_ext_by_OBJ_removed <= LibVersion then + begin + {$if declared(_X509_CRL_get_ext_by_OBJ)} + X509_CRL_get_ext_by_OBJ := @_X509_CRL_get_ext_by_OBJ; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_CRL_get_ext_by_OBJ_allownil)} + if FuncLoadError then + AFailed.Add('X509_CRL_get_ext_by_OBJ'); + {$ifend} + end; + + + X509_CRL_get_ext_by_critical := LoadLibFunction(ADllHandle, X509_CRL_get_ext_by_critical_procname); + FuncLoadError := not assigned(X509_CRL_get_ext_by_critical); + if FuncLoadError then + begin + {$if not defined(X509_CRL_get_ext_by_critical_allownil)} + X509_CRL_get_ext_by_critical := @ERR_X509_CRL_get_ext_by_critical; + {$ifend} + {$if declared(X509_CRL_get_ext_by_critical_introduced)} + if LibVersion < X509_CRL_get_ext_by_critical_introduced then + begin + {$if declared(FC_X509_CRL_get_ext_by_critical)} + X509_CRL_get_ext_by_critical := @FC_X509_CRL_get_ext_by_critical; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_CRL_get_ext_by_critical_removed)} + if X509_CRL_get_ext_by_critical_removed <= LibVersion then + begin + {$if declared(_X509_CRL_get_ext_by_critical)} + X509_CRL_get_ext_by_critical := @_X509_CRL_get_ext_by_critical; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_CRL_get_ext_by_critical_allownil)} + if FuncLoadError then + AFailed.Add('X509_CRL_get_ext_by_critical'); + {$ifend} + end; + + + X509_CRL_get_ext := LoadLibFunction(ADllHandle, X509_CRL_get_ext_procname); + FuncLoadError := not assigned(X509_CRL_get_ext); + if FuncLoadError then + begin + {$if not defined(X509_CRL_get_ext_allownil)} + X509_CRL_get_ext := @ERR_X509_CRL_get_ext; + {$ifend} + {$if declared(X509_CRL_get_ext_introduced)} + if LibVersion < X509_CRL_get_ext_introduced then + begin + {$if declared(FC_X509_CRL_get_ext)} + X509_CRL_get_ext := @FC_X509_CRL_get_ext; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_CRL_get_ext_removed)} + if X509_CRL_get_ext_removed <= LibVersion then + begin + {$if declared(_X509_CRL_get_ext)} + X509_CRL_get_ext := @_X509_CRL_get_ext; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_CRL_get_ext_allownil)} + if FuncLoadError then + AFailed.Add('X509_CRL_get_ext'); + {$ifend} + end; + + + X509_CRL_delete_ext := LoadLibFunction(ADllHandle, X509_CRL_delete_ext_procname); + FuncLoadError := not assigned(X509_CRL_delete_ext); + if FuncLoadError then + begin + {$if not defined(X509_CRL_delete_ext_allownil)} + X509_CRL_delete_ext := @ERR_X509_CRL_delete_ext; + {$ifend} + {$if declared(X509_CRL_delete_ext_introduced)} + if LibVersion < X509_CRL_delete_ext_introduced then + begin + {$if declared(FC_X509_CRL_delete_ext)} + X509_CRL_delete_ext := @FC_X509_CRL_delete_ext; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_CRL_delete_ext_removed)} + if X509_CRL_delete_ext_removed <= LibVersion then + begin + {$if declared(_X509_CRL_delete_ext)} + X509_CRL_delete_ext := @_X509_CRL_delete_ext; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_CRL_delete_ext_allownil)} + if FuncLoadError then + AFailed.Add('X509_CRL_delete_ext'); + {$ifend} + end; + + + X509_CRL_add_ext := LoadLibFunction(ADllHandle, X509_CRL_add_ext_procname); + FuncLoadError := not assigned(X509_CRL_add_ext); + if FuncLoadError then + begin + {$if not defined(X509_CRL_add_ext_allownil)} + X509_CRL_add_ext := @ERR_X509_CRL_add_ext; + {$ifend} + {$if declared(X509_CRL_add_ext_introduced)} + if LibVersion < X509_CRL_add_ext_introduced then + begin + {$if declared(FC_X509_CRL_add_ext)} + X509_CRL_add_ext := @FC_X509_CRL_add_ext; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_CRL_add_ext_removed)} + if X509_CRL_add_ext_removed <= LibVersion then + begin + {$if declared(_X509_CRL_add_ext)} + X509_CRL_add_ext := @_X509_CRL_add_ext; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_CRL_add_ext_allownil)} + if FuncLoadError then + AFailed.Add('X509_CRL_add_ext'); + {$ifend} + end; + + + X509_CRL_get_ext_d2i := LoadLibFunction(ADllHandle, X509_CRL_get_ext_d2i_procname); + FuncLoadError := not assigned(X509_CRL_get_ext_d2i); + if FuncLoadError then + begin + {$if not defined(X509_CRL_get_ext_d2i_allownil)} + X509_CRL_get_ext_d2i := @ERR_X509_CRL_get_ext_d2i; + {$ifend} + {$if declared(X509_CRL_get_ext_d2i_introduced)} + if LibVersion < X509_CRL_get_ext_d2i_introduced then + begin + {$if declared(FC_X509_CRL_get_ext_d2i)} + X509_CRL_get_ext_d2i := @FC_X509_CRL_get_ext_d2i; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_CRL_get_ext_d2i_removed)} + if X509_CRL_get_ext_d2i_removed <= LibVersion then + begin + {$if declared(_X509_CRL_get_ext_d2i)} + X509_CRL_get_ext_d2i := @_X509_CRL_get_ext_d2i; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_CRL_get_ext_d2i_allownil)} + if FuncLoadError then + AFailed.Add('X509_CRL_get_ext_d2i'); + {$ifend} + end; + + + X509_CRL_add1_ext_i2d := LoadLibFunction(ADllHandle, X509_CRL_add1_ext_i2d_procname); + FuncLoadError := not assigned(X509_CRL_add1_ext_i2d); + if FuncLoadError then + begin + {$if not defined(X509_CRL_add1_ext_i2d_allownil)} + X509_CRL_add1_ext_i2d := @ERR_X509_CRL_add1_ext_i2d; + {$ifend} + {$if declared(X509_CRL_add1_ext_i2d_introduced)} + if LibVersion < X509_CRL_add1_ext_i2d_introduced then + begin + {$if declared(FC_X509_CRL_add1_ext_i2d)} + X509_CRL_add1_ext_i2d := @FC_X509_CRL_add1_ext_i2d; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_CRL_add1_ext_i2d_removed)} + if X509_CRL_add1_ext_i2d_removed <= LibVersion then + begin + {$if declared(_X509_CRL_add1_ext_i2d)} + X509_CRL_add1_ext_i2d := @_X509_CRL_add1_ext_i2d; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_CRL_add1_ext_i2d_allownil)} + if FuncLoadError then + AFailed.Add('X509_CRL_add1_ext_i2d'); + {$ifend} + end; + + + X509_REVOKED_get_ext_count := LoadLibFunction(ADllHandle, X509_REVOKED_get_ext_count_procname); + FuncLoadError := not assigned(X509_REVOKED_get_ext_count); + if FuncLoadError then + begin + {$if not defined(X509_REVOKED_get_ext_count_allownil)} + X509_REVOKED_get_ext_count := @ERR_X509_REVOKED_get_ext_count; + {$ifend} + {$if declared(X509_REVOKED_get_ext_count_introduced)} + if LibVersion < X509_REVOKED_get_ext_count_introduced then + begin + {$if declared(FC_X509_REVOKED_get_ext_count)} + X509_REVOKED_get_ext_count := @FC_X509_REVOKED_get_ext_count; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_REVOKED_get_ext_count_removed)} + if X509_REVOKED_get_ext_count_removed <= LibVersion then + begin + {$if declared(_X509_REVOKED_get_ext_count)} + X509_REVOKED_get_ext_count := @_X509_REVOKED_get_ext_count; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_REVOKED_get_ext_count_allownil)} + if FuncLoadError then + AFailed.Add('X509_REVOKED_get_ext_count'); + {$ifend} + end; + + + X509_REVOKED_get_ext_by_NID := LoadLibFunction(ADllHandle, X509_REVOKED_get_ext_by_NID_procname); + FuncLoadError := not assigned(X509_REVOKED_get_ext_by_NID); + if FuncLoadError then + begin + {$if not defined(X509_REVOKED_get_ext_by_NID_allownil)} + X509_REVOKED_get_ext_by_NID := @ERR_X509_REVOKED_get_ext_by_NID; + {$ifend} + {$if declared(X509_REVOKED_get_ext_by_NID_introduced)} + if LibVersion < X509_REVOKED_get_ext_by_NID_introduced then + begin + {$if declared(FC_X509_REVOKED_get_ext_by_NID)} + X509_REVOKED_get_ext_by_NID := @FC_X509_REVOKED_get_ext_by_NID; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_REVOKED_get_ext_by_NID_removed)} + if X509_REVOKED_get_ext_by_NID_removed <= LibVersion then + begin + {$if declared(_X509_REVOKED_get_ext_by_NID)} + X509_REVOKED_get_ext_by_NID := @_X509_REVOKED_get_ext_by_NID; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_REVOKED_get_ext_by_NID_allownil)} + if FuncLoadError then + AFailed.Add('X509_REVOKED_get_ext_by_NID'); + {$ifend} + end; + + + X509_REVOKED_get_ext_by_OBJ := LoadLibFunction(ADllHandle, X509_REVOKED_get_ext_by_OBJ_procname); + FuncLoadError := not assigned(X509_REVOKED_get_ext_by_OBJ); + if FuncLoadError then + begin + {$if not defined(X509_REVOKED_get_ext_by_OBJ_allownil)} + X509_REVOKED_get_ext_by_OBJ := @ERR_X509_REVOKED_get_ext_by_OBJ; + {$ifend} + {$if declared(X509_REVOKED_get_ext_by_OBJ_introduced)} + if LibVersion < X509_REVOKED_get_ext_by_OBJ_introduced then + begin + {$if declared(FC_X509_REVOKED_get_ext_by_OBJ)} + X509_REVOKED_get_ext_by_OBJ := @FC_X509_REVOKED_get_ext_by_OBJ; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_REVOKED_get_ext_by_OBJ_removed)} + if X509_REVOKED_get_ext_by_OBJ_removed <= LibVersion then + begin + {$if declared(_X509_REVOKED_get_ext_by_OBJ)} + X509_REVOKED_get_ext_by_OBJ := @_X509_REVOKED_get_ext_by_OBJ; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_REVOKED_get_ext_by_OBJ_allownil)} + if FuncLoadError then + AFailed.Add('X509_REVOKED_get_ext_by_OBJ'); + {$ifend} + end; + + + X509_REVOKED_get_ext_by_critical := LoadLibFunction(ADllHandle, X509_REVOKED_get_ext_by_critical_procname); + FuncLoadError := not assigned(X509_REVOKED_get_ext_by_critical); + if FuncLoadError then + begin + {$if not defined(X509_REVOKED_get_ext_by_critical_allownil)} + X509_REVOKED_get_ext_by_critical := @ERR_X509_REVOKED_get_ext_by_critical; + {$ifend} + {$if declared(X509_REVOKED_get_ext_by_critical_introduced)} + if LibVersion < X509_REVOKED_get_ext_by_critical_introduced then + begin + {$if declared(FC_X509_REVOKED_get_ext_by_critical)} + X509_REVOKED_get_ext_by_critical := @FC_X509_REVOKED_get_ext_by_critical; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_REVOKED_get_ext_by_critical_removed)} + if X509_REVOKED_get_ext_by_critical_removed <= LibVersion then + begin + {$if declared(_X509_REVOKED_get_ext_by_critical)} + X509_REVOKED_get_ext_by_critical := @_X509_REVOKED_get_ext_by_critical; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_REVOKED_get_ext_by_critical_allownil)} + if FuncLoadError then + AFailed.Add('X509_REVOKED_get_ext_by_critical'); + {$ifend} + end; + + + X509_REVOKED_get_ext := LoadLibFunction(ADllHandle, X509_REVOKED_get_ext_procname); + FuncLoadError := not assigned(X509_REVOKED_get_ext); + if FuncLoadError then + begin + {$if not defined(X509_REVOKED_get_ext_allownil)} + X509_REVOKED_get_ext := @ERR_X509_REVOKED_get_ext; + {$ifend} + {$if declared(X509_REVOKED_get_ext_introduced)} + if LibVersion < X509_REVOKED_get_ext_introduced then + begin + {$if declared(FC_X509_REVOKED_get_ext)} + X509_REVOKED_get_ext := @FC_X509_REVOKED_get_ext; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_REVOKED_get_ext_removed)} + if X509_REVOKED_get_ext_removed <= LibVersion then + begin + {$if declared(_X509_REVOKED_get_ext)} + X509_REVOKED_get_ext := @_X509_REVOKED_get_ext; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_REVOKED_get_ext_allownil)} + if FuncLoadError then + AFailed.Add('X509_REVOKED_get_ext'); + {$ifend} + end; + + + X509_REVOKED_delete_ext := LoadLibFunction(ADllHandle, X509_REVOKED_delete_ext_procname); + FuncLoadError := not assigned(X509_REVOKED_delete_ext); + if FuncLoadError then + begin + {$if not defined(X509_REVOKED_delete_ext_allownil)} + X509_REVOKED_delete_ext := @ERR_X509_REVOKED_delete_ext; + {$ifend} + {$if declared(X509_REVOKED_delete_ext_introduced)} + if LibVersion < X509_REVOKED_delete_ext_introduced then + begin + {$if declared(FC_X509_REVOKED_delete_ext)} + X509_REVOKED_delete_ext := @FC_X509_REVOKED_delete_ext; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_REVOKED_delete_ext_removed)} + if X509_REVOKED_delete_ext_removed <= LibVersion then + begin + {$if declared(_X509_REVOKED_delete_ext)} + X509_REVOKED_delete_ext := @_X509_REVOKED_delete_ext; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_REVOKED_delete_ext_allownil)} + if FuncLoadError then + AFailed.Add('X509_REVOKED_delete_ext'); + {$ifend} + end; + + + X509_REVOKED_add_ext := LoadLibFunction(ADllHandle, X509_REVOKED_add_ext_procname); + FuncLoadError := not assigned(X509_REVOKED_add_ext); + if FuncLoadError then + begin + {$if not defined(X509_REVOKED_add_ext_allownil)} + X509_REVOKED_add_ext := @ERR_X509_REVOKED_add_ext; + {$ifend} + {$if declared(X509_REVOKED_add_ext_introduced)} + if LibVersion < X509_REVOKED_add_ext_introduced then + begin + {$if declared(FC_X509_REVOKED_add_ext)} + X509_REVOKED_add_ext := @FC_X509_REVOKED_add_ext; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_REVOKED_add_ext_removed)} + if X509_REVOKED_add_ext_removed <= LibVersion then + begin + {$if declared(_X509_REVOKED_add_ext)} + X509_REVOKED_add_ext := @_X509_REVOKED_add_ext; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_REVOKED_add_ext_allownil)} + if FuncLoadError then + AFailed.Add('X509_REVOKED_add_ext'); + {$ifend} + end; + + + X509_REVOKED_get_ext_d2i := LoadLibFunction(ADllHandle, X509_REVOKED_get_ext_d2i_procname); + FuncLoadError := not assigned(X509_REVOKED_get_ext_d2i); + if FuncLoadError then + begin + {$if not defined(X509_REVOKED_get_ext_d2i_allownil)} + X509_REVOKED_get_ext_d2i := @ERR_X509_REVOKED_get_ext_d2i; + {$ifend} + {$if declared(X509_REVOKED_get_ext_d2i_introduced)} + if LibVersion < X509_REVOKED_get_ext_d2i_introduced then + begin + {$if declared(FC_X509_REVOKED_get_ext_d2i)} + X509_REVOKED_get_ext_d2i := @FC_X509_REVOKED_get_ext_d2i; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_REVOKED_get_ext_d2i_removed)} + if X509_REVOKED_get_ext_d2i_removed <= LibVersion then + begin + {$if declared(_X509_REVOKED_get_ext_d2i)} + X509_REVOKED_get_ext_d2i := @_X509_REVOKED_get_ext_d2i; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_REVOKED_get_ext_d2i_allownil)} + if FuncLoadError then + AFailed.Add('X509_REVOKED_get_ext_d2i'); + {$ifend} + end; + + + X509_REVOKED_add1_ext_i2d := LoadLibFunction(ADllHandle, X509_REVOKED_add1_ext_i2d_procname); + FuncLoadError := not assigned(X509_REVOKED_add1_ext_i2d); + if FuncLoadError then + begin + {$if not defined(X509_REVOKED_add1_ext_i2d_allownil)} + X509_REVOKED_add1_ext_i2d := @ERR_X509_REVOKED_add1_ext_i2d; + {$ifend} + {$if declared(X509_REVOKED_add1_ext_i2d_introduced)} + if LibVersion < X509_REVOKED_add1_ext_i2d_introduced then + begin + {$if declared(FC_X509_REVOKED_add1_ext_i2d)} + X509_REVOKED_add1_ext_i2d := @FC_X509_REVOKED_add1_ext_i2d; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_REVOKED_add1_ext_i2d_removed)} + if X509_REVOKED_add1_ext_i2d_removed <= LibVersion then + begin + {$if declared(_X509_REVOKED_add1_ext_i2d)} + X509_REVOKED_add1_ext_i2d := @_X509_REVOKED_add1_ext_i2d; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_REVOKED_add1_ext_i2d_allownil)} + if FuncLoadError then + AFailed.Add('X509_REVOKED_add1_ext_i2d'); + {$ifend} + end; + + + X509_EXTENSION_create_by_NID := LoadLibFunction(ADllHandle, X509_EXTENSION_create_by_NID_procname); + FuncLoadError := not assigned(X509_EXTENSION_create_by_NID); + if FuncLoadError then + begin + {$if not defined(X509_EXTENSION_create_by_NID_allownil)} + X509_EXTENSION_create_by_NID := @ERR_X509_EXTENSION_create_by_NID; + {$ifend} + {$if declared(X509_EXTENSION_create_by_NID_introduced)} + if LibVersion < X509_EXTENSION_create_by_NID_introduced then + begin + {$if declared(FC_X509_EXTENSION_create_by_NID)} + X509_EXTENSION_create_by_NID := @FC_X509_EXTENSION_create_by_NID; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_EXTENSION_create_by_NID_removed)} + if X509_EXTENSION_create_by_NID_removed <= LibVersion then + begin + {$if declared(_X509_EXTENSION_create_by_NID)} + X509_EXTENSION_create_by_NID := @_X509_EXTENSION_create_by_NID; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_EXTENSION_create_by_NID_allownil)} + if FuncLoadError then + AFailed.Add('X509_EXTENSION_create_by_NID'); + {$ifend} + end; + + + X509_EXTENSION_create_by_OBJ := LoadLibFunction(ADllHandle, X509_EXTENSION_create_by_OBJ_procname); + FuncLoadError := not assigned(X509_EXTENSION_create_by_OBJ); + if FuncLoadError then + begin + {$if not defined(X509_EXTENSION_create_by_OBJ_allownil)} + X509_EXTENSION_create_by_OBJ := @ERR_X509_EXTENSION_create_by_OBJ; + {$ifend} + {$if declared(X509_EXTENSION_create_by_OBJ_introduced)} + if LibVersion < X509_EXTENSION_create_by_OBJ_introduced then + begin + {$if declared(FC_X509_EXTENSION_create_by_OBJ)} + X509_EXTENSION_create_by_OBJ := @FC_X509_EXTENSION_create_by_OBJ; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_EXTENSION_create_by_OBJ_removed)} + if X509_EXTENSION_create_by_OBJ_removed <= LibVersion then + begin + {$if declared(_X509_EXTENSION_create_by_OBJ)} + X509_EXTENSION_create_by_OBJ := @_X509_EXTENSION_create_by_OBJ; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_EXTENSION_create_by_OBJ_allownil)} + if FuncLoadError then + AFailed.Add('X509_EXTENSION_create_by_OBJ'); + {$ifend} + end; + + + X509_EXTENSION_set_object := LoadLibFunction(ADllHandle, X509_EXTENSION_set_object_procname); + FuncLoadError := not assigned(X509_EXTENSION_set_object); + if FuncLoadError then + begin + {$if not defined(X509_EXTENSION_set_object_allownil)} + X509_EXTENSION_set_object := @ERR_X509_EXTENSION_set_object; + {$ifend} + {$if declared(X509_EXTENSION_set_object_introduced)} + if LibVersion < X509_EXTENSION_set_object_introduced then + begin + {$if declared(FC_X509_EXTENSION_set_object)} + X509_EXTENSION_set_object := @FC_X509_EXTENSION_set_object; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_EXTENSION_set_object_removed)} + if X509_EXTENSION_set_object_removed <= LibVersion then + begin + {$if declared(_X509_EXTENSION_set_object)} + X509_EXTENSION_set_object := @_X509_EXTENSION_set_object; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_EXTENSION_set_object_allownil)} + if FuncLoadError then + AFailed.Add('X509_EXTENSION_set_object'); + {$ifend} + end; + + + X509_EXTENSION_set_critical := LoadLibFunction(ADllHandle, X509_EXTENSION_set_critical_procname); + FuncLoadError := not assigned(X509_EXTENSION_set_critical); + if FuncLoadError then + begin + {$if not defined(X509_EXTENSION_set_critical_allownil)} + X509_EXTENSION_set_critical := @ERR_X509_EXTENSION_set_critical; + {$ifend} + {$if declared(X509_EXTENSION_set_critical_introduced)} + if LibVersion < X509_EXTENSION_set_critical_introduced then + begin + {$if declared(FC_X509_EXTENSION_set_critical)} + X509_EXTENSION_set_critical := @FC_X509_EXTENSION_set_critical; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_EXTENSION_set_critical_removed)} + if X509_EXTENSION_set_critical_removed <= LibVersion then + begin + {$if declared(_X509_EXTENSION_set_critical)} + X509_EXTENSION_set_critical := @_X509_EXTENSION_set_critical; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_EXTENSION_set_critical_allownil)} + if FuncLoadError then + AFailed.Add('X509_EXTENSION_set_critical'); + {$ifend} + end; + + + X509_EXTENSION_set_data := LoadLibFunction(ADllHandle, X509_EXTENSION_set_data_procname); + FuncLoadError := not assigned(X509_EXTENSION_set_data); + if FuncLoadError then + begin + {$if not defined(X509_EXTENSION_set_data_allownil)} + X509_EXTENSION_set_data := @ERR_X509_EXTENSION_set_data; + {$ifend} + {$if declared(X509_EXTENSION_set_data_introduced)} + if LibVersion < X509_EXTENSION_set_data_introduced then + begin + {$if declared(FC_X509_EXTENSION_set_data)} + X509_EXTENSION_set_data := @FC_X509_EXTENSION_set_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_EXTENSION_set_data_removed)} + if X509_EXTENSION_set_data_removed <= LibVersion then + begin + {$if declared(_X509_EXTENSION_set_data)} + X509_EXTENSION_set_data := @_X509_EXTENSION_set_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_EXTENSION_set_data_allownil)} + if FuncLoadError then + AFailed.Add('X509_EXTENSION_set_data'); + {$ifend} + end; + + + X509_EXTENSION_get_object := LoadLibFunction(ADllHandle, X509_EXTENSION_get_object_procname); + FuncLoadError := not assigned(X509_EXTENSION_get_object); + if FuncLoadError then + begin + {$if not defined(X509_EXTENSION_get_object_allownil)} + X509_EXTENSION_get_object := @ERR_X509_EXTENSION_get_object; + {$ifend} + {$if declared(X509_EXTENSION_get_object_introduced)} + if LibVersion < X509_EXTENSION_get_object_introduced then + begin + {$if declared(FC_X509_EXTENSION_get_object)} + X509_EXTENSION_get_object := @FC_X509_EXTENSION_get_object; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_EXTENSION_get_object_removed)} + if X509_EXTENSION_get_object_removed <= LibVersion then + begin + {$if declared(_X509_EXTENSION_get_object)} + X509_EXTENSION_get_object := @_X509_EXTENSION_get_object; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_EXTENSION_get_object_allownil)} + if FuncLoadError then + AFailed.Add('X509_EXTENSION_get_object'); + {$ifend} + end; + + + X509_EXTENSION_get_data := LoadLibFunction(ADllHandle, X509_EXTENSION_get_data_procname); + FuncLoadError := not assigned(X509_EXTENSION_get_data); + if FuncLoadError then + begin + {$if not defined(X509_EXTENSION_get_data_allownil)} + X509_EXTENSION_get_data := @ERR_X509_EXTENSION_get_data; + {$ifend} + {$if declared(X509_EXTENSION_get_data_introduced)} + if LibVersion < X509_EXTENSION_get_data_introduced then + begin + {$if declared(FC_X509_EXTENSION_get_data)} + X509_EXTENSION_get_data := @FC_X509_EXTENSION_get_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_EXTENSION_get_data_removed)} + if X509_EXTENSION_get_data_removed <= LibVersion then + begin + {$if declared(_X509_EXTENSION_get_data)} + X509_EXTENSION_get_data := @_X509_EXTENSION_get_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_EXTENSION_get_data_allownil)} + if FuncLoadError then + AFailed.Add('X509_EXTENSION_get_data'); + {$ifend} + end; + + + X509_EXTENSION_get_critical := LoadLibFunction(ADllHandle, X509_EXTENSION_get_critical_procname); + FuncLoadError := not assigned(X509_EXTENSION_get_critical); + if FuncLoadError then + begin + {$if not defined(X509_EXTENSION_get_critical_allownil)} + X509_EXTENSION_get_critical := @ERR_X509_EXTENSION_get_critical; + {$ifend} + {$if declared(X509_EXTENSION_get_critical_introduced)} + if LibVersion < X509_EXTENSION_get_critical_introduced then + begin + {$if declared(FC_X509_EXTENSION_get_critical)} + X509_EXTENSION_get_critical := @FC_X509_EXTENSION_get_critical; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_EXTENSION_get_critical_removed)} + if X509_EXTENSION_get_critical_removed <= LibVersion then + begin + {$if declared(_X509_EXTENSION_get_critical)} + X509_EXTENSION_get_critical := @_X509_EXTENSION_get_critical; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_EXTENSION_get_critical_allownil)} + if FuncLoadError then + AFailed.Add('X509_EXTENSION_get_critical'); + {$ifend} + end; + + + X509_ATTRIBUTE_create_by_NID := LoadLibFunction(ADllHandle, X509_ATTRIBUTE_create_by_NID_procname); + FuncLoadError := not assigned(X509_ATTRIBUTE_create_by_NID); + if FuncLoadError then + begin + {$if not defined(X509_ATTRIBUTE_create_by_NID_allownil)} + X509_ATTRIBUTE_create_by_NID := @ERR_X509_ATTRIBUTE_create_by_NID; + {$ifend} + {$if declared(X509_ATTRIBUTE_create_by_NID_introduced)} + if LibVersion < X509_ATTRIBUTE_create_by_NID_introduced then + begin + {$if declared(FC_X509_ATTRIBUTE_create_by_NID)} + X509_ATTRIBUTE_create_by_NID := @FC_X509_ATTRIBUTE_create_by_NID; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_ATTRIBUTE_create_by_NID_removed)} + if X509_ATTRIBUTE_create_by_NID_removed <= LibVersion then + begin + {$if declared(_X509_ATTRIBUTE_create_by_NID)} + X509_ATTRIBUTE_create_by_NID := @_X509_ATTRIBUTE_create_by_NID; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_ATTRIBUTE_create_by_NID_allownil)} + if FuncLoadError then + AFailed.Add('X509_ATTRIBUTE_create_by_NID'); + {$ifend} + end; + + + X509_ATTRIBUTE_create_by_OBJ := LoadLibFunction(ADllHandle, X509_ATTRIBUTE_create_by_OBJ_procname); + FuncLoadError := not assigned(X509_ATTRIBUTE_create_by_OBJ); + if FuncLoadError then + begin + {$if not defined(X509_ATTRIBUTE_create_by_OBJ_allownil)} + X509_ATTRIBUTE_create_by_OBJ := @ERR_X509_ATTRIBUTE_create_by_OBJ; + {$ifend} + {$if declared(X509_ATTRIBUTE_create_by_OBJ_introduced)} + if LibVersion < X509_ATTRIBUTE_create_by_OBJ_introduced then + begin + {$if declared(FC_X509_ATTRIBUTE_create_by_OBJ)} + X509_ATTRIBUTE_create_by_OBJ := @FC_X509_ATTRIBUTE_create_by_OBJ; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_ATTRIBUTE_create_by_OBJ_removed)} + if X509_ATTRIBUTE_create_by_OBJ_removed <= LibVersion then + begin + {$if declared(_X509_ATTRIBUTE_create_by_OBJ)} + X509_ATTRIBUTE_create_by_OBJ := @_X509_ATTRIBUTE_create_by_OBJ; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_ATTRIBUTE_create_by_OBJ_allownil)} + if FuncLoadError then + AFailed.Add('X509_ATTRIBUTE_create_by_OBJ'); + {$ifend} + end; + + + X509_ATTRIBUTE_create_by_txt := LoadLibFunction(ADllHandle, X509_ATTRIBUTE_create_by_txt_procname); + FuncLoadError := not assigned(X509_ATTRIBUTE_create_by_txt); + if FuncLoadError then + begin + {$if not defined(X509_ATTRIBUTE_create_by_txt_allownil)} + X509_ATTRIBUTE_create_by_txt := @ERR_X509_ATTRIBUTE_create_by_txt; + {$ifend} + {$if declared(X509_ATTRIBUTE_create_by_txt_introduced)} + if LibVersion < X509_ATTRIBUTE_create_by_txt_introduced then + begin + {$if declared(FC_X509_ATTRIBUTE_create_by_txt)} + X509_ATTRIBUTE_create_by_txt := @FC_X509_ATTRIBUTE_create_by_txt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_ATTRIBUTE_create_by_txt_removed)} + if X509_ATTRIBUTE_create_by_txt_removed <= LibVersion then + begin + {$if declared(_X509_ATTRIBUTE_create_by_txt)} + X509_ATTRIBUTE_create_by_txt := @_X509_ATTRIBUTE_create_by_txt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_ATTRIBUTE_create_by_txt_allownil)} + if FuncLoadError then + AFailed.Add('X509_ATTRIBUTE_create_by_txt'); + {$ifend} + end; + + + X509_ATTRIBUTE_set1_object := LoadLibFunction(ADllHandle, X509_ATTRIBUTE_set1_object_procname); + FuncLoadError := not assigned(X509_ATTRIBUTE_set1_object); + if FuncLoadError then + begin + {$if not defined(X509_ATTRIBUTE_set1_object_allownil)} + X509_ATTRIBUTE_set1_object := @ERR_X509_ATTRIBUTE_set1_object; + {$ifend} + {$if declared(X509_ATTRIBUTE_set1_object_introduced)} + if LibVersion < X509_ATTRIBUTE_set1_object_introduced then + begin + {$if declared(FC_X509_ATTRIBUTE_set1_object)} + X509_ATTRIBUTE_set1_object := @FC_X509_ATTRIBUTE_set1_object; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_ATTRIBUTE_set1_object_removed)} + if X509_ATTRIBUTE_set1_object_removed <= LibVersion then + begin + {$if declared(_X509_ATTRIBUTE_set1_object)} + X509_ATTRIBUTE_set1_object := @_X509_ATTRIBUTE_set1_object; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_ATTRIBUTE_set1_object_allownil)} + if FuncLoadError then + AFailed.Add('X509_ATTRIBUTE_set1_object'); + {$ifend} + end; + + + X509_ATTRIBUTE_set1_data := LoadLibFunction(ADllHandle, X509_ATTRIBUTE_set1_data_procname); + FuncLoadError := not assigned(X509_ATTRIBUTE_set1_data); + if FuncLoadError then + begin + {$if not defined(X509_ATTRIBUTE_set1_data_allownil)} + X509_ATTRIBUTE_set1_data := @ERR_X509_ATTRIBUTE_set1_data; + {$ifend} + {$if declared(X509_ATTRIBUTE_set1_data_introduced)} + if LibVersion < X509_ATTRIBUTE_set1_data_introduced then + begin + {$if declared(FC_X509_ATTRIBUTE_set1_data)} + X509_ATTRIBUTE_set1_data := @FC_X509_ATTRIBUTE_set1_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_ATTRIBUTE_set1_data_removed)} + if X509_ATTRIBUTE_set1_data_removed <= LibVersion then + begin + {$if declared(_X509_ATTRIBUTE_set1_data)} + X509_ATTRIBUTE_set1_data := @_X509_ATTRIBUTE_set1_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_ATTRIBUTE_set1_data_allownil)} + if FuncLoadError then + AFailed.Add('X509_ATTRIBUTE_set1_data'); + {$ifend} + end; + + + X509_ATTRIBUTE_get0_data := LoadLibFunction(ADllHandle, X509_ATTRIBUTE_get0_data_procname); + FuncLoadError := not assigned(X509_ATTRIBUTE_get0_data); + if FuncLoadError then + begin + {$if not defined(X509_ATTRIBUTE_get0_data_allownil)} + X509_ATTRIBUTE_get0_data := @ERR_X509_ATTRIBUTE_get0_data; + {$ifend} + {$if declared(X509_ATTRIBUTE_get0_data_introduced)} + if LibVersion < X509_ATTRIBUTE_get0_data_introduced then + begin + {$if declared(FC_X509_ATTRIBUTE_get0_data)} + X509_ATTRIBUTE_get0_data := @FC_X509_ATTRIBUTE_get0_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_ATTRIBUTE_get0_data_removed)} + if X509_ATTRIBUTE_get0_data_removed <= LibVersion then + begin + {$if declared(_X509_ATTRIBUTE_get0_data)} + X509_ATTRIBUTE_get0_data := @_X509_ATTRIBUTE_get0_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_ATTRIBUTE_get0_data_allownil)} + if FuncLoadError then + AFailed.Add('X509_ATTRIBUTE_get0_data'); + {$ifend} + end; + + + X509_ATTRIBUTE_count := LoadLibFunction(ADllHandle, X509_ATTRIBUTE_count_procname); + FuncLoadError := not assigned(X509_ATTRIBUTE_count); + if FuncLoadError then + begin + {$if not defined(X509_ATTRIBUTE_count_allownil)} + X509_ATTRIBUTE_count := @ERR_X509_ATTRIBUTE_count; + {$ifend} + {$if declared(X509_ATTRIBUTE_count_introduced)} + if LibVersion < X509_ATTRIBUTE_count_introduced then + begin + {$if declared(FC_X509_ATTRIBUTE_count)} + X509_ATTRIBUTE_count := @FC_X509_ATTRIBUTE_count; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_ATTRIBUTE_count_removed)} + if X509_ATTRIBUTE_count_removed <= LibVersion then + begin + {$if declared(_X509_ATTRIBUTE_count)} + X509_ATTRIBUTE_count := @_X509_ATTRIBUTE_count; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_ATTRIBUTE_count_allownil)} + if FuncLoadError then + AFailed.Add('X509_ATTRIBUTE_count'); + {$ifend} + end; + + + X509_ATTRIBUTE_get0_object := LoadLibFunction(ADllHandle, X509_ATTRIBUTE_get0_object_procname); + FuncLoadError := not assigned(X509_ATTRIBUTE_get0_object); + if FuncLoadError then + begin + {$if not defined(X509_ATTRIBUTE_get0_object_allownil)} + X509_ATTRIBUTE_get0_object := @ERR_X509_ATTRIBUTE_get0_object; + {$ifend} + {$if declared(X509_ATTRIBUTE_get0_object_introduced)} + if LibVersion < X509_ATTRIBUTE_get0_object_introduced then + begin + {$if declared(FC_X509_ATTRIBUTE_get0_object)} + X509_ATTRIBUTE_get0_object := @FC_X509_ATTRIBUTE_get0_object; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_ATTRIBUTE_get0_object_removed)} + if X509_ATTRIBUTE_get0_object_removed <= LibVersion then + begin + {$if declared(_X509_ATTRIBUTE_get0_object)} + X509_ATTRIBUTE_get0_object := @_X509_ATTRIBUTE_get0_object; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_ATTRIBUTE_get0_object_allownil)} + if FuncLoadError then + AFailed.Add('X509_ATTRIBUTE_get0_object'); + {$ifend} + end; + + + X509_ATTRIBUTE_get0_type := LoadLibFunction(ADllHandle, X509_ATTRIBUTE_get0_type_procname); + FuncLoadError := not assigned(X509_ATTRIBUTE_get0_type); + if FuncLoadError then + begin + {$if not defined(X509_ATTRIBUTE_get0_type_allownil)} + X509_ATTRIBUTE_get0_type := @ERR_X509_ATTRIBUTE_get0_type; + {$ifend} + {$if declared(X509_ATTRIBUTE_get0_type_introduced)} + if LibVersion < X509_ATTRIBUTE_get0_type_introduced then + begin + {$if declared(FC_X509_ATTRIBUTE_get0_type)} + X509_ATTRIBUTE_get0_type := @FC_X509_ATTRIBUTE_get0_type; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_ATTRIBUTE_get0_type_removed)} + if X509_ATTRIBUTE_get0_type_removed <= LibVersion then + begin + {$if declared(_X509_ATTRIBUTE_get0_type)} + X509_ATTRIBUTE_get0_type := @_X509_ATTRIBUTE_get0_type; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_ATTRIBUTE_get0_type_allownil)} + if FuncLoadError then + AFailed.Add('X509_ATTRIBUTE_get0_type'); + {$ifend} + end; + + + EVP_PKEY_get_attr_count := LoadLibFunction(ADllHandle, EVP_PKEY_get_attr_count_procname); + FuncLoadError := not assigned(EVP_PKEY_get_attr_count); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_get_attr_count_allownil)} + EVP_PKEY_get_attr_count := @ERR_EVP_PKEY_get_attr_count; + {$ifend} + {$if declared(EVP_PKEY_get_attr_count_introduced)} + if LibVersion < EVP_PKEY_get_attr_count_introduced then + begin + {$if declared(FC_EVP_PKEY_get_attr_count)} + EVP_PKEY_get_attr_count := @FC_EVP_PKEY_get_attr_count; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_get_attr_count_removed)} + if EVP_PKEY_get_attr_count_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_get_attr_count)} + EVP_PKEY_get_attr_count := @_EVP_PKEY_get_attr_count; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_get_attr_count_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_get_attr_count'); + {$ifend} + end; + + + EVP_PKEY_get_attr_by_NID := LoadLibFunction(ADllHandle, EVP_PKEY_get_attr_by_NID_procname); + FuncLoadError := not assigned(EVP_PKEY_get_attr_by_NID); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_get_attr_by_NID_allownil)} + EVP_PKEY_get_attr_by_NID := @ERR_EVP_PKEY_get_attr_by_NID; + {$ifend} + {$if declared(EVP_PKEY_get_attr_by_NID_introduced)} + if LibVersion < EVP_PKEY_get_attr_by_NID_introduced then + begin + {$if declared(FC_EVP_PKEY_get_attr_by_NID)} + EVP_PKEY_get_attr_by_NID := @FC_EVP_PKEY_get_attr_by_NID; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_get_attr_by_NID_removed)} + if EVP_PKEY_get_attr_by_NID_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_get_attr_by_NID)} + EVP_PKEY_get_attr_by_NID := @_EVP_PKEY_get_attr_by_NID; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_get_attr_by_NID_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_get_attr_by_NID'); + {$ifend} + end; + + + EVP_PKEY_get_attr_by_OBJ := LoadLibFunction(ADllHandle, EVP_PKEY_get_attr_by_OBJ_procname); + FuncLoadError := not assigned(EVP_PKEY_get_attr_by_OBJ); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_get_attr_by_OBJ_allownil)} + EVP_PKEY_get_attr_by_OBJ := @ERR_EVP_PKEY_get_attr_by_OBJ; + {$ifend} + {$if declared(EVP_PKEY_get_attr_by_OBJ_introduced)} + if LibVersion < EVP_PKEY_get_attr_by_OBJ_introduced then + begin + {$if declared(FC_EVP_PKEY_get_attr_by_OBJ)} + EVP_PKEY_get_attr_by_OBJ := @FC_EVP_PKEY_get_attr_by_OBJ; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_get_attr_by_OBJ_removed)} + if EVP_PKEY_get_attr_by_OBJ_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_get_attr_by_OBJ)} + EVP_PKEY_get_attr_by_OBJ := @_EVP_PKEY_get_attr_by_OBJ; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_get_attr_by_OBJ_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_get_attr_by_OBJ'); + {$ifend} + end; + + + EVP_PKEY_get_attr := LoadLibFunction(ADllHandle, EVP_PKEY_get_attr_procname); + FuncLoadError := not assigned(EVP_PKEY_get_attr); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_get_attr_allownil)} + EVP_PKEY_get_attr := @ERR_EVP_PKEY_get_attr; + {$ifend} + {$if declared(EVP_PKEY_get_attr_introduced)} + if LibVersion < EVP_PKEY_get_attr_introduced then + begin + {$if declared(FC_EVP_PKEY_get_attr)} + EVP_PKEY_get_attr := @FC_EVP_PKEY_get_attr; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_get_attr_removed)} + if EVP_PKEY_get_attr_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_get_attr)} + EVP_PKEY_get_attr := @_EVP_PKEY_get_attr; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_get_attr_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_get_attr'); + {$ifend} + end; + + + EVP_PKEY_delete_attr := LoadLibFunction(ADllHandle, EVP_PKEY_delete_attr_procname); + FuncLoadError := not assigned(EVP_PKEY_delete_attr); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_delete_attr_allownil)} + EVP_PKEY_delete_attr := @ERR_EVP_PKEY_delete_attr; + {$ifend} + {$if declared(EVP_PKEY_delete_attr_introduced)} + if LibVersion < EVP_PKEY_delete_attr_introduced then + begin + {$if declared(FC_EVP_PKEY_delete_attr)} + EVP_PKEY_delete_attr := @FC_EVP_PKEY_delete_attr; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_delete_attr_removed)} + if EVP_PKEY_delete_attr_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_delete_attr)} + EVP_PKEY_delete_attr := @_EVP_PKEY_delete_attr; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_delete_attr_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_delete_attr'); + {$ifend} + end; + + + EVP_PKEY_add1_attr := LoadLibFunction(ADllHandle, EVP_PKEY_add1_attr_procname); + FuncLoadError := not assigned(EVP_PKEY_add1_attr); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_add1_attr_allownil)} + EVP_PKEY_add1_attr := @ERR_EVP_PKEY_add1_attr; + {$ifend} + {$if declared(EVP_PKEY_add1_attr_introduced)} + if LibVersion < EVP_PKEY_add1_attr_introduced then + begin + {$if declared(FC_EVP_PKEY_add1_attr)} + EVP_PKEY_add1_attr := @FC_EVP_PKEY_add1_attr; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_add1_attr_removed)} + if EVP_PKEY_add1_attr_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_add1_attr)} + EVP_PKEY_add1_attr := @_EVP_PKEY_add1_attr; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_add1_attr_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_add1_attr'); + {$ifend} + end; + + + EVP_PKEY_add1_attr_by_OBJ := LoadLibFunction(ADllHandle, EVP_PKEY_add1_attr_by_OBJ_procname); + FuncLoadError := not assigned(EVP_PKEY_add1_attr_by_OBJ); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_add1_attr_by_OBJ_allownil)} + EVP_PKEY_add1_attr_by_OBJ := @ERR_EVP_PKEY_add1_attr_by_OBJ; + {$ifend} + {$if declared(EVP_PKEY_add1_attr_by_OBJ_introduced)} + if LibVersion < EVP_PKEY_add1_attr_by_OBJ_introduced then + begin + {$if declared(FC_EVP_PKEY_add1_attr_by_OBJ)} + EVP_PKEY_add1_attr_by_OBJ := @FC_EVP_PKEY_add1_attr_by_OBJ; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_add1_attr_by_OBJ_removed)} + if EVP_PKEY_add1_attr_by_OBJ_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_add1_attr_by_OBJ)} + EVP_PKEY_add1_attr_by_OBJ := @_EVP_PKEY_add1_attr_by_OBJ; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_add1_attr_by_OBJ_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_add1_attr_by_OBJ'); + {$ifend} + end; + + + EVP_PKEY_add1_attr_by_NID := LoadLibFunction(ADllHandle, EVP_PKEY_add1_attr_by_NID_procname); + FuncLoadError := not assigned(EVP_PKEY_add1_attr_by_NID); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_add1_attr_by_NID_allownil)} + EVP_PKEY_add1_attr_by_NID := @ERR_EVP_PKEY_add1_attr_by_NID; + {$ifend} + {$if declared(EVP_PKEY_add1_attr_by_NID_introduced)} + if LibVersion < EVP_PKEY_add1_attr_by_NID_introduced then + begin + {$if declared(FC_EVP_PKEY_add1_attr_by_NID)} + EVP_PKEY_add1_attr_by_NID := @FC_EVP_PKEY_add1_attr_by_NID; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_add1_attr_by_NID_removed)} + if EVP_PKEY_add1_attr_by_NID_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_add1_attr_by_NID)} + EVP_PKEY_add1_attr_by_NID := @_EVP_PKEY_add1_attr_by_NID; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_add1_attr_by_NID_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_add1_attr_by_NID'); + {$ifend} + end; + + + EVP_PKEY_add1_attr_by_txt := LoadLibFunction(ADllHandle, EVP_PKEY_add1_attr_by_txt_procname); + FuncLoadError := not assigned(EVP_PKEY_add1_attr_by_txt); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY_add1_attr_by_txt_allownil)} + EVP_PKEY_add1_attr_by_txt := @ERR_EVP_PKEY_add1_attr_by_txt; + {$ifend} + {$if declared(EVP_PKEY_add1_attr_by_txt_introduced)} + if LibVersion < EVP_PKEY_add1_attr_by_txt_introduced then + begin + {$if declared(FC_EVP_PKEY_add1_attr_by_txt)} + EVP_PKEY_add1_attr_by_txt := @FC_EVP_PKEY_add1_attr_by_txt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY_add1_attr_by_txt_removed)} + if EVP_PKEY_add1_attr_by_txt_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY_add1_attr_by_txt)} + EVP_PKEY_add1_attr_by_txt := @_EVP_PKEY_add1_attr_by_txt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY_add1_attr_by_txt_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY_add1_attr_by_txt'); + {$ifend} + end; + + + X509_verify_cert := LoadLibFunction(ADllHandle, X509_verify_cert_procname); + FuncLoadError := not assigned(X509_verify_cert); + if FuncLoadError then + begin + {$if not defined(X509_verify_cert_allownil)} + X509_verify_cert := @ERR_X509_verify_cert; + {$ifend} + {$if declared(X509_verify_cert_introduced)} + if LibVersion < X509_verify_cert_introduced then + begin + {$if declared(FC_X509_verify_cert)} + X509_verify_cert := @FC_X509_verify_cert; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_verify_cert_removed)} + if X509_verify_cert_removed <= LibVersion then + begin + {$if declared(_X509_verify_cert)} + X509_verify_cert := @_X509_verify_cert; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_verify_cert_allownil)} + if FuncLoadError then + AFailed.Add('X509_verify_cert'); + {$ifend} + end; + + + PKCS5_pbe_set0_algor := LoadLibFunction(ADllHandle, PKCS5_pbe_set0_algor_procname); + FuncLoadError := not assigned(PKCS5_pbe_set0_algor); + if FuncLoadError then + begin + {$if not defined(PKCS5_pbe_set0_algor_allownil)} + PKCS5_pbe_set0_algor := @ERR_PKCS5_pbe_set0_algor; + {$ifend} + {$if declared(PKCS5_pbe_set0_algor_introduced)} + if LibVersion < PKCS5_pbe_set0_algor_introduced then + begin + {$if declared(FC_PKCS5_pbe_set0_algor)} + PKCS5_pbe_set0_algor := @FC_PKCS5_pbe_set0_algor; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS5_pbe_set0_algor_removed)} + if PKCS5_pbe_set0_algor_removed <= LibVersion then + begin + {$if declared(_PKCS5_pbe_set0_algor)} + PKCS5_pbe_set0_algor := @_PKCS5_pbe_set0_algor; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS5_pbe_set0_algor_allownil)} + if FuncLoadError then + AFailed.Add('PKCS5_pbe_set0_algor'); + {$ifend} + end; + + + PKCS5_pbe_set := LoadLibFunction(ADllHandle, PKCS5_pbe_set_procname); + FuncLoadError := not assigned(PKCS5_pbe_set); + if FuncLoadError then + begin + {$if not defined(PKCS5_pbe_set_allownil)} + PKCS5_pbe_set := @ERR_PKCS5_pbe_set; + {$ifend} + {$if declared(PKCS5_pbe_set_introduced)} + if LibVersion < PKCS5_pbe_set_introduced then + begin + {$if declared(FC_PKCS5_pbe_set)} + PKCS5_pbe_set := @FC_PKCS5_pbe_set; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS5_pbe_set_removed)} + if PKCS5_pbe_set_removed <= LibVersion then + begin + {$if declared(_PKCS5_pbe_set)} + PKCS5_pbe_set := @_PKCS5_pbe_set; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS5_pbe_set_allownil)} + if FuncLoadError then + AFailed.Add('PKCS5_pbe_set'); + {$ifend} + end; + + + PKCS5_pbe2_set := LoadLibFunction(ADllHandle, PKCS5_pbe2_set_procname); + FuncLoadError := not assigned(PKCS5_pbe2_set); + if FuncLoadError then + begin + {$if not defined(PKCS5_pbe2_set_allownil)} + PKCS5_pbe2_set := @ERR_PKCS5_pbe2_set; + {$ifend} + {$if declared(PKCS5_pbe2_set_introduced)} + if LibVersion < PKCS5_pbe2_set_introduced then + begin + {$if declared(FC_PKCS5_pbe2_set)} + PKCS5_pbe2_set := @FC_PKCS5_pbe2_set; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS5_pbe2_set_removed)} + if PKCS5_pbe2_set_removed <= LibVersion then + begin + {$if declared(_PKCS5_pbe2_set)} + PKCS5_pbe2_set := @_PKCS5_pbe2_set; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS5_pbe2_set_allownil)} + if FuncLoadError then + AFailed.Add('PKCS5_pbe2_set'); + {$ifend} + end; + + + PKCS5_pbe2_set_iv := LoadLibFunction(ADllHandle, PKCS5_pbe2_set_iv_procname); + FuncLoadError := not assigned(PKCS5_pbe2_set_iv); + if FuncLoadError then + begin + {$if not defined(PKCS5_pbe2_set_iv_allownil)} + PKCS5_pbe2_set_iv := @ERR_PKCS5_pbe2_set_iv; + {$ifend} + {$if declared(PKCS5_pbe2_set_iv_introduced)} + if LibVersion < PKCS5_pbe2_set_iv_introduced then + begin + {$if declared(FC_PKCS5_pbe2_set_iv)} + PKCS5_pbe2_set_iv := @FC_PKCS5_pbe2_set_iv; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS5_pbe2_set_iv_removed)} + if PKCS5_pbe2_set_iv_removed <= LibVersion then + begin + {$if declared(_PKCS5_pbe2_set_iv)} + PKCS5_pbe2_set_iv := @_PKCS5_pbe2_set_iv; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS5_pbe2_set_iv_allownil)} + if FuncLoadError then + AFailed.Add('PKCS5_pbe2_set_iv'); + {$ifend} + end; + + + PKCS5_pbe2_set_scrypt := LoadLibFunction(ADllHandle, PKCS5_pbe2_set_scrypt_procname); + FuncLoadError := not assigned(PKCS5_pbe2_set_scrypt); + if FuncLoadError then + begin + {$if not defined(PKCS5_pbe2_set_scrypt_allownil)} + PKCS5_pbe2_set_scrypt := @ERR_PKCS5_pbe2_set_scrypt; + {$ifend} + {$if declared(PKCS5_pbe2_set_scrypt_introduced)} + if LibVersion < PKCS5_pbe2_set_scrypt_introduced then + begin + {$if declared(FC_PKCS5_pbe2_set_scrypt)} + PKCS5_pbe2_set_scrypt := @FC_PKCS5_pbe2_set_scrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS5_pbe2_set_scrypt_removed)} + if PKCS5_pbe2_set_scrypt_removed <= LibVersion then + begin + {$if declared(_PKCS5_pbe2_set_scrypt)} + PKCS5_pbe2_set_scrypt := @_PKCS5_pbe2_set_scrypt; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS5_pbe2_set_scrypt_allownil)} + if FuncLoadError then + AFailed.Add('PKCS5_pbe2_set_scrypt'); + {$ifend} + end; + + {introduced 1.1.0} + PKCS5_pbkdf2_set := LoadLibFunction(ADllHandle, PKCS5_pbkdf2_set_procname); + FuncLoadError := not assigned(PKCS5_pbkdf2_set); + if FuncLoadError then + begin + {$if not defined(PKCS5_pbkdf2_set_allownil)} + PKCS5_pbkdf2_set := @ERR_PKCS5_pbkdf2_set; + {$ifend} + {$if declared(PKCS5_pbkdf2_set_introduced)} + if LibVersion < PKCS5_pbkdf2_set_introduced then + begin + {$if declared(FC_PKCS5_pbkdf2_set)} + PKCS5_pbkdf2_set := @FC_PKCS5_pbkdf2_set; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS5_pbkdf2_set_removed)} + if PKCS5_pbkdf2_set_removed <= LibVersion then + begin + {$if declared(_PKCS5_pbkdf2_set)} + PKCS5_pbkdf2_set := @_PKCS5_pbkdf2_set; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS5_pbkdf2_set_allownil)} + if FuncLoadError then + AFailed.Add('PKCS5_pbkdf2_set'); + {$ifend} + end; + + + EVP_PKCS82PKEY := LoadLibFunction(ADllHandle, EVP_PKCS82PKEY_procname); + FuncLoadError := not assigned(EVP_PKCS82PKEY); + if FuncLoadError then + begin + {$if not defined(EVP_PKCS82PKEY_allownil)} + EVP_PKCS82PKEY := @ERR_EVP_PKCS82PKEY; + {$ifend} + {$if declared(EVP_PKCS82PKEY_introduced)} + if LibVersion < EVP_PKCS82PKEY_introduced then + begin + {$if declared(FC_EVP_PKCS82PKEY)} + EVP_PKCS82PKEY := @FC_EVP_PKCS82PKEY; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKCS82PKEY_removed)} + if EVP_PKCS82PKEY_removed <= LibVersion then + begin + {$if declared(_EVP_PKCS82PKEY)} + EVP_PKCS82PKEY := @_EVP_PKCS82PKEY; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKCS82PKEY_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKCS82PKEY'); + {$ifend} + end; + + + EVP_PKEY2PKCS8 := LoadLibFunction(ADllHandle, EVP_PKEY2PKCS8_procname); + FuncLoadError := not assigned(EVP_PKEY2PKCS8); + if FuncLoadError then + begin + {$if not defined(EVP_PKEY2PKCS8_allownil)} + EVP_PKEY2PKCS8 := @ERR_EVP_PKEY2PKCS8; + {$ifend} + {$if declared(EVP_PKEY2PKCS8_introduced)} + if LibVersion < EVP_PKEY2PKCS8_introduced then + begin + {$if declared(FC_EVP_PKEY2PKCS8)} + EVP_PKEY2PKCS8 := @FC_EVP_PKEY2PKCS8; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(EVP_PKEY2PKCS8_removed)} + if EVP_PKEY2PKCS8_removed <= LibVersion then + begin + {$if declared(_EVP_PKEY2PKCS8)} + EVP_PKEY2PKCS8 := @_EVP_PKEY2PKCS8; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(EVP_PKEY2PKCS8_allownil)} + if FuncLoadError then + AFailed.Add('EVP_PKEY2PKCS8'); + {$ifend} + end; + + + PKCS8_pkey_set0 := LoadLibFunction(ADllHandle, PKCS8_pkey_set0_procname); + FuncLoadError := not assigned(PKCS8_pkey_set0); + if FuncLoadError then + begin + {$if not defined(PKCS8_pkey_set0_allownil)} + PKCS8_pkey_set0 := @ERR_PKCS8_pkey_set0; + {$ifend} + {$if declared(PKCS8_pkey_set0_introduced)} + if LibVersion < PKCS8_pkey_set0_introduced then + begin + {$if declared(FC_PKCS8_pkey_set0)} + PKCS8_pkey_set0 := @FC_PKCS8_pkey_set0; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS8_pkey_set0_removed)} + if PKCS8_pkey_set0_removed <= LibVersion then + begin + {$if declared(_PKCS8_pkey_set0)} + PKCS8_pkey_set0 := @_PKCS8_pkey_set0; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS8_pkey_set0_allownil)} + if FuncLoadError then + AFailed.Add('PKCS8_pkey_set0'); + {$ifend} + end; + + + PKCS8_pkey_get0 := LoadLibFunction(ADllHandle, PKCS8_pkey_get0_procname); + FuncLoadError := not assigned(PKCS8_pkey_get0); + if FuncLoadError then + begin + {$if not defined(PKCS8_pkey_get0_allownil)} + PKCS8_pkey_get0 := @ERR_PKCS8_pkey_get0; + {$ifend} + {$if declared(PKCS8_pkey_get0_introduced)} + if LibVersion < PKCS8_pkey_get0_introduced then + begin + {$if declared(FC_PKCS8_pkey_get0)} + PKCS8_pkey_get0 := @FC_PKCS8_pkey_get0; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS8_pkey_get0_removed)} + if PKCS8_pkey_get0_removed <= LibVersion then + begin + {$if declared(_PKCS8_pkey_get0)} + PKCS8_pkey_get0 := @_PKCS8_pkey_get0; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS8_pkey_get0_allownil)} + if FuncLoadError then + AFailed.Add('PKCS8_pkey_get0'); + {$ifend} + end; + + + PKCS8_pkey_add1_attr_by_NID := LoadLibFunction(ADllHandle, PKCS8_pkey_add1_attr_by_NID_procname); + FuncLoadError := not assigned(PKCS8_pkey_add1_attr_by_NID); + if FuncLoadError then + begin + {$if not defined(PKCS8_pkey_add1_attr_by_NID_allownil)} + PKCS8_pkey_add1_attr_by_NID := @ERR_PKCS8_pkey_add1_attr_by_NID; + {$ifend} + {$if declared(PKCS8_pkey_add1_attr_by_NID_introduced)} + if LibVersion < PKCS8_pkey_add1_attr_by_NID_introduced then + begin + {$if declared(FC_PKCS8_pkey_add1_attr_by_NID)} + PKCS8_pkey_add1_attr_by_NID := @FC_PKCS8_pkey_add1_attr_by_NID; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PKCS8_pkey_add1_attr_by_NID_removed)} + if PKCS8_pkey_add1_attr_by_NID_removed <= LibVersion then + begin + {$if declared(_PKCS8_pkey_add1_attr_by_NID)} + PKCS8_pkey_add1_attr_by_NID := @_PKCS8_pkey_add1_attr_by_NID; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PKCS8_pkey_add1_attr_by_NID_allownil)} + if FuncLoadError then + AFailed.Add('PKCS8_pkey_add1_attr_by_NID'); + {$ifend} + end; + + {introduced 1.1.0} + X509_PUBKEY_set0_param := LoadLibFunction(ADllHandle, X509_PUBKEY_set0_param_procname); + FuncLoadError := not assigned(X509_PUBKEY_set0_param); + if FuncLoadError then + begin + {$if not defined(X509_PUBKEY_set0_param_allownil)} + X509_PUBKEY_set0_param := @ERR_X509_PUBKEY_set0_param; + {$ifend} + {$if declared(X509_PUBKEY_set0_param_introduced)} + if LibVersion < X509_PUBKEY_set0_param_introduced then + begin + {$if declared(FC_X509_PUBKEY_set0_param)} + X509_PUBKEY_set0_param := @FC_X509_PUBKEY_set0_param; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_PUBKEY_set0_param_removed)} + if X509_PUBKEY_set0_param_removed <= LibVersion then + begin + {$if declared(_X509_PUBKEY_set0_param)} + X509_PUBKEY_set0_param := @_X509_PUBKEY_set0_param; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_PUBKEY_set0_param_allownil)} + if FuncLoadError then + AFailed.Add('X509_PUBKEY_set0_param'); + {$ifend} + end; + + + X509_PUBKEY_get0_param := LoadLibFunction(ADllHandle, X509_PUBKEY_get0_param_procname); + FuncLoadError := not assigned(X509_PUBKEY_get0_param); + if FuncLoadError then + begin + {$if not defined(X509_PUBKEY_get0_param_allownil)} + X509_PUBKEY_get0_param := @ERR_X509_PUBKEY_get0_param; + {$ifend} + {$if declared(X509_PUBKEY_get0_param_introduced)} + if LibVersion < X509_PUBKEY_get0_param_introduced then + begin + {$if declared(FC_X509_PUBKEY_get0_param)} + X509_PUBKEY_get0_param := @FC_X509_PUBKEY_get0_param; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_PUBKEY_get0_param_removed)} + if X509_PUBKEY_get0_param_removed <= LibVersion then + begin + {$if declared(_X509_PUBKEY_get0_param)} + X509_PUBKEY_get0_param := @_X509_PUBKEY_get0_param; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_PUBKEY_get0_param_allownil)} + if FuncLoadError then + AFailed.Add('X509_PUBKEY_get0_param'); + {$ifend} + end; + + + X509_check_trust := LoadLibFunction(ADllHandle, X509_check_trust_procname); + FuncLoadError := not assigned(X509_check_trust); + if FuncLoadError then + begin + {$if not defined(X509_check_trust_allownil)} + X509_check_trust := @ERR_X509_check_trust; + {$ifend} + {$if declared(X509_check_trust_introduced)} + if LibVersion < X509_check_trust_introduced then + begin + {$if declared(FC_X509_check_trust)} + X509_check_trust := @FC_X509_check_trust; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_check_trust_removed)} + if X509_check_trust_removed <= LibVersion then + begin + {$if declared(_X509_check_trust)} + X509_check_trust := @_X509_check_trust; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_check_trust_allownil)} + if FuncLoadError then + AFailed.Add('X509_check_trust'); + {$ifend} + end; + + + X509_TRUST_get_count := LoadLibFunction(ADllHandle, X509_TRUST_get_count_procname); + FuncLoadError := not assigned(X509_TRUST_get_count); + if FuncLoadError then + begin + {$if not defined(X509_TRUST_get_count_allownil)} + X509_TRUST_get_count := @ERR_X509_TRUST_get_count; + {$ifend} + {$if declared(X509_TRUST_get_count_introduced)} + if LibVersion < X509_TRUST_get_count_introduced then + begin + {$if declared(FC_X509_TRUST_get_count)} + X509_TRUST_get_count := @FC_X509_TRUST_get_count; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_TRUST_get_count_removed)} + if X509_TRUST_get_count_removed <= LibVersion then + begin + {$if declared(_X509_TRUST_get_count)} + X509_TRUST_get_count := @_X509_TRUST_get_count; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_TRUST_get_count_allownil)} + if FuncLoadError then + AFailed.Add('X509_TRUST_get_count'); + {$ifend} + end; + + + X509_TRUST_get0 := LoadLibFunction(ADllHandle, X509_TRUST_get0_procname); + FuncLoadError := not assigned(X509_TRUST_get0); + if FuncLoadError then + begin + {$if not defined(X509_TRUST_get0_allownil)} + X509_TRUST_get0 := @ERR_X509_TRUST_get0; + {$ifend} + {$if declared(X509_TRUST_get0_introduced)} + if LibVersion < X509_TRUST_get0_introduced then + begin + {$if declared(FC_X509_TRUST_get0)} + X509_TRUST_get0 := @FC_X509_TRUST_get0; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_TRUST_get0_removed)} + if X509_TRUST_get0_removed <= LibVersion then + begin + {$if declared(_X509_TRUST_get0)} + X509_TRUST_get0 := @_X509_TRUST_get0; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_TRUST_get0_allownil)} + if FuncLoadError then + AFailed.Add('X509_TRUST_get0'); + {$ifend} + end; + + + X509_TRUST_get_by_id := LoadLibFunction(ADllHandle, X509_TRUST_get_by_id_procname); + FuncLoadError := not assigned(X509_TRUST_get_by_id); + if FuncLoadError then + begin + {$if not defined(X509_TRUST_get_by_id_allownil)} + X509_TRUST_get_by_id := @ERR_X509_TRUST_get_by_id; + {$ifend} + {$if declared(X509_TRUST_get_by_id_introduced)} + if LibVersion < X509_TRUST_get_by_id_introduced then + begin + {$if declared(FC_X509_TRUST_get_by_id)} + X509_TRUST_get_by_id := @FC_X509_TRUST_get_by_id; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_TRUST_get_by_id_removed)} + if X509_TRUST_get_by_id_removed <= LibVersion then + begin + {$if declared(_X509_TRUST_get_by_id)} + X509_TRUST_get_by_id := @_X509_TRUST_get_by_id; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_TRUST_get_by_id_allownil)} + if FuncLoadError then + AFailed.Add('X509_TRUST_get_by_id'); + {$ifend} + end; + + + X509_TRUST_cleanup := LoadLibFunction(ADllHandle, X509_TRUST_cleanup_procname); + FuncLoadError := not assigned(X509_TRUST_cleanup); + if FuncLoadError then + begin + {$if not defined(X509_TRUST_cleanup_allownil)} + X509_TRUST_cleanup := @ERR_X509_TRUST_cleanup; + {$ifend} + {$if declared(X509_TRUST_cleanup_introduced)} + if LibVersion < X509_TRUST_cleanup_introduced then + begin + {$if declared(FC_X509_TRUST_cleanup)} + X509_TRUST_cleanup := @FC_X509_TRUST_cleanup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_TRUST_cleanup_removed)} + if X509_TRUST_cleanup_removed <= LibVersion then + begin + {$if declared(_X509_TRUST_cleanup)} + X509_TRUST_cleanup := @_X509_TRUST_cleanup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_TRUST_cleanup_allownil)} + if FuncLoadError then + AFailed.Add('X509_TRUST_cleanup'); + {$ifend} + end; + + + X509_TRUST_get_flags := LoadLibFunction(ADllHandle, X509_TRUST_get_flags_procname); + FuncLoadError := not assigned(X509_TRUST_get_flags); + if FuncLoadError then + begin + {$if not defined(X509_TRUST_get_flags_allownil)} + X509_TRUST_get_flags := @ERR_X509_TRUST_get_flags; + {$ifend} + {$if declared(X509_TRUST_get_flags_introduced)} + if LibVersion < X509_TRUST_get_flags_introduced then + begin + {$if declared(FC_X509_TRUST_get_flags)} + X509_TRUST_get_flags := @FC_X509_TRUST_get_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_TRUST_get_flags_removed)} + if X509_TRUST_get_flags_removed <= LibVersion then + begin + {$if declared(_X509_TRUST_get_flags)} + X509_TRUST_get_flags := @_X509_TRUST_get_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_TRUST_get_flags_allownil)} + if FuncLoadError then + AFailed.Add('X509_TRUST_get_flags'); + {$ifend} + end; + + + X509_TRUST_get0_name := LoadLibFunction(ADllHandle, X509_TRUST_get0_name_procname); + FuncLoadError := not assigned(X509_TRUST_get0_name); + if FuncLoadError then + begin + {$if not defined(X509_TRUST_get0_name_allownil)} + X509_TRUST_get0_name := @ERR_X509_TRUST_get0_name; + {$ifend} + {$if declared(X509_TRUST_get0_name_introduced)} + if LibVersion < X509_TRUST_get0_name_introduced then + begin + {$if declared(FC_X509_TRUST_get0_name)} + X509_TRUST_get0_name := @FC_X509_TRUST_get0_name; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_TRUST_get0_name_removed)} + if X509_TRUST_get0_name_removed <= LibVersion then + begin + {$if declared(_X509_TRUST_get0_name)} + X509_TRUST_get0_name := @_X509_TRUST_get0_name; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_TRUST_get0_name_allownil)} + if FuncLoadError then + AFailed.Add('X509_TRUST_get0_name'); + {$ifend} + end; + + + X509_TRUST_get_trust := LoadLibFunction(ADllHandle, X509_TRUST_get_trust_procname); + FuncLoadError := not assigned(X509_TRUST_get_trust); + if FuncLoadError then + begin + {$if not defined(X509_TRUST_get_trust_allownil)} + X509_TRUST_get_trust := @ERR_X509_TRUST_get_trust; + {$ifend} + {$if declared(X509_TRUST_get_trust_introduced)} + if LibVersion < X509_TRUST_get_trust_introduced then + begin + {$if declared(FC_X509_TRUST_get_trust)} + X509_TRUST_get_trust := @FC_X509_TRUST_get_trust; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_TRUST_get_trust_removed)} + if X509_TRUST_get_trust_removed <= LibVersion then + begin + {$if declared(_X509_TRUST_get_trust)} + X509_TRUST_get_trust := @_X509_TRUST_get_trust; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_TRUST_get_trust_allownil)} + if FuncLoadError then + AFailed.Add('X509_TRUST_get_trust'); + {$ifend} + end; + + + X509_NAME_hash_ex := LoadLibFunction(ADllHandle, X509_NAME_hash_ex_procname); + FuncLoadError := not assigned(X509_NAME_hash_ex); + if FuncLoadError then + begin + {$if not defined(X509_NAME_hash_ex_allownil)} + X509_NAME_hash_ex := @ERR_X509_NAME_hash_ex; + {$ifend} + {$if declared(X509_NAME_hash_ex_introduced)} + if LibVersion < X509_NAME_hash_ex_introduced then + begin + {$if declared(FC_X509_NAME_hash_ex)} + X509_NAME_hash_ex := @FC_X509_NAME_hash_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_NAME_hash_ex_removed)} + if X509_NAME_hash_ex_removed <= LibVersion then + begin + {$if declared(_X509_NAME_hash_ex)} + X509_NAME_hash_ex := @_X509_NAME_hash_ex; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_NAME_hash_ex_allownil)} + if FuncLoadError then + AFailed.Add('X509_NAME_hash_ex'); + {$ifend} + end; + + {introduced 3.0.0} +end; + +procedure Unload; +begin + X509_CRL_set_default_method := nil; + X509_CRL_METHOD_free := nil; + X509_CRL_set_meth_data := nil; + X509_CRL_get_meth_data := nil; + X509_verify_cert_error_string := nil; + X509_verify := nil; + X509_REQ_verify := nil; + X509_CRL_verify := nil; + NETSCAPE_SPKI_verify := nil; + NETSCAPE_SPKI_b64_decode := nil; + NETSCAPE_SPKI_b64_encode := nil; + NETSCAPE_SPKI_get_pubkey := nil; + NETSCAPE_SPKI_set_pubkey := nil; + NETSCAPE_SPKI_print := nil; + X509_signature_dump := nil; + X509_signature_print := nil; + X509_sign := nil; + X509_sign_ctx := nil; + X509_http_nbio := nil; {removed 3.0.0} + X509_REQ_sign := nil; + X509_REQ_sign_ctx := nil; + X509_CRL_sign := nil; + X509_CRL_sign_ctx := nil; + X509_CRL_http_nbio := nil; {removed 3.0.0} + NETSCAPE_SPKI_sign := nil; + X509_pubkey_digest := nil; + X509_digest := nil; + X509_CRL_digest := nil; + X509_REQ_digest := nil; + X509_NAME_digest := nil; + d2i_X509_bio := nil; + i2d_X509_bio := nil; + d2i_X509_CRL_bio := nil; + i2d_X509_CRL_bio := nil; + d2i_X509_REQ_bio := nil; + i2d_X509_REQ_bio := nil; + d2i_RSAPrivateKey_bio := nil; + i2d_RSAPrivateKey_bio := nil; + d2i_RSAPublicKey_bio := nil; + i2d_RSAPublicKey_bio := nil; + d2i_RSA_PUBKEY_bio := nil; + i2d_RSA_PUBKEY_bio := nil; + d2i_DSA_PUBKEY_bio := nil; + i2d_DSA_PUBKEY_bio := nil; + d2i_DSAPrivateKey_bio := nil; + i2d_DSAPrivateKey_bio := nil; + d2i_EC_PUBKEY_bio := nil; + i2d_EC_PUBKEY_bio := nil; + d2i_ECPrivateKey_bio := nil; + i2d_ECPrivateKey_bio := nil; + d2i_PKCS8_bio := nil; + i2d_PKCS8_bio := nil; + d2i_PKCS8_PRIV_KEY_INFO_bio := nil; + i2d_PKCS8_PRIV_KEY_INFO_bio := nil; + i2d_PKCS8PrivateKeyInfo_bio := nil; + i2d_PrivateKey_bio := nil; + d2i_PrivateKey_bio := nil; + i2d_PUBKEY_bio := nil; + d2i_PUBKEY_bio := nil; + X509_dup := nil; + X509_ATTRIBUTE_dup := nil; + X509_EXTENSION_dup := nil; + X509_CRL_dup := nil; + X509_REVOKED_dup := nil; + X509_REQ_dup := nil; + X509_ALGOR_dup := nil; + X509_ALGOR_set0 := nil; + X509_ALGOR_get0 := nil; + X509_ALGOR_set_md := nil; + X509_ALGOR_cmp := nil; + X509_NAME_dup := nil; + X509_NAME_ENTRY_dup := nil; + X509_cmp_time := nil; + X509_cmp_current_time := nil; + X509_time_adj := nil; + X509_time_adj_ex := nil; + X509_gmtime_adj := nil; + X509_get_default_cert_area := nil; + X509_get_default_cert_dir := nil; + X509_get_default_cert_file := nil; + X509_get_default_cert_dir_env := nil; + X509_get_default_cert_file_env := nil; + X509_get_default_private_dir := nil; + X509_to_X509_REQ := nil; + X509_REQ_to_X509 := nil; + X509_ALGOR_new := nil; + X509_ALGOR_free := nil; + d2i_X509_ALGOR := nil; + i2d_X509_ALGOR := nil; + X509_VAL_new := nil; + X509_VAL_free := nil; + d2i_X509_VAL := nil; + i2d_X509_VAL := nil; + X509_PUBKEY_new := nil; + X509_PUBKEY_free := nil; + d2i_X509_PUBKEY := nil; + i2d_X509_PUBKEY := nil; + X509_PUBKEY_set := nil; + X509_PUBKEY_get0 := nil; {introduced 1.1.0} + X509_PUBKEY_get := nil; + X509_get_pathlen := nil; {introduced 1.1.0} + i2d_PUBKEY := nil; + d2i_PUBKEY := nil; + i2d_RSA_PUBKEY := nil; + d2i_RSA_PUBKEY := nil; + i2d_DSA_PUBKEY := nil; + d2i_DSA_PUBKEY := nil; + i2d_EC_PUBKEY := nil; + d2i_EC_PUBKEY := nil; + X509_SIG_new := nil; + X509_SIG_free := nil; + d2i_X509_SIG := nil; + i2d_X509_SIG := nil; + X509_SIG_get0 := nil; {introduced 1.1.0} + X509_SIG_getm := nil; {introduced 1.1.0} + X509_REQ_INFO_new := nil; + X509_REQ_INFO_free := nil; + d2i_X509_REQ_INFO := nil; + i2d_X509_REQ_INFO := nil; + X509_REQ_new := nil; + X509_REQ_free := nil; + d2i_X509_REQ := nil; + i2d_X509_REQ := nil; + X509_ATTRIBUTE_new := nil; + X509_ATTRIBUTE_free := nil; + d2i_X509_ATTRIBUTE := nil; + i2d_X509_ATTRIBUTE := nil; + X509_ATTRIBUTE_create := nil; + X509_EXTENSION_new := nil; + X509_EXTENSION_free := nil; + d2i_X509_EXTENSION := nil; + i2d_X509_EXTENSION := nil; + X509_NAME_ENTRY_new := nil; + X509_NAME_ENTRY_free := nil; + d2i_X509_NAME_ENTRY := nil; + i2d_X509_NAME_ENTRY := nil; + X509_NAME_new := nil; + X509_NAME_free := nil; + d2i_X509_NAME := nil; + i2d_X509_NAME := nil; + X509_NAME_set := nil; + X509_new := nil; + X509_free := nil; + d2i_X509 := nil; + i2d_X509 := nil; + X509_set_ex_data := nil; + X509_get_ex_data := nil; + i2d_X509_AUX := nil; + d2i_X509_AUX := nil; + i2d_re_X509_tbs := nil; + X509_SIG_INFO_get := nil; {introduced 1.1.0} + X509_SIG_INFO_set := nil; {introduced 1.1.0} + X509_get_signature_info := nil; {introduced 1.1.0} + X509_get0_signature := nil; {introduced 1.1.0} + X509_get_signature_nid := nil; + X509_trusted := nil; {introduced 1.1.0} + X509_alias_set1 := nil; + X509_keyid_set1 := nil; + X509_alias_get0 := nil; + X509_keyid_get0 := nil; + X509_TRUST_set := nil; + X509_add1_trust_object := nil; + X509_add1_reject_object := nil; + X509_trust_clear := nil; + X509_reject_clear := nil; + X509_REVOKED_new := nil; + X509_REVOKED_free := nil; + d2i_X509_REVOKED := nil; + i2d_X509_REVOKED := nil; + X509_CRL_INFO_new := nil; + X509_CRL_INFO_free := nil; + d2i_X509_CRL_INFO := nil; + i2d_X509_CRL_INFO := nil; + X509_CRL_new := nil; + X509_CRL_free := nil; + d2i_X509_CRL := nil; + i2d_X509_CRL := nil; + X509_CRL_add0_revoked := nil; + X509_CRL_get0_by_serial := nil; + X509_CRL_get0_by_cert := nil; + X509_PKEY_new := nil; + X509_PKEY_free := nil; + X509_INFO_new := nil; + X509_INFO_free := nil; + X509_NAME_oneline := nil; + ASN1_item_digest := nil; + ASN1_item_verify := nil; + ASN1_item_sign := nil; + ASN1_item_sign_ctx := nil; + X509_get_version := nil; {introduced 1.1.0} + X509_set_version := nil; + X509_set_serialNumber := nil; + X509_get_serialNumber := nil; + X509_get0_serialNumber := nil; {introduced 1.1.0} + X509_set_issuer_name := nil; + X509_get_issuer_name := nil; + X509_set_subject_name := nil; + X509_get_subject_name := nil; + X509_get0_notBefore := nil; {introduced 1.1.0} + X509_getm_notBefore := nil; {introduced 1.1.0} + X509_set1_notBefore := nil; {introduced 1.1.0} + X509_get0_notAfter := nil; {introduced 1.1.0} + X509_getm_notAfter := nil; {introduced 1.1.0} + X509_set1_notAfter := nil; {introduced 1.1.0} + X509_set_pubkey := nil; + X509_up_ref := nil; {introduced 1.1.0} + X509_get_signature_type := nil; {introduced 1.1.0} + X509_get_X509_PUBKEY := nil; {introduced 1.1.0} + X509_get0_uids := nil; {introduced 1.1.0} + X509_get0_tbs_sigalg := nil; {introduced 1.1.0} + X509_get0_pubkey := nil; {introduced 1.1.0} + X509_get_pubkey := nil; + X509_get0_pubkey_bitstr := nil; + X509_certificate_type := nil; + X509_REQ_get_version := nil; {introduced 1.1.0} + X509_REQ_set_version := nil; + X509_REQ_get_subject_name := nil; {introduced 1.1.0} + X509_REQ_set_subject_name := nil; + X509_REQ_get0_signature := nil; {introduced 1.1.0} + X509_REQ_get_signature_nid := nil; {introduced 1.1.0} + i2d_re_X509_REQ_tbs := nil; {introduced 1.1.0} + X509_REQ_set_pubkey := nil; + X509_REQ_get_pubkey := nil; + X509_REQ_get0_pubkey := nil; {introduced 1.1.0} + X509_REQ_get_X509_PUBKEY := nil; {introduced 1.1.0} + X509_REQ_extension_nid := nil; + X509_REQ_get_extension_nids := nil; + X509_REQ_set_extension_nids := nil; + X509_REQ_get_attr_count := nil; + X509_REQ_get_attr_by_NID := nil; + X509_REQ_get_attr_by_OBJ := nil; + X509_REQ_get_attr := nil; + X509_REQ_delete_attr := nil; + X509_REQ_add1_attr := nil; + X509_REQ_add1_attr_by_OBJ := nil; + X509_REQ_add1_attr_by_NID := nil; + X509_REQ_add1_attr_by_txt := nil; + X509_CRL_set_version := nil; + X509_CRL_set_issuer_name := nil; + X509_CRL_set1_lastUpdate := nil; {introduced 1.1.0} + X509_CRL_set1_nextUpdate := nil; {introduced 1.1.0} + X509_CRL_sort := nil; + X509_CRL_up_ref := nil; {introduced 1.1.0} + X509_CRL_get_version := nil; {introduced 1.1.0} + X509_CRL_get0_lastUpdate := nil; {introduced 1.1.0} + X509_CRL_get0_nextUpdate := nil; {introduced 1.1.0} + X509_CRL_get_issuer := nil; {introduced 1.1.0} + X509_CRL_get0_signature := nil; {introduced 1.1.0} + X509_CRL_get_signature_nid := nil; {introduced 1.1.0} + i2d_re_X509_CRL_tbs := nil; {introduced 1.1.0} + X509_REVOKED_get0_serialNumber := nil; {introduced 1.1.0} + X509_REVOKED_set_serialNumber := nil; + X509_REVOKED_get0_revocationDate := nil; {introduced 1.1.0} + X509_REVOKED_set_revocationDate := nil; + X509_CRL_diff := nil; + X509_REQ_check_private_key := nil; + X509_check_private_key := nil; + X509_CRL_check_suiteb := nil; + X509_issuer_and_serial_cmp := nil; + X509_issuer_and_serial_hash := nil; + X509_issuer_name_cmp := nil; + X509_issuer_name_hash := nil; + X509_subject_name_cmp := nil; + X509_subject_name_hash := nil; + X509_cmp := nil; + X509_NAME_cmp := nil; + X509_NAME_hash := nil; {removed 3.0.0} + X509_NAME_hash_old := nil; + X509_CRL_cmp := nil; + X509_CRL_match := nil; + X509_aux_print := nil; {introduced 1.1.0} + X509_NAME_print := nil; + X509_NAME_print_ex := nil; + X509_print_ex := nil; + X509_print := nil; + X509_ocspid_print := nil; + X509_CRL_print_ex := nil; {introduced 1.1.0} + X509_CRL_print := nil; + X509_REQ_print_ex := nil; + X509_REQ_print := nil; + X509_NAME_entry_count := nil; + X509_NAME_get_text_by_NID := nil; + X509_NAME_get_text_by_OBJ := nil; + X509_NAME_get_index_by_NID := nil; + X509_NAME_get_index_by_OBJ := nil; + X509_NAME_get_entry := nil; + X509_NAME_delete_entry := nil; + X509_NAME_add_entry := nil; + X509_NAME_add_entry_by_OBJ := nil; + X509_NAME_add_entry_by_NID := nil; + X509_NAME_ENTRY_create_by_txt := nil; + X509_NAME_ENTRY_create_by_NID := nil; + X509_NAME_add_entry_by_txt := nil; + X509_NAME_ENTRY_create_by_OBJ := nil; + X509_NAME_ENTRY_set_object := nil; + X509_NAME_ENTRY_set_data := nil; + X509_NAME_ENTRY_get_object := nil; + X509_NAME_ENTRY_get_data := nil; + X509_NAME_ENTRY_set := nil; {introduced 1.1.0} + X509_NAME_get0_der := nil; {introduced 1.1.0} + X509_get_ext_count := nil; + X509_get_ext_by_NID := nil; + X509_get_ext_by_OBJ := nil; + X509_get_ext_by_critical := nil; + X509_get_ext := nil; + X509_delete_ext := nil; + X509_add_ext := nil; + X509_get_ext_d2i := nil; + X509_add1_ext_i2d := nil; + X509_CRL_get_ext_count := nil; + X509_CRL_get_ext_by_NID := nil; + X509_CRL_get_ext_by_OBJ := nil; + X509_CRL_get_ext_by_critical := nil; + X509_CRL_get_ext := nil; + X509_CRL_delete_ext := nil; + X509_CRL_add_ext := nil; + X509_CRL_get_ext_d2i := nil; + X509_CRL_add1_ext_i2d := nil; + X509_REVOKED_get_ext_count := nil; + X509_REVOKED_get_ext_by_NID := nil; + X509_REVOKED_get_ext_by_OBJ := nil; + X509_REVOKED_get_ext_by_critical := nil; + X509_REVOKED_get_ext := nil; + X509_REVOKED_delete_ext := nil; + X509_REVOKED_add_ext := nil; + X509_REVOKED_get_ext_d2i := nil; + X509_REVOKED_add1_ext_i2d := nil; + X509_EXTENSION_create_by_NID := nil; + X509_EXTENSION_create_by_OBJ := nil; + X509_EXTENSION_set_object := nil; + X509_EXTENSION_set_critical := nil; + X509_EXTENSION_set_data := nil; + X509_EXTENSION_get_object := nil; + X509_EXTENSION_get_data := nil; + X509_EXTENSION_get_critical := nil; + X509_ATTRIBUTE_create_by_NID := nil; + X509_ATTRIBUTE_create_by_OBJ := nil; + X509_ATTRIBUTE_create_by_txt := nil; + X509_ATTRIBUTE_set1_object := nil; + X509_ATTRIBUTE_set1_data := nil; + X509_ATTRIBUTE_get0_data := nil; + X509_ATTRIBUTE_count := nil; + X509_ATTRIBUTE_get0_object := nil; + X509_ATTRIBUTE_get0_type := nil; + EVP_PKEY_get_attr_count := nil; + EVP_PKEY_get_attr_by_NID := nil; + EVP_PKEY_get_attr_by_OBJ := nil; + EVP_PKEY_get_attr := nil; + EVP_PKEY_delete_attr := nil; + EVP_PKEY_add1_attr := nil; + EVP_PKEY_add1_attr_by_OBJ := nil; + EVP_PKEY_add1_attr_by_NID := nil; + EVP_PKEY_add1_attr_by_txt := nil; + X509_verify_cert := nil; + PKCS5_pbe_set0_algor := nil; + PKCS5_pbe_set := nil; + PKCS5_pbe2_set := nil; + PKCS5_pbe2_set_iv := nil; + PKCS5_pbe2_set_scrypt := nil; {introduced 1.1.0} + PKCS5_pbkdf2_set := nil; + EVP_PKCS82PKEY := nil; + EVP_PKEY2PKCS8 := nil; + PKCS8_pkey_set0 := nil; + PKCS8_pkey_get0 := nil; + PKCS8_pkey_add1_attr_by_NID := nil; {introduced 1.1.0} + X509_PUBKEY_set0_param := nil; + X509_PUBKEY_get0_param := nil; + X509_check_trust := nil; + X509_TRUST_get_count := nil; + X509_TRUST_get0 := nil; + X509_TRUST_get_by_id := nil; + X509_TRUST_cleanup := nil; + X509_TRUST_get_flags := nil; + X509_TRUST_get0_name := nil; + X509_TRUST_get_trust := nil; + X509_NAME_hash_ex := nil; {introduced 3.0.0} +end; +{$ELSE} +function X509_NAME_hash(x: PX509_NAME): TIdC_ULONG; +begin + Result := X509_NAME_hash_ex(x,nil,nil,nil); +end; + + + + + +{$ENDIF} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +initialization + Register_SSLLoader(@Load,'LibCrypto'); + Register_SSLUnloader(@Unload); +{$ENDIF} +end. diff --git a/IdOpenSSLHeaders_x509_vfy.pas b/IdOpenSSLHeaders_x509_vfy.pas new file mode 100644 index 0000000..40ed298 --- /dev/null +++ b/IdOpenSSLHeaders_x509_vfy.pas @@ -0,0 +1,7840 @@ + (* This unit was generated using the script genOpenSSLHdrs.sh from the source file IdOpenSSLHeaders_x509_vfy.h2pas + It should not be modified directly. All changes should be made to IdOpenSSLHeaders_x509_vfy.h2pas + and this file regenerated. IdOpenSSLHeaders_x509_vfy.h2pas is distributed with the full Indy + Distribution. + *) + +{$i IdCompilerDefines.inc} +{$i IdSSLOpenSSLDefines.inc} +{$IFNDEF USE_OPENSSL} + { error Should not compile if USE_OPENSSL is not defined!!!} +{$ENDIF} +{******************************************************************************} +{ } +{ Indy (Internet Direct) - Internet Protocols Simplified } +{ } +{ https://www.indyproject.org/ } +{ https://gitter.im/IndySockets/Indy } +{ } +{******************************************************************************} +{ } +{ This file is part of the Indy (Internet Direct) project, and is offered } +{ under the dual-licensing agreement described on the Indy website. } +{ (https://www.indyproject.org/license/) } +{ } +{ Copyright: } +{ (c) 1993-2020, Chad Z. Hower and the Indy Pit Crew. All rights reserved. } +{ } +{******************************************************************************} +{ } +{ } +{******************************************************************************} + +unit IdOpenSSLHeaders_x509_vfy; + +interface + +// Headers for OpenSSL 1.1.1 +// x509_vfy.h + + +{$MINENUMSIZE 4} + +uses + IdCTypes, + IdGlobal, + IdSSLOpenSSLConsts, + IdOpenSSLHeaders_ssl, + IdOpenSSLHeaders_ossl_typ; + +const + X509_L_FILE_LOAD = 1; + X509_L_ADD_DIR = 2; + + X509_V_OK = 0; + X509_V_ERR_UNSPECIFIED = 1; + X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT = 2; + X509_V_ERR_UNABLE_TO_GET_CRL = 3; + X509_V_ERR_UNABLE_TO_DECRYPT_CERT_SIGNATURE = 4; + X509_V_ERR_UNABLE_TO_DECRYPT_CRL_SIGNATURE = 5; + X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY = 6; + X509_V_ERR_CERT_SIGNATURE_FAILURE = 7; + X509_V_ERR_CRL_SIGNATURE_FAILURE = 8; + X509_V_ERR_CERT_NOT_YET_VALID = 9; + X509_V_ERR_CERT_HAS_EXPIRED = 10; + X509_V_ERR_CRL_NOT_YET_VALID = 11; + X509_V_ERR_CRL_HAS_EXPIRED = 12; + X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD = 13; + X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD = 14; + X509_V_ERR_ERROR_IN_CRL_LAST_UPDATE_FIELD = 15; + X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD = 16; + X509_V_ERR_OUT_OF_MEM = 17; + X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT = 18; + X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN = 19; + X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY = 20; + X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE = 21; + X509_V_ERR_CERT_CHAIN_TOO_LONG = 22; + X509_V_ERR_CERT_REVOKED = 23; + X509_V_ERR_INVALID_CA = 24; + X509_V_ERR_PATH_LENGTH_EXCEEDED = 25; + X509_V_ERR_INVALID_PURPOSE = 26; + X509_V_ERR_CERT_UNTRUSTED = 27; + X509_V_ERR_CERT_REJECTED = 28; + (* These are 'informational' when looking for issuer cert *) + X509_V_ERR_SUBJECT_ISSUER_MISMATCH = 29; + X509_V_ERR_AKID_SKID_MISMATCH = 30; + X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH = 31; + X509_V_ERR_KEYUSAGE_NO_CERTSIGN = 32; + X509_V_ERR_UNABLE_TO_GET_CRL_ISSUER = 33; + X509_V_ERR_UNHANDLED_CRITICAL_EXTENSION = 34; + X509_V_ERR_KEYUSAGE_NO_CRL_SIGN = 35; + X509_V_ERR_UNHANDLED_CRITICAL_CRL_EXTENSION = 36; + X509_V_ERR_INVALID_NON_CA = 37; + X509_V_ERR_PROXY_PATH_LENGTH_EXCEEDED = 38; + X509_V_ERR_KEYUSAGE_NO_DIGITAL_SIGNATURE = 39; + X509_V_ERR_PROXY_CERTIFICATES_NOT_ALLOWED = 40; + X509_V_ERR_INVALID_EXTENSION = 41; + X509_V_ERR_INVALID_POLICY_EXTENSION = 42; + X509_V_ERR_NO_EXPLICIT_POLICY = 43; + X509_V_ERR_DIFFERENT_CRL_SCOPE = 44; + X509_V_ERR_UNSUPPORTED_EXTENSION_FEATURE = 45; + X509_V_ERR_UNNESTED_RESOURCE = 46; + X509_V_ERR_PERMITTED_VIOLATION = 47; + X509_V_ERR_EXCLUDED_VIOLATION = 48; + X509_V_ERR_SUBTREE_MINMAX = 49; + (* The application is not happy *) + X509_V_ERR_APPLICATION_VERIFICATION = 50; + X509_V_ERR_UNSUPPORTED_CONSTRAINT_TYPE = 51; + X509_V_ERR_UNSUPPORTED_CONSTRAINT_SYNTAX = 52; + X509_V_ERR_UNSUPPORTED_NAME_SYNTAX = 53; + X509_V_ERR_CRL_PATH_VALIDATION_ERROR = 54; + (* Another issuer check debug option *) + X509_V_ERR_PATH_LOOP = 55; + (* Suite B mode algorithm violation *) + X509_V_ERR_SUITE_B_INVALID_VERSION = 56; + X509_V_ERR_SUITE_B_INVALID_ALGORITHM = 57; + X509_V_ERR_SUITE_B_INVALID_CURVE = 58; + X509_V_ERR_SUITE_B_INVALID_SIGNATURE_ALGORITHM = 59; + X509_V_ERR_SUITE_B_LOS_NOT_ALLOWED = 60; + X509_V_ERR_SUITE_B_CANNOT_SIGN_P_384_WITH_P_256 = 61; + (* Host, email and IP check errors *) + X509_V_ERR_HOSTNAME_MISMATCH = 62; + X509_V_ERR_EMAIL_MISMATCH = 63; + X509_V_ERR_IP_ADDRESS_MISMATCH = 64; + (* DANE TLSA errors *) + X509_V_ERR_DANE_NO_MATCH = 65; + (* security level errors *) + X509_V_ERR_EE_KEY_TOO_SMALL = 66; + X509_V_ERR_CA_KEY_TOO_SMALL = 67; + X509_V_ERR_CA_MD_TOO_WEAK = 68; + (* Caller error *) + X509_V_ERR_INVALID_CALL = 69; + (* Issuer lookup error *) + X509_V_ERR_STORE_LOOKUP = 70; + (* Certificate transparency *) + X509_V_ERR_NO_VALID_SCTS = 71; + + X509_V_ERR_PROXY_SUBJECT_NAME_VIOLATION = 72; + (* OCSP status errors *) + X509_V_ERR_OCSP_VERIFY_NEEDED = 73; (* Need OCSP verification *) + X509_V_ERR_OCSP_VERIFY_FAILED = 74; (* Couldn't verify cert through OCSP *) + X509_V_ERR_OCSP_CERT_UNKNOWN = 75; (* Certificate wasn't recognized by the OCSP responder *) + + (* Certificate verify flags *) + + (* Use check time instead of current time *) + X509_V_FLAG_USE_CHECK_TIME = $2; + (* Lookup CRLs *) + X509_V_FLAG_CRL_CHECK = $4; + (* Lookup CRLs for whole chain *) + X509_V_FLAG_CRL_CHECK_ALL = $8; + (* Ignore unhandled critical extensions *) + X509_V_FLAG_IGNORE_CRITICAL = $10; + (* Disable workarounds for broken certificates *) + X509_V_FLAG_X509_STRICT = $20; + (* Enable proxy certificate validation *) + X509_V_FLAG_ALLOW_PROXY_CERTS = $40; + (* Enable policy checking *) + X509_V_FLAG_POLICY_CHECK = $80; + (* Policy variable require-explicit-policy *) + X509_V_FLAG_EXPLICIT_POLICY = $100; + (* Policy variable inhibit-any-policy *) + X509_V_FLAG_INHIBIT_ANY = $200; + (* Policy variable inhibit-policy-mapping *) + X509_V_FLAG_INHIBIT_MAP = $400; + (* Notify callback that policy is OK *) + X509_V_FLAG_NOTIFY_POLICY = $800; + (* Extended CRL features such as indirect CRLs, alternate CRL signing keys *) + X509_V_FLAG_EXTENDED_CRL_SUPPORT = $1000; + (* Delta CRL support *) + X509_V_FLAG_USE_DELTAS = $2000; + (* Check self-signed CA signature *) + X509_V_FLAG_CHECK_SS_SIGNATURE = $4000; + (* Use trusted store first *) + X509_V_FLAG_TRUSTED_FIRST = $8000; + (* Suite B 128 bit only mode: not normally used *) + X509_V_FLAG_SUITEB_128_LOS_ONLY = $10000; + (* Suite B 192 bit only mode *) + X509_V_FLAG_SUITEB_192_LOS = $20000; + (* Suite B 128 bit mode allowing 192 bit algorithms *) + X509_V_FLAG_SUITEB_128_LOS = $30000; + (* Allow partial chains if at least one certificate is in trusted store *) + X509_V_FLAG_PARTIAL_CHAIN = $80000; + (* + * If the initial chain is not trusted, do not attempt to build an alternative + * chain. Alternate chain checking was introduced 1.1.0. Setting this flag + * will force the behaviour to match that of previous versions. + *) + X509_V_FLAG_NO_ALT_CHAINS = $100000; + (* Do not check certificate/CRL validity against current time *) + X509_V_FLAG_NO_CHECK_TIME = $200000; + + X509_VP_FLAG_DEFAULT = $1; + X509_VP_FLAG_OVERWRITE = $2; + X509_VP_FLAG_RESET_FLAGS = $4; + X509_VP_FLAG_LOCKED = $8; + X509_VP_FLAG_ONCE = $10; + + (* Internal use: mask of policy related options *) + X509_V_FLAG_POLICY_MASK = X509_V_FLAG_POLICY_CHECK or X509_V_FLAG_EXPLICIT_POLICY + or X509_V_FLAG_INHIBIT_ANY or X509_V_FLAG_INHIBIT_MAP; + + + DANE_FLAG_NO_DANE_EE_NAMECHECKS = TIdC_Long(1) shl 0; + + (* Non positive return values are errors *) + X509_PCY_TREE_FAILURE = -2; (* Failure to satisfy explicit policy *) + X509_PCY_TREE_INVALID = -1; (* Inconsistent or invalid extensions *) + X509_PCY_TREE_INTERNAL = 0; (* Internal error, most likely malloc *) + + (* + * Positive return values form a bit mask, all but the first are internal to + * the library and don't appear in results from X509_policy_check(). + *) + X509_PCY_TREE_VALID = 1; (* The policy tree is valid *) + X509_PCY_TREE_EMPTY = 2; (* The policy tree is empty *) + X509_PCY_TREE_EXPLICIT = 4; (* Explicit policy required *) + +type + (*- + SSL_CTX -> X509_STORE + -> X509_LOOKUP + ->X509_LOOKUP_METHOD + -> X509_LOOKUP + ->X509_LOOKUP_METHOD + + SSL -> X509_STORE_CTX + ->X509_STORE + + The X509_STORE holds the tables etc for verification stuff. + A X509_STORE_CTX is used while validating a single certificate. + The X509_STORE has X509_LOOKUPs for looking up certs. + The X509_STORE then calls a function to actually verify the + certificate chain. + *) + + X509_LOOKUP_TYPE = ( + X509_LU_NONE = 0, + X509_LU_X509, + X509_LU_CRL + ); + + X509_STORE_CTX_verify_cb = function(v1: TIdC_INT; v2: PX509_STORE_CTX): TIdC_INT; + X509_STORE_CTX_verify_fn = function(v1: PX509_STORE_CTX): TIdC_INT; + X509_STORE_CTX_get_issuer_fn = function(issuer: PPX509; ctx: PX509_STORE_CTX; x: PX509): TIdC_INT; + X509_STORE_CTX_check_issued_fn = function(ctx: PX509_STORE_CTX; x: PX509; issuer: PX509): TIdC_INT; + X509_STORE_CTX_check_revocation_fn = function(ctx: PX509_STORE_CTX): TIdC_INT; + X509_STORE_CTX_get_crl_fn = function(ctx: PX509_STORE_CTX; crl: PPX509_CRL; x: PX509): TIdC_INT; + X509_STORE_CTX_check_crl_fn = function(ctx: PX509_STORE_CTX; crl: PX509_CRL): TIdC_INT; + X509_STORE_CTX_cert_crl_fn = function(ctx: PX509_STORE_CTX; crl: PX509_CRL; x: PX509): TIdC_INT; + X509_STORE_CTX_check_policy_fn = function(ctx: PX509_STORE_CTX): TIdC_INT; +// typedef STACK_OF(X509) *(*X509_STORE_CTX_lookup_certs_fn)(X509_STORE_CTX *ctx, +// X509_NAME *nm); +// typedef STACK_OF(X509_CRL) *(*X509_STORE_CTX_lookup_crls_fn)(X509_STORE_CTX *ctx, +// X509_NAME *nm); + X509_STORE_CTX_cleanup_fn = function(ctx: PX509_STORE_CTX): TIdC_INT; + + X509_LOOKUP_ctrl_fn = function(ctx: PX509_LOOKUP; cmd: TIdC_INT; + const argc: PIdAnsiChar; argl: TIdC_LONG; ret: PPIdAnsiChar): TIdC_INT; cdecl; + X509_LOOKUP_get_by_subject_fn = function(ctx: PX509_LOOKUP; + type_: X509_LOOKUP_TYPE; name: PX509_NAME; ret: PX509_OBJECT): TIdC_INT; cdecl; + X509_LOOKUP_get_by_issuer_serial_fn = function(ctx: PX509_LOOKUP; + type_: X509_LOOKUP_TYPE; name: PX509_NAME; serial: PASN1_INTEGER; ret: PX509_OBJECT): TIdC_INT; cdecl; + X509_LOOKUP_get_by_fingerprint_fn = function(ctx: PX509_LOOKUP; type_: X509_LOOKUP_TYPE; + const bytes: PByte; len: TIdC_INT; ret: PX509_OBJECT): TIdC_INT; cdecl; + X509_LOOKUP_get_by_alias_fn = function(ctx: PX509_LOOKUP; type_: X509_LOOKUP_TYPE; + const str: PIdAnsiChar; len: TIdC_INT; ret: PX509_OBJECT): TIdC_INT; cdecl; + + //DEFINE_STACK_OF(X509_LOOKUP) + //DEFINE_STACK_OF(X509_OBJECT) + //DEFINE_STACK_OF(X509_VERIFY_PARAM) + + { The EXTERNALSYM directive is ignored by FPC, however, it is used by Delphi as follows: + + The EXTERNALSYM directive prevents the specified Delphi symbol from appearing in header + files generated for C++. } + + {$EXTERNALSYM X509_STORE_set_depth} + {$EXTERNALSYM X509_STORE_CTX_set_depth} + {$EXTERNALSYM X509_OBJECT_up_ref_count} + {$EXTERNALSYM X509_OBJECT_new} {introduced 1.1.0} + {$EXTERNALSYM X509_OBJECT_free} {introduced 1.1.0} + {$EXTERNALSYM X509_OBJECT_get_type} {introduced 1.1.0} + {$EXTERNALSYM X509_OBJECT_get0_X509} {introduced 1.1.0} + {$EXTERNALSYM X509_OBJECT_set1_X509} {introduced 1.1.0} + {$EXTERNALSYM X509_OBJECT_get0_X509_CRL} {introduced 1.1.0} + {$EXTERNALSYM X509_OBJECT_set1_X509_CRL} {introduced 1.1.0} + {$EXTERNALSYM X509_STORE_new} + {$EXTERNALSYM X509_STORE_free} + {$EXTERNALSYM X509_STORE_lock} {introduced 1.1.0} + {$EXTERNALSYM X509_STORE_unlock} {introduced 1.1.0} + {$EXTERNALSYM X509_STORE_up_ref} {introduced 1.1.0} + {$EXTERNALSYM X509_STORE_set_flags} + {$EXTERNALSYM X509_STORE_set_purpose} + {$EXTERNALSYM X509_STORE_set_trust} + {$EXTERNALSYM X509_STORE_set1_param} + {$EXTERNALSYM X509_STORE_get0_param} {introduced 1.1.0} + {$EXTERNALSYM X509_STORE_set_verify} {introduced 1.1.0} + {$EXTERNALSYM X509_STORE_CTX_set_verify} {introduced 1.1.0} + {$EXTERNALSYM X509_STORE_get_verify} {introduced 1.1.0} + {$EXTERNALSYM X509_STORE_set_verify_cb} + {$EXTERNALSYM X509_STORE_get_verify_cb} {introduced 1.1.0} + {$EXTERNALSYM X509_STORE_set_get_issuer} {introduced 1.1.0} + {$EXTERNALSYM X509_STORE_get_get_issuer} {introduced 1.1.0} + {$EXTERNALSYM X509_STORE_set_check_issued} {introduced 1.1.0} + {$EXTERNALSYM X509_STORE_get_check_issued} {introduced 1.1.0} + {$EXTERNALSYM X509_STORE_set_check_revocation} {introduced 1.1.0} + {$EXTERNALSYM X509_STORE_get_check_revocation} {introduced 1.1.0} + {$EXTERNALSYM X509_STORE_set_get_crl} {introduced 1.1.0} + {$EXTERNALSYM X509_STORE_get_get_crl} {introduced 1.1.0} + {$EXTERNALSYM X509_STORE_set_check_crl} {introduced 1.1.0} + {$EXTERNALSYM X509_STORE_get_check_crl} {introduced 1.1.0} + {$EXTERNALSYM X509_STORE_set_cert_crl} {introduced 1.1.0} + {$EXTERNALSYM X509_STORE_get_cert_crl} {introduced 1.1.0} + {$EXTERNALSYM X509_STORE_set_check_policy} {introduced 1.1.0} + {$EXTERNALSYM X509_STORE_get_check_policy} {introduced 1.1.0} + {$EXTERNALSYM X509_STORE_set_cleanup} {introduced 1.1.0} + {$EXTERNALSYM X509_STORE_get_cleanup} {introduced 1.1.0} + {$EXTERNALSYM X509_STORE_set_ex_data} {introduced 1.1.0} + {$EXTERNALSYM X509_STORE_get_ex_data} {introduced 1.1.0} + {$EXTERNALSYM X509_STORE_CTX_new} + {$EXTERNALSYM X509_STORE_CTX_get1_issuer} + {$EXTERNALSYM X509_STORE_CTX_free} + {$EXTERNALSYM X509_STORE_CTX_cleanup} + {$EXTERNALSYM X509_STORE_CTX_get0_store} + {$EXTERNALSYM X509_STORE_CTX_get0_cert} {introduced 1.1.0} + {$EXTERNALSYM X509_STORE_CTX_set_verify_cb} + {$EXTERNALSYM X509_STORE_CTX_get_verify_cb} {introduced 1.1.0} + {$EXTERNALSYM X509_STORE_CTX_get_verify} {introduced 1.1.0} + {$EXTERNALSYM X509_STORE_CTX_get_get_issuer} {introduced 1.1.0} + {$EXTERNALSYM X509_STORE_CTX_get_check_issued} {introduced 1.1.0} + {$EXTERNALSYM X509_STORE_CTX_get_check_revocation} {introduced 1.1.0} + {$EXTERNALSYM X509_STORE_CTX_get_get_crl} {introduced 1.1.0} + {$EXTERNALSYM X509_STORE_CTX_get_check_crl} {introduced 1.1.0} + {$EXTERNALSYM X509_STORE_CTX_get_cert_crl} {introduced 1.1.0} + {$EXTERNALSYM X509_STORE_CTX_get_check_policy} {introduced 1.1.0} + {$EXTERNALSYM X509_STORE_CTX_get_cleanup} {introduced 1.1.0} + {$EXTERNALSYM X509_STORE_add_lookup} + {$EXTERNALSYM X509_LOOKUP_hash_dir} + {$EXTERNALSYM X509_LOOKUP_file} + {$EXTERNALSYM X509_LOOKUP_meth_new} {introduced 1.1.0} + {$EXTERNALSYM X509_LOOKUP_meth_free} {introduced 1.1.0} + {$EXTERNALSYM X509_LOOKUP_meth_set_ctrl} {introduced 1.1.0} + {$EXTERNALSYM X509_LOOKUP_meth_get_ctrl} {introduced 1.1.0} + {$EXTERNALSYM X509_LOOKUP_meth_set_get_by_subject} {introduced 1.1.0} + {$EXTERNALSYM X509_LOOKUP_meth_get_get_by_subject} {introduced 1.1.0} + {$EXTERNALSYM X509_LOOKUP_meth_set_get_by_issuer_serial} {introduced 1.1.0} + {$EXTERNALSYM X509_LOOKUP_meth_get_get_by_issuer_serial} {introduced 1.1.0} + {$EXTERNALSYM X509_LOOKUP_meth_set_get_by_fingerprint} {introduced 1.1.0} + {$EXTERNALSYM X509_LOOKUP_meth_get_get_by_fingerprint} {introduced 1.1.0} + {$EXTERNALSYM X509_LOOKUP_meth_set_get_by_alias} {introduced 1.1.0} + {$EXTERNALSYM X509_LOOKUP_meth_get_get_by_alias} {introduced 1.1.0} + {$EXTERNALSYM X509_STORE_add_cert} + {$EXTERNALSYM X509_STORE_add_crl} + {$EXTERNALSYM X509_STORE_CTX_get_by_subject} {introduced 1.1.0} + {$EXTERNALSYM X509_STORE_CTX_get_obj_by_subject} {introduced 1.1.0} + {$EXTERNALSYM X509_LOOKUP_ctrl} + {$EXTERNALSYM X509_load_cert_file} + {$EXTERNALSYM X509_load_crl_file} + {$EXTERNALSYM X509_load_cert_crl_file} + {$EXTERNALSYM X509_LOOKUP_new} + {$EXTERNALSYM X509_LOOKUP_free} + {$EXTERNALSYM X509_LOOKUP_init} + {$EXTERNALSYM X509_LOOKUP_by_subject} + {$EXTERNALSYM X509_LOOKUP_by_issuer_serial} + {$EXTERNALSYM X509_LOOKUP_by_fingerprint} + {$EXTERNALSYM X509_LOOKUP_by_alias} + {$EXTERNALSYM X509_LOOKUP_set_method_data} {introduced 1.1.0} + {$EXTERNALSYM X509_LOOKUP_get_method_data} {introduced 1.1.0} + {$EXTERNALSYM X509_LOOKUP_get_store} {introduced 1.1.0} + {$EXTERNALSYM X509_LOOKUP_shutdown} + {$EXTERNALSYM X509_STORE_load_locations} + {$EXTERNALSYM X509_STORE_set_default_paths} + {$EXTERNALSYM X509_STORE_CTX_set_ex_data} + {$EXTERNALSYM X509_STORE_CTX_get_ex_data} + {$EXTERNALSYM X509_STORE_CTX_get_error} + {$EXTERNALSYM X509_STORE_CTX_set_error} + {$EXTERNALSYM X509_STORE_CTX_get_error_depth} + {$EXTERNALSYM X509_STORE_CTX_set_error_depth} {introduced 1.1.0} + {$EXTERNALSYM X509_STORE_CTX_get_current_cert} + {$EXTERNALSYM X509_STORE_CTX_set_current_cert} {introduced 1.1.0} + {$EXTERNALSYM X509_STORE_CTX_get0_current_issuer} + {$EXTERNALSYM X509_STORE_CTX_get0_current_crl} + {$EXTERNALSYM X509_STORE_CTX_get0_parent_ctx} + {$EXTERNALSYM X509_STORE_CTX_set_cert} + {$EXTERNALSYM X509_STORE_CTX_set_purpose} + {$EXTERNALSYM X509_STORE_CTX_set_trust} + {$EXTERNALSYM X509_STORE_CTX_purpose_inherit} + {$EXTERNALSYM X509_STORE_CTX_set_flags} + {$EXTERNALSYM X509_STORE_CTX_get0_policy_tree} + {$EXTERNALSYM X509_STORE_CTX_get_explicit_policy} + {$EXTERNALSYM X509_STORE_CTX_get_num_untrusted} {introduced 1.1.0} + {$EXTERNALSYM X509_STORE_CTX_get0_param} + {$EXTERNALSYM X509_STORE_CTX_set0_param} + {$EXTERNALSYM X509_STORE_CTX_set_default} + {$EXTERNALSYM X509_STORE_CTX_set0_dane} {introduced 1.1.0} + {$EXTERNALSYM X509_VERIFY_PARAM_new} + {$EXTERNALSYM X509_VERIFY_PARAM_free} + {$EXTERNALSYM X509_VERIFY_PARAM_inherit} + {$EXTERNALSYM X509_VERIFY_PARAM_set1} + {$EXTERNALSYM X509_VERIFY_PARAM_set1_name} + {$EXTERNALSYM X509_VERIFY_PARAM_set_flags} + {$EXTERNALSYM X509_VERIFY_PARAM_clear_flags} + {$EXTERNALSYM X509_VERIFY_PARAM_get_flags} + {$EXTERNALSYM X509_VERIFY_PARAM_set_purpose} + {$EXTERNALSYM X509_VERIFY_PARAM_set_trust} + {$EXTERNALSYM X509_VERIFY_PARAM_set_depth} + {$EXTERNALSYM X509_VERIFY_PARAM_set_auth_level} {introduced 1.1.0} + {$EXTERNALSYM X509_VERIFY_PARAM_add0_policy} + {$EXTERNALSYM X509_VERIFY_PARAM_set_inh_flags} {introduced 1.1.0} + {$EXTERNALSYM X509_VERIFY_PARAM_get_inh_flags} {introduced 1.1.0} + {$EXTERNALSYM X509_VERIFY_PARAM_set1_host} + {$EXTERNALSYM X509_VERIFY_PARAM_add1_host} + {$EXTERNALSYM X509_VERIFY_PARAM_set_hostflags} + {$EXTERNALSYM X509_VERIFY_PARAM_get_hostflags} {introduced 1.1.0} + {$EXTERNALSYM X509_VERIFY_PARAM_get0_peername} + {$EXTERNALSYM X509_VERIFY_PARAM_move_peername} {introduced 1.1.0} + {$EXTERNALSYM X509_VERIFY_PARAM_set1_email} + {$EXTERNALSYM X509_VERIFY_PARAM_set1_ip} + {$EXTERNALSYM X509_VERIFY_PARAM_set1_ip_asc} + {$EXTERNALSYM X509_VERIFY_PARAM_get_depth} + {$EXTERNALSYM X509_VERIFY_PARAM_get_auth_level} {introduced 1.1.0} + {$EXTERNALSYM X509_VERIFY_PARAM_get0_name} + {$EXTERNALSYM X509_VERIFY_PARAM_add0_table} + {$EXTERNALSYM X509_VERIFY_PARAM_get_count} + {$EXTERNALSYM X509_VERIFY_PARAM_get0} + {$EXTERNALSYM X509_VERIFY_PARAM_lookup} + {$EXTERNALSYM X509_VERIFY_PARAM_table_cleanup} + {$EXTERNALSYM X509_policy_tree_free} + {$EXTERNALSYM X509_policy_tree_level_count} + {$EXTERNALSYM X509_policy_tree_get0_level} + {$EXTERNALSYM X509_policy_level_node_count} + {$EXTERNALSYM X509_policy_level_get0_node} + {$EXTERNALSYM X509_policy_node_get0_policy} + {$EXTERNALSYM X509_policy_node_get0_parent} +{helper_functions} +function X509_LOOKUP_load_file(ctx: PX509_LOOKUP; name: PIdAnsiChar; type_: TIdC_LONG): TIdC_INT; +{\helper_functions} + + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +var + {$EXTERNALSYM X509_STORE_CTX_get_app_data} {removed 1.0.0} + X509_STORE_set_depth: function (store: PX509_STORE; depth: TIdC_INT): TIdC_INT; cdecl = nil; + + X509_STORE_CTX_set_depth: procedure (ctx: PX509_STORE_CTX; depth: TIdC_INT); cdecl = nil; + + //# define X509_STORE_CTX_set_app_data(ctx,data) \ + // X509_STORE_CTX_set_ex_data(ctx,0,data) + //# define X509_STORE_CTX_get_app_data(ctx) \ + // X509_STORE_CTX_get_ex_data(ctx,0) + X509_STORE_CTX_get_app_data: function (ctx: PX509_STORE_CTX): Pointer; cdecl = nil; {removed 1.0.0} + // + //# define X509_LOOKUP_load_file(x,name,type) \ + // X509_LOOKUP_ctrl((x),X509_L_FILE_LOAD,(name),(TIdC_LONG)(type),NULL) + // + //# define X509_LOOKUP_add_dir(x,name,type) \ + // X509_LOOKUP_ctrl((x),X509_L_ADD_DIR,(name),(TIdC_LONG)(type),NULL) + // + //TIdC_INT X509_OBJECT_idx_by_subject(STACK_OF(X509_OBJECT) *h, X509_LOOKUP_TYPE type, + // X509_NAME *name); + //X509_OBJECT *X509_OBJECT_retrieve_by_subject(STACK_OF(X509_OBJECT) *h, + // X509_LOOKUP_TYPE type, + // X509_NAME *name); + //X509_OBJECT *X509_OBJECT_retrieve_match(STACK_OF(X509_OBJECT) *h, + // X509_OBJECT *x); + X509_OBJECT_up_ref_count: function (a: PX509_OBJECT): TIdC_INT; cdecl = nil; + X509_OBJECT_new: function : PX509_OBJECT; cdecl = nil; {introduced 1.1.0} + X509_OBJECT_free: procedure (a: PX509_OBJECT); cdecl = nil; {introduced 1.1.0} + X509_OBJECT_get_type: function (const a: PX509_OBJECT): X509_LOOKUP_TYPE; cdecl = nil; {introduced 1.1.0} + X509_OBJECT_get0_X509: function (const a: PX509_OBJECT): PX509; cdecl = nil; {introduced 1.1.0} + X509_OBJECT_set1_X509: function (a: PX509_OBJECT; obj: PX509): TIdC_INT; cdecl = nil; {introduced 1.1.0} + X509_OBJECT_get0_X509_CRL: function (a: PX509_OBJECT): PX509_CRL; cdecl = nil; {introduced 1.1.0} + X509_OBJECT_set1_X509_CRL: function (a: PX509_OBJECT; obj: PX509_CRL): TIdC_INT; cdecl = nil; {introduced 1.1.0} + X509_STORE_new: function : PX509_STORE; cdecl = nil; + X509_STORE_free: procedure (v: PX509_STORE); cdecl = nil; + X509_STORE_lock: function (ctx: PX509_STORE): TIdC_INT; cdecl = nil; {introduced 1.1.0} + X509_STORE_unlock: function (ctx: PX509_STORE): TIdC_INT; cdecl = nil; {introduced 1.1.0} + X509_STORE_up_ref: function (v: PX509_STORE): TIdC_INT; cdecl = nil; {introduced 1.1.0} + //STACK_OF(X509_OBJECT) *X509_STORE_get0_objects(X509_STORE *v); + + //STACK_OF(X509) *X509_STORE_CTX_get1_certs(X509_STORE_CTX *st, X509_NAME *nm); + //STACK_OF(X509_CRL) *X509_STORE_CTX_get1_crls(X509_STORE_CTX *st, X509_NAME *nm); + X509_STORE_set_flags: function (ctx: PX509_STORE; flags: TIdC_ULONG): TIdC_INT; cdecl = nil; + X509_STORE_set_purpose: function (ctx: PX509_STORE; purpose: TIdC_INT): TIdC_INT; cdecl = nil; + X509_STORE_set_trust: function (ctx: PX509_STORE; trust: TIdC_INT): TIdC_INT; cdecl = nil; + X509_STORE_set1_param: function (ctx: PX509_STORE; pm: PX509_VERIFY_PARAM): TIdC_INT; cdecl = nil; + X509_STORE_get0_param: function (ctx: PX509_STORE): PX509_VERIFY_PARAM; cdecl = nil; {introduced 1.1.0} + + X509_STORE_set_verify: procedure (ctx: PX509_STORE; verify: X509_STORE_CTX_verify_fn); cdecl = nil; {introduced 1.1.0} + //#define X509_STORE_set_verify_func(ctx, func) \ + // X509_STORE_set_verify((ctx),(func)) + X509_STORE_CTX_set_verify: procedure (ctx: PX509_STORE_CTX; verify: X509_STORE_CTX_verify_fn); cdecl = nil; {introduced 1.1.0} + X509_STORE_get_verify: function (ctx: PX509_STORE): X509_STORE_CTX_verify_fn; cdecl = nil; {introduced 1.1.0} + X509_STORE_set_verify_cb: procedure (ctx: PX509_STORE; verify_cb: X509_STORE_CTX_verify_cb); cdecl = nil; + //# define X509_STORE_set_verify_cb_func(ctx,func) \ + // X509_STORE_set_verify_cb((ctx),(func)) + X509_STORE_get_verify_cb: function (ctx: PX509_STORE): X509_STORE_CTX_verify_cb; cdecl = nil; {introduced 1.1.0} + X509_STORE_set_get_issuer: procedure (ctx: PX509_STORE; get_issuer: X509_STORE_CTX_get_issuer_fn); cdecl = nil; {introduced 1.1.0} + X509_STORE_get_get_issuer: function (ctx: PX509_STORE): X509_STORE_CTX_get_issuer_fn; cdecl = nil; {introduced 1.1.0} + X509_STORE_set_check_issued: procedure (ctx: PX509_STORE; check_issued: X509_STORE_CTX_check_issued_fn); cdecl = nil; {introduced 1.1.0} + X509_STORE_get_check_issued: function (ctx: PX509_STORE): X509_STORE_CTX_check_issued_fn; cdecl = nil; {introduced 1.1.0} + X509_STORE_set_check_revocation: procedure (ctx: PX509_STORE; check_revocation: X509_STORE_CTX_check_revocation_fn); cdecl = nil; {introduced 1.1.0} + X509_STORE_get_check_revocation: function (ctx: PX509_STORE): X509_STORE_CTX_check_revocation_fn; cdecl = nil; {introduced 1.1.0} + X509_STORE_set_get_crl: procedure (ctx: PX509_STORE; get_crl: X509_STORE_CTX_get_crl_fn); cdecl = nil; {introduced 1.1.0} + X509_STORE_get_get_crl: function (ctx: PX509_STORE): X509_STORE_CTX_get_crl_fn; cdecl = nil; {introduced 1.1.0} + X509_STORE_set_check_crl: procedure (ctx: PX509_STORE; check_crl: X509_STORE_CTX_check_crl_fn); cdecl = nil; {introduced 1.1.0} + X509_STORE_get_check_crl: function (ctx: PX509_STORE): X509_STORE_CTX_check_crl_fn; cdecl = nil; {introduced 1.1.0} + X509_STORE_set_cert_crl: procedure (ctx: PX509_STORE; cert_crl: X509_STORE_CTX_cert_crl_fn); cdecl = nil; {introduced 1.1.0} + X509_STORE_get_cert_crl: function (ctx: PX509_STORE): X509_STORE_CTX_cert_crl_fn; cdecl = nil; {introduced 1.1.0} + X509_STORE_set_check_policy: procedure (ctx: PX509_STORE; check_policy: X509_STORE_CTX_check_policy_fn); cdecl = nil; {introduced 1.1.0} + X509_STORE_get_check_policy: function (ctx: PX509_STORE): X509_STORE_CTX_check_policy_fn; cdecl = nil; {introduced 1.1.0} +// procedure X509_STORE_set_lookup_certs(ctx: PX509_STORE; lookup_certs: X509_STORE_CTX_lookup_certs_fn); +// function X509_STORE_get_lookup_certs(ctx: PX509_STORE): X509_STORE_CTX_lookup_certs_fn; +// procedure X509_STORE_set_lookup_crls(ctx: PX509_STORE; lookup_crls: X509_STORE_CTX_lookup_crls_fn); +// #define X509_STORE_set_lookup_crls_cb(ctx, func) \ +// X509_STORE_set_lookup_crls((ctx), (func)) +// function X509_STORE_get_lookup_crls(ctx: PX509_STORE): X509_STORE_CTX_lookup_crls_fn; + X509_STORE_set_cleanup: procedure (ctx: PX509_STORE; cleanup: X509_STORE_CTX_cleanup_fn); cdecl = nil; {introduced 1.1.0} + X509_STORE_get_cleanup: function (ctx: PX509_STORE): X509_STORE_CTX_cleanup_fn; cdecl = nil; {introduced 1.1.0} + + //#define X509_STORE_get_ex_new_index(l, p, newf, dupf, freef) \ + // CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_X509_STORE, l, p, newf, dupf, freef) + X509_STORE_set_ex_data: function (ctx: PX509_STORE; idx: TIdC_INT; data: Pointer): TIdC_INT; cdecl = nil; {introduced 1.1.0} + X509_STORE_get_ex_data: function (ctx: PX509_STORE; idx: TIdC_INT): Pointer; cdecl = nil; {introduced 1.1.0} + + X509_STORE_CTX_new: function : PX509_STORE_CTX; cdecl = nil; + + X509_STORE_CTX_get1_issuer: function (issuer: PPX509; ctx: PX509_STORE_CTX; x: PX509): TIdC_INT; cdecl = nil; + + X509_STORE_CTX_free: procedure (ctx: PX509_STORE_CTX); cdecl = nil; +// TIdC_INT X509_STORE_CTX_init(ctx: PX509_STORE_CTX; store: PX509_STORE; x509: PX509; chain: P STACK_OF(X509)); +// procedure X509_STORE_CTX_set0_trusted_stack(ctx: PX509_STORE_CTX; sk: P STACK_OF(X509)); + X509_STORE_CTX_cleanup: procedure (ctx: PX509_STORE_CTX); cdecl = nil; + + X509_STORE_CTX_get0_store: function (ctx: PX509_STORE_CTX): PX509_STORE; cdecl = nil; + X509_STORE_CTX_get0_cert: function (ctx: PX509_STORE_CTX): PX509; cdecl = nil; {introduced 1.1.0} + //STACK_OF(X509)* X509_STORE_CTX_get0_untrusted(X509_STORE_CTX *ctx); + //void X509_STORE_CTX_set0_untrusted(X509_STORE_CTX *ctx, STACK_OF(X509) *sk); + X509_STORE_CTX_set_verify_cb: procedure (ctx: PX509_STORE_CTX; verify: X509_STORE_CTX_verify_cb); cdecl = nil; + X509_STORE_CTX_get_verify_cb: function (ctx: PX509_STORE_CTX): X509_STORE_CTX_verify_cb; cdecl = nil; {introduced 1.1.0} + X509_STORE_CTX_get_verify: function (ctx: PX509_STORE_CTX): X509_STORE_CTX_verify_fn; cdecl = nil; {introduced 1.1.0} + X509_STORE_CTX_get_get_issuer: function (ctx: PX509_STORE_CTX): X509_STORE_CTX_get_issuer_fn; cdecl = nil; {introduced 1.1.0} + X509_STORE_CTX_get_check_issued: function (ctx: PX509_STORE_CTX): X509_STORE_CTX_check_issued_fn; cdecl = nil; {introduced 1.1.0} + X509_STORE_CTX_get_check_revocation: function (ctx: PX509_STORE_CTX): X509_STORE_CTX_check_revocation_fn; cdecl = nil; {introduced 1.1.0} + X509_STORE_CTX_get_get_crl: function (ctx: PX509_STORE_CTX): X509_STORE_CTX_get_crl_fn; cdecl = nil; {introduced 1.1.0} + X509_STORE_CTX_get_check_crl: function (ctx: PX509_STORE_CTX): X509_STORE_CTX_check_crl_fn; cdecl = nil; {introduced 1.1.0} + X509_STORE_CTX_get_cert_crl: function (ctx: PX509_STORE_CTX): X509_STORE_CTX_cert_crl_fn; cdecl = nil; {introduced 1.1.0} + X509_STORE_CTX_get_check_policy: function (ctx: PX509_STORE_CTX): X509_STORE_CTX_check_policy_fn; cdecl = nil; {introduced 1.1.0} +// function X509_STORE_CTX_get_lookup_certs(ctx: PX509_STORE_CTX): X509_STORE_CTX_lookup_certs_fn; +// function X509_STORE_CTX_get_lookup_crls(ctx: PX509_STORE_CTX): X509_STORE_CTX_lookup_crls_fn; + X509_STORE_CTX_get_cleanup: function (ctx: PX509_STORE_CTX): X509_STORE_CTX_cleanup_fn; cdecl = nil; {introduced 1.1.0} + + X509_STORE_add_lookup: function (v: PX509_STORE; m: PX509_LOOKUP_METHOD): PX509_LOOKUP; cdecl = nil; + X509_LOOKUP_hash_dir: function : PX509_LOOKUP_METHOD; cdecl = nil; + X509_LOOKUP_file: function : PX509_LOOKUP_METHOD; cdecl = nil; + + X509_LOOKUP_meth_new: function (const name: PIdAnsiChar): PX509_LOOKUP_METHOD; cdecl = nil; {introduced 1.1.0} + X509_LOOKUP_meth_free: procedure (method: PX509_LOOKUP_METHOD); cdecl = nil; {introduced 1.1.0} + + //TIdC_INT X509_LOOKUP_meth_set_new_item(X509_LOOKUP_METHOD *method, + // TIdC_INT (*new_item) (X509_LOOKUP *ctx)); + //TIdC_INT (*X509_LOOKUP_meth_get_new_item(const X509_LOOKUP_METHOD* method)) + // (X509_LOOKUP *ctx); + // + //TIdC_INT X509_LOOKUP_meth_set_free(X509_LOOKUP_METHOD *method, + // void (*free_fn) (X509_LOOKUP *ctx)); + //void (*X509_LOOKUP_meth_get_free(const X509_LOOKUP_METHOD* method)) + // (X509_LOOKUP *ctx); + // + //TIdC_INT X509_LOOKUP_meth_set_init(X509_LOOKUP_METHOD *method, + // TIdC_INT (*init) (X509_LOOKUP *ctx)); + //TIdC_INT (*X509_LOOKUP_meth_get_init(const X509_LOOKUP_METHOD* method)) + // (X509_LOOKUP *ctx); + // + //TIdC_INT X509_LOOKUP_meth_set_shutdown(X509_LOOKUP_METHOD *method, + // TIdC_INT (*shutdown) (X509_LOOKUP *ctx)); + //TIdC_INT (*X509_LOOKUP_meth_get_shutdown(const X509_LOOKUP_METHOD* method)) + // (X509_LOOKUP *ctx); + + X509_LOOKUP_meth_set_ctrl: function (method: PX509_LOOKUP_METHOD; ctrl_fn: X509_LOOKUP_ctrl_fn): TIdC_INT; cdecl = nil; {introduced 1.1.0} + X509_LOOKUP_meth_get_ctrl: function (const method: PX509_LOOKUP_METHOD): X509_LOOKUP_ctrl_fn; cdecl = nil; {introduced 1.1.0} + + X509_LOOKUP_meth_set_get_by_subject: function (method: PX509_LOOKUP_METHOD; fn: X509_LOOKUP_get_by_subject_fn): TIdC_INT; cdecl = nil; {introduced 1.1.0} + X509_LOOKUP_meth_get_get_by_subject: function (const method: PX509_LOOKUP_METHOD): X509_LOOKUP_get_by_subject_fn; cdecl = nil; {introduced 1.1.0} + + X509_LOOKUP_meth_set_get_by_issuer_serial: function (method: PX509_LOOKUP_METHOD; fn: X509_LOOKUP_get_by_issuer_serial_fn): TIdC_INT; cdecl = nil; {introduced 1.1.0} + X509_LOOKUP_meth_get_get_by_issuer_serial: function (const method: PX509_LOOKUP_METHOD): X509_LOOKUP_get_by_issuer_serial_fn; cdecl = nil; {introduced 1.1.0} + + X509_LOOKUP_meth_set_get_by_fingerprint: function (method: PX509_LOOKUP_METHOD; fn: X509_LOOKUP_get_by_fingerprint_fn): TIdC_INT; cdecl = nil; {introduced 1.1.0} + X509_LOOKUP_meth_get_get_by_fingerprint: function (const method: PX509_LOOKUP_METHOD): X509_LOOKUP_get_by_fingerprint_fn; cdecl = nil; {introduced 1.1.0} + + X509_LOOKUP_meth_set_get_by_alias: function (method: PX509_LOOKUP_METHOD; fn: X509_LOOKUP_get_by_alias_fn): TIdC_INT; cdecl = nil; {introduced 1.1.0} + X509_LOOKUP_meth_get_get_by_alias: function (const method: PX509_LOOKUP_METHOD): X509_LOOKUP_get_by_alias_fn; cdecl = nil; {introduced 1.1.0} + + X509_STORE_add_cert: function (ctx: PX509_STORE; x: PX509): TIdC_INT; cdecl = nil; + X509_STORE_add_crl: function (ctx: PX509_STORE; x: PX509_CRL): TIdC_INT; cdecl = nil; + + X509_STORE_CTX_get_by_subject: function (vs: PX509_STORE_CTX; type_: X509_LOOKUP_TYPE; name: PX509_NAME; ret: PX509_OBJECT): TIdC_INT; cdecl = nil; {introduced 1.1.0} + X509_STORE_CTX_get_obj_by_subject: function (vs: PX509_STORE_CTX; type_: X509_LOOKUP_TYPE; name: PX509_NAME): PX509_OBJECT; cdecl = nil; {introduced 1.1.0} + + X509_LOOKUP_ctrl: function (ctx: PX509_LOOKUP; cmd: TIdC_INT; const argc: PIdAnsiChar; argl: TIdC_LONG; ret: PPIdAnsiChar): TIdC_INT; cdecl = nil; + + X509_load_cert_file: function (ctx: PX509_LOOKUP; const file_: PIdAnsiChar; type_: TIdC_INT): TIdC_INT; cdecl = nil; + X509_load_crl_file: function (ctx: PX509_LOOKUP; const file_: PIdAnsiChar; type_: TIdC_INT): TIdC_INT; cdecl = nil; + X509_load_cert_crl_file: function (ctx: PX509_LOOKUP; const file_: PIdAnsiChar; type_: TIdC_INT): TIdC_INT; cdecl = nil; + + X509_LOOKUP_new: function (method: PX509_LOOKUP_METHOD): PX509_LOOKUP; cdecl = nil; + X509_LOOKUP_free: procedure (ctx: PX509_LOOKUP); cdecl = nil; + X509_LOOKUP_init: function (ctx: PX509_LOOKUP): TIdC_INT; cdecl = nil; + X509_LOOKUP_by_subject: function (ctx: PX509_LOOKUP; type_: X509_LOOKUP_TYPE; name: PX509_NAME; ret: PX509_OBJECT): TIdC_INT; cdecl = nil; + X509_LOOKUP_by_issuer_serial: function (ctx: PX509_LOOKUP; type_: X509_LOOKUP_TYPE; name: PX509_NAME; serial: PASN1_INTEGER; ret: PX509_OBJECT): TIdC_INT; cdecl = nil; + X509_LOOKUP_by_fingerprint: function (ctx: PX509_LOOKUP; type_: X509_LOOKUP_TYPE; const bytes: PByte; len: TIdC_INT; ret: PX509_OBJECT): TIdC_INT; cdecl = nil; + X509_LOOKUP_by_alias: function (ctx: PX509_LOOKUP; type_: X509_LOOKUP_TYPE; const str: PIdAnsiChar; len: TIdC_INT; ret: PX509_OBJECT): TIdC_INT; cdecl = nil; + X509_LOOKUP_set_method_data: function (ctx: PX509_LOOKUP; data: Pointer): TIdC_INT; cdecl = nil; {introduced 1.1.0} + X509_LOOKUP_get_method_data: function (const ctx: PX509_LOOKUP): Pointer; cdecl = nil; {introduced 1.1.0} + X509_LOOKUP_get_store: function (const ctx: PX509_LOOKUP): PX509_STORE; cdecl = nil; {introduced 1.1.0} + X509_LOOKUP_shutdown: function (ctx: PX509_LOOKUP): TIdC_INT; cdecl = nil; + + X509_STORE_load_locations: function (ctx: PX509_STORE; const file_: PIdAnsiChar; const dir: PIdAnsiChar): TIdC_INT; cdecl = nil; + X509_STORE_set_default_paths: function (ctx: PX509_STORE): TIdC_INT; cdecl = nil; + + //#define X509_STORE_CTX_get_ex_new_index(l, p, newf, dupf, freef) \ + // CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_X509_STORE_CTX, l, p, newf, dupf, freef) + X509_STORE_CTX_set_ex_data: function (ctx: PX509_STORE_CTX; idx: TIdC_INT; data: Pointer): TIdC_INT; cdecl = nil; + X509_STORE_CTX_get_ex_data: function (ctx: PX509_STORE_CTX; idx: TIdC_INT): Pointer; cdecl = nil; + X509_STORE_CTX_get_error: function (ctx: PX509_STORE_CTX): TIdC_INT; cdecl = nil; + X509_STORE_CTX_set_error: procedure (ctx: X509_STORE_CTX; s: TIdC_INT); cdecl = nil; + X509_STORE_CTX_get_error_depth: function (ctx: PX509_STORE_CTX): TIdC_INT; cdecl = nil; + X509_STORE_CTX_set_error_depth: procedure (ctx: PX509_STORE_CTX; depth: TIdC_INT); cdecl = nil; {introduced 1.1.0} + X509_STORE_CTX_get_current_cert: function (ctx: PX509_STORE_CTX): PX509; cdecl = nil; + X509_STORE_CTX_set_current_cert: procedure (ctx: PX509_STORE_CTX; x: PX509); cdecl = nil; {introduced 1.1.0} + X509_STORE_CTX_get0_current_issuer: function (ctx: PX509_STORE_CTX): PX509; cdecl = nil; + X509_STORE_CTX_get0_current_crl: function (ctx: PX509_STORE_CTX): PX509_CRL; cdecl = nil; + X509_STORE_CTX_get0_parent_ctx: function (ctx: PX509_STORE_CTX): PX509_STORE_CTX; cdecl = nil; +// STACK_OF(X509) *X509_STORE_CTX_get0_chain(X509_STORE_CTX *ctx); +// STACK_OF(X509) *X509_STORE_CTX_get1_chain(X509_STORE_CTX *ctx); + X509_STORE_CTX_set_cert: procedure (c: PX509_STORE_CTX; x: PX509); cdecl = nil; +// void X509_STORE_CTX_set0_verified_chain(X509_STORE_CTX *c, STACK_OF(X509) *sk); +// void X509_STORE_CTX_set0_crls(X509_STORE_CTX *c, STACK_OF(X509_CRL) *sk); + X509_STORE_CTX_set_purpose: function (ctx: PX509_STORE_CTX; purpose: TIdC_INT): TIdC_INT; cdecl = nil; + X509_STORE_CTX_set_trust: function (ctx: PX509_STORE_CTX; trust: TIdC_INT): TIdC_INT; cdecl = nil; + X509_STORE_CTX_purpose_inherit: function (ctx: PX509_STORE_CTX; def_purpose: TIdC_INT; purpose: TIdC_INT; trust: TIdC_INT): TIdC_INT; cdecl = nil; + X509_STORE_CTX_set_flags: procedure (ctx: PX509_STORE_CTX; flags: TIdC_ULONG); cdecl = nil; +// procedure X509_STORE_CTX_set_time(ctx: PX509_STORE_CTX; flags: TIdC_ULONG; t: TIdC_TIMET); + + X509_STORE_CTX_get0_policy_tree: function (ctx: PX509_STORE_CTX): PX509_POLICY_TREE; cdecl = nil; + X509_STORE_CTX_get_explicit_policy: function (ctx: PX509_STORE_CTX): TIdC_INT; cdecl = nil; + X509_STORE_CTX_get_num_untrusted: function (ctx: PX509_STORE_CTX): TIdC_INT; cdecl = nil; {introduced 1.1.0} + + X509_STORE_CTX_get0_param: function (ctx: PX509_STORE_CTX): PX509_VERIFY_PARAM; cdecl = nil; + X509_STORE_CTX_set0_param: procedure (ctx: PX509_STORE_CTX; param: PX509_VERIFY_PARAM); cdecl = nil; + X509_STORE_CTX_set_default: function (ctx: PX509_STORE_CTX; const name: PIdAnsiChar): TIdC_INT; cdecl = nil; + + (* + * Bridge opacity barrier between libcrypt and libssl, also needed to support + * offline testing in test/danetest.c + *) + X509_STORE_CTX_set0_dane: procedure (ctx: PX509_STORE_CTX; dane: PSSL_DANE); cdecl = nil; {introduced 1.1.0} + + (* X509_VERIFY_PARAM functions *) + + X509_VERIFY_PARAM_new: function : PX509_VERIFY_PARAM; cdecl = nil; + X509_VERIFY_PARAM_free: procedure (param: PX509_VERIFY_PARAM); cdecl = nil; + X509_VERIFY_PARAM_inherit: function (to_: PX509_VERIFY_PARAM; const from: PX509_VERIFY_PARAM): TIdC_INT; cdecl = nil; + X509_VERIFY_PARAM_set1: function (to_: PX509_VERIFY_PARAM; const from: PX509_VERIFY_PARAM): TIdC_INT; cdecl = nil; + X509_VERIFY_PARAM_set1_name: function (param: PX509_VERIFY_PARAM; const name: PIdAnsiChar): TIdC_INT; cdecl = nil; + X509_VERIFY_PARAM_set_flags: function (param: PX509_VERIFY_PARAM; flags: TIdC_ULONG): TIdC_INT; cdecl = nil; + X509_VERIFY_PARAM_clear_flags: function (param: PX509_VERIFY_PARAM; flags: TIdC_ULONG): TIdC_INT; cdecl = nil; + X509_VERIFY_PARAM_get_flags: function (param: PX509_VERIFY_PARAM): TIdC_ULONG; cdecl = nil; + X509_VERIFY_PARAM_set_purpose: function (param: PX509_VERIFY_PARAM; purpose: TIdC_INT): TIdC_INT; cdecl = nil; + X509_VERIFY_PARAM_set_trust: function (param: PX509_VERIFY_PARAM; trust: TIdC_INT): TIdC_INT; cdecl = nil; + X509_VERIFY_PARAM_set_depth: procedure (param: PX509_VERIFY_PARAM; depth: TIdC_INT); cdecl = nil; + X509_VERIFY_PARAM_set_auth_level: procedure (param: PX509_VERIFY_PARAM; auth_level: TIdC_INT); cdecl = nil; {introduced 1.1.0} +// function X509_VERIFY_PARAM_get_time(const param: PX509_VERIFY_PARAM): TIdC_TIMET; +// procedure X509_VERIFY_PARAM_set_time(param: PX509_VERIFY_PARAM; t: TIdC_TIMET); + X509_VERIFY_PARAM_add0_policy: function (param: PX509_VERIFY_PARAM; policy: PASN1_OBJECT): TIdC_INT; cdecl = nil; + //TIdC_INT X509_VERIFY_PARAM_set1_policies(X509_VERIFY_PARAM *param, + // STACK_OF(ASN1_OBJECT) *policies); + + X509_VERIFY_PARAM_set_inh_flags: function (param: PX509_VERIFY_PARAM; flags: TIdC_UINT32): TIdC_INT; cdecl = nil; {introduced 1.1.0} + X509_VERIFY_PARAM_get_inh_flags: function (const param: PX509_VERIFY_PARAM): TIdC_UINT32; cdecl = nil; {introduced 1.1.0} + + X509_VERIFY_PARAM_set1_host: function (param: PX509_VERIFY_PARAM; const name: PIdAnsiChar; namelen: TIdC_SIZET): TIdC_INT; cdecl = nil; + X509_VERIFY_PARAM_add1_host: function (param: PX509_VERIFY_PARAM; const name: PIdAnsiChar; namelen: TIdC_SIZET): TIdC_INT; cdecl = nil; + X509_VERIFY_PARAM_set_hostflags: procedure (param: PX509_VERIFY_PARAM; flags: TIdC_UINT); cdecl = nil; + X509_VERIFY_PARAM_get_hostflags: function (const param: PX509_VERIFY_PARAM): TIdC_UINT; cdecl = nil; {introduced 1.1.0} + X509_VERIFY_PARAM_get0_peername: function (v1: PX509_VERIFY_PARAM): PIdAnsiChar; cdecl = nil; + X509_VERIFY_PARAM_move_peername: procedure (v1: PX509_VERIFY_PARAM; v2: PX509_VERIFY_PARAM); cdecl = nil; {introduced 1.1.0} + X509_VERIFY_PARAM_set1_email: function (param: PX509_VERIFY_PARAM; const email: PIdAnsiChar; emaillen: TIdC_SIZET): TIdC_INT; cdecl = nil; + X509_VERIFY_PARAM_set1_ip: function (param: PX509_VERIFY_PARAM; const ip: PByte; iplen: TIdC_SIZET): TIdC_INT; cdecl = nil; + X509_VERIFY_PARAM_set1_ip_asc: function (param: PX509_VERIFY_PARAM; const ipasc: PIdAnsiChar): TIdC_INT; cdecl = nil; + + X509_VERIFY_PARAM_get_depth: function (const param: PX509_VERIFY_PARAM): TIdC_INT; cdecl = nil; + X509_VERIFY_PARAM_get_auth_level: function (const param: PX509_VERIFY_PARAM): TIdC_INT; cdecl = nil; {introduced 1.1.0} + X509_VERIFY_PARAM_get0_name: function (const param: PX509_VERIFY_PARAM): PIdAnsiChar; cdecl = nil; + + X509_VERIFY_PARAM_add0_table: function (param: PX509_VERIFY_PARAM): TIdC_INT; cdecl = nil; + X509_VERIFY_PARAM_get_count: function : TIdC_INT; cdecl = nil; + X509_VERIFY_PARAM_get0: function (id: TIdC_INT): PX509_VERIFY_PARAM; cdecl = nil; + X509_VERIFY_PARAM_lookup: function (const name: PIdAnsiChar): X509_VERIFY_PARAM; cdecl = nil; + X509_VERIFY_PARAM_table_cleanup: procedure ; cdecl = nil; + + //TIdC_INT X509_policy_check(X509_POLICY_TREE **ptree, TIdC_INT *pexplicit_policy, + // STACK_OF(X509) *certs, + // STACK_OF(ASN1_OBJECT) *policy_oids, TIdC_UINT flags); + + X509_policy_tree_free: procedure (tree: PX509_POLICY_TREE); cdecl = nil; + + X509_policy_tree_level_count: function (const tree: PX509_POLICY_TREE): TIdC_INT; cdecl = nil; + X509_policy_tree_get0_level: function (const tree: PX509_POLICY_TREE; i: TIdC_INT): PX509_POLICY_LEVEL; cdecl = nil; + + //STACK_OF(X509_POLICY_NODE) *X509_policy_tree_get0_policies(const + // X509_POLICY_TREE + // *tree); + // + //STACK_OF(X509_POLICY_NODE) *X509_policy_tree_get0_user_policies(const + // X509_POLICY_TREE + // *tree); + + X509_policy_level_node_count: function (level: PX509_POLICY_LEVEL): TIdC_INT; cdecl = nil; + + X509_policy_level_get0_node: function (level: PX509_POLICY_LEVEL; i: TIdC_INT): PX509_POLICY_NODE; cdecl = nil; + + X509_policy_node_get0_policy: function (const node: PX509_POLICY_NODE): PASN1_OBJECT; cdecl = nil; + + //STACK_OF(POLICYQUALINFO) *X509_policy_node_get0_qualifiers(const + // X509_POLICY_NODE + // *node); + X509_policy_node_get0_parent: function (const node: PX509_POLICY_NODE): PX509_POLICY_NODE; cdecl = nil; + +{$ELSE} + function X509_STORE_set_depth(store: PX509_STORE; depth: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + + procedure X509_STORE_CTX_set_depth(ctx: PX509_STORE_CTX; depth: TIdC_INT) cdecl; external CLibCrypto; + + //# define X509_STORE_CTX_set_app_data(ctx,data) \ + // X509_STORE_CTX_set_ex_data(ctx,0,data) + //# define X509_STORE_CTX_get_app_data(ctx) \ + // X509_STORE_CTX_get_ex_data(ctx,0) + // + //# define X509_LOOKUP_load_file(x,name,type) \ + // X509_LOOKUP_ctrl((x),X509_L_FILE_LOAD,(name),(TIdC_LONG)(type),NULL) + // + //# define X509_LOOKUP_add_dir(x,name,type) \ + // X509_LOOKUP_ctrl((x),X509_L_ADD_DIR,(name),(TIdC_LONG)(type),NULL) + // + //TIdC_INT X509_OBJECT_idx_by_subject(STACK_OF(X509_OBJECT) *h, X509_LOOKUP_TYPE type, + // X509_NAME *name); + //X509_OBJECT *X509_OBJECT_retrieve_by_subject(STACK_OF(X509_OBJECT) *h, + // X509_LOOKUP_TYPE type, + // X509_NAME *name); + //X509_OBJECT *X509_OBJECT_retrieve_match(STACK_OF(X509_OBJECT) *h, + // X509_OBJECT *x); + function X509_OBJECT_up_ref_count(a: PX509_OBJECT): TIdC_INT cdecl; external CLibCrypto; + function X509_OBJECT_new: PX509_OBJECT cdecl; external CLibCrypto; {introduced 1.1.0} + procedure X509_OBJECT_free(a: PX509_OBJECT) cdecl; external CLibCrypto; {introduced 1.1.0} + function X509_OBJECT_get_type(const a: PX509_OBJECT): X509_LOOKUP_TYPE cdecl; external CLibCrypto; {introduced 1.1.0} + function X509_OBJECT_get0_X509(const a: PX509_OBJECT): PX509 cdecl; external CLibCrypto; {introduced 1.1.0} + function X509_OBJECT_set1_X509(a: PX509_OBJECT; obj: PX509): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function X509_OBJECT_get0_X509_CRL(a: PX509_OBJECT): PX509_CRL cdecl; external CLibCrypto; {introduced 1.1.0} + function X509_OBJECT_set1_X509_CRL(a: PX509_OBJECT; obj: PX509_CRL): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function X509_STORE_new: PX509_STORE cdecl; external CLibCrypto; + procedure X509_STORE_free(v: PX509_STORE) cdecl; external CLibCrypto; + function X509_STORE_lock(ctx: PX509_STORE): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function X509_STORE_unlock(ctx: PX509_STORE): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function X509_STORE_up_ref(v: PX509_STORE): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + //STACK_OF(X509_OBJECT) *X509_STORE_get0_objects(X509_STORE *v); + + //STACK_OF(X509) *X509_STORE_CTX_get1_certs(X509_STORE_CTX *st, X509_NAME *nm); + //STACK_OF(X509_CRL) *X509_STORE_CTX_get1_crls(X509_STORE_CTX *st, X509_NAME *nm); + function X509_STORE_set_flags(ctx: PX509_STORE; flags: TIdC_ULONG): TIdC_INT cdecl; external CLibCrypto; + function X509_STORE_set_purpose(ctx: PX509_STORE; purpose: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function X509_STORE_set_trust(ctx: PX509_STORE; trust: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function X509_STORE_set1_param(ctx: PX509_STORE; pm: PX509_VERIFY_PARAM): TIdC_INT cdecl; external CLibCrypto; + function X509_STORE_get0_param(ctx: PX509_STORE): PX509_VERIFY_PARAM cdecl; external CLibCrypto; {introduced 1.1.0} + + procedure X509_STORE_set_verify(ctx: PX509_STORE; verify: X509_STORE_CTX_verify_fn) cdecl; external CLibCrypto; {introduced 1.1.0} + //#define X509_STORE_set_verify_func(ctx, func) \ + // X509_STORE_set_verify((ctx),(func)) + procedure X509_STORE_CTX_set_verify(ctx: PX509_STORE_CTX; verify: X509_STORE_CTX_verify_fn) cdecl; external CLibCrypto; {introduced 1.1.0} + function X509_STORE_get_verify(ctx: PX509_STORE): X509_STORE_CTX_verify_fn cdecl; external CLibCrypto; {introduced 1.1.0} + procedure X509_STORE_set_verify_cb(ctx: PX509_STORE; verify_cb: X509_STORE_CTX_verify_cb) cdecl; external CLibCrypto; + //# define X509_STORE_set_verify_cb_func(ctx,func) \ + // X509_STORE_set_verify_cb((ctx),(func)) + function X509_STORE_get_verify_cb(ctx: PX509_STORE): X509_STORE_CTX_verify_cb cdecl; external CLibCrypto; {introduced 1.1.0} + procedure X509_STORE_set_get_issuer(ctx: PX509_STORE; get_issuer: X509_STORE_CTX_get_issuer_fn) cdecl; external CLibCrypto; {introduced 1.1.0} + function X509_STORE_get_get_issuer(ctx: PX509_STORE): X509_STORE_CTX_get_issuer_fn cdecl; external CLibCrypto; {introduced 1.1.0} + procedure X509_STORE_set_check_issued(ctx: PX509_STORE; check_issued: X509_STORE_CTX_check_issued_fn) cdecl; external CLibCrypto; {introduced 1.1.0} + function X509_STORE_get_check_issued(ctx: PX509_STORE): X509_STORE_CTX_check_issued_fn cdecl; external CLibCrypto; {introduced 1.1.0} + procedure X509_STORE_set_check_revocation(ctx: PX509_STORE; check_revocation: X509_STORE_CTX_check_revocation_fn) cdecl; external CLibCrypto; {introduced 1.1.0} + function X509_STORE_get_check_revocation(ctx: PX509_STORE): X509_STORE_CTX_check_revocation_fn cdecl; external CLibCrypto; {introduced 1.1.0} + procedure X509_STORE_set_get_crl(ctx: PX509_STORE; get_crl: X509_STORE_CTX_get_crl_fn) cdecl; external CLibCrypto; {introduced 1.1.0} + function X509_STORE_get_get_crl(ctx: PX509_STORE): X509_STORE_CTX_get_crl_fn cdecl; external CLibCrypto; {introduced 1.1.0} + procedure X509_STORE_set_check_crl(ctx: PX509_STORE; check_crl: X509_STORE_CTX_check_crl_fn) cdecl; external CLibCrypto; {introduced 1.1.0} + function X509_STORE_get_check_crl(ctx: PX509_STORE): X509_STORE_CTX_check_crl_fn cdecl; external CLibCrypto; {introduced 1.1.0} + procedure X509_STORE_set_cert_crl(ctx: PX509_STORE; cert_crl: X509_STORE_CTX_cert_crl_fn) cdecl; external CLibCrypto; {introduced 1.1.0} + function X509_STORE_get_cert_crl(ctx: PX509_STORE): X509_STORE_CTX_cert_crl_fn cdecl; external CLibCrypto; {introduced 1.1.0} + procedure X509_STORE_set_check_policy(ctx: PX509_STORE; check_policy: X509_STORE_CTX_check_policy_fn) cdecl; external CLibCrypto; {introduced 1.1.0} + function X509_STORE_get_check_policy(ctx: PX509_STORE): X509_STORE_CTX_check_policy_fn cdecl; external CLibCrypto; {introduced 1.1.0} +// procedure X509_STORE_set_lookup_certs(ctx: PX509_STORE; lookup_certs: X509_STORE_CTX_lookup_certs_fn); +// function X509_STORE_get_lookup_certs(ctx: PX509_STORE): X509_STORE_CTX_lookup_certs_fn; +// procedure X509_STORE_set_lookup_crls(ctx: PX509_STORE; lookup_crls: X509_STORE_CTX_lookup_crls_fn); +// #define X509_STORE_set_lookup_crls_cb(ctx, func) \ +// X509_STORE_set_lookup_crls((ctx), (func)) +// function X509_STORE_get_lookup_crls(ctx: PX509_STORE): X509_STORE_CTX_lookup_crls_fn; + procedure X509_STORE_set_cleanup(ctx: PX509_STORE; cleanup: X509_STORE_CTX_cleanup_fn) cdecl; external CLibCrypto; {introduced 1.1.0} + function X509_STORE_get_cleanup(ctx: PX509_STORE): X509_STORE_CTX_cleanup_fn cdecl; external CLibCrypto; {introduced 1.1.0} + + //#define X509_STORE_get_ex_new_index(l, p, newf, dupf, freef) \ + // CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_X509_STORE, l, p, newf, dupf, freef) + function X509_STORE_set_ex_data(ctx: PX509_STORE; idx: TIdC_INT; data: Pointer): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function X509_STORE_get_ex_data(ctx: PX509_STORE; idx: TIdC_INT): Pointer cdecl; external CLibCrypto; {introduced 1.1.0} + + function X509_STORE_CTX_new: PX509_STORE_CTX cdecl; external CLibCrypto; + + function X509_STORE_CTX_get1_issuer(issuer: PPX509; ctx: PX509_STORE_CTX; x: PX509): TIdC_INT cdecl; external CLibCrypto; + + procedure X509_STORE_CTX_free(ctx: PX509_STORE_CTX) cdecl; external CLibCrypto; +// TIdC_INT X509_STORE_CTX_init(ctx: PX509_STORE_CTX; store: PX509_STORE; x509: PX509; chain: P STACK_OF(X509)); +// procedure X509_STORE_CTX_set0_trusted_stack(ctx: PX509_STORE_CTX; sk: P STACK_OF(X509)); + procedure X509_STORE_CTX_cleanup(ctx: PX509_STORE_CTX) cdecl; external CLibCrypto; + + function X509_STORE_CTX_get0_store(ctx: PX509_STORE_CTX): PX509_STORE cdecl; external CLibCrypto; + function X509_STORE_CTX_get0_cert(ctx: PX509_STORE_CTX): PX509 cdecl; external CLibCrypto; {introduced 1.1.0} + //STACK_OF(X509)* X509_STORE_CTX_get0_untrusted(X509_STORE_CTX *ctx); + //void X509_STORE_CTX_set0_untrusted(X509_STORE_CTX *ctx, STACK_OF(X509) *sk); + procedure X509_STORE_CTX_set_verify_cb(ctx: PX509_STORE_CTX; verify: X509_STORE_CTX_verify_cb) cdecl; external CLibCrypto; + function X509_STORE_CTX_get_verify_cb(ctx: PX509_STORE_CTX): X509_STORE_CTX_verify_cb cdecl; external CLibCrypto; {introduced 1.1.0} + function X509_STORE_CTX_get_verify(ctx: PX509_STORE_CTX): X509_STORE_CTX_verify_fn cdecl; external CLibCrypto; {introduced 1.1.0} + function X509_STORE_CTX_get_get_issuer(ctx: PX509_STORE_CTX): X509_STORE_CTX_get_issuer_fn cdecl; external CLibCrypto; {introduced 1.1.0} + function X509_STORE_CTX_get_check_issued(ctx: PX509_STORE_CTX): X509_STORE_CTX_check_issued_fn cdecl; external CLibCrypto; {introduced 1.1.0} + function X509_STORE_CTX_get_check_revocation(ctx: PX509_STORE_CTX): X509_STORE_CTX_check_revocation_fn cdecl; external CLibCrypto; {introduced 1.1.0} + function X509_STORE_CTX_get_get_crl(ctx: PX509_STORE_CTX): X509_STORE_CTX_get_crl_fn cdecl; external CLibCrypto; {introduced 1.1.0} + function X509_STORE_CTX_get_check_crl(ctx: PX509_STORE_CTX): X509_STORE_CTX_check_crl_fn cdecl; external CLibCrypto; {introduced 1.1.0} + function X509_STORE_CTX_get_cert_crl(ctx: PX509_STORE_CTX): X509_STORE_CTX_cert_crl_fn cdecl; external CLibCrypto; {introduced 1.1.0} + function X509_STORE_CTX_get_check_policy(ctx: PX509_STORE_CTX): X509_STORE_CTX_check_policy_fn cdecl; external CLibCrypto; {introduced 1.1.0} +// function X509_STORE_CTX_get_lookup_certs(ctx: PX509_STORE_CTX): X509_STORE_CTX_lookup_certs_fn; +// function X509_STORE_CTX_get_lookup_crls(ctx: PX509_STORE_CTX): X509_STORE_CTX_lookup_crls_fn; + function X509_STORE_CTX_get_cleanup(ctx: PX509_STORE_CTX): X509_STORE_CTX_cleanup_fn cdecl; external CLibCrypto; {introduced 1.1.0} + + function X509_STORE_add_lookup(v: PX509_STORE; m: PX509_LOOKUP_METHOD): PX509_LOOKUP cdecl; external CLibCrypto; + function X509_LOOKUP_hash_dir: PX509_LOOKUP_METHOD cdecl; external CLibCrypto; + function X509_LOOKUP_file: PX509_LOOKUP_METHOD cdecl; external CLibCrypto; + + function X509_LOOKUP_meth_new(const name: PIdAnsiChar): PX509_LOOKUP_METHOD cdecl; external CLibCrypto; {introduced 1.1.0} + procedure X509_LOOKUP_meth_free(method: PX509_LOOKUP_METHOD) cdecl; external CLibCrypto; {introduced 1.1.0} + + //TIdC_INT X509_LOOKUP_meth_set_new_item(X509_LOOKUP_METHOD *method, + // TIdC_INT (*new_item) (X509_LOOKUP *ctx)); + //TIdC_INT (*X509_LOOKUP_meth_get_new_item(const X509_LOOKUP_METHOD* method)) + // (X509_LOOKUP *ctx); + // + //TIdC_INT X509_LOOKUP_meth_set_free(X509_LOOKUP_METHOD *method, + // void (*free_fn) (X509_LOOKUP *ctx)); + //void (*X509_LOOKUP_meth_get_free(const X509_LOOKUP_METHOD* method)) + // (X509_LOOKUP *ctx); + // + //TIdC_INT X509_LOOKUP_meth_set_init(X509_LOOKUP_METHOD *method, + // TIdC_INT (*init) (X509_LOOKUP *ctx)); + //TIdC_INT (*X509_LOOKUP_meth_get_init(const X509_LOOKUP_METHOD* method)) + // (X509_LOOKUP *ctx); + // + //TIdC_INT X509_LOOKUP_meth_set_shutdown(X509_LOOKUP_METHOD *method, + // TIdC_INT (*shutdown) (X509_LOOKUP *ctx)); + //TIdC_INT (*X509_LOOKUP_meth_get_shutdown(const X509_LOOKUP_METHOD* method)) + // (X509_LOOKUP *ctx); + + function X509_LOOKUP_meth_set_ctrl(method: PX509_LOOKUP_METHOD; ctrl_fn: X509_LOOKUP_ctrl_fn): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function X509_LOOKUP_meth_get_ctrl(const method: PX509_LOOKUP_METHOD): X509_LOOKUP_ctrl_fn cdecl; external CLibCrypto; {introduced 1.1.0} + + function X509_LOOKUP_meth_set_get_by_subject(method: PX509_LOOKUP_METHOD; fn: X509_LOOKUP_get_by_subject_fn): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function X509_LOOKUP_meth_get_get_by_subject(const method: PX509_LOOKUP_METHOD): X509_LOOKUP_get_by_subject_fn cdecl; external CLibCrypto; {introduced 1.1.0} + + function X509_LOOKUP_meth_set_get_by_issuer_serial(method: PX509_LOOKUP_METHOD; fn: X509_LOOKUP_get_by_issuer_serial_fn): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function X509_LOOKUP_meth_get_get_by_issuer_serial(const method: PX509_LOOKUP_METHOD): X509_LOOKUP_get_by_issuer_serial_fn cdecl; external CLibCrypto; {introduced 1.1.0} + + function X509_LOOKUP_meth_set_get_by_fingerprint(method: PX509_LOOKUP_METHOD; fn: X509_LOOKUP_get_by_fingerprint_fn): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function X509_LOOKUP_meth_get_get_by_fingerprint(const method: PX509_LOOKUP_METHOD): X509_LOOKUP_get_by_fingerprint_fn cdecl; external CLibCrypto; {introduced 1.1.0} + + function X509_LOOKUP_meth_set_get_by_alias(method: PX509_LOOKUP_METHOD; fn: X509_LOOKUP_get_by_alias_fn): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function X509_LOOKUP_meth_get_get_by_alias(const method: PX509_LOOKUP_METHOD): X509_LOOKUP_get_by_alias_fn cdecl; external CLibCrypto; {introduced 1.1.0} + + function X509_STORE_add_cert(ctx: PX509_STORE; x: PX509): TIdC_INT cdecl; external CLibCrypto; + function X509_STORE_add_crl(ctx: PX509_STORE; x: PX509_CRL): TIdC_INT cdecl; external CLibCrypto; + + function X509_STORE_CTX_get_by_subject(vs: PX509_STORE_CTX; type_: X509_LOOKUP_TYPE; name: PX509_NAME; ret: PX509_OBJECT): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function X509_STORE_CTX_get_obj_by_subject(vs: PX509_STORE_CTX; type_: X509_LOOKUP_TYPE; name: PX509_NAME): PX509_OBJECT cdecl; external CLibCrypto; {introduced 1.1.0} + + function X509_LOOKUP_ctrl(ctx: PX509_LOOKUP; cmd: TIdC_INT; const argc: PIdAnsiChar; argl: TIdC_LONG; ret: PPIdAnsiChar): TIdC_INT cdecl; external CLibCrypto; + + function X509_load_cert_file(ctx: PX509_LOOKUP; const file_: PIdAnsiChar; type_: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function X509_load_crl_file(ctx: PX509_LOOKUP; const file_: PIdAnsiChar; type_: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function X509_load_cert_crl_file(ctx: PX509_LOOKUP; const file_: PIdAnsiChar; type_: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + + function X509_LOOKUP_new(method: PX509_LOOKUP_METHOD): PX509_LOOKUP cdecl; external CLibCrypto; + procedure X509_LOOKUP_free(ctx: PX509_LOOKUP) cdecl; external CLibCrypto; + function X509_LOOKUP_init(ctx: PX509_LOOKUP): TIdC_INT cdecl; external CLibCrypto; + function X509_LOOKUP_by_subject(ctx: PX509_LOOKUP; type_: X509_LOOKUP_TYPE; name: PX509_NAME; ret: PX509_OBJECT): TIdC_INT cdecl; external CLibCrypto; + function X509_LOOKUP_by_issuer_serial(ctx: PX509_LOOKUP; type_: X509_LOOKUP_TYPE; name: PX509_NAME; serial: PASN1_INTEGER; ret: PX509_OBJECT): TIdC_INT cdecl; external CLibCrypto; + function X509_LOOKUP_by_fingerprint(ctx: PX509_LOOKUP; type_: X509_LOOKUP_TYPE; const bytes: PByte; len: TIdC_INT; ret: PX509_OBJECT): TIdC_INT cdecl; external CLibCrypto; + function X509_LOOKUP_by_alias(ctx: PX509_LOOKUP; type_: X509_LOOKUP_TYPE; const str: PIdAnsiChar; len: TIdC_INT; ret: PX509_OBJECT): TIdC_INT cdecl; external CLibCrypto; + function X509_LOOKUP_set_method_data(ctx: PX509_LOOKUP; data: Pointer): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function X509_LOOKUP_get_method_data(const ctx: PX509_LOOKUP): Pointer cdecl; external CLibCrypto; {introduced 1.1.0} + function X509_LOOKUP_get_store(const ctx: PX509_LOOKUP): PX509_STORE cdecl; external CLibCrypto; {introduced 1.1.0} + function X509_LOOKUP_shutdown(ctx: PX509_LOOKUP): TIdC_INT cdecl; external CLibCrypto; + + function X509_STORE_load_locations(ctx: PX509_STORE; const file_: PIdAnsiChar; const dir: PIdAnsiChar): TIdC_INT cdecl; external CLibCrypto; + function X509_STORE_set_default_paths(ctx: PX509_STORE): TIdC_INT cdecl; external CLibCrypto; + + //#define X509_STORE_CTX_get_ex_new_index(l, p, newf, dupf, freef) \ + // CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_X509_STORE_CTX, l, p, newf, dupf, freef) + function X509_STORE_CTX_set_ex_data(ctx: PX509_STORE_CTX; idx: TIdC_INT; data: Pointer): TIdC_INT cdecl; external CLibCrypto; + function X509_STORE_CTX_get_ex_data(ctx: PX509_STORE_CTX; idx: TIdC_INT): Pointer cdecl; external CLibCrypto; + function X509_STORE_CTX_get_error(ctx: PX509_STORE_CTX): TIdC_INT cdecl; external CLibCrypto; + procedure X509_STORE_CTX_set_error(ctx: X509_STORE_CTX; s: TIdC_INT) cdecl; external CLibCrypto; + function X509_STORE_CTX_get_error_depth(ctx: PX509_STORE_CTX): TIdC_INT cdecl; external CLibCrypto; + procedure X509_STORE_CTX_set_error_depth(ctx: PX509_STORE_CTX; depth: TIdC_INT) cdecl; external CLibCrypto; {introduced 1.1.0} + function X509_STORE_CTX_get_current_cert(ctx: PX509_STORE_CTX): PX509 cdecl; external CLibCrypto; + procedure X509_STORE_CTX_set_current_cert(ctx: PX509_STORE_CTX; x: PX509) cdecl; external CLibCrypto; {introduced 1.1.0} + function X509_STORE_CTX_get0_current_issuer(ctx: PX509_STORE_CTX): PX509 cdecl; external CLibCrypto; + function X509_STORE_CTX_get0_current_crl(ctx: PX509_STORE_CTX): PX509_CRL cdecl; external CLibCrypto; + function X509_STORE_CTX_get0_parent_ctx(ctx: PX509_STORE_CTX): PX509_STORE_CTX cdecl; external CLibCrypto; +// STACK_OF(X509) *X509_STORE_CTX_get0_chain(X509_STORE_CTX *ctx); +// STACK_OF(X509) *X509_STORE_CTX_get1_chain(X509_STORE_CTX *ctx); + procedure X509_STORE_CTX_set_cert(c: PX509_STORE_CTX; x: PX509) cdecl; external CLibCrypto; +// void X509_STORE_CTX_set0_verified_chain(X509_STORE_CTX *c, STACK_OF(X509) *sk); +// void X509_STORE_CTX_set0_crls(X509_STORE_CTX *c, STACK_OF(X509_CRL) *sk); + function X509_STORE_CTX_set_purpose(ctx: PX509_STORE_CTX; purpose: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function X509_STORE_CTX_set_trust(ctx: PX509_STORE_CTX; trust: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function X509_STORE_CTX_purpose_inherit(ctx: PX509_STORE_CTX; def_purpose: TIdC_INT; purpose: TIdC_INT; trust: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + procedure X509_STORE_CTX_set_flags(ctx: PX509_STORE_CTX; flags: TIdC_ULONG) cdecl; external CLibCrypto; +// procedure X509_STORE_CTX_set_time(ctx: PX509_STORE_CTX; flags: TIdC_ULONG; t: TIdC_TIMET); + + function X509_STORE_CTX_get0_policy_tree(ctx: PX509_STORE_CTX): PX509_POLICY_TREE cdecl; external CLibCrypto; + function X509_STORE_CTX_get_explicit_policy(ctx: PX509_STORE_CTX): TIdC_INT cdecl; external CLibCrypto; + function X509_STORE_CTX_get_num_untrusted(ctx: PX509_STORE_CTX): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + + function X509_STORE_CTX_get0_param(ctx: PX509_STORE_CTX): PX509_VERIFY_PARAM cdecl; external CLibCrypto; + procedure X509_STORE_CTX_set0_param(ctx: PX509_STORE_CTX; param: PX509_VERIFY_PARAM) cdecl; external CLibCrypto; + function X509_STORE_CTX_set_default(ctx: PX509_STORE_CTX; const name: PIdAnsiChar): TIdC_INT cdecl; external CLibCrypto; + + (* + * Bridge opacity barrier between libcrypt and libssl, also needed to support + * offline testing in test/danetest.c + *) + procedure X509_STORE_CTX_set0_dane(ctx: PX509_STORE_CTX; dane: PSSL_DANE) cdecl; external CLibCrypto; {introduced 1.1.0} + + (* X509_VERIFY_PARAM functions *) + + function X509_VERIFY_PARAM_new: PX509_VERIFY_PARAM cdecl; external CLibCrypto; + procedure X509_VERIFY_PARAM_free(param: PX509_VERIFY_PARAM) cdecl; external CLibCrypto; + function X509_VERIFY_PARAM_inherit(to_: PX509_VERIFY_PARAM; const from: PX509_VERIFY_PARAM): TIdC_INT cdecl; external CLibCrypto; + function X509_VERIFY_PARAM_set1(to_: PX509_VERIFY_PARAM; const from: PX509_VERIFY_PARAM): TIdC_INT cdecl; external CLibCrypto; + function X509_VERIFY_PARAM_set1_name(param: PX509_VERIFY_PARAM; const name: PIdAnsiChar): TIdC_INT cdecl; external CLibCrypto; + function X509_VERIFY_PARAM_set_flags(param: PX509_VERIFY_PARAM; flags: TIdC_ULONG): TIdC_INT cdecl; external CLibCrypto; + function X509_VERIFY_PARAM_clear_flags(param: PX509_VERIFY_PARAM; flags: TIdC_ULONG): TIdC_INT cdecl; external CLibCrypto; + function X509_VERIFY_PARAM_get_flags(param: PX509_VERIFY_PARAM): TIdC_ULONG cdecl; external CLibCrypto; + function X509_VERIFY_PARAM_set_purpose(param: PX509_VERIFY_PARAM; purpose: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function X509_VERIFY_PARAM_set_trust(param: PX509_VERIFY_PARAM; trust: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + procedure X509_VERIFY_PARAM_set_depth(param: PX509_VERIFY_PARAM; depth: TIdC_INT) cdecl; external CLibCrypto; + procedure X509_VERIFY_PARAM_set_auth_level(param: PX509_VERIFY_PARAM; auth_level: TIdC_INT) cdecl; external CLibCrypto; {introduced 1.1.0} +// function X509_VERIFY_PARAM_get_time(const param: PX509_VERIFY_PARAM): TIdC_TIMET; +// procedure X509_VERIFY_PARAM_set_time(param: PX509_VERIFY_PARAM; t: TIdC_TIMET); + function X509_VERIFY_PARAM_add0_policy(param: PX509_VERIFY_PARAM; policy: PASN1_OBJECT): TIdC_INT cdecl; external CLibCrypto; + //TIdC_INT X509_VERIFY_PARAM_set1_policies(X509_VERIFY_PARAM *param, + // STACK_OF(ASN1_OBJECT) *policies); + + function X509_VERIFY_PARAM_set_inh_flags(param: PX509_VERIFY_PARAM; flags: TIdC_UINT32): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function X509_VERIFY_PARAM_get_inh_flags(const param: PX509_VERIFY_PARAM): TIdC_UINT32 cdecl; external CLibCrypto; {introduced 1.1.0} + + function X509_VERIFY_PARAM_set1_host(param: PX509_VERIFY_PARAM; const name: PIdAnsiChar; namelen: TIdC_SIZET): TIdC_INT cdecl; external CLibCrypto; + function X509_VERIFY_PARAM_add1_host(param: PX509_VERIFY_PARAM; const name: PIdAnsiChar; namelen: TIdC_SIZET): TIdC_INT cdecl; external CLibCrypto; + procedure X509_VERIFY_PARAM_set_hostflags(param: PX509_VERIFY_PARAM; flags: TIdC_UINT) cdecl; external CLibCrypto; + function X509_VERIFY_PARAM_get_hostflags(const param: PX509_VERIFY_PARAM): TIdC_UINT cdecl; external CLibCrypto; {introduced 1.1.0} + function X509_VERIFY_PARAM_get0_peername(v1: PX509_VERIFY_PARAM): PIdAnsiChar cdecl; external CLibCrypto; + procedure X509_VERIFY_PARAM_move_peername(v1: PX509_VERIFY_PARAM; v2: PX509_VERIFY_PARAM) cdecl; external CLibCrypto; {introduced 1.1.0} + function X509_VERIFY_PARAM_set1_email(param: PX509_VERIFY_PARAM; const email: PIdAnsiChar; emaillen: TIdC_SIZET): TIdC_INT cdecl; external CLibCrypto; + function X509_VERIFY_PARAM_set1_ip(param: PX509_VERIFY_PARAM; const ip: PByte; iplen: TIdC_SIZET): TIdC_INT cdecl; external CLibCrypto; + function X509_VERIFY_PARAM_set1_ip_asc(param: PX509_VERIFY_PARAM; const ipasc: PIdAnsiChar): TIdC_INT cdecl; external CLibCrypto; + + function X509_VERIFY_PARAM_get_depth(const param: PX509_VERIFY_PARAM): TIdC_INT cdecl; external CLibCrypto; + function X509_VERIFY_PARAM_get_auth_level(const param: PX509_VERIFY_PARAM): TIdC_INT cdecl; external CLibCrypto; {introduced 1.1.0} + function X509_VERIFY_PARAM_get0_name(const param: PX509_VERIFY_PARAM): PIdAnsiChar cdecl; external CLibCrypto; + + function X509_VERIFY_PARAM_add0_table(param: PX509_VERIFY_PARAM): TIdC_INT cdecl; external CLibCrypto; + function X509_VERIFY_PARAM_get_count: TIdC_INT cdecl; external CLibCrypto; + function X509_VERIFY_PARAM_get0(id: TIdC_INT): PX509_VERIFY_PARAM cdecl; external CLibCrypto; + function X509_VERIFY_PARAM_lookup(const name: PIdAnsiChar): X509_VERIFY_PARAM cdecl; external CLibCrypto; + procedure X509_VERIFY_PARAM_table_cleanup cdecl; external CLibCrypto; + + //TIdC_INT X509_policy_check(X509_POLICY_TREE **ptree, TIdC_INT *pexplicit_policy, + // STACK_OF(X509) *certs, + // STACK_OF(ASN1_OBJECT) *policy_oids, TIdC_UINT flags); + + procedure X509_policy_tree_free(tree: PX509_POLICY_TREE) cdecl; external CLibCrypto; + + function X509_policy_tree_level_count(const tree: PX509_POLICY_TREE): TIdC_INT cdecl; external CLibCrypto; + function X509_policy_tree_get0_level(const tree: PX509_POLICY_TREE; i: TIdC_INT): PX509_POLICY_LEVEL cdecl; external CLibCrypto; + + //STACK_OF(X509_POLICY_NODE) *X509_policy_tree_get0_policies(const + // X509_POLICY_TREE + // *tree); + // + //STACK_OF(X509_POLICY_NODE) *X509_policy_tree_get0_user_policies(const + // X509_POLICY_TREE + // *tree); + + function X509_policy_level_node_count(level: PX509_POLICY_LEVEL): TIdC_INT cdecl; external CLibCrypto; + + function X509_policy_level_get0_node(level: PX509_POLICY_LEVEL; i: TIdC_INT): PX509_POLICY_NODE cdecl; external CLibCrypto; + + function X509_policy_node_get0_policy(const node: PX509_POLICY_NODE): PASN1_OBJECT cdecl; external CLibCrypto; + + //STACK_OF(POLICYQUALINFO) *X509_policy_node_get0_qualifiers(const + // X509_POLICY_NODE + // *node); + function X509_policy_node_get0_parent(const node: PX509_POLICY_NODE): PX509_POLICY_NODE cdecl; external CLibCrypto; + +function X509_STORE_CTX_get_app_data(ctx: PX509_STORE_CTX): Pointer; {removed 1.0.0} +{$ENDIF} + +implementation + + uses + classes, + IdSSLOpenSSLExceptionHandlers, + IdResourceStringsOpenSSL + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + ,IdSSLOpenSSLLoader + {$ENDIF}; + +const + X509_OBJECT_new_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_OBJECT_free_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_OBJECT_get_type_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_OBJECT_get0_X509_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_OBJECT_set1_X509_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_OBJECT_get0_X509_CRL_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_OBJECT_set1_X509_CRL_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_STORE_lock_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_STORE_unlock_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_STORE_up_ref_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_STORE_get0_param_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_STORE_set_verify_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_STORE_CTX_set_verify_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_STORE_get_verify_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_STORE_get_verify_cb_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_STORE_set_get_issuer_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_STORE_get_get_issuer_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_STORE_set_check_issued_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_STORE_get_check_issued_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_STORE_set_check_revocation_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_STORE_get_check_revocation_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_STORE_set_get_crl_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_STORE_get_get_crl_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_STORE_set_check_crl_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_STORE_get_check_crl_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_STORE_set_cert_crl_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_STORE_get_cert_crl_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_STORE_set_check_policy_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_STORE_get_check_policy_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_STORE_set_cleanup_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_STORE_get_cleanup_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_STORE_set_ex_data_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_STORE_get_ex_data_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_STORE_CTX_get0_cert_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_STORE_CTX_get_verify_cb_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_STORE_CTX_get_verify_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_STORE_CTX_get_get_issuer_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_STORE_CTX_get_check_issued_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_STORE_CTX_get_check_revocation_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_STORE_CTX_get_get_crl_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_STORE_CTX_get_check_crl_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_STORE_CTX_get_cert_crl_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_STORE_CTX_get_check_policy_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_STORE_CTX_get_cleanup_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_LOOKUP_meth_new_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_LOOKUP_meth_free_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_LOOKUP_meth_set_ctrl_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_LOOKUP_meth_get_ctrl_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_LOOKUP_meth_set_get_by_subject_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_LOOKUP_meth_get_get_by_subject_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_LOOKUP_meth_set_get_by_issuer_serial_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_LOOKUP_meth_get_get_by_issuer_serial_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_LOOKUP_meth_set_get_by_fingerprint_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_LOOKUP_meth_get_get_by_fingerprint_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_LOOKUP_meth_set_get_by_alias_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_LOOKUP_meth_get_get_by_alias_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_STORE_CTX_get_by_subject_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_STORE_CTX_get_obj_by_subject_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_LOOKUP_set_method_data_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_LOOKUP_get_method_data_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_LOOKUP_get_store_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_STORE_CTX_set_error_depth_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_STORE_CTX_set_current_cert_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_STORE_CTX_get_num_untrusted_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_STORE_CTX_set0_dane_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_VERIFY_PARAM_set_auth_level_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_VERIFY_PARAM_set_inh_flags_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_VERIFY_PARAM_get_inh_flags_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_VERIFY_PARAM_get_hostflags_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_VERIFY_PARAM_move_peername_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_VERIFY_PARAM_get_auth_level_introduced = (byte(1) shl 8 or byte(1)) shl 8 or byte(0); + X509_STORE_CTX_get_app_data_removed = (byte(1) shl 8 or byte(0)) shl 8 or byte(0); + +{helper_functions} +function X509_LOOKUP_load_file(ctx: PX509_LOOKUP; name: PIdAnsiChar; type_: TIdC_LONG): TIdC_INT; +begin + Result := X509_LOOKUP_ctrl(ctx,X509_L_FILE_LOAD,name,type_,nil); +end; +{\helper_functions} + + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +const + X509_STORE_set_depth_procname = 'X509_STORE_set_depth'; + + X509_STORE_CTX_set_depth_procname = 'X509_STORE_CTX_set_depth'; + + //# define X509_STORE_CTX_set_app_data(ctx,data) \ + // X509_STORE_CTX_set_ex_data(ctx,0,data) + //# define X509_STORE_CTX_get_app_data(ctx) \ + // X509_STORE_CTX_get_ex_data(ctx,0) + X509_STORE_CTX_get_app_data_procname = 'X509_STORE_CTX_get_app_data'; {removed 1.0.0} + // + //# define X509_LOOKUP_load_file(x,name,type) \ + // X509_LOOKUP_ctrl((x),X509_L_FILE_LOAD,(name),(TIdC_LONG)(type),NULL) + // + //# define X509_LOOKUP_add_dir(x,name,type) \ + // X509_LOOKUP_ctrl((x),X509_L_ADD_DIR,(name),(TIdC_LONG)(type),NULL) + // + //TIdC_INT X509_OBJECT_idx_by_subject(STACK_OF(X509_OBJECT) *h, X509_LOOKUP_TYPE type, + // X509_NAME *name); + //X509_OBJECT *X509_OBJECT_retrieve_by_subject(STACK_OF(X509_OBJECT) *h, + // X509_LOOKUP_TYPE type, + // X509_NAME *name); + //X509_OBJECT *X509_OBJECT_retrieve_match(STACK_OF(X509_OBJECT) *h, + // X509_OBJECT *x); + X509_OBJECT_up_ref_count_procname = 'X509_OBJECT_up_ref_count'; + X509_OBJECT_new_procname = 'X509_OBJECT_new'; {introduced 1.1.0} + X509_OBJECT_free_procname = 'X509_OBJECT_free'; {introduced 1.1.0} + X509_OBJECT_get_type_procname = 'X509_OBJECT_get_type'; {introduced 1.1.0} + X509_OBJECT_get0_X509_procname = 'X509_OBJECT_get0_X509'; {introduced 1.1.0} + X509_OBJECT_set1_X509_procname = 'X509_OBJECT_set1_X509'; {introduced 1.1.0} + X509_OBJECT_get0_X509_CRL_procname = 'X509_OBJECT_get0_X509_CRL'; {introduced 1.1.0} + X509_OBJECT_set1_X509_CRL_procname = 'X509_OBJECT_set1_X509_CRL'; {introduced 1.1.0} + X509_STORE_new_procname = 'X509_STORE_new'; + X509_STORE_free_procname = 'X509_STORE_free'; + X509_STORE_lock_procname = 'X509_STORE_lock'; {introduced 1.1.0} + X509_STORE_unlock_procname = 'X509_STORE_unlock'; {introduced 1.1.0} + X509_STORE_up_ref_procname = 'X509_STORE_up_ref'; {introduced 1.1.0} + //STACK_OF(X509_OBJECT) *X509_STORE_get0_objects(X509_STORE *v); + + //STACK_OF(X509) *X509_STORE_CTX_get1_certs(X509_STORE_CTX *st, X509_NAME *nm); + //STACK_OF(X509_CRL) *X509_STORE_CTX_get1_crls(X509_STORE_CTX *st, X509_NAME *nm); + X509_STORE_set_flags_procname = 'X509_STORE_set_flags'; + X509_STORE_set_purpose_procname = 'X509_STORE_set_purpose'; + X509_STORE_set_trust_procname = 'X509_STORE_set_trust'; + X509_STORE_set1_param_procname = 'X509_STORE_set1_param'; + X509_STORE_get0_param_procname = 'X509_STORE_get0_param'; {introduced 1.1.0} + + X509_STORE_set_verify_procname = 'X509_STORE_set_verify'; {introduced 1.1.0} + //#define X509_STORE_set_verify_func(ctx, func) \ + // X509_STORE_set_verify((ctx),(func)) + X509_STORE_CTX_set_verify_procname = 'X509_STORE_CTX_set_verify'; {introduced 1.1.0} + X509_STORE_get_verify_procname = 'X509_STORE_get_verify'; {introduced 1.1.0} + X509_STORE_set_verify_cb_procname = 'X509_STORE_set_verify_cb'; + //# define X509_STORE_set_verify_cb_func(ctx,func) \ + // X509_STORE_set_verify_cb((ctx),(func)) + X509_STORE_get_verify_cb_procname = 'X509_STORE_get_verify_cb'; {introduced 1.1.0} + X509_STORE_set_get_issuer_procname = 'X509_STORE_set_get_issuer'; {introduced 1.1.0} + X509_STORE_get_get_issuer_procname = 'X509_STORE_get_get_issuer'; {introduced 1.1.0} + X509_STORE_set_check_issued_procname = 'X509_STORE_set_check_issued'; {introduced 1.1.0} + X509_STORE_get_check_issued_procname = 'X509_STORE_get_check_issued'; {introduced 1.1.0} + X509_STORE_set_check_revocation_procname = 'X509_STORE_set_check_revocation'; {introduced 1.1.0} + X509_STORE_get_check_revocation_procname = 'X509_STORE_get_check_revocation'; {introduced 1.1.0} + X509_STORE_set_get_crl_procname = 'X509_STORE_set_get_crl'; {introduced 1.1.0} + X509_STORE_get_get_crl_procname = 'X509_STORE_get_get_crl'; {introduced 1.1.0} + X509_STORE_set_check_crl_procname = 'X509_STORE_set_check_crl'; {introduced 1.1.0} + X509_STORE_get_check_crl_procname = 'X509_STORE_get_check_crl'; {introduced 1.1.0} + X509_STORE_set_cert_crl_procname = 'X509_STORE_set_cert_crl'; {introduced 1.1.0} + X509_STORE_get_cert_crl_procname = 'X509_STORE_get_cert_crl'; {introduced 1.1.0} + X509_STORE_set_check_policy_procname = 'X509_STORE_set_check_policy'; {introduced 1.1.0} + X509_STORE_get_check_policy_procname = 'X509_STORE_get_check_policy'; {introduced 1.1.0} +// procedure X509_STORE_set_lookup_certs(ctx: PX509_STORE; lookup_certs: X509_STORE_CTX_lookup_certs_fn); +// function X509_STORE_get_lookup_certs(ctx: PX509_STORE): X509_STORE_CTX_lookup_certs_fn; +// procedure X509_STORE_set_lookup_crls(ctx: PX509_STORE; lookup_crls: X509_STORE_CTX_lookup_crls_fn); +// #define X509_STORE_set_lookup_crls_cb(ctx, func) \ +// X509_STORE_set_lookup_crls((ctx), (func)) +// function X509_STORE_get_lookup_crls(ctx: PX509_STORE): X509_STORE_CTX_lookup_crls_fn; + X509_STORE_set_cleanup_procname = 'X509_STORE_set_cleanup'; {introduced 1.1.0} + X509_STORE_get_cleanup_procname = 'X509_STORE_get_cleanup'; {introduced 1.1.0} + + //#define X509_STORE_get_ex_new_index(l, p, newf, dupf, freef) \ + // CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_X509_STORE, l, p, newf, dupf, freef) + X509_STORE_set_ex_data_procname = 'X509_STORE_set_ex_data'; {introduced 1.1.0} + X509_STORE_get_ex_data_procname = 'X509_STORE_get_ex_data'; {introduced 1.1.0} + + X509_STORE_CTX_new_procname = 'X509_STORE_CTX_new'; + + X509_STORE_CTX_get1_issuer_procname = 'X509_STORE_CTX_get1_issuer'; + + X509_STORE_CTX_free_procname = 'X509_STORE_CTX_free'; +// TIdC_INT X509_STORE_CTX_init(ctx: PX509_STORE_CTX; store: PX509_STORE; x509: PX509; chain: P STACK_OF(X509)); +// procedure X509_STORE_CTX_set0_trusted_stack(ctx: PX509_STORE_CTX; sk: P STACK_OF(X509)); + X509_STORE_CTX_cleanup_procname = 'X509_STORE_CTX_cleanup'; + + X509_STORE_CTX_get0_store_procname = 'X509_STORE_CTX_get0_store'; + X509_STORE_CTX_get0_cert_procname = 'X509_STORE_CTX_get0_cert'; {introduced 1.1.0} + //STACK_OF(X509)* X509_STORE_CTX_get0_untrusted(X509_STORE_CTX *ctx); + //void X509_STORE_CTX_set0_untrusted(X509_STORE_CTX *ctx, STACK_OF(X509) *sk); + X509_STORE_CTX_set_verify_cb_procname = 'X509_STORE_CTX_set_verify_cb'; + X509_STORE_CTX_get_verify_cb_procname = 'X509_STORE_CTX_get_verify_cb'; {introduced 1.1.0} + X509_STORE_CTX_get_verify_procname = 'X509_STORE_CTX_get_verify'; {introduced 1.1.0} + X509_STORE_CTX_get_get_issuer_procname = 'X509_STORE_CTX_get_get_issuer'; {introduced 1.1.0} + X509_STORE_CTX_get_check_issued_procname = 'X509_STORE_CTX_get_check_issued'; {introduced 1.1.0} + X509_STORE_CTX_get_check_revocation_procname = 'X509_STORE_CTX_get_check_revocation'; {introduced 1.1.0} + X509_STORE_CTX_get_get_crl_procname = 'X509_STORE_CTX_get_get_crl'; {introduced 1.1.0} + X509_STORE_CTX_get_check_crl_procname = 'X509_STORE_CTX_get_check_crl'; {introduced 1.1.0} + X509_STORE_CTX_get_cert_crl_procname = 'X509_STORE_CTX_get_cert_crl'; {introduced 1.1.0} + X509_STORE_CTX_get_check_policy_procname = 'X509_STORE_CTX_get_check_policy'; {introduced 1.1.0} +// function X509_STORE_CTX_get_lookup_certs(ctx: PX509_STORE_CTX): X509_STORE_CTX_lookup_certs_fn; +// function X509_STORE_CTX_get_lookup_crls(ctx: PX509_STORE_CTX): X509_STORE_CTX_lookup_crls_fn; + X509_STORE_CTX_get_cleanup_procname = 'X509_STORE_CTX_get_cleanup'; {introduced 1.1.0} + + X509_STORE_add_lookup_procname = 'X509_STORE_add_lookup'; + X509_LOOKUP_hash_dir_procname = 'X509_LOOKUP_hash_dir'; + X509_LOOKUP_file_procname = 'X509_LOOKUP_file'; + + X509_LOOKUP_meth_new_procname = 'X509_LOOKUP_meth_new'; {introduced 1.1.0} + X509_LOOKUP_meth_free_procname = 'X509_LOOKUP_meth_free'; {introduced 1.1.0} + + //TIdC_INT X509_LOOKUP_meth_set_new_item(X509_LOOKUP_METHOD *method, + // TIdC_INT (*new_item) (X509_LOOKUP *ctx)); + //TIdC_INT (*X509_LOOKUP_meth_get_new_item(const X509_LOOKUP_METHOD* method)) + // (X509_LOOKUP *ctx); + // + //TIdC_INT X509_LOOKUP_meth_set_free(X509_LOOKUP_METHOD *method, + // void (*free_fn) (X509_LOOKUP *ctx)); + //void (*X509_LOOKUP_meth_get_free(const X509_LOOKUP_METHOD* method)) + // (X509_LOOKUP *ctx); + // + //TIdC_INT X509_LOOKUP_meth_set_init(X509_LOOKUP_METHOD *method, + // TIdC_INT (*init) (X509_LOOKUP *ctx)); + //TIdC_INT (*X509_LOOKUP_meth_get_init(const X509_LOOKUP_METHOD* method)) + // (X509_LOOKUP *ctx); + // + //TIdC_INT X509_LOOKUP_meth_set_shutdown(X509_LOOKUP_METHOD *method, + // TIdC_INT (*shutdown) (X509_LOOKUP *ctx)); + //TIdC_INT (*X509_LOOKUP_meth_get_shutdown(const X509_LOOKUP_METHOD* method)) + // (X509_LOOKUP *ctx); + + X509_LOOKUP_meth_set_ctrl_procname = 'X509_LOOKUP_meth_set_ctrl'; {introduced 1.1.0} + X509_LOOKUP_meth_get_ctrl_procname = 'X509_LOOKUP_meth_get_ctrl'; {introduced 1.1.0} + + X509_LOOKUP_meth_set_get_by_subject_procname = 'X509_LOOKUP_meth_set_get_by_subject'; {introduced 1.1.0} + X509_LOOKUP_meth_get_get_by_subject_procname = 'X509_LOOKUP_meth_get_get_by_subject'; {introduced 1.1.0} + + X509_LOOKUP_meth_set_get_by_issuer_serial_procname = 'X509_LOOKUP_meth_set_get_by_issuer_serial'; {introduced 1.1.0} + X509_LOOKUP_meth_get_get_by_issuer_serial_procname = 'X509_LOOKUP_meth_get_get_by_issuer_serial'; {introduced 1.1.0} + + X509_LOOKUP_meth_set_get_by_fingerprint_procname = 'X509_LOOKUP_meth_set_get_by_fingerprint'; {introduced 1.1.0} + X509_LOOKUP_meth_get_get_by_fingerprint_procname = 'X509_LOOKUP_meth_get_get_by_fingerprint'; {introduced 1.1.0} + + X509_LOOKUP_meth_set_get_by_alias_procname = 'X509_LOOKUP_meth_set_get_by_alias'; {introduced 1.1.0} + X509_LOOKUP_meth_get_get_by_alias_procname = 'X509_LOOKUP_meth_get_get_by_alias'; {introduced 1.1.0} + + X509_STORE_add_cert_procname = 'X509_STORE_add_cert'; + X509_STORE_add_crl_procname = 'X509_STORE_add_crl'; + + X509_STORE_CTX_get_by_subject_procname = 'X509_STORE_CTX_get_by_subject'; {introduced 1.1.0} + X509_STORE_CTX_get_obj_by_subject_procname = 'X509_STORE_CTX_get_obj_by_subject'; {introduced 1.1.0} + + X509_LOOKUP_ctrl_procname = 'X509_LOOKUP_ctrl'; + + X509_load_cert_file_procname = 'X509_load_cert_file'; + X509_load_crl_file_procname = 'X509_load_crl_file'; + X509_load_cert_crl_file_procname = 'X509_load_cert_crl_file'; + + X509_LOOKUP_new_procname = 'X509_LOOKUP_new'; + X509_LOOKUP_free_procname = 'X509_LOOKUP_free'; + X509_LOOKUP_init_procname = 'X509_LOOKUP_init'; + X509_LOOKUP_by_subject_procname = 'X509_LOOKUP_by_subject'; + X509_LOOKUP_by_issuer_serial_procname = 'X509_LOOKUP_by_issuer_serial'; + X509_LOOKUP_by_fingerprint_procname = 'X509_LOOKUP_by_fingerprint'; + X509_LOOKUP_by_alias_procname = 'X509_LOOKUP_by_alias'; + X509_LOOKUP_set_method_data_procname = 'X509_LOOKUP_set_method_data'; {introduced 1.1.0} + X509_LOOKUP_get_method_data_procname = 'X509_LOOKUP_get_method_data'; {introduced 1.1.0} + X509_LOOKUP_get_store_procname = 'X509_LOOKUP_get_store'; {introduced 1.1.0} + X509_LOOKUP_shutdown_procname = 'X509_LOOKUP_shutdown'; + + X509_STORE_load_locations_procname = 'X509_STORE_load_locations'; + X509_STORE_set_default_paths_procname = 'X509_STORE_set_default_paths'; + + //#define X509_STORE_CTX_get_ex_new_index(l, p, newf, dupf, freef) \ + // CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_X509_STORE_CTX, l, p, newf, dupf, freef) + X509_STORE_CTX_set_ex_data_procname = 'X509_STORE_CTX_set_ex_data'; + X509_STORE_CTX_get_ex_data_procname = 'X509_STORE_CTX_get_ex_data'; + X509_STORE_CTX_get_error_procname = 'X509_STORE_CTX_get_error'; + X509_STORE_CTX_set_error_procname = 'X509_STORE_CTX_set_error'; + X509_STORE_CTX_get_error_depth_procname = 'X509_STORE_CTX_get_error_depth'; + X509_STORE_CTX_set_error_depth_procname = 'X509_STORE_CTX_set_error_depth'; {introduced 1.1.0} + X509_STORE_CTX_get_current_cert_procname = 'X509_STORE_CTX_get_current_cert'; + X509_STORE_CTX_set_current_cert_procname = 'X509_STORE_CTX_set_current_cert'; {introduced 1.1.0} + X509_STORE_CTX_get0_current_issuer_procname = 'X509_STORE_CTX_get0_current_issuer'; + X509_STORE_CTX_get0_current_crl_procname = 'X509_STORE_CTX_get0_current_crl'; + X509_STORE_CTX_get0_parent_ctx_procname = 'X509_STORE_CTX_get0_parent_ctx'; +// STACK_OF(X509) *X509_STORE_CTX_get0_chain(X509_STORE_CTX *ctx); +// STACK_OF(X509) *X509_STORE_CTX_get1_chain(X509_STORE_CTX *ctx); + X509_STORE_CTX_set_cert_procname = 'X509_STORE_CTX_set_cert'; +// void X509_STORE_CTX_set0_verified_chain(X509_STORE_CTX *c, STACK_OF(X509) *sk); +// void X509_STORE_CTX_set0_crls(X509_STORE_CTX *c, STACK_OF(X509_CRL) *sk); + X509_STORE_CTX_set_purpose_procname = 'X509_STORE_CTX_set_purpose'; + X509_STORE_CTX_set_trust_procname = 'X509_STORE_CTX_set_trust'; + X509_STORE_CTX_purpose_inherit_procname = 'X509_STORE_CTX_purpose_inherit'; + X509_STORE_CTX_set_flags_procname = 'X509_STORE_CTX_set_flags'; +// procedure X509_STORE_CTX_set_time(ctx: PX509_STORE_CTX; flags: TIdC_ULONG; t: TIdC_TIMET); + + X509_STORE_CTX_get0_policy_tree_procname = 'X509_STORE_CTX_get0_policy_tree'; + X509_STORE_CTX_get_explicit_policy_procname = 'X509_STORE_CTX_get_explicit_policy'; + X509_STORE_CTX_get_num_untrusted_procname = 'X509_STORE_CTX_get_num_untrusted'; {introduced 1.1.0} + + X509_STORE_CTX_get0_param_procname = 'X509_STORE_CTX_get0_param'; + X509_STORE_CTX_set0_param_procname = 'X509_STORE_CTX_set0_param'; + X509_STORE_CTX_set_default_procname = 'X509_STORE_CTX_set_default'; + + (* + * Bridge opacity barrier between libcrypt and libssl, also needed to support + * offline testing in test/danetest.c + *) + X509_STORE_CTX_set0_dane_procname = 'X509_STORE_CTX_set0_dane'; {introduced 1.1.0} + + (* X509_VERIFY_PARAM functions *) + + X509_VERIFY_PARAM_new_procname = 'X509_VERIFY_PARAM_new'; + X509_VERIFY_PARAM_free_procname = 'X509_VERIFY_PARAM_free'; + X509_VERIFY_PARAM_inherit_procname = 'X509_VERIFY_PARAM_inherit'; + X509_VERIFY_PARAM_set1_procname = 'X509_VERIFY_PARAM_set1'; + X509_VERIFY_PARAM_set1_name_procname = 'X509_VERIFY_PARAM_set1_name'; + X509_VERIFY_PARAM_set_flags_procname = 'X509_VERIFY_PARAM_set_flags'; + X509_VERIFY_PARAM_clear_flags_procname = 'X509_VERIFY_PARAM_clear_flags'; + X509_VERIFY_PARAM_get_flags_procname = 'X509_VERIFY_PARAM_get_flags'; + X509_VERIFY_PARAM_set_purpose_procname = 'X509_VERIFY_PARAM_set_purpose'; + X509_VERIFY_PARAM_set_trust_procname = 'X509_VERIFY_PARAM_set_trust'; + X509_VERIFY_PARAM_set_depth_procname = 'X509_VERIFY_PARAM_set_depth'; + X509_VERIFY_PARAM_set_auth_level_procname = 'X509_VERIFY_PARAM_set_auth_level'; {introduced 1.1.0} +// function X509_VERIFY_PARAM_get_time(const param: PX509_VERIFY_PARAM): TIdC_TIMET; +// procedure X509_VERIFY_PARAM_set_time(param: PX509_VERIFY_PARAM; t: TIdC_TIMET); + X509_VERIFY_PARAM_add0_policy_procname = 'X509_VERIFY_PARAM_add0_policy'; + //TIdC_INT X509_VERIFY_PARAM_set1_policies(X509_VERIFY_PARAM *param, + // STACK_OF(ASN1_OBJECT) *policies); + + X509_VERIFY_PARAM_set_inh_flags_procname = 'X509_VERIFY_PARAM_set_inh_flags'; {introduced 1.1.0} + X509_VERIFY_PARAM_get_inh_flags_procname = 'X509_VERIFY_PARAM_get_inh_flags'; {introduced 1.1.0} + + X509_VERIFY_PARAM_set1_host_procname = 'X509_VERIFY_PARAM_set1_host'; + X509_VERIFY_PARAM_add1_host_procname = 'X509_VERIFY_PARAM_add1_host'; + X509_VERIFY_PARAM_set_hostflags_procname = 'X509_VERIFY_PARAM_set_hostflags'; + X509_VERIFY_PARAM_get_hostflags_procname = 'X509_VERIFY_PARAM_get_hostflags'; {introduced 1.1.0} + X509_VERIFY_PARAM_get0_peername_procname = 'X509_VERIFY_PARAM_get0_peername'; + X509_VERIFY_PARAM_move_peername_procname = 'X509_VERIFY_PARAM_move_peername'; {introduced 1.1.0} + X509_VERIFY_PARAM_set1_email_procname = 'X509_VERIFY_PARAM_set1_email'; + X509_VERIFY_PARAM_set1_ip_procname = 'X509_VERIFY_PARAM_set1_ip'; + X509_VERIFY_PARAM_set1_ip_asc_procname = 'X509_VERIFY_PARAM_set1_ip_asc'; + + X509_VERIFY_PARAM_get_depth_procname = 'X509_VERIFY_PARAM_get_depth'; + X509_VERIFY_PARAM_get_auth_level_procname = 'X509_VERIFY_PARAM_get_auth_level'; {introduced 1.1.0} + X509_VERIFY_PARAM_get0_name_procname = 'X509_VERIFY_PARAM_get0_name'; + + X509_VERIFY_PARAM_add0_table_procname = 'X509_VERIFY_PARAM_add0_table'; + X509_VERIFY_PARAM_get_count_procname = 'X509_VERIFY_PARAM_get_count'; + X509_VERIFY_PARAM_get0_procname = 'X509_VERIFY_PARAM_get0'; + X509_VERIFY_PARAM_lookup_procname = 'X509_VERIFY_PARAM_lookup'; + X509_VERIFY_PARAM_table_cleanup_procname = 'X509_VERIFY_PARAM_table_cleanup'; + + //TIdC_INT X509_policy_check(X509_POLICY_TREE **ptree, TIdC_INT *pexplicit_policy, + // STACK_OF(X509) *certs, + // STACK_OF(ASN1_OBJECT) *policy_oids, TIdC_UINT flags); + + X509_policy_tree_free_procname = 'X509_policy_tree_free'; + + X509_policy_tree_level_count_procname = 'X509_policy_tree_level_count'; + X509_policy_tree_get0_level_procname = 'X509_policy_tree_get0_level'; + + //STACK_OF(X509_POLICY_NODE) *X509_policy_tree_get0_policies(const + // X509_POLICY_TREE + // *tree); + // + //STACK_OF(X509_POLICY_NODE) *X509_policy_tree_get0_user_policies(const + // X509_POLICY_TREE + // *tree); + + X509_policy_level_node_count_procname = 'X509_policy_level_node_count'; + + X509_policy_level_get0_node_procname = 'X509_policy_level_get0_node'; + + X509_policy_node_get0_policy_procname = 'X509_policy_node_get0_policy'; + + //STACK_OF(POLICYQUALINFO) *X509_policy_node_get0_qualifiers(const + // X509_POLICY_NODE + // *node); + X509_policy_node_get0_parent_procname = 'X509_policy_node_get0_parent'; + + +function _X509_STORE_CTX_get_app_data(ctx: PX509_STORE_CTX): Pointer; cdecl; +begin + Result := X509_STORE_CTX_get_ex_data(ctx,SSL_get_ex_data_X509_STORE_CTX_idx); +end; + + +{forward_compatibility} +type + _PX509_LOOKUP_METHOD = ^_X509_LOOKUP_METHOD; + _X509_LOOKUP_METHOD = record + name : PIdAnsiChar; + new_item : function (ctx : PX509_LOOKUP): TIdC_INT; cdecl; + free : procedure (ctx : PX509_LOOKUP); cdecl; + init : function(ctx : PX509_LOOKUP) : TIdC_INT; cdecl; + shutdown : function(ctx : PX509_LOOKUP) : TIdC_INT; cdecl; + ctrl: function(ctx : PX509_LOOKUP; cmd : TIdC_INT; const argc : PIdAnsiChar; argl : TIdC_LONG; out ret : PIdAnsiChar ) : TIdC_INT; cdecl; + get_by_subject: function(ctx : PX509_LOOKUP; _type : TIdC_INT; name : PX509_NAME; ret : PX509_OBJECT ) : TIdC_INT; cdecl; + get_by_issuer_serial : function(ctx : PX509_LOOKUP; _type : TIdC_INT; name : PX509_NAME; serial : PASN1_INTEGER; ret : PX509_OBJECT) : TIdC_INT; cdecl; + get_by_fingerprint : function (ctx : PX509_LOOKUP; _type : TIdC_INT; bytes : PIdAnsiChar; len : TIdC_INT; ret : PX509_OBJECT): TIdC_INT; cdecl; + get_by_alias : function(ctx : PX509_LOOKUP; _type : TIdC_INT; str : PIdAnsiChar; ret : PX509_OBJECT) : TIdC_INT; cdecl; + end; + +const + Indy_x509_unicode_file_lookup: _X509_LOOKUP_METHOD = + ( + name: 'Load file into cache'; + new_item: nil; // * new */ + free: nil; // * free */ + init: nil; // * init */ + shutdown: nil; // * shutdown */ + ctrl: nil; // * ctrl */ + get_by_subject: nil; // * get_by_subject */ + get_by_issuer_serial: nil; // * get_by_issuer_serial */ + get_by_fingerprint: nil; // * get_by_fingerprint */ + get_by_alias: nil // * get_by_alias */ + ); + +function FC_X509_LOOKUP_meth_new(const name: PIdAnsiChar): PX509_LOOKUP_METHOD; cdecl; +begin + Result := @Indy_x509_unicode_file_lookup; +end; + +procedure FC_X509_LOOKUP_meth_free(method: PX509_LOOKUP_METHOD); cdecl; +begin + //Do nothing +end; + +function FC_X509_LOOKUP_meth_set_ctrl(method: PX509_LOOKUP_METHOD; ctrl_fn: X509_LOOKUP_ctrl_fn): TIdC_INT; cdecl; +begin + _PX509_LOOKUP_METHOD(method)^.ctrl := @ctrl_fn; + Result := 1; +end; +(* +struct x509_lookup_st { + int init; /* have we been started */ + int skip; /* don't use us. */ + X509_LOOKUP_METHOD *method; /* the functions */ + char *method_data; /* method data */ + X509_STORE *store_ctx; /* who owns us */ +} /* X509_LOOKUP */ ; +*) + +type + _PX509_LOOKUP = ^_X509_LOOKUP; + _X509_LOOKUP = record + init: TIdC_INT; + skip: TIdC_INT; + method: PX509_LOOKUP_METHOD; + method_data: PIdAnsiChar; + store_ctx: PX509_STORE; + end; + +function FC_X509_LOOKUP_get_store(const ctx: PX509_LOOKUP): PX509_STORE; cdecl; +begin + Result := _PX509_LOOKUP(ctx)^.store_ctx; +end; + +{/forward_compatibility} +{$WARN NO_RETVAL OFF} +function ERR_X509_STORE_set_depth(store: PX509_STORE; depth: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_STORE_set_depth_procname); +end; + + + +procedure ERR_X509_STORE_CTX_set_depth(ctx: PX509_STORE_CTX; depth: TIdC_INT); +begin + EIdAPIFunctionNotPresent.RaiseException(X509_STORE_CTX_set_depth_procname); +end; + + + + //# define X509_STORE_CTX_set_app_data(ctx,data) \ + // X509_STORE_CTX_set_ex_data(ctx,0,data) + //# define X509_STORE_CTX_get_app_data(ctx) \ + // X509_STORE_CTX_get_ex_data(ctx,0) +function ERR_X509_STORE_CTX_get_app_data(ctx: PX509_STORE_CTX): Pointer; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_STORE_CTX_get_app_data_procname); +end; + + + // + //# define X509_LOOKUP_load_file(x,name,type) \ + // X509_LOOKUP_ctrl((x),X509_L_FILE_LOAD,(name),(TIdC_LONG)(type),NULL) + // + //# define X509_LOOKUP_add_dir(x,name,type) \ + // X509_LOOKUP_ctrl((x),X509_L_ADD_DIR,(name),(TIdC_LONG)(type),NULL) + // + //TIdC_INT X509_OBJECT_idx_by_subject(STACK_OF(X509_OBJECT) *h, X509_LOOKUP_TYPE type, + // X509_NAME *name); + //X509_OBJECT *X509_OBJECT_retrieve_by_subject(STACK_OF(X509_OBJECT) *h, + // X509_LOOKUP_TYPE type, + // X509_NAME *name); + //X509_OBJECT *X509_OBJECT_retrieve_match(STACK_OF(X509_OBJECT) *h, + // X509_OBJECT *x); +function ERR_X509_OBJECT_up_ref_count(a: PX509_OBJECT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_OBJECT_up_ref_count_procname); +end; + + +function ERR_X509_OBJECT_new: PX509_OBJECT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_OBJECT_new_procname); +end; + + {introduced 1.1.0} +procedure ERR_X509_OBJECT_free(a: PX509_OBJECT); +begin + EIdAPIFunctionNotPresent.RaiseException(X509_OBJECT_free_procname); +end; + + {introduced 1.1.0} +function ERR_X509_OBJECT_get_type(const a: PX509_OBJECT): X509_LOOKUP_TYPE; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_OBJECT_get_type_procname); +end; + + {introduced 1.1.0} +function ERR_X509_OBJECT_get0_X509(const a: PX509_OBJECT): PX509; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_OBJECT_get0_X509_procname); +end; + + {introduced 1.1.0} +function ERR_X509_OBJECT_set1_X509(a: PX509_OBJECT; obj: PX509): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_OBJECT_set1_X509_procname); +end; + + {introduced 1.1.0} +function ERR_X509_OBJECT_get0_X509_CRL(a: PX509_OBJECT): PX509_CRL; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_OBJECT_get0_X509_CRL_procname); +end; + + {introduced 1.1.0} +function ERR_X509_OBJECT_set1_X509_CRL(a: PX509_OBJECT; obj: PX509_CRL): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_OBJECT_set1_X509_CRL_procname); +end; + + {introduced 1.1.0} +function ERR_X509_STORE_new: PX509_STORE; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_STORE_new_procname); +end; + + +procedure ERR_X509_STORE_free(v: PX509_STORE); +begin + EIdAPIFunctionNotPresent.RaiseException(X509_STORE_free_procname); +end; + + +function ERR_X509_STORE_lock(ctx: PX509_STORE): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_STORE_lock_procname); +end; + + {introduced 1.1.0} +function ERR_X509_STORE_unlock(ctx: PX509_STORE): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_STORE_unlock_procname); +end; + + {introduced 1.1.0} +function ERR_X509_STORE_up_ref(v: PX509_STORE): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_STORE_up_ref_procname); +end; + + {introduced 1.1.0} + //STACK_OF(X509_OBJECT) *X509_STORE_get0_objects(X509_STORE *v); + + //STACK_OF(X509) *X509_STORE_CTX_get1_certs(X509_STORE_CTX *st, X509_NAME *nm); + //STACK_OF(X509_CRL) *X509_STORE_CTX_get1_crls(X509_STORE_CTX *st, X509_NAME *nm); +function ERR_X509_STORE_set_flags(ctx: PX509_STORE; flags: TIdC_ULONG): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_STORE_set_flags_procname); +end; + + +function ERR_X509_STORE_set_purpose(ctx: PX509_STORE; purpose: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_STORE_set_purpose_procname); +end; + + +function ERR_X509_STORE_set_trust(ctx: PX509_STORE; trust: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_STORE_set_trust_procname); +end; + + +function ERR_X509_STORE_set1_param(ctx: PX509_STORE; pm: PX509_VERIFY_PARAM): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_STORE_set1_param_procname); +end; + + +function ERR_X509_STORE_get0_param(ctx: PX509_STORE): PX509_VERIFY_PARAM; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_STORE_get0_param_procname); +end; + + {introduced 1.1.0} + +procedure ERR_X509_STORE_set_verify(ctx: PX509_STORE; verify: X509_STORE_CTX_verify_fn); +begin + EIdAPIFunctionNotPresent.RaiseException(X509_STORE_set_verify_procname); +end; + + {introduced 1.1.0} + //#define X509_STORE_set_verify_func(ctx, func) \ + // X509_STORE_set_verify((ctx),(func)) +procedure ERR_X509_STORE_CTX_set_verify(ctx: PX509_STORE_CTX; verify: X509_STORE_CTX_verify_fn); +begin + EIdAPIFunctionNotPresent.RaiseException(X509_STORE_CTX_set_verify_procname); +end; + + {introduced 1.1.0} +function ERR_X509_STORE_get_verify(ctx: PX509_STORE): X509_STORE_CTX_verify_fn; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_STORE_get_verify_procname); +end; + + {introduced 1.1.0} +procedure ERR_X509_STORE_set_verify_cb(ctx: PX509_STORE; verify_cb: X509_STORE_CTX_verify_cb); +begin + EIdAPIFunctionNotPresent.RaiseException(X509_STORE_set_verify_cb_procname); +end; + + + //# define X509_STORE_set_verify_cb_func(ctx,func) \ + // X509_STORE_set_verify_cb((ctx),(func)) +function ERR_X509_STORE_get_verify_cb(ctx: PX509_STORE): X509_STORE_CTX_verify_cb; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_STORE_get_verify_cb_procname); +end; + + {introduced 1.1.0} +procedure ERR_X509_STORE_set_get_issuer(ctx: PX509_STORE; get_issuer: X509_STORE_CTX_get_issuer_fn); +begin + EIdAPIFunctionNotPresent.RaiseException(X509_STORE_set_get_issuer_procname); +end; + + {introduced 1.1.0} +function ERR_X509_STORE_get_get_issuer(ctx: PX509_STORE): X509_STORE_CTX_get_issuer_fn; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_STORE_get_get_issuer_procname); +end; + + {introduced 1.1.0} +procedure ERR_X509_STORE_set_check_issued(ctx: PX509_STORE; check_issued: X509_STORE_CTX_check_issued_fn); +begin + EIdAPIFunctionNotPresent.RaiseException(X509_STORE_set_check_issued_procname); +end; + + {introduced 1.1.0} +function ERR_X509_STORE_get_check_issued(ctx: PX509_STORE): X509_STORE_CTX_check_issued_fn; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_STORE_get_check_issued_procname); +end; + + {introduced 1.1.0} +procedure ERR_X509_STORE_set_check_revocation(ctx: PX509_STORE; check_revocation: X509_STORE_CTX_check_revocation_fn); +begin + EIdAPIFunctionNotPresent.RaiseException(X509_STORE_set_check_revocation_procname); +end; + + {introduced 1.1.0} +function ERR_X509_STORE_get_check_revocation(ctx: PX509_STORE): X509_STORE_CTX_check_revocation_fn; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_STORE_get_check_revocation_procname); +end; + + {introduced 1.1.0} +procedure ERR_X509_STORE_set_get_crl(ctx: PX509_STORE; get_crl: X509_STORE_CTX_get_crl_fn); +begin + EIdAPIFunctionNotPresent.RaiseException(X509_STORE_set_get_crl_procname); +end; + + {introduced 1.1.0} +function ERR_X509_STORE_get_get_crl(ctx: PX509_STORE): X509_STORE_CTX_get_crl_fn; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_STORE_get_get_crl_procname); +end; + + {introduced 1.1.0} +procedure ERR_X509_STORE_set_check_crl(ctx: PX509_STORE; check_crl: X509_STORE_CTX_check_crl_fn); +begin + EIdAPIFunctionNotPresent.RaiseException(X509_STORE_set_check_crl_procname); +end; + + {introduced 1.1.0} +function ERR_X509_STORE_get_check_crl(ctx: PX509_STORE): X509_STORE_CTX_check_crl_fn; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_STORE_get_check_crl_procname); +end; + + {introduced 1.1.0} +procedure ERR_X509_STORE_set_cert_crl(ctx: PX509_STORE; cert_crl: X509_STORE_CTX_cert_crl_fn); +begin + EIdAPIFunctionNotPresent.RaiseException(X509_STORE_set_cert_crl_procname); +end; + + {introduced 1.1.0} +function ERR_X509_STORE_get_cert_crl(ctx: PX509_STORE): X509_STORE_CTX_cert_crl_fn; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_STORE_get_cert_crl_procname); +end; + + {introduced 1.1.0} +procedure ERR_X509_STORE_set_check_policy(ctx: PX509_STORE; check_policy: X509_STORE_CTX_check_policy_fn); +begin + EIdAPIFunctionNotPresent.RaiseException(X509_STORE_set_check_policy_procname); +end; + + {introduced 1.1.0} +function ERR_X509_STORE_get_check_policy(ctx: PX509_STORE): X509_STORE_CTX_check_policy_fn; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_STORE_get_check_policy_procname); +end; + + {introduced 1.1.0} +// procedure X509_STORE_set_lookup_certs(ctx: PX509_STORE; lookup_certs: X509_STORE_CTX_lookup_certs_fn); +// function X509_STORE_get_lookup_certs(ctx: PX509_STORE): X509_STORE_CTX_lookup_certs_fn; +// procedure X509_STORE_set_lookup_crls(ctx: PX509_STORE; lookup_crls: X509_STORE_CTX_lookup_crls_fn); +// #define X509_STORE_set_lookup_crls_cb(ctx, func) \ +// X509_STORE_set_lookup_crls((ctx), (func)) +// function X509_STORE_get_lookup_crls(ctx: PX509_STORE): X509_STORE_CTX_lookup_crls_fn; +procedure ERR_X509_STORE_set_cleanup(ctx: PX509_STORE; cleanup: X509_STORE_CTX_cleanup_fn); +begin + EIdAPIFunctionNotPresent.RaiseException(X509_STORE_set_cleanup_procname); +end; + + {introduced 1.1.0} +function ERR_X509_STORE_get_cleanup(ctx: PX509_STORE): X509_STORE_CTX_cleanup_fn; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_STORE_get_cleanup_procname); +end; + + {introduced 1.1.0} + + //#define X509_STORE_get_ex_new_index(l, p, newf, dupf, freef) \ + // CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_X509_STORE, l, p, newf, dupf, freef) +function ERR_X509_STORE_set_ex_data(ctx: PX509_STORE; idx: TIdC_INT; data: Pointer): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_STORE_set_ex_data_procname); +end; + + {introduced 1.1.0} +function ERR_X509_STORE_get_ex_data(ctx: PX509_STORE; idx: TIdC_INT): Pointer; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_STORE_get_ex_data_procname); +end; + + {introduced 1.1.0} + +function ERR_X509_STORE_CTX_new: PX509_STORE_CTX; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_STORE_CTX_new_procname); +end; + + + +function ERR_X509_STORE_CTX_get1_issuer(issuer: PPX509; ctx: PX509_STORE_CTX; x: PX509): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_STORE_CTX_get1_issuer_procname); +end; + + + +procedure ERR_X509_STORE_CTX_free(ctx: PX509_STORE_CTX); +begin + EIdAPIFunctionNotPresent.RaiseException(X509_STORE_CTX_free_procname); +end; + + +// TIdC_INT X509_STORE_CTX_init(ctx: PX509_STORE_CTX; store: PX509_STORE; x509: PX509; chain: P STACK_OF(X509)); +// procedure X509_STORE_CTX_set0_trusted_stack(ctx: PX509_STORE_CTX; sk: P STACK_OF(X509)); +procedure ERR_X509_STORE_CTX_cleanup(ctx: PX509_STORE_CTX); +begin + EIdAPIFunctionNotPresent.RaiseException(X509_STORE_CTX_cleanup_procname); +end; + + + +function ERR_X509_STORE_CTX_get0_store(ctx: PX509_STORE_CTX): PX509_STORE; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_STORE_CTX_get0_store_procname); +end; + + +function ERR_X509_STORE_CTX_get0_cert(ctx: PX509_STORE_CTX): PX509; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_STORE_CTX_get0_cert_procname); +end; + + {introduced 1.1.0} + //STACK_OF(X509)* X509_STORE_CTX_get0_untrusted(X509_STORE_CTX *ctx); + //void X509_STORE_CTX_set0_untrusted(X509_STORE_CTX *ctx, STACK_OF(X509) *sk); +procedure ERR_X509_STORE_CTX_set_verify_cb(ctx: PX509_STORE_CTX; verify: X509_STORE_CTX_verify_cb); +begin + EIdAPIFunctionNotPresent.RaiseException(X509_STORE_CTX_set_verify_cb_procname); +end; + + +function ERR_X509_STORE_CTX_get_verify_cb(ctx: PX509_STORE_CTX): X509_STORE_CTX_verify_cb; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_STORE_CTX_get_verify_cb_procname); +end; + + {introduced 1.1.0} +function ERR_X509_STORE_CTX_get_verify(ctx: PX509_STORE_CTX): X509_STORE_CTX_verify_fn; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_STORE_CTX_get_verify_procname); +end; + + {introduced 1.1.0} +function ERR_X509_STORE_CTX_get_get_issuer(ctx: PX509_STORE_CTX): X509_STORE_CTX_get_issuer_fn; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_STORE_CTX_get_get_issuer_procname); +end; + + {introduced 1.1.0} +function ERR_X509_STORE_CTX_get_check_issued(ctx: PX509_STORE_CTX): X509_STORE_CTX_check_issued_fn; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_STORE_CTX_get_check_issued_procname); +end; + + {introduced 1.1.0} +function ERR_X509_STORE_CTX_get_check_revocation(ctx: PX509_STORE_CTX): X509_STORE_CTX_check_revocation_fn; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_STORE_CTX_get_check_revocation_procname); +end; + + {introduced 1.1.0} +function ERR_X509_STORE_CTX_get_get_crl(ctx: PX509_STORE_CTX): X509_STORE_CTX_get_crl_fn; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_STORE_CTX_get_get_crl_procname); +end; + + {introduced 1.1.0} +function ERR_X509_STORE_CTX_get_check_crl(ctx: PX509_STORE_CTX): X509_STORE_CTX_check_crl_fn; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_STORE_CTX_get_check_crl_procname); +end; + + {introduced 1.1.0} +function ERR_X509_STORE_CTX_get_cert_crl(ctx: PX509_STORE_CTX): X509_STORE_CTX_cert_crl_fn; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_STORE_CTX_get_cert_crl_procname); +end; + + {introduced 1.1.0} +function ERR_X509_STORE_CTX_get_check_policy(ctx: PX509_STORE_CTX): X509_STORE_CTX_check_policy_fn; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_STORE_CTX_get_check_policy_procname); +end; + + {introduced 1.1.0} +// function X509_STORE_CTX_get_lookup_certs(ctx: PX509_STORE_CTX): X509_STORE_CTX_lookup_certs_fn; +// function X509_STORE_CTX_get_lookup_crls(ctx: PX509_STORE_CTX): X509_STORE_CTX_lookup_crls_fn; +function ERR_X509_STORE_CTX_get_cleanup(ctx: PX509_STORE_CTX): X509_STORE_CTX_cleanup_fn; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_STORE_CTX_get_cleanup_procname); +end; + + {introduced 1.1.0} + +function ERR_X509_STORE_add_lookup(v: PX509_STORE; m: PX509_LOOKUP_METHOD): PX509_LOOKUP; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_STORE_add_lookup_procname); +end; + + +function ERR_X509_LOOKUP_hash_dir: PX509_LOOKUP_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_LOOKUP_hash_dir_procname); +end; + + +function ERR_X509_LOOKUP_file: PX509_LOOKUP_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_LOOKUP_file_procname); +end; + + + +function ERR_X509_LOOKUP_meth_new(const name: PIdAnsiChar): PX509_LOOKUP_METHOD; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_LOOKUP_meth_new_procname); +end; + + {introduced 1.1.0} +procedure ERR_X509_LOOKUP_meth_free(method: PX509_LOOKUP_METHOD); +begin + EIdAPIFunctionNotPresent.RaiseException(X509_LOOKUP_meth_free_procname); +end; + + {introduced 1.1.0} + + //TIdC_INT X509_LOOKUP_meth_set_new_item(X509_LOOKUP_METHOD *method, + // TIdC_INT (*new_item) (X509_LOOKUP *ctx)); + //TIdC_INT (*X509_LOOKUP_meth_get_new_item(const X509_LOOKUP_METHOD* method)) + // (X509_LOOKUP *ctx); + // + //TIdC_INT X509_LOOKUP_meth_set_free(X509_LOOKUP_METHOD *method, + // void (*free_fn) (X509_LOOKUP *ctx)); + //void (*X509_LOOKUP_meth_get_free(const X509_LOOKUP_METHOD* method)) + // (X509_LOOKUP *ctx); + // + //TIdC_INT X509_LOOKUP_meth_set_init(X509_LOOKUP_METHOD *method, + // TIdC_INT (*init) (X509_LOOKUP *ctx)); + //TIdC_INT (*X509_LOOKUP_meth_get_init(const X509_LOOKUP_METHOD* method)) + // (X509_LOOKUP *ctx); + // + //TIdC_INT X509_LOOKUP_meth_set_shutdown(X509_LOOKUP_METHOD *method, + // TIdC_INT (*shutdown) (X509_LOOKUP *ctx)); + //TIdC_INT (*X509_LOOKUP_meth_get_shutdown(const X509_LOOKUP_METHOD* method)) + // (X509_LOOKUP *ctx); + +function ERR_X509_LOOKUP_meth_set_ctrl(method: PX509_LOOKUP_METHOD; ctrl_fn: X509_LOOKUP_ctrl_fn): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_LOOKUP_meth_set_ctrl_procname); +end; + + {introduced 1.1.0} +function ERR_X509_LOOKUP_meth_get_ctrl(const method: PX509_LOOKUP_METHOD): X509_LOOKUP_ctrl_fn; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_LOOKUP_meth_get_ctrl_procname); +end; + + {introduced 1.1.0} + +function ERR_X509_LOOKUP_meth_set_get_by_subject(method: PX509_LOOKUP_METHOD; fn: X509_LOOKUP_get_by_subject_fn): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_LOOKUP_meth_set_get_by_subject_procname); +end; + + {introduced 1.1.0} +function ERR_X509_LOOKUP_meth_get_get_by_subject(const method: PX509_LOOKUP_METHOD): X509_LOOKUP_get_by_subject_fn; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_LOOKUP_meth_get_get_by_subject_procname); +end; + + {introduced 1.1.0} + +function ERR_X509_LOOKUP_meth_set_get_by_issuer_serial(method: PX509_LOOKUP_METHOD; fn: X509_LOOKUP_get_by_issuer_serial_fn): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_LOOKUP_meth_set_get_by_issuer_serial_procname); +end; + + {introduced 1.1.0} +function ERR_X509_LOOKUP_meth_get_get_by_issuer_serial(const method: PX509_LOOKUP_METHOD): X509_LOOKUP_get_by_issuer_serial_fn; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_LOOKUP_meth_get_get_by_issuer_serial_procname); +end; + + {introduced 1.1.0} + +function ERR_X509_LOOKUP_meth_set_get_by_fingerprint(method: PX509_LOOKUP_METHOD; fn: X509_LOOKUP_get_by_fingerprint_fn): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_LOOKUP_meth_set_get_by_fingerprint_procname); +end; + + {introduced 1.1.0} +function ERR_X509_LOOKUP_meth_get_get_by_fingerprint(const method: PX509_LOOKUP_METHOD): X509_LOOKUP_get_by_fingerprint_fn; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_LOOKUP_meth_get_get_by_fingerprint_procname); +end; + + {introduced 1.1.0} + +function ERR_X509_LOOKUP_meth_set_get_by_alias(method: PX509_LOOKUP_METHOD; fn: X509_LOOKUP_get_by_alias_fn): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_LOOKUP_meth_set_get_by_alias_procname); +end; + + {introduced 1.1.0} +function ERR_X509_LOOKUP_meth_get_get_by_alias(const method: PX509_LOOKUP_METHOD): X509_LOOKUP_get_by_alias_fn; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_LOOKUP_meth_get_get_by_alias_procname); +end; + + {introduced 1.1.0} + +function ERR_X509_STORE_add_cert(ctx: PX509_STORE; x: PX509): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_STORE_add_cert_procname); +end; + + +function ERR_X509_STORE_add_crl(ctx: PX509_STORE; x: PX509_CRL): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_STORE_add_crl_procname); +end; + + + +function ERR_X509_STORE_CTX_get_by_subject(vs: PX509_STORE_CTX; type_: X509_LOOKUP_TYPE; name: PX509_NAME; ret: PX509_OBJECT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_STORE_CTX_get_by_subject_procname); +end; + + {introduced 1.1.0} +function ERR_X509_STORE_CTX_get_obj_by_subject(vs: PX509_STORE_CTX; type_: X509_LOOKUP_TYPE; name: PX509_NAME): PX509_OBJECT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_STORE_CTX_get_obj_by_subject_procname); +end; + + {introduced 1.1.0} + +function ERR_X509_LOOKUP_ctrl(ctx: PX509_LOOKUP; cmd: TIdC_INT; const argc: PIdAnsiChar; argl: TIdC_LONG; ret: PPIdAnsiChar): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_LOOKUP_ctrl_procname); +end; + + + +function ERR_X509_load_cert_file(ctx: PX509_LOOKUP; const file_: PIdAnsiChar; type_: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_load_cert_file_procname); +end; + + +function ERR_X509_load_crl_file(ctx: PX509_LOOKUP; const file_: PIdAnsiChar; type_: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_load_crl_file_procname); +end; + + +function ERR_X509_load_cert_crl_file(ctx: PX509_LOOKUP; const file_: PIdAnsiChar; type_: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_load_cert_crl_file_procname); +end; + + + +function ERR_X509_LOOKUP_new(method: PX509_LOOKUP_METHOD): PX509_LOOKUP; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_LOOKUP_new_procname); +end; + + +procedure ERR_X509_LOOKUP_free(ctx: PX509_LOOKUP); +begin + EIdAPIFunctionNotPresent.RaiseException(X509_LOOKUP_free_procname); +end; + + +function ERR_X509_LOOKUP_init(ctx: PX509_LOOKUP): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_LOOKUP_init_procname); +end; + + +function ERR_X509_LOOKUP_by_subject(ctx: PX509_LOOKUP; type_: X509_LOOKUP_TYPE; name: PX509_NAME; ret: PX509_OBJECT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_LOOKUP_by_subject_procname); +end; + + +function ERR_X509_LOOKUP_by_issuer_serial(ctx: PX509_LOOKUP; type_: X509_LOOKUP_TYPE; name: PX509_NAME; serial: PASN1_INTEGER; ret: PX509_OBJECT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_LOOKUP_by_issuer_serial_procname); +end; + + +function ERR_X509_LOOKUP_by_fingerprint(ctx: PX509_LOOKUP; type_: X509_LOOKUP_TYPE; const bytes: PByte; len: TIdC_INT; ret: PX509_OBJECT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_LOOKUP_by_fingerprint_procname); +end; + + +function ERR_X509_LOOKUP_by_alias(ctx: PX509_LOOKUP; type_: X509_LOOKUP_TYPE; const str: PIdAnsiChar; len: TIdC_INT; ret: PX509_OBJECT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_LOOKUP_by_alias_procname); +end; + + +function ERR_X509_LOOKUP_set_method_data(ctx: PX509_LOOKUP; data: Pointer): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_LOOKUP_set_method_data_procname); +end; + + {introduced 1.1.0} +function ERR_X509_LOOKUP_get_method_data(const ctx: PX509_LOOKUP): Pointer; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_LOOKUP_get_method_data_procname); +end; + + {introduced 1.1.0} +function ERR_X509_LOOKUP_get_store(const ctx: PX509_LOOKUP): PX509_STORE; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_LOOKUP_get_store_procname); +end; + + {introduced 1.1.0} +function ERR_X509_LOOKUP_shutdown(ctx: PX509_LOOKUP): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_LOOKUP_shutdown_procname); +end; + + + +function ERR_X509_STORE_load_locations(ctx: PX509_STORE; const file_: PIdAnsiChar; const dir: PIdAnsiChar): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_STORE_load_locations_procname); +end; + + +function ERR_X509_STORE_set_default_paths(ctx: PX509_STORE): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_STORE_set_default_paths_procname); +end; + + + + //#define X509_STORE_CTX_get_ex_new_index(l, p, newf, dupf, freef) \ + // CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_X509_STORE_CTX, l, p, newf, dupf, freef) +function ERR_X509_STORE_CTX_set_ex_data(ctx: PX509_STORE_CTX; idx: TIdC_INT; data: Pointer): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_STORE_CTX_set_ex_data_procname); +end; + + +function ERR_X509_STORE_CTX_get_ex_data(ctx: PX509_STORE_CTX; idx: TIdC_INT): Pointer; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_STORE_CTX_get_ex_data_procname); +end; + + +function ERR_X509_STORE_CTX_get_error(ctx: PX509_STORE_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_STORE_CTX_get_error_procname); +end; + + +procedure ERR_X509_STORE_CTX_set_error(ctx: X509_STORE_CTX; s: TIdC_INT); +begin + EIdAPIFunctionNotPresent.RaiseException(X509_STORE_CTX_set_error_procname); +end; + + +function ERR_X509_STORE_CTX_get_error_depth(ctx: PX509_STORE_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_STORE_CTX_get_error_depth_procname); +end; + + +procedure ERR_X509_STORE_CTX_set_error_depth(ctx: PX509_STORE_CTX; depth: TIdC_INT); +begin + EIdAPIFunctionNotPresent.RaiseException(X509_STORE_CTX_set_error_depth_procname); +end; + + {introduced 1.1.0} +function ERR_X509_STORE_CTX_get_current_cert(ctx: PX509_STORE_CTX): PX509; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_STORE_CTX_get_current_cert_procname); +end; + + +procedure ERR_X509_STORE_CTX_set_current_cert(ctx: PX509_STORE_CTX; x: PX509); +begin + EIdAPIFunctionNotPresent.RaiseException(X509_STORE_CTX_set_current_cert_procname); +end; + + {introduced 1.1.0} +function ERR_X509_STORE_CTX_get0_current_issuer(ctx: PX509_STORE_CTX): PX509; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_STORE_CTX_get0_current_issuer_procname); +end; + + +function ERR_X509_STORE_CTX_get0_current_crl(ctx: PX509_STORE_CTX): PX509_CRL; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_STORE_CTX_get0_current_crl_procname); +end; + + +function ERR_X509_STORE_CTX_get0_parent_ctx(ctx: PX509_STORE_CTX): PX509_STORE_CTX; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_STORE_CTX_get0_parent_ctx_procname); +end; + + +// STACK_OF(X509) *X509_STORE_CTX_get0_chain(X509_STORE_CTX *ctx); +// STACK_OF(X509) *X509_STORE_CTX_get1_chain(X509_STORE_CTX *ctx); +procedure ERR_X509_STORE_CTX_set_cert(c: PX509_STORE_CTX; x: PX509); +begin + EIdAPIFunctionNotPresent.RaiseException(X509_STORE_CTX_set_cert_procname); +end; + + +// void X509_STORE_CTX_set0_verified_chain(X509_STORE_CTX *c, STACK_OF(X509) *sk); +// void X509_STORE_CTX_set0_crls(X509_STORE_CTX *c, STACK_OF(X509_CRL) *sk); +function ERR_X509_STORE_CTX_set_purpose(ctx: PX509_STORE_CTX; purpose: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_STORE_CTX_set_purpose_procname); +end; + + +function ERR_X509_STORE_CTX_set_trust(ctx: PX509_STORE_CTX; trust: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_STORE_CTX_set_trust_procname); +end; + + +function ERR_X509_STORE_CTX_purpose_inherit(ctx: PX509_STORE_CTX; def_purpose: TIdC_INT; purpose: TIdC_INT; trust: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_STORE_CTX_purpose_inherit_procname); +end; + + +procedure ERR_X509_STORE_CTX_set_flags(ctx: PX509_STORE_CTX; flags: TIdC_ULONG); +begin + EIdAPIFunctionNotPresent.RaiseException(X509_STORE_CTX_set_flags_procname); +end; + + +// procedure X509_STORE_CTX_set_time(ctx: PX509_STORE_CTX; flags: TIdC_ULONG; t: TIdC_TIMET); + +function ERR_X509_STORE_CTX_get0_policy_tree(ctx: PX509_STORE_CTX): PX509_POLICY_TREE; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_STORE_CTX_get0_policy_tree_procname); +end; + + +function ERR_X509_STORE_CTX_get_explicit_policy(ctx: PX509_STORE_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_STORE_CTX_get_explicit_policy_procname); +end; + + +function ERR_X509_STORE_CTX_get_num_untrusted(ctx: PX509_STORE_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_STORE_CTX_get_num_untrusted_procname); +end; + + {introduced 1.1.0} + +function ERR_X509_STORE_CTX_get0_param(ctx: PX509_STORE_CTX): PX509_VERIFY_PARAM; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_STORE_CTX_get0_param_procname); +end; + + +procedure ERR_X509_STORE_CTX_set0_param(ctx: PX509_STORE_CTX; param: PX509_VERIFY_PARAM); +begin + EIdAPIFunctionNotPresent.RaiseException(X509_STORE_CTX_set0_param_procname); +end; + + +function ERR_X509_STORE_CTX_set_default(ctx: PX509_STORE_CTX; const name: PIdAnsiChar): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_STORE_CTX_set_default_procname); +end; + + + + (* + * Bridge opacity barrier between libcrypt and libssl, also needed to support + * offline testing in test/danetest.c + *) +procedure ERR_X509_STORE_CTX_set0_dane(ctx: PX509_STORE_CTX; dane: PSSL_DANE); +begin + EIdAPIFunctionNotPresent.RaiseException(X509_STORE_CTX_set0_dane_procname); +end; + + {introduced 1.1.0} + + (* X509_VERIFY_PARAM functions *) + +function ERR_X509_VERIFY_PARAM_new: PX509_VERIFY_PARAM; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_VERIFY_PARAM_new_procname); +end; + + +procedure ERR_X509_VERIFY_PARAM_free(param: PX509_VERIFY_PARAM); +begin + EIdAPIFunctionNotPresent.RaiseException(X509_VERIFY_PARAM_free_procname); +end; + + +function ERR_X509_VERIFY_PARAM_inherit(to_: PX509_VERIFY_PARAM; const from: PX509_VERIFY_PARAM): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_VERIFY_PARAM_inherit_procname); +end; + + +function ERR_X509_VERIFY_PARAM_set1(to_: PX509_VERIFY_PARAM; const from: PX509_VERIFY_PARAM): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_VERIFY_PARAM_set1_procname); +end; + + +function ERR_X509_VERIFY_PARAM_set1_name(param: PX509_VERIFY_PARAM; const name: PIdAnsiChar): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_VERIFY_PARAM_set1_name_procname); +end; + + +function ERR_X509_VERIFY_PARAM_set_flags(param: PX509_VERIFY_PARAM; flags: TIdC_ULONG): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_VERIFY_PARAM_set_flags_procname); +end; + + +function ERR_X509_VERIFY_PARAM_clear_flags(param: PX509_VERIFY_PARAM; flags: TIdC_ULONG): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_VERIFY_PARAM_clear_flags_procname); +end; + + +function ERR_X509_VERIFY_PARAM_get_flags(param: PX509_VERIFY_PARAM): TIdC_ULONG; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_VERIFY_PARAM_get_flags_procname); +end; + + +function ERR_X509_VERIFY_PARAM_set_purpose(param: PX509_VERIFY_PARAM; purpose: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_VERIFY_PARAM_set_purpose_procname); +end; + + +function ERR_X509_VERIFY_PARAM_set_trust(param: PX509_VERIFY_PARAM; trust: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_VERIFY_PARAM_set_trust_procname); +end; + + +procedure ERR_X509_VERIFY_PARAM_set_depth(param: PX509_VERIFY_PARAM; depth: TIdC_INT); +begin + EIdAPIFunctionNotPresent.RaiseException(X509_VERIFY_PARAM_set_depth_procname); +end; + + +procedure ERR_X509_VERIFY_PARAM_set_auth_level(param: PX509_VERIFY_PARAM; auth_level: TIdC_INT); +begin + EIdAPIFunctionNotPresent.RaiseException(X509_VERIFY_PARAM_set_auth_level_procname); +end; + + {introduced 1.1.0} +// function X509_VERIFY_PARAM_get_time(const param: PX509_VERIFY_PARAM): TIdC_TIMET; +// procedure X509_VERIFY_PARAM_set_time(param: PX509_VERIFY_PARAM; t: TIdC_TIMET); +function ERR_X509_VERIFY_PARAM_add0_policy(param: PX509_VERIFY_PARAM; policy: PASN1_OBJECT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_VERIFY_PARAM_add0_policy_procname); +end; + + + //TIdC_INT X509_VERIFY_PARAM_set1_policies(X509_VERIFY_PARAM *param, + // STACK_OF(ASN1_OBJECT) *policies); + +function ERR_X509_VERIFY_PARAM_set_inh_flags(param: PX509_VERIFY_PARAM; flags: TIdC_UINT32): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_VERIFY_PARAM_set_inh_flags_procname); +end; + + {introduced 1.1.0} +function ERR_X509_VERIFY_PARAM_get_inh_flags(const param: PX509_VERIFY_PARAM): TIdC_UINT32; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_VERIFY_PARAM_get_inh_flags_procname); +end; + + {introduced 1.1.0} + +function ERR_X509_VERIFY_PARAM_set1_host(param: PX509_VERIFY_PARAM; const name: PIdAnsiChar; namelen: TIdC_SIZET): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_VERIFY_PARAM_set1_host_procname); +end; + + +function ERR_X509_VERIFY_PARAM_add1_host(param: PX509_VERIFY_PARAM; const name: PIdAnsiChar; namelen: TIdC_SIZET): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_VERIFY_PARAM_add1_host_procname); +end; + + +procedure ERR_X509_VERIFY_PARAM_set_hostflags(param: PX509_VERIFY_PARAM; flags: TIdC_UINT); +begin + EIdAPIFunctionNotPresent.RaiseException(X509_VERIFY_PARAM_set_hostflags_procname); +end; + + +function ERR_X509_VERIFY_PARAM_get_hostflags(const param: PX509_VERIFY_PARAM): TIdC_UINT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_VERIFY_PARAM_get_hostflags_procname); +end; + + {introduced 1.1.0} +function ERR_X509_VERIFY_PARAM_get0_peername(v1: PX509_VERIFY_PARAM): PIdAnsiChar; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_VERIFY_PARAM_get0_peername_procname); +end; + + +procedure ERR_X509_VERIFY_PARAM_move_peername(v1: PX509_VERIFY_PARAM; v2: PX509_VERIFY_PARAM); +begin + EIdAPIFunctionNotPresent.RaiseException(X509_VERIFY_PARAM_move_peername_procname); +end; + + {introduced 1.1.0} +function ERR_X509_VERIFY_PARAM_set1_email(param: PX509_VERIFY_PARAM; const email: PIdAnsiChar; emaillen: TIdC_SIZET): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_VERIFY_PARAM_set1_email_procname); +end; + + +function ERR_X509_VERIFY_PARAM_set1_ip(param: PX509_VERIFY_PARAM; const ip: PByte; iplen: TIdC_SIZET): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_VERIFY_PARAM_set1_ip_procname); +end; + + +function ERR_X509_VERIFY_PARAM_set1_ip_asc(param: PX509_VERIFY_PARAM; const ipasc: PIdAnsiChar): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_VERIFY_PARAM_set1_ip_asc_procname); +end; + + + +function ERR_X509_VERIFY_PARAM_get_depth(const param: PX509_VERIFY_PARAM): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_VERIFY_PARAM_get_depth_procname); +end; + + +function ERR_X509_VERIFY_PARAM_get_auth_level(const param: PX509_VERIFY_PARAM): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_VERIFY_PARAM_get_auth_level_procname); +end; + + {introduced 1.1.0} +function ERR_X509_VERIFY_PARAM_get0_name(const param: PX509_VERIFY_PARAM): PIdAnsiChar; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_VERIFY_PARAM_get0_name_procname); +end; + + + +function ERR_X509_VERIFY_PARAM_add0_table(param: PX509_VERIFY_PARAM): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_VERIFY_PARAM_add0_table_procname); +end; + + +function ERR_X509_VERIFY_PARAM_get_count: TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_VERIFY_PARAM_get_count_procname); +end; + + +function ERR_X509_VERIFY_PARAM_get0(id: TIdC_INT): PX509_VERIFY_PARAM; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_VERIFY_PARAM_get0_procname); +end; + + +function ERR_X509_VERIFY_PARAM_lookup(const name: PIdAnsiChar): X509_VERIFY_PARAM; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_VERIFY_PARAM_lookup_procname); +end; + + +procedure ERR_X509_VERIFY_PARAM_table_cleanup; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_VERIFY_PARAM_table_cleanup_procname); +end; + + + + //TIdC_INT X509_policy_check(X509_POLICY_TREE **ptree, TIdC_INT *pexplicit_policy, + // STACK_OF(X509) *certs, + // STACK_OF(ASN1_OBJECT) *policy_oids, TIdC_UINT flags); + +procedure ERR_X509_policy_tree_free(tree: PX509_POLICY_TREE); +begin + EIdAPIFunctionNotPresent.RaiseException(X509_policy_tree_free_procname); +end; + + + +function ERR_X509_policy_tree_level_count(const tree: PX509_POLICY_TREE): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_policy_tree_level_count_procname); +end; + + +function ERR_X509_policy_tree_get0_level(const tree: PX509_POLICY_TREE; i: TIdC_INT): PX509_POLICY_LEVEL; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_policy_tree_get0_level_procname); +end; + + + + //STACK_OF(X509_POLICY_NODE) *X509_policy_tree_get0_policies(const + // X509_POLICY_TREE + // *tree); + // + //STACK_OF(X509_POLICY_NODE) *X509_policy_tree_get0_user_policies(const + // X509_POLICY_TREE + // *tree); + +function ERR_X509_policy_level_node_count(level: PX509_POLICY_LEVEL): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_policy_level_node_count_procname); +end; + + + +function ERR_X509_policy_level_get0_node(level: PX509_POLICY_LEVEL; i: TIdC_INT): PX509_POLICY_NODE; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_policy_level_get0_node_procname); +end; + + + +function ERR_X509_policy_node_get0_policy(const node: PX509_POLICY_NODE): PASN1_OBJECT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_policy_node_get0_policy_procname); +end; + + + + //STACK_OF(POLICYQUALINFO) *X509_policy_node_get0_qualifiers(const + // X509_POLICY_NODE + // *node); +function ERR_X509_policy_node_get0_parent(const node: PX509_POLICY_NODE): PX509_POLICY_NODE; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_policy_node_get0_parent_procname); +end; + + + +{$WARN NO_RETVAL ON} + +procedure Load(const ADllHandle: TIdLibHandle; LibVersion: TIdC_UINT; const AFailed: TStringList); + +var FuncLoadError: boolean; + +begin + X509_STORE_set_depth := LoadLibFunction(ADllHandle, X509_STORE_set_depth_procname); + FuncLoadError := not assigned(X509_STORE_set_depth); + if FuncLoadError then + begin + {$if not defined(X509_STORE_set_depth_allownil)} + X509_STORE_set_depth := @ERR_X509_STORE_set_depth; + {$ifend} + {$if declared(X509_STORE_set_depth_introduced)} + if LibVersion < X509_STORE_set_depth_introduced then + begin + {$if declared(FC_X509_STORE_set_depth)} + X509_STORE_set_depth := @FC_X509_STORE_set_depth; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_STORE_set_depth_removed)} + if X509_STORE_set_depth_removed <= LibVersion then + begin + {$if declared(_X509_STORE_set_depth)} + X509_STORE_set_depth := @_X509_STORE_set_depth; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_STORE_set_depth_allownil)} + if FuncLoadError then + AFailed.Add('X509_STORE_set_depth'); + {$ifend} + end; + + + X509_STORE_CTX_set_depth := LoadLibFunction(ADllHandle, X509_STORE_CTX_set_depth_procname); + FuncLoadError := not assigned(X509_STORE_CTX_set_depth); + if FuncLoadError then + begin + {$if not defined(X509_STORE_CTX_set_depth_allownil)} + X509_STORE_CTX_set_depth := @ERR_X509_STORE_CTX_set_depth; + {$ifend} + {$if declared(X509_STORE_CTX_set_depth_introduced)} + if LibVersion < X509_STORE_CTX_set_depth_introduced then + begin + {$if declared(FC_X509_STORE_CTX_set_depth)} + X509_STORE_CTX_set_depth := @FC_X509_STORE_CTX_set_depth; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_STORE_CTX_set_depth_removed)} + if X509_STORE_CTX_set_depth_removed <= LibVersion then + begin + {$if declared(_X509_STORE_CTX_set_depth)} + X509_STORE_CTX_set_depth := @_X509_STORE_CTX_set_depth; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_STORE_CTX_set_depth_allownil)} + if FuncLoadError then + AFailed.Add('X509_STORE_CTX_set_depth'); + {$ifend} + end; + + + X509_STORE_CTX_get_app_data := LoadLibFunction(ADllHandle, X509_STORE_CTX_get_app_data_procname); + FuncLoadError := not assigned(X509_STORE_CTX_get_app_data); + if FuncLoadError then + begin + {$if not defined(X509_STORE_CTX_get_app_data_allownil)} + X509_STORE_CTX_get_app_data := @ERR_X509_STORE_CTX_get_app_data; + {$ifend} + {$if declared(X509_STORE_CTX_get_app_data_introduced)} + if LibVersion < X509_STORE_CTX_get_app_data_introduced then + begin + {$if declared(FC_X509_STORE_CTX_get_app_data)} + X509_STORE_CTX_get_app_data := @FC_X509_STORE_CTX_get_app_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_STORE_CTX_get_app_data_removed)} + if X509_STORE_CTX_get_app_data_removed <= LibVersion then + begin + {$if declared(_X509_STORE_CTX_get_app_data)} + X509_STORE_CTX_get_app_data := @_X509_STORE_CTX_get_app_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_STORE_CTX_get_app_data_allownil)} + if FuncLoadError then + AFailed.Add('X509_STORE_CTX_get_app_data'); + {$ifend} + end; + + + X509_OBJECT_up_ref_count := LoadLibFunction(ADllHandle, X509_OBJECT_up_ref_count_procname); + FuncLoadError := not assigned(X509_OBJECT_up_ref_count); + if FuncLoadError then + begin + {$if not defined(X509_OBJECT_up_ref_count_allownil)} + X509_OBJECT_up_ref_count := @ERR_X509_OBJECT_up_ref_count; + {$ifend} + {$if declared(X509_OBJECT_up_ref_count_introduced)} + if LibVersion < X509_OBJECT_up_ref_count_introduced then + begin + {$if declared(FC_X509_OBJECT_up_ref_count)} + X509_OBJECT_up_ref_count := @FC_X509_OBJECT_up_ref_count; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_OBJECT_up_ref_count_removed)} + if X509_OBJECT_up_ref_count_removed <= LibVersion then + begin + {$if declared(_X509_OBJECT_up_ref_count)} + X509_OBJECT_up_ref_count := @_X509_OBJECT_up_ref_count; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_OBJECT_up_ref_count_allownil)} + if FuncLoadError then + AFailed.Add('X509_OBJECT_up_ref_count'); + {$ifend} + end; + + + X509_OBJECT_new := LoadLibFunction(ADllHandle, X509_OBJECT_new_procname); + FuncLoadError := not assigned(X509_OBJECT_new); + if FuncLoadError then + begin + {$if not defined(X509_OBJECT_new_allownil)} + X509_OBJECT_new := @ERR_X509_OBJECT_new; + {$ifend} + {$if declared(X509_OBJECT_new_introduced)} + if LibVersion < X509_OBJECT_new_introduced then + begin + {$if declared(FC_X509_OBJECT_new)} + X509_OBJECT_new := @FC_X509_OBJECT_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_OBJECT_new_removed)} + if X509_OBJECT_new_removed <= LibVersion then + begin + {$if declared(_X509_OBJECT_new)} + X509_OBJECT_new := @_X509_OBJECT_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_OBJECT_new_allownil)} + if FuncLoadError then + AFailed.Add('X509_OBJECT_new'); + {$ifend} + end; + + {introduced 1.1.0} + X509_OBJECT_free := LoadLibFunction(ADllHandle, X509_OBJECT_free_procname); + FuncLoadError := not assigned(X509_OBJECT_free); + if FuncLoadError then + begin + {$if not defined(X509_OBJECT_free_allownil)} + X509_OBJECT_free := @ERR_X509_OBJECT_free; + {$ifend} + {$if declared(X509_OBJECT_free_introduced)} + if LibVersion < X509_OBJECT_free_introduced then + begin + {$if declared(FC_X509_OBJECT_free)} + X509_OBJECT_free := @FC_X509_OBJECT_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_OBJECT_free_removed)} + if X509_OBJECT_free_removed <= LibVersion then + begin + {$if declared(_X509_OBJECT_free)} + X509_OBJECT_free := @_X509_OBJECT_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_OBJECT_free_allownil)} + if FuncLoadError then + AFailed.Add('X509_OBJECT_free'); + {$ifend} + end; + + {introduced 1.1.0} + X509_OBJECT_get_type := LoadLibFunction(ADllHandle, X509_OBJECT_get_type_procname); + FuncLoadError := not assigned(X509_OBJECT_get_type); + if FuncLoadError then + begin + {$if not defined(X509_OBJECT_get_type_allownil)} + X509_OBJECT_get_type := @ERR_X509_OBJECT_get_type; + {$ifend} + {$if declared(X509_OBJECT_get_type_introduced)} + if LibVersion < X509_OBJECT_get_type_introduced then + begin + {$if declared(FC_X509_OBJECT_get_type)} + X509_OBJECT_get_type := @FC_X509_OBJECT_get_type; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_OBJECT_get_type_removed)} + if X509_OBJECT_get_type_removed <= LibVersion then + begin + {$if declared(_X509_OBJECT_get_type)} + X509_OBJECT_get_type := @_X509_OBJECT_get_type; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_OBJECT_get_type_allownil)} + if FuncLoadError then + AFailed.Add('X509_OBJECT_get_type'); + {$ifend} + end; + + {introduced 1.1.0} + X509_OBJECT_get0_X509 := LoadLibFunction(ADllHandle, X509_OBJECT_get0_X509_procname); + FuncLoadError := not assigned(X509_OBJECT_get0_X509); + if FuncLoadError then + begin + {$if not defined(X509_OBJECT_get0_X509_allownil)} + X509_OBJECT_get0_X509 := @ERR_X509_OBJECT_get0_X509; + {$ifend} + {$if declared(X509_OBJECT_get0_X509_introduced)} + if LibVersion < X509_OBJECT_get0_X509_introduced then + begin + {$if declared(FC_X509_OBJECT_get0_X509)} + X509_OBJECT_get0_X509 := @FC_X509_OBJECT_get0_X509; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_OBJECT_get0_X509_removed)} + if X509_OBJECT_get0_X509_removed <= LibVersion then + begin + {$if declared(_X509_OBJECT_get0_X509)} + X509_OBJECT_get0_X509 := @_X509_OBJECT_get0_X509; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_OBJECT_get0_X509_allownil)} + if FuncLoadError then + AFailed.Add('X509_OBJECT_get0_X509'); + {$ifend} + end; + + {introduced 1.1.0} + X509_OBJECT_set1_X509 := LoadLibFunction(ADllHandle, X509_OBJECT_set1_X509_procname); + FuncLoadError := not assigned(X509_OBJECT_set1_X509); + if FuncLoadError then + begin + {$if not defined(X509_OBJECT_set1_X509_allownil)} + X509_OBJECT_set1_X509 := @ERR_X509_OBJECT_set1_X509; + {$ifend} + {$if declared(X509_OBJECT_set1_X509_introduced)} + if LibVersion < X509_OBJECT_set1_X509_introduced then + begin + {$if declared(FC_X509_OBJECT_set1_X509)} + X509_OBJECT_set1_X509 := @FC_X509_OBJECT_set1_X509; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_OBJECT_set1_X509_removed)} + if X509_OBJECT_set1_X509_removed <= LibVersion then + begin + {$if declared(_X509_OBJECT_set1_X509)} + X509_OBJECT_set1_X509 := @_X509_OBJECT_set1_X509; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_OBJECT_set1_X509_allownil)} + if FuncLoadError then + AFailed.Add('X509_OBJECT_set1_X509'); + {$ifend} + end; + + {introduced 1.1.0} + X509_OBJECT_get0_X509_CRL := LoadLibFunction(ADllHandle, X509_OBJECT_get0_X509_CRL_procname); + FuncLoadError := not assigned(X509_OBJECT_get0_X509_CRL); + if FuncLoadError then + begin + {$if not defined(X509_OBJECT_get0_X509_CRL_allownil)} + X509_OBJECT_get0_X509_CRL := @ERR_X509_OBJECT_get0_X509_CRL; + {$ifend} + {$if declared(X509_OBJECT_get0_X509_CRL_introduced)} + if LibVersion < X509_OBJECT_get0_X509_CRL_introduced then + begin + {$if declared(FC_X509_OBJECT_get0_X509_CRL)} + X509_OBJECT_get0_X509_CRL := @FC_X509_OBJECT_get0_X509_CRL; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_OBJECT_get0_X509_CRL_removed)} + if X509_OBJECT_get0_X509_CRL_removed <= LibVersion then + begin + {$if declared(_X509_OBJECT_get0_X509_CRL)} + X509_OBJECT_get0_X509_CRL := @_X509_OBJECT_get0_X509_CRL; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_OBJECT_get0_X509_CRL_allownil)} + if FuncLoadError then + AFailed.Add('X509_OBJECT_get0_X509_CRL'); + {$ifend} + end; + + {introduced 1.1.0} + X509_OBJECT_set1_X509_CRL := LoadLibFunction(ADllHandle, X509_OBJECT_set1_X509_CRL_procname); + FuncLoadError := not assigned(X509_OBJECT_set1_X509_CRL); + if FuncLoadError then + begin + {$if not defined(X509_OBJECT_set1_X509_CRL_allownil)} + X509_OBJECT_set1_X509_CRL := @ERR_X509_OBJECT_set1_X509_CRL; + {$ifend} + {$if declared(X509_OBJECT_set1_X509_CRL_introduced)} + if LibVersion < X509_OBJECT_set1_X509_CRL_introduced then + begin + {$if declared(FC_X509_OBJECT_set1_X509_CRL)} + X509_OBJECT_set1_X509_CRL := @FC_X509_OBJECT_set1_X509_CRL; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_OBJECT_set1_X509_CRL_removed)} + if X509_OBJECT_set1_X509_CRL_removed <= LibVersion then + begin + {$if declared(_X509_OBJECT_set1_X509_CRL)} + X509_OBJECT_set1_X509_CRL := @_X509_OBJECT_set1_X509_CRL; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_OBJECT_set1_X509_CRL_allownil)} + if FuncLoadError then + AFailed.Add('X509_OBJECT_set1_X509_CRL'); + {$ifend} + end; + + {introduced 1.1.0} + X509_STORE_new := LoadLibFunction(ADllHandle, X509_STORE_new_procname); + FuncLoadError := not assigned(X509_STORE_new); + if FuncLoadError then + begin + {$if not defined(X509_STORE_new_allownil)} + X509_STORE_new := @ERR_X509_STORE_new; + {$ifend} + {$if declared(X509_STORE_new_introduced)} + if LibVersion < X509_STORE_new_introduced then + begin + {$if declared(FC_X509_STORE_new)} + X509_STORE_new := @FC_X509_STORE_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_STORE_new_removed)} + if X509_STORE_new_removed <= LibVersion then + begin + {$if declared(_X509_STORE_new)} + X509_STORE_new := @_X509_STORE_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_STORE_new_allownil)} + if FuncLoadError then + AFailed.Add('X509_STORE_new'); + {$ifend} + end; + + + X509_STORE_free := LoadLibFunction(ADllHandle, X509_STORE_free_procname); + FuncLoadError := not assigned(X509_STORE_free); + if FuncLoadError then + begin + {$if not defined(X509_STORE_free_allownil)} + X509_STORE_free := @ERR_X509_STORE_free; + {$ifend} + {$if declared(X509_STORE_free_introduced)} + if LibVersion < X509_STORE_free_introduced then + begin + {$if declared(FC_X509_STORE_free)} + X509_STORE_free := @FC_X509_STORE_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_STORE_free_removed)} + if X509_STORE_free_removed <= LibVersion then + begin + {$if declared(_X509_STORE_free)} + X509_STORE_free := @_X509_STORE_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_STORE_free_allownil)} + if FuncLoadError then + AFailed.Add('X509_STORE_free'); + {$ifend} + end; + + + X509_STORE_lock := LoadLibFunction(ADllHandle, X509_STORE_lock_procname); + FuncLoadError := not assigned(X509_STORE_lock); + if FuncLoadError then + begin + {$if not defined(X509_STORE_lock_allownil)} + X509_STORE_lock := @ERR_X509_STORE_lock; + {$ifend} + {$if declared(X509_STORE_lock_introduced)} + if LibVersion < X509_STORE_lock_introduced then + begin + {$if declared(FC_X509_STORE_lock)} + X509_STORE_lock := @FC_X509_STORE_lock; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_STORE_lock_removed)} + if X509_STORE_lock_removed <= LibVersion then + begin + {$if declared(_X509_STORE_lock)} + X509_STORE_lock := @_X509_STORE_lock; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_STORE_lock_allownil)} + if FuncLoadError then + AFailed.Add('X509_STORE_lock'); + {$ifend} + end; + + {introduced 1.1.0} + X509_STORE_unlock := LoadLibFunction(ADllHandle, X509_STORE_unlock_procname); + FuncLoadError := not assigned(X509_STORE_unlock); + if FuncLoadError then + begin + {$if not defined(X509_STORE_unlock_allownil)} + X509_STORE_unlock := @ERR_X509_STORE_unlock; + {$ifend} + {$if declared(X509_STORE_unlock_introduced)} + if LibVersion < X509_STORE_unlock_introduced then + begin + {$if declared(FC_X509_STORE_unlock)} + X509_STORE_unlock := @FC_X509_STORE_unlock; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_STORE_unlock_removed)} + if X509_STORE_unlock_removed <= LibVersion then + begin + {$if declared(_X509_STORE_unlock)} + X509_STORE_unlock := @_X509_STORE_unlock; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_STORE_unlock_allownil)} + if FuncLoadError then + AFailed.Add('X509_STORE_unlock'); + {$ifend} + end; + + {introduced 1.1.0} + X509_STORE_up_ref := LoadLibFunction(ADllHandle, X509_STORE_up_ref_procname); + FuncLoadError := not assigned(X509_STORE_up_ref); + if FuncLoadError then + begin + {$if not defined(X509_STORE_up_ref_allownil)} + X509_STORE_up_ref := @ERR_X509_STORE_up_ref; + {$ifend} + {$if declared(X509_STORE_up_ref_introduced)} + if LibVersion < X509_STORE_up_ref_introduced then + begin + {$if declared(FC_X509_STORE_up_ref)} + X509_STORE_up_ref := @FC_X509_STORE_up_ref; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_STORE_up_ref_removed)} + if X509_STORE_up_ref_removed <= LibVersion then + begin + {$if declared(_X509_STORE_up_ref)} + X509_STORE_up_ref := @_X509_STORE_up_ref; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_STORE_up_ref_allownil)} + if FuncLoadError then + AFailed.Add('X509_STORE_up_ref'); + {$ifend} + end; + + {introduced 1.1.0} + X509_STORE_set_flags := LoadLibFunction(ADllHandle, X509_STORE_set_flags_procname); + FuncLoadError := not assigned(X509_STORE_set_flags); + if FuncLoadError then + begin + {$if not defined(X509_STORE_set_flags_allownil)} + X509_STORE_set_flags := @ERR_X509_STORE_set_flags; + {$ifend} + {$if declared(X509_STORE_set_flags_introduced)} + if LibVersion < X509_STORE_set_flags_introduced then + begin + {$if declared(FC_X509_STORE_set_flags)} + X509_STORE_set_flags := @FC_X509_STORE_set_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_STORE_set_flags_removed)} + if X509_STORE_set_flags_removed <= LibVersion then + begin + {$if declared(_X509_STORE_set_flags)} + X509_STORE_set_flags := @_X509_STORE_set_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_STORE_set_flags_allownil)} + if FuncLoadError then + AFailed.Add('X509_STORE_set_flags'); + {$ifend} + end; + + + X509_STORE_set_purpose := LoadLibFunction(ADllHandle, X509_STORE_set_purpose_procname); + FuncLoadError := not assigned(X509_STORE_set_purpose); + if FuncLoadError then + begin + {$if not defined(X509_STORE_set_purpose_allownil)} + X509_STORE_set_purpose := @ERR_X509_STORE_set_purpose; + {$ifend} + {$if declared(X509_STORE_set_purpose_introduced)} + if LibVersion < X509_STORE_set_purpose_introduced then + begin + {$if declared(FC_X509_STORE_set_purpose)} + X509_STORE_set_purpose := @FC_X509_STORE_set_purpose; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_STORE_set_purpose_removed)} + if X509_STORE_set_purpose_removed <= LibVersion then + begin + {$if declared(_X509_STORE_set_purpose)} + X509_STORE_set_purpose := @_X509_STORE_set_purpose; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_STORE_set_purpose_allownil)} + if FuncLoadError then + AFailed.Add('X509_STORE_set_purpose'); + {$ifend} + end; + + + X509_STORE_set_trust := LoadLibFunction(ADllHandle, X509_STORE_set_trust_procname); + FuncLoadError := not assigned(X509_STORE_set_trust); + if FuncLoadError then + begin + {$if not defined(X509_STORE_set_trust_allownil)} + X509_STORE_set_trust := @ERR_X509_STORE_set_trust; + {$ifend} + {$if declared(X509_STORE_set_trust_introduced)} + if LibVersion < X509_STORE_set_trust_introduced then + begin + {$if declared(FC_X509_STORE_set_trust)} + X509_STORE_set_trust := @FC_X509_STORE_set_trust; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_STORE_set_trust_removed)} + if X509_STORE_set_trust_removed <= LibVersion then + begin + {$if declared(_X509_STORE_set_trust)} + X509_STORE_set_trust := @_X509_STORE_set_trust; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_STORE_set_trust_allownil)} + if FuncLoadError then + AFailed.Add('X509_STORE_set_trust'); + {$ifend} + end; + + + X509_STORE_set1_param := LoadLibFunction(ADllHandle, X509_STORE_set1_param_procname); + FuncLoadError := not assigned(X509_STORE_set1_param); + if FuncLoadError then + begin + {$if not defined(X509_STORE_set1_param_allownil)} + X509_STORE_set1_param := @ERR_X509_STORE_set1_param; + {$ifend} + {$if declared(X509_STORE_set1_param_introduced)} + if LibVersion < X509_STORE_set1_param_introduced then + begin + {$if declared(FC_X509_STORE_set1_param)} + X509_STORE_set1_param := @FC_X509_STORE_set1_param; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_STORE_set1_param_removed)} + if X509_STORE_set1_param_removed <= LibVersion then + begin + {$if declared(_X509_STORE_set1_param)} + X509_STORE_set1_param := @_X509_STORE_set1_param; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_STORE_set1_param_allownil)} + if FuncLoadError then + AFailed.Add('X509_STORE_set1_param'); + {$ifend} + end; + + + X509_STORE_get0_param := LoadLibFunction(ADllHandle, X509_STORE_get0_param_procname); + FuncLoadError := not assigned(X509_STORE_get0_param); + if FuncLoadError then + begin + {$if not defined(X509_STORE_get0_param_allownil)} + X509_STORE_get0_param := @ERR_X509_STORE_get0_param; + {$ifend} + {$if declared(X509_STORE_get0_param_introduced)} + if LibVersion < X509_STORE_get0_param_introduced then + begin + {$if declared(FC_X509_STORE_get0_param)} + X509_STORE_get0_param := @FC_X509_STORE_get0_param; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_STORE_get0_param_removed)} + if X509_STORE_get0_param_removed <= LibVersion then + begin + {$if declared(_X509_STORE_get0_param)} + X509_STORE_get0_param := @_X509_STORE_get0_param; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_STORE_get0_param_allownil)} + if FuncLoadError then + AFailed.Add('X509_STORE_get0_param'); + {$ifend} + end; + + {introduced 1.1.0} + X509_STORE_set_verify := LoadLibFunction(ADllHandle, X509_STORE_set_verify_procname); + FuncLoadError := not assigned(X509_STORE_set_verify); + if FuncLoadError then + begin + {$if not defined(X509_STORE_set_verify_allownil)} + X509_STORE_set_verify := @ERR_X509_STORE_set_verify; + {$ifend} + {$if declared(X509_STORE_set_verify_introduced)} + if LibVersion < X509_STORE_set_verify_introduced then + begin + {$if declared(FC_X509_STORE_set_verify)} + X509_STORE_set_verify := @FC_X509_STORE_set_verify; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_STORE_set_verify_removed)} + if X509_STORE_set_verify_removed <= LibVersion then + begin + {$if declared(_X509_STORE_set_verify)} + X509_STORE_set_verify := @_X509_STORE_set_verify; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_STORE_set_verify_allownil)} + if FuncLoadError then + AFailed.Add('X509_STORE_set_verify'); + {$ifend} + end; + + {introduced 1.1.0} + X509_STORE_CTX_set_verify := LoadLibFunction(ADllHandle, X509_STORE_CTX_set_verify_procname); + FuncLoadError := not assigned(X509_STORE_CTX_set_verify); + if FuncLoadError then + begin + {$if not defined(X509_STORE_CTX_set_verify_allownil)} + X509_STORE_CTX_set_verify := @ERR_X509_STORE_CTX_set_verify; + {$ifend} + {$if declared(X509_STORE_CTX_set_verify_introduced)} + if LibVersion < X509_STORE_CTX_set_verify_introduced then + begin + {$if declared(FC_X509_STORE_CTX_set_verify)} + X509_STORE_CTX_set_verify := @FC_X509_STORE_CTX_set_verify; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_STORE_CTX_set_verify_removed)} + if X509_STORE_CTX_set_verify_removed <= LibVersion then + begin + {$if declared(_X509_STORE_CTX_set_verify)} + X509_STORE_CTX_set_verify := @_X509_STORE_CTX_set_verify; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_STORE_CTX_set_verify_allownil)} + if FuncLoadError then + AFailed.Add('X509_STORE_CTX_set_verify'); + {$ifend} + end; + + {introduced 1.1.0} + X509_STORE_get_verify := LoadLibFunction(ADllHandle, X509_STORE_get_verify_procname); + FuncLoadError := not assigned(X509_STORE_get_verify); + if FuncLoadError then + begin + {$if not defined(X509_STORE_get_verify_allownil)} + X509_STORE_get_verify := @ERR_X509_STORE_get_verify; + {$ifend} + {$if declared(X509_STORE_get_verify_introduced)} + if LibVersion < X509_STORE_get_verify_introduced then + begin + {$if declared(FC_X509_STORE_get_verify)} + X509_STORE_get_verify := @FC_X509_STORE_get_verify; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_STORE_get_verify_removed)} + if X509_STORE_get_verify_removed <= LibVersion then + begin + {$if declared(_X509_STORE_get_verify)} + X509_STORE_get_verify := @_X509_STORE_get_verify; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_STORE_get_verify_allownil)} + if FuncLoadError then + AFailed.Add('X509_STORE_get_verify'); + {$ifend} + end; + + {introduced 1.1.0} + X509_STORE_set_verify_cb := LoadLibFunction(ADllHandle, X509_STORE_set_verify_cb_procname); + FuncLoadError := not assigned(X509_STORE_set_verify_cb); + if FuncLoadError then + begin + {$if not defined(X509_STORE_set_verify_cb_allownil)} + X509_STORE_set_verify_cb := @ERR_X509_STORE_set_verify_cb; + {$ifend} + {$if declared(X509_STORE_set_verify_cb_introduced)} + if LibVersion < X509_STORE_set_verify_cb_introduced then + begin + {$if declared(FC_X509_STORE_set_verify_cb)} + X509_STORE_set_verify_cb := @FC_X509_STORE_set_verify_cb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_STORE_set_verify_cb_removed)} + if X509_STORE_set_verify_cb_removed <= LibVersion then + begin + {$if declared(_X509_STORE_set_verify_cb)} + X509_STORE_set_verify_cb := @_X509_STORE_set_verify_cb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_STORE_set_verify_cb_allownil)} + if FuncLoadError then + AFailed.Add('X509_STORE_set_verify_cb'); + {$ifend} + end; + + + X509_STORE_get_verify_cb := LoadLibFunction(ADllHandle, X509_STORE_get_verify_cb_procname); + FuncLoadError := not assigned(X509_STORE_get_verify_cb); + if FuncLoadError then + begin + {$if not defined(X509_STORE_get_verify_cb_allownil)} + X509_STORE_get_verify_cb := @ERR_X509_STORE_get_verify_cb; + {$ifend} + {$if declared(X509_STORE_get_verify_cb_introduced)} + if LibVersion < X509_STORE_get_verify_cb_introduced then + begin + {$if declared(FC_X509_STORE_get_verify_cb)} + X509_STORE_get_verify_cb := @FC_X509_STORE_get_verify_cb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_STORE_get_verify_cb_removed)} + if X509_STORE_get_verify_cb_removed <= LibVersion then + begin + {$if declared(_X509_STORE_get_verify_cb)} + X509_STORE_get_verify_cb := @_X509_STORE_get_verify_cb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_STORE_get_verify_cb_allownil)} + if FuncLoadError then + AFailed.Add('X509_STORE_get_verify_cb'); + {$ifend} + end; + + {introduced 1.1.0} + X509_STORE_set_get_issuer := LoadLibFunction(ADllHandle, X509_STORE_set_get_issuer_procname); + FuncLoadError := not assigned(X509_STORE_set_get_issuer); + if FuncLoadError then + begin + {$if not defined(X509_STORE_set_get_issuer_allownil)} + X509_STORE_set_get_issuer := @ERR_X509_STORE_set_get_issuer; + {$ifend} + {$if declared(X509_STORE_set_get_issuer_introduced)} + if LibVersion < X509_STORE_set_get_issuer_introduced then + begin + {$if declared(FC_X509_STORE_set_get_issuer)} + X509_STORE_set_get_issuer := @FC_X509_STORE_set_get_issuer; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_STORE_set_get_issuer_removed)} + if X509_STORE_set_get_issuer_removed <= LibVersion then + begin + {$if declared(_X509_STORE_set_get_issuer)} + X509_STORE_set_get_issuer := @_X509_STORE_set_get_issuer; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_STORE_set_get_issuer_allownil)} + if FuncLoadError then + AFailed.Add('X509_STORE_set_get_issuer'); + {$ifend} + end; + + {introduced 1.1.0} + X509_STORE_get_get_issuer := LoadLibFunction(ADllHandle, X509_STORE_get_get_issuer_procname); + FuncLoadError := not assigned(X509_STORE_get_get_issuer); + if FuncLoadError then + begin + {$if not defined(X509_STORE_get_get_issuer_allownil)} + X509_STORE_get_get_issuer := @ERR_X509_STORE_get_get_issuer; + {$ifend} + {$if declared(X509_STORE_get_get_issuer_introduced)} + if LibVersion < X509_STORE_get_get_issuer_introduced then + begin + {$if declared(FC_X509_STORE_get_get_issuer)} + X509_STORE_get_get_issuer := @FC_X509_STORE_get_get_issuer; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_STORE_get_get_issuer_removed)} + if X509_STORE_get_get_issuer_removed <= LibVersion then + begin + {$if declared(_X509_STORE_get_get_issuer)} + X509_STORE_get_get_issuer := @_X509_STORE_get_get_issuer; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_STORE_get_get_issuer_allownil)} + if FuncLoadError then + AFailed.Add('X509_STORE_get_get_issuer'); + {$ifend} + end; + + {introduced 1.1.0} + X509_STORE_set_check_issued := LoadLibFunction(ADllHandle, X509_STORE_set_check_issued_procname); + FuncLoadError := not assigned(X509_STORE_set_check_issued); + if FuncLoadError then + begin + {$if not defined(X509_STORE_set_check_issued_allownil)} + X509_STORE_set_check_issued := @ERR_X509_STORE_set_check_issued; + {$ifend} + {$if declared(X509_STORE_set_check_issued_introduced)} + if LibVersion < X509_STORE_set_check_issued_introduced then + begin + {$if declared(FC_X509_STORE_set_check_issued)} + X509_STORE_set_check_issued := @FC_X509_STORE_set_check_issued; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_STORE_set_check_issued_removed)} + if X509_STORE_set_check_issued_removed <= LibVersion then + begin + {$if declared(_X509_STORE_set_check_issued)} + X509_STORE_set_check_issued := @_X509_STORE_set_check_issued; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_STORE_set_check_issued_allownil)} + if FuncLoadError then + AFailed.Add('X509_STORE_set_check_issued'); + {$ifend} + end; + + {introduced 1.1.0} + X509_STORE_get_check_issued := LoadLibFunction(ADllHandle, X509_STORE_get_check_issued_procname); + FuncLoadError := not assigned(X509_STORE_get_check_issued); + if FuncLoadError then + begin + {$if not defined(X509_STORE_get_check_issued_allownil)} + X509_STORE_get_check_issued := @ERR_X509_STORE_get_check_issued; + {$ifend} + {$if declared(X509_STORE_get_check_issued_introduced)} + if LibVersion < X509_STORE_get_check_issued_introduced then + begin + {$if declared(FC_X509_STORE_get_check_issued)} + X509_STORE_get_check_issued := @FC_X509_STORE_get_check_issued; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_STORE_get_check_issued_removed)} + if X509_STORE_get_check_issued_removed <= LibVersion then + begin + {$if declared(_X509_STORE_get_check_issued)} + X509_STORE_get_check_issued := @_X509_STORE_get_check_issued; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_STORE_get_check_issued_allownil)} + if FuncLoadError then + AFailed.Add('X509_STORE_get_check_issued'); + {$ifend} + end; + + {introduced 1.1.0} + X509_STORE_set_check_revocation := LoadLibFunction(ADllHandle, X509_STORE_set_check_revocation_procname); + FuncLoadError := not assigned(X509_STORE_set_check_revocation); + if FuncLoadError then + begin + {$if not defined(X509_STORE_set_check_revocation_allownil)} + X509_STORE_set_check_revocation := @ERR_X509_STORE_set_check_revocation; + {$ifend} + {$if declared(X509_STORE_set_check_revocation_introduced)} + if LibVersion < X509_STORE_set_check_revocation_introduced then + begin + {$if declared(FC_X509_STORE_set_check_revocation)} + X509_STORE_set_check_revocation := @FC_X509_STORE_set_check_revocation; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_STORE_set_check_revocation_removed)} + if X509_STORE_set_check_revocation_removed <= LibVersion then + begin + {$if declared(_X509_STORE_set_check_revocation)} + X509_STORE_set_check_revocation := @_X509_STORE_set_check_revocation; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_STORE_set_check_revocation_allownil)} + if FuncLoadError then + AFailed.Add('X509_STORE_set_check_revocation'); + {$ifend} + end; + + {introduced 1.1.0} + X509_STORE_get_check_revocation := LoadLibFunction(ADllHandle, X509_STORE_get_check_revocation_procname); + FuncLoadError := not assigned(X509_STORE_get_check_revocation); + if FuncLoadError then + begin + {$if not defined(X509_STORE_get_check_revocation_allownil)} + X509_STORE_get_check_revocation := @ERR_X509_STORE_get_check_revocation; + {$ifend} + {$if declared(X509_STORE_get_check_revocation_introduced)} + if LibVersion < X509_STORE_get_check_revocation_introduced then + begin + {$if declared(FC_X509_STORE_get_check_revocation)} + X509_STORE_get_check_revocation := @FC_X509_STORE_get_check_revocation; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_STORE_get_check_revocation_removed)} + if X509_STORE_get_check_revocation_removed <= LibVersion then + begin + {$if declared(_X509_STORE_get_check_revocation)} + X509_STORE_get_check_revocation := @_X509_STORE_get_check_revocation; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_STORE_get_check_revocation_allownil)} + if FuncLoadError then + AFailed.Add('X509_STORE_get_check_revocation'); + {$ifend} + end; + + {introduced 1.1.0} + X509_STORE_set_get_crl := LoadLibFunction(ADllHandle, X509_STORE_set_get_crl_procname); + FuncLoadError := not assigned(X509_STORE_set_get_crl); + if FuncLoadError then + begin + {$if not defined(X509_STORE_set_get_crl_allownil)} + X509_STORE_set_get_crl := @ERR_X509_STORE_set_get_crl; + {$ifend} + {$if declared(X509_STORE_set_get_crl_introduced)} + if LibVersion < X509_STORE_set_get_crl_introduced then + begin + {$if declared(FC_X509_STORE_set_get_crl)} + X509_STORE_set_get_crl := @FC_X509_STORE_set_get_crl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_STORE_set_get_crl_removed)} + if X509_STORE_set_get_crl_removed <= LibVersion then + begin + {$if declared(_X509_STORE_set_get_crl)} + X509_STORE_set_get_crl := @_X509_STORE_set_get_crl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_STORE_set_get_crl_allownil)} + if FuncLoadError then + AFailed.Add('X509_STORE_set_get_crl'); + {$ifend} + end; + + {introduced 1.1.0} + X509_STORE_get_get_crl := LoadLibFunction(ADllHandle, X509_STORE_get_get_crl_procname); + FuncLoadError := not assigned(X509_STORE_get_get_crl); + if FuncLoadError then + begin + {$if not defined(X509_STORE_get_get_crl_allownil)} + X509_STORE_get_get_crl := @ERR_X509_STORE_get_get_crl; + {$ifend} + {$if declared(X509_STORE_get_get_crl_introduced)} + if LibVersion < X509_STORE_get_get_crl_introduced then + begin + {$if declared(FC_X509_STORE_get_get_crl)} + X509_STORE_get_get_crl := @FC_X509_STORE_get_get_crl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_STORE_get_get_crl_removed)} + if X509_STORE_get_get_crl_removed <= LibVersion then + begin + {$if declared(_X509_STORE_get_get_crl)} + X509_STORE_get_get_crl := @_X509_STORE_get_get_crl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_STORE_get_get_crl_allownil)} + if FuncLoadError then + AFailed.Add('X509_STORE_get_get_crl'); + {$ifend} + end; + + {introduced 1.1.0} + X509_STORE_set_check_crl := LoadLibFunction(ADllHandle, X509_STORE_set_check_crl_procname); + FuncLoadError := not assigned(X509_STORE_set_check_crl); + if FuncLoadError then + begin + {$if not defined(X509_STORE_set_check_crl_allownil)} + X509_STORE_set_check_crl := @ERR_X509_STORE_set_check_crl; + {$ifend} + {$if declared(X509_STORE_set_check_crl_introduced)} + if LibVersion < X509_STORE_set_check_crl_introduced then + begin + {$if declared(FC_X509_STORE_set_check_crl)} + X509_STORE_set_check_crl := @FC_X509_STORE_set_check_crl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_STORE_set_check_crl_removed)} + if X509_STORE_set_check_crl_removed <= LibVersion then + begin + {$if declared(_X509_STORE_set_check_crl)} + X509_STORE_set_check_crl := @_X509_STORE_set_check_crl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_STORE_set_check_crl_allownil)} + if FuncLoadError then + AFailed.Add('X509_STORE_set_check_crl'); + {$ifend} + end; + + {introduced 1.1.0} + X509_STORE_get_check_crl := LoadLibFunction(ADllHandle, X509_STORE_get_check_crl_procname); + FuncLoadError := not assigned(X509_STORE_get_check_crl); + if FuncLoadError then + begin + {$if not defined(X509_STORE_get_check_crl_allownil)} + X509_STORE_get_check_crl := @ERR_X509_STORE_get_check_crl; + {$ifend} + {$if declared(X509_STORE_get_check_crl_introduced)} + if LibVersion < X509_STORE_get_check_crl_introduced then + begin + {$if declared(FC_X509_STORE_get_check_crl)} + X509_STORE_get_check_crl := @FC_X509_STORE_get_check_crl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_STORE_get_check_crl_removed)} + if X509_STORE_get_check_crl_removed <= LibVersion then + begin + {$if declared(_X509_STORE_get_check_crl)} + X509_STORE_get_check_crl := @_X509_STORE_get_check_crl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_STORE_get_check_crl_allownil)} + if FuncLoadError then + AFailed.Add('X509_STORE_get_check_crl'); + {$ifend} + end; + + {introduced 1.1.0} + X509_STORE_set_cert_crl := LoadLibFunction(ADllHandle, X509_STORE_set_cert_crl_procname); + FuncLoadError := not assigned(X509_STORE_set_cert_crl); + if FuncLoadError then + begin + {$if not defined(X509_STORE_set_cert_crl_allownil)} + X509_STORE_set_cert_crl := @ERR_X509_STORE_set_cert_crl; + {$ifend} + {$if declared(X509_STORE_set_cert_crl_introduced)} + if LibVersion < X509_STORE_set_cert_crl_introduced then + begin + {$if declared(FC_X509_STORE_set_cert_crl)} + X509_STORE_set_cert_crl := @FC_X509_STORE_set_cert_crl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_STORE_set_cert_crl_removed)} + if X509_STORE_set_cert_crl_removed <= LibVersion then + begin + {$if declared(_X509_STORE_set_cert_crl)} + X509_STORE_set_cert_crl := @_X509_STORE_set_cert_crl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_STORE_set_cert_crl_allownil)} + if FuncLoadError then + AFailed.Add('X509_STORE_set_cert_crl'); + {$ifend} + end; + + {introduced 1.1.0} + X509_STORE_get_cert_crl := LoadLibFunction(ADllHandle, X509_STORE_get_cert_crl_procname); + FuncLoadError := not assigned(X509_STORE_get_cert_crl); + if FuncLoadError then + begin + {$if not defined(X509_STORE_get_cert_crl_allownil)} + X509_STORE_get_cert_crl := @ERR_X509_STORE_get_cert_crl; + {$ifend} + {$if declared(X509_STORE_get_cert_crl_introduced)} + if LibVersion < X509_STORE_get_cert_crl_introduced then + begin + {$if declared(FC_X509_STORE_get_cert_crl)} + X509_STORE_get_cert_crl := @FC_X509_STORE_get_cert_crl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_STORE_get_cert_crl_removed)} + if X509_STORE_get_cert_crl_removed <= LibVersion then + begin + {$if declared(_X509_STORE_get_cert_crl)} + X509_STORE_get_cert_crl := @_X509_STORE_get_cert_crl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_STORE_get_cert_crl_allownil)} + if FuncLoadError then + AFailed.Add('X509_STORE_get_cert_crl'); + {$ifend} + end; + + {introduced 1.1.0} + X509_STORE_set_check_policy := LoadLibFunction(ADllHandle, X509_STORE_set_check_policy_procname); + FuncLoadError := not assigned(X509_STORE_set_check_policy); + if FuncLoadError then + begin + {$if not defined(X509_STORE_set_check_policy_allownil)} + X509_STORE_set_check_policy := @ERR_X509_STORE_set_check_policy; + {$ifend} + {$if declared(X509_STORE_set_check_policy_introduced)} + if LibVersion < X509_STORE_set_check_policy_introduced then + begin + {$if declared(FC_X509_STORE_set_check_policy)} + X509_STORE_set_check_policy := @FC_X509_STORE_set_check_policy; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_STORE_set_check_policy_removed)} + if X509_STORE_set_check_policy_removed <= LibVersion then + begin + {$if declared(_X509_STORE_set_check_policy)} + X509_STORE_set_check_policy := @_X509_STORE_set_check_policy; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_STORE_set_check_policy_allownil)} + if FuncLoadError then + AFailed.Add('X509_STORE_set_check_policy'); + {$ifend} + end; + + {introduced 1.1.0} + X509_STORE_get_check_policy := LoadLibFunction(ADllHandle, X509_STORE_get_check_policy_procname); + FuncLoadError := not assigned(X509_STORE_get_check_policy); + if FuncLoadError then + begin + {$if not defined(X509_STORE_get_check_policy_allownil)} + X509_STORE_get_check_policy := @ERR_X509_STORE_get_check_policy; + {$ifend} + {$if declared(X509_STORE_get_check_policy_introduced)} + if LibVersion < X509_STORE_get_check_policy_introduced then + begin + {$if declared(FC_X509_STORE_get_check_policy)} + X509_STORE_get_check_policy := @FC_X509_STORE_get_check_policy; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_STORE_get_check_policy_removed)} + if X509_STORE_get_check_policy_removed <= LibVersion then + begin + {$if declared(_X509_STORE_get_check_policy)} + X509_STORE_get_check_policy := @_X509_STORE_get_check_policy; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_STORE_get_check_policy_allownil)} + if FuncLoadError then + AFailed.Add('X509_STORE_get_check_policy'); + {$ifend} + end; + + {introduced 1.1.0} + X509_STORE_set_cleanup := LoadLibFunction(ADllHandle, X509_STORE_set_cleanup_procname); + FuncLoadError := not assigned(X509_STORE_set_cleanup); + if FuncLoadError then + begin + {$if not defined(X509_STORE_set_cleanup_allownil)} + X509_STORE_set_cleanup := @ERR_X509_STORE_set_cleanup; + {$ifend} + {$if declared(X509_STORE_set_cleanup_introduced)} + if LibVersion < X509_STORE_set_cleanup_introduced then + begin + {$if declared(FC_X509_STORE_set_cleanup)} + X509_STORE_set_cleanup := @FC_X509_STORE_set_cleanup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_STORE_set_cleanup_removed)} + if X509_STORE_set_cleanup_removed <= LibVersion then + begin + {$if declared(_X509_STORE_set_cleanup)} + X509_STORE_set_cleanup := @_X509_STORE_set_cleanup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_STORE_set_cleanup_allownil)} + if FuncLoadError then + AFailed.Add('X509_STORE_set_cleanup'); + {$ifend} + end; + + {introduced 1.1.0} + X509_STORE_get_cleanup := LoadLibFunction(ADllHandle, X509_STORE_get_cleanup_procname); + FuncLoadError := not assigned(X509_STORE_get_cleanup); + if FuncLoadError then + begin + {$if not defined(X509_STORE_get_cleanup_allownil)} + X509_STORE_get_cleanup := @ERR_X509_STORE_get_cleanup; + {$ifend} + {$if declared(X509_STORE_get_cleanup_introduced)} + if LibVersion < X509_STORE_get_cleanup_introduced then + begin + {$if declared(FC_X509_STORE_get_cleanup)} + X509_STORE_get_cleanup := @FC_X509_STORE_get_cleanup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_STORE_get_cleanup_removed)} + if X509_STORE_get_cleanup_removed <= LibVersion then + begin + {$if declared(_X509_STORE_get_cleanup)} + X509_STORE_get_cleanup := @_X509_STORE_get_cleanup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_STORE_get_cleanup_allownil)} + if FuncLoadError then + AFailed.Add('X509_STORE_get_cleanup'); + {$ifend} + end; + + {introduced 1.1.0} + X509_STORE_set_ex_data := LoadLibFunction(ADllHandle, X509_STORE_set_ex_data_procname); + FuncLoadError := not assigned(X509_STORE_set_ex_data); + if FuncLoadError then + begin + {$if not defined(X509_STORE_set_ex_data_allownil)} + X509_STORE_set_ex_data := @ERR_X509_STORE_set_ex_data; + {$ifend} + {$if declared(X509_STORE_set_ex_data_introduced)} + if LibVersion < X509_STORE_set_ex_data_introduced then + begin + {$if declared(FC_X509_STORE_set_ex_data)} + X509_STORE_set_ex_data := @FC_X509_STORE_set_ex_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_STORE_set_ex_data_removed)} + if X509_STORE_set_ex_data_removed <= LibVersion then + begin + {$if declared(_X509_STORE_set_ex_data)} + X509_STORE_set_ex_data := @_X509_STORE_set_ex_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_STORE_set_ex_data_allownil)} + if FuncLoadError then + AFailed.Add('X509_STORE_set_ex_data'); + {$ifend} + end; + + {introduced 1.1.0} + X509_STORE_get_ex_data := LoadLibFunction(ADllHandle, X509_STORE_get_ex_data_procname); + FuncLoadError := not assigned(X509_STORE_get_ex_data); + if FuncLoadError then + begin + {$if not defined(X509_STORE_get_ex_data_allownil)} + X509_STORE_get_ex_data := @ERR_X509_STORE_get_ex_data; + {$ifend} + {$if declared(X509_STORE_get_ex_data_introduced)} + if LibVersion < X509_STORE_get_ex_data_introduced then + begin + {$if declared(FC_X509_STORE_get_ex_data)} + X509_STORE_get_ex_data := @FC_X509_STORE_get_ex_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_STORE_get_ex_data_removed)} + if X509_STORE_get_ex_data_removed <= LibVersion then + begin + {$if declared(_X509_STORE_get_ex_data)} + X509_STORE_get_ex_data := @_X509_STORE_get_ex_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_STORE_get_ex_data_allownil)} + if FuncLoadError then + AFailed.Add('X509_STORE_get_ex_data'); + {$ifend} + end; + + {introduced 1.1.0} + X509_STORE_CTX_new := LoadLibFunction(ADllHandle, X509_STORE_CTX_new_procname); + FuncLoadError := not assigned(X509_STORE_CTX_new); + if FuncLoadError then + begin + {$if not defined(X509_STORE_CTX_new_allownil)} + X509_STORE_CTX_new := @ERR_X509_STORE_CTX_new; + {$ifend} + {$if declared(X509_STORE_CTX_new_introduced)} + if LibVersion < X509_STORE_CTX_new_introduced then + begin + {$if declared(FC_X509_STORE_CTX_new)} + X509_STORE_CTX_new := @FC_X509_STORE_CTX_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_STORE_CTX_new_removed)} + if X509_STORE_CTX_new_removed <= LibVersion then + begin + {$if declared(_X509_STORE_CTX_new)} + X509_STORE_CTX_new := @_X509_STORE_CTX_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_STORE_CTX_new_allownil)} + if FuncLoadError then + AFailed.Add('X509_STORE_CTX_new'); + {$ifend} + end; + + + X509_STORE_CTX_get1_issuer := LoadLibFunction(ADllHandle, X509_STORE_CTX_get1_issuer_procname); + FuncLoadError := not assigned(X509_STORE_CTX_get1_issuer); + if FuncLoadError then + begin + {$if not defined(X509_STORE_CTX_get1_issuer_allownil)} + X509_STORE_CTX_get1_issuer := @ERR_X509_STORE_CTX_get1_issuer; + {$ifend} + {$if declared(X509_STORE_CTX_get1_issuer_introduced)} + if LibVersion < X509_STORE_CTX_get1_issuer_introduced then + begin + {$if declared(FC_X509_STORE_CTX_get1_issuer)} + X509_STORE_CTX_get1_issuer := @FC_X509_STORE_CTX_get1_issuer; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_STORE_CTX_get1_issuer_removed)} + if X509_STORE_CTX_get1_issuer_removed <= LibVersion then + begin + {$if declared(_X509_STORE_CTX_get1_issuer)} + X509_STORE_CTX_get1_issuer := @_X509_STORE_CTX_get1_issuer; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_STORE_CTX_get1_issuer_allownil)} + if FuncLoadError then + AFailed.Add('X509_STORE_CTX_get1_issuer'); + {$ifend} + end; + + + X509_STORE_CTX_free := LoadLibFunction(ADllHandle, X509_STORE_CTX_free_procname); + FuncLoadError := not assigned(X509_STORE_CTX_free); + if FuncLoadError then + begin + {$if not defined(X509_STORE_CTX_free_allownil)} + X509_STORE_CTX_free := @ERR_X509_STORE_CTX_free; + {$ifend} + {$if declared(X509_STORE_CTX_free_introduced)} + if LibVersion < X509_STORE_CTX_free_introduced then + begin + {$if declared(FC_X509_STORE_CTX_free)} + X509_STORE_CTX_free := @FC_X509_STORE_CTX_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_STORE_CTX_free_removed)} + if X509_STORE_CTX_free_removed <= LibVersion then + begin + {$if declared(_X509_STORE_CTX_free)} + X509_STORE_CTX_free := @_X509_STORE_CTX_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_STORE_CTX_free_allownil)} + if FuncLoadError then + AFailed.Add('X509_STORE_CTX_free'); + {$ifend} + end; + + + X509_STORE_CTX_cleanup := LoadLibFunction(ADllHandle, X509_STORE_CTX_cleanup_procname); + FuncLoadError := not assigned(X509_STORE_CTX_cleanup); + if FuncLoadError then + begin + {$if not defined(X509_STORE_CTX_cleanup_allownil)} + X509_STORE_CTX_cleanup := @ERR_X509_STORE_CTX_cleanup; + {$ifend} + {$if declared(X509_STORE_CTX_cleanup_introduced)} + if LibVersion < X509_STORE_CTX_cleanup_introduced then + begin + {$if declared(FC_X509_STORE_CTX_cleanup)} + X509_STORE_CTX_cleanup := @FC_X509_STORE_CTX_cleanup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_STORE_CTX_cleanup_removed)} + if X509_STORE_CTX_cleanup_removed <= LibVersion then + begin + {$if declared(_X509_STORE_CTX_cleanup)} + X509_STORE_CTX_cleanup := @_X509_STORE_CTX_cleanup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_STORE_CTX_cleanup_allownil)} + if FuncLoadError then + AFailed.Add('X509_STORE_CTX_cleanup'); + {$ifend} + end; + + + X509_STORE_CTX_get0_store := LoadLibFunction(ADllHandle, X509_STORE_CTX_get0_store_procname); + FuncLoadError := not assigned(X509_STORE_CTX_get0_store); + if FuncLoadError then + begin + {$if not defined(X509_STORE_CTX_get0_store_allownil)} + X509_STORE_CTX_get0_store := @ERR_X509_STORE_CTX_get0_store; + {$ifend} + {$if declared(X509_STORE_CTX_get0_store_introduced)} + if LibVersion < X509_STORE_CTX_get0_store_introduced then + begin + {$if declared(FC_X509_STORE_CTX_get0_store)} + X509_STORE_CTX_get0_store := @FC_X509_STORE_CTX_get0_store; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_STORE_CTX_get0_store_removed)} + if X509_STORE_CTX_get0_store_removed <= LibVersion then + begin + {$if declared(_X509_STORE_CTX_get0_store)} + X509_STORE_CTX_get0_store := @_X509_STORE_CTX_get0_store; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_STORE_CTX_get0_store_allownil)} + if FuncLoadError then + AFailed.Add('X509_STORE_CTX_get0_store'); + {$ifend} + end; + + + X509_STORE_CTX_get0_cert := LoadLibFunction(ADllHandle, X509_STORE_CTX_get0_cert_procname); + FuncLoadError := not assigned(X509_STORE_CTX_get0_cert); + if FuncLoadError then + begin + {$if not defined(X509_STORE_CTX_get0_cert_allownil)} + X509_STORE_CTX_get0_cert := @ERR_X509_STORE_CTX_get0_cert; + {$ifend} + {$if declared(X509_STORE_CTX_get0_cert_introduced)} + if LibVersion < X509_STORE_CTX_get0_cert_introduced then + begin + {$if declared(FC_X509_STORE_CTX_get0_cert)} + X509_STORE_CTX_get0_cert := @FC_X509_STORE_CTX_get0_cert; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_STORE_CTX_get0_cert_removed)} + if X509_STORE_CTX_get0_cert_removed <= LibVersion then + begin + {$if declared(_X509_STORE_CTX_get0_cert)} + X509_STORE_CTX_get0_cert := @_X509_STORE_CTX_get0_cert; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_STORE_CTX_get0_cert_allownil)} + if FuncLoadError then + AFailed.Add('X509_STORE_CTX_get0_cert'); + {$ifend} + end; + + {introduced 1.1.0} + X509_STORE_CTX_set_verify_cb := LoadLibFunction(ADllHandle, X509_STORE_CTX_set_verify_cb_procname); + FuncLoadError := not assigned(X509_STORE_CTX_set_verify_cb); + if FuncLoadError then + begin + {$if not defined(X509_STORE_CTX_set_verify_cb_allownil)} + X509_STORE_CTX_set_verify_cb := @ERR_X509_STORE_CTX_set_verify_cb; + {$ifend} + {$if declared(X509_STORE_CTX_set_verify_cb_introduced)} + if LibVersion < X509_STORE_CTX_set_verify_cb_introduced then + begin + {$if declared(FC_X509_STORE_CTX_set_verify_cb)} + X509_STORE_CTX_set_verify_cb := @FC_X509_STORE_CTX_set_verify_cb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_STORE_CTX_set_verify_cb_removed)} + if X509_STORE_CTX_set_verify_cb_removed <= LibVersion then + begin + {$if declared(_X509_STORE_CTX_set_verify_cb)} + X509_STORE_CTX_set_verify_cb := @_X509_STORE_CTX_set_verify_cb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_STORE_CTX_set_verify_cb_allownil)} + if FuncLoadError then + AFailed.Add('X509_STORE_CTX_set_verify_cb'); + {$ifend} + end; + + + X509_STORE_CTX_get_verify_cb := LoadLibFunction(ADllHandle, X509_STORE_CTX_get_verify_cb_procname); + FuncLoadError := not assigned(X509_STORE_CTX_get_verify_cb); + if FuncLoadError then + begin + {$if not defined(X509_STORE_CTX_get_verify_cb_allownil)} + X509_STORE_CTX_get_verify_cb := @ERR_X509_STORE_CTX_get_verify_cb; + {$ifend} + {$if declared(X509_STORE_CTX_get_verify_cb_introduced)} + if LibVersion < X509_STORE_CTX_get_verify_cb_introduced then + begin + {$if declared(FC_X509_STORE_CTX_get_verify_cb)} + X509_STORE_CTX_get_verify_cb := @FC_X509_STORE_CTX_get_verify_cb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_STORE_CTX_get_verify_cb_removed)} + if X509_STORE_CTX_get_verify_cb_removed <= LibVersion then + begin + {$if declared(_X509_STORE_CTX_get_verify_cb)} + X509_STORE_CTX_get_verify_cb := @_X509_STORE_CTX_get_verify_cb; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_STORE_CTX_get_verify_cb_allownil)} + if FuncLoadError then + AFailed.Add('X509_STORE_CTX_get_verify_cb'); + {$ifend} + end; + + {introduced 1.1.0} + X509_STORE_CTX_get_verify := LoadLibFunction(ADllHandle, X509_STORE_CTX_get_verify_procname); + FuncLoadError := not assigned(X509_STORE_CTX_get_verify); + if FuncLoadError then + begin + {$if not defined(X509_STORE_CTX_get_verify_allownil)} + X509_STORE_CTX_get_verify := @ERR_X509_STORE_CTX_get_verify; + {$ifend} + {$if declared(X509_STORE_CTX_get_verify_introduced)} + if LibVersion < X509_STORE_CTX_get_verify_introduced then + begin + {$if declared(FC_X509_STORE_CTX_get_verify)} + X509_STORE_CTX_get_verify := @FC_X509_STORE_CTX_get_verify; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_STORE_CTX_get_verify_removed)} + if X509_STORE_CTX_get_verify_removed <= LibVersion then + begin + {$if declared(_X509_STORE_CTX_get_verify)} + X509_STORE_CTX_get_verify := @_X509_STORE_CTX_get_verify; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_STORE_CTX_get_verify_allownil)} + if FuncLoadError then + AFailed.Add('X509_STORE_CTX_get_verify'); + {$ifend} + end; + + {introduced 1.1.0} + X509_STORE_CTX_get_get_issuer := LoadLibFunction(ADllHandle, X509_STORE_CTX_get_get_issuer_procname); + FuncLoadError := not assigned(X509_STORE_CTX_get_get_issuer); + if FuncLoadError then + begin + {$if not defined(X509_STORE_CTX_get_get_issuer_allownil)} + X509_STORE_CTX_get_get_issuer := @ERR_X509_STORE_CTX_get_get_issuer; + {$ifend} + {$if declared(X509_STORE_CTX_get_get_issuer_introduced)} + if LibVersion < X509_STORE_CTX_get_get_issuer_introduced then + begin + {$if declared(FC_X509_STORE_CTX_get_get_issuer)} + X509_STORE_CTX_get_get_issuer := @FC_X509_STORE_CTX_get_get_issuer; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_STORE_CTX_get_get_issuer_removed)} + if X509_STORE_CTX_get_get_issuer_removed <= LibVersion then + begin + {$if declared(_X509_STORE_CTX_get_get_issuer)} + X509_STORE_CTX_get_get_issuer := @_X509_STORE_CTX_get_get_issuer; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_STORE_CTX_get_get_issuer_allownil)} + if FuncLoadError then + AFailed.Add('X509_STORE_CTX_get_get_issuer'); + {$ifend} + end; + + {introduced 1.1.0} + X509_STORE_CTX_get_check_issued := LoadLibFunction(ADllHandle, X509_STORE_CTX_get_check_issued_procname); + FuncLoadError := not assigned(X509_STORE_CTX_get_check_issued); + if FuncLoadError then + begin + {$if not defined(X509_STORE_CTX_get_check_issued_allownil)} + X509_STORE_CTX_get_check_issued := @ERR_X509_STORE_CTX_get_check_issued; + {$ifend} + {$if declared(X509_STORE_CTX_get_check_issued_introduced)} + if LibVersion < X509_STORE_CTX_get_check_issued_introduced then + begin + {$if declared(FC_X509_STORE_CTX_get_check_issued)} + X509_STORE_CTX_get_check_issued := @FC_X509_STORE_CTX_get_check_issued; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_STORE_CTX_get_check_issued_removed)} + if X509_STORE_CTX_get_check_issued_removed <= LibVersion then + begin + {$if declared(_X509_STORE_CTX_get_check_issued)} + X509_STORE_CTX_get_check_issued := @_X509_STORE_CTX_get_check_issued; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_STORE_CTX_get_check_issued_allownil)} + if FuncLoadError then + AFailed.Add('X509_STORE_CTX_get_check_issued'); + {$ifend} + end; + + {introduced 1.1.0} + X509_STORE_CTX_get_check_revocation := LoadLibFunction(ADllHandle, X509_STORE_CTX_get_check_revocation_procname); + FuncLoadError := not assigned(X509_STORE_CTX_get_check_revocation); + if FuncLoadError then + begin + {$if not defined(X509_STORE_CTX_get_check_revocation_allownil)} + X509_STORE_CTX_get_check_revocation := @ERR_X509_STORE_CTX_get_check_revocation; + {$ifend} + {$if declared(X509_STORE_CTX_get_check_revocation_introduced)} + if LibVersion < X509_STORE_CTX_get_check_revocation_introduced then + begin + {$if declared(FC_X509_STORE_CTX_get_check_revocation)} + X509_STORE_CTX_get_check_revocation := @FC_X509_STORE_CTX_get_check_revocation; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_STORE_CTX_get_check_revocation_removed)} + if X509_STORE_CTX_get_check_revocation_removed <= LibVersion then + begin + {$if declared(_X509_STORE_CTX_get_check_revocation)} + X509_STORE_CTX_get_check_revocation := @_X509_STORE_CTX_get_check_revocation; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_STORE_CTX_get_check_revocation_allownil)} + if FuncLoadError then + AFailed.Add('X509_STORE_CTX_get_check_revocation'); + {$ifend} + end; + + {introduced 1.1.0} + X509_STORE_CTX_get_get_crl := LoadLibFunction(ADllHandle, X509_STORE_CTX_get_get_crl_procname); + FuncLoadError := not assigned(X509_STORE_CTX_get_get_crl); + if FuncLoadError then + begin + {$if not defined(X509_STORE_CTX_get_get_crl_allownil)} + X509_STORE_CTX_get_get_crl := @ERR_X509_STORE_CTX_get_get_crl; + {$ifend} + {$if declared(X509_STORE_CTX_get_get_crl_introduced)} + if LibVersion < X509_STORE_CTX_get_get_crl_introduced then + begin + {$if declared(FC_X509_STORE_CTX_get_get_crl)} + X509_STORE_CTX_get_get_crl := @FC_X509_STORE_CTX_get_get_crl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_STORE_CTX_get_get_crl_removed)} + if X509_STORE_CTX_get_get_crl_removed <= LibVersion then + begin + {$if declared(_X509_STORE_CTX_get_get_crl)} + X509_STORE_CTX_get_get_crl := @_X509_STORE_CTX_get_get_crl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_STORE_CTX_get_get_crl_allownil)} + if FuncLoadError then + AFailed.Add('X509_STORE_CTX_get_get_crl'); + {$ifend} + end; + + {introduced 1.1.0} + X509_STORE_CTX_get_check_crl := LoadLibFunction(ADllHandle, X509_STORE_CTX_get_check_crl_procname); + FuncLoadError := not assigned(X509_STORE_CTX_get_check_crl); + if FuncLoadError then + begin + {$if not defined(X509_STORE_CTX_get_check_crl_allownil)} + X509_STORE_CTX_get_check_crl := @ERR_X509_STORE_CTX_get_check_crl; + {$ifend} + {$if declared(X509_STORE_CTX_get_check_crl_introduced)} + if LibVersion < X509_STORE_CTX_get_check_crl_introduced then + begin + {$if declared(FC_X509_STORE_CTX_get_check_crl)} + X509_STORE_CTX_get_check_crl := @FC_X509_STORE_CTX_get_check_crl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_STORE_CTX_get_check_crl_removed)} + if X509_STORE_CTX_get_check_crl_removed <= LibVersion then + begin + {$if declared(_X509_STORE_CTX_get_check_crl)} + X509_STORE_CTX_get_check_crl := @_X509_STORE_CTX_get_check_crl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_STORE_CTX_get_check_crl_allownil)} + if FuncLoadError then + AFailed.Add('X509_STORE_CTX_get_check_crl'); + {$ifend} + end; + + {introduced 1.1.0} + X509_STORE_CTX_get_cert_crl := LoadLibFunction(ADllHandle, X509_STORE_CTX_get_cert_crl_procname); + FuncLoadError := not assigned(X509_STORE_CTX_get_cert_crl); + if FuncLoadError then + begin + {$if not defined(X509_STORE_CTX_get_cert_crl_allownil)} + X509_STORE_CTX_get_cert_crl := @ERR_X509_STORE_CTX_get_cert_crl; + {$ifend} + {$if declared(X509_STORE_CTX_get_cert_crl_introduced)} + if LibVersion < X509_STORE_CTX_get_cert_crl_introduced then + begin + {$if declared(FC_X509_STORE_CTX_get_cert_crl)} + X509_STORE_CTX_get_cert_crl := @FC_X509_STORE_CTX_get_cert_crl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_STORE_CTX_get_cert_crl_removed)} + if X509_STORE_CTX_get_cert_crl_removed <= LibVersion then + begin + {$if declared(_X509_STORE_CTX_get_cert_crl)} + X509_STORE_CTX_get_cert_crl := @_X509_STORE_CTX_get_cert_crl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_STORE_CTX_get_cert_crl_allownil)} + if FuncLoadError then + AFailed.Add('X509_STORE_CTX_get_cert_crl'); + {$ifend} + end; + + {introduced 1.1.0} + X509_STORE_CTX_get_check_policy := LoadLibFunction(ADllHandle, X509_STORE_CTX_get_check_policy_procname); + FuncLoadError := not assigned(X509_STORE_CTX_get_check_policy); + if FuncLoadError then + begin + {$if not defined(X509_STORE_CTX_get_check_policy_allownil)} + X509_STORE_CTX_get_check_policy := @ERR_X509_STORE_CTX_get_check_policy; + {$ifend} + {$if declared(X509_STORE_CTX_get_check_policy_introduced)} + if LibVersion < X509_STORE_CTX_get_check_policy_introduced then + begin + {$if declared(FC_X509_STORE_CTX_get_check_policy)} + X509_STORE_CTX_get_check_policy := @FC_X509_STORE_CTX_get_check_policy; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_STORE_CTX_get_check_policy_removed)} + if X509_STORE_CTX_get_check_policy_removed <= LibVersion then + begin + {$if declared(_X509_STORE_CTX_get_check_policy)} + X509_STORE_CTX_get_check_policy := @_X509_STORE_CTX_get_check_policy; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_STORE_CTX_get_check_policy_allownil)} + if FuncLoadError then + AFailed.Add('X509_STORE_CTX_get_check_policy'); + {$ifend} + end; + + {introduced 1.1.0} + X509_STORE_CTX_get_cleanup := LoadLibFunction(ADllHandle, X509_STORE_CTX_get_cleanup_procname); + FuncLoadError := not assigned(X509_STORE_CTX_get_cleanup); + if FuncLoadError then + begin + {$if not defined(X509_STORE_CTX_get_cleanup_allownil)} + X509_STORE_CTX_get_cleanup := @ERR_X509_STORE_CTX_get_cleanup; + {$ifend} + {$if declared(X509_STORE_CTX_get_cleanup_introduced)} + if LibVersion < X509_STORE_CTX_get_cleanup_introduced then + begin + {$if declared(FC_X509_STORE_CTX_get_cleanup)} + X509_STORE_CTX_get_cleanup := @FC_X509_STORE_CTX_get_cleanup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_STORE_CTX_get_cleanup_removed)} + if X509_STORE_CTX_get_cleanup_removed <= LibVersion then + begin + {$if declared(_X509_STORE_CTX_get_cleanup)} + X509_STORE_CTX_get_cleanup := @_X509_STORE_CTX_get_cleanup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_STORE_CTX_get_cleanup_allownil)} + if FuncLoadError then + AFailed.Add('X509_STORE_CTX_get_cleanup'); + {$ifend} + end; + + {introduced 1.1.0} + X509_STORE_add_lookup := LoadLibFunction(ADllHandle, X509_STORE_add_lookup_procname); + FuncLoadError := not assigned(X509_STORE_add_lookup); + if FuncLoadError then + begin + {$if not defined(X509_STORE_add_lookup_allownil)} + X509_STORE_add_lookup := @ERR_X509_STORE_add_lookup; + {$ifend} + {$if declared(X509_STORE_add_lookup_introduced)} + if LibVersion < X509_STORE_add_lookup_introduced then + begin + {$if declared(FC_X509_STORE_add_lookup)} + X509_STORE_add_lookup := @FC_X509_STORE_add_lookup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_STORE_add_lookup_removed)} + if X509_STORE_add_lookup_removed <= LibVersion then + begin + {$if declared(_X509_STORE_add_lookup)} + X509_STORE_add_lookup := @_X509_STORE_add_lookup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_STORE_add_lookup_allownil)} + if FuncLoadError then + AFailed.Add('X509_STORE_add_lookup'); + {$ifend} + end; + + + X509_LOOKUP_hash_dir := LoadLibFunction(ADllHandle, X509_LOOKUP_hash_dir_procname); + FuncLoadError := not assigned(X509_LOOKUP_hash_dir); + if FuncLoadError then + begin + {$if not defined(X509_LOOKUP_hash_dir_allownil)} + X509_LOOKUP_hash_dir := @ERR_X509_LOOKUP_hash_dir; + {$ifend} + {$if declared(X509_LOOKUP_hash_dir_introduced)} + if LibVersion < X509_LOOKUP_hash_dir_introduced then + begin + {$if declared(FC_X509_LOOKUP_hash_dir)} + X509_LOOKUP_hash_dir := @FC_X509_LOOKUP_hash_dir; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_LOOKUP_hash_dir_removed)} + if X509_LOOKUP_hash_dir_removed <= LibVersion then + begin + {$if declared(_X509_LOOKUP_hash_dir)} + X509_LOOKUP_hash_dir := @_X509_LOOKUP_hash_dir; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_LOOKUP_hash_dir_allownil)} + if FuncLoadError then + AFailed.Add('X509_LOOKUP_hash_dir'); + {$ifend} + end; + + + X509_LOOKUP_file := LoadLibFunction(ADllHandle, X509_LOOKUP_file_procname); + FuncLoadError := not assigned(X509_LOOKUP_file); + if FuncLoadError then + begin + {$if not defined(X509_LOOKUP_file_allownil)} + X509_LOOKUP_file := @ERR_X509_LOOKUP_file; + {$ifend} + {$if declared(X509_LOOKUP_file_introduced)} + if LibVersion < X509_LOOKUP_file_introduced then + begin + {$if declared(FC_X509_LOOKUP_file)} + X509_LOOKUP_file := @FC_X509_LOOKUP_file; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_LOOKUP_file_removed)} + if X509_LOOKUP_file_removed <= LibVersion then + begin + {$if declared(_X509_LOOKUP_file)} + X509_LOOKUP_file := @_X509_LOOKUP_file; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_LOOKUP_file_allownil)} + if FuncLoadError then + AFailed.Add('X509_LOOKUP_file'); + {$ifend} + end; + + + X509_LOOKUP_meth_new := LoadLibFunction(ADllHandle, X509_LOOKUP_meth_new_procname); + FuncLoadError := not assigned(X509_LOOKUP_meth_new); + if FuncLoadError then + begin + {$if not defined(X509_LOOKUP_meth_new_allownil)} + X509_LOOKUP_meth_new := @ERR_X509_LOOKUP_meth_new; + {$ifend} + {$if declared(X509_LOOKUP_meth_new_introduced)} + if LibVersion < X509_LOOKUP_meth_new_introduced then + begin + {$if declared(FC_X509_LOOKUP_meth_new)} + X509_LOOKUP_meth_new := @FC_X509_LOOKUP_meth_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_LOOKUP_meth_new_removed)} + if X509_LOOKUP_meth_new_removed <= LibVersion then + begin + {$if declared(_X509_LOOKUP_meth_new)} + X509_LOOKUP_meth_new := @_X509_LOOKUP_meth_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_LOOKUP_meth_new_allownil)} + if FuncLoadError then + AFailed.Add('X509_LOOKUP_meth_new'); + {$ifend} + end; + + {introduced 1.1.0} + X509_LOOKUP_meth_free := LoadLibFunction(ADllHandle, X509_LOOKUP_meth_free_procname); + FuncLoadError := not assigned(X509_LOOKUP_meth_free); + if FuncLoadError then + begin + {$if not defined(X509_LOOKUP_meth_free_allownil)} + X509_LOOKUP_meth_free := @ERR_X509_LOOKUP_meth_free; + {$ifend} + {$if declared(X509_LOOKUP_meth_free_introduced)} + if LibVersion < X509_LOOKUP_meth_free_introduced then + begin + {$if declared(FC_X509_LOOKUP_meth_free)} + X509_LOOKUP_meth_free := @FC_X509_LOOKUP_meth_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_LOOKUP_meth_free_removed)} + if X509_LOOKUP_meth_free_removed <= LibVersion then + begin + {$if declared(_X509_LOOKUP_meth_free)} + X509_LOOKUP_meth_free := @_X509_LOOKUP_meth_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_LOOKUP_meth_free_allownil)} + if FuncLoadError then + AFailed.Add('X509_LOOKUP_meth_free'); + {$ifend} + end; + + {introduced 1.1.0} + X509_LOOKUP_meth_set_ctrl := LoadLibFunction(ADllHandle, X509_LOOKUP_meth_set_ctrl_procname); + FuncLoadError := not assigned(X509_LOOKUP_meth_set_ctrl); + if FuncLoadError then + begin + {$if not defined(X509_LOOKUP_meth_set_ctrl_allownil)} + X509_LOOKUP_meth_set_ctrl := @ERR_X509_LOOKUP_meth_set_ctrl; + {$ifend} + {$if declared(X509_LOOKUP_meth_set_ctrl_introduced)} + if LibVersion < X509_LOOKUP_meth_set_ctrl_introduced then + begin + {$if declared(FC_X509_LOOKUP_meth_set_ctrl)} + X509_LOOKUP_meth_set_ctrl := @FC_X509_LOOKUP_meth_set_ctrl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_LOOKUP_meth_set_ctrl_removed)} + if X509_LOOKUP_meth_set_ctrl_removed <= LibVersion then + begin + {$if declared(_X509_LOOKUP_meth_set_ctrl)} + X509_LOOKUP_meth_set_ctrl := @_X509_LOOKUP_meth_set_ctrl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_LOOKUP_meth_set_ctrl_allownil)} + if FuncLoadError then + AFailed.Add('X509_LOOKUP_meth_set_ctrl'); + {$ifend} + end; + + {introduced 1.1.0} + X509_LOOKUP_meth_get_ctrl := LoadLibFunction(ADllHandle, X509_LOOKUP_meth_get_ctrl_procname); + FuncLoadError := not assigned(X509_LOOKUP_meth_get_ctrl); + if FuncLoadError then + begin + {$if not defined(X509_LOOKUP_meth_get_ctrl_allownil)} + X509_LOOKUP_meth_get_ctrl := @ERR_X509_LOOKUP_meth_get_ctrl; + {$ifend} + {$if declared(X509_LOOKUP_meth_get_ctrl_introduced)} + if LibVersion < X509_LOOKUP_meth_get_ctrl_introduced then + begin + {$if declared(FC_X509_LOOKUP_meth_get_ctrl)} + X509_LOOKUP_meth_get_ctrl := @FC_X509_LOOKUP_meth_get_ctrl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_LOOKUP_meth_get_ctrl_removed)} + if X509_LOOKUP_meth_get_ctrl_removed <= LibVersion then + begin + {$if declared(_X509_LOOKUP_meth_get_ctrl)} + X509_LOOKUP_meth_get_ctrl := @_X509_LOOKUP_meth_get_ctrl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_LOOKUP_meth_get_ctrl_allownil)} + if FuncLoadError then + AFailed.Add('X509_LOOKUP_meth_get_ctrl'); + {$ifend} + end; + + {introduced 1.1.0} + X509_LOOKUP_meth_set_get_by_subject := LoadLibFunction(ADllHandle, X509_LOOKUP_meth_set_get_by_subject_procname); + FuncLoadError := not assigned(X509_LOOKUP_meth_set_get_by_subject); + if FuncLoadError then + begin + {$if not defined(X509_LOOKUP_meth_set_get_by_subject_allownil)} + X509_LOOKUP_meth_set_get_by_subject := @ERR_X509_LOOKUP_meth_set_get_by_subject; + {$ifend} + {$if declared(X509_LOOKUP_meth_set_get_by_subject_introduced)} + if LibVersion < X509_LOOKUP_meth_set_get_by_subject_introduced then + begin + {$if declared(FC_X509_LOOKUP_meth_set_get_by_subject)} + X509_LOOKUP_meth_set_get_by_subject := @FC_X509_LOOKUP_meth_set_get_by_subject; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_LOOKUP_meth_set_get_by_subject_removed)} + if X509_LOOKUP_meth_set_get_by_subject_removed <= LibVersion then + begin + {$if declared(_X509_LOOKUP_meth_set_get_by_subject)} + X509_LOOKUP_meth_set_get_by_subject := @_X509_LOOKUP_meth_set_get_by_subject; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_LOOKUP_meth_set_get_by_subject_allownil)} + if FuncLoadError then + AFailed.Add('X509_LOOKUP_meth_set_get_by_subject'); + {$ifend} + end; + + {introduced 1.1.0} + X509_LOOKUP_meth_get_get_by_subject := LoadLibFunction(ADllHandle, X509_LOOKUP_meth_get_get_by_subject_procname); + FuncLoadError := not assigned(X509_LOOKUP_meth_get_get_by_subject); + if FuncLoadError then + begin + {$if not defined(X509_LOOKUP_meth_get_get_by_subject_allownil)} + X509_LOOKUP_meth_get_get_by_subject := @ERR_X509_LOOKUP_meth_get_get_by_subject; + {$ifend} + {$if declared(X509_LOOKUP_meth_get_get_by_subject_introduced)} + if LibVersion < X509_LOOKUP_meth_get_get_by_subject_introduced then + begin + {$if declared(FC_X509_LOOKUP_meth_get_get_by_subject)} + X509_LOOKUP_meth_get_get_by_subject := @FC_X509_LOOKUP_meth_get_get_by_subject; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_LOOKUP_meth_get_get_by_subject_removed)} + if X509_LOOKUP_meth_get_get_by_subject_removed <= LibVersion then + begin + {$if declared(_X509_LOOKUP_meth_get_get_by_subject)} + X509_LOOKUP_meth_get_get_by_subject := @_X509_LOOKUP_meth_get_get_by_subject; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_LOOKUP_meth_get_get_by_subject_allownil)} + if FuncLoadError then + AFailed.Add('X509_LOOKUP_meth_get_get_by_subject'); + {$ifend} + end; + + {introduced 1.1.0} + X509_LOOKUP_meth_set_get_by_issuer_serial := LoadLibFunction(ADllHandle, X509_LOOKUP_meth_set_get_by_issuer_serial_procname); + FuncLoadError := not assigned(X509_LOOKUP_meth_set_get_by_issuer_serial); + if FuncLoadError then + begin + {$if not defined(X509_LOOKUP_meth_set_get_by_issuer_serial_allownil)} + X509_LOOKUP_meth_set_get_by_issuer_serial := @ERR_X509_LOOKUP_meth_set_get_by_issuer_serial; + {$ifend} + {$if declared(X509_LOOKUP_meth_set_get_by_issuer_serial_introduced)} + if LibVersion < X509_LOOKUP_meth_set_get_by_issuer_serial_introduced then + begin + {$if declared(FC_X509_LOOKUP_meth_set_get_by_issuer_serial)} + X509_LOOKUP_meth_set_get_by_issuer_serial := @FC_X509_LOOKUP_meth_set_get_by_issuer_serial; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_LOOKUP_meth_set_get_by_issuer_serial_removed)} + if X509_LOOKUP_meth_set_get_by_issuer_serial_removed <= LibVersion then + begin + {$if declared(_X509_LOOKUP_meth_set_get_by_issuer_serial)} + X509_LOOKUP_meth_set_get_by_issuer_serial := @_X509_LOOKUP_meth_set_get_by_issuer_serial; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_LOOKUP_meth_set_get_by_issuer_serial_allownil)} + if FuncLoadError then + AFailed.Add('X509_LOOKUP_meth_set_get_by_issuer_serial'); + {$ifend} + end; + + {introduced 1.1.0} + X509_LOOKUP_meth_get_get_by_issuer_serial := LoadLibFunction(ADllHandle, X509_LOOKUP_meth_get_get_by_issuer_serial_procname); + FuncLoadError := not assigned(X509_LOOKUP_meth_get_get_by_issuer_serial); + if FuncLoadError then + begin + {$if not defined(X509_LOOKUP_meth_get_get_by_issuer_serial_allownil)} + X509_LOOKUP_meth_get_get_by_issuer_serial := @ERR_X509_LOOKUP_meth_get_get_by_issuer_serial; + {$ifend} + {$if declared(X509_LOOKUP_meth_get_get_by_issuer_serial_introduced)} + if LibVersion < X509_LOOKUP_meth_get_get_by_issuer_serial_introduced then + begin + {$if declared(FC_X509_LOOKUP_meth_get_get_by_issuer_serial)} + X509_LOOKUP_meth_get_get_by_issuer_serial := @FC_X509_LOOKUP_meth_get_get_by_issuer_serial; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_LOOKUP_meth_get_get_by_issuer_serial_removed)} + if X509_LOOKUP_meth_get_get_by_issuer_serial_removed <= LibVersion then + begin + {$if declared(_X509_LOOKUP_meth_get_get_by_issuer_serial)} + X509_LOOKUP_meth_get_get_by_issuer_serial := @_X509_LOOKUP_meth_get_get_by_issuer_serial; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_LOOKUP_meth_get_get_by_issuer_serial_allownil)} + if FuncLoadError then + AFailed.Add('X509_LOOKUP_meth_get_get_by_issuer_serial'); + {$ifend} + end; + + {introduced 1.1.0} + X509_LOOKUP_meth_set_get_by_fingerprint := LoadLibFunction(ADllHandle, X509_LOOKUP_meth_set_get_by_fingerprint_procname); + FuncLoadError := not assigned(X509_LOOKUP_meth_set_get_by_fingerprint); + if FuncLoadError then + begin + {$if not defined(X509_LOOKUP_meth_set_get_by_fingerprint_allownil)} + X509_LOOKUP_meth_set_get_by_fingerprint := @ERR_X509_LOOKUP_meth_set_get_by_fingerprint; + {$ifend} + {$if declared(X509_LOOKUP_meth_set_get_by_fingerprint_introduced)} + if LibVersion < X509_LOOKUP_meth_set_get_by_fingerprint_introduced then + begin + {$if declared(FC_X509_LOOKUP_meth_set_get_by_fingerprint)} + X509_LOOKUP_meth_set_get_by_fingerprint := @FC_X509_LOOKUP_meth_set_get_by_fingerprint; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_LOOKUP_meth_set_get_by_fingerprint_removed)} + if X509_LOOKUP_meth_set_get_by_fingerprint_removed <= LibVersion then + begin + {$if declared(_X509_LOOKUP_meth_set_get_by_fingerprint)} + X509_LOOKUP_meth_set_get_by_fingerprint := @_X509_LOOKUP_meth_set_get_by_fingerprint; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_LOOKUP_meth_set_get_by_fingerprint_allownil)} + if FuncLoadError then + AFailed.Add('X509_LOOKUP_meth_set_get_by_fingerprint'); + {$ifend} + end; + + {introduced 1.1.0} + X509_LOOKUP_meth_get_get_by_fingerprint := LoadLibFunction(ADllHandle, X509_LOOKUP_meth_get_get_by_fingerprint_procname); + FuncLoadError := not assigned(X509_LOOKUP_meth_get_get_by_fingerprint); + if FuncLoadError then + begin + {$if not defined(X509_LOOKUP_meth_get_get_by_fingerprint_allownil)} + X509_LOOKUP_meth_get_get_by_fingerprint := @ERR_X509_LOOKUP_meth_get_get_by_fingerprint; + {$ifend} + {$if declared(X509_LOOKUP_meth_get_get_by_fingerprint_introduced)} + if LibVersion < X509_LOOKUP_meth_get_get_by_fingerprint_introduced then + begin + {$if declared(FC_X509_LOOKUP_meth_get_get_by_fingerprint)} + X509_LOOKUP_meth_get_get_by_fingerprint := @FC_X509_LOOKUP_meth_get_get_by_fingerprint; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_LOOKUP_meth_get_get_by_fingerprint_removed)} + if X509_LOOKUP_meth_get_get_by_fingerprint_removed <= LibVersion then + begin + {$if declared(_X509_LOOKUP_meth_get_get_by_fingerprint)} + X509_LOOKUP_meth_get_get_by_fingerprint := @_X509_LOOKUP_meth_get_get_by_fingerprint; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_LOOKUP_meth_get_get_by_fingerprint_allownil)} + if FuncLoadError then + AFailed.Add('X509_LOOKUP_meth_get_get_by_fingerprint'); + {$ifend} + end; + + {introduced 1.1.0} + X509_LOOKUP_meth_set_get_by_alias := LoadLibFunction(ADllHandle, X509_LOOKUP_meth_set_get_by_alias_procname); + FuncLoadError := not assigned(X509_LOOKUP_meth_set_get_by_alias); + if FuncLoadError then + begin + {$if not defined(X509_LOOKUP_meth_set_get_by_alias_allownil)} + X509_LOOKUP_meth_set_get_by_alias := @ERR_X509_LOOKUP_meth_set_get_by_alias; + {$ifend} + {$if declared(X509_LOOKUP_meth_set_get_by_alias_introduced)} + if LibVersion < X509_LOOKUP_meth_set_get_by_alias_introduced then + begin + {$if declared(FC_X509_LOOKUP_meth_set_get_by_alias)} + X509_LOOKUP_meth_set_get_by_alias := @FC_X509_LOOKUP_meth_set_get_by_alias; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_LOOKUP_meth_set_get_by_alias_removed)} + if X509_LOOKUP_meth_set_get_by_alias_removed <= LibVersion then + begin + {$if declared(_X509_LOOKUP_meth_set_get_by_alias)} + X509_LOOKUP_meth_set_get_by_alias := @_X509_LOOKUP_meth_set_get_by_alias; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_LOOKUP_meth_set_get_by_alias_allownil)} + if FuncLoadError then + AFailed.Add('X509_LOOKUP_meth_set_get_by_alias'); + {$ifend} + end; + + {introduced 1.1.0} + X509_LOOKUP_meth_get_get_by_alias := LoadLibFunction(ADllHandle, X509_LOOKUP_meth_get_get_by_alias_procname); + FuncLoadError := not assigned(X509_LOOKUP_meth_get_get_by_alias); + if FuncLoadError then + begin + {$if not defined(X509_LOOKUP_meth_get_get_by_alias_allownil)} + X509_LOOKUP_meth_get_get_by_alias := @ERR_X509_LOOKUP_meth_get_get_by_alias; + {$ifend} + {$if declared(X509_LOOKUP_meth_get_get_by_alias_introduced)} + if LibVersion < X509_LOOKUP_meth_get_get_by_alias_introduced then + begin + {$if declared(FC_X509_LOOKUP_meth_get_get_by_alias)} + X509_LOOKUP_meth_get_get_by_alias := @FC_X509_LOOKUP_meth_get_get_by_alias; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_LOOKUP_meth_get_get_by_alias_removed)} + if X509_LOOKUP_meth_get_get_by_alias_removed <= LibVersion then + begin + {$if declared(_X509_LOOKUP_meth_get_get_by_alias)} + X509_LOOKUP_meth_get_get_by_alias := @_X509_LOOKUP_meth_get_get_by_alias; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_LOOKUP_meth_get_get_by_alias_allownil)} + if FuncLoadError then + AFailed.Add('X509_LOOKUP_meth_get_get_by_alias'); + {$ifend} + end; + + {introduced 1.1.0} + X509_STORE_add_cert := LoadLibFunction(ADllHandle, X509_STORE_add_cert_procname); + FuncLoadError := not assigned(X509_STORE_add_cert); + if FuncLoadError then + begin + {$if not defined(X509_STORE_add_cert_allownil)} + X509_STORE_add_cert := @ERR_X509_STORE_add_cert; + {$ifend} + {$if declared(X509_STORE_add_cert_introduced)} + if LibVersion < X509_STORE_add_cert_introduced then + begin + {$if declared(FC_X509_STORE_add_cert)} + X509_STORE_add_cert := @FC_X509_STORE_add_cert; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_STORE_add_cert_removed)} + if X509_STORE_add_cert_removed <= LibVersion then + begin + {$if declared(_X509_STORE_add_cert)} + X509_STORE_add_cert := @_X509_STORE_add_cert; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_STORE_add_cert_allownil)} + if FuncLoadError then + AFailed.Add('X509_STORE_add_cert'); + {$ifend} + end; + + + X509_STORE_add_crl := LoadLibFunction(ADllHandle, X509_STORE_add_crl_procname); + FuncLoadError := not assigned(X509_STORE_add_crl); + if FuncLoadError then + begin + {$if not defined(X509_STORE_add_crl_allownil)} + X509_STORE_add_crl := @ERR_X509_STORE_add_crl; + {$ifend} + {$if declared(X509_STORE_add_crl_introduced)} + if LibVersion < X509_STORE_add_crl_introduced then + begin + {$if declared(FC_X509_STORE_add_crl)} + X509_STORE_add_crl := @FC_X509_STORE_add_crl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_STORE_add_crl_removed)} + if X509_STORE_add_crl_removed <= LibVersion then + begin + {$if declared(_X509_STORE_add_crl)} + X509_STORE_add_crl := @_X509_STORE_add_crl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_STORE_add_crl_allownil)} + if FuncLoadError then + AFailed.Add('X509_STORE_add_crl'); + {$ifend} + end; + + + X509_STORE_CTX_get_by_subject := LoadLibFunction(ADllHandle, X509_STORE_CTX_get_by_subject_procname); + FuncLoadError := not assigned(X509_STORE_CTX_get_by_subject); + if FuncLoadError then + begin + {$if not defined(X509_STORE_CTX_get_by_subject_allownil)} + X509_STORE_CTX_get_by_subject := @ERR_X509_STORE_CTX_get_by_subject; + {$ifend} + {$if declared(X509_STORE_CTX_get_by_subject_introduced)} + if LibVersion < X509_STORE_CTX_get_by_subject_introduced then + begin + {$if declared(FC_X509_STORE_CTX_get_by_subject)} + X509_STORE_CTX_get_by_subject := @FC_X509_STORE_CTX_get_by_subject; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_STORE_CTX_get_by_subject_removed)} + if X509_STORE_CTX_get_by_subject_removed <= LibVersion then + begin + {$if declared(_X509_STORE_CTX_get_by_subject)} + X509_STORE_CTX_get_by_subject := @_X509_STORE_CTX_get_by_subject; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_STORE_CTX_get_by_subject_allownil)} + if FuncLoadError then + AFailed.Add('X509_STORE_CTX_get_by_subject'); + {$ifend} + end; + + {introduced 1.1.0} + X509_STORE_CTX_get_obj_by_subject := LoadLibFunction(ADllHandle, X509_STORE_CTX_get_obj_by_subject_procname); + FuncLoadError := not assigned(X509_STORE_CTX_get_obj_by_subject); + if FuncLoadError then + begin + {$if not defined(X509_STORE_CTX_get_obj_by_subject_allownil)} + X509_STORE_CTX_get_obj_by_subject := @ERR_X509_STORE_CTX_get_obj_by_subject; + {$ifend} + {$if declared(X509_STORE_CTX_get_obj_by_subject_introduced)} + if LibVersion < X509_STORE_CTX_get_obj_by_subject_introduced then + begin + {$if declared(FC_X509_STORE_CTX_get_obj_by_subject)} + X509_STORE_CTX_get_obj_by_subject := @FC_X509_STORE_CTX_get_obj_by_subject; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_STORE_CTX_get_obj_by_subject_removed)} + if X509_STORE_CTX_get_obj_by_subject_removed <= LibVersion then + begin + {$if declared(_X509_STORE_CTX_get_obj_by_subject)} + X509_STORE_CTX_get_obj_by_subject := @_X509_STORE_CTX_get_obj_by_subject; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_STORE_CTX_get_obj_by_subject_allownil)} + if FuncLoadError then + AFailed.Add('X509_STORE_CTX_get_obj_by_subject'); + {$ifend} + end; + + {introduced 1.1.0} + X509_LOOKUP_ctrl := LoadLibFunction(ADllHandle, X509_LOOKUP_ctrl_procname); + FuncLoadError := not assigned(X509_LOOKUP_ctrl); + if FuncLoadError then + begin + {$if not defined(X509_LOOKUP_ctrl_allownil)} + X509_LOOKUP_ctrl := @ERR_X509_LOOKUP_ctrl; + {$ifend} + {$if declared(X509_LOOKUP_ctrl_introduced)} + if LibVersion < X509_LOOKUP_ctrl_introduced then + begin + {$if declared(FC_X509_LOOKUP_ctrl)} + X509_LOOKUP_ctrl := @FC_X509_LOOKUP_ctrl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_LOOKUP_ctrl_removed)} + if X509_LOOKUP_ctrl_removed <= LibVersion then + begin + {$if declared(_X509_LOOKUP_ctrl)} + X509_LOOKUP_ctrl := @_X509_LOOKUP_ctrl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_LOOKUP_ctrl_allownil)} + if FuncLoadError then + AFailed.Add('X509_LOOKUP_ctrl'); + {$ifend} + end; + + + X509_load_cert_file := LoadLibFunction(ADllHandle, X509_load_cert_file_procname); + FuncLoadError := not assigned(X509_load_cert_file); + if FuncLoadError then + begin + {$if not defined(X509_load_cert_file_allownil)} + X509_load_cert_file := @ERR_X509_load_cert_file; + {$ifend} + {$if declared(X509_load_cert_file_introduced)} + if LibVersion < X509_load_cert_file_introduced then + begin + {$if declared(FC_X509_load_cert_file)} + X509_load_cert_file := @FC_X509_load_cert_file; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_load_cert_file_removed)} + if X509_load_cert_file_removed <= LibVersion then + begin + {$if declared(_X509_load_cert_file)} + X509_load_cert_file := @_X509_load_cert_file; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_load_cert_file_allownil)} + if FuncLoadError then + AFailed.Add('X509_load_cert_file'); + {$ifend} + end; + + + X509_load_crl_file := LoadLibFunction(ADllHandle, X509_load_crl_file_procname); + FuncLoadError := not assigned(X509_load_crl_file); + if FuncLoadError then + begin + {$if not defined(X509_load_crl_file_allownil)} + X509_load_crl_file := @ERR_X509_load_crl_file; + {$ifend} + {$if declared(X509_load_crl_file_introduced)} + if LibVersion < X509_load_crl_file_introduced then + begin + {$if declared(FC_X509_load_crl_file)} + X509_load_crl_file := @FC_X509_load_crl_file; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_load_crl_file_removed)} + if X509_load_crl_file_removed <= LibVersion then + begin + {$if declared(_X509_load_crl_file)} + X509_load_crl_file := @_X509_load_crl_file; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_load_crl_file_allownil)} + if FuncLoadError then + AFailed.Add('X509_load_crl_file'); + {$ifend} + end; + + + X509_load_cert_crl_file := LoadLibFunction(ADllHandle, X509_load_cert_crl_file_procname); + FuncLoadError := not assigned(X509_load_cert_crl_file); + if FuncLoadError then + begin + {$if not defined(X509_load_cert_crl_file_allownil)} + X509_load_cert_crl_file := @ERR_X509_load_cert_crl_file; + {$ifend} + {$if declared(X509_load_cert_crl_file_introduced)} + if LibVersion < X509_load_cert_crl_file_introduced then + begin + {$if declared(FC_X509_load_cert_crl_file)} + X509_load_cert_crl_file := @FC_X509_load_cert_crl_file; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_load_cert_crl_file_removed)} + if X509_load_cert_crl_file_removed <= LibVersion then + begin + {$if declared(_X509_load_cert_crl_file)} + X509_load_cert_crl_file := @_X509_load_cert_crl_file; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_load_cert_crl_file_allownil)} + if FuncLoadError then + AFailed.Add('X509_load_cert_crl_file'); + {$ifend} + end; + + + X509_LOOKUP_new := LoadLibFunction(ADllHandle, X509_LOOKUP_new_procname); + FuncLoadError := not assigned(X509_LOOKUP_new); + if FuncLoadError then + begin + {$if not defined(X509_LOOKUP_new_allownil)} + X509_LOOKUP_new := @ERR_X509_LOOKUP_new; + {$ifend} + {$if declared(X509_LOOKUP_new_introduced)} + if LibVersion < X509_LOOKUP_new_introduced then + begin + {$if declared(FC_X509_LOOKUP_new)} + X509_LOOKUP_new := @FC_X509_LOOKUP_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_LOOKUP_new_removed)} + if X509_LOOKUP_new_removed <= LibVersion then + begin + {$if declared(_X509_LOOKUP_new)} + X509_LOOKUP_new := @_X509_LOOKUP_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_LOOKUP_new_allownil)} + if FuncLoadError then + AFailed.Add('X509_LOOKUP_new'); + {$ifend} + end; + + + X509_LOOKUP_free := LoadLibFunction(ADllHandle, X509_LOOKUP_free_procname); + FuncLoadError := not assigned(X509_LOOKUP_free); + if FuncLoadError then + begin + {$if not defined(X509_LOOKUP_free_allownil)} + X509_LOOKUP_free := @ERR_X509_LOOKUP_free; + {$ifend} + {$if declared(X509_LOOKUP_free_introduced)} + if LibVersion < X509_LOOKUP_free_introduced then + begin + {$if declared(FC_X509_LOOKUP_free)} + X509_LOOKUP_free := @FC_X509_LOOKUP_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_LOOKUP_free_removed)} + if X509_LOOKUP_free_removed <= LibVersion then + begin + {$if declared(_X509_LOOKUP_free)} + X509_LOOKUP_free := @_X509_LOOKUP_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_LOOKUP_free_allownil)} + if FuncLoadError then + AFailed.Add('X509_LOOKUP_free'); + {$ifend} + end; + + + X509_LOOKUP_init := LoadLibFunction(ADllHandle, X509_LOOKUP_init_procname); + FuncLoadError := not assigned(X509_LOOKUP_init); + if FuncLoadError then + begin + {$if not defined(X509_LOOKUP_init_allownil)} + X509_LOOKUP_init := @ERR_X509_LOOKUP_init; + {$ifend} + {$if declared(X509_LOOKUP_init_introduced)} + if LibVersion < X509_LOOKUP_init_introduced then + begin + {$if declared(FC_X509_LOOKUP_init)} + X509_LOOKUP_init := @FC_X509_LOOKUP_init; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_LOOKUP_init_removed)} + if X509_LOOKUP_init_removed <= LibVersion then + begin + {$if declared(_X509_LOOKUP_init)} + X509_LOOKUP_init := @_X509_LOOKUP_init; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_LOOKUP_init_allownil)} + if FuncLoadError then + AFailed.Add('X509_LOOKUP_init'); + {$ifend} + end; + + + X509_LOOKUP_by_subject := LoadLibFunction(ADllHandle, X509_LOOKUP_by_subject_procname); + FuncLoadError := not assigned(X509_LOOKUP_by_subject); + if FuncLoadError then + begin + {$if not defined(X509_LOOKUP_by_subject_allownil)} + X509_LOOKUP_by_subject := @ERR_X509_LOOKUP_by_subject; + {$ifend} + {$if declared(X509_LOOKUP_by_subject_introduced)} + if LibVersion < X509_LOOKUP_by_subject_introduced then + begin + {$if declared(FC_X509_LOOKUP_by_subject)} + X509_LOOKUP_by_subject := @FC_X509_LOOKUP_by_subject; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_LOOKUP_by_subject_removed)} + if X509_LOOKUP_by_subject_removed <= LibVersion then + begin + {$if declared(_X509_LOOKUP_by_subject)} + X509_LOOKUP_by_subject := @_X509_LOOKUP_by_subject; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_LOOKUP_by_subject_allownil)} + if FuncLoadError then + AFailed.Add('X509_LOOKUP_by_subject'); + {$ifend} + end; + + + X509_LOOKUP_by_issuer_serial := LoadLibFunction(ADllHandle, X509_LOOKUP_by_issuer_serial_procname); + FuncLoadError := not assigned(X509_LOOKUP_by_issuer_serial); + if FuncLoadError then + begin + {$if not defined(X509_LOOKUP_by_issuer_serial_allownil)} + X509_LOOKUP_by_issuer_serial := @ERR_X509_LOOKUP_by_issuer_serial; + {$ifend} + {$if declared(X509_LOOKUP_by_issuer_serial_introduced)} + if LibVersion < X509_LOOKUP_by_issuer_serial_introduced then + begin + {$if declared(FC_X509_LOOKUP_by_issuer_serial)} + X509_LOOKUP_by_issuer_serial := @FC_X509_LOOKUP_by_issuer_serial; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_LOOKUP_by_issuer_serial_removed)} + if X509_LOOKUP_by_issuer_serial_removed <= LibVersion then + begin + {$if declared(_X509_LOOKUP_by_issuer_serial)} + X509_LOOKUP_by_issuer_serial := @_X509_LOOKUP_by_issuer_serial; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_LOOKUP_by_issuer_serial_allownil)} + if FuncLoadError then + AFailed.Add('X509_LOOKUP_by_issuer_serial'); + {$ifend} + end; + + + X509_LOOKUP_by_fingerprint := LoadLibFunction(ADllHandle, X509_LOOKUP_by_fingerprint_procname); + FuncLoadError := not assigned(X509_LOOKUP_by_fingerprint); + if FuncLoadError then + begin + {$if not defined(X509_LOOKUP_by_fingerprint_allownil)} + X509_LOOKUP_by_fingerprint := @ERR_X509_LOOKUP_by_fingerprint; + {$ifend} + {$if declared(X509_LOOKUP_by_fingerprint_introduced)} + if LibVersion < X509_LOOKUP_by_fingerprint_introduced then + begin + {$if declared(FC_X509_LOOKUP_by_fingerprint)} + X509_LOOKUP_by_fingerprint := @FC_X509_LOOKUP_by_fingerprint; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_LOOKUP_by_fingerprint_removed)} + if X509_LOOKUP_by_fingerprint_removed <= LibVersion then + begin + {$if declared(_X509_LOOKUP_by_fingerprint)} + X509_LOOKUP_by_fingerprint := @_X509_LOOKUP_by_fingerprint; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_LOOKUP_by_fingerprint_allownil)} + if FuncLoadError then + AFailed.Add('X509_LOOKUP_by_fingerprint'); + {$ifend} + end; + + + X509_LOOKUP_by_alias := LoadLibFunction(ADllHandle, X509_LOOKUP_by_alias_procname); + FuncLoadError := not assigned(X509_LOOKUP_by_alias); + if FuncLoadError then + begin + {$if not defined(X509_LOOKUP_by_alias_allownil)} + X509_LOOKUP_by_alias := @ERR_X509_LOOKUP_by_alias; + {$ifend} + {$if declared(X509_LOOKUP_by_alias_introduced)} + if LibVersion < X509_LOOKUP_by_alias_introduced then + begin + {$if declared(FC_X509_LOOKUP_by_alias)} + X509_LOOKUP_by_alias := @FC_X509_LOOKUP_by_alias; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_LOOKUP_by_alias_removed)} + if X509_LOOKUP_by_alias_removed <= LibVersion then + begin + {$if declared(_X509_LOOKUP_by_alias)} + X509_LOOKUP_by_alias := @_X509_LOOKUP_by_alias; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_LOOKUP_by_alias_allownil)} + if FuncLoadError then + AFailed.Add('X509_LOOKUP_by_alias'); + {$ifend} + end; + + + X509_LOOKUP_set_method_data := LoadLibFunction(ADllHandle, X509_LOOKUP_set_method_data_procname); + FuncLoadError := not assigned(X509_LOOKUP_set_method_data); + if FuncLoadError then + begin + {$if not defined(X509_LOOKUP_set_method_data_allownil)} + X509_LOOKUP_set_method_data := @ERR_X509_LOOKUP_set_method_data; + {$ifend} + {$if declared(X509_LOOKUP_set_method_data_introduced)} + if LibVersion < X509_LOOKUP_set_method_data_introduced then + begin + {$if declared(FC_X509_LOOKUP_set_method_data)} + X509_LOOKUP_set_method_data := @FC_X509_LOOKUP_set_method_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_LOOKUP_set_method_data_removed)} + if X509_LOOKUP_set_method_data_removed <= LibVersion then + begin + {$if declared(_X509_LOOKUP_set_method_data)} + X509_LOOKUP_set_method_data := @_X509_LOOKUP_set_method_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_LOOKUP_set_method_data_allownil)} + if FuncLoadError then + AFailed.Add('X509_LOOKUP_set_method_data'); + {$ifend} + end; + + {introduced 1.1.0} + X509_LOOKUP_get_method_data := LoadLibFunction(ADllHandle, X509_LOOKUP_get_method_data_procname); + FuncLoadError := not assigned(X509_LOOKUP_get_method_data); + if FuncLoadError then + begin + {$if not defined(X509_LOOKUP_get_method_data_allownil)} + X509_LOOKUP_get_method_data := @ERR_X509_LOOKUP_get_method_data; + {$ifend} + {$if declared(X509_LOOKUP_get_method_data_introduced)} + if LibVersion < X509_LOOKUP_get_method_data_introduced then + begin + {$if declared(FC_X509_LOOKUP_get_method_data)} + X509_LOOKUP_get_method_data := @FC_X509_LOOKUP_get_method_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_LOOKUP_get_method_data_removed)} + if X509_LOOKUP_get_method_data_removed <= LibVersion then + begin + {$if declared(_X509_LOOKUP_get_method_data)} + X509_LOOKUP_get_method_data := @_X509_LOOKUP_get_method_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_LOOKUP_get_method_data_allownil)} + if FuncLoadError then + AFailed.Add('X509_LOOKUP_get_method_data'); + {$ifend} + end; + + {introduced 1.1.0} + X509_LOOKUP_get_store := LoadLibFunction(ADllHandle, X509_LOOKUP_get_store_procname); + FuncLoadError := not assigned(X509_LOOKUP_get_store); + if FuncLoadError then + begin + {$if not defined(X509_LOOKUP_get_store_allownil)} + X509_LOOKUP_get_store := @ERR_X509_LOOKUP_get_store; + {$ifend} + {$if declared(X509_LOOKUP_get_store_introduced)} + if LibVersion < X509_LOOKUP_get_store_introduced then + begin + {$if declared(FC_X509_LOOKUP_get_store)} + X509_LOOKUP_get_store := @FC_X509_LOOKUP_get_store; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_LOOKUP_get_store_removed)} + if X509_LOOKUP_get_store_removed <= LibVersion then + begin + {$if declared(_X509_LOOKUP_get_store)} + X509_LOOKUP_get_store := @_X509_LOOKUP_get_store; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_LOOKUP_get_store_allownil)} + if FuncLoadError then + AFailed.Add('X509_LOOKUP_get_store'); + {$ifend} + end; + + {introduced 1.1.0} + X509_LOOKUP_shutdown := LoadLibFunction(ADllHandle, X509_LOOKUP_shutdown_procname); + FuncLoadError := not assigned(X509_LOOKUP_shutdown); + if FuncLoadError then + begin + {$if not defined(X509_LOOKUP_shutdown_allownil)} + X509_LOOKUP_shutdown := @ERR_X509_LOOKUP_shutdown; + {$ifend} + {$if declared(X509_LOOKUP_shutdown_introduced)} + if LibVersion < X509_LOOKUP_shutdown_introduced then + begin + {$if declared(FC_X509_LOOKUP_shutdown)} + X509_LOOKUP_shutdown := @FC_X509_LOOKUP_shutdown; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_LOOKUP_shutdown_removed)} + if X509_LOOKUP_shutdown_removed <= LibVersion then + begin + {$if declared(_X509_LOOKUP_shutdown)} + X509_LOOKUP_shutdown := @_X509_LOOKUP_shutdown; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_LOOKUP_shutdown_allownil)} + if FuncLoadError then + AFailed.Add('X509_LOOKUP_shutdown'); + {$ifend} + end; + + + X509_STORE_load_locations := LoadLibFunction(ADllHandle, X509_STORE_load_locations_procname); + FuncLoadError := not assigned(X509_STORE_load_locations); + if FuncLoadError then + begin + {$if not defined(X509_STORE_load_locations_allownil)} + X509_STORE_load_locations := @ERR_X509_STORE_load_locations; + {$ifend} + {$if declared(X509_STORE_load_locations_introduced)} + if LibVersion < X509_STORE_load_locations_introduced then + begin + {$if declared(FC_X509_STORE_load_locations)} + X509_STORE_load_locations := @FC_X509_STORE_load_locations; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_STORE_load_locations_removed)} + if X509_STORE_load_locations_removed <= LibVersion then + begin + {$if declared(_X509_STORE_load_locations)} + X509_STORE_load_locations := @_X509_STORE_load_locations; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_STORE_load_locations_allownil)} + if FuncLoadError then + AFailed.Add('X509_STORE_load_locations'); + {$ifend} + end; + + + X509_STORE_set_default_paths := LoadLibFunction(ADllHandle, X509_STORE_set_default_paths_procname); + FuncLoadError := not assigned(X509_STORE_set_default_paths); + if FuncLoadError then + begin + {$if not defined(X509_STORE_set_default_paths_allownil)} + X509_STORE_set_default_paths := @ERR_X509_STORE_set_default_paths; + {$ifend} + {$if declared(X509_STORE_set_default_paths_introduced)} + if LibVersion < X509_STORE_set_default_paths_introduced then + begin + {$if declared(FC_X509_STORE_set_default_paths)} + X509_STORE_set_default_paths := @FC_X509_STORE_set_default_paths; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_STORE_set_default_paths_removed)} + if X509_STORE_set_default_paths_removed <= LibVersion then + begin + {$if declared(_X509_STORE_set_default_paths)} + X509_STORE_set_default_paths := @_X509_STORE_set_default_paths; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_STORE_set_default_paths_allownil)} + if FuncLoadError then + AFailed.Add('X509_STORE_set_default_paths'); + {$ifend} + end; + + + X509_STORE_CTX_set_ex_data := LoadLibFunction(ADllHandle, X509_STORE_CTX_set_ex_data_procname); + FuncLoadError := not assigned(X509_STORE_CTX_set_ex_data); + if FuncLoadError then + begin + {$if not defined(X509_STORE_CTX_set_ex_data_allownil)} + X509_STORE_CTX_set_ex_data := @ERR_X509_STORE_CTX_set_ex_data; + {$ifend} + {$if declared(X509_STORE_CTX_set_ex_data_introduced)} + if LibVersion < X509_STORE_CTX_set_ex_data_introduced then + begin + {$if declared(FC_X509_STORE_CTX_set_ex_data)} + X509_STORE_CTX_set_ex_data := @FC_X509_STORE_CTX_set_ex_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_STORE_CTX_set_ex_data_removed)} + if X509_STORE_CTX_set_ex_data_removed <= LibVersion then + begin + {$if declared(_X509_STORE_CTX_set_ex_data)} + X509_STORE_CTX_set_ex_data := @_X509_STORE_CTX_set_ex_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_STORE_CTX_set_ex_data_allownil)} + if FuncLoadError then + AFailed.Add('X509_STORE_CTX_set_ex_data'); + {$ifend} + end; + + + X509_STORE_CTX_get_ex_data := LoadLibFunction(ADllHandle, X509_STORE_CTX_get_ex_data_procname); + FuncLoadError := not assigned(X509_STORE_CTX_get_ex_data); + if FuncLoadError then + begin + {$if not defined(X509_STORE_CTX_get_ex_data_allownil)} + X509_STORE_CTX_get_ex_data := @ERR_X509_STORE_CTX_get_ex_data; + {$ifend} + {$if declared(X509_STORE_CTX_get_ex_data_introduced)} + if LibVersion < X509_STORE_CTX_get_ex_data_introduced then + begin + {$if declared(FC_X509_STORE_CTX_get_ex_data)} + X509_STORE_CTX_get_ex_data := @FC_X509_STORE_CTX_get_ex_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_STORE_CTX_get_ex_data_removed)} + if X509_STORE_CTX_get_ex_data_removed <= LibVersion then + begin + {$if declared(_X509_STORE_CTX_get_ex_data)} + X509_STORE_CTX_get_ex_data := @_X509_STORE_CTX_get_ex_data; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_STORE_CTX_get_ex_data_allownil)} + if FuncLoadError then + AFailed.Add('X509_STORE_CTX_get_ex_data'); + {$ifend} + end; + + + X509_STORE_CTX_get_error := LoadLibFunction(ADllHandle, X509_STORE_CTX_get_error_procname); + FuncLoadError := not assigned(X509_STORE_CTX_get_error); + if FuncLoadError then + begin + {$if not defined(X509_STORE_CTX_get_error_allownil)} + X509_STORE_CTX_get_error := @ERR_X509_STORE_CTX_get_error; + {$ifend} + {$if declared(X509_STORE_CTX_get_error_introduced)} + if LibVersion < X509_STORE_CTX_get_error_introduced then + begin + {$if declared(FC_X509_STORE_CTX_get_error)} + X509_STORE_CTX_get_error := @FC_X509_STORE_CTX_get_error; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_STORE_CTX_get_error_removed)} + if X509_STORE_CTX_get_error_removed <= LibVersion then + begin + {$if declared(_X509_STORE_CTX_get_error)} + X509_STORE_CTX_get_error := @_X509_STORE_CTX_get_error; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_STORE_CTX_get_error_allownil)} + if FuncLoadError then + AFailed.Add('X509_STORE_CTX_get_error'); + {$ifend} + end; + + + X509_STORE_CTX_set_error := LoadLibFunction(ADllHandle, X509_STORE_CTX_set_error_procname); + FuncLoadError := not assigned(X509_STORE_CTX_set_error); + if FuncLoadError then + begin + {$if not defined(X509_STORE_CTX_set_error_allownil)} + X509_STORE_CTX_set_error := @ERR_X509_STORE_CTX_set_error; + {$ifend} + {$if declared(X509_STORE_CTX_set_error_introduced)} + if LibVersion < X509_STORE_CTX_set_error_introduced then + begin + {$if declared(FC_X509_STORE_CTX_set_error)} + X509_STORE_CTX_set_error := @FC_X509_STORE_CTX_set_error; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_STORE_CTX_set_error_removed)} + if X509_STORE_CTX_set_error_removed <= LibVersion then + begin + {$if declared(_X509_STORE_CTX_set_error)} + X509_STORE_CTX_set_error := @_X509_STORE_CTX_set_error; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_STORE_CTX_set_error_allownil)} + if FuncLoadError then + AFailed.Add('X509_STORE_CTX_set_error'); + {$ifend} + end; + + + X509_STORE_CTX_get_error_depth := LoadLibFunction(ADllHandle, X509_STORE_CTX_get_error_depth_procname); + FuncLoadError := not assigned(X509_STORE_CTX_get_error_depth); + if FuncLoadError then + begin + {$if not defined(X509_STORE_CTX_get_error_depth_allownil)} + X509_STORE_CTX_get_error_depth := @ERR_X509_STORE_CTX_get_error_depth; + {$ifend} + {$if declared(X509_STORE_CTX_get_error_depth_introduced)} + if LibVersion < X509_STORE_CTX_get_error_depth_introduced then + begin + {$if declared(FC_X509_STORE_CTX_get_error_depth)} + X509_STORE_CTX_get_error_depth := @FC_X509_STORE_CTX_get_error_depth; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_STORE_CTX_get_error_depth_removed)} + if X509_STORE_CTX_get_error_depth_removed <= LibVersion then + begin + {$if declared(_X509_STORE_CTX_get_error_depth)} + X509_STORE_CTX_get_error_depth := @_X509_STORE_CTX_get_error_depth; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_STORE_CTX_get_error_depth_allownil)} + if FuncLoadError then + AFailed.Add('X509_STORE_CTX_get_error_depth'); + {$ifend} + end; + + + X509_STORE_CTX_set_error_depth := LoadLibFunction(ADllHandle, X509_STORE_CTX_set_error_depth_procname); + FuncLoadError := not assigned(X509_STORE_CTX_set_error_depth); + if FuncLoadError then + begin + {$if not defined(X509_STORE_CTX_set_error_depth_allownil)} + X509_STORE_CTX_set_error_depth := @ERR_X509_STORE_CTX_set_error_depth; + {$ifend} + {$if declared(X509_STORE_CTX_set_error_depth_introduced)} + if LibVersion < X509_STORE_CTX_set_error_depth_introduced then + begin + {$if declared(FC_X509_STORE_CTX_set_error_depth)} + X509_STORE_CTX_set_error_depth := @FC_X509_STORE_CTX_set_error_depth; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_STORE_CTX_set_error_depth_removed)} + if X509_STORE_CTX_set_error_depth_removed <= LibVersion then + begin + {$if declared(_X509_STORE_CTX_set_error_depth)} + X509_STORE_CTX_set_error_depth := @_X509_STORE_CTX_set_error_depth; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_STORE_CTX_set_error_depth_allownil)} + if FuncLoadError then + AFailed.Add('X509_STORE_CTX_set_error_depth'); + {$ifend} + end; + + {introduced 1.1.0} + X509_STORE_CTX_get_current_cert := LoadLibFunction(ADllHandle, X509_STORE_CTX_get_current_cert_procname); + FuncLoadError := not assigned(X509_STORE_CTX_get_current_cert); + if FuncLoadError then + begin + {$if not defined(X509_STORE_CTX_get_current_cert_allownil)} + X509_STORE_CTX_get_current_cert := @ERR_X509_STORE_CTX_get_current_cert; + {$ifend} + {$if declared(X509_STORE_CTX_get_current_cert_introduced)} + if LibVersion < X509_STORE_CTX_get_current_cert_introduced then + begin + {$if declared(FC_X509_STORE_CTX_get_current_cert)} + X509_STORE_CTX_get_current_cert := @FC_X509_STORE_CTX_get_current_cert; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_STORE_CTX_get_current_cert_removed)} + if X509_STORE_CTX_get_current_cert_removed <= LibVersion then + begin + {$if declared(_X509_STORE_CTX_get_current_cert)} + X509_STORE_CTX_get_current_cert := @_X509_STORE_CTX_get_current_cert; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_STORE_CTX_get_current_cert_allownil)} + if FuncLoadError then + AFailed.Add('X509_STORE_CTX_get_current_cert'); + {$ifend} + end; + + + X509_STORE_CTX_set_current_cert := LoadLibFunction(ADllHandle, X509_STORE_CTX_set_current_cert_procname); + FuncLoadError := not assigned(X509_STORE_CTX_set_current_cert); + if FuncLoadError then + begin + {$if not defined(X509_STORE_CTX_set_current_cert_allownil)} + X509_STORE_CTX_set_current_cert := @ERR_X509_STORE_CTX_set_current_cert; + {$ifend} + {$if declared(X509_STORE_CTX_set_current_cert_introduced)} + if LibVersion < X509_STORE_CTX_set_current_cert_introduced then + begin + {$if declared(FC_X509_STORE_CTX_set_current_cert)} + X509_STORE_CTX_set_current_cert := @FC_X509_STORE_CTX_set_current_cert; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_STORE_CTX_set_current_cert_removed)} + if X509_STORE_CTX_set_current_cert_removed <= LibVersion then + begin + {$if declared(_X509_STORE_CTX_set_current_cert)} + X509_STORE_CTX_set_current_cert := @_X509_STORE_CTX_set_current_cert; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_STORE_CTX_set_current_cert_allownil)} + if FuncLoadError then + AFailed.Add('X509_STORE_CTX_set_current_cert'); + {$ifend} + end; + + {introduced 1.1.0} + X509_STORE_CTX_get0_current_issuer := LoadLibFunction(ADllHandle, X509_STORE_CTX_get0_current_issuer_procname); + FuncLoadError := not assigned(X509_STORE_CTX_get0_current_issuer); + if FuncLoadError then + begin + {$if not defined(X509_STORE_CTX_get0_current_issuer_allownil)} + X509_STORE_CTX_get0_current_issuer := @ERR_X509_STORE_CTX_get0_current_issuer; + {$ifend} + {$if declared(X509_STORE_CTX_get0_current_issuer_introduced)} + if LibVersion < X509_STORE_CTX_get0_current_issuer_introduced then + begin + {$if declared(FC_X509_STORE_CTX_get0_current_issuer)} + X509_STORE_CTX_get0_current_issuer := @FC_X509_STORE_CTX_get0_current_issuer; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_STORE_CTX_get0_current_issuer_removed)} + if X509_STORE_CTX_get0_current_issuer_removed <= LibVersion then + begin + {$if declared(_X509_STORE_CTX_get0_current_issuer)} + X509_STORE_CTX_get0_current_issuer := @_X509_STORE_CTX_get0_current_issuer; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_STORE_CTX_get0_current_issuer_allownil)} + if FuncLoadError then + AFailed.Add('X509_STORE_CTX_get0_current_issuer'); + {$ifend} + end; + + + X509_STORE_CTX_get0_current_crl := LoadLibFunction(ADllHandle, X509_STORE_CTX_get0_current_crl_procname); + FuncLoadError := not assigned(X509_STORE_CTX_get0_current_crl); + if FuncLoadError then + begin + {$if not defined(X509_STORE_CTX_get0_current_crl_allownil)} + X509_STORE_CTX_get0_current_crl := @ERR_X509_STORE_CTX_get0_current_crl; + {$ifend} + {$if declared(X509_STORE_CTX_get0_current_crl_introduced)} + if LibVersion < X509_STORE_CTX_get0_current_crl_introduced then + begin + {$if declared(FC_X509_STORE_CTX_get0_current_crl)} + X509_STORE_CTX_get0_current_crl := @FC_X509_STORE_CTX_get0_current_crl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_STORE_CTX_get0_current_crl_removed)} + if X509_STORE_CTX_get0_current_crl_removed <= LibVersion then + begin + {$if declared(_X509_STORE_CTX_get0_current_crl)} + X509_STORE_CTX_get0_current_crl := @_X509_STORE_CTX_get0_current_crl; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_STORE_CTX_get0_current_crl_allownil)} + if FuncLoadError then + AFailed.Add('X509_STORE_CTX_get0_current_crl'); + {$ifend} + end; + + + X509_STORE_CTX_get0_parent_ctx := LoadLibFunction(ADllHandle, X509_STORE_CTX_get0_parent_ctx_procname); + FuncLoadError := not assigned(X509_STORE_CTX_get0_parent_ctx); + if FuncLoadError then + begin + {$if not defined(X509_STORE_CTX_get0_parent_ctx_allownil)} + X509_STORE_CTX_get0_parent_ctx := @ERR_X509_STORE_CTX_get0_parent_ctx; + {$ifend} + {$if declared(X509_STORE_CTX_get0_parent_ctx_introduced)} + if LibVersion < X509_STORE_CTX_get0_parent_ctx_introduced then + begin + {$if declared(FC_X509_STORE_CTX_get0_parent_ctx)} + X509_STORE_CTX_get0_parent_ctx := @FC_X509_STORE_CTX_get0_parent_ctx; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_STORE_CTX_get0_parent_ctx_removed)} + if X509_STORE_CTX_get0_parent_ctx_removed <= LibVersion then + begin + {$if declared(_X509_STORE_CTX_get0_parent_ctx)} + X509_STORE_CTX_get0_parent_ctx := @_X509_STORE_CTX_get0_parent_ctx; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_STORE_CTX_get0_parent_ctx_allownil)} + if FuncLoadError then + AFailed.Add('X509_STORE_CTX_get0_parent_ctx'); + {$ifend} + end; + + + X509_STORE_CTX_set_cert := LoadLibFunction(ADllHandle, X509_STORE_CTX_set_cert_procname); + FuncLoadError := not assigned(X509_STORE_CTX_set_cert); + if FuncLoadError then + begin + {$if not defined(X509_STORE_CTX_set_cert_allownil)} + X509_STORE_CTX_set_cert := @ERR_X509_STORE_CTX_set_cert; + {$ifend} + {$if declared(X509_STORE_CTX_set_cert_introduced)} + if LibVersion < X509_STORE_CTX_set_cert_introduced then + begin + {$if declared(FC_X509_STORE_CTX_set_cert)} + X509_STORE_CTX_set_cert := @FC_X509_STORE_CTX_set_cert; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_STORE_CTX_set_cert_removed)} + if X509_STORE_CTX_set_cert_removed <= LibVersion then + begin + {$if declared(_X509_STORE_CTX_set_cert)} + X509_STORE_CTX_set_cert := @_X509_STORE_CTX_set_cert; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_STORE_CTX_set_cert_allownil)} + if FuncLoadError then + AFailed.Add('X509_STORE_CTX_set_cert'); + {$ifend} + end; + + + X509_STORE_CTX_set_purpose := LoadLibFunction(ADllHandle, X509_STORE_CTX_set_purpose_procname); + FuncLoadError := not assigned(X509_STORE_CTX_set_purpose); + if FuncLoadError then + begin + {$if not defined(X509_STORE_CTX_set_purpose_allownil)} + X509_STORE_CTX_set_purpose := @ERR_X509_STORE_CTX_set_purpose; + {$ifend} + {$if declared(X509_STORE_CTX_set_purpose_introduced)} + if LibVersion < X509_STORE_CTX_set_purpose_introduced then + begin + {$if declared(FC_X509_STORE_CTX_set_purpose)} + X509_STORE_CTX_set_purpose := @FC_X509_STORE_CTX_set_purpose; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_STORE_CTX_set_purpose_removed)} + if X509_STORE_CTX_set_purpose_removed <= LibVersion then + begin + {$if declared(_X509_STORE_CTX_set_purpose)} + X509_STORE_CTX_set_purpose := @_X509_STORE_CTX_set_purpose; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_STORE_CTX_set_purpose_allownil)} + if FuncLoadError then + AFailed.Add('X509_STORE_CTX_set_purpose'); + {$ifend} + end; + + + X509_STORE_CTX_set_trust := LoadLibFunction(ADllHandle, X509_STORE_CTX_set_trust_procname); + FuncLoadError := not assigned(X509_STORE_CTX_set_trust); + if FuncLoadError then + begin + {$if not defined(X509_STORE_CTX_set_trust_allownil)} + X509_STORE_CTX_set_trust := @ERR_X509_STORE_CTX_set_trust; + {$ifend} + {$if declared(X509_STORE_CTX_set_trust_introduced)} + if LibVersion < X509_STORE_CTX_set_trust_introduced then + begin + {$if declared(FC_X509_STORE_CTX_set_trust)} + X509_STORE_CTX_set_trust := @FC_X509_STORE_CTX_set_trust; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_STORE_CTX_set_trust_removed)} + if X509_STORE_CTX_set_trust_removed <= LibVersion then + begin + {$if declared(_X509_STORE_CTX_set_trust)} + X509_STORE_CTX_set_trust := @_X509_STORE_CTX_set_trust; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_STORE_CTX_set_trust_allownil)} + if FuncLoadError then + AFailed.Add('X509_STORE_CTX_set_trust'); + {$ifend} + end; + + + X509_STORE_CTX_purpose_inherit := LoadLibFunction(ADllHandle, X509_STORE_CTX_purpose_inherit_procname); + FuncLoadError := not assigned(X509_STORE_CTX_purpose_inherit); + if FuncLoadError then + begin + {$if not defined(X509_STORE_CTX_purpose_inherit_allownil)} + X509_STORE_CTX_purpose_inherit := @ERR_X509_STORE_CTX_purpose_inherit; + {$ifend} + {$if declared(X509_STORE_CTX_purpose_inherit_introduced)} + if LibVersion < X509_STORE_CTX_purpose_inherit_introduced then + begin + {$if declared(FC_X509_STORE_CTX_purpose_inherit)} + X509_STORE_CTX_purpose_inherit := @FC_X509_STORE_CTX_purpose_inherit; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_STORE_CTX_purpose_inherit_removed)} + if X509_STORE_CTX_purpose_inherit_removed <= LibVersion then + begin + {$if declared(_X509_STORE_CTX_purpose_inherit)} + X509_STORE_CTX_purpose_inherit := @_X509_STORE_CTX_purpose_inherit; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_STORE_CTX_purpose_inherit_allownil)} + if FuncLoadError then + AFailed.Add('X509_STORE_CTX_purpose_inherit'); + {$ifend} + end; + + + X509_STORE_CTX_set_flags := LoadLibFunction(ADllHandle, X509_STORE_CTX_set_flags_procname); + FuncLoadError := not assigned(X509_STORE_CTX_set_flags); + if FuncLoadError then + begin + {$if not defined(X509_STORE_CTX_set_flags_allownil)} + X509_STORE_CTX_set_flags := @ERR_X509_STORE_CTX_set_flags; + {$ifend} + {$if declared(X509_STORE_CTX_set_flags_introduced)} + if LibVersion < X509_STORE_CTX_set_flags_introduced then + begin + {$if declared(FC_X509_STORE_CTX_set_flags)} + X509_STORE_CTX_set_flags := @FC_X509_STORE_CTX_set_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_STORE_CTX_set_flags_removed)} + if X509_STORE_CTX_set_flags_removed <= LibVersion then + begin + {$if declared(_X509_STORE_CTX_set_flags)} + X509_STORE_CTX_set_flags := @_X509_STORE_CTX_set_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_STORE_CTX_set_flags_allownil)} + if FuncLoadError then + AFailed.Add('X509_STORE_CTX_set_flags'); + {$ifend} + end; + + + X509_STORE_CTX_get0_policy_tree := LoadLibFunction(ADllHandle, X509_STORE_CTX_get0_policy_tree_procname); + FuncLoadError := not assigned(X509_STORE_CTX_get0_policy_tree); + if FuncLoadError then + begin + {$if not defined(X509_STORE_CTX_get0_policy_tree_allownil)} + X509_STORE_CTX_get0_policy_tree := @ERR_X509_STORE_CTX_get0_policy_tree; + {$ifend} + {$if declared(X509_STORE_CTX_get0_policy_tree_introduced)} + if LibVersion < X509_STORE_CTX_get0_policy_tree_introduced then + begin + {$if declared(FC_X509_STORE_CTX_get0_policy_tree)} + X509_STORE_CTX_get0_policy_tree := @FC_X509_STORE_CTX_get0_policy_tree; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_STORE_CTX_get0_policy_tree_removed)} + if X509_STORE_CTX_get0_policy_tree_removed <= LibVersion then + begin + {$if declared(_X509_STORE_CTX_get0_policy_tree)} + X509_STORE_CTX_get0_policy_tree := @_X509_STORE_CTX_get0_policy_tree; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_STORE_CTX_get0_policy_tree_allownil)} + if FuncLoadError then + AFailed.Add('X509_STORE_CTX_get0_policy_tree'); + {$ifend} + end; + + + X509_STORE_CTX_get_explicit_policy := LoadLibFunction(ADllHandle, X509_STORE_CTX_get_explicit_policy_procname); + FuncLoadError := not assigned(X509_STORE_CTX_get_explicit_policy); + if FuncLoadError then + begin + {$if not defined(X509_STORE_CTX_get_explicit_policy_allownil)} + X509_STORE_CTX_get_explicit_policy := @ERR_X509_STORE_CTX_get_explicit_policy; + {$ifend} + {$if declared(X509_STORE_CTX_get_explicit_policy_introduced)} + if LibVersion < X509_STORE_CTX_get_explicit_policy_introduced then + begin + {$if declared(FC_X509_STORE_CTX_get_explicit_policy)} + X509_STORE_CTX_get_explicit_policy := @FC_X509_STORE_CTX_get_explicit_policy; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_STORE_CTX_get_explicit_policy_removed)} + if X509_STORE_CTX_get_explicit_policy_removed <= LibVersion then + begin + {$if declared(_X509_STORE_CTX_get_explicit_policy)} + X509_STORE_CTX_get_explicit_policy := @_X509_STORE_CTX_get_explicit_policy; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_STORE_CTX_get_explicit_policy_allownil)} + if FuncLoadError then + AFailed.Add('X509_STORE_CTX_get_explicit_policy'); + {$ifend} + end; + + + X509_STORE_CTX_get_num_untrusted := LoadLibFunction(ADllHandle, X509_STORE_CTX_get_num_untrusted_procname); + FuncLoadError := not assigned(X509_STORE_CTX_get_num_untrusted); + if FuncLoadError then + begin + {$if not defined(X509_STORE_CTX_get_num_untrusted_allownil)} + X509_STORE_CTX_get_num_untrusted := @ERR_X509_STORE_CTX_get_num_untrusted; + {$ifend} + {$if declared(X509_STORE_CTX_get_num_untrusted_introduced)} + if LibVersion < X509_STORE_CTX_get_num_untrusted_introduced then + begin + {$if declared(FC_X509_STORE_CTX_get_num_untrusted)} + X509_STORE_CTX_get_num_untrusted := @FC_X509_STORE_CTX_get_num_untrusted; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_STORE_CTX_get_num_untrusted_removed)} + if X509_STORE_CTX_get_num_untrusted_removed <= LibVersion then + begin + {$if declared(_X509_STORE_CTX_get_num_untrusted)} + X509_STORE_CTX_get_num_untrusted := @_X509_STORE_CTX_get_num_untrusted; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_STORE_CTX_get_num_untrusted_allownil)} + if FuncLoadError then + AFailed.Add('X509_STORE_CTX_get_num_untrusted'); + {$ifend} + end; + + {introduced 1.1.0} + X509_STORE_CTX_get0_param := LoadLibFunction(ADllHandle, X509_STORE_CTX_get0_param_procname); + FuncLoadError := not assigned(X509_STORE_CTX_get0_param); + if FuncLoadError then + begin + {$if not defined(X509_STORE_CTX_get0_param_allownil)} + X509_STORE_CTX_get0_param := @ERR_X509_STORE_CTX_get0_param; + {$ifend} + {$if declared(X509_STORE_CTX_get0_param_introduced)} + if LibVersion < X509_STORE_CTX_get0_param_introduced then + begin + {$if declared(FC_X509_STORE_CTX_get0_param)} + X509_STORE_CTX_get0_param := @FC_X509_STORE_CTX_get0_param; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_STORE_CTX_get0_param_removed)} + if X509_STORE_CTX_get0_param_removed <= LibVersion then + begin + {$if declared(_X509_STORE_CTX_get0_param)} + X509_STORE_CTX_get0_param := @_X509_STORE_CTX_get0_param; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_STORE_CTX_get0_param_allownil)} + if FuncLoadError then + AFailed.Add('X509_STORE_CTX_get0_param'); + {$ifend} + end; + + + X509_STORE_CTX_set0_param := LoadLibFunction(ADllHandle, X509_STORE_CTX_set0_param_procname); + FuncLoadError := not assigned(X509_STORE_CTX_set0_param); + if FuncLoadError then + begin + {$if not defined(X509_STORE_CTX_set0_param_allownil)} + X509_STORE_CTX_set0_param := @ERR_X509_STORE_CTX_set0_param; + {$ifend} + {$if declared(X509_STORE_CTX_set0_param_introduced)} + if LibVersion < X509_STORE_CTX_set0_param_introduced then + begin + {$if declared(FC_X509_STORE_CTX_set0_param)} + X509_STORE_CTX_set0_param := @FC_X509_STORE_CTX_set0_param; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_STORE_CTX_set0_param_removed)} + if X509_STORE_CTX_set0_param_removed <= LibVersion then + begin + {$if declared(_X509_STORE_CTX_set0_param)} + X509_STORE_CTX_set0_param := @_X509_STORE_CTX_set0_param; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_STORE_CTX_set0_param_allownil)} + if FuncLoadError then + AFailed.Add('X509_STORE_CTX_set0_param'); + {$ifend} + end; + + + X509_STORE_CTX_set_default := LoadLibFunction(ADllHandle, X509_STORE_CTX_set_default_procname); + FuncLoadError := not assigned(X509_STORE_CTX_set_default); + if FuncLoadError then + begin + {$if not defined(X509_STORE_CTX_set_default_allownil)} + X509_STORE_CTX_set_default := @ERR_X509_STORE_CTX_set_default; + {$ifend} + {$if declared(X509_STORE_CTX_set_default_introduced)} + if LibVersion < X509_STORE_CTX_set_default_introduced then + begin + {$if declared(FC_X509_STORE_CTX_set_default)} + X509_STORE_CTX_set_default := @FC_X509_STORE_CTX_set_default; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_STORE_CTX_set_default_removed)} + if X509_STORE_CTX_set_default_removed <= LibVersion then + begin + {$if declared(_X509_STORE_CTX_set_default)} + X509_STORE_CTX_set_default := @_X509_STORE_CTX_set_default; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_STORE_CTX_set_default_allownil)} + if FuncLoadError then + AFailed.Add('X509_STORE_CTX_set_default'); + {$ifend} + end; + + + X509_STORE_CTX_set0_dane := LoadLibFunction(ADllHandle, X509_STORE_CTX_set0_dane_procname); + FuncLoadError := not assigned(X509_STORE_CTX_set0_dane); + if FuncLoadError then + begin + {$if not defined(X509_STORE_CTX_set0_dane_allownil)} + X509_STORE_CTX_set0_dane := @ERR_X509_STORE_CTX_set0_dane; + {$ifend} + {$if declared(X509_STORE_CTX_set0_dane_introduced)} + if LibVersion < X509_STORE_CTX_set0_dane_introduced then + begin + {$if declared(FC_X509_STORE_CTX_set0_dane)} + X509_STORE_CTX_set0_dane := @FC_X509_STORE_CTX_set0_dane; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_STORE_CTX_set0_dane_removed)} + if X509_STORE_CTX_set0_dane_removed <= LibVersion then + begin + {$if declared(_X509_STORE_CTX_set0_dane)} + X509_STORE_CTX_set0_dane := @_X509_STORE_CTX_set0_dane; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_STORE_CTX_set0_dane_allownil)} + if FuncLoadError then + AFailed.Add('X509_STORE_CTX_set0_dane'); + {$ifend} + end; + + {introduced 1.1.0} + X509_VERIFY_PARAM_new := LoadLibFunction(ADllHandle, X509_VERIFY_PARAM_new_procname); + FuncLoadError := not assigned(X509_VERIFY_PARAM_new); + if FuncLoadError then + begin + {$if not defined(X509_VERIFY_PARAM_new_allownil)} + X509_VERIFY_PARAM_new := @ERR_X509_VERIFY_PARAM_new; + {$ifend} + {$if declared(X509_VERIFY_PARAM_new_introduced)} + if LibVersion < X509_VERIFY_PARAM_new_introduced then + begin + {$if declared(FC_X509_VERIFY_PARAM_new)} + X509_VERIFY_PARAM_new := @FC_X509_VERIFY_PARAM_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_VERIFY_PARAM_new_removed)} + if X509_VERIFY_PARAM_new_removed <= LibVersion then + begin + {$if declared(_X509_VERIFY_PARAM_new)} + X509_VERIFY_PARAM_new := @_X509_VERIFY_PARAM_new; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_VERIFY_PARAM_new_allownil)} + if FuncLoadError then + AFailed.Add('X509_VERIFY_PARAM_new'); + {$ifend} + end; + + + X509_VERIFY_PARAM_free := LoadLibFunction(ADllHandle, X509_VERIFY_PARAM_free_procname); + FuncLoadError := not assigned(X509_VERIFY_PARAM_free); + if FuncLoadError then + begin + {$if not defined(X509_VERIFY_PARAM_free_allownil)} + X509_VERIFY_PARAM_free := @ERR_X509_VERIFY_PARAM_free; + {$ifend} + {$if declared(X509_VERIFY_PARAM_free_introduced)} + if LibVersion < X509_VERIFY_PARAM_free_introduced then + begin + {$if declared(FC_X509_VERIFY_PARAM_free)} + X509_VERIFY_PARAM_free := @FC_X509_VERIFY_PARAM_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_VERIFY_PARAM_free_removed)} + if X509_VERIFY_PARAM_free_removed <= LibVersion then + begin + {$if declared(_X509_VERIFY_PARAM_free)} + X509_VERIFY_PARAM_free := @_X509_VERIFY_PARAM_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_VERIFY_PARAM_free_allownil)} + if FuncLoadError then + AFailed.Add('X509_VERIFY_PARAM_free'); + {$ifend} + end; + + + X509_VERIFY_PARAM_inherit := LoadLibFunction(ADllHandle, X509_VERIFY_PARAM_inherit_procname); + FuncLoadError := not assigned(X509_VERIFY_PARAM_inherit); + if FuncLoadError then + begin + {$if not defined(X509_VERIFY_PARAM_inherit_allownil)} + X509_VERIFY_PARAM_inherit := @ERR_X509_VERIFY_PARAM_inherit; + {$ifend} + {$if declared(X509_VERIFY_PARAM_inherit_introduced)} + if LibVersion < X509_VERIFY_PARAM_inherit_introduced then + begin + {$if declared(FC_X509_VERIFY_PARAM_inherit)} + X509_VERIFY_PARAM_inherit := @FC_X509_VERIFY_PARAM_inherit; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_VERIFY_PARAM_inherit_removed)} + if X509_VERIFY_PARAM_inherit_removed <= LibVersion then + begin + {$if declared(_X509_VERIFY_PARAM_inherit)} + X509_VERIFY_PARAM_inherit := @_X509_VERIFY_PARAM_inherit; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_VERIFY_PARAM_inherit_allownil)} + if FuncLoadError then + AFailed.Add('X509_VERIFY_PARAM_inherit'); + {$ifend} + end; + + + X509_VERIFY_PARAM_set1 := LoadLibFunction(ADllHandle, X509_VERIFY_PARAM_set1_procname); + FuncLoadError := not assigned(X509_VERIFY_PARAM_set1); + if FuncLoadError then + begin + {$if not defined(X509_VERIFY_PARAM_set1_allownil)} + X509_VERIFY_PARAM_set1 := @ERR_X509_VERIFY_PARAM_set1; + {$ifend} + {$if declared(X509_VERIFY_PARAM_set1_introduced)} + if LibVersion < X509_VERIFY_PARAM_set1_introduced then + begin + {$if declared(FC_X509_VERIFY_PARAM_set1)} + X509_VERIFY_PARAM_set1 := @FC_X509_VERIFY_PARAM_set1; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_VERIFY_PARAM_set1_removed)} + if X509_VERIFY_PARAM_set1_removed <= LibVersion then + begin + {$if declared(_X509_VERIFY_PARAM_set1)} + X509_VERIFY_PARAM_set1 := @_X509_VERIFY_PARAM_set1; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_VERIFY_PARAM_set1_allownil)} + if FuncLoadError then + AFailed.Add('X509_VERIFY_PARAM_set1'); + {$ifend} + end; + + + X509_VERIFY_PARAM_set1_name := LoadLibFunction(ADllHandle, X509_VERIFY_PARAM_set1_name_procname); + FuncLoadError := not assigned(X509_VERIFY_PARAM_set1_name); + if FuncLoadError then + begin + {$if not defined(X509_VERIFY_PARAM_set1_name_allownil)} + X509_VERIFY_PARAM_set1_name := @ERR_X509_VERIFY_PARAM_set1_name; + {$ifend} + {$if declared(X509_VERIFY_PARAM_set1_name_introduced)} + if LibVersion < X509_VERIFY_PARAM_set1_name_introduced then + begin + {$if declared(FC_X509_VERIFY_PARAM_set1_name)} + X509_VERIFY_PARAM_set1_name := @FC_X509_VERIFY_PARAM_set1_name; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_VERIFY_PARAM_set1_name_removed)} + if X509_VERIFY_PARAM_set1_name_removed <= LibVersion then + begin + {$if declared(_X509_VERIFY_PARAM_set1_name)} + X509_VERIFY_PARAM_set1_name := @_X509_VERIFY_PARAM_set1_name; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_VERIFY_PARAM_set1_name_allownil)} + if FuncLoadError then + AFailed.Add('X509_VERIFY_PARAM_set1_name'); + {$ifend} + end; + + + X509_VERIFY_PARAM_set_flags := LoadLibFunction(ADllHandle, X509_VERIFY_PARAM_set_flags_procname); + FuncLoadError := not assigned(X509_VERIFY_PARAM_set_flags); + if FuncLoadError then + begin + {$if not defined(X509_VERIFY_PARAM_set_flags_allownil)} + X509_VERIFY_PARAM_set_flags := @ERR_X509_VERIFY_PARAM_set_flags; + {$ifend} + {$if declared(X509_VERIFY_PARAM_set_flags_introduced)} + if LibVersion < X509_VERIFY_PARAM_set_flags_introduced then + begin + {$if declared(FC_X509_VERIFY_PARAM_set_flags)} + X509_VERIFY_PARAM_set_flags := @FC_X509_VERIFY_PARAM_set_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_VERIFY_PARAM_set_flags_removed)} + if X509_VERIFY_PARAM_set_flags_removed <= LibVersion then + begin + {$if declared(_X509_VERIFY_PARAM_set_flags)} + X509_VERIFY_PARAM_set_flags := @_X509_VERIFY_PARAM_set_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_VERIFY_PARAM_set_flags_allownil)} + if FuncLoadError then + AFailed.Add('X509_VERIFY_PARAM_set_flags'); + {$ifend} + end; + + + X509_VERIFY_PARAM_clear_flags := LoadLibFunction(ADllHandle, X509_VERIFY_PARAM_clear_flags_procname); + FuncLoadError := not assigned(X509_VERIFY_PARAM_clear_flags); + if FuncLoadError then + begin + {$if not defined(X509_VERIFY_PARAM_clear_flags_allownil)} + X509_VERIFY_PARAM_clear_flags := @ERR_X509_VERIFY_PARAM_clear_flags; + {$ifend} + {$if declared(X509_VERIFY_PARAM_clear_flags_introduced)} + if LibVersion < X509_VERIFY_PARAM_clear_flags_introduced then + begin + {$if declared(FC_X509_VERIFY_PARAM_clear_flags)} + X509_VERIFY_PARAM_clear_flags := @FC_X509_VERIFY_PARAM_clear_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_VERIFY_PARAM_clear_flags_removed)} + if X509_VERIFY_PARAM_clear_flags_removed <= LibVersion then + begin + {$if declared(_X509_VERIFY_PARAM_clear_flags)} + X509_VERIFY_PARAM_clear_flags := @_X509_VERIFY_PARAM_clear_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_VERIFY_PARAM_clear_flags_allownil)} + if FuncLoadError then + AFailed.Add('X509_VERIFY_PARAM_clear_flags'); + {$ifend} + end; + + + X509_VERIFY_PARAM_get_flags := LoadLibFunction(ADllHandle, X509_VERIFY_PARAM_get_flags_procname); + FuncLoadError := not assigned(X509_VERIFY_PARAM_get_flags); + if FuncLoadError then + begin + {$if not defined(X509_VERIFY_PARAM_get_flags_allownil)} + X509_VERIFY_PARAM_get_flags := @ERR_X509_VERIFY_PARAM_get_flags; + {$ifend} + {$if declared(X509_VERIFY_PARAM_get_flags_introduced)} + if LibVersion < X509_VERIFY_PARAM_get_flags_introduced then + begin + {$if declared(FC_X509_VERIFY_PARAM_get_flags)} + X509_VERIFY_PARAM_get_flags := @FC_X509_VERIFY_PARAM_get_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_VERIFY_PARAM_get_flags_removed)} + if X509_VERIFY_PARAM_get_flags_removed <= LibVersion then + begin + {$if declared(_X509_VERIFY_PARAM_get_flags)} + X509_VERIFY_PARAM_get_flags := @_X509_VERIFY_PARAM_get_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_VERIFY_PARAM_get_flags_allownil)} + if FuncLoadError then + AFailed.Add('X509_VERIFY_PARAM_get_flags'); + {$ifend} + end; + + + X509_VERIFY_PARAM_set_purpose := LoadLibFunction(ADllHandle, X509_VERIFY_PARAM_set_purpose_procname); + FuncLoadError := not assigned(X509_VERIFY_PARAM_set_purpose); + if FuncLoadError then + begin + {$if not defined(X509_VERIFY_PARAM_set_purpose_allownil)} + X509_VERIFY_PARAM_set_purpose := @ERR_X509_VERIFY_PARAM_set_purpose; + {$ifend} + {$if declared(X509_VERIFY_PARAM_set_purpose_introduced)} + if LibVersion < X509_VERIFY_PARAM_set_purpose_introduced then + begin + {$if declared(FC_X509_VERIFY_PARAM_set_purpose)} + X509_VERIFY_PARAM_set_purpose := @FC_X509_VERIFY_PARAM_set_purpose; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_VERIFY_PARAM_set_purpose_removed)} + if X509_VERIFY_PARAM_set_purpose_removed <= LibVersion then + begin + {$if declared(_X509_VERIFY_PARAM_set_purpose)} + X509_VERIFY_PARAM_set_purpose := @_X509_VERIFY_PARAM_set_purpose; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_VERIFY_PARAM_set_purpose_allownil)} + if FuncLoadError then + AFailed.Add('X509_VERIFY_PARAM_set_purpose'); + {$ifend} + end; + + + X509_VERIFY_PARAM_set_trust := LoadLibFunction(ADllHandle, X509_VERIFY_PARAM_set_trust_procname); + FuncLoadError := not assigned(X509_VERIFY_PARAM_set_trust); + if FuncLoadError then + begin + {$if not defined(X509_VERIFY_PARAM_set_trust_allownil)} + X509_VERIFY_PARAM_set_trust := @ERR_X509_VERIFY_PARAM_set_trust; + {$ifend} + {$if declared(X509_VERIFY_PARAM_set_trust_introduced)} + if LibVersion < X509_VERIFY_PARAM_set_trust_introduced then + begin + {$if declared(FC_X509_VERIFY_PARAM_set_trust)} + X509_VERIFY_PARAM_set_trust := @FC_X509_VERIFY_PARAM_set_trust; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_VERIFY_PARAM_set_trust_removed)} + if X509_VERIFY_PARAM_set_trust_removed <= LibVersion then + begin + {$if declared(_X509_VERIFY_PARAM_set_trust)} + X509_VERIFY_PARAM_set_trust := @_X509_VERIFY_PARAM_set_trust; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_VERIFY_PARAM_set_trust_allownil)} + if FuncLoadError then + AFailed.Add('X509_VERIFY_PARAM_set_trust'); + {$ifend} + end; + + + X509_VERIFY_PARAM_set_depth := LoadLibFunction(ADllHandle, X509_VERIFY_PARAM_set_depth_procname); + FuncLoadError := not assigned(X509_VERIFY_PARAM_set_depth); + if FuncLoadError then + begin + {$if not defined(X509_VERIFY_PARAM_set_depth_allownil)} + X509_VERIFY_PARAM_set_depth := @ERR_X509_VERIFY_PARAM_set_depth; + {$ifend} + {$if declared(X509_VERIFY_PARAM_set_depth_introduced)} + if LibVersion < X509_VERIFY_PARAM_set_depth_introduced then + begin + {$if declared(FC_X509_VERIFY_PARAM_set_depth)} + X509_VERIFY_PARAM_set_depth := @FC_X509_VERIFY_PARAM_set_depth; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_VERIFY_PARAM_set_depth_removed)} + if X509_VERIFY_PARAM_set_depth_removed <= LibVersion then + begin + {$if declared(_X509_VERIFY_PARAM_set_depth)} + X509_VERIFY_PARAM_set_depth := @_X509_VERIFY_PARAM_set_depth; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_VERIFY_PARAM_set_depth_allownil)} + if FuncLoadError then + AFailed.Add('X509_VERIFY_PARAM_set_depth'); + {$ifend} + end; + + + X509_VERIFY_PARAM_set_auth_level := LoadLibFunction(ADllHandle, X509_VERIFY_PARAM_set_auth_level_procname); + FuncLoadError := not assigned(X509_VERIFY_PARAM_set_auth_level); + if FuncLoadError then + begin + {$if not defined(X509_VERIFY_PARAM_set_auth_level_allownil)} + X509_VERIFY_PARAM_set_auth_level := @ERR_X509_VERIFY_PARAM_set_auth_level; + {$ifend} + {$if declared(X509_VERIFY_PARAM_set_auth_level_introduced)} + if LibVersion < X509_VERIFY_PARAM_set_auth_level_introduced then + begin + {$if declared(FC_X509_VERIFY_PARAM_set_auth_level)} + X509_VERIFY_PARAM_set_auth_level := @FC_X509_VERIFY_PARAM_set_auth_level; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_VERIFY_PARAM_set_auth_level_removed)} + if X509_VERIFY_PARAM_set_auth_level_removed <= LibVersion then + begin + {$if declared(_X509_VERIFY_PARAM_set_auth_level)} + X509_VERIFY_PARAM_set_auth_level := @_X509_VERIFY_PARAM_set_auth_level; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_VERIFY_PARAM_set_auth_level_allownil)} + if FuncLoadError then + AFailed.Add('X509_VERIFY_PARAM_set_auth_level'); + {$ifend} + end; + + {introduced 1.1.0} + X509_VERIFY_PARAM_add0_policy := LoadLibFunction(ADllHandle, X509_VERIFY_PARAM_add0_policy_procname); + FuncLoadError := not assigned(X509_VERIFY_PARAM_add0_policy); + if FuncLoadError then + begin + {$if not defined(X509_VERIFY_PARAM_add0_policy_allownil)} + X509_VERIFY_PARAM_add0_policy := @ERR_X509_VERIFY_PARAM_add0_policy; + {$ifend} + {$if declared(X509_VERIFY_PARAM_add0_policy_introduced)} + if LibVersion < X509_VERIFY_PARAM_add0_policy_introduced then + begin + {$if declared(FC_X509_VERIFY_PARAM_add0_policy)} + X509_VERIFY_PARAM_add0_policy := @FC_X509_VERIFY_PARAM_add0_policy; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_VERIFY_PARAM_add0_policy_removed)} + if X509_VERIFY_PARAM_add0_policy_removed <= LibVersion then + begin + {$if declared(_X509_VERIFY_PARAM_add0_policy)} + X509_VERIFY_PARAM_add0_policy := @_X509_VERIFY_PARAM_add0_policy; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_VERIFY_PARAM_add0_policy_allownil)} + if FuncLoadError then + AFailed.Add('X509_VERIFY_PARAM_add0_policy'); + {$ifend} + end; + + + X509_VERIFY_PARAM_set_inh_flags := LoadLibFunction(ADllHandle, X509_VERIFY_PARAM_set_inh_flags_procname); + FuncLoadError := not assigned(X509_VERIFY_PARAM_set_inh_flags); + if FuncLoadError then + begin + {$if not defined(X509_VERIFY_PARAM_set_inh_flags_allownil)} + X509_VERIFY_PARAM_set_inh_flags := @ERR_X509_VERIFY_PARAM_set_inh_flags; + {$ifend} + {$if declared(X509_VERIFY_PARAM_set_inh_flags_introduced)} + if LibVersion < X509_VERIFY_PARAM_set_inh_flags_introduced then + begin + {$if declared(FC_X509_VERIFY_PARAM_set_inh_flags)} + X509_VERIFY_PARAM_set_inh_flags := @FC_X509_VERIFY_PARAM_set_inh_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_VERIFY_PARAM_set_inh_flags_removed)} + if X509_VERIFY_PARAM_set_inh_flags_removed <= LibVersion then + begin + {$if declared(_X509_VERIFY_PARAM_set_inh_flags)} + X509_VERIFY_PARAM_set_inh_flags := @_X509_VERIFY_PARAM_set_inh_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_VERIFY_PARAM_set_inh_flags_allownil)} + if FuncLoadError then + AFailed.Add('X509_VERIFY_PARAM_set_inh_flags'); + {$ifend} + end; + + {introduced 1.1.0} + X509_VERIFY_PARAM_get_inh_flags := LoadLibFunction(ADllHandle, X509_VERIFY_PARAM_get_inh_flags_procname); + FuncLoadError := not assigned(X509_VERIFY_PARAM_get_inh_flags); + if FuncLoadError then + begin + {$if not defined(X509_VERIFY_PARAM_get_inh_flags_allownil)} + X509_VERIFY_PARAM_get_inh_flags := @ERR_X509_VERIFY_PARAM_get_inh_flags; + {$ifend} + {$if declared(X509_VERIFY_PARAM_get_inh_flags_introduced)} + if LibVersion < X509_VERIFY_PARAM_get_inh_flags_introduced then + begin + {$if declared(FC_X509_VERIFY_PARAM_get_inh_flags)} + X509_VERIFY_PARAM_get_inh_flags := @FC_X509_VERIFY_PARAM_get_inh_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_VERIFY_PARAM_get_inh_flags_removed)} + if X509_VERIFY_PARAM_get_inh_flags_removed <= LibVersion then + begin + {$if declared(_X509_VERIFY_PARAM_get_inh_flags)} + X509_VERIFY_PARAM_get_inh_flags := @_X509_VERIFY_PARAM_get_inh_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_VERIFY_PARAM_get_inh_flags_allownil)} + if FuncLoadError then + AFailed.Add('X509_VERIFY_PARAM_get_inh_flags'); + {$ifend} + end; + + {introduced 1.1.0} + X509_VERIFY_PARAM_set1_host := LoadLibFunction(ADllHandle, X509_VERIFY_PARAM_set1_host_procname); + FuncLoadError := not assigned(X509_VERIFY_PARAM_set1_host); + if FuncLoadError then + begin + {$if not defined(X509_VERIFY_PARAM_set1_host_allownil)} + X509_VERIFY_PARAM_set1_host := @ERR_X509_VERIFY_PARAM_set1_host; + {$ifend} + {$if declared(X509_VERIFY_PARAM_set1_host_introduced)} + if LibVersion < X509_VERIFY_PARAM_set1_host_introduced then + begin + {$if declared(FC_X509_VERIFY_PARAM_set1_host)} + X509_VERIFY_PARAM_set1_host := @FC_X509_VERIFY_PARAM_set1_host; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_VERIFY_PARAM_set1_host_removed)} + if X509_VERIFY_PARAM_set1_host_removed <= LibVersion then + begin + {$if declared(_X509_VERIFY_PARAM_set1_host)} + X509_VERIFY_PARAM_set1_host := @_X509_VERIFY_PARAM_set1_host; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_VERIFY_PARAM_set1_host_allownil)} + if FuncLoadError then + AFailed.Add('X509_VERIFY_PARAM_set1_host'); + {$ifend} + end; + + + X509_VERIFY_PARAM_add1_host := LoadLibFunction(ADllHandle, X509_VERIFY_PARAM_add1_host_procname); + FuncLoadError := not assigned(X509_VERIFY_PARAM_add1_host); + if FuncLoadError then + begin + {$if not defined(X509_VERIFY_PARAM_add1_host_allownil)} + X509_VERIFY_PARAM_add1_host := @ERR_X509_VERIFY_PARAM_add1_host; + {$ifend} + {$if declared(X509_VERIFY_PARAM_add1_host_introduced)} + if LibVersion < X509_VERIFY_PARAM_add1_host_introduced then + begin + {$if declared(FC_X509_VERIFY_PARAM_add1_host)} + X509_VERIFY_PARAM_add1_host := @FC_X509_VERIFY_PARAM_add1_host; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_VERIFY_PARAM_add1_host_removed)} + if X509_VERIFY_PARAM_add1_host_removed <= LibVersion then + begin + {$if declared(_X509_VERIFY_PARAM_add1_host)} + X509_VERIFY_PARAM_add1_host := @_X509_VERIFY_PARAM_add1_host; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_VERIFY_PARAM_add1_host_allownil)} + if FuncLoadError then + AFailed.Add('X509_VERIFY_PARAM_add1_host'); + {$ifend} + end; + + + X509_VERIFY_PARAM_set_hostflags := LoadLibFunction(ADllHandle, X509_VERIFY_PARAM_set_hostflags_procname); + FuncLoadError := not assigned(X509_VERIFY_PARAM_set_hostflags); + if FuncLoadError then + begin + {$if not defined(X509_VERIFY_PARAM_set_hostflags_allownil)} + X509_VERIFY_PARAM_set_hostflags := @ERR_X509_VERIFY_PARAM_set_hostflags; + {$ifend} + {$if declared(X509_VERIFY_PARAM_set_hostflags_introduced)} + if LibVersion < X509_VERIFY_PARAM_set_hostflags_introduced then + begin + {$if declared(FC_X509_VERIFY_PARAM_set_hostflags)} + X509_VERIFY_PARAM_set_hostflags := @FC_X509_VERIFY_PARAM_set_hostflags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_VERIFY_PARAM_set_hostflags_removed)} + if X509_VERIFY_PARAM_set_hostflags_removed <= LibVersion then + begin + {$if declared(_X509_VERIFY_PARAM_set_hostflags)} + X509_VERIFY_PARAM_set_hostflags := @_X509_VERIFY_PARAM_set_hostflags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_VERIFY_PARAM_set_hostflags_allownil)} + if FuncLoadError then + AFailed.Add('X509_VERIFY_PARAM_set_hostflags'); + {$ifend} + end; + + + X509_VERIFY_PARAM_get_hostflags := LoadLibFunction(ADllHandle, X509_VERIFY_PARAM_get_hostflags_procname); + FuncLoadError := not assigned(X509_VERIFY_PARAM_get_hostflags); + if FuncLoadError then + begin + {$if not defined(X509_VERIFY_PARAM_get_hostflags_allownil)} + X509_VERIFY_PARAM_get_hostflags := @ERR_X509_VERIFY_PARAM_get_hostflags; + {$ifend} + {$if declared(X509_VERIFY_PARAM_get_hostflags_introduced)} + if LibVersion < X509_VERIFY_PARAM_get_hostflags_introduced then + begin + {$if declared(FC_X509_VERIFY_PARAM_get_hostflags)} + X509_VERIFY_PARAM_get_hostflags := @FC_X509_VERIFY_PARAM_get_hostflags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_VERIFY_PARAM_get_hostflags_removed)} + if X509_VERIFY_PARAM_get_hostflags_removed <= LibVersion then + begin + {$if declared(_X509_VERIFY_PARAM_get_hostflags)} + X509_VERIFY_PARAM_get_hostflags := @_X509_VERIFY_PARAM_get_hostflags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_VERIFY_PARAM_get_hostflags_allownil)} + if FuncLoadError then + AFailed.Add('X509_VERIFY_PARAM_get_hostflags'); + {$ifend} + end; + + {introduced 1.1.0} + X509_VERIFY_PARAM_get0_peername := LoadLibFunction(ADllHandle, X509_VERIFY_PARAM_get0_peername_procname); + FuncLoadError := not assigned(X509_VERIFY_PARAM_get0_peername); + if FuncLoadError then + begin + {$if not defined(X509_VERIFY_PARAM_get0_peername_allownil)} + X509_VERIFY_PARAM_get0_peername := @ERR_X509_VERIFY_PARAM_get0_peername; + {$ifend} + {$if declared(X509_VERIFY_PARAM_get0_peername_introduced)} + if LibVersion < X509_VERIFY_PARAM_get0_peername_introduced then + begin + {$if declared(FC_X509_VERIFY_PARAM_get0_peername)} + X509_VERIFY_PARAM_get0_peername := @FC_X509_VERIFY_PARAM_get0_peername; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_VERIFY_PARAM_get0_peername_removed)} + if X509_VERIFY_PARAM_get0_peername_removed <= LibVersion then + begin + {$if declared(_X509_VERIFY_PARAM_get0_peername)} + X509_VERIFY_PARAM_get0_peername := @_X509_VERIFY_PARAM_get0_peername; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_VERIFY_PARAM_get0_peername_allownil)} + if FuncLoadError then + AFailed.Add('X509_VERIFY_PARAM_get0_peername'); + {$ifend} + end; + + + X509_VERIFY_PARAM_move_peername := LoadLibFunction(ADllHandle, X509_VERIFY_PARAM_move_peername_procname); + FuncLoadError := not assigned(X509_VERIFY_PARAM_move_peername); + if FuncLoadError then + begin + {$if not defined(X509_VERIFY_PARAM_move_peername_allownil)} + X509_VERIFY_PARAM_move_peername := @ERR_X509_VERIFY_PARAM_move_peername; + {$ifend} + {$if declared(X509_VERIFY_PARAM_move_peername_introduced)} + if LibVersion < X509_VERIFY_PARAM_move_peername_introduced then + begin + {$if declared(FC_X509_VERIFY_PARAM_move_peername)} + X509_VERIFY_PARAM_move_peername := @FC_X509_VERIFY_PARAM_move_peername; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_VERIFY_PARAM_move_peername_removed)} + if X509_VERIFY_PARAM_move_peername_removed <= LibVersion then + begin + {$if declared(_X509_VERIFY_PARAM_move_peername)} + X509_VERIFY_PARAM_move_peername := @_X509_VERIFY_PARAM_move_peername; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_VERIFY_PARAM_move_peername_allownil)} + if FuncLoadError then + AFailed.Add('X509_VERIFY_PARAM_move_peername'); + {$ifend} + end; + + {introduced 1.1.0} + X509_VERIFY_PARAM_set1_email := LoadLibFunction(ADllHandle, X509_VERIFY_PARAM_set1_email_procname); + FuncLoadError := not assigned(X509_VERIFY_PARAM_set1_email); + if FuncLoadError then + begin + {$if not defined(X509_VERIFY_PARAM_set1_email_allownil)} + X509_VERIFY_PARAM_set1_email := @ERR_X509_VERIFY_PARAM_set1_email; + {$ifend} + {$if declared(X509_VERIFY_PARAM_set1_email_introduced)} + if LibVersion < X509_VERIFY_PARAM_set1_email_introduced then + begin + {$if declared(FC_X509_VERIFY_PARAM_set1_email)} + X509_VERIFY_PARAM_set1_email := @FC_X509_VERIFY_PARAM_set1_email; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_VERIFY_PARAM_set1_email_removed)} + if X509_VERIFY_PARAM_set1_email_removed <= LibVersion then + begin + {$if declared(_X509_VERIFY_PARAM_set1_email)} + X509_VERIFY_PARAM_set1_email := @_X509_VERIFY_PARAM_set1_email; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_VERIFY_PARAM_set1_email_allownil)} + if FuncLoadError then + AFailed.Add('X509_VERIFY_PARAM_set1_email'); + {$ifend} + end; + + + X509_VERIFY_PARAM_set1_ip := LoadLibFunction(ADllHandle, X509_VERIFY_PARAM_set1_ip_procname); + FuncLoadError := not assigned(X509_VERIFY_PARAM_set1_ip); + if FuncLoadError then + begin + {$if not defined(X509_VERIFY_PARAM_set1_ip_allownil)} + X509_VERIFY_PARAM_set1_ip := @ERR_X509_VERIFY_PARAM_set1_ip; + {$ifend} + {$if declared(X509_VERIFY_PARAM_set1_ip_introduced)} + if LibVersion < X509_VERIFY_PARAM_set1_ip_introduced then + begin + {$if declared(FC_X509_VERIFY_PARAM_set1_ip)} + X509_VERIFY_PARAM_set1_ip := @FC_X509_VERIFY_PARAM_set1_ip; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_VERIFY_PARAM_set1_ip_removed)} + if X509_VERIFY_PARAM_set1_ip_removed <= LibVersion then + begin + {$if declared(_X509_VERIFY_PARAM_set1_ip)} + X509_VERIFY_PARAM_set1_ip := @_X509_VERIFY_PARAM_set1_ip; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_VERIFY_PARAM_set1_ip_allownil)} + if FuncLoadError then + AFailed.Add('X509_VERIFY_PARAM_set1_ip'); + {$ifend} + end; + + + X509_VERIFY_PARAM_set1_ip_asc := LoadLibFunction(ADllHandle, X509_VERIFY_PARAM_set1_ip_asc_procname); + FuncLoadError := not assigned(X509_VERIFY_PARAM_set1_ip_asc); + if FuncLoadError then + begin + {$if not defined(X509_VERIFY_PARAM_set1_ip_asc_allownil)} + X509_VERIFY_PARAM_set1_ip_asc := @ERR_X509_VERIFY_PARAM_set1_ip_asc; + {$ifend} + {$if declared(X509_VERIFY_PARAM_set1_ip_asc_introduced)} + if LibVersion < X509_VERIFY_PARAM_set1_ip_asc_introduced then + begin + {$if declared(FC_X509_VERIFY_PARAM_set1_ip_asc)} + X509_VERIFY_PARAM_set1_ip_asc := @FC_X509_VERIFY_PARAM_set1_ip_asc; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_VERIFY_PARAM_set1_ip_asc_removed)} + if X509_VERIFY_PARAM_set1_ip_asc_removed <= LibVersion then + begin + {$if declared(_X509_VERIFY_PARAM_set1_ip_asc)} + X509_VERIFY_PARAM_set1_ip_asc := @_X509_VERIFY_PARAM_set1_ip_asc; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_VERIFY_PARAM_set1_ip_asc_allownil)} + if FuncLoadError then + AFailed.Add('X509_VERIFY_PARAM_set1_ip_asc'); + {$ifend} + end; + + + X509_VERIFY_PARAM_get_depth := LoadLibFunction(ADllHandle, X509_VERIFY_PARAM_get_depth_procname); + FuncLoadError := not assigned(X509_VERIFY_PARAM_get_depth); + if FuncLoadError then + begin + {$if not defined(X509_VERIFY_PARAM_get_depth_allownil)} + X509_VERIFY_PARAM_get_depth := @ERR_X509_VERIFY_PARAM_get_depth; + {$ifend} + {$if declared(X509_VERIFY_PARAM_get_depth_introduced)} + if LibVersion < X509_VERIFY_PARAM_get_depth_introduced then + begin + {$if declared(FC_X509_VERIFY_PARAM_get_depth)} + X509_VERIFY_PARAM_get_depth := @FC_X509_VERIFY_PARAM_get_depth; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_VERIFY_PARAM_get_depth_removed)} + if X509_VERIFY_PARAM_get_depth_removed <= LibVersion then + begin + {$if declared(_X509_VERIFY_PARAM_get_depth)} + X509_VERIFY_PARAM_get_depth := @_X509_VERIFY_PARAM_get_depth; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_VERIFY_PARAM_get_depth_allownil)} + if FuncLoadError then + AFailed.Add('X509_VERIFY_PARAM_get_depth'); + {$ifend} + end; + + + X509_VERIFY_PARAM_get_auth_level := LoadLibFunction(ADllHandle, X509_VERIFY_PARAM_get_auth_level_procname); + FuncLoadError := not assigned(X509_VERIFY_PARAM_get_auth_level); + if FuncLoadError then + begin + {$if not defined(X509_VERIFY_PARAM_get_auth_level_allownil)} + X509_VERIFY_PARAM_get_auth_level := @ERR_X509_VERIFY_PARAM_get_auth_level; + {$ifend} + {$if declared(X509_VERIFY_PARAM_get_auth_level_introduced)} + if LibVersion < X509_VERIFY_PARAM_get_auth_level_introduced then + begin + {$if declared(FC_X509_VERIFY_PARAM_get_auth_level)} + X509_VERIFY_PARAM_get_auth_level := @FC_X509_VERIFY_PARAM_get_auth_level; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_VERIFY_PARAM_get_auth_level_removed)} + if X509_VERIFY_PARAM_get_auth_level_removed <= LibVersion then + begin + {$if declared(_X509_VERIFY_PARAM_get_auth_level)} + X509_VERIFY_PARAM_get_auth_level := @_X509_VERIFY_PARAM_get_auth_level; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_VERIFY_PARAM_get_auth_level_allownil)} + if FuncLoadError then + AFailed.Add('X509_VERIFY_PARAM_get_auth_level'); + {$ifend} + end; + + {introduced 1.1.0} + X509_VERIFY_PARAM_get0_name := LoadLibFunction(ADllHandle, X509_VERIFY_PARAM_get0_name_procname); + FuncLoadError := not assigned(X509_VERIFY_PARAM_get0_name); + if FuncLoadError then + begin + {$if not defined(X509_VERIFY_PARAM_get0_name_allownil)} + X509_VERIFY_PARAM_get0_name := @ERR_X509_VERIFY_PARAM_get0_name; + {$ifend} + {$if declared(X509_VERIFY_PARAM_get0_name_introduced)} + if LibVersion < X509_VERIFY_PARAM_get0_name_introduced then + begin + {$if declared(FC_X509_VERIFY_PARAM_get0_name)} + X509_VERIFY_PARAM_get0_name := @FC_X509_VERIFY_PARAM_get0_name; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_VERIFY_PARAM_get0_name_removed)} + if X509_VERIFY_PARAM_get0_name_removed <= LibVersion then + begin + {$if declared(_X509_VERIFY_PARAM_get0_name)} + X509_VERIFY_PARAM_get0_name := @_X509_VERIFY_PARAM_get0_name; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_VERIFY_PARAM_get0_name_allownil)} + if FuncLoadError then + AFailed.Add('X509_VERIFY_PARAM_get0_name'); + {$ifend} + end; + + + X509_VERIFY_PARAM_add0_table := LoadLibFunction(ADllHandle, X509_VERIFY_PARAM_add0_table_procname); + FuncLoadError := not assigned(X509_VERIFY_PARAM_add0_table); + if FuncLoadError then + begin + {$if not defined(X509_VERIFY_PARAM_add0_table_allownil)} + X509_VERIFY_PARAM_add0_table := @ERR_X509_VERIFY_PARAM_add0_table; + {$ifend} + {$if declared(X509_VERIFY_PARAM_add0_table_introduced)} + if LibVersion < X509_VERIFY_PARAM_add0_table_introduced then + begin + {$if declared(FC_X509_VERIFY_PARAM_add0_table)} + X509_VERIFY_PARAM_add0_table := @FC_X509_VERIFY_PARAM_add0_table; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_VERIFY_PARAM_add0_table_removed)} + if X509_VERIFY_PARAM_add0_table_removed <= LibVersion then + begin + {$if declared(_X509_VERIFY_PARAM_add0_table)} + X509_VERIFY_PARAM_add0_table := @_X509_VERIFY_PARAM_add0_table; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_VERIFY_PARAM_add0_table_allownil)} + if FuncLoadError then + AFailed.Add('X509_VERIFY_PARAM_add0_table'); + {$ifend} + end; + + + X509_VERIFY_PARAM_get_count := LoadLibFunction(ADllHandle, X509_VERIFY_PARAM_get_count_procname); + FuncLoadError := not assigned(X509_VERIFY_PARAM_get_count); + if FuncLoadError then + begin + {$if not defined(X509_VERIFY_PARAM_get_count_allownil)} + X509_VERIFY_PARAM_get_count := @ERR_X509_VERIFY_PARAM_get_count; + {$ifend} + {$if declared(X509_VERIFY_PARAM_get_count_introduced)} + if LibVersion < X509_VERIFY_PARAM_get_count_introduced then + begin + {$if declared(FC_X509_VERIFY_PARAM_get_count)} + X509_VERIFY_PARAM_get_count := @FC_X509_VERIFY_PARAM_get_count; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_VERIFY_PARAM_get_count_removed)} + if X509_VERIFY_PARAM_get_count_removed <= LibVersion then + begin + {$if declared(_X509_VERIFY_PARAM_get_count)} + X509_VERIFY_PARAM_get_count := @_X509_VERIFY_PARAM_get_count; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_VERIFY_PARAM_get_count_allownil)} + if FuncLoadError then + AFailed.Add('X509_VERIFY_PARAM_get_count'); + {$ifend} + end; + + + X509_VERIFY_PARAM_get0 := LoadLibFunction(ADllHandle, X509_VERIFY_PARAM_get0_procname); + FuncLoadError := not assigned(X509_VERIFY_PARAM_get0); + if FuncLoadError then + begin + {$if not defined(X509_VERIFY_PARAM_get0_allownil)} + X509_VERIFY_PARAM_get0 := @ERR_X509_VERIFY_PARAM_get0; + {$ifend} + {$if declared(X509_VERIFY_PARAM_get0_introduced)} + if LibVersion < X509_VERIFY_PARAM_get0_introduced then + begin + {$if declared(FC_X509_VERIFY_PARAM_get0)} + X509_VERIFY_PARAM_get0 := @FC_X509_VERIFY_PARAM_get0; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_VERIFY_PARAM_get0_removed)} + if X509_VERIFY_PARAM_get0_removed <= LibVersion then + begin + {$if declared(_X509_VERIFY_PARAM_get0)} + X509_VERIFY_PARAM_get0 := @_X509_VERIFY_PARAM_get0; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_VERIFY_PARAM_get0_allownil)} + if FuncLoadError then + AFailed.Add('X509_VERIFY_PARAM_get0'); + {$ifend} + end; + + + X509_VERIFY_PARAM_lookup := LoadLibFunction(ADllHandle, X509_VERIFY_PARAM_lookup_procname); + FuncLoadError := not assigned(X509_VERIFY_PARAM_lookup); + if FuncLoadError then + begin + {$if not defined(X509_VERIFY_PARAM_lookup_allownil)} + X509_VERIFY_PARAM_lookup := @ERR_X509_VERIFY_PARAM_lookup; + {$ifend} + {$if declared(X509_VERIFY_PARAM_lookup_introduced)} + if LibVersion < X509_VERIFY_PARAM_lookup_introduced then + begin + {$if declared(FC_X509_VERIFY_PARAM_lookup)} + X509_VERIFY_PARAM_lookup := @FC_X509_VERIFY_PARAM_lookup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_VERIFY_PARAM_lookup_removed)} + if X509_VERIFY_PARAM_lookup_removed <= LibVersion then + begin + {$if declared(_X509_VERIFY_PARAM_lookup)} + X509_VERIFY_PARAM_lookup := @_X509_VERIFY_PARAM_lookup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_VERIFY_PARAM_lookup_allownil)} + if FuncLoadError then + AFailed.Add('X509_VERIFY_PARAM_lookup'); + {$ifend} + end; + + + X509_VERIFY_PARAM_table_cleanup := LoadLibFunction(ADllHandle, X509_VERIFY_PARAM_table_cleanup_procname); + FuncLoadError := not assigned(X509_VERIFY_PARAM_table_cleanup); + if FuncLoadError then + begin + {$if not defined(X509_VERIFY_PARAM_table_cleanup_allownil)} + X509_VERIFY_PARAM_table_cleanup := @ERR_X509_VERIFY_PARAM_table_cleanup; + {$ifend} + {$if declared(X509_VERIFY_PARAM_table_cleanup_introduced)} + if LibVersion < X509_VERIFY_PARAM_table_cleanup_introduced then + begin + {$if declared(FC_X509_VERIFY_PARAM_table_cleanup)} + X509_VERIFY_PARAM_table_cleanup := @FC_X509_VERIFY_PARAM_table_cleanup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_VERIFY_PARAM_table_cleanup_removed)} + if X509_VERIFY_PARAM_table_cleanup_removed <= LibVersion then + begin + {$if declared(_X509_VERIFY_PARAM_table_cleanup)} + X509_VERIFY_PARAM_table_cleanup := @_X509_VERIFY_PARAM_table_cleanup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_VERIFY_PARAM_table_cleanup_allownil)} + if FuncLoadError then + AFailed.Add('X509_VERIFY_PARAM_table_cleanup'); + {$ifend} + end; + + + X509_policy_tree_free := LoadLibFunction(ADllHandle, X509_policy_tree_free_procname); + FuncLoadError := not assigned(X509_policy_tree_free); + if FuncLoadError then + begin + {$if not defined(X509_policy_tree_free_allownil)} + X509_policy_tree_free := @ERR_X509_policy_tree_free; + {$ifend} + {$if declared(X509_policy_tree_free_introduced)} + if LibVersion < X509_policy_tree_free_introduced then + begin + {$if declared(FC_X509_policy_tree_free)} + X509_policy_tree_free := @FC_X509_policy_tree_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_policy_tree_free_removed)} + if X509_policy_tree_free_removed <= LibVersion then + begin + {$if declared(_X509_policy_tree_free)} + X509_policy_tree_free := @_X509_policy_tree_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_policy_tree_free_allownil)} + if FuncLoadError then + AFailed.Add('X509_policy_tree_free'); + {$ifend} + end; + + + X509_policy_tree_level_count := LoadLibFunction(ADllHandle, X509_policy_tree_level_count_procname); + FuncLoadError := not assigned(X509_policy_tree_level_count); + if FuncLoadError then + begin + {$if not defined(X509_policy_tree_level_count_allownil)} + X509_policy_tree_level_count := @ERR_X509_policy_tree_level_count; + {$ifend} + {$if declared(X509_policy_tree_level_count_introduced)} + if LibVersion < X509_policy_tree_level_count_introduced then + begin + {$if declared(FC_X509_policy_tree_level_count)} + X509_policy_tree_level_count := @FC_X509_policy_tree_level_count; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_policy_tree_level_count_removed)} + if X509_policy_tree_level_count_removed <= LibVersion then + begin + {$if declared(_X509_policy_tree_level_count)} + X509_policy_tree_level_count := @_X509_policy_tree_level_count; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_policy_tree_level_count_allownil)} + if FuncLoadError then + AFailed.Add('X509_policy_tree_level_count'); + {$ifend} + end; + + + X509_policy_tree_get0_level := LoadLibFunction(ADllHandle, X509_policy_tree_get0_level_procname); + FuncLoadError := not assigned(X509_policy_tree_get0_level); + if FuncLoadError then + begin + {$if not defined(X509_policy_tree_get0_level_allownil)} + X509_policy_tree_get0_level := @ERR_X509_policy_tree_get0_level; + {$ifend} + {$if declared(X509_policy_tree_get0_level_introduced)} + if LibVersion < X509_policy_tree_get0_level_introduced then + begin + {$if declared(FC_X509_policy_tree_get0_level)} + X509_policy_tree_get0_level := @FC_X509_policy_tree_get0_level; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_policy_tree_get0_level_removed)} + if X509_policy_tree_get0_level_removed <= LibVersion then + begin + {$if declared(_X509_policy_tree_get0_level)} + X509_policy_tree_get0_level := @_X509_policy_tree_get0_level; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_policy_tree_get0_level_allownil)} + if FuncLoadError then + AFailed.Add('X509_policy_tree_get0_level'); + {$ifend} + end; + + + X509_policy_level_node_count := LoadLibFunction(ADllHandle, X509_policy_level_node_count_procname); + FuncLoadError := not assigned(X509_policy_level_node_count); + if FuncLoadError then + begin + {$if not defined(X509_policy_level_node_count_allownil)} + X509_policy_level_node_count := @ERR_X509_policy_level_node_count; + {$ifend} + {$if declared(X509_policy_level_node_count_introduced)} + if LibVersion < X509_policy_level_node_count_introduced then + begin + {$if declared(FC_X509_policy_level_node_count)} + X509_policy_level_node_count := @FC_X509_policy_level_node_count; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_policy_level_node_count_removed)} + if X509_policy_level_node_count_removed <= LibVersion then + begin + {$if declared(_X509_policy_level_node_count)} + X509_policy_level_node_count := @_X509_policy_level_node_count; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_policy_level_node_count_allownil)} + if FuncLoadError then + AFailed.Add('X509_policy_level_node_count'); + {$ifend} + end; + + + X509_policy_level_get0_node := LoadLibFunction(ADllHandle, X509_policy_level_get0_node_procname); + FuncLoadError := not assigned(X509_policy_level_get0_node); + if FuncLoadError then + begin + {$if not defined(X509_policy_level_get0_node_allownil)} + X509_policy_level_get0_node := @ERR_X509_policy_level_get0_node; + {$ifend} + {$if declared(X509_policy_level_get0_node_introduced)} + if LibVersion < X509_policy_level_get0_node_introduced then + begin + {$if declared(FC_X509_policy_level_get0_node)} + X509_policy_level_get0_node := @FC_X509_policy_level_get0_node; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_policy_level_get0_node_removed)} + if X509_policy_level_get0_node_removed <= LibVersion then + begin + {$if declared(_X509_policy_level_get0_node)} + X509_policy_level_get0_node := @_X509_policy_level_get0_node; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_policy_level_get0_node_allownil)} + if FuncLoadError then + AFailed.Add('X509_policy_level_get0_node'); + {$ifend} + end; + + + X509_policy_node_get0_policy := LoadLibFunction(ADllHandle, X509_policy_node_get0_policy_procname); + FuncLoadError := not assigned(X509_policy_node_get0_policy); + if FuncLoadError then + begin + {$if not defined(X509_policy_node_get0_policy_allownil)} + X509_policy_node_get0_policy := @ERR_X509_policy_node_get0_policy; + {$ifend} + {$if declared(X509_policy_node_get0_policy_introduced)} + if LibVersion < X509_policy_node_get0_policy_introduced then + begin + {$if declared(FC_X509_policy_node_get0_policy)} + X509_policy_node_get0_policy := @FC_X509_policy_node_get0_policy; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_policy_node_get0_policy_removed)} + if X509_policy_node_get0_policy_removed <= LibVersion then + begin + {$if declared(_X509_policy_node_get0_policy)} + X509_policy_node_get0_policy := @_X509_policy_node_get0_policy; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_policy_node_get0_policy_allownil)} + if FuncLoadError then + AFailed.Add('X509_policy_node_get0_policy'); + {$ifend} + end; + + + X509_policy_node_get0_parent := LoadLibFunction(ADllHandle, X509_policy_node_get0_parent_procname); + FuncLoadError := not assigned(X509_policy_node_get0_parent); + if FuncLoadError then + begin + {$if not defined(X509_policy_node_get0_parent_allownil)} + X509_policy_node_get0_parent := @ERR_X509_policy_node_get0_parent; + {$ifend} + {$if declared(X509_policy_node_get0_parent_introduced)} + if LibVersion < X509_policy_node_get0_parent_introduced then + begin + {$if declared(FC_X509_policy_node_get0_parent)} + X509_policy_node_get0_parent := @FC_X509_policy_node_get0_parent; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_policy_node_get0_parent_removed)} + if X509_policy_node_get0_parent_removed <= LibVersion then + begin + {$if declared(_X509_policy_node_get0_parent)} + X509_policy_node_get0_parent := @_X509_policy_node_get0_parent; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_policy_node_get0_parent_allownil)} + if FuncLoadError then + AFailed.Add('X509_policy_node_get0_parent'); + {$ifend} + end; + + +end; + +procedure Unload; +begin + X509_STORE_set_depth := nil; + X509_STORE_CTX_set_depth := nil; + X509_STORE_CTX_get_app_data := nil; {removed 1.0.0} + X509_OBJECT_up_ref_count := nil; + X509_OBJECT_new := nil; {introduced 1.1.0} + X509_OBJECT_free := nil; {introduced 1.1.0} + X509_OBJECT_get_type := nil; {introduced 1.1.0} + X509_OBJECT_get0_X509 := nil; {introduced 1.1.0} + X509_OBJECT_set1_X509 := nil; {introduced 1.1.0} + X509_OBJECT_get0_X509_CRL := nil; {introduced 1.1.0} + X509_OBJECT_set1_X509_CRL := nil; {introduced 1.1.0} + X509_STORE_new := nil; + X509_STORE_free := nil; + X509_STORE_lock := nil; {introduced 1.1.0} + X509_STORE_unlock := nil; {introduced 1.1.0} + X509_STORE_up_ref := nil; {introduced 1.1.0} + X509_STORE_set_flags := nil; + X509_STORE_set_purpose := nil; + X509_STORE_set_trust := nil; + X509_STORE_set1_param := nil; + X509_STORE_get0_param := nil; {introduced 1.1.0} + X509_STORE_set_verify := nil; {introduced 1.1.0} + X509_STORE_CTX_set_verify := nil; {introduced 1.1.0} + X509_STORE_get_verify := nil; {introduced 1.1.0} + X509_STORE_set_verify_cb := nil; + X509_STORE_get_verify_cb := nil; {introduced 1.1.0} + X509_STORE_set_get_issuer := nil; {introduced 1.1.0} + X509_STORE_get_get_issuer := nil; {introduced 1.1.0} + X509_STORE_set_check_issued := nil; {introduced 1.1.0} + X509_STORE_get_check_issued := nil; {introduced 1.1.0} + X509_STORE_set_check_revocation := nil; {introduced 1.1.0} + X509_STORE_get_check_revocation := nil; {introduced 1.1.0} + X509_STORE_set_get_crl := nil; {introduced 1.1.0} + X509_STORE_get_get_crl := nil; {introduced 1.1.0} + X509_STORE_set_check_crl := nil; {introduced 1.1.0} + X509_STORE_get_check_crl := nil; {introduced 1.1.0} + X509_STORE_set_cert_crl := nil; {introduced 1.1.0} + X509_STORE_get_cert_crl := nil; {introduced 1.1.0} + X509_STORE_set_check_policy := nil; {introduced 1.1.0} + X509_STORE_get_check_policy := nil; {introduced 1.1.0} + X509_STORE_set_cleanup := nil; {introduced 1.1.0} + X509_STORE_get_cleanup := nil; {introduced 1.1.0} + X509_STORE_set_ex_data := nil; {introduced 1.1.0} + X509_STORE_get_ex_data := nil; {introduced 1.1.0} + X509_STORE_CTX_new := nil; + X509_STORE_CTX_get1_issuer := nil; + X509_STORE_CTX_free := nil; + X509_STORE_CTX_cleanup := nil; + X509_STORE_CTX_get0_store := nil; + X509_STORE_CTX_get0_cert := nil; {introduced 1.1.0} + X509_STORE_CTX_set_verify_cb := nil; + X509_STORE_CTX_get_verify_cb := nil; {introduced 1.1.0} + X509_STORE_CTX_get_verify := nil; {introduced 1.1.0} + X509_STORE_CTX_get_get_issuer := nil; {introduced 1.1.0} + X509_STORE_CTX_get_check_issued := nil; {introduced 1.1.0} + X509_STORE_CTX_get_check_revocation := nil; {introduced 1.1.0} + X509_STORE_CTX_get_get_crl := nil; {introduced 1.1.0} + X509_STORE_CTX_get_check_crl := nil; {introduced 1.1.0} + X509_STORE_CTX_get_cert_crl := nil; {introduced 1.1.0} + X509_STORE_CTX_get_check_policy := nil; {introduced 1.1.0} + X509_STORE_CTX_get_cleanup := nil; {introduced 1.1.0} + X509_STORE_add_lookup := nil; + X509_LOOKUP_hash_dir := nil; + X509_LOOKUP_file := nil; + X509_LOOKUP_meth_new := nil; {introduced 1.1.0} + X509_LOOKUP_meth_free := nil; {introduced 1.1.0} + X509_LOOKUP_meth_set_ctrl := nil; {introduced 1.1.0} + X509_LOOKUP_meth_get_ctrl := nil; {introduced 1.1.0} + X509_LOOKUP_meth_set_get_by_subject := nil; {introduced 1.1.0} + X509_LOOKUP_meth_get_get_by_subject := nil; {introduced 1.1.0} + X509_LOOKUP_meth_set_get_by_issuer_serial := nil; {introduced 1.1.0} + X509_LOOKUP_meth_get_get_by_issuer_serial := nil; {introduced 1.1.0} + X509_LOOKUP_meth_set_get_by_fingerprint := nil; {introduced 1.1.0} + X509_LOOKUP_meth_get_get_by_fingerprint := nil; {introduced 1.1.0} + X509_LOOKUP_meth_set_get_by_alias := nil; {introduced 1.1.0} + X509_LOOKUP_meth_get_get_by_alias := nil; {introduced 1.1.0} + X509_STORE_add_cert := nil; + X509_STORE_add_crl := nil; + X509_STORE_CTX_get_by_subject := nil; {introduced 1.1.0} + X509_STORE_CTX_get_obj_by_subject := nil; {introduced 1.1.0} + X509_LOOKUP_ctrl := nil; + X509_load_cert_file := nil; + X509_load_crl_file := nil; + X509_load_cert_crl_file := nil; + X509_LOOKUP_new := nil; + X509_LOOKUP_free := nil; + X509_LOOKUP_init := nil; + X509_LOOKUP_by_subject := nil; + X509_LOOKUP_by_issuer_serial := nil; + X509_LOOKUP_by_fingerprint := nil; + X509_LOOKUP_by_alias := nil; + X509_LOOKUP_set_method_data := nil; {introduced 1.1.0} + X509_LOOKUP_get_method_data := nil; {introduced 1.1.0} + X509_LOOKUP_get_store := nil; {introduced 1.1.0} + X509_LOOKUP_shutdown := nil; + X509_STORE_load_locations := nil; + X509_STORE_set_default_paths := nil; + X509_STORE_CTX_set_ex_data := nil; + X509_STORE_CTX_get_ex_data := nil; + X509_STORE_CTX_get_error := nil; + X509_STORE_CTX_set_error := nil; + X509_STORE_CTX_get_error_depth := nil; + X509_STORE_CTX_set_error_depth := nil; {introduced 1.1.0} + X509_STORE_CTX_get_current_cert := nil; + X509_STORE_CTX_set_current_cert := nil; {introduced 1.1.0} + X509_STORE_CTX_get0_current_issuer := nil; + X509_STORE_CTX_get0_current_crl := nil; + X509_STORE_CTX_get0_parent_ctx := nil; + X509_STORE_CTX_set_cert := nil; + X509_STORE_CTX_set_purpose := nil; + X509_STORE_CTX_set_trust := nil; + X509_STORE_CTX_purpose_inherit := nil; + X509_STORE_CTX_set_flags := nil; + X509_STORE_CTX_get0_policy_tree := nil; + X509_STORE_CTX_get_explicit_policy := nil; + X509_STORE_CTX_get_num_untrusted := nil; {introduced 1.1.0} + X509_STORE_CTX_get0_param := nil; + X509_STORE_CTX_set0_param := nil; + X509_STORE_CTX_set_default := nil; + X509_STORE_CTX_set0_dane := nil; {introduced 1.1.0} + X509_VERIFY_PARAM_new := nil; + X509_VERIFY_PARAM_free := nil; + X509_VERIFY_PARAM_inherit := nil; + X509_VERIFY_PARAM_set1 := nil; + X509_VERIFY_PARAM_set1_name := nil; + X509_VERIFY_PARAM_set_flags := nil; + X509_VERIFY_PARAM_clear_flags := nil; + X509_VERIFY_PARAM_get_flags := nil; + X509_VERIFY_PARAM_set_purpose := nil; + X509_VERIFY_PARAM_set_trust := nil; + X509_VERIFY_PARAM_set_depth := nil; + X509_VERIFY_PARAM_set_auth_level := nil; {introduced 1.1.0} + X509_VERIFY_PARAM_add0_policy := nil; + X509_VERIFY_PARAM_set_inh_flags := nil; {introduced 1.1.0} + X509_VERIFY_PARAM_get_inh_flags := nil; {introduced 1.1.0} + X509_VERIFY_PARAM_set1_host := nil; + X509_VERIFY_PARAM_add1_host := nil; + X509_VERIFY_PARAM_set_hostflags := nil; + X509_VERIFY_PARAM_get_hostflags := nil; {introduced 1.1.0} + X509_VERIFY_PARAM_get0_peername := nil; + X509_VERIFY_PARAM_move_peername := nil; {introduced 1.1.0} + X509_VERIFY_PARAM_set1_email := nil; + X509_VERIFY_PARAM_set1_ip := nil; + X509_VERIFY_PARAM_set1_ip_asc := nil; + X509_VERIFY_PARAM_get_depth := nil; + X509_VERIFY_PARAM_get_auth_level := nil; {introduced 1.1.0} + X509_VERIFY_PARAM_get0_name := nil; + X509_VERIFY_PARAM_add0_table := nil; + X509_VERIFY_PARAM_get_count := nil; + X509_VERIFY_PARAM_get0 := nil; + X509_VERIFY_PARAM_lookup := nil; + X509_VERIFY_PARAM_table_cleanup := nil; + X509_policy_tree_free := nil; + X509_policy_tree_level_count := nil; + X509_policy_tree_get0_level := nil; + X509_policy_level_node_count := nil; + X509_policy_level_get0_node := nil; + X509_policy_node_get0_policy := nil; + X509_policy_node_get0_parent := nil; +end; +{$ELSE} +function X509_STORE_CTX_get_app_data(ctx: PX509_STORE_CTX): Pointer; +begin + Result := X509_STORE_CTX_get_ex_data(ctx,SSL_get_ex_data_X509_STORE_CTX_idx); +end; + + +{$ENDIF} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +initialization + Register_SSLLoader(@Load,'LibCrypto'); + Register_SSLUnloader(@Unload); +{$ENDIF} +end. diff --git a/IdOpenSSLHeaders_x509err.pas b/IdOpenSSLHeaders_x509err.pas new file mode 100644 index 0000000..4b1e1e2 --- /dev/null +++ b/IdOpenSSLHeaders_x509err.pas @@ -0,0 +1,247 @@ + (* This unit was generated using the script genOpenSSLHdrs.sh from the source file IdOpenSSLHeaders_x509err.h2pas + It should not be modified directly. All changes should be made to IdOpenSSLHeaders_x509err.h2pas + and this file regenerated. IdOpenSSLHeaders_x509err.h2pas is distributed with the full Indy + Distribution. + *) + +{$i IdCompilerDefines.inc} +{$i IdSSLOpenSSLDefines.inc} +{$IFNDEF USE_OPENSSL} + { error Should not compile if USE_OPENSSL is not defined!!!} +{$ENDIF} +{******************************************************************************} +{ } +{ Indy (Internet Direct) - Internet Protocols Simplified } +{ } +{ https://www.indyproject.org/ } +{ https://gitter.im/IndySockets/Indy } +{ } +{******************************************************************************} +{ } +{ This file is part of the Indy (Internet Direct) project, and is offered } +{ under the dual-licensing agreement described on the Indy website. } +{ (https://www.indyproject.org/license/) } +{ } +{ Copyright: } +{ (c) 1993-2020, Chad Z. Hower and the Indy Pit Crew. All rights reserved. } +{ } +{******************************************************************************} +{ } +{ } +{******************************************************************************} + +unit IdOpenSSLHeaders_x509err; + +interface + +// Headers for OpenSSL 1.1.1 +// x509err.h + + +uses + IdCTypes, + IdGlobal, + IdSSLOpenSSLConsts; + +const + (* + * X509 function codes. + *) + X509_F_ADD_CERT_DIR = 100; + X509_F_BUILD_CHAIN = 106; + X509_F_BY_FILE_CTRL = 101; + X509_F_CHECK_NAME_CONSTRAINTS = 149; + X509_F_CHECK_POLICY = 145; + X509_F_DANE_I2D = 107; + X509_F_DIR_CTRL = 102; + X509_F_GET_CERT_BY_SUBJECT = 103; + X509_F_I2D_X509_AUX = 151; + X509_F_LOOKUP_CERTS_SK = 152; + X509_F_NETSCAPE_SPKI_B64_DECODE = 129; + X509_F_NETSCAPE_SPKI_B64_ENCODE = 130; + X509_F_NEW_DIR = 153; + X509_F_X509AT_ADD1_ATTR = 135; + X509_F_X509V3_ADD_EXT = 104; + X509_F_X509_ATTRIBUTE_CREATE_BY_NID = 136; + X509_F_X509_ATTRIBUTE_CREATE_BY_OBJ = 137; + X509_F_X509_ATTRIBUTE_CREATE_BY_TXT = 140; + X509_F_X509_ATTRIBUTE_GET0_DATA = 139; + X509_F_X509_ATTRIBUTE_SET1_DATA = 138; + X509_F_X509_CHECK_PRIVATE_KEY = 128; + X509_F_X509_CRL_DIFF = 105; + X509_F_X509_CRL_METHOD_NEW = 154; + X509_F_X509_CRL_PRINT_FP = 147; + X509_F_X509_EXTENSION_CREATE_BY_NID = 108; + X509_F_X509_EXTENSION_CREATE_BY_OBJ = 109; + X509_F_X509_GET_PUBKEY_PARAMETERS = 110; + X509_F_X509_LOAD_CERT_CRL_FILE = 132; + X509_F_X509_LOAD_CERT_FILE = 111; + X509_F_X509_LOAD_CRL_FILE = 112; + X509_F_X509_LOOKUP_METH_NEW = 160; + X509_F_X509_LOOKUP_NEW = 155; + X509_F_X509_NAME_ADD_ENTRY = 113; + X509_F_X509_NAME_CANON = 156; + X509_F_X509_NAME_ENTRY_CREATE_BY_NID = 114; + X509_F_X509_NAME_ENTRY_CREATE_BY_TXT = 131; + X509_F_X509_NAME_ENTRY_SET_OBJECT = 115; + X509_F_X509_NAME_ONELINE = 116; + X509_F_X509_NAME_PRINT = 117; + X509_F_X509_OBJECT_NEW = 150; + X509_F_X509_PRINT_EX_FP = 118; + X509_F_X509_PUBKEY_DECODE = 148; + X509_F_X509_PUBKEY_GET0 = 119; + X509_F_X509_PUBKEY_SET = 120; + X509_F_X509_REQ_CHECK_PRIVATE_KEY = 144; + X509_F_X509_REQ_PRINT_EX = 121; + X509_F_X509_REQ_PRINT_FP = 122; + X509_F_X509_REQ_TO_X509 = 123; + X509_F_X509_STORE_ADD_CERT = 124; + X509_F_X509_STORE_ADD_CRL = 125; + X509_F_X509_STORE_ADD_LOOKUP = 157; + X509_F_X509_STORE_CTX_GET1_ISSUER = 146; + X509_F_X509_STORE_CTX_INIT = 143; + X509_F_X509_STORE_CTX_NEW = 142; + X509_F_X509_STORE_CTX_PURPOSE_INHERIT = 134; + X509_F_X509_STORE_NEW = 158; + X509_F_X509_TO_X509_REQ = 126; + X509_F_X509_TRUST_ADD = 133; + X509_F_X509_TRUST_SET = 141; + X509_F_X509_VERIFY_CERT = 127; + X509_F_X509_VERIFY_PARAM_NEW = 159; + + (* + * X509 reason codes. + *) + X509_R_AKID_MISMATCH = 110; + X509_R_BAD_SELECTOR = 133; + X509_R_BAD_X509_FILETYPE = 100; + X509_R_BASE64_DECODE_ERROR = 118; + X509_R_CANT_CHECK_DH_KEY = 114; + X509_R_CERT_ALREADY_IN_HASH_TABLE = 101; + X509_R_CRL_ALREADY_DELTA = 127; + X509_R_CRL_VERIFY_FAILURE = 131; + X509_R_IDP_MISMATCH = 128; + X509_R_INVALID_ATTRIBUTES = 138; + X509_R_INVALID_DIRECTORY = 113; + X509_R_INVALID_FIELD_NAME = 119; + X509_R_INVALID_TRUST = 123; + X509_R_ISSUER_MISMATCH = 129; + X509_R_KEY_TYPE_MISMATCH = 115; + X509_R_KEY_VALUES_MISMATCH = 116; + X509_R_LOADING_CERT_DIR = 103; + X509_R_LOADING_DEFAULTS = 104; + X509_R_METHOD_NOT_SUPPORTED = 124; + X509_R_NAME_TOO_LONG = 134; + X509_R_NEWER_CRL_NOT_NEWER = 132; + X509_R_NO_CERTIFICATE_FOUND = 135; + X509_R_NO_CERTIFICATE_OR_CRL_FOUND = 136; + X509_R_NO_CERT_SET_FOR_US_TO_VERIFY = 105; + X509_R_NO_CRL_FOUND = 137; + X509_R_NO_CRL_NUMBER = 130; + X509_R_PUBLIC_KEY_DECODE_ERROR = 125; + X509_R_PUBLIC_KEY_ENCODE_ERROR = 126; + X509_R_SHOULD_RETRY = 106; + X509_R_UNABLE_TO_FIND_PARAMETERS_IN_CHAIN = 107; + X509_R_UNABLE_TO_GET_CERTS_PUBLIC_KEY = 108; + X509_R_UNKNOWN_KEY_TYPE = 117; + X509_R_UNKNOWN_NID = 109; + X509_R_UNKNOWN_PURPOSE_ID = 121; + X509_R_UNKNOWN_TRUST_ID = 120; + X509_R_UNSUPPORTED_ALGORITHM = 111; + X509_R_WRONG_LOOKUP_TYPE = 112; + X509_R_WRONG_TYPE = 122; + + { The EXTERNALSYM directive is ignored by FPC, however, it is used by Delphi as follows: + + The EXTERNALSYM directive prevents the specified Delphi symbol from appearing in header + files generated for C++. } + + {$EXTERNALSYM ERR_load_X509_strings} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +var + ERR_load_X509_strings: function : TIdC_INT; cdecl = nil; + +{$ELSE} + function ERR_load_X509_strings: TIdC_INT cdecl; external CLibCrypto; + +{$ENDIF} + +implementation + + uses + classes, + IdSSLOpenSSLExceptionHandlers, + IdResourceStringsOpenSSL + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + ,IdSSLOpenSSLLoader + {$ENDIF}; + + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +const + ERR_load_X509_strings_procname = 'ERR_load_X509_strings'; + + +{$WARN NO_RETVAL OFF} +function ERR_ERR_load_X509_strings: TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(ERR_load_X509_strings_procname); +end; + + + +{$WARN NO_RETVAL ON} + +procedure Load(const ADllHandle: TIdLibHandle; LibVersion: TIdC_UINT; const AFailed: TStringList); + +var FuncLoadError: boolean; + +begin + ERR_load_X509_strings := LoadLibFunction(ADllHandle, ERR_load_X509_strings_procname); + FuncLoadError := not assigned(ERR_load_X509_strings); + if FuncLoadError then + begin + {$if not defined(ERR_load_X509_strings_allownil)} + ERR_load_X509_strings := @ERR_ERR_load_X509_strings; + {$ifend} + {$if declared(ERR_load_X509_strings_introduced)} + if LibVersion < ERR_load_X509_strings_introduced then + begin + {$if declared(FC_ERR_load_X509_strings)} + ERR_load_X509_strings := @FC_ERR_load_X509_strings; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ERR_load_X509_strings_removed)} + if ERR_load_X509_strings_removed <= LibVersion then + begin + {$if declared(_ERR_load_X509_strings)} + ERR_load_X509_strings := @_ERR_load_X509_strings; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ERR_load_X509_strings_allownil)} + if FuncLoadError then + AFailed.Add('ERR_load_X509_strings'); + {$ifend} + end; + + +end; + +procedure Unload; +begin + ERR_load_X509_strings := nil; +end; +{$ELSE} +{$ENDIF} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +initialization + Register_SSLLoader(@Load,'LibCrypto'); + Register_SSLUnloader(@Unload); +{$ENDIF} +end. diff --git a/IdOpenSSLHeaders_x509v3.pas b/IdOpenSSLHeaders_x509v3.pas new file mode 100644 index 0000000..9857c1c --- /dev/null +++ b/IdOpenSSLHeaders_x509v3.pas @@ -0,0 +1,5282 @@ + (* This unit was generated using the script genOpenSSLHdrs.sh from the source file IdOpenSSLHeaders_x509v3.h2pas + It should not be modified directly. All changes should be made to IdOpenSSLHeaders_x509v3.h2pas + and this file regenerated. IdOpenSSLHeaders_x509v3.h2pas is distributed with the full Indy + Distribution. + *) + +{$i IdCompilerDefines.inc} +{$i IdSSLOpenSSLDefines.inc} +{$IFNDEF USE_OPENSSL} + { error Should not compile if USE_OPENSSL is not defined!!!} +{$ENDIF} +{******************************************************************************} +{ } +{ Indy (Internet Direct) - Internet Protocols Simplified } +{ } +{ https://www.indyproject.org/ } +{ https://gitter.im/IndySockets/Indy } +{ } +{******************************************************************************} +{ } +{ This file is part of the Indy (Internet Direct) project, and is offered } +{ under the dual-licensing agreement described on the Indy website. } +{ (https://www.indyproject.org/license/) } +{ } +{ Copyright: } +{ (c) 1993-2020, Chad Z. Hower and the Indy Pit Crew. All rights reserved. } +{ } +{******************************************************************************} +{ } +{ } +{******************************************************************************} + +unit IdOpenSSLHeaders_x509v3; + +interface + +// Headers for OpenSSL 1.1.1 +// x509v3.h + + +uses + IdCTypes, + IdGlobal, + IdSSLOpenSSLConsts, + IdOpenSSLHeaders_ossl_typ, + IdOpenSSLHeaders_asn1, + IdOpenSSLHeaders_asn1t, + IdOpenSSLHeaders_safestack, + IdOpenSSLHeaders_stack, + IdOpenSSLHeaders_x509; + +const + (* ext_flags values *) + X509V3_EXT_DYNAMIC = $1; + X509V3_EXT_CTX_DEP = $2; + X509V3_EXT_MULTILINE = $4; + + // v3_ext_ctx + CTX_TEST = $1; + X509V3_CTX_REPLACE = $2; + + // GENERAL_NAME_st + GEN_OTHERNAME = 0; + GEN_EMAIL = 1; + GEN_DNS = 2; + GEN_X400 = 3; + GEN_DIRNAME = 4; + GEN_EDIPARTY = 5; + GEN_URI = 6; + GEN_IPADD = 7; + GEN_RID = 8; + + (* All existing reasons *) + CRLDP_ALL_REASONS = $807f; + + CRL_REASON_NONE = -1; + CRL_REASON_UNSPECIFIED = 0; + CRL_REASON_KEY_COMPROMISE = 1; + CRL_REASON_CA_COMPROMISE = 2; + CRL_REASON_AFFILIATION_CHANGED = 3; + CRL_REASON_SUPERSEDED = 4; + CRL_REASON_CESSATION_OF_OPERATION = 5; + CRL_REASON_CERTIFICATE_HOLD = 6; + CRL_REASON_REMOVE_FROM_CRL = 8; + CRL_REASON_PRIVILEGE_WITHDRAWN = 9; + CRL_REASON_AA_COMPROMISE = 10; + + (* Values in idp_flags field *) + (* IDP present *) + IDP_PRESENT = $1; + (* IDP values inconsistent *) + IDP_INVALID = $2; + (* onlyuser true *) + IDP_ONLYUSER = $4; + (* onlyCA true *) + IDP_ONLYCA = $8; + (* onlyattr true *) + IDP_ONLYATTR = $10; + (* indirectCRL true *) + IDP_INDIRECT = $20; + (* onlysomereasons present *) + IDP_REASONS = $40; + + EXT_END: array[0..13] of TIdC_INT = (-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + + (* X509_PURPOSE stuff *) + + EXFLAG_BCONS = $1; + EXFLAG_KUSAGE = $2; + EXFLAG_XKUSAGE = $4; + EXFLAG_NSCERT = $8; + + EXFLAG_CA = $10; + (* Really self issued not necessarily self signed *) + EXFLAG_SI = $20; + EXFLAG_V1 = $40; + EXFLAG_INVALID = $80; + (* EXFLAG_SET is set to indicate that some values have been precomputed *) + EXFLAG_SET = $100; + EXFLAG_CRITICAL = $200; + EXFLAG_PROXY = $400; + + EXFLAG_INVALID_POLICY = $800; + EXFLAG_FRESHEST = $1000; + (* Self signed *) + EXFLAG_SS = $2000; + + EXFLAG_BCONS_CRITICAL = $10000; //introudced 3.0.0 + EXFLAG_AKID_CRITICAL = $20000; //introduced 3.0.0 + EXFLAG_SKID_CRITICAL = $40000; //introduced 3.0.0 + EXFLAG_SAN_CRITICAL = $80000; //introudced 3.0.0 + EXFLAG_NO_FINGERPRINT = $100000; //introduced 3.0.0 + + KU_DIGITAL_SIGNATURE = $0080; + KU_NON_REPUDIATION = $0040; + KU_KEY_ENCIPHERMENT = $0020; + KU_DATA_ENCIPHERMENT = $0010; + KU_KEY_AGREEMENT = $0008; + KU_KEY_CERT_SIGN = $0004; + KU_CRL_SIGN = $0002; + KU_ENCIPHER_ONLY = $0001; + KU_DECIPHER_ONLY = $8000; + + NS_SSL_CLIENT = $80; + NS_SSL_SERVER = $40; + NS_SMIME = $20; + NS_OBJSIGN = $10; + NS_SSL_CA = $04; + NS_SMIME_CA = $02; + NS_OBJSIGN_CA = $01; + NS_ANY_CA = NS_SSL_CA or NS_SMIME_CA or NS_OBJSIGN_CA; + + XKU_SSL_SERVER = $1; + XKU_SSL_CLIENT = $2; + XKU_SMIME = $4; + XKU_CODE_SIGN = $8; + XKU_SGC = $10; + XKU_OCSP_SIGN = $20; + XKU_TIMESTAMP = $40; + XKU_DVCS = $80; + XKU_ANYEKU = $100; + + X509_PURPOSE_DYNAMIC = $1; + X509_PURPOSE_DYNAMIC_NAME = $2; + + X509_PURPOSE_SSL_CLIENT = 1; + X509_PURPOSE_SSL_SERVER = 2; + X509_PURPOSE_NS_SSL_SERVER = 3; + X509_PURPOSE_SMIME_SIGN = 4; + X509_PURPOSE_SMIME_ENCRYPT = 5; + X509_PURPOSE_CRL_SIGN = 6; + X509_PURPOSE_ANY = 7; + X509_PURPOSE_OCSP_HELPER = 8; + X509_PURPOSE_TIMESTAMP_SIGN = 9; + + X509_PURPOSE_MIN = 1; + X509_PURPOSE_MAX = 9; + + (* Flags for X509V3_EXT_print() *) + + X509V3_EXT_UNKNOWN_MASK = TIdC_LONG($f) shl 16; + (* Return error for unknown extensions *) + X509V3_EXT_DEFAULT = 0; + (* Print error for unknown extensions *) + X509V3_EXT_ERROR_UNKNOWN = TIdC_LONG(1) shl 16; + (* ASN1 parse unknown extensions *) + X509V3_EXT_PARSE_UNKNOWN = TIdC_LONG(2) shl 16; + (* BIO_dump unknown extensions *) + X509V3_EXT_DUMP_UNKNOWN = TIdC_LONG(3) shl 16; + + (* Flags for X509V3_add1_i2d *) + + X509V3_ADD_OP_MASK = TIdC_LONG($f); + X509V3_ADD_DEFAULT = TIdC_LONG(0); + X509V3_ADD_APPEND = TIdC_LONG(1); + X509V3_ADD_REPLACE = TIdC_LONG(2); + X509V3_ADD_REPLACE_EXISTING = TIdC_LONG(3); + X509V3_ADD_KEEP_EXISTING = TIdC_LONG(4); + X509V3_ADD_DELETE = TIdC_LONG(5); + X509V3_ADD_SILENT = $10; + + (* Flags for X509_check_* functions *) + + (* + * Always check subject name for host match even if subject alt names present + *) + X509_CHECK_FLAG_ALWAYS_CHECK_SUBJECT = $1; + (* Disable wildcard matching for dnsName fields and common name. *) + X509_CHECK_FLAG_NO_WILDCARDS = $2; + (* Wildcards must not match a partial label. *) + X509_CHECK_FLAG_NO_PARTIAL_WILDCARDS = $4; + (* Allow (non-partial) wildcards to match multiple labels. *) + X509_CHECK_FLAG_MULTI_LABEL_WILDCARDS = $8; + (* Constraint verifier subdomain patterns to match a single labels. *) + X509_CHECK_FLAG_SINGLE_LABEL_SUBDOMAINS = $10; + (* Never check the subject CN *) + X509_CHECK_FLAG_NEVER_CHECK_SUBJECT = $20; + (* + * Match reference identifiers starting with "." to any sub-domain. + * This is a non-public flag, turned on implicitly when the subject + * reference identity is a DNS name. + *) + _X509_CHECK_FLAG_DOT_SUBDOMAINS = $8000; + + ASIdOrRange_id = 0; + ASIdOrRange_range = 1; + + ASIdentifierChoice_inherit = 0; + ASIdentifierChoice_asIdsOrRanges = 1; + + IPAddressOrRange_addressPrefix = 0; + IPAddressOrRange_addressRange = 1; + + IPAddressChoice_inherit = 0; + IPAddressChoice_addressesOrRanges = 1; + + (* + * API tag for elements of the ASIdentifer SEQUENCE. + *) + V3_ASID_ASNUM = 0; + V3_ASID_RDI = 1; + + (* + * AFI values, assigned by IANA. It'd be nice to make the AFI + * handling code totally generic, but there are too many little things + * that would need to be defined for other address families for it to + * be worth the trouble. + *) + IANA_AFI_IPV4 = 1; + IANA_AFI_IPV6 = 2; + +type + (* Forward reference *) + //Pv3_ext_method = ^v3_ext_method; + //Pv3_ext_ctx = ^v3_ext_ctx; + + (* Useful typedefs *) + + //X509V3_EXT_NEW = function: Pointer; cdecl; + //X509V3_EXT_FREE = procedure(v1: Pointer); cdecl; + //X509V3_EXT_D2I = function(v1: Pointer; v2: PPByte; v3: TIdC_Long): Pointer; cdecl; + //X509V3_EXT_I2D = function(v1: Pointer; v2: PPByte): TIdC_INT; cdecl; +// typedef STACK_OF(CONF_VALUE) * +// (*X509V3_EXT_I2V) (const struct v3_ext_method *method, void *ext, +// STACK_OF(CONF_VALUE) *extlist); +// typedef void *(*X509V3_EXT_V2I)(const struct v3_ext_method *method, +// struct v3_ext_ctx *ctx, +// STACK_OF(CONF_VALUE) *values); + //X509V3_EXT_I2S = function(method: Pv3_ext_method; ext: Pointer): PIdAnsiChar; cdecl; + //X509V3_EXT_S2I = function(method: Pv3_ext_method; ctx: Pv3_ext_ctx; const str: PIdAnsiChar): Pointer; cdecl; + //X509V3_EXT_I2R = function(const method: Pv3_ext_method; ext: Pointer; out_: PBIO; indent: TIdC_INT): TIdC_INT; cdecl; + //X509V3_EXT_R2I = function(const method: Pv3_ext_method; ctx: Pv3_ext_ctx; const str: PIdAnsiChar): Pointer; cdecl; + +// (* V3 extension structure *) +// v3_ext_method = record +// ext_nid: TIdC_INT; +// ext_flags: TIdC_INT; +//(* If this is set the following four fields are ignored *) +// it: PASN1_ITEM_EXP; +//(* Old style ASN1 calls *) +// ext_new: X509V3_EXT_NEW; +// ext_free: X509V3_EXT_FREE; +// d2i: X509V3_EXT_D2I; +// i2d: X509V3_EXT_I2D; +//(* The following pair is used for string extensions *) +// i2s: X509V3_EXT_I2S; +// s2i: X509V3_EXT_S2I; +//(* The following pair is used for multi-valued extensions *) +// i2v: X509V3_EXT_I2V; +// v2i: X509V3_EXT_V2I; +//(* The following are used for raw extensions *) +// i2r: X509V3_EXT_I2R; +// r2i: X509V3_EXT_R2I; +// usr_data: Pointer; (* Any extension specific data *) +// end; +// X509V3_EXT_METHOD = v3_ext_method; +// PX509V3_EXT_METHOD = ^X509V3_EXT_METHOD; +// DEFINE_STACK_OF(X509V3_EXT_METHOD) + +// typedef struct X509V3_CONF_METHOD_st { +// PIdAnsiChar *(*get_string) (void *db, const section: PIdAnsiChar, const value: PIdAnsiChar); +// STACK_OF(CONF_VALUE) *(*get_section) (void *db, const section: PIdAnsiChar); +// void (*free_string) (void *db, PIdAnsiChar *string); +// void (*free_section) (void *db, STACK_OF(CONF_VALUE) *section); +// } X509V3_CONF_METHOD; + +// Moved to ossl_typ +// (* Context specific info *) +// v3_ext_ctx = record +// flags: TIdC_INT; +// issuer_cert: PX509; +// subject_cert: PX509; +// subject_req: PX509_REQ; +// crl: PX509_CRL; +// db_meth: PX509V3_CONF_METHOD; +// db: Pointer; +// (* Maybe more here *) +// end; + + ENUMERATED_NAMES = BIT_STRING_BITNAME; + + BASIC_CONSTRAINTS_st = record + ca: TIdC_INT; + pathlen: PASN1_INTEGER; + end; + BASIC_CONSTRAINTS = BASIC_CONSTRAINTS_st; + PBASIC_CONSTRAINTS = ^BASIC_CONSTRAINTS; + + PKEY_USAGE_PERIOD_st = record + notBefore: PASN1_GENERALIZEDTIME; + notAfter: PASN1_GENERALIZEDTIME; + end; + PKEY_USAGE_PERIOD = PKEY_USAGE_PERIOD_st; + PPKEY_USAGE_PERIOD = ^PKEY_USAGE_PERIOD; + + otherName_st = record + type_id: PASN1_OBJECT; + value: PASN1_TYPE; + end; + OTHERNAME = otherName_st; + POTHERNAME = ^OTHERNAME; + + EDIPartyName_st = record + nameAssigner: PASN1_STRING; + partyName: PASN1_STRING; + end; + EDIPARTYNAME = EDIPartyName_st; + PEDIPARTYNAME = ^EDIPARTYNAME; + + GENERAL_NAME_st_union = record + case TIdC_INT of + 0: (ptr: PIdAnsiChar); + 1: (otherName: POTHERNAME); (* otherName *) + 2: (rfc822Name: PASN1_IA5STRING); + 3: (dNSName: PASN1_IA5STRING); + 4: (x400Address: PASN1_TYPE); + 5: (directoryName: PX509_NAME); + 6: (ediPartyName: PEDIPARTYNAME); + 7: (uniformResourceIdentifier: PASN1_IA5STRING); + 8: (iPAddress: PASN1_OCTET_STRING); + 9: (registeredID: PASN1_OBJECT); + (* Old names *) + 10: (ip: PASN1_OCTET_STRING); (* iPAddress *) + 11: (dirn: PX509_NAME); (* dirn *) + 12: (ia5: PASN1_IA5STRING); (* rfc822Name, dNSName, + * uniformResourceIdentifier *) + 13: (rid: PASN1_OBJECT); (* registeredID *) + 14: (other: PASN1_TYPE); (* x400Address *) + end; + GENERAL_NAME_st = record + type_: TIdC_INT; + d: GENERAL_NAME_st_union; + end; + GENERAL_NAME = GENERAL_NAME_st; + PGENERAL_NAME = ^GENERAL_NAME; + + PSTACK_OF_GENERAL_NAME = Pointer; + PGENERAL_NAMES = PSTACK_OF_GENERAL_NAME; + + ACCESS_DESCRIPTION_st = record + method: PASN1_OBJECT; + location: PGENERAL_NAME; + end; + ACCESS_DESCRIPTION = ACCESS_DESCRIPTION_st; + PACCESS_DESCRIPTION = ^ACCESS_DESCRIPTION; + +// typedef STACK_OF(ACCESS_DESCRIPTION) AUTHORITY_INFO_ACCESS; + +// typedef STACK_OF(ASN1_OBJECT) EXTENDED_KEY_USAGE; + +// typedef STACK_OF(ASN1_INTEGER) TLS_FEATURE; + +// DEFINE_STACK_OF(GENERAL_NAME) +// typedef STACK_OF(GENERAL_NAME) GENERAL_NAMES; +// DEFINE_STACK_OF(GENERAL_NAMES) + +// DEFINE_STACK_OF(ACCESS_DESCRIPTION) +// DIST_POINT_NAME_st_union = record +// case TIdC_INT of +// 0: (GENERAL_NAMES *fullname); +// 1: (STACK_OF(X509_NAME_ENTRY) *relativename); +// end; + DIST_POINT_NAME_st = record + type_: TIdC_INT; + (* If relativename then this contains the full distribution point name *) + dpname: PX509_NAME; + end; + DIST_POINT_NAME = DIST_POINT_NAME_st; + PDIST_POINT_NAME = ^DIST_POINT_NAME; + + +// struct DIST_POINT_ST { +// DIST_POINT_NAME *distpoint; +// ASN1_BIT_STRING *reasons; +// GENERAL_NAMES *CRLissuer; +// TIdC_INT dp_reasons; +// }; + +// typedef STACK_OF(DIST_POINT) CRL_DIST_POINTS; + +// DEFINE_STACK_OF(DIST_POINT) + + AUTHORITY_KEYID_st = record + keyid: PASN1_OCTET_STRING; + issuer: PGENERAL_NAMES; + serial: PASN1_INTEGER; + end; + PAUTHORITY_KEYID_st = ^AUTHORITY_KEYID_st; + + (* Strong extranet structures *) + + SXNET_ID_st = record + zone: PASN1_INTEGER; + user: PASN1_OCTET_STRING; + end; + SXNETID = SXNET_ID_st; + PSXNETID = ^SXNETID; +// DEFINE_STACK_OF(SXNETID) + +// SXNET_st = record +// ASN1_INTEGER *version; +// STACK_OF(SXNETID) *ids; +// end; +// SXNET = SXNET_st; +// PSXNET = ^SXNET; + +// NOTICEREF_st = record +// ASN1_STRING *organization; +// STACK_OF(ASN1_INTEGER) *noticenos; +// end; +// NOTICEREF = NOTICEREF_st; +// PNOTICEREF = ^NOTICEREF; + +// USERNOTICE_st = record +// noticeref: PNOTICEREF; +// exptext: PASN1_STRING; +// end; +// USERNOTICE = USERNOTICE_st; +// PUSERNOTICE = ^USERNOTICE; + +// POLICYQUALINFO_st_union = record +// case TIdC_INT of +// 0: (cpsuri: PASN1_IA5STRING); +// 1: (usernotice: PUSERNOTICE); +// 2: (other: PASN1_TYPE); +// end; +// POLICYQUALINFO_st = record +// pqualid: PASN1_OBJECT; +// d: POLICYQUALINFO_st_union; +// end; +// POLICYQUALINFO = POLICYQUALINFO_st; +// PPOLICYQUALINFO = ^POLICYQUALINFO; +// DEFINE_STACK_OF(POLICYQUALINFO) + +// POLICYINFO_st = record +// ASN1_OBJECT *policyid; +// STACK_OF(POLICYQUALINFO) *qualifiers; +// end; +// POLICYINFO = POLICYINFO_st; +// PPOLICYINFO = ^POLICYINFO; +// typedef STACK_OF(POLICYINFO) CERTIFICATEPOLICIES; +// DEFINE_STACK_OF(POLICYINFO) + + POLICY_MAPPING_st = record + issuerDomainPolicy: PASN1_OBJECT; + subjectDomainPolicy: PASN1_OBJECT; + end; + POLICY_MAPPING = POLICY_MAPPING_st; + PPOLICY_MAPPING = ^POLICY_MAPPING; +// DEFINE_STACK_OF(POLICY_MAPPING) +// typedef STACK_OF(POLICY_MAPPING) POLICY_MAPPINGS; + + GENERAL_SUBTREE_st = record + base: PGENERAL_NAME; + minimum: PASN1_INTEGER; + maximum: PASN1_INTEGER; + end; + GENERAL_SUBTREE = GENERAL_SUBTREE_st; + PGENERAL_SUBTREE = ^GENERAL_SUBTREE; +// DEFINE_STACK_OF(GENERAL_SUBTREE) + +// NAME_CONSTRAINTS_st = record +// STACK_OF(GENERAL_SUBTREE) *permittedSubtrees; +// STACK_OF(GENERAL_SUBTREE) *excludedSubtrees; +// end; + + POLICY_CONSTRAINTS_st = record + requireExplicitPolicy: PASN1_INTEGER; + inhibitPolicyMapping: PASN1_INTEGER; + end; + POLICY_CONSTRAINTS = POLICY_CONSTRAINTS_st; + PPOLICY_CONSTRAINTS = ^POLICY_CONSTRAINTS; + + (* Proxy certificate structures, see RFC 3820 *) + PROXY_POLICY_st = record + policyLanguage: PASN1_OBJECT; + policy: PASN1_OCTET_STRING; + end; + PROXY_POLICY = PROXY_POLICY_st; + PPROXY_POLICY = ^PROXY_POLICY; +// DECLARE_ASN1_FUNCTIONS(PROXY_POLICY) + + PROXY_CERT_INFO_EXTENSION_st = record + pcPathLengthConstraint: PASN1_INTEGER; + proxyPolicy: PPROXY_POLICY; + end; + PROXY_CERT_INFO_EXTENSION = PROXY_CERT_INFO_EXTENSION_st; + PPROXY_CERT_INFO_EXTENSION = ^PROXY_CERT_INFO_EXTENSION; +// DECLARE_ASN1_FUNCTIONS(PROXY_CERT_INFO_EXTENSION) + +// ISSUING_DIST_POint_st = record +// distpoint: PDIST_POINT_NAME; +// TIdC_INT onlyuser; +// TIdC_INT onlyCA; +// onlysomereasons: PASN1_BIT_STRING; +// TIdC_INT indirectCRL; +// TIdC_INT onlyattr; +// end; + +// # define X509V3_conf_err(val) ERR_add_error_data(6, \ +// "section:", (val)->section, \ +// ",name:", (val)->name, ",value:", (val)->value) +// +// # define X509V3_set_ctx_test(ctx) \ +// X509V3_set_ctx(ctx, NULL, NULL, NULL, NULL, CTX_TEST) +// # define X509V3_set_ctx_nodb(ctx) (ctx)->db = NULL; +// +// # define EXT_BITSTRING(nid, table) { nid, 0, ASN1_ITEM_ref(ASN1_BIT_STRING), \ +// 0,0,0,0, \ +// 0,0, \ +// (X509V3_EXT_I2V)i2v_ASN1_BIT_STRING, \ +// (X509V3_EXT_V2I)v2i_ASN1_BIT_STRING, \ +// NULL, NULL, \ +// table} +// +// # define EXT_IA5STRING(nid) { nid, 0, ASN1_ITEM_ref(ASN1_IA5STRING), \ +// 0,0,0,0, \ +// (X509V3_EXT_I2S)i2s_ASN1_IA5STRING, \ +// (X509V3_EXT_S2I)s2i_ASN1_IA5STRING, \ +// 0,0,0,0, \ +// NULL} + + PX509_PURPOSE = ^X509_PURPOSE; + x509_purpose_st = record + purpose: TIdC_INT; + trust: TIdC_INT; (* Default trust ID *) + flags: TIdC_INT; + check_purpose: function(const v1: PX509_PURPOSE; const v2: PX509; v3: TIdC_INT): TIdC_INT; cdecl; + name: PIdAnsiChar; + sname: PIdAnsiChar; + usr_data: Pointer; + end; + X509_PURPOSE = x509_purpose_st; +// DEFINE_STACK_OF(X509_PURPOSE) + +// DECLARE_ASN1_FUNCTIONS(BASIC_CONSTRAINTS_st) + +// DECLARE_ASN1_FUNCTIONS(SXNET) +// DECLARE_ASN1_FUNCTIONS(SXNETID) + + ASRange_st = record + min, max: PASN1_INTEGER; + end; + ASRange = ASRange_st; + PASRange = ^ASRange; + + ASIdOrRange_st = record + type_: TIdC_INT; + case u: TIdC_INT of + 0: (id: PASN1_INTEGER); + 1: (range: PASRange); + end; + ASIdOrRange = ASIdOrRange_st; + PASIdOrRange = ^ASIdOrRange; +// typedef STACK_OF(ASIdOrRange) ASIdOrRanges; +// DEFINE_STACK_OF(ASIdOrRange) + +// ASIdentifierChoice_st = record +// type_: TIdC_INT; +// case u: TIdC_INT of +// 0: (inherit: PASN1_NULL); +// 1: (asIdsOrRanges: PASIdOrRanges); +// end; +// ASIdentifierChoice = ASIdentifierChoice_st; +// PASIdentifierChoice = ^ASIdentifierChoice; + +// ASIdentifiers_st = record +// asnum, rdi: PASIdentifierChoice; +// end; +// ASIdentifiers = ASIdentifiers_st; +// PASIdentifiers = ^ASIdentifiers; + +// DECLARE_ASN1_FUNCTIONS(ASRange) +// DECLARE_ASN1_FUNCTIONS(ASIdOrRange) +// DECLARE_ASN1_FUNCTIONS(ASIdentifierChoice) +// DECLARE_ASN1_FUNCTIONS(ASIdentifiers) + + IPAddressRange_st = record + min, max: PASN1_BIT_STRING; + end; + IPAddressRange = IPAddressRange_st; + PIPAddressRange = ^IPAddressRange; + + IPAddressOrRange_st = record + type_: TIdC_INT; + case u: TIdC_INT of + 0: (addressPrefix: PASN1_BIT_STRING); + 1: (addressRange: PIPAddressRange); + end; + IPAddressOrRange = IPAddressOrRange_st; + PIPAddressOrRange = ^IPAddressOrRange; + +// typedef STACK_OF(IPAddressOrRange) IPAddressOrRanges; +// DEFINE_STACK_OF(IPAddressOrRange) + +// IPAddressChoice_st = record +// type_: TIdC_INT; +// case u: TIdC_INT of +// 0: (inherit: PASN1_NULL); +// 1: (addressesOrRanges: PIPAddressOrRanges); +// end; +// IPAddressChoice = IPAddressChoice_st; +// PIPAddressChoice = ^IPAddressChoice; + +// IPAddressFamily_st = record +// addressFamily: PASN1_OCTET_STRING; +// ipAddressChoice: PIPAddressChoice; +// end; +// IPAddressFamily = IPAddressFamily_st; +// PIPAddressFamily = ^IPAddressFamily; + +// typedef STACK_OF(IPAddressFamily) IPAddrBlocks; +// DEFINE_STACK_OF(IPAddressFamily) + +// DECLARE_ASN1_FUNCTIONS(IPAddressRange) +// DECLARE_ASN1_FUNCTIONS(IPAddressOrRange) +// DECLARE_ASN1_FUNCTIONS(IPAddressChoice) +// DECLARE_ASN1_FUNCTIONS(IPAddressFamily) + + NamingAuthority_st = type Pointer; + NAMING_AUTHORITY = NamingAuthority_st; + PNAMING_AUTHORITY = ^NAMING_AUTHORITY; + + ProfessionInfo_st = type Pointer; + PROFESSION_INFO = ProfessionInfo_st; + PPROFESSION_INFO = ^PROFESSION_INFO; + + Admissions_st = type Pointer; + ADMISSIONS = Admissions_st; + PADMISSIONS = ^ADMISSIONS; + + AdmissionSyntax_st = type Pointer; + ADMISSION_SYNTAX = AdmissionSyntax_st; + PADMISSION_SYNTAX = ^ADMISSION_SYNTAX; +// DECLARE_ASN1_FUNCTIONS(NAMING_AUTHORITY) +// DECLARE_ASN1_FUNCTIONS(PROFESSION_INFO) +// DECLARE_ASN1_FUNCTIONS(ADMISSIONS) +// DECLARE_ASN1_FUNCTIONS(ADMISSION_SYNTAX) +// DEFINE_STACK_OF(ADMISSIONS) +// DEFINE_STACK_OF(PROFESSION_INFO) +// typedef STACK_OF(PROFESSION_INFO) PROFESSION_INFOS; + +// function SXNET_add_id_asc(psx: PPSXNET; const zone: PIdAnsiChar; const user: PIdAnsiChar; userlen: TIdC_INT): TIdC_INT; +// function SXNET_add_id_ulong(psx: PPSXNET; lzone: TIdC_ULONG; const user: PIdAnsiChar; userlen: TIdC_INT): TIdC_INT; +// function SXNET_add_id_INTEGER(psx: PPSXNET; izone: PASN1_INTEGER; const user: PIdAnsiChar; userlen: TIdC_INT): TIdC_INT; + +// function SXNET_get_id_asc(sx: PSXNET; const zone: PIdAnsiChar): PASN1_OCTET_STRING; +// function SXNET_get_id_ulong(sx: PSXNET; lzone: TIdC_ULONG): PASN1_OCTET_STRING; +// function SXNET_get_id_INTEGER(sx: PSXNET; zone: PASN1_INTEGER): PASN1_OCTET_STRING; + +// DECLARE_ASN1_FUNCTIONS(AUTHORITY_KEYID) + +// DECLARE_ASN1_FUNCTIONS(PKEY_USAGE_PERIOD) + +// DECLARE_ASN1_FUNCTIONS(GENERAL_NAME) +// GENERAL_NAME *GENERAL_NAME_dup(a: PGENERAL_NAME); + { The EXTERNALSYM directive is ignored by FPC, however, it is used by Delphi as follows: + + The EXTERNALSYM directive prevents the specified Delphi symbol from appearing in header + files generated for C++. } + + {$EXTERNALSYM GENERAL_NAME_cmp} + {$EXTERNALSYM GENERAL_NAME_print} + {$EXTERNALSYM OTHERNAME_cmp} + {$EXTERNALSYM GENERAL_NAME_set0_value} + {$EXTERNALSYM GENERAL_NAME_get0_value} + {$EXTERNALSYM GENERAL_NAME_set0_othername} + {$EXTERNALSYM GENERAL_NAME_get0_otherName} + {$EXTERNALSYM i2a_ACCESS_DESCRIPTION} + {$EXTERNALSYM DIST_POINT_set_dpname} + {$EXTERNALSYM NAME_CONSTRAINTS_check} + {$EXTERNALSYM NAME_CONSTRAINTS_check_CN} + {$EXTERNALSYM BASIC_CONSTRAINTS_free} + {$EXTERNALSYM AUTHORITY_KEYID_free} + {$EXTERNALSYM X509V3_EXT_nconf_nid} + {$EXTERNALSYM X509V3_EXT_nconf} + {$EXTERNALSYM X509V3_EXT_add_nconf} + {$EXTERNALSYM X509V3_EXT_REQ_add_nconf} + {$EXTERNALSYM X509V3_EXT_CRL_add_nconf} + {$EXTERNALSYM X509V3_EXT_conf_nid} + {$EXTERNALSYM X509V3_EXT_conf} + {$EXTERNALSYM X509V3_EXT_add_conf} + {$EXTERNALSYM X509V3_EXT_REQ_add_conf} + {$EXTERNALSYM X509V3_EXT_CRL_add_conf} + {$EXTERNALSYM X509V3_set_nconf} + {$EXTERNALSYM X509V3_get_string} + {$EXTERNALSYM X509V3_string_free} + {$EXTERNALSYM X509V3_set_ctx} + {$EXTERNALSYM X509V3_EXT_add_alias} + {$EXTERNALSYM X509V3_EXT_cleanup} + {$EXTERNALSYM X509V3_add_standard_extensions} + {$EXTERNALSYM X509V3_EXT_d2i} + {$EXTERNALSYM X509V3_EXT_i2d} + {$EXTERNALSYM X509V3_EXT_print} + {$EXTERNALSYM X509_check_ca} + {$EXTERNALSYM X509_check_purpose} + {$EXTERNALSYM X509_supported_extension} + {$EXTERNALSYM X509_PURPOSE_set} + {$EXTERNALSYM X509_check_issued} + {$EXTERNALSYM X509_check_akid} + {$EXTERNALSYM X509_set_proxy_flag} + {$EXTERNALSYM X509_set_proxy_pathlen} + {$EXTERNALSYM X509_get_proxy_pathlen} + {$EXTERNALSYM X509_get_extension_flags} + {$EXTERNALSYM X509_get_key_usage} + {$EXTERNALSYM X509_get_extended_key_usage} + {$EXTERNALSYM X509_get0_subject_key_id} + {$EXTERNALSYM X509_get0_authority_key_id} + {$EXTERNALSYM X509_get0_authority_serial} + {$EXTERNALSYM X509_PURPOSE_get_count} + {$EXTERNALSYM X509_PURPOSE_get0} + {$EXTERNALSYM X509_PURPOSE_get_by_sname} + {$EXTERNALSYM X509_PURPOSE_get_by_id} + {$EXTERNALSYM X509_PURPOSE_get0_name} + {$EXTERNALSYM X509_PURPOSE_get0_sname} + {$EXTERNALSYM X509_PURPOSE_get_trust} + {$EXTERNALSYM X509_PURPOSE_cleanup} + {$EXTERNALSYM X509_PURPOSE_get_id} + {$EXTERNALSYM X509_email_free} + {$EXTERNALSYM X509_get1_email} + {$EXTERNALSYM X509_REQ_get1_email} + {$EXTERNALSYM X509_get1_ocsp} + {$EXTERNALSYM X509_check_host} + {$EXTERNALSYM X509_check_email} + {$EXTERNALSYM X509_check_ip} + {$EXTERNALSYM X509_check_ip_asc} + {$EXTERNALSYM a2i_IPADDRESS} + {$EXTERNALSYM a2i_IPADDRESS_NC} + {$EXTERNALSYM X509_POLICY_NODE_print} + {$EXTERNALSYM X509v3_addr_get_range} + {$EXTERNALSYM X509v3_asid_validate_path} + {$EXTERNALSYM X509v3_addr_validate_path} + {$EXTERNALSYM NAMING_AUTHORITY_get0_authorityId} + {$EXTERNALSYM NAMING_AUTHORITY_get0_authorityURL} + {$EXTERNALSYM NAMING_AUTHORITY_get0_authorityText} + {$EXTERNALSYM NAMING_AUTHORITY_set0_authorityId} + {$EXTERNALSYM NAMING_AUTHORITY_set0_authorityURL} + {$EXTERNALSYM NAMING_AUTHORITY_set0_authorityText} + {$EXTERNALSYM ADMISSION_SYNTAX_get0_admissionAuthority} + {$EXTERNALSYM ADMISSION_SYNTAX_set0_admissionAuthority} + {$EXTERNALSYM ADMISSIONS_get0_admissionAuthority} + {$EXTERNALSYM ADMISSIONS_set0_admissionAuthority} + {$EXTERNALSYM ADMISSIONS_get0_namingAuthority} + {$EXTERNALSYM ADMISSIONS_set0_namingAuthority} + {$EXTERNALSYM PROFESSION_INFO_get0_addProfessionInfo} + {$EXTERNALSYM PROFESSION_INFO_set0_addProfessionInfo} + {$EXTERNALSYM PROFESSION_INFO_get0_namingAuthority} + {$EXTERNALSYM PROFESSION_INFO_set0_namingAuthority} + {$EXTERNALSYM PROFESSION_INFO_get0_registrationNumber} + {$EXTERNALSYM PROFESSION_INFO_set0_registrationNumber} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +var + GENERAL_NAME_cmp: function (a: PGENERAL_NAME; b: PGENERAL_NAME): TIdC_INT; cdecl = nil; + +// ASN1_BIT_STRING *v2i_ASN1_BIT_STRING(method: PX509V3_EXT_METHOD; ctx: PX509V3_CTX; STACK_OF(CONF_VALUE) *nval); +// STACK_OF(CONF_VALUE) *i2v_ASN1_BIT_STRING(method: PX509V3_EXT_METHOD; ASN1_BIT_STRING *bits; STACK_OF(CONF_VALUE) *extlist); + //function i2s_ASN1_IA5STRING(method: PX509V3_EXT_METHOD; ia5: PASN1_IA5STRING): PIdAnsiChar; + //function s2i_ASN1_IA5STRING(method: PX509V3_EXT_METHOD; ctx: PX509V3_CTX; const str: PIdAnsiChar): PASN1_IA5STRING; + +// STACK_OF(CONF_VALUE) *i2v_GENERAL_NAME(method: PX509V3_EXT_METHOD; gen: PGENERAL_NAME; STACK_OF(CONF_VALUE) *ret); + GENERAL_NAME_print: function (out_: PBIO; gen: PGENERAL_NAME): TIdC_INT; cdecl = nil; + +// DECLARE_ASN1_FUNCTIONS(GENERAL_NAMES) + +// STACK_OF(CONF_VALUE) *i2v_GENERAL_NAMES(method: PX509V3_EXT_METHOD, GENERAL_NAMES *gen, STACK_OF(CONF_VALUE) *extlist); +// GENERAL_NAMES *v2i_GENERAL_NAMES(const method: PX509V3_EXT_METHOD, ctx: PX509V3_CTX, STACK_OF(CONF_VALUE) *nval); + +// DECLARE_ASN1_FUNCTIONS(OTHERNAME) +// DECLARE_ASN1_FUNCTIONS(EDIPARTYNAME) + OTHERNAME_cmp: function (a: POTHERNAME; b: POTHERNAME): TIdC_INT; cdecl = nil; + GENERAL_NAME_set0_value: procedure (a: PGENERAL_NAME; type_: TIdC_INT; value: Pointer); cdecl = nil; + GENERAL_NAME_get0_value: function (const a: PGENERAL_NAME; ptype: PIdC_INT): Pointer; cdecl = nil; + GENERAL_NAME_set0_othername: function (gen: PGENERAL_NAME; oid: PASN1_OBJECT; value: PASN1_TYPE): TIdC_INT; cdecl = nil; + GENERAL_NAME_get0_otherName: function (const gen: PGENERAL_NAME; poid: PPASN1_OBJECT; pvalue: PPASN1_TYPE): TIdC_INT; cdecl = nil; + + GENERAL_NAMES_free : procedure(a : PGENERAL_NAMES); cdecl =nil; + //function i2s_ASN1_OCTET_STRING(method: PX509V3_EXT_METHOD; const ia5: PASN1_OCTET_STRING): PIdAnsiChar; + //function s2i_ASN1_OCTET_STRING(method: PX509V3_EXT_METHOD; ctx: PX509V3_CTX; const str: PIdAnsiChar): PASN1_OCTET_STRING; + +// DECLARE_ASN1_FUNCTIONS(EXTENDED_KEY_USAGE) + i2a_ACCESS_DESCRIPTION: function (bp: PBIO; const a: PACCESS_DESCRIPTION): TIdC_INT; cdecl = nil; + +// DECLARE_ASN1_ALLOC_FUNCTIONS(TLS_FEATURE) + +// DECLARE_ASN1_FUNCTIONS(CERTIFICATEPOLICIES) +// DECLARE_ASN1_FUNCTIONS(POLICYINFO) +// DECLARE_ASN1_FUNCTIONS(POLICYQUALINFO) +// DECLARE_ASN1_FUNCTIONS(USERNOTICE) +// DECLARE_ASN1_FUNCTIONS(NOTICEREF) + +// DECLARE_ASN1_FUNCTIONS(CRL_DIST_POINTS) +// DECLARE_ASN1_FUNCTIONS(DIST_POINT) +// DECLARE_ASN1_FUNCTIONS(DIST_POINT_NAME) +// DECLARE_ASN1_FUNCTIONS(ISSUING_DIST_POINT) + + DIST_POINT_set_dpname: function (dpn: PDIST_POINT_NAME; iname: PX509_NAME): TIdC_INT; cdecl = nil; + + NAME_CONSTRAINTS_check: function (x: PX509; nc: PNAME_CONSTRAINTS): TIdC_INT; cdecl = nil; + NAME_CONSTRAINTS_check_CN: function (x: PX509; nc: PNAME_CONSTRAINTS): TIdC_INT; cdecl = nil; + + BASIC_CONSTRAINTS_free : procedure(bc : PBASIC_CONSTRAINTS); cdecl = nil; + AUTHORITY_KEYID_free : procedure(id : PAUTHORITY_KEYID); cdecl = nil; +// DECLARE_ASN1_FUNCTIONS(ACCESS_DESCRIPTION) +// DECLARE_ASN1_FUNCTIONS(AUTHORITY_INFO_ACCESS) + +// DECLARE_ASN1_ITEM(POLICY_MAPPING) +// DECLARE_ASN1_ALLOC_FUNCTIONS(POLICY_MAPPING) +// DECLARE_ASN1_ITEM(POLICY_MAPPINGS) + +// DECLARE_ASN1_ITEM(GENERAL_SUBTREE) +// DECLARE_ASN1_ALLOC_FUNCTIONS(GENERAL_SUBTREE) + +// DECLARE_ASN1_ITEM(NAME_CONSTRAINTS) +// DECLARE_ASN1_ALLOC_FUNCTIONS(NAME_CONSTRAINTS) + +// DECLARE_ASN1_ALLOC_FUNCTIONS(POLICY_CONSTRAINTS) +// DECLARE_ASN1_ITEM(POLICY_CONSTRAINTS) + + //function a2i_GENERAL_NAME(out_: PGENERAL_NAME; const method: PX509V3_EXT_METHOD; ctx: PX509V3_CTX; TIdC_INT gen_type; const value: PIdAnsiChar; is_nc: TIdC_INT): GENERAL_NAME; + + //function v2i_GENERAL_NAME(const method: PX509V3_EXT_METHOD; ctx: PX509V3_CTX; cnf: PCONF_VALUE): PGENERAL_NAME; + //function v2i_GENERAL_NAME_ex(out_: PGENERAL_NAME; const method: PX509V3_EXT_METHOD; ctx: PX509V3_CTX; cnf: PCONF_VALUE; is_nc: TIdC_INT): PGENERAL_NAME; + //procedure X509V3_conf_free(val: PCONF_VALUE); + + X509V3_EXT_nconf_nid: function (conf: PCONF; ctx: PX509V3_CTX; ext_nid: TIdC_INT; const value: PIdAnsiChar): PX509_EXTENSION; cdecl = nil; + X509V3_EXT_nconf: function (conf: PCONF; ctx: PX509V3_CTX; const name: PIdAnsiChar; const value: PIdAnsiChar): PX509_EXTENSION; cdecl = nil; +// TIdC_INT X509V3_EXT_add_nconf_sk(conf: PCONF; ctx: PX509V3_CTX; const section: PIdAnsiChar; STACK_OF(X509_EXTENSION) **sk); + X509V3_EXT_add_nconf: function (conf: PCONF; ctx: PX509V3_CTX; const section: PIdAnsiChar; cert: PX509): TIdC_INT; cdecl = nil; + X509V3_EXT_REQ_add_nconf: function (conf: PCONF; ctx: PX509V3_CTX; const section: PIdAnsiChar; req: PX509_REQ): TIdC_INT; cdecl = nil; + X509V3_EXT_CRL_add_nconf: function (conf: PCONF; ctx: PX509V3_CTX; const section: PIdAnsiChar; crl: PX509_CRL): TIdC_INT; cdecl = nil; + + X509V3_EXT_conf_nid: function (conf: Pointer; ctx: PX509V3_CTX; ext_nid: TIdC_INT; const value: PIdAnsiChar): PX509_EXTENSION; cdecl = nil; +// X509_EXTENSION *X509V3_EXT_conf_nid(LHASH_OF(CONF_VALUE) *conf; ctx: PX509V3_CTX; ext_nid: TIdC_INT; const value: PIdAnsiChar); + X509V3_EXT_conf: function (conf: Pointer; ctx: PX509V3_CTX; const name: PIdAnsiChar; const value: PIdAnsiChar): PX509_EXTENSION; cdecl = nil; +// X509_EXTENSION *X509V3_EXT_conf(LHASH_OF(CONF_VALUE) *conf; ctx: PX509V3_CTX; const name: PIdAnsiChar; const value: PIdAnsiChar); + X509V3_EXT_add_conf: function (conf: Pointer; ctx: PX509V3_CTX; const section: PIdAnsiChar; cert: PX509): TIdC_INT; cdecl = nil; +// TIdC_INT X509V3_EXT_add_conf(LHASH_OF(CONF_VALUE) *conf; ctx: PX509V3_CTX; const section: PIdAnsiChar; cert: PX509); + X509V3_EXT_REQ_add_conf: function (conf: Pointer; ctx: PX509V3_CTX; const section: PIdAnsiChar; req: PX509_REQ): TIdC_INT; cdecl = nil; +// TIdC_INT X509V3_EXT_REQ_add_conf(LHASH_OF(CONF_VALUE) *conf; ctx: PX509V3_CTX; const section: PIdAnsiChar; req: PX509_REQ); + X509V3_EXT_CRL_add_conf: function (conf: Pointer; ctx: PX509V3_CTX; const section: PIdAnsiChar; crl: PX509_CRL): TIdC_INT; cdecl = nil; +// TIdC_INT X509V3_EXT_CRL_add_conf(LHASH_OF(CONF_VALUE) *conf; ctx: PX509V3_CTX; const section: PIdAnsiChar; crl: PX509_CRL); + +// TIdC_INT X509V3_add_value_bool_nf(const name: PIdAnsiChar; TIdC_INT asn1_bool; STACK_OF(CONF_VALUE) **extlist); + //function X509V3_get_value_bool(const value: PCONF_VALUE; asn1_bool: PIdC_INT): TIdC_INT; + //function X509V3_get_value_int(const value: PCONF_VALUE; aint: PPASN1_INTEGER): TIdC_INT; + X509V3_set_nconf: procedure (ctx: PX509V3_CTX; conf: PCONF); cdecl = nil; +// void X509V3_set_conf_lhash(ctx: PX509V3_CTX; LHASH_OF(CONF_VALUE) *lhash); + + X509V3_get_string: function (ctx: PX509V3_CTX; const name: PIdAnsiChar; const section: PIdAnsiChar): PIdAnsiChar; cdecl = nil; +// STACK_OF(CONF_VALUE) *X509V3_get_section(ctx: PX509V3_CTX; const section: PIdAnsiChar); + X509V3_string_free: procedure (ctx: PX509V3_CTX; str: PIdAnsiChar); cdecl = nil; +// void X509V3_section_free(ctx: PX509V3_CTX; STACK_OF(CONF_VALUE) *section); + X509V3_set_ctx: procedure (ctx: PX509V3_CTX; issuer: PX509; subject: PX509; req: PX509_REQ; crl: PX509_CRL; flags: TIdC_INT); cdecl = nil; + +// TIdC_INT X509V3_add_value(const name: PIdAnsiChar; const value: PIdAnsiChar; STACK_OF(CONF_VALUE) **extlist); +// TIdC_INT X509V3_add_value_uPIdAnsiChar(const name: PIdAnsiChar; const Byte *value; STACK_OF(CONF_VALUE) **extlist); +// TIdC_INT X509V3_add_value_bool(const name: PIdAnsiChar; TIdC_INT asn1_bool; STACK_OF(CONF_VALUE) **extlist); +// TIdC_INT X509V3_add_value_int(const name: PIdAnsiChar; const aint: PASN1_INTEGER; STACK_OF(CONF_VALUE) **extlist); + //function i2s_ASN1_INTEGER(meth: PX509V3_EXT_METHOD; const aint: PASN1_INTEGER): PIdAnsiChar; + //function s2i_ASN1_INTEGER(meth: PX509V3_EXT_METHOD; const value: PIdAnsiChar): PASN1_INTEGER; + //function i2s_ASN1_ENUMERATED(meth: PX509V3_EXT_METHOD; const aint: PASN1_ENUMERATED): PIdAnsiChar; + //function i2s_ASN1_ENUMERATED_TABLE(meth: PX509V3_EXT_METHOD; const aint: PASN1_ENUMERATED): PIdAnsiChar; + //function X509V3_EXT_add(ext: PX509V3_EXT_METHOD): TIdC_INT; + //function X509V3_EXT_add_list(extlist: PX509V3_EXT_METHOD): TIdC_INT; + X509V3_EXT_add_alias: function (nid_to: TIdC_INT; nid_from: TIdC_INT): TIdC_INT; cdecl = nil; + X509V3_EXT_cleanup: procedure ; cdecl = nil; + + //function X509V3_EXT_get(ext: PX509_EXTENSION): PX509V3_EXT_METHOD; + //function X509V3_EXT_get_nid(nid: TIdC_INT): PX509V3_EXT_METHOD; + X509V3_add_standard_extensions: function : TIdC_INT; cdecl = nil; +// STACK_OF(CONF_VALUE) *X509V3_parse_list(const line: PIdAnsiChar); + X509V3_EXT_d2i: function (ext: PX509_EXTENSION): Pointer; cdecl = nil; +// void *X509V3_get_d2i(const STACK_OF(X509_EXTENSION) *x; nid: TIdC_INT; TIdC_INT *crit; TIdC_INT *idx); + + X509V3_EXT_i2d: function (ext_nid: TIdC_INT; crit: TIdC_INT; ext_struc: Pointer): PX509_EXTENSION; cdecl = nil; +// TIdC_INT X509V3_add1_i2d(STACK_OF(X509_EXTENSION) **x; nid: TIdC_INT; value: Pointer; crit: TIdC_INT; TIdC_ULONG flags); + +// void X509V3_EXT_val_prn(out_: PBIO; STACK_OF(CONF_VALUE) *val; indent: TIdC_INT; TIdC_INT ml); + X509V3_EXT_print: function (out_: PBIO; ext: PX509_EXTENSION; flag: TIdC_ULONG; indent: TIdC_INT): TIdC_INT; cdecl = nil; +// TIdC_INT X509V3_extensions_print(out_: PBIO; const PIdAnsiChar *title; const STACK_OF(X509_EXTENSION) *exts; flag: TIdC_ULONG; indent: TIdC_INT); + + X509_check_ca: function (x: PX509): TIdC_INT; cdecl = nil; + X509_check_purpose: function (x: PX509; id: TIdC_INT; ca: TIdC_INT): TIdC_INT; cdecl = nil; + X509_supported_extension: function (ex: PX509_EXTENSION): TIdC_INT; cdecl = nil; + X509_PURPOSE_set: function (p: PIdC_INT; purpose: TIdC_INT): TIdC_INT; cdecl = nil; + X509_check_issued: function (issuer: PX509; subject: PX509): TIdC_INT; cdecl = nil; + X509_check_akid: function (issuer: PX509; akid: PAUTHORITY_KEYID): TIdC_INT; cdecl = nil; + X509_set_proxy_flag: procedure (x: PX509); cdecl = nil; + X509_set_proxy_pathlen: procedure (x: PX509; l: TIdC_LONG); cdecl = nil; + X509_get_proxy_pathlen: function (x: PX509): TIdC_LONG; cdecl = nil; + + X509_get_extension_flags: function (x: PX509): TIdC_UINT32; cdecl = nil; + X509_get_key_usage: function (x: PX509): TIdC_UINT32; cdecl = nil; + X509_get_extended_key_usage: function (x: PX509): TIdC_UINT32; cdecl = nil; + X509_get0_subject_key_id: function (x: PX509): PASN1_OCTET_STRING; cdecl = nil; + X509_get0_authority_key_id: function (x: PX509): PASN1_OCTET_STRING; cdecl = nil; + X509_get0_authority_issuer: function(x : PX509) : PGENERAL_NAMES; cdecl = nil; + X509_get0_authority_serial: function (x: PX509): PASN1_INTEGER; cdecl = nil; + + X509_PURPOSE_get_count: function : TIdC_INT; cdecl = nil; + X509_PURPOSE_get0: function (idx: TIdC_INT): PX509_PURPOSE; cdecl = nil; + X509_PURPOSE_get_by_sname: function (const sname: PIdAnsiChar): TIdC_INT; cdecl = nil; + X509_PURPOSE_get_by_id: function (id: TIdC_INT): TIdC_INT; cdecl = nil; +// TIdC_INT X509_PURPOSE_add(id: TIdC_INT, TIdC_INT trust, flags: TIdC_INT, TIdC_INT (*ck) (const X509_PURPOSE *, const X509 *, TIdC_INT), const name: PIdAnsiChar, const sname: PIdAnsiChar, void *arg); + X509_PURPOSE_get0_name: function (const xp: PX509_PURPOSE): PIdAnsiChar; cdecl = nil; + X509_PURPOSE_get0_sname: function (const xp: PX509_PURPOSE): PIdAnsiChar; cdecl = nil; + X509_PURPOSE_get_trust: function (const xp: PX509_PURPOSE): TIdC_INT; cdecl = nil; + X509_PURPOSE_cleanup: procedure ; cdecl = nil; + X509_PURPOSE_get_id: function (const v1: PX509_PURPOSE): TIdC_INT; cdecl = nil; + + X509_get1_email : function (x: PX509) : PSTACK_OF_OPENSSL_STRING; + X509_REQ_get1_email : function( x : PX509_REQ) : PSTACK_OF_OPENSSL_STRING; + X509_email_free : procedure(sk : PSTACK_OF_OPENSSL_STRING); + X509_get1_ocsp : function(x: PX509) : PSTACK_OF_OPENSSL_STRING; + + X509_check_host: function (x: PX509; const chk: PIdAnsiChar; chklen: TIdC_SIZET; flags: TIdC_UINT; peername: PPIdAnsiChar): TIdC_INT; cdecl = nil; + X509_check_email: function (x: PX509; const chk: PIdAnsiChar; chklen: TIdC_SIZET; flags: TIdC_UINT): TIdC_INT; cdecl = nil; + X509_check_ip: function (x: PX509; const chk: PByte; chklen: TIdC_SIZET; flags: TIdC_UINT): TIdC_INT; cdecl = nil; + X509_check_ip_asc: function (x: PX509; const ipasc: PIdAnsiChar; flags: TIdC_UINT): TIdC_INT; cdecl = nil; + + a2i_IPADDRESS: function (const ipasc: PIdAnsiChar): PASN1_OCTET_STRING; cdecl = nil; + a2i_IPADDRESS_NC: function (const ipasc: PIdAnsiChar): PASN1_OCTET_STRING; cdecl = nil; +// TIdC_INT X509V3_NAME_from_section(X509_NAME *nm; STACK_OF(CONF_VALUE) *dn_sk; TIdC_ULONG chtype); + + X509_POLICY_NODE_print: procedure (out_: PBIO; node: PX509_POLICY_NODE; indent: TIdC_INT); cdecl = nil; +// DEFINE_STACK_OF(X509_POLICY_NODE) + + (* + * Utilities to construct and extract values from RFC3779 extensions, + * since some of the encodings (particularly for IP address prefixes + * and ranges) are a bit tedious to work with directly. + *) + //function X509v3_asid_add_inherit(asid: PASIdentifiers; which: TIdC_INT): TIdC_INT; + //function X509v3_asid_add_id_or_range(asid: PASIdentifiers; which: TIdC_INT; min: PASN1_INTEGER; max: PASN1_INTEGER): TIdC_INT; + //function X509v3_addr_add_inherit(addr: PIPAddrBlocks; const afi: TIdC_UINT; const safi: PIdC_UINT): TIdC_INT; + //function X509v3_addr_add_prefix(addr: PIPAddrBlocks; const afi: TIdC_UINT; const safi: PIdC_UINT; a: PByte; const prefixlen: TIdC_INT): TIdC_INT; + //function X509v3_addr_add_range(addr: PIPAddrBlocks; const afi: TIdC_UINT; const safi: PIdC_UINT; min: PByte; max: PByte): TIdC_INT; + //function X509v3_addr_get_afi(const f: PIPAddressFamily): TIdC_UINT; + X509v3_addr_get_range: function (aor: PIPAddressOrRange; const afi: TIdC_UINT; min: PByte; max: Byte; const length: TIdC_INT): TIdC_INT; cdecl = nil; + + (* + * Canonical forms. + *) + //function X509v3_asid_is_canonical(asid: PASIdentifiers): TIdC_INT; + //function X509v3_addr_is_canonical(addr: PIPAddrBlocks): TIdC_INT; + //function X509v3_asid_canonize(asid: PASIdentifiers): TIdC_INT; + //function X509v3_addr_canonize(addr: PIPAddrBlocks): TIdC_INT; + + (* + * Tests for inheritance and containment. + *) + //function X509v3_asid_inherits(asid: PASIdentifiers): TIdC_INT; + //function X509v3_addr_inherits(addr: PIPAddrBlocks): TIdC_INT; + //function X509v3_asid_subset(a: PASIdentifiers; b: PASIdentifiers): TIdC_INT; + //function X509v3_addr_subset(a: PIPAddrBlocks; b: PIPAddrBlocks): TIdC_INT; + + (* + * Check whether RFC 3779 extensions nest properly in chains. + *) + X509v3_asid_validate_path: function (v1: PX509_STORE_CTX): TIdC_INT; cdecl = nil; + X509v3_addr_validate_path: function (v1: PX509_STORE_CTX): TIdC_INT; cdecl = nil; +// TIdC_INT X509v3_asid_validate_resource_set(STACK_OF(X509) *chain; ASIdentifiers *ext; TIdC_INT allow_inheritance); +// TIdC_INT X509v3_addr_validate_resource_set(STACK_OF(X509) *chain; IPAddrBlocks *ext; TIdC_INT allow_inheritance); + + +// DEFINE_STACK_OF(ASN1_STRING) + + (* + * Admission Syntax + *) + NAMING_AUTHORITY_get0_authorityId: function (const n: PNAMING_AUTHORITY): PASN1_OBJECT; cdecl = nil; + NAMING_AUTHORITY_get0_authorityURL: function (const n: PNAMING_AUTHORITY): PASN1_IA5STRING; cdecl = nil; + NAMING_AUTHORITY_get0_authorityText: function (const n: PNAMING_AUTHORITY): PASN1_STRING; cdecl = nil; + NAMING_AUTHORITY_set0_authorityId: procedure (n: PNAMING_AUTHORITY; namingAuthorityId: PASN1_OBJECT); cdecl = nil; + NAMING_AUTHORITY_set0_authorityURL: procedure (n: PNAMING_AUTHORITY; namingAuthorityUrl: PASN1_IA5STRING); cdecl = nil; + NAMING_AUTHORITY_set0_authorityText: procedure (n: PNAMING_AUTHORITY; namingAuthorityText: PASN1_STRING); cdecl = nil; + + ADMISSION_SYNTAX_get0_admissionAuthority: function (const as_: ADMISSION_SYNTAX): PGENERAL_NAME; cdecl = nil; + ADMISSION_SYNTAX_set0_admissionAuthority: procedure (as_: ADMISSION_SYNTAX; aa: PGENERAL_NAME); cdecl = nil; +// const STACK_OF(ADMISSIONS) *ADMISSION_SYNTAX_get0_contentsOfAdmissions(const as_: ADMISSION_SYNTAX); +// void ADMISSION_SYNTAX_set0_contentsOfAdmissions(as_: ADMISSION_SYNTAX; STACK_OF(ADMISSIONS) *a); + ADMISSIONS_get0_admissionAuthority: function (const a: PADMISSIONS): PGENERAL_NAME; cdecl = nil; + ADMISSIONS_set0_admissionAuthority: procedure (a: PADMISSIONS; aa: PGENERAL_NAME); cdecl = nil; + ADMISSIONS_get0_namingAuthority: function (const a: PADMISSIONS): PNAMING_AUTHORITY; cdecl = nil; + ADMISSIONS_set0_namingAuthority: procedure (a: PADMISSIONS; na: PNAMING_AUTHORITY); cdecl = nil; + //function ADMISSIONS_get0_professionInfos(const a: PADMISSIONS): PPROFESSION_INFOS; + //procedure ADMISSIONS_set0_professionInfos(a: PADMISSIONS; pi: PPROFESSION_INFOS); + PROFESSION_INFO_get0_addProfessionInfo: function (const pi: PPROFESSION_INFO): PASN1_OCTET_STRING; cdecl = nil; + PROFESSION_INFO_set0_addProfessionInfo: procedure (pi: PPROFESSION_INFO; aos: PASN1_OCTET_STRING); cdecl = nil; + PROFESSION_INFO_get0_namingAuthority: function (const pi: PPROFESSION_INFO): PNAMING_AUTHORITY; cdecl = nil; + PROFESSION_INFO_set0_namingAuthority: procedure (pi: PPROFESSION_INFO; na: PNAMING_AUTHORITY); cdecl = nil; +// const STACK_OF(ASN1_STRING) *PROFESSION_INFO_get0_professionItems(const pi: PPROFESSION_INFO); +// void PROFESSION_INFO_set0_professionItems(pi: PPROFESSION_INFO; STACK_OF(ASN1_STRING) *as); +// const STACK_OF(ASN1_OBJECT) *PROFESSION_INFO_get0_professionOIDs(const pi: PPROFESSION_INFO); +// void PROFESSION_INFO_set0_professionOIDs(pi: PPROFESSION_INFO; STACK_OF(ASN1_OBJECT) *po); + PROFESSION_INFO_get0_registrationNumber: function (const pi: PPROFESSION_INFO): PASN1_PRINTABLESTRING; cdecl = nil; + PROFESSION_INFO_set0_registrationNumber: procedure (pi: PPROFESSION_INFO; rn: PASN1_PRINTABLESTRING); cdecl = nil; + + +{$ELSE} + function GENERAL_NAME_cmp(a: PGENERAL_NAME; b: PGENERAL_NAME): TIdC_INT cdecl; external CLibCrypto; + +// ASN1_BIT_STRING *v2i_ASN1_BIT_STRING(method: PX509V3_EXT_METHOD; ctx: PX509V3_CTX; STACK_OF(CONF_VALUE) *nval); +// STACK_OF(CONF_VALUE) *i2v_ASN1_BIT_STRING(method: PX509V3_EXT_METHOD; ASN1_BIT_STRING *bits; STACK_OF(CONF_VALUE) *extlist); + //function i2s_ASN1_IA5STRING(method: PX509V3_EXT_METHOD; ia5: PASN1_IA5STRING): PIdAnsiChar; + //function s2i_ASN1_IA5STRING(method: PX509V3_EXT_METHOD; ctx: PX509V3_CTX; const str: PIdAnsiChar): PASN1_IA5STRING; + +// STACK_OF(CONF_VALUE) *i2v_GENERAL_NAME(method: PX509V3_EXT_METHOD; gen: PGENERAL_NAME; STACK_OF(CONF_VALUE) *ret); + function GENERAL_NAME_print(out_: PBIO; gen: PGENERAL_NAME): TIdC_INT cdecl; external CLibCrypto; + +// DECLARE_ASN1_FUNCTIONS(GENERAL_NAMES) + +// STACK_OF(CONF_VALUE) *i2v_GENERAL_NAMES(method: PX509V3_EXT_METHOD, GENERAL_NAMES *gen, STACK_OF(CONF_VALUE) *extlist); +// GENERAL_NAMES *v2i_GENERAL_NAMES(const method: PX509V3_EXT_METHOD, ctx: PX509V3_CTX, STACK_OF(CONF_VALUE) *nval); + +// DECLARE_ASN1_FUNCTIONS(OTHERNAME) +// DECLARE_ASN1_FUNCTIONS(EDIPARTYNAME) + function OTHERNAME_cmp(a: POTHERNAME; b: POTHERNAME): TIdC_INT cdecl; external CLibCrypto; + procedure GENERAL_NAME_set0_value(a: PGENERAL_NAME; type_: TIdC_INT; value: Pointer) cdecl; external CLibCrypto; + function GENERAL_NAME_get0_value(const a: PGENERAL_NAME; ptype: PIdC_INT): Pointer cdecl; external CLibCrypto; + function GENERAL_NAME_set0_othername(gen: PGENERAL_NAME; oid: PASN1_OBJECT; value: PASN1_TYPE): TIdC_INT cdecl; external CLibCrypto; + function GENERAL_NAME_get0_otherName(const gen: PGENERAL_NAME; poid: PPASN1_OBJECT; pvalue: PPASN1_TYPE): TIdC_INT cdecl; external CLibCrypto; + procedure GENERAL_NAMES_free((a : PGENERAL_NAMES); cdecl; external CLibCrypto; + + //function i2s_ASN1_OCTET_STRING(method: PX509V3_EXT_METHOD; const ia5: PASN1_OCTET_STRING): PIdAnsiChar; + //function s2i_ASN1_OCTET_STRING(method: PX509V3_EXT_METHOD; ctx: PX509V3_CTX; const str: PIdAnsiChar): PASN1_OCTET_STRING; + +// DECLARE_ASN1_FUNCTIONS(EXTENDED_KEY_USAGE) + function i2a_ACCESS_DESCRIPTION(bp: PBIO; const a: PACCESS_DESCRIPTION): TIdC_INT cdecl; external CLibCrypto; + +// DECLARE_ASN1_ALLOC_FUNCTIONS(TLS_FEATURE) + +// DECLARE_ASN1_FUNCTIONS(CERTIFICATEPOLICIES) +// DECLARE_ASN1_FUNCTIONS(POLICYINFO) +// DECLARE_ASN1_FUNCTIONS(POLICYQUALINFO) +// DECLARE_ASN1_FUNCTIONS(USERNOTICE) +// DECLARE_ASN1_FUNCTIONS(NOTICEREF) + +// DECLARE_ASN1_FUNCTIONS(CRL_DIST_POINTS) +// DECLARE_ASN1_FUNCTIONS(DIST_POINT) +// DECLARE_ASN1_FUNCTIONS(DIST_POINT_NAME) +// DECLARE_ASN1_FUNCTIONS(ISSUING_DIST_POINT) + + function DIST_POINT_set_dpname(dpn: PDIST_POINT_NAME; iname: PX509_NAME): TIdC_INT cdecl; external CLibCrypto; + + function NAME_CONSTRAINTS_check(x: PX509; nc: PNAME_CONSTRAINTS): TIdC_INT cdecl; external CLibCrypto; + function NAME_CONSTRAINTS_check_CN(x: PX509; nc: PNAME_CONSTRAINTS): TIdC_INT cdecl; external CLibCrypto; + procedure BASIC_CONSTRAINTS_free(bc : PBASIC_CONSTRAINTS); cdecl; external CLibCrypto; + procedure AUTHORITY_KEYID_free(id : AUTHORITY_KEYID); cdecl; external CLibCrypto; +// DECLARE_ASN1_FUNCTIONS(ACCESS_DESCRIPTION) +// DECLARE_ASN1_FUNCTIONS(AUTHORITY_INFO_ACCESS) + +// DECLARE_ASN1_ITEM(POLICY_MAPPING) +// DECLARE_ASN1_ALLOC_FUNCTIONS(POLICY_MAPPING) +// DECLARE_ASN1_ITEM(POLICY_MAPPINGS) + +// DECLARE_ASN1_ITEM(GENERAL_SUBTREE) +// DECLARE_ASN1_ALLOC_FUNCTIONS(GENERAL_SUBTREE) + +// DECLARE_ASN1_ITEM(NAME_CONSTRAINTS) +// DECLARE_ASN1_ALLOC_FUNCTIONS(NAME_CONSTRAINTS) + +// DECLARE_ASN1_ALLOC_FUNCTIONS(POLICY_CONSTRAINTS) +// DECLARE_ASN1_ITEM(POLICY_CONSTRAINTS) + + //function a2i_GENERAL_NAME(out_: PGENERAL_NAME; const method: PX509V3_EXT_METHOD; ctx: PX509V3_CTX; TIdC_INT gen_type; const value: PIdAnsiChar; is_nc: TIdC_INT): GENERAL_NAME; + + //function v2i_GENERAL_NAME(const method: PX509V3_EXT_METHOD; ctx: PX509V3_CTX; cnf: PCONF_VALUE): PGENERAL_NAME; + //function v2i_GENERAL_NAME_ex(out_: PGENERAL_NAME; const method: PX509V3_EXT_METHOD; ctx: PX509V3_CTX; cnf: PCONF_VALUE; is_nc: TIdC_INT): PGENERAL_NAME; + //procedure X509V3_conf_free(val: PCONF_VALUE); + + function X509V3_EXT_nconf_nid(conf: PCONF; ctx: PX509V3_CTX; ext_nid: TIdC_INT; const value: PIdAnsiChar): PX509_EXTENSION cdecl; external CLibCrypto; + function X509V3_EXT_nconf(conf: PCONF; ctx: PX509V3_CTX; const name: PIdAnsiChar; const value: PIdAnsiChar): PX509_EXTENSION cdecl; external CLibCrypto; +// TIdC_INT X509V3_EXT_add_nconf_sk(conf: PCONF; ctx: PX509V3_CTX; const section: PIdAnsiChar; STACK_OF(X509_EXTENSION) **sk); + function X509V3_EXT_add_nconf(conf: PCONF; ctx: PX509V3_CTX; const section: PIdAnsiChar; cert: PX509): TIdC_INT cdecl; external CLibCrypto; + function X509V3_EXT_REQ_add_nconf(conf: PCONF; ctx: PX509V3_CTX; const section: PIdAnsiChar; req: PX509_REQ): TIdC_INT cdecl; external CLibCrypto; + function X509V3_EXT_CRL_add_nconf(conf: PCONF; ctx: PX509V3_CTX; const section: PIdAnsiChar; crl: PX509_CRL): TIdC_INT cdecl; external CLibCrypto; + + function X509V3_EXT_conf_nid(conf: Pointer; ctx: PX509V3_CTX; ext_nid: TIdC_INT; const value: PIdAnsiChar): PX509_EXTENSION cdecl; external CLibCrypto; +// X509_EXTENSION *X509V3_EXT_conf_nid(LHASH_OF(CONF_VALUE) *conf; ctx: PX509V3_CTX; ext_nid: TIdC_INT; const value: PIdAnsiChar); + function X509V3_EXT_conf(conf: Pointer; ctx: PX509V3_CTX; const name: PIdAnsiChar; const value: PIdAnsiChar): PX509_EXTENSION cdecl; external CLibCrypto; +// X509_EXTENSION *X509V3_EXT_conf(LHASH_OF(CONF_VALUE) *conf; ctx: PX509V3_CTX; const name: PIdAnsiChar; const value: PIdAnsiChar); + function X509V3_EXT_add_conf(conf: Pointer; ctx: PX509V3_CTX; const section: PIdAnsiChar; cert: PX509): TIdC_INT cdecl; external CLibCrypto; +// TIdC_INT X509V3_EXT_add_conf(LHASH_OF(CONF_VALUE) *conf; ctx: PX509V3_CTX; const section: PIdAnsiChar; cert: PX509); + function X509V3_EXT_REQ_add_conf(conf: Pointer; ctx: PX509V3_CTX; const section: PIdAnsiChar; req: PX509_REQ): TIdC_INT cdecl; external CLibCrypto; +// TIdC_INT X509V3_EXT_REQ_add_conf(LHASH_OF(CONF_VALUE) *conf; ctx: PX509V3_CTX; const section: PIdAnsiChar; req: PX509_REQ); + function X509V3_EXT_CRL_add_conf(conf: Pointer; ctx: PX509V3_CTX; const section: PIdAnsiChar; crl: PX509_CRL): TIdC_INT cdecl; external CLibCrypto; +// TIdC_INT X509V3_EXT_CRL_add_conf(LHASH_OF(CONF_VALUE) *conf; ctx: PX509V3_CTX; const section: PIdAnsiChar; crl: PX509_CRL); + +// TIdC_INT X509V3_add_value_bool_nf(const name: PIdAnsiChar; TIdC_INT asn1_bool; STACK_OF(CONF_VALUE) **extlist); + //function X509V3_get_value_bool(const value: PCONF_VALUE; asn1_bool: PIdC_INT): TIdC_INT; + //function X509V3_get_value_int(const value: PCONF_VALUE; aint: PPASN1_INTEGER): TIdC_INT; + procedure X509V3_set_nconf(ctx: PX509V3_CTX; conf: PCONF) cdecl; external CLibCrypto; +// void X509V3_set_conf_lhash(ctx: PX509V3_CTX; LHASH_OF(CONF_VALUE) *lhash); + + function X509V3_get_string(ctx: PX509V3_CTX; const name: PIdAnsiChar; const section: PIdAnsiChar): PIdAnsiChar cdecl; external CLibCrypto; +// STACK_OF(CONF_VALUE) *X509V3_get_section(ctx: PX509V3_CTX; const section: PIdAnsiChar); + procedure X509V3_string_free(ctx: PX509V3_CTX; str: PIdAnsiChar) cdecl; external CLibCrypto; +// void X509V3_section_free(ctx: PX509V3_CTX; STACK_OF(CONF_VALUE) *section); + procedure X509V3_set_ctx(ctx: PX509V3_CTX; issuer: PX509; subject: PX509; req: PX509_REQ; crl: PX509_CRL; flags: TIdC_INT) cdecl; external CLibCrypto; + +// TIdC_INT X509V3_add_value(const name: PIdAnsiChar; const value: PIdAnsiChar; STACK_OF(CONF_VALUE) **extlist); +// TIdC_INT X509V3_add_value_uPIdAnsiChar(const name: PIdAnsiChar; const Byte *value; STACK_OF(CONF_VALUE) **extlist); +// TIdC_INT X509V3_add_value_bool(const name: PIdAnsiChar; TIdC_INT asn1_bool; STACK_OF(CONF_VALUE) **extlist); +// TIdC_INT X509V3_add_value_int(const name: PIdAnsiChar; const aint: PASN1_INTEGER; STACK_OF(CONF_VALUE) **extlist); + //function i2s_ASN1_INTEGER(meth: PX509V3_EXT_METHOD; const aint: PASN1_INTEGER): PIdAnsiChar; + //function s2i_ASN1_INTEGER(meth: PX509V3_EXT_METHOD; const value: PIdAnsiChar): PASN1_INTEGER; + //function i2s_ASN1_ENUMERATED(meth: PX509V3_EXT_METHOD; const aint: PASN1_ENUMERATED): PIdAnsiChar; + //function i2s_ASN1_ENUMERATED_TABLE(meth: PX509V3_EXT_METHOD; const aint: PASN1_ENUMERATED): PIdAnsiChar; + //function X509V3_EXT_add(ext: PX509V3_EXT_METHOD): TIdC_INT; + //function X509V3_EXT_add_list(extlist: PX509V3_EXT_METHOD): TIdC_INT; + function X509V3_EXT_add_alias(nid_to: TIdC_INT; nid_from: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + procedure X509V3_EXT_cleanup cdecl; external CLibCrypto; + + //function X509V3_EXT_get(ext: PX509_EXTENSION): PX509V3_EXT_METHOD; + //function X509V3_EXT_get_nid(nid: TIdC_INT): PX509V3_EXT_METHOD; + function X509V3_add_standard_extensions: TIdC_INT cdecl; external CLibCrypto; +// STACK_OF(CONF_VALUE) *X509V3_parse_list(const line: PIdAnsiChar); + function X509V3_EXT_d2i(ext: PX509_EXTENSION): Pointer cdecl; external CLibCrypto; +// void *X509V3_get_d2i(const STACK_OF(X509_EXTENSION) *x; nid: TIdC_INT; TIdC_INT *crit; TIdC_INT *idx); + + function X509V3_EXT_i2d(ext_nid: TIdC_INT; crit: TIdC_INT; ext_struc: Pointer): PX509_EXTENSION cdecl; external CLibCrypto; +// TIdC_INT X509V3_add1_i2d(STACK_OF(X509_EXTENSION) **x; nid: TIdC_INT; value: Pointer; crit: TIdC_INT; TIdC_ULONG flags); + +// void X509V3_EXT_val_prn(out_: PBIO; STACK_OF(CONF_VALUE) *val; indent: TIdC_INT; TIdC_INT ml); + function X509V3_EXT_print(out_: PBIO; ext: PX509_EXTENSION; flag: TIdC_ULONG; indent: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; +// TIdC_INT X509V3_extensions_print(out_: PBIO; const PIdAnsiChar *title; const STACK_OF(X509_EXTENSION) *exts; flag: TIdC_ULONG; indent: TIdC_INT); + + function X509_check_ca(x: PX509): TIdC_INT cdecl; external CLibCrypto; + function X509_check_purpose(x: PX509; id: TIdC_INT; ca: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function X509_supported_extension(ex: PX509_EXTENSION): TIdC_INT cdecl; external CLibCrypto; + function X509_PURPOSE_set(p: PIdC_INT; purpose: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + function X509_check_issued(issuer: PX509; subject: PX509): TIdC_INT cdecl; external CLibCrypto; + function X509_check_akid(issuer: PX509; akid: PAUTHORITY_KEYID): TIdC_INT cdecl; external CLibCrypto; + procedure X509_set_proxy_flag(x: PX509) cdecl; external CLibCrypto; + procedure X509_set_proxy_pathlen(x: PX509; l: TIdC_LONG) cdecl; external CLibCrypto; + function X509_get_proxy_pathlen(x: PX509): TIdC_LONG cdecl; external CLibCrypto; + + function X509_get_extension_flags(x: PX509): TIdC_UINT32 cdecl; external CLibCrypto; + function X509_get_key_usage(x: PX509): TIdC_UINT32 cdecl; external CLibCrypto; + function X509_get_extended_key_usage(x: PX509): TIdC_UINT32 cdecl; external CLibCrypto; + function X509_get0_subject_key_id(x: PX509): PASN1_OCTET_STRING cdecl; external CLibCrypto; + function X509_get0_authority_key_id(x: PX509): PASN1_OCTET_STRING cdecl; external CLibCrypto; + function X509_get0_authority_issuer(x: PX509): PGENERAL_NAMES; cdecl; external CLibCrypto; + function X509_get0_authority_serial(x: PX509): PASN1_INTEGER cdecl; external CLibCrypto; + + function X509_PURPOSE_get_count: TIdC_INT cdecl; external CLibCrypto; + function X509_PURPOSE_get0(idx: TIdC_INT): PX509_PURPOSE cdecl; external CLibCrypto; + function X509_PURPOSE_get_by_sname(const sname: PIdAnsiChar): TIdC_INT cdecl; external CLibCrypto; + function X509_PURPOSE_get_by_id(id: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; +// TIdC_INT X509_PURPOSE_add(id: TIdC_INT, TIdC_INT trust, flags: TIdC_INT, TIdC_INT (*ck) (const X509_PURPOSE *, const X509 *, TIdC_INT), const name: PIdAnsiChar, const sname: PIdAnsiChar, void *arg); + function X509_PURPOSE_get0_name(const xp: PX509_PURPOSE): PIdAnsiChar cdecl; external CLibCrypto; + function X509_PURPOSE_get0_sname(const xp: PX509_PURPOSE): PIdAnsiChar cdecl; external CLibCrypto; + function X509_PURPOSE_get_trust(const xp: PX509_PURPOSE): TIdC_INT cdecl; external CLibCrypto; + procedure X509_PURPOSE_cleanup cdecl; external CLibCrypto; + function X509_PURPOSE_get_id(const v1: PX509_PURPOSE): TIdC_INT cdecl; external CLibCrypto; + + function X509_get1_email(x: PX509) : PSTACK_OF_OPENSSL_STRING; cdecl; external CLibCrypto; + function X509_REQ_get1_email( x : PX509_REQ) : PSTACK_OF_OPENSSL_STRING; cdecl; external CLibCrypto; + procedure X509_email_free(sk : PSTACK_OF_OPENSSL_STRING); cdecl; external CLibCrypto; + function X509_get1_ocsp(x: PX509) : PSTACK_OF_OPENSSL_STRING; cdecl; external CLibCrypto; + + function X509_check_host(x: PX509; const chk: PIdAnsiChar; chklen: TIdC_SIZET; flags: TIdC_UINT; peername: PPIdAnsiChar): TIdC_INT cdecl; external CLibCrypto; + function X509_check_email(x: PX509; const chk: PIdAnsiChar; chklen: TIdC_SIZET; flags: TIdC_UINT): TIdC_INT cdecl; external CLibCrypto; + function X509_check_ip(x: PX509; const chk: PByte; chklen: TIdC_SIZET; flags: TIdC_UINT): TIdC_INT cdecl; external CLibCrypto; + function X509_check_ip_asc(x: PX509; const ipasc: PIdAnsiChar; flags: TIdC_UINT): TIdC_INT cdecl; external CLibCrypto; + + function a2i_IPADDRESS(const ipasc: PIdAnsiChar): PASN1_OCTET_STRING cdecl; external CLibCrypto; + function a2i_IPADDRESS_NC(const ipasc: PIdAnsiChar): PASN1_OCTET_STRING cdecl; external CLibCrypto; +// TIdC_INT X509V3_NAME_from_section(X509_NAME *nm; STACK_OF(CONF_VALUE) *dn_sk; TIdC_ULONG chtype); + + procedure X509_POLICY_NODE_print(out_: PBIO; node: PX509_POLICY_NODE; indent: TIdC_INT) cdecl; external CLibCrypto; +// DEFINE_STACK_OF(X509_POLICY_NODE) + + (* + * Utilities to construct and extract values from RFC3779 extensions, + * since some of the encodings (particularly for IP address prefixes + * and ranges) are a bit tedious to work with directly. + *) + //function X509v3_asid_add_inherit(asid: PASIdentifiers; which: TIdC_INT): TIdC_INT; + //function X509v3_asid_add_id_or_range(asid: PASIdentifiers; which: TIdC_INT; min: PASN1_INTEGER; max: PASN1_INTEGER): TIdC_INT; + //function X509v3_addr_add_inherit(addr: PIPAddrBlocks; const afi: TIdC_UINT; const safi: PIdC_UINT): TIdC_INT; + //function X509v3_addr_add_prefix(addr: PIPAddrBlocks; const afi: TIdC_UINT; const safi: PIdC_UINT; a: PByte; const prefixlen: TIdC_INT): TIdC_INT; + //function X509v3_addr_add_range(addr: PIPAddrBlocks; const afi: TIdC_UINT; const safi: PIdC_UINT; min: PByte; max: PByte): TIdC_INT; + //function X509v3_addr_get_afi(const f: PIPAddressFamily): TIdC_UINT; + function X509v3_addr_get_range(aor: PIPAddressOrRange; const afi: TIdC_UINT; min: PByte; max: Byte; const length: TIdC_INT): TIdC_INT cdecl; external CLibCrypto; + + (* + * Canonical forms. + *) + //function X509v3_asid_is_canonical(asid: PASIdentifiers): TIdC_INT; + //function X509v3_addr_is_canonical(addr: PIPAddrBlocks): TIdC_INT; + //function X509v3_asid_canonize(asid: PASIdentifiers): TIdC_INT; + //function X509v3_addr_canonize(addr: PIPAddrBlocks): TIdC_INT; + + (* + * Tests for inheritance and containment. + *) + //function X509v3_asid_inherits(asid: PASIdentifiers): TIdC_INT; + //function X509v3_addr_inherits(addr: PIPAddrBlocks): TIdC_INT; + //function X509v3_asid_subset(a: PASIdentifiers; b: PASIdentifiers): TIdC_INT; + //function X509v3_addr_subset(a: PIPAddrBlocks; b: PIPAddrBlocks): TIdC_INT; + + (* + * Check whether RFC 3779 extensions nest properly in chains. + *) + function X509v3_asid_validate_path(v1: PX509_STORE_CTX): TIdC_INT cdecl; external CLibCrypto; + function X509v3_addr_validate_path(v1: PX509_STORE_CTX): TIdC_INT cdecl; external CLibCrypto; +// TIdC_INT X509v3_asid_validate_resource_set(STACK_OF(X509) *chain; ASIdentifiers *ext; TIdC_INT allow_inheritance); +// TIdC_INT X509v3_addr_validate_resource_set(STACK_OF(X509) *chain; IPAddrBlocks *ext; TIdC_INT allow_inheritance); + + +// DEFINE_STACK_OF(ASN1_STRING) + + (* + * Admission Syntax + *) + function NAMING_AUTHORITY_get0_authorityId(const n: PNAMING_AUTHORITY): PASN1_OBJECT cdecl; external CLibCrypto; + function NAMING_AUTHORITY_get0_authorityURL(const n: PNAMING_AUTHORITY): PASN1_IA5STRING cdecl; external CLibCrypto; + function NAMING_AUTHORITY_get0_authorityText(const n: PNAMING_AUTHORITY): PASN1_STRING cdecl; external CLibCrypto; + procedure NAMING_AUTHORITY_set0_authorityId(n: PNAMING_AUTHORITY; namingAuthorityId: PASN1_OBJECT) cdecl; external CLibCrypto; + procedure NAMING_AUTHORITY_set0_authorityURL(n: PNAMING_AUTHORITY; namingAuthorityUrl: PASN1_IA5STRING) cdecl; external CLibCrypto; + procedure NAMING_AUTHORITY_set0_authorityText(n: PNAMING_AUTHORITY; namingAuthorityText: PASN1_STRING) cdecl; external CLibCrypto; + + function ADMISSION_SYNTAX_get0_admissionAuthority(const as_: ADMISSION_SYNTAX): PGENERAL_NAME cdecl; external CLibCrypto; + procedure ADMISSION_SYNTAX_set0_admissionAuthority(as_: ADMISSION_SYNTAX; aa: PGENERAL_NAME) cdecl; external CLibCrypto; +// const STACK_OF(ADMISSIONS) *ADMISSION_SYNTAX_get0_contentsOfAdmissions(const as_: ADMISSION_SYNTAX); +// void ADMISSION_SYNTAX_set0_contentsOfAdmissions(as_: ADMISSION_SYNTAX; STACK_OF(ADMISSIONS) *a); + function ADMISSIONS_get0_admissionAuthority(const a: PADMISSIONS): PGENERAL_NAME cdecl; external CLibCrypto; + procedure ADMISSIONS_set0_admissionAuthority(a: PADMISSIONS; aa: PGENERAL_NAME) cdecl; external CLibCrypto; + function ADMISSIONS_get0_namingAuthority(const a: PADMISSIONS): PNAMING_AUTHORITY cdecl; external CLibCrypto; + procedure ADMISSIONS_set0_namingAuthority(a: PADMISSIONS; na: PNAMING_AUTHORITY) cdecl; external CLibCrypto; + //function ADMISSIONS_get0_professionInfos(const a: PADMISSIONS): PPROFESSION_INFOS; + //procedure ADMISSIONS_set0_professionInfos(a: PADMISSIONS; pi: PPROFESSION_INFOS); + function PROFESSION_INFO_get0_addProfessionInfo(const pi: PPROFESSION_INFO): PASN1_OCTET_STRING cdecl; external CLibCrypto; + procedure PROFESSION_INFO_set0_addProfessionInfo(pi: PPROFESSION_INFO; aos: PASN1_OCTET_STRING) cdecl; external CLibCrypto; + function PROFESSION_INFO_get0_namingAuthority(const pi: PPROFESSION_INFO): PNAMING_AUTHORITY cdecl; external CLibCrypto; + procedure PROFESSION_INFO_set0_namingAuthority(pi: PPROFESSION_INFO; na: PNAMING_AUTHORITY) cdecl; external CLibCrypto; +// const STACK_OF(ASN1_STRING) *PROFESSION_INFO_get0_professionItems(const pi: PPROFESSION_INFO); +// void PROFESSION_INFO_set0_professionItems(pi: PPROFESSION_INFO; STACK_OF(ASN1_STRING) *as); +// const STACK_OF(ASN1_OBJECT) *PROFESSION_INFO_get0_professionOIDs(const pi: PPROFESSION_INFO); +// void PROFESSION_INFO_set0_professionOIDs(pi: PPROFESSION_INFO; STACK_OF(ASN1_OBJECT) *po); + function PROFESSION_INFO_get0_registrationNumber(const pi: PPROFESSION_INFO): PASN1_PRINTABLESTRING cdecl; external CLibCrypto; + procedure PROFESSION_INFO_set0_registrationNumber(pi: PPROFESSION_INFO; rn: PASN1_PRINTABLESTRING) cdecl; external CLibCrypto; + + +{$ENDIF} +type + Tsk_GENERAL_NAME_new = function(cmp : Tsk_new_cmp) : PSTACK_OF_GENERAL_NAME cdecl; + Tsk_GENERAL_NAME_new_null = function : PSTACK_OF_GENERAL_NAME cdecl; + Tsk_GENERAL_NAME_free = procedure(st : PSTACK_OF_GENERAL_NAME) cdecl; + Tsk_GENERAL_NAME_num = function (const sk : PSTACK_OF_GENERAL_NAME) : TIdC_INT cdecl; + Tsk_GENERAL_NAME_value = function (const sk : PSTACK_OF_GENERAL_NAME; i : TIdC_INT) : PGENERAL_NAME cdecl; + Tsk_GENERAL_NAME_push = function (sk : PSTACK_OF_GENERAL_NAME; st : PGENERAL_NAME) : TIdC_INT cdecl; + Tsk_GENERAL_NAME_dup = function (sk : PSTACK_OF_GENERAL_NAME) : PSTACK_OF_GENERAL_NAME cdecl; + Tsk_GENERAL_NAME_find = function (sk : PSTACK_OF_GENERAL_NAME; val : PGENERAL_NAME) : TIdC_INT cdecl; + Tsk_GENERAL_NAME_pop_free = procedure (sk : PSTACK_OF_GENERAL_NAME; func: Tsk_pop_free_func) cdecl; + +var + sk_GENERAL_NAME_new : Tsk_GENERAL_NAME_new absolute sk_new; + sk_GENERAL_NAME_new_null : Tsk_GENERAL_NAME_new_null absolute sk_new_null; + sk_GENERAL_NAME_free : Tsk_GENERAL_NAME_free absolute sk_free; + sk_GENERAL_NAME_num : Tsk_GENERAL_NAME_num absolute sk_num; + sk_GENERAL_NAME_value : Tsk_GENERAL_NAME_value absolute sk_value; + sk_GENERAL_NAME_push : Tsk_GENERAL_NAME_push absolute sk_push; + sk_GENERAL_NAME_dup : Tsk_GENERAL_NAME_dup absolute sk_dup; + sk_GENERAL_NAME_find : Tsk_GENERAL_NAME_find absolute sk_find; + sk_GENERAL_NAME_pop_free : Tsk_GENERAL_NAME_pop_free absolute sk_pop_free; + +implementation + + uses + classes, + IdSSLOpenSSLExceptionHandlers, + IdResourceStringsOpenSSL + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + ,IdSSLOpenSSLLoader + {$ENDIF}; + + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +const + GENERAL_NAME_cmp_procname = 'GENERAL_NAME_cmp'; + +// ASN1_BIT_STRING *v2i_ASN1_BIT_STRING(method: PX509V3_EXT_METHOD; ctx: PX509V3_CTX; STACK_OF(CONF_VALUE) *nval); +// STACK_OF(CONF_VALUE) *i2v_ASN1_BIT_STRING(method: PX509V3_EXT_METHOD; ASN1_BIT_STRING *bits; STACK_OF(CONF_VALUE) *extlist); + //function i2s_ASN1_IA5STRING(method: PX509V3_EXT_METHOD; ia5: PASN1_IA5STRING): PIdAnsiChar; + //function s2i_ASN1_IA5STRING(method: PX509V3_EXT_METHOD; ctx: PX509V3_CTX; const str: PIdAnsiChar): PASN1_IA5STRING; + +// STACK_OF(CONF_VALUE) *i2v_GENERAL_NAME(method: PX509V3_EXT_METHOD; gen: PGENERAL_NAME; STACK_OF(CONF_VALUE) *ret); + GENERAL_NAME_print_procname = 'GENERAL_NAME_print'; + +// DECLARE_ASN1_FUNCTIONS(GENERAL_NAMES) + +// STACK_OF(CONF_VALUE) *i2v_GENERAL_NAMES(method: PX509V3_EXT_METHOD, GENERAL_NAMES *gen, STACK_OF(CONF_VALUE) *extlist); +// GENERAL_NAMES *v2i_GENERAL_NAMES(const method: PX509V3_EXT_METHOD, ctx: PX509V3_CTX, STACK_OF(CONF_VALUE) *nval); + +// DECLARE_ASN1_FUNCTIONS(OTHERNAME) +// DECLARE_ASN1_FUNCTIONS(EDIPARTYNAME) + OTHERNAME_cmp_procname = 'OTHERNAME_cmp'; + GENERAL_NAME_set0_value_procname = 'GENERAL_NAME_set0_value'; + GENERAL_NAME_get0_value_procname = 'GENERAL_NAME_get0_value'; + GENERAL_NAME_set0_othername_procname = 'GENERAL_NAME_set0_othername'; + GENERAL_NAME_get0_otherName_procname = 'GENERAL_NAME_get0_otherName'; + GENERAL_NAMES_free_procname = 'GENERAL_NAMES_free'; + + //function i2s_ASN1_OCTET_STRING(method: PX509V3_EXT_METHOD; const ia5: PASN1_OCTET_STRING): PIdAnsiChar; + //function s2i_ASN1_OCTET_STRING(method: PX509V3_EXT_METHOD; ctx: PX509V3_CTX; const str: PIdAnsiChar): PASN1_OCTET_STRING; + +// DECLARE_ASN1_FUNCTIONS(EXTENDED_KEY_USAGE) + i2a_ACCESS_DESCRIPTION_procname = 'i2a_ACCESS_DESCRIPTION'; + +// DECLARE_ASN1_ALLOC_FUNCTIONS(TLS_FEATURE) + +// DECLARE_ASN1_FUNCTIONS(CERTIFICATEPOLICIES) +// DECLARE_ASN1_FUNCTIONS(POLICYINFO) +// DECLARE_ASN1_FUNCTIONS(POLICYQUALINFO) +// DECLARE_ASN1_FUNCTIONS(USERNOTICE) +// DECLARE_ASN1_FUNCTIONS(NOTICEREF) + +// DECLARE_ASN1_FUNCTIONS(CRL_DIST_POINTS) +// DECLARE_ASN1_FUNCTIONS(DIST_POINT) +// DECLARE_ASN1_FUNCTIONS(DIST_POINT_NAME) +// DECLARE_ASN1_FUNCTIONS(ISSUING_DIST_POINT) + + DIST_POINT_set_dpname_procname = 'DIST_POINT_set_dpname'; + + NAME_CONSTRAINTS_check_procname = 'NAME_CONSTRAINTS_check'; + NAME_CONSTRAINTS_check_CN_procname = 'NAME_CONSTRAINTS_check_CN'; + + BASIC_CONSTRAINTS_free_procname = 'BASIC_CONSTRAINTS_free'; + AUTHORITY_KEYID_free_procname = 'AUTHORITY_KEYID_free'; + +// DECLARE_ASN1_FUNCTIONS(ACCESS_DESCRIPTION) +// DECLARE_ASN1_FUNCTIONS(AUTHORITY_INFO_ACCESS) + +// DECLARE_ASN1_ITEM(POLICY_MAPPING) +// DECLARE_ASN1_ALLOC_FUNCTIONS(POLICY_MAPPING) +// DECLARE_ASN1_ITEM(POLICY_MAPPINGS) + +// DECLARE_ASN1_ITEM(GENERAL_SUBTREE) +// DECLARE_ASN1_ALLOC_FUNCTIONS(GENERAL_SUBTREE) + +// DECLARE_ASN1_ITEM(NAME_CONSTRAINTS) +// DECLARE_ASN1_ALLOC_FUNCTIONS(NAME_CONSTRAINTS) + +// DECLARE_ASN1_ALLOC_FUNCTIONS(POLICY_CONSTRAINTS) +// DECLARE_ASN1_ITEM(POLICY_CONSTRAINTS) + + //function a2i_GENERAL_NAME(out_: PGENERAL_NAME; const method: PX509V3_EXT_METHOD; ctx: PX509V3_CTX; TIdC_INT gen_type; const value: PIdAnsiChar; is_nc: TIdC_INT): GENERAL_NAME; + + //function v2i_GENERAL_NAME(const method: PX509V3_EXT_METHOD; ctx: PX509V3_CTX; cnf: PCONF_VALUE): PGENERAL_NAME; + //function v2i_GENERAL_NAME_ex(out_: PGENERAL_NAME; const method: PX509V3_EXT_METHOD; ctx: PX509V3_CTX; cnf: PCONF_VALUE; is_nc: TIdC_INT): PGENERAL_NAME; + //procedure X509V3_conf_free(val: PCONF_VALUE); + + X509V3_EXT_nconf_nid_procname = 'X509V3_EXT_nconf_nid'; + X509V3_EXT_nconf_procname = 'X509V3_EXT_nconf'; +// TIdC_INT X509V3_EXT_add_nconf_sk(conf: PCONF; ctx: PX509V3_CTX; const section: PIdAnsiChar; STACK_OF(X509_EXTENSION) **sk); + X509V3_EXT_add_nconf_procname = 'X509V3_EXT_add_nconf'; + X509V3_EXT_REQ_add_nconf_procname = 'X509V3_EXT_REQ_add_nconf'; + X509V3_EXT_CRL_add_nconf_procname = 'X509V3_EXT_CRL_add_nconf'; + + X509V3_EXT_conf_nid_procname = 'X509V3_EXT_conf_nid'; +// X509_EXTENSION *X509V3_EXT_conf_nid(LHASH_OF(CONF_VALUE) *conf; ctx: PX509V3_CTX; ext_nid: TIdC_INT; const value: PIdAnsiChar); + X509V3_EXT_conf_procname = 'X509V3_EXT_conf'; +// X509_EXTENSION *X509V3_EXT_conf(LHASH_OF(CONF_VALUE) *conf; ctx: PX509V3_CTX; const name: PIdAnsiChar; const value: PIdAnsiChar); + X509V3_EXT_add_conf_procname = 'X509V3_EXT_add_conf'; +// TIdC_INT X509V3_EXT_add_conf(LHASH_OF(CONF_VALUE) *conf; ctx: PX509V3_CTX; const section: PIdAnsiChar; cert: PX509); + X509V3_EXT_REQ_add_conf_procname = 'X509V3_EXT_REQ_add_conf'; +// TIdC_INT X509V3_EXT_REQ_add_conf(LHASH_OF(CONF_VALUE) *conf; ctx: PX509V3_CTX; const section: PIdAnsiChar; req: PX509_REQ); + X509V3_EXT_CRL_add_conf_procname = 'X509V3_EXT_CRL_add_conf'; +// TIdC_INT X509V3_EXT_CRL_add_conf(LHASH_OF(CONF_VALUE) *conf; ctx: PX509V3_CTX; const section: PIdAnsiChar; crl: PX509_CRL); + +// TIdC_INT X509V3_add_value_bool_nf(const name: PIdAnsiChar; TIdC_INT asn1_bool; STACK_OF(CONF_VALUE) **extlist); + //function X509V3_get_value_bool(const value: PCONF_VALUE; asn1_bool: PIdC_INT): TIdC_INT; + //function X509V3_get_value_int(const value: PCONF_VALUE; aint: PPASN1_INTEGER): TIdC_INT; + X509V3_set_nconf_procname = 'X509V3_set_nconf'; +// void X509V3_set_conf_lhash(ctx: PX509V3_CTX; LHASH_OF(CONF_VALUE) *lhash); + + X509V3_get_string_procname = 'X509V3_get_string'; +// STACK_OF(CONF_VALUE) *X509V3_get_section(ctx: PX509V3_CTX; const section: PIdAnsiChar); + X509V3_string_free_procname = 'X509V3_string_free'; +// void X509V3_section_free(ctx: PX509V3_CTX; STACK_OF(CONF_VALUE) *section); + X509V3_set_ctx_procname = 'X509V3_set_ctx'; + +// TIdC_INT X509V3_add_value(const name: PIdAnsiChar; const value: PIdAnsiChar; STACK_OF(CONF_VALUE) **extlist); +// TIdC_INT X509V3_add_value_uPIdAnsiChar(const name: PIdAnsiChar; const Byte *value; STACK_OF(CONF_VALUE) **extlist); +// TIdC_INT X509V3_add_value_bool(const name: PIdAnsiChar; TIdC_INT asn1_bool; STACK_OF(CONF_VALUE) **extlist); +// TIdC_INT X509V3_add_value_int(const name: PIdAnsiChar; const aint: PASN1_INTEGER; STACK_OF(CONF_VALUE) **extlist); + //function i2s_ASN1_INTEGER(meth: PX509V3_EXT_METHOD; const aint: PASN1_INTEGER): PIdAnsiChar; + //function s2i_ASN1_INTEGER(meth: PX509V3_EXT_METHOD; const value: PIdAnsiChar): PASN1_INTEGER; + //function i2s_ASN1_ENUMERATED(meth: PX509V3_EXT_METHOD; const aint: PASN1_ENUMERATED): PIdAnsiChar; + //function i2s_ASN1_ENUMERATED_TABLE(meth: PX509V3_EXT_METHOD; const aint: PASN1_ENUMERATED): PIdAnsiChar; + //function X509V3_EXT_add(ext: PX509V3_EXT_METHOD): TIdC_INT; + //function X509V3_EXT_add_list(extlist: PX509V3_EXT_METHOD): TIdC_INT; + X509V3_EXT_add_alias_procname = 'X509V3_EXT_add_alias'; + X509V3_EXT_cleanup_procname = 'X509V3_EXT_cleanup'; + + //function X509V3_EXT_get(ext: PX509_EXTENSION): PX509V3_EXT_METHOD; + //function X509V3_EXT_get_nid(nid: TIdC_INT): PX509V3_EXT_METHOD; + X509V3_add_standard_extensions_procname = 'X509V3_add_standard_extensions'; +// STACK_OF(CONF_VALUE) *X509V3_parse_list(const line: PIdAnsiChar); + X509V3_EXT_d2i_procname = 'X509V3_EXT_d2i'; +// void *X509V3_get_d2i(const STACK_OF(X509_EXTENSION) *x; nid: TIdC_INT; TIdC_INT *crit; TIdC_INT *idx); + + X509V3_EXT_i2d_procname = 'X509V3_EXT_i2d'; +// TIdC_INT X509V3_add1_i2d(STACK_OF(X509_EXTENSION) **x; nid: TIdC_INT; value: Pointer; crit: TIdC_INT; TIdC_ULONG flags); + +// void X509V3_EXT_val_prn(out_: PBIO; STACK_OF(CONF_VALUE) *val; indent: TIdC_INT; TIdC_INT ml); + X509V3_EXT_print_procname = 'X509V3_EXT_print'; +// TIdC_INT X509V3_extensions_print(out_: PBIO; const PIdAnsiChar *title; const STACK_OF(X509_EXTENSION) *exts; flag: TIdC_ULONG; indent: TIdC_INT); + + X509_check_ca_procname = 'X509_check_ca'; + X509_check_purpose_procname = 'X509_check_purpose'; + X509_supported_extension_procname = 'X509_supported_extension'; + X509_PURPOSE_set_procname = 'X509_PURPOSE_set'; + X509_check_issued_procname = 'X509_check_issued'; + X509_check_akid_procname = 'X509_check_akid'; + X509_set_proxy_flag_procname = 'X509_set_proxy_flag'; + X509_set_proxy_pathlen_procname = 'X509_set_proxy_pathlen'; + X509_get_proxy_pathlen_procname = 'X509_get_proxy_pathlen'; + + X509_get_extension_flags_procname = 'X509_get_extension_flags'; + X509_get_key_usage_procname = 'X509_get_key_usage'; + X509_get_extended_key_usage_procname = 'X509_get_extended_key_usage'; + X509_get0_subject_key_id_procname = 'X509_get0_subject_key_id'; + X509_get0_authority_key_id_procname = 'X509_get0_authority_key_id'; + X509_get0_authority_issuer_procname = 'X509_get0_authority_issuer'; + X509_get0_authority_serial_procname = 'X509_get0_authority_serial'; + + X509_PURPOSE_get_count_procname = 'X509_PURPOSE_get_count'; + X509_PURPOSE_get0_procname = 'X509_PURPOSE_get0'; + X509_PURPOSE_get_by_sname_procname = 'X509_PURPOSE_get_by_sname'; + X509_PURPOSE_get_by_id_procname = 'X509_PURPOSE_get_by_id'; +// TIdC_INT X509_PURPOSE_add(id: TIdC_INT, TIdC_INT trust, flags: TIdC_INT, TIdC_INT (*ck) (const X509_PURPOSE *, const X509 *, TIdC_INT), const name: PIdAnsiChar, const sname: PIdAnsiChar, void *arg); + X509_PURPOSE_get0_name_procname = 'X509_PURPOSE_get0_name'; + X509_PURPOSE_get0_sname_procname = 'X509_PURPOSE_get0_sname'; + X509_PURPOSE_get_trust_procname = 'X509_PURPOSE_get_trust'; + X509_PURPOSE_cleanup_procname = 'X509_PURPOSE_cleanup'; + X509_PURPOSE_get_id_procname = 'X509_PURPOSE_get_id'; + + X509_get1_email_procname = 'X509_get1_email'; + X509_REQ_get1_email_procname = 'X509_REQ_get1_email'; + X509_email_free_procname = 'X509_email_free'; + X509_get1_ocsp_procname = 'X509_get1_ocsp'; + + X509_check_host_procname = 'X509_check_host'; + X509_check_email_procname = 'X509_check_email'; + X509_check_ip_procname = 'X509_check_ip'; + X509_check_ip_asc_procname = 'X509_check_ip_asc'; + + a2i_IPADDRESS_procname = 'a2i_IPADDRESS'; + a2i_IPADDRESS_NC_procname = 'a2i_IPADDRESS_NC'; +// TIdC_INT X509V3_NAME_from_section(X509_NAME *nm; STACK_OF(CONF_VALUE) *dn_sk; TIdC_ULONG chtype); + + X509_POLICY_NODE_print_procname = 'X509_POLICY_NODE_print'; +// DEFINE_STACK_OF(X509_POLICY_NODE) + + (* + * Utilities to construct and extract values from RFC3779 extensions, + * since some of the encodings (particularly for IP address prefixes + * and ranges) are a bit tedious to work with directly. + *) + //function X509v3_asid_add_inherit(asid: PASIdentifiers; which: TIdC_INT): TIdC_INT; + //function X509v3_asid_add_id_or_range(asid: PASIdentifiers; which: TIdC_INT; min: PASN1_INTEGER; max: PASN1_INTEGER): TIdC_INT; + //function X509v3_addr_add_inherit(addr: PIPAddrBlocks; const afi: TIdC_UINT; const safi: PIdC_UINT): TIdC_INT; + //function X509v3_addr_add_prefix(addr: PIPAddrBlocks; const afi: TIdC_UINT; const safi: PIdC_UINT; a: PByte; const prefixlen: TIdC_INT): TIdC_INT; + //function X509v3_addr_add_range(addr: PIPAddrBlocks; const afi: TIdC_UINT; const safi: PIdC_UINT; min: PByte; max: PByte): TIdC_INT; + //function X509v3_addr_get_afi(const f: PIPAddressFamily): TIdC_UINT; + X509v3_addr_get_range_procname = 'X509v3_addr_get_range'; + + (* + * Canonical forms. + *) + //function X509v3_asid_is_canonical(asid: PASIdentifiers): TIdC_INT; + //function X509v3_addr_is_canonical(addr: PIPAddrBlocks): TIdC_INT; + //function X509v3_asid_canonize(asid: PASIdentifiers): TIdC_INT; + //function X509v3_addr_canonize(addr: PIPAddrBlocks): TIdC_INT; + + (* + * Tests for inheritance and containment. + *) + //function X509v3_asid_inherits(asid: PASIdentifiers): TIdC_INT; + //function X509v3_addr_inherits(addr: PIPAddrBlocks): TIdC_INT; + //function X509v3_asid_subset(a: PASIdentifiers; b: PASIdentifiers): TIdC_INT; + //function X509v3_addr_subset(a: PIPAddrBlocks; b: PIPAddrBlocks): TIdC_INT; + + (* + * Check whether RFC 3779 extensions nest properly in chains. + *) + X509v3_asid_validate_path_procname = 'X509v3_asid_validate_path'; + X509v3_addr_validate_path_procname = 'X509v3_addr_validate_path'; +// TIdC_INT X509v3_asid_validate_resource_set(STACK_OF(X509) *chain; ASIdentifiers *ext; TIdC_INT allow_inheritance); +// TIdC_INT X509v3_addr_validate_resource_set(STACK_OF(X509) *chain; IPAddrBlocks *ext; TIdC_INT allow_inheritance); + + +// DEFINE_STACK_OF(ASN1_STRING) + + (* + * Admission Syntax + *) + NAMING_AUTHORITY_get0_authorityId_procname = 'NAMING_AUTHORITY_get0_authorityId'; + NAMING_AUTHORITY_get0_authorityURL_procname = 'NAMING_AUTHORITY_get0_authorityURL'; + NAMING_AUTHORITY_get0_authorityText_procname = 'NAMING_AUTHORITY_get0_authorityText'; + NAMING_AUTHORITY_set0_authorityId_procname = 'NAMING_AUTHORITY_set0_authorityId'; + NAMING_AUTHORITY_set0_authorityURL_procname = 'NAMING_AUTHORITY_set0_authorityURL'; + NAMING_AUTHORITY_set0_authorityText_procname = 'NAMING_AUTHORITY_set0_authorityText'; + + ADMISSION_SYNTAX_get0_admissionAuthority_procname = 'ADMISSION_SYNTAX_get0_admissionAuthority'; + ADMISSION_SYNTAX_set0_admissionAuthority_procname = 'ADMISSION_SYNTAX_set0_admissionAuthority'; +// const STACK_OF(ADMISSIONS) *ADMISSION_SYNTAX_get0_contentsOfAdmissions(const as_: ADMISSION_SYNTAX); +// void ADMISSION_SYNTAX_set0_contentsOfAdmissions(as_: ADMISSION_SYNTAX; STACK_OF(ADMISSIONS) *a); + ADMISSIONS_get0_admissionAuthority_procname = 'ADMISSIONS_get0_admissionAuthority'; + ADMISSIONS_set0_admissionAuthority_procname = 'ADMISSIONS_set0_admissionAuthority'; + ADMISSIONS_get0_namingAuthority_procname = 'ADMISSIONS_get0_namingAuthority'; + ADMISSIONS_set0_namingAuthority_procname = 'ADMISSIONS_set0_namingAuthority'; + //function ADMISSIONS_get0_professionInfos(const a: PADMISSIONS): PPROFESSION_INFOS; + //procedure ADMISSIONS_set0_professionInfos(a: PADMISSIONS; pi: PPROFESSION_INFOS); + PROFESSION_INFO_get0_addProfessionInfo_procname = 'PROFESSION_INFO_get0_addProfessionInfo'; + PROFESSION_INFO_set0_addProfessionInfo_procname = 'PROFESSION_INFO_set0_addProfessionInfo'; + PROFESSION_INFO_get0_namingAuthority_procname = 'PROFESSION_INFO_get0_namingAuthority'; + PROFESSION_INFO_set0_namingAuthority_procname = 'PROFESSION_INFO_set0_namingAuthority'; +// const STACK_OF(ASN1_STRING) *PROFESSION_INFO_get0_professionItems(const pi: PPROFESSION_INFO); +// void PROFESSION_INFO_set0_professionItems(pi: PPROFESSION_INFO; STACK_OF(ASN1_STRING) *as); +// const STACK_OF(ASN1_OBJECT) *PROFESSION_INFO_get0_professionOIDs(const pi: PPROFESSION_INFO); +// void PROFESSION_INFO_set0_professionOIDs(pi: PPROFESSION_INFO; STACK_OF(ASN1_OBJECT) *po); + PROFESSION_INFO_get0_registrationNumber_procname = 'PROFESSION_INFO_get0_registrationNumber'; + PROFESSION_INFO_set0_registrationNumber_procname = 'PROFESSION_INFO_set0_registrationNumber'; + + + +{$WARN NO_RETVAL OFF} +function ERR_GENERAL_NAME_cmp(a: PGENERAL_NAME; b: PGENERAL_NAME): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(GENERAL_NAME_cmp_procname); +end; + + + +// ASN1_BIT_STRING *v2i_ASN1_BIT_STRING(method: PX509V3_EXT_METHOD; ctx: PX509V3_CTX; STACK_OF(CONF_VALUE) *nval); +// STACK_OF(CONF_VALUE) *i2v_ASN1_BIT_STRING(method: PX509V3_EXT_METHOD; ASN1_BIT_STRING *bits; STACK_OF(CONF_VALUE) *extlist); + //function i2s_ASN1_IA5STRING(method: PX509V3_EXT_METHOD; ia5: PASN1_IA5STRING): PIdAnsiChar; + //function s2i_ASN1_IA5STRING(method: PX509V3_EXT_METHOD; ctx: PX509V3_CTX; const str: PIdAnsiChar): PASN1_IA5STRING; + +// STACK_OF(CONF_VALUE) *i2v_GENERAL_NAME(method: PX509V3_EXT_METHOD; gen: PGENERAL_NAME; STACK_OF(CONF_VALUE) *ret); +function ERR_GENERAL_NAME_print(out_: PBIO; gen: PGENERAL_NAME): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(GENERAL_NAME_print_procname); +end; + + + +// DECLARE_ASN1_FUNCTIONS(GENERAL_NAMES) + +// STACK_OF(CONF_VALUE) *i2v_GENERAL_NAMES(method: PX509V3_EXT_METHOD, GENERAL_NAMES *gen, STACK_OF(CONF_VALUE) *extlist); +// GENERAL_NAMES *v2i_GENERAL_NAMES(const method: PX509V3_EXT_METHOD, ctx: PX509V3_CTX, STACK_OF(CONF_VALUE) *nval); + +// DECLARE_ASN1_FUNCTIONS(OTHERNAME) +// DECLARE_ASN1_FUNCTIONS(EDIPARTYNAME) +function ERR_OTHERNAME_cmp(a: POTHERNAME; b: POTHERNAME): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(OTHERNAME_cmp_procname); +end; + + +procedure ERR_GENERAL_NAME_set0_value(a: PGENERAL_NAME; type_: TIdC_INT; value: Pointer); +begin + EIdAPIFunctionNotPresent.RaiseException(GENERAL_NAME_set0_value_procname); +end; + + +function ERR_GENERAL_NAME_get0_value(const a: PGENERAL_NAME; ptype: PIdC_INT): Pointer; +begin + EIdAPIFunctionNotPresent.RaiseException(GENERAL_NAME_get0_value_procname); +end; + + +function ERR_GENERAL_NAME_set0_othername(gen: PGENERAL_NAME; oid: PASN1_OBJECT; value: PASN1_TYPE): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(GENERAL_NAME_set0_othername_procname); +end; + + +function ERR_GENERAL_NAME_get0_otherName(const gen: PGENERAL_NAME; poid: PPASN1_OBJECT; pvalue: PPASN1_TYPE): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(GENERAL_NAME_get0_otherName_procname); +end; + +procedure ERR_GENERAL_NAMES_free(a : PGENERAL_NAMES); +begin + EIdAPIFunctionNotPresent.RaiseException(GENERAL_NAMES_free_procname); +end; + + //function i2s_ASN1_OCTET_STRING(method: PX509V3_EXT_METHOD; const ia5: PASN1_OCTET_STRING): PIdAnsiChar; + //function s2i_ASN1_OCTET_STRING(method: PX509V3_EXT_METHOD; ctx: PX509V3_CTX; const str: PIdAnsiChar): PASN1_OCTET_STRING; + +// DECLARE_ASN1_FUNCTIONS(EXTENDED_KEY_USAGE) +function ERR_i2a_ACCESS_DESCRIPTION(bp: PBIO; const a: PACCESS_DESCRIPTION): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(i2a_ACCESS_DESCRIPTION_procname); +end; + + + +// DECLARE_ASN1_ALLOC_FUNCTIONS(TLS_FEATURE) + +// DECLARE_ASN1_FUNCTIONS(CERTIFICATEPOLICIES) +// DECLARE_ASN1_FUNCTIONS(POLICYINFO) +// DECLARE_ASN1_FUNCTIONS(POLICYQUALINFO) +// DECLARE_ASN1_FUNCTIONS(USERNOTICE) +// DECLARE_ASN1_FUNCTIONS(NOTICEREF) + +// DECLARE_ASN1_FUNCTIONS(CRL_DIST_POINTS) +// DECLARE_ASN1_FUNCTIONS(DIST_POINT) +// DECLARE_ASN1_FUNCTIONS(DIST_POINT_NAME) +// DECLARE_ASN1_FUNCTIONS(ISSUING_DIST_POINT) + +function ERR_DIST_POINT_set_dpname(dpn: PDIST_POINT_NAME; iname: PX509_NAME): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(DIST_POINT_set_dpname_procname); +end; + + + +function ERR_NAME_CONSTRAINTS_check(x: PX509; nc: PNAME_CONSTRAINTS): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(NAME_CONSTRAINTS_check_procname); +end; + + +function ERR_NAME_CONSTRAINTS_check_CN(x: PX509; nc: PNAME_CONSTRAINTS): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(NAME_CONSTRAINTS_check_CN_procname); +end; + + +procedure ERR_BASIC_CONSTRAINTS_free(bc : PBASIC_CONSTRAINTS); +begin + EIdAPIFunctionNotPresent.RaiseException(BASIC_CONSTRAINTS_free_procname); +end; + +procedure ERR_AUTHORITY_KEYID_free(id : PAUTHORITY_KEYID); +begin + EIdAPIFunctionNotPresent.RaiseException(AUTHORITY_KEYID_free_procname); +end; + +// DECLARE_ASN1_FUNCTIONS(ACCESS_DESCRIPTION) +// DECLARE_ASN1_FUNCTIONS(AUTHORITY_INFO_ACCESS) + +// DECLARE_ASN1_ITEM(POLICY_MAPPING) +// DECLARE_ASN1_ALLOC_FUNCTIONS(POLICY_MAPPING) +// DECLARE_ASN1_ITEM(POLICY_MAPPINGS) + +// DECLARE_ASN1_ITEM(GENERAL_SUBTREE) +// DECLARE_ASN1_ALLOC_FUNCTIONS(GENERAL_SUBTREE) + +// DECLARE_ASN1_ITEM(NAME_CONSTRAINTS) +// DECLARE_ASN1_ALLOC_FUNCTIONS(NAME_CONSTRAINTS) + +// DECLARE_ASN1_ALLOC_FUNCTIONS(POLICY_CONSTRAINTS) +// DECLARE_ASN1_ITEM(POLICY_CONSTRAINTS) + + //function a2i_GENERAL_NAME(out_: PGENERAL_NAME; const method: PX509V3_EXT_METHOD; ctx: PX509V3_CTX; TIdC_INT gen_type; const value: PIdAnsiChar; is_nc: TIdC_INT): GENERAL_NAME; + + //function v2i_GENERAL_NAME(const method: PX509V3_EXT_METHOD; ctx: PX509V3_CTX; cnf: PCONF_VALUE): PGENERAL_NAME; + //function v2i_GENERAL_NAME_ex(out_: PGENERAL_NAME; const method: PX509V3_EXT_METHOD; ctx: PX509V3_CTX; cnf: PCONF_VALUE; is_nc: TIdC_INT): PGENERAL_NAME; + //procedure X509V3_conf_free(val: PCONF_VALUE); + +function ERR_X509V3_EXT_nconf_nid(conf: PCONF; ctx: PX509V3_CTX; ext_nid: TIdC_INT; const value: PIdAnsiChar): PX509_EXTENSION; +begin + EIdAPIFunctionNotPresent.RaiseException(X509V3_EXT_nconf_nid_procname); +end; + + +function ERR_X509V3_EXT_nconf(conf: PCONF; ctx: PX509V3_CTX; const name: PIdAnsiChar; const value: PIdAnsiChar): PX509_EXTENSION; +begin + EIdAPIFunctionNotPresent.RaiseException(X509V3_EXT_nconf_procname); +end; + + +// TIdC_INT X509V3_EXT_add_nconf_sk(conf: PCONF; ctx: PX509V3_CTX; const section: PIdAnsiChar; STACK_OF(X509_EXTENSION) **sk); +function ERR_X509V3_EXT_add_nconf(conf: PCONF; ctx: PX509V3_CTX; const section: PIdAnsiChar; cert: PX509): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509V3_EXT_add_nconf_procname); +end; + + +function ERR_X509V3_EXT_REQ_add_nconf(conf: PCONF; ctx: PX509V3_CTX; const section: PIdAnsiChar; req: PX509_REQ): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509V3_EXT_REQ_add_nconf_procname); +end; + + +function ERR_X509V3_EXT_CRL_add_nconf(conf: PCONF; ctx: PX509V3_CTX; const section: PIdAnsiChar; crl: PX509_CRL): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509V3_EXT_CRL_add_nconf_procname); +end; + + + +function ERR_X509V3_EXT_conf_nid(conf: Pointer; ctx: PX509V3_CTX; ext_nid: TIdC_INT; const value: PIdAnsiChar): PX509_EXTENSION; +begin + EIdAPIFunctionNotPresent.RaiseException(X509V3_EXT_conf_nid_procname); +end; + + +// X509_EXTENSION *X509V3_EXT_conf_nid(LHASH_OF(CONF_VALUE) *conf; ctx: PX509V3_CTX; ext_nid: TIdC_INT; const value: PIdAnsiChar); +function ERR_X509V3_EXT_conf(conf: Pointer; ctx: PX509V3_CTX; const name: PIdAnsiChar; const value: PIdAnsiChar): PX509_EXTENSION; +begin + EIdAPIFunctionNotPresent.RaiseException(X509V3_EXT_conf_procname); +end; + + +// X509_EXTENSION *X509V3_EXT_conf(LHASH_OF(CONF_VALUE) *conf; ctx: PX509V3_CTX; const name: PIdAnsiChar; const value: PIdAnsiChar); +function ERR_X509V3_EXT_add_conf(conf: Pointer; ctx: PX509V3_CTX; const section: PIdAnsiChar; cert: PX509): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509V3_EXT_add_conf_procname); +end; + + +// TIdC_INT X509V3_EXT_add_conf(LHASH_OF(CONF_VALUE) *conf; ctx: PX509V3_CTX; const section: PIdAnsiChar; cert: PX509); +function ERR_X509V3_EXT_REQ_add_conf(conf: Pointer; ctx: PX509V3_CTX; const section: PIdAnsiChar; req: PX509_REQ): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509V3_EXT_REQ_add_conf_procname); +end; + + +// TIdC_INT X509V3_EXT_REQ_add_conf(LHASH_OF(CONF_VALUE) *conf; ctx: PX509V3_CTX; const section: PIdAnsiChar; req: PX509_REQ); +function ERR_X509V3_EXT_CRL_add_conf(conf: Pointer; ctx: PX509V3_CTX; const section: PIdAnsiChar; crl: PX509_CRL): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509V3_EXT_CRL_add_conf_procname); +end; + + +// TIdC_INT X509V3_EXT_CRL_add_conf(LHASH_OF(CONF_VALUE) *conf; ctx: PX509V3_CTX; const section: PIdAnsiChar; crl: PX509_CRL); + +// TIdC_INT X509V3_add_value_bool_nf(const name: PIdAnsiChar; TIdC_INT asn1_bool; STACK_OF(CONF_VALUE) **extlist); + //function X509V3_get_value_bool(const value: PCONF_VALUE; asn1_bool: PIdC_INT): TIdC_INT; + //function X509V3_get_value_int(const value: PCONF_VALUE; aint: PPASN1_INTEGER): TIdC_INT; +procedure ERR_X509V3_set_nconf(ctx: PX509V3_CTX; conf: PCONF); +begin + EIdAPIFunctionNotPresent.RaiseException(X509V3_set_nconf_procname); +end; + + +// void X509V3_set_conf_lhash(ctx: PX509V3_CTX; LHASH_OF(CONF_VALUE) *lhash); + +function ERR_X509V3_get_string(ctx: PX509V3_CTX; const name: PIdAnsiChar; const section: PIdAnsiChar): PIdAnsiChar; +begin + EIdAPIFunctionNotPresent.RaiseException(X509V3_get_string_procname); +end; + + +// STACK_OF(CONF_VALUE) *X509V3_get_section(ctx: PX509V3_CTX; const section: PIdAnsiChar); +procedure ERR_X509V3_string_free(ctx: PX509V3_CTX; str: PIdAnsiChar); +begin + EIdAPIFunctionNotPresent.RaiseException(X509V3_string_free_procname); +end; + + +// void X509V3_section_free(ctx: PX509V3_CTX; STACK_OF(CONF_VALUE) *section); +procedure ERR_X509V3_set_ctx(ctx: PX509V3_CTX; issuer: PX509; subject: PX509; req: PX509_REQ; crl: PX509_CRL; flags: TIdC_INT); +begin + EIdAPIFunctionNotPresent.RaiseException(X509V3_set_ctx_procname); +end; + + + +// TIdC_INT X509V3_add_value(const name: PIdAnsiChar; const value: PIdAnsiChar; STACK_OF(CONF_VALUE) **extlist); +// TIdC_INT X509V3_add_value_uPIdAnsiChar(const name: PIdAnsiChar; const Byte *value; STACK_OF(CONF_VALUE) **extlist); +// TIdC_INT X509V3_add_value_bool(const name: PIdAnsiChar; TIdC_INT asn1_bool; STACK_OF(CONF_VALUE) **extlist); +// TIdC_INT X509V3_add_value_int(const name: PIdAnsiChar; const aint: PASN1_INTEGER; STACK_OF(CONF_VALUE) **extlist); + //function i2s_ASN1_INTEGER(meth: PX509V3_EXT_METHOD; const aint: PASN1_INTEGER): PIdAnsiChar; + //function s2i_ASN1_INTEGER(meth: PX509V3_EXT_METHOD; const value: PIdAnsiChar): PASN1_INTEGER; + //function i2s_ASN1_ENUMERATED(meth: PX509V3_EXT_METHOD; const aint: PASN1_ENUMERATED): PIdAnsiChar; + //function i2s_ASN1_ENUMERATED_TABLE(meth: PX509V3_EXT_METHOD; const aint: PASN1_ENUMERATED): PIdAnsiChar; + //function X509V3_EXT_add(ext: PX509V3_EXT_METHOD): TIdC_INT; + //function X509V3_EXT_add_list(extlist: PX509V3_EXT_METHOD): TIdC_INT; +function ERR_X509V3_EXT_add_alias(nid_to: TIdC_INT; nid_from: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509V3_EXT_add_alias_procname); +end; + + +procedure ERR_X509V3_EXT_cleanup; +begin + EIdAPIFunctionNotPresent.RaiseException(X509V3_EXT_cleanup_procname); +end; + + + + //function X509V3_EXT_get(ext: PX509_EXTENSION): PX509V3_EXT_METHOD; + //function X509V3_EXT_get_nid(nid: TIdC_INT): PX509V3_EXT_METHOD; +function ERR_X509V3_add_standard_extensions: TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509V3_add_standard_extensions_procname); +end; + + +// STACK_OF(CONF_VALUE) *X509V3_parse_list(const line: PIdAnsiChar); +function ERR_X509V3_EXT_d2i(ext: PX509_EXTENSION): Pointer; +begin + EIdAPIFunctionNotPresent.RaiseException(X509V3_EXT_d2i_procname); +end; + + +// void *X509V3_get_d2i(const STACK_OF(X509_EXTENSION) *x; nid: TIdC_INT; TIdC_INT *crit; TIdC_INT *idx); + +function ERR_X509V3_EXT_i2d(ext_nid: TIdC_INT; crit: TIdC_INT; ext_struc: Pointer): PX509_EXTENSION; +begin + EIdAPIFunctionNotPresent.RaiseException(X509V3_EXT_i2d_procname); +end; + + +// TIdC_INT X509V3_add1_i2d(STACK_OF(X509_EXTENSION) **x; nid: TIdC_INT; value: Pointer; crit: TIdC_INT; TIdC_ULONG flags); + +// void X509V3_EXT_val_prn(out_: PBIO; STACK_OF(CONF_VALUE) *val; indent: TIdC_INT; TIdC_INT ml); +function ERR_X509V3_EXT_print(out_: PBIO; ext: PX509_EXTENSION; flag: TIdC_ULONG; indent: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509V3_EXT_print_procname); +end; + + +// TIdC_INT X509V3_extensions_print(out_: PBIO; const PIdAnsiChar *title; const STACK_OF(X509_EXTENSION) *exts; flag: TIdC_ULONG; indent: TIdC_INT); + +function ERR_X509_check_ca(x: PX509): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_check_ca_procname); +end; + + +function ERR_X509_check_purpose(x: PX509; id: TIdC_INT; ca: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_check_purpose_procname); +end; + + +function ERR_X509_supported_extension(ex: PX509_EXTENSION): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_supported_extension_procname); +end; + + +function ERR_X509_PURPOSE_set(p: PIdC_INT; purpose: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_PURPOSE_set_procname); +end; + + +function ERR_X509_check_issued(issuer: PX509; subject: PX509): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_check_issued_procname); +end; + + +function ERR_X509_check_akid(issuer: PX509; akid: PAUTHORITY_KEYID): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_check_akid_procname); +end; + + +procedure ERR_X509_set_proxy_flag(x: PX509); +begin + EIdAPIFunctionNotPresent.RaiseException(X509_set_proxy_flag_procname); +end; + + +procedure ERR_X509_set_proxy_pathlen(x: PX509; l: TIdC_LONG); +begin + EIdAPIFunctionNotPresent.RaiseException(X509_set_proxy_pathlen_procname); +end; + + +function ERR_X509_get_proxy_pathlen(x: PX509): TIdC_LONG; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_get_proxy_pathlen_procname); +end; + + + +function ERR_X509_get_extension_flags(x: PX509): TIdC_UINT32; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_get_extension_flags_procname); +end; + + +function ERR_X509_get_key_usage(x: PX509): TIdC_UINT32; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_get_key_usage_procname); +end; + + +function ERR_X509_get_extended_key_usage(x: PX509): TIdC_UINT32; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_get_extended_key_usage_procname); +end; + + +function ERR_X509_get0_subject_key_id(x: PX509): PASN1_OCTET_STRING; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_get0_subject_key_id_procname); +end; + + +function ERR_X509_get0_authority_key_id(x: PX509): PASN1_OCTET_STRING; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_get0_authority_key_id_procname); +end; + + +function ERR_X509_get0_authority_issuer(x: PX509): PGENERAL_NAMES; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_get0_authority_issuer_procname); +end; + +function ERR_X509_get0_authority_serial(x: PX509): PASN1_INTEGER; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_get0_authority_serial_procname); +end; + + + +function ERR_X509_PURPOSE_get_count: TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_PURPOSE_get_count_procname); +end; + + +function ERR_X509_PURPOSE_get0(idx: TIdC_INT): PX509_PURPOSE; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_PURPOSE_get0_procname); +end; + + +function ERR_X509_PURPOSE_get_by_sname(const sname: PIdAnsiChar): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_PURPOSE_get_by_sname_procname); +end; + + +function ERR_X509_PURPOSE_get_by_id(id: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_PURPOSE_get_by_id_procname); +end; + + +// TIdC_INT X509_PURPOSE_add(id: TIdC_INT, TIdC_INT trust, flags: TIdC_INT, TIdC_INT (*ck) (const X509_PURPOSE *, const X509 *, TIdC_INT), const name: PIdAnsiChar, const sname: PIdAnsiChar, void *arg); +function ERR_X509_PURPOSE_get0_name(const xp: PX509_PURPOSE): PIdAnsiChar; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_PURPOSE_get0_name_procname); +end; + + +function ERR_X509_PURPOSE_get0_sname(const xp: PX509_PURPOSE): PIdAnsiChar; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_PURPOSE_get0_sname_procname); +end; + + +function ERR_X509_PURPOSE_get_trust(const xp: PX509_PURPOSE): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_PURPOSE_get_trust_procname); +end; + + +procedure ERR_X509_PURPOSE_cleanup; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_PURPOSE_cleanup_procname); +end; + + +function ERR_X509_PURPOSE_get_id(const v1: PX509_PURPOSE): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_PURPOSE_get_id_procname); +end; + +function ERR_X509_get1_email(x: PX509) : PSTACK_OF_OPENSSL_STRING; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_get1_email_procname); +end; + +function ERR_X509_REQ_get1_email( x : PX509_REQ) : PSTACK_OF_OPENSSL_STRING; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_REQ_get1_email_procname); +end; + +procedure ERR_X509_email_free(sk : PSTACK_OF_OPENSSL_STRING); +begin + EIdAPIFunctionNotPresent.RaiseException(X509_email_free_procname); +end; + +function ERR_X509_get1_ocsp(x: PX509) : PSTACK_OF_OPENSSL_STRING; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_get1_ocsp_procname); +end; + +function ERR_X509_check_host(x: PX509; const chk: PIdAnsiChar; chklen: TIdC_SIZET; flags: TIdC_UINT; peername: PPIdAnsiChar): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_check_host_procname); +end; + + +function ERR_X509_check_email(x: PX509; const chk: PIdAnsiChar; chklen: TIdC_SIZET; flags: TIdC_UINT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_check_email_procname); +end; + + +function ERR_X509_check_ip(x: PX509; const chk: PByte; chklen: TIdC_SIZET; flags: TIdC_UINT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_check_ip_procname); +end; + + +function ERR_X509_check_ip_asc(x: PX509; const ipasc: PIdAnsiChar; flags: TIdC_UINT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509_check_ip_asc_procname); +end; + + + +function ERR_a2i_IPADDRESS(const ipasc: PIdAnsiChar): PASN1_OCTET_STRING; +begin + EIdAPIFunctionNotPresent.RaiseException(a2i_IPADDRESS_procname); +end; + + +function ERR_a2i_IPADDRESS_NC(const ipasc: PIdAnsiChar): PASN1_OCTET_STRING; +begin + EIdAPIFunctionNotPresent.RaiseException(a2i_IPADDRESS_NC_procname); +end; + + +// TIdC_INT X509V3_NAME_from_section(X509_NAME *nm; STACK_OF(CONF_VALUE) *dn_sk; TIdC_ULONG chtype); + +procedure ERR_X509_POLICY_NODE_print(out_: PBIO; node: PX509_POLICY_NODE; indent: TIdC_INT); +begin + EIdAPIFunctionNotPresent.RaiseException(X509_POLICY_NODE_print_procname); +end; + + +// DEFINE_STACK_OF(X509_POLICY_NODE) + + (* + * Utilities to construct and extract values from RFC3779 extensions, + * since some of the encodings (particularly for IP address prefixes + * and ranges) are a bit tedious to work with directly. + *) + //function X509v3_asid_add_inherit(asid: PASIdentifiers; which: TIdC_INT): TIdC_INT; + //function X509v3_asid_add_id_or_range(asid: PASIdentifiers; which: TIdC_INT; min: PASN1_INTEGER; max: PASN1_INTEGER): TIdC_INT; + //function X509v3_addr_add_inherit(addr: PIPAddrBlocks; const afi: TIdC_UINT; const safi: PIdC_UINT): TIdC_INT; + //function X509v3_addr_add_prefix(addr: PIPAddrBlocks; const afi: TIdC_UINT; const safi: PIdC_UINT; a: PByte; const prefixlen: TIdC_INT): TIdC_INT; + //function X509v3_addr_add_range(addr: PIPAddrBlocks; const afi: TIdC_UINT; const safi: PIdC_UINT; min: PByte; max: PByte): TIdC_INT; + //function X509v3_addr_get_afi(const f: PIPAddressFamily): TIdC_UINT; +function ERR_X509v3_addr_get_range(aor: PIPAddressOrRange; const afi: TIdC_UINT; min: PByte; max: Byte; const length: TIdC_INT): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509v3_addr_get_range_procname); +end; + + + + (* + * Canonical forms. + *) + //function X509v3_asid_is_canonical(asid: PASIdentifiers): TIdC_INT; + //function X509v3_addr_is_canonical(addr: PIPAddrBlocks): TIdC_INT; + //function X509v3_asid_canonize(asid: PASIdentifiers): TIdC_INT; + //function X509v3_addr_canonize(addr: PIPAddrBlocks): TIdC_INT; + + (* + * Tests for inheritance and containment. + *) + //function X509v3_asid_inherits(asid: PASIdentifiers): TIdC_INT; + //function X509v3_addr_inherits(addr: PIPAddrBlocks): TIdC_INT; + //function X509v3_asid_subset(a: PASIdentifiers; b: PASIdentifiers): TIdC_INT; + //function X509v3_addr_subset(a: PIPAddrBlocks; b: PIPAddrBlocks): TIdC_INT; + + (* + * Check whether RFC 3779 extensions nest properly in chains. + *) +function ERR_X509v3_asid_validate_path(v1: PX509_STORE_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509v3_asid_validate_path_procname); +end; + + +function ERR_X509v3_addr_validate_path(v1: PX509_STORE_CTX): TIdC_INT; +begin + EIdAPIFunctionNotPresent.RaiseException(X509v3_addr_validate_path_procname); +end; + + +// TIdC_INT X509v3_asid_validate_resource_set(STACK_OF(X509) *chain; ASIdentifiers *ext; TIdC_INT allow_inheritance); +// TIdC_INT X509v3_addr_validate_resource_set(STACK_OF(X509) *chain; IPAddrBlocks *ext; TIdC_INT allow_inheritance); + + +// DEFINE_STACK_OF(ASN1_STRING) + + (* + * Admission Syntax + *) +function ERR_NAMING_AUTHORITY_get0_authorityId(const n: PNAMING_AUTHORITY): PASN1_OBJECT; +begin + EIdAPIFunctionNotPresent.RaiseException(NAMING_AUTHORITY_get0_authorityId_procname); +end; + + +function ERR_NAMING_AUTHORITY_get0_authorityURL(const n: PNAMING_AUTHORITY): PASN1_IA5STRING; +begin + EIdAPIFunctionNotPresent.RaiseException(NAMING_AUTHORITY_get0_authorityURL_procname); +end; + + +function ERR_NAMING_AUTHORITY_get0_authorityText(const n: PNAMING_AUTHORITY): PASN1_STRING; +begin + EIdAPIFunctionNotPresent.RaiseException(NAMING_AUTHORITY_get0_authorityText_procname); +end; + + +procedure ERR_NAMING_AUTHORITY_set0_authorityId(n: PNAMING_AUTHORITY; namingAuthorityId: PASN1_OBJECT); +begin + EIdAPIFunctionNotPresent.RaiseException(NAMING_AUTHORITY_set0_authorityId_procname); +end; + + +procedure ERR_NAMING_AUTHORITY_set0_authorityURL(n: PNAMING_AUTHORITY; namingAuthorityUrl: PASN1_IA5STRING); +begin + EIdAPIFunctionNotPresent.RaiseException(NAMING_AUTHORITY_set0_authorityURL_procname); +end; + + +procedure ERR_NAMING_AUTHORITY_set0_authorityText(n: PNAMING_AUTHORITY; namingAuthorityText: PASN1_STRING); +begin + EIdAPIFunctionNotPresent.RaiseException(NAMING_AUTHORITY_set0_authorityText_procname); +end; + + + +function ERR_ADMISSION_SYNTAX_get0_admissionAuthority(const as_: ADMISSION_SYNTAX): PGENERAL_NAME; +begin + EIdAPIFunctionNotPresent.RaiseException(ADMISSION_SYNTAX_get0_admissionAuthority_procname); +end; + + +procedure ERR_ADMISSION_SYNTAX_set0_admissionAuthority(as_: ADMISSION_SYNTAX; aa: PGENERAL_NAME); +begin + EIdAPIFunctionNotPresent.RaiseException(ADMISSION_SYNTAX_set0_admissionAuthority_procname); +end; + + +// const STACK_OF(ADMISSIONS) *ADMISSION_SYNTAX_get0_contentsOfAdmissions(const as_: ADMISSION_SYNTAX); +// void ADMISSION_SYNTAX_set0_contentsOfAdmissions(as_: ADMISSION_SYNTAX; STACK_OF(ADMISSIONS) *a); +function ERR_ADMISSIONS_get0_admissionAuthority(const a: PADMISSIONS): PGENERAL_NAME; +begin + EIdAPIFunctionNotPresent.RaiseException(ADMISSIONS_get0_admissionAuthority_procname); +end; + + +procedure ERR_ADMISSIONS_set0_admissionAuthority(a: PADMISSIONS; aa: PGENERAL_NAME); +begin + EIdAPIFunctionNotPresent.RaiseException(ADMISSIONS_set0_admissionAuthority_procname); +end; + + +function ERR_ADMISSIONS_get0_namingAuthority(const a: PADMISSIONS): PNAMING_AUTHORITY; +begin + EIdAPIFunctionNotPresent.RaiseException(ADMISSIONS_get0_namingAuthority_procname); +end; + + +procedure ERR_ADMISSIONS_set0_namingAuthority(a: PADMISSIONS; na: PNAMING_AUTHORITY); +begin + EIdAPIFunctionNotPresent.RaiseException(ADMISSIONS_set0_namingAuthority_procname); +end; + + + //function ADMISSIONS_get0_professionInfos(const a: PADMISSIONS): PPROFESSION_INFOS; + //procedure ADMISSIONS_set0_professionInfos(a: PADMISSIONS; pi: PPROFESSION_INFOS); +function ERR_PROFESSION_INFO_get0_addProfessionInfo(const pi: PPROFESSION_INFO): PASN1_OCTET_STRING; +begin + EIdAPIFunctionNotPresent.RaiseException(PROFESSION_INFO_get0_addProfessionInfo_procname); +end; + + +procedure ERR_PROFESSION_INFO_set0_addProfessionInfo(pi: PPROFESSION_INFO; aos: PASN1_OCTET_STRING); +begin + EIdAPIFunctionNotPresent.RaiseException(PROFESSION_INFO_set0_addProfessionInfo_procname); +end; + + +function ERR_PROFESSION_INFO_get0_namingAuthority(const pi: PPROFESSION_INFO): PNAMING_AUTHORITY; +begin + EIdAPIFunctionNotPresent.RaiseException(PROFESSION_INFO_get0_namingAuthority_procname); +end; + + +procedure ERR_PROFESSION_INFO_set0_namingAuthority(pi: PPROFESSION_INFO; na: PNAMING_AUTHORITY); +begin + EIdAPIFunctionNotPresent.RaiseException(PROFESSION_INFO_set0_namingAuthority_procname); +end; + + +// const STACK_OF(ASN1_STRING) *PROFESSION_INFO_get0_professionItems(const pi: PPROFESSION_INFO); +// void PROFESSION_INFO_set0_professionItems(pi: PPROFESSION_INFO; STACK_OF(ASN1_STRING) *as); +// const STACK_OF(ASN1_OBJECT) *PROFESSION_INFO_get0_professionOIDs(const pi: PPROFESSION_INFO); +// void PROFESSION_INFO_set0_professionOIDs(pi: PPROFESSION_INFO; STACK_OF(ASN1_OBJECT) *po); +function ERR_PROFESSION_INFO_get0_registrationNumber(const pi: PPROFESSION_INFO): PASN1_PRINTABLESTRING; +begin + EIdAPIFunctionNotPresent.RaiseException(PROFESSION_INFO_get0_registrationNumber_procname); +end; + + +procedure ERR_PROFESSION_INFO_set0_registrationNumber(pi: PPROFESSION_INFO; rn: PASN1_PRINTABLESTRING); +begin + EIdAPIFunctionNotPresent.RaiseException(PROFESSION_INFO_set0_registrationNumber_procname); +end; + + + + +{$WARN NO_RETVAL ON} + +procedure Load(const ADllHandle: TIdLibHandle; LibVersion: TIdC_UINT; const AFailed: TStringList); + +var FuncLoadError: boolean; + +begin + GENERAL_NAME_cmp := LoadLibFunction(ADllHandle, GENERAL_NAME_cmp_procname); + FuncLoadError := not assigned(GENERAL_NAME_cmp); + if FuncLoadError then + begin + {$if not defined(GENERAL_NAME_cmp_allownil)} + GENERAL_NAME_cmp := @ERR_GENERAL_NAME_cmp; + {$ifend} + {$if declared(GENERAL_NAME_cmp_introduced)} + if LibVersion < GENERAL_NAME_cmp_introduced then + begin + {$if declared(FC_GENERAL_NAME_cmp)} + GENERAL_NAME_cmp := @FC_GENERAL_NAME_cmp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(GENERAL_NAME_cmp_removed)} + if GENERAL_NAME_cmp_removed <= LibVersion then + begin + {$if declared(_GENERAL_NAME_cmp)} + GENERAL_NAME_cmp := @_GENERAL_NAME_cmp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(GENERAL_NAME_cmp_allownil)} + if FuncLoadError then + AFailed.Add('GENERAL_NAME_cmp'); + {$ifend} + end; + + + GENERAL_NAME_print := LoadLibFunction(ADllHandle, GENERAL_NAME_print_procname); + FuncLoadError := not assigned(GENERAL_NAME_print); + if FuncLoadError then + begin + {$if not defined(GENERAL_NAME_print_allownil)} + GENERAL_NAME_print := @ERR_GENERAL_NAME_print; + {$ifend} + {$if declared(GENERAL_NAME_print_introduced)} + if LibVersion < GENERAL_NAME_print_introduced then + begin + {$if declared(FC_GENERAL_NAME_print)} + GENERAL_NAME_print := @FC_GENERAL_NAME_print; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(GENERAL_NAME_print_removed)} + if GENERAL_NAME_print_removed <= LibVersion then + begin + {$if declared(_GENERAL_NAME_print)} + GENERAL_NAME_print := @_GENERAL_NAME_print; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(GENERAL_NAME_print_allownil)} + if FuncLoadError then + AFailed.Add('GENERAL_NAME_print'); + {$ifend} + end; + + + OTHERNAME_cmp := LoadLibFunction(ADllHandle, OTHERNAME_cmp_procname); + FuncLoadError := not assigned(OTHERNAME_cmp); + if FuncLoadError then + begin + {$if not defined(OTHERNAME_cmp_allownil)} + OTHERNAME_cmp := @ERR_OTHERNAME_cmp; + {$ifend} + {$if declared(OTHERNAME_cmp_introduced)} + if LibVersion < OTHERNAME_cmp_introduced then + begin + {$if declared(FC_OTHERNAME_cmp)} + OTHERNAME_cmp := @FC_OTHERNAME_cmp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(OTHERNAME_cmp_removed)} + if OTHERNAME_cmp_removed <= LibVersion then + begin + {$if declared(_OTHERNAME_cmp)} + OTHERNAME_cmp := @_OTHERNAME_cmp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(OTHERNAME_cmp_allownil)} + if FuncLoadError then + AFailed.Add('OTHERNAME_cmp'); + {$ifend} + end; + + + GENERAL_NAME_set0_value := LoadLibFunction(ADllHandle, GENERAL_NAME_set0_value_procname); + FuncLoadError := not assigned(GENERAL_NAME_set0_value); + if FuncLoadError then + begin + {$if not defined(GENERAL_NAME_set0_value_allownil)} + GENERAL_NAME_set0_value := @ERR_GENERAL_NAME_set0_value; + {$ifend} + {$if declared(GENERAL_NAME_set0_value_introduced)} + if LibVersion < GENERAL_NAME_set0_value_introduced then + begin + {$if declared(FC_GENERAL_NAME_set0_value)} + GENERAL_NAME_set0_value := @FC_GENERAL_NAME_set0_value; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(GENERAL_NAME_set0_value_removed)} + if GENERAL_NAME_set0_value_removed <= LibVersion then + begin + {$if declared(_GENERAL_NAME_set0_value)} + GENERAL_NAME_set0_value := @_GENERAL_NAME_set0_value; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(GENERAL_NAME_set0_value_allownil)} + if FuncLoadError then + AFailed.Add('GENERAL_NAME_set0_value'); + {$ifend} + end; + + + GENERAL_NAME_get0_value := LoadLibFunction(ADllHandle, GENERAL_NAME_get0_value_procname); + FuncLoadError := not assigned(GENERAL_NAME_get0_value); + if FuncLoadError then + begin + {$if not defined(GENERAL_NAME_get0_value_allownil)} + GENERAL_NAME_get0_value := @ERR_GENERAL_NAME_get0_value; + {$ifend} + {$if declared(GENERAL_NAME_get0_value_introduced)} + if LibVersion < GENERAL_NAME_get0_value_introduced then + begin + {$if declared(FC_GENERAL_NAME_get0_value)} + GENERAL_NAME_get0_value := @FC_GENERAL_NAME_get0_value; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(GENERAL_NAME_get0_value_removed)} + if GENERAL_NAME_get0_value_removed <= LibVersion then + begin + {$if declared(_GENERAL_NAME_get0_value)} + GENERAL_NAME_get0_value := @_GENERAL_NAME_get0_value; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(GENERAL_NAME_get0_value_allownil)} + if FuncLoadError then + AFailed.Add('GENERAL_NAME_get0_value'); + {$ifend} + end; + + + GENERAL_NAME_set0_othername := LoadLibFunction(ADllHandle, GENERAL_NAME_set0_othername_procname); + FuncLoadError := not assigned(GENERAL_NAME_set0_othername); + if FuncLoadError then + begin + {$if not defined(GENERAL_NAME_set0_othername_allownil)} + GENERAL_NAME_set0_othername := @ERR_GENERAL_NAME_set0_othername; + {$ifend} + {$if declared(GENERAL_NAME_set0_othername_introduced)} + if LibVersion < GENERAL_NAME_set0_othername_introduced then + begin + {$if declared(FC_GENERAL_NAME_set0_othername)} + GENERAL_NAME_set0_othername := @FC_GENERAL_NAME_set0_othername; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(GENERAL_NAME_set0_othername_removed)} + if GENERAL_NAME_set0_othername_removed <= LibVersion then + begin + {$if declared(_GENERAL_NAME_set0_othername)} + GENERAL_NAME_set0_othername := @_GENERAL_NAME_set0_othername; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(GENERAL_NAME_set0_othername_allownil)} + if FuncLoadError then + AFailed.Add('GENERAL_NAME_set0_othername'); + {$ifend} + end; + + + GENERAL_NAME_get0_otherName := LoadLibFunction(ADllHandle, GENERAL_NAME_get0_otherName_procname); + FuncLoadError := not assigned(GENERAL_NAME_get0_otherName); + if FuncLoadError then + begin + {$if not defined(GENERAL_NAME_get0_otherName_allownil)} + GENERAL_NAME_get0_otherName := @ERR_GENERAL_NAME_get0_otherName; + {$ifend} + {$if declared(GENERAL_NAME_get0_otherName_introduced)} + if LibVersion < GENERAL_NAME_get0_otherName_introduced then + begin + {$if declared(FC_GENERAL_NAME_get0_otherName)} + GENERAL_NAME_get0_otherName := @FC_GENERAL_NAME_get0_otherName; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(GENERAL_NAME_get0_otherName_removed)} + if GENERAL_NAME_get0_otherName_removed <= LibVersion then + begin + {$if declared(_GENERAL_NAME_get0_otherName)} + GENERAL_NAME_get0_otherName := @_GENERAL_NAME_get0_otherName; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(GENERAL_NAME_get0_otherName_allownil)} + if FuncLoadError then + AFailed.Add('GENERAL_NAME_get0_otherName'); + {$ifend} + end; + + + GENERAL_NAMES_free := LoadLibFunction(ADllHandle, GENERAL_NAMES_free_procname); + FuncLoadError := not assigned(GENERAL_NAME_get0_otherName); + if FuncLoadError then + begin + {$if not defined(GENERAL_NAMES_free_allownil)} + GENERAL_NAMES_free := @ERR_GENERAL_NAMES_free; + {$ifend} + {$if declared(GENERAL_NAMES_free_introduced)} + if LibVersion < GENERAL_NAMES_free_introduced then + begin + {$if declared(FC_GENERAL_NAMES_free)} + GENERAL_NAMES_free := @FC_GENERAL_NAMES_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(GENERAL_NAMES_free_removed)} + if GENERAL_NAMES_free_removed <= LibVersion then + begin + {$if declared(_GENERAL_NAMES_free)} + GENERAL_NAMES_free := @_GENERAL_NAMES_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(GENERAL_NAMES_free_allownil)} + if FuncLoadError then + AFailed.Add('GENERAL_NAMES_free'); + {$ifend} + end; + + + i2a_ACCESS_DESCRIPTION := LoadLibFunction(ADllHandle, i2a_ACCESS_DESCRIPTION_procname); + FuncLoadError := not assigned(i2a_ACCESS_DESCRIPTION); + if FuncLoadError then + begin + {$if not defined(i2a_ACCESS_DESCRIPTION_allownil)} + i2a_ACCESS_DESCRIPTION := @ERR_i2a_ACCESS_DESCRIPTION; + {$ifend} + {$if declared(i2a_ACCESS_DESCRIPTION_introduced)} + if LibVersion < i2a_ACCESS_DESCRIPTION_introduced then + begin + {$if declared(FC_i2a_ACCESS_DESCRIPTION)} + i2a_ACCESS_DESCRIPTION := @FC_i2a_ACCESS_DESCRIPTION; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(i2a_ACCESS_DESCRIPTION_removed)} + if i2a_ACCESS_DESCRIPTION_removed <= LibVersion then + begin + {$if declared(_i2a_ACCESS_DESCRIPTION)} + i2a_ACCESS_DESCRIPTION := @_i2a_ACCESS_DESCRIPTION; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(i2a_ACCESS_DESCRIPTION_allownil)} + if FuncLoadError then + AFailed.Add('i2a_ACCESS_DESCRIPTION'); + {$ifend} + end; + + + DIST_POINT_set_dpname := LoadLibFunction(ADllHandle, DIST_POINT_set_dpname_procname); + FuncLoadError := not assigned(DIST_POINT_set_dpname); + if FuncLoadError then + begin + {$if not defined(DIST_POINT_set_dpname_allownil)} + DIST_POINT_set_dpname := @ERR_DIST_POINT_set_dpname; + {$ifend} + {$if declared(DIST_POINT_set_dpname_introduced)} + if LibVersion < DIST_POINT_set_dpname_introduced then + begin + {$if declared(FC_DIST_POINT_set_dpname)} + DIST_POINT_set_dpname := @FC_DIST_POINT_set_dpname; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(DIST_POINT_set_dpname_removed)} + if DIST_POINT_set_dpname_removed <= LibVersion then + begin + {$if declared(_DIST_POINT_set_dpname)} + DIST_POINT_set_dpname := @_DIST_POINT_set_dpname; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(DIST_POINT_set_dpname_allownil)} + if FuncLoadError then + AFailed.Add('DIST_POINT_set_dpname'); + {$ifend} + end; + + + NAME_CONSTRAINTS_check := LoadLibFunction(ADllHandle, NAME_CONSTRAINTS_check_procname); + FuncLoadError := not assigned(NAME_CONSTRAINTS_check); + if FuncLoadError then + begin + {$if not defined(NAME_CONSTRAINTS_check_allownil)} + NAME_CONSTRAINTS_check := @ERR_NAME_CONSTRAINTS_check; + {$ifend} + {$if declared(NAME_CONSTRAINTS_check_introduced)} + if LibVersion < NAME_CONSTRAINTS_check_introduced then + begin + {$if declared(FC_NAME_CONSTRAINTS_check)} + NAME_CONSTRAINTS_check := @FC_NAME_CONSTRAINTS_check; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(NAME_CONSTRAINTS_check_removed)} + if NAME_CONSTRAINTS_check_removed <= LibVersion then + begin + {$if declared(_NAME_CONSTRAINTS_check)} + NAME_CONSTRAINTS_check := @_NAME_CONSTRAINTS_check; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(NAME_CONSTRAINTS_check_allownil)} + if FuncLoadError then + AFailed.Add('NAME_CONSTRAINTS_check'); + {$ifend} + end; + + + NAME_CONSTRAINTS_check_CN := LoadLibFunction(ADllHandle, NAME_CONSTRAINTS_check_CN_procname); + FuncLoadError := not assigned(NAME_CONSTRAINTS_check_CN); + if FuncLoadError then + begin + {$if not defined(NAME_CONSTRAINTS_check_CN_allownil)} + NAME_CONSTRAINTS_check_CN := @ERR_NAME_CONSTRAINTS_check_CN; + {$ifend} + {$if declared(NAME_CONSTRAINTS_check_CN_introduced)} + if LibVersion < NAME_CONSTRAINTS_check_CN_introduced then + begin + {$if declared(FC_NAME_CONSTRAINTS_check_CN)} + NAME_CONSTRAINTS_check_CN := @FC_NAME_CONSTRAINTS_check_CN; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(NAME_CONSTRAINTS_check_CN_removed)} + if NAME_CONSTRAINTS_check_CN_removed <= LibVersion then + begin + {$if declared(_NAME_CONSTRAINTS_check_CN)} + NAME_CONSTRAINTS_check_CN := @_NAME_CONSTRAINTS_check_CN; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(NAME_CONSTRAINTS_check_CN_allownil)} + if FuncLoadError then + AFailed.Add('NAME_CONSTRAINTS_check_CN'); + {$ifend} + end; + + + BASIC_CONSTRAINTS_free := LoadLibFunction(ADllHandle, BASIC_CONSTRAINTS_free_procname); + FuncLoadError := not assigned(BASIC_CONSTRAINTS_free); + if FuncLoadError then + begin + {$if not defined(BASIC_CONSTRAINTS_free_allownil)} + BASIC_CONSTRAINTS_free := @ERR_BASIC_CONSTRAINTS_free; + {$ifend} + {$if declared(BASIC_CONSTRAINTS_free_introduced)} + if LibVersion < BASIC_CONSTRAINTS_free_introduced then + begin + {$if declared(FC_BASIC_CONSTRAINTS_free)} + BASIC_CONSTRAINTS_free := @FC_BASIC_CONSTRAINTS_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(BASIC_CONSTRAINTS_free_removed)} + if BASIC_CONSTRAINTS_free_removed <= LibVersion then + begin + {$if declared(_BASIC_CONSTRAINTS_free)} + BASIC_CONSTRAINTS_free := @_BASIC_CONSTRAINTS_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(BASIC_CONSTRAINTS_free_allownil)} + if FuncLoadError then + AFailed.Add('BASIC_CONSTRAINTS_free'); + {$ifend} + end; + + + AUTHORITY_KEYID_free := LoadLibFunction(ADllHandle, AUTHORITY_KEYID_free_procname); + FuncLoadError := not assigned(AUTHORITY_KEYID_free); + if FuncLoadError then + begin + {$if not defined(AUTHORITY_KEYID_free_allownil)} + AUTHORITY_KEYID_free := @ERR_AUTHORITY_KEYID_free; + {$ifend} + {$if declared(AUTHORITY_KEYID_free_introduced)} + if LibVersion < AUTHORITY_KEYID_free_introduced then + begin + {$if declared(FC_AUTHORITY_KEYID_free)} + AUTHORITY_KEYID_free := @FC_AUTHORITY_KEYID_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(AUTHORITY_KEYID_free_removed)} + if AUTHORITY_KEYID_free_removed <= LibVersion then + begin + {$if declared(_AUTHORITY_KEYID_free)} + AUTHORITY_KEYID_free := @_AUTHORITY_KEYID_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(AUTHORITY_KEYID_free_allownil)} + if FuncLoadError then + AFailed.Add('AUTHORITY_KEYID_free'); + {$ifend} + end; + + + X509V3_EXT_nconf_nid := LoadLibFunction(ADllHandle, X509V3_EXT_nconf_nid_procname); + FuncLoadError := not assigned(X509V3_EXT_nconf_nid); + if FuncLoadError then + begin + {$if not defined(X509V3_EXT_nconf_nid_allownil)} + X509V3_EXT_nconf_nid := @ERR_X509V3_EXT_nconf_nid; + {$ifend} + {$if declared(X509V3_EXT_nconf_nid_introduced)} + if LibVersion < X509V3_EXT_nconf_nid_introduced then + begin + {$if declared(FC_X509V3_EXT_nconf_nid)} + X509V3_EXT_nconf_nid := @FC_X509V3_EXT_nconf_nid; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509V3_EXT_nconf_nid_removed)} + if X509V3_EXT_nconf_nid_removed <= LibVersion then + begin + {$if declared(_X509V3_EXT_nconf_nid)} + X509V3_EXT_nconf_nid := @_X509V3_EXT_nconf_nid; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509V3_EXT_nconf_nid_allownil)} + if FuncLoadError then + AFailed.Add('X509V3_EXT_nconf_nid'); + {$ifend} + end; + + + X509V3_EXT_nconf := LoadLibFunction(ADllHandle, X509V3_EXT_nconf_procname); + FuncLoadError := not assigned(X509V3_EXT_nconf); + if FuncLoadError then + begin + {$if not defined(X509V3_EXT_nconf_allownil)} + X509V3_EXT_nconf := @ERR_X509V3_EXT_nconf; + {$ifend} + {$if declared(X509V3_EXT_nconf_introduced)} + if LibVersion < X509V3_EXT_nconf_introduced then + begin + {$if declared(FC_X509V3_EXT_nconf)} + X509V3_EXT_nconf := @FC_X509V3_EXT_nconf; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509V3_EXT_nconf_removed)} + if X509V3_EXT_nconf_removed <= LibVersion then + begin + {$if declared(_X509V3_EXT_nconf)} + X509V3_EXT_nconf := @_X509V3_EXT_nconf; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509V3_EXT_nconf_allownil)} + if FuncLoadError then + AFailed.Add('X509V3_EXT_nconf'); + {$ifend} + end; + + + X509V3_EXT_add_nconf := LoadLibFunction(ADllHandle, X509V3_EXT_add_nconf_procname); + FuncLoadError := not assigned(X509V3_EXT_add_nconf); + if FuncLoadError then + begin + {$if not defined(X509V3_EXT_add_nconf_allownil)} + X509V3_EXT_add_nconf := @ERR_X509V3_EXT_add_nconf; + {$ifend} + {$if declared(X509V3_EXT_add_nconf_introduced)} + if LibVersion < X509V3_EXT_add_nconf_introduced then + begin + {$if declared(FC_X509V3_EXT_add_nconf)} + X509V3_EXT_add_nconf := @FC_X509V3_EXT_add_nconf; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509V3_EXT_add_nconf_removed)} + if X509V3_EXT_add_nconf_removed <= LibVersion then + begin + {$if declared(_X509V3_EXT_add_nconf)} + X509V3_EXT_add_nconf := @_X509V3_EXT_add_nconf; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509V3_EXT_add_nconf_allownil)} + if FuncLoadError then + AFailed.Add('X509V3_EXT_add_nconf'); + {$ifend} + end; + + + X509V3_EXT_REQ_add_nconf := LoadLibFunction(ADllHandle, X509V3_EXT_REQ_add_nconf_procname); + FuncLoadError := not assigned(X509V3_EXT_REQ_add_nconf); + if FuncLoadError then + begin + {$if not defined(X509V3_EXT_REQ_add_nconf_allownil)} + X509V3_EXT_REQ_add_nconf := @ERR_X509V3_EXT_REQ_add_nconf; + {$ifend} + {$if declared(X509V3_EXT_REQ_add_nconf_introduced)} + if LibVersion < X509V3_EXT_REQ_add_nconf_introduced then + begin + {$if declared(FC_X509V3_EXT_REQ_add_nconf)} + X509V3_EXT_REQ_add_nconf := @FC_X509V3_EXT_REQ_add_nconf; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509V3_EXT_REQ_add_nconf_removed)} + if X509V3_EXT_REQ_add_nconf_removed <= LibVersion then + begin + {$if declared(_X509V3_EXT_REQ_add_nconf)} + X509V3_EXT_REQ_add_nconf := @_X509V3_EXT_REQ_add_nconf; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509V3_EXT_REQ_add_nconf_allownil)} + if FuncLoadError then + AFailed.Add('X509V3_EXT_REQ_add_nconf'); + {$ifend} + end; + + + X509V3_EXT_CRL_add_nconf := LoadLibFunction(ADllHandle, X509V3_EXT_CRL_add_nconf_procname); + FuncLoadError := not assigned(X509V3_EXT_CRL_add_nconf); + if FuncLoadError then + begin + {$if not defined(X509V3_EXT_CRL_add_nconf_allownil)} + X509V3_EXT_CRL_add_nconf := @ERR_X509V3_EXT_CRL_add_nconf; + {$ifend} + {$if declared(X509V3_EXT_CRL_add_nconf_introduced)} + if LibVersion < X509V3_EXT_CRL_add_nconf_introduced then + begin + {$if declared(FC_X509V3_EXT_CRL_add_nconf)} + X509V3_EXT_CRL_add_nconf := @FC_X509V3_EXT_CRL_add_nconf; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509V3_EXT_CRL_add_nconf_removed)} + if X509V3_EXT_CRL_add_nconf_removed <= LibVersion then + begin + {$if declared(_X509V3_EXT_CRL_add_nconf)} + X509V3_EXT_CRL_add_nconf := @_X509V3_EXT_CRL_add_nconf; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509V3_EXT_CRL_add_nconf_allownil)} + if FuncLoadError then + AFailed.Add('X509V3_EXT_CRL_add_nconf'); + {$ifend} + end; + + + X509V3_EXT_conf_nid := LoadLibFunction(ADllHandle, X509V3_EXT_conf_nid_procname); + FuncLoadError := not assigned(X509V3_EXT_conf_nid); + if FuncLoadError then + begin + {$if not defined(X509V3_EXT_conf_nid_allownil)} + X509V3_EXT_conf_nid := @ERR_X509V3_EXT_conf_nid; + {$ifend} + {$if declared(X509V3_EXT_conf_nid_introduced)} + if LibVersion < X509V3_EXT_conf_nid_introduced then + begin + {$if declared(FC_X509V3_EXT_conf_nid)} + X509V3_EXT_conf_nid := @FC_X509V3_EXT_conf_nid; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509V3_EXT_conf_nid_removed)} + if X509V3_EXT_conf_nid_removed <= LibVersion then + begin + {$if declared(_X509V3_EXT_conf_nid)} + X509V3_EXT_conf_nid := @_X509V3_EXT_conf_nid; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509V3_EXT_conf_nid_allownil)} + if FuncLoadError then + AFailed.Add('X509V3_EXT_conf_nid'); + {$ifend} + end; + + + X509V3_EXT_conf := LoadLibFunction(ADllHandle, X509V3_EXT_conf_procname); + FuncLoadError := not assigned(X509V3_EXT_conf); + if FuncLoadError then + begin + {$if not defined(X509V3_EXT_conf_allownil)} + X509V3_EXT_conf := @ERR_X509V3_EXT_conf; + {$ifend} + {$if declared(X509V3_EXT_conf_introduced)} + if LibVersion < X509V3_EXT_conf_introduced then + begin + {$if declared(FC_X509V3_EXT_conf)} + X509V3_EXT_conf := @FC_X509V3_EXT_conf; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509V3_EXT_conf_removed)} + if X509V3_EXT_conf_removed <= LibVersion then + begin + {$if declared(_X509V3_EXT_conf)} + X509V3_EXT_conf := @_X509V3_EXT_conf; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509V3_EXT_conf_allownil)} + if FuncLoadError then + AFailed.Add('X509V3_EXT_conf'); + {$ifend} + end; + + + X509V3_EXT_add_conf := LoadLibFunction(ADllHandle, X509V3_EXT_add_conf_procname); + FuncLoadError := not assigned(X509V3_EXT_add_conf); + if FuncLoadError then + begin + {$if not defined(X509V3_EXT_add_conf_allownil)} + X509V3_EXT_add_conf := @ERR_X509V3_EXT_add_conf; + {$ifend} + {$if declared(X509V3_EXT_add_conf_introduced)} + if LibVersion < X509V3_EXT_add_conf_introduced then + begin + {$if declared(FC_X509V3_EXT_add_conf)} + X509V3_EXT_add_conf := @FC_X509V3_EXT_add_conf; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509V3_EXT_add_conf_removed)} + if X509V3_EXT_add_conf_removed <= LibVersion then + begin + {$if declared(_X509V3_EXT_add_conf)} + X509V3_EXT_add_conf := @_X509V3_EXT_add_conf; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509V3_EXT_add_conf_allownil)} + if FuncLoadError then + AFailed.Add('X509V3_EXT_add_conf'); + {$ifend} + end; + + + X509V3_EXT_REQ_add_conf := LoadLibFunction(ADllHandle, X509V3_EXT_REQ_add_conf_procname); + FuncLoadError := not assigned(X509V3_EXT_REQ_add_conf); + if FuncLoadError then + begin + {$if not defined(X509V3_EXT_REQ_add_conf_allownil)} + X509V3_EXT_REQ_add_conf := @ERR_X509V3_EXT_REQ_add_conf; + {$ifend} + {$if declared(X509V3_EXT_REQ_add_conf_introduced)} + if LibVersion < X509V3_EXT_REQ_add_conf_introduced then + begin + {$if declared(FC_X509V3_EXT_REQ_add_conf)} + X509V3_EXT_REQ_add_conf := @FC_X509V3_EXT_REQ_add_conf; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509V3_EXT_REQ_add_conf_removed)} + if X509V3_EXT_REQ_add_conf_removed <= LibVersion then + begin + {$if declared(_X509V3_EXT_REQ_add_conf)} + X509V3_EXT_REQ_add_conf := @_X509V3_EXT_REQ_add_conf; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509V3_EXT_REQ_add_conf_allownil)} + if FuncLoadError then + AFailed.Add('X509V3_EXT_REQ_add_conf'); + {$ifend} + end; + + + X509V3_EXT_CRL_add_conf := LoadLibFunction(ADllHandle, X509V3_EXT_CRL_add_conf_procname); + FuncLoadError := not assigned(X509V3_EXT_CRL_add_conf); + if FuncLoadError then + begin + {$if not defined(X509V3_EXT_CRL_add_conf_allownil)} + X509V3_EXT_CRL_add_conf := @ERR_X509V3_EXT_CRL_add_conf; + {$ifend} + {$if declared(X509V3_EXT_CRL_add_conf_introduced)} + if LibVersion < X509V3_EXT_CRL_add_conf_introduced then + begin + {$if declared(FC_X509V3_EXT_CRL_add_conf)} + X509V3_EXT_CRL_add_conf := @FC_X509V3_EXT_CRL_add_conf; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509V3_EXT_CRL_add_conf_removed)} + if X509V3_EXT_CRL_add_conf_removed <= LibVersion then + begin + {$if declared(_X509V3_EXT_CRL_add_conf)} + X509V3_EXT_CRL_add_conf := @_X509V3_EXT_CRL_add_conf; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509V3_EXT_CRL_add_conf_allownil)} + if FuncLoadError then + AFailed.Add('X509V3_EXT_CRL_add_conf'); + {$ifend} + end; + + + X509V3_set_nconf := LoadLibFunction(ADllHandle, X509V3_set_nconf_procname); + FuncLoadError := not assigned(X509V3_set_nconf); + if FuncLoadError then + begin + {$if not defined(X509V3_set_nconf_allownil)} + X509V3_set_nconf := @ERR_X509V3_set_nconf; + {$ifend} + {$if declared(X509V3_set_nconf_introduced)} + if LibVersion < X509V3_set_nconf_introduced then + begin + {$if declared(FC_X509V3_set_nconf)} + X509V3_set_nconf := @FC_X509V3_set_nconf; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509V3_set_nconf_removed)} + if X509V3_set_nconf_removed <= LibVersion then + begin + {$if declared(_X509V3_set_nconf)} + X509V3_set_nconf := @_X509V3_set_nconf; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509V3_set_nconf_allownil)} + if FuncLoadError then + AFailed.Add('X509V3_set_nconf'); + {$ifend} + end; + + + X509V3_get_string := LoadLibFunction(ADllHandle, X509V3_get_string_procname); + FuncLoadError := not assigned(X509V3_get_string); + if FuncLoadError then + begin + {$if not defined(X509V3_get_string_allownil)} + X509V3_get_string := @ERR_X509V3_get_string; + {$ifend} + {$if declared(X509V3_get_string_introduced)} + if LibVersion < X509V3_get_string_introduced then + begin + {$if declared(FC_X509V3_get_string)} + X509V3_get_string := @FC_X509V3_get_string; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509V3_get_string_removed)} + if X509V3_get_string_removed <= LibVersion then + begin + {$if declared(_X509V3_get_string)} + X509V3_get_string := @_X509V3_get_string; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509V3_get_string_allownil)} + if FuncLoadError then + AFailed.Add('X509V3_get_string'); + {$ifend} + end; + + + X509V3_string_free := LoadLibFunction(ADllHandle, X509V3_string_free_procname); + FuncLoadError := not assigned(X509V3_string_free); + if FuncLoadError then + begin + {$if not defined(X509V3_string_free_allownil)} + X509V3_string_free := @ERR_X509V3_string_free; + {$ifend} + {$if declared(X509V3_string_free_introduced)} + if LibVersion < X509V3_string_free_introduced then + begin + {$if declared(FC_X509V3_string_free)} + X509V3_string_free := @FC_X509V3_string_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509V3_string_free_removed)} + if X509V3_string_free_removed <= LibVersion then + begin + {$if declared(_X509V3_string_free)} + X509V3_string_free := @_X509V3_string_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509V3_string_free_allownil)} + if FuncLoadError then + AFailed.Add('X509V3_string_free'); + {$ifend} + end; + + + X509V3_set_ctx := LoadLibFunction(ADllHandle, X509V3_set_ctx_procname); + FuncLoadError := not assigned(X509V3_set_ctx); + if FuncLoadError then + begin + {$if not defined(X509V3_set_ctx_allownil)} + X509V3_set_ctx := @ERR_X509V3_set_ctx; + {$ifend} + {$if declared(X509V3_set_ctx_introduced)} + if LibVersion < X509V3_set_ctx_introduced then + begin + {$if declared(FC_X509V3_set_ctx)} + X509V3_set_ctx := @FC_X509V3_set_ctx; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509V3_set_ctx_removed)} + if X509V3_set_ctx_removed <= LibVersion then + begin + {$if declared(_X509V3_set_ctx)} + X509V3_set_ctx := @_X509V3_set_ctx; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509V3_set_ctx_allownil)} + if FuncLoadError then + AFailed.Add('X509V3_set_ctx'); + {$ifend} + end; + + + X509V3_EXT_add_alias := LoadLibFunction(ADllHandle, X509V3_EXT_add_alias_procname); + FuncLoadError := not assigned(X509V3_EXT_add_alias); + if FuncLoadError then + begin + {$if not defined(X509V3_EXT_add_alias_allownil)} + X509V3_EXT_add_alias := @ERR_X509V3_EXT_add_alias; + {$ifend} + {$if declared(X509V3_EXT_add_alias_introduced)} + if LibVersion < X509V3_EXT_add_alias_introduced then + begin + {$if declared(FC_X509V3_EXT_add_alias)} + X509V3_EXT_add_alias := @FC_X509V3_EXT_add_alias; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509V3_EXT_add_alias_removed)} + if X509V3_EXT_add_alias_removed <= LibVersion then + begin + {$if declared(_X509V3_EXT_add_alias)} + X509V3_EXT_add_alias := @_X509V3_EXT_add_alias; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509V3_EXT_add_alias_allownil)} + if FuncLoadError then + AFailed.Add('X509V3_EXT_add_alias'); + {$ifend} + end; + + + X509V3_EXT_cleanup := LoadLibFunction(ADllHandle, X509V3_EXT_cleanup_procname); + FuncLoadError := not assigned(X509V3_EXT_cleanup); + if FuncLoadError then + begin + {$if not defined(X509V3_EXT_cleanup_allownil)} + X509V3_EXT_cleanup := @ERR_X509V3_EXT_cleanup; + {$ifend} + {$if declared(X509V3_EXT_cleanup_introduced)} + if LibVersion < X509V3_EXT_cleanup_introduced then + begin + {$if declared(FC_X509V3_EXT_cleanup)} + X509V3_EXT_cleanup := @FC_X509V3_EXT_cleanup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509V3_EXT_cleanup_removed)} + if X509V3_EXT_cleanup_removed <= LibVersion then + begin + {$if declared(_X509V3_EXT_cleanup)} + X509V3_EXT_cleanup := @_X509V3_EXT_cleanup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509V3_EXT_cleanup_allownil)} + if FuncLoadError then + AFailed.Add('X509V3_EXT_cleanup'); + {$ifend} + end; + + + X509V3_add_standard_extensions := LoadLibFunction(ADllHandle, X509V3_add_standard_extensions_procname); + FuncLoadError := not assigned(X509V3_add_standard_extensions); + if FuncLoadError then + begin + {$if not defined(X509V3_add_standard_extensions_allownil)} + X509V3_add_standard_extensions := @ERR_X509V3_add_standard_extensions; + {$ifend} + {$if declared(X509V3_add_standard_extensions_introduced)} + if LibVersion < X509V3_add_standard_extensions_introduced then + begin + {$if declared(FC_X509V3_add_standard_extensions)} + X509V3_add_standard_extensions := @FC_X509V3_add_standard_extensions; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509V3_add_standard_extensions_removed)} + if X509V3_add_standard_extensions_removed <= LibVersion then + begin + {$if declared(_X509V3_add_standard_extensions)} + X509V3_add_standard_extensions := @_X509V3_add_standard_extensions; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509V3_add_standard_extensions_allownil)} + if FuncLoadError then + AFailed.Add('X509V3_add_standard_extensions'); + {$ifend} + end; + + + X509V3_EXT_d2i := LoadLibFunction(ADllHandle, X509V3_EXT_d2i_procname); + FuncLoadError := not assigned(X509V3_EXT_d2i); + if FuncLoadError then + begin + {$if not defined(X509V3_EXT_d2i_allownil)} + X509V3_EXT_d2i := @ERR_X509V3_EXT_d2i; + {$ifend} + {$if declared(X509V3_EXT_d2i_introduced)} + if LibVersion < X509V3_EXT_d2i_introduced then + begin + {$if declared(FC_X509V3_EXT_d2i)} + X509V3_EXT_d2i := @FC_X509V3_EXT_d2i; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509V3_EXT_d2i_removed)} + if X509V3_EXT_d2i_removed <= LibVersion then + begin + {$if declared(_X509V3_EXT_d2i)} + X509V3_EXT_d2i := @_X509V3_EXT_d2i; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509V3_EXT_d2i_allownil)} + if FuncLoadError then + AFailed.Add('X509V3_EXT_d2i'); + {$ifend} + end; + + + X509V3_EXT_i2d := LoadLibFunction(ADllHandle, X509V3_EXT_i2d_procname); + FuncLoadError := not assigned(X509V3_EXT_i2d); + if FuncLoadError then + begin + {$if not defined(X509V3_EXT_i2d_allownil)} + X509V3_EXT_i2d := @ERR_X509V3_EXT_i2d; + {$ifend} + {$if declared(X509V3_EXT_i2d_introduced)} + if LibVersion < X509V3_EXT_i2d_introduced then + begin + {$if declared(FC_X509V3_EXT_i2d)} + X509V3_EXT_i2d := @FC_X509V3_EXT_i2d; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509V3_EXT_i2d_removed)} + if X509V3_EXT_i2d_removed <= LibVersion then + begin + {$if declared(_X509V3_EXT_i2d)} + X509V3_EXT_i2d := @_X509V3_EXT_i2d; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509V3_EXT_i2d_allownil)} + if FuncLoadError then + AFailed.Add('X509V3_EXT_i2d'); + {$ifend} + end; + + + X509V3_EXT_print := LoadLibFunction(ADllHandle, X509V3_EXT_print_procname); + FuncLoadError := not assigned(X509V3_EXT_print); + if FuncLoadError then + begin + {$if not defined(X509V3_EXT_print_allownil)} + X509V3_EXT_print := @ERR_X509V3_EXT_print; + {$ifend} + {$if declared(X509V3_EXT_print_introduced)} + if LibVersion < X509V3_EXT_print_introduced then + begin + {$if declared(FC_X509V3_EXT_print)} + X509V3_EXT_print := @FC_X509V3_EXT_print; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509V3_EXT_print_removed)} + if X509V3_EXT_print_removed <= LibVersion then + begin + {$if declared(_X509V3_EXT_print)} + X509V3_EXT_print := @_X509V3_EXT_print; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509V3_EXT_print_allownil)} + if FuncLoadError then + AFailed.Add('X509V3_EXT_print'); + {$ifend} + end; + + + X509_check_ca := LoadLibFunction(ADllHandle, X509_check_ca_procname); + FuncLoadError := not assigned(X509_check_ca); + if FuncLoadError then + begin + {$if not defined(X509_check_ca_allownil)} + X509_check_ca := @ERR_X509_check_ca; + {$ifend} + {$if declared(X509_check_ca_introduced)} + if LibVersion < X509_check_ca_introduced then + begin + {$if declared(FC_X509_check_ca)} + X509_check_ca := @FC_X509_check_ca; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_check_ca_removed)} + if X509_check_ca_removed <= LibVersion then + begin + {$if declared(_X509_check_ca)} + X509_check_ca := @_X509_check_ca; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_check_ca_allownil)} + if FuncLoadError then + AFailed.Add('X509_check_ca'); + {$ifend} + end; + + + X509_check_purpose := LoadLibFunction(ADllHandle, X509_check_purpose_procname); + FuncLoadError := not assigned(X509_check_purpose); + if FuncLoadError then + begin + {$if not defined(X509_check_purpose_allownil)} + X509_check_purpose := @ERR_X509_check_purpose; + {$ifend} + {$if declared(X509_check_purpose_introduced)} + if LibVersion < X509_check_purpose_introduced then + begin + {$if declared(FC_X509_check_purpose)} + X509_check_purpose := @FC_X509_check_purpose; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_check_purpose_removed)} + if X509_check_purpose_removed <= LibVersion then + begin + {$if declared(_X509_check_purpose)} + X509_check_purpose := @_X509_check_purpose; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_check_purpose_allownil)} + if FuncLoadError then + AFailed.Add('X509_check_purpose'); + {$ifend} + end; + + + X509_supported_extension := LoadLibFunction(ADllHandle, X509_supported_extension_procname); + FuncLoadError := not assigned(X509_supported_extension); + if FuncLoadError then + begin + {$if not defined(X509_supported_extension_allownil)} + X509_supported_extension := @ERR_X509_supported_extension; + {$ifend} + {$if declared(X509_supported_extension_introduced)} + if LibVersion < X509_supported_extension_introduced then + begin + {$if declared(FC_X509_supported_extension)} + X509_supported_extension := @FC_X509_supported_extension; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_supported_extension_removed)} + if X509_supported_extension_removed <= LibVersion then + begin + {$if declared(_X509_supported_extension)} + X509_supported_extension := @_X509_supported_extension; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_supported_extension_allownil)} + if FuncLoadError then + AFailed.Add('X509_supported_extension'); + {$ifend} + end; + + + X509_PURPOSE_set := LoadLibFunction(ADllHandle, X509_PURPOSE_set_procname); + FuncLoadError := not assigned(X509_PURPOSE_set); + if FuncLoadError then + begin + {$if not defined(X509_PURPOSE_set_allownil)} + X509_PURPOSE_set := @ERR_X509_PURPOSE_set; + {$ifend} + {$if declared(X509_PURPOSE_set_introduced)} + if LibVersion < X509_PURPOSE_set_introduced then + begin + {$if declared(FC_X509_PURPOSE_set)} + X509_PURPOSE_set := @FC_X509_PURPOSE_set; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_PURPOSE_set_removed)} + if X509_PURPOSE_set_removed <= LibVersion then + begin + {$if declared(_X509_PURPOSE_set)} + X509_PURPOSE_set := @_X509_PURPOSE_set; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_PURPOSE_set_allownil)} + if FuncLoadError then + AFailed.Add('X509_PURPOSE_set'); + {$ifend} + end; + + + X509_check_issued := LoadLibFunction(ADllHandle, X509_check_issued_procname); + FuncLoadError := not assigned(X509_check_issued); + if FuncLoadError then + begin + {$if not defined(X509_check_issued_allownil)} + X509_check_issued := @ERR_X509_check_issued; + {$ifend} + {$if declared(X509_check_issued_introduced)} + if LibVersion < X509_check_issued_introduced then + begin + {$if declared(FC_X509_check_issued)} + X509_check_issued := @FC_X509_check_issued; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_check_issued_removed)} + if X509_check_issued_removed <= LibVersion then + begin + {$if declared(_X509_check_issued)} + X509_check_issued := @_X509_check_issued; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_check_issued_allownil)} + if FuncLoadError then + AFailed.Add('X509_check_issued'); + {$ifend} + end; + + + X509_check_akid := LoadLibFunction(ADllHandle, X509_check_akid_procname); + FuncLoadError := not assigned(X509_check_akid); + if FuncLoadError then + begin + {$if not defined(X509_check_akid_allownil)} + X509_check_akid := @ERR_X509_check_akid; + {$ifend} + {$if declared(X509_check_akid_introduced)} + if LibVersion < X509_check_akid_introduced then + begin + {$if declared(FC_X509_check_akid)} + X509_check_akid := @FC_X509_check_akid; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_check_akid_removed)} + if X509_check_akid_removed <= LibVersion then + begin + {$if declared(_X509_check_akid)} + X509_check_akid := @_X509_check_akid; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_check_akid_allownil)} + if FuncLoadError then + AFailed.Add('X509_check_akid'); + {$ifend} + end; + + + X509_set_proxy_flag := LoadLibFunction(ADllHandle, X509_set_proxy_flag_procname); + FuncLoadError := not assigned(X509_set_proxy_flag); + if FuncLoadError then + begin + {$if not defined(X509_set_proxy_flag_allownil)} + X509_set_proxy_flag := @ERR_X509_set_proxy_flag; + {$ifend} + {$if declared(X509_set_proxy_flag_introduced)} + if LibVersion < X509_set_proxy_flag_introduced then + begin + {$if declared(FC_X509_set_proxy_flag)} + X509_set_proxy_flag := @FC_X509_set_proxy_flag; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_set_proxy_flag_removed)} + if X509_set_proxy_flag_removed <= LibVersion then + begin + {$if declared(_X509_set_proxy_flag)} + X509_set_proxy_flag := @_X509_set_proxy_flag; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_set_proxy_flag_allownil)} + if FuncLoadError then + AFailed.Add('X509_set_proxy_flag'); + {$ifend} + end; + + + X509_set_proxy_pathlen := LoadLibFunction(ADllHandle, X509_set_proxy_pathlen_procname); + FuncLoadError := not assigned(X509_set_proxy_pathlen); + if FuncLoadError then + begin + {$if not defined(X509_set_proxy_pathlen_allownil)} + X509_set_proxy_pathlen := @ERR_X509_set_proxy_pathlen; + {$ifend} + {$if declared(X509_set_proxy_pathlen_introduced)} + if LibVersion < X509_set_proxy_pathlen_introduced then + begin + {$if declared(FC_X509_set_proxy_pathlen)} + X509_set_proxy_pathlen := @FC_X509_set_proxy_pathlen; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_set_proxy_pathlen_removed)} + if X509_set_proxy_pathlen_removed <= LibVersion then + begin + {$if declared(_X509_set_proxy_pathlen)} + X509_set_proxy_pathlen := @_X509_set_proxy_pathlen; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_set_proxy_pathlen_allownil)} + if FuncLoadError then + AFailed.Add('X509_set_proxy_pathlen'); + {$ifend} + end; + + + X509_get_proxy_pathlen := LoadLibFunction(ADllHandle, X509_get_proxy_pathlen_procname); + FuncLoadError := not assigned(X509_get_proxy_pathlen); + if FuncLoadError then + begin + {$if not defined(X509_get_proxy_pathlen_allownil)} + X509_get_proxy_pathlen := @ERR_X509_get_proxy_pathlen; + {$ifend} + {$if declared(X509_get_proxy_pathlen_introduced)} + if LibVersion < X509_get_proxy_pathlen_introduced then + begin + {$if declared(FC_X509_get_proxy_pathlen)} + X509_get_proxy_pathlen := @FC_X509_get_proxy_pathlen; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_get_proxy_pathlen_removed)} + if X509_get_proxy_pathlen_removed <= LibVersion then + begin + {$if declared(_X509_get_proxy_pathlen)} + X509_get_proxy_pathlen := @_X509_get_proxy_pathlen; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_get_proxy_pathlen_allownil)} + if FuncLoadError then + AFailed.Add('X509_get_proxy_pathlen'); + {$ifend} + end; + + + X509_get_extension_flags := LoadLibFunction(ADllHandle, X509_get_extension_flags_procname); + FuncLoadError := not assigned(X509_get_extension_flags); + if FuncLoadError then + begin + {$if not defined(X509_get_extension_flags_allownil)} + X509_get_extension_flags := @ERR_X509_get_extension_flags; + {$ifend} + {$if declared(X509_get_extension_flags_introduced)} + if LibVersion < X509_get_extension_flags_introduced then + begin + {$if declared(FC_X509_get_extension_flags)} + X509_get_extension_flags := @FC_X509_get_extension_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_get_extension_flags_removed)} + if X509_get_extension_flags_removed <= LibVersion then + begin + {$if declared(_X509_get_extension_flags)} + X509_get_extension_flags := @_X509_get_extension_flags; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_get_extension_flags_allownil)} + if FuncLoadError then + AFailed.Add('X509_get_extension_flags'); + {$ifend} + end; + + + X509_get_key_usage := LoadLibFunction(ADllHandle, X509_get_key_usage_procname); + FuncLoadError := not assigned(X509_get_key_usage); + if FuncLoadError then + begin + {$if not defined(X509_get_key_usage_allownil)} + X509_get_key_usage := @ERR_X509_get_key_usage; + {$ifend} + {$if declared(X509_get_key_usage_introduced)} + if LibVersion < X509_get_key_usage_introduced then + begin + {$if declared(FC_X509_get_key_usage)} + X509_get_key_usage := @FC_X509_get_key_usage; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_get_key_usage_removed)} + if X509_get_key_usage_removed <= LibVersion then + begin + {$if declared(_X509_get_key_usage)} + X509_get_key_usage := @_X509_get_key_usage; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_get_key_usage_allownil)} + if FuncLoadError then + AFailed.Add('X509_get_key_usage'); + {$ifend} + end; + + + X509_get_extended_key_usage := LoadLibFunction(ADllHandle, X509_get_extended_key_usage_procname); + FuncLoadError := not assigned(X509_get_extended_key_usage); + if FuncLoadError then + begin + {$if not defined(X509_get_extended_key_usage_allownil)} + X509_get_extended_key_usage := @ERR_X509_get_extended_key_usage; + {$ifend} + {$if declared(X509_get_extended_key_usage_introduced)} + if LibVersion < X509_get_extended_key_usage_introduced then + begin + {$if declared(FC_X509_get_extended_key_usage)} + X509_get_extended_key_usage := @FC_X509_get_extended_key_usage; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_get_extended_key_usage_removed)} + if X509_get_extended_key_usage_removed <= LibVersion then + begin + {$if declared(_X509_get_extended_key_usage)} + X509_get_extended_key_usage := @_X509_get_extended_key_usage; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_get_extended_key_usage_allownil)} + if FuncLoadError then + AFailed.Add('X509_get_extended_key_usage'); + {$ifend} + end; + + + X509_get0_subject_key_id := LoadLibFunction(ADllHandle, X509_get0_subject_key_id_procname); + FuncLoadError := not assigned(X509_get0_subject_key_id); + if FuncLoadError then + begin + {$if not defined(X509_get0_subject_key_id_allownil)} + X509_get0_subject_key_id := @ERR_X509_get0_subject_key_id; + {$ifend} + {$if declared(X509_get0_subject_key_id_introduced)} + if LibVersion < X509_get0_subject_key_id_introduced then + begin + {$if declared(FC_X509_get0_subject_key_id)} + X509_get0_subject_key_id := @FC_X509_get0_subject_key_id; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_get0_subject_key_id_removed)} + if X509_get0_subject_key_id_removed <= LibVersion then + begin + {$if declared(_X509_get0_subject_key_id)} + X509_get0_subject_key_id := @_X509_get0_subject_key_id; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_get0_subject_key_id_allownil)} + if FuncLoadError then + AFailed.Add('X509_get0_subject_key_id'); + {$ifend} + end; + + X509_get0_authority_issuer := LoadLibFunction(ADllHandle, X509_get0_authority_issuer_procname); + FuncLoadError := not assigned(X509_get0_subject_key_id); + if FuncLoadError then + begin + {$if not defined(X509_get0_authority_issuer_allownil)} + X509_get0_authority_issuer := @ERR_X509_get0_authority_issuer; + {$ifend} + {$if declared(X509_get0_authority_issuer_introduced)} + if LibVersion < X509_get0_subject_key_id_introduced then + begin + {$if declared(FC_X509_get0_authority_issuer)} + X509_get0_subject_key_id := @FC_X509_get0_subject_key_id; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_get0_authority_issuer_removed)} + if X509_get0_subject_key_id_removed <= LibVersion then + begin + {$if declared(_X509_get0_authority_issuer)} + X509_get0_subject_key_id := @_X509_get0_subject_key_id; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_get0_authority_issuer_allownil)} + if FuncLoadError then + AFailed.Add('X509_get0_authority_issuer'); + {$ifend} + end; + + X509_get0_authority_key_id := LoadLibFunction(ADllHandle, X509_get0_authority_key_id_procname); + FuncLoadError := not assigned(X509_get0_authority_key_id); + if FuncLoadError then + begin + {$if not defined(X509_get0_authority_key_id_allownil)} + X509_get0_authority_key_id := @ERR_X509_get0_authority_key_id; + {$ifend} + {$if declared(X509_get0_authority_key_id_introduced)} + if LibVersion < X509_get0_authority_key_id_introduced then + begin + {$if declared(FC_X509_get0_authority_key_id)} + X509_get0_authority_key_id := @FC_X509_get0_authority_key_id; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_get0_authority_key_id_removed)} + if X509_get0_authority_key_id_removed <= LibVersion then + begin + {$if declared(_X509_get0_authority_key_id)} + X509_get0_authority_key_id := @_X509_get0_authority_key_id; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_get0_authority_key_id_allownil)} + if FuncLoadError then + AFailed.Add('X509_get0_authority_key_id'); + {$ifend} + end; + + + X509_get0_authority_serial := LoadLibFunction(ADllHandle, X509_get0_authority_serial_procname); + FuncLoadError := not assigned(X509_get0_authority_serial); + if FuncLoadError then + begin + {$if not defined(X509_get0_authority_serial_allownil)} + X509_get0_authority_serial := @ERR_X509_get0_authority_serial; + {$ifend} + {$if declared(X509_get0_authority_serial_introduced)} + if LibVersion < X509_get0_authority_serial_introduced then + begin + {$if declared(FC_X509_get0_authority_serial)} + X509_get0_authority_serial := @FC_X509_get0_authority_serial; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_get0_authority_serial_removed)} + if X509_get0_authority_serial_removed <= LibVersion then + begin + {$if declared(_X509_get0_authority_serial)} + X509_get0_authority_serial := @_X509_get0_authority_serial; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_get0_authority_serial_allownil)} + if FuncLoadError then + AFailed.Add('X509_get0_authority_serial'); + {$ifend} + end; + + + X509_PURPOSE_get_count := LoadLibFunction(ADllHandle, X509_PURPOSE_get_count_procname); + FuncLoadError := not assigned(X509_PURPOSE_get_count); + if FuncLoadError then + begin + {$if not defined(X509_PURPOSE_get_count_allownil)} + X509_PURPOSE_get_count := @ERR_X509_PURPOSE_get_count; + {$ifend} + {$if declared(X509_PURPOSE_get_count_introduced)} + if LibVersion < X509_PURPOSE_get_count_introduced then + begin + {$if declared(FC_X509_PURPOSE_get_count)} + X509_PURPOSE_get_count := @FC_X509_PURPOSE_get_count; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_PURPOSE_get_count_removed)} + if X509_PURPOSE_get_count_removed <= LibVersion then + begin + {$if declared(_X509_PURPOSE_get_count)} + X509_PURPOSE_get_count := @_X509_PURPOSE_get_count; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_PURPOSE_get_count_allownil)} + if FuncLoadError then + AFailed.Add('X509_PURPOSE_get_count'); + {$ifend} + end; + + + X509_PURPOSE_get0 := LoadLibFunction(ADllHandle, X509_PURPOSE_get0_procname); + FuncLoadError := not assigned(X509_PURPOSE_get0); + if FuncLoadError then + begin + {$if not defined(X509_PURPOSE_get0_allownil)} + X509_PURPOSE_get0 := @ERR_X509_PURPOSE_get0; + {$ifend} + {$if declared(X509_PURPOSE_get0_introduced)} + if LibVersion < X509_PURPOSE_get0_introduced then + begin + {$if declared(FC_X509_PURPOSE_get0)} + X509_PURPOSE_get0 := @FC_X509_PURPOSE_get0; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_PURPOSE_get0_removed)} + if X509_PURPOSE_get0_removed <= LibVersion then + begin + {$if declared(_X509_PURPOSE_get0)} + X509_PURPOSE_get0 := @_X509_PURPOSE_get0; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_PURPOSE_get0_allownil)} + if FuncLoadError then + AFailed.Add('X509_PURPOSE_get0'); + {$ifend} + end; + + + X509_PURPOSE_get_by_sname := LoadLibFunction(ADllHandle, X509_PURPOSE_get_by_sname_procname); + FuncLoadError := not assigned(X509_PURPOSE_get_by_sname); + if FuncLoadError then + begin + {$if not defined(X509_PURPOSE_get_by_sname_allownil)} + X509_PURPOSE_get_by_sname := @ERR_X509_PURPOSE_get_by_sname; + {$ifend} + {$if declared(X509_PURPOSE_get_by_sname_introduced)} + if LibVersion < X509_PURPOSE_get_by_sname_introduced then + begin + {$if declared(FC_X509_PURPOSE_get_by_sname)} + X509_PURPOSE_get_by_sname := @FC_X509_PURPOSE_get_by_sname; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_PURPOSE_get_by_sname_removed)} + if X509_PURPOSE_get_by_sname_removed <= LibVersion then + begin + {$if declared(_X509_PURPOSE_get_by_sname)} + X509_PURPOSE_get_by_sname := @_X509_PURPOSE_get_by_sname; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_PURPOSE_get_by_sname_allownil)} + if FuncLoadError then + AFailed.Add('X509_PURPOSE_get_by_sname'); + {$ifend} + end; + + + X509_PURPOSE_get_by_id := LoadLibFunction(ADllHandle, X509_PURPOSE_get_by_id_procname); + FuncLoadError := not assigned(X509_PURPOSE_get_by_id); + if FuncLoadError then + begin + {$if not defined(X509_PURPOSE_get_by_id_allownil)} + X509_PURPOSE_get_by_id := @ERR_X509_PURPOSE_get_by_id; + {$ifend} + {$if declared(X509_PURPOSE_get_by_id_introduced)} + if LibVersion < X509_PURPOSE_get_by_id_introduced then + begin + {$if declared(FC_X509_PURPOSE_get_by_id)} + X509_PURPOSE_get_by_id := @FC_X509_PURPOSE_get_by_id; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_PURPOSE_get_by_id_removed)} + if X509_PURPOSE_get_by_id_removed <= LibVersion then + begin + {$if declared(_X509_PURPOSE_get_by_id)} + X509_PURPOSE_get_by_id := @_X509_PURPOSE_get_by_id; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_PURPOSE_get_by_id_allownil)} + if FuncLoadError then + AFailed.Add('X509_PURPOSE_get_by_id'); + {$ifend} + end; + + + X509_PURPOSE_get0_name := LoadLibFunction(ADllHandle, X509_PURPOSE_get0_name_procname); + FuncLoadError := not assigned(X509_PURPOSE_get0_name); + if FuncLoadError then + begin + {$if not defined(X509_PURPOSE_get0_name_allownil)} + X509_PURPOSE_get0_name := @ERR_X509_PURPOSE_get0_name; + {$ifend} + {$if declared(X509_PURPOSE_get0_name_introduced)} + if LibVersion < X509_PURPOSE_get0_name_introduced then + begin + {$if declared(FC_X509_PURPOSE_get0_name)} + X509_PURPOSE_get0_name := @FC_X509_PURPOSE_get0_name; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_PURPOSE_get0_name_removed)} + if X509_PURPOSE_get0_name_removed <= LibVersion then + begin + {$if declared(_X509_PURPOSE_get0_name)} + X509_PURPOSE_get0_name := @_X509_PURPOSE_get0_name; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_PURPOSE_get0_name_allownil)} + if FuncLoadError then + AFailed.Add('X509_PURPOSE_get0_name'); + {$ifend} + end; + + + X509_PURPOSE_get0_sname := LoadLibFunction(ADllHandle, X509_PURPOSE_get0_sname_procname); + FuncLoadError := not assigned(X509_PURPOSE_get0_sname); + if FuncLoadError then + begin + {$if not defined(X509_PURPOSE_get0_sname_allownil)} + X509_PURPOSE_get0_sname := @ERR_X509_PURPOSE_get0_sname; + {$ifend} + {$if declared(X509_PURPOSE_get0_sname_introduced)} + if LibVersion < X509_PURPOSE_get0_sname_introduced then + begin + {$if declared(FC_X509_PURPOSE_get0_sname)} + X509_PURPOSE_get0_sname := @FC_X509_PURPOSE_get0_sname; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_PURPOSE_get0_sname_removed)} + if X509_PURPOSE_get0_sname_removed <= LibVersion then + begin + {$if declared(_X509_PURPOSE_get0_sname)} + X509_PURPOSE_get0_sname := @_X509_PURPOSE_get0_sname; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_PURPOSE_get0_sname_allownil)} + if FuncLoadError then + AFailed.Add('X509_PURPOSE_get0_sname'); + {$ifend} + end; + + + X509_PURPOSE_get_trust := LoadLibFunction(ADllHandle, X509_PURPOSE_get_trust_procname); + FuncLoadError := not assigned(X509_PURPOSE_get_trust); + if FuncLoadError then + begin + {$if not defined(X509_PURPOSE_get_trust_allownil)} + X509_PURPOSE_get_trust := @ERR_X509_PURPOSE_get_trust; + {$ifend} + {$if declared(X509_PURPOSE_get_trust_introduced)} + if LibVersion < X509_PURPOSE_get_trust_introduced then + begin + {$if declared(FC_X509_PURPOSE_get_trust)} + X509_PURPOSE_get_trust := @FC_X509_PURPOSE_get_trust; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_PURPOSE_get_trust_removed)} + if X509_PURPOSE_get_trust_removed <= LibVersion then + begin + {$if declared(_X509_PURPOSE_get_trust)} + X509_PURPOSE_get_trust := @_X509_PURPOSE_get_trust; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_PURPOSE_get_trust_allownil)} + if FuncLoadError then + AFailed.Add('X509_PURPOSE_get_trust'); + {$ifend} + end; + + + X509_PURPOSE_cleanup := LoadLibFunction(ADllHandle, X509_PURPOSE_cleanup_procname); + FuncLoadError := not assigned(X509_PURPOSE_cleanup); + if FuncLoadError then + begin + {$if not defined(X509_PURPOSE_cleanup_allownil)} + X509_PURPOSE_cleanup := @ERR_X509_PURPOSE_cleanup; + {$ifend} + {$if declared(X509_PURPOSE_cleanup_introduced)} + if LibVersion < X509_PURPOSE_cleanup_introduced then + begin + {$if declared(FC_X509_PURPOSE_cleanup)} + X509_PURPOSE_cleanup := @FC_X509_PURPOSE_cleanup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_PURPOSE_cleanup_removed)} + if X509_PURPOSE_cleanup_removed <= LibVersion then + begin + {$if declared(_X509_PURPOSE_cleanup)} + X509_PURPOSE_cleanup := @_X509_PURPOSE_cleanup; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_PURPOSE_cleanup_allownil)} + if FuncLoadError then + AFailed.Add('X509_PURPOSE_cleanup'); + {$ifend} + end; + + + X509_PURPOSE_get_id := LoadLibFunction(ADllHandle, X509_PURPOSE_get_id_procname); + FuncLoadError := not assigned(X509_PURPOSE_get_id); + if FuncLoadError then + begin + {$if not defined(X509_PURPOSE_get_id_allownil)} + X509_PURPOSE_get_id := @ERR_X509_PURPOSE_get_id; + {$ifend} + {$if declared(X509_PURPOSE_get_id_introduced)} + if LibVersion < X509_PURPOSE_get_id_introduced then + begin + {$if declared(FC_X509_PURPOSE_get_id)} + X509_PURPOSE_get_id := @FC_X509_PURPOSE_get_id; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_PURPOSE_get_id_removed)} + if X509_PURPOSE_get_id_removed <= LibVersion then + begin + {$if declared(_X509_PURPOSE_get_id)} + X509_PURPOSE_get_id := @_X509_PURPOSE_get_id; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_PURPOSE_get_id_allownil)} + if FuncLoadError then + AFailed.Add('X509_PURPOSE_get_id'); + {$ifend} + end; + + + X509_get1_email := LoadLibFunction(ADllHandle, X509_get1_email_procname); + FuncLoadError := not assigned(X509_PURPOSE_get_id); + if FuncLoadError then + begin + {$if not defined(X509_PURPOSE_get_id_allownil)} + X509_get1_email := @ERR_X509_get1_email; + {$ifend} + {$if declared(X509_get1_email_introduced)} + if LibVersion < X509_get1_email_introduced then + begin + {$if declared(FC_X509_get1_email)} + X509_get1_email := @FC_X509_get1_email; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_get1_email_removed)} + if X509_get1_email_removed <= LibVersion then + begin + {$if declared(_X509_PURPOSE_get_id)} + X509_get1_email := @_X509_get1_email; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_get1_email_allownil)} + if FuncLoadError then + AFailed.Add('X509_get1_email'); + {$ifend} + end; + + + X509_REQ_get1_email := LoadLibFunction(ADllHandle, X509_REQ_get1_email_procname); + FuncLoadError := not assigned(X509_get1_email); + if FuncLoadError then + begin + {$if not defined(X509_REQ_get1_email_allownil)} + X509_REQ_get1_email := @ERR_X509_REQ_get1_email; + {$ifend} + {$if declared(X509_REQ_get1_email_introduced)} + if LibVersion < X509_REQ_get1_email_introduced then + begin + {$if declared(FC_X509_REQ_get1_email)} + X509_REQ_get1_email := @FC_X509_REQ_get1_email; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_REQ_get1_email_removed)} + if X509_REQ_get1_email_removed <= LibVersion then + begin + {$if declared(_X509_get1_email)} + X509_REQ_get1_email := @_X509_REQ_get1_email; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_REQ_get1_email_allownil)} + if FuncLoadError then + AFailed.Add('X509_REQ_get1_email'); + {$ifend} + end; + + + X509_email_free := LoadLibFunction(ADllHandle, X509_email_free_procname); + FuncLoadError := not assigned(X509_email_free); + if FuncLoadError then + begin + {$if not defined(X509_email_free_allownil)} + X509_email_free := @ERR_X509_email_free; + {$ifend} + {$if declared(X509_email_free_introduced)} + if LibVersion < X509_email_free_introduced then + begin + {$if declared(FC_X509_email_free)} + X509_email_free := @FC_X509_email_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_email_free_removed)} + if X509_email_free_removed <= LibVersion then + begin + {$if declared(_X509_get1_email)} + X509_email_free := @_X509_email_free; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_email_free_allownil)} + if FuncLoadError then + AFailed.Add('X509_email_free'); + {$ifend} + end; + + + X509_get1_ocsp := LoadLibFunction(ADllHandle, X509_get1_ocsp_procname); + FuncLoadError := not assigned(X509_get1_ocsp); + if FuncLoadError then + begin + {$if not defined(X509_get1_ocsp_allownil)} + X509_get1_ocsp := @ERR_X509_get1_ocsp; + {$ifend} + {$if declared(X509_get1_ocsp_introduced)} + if LibVersion < X509_get1_ocsp_introduced then + begin + {$if declared(FC_X509_get1_ocsp)} + X509_get1_ocsp := @FC_X509_get1_ocsp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_get1_ocsp_removed)} + if X509_get1_ocsp_removed <= LibVersion then + begin + {$if declared(_X509_get1_email)} + X509_get1_ocsp := @_X509_get1_ocsp; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_get1_ocsp_allownil)} + if FuncLoadError then + AFailed.Add('X509_get1_ocsp'); + {$ifend} + end; + + + X509_check_host := LoadLibFunction(ADllHandle, X509_check_host_procname); + FuncLoadError := not assigned(X509_check_host); + if FuncLoadError then + begin + {$if not defined(X509_check_host_allownil)} + X509_check_host := @ERR_X509_check_host; + {$ifend} + {$if declared(X509_check_host_introduced)} + if LibVersion < X509_check_host_introduced then + begin + {$if declared(FC_X509_check_host)} + X509_check_host := @FC_X509_check_host; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_check_host_removed)} + if X509_check_host_removed <= LibVersion then + begin + {$if declared(_X509_check_host)} + X509_check_host := @_X509_check_host; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_check_host_allownil)} + if FuncLoadError then + AFailed.Add('X509_check_host'); + {$ifend} + end; + + + X509_check_email := LoadLibFunction(ADllHandle, X509_check_email_procname); + FuncLoadError := not assigned(X509_check_email); + if FuncLoadError then + begin + {$if not defined(X509_check_email_allownil)} + X509_check_email := @ERR_X509_check_email; + {$ifend} + {$if declared(X509_check_email_introduced)} + if LibVersion < X509_check_email_introduced then + begin + {$if declared(FC_X509_check_email)} + X509_check_email := @FC_X509_check_email; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_check_email_removed)} + if X509_check_email_removed <= LibVersion then + begin + {$if declared(_X509_check_email)} + X509_check_email := @_X509_check_email; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_check_email_allownil)} + if FuncLoadError then + AFailed.Add('X509_check_email'); + {$ifend} + end; + + + X509_check_ip := LoadLibFunction(ADllHandle, X509_check_ip_procname); + FuncLoadError := not assigned(X509_check_ip); + if FuncLoadError then + begin + {$if not defined(X509_check_ip_allownil)} + X509_check_ip := @ERR_X509_check_ip; + {$ifend} + {$if declared(X509_check_ip_introduced)} + if LibVersion < X509_check_ip_introduced then + begin + {$if declared(FC_X509_check_ip)} + X509_check_ip := @FC_X509_check_ip; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_check_ip_removed)} + if X509_check_ip_removed <= LibVersion then + begin + {$if declared(_X509_check_ip)} + X509_check_ip := @_X509_check_ip; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_check_ip_allownil)} + if FuncLoadError then + AFailed.Add('X509_check_ip'); + {$ifend} + end; + + + X509_check_ip_asc := LoadLibFunction(ADllHandle, X509_check_ip_asc_procname); + FuncLoadError := not assigned(X509_check_ip_asc); + if FuncLoadError then + begin + {$if not defined(X509_check_ip_asc_allownil)} + X509_check_ip_asc := @ERR_X509_check_ip_asc; + {$ifend} + {$if declared(X509_check_ip_asc_introduced)} + if LibVersion < X509_check_ip_asc_introduced then + begin + {$if declared(FC_X509_check_ip_asc)} + X509_check_ip_asc := @FC_X509_check_ip_asc; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_check_ip_asc_removed)} + if X509_check_ip_asc_removed <= LibVersion then + begin + {$if declared(_X509_check_ip_asc)} + X509_check_ip_asc := @_X509_check_ip_asc; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_check_ip_asc_allownil)} + if FuncLoadError then + AFailed.Add('X509_check_ip_asc'); + {$ifend} + end; + + + a2i_IPADDRESS := LoadLibFunction(ADllHandle, a2i_IPADDRESS_procname); + FuncLoadError := not assigned(a2i_IPADDRESS); + if FuncLoadError then + begin + {$if not defined(a2i_IPADDRESS_allownil)} + a2i_IPADDRESS := @ERR_a2i_IPADDRESS; + {$ifend} + {$if declared(a2i_IPADDRESS_introduced)} + if LibVersion < a2i_IPADDRESS_introduced then + begin + {$if declared(FC_a2i_IPADDRESS)} + a2i_IPADDRESS := @FC_a2i_IPADDRESS; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(a2i_IPADDRESS_removed)} + if a2i_IPADDRESS_removed <= LibVersion then + begin + {$if declared(_a2i_IPADDRESS)} + a2i_IPADDRESS := @_a2i_IPADDRESS; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(a2i_IPADDRESS_allownil)} + if FuncLoadError then + AFailed.Add('a2i_IPADDRESS'); + {$ifend} + end; + + + a2i_IPADDRESS_NC := LoadLibFunction(ADllHandle, a2i_IPADDRESS_NC_procname); + FuncLoadError := not assigned(a2i_IPADDRESS_NC); + if FuncLoadError then + begin + {$if not defined(a2i_IPADDRESS_NC_allownil)} + a2i_IPADDRESS_NC := @ERR_a2i_IPADDRESS_NC; + {$ifend} + {$if declared(a2i_IPADDRESS_NC_introduced)} + if LibVersion < a2i_IPADDRESS_NC_introduced then + begin + {$if declared(FC_a2i_IPADDRESS_NC)} + a2i_IPADDRESS_NC := @FC_a2i_IPADDRESS_NC; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(a2i_IPADDRESS_NC_removed)} + if a2i_IPADDRESS_NC_removed <= LibVersion then + begin + {$if declared(_a2i_IPADDRESS_NC)} + a2i_IPADDRESS_NC := @_a2i_IPADDRESS_NC; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(a2i_IPADDRESS_NC_allownil)} + if FuncLoadError then + AFailed.Add('a2i_IPADDRESS_NC'); + {$ifend} + end; + + + X509_POLICY_NODE_print := LoadLibFunction(ADllHandle, X509_POLICY_NODE_print_procname); + FuncLoadError := not assigned(X509_POLICY_NODE_print); + if FuncLoadError then + begin + {$if not defined(X509_POLICY_NODE_print_allownil)} + X509_POLICY_NODE_print := @ERR_X509_POLICY_NODE_print; + {$ifend} + {$if declared(X509_POLICY_NODE_print_introduced)} + if LibVersion < X509_POLICY_NODE_print_introduced then + begin + {$if declared(FC_X509_POLICY_NODE_print)} + X509_POLICY_NODE_print := @FC_X509_POLICY_NODE_print; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509_POLICY_NODE_print_removed)} + if X509_POLICY_NODE_print_removed <= LibVersion then + begin + {$if declared(_X509_POLICY_NODE_print)} + X509_POLICY_NODE_print := @_X509_POLICY_NODE_print; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509_POLICY_NODE_print_allownil)} + if FuncLoadError then + AFailed.Add('X509_POLICY_NODE_print'); + {$ifend} + end; + + + X509v3_addr_get_range := LoadLibFunction(ADllHandle, X509v3_addr_get_range_procname); + FuncLoadError := not assigned(X509v3_addr_get_range); + if FuncLoadError then + begin + {$if not defined(X509v3_addr_get_range_allownil)} + X509v3_addr_get_range := @ERR_X509v3_addr_get_range; + {$ifend} + {$if declared(X509v3_addr_get_range_introduced)} + if LibVersion < X509v3_addr_get_range_introduced then + begin + {$if declared(FC_X509v3_addr_get_range)} + X509v3_addr_get_range := @FC_X509v3_addr_get_range; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509v3_addr_get_range_removed)} + if X509v3_addr_get_range_removed <= LibVersion then + begin + {$if declared(_X509v3_addr_get_range)} + X509v3_addr_get_range := @_X509v3_addr_get_range; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509v3_addr_get_range_allownil)} + if FuncLoadError then + AFailed.Add('X509v3_addr_get_range'); + {$ifend} + end; + + + X509v3_asid_validate_path := LoadLibFunction(ADllHandle, X509v3_asid_validate_path_procname); + FuncLoadError := not assigned(X509v3_asid_validate_path); + if FuncLoadError then + begin + {$if not defined(X509v3_asid_validate_path_allownil)} + X509v3_asid_validate_path := @ERR_X509v3_asid_validate_path; + {$ifend} + {$if declared(X509v3_asid_validate_path_introduced)} + if LibVersion < X509v3_asid_validate_path_introduced then + begin + {$if declared(FC_X509v3_asid_validate_path)} + X509v3_asid_validate_path := @FC_X509v3_asid_validate_path; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509v3_asid_validate_path_removed)} + if X509v3_asid_validate_path_removed <= LibVersion then + begin + {$if declared(_X509v3_asid_validate_path)} + X509v3_asid_validate_path := @_X509v3_asid_validate_path; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509v3_asid_validate_path_allownil)} + if FuncLoadError then + AFailed.Add('X509v3_asid_validate_path'); + {$ifend} + end; + + + X509v3_addr_validate_path := LoadLibFunction(ADllHandle, X509v3_addr_validate_path_procname); + FuncLoadError := not assigned(X509v3_addr_validate_path); + if FuncLoadError then + begin + {$if not defined(X509v3_addr_validate_path_allownil)} + X509v3_addr_validate_path := @ERR_X509v3_addr_validate_path; + {$ifend} + {$if declared(X509v3_addr_validate_path_introduced)} + if LibVersion < X509v3_addr_validate_path_introduced then + begin + {$if declared(FC_X509v3_addr_validate_path)} + X509v3_addr_validate_path := @FC_X509v3_addr_validate_path; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(X509v3_addr_validate_path_removed)} + if X509v3_addr_validate_path_removed <= LibVersion then + begin + {$if declared(_X509v3_addr_validate_path)} + X509v3_addr_validate_path := @_X509v3_addr_validate_path; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(X509v3_addr_validate_path_allownil)} + if FuncLoadError then + AFailed.Add('X509v3_addr_validate_path'); + {$ifend} + end; + + + NAMING_AUTHORITY_get0_authorityId := LoadLibFunction(ADllHandle, NAMING_AUTHORITY_get0_authorityId_procname); + FuncLoadError := not assigned(NAMING_AUTHORITY_get0_authorityId); + if FuncLoadError then + begin + {$if not defined(NAMING_AUTHORITY_get0_authorityId_allownil)} + NAMING_AUTHORITY_get0_authorityId := @ERR_NAMING_AUTHORITY_get0_authorityId; + {$ifend} + {$if declared(NAMING_AUTHORITY_get0_authorityId_introduced)} + if LibVersion < NAMING_AUTHORITY_get0_authorityId_introduced then + begin + {$if declared(FC_NAMING_AUTHORITY_get0_authorityId)} + NAMING_AUTHORITY_get0_authorityId := @FC_NAMING_AUTHORITY_get0_authorityId; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(NAMING_AUTHORITY_get0_authorityId_removed)} + if NAMING_AUTHORITY_get0_authorityId_removed <= LibVersion then + begin + {$if declared(_NAMING_AUTHORITY_get0_authorityId)} + NAMING_AUTHORITY_get0_authorityId := @_NAMING_AUTHORITY_get0_authorityId; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(NAMING_AUTHORITY_get0_authorityId_allownil)} + if FuncLoadError then + AFailed.Add('NAMING_AUTHORITY_get0_authorityId'); + {$ifend} + end; + + + NAMING_AUTHORITY_get0_authorityURL := LoadLibFunction(ADllHandle, NAMING_AUTHORITY_get0_authorityURL_procname); + FuncLoadError := not assigned(NAMING_AUTHORITY_get0_authorityURL); + if FuncLoadError then + begin + {$if not defined(NAMING_AUTHORITY_get0_authorityURL_allownil)} + NAMING_AUTHORITY_get0_authorityURL := @ERR_NAMING_AUTHORITY_get0_authorityURL; + {$ifend} + {$if declared(NAMING_AUTHORITY_get0_authorityURL_introduced)} + if LibVersion < NAMING_AUTHORITY_get0_authorityURL_introduced then + begin + {$if declared(FC_NAMING_AUTHORITY_get0_authorityURL)} + NAMING_AUTHORITY_get0_authorityURL := @FC_NAMING_AUTHORITY_get0_authorityURL; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(NAMING_AUTHORITY_get0_authorityURL_removed)} + if NAMING_AUTHORITY_get0_authorityURL_removed <= LibVersion then + begin + {$if declared(_NAMING_AUTHORITY_get0_authorityURL)} + NAMING_AUTHORITY_get0_authorityURL := @_NAMING_AUTHORITY_get0_authorityURL; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(NAMING_AUTHORITY_get0_authorityURL_allownil)} + if FuncLoadError then + AFailed.Add('NAMING_AUTHORITY_get0_authorityURL'); + {$ifend} + end; + + + NAMING_AUTHORITY_get0_authorityText := LoadLibFunction(ADllHandle, NAMING_AUTHORITY_get0_authorityText_procname); + FuncLoadError := not assigned(NAMING_AUTHORITY_get0_authorityText); + if FuncLoadError then + begin + {$if not defined(NAMING_AUTHORITY_get0_authorityText_allownil)} + NAMING_AUTHORITY_get0_authorityText := @ERR_NAMING_AUTHORITY_get0_authorityText; + {$ifend} + {$if declared(NAMING_AUTHORITY_get0_authorityText_introduced)} + if LibVersion < NAMING_AUTHORITY_get0_authorityText_introduced then + begin + {$if declared(FC_NAMING_AUTHORITY_get0_authorityText)} + NAMING_AUTHORITY_get0_authorityText := @FC_NAMING_AUTHORITY_get0_authorityText; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(NAMING_AUTHORITY_get0_authorityText_removed)} + if NAMING_AUTHORITY_get0_authorityText_removed <= LibVersion then + begin + {$if declared(_NAMING_AUTHORITY_get0_authorityText)} + NAMING_AUTHORITY_get0_authorityText := @_NAMING_AUTHORITY_get0_authorityText; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(NAMING_AUTHORITY_get0_authorityText_allownil)} + if FuncLoadError then + AFailed.Add('NAMING_AUTHORITY_get0_authorityText'); + {$ifend} + end; + + + NAMING_AUTHORITY_set0_authorityId := LoadLibFunction(ADllHandle, NAMING_AUTHORITY_set0_authorityId_procname); + FuncLoadError := not assigned(NAMING_AUTHORITY_set0_authorityId); + if FuncLoadError then + begin + {$if not defined(NAMING_AUTHORITY_set0_authorityId_allownil)} + NAMING_AUTHORITY_set0_authorityId := @ERR_NAMING_AUTHORITY_set0_authorityId; + {$ifend} + {$if declared(NAMING_AUTHORITY_set0_authorityId_introduced)} + if LibVersion < NAMING_AUTHORITY_set0_authorityId_introduced then + begin + {$if declared(FC_NAMING_AUTHORITY_set0_authorityId)} + NAMING_AUTHORITY_set0_authorityId := @FC_NAMING_AUTHORITY_set0_authorityId; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(NAMING_AUTHORITY_set0_authorityId_removed)} + if NAMING_AUTHORITY_set0_authorityId_removed <= LibVersion then + begin + {$if declared(_NAMING_AUTHORITY_set0_authorityId)} + NAMING_AUTHORITY_set0_authorityId := @_NAMING_AUTHORITY_set0_authorityId; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(NAMING_AUTHORITY_set0_authorityId_allownil)} + if FuncLoadError then + AFailed.Add('NAMING_AUTHORITY_set0_authorityId'); + {$ifend} + end; + + + NAMING_AUTHORITY_set0_authorityURL := LoadLibFunction(ADllHandle, NAMING_AUTHORITY_set0_authorityURL_procname); + FuncLoadError := not assigned(NAMING_AUTHORITY_set0_authorityURL); + if FuncLoadError then + begin + {$if not defined(NAMING_AUTHORITY_set0_authorityURL_allownil)} + NAMING_AUTHORITY_set0_authorityURL := @ERR_NAMING_AUTHORITY_set0_authorityURL; + {$ifend} + {$if declared(NAMING_AUTHORITY_set0_authorityURL_introduced)} + if LibVersion < NAMING_AUTHORITY_set0_authorityURL_introduced then + begin + {$if declared(FC_NAMING_AUTHORITY_set0_authorityURL)} + NAMING_AUTHORITY_set0_authorityURL := @FC_NAMING_AUTHORITY_set0_authorityURL; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(NAMING_AUTHORITY_set0_authorityURL_removed)} + if NAMING_AUTHORITY_set0_authorityURL_removed <= LibVersion then + begin + {$if declared(_NAMING_AUTHORITY_set0_authorityURL)} + NAMING_AUTHORITY_set0_authorityURL := @_NAMING_AUTHORITY_set0_authorityURL; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(NAMING_AUTHORITY_set0_authorityURL_allownil)} + if FuncLoadError then + AFailed.Add('NAMING_AUTHORITY_set0_authorityURL'); + {$ifend} + end; + + + NAMING_AUTHORITY_set0_authorityText := LoadLibFunction(ADllHandle, NAMING_AUTHORITY_set0_authorityText_procname); + FuncLoadError := not assigned(NAMING_AUTHORITY_set0_authorityText); + if FuncLoadError then + begin + {$if not defined(NAMING_AUTHORITY_set0_authorityText_allownil)} + NAMING_AUTHORITY_set0_authorityText := @ERR_NAMING_AUTHORITY_set0_authorityText; + {$ifend} + {$if declared(NAMING_AUTHORITY_set0_authorityText_introduced)} + if LibVersion < NAMING_AUTHORITY_set0_authorityText_introduced then + begin + {$if declared(FC_NAMING_AUTHORITY_set0_authorityText)} + NAMING_AUTHORITY_set0_authorityText := @FC_NAMING_AUTHORITY_set0_authorityText; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(NAMING_AUTHORITY_set0_authorityText_removed)} + if NAMING_AUTHORITY_set0_authorityText_removed <= LibVersion then + begin + {$if declared(_NAMING_AUTHORITY_set0_authorityText)} + NAMING_AUTHORITY_set0_authorityText := @_NAMING_AUTHORITY_set0_authorityText; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(NAMING_AUTHORITY_set0_authorityText_allownil)} + if FuncLoadError then + AFailed.Add('NAMING_AUTHORITY_set0_authorityText'); + {$ifend} + end; + + + ADMISSION_SYNTAX_get0_admissionAuthority := LoadLibFunction(ADllHandle, ADMISSION_SYNTAX_get0_admissionAuthority_procname); + FuncLoadError := not assigned(ADMISSION_SYNTAX_get0_admissionAuthority); + if FuncLoadError then + begin + {$if not defined(ADMISSION_SYNTAX_get0_admissionAuthority_allownil)} + ADMISSION_SYNTAX_get0_admissionAuthority := @ERR_ADMISSION_SYNTAX_get0_admissionAuthority; + {$ifend} + {$if declared(ADMISSION_SYNTAX_get0_admissionAuthority_introduced)} + if LibVersion < ADMISSION_SYNTAX_get0_admissionAuthority_introduced then + begin + {$if declared(FC_ADMISSION_SYNTAX_get0_admissionAuthority)} + ADMISSION_SYNTAX_get0_admissionAuthority := @FC_ADMISSION_SYNTAX_get0_admissionAuthority; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ADMISSION_SYNTAX_get0_admissionAuthority_removed)} + if ADMISSION_SYNTAX_get0_admissionAuthority_removed <= LibVersion then + begin + {$if declared(_ADMISSION_SYNTAX_get0_admissionAuthority)} + ADMISSION_SYNTAX_get0_admissionAuthority := @_ADMISSION_SYNTAX_get0_admissionAuthority; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ADMISSION_SYNTAX_get0_admissionAuthority_allownil)} + if FuncLoadError then + AFailed.Add('ADMISSION_SYNTAX_get0_admissionAuthority'); + {$ifend} + end; + + + ADMISSION_SYNTAX_set0_admissionAuthority := LoadLibFunction(ADllHandle, ADMISSION_SYNTAX_set0_admissionAuthority_procname); + FuncLoadError := not assigned(ADMISSION_SYNTAX_set0_admissionAuthority); + if FuncLoadError then + begin + {$if not defined(ADMISSION_SYNTAX_set0_admissionAuthority_allownil)} + ADMISSION_SYNTAX_set0_admissionAuthority := @ERR_ADMISSION_SYNTAX_set0_admissionAuthority; + {$ifend} + {$if declared(ADMISSION_SYNTAX_set0_admissionAuthority_introduced)} + if LibVersion < ADMISSION_SYNTAX_set0_admissionAuthority_introduced then + begin + {$if declared(FC_ADMISSION_SYNTAX_set0_admissionAuthority)} + ADMISSION_SYNTAX_set0_admissionAuthority := @FC_ADMISSION_SYNTAX_set0_admissionAuthority; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ADMISSION_SYNTAX_set0_admissionAuthority_removed)} + if ADMISSION_SYNTAX_set0_admissionAuthority_removed <= LibVersion then + begin + {$if declared(_ADMISSION_SYNTAX_set0_admissionAuthority)} + ADMISSION_SYNTAX_set0_admissionAuthority := @_ADMISSION_SYNTAX_set0_admissionAuthority; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ADMISSION_SYNTAX_set0_admissionAuthority_allownil)} + if FuncLoadError then + AFailed.Add('ADMISSION_SYNTAX_set0_admissionAuthority'); + {$ifend} + end; + + + ADMISSIONS_get0_admissionAuthority := LoadLibFunction(ADllHandle, ADMISSIONS_get0_admissionAuthority_procname); + FuncLoadError := not assigned(ADMISSIONS_get0_admissionAuthority); + if FuncLoadError then + begin + {$if not defined(ADMISSIONS_get0_admissionAuthority_allownil)} + ADMISSIONS_get0_admissionAuthority := @ERR_ADMISSIONS_get0_admissionAuthority; + {$ifend} + {$if declared(ADMISSIONS_get0_admissionAuthority_introduced)} + if LibVersion < ADMISSIONS_get0_admissionAuthority_introduced then + begin + {$if declared(FC_ADMISSIONS_get0_admissionAuthority)} + ADMISSIONS_get0_admissionAuthority := @FC_ADMISSIONS_get0_admissionAuthority; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ADMISSIONS_get0_admissionAuthority_removed)} + if ADMISSIONS_get0_admissionAuthority_removed <= LibVersion then + begin + {$if declared(_ADMISSIONS_get0_admissionAuthority)} + ADMISSIONS_get0_admissionAuthority := @_ADMISSIONS_get0_admissionAuthority; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ADMISSIONS_get0_admissionAuthority_allownil)} + if FuncLoadError then + AFailed.Add('ADMISSIONS_get0_admissionAuthority'); + {$ifend} + end; + + + ADMISSIONS_set0_admissionAuthority := LoadLibFunction(ADllHandle, ADMISSIONS_set0_admissionAuthority_procname); + FuncLoadError := not assigned(ADMISSIONS_set0_admissionAuthority); + if FuncLoadError then + begin + {$if not defined(ADMISSIONS_set0_admissionAuthority_allownil)} + ADMISSIONS_set0_admissionAuthority := @ERR_ADMISSIONS_set0_admissionAuthority; + {$ifend} + {$if declared(ADMISSIONS_set0_admissionAuthority_introduced)} + if LibVersion < ADMISSIONS_set0_admissionAuthority_introduced then + begin + {$if declared(FC_ADMISSIONS_set0_admissionAuthority)} + ADMISSIONS_set0_admissionAuthority := @FC_ADMISSIONS_set0_admissionAuthority; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ADMISSIONS_set0_admissionAuthority_removed)} + if ADMISSIONS_set0_admissionAuthority_removed <= LibVersion then + begin + {$if declared(_ADMISSIONS_set0_admissionAuthority)} + ADMISSIONS_set0_admissionAuthority := @_ADMISSIONS_set0_admissionAuthority; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ADMISSIONS_set0_admissionAuthority_allownil)} + if FuncLoadError then + AFailed.Add('ADMISSIONS_set0_admissionAuthority'); + {$ifend} + end; + + + ADMISSIONS_get0_namingAuthority := LoadLibFunction(ADllHandle, ADMISSIONS_get0_namingAuthority_procname); + FuncLoadError := not assigned(ADMISSIONS_get0_namingAuthority); + if FuncLoadError then + begin + {$if not defined(ADMISSIONS_get0_namingAuthority_allownil)} + ADMISSIONS_get0_namingAuthority := @ERR_ADMISSIONS_get0_namingAuthority; + {$ifend} + {$if declared(ADMISSIONS_get0_namingAuthority_introduced)} + if LibVersion < ADMISSIONS_get0_namingAuthority_introduced then + begin + {$if declared(FC_ADMISSIONS_get0_namingAuthority)} + ADMISSIONS_get0_namingAuthority := @FC_ADMISSIONS_get0_namingAuthority; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ADMISSIONS_get0_namingAuthority_removed)} + if ADMISSIONS_get0_namingAuthority_removed <= LibVersion then + begin + {$if declared(_ADMISSIONS_get0_namingAuthority)} + ADMISSIONS_get0_namingAuthority := @_ADMISSIONS_get0_namingAuthority; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ADMISSIONS_get0_namingAuthority_allownil)} + if FuncLoadError then + AFailed.Add('ADMISSIONS_get0_namingAuthority'); + {$ifend} + end; + + + ADMISSIONS_set0_namingAuthority := LoadLibFunction(ADllHandle, ADMISSIONS_set0_namingAuthority_procname); + FuncLoadError := not assigned(ADMISSIONS_set0_namingAuthority); + if FuncLoadError then + begin + {$if not defined(ADMISSIONS_set0_namingAuthority_allownil)} + ADMISSIONS_set0_namingAuthority := @ERR_ADMISSIONS_set0_namingAuthority; + {$ifend} + {$if declared(ADMISSIONS_set0_namingAuthority_introduced)} + if LibVersion < ADMISSIONS_set0_namingAuthority_introduced then + begin + {$if declared(FC_ADMISSIONS_set0_namingAuthority)} + ADMISSIONS_set0_namingAuthority := @FC_ADMISSIONS_set0_namingAuthority; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(ADMISSIONS_set0_namingAuthority_removed)} + if ADMISSIONS_set0_namingAuthority_removed <= LibVersion then + begin + {$if declared(_ADMISSIONS_set0_namingAuthority)} + ADMISSIONS_set0_namingAuthority := @_ADMISSIONS_set0_namingAuthority; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(ADMISSIONS_set0_namingAuthority_allownil)} + if FuncLoadError then + AFailed.Add('ADMISSIONS_set0_namingAuthority'); + {$ifend} + end; + + + PROFESSION_INFO_get0_addProfessionInfo := LoadLibFunction(ADllHandle, PROFESSION_INFO_get0_addProfessionInfo_procname); + FuncLoadError := not assigned(PROFESSION_INFO_get0_addProfessionInfo); + if FuncLoadError then + begin + {$if not defined(PROFESSION_INFO_get0_addProfessionInfo_allownil)} + PROFESSION_INFO_get0_addProfessionInfo := @ERR_PROFESSION_INFO_get0_addProfessionInfo; + {$ifend} + {$if declared(PROFESSION_INFO_get0_addProfessionInfo_introduced)} + if LibVersion < PROFESSION_INFO_get0_addProfessionInfo_introduced then + begin + {$if declared(FC_PROFESSION_INFO_get0_addProfessionInfo)} + PROFESSION_INFO_get0_addProfessionInfo := @FC_PROFESSION_INFO_get0_addProfessionInfo; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PROFESSION_INFO_get0_addProfessionInfo_removed)} + if PROFESSION_INFO_get0_addProfessionInfo_removed <= LibVersion then + begin + {$if declared(_PROFESSION_INFO_get0_addProfessionInfo)} + PROFESSION_INFO_get0_addProfessionInfo := @_PROFESSION_INFO_get0_addProfessionInfo; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PROFESSION_INFO_get0_addProfessionInfo_allownil)} + if FuncLoadError then + AFailed.Add('PROFESSION_INFO_get0_addProfessionInfo'); + {$ifend} + end; + + + PROFESSION_INFO_set0_addProfessionInfo := LoadLibFunction(ADllHandle, PROFESSION_INFO_set0_addProfessionInfo_procname); + FuncLoadError := not assigned(PROFESSION_INFO_set0_addProfessionInfo); + if FuncLoadError then + begin + {$if not defined(PROFESSION_INFO_set0_addProfessionInfo_allownil)} + PROFESSION_INFO_set0_addProfessionInfo := @ERR_PROFESSION_INFO_set0_addProfessionInfo; + {$ifend} + {$if declared(PROFESSION_INFO_set0_addProfessionInfo_introduced)} + if LibVersion < PROFESSION_INFO_set0_addProfessionInfo_introduced then + begin + {$if declared(FC_PROFESSION_INFO_set0_addProfessionInfo)} + PROFESSION_INFO_set0_addProfessionInfo := @FC_PROFESSION_INFO_set0_addProfessionInfo; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PROFESSION_INFO_set0_addProfessionInfo_removed)} + if PROFESSION_INFO_set0_addProfessionInfo_removed <= LibVersion then + begin + {$if declared(_PROFESSION_INFO_set0_addProfessionInfo)} + PROFESSION_INFO_set0_addProfessionInfo := @_PROFESSION_INFO_set0_addProfessionInfo; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PROFESSION_INFO_set0_addProfessionInfo_allownil)} + if FuncLoadError then + AFailed.Add('PROFESSION_INFO_set0_addProfessionInfo'); + {$ifend} + end; + + + PROFESSION_INFO_get0_namingAuthority := LoadLibFunction(ADllHandle, PROFESSION_INFO_get0_namingAuthority_procname); + FuncLoadError := not assigned(PROFESSION_INFO_get0_namingAuthority); + if FuncLoadError then + begin + {$if not defined(PROFESSION_INFO_get0_namingAuthority_allownil)} + PROFESSION_INFO_get0_namingAuthority := @ERR_PROFESSION_INFO_get0_namingAuthority; + {$ifend} + {$if declared(PROFESSION_INFO_get0_namingAuthority_introduced)} + if LibVersion < PROFESSION_INFO_get0_namingAuthority_introduced then + begin + {$if declared(FC_PROFESSION_INFO_get0_namingAuthority)} + PROFESSION_INFO_get0_namingAuthority := @FC_PROFESSION_INFO_get0_namingAuthority; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PROFESSION_INFO_get0_namingAuthority_removed)} + if PROFESSION_INFO_get0_namingAuthority_removed <= LibVersion then + begin + {$if declared(_PROFESSION_INFO_get0_namingAuthority)} + PROFESSION_INFO_get0_namingAuthority := @_PROFESSION_INFO_get0_namingAuthority; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PROFESSION_INFO_get0_namingAuthority_allownil)} + if FuncLoadError then + AFailed.Add('PROFESSION_INFO_get0_namingAuthority'); + {$ifend} + end; + + + PROFESSION_INFO_set0_namingAuthority := LoadLibFunction(ADllHandle, PROFESSION_INFO_set0_namingAuthority_procname); + FuncLoadError := not assigned(PROFESSION_INFO_set0_namingAuthority); + if FuncLoadError then + begin + {$if not defined(PROFESSION_INFO_set0_namingAuthority_allownil)} + PROFESSION_INFO_set0_namingAuthority := @ERR_PROFESSION_INFO_set0_namingAuthority; + {$ifend} + {$if declared(PROFESSION_INFO_set0_namingAuthority_introduced)} + if LibVersion < PROFESSION_INFO_set0_namingAuthority_introduced then + begin + {$if declared(FC_PROFESSION_INFO_set0_namingAuthority)} + PROFESSION_INFO_set0_namingAuthority := @FC_PROFESSION_INFO_set0_namingAuthority; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PROFESSION_INFO_set0_namingAuthority_removed)} + if PROFESSION_INFO_set0_namingAuthority_removed <= LibVersion then + begin + {$if declared(_PROFESSION_INFO_set0_namingAuthority)} + PROFESSION_INFO_set0_namingAuthority := @_PROFESSION_INFO_set0_namingAuthority; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PROFESSION_INFO_set0_namingAuthority_allownil)} + if FuncLoadError then + AFailed.Add('PROFESSION_INFO_set0_namingAuthority'); + {$ifend} + end; + + + PROFESSION_INFO_get0_registrationNumber := LoadLibFunction(ADllHandle, PROFESSION_INFO_get0_registrationNumber_procname); + FuncLoadError := not assigned(PROFESSION_INFO_get0_registrationNumber); + if FuncLoadError then + begin + {$if not defined(PROFESSION_INFO_get0_registrationNumber_allownil)} + PROFESSION_INFO_get0_registrationNumber := @ERR_PROFESSION_INFO_get0_registrationNumber; + {$ifend} + {$if declared(PROFESSION_INFO_get0_registrationNumber_introduced)} + if LibVersion < PROFESSION_INFO_get0_registrationNumber_introduced then + begin + {$if declared(FC_PROFESSION_INFO_get0_registrationNumber)} + PROFESSION_INFO_get0_registrationNumber := @FC_PROFESSION_INFO_get0_registrationNumber; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PROFESSION_INFO_get0_registrationNumber_removed)} + if PROFESSION_INFO_get0_registrationNumber_removed <= LibVersion then + begin + {$if declared(_PROFESSION_INFO_get0_registrationNumber)} + PROFESSION_INFO_get0_registrationNumber := @_PROFESSION_INFO_get0_registrationNumber; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PROFESSION_INFO_get0_registrationNumber_allownil)} + if FuncLoadError then + AFailed.Add('PROFESSION_INFO_get0_registrationNumber'); + {$ifend} + end; + + + PROFESSION_INFO_set0_registrationNumber := LoadLibFunction(ADllHandle, PROFESSION_INFO_set0_registrationNumber_procname); + FuncLoadError := not assigned(PROFESSION_INFO_set0_registrationNumber); + if FuncLoadError then + begin + {$if not defined(PROFESSION_INFO_set0_registrationNumber_allownil)} + PROFESSION_INFO_set0_registrationNumber := @ERR_PROFESSION_INFO_set0_registrationNumber; + {$ifend} + {$if declared(PROFESSION_INFO_set0_registrationNumber_introduced)} + if LibVersion < PROFESSION_INFO_set0_registrationNumber_introduced then + begin + {$if declared(FC_PROFESSION_INFO_set0_registrationNumber)} + PROFESSION_INFO_set0_registrationNumber := @FC_PROFESSION_INFO_set0_registrationNumber; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if declared(PROFESSION_INFO_set0_registrationNumber_removed)} + if PROFESSION_INFO_set0_registrationNumber_removed <= LibVersion then + begin + {$if declared(_PROFESSION_INFO_set0_registrationNumber)} + PROFESSION_INFO_set0_registrationNumber := @_PROFESSION_INFO_set0_registrationNumber; + {$ifend} + FuncLoadError := false; + end; + {$ifend} + {$if not defined(PROFESSION_INFO_set0_registrationNumber_allownil)} + if FuncLoadError then + AFailed.Add('PROFESSION_INFO_set0_registrationNumber'); + {$ifend} + end; + + +end; + +procedure Unload; +begin + GENERAL_NAME_cmp := nil; + GENERAL_NAME_print := nil; + OTHERNAME_cmp := nil; + GENERAL_NAME_set0_value := nil; + GENERAL_NAME_get0_value := nil; + GENERAL_NAME_set0_othername := nil; + GENERAL_NAME_get0_otherName := nil; + GENERAL_NAMES_free := nil; + i2a_ACCESS_DESCRIPTION := nil; + DIST_POINT_set_dpname := nil; + NAME_CONSTRAINTS_check := nil; + NAME_CONSTRAINTS_check_CN := nil; + BASIC_CONSTRAINTS_free := nil; + AUTHORITY_KEYID_free := nil; + X509V3_EXT_nconf_nid := nil; + X509V3_EXT_nconf := nil; + X509V3_EXT_add_nconf := nil; + X509V3_EXT_REQ_add_nconf := nil; + X509V3_EXT_CRL_add_nconf := nil; + X509V3_EXT_conf_nid := nil; + X509V3_EXT_conf := nil; + X509V3_EXT_add_conf := nil; + X509V3_EXT_REQ_add_conf := nil; + X509V3_EXT_CRL_add_conf := nil; + X509V3_set_nconf := nil; + X509V3_get_string := nil; + X509V3_string_free := nil; + X509V3_set_ctx := nil; + X509V3_EXT_add_alias := nil; + X509V3_EXT_cleanup := nil; + X509V3_add_standard_extensions := nil; + X509V3_EXT_d2i := nil; + X509V3_EXT_i2d := nil; + X509V3_EXT_print := nil; + X509_check_ca := nil; + X509_check_purpose := nil; + X509_supported_extension := nil; + X509_PURPOSE_set := nil; + X509_check_issued := nil; + X509_check_akid := nil; + X509_set_proxy_flag := nil; + X509_set_proxy_pathlen := nil; + X509_get_proxy_pathlen := nil; + X509_get_extension_flags := nil; + X509_get_key_usage := nil; + X509_get_extended_key_usage := nil; + X509_get0_subject_key_id := nil; + X509_get0_authority_key_id := nil; + X509_get0_authority_serial := nil; + X509_PURPOSE_get_count := nil; + X509_PURPOSE_get0 := nil; + X509_PURPOSE_get_by_sname := nil; + X509_PURPOSE_get_by_id := nil; + X509_PURPOSE_get0_name := nil; + X509_PURPOSE_get0_sname := nil; + X509_PURPOSE_get_trust := nil; + X509_PURPOSE_cleanup := nil; + X509_PURPOSE_get_id := nil; + X509_get1_email := nil; + X509_REQ_get1_email := nil; + X509_email_free := nil; + X509_get1_ocsp := nil; + X509_check_host := nil; + X509_check_email := nil; + X509_check_ip := nil; + X509_check_ip_asc := nil; + a2i_IPADDRESS := nil; + a2i_IPADDRESS_NC := nil; + X509_POLICY_NODE_print := nil; + X509v3_addr_get_range := nil; + X509v3_asid_validate_path := nil; + X509v3_addr_validate_path := nil; + NAMING_AUTHORITY_get0_authorityId := nil; + NAMING_AUTHORITY_get0_authorityURL := nil; + NAMING_AUTHORITY_get0_authorityText := nil; + NAMING_AUTHORITY_set0_authorityId := nil; + NAMING_AUTHORITY_set0_authorityURL := nil; + NAMING_AUTHORITY_set0_authorityText := nil; + ADMISSION_SYNTAX_get0_admissionAuthority := nil; + ADMISSION_SYNTAX_set0_admissionAuthority := nil; + ADMISSIONS_get0_admissionAuthority := nil; + ADMISSIONS_set0_admissionAuthority := nil; + ADMISSIONS_get0_namingAuthority := nil; + ADMISSIONS_set0_namingAuthority := nil; + PROFESSION_INFO_get0_addProfessionInfo := nil; + PROFESSION_INFO_set0_addProfessionInfo := nil; + PROFESSION_INFO_get0_namingAuthority := nil; + PROFESSION_INFO_set0_namingAuthority := nil; + PROFESSION_INFO_get0_registrationNumber := nil; + PROFESSION_INFO_set0_registrationNumber := nil; +end; +{$ELSE} +{$ENDIF} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +initialization + Register_SSLLoader(@Load,'LibCrypto'); + Register_SSLUnloader(@Unload); +{$ENDIF} +end. diff --git a/IdOpenSSLRegister.dcr b/IdOpenSSLRegister.dcr new file mode 100644 index 0000000..33a8357 Binary files /dev/null and b/IdOpenSSLRegister.dcr differ diff --git a/IdOpenSSL_FIPS.pas b/IdOpenSSL_FIPS.pas new file mode 100644 index 0000000..21213d7 --- /dev/null +++ b/IdOpenSSL_FIPS.pas @@ -0,0 +1,436 @@ +unit IdOpenSSL_FIPS; + +interface + +implementation +uses + IdCTypes, + IdFIPS, + IdGlobal, + IdSSLOpenSSLExceptionHandlers, + IdOpenSSLHeaders_crypto, + IdOpenSSLHeaders_evp, + IdOpenSSLHeaders_hmac, + IdOpenSSLHeaders_ossl_typ, + IdSSLOpenSSLLoader; + +//**************** FIPS Support backend ******************* +function OpenSSLIsHashingIntfAvail : Boolean; +begin + Result := Assigned(EVP_DigestInit_ex) and + Assigned(EVP_DigestUpdate) and + Assigned(EVP_DigestFinal_ex) ; +end; + +function OpenSSLGetFIPSMode : Boolean; +begin + Result := FIPS_mode <> 0; +end; + +function OpenSSLSetFIPSMode(const AMode : Boolean) : Boolean; +begin + //leave this empty as we may not be using something that supports FIPS + if AMode then begin + Result := FIPS_mode_set(1) = 1; + end else begin + Result := FIPS_mode_set(0) = 1; + end; +end; + +function OpenSSLGetDigestCtx( AInst : PEVP_MD) : TIdHashIntCtx; + {$IFDEF USE_INLINE} inline; {$ENDIF} +var LRet : Integer; +begin + Result := AllocMem(SizeOf(EVP_MD_CTX)); + EVP_MD_CTX_init(Result); + + LRet := EVP_DigestInit_ex(Result, AInst, nil); + if LRet <> 1 then begin + EIdDigestInitEx.RaiseException('EVP_DigestInit_ex error'); + end; +end; + +function OpenSSLIsMD2HashIntfAvail: Boolean; +begin + {$IFDEF OPENSSL_NO_MD2} + Result := False; + {$ELSE} + Result := Assigned(EVP_md2); + {$ENDIF} +end; + +function OpenSSLGetMD2HashInst : TIdHashIntCtx; +{$IFNDEF OPENSSL_NO_MD2} +var + LRet : PEVP_MD; +{$ENDIF} +begin + {$IFDEF OPENSSL_NO_MD2} + Result := nil; + {$ELSE} + LRet := EVP_md2; + Result := OpenSSLGetDigestCtx(LRet); + {$ENDIF} +end; + +function OpenSSLIsMD4HashIntfAvail: Boolean; +begin + Result := Assigned(EVP_md4); +end; + +function OpenSSLGetMD4HashInst : TIdHashIntCtx; +var + LRet : PEVP_MD; +begin + LRet := EVP_md4; + Result := OpenSSLGetDigestCtx(LRet); +end; + +function OpenSSLIsMD5HashIntfAvail: Boolean; +begin + Result := Assigned(EVP_md5); +end; + +function OpenSSLGetMD5HashInst : TIdHashIntCtx; +var + LRet : PEVP_MD; +begin + LRet := EVP_md5; + Result := OpenSSLGetDigestCtx(LRet); +end; + +function OpenSSLIsSHA1HashIntfAvail: Boolean; +begin + {$IFDEF OPENSSL_NO_SHA} + Result := False; + {$ELSE} + Result := Assigned(EVP_sha1); + {$ENDIF} +end; + +function OpenSSLGetSHA1HashInst : TIdHashIntCtx; +{$IFNDEF OPENSSL_NO_SHA} +var + LRet : PEVP_MD; +{$ENDIF} +begin + {$IFDEF OPENSSL_NO_SHA} + Result := nil; + {$ELSE} + LRet := EVP_sha1; + Result := OpenSSLGetDigestCtx(LRet); + {$ENDIF} +end; + +function OpenSSLIsSHA224HashIntfAvail: Boolean; +begin + {$IFDEF OPENSSL_NO_SHA256} + Result := False; + {$ELSE} + Result := Assigned(EVP_sha224); + {$ENDIF} +end; + +function OpenSSLGetSHA224HashInst : TIdHashIntCtx; +{$IFNDEF OPENSSL_NO_SHA256} +var + LRet : PEVP_MD; +{$ENDIF} +begin + {$IFDEF OPENSSL_NO_SHA256} + Result := nil; + {$ELSE} + LRet := EVP_sha224; + Result := OpenSSLGetDigestCtx(LRet); + {$ENDIF} +end; + +function OpenSSLIsSHA256HashIntfAvail: Boolean; +begin + {$IFDEF OPENSSL_NO_SHA256} + Result := False; + {$ELSE} + Result := Assigned(EVP_sha256); + {$ENDIF} +end; + +function OpenSSLGetSHA256HashInst : TIdHashIntCtx; +{$IFNDEF OPENSSL_NO_SHA256} +var + LRet : PEVP_MD; +{$ENDIF} +begin + {$IFDEF OPENSSL_NO_SHA256} + Result := nil; + {$ELSE} + LRet := EVP_sha256; + Result := OpenSSLGetDigestCtx(LRet); + {$ENDIF} +end; + +function OpenSSLIsSHA384HashIntfAvail: Boolean; +begin + {$IFDEF OPENSSL_NO_SHA512} + Result := False; + {$ELSE} + Result := Assigned(EVP_sha384); + {$ENDIF} +end; + +function OpenSSLGetSHA384HashInst : TIdHashIntCtx; +{$IFNDEF OPENSSL_NO_SHA512} +var + LRet : PEVP_MD; +{$ENDIF} +begin + {$IFDEF OPENSSL_NO_SHA512} + Result := nil; + {$ELSE} + LRet := EVP_sha384; + Result := OpenSSLGetDigestCtx(LRet); + {$ENDIF} +end; + +function OpenSSLIsSHA512HashIntfAvail: Boolean; +begin + {$IFDEF OPENSSL_NO_SHA512} + Result := nil; + {$ELSE} + Result := Assigned(EVP_sha512); + {$ENDIF} +end; + +function OpenSSLGetSHA512HashInst : TIdHashIntCtx; +{$IFNDEF OPENSSL_NO_SHA512} +var + LRet : PEVP_MD; +{$ENDIF} +begin + {$IFDEF OPENSSL_NO_SHA512} + Result := nil; + {$ELSE} + LRet := EVP_sha512; + Result := OpenSSLGetDigestCtx(LRet); +{$ENDIF} +end; + +procedure OpenSSLUpdateHashInst(ACtx: TIdHashIntCtx; const AIn: TIdBytes); +var + LRet : TIdC_Int; +begin + LRet := EVP_DigestUpdate(ACtx, PByte(Ain), Length(AIn)); + if LRet <> 1 then begin + EIdDigestInitEx.RaiseException('EVP_DigestUpdate error'); + end; +end; + +function OpenSSLFinalHashInst(ACtx: TIdHashIntCtx): TIdBytes; +var + LLen : TIdC_UInt; + LRet : TIdC_Int; +begin + SetLength(Result,EVP_MAX_MD_SIZE); + LRet := EVP_DigestFinal_ex(ACtx, @Result[0], LLen); + if LRet <> 1 then begin + EIdDigestFinalEx.RaiseException('EVP_DigestFinal_ex error'); + end; + SetLength(Result,LLen); + EVP_MD_CTX_cleanup(ACtx); + FreeMem(ACtx,SizeOf(EVP_MD_CTX)); +end; + +function OpenSSLIsHMACAvail : Boolean; +begin + {$IFDEF OPENSSL_NO_HMAC} + Result := False; + {$ELSE} + Result := Assigned(HMAC_CTX_init) and + Assigned(HMAC_Init_ex) or + Assigned(HMAC_Update) or + Assigned(HMAC_Final) or + Assigned(HMAC_CTX_cleanup); + {$ENDIF} +end; + +function OpenSSLIsHMACMD5Avail: Boolean; +begin + {$IFDEF OPENSSL_NO_MD5} + Result := False; + {$ELSE} + Result := Assigned(EVP_md5); + {$ENDIF} +end; + +function OpenSSLGetHMACMD5Inst(const AKey : TIdBytes) : TIdHMACIntCtx; +begin + {$IFDEF OPENSSL_NO_MD5} + Result := nil; + {$ELSE} + Result := AllocMem(SizeOf(HMAC_CTX)); + HMAC_CTX_init(Result); + HMAC_Init_ex(Result, PByte(AKey), Length(AKey), EVP_md5, nil); + {$ENDIF} +end; + +function OpenSSLIsHMACSHA1Avail: Boolean; +begin + {$IFDEF OPENSSL_NO_SHA} + Result := False; + {$ELSE} + Result := Assigned(EVP_sha1); + {$ENDIF} +end; + +function OpenSSLGetHMACSHA1Inst(const AKey : TIdBytes) : TIdHMACIntCtx; +begin + {$IFDEF OPENSSL_NO_SHA} + Result := nil; + {$ELSE} + Result := AllocMem(SizeOf(HMAC_CTX)); + HMAC_CTX_init(Result); + HMAC_Init_ex(Result, PByte(AKey), Length(AKey), EVP_sha1, nil); + {$ENDIF} +end; + +function OpenSSLIsHMACSHA224Avail: Boolean; + +begin + {$IFDEF OPENSSL_NO_SHA256} + Result := False; + {$ELSE} + Result := Assigned(EVP_sha224); + {$ENDIF} +end; + +function OpenSSLGetHMACSHA224Inst(const AKey : TIdBytes) : TIdHMACIntCtx; +begin + {$IFDEF OPENSSL_NO_SHA256} + Result := nil; + {$ELSE} + Result := AllocMem(SizeOf(HMAC_CTX)); + HMAC_CTX_init(Result); + HMAC_Init_ex(Result, PByte(AKey), Length(AKey), EVP_sha224, nil); + {$ENDIF} +end; + +function OpenSSLIsHMACSHA256Avail: Boolean; +begin + {$IFDEF OPENSSL_NO_SHA256} + Result := False; + {$ELSE} + Result := Assigned(EVP_sha256); + {$ENDIF} +end; + +function OpenSSLGetHMACSHA256Inst(const AKey : TIdBytes) : TIdHMACIntCtx; +begin + {$IFDEF OPENSSL_NO_SHA256} + Result := nil; + {$ELSE} + Result := AllocMem(SizeOf(HMAC_CTX)); + HMAC_CTX_init(Result); + HMAC_Init_ex(Result, PByte(AKey), Length(AKey), EVP_sha256, nil); + {$ENDIF} +end; + +function OpenSSLIsHMACSHA384Avail: Boolean; +begin + {$IFDEF OPENSSL_NO_SHA512} + Result := False; + {$ELSE} + Result := Assigned(EVP_sha384); + {$ENDIF} +end; + +function OpenSSLGetHMACSHA384Inst(const AKey : TIdBytes) : TIdHMACIntCtx; +begin + {$IFDEF OPENSSL_NO_SHA512} + Result := nil; + {$ELSE} + Result := AllocMem(SizeOf(HMAC_CTX)); + HMAC_CTX_init(Result); + HMAC_Init_ex(Result, PByte(AKey), Length(AKey), EVP_sha384, nil); + {$ENDIF} +end; + +function OpenSSLIsHMACSHA512Avail: Boolean; +begin + {$IFDEF OPENSSL_NO_SHA512} + Result := False; + {$ELSE} + Result := Assigned(EVP_sha512); + {$ENDIF} +end; + +function OpenSSLGetHMACSHA512Inst(const AKey : TIdBytes) : TIdHMACIntCtx; +begin + {$IFDEF OPENSSL_NO_SHA512} + Result := nil; + {$ELSE} + Result := AllocMem(SizeOf(HMAC_CTX)); + HMAC_CTX_init(Result); + HMAC_Init_ex(Result, PByte(AKey), Length(AKey), EVP_sha512, nil); + {$ENDIF} +end; + +procedure OpenSSLUpdateHMACInst(ACtx : TIdHMACIntCtx; const AIn: TIdBytes); +begin + HMAC_Update(ACtx, PByte(AIn), Length(AIn)); +end; + +function OpenSSLFinalHMACInst(ACtx: TIdHMACIntCtx): TIdBytes; +var + LLen : TIdC_UInt; +begin + LLen := EVP_MAX_MD_SIZE; + SetLength(Result,LLen); + HMAC_Final(ACtx, @Result[0], @LLen); + SetLength(Result,LLen); + HMAC_CTX_cleanup(ACtx); + FreeMem(ACtx,SizeOf(HMAC_CTX)); +end; + +function LoadOpenSSL : Boolean; +begin + Result := GetOpenSSLLoader.Load; +end; + +initialization + SetFIPSMode := OpenSSLSetFIPSMode; + GetFIPSMode := OpenSSLGetFIPSMode; + IsHashingIntfAvail := OpenSSLIsHashingIntfAvail; + IsMD2HashIntfAvail := OpenSSLIsMD2HashIntfAvail; + GetMD2HashInst := OpenSSLGetMD2HashInst; + IsMD4HashIntfAvail := OpenSSLIsMD4HashIntfAvail; + GetMD4HashInst := OpenSSLGetMD4HashInst; + IsMD5HashIntfAvail := OpenSSLIsMD5HashIntfAvail; + GetMD5HashInst := OpenSSLGetMD5HashInst; + IsSHA1HashIntfAvail := OpenSSLIsSHA1HashIntfAvail; + GetSHA1HashInst := OpenSSLGetSHA1HashInst; + IsSHA224HashIntfAvail := OpenSSLIsSHA224HashIntfAvail; + GetSHA224HashInst := OpenSSLGetSHA224HashInst; + IsSHA256HashIntfAvail := OpenSSLIsSHA256HashIntfAvail; + GetSHA256HashInst := OpenSSLGetSHA256HashInst; + IsSHA384HashIntfAvail := OpenSSLIsSHA384HashIntfAvail; + GetSHA384HashInst := OpenSSLGetSHA384HashInst; + IsSHA512HashIntfAvail := OpenSSLIsSHA512HashIntfAvail; + GetSHA512HashInst := OpenSSLGetSHA512HashInst; + UpdateHashInst := OpenSSLUpdateHashInst; + FinalHashInst := OpenSSLFinalHashInst; + IsHMACAvail := OpenSSLIsHMACAvail; + IsHMACMD5Avail := OpenSSLIsHMACMD5Avail; + GetHMACMD5HashInst := OpenSSLGetHMACMD5Inst; + IsHMACSHA1Avail := OpenSSLIsHMACSHA1Avail; + GetHMACSHA1HashInst:= OpenSSLGetHMACSHA1Inst; + IsHMACSHA224Avail := OpenSSLIsHMACSHA224Avail; + GetHMACSHA224HashInst:= OpenSSLGetHMACSHA224Inst; + IsHMACSHA256Avail := OpenSSLIsHMACSHA256Avail; + GetHMACSHA256HashInst:= OpenSSLGetHMACSHA256Inst; + IsHMACSHA384Avail := OpenSSLIsHMACSHA384Avail; + GetHMACSHA384HashInst:= OpenSSLGetHMACSHA384Inst; + IsHMACSHA512Avail := OpenSSLIsHMACSHA512Avail; + GetHMACSHA512HashInst:= OpenSSLGetHMACSHA512Inst; + UpdateHMACInst := OpenSSLUpdateHMACInst; + FinalHMACInst := OpenSSLFinalHMACInst; + LoadHashLibrary := LoadOpenSSL; +end. diff --git a/IdRegisterOpenSSL.pas b/IdRegisterOpenSSL.pas index 5c1d811..846ab9b 100644 --- a/IdRegisterOpenSSL.pas +++ b/IdRegisterOpenSSL.pas @@ -1,93 +1,94 @@ -{ - This file is part of the Indy (Internet Direct) project, and is offered - under the dual-licensing agreement described on the Indy website. - (http://www.indyproject.org/) - - Copyright: - (c) 1993-2024, Chad Z. Hower and the Indy Pit Crew. All rights reserved. -} - -unit IdRegisterOpenSSL; - - -interface - -{$i IdCompilerDefines.inc} - -uses - Classes, - {$IFDEF DOTNET} - Borland.Vcl.Design.DesignIntF, - Borland.Vcl.Design.DesignEditors - {$ELSE} - {$IFDEF FPC} - PropEdits, - ComponentEditors - {$ELSE} - {$IFDEF VCL_6_OR_ABOVE} - DesignIntf, - DesignEditors - {$ELSE} - Dsgnintf - {$ENDIF} - {$ENDIF} - {$ENDIF} - ; - -{$IFDEF HAS_TSelectionEditor} -type - TIdOpenSSLSelectionEditor = class(TSelectionEditor) - public - procedure RequiresUnits(Proc: TGetStrProc); override; - end; -{$ENDIF} - -procedure Register; - -implementation - -uses - IdDsnCoreResourceStrings, // for RSRegIndyIOHandlers in dclIndyCore package - {$IFDEF FPC} - IdDsnResourceStrings, // for RSProt in dclIndyProtocols package - LResources, - {$ENDIF} - IdSSLOpenSSL; - -{$IFNDEF FPC} - {$R IdRegisterOpenSSL.dcr} -{$ENDIF} - -{$IFDEF HAS_TSelectionEditor} - -{TIdOpenSSLSelectionEditor} - -procedure TIdOpenSSLSelectionEditor.RequiresUnits(Proc: TGetStrProc); -begin - inherited RequiresUnits(Proc); - //for new callback event - Proc('IdCTypes'); {Do not localize} - Proc('IdSSLOpenSSLHeaders'); {Do not localize} -end; - -{$ENDIF} - -procedure Register; -begin - RegisterComponents(RSRegIndyIOHandlers{$IFDEF FPC}+RSProt{$ENDIF}, [ - TIdServerIOHandlerSSLOpenSSL, - TIdSSLIOHandlerSocketOpenSSL - ]); - - {$IFDEF HAS_TSelectionEditor} - RegisterSelectionEditor(TIdServerIOHandlerSSLOpenSSL, TIdOpenSSLSelectionEditor); - RegisterSelectionEditor(TIdSSLIOHandlerSocketOpenSSL, TIdOpenSSLSelectionEditor); - {$ENDIF} -end; - -{$IFDEF FPC} -initialization -{$i IdRegisterOpenSSL.lrs} -{$ENDIF} - -end. +{ + This file is part of the Indy (Internet Direct) project, and is offered + under the dual-licensing agreement described on the Indy website. + (http://www.indyproject.org/) + + Copyright: + (c) 1993-2024, Chad Z. Hower and the Indy Pit Crew. All rights reserved. +} + +unit IdRegisterOpenSSL; + + +interface + +{$i IdCompilerDefines.inc} + +uses + Classes, + {$IFDEF DOTNET} + Borland.Vcl.Design.DesignIntF, + Borland.Vcl.Design.DesignEditors + {$ELSE} + {$IFDEF FPC} + PropEdits, + ComponentEditors + {$ELSE} + {$IFDEF VCL_6_OR_ABOVE} + DesignIntf, + DesignEditors + {$ELSE} + Dsgnintf + {$ENDIF} + {$ENDIF} + {$ENDIF} + ; + +{$IFDEF HAS_TSelectionEditor} +type + TIdOpenSSLSelectionEditor = class(TSelectionEditor) + public + procedure RequiresUnits(Proc: TGetStrProc); override; + end; +{$ENDIF} + +procedure Register; + +implementation + +uses + IdDsnCoreResourceStrings, // for RSRegIndyIOHandlers in dclIndyCore package + {$IFDEF FPC} + IdDsnResourceStrings, // for RSProt in dclIndyProtocols package + LResources, + {$ENDIF} + IdSSLOpenSSL; + +{$IFNDEF FPC} + {$R IdRegisterOpenSSL.dcr} +{$ENDIF} + +{$IFDEF HAS_TSelectionEditor} + +{TIdOpenSSLSelectionEditor} + +procedure TIdOpenSSLSelectionEditor.RequiresUnits(Proc: TGetStrProc); +begin + inherited RequiresUnits(Proc); + //for new callback event + Proc('IdCTypes'); {Do not localize} + Proc('IdOpenSSLHeaders_ossl_typ'); {Do not localize} + Proc('IdSSLOpenSSL_X509'); +end; + +{$ENDIF} + +procedure Register; +begin + RegisterComponents(RSRegIndyIOHandlers{$IFDEF FPC}+RSProt{$ENDIF}, [ + TIdServerIOHandlerSSLOpenSSL, + TIdSSLIOHandlerSocketOpenSSL + ]); + + {$IFDEF HAS_TSelectionEditor} + RegisterSelectionEditor(TIdServerIOHandlerSSLOpenSSL, TIdOpenSSLSelectionEditor); + RegisterSelectionEditor(TIdSSLIOHandlerSocketOpenSSL, TIdOpenSSLSelectionEditor); + {$ENDIF} +end; + +{$IFDEF FPC} +initialization +{$i IdRegisterOpenSSL.lrs} +{$ENDIF} + +end. diff --git a/IdRegisterSSL.lrs b/IdRegisterSSL.lrs new file mode 100644 index 0000000..c9a9c07 --- /dev/null +++ b/IdRegisterSSL.lrs @@ -0,0 +1,55 @@ +LazarusResources.Add('TIdServerIOHandlerSSLOpenSSL','XPM',[ + '/* XPM */'#13#10'static char *Pixmap[] = {'#13#10'"24 24 16 2",'#13#10'"00 c' + +' black",'#13#10'"01 c #800000",'#13#10'"02 c #008000",'#13#10'"03 c #808000' + +'",'#13#10'"04 c #000080",'#13#10'"05 c none",'#13#10'"06 c #008080",'#13#10 + +'"07 c #808080",'#13#10'"08 c #C0C0C0",'#13#10'"09 c red",'#13#10'"10 c gree' + +'n",'#13#10'"11 c yellow",'#13#10'"12 c blue",'#13#10'"13 c magenta",'#13#10 + +'"14 c cyan",'#13#10'"15 c Gray100",'#13#10'"0505000000000000000505050505050' + +'50505050505050505",'#13#10'"05050015151515150004040404040404040404040404040' + +'5",'#13#10'"050400151414141500151515151515151515151515150404",'#13#10'"0504' + +'00151414141500151515151515151515151515150404",'#13#10'"05040015070707070015' + +'1515151515151515151515150404",'#13#10'"050400000000000000151500000000151515' + +'151515150404",'#13#10'"000000151508080800000008080808001515151515150404",' + +#13#10'"001515080808080808070000000008070715151515150404",'#13#10'"001507070' + +'707070707070015151500080015151515150404",'#13#10'"0000000000000000000000151' + +'51500080015151515150404",'#13#10'"05041515151515150008001515150008001515151' + +'5150404",'#13#10'"050415151515150000000000000000000000151515150404",'#13#10 + +'"050415151515000808080808080808080808001515150404",'#13#10'"050415151515000' + +'707070700000007070707001515150404",'#13#10'"0504151515150008080808000000080' + +'80808001515150404",'#13#10'"05041515151500070707080800080807070700151515040' + +'4",'#13#10'"050415151515000808080807000708080808001515150404",'#13#10'"0504' + +'15151515150007070807000708070700151515150404",'#13#10'"05041515151515150000' + +'0808080808000015151515150404",'#13#10'"050415151515151515150000000000151515' + +'151515150404",'#13#10'"050415151515151515151515151515151515151515150404",' + +#13#10'"050415151515151515151515151515151515151515150404",'#13#10'"050404040' + +'404040404040404040404040404040404040404",'#13#10'"0505040404040404040404040' + +'40404040404040404040405"'#13#10'};'#13#10 +]); +LazarusResources.Add('TIdSSLIOHandlerSocketOpenSSL','XPM',[ + '/* XPM */'#13#10'static char *Pixmap[] = {'#13#10'"24 24 16 2",'#13#10'"00 c' + +' black",'#13#10'"01 c #800000",'#13#10'"02 c #008000",'#13#10'"03 c #808000' + +'",'#13#10'"04 c #000080",'#13#10'"05 c none",'#13#10'"06 c #008080",'#13#10 + +'"07 c #C0C0C0",'#13#10'"08 c #808080",'#13#10'"09 c red",'#13#10'"10 c gree' + +'n",'#13#10'"11 c yellow",'#13#10'"12 c blue",'#13#10'"13 c magenta",'#13#10 + +'"14 c cyan",'#13#10'"15 c Gray100",'#13#10'"0505050505050505050505050505050' + +'50505050505050505",'#13#10'"05050404040404040404040404040404040404040404040' + +'5",'#13#10'"050415151515151515151515151515151515151515150404",'#13#10'"0504' + +'15151515151515151515151515151515151515150404",'#13#10'"05041515151515151515' + +'1515151515151515151515150404",'#13#10'"050415151515151515150000000000151515' + +'151515150404",'#13#10'"050415151515151515000707070707001515151515150404",' + +#13#10'"050415151515151508080700000007080815151515150404",'#13#10'"050415151' + +'515151500070015151500070015151515150404",'#13#10'"0504151515151515000700151' + +'51500070015151515150404",'#13#10'"05041515151515150007001515150007001515151' + +'5150404",'#13#10'"050415151515150000000000000000000000151515150404",'#13#10 + +'"050415151515000707070707070707070707001515150404",'#13#10'"050415151515000' + +'808080800000008080808001515150404",'#13#10'"0504151515150007070707000000070' + +'70707001515150404",'#13#10'"05041515151500080808070700070708080800151515040' + +'4",'#13#10'"050415151515000707070708000807070707001515150404",'#13#10'"0504' + +'15151515150008080708000807080800151515150404",'#13#10'"05041515151515150000' + +'0707070707000015151515150404",'#13#10'"050415151515151515150000000000151515' + +'151515150404",'#13#10'"050415151515151515151515151515151515151515150404",' + +#13#10'"050415151515151515151515151515151515151515150404",'#13#10'"050404040' + +'404040404040404040404040404040404040404",'#13#10'"0505040404040404040404040' + +'40404040404040404040405"'#13#10'};'#13#10 +]); + diff --git a/IdRegisterSSL.pas b/IdRegisterSSL.pas new file mode 100644 index 0000000..a0dd6f8 --- /dev/null +++ b/IdRegisterSSL.pas @@ -0,0 +1,42 @@ +unit IdRegisterSSL; + +{$i IdCompilerDefines.inc} + +interface + +uses + Classes , SysUtils, IdDsnCoreResourceStrings, IdDsnResourceStrings , + {$IFDEF FPC} + LResources, + {$ENDIF} + IdSSLOpenSSL; + +procedure Register; + +implementation + +{$IFNDEF FPC} +{$R IdOpenSSLRegister.dcr} +{$ENDIF} + +procedure Register; +begin + {$IFDEF FPC} + RegisterComponents(RSRegIndyIOHandlers+RSProt, [ + TIdServerIOHandlerSSLOpenSSL, + TIdSSLIOHandlerSocketOpenSSL + ]); + {$ELSE} + RegisterComponents(RSRegIndyIOHandlers, [ + TIdServerIOHandlerSSLOpenSSL, + TIdSSLIOHandlerSocketOpenSSL + ]); + {$ENDIF} +end; + +{$IFDEF FPC} +initialization +{$i IdRegisterSSL.lrs} +{$ENDIF} +end. + diff --git a/IdResourceStringsOpenSSL.pas b/IdResourceStringsOpenSSL.pas index b6bc296..8a38177 100644 --- a/IdResourceStringsOpenSSL.pas +++ b/IdResourceStringsOpenSSL.pas @@ -1,35 +1,68 @@ -unit IdResourceStringsOpenSSL; - -interface - -resourcestring - {IdOpenSSL} - RSOSSFailedToLoad = 'Failed to load %s.'; - RSOSSFailedToLoad_WithErrCode = 'Failed to load %s (error #%d).'; - RSOSSMissingExport_WithErrCode = '%s (error #%d)'; - RSOSSUnsupportedVersion = 'Unsupported SSL Library version: %.8x.'; - RSOSSUnsupportedLibrary = 'Unsupported SSL Library: %s.'; - RSOSSLModeNotSet = 'Mode has not been set.'; - RSOSSLCouldNotLoadSSLLibrary = 'Could not load SSL library.'; - RSOSSLStatusString = 'SSL status: "%s"'; - RSOSSLConnectionDropped = 'SSL connection has dropped.'; - RSOSSLCertificateLookup = 'SSL certificate request error.'; - RSOSSLInternal = 'SSL library internal error.'; - //callback where strings - RSOSSLAlert = '%s Alert'; - RSOSSLReadAlert = '%s Read Alert'; - RSOSSLWriteAlert = '%s Write Alert'; - RSOSSLAcceptLoop = 'Accept Loop'; - RSOSSLAcceptError = 'Accept Error'; - RSOSSLAcceptFailed = 'Accept Failed'; - RSOSSLAcceptExit = 'Accept Exit'; - RSOSSLConnectLoop = 'Connect Loop'; - RSOSSLConnectError = 'Connect Error'; - RSOSSLConnectFailed = 'Connect Failed'; - RSOSSLConnectExit = 'Connect Exit'; - RSOSSLHandshakeStart = 'Handshake Start'; - RSOSSLHandshakeDone = 'Handshake Done'; - -implementation - -end. +{******************************************************************************} +{ } +{ Indy (Internet Direct) - Internet Protocols Simplified } +{ } +{ https://www.indyproject.org/ } +{ https://gitter.im/IndySockets/Indy } +{ } +{******************************************************************************} +{ } +{ This file is part of the Indy (Internet Direct) project, and is offered } +{ under the dual-licensing agreement described on the Indy website. } +{ (https://www.indyproject.org/license/) } +{ } +{ Copyright: } +{ (c) 1993-2020, Chad Z. Hower and the Indy Pit Crew. All rights reserved. } +{ } +{******************************************************************************} +{ } +{ Originally written by: Fabian S. Biehn } +{ fbiehn@aagon.com (German & English) } +{ } +{ Contributers: } +{ Here could be your name } +{ } +{******************************************************************************} +unit IdResourceStringsOpenSSL; + +interface + +resourcestring + {IdOpenSSL} + RSOSSFailedToLoad = 'Failed to load %s.'; + RSOSSFailedToLoad_WithErrCode = 'Failed to load %s (error #%d).'; + RSOSSMissingExport_WithErrCode = '%s (error #%d)'; + RSOSSUnsupportedVersion = 'Unsupported SSL Library version: %.8x.'; + RSOSSUnsupportedLibrary = 'Unsupported SSL Library: %s.'; + RSOSSLModeNotSet = 'Mode has not been set.'; + RSOSSLCouldNotLoadSSLLibrary = 'Could not load SSL library.'; + RSOSSLStatusString = 'SSL status: "%s"'; + RSOSSLConnectionDropped = 'SSL connection has dropped.'; + RSOSSLCertificateLookup = 'SSL certificate request error.'; + RSOSSLInternal = 'SSL library internal error.'; + ROSSLCantGetSSLVersionNo = 'Unable to determine SSL Library Version number'; + ROSSLAPIFunctionNotPresent = 'OpenSSL API Function/Procedure %s not found in SSL Library'; + ROSUnrecognisedLibName = 'Unrecognised SSL Library name (%s)'; + ROSCertificateNotAddedToStore = 'Unable to add X.509 Certificate to cert store'; + ROSUnsupported = 'Not Supported'; + //callback where strings + RSOSSLAlert = '%s Alert'; + RSOSSLReadAlert = '%s Read Alert'; + RSOSSLWriteAlert = '%s Write Alert'; + RSOSSLAcceptLoop = 'Accept Loop'; + RSOSSLAcceptError = 'Accept Error'; + RSOSSLAcceptFailed = 'Accept Failed'; + RSOSSLAcceptExit = 'Accept Exit'; + RSOSSLConnectLoop = 'Connect Loop'; + RSOSSLConnectError = 'Connect Error'; + RSOSSLConnectFailed = 'Connect Failed'; + RSOSSLConnectExit = 'Connect Exit'; + RSOSSLHandshakeStart = 'Handshake Start'; + RSOSSLHandshakeDone = 'Handshake Done'; + {IdSSLOpenSSLFIPS} + RSOSSLEVPDigestExError = 'EVP_DigestInit_ex error'; + RSOSSLEVPDigestUpdateError = 'EVP_DigestUpdate error'; + +implementation + +end. diff --git a/IdSSLOpenSSL.pas b/IdSSLOpenSSL.pas index 05c8224..2bbcde9 100644 --- a/IdSSLOpenSSL.pas +++ b/IdSSLOpenSSL.pas @@ -1,4154 +1,2924 @@ -{ - This file is part of the Indy (Internet Direct) project, and is offered - under the dual-licensing agreement described on the Indy website. - (http://www.indyproject.org/) - - Copyright: - (c) 1993-2024, Chad Z. Hower and the Indy Pit Crew. All rights reserved. -} -unit IdSSLOpenSSL; -{ - Author: Gregor Ibic (gregor.ibic@intelicom.si) - Copyright: (c) Gregor Ibic, Intelicom d.o.o and Indy Working Group. -} - -{ - Indy OpenSSL now uses the standard OpenSSL libraries - for pre-compiled win32 dlls, see: - http://www.openssl.org/related/binaries.html - recommended v0.9.8a or later -} - -{ - Important information concerning OnVerifyPeer: - Rev 1.39 of February 2005 deliberately broke the OnVerifyPeer interface, - which (obviously?) only affects programs that implemented that callback - as part of the SSL negotiation. Note that you really should always - implement OnVerifyPeer, otherwise the certificate of the peer you are - connecting to is NOT checked to ensure it is valid. - - Prior to this, if the SSL library detected a problem with a certificate - or the Depth was insufficient (i.e. the "Ok" parameter in VerifyCallback - is 0 / FALSE), then irrespective of whether your OnVerifyPeer returned True - or False, the SSL connection would be deliberately failed. - - This created a problem in that even if there was only a very minor - problem with one of the certificates in the chain (OnVerifyPeer is called - once for each certificate in the certificate chain), which the user may - have been happy to accept, the SSL negotiation would be failed. However, - changing the code to allow the SSL connection when a user returned True - for OnVerifyPeer would have meant that existing code which depended on - automatic rejection of invalid certificates would then be accepting - invalid certificates, which would have been an unacceptable security - change. - - Consequently, OnVerifyPeer was changed to deliberately break existing code - by adding an AOk parameter. To preserve the previous functionality, your - OnVerifyPeer event should do "Result := AOk;". If you wish to consider - accepting certificates that the SSL library has considered invalid, then - in your OnVerifyPeer, make sure you satisfy yourself that the certificate - really is valid and then set Result to True. In reality, in addition to - checking AOk, you should always implement code that ensures you are only - accepting certificates which are valid (at least from your point of view). - - Ciaran Costelloe, ccostelloe@flogas.ie -} -{ -RLebeau 1/12/2011: Breaking OnVerifyPeer event again, this time to add an -additional AError parameter (patch courtesy of "jvlad", dmda@yandex.ru). -This helps user code distinquish between Self-signed and invalid certificates. -} - -interface - -{$I IdCompilerDefines.inc} - -{$TYPEDADDRESS OFF} - -uses - //facilitate inlining only. - {$IFDEF WINDOWS} - Windows, - {$ENDIF} - Classes, - IdBuffer, - IdCTypes, - IdGlobal, - IdException, - IdStackConsts, - IdSocketHandle, - IdSSLOpenSSLHeaders, - IdComponent, - IdIOHandler, - IdGlobalProtocols, - IdTCPServer, - IdThread, - IdTCPConnection, - IdIntercept, - IdIOHandlerSocket, - IdSSL, - IdSocks, - IdScheduler, - IdYarn; - -type - TIdSSLVersion = (sslvSSLv2, sslvSSLv23, sslvSSLv3, sslvTLSv1,sslvTLSv1_1,sslvTLSv1_2); - TIdSSLVersions = set of TIdSSLVersion; - TIdSSLMode = (sslmUnassigned, sslmClient, sslmServer, sslmBoth); - TIdSSLVerifyMode = (sslvrfPeer, sslvrfFailIfNoPeerCert, sslvrfClientOnce); - TIdSSLVerifyModeSet = set of TIdSSLVerifyMode; - TIdSSLCtxMode = (sslCtxClient, sslCtxServer); - TIdSSLAction = (sslRead, sslWrite); - -const - DEF_SSLVERSION = sslvTLSv1; - DEF_SSLVERSIONS = [sslvTLSv1]; - P12_FILETYPE = 3; - MAX_SSL_PASSWORD_LENGTH = 128; - -type - TIdSSLULong = packed record - case Byte of - 0: (B1, B2, B3, B4: UInt8); - 1: (W1, W2: UInt16); - 2: (L1: Int32); - 3: (C1: UInt32); - end; - - TIdSSLEVP_MD = record - Length: TIdC_UINT; - MD: Array [0 .. EVP_MAX_MD_SIZE - 1] of TIdAnsiChar; - end; - - TIdSSLByteArray = record - Length: TIdC_UINT; - Data: PByte; - end; - - TIdX509 = class; - TIdSSLIOHandlerSocketOpenSSL = class; - TIdSSLCipher = class; - TCallbackEvent = procedure(const AMsg: String) of object; - TCallbackExEvent = procedure(ASender : TObject; const AsslSocket: PSSL; - const AWhere, Aret: TIdC_INT; const AType, AMsg : String ) of object; - TPasswordEvent = procedure(var Password: String) of object; - TPasswordEventEx = procedure( ASender : TObject; var VPassword: String; const AIsWrite : Boolean) of object; - TVerifyPeerEvent = function(Certificate: TIdX509; AOk: Boolean; ADepth, AError: Integer): Boolean of object; - TIOHandlerNotify = procedure(ASender: TIdSSLIOHandlerSocketOpenSSL) of object; - - TIdSSLOptions = class(TPersistent) - protected - fsRootCertFile, - fsCertFile, - fsKeyFile, - fsDHParamsFile: String; - fMethod: TIdSSLVersion; - fSSLVersions : TIdSSLVersions; - fMode: TIdSSLMode; - fVerifyDepth: Integer; - fVerifyMode: TIdSSLVerifyModeSet; - //fVerifyFile, - fVerifyDirs: String; - fCipherList: String; - procedure AssignTo(Destination: TPersistent); override; - procedure SetSSLVersions(const AValue : TIdSSLVersions); - procedure SetMethod(const AValue : TIdSSLVersion); - public - constructor Create; - // procedure Assign(ASource: TPersistent); override; - published - property RootCertFile: String read fsRootCertFile write fsRootCertFile; - property CertFile: String read fsCertFile write fsCertFile; - property KeyFile: String read fsKeyFile write fsKeyFile; - property DHParamsFile: String read fsDHParamsFile write fsDHParamsFile; - property Method: TIdSSLVersion read fMethod write SetMethod default DEF_SSLVERSION; - property SSLVersions : TIdSSLVersions read fSSLVersions write SetSSLVersions default DEF_SSLVERSIONS; - property Mode: TIdSSLMode read fMode write fMode; - property VerifyMode: TIdSSLVerifyModeSet read fVerifyMode write fVerifyMode; - property VerifyDepth: Integer read fVerifyDepth write fVerifyDepth; -// property VerifyFile: String read fVerifyFile write fVerifyFile; - property VerifyDirs: String read fVerifyDirs write fVerifyDirs; - property CipherList: String read fCipherList write fCipherList; - end; - - TIdSSLContext = class(TObject) - protected - fMethod: TIdSSLVersion; - fSSLVersions : TIdSSLVersions; - fMode: TIdSSLMode; - fsRootCertFile, fsCertFile, fsKeyFile, fsDHParamsFile: String; - fVerifyDepth: Integer; - fVerifyMode: TIdSSLVerifyModeSet; -// fVerifyFile: String; - fVerifyDirs: String; - fCipherList: String; - fContext: PSSL_CTX; - fStatusInfoOn: Boolean; -// fPasswordRoutineOn: Boolean; - fVerifyOn: Boolean; - fSessionId: Integer; - fCtxMode: TIdSSLCtxMode; - procedure DestroyContext; - function SetSSLMethod: PSSL_METHOD; - procedure SetVerifyMode(Mode: TIdSSLVerifyModeSet; CheckRoutine: Boolean); - function GetVerifyMode: TIdSSLVerifyModeSet; - procedure InitContext(CtxMode: TIdSSLCtxMode); - public - {$IFDEF USE_OBJECT_ARC}[Weak]{$ENDIF} Parent: TObject; - constructor Create; - destructor Destroy; override; - function Clone : TIdSSLContext; - function LoadRootCert: Boolean; - function LoadCert: Boolean; - function LoadKey: Boolean; - function LoadDHParams: Boolean; - property StatusInfoOn: Boolean read fStatusInfoOn write fStatusInfoOn; -// property PasswordRoutineOn: Boolean read fPasswordRoutineOn write fPasswordRoutineOn; - property VerifyOn: Boolean read fVerifyOn write fVerifyOn; -//THese can't be published in a TObject without a compiler warning. - // published - property SSLVersions : TIdSSLVersions read fSSLVersions write fSSLVersions; - property Method: TIdSSLVersion read fMethod write fMethod; - property Mode: TIdSSLMode read fMode write fMode; - property RootCertFile: String read fsRootCertFile write fsRootCertFile; - property CertFile: String read fsCertFile write fsCertFile; - property CipherList: String read fCipherList write fCipherList; - property KeyFile: String read fsKeyFile write fsKeyFile; - property DHParamsFile: String read fsDHParamsFile write fsDHParamsFile; -// property VerifyMode: TIdSSLVerifyModeSet read GetVerifyMode write SetVerifyMode; -// property VerifyFile: String read fVerifyFile write fVerifyFile; - property VerifyDirs: String read fVerifyDirs write fVerifyDirs; - property VerifyMode: TIdSSLVerifyModeSet read fVerifyMode write fVerifyMode; - property VerifyDepth: Integer read fVerifyDepth write fVerifyDepth; - - end; - - TIdSSLSocket = class(TObject) - protected - {$IFDEF USE_OBJECT_ARC}[Weak]{$ENDIF} fParent: TObject; - fPeerCert: TIdX509; - fSSL: PSSL; - fSSLCipher: TIdSSLCipher; - fSSLContext: TIdSSLContext; - fHostName: String; - function GetPeerCert: TIdX509; - function GetSSLError(retCode: Integer): Integer; - function GetSSLCipher: TIdSSLCipher; - public - constructor Create(Parent: TObject); - destructor Destroy; override; - procedure Accept(const pHandle: TIdStackSocketHandle); - procedure Connect(const pHandle: TIdStackSocketHandle); - function Send(const ABuffer : TIdBytes; AOffset, ALength: Integer): Integer; - function Recv(var ABuffer : TIdBytes): Integer; - function GetSessionID: TIdSSLByteArray; - function GetSessionIDAsString:String; - procedure SetCipherList(CipherList: String); - // - property PeerCert: TIdX509 read GetPeerCert; - property Cipher: TIdSSLCipher read GetSSLCipher; - property HostName: String read fHostName; - end; - - // TIdSSLIOHandlerSocketOpenSSL and TIdServerIOHandlerSSLOpenSSL have some common - // functions, but they do not have a common ancestor, so this interface helps - // bridge the gap... - IIdSSLOpenSSLCallbackHelper = interface(IInterface) - ['{583F1209-10BA-4E06-8810-155FAEC415FE}'] - function GetPassword(const AIsWrite : Boolean): string; - procedure StatusInfo(const ASSL: PSSL; AWhere, ARet: TIdC_INT; const AStatusStr: string); - function VerifyPeer(ACertificate: TIdX509; AOk: Boolean; ADepth, AError: Integer): Boolean; - function GetIOHandlerSelf: TIdSSLIOHandlerSocketOpenSSL; - end; - - TIdSSLIOHandlerSocketOpenSSL = class(TIdSSLIOHandlerSocketBase, IIdSSLOpenSSLCallbackHelper) - protected - fSSLContext: TIdSSLContext; - fxSSLOptions: TIdSSLOptions; - fSSLSocket: TIdSSLSocket; - //fPeerCert: TIdX509; - fOnStatusInfo: TCallbackEvent; - FOnStatusInfoEx : TCallbackExEvent; - fOnGetPassword: TPasswordEvent; - fOnGetPasswordEx : TPasswordEventEx; - fOnVerifyPeer: TVerifyPeerEvent; - fSSLLayerClosed: Boolean; - fOnBeforeConnect: TIOHandlerNotify; - // function GetPeerCert: TIdX509; - //procedure CreateSSLContext(axMode: TIdSSLMode); - // - procedure SetPassThrough(const Value: Boolean); override; - procedure DoBeforeConnect(ASender: TIdSSLIOHandlerSocketOpenSSL); virtual; - procedure DoStatusInfo(const AMsg: String); virtual; - procedure DoStatusInfoEx(const AsslSocket: PSSL; - const AWhere, Aret: TIdC_INT; const AWhereStr, ARetStr : String ); - procedure DoGetPassword(var Password: String); virtual; - procedure DoGetPasswordEx(var VPassword: String; const AIsWrite : Boolean); virtual; - - function DoVerifyPeer(Certificate: TIdX509; AOk: Boolean; ADepth, AError: Integer): Boolean; virtual; - function RecvEnc(var VBuffer: TIdBytes): Integer; override; - function SendEnc(const ABuffer: TIdBytes; const AOffset, ALength: Integer): Integer; override; - procedure Init; - procedure OpenEncodedConnection; virtual; - //some overrides from base classes - procedure InitComponent; override; - procedure ConnectClient; override; - function CheckForError(ALastResult: Integer): Integer; override; - procedure RaiseError(AError: Integer); override; - - { IIdSSLOpenSSLCallbackHelper } - function GetPassword(const AIsWrite : Boolean): string; - procedure StatusInfo(const ASslSocket: PSSL; AWhere, ARet: TIdC_INT; const AStatusStr: string); - function VerifyPeer(ACertificate: TIdX509; AOk: Boolean; ADepth, AError: Integer): Boolean; - function GetIOHandlerSelf: TIdSSLIOHandlerSocketOpenSSL; - - public - destructor Destroy; override; - // TODO: add an AOwner parameter - function Clone : TIdSSLIOHandlerSocketBase; override; - procedure StartSSL; override; - procedure AfterAccept; override; - procedure Close; override; - procedure Open; override; - function Readable(AMSec: Integer = IdTimeoutDefault): Boolean; override; - property SSLSocket: TIdSSLSocket read fSSLSocket write fSSLSocket; - property OnBeforeConnect: TIOHandlerNotify read fOnBeforeConnect write fOnBeforeConnect; - property SSLContext: TIdSSLContext read fSSLContext write fSSLContext; - published - property SSLOptions: TIdSSLOptions read fxSSLOptions write fxSSLOptions; - property OnStatusInfo: TCallbackEvent read fOnStatusInfo write fOnStatusInfo; - property OnStatusInfoEx: TCallbackExEvent read fOnStatusInfoEx write fOnStatusInfoEx; - property OnGetPassword: TPasswordEvent read fOnGetPassword write fOnGetPassword; - property OnGetPasswordEx : TPasswordEventEx read fOnGetPasswordEx write fOnGetPasswordEx; - property OnVerifyPeer: TVerifyPeerEvent read fOnVerifyPeer write fOnVerifyPeer; - end; - - TIdServerIOHandlerSSLOpenSSL = class(TIdServerIOHandlerSSLBase, IIdSSLOpenSSLCallbackHelper) - protected - fxSSLOptions: TIdSSLOptions; - fSSLContext: TIdSSLContext; - fOnStatusInfo: TCallbackEvent; - FOnStatusInfoEx : TCallbackExEvent; - fOnGetPassword: TPasswordEvent; - fOnGetPasswordEx : TPasswordEventEx; - fOnVerifyPeer: TVerifyPeerEvent; - // - //procedure CreateSSLContext(axMode: TIdSSLMode); - //procedure CreateSSLContext; - // - procedure DoStatusInfo(const AMsg: String); virtual; - procedure DoStatusInfoEx(const AsslSocket: PSSL; - const AWhere, Aret: TIdC_INT; const AWhereStr, ARetStr : String ); - procedure DoGetPassword(var Password: String); virtual; -//TPasswordEventEx - procedure DoGetPasswordEx(var VPassword: String; const AIsWrite : Boolean); virtual; - function DoVerifyPeer(Certificate: TIdX509; AOk: Boolean; ADepth, AError: Integer): Boolean; virtual; - procedure InitComponent; override; - - { IIdSSLOpenSSLCallbackHelper } - function GetPassword(const AIsWrite : Boolean): string; - procedure StatusInfo(const ASslSocket: PSSL; AWhere, ARet: TIdC_INT; const AStatusStr: string); - function VerifyPeer(ACertificate: TIdX509; AOk: Boolean; ADepth, AError: Integer): Boolean; - function GetIOHandlerSelf: TIdSSLIOHandlerSocketOpenSSL; - - public - procedure Init; override; - procedure Shutdown; override; - // AListenerThread is a thread and not a yarn. Its the listener thread. - function Accept(ASocket: TIdSocketHandle; AListenerThread: TIdThread; - AYarn: TIdYarn): TIdIOHandler; override; -// function Accept(ASocket: TIdSocketHandle; AThread: TIdThread) : TIdIOHandler; override; - destructor Destroy; override; - function MakeClientIOHandler : TIdSSLIOHandlerSocketBase; override; - // - function MakeFTPSvrPort : TIdSSLIOHandlerSocketBase; override; - function MakeFTPSvrPasv : TIdSSLIOHandlerSocketBase; override; - // - property SSLContext: TIdSSLContext read fSSLContext; - published - property SSLOptions: TIdSSLOptions read fxSSLOptions write fxSSLOptions; - property OnStatusInfo: TCallbackEvent read fOnStatusInfo write fOnStatusInfo; - property OnStatusInfoEx: TCallbackExEvent read fOnStatusInfoEx write fOnStatusInfoEx; - property OnGetPassword: TPasswordEvent read fOnGetPassword write fOnGetPassword; - property OnGetPasswordEx : TPasswordEventEx read fOnGetPasswordEx write fOnGetPasswordEx; - property OnVerifyPeer: TVerifyPeerEvent read fOnVerifyPeer write fOnVerifyPeer; - end; - - TIdX509Name = class(TObject) - protected - fX509Name: PX509_NAME; - function CertInOneLine: String; - function GetHash: TIdSSLULong; - function GetHashAsString: String; - public - constructor Create(aX509Name: PX509_NAME); - // - property Hash: TIdSSLULong read GetHash; - property HashAsString: string read GetHashAsString; - property OneLine: string read CertInOneLine; - // - property CertificateName: PX509_NAME read fX509Name; - end; - - TIdX509Info = class(TObject) - protected - //Do not free this here because it belongs - //to the X509 or something else. - FX509 : PX509; - public - constructor Create( aX509: PX509); - // - property Certificate: PX509 read FX509; - end; - - TIdX509Fingerprints = class(TIdX509Info) - protected - function GetMD5: TIdSSLEVP_MD; - function GetMD5AsString:String; - function GetSHA1: TIdSSLEVP_MD; - function GetSHA1AsString:String; - function GetSHA224 : TIdSSLEVP_MD; - function GetSHA224AsString : String; - function GetSHA256 : TIdSSLEVP_MD; - function GetSHA256AsString : String; - function GetSHA384 : TIdSSLEVP_MD; - function GetSHA384AsString : String; - function GetSHA512 : TIdSSLEVP_MD; - function GetSHA512AsString : String; - public - property MD5 : TIdSSLEVP_MD read GetMD5; - property MD5AsString : String read GetMD5AsString; -{IMPORTANT!!! - -FIPS approves only these algorithms for hashing. -SHA-1 -SHA-224 -SHA-256 -SHA-384 -SHA-512 - -http://csrc.nist.gov/CryptoToolkit/tkhash.html -} - property SHA1 : TIdSSLEVP_MD read GetSHA1; - property SHA1AsString : String read GetSHA1AsString; - property SHA224 : TIdSSLEVP_MD read GetSHA224; - property SHA224AsString : String read GetSHA224AsString; - property SHA256 : TIdSSLEVP_MD read GetSHA256; - property SHA256AsString : String read GetSHA256AsString; - property SHA384 : TIdSSLEVP_MD read GetSHA384; - property SHA384AsString : String read GetSHA384AsString; - property SHA512 : TIdSSLEVP_MD read GetSHA512; - property SHA512AsString : String read GetSHA512AsString; - end; - - TIdX509SigInfo = class(TIdX509Info) - protected - function GetSignature : String; - function GetSigType : TIdC_INT; - function GetSigTypeAsString : String; - public - property Signature : String read GetSignature; - property SigType : TIdC_INT read GetSigType ; - property SigTypeAsString : String read GetSigTypeAsString; - end; - - TIdX509 = class(TObject) - protected - FFingerprints : TIdX509Fingerprints; - FSigInfo : TIdX509SigInfo; - FCanFreeX509 : Boolean; - FX509 : PX509; - FSubject : TIdX509Name; - FIssuer : TIdX509Name; - FDisplayInfo : TStrings; - function RSubject:TIdX509Name; - function RIssuer:TIdX509Name; - function RnotBefore:TDateTime; - function RnotAfter:TDateTime; - function RFingerprint:TIdSSLEVP_MD; - function RFingerprintAsString:String; - function GetSerialNumber: String; - function GetVersion : TIdC_LONG; - function GetDisplayInfo : TStrings; - public - Constructor Create(aX509: PX509; aCanFreeX509: Boolean = True); virtual; - Destructor Destroy; override; - property Version : TIdC_LONG read GetVersion; - // - property SigInfo : TIdX509SigInfo read FSigInfo; - property Fingerprints : TIdX509Fingerprints read FFingerprints; - // - property Fingerprint: TIdSSLEVP_MD read RFingerprint; - property FingerprintAsString: String read RFingerprintAsString; - property Subject: TIdX509Name read RSubject; - property Issuer: TIdX509Name read RIssuer; - property notBefore: TDateTime read RnotBefore; - property notAfter: TDateTime read RnotAfter; - property SerialNumber : string read GetSerialNumber; - property DisplayInfo : TStrings read GetDisplayInfo; - // - property Certificate: PX509 read FX509; - end; - - TIdSSLCipher = class(TObject) - protected - FSSLSocket: TIdSSLSocket; - function GetDescription: String; - function GetName: String; - function GetBits: Integer; - function GetVersion: String; - public - constructor Create(AOwner: TIdSSLSocket); - destructor Destroy; override; - //These can't be published without a compiler warning. - // published - property Description: String read GetDescription; - property Name: String read GetName; - property Bits: Integer read GetBits; - property Version: String read GetVersion; - end; - EIdOSSLCouldNotLoadSSLLibrary = class(EIdOpenSSLError); - EIdOSSLModeNotSet = class(EIdOpenSSLError); - EIdOSSLGetMethodError = class(EIdOpenSSLError); - EIdOSSLCreatingSessionError = class(EIdOpenSSLError); - EIdOSSLCreatingContextError = class(EIdOpenSSLAPICryptoError); - EIdOSSLLoadingRootCertError = class(EIdOpenSSLAPICryptoError); - EIdOSSLLoadingCertError = class(EIdOpenSSLAPICryptoError); - EIdOSSLLoadingKeyError = class(EIdOpenSSLAPICryptoError); - EIdOSSLLoadingDHParamsError = class(EIdOpenSSLAPICryptoError); - EIdOSSLSettingCipherError = class(EIdOpenSSLError); - EIdOSSLFDSetError = class(EIdOpenSSLAPISSLError); - EIdOSSLDataBindingError = class(EIdOpenSSLAPISSLError); - EIdOSSLAcceptError = class(EIdOpenSSLAPISSLError); - EIdOSSLConnectError = class(EIdOpenSSLAPISSLError); - {$IFNDEF OPENSSL_NO_TLSEXT} - EIdOSSLSettingTLSHostNameError = class(EIdOpenSSLAPISSLError); - {$ENDIF} - -function LoadOpenSSLLibrary: Boolean; -procedure UnLoadOpenSSLLibrary; - -function OpenSSLVersion: string; - -implementation - -uses - {$IFDEF HAS_UNIT_Generics_Collections} - System.Generics.Collections, - {$ENDIF} - {$IFDEF USE_VCL_POSIX} - Posix.SysTime, - Posix.Time, - Posix.Unistd, - {$ENDIF} - IdFIPS, - IdResourceStringsCore, - IdResourceStringsProtocols, - IdResourceStringsOpenSSL, - IdStack, - IdStackBSDBase, - IdAntiFreezeBase, - IdExceptionCore, - IdResourceStrings, - IdThreadSafe, - IdCustomTransparentProxy, - IdURI, - SysUtils, - SyncObjs; - -type - // TODO: TIdThreadSafeObjectList instead? - {$IFDEF HAS_GENERICS_TThreadList} - TIdCriticalSectionThreadList = TThreadList; - TIdCriticalSectionList = TList; - {$ELSE} - // TODO: flesh out to match TThreadList and TList on non-Generics compilers - TIdCriticalSectionThreadList = TThreadList; - TIdCriticalSectionList = TList; - {$ENDIF} - - // RLebeau 1/24/2019: defining this as a private implementation for now to - // avoid a change in the public interface above. This should be rolled into - // the public interface at some point... - TIdSSLOptions_Internal = class(TIdSSLOptions) - public - {$IFDEF USE_OBJECT_ARC}[Weak]{$ENDIF} Parent: TObject; - end; - -var - SSLIsLoaded: TIdThreadSafeBoolean = nil; - LockInfoCB: TIdCriticalSection = nil; - LockPassCB: TIdCriticalSection = nil; - LockVerifyCB: TIdCriticalSection = nil; - CallbackLockList: TIdCriticalSectionThreadList = nil; - -procedure GetStateVars(const sslSocket: PSSL; AWhere, Aret: TIdC_INT; var VTypeStr, VMsg : String); - {$IFDEF USE_INLINE}inline;{$ENDIF} -begin - case AWhere of - SSL_CB_ALERT : - begin - VTypeStr := IndyFormat( RSOSSLAlert,[SSL_alert_type_string_long(Aret)]); - VMsg := String(SSL_alert_type_string_long(Aret)); - end; - SSL_CB_READ_ALERT : - begin - VTypeStr := IndyFormat(RSOSSLReadAlert,[SSL_alert_type_string_long(Aret)]); - VMsg := String( SSL_alert_desc_string_long(Aret)); - end; - SSL_CB_WRITE_ALERT : - begin - VTypeStr := IndyFormat(RSOSSLWriteAlert,[SSL_alert_type_string_long(Aret)]); - VMsg := String( SSL_alert_desc_string_long(Aret)); - end; - SSL_CB_ACCEPT_LOOP : - begin - VTypeStr := RSOSSLAcceptLoop; - VMsg := String( SSL_state_string_long(sslSocket)); - end; - SSL_CB_ACCEPT_EXIT : - begin - if ARet < 0 then begin - VTypeStr := RSOSSLAcceptError; - end else begin - if ARet = 0 then begin - VTypeStr := RSOSSLAcceptFailed; - end else begin - VTypeStr := RSOSSLAcceptExit; - end; - end; - VMsg := String( SSL_state_string_long(sslSocket) ); - end; - SSL_CB_CONNECT_LOOP : - begin - VTypeStr := RSOSSLConnectLoop; - VMsg := String( SSL_state_string_long(sslSocket) ); - end; - SSL_CB_CONNECT_EXIT : - begin - if ARet < 0 then begin - VTypeStr := RSOSSLConnectError; - end else begin - if ARet = 0 then begin - VTypeStr := RSOSSLConnectFailed - end else begin - VTypeStr := RSOSSLConnectExit; - end; - end; - VMsg := String( SSL_state_string_long(sslSocket) ); - end; - SSL_CB_HANDSHAKE_START : - begin - VTypeStr := RSOSSLHandshakeStart; - VMsg := String( SSL_state_string_long(sslSocket) ); - end; - SSL_CB_HANDSHAKE_DONE : - begin - VTypeStr := RSOSSLHandshakeDone; - VMsg := String( SSL_state_string_long(sslSocket) ); - end; - end; -{var LW : TIdC_INT; -begin - VMsg := ''; - LW := Awhere and (not SSL_ST_MASK); - if (LW and SSL_ST_CONNECT) > 0 then begin - VWhereStr := 'SSL_connect:'; - end else begin - if (LW and SSL_ST_ACCEPT) > 0 then begin - VWhereStr := ' SSL_accept:'; - end else begin - VWhereStr := ' undefined:'; - end; - end; -// IdSslStateStringLong - if (Awhere and SSL_CB_LOOP) > 0 then begin - VMsg := IdSslStateStringLong(sslSocket); - end else begin - if (Awhere and SSL_CB_ALERT) > 0 then begin - if (Awhere and SSL_CB_READ > 0) then begin - VWhereStr := VWhereStr + ' read:'+ IdSslAlertTypeStringLong(Aret); - end else begin - VWhereStr := VWhereStr + 'write:'+ IdSslAlertTypeStringLong(Aret); - end;; - VMsg := IdSslAlertDescStringLong(Aret); - end else begin - if (Awhere and SSL_CB_EXIT) > 0 then begin - if ARet = 0 then begin - - VWhereStr := VWhereStr +'failed'; - VMsg := IdSslStateStringLong(sslSocket); - end else begin - if ARet < 0 then begin - VWhereStr := VWhereStr +'error'; - VMsg := IdSslStateStringLong(sslSocket); - end; - end; - end; - end; - end; } -end; - -function PasswordCallback(buf: PIdAnsiChar; size: TIdC_INT; rwflag: TIdC_INT; userdata: Pointer): TIdC_INT; cdecl; -{$IFDEF USE_MARSHALLED_PTRS} -type - TBytesPtr = ^TBytes; -{$ENDIF} -var - Password: String; - {$IFDEF STRING_IS_UNICODE} - LPassword: TIdBytes; - {$ENDIF} - IdSSLContext: TIdSSLContext; - LErr : Integer; - LHelper: IIdSSLOpenSSLCallbackHelper; -begin - //Preserve last eror just in case OpenSSL is using it and we do something that - //clobers it. CYA. - LErr := GStack.WSGetLastError; - try - LockPassCB.Enter; - try - Password := ''; {Do not Localize} - IdSSLContext := TIdSSLContext(userdata); - if Supports(IdSSLContext.Parent, IIdSSLOpenSSLCallbackHelper, IInterface(LHelper)) then begin - Password := LHelper.GetPassword(rwflag > 0); - LHelper := nil; - end; - FillChar(buf^, size, 0); - {$IFDEF STRING_IS_UNICODE} - LPassword := IndyTextEncoding_OSDefault.GetBytes(Password); - if Length(LPassword) > 0 then begin - {$IFDEF USE_MARSHALLED_PTRS} - TMarshal.Copy(TBytesPtr(@LPassword)^, 0, TPtrWrapper.Create(buf), IndyMin(Length(LPassword), size)); - {$ELSE} - Move(LPassword[0], buf^, IndyMin(Length(LPassword), size)); - {$ENDIF} - end; - Result := Length(LPassword); - {$ELSE} - StrPLCopy(buf, Password, size); - Result := Length(Password); - {$ENDIF} - buf[size-1] := #0; // RLebeau: truncate the password if needed - finally - LockPassCB.Leave; - end; - finally - GStack.WSSetLastError(LErr); - end; -end; - -procedure InfoCallback(const sslSocket: PSSL; where, ret: TIdC_INT); cdecl; -var - IdSSLSocket: TIdSSLSocket; - StatusStr : String; - LErr : Integer; - LHelper: IIdSSLOpenSSLCallbackHelper; -begin -{ -You have to save the value of WSGetLastError as some Operating System API -function calls will reset that value and we can't know what a programmer will -do in this event. We need the value of WSGetLastError so we can report -an underlying socket error when the OpenSSL function returns. - -JPM. -} - LErr := GStack.WSGetLastError; - try - LockInfoCB.Enter; - try - IdSSLSocket := TIdSSLSocket(SSL_get_app_data(sslSocket)); - if Supports(IdSSLSocket.fParent, IIdSSLOpenSSLCallbackHelper, IInterface(LHelper)) then begin - StatusStr := IndyFormat(RSOSSLStatusString, [String(SSL_state_string_long(sslSocket))]); - LHelper.StatusInfo(sslSocket, where, ret, StatusStr); - LHelper := nil; - end; - finally - LockInfoCB.Leave; - end; - finally - GStack.WSSetLastError(LErr); - end; -end; - -function TranslateInternalVerifyToSSL(Mode: TIdSSLVerifyModeSet): Integer; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := SSL_VERIFY_NONE; - if sslvrfPeer in Mode then begin - Result := Result or SSL_VERIFY_PEER; - end; - if sslvrfFailIfNoPeerCert in Mode then begin - Result := Result or SSL_VERIFY_FAIL_IF_NO_PEER_CERT; - end; - if sslvrfClientOnce in Mode then begin - Result := Result or SSL_VERIFY_CLIENT_ONCE; - end; -end; - -function VerifyCallback(Ok: TIdC_INT; ctx: PX509_STORE_CTX): TIdC_INT; cdecl; -var - hcert: PX509; - Certificate: TIdX509; - hSSL: PSSL; - IdSSLSocket: TIdSSLSocket; - // str: String; - VerifiedOK: Boolean; - Depth: Integer; - Error: Integer; - LOk: Boolean; - LHelper: IIdSSLOpenSSLCallbackHelper; -begin - LockVerifyCB.Enter; - try - VerifiedOK := True; - try - hSSL := X509_STORE_CTX_get_app_data(ctx); - if hSSL = nil then begin - Result := Ok; - Exit; - end; - hcert := X509_STORE_CTX_get_current_cert(ctx); - Certificate := TIdX509.Create(hcert, False); // the certificate is owned by the store - try - IdSSLSocket := TIdSSLSocket(SSL_get_app_data(hSSL)); - Error := X509_STORE_CTX_get_error(ctx); - Depth := X509_STORE_CTX_get_error_depth(ctx); - if not ((Ok > 0) and (IdSSLSocket.fSSLContext.VerifyDepth >= Depth)) then begin - Ok := 0; - {if Error = X509_V_OK then begin - Error := X509_V_ERR_CERT_CHAIN_TOO_LONG; - end;} - end; - LOk := False; - if Ok = 1 then begin - LOk := True; - end; - if Supports(IdSSLSocket.fParent, IIdSSLOpenSSLCallbackHelper, IInterface(LHelper)) then begin - VerifiedOK := LHelper.VerifyPeer(Certificate, LOk, Depth, Error); - LHelper := nil; - end; - finally - FreeAndNil(Certificate); - end; - except - VerifiedOK := False; - end; - //if VerifiedOK and (Ok > 0) then begin - if VerifiedOK {and (Ok > 0)} then begin - Result := 1; - end - else begin - Result := 0; - end; - // Result := Ok; // testing - finally - LockVerifyCB.Leave; - end; -end; - -////////////////////////////////////////////////////// -// Utilities -////////////////////////////////////////////////////// - -function IndySSL_load_client_CA_file(const AFileName: String) : PSTACK_OF_X509_NAME; forward; -function IndySSL_CTX_use_PrivateKey_file(ctx: PSSL_CTX; const AFileName: String; - AType: Integer): TIdC_INT; forward; -function IndySSL_CTX_use_certificate_file(ctx: PSSL_CTX; const AFileName: String; - AType: Integer): TIdC_INT; forward; -function IndySSL_CTX_use_certificate_chain_file(ctx :PSSL_CTX; - const AFileName: String) : TIdC_INT; forward; - -function IndyX509_STORE_load_locations(ctx: PX509_STORE; - const AFileName, APathName: String): TIdC_INT; forward; -function IndySSL_CTX_load_verify_locations(ctx: PSSL_CTX; - const ACAFile, ACAPath: String): TIdC_INT; forward; -function IndySSL_CTX_use_DHparams_file(ctx: PSSL_CTX; - const AFileName: String; AType: Integer): TIdC_INT; forward; - -// TODO -{ -function d2i_DHparams_bio(bp: PBIO; x: PPointer): PDH; inline; -begin - Result := PDH(ASN1_d2i_bio(@DH_new, @d2i_DHparams, bp, x)); -end; -} - -// SSL_CTX_use_PrivateKey_file() and SSL_CTX_use_certificate_file() do not -// natively support PKCS12 certificates/keys, only PEM/ASN1, so load them -// manually... - -function IndySSL_CTX_use_PrivateKey_file_PKCS12(ctx: PSSL_CTX; const AFileName: String): TIdC_INT; -var - LM: TMemoryStream; - B: PBIO; - LKey: PEVP_PKEY; - LCert: PX509; - P12: PPKCS12; - CertChain: PSTACK_OF_X509; - LPassword: array of TIdAnsiChar; - LPasswordPtr: PIdAnsiChar; -begin - Result := 0; - - LM := nil; - try - LM := TMemoryStream.Create; - LM.LoadFromFile(AFileName); - except - // Surpress exception here since it's going to be called by the OpenSSL .DLL - // Follow the OpenSSL .DLL Error conventions. - SSLerr(SSL_F_SSL_CTX_USE_PRIVATEKEY_FILE, ERR_R_SYS_LIB); - LM.Free; - Exit; - end; - - try - B := BIO_new_mem_buf(LM.Memory, LM.Size); - if not Assigned(B) then begin - SSLerr(SSL_F_SSL_CTX_USE_PRIVATEKEY_FILE, ERR_R_BUF_LIB); - Exit; - end; - try - SetLength(LPassword, MAX_SSL_PASSWORD_LENGTH+1); - LPassword[MAX_SSL_PASSWORD_LENGTH] := TIdAnsiChar(0); - LPasswordPtr := PIdAnsiChar(LPassword); - if Assigned(ctx^.default_passwd_callback) then begin - ctx^.default_passwd_callback(LPasswordPtr, MAX_SSL_PASSWORD_LENGTH, 0, ctx^.default_passwd_callback_userdata); - // TODO: check return value for failure - end else begin - // TODO: call PEM_def_callback(), like PEM_read_bio_X509() does - // when default_passwd_callback is nil - end; - P12 := d2i_PKCS12_bio(B, nil); - if not Assigned(P12) then begin - SSLerr(SSL_F_SSL_CTX_USE_PRIVATEKEY_FILE, ERR_R_PKCS12_LIB); - Exit; - end; - try - CertChain := nil; - if PKCS12_parse(P12, LPasswordPtr, LKey, LCert, @CertChain) <> 1 then begin - SSLerr(SSL_F_SSL_CTX_USE_CERTIFICATE_FILE, ERR_R_PKCS12_LIB); - Exit; - end; - try - Result := SSL_CTX_use_PrivateKey(ctx, LKey); - finally - sk_pop_free(CertChain, @X509_free); - X509_free(LCert); - EVP_PKEY_free(LKey); - end; - finally - PKCS12_free(P12); - end; - finally - BIO_free(B); - end; - finally - FreeAndNil(LM); - end; -end; - -function IndySSL_CTX_use_certificate_file_PKCS12(ctx: PSSL_CTX; const AFileName: String): TIdC_INT; -var - LM: TMemoryStream; - B: PBIO; - LCert: PX509; - P12: PPKCS12; - PKey: PEVP_PKEY; - CertChain: PSTACK_OF_X509; - LPassword: array of TIdAnsiChar; - LPasswordPtr: PIdAnsiChar; -begin - Result := 0; - - LM := nil; - try - LM := TMemoryStream.Create; - LM.LoadFromFile(AFileName); - except - // Surpress exception here since it's going to be called by the OpenSSL .DLL - // Follow the OpenSSL .DLL Error conventions. - SSLerr(SSL_F_SSL_CTX_USE_CERTIFICATE_FILE, ERR_R_SYS_LIB); - LM.Free; - Exit; - end; - - try - B := BIO_new_mem_buf(LM.Memory, LM.Size); - if not Assigned(B) then begin - SSLerr(SSL_F_SSL_CTX_USE_CERTIFICATE_FILE, ERR_R_BUF_LIB); - Exit; - end; - try - SetLength(LPassword, MAX_SSL_PASSWORD_LENGTH+1); - LPassword[MAX_SSL_PASSWORD_LENGTH] := TIdAnsiChar(0); - LPasswordPtr := PIdAnsiChar(LPassword); - if Assigned(ctx^.default_passwd_callback) then begin - ctx^.default_passwd_callback(LPasswordPtr, MAX_SSL_PASSWORD_LENGTH, 0, ctx^.default_passwd_callback_userdata); - // TODO: check return value for failure - end else begin - // TODO: call PEM_def_callback(), like PEM_read_bio_X509() does - // when default_passwd_callback is nil - end; - P12 := d2i_PKCS12_bio(B, nil); - if not Assigned(P12) then - begin - SSLerr(SSL_F_SSL_CTX_USE_CERTIFICATE_FILE, ERR_R_PKCS12_LIB); - Exit; - end; - try - CertChain := nil; - if PKCS12_parse(P12, LPasswordPtr, PKey, LCert, @CertChain) <> 1 then begin - SSLerr(SSL_F_SSL_CTX_USE_CERTIFICATE_FILE, ERR_R_PKCS12_LIB); - Exit; - end; - try - Result := SSL_CTX_use_certificate(ctx, LCert); - finally - sk_pop_free(CertChain, @X509_free); - X509_free(LCert); - EVP_PKEY_free(PKey); - end; - finally - PKCS12_free(P12); - end; - finally - BIO_free(B); - end; - finally - FreeAndNil(LM); - end; -end; - -{ - IMPORTANT!!! - - OpenSSL can not handle Unicode file names at all. On Posix systems, UTF8 File - names can be used with OpenSSL. The Windows operating system does not accept - UTF8 file names at all so we have our own routines that will handle Unicode - filenames. Most of this section of code is based on code in the OpenSSL .DLL - which is copyrighted by the OpenSSL developers. Some of it is translated into - Pascal and made some modifications so that it will handle Unicode filenames. -} - -{$IFDEF STRING_IS_UNICODE} - - {$IFDEF WINDOWS} - -function Indy_unicode_X509_load_cert_crl_file(ctx: PX509_LOOKUP; const AFileName: String; - const _type: TIdC_INT): TIdC_INT; forward; -function Indy_unicode_X509_load_cert_file(ctx: PX509_LOOKUP; const AFileName: String; - _type: TIdC_INT): TIdC_INT; forward; - -{ - This is for some file lookup definitions for a LOOKUP method that - uses Unicode filenames instead of ASCII or UTF8. It is not meant - to be portable at all. -} -function by_Indy_unicode_file_ctrl(ctx: PX509_LOOKUP; cmd: TIdC_INT; - const argc: PAnsiChar; argl: TIdC_LONG; out ret: PAnsiChar): TIdC_INT; - cdecl; forward; - -const - Indy_x509_unicode_file_lookup: X509_LOOKUP_METHOD = - ( - name: PAnsiChar('Load file into cache'); - new_item: nil; // * new */ - free: nil; // * free */ - init: nil; // * init */ - shutdown: nil; // * shutdown */ - ctrl: by_Indy_unicode_file_ctrl; // * ctrl */ - get_by_subject: nil; // * get_by_subject */ - get_by_issuer_serial: nil; // * get_by_issuer_serial */ - get_by_fingerprint: nil; // * get_by_fingerprint */ - get_by_alias: nil // * get_by_alias */ - ); - -function Indy_Unicode_X509_LOOKUP_file(): PX509_LOOKUP_METHOD cdecl; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := @Indy_x509_unicode_file_lookup; -end; - -function by_Indy_unicode_file_ctrl(ctx: PX509_LOOKUP; cmd: TIdC_INT; - const argc: PAnsiChar; argl: TIdC_LONG; out ret: PAnsiChar): TIdC_INT; cdecl; -var - LOk: TIdC_INT; - LFileName: String; -begin - LOk := 0; - case cmd of - X509_L_FILE_LOAD: - begin - // Note that typecasting an AnsiChar as a WideChar below is normally a crazy - // thing to do. The thing is that the OpenSSL API is based on PAnsiChar, and - // we are writing this function just for Unicode filenames. argc is actually - // a PWideChar that has been coerced into a PAnsiChar so it can pass through - // OpenSSL APIs... - case argl of - X509_FILETYPE_DEFAULT: - begin - LFileName := GetEnvironmentVariable(String(X509_get_default_cert_file_env)); - if LFileName = '' then begin - LFileName := String(X509_get_default_cert_file); - end; - LOk := Ord(Indy_unicode_X509_load_cert_crl_file(ctx, LFileName, X509_FILETYPE_PEM) <> 0); - if LOk = 0 then begin - X509err(X509_F_BY_FILE_CTRL, X509_R_LOADING_DEFAULTS); - end; - end; - X509_FILETYPE_PEM: - begin - LFileName := PWideChar(Pointer(argc)); - LOk := Ord(Indy_unicode_X509_load_cert_crl_file(ctx, LFileName, X509_FILETYPE_PEM) <> 0); - end; - else - LFileName := PWideChar(Pointer(argc)); - LOk := Ord(Indy_unicode_X509_load_cert_file(ctx, LFileName, TIdC_INT(argl)) <> 0); - end; - end; - end; - Result := LOk; -end; - -function Indy_unicode_X509_load_cert_file(ctx: PX509_LOOKUP; const AFileName: String; - _type: TIdC_INT): TIdC_INT; -var - LM: TMemoryStream; - Lin: PBIO; - LX: PX509; - i, count: Integer; -begin - Result := 0; - count := 0; - - if AFileName = '' then begin - Result := 1; - Exit; - end; - - LM := nil; - try - LM := TMemoryStream.Create; - LM.LoadFromFile(AFileName); - except - // Surpress exception here since it's going to be called by the OpenSSL .DLL - // Follow the OpenSSL .DLL Error conventions. - X509err(X509_F_X509_LOAD_CERT_FILE, ERR_R_SYS_LIB); - LM.Free; - Exit; - end; - - try - Lin := BIO_new_mem_buf(LM.Memory, LM.Size); - if not Assigned(Lin) then begin - X509err(X509_F_X509_LOAD_CERT_FILE, ERR_R_SYS_LIB); - Exit; - end; - try - case _type of - X509_FILETYPE_PEM: - begin - repeat - LX := PEM_read_bio_X509_AUX(Lin, nil, nil, nil); - if not Assigned(LX) then begin - if ((ERR_GET_REASON(ERR_peek_last_error()) - = PEM_R_NO_START_LINE) and (count > 0)) then begin - ERR_clear_error(); - Break; - end else begin - X509err(X509_F_X509_LOAD_CERT_FILE, ERR_R_PEM_LIB); - Exit; - end; - end; - i := X509_STORE_add_cert(ctx^.store_ctx, LX); - if i = 0 then begin - Exit; - end; - Inc(count); - X509_Free(LX); - until False; - Result := count; - end; - X509_FILETYPE_ASN1: - begin - LX := d2i_X509_bio(Lin, nil); - if not Assigned(LX) then begin - X509err(X509_F_X509_LOAD_CERT_FILE, ERR_R_ASN1_LIB); - Exit; - end; - i := X509_STORE_add_cert(ctx^.store_ctx, LX); - if i = 0 then begin - Exit; - end; - Result := i; - end; - else - X509err(X509_F_X509_LOAD_CERT_FILE, X509_R_BAD_X509_FILETYPE); - Exit; - end; - finally - BIO_free(Lin); - end; - finally - FreeAndNil(LM); - end; -end; - -function Indy_unicode_X509_load_cert_crl_file(ctx: PX509_LOOKUP; const AFileName: String; - const _type: TIdC_INT): TIdC_INT; -var - LM: TMemoryStream; - Linf: PSTACK_OF_X509_INFO; - Litmp: PX509_INFO; - Lin: PBIO; - i, count: Integer; -begin - Result := 0; - count := 0; - LM := nil; - - if _type <> X509_FILETYPE_PEM then begin - Result := Indy_unicode_X509_load_cert_file(ctx, AFileName, _type); - Exit; - end; - - try - LM := TMemoryStream.Create; - LM.LoadFromFile(AFileName); - except - // Surpress exception here since it's going to be called by the OpenSSL .DLL - // Follow the OpenSSL .DLL Error conventions. - X509err(X509_F_X509_LOAD_CERT_CRL_FILE, ERR_R_SYS_LIB); - LM.Free; - Exit; - end; - - try - Lin := BIO_new_mem_buf(LM.Memory, LM.Size); - if not Assigned(Lin) then begin - X509err(X509_F_X509_LOAD_CERT_CRL_FILE, ERR_R_SYS_LIB); - Exit; - end; - try - Linf := PEM_X509_INFO_read_bio(Lin, nil, nil, nil); - finally - BIO_free(Lin); - end; - finally - FreeAndNil(LM); - end; - if not Assigned(Linf) then begin - X509err(X509_F_X509_LOAD_CERT_CRL_FILE, ERR_R_PEM_LIB); - Exit; - end; - try - for i := 0 to sk_X509_INFO_num(Linf) - 1 do begin - Litmp := sk_X509_INFO_value(Linf, i); - if Assigned(Litmp^.x509) then begin - X509_STORE_add_cert(ctx^.store_ctx, Litmp^.x509); - Inc(count); - end; - if Assigned(Litmp^.crl) then begin - X509_STORE_add_crl(ctx^.store_ctx, Litmp^.crl); - Inc(count); - end; - end; - finally - sk_X509_INFO_pop_free(Linf, @X509_INFO_free); - end; - Result := count; -end; - -procedure IndySSL_load_client_CA_file_err(var VRes: PSTACK_OF_X509_NAME); -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - if Assigned(VRes) then begin - sk_X509_NAME_pop_free(VRes, @X509_NAME_free); - VRes := nil; - end; -end; - -function xname_cmp(const a, b: PPX509_NAME): TIdC_INT; cdecl; -begin - Result := X509_NAME_cmp(a^, b^); -end; - -function IndySSL_load_client_CA_file(const AFileName: String): PSTACK_OF_X509_NAME; -var - LM: TMemoryStream; - LB: PBIO; - Lsk: PSTACK_OF_X509_NAME; - LX: PX509; - LXN, LXNDup: PX509_NAME; - Failed: Boolean; -begin - Result := nil; - Failed := False; - LX := nil; - Lsk := sk_X509_NAME_new(@xname_cmp); - if Assigned(Lsk) then begin - try - LM := nil; - try - LM := TMemoryStream.Create; - LM.LoadFromFile(AFileName); - except - // Surpress exception here since it's going to be called by the OpenSSL .DLL - // Follow the OpenSSL .DLL Error conventions. - SSLerr(SSL_F_SSL_LOAD_CLIENT_CA_FILE, ERR_R_SYS_LIB); - LM.Free; - Exit; - end; - try - LB := BIO_new_mem_buf(LM.Memory, LM.Size); - if Assigned(LB) then begin - try - try - repeat - LX := PEM_read_bio_X509(LB, nil, nil, nil); - if LX = nil then begin - Break; - end; - if not Assigned(Result) then begin - Result := sk_X509_NAME_new_null; - if not Assigned(Result) then begin - SSLerr(SSL_F_SSL_LOAD_CLIENT_CA_FILE, ERR_R_MALLOC_FAILURE); - Failed := True; - Exit; - end; - end; - LXN := X509_get_subject_name(LX); - if not Assigned(LXN) then begin - // error - IndySSL_load_client_CA_file_err(Result); - Failed := True; - Exit; - end; - // * check for duplicates */ - LXNDup := X509_NAME_dup(LXN); - if not Assigned(LXNDup) then begin - // error - IndySSL_load_client_CA_file_err(Result); - Failed := True; - Exit; - end; - if (sk_X509_NAME_find(Lsk, LXNDup) >= 0) then begin - X509_NAME_free(LXNDup); - end else begin - sk_X509_NAME_push(Lsk, LXNDup); - sk_X509_NAME_push(Result, LXNDup); - end; - X509_free(LX); - LX := nil; - until False; - finally - if Assigned(LX) then begin - X509_free(LX); - end; - if Failed and Assigned(Result) then begin - sk_X509_NAME_pop_free(Result, @X509_NAME_free); - Result := nil; - end; - end; - finally - BIO_free(LB); - end; - end - else begin - SSLerr(SSL_F_SSL_LOAD_CLIENT_CA_FILE, ERR_R_MALLOC_FAILURE); - end; - finally - FreeAndNil(LM); - end; - finally - sk_X509_NAME_free(Lsk); - end; - end - else begin - SSLerr(SSL_F_SSL_LOAD_CLIENT_CA_FILE, ERR_R_MALLOC_FAILURE); - end; - if Assigned(Result) then begin - ERR_clear_error; - end; -end; - -function IndySSL_CTX_use_PrivateKey_file(ctx: PSSL_CTX; const AFileName: String; - AType: Integer): TIdC_INT; -var - LM: TMemoryStream; - B: PBIO; - LKey: PEVP_PKEY; - j: TIdC_INT; -begin - Result := 0; - - LM := nil; - try - LM := TMemoryStream.Create; - LM.LoadFromFile(AFileName); - except - // Surpress exception here since it's going to be called by the OpenSSL .DLL - // Follow the OpenSSL .DLL Error conventions. - SSLerr(SSL_F_SSL_CTX_USE_PRIVATEKEY_FILE, ERR_R_SYS_LIB); - LM.Free; - Exit; - end; - - try - B := BIO_new_mem_buf(LM.Memory, LM.Size); - if not Assigned(B) then begin - SSLerr(SSL_F_SSL_CTX_USE_PRIVATEKEY_FILE, ERR_R_BUF_LIB); - Exit; - end; - try - case AType of - SSL_FILETYPE_PEM: - begin - j := ERR_R_PEM_LIB; - LKey := PEM_read_bio_PrivateKey(B, nil, - ctx^.default_passwd_callback, - ctx^.default_passwd_callback_userdata); - end; - SSL_FILETYPE_ASN1: - begin - j := ERR_R_ASN1_LIB; - LKey := d2i_PrivateKey_bio(B, nil); - end; - else - SSLerr(SSL_F_SSL_CTX_USE_PRIVATEKEY_FILE, SSL_R_BAD_SSL_FILETYPE); - Exit; - end; - if not Assigned(LKey) then begin - SSLerr(SSL_F_SSL_CTX_USE_PRIVATEKEY_FILE, j); - Exit; - end; - Result := SSL_CTX_use_PrivateKey(ctx, LKey); - EVP_PKEY_free(LKey); - finally - BIO_free(B); - end; - finally - FreeAndNil(LM); - end; -end; - -function IndySSL_CTX_use_certificate_file(ctx: PSSL_CTX; - const AFileName: String; AType: Integer): TIdC_INT; -var - LM: TMemoryStream; - B: PBIO; - LX: PX509; - j: TIdC_INT; -begin - Result := 0; - - LM := nil; - try - LM := TMemoryStream.Create; - LM.LoadFromFile(AFileName); - except - // Surpress exception here since it's going to be called by the OpenSSL .DLL - // Follow the OpenSSL .DLL Error conventions. - SSLerr(SSL_F_SSL_CTX_USE_CERTIFICATE_FILE, ERR_R_SYS_LIB); - LM.Free; - Exit; - end; - - try - B := BIO_new_mem_buf(LM.Memory, LM.Size); - if not Assigned(B) then begin - SSLerr(SSL_F_SSL_CTX_USE_CERTIFICATE_FILE, ERR_R_BUF_LIB); - Exit; - end; - try - case AType of - SSL_FILETYPE_ASN1: - begin - j := ERR_R_ASN1_LIB; - LX := d2i_X509_bio(B, nil); - end; - SSL_FILETYPE_PEM: - begin - j := ERR_R_PEM_LIB; - LX := PEM_read_bio_X509(B, nil, ctx^.default_passwd_callback, - ctx^.default_passwd_callback_userdata); - end - else begin - SSLerr(SSL_F_SSL_CTX_USE_CERTIFICATE_FILE, SSL_R_BAD_SSL_FILETYPE); - Exit; - end; - end; - if not Assigned(LX) then begin - SSLerr(SSL_F_SSL_CTX_USE_CERTIFICATE_FILE, j); - Exit; - end; - Result := SSL_CTX_use_certificate(ctx, LX); - X509_free(LX); - finally - BIO_free(B); - end; - finally - FreeAndNil(LM); - end; -end; - -function IndySSL_CTX_use_certificate_chain_file(ctx :PSSL_CTX; - const AFileName: String) : TIdC_INT; -var - LM: TMemoryStream; - B: PBIO; - LX: PX509; - ca :PX509; - r: TIdC_INT; - LErr :TIdC_ULONG; - -begin - Result := 0; - - ERR_clear_error(); //* clear error stack for - //* SSL_CTX_use_certificate() */ - - LM := nil; - try - LM := TMemoryStream.Create; - LM.LoadFromFile(AFileName); - except - // Surpress exception here since it's going to be called by the OpenSSL .DLL - // Follow the OpenSSL .DLL Error conventions. - SSLerr(SSL_F_SSL_CTX_USE_CERTIFICATE_CHAIN_FILE, ERR_R_SYS_LIB); - LM.Free; - Exit; - end; - try - B := BIO_new_mem_buf(LM.Memory, LM.Size); - if not Assigned(B) then begin - SSLerr(SSL_F_SSL_CTX_USE_CERTIFICATE_FILE, ERR_R_BUF_LIB); - Exit; - end; - try - LX := PEM_read_bio_X509_AUX(B, nil, ctx^.default_passwd_callback, - ctx^.default_passwd_callback_userdata); - if (Lx = nil) then begin - SSLerr(SSL_F_SSL_CTX_USE_CERTIFICATE_CHAIN_FILE, ERR_R_PEM_LIB); - end else begin - Result := SSL_CTX_use_certificate(ctx, Lx); - if (ERR_peek_error() <> 0) then begin - Result := 0; //* Key/certificate mismatch doesn't imply - //* ret==0 ... */ - end; - if Result <> 0 then begin - SSL_CTX_clear_chain_certs(ctx); - repeat - ca := PEM_read_bio_X509(B, nil, - ctx^.default_passwd_callback, - ctx^.default_passwd_callback_userdata); - if ca = nil then begin - break; - end; - r := SSL_CTX_add0_chain_cert(ctx, ca); - if (r = 0) then begin - X509_free(ca); - Result := 0; - break; -// goto end; - end; - //* - //* Note that we must not free r if it was successfully added to - //* the chain (while we must free the main certificate, since its - //* reference count is increased by SSL_CTX_use_certificate). - // */ - until False; - if ca <> nil then begin - //* When the while loop ends, it's usually just EOF. */ - LErr := ERR_peek_last_error(); - if (ERR_GET_LIB(Lerr) = ERR_LIB_PEM) - and (ERR_GET_REASON(Lerr) = PEM_R_NO_START_LINE) then begin - ERR_clear_error(); - end else begin - Result := 0; //* some real error */ - end; - end; - end; - //err: - if LX <> nil then begin - X509_free(LX); - end; - end; - finally - BIO_free(B); - end; - finally - FreeAndNil(LM); - end; -end; - -function IndyX509_STORE_load_locations(ctx: PX509_STORE; - const AFileName, APathName: String): TIdC_INT; -var - lookup: PX509_LOOKUP; -begin - Result := 0; - if AFileName <> '' then begin - lookup := X509_STORE_add_lookup(ctx, Indy_Unicode_X509_LOOKUP_file); - if not Assigned(lookup) then begin - Exit; - end; - // RLebeau: the PAnsiChar(Pointer(...)) cast below looks weird, but it is - // intentional. X509_LOOKUP_load_file() takes a PAnsiChar as input, but - // we are using Unicode strings here. So casting the UnicodeString to a - // raw Pointer and then passing that to X509_LOOKUP_load_file() as PAnsiChar. - // Indy_Unicode_X509_LOOKUP_file will cast it back to PWideChar for processing... - if (X509_LOOKUP_load_file(lookup, PAnsiChar(Pointer(AFileName)), X509_FILETYPE_PEM) <> 1) then begin - Exit; - end; - end; - if APathName <> '' then begin - { TODO: Figure out how to do the hash dir lookup with a Unicode path. } - if (X509_STORE_load_locations(ctx, nil, PAnsiChar(AnsiString(APathName))) <> 1) then begin - Exit; - end; - end; - if (AFileName = '') and (APathName = '') then begin - Exit; - end; - Result := 1; -end; - -function IndySSL_CTX_load_verify_locations(ctx: PSSL_CTX; - const ACAFile, ACAPath: String): TIdC_INT; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := IndyX509_STORE_load_locations(ctx^.cert_store, ACAFile, ACAPath); -end; - -function IndySSL_CTX_use_DHparams_file(ctx: PSSL_CTX; - const AFileName: String; AType: Integer): TIdC_INT; -var - LM: TMemoryStream; - B: PBIO; - LDH: PDH; - j: Integer; -begin - Result := 0; - - LM := nil; - try - LM := TMemoryStream.Create; - LM.LoadFromFile(AFileName); - except - // Surpress exception here since it's going to be called by the OpenSSL .DLL - // Follow the OpenSSL .DLL Error conventions. - SSLerr(SSL_F_SSL3_CTRL, ERR_R_SYS_LIB); - LM.Free; - Exit; - end; - - try - B := BIO_new_mem_buf(LM.Memory, LM.Size); - if not Assigned(B) then begin - SSLerr(SSL_F_SSL3_CTRL, ERR_R_BUF_LIB); - Exit; - end; - try - case AType of - // TODO - { - SSL_FILETYPE_ASN1: - begin - j := ERR_R_ASN1_LIB; - LDH := d2i_DHparams_bio(B, nil); - end; - } - SSL_FILETYPE_PEM: - begin - j := ERR_R_DH_LIB; - LDH := PEM_read_bio_DHparams(B, nil, ctx^.default_passwd_callback, - ctx^.default_passwd_callback_userdata); - end - else begin - SSLerr(SSL_F_SSL3_CTRL, SSL_R_BAD_SSL_FILETYPE); - Exit; - end; - end; - if not Assigned(LDH) then begin - SSLerr(SSL_F_SSL3_CTRL, j); - Exit; - end; - Result := SSL_CTX_set_tmp_dh(ctx, LDH); - DH_free(LDH); - finally - BIO_free(B); - end; - finally - FreeAndNil(LM); - end; -end; - - {$ENDIF} // WINDOWS - - {$IFDEF UNIX} - -function IndySSL_load_client_CA_file(const AFileName: String) : PSTACK_OF_X509_NAME; -{$IFDEF USE_MARSHALLED_PTRS} -var - M: TMarshaller; -{$ENDIF} -begin - Result := SSL_load_client_CA_file( - {$IFDEF USE_MARSHALLED_PTRS} - M.AsUtf8(AFileName).ToPointer - {$ELSE} - PAnsiChar(UTF8String(AFileName)) - {$ENDIF} - ); -end; - -function IndySSL_CTX_use_PrivateKey_file(ctx: PSSL_CTX; const AFileName: String; - AType: Integer): TIdC_INT; -{$IFDEF USE_INLINE} inline; {$ENDIF} -{$IFDEF USE_MARSHALLED_PTRS} -var - M: TMarshaller; -{$ENDIF} -begin - Result := SSL_CTX_use_PrivateKey_file(ctx, - {$IFDEF USE_MARSHALLED_PTRS} - M.AsUtf8(AFileName).ToPointer - {$ELSE} - PAnsiChar(UTF8String(AFileName)) - {$ENDIF} - , AType); -end; - -function IndySSL_CTX_use_certificate_file(ctx: PSSL_CTX; - const AFileName: String; AType: Integer): TIdC_INT; -{$IFDEF USE_INLINE} inline; {$ENDIF} -{$IFDEF USE_MARSHALLED_PTRS} -var - M: TMarshaller; -{$ENDIF} -begin - Result := SSL_CTX_use_certificate_file(ctx, - {$IFDEF USE_MARSHALLED_PTRS} - M.AsUtf8(AFileName).ToPointer - {$ELSE} - PAnsiChar(UTF8String(AFileName)) - {$ENDIF} - , AType); -end; - -function IndySSL_CTX_use_certificate_chain_file(ctx :PSSL_CTX; - const AFileName: String) : TIdC_INT; -{$IFDEF USE_INLINE} inline; {$ENDIF} -{$IFDEF USE_MARSHALLED_PTRS} -var - M: TMarshaller; -{$ENDIF} -begin - Result := SSL_CTX_use_certificate_chain_file(ctx, - {$IFDEF USE_MARSHALLED_PTRS} - M.AsUtf8(AFileName).ToPointer - {$ELSE} - PAnsiChar(UTF8String(AFileName)) - {$ENDIF}); -end; - -{$IFDEF USE_MARSHALLED_PTRS} -function AsUtf8OrNil(var M: TMarshaller; const S: String): Pointer; - {$IFDEF USE_INLINE} inline; {$ENDIF} -begin - if S <> '' then begin - Result := M.AsUtf8(S).ToPointer; - end else begin - Result := nil; - end; -end; -{$ENDIF} - -function IndyX509_STORE_load_locations(ctx: PX509_STORE; - const AFileName, APathName: String): TIdC_INT; -{$IFDEF USE_INLINE} inline; {$ENDIF} -{$IFDEF USE_MARSHALLED_PTRS} -var - M: TMarshaller; -{$ENDIF} -begin - // RLebeau 4/18/2010: X509_STORE_load_locations() expects nil pointers - // for unused values, but casting a string directly to a PAnsiChar - // always produces a non-nil pointer, which causes X509_STORE_load_locations() - // to fail. Need to cast the string to an intermediate Pointer so the - // PAnsiChar cast is applied to the raw data and thus can be nil... - // - // RLebeau 8/18/2017: TMarshaller also produces a non-nil TPtrWrapper for - // an empty string, so need to handle nil specially with marshalled - // strings as well... - // - Result := X509_STORE_load_locations(ctx, - {$IFDEF USE_MARSHALLED_PTRS} - AsUtf8OrNil(M, AFileName), - AsUtf8OrNil(M, APathName) - {$ELSE} - PAnsiChar(Pointer(UTF8String(AFileName))), - PAnsiChar(Pointer(UTF8String(APathName))) - {$ENDIF} - ); -end; - -function IndySSL_CTX_load_verify_locations(ctx: PSSL_CTX; - const ACAFile, ACAPath: String): TIdC_INT; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - // RLebeau: why are we calling X509_STORE_load_locations() directly - // instead of just calling SSL_CTX_load_verify_locations() with - // UTF-8 input? - - //Result := SSL_CTX_load_verify_locations(ctx, - // {$IFDEF USE_MARSHALLED_PTRS} - // AsUtf8OrNl(ACAFile), - // AsUtf8OrNil(ACAPath) - // {$ELSE} - // PAnsiChar(Pointer(UTF8String(ACAFile))), - // PAnsiChar(Pointer(UTF8String(ACAPath))) - // {$ENDIF} - //); - - Result := IndyX509_STORE_load_locations(ctx^.cert_store, ACAFile, ACAPath); -end; - -function IndySSL_CTX_use_DHparams_file(ctx: PSSL_CTX; - const AFileName: String; AType: Integer): TIdC_INT; -var - B: PBIO; - LDH: PDH; - j: Integer; - {$IFDEF USE_MARSHALLED_PTRS} - M: TMarshaller; - {$ENDIF} -begin - Result := 0; - B := BIO_new_file( - {$IFDEF USE_MARSHALLED_PTRS} - M.AsUtf8(AFileName).ToPointer - {$ELSE} - PAnsiChar(UTF8String(AFileName)) - {$ENDIF} - , 'r'); - if Assigned(B) then begin - try - case AType of - // TODO - { - SSL_FILETYPE_ASN1: - begin - j := ERR_R_ASN1_LIB; - LDH := d2i_DHparams_bio(B, nil); - end; - } - SSL_FILETYPE_PEM: - begin - j := ERR_R_DH_LIB; - LDH := PEM_read_bio_DHparams(B, nil, ctx^.default_passwd_callback, - ctx^.default_passwd_callback_userdata); - end - else begin - SSLerr(SSL_F_SSL3_CTRL, SSL_R_BAD_SSL_FILETYPE); - Exit; - end; - end; - if not Assigned(LDH) then begin - SSLerr(SSL_F_SSL3_CTRL, j); - Exit; - end; - Result := SSL_CTX_set_tmp_dh(ctx, LDH); - DH_free(LDH); - finally - BIO_free(B); - end; - end; -end; - - {$ENDIF} // UNIX - -{$ELSE} // STRING_IS_UNICODE - -function IndySSL_load_client_CA_file(const AFileName: String) : PSTACK_OF_X509_NAME; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := SSL_load_client_CA_file(PAnsiChar(AFileName)); -end; - -function IndySSL_CTX_use_PrivateKey_file(ctx: PSSL_CTX; const AFileName: String; - AType: Integer): TIdC_INT; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := SSL_CTX_use_PrivateKey_file(ctx, PAnsiChar(AFileName), AType); -end; - -function IndySSL_CTX_use_certificate_file(ctx: PSSL_CTX; - const AFileName: String; AType: Integer): TIdC_INT; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := SSL_CTX_use_certificate_file(ctx, PAnsiChar(AFileName), AType); -end; - -function IndySSL_CTX_use_certificate_chain_file(ctx :PSSL_CTX; - const AFileName: String) : TIdC_INT; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := SSL_CTX_use_certificate_chain_file(ctx, PAnsiChar(AFileName)); -end; - -function IndyX509_STORE_load_locations(ctx: PX509_STORE; - const AFileName, APathName: String): TIdC_INT; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - // RLebeau 4/18/2010: X509_STORE_load_locations() expects nil pointers - // for unused values, but casting a string directly to a PAnsiChar - // always produces a non-nil pointer, which causes X509_STORE_load_locations() - // to fail. Need to cast the string to an intermediate Pointer so the - // PAnsiChar cast is applied to the raw data and thus can be nil... - // - Result := X509_STORE_load_locations(ctx, - PAnsiChar(Pointer(AFileName)), - PAnsiChar(Pointer(APathName))); -end; - -function IndySSL_CTX_load_verify_locations(ctx: PSSL_CTX; - const ACAFile, ACAPath: String): TIdC_INT; -begin - // RLebeau 4/18/2010: X509_STORE_load_locations() expects nil pointers - // for unused values, but casting a string directly to a PAnsiChar - // always produces a non-nil pointer, which causes X509_STORE_load_locations() - // to fail. Need to cast the string to an intermediate Pointer so the - // PAnsiChar cast is applied to the raw data and thus can be nil... - // - Result := SSL_CTX_load_verify_locations(ctx, - PAnsiChar(Pointer(ACAFile)), - PAnsiChar(Pointer(ACAPath))); -end; - -function IndySSL_CTX_use_DHparams_file(ctx: PSSL_CTX; - const AFileName: String; AType: Integer): TIdC_INT; -var - B: PBIO; - LDH: PDH; - j: Integer; -begin - Result := 0; - B := BIO_new_file(PAnsiChar(AFileName), 'r'); - if Assigned(B) then begin - try - case AType of - // TODO - { - SSL_FILETYPE_ASN1: - begin - j := ERR_R_ASN1_LIB; - LDH := d2i_DHparams_bio(B, nil); - end; - } - SSL_FILETYPE_PEM: - begin - j := ERR_R_DH_LIB; - LDH := PEM_read_bio_DHparams(B, nil, ctx^.default_passwd_callback, - ctx^.default_passwd_callback_userdata); - end - else begin - SSLerr(SSL_F_SSL3_CTRL, SSL_R_BAD_SSL_FILETYPE); - Exit; - end; - end; - if not Assigned(LDH) then begin - SSLerr(SSL_F_SSL3_CTRL, j); - Exit; - end; - Result := SSL_CTX_set_tmp_dh(ctx, LDH); - DH_free(LDH); - finally - BIO_free(B); - end; - end; -end; - -{$ENDIF} - -function AddMins(const DT: TDateTime; const Mins: Extended): TDateTime; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := DT + Mins / (60 * 24) -end; - -function AddHrs(const DT: TDateTime; const Hrs: Extended): TDateTime; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := DT + Hrs / 24.0; -end; - -{$IFDEF OPENSSL_SET_MEMORY_FUNCS} - -function IdMalloc(num: UInt32): Pointer cdecl; -begin - Result := AllocMem(num); -end; - -function IdRealloc(addr: Pointer; num: UInt32): Pointer cdecl; -begin - Result := addr; - ReallocMem(Result, num); -end; - -procedure IdFree(addr: Pointer)cdecl; -begin - FreeMem(addr); -end; - -procedure IdSslCryptoMallocInit; -// replaces the actual alloc routines -// this is useful if you are using a memory manager that can report on leaks -// at shutdown time. -var - r: Integer; -begin - r := CRYPTO_set_mem_functions(@IdMalloc, @IdRealloc, @IdFree); - Assert(r <> 0); -end; -{$ENDIF} - -{$IFNDEF OPENSSL_NO_BIO} -procedure DumpCert(AOut: TStrings; AX509: PX509); -var - LMem: PBIO; - LLen : TIdC_INT; - LBufPtr : PIdAnsiChar; -begin - if Assigned(X509_print) then begin - LMem := BIO_new(BIO_s_mem); - if LMem <> nil then begin - try - X509_print(LMem, AX509); - LLen := BIO_get_mem_data(LMem, LBufPtr); - if (LLen > 0) and (LBufPtr <> nil) then begin - AOut.Text := IndyTextEncoding_UTF8.GetString( - {$IFNDEF VCL_6_OR_ABOVE} - // RLebeau: for some reason, Delphi 5 causes a "There is no overloaded - // version of 'GetString' that can be called with these arguments" compiler - // error if the PByte type-cast is used, even though GetString() actually - // expects a PByte as input. Must be a compiler bug, as it compiles fine - // in Delphi 6. So, converting to TIdBytes until I find a better solution... - RawToBytes(LBufPtr^, LLen) - {$ELSE} - PByte(LBufPtr), LLen - {$ENDIF} - ); - end; - finally - BIO_free(LMem); - end; - end; - end; -end; - -{$ELSE} - -procedure DumpCert(AOut: TStrings; AX509: PX509); -begin -end; - -{$ENDIF} - -{$IFNDEF WIN32_OR_WIN64} -procedure _threadid_func(id : PCRYPTO_THREADID) cdecl; -begin - if Assigned(CRYPTO_THREADID_set_numeric) then begin - CRYPTO_THREADID_set_numeric(id, TIdC_ULONG(CurrentThreadId)); - end; -end; - -function _GetThreadID: TIdC_ULONG; cdecl; -begin - // TODO: Verify how well this will work with fibers potentially running from - // thread to thread or many on the same thread. - Result := TIdC_ULONG(CurrentThreadId); -end; -{$ENDIF} - -procedure SslLockingCallback(mode, n: TIdC_INT; Afile: PIdAnsiChar; - line: TIdC_INT)cdecl; -var - Lock: TIdCriticalSection; - LList: TIdCriticalSectionList; -begin - Assert(CallbackLockList <> nil); - Lock := nil; - - LList := CallbackLockList.LockList; - try - if n < LList.Count then begin - Lock := {$IFDEF HAS_GENERICS_TList}LList.Items[n]{$ELSE}TIdCriticalSection(LList.Items[n]){$ENDIF}; - end; - finally - CallbackLockList.UnlockList; - end; - Assert(Lock <> nil); - if (mode and CRYPTO_LOCK) = CRYPTO_LOCK then begin - Lock.Acquire; - end else begin - Lock.Release; - end; -end; - -procedure PrepareOpenSSLLocking; -var - i, cnt: Integer; - Lock: TIdCriticalSection; - LList: TIdCriticalSectionList; -begin - LList := CallbackLockList.LockList; - try - cnt := _CRYPTO_num_locks; - for i := 0 to cnt - 1 do begin - Lock := TIdCriticalSection.Create; - try - LList.Add(Lock); - except - Lock.Free; - raise; - end; - end; - finally - CallbackLockList.UnlockList; - end; -end; - -// Note that I define UCTTime as PASN1_STRING -function UTCTime2DateTime(UCTTime: PASN1_UTCTIME): TDateTime; -{$IFDEF USE_INLINE} inline; {$ENDIF} -var - year: Word; - month: Word; - day: Word; - hour: Word; - min: Word; - sec: Word; - tz_h: Integer; - tz_m: Integer; -begin - Result := 0; - if UTC_Time_Decode(UCTTime, year, month, day, hour, min, sec, tz_h, tz_m) > 0 then begin - Result := EncodeDate(year, month, day) + EncodeTime(hour, min, sec, 0); - AddMins(Result, tz_m); - AddHrs(Result, tz_h); - Result := UTCTimeToLocalTime(Result); - end; -end; - -{ -function RSACallback(sslSocket: PSSL; e: Integer; KeyLength: Integer):PRSA; cdecl; -const - RSA: PRSA = nil; -var - SSLSocket: TSSLWSocket; - IdSSLSocket: TIdSSLSocket; -begin - IdSSLSocket := TIdSSLSocket(IdSslGetAppData(sslSocket)); - - if Assigned(IdSSLSocket) then begin - IdSSLSocket.TriggerSSLRSACallback(KeyLength); - end; - - Result := RSA_generate_key(KeyLength, RSA_F4, @RSAProgressCallback, ssl); -end; -} - -function LogicalAnd(A, B: Integer): Boolean; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := (A and B) = B; -end; - -function BytesToHexString(APtr: Pointer; ALen: Integer): String; -{$IFDEF USE_INLINE} inline; {$ENDIF} -var - i: Integer; - LPtr: PByte; -begin - Result := ''; - LPtr := PByte(APtr); - for i := 0 to (ALen - 1) do begin - if i <> 0 then begin - Result := Result + ':'; { Do not Localize } - end; - Result := Result + IndyFormat('%.2x', [LPtr^]); - Inc(LPtr); - end; -end; - -function MDAsString(const AMD: TIdSSLEVP_MD): String; -{$IFDEF USE_INLINE} inline; {$ENDIF} -var - i: Integer; -begin - Result := ''; - for i := 0 to AMD.Length - 1 do begin - if i <> 0 then begin - Result := Result + ':'; { Do not Localize } - end; - Result := Result + IndyFormat('%.2x', [Byte(AMD.MD[i])]); - { do not localize } - end; -end; - -function LoadOpenSSLLibrary: Boolean; -begin - Assert(SSLIsLoaded <> nil); - SSLIsLoaded.Lock; - try - if SSLIsLoaded.Value then begin - Result := True; - Exit; - end; - Result := IdSSLOpenSSLHeaders.Load; - if not Result then begin - Exit; - end; -{$IFDEF OPENSSL_SET_MEMORY_FUNCS} - // has to be done before anything that uses memory - IdSslCryptoMallocInit; -{$ENDIF} - // required eg to encrypt a private key when writing - OpenSSL_add_all_ciphers; - OpenSSL_add_all_digests; - InitializeRandom; - // IdSslRandScreen; - SSL_load_error_strings; - // Successful loading if true - Result := SSLeay_add_ssl_algorithms > 0; - if not Result then begin - Exit; - end; - // Create locking structures, we need them for callback routines - Assert(LockInfoCB = nil); - LockInfoCB := TIdCriticalSection.Create; - LockPassCB := TIdCriticalSection.Create; - LockVerifyCB := TIdCriticalSection.Create; - // Handle internal OpenSSL locking - CallbackLockList := TIdCriticalSectionThreadList.Create; - PrepareOpenSSLLocking; - CRYPTO_set_locking_callback(@SslLockingCallback); -{$IFNDEF WIN32_OR_WIN64} - if Assigned(CRYPTO_THREADID_set_callback) then begin - CRYPTO_THREADID_set_callback(@_threadid_func); - end else begin - CRYPTO_set_id_callback(@_GetThreadID); - end; -{$ENDIF} - SSLIsLoaded.Value := True; - Result := True; - finally - SSLIsLoaded.Unlock; - end; -end; - -procedure UnLoadOpenSSLLibrary; -// allow the user to call unload directly? -// will then need to implement reference count -{$IFNDEF USE_OBJECT_ARC} -var - i: Integer; - LList: TIdCriticalSectionList; -{$ENDIF} -begin - // ssl was never loaded - if Assigned(CRYPTO_set_locking_callback) then begin - CRYPTO_set_locking_callback(nil); - end; - CleanupRandom; // <-- RLebeau: why is this here and not in IdSSLOpenSSLHeaders.Unload()? - IdSSLOpenSSLHeaders.Unload; - FreeAndNil(LockInfoCB); - FreeAndNil(LockPassCB); - FreeAndNil(LockVerifyCB); - if Assigned(CallbackLockList) then begin - {$IFDEF USE_OBJECT_ARC} - CallbackLockList.Clear; // Items are auto-freed - {$ELSE} - LList := CallbackLockList.LockList; - begin - try - for i := 0 to LList.Count - 1 do begin - {$IFDEF HAS_GENERICS_TList}LList.Items[i]{$ELSE}TIdCriticalSection(LList.Items[i]){$ENDIF}.Free; - end; - LList.Clear; - finally - CallbackLockList.UnlockList; - end; - end; - {$ENDIF} - FreeAndNil(CallbackLockList); - end; - SSLIsLoaded.Value := False; -end; - -function OpenSSLVersion: string; -begin - Result := ''; - // RLebeau 9/7/2015: even if LoadOpenSSLLibrary() fails, _SSLeay_version() - // might have been loaded OK before the failure occured. LoadOpenSSLLibrary() - // does not unload .. - IdSSLOpenSSL.LoadOpenSSLLibrary; - if Assigned(_SSLeay_version) then begin - Result := String(_SSLeay_version(SSLEAY_VERSION)); - end; -end; - -////////////////////////////////////////////////////// -// TIdSSLOptions -/////////////////////////////////////////////////////// - -constructor TIdSSLOptions.Create; -begin - inherited Create; - fMethod := DEF_SSLVERSION; - fSSLVersions := DEF_SSLVERSIONS; -end; - -procedure TIdSSLOptions.SetMethod(const AValue: TIdSSLVersion); -begin - fMethod := AValue; - if AValue = sslvSSLv23 then begin - fSSLVersions := [sslvSSLv2,sslvSSLv3,sslvTLSv1,sslvTLSv1_1,sslvTLSv1_2]; - end else begin - fSSLVersions := [AValue]; - end; -end; - -procedure TIdSSLOptions.SetSSLVersions(const AValue: TIdSSLVersions); -begin - fSSLVersions := AValue; - if fSSLVersions = [sslvSSLv2] then begin - fMethod := sslvSSLv2; - end - else if fSSLVersions = [sslvSSLv3] then begin - fMethod := sslvSSLv3; - end - else if fSSLVersions = [sslvTLSv1] then begin - fMethod := sslvTLSv1; - end - else if fSSLVersions = [sslvTLSv1_1 ] then begin - fMethod := sslvTLSv1_1; - end - else if fSSLVersions = [sslvTLSv1_2 ] then begin - fMethod := sslvTLSv1_2; - end - else begin - fMethod := sslvSSLv23; - if sslvSSLv23 in fSSLVersions then begin - Exclude(fSSLVersions, sslvSSLv23); - if fSSLVersions = [] then begin - fSSLVersions := [sslvSSLv2,sslvSSLv3,sslvTLSv1,sslvTLSv1_1,sslvTLSv1_2]; - end; - end; - end; -end; - -procedure TIdSSLOptions.AssignTo(Destination: TPersistent); -var - LDest: TIdSSLOptions; -begin - if Destination is TIdSSLOptions then begin - LDest := TIdSSLOptions(Destination); - LDest.RootCertFile := RootCertFile; - LDest.CertFile := CertFile; - LDest.KeyFile := KeyFile; - LDest.DHParamsFile := DHParamsFile; - LDest.Method := Method; - LDest.SSLVersions := SSLVersions; - LDest.Mode := Mode; - LDest.VerifyMode := VerifyMode; - LDest.VerifyDepth := VerifyDepth; - LDest.VerifyDirs := VerifyDirs; - LDest.CipherList := CipherList; - end else begin - inherited AssignTo(Destination); - end; -end; - -/////////////////////////////////////////////////////// -// TIdServerIOHandlerSSLOpenSSL -/////////////////////////////////////////////////////// - -{ TIdServerIOHandlerSSLOpenSSL } - -procedure TIdServerIOHandlerSSLOpenSSL.InitComponent; -begin - inherited InitComponent; - fxSSLOptions := TIdSSLOptions_Internal.Create; - TIdSSLOptions_Internal(fxSSLOptions).Parent := Self; -end; - -destructor TIdServerIOHandlerSSLOpenSSL.Destroy; -begin - FreeAndNil(fxSSLOptions); - inherited Destroy; -end; - -procedure TIdServerIOHandlerSSLOpenSSL.Init; -//see also TIdSSLIOHandlerSocketOpenSSL.Init -begin - //ensure Init isn't called twice - Assert(fSSLContext = nil); - fSSLContext := TIdSSLContext.Create; - fSSLContext.Parent := Self; - fSSLContext.RootCertFile := SSLOptions.RootCertFile; - fSSLContext.CertFile := SSLOptions.CertFile; - fSSLContext.KeyFile := SSLOptions.KeyFile; - fSSLContext.DHParamsFile := SSLOptions.DHParamsFile; - fSSLContext.fVerifyDepth := SSLOptions.fVerifyDepth; - fSSLContext.fVerifyMode := SSLOptions.fVerifyMode; - // fSSLContext.fVerifyFile := SSLOptions.fVerifyFile; - fSSLContext.fVerifyDirs := SSLOptions.fVerifyDirs; - fSSLContext.fCipherList := SSLOptions.fCipherList; - fSSLContext.VerifyOn := Assigned(fOnVerifyPeer); - fSSLContext.StatusInfoOn := Assigned(fOnStatusInfo) or Assigned(FOnStatusInfoEx); - //fSSLContext.PasswordRoutineOn := Assigned(fOnGetPassword); - fSSLContext.fMethod := SSLOptions.Method; - fSSLContext.fMode := SSLOptions.Mode; - fSSLContext.fSSLVersions := SSLOptions.SSLVersions; - - fSSLContext.InitContext(sslCtxServer); -end; - -function TIdServerIOHandlerSSLOpenSSL.Accept(ASocket: TIdSocketHandle; - // This is a thread and not a yarn. Its the listener thread. - AListenerThread: TIdThread; AYarn: TIdYarn ): TIdIOHandler; -var - LIO: TIdSSLIOHandlerSocketOpenSSL; -begin - //using a custom scheduler, AYarn may be nil, so don't assert - Assert(ASocket<>nil); - Assert(fSSLContext<>nil); - Assert(AListenerThread<>nil); - - Result := nil; - LIO := TIdSSLIOHandlerSocketOpenSSL.Create(nil); - try - LIO.PassThrough := True; - LIO.Open; - while not AListenerThread.Stopped do begin - if ASocket.Select(250) then begin - if (not AListenerThread.Stopped) and LIO.Binding.Accept(ASocket.Handle) then begin - //we need to pass the SSLOptions for the socket from the server - // TODO: wouldn't it be easier to just Assign() the server's SSLOptions - // here? Do we really need to share ownership of it? - // LIO.fxSSLOptions.Assign(fxSSLOptions); - FreeAndNil(LIO.fxSSLOptions); - LIO.IsPeer := True; - LIO.fxSSLOptions := fxSSLOptions; - LIO.fSSLSocket := TIdSSLSocket.Create(Self); - LIO.fSSLContext := fSSLContext; - // TODO: to enable server-side SNI, we need to: - // - Set up an additional SSL_CTX for each different certificate; - // - Add a servername callback to each SSL_CTX using SSL_CTX_set_tlsext_servername_callback(); - // - In the callback, retrieve the client-supplied servername with - // SSL_get_servername(ssl, TLSEXT_NAMETYPE_host_name). Figure out the right - // SSL_CTX to go with that host name, then switch the SSL object to that - // SSL_CTX with SSL_set_SSL_CTX(). - - // RLebeau 2/1/2022: note, the following call is basically a no-op for OpenSSL, - // because PassThrough=True and fSSLContext are both assigned above, so there - // is really nothing for TIdSSLIOHandlerSocketOpenSSL.Init() or - // TIdSSLIOHandlerSocketOpenSSL.StartSSL() to do when called by - // TIdSSLIOHandlerSocketOpenSSL.AfterAccept(). If anything, all this will - // really do is update the Binding's IPVersion. But, calling this is consistent - // with other server Accept() implementations, so we should do it here, too... - LIO.AfterAccept; - - Result := LIO; - LIO := nil; - Break; - end; - end; - end; - finally - FreeAndNil(LIO); - end; -end; - -procedure TIdServerIOHandlerSSLOpenSSL.DoStatusInfo(const AMsg: String); -begin - if Assigned(fOnStatusInfo) then begin - fOnStatusInfo(AMsg); - end; -end; - -procedure TIdServerIOHandlerSSLOpenSSL.DoStatusInfoEx(const AsslSocket: PSSL; - const AWhere, Aret: TIdC_INT; const AWhereStr, ARetStr: String); -begin - if Assigned(FOnStatusInfoEx) then begin - FOnStatusInfoEx(Self,AsslSocket,AWhere,Aret,AWHereStr,ARetStr); - end; -end; - -procedure TIdServerIOHandlerSSLOpenSSL.DoGetPassword(var Password: String); -begin - if Assigned(fOnGetPassword) then begin - fOnGetPassword(Password); - end; -end; - -procedure TIdServerIOHandlerSSLOpenSSL.DoGetPasswordEx( - var VPassword: String; const AIsWrite: Boolean); -begin - if Assigned(fOnGetPasswordEx) then begin - fOnGetPasswordEx(Self,VPassword,AIsWrite); - end; -end; - -function TIdServerIOHandlerSSLOpenSSL.DoVerifyPeer(Certificate: TIdX509; - AOk: Boolean; ADepth, AError: Integer): Boolean; -begin - Result := True; - if Assigned(fOnVerifyPeer) then begin - Result := fOnVerifyPeer(Certificate, AOk, ADepth, AError); - end; -end; - -function TIdServerIOHandlerSSLOpenSSL.MakeFTPSvrPort : TIdSSLIOHandlerSocketBase; -var - LIO : TIdSSLIOHandlerSocketOpenSSL; -begin - LIO := TIdSSLIOHandlerSocketOpenSSL.Create(nil); - try - LIO.PassThrough := True; - LIO.OnGetPassword := DoGetPassword; - LIO.OnGetPasswordEx := OnGetPasswordEx; - LIO.IsPeer := True; // RLebeau 1/24/2019: is this still needed now? - LIO.SSLOptions.Assign(SSLOptions); - LIO.SSLOptions.Mode := sslmBoth;{or sslmClient}{doesn't really matter} - LIO.SSLContext := SSLContext; - except - LIO.Free; - raise; - end; - Result := LIO; -end; - -procedure TIdServerIOHandlerSSLOpenSSL.Shutdown; -begin - FreeAndNil(fSSLContext); - inherited Shutdown; -end; - -function TIdServerIOHandlerSSLOpenSSL.MakeFTPSvrPasv : TIdSSLIOHandlerSocketBase; -var - LIO : TIdSSLIOHandlerSocketOpenSSL; -begin - LIO := TIdSSLIOHandlerSocketOpenSSL.Create(nil); - try - LIO.PassThrough := True; - LIO.OnGetPassword := DoGetPassword; - LIO.OnGetPasswordEx := OnGetPasswordEx; - LIO.IsPeer := True; - LIO.SSLOptions.Assign(SSLOptions); - LIO.SSLOptions.Mode := sslmBoth;{or sslmServer} - LIO.SSLContext := nil; - except - LIO.Free; - raise; - end; - Result := LIO; -end; - -{ IIdSSLOpenSSLCallbackHelper } - -function TIdServerIOHandlerSSLOpenSSL.GetPassword(const AIsWrite : Boolean): string; -begin - DoGetPasswordEx(Result, AIsWrite); - if Result = '' then begin - DoGetPassword(Result); - end; -end; - -procedure TIdServerIOHandlerSSLOpenSSL.StatusInfo(const ASslSocket: PSSL; - AWhere, ARet: TIdC_INT; const AStatusStr: string); -var - LType, LMsg: string; -begin - DoStatusInfo(AStatusStr); - if Assigned(fOnStatusInfoEx) then begin - GetStateVars(ASslSocket, AWhere, ARet, LType, LMsg); - DoStatusInfoEx(ASslSocket, AWhere, ARet, LType, LMsg); - end; -end; - -function TIdServerIOHandlerSSLOpenSSL.VerifyPeer(ACertificate: TIdX509; - AOk: Boolean; ADepth, AError: Integer): Boolean; -begin - Result := DoVerifyPeer(ACertificate, AOk, ADepth, AError); -end; - -function TIdServerIOHandlerSSLOpenSSL.GetIOHandlerSelf: TIdSSLIOHandlerSocketOpenSSL; -begin - Result := nil; -end; - -/////////////////////////////////////////////////////// -// TIdSSLIOHandlerSocketOpenSSL -/////////////////////////////////////////////////////// - -function TIdServerIOHandlerSSLOpenSSL.MakeClientIOHandler: TIdSSLIOHandlerSocketBase; -var - LIO : TIdSSLIOHandlerSocketOpenSSL; -begin - LIO := TIdSSLIOHandlerSocketOpenSSL.Create(nil); - try - LIO.PassThrough := True; - // LIO.SSLOptions.Free; - // LIO.SSLOptions := SSLOptions; - // LIO.SSLContext := SSLContext; - LIO.SSLOptions.Assign(SSLOptions); - // LIO.SSLContext := SSLContext; - LIO.SSLContext := nil;//SSLContext.Clone; // BGO: clone does not work, it must be either NIL, or SSLContext - LIO.OnGetPassword := DoGetPassword; - LIO.OnGetPasswordEx := OnGetPasswordEx; - except - LIO.Free; - raise; - end; - Result := LIO; -end; - -{ TIdSSLIOHandlerSocketOpenSSL } - -procedure TIdSSLIOHandlerSocketOpenSSL.InitComponent; -begin - inherited InitComponent; - IsPeer := False; - fxSSLOptions := TIdSSLOptions_Internal.Create; - TIdSSLOptions_Internal(fxSSLOptions).Parent := Self; - fSSLLayerClosed := True; - fSSLContext := nil; -end; - -destructor TIdSSLIOHandlerSocketOpenSSL.Destroy; -begin - FreeAndNil(fSSLSocket); - //we do not destroy these if their Parent is not Self - //because these do not belong to us when we are in a server. - if (fSSLContext <> nil) and (fSSLContext.Parent = Self) then begin - FreeAndNil(fSSLContext); - end; - if (fxSSLOptions <> nil) and - (fxSSLOptions is TIdSSLOptions_Internal) and - (TIdSSLOptions_Internal(fxSSLOptions).Parent = Self) then - begin - FreeAndNil(fxSSLOptions); - end; - inherited Destroy; -end; - -procedure TIdSSLIOHandlerSocketOpenSSL.ConnectClient; -var - LPassThrough: Boolean; -begin - // RLebeau: initialize OpenSSL before connecting the socket... - try - Init; - except - on EIdOSSLCouldNotLoadSSLLibrary do begin - if not PassThrough then raise; - end; - end; - // RLebeau 1/11/07: In case a proxy is being used, pass through - // any data from the base class unencrypted when setting up that - // connection. We should do this anyway since SSL hasn't been - // negotiated yet! - LPassThrough := fPassThrough; - fPassThrough := True; - try - inherited ConnectClient; - finally - fPassThrough := LPassThrough; - end; - DoBeforeConnect(Self); - // CreateSSLContext(sslmClient); - // CreateSSLContext(SSLOptions.fMode); - StartSSL; -end; - -procedure TIdSSLIOHandlerSocketOpenSSL.StartSSL; -begin - if not PassThrough then begin - OpenEncodedConnection; - end; -end; - -procedure TIdSSLIOHandlerSocketOpenSSL.Close; -begin - FreeAndNil(fSSLSocket); - if fSSLContext <> nil then begin - if fSSLContext.Parent = Self then begin - FreeAndNil(fSSLContext); - end else begin - fSSLContext := nil; - end; - end; - inherited Close; -end; - -procedure TIdSSLIOHandlerSocketOpenSSL.Open; -begin - FOpened := False; - inherited Open; -end; - -function TIdSSLIOHandlerSocketOpenSSL.Readable(AMSec: Integer = IdTimeoutDefault): Boolean; -begin - if not fPassThrough then - begin - Result := (fSSLSocket <> nil) and (ssl_pending(fSSLSocket.fSSL) > 0); - if Result then Exit; - end; - Result := inherited Readable(AMSec); -end; - -procedure TIdSSLIOHandlerSocketOpenSSL.SetPassThrough(const Value: Boolean); -begin - if fPassThrough <> Value then begin - if not Value then begin - if BindingAllocated then begin - if Assigned(fSSLContext) then begin - OpenEncodedConnection; - end else begin - raise EIdOSSLCouldNotLoadSSLLibrary.Create(RSOSSLCouldNotLoadSSLLibrary); - end; - end; - end - else begin - // RLebeau 8/16/2019: need to call SSL_shutdown() here if the SSL/TLS session is active. - // This is for FTP when handling CCC and REIN commands. The SSL/TLS session needs to be - // shutdown cleanly on both ends without closing the underlying socket connection because - // it is going to be used for continued unsecure communications! - if (fSSLSocket <> nil) and (fSSLSocket.fSSL <> nil) then begin - // if SSL_shutdown() returns 0, a "close notify" was sent to the peer and SSL_shutdown() - // needs to be called again to receive the peer's "close notify" in response... - if SSL_shutdown(fSSLSocket.fSSL) = 0 then begin - SSL_shutdown(fSSLSocket.fSSL); - end; - end; - {$IFDEF WIN32_OR_WIN64} - // begin bug fix - if BindingAllocated and IndyCheckWindowsVersion(6) then - begin - // disables Vista+ SSL_Read and SSL_Write timeout fix - Binding.SetSockOpt(Id_SOL_SOCKET, Id_SO_RCVTIMEO, 0); - Binding.SetSockOpt(Id_SOL_SOCKET, Id_SO_SNDTIMEO, 0); - end; - // end bug fix - {$ENDIF} - end; - fPassThrough := Value; - end; -end; - -function TIdSSLIOHandlerSocketOpenSSL.RecvEnc(var VBuffer: TIdBytes): Integer; -begin - Result := fSSLSocket.Recv(VBuffer); -end; - -function TIdSSLIOHandlerSocketOpenSSL.SendEnc(const ABuffer: TIdBytes; - const AOffset, ALength: Integer): Integer; -begin - Result := fSSLSocket.Send(ABuffer, AOffset, ALength); -end; - -procedure TIdSSLIOHandlerSocketOpenSSL.AfterAccept; -begin - try - inherited AfterAccept; - // RLebeau: initialize OpenSSL after accepting a client socket... - try - Init; - except - on EIdOSSLCouldNotLoadSSLLibrary do begin - if not PassThrough then raise; - end; - end; - StartSSL; - except - Close; - raise; - end; -end; - -procedure TIdSSLIOHandlerSocketOpenSSL.Init; -//see also TIdServerIOHandlerSSLOpenSSL.Init -begin - if not Assigned(fSSLContext) then begin - fSSLContext := TIdSSLContext.Create; - fSSLContext.Parent := Self; - fSSLContext.RootCertFile := SSLOptions.RootCertFile; - fSSLContext.CertFile := SSLOptions.CertFile; - fSSLContext.KeyFile := SSLOptions.KeyFile; - fSSLContext.DHParamsFile := SSLOptions.DHParamsFile; - fSSLContext.fVerifyDepth := SSLOptions.fVerifyDepth; - fSSLContext.fVerifyMode := SSLOptions.fVerifyMode; - // fSSLContext.fVerifyFile := SSLOptions.fVerifyFile; - fSSLContext.fVerifyDirs := SSLOptions.fVerifyDirs; - fSSLContext.fCipherList := SSLOptions.fCipherList; - fSSLContext.VerifyOn := Assigned(fOnVerifyPeer); - fSSLContext.StatusInfoOn := Assigned(fOnStatusInfo) or Assigned(fOnStatusInfoEx); - //fSSLContext.PasswordRoutineOn := Assigned(fOnGetPassword); - fSSLContext.fMethod := SSLOptions.Method; - fSSLContext.fSSLVersions := SSLOptions.SSLVersions; - fSSLContext.fMode := SSLOptions.Mode; - fSSLContext.InitContext(sslCtxClient); - end; -end; -//} - -procedure TIdSSLIOHandlerSocketOpenSSL.DoStatusInfo(const AMsg: String); -begin - if Assigned(fOnStatusInfo) then begin - fOnStatusInfo(AMsg); - end; -end; - -procedure TIdSSLIOHandlerSocketOpenSSL.DoStatusInfoEx( - const AsslSocket: PSSL; const AWhere, Aret: TIdC_INT; const AWhereStr, - ARetStr: String); -begin - if Assigned(FOnStatusInfoEx) then begin - FOnStatusInfoEx(Self,AsslSocket,AWhere,Aret,AWHereStr,ARetStr); - end; -end; - -procedure TIdSSLIOHandlerSocketOpenSSL.DoGetPassword(var Password: String); -begin - if Assigned(fOnGetPassword) then begin - fOnGetPassword(Password); - end; -end; - -procedure TIdSSLIOHandlerSocketOpenSSL.DoGetPasswordEx(var VPassword: String; - const AIsWrite: Boolean); -begin - if Assigned(fOnGetPasswordEx) then begin - fOnGetPasswordEx(Self,VPassword,AIsWrite); - end; -end; - -function TIdSSLIOHandlerSocketOpenSSL.DoVerifyPeer(Certificate: TIdX509; - AOk: Boolean; ADepth, AError: Integer): Boolean; -begin - Result := True; - if Assigned(fOnVerifyPeer) then begin - Result := fOnVerifyPeer(Certificate, AOk, ADepth, AError); - end; -end; - -procedure TIdSSLIOHandlerSocketOpenSSL.OpenEncodedConnection; -var - {$IFDEF WIN32_OR_WIN64} - LTimeout: Integer; - {$ENDIF} - LMode: TIdSSLMode; - LHost: string; - - // TODO: move the following to TIdSSLIOHandlerSocketBase... - - function GetURIHost: string; - var - LURI: TIdURI; - begin - Result := ''; - if URIToCheck <> '' then - begin - LURI := TIdURI.Create(URIToCheck); - try - Result := LURI.Host; - finally - LURI.Free; - end; - end; - end; - - function GetProxyTargetHost: string; - var - // under ARC, convert a weak reference to a strong reference before working with it - LTransparentProxy, LNextTransparentProxy: TIdCustomTransparentProxy; - begin - Result := ''; - // RLebeau: not reading from the property as it will create a - // default Proxy object if one is not already assigned... - LTransparentProxy := FTransparentProxy; - if Assigned(LTransparentProxy) then - begin - if LTransparentProxy.Enabled then - begin - repeat - LNextTransparentProxy := LTransparentProxy.ChainedProxy; - if not Assigned(LNextTransparentProxy) then Break; - if not LNextTransparentProxy.Enabled then Break; - LTransparentProxy := LNextTransparentProxy; - until False; - Result := LTransparentProxy.Host; - end; - end; - end; - -begin - Assert(Binding<>nil); - if not Assigned(fSSLSocket) then begin - fSSLSocket := TIdSSLSocket.Create(Self); - end; - Assert(fSSLSocket.fSSLContext=nil); - fSSLSocket.fSSLContext := fSSLContext; - {$IFDEF WIN32_OR_WIN64} - // begin bug fix - if IndyCheckWindowsVersion(6) then - begin - // Note: Fix needed to allow SSL_Read and SSL_Write to timeout under - // Vista+ when connection is dropped - LTimeout := FReadTimeOut; - if LTimeout <= 0 then begin - LTimeout := 30000; // 30 seconds - end; - Binding.SetSockOpt(Id_SOL_SOCKET, Id_SO_RCVTIMEO, LTimeout); - Binding.SetSockOpt(Id_SOL_SOCKET, Id_SO_SNDTIMEO, LTimeout); - end; - // end bug fix - {$ENDIF} - // RLebeau 7/2/2015: do not rely on IsPeer to decide whether to call Connect() - // or Accept(). SSLContext.Mode controls whether a client or server method is - // used to handle the connection, so that same value should be used here as well. - // A user encountered a scenario where he needed to connect a TIdTCPClient to a - // TCP server on a hardware device, but run the client's SSLIOHandler as an SSL - // server because the device was initiating the SSL handshake as an SSL client. - // IsPeer was not designed to handle that scenario. Setting IsPeer to True - // allowed Accept() to be called here, but at the cost of causing memory leaks - // in TIdSSLIOHandlerSocketOpenSSL.Destroy() and TIdSSLIOHandlerSocketOpenSSL.Close() - // in client components! IsPeer is intended to be set to True only in server - // components... - LMode := fSSLContext.Mode; - if not (LMode in [sslmClient, sslmServer]) then begin - // Mode must be sslmBoth (or else TIdSSLContext.SetSSLMethod() would have - // raised an exception), so just fall back to previous behavior for now, - // until we can figure out a better way to handle this scenario... - if IsPeer then begin - LMode := sslmServer; - end else begin - LMode := sslmClient; - end; - end; - if LMode = sslmClient then begin - LHost := GetURIHost; - if LHost = '' then - begin - LHost := GetProxyTargetHost; - if LHost = '' then begin - LHost := Self.Host; - end; - end; - fSSLSocket.fHostName := LHost; - fSSLSocket.Connect(Binding.Handle); - end else begin - fSSLSocket.fHostName := ''; - fSSLSocket.Accept(Binding.Handle); - end; - fPassThrough := False; -end; - -procedure TIdSSLIOHandlerSocketOpenSSL.DoBeforeConnect(ASender: TIdSSLIOHandlerSocketOpenSSL); -begin - if Assigned(OnBeforeConnect) then begin - OnBeforeConnect(Self); - end; -end; - - -// TODO: add an AOwner parameter -function TIdSSLIOHandlerSocketOpenSSL.Clone: TIdSSLIOHandlerSocketBase; -var - LIO : TIdSSLIOHandlerSocketOpenSSL; -begin - LIO := TIdSSLIOHandlerSocketOpenSSL.Create(nil); - try - LIO.SSLOptions.Assign( SSLOptions ); - LIO.OnStatusInfo := DoStatusInfo; - LIO.OnGetPassword := DoGetPassword; - LIO.OnGetPasswordEx := OnGetPasswordEx; - LIO.OnVerifyPeer := DoVerifyPeer; - LIO.fSSLSocket := TIdSSLSocket.Create(Self); - except - LIO.Free; - raise; - end; - Result := LIO; -end; - -function TIdSSLIOHandlerSocketOpenSSL.CheckForError(ALastResult: Integer): Integer; -//var -// err: Integer; -begin - if PassThrough then begin - Result := inherited CheckForError(ALastResult); - end else begin - Result := fSSLSocket.GetSSLError(ALastResult); - if Result = SSL_ERROR_NONE then begin - Result := 0; - Exit; - end; - if Result = SSL_ERROR_SYSCALL then begin - Result := inherited CheckForError(Integer(Id_SOCKET_ERROR)); - Exit; - end; - EIdOpenSSLAPISSLError.RaiseExceptionCode(Result, ALastResult, ''); - end; -end; - -procedure TIdSSLIOHandlerSocketOpenSSL.RaiseError(AError: Integer); -begin - if (PassThrough) or (AError = Id_WSAESHUTDOWN) or (AError = Id_WSAECONNABORTED) or (AError = Id_WSAECONNRESET) then begin - inherited RaiseError(AError); - end else begin - EIdOpenSSLAPISSLError.RaiseException(fSSLSocket.fSSL, AError, ''); - end; -end; - -{ IIdSSLOpenSSLCallbackHelper } - -function TIdSSLIOHandlerSocketOpenSSL.GetPassword(const AIsWrite : Boolean): string; -begin - DoGetPasswordEx(Result, AIsWrite); - if Result = '' then begin - DoGetPassword(Result); - end; -end; - -procedure TIdSSLIOHandlerSocketOpenSSL.StatusInfo(const ASslSocket: PSSL; - AWhere, ARet: TIdC_INT; const AStatusStr: string); -var - LType, LMsg: string; -begin - DoStatusInfo(AStatusStr); - if Assigned(fOnStatusInfoEx) then begin - GetStateVars(ASslSocket, AWhere, ARet, LType, LMsg); - DoStatusInfoEx(ASslSocket, AWhere, ARet, LType, LMsg); - end; -end; - -function TIdSSLIOHandlerSocketOpenSSL.VerifyPeer(ACertificate: TIdX509; - AOk: Boolean; ADepth, AError: Integer): Boolean; -begin - Result := DoVerifyPeer(ACertificate, AOk, ADepth, AError); -end; - -function TIdSSLIOHandlerSocketOpenSSL.GetIOHandlerSelf: TIdSSLIOHandlerSocketOpenSSL; -begin - Result := Self; -end; - -{ TIdSSLContext } - -constructor TIdSSLContext.Create; -begin - inherited Create; - //an exception here probably means that you are using the wrong version - //of the openssl libraries. refer to comments at the top of this file. - if not LoadOpenSSLLibrary then begin - raise EIdOSSLCouldNotLoadSSLLibrary.Create(RSOSSLCouldNotLoadSSLLibrary); - end; - fVerifyMode := []; - fMode := sslmUnassigned; - fSessionId := 1; -end; - -destructor TIdSSLContext.Destroy; -begin - DestroyContext; - inherited Destroy; -end; - -procedure TIdSSLContext.DestroyContext; -begin - if fContext <> nil then begin - SSL_CTX_free(fContext); - fContext := nil; - end; -end; - -procedure TIdSSLContext.InitContext(CtxMode: TIdSSLCtxMode); -var - SSLMethod: PSSL_METHOD; - error: TIdC_INT; -// pCAname: PSTACK_X509_NAME; - {$IFDEF USE_MARSHALLED_PTRS} - M: TMarshaller; - {$ENDIF} -begin - // Destroy the context first - DestroyContext; - if fMode = sslmUnassigned then begin - if CtxMode = sslCtxServer then begin - fMode := sslmServer; - end else begin - fMode := sslmClient; - end - end; - // get SSL method function (SSL2, SSL23, SSL3, TLS) - SSLMethod := SetSSLMethod; - // create new SSL context - fContext := SSL_CTX_new(SSLMethod); - if fContext = nil then begin - EIdOSSLCreatingContextError.RaiseException(RSSSLCreatingContextError); - end; - //set SSL Versions we will use - - // in OpenSSL 1.0.2g onwards, SSLv2 is disabled and not exported by default - // at compile-time. If OpenSSL is compiled with "enable-ssl2" enabled so the - // SSLv2_xxx_method() functions are exported, SSLv2 is still disabled by - // default in the SSLv23_xxx_method() functions and must be enabled explicitly... - if IsOpenSSL_SSLv2_Available then begin - if not (sslvSSLv2 in SSLVersions) then begin - SSL_CTX_set_options(fContext, SSL_OP_NO_SSLv2); - end - else if (fMethod = sslvSSLv23) then begin - SSL_CTX_clear_options(fContext, SSL_OP_NO_SSLv2); - end; - end; - // SSLv3 might also be disabled as well.. - if IsOpenSSL_SSLv3_Available then begin - if not (sslvSSLv3 in SSLVersions) then begin - SSL_CTX_set_options(fContext, SSL_OP_NO_SSLv3); - end - else if (fMethod = sslvSSLv23) then begin - SSL_CTX_clear_options(fContext, SSL_OP_NO_SSLv3); - end; - end; - // may as well do the same for all of them... - if IsOpenSSL_TLSv1_0_Available then begin - if not (sslvTLSv1 in SSLVersions) then begin - SSL_CTX_set_options(fContext, SSL_OP_NO_TLSv1); - end - else if (fMethod = sslvSSLv23) then begin - SSL_CTX_clear_options(fContext, SSL_OP_NO_TLSv1); - end; - end; -{IMPORTANT!!! Do not set SSL_CTX_set_options SSL_OP_NO_TLSv1_1 and -SSL_OP_NO_TLSv1_2 if that functionality is not available. OpenSSL 1.0 and -earlier do not support those flags. Those flags would only cause -an invalid MAC when doing SSL.} - if IsOpenSSL_TLSv1_1_Available then begin - if not (sslvTLSv1_1 in SSLVersions) then begin - SSL_CTX_set_options(fContext, SSL_OP_NO_TLSv1_1); - end - else if (fMethod = sslvSSLv23) then begin - SSL_CTX_clear_options(fContext, SSL_OP_NO_TLSv1_1); - end; - end; - if IsOpenSSL_TLSv1_2_Available then begin - if not (sslvTLSv1_2 in SSLVersions) then begin - SSL_CTX_set_options(fContext, SSL_OP_NO_TLSv1_2); - end - else if (fMethod = sslvSSLv23) then begin - SSL_CTX_clear_options(fContext, SSL_OP_NO_TLSv1_2); - end; - end; - - SSL_CTX_set_mode(fContext, SSL_MODE_AUTO_RETRY); - // assign a password lookup routine -// if PasswordRoutineOn then begin - SSL_CTX_set_default_passwd_cb(fContext, @PasswordCallback); - SSL_CTX_set_default_passwd_cb_userdata(fContext, Self); -// end; - - SSL_CTX_set_default_verify_paths(fContext); - // load key and certificate files - if (RootCertFile <> '') or (VerifyDirs <> '') then begin {Do not Localize} - if not LoadRootCert then begin - EIdOSSLLoadingRootCertError.RaiseException(RSSSLLoadingRootCertError); - end; - end; - if CertFile <> '' then begin {Do not Localize} - if not LoadCert then begin - EIdOSSLLoadingCertError.RaiseException(RSSSLLoadingCertError); - end; - end; - if KeyFile <> '' then begin {Do not Localize} - if not LoadKey then begin - EIdOSSLLoadingKeyError.RaiseException(RSSSLLoadingKeyError); - end; - end; - if DHParamsFile <> '' then begin {Do not Localize} - if not LoadDHParams then begin - EIdOSSLLoadingDHParamsError.RaiseException(RSSSLLoadingDHParamsError); - end; - end; - if StatusInfoOn then begin - SSL_CTX_set_info_callback(fContext, InfoCallback); - end; - //if_SSL_CTX_set_tmp_rsa_callback(hSSLContext, @RSACallback); - if fCipherList <> '' then begin {Do not Localize} - error := SSL_CTX_set_cipher_list(fContext, - {$IFDEF USE_MARSHALLED_PTRS} - M.AsAnsi(fCipherList).ToPointer - {$ELSE} - PAnsiChar( - {$IFDEF STRING_IS_ANSI} - fCipherList - {$ELSE} - AnsiString(fCipherList) // explicit cast to Ansi - {$ENDIF} - ) - {$ENDIF} - ); - end else begin - // RLebeau: don't override OpenSSL's default. As OpenSSL evolves, the - // SSL_DEFAULT_CIPHER_LIST constant defined in the C/C++ SDK may change, - // while Indy's define of it might take some time to catch up. We don't - // want users using an older default with newer DLLs... - (* - error := SSL_CTX_set_cipher_list(fContext, - {$IFDEF USE_MARSHALLED_PTRS} - M.AsAnsi(SSL_DEFAULT_CIPHER_LIST).ToPointer - {$ELSE} - SSL_DEFAULT_CIPHER_LIST - {$ENDIF} - ); - *) - error := 1; - end; - if error <= 0 then begin - // TODO: should this be using EIdOSSLSettingCipherError.RaiseException() instead? - raise EIdOSSLSettingCipherError.Create(RSSSLSettingCipherError); - end; - if fVerifyMode <> [] then begin - SetVerifyMode(fVerifyMode, VerifyOn); - end; - if CtxMode = sslCtxServer then begin - SSL_CTX_set_session_id_context(fContext, PByte(@fSessionId), SizeOf(fSessionId)); - end; - // CA list - if RootCertFile <> '' then begin {Do not Localize} - SSL_CTX_set_client_CA_list(fContext, IndySSL_load_client_CA_file(RootCertFile)); - end - - // TODO: provide an event so users can apply their own settings as needed... -end; - -procedure TIdSSLContext.SetVerifyMode(Mode: TIdSSLVerifyModeSet; CheckRoutine: Boolean); -var - Func: TSSL_CTX_set_verify_callback; -begin - if fContext<>nil then begin -// SSL_CTX_set_default_verify_paths(fContext); - if CheckRoutine then begin - Func := VerifyCallback; - end else begin - Func := nil; - end; - SSL_CTX_set_verify(fContext, TranslateInternalVerifyToSSL(Mode), Func); - SSL_CTX_set_verify_depth(fContext, fVerifyDepth); - end; -end; - -function TIdSSLContext.GetVerifyMode: TIdSSLVerifyModeSet; -begin - Result := fVerifyMode; -end; -{ -function TIdSSLContext.LoadVerifyLocations(FileName: String; Dirs: String): Boolean; -begin - Result := False; - - if (Dirs <> '') or (FileName <> '') then begin - if IndySSL_CTX_load_verify_locations(fContext, FileName, Dirs) <= 0 then begin - raise EIdOSSLCouldNotLoadSSLLibrary.Create(RSOSSLCouldNotLoadSSLLibrary); - end; - end; - - Result := True; -end; -} -function SelectTLS1Method(const AMode : TIdSSLMode) : PSSL_METHOD; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := nil; - case AMode of - sslmServer : begin - if Assigned(TLSv1_server_method) then begin - Result := TLSv1_server_method(); - end; - end; - sslmClient : begin - if Assigned(TLSv1_client_method) then begin - Result := TLSv1_client_method(); - end; - end; - else - if Assigned(TLSv1_method) then begin - Result := TLSv1_method(); - end; - end; -end; - -function TIdSSLContext.SetSSLMethod: PSSL_METHOD; -begin - Result := nil; - if fMode = sslmUnassigned then begin - raise EIdOSSLModeNotSet.Create(RSOSSLModeNotSet); - end; - case fMethod of - sslvSSLv2: - case fMode of - sslmServer : begin - if Assigned(SSLv2_server_method) then begin - Result := SSLv2_server_method(); - end; - end; - sslmClient : begin - if Assigned(SSLv2_client_method) then begin - Result := SSLv2_client_method(); - end; - end; - else - if Assigned(SSLv2_method) then begin - Result := SSLv2_method(); - end; - end; - sslvSSLv23: - case fMode of - sslmServer : begin - if Assigned(SSLv23_server_method) then begin - Result := SSLv23_server_method(); - end; - end; - sslmClient : begin - if Assigned(SSLv23_client_method) then begin - Result := SSLv23_client_method(); - end; - end; - else - if Assigned(SSLv23_method) then begin - Result := SSLv23_method(); - end; - end; - sslvSSLv3: - case fMode of - sslmServer : begin - if Assigned(SSLv3_server_method) then begin - Result := SSLv3_server_method(); - end; - end; - sslmClient : begin - if Assigned(SSLv3_client_method) then begin - Result := SSLv3_client_method(); - end; - end; - else - if Assigned(SSLv3_method) then begin - Result := SSLv3_method(); - end; - end; - {IMPORTANT!!! fallback to TLS 1.0 if TLS 1.1 or 1.2 is not available. - This is important because OpenSSL earlier than 1.0.1 does not support this - functionality. - - Todo: Figure out a better fallback. - } - // TODO: get rid of this fallack! If the user didn't choose TLS 1.0, then - // don't falback to it, just fail instead, like with all of the other SSL/TLS - // versions... - sslvTLSv1: - Result := SelectTLS1Method(fMode); - sslvTLSv1_1: - case fMode of - sslmServer : begin - if Assigned(TLSv1_1_server_method) then begin - Result := TLSv1_1_server_method(); - end else begin - Result := SelectTLS1Method(fMode); - end; - end; - sslmClient : begin - if Assigned(TLSv1_1_client_method) then begin - Result := TLSv1_1_client_method(); - end else begin - Result := SelectTLS1Method(fMode); - end; - end; - else - if Assigned(TLSv1_1_method) then begin - Result := TLSv1_1_method(); - end else begin - Result := SelectTLS1Method(fMode); - end; - end; - sslvTLSv1_2: - case fMode of - sslmServer : begin - if Assigned(TLSv1_2_server_method) then begin - Result := TLSv1_2_server_method(); - end else begin - // TODO: fallback to TLSv1.1 if available? - Result := SelectTLS1Method(fMode); - end; - end; - sslmClient : begin - if Assigned(TLSv1_2_client_method) then begin - Result := TLSv1_2_client_method(); - end else begin - // TODO: fallback to TLSv1.1 if available? - Result := SelectTLS1Method(fMode); - end; - end; - else - if Assigned(TLSv1_2_method) then begin - Result := TLSv1_2_method(); - end else begin - // TODO: fallback to TLSv1.1 if available? - Result := SelectTLS1Method(fMode); - end; - end; - end; - if Result = nil then begin - raise EIdOSSLGetMethodError.Create(RSSSLGetMethodError); - end; -end; - -function TIdSSLContext.LoadRootCert: Boolean; -begin - Result := IndySSL_CTX_load_verify_locations(fContext, RootCertFile, VerifyDirs) > 0; -end; - -function TIdSSLContext.LoadCert: Boolean; -begin - if PosInStrArray(ExtractFileExt(CertFile), ['.p12', '.pfx'], False) <> -1 then begin - Result := IndySSL_CTX_use_certificate_file_PKCS12(fContext, CertFile) > 0; - end else begin - //OpenSSL 1.0.2 has a new function, SSL_CTX_use_certificate_chain_file - //that handles a chain of certificates in a PEM file. That is prefered. - if Assigned(SSL_CTX_use_certificate_chain_file) then begin - Result := IndySSL_CTX_use_certificate_chain_file(fContext, CertFile) > 0; - end else begin - Result := IndySSL_CTX_use_certificate_file(fContext, CertFile, SSL_FILETYPE_PEM) > 0; - end; - end; -end; - -function TIdSSLContext.LoadKey: Boolean; -begin - if PosInStrArray(ExtractFileExt(KeyFile), ['.p12', '.pfx'], False) <> -1 then begin - Result := IndySSL_CTX_use_PrivateKey_file_PKCS12(fContext, KeyFile) > 0; - end else begin - Result := IndySSL_CTX_use_PrivateKey_file(fContext, KeyFile, SSL_FILETYPE_PEM) > 0; - end; - if Result then begin - Result := SSL_CTX_check_private_key(fContext) > 0; - end; -end; - -function TIdSSLContext.LoadDHParams: Boolean; -begin - Result := IndySSL_CTX_use_DHparams_file(fContext, fsDHParamsFile, SSL_FILETYPE_PEM) > 0; -end; - -////////////////////////////////////////////////////////////// - -function TIdSSLContext.Clone: TIdSSLContext; -begin - Result := TIdSSLContext.Create; - Result.StatusInfoOn := StatusInfoOn; -// property PasswordRoutineOn: Boolean read fPasswordRoutineOn write fPasswordRoutineOn; - Result.VerifyOn := VerifyOn; - Result.Method := Method; - Result.SSLVersions := SSLVersions; - Result.Mode := Mode; - Result.RootCertFile := RootCertFile; - Result.CertFile := CertFile; - Result.KeyFile := KeyFile; - Result.VerifyMode := VerifyMode; - Result.VerifyDepth := VerifyDepth; -end; - -{ TIdSSLSocket } - -constructor TIdSSLSocket.Create(Parent: TObject); -begin - inherited Create; - fParent := Parent; -end; - -destructor TIdSSLSocket.Destroy; -begin - if fSSL <> nil then begin - // TODO: should this be moved to TIdSSLContext instead? Is this here - // just to make sure the SSL shutdown does not log any messages? - { - if (fSSLContext <> nil) and (fSSLContext.StatusInfoOn) and - (fSSLContext.fContext <> nil) then begin - SSL_CTX_set_info_callback(fSSLContext.fContext, nil); - end; - } - //SSL_set_shutdown(fSSL, SSL_SENT_SHUTDOWN); - SSL_shutdown(fSSL); - SSL_free(fSSL); - fSSL := nil; - end; - FreeAndNil(fSSLCipher); - FreeAndNil(fPeerCert); - inherited Destroy; -end; - -function TIdSSLSocket.GetSSLError(retCode: Integer): Integer; -begin - // COMMENT!!! - // I found out that SSL layer should not interpret errors, cause they will pop up - // on the socket layer. Only thing that the SSL layer should consider is key - // or protocol renegotiation. This is done by loop in read and write - Result := SSL_get_error(fSSL, retCode); - case Result of - SSL_ERROR_NONE: - Result := SSL_ERROR_NONE; - SSL_ERROR_WANT_WRITE: - Result := SSL_ERROR_WANT_WRITE; - SSL_ERROR_WANT_READ: - Result := SSL_ERROR_WANT_READ; - SSL_ERROR_ZERO_RETURN: - Result := SSL_ERROR_ZERO_RETURN; - //Result := SSL_ERROR_NONE; - { - // ssl layer has been disconnected, it is not necessary that also - // socked has been closed - case Mode of - sslemClient: begin - case Action of - sslWrite: begin - if retCode = 0 then begin - Result := 0; - end - else begin - raise EIdException.Create(RSOSSLConnectionDropped); // TODO: create a new Exception class for this - end; - end; - end; - end;} - - //raise EIdException.Create(RSOSSLConnectionDropped); // TODO: create a new Exception class for this - // X509_LOOKUP event is not really an error, just an event - // SSL_ERROR_WANT_X509_LOOKUP: - // raise EIdException.Create(RSOSSLCertificateLookup); // TODO: create a new Exception class for this - SSL_ERROR_SYSCALL: - Result := SSL_ERROR_SYSCALL; - // Result := SSL_ERROR_NONE; - - {//raise EIdException.Create(RSOSSLInternal); // TODO: create a new Exception class for this - if (retCode <> 0) or (DataLen <> 0) then begin - raise EIdException.Create(RSOSSLConnectionDropped); // TODO: create a new Exception class for this - end - else begin - Result := 0; - end;} - - SSL_ERROR_SSL: - // raise EIdException.Create(RSOSSLInternal); // TODO: create a new Exception class for this - Result := SSL_ERROR_SSL; - // Result := SSL_ERROR_NONE; - end; -end; - -procedure TIdSSLSocket.Accept(const pHandle: TIdStackSocketHandle); -//Accept and Connect have a lot of duplicated code -var - error: Integer; - StatusStr: String; - LParentIO: TIdSSLIOHandlerSocketOpenSSL; - LHelper: IIdSSLOpenSSLCallbackHelper; -begin - Assert(fSSL=nil); - Assert(fSSLContext<>nil); - fSSL := SSL_new(fSSLContext.fContext); - if fSSL = nil then begin - raise EIdOSSLCreatingSessionError.Create(RSSSLCreatingSessionError); - end; - error := SSL_set_app_data(fSSL, Self); - if error <= 0 then begin - EIdOSSLDataBindingError.RaiseException(fSSL, error, RSSSLDataBindingError); - end; - error := SSL_set_fd(fSSL, pHandle); - if error <= 0 then begin - EIdOSSLFDSetError.RaiseException(fSSL, error, RSSSLFDSetError); - end; - // RLebeau: if this socket's IOHandler was cloned, no need to reuse the - // original IOHandler's active session ID, since this is a server socket - // that generates its own sessions... - // - // RLebeau: is this actually true? Should we be reusing the original - // IOHandler's active session ID regardless of whether this is a client - // or server socket? What about FTP in non-passive mode, for example? - { - if (LParentIO <> nil) and (LParentIO.fSSLSocket <> nil) and - (LParentIO.fSSLSocket <> Self) then - begin - SSL_copy_session_id(fSSL, LParentIO.fSSLSocket.fSSL); - end; - } - error := SSL_accept(fSSL); - if error <= 0 then begin - EIdOSSLAcceptError.RaiseException(fSSL, error, RSSSLAcceptError); - end; - if Supports(fParent, IIdSSLOpenSSLCallbackHelper, IInterface(LHelper)) then begin - LParentIO := LHelper.GetIOHandlerSelf; - if LParentIO <> nil then begin - StatusStr := 'Cipher: name = ' + Cipher.Name + '; ' + {Do not Localize} - 'description = ' + Cipher.Description + '; ' + {Do not Localize} - 'bits = ' + IntToStr(Cipher.Bits) + '; ' + {Do not Localize} - 'version = ' + Cipher.Version + '; '; {Do not Localize} - LParentIO.DoStatusInfo(StatusStr); - end; - LHelper := nil; - end; -end; - -procedure TIdSSLSocket.Connect(const pHandle: TIdStackSocketHandle); -var - error: Integer; - StatusStr: String; - LParentIO: TIdSSLIOHandlerSocketOpenSSL; - LHelper: IIdSSLOpenSSLCallbackHelper; -begin - Assert(fSSL=nil); - Assert(fSSLContext<>nil); - if Supports(fParent, IIdSSLOpenSSLCallbackHelper, IInterface(LHelper)) then begin - LParentIO := LHelper.GetIOHandlerSelf; - end else begin - LParentIO := nil; - end; - fSSL := SSL_new(fSSLContext.fContext); - if fSSL = nil then begin - raise EIdOSSLCreatingSessionError.Create(RSSSLCreatingSessionError); - end; - error := SSL_set_app_data(fSSL, Self); - if error <= 0 then begin - EIdOSSLDataBindingError.RaiseException(fSSL, error, RSSSLDataBindingError); - end; - error := SSL_set_fd(fSSL, pHandle); - if error <= 0 then begin - EIdOSSLFDSetError.RaiseException(fSSL, error, RSSSLFDSetError); - end; - // RLebeau: if this socket's IOHandler was cloned, reuse the - // original IOHandler's active session ID... - if (LParentIO <> nil) and (LParentIO.fSSLSocket <> nil) and - (LParentIO.fSSLSocket <> Self) then - begin - SSL_copy_session_id(fSSL, LParentIO.fSSLSocket.fSSL); - end; - {$IFNDEF OPENSSL_NO_TLSEXT} - error := SSL_set_tlsext_host_name(fSSL, fHostName); - if error <= 0 then begin - // RLebeau: for the time being, not raising an exception on error, as I don't - // know which OpenSSL versions support this extension, and which error code(s) - // are safe to ignore on those versions... - //EIdOSSLSettingTLSHostNameError.RaiseException(fSSL, error, RSSSLSettingTLSHostNameError); - end; - {$ENDIF} - error := SSL_connect(fSSL); - if error <= 0 then begin - // TODO: if sslv23 is being used, but sslv23 is not being used on the - // remote side, SSL_connect() will fail. In that case, before giving up, - // try re-connecting using a version-specific method for each enabled - // version, maybe one will succeed... - EIdOSSLConnectError.RaiseException(fSSL, error, RSSSLConnectError); - end; - // TODO: even if SSL_connect() returns success, the connection might - // still be insecure if SSL_connect() detected that certificate validation - // actually failed, but ignored it because SSL_VERIFY_PEER was disabled! - // It would report such a failure via SSL_get_verify_result() instead of - // returning an error code, so we should call SSL_get_verify_result() here - // to make sure... - if LParentIO <> nil then begin - StatusStr := 'Cipher: name = ' + Cipher.Name + '; ' + {Do not Localize} - 'description = ' + Cipher.Description + '; ' + {Do not Localize} - 'bits = ' + IntToStr(Cipher.Bits) + '; ' + {Do not Localize} - 'version = ' + Cipher.Version + '; '; {Do not Localize} - LParentIO.DoStatusInfo(StatusStr); - end; - // TODO: enable this - { - var - peercert: PX509; - lHostName: AnsiString; - peercert := SSL_get_peer_certificate(fSSL); - try - lHostName := AnsiString(fHostName); - if (X509_check_host(peercert, PByte(PAnsiChar(lHostName)), Length(lHostName), 0) != 1) and - (not certificate_host_name_override(peercert, PAnsiChar(lHostName)) then - begin - EIdOSSLCertificateError.RaiseException(fSSL, error, 'SSL certificate does not match host name'); - end; - finally - X509_free(peercert); - end; -} -end; - -function TIdSSLSocket.Recv(var ABuffer: TIdBytes): Integer; -var - ret, err: Integer; -begin - repeat - ret := SSL_read(fSSL, PByte(ABuffer), Length(ABuffer)); - if ret > 0 then begin - Result := ret; - Exit; - end; - err := GetSSLError(ret); - if (err = SSL_ERROR_WANT_READ) or (err = SSL_ERROR_WANT_WRITE) then begin - Continue; - end; - if err = SSL_ERROR_ZERO_RETURN then begin - Result := 0; - end else begin - Result := ret; - end; - Exit; - until False; -end; - -function TIdSSLSocket.Send(const ABuffer: TIdBytes; AOffset, ALength: Integer): Integer; -var - ret, err: Integer; -begin - Result := 0; - repeat - ret := SSL_write(fSSL, @ABuffer[AOffset], ALength); - if ret > 0 then begin - Inc(Result, ret); - Inc(AOffset, ret); - Dec(ALength, ret); - if ALength < 1 then begin - Exit; - end; - Continue; - end; - err := GetSSLError(ret); - if (err = SSL_ERROR_WANT_READ) or (err = SSL_ERROR_WANT_WRITE) then begin - Continue; - end; - if err = SSL_ERROR_ZERO_RETURN then begin - Result := 0; - end else begin - Result := ret; - end; - Exit; - until False; -end; - -function TIdSSLSocket.GetPeerCert: TIdX509; -var - LX509: PX509; -begin - if fPeerCert = nil then begin - LX509 := SSL_get_peer_certificate(fSSL); - if LX509 <> nil then begin - fPeerCert := TIdX509.Create(LX509, False); - end; - end; - Result := fPeerCert; -end; - -function TIdSSLSocket.GetSSLCipher: TIdSSLCipher; -begin - if (fSSLCipher = nil) and (fSSL<>nil) then begin - fSSLCipher := TIdSSLCipher.Create(Self); - end; - Result := fSSLCipher; -end; - -function TIdSSLSocket.GetSessionID: TIdSSLByteArray; -var - pSession: PSSL_SESSION; -begin - Result.Length := 0; - Result.Data := nil; - if Assigned(SSL_get_session) and Assigned(SSL_SESSION_get_id) then - begin - if fSSL <> nil then begin - pSession := SSL_get_session(fSSL); - if pSession <> nil then begin - Result.Data := PByte(SSL_SESSION_get_id(pSession, @Result.Length)); - end; - end; - end; -end; - -function TIdSSLSocket.GetSessionIDAsString:String; -var - Data: TIdSSLByteArray; - i: TIdC_UINT; - LDataPtr: PByte; -begin - Result := ''; {Do not Localize} - Data := GetSessionID; - if Data.Length > 0 then begin - for i := 0 to Data.Length-1 do begin - // RLebeau: not all Delphi versions support indexed access using PByte - LDataPtr := Data.Data; - Inc(LDataPtr, I); - Result := Result + IndyFormat('%.2x', [LDataPtr^]);{do not localize} - end; - end; -end; - -procedure TIdSSLSocket.SetCipherList(CipherList: String); -//var -// tmpPStr: PAnsiChar; -begin -{ - fCipherList := CipherList; - fCipherList_Ch := True; - aCipherList := aCipherList+#0; - if hSSL <> nil then f_SSL_set_cipher_list(hSSL, @aCipherList[1]); -} -end; - -/////////////////////////////////////////////////////////////// -// X509 Certificate -/////////////////////////////////////////////////////////////// - -{ TIdX509Name } - -function TIdX509Name.CertInOneLine: String; -var - LOneLine: array[0..2048] of TIdAnsiChar; -begin - if FX509Name = nil then begin - Result := ''; {Do not Localize} - end else begin - Result := String(X509_NAME_oneline(FX509Name, @LOneLine[0], SizeOf(LOneLine))); - end; -end; - -function TIdX509Name.GetHash: TIdSSLULong; -begin - if FX509Name = nil then begin - FillChar(Result, SizeOf(Result), 0) - end else begin - Result.C1 := X509_NAME_hash(FX509Name); - end; -end; - -function TIdX509Name.GetHashAsString: String; -begin - Result := IndyFormat('%.8x', [Hash.L1]); {do not localize} -end; - -constructor TIdX509Name.Create(aX509Name: PX509_NAME); -begin - Inherited Create; - FX509Name := aX509Name; -end; - - -/////////////////////////////////////////////////////////////// -// X509 Certificate -/////////////////////////////////////////////////////////////// - -{ TIdX509Info } - -constructor TIdX509Info.Create(aX509: PX509); -begin - inherited Create; - FX509 := aX509; -end; - -{ TIdX509Fingerprints } - -function TIdX509Fingerprints.GetMD5: TIdSSLEVP_MD; -begin - CheckMD5Permitted; - X509_digest(FX509, EVP_md5, PByte(@Result.MD), Result.Length); -end; - -function TIdX509Fingerprints.GetMD5AsString: String; -begin - Result := MDAsString(MD5); -end; - -function TIdX509Fingerprints.GetSHA1: TIdSSLEVP_MD; -begin - X509_digest(FX509, EVP_sha1, PByte(@Result.MD), Result.Length); -end; - -function TIdX509Fingerprints.GetSHA1AsString: String; -begin - Result := MDAsString(SHA1); -end; - -function TIdX509Fingerprints.GetSHA224 : TIdSSLEVP_MD; -begin - if Assigned(EVP_sha224) then begin - X509_digest(FX509, EVP_sha224, PByte(@Result.MD), Result.Length); - end else begin - FillChar(Result, SizeOf(Result), 0); - end; -end; - -function TIdX509Fingerprints.GetSHA224AsString : String; -begin - if Assigned(EVP_sha224) then begin - Result := MDAsString(SHA224); - end else begin - Result := ''; - end; -end; - -function TIdX509Fingerprints.GetSHA256 : TIdSSLEVP_MD; -begin - if Assigned(EVP_sha256) then begin - X509_digest(FX509, EVP_sha256, PByte(@Result.MD), Result.Length); - end else begin - FillChar(Result, SizeOf(Result), 0); - end; -end; - -function TIdX509Fingerprints.GetSHA256AsString : String; -begin - if Assigned(EVP_sha256) then begin - Result := MDAsString(SHA256); - end else begin - Result := ''; - end; -end; - -function TIdX509Fingerprints.GetSHA384 : TIdSSLEVP_MD; -begin - if Assigned(EVP_SHA384) then begin - X509_digest(FX509, EVP_SHA384, PByte(@Result.MD), Result.Length); - end else begin - FillChar(Result, SizeOf(Result), 0); - end; -end; - -function TIdX509Fingerprints.GetSHA384AsString : String; -begin - if Assigned(EVP_SHA384) then begin - Result := MDAsString(SHA384); - end else begin - Result := ''; - end; -end; - -function TIdX509Fingerprints.GetSHA512 : TIdSSLEVP_MD; -begin - if Assigned(EVP_sha512) then begin - X509_digest(FX509, EVP_sha512, PByte(@Result.MD), Result.Length); - end else begin - FillChar(Result, SizeOf(Result), 0); - end; -end; - -function TIdX509Fingerprints.GetSHA512AsString : String; -begin - if Assigned(EVP_sha512) then begin - Result := MDAsString(SHA512); - end else begin - Result := ''; - end; -end; - -{ TIdX509SigInfo } - -function TIdX509SigInfo.GetSignature: String; -begin - Result := BytesToHexString(FX509^.signature^.data, FX509^.signature^.length); -end; - -function TIdX509SigInfo.GetSigType: TIdC_INT; -begin - Result := X509_get_signature_type(FX509); -end; - -function TIdX509SigInfo.GetSigTypeAsString: String; -begin - Result := String(OBJ_nid2ln(SigType)); -end; - -{ TIdX509 } - -constructor TIdX509.Create(aX509: PX509; aCanFreeX509: Boolean = True); -begin - inherited Create; - //don't create FDisplayInfo unless specifically requested. - FDisplayInfo := nil; - FX509 := aX509; - FCanFreeX509 := aCanFreeX509; - FFingerprints := TIdX509Fingerprints.Create(FX509); - FSigInfo := TIdX509SigInfo.Create(FX509); - FSubject := nil; - FIssuer := nil; -end; - -destructor TIdX509.Destroy; -begin - FreeAndNil(FDisplayInfo); - FreeAndNil(FSubject); - FreeAndNil(FIssuer); - FreeAndNil(FFingerprints); - FreeAndNil(FSigInfo); - { If the X.509 certificate handle was obtained from a certificate - store or from the SSL connection as a peer certificate, then DO NOT - free it here! The memory is owned by the OpenSSL library and will - crash the library if Indy tries to free its private memory here } - if FCanFreeX509 then begin - X509_free(FX509); - end; - inherited Destroy; -end; - - -function TIdX509.GetDisplayInfo: TStrings; -begin - if not Assigned(FDisplayInfo) then begin - FDisplayInfo := TStringList.Create; - DumpCert(FDisplayInfo, FX509); - end; - Result := FDisplayInfo; -end; - -function TIdX509.GetSerialNumber: String; -var - LSN : PASN1_INTEGER; -begin - if FX509 <> nil then begin - LSN := X509_get_serialNumber(FX509); - Result := BytesToHexString(LSN.data, LSN.length); - end else begin - Result := ''; - end; -end; - -function TIdX509.GetVersion : TIdC_LONG; -begin - Result := X509_get_version(FX509); -end; - -function TIdX509.RSubject: TIdX509Name; -var - Lx509_name: PX509_NAME; -Begin - if not Assigned(FSubject) then begin - if FX509 <> nil then begin - Lx509_name := X509_get_subject_name(FX509); - end else begin - Lx509_name := nil; - end; - FSubject := TIdX509Name.Create(Lx509_name); - end; - Result := FSubject; -end; - -function TIdX509.RIssuer: TIdX509Name; -var - Lx509_name: PX509_NAME; -begin - if not Assigned(FIssuer) then begin - if FX509 <> nil then begin - Lx509_name := X509_get_issuer_name(FX509); - end else begin - Lx509_name := nil; - end; - FIssuer := TIdX509Name.Create(Lx509_name); - End; - Result := FIssuer; -end; - -function TIdX509.RFingerprint: TIdSSLEVP_MD; -begin - X509_digest(FX509, EVP_md5, PByte(@Result.MD), Result.Length); -end; - -function TIdX509.RFingerprintAsString: String; -begin - Result := MDAsString(Fingerprint); -end; - -function TIdX509.RnotBefore: TDateTime; -begin - if FX509 = nil then begin - Result := 0 - end else begin - //This is a safe typecast since PASN1_UTCTIME and PASN1_TIME are really - //pointers to ASN1 strings since ASN1_UTCTIME amd ASM1_TIME are ASN1_STRING. - Result := UTCTime2DateTime(PASN1_UTCTIME(X509_get_notBefore(FX509))); - end; -end; - -function TIdX509.RnotAfter:TDateTime; -begin - if FX509 = nil then begin - Result := 0 - end else begin - Result := UTCTime2DateTime(PASN1_UTCTIME(X509_get_notAfter(FX509))); - end; -end; - -/////////////////////////////////////////////////////////////// -// TIdSSLCipher -/////////////////////////////////////////////////////////////// -constructor TIdSSLCipher.Create(AOwner: TIdSSLSocket); -begin - inherited Create; - FSSLSocket := AOwner; -end; - -destructor TIdSSLCipher.Destroy; -begin - inherited Destroy; -end; - -function TIdSSLCipher.GetDescription; -var - Buf: array[0..1024] of TIdAnsiChar; -begin - Result := String(SSL_CIPHER_description(SSL_get_current_cipher(FSSLSocket.fSSL), @Buf[0], SizeOf(Buf)-1)); -end; - -function TIdSSLCipher.GetName:String; -begin - Result := String(SSL_CIPHER_get_name(SSL_get_current_cipher(FSSLSocket.fSSL))); -end; - -function TIdSSLCipher.GetBits:TIdC_INT; -begin - SSL_CIPHER_get_bits(SSL_get_current_cipher(FSSLSocket.fSSL), Result); -end; - -function TIdSSLCipher.GetVersion:String; -begin - Result := String(SSL_CIPHER_get_version(SSL_get_current_cipher(FSSLSocket.fSSL))); -end; - -initialization - Assert(SSLIsLoaded=nil); - SSLIsLoaded := TIdThreadSafeBoolean.Create; - - RegisterSSL('OpenSSL','Indy Pit Crew', {do not localize} - 'Copyright '+Char(169)+' 1993 - 2023'#10#13 + {do not localize} - 'Chad Z. Hower (Kudzu) and the Indy Pit Crew. All rights reserved.', {do not localize} - 'Open SSL Support DLL Delphi and C++Builder interface', {do not localize} - 'http://www.indyproject.org/'#10#13 + {do not localize} - 'Original Author - Gregor Ibic', {do not localize} - TIdSSLIOHandlerSocketOpenSSL, - TIdServerIOHandlerSSLOpenSSL); - - TIdSSLIOHandlerSocketOpenSSL.RegisterIOHandler; -finalization - // TODO: TIdSSLIOHandlerSocketOpenSSL.UnregisterIOHandler; - UnLoadOpenSSLLibrary; - //free the lock last as unload makes calls that use it - FreeAndNil(SSLIsLoaded); -end. +{ + $Project$ + $Workfile$ + $Revision$ + $DateUTC$ + $Id$ + } + {******************************************************************************} + { } + { Indy (Internet Direct) - Internet Protocols Simplified } + { } + { https://www.indyproject.org/ } + { https://gitter.im/IndySockets/Indy } + { } + {******************************************************************************} + { } + { This file is part of the Indy (Internet Direct) project, and is offered } + { under the dual-licensing agreement described on the Indy website. } + { (https://www.indyproject.org/license/) } + { } + { Copyright: } + { (c) 1993-2024, the Indy Pit Crew. All rights reserved. } + { } + {******************************************************************************} + { } + { Contributers: } + { Here could be your name } + { } + {******************************************************************************} + +{ + $Log$ +} +{ + Rev 1.41 22/02/2024 AWhyman + a. Property SSLProtocolVersion added to TSocket. This returns the SSL/TLS protocol + version that was negotiated when the session was created. + + b. SSL Headers now loaded using the IdOpenSSLLoader unit in order to support + OpenSSL 3 and later. + + c. New property TIdSSLOptions.UseSystemRootCertificateStore. Defaults to true. + If true then SSL_CTX_set_default_verify_paths is called. This causes the + certs in OPENSSLDIR/certs to be used for certificate verification + + d. Windows only: if OPENSSL_DONT_USE_WINDOWS_CERT_STORE not defined and + TIdSSLOptions.UseSystemRootCertificateStore is true then + Windows Root Certificate store is also loaded into SSL Context X.509 certificate store. + + e. Direct access to OpenSSL internal data structures (exposed in earlier versions, + but now opaque (typically 1.1.1 onwards) now uses getter and setter functions + provided by later versions of OpenSSL libraries with forwards compatibility + functions (in appropriate SSL Header unit) used to provide getters and setters + for earlier versions. + + f. New functions: OpenSSLVersion and OpenSSLDir. These are information access + that return, respectively, the OpenSSL Version string and the OpenSSL Directory. + + Rev 1.40 03/11/2009 09:04:00 AWinkelsdorf + Implemented fix for Vista+ SSL_Read and SSL_Write to allow connection + timeout. + + Rev 1.39 16/02/2005 23:26:08 CCostelloe + Changed OnVerifyPeer. Breaks existing implementation of OnVerifyPeer. See + long comment near top of file. + + Rev 1.38 1/31/05 6:02:28 PM RLebeau + Updated _GetThreadId() callback to reflect changes in IdGlobal unit + + Rev 1.37 7/27/2004 1:54:26 AM JPMugaas + Now should use the Intercept property for sends. + + Rev 1.36 2004-05-18 21:38:36 Mattias + Fixed unload bug + + Rev 1.35 2004-05-07 16:34:26 Mattias + Implemented OpenSSL locking callbacks + + Rev 1.34 27/04/2004 9:38:48 HHariri + Added compiler directive so it works in BCB + + Rev 1.33 4/26/2004 12:41:10 AM BGooijen + Fixed WriteDirect + + Rev 1.32 2004.04.08 10:55:30 PM czhower + IOHandler changes. + + Rev 1.31 3/7/2004 9:02:58 PM JPMugaas + Fixed compiler warning about visibility. + + Rev 1.30 2004.03.07 11:46:40 AM czhower + Flushbuffer fix + other minor ones found + + Rev 1.29 2/7/2004 5:50:50 AM JPMugaas + Fixed Copyright. + + Rev 1.28 2/6/2004 3:45:56 PM JPMugaas + Only a start on NET porting. This is not finished and will not compile on + DotNET> + + Rev 1.27 2004.02.03 5:44:24 PM czhower + Name changes + + Rev 1.26 1/21/2004 4:03:48 PM JPMugaas + InitComponent + + Rev 1.25 1/14/2004 11:39:10 AM JPMugaas + Server IOHandler now works. Accept was commented out. + + Rev 1.24 2003.11.29 10:19:28 AM czhower + Updated for core change to InputBuffer. + + Rev 1.23 10/21/2003 10:09:14 AM JPMugaas + Intercept enabled. + + Rev 1.22 10/21/2003 09:41:38 AM JPMugaas + Updated for new API. Verified with TIdFTP with active and passive transfers + as well as clear and protected data channels. + + Rev 1.21 10/21/2003 07:32:38 AM JPMugaas + Checked in what I have. Porting still continues. + + Rev 1.20 10/17/2003 1:08:08 AM DSiders + Added localization comments. + + Rev 1.19 2003.10.12 6:36:44 PM czhower + Now compiles. + + Rev 1.18 9/19/2003 11:24:58 AM JPMugaas + Should compile. + + Rev 1.17 9/18/2003 10:20:32 AM JPMugaas + Updated for new API. + + Rev 1.16 2003.07.16 3:26:52 PM czhower + Fixed for a core change. + + Rev 1.15 6/30/2003 1:52:22 PM BGooijen + Changed for new buffer interface + + Rev 1.14 6/29/2003 5:42:02 PM BGooijen + fixed problem in TIdSSLIOHandlerSocketOpenSSL.SetPassThrough that Henrick + Hellstrom reported + + Rev 1.13 5/7/2003 7:13:00 PM BGooijen + changed Connected to BindingAllocated in ReadFromSource + + Rev 1.12 3/30/2003 12:16:40 AM BGooijen + bugfixed+ added MakeFTPSvrPort/MakeFTPSvrPasv + + Rev 1.11 3/14/2003 06:56:08 PM JPMugaas + Added a clone method to the SSLContext. + + Rev 1.10 3/14/2003 05:29:10 PM JPMugaas + Change to prevent an AV when shutting down the FTP Server. + + Rev 1.9 3/14/2003 10:00:38 PM BGooijen + Removed TIdServerIOHandlerSSLBase.PeerPassthrough, the ssl is now enabled in + the server-protocol-files + + Rev 1.8 3/13/2003 11:55:38 AM JPMugaas + Updated registration framework to give more information. + + Rev 1.7 3/13/2003 11:07:14 AM JPMugaas + OpenSSL classes renamed. + + Rev 1.6 3/13/2003 10:28:16 AM JPMugaas + Forgot the reegistration - OOPS!!! + + Rev 1.5 3/13/2003 09:49:42 AM JPMugaas + Now uses an abstract SSL base class instead of OpenSSL so 3rd-party vendors + can plug-in their products. + + Rev 1.4 3/13/2003 10:20:08 AM BGooijen + Server side fibers + + Rev 1.3 2003.02.25 3:56:22 AM czhower + + Rev 1.2 2/5/2003 10:27:46 PM BGooijen + Fixed bug in OpenEncodedConnection + + Rev 1.1 2/4/2003 6:31:22 PM BGooijen + Fixed for Indy 10 + + Rev 1.0 11/13/2002 08:01:24 AM JPMugaas +} +unit IdSSLOpenSSL; +{ + Author: Gregor Ibic (gregor.ibic@intelicom.si) + Copyright: (c) Gregor Ibic, Intelicom d.o.o and Indy Working Group. +} + +{ + Indy OpenSSL now uses the standard OpenSSL libraries + for pre-compiled win32 dlls, see: + http://www.openssl.org/related/binaries.html + recommended v0.9.8a or later +} + +{ + Important information concerning OnVerifyPeer: + Rev 1.39 of February 2005 deliberately broke the OnVerifyPeer interface, + which (obviously?) only affects programs that implemented that callback + as part of the SSL negotiation. Note that you really should always + implement OnVerifyPeer, otherwise the certificate of the peer you are + connecting to is NOT checked to ensure it is valid. + + Prior to this, if the SSL library detected a problem with a certificate + or the Depth was insufficient (i.e. the "Ok" parameter in VerifyCallback + is 0 / FALSE), then irrespective of whether your OnVerifyPeer returned True + or False, the SSL connection would be deliberately failed. + + This created a problem in that even if there was only a very minor + problem with one of the certificates in the chain (OnVerifyPeer is called + once for each certificate in the certificate chain), which the user may + have been happy to accept, the SSL negotiation would be failed. However, + changing the code to allow the SSL connection when a user returned True + for OnVerifyPeer would have meant that existing code which depended on + automatic rejection of invalid certificates would then be accepting + invalid certificates, which would have been an unacceptable security + change. + + Consequently, OnVerifyPeer was changed to deliberately break existing code + by adding an AOk parameter. To preserve the previous functionality, your + OnVerifyPeer event should do "Result := AOk;". If you wish to consider + accepting certificates that the SSL library has considered invalid, then + in your OnVerifyPeer, make sure you satisfy yourself that the certificate + really is valid and then set Result to True. In reality, in addition to + checking AOk, you should always implement code that ensures you are only + accepting certificates which are valid (at least from your point of view). + + Ciaran Costelloe, ccostelloe@flogas.ie +} +{ +RLebeau 1/12/2011: Breaking OnVerifyPeer event again, this time to add an +additional AError parameter (patch courtesy of "jvlad", dmda@yandex.ru). +This helps user code distinquish between Self-signed and invalid certificates. +} + +interface + +{$I IdCompilerDefines.inc} +{$i IdSSLOpenSSLDefines.inc} + +{$IFDEF WINDOWS} +{$IFNDEF OPENSSL_DONT_USE_WINDOWS_CERT_STORE} +{$DEFINE USE_WINDOWS_CERT_STORE} +{$ENDIF} +{$ENDIF} + +{$TYPEDADDRESS OFF} + +uses + //facilitate inlining only. + {$IFDEF WINDOWS} + Windows, + {$ENDIF} + Classes, + IdBuffer, + IdCTypes, + IdGlobal, + IdException, + IdStackConsts, + IdSocketHandle, + IdComponent, + IdIOHandler, + IdGlobalProtocols, + IdTCPServer, + IdThread, + IdTCPConnection, + IdIntercept, + IdIOHandlerSocket, + IdSSL, + IdSocks, + IdScheduler, + IdYarn, + IdSSLOpenSSLExceptionHandlers, + IdOpenSSLHeaders_ossl_typ, + IdOpenSSLHeaders_ssl, + IdSSLOpenSSL_X509, + IdSSLOpenSSLFIPS {Ensure FIPS functions initialised}; + +type + TIdSSLVersion = (sslUnknown,sslvSSLv2, sslvSSLv23, sslvSSLv3, sslvTLSv1,sslvTLSv1_1, + sslvTLSv1_2, sslvTLSv1_3); {May need to update constants below if adding to this set} + TIdSSLVersions = set of TIdSSLVersion; + TIdSSLMode = (sslmUnassigned, sslmClient, sslmServer, sslmBoth); + TIdSSLVerifyMode = (sslvrfPeer, sslvrfFailIfNoPeerCert, sslvrfClientOnce); + TIdSSLVerifyModeSet = set of TIdSSLVerifyMode; + TIdSSLCtxMode = (sslCtxClient, sslCtxServer); + TIdSSLAction = (sslRead, sslWrite); + +const + DEF_SSLVERSION = sslvTLSv1_2; + DEF_SSLVERSIONS = [sslvTLSv1_2,sslvTLSv1_3]; + MAX_SSLVERSION = sslvTLSv1_3; + P12_FILETYPE = 3; + +type + TIdSSLIOHandlerSocketOpenSSL = class; + TIdSSLCipher = class; + TCallbackEvent = procedure(const AMsg: String) of object; + TCallbackExEvent = procedure(ASender : TObject; const AsslSocket: PSSL; + const AWhere, Aret: TIdC_INT; const AType, AMsg : String ) of object; + TPasswordEvent = procedure(var Password: String) of object; + TPasswordEventEx = procedure( ASender : TObject; var VPassword: String; const AIsWrite : Boolean) of object; + TVerifyPeerEvent = function(Certificate: TIdX509; AOk: Boolean; ADepth, AError: Integer): Boolean of object; + TIOHandlerNotify = procedure(ASender: TIdSSLIOHandlerSocketOpenSSL) of object; + + { TIdSSLOptions } + + TIdSSLOptions = class(TPersistent) + private + fUseSystemRootCertificateStore : boolean; + protected + fsRootCertFile, + fsCertFile, + fsKeyFile, + fsDHParamsFile: String; + fMethod: TIdSSLVersion; + fSSLVersions : TIdSSLVersions; + fMode: TIdSSLMode; + fVerifyDepth: Integer; + fVerifyMode: TIdSSLVerifyModeSet; + //fVerifyFile, + fVerifyDirs: String; + fCipherList: String; + procedure AssignTo(Destination: TPersistent); override; + procedure SetSSLVersions(const AValue : TIdSSLVersions); + procedure SetMethod(const AValue : TIdSSLVersion); + public + constructor Create; + // procedure Assign(ASource: TPersistent); override; + published + property RootCertFile: String read fsRootCertFile write fsRootCertFile; + property CertFile: String read fsCertFile write fsCertFile; + property KeyFile: String read fsKeyFile write fsKeyFile; + property DHParamsFile: String read fsDHParamsFile write fsDHParamsFile; + property Method: TIdSSLVersion read fMethod write SetMethod default DEF_SSLVERSION; {ignored with OpenSSL 1.1.0 or later} + property SSLVersions : TIdSSLVersions read fSSLVersions + write SetSSLVersions + default DEF_SSLVERSIONS; {SSLVersions is only used to determine min version with OpenSSL 1.1.0 or later} + property Mode: TIdSSLMode read fMode write fMode; + property VerifyMode: TIdSSLVerifyModeSet read fVerifyMode write fVerifyMode; + property VerifyDepth: Integer read fVerifyDepth write fVerifyDepth; +// property VerifyFile: String read fVerifyFile write fVerifyFile; + property VerifyDirs: String read fVerifyDirs write fVerifyDirs; + property UseSystemRootCertificateStore: boolean read fUseSystemRootCertificateStore write fUseSystemRootCertificateStore default true; + property CipherList: String read fCipherList write fCipherList; + end; + + { TIdSSLContext } + + TIdSSLContext = class(TObject) + private + fUseSystemRootCertificateStore : boolean; + {$IFDEF USE_WINDOWS_CERT_STORE} + procedure LoadWindowsCertStore; + {$ENDIF} + protected + fMethod: TIdSSLVersion; + fSSLVersions : TIdSSLVersions; + fMode: TIdSSLMode; + fsRootCertFile, fsCertFile, fsKeyFile, fsDHParamsFile: String; + fVerifyDepth: Integer; + fVerifyMode: TIdSSLVerifyModeSet; +// fVerifyFile: String; + fVerifyDirs: String; + fCipherList: String; + fContext: PSSL_CTX; + fStatusInfoOn: Boolean; +// fPasswordRoutineOn: Boolean; + fVerifyOn: Boolean; + fSessionId: Integer; + fCtxMode: TIdSSLCtxMode; + procedure DestroyContext; + function SetSSLMethod: PSSL_METHOD; + procedure SetVerifyMode(Mode: TIdSSLVerifyModeSet; CheckRoutine: Boolean); + function GetVerifyMode: TIdSSLVerifyModeSet; + procedure InitContext(CtxMode: TIdSSLCtxMode); + public + {$IFDEF USE_OBJECT_ARC}[Weak]{$ENDIF} Parent: TObject; + constructor Create; + destructor Destroy; override; + function Clone : TIdSSLContext; + function LoadRootCert: Boolean; + function LoadCert: Boolean; + function LoadKey: Boolean; + function LoadDHParams: Boolean; + property StatusInfoOn: Boolean read fStatusInfoOn write fStatusInfoOn; +// property PasswordRoutineOn: Boolean read fPasswordRoutineOn write fPasswordRoutineOn; + property VerifyOn: Boolean read fVerifyOn write fVerifyOn; +//THese can't be published in a TObject without a compiler warning. + // published + property SSLVersions : TIdSSLVersions read fSSLVersions write fSSLVersions; + property Method: TIdSSLVersion read fMethod write fMethod; + property Mode: TIdSSLMode read fMode write fMode; + property RootCertFile: String read fsRootCertFile write fsRootCertFile; + property CertFile: String read fsCertFile write fsCertFile; + property CipherList: String read fCipherList write fCipherList; + property KeyFile: String read fsKeyFile write fsKeyFile; + property DHParamsFile: String read fsDHParamsFile write fsDHParamsFile; +// property VerifyMode: TIdSSLVerifyModeSet read GetVerifyMode write SetVerifyMode; +// property VerifyFile: String read fVerifyFile write fVerifyFile; + property UseSystemRootCertificateStore: boolean read fUseSystemRootCertificateStore write fUseSystemRootCertificateStore; + property VerifyDirs: String read fVerifyDirs write fVerifyDirs; + property VerifyMode: TIdSSLVerifyModeSet read fVerifyMode write fVerifyMode; + property VerifyDepth: Integer read fVerifyDepth write fVerifyDepth; + + end; + + { TIdSSLSocket } + + TIdSSLSocket = class(TObject) + private + fSession: PSSL_SESSION; + function GetProtocolVersion: TIdSSLVersion; + function GetSSLProtocolVersionStr: string; + protected + {$IFDEF USE_OBJECT_ARC}[Weak]{$ENDIF} fParent: TObject; + fPeerCert: TIdX509; + fSSL: PSSL; + fSSLCipher: TIdSSLCipher; + fSSLContext: TIdSSLContext; + fHostName: String; + function GetPeerCert: TIdX509; + function GetSSLError(retCode: Integer): Integer; + function GetSSLCipher: TIdSSLCipher; + public + constructor Create(Parent: TObject); + destructor Destroy; override; + procedure Accept(const pHandle: TIdStackSocketHandle); + procedure Connect(const pHandle: TIdStackSocketHandle); + function Send(const ABuffer : TIdBytes; AOffset, ALength: Integer): Integer; + function Recv(var ABuffer : TIdBytes): Integer; + function GetSessionID: TIdSSLByteArray; + function GetSessionIDAsString:String; + procedure SetCipherList(CipherList: String); + // + property PeerCert: TIdX509 read GetPeerCert; + property Cipher: TIdSSLCipher read GetSSLCipher; + property HostName: String read fHostName; + property SSLProtocolVersion: TIdSSLVersion read GetProtocolVersion; + property SSLProtocolVersionStr: string read GetSSLProtocolVersionStr; + end; + + // TIdSSLIOHandlerSocketOpenSSL and TIdServerIOHandlerSSLOpenSSL have some common + // functions, but they do not have a common ancestor, so this interface helps + // bridge the gap... + IIdSSLOpenSSLCallbackHelper = interface(IInterface) + ['{583F1209-10BA-4E06-8810-155FAEC415FE}'] + function GetPassword(const AIsWrite : Boolean): string; + procedure StatusInfo(const ASSL: PSSL; AWhere, ARet: TIdC_INT; const AStatusStr: string); + function VerifyPeer(ACertificate: TIdX509; AOk: Boolean; ADepth, AError: Integer): Boolean; + function GetIOHandlerSelf: TIdSSLIOHandlerSocketOpenSSL; + end; + + TIdSSLIOHandlerSocketOpenSSL = class(TIdSSLIOHandlerSocketBase, IIdSSLOpenSSLCallbackHelper) + protected + fSSLContext: TIdSSLContext; + fxSSLOptions: TIdSSLOptions; + fSSLSocket: TIdSSLSocket; + //fPeerCert: TIdX509; + fOnStatusInfo: TCallbackEvent; + FOnStatusInfoEx : TCallbackExEvent; + fOnGetPassword: TPasswordEvent; + fOnGetPasswordEx : TPasswordEventEx; + fOnVerifyPeer: TVerifyPeerEvent; + fSSLLayerClosed: Boolean; + fOnBeforeConnect: TIOHandlerNotify; + FOnSSLNegotiated : TIOHandlerNotify; + // function GetPeerCert: TIdX509; + //procedure CreateSSLContext(axMode: TIdSSLMode); + // + procedure SetPassThrough(const Value: Boolean); override; + procedure DoBeforeConnect(ASender: TIdSSLIOHandlerSocketOpenSSL); virtual; + procedure DoStatusInfo(const AMsg: String); virtual; + procedure DoStatusInfoEx(const AsslSocket: PSSL; + const AWhere, Aret: TIdC_INT; const AWhereStr, ARetStr : String ); + procedure DoGetPassword(var Password: String); virtual; + procedure DoGetPasswordEx(var VPassword: String; const AIsWrite : Boolean); virtual; + procedure DoOnSSLNegotiated; virtual; + function DoVerifyPeer(Certificate: TIdX509; AOk: Boolean; ADepth, AError: Integer): Boolean; virtual; + function RecvEnc(var VBuffer: TIdBytes): Integer; override; + function SendEnc(const ABuffer: TIdBytes; const AOffset, ALength: Integer): Integer; override; + procedure Init; + procedure OpenEncodedConnection; virtual; + //some overrides from base classes + procedure InitComponent; override; + procedure ConnectClient; override; + function CheckForError(ALastResult: Integer): Integer; override; + procedure RaiseError(AError: Integer); override; + + { IIdSSLOpenSSLCallbackHelper } + function GetPassword(const AIsWrite : Boolean): string; + procedure StatusInfo(const ASslSocket: PSSL; AWhere, ARet: TIdC_INT; const AStatusStr: string); + function VerifyPeer(ACertificate: TIdX509; AOk: Boolean; ADepth, AError: Integer): Boolean; + function GetIOHandlerSelf: TIdSSLIOHandlerSocketOpenSSL; + + public + destructor Destroy; override; + // TODO: add an AOwner parameter + function Clone : TIdSSLIOHandlerSocketBase; override; + procedure StartSSL; override; + procedure AfterAccept; override; + procedure Close; override; + procedure Open; override; + function Readable(AMSec: Integer = IdTimeoutDefault): Boolean; override; + property SSLSocket: TIdSSLSocket read fSSLSocket write fSSLSocket; + property OnBeforeConnect: TIOHandlerNotify read fOnBeforeConnect write fOnBeforeConnect; + property SSLContext: TIdSSLContext read fSSLContext write fSSLContext; + published + property OnSSLNegotiated : TIOHandlerNotify read FOnSSLNegotiated write FOnSSLNegotiated; + property SSLOptions: TIdSSLOptions read fxSSLOptions write fxSSLOptions; + property OnStatusInfo: TCallbackEvent read fOnStatusInfo write fOnStatusInfo; + property OnStatusInfoEx: TCallbackExEvent read fOnStatusInfoEx write fOnStatusInfoEx; + property OnGetPassword: TPasswordEvent read fOnGetPassword write fOnGetPassword; + property OnGetPasswordEx : TPasswordEventEx read fOnGetPasswordEx write fOnGetPasswordEx; + property OnVerifyPeer: TVerifyPeerEvent read fOnVerifyPeer write fOnVerifyPeer; + end; + + TIdServerIOHandlerSSLOpenSSL = class(TIdServerIOHandlerSSLBase, IIdSSLOpenSSLCallbackHelper) + protected + fxSSLOptions: TIdSSLOptions; + fSSLContext: TIdSSLContext; + fOnStatusInfo: TCallbackEvent; + FOnStatusInfoEx : TCallbackExEvent; + fOnGetPassword: TPasswordEvent; + fOnGetPasswordEx : TPasswordEventEx; + fOnVerifyPeer: TVerifyPeerEvent; + // + //procedure CreateSSLContext(axMode: TIdSSLMode); + //procedure CreateSSLContext; + // + procedure DoStatusInfo(const AMsg: String); virtual; + procedure DoStatusInfoEx(const AsslSocket: PSSL; + const AWhere, Aret: TIdC_INT; const AWhereStr, ARetStr : String ); + procedure DoGetPassword(var Password: String); virtual; +//TPasswordEventEx + procedure DoGetPasswordEx(var VPassword: String; const AIsWrite : Boolean); virtual; + function DoVerifyPeer(Certificate: TIdX509; AOk: Boolean; ADepth, AError: Integer): Boolean; virtual; + procedure InitComponent; override; + + { IIdSSLOpenSSLCallbackHelper } + function GetPassword(const AIsWrite : Boolean): string; + procedure StatusInfo(const ASslSocket: PSSL; AWhere, ARet: TIdC_INT; const AStatusStr: string); + function VerifyPeer(ACertificate: TIdX509; AOk: Boolean; ADepth, AError: Integer): Boolean; + function GetIOHandlerSelf: TIdSSLIOHandlerSocketOpenSSL; + + public + procedure Init; override; + procedure Shutdown; override; + // AListenerThread is a thread and not a yarn. Its the listener thread. + function Accept(ASocket: TIdSocketHandle; AListenerThread: TIdThread; + AYarn: TIdYarn): TIdIOHandler; override; +// function Accept(ASocket: TIdSocketHandle; AThread: TIdThread) : TIdIOHandler; override; + destructor Destroy; override; + function MakeClientIOHandler : TIdSSLIOHandlerSocketBase; override; + // + function MakeFTPSvrPort : TIdSSLIOHandlerSocketBase; override; + function MakeFTPSvrPasv : TIdSSLIOHandlerSocketBase; override; + // + property SSLContext: TIdSSLContext read fSSLContext; + published + property SSLOptions: TIdSSLOptions read fxSSLOptions write fxSSLOptions; + property OnStatusInfo: TCallbackEvent read fOnStatusInfo write fOnStatusInfo; + property OnStatusInfoEx: TCallbackExEvent read fOnStatusInfoEx write fOnStatusInfoEx; + property OnGetPassword: TPasswordEvent read fOnGetPassword write fOnGetPassword; + property OnGetPasswordEx : TPasswordEventEx read fOnGetPasswordEx write fOnGetPasswordEx; + property OnVerifyPeer: TVerifyPeerEvent read fOnVerifyPeer write fOnVerifyPeer; + end; + + TIdSSLCipher = class(TObject) + protected + FSSLSocket: TIdSSLSocket; + function GetDescription: String; + function GetName: String; + function GetBits: Integer; + function GetVersion: String; + public + constructor Create(AOwner: TIdSSLSocket); + destructor Destroy; override; + //These can't be published without a compiler warning. + // published + property Description: String read GetDescription; + property Name: String read GetName; + property Bits: Integer read GetBits; + property Version: String read GetVersion; + end; + EIdOSSLCouldNotLoadSSLLibrary = class(EIdOpenSSLError); + EIdOSSLModeNotSet = class(EIdOpenSSLError); + EIdOSSLGetMethodError = class(EIdOpenSSLError); + EIdOSSLCreatingSessionError = class(EIdOpenSSLError); + EIdOSSLCreatingContextError = class(EIdOpenSSLAPICryptoError); + EIdOSSLLoadingRootCertError = class(EIdOpenSSLAPICryptoError); + EIdOSSLLoadingCertError = class(EIdOpenSSLAPICryptoError); + EIdOSSLLoadingKeyError = class(EIdOpenSSLAPICryptoError); + EIdOSSLLoadingDHParamsError = class(EIdOpenSSLAPICryptoError); + EIdOSSLSettingCipherError = class(EIdOpenSSLError); + EIdOSSLFDSetError = class(EIdOpenSSLAPISSLError); + EIdOSSLDataBindingError = class(EIdOpenSSLAPISSLError); + EIdOSSLAcceptError = class(EIdOpenSSLAPISSLError); + EIdOSSLConnectError = class(EIdOpenSSLAPISSLError); + {$IFNDEF OPENSSL_NO_TLSEXT} + EIdOSSLSettingTLSHostNameError = class(EIdOpenSSLAPISSLError); + {$ENDIF} + +function LoadOpenSSLLibrary: Boolean; +procedure UnLoadOpenSSLLibrary; + +function OpenSSLVersion: string; +function OpenSSLDir: string; + +implementation + +uses + {$IFDEF HAS_UNIT_Generics_Collections} + System.Generics.Collections, + {$ENDIF} + {$IFDEF USE_VCL_POSIX} + Posix.SysTime, + Posix.Time, + Posix.Unistd, + {$ENDIF} + IdFIPS, + IdResourceStringsCore, + IdResourceStringsProtocols, + IdResourceStringsOpenSSL, + IdStack, + IdStackBSDBase, + IdAntiFreezeBase, + IdExceptionCore, + IdResourceStrings, + IdThreadSafe, + IdCustomTransparentProxy, + IdURI, + SysUtils, + SyncObjs, + IdOpenSSLHeaders_obj_mac, + IdOpenSSLHeaders_asn1, + IdOpenSSLHeaders_bn, + IdOpenSSLHeaders_x509_vfy, + IdOpenSSLHeaders_pkcs12, + IdOpenSSLHeaders_sslerr, + IdOpenSSLHeaders_err, + IdOpenSSLHeaders_evp, + IdOpenSSLHeaders_bio, + IdOpenSSLHeaders_pem, + IdOpenSSLHeaders_stack, + IdOpenSSLHeaders_crypto, + IdOpenSSLHeaders_tls1, + IdOpenSSLHeaders_objects, + IdOpenSSLHeaders_ssl3, + IdOpenSSLHeaders_x509, + IdSSLOpenSSLConsts, + IdSSLOpenSSL_Files, + IdSSLOpenSSLLoader; + +type + TRAND_bytes = function(buf : PIdAnsiChar; num : integer) : integer; cdecl; + TRAND_pseudo_bytes = function(buf : PIdAnsiChar; num : integer) : integer; cdecl; + TRAND_seed = procedure(buf : PIdAnsiChar; num : integer); cdecl; + TRAND_add = procedure(buf : PIdAnsiChar; num : integer; entropy : integer); cdecl; + TRAND_status = function() : integer; cdecl; + {$IFDEF SYS_WIN} + TRAND_event = function(iMsg : UINT; wp : wparam; lp : lparam) : integer; cdecl; + {$ENDIF} + TRAND_cleanup = procedure; cdecl; + +var + _RAND_cleanup : TRAND_cleanup = nil; + _RAND_bytes : TRAND_bytes = nil; + _RAND_pseudo_bytes : TRAND_pseudo_bytes = nil; + _RAND_seed : TRAND_seed = nil; + _RAND_add : TRAND_add = nil; + _RAND_status : TRAND_status = nil; + {$IFDEF SYS_WIN} + // LIBEAY functions - open SSL 0.9.6a + _RAND_screen : procedure cdecl = nil; + _RAND_event : TRAND_event = nil; + {$ENDIF} + + + procedure InitializeRandom; + begin + {$IFDEF SYS_WIN} + if Assigned(_RAND_screen) then begin + _RAND_screen; + end; + {$ENDIF} + end; + + procedure CleanupRandom; + begin + if Assigned(_RAND_cleanup) then begin + _RAND_cleanup; + end; + end; + + + +type + // TODO: TIdThreadSafeObjectList instead? + {$IFDEF HAS_GENERICS_TThreadList} + TIdCriticalSectionThreadList = TThreadList; + TIdCriticalSectionList = TList; + {$ELSE} + // TODO: flesh out to match TThreadList and TList on non-Generics compilers + TIdCriticalSectionThreadList = TThreadList; + TIdCriticalSectionList = TList; + {$ENDIF} + + // RLebeau 1/24/2019: defining this as a private implementation for now to + // avoid a change in the public interface above. This should be rolled into + // the public interface at some point... + TIdSSLOptions_Internal = class(TIdSSLOptions) + public + {$IFDEF USE_OBJECT_ARC}[Weak]{$ENDIF} Parent: TObject; + end; + +var + SSLIsLoaded: TIdThreadSafeBoolean = nil; + LockInfoCB: TIdCriticalSection = nil; + LockPassCB: TIdCriticalSection = nil; + LockVerifyCB: TIdCriticalSection = nil; + CallbackLockList: TIdCriticalSectionThreadList = nil; + +procedure GetStateVars(const sslSocket: PSSL; AWhere, Aret: TIdC_INT; var VTypeStr, VMsg : String); + {$IFDEF USE_INLINE}inline;{$ENDIF} +begin + case AWhere of + SSL_CB_ALERT : + begin + VTypeStr := IndyFormat( RSOSSLAlert,[SSL_alert_type_string_long(Aret)]); + VMsg := String(SSL_alert_type_string_long(Aret)); + end; + SSL_CB_READ_ALERT : + begin + VTypeStr := IndyFormat(RSOSSLReadAlert,[SSL_alert_type_string_long(Aret)]); + VMsg := String( SSL_alert_desc_string_long(Aret)); + end; + SSL_CB_WRITE_ALERT : + begin + VTypeStr := IndyFormat(RSOSSLWriteAlert,[SSL_alert_type_string_long(Aret)]); + VMsg := String( SSL_alert_desc_string_long(Aret)); + end; + SSL_CB_ACCEPT_LOOP : + begin + VTypeStr := RSOSSLAcceptLoop; + VMsg := String( SSL_state_string_long(sslSocket)); + end; + SSL_CB_ACCEPT_EXIT : + begin + if ARet < 0 then begin + VTypeStr := RSOSSLAcceptError; + end else begin + if ARet = 0 then begin + VTypeStr := RSOSSLAcceptFailed; + end else begin + VTypeStr := RSOSSLAcceptExit; + end; + end; + VMsg := String( SSL_state_string_long(sslSocket) ); + end; + SSL_CB_CONNECT_LOOP : + begin + VTypeStr := RSOSSLConnectLoop; + VMsg := String( SSL_state_string_long(sslSocket) ); + end; + SSL_CB_CONNECT_EXIT : + begin + if ARet < 0 then begin + VTypeStr := RSOSSLConnectError; + end else begin + if ARet = 0 then begin + VTypeStr := RSOSSLConnectFailed + end else begin + VTypeStr := RSOSSLConnectExit; + end; + end; + VMsg := String( SSL_state_string_long(sslSocket) ); + end; + SSL_CB_HANDSHAKE_START : + begin + VTypeStr := RSOSSLHandshakeStart; + VMsg := String( SSL_state_string_long(sslSocket) ); + end; + SSL_CB_HANDSHAKE_DONE : + begin + VTypeStr := RSOSSLHandshakeDone; + VMsg := String( SSL_state_string_long(sslSocket) ); + end; + end; +end; + +function PasswordCallback(buf: PIdAnsiChar; size: TIdC_INT; rwflag: TIdC_INT; userdata: Pointer): TIdC_INT; cdecl; +{$IFDEF USE_MARSHALLED_PTRS} +type + TBytesPtr = ^TBytes; +{$ENDIF} +var + Password: String; + {$IFDEF STRING_IS_UNICODE} + LPassword: TIdBytes; + {$ENDIF} + IdSSLContext: TIdSSLContext; + LErr : Integer; + LHelper: IIdSSLOpenSSLCallbackHelper; +begin + //Preserve last eror just in case OpenSSL is using it and we do something that + //clobers it. CYA. + LErr := GStack.WSGetLastError; + try + LockPassCB.Enter; + try + Password := ''; {Do not Localize} + IdSSLContext := TIdSSLContext(userdata); + if Supports(IdSSLContext.Parent, IIdSSLOpenSSLCallbackHelper, IInterface(LHelper)) then begin + Password := LHelper.GetPassword(rwflag > 0); + LHelper := nil; + end; + FillChar(buf^, size, 0); + {$IFDEF STRING_IS_UNICODE} + LPassword := IndyTextEncoding_OSDefault.GetBytes(Password); + if Length(LPassword) > 0 then begin + {$IFDEF USE_MARSHALLED_PTRS} + TMarshal.Copy(TBytesPtr(@LPassword)^, 0, TPtrWrapper.Create(buf), IndyMin(Length(LPassword), size)); + {$ELSE} + Move(LPassword[0], buf^, IndyMin(Length(LPassword), size)); + {$ENDIF} + end; + Result := Length(LPassword); + {$ELSE} + StrPLCopy(buf, Password, size); + Result := Length(Password); + {$ENDIF} + buf[size-1] := #0; // RLebeau: truncate the password if needed + finally + LockPassCB.Leave; + end; + finally + GStack.WSSetLastError(LErr); + end; +end; + +procedure InfoCallback(const sslSocket: PSSL; where, ret: TIdC_INT); cdecl; +var + IdSSLSocket: TIdSSLSocket; + StatusStr : String; + LErr : Integer; + LHelper: IIdSSLOpenSSLCallbackHelper; +begin +{ +You have to save the value of WSGetLastError as some Operating System API +function calls will reset that value and we can't know what a programmer will +do in this event. We need the value of WSGetLastError so we can report +an underlying socket error when the OpenSSL function returns. + +JPM. +} + LErr := GStack.WSGetLastError; + try + LockInfoCB.Enter; + try + IdSSLSocket := TIdSSLSocket(SSL_get_app_data(sslSocket)); + if Supports(IdSSLSocket.fParent, IIdSSLOpenSSLCallbackHelper, IInterface(LHelper)) then begin + StatusStr := IndyFormat(RSOSSLStatusString, [String(SSL_state_string_long(sslSocket))]); + LHelper.StatusInfo(sslSocket, where, ret, StatusStr); + LHelper := nil; + end; + finally + LockInfoCB.Leave; + end; + finally + GStack.WSSetLastError(LErr); + end; +end; + +function TranslateInternalVerifyToSSL(Mode: TIdSSLVerifyModeSet): Integer; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := SSL_VERIFY_NONE; + if sslvrfPeer in Mode then begin + Result := Result or SSL_VERIFY_PEER; + end; + if sslvrfFailIfNoPeerCert in Mode then begin + Result := Result or SSL_VERIFY_FAIL_IF_NO_PEER_CERT; + end; + if sslvrfClientOnce in Mode then begin + Result := Result or SSL_VERIFY_CLIENT_ONCE; + end; +end; + +function VerifyCallback(Ok: TIdC_INT; ctx: PX509_STORE_CTX): TIdC_INT; cdecl; +var + hcert: PX509; + Certificate: TIdX509; + hSSL: PSSL; + IdSSLSocket: TIdSSLSocket; + // str: String; + VerifiedOK: Boolean; + Depth: Integer; + Error: Integer; + LOk: Boolean; + LHelper: IIdSSLOpenSSLCallbackHelper; +begin + LockVerifyCB.Enter; + try + VerifiedOK := True; + try + hSSL := X509_STORE_CTX_get_app_data(ctx); + if hSSL = nil then begin + Result := Ok; + Exit; + end; + hcert := X509_STORE_CTX_get_current_cert(ctx); + Certificate := TIdX509.Create(hcert, False); // the certificate is owned by the store + try + IdSSLSocket := TIdSSLSocket(SSL_get_app_data(hSSL)); + Error := X509_STORE_CTX_get_error(ctx); + Depth := X509_STORE_CTX_get_error_depth(ctx); + if not ((Ok > 0) and (IdSSLSocket.fSSLContext.VerifyDepth >= Depth)) then begin + Ok := 0; + {if Error = X509_V_OK then begin + Error := X509_V_ERR_CERT_CHAIN_TOO_LONG; + end;} + end; + LOk := False; + if Ok = 1 then begin + LOk := True; + end; + if Supports(IdSSLSocket.fParent, IIdSSLOpenSSLCallbackHelper, IInterface(LHelper)) then begin + VerifiedOK := LHelper.VerifyPeer(Certificate, LOk, Depth, Error); + LHelper := nil; + end; + finally + FreeAndNil(Certificate); + end; + except + VerifiedOK := False; + end; + //if VerifiedOK and (Ok > 0) then begin + if VerifiedOK {and (Ok > 0)} then begin + Result := 1; + end + else begin + Result := 0; + end; + // Result := Ok; // testing + finally + LockVerifyCB.Leave; + end; +end; + +{$IFDEF OPENSSL_SET_MEMORY_FUNCS} + +function IdMalloc(num: UInt32): Pointer cdecl; +begin + Result := AllocMem(num); +end; + +function IdRealloc(addr: Pointer; num: UInt32): Pointer cdecl; +begin + Result := addr; + ReallocMem(Result, num); +end; + +procedure IdFree(addr: Pointer)cdecl; +begin + FreeMem(addr); +end; + +procedure IdSslCryptoMallocInit; +// replaces the actual alloc routines +// this is useful if you are using a memory manager that can report on leaks +// at shutdown time. +var + r: Integer; +begin + r := CRYPTO_set_mem_functions(@IdMalloc, @IdRealloc, @IdFree); + Assert(r <> 0); +end; +{$ENDIF} + + +{$IFNDEF WIN32_OR_WIN64} +procedure _threadid_func(id : PCRYPTO_THREADID) cdecl; +begin + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + if Assigned(CRYPTO_THREADID_set_numeric) then + {$ENDIF} + begin + CRYPTO_THREADID_set_numeric(id, TIdC_ULONG(CurrentThreadId)); + end; +end; + +function _GetThreadID: TIdC_ULONG; cdecl; +begin + // TODO: Verify how well this will work with fibers potentially running from + // thread to thread or many on the same thread. + Result := TIdC_ULONG(CurrentThreadId); +end; +{$ENDIF} + +procedure SslLockingCallback(mode, n: TIdC_INT; Afile: PIdAnsiChar; + line: TIdC_INT)cdecl; +var + Lock: TIdCriticalSection; + LList: TIdCriticalSectionList; +begin + Assert(CallbackLockList <> nil); + Lock := nil; + + LList := CallbackLockList.LockList; + try + if n < LList.Count then begin + Lock := {$IFDEF HAS_GENERICS_TList}LList.Items[n]{$ELSE}TIdCriticalSection(LList.Items[n]){$ENDIF}; + end; + finally + CallbackLockList.UnlockList; + end; + Assert(Lock <> nil); + if (mode and CRYPTO_LOCK) = CRYPTO_LOCK then begin + Lock.Acquire; + end else begin + Lock.Release; + end; +end; + +procedure PrepareOpenSSLLocking; +var + i, cnt: Integer; + Lock: TIdCriticalSection; + LList: TIdCriticalSectionList; +begin + LList := CallbackLockList.LockList; + try + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + if assigned(CRYPTO_num_locks) then + cnt := CRYPTO_num_locks + else + cnt := 0; + {$ELSE} + cnt := CRYPTO_num_locks; + {$ENDIF} + for i := 0 to cnt - 1 do begin + Lock := TIdCriticalSection.Create; + try + LList.Add(Lock); + except + Lock.Free; + raise; + end; + end; + finally + CallbackLockList.UnlockList; + end; +end; + + +{ +function RSACallback(sslSocket: PSSL; e: Integer; KeyLength: Integer):PRSA; cdecl; +const + RSA: PRSA = nil; +var + SSLSocket: TSSLWSocket; + IdSSLSocket: TIdSSLSocket; +begin + IdSSLSocket := TIdSSLSocket(IdSslGetAppData(sslSocket)); + + if Assigned(IdSSLSocket) then begin + IdSSLSocket.TriggerSSLRSACallback(KeyLength); + end; + + Result := RSA_generate_key(KeyLength, RSA_F4, @RSAProgressCallback, ssl); +end; +} + + +function LoadOpenSSLLibrary: Boolean; +begin + Assert(SSLIsLoaded <> nil); + SSLIsLoaded.Lock; + try + if SSLIsLoaded.Value then begin + Result := True; + Exit; + end; + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + Result := GetOpenSSLLoader.Load; + if not Result then + Exit; + {$ENDIF} +{$IFDEF OPENSSL_SET_MEMORY_FUNCS} + // has to be done before anything that uses memory + IdSslCryptoMallocInit; +{$ENDIF} + OPENSSL_init_ssl(OPENSSL_INIT_LOAD_SSL_STRINGS or OPENSSL_INIT_ADD_ALL_CIPHERS or + OPENSSL_INIT_ADD_ALL_DIGESTS or OPENSSL_INIT_LOAD_CRYPTO_STRINGS or + OPENSSL_INIT_LOAD_CONFIG or OPENSSL_INIT_ASYNC or + OPENSSL_INIT_ENGINE_ALL_BUILTIN ,nil); + + + InitializeRandom; + // Create locking structures, we need them for callback routines + Assert(LockInfoCB = nil); + LockInfoCB := TIdCriticalSection.Create; + LockPassCB := TIdCriticalSection.Create; + LockVerifyCB := TIdCriticalSection.Create; + // Handle internal OpenSSL locking + CallbackLockList := TIdCriticalSectionThreadList.Create; + PrepareOpenSSLLocking; + CRYPTO_set_locking_callback(@SslLockingCallback); +{$IFNDEF WIN32_OR_WIN64} +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} + if Assigned(CRYPTO_THREADID_set_callback) then begin + CRYPTO_THREADID_set_callback(@_threadid_func); + end else begin + CRYPTO_set_id_callback(@_GetThreadID); + end; +{$ELSE} + CRYPTO_THREADID_set_callback(@_threadid_func); +{$ENDIF} +{$ENDIF} + SSLIsLoaded.Value := True; + Result := True; + finally + SSLIsLoaded.Unlock; + end; + +end; + +procedure UnLoadOpenSSLLibrary; +{$IFNDEF USE_OBJECT_ARC} +var + i: Integer; + LList: TIdCriticalSectionList; +{$ENDIF} +begin + SSLIsLoaded.Lock; + try + if not SSLIsLoaded.Value then + Exit; + + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + if Assigned(CRYPTO_set_locking_callback) then + {$ENDIF} + CRYPTO_set_locking_callback(nil); + + CleanupRandom; // <-- RLebeau: why is this here and not in IdSSLOpenSSLHeaders.Unload()? + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + GetOpenSSLLoader.Unload; + {$ENDIF} + FreeAndNil(LockInfoCB); + FreeAndNil(LockPassCB); + FreeAndNil(LockVerifyCB); + if Assigned(CallbackLockList) then begin + {$IFDEF USE_OBJECT_ARC} + CallbackLockList.Clear; // Items are auto-freed + {$ELSE} + LList := CallbackLockList.LockList; + begin + try + for i := 0 to LList.Count - 1 do begin + {$IFDEF HAS_GENERICS_TList}LList.Items[i]{$ELSE}TIdCriticalSection(LList.Items[i]){$ENDIF}.Free; + end; + LList.Clear; + finally + CallbackLockList.UnlockList; + end; + end; + {$ENDIF} + FreeAndNil(CallbackLockList); + end; + SSLIsLoaded.Value := False; + finally + SSLIsLoaded.Unlock; + end; +end; + +function OpenSSLVersion: string; +begin + Result := ''; + // RLebeau 9/7/2015: even if LoadOpenSSLLibrary() fails, _SSLeay_version() + // might have been loaded OK before the failure occured. LoadOpenSSLLibrary() + // does not unload .. + LoadOpenSSLLibrary; + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + if Assigned(SSLeay_version) then + {$ENDIF} + Result := String(SSLeay_version(SSLEAY_VERSION_CONST)); +end; + +function OpenSSLDir : string; +var i: integer; +begin + Result := ''; + LoadOpenSSLLibrary; + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + if Assigned(SSLeay_version) then + {$ENDIF} + Result := String(SSLeay_version(OPENSSL_DIR)); + {assumed format is 'OPENSSLDIR: ""'} + i := Pos('"',Result); + if i < 0 then + Result := '' + else + begin + Delete(Result,1,i); + i := Pos('"',Result); + if i < 0 then + Result := '' + else + Delete(Result,i,Length(Result)-i+1); + end; +end; + + +////////////////////////////////////////////////////// +// TIdSSLOptions +/////////////////////////////////////////////////////// + +constructor TIdSSLOptions.Create; +begin + inherited Create; + fMethod := DEF_SSLVERSION; + fSSLVersions := DEF_SSLVERSIONS; + fUseSystemRootCertificateStore := true; +end; + +procedure TIdSSLOptions.SetMethod(const AValue: TIdSSLVersion); +begin + fMethod := AValue; + if AValue = sslvSSLv23 then begin + fSSLVersions := [sslvSSLv2,sslvSSLv3,sslvTLSv1,sslvTLSv1_1,sslvTLSv1_2]; + end else begin + fSSLVersions := [AValue]; + end; +end; + +procedure TIdSSLOptions.SetSSLVersions(const AValue: TIdSSLVersions); +begin + fSSLVersions := AValue; + if fSSLVersions = [sslvSSLv2] then begin + fMethod := sslvSSLv2; + end + else if fSSLVersions = [sslvSSLv3] then begin + fMethod := sslvSSLv3; + end + else if fSSLVersions = [sslvTLSv1] then begin + fMethod := sslvTLSv1; + end + else if fSSLVersions = [sslvTLSv1_1 ] then begin + fMethod := sslvTLSv1_1; + end + else if fSSLVersions = [sslvTLSv1_2 ] then begin + fMethod := sslvTLSv1_2; + end + else if fSSLVersions = [sslvTLSv1_3 ] then begin + if HasTLS_method then + fMethod := sslvTLSv1_3 + else + fMethod := sslvTLSv1_2; + end + else begin + fMethod := sslvSSLv23; + if sslvSSLv23 in fSSLVersions then begin + Exclude(fSSLVersions, sslvSSLv23); + if fSSLVersions = [] then begin + fSSLVersions := [sslvSSLv2,sslvSSLv3,sslvTLSv1,sslvTLSv1_1,sslvTLSv1_2]; + end; + end; + end; +end; + +procedure TIdSSLOptions.AssignTo(Destination: TPersistent); +var + LDest: TIdSSLOptions; +begin + if Destination is TIdSSLOptions then begin + LDest := TIdSSLOptions(Destination); + LDest.RootCertFile := RootCertFile; + LDest.CertFile := CertFile; + LDest.KeyFile := KeyFile; + LDest.DHParamsFile := DHParamsFile; + LDest.Method := Method; + LDest.SSLVersions := SSLVersions; + LDest.Mode := Mode; + LDest.VerifyMode := VerifyMode; + LDest.VerifyDepth := VerifyDepth; + LDest.fUseSystemRootCertificateStore := fUseSystemRootCertificateStore; + LDest.VerifyDirs := VerifyDirs; + LDest.CipherList := CipherList; + end else begin + inherited AssignTo(Destination); + end; +end; + +/////////////////////////////////////////////////////// +// TIdServerIOHandlerSSLOpenSSL +/////////////////////////////////////////////////////// + +{ TIdServerIOHandlerSSLOpenSSL } + +procedure TIdServerIOHandlerSSLOpenSSL.InitComponent; +begin + inherited InitComponent; + fxSSLOptions := TIdSSLOptions_Internal.Create; + TIdSSLOptions_Internal(fxSSLOptions).Parent := Self; +end; + +destructor TIdServerIOHandlerSSLOpenSSL.Destroy; +begin + FreeAndNil(fxSSLOptions); + inherited Destroy; +end; + +procedure TIdServerIOHandlerSSLOpenSSL.Init; +//see also TIdSSLIOHandlerSocketOpenSSL.Init +begin + //ensure Init isn't called twice + Assert(fSSLContext = nil); + fSSLContext := TIdSSLContext.Create; + fSSLContext.Parent := Self; + fSSLContext.RootCertFile := SSLOptions.RootCertFile; + fSSLContext.CertFile := SSLOptions.CertFile; + fSSLContext.KeyFile := SSLOptions.KeyFile; + fSSLContext.DHParamsFile := SSLOptions.DHParamsFile; + fSSLContext.fVerifyDepth := SSLOptions.fVerifyDepth; + fSSLContext.fVerifyMode := SSLOptions.fVerifyMode; + // fSSLContext.fVerifyFile := SSLOptions.fVerifyFile; + fSSLContext.fUseSystemRootCertificateStore := SSLOptions.fUseSystemRootCertificateStore; + fSSLContext.fVerifyDirs := SSLOptions.fVerifyDirs; + fSSLContext.fCipherList := SSLOptions.fCipherList; + fSSLContext.VerifyOn := Assigned(fOnVerifyPeer); + fSSLContext.StatusInfoOn := Assigned(fOnStatusInfo) or Assigned(FOnStatusInfoEx); + //fSSLContext.PasswordRoutineOn := Assigned(fOnGetPassword); + fSSLContext.fMethod := SSLOptions.Method; + fSSLContext.fMode := SSLOptions.Mode; + fSSLContext.fSSLVersions := SSLOptions.SSLVersions; + + fSSLContext.InitContext(sslCtxServer); +end; + +function TIdServerIOHandlerSSLOpenSSL.Accept(ASocket: TIdSocketHandle; + // This is a thread and not a yarn. Its the listener thread. + AListenerThread: TIdThread; AYarn: TIdYarn ): TIdIOHandler; +var + LIO: TIdSSLIOHandlerSocketOpenSSL; +begin + //using a custom scheduler, AYarn may be nil, so don't assert + Assert(ASocket<>nil); + Assert(fSSLContext<>nil); + Assert(AListenerThread<>nil); + + Result := nil; + LIO := TIdSSLIOHandlerSocketOpenSSL.Create(nil); + try + LIO.PassThrough := True; + LIO.Open; + while not AListenerThread.Stopped do begin + if ASocket.Select(250) then begin + if (not AListenerThread.Stopped) and LIO.Binding.Accept(ASocket.Handle) then begin + //we need to pass the SSLOptions for the socket from the server + // TODO: wouldn't it be easier to just Assign() the server's SSLOptions + // here? Do we really need to share ownership of it? + // LIO.fxSSLOptions.Assign(fxSSLOptions); + FreeAndNil(LIO.fxSSLOptions); + LIO.IsPeer := True; + LIO.fxSSLOptions := fxSSLOptions; + LIO.fSSLSocket := TIdSSLSocket.Create(Self); + LIO.fSSLContext := fSSLContext; + // TODO: to enable server-side SNI, we need to: + // - Set up an additional SSL_CTX for each different certificate; + // - Add a servername callback to each SSL_CTX using SSL_CTX_set_tlsext_servername_callback(); + // - In the callback, retrieve the client-supplied servername with + // SSL_get_servername(ssl, TLSEXT_NAMETYPE_host_name). Figure out the right + // SSL_CTX to go with that host name, then switch the SSL object to that + // SSL_CTX with SSL_set_SSL_CTX(). + + // RLebeau 2/1/2022: note, the following call is basically a no-op for OpenSSL, + // because PassThrough=True and fSSLContext are both assigned above, so there + // is really nothing for TIdSSLIOHandlerSocketOpenSSL.Init() or + // TIdSSLIOHandlerSocketOpenSSL.StartSSL() to do when called by + // TIdSSLIOHandlerSocketOpenSSL.AfterAccept(). If anything, all this will + // really do is update the Binding's IPVersion. But, calling this is consistent + // with other server Accept() implementations, so we should do it here, too... + LIO.AfterAccept; + + Result := LIO; + LIO := nil; + Break; + end; + end; + end; + finally + FreeAndNil(LIO); + end; +end; + +procedure TIdServerIOHandlerSSLOpenSSL.DoStatusInfo(const AMsg: String); +begin + if Assigned(fOnStatusInfo) then begin + fOnStatusInfo(AMsg); + end; +end; + +procedure TIdServerIOHandlerSSLOpenSSL.DoStatusInfoEx(const AsslSocket: PSSL; + const AWhere, Aret: TIdC_INT; const AWhereStr, ARetStr: String); +begin + if Assigned(FOnStatusInfoEx) then begin + FOnStatusInfoEx(Self,AsslSocket,AWhere,Aret,AWHereStr,ARetStr); + end; +end; + +procedure TIdServerIOHandlerSSLOpenSSL.DoGetPassword(var Password: String); +begin + if Assigned(fOnGetPassword) then begin + fOnGetPassword(Password); + end; +end; + +procedure TIdServerIOHandlerSSLOpenSSL.DoGetPasswordEx( + var VPassword: String; const AIsWrite: Boolean); +begin + if Assigned(fOnGetPasswordEx) then begin + fOnGetPasswordEx(Self,VPassword,AIsWrite); + end; +end; + +function TIdServerIOHandlerSSLOpenSSL.DoVerifyPeer(Certificate: TIdX509; + AOk: Boolean; ADepth, AError: Integer): Boolean; +begin + Result := True; + if Assigned(fOnVerifyPeer) then begin + Result := fOnVerifyPeer(Certificate, AOk, ADepth, AError); + end; +end; + +function TIdServerIOHandlerSSLOpenSSL.MakeFTPSvrPort : TIdSSLIOHandlerSocketBase; +var + LIO : TIdSSLIOHandlerSocketOpenSSL; +begin + LIO := TIdSSLIOHandlerSocketOpenSSL.Create(nil); + try + LIO.PassThrough := True; + LIO.OnGetPassword := DoGetPassword; + LIO.OnGetPasswordEx := OnGetPasswordEx; + LIO.IsPeer := True; // RLebeau 1/24/2019: is this still needed now? + LIO.SSLOptions.Assign(SSLOptions); + LIO.SSLOptions.Mode := sslmBoth;{or sslmClient}{doesn't really matter} + LIO.SSLContext := SSLContext; + except + LIO.Free; + raise; + end; + Result := LIO; +end; + +procedure TIdServerIOHandlerSSLOpenSSL.Shutdown; +begin + FreeAndNil(fSSLContext); + inherited Shutdown; +end; + +function TIdServerIOHandlerSSLOpenSSL.MakeFTPSvrPasv : TIdSSLIOHandlerSocketBase; +var + LIO : TIdSSLIOHandlerSocketOpenSSL; +begin + LIO := TIdSSLIOHandlerSocketOpenSSL.Create(nil); + try + LIO.PassThrough := True; + LIO.OnGetPassword := DoGetPassword; + LIO.OnGetPasswordEx := OnGetPasswordEx; + LIO.IsPeer := True; + LIO.SSLOptions.Assign(SSLOptions); + LIO.SSLOptions.Mode := sslmBoth;{or sslmServer} + LIO.SSLContext := nil; + except + LIO.Free; + raise; + end; + Result := LIO; +end; + +{ IIdSSLOpenSSLCallbackHelper } + +function TIdServerIOHandlerSSLOpenSSL.GetPassword(const AIsWrite : Boolean): string; +begin + DoGetPasswordEx(Result, AIsWrite); + if Result = '' then begin + DoGetPassword(Result); + end; +end; + +procedure TIdServerIOHandlerSSLOpenSSL.StatusInfo(const ASslSocket: PSSL; + AWhere, ARet: TIdC_INT; const AStatusStr: string); +var + LType, LMsg: string; +begin + DoStatusInfo(AStatusStr); + if Assigned(fOnStatusInfoEx) then begin + GetStateVars(ASslSocket, AWhere, ARet, LType, LMsg); + DoStatusInfoEx(ASslSocket, AWhere, ARet, LType, LMsg); + end; +end; + +function TIdServerIOHandlerSSLOpenSSL.VerifyPeer(ACertificate: TIdX509; + AOk: Boolean; ADepth, AError: Integer): Boolean; +begin + Result := DoVerifyPeer(ACertificate, AOk, ADepth, AError); +end; + +function TIdServerIOHandlerSSLOpenSSL.GetIOHandlerSelf: TIdSSLIOHandlerSocketOpenSSL; +begin + Result := nil; +end; + +/////////////////////////////////////////////////////// +// TIdSSLIOHandlerSocketOpenSSL +/////////////////////////////////////////////////////// + +function TIdServerIOHandlerSSLOpenSSL.MakeClientIOHandler: TIdSSLIOHandlerSocketBase; +var + LIO : TIdSSLIOHandlerSocketOpenSSL; +begin + LIO := TIdSSLIOHandlerSocketOpenSSL.Create(nil); + try + LIO.PassThrough := True; + // LIO.SSLOptions.Free; + // LIO.SSLOptions := SSLOptions; + // LIO.SSLContext := SSLContext; + LIO.SSLOptions.Assign(SSLOptions); + // LIO.SSLContext := SSLContext; + LIO.SSLContext := nil;//SSLContext.Clone; // BGO: clone does not work, it must be either NIL, or SSLContext + LIO.OnGetPassword := DoGetPassword; + LIO.OnGetPasswordEx := OnGetPasswordEx; + except + LIO.Free; + raise; + end; + Result := LIO; +end; + +{ TIdSSLIOHandlerSocketOpenSSL } + +procedure TIdSSLIOHandlerSocketOpenSSL.InitComponent; +begin + inherited InitComponent; + IsPeer := False; + fxSSLOptions := TIdSSLOptions_Internal.Create; + TIdSSLOptions_Internal(fxSSLOptions).Parent := Self; + fSSLLayerClosed := True; + fSSLContext := nil; +end; + +destructor TIdSSLIOHandlerSocketOpenSSL.Destroy; +begin + FreeAndNil(fSSLSocket); + //we do not destroy these if their Parent is not Self + //because these do not belong to us when we are in a server. + if (fSSLContext <> nil) and (fSSLContext.Parent = Self) then begin + FreeAndNil(fSSLContext); + end; + if (fxSSLOptions <> nil) and + (fxSSLOptions is TIdSSLOptions_Internal) and + (TIdSSLOptions_Internal(fxSSLOptions).Parent = Self) then + begin + FreeAndNil(fxSSLOptions); + end; + inherited Destroy; +end; + +procedure TIdSSLIOHandlerSocketOpenSSL.ConnectClient; +var + LPassThrough: Boolean; +begin + // RLebeau: initialize OpenSSL before connecting the socket... + try + Init; + except + on EIdOSSLCouldNotLoadSSLLibrary do begin + if not PassThrough then raise; + end; + end; + // RLebeau 1/11/07: In case a proxy is being used, pass through + // any data from the base class unencrypted when setting up that + // connection. We should do this anyway since SSL hasn't been + // negotiated yet! + LPassThrough := fPassThrough; + fPassThrough := True; + try + inherited ConnectClient; + finally + fPassThrough := LPassThrough; + end; + DoBeforeConnect(Self); + // CreateSSLContext(sslmClient); + // CreateSSLContext(SSLOptions.fMode); + StartSSL; +end; + +procedure TIdSSLIOHandlerSocketOpenSSL.StartSSL; +begin + if not PassThrough then begin + OpenEncodedConnection; + end; +end; + +procedure TIdSSLIOHandlerSocketOpenSSL.Close; +begin + FreeAndNil(fSSLSocket); + if fSSLContext <> nil then begin + if fSSLContext.Parent = Self then begin + FreeAndNil(fSSLContext); + end else begin + fSSLContext := nil; + end; + end; + inherited Close; +end; + +procedure TIdSSLIOHandlerSocketOpenSSL.Open; +begin + FOpened := False; + inherited Open; +end; + +function TIdSSLIOHandlerSocketOpenSSL.Readable(AMSec: Integer = IdTimeoutDefault): Boolean; +begin + if not fPassThrough then + begin + Result := (fSSLSocket <> nil) and (ssl_pending(fSSLSocket.fSSL) > 0); + if Result then Exit; + end; + Result := inherited Readable(AMSec); +end; + +procedure TIdSSLIOHandlerSocketOpenSSL.SetPassThrough(const Value: Boolean); +begin + if fPassThrough <> Value then begin + if not Value then begin + if BindingAllocated then begin + if Assigned(fSSLContext) then begin + OpenEncodedConnection; + end else begin + raise EIdOSSLCouldNotLoadSSLLibrary.Create(RSOSSLCouldNotLoadSSLLibrary); + end; + end; + end + else begin + // RLebeau 8/16/2019: need to call SSL_shutdown() here if the SSL/TLS session is active. + // This is for FTP when handling CCC and REIN commands. The SSL/TLS session needs to be + // shutdown cleanly on both ends without closing the underlying socket connection because + // it is going to be used for continued unsecure communications! + if (fSSLSocket <> nil) and (fSSLSocket.fSSL <> nil) then begin + // if SSL_shutdown() returns 0, a "close notify" was sent to the peer and SSL_shutdown() + // needs to be called again to receive the peer's "close notify" in response... + if SSL_shutdown(fSSLSocket.fSSL) = 0 then begin + SSL_shutdown(fSSLSocket.fSSL); + end; + end; + {$IFDEF WIN32_OR_WIN64} + // begin bug fix + if BindingAllocated and IndyCheckWindowsVersion(6) then + begin + // disables Vista+ SSL_Read and SSL_Write timeout fix + Binding.SetSockOpt(Id_SOL_SOCKET, Id_SO_RCVTIMEO, 0); + Binding.SetSockOpt(Id_SOL_SOCKET, Id_SO_SNDTIMEO, 0); + end; + // end bug fix + {$ENDIF} + end; + fPassThrough := Value; + end; +end; + +function TIdSSLIOHandlerSocketOpenSSL.RecvEnc(var VBuffer: TIdBytes): Integer; +begin + Result := fSSLSocket.Recv(VBuffer); +end; + +function TIdSSLIOHandlerSocketOpenSSL.SendEnc(const ABuffer: TIdBytes; + const AOffset, ALength: Integer): Integer; +begin + Result := fSSLSocket.Send(ABuffer, AOffset, ALength); +end; + +procedure TIdSSLIOHandlerSocketOpenSSL.AfterAccept; +begin + try + inherited AfterAccept; + // RLebeau: initialize OpenSSL after accepting a client socket... + try + Init; + except + on EIdOSSLCouldNotLoadSSLLibrary do begin + if not PassThrough then raise; + end; + end; + StartSSL; + except + Close; + raise; + end; +end; + +procedure TIdSSLIOHandlerSocketOpenSSL.Init; +//see also TIdServerIOHandlerSSLOpenSSL.Init +begin + if not Assigned(fSSLContext) then begin + fSSLContext := TIdSSLContext.Create; + fSSLContext.Parent := Self; + fSSLContext.RootCertFile := SSLOptions.RootCertFile; + fSSLContext.CertFile := SSLOptions.CertFile; + fSSLContext.KeyFile := SSLOptions.KeyFile; + fSSLContext.DHParamsFile := SSLOptions.DHParamsFile; + fSSLContext.fVerifyDepth := SSLOptions.fVerifyDepth; + fSSLContext.fVerifyMode := SSLOptions.fVerifyMode; + // fSSLContext.fVerifyFile := SSLOptions.fVerifyFile; + fSSLContext.fUseSystemRootCertificateStore := SSLOptions.fUseSystemRootCertificateStore; + fSSLContext.fVerifyDirs := SSLOptions.fVerifyDirs; + fSSLContext.fCipherList := SSLOptions.fCipherList; + fSSLContext.VerifyOn := Assigned(fOnVerifyPeer); + fSSLContext.StatusInfoOn := Assigned(fOnStatusInfo) or Assigned(fOnStatusInfoEx); + //fSSLContext.PasswordRoutineOn := Assigned(fOnGetPassword); + fSSLContext.fMethod := SSLOptions.Method; + fSSLContext.fSSLVersions := SSLOptions.SSLVersions; + fSSLContext.fMode := SSLOptions.Mode; + fSSLContext.InitContext(sslCtxClient); + end; +end; +//} + +procedure TIdSSLIOHandlerSocketOpenSSL.DoStatusInfo(const AMsg: String); +begin + if Assigned(fOnStatusInfo) then begin + fOnStatusInfo(AMsg); + end; +end; + +procedure TIdSSLIOHandlerSocketOpenSSL.DoStatusInfoEx( + const AsslSocket: PSSL; const AWhere, Aret: TIdC_INT; const AWhereStr, + ARetStr: String); +begin + if Assigned(FOnStatusInfoEx) then begin + FOnStatusInfoEx(Self,AsslSocket,AWhere,Aret,AWHereStr,ARetStr); + end; +end; + +procedure TIdSSLIOHandlerSocketOpenSSL.DoGetPassword(var Password: String); +begin + if Assigned(fOnGetPassword) then begin + fOnGetPassword(Password); + end; +end; + +procedure TIdSSLIOHandlerSocketOpenSSL.DoGetPasswordEx(var VPassword: String; + const AIsWrite: Boolean); +begin + if Assigned(fOnGetPasswordEx) then begin + fOnGetPasswordEx(Self,VPassword,AIsWrite); + end; +end; + +procedure TIdSSLIOHandlerSocketOpenSSL.DoOnSSLNegotiated; +begin + if Assigned(FOnSSLNegotiated) then begin + FOnSSLNegotiated(Self); + end; +end; + +function TIdSSLIOHandlerSocketOpenSSL.DoVerifyPeer(Certificate: TIdX509; + AOk: Boolean; ADepth, AError: Integer): Boolean; +begin + Result := True; + if Assigned(fOnVerifyPeer) then begin + Result := fOnVerifyPeer(Certificate, AOk, ADepth, AError); + end; +end; + +procedure TIdSSLIOHandlerSocketOpenSSL.OpenEncodedConnection; +var + {$IFDEF WIN32_OR_WIN64} + LTimeout: Integer; + {$ENDIF} + LMode: TIdSSLMode; + LHost: string; + + // TODO: move the following to TIdSSLIOHandlerSocketBase... + + function GetURIHost: string; + var + LURI: TIdURI; + begin + Result := ''; + if URIToCheck <> '' then + begin + LURI := TIdURI.Create(URIToCheck); + try + Result := LURI.Host; + finally + LURI.Free; + end; + end; + end; + + function GetProxyTargetHost: string; + var + // under ARC, convert a weak reference to a strong reference before working with it + LTransparentProxy, LNextTransparentProxy: TIdCustomTransparentProxy; + begin + Result := ''; + // RLebeau: not reading from the property as it will create a + // default Proxy object if one is not already assigned... + LTransparentProxy := FTransparentProxy; + if Assigned(LTransparentProxy) then + begin + if LTransparentProxy.Enabled then + begin + repeat + LNextTransparentProxy := LTransparentProxy.ChainedProxy; + if not Assigned(LNextTransparentProxy) then Break; + if not LNextTransparentProxy.Enabled then Break; + LTransparentProxy := LNextTransparentProxy; + until False; + Result := LTransparentProxy.Host; + end; + end; + end; + +begin + Assert(Binding<>nil); + if not Assigned(fSSLSocket) then begin + fSSLSocket := TIdSSLSocket.Create(Self); + end; + Assert(fSSLSocket.fSSLContext=nil); + fSSLSocket.fSSLContext := fSSLContext; + {$IFDEF WIN32_OR_WIN64} + // begin bug fix + if IndyCheckWindowsVersion(6) then + begin + // Note: Fix needed to allow SSL_Read and SSL_Write to timeout under + // Vista+ when connection is dropped + LTimeout := FReadTimeOut; + if LTimeout <= 0 then begin + LTimeout := 30000; // 30 seconds + end; + Binding.SetSockOpt(Id_SOL_SOCKET, Id_SO_RCVTIMEO, LTimeout); + Binding.SetSockOpt(Id_SOL_SOCKET, Id_SO_SNDTIMEO, LTimeout); + end; + // end bug fix + {$ENDIF} + // RLebeau 7/2/2015: do not rely on IsPeer to decide whether to call Connect() + // or Accept(). SSLContext.Mode controls whether a client or server method is + // used to handle the connection, so that same value should be used here as well. + // A user encountered a scenario where he needed to connect a TIdTCPClient to a + // TCP server on a hardware device, but run the client's SSLIOHandler as an SSL + // server because the device was initiating the SSL handshake as an SSL client. + // IsPeer was not designed to handle that scenario. Setting IsPeer to True + // allowed Accept() to be called here, but at the cost of causing memory leaks + // in TIdSSLIOHandlerSocketOpenSSL.Destroy() and TIdSSLIOHandlerSocketOpenSSL.Close() + // in client components! IsPeer is intended to be set to True only in server + // components... + LMode := fSSLContext.Mode; + if not (LMode in [sslmClient, sslmServer]) then begin + // Mode must be sslmBoth (or else TIdSSLContext.SetSSLMethod() would have + // raised an exception), so just fall back to previous behavior for now, + // until we can figure out a better way to handle this scenario... + if IsPeer then begin + LMode := sslmServer; + end else begin + LMode := sslmClient; + end; + end; + if LMode = sslmClient then begin + LHost := GetURIHost; + if LHost = '' then + begin + LHost := GetProxyTargetHost; + if LHost = '' then begin + LHost := Self.Host; + end; + end; + fSSLSocket.fHostName := LHost; + fSSLSocket.Connect(Binding.Handle); + end else begin + fSSLSocket.fHostName := ''; + fSSLSocket.Accept(Binding.Handle); + end; + DoOnSSLNegotiated; + fPassThrough := False; +end; + +procedure TIdSSLIOHandlerSocketOpenSSL.DoBeforeConnect(ASender: TIdSSLIOHandlerSocketOpenSSL); +begin + if Assigned(OnBeforeConnect) then begin + OnBeforeConnect(Self); + end; +end; + + +// TODO: add an AOwner parameter +function TIdSSLIOHandlerSocketOpenSSL.Clone: TIdSSLIOHandlerSocketBase; +var + LIO : TIdSSLIOHandlerSocketOpenSSL; +begin + LIO := TIdSSLIOHandlerSocketOpenSSL.Create(nil); + try + LIO.SSLOptions.Assign( SSLOptions ); + LIO.OnStatusInfo := DoStatusInfo; + LIO.OnGetPassword := DoGetPassword; + LIO.OnGetPasswordEx := OnGetPasswordEx; + LIO.OnVerifyPeer := DoVerifyPeer; + LIO.OnSSLNegotiated := OnSSLNegotiated; + LIO.fSSLSocket := TIdSSLSocket.Create(Self); + except + LIO.Free; + raise; + end; + Result := LIO; +end; + +function TIdSSLIOHandlerSocketOpenSSL.CheckForError(ALastResult: Integer): Integer; +//var +// err: Integer; +begin + if PassThrough then begin + Result := inherited CheckForError(ALastResult); + end else begin + Result := fSSLSocket.GetSSLError(ALastResult); + if Result = SSL_ERROR_NONE then begin + Result := 0; + Exit; + end; + if Result = SSL_ERROR_SYSCALL then begin + Result := inherited CheckForError(Integer(Id_SOCKET_ERROR)); + Exit; + end; + EIdOpenSSLAPISSLError.RaiseExceptionCode(Result, ALastResult, ''); + end; +end; + +procedure TIdSSLIOHandlerSocketOpenSSL.RaiseError(AError: Integer); +begin + if (PassThrough) or (AError = Id_WSAESHUTDOWN) or (AError = Id_WSAECONNABORTED) or (AError = Id_WSAECONNRESET) then begin + inherited RaiseError(AError); + end else begin + EIdOpenSSLAPISSLError.RaiseException(fSSLSocket.fSSL, AError, ''); + end; +end; + +{ IIdSSLOpenSSLCallbackHelper } + +function TIdSSLIOHandlerSocketOpenSSL.GetPassword(const AIsWrite : Boolean): string; +begin + DoGetPasswordEx(Result, AIsWrite); + if Result = '' then begin + DoGetPassword(Result); + end; +end; + +procedure TIdSSLIOHandlerSocketOpenSSL.StatusInfo(const ASslSocket: PSSL; + AWhere, ARet: TIdC_INT; const AStatusStr: string); +var + LType, LMsg: string; +begin + DoStatusInfo(AStatusStr); + if Assigned(fOnStatusInfoEx) then begin + GetStateVars(ASslSocket, AWhere, ARet, LType, LMsg); + DoStatusInfoEx(ASslSocket, AWhere, ARet, LType, LMsg); + end; +end; + +function TIdSSLIOHandlerSocketOpenSSL.VerifyPeer(ACertificate: TIdX509; + AOk: Boolean; ADepth, AError: Integer): Boolean; +begin + Result := DoVerifyPeer(ACertificate, AOk, ADepth, AError); +end; + +function TIdSSLIOHandlerSocketOpenSSL.GetIOHandlerSelf: TIdSSLIOHandlerSocketOpenSSL; +begin + Result := Self; +end; + +{ TIdSSLContext } + +constructor TIdSSLContext.Create; +begin + inherited Create; + //an exception here probably means that you are using the wrong version + //of the openssl libraries. refer to comments at the top of this file. + if not LoadOpenSSLLibrary then begin + raise EIdOSSLCouldNotLoadSSLLibrary.Create(RSOSSLCouldNotLoadSSLLibrary); + end; + fVerifyMode := []; + fMode := sslmUnassigned; + fSessionId := 1; + fUseSystemRootCertificateStore := true; +end; + +destructor TIdSSLContext.Destroy; +begin + DestroyContext; + inherited Destroy; +end; + +{$IFDEF USE_WINDOWS_CERT_STORE} +const + wincryptdll = 'crypt32.dll'; + RootStore = 'ROOT'; + +type + HCERTSTORE = THandle; + HCRYPTPROV_LEGACY = PIdC_LONG; + PCERT_INFO = pointer; {don't need to know this structure} + PCCERT_CONTEXT = ^CERT_CONTEXT; + CERT_CONTEXT = record + dwCertEncodingType: DWORD; + pbCertEncoded: PByte; + cbCertEncoded: DWORD; + CertInfo: PCERT_INFO; + certstore: HCERTSTORE + end; + +{$IFDEF STRING_IS_ANSI} +{$EXTERNALSYM CertOpenSystemStoreA} +function CertOpenSystemStoreA(hProv: HCRYPTPROV_LEGACY; szSubsystemProtocol: PIdAnsiChar):HCERTSTORE; + stdcall; external wincryptdll; +{$ELSE} +{$EXTERNALSYM CertOpenSystemStoreW} +function CertOpenSystemStoreW(hProv: HCRYPTPROV_LEGACY; szSubsystemProtocol: PCHar):HCERTSTORE; + stdcall; external wincryptdll; +{$ENDIF} + +{$EXTERNALSYM CertCloseStore} +function CertCloseStore(certstore: HCERTSTORE; dwFlags: DWORD): boolean; stdcall; external wincryptdll; + +{$EXTERNALSYM CertEnumCertificatesInStore} +function CertEnumCertificatesInStore(certstore: HCERTSTORE; pPrevCertContext: PCCERT_CONTEXT): PCCERT_CONTEXT; + stdcall; external wincryptdll; + +{Copy Windows CA Certs to out cert store} +procedure TIdSSLContext.LoadWindowsCertStore; +var WinCertStore: HCERTSTORE; + X509Cert: PX509; + cert_context: PCCERT_CONTEXT; + error: integer; + SSLCertStore: PX509_STORE; + CertEncoded: PByte; +begin + cert_context := nil; + {$IFDEF STRING_IS_ANSI} + WinCertStore := CertOpenSystemStoreA(nil,RootStore); + {$ELSE} + WinCertStore := CertOpenSystemStoreW(nil,RootStore); + {$ENDIF} + if WinCertStore = 0 then + Exit; + + SSLCertStore := SSL_CTX_get_cert_store(fContext); + try + cert_context := CertEnumCertificatesInStore(WinCertStore,cert_context); + while cert_context <> nil do + begin + CertEncoded := cert_context^.pbCertEncoded; + X509Cert := d2i_X509(nil,@CertEncoded, cert_context^.cbCertEncoded); + if X509Cert <> nil then + begin + error := X509_STORE_add_cert(SSLCertStore, X509Cert); +//Ignore if cert already in store + if (error = 0) and + (ERR_GET_REASON(ERR_get_error) <> X509_R_CERT_ALREADY_IN_HASH_TABLE) then + EIdOpenSSLAPICryptoError.RaiseException(ROSCertificateNotAddedToStore); + X509_free(X509Cert); + end; + cert_context := CertEnumCertificatesInStore(WinCertStore,cert_context); + end; + finally + CertCloseStore(WinCertStore, 0); + end; +end; +{$ENDIF} + +procedure TIdSSLContext.DestroyContext; +begin + if fContext <> nil then begin + SSL_CTX_free(fContext); + fContext := nil; + end; +end; + +procedure TIdSSLContext.InitContext(CtxMode: TIdSSLCtxMode); +const + SSLProtoVersion: array[TIdSSLVersion] of TIdC_LONG = (0,0,0, + SSL3_VERSION, {sslvSSLv3} + TLS1_VERSION, {sslvTLSv1} + TLS1_1_VERSION, {sslvTLSv1_1} + TLS1_2_VERSION, {sslvTLSv1_2} + TLS1_3_VERSION); {sslvTLSv1_3} +var + SSLMethod: PSSL_METHOD; + error: TIdC_INT; + v: TIdSSLVersion; +// pCAname: PSTACK_X509_NAME; + {$IFDEF USE_MARSHALLED_PTRS} + M: TMarshaller; + {$ENDIF} +begin + // Destroy the context first + DestroyContext; + if fMode = sslmUnassigned then begin + if CtxMode = sslCtxServer then begin + fMode := sslmServer; + end else begin + fMode := sslmClient; + end + end; + // get SSL method function (SSL2, SSL23, SSL3, TLS) + SSLMethod := SetSSLMethod; + // create new SSL context + fContext := SSL_CTX_new(SSLMethod); + if fContext = nil then begin + EIdOSSLCreatingContextError.RaiseException(RSSSLCreatingContextError); + end; + + //set SSL Versions we will use + if HasTLS_method then + begin + if SSLVersions <> [] then + begin + for v := sslvSSLv3 to MAX_SSLVERSION do + begin + if v in SSLVersions then + begin + SSL_CTX_set_min_proto_version(fContext,SSLProtoVersion[v]); + break; + end; + end; + for v := MAX_SSLVERSION downto sslvSSLv3 do + begin + if v in SSLVersions then + begin + SSL_CTX_set_max_proto_version(fContext,SSLProtoVersion[v]); + break; + end; + end; + end + else + begin + SSL_CTX_set_min_proto_version(fContext,SSL3_VERSION); + SSL_CTX_set_max_proto_version(fContext,SSLProtoVersion[high(TIdSSLVersion)]); + end; + end + else + begin + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + {legacy code 1.0.2 and earlier} + + if IsOpenSSL_SSLv2_Available then begin + if not (sslvSSLv2 in SSLVersions) then begin + SSL_CTX_set_options(fContext, SSL_OP_NO_SSLv2); + end + else if (fMethod = sslvSSLv23) then begin + SSL_CTX_clear_options(fContext, SSL_OP_NO_SSLv2); + end; + end; + // SSLv3 might also be disabled as well.. + if IsOpenSSL_SSLv3_Available then begin + if not (sslvSSLv3 in SSLVersions) then begin + SSL_CTX_set_options(fContext, SSL_OP_NO_SSLv3); + end + else if (fMethod = sslvSSLv23) then begin + SSL_CTX_clear_options(fContext, SSL_OP_NO_SSLv3); + end; + end; + // may as well do the same for all of them... + if IsOpenSSL_TLSv1_0_Available then begin + if not (sslvTLSv1 in SSLVersions) then begin + SSL_CTX_set_options(fContext, SSL_OP_NO_TLSv1); + end + else if (fMethod = sslvSSLv23) then begin + SSL_CTX_clear_options(fContext, SSL_OP_NO_TLSv1); + end; + end; + {IMPORTANT!!! Do not set SSL_CTX_set_options SSL_OP_NO_TLSv1_1 and + SSL_OP_NO_TLSv1_2 if that functionality is not available. OpenSSL 1.0 and + earlier do not support those flags. Those flags would only cause + an invalid MAC when doing SSL.} + if IsOpenSSL_TLSv1_1_Available then begin + if not (sslvTLSv1_1 in SSLVersions) then begin + SSL_CTX_set_options(fContext, SSL_OP_NO_TLSv1_1); + end + else if (fMethod = sslvSSLv23) then begin + SSL_CTX_clear_options(fContext, SSL_OP_NO_TLSv1_1); + end; + end; + if IsOpenSSL_TLSv1_2_Available then begin + if not (sslvTLSv1_2 in SSLVersions) then begin + SSL_CTX_set_options(fContext, SSL_OP_NO_TLSv1_2); + end + else if (fMethod = sslvSSLv23) then begin + SSL_CTX_clear_options(fContext, SSL_OP_NO_TLSv1_2); + end; + end; + {$ENDIF} + end; + + SSL_CTX_set_mode(fContext, SSL_MODE_AUTO_RETRY); + // assign a password lookup routine +// if PasswordRoutineOn then begin + SSL_CTX_set_default_passwd_cb(fContext, @PasswordCallback); + SSL_CTX_set_default_passwd_cb_userdata(fContext, Self); +// end; + + if fUseSystemRootCertificateStore then + begin + {$IFDEF USE_WINDOWS_CERT_STORE} + LoadWindowsCertStore; + {$ELSE} + SSL_CTX_set_default_verify_paths(fContext); + {$ENDIF} + end; + // load key and certificate files + if (RootCertFile <> '') or (VerifyDirs <> '') then begin {Do not Localize} + if not LoadRootCert then begin + EIdOSSLLoadingRootCertError.RaiseException(RSSSLLoadingRootCertError); + end; + end; + if CertFile <> '' then begin {Do not Localize} + if not LoadCert then begin + EIdOSSLLoadingCertError.RaiseException(RSSSLLoadingCertError); + end; + end; + if KeyFile <> '' then begin {Do not Localize} + if not LoadKey then begin + EIdOSSLLoadingKeyError.RaiseException(RSSSLLoadingKeyError); + end; + end; + if DHParamsFile <> '' then begin {Do not Localize} + if not LoadDHParams then begin + EIdOSSLLoadingDHParamsError.RaiseException(RSSSLLoadingDHParamsError); + end; + end; + if StatusInfoOn then begin + SSL_CTX_set_info_callback(fContext, InfoCallback); + end; + //if_SSL_CTX_set_tmp_rsa_callback(hSSLContext, @RSACallback); + if fCipherList <> '' then begin {Do not Localize} + error := SSL_CTX_set_cipher_list(fContext, + {$IFDEF USE_MARSHALLED_PTRS} + M.AsAnsi(fCipherList).ToPointer + {$ELSE} + PAnsiChar( + {$IFDEF STRING_IS_ANSI} + fCipherList + {$ELSE} + AnsiString(fCipherList) // explicit cast to Ansi + {$ENDIF} + ) + {$ENDIF} + ); + end else begin + // RLebeau: don't override OpenSSL's default. As OpenSSL evolves, the + // SSL_DEFAULT_CIPHER_LIST constant defined in the C/C++ SDK may change, + // while Indy's define of it might take some time to catch up. We don't + // want users using an older default with newer DLLs... + (* + error := SSL_CTX_set_cipher_list(fContext, + {$IFDEF USE_MARSHALLED_PTRS} + M.AsAnsi(SSL_DEFAULT_CIPHER_LIST).ToPointer + {$ELSE} + SSL_DEFAULT_CIPHER_LIST + {$ENDIF} + ); + *) + error := 1; + end; + if error <= 0 then begin + // TODO: should this be using EIdOSSLSettingCipherError.RaiseException() instead? + raise EIdOSSLSettingCipherError.Create(RSSSLSettingCipherError); + end; + if fVerifyMode <> [] then begin + SetVerifyMode(fVerifyMode, VerifyOn); + end; + if CtxMode = sslCtxServer then begin + SSL_CTX_set_session_id_context(fContext, PByte(@fSessionId), SizeOf(fSessionId)); + end; + // CA list + if RootCertFile <> '' then begin {Do not Localize} + SSL_CTX_set_client_CA_list(fContext, IndySSL_load_client_CA_file(RootCertFile)); + end + + // TODO: provide an event so users can apply their own settings as needed... +end; + +procedure TIdSSLContext.SetVerifyMode(Mode: TIdSSLVerifyModeSet; CheckRoutine: Boolean); +var + Func: TSSL_CTX_set_verify_callback; +begin + if fContext<>nil then begin +// SSL_CTX_set_default_verify_paths(fContext); + if CheckRoutine then begin + Func := VerifyCallback; + end else begin + Func := nil; + end; + SSL_CTX_set_verify(fContext, TranslateInternalVerifyToSSL(Mode), Func); + SSL_CTX_set_verify_depth(fContext, fVerifyDepth); + end; +end; + +function TIdSSLContext.GetVerifyMode: TIdSSLVerifyModeSet; +begin + Result := fVerifyMode; +end; +{ +function TIdSSLContext.LoadVerifyLocations(FileName: String; Dirs: String): Boolean; +begin + Result := False; + + if (Dirs <> '') or (FileName <> '') then begin + if IndySSL_CTX_load_verify_locations(fContext, FileName, Dirs) <= 0 then begin + raise EIdOSSLCouldNotLoadSSLLibrary.Create(RSOSSLCouldNotLoadSSLLibrary); + end; + end; + + Result := True; +end; +} + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +function SelectTLS1Method(const AMode : TIdSSLMode) : PSSL_METHOD; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := nil; + case AMode of + sslmServer : begin + if Assigned(TLSv1_server_method) then begin + Result := TLSv1_server_method(); + end; + end; + sslmClient : begin + if Assigned(TLSv1_client_method) then begin + Result := TLSv1_client_method(); + end; + end; + else + if Assigned(TLSv1_method) then begin + Result := TLSv1_method(); + end; + end; +end; +{$ENDIF} + +function TIdSSLContext.SetSSLMethod: PSSL_METHOD; +begin + Result := nil; + if fMode = sslmUnassigned then begin + raise EIdOSSLModeNotSet.Create(RSOSSLModeNotSet); + end; + {We are running with OpenSSL 1.1.1 or later. OpenSSL will negotiate the best + available SSL/TLS version and there is not much that we can do to influence this. + Hence, we ignore fMethod. + + Quoting from the OpenSSL man page: + + TLS_method(), TLS_server_method(), TLS_client_method() + + These are the general-purpose version-flexible SSL/TLS methods. The actual + protocol version used will be negotiated to the highest version mutually s + upported by the client and the server. The supported protocols are SSLv3, + TLSv1, TLSv1.1, TLSv1.2 and TLSv1.3. Applications should use these methods, + and avoid the version-specific methods described below [e.g. SSLv2_method), + which are deprecated. +} + case fMode of + sslmClient: + Result := TLS_client_method(); + + sslmServer: + Result := TLS_server_method(); + + sslmBoth: + Result := TLS_Method(); + + end; +end; + +function TIdSSLContext.LoadRootCert: Boolean; +begin + Result := IndySSL_CTX_load_verify_locations(fContext, RootCertFile, VerifyDirs) > 0; +end; + +function TIdSSLContext.LoadCert: Boolean; +begin + if PosInStrArray(ExtractFileExt(CertFile), ['.p12', '.pfx'], False) <> -1 then begin + Result := IndySSL_CTX_use_certificate_file_PKCS12(fContext, CertFile) > 0; + end else begin + //OpenSSL 1.0.2 has a new function, SSL_CTX_use_certificate_chain_file + //that handles a chain of certificates in a PEM file. That is prefered. + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + if Assigned(SSL_CTX_use_certificate_chain_file) then begin + Result := IndySSL_CTX_use_certificate_chain_file(fContext, CertFile) > 0; + end else begin + Result := IndySSL_CTX_use_certificate_file(fContext, CertFile, SSL_FILETYPE_PEM) > 0; + end; + {$ELSE} + Result := IndySSL_CTX_use_certificate_chain_file(fContext, CertFile) > 0; + {$ENDIF} + end; +end; + +function TIdSSLContext.LoadKey: Boolean; +begin + if PosInStrArray(ExtractFileExt(KeyFile), ['.p12', '.pfx'], False) <> -1 then begin + Result := IndySSL_CTX_use_PrivateKey_file_PKCS12(fContext, KeyFile) > 0; + end else begin + Result := IndySSL_CTX_use_PrivateKey_file(fContext, KeyFile, SSL_FILETYPE_PEM) > 0; + end; + if Result then begin + Result := SSL_CTX_check_private_key(fContext) > 0; + end; +end; + +function TIdSSLContext.LoadDHParams: Boolean; +begin + Result := IndySSL_CTX_use_DHparams_file(fContext, fsDHParamsFile, SSL_FILETYPE_PEM) > 0; +end; + +////////////////////////////////////////////////////////////// + +function TIdSSLContext.Clone: TIdSSLContext; +begin + Result := TIdSSLContext.Create; + Result.StatusInfoOn := StatusInfoOn; +// property PasswordRoutineOn: Boolean read fPasswordRoutineOn write fPasswordRoutineOn; + Result.VerifyOn := VerifyOn; + Result.Method := Method; + Result.SSLVersions := SSLVersions; + Result.Mode := Mode; + Result.RootCertFile := RootCertFile; + Result.CertFile := CertFile; + Result.KeyFile := KeyFile; + Result.VerifyMode := VerifyMode; + Result.VerifyDepth := VerifyDepth; +end; + +{ TIdSSLSocket } + +constructor TIdSSLSocket.Create(Parent: TObject); +begin + inherited Create; + fParent := Parent; +end; + +destructor TIdSSLSocket.Destroy; +begin + if fSession <> nil then + SSL_SESSION_free(fSession); + if fSSL <> nil then begin + // TODO: should this be moved to TIdSSLContext instead? Is this here + // just to make sure the SSL shutdown does not log any messages? + { + if (fSSLContext <> nil) and (fSSLContext.StatusInfoOn) and + (fSSLContext.fContext <> nil) then begin + SSL_CTX_set_info_callback(fSSLContext.fContext, nil); + end; + } + //SSL_set_shutdown(fSSL, SSL_SENT_SHUTDOWN); + SSL_shutdown(fSSL); + SSL_free(fSSL); + fSSL := nil; + end; + FreeAndNil(fSSLCipher); + FreeAndNil(fPeerCert); + inherited Destroy; +end; + +function TIdSSLSocket.GetSSLError(retCode: Integer): Integer; +begin + // COMMENT!!! + // I found out that SSL layer should not interpret errors, cause they will pop up + // on the socket layer. Only thing that the SSL layer should consider is key + // or protocol renegotiation. This is done by loop in read and write + Result := SSL_get_error(fSSL, retCode); + case Result of + SSL_ERROR_NONE: + Result := SSL_ERROR_NONE; + SSL_ERROR_WANT_WRITE: + Result := SSL_ERROR_WANT_WRITE; + SSL_ERROR_WANT_READ: + Result := SSL_ERROR_WANT_READ; + SSL_ERROR_ZERO_RETURN: + Result := SSL_ERROR_ZERO_RETURN; + //Result := SSL_ERROR_NONE; + { + // ssl layer has been disconnected, it is not necessary that also + // socked has been closed + case Mode of + sslemClient: begin + case Action of + sslWrite: begin + if retCode = 0 then begin + Result := 0; + end + else begin + raise EIdException.Create(RSOSSLConnectionDropped); // TODO: create a new Exception class for this + end; + end; + end; + end;} + + //raise EIdException.Create(RSOSSLConnectionDropped); // TODO: create a new Exception class for this + // X509_LOOKUP event is not really an error, just an event + // SSL_ERROR_WANT_X509_LOOKUP: + // raise EIdException.Create(RSOSSLCertificateLookup); // TODO: create a new Exception class for this + SSL_ERROR_SYSCALL: + Result := SSL_ERROR_SYSCALL; + // Result := SSL_ERROR_NONE; + + {//raise EIdException.Create(RSOSSLInternal); // TODO: create a new Exception class for this + if (retCode <> 0) or (DataLen <> 0) then begin + raise EIdException.Create(RSOSSLConnectionDropped); // TODO: create a new Exception class for this + end + else begin + Result := 0; + end;} + + SSL_ERROR_SSL: + // raise EIdException.Create(RSOSSLInternal); // TODO: create a new Exception class for this + Result := SSL_ERROR_SSL; + // Result := SSL_ERROR_NONE; + end; +end; + +procedure TIdSSLSocket.Accept(const pHandle: TIdStackSocketHandle); +//Accept and Connect have a lot of duplicated code +var + error: Integer; + StatusStr: String; + LParentIO: TIdSSLIOHandlerSocketOpenSSL; + LHelper: IIdSSLOpenSSLCallbackHelper; +begin + Assert(fSSL=nil); + Assert(fSSLContext<>nil); + fSSL := SSL_new(fSSLContext.fContext); + if fSSL = nil then begin + raise EIdOSSLCreatingSessionError.Create(RSSSLCreatingSessionError); + end; + error := SSL_set_app_data(fSSL, Self); + if error <= 0 then begin + EIdOSSLDataBindingError.RaiseException(fSSL, error, RSSSLDataBindingError); + end; + error := SSL_set_fd(fSSL, pHandle); + if error <= 0 then begin + EIdOSSLFDSetError.RaiseException(fSSL, error, RSSSLFDSetError); + end; + // RLebeau: if this socket's IOHandler was cloned, no need to reuse the + // original IOHandler's active session ID, since this is a server socket + // that generates its own sessions... + // + // RLebeau: is this actually true? Should we be reusing the original + // IOHandler's active session ID regardless of whether this is a client + // or server socket? What about FTP in non-passive mode, for example? + { + if (LParentIO <> nil) and (LParentIO.fSSLSocket <> nil) and + (LParentIO.fSSLSocket <> Self) then + begin + SSL_copy_session_id(fSSL, LParentIO.fSSLSocket.fSSL); + end; + } + error := SSL_accept(fSSL); + if error <= 0 then begin + EIdOSSLAcceptError.RaiseException(fSSL, error, RSSSLAcceptError); + end; + fSession := SSL_get1_session(fSSL); + if Supports(fParent, IIdSSLOpenSSLCallbackHelper, IInterface(LHelper)) then begin + LParentIO := LHelper.GetIOHandlerSelf; + if LParentIO <> nil then begin + StatusStr := 'Cipher: name = ' + Cipher.Name + '; ' + {Do not Localize} + 'description = ' + Cipher.Description + '; ' + {Do not Localize} + 'bits = ' + IntToStr(Cipher.Bits) + '; ' + {Do not Localize} + 'version = ' + Cipher.Version + '; '; {Do not Localize} + LParentIO.DoStatusInfo(StatusStr); + end; + LHelper := nil; + end; +end; + +procedure TIdSSLSocket.Connect(const pHandle: TIdStackSocketHandle); +var + error: Integer; + StatusStr: String; + LParentIO: TIdSSLIOHandlerSocketOpenSSL; + LHelper: IIdSSLOpenSSLCallbackHelper; +begin + Assert(fSSL=nil); + Assert(fSSLContext<>nil); + if Supports(fParent, IIdSSLOpenSSLCallbackHelper, IInterface(LHelper)) then begin + LParentIO := LHelper.GetIOHandlerSelf; + end else begin + LParentIO := nil; + end; + fSSL := SSL_new(fSSLContext.fContext); + if fSSL = nil then begin + raise EIdOSSLCreatingSessionError.Create(RSSSLCreatingSessionError); + end; + error := SSL_set_app_data(fSSL, Self); + if error <= 0 then begin + EIdOSSLDataBindingError.RaiseException(fSSL, error, RSSSLDataBindingError); + end; + error := SSL_set_fd(fSSL, pHandle); + if error <= 0 then begin + EIdOSSLFDSetError.RaiseException(fSSL, error, RSSSLFDSetError); + end; + // RLebeau: if this socket's IOHandler was cloned, reuse the + // original IOHandler's active session ID... + if (LParentIO <> nil) and (LParentIO.fSSLSocket <> nil) and + (LParentIO.fSSLSocket <> Self) then + begin + SSL_copy_session_id(fSSL, LParentIO.fSSLSocket.fSSL); + end; + {$IFNDEF OPENSSL_NO_TLSEXT} + {Delphi appears to need the extra AnsiString coerction. Otherwise, only the + first character to the hostname is passed} + error := SSL_set_tlsext_host_name(fSSL, PIdAnsiChar(AnsiString(fHostName))); + if error <= 0 then begin + // RLebeau: for the time being, not raising an exception on error, as I don't + // know which OpenSSL versions support this extension, and which error code(s) + // are safe to ignore on those versions... + //EIdOSSLSettingTLSHostNameError.RaiseException(fSSL, error, RSSSLSettingTLSHostNameError); + end; + {$ENDIF} + error := SSL_connect(fSSL); + if error <= 0 then begin + // TODO: if sslv23 is being used, but sslv23 is not being used on the + // remote side, SSL_connect() will fail. In that case, before giving up, + // try re-connecting using a version-specific method for each enabled + // version, maybe one will succeed... + EIdOSSLConnectError.RaiseException(fSSL, error, RSSSLConnectError); + end; + fSession := SSL_get1_session(fSSL); + // TODO: even if SSL_connect() returns success, the connection might + // still be insecure if SSL_connect() detected that certificate validation + // actually failed, but ignored it because SSL_VERIFY_PEER was disabled! + // It would report such a failure via SSL_get_verify_result() instead of + // returning an error code, so we should call SSL_get_verify_result() here + // to make sure... + if LParentIO <> nil then begin + StatusStr := 'Cipher: name = ' + Cipher.Name + '; ' + {Do not Localize} + 'description = ' + Cipher.Description + '; ' + {Do not Localize} + 'bits = ' + IntToStr(Cipher.Bits) + '; ' + {Do not Localize} + 'version = ' + Cipher.Version + '; '; {Do not Localize} + LParentIO.DoStatusInfo(StatusStr); + end; + // TODO: enable this + { + var + peercert: PX509; + lHostName: AnsiString; + peercert := SSL_get_peer_certificate(fSSL); + try + lHostName := AnsiString(fHostName); + if (X509_check_host(peercert, PByte(PAnsiChar(lHostName)), Length(lHostName), 0) != 1) and + (not certificate_host_name_override(peercert, PAnsiChar(lHostName)) then + begin + EIdOSSLCertificateError.RaiseException(fSSL, error, 'SSL certificate does not match host name'); + end; + finally + X509_free(peercert); + end; +} +end; + +function TIdSSLSocket.Recv(var ABuffer: TIdBytes): Integer; +var + ret, err: Integer; +begin + repeat + ret := SSL_read(fSSL, PByte(ABuffer), Length(ABuffer)); + if ret > 0 then begin + Result := ret; + Exit; + end; + err := GetSSLError(ret); + if (err = SSL_ERROR_WANT_READ) or (err = SSL_ERROR_WANT_WRITE) then begin + Continue; + end; + if err = SSL_ERROR_ZERO_RETURN then begin + Result := 0; + end else begin + Result := ret; + end; + Exit; + until False; +end; + +function TIdSSLSocket.Send(const ABuffer: TIdBytes; AOffset, ALength: Integer): Integer; +var + ret, err: Integer; +begin + Result := 0; + repeat + ret := SSL_write(fSSL, @ABuffer[AOffset], ALength); + if ret > 0 then begin + Inc(Result, ret); + Inc(AOffset, ret); + Dec(ALength, ret); + if ALength < 1 then begin + Exit; + end; + Continue; + end; + err := GetSSLError(ret); + if (err = SSL_ERROR_WANT_READ) or (err = SSL_ERROR_WANT_WRITE) then begin + Continue; + end; + if err = SSL_ERROR_ZERO_RETURN then begin + Result := 0; + end else begin + Result := ret; + end; + Exit; + until False; +end; + +function TIdSSLSocket.GetProtocolVersion: TIdSSLVersion; +begin + if fSession = nil then + Result := sslUnknown + else + case SSL_SESSION_get_protocol_version(fSession) of + SSL3_VERSION: + Result := sslvSSLv3; + TLS1_VERSION: + Result := sslvTLSv1; + TLS1_1_VERSION: + Result := sslvTLSv1_1; + TLS1_2_VERSION: + Result := sslvTLSv1_2; + TLS1_3_VERSION: + Result := sslvTLSv1_3; + else + Result := sslUnknown; + end; +end; + +function TIdSSLSocket.GetSSLProtocolVersionStr: string; +begin + case SSLProtocolVersion of + sslUnknown: + Result := 'Unknown'; + sslvSSLv2: + Result := 'SSLv2'; + sslvSSLv3: + Result := 'SSLv3'; + sslvTLSv1: + Result := 'TLS'; + sslvTLSv1_1: + Result := 'TLSv1.1'; + sslvTLSv1_2: + Result := 'TLSv1.2'; + sslvTLSv1_3: + Result := 'TLSv1.3'; + end; +end; + +function TIdSSLSocket.GetPeerCert: TIdX509; +var + LX509: PX509; +begin + if fPeerCert = nil then begin + LX509 := SSL_get_peer_certificate(fSSL); + if LX509 <> nil then begin + fPeerCert := TIdX509.Create(LX509, False); + end; + end; + Result := fPeerCert; +end; + +function TIdSSLSocket.GetSSLCipher: TIdSSLCipher; +begin + if (fSSLCipher = nil) and (fSSL<>nil) then begin + fSSLCipher := TIdSSLCipher.Create(Self); + end; + Result := fSSLCipher; +end; + +function TIdSSLSocket.GetSessionID: TIdSSLByteArray; +var + pSession: PSSL_SESSION; +begin + Result.Length := 0; + Result.Data := nil; + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + if Assigned(SSL_get_session) and Assigned(SSL_SESSION_get_id) then + {$ENDIF} + begin + if fSSL <> nil then begin + pSession := SSL_get_session(fSSL); + if pSession <> nil then begin + Result.Data := PByte(SSL_SESSION_get_id(pSession, @Result.Length)); + end; + end; + end; +end; + +function TIdSSLSocket.GetSessionIDAsString:String; +var + Data: TIdSSLByteArray; + i: TIdC_UINT; + LDataPtr: PByte; +begin + Result := ''; {Do not Localize} + Data := GetSessionID; + if Data.Length > 0 then begin + for i := 0 to Data.Length-1 do begin + // RLebeau: not all Delphi versions support indexed access using PByte + LDataPtr := Data.Data; + Inc(LDataPtr, I); + Result := Result + IndyFormat('%.2x', [LDataPtr^]);{do not localize} + end; + end; +end; + +procedure TIdSSLSocket.SetCipherList(CipherList: String); +//var +// tmpPStr: PAnsiChar; +begin +{ + fCipherList := CipherList; + fCipherList_Ch := True; + aCipherList := aCipherList+#0; + if hSSL <> nil then f_SSL_set_cipher_list(hSSL, @aCipherList[1]); +} +end; + + + +/////////////////////////////////////////////////////////////// +// TIdSSLCipher +/////////////////////////////////////////////////////////////// +constructor TIdSSLCipher.Create(AOwner: TIdSSLSocket); +begin + inherited Create; + FSSLSocket := AOwner; +end; + +destructor TIdSSLCipher.Destroy; +begin + inherited Destroy; +end; + +function TIdSSLCipher.GetDescription; +var + Buf: array[0..1024] of TIdAnsiChar; + LSSLCipher : PSSL_CIPHER; +begin + Result := ''; + LSSLCipher := SSL_get_current_cipher(FSSLSocket.fSSL); + if Assigned(LSSLCipher) then begin + Result := String(SSL_CIPHER_description(LSSLCipher, @Buf[0], SizeOf(Buf)-1)); + end; +end; + +function TIdSSLCipher.GetName:String; +var + LSSLCipher : PSSL_CIPHER; +begin + Result := ''; + LSSLCipher := SSL_get_current_cipher(FSSLSocket.fSSL); + if Assigned( LSSLCipher) then begin + Result := String(SSL_CIPHER_get_name(LSSLCipher)); + end; +end; + +function TIdSSLCipher.GetBits:TIdC_INT; +var + LSSLCipher : PSSL_CIPHER; +begin + Result := 0; + LSSLCipher := SSL_get_current_cipher(FSSLSocket.fSSL); + if Assigned(LSSLCipher) then begin + SSL_CIPHER_get_bits(LSSLCipher, Result); + end; +end; + +function TIdSSLCipher.GetVersion:String; +var + LSSLCipher : PSSL_CIPHER; +begin + Result := ''; + LSSLCipher := SSL_get_current_cipher(FSSLSocket.fSSL); + if Assigned(LSSLCipher) then begin + Result := String(SSL_CIPHER_get_version(LSSLCipher)); + end; +end; + + +{$I IdSymbolDeprecatedOff.inc} + +initialization + Assert(SSLIsLoaded=nil); + SSLIsLoaded := TIdThreadSafeBoolean.Create; + + {$I IdSymbolDeprecatedOff.inc} + RegisterSSL('OpenSSL','Indy Pit Crew', {do not localize} + 'Copyright '+Char(169)+' 1993 - 2014'#10#13 + {do not localize} + 'Chad Z. Hower (Kudzu) and the Indy Pit Crew. All rights reserved.', {do not localize} + 'Open SSL Support DLL Delphi and C++Builder interface', {do not localize} + 'http://www.indyproject.org/'#10#13 + {do not localize} + 'Original Author - Gregor Ibic', {do not localize} + TIdSSLIOHandlerSocketOpenSSL, + TIdServerIOHandlerSSLOpenSSL); + {$I IdSymbolDeprecatedOn.inc} + + TIdSSLIOHandlerSocketOpenSSL.RegisterIOHandler; +finalization + // TODO: TIdSSLIOHandlerSocketOpenSSL.UnregisterIOHandler; + UnLoadOpenSSLLibrary; + //free the lock last as unload makes calls that use it + FreeAndNil(SSLIsLoaded); +end. diff --git a/IdSSLOpenSSLConsts.pas b/IdSSLOpenSSLConsts.pas new file mode 100644 index 0000000..d267765 --- /dev/null +++ b/IdSSLOpenSSLConsts.pas @@ -0,0 +1,92 @@ +{******************************************************************************} +{ } +{ Indy (Internet Direct) - Internet Protocols Simplified } +{ } +{ https://www.indyproject.org/ } +{ https://gitter.im/IndySockets/Indy } +{ } +{******************************************************************************} +{ } +{ This file is part of the Indy (Internet Direct) project, and is offered } +{ under the dual-licensing agreement described on the Indy website. } +{ (https://www.indyproject.org/license/) } +{ } +{ Copyright: } +{ (c) 1993-2024, the Indy Pit Crew. All rights reserved. } +{ } +{******************************************************************************} +{ } +{ Contributers: } +{ Here could be your name } +{ } +{******************************************************************************} +unit IdSSLOpenSSLConsts; + +interface + +{$i IdCompilerDefines.inc} +{$i IdSSLOpenSSLDefines.inc} + + +const + {The default SSLLibraryPath is empty. You can override this by setting the + OPENSSL_LIBRARY_PATH environment variable to the absolute path of the location + of your openssl library.} + + OpenSSLLibraryPath = 'OPENSSL_LIBRARY_PATH'; {environment variable name} + {$IFNDEF OPENSSL_NO_MIN_VERSION} + min_supported_ssl_version = (((byte(1) shl 8) + byte(0)) shl 8) shl 8 + byte(0); {1.0.0} + {$ELSE} + min_supported_ssl_version = 0; + {$ENDIF} + CLibCryptoBase = 'libcrypto'; + CLibSSLBase = 'libssl'; + + {The following lists are used when trying to locate the libcrypto and libssl libraries. + Default sufficies can be replaced by setting the IOpenSSLLoader.GetSSLLibVersions property} + {$IFDEF OPENSSL_USE_STATIC_LIBRARY} + CLibCrypto = ''; + CLibSSL = ''; + {$LINKLIB ssl.a} + {$LINKLIB crypto.a} + {$ENDIF} + + {$IFDEF OPENSSL_USE_SHARED_LIBRARY} + {$IFDEF UNIX} + CLibCrypto = 'crypto'; + CLibSSL = 'ssl'; + {$ENDIF} + {$IFDEF WINDOWS} + {$IFDEF CPU64} + CLibCrypto = 'libcrypto-3-x64.dll'; + CLibSSL = 'libssl-3-x64.dll'; + {$ENDIF} + {$IFDEF CPU32} + CLibCrypto = 'libcrypto-3.dll'; + CLibSSL = 'libssl-3.dll'; + {$ENDIF} + {$ENDIF} + {$ENDIF} + + {$IFDEF UNIX} + DirListDelimiter = ':'; + LibSuffix = '.so'; + DefaultLibVersions = '.3:.1.1:.1.0.2:.1.0.0:.0.9.9:.0.9.8:.0.9.7:.0.9.6'; + {$ENDIF} + {$IFDEF WINDOWS} + DirListDelimiter = ';'; + LibSuffix = ''; + LegacyLibCrypto = 'libeay32'; + LegacyLibssl = 'ssleay32'; + + {$IFDEF CPU64} + DefaultLibVersions = '-3-x64;-1_1-x64;-1-x64;'; + {$ENDIF} + {$IFDEF CPU32} + DefaultLibVersions = '-3;-1_1;-1;'; + {$ENDIF} + {$ENDIF} + +implementation + +end. diff --git a/IdSSLOpenSSLDefines.inc b/IdSSLOpenSSLDefines.inc new file mode 100644 index 0000000..4c4d487 --- /dev/null +++ b/IdSSLOpenSSLDefines.inc @@ -0,0 +1,39 @@ +{ Three ways to link to the OpenSSL library are supported: + + 1. Dynamic linking at run time using calls to LoadLibrary and GetProcAddress. + This is the default and allows Indy to find the OpenSSL libraries and adjust + itself to suit the version found. Versions 1.0.2 to 3.x are currently supported. + + 2. Static loading of a shared library (.dll or .so). When your program is loaded + the loader searches for the shared library and links it to your program. Indy + can only support the 3.x OpenSSL libraries in this mode. + + 3. Statically linked to a static library at link time. Your program executable + includes the OpenSSL libraries which then do not have to be separately + installed on the target system. Supported only for the 3.x OpenSSL Libraries + and for the Free Pascal Compiler (FPC). Delphi does not support this link option. + + Link Option 2 is selected if your program or the IndyOpenSSL package is compiled with + the OPENSSL_USE_SHARED_LIBRARY defined symbol. It is also selected if + IdCompilierDefines.inc sets the STATICLOAD_OPENSSL defined symbol (e.g. for IOS). + + Link Option 3 is selected if your program or the IndyOpenSSL package is compiled with + the OPENSSL_USE_STATIC_LIBRARY defined symbol. + + } +{$IFDEF STATICLOAD_OPENSSL} +{$DEFINE OPENSSL_STATIC_LINK_MODEL} +{$UNDEF OPENSSL_USE_STATIC_LIBRARY} +{$ENDIF} +{$IFDEF OPENSSL_USE_SHARED_LIBRARY} +{$DEFINE OPENSSL_STATIC_LINK_MODEL} +{$ENDIF} +{$IFDEF OPENSSL_USE_STATIC_LIBRARY} +{$IFNDEF FPC} +{$message Error:OPENSSL_USE_STATIC_LIBRARY may only be used when compiling with the Free Pascal Compiler} +{$ELSE} +{$DEFINE OPENSSL_STATIC_LINK_MODEL} +{$ENDIF} +{$ENDIF} + + diff --git a/IdSSLOpenSSLExceptionHandlers.pas b/IdSSLOpenSSLExceptionHandlers.pas new file mode 100644 index 0000000..3b77957 --- /dev/null +++ b/IdSSLOpenSSLExceptionHandlers.pas @@ -0,0 +1,190 @@ +{******************************************************************************} +{ } +{ Indy (Internet Direct) - Internet Protocols Simplified } +{ } +{ https://www.indyproject.org/ } +{ https://gitter.im/IndySockets/Indy } +{ } +{******************************************************************************} +{ } +{ This file is part of the Indy (Internet Direct) project, and is offered } +{ under the dual-licensing agreement described on the Indy website. } +{ (https://www.indyproject.org/license/) } +{ } +{ Copyright: } +{ (c) 1993-2020, Chad Z. Hower and the Indy Pit Crew. All rights reserved. } +{ } +{******************************************************************************} +{ } +{ Originally written by: Fabian S. Biehn } +{ fbiehn@aagon.com (German & English) } +{ } +{ Contributers: } +{ Here could be your name } +{ } +{******************************************************************************} +unit IdSSLOpenSSLExceptionHandlers; + +{$I IdCompilerDefines.inc} + + +interface + +uses + Classes, SysUtils, IdException, IdCTypes; + +type +//moved from IdSSLOpenSSL so we can use these classes in other places + EIdOpenSSLError = class(EIdException); + TIdOpenSSLAPISSLError = class of EIdOpenSSLAPISSLError; + + EIdOpenSSLAPISSLError = class(EIdOpenSSLError) + protected + FErrorCode : TIdC_INT; + FRetCode : TIdC_INT; + public + class procedure RaiseException(ASSL: Pointer; const ARetCode : TIdC_INT; const AMsg : String = ''); + class procedure RaiseExceptionCode(const AErrCode, ARetCode : TIdC_INT; const AMsg : String = ''); + property ErrorCode : TIdC_INT read FErrorCode; + property RetCode : TIdC_INT read FRetCode; + end; + + TIdSSLOpenSSLAPICryptoError = class of EIdOpenSSLAPICryptoError; + EIdOpenSSLAPICryptoError = class(EIdOpenSSLError) + protected + FErrorCode : TIdC_ULONG; + public + class procedure RaiseExceptionCode(const AErrCode : TIdC_ULONG; const AMsg : String = ''); + class procedure RaiseException(const AMsg : String = ''); + property ErrorCode : TIdC_ULONG read FErrorCode; + end; + EIdOSSLUnderlyingCryptoError = class(EIdOpenSSLAPICryptoError); + + EIdDigestError = class(EIdOpenSSLAPICryptoError); + EIdDigestFinalEx = class(EIdDigestError); + EIdDigestInitEx = class(EIdDigestError); + EIdDigestUpdate = class(EIdDigestError); + + { EIdAPIFunctionNotPresent } + + EIdAPIFunctionNotPresent = class(EIdOpenSSLError) + public + class procedure RaiseException(const functionName: string); + end; + +implementation + +uses IdOpenSSLHeaders_err, IdGlobal, IdOpenSSLHeaders_ssl, + IdOpenSSLHeaders_ossl_typ, IdResourceStringsProtocols, + IdStack, IdResourceStringsOpenSSL; + +function GetErrorMessage(const AErr : TIdC_ULONG) : String; +{$IFDEF USE_INLINE} inline; {$ENDIF} +const + sMaxErrMsg = 160; +var + LErrMsg: array [0..sMaxErrMsg] of TIdAnsiChar; + {$IFDEF USE_MARSHALLED_PTRS} + LErrMsgPtr: TPtrWrapper; + {$ENDIF} +begin + {$IFDEF USE_MARSHALLED_PTRS} + LErrMsgPtr := TPtrWrapper.Create(@LErrMsg[0]); + {$ENDIF} + ERR_error_string_n(AErr, + {$IFDEF USE_MARSHALLED_PTRS} + LErrMsgPtr.ToPointer + {$ELSE} + LErrMsg + {$ENDIF}, sMaxErrMsg); + LErrMsg[sMaxErrMsg] := TIdAnsiChar(0); + {$IFDEF USE_MARSHALLED_PTRS} + Result := TMarshal.ReadStringAsAnsi(LErrMsgPtr); + {$ELSE} + Result := String(LErrMsg); + {$ENDIF} +end; + +{ EIdAPIFunctionNotPresent } + +class procedure EIdAPIFunctionNotPresent.RaiseException(const functionName: string); +begin + raise EIdAPIFunctionNotPresent.CreateFmt(ROSSLAPIFunctionNotPresent,[functionName]); +end; + +{ EIdOpenSSLAPICryptoError } +class procedure EIdOpenSSLAPICryptoError.RaiseException(const AMsg : String = ''); +begin + RaiseExceptionCode(ERR_get_error(), AMsg); +end; + +class procedure EIdOpenSSLAPICryptoError.RaiseExceptionCode( + const AErrCode: TIdC_ULONG; const AMsg: String); +var + LMsg: String; + LException : EIdOpenSSLAPICryptoError; +begin + if AMsg <> '' then begin + LMsg := AMsg + sLineBreak + String(GetErrorMessage(AErrCode)); + end else begin + LMsg := String(GetErrorMessage(AErrCode)); + end; + LException := Create(LMsg); + LException.FErrorCode := AErrCode; + raise LException; +end; + +{ EIdOpenSSLAPISSLError } + +class procedure EIdOpenSSLAPISSLError.RaiseException(ASSL: Pointer; const ARetCode: TIdC_INT; + const AMsg: String); +begin + RaiseExceptionCode(SSL_get_error(PSSL(ASSL), ARetCode), ARetCode, AMsg); +end; + +class procedure EIdOpenSSLAPISSLError.RaiseExceptionCode(const AErrCode, ARetCode: TIdC_INT; + const AMsg: String); +var + LErrQueue : TIdC_ULONG; + LException : EIdOpenSSLAPISSLError; + LErrStr : String; +begin + if AMsg <> '' then begin + LErrStr := AMsg + sLineBreak; + end else begin + LErrStr := ''; + end; + case AErrCode of + SSL_ERROR_SYSCALL : + begin + LErrQueue := ERR_get_error; + if LErrQueue <> 0 then begin + EIdOSSLUnderlyingCryptoError.RaiseExceptionCode(LErrQueue, AMsg); + end; + if ARetCode = 0 then begin + LException := Create(LErrStr + RSSSLEOFViolation); + LException.FErrorCode := AErrCode; + LException.FRetCode := ARetCode; + raise LException; + end; + {Note that if LErrQueue returns 0 and ARetCode = -1, there probably + is an error in the underlying socket so you should raise a socket error} + if ARetCode = -1 then begin + // TODO: catch the socket exception and re-raise it as the InnerException + // for an EIdOpenSSLAPISSLError exception... + GStack.RaiseLastSocketError; + end; + end; + SSL_ERROR_SSL : begin + EIdOSSLUnderlyingCryptoError.RaiseException(AMsg); + end + end; + // everything else... + LException := Create(LErrStr + String(GetErrorMessage(AErrCode))); + LException.FErrorCode := AErrCode; + LException.FRetCode := ARetCode; + raise LException; +end; + +end. + diff --git a/IdSSLOpenSSLFIPS.pas b/IdSSLOpenSSLFIPS.pas new file mode 100644 index 0000000..4eb811c --- /dev/null +++ b/IdSSLOpenSSLFIPS.pas @@ -0,0 +1,544 @@ +{******************************************************************************} +{ } +{ Indy (Internet Direct) - Internet Protocols Simplified } +{ } +{ https://www.indyproject.org/ } +{ https://gitter.im/IndySockets/Indy } +{ } +{******************************************************************************} +{ } +{ This file is part of the Indy (Internet Direct) project, and is offered } +{ under the dual-licensing agreement described on the Indy website. } +{ (https://www.indyproject.org/license/) } +{ } +{ Copyright: } +{ (c) 1993-2024, the Indy Pit Crew. All rights reserved. } +{ } +{******************************************************************************} +{ } +{ Contributers: } +{ Here could be your name } +{ } +{******************************************************************************} +unit IdSSLOpenSSLFIPS; + +{$i IdCompilerDefines.inc} +{$i IdSSLOpenSSLDefines.inc} + +interface + +uses + Classes; + +implementation + +uses + IdException, + IdGlobal, + IdCTypes, + IdFIPS, + IdSSLOpenSSLExceptionHandlers, + IdResourceStringsOpenSSL, + IdOpenSSLHeaders_evp, + IdOpenSSLHeaders_crypto, + IdOpenSSLHeaders_hmac, + IdOpenSSLHeaders_ossl_typ; + +function FIPS_mode_set(onoff : TIdC_INT) : TIdC_INT; {$IFDEF INLINE}inline;{$ENDIF} +begin + Result := 0; + {$IFDEF OPENSSL_FIPS} + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + if Assigned(IdOpenSSLHeaders_crypto.FIPS_mode_set) then + {$ENDIF} + begin + Result := IdOpenSSLHeaders_crypto.FIPS_mode_set(onoff); + end; + {$ENDIF} +end; + +function FIPS_mode() : TIdC_INT; {$IFDEF INLINE}inline;{$ENDIF} +begin + Result := 0; + {$IFDEF OPENSSL_FIPS} + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + if Assigned(IdOpenSSLHeaders_crypto.FIPS_mode) then + {$ENDIF} + begin + Result := IdOpenSSLHeaders_crypto.FIPS_mode; + end; + {$ENDIF} +end; + +//**************** FIPS Support backend ******************* + +function OpenSSLIsHashingIntfAvail : Boolean; +begin + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + Result := Assigned(EVP_DigestInit_ex) and + Assigned(EVP_DigestUpdate) and + Assigned(EVP_DigestFinal_ex) ; + {$ELSE} + Result := true; + {$ENDIF} +end; + +function OpenSSLGetFIPSMode : Boolean; +begin + Result := FIPS_mode <> 0; +end; + +function OpenSSLSetFIPSMode(const AMode : Boolean) : Boolean; +begin + //leave this empty as we may not be using something that supports FIPS + if AMode then begin + Result := FIPS_mode_set(1) = 1; + end else begin + Result := FIPS_mode_set(0) = 1; + end; +end; + +function OpenSSLGetDigestCtx( AInst : PEVP_MD) : TIdHashIntCtx; + {$IFDEF USE_INLINE} inline; {$ENDIF} +var LRet : Integer; +begin + Result := EVP_MD_CTX_new; + + LRet := EVP_DigestInit_ex(Result, AInst, nil); + if LRet <> 1 then begin + EIdDigestInitEx.RaiseException(RSOSSLEVPDigestExError); + end; +end; + +function OpenSSLIsMD2HashIntfAvail: Boolean; +begin + {$IFDEF OPENSSL_NO_MD2} + Result := False; + {$ELSE} + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + Result := Assigned(EVP_md2); + {$ELSE} + Result := true; + {$ENDIF} + {$ENDIF} +end; + +function OpenSSLGetMD2HashInst : TIdHashIntCtx; +{$IFNDEF OPENSSL_NO_MD2} +var + LRet : PEVP_MD; +{$ENDIF} +begin + {$IFDEF OPENSSL_NO_MD2} + Result := nil; + {$ELSE} + LRet := EVP_md2; + Result := OpenSSLGetDigestCtx(LRet); + {$ENDIF} +end; + +function OpenSSLIsMD4HashIntfAvail: Boolean; +begin + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + Result := Assigned(EVP_md4); + {$ELSE} + Result := true; + {$ENDIF} +end; + +function OpenSSLGetMD4HashInst : TIdHashIntCtx; +var + LRet : PEVP_MD; +begin + LRet := EVP_md4; + Result := OpenSSLGetDigestCtx(LRet); +end; + +function OpenSSLIsMD5HashIntfAvail: Boolean; +begin + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + Result := Assigned(EVP_md5); + {$ELSE} + Result := true; + {$ENDIF} +end; + +function OpenSSLGetMD5HashInst : TIdHashIntCtx; +var + LRet : PEVP_MD; +begin + LRet := EVP_md5; + Result := OpenSSLGetDigestCtx(LRet); +end; + +function OpenSSLIsSHA1HashIntfAvail: Boolean; +begin + {$IFDEF OPENSSL_NO_SHA} + Result := False; + {$ELSE} + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + Result := Assigned(EVP_sha1); + {$ELSE} + Result := true; + {$ENDIF} + {$ENDIF} +end; + +function OpenSSLGetSHA1HashInst : TIdHashIntCtx; +{$IFNDEF OPENSSL_NO_SHA} +var + LRet : PEVP_MD; +{$ENDIF} +begin + {$IFDEF OPENSSL_NO_SHA} + Result := nil; + {$ELSE} + LRet := EVP_sha1; + Result := OpenSSLGetDigestCtx(LRet); + {$ENDIF} +end; + +function OpenSSLIsSHA224HashIntfAvail: Boolean; +begin + {$IFDEF OPENSSL_NO_SHA256} + Result := False; + {$ELSE} + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + Result := Assigned(EVP_sha224); + {$ELSE} + Result := true; + {$ENDIF} + {$ENDIF} +end; + +function OpenSSLGetSHA224HashInst : TIdHashIntCtx; +{$IFNDEF OPENSSL_NO_SHA256} +var + LRet : PEVP_MD; +{$ENDIF} +begin + {$IFDEF OPENSSL_NO_SHA256} + Result := nil; + {$ELSE} + LRet := EVP_sha224; + Result := OpenSSLGetDigestCtx(LRet); + {$ENDIF} +end; + +function OpenSSLIsSHA256HashIntfAvail: Boolean; +begin + {$IFDEF OPENSSL_NO_SHA256} + Result := False; + {$ELSE} + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + Result := Assigned(EVP_sha256); + {$ELSE} + Result := true; + {$ENDIF} + {$ENDIF} +end; + +function OpenSSLGetSHA256HashInst : TIdHashIntCtx; +{$IFNDEF OPENSSL_NO_SHA256} +var + LRet : PEVP_MD; +{$ENDIF} +begin + {$IFDEF OPENSSL_NO_SHA256} + Result := nil; + {$ELSE} + LRet := EVP_sha256; + Result := OpenSSLGetDigestCtx(LRet); + {$ENDIF} +end; + +function OpenSSLIsSHA384HashIntfAvail: Boolean; +begin + {$IFDEF OPENSSL_NO_SHA512} + Result := False; + {$ELSE} + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + Result := Assigned(EVP_sha384); + {$ELSE} + {$ENDIF} + {$ENDIF} +end; + +function OpenSSLGetSHA384HashInst : TIdHashIntCtx; +{$IFNDEF OPENSSL_NO_SHA512} +var + LRet : PEVP_MD; +{$ENDIF} +begin + {$IFDEF OPENSSL_NO_SHA512} + Result := nil; + {$ELSE} + LRet := EVP_sha384; + Result := OpenSSLGetDigestCtx(LRet); + {$ENDIF} +end; + +function OpenSSLIsSHA512HashIntfAvail: Boolean; +begin + {$IFDEF OPENSSL_NO_SHA512} + Result := nil; + {$ELSE} + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + Result := Assigned(EVP_sha512); + {$ELSE} + Result := true; + {$ENDIF} + {$ENDIF} +end; + +function OpenSSLGetSHA512HashInst : TIdHashIntCtx; +{$IFNDEF OPENSSL_NO_SHA512} +var + LRet : PEVP_MD; +{$ENDIF} +begin + {$IFDEF OPENSSL_NO_SHA512} + Result := nil; + {$ELSE} + LRet := EVP_sha512; + Result := OpenSSLGetDigestCtx(LRet); +{$ENDIF} +end; + +procedure OpenSSLUpdateHashInst(ACtx: TIdHashIntCtx; const AIn: TIdBytes); +var + LRet : TIdC_Int; +begin + LRet := EVP_DigestUpdate(ACtx, PByte(Ain), Length(AIn)); + if LRet <> 1 then begin + EIdDigestInitEx.RaiseException(RSOSSLEVPDigestUpdateError); + end; +end; + +function OpenSSLFinalHashInst(ACtx: TIdHashIntCtx): TIdBytes; +var + LLen : TIdC_UInt; + LRet : TIdC_Int; +begin + SetLength(Result,EVP_MAX_MD_SIZE); + LRet := EVP_DigestFinal_ex(ACtx, PByte(@Result[0]), LLen); + if LRet <> 1 then begin + EIdDigestFinalEx.RaiseException('EVP_DigestFinal_ex error'); + end; + SetLength(Result,LLen); + EVP_MD_CTX_free(PEVP_MD_CTX(ACtx)); +end; + +function OpenSSLIsHMACAvail : Boolean; +begin + {$IFDEF OPENSSL_NO_HMAC} + Result := False; + {$ELSE} + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + Result := Assigned(HMAC_CTX_new) and + Assigned(HMAC_Init_ex) and + Assigned(HMAC_Update) and + Assigned(HMAC_Final) and + Assigned(HMAC_CTX_free); + {$ELSE} + Result := true; + {$ENDIF} + {$ENDIF} +end; + +function OpenSSLIsHMACMD5Avail: Boolean; +begin + {$IFDEF OPENSSL_NO_MD5} + Result := False; + {$ELSE} + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + Result := Assigned(EVP_md5); + {$ELSE} + Result := true; + {$ENDIF} + {$ENDIF} +end; + +function OpenSSLGetHMACMD5Inst(const AKey : TIdBytes) : TIdHMACIntCtx; +begin + {$IFDEF OPENSSL_NO_MD5} + Result := nil; + {$ELSE} + Result := HMAC_CTX_new; + HMAC_Init_ex(Result, PByte(AKey), Length(AKey), EVP_md5, nil); + {$ENDIF} +end; + +function OpenSSLIsHMACSHA1Avail: Boolean; +begin + {$IFDEF OPENSSL_NO_SHA} + Result := False; + {$ELSE} + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + Result := Assigned(EVP_sha1); + {$ELSE} + Result := true; + {$ENDIF} + {$ENDIF} +end; + +function OpenSSLGetHMACSHA1Inst(const AKey : TIdBytes) : TIdHMACIntCtx; +begin + {$IFDEF OPENSSL_NO_SHA} + Result := nil; + {$ELSE} + Result := HMAC_CTX_new; + HMAC_Init_ex(Result, PByte(AKey), Length(AKey), EVP_sha1, nil); + {$ENDIF} +end; + +function OpenSSLIsHMACSHA224Avail: Boolean; + +begin + {$IFDEF OPENSSL_NO_SHA256} + Result := False; + {$ELSE} + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + Result := Assigned(EVP_sha224); + {$ELSE} + Result := true; + {$ENDIF} + {$ENDIF} +end; + +function OpenSSLGetHMACSHA224Inst(const AKey : TIdBytes) : TIdHMACIntCtx; +begin + {$IFDEF OPENSSL_NO_SHA256} + Result := nil; + {$ELSE} + Result := HMAC_CTX_new; + HMAC_Init_ex(Result, PByte(AKey), Length(AKey), EVP_sha224, nil); + {$ENDIF} +end; + +function OpenSSLIsHMACSHA256Avail: Boolean; +begin + {$IFDEF OPENSSL_NO_SHA256} + Result := False; + {$ELSE} + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + Result := Assigned(EVP_sha256); + {$ELSE} + Result := true; + {$ENDIF} + {$ENDIF} +end; + +function OpenSSLGetHMACSHA256Inst(const AKey : TIdBytes) : TIdHMACIntCtx; +begin + {$IFDEF OPENSSL_NO_SHA256} + Result := nil; + {$ELSE} + Result := HMAC_CTX_new; + HMAC_Init_ex(Result, PByte(AKey), Length(AKey), EVP_sha256, nil); + {$ENDIF} +end; + +function OpenSSLIsHMACSHA384Avail: Boolean; +begin + {$IFDEF OPENSSL_NO_SHA512} + Result := False; + {$ELSE} + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + Result := Assigned(EVP_sha384); + {$ELSE} + Result := true; + {$ENDIF} + {$ENDIF} +end; + +function OpenSSLGetHMACSHA384Inst(const AKey : TIdBytes) : TIdHMACIntCtx; +begin + {$IFDEF OPENSSL_NO_SHA512} + Result := nil; + {$ELSE} + Result := HMAC_CTX_new; + HMAC_Init_ex(Result, PByte(AKey), Length(AKey), EVP_sha384, nil); + {$ENDIF} +end; + +function OpenSSLIsHMACSHA512Avail: Boolean; +begin + {$IFDEF OPENSSL_NO_SHA512} + Result := False; + {$ELSE} + {$IFNDEF OPENSSL_STATIC_LINK_MODEL} + Result := Assigned(EVP_sha512); + {$ELSE} + Result := true; + {$ENDIF} + {$ENDIF} +end; + +function OpenSSLGetHMACSHA512Inst(const AKey : TIdBytes) : TIdHMACIntCtx; +begin + {$IFDEF OPENSSL_NO_SHA512} + Result := nil; + {$ELSE} + Result := HMAC_CTX_new; + HMAC_Init_ex(Result, PByte(AKey), Length(AKey), EVP_sha512, nil); + {$ENDIF} +end; + +procedure OpenSSLUpdateHMACInst(ACtx : TIdHMACIntCtx; const AIn: TIdBytes); +begin + HMAC_Update(ACtx, PByte(AIn), Length(AIn)); +end; + +function OpenSSLFinalHMACInst(ACtx: TIdHMACIntCtx): TIdBytes; +var + LLen : TIdC_UInt; +begin + LLen := EVP_MAX_MD_SIZE; + SetLength(Result,LLen); + HMAC_Final(ACtx, PByte(@Result[0]), @LLen); + SetLength(Result,LLen); + HMAC_CTX_free(ACtx); +end; + +//**************************************************** + +initialization + SetFIPSMode := OpenSSLSetFIPSMode; + GetFIPSMode := OpenSSLGetFIPSMode; + IsHashingIntfAvail := OpenSSLIsHashingIntfAvail; + IsMD2HashIntfAvail := OpenSSLIsMD2HashIntfAvail; + GetMD2HashInst := OpenSSLGetMD2HashInst; + IsMD4HashIntfAvail := OpenSSLIsMD4HashIntfAvail; + GetMD4HashInst := OpenSSLGetMD4HashInst; + IsMD5HashIntfAvail := OpenSSLIsMD5HashIntfAvail; + GetMD5HashInst := OpenSSLGetMD5HashInst; + IsSHA1HashIntfAvail := OpenSSLIsSHA1HashIntfAvail; + GetSHA1HashInst := OpenSSLGetSHA1HashInst; + IsSHA224HashIntfAvail := OpenSSLIsSHA224HashIntfAvail; + GetSHA224HashInst := OpenSSLGetSHA224HashInst; + IsSHA256HashIntfAvail := OpenSSLIsSHA256HashIntfAvail; + GetSHA256HashInst := OpenSSLGetSHA256HashInst; + IsSHA384HashIntfAvail := OpenSSLIsSHA384HashIntfAvail; + GetSHA384HashInst := OpenSSLGetSHA384HashInst; + IsSHA512HashIntfAvail := OpenSSLIsSHA512HashIntfAvail; + GetSHA512HashInst := OpenSSLGetSHA512HashInst; + UpdateHashInst := OpenSSLUpdateHashInst; + FinalHashInst := OpenSSLFinalHashInst; + IsHMACAvail := OpenSSLIsHMACAvail; + IsHMACMD5Avail := OpenSSLIsHMACMD5Avail; + GetHMACMD5HashInst := OpenSSLGetHMACMD5Inst; + IsHMACSHA1Avail := OpenSSLIsHMACSHA1Avail; + GetHMACSHA1HashInst:= OpenSSLGetHMACSHA1Inst; + IsHMACSHA224Avail := OpenSSLIsHMACSHA224Avail; + GetHMACSHA224HashInst:= OpenSSLGetHMACSHA224Inst; + IsHMACSHA256Avail := OpenSSLIsHMACSHA256Avail; + GetHMACSHA256HashInst:= OpenSSLGetHMACSHA256Inst; + IsHMACSHA384Avail := OpenSSLIsHMACSHA384Avail; + GetHMACSHA384HashInst:= OpenSSLGetHMACSHA384Inst; + IsHMACSHA512Avail := OpenSSLIsHMACSHA512Avail; + GetHMACSHA512HashInst:= OpenSSLGetHMACSHA512Inst; + UpdateHMACInst := OpenSSLUpdateHMACInst; + FinalHMACInst := OpenSSLFinalHMACInst; +end. + diff --git a/IdSSLOpenSSLHeaders.pas b/IdSSLOpenSSLHeaders.pas index fbc8460..7b69698 100644 --- a/IdSSLOpenSSLHeaders.pas +++ b/IdSSLOpenSSLHeaders.pas @@ -1,26976 +1,26976 @@ -{ - This file is part of the Indy (Internet Direct) project, and is offered - under the dual-licensing agreement described on the Indy website. - (http://www.indyproject.org/) - - Copyright: - (c) 1993-2024, Chad Z. Hower and the Indy Pit Crew. All rights reserved. -} -unit IdSSLOpenSSLHeaders; - -{ - Author: Gregor Ibic (gregor.ibic@intelicom.si) - Copyright: (c) Gregor Ibic, Intelicom d.o.o and Indy Working Group. -} -{ -Note to self:: -===== Win32 with mingw32 ==== -Configuring for mingw - no-camellia [default] OPENSSL_NO_CAMELLIA (skip dir) - no-capieng [default] OPENSSL_NO_CAPIENG (skip dir) - no-cms [default] OPENSSL_NO_CMS (skip dir) - no-gmp [default] OPENSSL_NO_GMP (skip dir) - no-jpake [experimental] OPENSSL_NO_JPAKE (skip dir) - no-krb5 [krb5-flavor not specified] OPENSSL_NO_KRB5 - no-mdc2 [default] OPENSSL_NO_MDC2 (skip dir) - no-montasm [default] - no-rc5 [default] OPENSSL_NO_RC5 (skip dir) - no-rfc3779 [default] OPENSSL_NO_RFC3779 (skip dir) - no-seed [default] OPENSSL_NO_SEED (skip dir) - no-shared [default] - no-zlib [default] - no-zlib-dynamic [default] -IsMK1MF=1 -CC =gcc -CFLAG =-DOPENSSL_THREADS -DDSO_WIN32 -mno-cygwin -DL_ENDIAN -fomit-frame-pointer -O3 -march=i486 -Wall -D_WIN32_WINNT=0x333 -DOPENSSL_BN_ASM_PART_WORDS -DOPENSSL_IA32_SSE2 -DSHA1_ASM -DMD5_ASM -DRMD160_ASM -DAES_ASM -EX_LIBS =-lwsock32 -lgdi32 -CPUID_OBJ =x86cpuid-cof.o -BN_ASM =bn86-cof.o co86-cof.o -DES_ENC =dx86-cof.o yx86-cof.o -AES_ASM_OBJ =ax86-cof.o -BF_ENC =bx86-cof.o -CAST_ENC =cx86-cof.o -RC4_ENC =rx86-cof.o rc4_skey.o -RC5_ENC =r586-cof.o -MD5_OBJ_ASM =mx86-cof.o -SHA1_OBJ_ASM =sx86-cof.o s512sse2-cof.o -RMD160_OBJ_ASM=rm86-cof.o -PROCESSOR = -RANLIB =true -ARFLAGS = -PERL =perl -THIRTY_TWO_BIT mode -DES_PTR used -DES_RISC1 used -DES_UNROLL used -BN_LLONG mode -RC4_INDEX mode -RC4_CHUNK is undefined - -Configured for mingw. -Generating x86 for GNU assember -Bignum -DES -crypt -Blowfish -CAST5 -RC4 -MD5 -SHA1 -RIPEMD160 -RC5\32 -CPUID -Generating makefile -Generating DLL definition files -Building the libraries -Building OpenSSL -===== Win64 ====== -Targeting Windows Server 2003 X64 RETAIL - -perl Configure VC-WIN64A - -W:\openssl\openssl-0.9.8k>perl Configure VC-WIN64A -Configuring for VC-WIN64A - no-camellia [default] OPENSSL_NO_CAMELLIA (skip dir) - no-capieng [default] OPENSSL_NO_CAPIENG (skip dir) - no-cms [default] OPENSSL_NO_CMS (skip dir) - no-gmp [default] OPENSSL_NO_GMP (skip dir) - no-jpake [experimental] OPENSSL_NO_JPAKE (skip dir) - no-krb5 [krb5-flavor not specified] OPENSSL_NO_KRB5 - no-mdc2 [default] OPENSSL_NO_MDC2 (skip dir) - no-montasm [default] - no-rc5 [default] OPENSSL_NO_RC5 (skip dir) - no-rfc3779 [default] OPENSSL_NO_RFC3779 (skip dir) - no-seed [default] OPENSSL_NO_SEED (skip dir) - no-shared [default] - no-zlib [default] - no-zlib-dynamic [default] -IsMK1MF=1 -CC =cl -CFLAG =-DOPENSSL_THREADS -DDSO_WIN32 -EX_LIBS = -CPUID_OBJ = -BN_ASM =bn_asm.o -DES_ENC =des_enc.o fcrypt_b.o -AES_ASM_OBJ =aes_core.o aes_cbc.o -BF_ENC =bf_enc.o -CAST_ENC =c_enc.o -RC4_ENC =rc4_enc.o rc4_skey.o -RC5_ENC =rc5_enc.o -MD5_OBJ_ASM = -SHA1_OBJ_ASM = -RMD160_OBJ_ASM= -PROCESSOR = -RANLIB =true -ARFLAGS = -PERL =perl -SIXTY_FOUR_BIT mode -DES_INT used -RC4_CHUNK is unsigned long long - -Configured for VC-WIN64A. - -W:\openssl\openssl-0.9.8k>ms\do_win64a - -W:\openssl\openssl-0.9.8k>perl util\mkfiles.pl 1>MINFO - -W:\openssl\openssl-0.9.8k>perl ms\uplink.pl win64a 1>ms\uptable.asm - -W:\openssl\openssl-0.9.8k>ml64 -c -Foms\uptable.obj ms\uptable.asm -Microsoft (R) Macro Assembler (AMD64) Version 8.00.40310.39 -Copyright (C) Microsoft Corporation. All rights reserved. - - Assembling: ms\uptable.asm - -W:\openssl\openssl-0.9.8k>perl util\mk1mf.pl no-asm VC-WIN64A 1>ms\nt.mak - -W:\openssl\openssl-0.9.8k>perl util\mk1mf.pl dll no-asm VC-WIN64A 1>ms\ntdll.ma -k - -W:\openssl\openssl-0.9.8k>perl util\mkdef.pl 32 libeay 1>ms\libeay32.def - -W:\openssl\openssl-0.9.8k>perl util\mkdef.pl 32 ssleay 1>ms\ssleay32.def - -CFLAG= /MD /Ox /W3 /Gs0 /GF /Gy /nologo --DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DDSO_WIN32 -DOPENSSL_SYSNAME_WIN32 --DOPENSSL_SYSNAME_WINNT -DUNICODE -D_UNICODE -D_CRT_SECURE_NO_DEPRECATE --D_CRT_NONSTDC_NO_DEPRECATE -DOPENSSL_USE_APPLINK -I. /Fdout32dll --DOPENSSL_NO_CAMELLIA -DOPENSSL_NO_SEED -DOPENSSL_NO_RC5 -DOPENSSL_NO_MDC2 --DOPENSSL_NO_CMS -DOPENSSL_NO_JPAKE -DOPENSSL_NO_CAPIENG -DOPENSSL_NO_KRB5 --DOPENSSL_NO_DYNAMIC_ENGINE - -} - -interface - -{$I IdCompilerDefines.inc} - -{$WRITEABLECONST OFF} - -{$IFNDEF FPC} - {$IFDEF WIN32} - {$ALIGN OFF} - {$ENDIF} - {$IFDEF WIN64} - {$ALIGN ON} - {$ENDIF} - {$IFNDEF WIN32_OR_WIN64} - {$IFNDEF VCL_CROSS_COMPILE} - {$message error error alignment!} - {$ENDIF} - {$ENDIF} -{$ELSE} - {$packrecords C} -{$ENDIF} - -//THe OpenSSL developers use a IF 0 and an IF 1 convention for selectively -//enabling or disabling things. -{$DEFINE USE_THIS} -{.$DEFINE OMIT_THIS} -{ -IMPORTANT!!!! - -A lot of IFDEF's and defines have to used because OpenSSL has a number of options' -and those can effect the API. The options are determined by a "configure" script -that generates apporpriate make files with the appropriate defines. If you do -custom compiles of OpenSSL or if it's compiled differently that what I assume, -you will need to add or deactivate the defines. - -my $x86_gcc_des="DES_PTR DES_RISC1 DES_UNROLL"; - -# MD2_CHAR slags pentium pros -my $x86_gcc_opts="RC4_INDEX MD2_INT"; -... -# This is what $depflags will look like with the above defaults -# (we need this to see if we should advise the user to run "make depend"): -my $default_depflags = " -DOPENSSL_NO_CAMELLIA -DOPENSSL_NO_CAPIENG -DOPENSSL_NO_CMS -DOPENSSL_NO_GMP -DOPENSSL_NO_JPAKE -DOPENSSL_NO_MDC2 -DOPENSSL_NO_RC5 -DOPENSSL_NO_RFC3779 -DOPENSSL_NO_SEED"; - -} - -// # Our development configs -// "purify", "purify gcc:-g -DPURIFY -Wall::(unknown)::-lsocket -lnsl::::", -// "debug", "gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DOPENSSL_NO_ASM -ggdb -g2 -Wformat -Wshadow -Wmissing-prototypes -Wmissing-declarations -Werror::(unknown)::-lefence::::", -// "debug-ben", "gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DPEDANTIC -DDEBUG_SAFESTACK -O2 -pedantic -Wall -Wshadow -Werror -pipe::(unknown):::::bn86-elf.o co86-elf.o", -// "debug-ben-openbsd","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DPEDANTIC -DDEBUG_SAFESTACK -DOPENSSL_OPENBSD_DEV_CRYPTO -DOPENSSL_NO_ASM -O2 -pedantic -Wall -Wshadow -Werror -pipe::(unknown)::::", -// "debug-ben-openbsd-debug","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DPEDANTIC -DDEBUG_SAFESTACK -DOPENSSL_OPENBSD_DEV_CRYPTO -DOPENSSL_NO_ASM -g3 -O2 -pedantic -Wall -Wshadow -Werror -pipe::(unknown)::::", -// "debug-ben-debug", "gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DPEDANTIC -DDEBUG_SAFESTACK -g3 -O2 -pedantic -Wall -Wshadow -Werror -pipe::(unknown)::::::", -// "debug-ben-strict", "gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DCONST_STRICT -O2 -Wall -Wshadow -Werror -Wpointer-arith -Wcast-qual -Wwrite-strings -pipe::(unknown)::::::", -// "debug-rse","cc:-DTERMIOS -DL_ENDIAN -pipe -O -g -ggdb3 -Wall::(unknown):::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}", -// "debug-bodo", "gcc:-DL_ENDIAN -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBIO_PAIR_DEBUG -DPEDANTIC -g -march=i486 -pedantic -Wshadow -Wall -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe::-D_REENTRANT:::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}", -// "debug-ulf", "gcc:-DTERMIOS -DL_ENDIAN -march=i486 -Wall -DBN_DEBUG -DBN_DEBUG_RAND -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DOPENSSL_NO_ASM -g -Wformat -Wshadow -Wmissing-prototypes -Wmissing-declarations:::CYGWIN32:::${no_asm}:win32:cygwin-shared:::.dll", -// "debug-steve64", "gcc:-m64 -DL_ENDIAN -DTERMIO -DREF_CHECK -DCONF_DEBUG -DDEBUG_SAFESTACK -DCRYPTO_MDEBUG_ALL -DPEDANTIC -DOPENSSL_NO_DEPRECATED -g -pedantic -Wall -Werror -Wno-long-long -Wsign-compare -DMD32_REG_T=int::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK BF_PTR2 DES_INT DES_UNROLL:${x86_64_asm}:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", -// "debug-steve32", "gcc:-m32 -DL_ENDIAN -DREF_CHECK -DCONF_DEBUG -DDEBUG_SAFESTACK -DCRYPTO_MDEBUG_ALL -DPEDANTIC -DOPENSSL_NO_DEPRECATED -g -pedantic -Wno-long-long -Wall -Werror -Wshadow -pipe::-D_REENTRANT::-rdynamic -ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC:-m32:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", -// "debug-steve", "gcc:-DL_ENDIAN -DREF_CHECK -DCONF_DEBUG -DDEBUG_SAFESTACK -DCRYPTO_MDEBUG_ALL -DPEDANTIC -m32 -g -pedantic -Wno-long-long -Wall -Werror -Wshadow -pipe::-D_REENTRANT::-rdynamic -ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared", -// "debug-steve-opt", "gcc:-DL_ENDIAN -DREF_CHECK -DCONF_DEBUG -DDEBUG_SAFESTACK -DCRYPTO_MDEBUG_ALL -DPEDANTIC -m32 -O3 -g -pedantic -Wno-long-long -Wall -Werror -Wshadow -pipe::-D_REENTRANT::-rdynamic -ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared", -// "debug-steve-linux-pseudo64", "gcc:-DL_ENDIAN -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DDEBUG_SAFESTACK -DCRYPTO_MDEBUG_ALL -DOPENSSL_NO_ASM -g -mcpu=i486 -Wall -Werror -Wshadow -pipe::-D_REENTRANT::-rdynamic -ldl:SIXTY_FOUR_BIT:${no_asm}:dlfcn:linux-shared", -// "debug-levitte-linux-elf","gcc:-DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -DPEDANTIC -ggdb -g3 -mcpu=i486 -pedantic -ansi -Wall -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", -// "debug-levitte-linux-noasm","gcc:-DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DOPENSSL_NO_ASM -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -DPEDANTIC -ggdb -g3 -mcpu=i486 -pedantic -ansi -Wall -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", -// "debug-levitte-linux-elf-extreme","gcc:-DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -DPEDANTIC -ggdb -g3 -mcpu=i486 -pedantic -ansi -Wall -W -Wundef -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", -// "debug-levitte-linux-noasm-extreme","gcc:-DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DOPENSSL_NO_ASM -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -DPEDANTIC -ggdb -g3 -mcpu=i486 -pedantic -ansi -Wall -W -Wundef -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", -// "debug-geoff","gcc:-DBN_DEBUG -DBN_DEBUG_RAND -DBN_STRICT -DPURIFY -DOPENSSL_NO_DEPRECATED -DOPENSSL_NO_ASM -DOPENSSL_NO_INLINE_ASM -DL_ENDIAN -DTERMIO -DPEDANTIC -O1 -ggdb2 -Wall -Werror -Wundef -pedantic -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-align -Wsign-compare -Wmissing-prototypes -Wmissing-declarations -Wno-long-long::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", -// "debug-linux-pentium","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -DTERMIO -g -mcpu=pentium -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn", -// "debug-linux-ppro","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -DTERMIO -g -mcpu=pentiumpro -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn", -// "debug-linux-elf","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -DTERMIO -g -march=i486 -Wall::-D_REENTRANT::-lefence -ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", -// "debug-linux-elf-noefence","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -DTERMIO -g -march=i486 -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", -// "dist", "cc:-O::(unknown)::::::", - -// # Basic configs that should work on any (32 and less bit) box -// "gcc", "gcc:-O3::(unknown):::BN_LLONG:::", -// "cc", "cc:-O::(unknown)::::::", - -// ####VOS Configurations -// "vos-gcc","gcc:-O3 -Wall -D_POSIX_C_SOURCE=200112L -D_BSD -DB_ENDIAN::(unknown):VOS:-Wl,-map:BN_LLONG:${no_asm}:::::.so:", -// "debug-vos-gcc","gcc:-O0 -g -Wall -D_POSIX_C_SOURCE=200112L -D_BSD -DB_ENDIAN -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG::(unknown):VOS:-Wl,-map:BN_LLONG:${no_asm}:::::.so:", - -// #### Solaris x86 with GNU C setups -// # -DOPENSSL_NO_INLINE_ASM switches off inline assembler. We have to do it -// # here because whenever GNU C instantiates an assembler template it -// # surrounds it with #APP #NO_APP comment pair which (at least Solaris -// # 7_x86) /usr/ccs/bin/as fails to assemble with "Illegal mnemonic" -// # error message. -// "solaris-x86-gcc","gcc:-O3 -fomit-frame-pointer -march=pentium -Wall -DL_ENDIAN -DOPENSSL_NO_INLINE_ASM::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:solaris-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", -// # -shared -static-libgcc might appear controversial, but modules taken -// # from static libgcc do not have relocations and linking them into our -// # shared objects doesn't have any negative side-effects. On the contrary, -// # doing so makes it possible to use gcc shared build with Sun C. Given -// # that gcc generates faster code [thanks to inline assembler], I would -// # actually recommend to consider using gcc shared build even with vendor -// # compiler:-) -// # -// "solaris64-x86_64-gcc","gcc:-m64 -O3 -Wall -DL_ENDIAN -DMD32_REG_T=int::-D_REENTRANT::-lsocket -lnsl -ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK BF_PTR2 DES_INT DES_UNROLL:${x86_64_asm}:dlfcn:solaris-shared:-fPIC:-m64 -shared -static-libgcc:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", -// -// #### Solaris x86 with Sun C setups -// "solaris-x86-cc","cc:-fast -O -Xa::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_UNROLL BF_PTR:${no_asm}:dlfcn:solaris-shared:-KPIC:-G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", -// "solaris64-x86_64-cc","cc:-fast -xarch=amd64 -xstrconst -Xa -DL_ENDIAN::-D_REENTRANT::-lsocket -lnsl -ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK BF_PTR2 DES_INT DES_UNROLL:${x86_64_asm}:dlfcn:solaris-shared:-KPIC:-xarch=amd64 -G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", - -// #### SPARC Solaris with GNU C setups -// "solaris-sparcv7-gcc","gcc:-O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${no_asm}:dlfcn:solaris-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", -// "solaris-sparcv8-gcc","gcc:-mv8 -O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::sparcv8.o:des_enc-sparc.o fcrypt_b.o:::::::::dlfcn:solaris-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", -// # -m32 should be safe to add as long as driver recognizes -mcpu=ultrasparc -// "solaris-sparcv9-gcc","gcc:-m32 -mcpu=ultrasparc -O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::sparcv8plus.o:des_enc-sparc.o fcrypt_b.o:::::::::dlfcn:solaris-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", -// "solaris64-sparcv9-gcc","gcc:-m64 -mcpu=ultrasparc -O3 -Wall -DB_ENDIAN::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL BF_PTR:::des_enc-sparc.o fcrypt_b.o:::::::::dlfcn:solaris-shared:-fPIC:-m64 -shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", -// #### -// "debug-solaris-sparcv8-gcc","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG_ALL -O -g -mv8 -Wall -DB_ENDIAN::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::sparcv8.o::::::::::dlfcn:solaris-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", -// "debug-solaris-sparcv9-gcc","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG_ALL -DPEDANTIC -O -g -mcpu=ultrasparc -pedantic -ansi -Wall -Wshadow -Wno-long-long -D__EXTENSIONS__ -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::sparcv8plus.o:des_enc-sparc.o fcrypt_b.o:::::::::dlfcn:solaris-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", - -// #### SPARC Solaris with Sun C setups -// # SC4.0 doesn't pass 'make test', upgrade to SC5.0 or SC4.2. -// # SC4.2 is ok, better than gcc even on bn as long as you tell it -xarch=v8 -// # SC5.0 note: Compiler common patch 107357-01 or later is required! -// "solaris-sparcv7-cc","cc:-xO5 -xstrconst -xdepend -Xa -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_RISC1 DES_UNROLL BF_PTR:${no_asm}:dlfcn:solaris-shared:-KPIC:-G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", -// "solaris-sparcv8-cc","cc:-xarch=v8 -xO5 -xstrconst -xdepend -Xa -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_RISC1 DES_UNROLL BF_PTR::sparcv8.o:des_enc-sparc.o fcrypt_b.o:::::::::dlfcn:solaris-shared:-KPIC:-G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", -// "solaris-sparcv9-cc","cc:-xtarget=ultra -xarch=v8plus -xO5 -xstrconst -xdepend -Xa -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK_LL DES_PTR DES_RISC1 DES_UNROLL BF_PTR::sparcv8plus.o:des_enc-sparc.o fcrypt_b.o:::::::::dlfcn:solaris-shared:-KPIC:-G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", -// "solaris64-sparcv9-cc","cc:-xtarget=ultra -xarch=v9 -xO5 -xstrconst -xdepend -Xa -DB_ENDIAN::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL BF_PTR:::des_enc-sparc.o fcrypt_b.o:::::::::dlfcn:solaris-shared:-KPIC:-xarch=v9 -G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):/usr/ccs/bin/ar rs", -// #### -// "debug-solaris-sparcv8-cc","cc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG_ALL -xarch=v8 -g -O -xstrconst -Xa -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_RISC1 DES_UNROLL BF_PTR::sparcv8.o::::::::::dlfcn:solaris-shared:-KPIC:-G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", -// "debug-solaris-sparcv9-cc","cc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG_ALL -xtarget=ultra -xarch=v8plus -g -O -xstrconst -Xa -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK_LL DES_PTR DES_RISC1 DES_UNROLL BF_PTR::sparcv8plus.o::::::::::dlfcn:solaris-shared:-KPIC:-G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", - -// #### SunOS configs, assuming sparc for the gcc one. -// #"sunos-cc", "cc:-O4 -DNOPROTO -DNOCONST::(unknown):SUNOS::DES_UNROLL:${no_asm}::", -// "sunos-gcc","gcc:-O3 -mv8 -Dssize_t=int::(unknown):SUNOS::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL DES_PTR DES_RISC1:${no_asm}::", - -// #### IRIX 5.x configs -// # -mips2 flag is added by ./config when appropriate. -// "irix-gcc","gcc:-O3 -DTERMIOS -DB_ENDIAN::(unknown):::BN_LLONG MD2_CHAR RC4_INDEX RC4_CHAR RC4_CHUNK DES_UNROLL DES_RISC2 DES_PTR BF_PTR:${no_asm}:dlfcn:irix-shared:::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", -// "irix-cc", "cc:-O2 -use_readonly_const -DTERMIOS -DB_ENDIAN::(unknown):::BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_RISC2 DES_UNROLL BF_PTR:${no_asm}:dlfcn:irix-shared:::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", -// #### IRIX 6.x configs -// # Only N32 and N64 ABIs are supported. If you need O32 ABI build, invoke -// # './Configure irix-cc -o32' manually. -// "irix-mips3-gcc","gcc:-mabi=n32 -O3 -DTERMIOS -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE:::MD2_CHAR RC4_INDEX RC4_CHAR RC4_CHUNK_LL DES_UNROLL DES_RISC2 DES_PTR BF_PTR SIXTY_FOUR_BIT::bn-mips3.o::::::::::dlfcn:irix-shared::-mabi=n32:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", -// "irix-mips3-cc", "cc:-n32 -mips3 -O2 -use_readonly_const -G0 -rdata_shared -DTERMIOS -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE:::DES_PTR RC4_CHAR RC4_CHUNK_LL DES_RISC2 DES_UNROLL BF_PTR SIXTY_FOUR_BIT::bn-mips3.o::::::::::dlfcn:irix-shared::-n32:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", -// # N64 ABI builds. -// "irix64-mips4-gcc","gcc:-mabi=64 -mips4 -O3 -DTERMIOS -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE:::RC4_CHAR RC4_CHUNK DES_RISC2 DES_UNROLL SIXTY_FOUR_BIT_LONG::bn-mips3.o::::::::::dlfcn:irix-shared::-mabi=64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", -// "irix64-mips4-cc", "cc:-64 -mips4 -O2 -use_readonly_const -G0 -rdata_shared -DTERMIOS -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE:::RC4_CHAR RC4_CHUNK DES_RISC2 DES_UNROLL SIXTY_FOUR_BIT_LONG::bn-mips3.o::::::::::dlfcn:irix-shared::-64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", - -// #### Unified HP-UX ANSI C configs. -// # Special notes: -// # - Originally we were optimizing at +O4 level. It should be noted -// # that the only difference between +O3 and +O4 is global inter- -// # procedural analysis. As it has to be performed during the link -// # stage the compiler leaves behind certain pseudo-code in lib*.a -// # which might be release or even patch level specific. Generating -// # the machine code for and analyzing the *whole* program appears -// # to be *extremely* memory demanding while the performance gain is -// # actually questionable. The situation is intensified by the default -// # HP-UX data set size limit (infamous 'maxdsiz' tunable) of 64MB -// # which is way too low for +O4. In other words, doesn't +O3 make -// # more sense? -// # - Keep in mind that the HP compiler by default generates code -// # suitable for execution on the host you're currently compiling at. -// # If the toolkit is ment to be used on various PA-RISC processors -// # consider './config +DAportable'. -// # - +DD64 is chosen in favour of +DA2.0W because it's meant to be -// # compatible with *future* releases. -// # - If you run ./Configure hpux-parisc-[g]cc manually don't forget to -// # pass -D_REENTRANT on HP-UX 10 and later. -// # - -DMD32_XARRAY triggers workaround for compiler bug we ran into in -// # 32-bit message digests. (For the moment of this writing) HP C -// # doesn't seem to "digest" too many local variables (they make "him" -// # chew forever:-). For more details look-up MD32_XARRAY comment in -// # crypto/sha/sha_lcl.h. -// # -// # -// # Since there is mention of this in shlib/hpux10-cc.sh -// "hpux-parisc-cc-o4","cc:-Ae +O4 +ESlit -z -DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY::-D_REENTRANT::-ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1:${no_asm}:dl:hpux-shared:+Z:-b:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", -// "hpux-parisc-gcc","gcc:-O3 -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-Wl,+s -ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1:${no_asm}:dl:hpux-shared:-fPIC:-shared:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", -// "hpux-parisc2-gcc","gcc:-march=2.0 -O3 -DB_ENDIAN -D_REENTRANT::::-Wl,+s -ldld:SIXTY_FOUR_BIT RC4_CHAR RC4_CHUNK DES_PTR DES_UNROLL DES_RISC1::pa-risc2.o::::::::::dl:hpux-shared:-fPIC:-shared:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", -// "hpux64-parisc2-gcc","gcc:-O3 -DB_ENDIAN -D_REENTRANT::::-ldl:SIXTY_FOUR_BIT_LONG MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT::pa-risc2W.o::::::::::dlfcn:hpux-shared:-fpic:-shared:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", - -// # More attempts at unified 10.X and 11.X targets for HP C compiler. -// # -// # Chris Ruemmler -// # Kevin Steves -// "hpux-parisc-cc","cc:+O3 +Optrs_strongly_typed -Ae +ESlit -DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY::-D_REENTRANT::-Wl,+s -ldld:MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT:${no_asm}:dl:hpux-shared:+Z:-b:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", -// "hpux-parisc1_0-cc","cc:+DAportable +O3 +Optrs_strongly_typed -Ae +ESlit -DB_ENDIAN -DMD32_XARRAY::-D_REENTRANT::-Wl,+s -ldld:MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT:${no_asm}:dl:hpux-shared:+Z:-b:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", -// "hpux-parisc2-cc","cc:+DA2.0 +DS2.0 +O3 +Optrs_strongly_typed -Ae +ESlit -DB_ENDIAN -DMD32_XARRAY -D_REENTRANT::::-Wl,+s -ldld:SIXTY_FOUR_BIT MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT::pa-risc2.o::::::::::dl:hpux-shared:+Z:-b:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", -// "hpux64-parisc2-cc","cc:+DD64 +O3 +Optrs_strongly_typed -Ae +ESlit -DB_ENDIAN -DMD32_XARRAY -D_REENTRANT::::-ldl:SIXTY_FOUR_BIT_LONG MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT::pa-risc2W.o::::::::::dlfcn:hpux-shared:+Z:+DD64 -b:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", - -// # HP/UX IA-64 targets -// "hpux-ia64-cc","cc:-Ae +DD32 +O2 +Olit=all -z -DB_ENDIAN -D_REENTRANT::::-ldl:SIXTY_FOUR_BIT MD2_CHAR RC4_INDEX DES_UNROLL DES_RISC1 DES_INT:${ia64_asm}:dlfcn:hpux-shared:+Z:+DD32 -b:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", -// # Frank Geurts has patiently assisted with -// # with debugging of the following config. -// "hpux64-ia64-cc","cc:-Ae +DD64 +O3 +Olit=all -z -DB_ENDIAN -D_REENTRANT::::-ldl:SIXTY_FOUR_BIT_LONG MD2_CHAR RC4_INDEX DES_UNROLL DES_RISC1 DES_INT:${ia64_asm}:dlfcn:hpux-shared:+Z:+DD64 -b:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", -// # GCC builds... -// "hpux-ia64-gcc","gcc:-O3 -DB_ENDIAN -D_REENTRANT::::-ldl:SIXTY_FOUR_BIT MD2_CHAR RC4_INDEX DES_UNROLL DES_RISC1 DES_INT:${ia64_asm}:dlfcn:hpux-shared:-fpic:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", -// "hpux64-ia64-gcc","gcc:-mlp64 -O3 -DB_ENDIAN -D_REENTRANT::::-ldl:SIXTY_FOUR_BIT_LONG MD2_CHAR RC4_INDEX DES_UNROLL DES_RISC1 DES_INT:${ia64_asm}:dlfcn:hpux-shared:-fpic:-mlp64 -shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", - -// # Legacy HPUX 9.X configs... -// "hpux-cc", "cc:-DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY -Ae +ESlit +O2 -z::(unknown)::-Wl,+s -ldld:DES_PTR DES_UNROLL DES_RISC1:${no_asm}:dl:hpux-shared:+Z:-b:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", -// "hpux-gcc", "gcc:-DB_ENDIAN -DBN_DIV2W -O3::(unknown)::-Wl,+s -ldld:DES_PTR DES_UNROLL DES_RISC1:${no_asm}:dl:hpux-shared:-fPIC:-shared:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", - -// #### HP MPE/iX http://jazz.external.hp.com/src/openssl/ -// "MPE/iX-gcc", "gcc:-D_ENDIAN -DBN_DIV2W -O3 -D_POSIX_SOURCE -D_SOCKET_SOURCE -I/SYSLOG/PUB::(unknown):MPE:-L/SYSLOG/PUB -lsyslog -lsocket -lcurses:BN_LLONG DES_PTR DES_UNROLL DES_RISC1:::", - -// # DEC Alpha OSF/1/Tru64 targets. -// # -// # "What's in a name? That which we call a rose -// # By any other word would smell as sweet." -// # -// # - William Shakespeare, "Romeo & Juliet", Act II, scene II. -// # -// # For gcc, the following gave a %50 speedup on a 164 over the 'DES_INT' version -// # -// "osf1-alpha-gcc", "gcc:-O3::(unknown):::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_UNROLL DES_RISC1:${no_asm}:dlfcn:alpha-osf1-shared:::.so", -// "osf1-alpha-cc", "cc:-std1 -tune host -O4 -readonly_strings::(unknown):::SIXTY_FOUR_BIT_LONG RC4_CHUNK:${no_asm}:dlfcn:alpha-osf1-shared:::.so", -// "tru64-alpha-cc", "cc:-std1 -tune host -fast -readonly_strings::-pthread:::SIXTY_FOUR_BIT_LONG RC4_CHUNK:${no_asm}:dlfcn:alpha-osf1-shared::-msym:.so", - -// #### -// #### Variety of LINUX:-) -// #### -// # *-generic* is endian-neutral target, but ./config is free to -// # throw in -D[BL]_ENDIAN, whichever appropriate... -// "linux-generic32","gcc:-DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", -// "linux-ppc", "gcc:-DB_ENDIAN -DTERMIO -O3 -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_RISC1 DES_UNROLL::linux_ppc32.o::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", -// #### IA-32 targets... -// "linux-ia32-icc", "icc:-DL_ENDIAN -DTERMIO -O2 -no_cpprt::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-KPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", -// "linux-elf", "gcc:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", -// "linux-aout", "gcc:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -march=i486 -Wall::(unknown):::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_out_asm}", -// #### -// "linux-generic64","gcc:-DTERMIO -O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", -// "linux-ppc64", "gcc:-m64 -DB_ENDIAN -DTERMIO -O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_RISC1 DES_UNROLL::linux_ppc64.o::::::::::dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", -// "linux-ia64", "gcc:-DL_ENDIAN -DTERMIO -O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK:${ia64_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", -// "linux-ia64-ecc","ecc:-DL_ENDIAN -DTERMIO -O2 -Wall -no_cpprt::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK:${ia64_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", -// "linux-ia64-icc","icc:-DL_ENDIAN -DTERMIO -O2 -Wall -no_cpprt::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK:${ia64_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", -// "linux-x86_64", "gcc:-m64 -DL_ENDIAN -DTERMIO -O3 -Wall -DMD32_REG_T=int::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK BF_PTR2 DES_INT DES_UNROLL:${x86_64_asm}:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", -// #### SPARC Linux setups -// # Ray Miller has patiently -// # assisted with debugging of following two configs. -// "linux-sparcv8","gcc:-mv8 -DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall -DBN_DIV2W::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::sparcv8.o:des_enc-sparc.o fcrypt_b.o:::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", -// # it's a real mess with -mcpu=ultrasparc option under Linux, but -// # -Wa,-Av8plus should do the trick no matter what. -// "linux-sparcv9","gcc:-m32 -mcpu=ultrasparc -DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall -Wa,-Av8plus -DBN_DIV2W::-D_REENTRANT:ULTRASPARC:-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::sparcv8plus.o:des_enc-sparc.o fcrypt_b.o:::::::::dlfcn:linux-shared:-fPIC:-m32:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", -// # GCC 3.1 is a requirement -// "linux64-sparcv9","gcc:-m64 -mcpu=ultrasparc -DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT:ULTRASPARC:-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::::::::::::dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", -// #### Alpha Linux with GNU C and Compaq C setups -// # Special notes: -// # - linux-alpha+bwx-gcc is ment to be used from ./config only. If you -// # ought to run './Configure linux-alpha+bwx-gcc' manually, do -// # complement the command line with -mcpu=ev56, -mcpu=ev6 or whatever -// # which is appropriate. -// # - If you use ccc keep in mind that -fast implies -arch host and the -// # compiler is free to issue instructions which gonna make elder CPU -// # choke. If you wish to build "blended" toolkit, add -arch generic -// # *after* -fast and invoke './Configure linux-alpha-ccc' manually. -// # -// # -// # -// "linux-alpha-gcc","gcc:-O3 -DL_ENDIAN -DTERMIO::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_RISC1 DES_UNROLL:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", -// "linux-alpha+bwx-gcc","gcc:-O3 -DL_ENDIAN -DTERMIO::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_RISC1 DES_UNROLL:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", -// "linux-alpha-ccc","ccc:-fast -readonly_strings -DL_ENDIAN -DTERMIO::-D_REENTRANT:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL:${no_asm}", -// "linux-alpha+bwx-ccc","ccc:-fast -readonly_strings -DL_ENDIAN -DTERMIO::-D_REENTRANT:::SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL:${no_asm}", - -// #### *BSD [do see comment about ${BSDthreads} above!] -// "BSD-generic32","gcc:-DTERMIOS -O3 -fomit-frame-pointer -Wall::${BSDthreads}:::BN_LLONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL:${no_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", -// "BSD-x86", "gcc:-DL_ENDIAN -DTERMIOS -O3 -fomit-frame-pointer -Wall::${BSDthreads}:::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_out_asm}:dlfcn:bsd-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", -// "BSD-x86-elf", "gcc:-DL_ENDIAN -DTERMIOS -O3 -fomit-frame-pointer -Wall::${BSDthreads}:::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:bsd-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", -// "debug-BSD-x86-elf", "gcc:-DL_ENDIAN -DTERMIOS -O3 -Wall -g::${BSDthreads}:::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:bsd-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", -// "BSD-sparcv8", "gcc:-DB_ENDIAN -DTERMIOS -O3 -mv8 -Wall::${BSDthreads}:::BN_LLONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL::sparcv8.o:des_enc-sparc.o fcrypt_b.o:::::::::dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", - -// "BSD-generic64","gcc:-DTERMIOS -O3 -Wall::${BSDthreads}:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${no_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", -// # -DMD32_REG_T=int doesn't actually belong in sparc64 target, it -// # simply *happens* to work around a compiler bug in gcc 3.3.3, -// # triggered by RIPEMD160 code. -// "BSD-sparc64", "gcc:-DB_ENDIAN -DTERMIOS -O3 -DMD32_REG_T=int -Wall::${BSDthreads}:::SIXTY_FOUR_BIT_LONG RC2_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC2 BF_PTR:::des_enc-sparc.o fcrypt_b.o:::::::::dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", -// "BSD-ia64", "gcc:-DL_ENDIAN -DTERMIOS -O3 -Wall::${BSDthreads}:::SIXTY_FOUR_BIT_LONG RC4_CHUNK:${ia64_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", -// "BSD-x86_64", "gcc:-DL_ENDIAN -DTERMIOS -O3 -DMD32_REG_T=int -Wall::${BSDthreads}:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", - -// "bsdi-elf-gcc", "gcc:-DPERL5 -DL_ENDIAN -fomit-frame-pointer -O3 -march=i486 -Wall::(unknown)::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", - -// "nextstep", "cc:-O -Wall::(unknown):::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:::", -// "nextstep3.3", "cc:-O3 -Wall::(unknown):::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:::", - -// # NCR MP-RAS UNIX ver 02.03.01 -// "ncr-scde","cc:-O6 -Xa -Hoff=BEHAVED -686 -Hwide -Hiw::(unknown)::-lsocket -lnsl -lc89:${x86_gcc_des} ${x86_gcc_opts}:::", - -// # QNX -// "qnx4", "cc:-DL_ENDIAN -DTERMIO::(unknown):::${x86_gcc_des} ${x86_gcc_opts}:", -// "qnx6", "cc:-DL_ENDIAN -DTERMIOS::(unknown)::-lsocket:${x86_gcc_des} ${x86_gcc_opts}:", - -// #### SCO/Caldera targets. -// # -// # Originally we had like unixware-*, unixware-*-pentium, unixware-*-p6, etc. -// # Now we only have blended unixware-* as it's the only one used by ./config. -// # If you want to optimize for particular microarchitecture, bypass ./config -// # and './Configure unixware-7 -Kpentium_pro' or whatever appropriate. -// # Note that not all targets include assembler support. Mostly because of -// # lack of motivation to support out-of-date platforms with out-of-date -// # compiler drivers and assemblers. Tim Rice has -// # patiently assisted to debug most of it. -// # -// # UnixWare 2.0x fails destest with -O. -// "unixware-2.0","cc:-DFILIO_H -DNO_STRINGS_H::-Kthread::-lsocket -lnsl -lresolv -lx:${x86_gcc_des} ${x86_gcc_opts}:::", -// "unixware-2.1","cc:-O -DFILIO_H::-Kthread::-lsocket -lnsl -lresolv -lx:${x86_gcc_des} ${x86_gcc_opts}:::", -// "unixware-7","cc:-O -DFILIO_H -Kalloca::-Kthread::-lsocket -lnsl:BN_LLONG MD2_CHAR RC4_INDEX ${x86_gcc_des}:${x86_elf_asm}:dlfcn:svr5-shared:-Kpic::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", -// "unixware-7-gcc","gcc:-DL_ENDIAN -DFILIO_H -O3 -fomit-frame-pointer -march=pentium -Wall::-D_REENTRANT::-lsocket -lnsl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:gnu-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", -// # SCO 5 - Ben Laurie says the -O breaks the SCO cc. -// "sco5-cc", "cc:-belf::(unknown)::-lsocket -lnsl:${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:svr3-shared:-Kpic::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", -// "sco5-gcc", "gcc:-O3 -fomit-frame-pointer::(unknown)::-lsocket -lnsl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:svr3-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", - -// #### IBM's AIX. -// "aix3-cc", "cc:-O -DB_ENDIAN -qmaxmem=16384::(unknown):AIX::BN_LLONG RC4_CHAR:::", -// "aix-gcc", "gcc:-O -DB_ENDIAN::-pthread:AIX::BN_LLONG RC4_CHAR::aix_ppc32.o::::::::::dlfcn:aix-shared::-shared -Wl,-G:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)::-X 32", -// "aix64-gcc","gcc:-maix64 -O -DB_ENDIAN::-pthread:AIX::SIXTY_FOUR_BIT_LONG RC4_CHAR::aix_ppc64.o::::::::::dlfcn:aix-shared::-maix64 -shared -Wl,-G:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)::-X64", -// # Below targets assume AIX 5. Idea is to effectively disregard $OBJECT_MODE -// # at build time. $OBJECT_MODE is respected at ./config stage! -// "aix-cc", "cc:-q32 -O -DB_ENDIAN -qmaxmem=16384 -qro -qroconst::-qthreaded:AIX::BN_LLONG RC4_CHAR::aix_ppc32.o::::::::::dlfcn:aix-shared::-q32 -G:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)::-X 32", -// "aix64-cc", "cc:-q64 -O -DB_ENDIAN -qmaxmem=16384 -qro -qroconst::-qthreaded:AIX::SIXTY_FOUR_BIT_LONG RC4_CHAR::aix_ppc64.o::::::::::dlfcn:aix-shared::-q64 -G:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)::-X 64", - -// # -// # Cray T90 and similar (SDSC) -// # It's Big-endian, but the algorithms work properly when B_ENDIAN is NOT -// # defined. The T90 ints and longs are 8 bytes long, and apparently the -// # B_ENDIAN code assumes 4 byte ints. Fortunately, the non-B_ENDIAN and -// # non L_ENDIAN code aligns the bytes in each word correctly. -// # -// # The BIT_FIELD_LIMITS define is to avoid two fatal compiler errors: -// #'Taking the address of a bit field is not allowed. ' -// #'An expression with bit field exists as the operand of "sizeof" ' -// # (written by Wayne Schroeder ) -// # -// # j90 is considered the base machine type for unicos machines, -// # so this configuration is now called "cray-j90" ... -// "cray-j90", "cc: -DBIT_FIELD_LIMITS -DTERMIOS::(unknown):CRAY::SIXTY_FOUR_BIT_LONG DES_INT:::", - -// # -// # Cray T3E (Research Center Juelich, beckman@acl.lanl.gov) -// # -// # The BIT_FIELD_LIMITS define was written for the C90 (it seems). I added -// # another use. Basically, the problem is that the T3E uses some bit fields -// # for some st_addr stuff, and then sizeof and address-of fails -// # I could not use the ams/alpha.o option because the Cray assembler, 'cam' -// # did not like it. -// "cray-t3e", "cc: -DBIT_FIELD_LIMITS -DTERMIOS::(unknown):CRAY::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT:::", - -// # DGUX, 88100. -// "dgux-R3-gcc", "gcc:-O3 -fomit-frame-pointer::(unknown):::RC4_INDEX DES_UNROLL:::", -// "dgux-R4-gcc", "gcc:-O3 -fomit-frame-pointer::(unknown)::-lnsl -lsocket:RC4_INDEX DES_UNROLL:::", -// "dgux-R4-x86-gcc", "gcc:-O3 -fomit-frame-pointer -DL_ENDIAN::(unknown)::-lnsl -lsocket:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}", - -// # Sinix/ReliantUNIX RM400 -// # NOTE: The CDS++ Compiler up to V2.0Bsomething has the IRIX_CC_BUG optimizer problem. Better use -g */ -// "ReliantUNIX","cc:-KPIC -g -DTERMIOS -DB_ENDIAN::-Kthread:SNI:-lsocket -lnsl -lc -L/usr/ucblib -lucb:BN_LLONG DES_PTR DES_RISC2 DES_UNROLL BF_PTR:${no_asm}:dlfcn:reliantunix-shared:::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", -// "SINIX","cc:-O::(unknown):SNI:-lsocket -lnsl -lc -L/usr/ucblib -lucb:RC4_INDEX RC4_CHAR:::", -// "SINIX-N","/usr/ucb/cc:-O2 -misaligned::(unknown)::-lucb:RC4_INDEX RC4_CHAR:::", - -// # SIEMENS BS2000/OSD: an EBCDIC-based mainframe -// "BS2000-OSD","c89:-O -XLLML -XLLMK -XL -DB_ENDIAN -DTERMIOS -DCHARSET_EBCDIC::(unknown)::-lsocket -lnsl:THIRTY_TWO_BIT DES_PTR DES_UNROLL MD2_CHAR RC4_INDEX RC4_CHAR BF_PTR:::", - -// # OS/390 Unix an EBCDIC-based Unix system on IBM mainframe -// # You need to compile using the c89.sh wrapper in the tools directory, because the -// # IBM compiler does not like the -L switch after any object modules. -// # -// "OS390-Unix","c89.sh:-O -DB_ENDIAN -DCHARSET_EBCDIC -DNO_SYS_PARAM_H -D_ALL_SOURCE::(unknown):::THIRTY_TWO_BIT DES_PTR DES_UNROLL MD2_CHAR RC4_INDEX RC4_CHAR BF_PTR:::", - -// # Win64 targets, WIN64I denotes IA-64 and WIN64A - AMD64 -// "VC-WIN64I","cl::::WIN64I::SIXTY_FOUR_BIT RC4_CHUNK_LL DES_INT EXPORT_VAR_AS_FN:${no_asm}:win32", -// "VC-WIN64A","cl::::WIN64A::SIXTY_FOUR_BIT RC4_CHUNK_LL DES_INT EXPORT_VAR_AS_FN:${no_asm}:win32", - -// # Visual C targets -// "VC-NT","cl::::WINNT::BN_LLONG RC4_INDEX EXPORT_VAR_AS_FN ${x86_gcc_opts}:${no_asm}:win32", -// "VC-CE","cl::::WINCE::BN_LLONG RC4_INDEX EXPORT_VAR_AS_FN ${x86_gcc_opts}:${no_asm}:win32", -// "VC-WIN32","cl::::WIN32::BN_LLONG RC4_INDEX EXPORT_VAR_AS_FN ${x86_gcc_opts}:${no_asm}:win32", - -// # Borland C++ 4.5 -// "BC-32","bcc32::::WIN32::BN_LLONG DES_PTR RC4_INDEX EXPORT_VAR_AS_FN:${no_asm}:win32", - -// # MinGW -// "mingw", "gcc:-mno-cygwin -DL_ENDIAN -fomit-frame-pointer -O3 -march=i486 -Wall -D_WIN32_WINNT=0x333:::MINGW32:-lwsock32 -lgdi32:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts} EXPORT_VAR_AS_FN:${x86_coff_asm}:win32:cygwin-shared:-D_WINDLL -DOPENSSL_USE_APPLINK:-mno-cygwin -shared:.dll.a", - -// # UWIN -// "UWIN", "cc:-DTERMIOS -DL_ENDIAN -O -Wall:::UWIN::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${no_asm}:win32", - -// # Cygwin -// "Cygwin-pre1.3", "gcc:-DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O3 -m486 -Wall::(unknown):CYGWIN32::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${no_asm}:win32", -// "Cygwin", "gcc:-DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O3 -march=i486 -Wall:::CYGWIN32::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_coff_asm}:dlfcn:cygwin-shared:-D_WINDLL:-shared:.dll.a", -// "debug-Cygwin", "gcc:-DTERMIOS -DL_ENDIAN -march=i486 -Wall -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DOPENSSL_NO_ASM -g -Wformat -Wshadow -Wmissing-prototypes -Wmissing-declarations -Werror:::CYGWIN32:::${no_asm}:dlfcn:cygwin-shared:-D_WINDLL:-shared:.dll.a", - -// # NetWare from David Ward (dsward@novell.com) -// # requires either MetroWerks NLM development tools, or gcc / nlmconv -// # NetWare defaults socket bio to WinSock sockets. However, -// # the builds can be configured to use BSD sockets instead. -// # netware-clib => legacy CLib c-runtime support -// "netware-clib", "mwccnlm::::::${x86_gcc_opts}::", -// "netware-clib-bsdsock", "mwccnlm::::::${x86_gcc_opts}::", -// "netware-clib-gcc", "i586-netware-gcc:-nostdinc -I/ndk/nwsdk/include/nlm -I/ndk/ws295sdk/include -DL_ENDIAN -DNETWARE_CLIB -DOPENSSL_SYSNAME_NETWARE -O2 -Wall:::::${x86_gcc_opts}::", -// "netware-clib-bsdsock-gcc", "i586-netware-gcc:-nostdinc -I/ndk/nwsdk/include/nlm -DNETWARE_BSDSOCK -DNETDB_USE_INTERNET -DL_ENDIAN -DNETWARE_CLIB -DOPENSSL_SYSNAME_NETWARE -O2 -Wall:::::${x86_gcc_opts}::", -// # netware-libc => LibC/NKS support -// "netware-libc", "mwccnlm::::::BN_LLONG ${x86_gcc_opts}::", -// "netware-libc-bsdsock", "mwccnlm::::::BN_LLONG ${x86_gcc_opts}::", -// "netware-libc-gcc", "i586-netware-gcc:-nostdinc -I/ndk/libc/include -I/ndk/libc/include/winsock -DL_ENDIAN -DNETWARE_LIBC -DOPENSSL_SYSNAME_NETWARE -DTERMIO -O2 -Wall:::::BN_LLONG ${x86_gcc_opts}::", -// "netware-libc-bsdsock-gcc", "i586-netware-gcc:-nostdinc -I/ndk/libc/include -DNETWARE_BSDSOCK -DL_ENDIAN -DNETWARE_LIBC -DOPENSSL_SYSNAME_NETWARE -DTERMIO -O2 -Wall:::::BN_LLONG ${x86_gcc_opts}::", - -// # DJGPP -// "DJGPP", "gcc:-I/dev/env/WATT_ROOT/inc -DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O2 -Wall:::MSDOS:-L/dev/env/WATT_ROOT/lib -lwatt:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_out_asm}:", - -// # Ultrix from Bernhard Simon -// "ultrix-cc","cc:-std1 -O -Olimit 2500 -DL_ENDIAN::(unknown):::::::", -// "ultrix-gcc","gcc:-O3 -DL_ENDIAN::(unknown):::BN_LLONG::::", -// # K&R C is no longer supported; you need gcc on old Ultrix installations -// ##"ultrix","cc:-O2 -DNOPROTO -DNOCONST -DL_ENDIAN::(unknown):::::::", - -// ##### MacOS X (a.k.a. Rhapsody or Darwin) setup -// "rhapsody-ppc-cc","cc:-O3 -DB_ENDIAN::(unknown):MACOSX_RHAPSODY::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${no_asm}::", -// "darwin-ppc-cc","cc:-arch ppc -O3 -DB_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::osx_ppc32.o::::::::::dlfcn:darwin-shared:-fPIC -fno-common:-arch ppc -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib", -// "darwin64-ppc-cc","cc:-arch ppc64 -O3 -DB_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::osx_ppc64.o::::::::::dlfcn:darwin-shared:-fPIC -fno-common:-arch ppc64 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib", -// "darwin-i386-cc","cc:-arch i386 -O3 -fomit-frame-pointer -DL_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${no_asm}:dlfcn:darwin-shared:-fPIC -fno-common:-arch i386 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib", -// "debug-darwin-i386-cc","cc:-arch i386 -g3 -DL_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${no_asm}:dlfcn:darwin-shared:-fPIC -fno-common:-arch i386 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib", -// "darwin64-x86_64-cc","cc:-arch x86_64 -O3 -fomit-frame-pointer -DL_ENDIAN -DMD32_REG_T=int -Wall::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK BF_PTR2 DES_INT DES_UNROLL:${no_asm}:dlfcn:darwin-shared:-fPIC -fno-common:-arch x86_64 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib", -// "debug-darwin-ppc-cc","cc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DB_ENDIAN -g -Wall -O::-D_REENTRANT:MACOSX::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::osx_ppc32.o::::::::::dlfcn:darwin-shared:-fPIC -fno-common:-dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib", - -// ##### A/UX -// "aux3-gcc","gcc:-O2 -DTERMIO::(unknown):AUX:-lbsd:RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:::", - -// ##### Sony NEWS-OS 4.x -// "newsos4-gcc","gcc:-O -DB_ENDIAN::(unknown):NEWS4:-lmld -liberty:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_RISC1 DES_UNROLL BF_PTR::::", - -// ##### GNU Hurd -// "hurd-x86", "gcc:-DL_ENDIAN -DTERMIOS -O3 -fomit-frame-pointer -march=i486 -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC", - -// ##### OS/2 EMX -// "OS2-EMX", "gcc::::::::", - -// ##### VxWorks for various targets -// "vxworks-ppc405","ccppc:-g -msoft-float -mlongcall -DCPU=PPC405 -I\$(WIND_BASE)/target/h:::VXWORKS:-r:::::", -// "vxworks-ppc750","ccppc:-ansi -nostdinc -DPPC750 -D_REENTRANT -fvolatile -fno-builtin -fno-for-scope -fsigned-char -Wall -msoft-float -mlongcall -DCPU=PPC604 -I\$(WIND_BASE)/target/h \$(DEBUG_FLAG):::VXWORKS:-r:::::", -// "vxworks-ppc750-debug","ccppc:-ansi -nostdinc -DPPC750 -D_REENTRANT -fvolatile -fno-builtin -fno-for-scope -fsigned-char -Wall -msoft-float -mlongcall -DCPU=PPC604 -I\$(WIND_BASE)/target/h -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DPEDANTIC -DDEBUG_SAFESTACK -DDEBUG -g:::VXWORKS:-r:::::", -// "vxworks-ppc860","ccppc:-nostdinc -msoft-float -DCPU=PPC860 -DNO_STRINGS_H -I\$(WIND_BASE)/target/h:::VXWORKS:-r:::::", -// "vxworks-mipsle","ccmips:-B\$(WIND_BASE)/host/\$(WIND_HOST_TYPE)/lib/gcc-lib/ -DL_ENDIAN -EL -Wl,-EL -mips2 -mno-branch-likely -G 0 -fno-builtin -msoft-float -DCPU=MIPS32 -DMIPSEL -DNO_STRINGS_H -I\$(WIND_BASE)/target/h:::VXWORKS:-r::${no_asm}::::::ranlibmips:", - -// ##### Compaq Non-Stop Kernel (Tandem) -// "tandem-c89","c89:-Ww -D__TANDEM -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1 -D_TANDEM_SOURCE -DB_ENDIAN::(unknown):::THIRTY_TWO_BIT:::", - -{enable if you want FIPS support and are using an openssl library with FIPS support compiled in.} -{$DEFINE OPENSSL_FIPS} -//use this only for Safe Stack define and some define changes in OpenSSL 1.0 -//defines. - -{$UNDEF OPENSSL_1_0} - -{$IFDEF WIN32} - {$DEFINE OPENSSL_SYSNAME_WIN32} - {$DEFINE OPENSSL_SYS_WIN32} - {$DEFINE L_ENDIAN} - {$DEFINE DSO_WIN32} - - {$DEFINE BN_LLONG} - {$DEFINE RC4_INDEX} - {$DEFINE EXPORT_VAR_AS_FN} - {$DEFINE RC4_INDEX} - {$DEFINE MD2_INT} - - {$DEFINE _CRT_SECURE_NO_DEPRECATE} - {$DEFINE _CRT_NONSTDC_NO_DEPRECATE} - {$DEFINE BN_ASM} - {$DEFINE MD5_ASM} - {$DEFINE SHA1_ASM} - {$DEFINE RMD160_ASM} - {$DEFINE OPENSSL_NO_CMS} - {$DEFINE OPENSSL_NO_GMP} - {$DEFINE OPENSSL_NO_CAMELLIA} - {$DEFINE OPENSSL_NO_RC5} - {$DEFINE OPENSSL_NO_MD2} - {$DEFINE OPENSSL_NO_MDC2} - {$DEFINE OPENSSL_NO_KRB5} - {$DEFINE OPENSSL_NO_MDC} - {$DEFINE OPENSSL_NO_DYNAMIC_ENGINE} - {$DEFINE OPENSSL_NO_RFC3779} - {$DEFINE OPENSSL_NO_SEED} - - {$DEFINE OPENSSL_NO_CAPIENG} - {$DEFINE OPENSSL_NO_JPAKE} - {$DEFINE OPENSSL_1_0} -{$ENDIF} - -{$IFDEF WINCE} - {$DEFINE BN_LLONG} - {$DEFINE RC4_INDEX} - {$DEFINE EXPORT_VAR_AS_FN} - {$DEFINE RC4_INDEX} - {$DEFINE MD2_INT} - {$DEFINE OPENSSL_NO_CMS} - {$DEFINE OPENSSL_NO_CAMELLIA} - {$DEFINE OPENSSL_NO_RC5} - {$DEFINE OPENSSL_NO_MD2} - {$DEFINE OPENSSL_NO_MDC2} - {$DEFINE OPENSSL_NO_KRB5} - {$DEFINE OPENSSL_NO_DYNAMIC_ENGINE} - - {$DEFINE EXPORT_VAR_AS_FN} - {$DEFINE OPENSSL_NO_RFC3779} - {$DEFINE OPENSSL_NO_SEED} - {$DEFINE OPENSSL_NO_CAPIENG} - {$DEFINE OPENSSL_NO_JPAKE} -{$ENDIF} - -{$IFDEF WIN64} - //"VC-WIN64A","cl::::WIN64A::-SIXTY_FOUR_BIT RC4_CHUNK_LL DES_INT EXPORT_VAR_AS_FN:${no_asm}:win32", - {$DEFINE SIXTY_FOUR_BIT} - {$DEFINE RC4_CHUNK_LL} - {$DEFINE DES_INT} - {$DEFINE EXPORT_VAR_AS_FN} - - {$DEFINE L_ENDIAN} - - {$DEFINE DSO_WIN32} - {$DEFINE OPENSSL_SYSNAME_WIN32} - {$DEFINE OPENSSL_SYSNAME_WINNT} - {$DEFINE UNICODE} - {$DEFINE _UNICODE} - {$DEFINE _CRT_SECURE_NO_DEPRECATE} - {$DEFINE _CRT_NONSTDC_NO_DEPRECATE} - {$DEFINE OPENSSL_NO_CAMELLIA} - {$DEFINE OPENSSL_NO_RC5} - {$DEFINE OPENSSL_NO_MD2} - {$DEFINE OPENSSL_NO_MDC2} - {$DEFINE OPENSSL_NO_KRB5} - {$DEFINE OPENSSL_NO_DYNAMIC_ENGINE} - - {$DEFINE EXPORT_VAR_AS_FN} - {$DEFINE OPENSSL_NO_GMP} - {$DEFINE OPENSSL_NO_RFC3779} - {$DEFINE OPENSSL_NO_SEED} - {$DEFINE OPENSSL_NO_CAPIENG} - {$DEFINE OPENSSL_NO_JPAKE} - {$DEFINE OPENSSL_1_0} -{$ENDIF} - -{$IFDEF UNIX} -//attempt to get this right from FreeBSD CVS -//Makefile compile options. The file is located -//at http://www.freebsd.org/cgi/cvsweb.cgi/src/crypto/openssl/ . - {$DEFINE OPENSSL_NO_CAMELLIA} - {$DEFINE OPENSSL_NO_GMP} - {$DEFINE OPENSSL_NO_MD2} - {$DEFINE OPENSSL_NO_MDC2} - {$DEFINE OPENSSL_NO_RC5} - {$DEFINE OPENSSL_NO_SEED} - {$DEFINE OPENSSL_NO_RFC3779} - - {$DEFINE OPENSSL_NO_CAPIENG} - {$DEFINE OPENSSL_NO_JPAKE} -{$ENDIF} - -//#if (defined(OPENSSL_NO_RSA) || defined(OPENSSL_NO_MD5)) && !defined(OPENSSL_NO_SSL2) -//#define OPENSSL_NO_SSL2 -//#endif -{$IFDEF OPENSSL_NO_RSA} - {$IFNDEF OPENSSL_NO_SSL2} - {$DEFINE OPENSSL_NO_SSL2} - {$ENDIF} -{$ENDIF} -{$IFDEF OPENSSL_NO_MD5} - {$IFNDEF OPENSSL_NO_SSL2} - {$DEFINE OPENSSL_NO_SSL2} - {$ENDIF} -{$ENDIF} - -{$IFDEF WIN64} - {$DEFINE SYS_WIN} -{$ENDIF} -{$IFDEF WIN32} - {$DEFINE SYS_WIN} -{$ENDIF} -{$IFDEF WINCE} - {$DEFINE SYS_WIN} -{$ENDIF} - -{$IFNDEF SIXTY_FOUR_BIT} - {$IFNDEF SIXTY_FOUR_BIT_LONG} -//I've over simplified this because we don't support 8 or 16bit architectures - {$DEFINE THIRTY_TWO_BIT} - {$ENDIF} -{$ENDIF} -{$IFDEF OPENSSL_1_0} - {$DEFINE DEBUG_SAFESTACK} - {$UNDEF OPENSSL_NO_SEED} - {$UNDEF OPENSSL_NO_MDC2} - {$UNDEF OPENSSL_NO_CMS} - {$UNDEF OPENSSL_NO_CAPIENG} -{$ENDIF} - -// the following emits are a workaround to a -// name conflict with Win32 API header files -(*$HPPEMIT '#include '*) -{$IFDEF SYS_WIN} -(*$HPPEMIT '#undef X509_NAME'*) -(*$HPPEMIT '#undef X509_EXTENSIONS'*) -(*$HPPEMIT '#undef X509_CERT_PAIR'*) -(*$HPPEMIT '#undef PKCS7_ISSUER_AND_SERIAL'*) -(*$HPPEMIT '#undef OCSP_RESPONSE'*) -(*$HPPEMIT '#undef OCSP_REQUEST'*) -(*$HPPEMIT '#undef PKCS7_SIGNER_INFO'*) -(*$HPPEMIT '#undef OCSP_REQUEST'*) -(*$HPPEMIT '#undef OCSP_RESPONSE'*) -{$ENDIF} - -// the following emits are a workaround to allow -// compiling in C++ without having to re-define -// OpenSSL data types and without having to -// include the OpenSSL header files -{$IFDEF HAS_DIRECTIVE_HPPEMIT_NAMESPACE} -{$HPPEMIT OPENNAMESPACE} -{$ELSE} -(*$HPPEMIT 'namespace Idsslopensslheaders'*) -(*$HPPEMIT '{'*) -{$ENDIF} -(*$HPPEMIT ' struct SSL;'*) -(*$HPPEMIT ' typedef SSL* PSSL;'*) -(*$HPPEMIT ' struct SSL_CTX;'*) -(*$HPPEMIT ' typedef SSL_CTX* PSSL_CTX;'*) -(*$HPPEMIT ' struct SSL_METHOD;'*) -(*$HPPEMIT ' typedef SSL_METHOD* PSSL_METHOD;'*) -(*$HPPEMIT ' struct X509;'*) -(*$HPPEMIT ' typedef X509* PX509;'*) -(*$HPPEMIT ' struct X509_NAME;'*) -(*$HPPEMIT ' typedef X509_NAME* PX509_NAME;'*) -{$IFDEF HAS_DIRECTIVE_HPPEMIT_NAMESPACE} -{$HPPEMIT CLOSENAMESPACE} -{$ELSE} -(*$HPPEMIT '}'*) -{$ENDIF} - -// RLebeau: why are the following types not being placed in -// the Idsslopensslheaders namespace with the types above? -(*$HPPEMIT 'struct RSA;'*) -(*$HPPEMIT 'typedef RSA* PRSA;'*) -(*$HPPEMIT 'struct DSA;'*) -(*$HPPEMIT 'typedef DSA* PDSA;'*) -(*$HPPEMIT 'struct DH;'*) -(*$HPPEMIT 'typedef DH* PDH;'*) -(*$HPPEMIT 'typedef void* PEC_KEY;'*) - -uses - IdException, - IdGlobal, - {$IFDEF WINDOWS} - Windows, - IdWinsock2, - {$ENDIF} - {$IFDEF USE_VCL_POSIX} - Posix.SysSocket, - Posix.SysTime, - Posix.SysTypes, - {$ENDIF} - {$IFDEF KYLIXCOMPAT} - libc, - {$ENDIF} - {$IFDEF USE_BASEUNIX} - baseunix, - sockets, - {$ENDIF} - SysUtils, - IdCTypes; - -//temp for compile tests -{.$DEFINE SSLEAY_MACROS} - -const - {$IFNDEF HAS_PAnsiChar} - cNull: TIdAnsiChar = 0; - {$ENDIF} - - {$EXTERNALSYM CONF_MFLAGS_IGNORE_ERRORS} - CONF_MFLAGS_IGNORE_ERRORS = $1; - {$EXTERNALSYM CONF_MFLAGS_IGNORE_RETURN_CODES} - CONF_MFLAGS_IGNORE_RETURN_CODES = $2; - {$EXTERNALSYM CONF_MFLAGS_SILENT} - CONF_MFLAGS_SILENT = $4; - {$EXTERNALSYM CONF_MFLAGS_NO_DSO} - CONF_MFLAGS_NO_DSO = $8; - {$EXTERNALSYM CONF_MFLAGS_IGNORE_MISSING_FILE} - CONF_MFLAGS_IGNORE_MISSING_FILE = $10; - {$EXTERNALSYM CONF_MFLAGS_DEFAULT_SECTION} - CONF_MFLAGS_DEFAULT_SECTION = $20; - {$EXTERNALSYM CONF_F_CONF_DUMP_FP} - CONF_F_CONF_DUMP_FP = 104; - {$EXTERNALSYM CONF_F_CONF_LOAD} - CONF_F_CONF_LOAD = 100; - {$EXTERNALSYM CONF_F_CONF_LOAD_BIO} - CONF_F_CONF_LOAD_BIO = 102; - {$EXTERNALSYM CONF_F_CONF_LOAD_FP} - CONF_F_CONF_LOAD_FP = 103; - {$EXTERNALSYM CONF_F_CONF_MODULES_LOAD} - CONF_F_CONF_MODULES_LOAD = 116; - {$EXTERNALSYM CONF_F_DEF_LOAD} - CONF_F_DEF_LOAD = 120; - {$EXTERNALSYM CONF_F_DEF_LOAD_BIO} - CONF_F_DEF_LOAD_BIO = 121; - {$EXTERNALSYM CONF_F_MODULE_INIT} - CONF_F_MODULE_INIT = 115; - {$EXTERNALSYM CONF_F_MODULE_LOAD_DSO} - CONF_F_MODULE_LOAD_DSO = 117; - {$EXTERNALSYM CONF_F_CONF_PARSE_LIST} - CONF_F_CONF_PARSE_LIST = 119; - {$EXTERNALSYM CONF_F_MODULE_RUN} - CONF_F_MODULE_RUN = 118; - {$EXTERNALSYM CONF_F_NCONF_DUMP_BIO} - CONF_F_NCONF_DUMP_BIO = 105; - {$EXTERNALSYM CONF_F_NCONF_DUMP_FP} - CONF_F_NCONF_DUMP_FP = 106; - {$EXTERNALSYM CONF_F_NCONF_GET_NUMBER} - CONF_F_NCONF_GET_NUMBER = 107; - {$EXTERNALSYM CONF_F_NCONF_GET_NUMBER_E} - CONF_F_NCONF_GET_NUMBER_E = 112; - {$EXTERNALSYM CONF_F_NCONF_GET_SECTION} - CONF_F_NCONF_GET_SECTION = 108; - {$EXTERNALSYM CONF_F_NCONF_GET_STRING} - CONF_F_NCONF_GET_STRING = 109; - {$EXTERNALSYM CONF_F_NCONF_LOAD} - CONF_F_NCONF_LOAD = 113; - {$EXTERNALSYM CONF_F_NCONF_LOAD_BIO} - CONF_F_NCONF_LOAD_BIO = 110; - {$EXTERNALSYM CONF_F_NCONF_LOAD_FP} - CONF_F_NCONF_LOAD_FP = 114; - {$EXTERNALSYM CONF_F_NCONF_NEW} - CONF_F_NCONF_NEW = 111; - {$EXTERNALSYM CONF_F_STR_COPY} - CONF_F_STR_COPY = 101; - -//* Reason codes. */ - {$EXTERNALSYM CONF_R_ERROR_LOADING_DSO} - CONF_R_ERROR_LOADING_DSO = 110; - {$EXTERNALSYM CONF_R_LIST_CANNOT_BE_NULL} - CONF_R_LIST_CANNOT_BE_NULL = 115; - {$EXTERNALSYM CONF_R_MISSING_CLOSE_SQUARE_BRACKET} - CONF_R_MISSING_CLOSE_SQUARE_BRACKET = 100; - {$EXTERNALSYM CONF_R_MISSING_EQUAL_SIGN} - CONF_R_MISSING_EQUAL_SIGN = 101; - {$EXTERNALSYM CONF_R_MISSING_FINISH_FUNCTION} - CONF_R_MISSING_FINISH_FUNCTION = 111; - {$EXTERNALSYM CONF_R_MISSING_INIT_FUNCTION} - CONF_R_MISSING_INIT_FUNCTION = 112; - {$EXTERNALSYM CONF_R_MODULE_INITIALIZATION_ERROR} - CONF_R_MODULE_INITIALIZATION_ERROR = 109; - {$EXTERNALSYM CONF_R_NO_CLOSE_BRACE} - CONF_R_NO_CLOSE_BRACE = 102; - {$EXTERNALSYM CONF_R_NO_CONF} - CONF_R_NO_CONF = 105; - {$EXTERNALSYM CONF_R_NO_CONF_OR_ENVIRONMENT_VARIABLE} - CONF_R_NO_CONF_OR_ENVIRONMENT_VARIABLE = 106; - {$EXTERNALSYM CONF_R_NO_SECTION} - CONF_R_NO_SECTION = 107; - {$EXTERNALSYM CONF_R_NO_SUCH_FILE} - CONF_R_NO_SUCH_FILE = 114; - {$EXTERNALSYM CONF_R_NO_VALUE} - CONF_R_NO_VALUE = 108; - {$EXTERNALSYM CONF_R_UNABLE_TO_CREATE_NEW_SECTION} - CONF_R_UNABLE_TO_CREATE_NEW_SECTION = 103; - {$EXTERNALSYM CONF_R_UNKNOWN_MODULE_NAME} - CONF_R_UNKNOWN_MODULE_NAME = 113; - {$EXTERNALSYM CONF_R_VARIABLE_HAS_NO_VALUE} - CONF_R_VARIABLE_HAS_NO_VALUE = 104; - - {$EXTERNALSYM ASN1_F_A2D_ASN1_OBJECT} - ASN1_F_A2D_ASN1_OBJECT = 100; - {$EXTERNALSYM ASN1_F_A2I_ASN1_ENUMERATED} - ASN1_F_A2I_ASN1_ENUMERATED = 236; - {$EXTERNALSYM ASN1_F_A2I_ASN1_INTEGER} - ASN1_F_A2I_ASN1_INTEGER = 101; - {$EXTERNALSYM ASN1_F_A2I_ASN1_STRING} - ASN1_F_A2I_ASN1_STRING = 102; - {$EXTERNALSYM ASN1_F_ASN1_COLLATE_PRIMITIVE} - ASN1_F_ASN1_COLLATE_PRIMITIVE = 103; - {$EXTERNALSYM ASN1_F_ASN1_D2I_BIO} - ASN1_F_ASN1_D2I_BIO = 104; - {$EXTERNALSYM ASN1_F_ASN1_D2I_FP} - ASN1_F_ASN1_D2I_FP = 105; - {$EXTERNALSYM ASN1_F_ASN1_DUP} - ASN1_F_ASN1_DUP = 106; - {$EXTERNALSYM ASN1_F_ASN1_ENUMERATED_SET} - ASN1_F_ASN1_ENUMERATED_SET = 232; - {$EXTERNALSYM ASN1_F_ASN1_ENUMERATED_TO_BN} - ASN1_F_ASN1_ENUMERATED_TO_BN = 233; - {$EXTERNALSYM ASN1_F_ASN1_GENERALIZEDTIME_NEW} - ASN1_F_ASN1_GENERALIZEDTIME_NEW = 222; - {$EXTERNALSYM ASN1_F_ASN1_GET_OBJECT} - ASN1_F_ASN1_GET_OBJECT = 107; - {$EXTERNALSYM ASN1_F_ASN1_HEADER_NEW} - ASN1_F_ASN1_HEADER_NEW = 108; - {$EXTERNALSYM ASN1_F_ASN1_I2D_BIO} - ASN1_F_ASN1_I2D_BIO = 109; - {$EXTERNALSYM ASN1_F_ASN1_I2D_FP} - ASN1_F_ASN1_I2D_FP = 110; - {$EXTERNALSYM ASN1_F_ASN1_INTEGER_SET} - ASN1_F_ASN1_INTEGER_SET = 111; - {$EXTERNALSYM ASN1_F_ASN1_INTEGER_TO_BN} - ASN1_F_ASN1_INTEGER_TO_BN = 112; - {$EXTERNALSYM ASN1_F_ASN1_OBJECT_NEW} - ASN1_F_ASN1_OBJECT_NEW = 113; - - {$EXTERNALSYM ASN1_F_ASN1_OUTPUT_DATA} - ASN1_F_ASN1_OUTPUT_DATA= 207; - - {$EXTERNALSYM ASN1_F_ASN1_PACK_STRING} - ASN1_F_ASN1_PACK_STRING = 245; - {$EXTERNALSYM ASN1_F_ASN1_PBE_SET} - ASN1_F_ASN1_PBE_SET = 253; - {$EXTERNALSYM ASN1_F_ASN1_SEQ_PACK} - ASN1_F_ASN1_SEQ_PACK = 246; - {$EXTERNALSYM ASN1_F_ASN1_SEQ_UNPACK} - ASN1_F_ASN1_SEQ_UNPACK = 247; - {$EXTERNALSYM ASN1_F_ASN1_SIGN} - ASN1_F_ASN1_SIGN = 114; - {$EXTERNALSYM ASN1_F_ASN1_STRING_NEW} - ASN1_F_ASN1_STRING_NEW = 115; - {$EXTERNALSYM ASN1_F_ASN1_STRING_TYPE_NEW} - ASN1_F_ASN1_STRING_TYPE_NEW = 116; - {$EXTERNALSYM ASN1_F_ASN1_TYPE_GET_INT_OCTETSTRING} - ASN1_F_ASN1_TYPE_GET_INT_OCTETSTRING = 117; - {$EXTERNALSYM ASN1_F_ASN1_TYPE_GET_OCTETSTRING} - ASN1_F_ASN1_TYPE_GET_OCTETSTRING = 118; - {$EXTERNALSYM ASN1_F_ASN1_TYPE_NEW} - ASN1_F_ASN1_TYPE_NEW = 119; - {$EXTERNALSYM ASN1_F_ASN1_UNPACK_STRING} - ASN1_F_ASN1_UNPACK_STRING = 248; - {$EXTERNALSYM ASN1_F_ASN1_UTCTIME_NEW} - ASN1_F_ASN1_UTCTIME_NEW = 120; - {$EXTERNALSYM ASN1_F_ASN1_VERIFY} - ASN1_F_ASN1_VERIFY = 121; - {$EXTERNALSYM ASN1_F_B64_READ_ASN1} - ASN1_F_B64_READ_ASN1 = 208; - {$EXTERNALSYM ASN1_F_B64_WRITE_ASN1} - ASN1_F_B64_WRITE_ASN1 = 209; - {$EXTERNALSYM ASN1_F_BIO_NEW_NDEF} - ASN1_F_BIO_NEW_NDEF = 212; - {$EXTERNALSYM ASN1_F_BITSTR_CB} - ASN1_F_BITSTR_CB = 180; - {$EXTERNALSYM ASN1_F_SMIME_READ_ASN1} - ASN1_F_SMIME_READ_ASN1 = 210; - {$EXTERNALSYM ASN1_F_SMIME_TEXT} - ASN1_F_SMIME_TEXT = 211; - - - {$EXTERNALSYM ASN1_F_AUTHORITY_KEYID_NEW} - ASN1_F_AUTHORITY_KEYID_NEW = 237; - {$EXTERNALSYM ASN1_F_BASIC_CONSTRAINTS_NEW} - ASN1_F_BASIC_CONSTRAINTS_NEW = 226; - {$EXTERNALSYM ASN1_F_BN_TO_ASN1_ENUMERATED} - ASN1_F_BN_TO_ASN1_ENUMERATED = 234; - {$EXTERNALSYM ASN1_F_BN_TO_ASN1_INTEGER} - ASN1_F_BN_TO_ASN1_INTEGER = 122; - {$EXTERNALSYM ASN1_F_D2I_ASN1_BIT_STRING} - ASN1_F_D2I_ASN1_BIT_STRING = 123; - {$EXTERNALSYM ASN1_F_D2I_ASN1_BMPSTRING} - ASN1_F_D2I_ASN1_BMPSTRING = 124; - {$EXTERNALSYM ASN1_F_D2I_ASN1_BOOLEAN} - ASN1_F_D2I_ASN1_BOOLEAN = 125; - {$EXTERNALSYM ASN1_F_D2I_ASN1_BYTES} - ASN1_F_D2I_ASN1_BYTES = 126; - {$EXTERNALSYM ASN1_F_D2I_ASN1_ENUMERATED} - ASN1_F_D2I_ASN1_ENUMERATED = 235; - {$EXTERNALSYM ASN1_F_D2I_ASN1_GENERALIZEDTIME} - ASN1_F_D2I_ASN1_GENERALIZEDTIME = 223; - {$EXTERNALSYM ASN1_F_D2I_ASN1_HEADER} - ASN1_F_D2I_ASN1_HEADER = 127; - {$EXTERNALSYM ASN1_F_D2I_ASN1_INTEGER} - ASN1_F_D2I_ASN1_INTEGER = 128; - {$EXTERNALSYM ASN1_F_D2I_ASN1_OBJECT} - ASN1_F_D2I_ASN1_OBJECT = 129; - {$EXTERNALSYM ASN1_F_D2I_ASN1_OCTET_STRING} - ASN1_F_D2I_ASN1_OCTET_STRING = 130; - {$EXTERNALSYM ASN1_F_D2I_ASN1_PRINT_TYPE} - ASN1_F_D2I_ASN1_PRINT_TYPE = 131; - {$EXTERNALSYM ASN1_F_D2I_ASN1_SET} - ASN1_F_D2I_ASN1_SET = 132; - {$EXTERNALSYM ASN1_F_D2I_ASN1_TIME} - ASN1_F_D2I_ASN1_TIME = 224; - {$EXTERNALSYM ASN1_F_D2I_ASN1_TYPE} - ASN1_F_D2I_ASN1_TYPE = 133; - {$EXTERNALSYM ASN1_F_D2I_ASN1_TYPE_BYTES} - ASN1_F_D2I_ASN1_TYPE_BYTES = 134; - {$EXTERNALSYM ASN1_F_D2I_ASN1_UINTEGER} - ASN1_F_D2I_ASN1_UINTEGER = 280; - {$EXTERNALSYM ASN1_F_D2I_ASN1_UTCTIME} - ASN1_F_D2I_ASN1_UTCTIME = 135; - {$EXTERNALSYM ASN1_F_D2I_ASN1_UTF8STRING} - ASN1_F_D2I_ASN1_UTF8STRING = 266; - {$EXTERNALSYM ASN1_F_D2I_ASN1_VISIBLESTRING} - ASN1_F_D2I_ASN1_VISIBLESTRING = 267; - {$EXTERNALSYM ASN1_F_D2I_AUTHORITY_KEYID} - ASN1_F_D2I_AUTHORITY_KEYID = 238; - {$EXTERNALSYM ASN1_F_D2I_BASIC_CONSTRAINTS} - ASN1_F_D2I_BASIC_CONSTRAINTS = 227; - {$EXTERNALSYM ASN1_F_D2I_DHPARAMS} - ASN1_F_D2I_DHPARAMS = 136; - {$EXTERNALSYM ASN1_F_D2I_DIST_POINT} - ASN1_F_D2I_DIST_POINT = 276; - {$EXTERNALSYM ASN1_F_D2I_DIST_POINT_NAME} - ASN1_F_D2I_DIST_POINT_NAME = 277; - {$EXTERNALSYM ASN1_F_D2I_DSAPARAMS} - ASN1_F_D2I_DSAPARAMS = 137; - {$EXTERNALSYM ASN1_F_D2I_DSAPRIVATEKEY} - ASN1_F_D2I_DSAPRIVATEKEY = 138; - {$EXTERNALSYM ASN1_F_D2I_DSAPUBLICKEY} - ASN1_F_D2I_DSAPUBLICKEY = 139; - {$EXTERNALSYM ASN1_F_D2I_GENERAL_NAME} - ASN1_F_D2I_GENERAL_NAME = 230; - {$EXTERNALSYM ASN1_F_D2I_NETSCAPE_CERT_SEQUENCE} - ASN1_F_D2I_NETSCAPE_CERT_SEQUENCE = 228; - {$EXTERNALSYM ASN1_F_D2I_NETSCAPE_PKEY} - ASN1_F_D2I_NETSCAPE_PKEY = 140; - {$EXTERNALSYM ASN1_F_D2I_NETSCAPE_RSA} - ASN1_F_D2I_NETSCAPE_RSA = 141; - {$EXTERNALSYM ASN1_F_D2I_NETSCAPE_RSA_2} - ASN1_F_D2I_NETSCAPE_RSA_2 = 142; - {$EXTERNALSYM ASN1_F_D2I_NETSCAPE_SPKAC} - ASN1_F_D2I_NETSCAPE_SPKAC = 143; - {$EXTERNALSYM ASN1_F_D2I_NETSCAPE_SPKI} - ASN1_F_D2I_NETSCAPE_SPKI = 144; - {$EXTERNALSYM ASN1_F_D2I_NOTICEREF} - ASN1_F_D2I_NOTICEREF = 268; - {$EXTERNALSYM ASN1_F_D2I_PBE2PARAM} - ASN1_F_D2I_PBE2PARAM = 262; - {$EXTERNALSYM ASN1_F_D2I_PBEPARAM} - ASN1_F_D2I_PBEPARAM = 249; - {$EXTERNALSYM ASN1_F_D2I_PBKDF2PARAM} - ASN1_F_D2I_PBKDF2PARAM = 263; - {$EXTERNALSYM ASN1_F_D2I_PKCS12} - ASN1_F_D2I_PKCS12 = 254; - {$EXTERNALSYM ASN1_F_D2I_PKCS12_BAGS} - ASN1_F_D2I_PKCS12_BAGS = 255; - {$EXTERNALSYM ASN1_F_D2I_PKCS12_MAC_DATA} - ASN1_F_D2I_PKCS12_MAC_DATA = 256; - {$EXTERNALSYM ASN1_F_D2I_PKCS12_SAFEBAG} - ASN1_F_D2I_PKCS12_SAFEBAG = 257; - {$EXTERNALSYM ASN1_F_D2I_PKCS7} - ASN1_F_D2I_PKCS7 = 145; - {$EXTERNALSYM ASN1_F_D2I_PKCS7_DIGEST} - ASN1_F_D2I_PKCS7_DIGEST = 146; - {$EXTERNALSYM ASN1_F_D2I_PKCS7_ENCRYPT} - ASN1_F_D2I_PKCS7_ENCRYPT = 147; - {$EXTERNALSYM ASN1_F_D2I_PKCS7_ENC_CONTENT} - ASN1_F_D2I_PKCS7_ENC_CONTENT = 148; - {$EXTERNALSYM ASN1_F_D2I_PKCS7_ENVELOPE} - ASN1_F_D2I_PKCS7_ENVELOPE = 149; - {$EXTERNALSYM ASN1_F_D2I_PKCS7_ISSUER_AND_SERIAL} - ASN1_F_D2I_PKCS7_ISSUER_AND_SERIAL = 150; - {$EXTERNALSYM ASN1_F_D2I_PKCS7_RECIP_INFO} - ASN1_F_D2I_PKCS7_RECIP_INFO = 151; - {$EXTERNALSYM ASN1_F_D2I_PKCS7_SIGNED} - ASN1_F_D2I_PKCS7_SIGNED = 152; - {$EXTERNALSYM ASN1_F_D2I_PKCS7_SIGNER_INFO} - ASN1_F_D2I_PKCS7_SIGNER_INFO = 153; - {$EXTERNALSYM ASN1_F_D2I_PKCS7_SIGN_ENVELOPE} - ASN1_F_D2I_PKCS7_SIGN_ENVELOPE = 154; - {$EXTERNALSYM ASN1_F_D2I_PKCS8_PRIV_KEY_INFO} - ASN1_F_D2I_PKCS8_PRIV_KEY_INFO = 250; - {$EXTERNALSYM ASN1_F_D2I_PKEY_USAGE_PERIOD} - ASN1_F_D2I_PKEY_USAGE_PERIOD = 239; - {$EXTERNALSYM ASN1_F_D2I_POLICYINFO} - ASN1_F_D2I_POLICYINFO = 269; - {$EXTERNALSYM ASN1_F_D2I_POLICYQUALINFO} - ASN1_F_D2I_POLICYQUALINFO = 270; - {$EXTERNALSYM ASN1_F_D2I_PRIVATEKEY} - ASN1_F_D2I_PRIVATEKEY = 155; - {$EXTERNALSYM ASN1_F_D2I_PUBLICKEY} - ASN1_F_D2I_PUBLICKEY = 156; - {$EXTERNALSYM ASN1_F_D2I_RSAPRIVATEKEY} - ASN1_F_D2I_RSAPRIVATEKEY = 157; - {$EXTERNALSYM ASN1_F_D2I_RSAPUBLICKEY} - ASN1_F_D2I_RSAPUBLICKEY = 158; - {$EXTERNALSYM ASN1_F_D2I_SXNET} - ASN1_F_D2I_SXNET = 241; - {$EXTERNALSYM ASN1_F_D2I_SXNETID} - ASN1_F_D2I_SXNETID = 243; - {$EXTERNALSYM ASN1_F_D2I_USERNOTICE} - ASN1_F_D2I_USERNOTICE = 271; - {$EXTERNALSYM ASN1_F_D2I_X509} - ASN1_F_D2I_X509 = 159; - {$EXTERNALSYM ASN1_F_D2I_X509_ALGOR} - ASN1_F_D2I_X509_ALGOR = 160; - {$EXTERNALSYM ASN1_F_D2I_X509_ATTRIBUTE} - ASN1_F_D2I_X509_ATTRIBUTE = 161; - {$EXTERNALSYM ASN1_F_D2I_X509_CINF} - ASN1_F_D2I_X509_CINF = 162; - {$EXTERNALSYM ASN1_F_D2I_X509_CRL} - ASN1_F_D2I_X509_CRL = 163; - {$EXTERNALSYM ASN1_F_D2I_X509_CRL_INFO} - ASN1_F_D2I_X509_CRL_INFO = 164; - {$EXTERNALSYM ASN1_F_D2I_X509_EXTENSION} - ASN1_F_D2I_X509_EXTENSION = 165; - {$EXTERNALSYM ASN1_F_D2I_X509_KEY} - ASN1_F_D2I_X509_KEY = 166; - {$EXTERNALSYM ASN1_F_D2I_X509_NAME} - ASN1_F_D2I_X509_NAME = 167; - {$EXTERNALSYM ASN1_F_D2I_X509_NAME_ENTRY} - ASN1_F_D2I_X509_NAME_ENTRY = 168; - {$EXTERNALSYM ASN1_F_D2I_X509_PKEY} - ASN1_F_D2I_X509_PKEY = 169; - {$EXTERNALSYM ASN1_F_D2I_X509_PUBKEY} - ASN1_F_D2I_X509_PUBKEY = 170; - {$EXTERNALSYM ASN1_F_D2I_X509_REQ} - ASN1_F_D2I_X509_REQ = 171; - {$EXTERNALSYM ASN1_F_D2I_X509_REQ_INFO} - ASN1_F_D2I_X509_REQ_INFO = 172; - {$EXTERNALSYM ASN1_F_D2I_X509_REVOKED} - ASN1_F_D2I_X509_REVOKED = 173; - {$EXTERNALSYM ASN1_F_D2I_X509_SIG} - ASN1_F_D2I_X509_SIG = 174; - {$EXTERNALSYM ASN1_F_D2I_X509_VAL} - ASN1_F_D2I_X509_VAL = 175; - {$EXTERNALSYM ASN1_F_DIST_POINT_NAME_NEW} - ASN1_F_DIST_POINT_NAME_NEW = 278; - {$EXTERNALSYM ASN1_F_DIST_POINT_NEW} - ASN1_F_DIST_POINT_NEW = 279; - {$EXTERNALSYM ASN1_F_GENERAL_NAME_NEW} - ASN1_F_GENERAL_NAME_NEW = 231; - {$EXTERNALSYM ASN1_F_I2D_ASN1_HEADER} - ASN1_F_I2D_ASN1_HEADER = 176; - {$EXTERNALSYM ASN1_F_I2D_ASN1_TIME} - ASN1_F_I2D_ASN1_TIME = 225; - {$EXTERNALSYM ASN1_F_I2D_DHPARAMS} - ASN1_F_I2D_DHPARAMS = 177; - {$EXTERNALSYM ASN1_F_I2D_DSAPARAMS} - ASN1_F_I2D_DSAPARAMS = 178; - {$EXTERNALSYM ASN1_F_I2D_DSAPRIVATEKEY} - ASN1_F_I2D_DSAPRIVATEKEY = 179; - {$EXTERNALSYM ASN1_F_I2D_DSAPUBLICKEY} - ASN1_F_I2D_DSAPUBLICKEY = 180; - {$EXTERNALSYM ASN1_F_I2D_NETSCAPE_RSA} - ASN1_F_I2D_NETSCAPE_RSA = 181; - {$EXTERNALSYM ASN1_F_I2D_PKCS7} - ASN1_F_I2D_PKCS7 = 182; - {$EXTERNALSYM ASN1_F_I2D_PRIVATEKEY} - ASN1_F_I2D_PRIVATEKEY = 183; - {$EXTERNALSYM ASN1_F_I2D_PUBLICKEY} - ASN1_F_I2D_PUBLICKEY = 184; - {$EXTERNALSYM ASN1_F_I2D_RSAPRIVATEKEY} - ASN1_F_I2D_RSAPRIVATEKEY = 185; - {$EXTERNALSYM ASN1_F_I2D_RSAPUBLICKEY} - ASN1_F_I2D_RSAPUBLICKEY = 186; - {$EXTERNALSYM ASN1_F_I2D_X509_ATTRIBUTE} - ASN1_F_I2D_X509_ATTRIBUTE = 187; - {$EXTERNALSYM ASN1_F_I2T_ASN1_OBJECT} - ASN1_F_I2T_ASN1_OBJECT = 188; - {$EXTERNALSYM ASN1_F_NETSCAPE_CERT_SEQUENCE_NEW} - ASN1_F_NETSCAPE_CERT_SEQUENCE_NEW = 229; - {$EXTERNALSYM ASN1_F_NETSCAPE_PKEY_NEW} - ASN1_F_NETSCAPE_PKEY_NEW = 189; - {$EXTERNALSYM ASN1_F_NETSCAPE_SPKAC_NEW} - ASN1_F_NETSCAPE_SPKAC_NEW = 190; - {$EXTERNALSYM ASN1_F_NETSCAPE_SPKI_NEW} - ASN1_F_NETSCAPE_SPKI_NEW = 191; - {$EXTERNALSYM ASN1_F_NOTICEREF_NEW} - ASN1_F_NOTICEREF_NEW = 272; - {$EXTERNALSYM ASN1_F_PBE2PARAM_NEW} - ASN1_F_PBE2PARAM_NEW = 264; - {$EXTERNALSYM ASN1_F_PBEPARAM_NEW} - ASN1_F_PBEPARAM_NEW = 251; - {$EXTERNALSYM ASN1_F_PBKDF2PARAM_NEW} - ASN1_F_PBKDF2PARAM_NEW = 265; - {$EXTERNALSYM ASN1_F_PKCS12_BAGS_NEW} - ASN1_F_PKCS12_BAGS_NEW = 258; - {$EXTERNALSYM ASN1_F_PKCS12_MAC_DATA_NEW} - ASN1_F_PKCS12_MAC_DATA_NEW = 259; - {$EXTERNALSYM ASN1_F_PKCS12_NEW} - ASN1_F_PKCS12_NEW = 260; - {$EXTERNALSYM ASN1_F_PKCS12_SAFEBAG_NEW} - ASN1_F_PKCS12_SAFEBAG_NEW = 261; - {$EXTERNALSYM ASN1_F_PKCS5_PBE2_SET} - ASN1_F_PKCS5_PBE2_SET = 281; - {$EXTERNALSYM ASN1_F_PKCS7_DIGEST_NEW} - ASN1_F_PKCS7_DIGEST_NEW = 192; - {$EXTERNALSYM ASN1_F_PKCS7_ENCRYPT_NEW} - ASN1_F_PKCS7_ENCRYPT_NEW = 193; - {$EXTERNALSYM ASN1_F_PKCS7_ENC_CONTENT_NEW} - ASN1_F_PKCS7_ENC_CONTENT_NEW = 194; - {$EXTERNALSYM ASN1_F_PKCS7_ENVELOPE_NEW} - ASN1_F_PKCS7_ENVELOPE_NEW = 195; - {$EXTERNALSYM ASN1_F_PKCS7_ISSUER_AND_SERIAL_NEW} - ASN1_F_PKCS7_ISSUER_AND_SERIAL_NEW = 196; - {$EXTERNALSYM ASN1_F_PKCS7_NEW} - ASN1_F_PKCS7_NEW = 197; - {$EXTERNALSYM ASN1_F_PKCS7_RECIP_INFO_NEW} - ASN1_F_PKCS7_RECIP_INFO_NEW = 198; - {$EXTERNALSYM ASN1_F_PKCS7_SIGNED_NEW} - ASN1_F_PKCS7_SIGNED_NEW = 199; - {$EXTERNALSYM ASN1_F_PKCS7_SIGNER_INFO_NEW} - ASN1_F_PKCS7_SIGNER_INFO_NEW = 200; - {$EXTERNALSYM ASN1_F_PKCS7_SIGN_ENVELOPE_NEW} - ASN1_F_PKCS7_SIGN_ENVELOPE_NEW = 201; - {$EXTERNALSYM ASN1_F_PKCS8_PRIV_KEY_INFO_NEW} - ASN1_F_PKCS8_PRIV_KEY_INFO_NEW = 252; - {$EXTERNALSYM ASN1_F_PKEY_USAGE_PERIOD_NEW} - ASN1_F_PKEY_USAGE_PERIOD_NEW = 240; - {$EXTERNALSYM ASN1_F_POLICYINFO_NEW} - ASN1_F_POLICYINFO_NEW = 273; - {$EXTERNALSYM ASN1_F_POLICYQUALINFO_NEW} - ASN1_F_POLICYQUALINFO_NEW = 274; - {$EXTERNALSYM ASN1_F_SXNETID_NEW} - ASN1_F_SXNETID_NEW = 244; - {$EXTERNALSYM ASN1_F_SXNET_NEW} - ASN1_F_SXNET_NEW = 242; - {$EXTERNALSYM ASN1_F_USERNOTICE_NEW} - ASN1_F_USERNOTICE_NEW = 275; - {$EXTERNALSYM ASN1_F_X509_ALGOR_NEW} - ASN1_F_X509_ALGOR_NEW = 202; - {$EXTERNALSYM ASN1_F_X509_ATTRIBUTE_NEW} - ASN1_F_X509_ATTRIBUTE_NEW = 203; - {$EXTERNALSYM ASN1_F_X509_CINF_NEW} - ASN1_F_X509_CINF_NEW = 204; - {$EXTERNALSYM ASN1_F_X509_CRL_INFO_NEW} - ASN1_F_X509_CRL_INFO_NEW = 205; - {$EXTERNALSYM ASN1_F_X509_CRL_NEW} - ASN1_F_X509_CRL_NEW = 206; - {$EXTERNALSYM ASN1_F_X509_DHPARAMS_NEW} - ASN1_F_X509_DHPARAMS_NEW = 207; - {$EXTERNALSYM ASN1_F_X509_EXTENSION_NEW} - ASN1_F_X509_EXTENSION_NEW = 208; - {$EXTERNALSYM ASN1_F_X509_INFO_NEW} - ASN1_F_X509_INFO_NEW = 209; - {$EXTERNALSYM ASN1_F_X509_KEY_NEW} - ASN1_F_X509_KEY_NEW = 210; - {$EXTERNALSYM ASN1_F_X509_NAME_ENTRY_NEW} - ASN1_F_X509_NAME_ENTRY_NEW = 211; - {$EXTERNALSYM ASN1_F_X509_NAME_NEW} - ASN1_F_X509_NAME_NEW = 212; - {$EXTERNALSYM ASN1_F_X509_NEW} - ASN1_F_X509_NEW = 213; - {$EXTERNALSYM ASN1_F_X509_PKEY_NEW} - ASN1_F_X509_PKEY_NEW = 214; - {$EXTERNALSYM ASN1_F_X509_PUBKEY_NEW} - ASN1_F_X509_PUBKEY_NEW = 215; - {$EXTERNALSYM ASN1_F_X509_REQ_INFO_NEW} - ASN1_F_X509_REQ_INFO_NEW = 216; - {$EXTERNALSYM ASN1_F_X509_REQ_NEW} - ASN1_F_X509_REQ_NEW = 217; - {$EXTERNALSYM ASN1_F_X509_REVOKED_NEW} - ASN1_F_X509_REVOKED_NEW = 218; - {$EXTERNALSYM ASN1_F_X509_SIG_NEW} - ASN1_F_X509_SIG_NEW = 219; - {$EXTERNALSYM ASN1_F_X509_VAL_FREE} - ASN1_F_X509_VAL_FREE = 220; - {$EXTERNALSYM ASN1_F_X509_VAL_NEW} - ASN1_F_X509_VAL_NEW = 221; - {$EXTERNALSYM ASN1_OBJECT_FLAG_CRITICAL} - ASN1_OBJECT_FLAG_CRITICAL = $02; - {$EXTERNALSYM ASN1_OBJECT_FLAG_DYNAMIC} - ASN1_OBJECT_FLAG_DYNAMIC = $01; - {$EXTERNALSYM ASN1_OBJECT_FLAG_DYNAMIC_DATA} - ASN1_OBJECT_FLAG_DYNAMIC_DATA = $08; - {$EXTERNALSYM ASN1_OBJECT_FLAG_DYNAMIC_STRINGS} - ASN1_OBJECT_FLAG_DYNAMIC_STRINGS = $04; - {$EXTERNALSYM ASN1_R_ADDING_OBJECT} - ASN1_R_ADDING_OBJECT = 171; - {$EXTERNALSYM ASN1_R_ASN1_PARSE_ERROR} - ASN1_R_ASN1_PARSE_ERROR= 198; - {$EXTERNALSYM ASN1_R_ASN1_SIG_PARSE_ERROR} - ASN1_R_ASN1_SIG_PARSE_ERROR = 199; - - {$EXTERNALSYM ASN1_R_AUX_ERROR} - ASN1_R_AUX_ERROR = 100; - {$EXTERNALSYM ASN1_R_BAD_CLASS} - ASN1_R_BAD_CLASS = 101; - {$EXTERNALSYM ASN1_R_BAD_OBJECT_HEADER} - ASN1_R_BAD_OBJECT_HEADER = 102; - {$EXTERNALSYM ASN1_R_BAD_PASSWORD_READ} - ASN1_R_BAD_PASSWORD_READ = 103; - {$EXTERNALSYM ASN1_R_BAD_TAG} - ASN1_R_BAD_TAG = 104; - {$EXTERNALSYM ASN1_R_BMPSTRING_IS_WRONG_LENGTH} - ASN1_R_BMPSTRING_IS_WRONG_LENGTH = 210; - {$EXTERNALSYM ASN1_R_BN_LIB} - ASN1_R_BN_LIB = 105; - {$EXTERNALSYM ASN1_R_BOOLEAN_IS_WRONG_LENGTH} - ASN1_R_BOOLEAN_IS_WRONG_LENGTH = 106; - {$EXTERNALSYM ASN1_R_BUFFER_TOO_SMALL} - ASN1_R_BUFFER_TOO_SMALL = 107; - {$EXTERNALSYM ASN1_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER} - ASN1_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER = 108; - {$EXTERNALSYM ASN1_R_DATA_IS_WRONG} - ASN1_R_DATA_IS_WRONG = 109; - {$EXTERNALSYM ASN1_R_DECODE_ERROR} - ASN1_R_DECODE_ERROR = 110; - {$EXTERNALSYM ASN1_R_DECODING_ERROR} - ASN1_R_DECODING_ERROR = 111; - {$EXTERNALSYM ASN1_R_DEPTH_EXCEEDED} - ASN1_R_DEPTH_EXCEEDED = 174; - {$EXTERNALSYM ASN1_R_ENCODE_ERROR} - ASN1_R_ENCODE_ERROR = 112; - {$EXTERNALSYM ASN1_R_ERROR_GETTING_TIME} - ASN1_R_ERROR_GETTING_TIME = 173; - {$EXTERNALSYM ASN1_R_ERROR_LOADING_SECTION} - ASN1_R_ERROR_LOADING_SECTION = 172; - {$EXTERNALSYM ASN1_R_ERROR_PARSING_SET_ELEMENT} - ASN1_R_ERROR_PARSING_SET_ELEMENT = 113; - {$EXTERNALSYM ASN1_R_ERROR_SETTING_CIPHER_PARAMS} - ASN1_R_ERROR_SETTING_CIPHER_PARAMS = 114; - {$EXTERNALSYM ASN1_R_EXPECTING_AN_INTEGER} - ASN1_R_EXPECTING_AN_INTEGER = 115; - {$EXTERNALSYM ASN1_R_EXPECTING_AN_OBJECT} - ASN1_R_EXPECTING_AN_OBJECT = 116; - {$EXTERNALSYM ASN1_R_EXPECTING_A_BOOLEAN} - ASN1_R_EXPECTING_A_BOOLEAN = 117; - {$EXTERNALSYM ASN1_R_EXPECTING_A_TIME} - ASN1_R_EXPECTING_A_TIME = 118; - {$EXTERNALSYM ASN1_R_EXPLICIT_LENGTH_MISMATCH} - ASN1_R_EXPLICIT_LENGTH_MISMATCH = 119; - {$EXTERNALSYM ASN1_R_EXPLICIT_TAG_NOT_CONSTRUCTED} - ASN1_R_EXPLICIT_TAG_NOT_CONSTRUCTED = 120; - {$EXTERNALSYM ASN1_R_FIELD_MISSING} - ASN1_R_FIELD_MISSING = 121; - {$EXTERNALSYM ASN1_R_FIRST_NUM_TOO_LARGE} - ASN1_R_FIRST_NUM_TOO_LARGE = 122; - {$EXTERNALSYM ASN1_R_HEADER_TOO_LONG} - ASN1_R_HEADER_TOO_LONG = 123; - {$EXTERNALSYM ASN1_R_ILLEGAL_BITSTRING_FORMAT} - ASN1_R_ILLEGAL_BITSTRING_FORMAT = 175; - {$EXTERNALSYM ASN1_R_ILLEGAL_BOOLEAN} - ASN1_R_ILLEGAL_BOOLEAN = 176; - {$EXTERNALSYM ASN1_R_ILLEGAL_CHARACTERS} - ASN1_R_ILLEGAL_CHARACTERS = 124; - {$EXTERNALSYM ASN1_R_ILLEGAL_FORMAT} - ASN1_R_ILLEGAL_FORMAT = 177; - {$EXTERNALSYM ASN1_R_ILLEGAL_HEX} - ASN1_R_ILLEGAL_HEX = 178; - {$EXTERNALSYM ASN1_R_ILLEGAL_IMPLICIT_TAG} - ASN1_R_ILLEGAL_IMPLICIT_TAG = 179; - {$EXTERNALSYM ASN1_R_ILLEGAL_INTEGER} - ASN1_R_ILLEGAL_INTEGER = 180; - {$EXTERNALSYM ASN1_R_ILLEGAL_NESTED_TAGGING} - ASN1_R_ILLEGAL_NESTED_TAGGING = 181; - {$EXTERNALSYM ASN1_R_ILLEGAL_NULL} - ASN1_R_ILLEGAL_NULL = 125; - {$EXTERNALSYM ASN1_R_ILLEGAL_NULL_VALUE} - ASN1_R_ILLEGAL_NULL_VALUE = 182; - {$EXTERNALSYM ASN1_R_ILLEGAL_OBJECT} - ASN1_R_ILLEGAL_OBJECT = 183; - {$EXTERNALSYM ASN1_R_ILLEGAL_OPTIONAL_ANY} - ASN1_R_ILLEGAL_OPTIONAL_ANY = 126; - {$EXTERNALSYM ASN1_R_ILLEGAL_OPTIONS_ON_ITEM_TEMPLATE} - ASN1_R_ILLEGAL_OPTIONS_ON_ITEM_TEMPLATE = 170; - {$EXTERNALSYM ASN1_R_ILLEGAL_TAGGED_ANY} - ASN1_R_ILLEGAL_TAGGED_ANY = 127; - {$EXTERNALSYM ASN1_R_ILLEGAL_TIME_VALUE} - ASN1_R_ILLEGAL_TIME_VALUE = 184; - {$EXTERNALSYM ASN1_R_INTEGER_NOT_ASCII_FORMAT} - ASN1_R_INTEGER_NOT_ASCII_FORMAT = 185; - {$EXTERNALSYM ASN1_R_INTEGER_TOO_LARGE_FOR_LONG} - ASN1_R_INTEGER_TOO_LARGE_FOR_LONG = 128; - {$EXTERNALSYM ASN1_R_INVALID_BMPSTRING_LENGTH} - ASN1_R_INVALID_BMPSTRING_LENGTH = 129; - {$EXTERNALSYM ASN1_R_INVALID_DIGIT} - ASN1_R_INVALID_DIGIT = 130; - {$EXTERNALSYM ASN1_R_INVALID_MIME_TYPE} - ASN1_R_INVALID_MIME_TYPE = 200; - {$EXTERNALSYM ASN1_R_INVALID_MODIFIER} - ASN1_R_INVALID_MODIFIER = 186; - {$EXTERNALSYM ASN1_R_INVALID_NUMBER} - ASN1_R_INVALID_NUMBER = 187; - {$EXTERNALSYM ASN1_R_INVALID_OBJECT_ENCODING} - ASN1_R_INVALID_OBJECT_ENCODING = 212; - - {$EXTERNALSYM ASN1_R_INVALID_SEPARATOR} - ASN1_R_INVALID_SEPARATOR = 131; - {$EXTERNALSYM ASN1_R_INVALID_TIME_FORMAT} - ASN1_R_INVALID_TIME_FORMAT = 132; - {$EXTERNALSYM ASN1_R_INVALID_UNIVERSALSTRING_LENGTH} - ASN1_R_INVALID_UNIVERSALSTRING_LENGTH = 133; - {$EXTERNALSYM ASN1_R_INVALID_UTF8STRING} - ASN1_R_INVALID_UTF8STRING = 134; - {$EXTERNALSYM ASN1_R_IV_TOO_LARGE} - ASN1_R_IV_TOO_LARGE = 135; - {$EXTERNALSYM ASN1_R_LENGTH_ERROR} - ASN1_R_LENGTH_ERROR = 136; - {$EXTERNALSYM ASN1_R_LIST_ERROR} - ASN1_R_LIST_ERROR = 188; - {$EXTERNALSYM ASN1_R_MIME_NO_CONTENT_TYPE} - ASN1_R_MIME_NO_CONTENT_TYPE = 201; - {$EXTERNALSYM ASN1_R_MIME_PARSE_ERROR} - ASN1_R_MIME_PARSE_ERROR = 202; - {$EXTERNALSYM ASN1_R_MIME_SIG_PARSE_ERROR} - ASN1_R_MIME_SIG_PARSE_ERROR = 203; - {$EXTERNALSYM ASN1_R_MISSING_EOC} - ASN1_R_MISSING_EOC = 137; - {$EXTERNALSYM ASN1_R_MISSING_SECOND_NUMBER} - ASN1_R_MISSING_SECOND_NUMBER = 138; - {$EXTERNALSYM ASN1_R_MISSING_VALUE} - ASN1_R_MISSING_VALUE = 189; - {$EXTERNALSYM ASN1_R_MSTRING_NOT_UNIVERSAL} - ASN1_R_MSTRING_NOT_UNIVERSAL = 139; - {$EXTERNALSYM ASN1_R_MSTRING_WRONG_TAG} - ASN1_R_MSTRING_WRONG_TAG = 140; - {$EXTERNALSYM ASN1_R_NESTED_ASN1_STRING} - ASN1_R_NESTED_ASN1_STRING = 197; - {$EXTERNALSYM ASN1_R_NON_HEX_CHARACTERS} - ASN1_R_NON_HEX_CHARACTERS = 141; - {$EXTERNALSYM ASN1_R_NOT_ASCII_FORMAT} - ASN1_R_NOT_ASCII_FORMAT = 190; - {$EXTERNALSYM ASN1_R_NOT_ENOUGH_DATA} - ASN1_R_NOT_ENOUGH_DATA = 142; - {$EXTERNALSYM ASN1_R_NO_CONTENT_TYPE} - ASN1_R_NO_CONTENT_TYPE = 204; - {$EXTERNALSYM ASN1_R_NO_MATCHING_CHOICE_TYPE} - ASN1_R_NO_MATCHING_CHOICE_TYPE = 143; - {$EXTERNALSYM ASN1_R_NO_MULTIPART_BODY_FAILURE} - ASN1_R_NO_MULTIPART_BODY_FAILURE = 205; - {$EXTERNALSYM ASN1_R_NO_MULTIPART_BOUNDARY} - ASN1_R_NO_MULTIPART_BOUNDARY = 206; - {$EXTERNALSYM ASN1_R_NO_SIG_CONTENT_TYPE} - ASN1_R_NO_SIG_CONTENT_TYPE = 207; - {$EXTERNALSYM ASN1_R_NULL_IS_WRONG_LENGTH} - ASN1_R_NULL_IS_WRONG_LENGTH = 144; - {$EXTERNALSYM ASN1_R_OBJECT_NOT_ASCII_FORMAT} - ASN1_R_OBJECT_NOT_ASCII_FORMAT = 191; - {$EXTERNALSYM ASN1_R_ODD_NUMBER_OF_CHARS} - ASN1_R_ODD_NUMBER_OF_CHARS = 145; - {$EXTERNALSYM ASN1_R_PRIVATE_KEY_HEADER_MISSING} - ASN1_R_PRIVATE_KEY_HEADER_MISSING = 146; - {$EXTERNALSYM ASN1_R_SECOND_NUMBER_TOO_LARGE} - ASN1_R_SECOND_NUMBER_TOO_LARGE = 147; - {$EXTERNALSYM ASN1_R_SEQUENCE_LENGTH_MISMATCH} - ASN1_R_SEQUENCE_LENGTH_MISMATCH = 148; - {$EXTERNALSYM ASN1_R_SEQUENCE_NOT_CONSTRUCTED} - ASN1_R_SEQUENCE_NOT_CONSTRUCTED = 149; - {$EXTERNALSYM ASN1_R_SEQUENCE_OR_SET_NEEDS_CONFIG} - ASN1_R_SEQUENCE_OR_SET_NEEDS_CONFIG = 192; - {$EXTERNALSYM ASN1_R_SHORT_LINE} - ASN1_R_SHORT_LINE = 150; - {$EXTERNALSYM ASN1_R_SIG_INVALID_MIME_TYPE} - ASN1_R_SIG_INVALID_MIME_TYPE = 208; - {$EXTERNALSYM ASN1_R_STREAMING_NOT_SUPPORTED} - ASN1_R_STREAMING_NOT_SUPPORTED = 209; - {$EXTERNALSYM ASN1_R_STRING_TOO_LONG} - ASN1_R_STRING_TOO_LONG = 151; - {$EXTERNALSYM ASN1_R_STRING_TOO_SHORT} - ASN1_R_STRING_TOO_SHORT = 152; - {$EXTERNALSYM ASN1_R_TAG_VALUE_TOO_HIGH} - ASN1_R_TAG_VALUE_TOO_HIGH = 153; - {$EXTERNALSYM ASN1_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD} - ASN1_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD = 154; - {$EXTERNALSYM ASN1_R_TIME_NOT_ASCII_FORMAT} - ASN1_R_TIME_NOT_ASCII_FORMAT = 193; - {$EXTERNALSYM ASN1_R_TOO_LONG} - ASN1_R_TOO_LONG = 155; - {$EXTERNALSYM ASN1_R_TYPE_NOT_CONSTRUCTED} - ASN1_R_TYPE_NOT_CONSTRUCTED = 156; - {$EXTERNALSYM ASN1_R_UNABLE_TO_DECODE_RSA_KEY} - ASN1_R_UNABLE_TO_DECODE_RSA_KEY = 157; - {$EXTERNALSYM ASN1_R_UNABLE_TO_DECODE_RSA_PRIVATE_KEY} - ASN1_R_UNABLE_TO_DECODE_RSA_PRIVATE_KEY = 158; - {$EXTERNALSYM ASN1_R_UNEXPECTED_EOC} - ASN1_R_UNEXPECTED_EOC = 159; - {$EXTERNALSYM ASN1_R_UNIVERSALSTRING_IS_WRONG_LENGTH} - ASN1_R_UNIVERSALSTRING_IS_WRONG_LENGTH = 211; - {$EXTERNALSYM ASN1_R_UNKNOWN_FORMAT} - ASN1_R_UNKNOWN_FORMAT = 160; - {$EXTERNALSYM ASN1_R_UNKNOWN_MESSAGE_DIGEST_ALGORITHM} - ASN1_R_UNKNOWN_MESSAGE_DIGEST_ALGORITHM = 161; - {$EXTERNALSYM ASN1_R_UNKNOWN_OBJECT_TYPE} - ASN1_R_UNKNOWN_OBJECT_TYPE = 162; - {$EXTERNALSYM ASN1_R_UNKNOWN_PUBLIC_KEY_TYPE} - ASN1_R_UNKNOWN_PUBLIC_KEY_TYPE = 163; - {$EXTERNALSYM ASN1_R_UNKNOWN_TAG} - ASN1_R_UNKNOWN_TAG = 194; - {$EXTERNALSYM ASN1_R_UNKOWN_FORMAT} - ASN1_R_UNKOWN_FORMAT = 195; - {$EXTERNALSYM ASN1_R_UNSUPPORTED_ANY_DEFINED_BY_TYPE} - ASN1_R_UNSUPPORTED_ANY_DEFINED_BY_TYPE = 164; - {$EXTERNALSYM ASN1_R_UNSUPPORTED_CIPHER} - ASN1_R_UNSUPPORTED_CIPHER = 165; - {$EXTERNALSYM ASN1_R_UNSUPPORTED_ENCRYPTION_ALGORITHM} - ASN1_R_UNSUPPORTED_ENCRYPTION_ALGORITHM = 166; - {$EXTERNALSYM ASN1_R_UNSUPPORTED_PUBLIC_KEY_TYPE} - ASN1_R_UNSUPPORTED_PUBLIC_KEY_TYPE = 167; - {$EXTERNALSYM ASN1_R_UNSUPPORTED_TYPE} - ASN1_R_UNSUPPORTED_TYPE = 196; - {$EXTERNALSYM ASN1_R_WRONG_TAG} - ASN1_R_WRONG_TAG = 168; - {$EXTERNALSYM ASN1_R_WRONG_TYPE} - ASN1_R_WRONG_TYPE = 169; - - {$EXTERNALSYM ASN1_STRING_FLAG_BITS_LEFT} - ASN1_STRING_FLAG_BITS_LEFT = $08; - {$EXTERNALSYM ASN1_STRING_FLAG_NDEF} - ASN1_STRING_FLAG_NDEF = $010; -//* This flag is used by the CMS code to indicate that a string is not -// * complete and is a place holder for content when it had all been -// * accessed. The flag will be reset when content has been written to it. -// */ - {$EXTERNALSYM ASN1_STRING_FLAG_CONT} - ASN1_STRING_FLAG_CONT = $020; - {$EXTERNALSYM ASN1_LONG_UNDEF} - ASN1_LONG_UNDEF = $7fffffff; //0x7fffffffL - - {$EXTERNALSYM UB_NAME} - UB_NAME = 32768; - {$EXTERNALSYM UB_COMMON_NAME} - UB_COMMON_NAME = 64; - {$EXTERNALSYM UB_LOCALITY_NAME} - UB_LOCALITY_NAME = 128; - {$EXTERNALSYM UB_STATE_NAME} - UB_STATE_NAME = 128; - {$EXTERNALSYM UB_ORGANIZATION_NAME} - UB_ORGANIZATION_NAME = 64; - {$EXTERNALSYM UB_ORGANIZATION_UNIT_NAME} - UB_ORGANIZATION_UNIT_NAME = 64; - {$EXTERNALSYM UB_TITLE} - UB_TITLE = 64; - {$EXTERNALSYM UB_EMAIL_ADDRESS} - UB_EMAIL_ADDRESS = 128; - - {$EXTERNALSYM ASN1_STRFLGS_ESC_2253} - ASN1_STRFLGS_ESC_2253 = 1; - {$EXTERNALSYM ASN1_STRFLGS_ESC_CTRL} - ASN1_STRFLGS_ESC_CTRL = 2; - {$EXTERNALSYM ASN1_STRFLGS_ESC_MSB} - ASN1_STRFLGS_ESC_MSB = 4; - {$EXTERNALSYM ASN1_STRFLGS_ESC_QUOTE} - ASN1_STRFLGS_ESC_QUOTE = 8; - - {$EXTERNALSYM ASN1_STRFLGS_UTF8_CONVERT} - ASN1_STRFLGS_UTF8_CONVERT = $10; - {$EXTERNALSYM ASN1_STRFLGS_IGNORE_TYPE} - ASN1_STRFLGS_IGNORE_TYPE = $20; - {$EXTERNALSYM ASN1_STRFLGS_SHOW_TYPE} - ASN1_STRFLGS_SHOW_TYPE = $40; - {$EXTERNALSYM ASN1_STRFLGS_DUMP_ALL} - ASN1_STRFLGS_DUMP_ALL = $80; - {$EXTERNALSYM ASN1_STRFLGS_DUMP_UNKNOWN} - ASN1_STRFLGS_DUMP_UNKNOWN = $100; - {$EXTERNALSYM ASN1_STRFLGS_DUMP_DER} - ASN1_STRFLGS_DUMP_DER = $200; - {$EXTERNALSYM ASN1_STRFLGS_RFC2253} - ASN1_STRFLGS_RFC2253 = ASN1_STRFLGS_ESC_2253 or - ASN1_STRFLGS_ESC_CTRL or - ASN1_STRFLGS_ESC_MSB or - ASN1_STRFLGS_UTF8_CONVERT or - ASN1_STRFLGS_DUMP_UNKNOWN or - ASN1_STRFLGS_DUMP_DER; - - {$EXTERNALSYM BIO_BIND_NORMAL} - BIO_BIND_NORMAL = 0; - {$EXTERNALSYM BIO_BIND_REUSEADDR} - BIO_BIND_REUSEADDR = 2; - {$EXTERNALSYM BIO_BIND_REUSEADDR_IF_UNUSED} - BIO_BIND_REUSEADDR_IF_UNUSED = 1; - {$EXTERNALSYM BIO_CB_CTRL} - BIO_CB_CTRL = $06; - {$EXTERNALSYM BIO_CB_FREE} - BIO_CB_FREE = $01; - {$EXTERNALSYM BIO_CB_GETS} - BIO_CB_GETS = $05; - {$EXTERNALSYM BIO_CB_PUTS} - BIO_CB_PUTS = $04; - {$EXTERNALSYM BIO_CB_READ} - BIO_CB_READ = $02; - {$EXTERNALSYM BIO_CB_RETURN} - BIO_CB_RETURN = $80; - {$EXTERNALSYM BIO_CB_WRITE} - BIO_CB_WRITE = $03; - {$EXTERNALSYM BIO_CLOSE} - BIO_CLOSE = $01; - {$EXTERNALSYM BIO_CONN_S_BEFORE} - BIO_CONN_S_BEFORE = 1; - {$EXTERNALSYM BIO_CONN_S_BLOCKED_CONNECT} - BIO_CONN_S_BLOCKED_CONNECT = 7; - {$EXTERNALSYM BIO_CONN_S_CONNECT} - BIO_CONN_S_CONNECT = 5; - {$EXTERNALSYM BIO_CONN_S_CREATE_SOCKET} - BIO_CONN_S_CREATE_SOCKET = 4; - {$EXTERNALSYM BIO_CONN_S_GET_IP} - BIO_CONN_S_GET_IP = 2; - {$EXTERNALSYM BIO_CONN_S_GET_PORT} - BIO_CONN_S_GET_PORT = 3; - {$EXTERNALSYM BIO_CONN_S_NBIO} - BIO_CONN_S_NBIO = 8; - {$EXTERNALSYM BIO_CONN_S_OK} - BIO_CONN_S_OK = 6; - {$EXTERNALSYM BIO_CTRL_DUP} - BIO_CTRL_DUP = 12; - {$EXTERNALSYM BIO_CTRL_EOF} - BIO_CTRL_EOF = 2; - {$EXTERNALSYM BIO_CTRL_FLUSH} - BIO_CTRL_FLUSH = 11; - {$EXTERNALSYM BIO_CTRL_GET} - BIO_CTRL_GET = 5; - {$EXTERNALSYM BIO_CTRL_GET_CALLBACK} - BIO_CTRL_GET_CALLBACK = 15; - {$EXTERNALSYM BIO_CTRL_GET_CLOSE} - BIO_CTRL_GET_CLOSE = 8; - {$EXTERNALSYM BIO_CTRL_INFO} - BIO_CTRL_INFO = 3; - {$EXTERNALSYM BIO_CTRL_PENDING} - BIO_CTRL_PENDING = 10; - {$EXTERNALSYM BIO_CTRL_POP} - BIO_CTRL_POP = 7; - {$EXTERNALSYM BIO_CTRL_PUSH} - BIO_CTRL_PUSH = 6; - {$EXTERNALSYM BIO_CTRL_RESET} - BIO_CTRL_RESET = 1; - {$EXTERNALSYM BIO_CTRL_SET} - BIO_CTRL_SET = 4; - {$EXTERNALSYM BIO_CTRL_SET_CALLBACK} - BIO_CTRL_SET_CALLBACK = 14; - {$EXTERNALSYM BIO_CTRL_SET_CLOSE} - BIO_CTRL_SET_CLOSE = 9; - {$EXTERNALSYM BIO_CTRL_SET_FILENAME} - BIO_CTRL_SET_FILENAME = 30; - //* dgram BIO stuff */ - {$EXTERNALSYM BIO_CTRL_DGRAM_CONNECT} - BIO_CTRL_DGRAM_CONNECT = 31; //* BIO dgram special */ - {$EXTERNALSYM BIO_CTRL_DGRAM_SET_CONNECTED} - BIO_CTRL_DGRAM_SET_CONNECTED = 32; //* allow for an externally - //* connected socket to be - //* passed in */ - {$EXTERNALSYM BIO_CTRL_DGRAM_SET_RECV_TIMEOUT} - BIO_CTRL_DGRAM_SET_RECV_TIMEOUT = 33; //* setsockopt, essentially */ - {$EXTERNALSYM BIO_CTRL_DGRAM_GET_RECV_TIMEOUT} - BIO_CTRL_DGRAM_GET_RECV_TIMEOUT = 34; //* getsockopt, essentially */ - {$EXTERNALSYM BIO_CTRL_DGRAM_SET_SEND_TIMEOUT} - BIO_CTRL_DGRAM_SET_SEND_TIMEOUT = 35; //* setsockopt, essentially */ - {$EXTERNALSYM BIO_CTRL_DGRAM_GET_SEND_TIMEOUT} - BIO_CTRL_DGRAM_GET_SEND_TIMEOUT = 36; //* getsockopt, essentially */ - - {$EXTERNALSYM BIO_CTRL_DGRAM_GET_RECV_TIMER_EXP} - BIO_CTRL_DGRAM_GET_RECV_TIMER_EXP = 37; //* flag whether the last */ - {$EXTERNALSYM BIO_CTRL_DGRAM_GET_SEND_TIMER_EXP} - BIO_CTRL_DGRAM_GET_SEND_TIMER_EXP = 38; //* I/O operation tiemd out */ - - -//* #ifdef IP_MTU_DISCOVER */ - {$EXTERNALSYM BIO_CTRL_DGRAM_MTU_DISCOVER} - BIO_CTRL_DGRAM_MTU_DISCOVER = 39; //* set DF bit on egress packets */ -//* #endif */ - - {$EXTERNALSYM BIO_CTRL_DGRAM_QUERY_MTU} - BIO_CTRL_DGRAM_QUERY_MTU = 40; //* as kernel for current MTU */ - {$EXTERNALSYM BIO_CTRL_DGRAM_GET_MTU} - BIO_CTRL_DGRAM_GET_MTU = 41; //* get cached value for MTU */ - {$EXTERNALSYM BIO_CTRL_DGRAM_SET_MTU} - BIO_CTRL_DGRAM_SET_MTU = 42; //* set cached value for - // * MTU. want to use this - // * if asking the kernel - // * fails */ - - {$EXTERNALSYM BIO_CTRL_DGRAM_MTU_EXCEEDED} - BIO_CTRL_DGRAM_MTU_EXCEEDED = 43; //* check whether the MTU - // * was exceed in the - // * previous write - // * operation */ - {$EXTERNALSYM BIO_CTRL_DGRAM_GET_PEER} - BIO_CTRL_DGRAM_GET_PEER = 46; - - {$EXTERNALSYM BIO_CTRL_DGRAM_SET_PEER} - BIO_CTRL_DGRAM_SET_PEER = 44; //* Destination for the data */ - {$EXTERNALSYM BIO_CTRL_DGRAM_SET_NEXT_TIMEOUT} - BIO_CTRL_DGRAM_SET_NEXT_TIMEOUT = 45; //* Next DTLS handshake timeout to - - {$EXTERNALSYM BIO_CTRL_WPENDING} - BIO_CTRL_WPENDING = 13; - {$EXTERNALSYM BIO_C_DESTROY_BIO_PAIR} - BIO_C_DESTROY_BIO_PAIR = 139; - {$EXTERNALSYM BIO_C_DO_STATE_MACHINE} - BIO_C_DO_STATE_MACHINE = 101; - {$EXTERNALSYM BIO_C_FILE_SEEK} - BIO_C_FILE_SEEK = 128; - {$EXTERNALSYM BIO_C_FILE_TELL} - BIO_C_FILE_TELL = 133; - {$EXTERNALSYM BIO_C_GET_ACCEPT} - BIO_C_GET_ACCEPT = 124; - {$EXTERNALSYM BIO_C_GET_BIND_MODE} - BIO_C_GET_BIND_MODE = 132; - {$EXTERNALSYM BIO_C_GET_BUFF_NUM_LINES} - BIO_C_GET_BUFF_NUM_LINES = 116; - {$EXTERNALSYM BIO_C_GET_BUF_MEM_PTR} - BIO_C_GET_BUF_MEM_PTR = 115; - {$EXTERNALSYM BIO_C_GET_CIPHER_CTX} - BIO_C_GET_CIPHER_CTX = 129; - {$EXTERNALSYM BIO_C_GET_CIPHER_STATUS} - BIO_C_GET_CIPHER_STATUS = 113; - {$EXTERNALSYM BIO_C_GET_CONNECT} - BIO_C_GET_CONNECT = 123; - {$EXTERNALSYM BIO_C_GET_FD} - BIO_C_GET_FD = 105; - {$EXTERNALSYM BIO_C_GET_FILE_PTR} - BIO_C_GET_FILE_PTR = 107; - {$EXTERNALSYM BIO_C_GET_MD} - BIO_C_GET_MD = 112; - {$EXTERNALSYM BIO_C_GET_MD_CTX} - BIO_C_GET_MD_CTX = 120; - - {$EXTERNALSYM BIO_C_GET_PROXY_PARAM} - BIO_C_GET_PROXY_PARAM = 121; - {$EXTERNALSYM BIO_C_GET_READ_REQUEST} - BIO_C_GET_READ_REQUEST = 141; - {$EXTERNALSYM BIO_C_GET_SOCKS} - BIO_C_GET_SOCKS = 134; - - {$EXTERNALSYM BIO_C_GET_SSL} - BIO_C_GET_SSL = 110; - {$EXTERNALSYM BIO_C_GET_SSL_NUM_RENEGOTIATES} - BIO_C_GET_SSL_NUM_RENEGOTIATES = 126; - {$EXTERNALSYM BIO_C_GET_WRITE_BUF_SIZE} - BIO_C_GET_WRITE_BUF_SIZE = 137; - {$EXTERNALSYM BIO_C_GET_WRITE_GUARANTEE} - BIO_C_GET_WRITE_GUARANTEE = 140; - {$EXTERNALSYM BIO_C_MAKE_BIO_PAIR} - BIO_C_MAKE_BIO_PAIR = 138; - {$EXTERNALSYM BIO_C_SET_ACCEPT} - BIO_C_SET_ACCEPT = 118; - {$EXTERNALSYM BIO_C_SET_BIND_MODE} - BIO_C_SET_BIND_MODE = 131; - {$EXTERNALSYM BIO_C_SET_BUFF_READ_DATA} - BIO_C_SET_BUFF_READ_DATA = 122; - {$EXTERNALSYM BIO_C_SET_BUFF_SIZE} - BIO_C_SET_BUFF_SIZE = 117; - {$EXTERNALSYM BIO_C_SET_BUF_MEM} - BIO_C_SET_BUF_MEM = 114; - {$EXTERNALSYM BIO_C_SET_BUF_MEM_EOF_RETURN} - BIO_C_SET_BUF_MEM_EOF_RETURN = 130; - {$EXTERNALSYM BIO_C_SET_CONNECT} - BIO_C_SET_CONNECT = 100; - {$EXTERNALSYM BIO_C_SET_FD} - BIO_C_SET_FD = 104; - {$EXTERNALSYM BIO_C_SET_FILENAME} - BIO_C_SET_FILENAME = 108; - {$EXTERNALSYM BIO_C_SET_FILE_PTR} - BIO_C_SET_FILE_PTR = 106; - {$EXTERNALSYM BIO_C_SET_MD} - BIO_C_SET_MD = 111; - {$EXTERNALSYM BIO_C_SET_NBIO} - BIO_C_SET_NBIO = 102; - {$EXTERNALSYM BIO_C_SET_PROXY_PARAM} - BIO_C_SET_PROXY_PARAM = 103; - {$EXTERNALSYM BIO_C_SET_SOCKS} - BIO_C_SET_SOCKS = 135; - {$EXTERNALSYM BIO_C_SET_SSL} - BIO_C_SET_SSL = 109; - {$EXTERNALSYM BIO_C_SET_SSL_RENEGOTIATE_BYTES} - BIO_C_SET_SSL_RENEGOTIATE_BYTES = 125; - {$EXTERNALSYM BIO_C_SET_SSL_RENEGOTIATE_TIMEOUT} - BIO_C_SET_SSL_RENEGOTIATE_TIMEOUT = 127; - {$EXTERNALSYM BIO_C_SET_WRITE_BUF_SIZE} - BIO_C_SET_WRITE_BUF_SIZE = 136; - {$EXTERNALSYM BIO_C_SHUTDOWN_WR} - BIO_C_SHUTDOWN_WR = 142; - {$EXTERNALSYM BIO_C_NREAD0} - BIO_C_NREAD0 = 143; - {$EXTERNALSYM BIO_C_NREAD} - BIO_C_NREAD = 144; - {$EXTERNALSYM BIO_C_NWRITE0} - BIO_C_NWRITE0 = 145; - {$EXTERNALSYM BIO_C_NWRITE} - BIO_C_NWRITE = 146; - {$EXTERNALSYM BIO_C_RESET_READ_REQUEST} - BIO_C_RESET_READ_REQUEST = 147; - {$EXTERNALSYM BIO_C_SET_MD_CTX} - BIO_C_SET_MD_CTX = 148; - {$EXTERNALSYM BIO_C_SSL_MODE} - BIO_C_SSL_MODE = 119; - {$EXTERNALSYM BIO_FLAGS_BASE64_NO_NL} - BIO_FLAGS_BASE64_NO_NL = $100; - {$EXTERNALSYM BIO_FLAGS_IO_SPECIAL} - BIO_FLAGS_IO_SPECIAL = $04; - {$EXTERNALSYM BIO_FLAGS_READ} - BIO_FLAGS_READ = $01; - {$EXTERNALSYM BIO_FLAGS_WRITE} - BIO_FLAGS_WRITE = $02; - {$EXTERNALSYM BIO_FLAGS_RWS} - BIO_FLAGS_RWS = BIO_FLAGS_READ or - BIO_FLAGS_WRITE or - BIO_FLAGS_IO_SPECIAL; - {$EXTERNALSYM BIO_FLAGS_SHOULD_RETRY} - BIO_FLAGS_SHOULD_RETRY = $08; - {$EXTERNALSYM BIO_FP_APPEND} - BIO_FP_APPEND = $08; - {$EXTERNALSYM BIO_FP_READ} - BIO_FP_READ = $02; - {$EXTERNALSYM BIO_FP_TEXT} - BIO_FP_TEXT = $10; - {$EXTERNALSYM BIO_FP_WRITE} - BIO_FP_WRITE = $04; - {$EXTERNALSYM BIO_F_ACPT_STATE} - BIO_F_ACPT_STATE = 100; - {$EXTERNALSYM BIO_F_BIO_ACCEPT} - BIO_F_BIO_ACCEPT = 101; - {$EXTERNALSYM BIO_F_BIO_BER_GET_HEADER} - BIO_F_BIO_BER_GET_HEADER = 102; - {$EXTERNALSYM BIO_F_BIO_CTRL} - BIO_F_BIO_CTRL = 103; - {$EXTERNALSYM BIO_F_BIO_GETHOSTBYNAME} - BIO_F_BIO_GETHOSTBYNAME = 120; - {$EXTERNALSYM BIO_F_BIO_GETS} - BIO_F_BIO_GETS = 104; - {$EXTERNALSYM BIO_F_BIO_GET_ACCEPT_SOCKET} - BIO_F_BIO_GET_ACCEPT_SOCKET = 105; - {$EXTERNALSYM BIO_F_BIO_GET_HOST_IP} - BIO_F_BIO_GET_HOST_IP = 106; - {$EXTERNALSYM BIO_F_BIO_GET_PORT} - BIO_F_BIO_GET_PORT = 107; - {$EXTERNALSYM BIO_F_BIO_MAKE_PAIR} - BIO_F_BIO_MAKE_PAIR = 121; - {$EXTERNALSYM BIO_F_BIO_NEW} - BIO_F_BIO_NEW = 108; - {$EXTERNALSYM BIO_F_BIO_NEW_FILE} - BIO_F_BIO_NEW_FILE = 109; - {$EXTERNALSYM BIO_F_BIO_PUTS} - BIO_F_BIO_PUTS = 110; - {$EXTERNALSYM BIO_F_BIO_READ} - BIO_F_BIO_READ = 111; - {$EXTERNALSYM BIO_F_BIO_SOCK_INIT} - BIO_F_BIO_SOCK_INIT = 112; - {$EXTERNALSYM BIO_F_BIO_WRITE} - BIO_F_BIO_WRITE = 113; - {$EXTERNALSYM BIO_F_BUFFER_CTRL} - BIO_F_BUFFER_CTRL = 114; - {$EXTERNALSYM BIO_F_CONN_STATE} - BIO_F_CONN_STATE = 115; - {$EXTERNALSYM BIO_F_FILE_CTRL} - BIO_F_FILE_CTRL = 116; - {$EXTERNALSYM BIO_F_MEM_WRITE} - BIO_F_MEM_WRITE = 117; - {$EXTERNALSYM BIO_F_SSL_NEW} - BIO_F_SSL_NEW = 118; - {$EXTERNALSYM BIO_F_WSASTARTUP} - BIO_F_WSASTARTUP = 119; - {$EXTERNALSYM BIO_GHBN_CTRL_CACHE_SIZE} - BIO_GHBN_CTRL_CACHE_SIZE = 3; - {$EXTERNALSYM BIO_GHBN_CTRL_FLUSH} - BIO_GHBN_CTRL_FLUSH = 5; - {$EXTERNALSYM BIO_GHBN_CTRL_GET_ENTRY} - BIO_GHBN_CTRL_GET_ENTRY = 4; - {$EXTERNALSYM BIO_GHBN_CTRL_HITS} - BIO_GHBN_CTRL_HITS = 1; - {$EXTERNALSYM BIO_GHBN_CTRL_MISSES} - BIO_GHBN_CTRL_MISSES = 2; - {$EXTERNALSYM BIO_NOCLOSE} - BIO_NOCLOSE = $00; - {$EXTERNALSYM BIO_RR_CONNECT} - BIO_RR_CONNECT = $02; - {$EXTERNALSYM BIO_RR_SSL_X509_LOOKUP} - BIO_RR_SSL_X509_LOOKUP = $01; - {$EXTERNALSYM BIO_R_ACCEPT_ERROR} - BIO_R_ACCEPT_ERROR = 100; - {$EXTERNALSYM BIO_R_BAD_FOPEN_MODE} - BIO_R_BAD_FOPEN_MODE = 101; - {$EXTERNALSYM BIO_R_BAD_HOSTNAME_LOOKUP} - BIO_R_BAD_HOSTNAME_LOOKUP = 102; - {$EXTERNALSYM BIO_R_BROKEN_PIPE} - BIO_R_BROKEN_PIPE = 124; - {$EXTERNALSYM BIO_R_CONNECT_ERROR} - BIO_R_CONNECT_ERROR = 103; - {$EXTERNALSYM BIO_R_ERROR_SETTING_NBIO} - BIO_R_ERROR_SETTING_NBIO = 104; - {$EXTERNALSYM BIO_R_ERROR_SETTING_NBIO_ON_ACCEPTED_SOCKET} - BIO_R_ERROR_SETTING_NBIO_ON_ACCEPTED_SOCKET = 105; - {$EXTERNALSYM BIO_R_ERROR_SETTING_NBIO_ON_ACCEPT_SOCKET} - BIO_R_ERROR_SETTING_NBIO_ON_ACCEPT_SOCKET = 106; - {$EXTERNALSYM BIO_R_GETHOSTBYNAME_ADDR_IS_NOT_AF_INET} - BIO_R_GETHOSTBYNAME_ADDR_IS_NOT_AF_INET = 107; - {$EXTERNALSYM BIO_R_INVALID_ARGUMENT} - BIO_R_INVALID_ARGUMENT = 125; - {$EXTERNALSYM BIO_R_INVALID_IP_ADDRESS} - BIO_R_INVALID_IP_ADDRESS = 108; - {$EXTERNALSYM BIO_R_IN_USE} - BIO_R_IN_USE = 123; - {$EXTERNALSYM BIO_R_KEEPALIVE} - BIO_R_KEEPALIVE = 109; - {$EXTERNALSYM BIO_R_NBIO_CONNECT_ERROR} - BIO_R_NBIO_CONNECT_ERROR = 110; - {$EXTERNALSYM BIO_R_NO_ACCEPT_PORT_SPECIFIED} - BIO_R_NO_ACCEPT_PORT_SPECIFIED = 111; - {$EXTERNALSYM BIO_R_NO_HOSTNAME_SPECIFIED} - BIO_R_NO_HOSTNAME_SPECIFIED = 112; - {$EXTERNALSYM BIO_R_NO_PORT_DEFINED} - BIO_R_NO_PORT_DEFINED = 113; - {$EXTERNALSYM BIO_R_NO_PORT_SPECIFIED} - BIO_R_NO_PORT_SPECIFIED = 114; - {$EXTERNALSYM BIO_R_NULL_PARAMETER} - BIO_R_NULL_PARAMETER = 115; - {$EXTERNALSYM BIO_R_TAG_MISMATCH} - BIO_R_TAG_MISMATCH = 116; - {$EXTERNALSYM BIO_R_UNABLE_TO_BIND_SOCKET} - BIO_R_UNABLE_TO_BIND_SOCKET = 117; - {$EXTERNALSYM BIO_R_UNABLE_TO_CREATE_SOCKET} - BIO_R_UNABLE_TO_CREATE_SOCKET = 118; - {$EXTERNALSYM BIO_R_UNABLE_TO_LISTEN_SOCKET} - BIO_R_UNABLE_TO_LISTEN_SOCKET = 119; - {$EXTERNALSYM BIO_R_UNINITIALIZED} - BIO_R_UNINITIALIZED = 120; - {$EXTERNALSYM BIO_R_UNSUPPORTED_METHOD} - BIO_R_UNSUPPORTED_METHOD = 121; - {$EXTERNALSYM BIO_R_WSASTARTUP} - BIO_R_WSASTARTUP = 122; - {$EXTERNALSYM BIO_TYPE_ACCEPT} - BIO_TYPE_ACCEPT = 13 or $0400 or $0100; - {$EXTERNALSYM BIO_TYPE_BASE64} - BIO_TYPE_BASE64 = 11 or $0200; - {$EXTERNALSYM BIO_TYPE_BER} - BIO_TYPE_BER = 18 or $0200; - {$EXTERNALSYM BIO_TYPE_BIO} - BIO_TYPE_BIO = 19 or $0400; - {$EXTERNALSYM BIO_TYPE_BUFFER} - BIO_TYPE_BUFFER = 9 or $0200; - {$EXTERNALSYM BIO_TYPE_CIPHER} - BIO_TYPE_CIPHER = 10 or $0200; - {$EXTERNALSYM BIO_TYPE_CONNECT} - BIO_TYPE_CONNECT = 12 or $0400 or $0100; - {$EXTERNALSYM BIO_TYPE_DESCRIPTOR} - BIO_TYPE_DESCRIPTOR = $0100; - {$EXTERNALSYM BIO_TYPE_FD} - BIO_TYPE_FD = 4 or $0400 or $0100; - {$EXTERNALSYM BIO_TYPE_FILE} - BIO_TYPE_FILE = 2 or $0400; - {$EXTERNALSYM BIO_TYPE_FILTER} - BIO_TYPE_FILTER = $0200; - {$EXTERNALSYM BIO_TYPE_MD} - BIO_TYPE_MD = 8 or $0200; - {$EXTERNALSYM BIO_TYPE_MEM} - BIO_TYPE_MEM = 1 or $0400; - {$EXTERNALSYM BIO_TYPE_NBIO_TEST} - BIO_TYPE_NBIO_TEST = 16 or $0200; - {$EXTERNALSYM BIO_TYPE_NONE} - BIO_TYPE_NONE = 0; - {$EXTERNALSYM BIO_TYPE_NULL} - BIO_TYPE_NULL = 6 or $0400; - {$EXTERNALSYM BIO_TYPE_NULL_FILTER} - BIO_TYPE_NULL_FILTER = 17 or $0200; - {$EXTERNALSYM BIO_TYPE_PROXY_CLIENT} - BIO_TYPE_PROXY_CLIENT = 14 or $0200; - {$EXTERNALSYM BIO_TYPE_PROXY_SERVER} - BIO_TYPE_PROXY_SERVER = 15 or $0200; - {$EXTERNALSYM BIO_TYPE_SOCKET} - BIO_TYPE_SOCKET = 5 or $0400 or $0100; - {$EXTERNALSYM BIO_TYPE_SOURCE_SINK} - BIO_TYPE_SOURCE_SINK = $0400; - {$EXTERNALSYM BIO_TYPE_SSL} - BIO_TYPE_SSL = 7 or $0200; - {$EXTERNALSYM BIO_TYPE_LINEBUFFER} - BIO_TYPE_LINEBUFFER = 20 or $0200; - {$EXTERNALSYM BIO_TYPE_DGRAM} - BIO_TYPE_DGRAM = 21 or $0400 or $0100; - {$EXTERNALSYM BIO_TYPE_COMP} - BIO_TYPE_COMP = 23 or $0200; - - {$IFDEF SIXTY_FOUR_BIT_LONG} - {$EXTERNALSYM BN_BITS} - BN_BITS = 128; - {$EXTERNALSYM BN_BYTES} - BN_BYTES = 8; - {$EXTERNALSYM BN_BITS2} - BN_BITS2 = 64; - {$EXTERNALSYM BN_BITS4} - BN_BITS4 = 32; - {$EXTERNALSYM BN_DEC_FMT1} - BN_DEC_FMT1 = '%lu'; {Do not localize} - {$EXTERNALSYM BN_DEC_FMT2} - BN_DEC_FMT2 = '%019lu'; {Do not localize} - {$EXTERNALSYM BN_DEC_NUM} - BN_DEC_NUM = 19; - {$ENDIF} - {$IFDEF SIXTY_FOUR_BIT} - {$UNDEF BN_LLONG} - {$UNDEF BN_ULLONG} - {$EXTERNALSYM OPENSSL_BN_BITS} - OPENSSL_BN_BITS = 128; - {$EXTERNALSYM OPENSSL_BN_BYTES} - OPENSSL_BN_BYTES = 8; - {$EXTERNALSYM OPENSSL_BN_BITS2} - OPENSSL_BN_BITS2 = 64; - {$EXTERNALSYM OPENSSL_BN_BITS4} - OPENSSL_BN_BITS4 = 32; - {$EXTERNALSYM OPENSSL_BN_DEC_FMT1} - OPENSSL_BN_DEC_FMT1 = '%llu'; {Do not localize} - {$EXTERNALSYM OPENSSL_BN_DEC_FMT2} - OPENSSL_BN_DEC_FMT2 = '%019llu'; {Do not localize} - {$EXTERNALSYM OPENSSL_BN_DEC_NUM} - OPENSSL_BN_DEC_NUM = 19; - {$ENDIF} - {$IFDEF THIRTY_TWO_BIT} - {$EXTERNALSYM BN_BITS} - BN_BITS = 64; - {$EXTERNALSYM BN_BYTES} - BN_BYTES = 4; - {$EXTERNALSYM BN_BITS2} - BN_BITS2 = 32; - {$EXTERNALSYM BN_BITS4} - BN_BITS4 = 16; - {$EXTERNALSYM BN_DEC_FMT1} - BN_DEC_FMT1 = '%lu'; {Do not localize} - {$EXTERNALSYM BN_DEC_FMT2} - BN_DEC_FMT2 = '%09lu'; {Do not localize} - {$EXTERNALSYM BN_DEC_NUM} - BN_DEC_NUM = 9; - {$ENDIF} - {$EXTERNALSYM BN_CTX_NUM} - BN_CTX_NUM = 12; - {$IFNDEF OPENSSL_NO_DEPRECATED} - {$EXTERNALSYM BN_DEFAULT_BITS} - BN_DEFAULT_BITS = 1280; - {$ENDIF} - {$EXTERNALSYM BN_FLG_FREE} - BN_FLG_FREE = $8000; - {$EXTERNALSYM BN_FLG_MALLOCED} - BN_FLG_MALLOCED = $01; - {$EXTERNALSYM BN_FLG_STATIC_DATA} - BN_FLG_STATIC_DATA = $02; - {$EXTERNALSYM BN_FLG_CONSTTIME} - BN_FLG_CONSTTIME = $04; - //* avoid leaking exponent information through timing, - //* BN_mod_exp_mont() will call BN_mod_exp_mont_consttime, - //* BN_div() will call BN_div_no_branch, - // * BN_mod_inverse() will call BN_mod_inverse_no_branch. - // */ - {$IFNDEF OPENSSL_NO_DEPRECATED} - {$EXTERNALSYM BN_FLG_EXP_CONSTTIME} - BN_FLG_EXP_CONSTTIME = BN_FLG_CONSTTIME; //* deprecated name for the flag */ - //* avoid leaking exponent information through timings - //* (BN_mod_exp_mont() will call BN_mod_exp_mont_consttime) */ - {$ENDIF} - {$EXTERNALSYM BN_F_BN_BLINDING_CONVERT} - BN_F_BN_BLINDING_CONVERT = 100; - {$EXTERNALSYM BN_F_BN_BLINDING_INVERT} - BN_F_BN_BLINDING_INVERT = 101; - {$EXTERNALSYM BN_F_BN_BLINDING_NEW} - BN_F_BN_BLINDING_NEW = 102; - {$EXTERNALSYM BN_F_BN_BLINDING_UPDATE} - BN_F_BN_BLINDING_UPDATE = 103; - {$EXTERNALSYM BN_F_BN_BN2DEC} - BN_F_BN_BN2DEC = 104; - {$EXTERNALSYM BN_F_BN_BN2HEX} - BN_F_BN_BN2HEX = 105; - {$EXTERNALSYM BN_F_BN_CTX_NEW} - BN_F_BN_CTX_NEW = 106; - {$EXTERNALSYM BN_F_BN_DIV} - BN_F_BN_DIV = 107; - {$EXTERNALSYM BN_F_BN_DIV_NO_BRANCH} - BN_F_BN_DIV_NO_BRANCH = 138; - {$EXTERNALSYM BN_F_BN_EXPAND2} - BN_F_BN_EXPAND2 = 108; - {$EXTERNALSYM BN_F_BN_MOD_EXP_MONT} - BN_F_BN_MOD_EXP_MONT = 109; - {$EXTERNALSYM BN_F_BN_MOD_INVERSE} - BN_F_BN_MOD_INVERSE = 110; - {$EXTERNALSYM BN_F_BN_MOD_INVERSE_NO_BRANCH} - BN_F_BN_MOD_INVERSE_NO_BRANCH = 139; - {$EXTERNALSYM BN_F_BN_MOD_MUL_RECIPROCAL} - BN_F_BN_MOD_MUL_RECIPROCAL = 111; - {$EXTERNALSYM BN_F_BN_MPI2BN} - BN_F_BN_MPI2BN = 112; - {$EXTERNALSYM BN_F_BN_NEW} - BN_F_BN_NEW = 113; - {$EXTERNALSYM BN_F_BN_RAND} - BN_F_BN_RAND = 114; - {$EXTERNALSYM BN_F_BN_USUB} - BN_F_BN_USUB = 115; - {$EXTERNALSYM BN_MASK2} - BN_MASK2 = $ffffffff; - {$EXTERNALSYM BN_MASK2h} - BN_MASK2h = $ffff0000; - {$EXTERNALSYM BN_MASK2h1} - BN_MASK2h1 = $ffff8000; - {$EXTERNALSYM BN_MASK2l} - BN_MASK2l = $ffff; - {$EXTERNALSYM BN_R_ARG2_LT_ARG3} - BN_R_ARG2_LT_ARG3 = 100; - {$EXTERNALSYM BN_R_BAD_RECIPROCAL} - BN_R_BAD_RECIPROCAL = 101; - {$EXTERNALSYM BN_R_CALLED_WITH_EVEN_MODULUS} - BN_R_CALLED_WITH_EVEN_MODULUS = 102; - {$EXTERNALSYM BN_R_DIV_BY_ZERO} - BN_R_DIV_BY_ZERO = 103; - {$EXTERNALSYM BN_R_ENCODING_ERROR} - BN_R_ENCODING_ERROR = 104; - {$EXTERNALSYM BN_R_EXPAND_ON_STATIC_BIGNUM_DATA} - BN_R_EXPAND_ON_STATIC_BIGNUM_DATA = 105; - {$EXTERNALSYM BN_R_INVALID_LENGTH} - BN_R_INVALID_LENGTH = 106; - {$EXTERNALSYM BN_R_NOT_INITIALIZED} - BN_R_NOT_INITIALIZED = 107; - {$EXTERNALSYM BN_R_NO_INVERSE} - BN_R_NO_INVERSE = 108; - {$EXTERNALSYM BN_TBIT} - BN_TBIT = $80000000; - {$EXTERNALSYM BUFSIZ} - BUFSIZ = 1024; - {$EXTERNALSYM BUF_F_BUF_MEM_GROW} - BUF_F_BUF_MEM_GROW = 100; - {$EXTERNALSYM BUF_F_BUF_MEM_NEW} - BUF_F_BUF_MEM_NEW = 101; - {$EXTERNALSYM BUF_F_BUF_STRDUP} - BUF_F_BUF_STRDUP = 102; - - //function codes - {$EXTERNALSYM RAND_F_ENG_RAND_GET_RAND_METHOD} - RAND_F_ENG_RAND_GET_RAND_METHOD = 108; - {$EXTERNALSYM RAND_F_FIPS_RAND} - RAND_F_FIPS_RAND = 103; - {$EXTERNALSYM RAND_F_FIPS_RAND_BYTES} - RAND_F_FIPS_RAND_BYTES = 102; - {$EXTERNALSYM RAND_F_FIPS_RAND_GET_RAND_METHOD} - RAND_F_FIPS_RAND_GET_RAND_METHOD = 109; - {$EXTERNALSYM RAND_F_FIPS_RAND_SET_DT} - RAND_F_FIPS_RAND_SET_DT = 106; - {$EXTERNALSYM RAND_F_FIPS_SET_DT} - RAND_F_FIPS_SET_DT = 104; - {$EXTERNALSYM RAND_F_FIPS_SET_PRNG_SEED} - RAND_F_FIPS_SET_PRNG_SEED = 107; - {$EXTERNALSYM RAND_F_FIPS_SET_TEST_MODE} - RAND_F_FIPS_SET_TEST_MODE = 105; - {$EXTERNALSYM RAND_F_RAND_GET_RAND_METHOD} - RAND_F_RAND_GET_RAND_METHOD = 101; - {$EXTERNALSYM RAND_F_SSLEAY_RAND_BYTES} - RAND_F_SSLEAY_RAND_BYTES = 100; - -//* Reason codes. */ - {$EXTERNALSYM RAND_R_NON_FIPS_METHOD} - RAND_R_NON_FIPS_METHOD = 105; - {$EXTERNALSYM RAND_R_NOT_IN_TEST_MODE} - RAND_R_NOT_IN_TEST_MODE = 106; - {$EXTERNALSYM RAND_R_NO_KEY_SET} - RAND_R_NO_KEY_SET = 107; - {$EXTERNALSYM RAND_R_PRNG_ASKING_FOR_TOO_MUCH} - RAND_R_PRNG_ASKING_FOR_TOO_MUCH = 101; - {$EXTERNALSYM RAND_R_PRNG_ERROR} - RAND_R_PRNG_ERROR = 108; - {$EXTERNALSYM RAND_R_PRNG_KEYED} - RAND_R_PRNG_KEYED = 109; - {$EXTERNALSYM RAND_R_PRNG_NOT_REKEYED} - RAND_R_PRNG_NOT_REKEYED = 102; - {$EXTERNALSYM RAND_R_PRNG_NOT_RESEEDED} - RAND_R_PRNG_NOT_RESEEDED = 103; - {$EXTERNALSYM RAND_R_PRNG_NOT_SEEDED} - RAND_R_PRNG_NOT_SEEDED = 100; - {$EXTERNALSYM RAND_R_PRNG_SEED_MUST_NOT_MATCH_KEY} - RAND_R_PRNG_SEED_MUST_NOT_MATCH_KEY = 110; - {$EXTERNALSYM RAND_R_PRNG_STUCK} - RAND_R_PRNG_STUCK = 104; - - {$EXTERNALSYM B_ASN1_BIT_STRING} - B_ASN1_BIT_STRING = $0400; - {$EXTERNALSYM B_ASN1_BMPSTRING} - B_ASN1_BMPSTRING = $0800; - {$EXTERNALSYM B_ASN1_GENERALSTRING} - B_ASN1_GENERALSTRING = $0080; - {$EXTERNALSYM B_ASN1_GRAPHICSTRING} - B_ASN1_GRAPHICSTRING = $0020; - {$EXTERNALSYM B_ASN1_IA5STRING} - B_ASN1_IA5STRING = $0010; - {$EXTERNALSYM B_ASN1_ISO64STRING} - B_ASN1_ISO64STRING = $0040; - {$EXTERNALSYM B_ASN1_NUMERICSTRING} - B_ASN1_NUMERICSTRING = $0001; - {$EXTERNALSYM B_ASN1_OCTET_STRING} - B_ASN1_OCTET_STRING = $0200; - {$EXTERNALSYM B_ASN1_PRINTABLESTRING} - B_ASN1_PRINTABLESTRING = $0002; - {$EXTERNALSYM B_ASN1_T61STRING} - B_ASN1_T61STRING = $0004; - {$EXTERNALSYM B_ASN1_TELETEXSTRING} - B_ASN1_TELETEXSTRING = $0008; - {$EXTERNALSYM B_ASN1_UNIVERSALSTRING} - B_ASN1_UNIVERSALSTRING = $0100; - {$EXTERNALSYM B_ASN1_UNKNOWN} - B_ASN1_UNKNOWN = $1000; - {$EXTERNALSYM B_ASN1_UTF8STRING} - B_ASN1_UTF8STRING = $2000; - {$EXTERNALSYM B_ASN1_VIDEOTEXSTRING} - B_ASN1_VIDEOTEXSTRING = $0008; - {$EXTERNALSYM B_ASN1_VISIBLESTRING} - B_ASN1_VISIBLESTRING = $0040; - {$EXTERNALSYM B_ASN1_UTCTIME} - B_ASN1_UTCTIME = $4000; - {$EXTERNALSYM B_ASN1_GENERALIZEDTIME} - B_ASN1_GENERALIZEDTIME = $8000; - {$EXTERNALSYM B_ASN1_SEQUENCE} - B_ASN1_SEQUENCE = $10000; - {$EXTERNALSYM B_ASN1_TIME} - B_ASN1_TIME = B_ASN1_UTCTIME or - {$EXTERNALSYM B_ASN1_PRINTABLE} - B_ASN1_GENERALIZEDTIME; - - {$EXTERNALSYM B_ASN1_PRINTABLE} - B_ASN1_PRINTABLE = B_ASN1_NUMERICSTRING or - {$EXTERNALSYM B_ASN1_DIRECTORYSTRING} - B_ASN1_PRINTABLESTRING or - {$EXTERNALSYM B_ASN1_DIRECTORYSTRING} - B_ASN1_T61STRING or - {$EXTERNALSYM B_ASN1_DIRECTORYSTRING} - B_ASN1_IA5STRING or - {$EXTERNALSYM B_ASN1_DIRECTORYSTRING} - B_ASN1_BIT_STRING or - {$EXTERNALSYM B_ASN1_DIRECTORYSTRING} - B_ASN1_UNIVERSALSTRING or - {$EXTERNALSYM B_ASN1_DIRECTORYSTRING} - B_ASN1_BMPSTRING or - {$EXTERNALSYM B_ASN1_DIRECTORYSTRING} - B_ASN1_UTF8STRING or - {$EXTERNALSYM B_ASN1_DIRECTORYSTRING} - B_ASN1_SEQUENCE or - {$EXTERNALSYM B_ASN1_DIRECTORYSTRING} - B_ASN1_UNKNOWN; - {$EXTERNALSYM B_ASN1_DIRECTORYSTRING} - B_ASN1_DIRECTORYSTRING = B_ASN1_PRINTABLESTRING or - {$EXTERNALSYM B_ASN1_DISPLAYTEXT} - B_ASN1_TELETEXSTRING or - {$EXTERNALSYM B_ASN1_DISPLAYTEXT} - B_ASN1_BMPSTRING or - {$EXTERNALSYM B_ASN1_DISPLAYTEXT} - B_ASN1_UNIVERSALSTRING or - {$EXTERNALSYM B_ASN1_DISPLAYTEXT} - B_ASN1_UTF8STRING; - {$EXTERNALSYM B_ASN1_DISPLAYTEXT} - B_ASN1_DISPLAYTEXT = B_ASN1_IA5STRING or - {$EXTERNALSYM MBSTRING_FLAG} - B_ASN1_VISIBLESTRING or - {$EXTERNALSYM MBSTRING_FLAG} - B_ASN1_BMPSTRING or - {$EXTERNALSYM MBSTRING_FLAG} - B_ASN1_UTF8STRING; - {$EXTERNALSYM MBSTRING_FLAG} - MBSTRING_FLAG = $1000; - {$EXTERNALSYM MBSTRING_UTF8} - MBSTRING_UTF8 = MBSTRING_FLAG; - {$EXTERNALSYM MBSTRING_ASC} - MBSTRING_ASC = MBSTRING_FLAG or 1; - {$EXTERNALSYM MBSTRING_BMP} - MBSTRING_BMP = MBSTRING_FLAG or 2; - {$EXTERNALSYM MBSTRING_UNIV} - MBSTRING_UNIV = MBSTRING_FLAG or 4; - {$EXTERNALSYM SMIME_OLDMIME} - SMIME_OLDMIME = $400; - {$EXTERNALSYM SMIME_CRLFEOL} - SMIME_CRLFEOL = $800; - {$EXTERNALSYM SMIME_STREAM} - SMIME_STREAM = $1000; - - {$EXTERNALSYM _CLOCKS_PER_SEC_} - _CLOCKS_PER_SEC_ = 1000; - {$EXTERNALSYM _CLOCKS_PER_SEC_} - {$EXTERNALSYM CLOCKS_PER_SEC} - CLOCKS_PER_SEC = _CLOCKS_PER_SEC_; - {$EXTERNALSYM CLOCKS_PER_SEC} - {$EXTERNALSYM CLK_TCK} - CLK_TCK = CLOCKS_PER_SEC; - {$EXTERNALSYM CLK_TCK} -//* Function codes. */ - {$EXTERNALSYM COMP_F_BIO_ZLIB_FLUSH} - COMP_F_BIO_ZLIB_FLUSH = 99; - {$EXTERNALSYM COMP_F_BIO_ZLIB_NEW} - COMP_F_BIO_ZLIB_NEW = 100; - {$EXTERNALSYM COMP_F_BIO_ZLIB_READ} - COMP_F_BIO_ZLIB_READ = 101; - {$EXTERNALSYM COMP_F_BIO_ZLIB_WRITE} - COMP_F_BIO_ZLIB_WRITE = 102; - -//* Reason codes. */ - {$EXTERNALSYM COMP_R_ZLIB_DEFLATE_ERROR} - COMP_R_ZLIB_DEFLATE_ERROR = 99; - {$EXTERNALSYM COMP_R_ZLIB_INFLATE_ERROR} - COMP_R_ZLIB_INFLATE_ERROR = 100; - {$EXTERNALSYM COMP_R_ZLIB_NOT_SUPPORTED} - COMP_R_ZLIB_NOT_SUPPORTED = 101; - - {$EXTERNALSYM CRYPTO_EX_INDEX_BIO} - CRYPTO_EX_INDEX_BIO = 0; - {$EXTERNALSYM CRYPTO_EX_INDEX_SSL} - CRYPTO_EX_INDEX_SSL = 1; - {$EXTERNALSYM CRYPTO_EX_INDEX_SSL_CTX} - CRYPTO_EX_INDEX_SSL_CTX = 2; - {$EXTERNALSYM CRYPTO_EX_INDEX_SSL_SESSION} - CRYPTO_EX_INDEX_SSL_SESSION = 3; - {$EXTERNALSYM CRYPTO_EX_INDEX_X509_STORE} - CRYPTO_EX_INDEX_X509_STORE = 4; - {$EXTERNALSYM CRYPTO_EX_INDEX_X509_STORE_CTX} - CRYPTO_EX_INDEX_X509_STORE_CTX = 5; - {$EXTERNALSYM CRYPTO_EX_INDEX_RSA} - CRYPTO_EX_INDEX_RSA = 6; - {$EXTERNALSYM CRYPTO_EX_INDEX_DSA} - CRYPTO_EX_INDEX_DSA = 7; - {$EXTERNALSYM CRYPTO_EX_INDEX_DH} - CRYPTO_EX_INDEX_DH = 8; - {$EXTERNALSYM CRYPTO_EX_INDEX_ENGINE} - CRYPTO_EX_INDEX_ENGINE = 9; - {$EXTERNALSYM CRYPTO_EX_INDEX_X509} - CRYPTO_EX_INDEX_X509 = 10; - {$EXTERNALSYM CRYPTO_EX_INDEX_UI} - CRYPTO_EX_INDEX_UI = 11; - {$EXTERNALSYM CRYPTO_EX_INDEX_ECDSA} - CRYPTO_EX_INDEX_ECDSA = 12; - {$EXTERNALSYM CRYPTO_EX_INDEX_ECDH} - CRYPTO_EX_INDEX_ECDH = 13; - {$EXTERNALSYM CRYPTO_EX_INDEX_COMP} - CRYPTO_EX_INDEX_COMP = 14; - {$EXTERNALSYM CRYPTO_EX_INDEX_STORE} - CRYPTO_EX_INDEX_STORE = 15; - {$EXTERNALSYM CRYPTO_EX_INDEX_USER} - CRYPTO_EX_INDEX_USER = 100; - - {$EXTERNALSYM CRYPTO_F_CRYPTO_GET_EX_NEW_INDEX} - CRYPTO_F_CRYPTO_GET_EX_NEW_INDEX = 100; - {$EXTERNALSYM CRYPTO_F_CRYPTO_GET_NEW_DYNLOCKID} - CRYPTO_F_CRYPTO_GET_NEW_DYNLOCKID = 103; - {$EXTERNALSYM CRYPTO_F_CRYPTO_GET_NEW_LOCKID} - CRYPTO_F_CRYPTO_GET_NEW_LOCKID = 101; - {$EXTERNALSYM CRYPTO_F_CRYPTO_SET_EX_DATA} - CRYPTO_F_CRYPTO_SET_EX_DATA = 102; - {$EXTERNALSYM CRYPTO_F_DEF_ADD_INDEX} - CRYPTO_F_DEF_ADD_INDEX = 104; - {$EXTERNALSYM CRYPTO_F_DEF_GET_CLASS} - CRYPTO_F_DEF_GET_CLASS = 105; - {$EXTERNALSYM CRYPTO_F_INT_DUP_EX_DATA} - CRYPTO_F_INT_DUP_EX_DATA = 106; - {$EXTERNALSYM CRYPTO_F_INT_FREE_EX_DATA} - CRYPTO_F_INT_FREE_EX_DATA = 107; - {$EXTERNALSYM CRYPTO_F_INT_NEW_EX_DATA} - CRYPTO_F_INT_NEW_EX_DATA = 108; - {$EXTERNALSYM CRYPTO_R_NO_DYNLOCK_CREATE_CALLBACK} - CRYPTO_R_NO_DYNLOCK_CREATE_CALLBACK = 100; - - {$EXTERNALSYM CRYPTO_LOCK} - CRYPTO_LOCK = 1; - {$EXTERNALSYM CRYPTO_LOCK_ERR} - CRYPTO_LOCK_ERR = 1; - {$EXTERNALSYM CRYPTO_LOCK_ERR_HASH} - CRYPTO_LOCK_ERR_HASH = 2; - {$EXTERNALSYM CRYPTO_LOCK_X509} - CRYPTO_LOCK_X509 = 3; - {$EXTERNALSYM CRYPTO_LOCK_X509_INFO} - CRYPTO_LOCK_X509_INFO = 4; - {$EXTERNALSYM CRYPTO_LOCK_X509_PKEY} - CRYPTO_LOCK_X509_PKEY = 5; - {$EXTERNALSYM CRYPTO_LOCK_X509_CRL} - CRYPTO_LOCK_X509_CRL = 6; - {$EXTERNALSYM CRYPTO_LOCK_X509_REQ} - CRYPTO_LOCK_X509_REQ = 7; - {$EXTERNALSYM CRYPTO_LOCK_DSA} - CRYPTO_LOCK_DSA = 8; - {$EXTERNALSYM CRYPTO_LOCK_RSA} - CRYPTO_LOCK_RSA = 9; - {$EXTERNALSYM CRYPTO_LOCK_EVP_PKEY} - CRYPTO_LOCK_EVP_PKEY = 10; - {$EXTERNALSYM CRYPTO_LOCK_X509_STORE} - CRYPTO_LOCK_X509_STORE = 11; - {$EXTERNALSYM CRYPTO_LOCK_SSL_CTX} - CRYPTO_LOCK_SSL_CTX = 12; - {$EXTERNALSYM CRYPTO_LOCK_SSL_CERT} - CRYPTO_LOCK_SSL_CERT = 13; - {$EXTERNALSYM CRYPTO_LOCK_SSL_SESSION} - CRYPTO_LOCK_SSL_SESSION = 14; - {$EXTERNALSYM CRYPTO_LOCK_SSL_SESS_CERT} - CRYPTO_LOCK_SSL_SESS_CERT = 15; - {$EXTERNALSYM CRYPTO_LOCK_SSL} - CRYPTO_LOCK_SSL = 16; - {$EXTERNALSYM CRYPTO_LOCK_SSL_METHOD} - CRYPTO_LOCK_SSL_METHOD = 17; - {$EXTERNALSYM CRYPTO_LOCK_RAND} - CRYPTO_LOCK_RAND = 18; -// CRYPTO_LOCK_RAND = 17; - {$EXTERNALSYM CRYPTO_LOCK_RAND2} - CRYPTO_LOCK_RAND2 = 19; - {$EXTERNALSYM CRYPTO_LOCK_MALLOC} - CRYPTO_LOCK_MALLOC = 20; -//was CRYPTO_LOCK_MALLOC = 18; - {$EXTERNALSYM CRYPTO_LOCK_BIO} - CRYPTO_LOCK_BIO = 21; -//was CRYPTO_LOCK_BIO = 19; - {$EXTERNALSYM CRYPTO_LOCK_GETHOSTBYNAME} - CRYPTO_LOCK_GETHOSTBYNAME = 22; -//was CRYPTO_LOCK_GETHOSTBYNAME = 20; - {$EXTERNALSYM CRYPTO_LOCK_GETSERVBYNAME} - CRYPTO_LOCK_GETSERVBYNAME = 23; -//was CRYPTO_LOCK_GETSERVBYNAME = 21; - {$EXTERNALSYM CRYPTO_LOCK_READDIR} - CRYPTO_LOCK_READDIR = 24; -//was CRYPTO_LOCK_READDIR = 22; - {$EXTERNALSYM CRYPTO_LOCK_RSA_BLINDING} - CRYPTO_LOCK_RSA_BLINDING = 25; -//was CRYPTO_LOCK_RSA_BLINDING = 23; - {$EXTERNALSYM CRYPTO_LOCK_DH} - CRYPTO_LOCK_DH = 26; - {$EXTERNALSYM CRYPTO_LOCK_MALLOC2} - CRYPTO_LOCK_MALLOC2 = 27; - {$EXTERNALSYM CRYPTO_LOCK_DSO} - CRYPTO_LOCK_DSO = 28; - {$EXTERNALSYM CRYPTO_LOCK_DYNLOCK} - CRYPTO_LOCK_DYNLOCK = 29; - {$EXTERNALSYM CRYPTO_LOCK_ENGINE} - CRYPTO_LOCK_ENGINE = 30; - {$EXTERNALSYM CRYPTO_LOCK_UI} - CRYPTO_LOCK_UI = 31; - {$EXTERNALSYM CRYPTO_LOCK_ECDSA} - CRYPTO_LOCK_ECDSA = 32; - {$EXTERNALSYM CRYPTO_LOCK_EC} - CRYPTO_LOCK_EC = 33; - {$EXTERNALSYM CRYPTO_LOCK_ECDH} - CRYPTO_LOCK_ECDH = 34; - {$EXTERNALSYM CRYPTO_LOCK_BN} - CRYPTO_LOCK_BN = 35; - {$EXTERNALSYM CRYPTO_LOCK_EC_PRE_COMP} - CRYPTO_LOCK_EC_PRE_COMP = 36; - {$EXTERNALSYM CRYPTO_LOCK_STORE} - CRYPTO_LOCK_STORE = 37; - {$EXTERNALSYM CRYPTO_LOCK_COMP} - CRYPTO_LOCK_COMP = 38; - {$IFNDEF OPENSSL_FIPS} - {$EXTERNALSYM CRYPTO_NUM_LOCKS} - CRYPTO_NUM_LOCKS = 39; -// was OPENSSL_CRYPTO_NUM_LOCKS = 24; - {$ELSE} - {$EXTERNALSYM CRYPTO_LOCK_FIPS} - CRYPTO_LOCK_FIPS = 39; - {$EXTERNALSYM CRYPTO_LOCK_FIPS2} - CRYPTO_LOCK_FIPS2 = 40; - {$EXTERNALSYM CRYPTO_NUM_LOCKS} - CRYPTO_NUM_LOCKS = 41; - {$ENDIF} - {$EXTERNALSYM CRYPTO_MEM_CHECK_DISABLE} - CRYPTO_MEM_CHECK_DISABLE = $3; - {$EXTERNALSYM CRYPTO_MEM_CHECK_ENABLE} - CRYPTO_MEM_CHECK_ENABLE = $2; - {$EXTERNALSYM CRYPTO_MEM_CHECK_OFF} - CRYPTO_MEM_CHECK_OFF = $0; - {$EXTERNALSYM CRYPTO_MEM_CHECK_ON} - CRYPTO_MEM_CHECK_ON = $1; - {$EXTERNALSYM CRYPTO_READ} - CRYPTO_READ = 4; - {$EXTERNALSYM CRYPTO_UNLOCK} - CRYPTO_UNLOCK = 2; - {$EXTERNALSYM CRYPTO_WRITE} - CRYPTO_WRITE = 8; - {$EXTERNALSYM V_CRYPTO_MDEBUG_TIME} - V_CRYPTO_MDEBUG_TIME = $1; - {$EXTERNALSYM V_CRYPTO_MDEBUG_THREAD} - V_CRYPTO_MDEBUG_THREAD = $2; - {$IFNDEF OPENSSL_NO_AES} - {$EXTERNALSYM AES_ENCRYPT} - AES_ENCRYPT = 1; - {$EXTERNALSYM AES_DECRYPT} - AES_DECRYPT = 0; - {$EXTERNALSYM AES_MAXNR} - AES_MAXNR = 14; - {$EXTERNALSYM AES_BLOCK_SIZE} - AES_BLOCK_SIZE = 16; - {$ENDIF} -//* These values are used as commands to DSO_ctrl() */ - {$EXTERNALSYM DSO_CTRL_GET_FLAGS} - DSO_CTRL_GET_FLAGS = 1; - {$EXTERNALSYM DSO_CTRL_SET_FLAGS} - DSO_CTRL_SET_FLAGS = 2; - {$EXTERNALSYM DSO_CTRL_OR_FLAGS} - DSO_CTRL_OR_FLAGS = 3; - -///* By default, DSO_load() will translate the provided filename into a form -// * typical for the platform (more specifically the DSO_METHOD) using the -// * dso_name_converter function of the method. Eg. win32 will transform "blah" -// * into "blah.dll", and dlfcn will transform it into "libblah.so". The -// * behaviour can be overriden by setting the name_converter callback in the DSO -// * object (using DSO_set_name_converter()). This callback could even utilise -// * the DSO_METHOD's converter too if it only wants to override behaviour for -// * one or two possible DSO methods. However, the following flag can be set in a -// * DSO to prevent *any* native name-translation at all - eg. if the caller has -// * prompted the user for a path to a driver library so the filename should be -// * interpreted as-is. */ - {$EXTERNALSYM DSO_FLAG_NO_NAME_TRANSLATION} - DSO_FLAG_NO_NAME_TRANSLATION = $01; -///* An extra flag to give if only the extension should be added as -// * translation. This is obviously only of importance on Unix and -// * other operating systems where the translation also may prefix -// * the name with something, like 'lib', and ignored everywhere else. -// * This flag is also ignored if DSO_FLAG_NO_NAME_TRANSLATION is used -// * at the same time. */ - {$EXTERNALSYM DSO_FLAG_NAME_TRANSLATION_EXT_ONLY} - DSO_FLAG_NAME_TRANSLATION_EXT_ONLY = $02; - -///* The following flag controls the translation of symbol names to upper -// * case. This is currently only being implemented for OpenVMS. -// */ - {$EXTERNALSYM DSO_FLAG_UPCASE_SYMBOL} - DSO_FLAG_UPCASE_SYMBOL = $10; - -//* This flag loads the library with public symbols. -// * Meaning: The exported symbols of this library are public -// * to all libraries loaded after this library. -// * At the moment only implemented in unix. -// */ - {$EXTERNALSYM DSO_FLAG_GLOBAL_SYMBOLS} - DSO_FLAG_GLOBAL_SYMBOLS = $20; - //seed.h - {$IFNDEF OPENSSL_NO_SEED} - {$IFDEF AES_LONG} //* look whether we need 'long' to get 32 bits */ - {$DEFINE SEED_LONG} - {$ENDIF} - {$EXTERNALSYM SEED_BLOCK_SIZE} - SEED_BLOCK_SIZE = 16; - {$EXTERNALSYM SEED_KEY_LENGTH} - SEED_KEY_LENGTH = 16; - {$ENDIF} - {$IFNDEF OPENSSL_NO_CAST} - {$EXTERNALSYM CAST_BLOCK} - CAST_BLOCK = 8; - {$EXTERNALSYM CAST_DECRYPT} - CAST_DECRYPT = 0; - {$EXTERNALSYM CAST_ENCRYPT} - CAST_ENCRYPT = 1; - {$EXTERNALSYM CAST_KEY_LENGTH} - CAST_KEY_LENGTH = 16; - {$ENDIF} - {$IFNDEF OPENSSL_NO_DES} - {$EXTERNALSYM DES_CBC_MODE} - DES_CBC_MODE = 0; - {$EXTERNALSYM DES_DECRYPT} - DES_DECRYPT = 0; - {$EXTERNALSYM DES_ENCRYPT} - DES_ENCRYPT = 1; - {$EXTERNALSYM DES_PCBC_MODE} - DES_PCBC_MODE = 1; - {$ENDIF} - {$IFNDEF OPENSSL_NO_DH} - //the OpenSSL developers probably only wanted to make sure this was defined. - {$EXTERNALSYM DH_MAX_MODULUS_BITS} - DH_MAX_MODULUS_BITS = 10000; - {$EXTERNALSYM DH_FIPS_MIN_MODULUS_BITS} - DH_FIPS_MIN_MODULUS_BITS = 1024; - {$EXTERNALSYM DH_FLAG_CACHE_MONT_P} - DH_FLAG_CACHE_MONT_P = $01; - {$EXTERNALSYM DH_FLAG_NO_EXP_CONSTTIME} - DH_FLAG_NO_EXP_CONSTTIME = $02; - {$EXTERNALSYM DH_GENERATOR_2} - DH_GENERATOR_2 = 2; - {$EXTERNALSYM DH_GENERATOR_5} - DH_GENERATOR_5 = 5; - {$EXTERNALSYM DH_CHECK_P_NOT_PRIME} - DH_CHECK_P_NOT_PRIME = $01; - {$EXTERNALSYM DH_CHECK_P_NOT_STRONG_PRIME} - DH_CHECK_P_NOT_STRONG_PRIME = $02; - {$EXTERNALSYM DH_UNABLE_TO_CHECK_GENERATOR} - DH_UNABLE_TO_CHECK_GENERATOR = $04; - {$EXTERNALSYM DH_NOT_SUITABLE_GENERATOR} - DH_NOT_SUITABLE_GENERATOR = $08; - {$EXTERNALSYM DH_CHECK_PUBKEY_TOO_SMALL} - DH_CHECK_PUBKEY_TOO_SMALL = $01; - {$EXTERNALSYM DH_CHECK_PUBKEY_TOO_LARGE} - DH_CHECK_PUBKEY_TOO_LARGE = $02; - {$EXTERNALSYM DH_CHECK_P_NOT_SAFE_PRIME} - DH_CHECK_P_NOT_SAFE_PRIME = DH_CHECK_P_NOT_STRONG_PRIME; - {$EXTERNALSYM DH_F_DHPARAMS_PRINT} - DH_F_DHPARAMS_PRINT = 100; - {$EXTERNALSYM DH_F_DHPARAMS_PRINT_FP} - DH_F_DHPARAMS_PRINT_FP = 101; - {$EXTERNALSYM DH_F_COMPUTE_KEY} - DH_F_COMPUTE_KEY = 102; - {$EXTERNALSYM DH_F_GENERATE_KEY} - DH_F_GENERATE_KEY = 103; - {$EXTERNALSYM DH_F_GENERATE_PARAMETERS} - DH_F_GENERATE_PARAMETERS = 104; - {$EXTERNALSYM DH_F_DH_NEW_METHOD} - DH_F_DH_NEW_METHOD = 105; - {$EXTERNALSYM DH_F_DH_NEW} - DH_F_DH_NEW = 105; - {$EXTERNALSYM DH_F_DH_BUILTIN_GENPARAMS} - DH_F_DH_BUILTIN_GENPARAMS = 106; - {$EXTERNALSYM DH_F_DH_COMPUTE_KEY} - DH_F_DH_COMPUTE_KEY = 107; - //was DH_F_DH_COMPUTE_KEY = 102; - {$EXTERNALSYM DH_F_DH_GENERATE_KEY} - DH_F_DH_GENERATE_KEY = 108; - //was DH_F_DH_GENERATE_KEY = 103; - {$EXTERNALSYM DH_F_DH_GENERATE_PARAMETERS} - DH_F_DH_GENERATE_PARAMETERS = 109; - //was DH_F_DH_GENERATE_PARAMETERS = 104; - {$EXTERNALSYM DH_R_NO_PRIVATE_VALUE} - DH_R_NO_PRIVATE_VALUE = 100; - {$EXTERNALSYM DH_R_BAD_GENERATOR} - DH_R_BAD_GENERATOR = 101; - {$EXTERNALSYM DH_R_INVALID_PUBKEY} - DH_R_INVALID_PUBKEY = 102; - {$EXTERNALSYM DH_R_MODULUS_TOO_LARGE} - DH_R_MODULUS_TOO_LARGE = 103; - {$EXTERNALSYM DH_R_KEY_SIZE_TOO_SMALL} - DH_R_KEY_SIZE_TOO_SMALL = 104; - {$ENDIF} - {$IFNDEF OPENSSL_NO_DSA} - //I think the OpenSSL developers wanted to make sure this was defined. - {$EXTERNALSYM DSA_MAX_MODULUS_BITS} - DSA_MAX_MODULUS_BITS = 10000; - {$EXTERNALSYM DSA_FIPS_MIN_MODULUS_BITS} - DSA_FIPS_MIN_MODULUS_BITS = 1024; - {$EXTERNALSYM DSA_FLAG_CACHE_MONT_P} - DSA_FLAG_CACHE_MONT_P = $01; - {$EXTERNALSYM DSA_FLAG_NO_EXP_CONSTTIME} - DSA_FLAG_NO_EXP_CONSTTIME = $02; //* new with 0.9.7h; the built-in DSA -///* If this flag is set the DSA method is FIPS compliant and can be used -// * in FIPS mode. This is set in the validated module method. If an -// * application sets this flag in its own methods it is its reposibility -// * to ensure the result is compliant. -// */ - {$EXTERNALSYM DSA_FLAG_FIPS_METHOD} - DSA_FLAG_FIPS_METHOD = $0400; -///* If this flag is set the operations normally disabled in FIPS mode are -// * permitted it is then the applications responsibility to ensure that the -// * usage is compliant. -// */ - {$EXTERNALSYM DSA_FLAG_NON_FIPS_ALLOW} - DSA_FLAG_NON_FIPS_ALLOW = $0400; - {$EXTERNALSYM DSA_F_D2I_DSA_SIG} - DSA_F_D2I_DSA_SIG = 110; - {$EXTERNALSYM DSA_F_DSAPARAMS_PRINT} - DSA_F_DSAPARAMS_PRINT = 100; - {$EXTERNALSYM DSA_F_DSAPARAMS_PRINT_FP} - DSA_F_DSAPARAMS_PRINT_FP = 101; - {$EXTERNALSYM DSA_F_DSA_BUILTIN_KEYGEN} - DSA_F_DSA_BUILTIN_KEYGEN = 119; - {$EXTERNALSYM DSA_F_DSA_BUILTIN_PARAMGEN} - DSA_F_DSA_BUILTIN_PARAMGEN = 118; - {$EXTERNALSYM DSA_F_DSA_DO_SIGN} - DSA_F_DSA_DO_SIGN = 112; - {$EXTERNALSYM DSA_F_DSA_DO_VERIFY} - DSA_F_DSA_DO_VERIFY = 113; - {$EXTERNALSYM DSA_F_DSA_IS_PRIME} - DSA_F_DSA_IS_PRIME = 102; - {$EXTERNALSYM DSA_F_DSA_NEW} - DSA_F_DSA_NEW = 103; - {$EXTERNALSYM DSA_F_DSA_PRINT} - DSA_F_DSA_PRINT = 104; - {$EXTERNALSYM DSA_F_DSA_PRINT_FP} - DSA_F_DSA_PRINT_FP = 105; - {$EXTERNALSYM DSA_F_DSA_SIGN} - DSA_F_DSA_SIGN = 106; - {$EXTERNALSYM DSA_F_DSA_SIGN_SETUP} - DSA_F_DSA_SIGN_SETUP = 107; - {$EXTERNALSYM DSA_F_DSA_SIG_NEW} - DSA_F_DSA_SIG_NEW = 109; - {$EXTERNALSYM DSA_F_DSA_VERIFY} - DSA_F_DSA_VERIFY = 108; - {$EXTERNALSYM DSA_F_DSA_GENERATE_PARAMETERS} - DSA_F_DSA_GENERATE_PARAMETERS = 117; - {$EXTERNALSYM DSA_F_I2D_DSA_SIG} - DSA_F_I2D_DSA_SIG = 111; - {$EXTERNALSYM DSA_F_SIG_CB} - DSA_F_SIG_CB = 114; - {$EXTERNALSYM DSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE} - DSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE = 100; - {$EXTERNALSYM DSA_R_MISSING_PARAMETERS} - DSA_R_MISSING_PARAMETERS = 101; - {$EXTERNALSYM DSA_R_BAD_Q_VALUE} - DSA_R_BAD_Q_VALUE = 102; - {$EXTERNALSYM DSA_R_MODULUS_TOO_LARGE} - DSA_R_MODULUS_TOO_LARGE = 103; - {$EXTERNALSYM DSA_R_NON_FIPS_METHOD} - DSA_R_NON_FIPS_METHOD = 104; - {$EXTERNALSYM DSA_R_OPERATION_NOT_ALLOWED_IN_FIPS_MODE} - DSA_R_OPERATION_NOT_ALLOWED_IN_FIPS_MODE = 105; - {$EXTERNALSYM DSA_R_KEY_SIZE_TOO_SMALL} - DSA_R_KEY_SIZE_TOO_SMALL = 106; - {$ENDIF} - {$IFNDEF NO_EC} - {$EXTERNALSYM ECC_MAX_FIELD_BITS} - ECC_MAX_FIELD_BITS = 661; - {$EXTERNALSYM EC_NAMED_CURVE} - EC_NAMED_CURVE = $001; - {$EXTERNALSYM POINT_CONVERSION_COMPRESSED} - POINT_CONVERSION_COMPRESSED = 2; - {$EXTERNALSYM POINT_CONVERSION_UNCOMPRESSED} - POINT_CONVERSION_UNCOMPRESSED = 4; - {$EXTERNALSYM POINT_CONVERSION_HYBRID} - POINT_CONVERSION_HYBRID = 6; - {$EXTERNALSYM EC_PKEY_NO_PARAMETERS} - EC_PKEY_NO_PARAMETERS = $001; - {$EXTERNALSYM EC_PKEY_NO_PUBKEY} - EC_PKEY_NO_PUBKEY = $002; -//* Error codes for the EC functions. */ -//* Function codes. */ - {$EXTERNALSYM EC_F_COMPUTE_WNAF} - EC_F_COMPUTE_WNAF = 143; - {$EXTERNALSYM EC_F_D2I_ECPARAMETERS} - EC_F_D2I_ECPARAMETERS = 144; - {$EXTERNALSYM EC_F_D2I_ECPKPARAMETERS} - EC_F_D2I_ECPKPARAMETERS = 145; - {$EXTERNALSYM EC_F_D2I_ECPRIVATEKEY} - EC_F_D2I_ECPRIVATEKEY = 146; - {$EXTERNALSYM EC_F_ECPARAMETERS_PRINT} - EC_F_ECPARAMETERS_PRINT = 147; - {$EXTERNALSYM EC_F_ECPARAMETERS_PRINT_FP} - EC_F_ECPARAMETERS_PRINT_FP = 148; - {$EXTERNALSYM EC_F_ECPKPARAMETERS_PRINT} - EC_F_ECPKPARAMETERS_PRINT = 149; - {$EXTERNALSYM EC_F_ECPKPARAMETERS_PRINT_FP} - EC_F_ECPKPARAMETERS_PRINT_FP = 150; - {$EXTERNALSYM EC_F_ECP_NIST_MOD_192} - EC_F_ECP_NIST_MOD_192 = 203; - {$EXTERNALSYM EC_F_ECP_NIST_MOD_224} - EC_F_ECP_NIST_MOD_224 = 204; - {$EXTERNALSYM EC_F_ECP_NIST_MOD_256} - EC_F_ECP_NIST_MOD_256 = 205; - {$EXTERNALSYM EC_F_ECP_NIST_MOD_521} - EC_F_ECP_NIST_MOD_521 = 206; - {$EXTERNALSYM EC_F_EC_ASN1_GROUP2CURVE} - EC_F_EC_ASN1_GROUP2CURVE = 153; - {$EXTERNALSYM EC_F_EC_ASN1_GROUP2FIELDID} - EC_F_EC_ASN1_GROUP2FIELDID = 154; - {$EXTERNALSYM EC_F_EC_ASN1_GROUP2PARAMETERS} - EC_F_EC_ASN1_GROUP2PARAMETERS = 155; - {$EXTERNALSYM EC_F_EC_ASN1_GROUP2PKPARAMETERS} - EC_F_EC_ASN1_GROUP2PKPARAMETERS = 156; - {$EXTERNALSYM EC_F_EC_ASN1_PARAMETERS2GROUP} - EC_F_EC_ASN1_PARAMETERS2GROUP = 157; - {$EXTERNALSYM EC_F_EC_ASN1_PKPARAMETERS2GROUP} - EC_F_EC_ASN1_PKPARAMETERS2GROUP = 158; - {$EXTERNALSYM EC_F_EC_EX_DATA_SET_DATA} - EC_F_EC_EX_DATA_SET_DATA = 211; - {$EXTERNALSYM EC_F_EC_GF2M_MONTGOMERY_POINT_MULTIPLY} - EC_F_EC_GF2M_MONTGOMERY_POINT_MULTIPLY = 208; - {$EXTERNALSYM EC_F_EC_GF2M_SIMPLE_GROUP_CHECK_DISCRIMINANT} - EC_F_EC_GF2M_SIMPLE_GROUP_CHECK_DISCRIMINANT = 159; - {$EXTERNALSYM EC_F_EC_GF2M_SIMPLE_GROUP_SET_CURVE} - EC_F_EC_GF2M_SIMPLE_GROUP_SET_CURVE = 195; - {$EXTERNALSYM EC_F_EC_GF2M_SIMPLE_OCT2POINT} - EC_F_EC_GF2M_SIMPLE_OCT2POINT = 160; - {$EXTERNALSYM EC_F_EC_GF2M_SIMPLE_POINT2OCT} - EC_F_EC_GF2M_SIMPLE_POINT2OCT = 161; - {$EXTERNALSYM EC_F_EC_GF2M_SIMPLE_POINT_GET_AFFINE_COORDINATES} - EC_F_EC_GF2M_SIMPLE_POINT_GET_AFFINE_COORDINATES = 162; - {$EXTERNALSYM EC_F_EC_GF2M_SIMPLE_POINT_SET_AFFINE_COORDINATES} - EC_F_EC_GF2M_SIMPLE_POINT_SET_AFFINE_COORDINATES = 163; - {$EXTERNALSYM EC_F_EC_GF2M_SIMPLE_SET_COMPRESSED_COORDINATES} - EC_F_EC_GF2M_SIMPLE_SET_COMPRESSED_COORDINATES = 164; - {$EXTERNALSYM EC_F_EC_GFP_MONT_FIELD_DECODE} - EC_F_EC_GFP_MONT_FIELD_DECODE = 133; - {$EXTERNALSYM EC_F_EC_GFP_MONT_FIELD_ENCODE} - EC_F_EC_GFP_MONT_FIELD_ENCODE = 134; - {$EXTERNALSYM EC_F_EC_GFP_MONT_FIELD_MUL} - EC_F_EC_GFP_MONT_FIELD_MUL = 131; - {$EXTERNALSYM EC_F_EC_GFP_MONT_FIELD_SET_TO_ONE} - EC_F_EC_GFP_MONT_FIELD_SET_TO_ONE = 209; - {$EXTERNALSYM EC_F_EC_GFP_MONT_FIELD_SQR} - EC_F_EC_GFP_MONT_FIELD_SQR = 132; - {$EXTERNALSYM EC_F_EC_GFP_MONT_GROUP_SET_CURVE} - EC_F_EC_GFP_MONT_GROUP_SET_CURVE = 189; - {$EXTERNALSYM EC_F_EC_GFP_MONT_GROUP_SET_CURVE_GFP} - EC_F_EC_GFP_MONT_GROUP_SET_CURVE_GFP = 135; - {$EXTERNALSYM EC_F_EC_GFP_NIST_FIELD_MUL} - EC_F_EC_GFP_NIST_FIELD_MUL = 200; - {$EXTERNALSYM EC_F_EC_GFP_NIST_FIELD_SQR} - EC_F_EC_GFP_NIST_FIELD_SQR = 201; - {$EXTERNALSYM EC_F_EC_GFP_NIST_GROUP_SET_CURVE} - EC_F_EC_GFP_NIST_GROUP_SET_CURVE = 202; - {$EXTERNALSYM EC_F_EC_GFP_SIMPLE_GROUP_CHECK_DISCRIMINANT} - EC_F_EC_GFP_SIMPLE_GROUP_CHECK_DISCRIMINANT = 165; - {$EXTERNALSYM EC_F_EC_GFP_SIMPLE_GROUP_SET_CURVE} - EC_F_EC_GFP_SIMPLE_GROUP_SET_CURVE = 166; - {$EXTERNALSYM EC_F_EC_GFP_SIMPLE_GROUP_SET_CURVE_GFP} - EC_F_EC_GFP_SIMPLE_GROUP_SET_CURVE_GFP = 100; - {$EXTERNALSYM EC_F_EC_GFP_SIMPLE_GROUP_SET_GENERATOR} - EC_F_EC_GFP_SIMPLE_GROUP_SET_GENERATOR = 101; - {$EXTERNALSYM EC_F_EC_GFP_SIMPLE_MAKE_AFFINE} - EC_F_EC_GFP_SIMPLE_MAKE_AFFINE = 102; - {$EXTERNALSYM EC_F_EC_GFP_SIMPLE_OCT2POINT} - EC_F_EC_GFP_SIMPLE_OCT2POINT = 103; - {$EXTERNALSYM EC_F_EC_GFP_SIMPLE_POINT2OCT} - EC_F_EC_GFP_SIMPLE_POINT2OCT = 104; - {$EXTERNALSYM EC_F_EC_GFP_SIMPLE_POINTS_MAKE_AFFINE} - EC_F_EC_GFP_SIMPLE_POINTS_MAKE_AFFINE = 137; - {$EXTERNALSYM EC_F_EC_GFP_SIMPLE_POINT_GET_AFFINE_COORDINATES} - EC_F_EC_GFP_SIMPLE_POINT_GET_AFFINE_COORDINATES = 167; - {$EXTERNALSYM EC_F_EC_GFP_SIMPLE_POINT_GET_AFFINE_COORDINATES_GFP} - EC_F_EC_GFP_SIMPLE_POINT_GET_AFFINE_COORDINATES_GFP = 105; - {$EXTERNALSYM EC_F_EC_GFP_SIMPLE_POINT_SET_AFFINE_COORDINATES} - EC_F_EC_GFP_SIMPLE_POINT_SET_AFFINE_COORDINATES = 168; - {$EXTERNALSYM EC_F_EC_GFP_SIMPLE_POINT_SET_AFFINE_COORDINATES_GFP} - EC_F_EC_GFP_SIMPLE_POINT_SET_AFFINE_COORDINATES_GFP = 128; - {$EXTERNALSYM EC_F_EC_GFP_SIMPLE_SET_COMPRESSED_COORDINATES} - EC_F_EC_GFP_SIMPLE_SET_COMPRESSED_COORDINATES = 169; - {$EXTERNALSYM EC_F_EC_GFP_SIMPLE_SET_COMPRESSED_COORDINATES_GFP} - EC_F_EC_GFP_SIMPLE_SET_COMPRESSED_COORDINATES_GFP = 129; - {$EXTERNALSYM EC_F_EC_GROUP_CHECK} - EC_F_EC_GROUP_CHECK = 170; - {$EXTERNALSYM EC_F_EC_GROUP_CHECK_DISCRIMINANT} - EC_F_EC_GROUP_CHECK_DISCRIMINANT = 171; - {$EXTERNALSYM EC_F_EC_GROUP_COPY} - EC_F_EC_GROUP_COPY = 106; - {$EXTERNALSYM EC_F_EC_GROUP_GET0_GENERATOR} - EC_F_EC_GROUP_GET0_GENERATOR = 139; - {$EXTERNALSYM EC_F_EC_GROUP_GET_COFACTOR} - EC_F_EC_GROUP_GET_COFACTOR = 140; - {$EXTERNALSYM EC_F_EC_GROUP_GET_CURVE_GF2M} - EC_F_EC_GROUP_GET_CURVE_GF2M = 172; - {$EXTERNALSYM EC_F_EC_GROUP_GET_CURVE_GFP} - EC_F_EC_GROUP_GET_CURVE_GFP = 130; - {$EXTERNALSYM EC_F_EC_GROUP_GET_DEGREE} - EC_F_EC_GROUP_GET_DEGREE = 173; - {$EXTERNALSYM EC_F_EC_GROUP_GET_ORDER} - EC_F_EC_GROUP_GET_ORDER = 141; - {$EXTERNALSYM EC_F_EC_GROUP_GET_PENTANOMIAL_BASIS} - EC_F_EC_GROUP_GET_PENTANOMIAL_BASIS = 193; - {$EXTERNALSYM EC_F_EC_GROUP_GET_TRINOMIAL_BASIS} - EC_F_EC_GROUP_GET_TRINOMIAL_BASIS = 194; - {$EXTERNALSYM EC_F_EC_GROUP_NEW} - EC_F_EC_GROUP_NEW = 108; - {$EXTERNALSYM EC_F_EC_GROUP_NEW_BY_CURVE_NAME} - EC_F_EC_GROUP_NEW_BY_CURVE_NAME = 174; - {$EXTERNALSYM EC_F_EC_GROUP_NEW_FROM_DATA} - EC_F_EC_GROUP_NEW_FROM_DATA = 175; - {$EXTERNALSYM EC_F_EC_GROUP_PRECOMPUTE_MULT} - EC_F_EC_GROUP_PRECOMPUTE_MULT = 142; - {$EXTERNALSYM EC_F_EC_GROUP_SET_CURVE_GF2M} - EC_F_EC_GROUP_SET_CURVE_GF2M = 176; - {$EXTERNALSYM EC_F_EC_GROUP_SET_CURVE_GFP} - EC_F_EC_GROUP_SET_CURVE_GFP = 109; - {$EXTERNALSYM EC_F_EC_GROUP_SET_EXTRA_DATA} - EC_F_EC_GROUP_SET_EXTRA_DATA = 110; - {$EXTERNALSYM EC_F_EC_GROUP_SET_GENERATOR} - EC_F_EC_GROUP_SET_GENERATOR = 111; - {$EXTERNALSYM EC_F_EC_KEY_CHECK_KEY} - EC_F_EC_KEY_CHECK_KEY = 177; - {$EXTERNALSYM EC_F_EC_KEY_COPY} - EC_F_EC_KEY_COPY = 178; - {$EXTERNALSYM EC_F_EC_KEY_GENERATE_KEY} - EC_F_EC_KEY_GENERATE_KEY = 179; - {$EXTERNALSYM EC_F_EC_KEY_NEW} - EC_F_EC_KEY_NEW = 182; - {$EXTERNALSYM EC_F_EC_KEY_PRINT} - EC_F_EC_KEY_PRINT = 180; - {$EXTERNALSYM EC_F_EC_KEY_PRINT_FP} - EC_F_EC_KEY_PRINT_FP = 181; - {$EXTERNALSYM EC_F_EC_POINTS_MAKE_AFFINE} - EC_F_EC_POINTS_MAKE_AFFINE = 136; - {$EXTERNALSYM EC_F_EC_POINTS_MUL} - EC_F_EC_POINTS_MUL = 138; - {$EXTERNALSYM EC_F_EC_POINT_ADD} - EC_F_EC_POINT_ADD = 112; - {$EXTERNALSYM EC_F_EC_POINT_CMP} - EC_F_EC_POINT_CMP = 113; - {$EXTERNALSYM EC_F_EC_POINT_COPY} - EC_F_EC_POINT_COPY = 114; - {$EXTERNALSYM EC_F_EC_POINT_DBL} - EC_F_EC_POINT_DBL = 115; - {$EXTERNALSYM EC_F_EC_POINT_GET_AFFINE_COORDINATES_GF2M} - EC_F_EC_POINT_GET_AFFINE_COORDINATES_GF2M = 183; - {$EXTERNALSYM EC_F_EC_POINT_GET_AFFINE_COORDINATES_GFP} - EC_F_EC_POINT_GET_AFFINE_COORDINATES_GFP = 116; - {$EXTERNALSYM EC_F_EC_POINT_GET_JPROJECTIVE_COORDINATES_GFP} - EC_F_EC_POINT_GET_JPROJECTIVE_COORDINATES_GFP = 117; - {$EXTERNALSYM EC_F_EC_POINT_INVERT} - EC_F_EC_POINT_INVERT = 210; - {$EXTERNALSYM EC_F_EC_POINT_IS_AT_INFINITY} - EC_F_EC_POINT_IS_AT_INFINITY = 118; - {$EXTERNALSYM EC_F_EC_POINT_IS_ON_CURVE} - EC_F_EC_POINT_IS_ON_CURVE = 119; - {$EXTERNALSYM EC_F_EC_POINT_MAKE_AFFINE} - EC_F_EC_POINT_MAKE_AFFINE = 120; - {$EXTERNALSYM EC_F_EC_POINT_MUL} - EC_F_EC_POINT_MUL = 184; - {$EXTERNALSYM EC_F_EC_POINT_NEW} - EC_F_EC_POINT_NEW = 121; - {$EXTERNALSYM EC_F_EC_POINT_OCT2POINT} - EC_F_EC_POINT_OCT2POINT = 122; - {$EXTERNALSYM EC_F_EC_POINT_POINT2OCT} - EC_F_EC_POINT_POINT2OCT = 123; - {$EXTERNALSYM EC_F_EC_POINT_SET_AFFINE_COORDINATES_GF2M} - EC_F_EC_POINT_SET_AFFINE_COORDINATES_GF2M = 185; - {$EXTERNALSYM EC_F_EC_POINT_SET_AFFINE_COORDINATES_GFP} - EC_F_EC_POINT_SET_AFFINE_COORDINATES_GFP = 124; - {$EXTERNALSYM EC_F_EC_POINT_SET_COMPRESSED_COORDINATES_GF2M} - EC_F_EC_POINT_SET_COMPRESSED_COORDINATES_GF2M = 186; - {$EXTERNALSYM EC_F_EC_POINT_SET_COMPRESSED_COORDINATES_GFP} - EC_F_EC_POINT_SET_COMPRESSED_COORDINATES_GFP = 125; - {$EXTERNALSYM EC_F_EC_POINT_SET_JPROJECTIVE_COORDINATES_GFP} - EC_F_EC_POINT_SET_JPROJECTIVE_COORDINATES_GFP = 126; - {$EXTERNALSYM EC_F_EC_POINT_SET_TO_INFINITY} - EC_F_EC_POINT_SET_TO_INFINITY = 127; - {$EXTERNALSYM EC_F_EC_PRE_COMP_DUP} - EC_F_EC_PRE_COMP_DUP = 207; - {$EXTERNALSYM EC_F_EC_PRE_COMP_NEW} - EC_F_EC_PRE_COMP_NEW = 196; - {$EXTERNALSYM EC_F_EC_WNAF_MUL} - EC_F_EC_WNAF_MUL = 187; - {$EXTERNALSYM EC_F_EC_WNAF_PRECOMPUTE_MULT} - EC_F_EC_WNAF_PRECOMPUTE_MULT = 188; - {$EXTERNALSYM EC_F_I2D_ECPARAMETERS} - EC_F_I2D_ECPARAMETERS = 190; - {$EXTERNALSYM EC_F_I2D_ECPKPARAMETERS} - EC_F_I2D_ECPKPARAMETERS = 191; - {$EXTERNALSYM EC_F_I2D_ECPRIVATEKEY} - EC_F_I2D_ECPRIVATEKEY = 192; - {$EXTERNALSYM EC_F_I2O_ECPUBLICKEY} - EC_F_I2O_ECPUBLICKEY = 151; - {$EXTERNALSYM EC_F_O2I_ECPUBLICKEY} - EC_F_O2I_ECPUBLICKEY = 152; -//* Reason codes. */ - {$EXTERNALSYM EC_R_ASN1_ERROR} - EC_R_ASN1_ERROR = 115; - {$EXTERNALSYM EC_R_ASN1_UNKNOWN_FIELD} - EC_R_ASN1_UNKNOWN_FIELD = 116; - {$EXTERNALSYM EC_R_BUFFER_TOO_SMALL} - EC_R_BUFFER_TOO_SMALL = 100; - {$EXTERNALSYM EC_R_D2I_ECPKPARAMETERS_FAILURE} - EC_R_D2I_ECPKPARAMETERS_FAILURE = 117; - {$EXTERNALSYM EC_R_DISCRIMINANT_IS_ZERO} - EC_R_DISCRIMINANT_IS_ZERO = 118; - {$EXTERNALSYM EC_R_EC_GROUP_NEW_BY_NAME_FAILURE} - EC_R_EC_GROUP_NEW_BY_NAME_FAILURE = 119; - {$EXTERNALSYM EC_R_FIELD_TOO_LARGE} - EC_R_FIELD_TOO_LARGE = 138; - {$EXTERNALSYM EC_R_GROUP2PKPARAMETERS_FAILURE} - EC_R_GROUP2PKPARAMETERS_FAILURE = 120; - {$EXTERNALSYM EC_R_I2D_ECPKPARAMETERS_FAILURE} - EC_R_I2D_ECPKPARAMETERS_FAILURE = 121; - {$EXTERNALSYM EC_R_INCOMPATIBLE_OBJECTS} - EC_R_INCOMPATIBLE_OBJECTS = 101; - {$EXTERNALSYM EC_R_INVALID_ARGUMENT} - EC_R_INVALID_ARGUMENT = 112; - {$EXTERNALSYM EC_R_INVALID_COMPRESSED_POINT} - EC_R_INVALID_COMPRESSED_POINT = 110; - {$EXTERNALSYM EC_R_INVALID_COMPRESSION_BIT} - EC_R_INVALID_COMPRESSION_BIT = 109; - {$EXTERNALSYM EC_R_INVALID_ENCODING} - EC_R_INVALID_ENCODING = 102; - {$EXTERNALSYM EC_R_INVALID_FIELD} - EC_R_INVALID_FIELD = 103; - {$EXTERNALSYM EC_R_INVALID_FORM} - EC_R_INVALID_FORM = 104; - {$EXTERNALSYM EC_R_INVALID_GROUP_ORDER} - EC_R_INVALID_GROUP_ORDER = 122; - {$EXTERNALSYM EC_R_INVALID_PENTANOMIAL_BASIS} - EC_R_INVALID_PENTANOMIAL_BASIS = 132; - {$EXTERNALSYM EC_R_INVALID_PRIVATE_KEY} - EC_R_INVALID_PRIVATE_KEY = 123; - {$EXTERNALSYM EC_R_INVALID_TRINOMIAL_BASIS} - EC_R_INVALID_TRINOMIAL_BASIS = 137; - {$EXTERNALSYM EC_R_MISSING_PARAMETERS} - EC_R_MISSING_PARAMETERS = 124; - {$EXTERNALSYM EC_R_MISSING_PRIVATE_KEY} - EC_R_MISSING_PRIVATE_KEY = 125; - {$EXTERNALSYM EC_R_NOT_A_NIST_PRIME} - EC_R_NOT_A_NIST_PRIME = 135; - {$EXTERNALSYM EC_R_NOT_A_SUPPORTED_NIST_PRIME} - EC_R_NOT_A_SUPPORTED_NIST_PRIME = 136; - {$EXTERNALSYM EC_R_NOT_IMPLEMENTED} - EC_R_NOT_IMPLEMENTED = 126; - {$EXTERNALSYM EC_R_NOT_INITIALIZED} - EC_R_NOT_INITIALIZED = 111; - {$EXTERNALSYM EC_R_NO_FIELD_MOD} - EC_R_NO_FIELD_MOD = 133; - {$EXTERNALSYM EC_R_PASSED_NULL_PARAMETER} - EC_R_PASSED_NULL_PARAMETER = 134; - {$EXTERNALSYM EC_R_PKPARAMETERS2GROUP_FAILURE} - EC_R_PKPARAMETERS2GROUP_FAILURE = 127; - {$EXTERNALSYM EC_R_POINT_AT_INFINITY} - EC_R_POINT_AT_INFINITY = 106; - {$EXTERNALSYM EC_R_POINT_IS_NOT_ON_CURVE} - EC_R_POINT_IS_NOT_ON_CURVE = 107; - {$EXTERNALSYM EC_R_SLOT_FULL} - EC_R_SLOT_FULL = 108; - {$EXTERNALSYM EC_R_UNDEFINED_GENERATOR} - EC_R_UNDEFINED_GENERATOR = 113; - {$EXTERNALSYM EC_R_UNDEFINED_ORDER} - EC_R_UNDEFINED_ORDER = 128; - {$EXTERNALSYM EC_R_UNKNOWN_GROUP} - EC_R_UNKNOWN_GROUP = 129; - {$EXTERNALSYM EC_R_UNKNOWN_ORDER} - EC_R_UNKNOWN_ORDER = 114; - {$EXTERNALSYM EC_R_UNSUPPORTED_FIELD} - EC_R_UNSUPPORTED_FIELD = 131; - {$EXTERNALSYM EC_R_WRONG_ORDER} - EC_R_WRONG_ORDER = 130; - {$ENDIF} - {$IFNDEF OPENSSL_NO_ECDSA} - {$EXTERNALSYM ECDSA_F_ECDSA_DATA_NEW_METHOD} - ECDSA_F_ECDSA_DATA_NEW_METHOD = 100; - {$EXTERNALSYM ECDSA_F_ECDSA_DO_SIGN} - ECDSA_F_ECDSA_DO_SIGN = 101; - {$EXTERNALSYM ECDSA_F_ECDSA_DO_VERIFY} - ECDSA_F_ECDSA_DO_VERIFY = 102; - {$EXTERNALSYM ECDSA_F_ECDSA_SIGN_SETUP} - ECDSA_F_ECDSA_SIGN_SETUP = 103; - {$EXTERNALSYM ECDSA_R_BAD_SIGNATURE} - ECDSA_R_BAD_SIGNATURE = 100; - {$EXTERNALSYM ECDSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE} - ECDSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE = 101; - {$EXTERNALSYM ECDSA_R_ERR_EC_LIB} - ECDSA_R_ERR_EC_LIB = 102; - {$EXTERNALSYM ECDSA_R_MISSING_PARAMETERS} - ECDSA_R_MISSING_PARAMETERS = 103; - {$EXTERNALSYM ECDSA_R_RANDOM_NUMBER_GENERATION_FAILED} - ECDSA_R_RANDOM_NUMBER_GENERATION_FAILED = 104; - {$EXTERNALSYM ECDSA_R_SIGNATURE_MALLOC_FAILED} - ECDSA_R_SIGNATURE_MALLOC_FAILED = 105; - {$ENDIF} - {$IFNDEF OPENSSL_NO_ECDH} - {$EXTERNALSYM ECDH_F_ECDH_COMPUTE_KEY} - ECDH_F_ECDH_COMPUTE_KEY = 100; - {$EXTERNALSYM ECDH_F_ECDH_DATA_NEW_METHOD} - ECDH_F_ECDH_DATA_NEW_METHOD = 101; - {$EXTERNALSYM ECDH_R_KDF_FAILED} - ECDH_R_KDF_FAILED = 102; - {$EXTERNALSYM ECDH_R_NO_PRIVATE_VALUE} - ECDH_R_NO_PRIVATE_VALUE = 100; - {$EXTERNALSYM ECDH_R_POINT_ARITHMETIC_FAILURE} - ECDH_R_POINT_ARITHMETIC_FAILURE = 101; - {$ENDIF} - {$IFNDEF OPENSSL_NO_BF} - {$EXTERNALSYM BF_BLOCK} - BF_BLOCK = 8; - {$EXTERNALSYM BF_DECRYPT} - BF_DECRYPT = 0; - {$EXTERNALSYM BF_ENCRYPT} - BF_ENCRYPT = 1; - {$EXTERNALSYM BF_ROUNDS} - BF_ROUNDS = 16; - {$ENDIF} - {$EXTERNALSYM EVP_MAX_MD_SIZE} - EVP_MAX_MD_SIZE = 64; //* longest known is SHA512 */ - value I found, 16+20; - {$EXTERNALSYM EVP_MAX_KEY_LENGTH} - EVP_MAX_KEY_LENGTH = 32; //value I found, 24; - {$EXTERNALSYM EVP_MAX_IV_LENGTH} - EVP_MAX_IV_LENGTH = 16; //value I found, 8; - {$EXTERNALSYM EVP_MAX_BLOCK_LENGTH} - EVP_MAX_BLOCK_LENGTH=32; - {$EXTERNALSYM NID_dhKeyAgreement} - NID_dhKeyAgreement = 28; - - {$EXTERNALSYM NID_dsa} - NID_dsa = 116; - - {$EXTERNALSYM NID_dsa_2} - NID_dsa_2 = 67; - - {$EXTERNALSYM NID_dsaWithSHA} - NID_dsaWithSHA = 66; - - {$EXTERNALSYM NID_dsaWithSHA1} - NID_dsaWithSHA1 = 113; - - {$EXTERNALSYM NID_dsaWithSHA1_2} - NID_dsaWithSHA1_2 = 70; - - {$EXTERNALSYM EVP_PKEY_MO_SIGN} - EVP_PKEY_MO_SIGN = $0001; - {$EXTERNALSYM EVP_PKEY_MO_VERIFY} - EVP_PKEY_MO_VERIFY = $0002; - - {$EXTERNALSYM EVP_PKEY_MO_ENCRYPT} - EVP_PKEY_MO_ENCRYPT = $0004; - {$EXTERNALSYM EVP_PKEY_MO_DECRYPT} - EVP_PKEY_MO_DECRYPT = $0008; - - {$EXTERNALSYM EVP_MD_FLAG_FIPS} - EVP_MD_FLAG_FIPS = $0400; - //* Note if suitable for use in FIPS mode */ - {$EXTERNALSYM EVP_MD_FLAG_PKEY_DIGEST} - EVP_MD_FLAG_PKEY_DIGEST = $0002; //* digest is a "clone" digest used -// * which is a copy of an existing -// * one for a specific public key type. -// * EVP_dss1() etc */ -//* Digest uses EVP_PKEY_METHOD for signing instead of MD specific signing */ - - {$EXTERNALSYM EVP_MD_FLAG_PKEY_METHOD_SIGNATURE} - EVP_MD_FLAG_PKEY_METHOD_SIGNATURE = $0004; //note: conflicts with FIPS - -//* DigestAlgorithmIdentifier flags... */ - - {$EXTERNALSYM EVP_MD_FLAG_DIGALGID_MASK} - EVP_MD_FLAG_DIGALGID_MASK = $0018; - -//* NULL or absent parameter accepted. Use NULL */ - - {$EXTERNALSYM EVP_MD_FLAG_DIGALGID_NULL} - EVP_MD_FLAG_DIGALGID_NULL = $0000; - -//* NULL or absent parameter accepted. Use NULL for PKCS#1 otherwise absent */ - - {$EXTERNALSYM EVP_MD_FLAG_DIGALGID_ABSENT} - EVP_MD_FLAG_DIGALGID_ABSENT = $0008; - -//* Custom handling via ctrl */ - - {$EXTERNALSYM EVP_MD_FLAG_DIGALGID_CUSTOM} - EVP_MD_FLAG_DIGALGID_CUSTOM = $0018; - - {$EXTERNALSYM EVP_MD_FLAG_SVCTX} - EVP_MD_FLAG_SVCTX = $0800; - //* pass EVP_MD_SVCTX to sign/verify */ - -//* Digest ctrls */ - - {$EXTERNALSYM EVP_MD_CTRL_DIGALGID} - EVP_MD_CTRL_DIGALGID = $1; - {$EXTERNALSYM EVP_MD_CTRL_MICALG} - EVP_MD_CTRL_MICALG = $2; - -//* Minimum Algorithm specific ctrl value */ - - {$EXTERNALSYM EVP_MD_CTRL_ALG_CTRL} - EVP_MD_CTRL_ALG_CTRL = $1000; - - {$EXTERNALSYM NID_undef} - NID_undef = 0; - {$EXTERNALSYM NID_rsaEncryption} - NID_rsaEncryption = 6; - {$EXTERNALSYM NID_rsa} - NID_rsa = 19; - {$EXTERNALSYM NID_X9_62_id_ecPublicKey} - NID_X9_62_id_ecPublicKey = 408; - - {$EXTERNALSYM EVP_PKEY_NONE} - EVP_PKEY_NONE = NID_undef; - {$EXTERNALSYM EVP_PKEY_RSA} - EVP_PKEY_RSA = NID_rsaEncryption; - {$EXTERNALSYM EVP_PKEY_RSA2} - EVP_PKEY_RSA2 = NID_rsa; - {$EXTERNALSYM EVP_PKEY_DSA} - EVP_PKEY_DSA = NID_dsa; - {$EXTERNALSYM EVP_PKEY_DSA1} - EVP_PKEY_DSA1 = NID_dsa_2; - {$EXTERNALSYM EVP_PKEY_DSA2} - EVP_PKEY_DSA2 = NID_dsaWithSHA; - {$EXTERNALSYM EVP_PKEY_DSA3} - EVP_PKEY_DSA3 = NID_dsaWithSHA1; - {$EXTERNALSYM EVP_PKEY_DSA4} - EVP_PKEY_DSA4 = NID_dsaWithSHA1_2; - - {$EXTERNALSYM EVP_PKEY_DH} - EVP_PKEY_DH = NID_dhKeyAgreement; - {$EXTERNALSYM EVP_PKEY_EC} - EVP_PKEY_EC = NID_X9_62_id_ecPublicKey; - - {$EXTERNALSYM EVP_PKT_SIGN} - EVP_PKT_SIGN = $0010; - {$EXTERNALSYM EVP_PKT_ENC} - EVP_PKT_ENC = $0020; - {$EXTERNALSYM EVP_PKT_EXCH} - EVP_PKT_EXCH = $0040; - {$EXTERNALSYM EVP_PKT_EXP} - EVP_PKT_EXP = $1000; - - {$EXTERNALSYM EVP_PKS_RSA} - EVP_PKS_RSA = $0100; - {$EXTERNALSYM EVP_PKS_DSA} - EVP_PKS_DSA = $0200; - {$EXTERNALSYM EVP_PKS_EC} - EVP_PKS_EC = $0400; - - {$EXTERNALSYM EVP_PK_RSA} - EVP_PK_RSA = $0001; - {$EXTERNALSYM EVP_PK_DSA} - EVP_PK_DSA = $0002; - {$EXTERNALSYM EVP_PK_DH} - EVP_PK_DH = $0004; - {$EXTERNALSYM EVP_PK_EC} - EVP_PK_EC = $0008; - - {$EXTERNALSYM EVP_BLOWFISH_KEY_SIZE} - EVP_BLOWFISH_KEY_SIZE = 16; - {$EXTERNALSYM EVP_CAST5_KEY_SIZE} - EVP_CAST5_KEY_SIZE = 16; - {$EXTERNALSYM EVP_RC2_KEY_SIZE} - EVP_RC2_KEY_SIZE = 16; - {$EXTERNALSYM EVP_RC4_KEY_SIZE} - EVP_RC4_KEY_SIZE = 16; - {$EXTERNALSYM EVP_RC5_32_12_16_KEY_SIZE} - EVP_RC5_32_12_16_KEY_SIZE = 16; - {$EXTERNALSYM EVP_MD_CTX_FLAG_ONESHOT} - EVP_MD_CTX_FLAG_ONESHOT = $0001; - //* digest update will be called - //* once only */ - {$EXTERNALSYM EVP_MD_CTX_FLAG_CLEANED} - EVP_MD_CTX_FLAG_CLEANED = $0002; - //* context has already been - //* cleaned */ - {$EXTERNALSYM EVP_MD_CTX_FLAG_REUSE} - EVP_MD_CTX_FLAG_REUSE = $0004; - //* Don't free up ctx->md_data - //* in EVP_MD_CTX_cleanup */ - //OpenSSL 1.0.0. - //* FIPS and pad options are ignored in 1.0.0, definitions are here -// * so we don't accidentally reuse the values for other purposes. -// */ - - {$EXTERNALSYM EVP_MD_CTX_FLAG_NON_FIPS_ALLOW} - EVP_MD_CTX_FLAG_NON_FIPS_ALLOW = $0008; //* Allow use of non FIPS digest -// * in FIPS mode */ - -//* The following PAD options are also currently ignored in 1.0.0, digest -// * parameters are handled through EVP_DigestSign*() and EVP_DigestVerify*() -// * instead. -// */ - - - {$EXTERNALSYM EVP_MD_CTX_FLAG_PAD_MASK} - EVP_MD_CTX_FLAG_PAD_MASK = $F0; //* RSA mode to use */ - {$EXTERNALSYM EVP_MD_CTX_FLAG_PAD_PKCS1} - EVP_MD_CTX_FLAG_PAD_PKCS1 = $00; //* PKCS#1 v1.5 mode */ - {$EXTERNALSYM EVP_MD_CTX_FLAG_PAD_X931} - EVP_MD_CTX_FLAG_PAD_X931 = $10; //* X9.31 mode */ - {$EXTERNALSYM EVP_MD_CTX_FLAG_PAD_PSS} - EVP_MD_CTX_FLAG_PAD_PSS = $20; //* PSS mode */ -//#define M_EVP_MD_CTX_FLAG_PSS_SALT(ctx) \ -// ((ctx->flags>>16) &0xFFFF) /* seed length */ - {$EXTERNALSYM EVP_MD_CTX_FLAG_PSS_MDLEN} - EVP_MD_CTX_FLAG_PSS_MDLEN = $FFFF; //* salt len same as digest */ - {$EXTERNALSYM EVP_MD_CTX_FLAG_PSS_MREC} - EVP_MD_CTX_FLAG_PSS_MREC = $FFFE; //* salt max or auto recovered */ - {$EXTERNALSYM EVP_MD_CTX_FLAG_NO_INIT} - EVP_MD_CTX_FLAG_NO_INIT = $0100; //* Don't initialize md_data */ - - //* Modes for ciphers */ - {$EXTERNALSYM EVP_CIPH_STREAM_CIPHER} - EVP_CIPH_STREAM_CIPHER = $0; - {$EXTERNALSYM EVP_CIPH_ECB_MODE} - EVP_CIPH_ECB_MODE = $1; - {$EXTERNALSYM EVP_CIPH_CBC_MODE} - EVP_CIPH_CBC_MODE = $2; - {$EXTERNALSYM EVP_CIPH_CFB_MODE} - EVP_CIPH_CFB_MODE = $3; - {$EXTERNALSYM EVP_CIPH_OFB_MODE} - EVP_CIPH_OFB_MODE = $4; - {$EXTERNALSYM EVP_CIPH_CTR_MODE} - EVP_CIPH_CTR_MODE = $5; - {$EXTERNALSYM EVP_CIPH_GCM_MODE} - EVP_CIPH_GCM_MODE = $6; - {$EXTERNALSYM EVP_CIPH_CCM_MODE} - EVP_CIPH_CCM_MODE = $7; - {$EXTERNALSYM EVP_CIPH_XTS_MODE} - EVP_CIPH_XTS_MODE = $10001; - {$EXTERNALSYM EVP_CIPH_MODE} - EVP_CIPH_MODE = $F0007; - -//* Set if variable length cipher */ - {$EXTERNALSYM EVP_CIPH_VARIABLE_LENGTH} - EVP_CIPH_VARIABLE_LENGTH = $8; -//* Set if the iv handling should be done by the cipher itself */ - {$EXTERNALSYM EVP_CIPH_CUSTOM_IV} - EVP_CIPH_CUSTOM_IV = $10; -//* Set if the cipher's init() function should be called if key is NULL */ - {$EXTERNALSYM EVP_CIPH_ALWAYS_CALL_INIT} - EVP_CIPH_ALWAYS_CALL_INIT = $20; -//* Call ctrl() to init cipher parameters */ - {$EXTERNALSYM EVP_CIPH_CTRL_INIT} - EVP_CIPH_CTRL_INIT = $40; -//* Don't use standard key length function */ - {$EXTERNALSYM EVP_CIPH_CUSTOM_KEY_LENGTH} - EVP_CIPH_CUSTOM_KEY_LENGTH = $80; -//* Don't use standard block padding */ - {$EXTERNALSYM EVP_CIPH_NO_PADDING} - EVP_CIPH_NO_PADDING = $100; -//* cipher handles random key generation */ - {$EXTERNALSYM EVP_CIPH_RAND_KEY} - EVP_CIPH_RAND_KEY = $200; -//* cipher has its own additional copying logic */ - {$EXTERNALSYM EVP_CIPH_CUSTOM_COPY} - EVP_CIPH_CUSTOM_COPY = $400; -//* Allow use default ASN1 get/set iv */ - {$EXTERNALSYM EVP_CIPH_FLAG_DEFAULT_ASN1} - EVP_CIPH_FLAG_DEFAULT_ASN1 = $1000; -//* Buffer length in bits not bytes: CFB1 mode only */ - {$EXTERNALSYM EVP_CIPH_FLAG_LENGTH_BITS} - EVP_CIPH_FLAG_LENGTH_BITS = $2000; -//* Note if suitable for use in FIPS mode */ - {$EXTERNALSYM EVP_CIPH_FLAG_FIPS} - EVP_CIPH_FLAG_FIPS = $4000; -//* Allow non FIPS cipher in FIPS mode */ - {$EXTERNALSYM EVP_CIPH_FLAG_NON_FIPS_ALLOW} - EVP_CIPH_FLAG_NON_FIPS_ALLOW = $8000; -///* Cipher handles any and all padding logic as well -// * as finalisation. -// */ - {$EXTERNALSYM EVP_CIPH_FLAG_CUSTOM_CIPHER} - EVP_CIPH_FLAG_CUSTOM_CIPHER = $100000; - {$EXTERNALSYM EVP_CIPH_FLAG_AEAD_CIPHER} - EVP_CIPH_FLAG_AEAD_CIPHER = $200000; - - {$EXTERNALSYM EVP_CTRL_INIT} - EVP_CTRL_INIT = $0; - {$EXTERNALSYM EVP_CTRL_SET_KEY_LENGTH} - EVP_CTRL_SET_KEY_LENGTH = $1; - {$EXTERNALSYM EVP_CTRL_GET_RC2_KEY_BITS} - EVP_CTRL_GET_RC2_KEY_BITS = $2; - {$EXTERNALSYM EVP_CTRL_SET_RC2_KEY_BITS} - EVP_CTRL_SET_RC2_KEY_BITS = $3; - {$EXTERNALSYM EVP_CTRL_GET_RC5_ROUNDS} - EVP_CTRL_GET_RC5_ROUNDS = $4; - {$EXTERNALSYM EVP_CTRL_SET_RC5_ROUNDS} - EVP_CTRL_SET_RC5_ROUNDS = $5; - {$EXTERNALSYM EVP_CTRL_RAND_KEY} - EVP_CTRL_RAND_KEY = $6; - {$EXTERNALSYM EVP_CTRL_PBE_PRF_NID} - EVP_CTRL_PBE_PRF_NID = $7; - {$EXTERNALSYM EVP_CTRL_COPY} - EVP_CTRL_COPY = $8; - {$EXTERNALSYM EVP_CTRL_GCM_SET_IVLEN} - EVP_CTRL_GCM_SET_IVLEN = $9; - {$EXTERNALSYM EVP_CTRL_GCM_GET_TAG} - EVP_CTRL_GCM_GET_TAG = $10; - {$EXTERNALSYM EVP_CTRL_GCM_SET_TAG} - EVP_CTRL_GCM_SET_TAG = $11; - {$EXTERNALSYM EVP_CTRL_GCM_SET_IV_FIXED} - EVP_CTRL_GCM_SET_IV_FIXED = $12; - {$EXTERNALSYM EVP_CTRL_GCM_IV_GEN} - EVP_CTRL_GCM_IV_GEN = $13; - {$EXTERNALSYM EVP_CTRL_CCM_SET_IVLEN} - EVP_CTRL_CCM_SET_IVLEN = EVP_CTRL_GCM_SET_IVLEN; - {$EXTERNALSYM EVP_CTRL_CCM_GET_TAG} - EVP_CTRL_CCM_GET_TAG = EVP_CTRL_GCM_GET_TAG; - {$EXTERNALSYM EVP_CTRL_CCM_SET_TAG} - EVP_CTRL_CCM_SET_TAG = EVP_CTRL_GCM_SET_TAG; - {$EXTERNALSYM EVP_CTRL_CCM_SET_L} - EVP_CTRL_CCM_SET_L = $14; - {$EXTERNALSYM EVP_CTRL_CCM_SET_MSGLEN} - EVP_CTRL_CCM_SET_MSGLEN = $15; - -///* AEAD cipher deduces payload length and returns number of bytes -// * required to store MAC and eventual padding. Subsequent call to -// * EVP_Cipher even appends/verifies MAC. -// */ - {$EXTERNALSYM EVP_CTRL_AEAD_TLS1_AAD} - EVP_CTRL_AEAD_TLS1_AAD = $16; -//* Used by composite AEAD ciphers, no-op in GCM, CCM... */ - {$EXTERNALSYM EVP_CTRL_AEAD_SET_MAC_KEY} - EVP_CTRL_AEAD_SET_MAC_KEY = $17; -//* Set the GCM invocation field, decrypt only */ - {$EXTERNALSYM EVP_CTRL_GCM_SET_IV_INV} - EVP_CTRL_GCM_SET_IV_INV = $18; -//* PBE type */ - -//* GCM TLS constants */ -//* Length of fixed part of IV derived from PRF */ - {$EXTERNALSYM EVP_GCM_TLS_FIXED_IV_LEN} - EVP_GCM_TLS_FIXED_IV_LEN = 4; -//* Length of explicit part of IV part of TLS records */ - {$EXTERNALSYM EVP_GCM_TLS_EXPLICIT_IV_LEN} - EVP_GCM_TLS_EXPLICIT_IV_LEN = 8; -//* Length of tag for TLS */ - {$EXTERNALSYM EVP_GCM_TLS_TAG_LEN} - EVP_GCM_TLS_TAG_LEN = 16; - -//* Can appear as the outermost AlgorithmIdentifier */ - {$EXTERNALSYM EVP_PBE_TYPE_OUTER} - EVP_PBE_TYPE_OUTER = $0; -//* Is an PRF type OID */ - {$EXTERNALSYM EVP_PBE_TYPE_PRF} - EVP_PBE_TYPE_PRF = $1; - - {$EXTERNALSYM ASN1_PKEY_ALIAS} - ASN1_PKEY_ALIAS = $1; - {$EXTERNALSYM ASN1_PKEY_DYNAMIC} - ASN1_PKEY_DYNAMIC = $2; - {$EXTERNALSYM ASN1_PKEY_SIGPARAM_NULL} - ASN1_PKEY_SIGPARAM_NULL = $4; - {$EXTERNALSYM ASN1_PKEY_CTRL_PKCS7_SIGN} - ASN1_PKEY_CTRL_PKCS7_SIGN = $1; - {$EXTERNALSYM ASN1_PKEY_CTRL_PKCS7_ENCRYPT} - ASN1_PKEY_CTRL_PKCS7_ENCRYPT = $2; - {$EXTERNALSYM ASN1_PKEY_CTRL_DEFAULT_MD_NID} - ASN1_PKEY_CTRL_DEFAULT_MD_NID = $3; - {$EXTERNALSYM ASN1_PKEY_CTRL_CMS_SIGN} - ASN1_PKEY_CTRL_CMS_SIGN = $5; - {$EXTERNALSYM ASN1_PKEY_CTRL_CMS_ENVELOPE} - ASN1_PKEY_CTRL_CMS_ENVELOPE = $7; - - {$EXTERNALSYM EVP_PKEY_OP_UNDEFINED} - EVP_PKEY_OP_UNDEFINED = 0; - {$EXTERNALSYM EVP_PKEY_OP_PARAMGEN} - EVP_PKEY_OP_PARAMGEN =(1 shl 1); - {$EXTERNALSYM EVP_PKEY_OP_KEYGEN} - EVP_PKEY_OP_KEYGEN = (1 shl 2); - {$EXTERNALSYM EVP_PKEY_OP_SIGN} - EVP_PKEY_OP_SIGN = (1 shl 3); - {$EXTERNALSYM EVP_PKEY_OP_VERIFY} - EVP_PKEY_OP_VERIFY = (1 shl 4); - {$EXTERNALSYM EVP_PKEY_OP_VERIFYRECOVER} - EVP_PKEY_OP_VERIFYRECOVER = (1 shl 5); - {$EXTERNALSYM EVP_PKEY_OP_SIGNCTX} - EVP_PKEY_OP_SIGNCTX = (1 shl 6); - {$EXTERNALSYM EVP_PKEY_OP_VERIFYCTX} - EVP_PKEY_OP_VERIFYCTX = (1 shl 7); - {$EXTERNALSYM EVP_PKEY_OP_ENCRYPT} - EVP_PKEY_OP_ENCRYPT = (1 shl 8); - {$EXTERNALSYM EVP_PKEY_OP_DECRYPT} - EVP_PKEY_OP_DECRYPT = (1 shl 9); - {$EXTERNALSYM EVP_PKEY_OP_DERIVE} - EVP_PKEY_OP_DERIVE = (1 shl 10); - - {$EXTERNALSYM EVP_PKEY_OP_TYPE_SIG} - EVP_PKEY_OP_TYPE_SIG = - {$EXTERNALSYM EVP_PKEY_OP_TYPE_CRYPT} - (EVP_PKEY_OP_SIGN or EVP_PKEY_OP_VERIFY or EVP_PKEY_OP_VERIFYRECOVER - {$EXTERNALSYM EVP_PKEY_OP_TYPE_CRYPT} - or EVP_PKEY_OP_SIGNCTX or EVP_PKEY_OP_VERIFYCTX); - - {$EXTERNALSYM EVP_PKEY_OP_TYPE_CRYPT} - EVP_PKEY_OP_TYPE_CRYPT = (EVP_PKEY_OP_ENCRYPT or EVP_PKEY_OP_DECRYPT); - -// EVP_PKEY_OP_TYPE_NOGEN = -// (EVP_PKEY_OP_SIG or EVP_PKEY_OP_CRYPT or EVP_PKEY_OP_DERIVE); -// guessing from above. THere may be a typo in the header. - {$EXTERNALSYM EVP_PKEY_OP_TYPE_NOGEN} - EVP_PKEY_OP_TYPE_NOGEN = - {$EXTERNALSYM EVP_PKEY_OP_TYPE_GEN} - (EVP_PKEY_OP_TYPE_SIG or EVP_PKEY_OP_TYPE_CRYPT or EVP_PKEY_OP_DERIVE); - - {$EXTERNALSYM EVP_PKEY_OP_TYPE_GEN} - EVP_PKEY_OP_TYPE_GEN = - (EVP_PKEY_OP_PARAMGEN or EVP_PKEY_OP_KEYGEN); - - {$EXTERNALSYM EVP_PKEY_CTRL_MD} - EVP_PKEY_CTRL_MD = 1; - {$EXTERNALSYM EVP_PKEY_CTRL_PEER_KEY} - EVP_PKEY_CTRL_PEER_KEY = 2; - - {$EXTERNALSYM EVP_PKEY_CTRL_PKCS7_ENCRYPT} - EVP_PKEY_CTRL_PKCS7_ENCRYPT = 3; - {$EXTERNALSYM EVP_PKEY_CTRL_PKCS7_DECRYPT} - EVP_PKEY_CTRL_PKCS7_DECRYPT = 4; - - {$EXTERNALSYM EVP_PKEY_CTRL_PKCS7_SIGN} - EVP_PKEY_CTRL_PKCS7_SIGN = 5; - - {$EXTERNALSYM EVP_PKEY_CTRL_SET_MAC_KEY} - EVP_PKEY_CTRL_SET_MAC_KEY = 6; - - {$EXTERNALSYM EVP_PKEY_CTRL_DIGESTINIT} - EVP_PKEY_CTRL_DIGESTINIT = 7; - -//* Used by GOST key encryption in TLS */ - - {$EXTERNALSYM EVP_PKEY_CTRL_SET_IV} - EVP_PKEY_CTRL_SET_IV = 8; - {$EXTERNALSYM EVP_PKEY_CTRL_CMS_ENCRYPT} - EVP_PKEY_CTRL_CMS_ENCRYPT = 9; - {$EXTERNALSYM EVP_PKEY_CTRL_CMS_DECRYPT} - EVP_PKEY_CTRL_CMS_DECRYPT = 10; - {$EXTERNALSYM EVP_PKEY_CTRL_CMS_SIGN} - EVP_PKEY_CTRL_CMS_SIGN = 11; - {$EXTERNALSYM EVP_PKEY_CTRL_CIPHER} - EVP_PKEY_CTRL_CIPHER = 12; - {$EXTERNALSYM EVP_PKEY_ALG_CTRL} - EVP_PKEY_ALG_CTRL = $1000; - - {$EXTERNALSYM EVP_PKEY_FLAG_AUTOARGLEN} - EVP_PKEY_FLAG_AUTOARGLEN = 2; -///* Method handles all operations: don't assume any digest related -// * defaults. -// */ - {$EXTERNALSYM EVP_PKEY_FLAG_SIGCTX_CUSTOM} - EVP_PKEY_FLAG_SIGCTX_CUSTOM = 4; - {$EXTERNALSYM EVP_F_AESNI_INIT_KEY} - EVP_F_AESNI_INIT_KEY = 165; - {$EXTERNALSYM EVP_F_AESNI_XTS_CIPHER} - EVP_F_AESNI_XTS_CIPHER = 176; - {$EXTERNALSYM EVP_F_AES_INIT_KEY} - EVP_F_AES_INIT_KEY = 133; - {$EXTERNALSYM EVP_F_ALG_MODULE_INIT} - EVP_F_ALG_MODULE_INIT = 138; - {$EXTERNALSYM EVP_F_AES_XTS} - EVP_F_AES_XTS = 172; - {$EXTERNALSYM EVP_F_AES_XTS_CIPHER} - EVP_F_AES_XTS_CIPHER = 175; - {$EXTERNALSYM EVP_F_CAMELLIA_INIT_KEY} - EVP_F_CAMELLIA_INIT_KEY = 159; - {$EXTERNALSYM EVP_F_CMAC_INIT} - EVP_F_CMAC_INIT = 173; - {$EXTERNALSYM EVP_F_D2I_PKEY} - EVP_F_D2I_PKEY = 100; - {$EXTERNALSYM EVP_F_DO_SIGVER_INIT} - EVP_F_DO_SIGVER_INIT = 161; - {$EXTERNALSYM EVP_F_DO_EVP_ENC_ENGINE} - EVP_F_DO_EVP_ENC_ENGINE = 140; - {$EXTERNALSYM EVP_F_DSAPKEY2PKCS8} - EVP_F_DSAPKEY2PKCS8 = 134; - {$EXTERNALSYM EVP_F_DSA_PKEY2PKCS8} - EVP_F_DSA_PKEY2PKCS8 = 135; - {$EXTERNALSYM EVP_F_ECDSA_PKEY2PKCS8} - EVP_F_ECDSA_PKEY2PKCS8 = 129; - {$EXTERNALSYM EVP_F_ECKEY_PKEY2PKCS8} - EVP_F_ECKEY_PKEY2PKCS8 = 132; - {$EXTERNALSYM EVP_F_EVP_CIPHERINIT_EX} - EVP_F_EVP_CIPHERINIT_EX = 123; - {$EXTERNALSYM EVP_F_EVP_CIPHER_CTX_COPY} - EVP_F_EVP_CIPHER_CTX_COPY = 163; - {$EXTERNALSYM EVP_F_EVP_CIPHER_CTX_CTRL} - EVP_F_EVP_CIPHER_CTX_CTRL = 124; - {$EXTERNALSYM EVP_F_EVP_CIPHER_CTX_SET_KEY_LENGTH} - EVP_F_EVP_CIPHER_CTX_SET_KEY_LENGTH = 122; - {$EXTERNALSYM EVP_F_EVP_DECRYPTFINAL_EX} - EVP_F_EVP_DECRYPTFINAL_EX = 101; - //was EVP_F_EVP_DECRYPTFINAL = 101; - {$EXTERNALSYM EVP_F_EVP_DIGESTINIT_EX} - EVP_F_EVP_DIGESTINIT_EX = 128; - {$EXTERNALSYM EVP_F_EVP_ENCRYPTFINAL_EX} - EVP_F_EVP_ENCRYPTFINAL_EX = 127; - {$EXTERNALSYM EVP_F_EVP_MD_CTX_COPY_EX} - EVP_F_EVP_MD_CTX_COPY_EX = 110; - {$EXTERNALSYM EVP_F_EVP_MD_SIZE} - EVP_F_EVP_MD_SIZE = 162; - //was EVP_F_EVP_MD_CTX_COPY = 110; - {$EXTERNALSYM EVP_F_EVP_OPENINIT} - EVP_F_EVP_OPENINIT = 102; - {$EXTERNALSYM EVP_F_EVP_PBE_ALG_ADD} - EVP_F_EVP_PBE_ALG_ADD = 115; - {$EXTERNALSYM EVP_F_EVP_PBE_ALG_ADD_TYPE} - EVP_F_EVP_PBE_ALG_ADD_TYPE = 160; - {$EXTERNALSYM EVP_F_EVP_PBE_CIPHERINIT} - EVP_F_EVP_PBE_CIPHERINIT = 116; - {$EXTERNALSYM EVP_F_EVP_PKCS82PKEY} - EVP_F_EVP_PKCS82PKEY = 111; - {$EXTERNALSYM EVP_F_EVP_PKEY2PKCS8_BROKEN} - EVP_F_EVP_PKEY2PKCS8_BROKEN = 113; - //was EVP_F_EVP_PKEY2PKCS8 = 113; - {$EXTERNALSYM EVP_F_EVP_PKCS82PKEY_BROKEN} - EVP_F_EVP_PKCS82PKEY_BROKEN = 136; - {$EXTERNALSYM EVP_F_EVP_PKEY_COPY_PARAMETERS} - EVP_F_EVP_PKEY_COPY_PARAMETERS = 103; - {$EXTERNALSYM EVP_F_EVP_PKEY_CTX_CTRL} - EVP_F_EVP_PKEY_CTX_CTRL = 137; - {$EXTERNALSYM EVP_F_EVP_PKEY_CTX_CTRL_STR} - EVP_F_EVP_PKEY_CTX_CTRL_STR = 150; - {$EXTERNALSYM EVP_F_EVP_PKEY_CTX_DUP} - EVP_F_EVP_PKEY_CTX_DUP = 156; - {$EXTERNALSYM EVP_F_EVP_PKEY_DECRYPT} - EVP_F_EVP_PKEY_DECRYPT = 104; - {$EXTERNALSYM EVP_F_EVP_PKEY_DECRYPT_INIT} - EVP_F_EVP_PKEY_DECRYPT_INIT = 138; - {$EXTERNALSYM EVP_F_EVP_PKEY_DECRYPT_OLD} - EVP_F_EVP_PKEY_DECRYPT_OLD = 151; - {$EXTERNALSYM EVP_F_EVP_PKEY_DERIVE} - EVP_F_EVP_PKEY_DERIVE = 153; - {$EXTERNALSYM EVP_F_EVP_PKEY_DERIVE_INIT} - EVP_F_EVP_PKEY_DERIVE_INIT = 154; - {$EXTERNALSYM EVP_F_EVP_PKEY_DERIVE_SET_PEER} - EVP_F_EVP_PKEY_DERIVE_SET_PEER = 155; - {$EXTERNALSYM EVP_F_EVP_PKEY_ENCRYPT} - EVP_F_EVP_PKEY_ENCRYPT = 105; - {$EXTERNALSYM EVP_F_EVP_PKEY_ENCRYPT_INIT} - EVP_F_EVP_PKEY_ENCRYPT_INIT = 139; - {$EXTERNALSYM EVP_F_EVP_PKEY_ENCRYPT_OLD} - EVP_F_EVP_PKEY_ENCRYPT_OLD = 152; - {$EXTERNALSYM EVP_F_EVP_PKEY_GET1_DH} - EVP_F_EVP_PKEY_GET1_DH = 119; - {$EXTERNALSYM EVP_F_EVP_PKEY_GET1_DSA} - EVP_F_EVP_PKEY_GET1_DSA = 120; - {$EXTERNALSYM EVP_F_EVP_PKEY_GET1_ECDSA} - EVP_F_EVP_PKEY_GET1_ECDSA = 130; - {$EXTERNALSYM EVP_F_EVP_PKEY_GET1_EC_KEY} - EVP_F_EVP_PKEY_GET1_EC_KEY = 131; - {$EXTERNALSYM EVP_F_EVP_PKEY_GET1_RSA} - EVP_F_EVP_PKEY_GET1_RSA = 121; - {$EXTERNALSYM EVP_F_EVP_PKEY_KEYGEN} - EVP_F_EVP_PKEY_KEYGEN = 146; - {$EXTERNALSYM EVP_F_EVP_PKEY_KEYGEN_INIT} - EVP_F_EVP_PKEY_KEYGEN_INIT = 147; - {$EXTERNALSYM EVP_F_EVP_PKEY_NEW} - EVP_F_EVP_PKEY_NEW = 106; - {$EXTERNALSYM EVP_F_EVP_PKEY_PARAMGEN} - EVP_F_EVP_PKEY_PARAMGEN = 148; - {$EXTERNALSYM EVP_F_EVP_PKEY_PARAMGEN_INIT} - EVP_F_EVP_PKEY_PARAMGEN_INIT = 149; - {$EXTERNALSYM EVP_F_EVP_PKEY_SIGN} - EVP_F_EVP_PKEY_SIGN = 140; - {$EXTERNALSYM EVP_F_EVP_PKEY_SIGN_INIT} - EVP_F_EVP_PKEY_SIGN_INIT = 141; - {$EXTERNALSYM EVP_F_EVP_PKEY_VERIFY} - EVP_F_EVP_PKEY_VERIFY = 142; - {$EXTERNALSYM EVP_F_EVP_PKEY_VERIFY_INIT} - EVP_F_EVP_PKEY_VERIFY_INIT = 143; - {$EXTERNALSYM EVP_F_EVP_PKEY_VERIFY_RECOVER} - EVP_F_EVP_PKEY_VERIFY_RECOVER = 144; - {$EXTERNALSYM EVP_F_EVP_PKEY_VERIFY_RECOVER_INIT} - EVP_F_EVP_PKEY_VERIFY_RECOVER_INIT = 145; - {$EXTERNALSYM EVP_F_EVP_RIJNDAEL} - EVP_F_EVP_RIJNDAEL = 126; - {$EXTERNALSYM EVP_F_EVP_SIGNFINAL} - EVP_F_EVP_SIGNFINAL = 107; - {$EXTERNALSYM EVP_F_EVP_VERIFYFINAL} - EVP_F_EVP_VERIFYFINAL = 108; - {$EXTERNALSYM EVP_F_FIPS_CIPHERINIT} - EVP_F_FIPS_CIPHERINIT = 166; - {$EXTERNALSYM EVP_F_FIPS_CIPHER_CTX_COPY} - EVP_F_FIPS_CIPHER_CTX_COPY = 170; - {$EXTERNALSYM EVP_F_FIPS_CIPHER_CTX_CTRL} - EVP_F_FIPS_CIPHER_CTX_CTRL = 167; - {$EXTERNALSYM EVP_F_FIPS_CIPHER_CTX_SET_KEY_LENGTH} - EVP_F_FIPS_CIPHER_CTX_SET_KEY_LENGTH = 171; - {$EXTERNALSYM EVP_F_FIPS_DIGESTINIT} - EVP_F_FIPS_DIGESTINIT = 168; - {$EXTERNALSYM EVP_F_FIPS_MD_CTX_COPY} - EVP_F_FIPS_MD_CTX_COPY = 169; - {$EXTERNALSYM EVP_F_HMAC_INIT_EX} - EVP_F_HMAC_INIT_EX = 174; - {$EXTERNALSYM EVP_F_INT_CTX_NEW} - EVP_F_INT_CTX_NEW = 157; - {$EXTERNALSYM EVP_F_PKCS5_PBE_KEYIVGEN} - EVP_F_PKCS5_PBE_KEYIVGEN = 117; - {$EXTERNALSYM EVP_F_PKCS5_V2_PBKDF2_KEYIVGEN} - EVP_F_PKCS5_V2_PBKDF2_KEYIVGEN = 164; - - {$EXTERNALSYM EVP_F_PKCS5_V2_PBE_KEYIVGEN} - EVP_F_PKCS5_V2_PBE_KEYIVGEN = 118; - {$EXTERNALSYM EVP_F_PKCS8_SET_BROKEN} - EVP_F_PKCS8_SET_BROKEN = 112; - {$EXTERNALSYM EVP_F_PKEY_SET_TYPE} - EVP_F_PKEY_SET_TYPE = 158; - - //was EVP_F_EVP_PKCS8_SET_BROKEN = 112; - {$EXTERNALSYM EVP_F_RC2_MAGIC_TO_METH} - EVP_F_RC2_MAGIC_TO_METH = 109; - {$EXTERNALSYM EVP_F_RC5_CTRL} - EVP_F_RC5_CTRL = 125; - {$EXTERNALSYM EVP_R_AES_IV_SETUP_FAILED} - EVP_R_AES_IV_SETUP_FAILED = 162; - {$EXTERNALSYM EVP_R_AES_KEY_SETUP_FAILED} - EVP_R_AES_KEY_SETUP_FAILED = 143; - {$EXTERNALSYM EVP_R_ASN1_LIB} - EVP_R_ASN1_LIB = 140; - {$EXTERNALSYM EVP_R_BAD_BLOCK_LENGTH} - EVP_R_BAD_BLOCK_LENGTH = 136; - {$EXTERNALSYM EVP_R_BAD_DECRYPT} - EVP_R_BAD_DECRYPT = 100; - {$EXTERNALSYM EVP_R_BN_DECODE_ERROR} - EVP_R_BN_DECODE_ERROR = 112; - {$EXTERNALSYM EVP_R_BN_PUBKEY_ERROR} - EVP_R_BN_PUBKEY_ERROR = 113; - {$EXTERNALSYM EVP_R_BUFFER_TOO_SMALL} - EVP_R_BUFFER_TOO_SMALL = 155; - {$EXTERNALSYM EVP_R_CIPHER_PARAMETER_ERROR} - EVP_R_CIPHER_PARAMETER_ERROR = 122; - {$EXTERNALSYM EVP_R_COMMAND_NOT_SUPPORTED} - EVP_R_COMMAND_NOT_SUPPORTED = 147; - {$EXTERNALSYM EVP_R_DECODE_ERROR} - EVP_R_DECODE_ERROR = 114; - {$EXTERNALSYM EVP_R_DIFFERENT_KEY_TYPES} - EVP_R_DIFFERENT_KEY_TYPES = 101; - {$EXTERNALSYM EVP_R_DIFFERENT_PARAMETERS} - EVP_R_DIFFERENT_PARAMETERS = 153; - {$EXTERNALSYM EVP_R_DISABLED_FOR_FIPS} - EVP_R_DISABLED_FOR_FIPS = 163; //was 144; - - {$EXTERNALSYM EVP_R_ENCODE_ERROR} - EVP_R_ENCODE_ERROR = 115; - {$EXTERNALSYM EVP_R_ERROR_LOADING_SECTION} - EVP_R_ERROR_LOADING_SECTION = 165; - {$EXTERNALSYM EVP_R_ERROR_SETTING_FIPS_MODE} - EVP_R_ERROR_SETTING_FIPS_MODE = 166; - - {$EXTERNALSYM EVP_R_EVP_PBE_CIPHERINIT_ERROR} - EVP_R_EVP_PBE_CIPHERINIT_ERROR = 119; - {$EXTERNALSYM EVP_R_EXPECTING_AN_RSA_KEY} - EVP_R_EXPECTING_AN_RSA_KEY = 127; - {$EXTERNALSYM EVP_R_EXPECTING_A_DH_KEY} - EVP_R_EXPECTING_A_DH_KEY = 128; - {$EXTERNALSYM EVP_R_EXPECTING_A_DSA_KEY} - EVP_R_EXPECTING_A_DSA_KEY = 129; - {$EXTERNALSYM EVP_R_EXPECTING_A_ECDSA_KEY} - EVP_R_EXPECTING_A_ECDSA_KEY = 141; - {$EXTERNALSYM EVP_R_EXPECTING_A_EC_KEY} - EVP_R_EXPECTING_A_EC_KEY = 142; - {$EXTERNALSYM EVP_R_FIPS_MODE_NOT_SUPPORTED} - EVP_R_FIPS_MODE_NOT_SUPPORTED = 167; - {$EXTERNALSYM EVP_R_INITIALIZATION_ERROR} - EVP_R_INITIALIZATION_ERROR = 134; - {$EXTERNALSYM EVP_R_INPUT_NOT_INITIALIZED} - EVP_R_INPUT_NOT_INITIALIZED = 111; - {$EXTERNALSYM EVP_R_INVALID_DIGEST} - EVP_R_INVALID_DIGEST = 152; - {$EXTERNALSYM EVP_R_INVALID_KEY_LENGTH} - EVP_R_INVALID_KEY_LENGTH = 130; - {$EXTERNALSYM EVP_R_INVALID_OPERATION} - EVP_R_INVALID_OPERATION = 148; - {$EXTERNALSYM EVP_R_INVALID_FIPS_MODE} - EVP_R_INVALID_FIPS_MODE = 168; //was: 148; - {$EXTERNALSYM EVP_R_IV_TOO_LARGE} - EVP_R_IV_TOO_LARGE = 102; - {$EXTERNALSYM EVP_R_KEYGEN_FAILURE} - EVP_R_KEYGEN_FAILURE = 120; - {$EXTERNALSYM EVP_R_MESSAGE_DIGEST_IS_NULL} - EVP_R_MESSAGE_DIGEST_IS_NULL = 159; - {$EXTERNALSYM EVP_R_METHOD_NOT_SUPPORTED} - EVP_R_METHOD_NOT_SUPPORTED = 144; - {$EXTERNALSYM EVP_R_MISSING_PARMATERS} - EVP_R_MISSING_PARMATERS = 103; - {$EXTERNALSYM EVP_R_NO_CIPHER_SET} - EVP_R_NO_CIPHER_SET = 131; - {$EXTERNALSYM EVP_R_NO_DEFAULT_DIGEST} - EVP_R_NO_DEFAULT_DIGEST = 158; - {$EXTERNALSYM EVP_R_NO_DIGEST_SET} - EVP_R_NO_DIGEST_SET = 139; - {$EXTERNALSYM EVP_R_NO_DSA_PARAMETERS} - EVP_R_NO_DSA_PARAMETERS = 116; - {$EXTERNALSYM EVP_R_NO_KEY_SET} - EVP_R_NO_KEY_SET = 154; - {$EXTERNALSYM EVP_R_NO_OPERATION_SET} - EVP_R_NO_OPERATION_SET = 149; - {$EXTERNALSYM EVP_R_NO_SIGN_FUNCTION_CONFIGURED} - EVP_R_NO_SIGN_FUNCTION_CONFIGURED = 104; - {$EXTERNALSYM EVP_R_NO_VERIFY_FUNCTION_CONFIGURED} - EVP_R_NO_VERIFY_FUNCTION_CONFIGURED = 105; - {$EXTERNALSYM EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE} - EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE = 150; - {$EXTERNALSYM EVP_R_OPERATON_NOT_INITIALIZED} - EVP_R_OPERATON_NOT_INITIALIZED = 151; - {$EXTERNALSYM EVP_R_PKCS8_UNKNOWN_BROKEN_TYPE} - EVP_R_PKCS8_UNKNOWN_BROKEN_TYPE = 117; - {$EXTERNALSYM EVP_R_PRIVATE_KEY_DECODE_ERROR} - EVP_R_PRIVATE_KEY_DECODE_ERROR = 145; - {$EXTERNALSYM EVP_R_PRIVATE_KEY_ENCODE_ERROR} - EVP_R_PRIVATE_KEY_ENCODE_ERROR = 146; - {$EXTERNALSYM EVP_R_PUBLIC_KEY_NOT_RSA} - EVP_R_PUBLIC_KEY_NOT_RSA = 106; - {$EXTERNALSYM EVP_R_TOO_LARGE} - EVP_R_TOO_LARGE = 164; - {$EXTERNALSYM EVP_R_UNKNOWN_CIPHER} - EVP_R_UNKNOWN_CIPHER = 160; - {$EXTERNALSYM EVP_R_UNKNOWN_DIGEST} - EVP_R_UNKNOWN_DIGEST = 161; - {$EXTERNALSYM EVP_R_UNKNOWN_OPTION} - EVP_R_UNKNOWN_OPTION = 169; //149; - {$EXTERNALSYM EVP_R_UNKNOWN_PBE_ALGORITHM} - EVP_R_UNKNOWN_PBE_ALGORITHM = 121; - {$EXTERNALSYM EVP_R_UNSUPPORTED_CIPHER} - EVP_R_UNSUPPORTED_CIPHER = 107; - {$EXTERNALSYM EVP_R_UNSUPORTED_NUMBER_OF_ROUNDS} - EVP_R_UNSUPORTED_NUMBER_OF_ROUNDS = 135; - - {$EXTERNALSYM EVP_R_UNSUPPORTED_KEYLENGTH} - EVP_R_UNSUPPORTED_KEYLENGTH = 123; - {$EXTERNALSYM EVP_R_UNSUPPORTED_KEY_DERIVATION_FUNCTION} - EVP_R_UNSUPPORTED_KEY_DERIVATION_FUNCTION = 124; - {$EXTERNALSYM EVP_R_UNSUPPORTED_KEY_SIZE} - EVP_R_UNSUPPORTED_KEY_SIZE = 108; - {$EXTERNALSYM EVP_R_UNSUPPORTED_PRF} - EVP_R_UNSUPPORTED_PRF = 125; - {$EXTERNALSYM EVP_R_UNSUPPORTED_PRIVATE_KEY_ALGORITHM} - EVP_R_UNSUPPORTED_PRIVATE_KEY_ALGORITHM = 118; - {$EXTERNALSYM EVP_R_UNSUPPORTED_SALT_TYPE} - EVP_R_UNSUPPORTED_SALT_TYPE = 126; - {$EXTERNALSYM EVP_R_WRONG_FINAL_BLOCK_LENGTH} - EVP_R_WRONG_FINAL_BLOCK_LENGTH = 109; - {$EXTERNALSYM EVP_R_WRONG_PUBLIC_KEY_TYPE} - EVP_R_WRONG_PUBLIC_KEY_TYPE = 110; - {$EXTERNALSYM EVP_R_SEED_KEY_SETUP_FAILED} - EVP_R_SEED_KEY_SETUP_FAILED = 162; - {$IFDEF OPENSSL_FIPS} -//* Function codes. */ - {$EXTERNALSYM FIPS_F_DH_BUILTIN_GENPARAMS} - FIPS_F_DH_BUILTIN_GENPARAMS = 100; - {$EXTERNALSYM FIPS_F_DSA_BUILTIN_PARAMGEN} - FIPS_F_DSA_BUILTIN_PARAMGEN = 101; - {$EXTERNALSYM FIPS_F_DSA_DO_SIGN} - FIPS_F_DSA_DO_SIGN = 102; - {$EXTERNALSYM FIPS_F_DSA_DO_VERIFY} - FIPS_F_DSA_DO_VERIFY = 103; - {$EXTERNALSYM FIPS_F_EVP_CIPHERINIT_EX} - FIPS_F_EVP_CIPHERINIT_EX = 124; - {$EXTERNALSYM FIPS_F_EVP_DIGESTINIT_EX} - FIPS_F_EVP_DIGESTINIT_EX = 125; - {$EXTERNALSYM FIPS_F_FIPS_CHECK_DSA} - FIPS_F_FIPS_CHECK_DSA = 104; - {$EXTERNALSYM FIPS_F_FIPS_CHECK_INCORE_FINGERPRINT} - FIPS_F_FIPS_CHECK_INCORE_FINGERPRINT = 105; - {$EXTERNALSYM FIPS_F_FIPS_CHECK_RSA} - FIPS_F_FIPS_CHECK_RSA = 106; - {$EXTERNALSYM FIPS_F_FIPS_DSA_CHECK} - FIPS_F_FIPS_DSA_CHECK = 107; - {$EXTERNALSYM FIPS_F_FIPS_MODE_SET} - FIPS_F_FIPS_MODE_SET = 108; - {$EXTERNALSYM FIPS_F_FIPS_PKEY_SIGNATURE_TEST} - FIPS_F_FIPS_PKEY_SIGNATURE_TEST = 109; - {$EXTERNALSYM FIPS_F_FIPS_SELFTEST_AES} - FIPS_F_FIPS_SELFTEST_AES = 110; - {$EXTERNALSYM FIPS_F_FIPS_SELFTEST_DES} - FIPS_F_FIPS_SELFTEST_DES = 111; - {$EXTERNALSYM FIPS_F_FIPS_SELFTEST_DSA} - FIPS_F_FIPS_SELFTEST_DSA = 112; - {$EXTERNALSYM FIPS_F_FIPS_SELFTEST_HMAC} - FIPS_F_FIPS_SELFTEST_HMAC = 113; - {$EXTERNALSYM FIPS_F_FIPS_SELFTEST_RNG} - FIPS_F_FIPS_SELFTEST_RNG = 114; - {$EXTERNALSYM FIPS_F_FIPS_SELFTEST_SHA1} - FIPS_F_FIPS_SELFTEST_SHA1 = 115; - {$EXTERNALSYM FIPS_F_HASH_FINAL} - FIPS_F_HASH_FINAL = 123; - {$EXTERNALSYM FIPS_F_RSA_BUILTIN_KEYGEN} - FIPS_F_RSA_BUILTIN_KEYGEN = 116; - {$EXTERNALSYM FIPS_F_RSA_EAY_PRIVATE_DECRYPT} - FIPS_F_RSA_EAY_PRIVATE_DECRYPT = 117; - {$EXTERNALSYM FIPS_F_RSA_EAY_PRIVATE_ENCRYPT} - FIPS_F_RSA_EAY_PRIVATE_ENCRYPT = 118; - {$EXTERNALSYM FIPS_F_RSA_EAY_PUBLIC_DECRYPT} - FIPS_F_RSA_EAY_PUBLIC_DECRYPT = 119; - {$EXTERNALSYM FIPS_F_RSA_EAY_PUBLIC_ENCRYPT} - FIPS_F_RSA_EAY_PUBLIC_ENCRYPT = 120; - {$EXTERNALSYM FIPS_F_RSA_X931_GENERATE_KEY_EX} - FIPS_F_RSA_X931_GENERATE_KEY_EX = 121; - {$EXTERNALSYM FIPS_F_SSLEAY_RAND_BYTES} - FIPS_F_SSLEAY_RAND_BYTES = 122; -//* Reason codes. */ - {$EXTERNALSYM FIPS_R_CANNOT_READ_EXE} - FIPS_R_CANNOT_READ_EXE = 103; - {$EXTERNALSYM FIPS_R_CANNOT_READ_EXE_DIGEST} - FIPS_R_CANNOT_READ_EXE_DIGEST = 104; - {$EXTERNALSYM FIPS_R_CONTRADICTING_EVIDENCE} - FIPS_R_CONTRADICTING_EVIDENCE = 114; - {$EXTERNALSYM FIPS_R_EXE_DIGEST_DOES_NOT_MATCH} - FIPS_R_EXE_DIGEST_DOES_NOT_MATCH = 105; - {$EXTERNALSYM FIPS_R_FINGERPRINT_DOES_NOT_MATCH} - FIPS_R_FINGERPRINT_DOES_NOT_MATCH = 110; - {$EXTERNALSYM FIPS_R_FINGERPRINT_DOES_NOT_MATCH_NONPIC_RELOCATED} - FIPS_R_FINGERPRINT_DOES_NOT_MATCH_NONPIC_RELOCATED = 111; - {$EXTERNALSYM FIPS_R_FINGERPRINT_DOES_NOT_MATCH_SEGMENT_ALIASING} - FIPS_R_FINGERPRINT_DOES_NOT_MATCH_SEGMENT_ALIASING = 112; - {$EXTERNALSYM FIPS_R_FIPS_MODE_ALREADY_SET} - FIPS_R_FIPS_MODE_ALREADY_SET = 102; - {$EXTERNALSYM FIPS_R_FIPS_SELFTEST_FAILED} - FIPS_R_FIPS_SELFTEST_FAILED = 106; - {$EXTERNALSYM FIPS_R_INVALID_KEY_LENGTH} - FIPS_R_INVALID_KEY_LENGTH = 109; - {$EXTERNALSYM FIPS_R_KEY_TOO_SHORT} - FIPS_R_KEY_TOO_SHORT = 108; - {$EXTERNALSYM FIPS_R_NON_FIPS_METHOD} - FIPS_R_NON_FIPS_METHOD = 100; - {$EXTERNALSYM FIPS_R_PAIRWISE_TEST_FAILED} - FIPS_R_PAIRWISE_TEST_FAILED = 107; - {$EXTERNALSYM FIPS_R_RSA_DECRYPT_ERROR} - FIPS_R_RSA_DECRYPT_ERROR = 115; - {$EXTERNALSYM FIPS_R_RSA_ENCRYPT_ERROR} - FIPS_R_RSA_ENCRYPT_ERROR = 116; - {$EXTERNALSYM FIPS_R_SELFTEST_FAILED} - FIPS_R_SELFTEST_FAILED = 101; - {$EXTERNALSYM FIPS_R_TEST_FAILURE} - FIPS_R_TEST_FAILURE = 117; - {$EXTERNALSYM FIPS_R_UNSUPPORTED_PLATFORM} - FIPS_R_UNSUPPORTED_PLATFORM = 113; - {$ENDIF} - {$IFNDEF OPENSSL_NO_ENGINE} -//* These flags are used to control combinations of algorithm (methods) -// * by bitwise "OR"ing. */ - {$EXTERNALSYM ENGINE_METHOD_RSA : TIdC_UINT} - ENGINE_METHOD_RSA : TIdC_UINT = $0001; - {$EXTERNALSYM ENGINE_METHOD_DSA : TIdC_UINT} - ENGINE_METHOD_DSA : TIdC_UINT = $0002; - {$EXTERNALSYM ENGINE_METHOD_DH : TIdC_UINT} - ENGINE_METHOD_DH : TIdC_UINT = $0004; - {$EXTERNALSYM ENGINE_METHOD_RAND : TIdC_UINT} - ENGINE_METHOD_RAND : TIdC_UINT = $0008; - {$EXTERNALSYM ENGINE_METHOD_ECDH : TIdC_UINT} - ENGINE_METHOD_ECDH : TIdC_UINT = $0010; - {$EXTERNALSYM ENGINE_METHOD_ECDSA : TIdC_UINT} - ENGINE_METHOD_ECDSA : TIdC_UINT = $0020; - {$EXTERNALSYM ENGINE_METHOD_CIPHERS : TIdC_UINT} - ENGINE_METHOD_CIPHERS : TIdC_UINT = $0040; - {$EXTERNALSYM ENGINE_METHOD_DIGESTS : TIdC_UINT} - ENGINE_METHOD_DIGESTS : TIdC_UINT = $0080; - {$EXTERNALSYM ENGINE_METHOD_STORE : TIdC_UINT} - ENGINE_METHOD_STORE : TIdC_UINT = $0100; - {$EXTERNALSYM ENGINE_METHOD_PKEY_METHS : TIdC_UINT} - ENGINE_METHOD_PKEY_METHS : TIdC_UINT = $0200; - {$EXTERNALSYM ENGINE_METHOD_PKEY_ASN1_METHS : TIdC_UINT} - ENGINE_METHOD_PKEY_ASN1_METHS : TIdC_UINT = $0400; - -//* Obvious all-or-nothing cases. */ - {$EXTERNALSYM ENGINE_METHOD_ALL : TIdC_UINT} - ENGINE_METHOD_ALL : TIdC_UINT = $FFFF; - {$EXTERNALSYM ENGINE_METHOD_NONE : TIdC_UINT} - ENGINE_METHOD_NONE : TIdC_UINT = $0000; - {$EXTERNALSYM ENGINE_TABLE_FLAG_NOINIT : TIdC_UINT} - ENGINE_TABLE_FLAG_NOINIT : TIdC_UINT = $0001; - - {$EXTERNALSYM ENGINE_FLAGS_MANUAL_CMD_CTRL : TIdC_INT} - ENGINE_FLAGS_MANUAL_CMD_CTRL : TIdC_INT = $0002; - {$EXTERNALSYM ENGINE_FLAGS_BY_ID_COPY : TIdC_INT} - ENGINE_FLAGS_BY_ID_COPY : TIdC_INT = $0004; - {$EXTERNALSYM ENGINE_CMD_FLAG_NUMERIC : TIdC_UINT} - ENGINE_CMD_FLAG_NUMERIC : TIdC_UINT = $0001; - {$EXTERNALSYM ENGINE_CMD_FLAG_STRING : TIdC_UINT} - ENGINE_CMD_FLAG_STRING : TIdC_UINT = $0002; - {$EXTERNALSYM ENGINE_CMD_FLAG_NO_INPUT : TIdC_UINT} - ENGINE_CMD_FLAG_NO_INPUT : TIdC_UINT = $0004; - {$EXTERNALSYM ENGINE_CMD_FLAG_INTERNAL : TIdC_UINT} - ENGINE_CMD_FLAG_INTERNAL : TIdC_UINT = $0008; - - {$EXTERNALSYM ENGINE_CTRL_SET_LOGSTREAM} - ENGINE_CTRL_SET_LOGSTREAM = 1; - {$EXTERNALSYM ENGINE_CTRL_SET_PASSWORD_CALLBACK} - ENGINE_CTRL_SET_PASSWORD_CALLBACK = 2; - {$EXTERNALSYM ENGINE_CTRL_HUP} - ENGINE_CTRL_HUP = 3; - //* Close and reinitialise any - // handles/connections etc. */ - {$EXTERNALSYM ENGINE_CTRL_SET_USER_INTERFACE} - ENGINE_CTRL_SET_USER_INTERFACE = 4; //* Alternative to callback */ - {$EXTERNALSYM _CALLBACK_DATA} - _CALLBACK_DATA = 5; - //* User-specific data, used - // when calling the password - // callback and the user - // interface */ - {$EXTERNALSYM D_CONFIGURATION} - D_CONFIGURATION = 6; - //* Load a configuration, given - //a string that represents a - //file name or so */ - {$EXTERNALSYM D_SECTION} - D_SECTION = 7; - ///* Load data from a given - //section in the already loaded - //configuration */ - -////* Returns non-zero if the supplied ENGINE has a ctrl() handler. If "not", then -// * all the remaining control commands will return failure, so it is worth -// * checking this first if the caller is trying to "discover" the engine's -// * capabilities and doesn't want errors generated unnecessarily. */ - {$EXTERNALSYM ENGINE_CTRL_HAS_CTRL_FUNCTION} - ENGINE_CTRL_HAS_CTRL_FUNCTION = 10; -///* Returns a positive command number for the first command supported by the -// * engine. Returns zero if no ctrl commands are supported. */ - {$EXTERNALSYM ENGINE_CTRL_GET_FIRST_CMD_TYPE} - ENGINE_CTRL_GET_FIRST_CMD_TYPE = 11; -///* The 'long' argument specifies a command implemented by the engine, and the -// * return value is the next command supported, or zero if there are no more. */ - {$EXTERNALSYM ENGINE_CTRL_GET_NEXT_CMD_TYPE} - ENGINE_CTRL_GET_NEXT_CMD_TYPE = 12; -///* The 'void*' argument is a command name (cast from 'const char *'), and the -// * return value is the command that corresponds to it. */ - {$EXTERNALSYM ENGINE_CTRL_GET_CMD_FROM_NAME} - ENGINE_CTRL_GET_CMD_FROM_NAME = 13; -///* The next two allow a command to be converted into its corresponding string -// * form. In each case, the 'long' argument supplies the command. In the NAME_LEN -// * case, the return value is the length of the command name (not counting a -// * trailing EOL). In the NAME case, the 'void*' argument must be a string buffer -// * large enough, and it will be populated with the name of the command (WITH a -// * trailing EOL). */ - {$EXTERNALSYM ENGINE_CTRL_GET_NAME_LEN_FROM_CMD} - ENGINE_CTRL_GET_NAME_LEN_FROM_CMD = 14; - {$EXTERNALSYM ENGINE_CTRL_GET_NAME_FROM_CMD} - ENGINE_CTRL_GET_NAME_FROM_CMD = 15; -//* The next two are similar but give a "short description" of a command. */ - {$EXTERNALSYM ENGINE_CTRL_GET_DESC_LEN_FROM_CMD} - ENGINE_CTRL_GET_DESC_LEN_FROM_CMD = 16; - {$EXTERNALSYM ENGINE_CTRL_GET_DESC_FROM_CMD} - ENGINE_CTRL_GET_DESC_FROM_CMD = 17; -///* With this command, the return value is the OR'd combination of -// * ENGINE_CMD_FLAG_*** values that indicate what kind of input a given -// * engine-specific ctrl command expects. */ - {$EXTERNALSYM ENGINE_CTRL_GET_CMD_FLAGS} - ENGINE_CTRL_GET_CMD_FLAGS = 18; - -///* ENGINE implementations should start the numbering of their own control -// * commands from this value. (ie. ENGINE_CMD_BASE, ENGINE_CMD_BASE + 1, etc). */ - {$EXTERNALSYM ENGINE_CMD_BASE} - ENGINE_CMD_BASE = 200; - -///* NB: These 2 nCipher "chil" control commands are deprecated, and their -// * functionality is now available through ENGINE-specific control commands -// * (exposed through the above-mentioned 'CMD'-handling). Code using these 2 -// * commands should be migrated to the more general command handling before these -// * are removed. */ - -//* Flags specific to the nCipher "chil" engine */ - {$EXTERNALSYM ENGINE_CTRL_CHIL_SET_FORKCHECK} - ENGINE_CTRL_CHIL_SET_FORKCHECK = 100; -///* Depending on the value of the (long)i argument, this sets or -// * unsets the SimpleForkCheck flag in the CHIL API to enable or -// * disable checking and workarounds for applications that fork(). -// */ - {$EXTERNALSYM ENGINE_CTRL_CHIL_NO_LOCKING} - ENGINE_CTRL_CHIL_NO_LOCKING = 101; -///* This prevents the initialisation function from providing mutex -// * callbacks to the nCipher library. */ - -///* Binary/behaviour compatibility levels */ - {$EXTERNALSYM OSSL_DYNAMIC_VERSION : TIdC_UINT} - OSSL_DYNAMIC_VERSION : TIdC_UINT = $00020000; -///* Binary versions older than this are too old for us (whether we're a loader or -// * a loadee) */ - {$EXTERNALSYM OSSL_DYNAMIC_OLDEST : TIdC_UINT} - OSSL_DYNAMIC_OLDEST : TIdC_UINT = $00020000; -//* Function codes. */ - {$EXTERNALSYM ENGINE_F_DYNAMIC_CTRL} - ENGINE_F_DYNAMIC_CTRL = 180; - {$EXTERNALSYM ENGINE_F_DYNAMIC_GET_DATA_CTX} - ENGINE_F_DYNAMIC_GET_DATA_CTX = 181; - {$EXTERNALSYM ENGINE_F_DYNAMIC_LOAD} - ENGINE_F_DYNAMIC_LOAD = 182; - {$EXTERNALSYM ENGINE_F_DYNAMIC_SET_DATA_CTX} - ENGINE_F_DYNAMIC_SET_DATA_CTX = 183; - {$EXTERNALSYM ENGINE_F_ENGINE_ADD} - ENGINE_F_ENGINE_ADD = 105; - {$EXTERNALSYM ENGINE_F_ENGINE_BY_ID} - ENGINE_F_ENGINE_BY_ID = 106; - {$EXTERNALSYM ENGINE_F_ENGINE_CMD_IS_EXECUTABLE} - ENGINE_F_ENGINE_CMD_IS_EXECUTABLE = 170; - {$EXTERNALSYM ENGINE_F_ENGINE_CTRL} - ENGINE_F_ENGINE_CTRL = 142; - {$EXTERNALSYM ENGINE_F_ENGINE_CTRL_CMD} - ENGINE_F_ENGINE_CTRL_CMD = 178; - {$EXTERNALSYM ENGINE_F_ENGINE_CTRL_CMD_STRING} - ENGINE_F_ENGINE_CTRL_CMD_STRING = 171; - {$EXTERNALSYM ENGINE_F_ENGINE_FINISH} - ENGINE_F_ENGINE_FINISH = 107; - {$EXTERNALSYM ENGINE_F_ENGINE_FREE_UTIL} - ENGINE_F_ENGINE_FREE_UTIL = 108; - {$EXTERNALSYM ENGINE_F_ENGINE_GET_CIPHER} - ENGINE_F_ENGINE_GET_CIPHER = 185; - {$EXTERNALSYM ENGINE_F_ENGINE_GET_DEFAULT_TYPE} - ENGINE_F_ENGINE_GET_DEFAULT_TYPE = 177; - {$EXTERNALSYM ENGINE_F_ENGINE_GET_DIGEST} - ENGINE_F_ENGINE_GET_DIGEST = 186; - {$EXTERNALSYM ENGINE_F_ENGINE_GET_NEXT} - ENGINE_F_ENGINE_GET_NEXT = 115; - {$EXTERNALSYM ENGINE_F_ENGINE_GET_PKEY_ASN1_METH} - ENGINE_F_ENGINE_GET_PKEY_ASN1_METH = 193; - {$EXTERNALSYM ENGINE_F_ENGINE_GET_PKEY_METH} - ENGINE_F_ENGINE_GET_PKEY_METH = 192; - {$EXTERNALSYM ENGINE_F_ENGINE_GET_PREV} - ENGINE_F_ENGINE_GET_PREV = 116; - {$EXTERNALSYM ENGINE_F_ENGINE_INIT} - ENGINE_F_ENGINE_INIT = 119; - {$EXTERNALSYM ENGINE_F_ENGINE_LIST_ADD} - ENGINE_F_ENGINE_LIST_ADD = 120; - {$EXTERNALSYM ENGINE_F_ENGINE_LIST_REMOVE} - ENGINE_F_ENGINE_LIST_REMOVE = 121; - {$EXTERNALSYM ENGINE_F_ENGINE_LOAD_PRIVATE_KEY} - ENGINE_F_ENGINE_LOAD_PRIVATE_KEY = 150; - {$EXTERNALSYM ENGINE_F_ENGINE_LOAD_PUBLIC_KEY} - ENGINE_F_ENGINE_LOAD_PUBLIC_KEY = 151; - //was ENGINE_F_ENGINE_LOAD_SSL_CLIENT_CERT = 192; - {$EXTERNALSYM ENGINE_F_ENGINE_LOAD_SSL_CLIENT_CERT} - ENGINE_F_ENGINE_LOAD_SSL_CLIENT_CERT = 194; - - {$EXTERNALSYM ENGINE_F_ENGINE_NEW} - ENGINE_F_ENGINE_NEW = 122; - {$EXTERNALSYM ENGINE_F_ENGINE_REMOVE} - ENGINE_F_ENGINE_REMOVE = 123; - {$EXTERNALSYM ENGINE_F_ENGINE_SET_DEFAULT_STRING} - ENGINE_F_ENGINE_SET_DEFAULT_STRING = 189; - {$EXTERNALSYM ENGINE_F_ENGINE_SET_DEFAULT_TYPE} - ENGINE_F_ENGINE_SET_DEFAULT_TYPE = 126; - {$EXTERNALSYM ENGINE_F_ENGINE_SET_ID} - ENGINE_F_ENGINE_SET_ID = 129; - {$EXTERNALSYM ENGINE_F_ENGINE_SET_NAME} - ENGINE_F_ENGINE_SET_NAME = 130; - {$EXTERNALSYM ENGINE_F_ENGINE_TABLE_REGISTER} - ENGINE_F_ENGINE_TABLE_REGISTER = 184; - {$EXTERNALSYM ENGINE_F_ENGINE_UNLOAD_KEY} - ENGINE_F_ENGINE_UNLOAD_KEY = 152; - {$EXTERNALSYM ENGINE_F_ENGINE_UNLOCKED_FINISH} - ENGINE_F_ENGINE_UNLOCKED_FINISH = 191; - {$EXTERNALSYM ENGINE_F_ENGINE_UP_REF} - ENGINE_F_ENGINE_UP_REF = 190; - {$EXTERNALSYM ENGINE_F_INT_CTRL_HELPER} - ENGINE_F_INT_CTRL_HELPER = 172; - {$EXTERNALSYM ENGINE_F_INT_ENGINE_CONFIGURE} - ENGINE_F_INT_ENGINE_CONFIGURE = 188; - {$EXTERNALSYM ENGINE_F_INT_ENGINE_MODULE_INIT} - ENGINE_F_INT_ENGINE_MODULE_INIT = 187; - {$EXTERNALSYM ENGINE_F_LOG_MESSAGE} - ENGINE_F_LOG_MESSAGE = 141; -//* Reason codes. */ - {$EXTERNALSYM ENGINE_R_ALREADY_LOADED} - ENGINE_R_ALREADY_LOADED = 100; - {$EXTERNALSYM ENGINE_R_ARGUMENT_IS_NOT_A_NUMBER} - ENGINE_R_ARGUMENT_IS_NOT_A_NUMBER = 133; - {$EXTERNALSYM ENGINE_R_CMD_NOT_EXECUTABLE} - ENGINE_R_CMD_NOT_EXECUTABLE = 134; - {$EXTERNALSYM ENGINE_R_COMMAND_TAKES_INPUT} - ENGINE_R_COMMAND_TAKES_INPUT = 135; - {$EXTERNALSYM ENGINE_R_COMMAND_TAKES_NO_INPUT} - ENGINE_R_COMMAND_TAKES_NO_INPUT = 136; - {$EXTERNALSYM ENGINE_R_CONFLICTING_ENGINE_ID} - ENGINE_R_CONFLICTING_ENGINE_ID = 103; - {$EXTERNALSYM ENGINE_R_CTRL_COMMAND_NOT_IMPLEMENTED} - ENGINE_R_CTRL_COMMAND_NOT_IMPLEMENTED = 119; - {$EXTERNALSYM ENGINE_R_DH_NOT_IMPLEMENTED} - ENGINE_R_DH_NOT_IMPLEMENTED = 139; - {$EXTERNALSYM ENGINE_R_DSA_NOT_IMPLEMENTED} - ENGINE_R_DSA_NOT_IMPLEMENTED = 140; - {$EXTERNALSYM ENGINE_R_DSO_FAILURE} - ENGINE_R_DSO_FAILURE = 104; - {$EXTERNALSYM ENGINE_R_DSO_NOT_FOUND} - ENGINE_R_DSO_NOT_FOUND = 132; - {$EXTERNALSYM ENGINE_R_ENGINES_SECTION_ERROR} - ENGINE_R_ENGINES_SECTION_ERROR = 148; -//was: ENGINE_R_ENGINE_CONFIGURATION_ERROR = 101; - {$EXTERNALSYM ENGINE_R_ENGINE_CONFIGURATION_ERROR} - ENGINE_R_ENGINE_CONFIGURATION_ERROR = 102; - - {$EXTERNALSYM ENGINE_R_ENGINE_IS_NOT_IN_LIST} - ENGINE_R_ENGINE_IS_NOT_IN_LIST = 105; - {$EXTERNALSYM ENGINE_R_ENGINE_SECTION_ERROR} - ENGINE_R_ENGINE_SECTION_ERROR = 149; - {$EXTERNALSYM ENGINE_R_FAILED_LOADING_PRIVATE_KEY} - ENGINE_R_FAILED_LOADING_PRIVATE_KEY = 128; - {$EXTERNALSYM ENGINE_R_FAILED_LOADING_PUBLIC_KEY} - ENGINE_R_FAILED_LOADING_PUBLIC_KEY = 129; - {$EXTERNALSYM ENGINE_R_FINISH_FAILED} - ENGINE_R_FINISH_FAILED = 106; - {$EXTERNALSYM ENGINE_R_GET_HANDLE_FAILED} - ENGINE_R_GET_HANDLE_FAILED = 107; - {$EXTERNALSYM ENGINE_R_ID_OR_NAME_MISSING} - ENGINE_R_ID_OR_NAME_MISSING = 108; - {$EXTERNALSYM ENGINE_R_INIT_FAILED} - ENGINE_R_INIT_FAILED = 109; - {$EXTERNALSYM ENGINE_R_INTERNAL_LIST_ERROR} - ENGINE_R_INTERNAL_LIST_ERROR = 110; - {$EXTERNALSYM ENGINE_R_INVALID_ARGUMENT} - ENGINE_R_INVALID_ARGUMENT = 143; - {$EXTERNALSYM ENGINE_R_INVALID_CMD_NAME} - ENGINE_R_INVALID_CMD_NAME = 137; - {$EXTERNALSYM ENGINE_R_INVALID_CMD_NUMBER} - ENGINE_R_INVALID_CMD_NUMBER = 138; - {$EXTERNALSYM ENGINE_R_INVALID_INIT_VALUE} - ENGINE_R_INVALID_INIT_VALUE = 151; - {$EXTERNALSYM ENGINE_R_INVALID_STRING} - ENGINE_R_INVALID_STRING = 150; - {$EXTERNALSYM ENGINE_R_NOT_INITIALISED} - ENGINE_R_NOT_INITIALISED = 117; - {$EXTERNALSYM ENGINE_R_NOT_LOADED} - ENGINE_R_NOT_LOADED = 112; - {$EXTERNALSYM ENGINE_R_NO_CONTROL_FUNCTION} - ENGINE_R_NO_CONTROL_FUNCTION = 120; - {$EXTERNALSYM ENGINE_R_NO_INDEX} - ENGINE_R_NO_INDEX = 144; - {$EXTERNALSYM ENGINE_R_NO_LOAD_FUNCTION} - ENGINE_R_NO_LOAD_FUNCTION = 125; - {$EXTERNALSYM ENGINE_R_NO_REFERENCE} - ENGINE_R_NO_REFERENCE = 130; - {$EXTERNALSYM ENGINE_R_NO_SUCH_ENGINE} - ENGINE_R_NO_SUCH_ENGINE = 116; - {$EXTERNALSYM ENGINE_R_NO_UNLOAD_FUNCTION} - ENGINE_R_NO_UNLOAD_FUNCTION = 126; - {$EXTERNALSYM ENGINE_R_PROVIDE_PARAMETERS} - ENGINE_R_PROVIDE_PARAMETERS = 113; - {$EXTERNALSYM ENGINE_R_RSA_NOT_IMPLEMENTED} - ENGINE_R_RSA_NOT_IMPLEMENTED = 141; - {$EXTERNALSYM ENGINE_R_UNIMPLEMENTED_CIPHER} - ENGINE_R_UNIMPLEMENTED_CIPHER = 146; - {$EXTERNALSYM ENGINE_R_UNIMPLEMENTED_DIGEST} - ENGINE_R_UNIMPLEMENTED_DIGEST = 147; - {$EXTERNALSYM ENGINE_R_UNIMPLEMENTED_PUBLIC_KEY_METHOD} - ENGINE_R_UNIMPLEMENTED_PUBLIC_KEY_METHOD = 101; - {$EXTERNALSYM ENGINE_R_VERSION_INCOMPATIBILITY} - ENGINE_R_VERSION_INCOMPATIBILITY = 145; -{$ENDIF} - {$EXTERNALSYM MSS_EXIT_FAILURE} - MSS_EXIT_FAILURE = 1; - {$EXTERNALSYM MSS_EXIT_SUCCESS} - MSS_EXIT_SUCCESS = 0; - {$EXTERNALSYM FILENAME_MAX} - FILENAME_MAX = 1024; - {$EXTERNALSYM FOPEN_MAX} - FOPEN_MAX = 20; - {$IFNDEF OPENSSL_NO_IDEA} - {$EXTERNALSYM IDEA_BLOCK} - IDEA_BLOCK = 8; - {$EXTERNALSYM IDEA_DECRYPT} - IDEA_DECRYPT = 0; - {$EXTERNALSYM IDEA_ENCRYPT} - IDEA_ENCRYPT = 1; - {$EXTERNALSYM IDEA_KEY_LENGTH} - IDEA_KEY_LENGTH = 16; - {$ENDIF} - {$EXTERNALSYM IS_SEQUENCE} - IS_SEQUENCE = 0; - {$EXTERNALSYM IS_SET} - IS_SET = 1; - {$EXTERNALSYM KRBDES_DECRYPT} - KRBDES_DECRYPT = DES_DECRYPT; - {$EXTERNALSYM KRBDES_ENCRYPT} - KRBDES_ENCRYPT = DES_ENCRYPT; - {$EXTERNALSYM LH_LOAD_MULT} - LH_LOAD_MULT = 256; - {$EXTERNALSYM L_ctermid} - L_ctermid = 16; - {$EXTERNALSYM L_cuserid} - L_cuserid = 9; - {$EXTERNALSYM L_tmpnam} - L_tmpnam = 1024; - //chamellia.h - {$IFNDEF OPENSSL_NO_CAMELLIA} - {$EXTERNALSYM CAMELLIA_ENCRYPT} - CAMELLIA_ENCRYPT = 1; - {$EXTERNALSYM CAMELLIA_DECRYPT} - CAMELLIA_DECRYPT = 0; -//* This should be a hidden type, but EVP requires that the size be known */ - - {$EXTERNALSYM CAMELLIA_BLOCK_SIZE} - CAMELLIA_BLOCK_SIZE = 16; - {$EXTERNALSYM CAMELLIA_TABLE_BYTE_LEN} - CAMELLIA_TABLE_BYTE_LEN = 272; - {$EXTERNALSYM CAMELLIA_TABLE_WORD_LEN} - CAMELLIA_TABLE_WORD_LEN = (CAMELLIA_TABLE_BYTE_LEN / 4); - {$ENDIF} - //whrlpool.h - {$EXTERNALSYM WHIRLPOOL_DIGEST_LENGTH} - WHIRLPOOL_DIGEST_LENGTH = (512 div 8); - {$EXTERNALSYM WHIRLPOOL_BBLOCK} - WHIRLPOOL_BBLOCK = 512; - {$EXTERNALSYM WHIRLPOOL_COUNTER} - WHIRLPOOL_COUNTER = (256 div 8); - {$IFNDEF OPENSSL_NO_MD2} - {$EXTERNALSYM MD2_BLOCK} - MD2_BLOCK = 16; - {$EXTERNALSYM MD2_DIGEST_LENGTH} - MD2_DIGEST_LENGTH = 16; - {$ENDIF} - {$IFNDEF OPENSSL_NO_MD4} - {$EXTERNALSYM MD4_CBLOCK} - MD4_CBLOCK = 64; - {$EXTERNALSYM MD4_LBLOCK} - MD4_LBLOCK = (MD4_CBLOCK div 4); - {$EXTERNALSYM MD4_DIGEST_LENGTH} - MD4_DIGEST_LENGTH = 16; - {$ENDIF} - {$IFNDEF OPENSSL_NO_MD5} - {$EXTERNALSYM MD5_CBLOCK} - MD5_CBLOCK = 64; - {$EXTERNALSYM MD5_LBLOCK} - MD5_LBLOCK = 16; //(MD5_CBLOCK/4); - {$EXTERNALSYM MD5_DIGEST_LENGTH} - MD5_DIGEST_LENGTH = 16; - {$ENDIF} - {$IFNDEF OPENSSL_NO_MDC2} - {$EXTERNALSYM OPENSSL_MDC2_BLOCK} - OPENSSL_MDC2_BLOCK = 8; - {$EXTERNALSYM OPENSSL_MDC2_DIGEST_LENGTH} - OPENSSL_MDC2_DIGEST_LENGTH = 16; - {$ENDIF} - {$IFNDEF OPENSSL_NO_SHA} - {$EXTERNALSYM SHA_LBLOCK} - SHA_LBLOCK = 16; - {$EXTERNALSYM SHA_CBLOCK} - SHA_CBLOCK = 64; //(SHA_LBLOCK * 4); - {$EXTERNALSYM SHA_DIGEST_LENGTH} - SHA_DIGEST_LENGTH = 20; - {$EXTERNALSYM SHA_LAST_BLOCK} - SHA_LAST_BLOCK = ( SHA_CBLOCK -8); - {$EXTERNALSYM SHA256_CBLOCK} - SHA256_CBLOCK = ( SHA_LBLOCK * 4); - {$EXTERNALSYM SHA224_DIGEST_LENGTH} - SHA224_DIGEST_LENGTH = 28; - {$EXTERNALSYM SHA256_DIGEST_LENGTH} - SHA256_DIGEST_LENGTH = 32; - {$EXTERNALSYM SHA384_DIGEST_LENGTH} - SHA384_DIGEST_LENGTH = 48; - {$EXTERNALSYM SHA512_DIGEST_LENGTH} - SHA512_DIGEST_LENGTH = 64; - {$IFNDEF OPENSSL_NO_SHA512} - {$EXTERNALSYM SHA512_CBLOCK} - SHA512_CBLOCK = (SHA_LBLOCK*8); - {$ENDIF} - {$ENDIF} - {$EXTERNALSYM LN_SMIMECapabilities} - LN_SMIMECapabilities = 'S/MIME Capabilities'; {Do not localize} - {$EXTERNALSYM LN_X500} - LN_X500 = 'X500'; {Do not localize} - {$EXTERNALSYM LN_X509} - LN_X509 = 'X509'; {Do not localize} - {$EXTERNALSYM LN_algorithm} - LN_algorithm = 'algorithm'; {Do not localize} - {$EXTERNALSYM LN_authority_key_identifier} - LN_authority_key_identifier = 'X509v3 Authority Key Identifier'; {Do not localize} - {$EXTERNALSYM LN_basic_constraints} - LN_basic_constraints = 'X509v3 Basic Constraints'; {Do not localize} - {$EXTERNALSYM LN_bf_cbc} - LN_bf_cbc = 'bf-cbc'; {Do not localize} - {$EXTERNALSYM LN_bf_cfb64} - LN_bf_cfb64 = 'bf-cfb'; {Do not localize} - {$EXTERNALSYM LN_bf_ecb} - LN_bf_ecb = 'bf-ecb'; {Do not localize} - {$EXTERNALSYM LN_bf_ofb64} - LN_bf_ofb64 = 'bf-ofb'; {Do not localize} - {$EXTERNALSYM LN_cast5_cbc} - LN_cast5_cbc = 'cast5-cbc'; {Do not localize} - {$EXTERNALSYM LN_cast5_cfb64} - LN_cast5_cfb64 = 'cast5-cfb'; {Do not localize} - {$EXTERNALSYM LN_cast5_ecb} - LN_cast5_ecb = 'cast5-ecb'; {Do not localize} - {$EXTERNALSYM LN_cast5_ofb64} - LN_cast5_ofb64 = 'cast5-ofb'; {Do not localize} - {$EXTERNALSYM LN_certBag} - LN_certBag = 'certBag'; {Do not localize} - {$EXTERNALSYM LN_certificate_policies} - LN_certificate_policies = 'X509v3 Certificate Policies'; {Do not localize} - {$EXTERNALSYM LN_client_auth} - LN_client_auth = 'TLS Web Client Authentication'; {Do not localize} - {$EXTERNALSYM LN_code_sign} - LN_code_sign = 'Code Signing'; {Do not localize} - {$EXTERNALSYM LN_commonName} - LN_commonName = 'commonName'; {Do not localize} - {$EXTERNALSYM LN_countryName} - LN_countryName = 'countryName'; {Do not localize} - {$EXTERNALSYM LN_crlBag} - LN_crlBag = 'crlBag'; {Do not localize} - {$EXTERNALSYM LN_crl_distribution_points} - LN_crl_distribution_points = 'X509v3 CRL Distribution Points'; {Do not localize} - {$EXTERNALSYM LN_crl_number} - LN_crl_number = 'X509v3 CRL Number'; {Do not localize} - {$EXTERNALSYM LN_crl_reason} - LN_crl_reason = 'CRL Reason Code'; {Do not localize} - {$EXTERNALSYM LN_delta_crl} - LN_delta_crl = 'X509v3 Delta CRL Indicator'; {Do not localize} - {$EXTERNALSYM LN_des_cbc} - LN_des_cbc = 'des-cbc'; {Do not localize} - {$EXTERNALSYM LN_des_cfb64} - LN_des_cfb64 = 'des-cfb'; {Do not localize} - {$EXTERNALSYM LN_des_ecb} - LN_des_ecb = 'des-ecb'; {Do not localize} - {$EXTERNALSYM LN_des_ede} - LN_des_ede = 'des-ede'; {Do not localize} - {$EXTERNALSYM LN_des_ede3} - LN_des_ede3 = 'des-ede3'; {Do not localize} - {$EXTERNALSYM LN_des_ede3_cbc} - LN_des_ede3_cbc = 'des-ede3-cbc'; {Do not localize} - {$EXTERNALSYM LN_des_ede3_cfb64} - LN_des_ede3_cfb64 = 'des-ede3-cfb'; {Do not localize} - {$EXTERNALSYM LN_des_ede3_ofb64} - LN_des_ede3_ofb64 = 'des-ede3-ofb'; {Do not localize} - {$EXTERNALSYM LN_des_ede_cbc} - LN_des_ede_cbc = 'des-ede-cbc'; {Do not localize} - {$EXTERNALSYM LN_des_ede_cfb64} - LN_des_ede_cfb64 = 'des-ede-cfb'; {Do not localize} - {$EXTERNALSYM LN_des_ede_ofb64} - LN_des_ede_ofb64 = 'des-ede-ofb'; {Do not localize} - {$EXTERNALSYM LN_des_ofb64} - LN_des_ofb64 = 'des-ofb'; {Do not localize} - {$EXTERNALSYM LN_description} - LN_description = 'description'; {Do not localize} - {$EXTERNALSYM LN_desx_cbc} - LN_desx_cbc = 'desx-cbc'; {Do not localize} - {$EXTERNALSYM LN_dhKeyAgreement} - LN_dhKeyAgreement = 'dhKeyAgreement'; {Do not localize} - {$EXTERNALSYM LN_dsa} - LN_dsa = 'dsaEncryption'; {Do not localize} - {$EXTERNALSYM LN_dsaWithSHA} - LN_dsaWithSHA = 'dsaWithSHA'; {Do not localize} - {$EXTERNALSYM LN_dsaWithSHA1} - LN_dsaWithSHA1 = 'dsaWithSHA1'; {Do not localize} - {$EXTERNALSYM LN_dsaWithSHA1_2} - LN_dsaWithSHA1_2 = 'dsaWithSHA1-old'; {Do not localize} - {$EXTERNALSYM LN_dsa_2} - LN_dsa_2 = 'dsaEncryption-old'; {Do not localize} - {$EXTERNALSYM LN_email_protect} - LN_email_protect = 'E-mail Protection'; {Do not localize} - {$EXTERNALSYM LN_ext_key_usage} - LN_ext_key_usage = 'X509v3 Extended Key Usage'; {Do not localize} - {$EXTERNALSYM LN_friendlyName} - LN_friendlyName = 'friendlyName'; {Do not localize} - {$EXTERNALSYM LN_givenName} - LN_givenName = 'givenName'; {Do not localize} - {$EXTERNALSYM LN_hmacWithSHA1} - LN_hmacWithSHA1 = 'hmacWithSHA1'; {Do not localize} - {$EXTERNALSYM LN_id_pbkdf2} - LN_id_pbkdf2 = 'PBKDF2'; {Do not localize} - {$EXTERNALSYM LN_id_qt_cps} - LN_id_qt_cps = 'Policy Qualifier CPS'; {Do not localize} - {$EXTERNALSYM LN_id_qt_unotice} - LN_id_qt_unotice = 'Policy Qualifier User Notice'; {Do not localize} - {$EXTERNALSYM LN_idea_cbc} - LN_idea_cbc = 'idea-cbc'; {Do not localize} - {$EXTERNALSYM LN_idea_cfb64} - LN_idea_cfb64 = 'idea-cfb'; {Do not localize} - {$EXTERNALSYM LN_idea_ecb} - LN_idea_ecb = 'idea-ecb'; {Do not localize} - {$EXTERNALSYM LN_idea_ofb64} - LN_idea_ofb64 = 'idea-ofb'; {Do not localize} - {$EXTERNALSYM LN_initials} - LN_initials = 'initials'; {Do not localize} - {$EXTERNALSYM LN_invalidity_date} - LN_invalidity_date = 'Invalidity Date'; {Do not localize} - {$EXTERNALSYM LN_issuer_alt_name} - LN_issuer_alt_name = 'X509v3 Issuer Alternative Name'; {Do not localize} - {$EXTERNALSYM LN_keyBag} - LN_keyBag = 'keyBag'; {Do not localize} - {$EXTERNALSYM LN_key_usage} - LN_key_usage = 'X509v3 Key Usage'; {Do not localize} - {$EXTERNALSYM LN_localKeyID} - LN_localKeyID = 'localKeyID'; {Do not localize} - {$EXTERNALSYM LN_localityName} - LN_localityName = 'localityName'; {Do not localize} - {$EXTERNALSYM LN_md2} - LN_md2 = 'md2'; {Do not localize} - {$EXTERNALSYM LN_md2WithRSAEncryption} - LN_md2WithRSAEncryption = 'md2WithRSAEncryption'; {Do not localize} - {$EXTERNALSYM LN_md4} - LN_md4 = 'md4'; {Do not localize} - {$EXTERNALSYM LN_md5} - LN_md5 = 'md5'; {Do not localize} - {$EXTERNALSYM LN_md5WithRSA} - LN_md5WithRSA = 'md5WithRSA'; {Do not localize} - {$EXTERNALSYM LN_md5WithRSAEncryption} - LN_md5WithRSAEncryption = 'md5WithRSAEncryption'; {Do not localize} - {$EXTERNALSYM LN_md5_sha1} - LN_md5_sha1 = 'md5-sha1'; {Do not localize} - {$EXTERNALSYM LN_mdc2} - LN_mdc2 = 'mdc2'; {Do not localize} - {$EXTERNALSYM LN_mdc2WithRSA} - LN_mdc2WithRSA = 'mdc2withRSA'; {Do not localize} - {$EXTERNALSYM LN_ms_code_com} - LN_ms_code_com = 'Microsoft Commercial Code Signing'; {Do not localize} - {$EXTERNALSYM LN_ms_code_ind} - LN_ms_code_ind = 'Microsoft Individual Code Signing'; {Do not localize} - {$EXTERNALSYM LN_ms_ctl_sign} - LN_ms_ctl_sign = 'Microsoft Trust List Signing'; {Do not localize} - {$EXTERNALSYM LN_ms_efs} - LN_ms_efs = 'Microsoft Encrypted File System'; {Do not localize} - {$EXTERNALSYM LN_ms_sgc} - LN_ms_sgc = 'Microsoft Server Gated Crypto'; {Do not localize} - {$EXTERNALSYM LN_netscape} - LN_netscape = 'Netscape Communications Corp.'; {Do not localize} - {$EXTERNALSYM LN_netscape_base_url} - LN_netscape_base_url = 'Netscape Base Url'; {Do not localize} - {$EXTERNALSYM LN_netscape_ca_policy_url} - LN_netscape_ca_policy_url = 'Netscape CA Policy Url'; {Do not localize} - {$EXTERNALSYM LN_netscape_ca_revocation_url} - LN_netscape_ca_revocation_url = 'Netscape CA Revocation Url'; {Do not localize} - {$EXTERNALSYM LN_netscape_cert_extension} - LN_netscape_cert_extension = 'Netscape Certificate Extension'; {Do not localize} - {$EXTERNALSYM LN_netscape_cert_sequence} - LN_netscape_cert_sequence = 'Netscape Certificate Sequence'; {Do not localize} - {$EXTERNALSYM LN_netscape_cert_type} - LN_netscape_cert_type = 'Netscape Cert Type'; {Do not localize} - {$EXTERNALSYM LN_netscape_comment} - LN_netscape_comment = 'Netscape Comment'; {Do not localize} - {$EXTERNALSYM LN_netscape_data_type} - LN_netscape_data_type = 'Netscape Data Type'; {Do not localize} - {$EXTERNALSYM LN_netscape_renewal_url} - LN_netscape_renewal_url = 'Netscape Renewal Url'; {Do not localize} - {$EXTERNALSYM LN_netscape_revocation_url} - LN_netscape_revocation_url = 'Netscape Revocation Url'; {Do not localize} - {$EXTERNALSYM LN_netscape_ssl_server_name} - LN_netscape_ssl_server_name = 'Netscape SSL Server Name'; {Do not localize} - {$EXTERNALSYM LN_ns_sgc} - LN_ns_sgc = 'Netscape Server Gated Crypto'; {Do not localize} - {$EXTERNALSYM LN_organizationName} - LN_organizationName = 'organizationName'; {Do not localize} - {$EXTERNALSYM LN_organizationalUnitName} - LN_organizationalUnitName = 'organizationalUnitName'; {Do not localize} - {$EXTERNALSYM LN_pbeWithMD2AndDES_CBC} - LN_pbeWithMD2AndDES_CBC = 'pbeWithMD2AndDES-CBC'; {Do not localize} - {$EXTERNALSYM LN_pbeWithMD2AndRC2_CBC} - LN_pbeWithMD2AndRC2_CBC = 'pbeWithMD2AndRC2-CBC'; {Do not localize} - {$EXTERNALSYM LN_pbeWithMD5AndCast5_CBC} - LN_pbeWithMD5AndCast5_CBC = 'pbeWithMD5AndCast5CBC'; {Do not localize} - {$EXTERNALSYM LN_pbeWithMD5AndDES_CBC} - LN_pbeWithMD5AndDES_CBC = 'pbeWithMD5AndDES-CBC'; {Do not localize} - {$EXTERNALSYM LN_pbeWithMD5AndRC2_CBC} - LN_pbeWithMD5AndRC2_CBC = 'pbeWithMD5AndRC2-CBC'; {Do not localize} - {$EXTERNALSYM LN_pbeWithSHA1AndDES_CBC} - LN_pbeWithSHA1AndDES_CBC = 'pbeWithSHA1AndDES-CBC'; {Do not localize} - {$EXTERNALSYM LN_pbeWithSHA1AndRC2_CBC} - LN_pbeWithSHA1AndRC2_CBC = 'pbeWithSHA1AndRC2-CBC'; {Do not localize} - {$EXTERNALSYM LN_pbe_WithSHA1And128BitRC2_CBC} - LN_pbe_WithSHA1And128BitRC2_CBC = 'pbeWithSHA1And128BitRC2-CBC'; {Do not localize} - {$EXTERNALSYM LN_pbe_WithSHA1And128BitRC4} - LN_pbe_WithSHA1And128BitRC4 = 'pbeWithSHA1And128BitRC4'; {Do not localize} - {$EXTERNALSYM LN_pbe_WithSHA1And2_Key_TripleDES_CBC} - LN_pbe_WithSHA1And2_Key_TripleDES_CBC = 'pbeWithSHA1And2-KeyTripleDES-CBC'; {Do not localize} - {$EXTERNALSYM LN_pbe_WithSHA1And3_Key_TripleDES_CBC} - LN_pbe_WithSHA1And3_Key_TripleDES_CBC = 'pbeWithSHA1And3-KeyTripleDES-CBC'; {Do not localize} - {$EXTERNALSYM LN_pbe_WithSHA1And40BitRC2_CBC} - LN_pbe_WithSHA1And40BitRC2_CBC = 'pbeWithSHA1And40BitRC2-CBC'; {Do not localize} - {$EXTERNALSYM LN_pbe_WithSHA1And40BitRC4} - LN_pbe_WithSHA1And40BitRC4 = 'pbeWithSHA1And40BitRC4'; {Do not localize} - {$EXTERNALSYM LN_pbes2} - LN_pbes2 = 'PBES2'; {Do not localize} - {$EXTERNALSYM LN_pbmac1} - LN_pbmac1 = 'PBMAC1'; {Do not localize} - {$EXTERNALSYM LN_pkcs} - LN_pkcs = 'pkcs'; {Do not localize} - {$EXTERNALSYM LN_pkcs3} - LN_pkcs3 = 'pkcs3'; {Do not localize} - {$EXTERNALSYM LN_pkcs7} - LN_pkcs7 = 'pkcs7'; {Do not localize} - {$EXTERNALSYM LN_pkcs7_data} - LN_pkcs7_data = 'pkcs7-data'; {Do not localize} - {$EXTERNALSYM LN_pkcs7_digest} - LN_pkcs7_digest = 'pkcs7-digestData'; {Do not localize} - {$EXTERNALSYM LN_pkcs7_encrypted} - LN_pkcs7_encrypted = 'pkcs7-encryptedData'; {Do not localize} - {$EXTERNALSYM LN_pkcs7_enveloped} - LN_pkcs7_enveloped = 'pkcs7-envelopedData'; {Do not localize} - {$EXTERNALSYM LN_pkcs7_signed} - LN_pkcs7_signed = 'pkcs7-signedData'; {Do not localize} - {$EXTERNALSYM LN_pkcs7_signedAndEnveloped} - LN_pkcs7_signedAndEnveloped = 'pkcs7-signedAndEnvelopedData'; {Do not localize} - {$EXTERNALSYM LN_pkcs8ShroudedKeyBag} - LN_pkcs8ShroudedKeyBag = 'pkcs8ShroudedKeyBag'; {Do not localize} - {$EXTERNALSYM LN_pkcs9} - LN_pkcs9 = 'pkcs9'; {Do not localize} - {$EXTERNALSYM LN_pkcs9_challengePassword} - LN_pkcs9_challengePassword = 'challengePassword'; {Do not localize} - {$EXTERNALSYM LN_pkcs9_contentType} - LN_pkcs9_contentType = 'contentType'; {Do not localize} - {$EXTERNALSYM LN_pkcs9_countersignature} - LN_pkcs9_countersignature = 'countersignature'; {Do not localize} - {$EXTERNALSYM LN_pkcs9_emailAddress} - LN_pkcs9_emailAddress = 'emailAddress'; {Do not localize} - {$EXTERNALSYM LN_pkcs9_extCertAttributes} - LN_pkcs9_extCertAttributes = 'extendedCertificateAttributes'; {Do not localize} - {$EXTERNALSYM LN_pkcs9_messageDigest} - LN_pkcs9_messageDigest = 'messageDigest'; {Do not localize} - {$EXTERNALSYM LN_pkcs9_signingTime} - LN_pkcs9_signingTime = 'signingTime'; {Do not localize} - {$EXTERNALSYM LN_pkcs9_unstructuredAddress} - LN_pkcs9_unstructuredAddress = 'unstructuredAddress'; {Do not localize} - {$EXTERNALSYM LN_pkcs9_unstructuredName} - LN_pkcs9_unstructuredName = 'unstructuredName'; {Do not localize} - {$EXTERNALSYM LN_private_key_usage_period} - LN_private_key_usage_period = 'X509v3 Private Key Usage Period'; {Do not localize} - {$EXTERNALSYM LN_rc2_40_cbc} - LN_rc2_40_cbc = 'rc2-40-cbc'; {Do not localize} - {$EXTERNALSYM LN_rc2_64_cbc} - LN_rc2_64_cbc = 'rc2-64-cbc'; {Do not localize} - {$EXTERNALSYM LN_rc2_cbc} - LN_rc2_cbc = 'rc2-cbc'; {Do not localize} - {$EXTERNALSYM LN_rc2_cfb64} - LN_rc2_cfb64 = 'rc2-cfb'; {Do not localize} - {$EXTERNALSYM LN_rc2_ecb} - LN_rc2_ecb = 'rc2-ecb'; {Do not localize} - {$EXTERNALSYM LN_rc2_ofb64} - LN_rc2_ofb64 = 'rc2-ofb'; {Do not localize} - {$EXTERNALSYM LN_rc4} - LN_rc4 = 'rc4'; {Do not localize} - {$EXTERNALSYM LN_rc4_40} - LN_rc4_40 = 'rc4-40'; {Do not localize} - {$EXTERNALSYM LN_rc5_cbc} - LN_rc5_cbc = 'rc5-cbc'; {Do not localize} - {$EXTERNALSYM LN_rc5_cfb64} - LN_rc5_cfb64 = 'rc5-cfb'; {Do not localize} - {$EXTERNALSYM LN_rc5_ecb} - LN_rc5_ecb = 'rc5-ecb'; {Do not localize} - {$EXTERNALSYM LN_rc5_ofb64} - LN_rc5_ofb64 = 'rc5-ofb'; {Do not localize} - {$EXTERNALSYM LN_ripemd160} - LN_ripemd160 = 'ripemd160'; {Do not localize} - {$EXTERNALSYM LN_ripemd160WithRSA} - LN_ripemd160WithRSA = 'ripemd160WithRSA'; {Do not localize} - {$EXTERNALSYM LN_rle_compression} - LN_rle_compression = 'run length compression'; {Do not localize} - {$EXTERNALSYM LN_rsa} - LN_rsa = 'rsa'; {Do not localize} - {$EXTERNALSYM LN_rsaEncryption} - LN_rsaEncryption = 'rsaEncryption'; {Do not localize} - {$EXTERNALSYM LN_rsadsi} - LN_rsadsi = 'rsadsi'; {Do not localize} - {$EXTERNALSYM LN_safeContentsBag} - LN_safeContentsBag = 'safeContentsBag'; {Do not localize} - {$EXTERNALSYM LN_sdsiCertificate} - LN_sdsiCertificate = 'sdsiCertificate'; {Do not localize} - {$EXTERNALSYM LN_secretBag} - LN_secretBag = 'secretBag'; {Do not localize} - {$EXTERNALSYM LN_serialNumber} - LN_serialNumber = 'serialNumber'; {Do not localize} - {$EXTERNALSYM LN_server_auth} - LN_server_auth = 'TLS Web Server Authentication'; {Do not localize} - {$EXTERNALSYM LN_sha} - LN_sha = 'sha'; {Do not localize} - {$EXTERNALSYM LN_sha1} - LN_sha1 = 'sha1'; {Do not localize} - {$EXTERNALSYM LN_sha1WithRSA} - LN_sha1WithRSA = 'sha1WithRSA'; {Do not localize} - {$EXTERNALSYM LN_sha1WithRSAEncryption} - LN_sha1WithRSAEncryption = 'sha1WithRSAEncryption'; {Do not localize} - {$EXTERNALSYM LN_shaWithRSAEncryption} - LN_shaWithRSAEncryption = 'shaWithRSAEncryption'; {Do not localize} - {$EXTERNALSYM LN_sha256WithRSAEncryption} - LN_sha256WithRSAEncryption = 'sha256WithRSAEncryption'; {Do not localize} - {$EXTERNALSYM LN_sha384WithRSAEncryption} - LN_sha384WithRSAEncryption = 'sha384WithRSAEncryption'; {Do not localize} - {$EXTERNALSYM LN_sha512WithRSAEncryption} - LN_sha512WithRSAEncryption = 'sha512WithRSAEncryption'; {do not localize} - {$EXTERNALSYM LN_sha224WithRSAEncryption} - LN_sha224WithRSAEncryption = 'sha224WithRSAEncryption'; {Do not localize} - {$EXTERNALSYM LN_stateOrProvinceName} - LN_stateOrProvinceName = 'stateOrProvinceName'; {Do not localize} - {$EXTERNALSYM LN_subject_alt_name} - LN_subject_alt_name = 'X509v3 Subject Alternative Name'; {Do not localize} - {$EXTERNALSYM LN_subject_key_identifier} - LN_subject_key_identifier = 'X509v3 Subject Key Identifier'; {Do not localize} - {$EXTERNALSYM LN_surname} - LN_surname = 'surname'; {Do not localize} - {$EXTERNALSYM LN_sxnet} - LN_sxnet = 'Strong Extranet ID'; {Do not localize} - {$EXTERNALSYM LN_time_stamp} - LN_time_stamp = 'Time Stamping'; {Do not localize} - {$EXTERNALSYM LN_title} - LN_title = 'title'; {Do not localize} - {$EXTERNALSYM LN_undef} - LN_undef = 'undefined'; {Do not localize} - {$EXTERNALSYM LN_uniqueIdentifier} - LN_uniqueIdentifier = 'uniqueIdentifier'; {Do not localize} - {$EXTERNALSYM LN_x509Certificate} - LN_x509Certificate = 'x509Certificate'; {Do not localize} - {$EXTERNALSYM LN_x509Crl} - LN_x509Crl = 'x509Crl'; {Do not localize} - {$EXTERNALSYM LN_zlib_compression} - LN_zlib_compression = 'zlib compression'; {Do not localize} - {$EXTERNALSYM NID_SMIMECapabilities} - NID_SMIMECapabilities = 167; - {$EXTERNALSYM NID_X500} - NID_X500 = 11; - {$EXTERNALSYM NID_X509} - NID_X509 = 12; - {$EXTERNALSYM NID_algorithm} - NID_algorithm = 38; - {$EXTERNALSYM NID_authority_key_identifier} - NID_authority_key_identifier = 90; - {$EXTERNALSYM NID_basic_constraints} - NID_basic_constraints = 87; - {$EXTERNALSYM NID_bf_cbc} - NID_bf_cbc = 91; - {$EXTERNALSYM NID_bf_cfb64} - NID_bf_cfb64 = 93; - {$EXTERNALSYM NID_bf_ecb} - NID_bf_ecb = 92; - {$EXTERNALSYM NID_bf_ofb64} - NID_bf_ofb64 = 94; - {$EXTERNALSYM NID_cast5_cbc} - NID_cast5_cbc = 108; - {$EXTERNALSYM NID_cast5_cfb64} - NID_cast5_cfb64 = 110; - {$EXTERNALSYM NID_cast5_ecb} - NID_cast5_ecb = 109; - {$EXTERNALSYM NID_cast5_ofb64} - NID_cast5_ofb64 = 111; - {$EXTERNALSYM NID_certBag} - NID_certBag = 152; - {$EXTERNALSYM NID_certificate_policies} - NID_certificate_policies = 89; - {$EXTERNALSYM NID_client_auth} - NID_client_auth = 130; - {$EXTERNALSYM NID_code_sign} - NID_code_sign = 131; - {$EXTERNALSYM NID_commonName} - NID_commonName = 13; - {$EXTERNALSYM NID_countryName} - NID_countryName = 14; - {$EXTERNALSYM NID_crlBag} - NID_crlBag = 153; - {$EXTERNALSYM NID_crl_distribution_points} - NID_crl_distribution_points = 103; - {$EXTERNALSYM NID_crl_number} - NID_crl_number = 88; - {$EXTERNALSYM NID_crl_reason} - NID_crl_reason = 141; - {$EXTERNALSYM NID_delta_crl} - NID_delta_crl = 140; - {$EXTERNALSYM NID_des_cbc} - NID_des_cbc = 31; - {$EXTERNALSYM NID_des_cfb64} - NID_des_cfb64 = 30; - {$EXTERNALSYM NID_des_ecb} - NID_des_ecb = 29; - {$EXTERNALSYM NID_des_ede} - NID_des_ede = 32; - {$EXTERNALSYM NID_des_ede3} - NID_des_ede3 = 33; - {$EXTERNALSYM NID_des_ede3_cbc} - NID_des_ede3_cbc = 44; - {$EXTERNALSYM NID_des_ede3_cfb64} - NID_des_ede3_cfb64 = 61; - {$EXTERNALSYM NID_des_ede3_ofb64} - NID_des_ede3_ofb64 = 63; - {$EXTERNALSYM NID_des_ede_cbc} - NID_des_ede_cbc = 43; - {$EXTERNALSYM NID_des_ede_cfb64} - NID_des_ede_cfb64 = 60; - {$EXTERNALSYM NID_des_ede_ofb64} - NID_des_ede_ofb64 = 62; - {$EXTERNALSYM NID_des_ofb64} - NID_des_ofb64 = 45; - {$EXTERNALSYM NID_description} - NID_description = 107; - {$EXTERNALSYM NID_desx_cbc} - NID_desx_cbc = 80; - {$EXTERNALSYM NID_email_protect} - NID_email_protect = 132; - {$EXTERNALSYM NID_ext_key_usage} - NID_ext_key_usage = 126; - {$EXTERNALSYM NID_friendlyName} - NID_friendlyName = 156; - {$EXTERNALSYM NID_givenName} - NID_givenName = 99; - {$EXTERNALSYM NID_hmacWithSHA1} - NID_hmacWithSHA1 = 163; - {$EXTERNALSYM NID_id_kp} - NID_id_kp = 128; - {$EXTERNALSYM NID_id_pbkdf2} - NID_id_pbkdf2 = 69; - {$EXTERNALSYM NID_id_pkix} - NID_id_pkix = 127; - {$EXTERNALSYM NID_id_qt_cps} - NID_id_qt_cps = 164; - {$EXTERNALSYM NID_id_qt_unotice} - NID_id_qt_unotice = 165; - {$EXTERNALSYM NID_idea_cbc} - NID_idea_cbc = 34; - {$EXTERNALSYM NID_idea_cfb64} - NID_idea_cfb64 = 35; - {$EXTERNALSYM NID_idea_ecb} - NID_idea_ecb = 36; - {$EXTERNALSYM NID_idea_ofb64} - NID_idea_ofb64 = 46; - {$EXTERNALSYM NID_initials} - NID_initials = 101; - {$EXTERNALSYM NID_invalidity_date} - NID_invalidity_date = 142; - {$EXTERNALSYM NID_issuer_alt_name} - NID_issuer_alt_name = 86; - {$EXTERNALSYM NID_keyBag} - NID_keyBag = 150; - {$EXTERNALSYM NID_key_usage} - NID_key_usage = 83; - {$EXTERNALSYM NID_ld_ce} - NID_ld_ce = 81; - {$EXTERNALSYM NID_localKeyID} - NID_localKeyID = 157; - {$EXTERNALSYM NID_localityName} - NID_localityName = 15; - {$EXTERNALSYM NID_md2} - NID_md2 = 3; - {$EXTERNALSYM NID_md2WithRSAEncryption} - NID_md2WithRSAEncryption = 7; - {$EXTERNALSYM NID_md4} - NID_md4 = 257; - {$EXTERNALSYM NID_md4WithRSAEncryption} - NID_md4WithRSAEncryption = 396; - {$EXTERNALSYM NID_md5} - NID_md5 = 4; - {$EXTERNALSYM NID_md5WithRSA} - NID_md5WithRSA = 104; - {$EXTERNALSYM NID_md5WithRSAEncryption} - NID_md5WithRSAEncryption = 8; - {$EXTERNALSYM NID_md5_sha1} - NID_md5_sha1 = 114; - {$EXTERNALSYM NID_mdc2} - NID_mdc2 = 95; - {$EXTERNALSYM NID_mdc2WithRSA} - NID_mdc2WithRSA = 96; - {$EXTERNALSYM NID_ms_code_com} - NID_ms_code_com = 135; - {$EXTERNALSYM NID_ms_code_ind} - NID_ms_code_ind = 134; - {$EXTERNALSYM NID_ms_ctl_sign} - NID_ms_ctl_sign = 136; - {$EXTERNALSYM NID_ms_efs} - NID_ms_efs = 138; - {$EXTERNALSYM NID_ms_sgc} - NID_ms_sgc = 137; - {$EXTERNALSYM NID_netscape} - NID_netscape = 57; - {$EXTERNALSYM NID_netscape_base_url} - NID_netscape_base_url = 72; - {$EXTERNALSYM NID_netscape_ca_policy_url} - NID_netscape_ca_policy_url = 76; - {$EXTERNALSYM NID_netscape_ca_revocation_url} - NID_netscape_ca_revocation_url = 74; - {$EXTERNALSYM NID_netscape_cert_extension} - NID_netscape_cert_extension = 58; - {$EXTERNALSYM NID_netscape_cert_sequence} - NID_netscape_cert_sequence = 79; - {$EXTERNALSYM NID_netscape_cert_type} - NID_netscape_cert_type = 71; - {$EXTERNALSYM NID_netscape_comment} - NID_netscape_comment = 78; - {$EXTERNALSYM NID_netscape_data_type} - NID_netscape_data_type = 59; - {$EXTERNALSYM NID_netscape_renewal_url} - NID_netscape_renewal_url = 75; - {$EXTERNALSYM NID_netscape_revocation_url} - NID_netscape_revocation_url = 73; - {$EXTERNALSYM NID_netscape_ssl_server_name} - NID_netscape_ssl_server_name = 77; - {$EXTERNALSYM NID_ns_sgc} - NID_ns_sgc = 139; - {$EXTERNALSYM NID_organizationName} - NID_organizationName = 17; - {$EXTERNALSYM NID_organizationalUnitName} - NID_organizationalUnitName = 18; - {$EXTERNALSYM NID_pbeWithMD2AndDES_CBC} - NID_pbeWithMD2AndDES_CBC = 9; - {$EXTERNALSYM NID_pbeWithMD2AndRC2_CBC} - NID_pbeWithMD2AndRC2_CBC = 168; - {$EXTERNALSYM NID_pbeWithMD5AndCast5_CBC} - NID_pbeWithMD5AndCast5_CBC = 112; - {$EXTERNALSYM NID_pbeWithMD5AndDES_CBC} - NID_pbeWithMD5AndDES_CBC = 10; - {$EXTERNALSYM NID_pbeWithMD5AndRC2_CBC} - NID_pbeWithMD5AndRC2_CBC = 169; - {$EXTERNALSYM NID_pbeWithSHA1AndDES_CBC} - NID_pbeWithSHA1AndDES_CBC = 170; - {$EXTERNALSYM NID_pbeWithSHA1AndRC2_CBC} - NID_pbeWithSHA1AndRC2_CBC = 68; - {$EXTERNALSYM NID_pbe_WithSHA1And128BitRC2_CBC} - NID_pbe_WithSHA1And128BitRC2_CBC = 148; - {$EXTERNALSYM NID_pbe_WithSHA1And128BitRC4} - NID_pbe_WithSHA1And128BitRC4 = 144; - {$EXTERNALSYM NID_pbe_WithSHA1And2_Key_TripleDES_CBC} - NID_pbe_WithSHA1And2_Key_TripleDES_CBC = 147; - {$EXTERNALSYM NID_pbe_WithSHA1And3_Key_TripleDES_CBC} - NID_pbe_WithSHA1And3_Key_TripleDES_CBC = 146; - {$EXTERNALSYM NID_pbe_WithSHA1And40BitRC2_CBC} - NID_pbe_WithSHA1And40BitRC2_CBC = 149; - {$EXTERNALSYM NID_pbe_WithSHA1And40BitRC4} - NID_pbe_WithSHA1And40BitRC4 = 145; - {$EXTERNALSYM NID_pbes2} - NID_pbes2 = 161; - {$EXTERNALSYM NID_pbmac1} - NID_pbmac1 = 162; - {$EXTERNALSYM NID_pkcs} - NID_pkcs = 2; - {$EXTERNALSYM NID_pkcs3} - NID_pkcs3 = 27; - {$EXTERNALSYM NID_pkcs7} - NID_pkcs7 = 20; - {$EXTERNALSYM NID_pkcs7_data} - NID_pkcs7_data = 21; - {$EXTERNALSYM NID_pkcs7_digest} - NID_pkcs7_digest = 25; - {$EXTERNALSYM NID_pkcs7_encrypted} - NID_pkcs7_encrypted = 26; - {$EXTERNALSYM NID_pkcs7_enveloped} - NID_pkcs7_enveloped = 23; - {$EXTERNALSYM NID_pkcs7_signed} - NID_pkcs7_signed = 22; - {$EXTERNALSYM NID_pkcs7_signedAndEnveloped} - NID_pkcs7_signedAndEnveloped = 24; - {$EXTERNALSYM NID_pkcs8ShroudedKeyBag} - NID_pkcs8ShroudedKeyBag = 151; - {$EXTERNALSYM NID_pkcs9} - NID_pkcs9 = 47; - {$EXTERNALSYM NID_pkcs9_challengePassword} - NID_pkcs9_challengePassword = 54; - {$EXTERNALSYM NID_pkcs9_contentType} - NID_pkcs9_contentType = 50; - {$EXTERNALSYM NID_pkcs9_countersignature} - NID_pkcs9_countersignature = 53; - {$EXTERNALSYM NID_pkcs9_emailAddress} - NID_pkcs9_emailAddress = 48; - {$EXTERNALSYM NID_pkcs9_extCertAttributes} - NID_pkcs9_extCertAttributes = 56; - {$EXTERNALSYM NID_pkcs9_messageDigest} - NID_pkcs9_messageDigest = 51; - {$EXTERNALSYM NID_pkcs9_signingTime} - NID_pkcs9_signingTime = 52; - {$EXTERNALSYM NID_pkcs9_unstructuredAddress} - NID_pkcs9_unstructuredAddress = 55; - {$EXTERNALSYM NID_pkcs9_unstructuredName} - NID_pkcs9_unstructuredName = 49; - {$EXTERNALSYM NID_private_key_usage_period} - NID_private_key_usage_period = 84; - {$EXTERNALSYM NID_rc2_40_cbc} - NID_rc2_40_cbc = 98; - {$EXTERNALSYM NID_rc2_64_cbc} - NID_rc2_64_cbc = 166; - {$EXTERNALSYM NID_rc2_cbc} - NID_rc2_cbc = 37; - {$EXTERNALSYM NID_rc2_cfb64} - NID_rc2_cfb64 = 39; - {$EXTERNALSYM NID_rc2_ecb} - NID_rc2_ecb = 38; - {$EXTERNALSYM NID_rc2_ofb64} - NID_rc2_ofb64 = 40; - {$EXTERNALSYM NID_rc4} - NID_rc4 = 5; - {$EXTERNALSYM NID_rc4_40} - NID_rc4_40 = 97; - {$EXTERNALSYM NID_rc5_cbc} - NID_rc5_cbc = 120; - {$EXTERNALSYM NID_rc5_cfb64} - NID_rc5_cfb64 = 122; - {$EXTERNALSYM NID_rc5_ecb} - NID_rc5_ecb = 121; - {$EXTERNALSYM NID_rc5_ofb64} - NID_rc5_ofb64 = 123; - {$EXTERNALSYM NID_ripemd160} - NID_ripemd160 = 117; - {$EXTERNALSYM NID_ripemd160WithRSA} - NID_ripemd160WithRSA = 119; - {$EXTERNALSYM NID_rle_compression} - NID_rle_compression = 124; - {$EXTERNALSYM NID_rsadsi} - NID_rsadsi = 1; - {$EXTERNALSYM NID_safeContentsBag} - NID_safeContentsBag = 155; - {$EXTERNALSYM NID_sdsiCertificate} - NID_sdsiCertificate = 159; - {$EXTERNALSYM NID_secretBag} - NID_secretBag = 154; - {$EXTERNALSYM NID_serialNumber} - NID_serialNumber = 105; - {$EXTERNALSYM NID_server_auth} - NID_server_auth = 129; - {$EXTERNALSYM NID_sha} - NID_sha = 41; - {$EXTERNALSYM NID_sha1} - NID_sha1 = 64; - {$EXTERNALSYM NID_sha1WithRSA} - NID_sha1WithRSA = 115; - {$EXTERNALSYM NID_sha1WithRSAEncryption} - NID_sha1WithRSAEncryption = 65; - {$EXTERNALSYM NID_sha256WithRSAEncryption} - NID_sha256WithRSAEncryption = 668; - {$EXTERNALSYM NID_sha384WithRSAEncryption} - NID_sha384WithRSAEncryption = 669; - {$EXTERNALSYM NID_sha512WithRSAEncryption} - NID_sha512WithRSAEncryption = 670; - {$EXTERNALSYM NID_sha224WithRSAEncryption} - NID_sha224WithRSAEncryption = 671; - {$EXTERNALSYM NID_shaWithRSAEncryption} - NID_shaWithRSAEncryption = 42; - {$EXTERNALSYM NID_stateOrProvinceName} - NID_stateOrProvinceName = 16; - {$EXTERNALSYM NID_subject_alt_name} - NID_subject_alt_name = 85; - {$EXTERNALSYM NID_subject_key_identifier} - NID_subject_key_identifier = 82; - {$EXTERNALSYM NID_surname} - NID_surname = 100; - {$EXTERNALSYM NID_sxnet} - NID_sxnet = 143; - {$EXTERNALSYM NID_time_stamp} - NID_time_stamp = 133; - {$EXTERNALSYM NID_title} - NID_title = 106; - {$EXTERNALSYM NID_uniqueIdentifier} - NID_uniqueIdentifier = 102; - {$EXTERNALSYM NID_x509Certificate} - NID_x509Certificate = 158; - {$EXTERNALSYM NID_x509Crl} - NID_x509Crl = 160; - {$EXTERNALSYM NID_zlib_compression} - NID_zlib_compression = 125; - {$EXTERNALSYM OBJ_F_OBJ_CREATE} - OBJ_F_OBJ_CREATE = 100; - {$EXTERNALSYM OBJ_F_OBJ_DUP} - OBJ_F_OBJ_DUP = 101; - {$EXTERNALSYM OBJ_F_OBJ_NID2LN} - OBJ_F_OBJ_NID2LN = 102; - {$EXTERNALSYM OBJ_F_OBJ_NID2OBJ} - OBJ_F_OBJ_NID2OBJ = 103; - {$EXTERNALSYM OBJ_F_OBJ_NID2SN} - OBJ_F_OBJ_NID2SN = 104; - {$EXTERNALSYM OBJ_NAME_ALIAS} - OBJ_NAME_ALIAS = $8000; - {$EXTERNALSYM OBJ_NAME_TYPE_CIPHER_METH} - OBJ_NAME_TYPE_CIPHER_METH = $02; - {$EXTERNALSYM OBJ_NAME_TYPE_COMP_METH} - OBJ_NAME_TYPE_COMP_METH = $04; - {$EXTERNALSYM OBJ_NAME_TYPE_MD_METH} - OBJ_NAME_TYPE_MD_METH = $01; - {$EXTERNALSYM OBJ_NAME_TYPE_NUM} - OBJ_NAME_TYPE_NUM = $05; - {$EXTERNALSYM OBJ_NAME_TYPE_PKEY_METH} - OBJ_NAME_TYPE_PKEY_METH = $03; - {$EXTERNALSYM OBJ_NAME_TYPE_UNDEF} - OBJ_NAME_TYPE_UNDEF = $00; - {$EXTERNALSYM OBJ_R_MALLOC_FAILURE} - OBJ_R_MALLOC_FAILURE = 100; - {$EXTERNALSYM OBJ_R_UNKNOWN_NID} - OBJ_R_UNKNOWN_NID = 101; - {$EXTERNALSYM OPENSSL_VERSION_NUMBER} - OPENSSL_VERSION_NUMBER = $1000105f; // MMNNFFPPS Major, Minor, Fix, Patch, Status - {$EXTERNALSYM OPENSSL_VERSION_TEXT} -{$IFDEF OPENSSL_FIPS} - OPENSSL_VERSION_TEXT = 'OpenSSL 1.0.1e-fips 11 Feb 2013'; {Do not localize} -{$ELSE} - OPENSSL_VERSION_TEXT = 'OpenSSL 1.0.1e 11 Feb 2013'; {Do not localize} -{$ENDIF} - {$EXTERNALSYM OPENSSL_VERSION_PTEXT} - OPENSSL_VERSION_PTEXT = ' part of '+ OPENSSL_VERSION_TEXT; {Do not localize} - {$EXTERNALSYM PEM_BUFSIZE} - PEM_BUFSIZE = 1024; - {$EXTERNALSYM PEM_DEK_DES_CBC} - PEM_DEK_DES_CBC = 40; - {$EXTERNALSYM PEM_DEK_DES_ECB} - PEM_DEK_DES_ECB = 60; - {$EXTERNALSYM PEM_DEK_DES_EDE} - PEM_DEK_DES_EDE = 50; - {$EXTERNALSYM PEM_DEK_IDEA_CBC} - PEM_DEK_IDEA_CBC = 45; - {$EXTERNALSYM PEM_DEK_RSA} - PEM_DEK_RSA = 70; - {$EXTERNALSYM PEM_DEK_RSA_MD2} - PEM_DEK_RSA_MD2 = 80; - {$EXTERNALSYM PEM_DEK_RSA_MD5} - PEM_DEK_RSA_MD5 = 90; - {$EXTERNALSYM PEM_ERROR} - PEM_ERROR = 30; - {$EXTERNALSYM PEM_F_DEF_CALLBACK} - PEM_F_DEF_CALLBACK = 100; - {$EXTERNALSYM PEM_F_LOAD_IV} - PEM_F_LOAD_IV = 101; - {$EXTERNALSYM PEM_F_PEM_ASN1_READ} - PEM_F_PEM_ASN1_READ = 102; - {$EXTERNALSYM PEM_F_PEM_ASN1_READ_BIO} - PEM_F_PEM_ASN1_READ_BIO = 103; - {$EXTERNALSYM PEM_F_PEM_ASN1_WRITE} - PEM_F_PEM_ASN1_WRITE = 104; - {$EXTERNALSYM PEM_F_PEM_ASN1_WRITE_BIO} - PEM_F_PEM_ASN1_WRITE_BIO = 105; - {$EXTERNALSYM PEM_F_PEM_DO_HEADER} - PEM_F_PEM_DO_HEADER = 106; - {$EXTERNALSYM PEM_F_PEM_F_PEM_WRITE_PKCS8PRIVATEKEY} - PEM_F_PEM_F_PEM_WRITE_PKCS8PRIVATEKEY = 118; - {$EXTERNALSYM PEM_F_PEM_GET_EVP_CIPHER_INFO} - PEM_F_PEM_GET_EVP_CIPHER_INFO = 107; - {$EXTERNALSYM PEM_F_PEM_READ} - PEM_F_PEM_READ = 108; - {$EXTERNALSYM PEM_F_PEM_READ_BIO} - PEM_F_PEM_READ_BIO = 109; - {$EXTERNALSYM PEM_F_PEM_SEALFINAL} - PEM_F_PEM_SEALFINAL = 110; - {$EXTERNALSYM PEM_F_PEM_SEALINIT} - PEM_F_PEM_SEALINIT = 111; - {$EXTERNALSYM PEM_F_PEM_SIGNFINAL} - PEM_F_PEM_SIGNFINAL = 112; - {$EXTERNALSYM PEM_F_PEM_WRITE} - PEM_F_PEM_WRITE = 113; - {$EXTERNALSYM PEM_F_PEM_WRITE_BIO} - PEM_F_PEM_WRITE_BIO = 114; - {$EXTERNALSYM PEM_F_PEM_WRITE_BIO_PKCS8PRIVATEKEY} - PEM_F_PEM_WRITE_BIO_PKCS8PRIVATEKEY = 119; - {$EXTERNALSYM PEM_F_PEM_X509_INFO_READ} - PEM_F_PEM_X509_INFO_READ = 115; - {$EXTERNALSYM PEM_F_PEM_X509_INFO_READ_BIO} - PEM_F_PEM_X509_INFO_READ_BIO = 116; - {$EXTERNALSYM PEM_F_PEM_X509_INFO_WRITE_BIO} - PEM_F_PEM_X509_INFO_WRITE_BIO = 117; - {$EXTERNALSYM PEM_MD_MD2} - PEM_MD_MD2 = NID_md2; - {$EXTERNALSYM PEM_MD_MD2_RSA} - PEM_MD_MD2_RSA = NID_md2WithRSAEncryption; - {$EXTERNALSYM PEM_MD_MD5} - PEM_MD_MD5 = NID_md5; - {$EXTERNALSYM PEM_MD_MD5_RSA} - PEM_MD_MD5_RSA = NID_md5WithRSAEncryption; - {$EXTERNALSYM PEM_MD_SHA} - PEM_MD_SHA = NID_sha; - {$EXTERNALSYM PEM_MD_SHA_RSA} - PEM_MD_SHA_RSA = NID_sha1WithRSAEncryption; - {$EXTERNALSYM PEM_OBJ_UNDEF} - PEM_OBJ_UNDEF = 0; - {$EXTERNALSYM PEM_OBJ_X509} - PEM_OBJ_X509 = 1; - {$EXTERNALSYM PEM_OBJ_X509_REQ} - PEM_OBJ_X509_REQ = 2; - {$EXTERNALSYM PEM_OBJ_CRL} - PEM_OBJ_CRL = 3; - {$EXTERNALSYM PEM_OBJ_SSL_SESSION} - PEM_OBJ_SSL_SESSION = 4; - {$EXTERNALSYM PEM_OBJ_PRIV_KEY} - PEM_OBJ_PRIV_KEY = 10; - {$EXTERNALSYM PEM_OBJ_PRIV_RSA} - PEM_OBJ_PRIV_RSA = 11; - {$EXTERNALSYM PEM_OBJ_PRIV_DSA} - PEM_OBJ_PRIV_DSA = 12; - {$EXTERNALSYM PEM_OBJ_PRIV_DH} - PEM_OBJ_PRIV_DH = 13; - {$EXTERNALSYM PEM_OBJ_PUB_RSA} - PEM_OBJ_PUB_RSA = 14; - {$EXTERNALSYM PEM_OBJ_PUB_DSA} - PEM_OBJ_PUB_DSA = 15; - {$EXTERNALSYM PEM_OBJ_PUB_DH} - PEM_OBJ_PUB_DH = 16; - {$EXTERNALSYM PEM_OBJ_DHPARAMS} - PEM_OBJ_DHPARAMS = 17; - {$EXTERNALSYM PEM_OBJ_DSAPARAMS} - PEM_OBJ_DSAPARAMS = 18; - {$EXTERNALSYM PEM_OBJ_PRIV_RSA_PUBLIC} - PEM_OBJ_PRIV_RSA_PUBLIC = 19; - {$EXTERNALSYM PEM_OBJ_PRIV_ECDSA} - PEM_OBJ_PRIV_ECDSA = 20; - {$EXTERNALSYM PEM_OBJ_PUB_ECDSA} - PEM_OBJ_PUB_ECDSA = 21; - {$EXTERNALSYM PEM_OBJ_ECPARAMETERS} - PEM_OBJ_ECPARAMETERS = 22; - {$EXTERNALSYM PEM_R_BAD_BASE64_DECODE} - PEM_R_BAD_BASE64_DECODE = 100; - {$EXTERNALSYM PEM_R_BAD_DECRYPT} - PEM_R_BAD_DECRYPT = 101; - {$EXTERNALSYM PEM_R_BAD_END_LINE} - PEM_R_BAD_END_LINE = 102; - {$EXTERNALSYM PEM_R_BAD_IV_CHARS} - PEM_R_BAD_IV_CHARS = 103; - {$EXTERNALSYM PEM_R_BAD_PASSWORD_READ} - PEM_R_BAD_PASSWORD_READ = 104; - {$EXTERNALSYM PEM_R_ERROR_CONVERTING_PRIVATE_KEY} - PEM_R_ERROR_CONVERTING_PRIVATE_KEY = 115; - {$EXTERNALSYM PEM_R_NOT_DEK_INFO} - PEM_R_NOT_DEK_INFO = 105; - {$EXTERNALSYM PEM_R_NOT_ENCRYPTED} - PEM_R_NOT_ENCRYPTED = 106; - {$EXTERNALSYM PEM_R_NOT_PROC_TYPE} - PEM_R_NOT_PROC_TYPE = 107; - {$EXTERNALSYM PEM_R_NO_START_LINE} - PEM_R_NO_START_LINE = 108; - {$EXTERNALSYM PEM_R_PROBLEMS_GETTING_PASSWORD} - PEM_R_PROBLEMS_GETTING_PASSWORD = 109; - {$EXTERNALSYM PEM_R_PUBLIC_KEY_NO_RSA} - PEM_R_PUBLIC_KEY_NO_RSA = 110; - {$EXTERNALSYM PEM_R_READ_KEY} - PEM_R_READ_KEY = 111; - {$EXTERNALSYM PEM_R_SHORT_HEADER} - PEM_R_SHORT_HEADER = 112; - {$EXTERNALSYM PEM_R_UNSUPPORTED_CIPHER} - PEM_R_UNSUPPORTED_CIPHER = 113; - {$EXTERNALSYM PEM_R_UNSUPPORTED_ENCRYPTION} - PEM_R_UNSUPPORTED_ENCRYPTION = 114; - {$EXTERNALSYM PEM_STRING_EVP_PKEY} - PEM_STRING_EVP_PKEY = 'ANY PRIVATE KEY'; {Do not localize} - {$EXTERNALSYM PEM_STRING_X509_OLD} - PEM_STRING_X509_OLD = 'X509 CERTIFICATE'; {Do not localize} - {$EXTERNALSYM PEM_STRING_X509} - PEM_STRING_X509 = 'CERTIFICATE'; {Do not localize} - {$EXTERNALSYM PEM_STRING_X509_PAIR} - PEM_STRING_X509_PAIR = 'CERTIFICATE PAIR'; {Do not localize} - {$EXTERNALSYM PEM_STRING_X509_TRUSTED} - PEM_STRING_X509_TRUSTED = 'TRUSTED CERTIFICATE'; {Do not localize} - {$EXTERNALSYM PEM_STRING_X509_REQ_OLD} - PEM_STRING_X509_REQ_OLD = 'NEW CERTIFICATE REQUEST'; {Do not localize} - {$EXTERNALSYM PEM_STRING_X509_REQ} - PEM_STRING_X509_REQ = 'CERTIFICATE REQUEST'; {Do not localize} - {$EXTERNALSYM PEM_STRING_X509_CRL} - PEM_STRING_X509_CRL = 'X509 CRL'; {Do not localize} - {$EXTERNALSYM PEM_STRING_PUBLIC} - PEM_STRING_PUBLIC = 'PUBLIC KEY'; {Do not localize} - {$EXTERNALSYM PEM_STRING_RSA} - PEM_STRING_RSA = 'RSA PRIVATE KEY'; {Do not localize} - {$EXTERNALSYM PEM_STRING_RSA_PUBLIC} - PEM_STRING_RSA_PUBLIC = 'RSA PUBLIC KEY'; {Do not localize} - {$EXTERNALSYM PEM_STRING_DSA} - PEM_STRING_DSA = 'DSA PRIVATE KEY'; {Do not localize} - {$EXTERNALSYM PEM_STRING_DSA_PUBLIC} - PEM_STRING_DSA_PUBLIC = 'DSA PUBLIC KEY'; {Do not localize} - {$EXTERNALSYM PEM_STRING_PKCS7} - PEM_STRING_PKCS7 = 'PKCS7'; {Do not localize} - {$EXTERNALSYM PEM_STRING_PKCS7_SIGNED} - PEM_STRING_PKCS7_SIGNED ='PKCS #7 SIGNED DATA'; {Do not localize} - {$EXTERNALSYM PEM_STRING_PKCS8} - PEM_STRING_PKCS8 = 'ENCRYPTED PRIVATE KEY'; {Do not localize} - {$EXTERNALSYM PEM_STRING_PKCS8INF} - PEM_STRING_PKCS8INF = 'PRIVATE KEY'; {Do not localize} - {$EXTERNALSYM PEM_STRING_DHPARAMS} - PEM_STRING_DHPARAMS = 'DH PARAMETERS'; {Do not localize} - {$EXTERNALSYM PEM_STRING_SSL_SESSION} - PEM_STRING_SSL_SESSION = 'SSL SESSION PARAMETERS'; {Do not localize} - {$EXTERNALSYM PEM_STRING_DSAPARAMS} - PEM_STRING_DSAPARAMS = 'DSA PARAMETERS'; {Do not localize} - {$EXTERNALSYM PEM_STRING_ECDSA_PUBLIC} - PEM_STRING_ECDSA_PUBLIC = 'ECDSA PUBLIC KEY'; {Do not localize} - {$EXTERNALSYM PEM_STRING_ECPARAMETERS} - PEM_STRING_ECPARAMETERS = 'EC PARAMETERS'; {Do not localize} - {$EXTERNALSYM PEM_STRING_ECPRIVATEKEY} - PEM_STRING_ECPRIVATEKEY = 'EC PRIVATE KEY'; {Do not localize} - {$EXTERNALSYM PEM_STRING_CMS} - PEM_STRING_CMS = 'CMS'; {Do not localize} - {$EXTERNALSYM PEM_TYPE_CLEAR} - PEM_TYPE_CLEAR = 40; - {$EXTERNALSYM PEM_TYPE_ENCRYPTED} - PEM_TYPE_ENCRYPTED = 10; - {$EXTERNALSYM PEM_TYPE_MIC_CLEAR} - PEM_TYPE_MIC_CLEAR = 30; - {$EXTERNALSYM PEM_TYPE_MIC_ONLY} - PEM_TYPE_MIC_ONLY = 20; - {$EXTERNALSYM PKCS5_DEFAULT_ITER} - PKCS5_DEFAULT_ITER = 2048; - {$EXTERNALSYM PKCS5_SALT_LEN} - PKCS5_SALT_LEN = 8; - {$EXTERNALSYM PKCS7_F_PKCS7_ADD_CERTIFICATE} - PKCS7_F_PKCS7_ADD_CERTIFICATE = 100; - {$EXTERNALSYM PKCS7_F_PKCS7_ADD_CRL} - PKCS7_F_PKCS7_ADD_CRL = 101; - {$EXTERNALSYM PKCS7_F_PKCS7_ADD_RECIPIENT_INFO} - PKCS7_F_PKCS7_ADD_RECIPIENT_INFO = 102; - {$EXTERNALSYM PKCS7_F_PKCS7_ADD_SIGNER} - PKCS7_F_PKCS7_ADD_SIGNER = 103; - {$EXTERNALSYM PKCS7_F_PKCS7_CTRL} - PKCS7_F_PKCS7_CTRL = 104; - {$EXTERNALSYM PKCS7_F_PKCS7_DATADECODE} - PKCS7_F_PKCS7_DATADECODE = 112; - {$EXTERNALSYM PKCS7_F_PKCS7_DATAINIT} - PKCS7_F_PKCS7_DATAINIT = 105; - {$EXTERNALSYM PKCS7_F_PKCS7_DATASIGN} - PKCS7_F_PKCS7_DATASIGN = 106; - {$EXTERNALSYM PKCS7_F_PKCS7_DATAVERIFY} - PKCS7_F_PKCS7_DATAVERIFY = 107; - {$EXTERNALSYM PKCS7_F_PKCS7_SET_CIPHER} - PKCS7_F_PKCS7_SET_CIPHER = 108; - {$EXTERNALSYM PKCS7_F_PKCS7_SET_CONTENT} - PKCS7_F_PKCS7_SET_CONTENT = 109; - {$EXTERNALSYM PKCS7_F_PKCS7_SET_TYPE} - PKCS7_F_PKCS7_SET_TYPE = 110; - {$EXTERNALSYM PKCS7_F_PKCS7_SIGNATUREVERIFY} - PKCS7_F_PKCS7_SIGNATUREVERIFY = 113; - {$EXTERNALSYM PKCS7_OP_GET_DETACHED_SIGNATURE} - PKCS7_OP_GET_DETACHED_SIGNATURE = 2; - {$EXTERNALSYM PKCS7_OP_SET_DETACHED_SIGNATURE} - PKCS7_OP_SET_DETACHED_SIGNATURE = 1; - {$EXTERNALSYM PKCS7_R_CIPHER_NOT_INITIALIZED} - PKCS7_R_CIPHER_NOT_INITIALIZED = 116; - {$EXTERNALSYM PKCS7_R_DECRYPTED_KEY_IS_WRONG_LENGTH} - PKCS7_R_DECRYPTED_KEY_IS_WRONG_LENGTH = 100; - {$EXTERNALSYM PKCS7_R_DIGEST_FAILURE} - PKCS7_R_DIGEST_FAILURE = 101; - {$EXTERNALSYM PKCS7_R_INTERNAL_ERROR} - PKCS7_R_INTERNAL_ERROR = 102; - {$EXTERNALSYM PKCS7_R_MISSING_CERIPEND_INFO} - PKCS7_R_MISSING_CERIPEND_INFO = 103; - {$EXTERNALSYM PKCS7_R_NO_RECIPIENT_MATCHES_CERTIFICATE} - PKCS7_R_NO_RECIPIENT_MATCHES_CERTIFICATE = 115; - {$EXTERNALSYM PKCS7_R_OPERATION_NOT_SUPPORTED_ON_THIS_TYPE} - PKCS7_R_OPERATION_NOT_SUPPORTED_ON_THIS_TYPE = 104; - {$EXTERNALSYM PKCS7_R_SIGNATURE_FAILURE} - PKCS7_R_SIGNATURE_FAILURE = 105; - {$EXTERNALSYM PKCS7_R_UNABLE_TO_FIND_CERTIFICATE} - PKCS7_R_UNABLE_TO_FIND_CERTIFICATE = 106; - {$EXTERNALSYM PKCS7_R_UNABLE_TO_FIND_MEM_BIO} - PKCS7_R_UNABLE_TO_FIND_MEM_BIO = 107; - {$EXTERNALSYM PKCS7_R_UNABLE_TO_FIND_MESSAGE_DIGEST} - PKCS7_R_UNABLE_TO_FIND_MESSAGE_DIGEST = 108; - {$EXTERNALSYM PKCS7_R_UNKNOWN_DIGEST_TYPE} - PKCS7_R_UNKNOWN_DIGEST_TYPE = 109; - {$EXTERNALSYM PKCS7_R_UNKNOWN_OPERATION} - PKCS7_R_UNKNOWN_OPERATION = 110; - {$EXTERNALSYM PKCS7_R_UNSUPPORTED_CIPHER_TYPE} - PKCS7_R_UNSUPPORTED_CIPHER_TYPE = 111; - {$EXTERNALSYM PKCS7_R_UNSUPPORTED_CONTENT_TYPE} - PKCS7_R_UNSUPPORTED_CONTENT_TYPE = 112; - {$EXTERNALSYM PKCS7_R_WRONG_CONTENT_TYPE} - PKCS7_R_WRONG_CONTENT_TYPE = 113; - {$EXTERNALSYM PKCS7_R_WRONG_PKCS7_TYPE} - PKCS7_R_WRONG_PKCS7_TYPE = 114; - {$EXTERNALSYM PKCS7_S_BODY} - PKCS7_S_BODY = 1; - {$EXTERNALSYM PKCS7_S_HEADER} - PKCS7_S_HEADER = 0; - {$EXTERNALSYM PKCS7_S_TAIL} - PKCS7_S_TAIL = 2; - {$EXTERNALSYM PKCS8_NEG_PRIVKEY} - PKCS8_NEG_PRIVKEY = 4; - {$EXTERNALSYM PKCS8_NS_DB} - PKCS8_NS_DB = 3; - {$EXTERNALSYM PKCS8_EMBEDDED_PARAM} - PKCS8_EMBEDDED_PARAM = 2; - {$EXTERNALSYM PKCS8_NO_OCTET} - PKCS8_NO_OCTET = 1; - {$EXTERNALSYM PKCS8_OK} - PKCS8_OK = 0; - {$EXTERNALSYM P_tmpdir} - P_tmpdir = '/tmp'; {Do not localize} - {$EXTERNALSYM MSS_RAND_MAX} - MSS_RAND_MAX = $7fffffff; - {$IFNDEF OPENSSL_NO_RC2} - {$EXTERNALSYM RC2_BLOCK} - RC2_BLOCK = 8; - {$EXTERNALSYM RC2_DECRYPT} - RC2_DECRYPT = 0; - {$EXTERNALSYM RC2_ENCRYPT} - RC2_ENCRYPT = 1; - {$EXTERNALSYM RC2_KEY_LENGTH} - RC2_KEY_LENGTH = 16; - {$ENDIF} - {$IFNDEF OPENSSL_NO_RC5} - {$EXTERNALSYM RC5_12_ROUNDS} - RC5_12_ROUNDS = 12; - {$EXTERNALSYM RC5_16_ROUNDS} - RC5_16_ROUNDS = 16; - {$EXTERNALSYM RC5_32_BLOCK} - RC5_32_BLOCK = 8; - {$EXTERNALSYM RC5_32_KEY_LENGTH} - RC5_32_KEY_LENGTH = 16; - {$EXTERNALSYM RC5_8_ROUNDS} - RC5_8_ROUNDS = 8; - {$EXTERNALSYM RC5_DECRYPT} - RC5_DECRYPT = 0; - {$EXTERNALSYM RC5_ENCRYPT} - RC5_ENCRYPT = 1; - {$ENDIF} - {$IFNDEF OPENSSL_NO_HMAC} - {$EXTERNALSYM HMAC_MAX_MD_CBLOCK} - HMAC_MAX_MD_CBLOCK = 128; //* largest known is SHA512 */ - {$ENDIF} - {$IFNDEF OPENSSL_NO_RIPEMD} - {$EXTERNALSYM RIPEMD160_BLOCK} - RIPEMD160_BLOCK = 16; - {$EXTERNALSYM RIPEMD160_CBLOCK} - RIPEMD160_CBLOCK = 64; - {$EXTERNALSYM RIPEMD160_DIGEST_LENGTH} - RIPEMD160_DIGEST_LENGTH = 20; - {$EXTERNALSYM RIPEMD160_LAST_BLOCK} - RIPEMD160_LAST_BLOCK = 56; - {$EXTERNALSYM RIPEMD160_LBLOCK} - RIPEMD160_LBLOCK = 16; - {$EXTERNALSYM RIPEMD160_LENGTH_BLOCK} - RIPEMD160_LENGTH_BLOCK = 8; - {$ENDIF} - {$IFNDEF OPENSSL_NO_RSA} -///* If this flag is set the RSA method is FIPS compliant and can be used -// * in FIPS mode. This is set in the validated module method. If an -// * application sets this flag in its own methods it is its reposibility -// * to ensure the result is compliant. -// */ - - {$EXTERNALSYM RSA_FLAG_FIPS_METHOD} - RSA_FLAG_FIPS_METHOD = $0400; - -///* If this flag is set the operations normally disabled in FIPS mode are -// * permitted it is then the applications responsibility to ensure that the -// * usage is compliant. -// */ - - {$EXTERNALSYM RSA_FLAG_NON_FIPS_ALLOW} - RSA_FLAG_NON_FIPS_ALLOW = $0400; - - {$EXTERNALSYM RSA_3} - RSA_3 = $3; - {$EXTERNALSYM RSA_F4} - RSA_F4 = $10001; - {$EXTERNALSYM RSA_FLAG_BLINDING} - RSA_FLAG_BLINDING = $08; - {$EXTERNALSYM RSA_FLAG_CACHE_PRIVATE} - RSA_FLAG_CACHE_PRIVATE = $04; - {$EXTERNALSYM RSA_FLAG_CACHE_PUBLIC} - RSA_FLAG_CACHE_PUBLIC = $02; - {$EXTERNALSYM RSA_FLAG_EXT_PKEY} - RSA_FLAG_EXT_PKEY = $20; - {$EXTERNALSYM RSA_FLAG_SIGN_VER} - RSA_FLAG_SIGN_VER = $0040; - {$EXTERNALSYM RSA_FLAG_NO_BLINDING} - RSA_FLAG_NO_BLINDING =$0080; //* new with 0.9.6j and 0.9.7b; the built-in - //* RSA implementation now uses blinding by - //* default (ignoring RSA_FLAG_BLINDING), - //* but other engines might not need it - //*/ - {$EXTERNALSYM RSA_FLAG_NO_CONSTTIME} - RSA_FLAG_NO_CONSTTIME = $0100; //* new with 0.9.8f; the built-in RSA - //* implementation now uses constant time - //* operations by default in private key operations, - //* e.g., constant time modular exponentiation, - //* modular inverse without leaking branches, - //* division without leaking branches. This - //* flag disables these constant time - //* operations and results in faster RSA - //* private key operations. - //*/ -{$IFNDEF OPENSSL_NO_DEPRECATED} - {$EXTERNALSYM RSA_FLAG_NO_EXP_CONSTTIME} - RSA_FLAG_NO_EXP_CONSTTIME = RSA_FLAG_NO_CONSTTIME; //* deprecated name for the flag*/ - //* new with 0.9.7h; the built-in RSA - //* implementation now uses constant time - //* modular exponentiation for secret exponents - //* by default. This flag causes the - //* faster variable sliding window method to - //* be used for all exponents. - //*/ -{$ENDIF} - //the openssl developers probably only wanted to define this if it was not already defined. - {$EXTERNALSYM RSA_MAX_MODULUS_BITS} - RSA_MAX_MODULUS_BITS = 16384; - {$EXTERNALSYM RSA_FIPS_MIN_MODULUS_BITS} - RSA_FIPS_MIN_MODULUS_BITS = 1024; - //the openssl developers probably only wanted to define this if it was not already defined. - {$EXTERNALSYM RSA_SMALL_MODULUS_BITS} - RSA_SMALL_MODULUS_BITS = 3072; - //the openssl developers probably only wanted to define this if it was not already defined. - {$EXTERNALSYM RSA_MAX_PUBEXP_BITS} - RSA_MAX_PUBEXP_BITS = 64; //* exponent limit enforced for "large" modulus only */ - - {$EXTERNALSYM RSA_FLAG_THREAD_SAFE} - RSA_FLAG_THREAD_SAFE = $10; - //* function codes */ - {$EXTERNALSYM RSA_F_FIPS_RSA_SIGN} - RSA_F_FIPS_RSA_SIGN = 140; - {$EXTERNALSYM RSA_F_FIPS_RSA_VERIFY} - RSA_F_FIPS_RSA_VERIFY = 141; - {$EXTERNALSYM RSA_F_MEMORY_LOCK} - RSA_F_MEMORY_LOCK = 100; - {$EXTERNALSYM RSA_F_RSA_CHECK_KEY} - RSA_F_RSA_CHECK_KEY = 123; - {$EXTERNALSYM RSA_F_RSA_EAY_PRIVATE_DECRYPT} - RSA_F_RSA_EAY_PRIVATE_DECRYPT = 101; - {$EXTERNALSYM RSA_F_RSA_EAY_PRIVATE_ENCRYPT} - RSA_F_RSA_EAY_PRIVATE_ENCRYPT = 102; - {$EXTERNALSYM RSA_F_RSA_EAY_PUBLIC_DECRYPT} - RSA_F_RSA_EAY_PUBLIC_DECRYPT = 103; - {$EXTERNALSYM RSA_F_RSA_EAY_PUBLIC_ENCRYPT} - RSA_F_RSA_EAY_PUBLIC_ENCRYPT = 104; - {$EXTERNALSYM RSA_F_RSA_GENERATE_KEY} - RSA_F_RSA_GENERATE_KEY = 105; - {$EXTERNALSYM RSA_F_RSA_NEW_METHOD} - RSA_F_RSA_NEW_METHOD = 106; - {$EXTERNALSYM RSA_F_RSA_PADDING_ADD_NONE} - RSA_F_RSA_PADDING_ADD_NONE = 107; - {$EXTERNALSYM RSA_F_RSA_PADDING_ADD_PKCS1_OAEP} - RSA_F_RSA_PADDING_ADD_PKCS1_OAEP = 121; - {$EXTERNALSYM RSA_F_RSA_PADDING_ADD_PKCS1_TYPE_1} - RSA_F_RSA_PADDING_ADD_PKCS1_TYPE_1 = 108; - {$EXTERNALSYM RSA_F_RSA_PADDING_ADD_PKCS1_TYPE_2} - RSA_F_RSA_PADDING_ADD_PKCS1_TYPE_2 = 109; - {$EXTERNALSYM RSA_F_RSA_PADDING_ADD_SSLV23} - RSA_F_RSA_PADDING_ADD_SSLV23 = 110; - {$EXTERNALSYM RSA_F_RSA_PADDING_CHECK_NONE} - RSA_F_RSA_PADDING_CHECK_NONE = 111; - {$EXTERNALSYM RSA_F_RSA_PADDING_CHECK_PKCS1_OAEP} - RSA_F_RSA_PADDING_CHECK_PKCS1_OAEP = 122; - {$EXTERNALSYM RSA_F_RSA_PADDING_CHECK_PKCS1_TYPE_1} - RSA_F_RSA_PADDING_CHECK_PKCS1_TYPE_1 = 112; - {$EXTERNALSYM RSA_F_RSA_PADDING_CHECK_PKCS1_TYPE_2} - RSA_F_RSA_PADDING_CHECK_PKCS1_TYPE_2 = 113; - {$EXTERNALSYM RSA_F_RSA_PADDING_CHECK_SSLV23} - RSA_F_RSA_PADDING_CHECK_SSLV23 = 114; - {$EXTERNALSYM RSA_F_RSA_PRINT} - RSA_F_RSA_PRINT = 115; - {$EXTERNALSYM RSA_F_RSA_PRINT_FP} - RSA_F_RSA_PRINT_FP = 116; - {$EXTERNALSYM RSA_F_RSA_PRIVATE_ENCRYPT} - RSA_F_RSA_PRIVATE_ENCRYPT = 137; - {$EXTERNALSYM RSA_F_RSA_PUBLIC_DECRYPT} - RSA_F_RSA_PUBLIC_DECRYPT = 138; - {$EXTERNALSYM RSA_F_RSA_SETUP_BLINDING} - RSA_F_RSA_SETUP_BLINDING = 136; - {$EXTERNALSYM RSA_F_RSA_SET_DEFAULT_METHOD} - RSA_F_RSA_SET_DEFAULT_METHOD = 139; - {$EXTERNALSYM RSA_F_RSA_SET_METHOD} - RSA_F_RSA_SET_METHOD = 142; - {$EXTERNALSYM RSA_F_RSA_SIGN} - RSA_F_RSA_SIGN = 117; - {$EXTERNALSYM RSA_F_RSA_SIGN_ASN1_OCTET_STRING} - RSA_F_RSA_SIGN_ASN1_OCTET_STRING = 118; - {$EXTERNALSYM RSA_F_RSA_VERIFY} - RSA_F_RSA_VERIFY = 119; - {$EXTERNALSYM RSA_F_RSA_VERIFY_ASN1_OCTET_STRING} - RSA_F_RSA_VERIFY_ASN1_OCTET_STRING = 120; - {$EXTERNALSYM RSA_F_RSA_VERIFY_PKCS1_PSS} - RSA_F_RSA_VERIFY_PKCS1_PSS = 126; - {$EXTERNALSYM RSA_METHOD_FLAG_NO_CHECK} - RSA_METHOD_FLAG_NO_CHECK = $01; - {$EXTERNALSYM RSA_NO_PADDING} - RSA_NO_PADDING = 3; - {$EXTERNALSYM RSA_PKCS1_OAEP_PADDING} - RSA_PKCS1_OAEP_PADDING = 4; - {$EXTERNALSYM RSA_PKCS1_PADDING} - RSA_PKCS1_PADDING = 1; - {$EXTERNALSYM RSA_R_ALGORITHM_MISMATCH} - RSA_R_ALGORITHM_MISMATCH = 100; - {$EXTERNALSYM RSA_R_BAD_E_VALUE} - RSA_R_BAD_E_VALUE = 101; - {$EXTERNALSYM RSA_R_BAD_FIXED_HEADER_DECRYPT} - RSA_R_BAD_FIXED_HEADER_DECRYPT = 102; - {$EXTERNALSYM RSA_R_BAD_PAD_BYTE_COUNT} - RSA_R_BAD_PAD_BYTE_COUNT = 103; - {$EXTERNALSYM RSA_R_BAD_SIGNATURE} - RSA_R_BAD_SIGNATURE = 104; - {$EXTERNALSYM RSA_R_BLOCK_TYPE_IS_NOT_01} - RSA_R_BLOCK_TYPE_IS_NOT_01 = 106; - {$EXTERNALSYM RSA_R_BLOCK_TYPE_IS_NOT_02} - RSA_R_BLOCK_TYPE_IS_NOT_02 = 107; - {$EXTERNALSYM RSA_R_DATA_GREATER_THAN_MOD_LEN} - RSA_R_DATA_GREATER_THAN_MOD_LEN = 108; - {$EXTERNALSYM RSA_R_DATA_TOO_LARGE} - RSA_R_DATA_TOO_LARGE = 109; - {$EXTERNALSYM RSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE} - RSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE = 110; - {$EXTERNALSYM RSA_R_DATA_TOO_SMALL} - RSA_R_DATA_TOO_SMALL = 111; - {$EXTERNALSYM RSA_R_DATA_TOO_SMALL_FOR_KEY_SIZE} - RSA_R_DATA_TOO_SMALL_FOR_KEY_SIZE = 122; - {$EXTERNALSYM RSA_R_DIGEST_TOO_BIG_FOR_RSA_KEY} - RSA_R_DIGEST_TOO_BIG_FOR_RSA_KEY = 112; - {$EXTERNALSYM RSA_R_DMP1_NOT_CONGRUENT_TO_D} - RSA_R_DMP1_NOT_CONGRUENT_TO_D = 124; - {$EXTERNALSYM RSA_R_DMQ1_NOT_CONGRUENT_TO_D} - RSA_R_DMQ1_NOT_CONGRUENT_TO_D = 125; - {$EXTERNALSYM RSA_R_D_E_NOT_CONGRUENT_TO_1} - RSA_R_D_E_NOT_CONGRUENT_TO_1 = 123; - {$EXTERNALSYM RSA_R_IQMP_NOT_INVERSE_OF_Q} - RSA_R_IQMP_NOT_INVERSE_OF_Q = 126; - {$EXTERNALSYM RSA_R_KEY_SIZE_TOO_SMALL} - RSA_R_KEY_SIZE_TOO_SMALL = 120; - {$EXTERNALSYM RSA_R_LAST_OCTET_INVALID} - RSA_R_LAST_OCTET_INVALID = 134; - {$EXTERNALSYM RSA_R_MODULUS_TOO_LARGE} - RSA_R_MODULUS_TOO_LARGE = 105; - {$EXTERNALSYM RSA_R_NON_FIPS_METHOD} - RSA_R_NON_FIPS_METHOD = 141; - {$EXTERNALSYM RSA_R_NO_PUBLIC_EXPONENT} - RSA_R_NO_PUBLIC_EXPONENT = 140; - {$EXTERNALSYM RSA_R_NULL_BEFORE_BLOCK_MISSING} - RSA_R_NULL_BEFORE_BLOCK_MISSING = 113; - {$EXTERNALSYM RSA_R_N_DOES_NOT_EQUAL_P_Q} - RSA_R_N_DOES_NOT_EQUAL_P_Q = 127; - {$EXTERNALSYM RSA_R_OAEP_DECODING_ERROR} - RSA_R_OAEP_DECODING_ERROR = 121; - {$EXTERNALSYM RSA_R_OPERATION_NOT_ALLOWED_IN_FIPS_MODE} - RSA_R_OPERATION_NOT_ALLOWED_IN_FIPS_MODE = 142; - {$EXTERNALSYM RSA_R_PADDING_CHECK_FAILED} - RSA_R_PADDING_CHECK_FAILED = 114; - {$EXTERNALSYM RSA_R_P_NOT_PRIME} - RSA_R_P_NOT_PRIME = 128; - {$EXTERNALSYM RSA_R_Q_NOT_PRIME} - RSA_R_Q_NOT_PRIME = 129; - {$EXTERNALSYM RSA_R_SLEN_CHECK_FAILED} - RSA_R_SLEN_CHECK_FAILED = 136; - {$EXTERNALSYM RSA_R_SLEN_RECOVERY_FAILED} - RSA_R_SLEN_RECOVERY_FAILED = 135; - {$EXTERNALSYM RSA_R_SSLV3_ROLLBACK_ATTACK} - RSA_R_SSLV3_ROLLBACK_ATTACK = 115; - {$EXTERNALSYM RSA_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD} - RSA_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD = 116; - {$EXTERNALSYM RSA_R_UNKNOWN_ALGORITHM_TYPE} - RSA_R_UNKNOWN_ALGORITHM_TYPE = 117; - {$EXTERNALSYM RSA_R_UNKNOWN_PADDING_TYPE} - RSA_R_UNKNOWN_PADDING_TYPE = 118; - {$EXTERNALSYM RSA_R_WRONG_SIGNATURE_LENGTH} - RSA_R_WRONG_SIGNATURE_LENGTH = 119; - {$EXTERNALSYM RSA_SSLV23_PADDING} - RSA_SSLV23_PADDING = 2; - {$ENDIF} - {$EXTERNALSYM SEEK_CUR} - SEEK_CUR = 1; - {$EXTERNALSYM SEEK_END} - SEEK_END = 2; - {$EXTERNALSYM SEEK_SET} - SEEK_SET = 0; - {$EXTERNALSYM SN_Algorithm} - SN_Algorithm = 'Algorithm'; {Do not localize} - {$EXTERNALSYM SN_SMIMECapabilities} - SN_SMIMECapabilities = 'SMIME-CAPS'; {Do not localize} - {$EXTERNALSYM SN_authority_key_identifier} - SN_authority_key_identifier = 'authorityKeyIdentifier'; {Do not localize} - {$EXTERNALSYM SN_basic_constraints} - SN_basic_constraints = 'basicConstraints'; {Do not localize} - {$EXTERNALSYM SN_bf_cbc} - SN_bf_cbc = 'BF-CBC'; {Do not localize} - {$EXTERNALSYM SN_bf_cfb64} - SN_bf_cfb64 = 'BF-CFB'; {Do not localize} - {$EXTERNALSYM SN_bf_ecb} - SN_bf_ecb = 'BF-ECB'; {Do not localize} - {$EXTERNALSYM SN_bf_ofb64} - SN_bf_ofb64 = 'BF-OFB'; {Do not localize} - {$EXTERNALSYM SN_cast5_cbc} - SN_cast5_cbc = 'CAST5-CBC'; {Do not localize} - {$EXTERNALSYM SN_cast5_cfb64} - SN_cast5_cfb64 = 'CAST5-CFB'; {Do not localize} - {$EXTERNALSYM SN_cast5_ecb} - SN_cast5_ecb = 'CAST5-ECB'; {Do not localize} - {$EXTERNALSYM SN_cast5_ofb64} - SN_cast5_ofb64 = 'CAST5-OFB'; {Do not localize} - {$EXTERNALSYM SN_certificate_policies} - SN_certificate_policies = 'certificatePolicies'; {Do not localize} - {$EXTERNALSYM SN_client_auth} - SN_client_auth = 'clientAuth'; {Do not localize} - {$EXTERNALSYM SN_code_sign} - SN_code_sign = 'codeSigning'; {Do not localize} - {$EXTERNALSYM SN_commonName} - SN_commonName = 'CN'; {Do not localize} - {$EXTERNALSYM SN_countryName} - SN_countryName = 'C'; {Do not localize} - {$EXTERNALSYM SN_crl_distribution_points} - SN_crl_distribution_points = 'crlDistributionPoints'; {Do not localize} - {$EXTERNALSYM SN_crl_number} - SN_crl_number = 'crlNumber'; {Do not localize} - {$EXTERNALSYM SN_crl_reason} - SN_crl_reason = 'CRLReason'; {Do not localize} - {$EXTERNALSYM SN_delta_crl} - SN_delta_crl = 'deltaCRL'; {Do not localize} - {$EXTERNALSYM SN_des_cbc} - SN_des_cbc = 'DES-CBC'; {Do not localize} - {$EXTERNALSYM SN_des_cfb64} - SN_des_cfb64 = 'DES-CFB'; {Do not localize} - {$EXTERNALSYM SN_des_ecb} - SN_des_ecb = 'DES-ECB'; {Do not localize} - {$EXTERNALSYM SN_des_ede} - SN_des_ede = 'DES-EDE'; {Do not localize} - {$EXTERNALSYM SN_des_ede3} - SN_des_ede3 = 'DES-EDE3'; {Do not localize} - {$EXTERNALSYM SN_des_ede3_cbc} - SN_des_ede3_cbc = 'DES-EDE3-CBC'; {Do not localize} - {$EXTERNALSYM SN_des_ede3_cfb64} - SN_des_ede3_cfb64 = 'DES-EDE3-CFB'; {Do not localize} - {$EXTERNALSYM SN_des_ede3_ofb64} - SN_des_ede3_ofb64 = 'DES-EDE3-OFB'; {Do not localize} - {$EXTERNALSYM SN_des_ede_cbc} - SN_des_ede_cbc = 'DES-EDE-CBC'; {Do not localize} - {$EXTERNALSYM SN_des_ede_cfb64} - SN_des_ede_cfb64 = 'DES-EDE-CFB'; {Do not localize} - {$EXTERNALSYM SN_des_ede_ofb64} - SN_des_ede_ofb64 = 'DES-EDE-OFB'; {Do not localize} - {$EXTERNALSYM SN_des_ofb64} - SN_des_ofb64 = 'DES-OFB'; {Do not localize} - {$EXTERNALSYM SN_description} - SN_description = 'D'; {Do not localize} - {$EXTERNALSYM SN_desx_cbc} - SN_desx_cbc = 'DESX-CBC'; {Do not localize} - {$EXTERNALSYM SN_dsa} - SN_dsa = 'DSA'; {Do not localize} - {$EXTERNALSYM SN_dsaWithSHA} - SN_dsaWithSHA = 'DSA-SHA'; {Do not localize} - {$EXTERNALSYM SN_dsaWithSHA1} - SN_dsaWithSHA1 = 'DSA-SHA1'; {Do not localize} - {$EXTERNALSYM SN_dsaWithSHA1_2} - SN_dsaWithSHA1_2 = 'DSA-SHA1-old'; {Do not localize} - {$EXTERNALSYM SN_dsa_2} - SN_dsa_2 = 'DSA-old'; {Do not localize} - {$EXTERNALSYM SN_X9_62_id_ecPublicKey} - SN_X9_62_id_ecPublicKey = 'id-ecPublicKey'; {Do not localize} - {$EXTERNALSYM SN_email_protect} - SN_email_protect = 'emailProtection'; {Do not localize} - {$EXTERNALSYM SN_ext_key_usage} - SN_ext_key_usage = 'extendedKeyUsage'; {Do not localize} - {$EXTERNALSYM SN_givenName} - SN_givenName = 'G'; {Do not localize} - {$EXTERNALSYM SN_id_kp} - SN_id_kp = 'id-kp'; {Do not localize} - {$EXTERNALSYM SN_id_pkix} - SN_id_pkix = 'PKIX'; {Do not localize} - {$EXTERNALSYM SN_id_qt_cps} - SN_id_qt_cps = 'id-qt-cps'; {Do not localize} - {$EXTERNALSYM SN_id_qt_unotice} - SN_id_qt_unotice = 'id-qt-unotice'; {Do not localize} - {$EXTERNALSYM SN_idea_cbc} - SN_idea_cbc = 'IDEA-CBC'; {Do not localize} - {$EXTERNALSYM SN_idea_cfb64} - SN_idea_cfb64 = 'IDEA-CFB'; {Do not localize} - {$EXTERNALSYM SN_idea_ecb} - SN_idea_ecb = 'IDEA-ECB'; {Do not localize} - {$EXTERNALSYM SN_idea_ofb64} - SN_idea_ofb64 = 'IDEA-OFB'; {Do not localize} - {$EXTERNALSYM SN_identified_organization} - SN_identified_organization = 'identified-organization'; {Do not localize} - {$EXTERNALSYM SN_initials} - SN_initials = 'I'; {Do not localize} - {$EXTERNALSYM SN_invalidity_date} - SN_invalidity_date = 'invalidityDate'; {Do not localize} - {$EXTERNALSYM SN_iso} - SN_iso = 'ISO'; {Do not localize} - {$EXTERNALSYM SN_issuer_alt_name} - SN_issuer_alt_name = 'issuerAltName'; {Do not localize} - {$EXTERNALSYM SN_itu_t} - SN_itu_t = 'ITU-T'; {Do not localize} - {$EXTERNALSYM SN_joint_iso_itu_t} - SN_joint_iso_itu_t = 'JOINT-ISO-ITU-T'; {Do not localize} - {$EXTERNALSYM SN_key_usage} - SN_key_usage = 'keyUsage'; {Do not localize} - {$EXTERNALSYM SN_ld_ce} - SN_ld_ce = 'ld-ce'; {Do not localize} - {$EXTERNALSYM SN_localityName} - SN_localityName = 'L'; {Do not localize} - {$EXTERNALSYM SN_md2} - SN_md2 = 'MD2'; {Do not localize} - {$EXTERNALSYM SN_md2WithRSAEncryption} - SN_md2WithRSAEncryption = 'RSA-MD2'; {Do not localize} - {$EXTERNALSYM SN_md5} - SN_md5 = 'MD5'; {Do not localize} - {$EXTERNALSYM SN_md5WithRSA} - SN_md5WithRSA = 'RSA-NP-MD5'; {Do not localize} - {$EXTERNALSYM SN_md5WithRSAEncryption} - SN_md5WithRSAEncryption = 'RSA-MD5'; {Do not localize} - {$EXTERNALSYM SN_md5_sha1} - SN_md5_sha1 = 'MD5-SHA1'; {Do not localize} - {$EXTERNALSYM SN_mdc2} - SN_mdc2 = 'MDC2'; {Do not localize} - {$EXTERNALSYM SN_mdc2WithRSA} - SN_mdc2WithRSA = 'RSA-MDC2'; {Do not localize} - {$EXTERNALSYM SN_member_body} - SN_member_body ='member-body'; {Do not localize} - {$EXTERNALSYM SN_ms_code_com} - SN_ms_code_com = 'msCodeCom'; {Do not localize} - {$EXTERNALSYM SN_ms_code_ind} - SN_ms_code_ind = 'msCodeInd'; {Do not localize} - {$EXTERNALSYM SN_ms_ctl_sign} - SN_ms_ctl_sign = 'msCTLSign'; {Do not localize} - {$EXTERNALSYM SN_ms_efs} - SN_ms_efs = 'msEFS'; {Do not localize} - {$EXTERNALSYM SN_ms_sgc} - SN_ms_sgc = 'msSGC'; {Do not localize} - {$EXTERNALSYM SN_netscape} - SN_netscape = 'Netscape'; {Do not localize} - {$EXTERNALSYM SN_netscape_base_url} - SN_netscape_base_url = 'nsBaseUrl'; {Do not localize} - {$EXTERNALSYM SN_netscape_ca_policy_url} - SN_netscape_ca_policy_url = 'nsCaPolicyUrl'; {Do not localize} - {$EXTERNALSYM SN_netscape_ca_revocation_url} - SN_netscape_ca_revocation_url = 'nsCaRevocationUrl'; {Do not localize} - {$EXTERNALSYM SN_netscape_cert_extension} - SN_netscape_cert_extension = 'nsCertExt'; {Do not localize} - {$EXTERNALSYM SN_netscape_cert_sequence} - SN_netscape_cert_sequence = 'nsCertSequence'; {Do not localize} - {$EXTERNALSYM SN_netscape_cert_type} - SN_netscape_cert_type = 'nsCertType'; {Do not localize} - {$EXTERNALSYM SN_netscape_comment} - SN_netscape_comment = 'nsComment'; {Do not localize} - {$EXTERNALSYM SN_netscape_data_type} - SN_netscape_data_type = 'nsDataType'; {Do not localize} - {$EXTERNALSYM SN_netscape_renewal_url} - SN_netscape_renewal_url = 'nsRenewalUrl'; {Do not localize} - {$EXTERNALSYM SN_netscape_revocation_url} - SN_netscape_revocation_url = 'nsRevocationUrl'; {Do not localize} - {$EXTERNALSYM SN_netscape_ssl_server_name} - SN_netscape_ssl_server_name = 'nsSslServerName'; {Do not localize} - {$EXTERNALSYM SN_ns_sgc} - SN_ns_sgc = 'nsSGC'; {Do not localize} - {$EXTERNALSYM SN_organizationName} - SN_organizationName = 'O'; {Do not localize} - {$EXTERNALSYM SN_organizationalUnitName} - SN_organizationalUnitName = 'OU'; {Do not localize} - {$EXTERNALSYM SN_pkcs9_emailAddress} - SN_pkcs9_emailAddress = 'Email'; {Do not localize} - {$EXTERNALSYM SN_private_key_usage_period} - SN_private_key_usage_period = 'privateKeyUsagePeriod'; {Do not localize} - {$EXTERNALSYM SN_rc2_40_cbc} - SN_rc2_40_cbc = 'RC2-40-CBC'; {Do not localize} - {$EXTERNALSYM SN_rc2_64_cbc} - SN_rc2_64_cbc = 'RC2-64-CBC'; {Do not localize} - {$EXTERNALSYM SN_rc2_cbc} - SN_rc2_cbc = 'RC2-CBC'; {Do not localize} - {$EXTERNALSYM SN_rc2_cfb64} - SN_rc2_cfb64 = 'RC2-CFB'; {Do not localize} - {$EXTERNALSYM SN_rc2_ecb} - SN_rc2_ecb = 'RC2-ECB'; {Do not localize} - {$EXTERNALSYM SN_rc2_ofb64} - SN_rc2_ofb64 = 'RC2-OFB'; {Do not localize} - {$EXTERNALSYM SN_rc4} - SN_rc4 = 'RC4'; {Do not localize} - {$EXTERNALSYM SN_rc4_40} - SN_rc4_40 = 'RC4-40'; {Do not localize} - {$EXTERNALSYM SN_rc5_cbc} - SN_rc5_cbc = 'RC5-CBC'; {Do not localize} - {$EXTERNALSYM SN_rc5_cfb64} - SN_rc5_cfb64 = 'RC5-CFB'; {Do not localize} - {$EXTERNALSYM SN_rc5_ecb} - SN_rc5_ecb = 'RC5-ECB'; {Do not localize} - {$EXTERNALSYM SN_rc5_ofb64} - SN_rc5_ofb64 = 'RC5-OFB'; {Do not localize} - {$EXTERNALSYM SN_ripemd160} - SN_ripemd160 = 'RIPEMD160'; {Do not localize} - {$EXTERNALSYM SN_ripemd160WithRSA} - SN_ripemd160WithRSA = 'RSA-RIPEMD160'; {Do not localize} - {$EXTERNALSYM SN_rle_compression} - SN_rle_compression = 'RLE'; {Do not localize} - {$EXTERNALSYM SN_rsa} - SN_rsa = 'RSA'; {Do not localize} - {$EXTERNALSYM SN_serialNumber} - SN_serialNumber = 'SN'; {Do not localize} - {$EXTERNALSYM SN_server_auth} - SN_server_auth = 'serverAuth'; {Do not localize} - {$EXTERNALSYM SN_sha} - SN_sha = 'SHA'; {Do not localize} - {$EXTERNALSYM SN_sha1} - SN_sha1 = 'SHA1'; {Do not localize} - {$EXTERNALSYM SN_sha1WithRSA} - SN_sha1WithRSA = 'RSA-SHA1-2'; {Do not localize} - {$EXTERNALSYM SN_sha1WithRSAEncryption} - SN_sha1WithRSAEncryption = 'RSA-SHA1'; {Do not localize} - {$EXTERNALSYM SN_shaWithRSAEncryption} - SN_shaWithRSAEncryption = 'RSA-SHA'; {Do not localize} - {$EXTERNALSYM SN_stateOrProvinceName} - SN_stateOrProvinceName = 'ST'; {Do not localize} - {$EXTERNALSYM SN_subject_alt_name} - SN_subject_alt_name = 'subjectAltName'; {Do not localize} - {$EXTERNALSYM SN_subject_key_identifier} - SN_subject_key_identifier = 'subjectKeyIdentifier'; {Do not localize} - {$EXTERNALSYM SN_surname} - SN_surname = 'S'; {Do not localize} - {$EXTERNALSYM SN_sxnet} - SN_sxnet = 'SXNetID'; {Do not localize} - {$EXTERNALSYM SN_time_stamp} - SN_time_stamp = 'timeStamping'; {Do not localize} - {$EXTERNALSYM SN_title} - SN_title = 'T'; {Do not localize} - {$EXTERNALSYM SN_undef} - SN_undef = 'UNDEF'; {Do not localize} - {$EXTERNALSYM SN_uniqueIdentifier} - SN_uniqueIdentifier = 'UID'; {Do not localize} - {$EXTERNALSYM SN_zlib_compression} - SN_zlib_compression = 'ZLIB'; {Do not localize} - {$EXTERNALSYM OCSP_DEFAULT_NONCE_LENGTH} - OCSP_DEFAULT_NONCE_LENGTH = 16; - {$EXTERNALSYM OCSP_NOCERTS} - OCSP_NOCERTS = $1; - {$EXTERNALSYM OCSP_NOINTERN} - OCSP_NOINTERN = $2; - {$EXTERNALSYM OCSP_NOSIGS} - OCSP_NOSIGS = $4; - {$EXTERNALSYM OCSP_NOCHAIN} - OCSP_NOCHAIN = $8; - {$EXTERNALSYM OCSP_NOVERIFY} - OCSP_NOVERIFY = $10; - {$EXTERNALSYM OCSP_NOEXPLICIT} - OCSP_NOEXPLICIT = $20; - {$EXTERNALSYM OCSP_NOCASIGN} - OCSP_NOCASIGN = $40; - {$EXTERNALSYM OCSP_NODELEGATED} - OCSP_NODELEGATED = $80; - {$EXTERNALSYM OCSP_NOCHECKS} - OCSP_NOCHECKS = $100; - {$EXTERNALSYM OCSP_TRUSTOTHER} - OCSP_TRUSTOTHER = $200; - {$EXTERNALSYM OCSP_RESPID_KEY} - OCSP_RESPID_KEY = $400; - {$EXTERNALSYM OCSP_NOTIME} - OCSP_NOTIME = $800; - {$EXTERNALSYM OCSP_RESPONSE_STATUS_SUCCESSFUL} - OCSP_RESPONSE_STATUS_SUCCESSFUL = 0; - {$EXTERNALSYM OCSP_RESPONSE_STATUS_MALFORMEDREQUEST} - OCSP_RESPONSE_STATUS_MALFORMEDREQUEST = 1; - {$EXTERNALSYM OCSP_RESPONSE_STATUS_INTERNALERROR} - OCSP_RESPONSE_STATUS_INTERNALERROR = 2; - {$EXTERNALSYM OCSP_RESPONSE_STATUS_TRYLATER} - OCSP_RESPONSE_STATUS_TRYLATER = 3; - {$EXTERNALSYM OCSP_RESPONSE_STATUS_SIGREQUIRED} - OCSP_RESPONSE_STATUS_SIGREQUIRED = 5; - {$EXTERNALSYM OCSP_RESPONSE_STATUS_UNAUTHORIZED} - OCSP_RESPONSE_STATUS_UNAUTHORIZED = 6; - {$EXTERNALSYM OCSP_REVOKED_STATUS_NOSTATUS} - OCSP_REVOKED_STATUS_NOSTATUS = -1; - {$EXTERNALSYM OCSP_REVOKED_STATUS_UNSPECIFIED} - OCSP_REVOKED_STATUS_UNSPECIFIED = 0; - {$EXTERNALSYM OCSP_REVOKED_STATUS_KEYCOMPROMISE} - OCSP_REVOKED_STATUS_KEYCOMPROMISE = 1; - {$EXTERNALSYM OCSP_REVOKED_STATUS_CACOMPROMISE} - OCSP_REVOKED_STATUS_CACOMPROMISE = 2; - {$EXTERNALSYM OCSP_REVOKED_STATUS_AFFILIATIONCHANGED} - OCSP_REVOKED_STATUS_AFFILIATIONCHANGED = 3; - {$EXTERNALSYM OCSP_REVOKED_STATUS_SUPERSEDED} - OCSP_REVOKED_STATUS_SUPERSEDED = 4; - {$EXTERNALSYM OCSP_REVOKED_STATUS_CESSATIONOFOPERATION} - OCSP_REVOKED_STATUS_CESSATIONOFOPERATION = 5; - {$EXTERNALSYM OCSP_REVOKED_STATUS_CERTIFICATEHOLD} - OCSP_REVOKED_STATUS_CERTIFICATEHOLD = 6; - {$EXTERNALSYM OCSP_REVOKED_STATUS_REMOVEFROMCRL} - OCSP_REVOKED_STATUS_REMOVEFROMCRL = 8; - {$EXTERNALSYM V_OCSP_CERTSTATUS_GOOD} - V_OCSP_CERTSTATUS_GOOD = 0; - {$EXTERNALSYM V_OCSP_CERTSTATUS_REVOKED} - V_OCSP_CERTSTATUS_REVOKED = 1; - {$EXTERNALSYM V_OCSP_CERTSTATUS_UNKNOWN} - V_OCSP_CERTSTATUS_UNKNOWN = 2; - {$EXTERNALSYM OCSP_F_ASN1_STRING_ENCODE} - OCSP_F_ASN1_STRING_ENCODE = 100; - {$EXTERNALSYM OCSP_F_D2I_OCSP_NONCE} - OCSP_F_D2I_OCSP_NONCE = 102; - {$EXTERNALSYM OCSP_F_OCSP_BASIC_ADD1_STATUS} - OCSP_F_OCSP_BASIC_ADD1_STATUS = 103; - {$EXTERNALSYM OCSP_F_OCSP_BASIC_SIGN} - OCSP_F_OCSP_BASIC_SIGN = 104; - {$EXTERNALSYM OCSP_F_OCSP_BASIC_VERIFY} - OCSP_F_OCSP_BASIC_VERIFY = 105; - {$EXTERNALSYM OCSP_F_OCSP_CERT_ID_NEW} - OCSP_F_OCSP_CERT_ID_NEW = 101; - {$EXTERNALSYM OCSP_F_OCSP_CHECK_DELEGATED} - OCSP_F_OCSP_CHECK_DELEGATED = 106; - {$EXTERNALSYM OCSP_F_OCSP_CHECK_IDS} - OCSP_F_OCSP_CHECK_IDS = 107; - {$EXTERNALSYM OCSP_F_OCSP_CHECK_ISSUER} - OCSP_F_OCSP_CHECK_ISSUER = 108; - {$EXTERNALSYM OCSP_F_OCSP_CHECK_VALIDITY} - OCSP_F_OCSP_CHECK_VALIDITY = 115; - {$EXTERNALSYM OCSP_F_OCSP_MATCH_ISSUERID} - OCSP_F_OCSP_MATCH_ISSUERID = 109; - {$EXTERNALSYM OCSP_F_OCSP_PARSE_URL} - OCSP_F_OCSP_PARSE_URL = 114; - {$EXTERNALSYM OCSP_F_OCSP_REQUEST_SIGN} - OCSP_F_OCSP_REQUEST_SIGN = 110; - {$EXTERNALSYM OCSP_F_OCSP_REQUEST_VERIFY} - OCSP_F_OCSP_REQUEST_VERIFY = 116; - {$EXTERNALSYM OCSP_F_OCSP_RESPONSE_GET1_BASIC} - OCSP_F_OCSP_RESPONSE_GET1_BASIC = 111; - {$EXTERNALSYM OCSP_F_OCSP_SENDREQ_BIO} - OCSP_F_OCSP_SENDREQ_BIO = 112; - {$EXTERNALSYM OCSP_F_PARSE_HTTP_LINE1} - OCSP_F_PARSE_HTTP_LINE1 = 117; - {$EXTERNALSYM OCSP_F_REQUEST_VERIFY} - OCSP_F_REQUEST_VERIFY = 113; -//* Reason codes. */ - {$EXTERNALSYM OCSP_R_BAD_DATA} - OCSP_R_BAD_DATA = 100; - {$EXTERNALSYM OCSP_R_CERTIFICATE_VERIFY_ERROR} - OCSP_R_CERTIFICATE_VERIFY_ERROR = 101; - {$EXTERNALSYM OCSP_R_DIGEST_ERR} - OCSP_R_DIGEST_ERR = 102; - {$EXTERNALSYM OCSP_R_ERROR_IN_NEXTUPDATE_FIELD} - OCSP_R_ERROR_IN_NEXTUPDATE_FIELD = 122; - {$EXTERNALSYM OCSP_R_ERROR_IN_THISUPDATE_FIELD} - OCSP_R_ERROR_IN_THISUPDATE_FIELD = 123; - {$EXTERNALSYM OCSP_R_ERROR_PARSING_URL} - OCSP_R_ERROR_PARSING_URL = 121; - {$EXTERNALSYM OCSP_R_MISSING_OCSPSIGNING_USAGE} - OCSP_R_MISSING_OCSPSIGNING_USAGE = 103; - {$EXTERNALSYM OCSP_R_NEXTUPDATE_BEFORE_THISUPDATE} - OCSP_R_NEXTUPDATE_BEFORE_THISUPDATE = 124; - {$EXTERNALSYM OCSP_R_NOT_BASIC_RESPONSE} - OCSP_R_NOT_BASIC_RESPONSE = 104; - {$EXTERNALSYM OCSP_R_NO_CERTIFICATES_IN_CHAIN} - OCSP_R_NO_CERTIFICATES_IN_CHAIN = 105; - {$EXTERNALSYM OCSP_R_NO_CONTENT} - OCSP_R_NO_CONTENT = 106; - {$EXTERNALSYM OCSP_R_NO_PUBLIC_KEY} - OCSP_R_NO_PUBLIC_KEY = 107; - {$EXTERNALSYM OCSP_R_NO_RESPONSE_DATA} - OCSP_R_NO_RESPONSE_DATA = 108; - {$EXTERNALSYM OCSP_R_NO_REVOKED_TIME} - OCSP_R_NO_REVOKED_TIME = 109; - {$EXTERNALSYM OCSP_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE} - OCSP_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE = 110; - {$EXTERNALSYM OCSP_R_REQUEST_NOT_SIGNED} - OCSP_R_REQUEST_NOT_SIGNED = 128; - {$EXTERNALSYM OCSP_R_RESPONSE_CONTAINS_NO_REVOCATION_DATA} - OCSP_R_RESPONSE_CONTAINS_NO_REVOCATION_DATA = 111; - {$EXTERNALSYM OCSP_R_ROOT_CA_NOT_TRUSTED} - OCSP_R_ROOT_CA_NOT_TRUSTED = 112; - {$EXTERNALSYM OCSP_R_SERVER_READ_ERROR} - OCSP_R_SERVER_READ_ERROR = 113; - {$EXTERNALSYM OCSP_R_SERVER_RESPONSE_ERROR} - OCSP_R_SERVER_RESPONSE_ERROR = 114; - {$EXTERNALSYM OCSP_R_SERVER_RESPONSE_PARSE_ERROR} - OCSP_R_SERVER_RESPONSE_PARSE_ERROR = 115; - {$EXTERNALSYM OCSP_R_SERVER_WRITE_ERROR} - OCSP_R_SERVER_WRITE_ERROR = 116; - {$EXTERNALSYM OCSP_R_SIGNATURE_FAILURE} - OCSP_R_SIGNATURE_FAILURE = 117; - {$EXTERNALSYM OCSP_R_SIGNER_CERTIFICATE_NOT_FOUND} - OCSP_R_SIGNER_CERTIFICATE_NOT_FOUND = 118; - {$EXTERNALSYM OCSP_R_STATUS_EXPIRED} - OCSP_R_STATUS_EXPIRED = 125; - {$EXTERNALSYM OCSP_R_STATUS_NOT_YET_VALID} - OCSP_R_STATUS_NOT_YET_VALID = 126; - {$EXTERNALSYM OCSP_R_STATUS_TOO_OLD} - OCSP_R_STATUS_TOO_OLD = 127; - {$EXTERNALSYM OCSP_R_UNKNOWN_MESSAGE_DIGEST} - OCSP_R_UNKNOWN_MESSAGE_DIGEST = 119; - {$EXTERNALSYM OCSP_R_UNKNOWN_NID} - OCSP_R_UNKNOWN_NID = 120; - {$EXTERNALSYM OCSP_R_UNSUPPORTED_REQUESTORNAME_TYPE} - OCSP_R_UNSUPPORTED_REQUESTORNAME_TYPE = 129; - {$EXTERNALSYM SSL_ST_CONNECT} - SSL_ST_CONNECT = $1000; - {$EXTERNALSYM SSL_ST_ACCEPT} - SSL_ST_ACCEPT = $2000; - {$EXTERNALSYM SSL_ST_MASK} - SSL_ST_MASK = $0FFF; - {$EXTERNALSYM SSL_ST_INIT} - SSL_ST_INIT = SSL_ST_CONNECT or SSL_ST_ACCEPT; - {$EXTERNALSYM SSL_ST_BEFORE} - SSL_ST_BEFORE = $4000; - {$EXTERNALSYM SSL_ST_OK} - SSL_ST_OK = $03; - {$EXTERNALSYM SSL_ST_RENEGOTIATE} - SSL_ST_RENEGOTIATE = $04 or SSL_ST_INIT; - {$EXTERNALSYM SSL_CB_LOOP} - SSL_CB_LOOP = $01; - {$EXTERNALSYM SSL_CB_EXIT} - SSL_CB_EXIT = $02; - {$EXTERNALSYM SSL_CB_READ} - SSL_CB_READ = $04; - {$EXTERNALSYM SSL_CB_WRITE} - SSL_CB_WRITE = $08; - {$EXTERNALSYM SSL_CB_ALERT} - SSL_CB_ALERT = $4000; - - {$EXTERNALSYM SSL_CB_READ_ALERT} - SSL_CB_READ_ALERT = SSL_CB_ALERT or SSL_CB_READ; - {$EXTERNALSYM SSL_CB_WRITE_ALERT} - SSL_CB_WRITE_ALERT = SSL_CB_ALERT or SSL_CB_WRITE; - {$EXTERNALSYM SSL_CB_ACCEPT_LOOP} - SSL_CB_ACCEPT_LOOP = SSL_ST_ACCEPT or SSL_CB_LOOP; - {$EXTERNALSYM SSL_CB_ACCEPT_EXIT} - SSL_CB_ACCEPT_EXIT = SSL_ST_ACCEPT or SSL_CB_EXIT; - {$EXTERNALSYM SSL_CB_CONNECT_LOOP} - SSL_CB_CONNECT_LOOP = SSL_ST_CONNECT or SSL_CB_LOOP; - {$EXTERNALSYM SSL_CB_CONNECT_EXIT} - SSL_CB_CONNECT_EXIT = SSL_ST_CONNECT or SSL_CB_EXIT; - {$EXTERNALSYM SSL_CB_HANDSHAKE_START} - SSL_CB_HANDSHAKE_START = $10; - {$EXTERNALSYM SSL_CB_HANDSHAKE_DONE} - SSL_CB_HANDSHAKE_DONE = $20; - {$EXTERNALSYM SSL_ST_READ_BODY} - SSL_ST_READ_BODY = $F1; - {$EXTERNALSYM SSL_ST_READ_DONE} - SSL_ST_READ_DONE = $F2; - {$EXTERNALSYM SSL_ST_READ_HEADER} - SSL_ST_READ_HEADER = $F0; - - {$EXTERNALSYM SSL23_ST_CR_SRVR_HELLO_A} - SSL23_ST_CR_SRVR_HELLO_A = $220 or SSL_ST_CONNECT; - {$EXTERNALSYM SSL23_ST_CR_SRVR_HELLO_B} - SSL23_ST_CR_SRVR_HELLO_B = $221 or SSL_ST_CONNECT; - {$EXTERNALSYM SSL23_ST_CW_CLNT_HELLO_A} - SSL23_ST_CW_CLNT_HELLO_A = $210 or SSL_ST_CONNECT; - {$EXTERNALSYM SSL23_ST_CW_CLNT_HELLO_B} - SSL23_ST_CW_CLNT_HELLO_B = $211 or SSL_ST_CONNECT; - - {$EXTERNALSYM SSL23_ST_SR_CLNT_HELLO_A} - SSL23_ST_SR_CLNT_HELLO_A = $210 or SSL_ST_ACCEPT; - {$EXTERNALSYM SSL23_ST_SR_CLNT_HELLO_B} - SSL23_ST_SR_CLNT_HELLO_B = $211 or SSL_ST_ACCEPT; - {$EXTERNALSYM SSL2_AT_MD5_WITH_RSA_ENCRYPTION} - SSL2_AT_MD5_WITH_RSA_ENCRYPTION = $01; - {$EXTERNALSYM SSL2_CF_5_BYTE_ENC} - SSL2_CF_5_BYTE_ENC = $01; - {$EXTERNALSYM SSL2_CF_8_BYTE_ENC} - SSL2_CF_8_BYTE_ENC = $02; - {$EXTERNALSYM SSL2_CHALLENGE_LENGTH} - SSL2_CHALLENGE_LENGTH = 16; - {$EXTERNALSYM SSL2_CK_DES_192_EDE3_CBC_WITH_MD5} - SSL2_CK_DES_192_EDE3_CBC_WITH_MD5 = $020700c0; - {$EXTERNALSYM SSL2_CK_DES_192_EDE3_CBC_WITH_SHA} - SSL2_CK_DES_192_EDE3_CBC_WITH_SHA = $020701c0; - {$EXTERNALSYM SSL2_CK_DES_64_CBC_WITH_MD5} - SSL2_CK_DES_64_CBC_WITH_MD5 = $02060040; - {$EXTERNALSYM SSL2_CK_DES_64_CBC_WITH_SHA} - SSL2_CK_DES_64_CBC_WITH_SHA = $02060140; - {$EXTERNALSYM SSL2_CK_DES_64_CFB64_WITH_MD5_1} - SSL2_CK_DES_64_CFB64_WITH_MD5_1 = $02ff0800; - {$EXTERNALSYM SSL2_CK_IDEA_128_CBC_WITH_MD5} - SSL2_CK_IDEA_128_CBC_WITH_MD5 = $02050080; - {$EXTERNALSYM SSL2_CK_NULL} - SSL2_CK_NULL = $02ff0810; - {$EXTERNALSYM SSL2_CK_NULL_WITH_MD5} - SSL2_CK_NULL_WITH_MD5 = $02000000; - {$EXTERNALSYM SSL2_CK_RC2_128_CBC_EXPORT40_WITH_MD5} - SSL2_CK_RC2_128_CBC_EXPORT40_WITH_MD5 = $02040080; - {$EXTERNALSYM SSL2_CK_RC2_128_CBC_WITH_MD5} - SSL2_CK_RC2_128_CBC_WITH_MD5 = $02030080; - {$EXTERNALSYM SSL2_CK_RC4_128_EXPORT40_WITH_MD5} - SSL2_CK_RC4_128_EXPORT40_WITH_MD5 = $02020080; - {$EXTERNALSYM SSL2_CK_RC4_128_WITH_MD5} - SSL2_CK_RC4_128_WITH_MD5 = $02010080; - {$EXTERNALSYM SSL2_CK_RC4_64_WITH_MD5} - SSL2_CK_RC4_64_WITH_MD5 = $02080080; - {$EXTERNALSYM SSL2_CONNECTION_ID_LENGTH} - SSL2_CONNECTION_ID_LENGTH = 16; - {$EXTERNALSYM SSL2_CT_X509_CERTIFICATE} - SSL2_CT_X509_CERTIFICATE = $01; - {$EXTERNALSYM SSL2_MAX_CERT_CHALLENGE_LENGTH} - SSL2_MAX_CERT_CHALLENGE_LENGTH = 32; - {$EXTERNALSYM SSL2_MAX_CHALLENGE_LENGTH} - SSL2_MAX_CHALLENGE_LENGTH = 32; - {$EXTERNALSYM SSL2_MAX_CONNECTION_ID_LENGTH} - SSL2_MAX_CONNECTION_ID_LENGTH = 16; - {$EXTERNALSYM SSL2_MAX_KEY_MATERIAL_LENGTH} - SSL2_MAX_KEY_MATERIAL_LENGTH = 24; - {$EXTERNALSYM SSL2_MAX_MASTER_KEY_LENGTH_IN_BITS} - SSL2_MAX_MASTER_KEY_LENGTH_IN_BITS = 256; - {$EXTERNALSYM SSL2_MAX_RECORD_LENGTH_3_BYTE_HEADER} - SSL2_MAX_RECORD_LENGTH_3_BYTE_HEADER = 16383; - {$EXTERNALSYM SSL2_MAX_SSL_SESSION_ID_LENGTH} - SSL2_MAX_SSL_SESSION_ID_LENGTH = 32; - {$EXTERNALSYM SSL2_MIN_CERT_CHALLENGE_LENGTH} - SSL2_MIN_CERT_CHALLENGE_LENGTH = 16; - {$EXTERNALSYM SSL2_MIN_CHALLENGE_LENGTH} - SSL2_MIN_CHALLENGE_LENGTH = 16; - {$EXTERNALSYM SSL2_MT_CLIENT_CERTIFICATE} - SSL2_MT_CLIENT_CERTIFICATE = 8; - {$EXTERNALSYM SSL2_MT_CLIENT_FINISHED} - SSL2_MT_CLIENT_FINISHED = 3; - {$EXTERNALSYM SSL2_MT_CLIENT_HELLO} - SSL2_MT_CLIENT_HELLO = 1; - {$EXTERNALSYM SSL2_MT_CLIENT_MASTER_KEY} - SSL2_MT_CLIENT_MASTER_KEY = 2; - {$EXTERNALSYM SSL2_MT_ERROR} - SSL2_MT_ERROR = 0; - {$EXTERNALSYM SSL2_MT_REQUEST_CERTIFICATE} - SSL2_MT_REQUEST_CERTIFICATE = 7; - {$EXTERNALSYM SSL2_MT_SERVER_FINISHED} - SSL2_MT_SERVER_FINISHED = 6; - {$EXTERNALSYM SSL2_MT_SERVER_HELLO} - SSL2_MT_SERVER_HELLO = 4; - {$EXTERNALSYM SSL2_MT_SERVER_VERIFY} - SSL2_MT_SERVER_VERIFY = 5; - {$EXTERNALSYM SSL2_PE_BAD_CERTIFICATE} - SSL2_PE_BAD_CERTIFICATE = $0004; - {$EXTERNALSYM SSL2_PE_NO_CERTIFICATE} - SSL2_PE_NO_CERTIFICATE = $0002; - {$EXTERNALSYM SSL2_PE_NO_CIPHER} - SSL2_PE_NO_CIPHER = $0001; - {$EXTERNALSYM SSL2_PE_UNDEFINED_ERROR} - SSL2_PE_UNDEFINED_ERROR = $0000; - {$EXTERNALSYM SSL2_PE_UNSUPPORTED_CERTIFICATE_TYPE} - SSL2_PE_UNSUPPORTED_CERTIFICATE_TYPE = $0006; - {$EXTERNALSYM SSL2_SSL_SESSION_ID_LENGTH} - SSL2_SSL_SESSION_ID_LENGTH = 16; - {$EXTERNALSYM SSL2_ST_CLIENT_START_ENCRYPTION} - SSL2_ST_CLIENT_START_ENCRYPTION = $80 or SSL_ST_CONNECT; - {$EXTERNALSYM SSL2_ST_GET_CLIENT_FINISHED_A} - SSL2_ST_GET_CLIENT_FINISHED_A = $50 or SSL_ST_ACCEPT; - {$EXTERNALSYM SSL2_ST_GET_CLIENT_FINISHED_B} - SSL2_ST_GET_CLIENT_FINISHED_B = $51 or SSL_ST_ACCEPT; - {$EXTERNALSYM SSL2_ST_GET_CLIENT_HELLO_A} - SSL2_ST_GET_CLIENT_HELLO_A = $10 or SSL_ST_ACCEPT; - {$EXTERNALSYM SSL2_ST_GET_CLIENT_HELLO_B} - SSL2_ST_GET_CLIENT_HELLO_B = $11 or SSL_ST_ACCEPT; - {$EXTERNALSYM SSL2_ST_GET_CLIENT_HELLO_C} - SSL2_ST_GET_CLIENT_HELLO_C = $12 or SSL_ST_ACCEPT; - {$EXTERNALSYM SSL2_ST_GET_CLIENT_MASTER_KEY_A} - SSL2_ST_GET_CLIENT_MASTER_KEY_A = $30 or SSL_ST_ACCEPT; - {$EXTERNALSYM SSL2_ST_GET_CLIENT_MASTER_KEY_B} - SSL2_ST_GET_CLIENT_MASTER_KEY_B = $31 or SSL_ST_ACCEPT; - {$EXTERNALSYM SSL2_ST_GET_SERVER_FINISHED_A} - SSL2_ST_GET_SERVER_FINISHED_A = $70 or SSL_ST_CONNECT; - {$EXTERNALSYM SSL2_ST_GET_SERVER_FINISHED_B} - SSL2_ST_GET_SERVER_FINISHED_B = $71 or SSL_ST_CONNECT; - {$EXTERNALSYM SSL2_ST_GET_SERVER_HELLO_A} - SSL2_ST_GET_SERVER_HELLO_A = $20 or SSL_ST_CONNECT; - {$EXTERNALSYM SSL2_ST_GET_SERVER_HELLO_B} - SSL2_ST_GET_SERVER_HELLO_B = $21 or SSL_ST_CONNECT; - {$EXTERNALSYM SSL2_ST_GET_SERVER_VERIFY_A} - SSL2_ST_GET_SERVER_VERIFY_A = $60 or SSL_ST_CONNECT; - {$EXTERNALSYM SSL2_ST_GET_SERVER_VERIFY_B} - SSL2_ST_GET_SERVER_VERIFY_B = $61 or SSL_ST_CONNECT; - {$EXTERNALSYM SSL2_ST_SEND_CLIENT_CERTIFICATE_A} - SSL2_ST_SEND_CLIENT_CERTIFICATE_A = $50 or SSL_ST_CONNECT; - {$EXTERNALSYM SSL2_ST_SEND_CLIENT_CERTIFICATE_B} - SSL2_ST_SEND_CLIENT_CERTIFICATE_B = $51 or SSL_ST_CONNECT; - {$EXTERNALSYM SSL2_ST_SEND_CLIENT_CERTIFICATE_C} - SSL2_ST_SEND_CLIENT_CERTIFICATE_C = $52 or SSL_ST_CONNECT; - {$EXTERNALSYM SSL2_ST_SEND_CLIENT_CERTIFICATE_D} - SSL2_ST_SEND_CLIENT_CERTIFICATE_D = $53 or SSL_ST_CONNECT; - {$EXTERNALSYM SSL2_ST_SEND_CLIENT_FINISHED_A} - SSL2_ST_SEND_CLIENT_FINISHED_A = $40 or SSL_ST_CONNECT; - {$EXTERNALSYM SSL2_ST_SEND_CLIENT_FINISHED_B} - SSL2_ST_SEND_CLIENT_FINISHED_B = $41 or SSL_ST_CONNECT; - {$EXTERNALSYM SSL2_ST_SEND_CLIENT_HELLO_A} - SSL2_ST_SEND_CLIENT_HELLO_A = $10 or SSL_ST_CONNECT; - {$EXTERNALSYM SSL2_ST_SEND_CLIENT_HELLO_B} - SSL2_ST_SEND_CLIENT_HELLO_B = $11 or SSL_ST_CONNECT; - {$EXTERNALSYM SSL2_ST_SEND_CLIENT_MASTER_KEY_A} - SSL2_ST_SEND_CLIENT_MASTER_KEY_A = $30 or SSL_ST_CONNECT; - {$EXTERNALSYM SSL2_ST_SEND_CLIENT_MASTER_KEY_B} - SSL2_ST_SEND_CLIENT_MASTER_KEY_B = $31 or SSL_ST_CONNECT; - {$EXTERNALSYM SSL2_ST_SEND_REQUEST_CERTIFICATE_A} - SSL2_ST_SEND_REQUEST_CERTIFICATE_A = $70 or SSL_ST_ACCEPT; - {$EXTERNALSYM SSL2_ST_SEND_REQUEST_CERTIFICATE_B} - SSL2_ST_SEND_REQUEST_CERTIFICATE_B = $71 or SSL_ST_ACCEPT; - {$EXTERNALSYM SSL2_ST_SEND_REQUEST_CERTIFICATE_C} - SSL2_ST_SEND_REQUEST_CERTIFICATE_C = $72 or SSL_ST_ACCEPT; - {$EXTERNALSYM SSL2_ST_SEND_REQUEST_CERTIFICATE_D} - SSL2_ST_SEND_REQUEST_CERTIFICATE_D = $73 or SSL_ST_ACCEPT; - {$EXTERNALSYM SSL2_ST_SEND_SERVER_FINISHED_A} - SSL2_ST_SEND_SERVER_FINISHED_A = $60 or SSL_ST_ACCEPT; - {$EXTERNALSYM SSL2_ST_SEND_SERVER_FINISHED_B} - SSL2_ST_SEND_SERVER_FINISHED_B = $61 or SSL_ST_ACCEPT; - {$EXTERNALSYM SSL2_ST_SEND_SERVER_HELLO_A} - SSL2_ST_SEND_SERVER_HELLO_A = $20 or SSL_ST_ACCEPT; - {$EXTERNALSYM SSL2_ST_SEND_SERVER_HELLO_B} - SSL2_ST_SEND_SERVER_HELLO_B = $21 or SSL_ST_ACCEPT; - {$EXTERNALSYM SSL2_ST_SEND_SERVER_VERIFY_A} - SSL2_ST_SEND_SERVER_VERIFY_A = $40 or SSL_ST_ACCEPT; - {$EXTERNALSYM SSL2_ST_SEND_SERVER_VERIFY_B} - SSL2_ST_SEND_SERVER_VERIFY_B = $41 or SSL_ST_ACCEPT; - {$EXTERNALSYM SSL2_ST_SEND_SERVER_VERIFY_C} - SSL2_ST_SEND_SERVER_VERIFY_C = $42 or SSL_ST_ACCEPT; - {$EXTERNALSYM SSL2_ST_SERVER_START_ENCRYPTION} - SSL2_ST_SERVER_START_ENCRYPTION = $80 or SSL_ST_ACCEPT; - {$EXTERNALSYM SSL2_ST_X509_GET_CLIENT_CERTIFICATE} - SSL2_ST_X509_GET_CLIENT_CERTIFICATE = $90 or SSL_ST_CONNECT; - {$EXTERNALSYM SSL2_ST_X509_GET_SERVER_CERTIFICATE} - SSL2_ST_X509_GET_SERVER_CERTIFICATE = $90 or SSL_ST_ACCEPT; - {$EXTERNALSYM SSL2_TXT_DES_192_EDE3_CBC_WITH_MD5} - SSL2_TXT_DES_192_EDE3_CBC_WITH_MD5 = 'DES-CBC3-MD5'; {Do not localize} - {$EXTERNALSYM SSL2_TXT_DES_192_EDE3_CBC_WITH_SHA} - SSL2_TXT_DES_192_EDE3_CBC_WITH_SHA = 'DES-CBC3-SHA'; {Do not localize} - {$EXTERNALSYM SSL2_TXT_DES_64_CBC_WITH_MD5} - SSL2_TXT_DES_64_CBC_WITH_MD5 = 'DES-CBC-MD5'; {Do not localize} - {$EXTERNALSYM SSL2_TXT_DES_64_CBC_WITH_SHA} - SSL2_TXT_DES_64_CBC_WITH_SHA = 'DES-CBC-SHA'; {Do not localize} - {$EXTERNALSYM SSL2_TXT_DES_64_CFB64_WITH_MD5_1} - SSL2_TXT_DES_64_CFB64_WITH_MD5_1 = 'DES-CFB-M1'; {Do not localize} - {$EXTERNALSYM SSL2_TXT_IDEA_128_CBC_WITH_MD5} - SSL2_TXT_IDEA_128_CBC_WITH_MD5 = 'IDEA-CBC-MD5'; {Do not localize} - {$EXTERNALSYM SSL2_TXT_NULL} - SSL2_TXT_NULL = 'NULL'; {Do not localize} - {$EXTERNALSYM SSL2_TXT_NULL_WITH_MD5} - SSL2_TXT_NULL_WITH_MD5 = 'NULL-MD5'; {Do not localize} - {$EXTERNALSYM SSL2_TXT_RC2_128_CBC_EXPORT40_WITH_MD5} - SSL2_TXT_RC2_128_CBC_EXPORT40_WITH_MD5 = 'EXP-RC2-CBC-MD5'; {Do not localize} - {$EXTERNALSYM SSL2_TXT_RC2_128_CBC_WITH_MD5} - SSL2_TXT_RC2_128_CBC_WITH_MD5 = 'RC2-CBC-MD5'; {Do not localize} - {$EXTERNALSYM SSL2_TXT_RC4_128_EXPORT40_WITH_MD5} - SSL2_TXT_RC4_128_EXPORT40_WITH_MD5 = 'EXP-RC4-MD5'; {Do not localize} - {$EXTERNALSYM SSL2_TXT_RC4_128_WITH_MD5} - SSL2_TXT_RC4_128_WITH_MD5 = 'RC4-MD5'; {Do not localize} - {$EXTERNALSYM SSL2_TXT_RC4_64_WITH_MD5} - SSL2_TXT_RC4_64_WITH_MD5 = 'RC4-64-MD5'; {Do not localize} - {$EXTERNALSYM SSL2_VERSION} - SSL2_VERSION = $0002; - {$EXTERNALSYM SSL2_VERSION_MAJOR} - SSL2_VERSION_MAJOR = $00; - {$EXTERNALSYM SSL2_VERSION_MINOR} - SSL2_VERSION_MINOR = $02; - {$EXTERNALSYM SSL3_AD_BAD_CERTIFICATE} - SSL3_AD_BAD_CERTIFICATE = 42; - {$EXTERNALSYM SSL3_AD_BAD_RECORD_MAC} - SSL3_AD_BAD_RECORD_MAC = 20; - {$EXTERNALSYM SSL3_AD_CERTIFICATE_EXPIRED} - SSL3_AD_CERTIFICATE_EXPIRED = 45; - {$EXTERNALSYM SSL3_AD_CERTIFICATE_REVOKED} - SSL3_AD_CERTIFICATE_REVOKED = 44; - {$EXTERNALSYM SSL3_AD_CERTIFICATE_UNKNOWN} - SSL3_AD_CERTIFICATE_UNKNOWN = 46; - {$EXTERNALSYM SSL3_AD_CLOSE_NOTIFY} - SSL3_AD_CLOSE_NOTIFY = 0; - {$EXTERNALSYM SSL3_AD_DECOMPRESSION_FAILURE} - SSL3_AD_DECOMPRESSION_FAILURE = 30; - {$EXTERNALSYM SSL3_AD_HANDSHAKE_FAILURE} - SSL3_AD_HANDSHAKE_FAILURE = 40; - {$EXTERNALSYM SSL3_AD_ILLEGAL_PARAMETER} - SSL3_AD_ILLEGAL_PARAMETER = 47; - {$EXTERNALSYM TLS1_HB_REQUEST} - TLS1_HB_REQUEST = 1; - {$EXTERNALSYM TLS1_HB_RESPONSE} - TLS1_HB_RESPONSE = 2; - {$EXTERNALSYM SSL3_AD_NO_CERTIFICATE} - SSL3_AD_NO_CERTIFICATE = 41; - {$EXTERNALSYM SSL3_AD_UNEXPECTED_MESSAGE} - SSL3_AD_UNEXPECTED_MESSAGE = 10; - {$EXTERNALSYM SSL3_AD_UNSUPPORTED_CERTIFICATE} - SSL3_AD_UNSUPPORTED_CERTIFICATE = 43; - {$EXTERNALSYM SSL3_AL_FATAL} - SSL3_AL_FATAL = 2; - {$EXTERNALSYM SSL3_AL_WARNING} - SSL3_AL_WARNING = 1; - {$EXTERNALSYM SSL3_CC_CLIENT} - SSL3_CC_CLIENT = $10; - {$EXTERNALSYM SSL3_CC_READ} - SSL3_CC_READ = $01; - {$EXTERNALSYM SSL3_CC_SERVER} - SSL3_CC_SERVER = $20; - {$EXTERNALSYM SSL3_CC_WRITE} - SSL3_CC_WRITE = $02; - {$EXTERNALSYM SSL3_CHANGE_CIPHER_CLIENT_READ} - SSL3_CHANGE_CIPHER_CLIENT_READ = SSL3_CC_CLIENT or SSL3_CC_READ; - {$EXTERNALSYM SSL3_CHANGE_CIPHER_CLIENT_WRITE} - SSL3_CHANGE_CIPHER_CLIENT_WRITE = SSL3_CC_CLIENT or SSL3_CC_WRITE; - {$EXTERNALSYM SSL3_CHANGE_CIPHER_SERVER_READ} - SSL3_CHANGE_CIPHER_SERVER_READ = SSL3_CC_SERVER or SSL3_CC_READ; - {$EXTERNALSYM SSL3_CHANGE_CIPHER_SERVER_WRITE} - SSL3_CHANGE_CIPHER_SERVER_WRITE = SSL3_CC_SERVER or SSL3_CC_WRITE; - {$EXTERNALSYM SSL3_CK_ADH_DES_192_CBC_SHA} - SSL3_CK_ADH_DES_192_CBC_SHA = $0300001B; - {$EXTERNALSYM SSL3_CK_ADH_DES_40_CBC_SHA} - SSL3_CK_ADH_DES_40_CBC_SHA = $03000019; - {$EXTERNALSYM SSL3_CK_ADH_DES_64_CBC_SHA} - SSL3_CK_ADH_DES_64_CBC_SHA = $0300001A; - {$EXTERNALSYM SSL3_CK_ADH_RC4_128_MD5} - SSL3_CK_ADH_RC4_128_MD5 = $03000018; - {$EXTERNALSYM SSL3_CK_ADH_RC4_40_MD5} - SSL3_CK_ADH_RC4_40_MD5 = $03000017; - {$EXTERNALSYM SSL3_CK_DH_DSS_DES_192_CBC3_SHA} - SSL3_CK_DH_DSS_DES_192_CBC3_SHA = $0300000D; - {$EXTERNALSYM SSL3_CK_DH_DSS_DES_40_CBC_SHA} - SSL3_CK_DH_DSS_DES_40_CBC_SHA = $0300000B; - {$EXTERNALSYM SSL3_CK_DH_DSS_DES_64_CBC_SHA} - SSL3_CK_DH_DSS_DES_64_CBC_SHA = $0300000C; - {$EXTERNALSYM SSL3_CK_DH_RSA_DES_192_CBC3_SHA} - SSL3_CK_DH_RSA_DES_192_CBC3_SHA = $03000010; - {$EXTERNALSYM SSL3_CK_DH_RSA_DES_40_CBC_SHA} - SSL3_CK_DH_RSA_DES_40_CBC_SHA = $0300000E; - {$EXTERNALSYM SSL3_CK_DH_RSA_DES_64_CBC_SHA} - SSL3_CK_DH_RSA_DES_64_CBC_SHA = $0300000F; - {$EXTERNALSYM SSL3_CK_EDH_DSS_DES_192_CBC3_SHA} - SSL3_CK_EDH_DSS_DES_192_CBC3_SHA = $03000013; - {$EXTERNALSYM SSL3_CK_EDH_DSS_DES_40_CBC_SHA} - SSL3_CK_EDH_DSS_DES_40_CBC_SHA = $03000011; - {$EXTERNALSYM SSL3_CK_EDH_DSS_DES_64_CBC_SHA} - SSL3_CK_EDH_DSS_DES_64_CBC_SHA = $03000012; - {$EXTERNALSYM SSL3_CK_EDH_RSA_DES_192_CBC3_SHA} - SSL3_CK_EDH_RSA_DES_192_CBC3_SHA = $03000016; - {$EXTERNALSYM SSL3_CK_EDH_RSA_DES_40_CBC_SHA} - SSL3_CK_EDH_RSA_DES_40_CBC_SHA = $03000014; - {$EXTERNALSYM SSL3_CK_EDH_RSA_DES_64_CBC_SHA} - SSL3_CK_EDH_RSA_DES_64_CBC_SHA = $03000015; - {$EXTERNALSYM SSL3_CK_FZA_DMS_FZA_SHA} - SSL3_CK_FZA_DMS_FZA_SHA = $0300001D; - {$EXTERNALSYM SSL3_CK_FZA_DMS_NULL_SHA} - SSL3_CK_FZA_DMS_NULL_SHA = $0300001C; - {$EXTERNALSYM SSL3_CK_FZA_DMS_RC4_SHA} - SSL3_CK_FZA_DMS_RC4_SHA = $0300001E; - {$EXTERNALSYM SSL3_CK_RSA_DES_192_CBC3_SHA} - SSL3_CK_RSA_DES_192_CBC3_SHA = $0300000A; - {$EXTERNALSYM SSL3_CK_RSA_DES_40_CBC_SHA} - SSL3_CK_RSA_DES_40_CBC_SHA = $03000008; - {$EXTERNALSYM SSL3_CK_RSA_DES_64_CBC_SHA} - SSL3_CK_RSA_DES_64_CBC_SHA = $03000009; - {$EXTERNALSYM SSL3_CK_RSA_IDEA_128_SHA} - SSL3_CK_RSA_IDEA_128_SHA = $03000007; - //* Signalling cipher suite value: from draft-ietf-tls-renegotiation-03.txt */ - {$EXTERNALSYM SSL3_CK_SCSV} - SSL3_CK_SCSV = $030000FF; - - {$EXTERNALSYM SSL3_CK_RSA_NULL_MD5} - SSL3_CK_RSA_NULL_MD5 = $03000001; - {$EXTERNALSYM SSL3_CK_RSA_NULL_SHA} - SSL3_CK_RSA_NULL_SHA = $03000002; - {$EXTERNALSYM SSL3_CK_RSA_RC2_40_MD5} - SSL3_CK_RSA_RC2_40_MD5 = $03000006; - {$EXTERNALSYM SSL3_CK_RSA_RC4_128_MD5} - SSL3_CK_RSA_RC4_128_MD5 = $03000004; - {$EXTERNALSYM SSL3_CK_RSA_RC4_128_SHA} - SSL3_CK_RSA_RC4_128_SHA = $03000005; - {$EXTERNALSYM SSL3_CK_RSA_RC4_40_MD5} - SSL3_CK_RSA_RC4_40_MD5 = $03000003; - - {$EXTERNALSYM SSL3_CT_RSA_SIGN} - SSL3_CT_RSA_SIGN = 1; - {$EXTERNALSYM SSL3_CT_DSS_SIGN} - SSL3_CT_DSS_SIGN = 2; - {$EXTERNALSYM SSL3_CT_RSA_FIXED_DH} - SSL3_CT_RSA_FIXED_DH = 3; - {$EXTERNALSYM SSL3_CT_DSS_FIXED_DH} - SSL3_CT_DSS_FIXED_DH = 4; - {$EXTERNALSYM SSL3_CT_RSA_EPHEMERAL_DH} - SSL3_CT_RSA_EPHEMERAL_DH = 5; - {$EXTERNALSYM SSL3_CT_DSS_EPHEMERAL_DH} - SSL3_CT_DSS_EPHEMERAL_DH = 6; - - {$EXTERNALSYM SSL3_CT_FORTEZZA_DMS} - SSL3_CT_FORTEZZA_DMS = 20; - {$EXTERNALSYM SSL3_CT_NUMBER} - SSL3_CT_NUMBER = 9; //was 7; - - {$EXTERNALSYM SSL3_FLAGS_DELAY_CLIENT_FINISHED} - SSL3_FLAGS_DELAY_CLIENT_FINISHED = $0002; - {$EXTERNALSYM SSL3_FLAGS_NO_RENEGOTIATE_CIPHERS} - SSL3_FLAGS_NO_RENEGOTIATE_CIPHERS = $0001; - {$EXTERNALSYM SSL3_FLAGS_POP_BUFFER} - SSL3_FLAGS_POP_BUFFER = $0004; - {$EXTERNALSYM TLS1_FLAGS_TLS_PADDING_BUG} - TLS1_FLAGS_TLS_PADDING_BUG = $0008; - {$EXTERNALSYM TLS1_FLAGS_SKIP_CERT_VERIFY} - TLS1_FLAGS_SKIP_CERT_VERIFY = $0010; - {$EXTERNALSYM TLS1_FLAGS_KEEP_HANDSHAKE} - TLS1_FLAGS_KEEP_HANDSHAKE = $0020; - - {* SSL3_FLAGS_SGC_RESTART_DONE is set when we - * restart a handshake because of MS SGC and so prevents us - * from restarting the handshake in a loop. It's reset on a - * renegotiation, so effectively limits the client to one restart - * per negotiation. This limits the possibility of a DDoS - * attack where the client handshakes in a loop using SGC to - * restart. Servers which permit renegotiation can still be - * effected, but we can't prevent that. - *} - {$EXTERNALSYM SSL3_FLAGS_SGC_RESTART_DONE} - SSL3_FLAGS_SGC_RESTART_DONE = $0040; - - {$EXTERNALSYM SSL3_MASTER_SECRET_SIZE} - SSL3_MASTER_SECRET_SIZE = 48; - {$EXTERNALSYM SSL3_MAX_SSL_SESSION_ID_LENGTH} - SSL3_MAX_SSL_SESSION_ID_LENGTH = 32; - {$EXTERNALSYM SSL3_MT_HELLO_REQUEST} - SSL3_MT_HELLO_REQUEST = 0; - {$EXTERNALSYM SSL3_MT_CLIENT_REQUEST} - SSL3_MT_CLIENT_REQUEST = 0; - {$EXTERNALSYM SSL3_MT_CLIENT_HELLO} - SSL3_MT_CLIENT_HELLO = 1; - {$EXTERNALSYM SSL3_MT_SERVER_HELLO} - SSL3_MT_SERVER_HELLO = 2; - {$EXTERNALSYM SSL3_MT_NEWSESSION_TICKET} - SSL3_MT_NEWSESSION_TICKET = 4; - {$EXTERNALSYM SSL3_MT_CERTIFICATE} - SSL3_MT_CERTIFICATE = 11; - {$EXTERNALSYM SSL3_MT_SERVER_KEY_EXCHANGE} - SSL3_MT_SERVER_KEY_EXCHANGE = 12; - {$EXTERNALSYM SSL3_MT_CERTIFICATE_REQUEST} - SSL3_MT_CERTIFICATE_REQUEST = 13; - {$EXTERNALSYM SSL3_MT_SERVER_DONE} - SSL3_MT_SERVER_DONE = 14; - {$EXTERNALSYM SSL3_MT_CERTIFICATE_VERIFY} - SSL3_MT_CERTIFICATE_VERIFY = 15; - {$EXTERNALSYM SSL3_MT_CLIENT_KEY_EXCHANGE} - SSL3_MT_CLIENT_KEY_EXCHANGE = 16; - {$EXTERNALSYM SSL3_MT_FINISHED} - SSL3_MT_FINISHED = 20; - {$EXTERNALSYM SSL3_MT_CERTIFICATE_STATUS} - SSL3_MT_CERTIFICATE_STATUS = 22; - {$EXTERNALSYM SSL3_MT_NEXT_PROTO} - SSL3_MT_NEXT_PROTO = 67; - {$EXTERNALSYM DTLS1_MT_HELLO_VERIFY_REQUEST} - DTLS1_MT_HELLO_VERIFY_REQUEST = 3; - {$EXTERNALSYM SSL3_MT_CCS} - SSL3_MT_CCS = 1; - {$EXTERNALSYM SSL3_RANDOM_SIZE} - SSL3_RANDOM_SIZE = 32; - {$EXTERNALSYM SSL3_RS_BLANK} - SSL3_RS_BLANK = 1; - {$EXTERNALSYM SSL3_RS_ENCODED} - SSL3_RS_ENCODED = 2; - {$EXTERNALSYM SSL3_RS_PART_READ} - SSL3_RS_PART_READ = 4; - {$EXTERNALSYM SSL3_RS_PART_WRITE} - SSL3_RS_PART_WRITE = 5; - {$EXTERNALSYM SSL3_RS_PLAIN} - SSL3_RS_PLAIN = 3; - {$EXTERNALSYM SSL3_RS_READ_MORE} - SSL3_RS_READ_MORE = 3; - {$EXTERNALSYM SSL3_RT_ALERT} - SSL3_RT_ALERT = 21; - {$EXTERNALSYM SSL3_RT_APPLICATION_DATA} - SSL3_RT_APPLICATION_DATA = 23; - {$EXTERNALSYM TLS1_RT_HEARTBEAT} - TLS1_RT_HEARTBEAT = 24; - {$EXTERNALSYM SSL3_RT_CHANGE_CIPHER_SPEC} - SSL3_RT_CHANGE_CIPHER_SPEC = 20; - {$EXTERNALSYM SSL3_RT_HANDSHAKE} - SSL3_RT_HANDSHAKE = 22; - {$EXTERNALSYM SSL3_RT_HEADER_LENGTH} - SSL3_RT_HEADER_LENGTH = 5; - {$EXTERNALSYM SSL3_RT_MAX_MD_SIZE} - SSL3_RT_MAX_MD_SIZE = 64; - {$EXTERNALSYM SSL_RT_MAX_CIPHER_BLOCK_SIZE} - SSL_RT_MAX_CIPHER_BLOCK_SIZE = 16; - {$EXTERNALSYM SSL3_RT_MAX_EXTRA} - SSL3_RT_MAX_EXTRA = (16384); - - {$EXTERNALSYM SSL3_RT_MAX_PLAIN_LENGTH} - SSL3_RT_MAX_PLAIN_LENGTH = 16384; - {$EXTERNALSYM SSL3_RT_MAX_COMPRESSED_OVERHEAD} - SSL3_RT_MAX_COMPRESSED_OVERHEAD = 1024; - {$EXTERNALSYM SSL3_RT_MAX_ENCRYPTED_OVERHEAD} - SSL3_RT_MAX_ENCRYPTED_OVERHEAD = (256 + SSL3_RT_MAX_MD_SIZE); - {$EXTERNALSYM SSL3_RT_SEND_MAX_ENCRYPTED_OVERHEAD} - SSL3_RT_SEND_MAX_ENCRYPTED_OVERHEAD = (SSL_RT_MAX_CIPHER_BLOCK_SIZE + SSL3_RT_MAX_MD_SIZE); - {$EXTERNALSYM SSL3_RT_MAX_COMPRESSED_LENGTH} -{$ifdef OPENSSL_NO_COMP} - SSL3_RT_MAX_COMPRESSED_LENGTH = SSL3_RT_MAX_PLAIN_LENGTH; -{$else} - SSL3_RT_MAX_COMPRESSED_LENGTH = - (SSL3_RT_MAX_PLAIN_LENGTH+SSL3_RT_MAX_COMPRESSED_OVERHEAD); -{$endif} - {$EXTERNALSYM SSL3_RT_MAX_ENCRYPTED_LENGTH} - SSL3_RT_MAX_ENCRYPTED_LENGTH = - (SSL3_RT_MAX_ENCRYPTED_OVERHEAD+SSL3_RT_MAX_COMPRESSED_LENGTH); - {$EXTERNALSYM SSL3_RT_MAX_PACKET_SIZE} - SSL3_RT_MAX_PACKET_SIZE = - (SSL3_RT_MAX_ENCRYPTED_LENGTH+SSL3_RT_HEADER_LENGTH); - - {$EXTERNALSYM SSL3_RT_MAX_DATA_SIZE} - SSL3_RT_MAX_DATA_SIZE = 1024*1024; - - {$EXTERNALSYM SSL3_SESSION_ID_SIZE} - SSL3_SESSION_ID_SIZE = 32; - {$EXTERNALSYM SSL3_SSL_SESSION_ID_LENGTH} - SSL3_SSL_SESSION_ID_LENGTH = 32; - {$EXTERNALSYM SSL3_ST_CR_CERT_A} - SSL3_ST_CR_CERT_A = $130 or SSL_ST_CONNECT; - {$EXTERNALSYM SSL3_ST_CR_CERT_B} - SSL3_ST_CR_CERT_B = $131 or SSL_ST_CONNECT; - {$EXTERNALSYM SSL3_ST_CR_CERT_REQ_A} - SSL3_ST_CR_CERT_REQ_A = $150 or SSL_ST_CONNECT; - {$EXTERNALSYM SSL3_ST_CR_CERT_REQ_B} - SSL3_ST_CR_CERT_REQ_B = $151 or SSL_ST_CONNECT; - {$EXTERNALSYM SSL3_ST_CR_CHANGE_A} - SSL3_ST_CR_CHANGE_A = $1C0 or SSL_ST_CONNECT; - {$EXTERNALSYM SSL3_ST_CR_CHANGE_B} - SSL3_ST_CR_CHANGE_B = $1C1 or SSL_ST_CONNECT; - {$EXTERNALSYM SSL3_ST_CR_FINISHED_A} - SSL3_ST_CR_FINISHED_A = $1D0 or SSL_ST_CONNECT; - {$EXTERNALSYM SSL3_ST_CR_FINISHED_B} - SSL3_ST_CR_FINISHED_B = $1D1 or SSL_ST_CONNECT; - {$EXTERNALSYM SSL3_ST_CR_SESSION_TICKET_A} - SSL3_ST_CR_SESSION_TICKET_A = ($1E0 or SSL_ST_CONNECT); - {$EXTERNALSYM SSL3_ST_CR_SESSION_TICKET_B} - SSL3_ST_CR_SESSION_TICKET_B = ($1E1 or SSL_ST_CONNECT); - {$EXTERNALSYM SSL3_ST_CR_CERT_STATUS_A} - SSL3_ST_CR_CERT_STATUS_A = ($1F0 or SSL_ST_CONNECT); - {$EXTERNALSYM SSL3_ST_CR_CERT_STATUS_B} - SSL3_ST_CR_CERT_STATUS_B = ($1F1 or SSL_ST_CONNECT); - {$EXTERNALSYM SSL3_ST_CR_KEY_EXCH_A} - SSL3_ST_CR_KEY_EXCH_A = $140 or SSL_ST_CONNECT; - {$EXTERNALSYM SSL3_ST_CR_KEY_EXCH_B} - SSL3_ST_CR_KEY_EXCH_B = $141 or SSL_ST_CONNECT; - {$EXTERNALSYM SSL3_ST_CR_SRVR_DONE_A} - SSL3_ST_CR_SRVR_DONE_A = $160 or SSL_ST_CONNECT; - {$EXTERNALSYM SSL3_ST_CR_SRVR_DONE_B} - SSL3_ST_CR_SRVR_DONE_B = $161 or SSL_ST_CONNECT; - {$EXTERNALSYM SSL3_ST_CR_SRVR_HELLO_A} - SSL3_ST_CR_SRVR_HELLO_A = $120 or SSL_ST_CONNECT; - {$EXTERNALSYM SSL3_ST_CR_SRVR_HELLO_B} - SSL3_ST_CR_SRVR_HELLO_B = $121 or SSL_ST_CONNECT; - {$EXTERNALSYM SSL3_ST_CW_CERT_A} - SSL3_ST_CW_CERT_A = $170 or SSL_ST_CONNECT; - {$EXTERNALSYM SSL3_ST_CW_CERT_B} - SSL3_ST_CW_CERT_B = $171 or SSL_ST_CONNECT; - {$EXTERNALSYM SSL3_ST_CW_CERT_C} - SSL3_ST_CW_CERT_C = $172 or SSL_ST_CONNECT; - {$EXTERNALSYM SSL3_ST_CW_CERT_D} - SSL3_ST_CW_CERT_D = $173 or SSL_ST_CONNECT; - {$EXTERNALSYM SSL3_ST_CW_CERT_VRFY_A} - SSL3_ST_CW_CERT_VRFY_A = $190 or SSL_ST_CONNECT; - {$EXTERNALSYM SSL3_ST_CW_CERT_VRFY_B} - SSL3_ST_CW_CERT_VRFY_B = $191 or SSL_ST_CONNECT; - {$EXTERNALSYM SSL3_ST_CW_CHANGE_A} - SSL3_ST_CW_CHANGE_A = $1A0 or SSL_ST_CONNECT; - {$EXTERNALSYM SSL3_ST_CW_CHANGE_B} - SSL3_ST_CW_CHANGE_B = $1A1 or SSL_ST_CONNECT; - {$EXTERNALSYM SSL3_ST_CW_NEXT_PROTO_A} - SSL3_ST_CW_NEXT_PROTO_A = ($200 or SSL_ST_CONNECT); - {$EXTERNALSYM SSL3_ST_CW_NEXT_PROTO_B} - SSL3_ST_CW_NEXT_PROTO_B = ($201 or SSL_ST_CONNECT); - -{$ifndef OPENSSL_NO_SCTP} - {$EXTERNALSYM DTLS1_SCTP_ST_CW_WRITE_SOCK} - DTLS1_SCTP_ST_CW_WRITE_SOCK = $310 or SSL_ST_CONNECT; - {$EXTERNALSYM DTLS1_SCTP_ST_CR_READ_SOCK} - DTLS1_SCTP_ST_CR_READ_SOCK = $320 or SSL_ST_CONNECT; -{$endif} - {$EXTERNALSYM SSL3_ST_CW_CLNT_HELLO_A} - SSL3_ST_CW_CLNT_HELLO_A = $110 or SSL_ST_CONNECT; - {$EXTERNALSYM SSL3_ST_CW_CLNT_HELLO_B} - SSL3_ST_CW_CLNT_HELLO_B = $111 or SSL_ST_CONNECT; - {$EXTERNALSYM SSL3_ST_CW_FINISHED_A} - SSL3_ST_CW_FINISHED_A = $1B0 or SSL_ST_CONNECT; - {$EXTERNALSYM SSL3_ST_CW_FINISHED_B} - SSL3_ST_CW_FINISHED_B = $1B1 or SSL_ST_CONNECT; - {$EXTERNALSYM SSL3_ST_CW_FLUSH} - SSL3_ST_CW_FLUSH = $100 or SSL_ST_CONNECT; - {$EXTERNALSYM SSL3_ST_CW_KEY_EXCH_A} - SSL3_ST_CW_KEY_EXCH_A = $180 or SSL_ST_CONNECT; - {$EXTERNALSYM SSL3_ST_CW_KEY_EXCH_B} - SSL3_ST_CW_KEY_EXCH_B = $181 or SSL_ST_CONNECT; - {$EXTERNALSYM SSL3_ST_SR_CERT_A} - SSL3_ST_SR_CERT_A = $180 or SSL_ST_ACCEPT; - {$EXTERNALSYM SSL3_ST_SR_CERT_B} - SSL3_ST_SR_CERT_B = $181 or SSL_ST_ACCEPT; - {$EXTERNALSYM SSL3_ST_SR_CERT_VRFY_A} - SSL3_ST_SR_CERT_VRFY_A = $1A0 or SSL_ST_ACCEPT; - {$EXTERNALSYM SSL3_ST_SR_CERT_VRFY_B} - SSL3_ST_SR_CERT_VRFY_B = $1A1 or SSL_ST_ACCEPT; - {$EXTERNALSYM SSL3_ST_SR_CHANGE_A} - SSL3_ST_SR_CHANGE_A = $1B0 or SSL_ST_ACCEPT; - {$EXTERNALSYM SSL3_ST_SR_CHANGE_B} - SSL3_ST_SR_CHANGE_B = $1B1 or SSL_ST_ACCEPT; - {$EXTERNALSYM SSL3_ST_SR_NEXT_PROTO_A} - SSL3_ST_SR_NEXT_PROTO_A = ($210 or SSL_ST_ACCEPT); - {$EXTERNALSYM SSL3_ST_SR_NEXT_PROTO_B} - SSL3_ST_SR_NEXT_PROTO_B = ($211 or SSL_ST_ACCEPT); - {$EXTERNALSYM SSL3_ST_SR_CLNT_HELLO_A} - SSL3_ST_SR_CLNT_HELLO_A = $110 or SSL_ST_ACCEPT; - {$EXTERNALSYM SSL3_ST_SR_CLNT_HELLO_B} - SSL3_ST_SR_CLNT_HELLO_B = $111 or SSL_ST_ACCEPT; - {$EXTERNALSYM SSL3_ST_SR_CLNT_HELLO_C} - SSL3_ST_SR_CLNT_HELLO_C = $112 or SSL_ST_ACCEPT; - {$EXTERNALSYM SSL3_ST_SR_FINISHED_A} - SSL3_ST_SR_FINISHED_A = $1C0 or SSL_ST_ACCEPT; - {$EXTERNALSYM SSL3_ST_SR_FINISHED_B} - SSL3_ST_SR_FINISHED_B = $1C1 or SSL_ST_ACCEPT; - {$EXTERNALSYM SSL3_ST_SR_KEY_EXCH_A} - SSL3_ST_SR_KEY_EXCH_A = $190 or SSL_ST_ACCEPT; - {$EXTERNALSYM SSL3_ST_SR_KEY_EXCH_B} - SSL3_ST_SR_KEY_EXCH_B = $191 or SSL_ST_ACCEPT; - {$EXTERNALSYM SSL3_ST_SW_CERT_A} - SSL3_ST_SW_CERT_A = $140 or SSL_ST_ACCEPT; - {$EXTERNALSYM SSL3_ST_SW_CERT_B} - SSL3_ST_SW_CERT_B = $141 or SSL_ST_ACCEPT; - {$EXTERNALSYM SSL3_ST_SW_CERT_REQ_A} - SSL3_ST_SW_CERT_REQ_A = $160 or SSL_ST_ACCEPT; - {$EXTERNALSYM SSL3_ST_SW_CERT_REQ_B} - SSL3_ST_SW_CERT_REQ_B = $161 or SSL_ST_ACCEPT; - {$EXTERNALSYM SSL3_ST_SW_CHANGE_A} - SSL3_ST_SW_CHANGE_A = $1D0 or SSL_ST_ACCEPT; - {$EXTERNALSYM SSL3_ST_SW_CHANGE_B} - SSL3_ST_SW_CHANGE_B = $1D1 or SSL_ST_ACCEPT; - {$EXTERNALSYM SSL3_ST_SW_FINISHED_A} - SSL3_ST_SW_FINISHED_A = $1E0 or SSL_ST_ACCEPT; - {$EXTERNALSYM SSL3_ST_SW_FINISHED_B} - SSL3_ST_SW_FINISHED_B = $1E1 or SSL_ST_ACCEPT; - {$EXTERNALSYM SSL3_ST_SW_SESSION_TICKET_A} - SSL3_ST_SW_SESSION_TICKET_A = ($1F0 or SSL_ST_ACCEPT); - {$EXTERNALSYM SSL3_ST_SW_SESSION_TICKET_B} - SSL3_ST_SW_SESSION_TICKET_B = ($1F1 or SSL_ST_ACCEPT); - {$EXTERNALSYM SSL3_ST_SW_CERT_STATUS_A} - SSL3_ST_SW_CERT_STATUS_A = ($200 or SSL_ST_ACCEPT); - {$EXTERNALSYM SSL3_ST_SW_CERT_STATUS_B} - SSL3_ST_SW_CERT_STATUS_B = ($201 or SSL_ST_ACCEPT); - {$EXTERNALSYM SSL3_ST_SW_FLUSH} - SSL3_ST_SW_FLUSH = $100 or SSL_ST_ACCEPT; -{$ifndef OPENSSL_NO_SCTP} - {$EXTERNALSYM DTLS1_SCTP_ST_SW_WRITE_SOCK} - DTLS1_SCTP_ST_SW_WRITE_SOCK = ($310 or SSL_ST_ACCEPT); - {$EXTERNALSYM DTLS1_SCTP_ST_SR_READ_SOCK} - DTLS1_SCTP_ST_SR_READ_SOCK = ($320 or SSL_ST_ACCEPT); -{$endif} - {$EXTERNALSYM SSL3_ST_SW_HELLO_REQ_A} - SSL3_ST_SW_HELLO_REQ_A = $120 or SSL_ST_ACCEPT; - {$EXTERNALSYM SSL3_ST_SW_HELLO_REQ_B} - SSL3_ST_SW_HELLO_REQ_B = $121 or SSL_ST_ACCEPT; - {$EXTERNALSYM SSL3_ST_SW_HELLO_REQ_C} - SSL3_ST_SW_HELLO_REQ_C = $122 or SSL_ST_ACCEPT; - {$EXTERNALSYM SSL3_ST_SW_KEY_EXCH_A} - SSL3_ST_SW_KEY_EXCH_A = $150 or SSL_ST_ACCEPT; - {$EXTERNALSYM SSL3_ST_SW_KEY_EXCH_B} - SSL3_ST_SW_KEY_EXCH_B = $151 or SSL_ST_ACCEPT; - {$EXTERNALSYM SSL3_ST_SW_SRVR_DONE_A} - SSL3_ST_SW_SRVR_DONE_A = $170 or SSL_ST_ACCEPT; - {$EXTERNALSYM SSL3_ST_SW_SRVR_DONE_B} - SSL3_ST_SW_SRVR_DONE_B = $171 or SSL_ST_ACCEPT; - {$EXTERNALSYM SSL3_ST_SW_SRVR_HELLO_A} - SSL3_ST_SW_SRVR_HELLO_A = $130 or SSL_ST_ACCEPT; - {$EXTERNALSYM SSL3_ST_SW_SRVR_HELLO_B} - SSL3_ST_SW_SRVR_HELLO_B = $131 or SSL_ST_ACCEPT; - {$EXTERNALSYM SSL3_TXT_ADH_DES_192_CBC_SHA} - SSL3_TXT_ADH_DES_192_CBC_SHA = 'ADH-DES-CBC3-SHA'; {Do not localize} - {$EXTERNALSYM SSL3_TXT_ADH_DES_40_CBC_SHA} - SSL3_TXT_ADH_DES_40_CBC_SHA = 'EXP-ADH-DES-CBC-SHA'; {Do not localize} - {$EXTERNALSYM SSL3_TXT_ADH_DES_64_CBC_SHA} - SSL3_TXT_ADH_DES_64_CBC_SHA = 'ADH-DES-CBC-SHA'; {Do not localize} - {$EXTERNALSYM SSL3_TXT_ADH_RC4_128_MD5} - SSL3_TXT_ADH_RC4_128_MD5 = 'ADH-RC4-MD5'; {Do not localize} - {$EXTERNALSYM SSL3_TXT_ADH_RC4_40_MD5} - SSL3_TXT_ADH_RC4_40_MD5 = 'EXP-ADH-RC4-MD5'; {Do not localize} - {$EXTERNALSYM SSL3_TXT_DH_DSS_DES_192_CBC3_SHA} - SSL3_TXT_DH_DSS_DES_192_CBC3_SHA = 'DH-DSS-DES-CBC3-SHA'; {Do not localize} - {$EXTERNALSYM SSL3_TXT_DH_DSS_DES_40_CBC_SHA} - SSL3_TXT_DH_DSS_DES_40_CBC_SHA = 'EXP-DH-DSS-DES-CBC-SHA'; {Do not localize} - {$EXTERNALSYM SSL3_TXT_DH_DSS_DES_64_CBC_SHA} - SSL3_TXT_DH_DSS_DES_64_CBC_SHA = 'DH-DSS-DES-CBC-SHA'; {Do not localize} - {$EXTERNALSYM SSL3_TXT_DH_RSA_DES_192_CBC3_SHA} - SSL3_TXT_DH_RSA_DES_192_CBC3_SHA = 'DH-RSA-DES-CBC3-SHA'; {Do not localize} - {$EXTERNALSYM SSL3_TXT_DH_RSA_DES_40_CBC_SHA} - SSL3_TXT_DH_RSA_DES_40_CBC_SHA = 'EXP-DH-RSA-DES-CBC-SHA'; {Do not localize} - {$EXTERNALSYM SSL3_TXT_DH_RSA_DES_64_CBC_SHA} - SSL3_TXT_DH_RSA_DES_64_CBC_SHA = 'DH-RSA-DES-CBC-SHA'; {Do not localize} - {$EXTERNALSYM SSL3_TXT_EDH_DSS_DES_192_CBC3_SHA} - SSL3_TXT_EDH_DSS_DES_192_CBC3_SHA = 'EDH-DSS-DES-CBC3-SHA'; {Do not localize} - {$EXTERNALSYM SSL3_TXT_EDH_DSS_DES_40_CBC_SHA} - SSL3_TXT_EDH_DSS_DES_40_CBC_SHA = 'EXP-EDH-DSS-DES-CBC-SHA'; {Do not localize} - {$EXTERNALSYM SSL3_TXT_EDH_DSS_DES_64_CBC_SHA} - SSL3_TXT_EDH_DSS_DES_64_CBC_SHA = 'EDH-DSS-DES-CBC-SHA'; {Do not localize} - {$EXTERNALSYM SSL3_TXT_EDH_RSA_DES_192_CBC3_SHA} - SSL3_TXT_EDH_RSA_DES_192_CBC3_SHA = 'EDH-RSA-DES-CBC3-SHA'; {Do not localize} - {$EXTERNALSYM SSL3_TXT_EDH_RSA_DES_40_CBC_SHA} - SSL3_TXT_EDH_RSA_DES_40_CBC_SHA = 'EXP-EDH-RSA-DES-CBC-SHA'; {Do not localize} - {$EXTERNALSYM SSL3_TXT_EDH_RSA_DES_64_CBC_SHA} - SSL3_TXT_EDH_RSA_DES_64_CBC_SHA = 'EDH-RSA-DES-CBC-SHA'; {Do not localize} - {$EXTERNALSYM SSL3_TXT_FZA_DMS_FZA_SHA} - SSL3_TXT_FZA_DMS_FZA_SHA = 'FZA-FZA-CBC-SHA'; {Do not localize} - {$EXTERNALSYM SSL3_TXT_FZA_DMS_NULL_SHA} - SSL3_TXT_FZA_DMS_NULL_SHA = 'FZA-NULL-SHA'; {Do not localize} - {$EXTERNALSYM SSL3_TXT_FZA_DMS_RC4_SHA} - SSL3_TXT_FZA_DMS_RC4_SHA = 'FZA-RC4-SHA'; {Do not localize} - {$EXTERNALSYM SSL3_TXT_RSA_DES_192_CBC3_SHA} - SSL3_TXT_RSA_DES_192_CBC3_SHA = 'DES-CBC3-SHA'; {Do not localize} - {$EXTERNALSYM SSL3_TXT_RSA_DES_40_CBC_SHA} - SSL3_TXT_RSA_DES_40_CBC_SHA = 'EXP-DES-CBC-SHA'; {Do not localize} - {$EXTERNALSYM SSL3_TXT_RSA_DES_64_CBC_SHA} - SSL3_TXT_RSA_DES_64_CBC_SHA = 'DES-CBC-SHA'; {Do not localize} - {$EXTERNALSYM SSL3_TXT_RSA_IDEA_128_SHA} - SSL3_TXT_RSA_IDEA_128_SHA = 'IDEA-CBC-SHA'; {Do not localize} - {$EXTERNALSYM SSL3_TXT_RSA_NULL_MD5} - SSL3_TXT_RSA_NULL_MD5 = 'NULL-MD5'; {Do not localize} - {$EXTERNALSYM SSL3_TXT_RSA_NULL_SHA} - SSL3_TXT_RSA_NULL_SHA = 'NULL-SHA'; {Do not localize} - {$EXTERNALSYM SSL3_TXT_RSA_RC2_40_MD5} - SSL3_TXT_RSA_RC2_40_MD5 = 'EXP-RC2-CBC-MD5'; {Do not localize} - {$EXTERNALSYM SSL3_TXT_RSA_RC4_128_MD5} - SSL3_TXT_RSA_RC4_128_MD5 = 'RC4-MD5'; {Do not localize} - {$EXTERNALSYM SSL3_TXT_RSA_RC4_128_SHA} - SSL3_TXT_RSA_RC4_128_SHA = 'RC4-SHA'; {Do not localize} - {$EXTERNALSYM SSL3_TXT_RSA_RC4_40_MD5} - SSL3_TXT_RSA_RC4_40_MD5 = 'EXP-RC4-MD5'; {Do not localize} - {$EXTERNALSYM SSL3_VERSION} - SSL3_VERSION = $0300; - {$EXTERNALSYM SSL3_VERSION_MAJOR} - SSL3_VERSION_MAJOR = $03; - {$EXTERNALSYM SSL3_VERSION_MINOR} - SSL3_VERSION_MINOR = $00; - {$EXTERNALSYM SSLEAY_VERSION} - SSLEAY_VERSION = 0; -//* #define SSLEAY_OPTIONS 1 no longer supported */ - {$EXTERNALSYM SSLEAY_CFLAGS} - SSLEAY_CFLAGS = 2; - {$EXTERNALSYM SSLEAY_BUILT_ON} - SSLEAY_BUILT_ON = 3; - {$EXTERNALSYM SSLEAY_PLATFORM} - SSLEAY_PLATFORM = 4; - {$EXTERNALSYM SSLEAY_DIR} - SSLEAY_DIR = 5; - //tls1.h - {$EXTERNALSYM TLS1_AD_DECRYPTION_FAILED} - TLS1_AD_DECRYPTION_FAILED = 21; - {$EXTERNALSYM TLS1_AD_RECORD_OVERFLOW} - TLS1_AD_RECORD_OVERFLOW = 22; - {$EXTERNALSYM TLS1_AD_UNKNOWN_CA} - TLS1_AD_UNKNOWN_CA = 48; - {$EXTERNALSYM TLS1_AD_ACCESS_DENIED} - TLS1_AD_ACCESS_DENIED = 49; - {$EXTERNALSYM TLS1_AD_DECODE_ERROR} - TLS1_AD_DECODE_ERROR = 50; - {$EXTERNALSYM TLS1_AD_DECRYPT_ERROR} - TLS1_AD_DECRYPT_ERROR = 51; - {$EXTERNALSYM TLS1_AD_EXPORT_RESTRICTION} - TLS1_AD_EXPORT_RESTRICTION = 60; - {$EXTERNALSYM TLS1_AD_PROTOCOL_VERSION} - TLS1_AD_PROTOCOL_VERSION = 70; - {$EXTERNALSYM TLS1_AD_INSUFFICIENT_SECURITY} - TLS1_AD_INSUFFICIENT_SECURITY = 71; - {$EXTERNALSYM TLS1_AD_INTERNAL_ERROR} - TLS1_AD_INTERNAL_ERROR = 80; - {$EXTERNALSYM TLS1_AD_USER_CANCELLED} - TLS1_AD_USER_CANCELLED = 90; - {$EXTERNALSYM TLS1_AD_NO_RENEGOTIATION} - TLS1_AD_NO_RENEGOTIATION = 100; - //* codes 110-114 are from RFC3546 */ - {$EXTERNALSYM TLS1_AD_UNSUPPORTED_EXTENSION} - TLS1_AD_UNSUPPORTED_EXTENSION = 110; - {$EXTERNALSYM TLS1_AD_CERTIFICATE_UNOBTAINABLE} - TLS1_AD_CERTIFICATE_UNOBTAINABLE = 111; - {$EXTERNALSYM TLS1_AD_UNRECOGNIZED_NAME} - TLS1_AD_UNRECOGNIZED_NAME = 112; - {$EXTERNALSYM TLS1_AD_BAD_CERTIFICATE_STATUS_RESPONSE} - TLS1_AD_BAD_CERTIFICATE_STATUS_RESPONSE = 113; - {$EXTERNALSYM TLS1_AD_BAD_CERTIFICATE_HASH_VALUE} - TLS1_AD_BAD_CERTIFICATE_HASH_VALUE = 114; - {$EXTERNALSYM TLS1_AD_UNKNOWN_PSK_IDENTITY} - TLS1_AD_UNKNOWN_PSK_IDENTITY = 115;//* fatal */ -//* ExtensionType values from RFC 3546 */ - {$EXTERNALSYM TLSEXT_TYPE_server_name} - TLSEXT_TYPE_server_name = 0; - {$EXTERNALSYM TLSEXT_TYPE_max_fragment_length} - TLSEXT_TYPE_max_fragment_length = 1; - {$EXTERNALSYM TLSEXT_TYPE_client_certificate_url} - TLSEXT_TYPE_client_certificate_url = 2; - {$EXTERNALSYM TLSEXT_TYPE_trusted_ca_keys} - TLSEXT_TYPE_trusted_ca_keys = 3; - {$EXTERNALSYM TLSEXT_TYPE_truncated_hmac} - TLSEXT_TYPE_truncated_hmac = 4; - {$EXTERNALSYM TLSEXT_TYPE_status_request} - TLSEXT_TYPE_status_request =5; - {$EXTERNALSYM TLSEXT_TYPE_user_mapping} - TLSEXT_TYPE_user_mapping = 6; - {$EXTERNALSYM TLSEXT_TYPE_client_authz} - TLSEXT_TYPE_client_authz = 7; - {$EXTERNALSYM TLSEXT_TYPE_server_authz} - TLSEXT_TYPE_server_authz = 8; - {$EXTERNALSYM TLSEXT_TYPE_cert_type} - TLSEXT_TYPE_cert_type = 9; - {$EXTERNALSYM TLSEXT_TYPE_elliptic_curves} - TLSEXT_TYPE_elliptic_curves = 10; - {$EXTERNALSYM TLSEXT_TYPE_ec_point_formats} - TLSEXT_TYPE_ec_point_formats = 11; - {$EXTERNALSYM TLSEXT_TYPE_srp} - TLSEXT_TYPE_srp = 12; - {$EXTERNALSYM TLSEXT_TYPE_signature_algorithms} - TLSEXT_TYPE_signature_algorithms = 13; - {$EXTERNALSYM TLSEXT_TYPE_use_srtp} - TLSEXT_TYPE_use_srtp = 14; - {$EXTERNALSYM TLSEXT_TYPE_heartbeat} - TLSEXT_TYPE_heartbeat = 15; - {$EXTERNALSYM TLSEXT_TYPE_session_ticket} - TLSEXT_TYPE_session_ticket = 35; - {$IFNDEF OPENSSL_NO_NEXTPROTONEG} -//* This is not an IANA defined extension number */ - {$EXTERNALSYM TLSEXT_TYPE_next_proto_neg} - TLSEXT_TYPE_next_proto_neg = 13172; - {$ENDIF} - //* Temporary extension type */ - {$EXTERNALSYM TLSEXT_TYPE_renegotiate} - TLSEXT_TYPE_renegotiate = $ff01; - - //* NameType value from RFC 3546 */ - {$EXTERNALSYM TLSEXT_NAMETYPE_host_name} - TLSEXT_NAMETYPE_host_name = 0; -//* status request value from RFC 3546 */ - {$EXTERNALSYM TLSEXT_STATUSTYPE_ocsp} - TLSEXT_STATUSTYPE_ocsp = 1; - {$EXTERNALSYM TLSEXT_ECPOINTFORMAT_first} - TLSEXT_ECPOINTFORMAT_first = 0; - {$EXTERNALSYM TLSEXT_ECPOINTFORMAT_uncompressed} - TLSEXT_ECPOINTFORMAT_uncompressed = 0; - {$EXTERNALSYM TLSEXT_ECPOINTFORMAT_ansiX962_compressed_prime} - TLSEXT_ECPOINTFORMAT_ansiX962_compressed_prime = 1; - {$EXTERNALSYM TLSEXT_ECPOINTFORMAT_ansiX962_compressed_char2} - TLSEXT_ECPOINTFORMAT_ansiX962_compressed_char2 = 2; - {$EXTERNALSYM TLSEXT_ECPOINTFORMAT_last} - TLSEXT_ECPOINTFORMAT_last = 2; - {$EXTERNALSYM TLSEXT_signature_anonymous} - TLSEXT_signature_anonymous = 0; - {$EXTERNALSYM TLSEXT_signature_rsa} - TLSEXT_signature_rsa = 1; - {$EXTERNALSYM TLSEXT_signature_dsa} - TLSEXT_signature_dsa = 2; - {$EXTERNALSYM TLSEXT_signature_ecdsa} - TLSEXT_signature_ecdsa = 3; - {$EXTERNALSYM TLSEXT_hash_none} - TLSEXT_hash_none = 0; - {$EXTERNALSYM TLSEXT_hash_md5} - TLSEXT_hash_md5 = 1; - {$EXTERNALSYM TLSEXT_hash_sha1} - TLSEXT_hash_sha1 = 2; - {$EXTERNALSYM TLSEXT_hash_sha224} - TLSEXT_hash_sha224 = 3; - {$EXTERNALSYM TLSEXT_hash_sha256} - TLSEXT_hash_sha256 = 4; - {$EXTERNALSYM TLSEXT_hash_sha384} - TLSEXT_hash_sha384 = 5; - {$EXTERNALSYM TLSEXT_hash_sha512} - TLSEXT_hash_sha512 = 6; - -{$IFNDEF OPENSSL_NO_TLSEXT} - {$EXTERNALSYM TLSEXT_MAXLEN_host_name} - TLSEXT_MAXLEN_host_name = 255; - {$EXTERNALSYM SSL_TLSEXT_ERR_OK} - SSL_TLSEXT_ERR_OK = 0; - {$EXTERNALSYM SSL_TLSEXT_ERR_ALERT_WARNING} - SSL_TLSEXT_ERR_ALERT_WARNING = 1; - {$EXTERNALSYM SSL_TLSEXT_ERR_ALERT_FATAL} - SSL_TLSEXT_ERR_ALERT_FATAL = 2; - {$EXTERNALSYM SSL_TLSEXT_ERR_NOACK} - SSL_TLSEXT_ERR_NOACK = 3; - {$IFDEF OPENSSL_NO_HEARTBEATS} - {$EXTERNALSYM SSL_TLSEXT_HB_DONT_SEND_REQUESTS} - SSL_TLSEXT_HB_ENABLED = $01; - {$EXTERNALSYM SSL_TLSEXT_HB_DONT_SEND_REQUESTS} - SSL_TLSEXT_HB_DONT_SEND_REQUESTS = $02; - {$EXTERNALSYM SSL_TLSEXT_HB_DONT_RECV_REQUESTS} - SSL_TLSEXT_HB_DONT_RECV_REQUESTS = $04; - {$ENDIF} -{$ENDIF} - // - {$EXTERNALSYM SSLEAY_VERSION_NUMBER} - SSLEAY_VERSION_NUMBER = OPENSSL_VERSION_NUMBER; - {$EXTERNALSYM SSL_AD_REASON_OFFSET} - SSL_AD_REASON_OFFSET = 1000; - {$EXTERNALSYM SSL_AD_CLOSE_NOTIFY} - SSL_AD_CLOSE_NOTIFY = SSL3_AD_CLOSE_NOTIFY; - {$EXTERNALSYM SSL_AD_UNEXPECTED_MESSAGE} - SSL_AD_UNEXPECTED_MESSAGE = SSL3_AD_UNEXPECTED_MESSAGE; - {$EXTERNALSYM SSL_AD_BAD_RECORD_MAC} - SSL_AD_BAD_RECORD_MAC = SSL3_AD_BAD_RECORD_MAC; - {$EXTERNALSYM SSL_AD_DECRYPTION_FAILED} - SSL_AD_DECRYPTION_FAILED = TLS1_AD_DECRYPTION_FAILED; - {$EXTERNALSYM SSL_AD_RECORD_OVERFLOW} - SSL_AD_RECORD_OVERFLOW = TLS1_AD_RECORD_OVERFLOW; - {$EXTERNALSYM SSL_AD_DECOMPRESSION_FAILURE} - SSL_AD_DECOMPRESSION_FAILURE = SSL3_AD_DECOMPRESSION_FAILURE; - {$EXTERNALSYM SSL_AD_HANDSHAKE_FAILURE} - SSL_AD_HANDSHAKE_FAILURE = SSL3_AD_HANDSHAKE_FAILURE; - {$EXTERNALSYM SSL_AD_NO_CERTIFICATE} - SSL_AD_NO_CERTIFICATE = SSL3_AD_NO_CERTIFICATE; - {$EXTERNALSYM SSL_AD_BAD_CERTIFICATE} - SSL_AD_BAD_CERTIFICATE = SSL3_AD_BAD_CERTIFICATE; - {$EXTERNALSYM SSL_AD_UNSUPPORTED_CERTIFICATE} - SSL_AD_UNSUPPORTED_CERTIFICATE = SSL3_AD_UNSUPPORTED_CERTIFICATE; - {$EXTERNALSYM SSL_AD_CERTIFICATE_REVOKED} - SSL_AD_CERTIFICATE_REVOKED = SSL3_AD_CERTIFICATE_REVOKED; - {$EXTERNALSYM SSL_AD_CERTIFICATE_EXPIRED} - SSL_AD_CERTIFICATE_EXPIRED = SSL3_AD_CERTIFICATE_EXPIRED; - {$EXTERNALSYM SSL_AD_CERTIFICATE_UNKNOWN} - SSL_AD_CERTIFICATE_UNKNOWN = SSL3_AD_CERTIFICATE_UNKNOWN; - {$EXTERNALSYM SSL_AD_ILLEGAL_PARAMETER} - SSL_AD_ILLEGAL_PARAMETER = SSL3_AD_ILLEGAL_PARAMETER; - - {$EXTERNALSYM SSL_AD_UNKNOWN_CA} - SSL_AD_UNKNOWN_CA = TLS1_AD_UNKNOWN_CA; - {$EXTERNALSYM SSL_AD_ACCESS_DENIED} - SSL_AD_ACCESS_DENIED = TLS1_AD_ACCESS_DENIED; - {$EXTERNALSYM SSL_AD_DECODE_ERROR} - SSL_AD_DECODE_ERROR = TLS1_AD_DECODE_ERROR; - {$EXTERNALSYM SSL_AD_DECRYPT_ERROR} - SSL_AD_DECRYPT_ERROR = TLS1_AD_DECRYPT_ERROR; - {$EXTERNALSYM SSL_AD_EXPORT_RESTRICTION} - SSL_AD_EXPORT_RESTRICTION = TLS1_AD_EXPORT_RESTRICTION; - {$EXTERNALSYM SSL_AD_PROTOCOL_VERSION} - SSL_AD_PROTOCOL_VERSION = TLS1_AD_PROTOCOL_VERSION; - {$EXTERNALSYM SSL_AD_INSUFFICIENT_SECURITY} - SSL_AD_INSUFFICIENT_SECURITY = TLS1_AD_INSUFFICIENT_SECURITY; - {$EXTERNALSYM SSL_AD_INTERNAL_ERROR} - SSL_AD_INTERNAL_ERROR = TLS1_AD_INTERNAL_ERROR; - {$EXTERNALSYM SSL_AD_USER_CANCELLED} - SSL_AD_USER_CANCELLED = TLS1_AD_USER_CANCELLED; - {$EXTERNALSYM SSL_AD_NO_RENEGOTIATION} - SSL_AD_NO_RENEGOTIATION = TLS1_AD_NO_RENEGOTIATION; - {$EXTERNALSYM SSL_AD_UNSUPPORTED_EXTENSION} - SSL_AD_UNSUPPORTED_EXTENSION = TLS1_AD_UNSUPPORTED_EXTENSION; - {$EXTERNALSYM SSL_AD_CERTIFICATE_UNOBTAINABLE} - SSL_AD_CERTIFICATE_UNOBTAINABLE = TLS1_AD_CERTIFICATE_UNOBTAINABLE; - {$EXTERNALSYM SSL_AD_UNRECOGNIZED_NAME} - SSL_AD_UNRECOGNIZED_NAME = TLS1_AD_UNRECOGNIZED_NAME; - {$EXTERNALSYM SSL_AD_BAD_CERTIFICATE_STATUS_RESPONSE} - SSL_AD_BAD_CERTIFICATE_STATUS_RESPONSE = TLS1_AD_BAD_CERTIFICATE_STATUS_RESPONSE; - {$EXTERNALSYM SSL_AD_BAD_CERTIFICATE_HASH_VALUE} - SSL_AD_BAD_CERTIFICATE_HASH_VALUE = TLS1_AD_BAD_CERTIFICATE_HASH_VALUE; - {$EXTERNALSYM SSL_AD_UNKNOWN_PSK_IDENTITY} - SSL_AD_UNKNOWN_PSK_IDENTITY = TLS1_AD_UNKNOWN_PSK_IDENTITY; //* fatal */ - - - - - {$EXTERNALSYM SSL_CTRL_NEED_TMP_RSA} - SSL_CTRL_NEED_TMP_RSA = 1; - {$EXTERNALSYM SSL_CTRL_SET_TMP_RSA} - SSL_CTRL_SET_TMP_RSA = 2; - {$EXTERNALSYM SSL_CTRL_SET_TMP_DH} - SSL_CTRL_SET_TMP_DH = 3; - {$EXTERNALSYM SSL_CTRL_SET_TMP_ECDH} - SSL_CTRL_SET_TMP_ECDH = 4; - {$EXTERNALSYM SSL_CTRL_SET_TMP_RSA_CB} - SSL_CTRL_SET_TMP_RSA_CB = 5; - {$EXTERNALSYM SSL_CTRL_SET_TMP_DH_CB} - SSL_CTRL_SET_TMP_DH_CB = 6; - {$EXTERNALSYM SSL_CTRL_SET_TMP_ECDH_CB} - SSL_CTRL_SET_TMP_ECDH_CB = 7; - {$IFNDEF NO_TLSEXT} - //* see tls1.h for macros based on these */ - {$EXTERNALSYM SSL_CTRL_SET_TLSEXT_SERVERNAME_CB} - SSL_CTRL_SET_TLSEXT_SERVERNAME_CB = 53; - {$EXTERNALSYM SSL_CTRL_SET_TLSEXT_SERVERNAME_ARG} - SSL_CTRL_SET_TLSEXT_SERVERNAME_ARG = 54; - {$EXTERNALSYM SSL_CTRL_SET_TLSEXT_HOSTNAME} - SSL_CTRL_SET_TLSEXT_HOSTNAME = 55; - {$EXTERNALSYM SSL_CTRL_SET_TLSEXT_DEBUG_CB} - SSL_CTRL_SET_TLSEXT_DEBUG_CB = 56; - {$EXTERNALSYM SSL_CTRL_SET_TLSEXT_DEBUG_ARG} - SSL_CTRL_SET_TLSEXT_DEBUG_ARG = 57; - {$EXTERNALSYM SSL_CTRL_GET_TLSEXT_TICKET_KEYS} - SSL_CTRL_GET_TLSEXT_TICKET_KEYS = 58; - {$EXTERNALSYM SSL_CTRL_SET_TLSEXT_TICKET_KEYS} - SSL_CTRL_SET_TLSEXT_TICKET_KEYS = 59; - {$EXTERNALSYM SSL_CTRL_SET_TLSEXT_OPAQUE_PRF_INPUT} - SSL_CTRL_SET_TLSEXT_OPAQUE_PRF_INPUT = 60; - {$EXTERNALSYM SSL_CTRL_SET_TLSEXT_OPAQUE_PRF_INPUT_CB} - SSL_CTRL_SET_TLSEXT_OPAQUE_PRF_INPUT_CB = 61; - {$EXTERNALSYM SSL_CTRL_SET_TLSEXT_OPAQUE_PRF_INPUT_CB_ARG} - SSL_CTRL_SET_TLSEXT_OPAQUE_PRF_INPUT_CB_ARG = 62; - {$EXTERNALSYM SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB} - SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB = 63; - {$EXTERNALSYM SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB_ARG} - SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB_ARG = 64; - {$EXTERNALSYM SSL_CTRL_SET_TLSEXT_STATUS_REQ_TYPE} - SSL_CTRL_SET_TLSEXT_STATUS_REQ_TYPE = 65; - {$EXTERNALSYM SSL_CTRL_GET_TLSEXT_STATUS_REQ_EXTS} - SSL_CTRL_GET_TLSEXT_STATUS_REQ_EXTS = 66; - {$EXTERNALSYM SSL_CTRL_SET_TLSEXT_STATUS_REQ_EXTS} - SSL_CTRL_SET_TLSEXT_STATUS_REQ_EXTS = 67; - {$EXTERNALSYM SSL_CTRL_GET_TLSEXT_STATUS_REQ_IDS} - SSL_CTRL_GET_TLSEXT_STATUS_REQ_IDS = 68; - {$EXTERNALSYM SSL_CTRL_SET_TLSEXT_STATUS_REQ_IDS} - SSL_CTRL_SET_TLSEXT_STATUS_REQ_IDS = 69; - {$EXTERNALSYM SSL_CTRL_GET_TLSEXT_STATUS_REQ_OCSP_RESP} - SSL_CTRL_GET_TLSEXT_STATUS_REQ_OCSP_RESP = 70; - {$EXTERNALSYM SSL_CTRL_SET_TLSEXT_STATUS_REQ_OCSP_RESP} - SSL_CTRL_SET_TLSEXT_STATUS_REQ_OCSP_RESP = 71; - {$EXTERNALSYM SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB} - SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB = 72; - {$EXTERNALSYM SSL_CTRL_SET_TLS_EXT_SRP_USERNAME_CB} - SSL_CTRL_SET_TLS_EXT_SRP_USERNAME_CB = 75; - {$EXTERNALSYM SSL_CTRL_SET_SRP_VERIFY_PARAM_CB} - SSL_CTRL_SET_SRP_VERIFY_PARAM_CB = 76; - {$EXTERNALSYM SSL_CTRL_SET_SRP_GIVE_CLIENT_PWD_CB} - SSL_CTRL_SET_SRP_GIVE_CLIENT_PWD_CB = 77; - {$EXTERNALSYM SSL_CTRL_SET_SRP_ARG} - SSL_CTRL_SET_SRP_ARG = 78; - {$EXTERNALSYM SSL_CTRL_SET_TLS_EXT_SRP_USERNAME} - SSL_CTRL_SET_TLS_EXT_SRP_USERNAME = 79; - {$EXTERNALSYM SSL_CTRL_SET_TLS_EXT_SRP_STRENGTH} - SSL_CTRL_SET_TLS_EXT_SRP_STRENGTH = 80; - {$EXTERNALSYM SSL_CTRL_SET_TLS_EXT_SRP_PASSWORD} - SSL_CTRL_SET_TLS_EXT_SRP_PASSWORD = 81; - {$ifndef OPENSSL_NO_HEARTBEATS} - {$EXTERNALSYM SSL_CTRL_TLS_EXT_SEND_HEARTBEAT} - SSL_CTRL_TLS_EXT_SEND_HEARTBEAT = 85; - {$EXTERNALSYM SSL_CTRL_GET_TLS_EXT_HEARTBEAT_PENDING} - SSL_CTRL_GET_TLS_EXT_HEARTBEAT_PENDING = 86; - {$EXTERNALSYM SSL_CTRL_SET_TLS_EXT_HEARTBEAT_NO_REQUESTS} - SSL_CTRL_SET_TLS_EXT_HEARTBEAT_NO_REQUESTS = 87; - {$endif} - {$ENDIF} - {$EXTERNALSYM SSL_CTRL_SET_ECDH_AUTO} - SSL_CTRL_SET_ECDH_AUTO = 94; - - {$EXTERNALSYM DTLS_CTRL_GET_TIMEOUT} - DTLS_CTRL_GET_TIMEOUT = 73; - {$EXTERNALSYM DTLS_CTRL_HANDLE_TIMEOUT} - DTLS_CTRL_HANDLE_TIMEOUT = 74; - {$EXTERNALSYM DTLS_CTRL_LISTEN} - DTLS_CTRL_LISTEN = 75; - - {$EXTERNALSYM SSL_CTRL_GET_RI_SUPPORT} - SSL_CTRL_GET_RI_SUPPORT = 76; - {$EXTERNALSYM SSL_CTRL_CLEAR_OPTIONS} - SSL_CTRL_CLEAR_OPTIONS = 77; - {$EXTERNALSYM SSL_CTRL_CLEAR_MODE} - SSL_CTRL_CLEAR_MODE = 78; - {$EXTERNALSYM SSL_CTRL_GET_EXTRA_CHAIN_CERTS} - SSL_CTRL_GET_EXTRA_CHAIN_CERTS = 82; - {$EXTERNALSYM SSL_CTRL_CLEAR_EXTRA_CHAIN_CERTS} - SSL_CTRL_CLEAR_EXTRA_CHAIN_CERTS = 83; - {$EXTERNALSYM SSL_CTRL_CHAIN} //OpenSSL 1.0.2 - SSL_CTRL_CHAIN = 88; - {$EXTERNALSYM SSL_CTRL_CHAIN_CERT} //OpenSSL 1.0.2 - SSL_CTRL_CHAIN_CERT = 89; - {$EXTERNALSYM SSL_CTRL_GET_CHAIN_CERTS} //OpenSSL 1.0.2 - SSL_CTRL_GET_CHAIN_CERTS = 115; - {$EXTERNALSYM SSL_CTRL_GET_SESSION_REUSED} - SSL_CTRL_GET_SESSION_REUSED = 8; - {$EXTERNALSYM SSL_CTRL_GET_CLIENT_CERT_REQUEST} - SSL_CTRL_GET_CLIENT_CERT_REQUEST = 9; - {$EXTERNALSYM SSL_CTRL_GET_NUM_RENEGOTIATIONS} - SSL_CTRL_GET_NUM_RENEGOTIATIONS = 10; - {$EXTERNALSYM SSL_CTRL_CLEAR_NUM_RENEGOTIATIONS} - SSL_CTRL_CLEAR_NUM_RENEGOTIATIONS = 11; - {$EXTERNALSYM SSL_CTRL_GET_TOTAL_RENEGOTIATIONS} - SSL_CTRL_GET_TOTAL_RENEGOTIATIONS = 12; - {$EXTERNALSYM SSL_CTRL_GET_FLAGS} - SSL_CTRL_GET_FLAGS = 13; - {$EXTERNALSYM SSL_CTRL_EXTRA_CHAIN_CERT} - SSL_CTRL_EXTRA_CHAIN_CERT = 14; - {$EXTERNALSYM SSL_CTRL_SET_MSG_CALLBACK} - SSL_CTRL_SET_MSG_CALLBACK = 15; - {$EXTERNALSYM SSL_CTRL_SET_MSG_CALLBACK_ARG} - SSL_CTRL_SET_MSG_CALLBACK_ARG = 16; -//* only applies to datagram connections */ - {$EXTERNALSYM SSL_CTRL_SET_MTU} - SSL_CTRL_SET_MTU = 17; -//* Stats */ - {$EXTERNALSYM SSL_CTRL_SESS_NUMBER} - SSL_CTRL_SESS_NUMBER = 20; - {$EXTERNALSYM SSL_CTRL_SESS_CONNECT} - SSL_CTRL_SESS_CONNECT = 21; - {$EXTERNALSYM SSL_CTRL_SESS_CONNECT_GOOD} - SSL_CTRL_SESS_CONNECT_GOOD = 22; - {$EXTERNALSYM SSL_CTRL_SESS_CONNECT_RENEGOTIATE} - SSL_CTRL_SESS_CONNECT_RENEGOTIATE = 23; - {$EXTERNALSYM SSL_CTRL_SESS_ACCEPT} - SSL_CTRL_SESS_ACCEPT = 24; - {$EXTERNALSYM SSL_CTRL_SESS_ACCEPT_GOOD} - SSL_CTRL_SESS_ACCEPT_GOOD = 25; - {$EXTERNALSYM SSL_CTRL_SESS_ACCEPT_RENEGOTIATE} - SSL_CTRL_SESS_ACCEPT_RENEGOTIATE = 26; - {$EXTERNALSYM SSL_CTRL_SESS_HIT} - SSL_CTRL_SESS_HIT = 27; - {$EXTERNALSYM SSL_CTRL_SESS_CB_HIT} - SSL_CTRL_SESS_CB_HIT = 28; - {$EXTERNALSYM SSL_CTRL_SESS_MISSES} - SSL_CTRL_SESS_MISSES = 29; - {$EXTERNALSYM SSL_CTRL_SESS_TIMEOUTS} - SSL_CTRL_SESS_TIMEOUTS = 30; - {$EXTERNALSYM SSL_CTRL_SESS_CACHE_FULL} - SSL_CTRL_SESS_CACHE_FULL = 31; - {$EXTERNALSYM SSL_CTRL_OPTIONS} - SSL_CTRL_OPTIONS = 32; - {$EXTERNALSYM SSL_CTRL_MODE} - SSL_CTRL_MODE = 33; - {$EXTERNALSYM SSL_CTRL_GET_READ_AHEAD} - SSL_CTRL_GET_READ_AHEAD = 40; - {$EXTERNALSYM SSL_CTRL_SET_READ_AHEAD} - SSL_CTRL_SET_READ_AHEAD = 41; - {$EXTERNALSYM SSL_CTRL_SET_SESS_CACHE_SIZE} - SSL_CTRL_SET_SESS_CACHE_SIZE = 42; - {$EXTERNALSYM SSL_CTRL_GET_SESS_CACHE_SIZE} - SSL_CTRL_GET_SESS_CACHE_SIZE = 43; - {$EXTERNALSYM SSL_CTRL_SET_SESS_CACHE_MODE} - SSL_CTRL_SET_SESS_CACHE_MODE = 44; - {$EXTERNALSYM SSL_CTRL_GET_SESS_CACHE_MODE} - SSL_CTRL_GET_SESS_CACHE_MODE = 45; - {$EXTERNALSYM SSL_CTRL_GET_MAX_CERT_LIST} - SSL_CTRL_GET_MAX_CERT_LIST = 50; - {$EXTERNALSYM SSL_CTRL_SET_MAX_CERT_LIST} - SSL_CTRL_SET_MAX_CERT_LIST = 51; - {$EXTERNALSYM SSL_CTRL_SET_MAX_SEND_FRAGMENT} - SSL_CTRL_SET_MAX_SEND_FRAGMENT = 52; - - {$EXTERNALSYM SSL_DEFAULT_CIPHER_LIST} - SSL_DEFAULT_CIPHER_LIST = 'AES:ALL:!aNULL:!eNULL:+RC4:@STRENGTH'; //* low priority for RC4 */ - {$EXTERNALSYM SSL_ERROR_NONE} - SSL_ERROR_NONE = 0; - {$EXTERNALSYM SSL_ERROR_SSL} - SSL_ERROR_SSL = 1; - {$EXTERNALSYM SSL_ERROR_WANT_READ} - SSL_ERROR_WANT_READ = 2; - {$EXTERNALSYM SSL_ERROR_WANT_WRITE} - SSL_ERROR_WANT_WRITE = 3; - {$EXTERNALSYM SSL_ERROR_WANT_X509_LOOKUP} - SSL_ERROR_WANT_X509_LOOKUP = 4; - {$EXTERNALSYM SSL_ERROR_SYSCALL} - SSL_ERROR_SYSCALL = 5; - {$EXTERNALSYM SSL_ERROR_ZERO_RETURN} - SSL_ERROR_ZERO_RETURN = 6; - {$EXTERNALSYM SSL_ERROR_WANT_CONNECT} - SSL_ERROR_WANT_CONNECT = 7; - {$EXTERNALSYM SSL_ERROR_WANT_ACCEPT} - SSL_ERROR_WANT_ACCEPT = 8; - {$EXTERNALSYM X509_FILETYPE_ASN1} - X509_FILETYPE_ASN1 = 2; - {$EXTERNALSYM SSL_FILETYPE_ASN1} - SSL_FILETYPE_ASN1 = X509_FILETYPE_ASN1; - {$EXTERNALSYM X509_FILETYPE_PEM} - X509_FILETYPE_PEM = 1; - {$EXTERNALSYM SSL_FILETYPE_PEM} - SSL_FILETYPE_PEM = X509_FILETYPE_PEM; - {$EXTERNALSYM SSL_F_CLIENT_CERTIFICATE} - SSL_F_CLIENT_CERTIFICATE = 100; - {$EXTERNALSYM SSL_F_CLIENT_HELLO} - SSL_F_CLIENT_HELLO = 101; - {$EXTERNALSYM SSL_F_CLIENT_MASTER_KEY} - SSL_F_CLIENT_MASTER_KEY = 102; - {$EXTERNALSYM SSL_F_D2I_SSL_SESSION} - SSL_F_D2I_SSL_SESSION = 103; - {$EXTERNALSYM SSL_F_DO_SSL3_WRITE} - SSL_F_DO_SSL3_WRITE = 104; - {$EXTERNALSYM SSL_F_DTLS1_ACCEPT} - SSL_F_DTLS1_ACCEPT = 246; - {$EXTERNALSYM SSL_F_DTLS1_ADD_CERT_TO_BUF} - SSL_F_DTLS1_ADD_CERT_TO_BUF = 295; //was 280; - {$EXTERNALSYM SSL_F_DTLS1_BUFFER_RECORD} - SSL_F_DTLS1_BUFFER_RECORD = 247; - {$EXTERNALSYM SSL_F_DTLS1_CHECK_TIMEOUT_NUM} - SSL_F_DTLS1_CHECK_TIMEOUT_NUM = 316; - {$EXTERNALSYM SSL_F_DTLS1_CLIENT_HELLO} - SSL_F_DTLS1_CLIENT_HELLO = 248; - {$EXTERNALSYM SSL_F_DTLS1_CONNECT} - SSL_F_DTLS1_CONNECT = 249; - {$EXTERNALSYM SSL_F_DTLS1_ENC} - SSL_F_DTLS1_ENC = 250; - {$EXTERNALSYM SSL_F_DTLS1_GET_HELLO_VERIFY} - SSL_F_DTLS1_GET_HELLO_VERIFY = 251; - {$EXTERNALSYM SSL_F_DTLS1_GET_MESSAGE} - SSL_F_DTLS1_GET_MESSAGE = 252; - {$EXTERNALSYM SSL_F_DTLS1_GET_MESSAGE_FRAGMENT} - SSL_F_DTLS1_GET_MESSAGE_FRAGMENT = 253; - {$EXTERNALSYM SSL_F_DTLS1_GET_RECORD} - SSL_F_DTLS1_GET_RECORD = 254; - {$EXTERNALSYM SSL_F_DTLS1_HANDLE_TIMEOUT} - SSL_F_DTLS1_HANDLE_TIMEOUT = 297; //was 282 - {$EXTERNALSYM SSL_F_DTLS1_HEARTBEAT} - SSL_F_DTLS1_HEARTBEAT = 305; - {$EXTERNALSYM SSL_F_DTLS1_OUTPUT_CERT_CHAIN} - SSL_F_DTLS1_OUTPUT_CERT_CHAIN = 255; - {$EXTERNALSYM SSL_F_DTLS1_PREPROCESS_FRAGMENT} - SSL_F_DTLS1_PREPROCESS_FRAGMENT = 288; //was 277; - {$EXTERNALSYM SSL_F_DTLS1_PROCESS_OUT_OF_SEQ_MESSAGE} - SSL_F_DTLS1_PROCESS_OUT_OF_SEQ_MESSAGE = 256; - {$EXTERNALSYM SSL_F_DTLS1_PROCESS_RECORD} - SSL_F_DTLS1_PROCESS_RECORD = 257; - {$EXTERNALSYM SSL_F_DTLS1_READ_BYTES} - SSL_F_DTLS1_READ_BYTES = 258; - {$EXTERNALSYM SSL_F_DTLS1_READ_FAILED} - SSL_F_DTLS1_READ_FAILED = 259; - {$EXTERNALSYM SSL_F_DTLS1_SEND_CERTIFICATE_REQUEST} - SSL_F_DTLS1_SEND_CERTIFICATE_REQUEST = 260; - {$EXTERNALSYM SSL_F_DTLS1_SEND_CLIENT_CERTIFICATE} - SSL_F_DTLS1_SEND_CLIENT_CERTIFICATE = 261; - {$EXTERNALSYM SSL_F_DTLS1_SEND_CLIENT_KEY_EXCHANGE} - SSL_F_DTLS1_SEND_CLIENT_KEY_EXCHANGE = 262; - {$EXTERNALSYM SSL_F_DTLS1_SEND_CLIENT_VERIFY} - SSL_F_DTLS1_SEND_CLIENT_VERIFY = 263; - {$EXTERNALSYM SSL_F_DTLS1_SEND_HELLO_VERIFY_REQUEST} - SSL_F_DTLS1_SEND_HELLO_VERIFY_REQUEST = 264; - {$EXTERNALSYM SSL_F_DTLS1_SEND_SERVER_CERTIFICATE} - SSL_F_DTLS1_SEND_SERVER_CERTIFICATE = 265; - {$EXTERNALSYM SSL_F_DTLS1_SEND_SERVER_HELLO} - SSL_F_DTLS1_SEND_SERVER_HELLO = 266; - {$EXTERNALSYM SSL_F_DTLS1_SEND_SERVER_KEY_EXCHANGE} - SSL_F_DTLS1_SEND_SERVER_KEY_EXCHANGE = 267; - {$EXTERNALSYM SSL_F_DTLS1_WRITE_APP_DATA_BYTES} - SSL_F_DTLS1_WRITE_APP_DATA_BYTES = 268; - {$EXTERNALSYM SSL_F_GET_CLIENT_FINISHED} - SSL_F_GET_CLIENT_FINISHED = 105; - {$EXTERNALSYM SSL_F_GET_CLIENT_HELLO} - SSL_F_GET_CLIENT_HELLO = 106; - {$EXTERNALSYM SSL_F_GET_CLIENT_MASTER_KEY} - SSL_F_GET_CLIENT_MASTER_KEY = 107; - {$EXTERNALSYM SSL_F_GET_SERVER_FINISHED} - SSL_F_GET_SERVER_FINISHED = 108; - {$EXTERNALSYM SSL_F_GET_SERVER_HELLO} - SSL_F_GET_SERVER_HELLO = 109; - {$EXTERNALSYM SSL_F_GET_SERVER_VERIFY} - SSL_F_GET_SERVER_VERIFY = 110; - {$EXTERNALSYM SSL_F_I2D_SSL_SESSION} - SSL_F_I2D_SSL_SESSION = 111; - {$EXTERNALSYM SSL_F_READ_N} - SSL_F_READ_N = 112; - {$EXTERNALSYM SSL_F_REQUEST_CERTIFICATE} - SSL_F_REQUEST_CERTIFICATE = 113; - {$EXTERNALSYM SSL_F_SERVER_HELLO} - SSL_F_SERVER_HELLO = 114; - {$EXTERNALSYM SSL_F_SSL23_ACCEPT} - SSL_F_SSL23_ACCEPT = 115; - {$EXTERNALSYM SSL_F_SSL3_ADD_CERT_TO_BUF} - SSL_F_SSL3_ADD_CERT_TO_BUF = 296; //was 281; - - {$EXTERNALSYM SSL_F_SSL23_CLIENT_HELLO} - SSL_F_SSL23_CLIENT_HELLO = 116; - {$EXTERNALSYM SSL_F_SSL23_CONNECT} - SSL_F_SSL23_CONNECT = 117; - {$EXTERNALSYM SSL_F_SSL23_GET_CLIENT_HELLO} - SSL_F_SSL23_GET_CLIENT_HELLO = 118; - {$EXTERNALSYM SSL_F_SSL23_GET_SERVER_HELLO} - SSL_F_SSL23_GET_SERVER_HELLO = 119; - {$EXTERNALSYM SSL_F_SSL23_READ} - SSL_F_SSL23_READ = 120; - {$EXTERNALSYM SSL_F_SSL23_WRITE} - SSL_F_SSL23_WRITE = 121; - {$EXTERNALSYM SSL_F_SSL2_ACCEPT} - SSL_F_SSL2_ACCEPT = 122; - {$EXTERNALSYM SSL_F_SSL2_CONNECT} - SSL_F_SSL2_CONNECT = 123; - {$EXTERNALSYM SSL_F_SSL2_ENC_INIT} - SSL_F_SSL2_ENC_INIT = 124; - {$EXTERNALSYM SSL_F_SSL2_READ} - SSL_F_SSL2_READ = 125; - {$EXTERNALSYM SSL_F_SSL2_SET_CERTIFICATE} - SSL_F_SSL2_SET_CERTIFICATE = 126; - {$EXTERNALSYM SSL_F_SSL2_WRITE} - SSL_F_SSL2_WRITE = 127; - {$EXTERNALSYM SSL_F_SSL3_ACCEPT} - SSL_F_SSL3_ACCEPT = 128; - {$EXTERNALSYM SSL_F_SSL3_CHANGE_CIPHER_STATE} - SSL_F_SSL3_CHANGE_CIPHER_STATE = 129; - {$EXTERNALSYM SSL_F_SSL3_CHECK_CERT_AND_ALGORITHM} - SSL_F_SSL3_CHECK_CERT_AND_ALGORITHM = 130; - {$EXTERNALSYM SSL_F_SSL3_CHECK_CLIENT_HELLO} - SSL_F_SSL3_CHECK_CLIENT_HELLO = 304; - {$EXTERNALSYM SSL_F_SSL3_CLIENT_HELLO} - SSL_F_SSL3_CLIENT_HELLO = 131; - {$EXTERNALSYM SSL_F_SSL3_CONNECT} - SSL_F_SSL3_CONNECT = 132; - {$EXTERNALSYM SSL_F_SSL3_CTRL} - SSL_F_SSL3_CTRL = 213; - {$EXTERNALSYM SSL_F_SSL3_CTX_CTRL} - SSL_F_SSL3_CTX_CTRL = 133; - {$EXTERNALSYM SSL_F_SSL3_DIGEST_CACHED_RECORDS} - SSL_F_SSL3_DIGEST_CACHED_RECORDS = 293; - {$EXTERNALSYM SSL_F_SSL3_DO_CHANGE_CIPHER_SPEC} - SSL_F_SSL3_DO_CHANGE_CIPHER_SPEC = 292;//was 279; - {$EXTERNALSYM SSL_F_SSL3_ENC} - SSL_F_SSL3_ENC = 134; - {$EXTERNALSYM SSL_F_SSL3_GET_CERTIFICATE_REQUEST} - SSL_F_SSL3_GET_CERTIFICATE_REQUEST = 135; - {$EXTERNALSYM SSL_F_SSL3_GET_CERT_STATUS} - SSL_F_SSL3_GET_CERT_STATUS = 289;//was 288; - {$EXTERNALSYM SSL_F_SSL3_GET_CERT_VERIFY} - SSL_F_SSL3_GET_CERT_VERIFY = 136; - {$EXTERNALSYM SSL_F_SSL3_GET_CLIENT_CERTIFICATE} - SSL_F_SSL3_GET_CLIENT_CERTIFICATE = 137; - {$EXTERNALSYM SSL_F_SSL3_GET_CLIENT_HELLO} - SSL_F_SSL3_GET_CLIENT_HELLO = 138; - {$EXTERNALSYM SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE} - SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE = 139; - {$EXTERNALSYM SSL_F_SSL3_GET_FINISHED} - SSL_F_SSL3_GET_FINISHED = 140; - {$EXTERNALSYM SSL_F_SSL3_GET_KEY_EXCHANGE} - SSL_F_SSL3_GET_KEY_EXCHANGE = 141; - {$EXTERNALSYM SSL_F_SSL3_GET_MESSAGE} - SSL_F_SSL3_GET_MESSAGE = 142; - {$EXTERNALSYM SSL_F_SSL3_GET_NEW_SESSION_TICKET} - SSL_F_SSL3_GET_NEW_SESSION_TICKET = 283; - {$EXTERNALSYM SSL_F_SSL3_GET_NEXT_PROTO} - SSL_F_SSL3_GET_NEXT_PROTO = 306; - {$EXTERNALSYM SSL_F_SSL3_GET_RECORD} - SSL_F_SSL3_GET_RECORD = 143; - {$EXTERNALSYM SSL_F_SSL3_GET_SERVER_CERTIFICATE} - SSL_F_SSL3_GET_SERVER_CERTIFICATE = 144; - {$EXTERNALSYM SSL_F_SSL3_GET_SERVER_DONE} - SSL_F_SSL3_GET_SERVER_DONE = 145; - {$EXTERNALSYM SSL_F_SSL3_GET_SERVER_HELLO} - SSL_F_SSL3_GET_SERVER_HELLO = 146; - {$EXTERNALSYM SSL_F_SSL3_HANDSHAKE_MAC} - SSL_F_SSL3_HANDSHAKE_MAC = 285; - {$EXTERNALSYM SSL_F_SSL3_NEW_SESSION_TICKET} - SSL_F_SSL3_NEW_SESSION_TICKET = 287; //was 284; - {$EXTERNALSYM SSL_F_SSL3_OUTPUT_CERT_CHAIN} - SSL_F_SSL3_OUTPUT_CERT_CHAIN = 147; - {$EXTERNALSYM SSL_F_SSL3_READ_BYTES} - SSL_F_SSL3_READ_BYTES = 148; - {$EXTERNALSYM SSL_F_SSL3_READ_N} - SSL_F_SSL3_READ_N = 149; - {$EXTERNALSYM SSL_F_SSL3_SEND_CERTIFICATE_REQUEST} - SSL_F_SSL3_SEND_CERTIFICATE_REQUEST = 150; - {$EXTERNALSYM SSL_F_SSL3_SEND_CLIENT_CERTIFICATE} - SSL_F_SSL3_SEND_CLIENT_CERTIFICATE = 151; - {$EXTERNALSYM SSL_F_SSL3_SEND_CLIENT_KEY_EXCHANGE} - SSL_F_SSL3_SEND_CLIENT_KEY_EXCHANGE = 152; - {$EXTERNALSYM SSL_F_SSL3_SEND_CLIENT_VERIFY} - SSL_F_SSL3_SEND_CLIENT_VERIFY = 153; - {$EXTERNALSYM SSL_F_SSL3_SEND_SERVER_CERTIFICATE} - SSL_F_SSL3_SEND_SERVER_CERTIFICATE = 154; - {$EXTERNALSYM SSL_F_SSL3_SEND_SERVER_KEY_EXCHANGE} - SSL_F_SSL3_SEND_SERVER_KEY_EXCHANGE = 155; - {$EXTERNALSYM SSL_F_SSL3_SETUP_KEY_BLOCK} - SSL_F_SSL3_SETUP_KEY_BLOCK = 157; - {$EXTERNALSYM SSL_F_SSL3_SETUP_READ_BUFFER} - SSL_F_SSL3_SETUP_READ_BUFFER = 156; - {$EXTERNALSYM SSL_F_SSL3_SETUP_WRITE_BUFFER} - SSL_F_SSL3_SETUP_WRITE_BUFFER = 291; - {$EXTERNALSYM SSL_F_SSL3_WRITE_BYTES} - SSL_F_SSL3_WRITE_BYTES = 158; - {$EXTERNALSYM SSL_F_SSL3_WRITE_PENDING} - SSL_F_SSL3_WRITE_PENDING = 159; - {$EXTERNALSYM SSL_F_SSL_ADD_CLIENTHELLO_RENEGOTIATE_EXT} - SSL_F_SSL_ADD_CLIENTHELLO_RENEGOTIATE_EXT = 298;//was 285; - {$EXTERNALSYM SSL_F_SSL_ADD_CLIENTHELLO_TLSEXT} - SSL_F_SSL_ADD_CLIENTHELLO_TLSEXT = 277; //was 272; - {$EXTERNALSYM SSL_F_SSL_ADD_CLIENTHELLO_USE_SRTP_EXT} - SSL_F_SSL_ADD_CLIENTHELLO_USE_SRTP_EXT = 307; - {$EXTERNALSYM SSL_F_SSL_ADD_DIR_CERT_SUBJECTS_TO_STACK} - SSL_F_SSL_ADD_DIR_CERT_SUBJECTS_TO_STACK = 215; - {$EXTERNALSYM SSL_F_SSL_ADD_FILE_CERT_SUBJECTS_TO_STACK} - SSL_F_SSL_ADD_FILE_CERT_SUBJECTS_TO_STACK = 216; - {$EXTERNALSYM SSL_F_SSL_ADD_SERVERHELLO_RENEGOTIATE_EXT} - SSL_F_SSL_ADD_SERVERHELLO_RENEGOTIATE_EXT = 299;//was 286; - {$EXTERNALSYM SSL_F_SSL_ADD_SERVERHELLO_TLSEXT} - SSL_F_SSL_ADD_SERVERHELLO_TLSEXT = 278; //was 273; - {$EXTERNALSYM SSL_F_SSL_ADD_SERVERHELLO_USE_SRTP_EXT} - SSL_F_SSL_ADD_SERVERHELLO_USE_SRTP_EXT = 308; - {$EXTERNALSYM SSL_F_SSL_BAD_METHOD} - SSL_F_SSL_BAD_METHOD = 160; - {$EXTERNALSYM SSL_F_SSL_BYTES_TO_CIPHER_LIST} - SSL_F_SSL_BYTES_TO_CIPHER_LIST = 161; - {$EXTERNALSYM SSL_F_SSL_CERT_DUP} - SSL_F_SSL_CERT_DUP = 221; - {$EXTERNALSYM SSL_F_SSL_CERT_INST} - SSL_F_SSL_CERT_INST = 222; - {$EXTERNALSYM SSL_F_SSL_CERT_INSTANTIATE} - SSL_F_SSL_CERT_INSTANTIATE = 214; - {$EXTERNALSYM SSL_F_SSL_CERT_NEW} - SSL_F_SSL_CERT_NEW = 162; - {$EXTERNALSYM SSL_F_SSL_CHECK_PRIVATE_KEY} - SSL_F_SSL_CHECK_PRIVATE_KEY = 163; - {$EXTERNALSYM SSL_F_SSL_CHECK_SERVERHELLO_TLSEXT} - SSL_F_SSL_CHECK_SERVERHELLO_TLSEXT = 280;//was 274; - {$EXTERNALSYM SSL_F_SSL_CHECK_SRVR_ECC_CERT_AND_ALG} - SSL_F_SSL_CHECK_SRVR_ECC_CERT_AND_ALG = 279; - {$EXTERNALSYM SSL_F_SSL_CIPHER_PROCESS_RULESTR} - SSL_F_SSL_CIPHER_PROCESS_RULESTR = 230; - {$EXTERNALSYM SSL_F_SSL_CIPHER_STRENGTH_SORT} - SSL_F_SSL_CIPHER_STRENGTH_SORT = 231; - {$EXTERNALSYM SSL_F_SSL_CLEAR} - SSL_F_SSL_CLEAR = 164; - {$EXTERNALSYM SSL_F_SSL_COMP_ADD_COMPRESSION_METHOD} - SSL_F_SSL_COMP_ADD_COMPRESSION_METHOD = 165; - {$EXTERNALSYM SSL_F_SSL_CREATE_CIPHER_LIST} - SSL_F_SSL_CREATE_CIPHER_LIST = 166; - {$EXTERNALSYM SSL_F_SSL_CTRL} - SSL_F_SSL_CTRL = 232; - {$EXTERNALSYM SSL_F_SSL_CTX_CHECK_PRIVATE_KEY} - SSL_F_SSL_CTX_CHECK_PRIVATE_KEY = 168; - {$EXTERNALSYM SSL_F_SSL_CTX_MAKE_PROFILES} - SSL_F_SSL_CTX_MAKE_PROFILES = 309; - {$EXTERNALSYM SSL_F_SSL_CTX_NEW} - SSL_F_SSL_CTX_NEW = 169; - {$EXTERNALSYM SSL_F_SSL_CTX_SET_CIPHER_LIST} - SSL_F_SSL_CTX_SET_CIPHER_LIST = 269; - {$EXTERNALSYM SSL_F_SSL_CTX_SET_CLIENT_CERT_ENGINE} - SSL_F_SSL_CTX_SET_CLIENT_CERT_ENGINE = 290; //was 278; - {$EXTERNALSYM SSL_F_SSL_CTX_SET_PURPOSE} - SSL_F_SSL_CTX_SET_PURPOSE = 226; - {$EXTERNALSYM SSL_F_SSL_CTX_SET_SESSION_ID_CONTEXT} - SSL_F_SSL_CTX_SET_SESSION_ID_CONTEXT = 219; - {$EXTERNALSYM SSL_F_SSL_CTX_SET_SSL_VERSION} - SSL_F_SSL_CTX_SET_SSL_VERSION = 170; - {$EXTERNALSYM SSL_F_SSL_CTX_SET_TRUST} - SSL_F_SSL_CTX_SET_TRUST = 229; - {$EXTERNALSYM SSL_F_SSL_CTX_USE_CERTIFICATE} - SSL_F_SSL_CTX_USE_CERTIFICATE = 171; - {$EXTERNALSYM SSL_F_SSL_CTX_USE_CERTIFICATE_ASN1} - SSL_F_SSL_CTX_USE_CERTIFICATE_ASN1 = 172; - {$EXTERNALSYM SSL_F_SSL_CTX_USE_CERTIFICATE_CHAIN_FILE} - SSL_F_SSL_CTX_USE_CERTIFICATE_CHAIN_FILE = 220; - {$EXTERNALSYM SSL_F_SSL_CTX_USE_CERTIFICATE_FILE} - SSL_F_SSL_CTX_USE_CERTIFICATE_FILE = 173; - {$EXTERNALSYM SSL_F_SSL_CTX_USE_PRIVATEKEY} - SSL_F_SSL_CTX_USE_PRIVATEKEY = 174; - {$EXTERNALSYM SSL_F_SSL_CTX_USE_PRIVATEKEY_ASN1} - SSL_F_SSL_CTX_USE_PRIVATEKEY_ASN1 = 175; - {$EXTERNALSYM SSL_F_SSL_CTX_USE_PRIVATEKEY_FILE} - SSL_F_SSL_CTX_USE_PRIVATEKEY_FILE = 176; - {$EXTERNALSYM SSL_F_SSL_CTX_USE_PSK_IDENTITY_HINT} - SSL_F_SSL_CTX_USE_PSK_IDENTITY_HINT = 272; - {$EXTERNALSYM SSL_F_SSL_CTX_USE_RSAPRIVATEKEY} - SSL_F_SSL_CTX_USE_RSAPRIVATEKEY = 177; - {$EXTERNALSYM SSL_F_SSL_CTX_USE_RSAPRIVATEKEY_ASN1} - SSL_F_SSL_CTX_USE_RSAPRIVATEKEY_ASN1 = 178; - {$EXTERNALSYM SSL_F_SSL_CTX_USE_RSAPRIVATEKEY_FILE} - SSL_F_SSL_CTX_USE_RSAPRIVATEKEY_FILE = 179; - {$EXTERNALSYM SSL_F_SSL_DO_HANDSHAKE} - SSL_F_SSL_DO_HANDSHAKE = 180; - {$EXTERNALSYM SSL_F_SSL_GET_NEW_SESSION} - SSL_F_SSL_GET_NEW_SESSION = 181; - {$EXTERNALSYM SSL_F_SSL_GET_PREV_SESSION} - SSL_F_SSL_GET_PREV_SESSION = 217; - {$EXTERNALSYM SSL_F_SSL_GET_SERVER_SEND_CERT} - SSL_F_SSL_GET_SERVER_SEND_CERT = 182; - {$EXTERNALSYM SSL_F_SSL_GET_SERVER_SEND_PKEY} - SSL_F_SSL_GET_SERVER_SEND_PKEY = 317; - {$EXTERNALSYM SSL_F_SSL_GET_SIGN_PKEY} - SSL_F_SSL_GET_SIGN_PKEY = 183; - {$EXTERNALSYM SSL_F_SSL_INIT_WBIO_BUFFER} - SSL_F_SSL_INIT_WBIO_BUFFER = 184; - {$EXTERNALSYM SSL_F_SSL_LOAD_CLIENT_CA_FILE} - SSL_F_SSL_LOAD_CLIENT_CA_FILE = 185; - {$EXTERNALSYM SSL_F_SSL_NEW} - SSL_F_SSL_NEW = 186; - {$EXTERNALSYM SSL_F_SSL_PARSE_CLIENTHELLO_RENEGOTIATE_EXT} - SSL_F_SSL_PARSE_CLIENTHELLO_RENEGOTIATE_EXT = 300; //was 287; - {$EXTERNALSYM SSL_F_SSL_PARSE_CLIENTHELLO_TLSEXT} - SSL_F_SSL_PARSE_CLIENTHELLO_TLSEXT = 302; //was 290; - {$EXTERNALSYM SSL_F_SSL_PARSE_CLIENTHELLO_USE_SRTP_EXT} - SSL_F_SSL_PARSE_CLIENTHELLO_USE_SRTP_EXT = 310; - {$EXTERNALSYM SSL_F_SSL_PARSE_SERVERHELLO_RENEGOTIATE_EXT} - SSL_F_SSL_PARSE_SERVERHELLO_RENEGOTIATE_EXT = 301;//was 289; - {$EXTERNALSYM SSL_F_SSL_PARSE_SERVERHELLO_TLSEXT} - SSL_F_SSL_PARSE_SERVERHELLO_TLSEXT = 303; //was 291; - {$EXTERNALSYM SSL_F_SSL_PARSE_SERVERHELLO_USE_SRTP_EXT} - SSL_F_SSL_PARSE_SERVERHELLO_USE_SRTP_EXT = 311; - {$EXTERNALSYM SSL_F_SSL_PEEK} - SSL_F_SSL_PEEK = 270; - {$EXTERNALSYM SSL_F_SSL_PREPARE_CLIENTHELLO_TLSEXT} - SSL_F_SSL_PREPARE_CLIENTHELLO_TLSEXT = 281; //was 275; - {$EXTERNALSYM SSL_F_SSL_PREPARE_SERVERHELLO_TLSEXT} - SSL_F_SSL_PREPARE_SERVERHELLO_TLSEXT = 282;//was 276; - {$EXTERNALSYM SSL_F_SSL_READ} - SSL_F_SSL_READ = 223; - {$EXTERNALSYM SSL_F_SSL_RSA_PRIVATE_DECRYPT} - SSL_F_SSL_RSA_PRIVATE_DECRYPT = 187; - {$EXTERNALSYM SSL_F_SSL_RSA_PUBLIC_ENCRYPT} - SSL_F_SSL_RSA_PUBLIC_ENCRYPT = 188; - {$EXTERNALSYM SSL_F_SSL_SESSION_NEW} - SSL_F_SSL_SESSION_NEW = 189; - {$EXTERNALSYM SSL_F_SSL_SESSION_PRINT_FP} - SSL_F_SSL_SESSION_PRINT_FP = 190; - {$EXTERNALSYM SSL_F_SSL_SESSION_SET1_ID_CONTEXT} - SSL_F_SSL_SESSION_SET1_ID_CONTEXT = 312; - {$EXTERNALSYM SSL_F_SSL_SESS_CERT_NEW} - SSL_F_SSL_SESS_CERT_NEW = 225; - {$EXTERNALSYM SSL_F_SSL_SET_CERT} - SSL_F_SSL_SET_CERT = 191; - {$EXTERNALSYM SSL_F_SSL_SET_FD} - SSL_F_SSL_SET_FD = 192; - {$EXTERNALSYM SSL_F_SSL_SET_PKEY} - SSL_F_SSL_SET_PKEY = 193; - {$EXTERNALSYM SSL_F_SSL_SET_RFD} - SSL_F_SSL_SET_RFD = 194; - {$EXTERNALSYM SSL_F_SSL_SET_SESSION} - SSL_F_SSL_SET_SESSION = 195; - {$EXTERNALSYM SSL_F_SSL_SET_SESSION_ID_CONTEXT} - SSL_F_SSL_SET_SESSION_ID_CONTEXT = 218; - {$EXTERNALSYM SSL_F_SSL_SET_SESSION_TICKET_EXT} - SSL_F_SSL_SET_SESSION_TICKET_EXT = 294; - {$EXTERNALSYM SSL_F_SSL_SET_WFD} - SSL_F_SSL_SET_WFD = 196; - {$EXTERNALSYM SSL_F_SSL_SHUTDOWN} - SSL_F_SSL_SHUTDOWN = 224; - {$EXTERNALSYM SSL_F_SSL_SRP_CTX_INIT} - SSL_F_SSL_SRP_CTX_INIT = 313; - {$EXTERNALSYM SSL_F_SSL_UNDEFINED_FUNCTION} - SSL_F_SSL_UNDEFINED_FUNCTION = 197; - {$EXTERNALSYM SSL_F_SSL_USE_CERTIFICATE} - SSL_F_SSL_USE_CERTIFICATE = 198; - {$EXTERNALSYM SSL_F_SSL_USE_CERTIFICATE_ASN1} - SSL_F_SSL_USE_CERTIFICATE_ASN1 = 199; - {$EXTERNALSYM SSL_F_SSL_USE_CERTIFICATE_FILE} - SSL_F_SSL_USE_CERTIFICATE_FILE = 200; - {$EXTERNALSYM SSL_F_SSL_USE_PRIVATEKEY} - SSL_F_SSL_USE_PRIVATEKEY = 201; - {$EXTERNALSYM SSL_F_SSL_USE_PRIVATEKEY_ASN1} - SSL_F_SSL_USE_PRIVATEKEY_ASN1 = 202; - {$EXTERNALSYM SSL_F_SSL_USE_PRIVATEKEY_FILE} - SSL_F_SSL_USE_PRIVATEKEY_FILE = 203; - {$EXTERNALSYM SSL_F_SSL_USE_PSK_IDENTITY_HINT} - SSL_F_SSL_USE_PSK_IDENTITY_HINT = 273; - {$EXTERNALSYM SSL_F_SSL_USE_RSAPRIVATEKEY} - SSL_F_SSL_USE_RSAPRIVATEKEY = 204; - {$EXTERNALSYM SSL_F_SSL_USE_RSAPRIVATEKEY_ASN1} - SSL_F_SSL_USE_RSAPRIVATEKEY_ASN1 = 205; - {$EXTERNALSYM SSL_F_SSL_USE_RSAPRIVATEKEY_FILE} - SSL_F_SSL_USE_RSAPRIVATEKEY_FILE = 206; - {$EXTERNALSYM SSL_F_SSL_VERIFY_CERT_CHAIN} - SSL_F_SSL_VERIFY_CERT_CHAIN = 207; - {$EXTERNALSYM SSL_F_SSL_WRITE} - SSL_F_SSL_WRITE = 208; - {$EXTERNALSYM SSL_F_TLS1_CERT_VERIFY_MAC} - SSL_F_TLS1_CERT_VERIFY_MAC = 286; - {$EXTERNALSYM SSL_F_TLS1_CHANGE_CIPHER_STATE} - SSL_F_TLS1_CHANGE_CIPHER_STATE = 209; - {$EXTERNALSYM SSL_F_TLS1_CHECK_SERVERHELLO_TLSEXT} - SSL_F_TLS1_CHECK_SERVERHELLO_TLSEXT = 274; - {$EXTERNALSYM SSL_F_TLS1_ENC} - SSL_F_TLS1_ENC = 210; - {$EXTERNALSYM SSL_F_TLS1_EXPORT_KEYING_MATERIAL} - SSL_F_TLS1_EXPORT_KEYING_MATERIAL = 314; - {$EXTERNALSYM SSL_F_TLS1_HEARTBEAT} - SSL_F_TLS1_HEARTBEAT = 315; - {$EXTERNALSYM SSL_F_TLS1_PREPARE_CLIENTHELLO_TLSEXT} - SSL_F_TLS1_PREPARE_CLIENTHELLO_TLSEXT = 275; - {$EXTERNALSYM SSL_F_TLS1_PREPARE_SERVERHELLO_TLSEXT} - SSL_F_TLS1_PREPARE_SERVERHELLO_TLSEXT = 276; - {$EXTERNALSYM SSL_F_TLS1_PRF} - SSL_F_TLS1_PRF = 284; - {$EXTERNALSYM SSL_F_TLS1_SETUP_KEY_BLOCK} - SSL_F_TLS1_SETUP_KEY_BLOCK = 211; - {$EXTERNALSYM SSL_F_WRITE_PENDING} - SSL_F_WRITE_PENDING = 212; - {$EXTERNALSYM SSL_MAX_KEY_ARG_LENGTH} - SSL_MAX_KEY_ARG_LENGTH = 8; - {$EXTERNALSYM SSL_MAX_MASTER_KEY_LENGTH} - SSL_MAX_MASTER_KEY_LENGTH = 48; - {$EXTERNALSYM SSL_MAX_SID_CTX_LENGTH} - SSL_MAX_SID_CTX_LENGTH = 32; - {$EXTERNALSYM SSL_MAX_KRB5_PRINCIPAL_LENGTH} - SSL_MAX_KRB5_PRINCIPAL_LENGTH = 256; - {$EXTERNALSYM SSL_MAX_SSL_SESSION_ID_LENGTH} - SSL_MAX_SSL_SESSION_ID_LENGTH = 32; - {$EXTERNALSYM SSL_MODE_ENABLE_PARTIAL_WRITE} - SSL_MODE_ENABLE_PARTIAL_WRITE = $00000001; - {$EXTERNALSYM SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER} - SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER = $00000002; - {$EXTERNALSYM SSL_MODE_AUTO_RETRY} - SSL_MODE_AUTO_RETRY = $00000004; - {$EXTERNALSYM SSL_MODE_NO_AUTO_CHAIN} - SSL_MODE_NO_AUTO_CHAIN = $00000008; -///* Save RAM by releasing read and write buffers when they're empty. (SSL3 and -// * TLS only.) "Released" buffers are put onto a free-list in the context -// * or just freed (depending on the context's setting for freelist_max_len). */ - {$EXTERNALSYM SSL_MODE_RELEASE_BUFFERS} - SSL_MODE_RELEASE_BUFFERS = $00000010; - {$IFDEF OPENSSL_NO_BUF_FREELISTS} - {$EXTERNALSYM SSL_MAX_BUF_FREELIST_LEN_DEFAULT} - SSL_MAX_BUF_FREELIST_LEN_DEFAULT = 32; - {$ENDIF} - {$EXTERNALSYM SSL_NOTHING} - SSL_NOTHING = 1; - {$EXTERNALSYM SSL_WRITING} - SSL_WRITING = 2; - {$EXTERNALSYM SSL_READING} - SSL_READING = 3; - {$EXTERNALSYM SSL_X509_LOOKUP} - SSL_X509_LOOKUP = 4; - {$EXTERNALSYM SSL_OP_MICROSOFT_SESS_ID_BUG} - SSL_OP_MICROSOFT_SESS_ID_BUG = $00000001; - {$EXTERNALSYM SSL_OP_NETSCAPE_CHALLENGE_BUG} - SSL_OP_NETSCAPE_CHALLENGE_BUG = $00000002; -//* Allow initial connection to servers that don't support RI */ - {$EXTERNALSYM SSL_OP_LEGACY_SERVER_CONNECT} - SSL_OP_LEGACY_SERVER_CONNECT = $00000004; - - {$EXTERNALSYM SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG} - SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG = $00000008; - {$EXTERNALSYM SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG} - SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG = $00000010; - {$EXTERNALSYM SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER} - SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER = $00000020; - {$EXTERNALSYM SSL_OP_MSIE_SSLV2_RSA_PADDING} - SSL_OP_MSIE_SSLV2_RSA_PADDING = $00000040; - {$EXTERNALSYM SSL_OP_SSLEAY_080_CLIENT_DH_BUG} - SSL_OP_SSLEAY_080_CLIENT_DH_BUG = $00000080; - {$EXTERNALSYM SSL_OP_TLS_D5_BUG} - SSL_OP_TLS_D5_BUG = $00000100; - {$EXTERNALSYM SSL_OP_TLS_BLOCK_PADDING_BUG} - SSL_OP_TLS_BLOCK_PADDING_BUG = $00000200; - {$EXTERNALSYM SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS} - SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS = $00000800; - {$EXTERNALSYM SSL_OP_ALL} - SSL_OP_ALL = $00000FFF; //this was $000FFFFF; before 0.9.7 - {$EXTERNALSYM SSL_OP_NO_QUERY_MTU} - SSL_OP_NO_QUERY_MTU = $00001000; - {$EXTERNALSYM SSL_OP_COOKIE_EXCHANGE} - SSL_OP_COOKIE_EXCHANGE = $00002000; - {$EXTERNALSYM SSL_OP_NO_TICKET} - SSL_OP_NO_TICKET = $00004000; -//* Use Cisco's "speshul" version of DTLS_BAD_VER (as client) */ - {$EXTERNALSYM SSL_OP_CISCO_ANYCONNECT} - SSL_OP_CISCO_ANYCONNECT = $00008000; - {$EXTERNALSYM SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION} - SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION = $00010000; -//* Don't use compression even if supported */ - {$EXTERNALSYM SSL_OP_NO_COMPRESSION} - SSL_OP_NO_COMPRESSION = $00020000; -//* Permit unsafe legacy renegotiation */ - {$EXTERNALSYM SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION} - SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION = $00040000; - - {$EXTERNALSYM SSL_OP_SINGLE_ECDH_USE} - SSL_OP_SINGLE_ECDH_USE = $00080000; - {$EXTERNALSYM SSL_OP_SINGLE_DH_USE} - SSL_OP_SINGLE_DH_USE = $00100000; - {$EXTERNALSYM SSL_OP_EPHEMERAL_RSA} - SSL_OP_EPHEMERAL_RSA = $00200000; - {$EXTERNALSYM SSL_OP_CIPHER_SERVER_PREFERENCE} - SSL_OP_CIPHER_SERVER_PREFERENCE = $00400000; - {$EXTERNALSYM SSL_OP_TLS_ROLLBACK_BUG} - SSL_OP_TLS_ROLLBACK_BUG = $00800000; //was $00000400; - {$EXTERNALSYM SSL_OP_NO_SSLv2} - SSL_OP_NO_SSLv2 = $01000000; - {$EXTERNALSYM SSL_OP_NO_SSLv3} - SSL_OP_NO_SSLv3 = $02000000; - {$EXTERNALSYM SSL_OP_NO_TLSv1} - SSL_OP_NO_TLSv1 = $04000000; - {$EXTERNALSYM SSL_OP_NO_TLSv1_2} - SSL_OP_NO_TLSv1_2 = $08000000; - {$EXTERNALSYM SSL_OP_NO_TLSv1_1} - SSL_OP_NO_TLSv1_1 = $10000000; - {$EXTERNALSYM SSL_OP_PKCS1_CHECK_1} - SSL_OP_PKCS1_CHECK_1 = $00; //was $08000000; - {$EXTERNALSYM SSL_OP_PKCS1_CHECK_2} - SSL_OP_PKCS1_CHECK_2 = $00; //was $10000000; - - {$EXTERNALSYM SSL_OP_NETSCAPE_CA_DN_BUG} - SSL_OP_NETSCAPE_CA_DN_BUG = $20000000; - //OPENSSL_SSL_OP_NON_EXPORT_FIRST was removed for OpenSSL 0.9.7 (that was $40000000;) - {$EXTERNALSYM SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG} - SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG = $40000000;// was $80000000; -//* Make server add server-hello extension from early version of -// * cryptopro draft, when GOST ciphersuite is negotiated. -// * Required for interoperability with CryptoPro CSP 3.x -// */ - {$EXTERNALSYM SSL_OP_CRYPTOPRO_TLSEXT_BUG} - SSL_OP_CRYPTOPRO_TLSEXT_BUG = $80000000; - - {$EXTERNALSYM SSL_RECEIVED_SHUTDOWN} - SSL_RECEIVED_SHUTDOWN = 2; - {$EXTERNALSYM SSL_R_APP_DATA_IN_HANDSHAKE} - SSL_R_APP_DATA_IN_HANDSHAKE = 100; - {$EXTERNALSYM SSL_R_ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT} - SSL_R_ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT = 272; - {$EXTERNALSYM SSL_R_BAD_ALERT_RECORD} - SSL_R_BAD_ALERT_RECORD = 101; - {$EXTERNALSYM SSL_R_BAD_AUTHENTICATION_TYPE} - SSL_R_BAD_AUTHENTICATION_TYPE = 102; - {$EXTERNALSYM SSL_R_BAD_CHANGE_CIPHER_SPEC} - SSL_R_BAD_CHANGE_CIPHER_SPEC = 103; - {$EXTERNALSYM SSL_R_BAD_CHECKSUM} - SSL_R_BAD_CHECKSUM = 104; - {$EXTERNALSYM SSL_R_BAD_CLIENT_REQUEST} - SSL_R_BAD_CLIENT_REQUEST = 105; - {$EXTERNALSYM SSL_R_BAD_DATA_RETURNED_BY_CALLBACK} - SSL_R_BAD_DATA_RETURNED_BY_CALLBACK = 106; - {$EXTERNALSYM SSL_R_BAD_DECOMPRESSION} - SSL_R_BAD_DECOMPRESSION = 107; - {$EXTERNALSYM SSL_R_BAD_DH_G_LENGTH} - SSL_R_BAD_DH_G_LENGTH = 108; - {$EXTERNALSYM SSL_R_BAD_DH_PUB_KEY_LENGTH} - SSL_R_BAD_DH_PUB_KEY_LENGTH = 109; - {$EXTERNALSYM SSL_R_BAD_DH_P_LENGTH} - SSL_R_BAD_DH_P_LENGTH = 110; - {$EXTERNALSYM SSL_R_BAD_DIGEST_LENGTH} - SSL_R_BAD_DIGEST_LENGTH = 111; - {$EXTERNALSYM SSL_R_BAD_DSA_SIGNATURE} - SSL_R_BAD_DSA_SIGNATURE = 112; - {$EXTERNALSYM SSL_R_BAD_ECC_CERT} - SSL_R_BAD_ECC_CERT = 304; - {$EXTERNALSYM SSL_R_BAD_ECDSA_SIGNATURE} - SSL_R_BAD_ECDSA_SIGNATURE = 305; - {$EXTERNALSYM SSL_R_BAD_ECPOINT} - SSL_R_BAD_ECPOINT = 306; - {$EXTERNALSYM SSL_R_BAD_HANDSHAKE_LENGTH} - SSL_R_BAD_HANDSHAKE_LENGTH = 332; - {$EXTERNALSYM SSL_R_BAD_HELLO_REQUEST} - SSL_R_BAD_HELLO_REQUEST = 105; - {$EXTERNALSYM SSL_R_BAD_LENGTH} - SSL_R_BAD_LENGTH = 271; - {$EXTERNALSYM SSL_R_BAD_MAC_DECODE} - SSL_R_BAD_MAC_DECODE = 113; - {$EXTERNALSYM SSL_R_BAD_MAC_LENGTH} - SSL_R_BAD_MAC_LENGTH = 333; - {$EXTERNALSYM SSL_R_BAD_MESSAGE_TYPE} - SSL_R_BAD_MESSAGE_TYPE = 114; - {$EXTERNALSYM SSL_R_BAD_PACKET_LENGTH} - SSL_R_BAD_PACKET_LENGTH = 115; - {$EXTERNALSYM SSL_R_BAD_PROTOCOL_VERSION_NUMBER} - SSL_R_BAD_PROTOCOL_VERSION_NUMBER = 116; - {$EXTERNALSYM SSL_R_BAD_PSK_IDENTITY_HINT_LENGTH} - SSL_R_BAD_PSK_IDENTITY_HINT_LENGTH = 316; - {$EXTERNALSYM SSL_R_BAD_RESPONSE_ARGUMENT} - SSL_R_BAD_RESPONSE_ARGUMENT = 117; - {$EXTERNALSYM SSL_R_BAD_RSA_DECRYPT} - SSL_R_BAD_RSA_DECRYPT = 118; - {$EXTERNALSYM SSL_R_BAD_RSA_ENCRYPT} - SSL_R_BAD_RSA_ENCRYPT = 119; - {$EXTERNALSYM SSL_R_BAD_RSA_E_LENGTH} - SSL_R_BAD_RSA_E_LENGTH = 120; - {$EXTERNALSYM SSL_R_BAD_RSA_MODULUS_LENGTH} - SSL_R_BAD_RSA_MODULUS_LENGTH = 121; - {$EXTERNALSYM SSL_R_BAD_RSA_SIGNATURE} - SSL_R_BAD_RSA_SIGNATURE = 122; - {$EXTERNALSYM SSL_R_BAD_SIGNATURE} - SSL_R_BAD_SIGNATURE = 123; - {$EXTERNALSYM SSL_R_BAD_SRP_A_LENGTH} - SSL_R_BAD_SRP_A_LENGTH = 347; - {$EXTERNALSYM SSL_R_BAD_SRP_B_LENGTH} - SSL_R_BAD_SRP_B_LENGTH = 348; - {$EXTERNALSYM SSL_R_BAD_SRP_G_LENGTH} - SSL_R_BAD_SRP_G_LENGTH = 349; - {$EXTERNALSYM SSL_R_BAD_SRP_N_LENGTH} - SSL_R_BAD_SRP_N_LENGTH = 350; - {$EXTERNALSYM SSL_R_BAD_SRP_S_LENGTH} - SSL_R_BAD_SRP_S_LENGTH = 351; - {$EXTERNALSYM SSL_R_BAD_SRTP_MKI_VALUE} - SSL_R_BAD_SRTP_MKI_VALUE = 352; - {$EXTERNALSYM SSL_R_BAD_SRTP_PROTECTION_PROFILE_LIST} - SSL_R_BAD_SRTP_PROTECTION_PROFILE_LIST = 353; - - {$EXTERNALSYM SSL_R_BAD_SSL_FILETYPE} - SSL_R_BAD_SSL_FILETYPE = 124; - {$EXTERNALSYM SSL_R_BAD_SSL_SESSION_ID_LENGTH} - SSL_R_BAD_SSL_SESSION_ID_LENGTH = 125; - {$EXTERNALSYM SSL_R_BAD_STATE} - SSL_R_BAD_STATE = 126; - {$EXTERNALSYM SSL_R_BAD_WRITE_RETRY} - SSL_R_BAD_WRITE_RETRY = 127; - {$EXTERNALSYM SSL_R_BIO_NOT_SET} - SSL_R_BIO_NOT_SET = 128; - {$EXTERNALSYM SSL_R_BLOCK_CIPHER_PAD_IS_WRONG} - SSL_R_BLOCK_CIPHER_PAD_IS_WRONG = 129; - {$EXTERNALSYM SSL_R_BN_LIB} - SSL_R_BN_LIB = 130; - {$EXTERNALSYM SSL_R_CA_DN_LENGTH_MISMATCH} - SSL_R_CA_DN_LENGTH_MISMATCH = 131; - {$EXTERNALSYM SSL_R_CA_DN_TOO_LONG} - SSL_R_CA_DN_TOO_LONG = 132; - {$EXTERNALSYM SSL_R_CCS_RECEIVED_EARLY} - SSL_R_CCS_RECEIVED_EARLY = 133; - {$EXTERNALSYM SSL_R_CERTIFICATE_VERIFY_FAILED} - SSL_R_CERTIFICATE_VERIFY_FAILED = 134; - {$EXTERNALSYM SSL_R_CERT_LENGTH_MISMATCH} - SSL_R_CERT_LENGTH_MISMATCH = 135; - {$EXTERNALSYM SSL_R_CHALLENGE_IS_DIFFERENT} - SSL_R_CHALLENGE_IS_DIFFERENT = 136; - {$EXTERNALSYM SSL_R_CIPHER_CODE_WRONG_LENGTH} - SSL_R_CIPHER_CODE_WRONG_LENGTH = 137; - {$EXTERNALSYM SSL_R_CIPHER_OR_HASH_UNAVAILABLE} - SSL_R_CIPHER_OR_HASH_UNAVAILABLE = 138; - {$EXTERNALSYM SSL_R_CIPHER_TABLE_SRC_ERROR} - SSL_R_CIPHER_TABLE_SRC_ERROR = 139; - {$EXTERNALSYM SSL_R_CLIENTHELLO_TLSEXT} - SSL_R_CLIENTHELLO_TLSEXT = 226; //was 157; - {$EXTERNALSYM SSL_R_COMPRESSED_LENGTH_TOO_LONG} - SSL_R_COMPRESSED_LENGTH_TOO_LONG = 140; - {$EXTERNALSYM SSL_R_COMPRESSION_DISABLED} - SSL_R_COMPRESSION_DISABLED = 343; - {$EXTERNALSYM SSL_R_COMPRESSION_FAILURE} - SSL_R_COMPRESSION_FAILURE = 141; - {$EXTERNALSYM SSL_R_COMPRESSION_LIBRARY_ERROR} - SSL_R_COMPRESSION_LIBRARY_ERROR = 142; - {$EXTERNALSYM SSL_R_CONNECTION_ID_IS_DIFFERENT} - SSL_R_CONNECTION_ID_IS_DIFFERENT = 143; - {$EXTERNALSYM SSL_R_CONNECTION_TYPE_NOT_SET} - SSL_R_CONNECTION_TYPE_NOT_SET = 144; - {$EXTERNALSYM SSL_R_DATA_BETWEEN_CCS_AND_FINISHED} - SSL_R_DATA_BETWEEN_CCS_AND_FINISHED = 145; - {$EXTERNALSYM SSL_R_DATA_LENGTH_TOO_LONG} - SSL_R_DATA_LENGTH_TOO_LONG = 146; - {$EXTERNALSYM SSL_R_DECRYPTION_FAILED} - SSL_R_DECRYPTION_FAILED = 147; - {$EXTERNALSYM SSL_R_DH_PUBLIC_VALUE_LENGTH_IS_WRONG} - SSL_R_DH_PUBLIC_VALUE_LENGTH_IS_WRONG = 148; - {$EXTERNALSYM SSL_R_DIGEST_CHECK_FAILED} - SSL_R_DIGEST_CHECK_FAILED = 149; - {$EXTERNALSYM SSL_R_DTLS_MESSAGE_TOO_BIG} - SSL_R_DTLS_MESSAGE_TOO_BIG = 334; //was 318; - {$EXTERNALSYM SSL_R_ECC_CERT_NOT_FOR_KEY_AGREEMENT} - SSL_R_ECC_CERT_NOT_FOR_KEY_AGREEMENT = 317; - {$EXTERNALSYM SSL_R_ECC_CERT_NOT_FOR_SIGNING} - SSL_R_ECC_CERT_NOT_FOR_SIGNING = 318; - {$EXTERNALSYM SSL_R_ECC_CERT_SHOULD_HAVE_RSA_SIGNATURE} - SSL_R_ECC_CERT_SHOULD_HAVE_RSA_SIGNATURE = 322; - {$EXTERNALSYM SSL_R_ECC_CERT_SHOULD_HAVE_SHA1_SIGNATURE} - SSL_R_ECC_CERT_SHOULD_HAVE_SHA1_SIGNATURE = 323; - {$EXTERNALSYM SSL_R_ECGROUP_TOO_LARGE_FOR_CIPHER} - SSL_R_ECGROUP_TOO_LARGE_FOR_CIPHER = 310; - {$EXTERNALSYM SSL_R_EMPTY_SRTP_PROTECTION_PROFILE_LIST} - SSL_R_EMPTY_SRTP_PROTECTION_PROFILE_LIST = 354; - {$EXTERNALSYM SSL_R_ENCRYPTED_LENGTH_TOO_LONG} - SSL_R_ENCRYPTED_LENGTH_TOO_LONG = 150; - {$EXTERNALSYM SSL_R_ERROR_IN_RECEIVED_CIPHER_LIST} - SSL_R_ERROR_IN_RECEIVED_CIPHER_LIST = 151; - {$EXTERNALSYM SSL_R_EXCESSIVE_MESSAGE_SIZE} - SSL_R_EXCESSIVE_MESSAGE_SIZE = 152; - {$EXTERNALSYM SSL_R_EXTRA_DATA_IN_MESSAGE} - SSL_R_EXTRA_DATA_IN_MESSAGE = 153; - {$EXTERNALSYM SSL_R_GOT_A_FIN_BEFORE_A_CCS} - SSL_R_GOT_A_FIN_BEFORE_A_CCS = 154; - {$EXTERNALSYM SSL_R_GOT_NEXT_PROTO_BEFORE_A_CCS} - SSL_R_GOT_NEXT_PROTO_BEFORE_A_CCS = 355; - {$EXTERNALSYM SSL_R_GOT_NEXT_PROTO_WITHOUT_EXTENSION} - SSL_R_GOT_NEXT_PROTO_WITHOUT_EXTENSION = 356; - {$EXTERNALSYM SSL_R_HTTPS_PROXY_REQUEST} - SSL_R_HTTPS_PROXY_REQUEST = 155; - {$EXTERNALSYM SSL_R_HTTP_REQUEST} - SSL_R_HTTP_REQUEST = 156; - {$EXTERNALSYM SSL_R_ILLEGAL_PADDING} - SSL_R_ILLEGAL_PADDING = 283; - {$EXTERNALSYM SSL_R_INCONSISTENT_COMPRESSION} - SSL_R_INCONSISTENT_COMPRESSION = 340; - {$EXTERNALSYM SSL_R_INTERNAL_ERROR} - SSL_R_INTERNAL_ERROR = 157; - {$EXTERNALSYM SSL_R_INVALID_CHALLENGE_LENGTH} - SSL_R_INVALID_CHALLENGE_LENGTH = 158; - {$EXTERNALSYM SSL_R_INVALID_COMMAND} - SSL_R_INVALID_COMMAND = 280; - {$EXTERNALSYM SSL_R_INVALID_PURPOSE} - SSL_R_INVALID_PURPOSE = 278; - {$EXTERNALSYM SSL_R_INVALID_STATUS_RESPONSE} - SSL_R_INVALID_STATUS_RESPONSE = 316; - {$EXTERNALSYM SSL_R_INVALID_TICKET_KEYS_LENGTH} - SSL_R_INVALID_TICKET_KEYS_LENGTH = 275; - {$EXTERNALSYM SSL_R_INVALID_TRUST} - SSL_R_INVALID_TRUST = 279; - {$EXTERNALSYM SSL_R_LENGTH_MISMATCH} - SSL_R_LENGTH_MISMATCH = 159; - {$EXTERNALSYM SSL_R_LENGTH_TOO_SHORT} - SSL_R_LENGTH_TOO_SHORT = 160; - {$EXTERNALSYM SSL_R_LIBRARY_BUG} - SSL_R_LIBRARY_BUG = 274; - {$EXTERNALSYM SSL_R_LIBRARY_HAS_NO_CIPHERS} - SSL_R_LIBRARY_HAS_NO_CIPHERS = 161; - {$EXTERNALSYM SSL_R_MISSING_DH_DSA_CERT} - SSL_R_MISSING_DH_DSA_CERT = 162; - {$EXTERNALSYM SSL_R_MISSING_DH_KEY} - SSL_R_MISSING_DH_KEY = 163; - {$EXTERNALSYM SSL_R_MISSING_DH_RSA_CERT} - SSL_R_MISSING_DH_RSA_CERT = 164; - {$EXTERNALSYM SSL_R_MISSING_DSA_SIGNING_CERT} - SSL_R_MISSING_DSA_SIGNING_CERT = 165; - {$EXTERNALSYM SSL_R_MISSING_EXPORT_TMP_DH_KEY} - SSL_R_MISSING_EXPORT_TMP_DH_KEY = 166; - {$EXTERNALSYM SSL_R_MISSING_EXPORT_TMP_RSA_KEY} - SSL_R_MISSING_EXPORT_TMP_RSA_KEY = 167; - {$EXTERNALSYM SSL_R_MISSING_RSA_CERTIFICATE} - SSL_R_MISSING_RSA_CERTIFICATE = 168; - {$EXTERNALSYM SSL_R_MISSING_RSA_ENCRYPTING_CERT} - SSL_R_MISSING_RSA_ENCRYPTING_CERT = 169; - {$EXTERNALSYM SSL_R_MISSING_RSA_SIGNING_CERT} - SSL_R_MISSING_RSA_SIGNING_CERT = 170; - {$EXTERNALSYM SSL_R_MISSING_TMP_DH_KEY} - SSL_R_MISSING_TMP_DH_KEY = 171; - {$EXTERNALSYM SSL_R_MISSING_TMP_RSA_KEY} - SSL_R_MISSING_TMP_RSA_KEY = 172; - {$EXTERNALSYM SSL_R_MISSING_TMP_RSA_PKEY} - SSL_R_MISSING_TMP_RSA_PKEY = 173; - {$EXTERNALSYM SSL_R_MISSING_VERIFY_MESSAGE} - SSL_R_MISSING_VERIFY_MESSAGE = 174; - {$EXTERNALSYM SSL_R_MULTIPLE_SGC_RESTARTS} - SSL_R_MULTIPLE_SGC_RESTARTS = 346; - {$EXTERNALSYM SSL_R_NON_SSLV2_INITIAL_PACKET} - SSL_R_NON_SSLV2_INITIAL_PACKET = 175; - {$EXTERNALSYM SSL_R_NO_CERTIFICATES_RETURNED} - SSL_R_NO_CERTIFICATES_RETURNED = 176; - {$EXTERNALSYM SSL_R_NO_CERTIFICATE_ASSIGNED} - SSL_R_NO_CERTIFICATE_ASSIGNED = 177; - {$EXTERNALSYM SSL_R_NO_CERTIFICATE_RETURNED} - SSL_R_NO_CERTIFICATE_RETURNED = 178; - {$EXTERNALSYM SSL_R_NO_CERTIFICATE_SET} - SSL_R_NO_CERTIFICATE_SET = 179; - {$EXTERNALSYM SSL_R_NO_CERTIFICATE_SPECIFIED} - SSL_R_NO_CERTIFICATE_SPECIFIED = 180; - {$EXTERNALSYM SSL_R_NO_CIPHERS_AVAILABLE} - SSL_R_NO_CIPHERS_AVAILABLE = 181; - {$EXTERNALSYM SSL_R_NO_CIPHERS_PASSED} - SSL_R_NO_CIPHERS_PASSED = 182; - {$EXTERNALSYM SSL_R_NO_CIPHERS_SPECIFIED} - SSL_R_NO_CIPHERS_SPECIFIED = 183; - {$EXTERNALSYM SSL_R_NO_CIPHER_LIST} - SSL_R_NO_CIPHER_LIST = 184; - {$EXTERNALSYM SSL_R_NO_CIPHER_MATCH} - SSL_R_NO_CIPHER_MATCH = 185; - {$EXTERNALSYM SSL_R_NO_CLIENT_CERT_METHOD} - SSL_R_NO_CLIENT_CERT_METHOD = 317; - {$EXTERNALSYM SSL_R_NO_CLIENT_CERT_RECEIVED} - SSL_R_NO_CLIENT_CERT_RECEIVED = 186; - {$EXTERNALSYM SSL_R_NO_COMPRESSION_SPECIFIED} - SSL_R_NO_COMPRESSION_SPECIFIED = 187; - {$EXTERNALSYM SSL_R_NO_METHOD_SPECIFIED} - SSL_R_NO_METHOD_SPECIFIED = 188; - {$EXTERNALSYM SSL_R_NO_PRIVATEKEY} - SSL_R_NO_PRIVATEKEY = 189; - {$EXTERNALSYM SSL_R_NO_PRIVATE_KEY_ASSIGNED} - SSL_R_NO_PRIVATE_KEY_ASSIGNED = 190; - {$EXTERNALSYM SSL_R_NO_PROTOCOLS_AVAILABLE} - SSL_R_NO_PROTOCOLS_AVAILABLE = 191; - {$EXTERNALSYM SSL_R_NO_PUBLICKEY} - SSL_R_NO_PUBLICKEY = 192; - //was 318 - {$EXTERNALSYM SSL_R_NO_RENEGOTIATION} - SSL_R_NO_RENEGOTIATION = 319; - {$EXTERNALSYM SSL_R_NO_SHARED_CIPHER} - SSL_R_NO_SHARED_CIPHER = 193; - {$EXTERNALSYM SSL_R_NO_VERIFY_CALLBACK} - SSL_R_NO_VERIFY_CALLBACK = 194; - {$EXTERNALSYM SSL_R_NULL_SSL_CTX} - SSL_R_NULL_SSL_CTX = 195; - {$EXTERNALSYM SSL_R_NULL_SSL_METHOD_PASSED} - SSL_R_NULL_SSL_METHOD_PASSED = 196; - {$EXTERNALSYM SSL_R_OLD_SESSION_CIPHER_NOT_RETURNED} - SSL_R_OLD_SESSION_CIPHER_NOT_RETURNED = 197; - {$EXTERNALSYM SSL_R_ONLY_TLS_ALLOWED_IN_FIPS_MODE} - SSL_R_ONLY_TLS_ALLOWED_IN_FIPS_MODE = 297; - {$EXTERNALSYM SSL_R_PACKET_LENGTH_TOO_LONG} - SSL_R_PACKET_LENGTH_TOO_LONG = 198; - {$EXTERNALSYM SSL_R_PARSE_TLSEXT} - SSL_R_PARSE_TLSEXT = 223; - {$EXTERNALSYM SSL_R_PATH_TOO_LONG} - SSL_R_PATH_TOO_LONG = 270; - {$EXTERNALSYM SSL_R_PEER_DID_NOT_RETURN_A_CERTIFICATE} - SSL_R_PEER_DID_NOT_RETURN_A_CERTIFICATE = 199; - {$EXTERNALSYM SSL_R_PEER_ERROR} - SSL_R_PEER_ERROR = 200; - {$EXTERNALSYM SSL_R_PEER_ERROR_CERTIFICATE} - SSL_R_PEER_ERROR_CERTIFICATE = 201; - {$EXTERNALSYM SSL_R_PEER_ERROR_NO_CERTIFICATE} - SSL_R_PEER_ERROR_NO_CERTIFICATE = 202; - {$EXTERNALSYM SSL_R_PEER_ERROR_NO_CIPHER} - SSL_R_PEER_ERROR_NO_CIPHER = 203; - {$EXTERNALSYM SSL_R_PEER_ERROR_UNSUPPORTED_CERTIFICATE_TYPE} - SSL_R_PEER_ERROR_UNSUPPORTED_CERTIFICATE_TYPE = 204; - {$EXTERNALSYM SSL_R_PRE_MAC_LENGTH_TOO_LONG} - SSL_R_PRE_MAC_LENGTH_TOO_LONG = 205; - {$EXTERNALSYM SSL_R_PROBLEMS_MAPPING_CIPHER_FUNCTIONS} - SSL_R_PROBLEMS_MAPPING_CIPHER_FUNCTIONS = 206; - {$EXTERNALSYM SSL_R_PROTOCOL_IS_SHUTDOWN} - SSL_R_PROTOCOL_IS_SHUTDOWN = 207; - {$EXTERNALSYM SSL_R_PUBLIC_KEY_ENCRYPT_ERROR} - SSL_R_PUBLIC_KEY_ENCRYPT_ERROR = 208; - {$EXTERNALSYM SSL_R_PUBLIC_KEY_IS_NOT_RSA} - SSL_R_PUBLIC_KEY_IS_NOT_RSA = 209; - {$EXTERNALSYM SSL_R_PUBLIC_KEY_NOT_RSA} - SSL_R_PUBLIC_KEY_NOT_RSA = 210; - {$EXTERNALSYM SSL_R_READ_BIO_NOT_SET} - SSL_R_READ_BIO_NOT_SET = 211; - {$EXTERNALSYM SSL_R_READ_WRONG_PACKET_TYPE} - SSL_R_READ_WRONG_PACKET_TYPE = 212; - {$EXTERNALSYM SSL_R_RECORD_LENGTH_MISMATCH} - SSL_R_RECORD_LENGTH_MISMATCH = 213; - {$EXTERNALSYM SSL_R_RECORD_TOO_LARGE} - SSL_R_RECORD_TOO_LARGE = 214; - {$EXTERNALSYM SSL_R_RECORD_TOO_SMALL} - SSL_R_RECORD_TOO_SMALL = 298; - {$EXTERNALSYM SSL_R_RENEGOTIATE_EXT_TOO_LONG} - SSL_R_RENEGOTIATE_EXT_TOO_LONG = 320; - {$EXTERNALSYM SSL_R_RENEGOTIATION_ENCODING_ERR} - SSL_R_RENEGOTIATION_ENCODING_ERR = 321; - {$EXTERNALSYM SSL_R_RENEGOTIATION_MISMATCH} - SSL_R_RENEGOTIATION_MISMATCH = 322; - {$EXTERNALSYM SSL_R_REQUIRED_CIPHER_MISSING} - SSL_R_REQUIRED_CIPHER_MISSING = 215; - {$EXTERNALSYM SSL_R_REUSE_CERT_LENGTH_NOT_ZERO} - SSL_R_REUSE_CERT_LENGTH_NOT_ZERO = 216; - {$EXTERNALSYM SSL_R_REUSE_CERT_TYPE_NOT_ZERO} - SSL_R_REUSE_CERT_TYPE_NOT_ZERO = 217; - {$EXTERNALSYM SSL_R_REUSE_CIPHER_LIST_NOT_ZERO} - SSL_R_REUSE_CIPHER_LIST_NOT_ZERO = 218; - {$EXTERNALSYM SSL_R_SCSV_RECEIVED_WHEN_RENEGOTIATING} - SSL_R_SCSV_RECEIVED_WHEN_RENEGOTIATING = 324; - {$EXTERNALSYM SSL_R_SERVERHELLO_TLSEXT} - SSL_R_SERVERHELLO_TLSEXT = 224; - {$EXTERNALSYM SSL_R_SESSION_ID_CONTEXT_UNINITIALIZED} - SSL_R_SESSION_ID_CONTEXT_UNINITIALIZED = 277; - {$EXTERNALSYM SSL_R_SHORT_READ} - SSL_R_SHORT_READ = 219; - {$EXTERNALSYM SSL_R_SIGNATURE_FOR_NON_SIGNING_CERTIFICATE} - SSL_R_SIGNATURE_FOR_NON_SIGNING_CERTIFICATE = 220; - {$EXTERNALSYM SSL_R_SSL23_DOING_SESSION_ID_REUSE} - SSL_R_SSL23_DOING_SESSION_ID_REUSE = 221; - {$EXTERNALSYM SSL_R_SSL2_CONNECTION_ID_TOO_LONG} - SSL_R_SSL2_CONNECTION_ID_TOO_LONG = 299; - {$EXTERNALSYM SSL_R_SSL3_EXT_INVALID_SERVERNAME} - SSL_R_SSL3_EXT_INVALID_SERVERNAME = 225; - {$EXTERNALSYM SSL_R_SSL3_EXT_INVALID_SERVERNAME_TYPE} - SSL_R_SSL3_EXT_INVALID_SERVERNAME_TYPE = 226; - {$EXTERNALSYM SSL_R_SSL3_SESSION_ID_TOO_LONG} - SSL_R_SSL3_SESSION_ID_TOO_LONG = 300; - {$EXTERNALSYM SSL_R_SSL3_SESSION_ID_TOO_SHORT} - SSL_R_SSL3_SESSION_ID_TOO_SHORT = 222; - {$EXTERNALSYM SSL_R_SSLV3_ALERT_BAD_CERTIFICATE} - SSL_R_SSLV3_ALERT_BAD_CERTIFICATE = 1042; - {$EXTERNALSYM SSL_R_SSLV3_ALERT_BAD_RECORD_MAC} - SSL_R_SSLV3_ALERT_BAD_RECORD_MAC = 1020; - {$EXTERNALSYM SSL_R_SSLV3_ALERT_CERTIFICATE_EXPIRED} - SSL_R_SSLV3_ALERT_CERTIFICATE_EXPIRED = 1045; - {$EXTERNALSYM SSL_R_SSLV3_ALERT_CERTIFICATE_REVOKED} - SSL_R_SSLV3_ALERT_CERTIFICATE_REVOKED = 1044; - {$EXTERNALSYM SSL_R_SSLV3_ALERT_CERTIFICATE_UNKNOWN} - SSL_R_SSLV3_ALERT_CERTIFICATE_UNKNOWN = 1046; - {$EXTERNALSYM SSL_R_SSLV3_ALERT_DECOMPRESSION_FAILURE} - SSL_R_SSLV3_ALERT_DECOMPRESSION_FAILURE = 1030; - {$EXTERNALSYM SSL_R_SSLV3_ALERT_HANDSHAKE_FAILURE} - SSL_R_SSLV3_ALERT_HANDSHAKE_FAILURE = 1040; - {$EXTERNALSYM SSL_R_SSLV3_ALERT_ILLEGAL_PARAMETER} - SSL_R_SSLV3_ALERT_ILLEGAL_PARAMETER = 1047; - {$EXTERNALSYM SSL_R_SSLV3_ALERT_NO_CERTIFICATE} - SSL_R_SSLV3_ALERT_NO_CERTIFICATE = 1041; - {$EXTERNALSYM SSL_R_SSLV3_ALERT_PEER_ERROR_CERTIFICATE} - SSL_R_SSLV3_ALERT_PEER_ERROR_CERTIFICATE = 223; - {$EXTERNALSYM SSL_R_SSLV3_ALERT_PEER_ERROR_NO_CERTIFICATE} - SSL_R_SSLV3_ALERT_PEER_ERROR_NO_CERTIFICATE = 224; - {$EXTERNALSYM SSL_R_SSLV3_ALERT_PEER_ERROR_NO_CIPHER} - SSL_R_SSLV3_ALERT_PEER_ERROR_NO_CIPHER = 225; - {$EXTERNALSYM SSL_R_SSLV3_ALERT_PEER_ERROR_UNSUPPORTED_CERTIFICATE_TYPE} - SSL_R_SSLV3_ALERT_PEER_ERROR_UNSUPPORTED_CERTIFICATE_TYPE = 226; - {$EXTERNALSYM SSL_R_SSLV3_ALERT_UNEXPECTED_MESSAGE} - SSL_R_SSLV3_ALERT_UNEXPECTED_MESSAGE = 1010; - {$EXTERNALSYM SSL_R_SSLV3_ALERT_UNKNOWN_REMOTE_ERROR_TYPE} - SSL_R_SSLV3_ALERT_UNKNOWN_REMOTE_ERROR_TYPE = 227; - {$EXTERNALSYM SSL_R_SSLV3_ALERT_UNSUPPORTED_CERTIFICATE} - SSL_R_SSLV3_ALERT_UNSUPPORTED_CERTIFICATE = 1043; - {$EXTERNALSYM SSL_R_SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION} - SSL_R_SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION = 228; - {$EXTERNALSYM SSL_R_SSL_HANDSHAKE_FAILURE} - SSL_R_SSL_HANDSHAKE_FAILURE = 229; - {$EXTERNALSYM SSL_R_SSL_LIBRARY_HAS_NO_CIPHERS} - SSL_R_SSL_LIBRARY_HAS_NO_CIPHERS = 230; - {$EXTERNALSYM SSL_R_SSL_SESSION_ID_CONTEXT_TOO_LONG} - SSL_R_SSL_SESSION_ID_CONTEXT_TOO_LONG = 273; - {$EXTERNALSYM SSL_R_SSL_SESSION_ID_IS_DIFFERENT} - SSL_R_SSL_SESSION_ID_IS_DIFFERENT = 231; - {$EXTERNALSYM SSL_R_TLSV1_ALERT_ACCESS_DENIED} - SSL_R_TLSV1_ALERT_ACCESS_DENIED = 1049; - {$EXTERNALSYM SSL_R_TLSV1_ALERT_DECODE_ERROR} - SSL_R_TLSV1_ALERT_DECODE_ERROR = 1050; - {$EXTERNALSYM SSL_R_TLSV1_ALERT_DECRYPTION_FAILED} - SSL_R_TLSV1_ALERT_DECRYPTION_FAILED = 1021; - {$EXTERNALSYM SSL_R_TLSV1_ALERT_DECRYPT_ERROR} - SSL_R_TLSV1_ALERT_DECRYPT_ERROR = 1051; - {$EXTERNALSYM SSL_R_TLSV1_ALERT_EXPORT_RESTRICION} - SSL_R_TLSV1_ALERT_EXPORT_RESTRICION = 1060; - {$EXTERNALSYM SSL_R_TLSV1_ALERT_INSUFFICIENT_SECURITY} - SSL_R_TLSV1_ALERT_INSUFFICIENT_SECURITY = 1071; - {$EXTERNALSYM SSL_R_TLSV1_ALERT_INTERNAL_ERROR} - SSL_R_TLSV1_ALERT_INTERNAL_ERROR = 1080; - {$EXTERNALSYM SSL_R_TLSV1_ALERT_NO_RENEGOTIATION} - SSL_R_TLSV1_ALERT_NO_RENEGOTIATION = 1100; - {$EXTERNALSYM SSL_R_TLSV1_ALERT_PROTOCOL_VERSION} - SSL_R_TLSV1_ALERT_PROTOCOL_VERSION = 1070; - {$EXTERNALSYM SSL_R_TLSV1_ALERT_RECORD_OVERFLOW} - SSL_R_TLSV1_ALERT_RECORD_OVERFLOW = 1022; - {$EXTERNALSYM SSL_R_TLSV1_ALERT_UNKNOWN_CA} - SSL_R_TLSV1_ALERT_UNKNOWN_CA = 1048; - {$EXTERNALSYM SSL_R_TLSV1_ALERT_USER_CANCLED} - SSL_R_TLSV1_ALERT_USER_CANCLED = 1090; - {$EXTERNALSYM SSL_R_TLS_CLIENT_CERT_REQ_WITH_ANON_CIPHER} - SSL_R_TLS_CLIENT_CERT_REQ_WITH_ANON_CIPHER = 232; - {$EXTERNALSYM SSL_R_TLS_INVALID_ECPOINTFORMAT_LIST} - SSL_R_TLS_INVALID_ECPOINTFORMAT_LIST = 227; - {$EXTERNALSYM SSL_R_TLS_PEER_DID_NOT_RESPOND_WITH_CERTIFICATE_LIST} - SSL_R_TLS_PEER_DID_NOT_RESPOND_WITH_CERTIFICATE_LIST = 233; - {$EXTERNALSYM SSL_R_TLS_RSA_ENCRYPTED_VALUE_LENGTH_IS_WRONG} - SSL_R_TLS_RSA_ENCRYPTED_VALUE_LENGTH_IS_WRONG = 234; - {$EXTERNALSYM SSL_R_TRIED_TO_USE_UNSUPPORTED_CIPHER} - SSL_R_TRIED_TO_USE_UNSUPPORTED_CIPHER = 235; - {$EXTERNALSYM SSL_R_UNABLE_TO_DECODE_DH_CERTS} - SSL_R_UNABLE_TO_DECODE_DH_CERTS = 236; - {$EXTERNALSYM SSL_R_UNABLE_TO_EXTRACT_PUBLIC_KEY} - SSL_R_UNABLE_TO_EXTRACT_PUBLIC_KEY = 237; - {$EXTERNALSYM SSL_R_UNABLE_TO_FIND_DH_PARAMETERS} - SSL_R_UNABLE_TO_FIND_DH_PARAMETERS = 238; - {$EXTERNALSYM SSL_R_UNABLE_TO_FIND_PUBLIC_KEY_PARAMETERS} - SSL_R_UNABLE_TO_FIND_PUBLIC_KEY_PARAMETERS = 239; - {$EXTERNALSYM SSL_R_UNABLE_TO_FIND_SSL_METHOD} - SSL_R_UNABLE_TO_FIND_SSL_METHOD = 240; - {$EXTERNALSYM SSL_R_UNABLE_TO_LOAD_SSL2_MD5_ROUTINES} - SSL_R_UNABLE_TO_LOAD_SSL2_MD5_ROUTINES = 241; - {$EXTERNALSYM SSL_R_UNABLE_TO_LOAD_SSL3_MD5_ROUTINES} - SSL_R_UNABLE_TO_LOAD_SSL3_MD5_ROUTINES = 242; - {$EXTERNALSYM SSL_R_UNABLE_TO_LOAD_SSL3_SHA1_ROUTINES} - SSL_R_UNABLE_TO_LOAD_SSL3_SHA1_ROUTINES = 243; - {$EXTERNALSYM SSL_R_UNEXPECTED_MESSAGE} - SSL_R_UNEXPECTED_MESSAGE = 244; - {$EXTERNALSYM SSL_R_UNEXPECTED_RECORD} - SSL_R_UNEXPECTED_RECORD = 245; - {$EXTERNALSYM SSL_R_UNINITIALIZED} - SSL_R_UNINITIALIZED = 276; - {$EXTERNALSYM SSL_R_UNKNOWN_ALERT_TYPE} - SSL_R_UNKNOWN_ALERT_TYPE = 246; - {$EXTERNALSYM SSL_R_UNKNOWN_CERTIFICATE_TYPE} - SSL_R_UNKNOWN_CERTIFICATE_TYPE = 247; - {$EXTERNALSYM SSL_R_UNKNOWN_CIPHER_RETURNED} - SSL_R_UNKNOWN_CIPHER_RETURNED = 248; - {$EXTERNALSYM SSL_R_UNKNOWN_CIPHER_TYPE} - SSL_R_UNKNOWN_CIPHER_TYPE = 249; - {$EXTERNALSYM SSL_R_UNKNOWN_KEY_EXCHANGE_TYPE} - SSL_R_UNKNOWN_KEY_EXCHANGE_TYPE = 250; - {$EXTERNALSYM SSL_R_UNKNOWN_PKEY_TYPE} - SSL_R_UNKNOWN_PKEY_TYPE = 251; - {$EXTERNALSYM SSL_R_UNKNOWN_PROTOCOL} - SSL_R_UNKNOWN_PROTOCOL = 252; - {$EXTERNALSYM SSL_R_UNKNOWN_REMOTE_ERROR_TYPE} - SSL_R_UNKNOWN_REMOTE_ERROR_TYPE = 253; - {$EXTERNALSYM SSL_R_UNKNOWN_SSL_VERSION} - SSL_R_UNKNOWN_SSL_VERSION = 254; - {$EXTERNALSYM SSL_R_UNSUPPORTED_STATUS_TYPE} - SSL_R_UNSUPPORTED_STATUS_TYPE = 329; - {$EXTERNALSYM SSL_R_UNKNOWN_STATE} - SSL_R_UNKNOWN_STATE = 255; - {$EXTERNALSYM SSL_R_UNSAFE_LEGACY_RENEGOTIATION_DISABLED} - SSL_R_UNSAFE_LEGACY_RENEGOTIATION_DISABLED = 323; - {$EXTERNALSYM SSL_R_UNSUPPORTED_CIPHER} - SSL_R_UNSUPPORTED_CIPHER = 256; - {$EXTERNALSYM SSL_R_UNSUPPORTED_COMPRESSION_ALGORITHM} - SSL_R_UNSUPPORTED_COMPRESSION_ALGORITHM = 257; - {$EXTERNALSYM SSL_R_UNSUPPORTED_DIGEST_TYPE} - SSL_R_UNSUPPORTED_DIGEST_TYPE = 326; - {$EXTERNALSYM SSL_R_UNSUPPORTED_PROTOCOL} - SSL_R_UNSUPPORTED_PROTOCOL = 258; - {$EXTERNALSYM SSL_R_UNSUPPORTED_SSL_VERSION} - SSL_R_UNSUPPORTED_SSL_VERSION = 259; - {$EXTERNALSYM SSL_R_USE_SRTP_NOT_NEGOTIATED} - SSL_R_USE_SRTP_NOT_NEGOTIATED = 369; - {$EXTERNALSYM SSL_R_WRITE_BIO_NOT_SET} - SSL_R_WRITE_BIO_NOT_SET = 260; - {$EXTERNALSYM SSL_R_WRONG_CIPHER_RETURNED} - SSL_R_WRONG_CIPHER_RETURNED = 261; - {$EXTERNALSYM SSL_R_WRONG_MESSAGE_TYPE} - SSL_R_WRONG_MESSAGE_TYPE = 262; - {$EXTERNALSYM SSL_R_WRONG_NUMBER_OF_KEY_BITS} - SSL_R_WRONG_NUMBER_OF_KEY_BITS = 263; - {$EXTERNALSYM SSL_R_WRONG_SIGNATURE_LENGTH} - SSL_R_WRONG_SIGNATURE_LENGTH = 264; - {$EXTERNALSYM SSL_R_WRONG_SIGNATURE_SIZE} - SSL_R_WRONG_SIGNATURE_SIZE = 265; - {$EXTERNALSYM SSL_R_WRONG_SIGNATURE_TYPE} - SSL_R_WRONG_SIGNATURE_TYPE = 370; - {$EXTERNALSYM SSL_R_WRONG_SSL_VERSION} - SSL_R_WRONG_SSL_VERSION = 266; - {$EXTERNALSYM SSL_R_WRONG_VERSION_NUMBER} - SSL_R_WRONG_VERSION_NUMBER = 267; - {$EXTERNALSYM SSL_R_X509_LIB} - SSL_R_X509_LIB = 268; - {$EXTERNALSYM SSL_R_X509_VERIFICATION_SETUP_PROBLEMS} - SSL_R_X509_VERIFICATION_SETUP_PROBLEMS = 269; - {$EXTERNALSYM SSL_SENT_SHUTDOWN} - SSL_SENT_SHUTDOWN = 1; - {$EXTERNALSYM SSL_SESSION_ASN1_VERSION} - SSL_SESSION_ASN1_VERSION = $0001; - {$EXTERNALSYM SSL_SESSION_CACHE_MAX_SIZE_DEFAULT} - SSL_SESSION_CACHE_MAX_SIZE_DEFAULT = 1024*20; - {$EXTERNALSYM SSL_SESS_CACHE_CLIENT} - SSL_SESS_CACHE_CLIENT = $0001; - {$EXTERNALSYM SSL_SESS_CACHE_SERVER} - SSL_SESS_CACHE_SERVER = $0002; - {$EXTERNALSYM SSL_SESS_CACHE_BOTH} - SSL_SESS_CACHE_BOTH = SSL_SESS_CACHE_CLIENT or SSL_SESS_CACHE_SERVER; - {$EXTERNALSYM SSL_SESS_CACHE_NO_AUTO_CLEAR} - SSL_SESS_CACHE_NO_AUTO_CLEAR = $0080; - {$EXTERNALSYM SSL_SESS_CACHE_NO_INTERNAL_LOOKUP} - SSL_SESS_CACHE_NO_INTERNAL_LOOKUP = $0100; - {$EXTERNALSYM SSL_SESS_CACHE_OFF} - SSL_SESS_CACHE_OFF = $0000; - {$ifndef OPENSSL_NO_NEXTPROTONEG} - {$EXTERNALSYM OPENSSL_NPN_UNSUPPORTED} - OPENSSL_NPN_UNSUPPORTED = 0; - {$EXTERNALSYM OPENSSL_NPN_NEGOTIATED} - OPENSSL_NPN_NEGOTIATED = 1; - {$EXTERNALSYM OPENSSL_NPN_NO_OVERLAP} - OPENSSL_NPN_NO_OVERLAP = 2; - {$endif} -{$ifndef OPENSSL_NO_PSK} -//* the maximum length of the buffer given to callbacks containing the -// * resulting identity/psk */ - {$EXTERNALSYM PSK_MAX_IDENTITY_LEN} - PSK_MAX_IDENTITY_LEN = 128; - {$EXTERNALSYM PSK_MAX_PSK_LEN} - PSK_MAX_PSK_LEN = 256; -{$endif} - - - - {$EXTERNALSYM SSL_TXT_LOW} - SSL_TXT_LOW = 'LOW'; {Do not localize} - {$EXTERNALSYM SSL_TXT_MEDIUM} - SSL_TXT_MEDIUM = 'MEDIUM'; {Do not localize} - {$EXTERNALSYM SSL_TXT_HIGH} - SSL_TXT_HIGH = 'HIGH'; {Do not localize} - {$EXTERNALSYM SSL_TXT_FIPS} - SSL_TXT_FIPS = 'FIPS'; {Do not localize} - {$EXTERNALSYM SSL_TXT_kFZA} - SSL_TXT_kFZA = 'kFZA'; {Do not localize} - {$EXTERNALSYM SSL_TXT_aFZA} - SSL_TXT_aFZA = 'aFZA'; {Do not localize} - {$EXTERNALSYM SSL_TXT_eFZA} - SSL_TXT_eFZA = 'eFZA'; {Do not localize} - {$EXTERNALSYM SSL_TXT_FZA} - SSL_TXT_FZA = 'FZA'; {Do not localize} - {$EXTERNALSYM SSL_TXT_aNULL} - SSL_TXT_aNULL = 'aNULL'; {Do not localize} - {$EXTERNALSYM SSL_TXT_eNULL} - SSL_TXT_eNULL = 'eNULL'; {Do not localize} - {$EXTERNALSYM SSL_TXT_NULL} - SSL_TXT_NULL = 'NULL'; {Do not localize} - {$EXTERNALSYM SSL_TXT_kKRB5} - SSL_TXT_kKRB5 = 'kKRB5';{Do not localize} - {$EXTERNALSYM SSL_TXT_aKRB5} - SSL_TXT_aKRB5 ='aKRB5';{Do not localize} - {$EXTERNALSYM SSL_TXT_KRB5} - SSL_TXT_KRB5 = 'KRB5';{Do not localize} - {$EXTERNALSYM SSL_TXT_kRSA} - SSL_TXT_kRSA = 'kRSA'; {Do not localize} - {$EXTERNALSYM SSL_TXT_kDHr} - SSL_TXT_kDHr = 'kDHr'; {Do not localize} - {$EXTERNALSYM SSL_TXT_kDHd} - SSL_TXT_kDHd = 'kDHd'; {Do not localize} - {$EXTERNALSYM SSL_TXT_kEDH} - SSL_TXT_kEDH = 'kEDH'; {Do not localize} - {$EXTERNALSYM SSL_TXT_aRSA} - SSL_TXT_aRSA = 'aRSA'; {Do not localize} - {$EXTERNALSYM SSL_TXT_aDSS} - SSL_TXT_aDSS = 'aDSS'; {Do not localize} - {$EXTERNALSYM SSL_TXT_aDH} - SSL_TXT_aDH = 'aDH'; {Do not localize} - {$EXTERNALSYM SSL_TXT_RSA} - SSL_TXT_RSA = 'RSA'; {Do not localize} - {$EXTERNALSYM SSL_TXT_DH} - SSL_TXT_DH = 'DH'; {Do not localize} - {$EXTERNALSYM SSL_TXT_EDH} - SSL_TXT_EDH = 'EDH'; {Do not localize} - {$EXTERNALSYM SSL_TXT_ADH_C} - SSL_TXT_ADH_C = 'ADH'; {Do not localize} - {$EXTERNALSYM SSL_TXT_aDH_S} - SSL_TXT_aDH_S = 'aDH'; {Do not localize} - {$EXTERNALSYM SSL_TXT_DSS} - SSL_TXT_DSS = 'DSS'; {Do not localize} - {$EXTERNALSYM SSL_TXT_DES} - SSL_TXT_DES = 'DES'; {Do not localize} - {$EXTERNALSYM SSL_TXT_3DES} - SSL_TXT_3DES = '3DES'; {Do not localize} - {$EXTERNALSYM SSL_TXT_RC4} - SSL_TXT_RC4 = 'RC4'; {Do not localize} - {$EXTERNALSYM SSL_TXT_RC2} - SSL_TXT_RC2 = 'RC2'; {Do not localize} - {$EXTERNALSYM SSL_TXT_IDEA} - SSL_TXT_IDEA = 'IDEA'; {Do not localize} - {$EXTERNALSYM SSL_TXT_SEED} - SSL_TXT_SEED = 'SEED'; {Do not localize} - {$EXTERNALSYM SSL_TXT_AES} - SSL_TXT_AES = 'AES'; {Do not localize} - {$EXTERNALSYM SSL_TXT_CAMELLIA} - SSL_TXT_CAMELLIA = 'CAMELLIA'; {Do not localize} - {$EXTERNALSYM SSL_TXT_MD5} - SSL_TXT_MD5 = 'MD5'; {Do not localize} - {$EXTERNALSYM SSL_TXT_SHA1} - SSL_TXT_SHA1 = 'SHA1'; {Do not localize} - {$EXTERNALSYM SSL_TXT_SHA} - SSL_TXT_SHA = 'SHA'; {Do not localize} - {$EXTERNALSYM SSL_TXT_EXP} - SSL_TXT_EXP = 'EXP'; {Do not localize} - {$EXTERNALSYM SSL_TXT_EXPORT} - SSL_TXT_EXPORT = 'EXPORT'; {Do not localize} - {$EXTERNALSYM SSL_TXT_EXP40} - SSL_TXT_EXP40 = 'EXPORT40'; {Do not localize} - {$EXTERNALSYM SSL_TXT_EXP56} - SSL_TXT_EXP56 = 'EXPORT56'; {Do not localize} - {$EXTERNALSYM SSL_TXT_SSLV2} - SSL_TXT_SSLV2 = 'SSLv2'; {Do not localize} - {$EXTERNALSYM SSL_TXT_SSLV3} - SSL_TXT_SSLV3 = 'SSLv3'; {Do not localize} - {$EXTERNALSYM SSL_TXT_TLSV1} - SSL_TXT_TLSV1 = 'TLSv1'; {Do not localize} - {$EXTERNALSYM SSL_TXT_ALL} - SSL_TXT_ALL = 'ALL'; {Do not localize} - {$EXTERNALSYM SSL_TXT_ECC} - SSL_TXT_ECC = 'ECCdraft'; //* ECC ciphersuites are not yet official */ - {$EXTERNALSYM SSL_TXT_DES_192_EDE3_CBC_WITH_MD5} - SSL_TXT_DES_192_EDE3_CBC_WITH_MD5 = SSL2_TXT_DES_192_EDE3_CBC_WITH_MD5; - {$EXTERNALSYM SSL_TXT_DES_192_EDE3_CBC_WITH_SHA} - SSL_TXT_DES_192_EDE3_CBC_WITH_SHA = SSL2_TXT_DES_192_EDE3_CBC_WITH_SHA; - {$EXTERNALSYM SSL_TXT_DES_64_CBC_WITH_MD5} - SSL_TXT_DES_64_CBC_WITH_MD5 = SSL2_TXT_DES_64_CBC_WITH_MD5; - {$EXTERNALSYM SSL_TXT_DES_64_CBC_WITH_SHA} - SSL_TXT_DES_64_CBC_WITH_SHA = SSL2_TXT_DES_64_CBC_WITH_SHA; - {$EXTERNALSYM SSL_TXT_IDEA_128_CBC_WITH_MD5} - SSL_TXT_IDEA_128_CBC_WITH_MD5 = SSL2_TXT_IDEA_128_CBC_WITH_MD5; - {$EXTERNALSYM SSL_TXT_NULL_WITH_MD5} - SSL_TXT_NULL_WITH_MD5 = SSL2_TXT_NULL_WITH_MD5; - {$EXTERNALSYM SSL_TXT_RC2_128_CBC_EXPORT40_WITH_MD5} - SSL_TXT_RC2_128_CBC_EXPORT40_WITH_MD5 = SSL2_TXT_RC2_128_CBC_EXPORT40_WITH_MD5; - {$EXTERNALSYM SSL_TXT_RC2_128_CBC_WITH_MD5} - SSL_TXT_RC2_128_CBC_WITH_MD5 = SSL2_TXT_RC2_128_CBC_WITH_MD5; - {$EXTERNALSYM SSL_TXT_RC4_128_EXPORT40_WITH_MD5} - SSL_TXT_RC4_128_EXPORT40_WITH_MD5 = SSL2_TXT_RC4_128_EXPORT40_WITH_MD5; - {$EXTERNALSYM SSL_TXT_RC4_128_WITH_MD5} - SSL_TXT_RC4_128_WITH_MD5 = SSL2_TXT_RC4_128_WITH_MD5; - {$EXTERNALSYM SSL_VERIFY_CLIENT_ONCE} - SSL_VERIFY_CLIENT_ONCE = $04; - {$EXTERNALSYM SSL_VERIFY_FAIL_IF_NO_PEER_CERT} - SSL_VERIFY_FAIL_IF_NO_PEER_CERT = $02; - {$EXTERNALSYM SSL_VERIFY_NONE} - SSL_VERIFY_NONE = $00; - {$EXTERNALSYM SSL_VERIFY_PEER} - SSL_VERIFY_PEER = $01; - - {$EXTERNALSYM SSL_MAC_FLAG_READ_MAC_STREAM} - SSL_MAC_FLAG_READ_MAC_STREAM = 1; - {$EXTERNALSYM SSL_MAC_FLAG_WRITE_MAC_STREAM} - SSL_MAC_FLAG_WRITE_MAC_STREAM = 2; - {$EXTERNALSYM TLS1_ALLOW_EXPERIMENTAL_CIPHERSUITES} - TLS1_ALLOW_EXPERIMENTAL_CIPHERSUITES = 0; - {$EXTERNALSYM TLS1_2_VERSION} - TLS1_2_VERSION = $0303; - {$EXTERNALSYM TLS1_2_VERSION_MAJOR} - TLS1_2_VERSION_MAJOR = $03; - {$EXTERNALSYM TLS1_2_VERSION_MINOR} - TLS1_2_VERSION_MINOR = $03; - {$EXTERNALSYM TLS1_1_VERSION} - TLS1_1_VERSION = $0302; - {$EXTERNALSYM TLS1_1_VERSION_MAJOR} - TLS1_1_VERSION_MAJOR = $03; - {$EXTERNALSYM TLS1_1_VERSION_MINOR} - TLS1_1_VERSION_MINOR = $02; - {$EXTERNALSYM TLS1_VERSION} - TLS1_VERSION = $0301; - {$EXTERNALSYM TLS1_VERSION_MAJOR} - TLS1_VERSION_MAJOR = $03; - {$EXTERNALSYM TLS1_VERSION_MINOR} - TLS1_VERSION_MINOR = $01; - - {$IFNDEF OPENSSL_NO_HEARTBEATS} - {$EXTERNALSYM SSL_TLSEXT_HB_ENABLED} - SSL_TLSEXT_HB_ENABLED = $01; - {$EXTERNALSYM SSL_TLSEXT_HB_DONT_SEND_REQUESTS} - SSL_TLSEXT_HB_DONT_SEND_REQUESTS = $02; - {$EXTERNALSYM SSL_TLSEXT_HB_DONT_RECV_REQUESTS} - SSL_TLSEXT_HB_DONT_RECV_REQUESTS = $04; - - {$ENDIF} - - //* PSK ciphersuites from 4279 */ - {$EXTERNALSYM TLS1_CK_PSK_WITH_RC4_128_SHA} - TLS1_CK_PSK_WITH_RC4_128_SHA = $0300008A; - {$EXTERNALSYM TLS1_CK_PSK_WITH_3DES_EDE_CBC_SHA} - TLS1_CK_PSK_WITH_3DES_EDE_CBC_SHA = $0300008B; - {$EXTERNALSYM TLS1_CK_PSK_WITH_AES_128_CBC_SHA} - TLS1_CK_PSK_WITH_AES_128_CBC_SHA = $0300008C; - {$EXTERNALSYM TLS1_CK_PSK_WITH_AES_256_CBC_SHA} - TLS1_CK_PSK_WITH_AES_256_CBC_SHA = $0300008D; - - {$EXTERNALSYM TLS1_CK_RSA_EXPORT1024_WITH_RC4_56_MD5} - TLS1_CK_RSA_EXPORT1024_WITH_RC4_56_MD5 = $03000060; - {$EXTERNALSYM TLS1_CK_RSA_EXPORT1024_WITH_RC2_CBC_56_MD5} - TLS1_CK_RSA_EXPORT1024_WITH_RC2_CBC_56_MD5 = $03000061; - {$EXTERNALSYM TLS1_CK_RSA_EXPORT1024_WITH_DES_CBC_SHA} - TLS1_CK_RSA_EXPORT1024_WITH_DES_CBC_SHA = $03000062; - {$EXTERNALSYM TLS1_CK_DHE_DSS_EXPORT1024_WITH_DES_CBC_SHA} - TLS1_CK_DHE_DSS_EXPORT1024_WITH_DES_CBC_SHA = $03000063; - {$EXTERNALSYM TLS1_CK_RSA_EXPORT1024_WITH_RC4_56_SHA} - TLS1_CK_RSA_EXPORT1024_WITH_RC4_56_SHA = $03000064; - {$EXTERNALSYM TLS1_CK_DHE_DSS_EXPORT1024_WITH_RC4_56_SHA} - TLS1_CK_DHE_DSS_EXPORT1024_WITH_RC4_56_SHA = $03000065; - {$EXTERNALSYM TLS1_CK_DHE_DSS_WITH_RC4_128_SHA} - TLS1_CK_DHE_DSS_WITH_RC4_128_SHA = $03000066; -//* AES ciphersuites from RFC3268 */ - {$EXTERNALSYM TLS1_CK_RSA_WITH_AES_128_SHA} - TLS1_CK_RSA_WITH_AES_128_SHA = $0300002F; - {$EXTERNALSYM TLS1_CK_DH_DSS_WITH_AES_128_SHA} - TLS1_CK_DH_DSS_WITH_AES_128_SHA = $03000030; - {$EXTERNALSYM TLS1_CK_DH_RSA_WITH_AES_128_SHA} - TLS1_CK_DH_RSA_WITH_AES_128_SHA = $03000031; - {$EXTERNALSYM TLS1_CK_DHE_DSS_WITH_AES_128_SHA} - TLS1_CK_DHE_DSS_WITH_AES_128_SHA = $03000032; - {$EXTERNALSYM TLS1_CK_DHE_RSA_WITH_AES_128_SHA} - TLS1_CK_DHE_RSA_WITH_AES_128_SHA = $03000033; - {$EXTERNALSYM TLS1_CK_ADH_WITH_AES_128_SHA} - TLS1_CK_ADH_WITH_AES_128_SHA = $03000034; - {$EXTERNALSYM TLS1_CK_RSA_WITH_AES_256_SHA} - TLS1_CK_RSA_WITH_AES_256_SHA = $03000035; - {$EXTERNALSYM TLS1_CK_DH_DSS_WITH_AES_256_SHA} - TLS1_CK_DH_DSS_WITH_AES_256_SHA = $03000036; - {$EXTERNALSYM TLS1_CK_DH_RSA_WITH_AES_256_SHA} - TLS1_CK_DH_RSA_WITH_AES_256_SHA = $03000037; - {$EXTERNALSYM TLS1_CK_DHE_DSS_WITH_AES_256_SHA} - TLS1_CK_DHE_DSS_WITH_AES_256_SHA = $03000038; - {$EXTERNALSYM TLS1_CK_DHE_RSA_WITH_AES_256_SHA} - TLS1_CK_DHE_RSA_WITH_AES_256_SHA = $03000039; - {$EXTERNALSYM TLS1_CK_ADH_WITH_AES_256_SHA} - TLS1_CK_ADH_WITH_AES_256_SHA = $0300003A; -//* TLS v1.2 ciphersuites */ - {$EXTERNALSYM TLS1_CK_RSA_WITH_NULL_SHA256} - TLS1_CK_RSA_WITH_NULL_SHA256 = $0300003B; - {$EXTERNALSYM TLS1_CK_RSA_WITH_AES_128_SHA256} - TLS1_CK_RSA_WITH_AES_128_SHA256 = $0300003C; - {$EXTERNALSYM TLS1_CK_RSA_WITH_AES_256_SHA256} - TLS1_CK_RSA_WITH_AES_256_SHA256 = $0300003D; - {$EXTERNALSYM TLS1_CK_DH_DSS_WITH_AES_128_SHA256} - TLS1_CK_DH_DSS_WITH_AES_128_SHA256 = $0300003E; - {$EXTERNALSYM TLS1_CK_DH_RSA_WITH_AES_128_SHA256} - TLS1_CK_DH_RSA_WITH_AES_128_SHA256 = $0300003F; - {$EXTERNALSYM TLS1_CK_DHE_DSS_WITH_AES_128_SHA256} - TLS1_CK_DHE_DSS_WITH_AES_128_SHA256 = $03000040; - -//* Camellia ciphersuites from RFC4132 */ - {$EXTERNALSYM TLS1_CK_RSA_WITH_CAMELLIA_128_CBC_SHA} - TLS1_CK_RSA_WITH_CAMELLIA_128_CBC_SHA = $03000041; - {$EXTERNALSYM TLS1_CK_DH_DSS_WITH_CAMELLIA_128_CBC_SHA} - TLS1_CK_DH_DSS_WITH_CAMELLIA_128_CBC_SHA = $03000042; - {$EXTERNALSYM TLS1_CK_DH_RSA_WITH_CAMELLIA_128_CBC_SHA} - TLS1_CK_DH_RSA_WITH_CAMELLIA_128_CBC_SHA = $03000043; - {$EXTERNALSYM TLS1_CK_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA} - TLS1_CK_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA = $03000044; - {$EXTERNALSYM TLS1_CK_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA} - TLS1_CK_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA = $03000045; - {$EXTERNALSYM TLS1_CK_ADH_WITH_CAMELLIA_128_CBC_SHA} - TLS1_CK_ADH_WITH_CAMELLIA_128_CBC_SHA = $03000046; - {$EXTERNALSYM TLS1_CK_RSA_WITH_CAMELLIA_256_CBC_SHA} - TLS1_CK_RSA_WITH_CAMELLIA_256_CBC_SHA = $03000084; - {$EXTERNALSYM TLS1_CK_DH_DSS_WITH_CAMELLIA_256_CBC_SHA} - TLS1_CK_DH_DSS_WITH_CAMELLIA_256_CBC_SHA = $03000085; - {$EXTERNALSYM TLS1_CK_DH_RSA_WITH_CAMELLIA_256_CBC_SHA} - TLS1_CK_DH_RSA_WITH_CAMELLIA_256_CBC_SHA = $03000086; - {$EXTERNALSYM TLS1_CK_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA} - TLS1_CK_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA = $03000087; - {$EXTERNALSYM TLS1_CK_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA} - TLS1_CK_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA = $03000088; - {$EXTERNALSYM TLS1_CK_ADH_WITH_CAMELLIA_256_CBC_SHA} - TLS1_CK_ADH_WITH_CAMELLIA_256_CBC_SHA = $03000089; - -//* TLS v1.2 ciphersuites */ - {$EXTERNALSYM TLS1_CK_DHE_RSA_WITH_AES_128_SHA256} - TLS1_CK_DHE_RSA_WITH_AES_128_SHA256 = $03000067; - {$EXTERNALSYM TLS1_CK_DH_DSS_WITH_AES_256_SHA256} - TLS1_CK_DH_DSS_WITH_AES_256_SHA256 = $03000068; - {$EXTERNALSYM TLS1_CK_DH_RSA_WITH_AES_256_SHA256} - TLS1_CK_DH_RSA_WITH_AES_256_SHA256 = $03000069; - {$EXTERNALSYM TLS1_CK_DHE_DSS_WITH_AES_256_SHA256} - TLS1_CK_DHE_DSS_WITH_AES_256_SHA256 = $0300006A; - {$EXTERNALSYM TLS1_CK_DHE_RSA_WITH_AES_256_SHA256} - TLS1_CK_DHE_RSA_WITH_AES_256_SHA256 = $0300006B; - {$EXTERNALSYM TLS1_CK_ADH_WITH_AES_128_SHA256} - TLS1_CK_ADH_WITH_AES_128_SHA256 = $0300006C; - {$EXTERNALSYM TLS1_CK_ADH_WITH_AES_256_SHA256} - TLS1_CK_ADH_WITH_AES_256_SHA256 = $0300006D; - //* SEED ciphersuites from RFC4162 */ - {$EXTERNALSYM TLS1_CK_RSA_WITH_SEED_SHA} - TLS1_CK_RSA_WITH_SEED_SHA = $03000096; - {$EXTERNALSYM TLS1_CK_DH_DSS_WITH_SEED_SHA} - TLS1_CK_DH_DSS_WITH_SEED_SHA = $03000097; - {$EXTERNALSYM TLS1_CK_DH_RSA_WITH_SEED_SHA} - TLS1_CK_DH_RSA_WITH_SEED_SHA = $03000098; - {$EXTERNALSYM TLS1_CK_DHE_DSS_WITH_SEED_SHA} - TLS1_CK_DHE_DSS_WITH_SEED_SHA = $03000099; - {$EXTERNALSYM TLS1_CK_DHE_RSA_WITH_SEED_SHA} - TLS1_CK_DHE_RSA_WITH_SEED_SHA = $0300009A; - {$EXTERNALSYM TLS1_CK_ADH_WITH_SEED_SHA} - TLS1_CK_ADH_WITH_SEED_SHA = $0300009B; - -//* TLS v1.2 GCM ciphersuites from RFC5288 */ - {$EXTERNALSYM TLS1_CK_RSA_WITH_AES_128_GCM_SHA256} - TLS1_CK_RSA_WITH_AES_128_GCM_SHA256 = $0300009C; - {$EXTERNALSYM TLS1_CK_RSA_WITH_AES_256_GCM_SHA384} - TLS1_CK_RSA_WITH_AES_256_GCM_SHA384 = $0300009D; - {$EXTERNALSYM TLS1_CK_DHE_RSA_WITH_AES_128_GCM_SHA256} - TLS1_CK_DHE_RSA_WITH_AES_128_GCM_SHA256 = $0300009E; - {$EXTERNALSYM TLS1_CK_DHE_RSA_WITH_AES_256_GCM_SHA384} - TLS1_CK_DHE_RSA_WITH_AES_256_GCM_SHA384 = $0300009F; - {$EXTERNALSYM TLS1_CK_DH_RSA_WITH_AES_128_GCM_SHA256} - TLS1_CK_DH_RSA_WITH_AES_128_GCM_SHA256 = $030000A0; - {$EXTERNALSYM TLS1_CK_DH_RSA_WITH_AES_256_GCM_SHA384} - TLS1_CK_DH_RSA_WITH_AES_256_GCM_SHA384 = $030000A1; - {$EXTERNALSYM TLS1_CK_DHE_DSS_WITH_AES_128_GCM_SHA256} - TLS1_CK_DHE_DSS_WITH_AES_128_GCM_SHA256 = $030000A2; - {$EXTERNALSYM TLS1_CK_DHE_DSS_WITH_AES_256_GCM_SHA384} - TLS1_CK_DHE_DSS_WITH_AES_256_GCM_SHA384 = $030000A3; - {$EXTERNALSYM TLS1_CK_DH_DSS_WITH_AES_128_GCM_SHA256} - TLS1_CK_DH_DSS_WITH_AES_128_GCM_SHA256 = $030000A4; - {$EXTERNALSYM TLS1_CK_DH_DSS_WITH_AES_256_GCM_SHA384} - TLS1_CK_DH_DSS_WITH_AES_256_GCM_SHA384 = $030000A5; - {$EXTERNALSYM TLS1_CK_ADH_WITH_AES_128_GCM_SHA256} - TLS1_CK_ADH_WITH_AES_128_GCM_SHA256 = $030000A6; - {$EXTERNALSYM TLS1_CK_ADH_WITH_AES_256_GCM_SHA384} - TLS1_CK_ADH_WITH_AES_256_GCM_SHA384 = $030000A7; -//* ECC ciphersuites from draft-ietf-tls-ecc-12.txt with changes soon to be in draft 13 */ - {$EXTERNALSYM TLS1_CK_ECDH_ECDSA_WITH_NULL_SHA} - TLS1_CK_ECDH_ECDSA_WITH_NULL_SHA = $0300C001; - {$EXTERNALSYM TLS1_CK_ECDH_ECDSA_WITH_RC4_128_SHA} - TLS1_CK_ECDH_ECDSA_WITH_RC4_128_SHA = $0300C002; - {$EXTERNALSYM TLS1_CK_ECDH_ECDSA_WITH_DES_192_CBC3_SHA} - TLS1_CK_ECDH_ECDSA_WITH_DES_192_CBC3_SHA = $0300C003; - {$EXTERNALSYM TLS1_CK_ECDH_ECDSA_WITH_AES_128_CBC_SHA} - TLS1_CK_ECDH_ECDSA_WITH_AES_128_CBC_SHA = $0300C004; - {$EXTERNALSYM TLS1_CK_ECDH_ECDSA_WITH_AES_256_CBC_SHA} - TLS1_CK_ECDH_ECDSA_WITH_AES_256_CBC_SHA = $0300C005; - {$EXTERNALSYM TLS1_CK_ECDHE_ECDSA_WITH_NULL_SHA} - TLS1_CK_ECDHE_ECDSA_WITH_NULL_SHA = $0300C006; - {$EXTERNALSYM TLS1_CK_ECDHE_ECDSA_WITH_RC4_128_SHA} - TLS1_CK_ECDHE_ECDSA_WITH_RC4_128_SHA = $0300C007; - {$EXTERNALSYM TLS1_CK_ECDHE_ECDSA_WITH_DES_192_CBC3_SHA} - TLS1_CK_ECDHE_ECDSA_WITH_DES_192_CBC3_SHA = $0300C008; - {$EXTERNALSYM TLS1_CK_ECDHE_ECDSA_WITH_AES_128_CBC_SHA} - TLS1_CK_ECDHE_ECDSA_WITH_AES_128_CBC_SHA = $0300C009; - {$EXTERNALSYM TLS1_CK_ECDHE_ECDSA_WITH_AES_256_CBC_SHA} - TLS1_CK_ECDHE_ECDSA_WITH_AES_256_CBC_SHA = $0300C00A; - {$EXTERNALSYM TLS1_CK_ECDH_RSA_WITH_NULL_SHA} - TLS1_CK_ECDH_RSA_WITH_NULL_SHA = $0300C00B; - {$EXTERNALSYM TLS1_CK_ECDH_RSA_WITH_RC4_128_SHA} - TLS1_CK_ECDH_RSA_WITH_RC4_128_SHA = $0300C00C; - {$EXTERNALSYM TLS1_CK_ECDH_RSA_WITH_DES_192_CBC3_SHA} - TLS1_CK_ECDH_RSA_WITH_DES_192_CBC3_SHA = $0300C00D; - {$EXTERNALSYM TLS1_CK_ECDH_RSA_WITH_AES_128_CBC_SHA} - TLS1_CK_ECDH_RSA_WITH_AES_128_CBC_SHA = $0300C00E; - {$EXTERNALSYM TLS1_CK_ECDH_RSA_WITH_AES_256_CBC_SHA} - TLS1_CK_ECDH_RSA_WITH_AES_256_CBC_SHA = $0300C00F; - {$EXTERNALSYM TLS1_CK_ECDHE_RSA_WITH_NULL_SHA} - TLS1_CK_ECDHE_RSA_WITH_NULL_SHA = $0300C010; - {$EXTERNALSYM TLS1_CK_ECDHE_RSA_WITH_RC4_128_SHA} - TLS1_CK_ECDHE_RSA_WITH_RC4_128_SHA = $0300C011; - {$EXTERNALSYM TLS1_CK_ECDHE_RSA_WITH_DES_192_CBC3_SHA} - TLS1_CK_ECDHE_RSA_WITH_DES_192_CBC3_SHA = $0300C012; - {$EXTERNALSYM TLS1_CK_ECDHE_RSA_WITH_AES_128_CBC_SHA} - TLS1_CK_ECDHE_RSA_WITH_AES_128_CBC_SHA = $0300C013; - {$EXTERNALSYM TLS1_CK_ECDHE_RSA_WITH_AES_256_CBC_SHA} - TLS1_CK_ECDHE_RSA_WITH_AES_256_CBC_SHA = $0300C014; - {$EXTERNALSYM TLS1_CK_ECDH_anon_WITH_NULL_SHA} - TLS1_CK_ECDH_anon_WITH_NULL_SHA = $0300C015; - {$EXTERNALSYM TLS1_CK_ECDH_anon_WITH_RC4_128_SHA} - TLS1_CK_ECDH_anon_WITH_RC4_128_SHA = $0300C016; - {$EXTERNALSYM TLS1_CK_ECDH_anon_WITH_DES_192_CBC3_SHA} - TLS1_CK_ECDH_anon_WITH_DES_192_CBC3_SHA = $0300C017; - {$EXTERNALSYM TLS1_CK_ECDH_anon_WITH_AES_128_CBC_SHA} - TLS1_CK_ECDH_anon_WITH_AES_128_CBC_SHA = $0300C018; - {$EXTERNALSYM TLS1_CK_ECDH_anon_WITH_AES_256_CBC_SHA} - TLS1_CK_ECDH_anon_WITH_AES_256_CBC_SHA = $0300C019; -//* SRP ciphersuites from RFC 5054 */ - {$EXTERNALSYM TLS1_CK_SRP_SHA_WITH_3DES_EDE_CBC_SHA} - TLS1_CK_SRP_SHA_WITH_3DES_EDE_CBC_SHA = $0300C01A; - {$EXTERNALSYM TLS1_CK_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA} - TLS1_CK_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA = $0300C01B; - {$EXTERNALSYM TLS1_CK_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA} - TLS1_CK_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA = $0300C01C; - {$EXTERNALSYM TLS1_CK_SRP_SHA_WITH_AES_128_CBC_SHA} - TLS1_CK_SRP_SHA_WITH_AES_128_CBC_SHA = $0300C01D; - {$EXTERNALSYM TLS1_CK_SRP_SHA_RSA_WITH_AES_128_CBC_SHA} - TLS1_CK_SRP_SHA_RSA_WITH_AES_128_CBC_SHA = $0300C01E; - {$EXTERNALSYM TLS1_CK_SRP_SHA_DSS_WITH_AES_128_CBC_SHA} - TLS1_CK_SRP_SHA_DSS_WITH_AES_128_CBC_SHA = $0300C01F; - {$EXTERNALSYM TLS1_CK_SRP_SHA_WITH_AES_256_CBC_SHA} - TLS1_CK_SRP_SHA_WITH_AES_256_CBC_SHA = $0300C020; - {$EXTERNALSYM TLS1_CK_SRP_SHA_RSA_WITH_AES_256_CBC_SHA} - TLS1_CK_SRP_SHA_RSA_WITH_AES_256_CBC_SHA = $0300C021; - {$EXTERNALSYM TLS1_CK_SRP_SHA_DSS_WITH_AES_256_CBC_SHA} - TLS1_CK_SRP_SHA_DSS_WITH_AES_256_CBC_SHA = $0300C022; - -//* ECDH HMAC based ciphersuites from RFC5289 */ - - {$EXTERNALSYM TLS1_CK_ECDHE_ECDSA_WITH_AES_128_SHA256} - TLS1_CK_ECDHE_ECDSA_WITH_AES_128_SHA256 = $0300C023; - {$EXTERNALSYM TLS1_CK_ECDHE_ECDSA_WITH_AES_256_SHA384} - TLS1_CK_ECDHE_ECDSA_WITH_AES_256_SHA384 = $0300C024; - {$EXTERNALSYM TLS1_CK_ECDH_ECDSA_WITH_AES_128_SHA256} - TLS1_CK_ECDH_ECDSA_WITH_AES_128_SHA256 = $0300C025; - {$EXTERNALSYM TLS1_CK_ECDH_ECDSA_WITH_AES_256_SHA384} - TLS1_CK_ECDH_ECDSA_WITH_AES_256_SHA384 = $0300C026; - {$EXTERNALSYM TLS1_CK_ECDHE_RSA_WITH_AES_128_SHA256} - TLS1_CK_ECDHE_RSA_WITH_AES_128_SHA256 = $0300C027; - {$EXTERNALSYM TLS1_CK_ECDHE_RSA_WITH_AES_256_SHA384} - TLS1_CK_ECDHE_RSA_WITH_AES_256_SHA384 = $0300C028; - {$EXTERNALSYM TLS1_CK_ECDH_RSA_WITH_AES_128_SHA256} - TLS1_CK_ECDH_RSA_WITH_AES_128_SHA256 = $0300C029; - {$EXTERNALSYM TLS1_CK_ECDH_RSA_WITH_AES_256_SHA384} - TLS1_CK_ECDH_RSA_WITH_AES_256_SHA384 = $0300C02A; - -//* ECDH GCM based ciphersuites from RFC5289 */ - {$EXTERNALSYM TLS1_CK_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256} - TLS1_CK_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 = $0300C02B; - {$EXTERNALSYM TLS1_CK_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384} - TLS1_CK_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 = $0300C02C; - {$EXTERNALSYM TLS1_CK_ECDH_ECDSA_WITH_AES_128_GCM_SHA256} - TLS1_CK_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 = $0300C02D; - {$EXTERNALSYM TLS1_CK_ECDH_ECDSA_WITH_AES_256_GCM_SHA384} - TLS1_CK_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 = $0300C02E; - {$EXTERNALSYM TLS1_CK_ECDHE_RSA_WITH_AES_128_GCM_SHA256} - TLS1_CK_ECDHE_RSA_WITH_AES_128_GCM_SHA256 = $0300C02F; - {$EXTERNALSYM TLS1_CK_ECDHE_RSA_WITH_AES_256_GCM_SHA384} - TLS1_CK_ECDHE_RSA_WITH_AES_256_GCM_SHA384 = $0300C030; - {$EXTERNALSYM TLS1_CK_ECDH_RSA_WITH_AES_128_GCM_SHA256} - TLS1_CK_ECDH_RSA_WITH_AES_128_GCM_SHA256 = $0300C031; - {$EXTERNALSYM TLS1_CK_ECDH_RSA_WITH_AES_256_GCM_SHA384} - TLS1_CK_ECDH_RSA_WITH_AES_256_GCM_SHA384 = $0300C032; - - - {$EXTERNALSYM TLS1_FINISH_MAC_LENGTH} - TLS1_FINISH_MAC_LENGTH = 12; - {$EXTERNALSYM TLS1_TXT_RSA_EXPORT1024_WITH_RC4_56_MD5} - TLS1_TXT_RSA_EXPORT1024_WITH_RC4_56_MD5 = 'EXP1024-RC4-MD5'; - {$EXTERNALSYM TLS1_TXT_RSA_EXPORT1024_WITH_RC2_CBC_56_MD5} - TLS1_TXT_RSA_EXPORT1024_WITH_RC2_CBC_56_MD5 = 'EXP1024-RC2-CBC-MD5'; - {$EXTERNALSYM TLS1_TXT_RSA_EXPORT1024_WITH_DES_CBC_SHA} - TLS1_TXT_RSA_EXPORT1024_WITH_DES_CBC_SHA = 'EXP1024-DES-CBC-SHA'; - {$EXTERNALSYM TLS1_TXT_DHE_DSS_EXPORT1024_WITH_DES_CBC_SHA} - TLS1_TXT_DHE_DSS_EXPORT1024_WITH_DES_CBC_SHA = 'EXP1024-DHE-DSS-DES-CBC-SHA'; - {$EXTERNALSYM TLS1_TXT_RSA_EXPORT1024_WITH_RC4_56_SHA} - TLS1_TXT_RSA_EXPORT1024_WITH_RC4_56_SHA = 'EXP1024-RC4-SHA'; - {$EXTERNALSYM TLS1_TXT_DHE_DSS_EXPORT1024_WITH_RC4_56_SHA} - TLS1_TXT_DHE_DSS_EXPORT1024_WITH_RC4_56_SHA = 'EXP1024-DHE-DSS-RC4-SHA'; - {$EXTERNALSYM TLS1_TXT_DHE_DSS_WITH_RC4_128_SHA} - TLS1_TXT_DHE_DSS_WITH_RC4_128_SHA = 'DHE-DSS-RC4-SHA'; -//* AES ciphersuites from RFC3268 */ - {$EXTERNALSYM TLS1_TXT_RSA_WITH_AES_128_SHA} - TLS1_TXT_RSA_WITH_AES_128_SHA = 'AES128-SHA'; - {$EXTERNALSYM TLS1_TXT_DH_DSS_WITH_AES_128_SHA} - TLS1_TXT_DH_DSS_WITH_AES_128_SHA ='DH-DSS-AES128-SHA'; - {$EXTERNALSYM TLS1_TXT_DH_RSA_WITH_AES_128_SHA} - TLS1_TXT_DH_RSA_WITH_AES_128_SHA = 'DH-RSA-AES128-SHA'; - {$EXTERNALSYM TLS1_TXT_DHE_DSS_WITH_AES_128_SHA} - TLS1_TXT_DHE_DSS_WITH_AES_128_SHA = 'DHE-DSS-AES128-SHA'; - {$EXTERNALSYM TLS1_TXT_DHE_RSA_WITH_AES_128_SHA} - TLS1_TXT_DHE_RSA_WITH_AES_128_SHA = 'DHE-RSA-AES128-SHA'; - {$EXTERNALSYM TLS1_TXT_ADH_WITH_AES_128_SHA} - TLS1_TXT_ADH_WITH_AES_128_SHA = 'ADH-AES128-SHA'; - {$EXTERNALSYM TLS1_TXT_RSA_WITH_AES_256_SHA} - TLS1_TXT_RSA_WITH_AES_256_SHA = 'AES256-SHA'; - {$EXTERNALSYM TLS1_TXT_DH_DSS_WITH_AES_256_SHA} - TLS1_TXT_DH_DSS_WITH_AES_256_SHA ='DH-DSS-AES256-SHA'; - {$EXTERNALSYM TLS1_TXT_DH_RSA_WITH_AES_256_SHA} - TLS1_TXT_DH_RSA_WITH_AES_256_SHA = 'DH-RSA-AES256-SHA'; - {$EXTERNALSYM TLS1_TXT_DHE_DSS_WITH_AES_256_SHA} - TLS1_TXT_DHE_DSS_WITH_AES_256_SHA = 'DHE-DSS-AES256-SHA'; - {$EXTERNALSYM TLS1_TXT_DHE_RSA_WITH_AES_256_SHA} - TLS1_TXT_DHE_RSA_WITH_AES_256_SHA ='DHE-RSA-AES256-SHA'; - {$EXTERNALSYM TLS1_TXT_ADH_WITH_AES_256_SHA} - TLS1_TXT_ADH_WITH_AES_256_SHA = 'ADH-AES256-SHA'; -//* ECC ciphersuites from draft-ietf-tls-ecc-01.txt (Mar 15, 2001) */ - {$EXTERNALSYM TLS1_TXT_ECDH_ECDSA_WITH_NULL_SHA} - TLS1_TXT_ECDH_ECDSA_WITH_NULL_SHA = 'ECDH-ECDSA-NULL-SHA'; - {$EXTERNALSYM TLS1_TXT_ECDH_ECDSA_WITH_RC4_128_SHA} - TLS1_TXT_ECDH_ECDSA_WITH_RC4_128_SHA = 'ECDH-ECDSA-RC4-SHA'; - {$EXTERNALSYM TLS1_TXT_ECDH_ECDSA_WITH_DES_192_CBC3_SHA} - TLS1_TXT_ECDH_ECDSA_WITH_DES_192_CBC3_SHA = 'ECDH-ECDSA-DES-CBC3-SHA'; - {$EXTERNALSYM TLS1_TXT_ECDH_ECDSA_WITH_AES_128_CBC_SHA} - TLS1_TXT_ECDH_ECDSA_WITH_AES_128_CBC_SHA = 'ECDH-ECDSA-AES128-SHA'; - {$EXTERNALSYM TLS1_TXT_ECDH_ECDSA_WITH_AES_256_CBC_SHA} - TLS1_TXT_ECDH_ECDSA_WITH_AES_256_CBC_SHA = 'ECDH-ECDSA-AES256-SHA'; - {$EXTERNALSYM TLS1_TXT_ECDHE_ECDSA_WITH_NULL_SHA} - TLS1_TXT_ECDHE_ECDSA_WITH_NULL_SHA = 'ECDHE-ECDSA-NULL-SHA'; - {$EXTERNALSYM TLS1_TXT_ECDHE_ECDSA_WITH_RC4_128_SHA} - TLS1_TXT_ECDHE_ECDSA_WITH_RC4_128_SHA = 'ECDHE-ECDSA-RC4-SHA'; - {$EXTERNALSYM TLS1_TXT_ECDHE_ECDSA_WITH_DES_192_CBC3_SHA} - TLS1_TXT_ECDHE_ECDSA_WITH_DES_192_CBC3_SHA = 'ECDHE-ECDSA-DES-CBC3-SHA'; - {$EXTERNALSYM TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_CBC_SHA} - TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_CBC_SHA = 'ECDHE-ECDSA-AES128-SHA'; - {$EXTERNALSYM TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_CBC_SHA} - TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_CBC_SHA = 'ECDHE-ECDSA-AES256-SHA'; - {$EXTERNALSYM TLS1_TXT_ECDH_RSA_WITH_NULL_SHA} - TLS1_TXT_ECDH_RSA_WITH_NULL_SHA = 'ECDH-RSA-NULL-SHA'; - {$EXTERNALSYM TLS1_TXT_ECDH_RSA_WITH_RC4_128_SHA} - TLS1_TXT_ECDH_RSA_WITH_RC4_128_SHA = 'ECDH-RSA-RC4-SHA'; - {$EXTERNALSYM TLS1_TXT_ECDH_RSA_WITH_DES_192_CBC3_SHA} - TLS1_TXT_ECDH_RSA_WITH_DES_192_CBC3_SHA = 'ECDH-RSA-DES-CBC3-SHA'; - {$EXTERNALSYM TLS1_TXT_ECDH_RSA_WITH_AES_128_CBC_SHA} - TLS1_TXT_ECDH_RSA_WITH_AES_128_CBC_SHA = 'ECDH-RSA-AES128-SHA'; - {$EXTERNALSYM TLS1_TXT_ECDH_RSA_WITH_AES_256_CBC_SHA} - TLS1_TXT_ECDH_RSA_WITH_AES_256_CBC_SHA = 'ECDH-RSA-AES256-SHA'; - {$EXTERNALSYM TLS1_TXT_ECDHE_RSA_WITH_NULL_SHA} - TLS1_TXT_ECDHE_RSA_WITH_NULL_SHA = 'ECDHE-RSA-NULL-SHA'; - {$EXTERNALSYM TLS1_TXT_ECDHE_RSA_WITH_RC4_128_SHA} - TLS1_TXT_ECDHE_RSA_WITH_RC4_128_SHA = 'ECDHE-RSA-RC4-SHA'; - {$EXTERNALSYM TLS1_TXT_ECDHE_RSA_WITH_DES_192_CBC3_SHA} - TLS1_TXT_ECDHE_RSA_WITH_DES_192_CBC3_SHA = 'ECDHE-RSA-DES-CBC3-SHA'; - {$EXTERNALSYM TLS1_TXT_ECDHE_RSA_WITH_AES_128_CBC_SHA} - TLS1_TXT_ECDHE_RSA_WITH_AES_128_CBC_SHA = 'ECDHE-RSA-AES128-SHA'; - {$EXTERNALSYM TLS1_TXT_ECDHE_RSA_WITH_AES_256_CBC_SHA} - TLS1_TXT_ECDHE_RSA_WITH_AES_256_CBC_SHA = 'ECDHE-RSA-AES256-SHA'; - {$EXTERNALSYM TLS1_TXT_ECDH_anon_WITH_NULL_SHA} - TLS1_TXT_ECDH_anon_WITH_NULL_SHA = 'AECDH-NULL-SHA'; - {$EXTERNALSYM TLS1_TXT_ECDH_anon_WITH_RC4_128_SHA} - TLS1_TXT_ECDH_anon_WITH_RC4_128_SHA = 'AECDH-RC4-SHA'; - {$EXTERNALSYM TLS1_TXT_ECDH_anon_WITH_DES_192_CBC3_SHA} - TLS1_TXT_ECDH_anon_WITH_DES_192_CBC3_SHA = 'AECDH-DES-CBC3-SHA'; - {$EXTERNALSYM TLS1_TXT_ECDH_anon_WITH_AES_128_CBC_SHA} - TLS1_TXT_ECDH_anon_WITH_AES_128_CBC_SHA = 'AECDH-AES128-SHA'; - {$EXTERNALSYM TLS1_TXT_ECDH_anon_WITH_AES_256_CBC_SHA} - TLS1_TXT_ECDH_anon_WITH_AES_256_CBC_SHA = 'AECDH-AES256-SHA'; -//* Camellia ciphersuites from RFC4132 */ - {$EXTERNALSYM TLS1_TXT_RSA_WITH_CAMELLIA_128_CBC_SHA} - TLS1_TXT_RSA_WITH_CAMELLIA_128_CBC_SHA = 'CAMELLIA128-SHA'; - {$EXTERNALSYM TLS1_TXT_DH_DSS_WITH_CAMELLIA_128_CBC_SHA} - TLS1_TXT_DH_DSS_WITH_CAMELLIA_128_CBC_SHA = 'DH-DSS-CAMELLIA128-SHA'; - {$EXTERNALSYM TLS1_TXT_DH_RSA_WITH_CAMELLIA_128_CBC_SHA} - TLS1_TXT_DH_RSA_WITH_CAMELLIA_128_CBC_SHA = 'DH-RSA-CAMELLIA128-SHA'; - {$EXTERNALSYM TLS1_TXT_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA} - TLS1_TXT_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA = 'DHE-DSS-CAMELLIA128-SHA'; - {$EXTERNALSYM TLS1_TXT_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA} - TLS1_TXT_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA = 'DHE-RSA-CAMELLIA128-SHA'; - {$EXTERNALSYM TLS1_TXT_ADH_WITH_CAMELLIA_128_CBC_SHA} - TLS1_TXT_ADH_WITH_CAMELLIA_128_CBC_SHA = 'ADH-CAMELLIA128-SHA'; - {$EXTERNALSYM TLS1_TXT_RSA_WITH_CAMELLIA_256_CBC_SHA} - TLS1_TXT_RSA_WITH_CAMELLIA_256_CBC_SHA = 'CAMELLIA256-SHA'; - {$EXTERNALSYM TLS1_TXT_DH_DSS_WITH_CAMELLIA_256_CBC_SHA} - TLS1_TXT_DH_DSS_WITH_CAMELLIA_256_CBC_SHA = 'DH-DSS-CAMELLIA256-SHA'; - {$EXTERNALSYM TLS1_TXT_DH_RSA_WITH_CAMELLIA_256_CBC_SHA} - TLS1_TXT_DH_RSA_WITH_CAMELLIA_256_CBC_SHA = 'DH-RSA-CAMELLIA256-SHA'; - {$EXTERNALSYM TLS1_TXT_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA} - TLS1_TXT_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA = 'DHE-DSS-CAMELLIA256-SHA'; - {$EXTERNALSYM TLS1_TXT_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA} - TLS1_TXT_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA = 'DHE-RSA-CAMELLIA256-SHA'; - {$EXTERNALSYM TLS1_TXT_ADH_WITH_CAMELLIA_256_CBC_SHA} - TLS1_TXT_ADH_WITH_CAMELLIA_256_CBC_SHA = 'ADH-CAMELLIA256-SHA'; -//* SEED ciphersuites from RFC4162 */ - {$EXTERNALSYM TLS1_TXT_RSA_WITH_SEED_SHA} - TLS1_TXT_RSA_WITH_SEED_SHA = 'SEED-SHA'; - {$EXTERNALSYM TLS1_TXT_DH_DSS_WITH_SEED_SHA} - TLS1_TXT_DH_DSS_WITH_SEED_SHA = 'DH-DSS-SEED-SHA'; - {$EXTERNALSYM TLS1_TXT_DH_RSA_WITH_SEED_SHA} - TLS1_TXT_DH_RSA_WITH_SEED_SHA = 'DH-RSA-SEED-SHA'; - {$EXTERNALSYM TLS1_TXT_DHE_DSS_WITH_SEED_SHA} - TLS1_TXT_DHE_DSS_WITH_SEED_SHA = 'DHE-DSS-SEED-SHA'; - {$EXTERNALSYM TLS1_TXT_DHE_RSA_WITH_SEED_SHA} - TLS1_TXT_DHE_RSA_WITH_SEED_SHA = 'DHE-RSA-SEED-SHA'; - {$EXTERNALSYM TLS1_TXT_ADH_WITH_SEED_SHA} - TLS1_TXT_ADH_WITH_SEED_SHA = 'ADH-SEED-SHA'; -//* TLS v1.2 ciphersuites */ - {$EXTERNALSYM TLS1_TXT_RSA_WITH_NULL_SHA256} - TLS1_TXT_RSA_WITH_NULL_SHA256 = 'NULL-SHA256'; - {$EXTERNALSYM TLS1_TXT_RSA_WITH_AES_128_SHA256} - TLS1_TXT_RSA_WITH_AES_128_SHA256 = 'AES128-SHA256'; - {$EXTERNALSYM TLS1_TXT_RSA_WITH_AES_256_SHA256} - TLS1_TXT_RSA_WITH_AES_256_SHA256 = 'AES256-SHA256'; - {$EXTERNALSYM TLS1_TXT_DH_DSS_WITH_AES_128_SHA256} - TLS1_TXT_DH_DSS_WITH_AES_128_SHA256 = 'DH-DSS-AES128-SHA256'; - {$EXTERNALSYM TLS1_TXT_DH_RSA_WITH_AES_128_SHA256} - TLS1_TXT_DH_RSA_WITH_AES_128_SHA256 = 'DH-RSA-AES128-SHA256'; - {$EXTERNALSYM TLS1_TXT_DHE_DSS_WITH_AES_128_SHA256} - TLS1_TXT_DHE_DSS_WITH_AES_128_SHA256 = 'DHE-DSS-AES128-SHA256'; - {$EXTERNALSYM TLS1_TXT_DHE_RSA_WITH_AES_128_SHA256} - TLS1_TXT_DHE_RSA_WITH_AES_128_SHA256 = 'DHE-RSA-AES128-SHA256'; - {$EXTERNALSYM TLS1_TXT_DH_DSS_WITH_AES_256_SHA256} - TLS1_TXT_DH_DSS_WITH_AES_256_SHA256 = 'DH-DSS-AES256-SHA256'; - {$EXTERNALSYM TLS1_TXT_DH_RSA_WITH_AES_256_SHA256} - TLS1_TXT_DH_RSA_WITH_AES_256_SHA256 = 'DH-RSA-AES256-SHA256'; - {$EXTERNALSYM TLS1_TXT_DHE_DSS_WITH_AES_256_SHA256} - TLS1_TXT_DHE_DSS_WITH_AES_256_SHA256 = 'DHE-DSS-AES256-SHA256'; - {$EXTERNALSYM TLS1_TXT_DHE_RSA_WITH_AES_256_SHA256} - TLS1_TXT_DHE_RSA_WITH_AES_256_SHA256 = 'DHE-RSA-AES256-SHA256'; - {$EXTERNALSYM TLS1_TXT_ADH_WITH_AES_128_SHA256} - TLS1_TXT_ADH_WITH_AES_128_SHA256 = 'ADH-AES128-SHA256'; - {$EXTERNALSYM TLS1_TXT_ADH_WITH_AES_256_SHA256} - TLS1_TXT_ADH_WITH_AES_256_SHA256 = 'ADH-AES256-SHA256'; - -//* TLS v1.2 GCM ciphersuites from RFC5288 */ - {$EXTERNALSYM TLS1_TXT_RSA_WITH_AES_128_GCM_SHA256} - TLS1_TXT_RSA_WITH_AES_128_GCM_SHA256 = 'AES128-GCM-SHA256'; - {$EXTERNALSYM TLS1_TXT_RSA_WITH_AES_256_GCM_SHA384} - TLS1_TXT_RSA_WITH_AES_256_GCM_SHA384 = 'AES256-GCM-SHA384'; - {$EXTERNALSYM TLS1_TXT_DHE_RSA_WITH_AES_128_GCM_SHA256} -TLS1_TXT_DHE_RSA_WITH_AES_128_GCM_SHA256 = 'DHE-RSA-AES128-GCM-SHA256'; - {$EXTERNALSYM TLS1_TXT_DHE_RSA_WITH_AES_256_GCM_SHA384} -TLS1_TXT_DHE_RSA_WITH_AES_256_GCM_SHA384 = 'DHE-RSA-AES256-GCM-SHA384'; - {$EXTERNALSYM TLS1_TXT_DH_RSA_WITH_AES_128_GCM_SHA256} - TLS1_TXT_DH_RSA_WITH_AES_128_GCM_SHA256 = 'DH-RSA-AES128-GCM-SHA256'; - {$EXTERNALSYM TLS1_TXT_DH_RSA_WITH_AES_256_GCM_SHA384} - TLS1_TXT_DH_RSA_WITH_AES_256_GCM_SHA384 = 'DH-RSA-AES256-GCM-SHA384'; - {$EXTERNALSYM TLS1_TXT_DHE_DSS_WITH_AES_128_GCM_SHA256} - TLS1_TXT_DHE_DSS_WITH_AES_128_GCM_SHA256 = 'DHE-DSS-AES128-GCM-SHA256'; - {$EXTERNALSYM TLS1_TXT_DHE_DSS_WITH_AES_256_GCM_SHA384} - TLS1_TXT_DHE_DSS_WITH_AES_256_GCM_SHA384 = 'DHE-DSS-AES256-GCM-SHA384'; - {$EXTERNALSYM TLS1_TXT_DH_DSS_WITH_AES_128_GCM_SHA256} - TLS1_TXT_DH_DSS_WITH_AES_128_GCM_SHA256 = 'DH-DSS-AES128-GCM-SHA256'; - {$EXTERNALSYM TLS1_TXT_DH_DSS_WITH_AES_256_GCM_SHA384} - TLS1_TXT_DH_DSS_WITH_AES_256_GCM_SHA384 = 'DH-DSS-AES256-GCM-SHA384'; - {$EXTERNALSYM TLS1_TXT_ADH_WITH_AES_128_GCM_SHA256} - TLS1_TXT_ADH_WITH_AES_128_GCM_SHA256 = 'ADH-AES128-GCM-SHA256'; - {$EXTERNALSYM TLS1_TXT_ADH_WITH_AES_256_GCM_SHA384} - TLS1_TXT_ADH_WITH_AES_256_GCM_SHA384 = 'ADH-AES256-GCM-SHA384'; - -//* ECDH HMAC based ciphersuites from RFC5289 */ - - {$EXTERNALSYM TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_SHA256} - TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_SHA256 = 'ECDHE-ECDSA-AES128-SHA256'; - {$EXTERNALSYM TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_SHA384} - TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_SHA384 = 'ECDHE-ECDSA-AES256-SHA384'; - {$EXTERNALSYM TLS1_TXT_ECDH_ECDSA_WITH_AES_128_SHA256} - TLS1_TXT_ECDH_ECDSA_WITH_AES_128_SHA256 = 'ECDH-ECDSA-AES128-SHA256'; - {$EXTERNALSYM TLS1_TXT_ECDH_ECDSA_WITH_AES_256_SHA384} - TLS1_TXT_ECDH_ECDSA_WITH_AES_256_SHA384 = 'ECDH-ECDSA-AES256-SHA384'; - {$EXTERNALSYM TLS1_TXT_ECDHE_RSA_WITH_AES_128_SHA256} - TLS1_TXT_ECDHE_RSA_WITH_AES_128_SHA256 = 'ECDHE-RSA-AES128-SHA256'; - {$EXTERNALSYM TLS1_TXT_ECDHE_RSA_WITH_AES_256_SHA384} - TLS1_TXT_ECDHE_RSA_WITH_AES_256_SHA384 = 'ECDHE-RSA-AES256-SHA384'; - {$EXTERNALSYM TLS1_TXT_ECDH_RSA_WITH_AES_128_SHA256} - TLS1_TXT_ECDH_RSA_WITH_AES_128_SHA256 = 'ECDH-RSA-AES128-SHA256'; - {$EXTERNALSYM TLS1_TXT_ECDH_RSA_WITH_AES_256_SHA384} - TLS1_TXT_ECDH_RSA_WITH_AES_256_SHA384 = 'ECDH-RSA-AES256-SHA384'; - -//* ECDH GCM based ciphersuites from RFC5289 */ - {$EXTERNALSYM TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256} - TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 = 'ECDHE-ECDSA-AES128-GCM-SHA256'; - {$EXTERNALSYM TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384} - TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 = 'ECDHE-ECDSA-AES256-GCM-SHA384'; - {$EXTERNALSYM TLS1_TXT_ECDH_ECDSA_WITH_AES_128_GCM_SHA256} - TLS1_TXT_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 = 'ECDH-ECDSA-AES128-GCM-SHA256'; - {$EXTERNALSYM TLS1_TXT_ECDH_ECDSA_WITH_AES_256_GCM_SHA384} - TLS1_TXT_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 = 'ECDH-ECDSA-AES256-GCM-SHA384'; - {$EXTERNALSYM TLS1_TXT_ECDHE_RSA_WITH_AES_128_GCM_SHA256} - TLS1_TXT_ECDHE_RSA_WITH_AES_128_GCM_SHA256 = 'ECDHE-RSA-AES128-GCM-SHA256'; - {$EXTERNALSYM TLS1_TXT_ECDHE_RSA_WITH_AES_256_GCM_SHA384} - TLS1_TXT_ECDHE_RSA_WITH_AES_256_GCM_SHA384 = 'ECDHE-RSA-AES256-GCM-SHA384'; - {$EXTERNALSYM TLS1_TXT_ECDH_RSA_WITH_AES_128_GCM_SHA256} - TLS1_TXT_ECDH_RSA_WITH_AES_128_GCM_SHA256 = 'ECDH-RSA-AES128-GCM-SHA256'; - {$EXTERNALSYM TLS1_TXT_ECDH_RSA_WITH_AES_256_GCM_SHA384} - TLS1_TXT_ECDH_RSA_WITH_AES_256_GCM_SHA384 = 'ECDH-RSA-AES256-GCM-SHA384'; - - {$EXTERNALSYM TLS_CT_RSA_SIGN} - TLS_CT_RSA_SIGN = 1; - {$EXTERNALSYM TLS_CT_DSS_SIGN} - TLS_CT_DSS_SIGN = 2; - {$EXTERNALSYM TLS_CT_RSA_FIXED_DH} - TLS_CT_RSA_FIXED_DH = 3; - {$EXTERNALSYM TLS_CT_DSS_FIXED_DH} - TLS_CT_DSS_FIXED_DH = 4; - {$EXTERNALSYM TLS_CT_ECDSA_SIGN} - TLS_CT_ECDSA_SIGN = 64; - {$EXTERNALSYM TLS_CT_RSA_FIXED_ECDH} - TLS_CT_RSA_FIXED_ECDH = 65; - {$EXTERNALSYM TLS_CT_ECDSA_FIXED_ECDH} - TLS_CT_ECDSA_FIXED_ECDH = 66; - {$EXTERNALSYM TLS_CT_GOST94_SIGN} - TLS_CT_GOST94_SIGN = 21; - {$EXTERNALSYM TLS_CT_GOST01_SIGN} - TLS_CT_GOST01_SIGN = 22; -///* when correcting this number, correct also SSL3_CT_NUMBER in ssl3.h (see -// * comment there) */ - {$EXTERNALSYM TLS_CT_NUMBER} - TLS_CT_NUMBER = 9; //was 4; - - {$EXTERNALSYM TLS_MD_CLIENT_FINISH_CONST} - TLS_MD_CLIENT_FINISH_CONST = 'client finished'; {Do not localize} - {$EXTERNALSYM TLS_MD_CLIENT_FINISH_CONST_SIZE} - TLS_MD_CLIENT_FINISH_CONST_SIZE = 15; - {$EXTERNALSYM TLS_MD_SERVER_FINISH_CONST} - TLS_MD_SERVER_FINISH_CONST = 'server finished'; {Do not localize} - {$EXTERNALSYM TLS_MD_SERVER_FINISH_CONST_SIZE} - TLS_MD_SERVER_FINISH_CONST_SIZE = 15; - {$EXTERNALSYM TLS_MD_KEY_EXPANSION_CONST} - TLS_MD_KEY_EXPANSION_CONST = 'key expansion'; {Do not localize} - {$EXTERNALSYM TLS_MD_KEY_EXPANSION_CONST_SIZE} - TLS_MD_KEY_EXPANSION_CONST_SIZE = 13; - {$EXTERNALSYM TLS_MD_CLIENT_WRITE_KEY_CONST} - TLS_MD_CLIENT_WRITE_KEY_CONST = 'client write key'; {Do not localize} - {$EXTERNALSYM TLS_MD_CLIENT_WRITE_KEY_CONST_SIZE} - TLS_MD_CLIENT_WRITE_KEY_CONST_SIZE = 16; - {$EXTERNALSYM TLS_MD_SERVER_WRITE_KEY_CONST} - TLS_MD_SERVER_WRITE_KEY_CONST = 'server write key'; {Do not localize} - {$EXTERNALSYM TLS_MD_SERVER_WRITE_KEY_CONST_SIZE} - TLS_MD_SERVER_WRITE_KEY_CONST_SIZE = 16; - {$EXTERNALSYM TLS_MD_IV_BLOCK_CONST} - TLS_MD_IV_BLOCK_CONST = 'IV block'; {Do not localize} - {$EXTERNALSYM TLS_MD_IV_BLOCK_CONST_SIZE} - TLS_MD_IV_BLOCK_CONST_SIZE = 8; - {$EXTERNALSYM TLS_MD_MASTER_SECRET_CONST} - TLS_MD_MASTER_SECRET_CONST = 'master secret'; {Do not localize} - {$EXTERNALSYM TLS_MD_MASTER_SECRET_CONST_SIZE} - TLS_MD_MASTER_SECRET_CONST_SIZE = 13; - {$EXTERNALSYM TLS_MD_MAX_CONST_SIZE} - TLS_MD_MAX_CONST_SIZE = 20; - - {$EXTERNALSYM TMP_MAX} - TMP_MAX = 26; - {$EXTERNALSYM V_ASN1_APPLICATION} - V_ASN1_APPLICATION = $40; - {$EXTERNALSYM V_ASN1_APP_CHOOSE} - V_ASN1_APP_CHOOSE = -2; - {$EXTERNALSYM V_ASN1_BIT_STRING} - V_ASN1_BIT_STRING = 3; - {$EXTERNALSYM V_ASN1_BMPSTRING} - V_ASN1_BMPSTRING = 30; - {$EXTERNALSYM V_ASN1_BOOLEAN} - V_ASN1_BOOLEAN = 1; - {$EXTERNALSYM V_ASN1_CONSTRUCTED} - V_ASN1_CONSTRUCTED = $20; - {$EXTERNALSYM V_ASN1_CONTEXT_SPECIFIC} - V_ASN1_CONTEXT_SPECIFIC = $80; - {$EXTERNALSYM V_ASN1_ENUMERATED} - V_ASN1_ENUMERATED = 10; - {$EXTERNALSYM V_ASN1_EOC} - V_ASN1_EOC = 0; - {$EXTERNALSYM V_ASN1_EXTERNAL} - V_ASN1_EXTERNAL = 8; - {$EXTERNALSYM V_ASN1_GENERALIZEDTIME} - V_ASN1_GENERALIZEDTIME = 24; - {$EXTERNALSYM V_ASN1_GENERALSTRING} - V_ASN1_GENERALSTRING = 27; - {$EXTERNALSYM V_ASN1_GRAPHICSTRING} - V_ASN1_GRAPHICSTRING = 25; - {$EXTERNALSYM V_ASN1_IA5STRING} - V_ASN1_IA5STRING = 22; - {$EXTERNALSYM V_ASN1_INTEGER} - V_ASN1_INTEGER = 2; - {$EXTERNALSYM V_ASN1_ISO64STRING} - V_ASN1_ISO64STRING = 26; - {$EXTERNALSYM V_ASN1_NEG_ENUMERATED} - V_ASN1_NEG_ENUMERATED = 10+$100; - {$EXTERNALSYM V_ASN1_NEG_INTEGER} - V_ASN1_NEG_INTEGER = 2+$100; - {$EXTERNALSYM V_ASN1_NULL} - V_ASN1_NULL = 5; - {$EXTERNALSYM V_ASN1_NUMERICSTRING} - V_ASN1_NUMERICSTRING = 18; - {$EXTERNALSYM V_ASN1_OBJECT} - V_ASN1_OBJECT = 6; - {$EXTERNALSYM V_ASN1_OBJECT_DESCRIPTOR} - V_ASN1_OBJECT_DESCRIPTOR = 7; - {$EXTERNALSYM V_ASN1_OCTET_STRING} - V_ASN1_OCTET_STRING = 4; - {$EXTERNALSYM V_ASN1_PRIMATIVE_TAG} - V_ASN1_PRIMATIVE_TAG = $1f; - {$EXTERNALSYM V_ASN1_PRIMITIVE_TAG} - V_ASN1_PRIMITIVE_TAG = $1f; - {$EXTERNALSYM V_ASN1_PRINTABLESTRING} - V_ASN1_PRINTABLESTRING = 19; - {$EXTERNALSYM V_ASN1_PRIVATE} - V_ASN1_PRIVATE = $c0; - {$EXTERNALSYM V_ASN1_REAL} - V_ASN1_REAL = 9; - {$EXTERNALSYM V_ASN1_SEQUENCE} - V_ASN1_SEQUENCE = 16; - {$EXTERNALSYM V_ASN1_SET} - V_ASN1_SET = 17; - {$EXTERNALSYM V_ASN1_T61STRING} - V_ASN1_T61STRING = 20; - {$EXTERNALSYM V_ASN1_TELETEXSTRING} - V_ASN1_TELETEXSTRING = 20; - {$EXTERNALSYM V_ASN1_UNDEF} - V_ASN1_UNDEF = -1; - {$EXTERNALSYM V_ASN1_UNIVERSAL} - V_ASN1_UNIVERSAL = $00; - {$EXTERNALSYM V_ASN1_UNIVERSALSTRING} - V_ASN1_UNIVERSALSTRING = 28; - {$EXTERNALSYM V_ASN1_UTCTIME} - V_ASN1_UTCTIME = 23; - {$EXTERNALSYM V_ASN1_UTF8STRING} - V_ASN1_UTF8STRING = 12; - {$EXTERNALSYM V_ASN1_VIDEOTEXSTRING} - V_ASN1_VIDEOTEXSTRING = 21; - {$EXTERNALSYM V_ASN1_VISIBLESTRING} - V_ASN1_VISIBLESTRING = 26; - {$EXTERNALSYM WINNT} - WINNT = 1; - {$EXTERNALSYM X509_TRUST_DEFAULT} - X509_TRUST_DEFAULT = -1; //* Only valid in purpose settings */ - {$EXTERNALSYM X509_TRUST_COMPAT} - X509_TRUST_COMPAT = 1; - {$EXTERNALSYM X509_TRUST_SSL_CLIENT} - X509_TRUST_SSL_CLIENT = 2; - {$EXTERNALSYM X509_TRUST_SSL_SERVER} - X509_TRUST_SSL_SERVER = 3; - {$EXTERNALSYM X509_TRUST_EMAIL} - X509_TRUST_EMAIL = 4; - {$EXTERNALSYM X509_TRUST_OBJECT_SIGN} - X509_TRUST_OBJECT_SIGN = 5; - {$EXTERNALSYM X509_TRUST_OCSP_SIGN} - X509_TRUST_OCSP_SIGN = 6; - {$EXTERNALSYM X509_TRUST_OCSP_REQUEST} - X509_TRUST_OCSP_REQUEST = 7; - {$EXTERNALSYM X509_TRUST_TSA} - X509_TRUST_TSA = 8; - {$EXTERNALSYM X509_TRUST_MIN} - X509_TRUST_MIN = 1; - {$EXTERNALSYM X509_TRUST_MAX} - X509_TRUST_MAX = 8; - {$EXTERNALSYM X509_EXT_PACK_STRING} - X509_EXT_PACK_STRING = 2; - {$EXTERNALSYM X509_EXT_PACK_UNKNOWN} - X509_EXT_PACK_UNKNOWN = 1; - {$EXTERNALSYM X509_EX_V_INIT} - X509_EX_V_INIT = $0001; - {$EXTERNALSYM X509_EX_V_NETSCAPE_HACK} - X509_EX_V_NETSCAPE_HACK = $8000; - {$EXTERNALSYM X509_FILETYPE_DEFAULT} - X509_FILETYPE_DEFAULT = 3; - {$EXTERNALSYM X509_F_ADD_CERT_DIR} - X509_F_ADD_CERT_DIR = 100; - {$EXTERNALSYM X509_F_BY_FILE_CTRL} - X509_F_BY_FILE_CTRL = 101; - {$EXTERNALSYM X509_F_DIR_CTRL} - X509_F_DIR_CTRL = 102; - {$EXTERNALSYM X509_F_GET_CERT_BY_SUBJECT} - X509_F_GET_CERT_BY_SUBJECT = 103; - {$EXTERNALSYM X509_F_X509V3_ADD_EXT} - X509_F_X509V3_ADD_EXT = 104; - {$EXTERNALSYM X509_F_X509_EXTENSION_CREATE_BY_NID} - X509_F_X509_EXTENSION_CREATE_BY_NID = 108; - {$EXTERNALSYM X509_F_X509_EXTENSION_CREATE_BY_OBJ} - X509_F_X509_EXTENSION_CREATE_BY_OBJ = 109; - - {$EXTERNALSYM X509_F_X509_GET_PUBKEY_PARAMETERS} - X509_F_X509_GET_PUBKEY_PARAMETERS = 110; - {$EXTERNALSYM X509_F_X509_LOAD_CERT_FILE} - X509_F_X509_LOAD_CERT_FILE = 111; - {$EXTERNALSYM X509_F_X509_LOAD_CRL_FILE} - X509_F_X509_LOAD_CRL_FILE = 112; - {$EXTERNALSYM X509_F_X509_NAME_ADD_ENTRY} - X509_F_X509_NAME_ADD_ENTRY = 113; - {$EXTERNALSYM X509_F_X509_NAME_ENTRY_CREATE_BY_NID} - X509_F_X509_NAME_ENTRY_CREATE_BY_NID = 114; - {$EXTERNALSYM X509_F_X509_NAME_ENTRY_SET_OBJECT} - X509_F_X509_NAME_ENTRY_SET_OBJECT = 115; - {$EXTERNALSYM X509_F_X509_NAME_ONELINE} - X509_F_X509_NAME_ONELINE = 116; - {$EXTERNALSYM X509_F_X509_NAME_PRINT} - X509_F_X509_NAME_PRINT = 117; - {$EXTERNALSYM X509_F_X509_PRINT_FP} - X509_F_X509_PRINT_FP = 118; - {$EXTERNALSYM X509_F_X509_PUBKEY_GET} - X509_F_X509_PUBKEY_GET = 119; - - {$EXTERNALSYM X509_F_X509_PUBKEY_SET} - X509_F_X509_PUBKEY_SET = 120; - {$EXTERNALSYM X509_F_X509_REQ_PRINT} - X509_F_X509_REQ_PRINT = 121; - {$EXTERNALSYM X509_F_X509_REQ_PRINT_FP} - X509_F_X509_REQ_PRINT_FP = 122; - {$EXTERNALSYM X509_F_X509_REQ_TO_X509} - X509_F_X509_REQ_TO_X509 = 123; - {$EXTERNALSYM X509_F_X509_STORE_ADD_CERT} - X509_F_X509_STORE_ADD_CERT = 124; - {$EXTERNALSYM X509_F_X509_STORE_ADD_CRL} - X509_F_X509_STORE_ADD_CRL = 125; - {$EXTERNALSYM X509_F_X509_TO_X509_REQ} - X509_F_X509_TO_X509_REQ = 126; - {$EXTERNALSYM X509_F_X509_VERIFY_CERT} - X509_F_X509_VERIFY_CERT = 127; - {$EXTERNALSYM X509_F_X509_CHECK_PRIVATE_KEY} - X509_F_X509_CHECK_PRIVATE_KEY = 128; - {$EXTERNALSYM X509_F_NETSCAPE_SPKI_B64_DECODE} - X509_F_NETSCAPE_SPKI_B64_DECODE = 129; - - {$EXTERNALSYM X509_F_NETSCAPE_SPKI_B64_ENCODE} - X509_F_NETSCAPE_SPKI_B64_ENCODE = 130; - {$EXTERNALSYM X509_F_X509_NAME_ENTRY_CREATE_BY_TXT} - X509_F_X509_NAME_ENTRY_CREATE_BY_TXT = 131; - {$EXTERNALSYM X509_F_X509_LOAD_CERT_CRL_FILE} - X509_F_X509_LOAD_CERT_CRL_FILE = 132; - {$EXTERNALSYM X509_F_X509_TRUST_ADD} - X509_F_X509_TRUST_ADD = 133; - - {$EXTERNALSYM X509_F_X509_STORE_CTX_PURPOSE_INHERIT} - X509_F_X509_STORE_CTX_PURPOSE_INHERIT = 134; - {$EXTERNALSYM X509_F_X509AT_ADD1_ATTR} - X509_F_X509AT_ADD1_ATTR = 135; - {$EXTERNALSYM X509_F_X509_ATTRIBUTE_CREATE_BY_NID} - X509_F_X509_ATTRIBUTE_CREATE_BY_NID = 136; - {$EXTERNALSYM X509_F_X509_ATTRIBUTE_CREATE_BY_OBJ} - X509_F_X509_ATTRIBUTE_CREATE_BY_OBJ = 137; - {$EXTERNALSYM X509_F_X509_ATTRIBUTE_SET1_DATA} - X509_F_X509_ATTRIBUTE_SET1_DATA = 138; - {$EXTERNALSYM X509_F_X509_ATTRIBUTE_GET0_DATA} - X509_F_X509_ATTRIBUTE_GET0_DATA = 139; - - {$EXTERNALSYM X509_F_X509_ATTRIBUTE_CREATE_BY_TXT} - X509_F_X509_ATTRIBUTE_CREATE_BY_TXT = 140; - {$EXTERNALSYM X509_F_X509_TRUST_SET} - X509_F_X509_TRUST_SET = 141; - {$EXTERNALSYM X509_F_X509_STORE_CTX_NEW} - X509_F_X509_STORE_CTX_NEW = 142; - {$EXTERNALSYM X509_F_X509_STORE_CTX_INIT} - X509_F_X509_STORE_CTX_INIT = 143; - {$EXTERNALSYM X509_F_X509_REQ_CHECK_PRIVATE_KEY} - X509_F_X509_REQ_CHECK_PRIVATE_KEY = 144; - {$EXTERNALSYM X509_F_CHECK_POLICY} - X509_F_CHECK_POLICY = 145; - {$EXTERNALSYM X509_F_X509_STORE_CTX_GET1_ISSUER} - X509_F_X509_STORE_CTX_GET1_ISSUER = 146; - {$EXTERNALSYM X509_F_X509_CRL_PRINT_FP} - X509_F_X509_CRL_PRINT_FP = 147; - - {$EXTERNALSYM X509_LU_CRL} - X509_LU_CRL = 2; - {$EXTERNALSYM X509_LU_FAIL} - X509_LU_FAIL = 0; - {$EXTERNALSYM X509_LU_PKEY} - X509_LU_PKEY = 3; - {$EXTERNALSYM X509_LU_RETRY} - X509_LU_RETRY = -1; - {$EXTERNALSYM X509_LU_X509} - X509_LU_X509 = 1; - {$EXTERNALSYM X509_L_ADD_DIR} - X509_L_ADD_DIR = 2; - {$EXTERNALSYM X509_L_FILE_LOAD} - X509_L_FILE_LOAD = 1; - {$EXTERNALSYM X509_R_BAD_X509_FILETYPE} - X509_R_BAD_X509_FILETYPE = 100; - {$EXTERNALSYM X509_R_BASE64_DECODE_ERROR} - X509_R_BASE64_DECODE_ERROR = 118; - {$EXTERNALSYM X509_R_CANT_CHECK_DH_KEY} - X509_R_CANT_CHECK_DH_KEY = 114; - {$EXTERNALSYM X509_R_CERT_ALREADY_IN_HASH_TABLE} - X509_R_CERT_ALREADY_IN_HASH_TABLE = 101; - {$EXTERNALSYM X509_R_ERR_ASN1_LIB} - X509_R_ERR_ASN1_LIB = 102; - {$EXTERNALSYM X509_R_INVALID_DIRECTORY} - X509_R_INVALID_DIRECTORY = 113; - {$EXTERNALSYM X509_R_INVALID_FIELD_NAME} - X509_R_INVALID_FIELD_NAME = 119; - {$EXTERNALSYM X509_R_INVALID_TRUST} - X509_R_INVALID_TRUST = 123; - {$EXTERNALSYM X509_R_KEY_TYPE_MISMATCH} - X509_R_KEY_TYPE_MISMATCH = 115; - {$EXTERNALSYM X509_R_KEY_VALUES_MISMATCH} - X509_R_KEY_VALUES_MISMATCH = 116; - {$EXTERNALSYM X509_R_LOADING_CERT_DIR} - X509_R_LOADING_CERT_DIR = 103; - {$EXTERNALSYM X509_R_LOADING_DEFAULTS} - X509_R_LOADING_DEFAULTS = 104; - {$EXTERNALSYM X509_R_METHOD_NOT_SUPPORTED} - X509_R_METHOD_NOT_SUPPORTED = 124; - {$EXTERNALSYM X509_R_NO_CERT_SET_FOR_US_TO_VERIFY} - X509_R_NO_CERT_SET_FOR_US_TO_VERIFY = 105; - {$EXTERNALSYM X509_R_PUBLIC_KEY_DECODE_ERROR} - X509_R_PUBLIC_KEY_DECODE_ERROR = 125; - {$EXTERNALSYM X509_R_PUBLIC_KEY_ENCODE_ERROR} - X509_R_PUBLIC_KEY_ENCODE_ERROR = 126; - {$EXTERNALSYM X509_R_SHOULD_RETRY} - X509_R_SHOULD_RETRY = 106; - {$EXTERNALSYM X509_R_UNABLE_TO_FIND_PARAMETERS_IN_CHAIN} - X509_R_UNABLE_TO_FIND_PARAMETERS_IN_CHAIN = 107; - {$EXTERNALSYM X509_R_UNABLE_TO_GET_CERTS_PUBLIC_KEY} - X509_R_UNABLE_TO_GET_CERTS_PUBLIC_KEY = 108; - {$EXTERNALSYM X509_R_UNKNOWN_KEY_TYPE} - X509_R_UNKNOWN_KEY_TYPE = 117; - {$EXTERNALSYM X509_R_UNKNOWN_NID} - X509_R_UNKNOWN_NID = 109; - {$EXTERNALSYM X509_R_UNKNOWN_PURPOSE_ID} - X509_R_UNKNOWN_PURPOSE_ID = 121; - {$EXTERNALSYM X509_R_UNSUPPORTED_ALGORITHM} - X509_R_UNSUPPORTED_ALGORITHM = 111; - {$EXTERNALSYM X509_R_WRONG_LOOKUP_TYPE} - X509_R_WRONG_LOOKUP_TYPE = 112; - {$EXTERNALSYM X509_R_WRONG_TYPE} - X509_R_WRONG_TYPE = 122; - - {$EXTERNALSYM X509_V_ERR_UNSPECIFIED} - X509_V_ERR_UNSPECIFIED = 1; - {$EXTERNALSYM X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT} - X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT = 2; - {$EXTERNALSYM X509_V_ERR_UNABLE_TO_GET_CRL} - X509_V_ERR_UNABLE_TO_GET_CRL = 3; - {$EXTERNALSYM X509_V_ERR_UNABLE_TO_DECRYPT_CERT_SIGNATURE} - X509_V_ERR_UNABLE_TO_DECRYPT_CERT_SIGNATURE = 4; - {$EXTERNALSYM X509_V_ERR_UNABLE_TO_DECRYPT_CRL_SIGNATURE} - X509_V_ERR_UNABLE_TO_DECRYPT_CRL_SIGNATURE = 5; - {$EXTERNALSYM X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY} - X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY = 6; - {$EXTERNALSYM X509_V_ERR_CERT_SIGNATURE_FAILURE} - X509_V_ERR_CERT_SIGNATURE_FAILURE = 7; - {$EXTERNALSYM X509_V_ERR_CRL_SIGNATURE_FAILURE} - X509_V_ERR_CRL_SIGNATURE_FAILURE = 8; - {$EXTERNALSYM X509_V_ERR_CERT_NOT_YET_VALID} - X509_V_ERR_CERT_NOT_YET_VALID = 9; - {$EXTERNALSYM X509_V_ERR_CERT_HAS_EXPIRED} - X509_V_ERR_CERT_HAS_EXPIRED = 10; - {$EXTERNALSYM X509_V_ERR_CRL_NOT_YET_VALID} - X509_V_ERR_CRL_NOT_YET_VALID = 11; - {$EXTERNALSYM X509_V_ERR_CRL_HAS_EXPIRED} - X509_V_ERR_CRL_HAS_EXPIRED = 12; - {$EXTERNALSYM X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD} - X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD = 13; - {$EXTERNALSYM X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD} - X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD = 14; - {$EXTERNALSYM X509_V_ERR_ERROR_IN_CRL_LAST_UPDATE_FIELD} - X509_V_ERR_ERROR_IN_CRL_LAST_UPDATE_FIELD = 15; - {$EXTERNALSYM X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD} - X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD = 16; - {$EXTERNALSYM X509_V_ERR_OUT_OF_MEM} - X509_V_ERR_OUT_OF_MEM = 17; - {$EXTERNALSYM X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT} - X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT = 18; - {$EXTERNALSYM X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN} - X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN = 19; - {$EXTERNALSYM X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY} - X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY = 20; - {$EXTERNALSYM X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE} - X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE = 21; - {$EXTERNALSYM X509_V_ERR_CERT_CHAIN_TOO_LONG} - X509_V_ERR_CERT_CHAIN_TOO_LONG = 22; - {$EXTERNALSYM X509_V_ERR_CERT_REVOKED} - X509_V_ERR_CERT_REVOKED = 23; - {$EXTERNALSYM X509_V_ERR_INVALID_CA} - X509_V_ERR_INVALID_CA = 24; - {$EXTERNALSYM X509_V_ERR_PATH_LENGTH_EXCEEDED} - X509_V_ERR_PATH_LENGTH_EXCEEDED = 25; - {$EXTERNALSYM X509_V_ERR_INVALID_PURPOSE} - X509_V_ERR_INVALID_PURPOSE = 26; - {$EXTERNALSYM X509_V_ERR_CERT_UNTRUSTED} - X509_V_ERR_CERT_UNTRUSTED = 27; - {$EXTERNALSYM X509_V_ERR_CERT_REJECTED} - X509_V_ERR_CERT_REJECTED = 28; -//* These are 'informational' when looking for issuer cert */ - {$EXTERNALSYM X509_V_ERR_SUBJECT_ISSUER_MISMATCH} - X509_V_ERR_SUBJECT_ISSUER_MISMATCH = 29; - {$EXTERNALSYM X509_V_ERR_AKID_SKID_MISMATCH} - X509_V_ERR_AKID_SKID_MISMATCH = 30; - {$EXTERNALSYM X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH} - X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH = 31; - {$EXTERNALSYM X509_V_ERR_KEYUSAGE_NO_CERTSIGN} - X509_V_ERR_KEYUSAGE_NO_CERTSIGN = 32; - {$EXTERNALSYM X509_V_ERR_UNABLE_TO_GET_CRL_ISSUER} - X509_V_ERR_UNABLE_TO_GET_CRL_ISSUER = 33; - {$EXTERNALSYM X509_V_ERR_UNHANDLED_CRITICAL_EXTENSION} - X509_V_ERR_UNHANDLED_CRITICAL_EXTENSION = 34; - {$EXTERNALSYM X509_V_ERR_KEYUSAGE_NO_CRL_SIGN} - X509_V_ERR_KEYUSAGE_NO_CRL_SIGN = 35; - {$EXTERNALSYM X509_V_ERR_UNHANDLED_CRITICAL_CRL_EXTENSION} - X509_V_ERR_UNHANDLED_CRITICAL_CRL_EXTENSION = 36; - {$EXTERNALSYM X509_V_ERR_INVALID_NON_CA} - X509_V_ERR_INVALID_NON_CA = 37; - {$EXTERNALSYM X509_V_ERR_PROXY_PATH_LENGTH_EXCEEDED} - X509_V_ERR_PROXY_PATH_LENGTH_EXCEEDED = 38; - {$EXTERNALSYM X509_V_ERR_KEYUSAGE_NO_DIGITAL_SIGNATURE} - X509_V_ERR_KEYUSAGE_NO_DIGITAL_SIGNATURE = 39; - {$EXTERNALSYM X509_V_ERR_PROXY_CERTIFICATES_NOT_ALLOWED} - X509_V_ERR_PROXY_CERTIFICATES_NOT_ALLOWED = 40; - {$EXTERNALSYM X509_V_ERR_INVALID_EXTENSION} - X509_V_ERR_INVALID_EXTENSION = 41; - {$EXTERNALSYM X509_V_ERR_INVALID_POLICY_EXTENSION} - X509_V_ERR_INVALID_POLICY_EXTENSION = 42; - {$EXTERNALSYM X509_V_ERR_NO_EXPLICIT_POLICY} - X509_V_ERR_NO_EXPLICIT_POLICY = 43; - {$EXTERNALSYM X509_V_ERR_DIFFERENT_CRL_SCOPE} - X509_V_ERR_DIFFERENT_CRL_SCOPE = 44; - {$EXTERNALSYM X509_V_ERR_UNSUPPORTED_EXTENSION_FEATURE} - X509_V_ERR_UNSUPPORTED_EXTENSION_FEATURE = 45; - - {$EXTERNALSYM X509_V_ERR_UNNESTED_RESOURCE} - X509_V_ERR_UNNESTED_RESOURCE = 46; //was 44; - {$EXTERNALSYM X509_V_ERR_PERMITTED_VIOLATION} - X509_V_ERR_PERMITTED_VIOLATION = 47; - {$EXTERNALSYM X509_V_ERR_EXCLUDED_VIOLATION} - X509_V_ERR_EXCLUDED_VIOLATION = 48; - {$EXTERNALSYM X509_V_ERR_SUBTREE_MINMAX} - X509_V_ERR_SUBTREE_MINMAX = 49; - {$EXTERNALSYM X509_V_ERR_APPLICATION_VERIFICATION} - X509_V_ERR_APPLICATION_VERIFICATION = 50; - {$EXTERNALSYM X509_V_ERR_UNSUPPORTED_CONSTRAINT_TYPE} - X509_V_ERR_UNSUPPORTED_CONSTRAINT_TYPE = 51; - {$EXTERNALSYM X509_V_ERR_UNSUPPORTED_CONSTRAINT_SYNTAX} - X509_V_ERR_UNSUPPORTED_CONSTRAINT_SYNTAX = 52; - {$EXTERNALSYM X509_V_ERR_UNSUPPORTED_NAME_SYNTAX} - X509_V_ERR_UNSUPPORTED_NAME_SYNTAX = 53; - {$EXTERNALSYM X509_V_ERR_CRL_PATH_VALIDATION_ERROR} - X509_V_ERR_CRL_PATH_VALIDATION_ERROR = 54; - {$EXTERNALSYM X509_V_ERR_PATH_LOOP} - X509_V_ERR_PATH_LOOP = 55; - {$EXTERNALSYM X509_V_ERR_SUITE_B_INVALID_VERSION} - X509_V_ERR_SUITE_B_INVALID_VERSION = 56; - {$EXTERNALSYM X509_V_ERR_SUITE_B_INVALID_ALGORITHM} - X509_V_ERR_SUITE_B_INVALID_ALGORITHM = 57; - {$EXTERNALSYM X509_V_ERR_SUITE_B_INVALID_CURVE} - X509_V_ERR_SUITE_B_INVALID_CURVE = 58; - {$EXTERNALSYM X509_V_ERR_SUITE_B_INVALID_SIGNATURE_ALGORITHM} - X509_V_ERR_SUITE_B_INVALID_SIGNATURE_ALGORITHM = 59; - {$EXTERNALSYM X509_V_ERR_SUITE_B_LOS_NOT_ALLOWED} - X509_V_ERR_SUITE_B_LOS_NOT_ALLOWED = 60; - {$EXTERNALSYM X509_V_ERR_SUITE_B_CANNOT_SIGN_P_384_WITH_P_256} - X509_V_ERR_SUITE_B_CANNOT_SIGN_P_384_WITH_P_256 = 61; - {$EXTERNALSYM X509_V_ERR_HOSTNAME_MISMATCH} - X509_V_ERR_HOSTNAME_MISMATCH = 62; - {$EXTERNALSYM X509_V_ERR_EMAIL_MISMATCH} - X509_V_ERR_EMAIL_MISMATCH = 63; - {$EXTERNALSYM X509_V_ERR_IP_ADDRESS_MISMATCH} - X509_V_ERR_IP_ADDRESS_MISMATCH = 64; - {$EXTERNALSYM X509_V_ERR_DANE_NO_MATCH} - X509_V_ERR_DANE_NO_MATCH = 65; - {$EXTERNALSYM X509_V_ERR_EE_KEY_TOO_SMALL} - X509_V_ERR_EE_KEY_TOO_SMALL = 66; - {$EXTERNALSYM X509_V_ERR_CA_KEY_TOO_SMALL} - X509_V_ERR_CA_KEY_TOO_SMALL = 67; - {$EXTERNALSYM X509_V_ERR_CA_MD_TOO_WEAK} - X509_V_ERR_CA_MD_TOO_WEAK = 68; - {$EXTERNALSYM X509_V_ERR_INVALID_CALL} - X509_V_ERR_INVALID_CALL = 69; - {$EXTERNALSYM X509_V_ERR_STORE_LOOKUP} - X509_V_ERR_STORE_LOOKUP = 70; - {$EXTERNALSYM X509_V_ERR_NO_VALID_SCTS} - X509_V_ERR_NO_VALID_SCTS = 71; - {$EXTERNALSYM X509_V_ERR_PROXY_SUBJECT_NAME_VIOLATION} - X509_V_ERR_PROXY_SUBJECT_NAME_VIOLATION = 72; - {$EXTERNALSYM X509_V_ERR_OCSP_VERIFY_NEEDED} - X509_V_ERR_OCSP_VERIFY_NEEDED = 73; - {$EXTERNALSYM X509_V_ERR_OCSP_VERIFY_FAILED} - X509_V_ERR_OCSP_VERIFY_FAILED = 74; - {$EXTERNALSYM X509_V_ERR_OCSP_CERT_UNKNOWN} - X509_V_ERR_OCSP_CERT_UNKNOWN = 75; - - //* Certificate verify flags */ - - //* Send issuer+subject checks to verify_cb */ - {$EXTERNALSYM X509_V_FLAG_CB_ISSUER_CHECK} - X509_V_FLAG_CB_ISSUER_CHECK = $1; - //* Use check time instead of current time */ - {$EXTERNALSYM X509_V_FLAG_USE_CHECK_TIME} - X509_V_FLAG_USE_CHECK_TIME = $2; - //* Lookup CRLs */ - {$EXTERNALSYM X509_V_FLAG_CRL_CHECK} - X509_V_FLAG_CRL_CHECK = $4; - //* Lookup CRLs for whole chain */ - {$EXTERNALSYM X509_V_FLAG_CRL_CHECK_ALL} - X509_V_FLAG_CRL_CHECK_ALL = $8; - //* Ignore unhandled critical extensions */ - {$EXTERNALSYM X509_V_FLAG_IGNORE_CRITICAL} - X509_V_FLAG_IGNORE_CRITICAL = $10; -//* Disable workarounds for broken certificates */ - {$EXTERNALSYM X509_V_FLAG_X509_STRICT} - X509_V_FLAG_X509_STRICT = $20; -//* Enable proxy certificate validation */ - {$EXTERNALSYM X509_V_FLAG_ALLOW_PROXY_CERTS} - X509_V_FLAG_ALLOW_PROXY_CERTS = $40; -//* Enable policy checking */ - {$EXTERNALSYM X509_V_FLAG_POLICY_CHECK} - X509_V_FLAG_POLICY_CHECK = $80; -//* Policy variable require-explicit-policy */ - {$EXTERNALSYM X509_V_FLAG_EXPLICIT_POLICY} - X509_V_FLAG_EXPLICIT_POLICY = $100; -//* Policy variable inhibit-any-policy */ - {$EXTERNALSYM X509_V_FLAG_INHIBIT_ANY} - X509_V_FLAG_INHIBIT_ANY = $200; -//* Policy variable inhibit-policy-mapping */ - {$EXTERNALSYM X509_V_FLAG_INHIBIT_MAP} - X509_V_FLAG_INHIBIT_MAP = $400; -//* Notify callback that policy is OK */ - {$EXTERNALSYM X509_V_FLAG_NOTIFY_POLICY} - X509_V_FLAG_NOTIFY_POLICY = $800; -//* Extended CRL features such as indirect CRLs, alternate CRL signing keys */ - {$EXTERNALSYM X509_V_FLAG_EXTENDED_CRL_SUPPORT} - X509_V_FLAG_EXTENDED_CRL_SUPPORT = $1000; -//* Delta CRL support */ - {$EXTERNALSYM X509_V_FLAG_USE_DELTAS} - X509_V_FLAG_USE_DELTAS = $2000; -//* Check selfsigned CA signature */ - {$EXTERNALSYM X509_V_FLAG_CHECK_SS_SIGNATURE} - X509_V_FLAG_CHECK_SS_SIGNATURE = $4000; - - {$EXTERNALSYM X509_VP_FLAG_DEFAULT} - X509_VP_FLAG_DEFAULT = $1; - {$EXTERNALSYM X509_VP_FLAG_OVERWRITE} - X509_VP_FLAG_OVERWRITE = $2; - {$EXTERNALSYM X509_VP_FLAG_RESET_FLAGS} - X509_VP_FLAG_RESET_FLAGS = $4; - {$EXTERNALSYM X509_VP_FLAG_LOCKED} - X509_VP_FLAG_LOCKED = $8; - {$EXTERNALSYM X509_VP_FLAG_ONCE} - X509_VP_FLAG_ONCE = $10; - {$EXTERNALSYM X509_V_FLAG_POLICY_MASK} - X509_V_FLAG_POLICY_MASK = (X509_V_FLAG_POLICY_CHECK or - X509_V_FLAG_EXPLICIT_POLICY or - X509_V_FLAG_INHIBIT_ANY or - X509_V_FLAG_INHIBIT_MAP); - - {$EXTERNALSYM X509_V_OK} - X509_V_OK = 0; - {$EXTERNALSYM X509v3_KU_CRL_SIGN} - X509v3_KU_CRL_SIGN = $0002; - {$EXTERNALSYM X509v3_KU_DATA_ENCIPHERMENT} - X509v3_KU_DATA_ENCIPHERMENT = $0010; - {$EXTERNALSYM X509v3_KU_DECIPHER_ONLY} - X509v3_KU_DECIPHER_ONLY = $8000; - {$EXTERNALSYM X509v3_KU_DIGITAL_SIGNATURE} - X509v3_KU_DIGITAL_SIGNATURE = $0080; - {$EXTERNALSYM X509v3_KU_ENCIPHER_ONLY} - X509v3_KU_ENCIPHER_ONLY = $0001; - {$EXTERNALSYM X509v3_KU_KEY_AGREEMENT} - X509v3_KU_KEY_AGREEMENT = $0008; - {$EXTERNALSYM X509v3_KU_KEY_CERT_SIGN} - X509v3_KU_KEY_CERT_SIGN = $0004; - {$EXTERNALSYM X509v3_KU_KEY_ENCIPHERMENT} - X509v3_KU_KEY_ENCIPHERMENT = $0020; - {$EXTERNALSYM X509v3_KU_NON_REPUDIATION} - X509v3_KU_NON_REPUDIATION = $0040; - {$EXTERNALSYM X509v3_KU_UNDEF} - X509v3_KU_UNDEF = $ffff; - {$EXTERNALSYM X509V3_EXT_DYNAMIC} - X509V3_EXT_DYNAMIC = $1; - {$EXTERNALSYM X509V3_EXT_CTX_DEP} - X509V3_EXT_CTX_DEP = $2; - {$EXTERNALSYM X509V3_EXT_MULTILINE} - X509V3_EXT_MULTILINE = $4; - {$EXTERNALSYM GEN_OTHERNAME} - GEN_OTHERNAME = 0; - {$EXTERNALSYM GEN_EMAIL} - GEN_EMAIL = 1; - {$EXTERNALSYM GEN_DNS} - GEN_DNS = 2; - {$EXTERNALSYM GEN_X400} - GEN_X400 = 3; - {$EXTERNALSYM GEN_DIRNAME} - GEN_DIRNAME = 4; - {$EXTERNALSYM GEN_EDIPARTY} - GEN_EDIPARTY = 5; - {$EXTERNALSYM GEN_URI} - GEN_URI = 6; - {$EXTERNALSYM GEN_IPADD} - GEN_IPADD = 7; - {$EXTERNALSYM GEN_RID} - GEN_RID = 8; - {$EXTERNALSYM CRLDP_ALL_REASONS} - CRLDP_ALL_REASONS = $807f; - {$EXTERNALSYM CRL_REASON_NONE} - CRL_REASON_NONE = -1; - {$EXTERNALSYM CRL_REASON_UNSPECIFIED} - CRL_REASON_UNSPECIFIED = 0; - {$EXTERNALSYM CRL_REASON_KEY_COMPROMISE} - CRL_REASON_KEY_COMPROMISE = 1; - {$EXTERNALSYM CRL_REASON_CA_COMPROMISE} - CRL_REASON_CA_COMPROMISE = 2; - {$EXTERNALSYM CRL_REASON_AFFILIATION_CHANGED} - CRL_REASON_AFFILIATION_CHANGED = 3; - {$EXTERNALSYM CRL_REASON_SUPERSEDED} - CRL_REASON_SUPERSEDED = 4; - {$EXTERNALSYM CRL_REASON_CESSATION_OF_OPERATION} - CRL_REASON_CESSATION_OF_OPERATION = 5; - {$EXTERNALSYM CRL_REASON_CERTIFICATE_HOLD} - CRL_REASON_CERTIFICATE_HOLD = 6; - {$EXTERNALSYM CRL_REASON_REMOVE_FROM_CRL} - CRL_REASON_REMOVE_FROM_CRL = 8; - {$EXTERNALSYM CRL_REASON_PRIVILEGE_WITHDRAWN} - CRL_REASON_PRIVILEGE_WITHDRAWN = 9; - {$EXTERNALSYM CRL_REASON_AA_COMPROMISE} - CRL_REASON_AA_COMPROMISE = 10; - -//* Values in idp_flags field */ -//* IDP present */ - {$EXTERNALSYM IDP_PRESENT} - IDP_PRESENT = $1; -//* IDP values inconsistent */ - {$EXTERNALSYM IDP_INVALID} - IDP_INVALID = $2; -//* onlyuser true */ - {$EXTERNALSYM IDP_ONLYUSER} - IDP_ONLYUSER = $4; -//* onlyCA true */ - {$EXTERNALSYM IDP_ONLYCA} - IDP_ONLYCA = $8; -//* onlyattr true */ - {$EXTERNALSYM IDP_ONLYATTR} - IDP_ONLYATTR = $10; -//* indirectCRL true */ - {$EXTERNALSYM IDP_INDIRECT} - IDP_INDIRECT = $20; -//* onlysomereasons present */ - {$EXTERNALSYM IDP_REASONS} - IDP_REASONS = $40; - - //* X509_PURPOSE stuff */ - {$EXTERNALSYM EXFLAG_BCONS} - EXFLAG_BCONS = $1; - {$EXTERNALSYM EXFLAG_KUSAGE} - EXFLAG_KUSAGE = $2; - {$EXTERNALSYM EXFLAG_XKUSAGE} - EXFLAG_XKUSAGE = $4; - {$EXTERNALSYM EXFLAG_NSCERT} - EXFLAG_NSCERT = $8; - {$EXTERNALSYM EXFLAG_CA} - EXFLAG_CA = $10; - //* Really self issued not necessarily self signed */ - {$EXTERNALSYM EXFLAG_SI} - EXFLAG_SI = $20; - {$EXTERNALSYM EXFLAG_SS} - EXFLAG_SS = $20; - {$EXTERNALSYM EXFLAG_V1} - EXFLAG_V1 = $40; - {$EXTERNALSYM EXFLAG_INVALID} - EXFLAG_INVALID = $80; - {$EXTERNALSYM EXFLAG_SET} - EXFLAG_SET = $100; - {$EXTERNALSYM EXFLAG_CRITICAL} - EXFLAG_CRITICAL = $200; - {$EXTERNALSYM EXFLAG_PROXY} - EXFLAG_PROXY = $400; - {$EXTERNALSYM EXFLAG_INVALID_POLICY} - EXFLAG_INVALID_POLICY = $800; - {$EXTERNALSYM KU_DIGITAL_SIGNATURE} - KU_DIGITAL_SIGNATURE = $0080; - {$EXTERNALSYM KU_NON_REPUDIATION} - KU_NON_REPUDIATION = $0040; - {$EXTERNALSYM KU_KEY_ENCIPHERMENT} - KU_KEY_ENCIPHERMENT = $0020; - {$EXTERNALSYM KU_DATA_ENCIPHERMENT} - KU_DATA_ENCIPHERMENT = $0010; - {$EXTERNALSYM KU_KEY_AGREEMENT} - KU_KEY_AGREEMENT = $0008; - {$EXTERNALSYM KU_KEY_CERT_SIGN} - KU_KEY_CERT_SIGN = $0004; - {$EXTERNALSYM KU_CRL_SIGN} - KU_CRL_SIGN = $0002; - {$EXTERNALSYM KU_ENCIPHER_ONLY} - KU_ENCIPHER_ONLY = $0001; - {$EXTERNALSYM KU_DECIPHER_ONLY} - KU_DECIPHER_ONLY = $8000; - {$EXTERNALSYM NS_SSL_CLIENT} - NS_SSL_CLIENT = $80; - {$EXTERNALSYM NS_SSL_SERVER} - NS_SSL_SERVER = $40; - {$EXTERNALSYM NS_SMIME} - NS_SMIME = $20; - {$EXTERNALSYM NS_OBJSIGN} - NS_OBJSIGN = $10; - {$EXTERNALSYM NS_SSL_CA} - NS_SSL_CA = $04; - {$EXTERNALSYM NS_SMIME_CA} - NS_SMIME_CA = $02; - {$EXTERNALSYM NS_OBJSIGN_CA} - NS_OBJSIGN_CA = $01; - {$EXTERNALSYM NS_ANY_CA} - NS_ANY_CA = (NS_SSL_CA or NS_SMIME_CA or - {$EXTERNALSYM XKU_SSL_SERVER} - NS_OBJSIGN_CA); - {$EXTERNALSYM XKU_SSL_SERVER} - XKU_SSL_SERVER = $1; - {$EXTERNALSYM XKU_SSL_CLIENT} - XKU_SSL_CLIENT = $2; - {$EXTERNALSYM XKU_SMIME} - XKU_SMIME = $4; - {$EXTERNALSYM XKU_CODE_SIGN} - XKU_CODE_SIGN = $8; - {$EXTERNALSYM XKU_SGC} - XKU_SGC = $10; - {$EXTERNALSYM XKU_OCSP_SIGN} - XKU_OCSP_SIGN = $20; - {$EXTERNALSYM XKU_TIMESTAMP} - XKU_TIMESTAMP = $40; - {$EXTERNALSYM XKU_DVCS} - XKU_DVCS = $80; - {$EXTERNALSYM X509_PURPOSE_DYNAMIC} - X509_PURPOSE_DYNAMIC = $1; - {$EXTERNALSYM X509_PURPOSE_DYNAMIC_NAME} - X509_PURPOSE_DYNAMIC_NAME = $2; - - {$EXTERNALSYM X509_PURPOSE_SSL_CLIENT} - X509_PURPOSE_SSL_CLIENT = 1; - {$EXTERNALSYM X509_PURPOSE_SSL_SERVER} - X509_PURPOSE_SSL_SERVER = 2; - {$EXTERNALSYM X509_PURPOSE_NS_SSL_SERVER} - X509_PURPOSE_NS_SSL_SERVER = 3; - {$EXTERNALSYM X509_PURPOSE_SMIME_SIGN} - X509_PURPOSE_SMIME_SIGN = 4; - {$EXTERNALSYM X509_PURPOSE_SMIME_ENCRYPT} - X509_PURPOSE_SMIME_ENCRYPT = 5; - {$EXTERNALSYM X509_PURPOSE_CRL_SIGN} - X509_PURPOSE_CRL_SIGN = 6; - {$EXTERNALSYM X509_PURPOSE_ANY} - X509_PURPOSE_ANY = 7; - {$EXTERNALSYM X509_PURPOSE_OCSP_HELPER} - X509_PURPOSE_OCSP_HELPER = 8; - {$EXTERNALSYM X509_PURPOSE_TIMESTAMP_SIGN} - X509_PURPOSE_TIMESTAMP_SIGN = 9; - - {$EXTERNALSYM X509_PURPOSE_MIN} - X509_PURPOSE_MIN = 1; - {$EXTERNALSYM X509_PURPOSE_MAX} - X509_PURPOSE_MAX = 9; - - -//* Flags for X509V3_EXT_print() */ - - {$EXTERNALSYM X509V3_EXT_UNKNOWN_MASK} - X509V3_EXT_UNKNOWN_MASK = TIdC_LONG($f shl 16); -//* Return error for unknown extensions */ - {$EXTERNALSYM X509V3_EXT_DEFAULT} - X509V3_EXT_DEFAULT = 0; -//* Print error for unknown extensions */ - {$EXTERNALSYM X509V3_EXT_ERROR_UNKNOWN} - X509V3_EXT_ERROR_UNKNOWN = (TIdC_LONG(1) shl 16); -//* ASN1 parse unknown extensions */ - {$EXTERNALSYM X509V3_EXT_PARSE_UNKNOWN} - X509V3_EXT_PARSE_UNKNOWN = (TIdC_LONG(2) shl 16); -//* BIO_dump unknown extensions */ - {$EXTERNALSYM X509V3_EXT_DUMP_UNKNOWN} - X509V3_EXT_DUMP_UNKNOWN = (TIdC_LONG(3) shl 16); - -//* Flags for X509V3_add1_i2d */ - {$EXTERNALSYM X509V3_ADD_OP_MASK} - X509V3_ADD_OP_MASK = TIdC_LONG($f); - {$EXTERNALSYM X509V3_ADD_DEFAULT} - X509V3_ADD_DEFAULT = TIdC_LONG(0); - {$EXTERNALSYM X509V3_ADD_APPEND} - X509V3_ADD_APPEND = TIdC_LONG(1); - {$EXTERNALSYM X509V3_ADD_REPLACE} - X509V3_ADD_REPLACE = TIdC_LONG(2); - {$EXTERNALSYM X509V3_ADD_REPLACE_EXISTING} - X509V3_ADD_REPLACE_EXISTING = TIdC_LONG(3); - {$EXTERNALSYM X509V3_ADD_KEEP_EXISTING} - X509V3_ADD_KEEP_EXISTING = TIdC_LONG(4); - {$EXTERNALSYM X509V3_ADD_DELETE} - X509V3_ADD_DELETE = TIdC_LONG(5); - {$EXTERNALSYM X509V3_ADD_SILENT} - X509V3_ADD_SILENT = TIdC_LONG($10); - - {$IFNDEF OPENSSL_NO_RFC3779} - {$EXTERNALSYM ASIdOrRange_id} - ASIdOrRange_id = 0; - {$EXTERNALSYM ASIdOrRange_range} - ASIdOrRange_range = 1; - - {$EXTERNALSYM ASIdentifierChoice_inherit} - ASIdentifierChoice_inherit = 0; - {$EXTERNALSYM ASIdentifierChoice_asIdsOrRanges} - ASIdentifierChoice_asIdsOrRanges = 1; - - {$EXTERNALSYM IPAddressOrRange_addressPrefix} - IPAddressOrRange_addressPrefix = 0; - {$EXTERNALSYM IPAddressOrRange_addressRange} - IPAddressOrRange_addressRange = 1; - - {$EXTERNALSYM IPAddressChoice_inherit} - IPAddressChoice_inherit = 0; - {$EXTERNALSYM IPAddressChoice_addressesOrRanges} - IPAddressChoice_addressesOrRanges = 1; - -// /* -// * API tag for elements of the ASIdentifer SEQUENCE. -// */ - {$EXTERNALSYM V3_ASID_ASNUM} - V3_ASID_ASNUM = 0; - {$EXTERNALSYM V3_ASID_RDI} - V3_ASID_RDI = 1; - -//* -// * AFI values, assigned by IANA. It'd be nice to make the AFI -// * handling code totally generic, but there are too many little things -// * that would need to be defined for other address families for it to -// * be worth the trouble. -// */ - {$EXTERNALSYM IANA_AFI_IPV4} - IANA_AFI_IPV4 = 1; - {$EXTERNALSYM IANA_AFI_IPV6} - IANA_AFI_IPV6 = 2; - {$ENDIF} - - //* Function codes. */ - {$EXTERNALSYM X509V3_F_A2I_GENERAL_NAME} - X509V3_F_A2I_GENERAL_NAME = 164; - {$EXTERNALSYM X509V3_F_ASIDENTIFIERCHOICE_CANONIZE} - X509V3_F_ASIDENTIFIERCHOICE_CANONIZE = 161; - {$EXTERNALSYM X509V3_F_ASIDENTIFIERCHOICE_IS_CANONICAL} - X509V3_F_ASIDENTIFIERCHOICE_IS_CANONICAL = 162; - {$EXTERNALSYM X509V3_F_COPY_EMAIL} - X509V3_F_COPY_EMAIL = 122; - {$EXTERNALSYM X509V3_F_COPY_ISSUER} - X509V3_F_COPY_ISSUER = 123; - {$EXTERNALSYM X509V3_F_DO_DIRNAME} - X509V3_F_DO_DIRNAME = 144; - {$EXTERNALSYM X509V3_F_DO_EXT_CONF} - X509V3_F_DO_EXT_CONF = 124; - {$EXTERNALSYM X509V3_F_DO_EXT_I2D} - X509V3_F_DO_EXT_I2D = 135; - {$EXTERNALSYM X509V3_F_DO_EXT_NCONF} - X509V3_F_DO_EXT_NCONF = 151; - {$EXTERNALSYM X509V3_F_DO_I2V_NAME_CONSTRAINTS} - X509V3_F_DO_I2V_NAME_CONSTRAINTS = 148; - {$EXTERNALSYM X509V3_F_GNAMES_FROM_SECTNAME} - X509V3_F_GNAMES_FROM_SECTNAME = 156; - {$EXTERNALSYM X509V3_F_HEX_TO_STRING} - X509V3_F_HEX_TO_STRING = 111; - {$EXTERNALSYM X509V3_F_I2S_ASN1_ENUMERATED} - X509V3_F_I2S_ASN1_ENUMERATED = 121; - {$EXTERNALSYM X509V3_F_I2S_ASN1_IA5STRING} - X509V3_F_I2S_ASN1_IA5STRING = 149; - {$EXTERNALSYM X509V3_F_I2S_ASN1_INTEGER} - X509V3_F_I2S_ASN1_INTEGER = 120; - {$EXTERNALSYM X509V3_F_I2V_AUTHORITY_INFO_ACCESS} - X509V3_F_I2V_AUTHORITY_INFO_ACCESS = 138; - {$EXTERNALSYM X509V3_F_NOTICE_SECTION} - X509V3_F_NOTICE_SECTION =132; - {$EXTERNALSYM X509V3_F_NREF_NOS} - X509V3_F_NREF_NOS =133; - {$EXTERNALSYM X509V3_F_POLICY_SECTION} - X509V3_F_POLICY_SECTION =131; - {$EXTERNALSYM X509V3_F_PROCESS_PCI_VALUE} - X509V3_F_PROCESS_PCI_VALUE =150; - {$EXTERNALSYM X509V3_F_R2I_CERTPOL} - X509V3_F_R2I_CERTPOL =130; - {$EXTERNALSYM X509V3_F_R2I_PCI} - X509V3_F_R2I_PCI = 155; - {$EXTERNALSYM X509V3_F_S2I_ASN1_IA5STRING} - X509V3_F_S2I_ASN1_IA5STRING = 100; - {$EXTERNALSYM X509V3_F_S2I_ASN1_INTEGER} - X509V3_F_S2I_ASN1_INTEGER = 108; - {$EXTERNALSYM X509V3_F_S2I_ASN1_OCTET_STRING} - X509V3_F_S2I_ASN1_OCTET_STRING = 112; - {$EXTERNALSYM X509V3_F_S2I_ASN1_SKEY_ID} - X509V3_F_S2I_ASN1_SKEY_ID = 114; - {$EXTERNALSYM X509V3_F_S2I_SKEY_ID} - X509V3_F_S2I_SKEY_ID = 115; - {$EXTERNALSYM X509V3_F_SET_DIST_POINT_NAME} - X509V3_F_SET_DIST_POINT_NAME = 158; - {$EXTERNALSYM X509V3_F_STRING_TO_HEX} - X509V3_F_STRING_TO_HEX = 113; - {$EXTERNALSYM X509V3_F_SXNET_ADD_ID_ASC} - X509V3_F_SXNET_ADD_ID_ASC = 125; - {$EXTERNALSYM X509V3_F_SXNET_ADD_ID_INTEGER} - X509V3_F_SXNET_ADD_ID_INTEGER = 126; - {$EXTERNALSYM X509V3_F_SXNET_ADD_ID_ULONG} - X509V3_F_SXNET_ADD_ID_ULONG = 127; - {$EXTERNALSYM X509V3_F_SXNET_GET_ID_ASC} - X509V3_F_SXNET_GET_ID_ASC = 128; - {$EXTERNALSYM X509V3_F_SXNET_GET_ID_ULONG} - X509V3_F_SXNET_GET_ID_ULONG = 129; - {$EXTERNALSYM X509V3_F_V2I_ASIDENTIFIERS} - X509V3_F_V2I_ASIDENTIFIERS = 163; - {$EXTERNALSYM X509V3_F_V2I_ASN1_BIT_STRING} - X509V3_F_V2I_ASN1_BIT_STRING = 101; - {$EXTERNALSYM X509V3_F_V2I_AUTHORITY_INFO_ACCESS} - X509V3_F_V2I_AUTHORITY_INFO_ACCESS = 139; - {$EXTERNALSYM X509V3_F_V2I_AUTHORITY_KEYID} - X509V3_F_V2I_AUTHORITY_KEYID = 119; - {$EXTERNALSYM X509V3_F_V2I_BASIC_CONSTRAINTS} - X509V3_F_V2I_BASIC_CONSTRAINTS = 102; - {$EXTERNALSYM X509V3_F_V2I_CRLD} - X509V3_F_V2I_CRLD = 134; - {$EXTERNALSYM X509V3_F_V2I_EXTENDED_KEY_USAGE} - X509V3_F_V2I_EXTENDED_KEY_USAGE = 103; - {$EXTERNALSYM X509V3_F_V2I_GENERAL_NAMES} - X509V3_F_V2I_GENERAL_NAMES = 118; - {$EXTERNALSYM X509V3_F_V2I_GENERAL_NAME_EX} - X509V3_F_V2I_GENERAL_NAME_EX = 117; - {$EXTERNALSYM X509V3_F_V2I_IDP} - X509V3_F_V2I_IDP = 157; - {$EXTERNALSYM X509V3_F_V2I_IPADDRBLOCKS} - X509V3_F_V2I_IPADDRBLOCKS = 159; - {$EXTERNALSYM X509V3_F_V2I_ISSUER_ALT} - X509V3_F_V2I_ISSUER_ALT = 153; - {$EXTERNALSYM X509V3_F_V2I_NAME_CONSTRAINTS} - X509V3_F_V2I_NAME_CONSTRAINTS = 147; - {$EXTERNALSYM X509V3_F_V2I_POLICY_CONSTRAINTS} - X509V3_F_V2I_POLICY_CONSTRAINTS = 146; - {$EXTERNALSYM X509V3_F_V2I_POLICY_MAPPINGS} - X509V3_F_V2I_POLICY_MAPPINGS = 145; - {$EXTERNALSYM X509V3_F_V2I_SUBJECT_ALT} - X509V3_F_V2I_SUBJECT_ALT = 154; - {$EXTERNALSYM X509V3_F_V3_ADDR_VALIDATE_PATH_INTERNAL} - X509V3_F_V3_ADDR_VALIDATE_PATH_INTERNAL = 160; - {$EXTERNALSYM X509V3_F_V3_GENERIC_EXTENSION} - X509V3_F_V3_GENERIC_EXTENSION = 116; - {$EXTERNALSYM X509V3_F_X509V3_ADD1_I2D} - X509V3_F_X509V3_ADD1_I2D = 140; - {$EXTERNALSYM X509V3_F_X509V3_ADD_VALUE} - X509V3_F_X509V3_ADD_VALUE = 105; - {$EXTERNALSYM X509V3_F_X509V3_EXT_ADD} - X509V3_F_X509V3_EXT_ADD = 104; - {$EXTERNALSYM X509V3_F_X509V3_EXT_ADD_ALIAS} - X509V3_F_X509V3_EXT_ADD_ALIAS = 106; - {$EXTERNALSYM X509V3_F_X509V3_EXT_CONF} - X509V3_F_X509V3_EXT_CONF = 107; - {$EXTERNALSYM X509V3_F_X509V3_EXT_I2D} - X509V3_F_X509V3_EXT_I2D = 136; - {$EXTERNALSYM X509V3_F_X509V3_EXT_NCONF} - X509V3_F_X509V3_EXT_NCONF = 152; - {$EXTERNALSYM X509V3_F_X509V3_GET_SECTION} - X509V3_F_X509V3_GET_SECTION = 142; - {$EXTERNALSYM X509V3_F_X509V3_GET_STRING} - X509V3_F_X509V3_GET_STRING = 143; - {$EXTERNALSYM X509V3_F_X509V3_GET_VALUE_BOOL} - X509V3_F_X509V3_GET_VALUE_BOOL = 110; - {$EXTERNALSYM X509V3_F_X509V3_PARSE_LIST} - X509V3_F_X509V3_PARSE_LIST = 109; - {$EXTERNALSYM X509V3_F_X509_PURPOSE_ADD} - X509V3_F_X509_PURPOSE_ADD = 137; - {$EXTERNALSYM X509V3_F_X509_PURPOSE_SET} - X509V3_F_X509_PURPOSE_SET = 141; - - //* Reason codes. */ - {$EXTERNALSYM X509V3_R_BAD_IP_ADDRESS} - X509V3_R_BAD_IP_ADDRESS = 118; - {$EXTERNALSYM X509V3_R_BAD_OBJECT} - X509V3_R_BAD_OBJECT = 119; - {$EXTERNALSYM X509V3_R_BN_DEC2BN_ERROR} - X509V3_R_BN_DEC2BN_ERROR = 100; - {$EXTERNALSYM X509V3_R_BN_TO_ASN1_INTEGER_ERROR} - X509V3_R_BN_TO_ASN1_INTEGER_ERROR = 101; - {$EXTERNALSYM X509V3_R_DIRNAME_ERROR} - X509V3_R_DIRNAME_ERROR = 149; - {$EXTERNALSYM X509V3_R_DISTPOINT_ALREADY_SET} - X509V3_R_DISTPOINT_ALREADY_SET = 160; - {$EXTERNALSYM X509V3_R_DUPLICATE_ZONE_ID} - X509V3_R_DUPLICATE_ZONE_ID = 133; - {$EXTERNALSYM X509V3_R_ERROR_CONVERTING_ZONE} - X509V3_R_ERROR_CONVERTING_ZONE = 131; - {$EXTERNALSYM X509V3_R_ERROR_CREATING_EXTENSION} - X509V3_R_ERROR_CREATING_EXTENSION = 144; - {$EXTERNALSYM X509V3_R_ERROR_IN_EXTENSION} - X509V3_R_ERROR_IN_EXTENSION = 128; - {$EXTERNALSYM X509V3_R_EXPECTED_A_SECTION_NAME} - X509V3_R_EXPECTED_A_SECTION_NAME = 137; - {$EXTERNALSYM X509V3_R_EXTENSION_EXISTS} - X509V3_R_EXTENSION_EXISTS = 145; - {$EXTERNALSYM X509V3_R_EXTENSION_NAME_ERROR} - X509V3_R_EXTENSION_NAME_ERROR = 115; - {$EXTERNALSYM X509V3_R_EXTENSION_NOT_FOUND} - X509V3_R_EXTENSION_NOT_FOUND = 102; - {$EXTERNALSYM X509V3_R_EXTENSION_SETTING_NOT_SUPPORTED} - X509V3_R_EXTENSION_SETTING_NOT_SUPPORTED = 103; - {$EXTERNALSYM X509V3_R_EXTENSION_VALUE_ERROR} - X509V3_R_EXTENSION_VALUE_ERROR = 116; - {$EXTERNALSYM X509V3_R_ILLEGAL_EMPTY_EXTENSION} - X509V3_R_ILLEGAL_EMPTY_EXTENSION = 151; - {$EXTERNALSYM X509V3_R_ILLEGAL_HEX_DIGIT} - X509V3_R_ILLEGAL_HEX_DIGIT = 113; - {$EXTERNALSYM X509V3_R_INCORRECT_POLICY_SYNTAX_TAG} - X509V3_R_INCORRECT_POLICY_SYNTAX_TAG = 152; - {$EXTERNALSYM X509V3_R_INVALID_MULTIPLE_RDNS} - X509V3_R_INVALID_MULTIPLE_RDNS = 161; - {$EXTERNALSYM X509V3_R_INVALID_ASNUMBER} - X509V3_R_INVALID_ASNUMBER = 162; - {$EXTERNALSYM X509V3_R_INVALID_ASRANGE} - X509V3_R_INVALID_ASRANGE = 163; - {$EXTERNALSYM X509V3_R_INVALID_BOOLEAN_STRING} - X509V3_R_INVALID_BOOLEAN_STRING = 104; - {$EXTERNALSYM X509V3_R_INVALID_EXTENSION_STRING} - X509V3_R_INVALID_EXTENSION_STRING = 105; - {$EXTERNALSYM X509V3_R_INVALID_INHERITANCE} - X509V3_R_INVALID_INHERITANCE = 165; - {$EXTERNALSYM X509V3_R_INVALID_IPADDRESS} - X509V3_R_INVALID_IPADDRESS = 166; - {$EXTERNALSYM X509V3_R_INVALID_NAME} - X509V3_R_INVALID_NAME = 106; - {$EXTERNALSYM X509V3_R_INVALID_NULL_ARGUMENT} - X509V3_R_INVALID_NULL_ARGUMENT = 107; - {$EXTERNALSYM X509V3_R_INVALID_NULL_NAME} - X509V3_R_INVALID_NULL_NAME = 108; - {$EXTERNALSYM X509V3_R_INVALID_NULL_VALUE} - X509V3_R_INVALID_NULL_VALUE = 109; - {$EXTERNALSYM X509V3_R_INVALID_NUMBER} - X509V3_R_INVALID_NUMBER = 140; - {$EXTERNALSYM X509V3_R_INVALID_NUMBERS} - X509V3_R_INVALID_NUMBERS = 141; - {$EXTERNALSYM X509V3_R_INVALID_OBJECT_IDENTIFIER} - X509V3_R_INVALID_OBJECT_IDENTIFIER = 110; - {$EXTERNALSYM X509V3_R_INVALID_OPTION} - X509V3_R_INVALID_OPTION = 138; - {$EXTERNALSYM X509V3_R_INVALID_POLICY_IDENTIFIER} - X509V3_R_INVALID_POLICY_IDENTIFIER = 134; - {$EXTERNALSYM X509V3_R_INVALID_PROXY_POLICY_SETTING} - X509V3_R_INVALID_PROXY_POLICY_SETTING = 153; - {$EXTERNALSYM X509V3_R_INVALID_PURPOSE} - X509V3_R_INVALID_PURPOSE = 146; - {$EXTERNALSYM X509V3_R_INVALID_SAFI} - X509V3_R_INVALID_SAFI = 164; - {$EXTERNALSYM X509V3_R_INVALID_SECTION} - X509V3_R_INVALID_SECTION = 135; - {$EXTERNALSYM X509V3_R_INVALID_SYNTAX} - X509V3_R_INVALID_SYNTAX = 143; - {$EXTERNALSYM X509V3_R_ISSUER_DECODE_ERROR} - X509V3_R_ISSUER_DECODE_ERROR = 126; - {$EXTERNALSYM X509V3_R_MISSING_VALUE} - X509V3_R_MISSING_VALUE = 124; - {$EXTERNALSYM X509V3_R_NEED_ORGANIZATION_AND_NUMBERS} - X509V3_R_NEED_ORGANIZATION_AND_NUMBERS = 142; - {$EXTERNALSYM X509V3_R_NO_CONFIG_DATABASE} - X509V3_R_NO_CONFIG_DATABASE = 136; - {$EXTERNALSYM X509V3_R_NO_ISSUER_CERTIFICATE} - X509V3_R_NO_ISSUER_CERTIFICATE = 121; - {$EXTERNALSYM X509V3_R_NO_ISSUER_DETAILS} - X509V3_R_NO_ISSUER_DETAILS = 127; - {$EXTERNALSYM X509V3_R_NO_POLICY_IDENTIFIER} - X509V3_R_NO_POLICY_IDENTIFIER = 139; - {$EXTERNALSYM X509V3_R_NO_PROXY_CERT_POLICY_LANGUAGE_DEFINED} - X509V3_R_NO_PROXY_CERT_POLICY_LANGUAGE_DEFINED = 154; - {$EXTERNALSYM X509V3_R_NO_PUBLIC_KEY} - X509V3_R_NO_PUBLIC_KEY = 114; - {$EXTERNALSYM X509V3_R_NO_SUBJECT_DETAILS} - X509V3_R_NO_SUBJECT_DETAILS = 125; - {$EXTERNALSYM X509V3_R_ODD_NUMBER_OF_DIGITS} - X509V3_R_ODD_NUMBER_OF_DIGITS = 112; - {$EXTERNALSYM X509V3_R_OPERATION_NOT_DEFINED} - X509V3_R_OPERATION_NOT_DEFINED = 148; - {$EXTERNALSYM X509V3_R_OTHERNAME_ERROR} - X509V3_R_OTHERNAME_ERROR = 147; - {$EXTERNALSYM X509V3_R_POLICY_LANGUAGE_ALREADY_DEFINED} - X509V3_R_POLICY_LANGUAGE_ALREADY_DEFINED = 155; - {$EXTERNALSYM X509V3_R_POLICY_PATH_LENGTH} - X509V3_R_POLICY_PATH_LENGTH = 156; - {$EXTERNALSYM X509V3_R_POLICY_PATH_LENGTH_ALREADY_DEFINED} - X509V3_R_POLICY_PATH_LENGTH_ALREADY_DEFINED = 157; - {$EXTERNALSYM X509V3_R_POLICY_SYNTAX_NOT_CURRENTLY_SUPPORTED} - X509V3_R_POLICY_SYNTAX_NOT_CURRENTLY_SUPPORTED = 158; - {$EXTERNALSYM X509V3_R_POLICY_WHEN_PROXY_LANGUAGE_REQUIRES_NO_POLICY} - X509V3_R_POLICY_WHEN_PROXY_LANGUAGE_REQUIRES_NO_POLICY = 159; - {$EXTERNALSYM X509V3_R_SECTION_NOT_FOUND} - X509V3_R_SECTION_NOT_FOUND = 150; - {$EXTERNALSYM X509V3_R_UNABLE_TO_GET_ISSUER_DETAILS} - X509V3_R_UNABLE_TO_GET_ISSUER_DETAILS = 122; - {$EXTERNALSYM X509V3_R_UNABLE_TO_GET_ISSUER_KEYID} - X509V3_R_UNABLE_TO_GET_ISSUER_KEYID = 123; - {$EXTERNALSYM X509V3_R_UNKNOWN_BIT_STRING_ARGUMENT} - X509V3_R_UNKNOWN_BIT_STRING_ARGUMENT = 111; - {$EXTERNALSYM X509V3_R_UNKNOWN_EXTENSION} - X509V3_R_UNKNOWN_EXTENSION = 129; - {$EXTERNALSYM X509V3_R_UNKNOWN_EXTENSION_NAME} - X509V3_R_UNKNOWN_EXTENSION_NAME = 130; - {$EXTERNALSYM X509V3_R_UNKNOWN_OPTION} - X509V3_R_UNKNOWN_OPTION = 120; - {$EXTERNALSYM X509V3_R_UNSUPPORTED_OPTION} - X509V3_R_UNSUPPORTED_OPTION = 117; - {$EXTERNALSYM X509V3_R_UNSUPPORTED_TYPE} - X509V3_R_UNSUPPORTED_TYPE = 167; - {$EXTERNALSYM X509V3_R_USER_TOO_LONG} - X509V3_R_USER_TOO_LONG = 132; -//* Possible values for status. See ts_resp_print.c && ts_resp_verify.c. */ - {$EXTERNALSYM TS_STATUS_GRANTED} - TS_STATUS_GRANTED = 0; - {$EXTERNALSYM TS_STATUS_GRANTED_WITH_MODS} - TS_STATUS_GRANTED_WITH_MODS = 1; - {$EXTERNALSYM TS_STATUS_REJECTION} - TS_STATUS_REJECTION = 2; - {$EXTERNALSYM TS_STATUS_WAITING} - TS_STATUS_WAITING = 3; - {$EXTERNALSYM TS_STATUS_REVOCATION_WARNING} - TS_STATUS_REVOCATION_WARNING = 4; - {$EXTERNALSYM TS_STATUS_REVOCATION_NOTIFICATION} - TS_STATUS_REVOCATION_NOTIFICATION = 5; - -//* Possible values for failure_info. See ts_resp_print.c && ts_resp_verify.c */ - {$EXTERNALSYM TS_INFO_BAD_ALG} - TS_INFO_BAD_ALG = 0; - {$EXTERNALSYM TS_INFO_BAD_REQUEST} - TS_INFO_BAD_REQUEST = 2; - {$EXTERNALSYM TS_INFO_BAD_DATA_FORMAT} - TS_INFO_BAD_DATA_FORMAT = 5; - {$EXTERNALSYM TS_INFO_TIME_NOT_AVAILABLE} - TS_INFO_TIME_NOT_AVAILABLE = 14; - {$EXTERNALSYM TS_INFO_UNACCEPTED_POLICY} - TS_INFO_UNACCEPTED_POLICY = 15; - {$EXTERNALSYM TS_INFO_UNACCEPTED_EXTENSION} - TS_INFO_UNACCEPTED_EXTENSION = 16; - {$EXTERNALSYM TS_INFO_ADD_INFO_NOT_AVAILABLE} - TS_INFO_ADD_INFO_NOT_AVAILABLE = 17; - {$EXTERNALSYM TS_INFO_SYSTEM_FAILURE} - TS_INFO_SYSTEM_FAILURE = 25; -//* Declarations related to response generation, defined in ts/ts_resp_sign.c. */ -//* Optional flags for response generation. */ -//* Don't include the TSA name in response. */ - {$EXTERNALSYM TS_TSA_NAME} - TS_TSA_NAME = $01; -//* Set ordering to true in response. */ - {$EXTERNALSYM TS_ORDERING} - TS_ORDERING = $02; -///* -// * Include the signer certificate and the other specified certificates in -// * the ESS signing certificate attribute beside the PKCS7 signed data. -// * Only the signer certificates is included by default. -// */ - {$EXTERNALSYM TS_ESS_CERT_ID_CHAIN} - TS_ESS_CERT_ID_CHAIN = $04; -//* At most we accept usec precision. */ - {$EXTERNALSYM TS_MAX_CLOCK_PRECISION_DIGITS} - TS_MAX_CLOCK_PRECISION_DIGITS = 6; -//* Context structure for the generic verify method. */ - -//* Verify the signer's certificate and the signature of the response. */ - {$EXTERNALSYM TS_VFY_SIGNATURE} - TS_VFY_SIGNATURE = TIdC_ULONG(1 shl 0); -//* Verify the version number of the response. */ - {$EXTERNALSYM TS_VFY_VERSION} - TS_VFY_VERSION = TIdC_ULONG(1 shl 1); - ///* Verify if the policy supplied by the user matches the policy of the TSA. */ - {$EXTERNALSYM TS_VFY_POLICY} - TS_VFY_POLICY = TIdC_ULONG(1 shl 2); - -///* Verify the message imprint provided by the user. This flag should not be -// specified with TS_VFY_DATA. */ - {$EXTERNALSYM TS_VFY_IMPRINT} - TS_VFY_IMPRINT = TIdC_ULONG(1 shl 3); -///* Verify the message imprint computed by the verify method from the user -// provided data and the MD algorithm of the response. This flag should not be -// specified with TS_VFY_IMPRINT. */ - {$EXTERNALSYM TS_VFY_DATA} - TS_VFY_DATA = TIdC_ULONG(1 shl 4); -//* Verify the nonce value. */ - {$EXTERNALSYM TS_VFY_NONCE} - TS_VFY_NONCE = TIdC_ULONG(1 shl 5); -//* Verify if the TSA name field matches the signer certificate. */ - {$EXTERNALSYM TS_VFY_SIGNER} - TS_VFY_SIGNER = TIdC_ULONG(1 shl 6); -//* Verify if the TSA name field equals to the user provided name. */ - {$EXTERNALSYM TS_VFY_TSA_NAME} - TS_VFY_TSA_NAME = TIdC_ULONG(1 shl 7); - -//* You can use the following convenience constants. */ - {$EXTERNALSYM TS_VFY_ALL_IMPRINT} - TS_VFY_ALL_IMPRINT = (TS_VFY_SIGNATURE - or TS_VFY_VERSION - or TS_VFY_POLICY - or TS_VFY_IMPRINT - or TS_VFY_NONCE - or TS_VFY_SIGNER - or TS_VFY_TSA_NAME); - {$EXTERNALSYM TS_VFY_ALL_DATA} - TS_VFY_ALL_DATA = (TS_VFY_SIGNATURE - or TS_VFY_VERSION - or TS_VFY_POLICY - or TS_VFY_DATA - or TS_VFY_NONCE - or TS_VFY_SIGNER - or TS_VFY_TSA_NAME); - -//* Error codes for the TS functions. */ - - -//* Function codes. */ - {$EXTERNALSYM TS_F_D2I_TS_RESP} - TS_F_D2I_TS_RESP = 147; - {$EXTERNALSYM TS_F_DEF_SERIAL_CB} - TS_F_DEF_SERIAL_CB = 110; - {$EXTERNALSYM TS_F_DEF_TIME_CB} - TS_F_DEF_TIME_CB = 111; - {$EXTERNALSYM TS_F_ESS_ADD_SIGNING_CERT} - TS_F_ESS_ADD_SIGNING_CERT = 112; - {$EXTERNALSYM TS_F_ESS_CERT_ID_NEW_INIT} - TS_F_ESS_CERT_ID_NEW_INIT = 113; - {$EXTERNALSYM TS_F_ESS_SIGNING_CERT_NEW_INIT} - TS_F_ESS_SIGNING_CERT_NEW_INIT = 114; - {$EXTERNALSYM TS_F_INT_TS_RESP_VERIFY_TOKEN} - TS_F_INT_TS_RESP_VERIFY_TOKEN = 149; - {$EXTERNALSYM TS_F_PKCS7_TO_TS_TST_INFO} - TS_F_PKCS7_TO_TS_TST_INFO = 148; - {$EXTERNALSYM TS_F_TS_ACCURACY_SET_MICROS} - TS_F_TS_ACCURACY_SET_MICROS = 115; - {$EXTERNALSYM TS_F_TS_ACCURACY_SET_MILLIS} - TS_F_TS_ACCURACY_SET_MILLIS = 116; - {$EXTERNALSYM TS_F_TS_ACCURACY_SET_SECONDS} - TS_F_TS_ACCURACY_SET_SECONDS = 117; - {$EXTERNALSYM TS_F_TS_CHECK_IMPRINTS} - TS_F_TS_CHECK_IMPRINTS = 100; - {$EXTERNALSYM TS_F_TS_CHECK_NONCES} - TS_F_TS_CHECK_NONCES = 101; - {$EXTERNALSYM TS_F_TS_CHECK_POLICY} - TS_F_TS_CHECK_POLICY = 102; - {$EXTERNALSYM TS_F_TS_CHECK_SIGNING_CERTS} - TS_F_TS_CHECK_SIGNING_CERTS = 103; - {$EXTERNALSYM TS_F_TS_CHECK_STATUS_INFO} - TS_F_TS_CHECK_STATUS_INFO = 104; - {$EXTERNALSYM TS_F_TS_COMPUTE_IMPRINT} - TS_F_TS_COMPUTE_IMPRINT = 145; - {$EXTERNALSYM TS_F_TS_CONF_SET_DEFAULT_ENGINE} - TS_F_TS_CONF_SET_DEFAULT_ENGINE = 146; - {$EXTERNALSYM TS_F_TS_GET_STATUS_TEXT} - TS_F_TS_GET_STATUS_TEXT = 105; - {$EXTERNALSYM TS_F_TS_MSG_IMPRINT_SET_ALGO} - TS_F_TS_MSG_IMPRINT_SET_ALGO = 118; - {$EXTERNALSYM TS_F_TS_REQ_SET_MSG_IMPRINT} - TS_F_TS_REQ_SET_MSG_IMPRINT = 119; - {$EXTERNALSYM TS_F_TS_REQ_SET_NONCE} - TS_F_TS_REQ_SET_NONCE = 120; - {$EXTERNALSYM TS_F_TS_REQ_SET_POLICY_ID} - TS_F_TS_REQ_SET_POLICY_ID = 121; - {$EXTERNALSYM TS_F_TS_RESP_CREATE_RESPONSE} - TS_F_TS_RESP_CREATE_RESPONSE = 122; - {$EXTERNALSYM TS_F_TS_RESP_CREATE_TST_INFO} - TS_F_TS_RESP_CREATE_TST_INFO = 123; - {$EXTERNALSYM TS_F_TS_RESP_CTX_ADD_FAILURE_INFO} - TS_F_TS_RESP_CTX_ADD_FAILURE_INFO = 124; - {$EXTERNALSYM TS_F_TS_RESP_CTX_ADD_MD} - TS_F_TS_RESP_CTX_ADD_MD = 125; - {$EXTERNALSYM TS_F_TS_RESP_CTX_ADD_POLICY} - TS_F_TS_RESP_CTX_ADD_POLICY = 126; - {$EXTERNALSYM TS_F_TS_RESP_CTX_NEW} - TS_F_TS_RESP_CTX_NEW = 127; - {$EXTERNALSYM TS_F_TS_RESP_CTX_SET_ACCURACY} - TS_F_TS_RESP_CTX_SET_ACCURACY = 128; - {$EXTERNALSYM TS_F_TS_RESP_CTX_SET_CERTS} - TS_F_TS_RESP_CTX_SET_CERTS = 129; - {$EXTERNALSYM TS_F_TS_RESP_CTX_SET_DEF_POLICY} - TS_F_TS_RESP_CTX_SET_DEF_POLICY = 130; - {$EXTERNALSYM TS_F_TS_RESP_CTX_SET_SIGNER_CERT} - TS_F_TS_RESP_CTX_SET_SIGNER_CERT = 131; - {$EXTERNALSYM TS_F_TS_RESP_CTX_SET_STATUS_INFO} - TS_F_TS_RESP_CTX_SET_STATUS_INFO = 132; - {$EXTERNALSYM TS_F_TS_RESP_GET_POLICY} - TS_F_TS_RESP_GET_POLICY = 133; - {$EXTERNALSYM TS_F_TS_RESP_SET_GENTIME_WITH_PRECISION} - TS_F_TS_RESP_SET_GENTIME_WITH_PRECISION = 134; - {$EXTERNALSYM TS_F_TS_RESP_SET_STATUS_INFO} - TS_F_TS_RESP_SET_STATUS_INFO = 135; - {$EXTERNALSYM TS_F_TS_RESP_SET_TST_INFO} - TS_F_TS_RESP_SET_TST_INFO = 150; - {$EXTERNALSYM TS_F_TS_RESP_SIGN} - TS_F_TS_RESP_SIGN = 136; - {$EXTERNALSYM TS_F_TS_RESP_VERIFY_SIGNATURE} - TS_F_TS_RESP_VERIFY_SIGNATURE = 106; - {$EXTERNALSYM TS_F_TS_RESP_VERIFY_TOKEN} - TS_F_TS_RESP_VERIFY_TOKEN = 107; - {$EXTERNALSYM TS_F_TS_TST_INFO_SET_ACCURACY} - TS_F_TS_TST_INFO_SET_ACCURACY = 137; - {$EXTERNALSYM TS_F_TS_TST_INFO_SET_MSG_IMPRINT} - TS_F_TS_TST_INFO_SET_MSG_IMPRINT = 138; - {$EXTERNALSYM TS_F_TS_TST_INFO_SET_NONCE} - TS_F_TS_TST_INFO_SET_NONCE = 139; - {$EXTERNALSYM TS_F_TS_TST_INFO_SET_POLICY_ID} - TS_F_TS_TST_INFO_SET_POLICY_ID = 140; - {$EXTERNALSYM TS_F_TS_TST_INFO_SET_SERIAL} - TS_F_TS_TST_INFO_SET_SERIAL = 141; - {$EXTERNALSYM TS_F_TS_TST_INFO_SET_TIME} - TS_F_TS_TST_INFO_SET_TIME = 142; - {$EXTERNALSYM TS_F_TS_TST_INFO_SET_TSA} - TS_F_TS_TST_INFO_SET_TSA = 143; - {$EXTERNALSYM TS_F_TS_VERIFY} - TS_F_TS_VERIFY = 108; - {$EXTERNALSYM TS_F_TS_VERIFY_CERT} - TS_F_TS_VERIFY_CERT = 109; - {$EXTERNALSYM TS_F_TS_VERIFY_CTX_NEW} - TS_F_TS_VERIFY_CTX_NEW = 144; - -//* Reason codes. */ - {$EXTERNALSYM TS_R_BAD_PKCS7_TYPE} - TS_R_BAD_PKCS7_TYPE = 132; - {$EXTERNALSYM TS_R_BAD_TYPE} - TS_R_BAD_TYPE = 133; - {$EXTERNALSYM TS_R_CERTIFICATE_VERIFY_ERROR} - TS_R_CERTIFICATE_VERIFY_ERROR = 100; - {$EXTERNALSYM TS_R_COULD_NOT_SET_ENGINE} - TS_R_COULD_NOT_SET_ENGINE = 127; - {$EXTERNALSYM TS_R_COULD_NOT_SET_TIME} - TS_R_COULD_NOT_SET_TIME = 115; - {$EXTERNALSYM TS_R_D2I_TS_RESP_INT_FAILED} - TS_R_D2I_TS_RESP_INT_FAILED = 128; - {$EXTERNALSYM TS_R_DETACHED_CONTENT} - TS_R_DETACHED_CONTENT = 134; - {$EXTERNALSYM TS_R_ESS_ADD_SIGNING_CERT_ERROR} - TS_R_ESS_ADD_SIGNING_CERT_ERROR = 116; - {$EXTERNALSYM TS_R_ESS_SIGNING_CERTIFICATE_ERROR} - TS_R_ESS_SIGNING_CERTIFICATE_ERROR = 101; - {$EXTERNALSYM TS_R_INVALID_NULL_POINTER} - TS_R_INVALID_NULL_POINTER = 102; - {$EXTERNALSYM TS_R_INVALID_SIGNER_CERTIFICATE_PURPOSE} - TS_R_INVALID_SIGNER_CERTIFICATE_PURPOSE = 117; - {$EXTERNALSYM TS_R_MESSAGE_IMPRINT_MISMATCH} - TS_R_MESSAGE_IMPRINT_MISMATCH = 103; - {$EXTERNALSYM TS_R_NONCE_MISMATCH} - TS_R_NONCE_MISMATCH = 104; - {$EXTERNALSYM TS_R_NONCE_NOT_RETURNED} - TS_R_NONCE_NOT_RETURNED = 105; - {$EXTERNALSYM TS_R_NO_CONTENT} - TS_R_NO_CONTENT = 106; - {$EXTERNALSYM TS_R_NO_TIME_STAMP_TOKEN} - TS_R_NO_TIME_STAMP_TOKEN = 107; - {$EXTERNALSYM TS_R_PKCS7_ADD_SIGNATURE_ERROR} - TS_R_PKCS7_ADD_SIGNATURE_ERROR = 118; - {$EXTERNALSYM TS_R_PKCS7_ADD_SIGNED_ATTR_ERROR} - TS_R_PKCS7_ADD_SIGNED_ATTR_ERROR = 119; - {$EXTERNALSYM TS_R_PKCS7_TO_TS_TST_INFO_FAILED} - TS_R_PKCS7_TO_TS_TST_INFO_FAILED = 129; - {$EXTERNALSYM TS_R_POLICY_MISMATCH} - TS_R_POLICY_MISMATCH = 108; - {$EXTERNALSYM TS_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE} - TS_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE = 120; - {$EXTERNALSYM TS_R_RESPONSE_SETUP_ERROR} - TS_R_RESPONSE_SETUP_ERROR = 121; - {$EXTERNALSYM TS_R_SIGNATURE_FAILURE} - TS_R_SIGNATURE_FAILURE = 109; - {$EXTERNALSYM TS_R_THERE_MUST_BE_ONE_SIGNER} - TS_R_THERE_MUST_BE_ONE_SIGNER = 110; - {$EXTERNALSYM TS_R_TIME_SYSCALL_ERROR} - TS_R_TIME_SYSCALL_ERROR = 122; - {$EXTERNALSYM TS_R_TOKEN_NOT_PRESENT} - TS_R_TOKEN_NOT_PRESENT = 130; - {$EXTERNALSYM TS_R_TOKEN_PRESENT} - TS_R_TOKEN_PRESENT = 131; - {$EXTERNALSYM TS_R_TSA_NAME_MISMATCH} - TS_R_TSA_NAME_MISMATCH = 111; - {$EXTERNALSYM TS_R_TSA_UNTRUSTED} - TS_R_TSA_UNTRUSTED = 112; - {$EXTERNALSYM TS_R_TST_INFO_SETUP_ERROR} - TS_R_TST_INFO_SETUP_ERROR = 123; - {$EXTERNALSYM TS_R_TS_DATASIGN} - TS_R_TS_DATASIGN = 124; - {$EXTERNALSYM TS_R_UNACCEPTABLE_POLICY} - TS_R_UNACCEPTABLE_POLICY = 125; - {$EXTERNALSYM TS_R_UNSUPPORTED_MD_ALGORITHM} - TS_R_UNSUPPORTED_MD_ALGORITHM = 126; - {$EXTERNALSYM TS_R_UNSUPPORTED_VERSION} - TS_R_UNSUPPORTED_VERSION = 113; - {$EXTERNALSYM TS_R_WRONG_CONTENT_TYPE} - TS_R_WRONG_CONTENT_TYPE = 114; - - {$UNDEF OPENSSL_NO_CMS} - {$IFNDEF OPENSSL_NO_CMS} - {$EXTERNALSYM CMS_SIGNERINFO_ISSUER_SERIAL} - CMS_SIGNERINFO_ISSUER_SERIAL = 0; - {$EXTERNALSYM CMS_SIGNERINFO_KEYIDENTIFIER} - CMS_SIGNERINFO_KEYIDENTIFIER = 1; - {$EXTERNALSYM CMS_RECIPINFO_TRANS} - CMS_RECIPINFO_TRANS = 0; - {$EXTERNALSYM CMS_RECIPINFO_AGREE} - CMS_RECIPINFO_AGREE = 1; - {$EXTERNALSYM CMS_RECIPINFO_KEK} - CMS_RECIPINFO_KEK = 2; - {$EXTERNALSYM CMS_RECIPINFO_PASS} - CMS_RECIPINFO_PASS = 3; - {$EXTERNALSYM CMS_RECIPINFO_OTHER} - CMS_RECIPINFO_OTHER = 4; - -//* S/MIME related flags */ - {$EXTERNALSYM CMS_TEXT} - CMS_TEXT = $1; - {$EXTERNALSYM CMS_NOCERTS} - CMS_NOCERTS = $2; - {$EXTERNALSYM CMS_NO_CONTENT_VERIFY} - CMS_NO_CONTENT_VERIFY = $4; - {$EXTERNALSYM CMS_NO_ATTR_VERIFY} - CMS_NO_ATTR_VERIFY = $8; - {$EXTERNALSYM CMS_NOSIGS} - CMS_NOSIGS = (CMS_NO_CONTENT_VERIFY or CMS_NO_ATTR_VERIFY); - {$EXTERNALSYM CMS_NOINTERN} - CMS_NOINTERN = $10; - {$EXTERNALSYM CMS_NO_SIGNER_CERT_VERIFY} - CMS_NO_SIGNER_CERT_VERIFY = $20; - {$EXTERNALSYM CMS_NOVERIFY} - CMS_NOVERIFY = $20; - {$EXTERNALSYM CMS_DETACHED} - CMS_DETACHED = $40; - {$EXTERNALSYM CMS_BINARY} - CMS_BINARY = $80; - {$EXTERNALSYM CMS_NOATTR} - CMS_NOATTR = $100; - {$EXTERNALSYM CMS_NOSMIMECAP} - CMS_NOSMIMECAP = $200; - {$EXTERNALSYM CMS_NOOLDMIMETYPE} - CMS_NOOLDMIMETYPE = $400; - {$EXTERNALSYM CMS_CRLFEOL} - CMS_CRLFEOL = $800; - {$EXTERNALSYM CMS_STREAM} - CMS_STREAM = $1000; - {$EXTERNALSYM CMS_NOCRL} - CMS_NOCRL = $2000; - {$EXTERNALSYM CMS_PARTIAL} - CMS_PARTIAL = $4000; - {$EXTERNALSYM CMS_REUSE_DIGEST} - CMS_REUSE_DIGEST = $8000; - {$EXTERNALSYM CMS_USE_KEYID} - CMS_USE_KEYID = $10000; - -//* Error codes for the CMS functions. */ - -//* Function codes. */ - {$EXTERNALSYM CMS_F_CHECK_CONTENT} - CMS_F_CHECK_CONTENT = 99; - {$EXTERNALSYM CMS_F_CMS_ADD0_CERT} - CMS_F_CMS_ADD0_CERT = 164; - {$EXTERNALSYM CMS_F_CMS_ADD0_RECIPIENT_KEY} - CMS_F_CMS_ADD0_RECIPIENT_KEY = 100; - {$EXTERNALSYM CMS_F_CMS_ADD1_RECEIPTREQUEST} - CMS_F_CMS_ADD1_RECEIPTREQUEST = 158; - {$EXTERNALSYM CMS_F_CMS_ADD1_RECIPIENT_CERT} - CMS_F_CMS_ADD1_RECIPIENT_CERT = 101; - {$EXTERNALSYM CMS_F_CMS_ADD1_SIGNER} - CMS_F_CMS_ADD1_SIGNER = 102; - {$EXTERNALSYM CMS_F_CMS_ADD1_SIGNINGTIME} - CMS_F_CMS_ADD1_SIGNINGTIME = 103; - {$EXTERNALSYM CMS_F_CMS_COMPRESS} - CMS_F_CMS_COMPRESS = 104; - {$EXTERNALSYM CMS_F_CMS_COMPRESSEDDATA_CREATE} - CMS_F_CMS_COMPRESSEDDATA_CREATE = 105; - {$EXTERNALSYM CMS_F_CMS_COMPRESSEDDATA_INIT_BIO} - CMS_F_CMS_COMPRESSEDDATA_INIT_BIO = 106; - {$EXTERNALSYM CMS_F_CMS_COPY_CONTENT} - CMS_F_CMS_COPY_CONTENT = 107; - {$EXTERNALSYM CMS_F_CMS_COPY_MESSAGEDIGEST} - CMS_F_CMS_COPY_MESSAGEDIGEST = 108; - {$EXTERNALSYM CMS_F_CMS_DATA} - CMS_F_CMS_DATA = 109; - {$EXTERNALSYM CMS_F_CMS_DATAFINAL} - CMS_F_CMS_DATAFINAL = 110; - {$EXTERNALSYM CMS_F_CMS_DATAINIT} - CMS_F_CMS_DATAINIT = 111; - {$EXTERNALSYM CMS_F_CMS_DECRYPT} - CMS_F_CMS_DECRYPT = 112; - {$EXTERNALSYM CMS_F_CMS_DECRYPT_SET1_KEY} - CMS_F_CMS_DECRYPT_SET1_KEY = 113; - {$EXTERNALSYM CMS_F_CMS_DECRYPT_SET1_PKEY} - CMS_F_CMS_DECRYPT_SET1_PKEY = 114; - {$EXTERNALSYM CMS_F_CMS_DIGESTALGORITHM_FIND_CTX} - CMS_F_CMS_DIGESTALGORITHM_FIND_CTX = 115; - {$EXTERNALSYM CMS_F_CMS_DIGESTALGORITHM_INIT_BIO} - CMS_F_CMS_DIGESTALGORITHM_INIT_BIO = 116; - {$EXTERNALSYM CMS_F_CMS_DIGESTEDDATA_DO_FINAL} - CMS_F_CMS_DIGESTEDDATA_DO_FINAL = 117; - {$EXTERNALSYM CMS_F_CMS_DIGEST_VERIFY} - CMS_F_CMS_DIGEST_VERIFY = 118; - {$EXTERNALSYM CMS_F_CMS_ENCODE_RECEIPT} - CMS_F_CMS_ENCODE_RECEIPT = 161; - {$EXTERNALSYM CMS_F_CMS_ENCRYPT} - CMS_F_CMS_ENCRYPT = 119; - {$EXTERNALSYM CMS_F_CMS_ENCRYPTEDCONTENT_INIT_BIO} - CMS_F_CMS_ENCRYPTEDCONTENT_INIT_BIO = 120; - {$EXTERNALSYM CMS_F_CMS_ENCRYPTEDDATA_DECRYPT} - CMS_F_CMS_ENCRYPTEDDATA_DECRYPT = 121; - {$EXTERNALSYM CMS_F_CMS_ENCRYPTEDDATA_ENCRYPT} - CMS_F_CMS_ENCRYPTEDDATA_ENCRYPT = 122; - {$EXTERNALSYM CMS_F_CMS_ENCRYPTEDDATA_SET1_KEY} - CMS_F_CMS_ENCRYPTEDDATA_SET1_KEY = 123; - {$EXTERNALSYM CMS_F_CMS_ENVELOPEDDATA_CREATE} - CMS_F_CMS_ENVELOPEDDATA_CREATE = 124; - {$EXTERNALSYM CMS_F_CMS_ENVELOPEDDATA_INIT_BIO} - CMS_F_CMS_ENVELOPEDDATA_INIT_BIO = 125; - {$EXTERNALSYM CMS_F_CMS_ENVELOPED_DATA_INIT} - CMS_F_CMS_ENVELOPED_DATA_INIT = 126; - {$EXTERNALSYM CMS_F_CMS_FINAL} - CMS_F_CMS_FINAL = 127; - {$EXTERNALSYM CMS_F_CMS_GET0_CERTIFICATE_CHOICES} - CMS_F_CMS_GET0_CERTIFICATE_CHOICES = 128; - {$EXTERNALSYM CMS_F_CMS_GET0_CONTENT} - CMS_F_CMS_GET0_CONTENT = 129; - {$EXTERNALSYM CMS_F_CMS_GET0_ECONTENT_TYPE} - CMS_F_CMS_GET0_ECONTENT_TYPE = 130; - {$EXTERNALSYM CMS_F_CMS_GET0_ENVELOPED} - CMS_F_CMS_GET0_ENVELOPED = 131; - {$EXTERNALSYM CMS_F_CMS_GET0_REVOCATION_CHOICES} - CMS_F_CMS_GET0_REVOCATION_CHOICES = 132; - {$EXTERNALSYM CMS_F_CMS_GET0_SIGNED} - CMS_F_CMS_GET0_SIGNED = 133; - {$EXTERNALSYM CMS_F_CMS_MSGSIGDIGEST_ADD1} - CMS_F_CMS_MSGSIGDIGEST_ADD1 = 162; - {$EXTERNALSYM CMS_F_CMS_RECEIPTREQUEST_CREATE0} - CMS_F_CMS_RECEIPTREQUEST_CREATE0 = 159; - {$EXTERNALSYM CMS_F_CMS_RECEIPT_VERIFY} - CMS_F_CMS_RECEIPT_VERIFY = 160; - {$EXTERNALSYM CMS_F_CMS_RECIPIENTINFO_DECRYPT} - CMS_F_CMS_RECIPIENTINFO_DECRYPT = 134; - {$EXTERNALSYM CMS_F_CMS_RECIPIENTINFO_KEKRI_DECRYPT} - CMS_F_CMS_RECIPIENTINFO_KEKRI_DECRYPT = 135; - {$EXTERNALSYM CMS_F_CMS_RECIPIENTINFO_KEKRI_ENCRYPT} - CMS_F_CMS_RECIPIENTINFO_KEKRI_ENCRYPT = 136; - {$EXTERNALSYM CMS_F_CMS_RECIPIENTINFO_KEKRI_GET0_ID} - CMS_F_CMS_RECIPIENTINFO_KEKRI_GET0_ID = 137; - {$EXTERNALSYM CMS_F_CMS_RECIPIENTINFO_KEKRI_ID_CMP} - CMS_F_CMS_RECIPIENTINFO_KEKRI_ID_CMP = 138; - {$EXTERNALSYM CMS_F_CMS_RECIPIENTINFO_KTRI_CERT_CMP} - CMS_F_CMS_RECIPIENTINFO_KTRI_CERT_CMP = 139; - {$EXTERNALSYM CMS_F_CMS_RECIPIENTINFO_KTRI_DECRYPT} - CMS_F_CMS_RECIPIENTINFO_KTRI_DECRYPT = 140; - {$EXTERNALSYM CMS_F_CMS_RECIPIENTINFO_KTRI_ENCRYPT} - CMS_F_CMS_RECIPIENTINFO_KTRI_ENCRYPT = 141; - {$EXTERNALSYM CMS_F_CMS_RECIPIENTINFO_KTRI_GET0_ALGS} - CMS_F_CMS_RECIPIENTINFO_KTRI_GET0_ALGS = 142; - {$EXTERNALSYM CMS_F_CMS_RECIPIENTINFO_KTRI_GET0_SIGNER_ID} - CMS_F_CMS_RECIPIENTINFO_KTRI_GET0_SIGNER_ID = 143; - {$EXTERNALSYM CMS_F_CMS_RECIPIENTINFO_SET0_KEY} - CMS_F_CMS_RECIPIENTINFO_SET0_KEY = 144; - {$EXTERNALSYM CMS_F_CMS_RECIPIENTINFO_SET0_PKEY} - CMS_F_CMS_RECIPIENTINFO_SET0_PKEY = 145; - {$EXTERNALSYM CMS_F_CMS_SET1_SIGNERIDENTIFIER} - CMS_F_CMS_SET1_SIGNERIDENTIFIER = 146; - {$EXTERNALSYM CMS_F_CMS_SET_DETACHED} - CMS_F_CMS_SET_DETACHED = 147; - {$EXTERNALSYM CMS_F_CMS_SIGN} - CMS_F_CMS_SIGN = 148; - {$EXTERNALSYM CMS_F_CMS_SIGNED_DATA_INIT} - CMS_F_CMS_SIGNED_DATA_INIT = 149; - {$EXTERNALSYM CMS_F_CMS_SIGNERINFO_CONTENT_SIGN} - CMS_F_CMS_SIGNERINFO_CONTENT_SIGN = 150; - {$EXTERNALSYM CMS_F_CMS_SIGNERINFO_SIGN} - CMS_F_CMS_SIGNERINFO_SIGN = 151; - {$EXTERNALSYM CMS_F_CMS_SIGNERINFO_VERIFY} - CMS_F_CMS_SIGNERINFO_VERIFY = 152; - {$EXTERNALSYM CMS_F_CMS_SIGNERINFO_VERIFY_CERT} - CMS_F_CMS_SIGNERINFO_VERIFY_CERT = 153; - {$EXTERNALSYM CMS_F_CMS_SIGNERINFO_VERIFY_CONTENT} - CMS_F_CMS_SIGNERINFO_VERIFY_CONTENT = 154; - {$EXTERNALSYM CMS_F_CMS_SIGN_RECEIPT} - CMS_F_CMS_SIGN_RECEIPT = 163; - {$EXTERNALSYM CMS_F_CMS_STREAM} - CMS_F_CMS_STREAM = 155; - {$EXTERNALSYM CMS_F_CMS_UNCOMPRESS} - CMS_F_CMS_UNCOMPRESS = 156; - {$EXTERNALSYM CMS_F_CMS_VERIFY} - CMS_F_CMS_VERIFY = 157; - -//* Reason codes. */ - {$EXTERNALSYM CMS_R_ADD_SIGNER_ERROR} - CMS_R_ADD_SIGNER_ERROR = 99; - {$EXTERNALSYM CMS_R_CERTIFICATE_ALREADY_PRESENT} - CMS_R_CERTIFICATE_ALREADY_PRESENT = 175; - {$EXTERNALSYM CMS_R_CERTIFICATE_HAS_NO_KEYID} - CMS_R_CERTIFICATE_HAS_NO_KEYID = 160; - {$EXTERNALSYM CMS_R_CERTIFICATE_VERIFY_ERROR} - CMS_R_CERTIFICATE_VERIFY_ERROR = 100; - {$EXTERNALSYM CMS_R_CIPHER_INITIALISATION_ERROR} - CMS_R_CIPHER_INITIALISATION_ERROR = 101; - {$EXTERNALSYM CMS_R_CIPHER_PARAMETER_INITIALISATION_ERROR} - CMS_R_CIPHER_PARAMETER_INITIALISATION_ERROR = 102; - {$EXTERNALSYM CMS_R_CMS_DATAFINAL_ERROR} - CMS_R_CMS_DATAFINAL_ERROR = 103; - {$EXTERNALSYM CMS_R_CMS_LIB} - CMS_R_CMS_LIB = 104; - {$EXTERNALSYM CMS_R_CONTENTIDENTIFIER_MISMATCH} - CMS_R_CONTENTIDENTIFIER_MISMATCH = 170; - {$EXTERNALSYM CMS_R_CONTENT_NOT_FOUND} - CMS_R_CONTENT_NOT_FOUND = 105; - {$EXTERNALSYM CMS_R_CONTENT_TYPE_MISMATCH} - CMS_R_CONTENT_TYPE_MISMATCH = 171; - {$EXTERNALSYM CMS_R_CONTENT_TYPE_NOT_COMPRESSED_DATA} - CMS_R_CONTENT_TYPE_NOT_COMPRESSED_DATA = 106; - {$EXTERNALSYM CMS_R_CONTENT_TYPE_NOT_ENVELOPED_DATA} - CMS_R_CONTENT_TYPE_NOT_ENVELOPED_DATA = 107; - {$EXTERNALSYM CMS_R_CONTENT_TYPE_NOT_SIGNED_DATA} - CMS_R_CONTENT_TYPE_NOT_SIGNED_DATA = 108; - {$EXTERNALSYM CMS_R_CONTENT_VERIFY_ERROR} - CMS_R_CONTENT_VERIFY_ERROR = 109; - {$EXTERNALSYM CMS_R_CTRL_ERROR} - CMS_R_CTRL_ERROR = 110; - {$EXTERNALSYM CMS_R_CTRL_FAILURE} - CMS_R_CTRL_FAILURE = 111; - {$EXTERNALSYM CMS_R_DECRYPT_ERROR} - CMS_R_DECRYPT_ERROR = 112; - {$EXTERNALSYM CMS_R_DIGEST_ERROR} - CMS_R_DIGEST_ERROR = 161; - {$EXTERNALSYM CMS_R_ERROR_GETTING_PUBLIC_KEY} - CMS_R_ERROR_GETTING_PUBLIC_KEY = 113; - {$EXTERNALSYM CMS_R_ERROR_READING_MESSAGEDIGEST_ATTRIBUTE} - CMS_R_ERROR_READING_MESSAGEDIGEST_ATTRIBUTE = 114; - {$EXTERNALSYM CMS_R_ERROR_SETTING_KEY} - CMS_R_ERROR_SETTING_KEY = 115; - {$EXTERNALSYM CMS_R_ERROR_SETTING_RECIPIENTINFO} - CMS_R_ERROR_SETTING_RECIPIENTINFO = 116; - {$EXTERNALSYM CMS_R_INVALID_ENCRYPTED_KEY_LENGTH} - CMS_R_INVALID_ENCRYPTED_KEY_LENGTH = 117; - {$EXTERNALSYM CMS_R_INVALID_KEY_LENGTH} - CMS_R_INVALID_KEY_LENGTH = 118; - {$EXTERNALSYM CMS_R_MD_BIO_INIT_ERROR} - CMS_R_MD_BIO_INIT_ERROR = 119; - {$EXTERNALSYM CMS_R_MESSAGEDIGEST_ATTRIBUTE_WRONG_LENGTH} - CMS_R_MESSAGEDIGEST_ATTRIBUTE_WRONG_LENGTH = 120; - {$EXTERNALSYM CMS_R_MESSAGEDIGEST_WRONG_LENGTH} - CMS_R_MESSAGEDIGEST_WRONG_LENGTH = 121; - {$EXTERNALSYM CMS_R_MSGSIGDIGEST_ERROR} - CMS_R_MSGSIGDIGEST_ERROR = 172; - {$EXTERNALSYM CMS_R_MSGSIGDIGEST_VERIFICATION_FAILURE} - CMS_R_MSGSIGDIGEST_VERIFICATION_FAILURE = 162; - {$EXTERNALSYM CMS_R_MSGSIGDIGEST_WRONG_LENGTH} - CMS_R_MSGSIGDIGEST_WRONG_LENGTH = 163; - {$EXTERNALSYM CMS_R_NEED_ONE_SIGNER} - CMS_R_NEED_ONE_SIGNER = 164; - {$EXTERNALSYM CMS_R_NOT_A_SIGNED_RECEIPT} - CMS_R_NOT_A_SIGNED_RECEIPT = 165; - {$EXTERNALSYM CMS_R_NOT_ENCRYPTED_DATA} - CMS_R_NOT_ENCRYPTED_DATA = 122; - {$EXTERNALSYM CMS_R_NOT_KEK} - CMS_R_NOT_KEK = 123; - {$EXTERNALSYM CMS_R_NOT_KEY_TRANSPORT} - CMS_R_NOT_KEY_TRANSPORT = 124; - {$EXTERNALSYM CMS_R_NOT_SUPPORTED_FOR_THIS_KEY_TYPE} - CMS_R_NOT_SUPPORTED_FOR_THIS_KEY_TYPE = 125; - {$EXTERNALSYM CMS_R_NO_CIPHER} - CMS_R_NO_CIPHER = 126; - {$EXTERNALSYM CMS_R_NO_CONTENT} - CMS_R_NO_CONTENT = 127; - {$EXTERNALSYM CMS_R_NO_CONTENT_TYPE} - CMS_R_NO_CONTENT_TYPE = 173; - {$EXTERNALSYM CMS_R_NO_DEFAULT_DIGEST} - CMS_R_NO_DEFAULT_DIGEST = 128; - {$EXTERNALSYM CMS_R_NO_DIGEST_SET} - CMS_R_NO_DIGEST_SET = 129; - {$EXTERNALSYM CMS_R_NO_KEY} - CMS_R_NO_KEY = 130; - {$EXTERNALSYM CMS_R_NO_KEY_OR_CERT} - CMS_R_NO_KEY_OR_CERT = 174; - {$EXTERNALSYM CMS_R_NO_MATCHING_DIGEST} - CMS_R_NO_MATCHING_DIGEST = 131; - {$EXTERNALSYM CMS_R_NO_MATCHING_RECIPIENT} - CMS_R_NO_MATCHING_RECIPIENT = 132; - {$EXTERNALSYM CMS_R_NO_MATCHING_SIGNATURE} - CMS_R_NO_MATCHING_SIGNATURE = 166; - {$EXTERNALSYM CMS_R_NO_MSGSIGDIGEST} - CMS_R_NO_MSGSIGDIGEST = 167; - {$EXTERNALSYM CMS_R_NO_PRIVATE_KEY} - CMS_R_NO_PRIVATE_KEY = 133; - {$EXTERNALSYM CMS_R_NO_PUBLIC_KEY} - CMS_R_NO_PUBLIC_KEY = 134; - {$EXTERNALSYM CMS_R_NO_RECEIPT_REQUEST} - CMS_R_NO_RECEIPT_REQUEST = 168; - {$EXTERNALSYM CMS_R_NO_SIGNERS} - CMS_R_NO_SIGNERS = 135; - {$EXTERNALSYM CMS_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE} - CMS_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE = 136; - {$EXTERNALSYM CMS_R_RECEIPT_DECODE_ERROR} - CMS_R_RECEIPT_DECODE_ERROR = 169; - {$EXTERNALSYM CMS_R_RECIPIENT_ERROR} - CMS_R_RECIPIENT_ERROR = 137; - {$EXTERNALSYM CMS_R_SIGNER_CERTIFICATE_NOT_FOUND} - CMS_R_SIGNER_CERTIFICATE_NOT_FOUND = 138; - {$EXTERNALSYM CMS_R_SIGNFINAL_ERROR} - CMS_R_SIGNFINAL_ERROR = 139; - {$EXTERNALSYM CMS_R_SMIME_TEXT_ERROR} - CMS_R_SMIME_TEXT_ERROR = 140; - {$EXTERNALSYM CMS_R_STORE_INIT_ERROR} - CMS_R_STORE_INIT_ERROR = 141; - {$EXTERNALSYM CMS_R_TYPE_NOT_COMPRESSED_DATA} - CMS_R_TYPE_NOT_COMPRESSED_DATA = 142; - {$EXTERNALSYM CMS_R_TYPE_NOT_DATA} - CMS_R_TYPE_NOT_DATA = 143; - {$EXTERNALSYM CMS_R_TYPE_NOT_DIGESTED_DATA} - CMS_R_TYPE_NOT_DIGESTED_DATA = 144; - {$EXTERNALSYM CMS_R_TYPE_NOT_ENCRYPTED_DATA} - CMS_R_TYPE_NOT_ENCRYPTED_DATA = 145; - {$EXTERNALSYM CMS_R_TYPE_NOT_ENVELOPED_DATA} - CMS_R_TYPE_NOT_ENVELOPED_DATA = 146; - {$EXTERNALSYM CMS_R_UNABLE_TO_FINALIZE_CONTEXT} - CMS_R_UNABLE_TO_FINALIZE_CONTEXT = 147; - {$EXTERNALSYM CMS_R_UNKNOWN_CIPHER} - CMS_R_UNKNOWN_CIPHER = 148; - {$EXTERNALSYM CMS_R_UNKNOWN_DIGEST_ALGORIHM} - CMS_R_UNKNOWN_DIGEST_ALGORIHM = 149; - {$EXTERNALSYM CMS_R_UNKNOWN_ID} - CMS_R_UNKNOWN_ID = 150; - {$EXTERNALSYM CMS_R_UNSUPPORTED_COMPRESSION_ALGORITHM} - CMS_R_UNSUPPORTED_COMPRESSION_ALGORITHM = 151; - {$EXTERNALSYM CMS_R_UNSUPPORTED_CONTENT_TYPE} - CMS_R_UNSUPPORTED_CONTENT_TYPE = 152; - {$EXTERNALSYM CMS_R_UNSUPPORTED_KEK_ALGORITHM} - CMS_R_UNSUPPORTED_KEK_ALGORITHM = 153; - {$EXTERNALSYM CMS_R_UNSUPPORTED_RECIPIENT_TYPE} - CMS_R_UNSUPPORTED_RECIPIENT_TYPE = 154; - {$EXTERNALSYM CMS_R_UNSUPPORTED_RECPIENTINFO_TYPE} - CMS_R_UNSUPPORTED_RECPIENTINFO_TYPE = 155; - {$EXTERNALSYM CMS_R_UNSUPPORTED_TYPE} - CMS_R_UNSUPPORTED_TYPE = 156; - {$EXTERNALSYM CMS_R_UNWRAP_ERROR} - CMS_R_UNWRAP_ERROR = 157; - {$EXTERNALSYM CMS_R_VERIFICATION_FAILURE} - CMS_R_VERIFICATION_FAILURE = 158; - {$EXTERNALSYM CMS_R_WRAP_ERROR} - CMS_R_WRAP_ERROR = 159; - - {$ENDIF} - - {$EXTERNALSYM DSO_F_BEOS_BIND_FUNC} - DSO_F_BEOS_BIND_FUNC = 144; - {$EXTERNALSYM DSO_F_BEOS_BIND_VAR} - DSO_F_BEOS_BIND_VAR = 145; - {$EXTERNALSYM DSO_F_BEOS_LOAD} - DSO_F_BEOS_LOAD = 146; - {$EXTERNALSYM DSO_F_BEOS_NAME_CONVERTER} - DSO_F_BEOS_NAME_CONVERTER = 147; - {$EXTERNALSYM DSO_F_BEOS_UNLOAD} - DSO_F_BEOS_UNLOAD = 148; - {$EXTERNALSYM DSO_F_DLFCN_BIND_FUNC} - DSO_F_DLFCN_BIND_FUNC = 100; - {$EXTERNALSYM DSO_F_DLFCN_BIND_VAR} - DSO_F_DLFCN_BIND_VAR = 101; - {$EXTERNALSYM DSO_F_DLFCN_LOAD} - DSO_F_DLFCN_LOAD = 102; - {$EXTERNALSYM DSO_F_DLFCN_MERGER} - DSO_F_DLFCN_MERGER = 130; - {$EXTERNALSYM DSO_F_DLFCN_NAME_CONVERTER} - DSO_F_DLFCN_NAME_CONVERTER = 123; - {$EXTERNALSYM DSO_F_DLFCN_UNLOAD} - DSO_F_DLFCN_UNLOAD = 103; - {$EXTERNALSYM DSO_F_DL_BIND_FUNC} - DSO_F_DL_BIND_FUNC = 104; - {$EXTERNALSYM DSO_F_DL_BIND_VAR} - DSO_F_DL_BIND_VAR = 105; - {$EXTERNALSYM DSO_F_DL_LOAD} - DSO_F_DL_LOAD = 106; - {$EXTERNALSYM DSO_F_DL_MERGER} - DSO_F_DL_MERGER = 131; - {$EXTERNALSYM DSO_F_DL_NAME_CONVERTER} - DSO_F_DL_NAME_CONVERTER = 124; - {$EXTERNALSYM DSO_F_DL_UNLOAD} - DSO_F_DL_UNLOAD = 107; - {$EXTERNALSYM DSO_F_DSO_BIND_FUNC} - DSO_F_DSO_BIND_FUNC = 108; - {$EXTERNALSYM DSO_F_DSO_BIND_VAR} - DSO_F_DSO_BIND_VAR = 109; - {$EXTERNALSYM DSO_F_DSO_CONVERT_FILENAME} - DSO_F_DSO_CONVERT_FILENAME = 126; - {$EXTERNALSYM DSO_F_DSO_CTRL} - DSO_F_DSO_CTRL = 110; - {$EXTERNALSYM DSO_F_DSO_FREE} - DSO_F_DSO_FREE = 111; - {$EXTERNALSYM DSO_F_DSO_GET_FILENAME} - DSO_F_DSO_GET_FILENAME = 127; - {$EXTERNALSYM DSO_F_DSO_GET_LOADED_FILENAME} - DSO_F_DSO_GET_LOADED_FILENAME = 128; - {$EXTERNALSYM DSO_F_DSO_GLOBAL_LOOKUP} - DSO_F_DSO_GLOBAL_LOOKUP = 139; - {$EXTERNALSYM DSO_F_DSO_LOAD} - DSO_F_DSO_LOAD = 112; - {$EXTERNALSYM DSO_F_DSO_MERGE} - DSO_F_DSO_MERGE = 132; - {$EXTERNALSYM DSO_F_DSO_NEW_METHOD} - DSO_F_DSO_NEW_METHOD = 113; - {$EXTERNALSYM DSO_F_DSO_PATHBYADDR} - DSO_F_DSO_PATHBYADDR = 140; - {$EXTERNALSYM DSO_F_DSO_SET_FILENAME} - DSO_F_DSO_SET_FILENAME = 129; - {$EXTERNALSYM DSO_F_DSO_SET_NAME_CONVERTER} - DSO_F_DSO_SET_NAME_CONVERTER = 122; - {$EXTERNALSYM DSO_F_DSO_UP_REF} - DSO_F_DSO_UP_REF = 114; - {$EXTERNALSYM DSO_F_GLOBAL_LOOKUP_FUNC} - DSO_F_GLOBAL_LOOKUP_FUNC = 138; - {$EXTERNALSYM DSO_F_PATHBYADDR} - DSO_F_PATHBYADDR = 137; - {$EXTERNALSYM DSO_F_VMS_BIND_SYM} - DSO_F_VMS_BIND_SYM = 115; - {$EXTERNALSYM DSO_F_VMS_LOAD} - DSO_F_VMS_LOAD = 116; - {$EXTERNALSYM DSO_F_VMS_MERGER} - DSO_F_VMS_MERGER = 133; - {$EXTERNALSYM DSO_F_VMS_UNLOAD} - DSO_F_VMS_UNLOAD = 117; - {$EXTERNALSYM DSO_F_WIN32_BIND_FUNC} - DSO_F_WIN32_BIND_FUNC = 118; - {$EXTERNALSYM DSO_F_WIN32_BIND_VAR} - DSO_F_WIN32_BIND_VAR = 119; - {$EXTERNALSYM DSO_F_WIN32_GLOBALLOOKUP} - DSO_F_WIN32_GLOBALLOOKUP = 142; - {$EXTERNALSYM DSO_F_WIN32_GLOBALLOOKUP_FUNC} - DSO_F_WIN32_GLOBALLOOKUP_FUNC = 143; - {$EXTERNALSYM DSO_F_WIN32_JOINER} - DSO_F_WIN32_JOINER = 135; - {$EXTERNALSYM DSO_F_WIN32_LOAD} - DSO_F_WIN32_LOAD = 120; - {$EXTERNALSYM DSO_F_WIN32_MERGER} - DSO_F_WIN32_MERGER = 134; - {$EXTERNALSYM DSO_F_WIN32_NAME_CONVERTER} - DSO_F_WIN32_NAME_CONVERTER = 125; - {$EXTERNALSYM DSO_F_WIN32_PATHBYADDR} - DSO_F_WIN32_PATHBYADDR = 141; - {$EXTERNALSYM DSO_F_WIN32_SPLITTER} - DSO_F_WIN32_SPLITTER = 136; - {$EXTERNALSYM DSO_F_WIN32_UNLOAD} - DSO_F_WIN32_UNLOAD = 121; - -//* Reason codes. */ - {$EXTERNALSYM DSO_R_CTRL_FAILED} - DSO_R_CTRL_FAILED = 100; - {$EXTERNALSYM DSO_R_DSO_ALREADY_LOADED} - DSO_R_DSO_ALREADY_LOADED = 110; - {$EXTERNALSYM DSO_R_EMPTY_FILE_STRUCTURE} - DSO_R_EMPTY_FILE_STRUCTURE = 113; - {$EXTERNALSYM DSO_R_FAILURE} - DSO_R_FAILURE = 114; - {$EXTERNALSYM DSO_R_FILENAME_TOO_BIG} - DSO_R_FILENAME_TOO_BIG = 101; - {$EXTERNALSYM DSO_R_FINISH_FAILED} - DSO_R_FINISH_FAILED = 102; - {$EXTERNALSYM DSO_R_INCORRECT_FILE_SYNTAX} - DSO_R_INCORRECT_FILE_SYNTAX = 115; - {$EXTERNALSYM DSO_R_LOAD_FAILED} - DSO_R_LOAD_FAILED = 103; - {$EXTERNALSYM DSO_R_NAME_TRANSLATION_FAILED} - DSO_R_NAME_TRANSLATION_FAILED = 109; - {$EXTERNALSYM DSO_R_NO_FILENAME} - DSO_R_NO_FILENAME = 111; - {$EXTERNALSYM DSO_R_NO_FILE_SPECIFICATION} - DSO_R_NO_FILE_SPECIFICATION = 116; - {$EXTERNALSYM DSO_R_NULL_HANDLE} - DSO_R_NULL_HANDLE = 104; - {$EXTERNALSYM DSO_R_SET_FILENAME_FAILED} - DSO_R_SET_FILENAME_FAILED = 112; - {$EXTERNALSYM DSO_R_STACK_ERROR} - DSO_R_STACK_ERROR = 105; - {$EXTERNALSYM DSO_R_SYM_FAILURE} - DSO_R_SYM_FAILURE = 106; - {$EXTERNALSYM DSO_R_UNLOAD_FAILED} - DSO_R_UNLOAD_FAILED = 107; - {$EXTERNALSYM DSO_R_UNSUPPORTED} - DSO_R_UNSUPPORTED = 108; - - {$ifndef OPENSSL_NO_SRP} - {$EXTERNALSYM SRP_NO_ERROR} - - SRP_NO_ERROR = 0; - {$EXTERNALSYM SRP_ERR_VBASE_INCOMPLETE_FILE} - SRP_ERR_VBASE_INCOMPLETE_FILE = 1; - {$EXTERNALSYM SRP_ERR_VBASE_BN_LIB} - SRP_ERR_VBASE_BN_LIB = 2; - {$EXTERNALSYM SRP_ERR_OPEN_FILE} - SRP_ERR_OPEN_FILE = 3; - {$EXTERNALSYM SRP_ERR_MEMORY} - SRP_ERR_MEMORY = 4; - - {$EXTERNALSYM DB_srptype} - DB_srptype = 0; - {$EXTERNALSYM DB_srpverifier} - DB_srpverifier = 1; - {$EXTERNALSYM DB_srpsalt} - DB_srpsalt = 2; - {$EXTERNALSYM DB_srpid} - DB_srpid = 3; - {$EXTERNALSYM DB_srpgN} - DB_srpgN = 4; - {$EXTERNALSYM DB_srpinfo} - DB_srpinfo = 5; - {$NODEFINE DB_NUMBER} - DB_NUMBER = 6; - {$EXTERNALSYM DB_SRP_INDEX} - DB_SRP_INDEX = 'I'; - {$EXTERNALSYM DB_SRP_VALID} - DB_SRP_VALID = 'V'; - {$EXTERNALSYM DB_SRP_REVOKED} - DB_SRP_REVOKED = 'R'; - {$EXTERNALSYM DB_SRP_MODIF} - DB_SRP_MODIF = 'v'; - {$ENDIF} - {$EXTERNALSYM SRTP_AES128_CM_SHA1_80} - SRTP_AES128_CM_SHA1_80 = $0001; - {$EXTERNALSYM SRTP_AES128_CM_SHA1_32} - SRTP_AES128_CM_SHA1_32 = $0002; - {$EXTERNALSYM SRTP_AES128_F8_SHA1_80} - SRTP_AES128_F8_SHA1_80 = $0003; - {$EXTERNALSYM SRTP_AES128_F8_SHA1_32} - SRTP_AES128_F8_SHA1_32 = $0004; - {$EXTERNALSYM SRTP_NULL_SHA1_80} - SRTP_NULL_SHA1_80 = $0005; - {$EXTERNALSYM SRTP_NULL_SHA1_32} - SRTP_NULL_SHA1_32 = $0006; - - _ATEXIT_SIZE = 32; - {$EXTERNALSYM _ATEXIT_SIZE} - _IOFBF = 0; - {$EXTERNALSYM _IOFBF} - _IOLBF = 1; - {$EXTERNALSYM _IOLBF} - _IONBF = 2; - {$EXTERNALSYM _IONBF} - _N_LISTS = 30; - {$EXTERNALSYM _N_LISTS} - _MSS_WIN32 = 1; - {$EXTERNALSYM _MSS_WIN32} - _MSS_X86_ = 1; - {$EXTERNALSYM _MSS_X86_} - __CYGWIN32__ = 1; - {$EXTERNALSYM __CYGWIN32__} - __CYGWIN__ = 1; - {$EXTERNALSYM __CYGWIN__} - __GNUC_MINOR__ = 91; - {$EXTERNALSYM __GNUC_MINOR__} - __GNUC__ = 2; - {$EXTERNALSYM __GNUC__} - __SAPP = $0100; - {$EXTERNALSYM __SAPP } - __SEOF = $0020; - {$EXTERNALSYM __SEOF } - __SERR = $0040; - {$EXTERNALSYM __SERR } - __SLBF = $0001; - {$EXTERNALSYM __SLBF } - __SMBF = $0080; - {$EXTERNALSYM __SMBF } - __SMOD = $2000; - {$EXTERNALSYM __SMOD } - __SNBF = $0002; - {$EXTERNALSYM __SNBF } - __SNPT = $0800; - {$EXTERNALSYM __SNPT } - __SOFF = $1000; - {$EXTERNALSYM __SOFF } - __SOPT = $0400; - {$EXTERNALSYM __SOPT } - __SRD = $0004; - {$EXTERNALSYM __SRD } - __SRW = $0010; - {$EXTERNALSYM __SRW } - __SSTR = $0200; - {$EXTERNALSYM __SSTR } - __STDC__ = 1; - {$EXTERNALSYM __STDC__} - __SWR = $0008; - {$EXTERNALSYM __SWR } - __WINNT = 1; - {$EXTERNALSYM __WINNT} - __WINNT__ = 1; - {$EXTERNALSYM __WINNT__} - __i386 = 1; - {$EXTERNALSYM __i386} - __i386__ = 1; - {$EXTERNALSYM __i386__} - __i586 = 1; - {$EXTERNALSYM __i586} - __i586__ = 1; - {$EXTERNALSYM __i586__} - __pentium = 1; - {$EXTERNALSYM __pentium} - __pentium__ = 1; - {$EXTERNALSYM __pentium__} - i386 = 1; - {$EXTERNALSYM i386} - i586 = 1; - {$EXTERNALSYM i586} - pentium = 1; - {$EXTERNALSYM pentium} -//kssl.h -{$IFNDEF OPENSSL_NO_KRB5} -{These are consts for Kerberos support. These will not be complete because -FreePascal, Borland Delphi, and Indy don't support Kerberos. These are here -as place holders so we get an exact OpenSSL API if Kerberos support was compiled -in. -} - {$EXTERNALSYM KSSL_ERR_MAX} - KSSL_ERR_MAX = 255; - {$EXTERNALSYM KSSL_CLIENT} - KSSL_CLIENT = 1; - {$EXTERNALSYM KSSL_SERVER} - KSSL_SERVER = 2; - {$EXTERNALSYM KSSL_SERVICE} - KSSL_SERVICE = 3; - {$EXTERNALSYM KSSL_KEYTAB} - KSSL_KEYTAB = 4; - {$EXTERNALSYM KSSL_CTX_OK} - KSSL_CTX_OK = 0; - {$EXTERNALSYM KSSL_CTX_ERR} - KSSL_CTX_ERR = 1; - {$EXTERNALSYM KSSL_NOMEM} - KSSL_NOMEM = 2; -{$ENDIF} - -{Error - err.h } -const - {$EXTERNALSYM ERR_TXT_MALLOCED} - ERR_TXT_MALLOCED = $01; - {$EXTERNALSYM ERR_TXT_STRING} - ERR_TXT_STRING = $02; - {$EXTERNALSYM ERR_NUM_ERRORS} - ERR_NUM_ERRORS = 16; - -const - // library - {$EXTERNALSYM ERR_LIB_NONE} - ERR_LIB_NONE = 1; - {$EXTERNALSYM ERR_LIB_SYS} - ERR_LIB_SYS = 2; - {$EXTERNALSYM ERR_LIB_BN} - ERR_LIB_BN = 3; - {$EXTERNALSYM ERR_LIB_RSA} - ERR_LIB_RSA = 4; - {$EXTERNALSYM ERR_LIB_DH} - ERR_LIB_DH = 5; - {$EXTERNALSYM ERR_LIB_EVP} - ERR_LIB_EVP = 6; - {$EXTERNALSYM ERR_LIB_BUF} - ERR_LIB_BUF = 7; - {$EXTERNALSYM ERR_LIB_OBJ} - ERR_LIB_OBJ = 8; - {$EXTERNALSYM ERR_LIB_PEM} - ERR_LIB_PEM = 9; - {$EXTERNALSYM ERR_LIB_DSA} - ERR_LIB_DSA = 10; - {$EXTERNALSYM ERR_LIB_X509} - ERR_LIB_X509 = 11; -// ERR_LIB_METH = 12; - {$EXTERNALSYM ERR_LIB_ASN1} - ERR_LIB_ASN1 = 13; - {$EXTERNALSYM ERR_LIB_CONF} - ERR_LIB_CONF = 14; - {$EXTERNALSYM ERR_LIB_CRYPTO} - ERR_LIB_CRYPTO = 15; - {$EXTERNALSYM ERR_LIB_EC} - ERR_LIB_EC = 16; - {$EXTERNALSYM ERR_LIB_SSL} - ERR_LIB_SSL = 20; -// ERR_LIB_SSL23 = 21; -// ERR_LIB_SSL2 = 22; -// ERR_LIB_SSL3 = 23; -// ERR_LIB_RSAREF = 30; -// ERR_LIB_PROXY = 31; - {$EXTERNALSYM ERR_LIB_BIO} - ERR_LIB_BIO = 32; - {$EXTERNALSYM ERR_LIB_PKCS7} - ERR_LIB_PKCS7 = 33; - {$EXTERNALSYM ERR_LIB_X509V3} - ERR_LIB_X509V3 = 34; - {$EXTERNALSYM ERR_LIB_PKCS12} - ERR_LIB_PKCS12 = 35; - {$EXTERNALSYM ERR_LIB_RAND} - ERR_LIB_RAND = 36; - {$EXTERNALSYM ERR_LIB_DSO} - ERR_LIB_DSO = 37; - {$EXTERNALSYM ERR_LIB_ENGINE} - ERR_LIB_ENGINE = 38; - {$EXTERNALSYM ERR_LIB_OCSP} - ERR_LIB_OCSP = 39; - {$EXTERNALSYM ERR_LIB_UI} - ERR_LIB_UI = 40; - {$EXTERNALSYM ERR_LIB_COMP} - ERR_LIB_COMP = 41; - {$EXTERNALSYM ERR_LIB_ECDSA} - ERR_LIB_ECDSA = 42; - {$EXTERNALSYM ERR_LIB_ECDH} - ERR_LIB_ECDH = 43; - {$EXTERNALSYM ERR_LIB_STORE} - ERR_LIB_STORE = 44; - {$EXTERNALSYM ERR_LIB_FIPS} - ERR_LIB_FIPS = 45; - {$EXTERNALSYM ERR_LIB_CMS} - ERR_LIB_CMS = 46; - {$EXTERNALSYM ERR_LIB_TS} - ERR_LIB_TS = 47; - {$EXTERNALSYM ERR_LIB_HMAC} - ERR_LIB_HMAC = 48; - {$EXTERNALSYM ERR_LIB_JPAKE} - //OpenSSL 0.9.8n was 47 - ERR_LIB_JPAKE = 49; -//* fatal error */ - {$EXTERNALSYM ERR_R_FATAL} - ERR_R_FATAL = 64; -//was ERR_R_FATAL = 32; - {$EXTERNALSYM ERR_R_MALLOC_FAILURE} - ERR_R_MALLOC_FAILURE = (1 or ERR_R_FATAL); - {$EXTERNALSYM ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED} - ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED = (2 or ERR_R_FATAL); - {$EXTERNALSYM ERR_R_PASSED_NULL_PARAMETER} - ERR_R_PASSED_NULL_PARAMETER = (3 or ERR_R_FATAL); - {$EXTERNALSYM ERR_R_INTERNAL_ERROR} - ERR_R_INTERNAL_ERROR = (4 or ERR_R_FATAL); - {$EXTERNALSYM ERR_R_DISABLED} - ERR_R_DISABLED = (5 or ERR_R_FATAL); - {$EXTERNALSYM ERR_LIB_USER} - ERR_LIB_USER = 128; - // OS functions - {$EXTERNALSYM SYS_F_FOPEN} - SYS_F_FOPEN = 1; - {$EXTERNALSYM SYS_F_CONNECT} - SYS_F_CONNECT = 2; - {$EXTERNALSYM SYS_F_GETSERVBYNAME} - SYS_F_GETSERVBYNAME = 3; - {$EXTERNALSYM SYS_F_SOCKET} - SYS_F_SOCKET = 4; - {$EXTERNALSYM SYS_F_IOCTLSOCKET} - SYS_F_IOCTLSOCKET = 5; - {$EXTERNALSYM SYS_F_BIND} - SYS_F_BIND = 6; - {$EXTERNALSYM SYS_F_LISTEN} - SYS_F_LISTEN = 7; - {$EXTERNALSYM SYS_F_ACCEPT} - SYS_F_ACCEPT = 8; - {$EXTERNALSYM SYS_F_WSASTARTUP} - SYS_F_WSASTARTUP = 9; { Winsock stuff } - {$EXTERNALSYM SYS_F_OPENDIR} - SYS_F_OPENDIR = 10; - {$EXTERNALSYM SYS_F_FREAD} - SYS_F_FREAD = 11; -//* These are the possible flags. They can be or'ed together. */ -//* Use to have echoing of input */ - {$EXTERNALSYM UI_INPUT_FLAG_ECHO} - UI_INPUT_FLAG_ECHO = $01; -///* Use a default password. Where that password is found is completely -// up to the application, it might for example be in the user data set -// with UI_add_user_data(). It is not recommended to have more than -// one input in each UI being marked with this flag, or the application -// might get confused. */ - {$EXTERNALSYM UI_INPUT_FLAG_DEFAULT_PWD} - UI_INPUT_FLAG_DEFAULT_PWD = $02; - -//* The user of these routines may want to define flags of their own. The core -// UI won't look at those, but will pass them on to the method routines. They -// must use higher bits so they don't get confused with the UI bits above. -// UI_INPUT_FLAG_USER_BASE tells which is the lowest bit to use. A good -// example of use is this: - -// #define MY_UI_FLAG1 (0x01 << UI_INPUT_FLAG_USER_BASE) -//*/ - {$EXTERNALSYM UI_INPUT_FLAG_USER_BASE} - UI_INPUT_FLAG_USER_BASE = 16; - //IO_ctrl commands -//* The commands */ -//* Use UI_CONTROL_PRINT_ERRORS with the value 1 to have UI_process print the -// OpenSSL error stack before printing any info or added error messages and -// before any prompting. */ - {$EXTERNALSYM UI_CTRL_PRINT_ERRORS} - UI_CTRL_PRINT_ERRORS = 1; -//* Check if a UI_process() is possible to do again with the same instance of -// a user interface. This makes UI_ctrl() return 1 if it is redoable, and 0 -// if not. */ - {$EXTERNALSYM UI_CTRL_IS_REDOABLE} - UI_CTRL_IS_REDOABLE = 2; -//* Function codes. */ - {$EXTERNALSYM UI_F_GENERAL_ALLOCATE_BOOLEAN} - UI_F_GENERAL_ALLOCATE_BOOLEAN = 108; - {$EXTERNALSYM UI_F_GENERAL_ALLOCATE_PROMPT} - UI_F_GENERAL_ALLOCATE_PROMPT = 109; - {$EXTERNALSYM UI_F_GENERAL_ALLOCATE_STRING} - UI_F_GENERAL_ALLOCATE_STRING = 100; - {$EXTERNALSYM UI_F_UI_CTRL} - UI_F_UI_CTRL = 111; - {$EXTERNALSYM UI_F_UI_DUP_ERROR_STRING} - UI_F_UI_DUP_ERROR_STRING = 101; - {$EXTERNALSYM UI_F_UI_DUP_INFO_STRING} - UI_F_UI_DUP_INFO_STRING = 102; - {$EXTERNALSYM UI_F_UI_DUP_INPUT_BOOLEAN} - UI_F_UI_DUP_INPUT_BOOLEAN = 110; - {$EXTERNALSYM UI_F_UI_DUP_INPUT_STRING} - UI_F_UI_DUP_INPUT_STRING = 103; - {$EXTERNALSYM UI_F_UI_DUP_VERIFY_STRING} - UI_F_UI_DUP_VERIFY_STRING = 106; - {$EXTERNALSYM UI_F_UI_GET0_RESULT} - UI_F_UI_GET0_RESULT = 107; - {$EXTERNALSYM UI_F_UI_NEW_METHOD} - UI_F_UI_NEW_METHOD = 104; - {$EXTERNALSYM UI_F_UI_SET_RESULT} - UI_F_UI_SET_RESULT = 105; -//* Reason codes. */ - {$EXTERNALSYM UI_R_COMMON_OK_AND_CANCEL_CHARACTERS} - UI_R_COMMON_OK_AND_CANCEL_CHARACTERS = 104; - {$EXTERNALSYM UI_R_INDEX_TOO_LARGE} - UI_R_INDEX_TOO_LARGE = 102; - {$EXTERNALSYM UI_R_INDEX_TOO_SMALL} - UI_R_INDEX_TOO_SMALL = 103; - {$EXTERNALSYM UI_R_NO_RESULT_BUFFER} - UI_R_NO_RESULT_BUFFER = 105; - {$EXTERNALSYM UI_R_RESULT_TOO_LARGE} - UI_R_RESULT_TOO_LARGE = 100; - {$EXTERNALSYM UI_R_RESULT_TOO_SMALL} - UI_R_RESULT_TOO_SMALL = 101; - {$EXTERNALSYM UI_R_UNKNOWN_CONTROL_COMMAND} - UI_R_UNKNOWN_CONTROL_COMMAND = 106; - -const - // reasons - {$EXTERNALSYM ERR_R_SYS_LIB} - ERR_R_SYS_LIB = ERR_LIB_SYS; - {$EXTERNALSYM ERR_R_BN_LIB} - ERR_R_BN_LIB = ERR_LIB_BN; - {$EXTERNALSYM ERR_R_RSA_LIB} - ERR_R_RSA_LIB = ERR_LIB_RSA; - {$EXTERNALSYM ERR_R_DH_LIB} - ERR_R_DH_LIB = ERR_LIB_DH; - {$EXTERNALSYM ERR_R_EVP_LIB} - ERR_R_EVP_LIB = ERR_LIB_EVP; - {$EXTERNALSYM ERR_R_BUF_LIB} - ERR_R_BUF_LIB = ERR_LIB_BUF; - {$EXTERNALSYM ERR_R_OBJ_LIB} - ERR_R_OBJ_LIB = ERR_LIB_OBJ; - {$EXTERNALSYM ERR_R_PEM_LIB} - ERR_R_PEM_LIB = ERR_LIB_PEM; - {$EXTERNALSYM ERR_R_DSA_LIB} - ERR_R_DSA_LIB = ERR_LIB_DSA; - {$EXTERNALSYM ERR_R_X509_LIB} - ERR_R_X509_LIB = ERR_LIB_X509; - {$EXTERNALSYM ERR_R_ASN1_LIB} - ERR_R_ASN1_LIB = ERR_LIB_ASN1; - {$EXTERNALSYM ERR_R_CONF_LIB} - ERR_R_CONF_LIB = ERR_LIB_CONF; - {$EXTERNALSYM ERR_R_CRYPTO_LIB} - ERR_R_CRYPTO_LIB = ERR_LIB_CRYPTO; - {$EXTERNALSYM ERR_R_EC_LIB} - ERR_R_EC_LIB = ERR_LIB_EC; - {$EXTERNALSYM ERR_R_SSL_LIB} - ERR_R_SSL_LIB = ERR_LIB_SSL; - {$EXTERNALSYM ERR_R_BIO_LIB} - ERR_R_BIO_LIB = ERR_LIB_BIO; - {$EXTERNALSYM ERR_R_PKCS7_LIB} - ERR_R_PKCS7_LIB = ERR_LIB_PKCS7; - {$EXTERNALSYM ERR_R_X509V3_LIB} - ERR_R_X509V3_LIB = ERR_LIB_X509V3; - {$EXTERNALSYM ERR_R_PKCS12_LIB} - ERR_R_PKCS12_LIB = ERR_LIB_PKCS12; - {$EXTERNALSYM ERR_R_RAND_LIB} - ERR_R_RAND_LIB = ERR_LIB_RAND; - {$EXTERNALSYM ERR_R_DSO_LIB} - ERR_R_DSO_LIB = ERR_LIB_DSO; - {$EXTERNALSYM ERR_R_ENGINE_LIB} - ERR_R_ENGINE_LIB = ERR_LIB_ENGINE; - {$EXTERNALSYM ERR_R_OCSP_LIB} - ERR_R_OCSP_LIB = ERR_LIB_OCSP; - {$EXTERNALSYM ERR_R_UI_LIB} - ERR_R_UI_LIB = ERR_LIB_UI; - {$EXTERNALSYM ERR_R_COMP_LIB} - ERR_R_COMP_LIB = ERR_LIB_COMP; - {$EXTERNALSYM ERR_R_ECDSA_LIB} - ERR_R_ECDSA_LIB = ERR_LIB_ECDSA; - {$EXTERNALSYM ERR_R_ECDH_LIB} - ERR_R_ECDH_LIB = ERR_LIB_ECDH; - {$EXTERNALSYM ERR_R_STORE_LIB} - ERR_R_STORE_LIB = ERR_LIB_STORE; - {$EXTERNALSYM ERR_R_TS_LIB} - ERR_R_TS_LIB = ERR_LIB_TS; //* 45 */ - {$EXTERNALSYM ERR_R_NESTED_ASN1_ERROR} - ERR_R_NESTED_ASN1_ERROR = 58; - {$EXTERNALSYM ERR_R_BAD_ASN1_OBJECT_HEADER} - ERR_R_BAD_ASN1_OBJECT_HEADER = 59; - {$EXTERNALSYM ERR_R_BAD_GET_ASN1_OBJECT_CALL} - ERR_R_BAD_GET_ASN1_OBJECT_CALL = 60; - {$EXTERNALSYM ERR_R_EXPECTING_AN_ASN1_SEQUENCE} - ERR_R_EXPECTING_AN_ASN1_SEQUENCE = 61; - {$EXTERNALSYM ERR_R_ASN1_LENGTH_MISMATCH} - ERR_R_ASN1_LENGTH_MISMATCH = 62; - {$EXTERNALSYM ERR_R_MISSING_ASN1_EOS} - ERR_R_MISSING_ASN1_EOS = 63; - {$EXTERNALSYM DTLS1_VERSION} - DTLS1_VERSION = $FEFF; - {$EXTERNALSYM DTLS1_BAD_VER} - DTLS1_BAD_VER = $0100; -{$IFNDEF USE_THIS} -//* this alert description is not specified anywhere... */ - {$EXTERNALSYM DTLS1_AD_MISSING_HANDSHAKE_MESSAGE} - DTLS1_AD_MISSING_HANDSHAKE_MESSAGE = 110; -{$endif} - //was 32 - {$EXTERNALSYM DTLS1_COOKIE_LENGTH} - DTLS1_COOKIE_LENGTH = 256; - {$EXTERNALSYM DTLS1_RT_HEADER_LENGTH} - DTLS1_RT_HEADER_LENGTH = 13; - {$EXTERNALSYM DTLS1_HM_HEADER_LENGTH} - DTLS1_HM_HEADER_LENGTH = 12; - {$EXTERNALSYM DTLS1_HM_BAD_FRAGMENT} - DTLS1_HM_BAD_FRAGMENT = -2; - {$EXTERNALSYM DTLS1_HM_FRAGMENT_RETRY} - DTLS1_HM_FRAGMENT_RETRY = -3; - {$EXTERNALSYM DTLS1_CCS_HEADER_LENGTH} - //OpenSSL 0.9.8e defines this as OPENSSL_DTLS1_CCS_HEADER_LENGTH = 3; - DTLS1_CCS_HEADER_LENGTH = 1; - {$EXTERNALSYM DTLS1_AL_HEADER_LENGTH} -{$ifdef DTLS1_AD_MISSING_HANDSHAKE_MESSAGE} - DTLS1_AL_HEADER_LENGTH = 7; -{$else} - DTLS1_AL_HEADER_LENGTH = 2; -{$endif} - -type - {$EXTERNALSYM PPByte} - PPByte = ^PByte; - {$IFNDEF HAS_PPointer} - {$EXTERNALSYM PPointer} - PPointer = ^Pointer; - {$ENDIF} - -//This is just a synthasis since Pascal probably has what we need. -//In C, the OpenSSL developers were using the PQ_64BIT moniker -//to ensure that they had a value that is always 64bit. -//In Pascal, this is not a problem since Delphi and FreePascal have this in some form. - {$EXTERNALSYM PQ_64BIT} - PQ_64BIT = TIdC_UINT64; - -// RLebeau - the following value was conflicting with iphlpapi.h under C++Builder -// (and possibly other headers) so using the HPPEMIT further above as a workaround - {$EXTERNALSYM time_t} - time_t = TIdC_LONG; - {$EXTERNALSYM STACK} - STACK = record - num : TIdC_INT; //int num; - data : PIdAnsiChar; //char **data; - sorted : TIdC_INT;//int sorted; - num_alloc : TIdC_INT; //int num_alloc; - comp : function (_para1: PPIdAnsiChar; _para2: PPIdAnsiChar): TIdC_INT; cdecl; - //int (*comp)(const char * const *, const char * const *); - end; - {$EXTERNALSYM PSTACK} - PSTACK = ^STACK; - {$EXTERNALSYM PPSTACK} - PPSTACK = ^PSTACK; - {$EXTERNALSYM PSTACK_OF_POINTER} - PSTACK_OF_POINTER = Pointer; - {$NODEFINE PSSL} - PSSL = ^SSL; - //opensslconf.h - {$IFNDEF OPENSSL_NO_MD2} - {$EXTERNALSYM MD2_INT} - {$IFDEF MD2_CHAR} - MD2_INT = Char; - {$ELSE} - {$IFDEF MD2_LONG} - MD2_INT = TIdC_ULONG; - {$ELSE} - MD2_INT = TIdC_UINT; - {$ENDIF} - {$ENDIF} - {$ENDIF} - - {$IFNDEF OPENSSL_NO_RC1} - {$EXTERNALSYM RC2_INT} - {$IFDEF RC2_SHORT} - RC2_INT = TIdC_USHORT; - {$ELSE} - {$IFDEF RC2_LONG} - RC2_INT = TIdC_ULONG; - {$ELSE} - RC2_INT = TIdC_UINT; - {$ENDIF} - {$ENDIF} - {$ENDIF} - {$IFNDEF OPENSSL_NO_RC4} - {$EXTERNALSYM RC4_INT} - {$IFDEF RC4_CHAR} - RC4_INT = TIdC_USHORT; - {$ELSE} - {$IFDEF RC4_LONG} - RC4_INT = TIdC_ULONG; - {$ELSE} - RC4_INT = TIdC_UINT; - {$ENDIF} - {$ENDIF} - {$IFDEF RC4_CHUNK} - {$EXTERNALSYM RC4_CHUNK} - RC4_CHUNK = TIdC_ULONG; - {$ELSE} - {$IFDEF RC4_CHUNK_LL} - {$EXTERNALSYM RC4_CHUNK} - RC4_CHUNK = TIdC_ULONGLONG; - {$ELSE} - {$UNDEF RC4_CHUNK} - {$ENDIF} - {$ENDIF} - {$ENDIF} - {$IFNDEF OPENSSL_NO_IDEA} - {$EXTERNALSYM IDEA_INT} - {$IFDEF IDEA_SHORT} - IDEA_INT = TIdC_USHORT; - {$ELSE} - {$IFDEF IDEA_LONG} - IDEA_INT = TIdC_ULONG; - {$ELSE} - IDEA_INT = TIdC_UINT; - {$ENDIF} - {$ENDIF} - {$ENDIF} - //crypto.h - // OpenSSL 1.0.0 structure - ///* Don't use this structure directly. */ - {$EXTERNALSYM CRYPTO_THREADID} - CRYPTO_THREADID = record - ptr : Pointer; - val : TIdC_ULONG; - end; - {$EXTERNALSYM PCRYPTO_THREADID} - PCRYPTO_THREADID = ^CRYPTO_THREADID; - // end OpenSSL 1.0.0 structures - {$EXTERNALSYM OPENSSL_ITEM} - OPENSSL_ITEM = record - code : TIdC_INT; - value : Pointer; //* Not used for flag attributes */ - value_size : size_t; //* Max size of value for output, length for input */ - value_length : Psize_t; //* Returned length of value for output */ - end; - {$EXTERNALSYM CRYPTO_EX_DATA} - CRYPTO_EX_DATA = record - sk : PSTACK; - dummy : TIdC_INT; // gcc is screwing up this data structure :-( - end; - {$EXTERNALSYM PCRYPTO_EX_DATA} - PCRYPTO_EX_DATA = ^CRYPTO_EX_DATA; -{ -/* Some applications as well as some parts of OpenSSL need to allocate - and deallocate locks in a dynamic fashion. The following typedef - makes this possible in a type-safe manner. */ -/* struct CRYPTO_dynlock_value has to be defined by the application. */ -} - {$EXTERNALSYM PCRYPTO_dynlock_value} - PCRYPTO_dynlock_value = Pointer; - {$EXTERNALSYM CRYPTO_dynlock} - CRYPTO_dynlock = record - references : TIdC_INT; - data : PCRYPTO_dynlock_value; - end; - {$EXTERNALSYM PCRYPTO_dynlock} - PCRYPTO_dynlock = ^CRYPTO_dynlock; -//* Callback types for crypto.h */ -//typedef int CRYPTO_EX_new(void *parent, void *ptr, CRYPTO_EX_DATA *ad, -// int idx, long argl, void *argp); - {$EXTERNALSYM CRYPTO_EX_new} - CRYPTO_EX_new = function(parent : Pointer; ptr : Pointer; ad : CRYPTO_EX_DATA; - idx : TIdC_INT; arg1 : TIdC_LONG; argp : Pointer) : TIdC_INT; cdecl; -//typedef void CRYPTO_EX_free(void *parent, void *ptr, CRYPTO_EX_DATA *ad, -// int idx, long argl, void *argp); - {$EXTERNALSYM CRYPTO_EX_free} - CRYPTO_EX_free = procedure (parent : Pointer; ptr : Pointer; ad : CRYPTO_EX_DATA; - idx : TIdC_INT; arg1 : TIdC_LONG; argp : Pointer); cdecl; -//typedef int CRYPTO_EX_dup(CRYPTO_EX_DATA *to, CRYPTO_EX_DATA *from, void *from_d, -// int idx, long argl, void *argp); - {$EXTERNALSYM CRYPTO_EX_dup} - CRYPTO_EX_dup = function (_to : PCRYPTO_EX_DATA; from : PCRYPTO_EX_DATA; - from_d : Pointer; idx : TIdC_INT; arg1 : TIdC_LONG; argp : Pointer) : TIdC_INT; cdecl; - {$EXTERNALSYM CRYPTO_EX_DATA_FUNCS} - CRYPTO_EX_DATA_FUNCS = record - argl : TIdC_LONG; //* Arbitary long */ - argp : Pointer; //* Arbitary void * */ - new_func : CRYPTO_EX_new; - free_func : CRYPTO_EX_free; - dup_func : CRYPTO_EX_dup; - end; - {$IFDEF DEBUG_SAFESTACK} - {$EXTERNALSYM STACK_OF_CRYPTO_EX_DATA_FUNCS} - STACK_OF_CRYPTO_EX_DATA_FUNCS = record - stack: stack; - end; - {$EXTERNALSYM PSTACK_OF_CRYPTO_EX_DATA_FUNCS} - PSTACK_OF_CRYPTO_EX_DATA_FUNCS = ^STACK_OF_CRYPTO_EX_DATA_FUNCS; - {$ELSE} - //I think the DECLARE_STACK_OF macro is empty - {$EXTERNALSYM PSTACK_OF_CRYPTO_EX_DATA_FUNCS} - PSTACK_OF_CRYPTO_EX_DATA_FUNCS = PSTACK; - {$ENDIF} - ///* An opaque type representing an implementation of "ex_data" support */ - {$EXTERNALSYM PCRYPTO_EX_DATA_IMPL} - PCRYPTO_EX_DATA_IMPL = Pointer; - {$EXTERNALSYM ERR_string_data} - ERR_string_data = record - error : TIdC_ULONG; - _string : PIdAnsiChar; - end; - {$EXTERNALSYM PERR_string_data} - PERR_string_data = ^ERR_string_data; - {$EXTERNALSYM ERR_STATE} - ERR_STATE = record - tid : CRYPTO_THREADID; - // PID: TIdC_UINT; - err_flags : array [0..ERR_NUM_ERRORS - 1] of TIdC_INT; - err_buffer: array[0..ERR_NUM_ERRORS-1] of TIdC_UINT; - err_data : array [0..ERR_NUM_ERRORS -1] of PIdAnsiChar; - err_data_flags : array [0..ERR_NUM_ERRORS -1] of TIdC_INT; - err_file: array[0..ERR_NUM_ERRORS-1] of PIdAnsiChar; - err_line: array[0..ERR_NUM_ERRORS-1] of TIdC_INT; - top: TIdC_INT; - bottom: TIdC_INT; - end; // record - {$EXTERNALSYM TERR_STATE} - TERR_STATE = ERR_STATE; - {$EXTERNALSYM PERR_FNS} - PERR_FNS = Pointer; - //rand.h - {$IFDEF OPENSSL_FIPS} - {$EXTERNALSYM FIPS_RAND_SIZE_T} - FIPS_RAND_SIZE_T = TIdC_int; - {$ENDIF} - {$EXTERNALSYM RAND_METHOD} - RAND_METHOD = record - seed : procedure (const buf : Pointer; num : TIdC_INT) cdecl; - bytes : function(const buf : PIdAnsiChar; num : TIdC_INT) : TIdC_INT cdecl; - cleanup : procedure cdecl; - add : procedure (const buf : Pointer; num : TIdC_INT; entropy : TIdC_DOUBLE) cdecl; - pseudorand : function(buf : PIdAnsiChar; num : TIdC_INT) : TIdC_INT cdecl; - status : function : TIdC_INT cdecl; - end; - //bn.h - {$IFDEF SIXTY_FOUR_BIT_LONG} - {$EXTERNALSYM BN_ULLONG} - BN_ULLONG = TIdC_LONGLONG; - {$EXTERNALSYM BN_ULONG} - BN_ULONG = TIdC_ULONG; - {$EXTERNALSYM BN_LONG} - BN_LONG = TIdC_LONG; - {$ENDIF} - {$IFDEF SIXTY_FOUR_BIT} - {$EXTERNALSYM BN_ULLONG} - BN_ULLONG = TIdC_ULONGLONG; - {$EXTERNALSYM BN_LONG} - BN_LONG = TIdC_LONGLONG; - {$EXTERNALSYM BN_ULONG} - BN_ULONG = TIdC_ULONGLONG; - {$ENDIF} - {$IFDEF THIRTY_TWO_BIT} - {$EXTERNALSYM BN_ULLONG} - {$IFDEF BN_LLONG} - BN_ULLONG = TIdC_INT64; - {$ELSE} - BN_ULLONG = TIdC_ULONGLONG; - {$ENDIF} - {$EXTERNALSYM BN_LONG} - BN_LONG = TIdC_LONG; - {$EXTERNALSYM BN_ULONG} - BN_ULONG = TIdC_ULONG; - {$ENDIF} - {$EXTERNALSYM PBN_LONG} - PBN_LONG = ^BN_LONG; - {$EXTERNALSYM PBN_ULONG} - PBN_ULONG = ^BN_ULONG; - {$EXTERNALSYM BIGNUM} - BIGNUM = record - d : PBN_ULONG; // Pointer to an array of 'BN_BITS2' bit chunks. - top : TIdC_INT; // Index of last used d +1. - // The next are internal book keeping for bn_expand. - dmax : TIdC_INT; // Size of the d array. - neg : TIdC_INT; // one if the number is negative - flags : TIdC_INT; - end; - {$EXTERNALSYM PBIGNUM} - PBIGNUM = ^BIGNUM; - // BN_CTX = record - //This is defined internally. I don't want to do anything with an internal structure. - // end; - {$EXTERNALSYM PBN_CTX} - PBN_CTX = Pointer;//^BN_CTX; - {$EXTERNALSYM PPBN_CTX} - PPBN_CTX = ^PBN_CTX; - // Used for montgomery multiplication - {$EXTERNALSYM BN_MONT_CTX} - BN_MONT_CTX = record - ri : TIdC_INT; // number of bits in R - RR : BIGNUM; // used to convert to montgomery form - N : BIGNUM; // The modulus - Ni : BIGNUM; // R*(1/R mod N) - N*Ni = 1 - // (Ni is only stored for bignum algorithm) -{#if 0 - /* OpenSSL 0.9.9 preview: */ - BN_ULONG n0[2];/* least significant word(s) of Ni */ -#else - BN_ULONG n0; /* least significant word of Ni */ -#endif} - {$IFNDEF USE_THIS} - //* OpenSSL 0.9.9 preview: */ - n0 : array [0..1] of BN_ULONG; - {$ELSE} - n0 : BN_ULONG; // least significant word of Ni - {$ENDIF} - flags : TIdC_INT; - end; - {$EXTERNALSYM PBN_MONT_CTX} - PBN_MONT_CTX = ^BN_MONT_CTX; -// BN_BLINDING = record - //I can't locate any information about the record fields in this. -// end; - {$EXTERNALSYM PBN_BLINDING} - PBN_BLINDING = pointer;//^BN_BLINDING; - {$EXTERNALSYM BN_RECP_CTX} - BN_RECP_CTX = record - N : BIGNUM; // the divisor - Nr : BIGNUM; // the reciprocal - num_bits : TIdC_INT; - shift : TIdC_INT; - flags : TIdC_INT; - end; - {$EXTERNALSYM PBN_RECP_CTX} - PBN_RECP_CTX = ^BN_RECP_CTX; - {$EXTERNALSYM PBN_GENCB} - PBN_GENCB = ^BN_GENCB; - {$EXTERNALSYM PPBN_GENCB} - PPBN_GENCB = ^PBN_GENCB; - {$EXTERNALSYM BN_cb_1} - BN_cb_1 = procedure (p1, p2 : TIdC_INT; p3 : Pointer); cdecl; - {$EXTERNALSYM BN_cb_2} - BN_cb_2 = function (p1, p2 : TIdC_INT; p3 : PBN_GENCB): TIdC_INT; cdecl; - {$EXTERNALSYM BN_GENCB_union} - BN_GENCB_union = record - case Integer of - // if(ver==1) - handles old style callbacks - 0 : (cb_1 : BN_cb_1); - // if(ver==2) - new callback style - 1 : (cb_2 : BN_cb_2); - end; - {$EXTERNALSYM BN_GENCB} - BN_GENCB = record - ver : TIdC_UINT; // To handle binary (in)compatibility - arg : Pointer; // callback-specific data - cb : BN_GENCB_union; - end; - //aes.h - - //seed.h - - //chamellia.h - {$IFNDEF OPENSSL_NO_CAMELLIA} - {$EXTERNALSYM KEY_TABLE_TYPE} - KEY_TABLE_TYPE = array [0..(CAMELLIA_TABLE_WORD_LEN - 1)] of TIdC_UINT; //* to match with WORD */ - {$EXTERNALSYM CAMELLIA_KEY_union} - CAMELLIA_KEY_union = record - case byte of - 0 : (d : TIdC_DOUBLE); //* ensures 64-bit align */ - 1 : (rd_key : KEY_TABLE_TYPE); - end; - {$EXTERNALSYM CAMELLIA_KEY} - CAMELLIA_KEY = record - u : CAMELLIA_KEY_union; - grand_rounds : TIdC_INT; - end; - {$EXTERNALSYM PCAMELLIA_KEY} - PCAMELLIA_KEY = ^CAMELLIA_KEY; - {$ENDIF} - //whrlpool.h - {$EXTERNALSYM WHIRLPOOL_CTX_union} - WHIRLPOOL_CTX_union = record - case byte of - 0 : (c : array [0..WHIRLPOOL_DIGEST_LENGTH - 1] of byte ); - 1 : (q : array [0..(WHIRLPOOL_DIGEST_LENGTH div SizeOf(TIdC_DOUBLE))-1 ] of TIdC_DOUBLE); - end; - {$EXTERNALSYM WHIRLPOOL_CTX} - WHIRLPOOL_CTX = record - H : WHIRLPOOL_CTX_union; - data : array [0..(WHIRLPOOL_BBLOCK div 8)-1] of byte; - bitoff : TIdC_INT; - bitlen : array[0..(WHIRLPOOL_COUNTER div sizeof(size_t))-1] of size_t; - end; - {$EXTERNALSYM PWHIRLPOOL_CTX} - PWHIRLPOOL_CTX = ^WHIRLPOOL_CTX; - - //md2.h - {$IFNDEF OPENSSL_NO_MD2} - {$EXTERNALSYM MD2_CTX} - MD2_CTX = record - num : TIdC_UINT; - data : array [0..MD2_BLOCK - 1] of TIdAnsiChar; - cksm : array [0..MD2_BLOCK - 1] of MD2_INT; - state : array[0..MD2_BLOCK -1] of MD2_INT; - end; - {$EXTERNALSYM PMD2_CTX} - PMD2_CTX = ^MD2_CTX; - {$ENDIF} - //md4.h - {$IFNDEF OPENSSL_NO_MD4} - {$EXTERNALSYM MD4_LONG} - MD4_LONG = TIdC_ULONG; - {$EXTERNALSYM MD4_CTX} - MD4_CTX = record - A,B,C,D : MD4_LONG; - Nl,Nh : MD4_LONG; - data : array [0..(MD4_LBLOCK-1)] of MD4_LONG; - num : TIdC_UINT; - end; - {$EXTERNALSYM PMD4_CTX} - PMD4_CTX = ^MD4_CTX; - {$ENDIF} - //md5.h - {$EXTERNALSYM MD5_LONG} - MD5_LONG = TIdC_UINT; - {$EXTERNALSYM MD5_CTX} - MD5_CTX = record - A,B,C,D : MD5_LONG; - Nl,Nh : MD5_LONG; - data : array [0..(MD5_LBLOCK - 1)] of MD5_LONG; - num : TIdC_UINT; - end; - {$EXTERNALSYM PMD5_CTX} - PMD5_CTX = ^MD5_CTX; - //sha.h -//#if defined(OPENSSL_NO_SHA) || (defined(OPENSSL_NO_SHA0) && defined(OPENSSL_NO_SHA1)) -//#error SHA is disabled. -//#endif - {$IFDEF OPENSSL_NO_SHA} - {$DEFINE DONTUSESHA} - {$ENDIF} - {$IFDEF PENSSL_NO_SHA0} - {$IFDEF OPENSSL_NO_SHA1} - {$DEFINE DONTUSESHA} - {$ENDIF} - {$ENDIF} - {$IFNDEF DONTUSESHA} - {$IFDEF OPENSSL_FIPS} - {$EXTERNALSYM FIPS_SHA_SIZE_T} - FIPS_SHA_SIZE_T = size_t; - {$ENDIF} - {$ENDIF} - {$EXTERNALSYM SHA_LONG} - SHA_LONG = TIdC_UINT; - {$EXTERNALSYM SHA_CTX} - SHA_CTX = record - h0,h1,h2,h3,h4 : SHA_LONG; - Nl,Nh : SHA_LONG; - data : array [0..SHA_LBLOCK] of SHA_LONG; - num : TIdC_INT; - end; - {$IFNDEF OPENSSL_NO_SHA256} - {$EXTERNALSYM SHA256_CTX} - SHA256_CTX = record - h : array [0..(8 - 1)] of SHA_LONG; - Nl,Nh : SHA_LONG; - data : array [0..(SHA_LBLOCK -1)] of SHA_LONG; - num,md_len : TIdC_UINT; - end; - {$ENDIF} - {$IFNDEF OPENSSL_NO_SHA512} - {$EXTERNALSYM SHA_LONG64} - //not defined like this in sha.h but a comment - //says that it must be 64 bit. - SHA_LONG64 = TIdC_UINT64; - {$EXTERNALSYM TSHA512_CTX_Union} - TSHA512_CTX_Union = record - case integer of - 0 : (d : array [0..(SHA_LBLOCK -1)] of SHA_LONG64); - 1 : (p : array [0..(SHA512_CBLOCK -1)] of byte); - end; - {$EXTERNALSYM SHA512_CTX} - SHA512_CTX = record - h : array[0..(8-1)]of SHA_LONG64; - Nl,Nh : SHA_LONG64; - u : TSHA512_CTX_Union; - num,md_len : TIdC_UINT; - end; - {$EXTERNALSYM PSHA512_CTX} - PSHA512_CTX = ^SHA512_CTX; - {$ENDIF} - //ui.h - {$EXTERNALSYM PUI_METHOD} - PUI_METHOD = Pointer; //^UI_METHOD - {$EXTERNALSYM PUI_STRING} - PUI_STRING = Pointer; //^UI_STRING; - {$IFDEF DEBUG_SAFESTACK} - {$EXTERNALSYM STACK_OF_UI_STRING} - STACK_OF_UI_STRING = record - stack: stack; - end; - {$EXTERNALSYM PSTACK_OF_UI_STRING} - PSTACK_OF_UI_STRING = ^STACK_OF_UI_STRING; - {$ELSE} - //I think the DECLARE_STACK_OF macro is empty - {$EXTERNALSYM PSTACK_OF_UI_STRING} - PSTACK_OF_UI_STRING = PSTACK; - {$ENDIF} - {$EXTERNALSYM UI_string_types} - {$EXTERNALSYM UIT_NONE} - {$EXTERNALSYM UIT_PROMPT} - {$EXTERNALSYM UIT_VERIFY} - {$EXTERNALSYM UIT_BOOLEAN} - {$EXTERNALSYM UIT_INFO} - {$EXTERNALSYM UIT_ERROR} - UI_string_types = ( - UIT_NONE, //=0, - UIT_PROMPT, //* Prompt for a string */ - UIT_VERIFY, //* Prompt for a string and verify */ - UIT_BOOLEAN, //* Prompt for a yes/no response */ - UIT_INFO, //* Send info to the user */ - UIT_ERROR); //* Send an error message to the user */ - - //bio.h - //http://www.openssl.org/docs/crypto/bio.html - {$EXTERNALSYM PBIO} - PBIO = ^BIO; - {$EXTERNALSYM PBIO_METHOD} - PBIO_METHOD = ^BIO_METHOD; - {$EXTERNALSYM Pbio_info_cb} - Pbio_info_cb = procedure (_para1 : PBIO; _para2 : TIdC_INT; _para3 : PIdAnsiChar; - _para4 : TIdC_INT; _para5, _para6 : TIdC_LONG); cdecl; - {$EXTERNALSYM BIO_METHOD} - BIO_METHOD = record - _type : TIdC_INT; - name : PIdAnsiChar; - bwrite : function(_para1 : PBIO; _para2 : PIdAnsiChar; _para3 : TIdC_INT) : TIdC_INT; cdecl; - bread : function(_para1: PBIO; _para2: PIdAnsiChar; _para3: TIdC_INT) : TIdC_INT; cdecl; - bputs : function (_para1 : PBIO; _para2 : PIdAnsiChar) : TIdC_INT; cdecl; - bgets : function (_para1 : PBIO; _para2 : PIdAnsiChar; _para3 : TIdC_INT) : TIdC_INT; cdecl; - ctrl : function (_para1 : PBIO; _para2 : TIdC_INT; _para3 : TIdC_LONG; _para4 : Pointer) : TIdC_LONG; cdecl; - create : function(_para1 : PBIO) : TIdC_INT; cdecl; - destroy : function (_para1 : PBIO) : TIdC_INT; cdecl; - callback_ctrl : function (_para1 : PBIO; _para2 : TIdC_INT; _para3 : pbio_info_cb): TIdC_LONG; cdecl; - end; - BIO = record - method : PBIO_METHOD; - // bio, mode, argp, argi, argl, ret - callback : function (_para1 : PBIO; _para2 : TIdC_INT; _para3 : PIdAnsiChar; - _para4 : TIdC_INT; _para5, _para6 : TIdC_LONG) : TIdC_LONG cdecl; - cb_arg : PIdAnsiChar; // first argument for the callback - init : TIdC_INT; - shutdown : TIdC_INT; - flags : TIdC_INT; // extra storage - retry_reason : TIdC_INT; - num : TIdC_INT; - ptr : Pointer; - next_bio : PBIO; // used by filter BIOs - prev_bio : PBIO; // used by filter BIOs - references : TIdC_INT; - num_read : TIdC_ULONG; - num_write : TIdC_ULONG; - ex_data : CRYPTO_EX_DATA; - end; - {$EXTERNALSYM BIO} - {$EXTERNALSYM BIO_F_BUFFER_CTX} - BIO_F_BUFFER_CTX = record - { - /* Buffers are setup like this: - * - * <---------------------- size -----------------------> - * +---------------------------------------------------+ - * | consumed | remaining | free space | - * +---------------------------------------------------+ - * <-- off --><------- len -------> - *} - - //* BIO *bio; */ /* this is now in the BIO struct */ - ibuf_size : TIdC_INT; //* how big is the input buffer */ - obuf_size : TIdC_INT; //* how big is the output buffer */ - - ibuf : PIdAnsiChar; //* the char array */ - ibuf_len : TIdC_INT; //* how many bytes are in it */ - ibuf_off : TIdC_INT; //* write/read offset */ - - obuf : PIdAnsiChar; //* the char array */ - obuf_len : TIdC_INT; //* how many bytes are in it */ - obuf_off : TIdC_INT; //* write/read offset */ - end; - {$EXTERNALSYM PBIO_F_BUFFER_CTX} - PBIO_F_BUFFER_CTX = ^BIO_F_BUFFER_CTX; - //* Prefix and suffix callback in ASN1 BIO *// - {$EXTERNALSYM asn1_ps_function} - asn1_ps_function = function (b : PBIO; pbuf : PPIdAnsiChar; plen : PIdC_INT; parg : Pointer) : TIdC_INT cdecl; - //struct from engine.h -// ENGINE = record - //I don't have any info about record fields. -// end; - {$EXTERNALSYM PENGINE} - PENGINE = Pointer;//^ENGINE; - {$EXTERNALSYM PPENGINE} - PPENGINE = ^PENGINE; - //asn1.h - {$EXTERNALSYM I2D_OF_void} - //#define I2D_OF(type) int (*)(type *,unsigned char **) - I2D_OF_void = function(_para1 : Pointer; _para2 : PPByte) : TIdC_INT cdecl; - //D2I_OF(type) type *(*)(type **,const unsigned char **,long) - {$EXTERNALSYM D2I_OF_void} - D2I_OF_void = function (_para1 : PPointer; _para2 : PPByte; _para3 : TIdC_LONG) : Pointer cdecl; - // This is just an opaque pointer - // ASN1_VALUE = record - // end; - {$EXTERNALSYM PASN1_VALUE} - PASN1_VALUE = Pointer;//^ASN1_VALUE; - {$EXTERNALSYM PPASN1_VALUE} - PPASN1_VALUE = ^PASN1_VALUE; - {$IFDEF DEBUG_SAFESTACK} - {$EXTERNALSYM STACK_OF_ASN1_VALUE} - STACK_OF_ASN1_VALUE = record - stack: stack; - end; - {$EXTERNALSYM PSTACK_OF_ASN1_VALUE} - PSTACK_OF_ASN1_VALUE = ^STACK_OF_ASN1_VALUE; - {$ELSE} - //I think the DECLARE_STACK_OF macro is empty - {$EXTERNALSYM PSTACK_OF_ASN1_VALUE} - PSTACK_OF_ASN1_VALUE = PSTACK; - {$ENDIF} - {$EXTERNALSYM ASN1_OBJECT} - ASN1_OBJECT = record - sn, ln : PIdAnsiChar; - nid : TIdC_INT; - length : TIdC_INT; - data : PIdAnsiChar; - flags : TIdC_INT; // Should we free this one - end; - {$EXTERNALSYM PASN1_OBJECT} - PASN1_OBJECT = ^ASN1_OBJECT; - {$EXTERNALSYM PPASN1_OBJECT} - PPASN1_OBJECT = ^PASN1_OBJECT; - {$IFDEF DEBUG_SAFESTACK} - {$EXTERNALSYM STACK_OF_ASN1_OBJECT} - STACK_OF_ASN1_OBJECT = record - stack: stack; - end; - {$EXTERNALSYM PSTACK_OF_ASN1_OBJECT} - PSTACK_OF_ASN1_OBJECT = ^STACK_OF_ASN1_OBJECT; - {$ELSE} - //I think the DECLARE_STACK_OF macro is empty - {$EXTERNALSYM PSTACK_OF_ASN1_OBJECT} - PSTACK_OF_ASN1_OBJECT = PSTACK; - {$ENDIF} - {$EXTERNALSYM PPSTACK_OF_ASN1_OBJECT} - PPSTACK_OF_ASN1_OBJECT = ^PSTACK_OF_ASN1_OBJECT; - {$EXTERNALSYM asn1_string_st} - asn1_string_st = record - length : TIdC_INT; - _type : TIdC_INT; - data : PIdAnsiChar; - { The value of the following field depends on the type being - held. It is mostly being used for BIT_STRING so if the - input data has a non-zero 'unused bits' value, it will be - handled correctly } - flags : TIdC_LONG; - end; - //moved from asn1.h section here for a type definition - - {$IFNDEF OPENSSL_EXPORT_VAR_AS_FUNCTION} - {$EXTERNALSYM PASN1_ITEM} - // ASN1_ITEM pointer exported type - // typedef const ASN1_ITEM ASN1_ITEM_EXP; - PASN1_ITEM = ^ASN1_ITEM; - {$ELSE} - // Platforms that can't easily handle shared global variables are declared - // as functions returning ASN1_ITEM pointers. - // ASN1_ITEM pointer exported type - //typedef const ASN1_ITEM * ASN1_ITEM_EXP(void); - {$EXTERNALSYM PASN1_ITEM_EXP} - PASN1_ITEM_EXP = ^ASN1_ITEM_EXP; - {$ENDIF} -// typedef int asn1_output_data_fn(BIO *out, BIO *data, ASN1_VALUE *val, int flags, -// const ASN1_ITEM *it); - {$EXTERNALSYM asn1_output_data_fn} - asn1_output_data_fn = function(AOut : PBIO; data : PBIO; val : PASN1_VALUE; - flags : TIdC_INT; it : PASN1_ITEM): TIdC_INT; stdcall; - {$EXTERNALSYM ASN1_STRING} - ASN1_STRING = asn1_string_st; - {$EXTERNALSYM PASN1_STRING} - PASN1_STRING = ^ASN1_STRING; - {$EXTERNALSYM PPASN1_STRING} - PPASN1_STRING = ^PASN1_STRING; - {$EXTERNALSYM ASN1_INTEGER} - ASN1_INTEGER = ASN1_STRING; - {$EXTERNALSYM PASN1_INTEGER} - PASN1_INTEGER = ^ASN1_INTEGER; - {$EXTERNALSYM PPASN1_INTEGER} - PPASN1_INTEGER = ^PASN1_INTEGER; - {$IFDEF DEBUG_SAFESTACK} - {$EXTERNALSYM STACK_OF_ASN1_INTEGER} - STACK_OF_ASN1_INTEGER = record - stack: stack; - end; - {$EXTERNALSYM PSTACK_OF_ASN1_INTEGER} - PSTACK_OF_ASN1_INTEGER = ^STACK_OF_ASN1_INTEGER; - {$ELSE} - //I think the DECLARE_STACK_OF macro is empty - {$EXTERNALSYM PSTACK_OF_ASN1_INTEGER} - PSTACK_OF_ASN1_INTEGER = PSTACK; - {$ENDIF} - {$EXTERNALSYM ASN1_ENUMERATED} - ASN1_ENUMERATED = ASN1_STRING; - {$EXTERNALSYM PASN1_ENUMERATED} - PASN1_ENUMERATED = ^ASN1_ENUMERATED; - {$EXTERNALSYM PPASN1_ENUMERATED} - PPASN1_ENUMERATED = ^PASN1_ENUMERATED; - {$EXTERNALSYM ASN1_BIT_STRING} - ASN1_BIT_STRING = ASN1_STRING; - {$EXTERNALSYM PASN1_BIT_STRING} - PASN1_BIT_STRING = ^ASN1_BIT_STRING; - {$EXTERNALSYM PPASN1_BIT_STRING} - PPASN1_BIT_STRING = ^PASN1_BIT_STRING; - {$EXTERNALSYM ASN1_OCTET_STRING} - ASN1_OCTET_STRING = ASN1_STRING; - {$EXTERNALSYM PASN1_OCTET_STRING} - PASN1_OCTET_STRING = ^ASN1_OCTET_STRING; - {$EXTERNALSYM PPASN1_OCTET_STRING} - PPASN1_OCTET_STRING = ^PASN1_OCTET_STRING; - {$EXTERNALSYM ASN1_PRINTABLESTRING} - ASN1_PRINTABLESTRING = ASN1_STRING; - {$EXTERNALSYM PASN1_PRINTABLESTRING} - PASN1_PRINTABLESTRING = ^ASN1_PRINTABLESTRING; - {$EXTERNALSYM PPASN1_PRINTABLESTRING} - PPASN1_PRINTABLESTRING = ^PASN1_PRINTABLESTRING; - {$EXTERNALSYM ASN1_T61STRING} - ASN1_T61STRING = ASN1_STRING; - {$EXTERNALSYM PASN1_T61STRING} - PASN1_T61STRING = ^ASN1_T61STRING; - {$EXTERNALSYM PPASN1_T61STRING} - PPASN1_T61STRING = ^PASN1_T61STRING; - {$EXTERNALSYM ASN1_IA5STRING} - ASN1_IA5STRING = ASN1_STRING; - {$EXTERNALSYM PASN1_IA5STRING} - PASN1_IA5STRING = ^ASN1_IA5STRING; - {$EXTERNALSYM PPASN1_IA5STRING} - PPASN1_IA5STRING = ^PASN1_IA5STRING; - {$EXTERNALSYM ASN1_UTCTIME} - ASN1_UTCTIME = ASN1_STRING; - {$EXTERNALSYM PASN1_UTCTIME} - PASN1_UTCTIME = ^ASN1_UTCTIME; - {$EXTERNALSYM PPASN1_UTCTIME} - PPASN1_UTCTIME = ^PASN1_UTCTIME; - {$EXTERNALSYM ASN1_GENERALIZEDTIME} - ASN1_GENERALIZEDTIME = ASN1_STRING; - {$EXTERNALSYM PASN1_GENERALIZEDTIME} - PASN1_GENERALIZEDTIME = ^ASN1_GENERALIZEDTIME; - {$EXTERNALSYM PPASN1_GENERALIZEDTIME} - PPASN1_GENERALIZEDTIME = ^PASN1_GENERALIZEDTIME; - {$EXTERNALSYM ASN1_TIME} - ASN1_TIME = ASN1_STRING; - {$EXTERNALSYM PASN1_TIME} - PASN1_TIME = ^ASN1_TIME; - {$EXTERNALSYM PPASN1_TIME} - PPASN1_TIME = ^PASN1_TIME; - {$EXTERNALSYM ASN1_GENERALSTRING} - ASN1_GENERALSTRING = ASN1_STRING; - {$EXTERNALSYM PASN1_GENERALSTRING} - PASN1_GENERALSTRING = ^ASN1_GENERALSTRING; - {$EXTERNALSYM PPASN1_GENERALSTRING} - PPASN1_GENERALSTRING = ^PASN1_GENERALSTRING; - {$IFDEF DEBUG_SAFESTACK} - {$EXTERNALSYM STACK_OF_ASN1_GENERALSTRING} - STACK_OF_ASN1_GENERALSTRING = record - _stack: STACK; - end; - {$EXTERNALSYM PSTACK_OF_ASN1_GENERALSTRING} - PSTACK_OF_ASN1_GENERALSTRING =^STACK_OF_ASN1_GENERALSTRING; - {$ELSE} - //I think the DECLARE_STACK_OF macro is empty - {$EXTERNALSYM PSTACK_OF_ASN1_GENERALSTRING} - PSTACK_OF_ASN1_GENERALSTRING = PSTACK; - {$ENDIF} - {$EXTERNALSYM ASN1_UNIVERSALSTRING} - ASN1_UNIVERSALSTRING = ASN1_STRING; - {$EXTERNALSYM PASN1_UNIVERSALSTRING} - PASN1_UNIVERSALSTRING = ^ASN1_UNIVERSALSTRING; - {$EXTERNALSYM PPASN1_UNIVERSALSTRING} - PPASN1_UNIVERSALSTRING = ^PASN1_UNIVERSALSTRING; - {$EXTERNALSYM ASN1_BMPSTRING} - ASN1_BMPSTRING = ASN1_STRING; - {$EXTERNALSYM PASN1_BMPSTRING} - PASN1_BMPSTRING = ^ASN1_BMPSTRING; - {$EXTERNALSYM PPASN1_BMPSTRING} - PPASN1_BMPSTRING = ^PASN1_BMPSTRING; - {$EXTERNALSYM ASN1_VISIBLESTRING} - ASN1_VISIBLESTRING = ASN1_STRING; - {$EXTERNALSYM PASN1_VISIBLESTRING} - PASN1_VISIBLESTRING = ^ASN1_VISIBLESTRING; - {$EXTERNALSYM PPASN1_VISIBLESTRING} - PPASN1_VISIBLESTRING = ^PASN1_VISIBLESTRING; - {$EXTERNALSYM ASN1_UTF8STRING} - ASN1_UTF8STRING = ASN1_STRING; - {$EXTERNALSYM PASN1_UTF8STRING} - PASN1_UTF8STRING = ^ASN1_UTF8STRING; - {$EXTERNALSYM PPASN1_UTF8STRING} - PPASN1_UTF8STRING = ^PASN1_UTF8STRING; - {$EXTERNALSYM ASN1_BOOLEAN} - ASN1_BOOLEAN = TIdC_INT; - {$EXTERNALSYM PASN1_BOOLEAN} - PASN1_BOOLEAN = ^ASN1_BOOLEAN; - {$EXTERNALSYM PPASN1_BOOLEAN} - PPASN1_BOOLEAN = ^PASN1_BOOLEAN; - {$EXTERNALSYM ASN1_NULL} - ASN1_NULL = TIdC_INT; - {$EXTERNALSYM PASN1_NULL} - PASN1_NULL = ^ASN1_NULL; - {$EXTERNALSYM PPASN1_NULL} - PPASN1_NULL = ^PASN1_NULL; - {$EXTERNALSYM ASN1_TYPE} - ASN1_TYPE = record - case Integer of - 0: (ptr: PIdAnsiChar); - 1: (boolean: ASN1_BOOLEAN); - 2: (asn1_string: PASN1_STRING); - 3: (_object: PASN1_OBJECT); - 4: (integer: PASN1_INTEGER); - 5: (enumerated: PASN1_ENUMERATED); - 6: (bit_string: PASN1_BIT_STRING); - 7: (octet_string: PASN1_OCTET_STRING); - 8: (printablestring: PASN1_PRINTABLESTRING); - 9: (t61string: PASN1_T61STRING); - 10: (ia5string: PASN1_IA5STRING); - 11: (generalstring: PASN1_GENERALSTRING); - 12: (bmpstring: PASN1_BMPSTRING); - 13: (universalstring: PASN1_UNIVERSALSTRING); - 14: (utctime: PASN1_UTCTIME); - 15: (generalizedtime: PASN1_GENERALIZEDTIME); - 16: (visiblestring: PASN1_VISIBLESTRING); - 17: (utf8string: PASN1_UTF8STRING); - { set and sequence are left complete and still - contain the set or sequence bytes } - 18: (_set: PASN1_STRING); - 19: (sequence: PASN1_STRING); - end; - {$EXTERNALSYM PASN1_TYPE} - PASN1_TYPE = ^ASN1_TYPE; - {$EXTERNALSYM PPASN1_TYPE} - PPASN1_TYPE = ^PASN1_TYPE; - {$IFDEF DEBUG_SAFESTACK} - {$EXTERNALSYM STACK_OF_ASN1_TYPE} - STACK_OF_ASN1_TYPE = record - _stack: stack; - end; - {$EXTERNALSYM PSTACK_OF_ASN1_TYPE} - PSTACK_OF_ASN1_TYPE = ^STACK_OF_ASN1_TYPE; - {$ELSE} - //I think the DECLARE_STACK_OF macro is empty - {$EXTERNALSYM PSTACK_OF_ASN1_TYPE} - PSTACK_OF_ASN1_TYPE = ^PSTACK; - {$ENDIF} - {$EXTERNALSYM ASN1_CTX} - ASN1_CTX = record - p : PIdAnsiChar; // work char pointer - eos : TIdC_INT; // end of sequence read for indefinite encoding - error : TIdC_INT; // error code to use when returning an error - inf : TIdC_INT; // constructed if 0x20, indefinite is 0x21 - tag : TIdC_INT; // tag from last 'get object' - xclass : TIdC_INT; // class from last 'get object' - slen : TIdC_LONG; // length of last 'get object' - max : PIdAnsiChar; // largest value of p allowed - q : PIdAnsiChar; // temporary variable - pp : PPIdAnsiChar; // variable - line : TIdC_INT; // used in error processing - end; - {$EXTERNALSYM PASN1_CTX} - PASN1_CTX = ^ASN1_CTX; - {$EXTERNALSYM PPASN1_CTX} - PPASN1_CTX = ^PASN1_CTX; - {$EXTERNALSYM ASN1_METHOD} - ASN1_METHOD = record - i2d : i2d_of_void; - d2i : i2d_of_void; - create : function: Pointer; cdecl; - destroy : procedure(ptr: Pointer); cdecl; - end; - {$EXTERNALSYM PASN1_METHOD} - PASN1_METHOD = ^ASN1_METHOD; - {$EXTERNALSYM PPASN1_METHOD} - PPASN1_METHOD = ^PASN1_METHOD; - // This is used when parsing some Netscape objects - {$EXTERNALSYM ASN1_HEADER} - ASN1_HEADER = record - header : PASN1_OCTET_STRING; - data : Pointer; - meth : PASN1_METHOD; - end; - {$EXTERNALSYM PASN1_HEADER} - PASN1_HEADER = ^ASN1_HEADER; - {$EXTERNALSYM PPASN1_HEADER} - PPASN1_HEADER = ^PASN1_HEADER; - {$EXTERNALSYM ASN1_ENCODING} - ASN1_ENCODING = record - enc: PIdAnsiChar; - len: TIdC_LONG; - modified: TIdC_INT; - end; - {$EXTERNALSYM PASN1_ENCODING} - PASN1_ENCODING = ^ASN1_ENCODING; - {$EXTERNALSYM PPASN1_ENCODING} - PPASN1_ENCODING = ^PASN1_ENCODING; - {$EXTERNALSYM ASN1_STRING_TABLE} - ASN1_STRING_TABLE = record - nid : TIdC_INT; - minsize : TIdC_LONG; - maxsize : TIdC_LONG; - mask : TIdC_ULONG; - flags : TIdC_ULONG; - end; - {$EXTERNALSYM PASN1_STRING_TABLE} - PASN1_STRING_TABLE = ^ASN1_STRING_TABLE; - {$EXTERNALSYM PPASN1_STRING_TABLE} - PPASN1_STRING_TABLE = ^ASN1_STRING_TABLE; - {$IFDEF DEBUG_SAFESTACK} - {$EXTERNALSYM STACK_OF_ASN1_STRING_TABLE} - STACK_OF_ASN1_STRING_TABLE = record - _stack: stack; - end; - {$EXTERNALSYM PSTACK_OF_ASN1_STRING_TABLE} - PSTACK_OF_ASN1_STRING_TABLE = ^STACK_OF_ASN1_STRING_TABLE; - {$ELSE} - //I think the DECLARE_STACK_OF macro is empty - {$EXTERNALSYM PSTACK_OF_ASN1_STRING_TABLE} - PSTACK_OF_ASN1_STRING_TABLE = PSTACK; - {$ENDIF} - {$IFNDEF OPENSSL_EXPORT_VAR_AS_FUNCTION} - // ASN1_ITEM pointer exported type - // typedef const ASN1_ITEM ASN1_ITEM_EXP; - // ASN1_ITEM_EXP = ASN1_ITEM; - // PASN1_ITEM_EXP = ^ASN1_ITEM_EXP; - // PASN1_ITEM = ^ASN1_ITEM; - {$EXTERNALSYM PASN1_ITEM_EXP} - PASN1_ITEM_EXP = PASN1_ITEM; - {$ELSE} - // Platforms that can't easily handle shared global variables are declared - // as functions returning ASN1_ITEM pointers. - - // ASN1_ITEM pointer exported type - //typedef const ASN1_ITEM * ASN1_ITEM_EXP(void); - {$EXTERNALSYM ASN1_ITEM_EXP} - ASN1_ITEM_EXP = function : PASN1_ITEM cdecl; -// PASN1_ITEM_EXP = ^ASN1_ITEM_EXP; - {$ENDIF} - //rsa.h - struct rsa_st - {$IFNDEF OPENSSL_NO_RSA} - {$IFDEF OPENSSL_FIPS} - {$EXTERNALSYM FIPS_RSA_SIZE_T} - FIPS_RSA_SIZE_T = TIdC_int; - {$ENDIF} - {$EXTERNALSYM PRSA} - PRSA = ^RSA; - {$EXTERNALSYM PPRSA} - PPRSA =^PRSA; - {$EXTERNALSYM RSA_METHOD} - RSA_METHOD = record - name : PIdAnsiChar; - rsa_pub_enc : function (flen : TIdC_INT; const from : PIdAnsiChar; - _to : PIdAnsiChar; rsa : PRSA; padding : TIdC_INT) : TIdC_INT; cdecl; - rsa_pub_dec : function (flen : TIdC_INT; const from : PIdAnsiChar; - _to : PIdAnsiChar; rsa : PRSA; padding : TIdC_INT) : TIdC_INT; cdecl; - rsa_priv_enc : function (flen : TIdC_INT; const from : PIdAnsiChar; - _to : PIdAnsiChar; rsa : PRSA; padding : TIdC_INT) : TIdC_INT; cdecl; - rsa_priv_dec : function (flen : TIdC_INT; const from : PIdAnsiChar; - _to : PIdAnsiChar; rsa : PRSA; padding : TIdC_INT) : TIdC_INT; cdecl; - rsa_mod_exp : function (r0 : PBIGNUM; const I : PBIGNUM; - rsa : PRSA; ctx : PBN_CTX) : TIdC_INT cdecl; // Can be null / - bn_mod_exp : function (r : PBIGNUM; const a : PBIGNUM; - const p : PBIGNUM; const m: PBIGNUM; ctx : PBN_CTX; - m_ctx : PBN_MONT_CTX ) : TIdC_INT; cdecl; // Can be null - init : function (rsa : PRSA) : TIdC_INT; cdecl; // called at new - finish : function (rsa : PRSA) : TIdC_INT; cdecl; // called at free - flags : TIdC_INT; // RSA_METHOD_FLAG_* things - app_data : PIdAnsiChar; // may be needed! - // New sign and verify functions: some libraries don't allow arbitrary data - // to be signed/verified: this allows them to be used. Note: for this to work - // the RSA_public_decrypt() and RSA_private_encrypt() should *NOT* be used - // RSA_sign(), RSA_verify() should be used instead. Note: for backwards - // compatibility this functionality is only enabled if the RSA_FLAG_SIGN_VER - // option is set in 'flags'. - // - rsa_sign : function (_type : TIdC_INT; const m : PIdAnsiChar; m_length : TIdC_UINT; - sigret : PIdAnsiChar; siglen : PIdC_UINT; const rsa : PRSA) : TIdC_INT; cdecl; - rsa_verify : function(dtype : TIdC_INT; const m : PIdAnsiChar; m_length : PIdC_UINT; - sigbuf : PIdAnsiChar; siglen : PIdC_UINT; const rsa :PRSA) : TIdC_INT; cdecl; - // If this callback is NULL, the builtin software RSA key-gen will be used. - // This is for behavioural compatibility whilst the code gets rewired, but - // one day it would be nice to assume there are no such things as "builtin - // software" implementations. - rsa_keygen : function (rsa : PRSA; bits : TIdC_INT; e : PBIGNUM; cb : PBN_GENCB) : TIdC_INT; cdecl; - end; - {$EXTERNALSYM PRSA_METHOD} - PRSA_METHOD = ^RSA_METHOD; - - {$EXTERNALSYM rsa_st} - rsa_st = record - // The first parameter is used to pickup errors where - // this is passed instead of aEVP_PKEY, it is set to 0 - pad : TIdC_INT; - version : TIdC_LONG; - meth : PRSA_METHOD; // const RSA_METHOD *meth; - // functional reference if 'meth' is ENGINE-provided - engine : PENGINE; - n : PBIGNUM; - e : PBIGNUM; - d : PBIGNUM; - p : PBIGNUM; - q : PBIGNUM; - dmp1 : PBIGNUM; - dmq1 : PBIGNUM; - iqmp : PBIGNUM; - // be careful using this if the RSA structure is shared - ex_data : CRYPTO_EX_DATA; - references : TIdC_INT; - flags : TIdC_INT; - // Used to cache montgomery values - _method_mod_n : PBN_MONT_CTX; - _method_mod_p : PBN_MONT_CTX; - _method_mod_q : PBN_MONT_CTX; - // all BIGNUM values are actually in the following data, if it is not NULL - bignum_data : PIdAnsiChar; - blinding : PBN_BLINDING; - mt_blinding : PBN_BLINDING; - end; - {$EXTERNALSYM RSA} - RSA = rsa_st; - {$EXTERNALSYM Prsa_st} - Prsa_st = PRSA; - {$ENDIF} - //dso.h - {$EXTERNALSYM PDSO} - PDSO = ^DSO; -///* The function prototype used for method functions (or caller-provided -// * callbacks) that transform filenames. They are passed a DSO structure pointer -// * (or NULL if they are to be used independantly of a DSO object) and a -// * filename to transform. They should either return NULL (if there is an error -// * condition) or a newly allocated string containing the transformed form that -// * the caller will need to free with OPENSSL_free() when done. */ - {$EXTERNALSYM DSO_NAME_CONVERTER_FUNC} - DSO_NAME_CONVERTER_FUNC = function (dso : PDSO; para1 : PIdAnsiChar) : PIdAnsiChar cdecl; - {$EXTERNALSYM PDSO_METHOD} - PDSO_METHOD = ^DSO_METHOD; - {$EXTERNALSYM DSO_FUNC_TYPE} - DSO_FUNC_TYPE = procedure cdecl; -///* The function prototype used for method functions (or caller-provided -// * callbacks) that merge two file specifications. They are passed a -// * DSO structure pointer (or NULL if they are to be used independantly of -// * a DSO object) and two file specifications to merge. They should -// * either return NULL (if there is an error condition) or a newly allocated -// * string containing the result of merging that the caller will need -// * to free with OPENSSL_free() when done. -// * Here, merging means that bits and pieces are taken from each of the -// * file specifications and added together in whatever fashion that is -// * sensible for the DSO method in question. The only rule that really -// * applies is that if the two specification contain pieces of the same -// * type, the copy from the first string takes priority. One could see -// * it as the first specification is the one given by the user and the -// * second being a bunch of defaults to add on if they're missing in the -// * first. */ - {$EXTERNALSYM DSO_MERGER_FUNC} - DSO_MERGER_FUNC = function (DSO : PDSO; para1, para2 : PIdAnsiChar) : PIdAnsiChar stdcall; - {$EXTERNALSYM DSO_METHOD} - DSO_METHOD = record - name : PIdAnsiChar; - ///* Loads a shared library, NB: new DSO_METHODs must ensure that a - // * successful load populates the loaded_filename field, and likewise a - // * successful unload OPENSSL_frees and NULLs it out. */ - dso_load : function (dso : PDSO) : TIdC_INT cdecl; - //* Unloads a shared library */ - dso_unload : function (dso : PDSO) : TIdC_INT cdecl; - //* Binds a variable */ - dso_bind_var : function (dso : PDSO; symname : PIdAnsiChar) : Pointer cdecl; - ///* Binds a function - assumes a return type of DSO_FUNC_TYPE. - // * This should be cast to the real function prototype by the - // * caller. Platforms that don't have compatible representations - // * for different prototypes (this is possible within ANSI C) - // * are highly unlikely to have shared libraries at all, let - // * alone a DSO_METHOD implemented for them. */ - dso_bind_func : function (dso : PDSO; symname : PIdAnsiChar) : DSO_FUNC_TYPE stdcall; - - ///* The generic (yuck) "ctrl()" function. NB: Negative return - // * values (rather than zero) indicate errors. */ - dso_ctrl : function (dso : PDSO; cmd : TIdC_INT; larg : TIdC_LONG; parg : Pointer) : TIdC_LONG stdcall; - ///* The default DSO_METHOD-specific function for converting filenames to - // * a canonical native form. */ - dso_name_converter : DSO_NAME_CONVERTER_FUNC; - ///* The default DSO_METHOD-specific function for converting filenames to - // * a canonical native form. */ - dso_merger : DSO_MERGER_FUNC; - - //* [De]Initialisation handlers. */ - init : function (dso : PDSO) : TIdC_INT stdcall; - finish : function (dso : PDSO) : TIdC_INT stdcall; - - //* Return pathname of the module containing location */ - pathbyaddr : function (addr : Pointer; path : PIdAnsiChar; sz : TIdC_INT) : TIdC_INT stdcall; - //* Perform global symbol lookup, i.e. among *all* modules */ - globallookup : function (symname : PIdAnsiChar) : Pointer stdcall; - end; - {$EXTERNALSYM DSO} - DSO = record - meth : PDSO_METHOD; - ///* Standard dlopen uses a (void *). Win32 uses a HANDLE. VMS - // * doesn't use anything but will need to cache the filename - // * for use in the dso_bind handler. All in all, let each - // * method control its own destiny. "Handles" and such go in - // * a STACK. */ - meth_data : PSTACK_OF_POINTER; - references : TIdC_INT; - flags : TIdC_INT; - ///* For use by applications etc ... use this for your bits'n'pieces, - // * don't touch meth_data! */ - ex_data : CRYPTO_EX_DATA; - ///* If this callback function pointer is set to non-NULL, then it will - // * be used in DSO_load() in place of meth->dso_name_converter. NB: This - // * should normally set using DSO_set_name_converter(). */ - name_converter : DSO_NAME_CONVERTER_FUNC; - ///* If this callback function pointer is set to non-NULL, then it will - // * be used in DSO_load() in place of meth->dso_merger. NB: This - // * should normally set using DSO_set_merger(). */ - merger : DSO_MERGER_FUNC; - ///* This is populated with (a copy of) the platform-independant - // * filename used for this DSO. */ - filename : PIdAnsiChar; - ///* This is populated with (a copy of) the translated filename by which - // * the DSO was actually loaded. It is NULL iff the DSO is not currently - // * loaded. NB: This is here because the filename translation process - // * may involve a callback being invoked more than once not only to - // * convert to a platform-specific form, but also to try different - // * filenames in the process of trying to perform a load. As such, this - // * variable can be used to indicate (a) whether this DSO structure - // * corresponds to a loaded library or not, and (b) the filename with - // * which it was actually loaded. */ - loaded_filename : PIdAnsiChar; - end; - //dh.h - {$IFNDEF OPENSSL_NO_DH} - {$EXTERNALSYM PDH} - PDH = ^DH; - {$EXTERNALSYM DH_METHOD} - DH_METHOD = record - name : PIdAnsiChar; - // Methods here - generate_key : function (dh : PDH) : TIdC_INT; cdecl; - compute_key : function (key : PIdAnsiChar; const pub_key : PBIGNUM; dh : PDH) : TIdC_INT; cdecl; - bn_mod_exp : function (const dh : PDH; r : PBIGNUM; const e : PBIGNUM; - const p : PBIGNUM; const m : PBIGNUM; ctx : PBN_CTX; - m_ctx : PBN_MONT_CTX) : TIdC_INT; cdecl; // Can be null - init : function (dh : PDH) : TIdC_INT; cdecl; - finish : function (dh : PDH) : TIdC_INT; cdecl; - flags : TIdC_INT; - app_data : PIdAnsiChar; - // If this is non-NULL, it will be used to generate parameters - generate_params : function(dh : PDH; prime_len, generator : TIdC_INT; cb : PBN_GENCB) : TIdC_INT; cdecl; - end; - {$EXTERNALSYM dh_st} - dh_st = record - // The first parameter is used to pickup errors where - // this is passed instead of aEVP_PKEY, it is set to 0 - pad : TIdC_INT; - version : TIdC_LONG; - meth : PRSA_METHOD; - // functional reference if 'meth' is ENGINE-provided - engine: PENGINE; - n : PBIGNUM; - e : PBIGNUM; - d : PBIGNUM; - p : PBIGNUM; - q : PBIGNUM; - dmp1 : PBIGNUM; - dmq1 : PBIGNUM; - iqmp : PBIGNUM; - // be careful using this if the RSA structure is shared - ex_data : CRYPTO_EX_DATA; - references : TIdC_INT; - flags : TIdC_INT; - // Used to cache montgomery values - _method_mod_n : BN_MONT_CTX; - _method_mod_p : BN_MONT_CTX; - _method_mod_q : BN_MONT_CTX; - // all BIGNUM values are actually in the following data, if it is not NULL - bignum_data : PIdAnsiChar; - blinding : PBN_BLINDING; - mt_blinding : PBN_BLINDING; - end; - {$EXTERNALSYM DH} - DH = dh_st; - {$EXTERNALSYM Pdh_st} - Pdh_st = PDH; - {$EXTERNALSYM PPDH} - PPDH =^PDH; - {$ENDIF} - // dsa.h - {$IFNDEF OPENSSL_NO_DSA} - {$IFDEF OPENSSL_FIPS} - {$EXTERNALSYM FIPS_DSA_SIZE_T} - FIPS_DSA_SIZE_T = TIdC_int; - {$ENDIF} - {$EXTERNALSYM DSA_SIG} - DSA_SIG = record - r : PBIGNUM; - s : PBIGNUM; - end; - {$EXTERNALSYM PDSA_SIG} - PDSA_SIG = ^DSA_SIG; - {$EXTERNALSYM PDSA} - PDSA = ^DSA; - {$EXTERNALSYM DSA_METHOD} - DSA_METHOD = record - name : PIdAnsiChar; - dsa_do_sign : function (const dgst : PIdAnsiChar; dlen : TIdC_INT; dsa : PDSA) : PDSA_SIG; cdecl; - dsa_sign_setup : function (dsa : PDSA; ctx_in : PBN_CTX; kinvp, rp : PPBN_CTX) : TIdC_INT; cdecl; - dsa_do_verify : function(dgst : PIdAnsiChar; dgst_len : TIdC_INT; - sig : PDSA_SIG; dsa : PDSA) : TIdC_INT; cdecl; - dsa_mod_exp : function(dsa : PDSA; rr, a1, p1, - a2, p2, m : PBIGNUM; ctx : PBN_CTX; - in_mont : PBN_MONT_CTX) : TIdC_INT; cdecl; - bn_mod_exp : function (dsa : PDSA; r, a : PBIGNUM; const p, m : PBIGNUM; - ctx : PBN_CTX; m_ctx : PBN_CTX): TIdC_INT; cdecl; // Can be null - init : function (dsa : PDSA) : TIdC_INT; cdecl; - finish : function (dsa : PDSA) : TIdC_INT; cdecl; - flags : TIdC_INT; - app_data : PIdAnsiChar; - // If this is non-NULL, it is used to generate DSA parameters - dsa_paramgen : function (dsa : PDSA; bits : TIdC_INT; seed : PIdAnsiChar; - seed_len : TIdC_INT; counter_ret : PIdC_INT; h_ret : PIdC_ULONG; - cb : PBN_GENCB ) : TIdC_INT; cdecl; - // If this is non-NULL, it is used to generate DSA keys - dsa_keygen : function(dsa : PDSA) : TIdC_INT; cdecl; - end; - {$EXTERNALSYM PDSA_METHOD} - PDSA_METHOD = ^DSA_METHOD; - - {$EXTERNALSYM dsa_st} - dsa_st = record - // This first variable is used to pick up errors where - // a DSA is passed instead of of a EVP_PKEY - pad : TIdC_INT; - version : TIdC_LONG; - write_params : TIdC_INT; - p : PBIGNUM; - q : PBIGNUM; // == 20 - g : PBIGNUM; - pub_key : PBIGNUM; // y public key - priv_key : PBIGNUM; // x private key - kinv : BIGNUM; // Signing pre-calc - r : PBIGNUM; // Signing pre-calc - flags : TIdC_INT; - // Normally used to cache montgomery values - method_mont_p : PBN_MONT_CTX; - references : TIdC_INT; - ex_data : CRYPTO_EX_DATA; - meth : PDSA_METHOD; - // functional reference if 'meth' is ENGINE-provided - engine : PENGINE; - end; - {$EXTERNALSYM DSA} - DSA = dsa_st; - {$EXTERNALSYM Pdsa_st} - Pdsa_st = PDSA; - {$EXTERNALSYM PPDSA} - PPDSA = ^PDSA; - {$ENDIF} - // ec.h - {$IFNDEF OPENSSL_NO_EC} - // EC_METHOD = record - //The fields are internal to OpenSSL, they are not listed in the header. - // end; - {$EXTERNALSYM PEC_METHOD} - PEC_METHOD = Pointer;//^EC_METHOD; - {$EXTERNALSYM PPEC_METHOD} - PPEC_METHOD = ^PEC_METHOD; - // EC_GROUP = record - //The fields are internal to OpenSSL, they are not listed in the header. -// end; - {$EXTERNALSYM PEC_GROUP} - PEC_GROUP = Pointer;//^EC_GROUP; - {$EXTERNALSYM PPEC_GROUP} - PPEC_GROUP = ^PEC_GROUP; -// EC_POINT = record - //The fields are internal to OpenSSL, they are not listed in the header. -// end; - {$EXTERNALSYM PEC_POINT} - PEC_POINT = Pointer;//^EC_POINT; - {$EXTERNALSYM PPEC_POINT} - PPEC_POINT = ^PEC_POINT; - {$EXTERNALSYM EC_builtin_curve} - EC_builtin_curve = record - nid : TIdC_INT; - comment : PIdAnsiChar; - end; - {$EXTERNALSYM Pec_key_st} - Pec_key_st = Pointer; - {$EXTERNALSYM PEC_KEY} - PEC_KEY = Pec_key_st;//^EC_KEY; -// EC_KEY = record - //The fields are internal to OpenSSL, they are not listed in the header. -// end; - - {$EXTERNALSYM PPEC_KEY} - PPEC_KEY = ^PEC_KEY; - {$ENDIF} - //evp.h -// EVP_PBE_KEYGEN = record -// end; - {$EXTERNALSYM PEVP_PKEY_METHOD} - PEVP_PKEY_METHOD = pointer; //This is not defined publically in OpenSSL 1.0.0 - {$EXTERNALSYM PEVP_PKEY_CTX} - PEVP_PKEY_CTX = pointer; //This is not defined publically in OpenSSL 1.0.0 - {$EXTERNALSYM PPEVP_PKEY_CTX} - PPEVP_PKEY_CTX = ^PEVP_PKEY_CTX; - {$EXTERNALSYM PEVP_PKEY_ASN1_METHOD} - PEVP_PKEY_ASN1_METHOD = pointer; - {$EXTERNALSYM PEVP_PBE_KEYGEN} - PEVP_PBE_KEYGEN = Pointer;//^EVP_PBE_KEYGEN; - //evp.h - //struct evp_pkey_st - {$EXTERNALSYM PPEVP_PKEY} - PPEVP_PKEY = ^PEVP_PKEY; - {$EXTERNALSYM PEVP_PKEY} - PEVP_PKEY = ^EVP_PKEY; - {$EXTERNALSYM EVP_PKEY_union} - EVP_PKEY_union = record - case byte of - 0: (ptr : PIdAnsiChar); - - {$IFNDEF OPENSSL_NO_RSA} - 1: (rsa : PRSA); // RSA - {$ENDIF} - {$IFNDEF OPENSSL_NO_DSA} - 2: (dsa : PDSA); // DSA - {$ENDIF} - {$IFNDEF OPENSSL_NO_DH} - 3: (dh :PDH); // DH - {$ENDIF} - {$IFNDEF OPENSSL_NO_EC} - 4: (ec : PEC_KEY); // ECC - {$ENDIF} - end; - {$EXTERNALSYM Pevp_pkey_st} - Pevp_pkey_st = PEVP_PKEY; - //this was moved from x509 section so that something here can compile. - {$IFDEF DEBUG_SAFESTACK} - {$EXTERNALSYM STACK_OF_X509_ATTRIBUTE} - STACK_OF_X509_ATTRIBUTE = record - _stack: STACK; - end; - {$EXTERNALSYM PSTACK_OF_X509_ATTRIBUTE} - PSTACK_OF_X509_ATTRIBUTE = ^STACK_OF_X509_ATTRIBUTE; - {$ELSE} - //I think the DECLARE_STACK_OF macro is empty - {$EXTERNALSYM PSTACK_OF_X509_ATTRIBUTE} - PSTACK_OF_X509_ATTRIBUTE = PSTACK; - {$ENDIF} - {$EXTERNALSYM PPSTACK_OF_X509_ATTRIBUTE} - PPSTACK_OF_X509_ATTRIBUTE = ^PSTACK_OF_X509_ATTRIBUTE; - {$EXTERNALSYM EVP_PKEY} - EVP_PKEY = record - _type : TIdC_INT; - save_type : TIdC_INT; - references : TIdC_INT; - ameth : PEVP_PKEY_ASN1_METHOD; - pkey : EVP_PKEY_union; - attributes : PSTACK_OF_X509_ATTRIBUTE; // [ 0 ] - end; - {$EXTERNALSYM PEVP_MD} - PEVP_MD = ^EVP_MD; - {$EXTERNALSYM PEVP_MD_CTX} - PEVP_MD_CTX = ^EVP_MD_CTX; - {$EXTERNALSYM PPEVP_MD_CTX} - PPEVP_MD_CTX = ^PEVP_MD_CTX; - {$EXTERNALSYM EVP_MD_CTX} - EVP_MD_CTX = record - digest : PEVP_MD; - engine : PENGINE; // functional reference if 'digest' is ENGINE-provided - flags : TIdC_ULONG; - md_data : Pointer; - //* Public key context for sign/verify */ - pctx : PEVP_PKEY_CTX; - //* Update function: usually copied from EVP_MD */ -// int (*update)(EVP_MD_CTX *ctx,const void *data,size_t count); - update : function (ctx : PEVP_MD_CTX; const data : Pointer; count : size_t) : TIdC_INT cdecl; - end; - {$EXTERNALSYM EVP_MD_SVCTX} - EVP_MD_SVCTX = record - mctx : PEVP_MD_CTX; - key : Pointer; - end; - {$EXTERNALSYM PEVP_MD_SVCTX} - PEVP_MD_SVCTX = ^EVP_MD_SVCTX; - {$EXTERNALSYM EVP_MD} - EVP_MD = record - _type : TIdC_INT; - pkey_type : TIdC_INT; - md_size : TIdC_INT; - flags : TIdC_ULONG; - init : function (ctx : PEVP_MD_CTX) : TIdC_INT; cdecl; - update : function (ctx : PEVP_MD_CTX; data : Pointer; count : size_t):TIdC_INT; cdecl; - _final : function (ctx : PEVP_MD_CTX; md : PIdAnsiChar) : TIdC_INT; cdecl; - copy : function (_to : PEVP_MD_CTX; from : PEVP_MD_CTX ) : TIdC_INT; cdecl; - cleanup : function(ctx : PEVP_MD_CTX) : TIdC_INT; cdecl; - // FIXME: prototype these some day - sign : function(_type : TIdC_INT; m : PIdAnsiChar; m_length : TIdC_UINT; - sigret : PIdAnsiChar; siglen : TIdC_UINT; key : Pointer) : TIdC_INT; cdecl; - verify : function(_type : TIdC_INT; m : PIdAnsiChar; m_length : PIdAnsiChar; - sigbuf : PIdAnsiChar; siglen : TIdC_UINT; key : Pointer) : TIdC_INT; cdecl; - required_pkey_type : array [0..4] of TIdC_INT; // EVP_PKEY_xxx - block_size : TIdC_INT; - ctx_size : TIdC_INT; // how big does the ctx->md_data need to be - end; - {$EXTERNALSYM PPEVP_CIPHER_CTX} - PPEVP_CIPHER_CTX = ^PEVP_CIPHER_CTX; - {$EXTERNALSYM PEVP_CIPHER_CTX} - PEVP_CIPHER_CTX = ^EVP_CIPHER_CTX; - {$EXTERNALSYM PEVP_CIPHER} - PEVP_CIPHER = ^EVP_CIPHER; - {$EXTERNALSYM EVP_CIPHER} - EVP_CIPHER = record - nid : TIdC_INT; - block_size : TIdC_INT; - key_len : TIdC_INT; // Default value for variable length ciphers - iv_len : TIdC_INT; - flags : TIdC_UINT; // Various flags - init : function (ctx : PEVP_CIPHER_CTX; key : PIdAnsiChar; iv : PIdAnsiChar; enc : TIdC_INT): TIdC_INT; cdecl; - do_cipher : function (ctx : PEVP_CIPHER_CTX; _out : PIdAnsiChar; _in : PIdAnsiChar; inl : size_t) : TIdC_INT; cdecl; - cleanup : function (_para1 : PEVP_CIPHER_CTX): TIdC_INT; cdecl; // cleanup ctx - ctx_size : TIdC_INT; // how big ctx->cipher_data needs to be - set_asn1_parameters : function (_para1 : PEVP_CIPHER_CTX; - _para2 : PASN1_TYPE) : TIdC_INT; cdecl; // Populate a ASN1_TYPE with parameters - get_asn1_parameters :function (_para1 : PEVP_CIPHER_CTX; - _para2 : PASN1_TYPE) : TIdC_INT; cdecl; // Get parameters from a ASN1_TYPE - ctrl : function (_para1 : PEVP_CIPHER_CTX; _type : TIdC_INT; arg : TIdC_INT; - ptr : Pointer): TIdC_INT; cdecl; // Miscellaneous operations - app_data : Pointer; // Application data - end; - {$EXTERNALSYM EVP_CIPHER_CTX} - EVP_CIPHER_CTX = record - cipher : PEVP_CIPHER; - engine : PENGINE; // functional reference if 'cipher' is ENGINE-provided - encrypt: TIdC_INT; // encrypt or decrypt - buf_len : TIdC_INT; // number we have left - oiv : array [0..EVP_MAX_IV_LENGTH-1] of TIdAnsiChar; // original iv - iv : array [0..EVP_MAX_IV_LENGTH -1] of TIdAnsiChar; // working iv - buf : array [0..EVP_MAX_BLOCK_LENGTH -1] of TIdAnsiChar; // saved partial block - num : TIdC_INT; // used by cfb/ofb mode - app_data : Pointer; // application stuff - key_len : TIdC_INT; // May change for variable length cipher - flags : TIdC_ULONG; // Various flags - cipher_data : Pointer; // per EVP data - final_used : TIdC_INT; - block_mask : TIdC_INT; - _final : array [0..EVP_MAX_BLOCK_LENGTH-1] of TIdAnsiChar; // possible final block - end; - {$EXTERNALSYM EVP_CIPHER_INFO} - EVP_CIPHER_INFO = record - cipher : PEVP_CIPHER; - iv : array [0..EVP_MAX_IV_LENGTH -1] of TIdAnsiChar; - end; - {$EXTERNALSYM PEVP_CIPHER_INFO} - PEVP_CIPHER_INFO = ^EVP_CIPHER_INFO; - {$EXTERNALSYM EVP_ENCODE_CTX} - EVP_ENCODE_CTX = record - num : TIdC_INT; // number saved in a partial encode/decode - length: TIdC_INT; // The length is either the output line length - // (in input bytes) or the shortest input line - // length that is ok. Once decoding begins, - // the length is adjusted up each time a longer - // line is decoded - enc_data:array [0..79] of TIdAnsiChar; - line_num: TIdC_INT; // number read on current line - expect_nl: TIdC_INT; - end; - {$EXTERNALSYM PEVP_ENCODE_CTX} - PEVP_ENCODE_CTX = ^EVP_ENCODE_CTX; - //forward declarations from x509.h to make sure this compiles. - {$NODEFINE PX509} - PX509 = ^X509; - {$EXTERNALSYM PPX509} - PPX509 = ^PX509; - {$EXTERNALSYM PX509_CRL} - PX509_CRL = ^X509_CRL; - {$NODEFINE PX509_NAME} - PX509_NAME = ^X509_NAME; - {$EXTERNALSYM PX509_NAME_ENTRY} - PX509_NAME_ENTRY = ^X509_NAME_ENTRY; - {$EXTERNALSYM PX509_REQ} - PX509_REQ = ^X509_REQ; - {$EXTERNALSYM PX509_REQ_INFO} - PX509_REQ_INFO = ^X509_REQ_INFO; - {$EXTERNALSYM PPX509_REQ_INFO} - PPX509_REQ_INFO = ^PX509_REQ_INFO; - {$IFDEF DEBUG_SAFESTACK} - {$EXTERNALSYM STACK_OF_X509_NAME_ENTRY} - STACK_OF_X509_NAME_ENTRY = record - _stack: stack; - end; - {$EXTERNALSYM PSTACK_OF_X509_NAME_ENTRY} - PSTACK_OF_X509_NAME_ENTRY = ^STACK_OF_X509_NAME_ENTRY; - {$EXTERNALSYM STACK_OF_X509_REVOKED} - STACK_OF_X509_REVOKED = record - _stack: stack; - end; - {$EXTERNALSYM PSTACK_OF_X509_REVOKED} - PSTACK_OF_X509_REVOKED = ^STACK_OF_X509_REVOKED; - {$EXTERNALSYM STACK_OF_X509_NAME} - STACK_OF_X509_NAME = record - _stack: STACK; - end; - {$EXTERNALSYM PSTACK_OF_X509_NAME} - PSTACK_OF_X509_NAME = ^STACK_OF_X509_NAME; - {$ELSE} - {$EXTERNALSYM PSTACK_OF_X509_NAME_ENTRY} - PSTACK_OF_X509_NAME_ENTRY = PSTACK; - {$EXTERNALSYM PSTACK_OF_X509_REVOKED} - PSTACK_OF_X509_REVOKED = PSTACK; - {$EXTERNALSYM PSTACK_OF_X509_NAME} - PSTACK_OF_X509_NAME = PSTACK; - {$ENDIF} - {$EXTERNALSYM PPSTACK_OF_X509_REVOKED} - PPSTACK_OF_X509_REVOKED = ^PSTACK_OF_X509_REVOKED; - {$EXTERNALSYM PPX509_NAME} - PPX509_NAME =^PX509_NAME; - {$EXTERNALSYM PPSTACK_OF_X509_NAME} - PPSTACK_OF_X509_NAME = ^PSTACK_OF_X509_NAME; - //pcy_int.h - //Note that anything other than PSTACK should be undefined since the record - //members aren't exposed in the headers. - {$IFDEF DEBUG_SAFESTACK} - {$EXTERNALSYM STACK_OF_X509_POLICY_DATA} - STACK_OF_X509_POLICY_DATA = record - _stack: stack; - end; - {$EXTERNALSYM PSTACK_OF_X509_POLICY_DATA} - PSTACK_OF_X509_POLICY_DATA = ^STACK_OF_X509_POLICY_DATA; - {$EXTERNALSYM STACK_OF_X509_POLICY_REF} - STACK_OF_X509_POLICY_REF = record - _stack: stack; - end; - {$EXTERNALSYM PSTACK_OF_X509_POLICY_REF} - PSTACK_OF_X509_POLICY_REF = ^STACK_OF_X509_POLICY_DATA; - {$EXTERNALSYM STACK_OF_X509_POLICY_NODE} - STACK_OF_X509_POLICY_NODE = record - _stack: stack; - end; - {$EXTERNALSYM PSTACK_OF_X509_POLICY_NODE} - PSTACK_OF_X509_POLICY_NODE = ^STACK_OF_X509_POLICY_NODE; - {$EXTERNALSYM STACK_OF_POLICYQUALINFO} - STACK_OF_POLICYQUALINFO = record - _stack: stack; - end; - {$EXTERNALSYM PSTACK_OF_POLICYQUALINFO} - PSTACK_OF_POLICYQUALINFO = ^STACK_OF_POLICYQUALINFO; - {$ELSE} - //I think the DECLARE_STACK_OF macro is empty - {$EXTERNALSYM PSTACK_OF_X509_POLICY_DATA} - PSTACK_OF_X509_POLICY_DATA = PSTACK; - {$EXTERNALSYM PSTACK_OF_X509_POLICY_REF} - PSTACK_OF_X509_POLICY_REF = PSTACK; - {$EXTERNALSYM PSTACK_OF_X509_POLICY_NODE} - PSTACK_OF_X509_POLICY_NODE = PSTACK; - {$EXTERNALSYM PSTACK_OF_POLICYQUALINFO} - PSTACK_OF_POLICYQUALINFO = PSTACK; - {$ENDIF} - {$IFDEF DEBUG_SAFESTACK} - {$EXTERNALSYM STACK_OF_X509V3_EXT_METHOD} - STACK_OF_X509V3_EXT_METHOD = record - _stack: stack; - end; - {$EXTERNALSYM PSTACK_OF_X509V3_EXT_METHOD} - PSTACK_OF_X509V3_EXT_METHOD = ^STACK_OF_X509V3_EXT_METHOD; - {$ELSE} - //I think the DECLARE_STACK_OF macro is empty - {$EXTERNALSYM PSTACK_OF_X509V3_EXT_METHOD} - PSTACK_OF_X509V3_EXT_METHOD = PSTACK; - {$ENDIF} - {$EXTERNALSYM PPSTACK_OF_X509V3_EXT_METHOD} - PPSTACK_OF_X509V3_EXT_METHOD = ^PSTACK_OF_X509V3_EXT_METHOD; - {$IFDEF DEBUF_SAFESTACK} - {$EXTERNALSYM STACK_OF_X509} - STACK_OF_X509 = record - _stack: STACK; - end; - {$EXTERNALSYM PSTACK_OF_X509} - PSTACK_OF_X509 = ^STACK_OF_X509; - {$ELSE} - //I think the DECLARE_STACK_OF macro is empty - {$EXTERNALSYM PSTACK_OF_X509} - PSTACK_OF_X509 = PSTACK; - {$ENDIF} - {$EXTERNALSYM PPSTACK_OF_X509} - PPSTACK_OF_X509 = ^PSTACK_OF_X509; - //fips.h - //engiene.h - {$IFNDEF OPENSSL_NO_ENGINE} - //* Generic function pointer */ -//typedef int (*ENGINE_GEN_FUNC_PTR)(void); - {$EXTERNALSYM ENGINE_GEN_FUNC_PTR} - ENGINE_GEN_FUNC_PTR = function : TIdC_INT; cdecl; -// typedef int (*ENGINE_GEN_INT_FUNC_PTR)(ENGINE *); - {$EXTERNALSYM ENGINE_GEN_INT_FUNC_PTR} - ENGINE_GEN_INT_FUNC_PTR = function(Para1 : PENGINE) : TIdC_INT; cdecl; -//typedef int (*ENGINE_CTRL_FUNC_PTR)(ENGINE *, int, long, void *, void (*f)(void)); - {$EXTERNALSYM ENGINE_CTRL_FUNC_PTR_F} - ENGINE_CTRL_FUNC_PTR_F = procedure; cdecl; - {$EXTERNALSYM ENGINE_CTRL_FUNC_PTR} - ENGINE_CTRL_FUNC_PTR = function(Para1 : PENGINE; Para2 : TIdC_INT; - Para3 : TIdC_LONG; Para4 : Pointer; f : ENGINE_CTRL_FUNC_PTR_F) : TIdC_Int; cdecl; -//typedef EVP_PKEY * (*ENGINE_LOAD_KEY_PTR)(ENGINE *, const char *, -// UI_METHOD *ui_method, void *callback_data); - {$EXTERNALSYM ENGINE_LOAD_KEY_PTR} - ENGINE_LOAD_KEY_PTR = function(Para1 : PENGINE; Para2 : PIdAnsiChar; - ui_method : PUI_METHOD; callback_data : Pointer) : PEVP_PKEY; cdecl; -//typedef int (*ENGINE_SSL_CLIENT_CERT_PTR)(ENGINE *, SSL *ssl, -// STACK_OF(X509_NAME) *ca_dn, X509 **pcert, EVP_PKEY **pkey, -// STACK_OF(X509) **pother, UI_METHOD *ui_method, void *callback_data); - {$EXTERNALSYM ENGINE_SSL_CLIENT_CERT_PTR} - ENGINE_SSL_CLIENT_CERT_PTR = function(Para1 : PENGINE; ssl : PSSL; - ca_dn : PSTACK_OF_X509_NAME; var pcert : PX509; var pkey : PEVP_PKEY; - var pother : PSTACK_OF_X509; ui_method : PUI_METHOD; callback_data : Pointer) : TIdC_Int; cdecl; -//typedef int (*ENGINE_CIPHERS_PTR)(ENGINE *, const EVP_CIPHER **, const int **, int); - {$EXTERNALSYM ENGINE_CIPHERS_PTR} - ENGINE_CIPHERS_PTR = function(para1 : PENGINE; var para2 : PEVP_CIPHER; var para3 : PIdC_Int; para4 : TIdC_Int) : TIdC_Int; cdecl; -//typedef int (*ENGINE_DIGESTS_PTR)(ENGINE *, const EVP_MD **, const int **, int); - {$EXTERNALSYM ENGINE_DIGESTS_PTR} - ENGINE_DIGESTS_PTR = function(para1 : PENGINE; var Para2 : PEVP_MD; var Para3 : PIdC_INT; para4 : TIdC_INT) : TIdC_INT cdecl; -//typedef int (*ENGINE_PKEY_METHS_PTR)(ENGINE *, EVP_PKEY_METHOD **, const int **, int); - {$EXTERNALSYM ENGINE_PKEY_METHS_PTR} - ENGINE_PKEY_METHS_PTR = function(para1 : PENGINE; var Para2 : PEVP_PKEY_METHOD; var Para3 : PIdC_INT; para4 : TIdC_INT) : TIdC_INT cdecl; -//typedef int (*ENGINE_PKEY_ASN1_METHS_PTR)(ENGINE *, EVP_PKEY_ASN1_METHOD **, const int **, int); - {$EXTERNALSYM ENGINE_PKEY_ASN1_METHS_PTR} - ENGINE_PKEY_ASN1_METHS_PTR = function(para1 : PENGINE; var Para2 : PEVP_PKEY_ASN1_METHOD; var Para3 : PIdC_INT; para4 : TIdC_INT) : TIdC_INT cdecl; -{ -/* When compiling an ENGINE entirely as an external shared library, loadable by - * the "dynamic" ENGINE, these types are needed. The 'dynamic_fns' structure - * type provides the calling application's (or library's) error functionality - * and memory management function pointers to the loaded library. These should - * be used/set in the loaded library code so that the loading application's - * 'state' will be used/changed in all operations. The 'static_state' pointer - * allows the loaded library to know if it shares the same static data as the - * calling application (or library), and thus whether these callbacks need to be - * set or not. */ -} -//typedef void *(*dyn_MEM_malloc_cb)(size_t); - {$EXTERNALSYM dyn_MEM_malloc_cb} - dyn_MEM_malloc_cb = function(para1 : size_t) : Pointer; cdecl; -//typedef void *(*dyn_MEM_realloc_cb)(void *, size_t); - {$EXTERNALSYM dyn_MEM_realloc_cb} - dyn_MEM_realloc_cb = function (para1 : Pointer; para2 : size_t): Pointer; cdecl; -//typedef void (*dyn_MEM_free_cb)(void *); - {$EXTERNALSYM dyn_MEM_free_cb} - dyn_MEM_free_cb = procedure (para1 : Pointer); cdecl; - {$EXTERNALSYM dynamic_MEM_fns} - dynamic_MEM_fns = record - malloc_cb : dyn_MEM_malloc_cb; - realloc_cb : dyn_MEM_realloc_cb; - free_cb : dyn_MEM_free_cb; - end; -///* FIXME: Perhaps the memory and locking code (crypto.h) should declare and use -// * these types so we (and any other dependant code) can simplify a bit?? */ -//typedef void (*dyn_lock_locking_cb)(int,int,const char *,int); - {$EXTERNALSYM dyn_lock_locking_cb} - dyn_lock_locking_cb = procedure (para1, para2 : TIdC_INT; para3 : PIdAnsiChar; para4 : TIdC_INT); cdecl; -//typedef int (*dyn_lock_add_lock_cb)(int*,int,int,const char *,int); - {$EXTERNALSYM dyn_lock_add_lock_cb} - dyn_lock_add_lock_cb = function (var para1 : TIdC_INT; para2, para3 : TIdC_INT; para4 : PIdAnsiChar; para5 : TIdC_INT) : TIdC_INT; cdecl; -//typedef struct CRYPTO_dynlock_value *(*dyn_dynlock_create_cb)( -// const char *,int); - {$EXTERNALSYM dyn_dynlock_create_cb} - dyn_dynlock_create_cb = function (para1 : PIdAnsiChar; para2 : TIdC_INT) : PCRYPTO_dynlock_value; cdecl; -//typedef void (*dyn_dynlock_lock_cb)(int,struct CRYPTO_dynlock_value *, -// const char *,int); - {$EXTERNALSYM dyn_dynlock_lock_cb} - dyn_dynlock_lock_cb = procedure (para1 : TIdC_INT; para2 : PCRYPTO_dynlock_value); cdecl; -//typedef void (*dyn_dynlock_destroy_cb)(struct CRYPTO_dynlock_value *, -// const char *,int); - {$EXTERNALSYM dyn_dynlock_destroy_cb} - dyn_dynlock_destroy_cb = procedure(para1 : PCRYPTO_dynlock_value; para2 : PIdAnsiChar; para3 : TIdC_INT); cdecl; -//typedef struct st_dynamic_LOCK_fns { -// dyn_lock_locking_cb lock_locking_cb; -// dyn_lock_add_lock_cb lock_add_lock_cb; -// dyn_dynlock_create_cb dynlock_create_cb; -// dyn_dynlock_lock_cb dynlock_lock_cb; -// dyn_dynlock_destroy_cb dynlock_destroy_cb; -// } dynamic_LOCK_fns; - {$EXTERNALSYM dynamic_LOCK_fns} - dynamic_LOCK_fns = record - lock_locking_cb : dyn_lock_locking_cb; - lock_add_lock_cb : dyn_lock_add_lock_cb; - dynlock_create_cb : dyn_dynlock_create_cb; - dynlock_lock_cb : dyn_dynlock_lock_cb; - dynlock_destroy_cb : dyn_dynlock_destroy_cb; - end; -//* The top-level structure */ - {$EXTERNALSYM dynamic_fns} - dynamic_fns = record - static_state : Pointer; - err_fns : PERR_FNS; - ex_data_fns : PCRYPTO_EX_DATA_IMPL; - mem_fns : dynamic_MEM_fns; - lock_fns : dynamic_LOCK_fns; - end; -// typedef unsigned long (*dynamic_v_check_fn)(unsigned long ossl_version); - {$EXTERNALSYM dynamic_v_check_fn} - dynamic_v_check_fn = function(ossl_version : TIdC_ULONG) : TIdC_ULONG; cdecl; -//typedef int (*dynamic_bind_engine)(ENGINE *e, const char *id, -// const dynamic_fns *fns); - {$EXTERNALSYM dynamic_bind_engine} - dynamic_bind_engine = function(e : PENGINE; id : PIdAnsiChar; fns : dynamic_fns) : TIdC_INT; cdecl; - {$ENDIF} - //ecdsa.h - {$IFNDEF OPENSSL_NO_ECDSA} - {$EXTERNALSYM ECDSA_SIG} - ECDSA_SIG = record - r : PBIGNUM; - s : PBIGNUM; - end; - {$EXTERNALSYM PECDSA_SIG} - PECDSA_SIG = ^ECDSA_SIG; - {$EXTERNALSYM PPECDSA_SIG} - PPECDSA_SIG = ^PECDSA_SIG; -// ECDH_METHOD = record - //defined interally, not through the header so use function to access members - // end; - {$EXTERNALSYM PECDH_METHOD} - PECDH_METHOD = Pointer;//^ECDH_METHOD; - {$EXTERNALSYM PPECDH_METHOD} - PPECDH_METHOD = ^PECDH_METHOD; - {$ENDIF} - //ecdh.h - //aes.h - {$IFNDEF OPENSSL_NO_AES} - {$IFDEF OPENSSL_FIPS} - {$EXTERNALSYM FIPS_AES_SIZE_T} - FIPS_AES_SIZE_T = TIdC_INT; - {$ENDIF} - //OpenSSL Developer's note - // This should be a hidden type, but EVP requires that the size be known - {$EXTERNALSYM AES_KEY} - AES_KEY = record - rd_key: array[0..(4 *(AES_MAXNR + 1)-1)] of TIdC_UINT; - rounds : TIdC_INT; - end; - {$EXTERNALSYM PAES_KEY} - PAES_KEY = ^AES_KEY; - {$EXTERNALSYM PPAES_KEY} - PPAES_KEY = ^PAES_KEY; - {$ENDIF} - //seed.h - {$IFNDEF OPENSSL_NO_SEED} - {$EXTERNALSYM SEED_KEY_SCHEDULE} - SEED_KEY_SCHEDULE = record - {$IFDEF SEED_LONG} - data : array [0..(32 -1)] of TIdC_ULONG ; - {$ELSE} - data : array[0..(32-1)] of TIdC_UINT; - {$ENDIF} - end; - {$EXTERNALSYM PSEED_KEY_SCHEDULE} - PSEED_KEY_SCHEDULE = ^SEED_KEY_SCHEDULE; - {$ENDIF} - //lhash.h - {$EXTERNALSYM PLHASH_NODE} - PLHASH_NODE = ^LHASH_NODE; - {$EXTERNALSYM PPLHASH_NODE} - PPLHASH_NODE = ^PLHASH_NODE; - {$EXTERNALSYM LHASH_NODE} - LHASH_NODE = record - data : Pointer; - next : PLHASH_NODE; - {$IFNDEF OPENSSL_NO_HASH_COMP} - hash : TIdC_ULONG; - {$ENDIF} - end; - {$EXTERNALSYM LHASH_COMP_FN_TYPE} - LHASH_COMP_FN_TYPE = function (const p1,p2 : Pointer) : TIdC_INT; cdecl; - {$EXTERNALSYM PLHASH_COMP_FN_TYPE} - PLHASH_COMP_FN_TYPE = ^LHASH_COMP_FN_TYPE; - {$EXTERNALSYM LHASH_HASH_FN_TYPE} - LHASH_HASH_FN_TYPE = function(const p1 : Pointer) : TIdC_ULONG; cdecl; - {$EXTERNALSYM LHASH_DOALL_FN_TYPE} - LHASH_DOALL_FN_TYPE = procedure(p1 : Pointer); cdecl; - {$EXTERNALSYM LHASH_DOALL_ARG_FN_TYPE} - LHASH_DOALL_ARG_FN_TYPE = procedure(p1, p2 : Pointer); cdecl; - {$EXTERNALSYM LHASH} - LHASH = record - b : PPLHASH_NODE; - comp : LHASH_COMP_FN_TYPE; - hash : LHASH_HASH_FN_TYPE; - num_nodes : TIdC_UINT; - num_alloc_nodes : TIdC_UINT; - p : TIdC_UINT; - pmax : TIdC_UINT; - up_load : TIdC_ULONG; // load times 256 - down_load : TIdC_ULONG; // load times 256 - num_items : TIdC_ULONG; - num_expands : TIdC_ULONG; - num_expand_reallocs : TIdC_ULONG; - num_contracts : TIdC_ULONG; - num_contract_reallocs : TIdC_ULONG; - num_hash_calls : TIdC_ULONG; - num_comp_calls : TIdC_ULONG; - num_insert : TIdC_ULONG; - num_replace : TIdC_ULONG; - num_delete : TIdC_ULONG; - num_no_delete : TIdC_ULONG; - num_retrieve : TIdC_ULONG; - num_retrieve_miss : TIdC_ULONG; - num_hash_comps : TIdC_ULONG; - error : TIdC_INT; - end; - {$EXTERNALSYM PLHASH} - PLHASH = ^LHASH; - //conf.h - {$EXTERNALSYM CONF_VALUE} - CONF_VALUE = record - section : PIdAnsiChar; - name : PIdAnsiChar; - value : PIdAnsiChar; - end; - {$EXTERNALSYM PCONF_VALUE} - PCONF_VALUE = ^CONF_VALUE; - {$IFDEF DEBUG_SAFESTACK} - {$EXTERNALSYM STACK_OF_CONF_VALUE} - STACK_OF_CONF_VALUE = record - stack: stack; - end; - {$EXTERNALSYM PSTACK_OF_CONF_VALUE} - PSTACK_OF_CONF_VALUE = ^STACK_OF_CONF_VALUE; - {$ELSE} - //I think the DECLARE_STACK_OF macro is empty - {$EXTERNALSYM PSTACK_OF_CONF_VALUE} - PSTACK_OF_CONF_VALUE = PSTACK; - {$ENDIF} - {$EXTERNALSYM BIT_STRING_BITNAME} - //* This is used to contain a list of bit names */ - BIT_STRING_BITNAME = record - bitnum : TIdC_INT; - lname : PIdAnsiChar; - sname : PIdAnsiChar; - end; - {$EXTERNALSYM PBIT_STRING_BITNAME} - PBIT_STRING_BITNAME = ^BIT_STRING_BITNAME; - {$EXTERNALSYM PPBIT_STRING_BITNAME} - PPBIT_STRING_BITNAME = ^PBIT_STRING_BITNAME; - {$EXTERNALSYM buf_mem_st} - buf_mem_st = record - length : TIdC_INT; // current number of bytes - data : PIdAnsiChar; - max: TIdC_INT; // size of buffer - end; - {$EXTERNALSYM BUF_MEM} - BUF_MEM = buf_mem_st; - {$EXTERNALSYM PBUF_MEM} - PBUF_MEM = ^BUF_MEM; - {$EXTERNALSYM PPBUF_MEM} - PPBUF_MEM = ^PBUF_MEM; - {$EXTERNALSYM PFILE} - PFILE = Pointer; - //asn1t.h - {$EXTERNALSYM ASN1_TEMPLATE} - ASN1_TEMPLATE = record - flags : TIdC_ULONG; // Various flags - tag : TIdC_LONG; // tag, not used if no tagging - offset : TIdC_ULONG; // Offset of this field in structure - {$IFNDEF NO_ASN1_FIELD_NAMES} - field_name : PIdAnsiChar; // Field name - {$ENDIF} - item : PASN1_ITEM_EXP; // Relevant ASN1_ITEM or ASN1_ADB - end; - {$EXTERNALSYM PASN1_TEMPLATE} - PASN1_TEMPLATE = ^ASN1_TEMPLATE; - {$EXTERNALSYM ASN1_ITEM} - ASN1_ITEM = record - itype : Char; // The item type, primitive, SEQUENCE, CHOICE or extern - utype : TIdC_LONG; // underlying type - templates : PASN1_TEMPLATE; // If SEQUENCE or CHOICE this contains the contents - tcount : TIdC_LONG; // Number of templates if SEQUENCE or CHOICE - funcs : Pointer; // functions that handle this type - size : TIdC_LONG; // Structure size (usually) - {$IFNDEF NO_ASN1_FIELD_NAMES} - sname : PIdAnsiChar; // Structure name - {$ENDIF} - end; - {$EXTERNALSYM PASN1_PCTX} - PASN1_PCTX = Pointer; - {$IFDEF DEBUG_SAFESTACK} - {$EXTERNALSYM STACK_OF_ASN1_ADB_TABLE} - STACK_OF_ASN1_ADB_TABLE = record - stack: stack; - end; - {$EXTERNALSYM PSTACK_OF_ASN1_ADB_TABLE} - PSTACK_OF_ASN1_ADB_TABLE = ^STACK_OF_ASN1_ADB_TABLE; - {$ELSE} - //I think the DECLARE_STACK_OF macro is empty - {$EXTERNALSYM PSTACK_OF_ASN1_ADB_TABLE} - PSTACK_OF_ASN1_ADB_TABLE = PSTACK; - {$ENDIF} - {$EXTERNALSYM PPSTACK_OF_ASN1_ADB_TABLE} - PPSTACK_OF_ASN1_ADB_TABLE = ^PSTACK_OF_ASN1_ADB_TABLE; - {$EXTERNALSYM PASN1_ADB_TABLE} - PASN1_ADB_TABLE = ^ASN1_ADB_TABLE; - {$EXTERNALSYM PASN1_ADB} - PASN1_ADB = ^ASN1_ADB; - {$EXTERNALSYM ASN1_ADB} - ASN1_ADB = record - flags : TIdC_ULONG; // Various flags - offset : TIdC_ULONG; // Offset of selector field - app_items : PPSTACK_OF_ASN1_ADB_TABLE; // Application defined items - tbl : PASN1_ADB_TABLE; // Table of possible types - tblcount : TIdC_LONG; // Number of entries in tbl - default_tt : PASN1_TEMPLATE; // Type to use if no match - null_tt : PASN1_TEMPLATE; // Type to use if selector is NULL - end; - {$EXTERNALSYM ASN1_ADB_TABLE} - ASN1_ADB_TABLE = record - flags : TIdC_LONG; // Various flags - offset : TIdC_LONG; // Offset of selector field - app_items : PPSTACK_OF_ASN1_ADB_TABLE; // Application defined items - tbl : PASN1_ADB_TABLE; // Table of possible types - tblcount : TIdC_LONG; // Number of entries in tbl - default_tt : PASN1_TEMPLATE; // Type to use if no match - null_tt : PASN1_TEMPLATE; // Type to use if selector is NULL - end; - {$EXTERNALSYM PASN1_TLC} - PASN1_TLC = ^ASN1_TLC; - {$EXTERNALSYM ASN1_TLC} - ASN1_TLC = record - valid : Byte; //* Values below are valid */ - ret : TIdC_INT; //* return value */ - plen : TIdC_LONG; //* length */ - ptag : TIdC_INT; //* class value */ - pclass : TIdC_INT; //* class value */ - hdrlen : TIdC_INT; //* header length */ - end; - ///* Typedefs for ASN1 function pointers */ - {$EXTERNALSYM ASN1_new_func} - ASN1_new_func = function : PASN1_VALUE; cdecl; - {$EXTERNALSYM ASN1_free_func} - ASN1_free_func = procedure (a : PASN1_VALUE); cdecl; -// typedef ASN1_VALUE * ASN1_d2i_func(ASN1_VALUE **a, const unsigned char ** in, long length); - {$EXTERNALSYM ASN1_d2i_func} - ASN1_d2i_func = function (a : PASN1_VALUE; _in : PPByte; length : TIdC_LONG ) : PASN1_VALUE; cdecl; - // typedef int ASN1_i2d_func(ASN1_VALUE * a, unsigned char **in); - {$EXTERNALSYM ASN1_i2d_func} - ASN1_i2d_func = function (a : PASN1_VALUE; _in : PPByte) : TIdC_INT; cdecl; -// typedef int ASN1_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len, const ASN1_ITEM *it, -// int tag, int aclass, char opt, ASN1_TLC *ctx); - {$EXTERNALSYM ASN1_ex_d2i} - ASN1_ex_d2i = function(pval : PPASN1_VALUE; _in : PPByte; len : TIdC_LONG; - it : PASN1_ITEM; tag, aclass : TIdC_INT; opt : Byte; - ctx : PASN1_TLC) : TIdC_INT; cdecl; -//typedef int ASN1_ex_i2d(ASN1_VALUE **pval, unsigned char **out, const ASN1_ITEM *it, int tag, int aclass); - {$EXTERNALSYM ASN1_ex_i2d} - ASN1_ex_i2d = function(pval : PPASN1_VALUE; _out : PPByte; it : PASN1_ITEM; tag, aclass : TIdC_INT) : TIdC_INT; cdecl; -//typedef int ASN1_ex_new_func(ASN1_VALUE **pval, const ASN1_ITEM *it); - {$EXTERNALSYM ASN1_ex_new_func} - ASN1_ex_new_func = function(pval : PPASN1_VALUE; it : PASN1_ITEM) : TIdC_INT; cdecl; -//typedef void ASN1_ex_free_func(ASN1_VALUE **pval, const ASN1_ITEM *it); - {$EXTERNALSYM ASN1_ex_free_func} - ASN1_ex_free_func = procedure( pval : PPASN1_VALUE; it : PASN1_ITEM); cdecl; -//typedef int ASN1_primitive_i2c(ASN1_VALUE **pval, unsigned char *cont, int *putype, const ASN1_ITEM *it); - {$EXTERNALSYM ASN1_primitive_i2c} - ASN1_primitive_i2c = function (pval : PPASN1_VALUE; cont : PByte; putype : PIdC_INT; it : PASN1_ITEM ) : TIdC_INT; cdecl; -//typedef int ASN1_primitive_c2i(ASN1_VALUE **pval, const unsigned char *cont, int len, int utype, char *free_cont, const ASN1_ITEM *it); - {$EXTERNALSYM ASN1_primitive_c2i} - ASN1_primitive_c2i = function (pval : PPASN1_VALUE; cont : PByte; len, utype : TIdC_INT; free_cont : PByte; it: PASN1_ITEM) : TIdC_INT; cdecl; - ///* end typedefs - {$EXTERNALSYM ASN1_COMPAT_FUNCS} - ASN1_COMPAT_FUNCS = record - asn1_new : ASN1_new_func; - asn1_free : ASN1_free_func; - asn1_d2i : ASN1_d2i_func; - asn1_i2d : ASN1_i2d_func; - end; - {$EXTERNALSYM PASN1_COMPAT_FUNCS} - PASN1_COMPAT_FUNCS = ^ASN1_COMPAT_FUNCS; - {$EXTERNALSYM ASN1_EXTERN_FUNCS} - ASN1_EXTERN_FUNCS = record - app_data : Pointer; - asn1_ex_new : ASN1_ex_new_func; // ASN1_ex_new_func *asn1_ex_new; - asn1_ex_free : ASN1_ex_free_func; // ASN1_ex_free_func *asn1_ex_free; - asn1_ex_clear: ASN1_ex_free_func;// ASN1_ex_free_func *asn1_ex_clear; - asn1_ex_d2i : ASN1_ex_d2i;// ASN1_ex_d2i *asn1_ex_d2i; - asn1_ex_i2d : ASN1_ex_i2d; // ASN1_ex_i2d *asn1_ex_i2d; - end; - {$EXTERNALSYM PASN1_EXTERN_FUNCS} - PASN1_EXTERN_FUNCS = ^ASN1_EXTERN_FUNCS; - {$EXTERNALSYM ASN1_PRIMITIVE_FUNCS} - ASN1_PRIMITIVE_FUNCS = record - app_data : Pointer; - flags : TIdC_ULONG; -// ASN1_ex_new_func *prim_new; - prim_new : ASN1_ex_new_func; -// ASN1_ex_free_func *prim_free; - prim_free : ASN1_ex_free_func; -// ASN1_ex_free_func *prim_clear; - prim_clear : ASN1_ex_free_func; -// ASN1_primitive_c2i *prim_c2i; - prim_c2i : ASN1_primitive_c2i; -// ASN1_primitive_i2c *prim_i2c; - prim_i2c : ASN1_primitive_i2c; - end; - {$EXTERNALSYM PASN1_PRIMITIVE_FUNCS} - PASN1_PRIMITIVE_FUNCS = ^ASN1_PRIMITIVE_FUNCS; -//typedef int ASN1_aux_cb(int operation, ASN1_VALUE **in, const ASN1_ITEM *it); - {$EXTERNALSYM ASN1_aux_cb} - ASN1_aux_cb = function (operation : TIdC_INT; _in : PPASN1_VALUE; it : PASN1_ITEM) : TIdC_INT; cdecl; - {$EXTERNALSYM ASN1_AUX} - ASN1_AUX = record - app_data : Pointer; - flags : TIdC_INT; - ref_offset : TIdC_INT; //* Offset of reference value */ - ref_lock : TIdC_INT; //* Lock type to use */ - asn1_cb : ASN1_aux_cb; //ASN1_aux_cb *asn1_cb; - enc_offset : TIdC_INT; //* Offset of ASN1_ENCODING structure */ - end; - {$EXTERNALSYM PASN1_AUX} - PASN1_AUX = ^ASN1_AUX; - //hmac.h - //This has to come after the EVP definitions - {$IFNDEF OPENSSL_NO_HMAC} - {$EXTERNALSYM HMAC_CTX} - HMAC_CTX = record - md : PEVP_MD; - md_ctx : EVP_MD_CTX; - i_ctx : EVP_MD_CTX; - o_ctx : EVP_MD_CTX; - key_length : TIdC_UINT; - key : array[0..(HMAC_MAX_MD_CBLOCK - 1)] of byte; - end; - {$EXTERNALSYM PHMAC_CTX} - PHMAC_CTX = ^HMAC_CTX; - {$EXTERNALSYM PPHMAC_CTX} - PPHMAC_CTX = ^PHMAC_CTX; - {$ENDIF} - // X509_POLICY_DATA = record - // end; - {$EXTERNALSYM PX509_POLICY_DATA} - PX509_POLICY_DATA = Pointer;//^X509_POLICY_DATA; - // X509_POLICY_REF = record - // end; - {$EXTERNALSYM PX509_POLICY_REF} - PX509_POLICY_REF = Pointer;//^X509_POLICY_REF; - // X509_POLICY_CACHE = record - // end; - {$EXTERNALSYM PX509_POLICY_CACHE} - PX509_POLICY_CACHE = Pointer; //^X509_POLICY_CACHE; - //x509v3.h - {$EXTERNALSYM PPX509_NAME_ENTRY} - PPX509_NAME_ENTRY = ^PX509_NAME_ENTRY; - //forward declarations - {$EXTERNALSYM PV3_EXT_METHOD} - PV3_EXT_METHOD = ^V3_EXT_METHOD; - {$EXTERNALSYM PV3_EXT_CTX} - PV3_EXT_CTX = ^V3_EXT_CTX; - // - {$EXTERNALSYM X509V3_EXT_NEW} - X509V3_EXT_NEW = function: Pointer; cdecl; - {$EXTERNALSYM X509V3_EXT_FREE} - X509V3_EXT_FREE = procedure(_para1 : Pointer); cdecl; - {$EXTERNALSYM X509V3_EXT_D2I} - X509V3_EXT_D2I = function(_para1 : Pointer; const _para2 : PPIdAnsiChar; para3 : TIdC_LONG): Pointer; cdecl; - {$EXTERNALSYM X509V3_EXT_I2D} - X509V3_EXT_I2D = function (_para1 : Pointer; _para2 : PPIdAnsiChar) : TIdC_INT; cdecl; - {$EXTERNALSYM X509V3_EXT_I2V} - X509V3_EXT_I2V = function (method : PV3_EXT_METHOD; ext : Pointer; extlist : PSTACK_OF_CONF_VALUE) : PSTACK_OF_CONF_VALUE; cdecl; - {$EXTERNALSYM X509V3_EXT_V2I} - X509V3_EXT_V2I = function (method : Pv3_ext_method; ctx : PV3_EXT_CTX; values : PSTACK_OF_CONF_VALUE): Pointer; cdecl; - {$EXTERNALSYM X509V3_EXT_I2S} - X509V3_EXT_I2S = function (method : Pv3_ext_method; ext : Pointer) : PIdAnsiChar; cdecl; - {$EXTERNALSYM X509V3_EXT_S2I} - X509V3_EXT_S2I = function (method : Pv3_ext_method; ctx : Pv3_ext_ctx; const str : PIdAnsiChar): Pointer; cdecl; - {$EXTERNALSYM X509V3_EXT_I2R} - X509V3_EXT_I2R = function (method : Pv3_ext_method; ext : Pointer; _out : PBIO; indent : TIdC_INT) : TIdC_INT; cdecl; - {$EXTERNALSYM X509V3_EXT_R2I} - X509V3_EXT_R2I = function (method : Pv3_ext_method; ctx : Pv3_ext_ctx; const str : PIdAnsiChar): Pointer; cdecl; - {$EXTERNALSYM V3_EXT_METHOD} - V3_EXT_METHOD = record - ext_nid : TIdC_INT; - ext_flags : TIdC_INT; - // If this is set the following four fields are ignored - // I'm not sure what the ASN1_ITEM_EXP really is. The headers don't make it clear, JPM. - it : PASN1_ITEM_EXP; - // Old style ASN1 calls - ext_new : X509V3_EXT_NEW; - ext_free : X509V3_EXT_FREE; - d2i : X509V3_EXT_D2I; - i2d : X509V3_EXT_I2D; - // The following pair is used for string extensions - i2s : X509V3_EXT_I2S; - s2i : X509V3_EXT_S2I; - // The following pair is used for multi-valued extensions - i2v : X509V3_EXT_I2V; - v2i : X509V3_EXT_V2I; - // The following are used for raw extensions - i2r : X509V3_EXT_I2R; - r2i : X509V3_EXT_R2I; - usr_data : Pointer; // Any extension specific data - end; - {$EXTERNALSYM X509V3_EXT_METHOD} - X509V3_EXT_METHOD = V3_EXT_METHOD; - {$EXTERNALSYM X509V3_CONF_METHOD} - X509V3_CONF_METHOD = record - get_string : function(db : Pointer; section, value : PIdAnsiChar) : PIdAnsiChar; cdecl; - get_section : function(db : Pointer; section : PIdAnsiChar) : PSTACK_OF_CONF_VALUE; cdecl; - free_string : procedure(db : Pointer; _string : PIdAnsiChar); cdecl; - free_section : procedure (db : Pointer; section : PSTACK_OF_CONF_VALUE); - end; - {$EXTERNALSYM V3_EXT_CTX} - V3_EXT_CTX = record - flags : TIdC_INT; - issuer_cert : PX509; - subject_cert : PX509; - subject_req : PX509_REQ; - crl : PX509_CRL; - db_meth : X509V3_CONF_METHOD; - db : Pointer; - // OpenSSL developer's message from header - // Maybe more here - end; - {$EXTERNALSYM ENUMERATED_NAMES} - ENUMERATED_NAMES = BIT_STRING_BITNAME; - {$EXTERNALSYM BASIC_CONSTRAINTS} - BASIC_CONSTRAINTS = record - ca : TIdC_INT; - pathlen: PASN1_INTEGER; - end; - {$EXTERNALSYM PBASIC_CONSTRAINTS} - PBASIC_CONSTRAINTS = ^BASIC_CONSTRAINTS; - {$EXTERNALSYM PKEY_USAGE_PERIOD} - PKEY_USAGE_PERIOD = record - notBefore : ASN1_GENERALIZEDTIME; - notAfter : PASN1_GENERALIZEDTIME; - end; - {$EXTERNALSYM PPKEY_USAGE_PERIOD} - PPKEY_USAGE_PERIOD = ^PKEY_USAGE_PERIOD; - {$EXTERNALSYM OTHERNAME} - OTHERNAME = record - type_id : PASN1_OBJECT; - value : PASN1_TYPE; - end; - {$EXTERNALSYM POTHERNAME} - POTHERNAME = ^OTHERNAME; - {$EXTERNALSYM EDIPARTYNAME} - EDIPARTYNAME = record - nameAssigner : PASN1_STRING; - partyName : PASN1_STRING; - end; - {$EXTERNALSYM PEDIPARTYNAME} - PEDIPARTYNAME = ^EDIPARTYNAME; - {$EXTERNALSYM GENERAL_NAME_union} - GENERAL_NAME_union = record - case byte of - 0 : (ptr : PIdAnsiChar); - 1 : (otherName : POTHERNAME); // otherName - 2 : (rfc822Name : PASN1_IA5STRING); - 3 : (dNSName : PASN1_IA5STRING); - 4 : (x400Address : PASN1_TYPE); - 5 : (directoryName : PX509_NAME); - 6 : (ediPartyName : PEDIPARTYNAME); - 7 : (uniformResourceIdentifier : PASN1_IA5STRING); - 8 : (iPAddress : PASN1_OCTET_STRING); - 9 : (registeredID : PASN1_OBJECT); - // Old names - 10 : (ip : PASN1_OCTET_STRING); // iPAddress - 11 : (dirn : PX509_NAME); // dirn - 12 : (ia5 : PASN1_IA5STRING); // rfc822Name, dNSName, uniformResourceIdentifier - 13 : (rid : ASN1_OBJECT); // registeredID - 14 : (other : PASN1_TYPE); // x400Address - end; - {$EXTERNALSYM GENERAL_NAME} - GENERAL_NAME = record - _type : TIdC_INT; - d : GENERAL_NAME_union; - end; - {$EXTERNALSYM PGENERAL_NAME} - PGENERAL_NAME = ^GENERAL_NAME; - {$IFDEF DEBUG_SAFESTACK} - {$EXTERNALSYM STACK_OF_GENERAL_NAME} - STACK_OF_GENERAL_NAME = record - _stack: stack; - end; - {$EXTERNALSYM PSTACK_OF_GENERAL_NAME} - PSTACK_OF_GENERAL_NAME = ^STACK_OF_GENERAL_NAME; - {$ELSE} - //I think the DECLARE_STACK_OF macro is empty - {$EXTERNALSYM PSTACK_OF_GENERAL_NAME} - PSTACK_OF_GENERAL_NAME = PSTACK; - {$ENDIF} - {$EXTERNALSYM PGENERAL_NAMES} - PGENERAL_NAMES = PSTACK_OF_GENERAL_NAME; - {$EXTERNALSYM ACCESS_DESCRIPTION} - ACCESS_DESCRIPTION = record - method : PASN1_OBJECT; - location : PGENERAL_NAME; - end; - {$EXTERNALSYM PACCESS_DESCRIPTION} - PACCESS_DESCRIPTION = ^ACCESS_DESCRIPTION; - {$IFDEF DEBUG_SAFESTACK} - {$EXTERNALSYM STACK_OF_ACCESS_DESCRIPTION} - STACK_OF_ACCESS_DESCRIPTION = record - _stack: stack; - end; - {$EXTERNALSYM PSTACK_OF_ACCESS_DESCRIPTION} - PSTACK_OF_ACCESS_DESCRIPTION = ^STACK_OF_ACCESS_DESCRIPTION; - {$ELSE} - //I think the DECLARE_STACK_OF macro is empty - {$EXTERNALSYM PSTACK_OF_ACCESS_DESCRIPTION} - PSTACK_OF_ACCESS_DESCRIPTION = PSTACK; - {$ENDIF} - {$EXTERNALSYM PAUTHORITY_INFO_ACCESS} - PAUTHORITY_INFO_ACCESS = PSTACK_OF_ACCESS_DESCRIPTION; - {$EXTERNALSYM PEXTENDED_KEY_USAGE} - PEXTENDED_KEY_USAGE = PSTACK_OF_ASN1_OBJECT; - {$EXTERNALSYM DIST_POINT_NAME_union} - DIST_POINT_NAME_union = record - case byte of - 0 : (fullname : PGENERAL_NAMES); - 1 : (relativename : PSTACK_OF_X509_NAME_ENTRY); - end; - {$EXTERNALSYM DIST_POINT_NAME} - DIST_POINT_NAME = record - _type : TIdC_INT; - name : DIST_POINT_NAME_union; - end; - {$EXTERNALSYM PDIST_POINT_NAME} - PDIST_POINT_NAME = ^DIST_POINT_NAME; - {$EXTERNALSYM DIST_POINT} - DIST_POINT = record - distpoint : PDIST_POINT_NAME; - reasons : PASN1_BIT_STRING; - CRLissuer : PGENERAL_NAMES; - dp_reasons : TIdC_INT; - end; - {$IFDEF DEBUG_SAFESTACK} - {$EXTERNALSYM STACK_OF_DIST_POINT} - STACK_OF_DIST_POINT = record - _stack: stack; - end; - {$EXTERNALSYM PSTACK_OF_DIST_POINT} - PSTACK_OF_DIST_POINT = ^STACK_OF_DIST_POINT; - {$ELSE} - //I think the DECLARE_STACK_OF macro is empty - {$EXTERNALSYM PSTACK_OF_DIST_POINT} - PSTACK_OF_DIST_POINT = PSTACK; - {$ENDIF} - {$EXTERNALSYM AUTHORITY_KEYID} - AUTHORITY_KEYID = record - keyid : PASN1_OCTET_STRING; - issuer : PGENERAL_NAMES; - serial : PASN1_INTEGER; - end; - {$EXTERNALSYM PAUTHORITY_KEYID} - PAUTHORITY_KEYID = ^AUTHORITY_KEYID; - // Strong extranet structures - {$EXTERNALSYM SXNETID} - SXNETID = record - zone : PASN1_INTEGER; - user : PASN1_OCTET_STRING; - end; - {$EXTERNALSYM PSXNETID} - PSXNETID = ^SXNETID; - {$IFDEF DEBUG_SAFESTACK} - {$EXTERNALSYM STACK_OF_SXNETID} - STACK_OF_SXNETID = record - _stack: stack; - end; - {$EXTERNALSYM PSTACK_OF_SXNETID} - PSTACK_OF_SXNETID = ^STACK_OF_SXNETID; - {$ELSE} - //I think the DECLARE_STACK_OF macro is empty - {$EXTERNALSYM PSTACK_OF_SXNETID} - PSTACK_OF_SXNETID = PSTACK; - {$ENDIF} - {$EXTERNALSYM SXNET} - SXNET = record - version : PASN1_INTEGER; - ids : PSTACK_OF_SXNETID; - end; - {$EXTERNALSYM PSXNET} - PSXNET = ^SXNET; - {$EXTERNALSYM NOTICEREF} - NOTICEREF = record - organization : PASN1_STRING; - noticenos : PSTACK_OF_ASN1_INTEGER; - end; - {$EXTERNALSYM PNOTICEREF} - PNOTICEREF = ^NOTICEREF; - {$EXTERNALSYM USERNOTICE} - USERNOTICE = record - noticeref : PNOTICEREF; - exptext : PASN1_STRING; - end; - {$EXTERNALSYM PUSERNOTICE} - PUSERNOTICE = ^USERNOTICE; - {$EXTERNALSYM POLICYQUALINFO_union} - POLICYQUALINFO_union = record - case byte of - 0 : (cpsuri : PASN1_IA5STRING); - 1 : (usernotice : PUSERNOTICE); - 2 : (other : PASN1_TYPE); - end; - {$EXTERNALSYM POLICYQUALINFO} - POLICYQUALINFO = record - pqualid : PASN1_OBJECT; - d : POLICYQUALINFO_union; - end; - {$EXTERNALSYM PPOLICYQUALINFO} - PPOLICYQUALINFO = ^POLICYQUALINFO; - {$IFDEF DEBUG_SAFESTACK} - {$EXTERNALSYM STACK_OF_POLICYINFO} - STACK_OF_POLICYINFO = record - _stack: stack; - end; - {$EXTERNALSYM PSTACK_OF_POLICYINFO} - PSTACK_OF_POLICYINFO = ^STACK_OF_POLICYINFO; - {$ELSE} - {$EXTERNALSYM PSTACK_OF_POLICYINFO} - PSTACK_OF_POLICYINFO = PSTACK; - {$ENDIF} - {$EXTERNALSYM POLICYINFO} - POLICYINFO = record - policyid : PASN1_OBJECT; - qualifiers : PSTACK_OF_POLICYQUALINFO; - end; - {$EXTERNALSYM CERTIFICATEPOLICIES} - CERTIFICATEPOLICIES = PSTACK_OF_POLICYINFO; - //typedef STACK_OF(POLICYINFO) CERTIFICATEPOLICIES; - {$EXTERNALSYM POLICY_MAPPING} - POLICY_MAPPING = record - issuerDomainPolicy : PASN1_OBJECT; - subjectDomainPolicy : PASN1_OBJECT; - end; - {$EXTERNALSYM PPOLICY_MAPPING} - PPOLICY_MAPPING = ^POLICY_MAPPING; - {$IFDEF DEBUG_SAFESTACK} - {$EXTERNALSYM STACK_OF_POLICY_MAPPING} - STACK_OF_POLICY_MAPPING = record - _stack: stack; - end; - {$EXTERNALSYM PSTACK_OF_POLICY_MAPPING} - PSTACK_OF_POLICY_MAPPING = ^STACK_OF_POLICY_MAPPING; - {$ELSE} - //I think the DECLARE_STACK_OF macro is empty - {$EXTERNALSYM PSTACK_OF_POLICY_MAPPING} - PSTACK_OF_POLICY_MAPPING = PSTACK; - {$ENDIF} - {$EXTERNALSYM PPSTACK_OF_POLICY_MAPPING} - PPSTACK_OF_POLICY_MAPPING = ^PSTACK_OF_POLICY_MAPPING; - {$EXTERNALSYM GENERAL_SUBTREE} - GENERAL_SUBTREE = record - base : PGENERAL_NAME; - minimum : PASN1_INTEGER; - maximum : PASN1_INTEGER; - end; - {$EXTERNALSYM PGENERAL_SUBTREE} - PGENERAL_SUBTREE = ^GENERAL_SUBTREE; - {$IFDEF DEBUG_SAFESTACK} - {$EXTERNALSYM STACK_OF_GENERAL_SUBTREE} - STACK_OF_GENERAL_SUBTREE = record - _stack: stack; - end; - {$EXTERNALSYM PSTACK_OF_GENERAL_SUBTREE} - PSTACK_OF_GENERAL_SUBTREE = ^STACK_OF_GENERAL_SUBTREE; - {$ELSE} - //I think the DECLARE_STACK_OF macro is empty - {$EXTERNALSYM PSTACK_OF_GENERAL_SUBTREE} - PSTACK_OF_GENERAL_SUBTREE = PSTACK; - {$ENDIF} - {$EXTERNALSYM NAME_CONSTRAINTS} - NAME_CONSTRAINTS = record - permittedSubtrees : PSTACK_OF_GENERAL_SUBTREE; - excludedSubtrees : PSTACK_OF_GENERAL_SUBTREE; - end; - {$EXTERNALSYM PNAME_CONSTRAINTS} - PNAME_CONSTRAINTS = ^NAME_CONSTRAINTS; - {$EXTERNALSYM POLICY_CONSTRAINTS} - POLICY_CONSTRAINTS = record - requireExplicitPolicy : PASN1_INTEGER; - inhibitPolicyMapping : ASN1_INTEGER; - end; - {$EXTERNALSYM PPOLICY_CONSTRAINTS} - PPOLICY_CONSTRAINTS = ^POLICY_CONSTRAINTS; - // Proxy certificate structures, see RFC 3820 - {$EXTERNALSYM PROXY_POLICY} - PROXY_POLICY = record - policyLanguage : PASN1_OBJECT; - policy : ASN1_OCTET_STRING; - end; - {$EXTERNALSYM PPROXY_POLICY} - PPROXY_POLICY = ^PROXY_POLICY; - {$EXTERNALSYM PROXY_CERT_INFO_EXTENSION} - PROXY_CERT_INFO_EXTENSION = record - pcPathLengthConstraint : PASN1_INTEGER; - proxyPolicy : PPROXY_POLICY; - end; - {$EXTERNALSYM ISSUING_DIST_POINT} - ISSUING_DIST_POINT = record - distpoint : PDIST_POINT_NAME; - onlyuser : TIdC_INT; - onlyCA : TIdC_INT; - onlysomereasons : PASN1_BIT_STRING; - indirectCRL : TIdC_INT; - onlyattr : TIdC_INT; - end; - {$IFDEF DEBUG_SAFESTACK} - //These are cut and paste but the duplication is for type checking. - {$EXTERNALSYM STACK_OF_CMS_SignerInfo} - STACK_OF_CMS_SignerInfo = record - _stack: stack; - end; - {$EXTERNALSYM STACK_OF_GENERAL_NAMES} - STACK_OF_GENERAL_NAMES = record - _stack: stack; - end; - {$EXTERNALSYM PSTACK_OF_CMS_SignerInfo} - PSTACK_OF_CMS_SignerInfo = ^STACK_OF_CMS_SignerInfo; - {$EXTERNALSYM PSTACK_OF_GENERAL_NAMES} - PSTACK_OF_GENERAL_NAMES = ^STACK_OF_GENERAL_NAMES; - {$ELSE} - //I think the DECLARE_STACK_OF macro is empty - {$EXTERNALSYM PSTACK_OF_CMS_SignerInfo} - PSTACK_OF_CMS_SignerInfo = PSTACK; - {$EXTERNALSYM PSTACK_OF_GENERAL_NAMES} - PSTACK_OF_GENERAL_NAMES = PSTACK; - {$ENDIF} - {.$ENDIF} - {$EXTERNALSYM PISSUING_DIST_POINT} - PISSUING_DIST_POINT = ^ISSUING_DIST_POINT; - {$EXTERNALSYM PPROXY_CERT_INFO_EXTENSION} - PPROXY_CERT_INFO_EXTENSION = ^PROXY_CERT_INFO_EXTENSION; - {$EXTERNALSYM PX509_PURPOSE} - PX509_PURPOSE = ^X509_PURPOSE; - {$EXTERNALSYM X509_PURPOSE_check_purpose} - X509_PURPOSE_check_purpose = function(const _para1 : Px509_purpose; const _para2 : PX509; - para3 : TIdC_INT) : TIdC_INT; cdecl; - {$EXTERNALSYM X509_PURPOSE} - X509_PURPOSE = record - purpose : TIdC_INT; - trust : TIdC_INT; // Default trust ID - flags : TIdC_INT; - check_purpose : X509_PURPOSE_check_purpose; - name : PIdAnsiChar; - sname : PIdAnsiChar; - usr_data : Pointer; - end; - {$IFDEF DEBUG_SAFESTACK} - {$EXTERNALSYM STACK_OF_X509_PURPOSE} - STACK_OF_X509_PURPOSE = record - _stack: stack; - end; - {$EXTERNALSYM PSTACK_OF_X509_PURPOSE} - PSTACK_OF_X509_PURPOSE = ^STACK_OF_X509_PURPOSE; - {$ELSE} - //I think the DECLARE_STACK_OF macro is empty - {$EXTERNALSYM PSTACK_OF_X509_PURPOSE} - PSTACK_OF_X509_PURPOSE = PSTACK; - {$ENDIF} - {$IFNDEF OPENSSL_NO_RFC3779} - {$EXTERNALSYM ASRange} - ASRange = record - min, max : PASN1_INTEGER; - end; - {$EXTERNALSYM PASRange} - PASRange = ^ASRange; - {$EXTERNALSYM ASIdOrRange_union} - ASIdOrRange_union = record - case byte of - ASIdOrRange_id : (id : PASN1_INTEGER); - ASIdOrRange_range : (range : PASRange); - end; - {$EXTERNALSYM ASIdOrRange} - ASIdOrRange = record - _type : TIdC_INT; - u : ASIdOrRange_union; - end; - {$EXTERNALSYM PASIdOrRange} - PASIdOrRange = ^ASIdOrRange; - {$IFDEF DEBUG_SAFESTACK} - {$EXTERNALSYM STACK_OF_ASIdOrRange} - STACK_OF_ASIdOrRange = record - _stack: stack; - end; - {$EXTERNALSYM PSTACK_OF_ASIdOrRange} - PSTACK_OF_ASIdOrRange = ^STACK_OF_ASIdOrRange; - {$ELSE} - //I think the DECLARE_STACK_OF macro is empty - {$EXTERNALSYM PSTACK_OF_ASIdOrRange} - PSTACK_OF_ASIdOrRange = PSTACK; - {$ENDIF} - {$EXTERNALSYM PASIdOrRanges} - PASIdOrRanges = PSTACK_OF_ASIdOrRange; - {$EXTERNALSYM ASIdentifierChoice_union} - ASIdentifierChoice_union = record - case byte of - ASIdentifierChoice_inherit : (inherit : PASN1_NULL); - ASIdentifierChoice_asIdsOrRanges : (asIdsOrRanges : PASIdOrRanges); - end; - {$EXTERNALSYM ASIdentifierChoice} - ASIdentifierChoice = record - _type : TIdC_INT; - u : ASIdentifierChoice_union; - end; - {$EXTERNALSYM PASIdentifierChoice} - PASIdentifierChoice = ^ASIdentifierChoice; - {$EXTERNALSYM ASIdentifiers} - ASIdentifiers = record - asnum : PASIdentifierChoice; - rdi : PASIdentifierChoice; - end; - {$EXTERNALSYM PASIdentifiers} - PASIdentifiers = ^ASIdentifiers; - {$EXTERNALSYM IPAddressRange} - IPAddressRange = record - min, max : PASN1_BIT_STRING; - end; - {$EXTERNALSYM PIPAddressRange} - PIPAddressRange = ^IPAddressRange; - {$EXTERNALSYM IPAddressOrRange_union} - IPAddressOrRange_union = record - case byte of - IPAddressOrRange_addressPrefix : (addressPrefix : PASN1_BIT_STRING); - IPAddressOrRange_addressRange : (addressRange : PIPAddressRange); - end; - {$EXTERNALSYM IPAddressOrRange} - IPAddressOrRange = record - _type : TIdC_INT; - u : IPAddressOrRange_union; - end; - {$EXTERNALSYM PIPAddressOrRange} - PIPAddressOrRange = ^IPAddressOrRange; - {$IFDEF DEBUG_SAFESTACK} - {$EXTERNALSYM STACK_OF_IPAddressOrRange} - STACK_OF_IPAddressOrRange = record - _stack: stack; - end; - {$EXTERNALSYM PSTACK_OF_IPAddressOrRange} - PSTACK_OF_IPAddressOrRange = ^STACK_OF_IPAddressOrRange; - {$ELSE} - //I think the DECLARE_STACK_OF macro is empty - {$EXTERNALSYM PSTACK_OF_IPAddressOrRange} - PSTACK_OF_IPAddressOrRange = PSTACK; - {$ENDIF} - {$EXTERNALSYM PIPAddressOrRanges} - PIPAddressOrRanges = PSTACK_OF_IPAddressOrRange; - {$EXTERNALSYM IPAddressChoice_union} - IPAddressChoice_union = record - case byte of - IPAddressChoice_inherit : (inherit : PASN1_NULL); - IPAddressChoice_addressesOrRanges : (addressesOrRanges : PIPAddressOrRanges); - end; - {$EXTERNALSYM IPAddressChoice} - IPAddressChoice = record - _type : TIdC_INT; - u : IPAddressChoice_union; - end; - {$EXTERNALSYM PIPAddressChoice} - PIPAddressChoice = ^IPAddressChoice; - {$EXTERNALSYM IPAddressFamily} - IPAddressFamily = record - addressFamily : PASN1_OCTET_STRING; - ipAddressChoice : PIPAddressChoice; - end; - {$EXTERNALSYM PIPAddressFamily} - PIPAddressFamily = ^IPAddressFamily; - {$IFDEF DEBUG_SAFESTACK} - {$EXTERNALSYM STACK_OF_IPAddressFamily} - STACK_OF_IPAddressFamily = record - _stack: stack; - end; - {$EXTERNALSYM PSTACK_OF_IPAddressFamily} - PSTACK_OF_IPAddressFamily = ^STACK_OF_IPAddressFamily; - {$ELSE} - //I think the DECLARE_STACK_OF macro is empty - {$EXTERNALSYM PSTACK_OF_IPAddressFamily} - PSTACK_OF_IPAddressFamily = PSTACK; - {$ENDIF} - {$EXTERNALSYM PIPAddrBlocks} - PIPAddrBlocks = PSTACK_OF_IPAddressFamily; - {$ENDIF} - //x509.h - {$EXTERNALSYM X509_HASH_DIR_CTX} - X509_HASH_DIR_CTX = record - num_dirs : TIDC_INT; - dirs : PPIdAnsiChar; - dirs_type : PIdC_INT; - num_dirs_alloced : TIdC_INT; - end; - {$EXTERNALSYM PX509_HASH_DIR_CTX} - PX509_HASH_DIR_CTX = ^X509_HASH_DIR_CTX; - {$EXTERNALSYM X509_CERT_FILE_CTX} - X509_CERT_FILE_CTX = record - num_paths : TIdC_INT; // number of paths to files or directories - num_alloced : TIdC_INT; - paths : PPIdAnsiChar; // the list of paths or directories - path_type : TIdC_INT; - end; - {$EXTERNALSYM PX509_CERT_FILE_CTX} - PX509_CERT_FILE_CTX = ^X509_CERT_FILE_CTX; - {$EXTERNALSYM x509_object_union} - x509_object_union = record - case byte of - 0: (ptr : PIdAnsiChar); - 1: (_x509 : Px509); - 2: (crl : PX509_CRL); - 3: (pkey : PEVP_PKEY); - end; - {$EXTERNALSYM X509_OBJECT} - X509_OBJECT = record - _type : TIdC_INT; - data : x509_object_union; - end; - {$EXTERNALSYM PX509_OBJECT} - PX509_OBJECT = ^X509_OBJECT; - {$EXTERNALSYM PPX509_OBJECT} - PPX509_OBJECT = ^PX509_OBJECT; - {$IFDEF DEBUG_SAFESTACK} - {$EXTERNALSYM STACK_OF_X509_OBJECT} - STACK_OF_X509_OBJECT = record - _stack: STACK; - end; - {$EXTERNALSYM PSTACK_OF_X509_OBJECT} - PSTACK_OF_X509_OBJECT = ^STACK_OF_X509_OBJECT; - {$ELSE} - //I think the DECLARE_STACK_OF macro is empty - {$EXTERNALSYM PSTACK_OF_X509_OBJECT} - PSTACK_OF_X509_OBJECT = PSTACK; - {$ENDIF} - {$EXTERNALSYM X509_ALGOR} - X509_ALGOR = record - algorithm : PASN1_OBJECT; - parameter : PASN1_TYPE; - end; - {$EXTERNALSYM PX509_ALGOR} - PX509_ALGOR = ^X509_ALGOR; - {$EXTERNALSYM PPX509_ALGOR} - PPX509_ALGOR =^PX509_ALGOR; - {$IFDEF DEBUG_SAFESTACK} - {$EXTERNALSYM STACK_OF_X509_ALGOR} - STACK_OF_X509_ALGOR = record - _stack: stack; - end; - {$EXTERNALSYM PSTACK_OF_X509_ALGOR} - PSTACK_OF_X509_ALGOR = ^STACK_OF_X509_ALGOR; - {$ELSE} - //I think the DECLARE_STACK_OF macro is empty - {$EXTERNALSYM PSTACK_OF_X509_ALGOR} - PSTACK_OF_X509_ALGOR = PSTACK; - {$ENDIF} - {$EXTERNALSYM PPSTACK_OF_X509_ALGOR} - PPSTACK_OF_X509_ALGOR = ^PSTACK_OF_X509_ALGOR; - {$EXTERNALSYM X509_VAL} - X509_VAL = record - notBefore : PASN1_TIME; - notAfter : PASN1_TIME; - end; - {$EXTERNALSYM PX509_VAL} - PX509_VAL = ^X509_VAL; - {$EXTERNALSYM PPX509_VAL} - PPX509_VAL =^PX509_VAL; - {$EXTERNALSYM X509_PUBKEY} - X509_PUBKEY = record - algor : PX509_ALGOR; - public_key : PASN1_BIT_STRING; - pkey : PEVP_PKEY; - end; - {$EXTERNALSYM PX509_PUBKEY} - PX509_PUBKEY = ^X509_PUBKEY; - {$EXTERNALSYM PPX509_PUBKEY} - PPX509_PUBKEY =^PX509_PUBKEY; - {$EXTERNALSYM X509_SIG} - X509_SIG = record - algor : PX509_ALGOR; - digest : PASN1_OCTET_STRING; - end; - {$EXTERNALSYM PX509_SIG} - PX509_SIG = X509_SIG; - {$EXTERNALSYM PPX509_SIG} - PPX509_SIG =^PX509_SIG; - {$EXTERNALSYM X509_NAME_ENTRY} - X509_NAME_ENTRY = record - _object : PASN1_OBJECT; - value : PASN1_STRING; - _set : TIdC_INT; - size : TIdC_INT; // temp variable - end; - {$NODEFINE X509_NAME} - X509_NAME = record - entries : PSTACK_OF_X509_NAME_ENTRY; - modified : TIdC_INT; // true if 'bytes' needs to be built - {$IFNDEF OPENSSL_NO_BUFFER} - bytes : PBUF_MEM; - {$else} - bytes : PIdAnsiChar; - {$ENDIF} - //* unsigned long hash; Keep the hash around for lookups */ - canon_enc : PIdAnsiChar; - canon_enclen : TIdC_INT; - end; - {$EXTERNALSYM X509_EXTENSION} - X509_EXTENSION = record - _object : PASN1_OBJECT; - critical : ASN1_BOOLEAN; - value : PASN1_OCTET_STRING; - end; - {$EXTERNALSYM PX509_EXTENSION} - PX509_EXTENSION = ^X509_EXTENSION; - {$EXTERNALSYM PPX509_EXTENSION} - PPX509_EXTENSION =^PX509_EXTENSION; - {$IFDEF DEBUG_SAFESTACK} - {$EXTERNALSYM STACK_OF_X509_EXTENSION} - STACK_OF_X509_EXTENSION = record - _stack: stack; - end; - {$EXTERNALSYM X509_EXTENSIONS} - X509_EXTENSIONS = STACK_OF_X509_EXTENSION; - {$EXTERNALSYM PSTACK_OF_X509_EXTENSION} - PSTACK_OF_X509_EXTENSION = ^STACK_OF_X509_EXTENSION; - {$ELSE} - //I think the DECLARE_STACK_OF macro is empty - {$EXTERNALSYM PSTACK_OF_X509_EXTENSION} - PSTACK_OF_X509_EXTENSION = PSTACK; - {$ENDIF} - {$EXTERNALSYM PPSTACK_OF_X509_EXTENSION} - PPSTACK_OF_X509_EXTENSION = ^PSTACK_OF_X509_EXTENSION; - {$EXTERNALSYM PX509_EXTENSIONS} - PX509_EXTENSIONS = PPSTACK_OF_X509_EXTENSION; - {$EXTERNALSYM x509_attributes_union} - x509_attributes_union = record - case Byte of - $FF :(Ptr : PIdAnsiChar); - 0 : (_set: PSTACK_OF_ASN1_TYPE); // 0 - 1 : (_single: PASN1_TYPE); - end; - {$EXTERNALSYM X509_ATTRIBUTE} - X509_ATTRIBUTE = record - _object : PASN1_OBJECT; - single : TIdC_INT; // 0 for a set, 1 for a single item (which is wrong) - value : x509_attributes_union; - end; - {$EXTERNALSYM PX509_ATTRIBUTE} - PX509_ATTRIBUTE = ^X509_ATTRIBUTE; - {$EXTERNALSYM PPX509_ATTRIBUTE} - PPX509_ATTRIBUTE =^PX509_ATTRIBUTE; - {$EXTERNALSYM X509_REQ_INFO} - X509_REQ_INFO = record - enc: ASN1_ENCODING; - version: PASN1_INTEGER; - subject: PX509_NAME; - pubkey: PX509_PUBKEY; - attributes: PSTACK_OF_X509_ATTRIBUTE; // [ 0 ] - end; - {$EXTERNALSYM X509_REQ} - X509_REQ = record - req_info: PX509_REQ_INFO; - sig_alg: PX509_ALGOR; - signature: PASN1_BIT_STRING; - references: TIdC_INT; - end; - {$EXTERNALSYM PPX509_REQ} - PPX509_REQ = ^PX509_REQ; - {$EXTERNALSYM PX509_CINF} - PX509_CINF = ^X509_CINF; - {$EXTERNALSYM X509_CINF} - X509_CINF = record - version: PASN1_INTEGER; - serialNumber: PASN1_INTEGER; - signature: PX509_ALGOR; - issuer: PX509_NAME; - validity: PX509_VAL; - subject: PX509_NAME; - key: PX509_PUBKEY; - issuerUID: PASN1_BIT_STRING; // [ 1 ] optional in v2 - subjectUID: PASN1_BIT_STRING; // [ 2 ] optional in v2 - extensions: PSTACK_OF_X509_EXTENSION; - enc : ASN1_ENCODING; - end; - {$EXTERNALSYM X509_CERT_AUX} - X509_CERT_AUX = record - trust : PSTACK_OF_ASN1_OBJECT; // trusted uses - reject : PSTACK_OF_ASN1_OBJECT; // rejected uses - alias : PASN1_UTF8STRING; // "friendly name" - keyid : PASN1_OCTET_STRING; // key id of private key - other : PSTACK_OF_X509_ALGOR; // other unspecified info - end; - {$EXTERNALSYM PX509_CERT_AUX} - PX509_CERT_AUX = ^X509_CERT_AUX; - {$NODEFINE X509} - X509 = record - cert_info: PX509_CINF; - sig_alg : PX509_ALGOR; - signature : PASN1_BIT_STRING; - valid : TIdC_INT; - references : TIdC_INT; - name : PIdAnsiChar; - ex_data : CRYPTO_EX_DATA; - // These contain copies of various extension values - ex_pathlen : TIdC_LONG; - ex_pcpathlen : TIdC_LONG; - ex_flags : TIdC_ULONG; - ex_kusage : TIdC_ULONG; - ex_xkusage : TIdC_ULONG; - ex_nscert : TIdC_ULONG; - skid : PASN1_OCTET_STRING; - akid : PAUTHORITY_KEYID; - policy_cache : PX509_POLICY_CACHE; - crldp : PSTACK_OF_DIST_POINT; - altname : PSTACK_OF_GENERAL_NAME; - nc : PNAME_CONSTRAINTS; - {$IFNDEF OPENSSL_NO_RFC3779} - rfc3779_addr : PSTACK_OF_IPAddressFamily; - rfc3779_asid : PASIdentifiers; - {$ENDIF} - {$IFNDEF OPENSSL_NO_SHA} - sha1_hash : array [0..SHA_DIGEST_LENGTH-1] of TIdAnsiChar; - {$ENDIF} - aux : PX509_CERT_AUX; - end; - {$EXTERNALSYM X509_CRL_INFO} - X509_CRL_INFO = record - version : PASN1_INTEGER; - sig_alg : PX509_ALGOR; - issuer : PX509_NAME; - lastUpdate : PASN1_TIME; - nextUpdate : PASN1_TIME; - revoked : PSTACK_OF_X509_REVOKED; - extensions : PSTACK_OF_X509_EXTENSION; // [0] - enc : ASN1_ENCODING; - end; - {$EXTERNALSYM PX509_CRL_INFO} - PX509_CRL_INFO = ^X509_CRL_INFO; - {$EXTERNALSYM PPX509_CRL_INFO} - PPX509_CRL_INFO =^PX509_CRL_INFO; - {$IFDEF DEBUG_SAFESTACK} - {$EXTERNALSYM STACK_OF_X509_CRL_INFO} - STACK_OF_X509_CRL_INFO = record - _stack: stack; - end; - {$EXTERNALSYM PSTACK_OF_X509_CRL_INFO} - PSTACK_OF_X509_CRL_INFO = ^STACK_OF_X509_CRL_INFO; - {$ELSE} - //I think the DECLARE_STACK_OF macro is empty - {$EXTERNALSYM PSTACK_OF_X509_CRL_INFO} - PSTACK_OF_X509_CRL_INFO = PSTACK; - {$ENDIF} - {$EXTERNALSYM PX509_LOOKUP} - PX509_LOOKUP = ^X509_LOOKUP; - //This has to be declared ehre for a reference in the next type. - {$IFDEF DEBUG_SAFESTACK} - {$EXTERNALSYM STACK_OF_X509_LOOKUP} - STACK_OF_X509_LOOKUP = record - _stack: STACK; - end; - {$EXTERNALSYM PSTACK_OF_X509_LOOKUP} - PSTACK_OF_X509_LOOKUP = ^STACK_OF_X509_LOOKUP; - {$ELSE} - //I think the DECLARE_STACK_OF macro is empty - {$EXTERNALSYM PSTACK_OF_X509_LOOKUP} - PSTACK_OF_X509_LOOKUP = PSTACK; - {$ENDIF} - - {$IFDEF DEBUG_SAFESTACK} - {$EXTERNALSYM STACK_OF_X509_CRL} - STACK_OF_X509_CRL = record - _stack: STACK; - end; - {$EXTERNALSYM PSTACK_OF_X509_CRL} - PSTACK_OF_X509_CRL = ^STACK_OF_X509_CRL; - {$ELSE} - //I think the DECLARE_STACK_OF macro is empty - {$EXTERNALSYM PSTACK_OF_X509_CRL} - PSTACK_OF_X509_CRL = PSTACK; - {$ENDIF} - {$EXTERNALSYM PX509_VERIFY_PARAM} - PX509_VERIFY_PARAM = ^X509_VERIFY_PARAM; - {$EXTERNALSYM PX509_STORE_CTX} - PX509_STORE_CTX = ^X509_STORE_CTX; - {$EXTERNALSYM PPX509_CRL} - PPX509_CRL = ^PX509_CRL; - {$EXTERNALSYM X509_STORE} - X509_STORE = record - // The following is a cache of trusted certs - cache : TIdC_INT; // if true, stash any hits - objs : PSTACK_OF_X509_OBJECT; // Cache of all objects - // These are external lookup methods - get_cert_methods : PSTACK_OF_X509_LOOKUP; - param : PX509_VERIFY_PARAM; - // Callbacks for various operations - verify : function (ctx : PX509_STORE_CTX) : TIdC_INT; cdecl; // called to verify a certificate - verify_cb : function (ok : TIdC_INT; ctx : PX509_STORE_CTX) : TIdC_INT; cdecl; // error callback - get_issuer : function (issuer : PPX509; ctx : PX509_STORE_CTX; x : PX509) : TIdC_INT; cdecl; // get issuers cert from ctx - check_issued : function (ctx : PX509_STORE_CTX; x : PX509; issuer : PX509) : TIdC_INT; cdecl; // check issued - check_revocation : function (ctx : PX509_STORE_CTX) : TIdC_INT; cdecl; // Check revocation status of chain - get_crl : function (ctx : PX509_STORE_CTX; crl : PPX509_CRL; x : PX509) : TIdC_INT; cdecl;// retrieve CRL - check_crl : function(ctx : PX509_STORE_CTX; crl : PX509_CRL) : TIdC_INT; cdecl; // Check CRL validity - cert_crl : function(ctx : PX509_STORE_CTX; crl : PX509_CRL; x : PX509) : TIdC_INT; cdecl; // Check certificate against CRL - lookup_certs : function(ctx : PX509_STORE_CTX; nm : PX509_NAME) : PSTACK_OF_X509 cdecl; - lookup_crls : function(ctx : PX509_STORE_CTX; nm : PX509_NAME) : PSTACK_OF_X509_CRL cdecl; - cleanup : function(ctx : PX509_STORE_CTX) : TIdC_INT; cdecl; - ex_data : CRYPTO_EX_DATA; - references : TIdC_INT; - end; - {$EXTERNALSYM PX509_STORE} - PX509_STORE = ^X509_STORE; - {$EXTERNALSYM PX509_CRL_METHOD} - PX509_CRL_METHOD = Pointer; - {$EXTERNALSYM X509_CRL} - X509_CRL = record - crl : PX509_CRL_INFO; - sig_alg : PX509_ALGOR; - signature : PASN1_BIT_STRING; - references : TIdC_INT; - flags : TIdC_INT; - //* Copies of various extensions */ - akid : PAUTHORITY_KEYID; - idp : PISSUING_DIST_POINT; - //* Convenient breakdown of IDP */ - idp_flags : TIdC_INT; - idp_reasons : TIdC_INT; - //* CRL and base CRL numbers for delta processing */ - crl_number : PASN1_INTEGER; - base_crl_number : PASN1_INTEGER; -{$ifndef OPENSSL_NO_SHA} - sha1_hash : array [0..(SHA_DIGEST_LENGTH - 1)] of byte; -{$endif} - issuers : PSTACK_OF_GENERAL_NAMES; - meth : PX509_CRL_METHOD; - meth_data : Pointer; - end; - {$EXTERNALSYM X509_LOOKUP_METHOD} - X509_LOOKUP_METHOD = record - name : PIdAnsiChar; - new_item : function (ctx : PX509_LOOKUP): TIdC_INT; cdecl; - free : procedure (ctx : PX509_LOOKUP); cdecl; - init : function(ctx : PX509_LOOKUP) : TIdC_INT; cdecl; - shutdown : function(ctx : PX509_LOOKUP) : TIdC_INT; cdecl; - ctrl: function(ctx : PX509_LOOKUP; cmd : TIdC_INT; const argc : PIdAnsiChar; argl : TIdC_LONG; out ret : PIdAnsiChar ) : TIdC_INT; cdecl; - get_by_subject: function(ctx : PX509_LOOKUP; _type : TIdC_INT; name : PX509_NAME; ret : PX509_OBJECT ) : TIdC_INT; cdecl; - get_by_issuer_serial : function(ctx : PX509_LOOKUP; _type : TIdC_INT; name : PX509_NAME; serial : PASN1_INTEGER; ret : PX509_OBJECT) : TIdC_INT; cdecl; - get_by_fingerprint : function (ctx : PX509_LOOKUP; _type : TIdC_INT; bytes : PIdAnsiChar; len : TIdC_INT; ret : PX509_OBJECT): TIdC_INT; cdecl; - get_by_alias : function(ctx : PX509_LOOKUP; _type : TIdC_INT; str : PIdAnsiChar; ret : PX509_OBJECT) : TIdC_INT; cdecl; - end; - {$EXTERNALSYM PX509_LOOKUP_METHOD} - PX509_LOOKUP_METHOD = ^X509_LOOKUP_METHOD; - {$EXTERNALSYM PPX509_LOOKUP_METHOD} - PPX509_LOOKUP_METHOD = ^PX509_LOOKUP_METHOD; - {$EXTERNALSYM X509_VERIFY_PARAM} - X509_VERIFY_PARAM = record - name : PIdAnsiChar; - check_time : time_t; // Time to use - inh_flags : TIdC_ULONG; // Inheritance flags - flags : TIdC_ULONG; // Various verify flags - purpose : TIdC_INT; // purpose to check untrusted certificates - trust : TIdC_INT; // trust setting to check - depth : TIdC_INT; // Verify depth - policies : PSTACK_OF_ASN1_OBJECT; // Permissible policies - end; - {$IFDEF DEBUG_SAFESTACK} - {$EXTERNALSYM STACK_OF_X509_VERIFY_PARAM} - STACK_OF_X509_VERIFY_PARAM = record - _stack: STACK; - end; - {$EXTERNALSYM PSTACK_OF_X509_VERIFY_PARAM} - PSTACK_OF_X509_VERIFY_PARAM = ^STACK_OF_X509_VERIFY_PARAM; - {$ELSE} - //I think the DECLARE_STACK_OF macro is empty - {$EXTERNALSYM PSTACK_OF_X509_VERIFY_PARAM} - PSTACK_OF_X509_VERIFY_PARAM = PSTACK; - {$ENDIF} - {$EXTERNALSYM X509_LOOKUP} - X509_LOOKUP = record - init : TIdC_INT; // have we been started - skip : TIdC_INT; // don't use us. - method : PX509_LOOKUP_METHOD; // the functions - method_data : PIdAnsiChar; // method data - store_ctx : PX509_STORE; // who owns us - end; - {$EXTERNALSYM PX509_POLICY_TREE} - PX509_POLICY_TREE = Pointer; - {$EXTERNALSYM PPSTACK_OF_X509_LOOKUP} - PPSTACK_OF_X509_LOOKUP = ^PSTACK_OF_X509_LOOKUP; - // This is used when verifying cert chains. Since the - // gathering of the cert chain can take some time (and have to be - // 'retried', this needs to be kept and passed around. - X509_STORE_CTX = record // X509_STORE_CTX - ctx : PX509_STORE; - current_method : TIdC_INT; // used when looking up certs - // The following are set by the caller - cert : PX509; // The cert to check - untrusted : PSTACK_OF_X509; // chain of X509s - untrusted - passed in - crls : PSTACK_OF_X509_CRL; // set of CRLs passed in - param : PX509_VERIFY_PARAM; - other_ctx : Pointer; // Other info for use with get_issuer() - // Callbacks for various operations - verify : function (ctx : PX509_STORE_CTX) : TIdC_INT; cdecl; // called to verify a certificate - verify_cb : function (ok : TIdC_INT; ctx : PX509_STORE_CTX) : TIdC_INT; cdecl; // error callback - get_issuer : function (var issuer : PX509; ctx : PX509_STORE_CTX; x : PX509) : TIdC_INT; cdecl; // get issuers cert from ctx - check_issued : function(ctx : PX509_STORE_CTX; x, issuer : PX509) : TIdC_INT; cdecl; // check issued - check_revocation : function (ctx : PX509_STORE_CTX): TIdC_INT; cdecl; // Check revocation status of chain - get_crl : function (ctx : PX509_STORE_CTX; var crl : X509_CRL; x : PX509): TIdC_INT; cdecl; // retrieve CRL - check_crl : function (ctx : PX509_STORE_CTX; var crl : X509_CRL) : TIdC_INT; cdecl; // Check CRL validity - cert_crl : function (ctx : PX509_STORE_CTX; crl : PX509_CRL; x : PX509) : TIdC_INT; cdecl; // Check certificate against CRL - check_policy : function (ctx : PX509_STORE_CTX) : TIdC_INT; cdecl; - cleanup : function (ctx : PX509_STORE_CTX) : TIdC_INT; cdecl; - //* The following is built up */ - valid : TIdC_INT; //* if 0, rebuild chain */ - last_untrusted : TIdC_INT; //* index of last untrusted cert */ - chain : PSTACK_OF_X509; //* chain of X509s - built up and trusted */ - tree : PX509_POLICY_TREE; //* Valid policy tree */ - - explicit_policy : TIdC_INT; //* Require explicit policy value */ - - //* When something goes wrong, this is why */ - error_depth : TIdC_INT; - error : TIdC_INT; - current_cert : PX509; - current_issuer : PX509; //* cert currently being tested as valid issuer */ - current_crl : PX509_CRL; //* current CRL */ - - current_crl_score : TIdC_INT; //* score of current CRL */ - current_reasons : TIdC_UINT; //* Reason mask */ - - parent : PX509_STORE_CTX; //* For CRL path validation: parent context */ - - ex_data : CRYPTO_EX_DATA; - end; - {$EXTERNALSYM X509_STORE_CTX} - - {$EXTERNALSYM PX509_EXTENSION_METHOD} - PX509_EXTENSION_METHOD = Pointer; - {$EXTERNALSYM PX509_TRUST} - PX509_TRUST = ^X509_TRUST; - {$EXTERNALSYM X509_TRUST_check_trust} - X509_TRUST_check_trust = function(_para1 : PX509_TRUST; para2 : PX509; _para3 : TIdC_INT) : TIdC_INT; cdecl; - {$EXTERNALSYM X509_TRUST} - X509_TRUST = record - trust : TIdC_INT; - flags : TIdC_INT; - check_trust : X509_TRUST_check_trust; - name : PIdAnsiChar; - arg1 : TIdC_INT; - arg2 : Pointer; - end; - {$EXTERNALSYM PPX509_TRUST} - PPX509_TRUST = ^PX509_TRUST; - {$IFDEF DEBUG_SAFESTACK} - {$EXTERNALSYM STACK_OF_509_TRUST} - STACK_OF_509_TRUST = record - _stack: stack; - end; - {$EXTERNALSYM PSTACK_OF_509_TRUST} - PSTACK_OF_509_TRUST = ^STACK_OF_509_TRUST; - {$ELSE} - //I think the DECLARE_STACK_OF macro is empty - {$EXTERNALSYM PSTACK_OF_509_TRUST} - PSTACK_OF_509_TRUST = PSTACK; - {$ENDIF} - {$EXTERNALSYM X509_REVOKED} - X509_REVOKED = record - serialNumber: PASN1_INTEGER; - revocationDate: PASN1_TIME; - extensions: PSTACK_OF_X509_EXTENSION; // optional - //* Set up if indirect CRL */ - issuer : PSTACK_OF_GENERAL_NAME; - //* Revocation reason */ - reason : TIdC_INT; - sequence: TIdC_INT; - end; - {$EXTERNALSYM PX509_REVOKED} - PX509_REVOKED = ^X509_REVOKED; - {$EXTERNALSYM PPX509_REVOKED} - PPX509_REVOKED =^PX509_REVOKED; - {$EXTERNALSYM PX509_PKEY} - PX509_PKEY = Pointer; - {$EXTERNALSYM PPX509_PKEY} - PPX509_PKEY =^PX509_PKEY; - {$EXTERNALSYM X509_INFO} - X509_INFO = record - x509 : PX509; - crl : PX509_CRL; - x_pkey : PX509_PKEY; - enc_cipher: EVP_CIPHER_INFO; - enc_len: TIdC_INT; - enc_data: PIdAnsiChar; - references: TIdC_INT; - end; - {$EXTERNALSYM PX509_INFO} - PX509_INFO = ^X509_INFO; - {$EXTERNALSYM PPX509_INFO} - PPX509_INFO =^PX509_INFO; - {$IFDEF DEBUG_SAFESTACK} - {$EXTERNALSYM STACK_OF_X509_INFO} - STACK_OF_X509_INFO = record - _stack: stack; - end; - {$EXTERNALSYM PSTACK_OF_X509_INFO} - PSTACK_OF_X509_INFO = ^STACK_OF_X509_INFO; - {$ELSE} - //I think the DECLARE_STACK_OF macro is empty - {$EXTERNALSYM PSTACK_OF_X509_INFO} - PSTACK_OF_X509_INFO = PSTACK; - {$ENDIF} -// OpenSSL Developer's note -// The next 2 structures and their 8 routines were sent to me by -// Pat Richard and are used to manipulate -// Netscapes spki structures - useful if you are writing a CA web page - {$EXTERNALSYM NETSCAPE_SPKAC} - NETSCAPE_SPKAC = record - pubkey : PX509_PUBKEY; - challenge : PASN1_IA5STRING; // challenge sent in atlas >= PR2 - end; - {$EXTERNALSYM PNETSCAPE_SPKAC} - PNETSCAPE_SPKAC = ^NETSCAPE_SPKAC; - {$EXTERNALSYM PPNETSCAPE_SPKAC} - PPNETSCAPE_SPKAC = ^PNETSCAPE_SPKAC; - {$EXTERNALSYM NETSCAPE_SPKI} - NETSCAPE_SPKI = record - spkac : PNETSCAPE_SPKAC; // signed public key and challenge - sig_algor : PX509_ALGOR; - signature : PASN1_BIT_STRING; - end; - {$EXTERNALSYM PNETSCAPE_SPKI} - PNETSCAPE_SPKI = ^NETSCAPE_SPKI; - {$EXTERNALSYM PPNETSCAPE_SPKI} - PPNETSCAPE_SPKI = ^PNETSCAPE_SPKI; - {$EXTERNALSYM NETSCAPE_CERT_SEQUENCE} - NETSCAPE_CERT_SEQUENCE = record - _type : PASN1_OBJECT; - certs : PSTACK_OF_X509; - end; - {$EXTERNALSYM PNETSCAPE_CERT_SEQUENCE} - PNETSCAPE_CERT_SEQUENCE = ^NETSCAPE_CERT_SEQUENCE; - {$EXTERNALSYM PPNETSCAPE_CERT_SEQUENCE} - PPNETSCAPE_CERT_SEQUENCE = ^PNETSCAPE_CERT_SEQUENCE; - // Password based encryption structure - {$EXTERNALSYM PBEPARAM} - PBEPARAM = record - salt : PASN1_OCTET_STRING; - iter : PASN1_INTEGER; - end; - {$EXTERNALSYM PPBEPARAM} - PPBEPARAM = ^PBEPARAM; - {$EXTERNALSYM PPPBEPARAM} - PPPBEPARAM = ^PPBEPARAM; - // Password based encryption V2 structures - {$EXTERNALSYM PBE2PARAM} - PBE2PARAM = record - keyfunc : PX509_ALGOR; - encryption : PX509_ALGOR; - end; - {$EXTERNALSYM PPBE2PARAM} - PPBE2PARAM = ^PBE2PARAM; - {$EXTERNALSYM PBKDF2PARAM} - PBKDF2PARAM = record - salt : PASN1_TYPE; // Usually OCTET STRING but could be anything - iter : PASN1_INTEGER; - keylength : PASN1_INTEGER; - prf : PX509_ALGOR; - end; - {$EXTERNALSYM PPBKDF2PARAM} - PPBKDF2PARAM = ^PBKDF2PARAM; - {$EXTERNALSYM PPPBKDF2PARAM} - PPPBKDF2PARAM = ^PPBKDF2PARAM; - {$EXTERNALSYM PKCS8_PRIV_KEY_INFO} - PKCS8_PRIV_KEY_INFO = record - broken : TIdC_INT; // Flag for various broken formats -//#define PKCS8_OK 0 -//#define PKCS8_NO_OCTET 1 -//#define PKCS8_EMBEDDED_PARAM 2 -//#define PKCS8_NS_DB 3 - version : PASN1_INTEGER; - pkeyalg : PX509_ALGOR; - pkey : PASN1_TYPE; // Should be OCTET STRING but some are broken - attributes : PSTACK_OF_X509_ATTRIBUTE; - end; - {$EXTERNALSYM PPKCS8_PRIV_KEY_INFO} - PPKCS8_PRIV_KEY_INFO = ^PKCS8_PRIV_KEY_INFO; - {$EXTERNALSYM PPPKCS8_PRIV_KEY_INFO} - PPPKCS8_PRIV_KEY_INFO = ^PPKCS8_PRIV_KEY_INFO; - {$EXTERNALSYM PPKCS7_RECIP_INFO} - PPKCS7_RECIP_INFO = ^PKCS7_RECIP_INFO; - {$EXTERNALSYM PSHA_CTX} - PSHA_CTX = ^SHA_CTX; - //cms.h - {$IFDEF OPENSSL_NO_CMS} - {$EXTERNALSYM PCMS_ContentInfo} - PCMS_ContentInfo = Pointer; - {$EXTERNALSYM PCMS_SignerInfo} - PCMS_SignerInfo = Pointer; - {$EXTERNALSYM PCMS_CertificateChoices} - PCMS_CertificateChoices = Pointer; - {$EXTERNALSYM PCMS_RevocationInfoChoice} - PCMS_RevocationInfoChoice = Pointer; - {$EXTERNALSYM PCMS_RecipientInfo} - PCMS_RecipientInfo = Pointer; - {$EXTERNALSYM PCMS_ReceiptRequest} - PCMS_ReceiptRequest = Pointer; - {$EXTERNALSYM PCMS_Receipt} - PCMS_Receipt = Pointer; - {$EXTERNALSYM PSTACK_OF_CMS_SignerInfo} - {$ENDIF} - //ripemd.h - {$IFNDEF OPENSSL_NO_RIPEMD} - {$EXTERNALSYM RIPEMD160_LONG} - RIPEMD160_LONG = TIdC_UINT; - {$EXTERNALSYM RIPEMD160_CTX} - RIPEMD160_CTX = record - A,B,C,D,E : RIPEMD160_LONG; - Nl,Nh : RIPEMD160_LONG; - data : array [0..RIPEMD160_LBLOCK -1 ] of RIPEMD160_LONG; - num : TIdC_UINT; - end; - {$EXTERNALSYM PRIPEMD160_CTX} - PRIPEMD160_CTX = ^RIPEMD160_CTX; - {$ENDIF} - {$IFNDEF OPENSSL_NO_RC4} - {$EXTERNALSYM RC4_KEY} - RC4_KEY = record - x,y : RC4_INT; - data : array [0..(256 - 1)] of RC4_INT; - end; - {$EXTERNALSYM PRC4_KEY} - PRC4_KEY = ^RC4_KEY; - {$ENDIF} - //rc2.h - {$IFNDEF OPENSSL_NO_RC2} - {$EXTERNALSYM RC2_KEY} - RC2_KEY = record - data : array [0..(64 - 1)] of RC2_INT; - end; - {$EXTERNALSYM PRC2_KEY} - PRC2_KEY = ^RC2_KEY; - {$ENDIF} - {$IFNDEF OPENSSL_NO_RC5} - {$EXTERNALSYM RC5_32_INT} - RC5_32_INT = TIdC_UINT; - {$EXTERNALSYM RC5_32_KEY} - RC5_32_KEY = record - // Number of rounds - rounds : TIdC_INT; - data : array [0..(2*(RC5_16_ROUNDS+1)-1)] of RC5_32_INT; - end; - {$EXTERNALSYM PRC5_32_KEY} - PRC5_32_KEY = ^RC5_32_KEY; - {$ENDIF} - //blowfish.h - {$IFNDEF OPENSSL_NO_BF} - {$EXTERNALSYM BF_LONG} - BF_LONG = TIdC_UINT; - {$EXTERNALSYM BF_KEY} - BF_KEY = record - P : array [0..(BF_ROUNDS+2)-1] of BF_LONG; - S : array [0..(4*256)-1] of BF_LONG; - end; - {$EXTERNALSYM PBF_KEY} - PBF_KEY = ^BF_KEY; - {$ENDIF} - {$IFNDEF OPENSSL_NO_CAST} - {$EXTERNALSYM CAST_LONG} - CAST_LONG = TIdC_ULONG; - {$EXTERNALSYM CAST_KEY} - CAST_KEY = record - data : array[0..(32 -1)] of CAST_LONG; - short_key : TIdC_INT; // Use reduced rounds for short key - end; - {$EXTERNALSYM PCAST_KEY} - PCAST_KEY = ^CAST_KEY; - {$ENDIF} - {$IFNDEF OPENSSL_NO_IDEA} - {$EXTERNALSYM IDEA_KEY_SCHEDULE} - IDEA_KEY_SCHEDULE = record - data : array [0..(9-1),0..(6-1)] of IDEA_INT; - end; - {$EXTERNALSYM PIDEA_KEY_SCHEDULE} - PIDEA_KEY_SCHEDULE = ^IDEA_KEY_SCHEDULE; - {$ENDIF} - //ocsp.h - //* CertID ::= SEQUENCE { - //* hashAlgorithm AlgorithmIdentifier, - //* issuerNameHash OCTET STRING, -- Hash of Issuer's DN - //* issuerKeyHash OCTET STRING, -- Hash of Issuers public key (excluding the tag & length fields) - //* serialNumber CertificateSerialNumber } - //*/ -//typedef struct ocsp_cert_id_st - {$EXTERNALSYM OCSP_CERTID} - OCSP_CERTID = record - hashAlgorithm : PX509_ALGOR; - issuerNameHash : PASN1_OCTET_STRING; - issuerKeyHash : PASN1_OCTET_STRING; - serialNumber : PASN1_INTEGER; - end; - {$EXTERNALSYM POCSP_CERTID} - POCSP_CERTID = ^OCSP_CERTID; - {$EXTERNALSYM PPOCSP_CERTID} - PPOCSP_CERTID = ^POCSP_CERTID; - {$IFDEF DEBUG_SAFESTACK} - {$EXTERNALSYM STACK_OF_OCSP_CERTID} - STACK_OF_OCSP_CERTID = record - _stack: stack; - end; - {$EXTERNALSYM PSTACK_OF_OCSP_CERTID} - PSTACK_OF_OCSP_CERTID = ^STACK_OF_OCSP_CERTID; - {$ELSE} - //I think the DECLARE_STACK_OF macro is empty - {$EXTERNALSYM PSTACK_OF_OCSP_CERTID} - PSTACK_OF_OCSP_CERTID = PSTACK; - {$ENDIF} -// * Request ::= SEQUENCE { -// * reqCert CertID, -// * singleRequestExtensions [0] EXPLICIT Extensions OPTIONAL } -// */ - {$EXTERNALSYM OCSP_ONEREQ} - OCSP_ONEREQ = record - reqCert : POCSP_CERTID; - singleRequestExtensions : PSTACK_OF_X509_EXTENSION; - end; - {$EXTERNALSYM POCSP_ONEREQ} - POCSP_ONEREQ = ^OCSP_ONEREQ; - {$EXTERNALSYM PPOCSP_ONEREQ} - PPOCSP_ONEREQ = ^POCSP_ONEREQ; - {$IFDEF DEBUG_SAFESTACK} - {$EXTERNALSYM STACK_OF_OCSP_ONEREQ} - STACK_OF_OCSP_ONEREQ = record - _stack: stack; - end; - {$EXTERNALSYM PSTACK_OF_OCSP_ONEREQ} - PSTACK_OF_OCSP_ONEREQ = ^STACK_OF_OCSP_ONEREQ; - {$ELSE} - //I think the DECLARE_STACK_OF macro is empty - {$EXTERNALSYM PSTACK_OF_OCSP_ONEREQ} - PSTACK_OF_OCSP_ONEREQ = PSTACK; - {$ENDIF} -//* TBSRequest ::= SEQUENCE { -//* version [0] EXPLICIT Version DEFAULT v1, -//* requestorName [1] EXPLICIT GeneralName OPTIONAL, -//* requestList SEQUENCE OF Request, -//* requestExtensions [2] EXPLICIT Extensions OPTIONAL } -//*/ - {$EXTERNALSYM OCSP_REQINFO} - OCSP_REQINFO = record - version : PASN1_INTEGER; - requestorName : PGENERAL_NAME; - requestList : PSTACK_OF_OCSP_ONEREQ; - requestExtensions : PSTACK_OF_X509_EXTENSION; - end; - {$EXTERNALSYM POCSP_REQINFO} - POCSP_REQINFO = ^OCSP_REQINFO; - {$EXTERNALSYM PPOCSP_REQINFO} - PPOCSP_REQINFO = ^POCSP_REQINFO; -///* Signature ::= SEQUENCE { -// * signatureAlgorithm AlgorithmIdentifier, -// * signature BIT STRING, -// * certs [0] EXPLICIT SEQUENCE OF Certificate OPTIONAL } -// */ - {$EXTERNALSYM OCSP_SIGNATURE} - OCSP_SIGNATURE = record - signatureAlgorithm : PX509_ALGOR; - signature : PASN1_BIT_STRING; - certs : PSTACK_OF_X509; - end; - {$EXTERNALSYM POCSP_SIGNATURE} - POCSP_SIGNATURE = ^OCSP_SIGNATURE; - {$EXTERNALSYM PPOCSP_SIGNATURE} - PPOCSP_SIGNATURE = ^POCSP_SIGNATURE; -///* OCSPRequest ::= SEQUENCE { -// * tbsRequest TBSRequest, -// * optionalSignature [0] EXPLICIT Signature OPTIONAL } -// */ - {$EXTERNALSYM OCSP_REQUEST} - OCSP_REQUEST = record - tbsRequest : POCSP_REQINFO; - optionalSignature : POCSP_SIGNATURE; //* OPTIONAL */ - end; - {$EXTERNALSYM POCSP_REQUEST} - POCSP_REQUEST = ^OCSP_REQUEST; - {$EXTERNALSYM PPOCSP_REQUEST} - PPOCSP_REQUEST = ^POCSP_REQUEST; -///* OCSPResponseStatus ::= ENUMERATED { -// * successful (0), --Response has valid confirmations -// * malformedRequest (1), --Illegal confirmation request -// * internalError (2), --Internal error in issuer -// * tryLater (3), --Try again later -// * --(4) is not used -// * sigRequired (5), --Must sign the request -// * unauthorized (6) --Request unauthorized -// * } -// */ -///* ResponseBytes ::= SEQUENCE { -// * responseType OBJECT IDENTIFIER, -// * response OCTET STRING } -// */ - {$EXTERNALSYM OCSP_RESPBYTES} - OCSP_RESPBYTES = record - responseType : PASN1_OBJECT; - response : PASN1_OCTET_STRING; - end; - {$EXTERNALSYM POCSP_RESPBYTES} - POCSP_RESPBYTES = ^OCSP_RESPBYTES; - {$EXTERNALSYM PPOCSP_RESPBYTES} - PPOCSP_RESPBYTES = ^POCSP_RESPBYTES; -///* OCSPResponse ::= SEQUENCE { -// * responseStatus OCSPResponseStatus, -// * responseBytes [0] EXPLICIT ResponseBytes OPTIONAL } -// */ - {$EXTERNALSYM OCSP_RESPONSE} - OCSP_RESPONSE = record - responseStatus : PASN1_ENUMERATED; - responseBytes : POCSP_RESPBYTES; - end; - {$EXTERNALSYM POCSP_RESPONSE} - POCSP_RESPONSE = ^OCSP_RESPONSE; - {$EXTERNALSYM PPOCSP_RESPONSE} - PPOCSP_RESPONSE = ^POCSP_RESPONSE; -// /* ResponderID ::= CHOICE { -// * byName [1] Name, -// * byKey [2] KeyHash } -// */ - {$EXTERNALSYM OCSP_RESPID_union} - OCSP_RESPID_union = record - case Integer of - 0 : (byName : PX509_NAME); - 1 : (byKey : PASN1_OCTET_STRING); - end; - {$EXTERNALSYM OCSP_RESPID} - OCSP_RESPID = record - _type : TIdC_INT; - value : OCSP_RESPID_union; - end; - {$EXTERNALSYM POCSP_RESPID} - POCSP_RESPID = ^OCSP_RESPID; - {$EXTERNALSYM PPOCSP_RESPID} - PPOCSP_RESPID = ^POCSP_RESPID; - //* KeyHash ::= OCTET STRING --SHA-1 hash of responder's public key - // * --(excluding the tag and length fields) - // */ - {$IFDEF DEBUG_SAFESTACK} - {$EXTERNALSYM STACK_OF_OCSP_RESPID} - STACK_OF_OCSP_RESPID = record - _stack: stack; - end; - {$EXTERNALSYM PSTACK_OF_OCSP_RESPID} - PSTACK_OF_OCSP_RESPID = ^STACK_OF_OCSP_RESPID; - {$ELSE} - //I think the DECLARE_STACK_OF macro is empty - {$EXTERNALSYM PSTACK_OF_OCSP_RESPID} - PSTACK_OF_OCSP_RESPID = PSTACK; - {$ENDIF} -///* RevokedInfo ::= SEQUENCE { -// * revocationTime GeneralizedTime, -// * revocationReason [0] EXPLICIT CRLReason OPTIONAL } -// */ - {$EXTERNALSYM OCSP_REVOKEDINFO} - OCSP_REVOKEDINFO = record - revocationTime : PASN1_GENERALIZEDTIME; - revocationReason : PASN1_ENUMERATED; - end; - {$EXTERNALSYM POCSP_REVOKEDINFO} - POCSP_REVOKEDINFO = ^OCSP_REVOKEDINFO; - {$EXTERNALSYM PPOCSP_REVOKEDINFO} - PPOCSP_REVOKEDINFO = ^POCSP_REVOKEDINFO; -///* CertStatus ::= CHOICE { -// * good [0] IMPLICIT NULL, -// * revoked [1] IMPLICIT RevokedInfo, -// * unknown [2] IMPLICIT UnknownInfo } -// */ - {$EXTERNALSYM OCSP_CERTSTATUS_union} - OCSP_CERTSTATUS_union = record - case Integer of - 0 : (good : PASN1_NULL); - 1 : (revoked : POCSP_REVOKEDINFO); - 2 : (unknown : PASN1_NULL); - end; - {$EXTERNALSYM OCSP_CERTSTATUS} - OCSP_CERTSTATUS = record - _type : TIdC_INT; - value : OCSP_CERTSTATUS_union; - end; - {$EXTERNALSYM POCSP_CERTSTATUS} - POCSP_CERTSTATUS = ^OCSP_CERTSTATUS; - {$EXTERNALSYM PPOCSP_CERTSTATUS} - PPOCSP_CERTSTATUS = ^POCSP_CERTSTATUS; -///* SingleResponse ::= SEQUENCE { -// * certID CertID, -// * certStatus CertStatus, -// * thisUpdate GeneralizedTime, -// * nextUpdate [0] EXPLICIT GeneralizedTime OPTIONAL, -// * singleExtensions [1] EXPLICIT Extensions OPTIONAL } -// */ - {$EXTERNALSYM OCSP_SINGLERESP} - OCSP_SINGLERESP = record - certId : POCSP_CERTID; - certStatus : POCSP_CERTSTATUS; - thisUpdate : PASN1_GENERALIZEDTIME; - nextUpdate : PASN1_GENERALIZEDTIME; - singleExtensions : PSTACK_OF_X509_EXTENSION; - end; - {$EXTERNALSYM POCSP_SINGLERESP} - POCSP_SINGLERESP = ^OCSP_SINGLERESP; - {$EXTERNALSYM PPOCSP_SINGLERESP} - PPOCSP_SINGLERESP = ^POCSP_SINGLERESP; - {$IFDEF DEBUG_SAFESTACK} - {$EXTERNALSYM STACK_OF_OCSP_SINGLERESP} - STACK_OF_OCSP_SINGLERESP = record - _stack: stack; - end; - {$EXTERNALSYM PSTACK_OF_OCSP_SINGLERESP} - PSTACK_OF_OCSP_SINGLERESP = ^STACK_OF_OCSP_SINGLERESP; - {$ELSE} - //I think the DECLARE_STACK_OF macro is empty - {$EXTERNALSYM PSTACK_OF_OCSP_SINGLERESP} - PSTACK_OF_OCSP_SINGLERESP = PSTACK; - {$ENDIF} -///* ResponseData ::= SEQUENCE { -// * version [0] EXPLICIT Version DEFAULT v1, -// * responderID ResponderID, -// * producedAt GeneralizedTime, -// * responses SEQUENCE OF SingleResponse, -// * responseExtensions [1] EXPLICIT Extensions OPTIONAL } -// */ - {$EXTERNALSYM OCSP_RESPDATA} - OCSP_RESPDATA = record - version : PASN1_INTEGER; - responderId : POCSP_RESPID; - producedAt : PASN1_GENERALIZEDTIME; - responses : PSTACK_OF_OCSP_SINGLERESP; - responseExtensions : PSTACK_OF_X509_EXTENSION; - end; - {$EXTERNALSYM POCSP_RESPDATA} - POCSP_RESPDATA = ^OCSP_RESPDATA; - {$EXTERNALSYM PPOCSP_RESPDATA} - PPOCSP_RESPDATA = ^POCSP_RESPDATA; -///* BasicOCSPResponse ::= SEQUENCE { -// * tbsResponseData ResponseData, -// * signatureAlgorithm AlgorithmIdentifier, -// * signature BIT STRING, -// * certs [0] EXPLICIT SEQUENCE OF Certificate OPTIONAL } -// */ -// /* Note 1: -// The value for "signature" is specified in the OCSP rfc2560 as follows: -// "The value for the signature SHALL be computed on the hash of the DER -// encoding ResponseData." This means that you must hash the DER-encoded -// tbsResponseData, and then run it through a crypto-signing function, which -// will (at least w/RSA) do a hash-'n'-private-encrypt operation. This seems -// a bit odd, but that's the spec. Also note that the data structures do not -// leave anywhere to independently specify the algorithm used for the initial -// hash. So, we look at the signature-specification algorithm, and try to do -// something intelligent. -- Kathy Weinhold, CertCo */ -// /* Note 2: -// It seems that the mentioned passage from RFC 2560 (section 4.2.1) is open -// for interpretation. I've done tests against another responder, and found -// that it doesn't do the double hashing that the RFC seems to say one -// should. Therefore, all relevant functions take a flag saying which -// variant should be used. -- Richard Levitte, OpenSSL team and CeloCom */ - {$EXTERNALSYM OCSP_BASICRESP} - OCSP_BASICRESP = record - tbsResponseData : POCSP_RESPDATA; - signatureAlgorithm : PX509_ALGOR; - signature : PASN1_BIT_STRING; - certs : PSTACK_OF_X509; - end; - {$EXTERNALSYM POCSP_BASICRESP} - POCSP_BASICRESP = ^OCSP_BASICRESP; - {$EXTERNALSYM PPOCSP_BASICRESP} - PPOCSP_BASICRESP = ^POCSP_BASICRESP; -///* CrlID ::= SEQUENCE { -// * crlUrl [0] EXPLICIT IA5String OPTIONAL, -// * crlNum [1] EXPLICIT INTEGER OPTIONAL, -// * crlTime [2] EXPLICIT GeneralizedTime OPTIONAL } -// */ - {$EXTERNALSYM OCSP_CRLID} - OCSP_CRLID = record - crlUrl : PASN1_IA5STRING; - crlNum : PASN1_INTEGER; - crlTime : PASN1_GENERALIZEDTIME; - end; - {$EXTERNALSYM POCSP_CRLID} - POCSP_CRLID = ^OCSP_CRLID; - {$EXTERNALSYM PPOCSP_CRLID} - PPOCSP_CRLID = ^POCSP_CRLID; -///* ServiceLocator ::= SEQUENCE { -// * issuer Name, -// * locator AuthorityInfoAccessSyntax OPTIONAL } -// */ - {$EXTERNALSYM OCSP_SERVICELOC} - OCSP_SERVICELOC = record - issuer : PX509_NAME; - locator : PSTACK_OF_ACCESS_DESCRIPTION; - end; - {$EXTERNALSYM POCSP_SERVICELOC} - POCSP_SERVICELOC = ^OCSP_SERVICELOC; - {$EXTERNALSYM PPOCSP_SERVICELOC} - PPOCSP_SERVICELOC = ^POCSP_SERVICELOC; - //mdc2.h - //MDC2_CTX = record - //this is not defined in headers so it's best use functions in the API to access the structure. - //end; - {$EXTERNALSYM PMDC2_CTX} - PMDC2_CTX = Pointer;//^MDC2_CTX; - //tmdiff.h -// MS_TM = record - //this is not defined in headers so it's best use functions in the API to access the structure. - // end; - {$EXTERNALSYM PMS_TM} - PMS_TM = Pointer;//^MS_TM; - {$EXTERNALSYM PPMS_TM} - PPMS_TM = ^PMS_TM; - //PEVP_PBE_KEYGEN = Pointer; - {$EXTERNALSYM ppem_password_cb} - ppem_password_cb = function (buf : PIdAnsiChar; size : TIdC_INT; rwflag : TIdC_INT; userdata : Pointer) : TIdC_INT; cdecl; - {$EXTERNALSYM PEM_ENCODE_SEAL_CTX} - PEM_ENCODE_SEAL_CTX = record - encode : EVP_ENCODE_CTX; - md : EVP_MD_CTX; - cipher : EVP_CIPHER_CTX; - end; - {$EXTERNALSYM PPEM_ENCODE_SEAL_CTX} - PPEM_ENCODE_SEAL_CTX = ^PEM_ENCODE_SEAL_CTX; - {$IFDEF DEBUG_SAFESTACK} - {$EXTERNALSYM STACK_OF_SSL_COMP} - STACK_OF_SSL_COMP = record - _stack: stack; - end; - {$EXTERNALSYM PSTACK_OF_SSL_COMP} - PSTACK_OF_SSL_COMP = ^STACK_OF_SSL_COMP; - {$ELSE} - //I think the DECLARE_STACK_OF macro is empty - {$EXTERNALSYM PSTACK_OF_SSL_COMP} - PSTACK_OF_SSL_COMP = PSTACK; - {$ENDIF} - {$EXTERNALSYM PPSTACK_OF_SSL_COMP} - PPSTACK_OF_SSL_COMP = ^PSTACK_OF_SSL_COMP; - {$EXTERNALSYM PSSL_COMP} - PSSL_COMP = ^SSL_COMP; - {$EXTERNALSYM lhash_of_SSL_SESSION} - lhash_of_SSL_SESSION = record - dummy : TIdC_INT; - end; - {$EXTERNALSYM Plhash_of_SSL_SESSION} - Plhash_of_SSL_SESSION = ^lhash_of_SSL_SESSION; - - // PASN1_UTCTIME = Pointer; - -//GREGOR - spremenjana deklaracija ker se tolèe -// Phostent = Pointer; - {$NODEFINE Phostent2} - Phostent2 = Pointer; -//END GREGOR -{ This should cause problems, but I will solve them ONLY if they came ... } -{ !!!InvalidTypes!!! } -//END REMY - //des.h - // des_cblock = Integer; - {$EXTERNALSYM DES_cblock} - DES_cblock = array[0..7] of Byte; - {$EXTERNALSYM PDES_cblock} - PDES_cblock = ^DES_cblock; - {$EXTERNALSYM const_DES_cblock} - const_DES_cblock = DES_cblock; - {$EXTERNALSYM Pconst_DES_cblock} - Pconst_DES_cblock = ^const_DES_cblock; - // des_key_schedule = Integer; - {$EXTERNALSYM DES_LONG} - {$IFDEF DES_INT} - DES_LONG = TIdC_UINT; - {$ELSE} - DES_LONG = TIdC_ULONG; - {$ENDIF} - {$EXTERNALSYM des_cblock_union} - des_cblock_union = record - case integer of - 0: (cblock: des_cblock); - 1: (deslong: array [0..1] of DES_LONG); - end; - {$EXTERNALSYM des_ks_struct} - des_ks_struct = record - ks : des_cblock_union; - //IMPORTANT!!! - //Since OpenSSL 0.9.7-dev, the OpenSSL developers - //dropped this member. See: - //http://marc.info/?l=openssl-dev&m=100342566217528&w=2 - - weak_key: TIdC_INT; - end; - {$EXTERNALSYM des_key_schedule} - des_key_schedule = array[0..15] of des_ks_struct; - {$EXTERNALSYM des_cblocks} - des_cblocks = array[0..7] of byte; - //des_cblocks = Integer; - //des_old.h - {$EXTERNALSYM _ossl_old_des_cblock} - _ossl_old_des_cblock = array [0..7] of byte; - {$EXTERNALSYM P_ossl_old_des_cblock} - P_ossl_old_des_cblock = ^_ossl_old_des_cblock; - {$EXTERNALSYM _ossl_old_des_ks_union} - _ossl_old_des_ks_union = record - case Integer of - 0 : (_ : _ossl_old_des_cblock); - //* make sure things are correct size on machines with - //* 8 byte longs */ - 2 : (pad : array [0..1] of DES_LONG); - end; - {$EXTERNALSYM _ossl_old_des_ks_struct} - _ossl_old_des_ks_struct = record - ks : _ossl_old_des_ks_union; - end; - {$EXTERNALSYM _ossl_old_des_key_schedule} - _ossl_old_des_key_schedule = array [0..15] of _ossl_old_des_ks_struct; - {$EXTERNALSYM P_ossl_old_des_key_schedule} - P_ossl_old_des_key_schedule = ^_ossl_old_des_key_schedule; -{IMPORTANT!!! - -In C, symbols are case sensitive while in Pascal, they are insensitive. -Thus, when we something like this: - -#define des_cblock DES_cblock - -we, should do something like this: - -_des_cblock = DES_cblock -} - {$EXTERNALSYM _des_cblock} - {$EXTERNALSYM _des_key_schedule} - {$IFNDEF OPENSSL_DES_LIBDES_COMPATIBILITY} - _des_cblock = DES_cblock; - {$EXTERNALSYM _const_des_cblock} - _const_des_cblock = const_DES_cblock; - _des_key_schedule = DES_key_schedule; - {$ELSE} -///* libdes compatibility */ -//* Map all symbol names to _ossl_old_des_* form, so we avoid all -// clashes with libdes */ - _des_cblock = _ossl_old_des_cblock; - _des_key_schedule = _ossl_old_des_key_schedule; - {$ENDIF} - {$EXTERNALSYM TIdSslLockingCallback} - TIdSslLockingCallback = procedure (mode, n : TIdC_INT; Afile : PIdAnsiChar; line : TIdC_INT); cdecl; - {$EXTERNALSYM TIdSslIdCallback} - TIdSslIdCallback = function: TIdC_ULONG; cdecl; -///ssl_locl.h structs. These are probably internal records so don't expose -//their members as ssl_lock.h is not included in the headers -//JPM - {$EXTERNALSYM PSSL3_ENC_METHOD} - PSSL3_ENC_METHOD = pointer;//^SSL3_ENC_METHOD; -// SSL3_ENC_METHOD = record -// end; - {$EXTERNALSYM PCERT} - PCERT = pointer; - {$EXTERNALSYM PPCERT} - PPCERT = ^PCERT; - {$EXTERNALSYM PSESS_CERT} - PSESS_CERT = pointer; - //pkcs7.h - {$EXTERNALSYM PPKCS7} - PPKCS7 = ^PKCS7; - {$EXTERNALSYM PPPKCS7} - PPPKCS7 = ^PPKCS7; - {$EXTERNALSYM PKCS7_ISSUER_AND_SERIAL} - PKCS7_ISSUER_AND_SERIAL = record - issuer : PX509_NAME; - serial : PASN1_INTEGER; - end; - {$EXTERNALSYM PPKCS7_ISSUER_AND_SERIAL} - PPKCS7_ISSUER_AND_SERIAL = ^PKCS7_ISSUER_AND_SERIAL; - {$EXTERNALSYM PKCS7_SIGNER_INFO} - PKCS7_SIGNER_INFO = record - version : PASN1_INTEGER; // version 1 - issuer_and_serial : PPKCS7_ISSUER_AND_SERIAL; - digest_alg : PX509_ALGOR; - auth_attr : PSTACK_OF_X509_ATTRIBUTE; // [ 0 ] - digest_enc_alg : PX509_ALGOR; - enc_digest : PASN1_OCTET_STRING; - unauth_attr : PSTACK_OF_X509_ATTRIBUTE; // [ 1 ] - // The private key to sign with - pkey : PEVP_PKEY; - end; - {$EXTERNALSYM PPKCS7_SIGNER_INFO} - PPKCS7_SIGNER_INFO = ^PKCS7_SIGNER_INFO; - {$IFDEF DEBUG_SAFESTACK} - {$EXTERNALSYM STACK_OF_PKCS7_SIGNER_INFO} - STACK_OF_PKCS7_SIGNER_INFO = record - _stack: stack; - end; - {$EXTERNALSYM PSTACK_OF_PKCS7_SIGNER_INFO} - PSTACK_OF_PKCS7_SIGNER_INFO = ^STACK_OF_PKCS7_SIGNER_INFO; - {$ELSE} - //I think the DECLARE_STACK_OF macro is empty - {$EXTERNALSYM PSTACK_OF_PKCS7_SIGNER_INFO} - PSTACK_OF_PKCS7_SIGNER_INFO = PSTACK; - {$ENDIF} - {$EXTERNALSYM PKCS7_RECIP_INFO} - PKCS7_RECIP_INFO = record - version : PASN1_INTEGER; // version 0 - issuer_and_serial : PPKCS7_ISSUER_AND_SERIAL; - key_enc_algor : PX509_ALGOR; - enc_key : PASN1_OCTET_STRING; - cert : PX509; // get the pub-key from this - end; - {$IFDEF DEBUG_SAFESTACK} - {$EXTERNALSYM STACK_OF_PKCS7_RECIP_INFO} - STACK_OF_PKCS7_RECIP_INFO = record - _stack: stack; - end; - {$EXTERNALSYM PSTACK_OF_PKCS7_RECIP_INFO} - PSTACK_OF_PKCS7_RECIP_INFO = ^STACK_OF_PKCS7_RECIP_INFO; - {$ELSE} - //I think the DECLARE_STACK_OF macro is empty - {$EXTERNALSYM PSTACK_OF_PKCS7_RECIP_INFO} - PSTACK_OF_PKCS7_RECIP_INFO = PSTACK; - {$ENDIF} - {$EXTERNALSYM PPSTACK_OF_PKCS7_RECIP_INFO} - PPSTACK_OF_PKCS7_RECIP_INFO = ^PSTACK_OF_PKCS7_RECIP_INFO; - {$EXTERNALSYM PKCS7_SIGNED} - PKCS7_SIGNED = record - version : PASN1_INTEGER; // version 1 - md_algs : PSTACK_OF_X509_ALGOR; // md used - cert : PSTACK_OF_X509; // [ 0 ] - crl : PSTACK_OF_X509_CRL; // [ 1 ] - signer_info : PSTACK_OF_PKCS7_SIGNER_INFO; - contents : PPKCS7; - end; - {$EXTERNALSYM PPKCS7_SIGNED} - PPKCS7_SIGNED = ^PKCS7_SIGNED; - {$EXTERNALSYM PPPKCS7_SIGNED} - PPPKCS7_SIGNED = ^PPKCS7_SIGNED; - {$EXTERNALSYM PKCS7_ENC_CONTENT} - PKCS7_ENC_CONTENT = record - content_type : PASN1_OBJECT; - algorithm : PX509_ALGOR; - enc_data : PASN1_OCTET_STRING; // [ 0 ] - cipher : PEVP_CIPHER; - end; - {$EXTERNALSYM PPKCS7_ENC_CONTENT} - PPKCS7_ENC_CONTENT = ^PKCS7_ENC_CONTENT; - {$EXTERNALSYM PKCS7_ENVELOPE} - PKCS7_ENVELOPE = record - version : PASN1_INTEGER; // version 0 - recipientinfo : PSTACK_OF_PKCS7_RECIP_INFO; - enc_data : PPKCS7_ENC_CONTENT; - end; - {$EXTERNALSYM PPKCS7_ENVELOPE} - PPKCS7_ENVELOPE = ^PKCS7_ENVELOPE; - // OpenSSL developer notes - // The above structure is very very similar to PKCS7_SIGN_ENVELOPE. - // How about merging the two - {$EXTERNALSYM PKCS7_SIGN_ENVELOPE} - PKCS7_SIGN_ENVELOPE = record - version : PASN1_INTEGER; // version 1 - md_algs : PSTACK_OF_X509_ALGOR; // md used - cert : PSTACK_OF_X509; // [ 0 ] - crl : PSTACK_OF_X509_CRL; // [ 1 ] - signer_info : PSTACK_OF_PKCS7_SIGNER_INFO; - enc_data : PPKCS7_ENC_CONTENT; - recipientinfo : PSTACK_OF_PKCS7_RECIP_INFO; - end; - {$EXTERNALSYM PPKCS7_SIGN_ENVELOPE} - PPKCS7_SIGN_ENVELOPE = ^PKCS7_SIGN_ENVELOPE; - {$EXTERNALSYM PKCS7_DIGEST} - PKCS7_DIGEST = record - version : PASN1_INTEGER; // version 0 - md : PX509_ALGOR; // md used - contents : PPKCS7; - digest : PASN1_OCTET_STRING; - end; - {$EXTERNALSYM PPKCS7_DIGEST} - PPKCS7_DIGEST = ^PKCS7_DIGEST; - {$EXTERNALSYM PKCS7_ENCRYPT} - PKCS7_ENCRYPT = record - version : PASN1_INTEGER; // version 0 - enc_data : PPKCS7_ENC_CONTENT; - end; - {$EXTERNALSYM PPKCS7_ENCRYPT} - PPKCS7_ENCRYPT = ^PKCS7_ENCRYPT; - {$EXTERNALSYM PKCS7_union} - PKCS7_union = record - // content as defined by the type - // all encryption/message digests are applied to the 'contents', - // leaving out the 'type' field. - case Integer of - 0 : (ptr : PIdAnsiChar); - // NID_pkcs7_data - 1 : (data : PASN1_OCTET_STRING); - // NID_pkcs7_signed - 2 : (sign : PPKCS7_SIGNED); - // NID_pkcs7_enveloped - 3 : (enveloped : PPKCS7_ENVELOPE); - // NID_pkcs7_signedAndEnveloped - 4 : (signed_and_enveloped : PPKCS7_SIGN_ENVELOPE); - // NID_pkcs7_digest - 5 : (digest : PPKCS7_DIGEST); - // NID_pkcs7_encrypted - 6 : (encrypted : PPKCS7_ENCRYPT); - end; - {$EXTERNALSYM PKCS7} - PKCS7 = record - // The following is non NULL if it contains ASN1 encoding of - // this structure - asn1 : PIdAnsiChar; - length : TIdC_LONG; -//#define PKCS7_S_HEADER 0 -//#define PKCS7_S_BODY 1 -//#define PKCS7_S_TAIL 2 - state : TIdC_INT; // used during processing - detached : TIdC_INT; - _type : PASN1_OBJECT; - // content as defined by the type - // all encryption/message digests are applied to the 'contents', - // leaving out the 'type' field. - d : PKCS7_union; - end; - {$IFDEF DEBUG_SAFESTACK} - {$EXTERNALSYM STACK_OF_PKCS7} - STACK_OF_PKCS7 = record - _stack: stack; - end; - {$EXTERNALSYM PSTACK_OF_PKCS7} - PSTACK_OF_PKCS7 = ^STACK_OF_PKCS7; - {$ELSE} - //I think the DECLARE_STACK_OF macro is empty - {$EXTERNALSYM PSTACK_OF_PKCS7} - PSTACK_OF_PKCS7 = PSTACK; - {$ENDIF} - //pkcs12.h - {$EXTERNALSYM PKCS12_MAC_DATA} - PKCS12_MAC_DATA = record - dinfo : PX509_SIG; - salt : PASN1_OCTET_STRING; - iter : PASN1_INTEGER; // defaults to 1 - end; - {$EXTERNALSYM PPKCS12_MAC_DATA} - PPKCS12_MAC_DATA = ^PKCS12_MAC_DATA; - // PSESS_CERT = ^SESS_CERT; - {$EXTERNALSYM PPKCS12} - PPKCS12 = ^PKCS12; - {$EXTERNALSYM PPPKCS12} - PPPKCS12 = ^PPKCS12; - {$EXTERNALSYM PKCS12} - PKCS12 = record - version : PASN1_INTEGER; - mac : PPKCS12_MAC_DATA; - authsafes : PPKCS7; - end; - //ts.h - {$IFDEF DEBUG_SAFESTACK} - {$EXTERNALSYM STACK_OF_EVP_MD} - STACK_OF_EVP_MD = record - _stack: stack; - end; - {$EXTERNALSYM PSTACK_OF_EVP_MD} - PSTACK_OF_EVP_MD = ^STACK_OF_EVP_MD; - {$EXTERNALSYM STACK_OF_ASN1_UTF8STRING} - STACK_OF_ASN1_UTF8STRING = record - _stack: stack; - end; - {$EXTERNALSYM PSTACK_OF_ASN1_UTF8STRING} - PSTACK_OF_ASN1_UTF8STRING = ^STACK_OF_ASN1_UTF8STRING; - {$ELSE} - //I think the DECLARE_STACK_OF macro is empty - {$EXTERNALSYM PSTACK_OF_EVP_MD} - PSTACK_OF_EVP_MD = PSTACK; - {$EXTERNALSYM PSTACK_OF_ASN1_UTF8STRING} - PSTACK_OF_ASN1_UTF8STRING = PSTACK; - {$ENDIF} - {$EXTERNALSYM TS_MSG_IMPRINT} - TS_MSG_IMPRINT = record - hash_algo : PX509_ALGOR; - hashed_msg : PASN1_OCTET_STRING; - end; - {$EXTERNALSYM PTS_MSG_IMPRINT} - PTS_MSG_IMPRINT = ^TS_MSG_IMPRINT; - {$EXTERNALSYM TS_REQ} - TS_REQ = record - version : PASN1_INTEGER; - msg_imprint : PTS_MSG_IMPRINT; - policy_id : PASN1_OBJECT; //* OPTIONAL */ - nonce : PASN1_INTEGER; //* OPTIONAL */ - cert_req : ASN1_BOOLEAN; //* DEFAULT FALSE */ - extensions : PSTACK_OF_X509_EXTENSION; //* [0] OPTIONAL */ - end; - {$EXTERNALSYM PTS_REQ} - PTS_REQ = ^TS_REQ; - {$EXTERNALSYM TS_ACCURACY} - TS_ACCURACY = record - seconds : PASN1_INTEGER; - millis : PASN1_INTEGER; - micros : PASN1_INTEGER; - end; - {$EXTERNALSYM PTS_ACCURACY} - PTS_ACCURACY = ^TS_ACCURACY; - {$EXTERNALSYM TS_TST_INFO} - TS_TST_INFO = record - version : PASN1_INTEGER; - policy_id : PASN1_OBJECT; - msg_imprint : PTS_MSG_IMPRINT; - serial : PASN1_INTEGER; - time : PASN1_GENERALIZEDTIME; - accuracy : PTS_ACCURACY; - ordering : PASN1_BOOLEAN; - nonce : PASN1_INTEGER; - tsa : PGENERAL_NAME; - extensions : PSTACK_OF_X509_EXTENSION; - end; - {$EXTERNALSYM PTS_TST_INFO} - PTS_TST_INFO = ^TS_TST_INFO; - {$EXTERNALSYM TS_STATUS_INFO} - TS_STATUS_INFO = record - status : PASN1_INTEGER; - text : PSTACK_OF_ASN1_UTF8STRING; - failure_info : PASN1_BIT_STRING; - end; - {$EXTERNALSYM PTS_STATUS_INFO} - PTS_STATUS_INFO = ^TS_STATUS_INFO; - {$EXTERNALSYM TS_RESP} - TS_RESP = record - status_info : PTS_STATUS_INFO; - token : PPKCS7; - tst_info : PTS_TST_INFO; - end; - {$EXTERNALSYM PTS_RESP} - PTS_RESP = ^TS_RESP; - {$EXTERNALSYM ESS_ISSUER_SERIAL} - ESS_ISSUER_SERIAL = record - issuer : PSTACK_OF_GENERAL_NAME; - serial : PASN1_INTEGER; - end; - {$EXTERNALSYM PESS_ISSUER_SERIAL} - PESS_ISSUER_SERIAL = ^ESS_ISSUER_SERIAL; - {$EXTERNALSYM ESS_CERT_ID} - ESS_CERT_ID = record - hash : PASN1_OCTET_STRING; //* Always SHA-1 digest. */ - issuer_serial : PESS_ISSUER_SERIAL; - end; - {$EXTERNALSYM PESS_CERT_ID} - PESS_CERT_ID = ^ESS_CERT_ID; - {$IFDEF DEBUG_SAFESTACK} - {$EXTERNALSYM STACK_OF_ESS_CERT_ID} - STACK_OF_ESS_CERT_ID = record - _stack: stack; - end; - {$EXTERNALSYM PSTACK_OF_ESS_CERT_ID} - PSTACK_OF_ESS_CERT_ID = ^STACK_OF_ESS_CERT_ID; - {$ELSE} - //I think the DECLARE_STACK_OF macro is empty - {$EXTERNALSYM PSTACK_OF_ESS_CERT_ID} - PSTACK_OF_ESS_CERT_ID = PSTACK; - {$ENDIF} - {$EXTERNALSYM ESS_SIGNING_CERT} - ESS_SIGNING_CERT = record - cert_ids : PSTACK_OF_ESS_CERT_ID; - policy_info : PSTACK_OF_POLICYINFO; - end; - {$EXTERNALSYM PESS_SIGNING_CERT} - PESS_SIGNING_CERT = ^ESS_SIGNING_CERT; - {$EXTERNALSYM PTS_resp_ctx} - PTS_resp_ctx = ^TS_resp_ctx; -//* This must return a unique number less than 160 bits long. */ -//typedef ASN1_INTEGER *(*TS_serial_cb)(struct TS_resp_ctx *, void *); - {$EXTERNALSYM TS_serial_cb} - TS_serial_cb = function (p1 : PTS_resp_ctx; p2 : Pointer) : PASN1_INTEGER cdecl; - //* This must return the seconds and microseconds since Jan 1, 1970 in - // the sec and usec variables allocated by the caller. - // Return non-zero for success and zero for failure. */ -//typedef int (*TS_time_cb)(struct TS_resp_ctx *, void *, long *sec, long *usec); - {$EXTERNALSYM TS_time_cb} - TS_time_cb = function (p1 : PTS_resp_ctx; p2 : Pointer; sec, usec : TIdC_LONG) : TIdC_INT cdecl; -///* This must process the given extension. -// * It can modify the TS_TST_INFO object of the context. -// * Return values: !0 (processed), 0 (error, it must set the -// * status info/failure info of the response). -// */ -//typedef int (*TS_extension_cb)(struct TS_resp_ctx *, X509_EXTENSION *, void *); - {$EXTERNALSYM TS_extension_cb} - TS_extension_cb = function (p1 : PTS_resp_ctx; p2 : PX509_EXTENSION; p3 : Pointer) : TIdC_INT cdecl; - {$EXTERNALSYM TS_RESP_CTX} - TS_RESP_CTX = record - signer_cert : PX509; - signer_key : PEVP_PKEY; - certs : PSTACK_OF_X509; //* Certs to include in signed data. */ - policies : PSTACK_OF_ASN1_OBJECT; //* Acceptable policies. */ - default_policy : PASN1_OBJECT; //* It may appear in policies, too. */ - mds : PSTACK_OF_EVP_MD; //* Acceptable message digests. */ - seconds : PASN1_INTEGER; //* accuracy, 0 means not specified. */ - millis : PASN1_INTEGER; //* accuracy, 0 means not specified. */ - micros : PASN1_INTEGER; //* accuracy, 0 means not specified. */ - clock_precision_digits : TIdC_UNSIGNED; //* fraction of seconds in - //time stamp token. */ - flags : TIdC_UNSIGNED; //* Optional info, see values above. */ - - //* Callback functions. */ - serial_cb : TS_serial_cb; - serial_cb_data : Pointer; //* User data for serial_cb. */ - - time_cb : TS_time_cb; - time_cb_data : Pointer; //* User data for time_cb. */ - - extension_cb : TS_extension_cb; - extension_cb_data : Pointer; //* User data for extension_cb. */ - - //* These members are used only while creating the response. */ - request : PTS_REQ; - response : PTS_RESP; - tst_info : PTS_TST_INFO; - end; - {$EXTERNALSYM TS_VERIFY_CTX} - TS_VERIFY_CTX = record - //* Set this to the union of TS_VFY_... flags you want to carry out. */ - flags : TIdC_UNSIGNED; - - //* Must be set only with TS_VFY_SIGNATURE. certs is optional. */ - store : PX509_STORE; - certs : PSTACK_OF_X509; - - //* Must be set only with TS_VFY_POLICY. */ - policy : PASN1_OBJECT; - -// /* Must be set only with TS_VFY_IMPRINT. If md_alg is NULL, -// the algorithm from the response is used. */ - md_alg : PX509_ALGOR; - imprint : PIdAnsiChar; - imprint_len : TIdC_UNSIGNED; - - //* Must be set only with TS_VFY_DATA. */ - data : PBIO; - - //* Must be set only with TS_VFY_TSA_NAME. */ - nonce : PASN1_INTEGER; - - //* Must be set only with TS_VFY_TSA_NAME. */ - tsa_name : PGENERAL_NAME; - end; - {$EXTERNALSYM PTS_VERIFY_CTX} - PTS_VERIFY_CTX = ^TS_VERIFY_CTX; - //comp.h - {$EXTERNALSYM PCOMP_CTX} - PCOMP_CTX = ^COMP_CTX; - {$EXTERNALSYM COMP_METHOD} - COMP_METHOD = record - _type : TIdC_INT; // NID for compression library - name : PIdAnsiChar; // A text string to identify the library - init : function (ctx : PCOMP_CTX) : TIdC_INT; cdecl; - finish : procedure (ctx : PCOMP_CTX); cdecl; - compress : function (ctx : PCOMP_CTX; - _out : PIdAnsiChar; olen : TIdC_UINT; - _in : PIdAnsiChar; ilen : TIdC_UINT) : TIdC_INT; cdecl; - expand : function (ctx : PCOMP_CTX; - _out : PIdAnsiChar; olen : TIdC_UINT; - _in : PIdAnsiChar; ilen : TIdC_UINT) : TIdC_INT; cdecl; - // The following two do NOTHING, but are kept for backward compatibility - ctrl : function : TIdC_INT; cdecl; - callback_ctrl : function : TIdC_INT; cdecl; - end; - {$EXTERNALSYM PCOMP_METHOD} - PCOMP_METHOD = ^COMP_METHOD; - {$EXTERNALSYM COMP_CTX} - COMP_CTX = record - meth : PCOMP_METHOD; - compress_in : TIdC_ULONG; - compress_out : TIdC_ULONG; - expand_in : TIdC_ULONG; - expand_out : TIdC_ULONG; - ex_data : PCRYPTO_EX_DATA; - end; - //srp.h - {$EXTERNALSYM SRP_gN_cache} - SRP_gN_cache = record - b64_bn : PIdAnsiChar; - bn : PBIGNUM; - end; - {$EXTERNALSYM PSRP_gN_cache} - PSRP_gN_cache = ^SRP_gN_cache; - {$IFDEF DEBUG_SAFESTACK} - {$EXTERNALSYM STACK_OF_SRP_gN_cache} - STACK_OF_SRP_gN_cache = record - _stack: stack; - end; - {$EXTERNALSYM PSTACK_OF_SRP_gN_cache} - PSTACK_OF_SRP_gN_cache = ^STACK_OF_SRP_gN_cache; - {$ELSE} - //I think the DECLARE_STACK_OF macro is empty - {$EXTERNALSYM PSTACK_OF_SRP_gN_cache} - PSTACK_OF_SRP_gN_cache = PSTACK; - {$ENDIF} - {$EXTERNALSYM SRP_user_pwd} - SRP_user_pwd = record - id : PIdAnsiChar; - s : PBIGNUM; - v : PBIGNUM; - g : PBIGNUM; - N : PBIGNUM; - info : PIdAnsiChar; - end; - {$EXTERNALSYM PSRP_user_pwd} - PSRP_user_pwd = ^SRP_user_pwd; - {$IFDEF DEBUG_SAFESTACK} - {$EXTERNALSYM STACK_OF_SRP_user_pwd} - STACK_OF_SRP_user_pwd = record - _stack: stack; - end; - {$EXTERNALSYM PSTACK_OF_SRP_user_pwd} - PSTACK_OF_SRP_user_pwd = ^STACK_OF_SRP_user_pwd; - {$ELSE} - //I think the DECLARE_STACK_OF macro is empty - {$EXTERNALSYM PSTACK_OF_SRP_user_pwd} - PSTACK_OF_SRP_user_pwd = PSTACK; - {$ENDIF} - {$EXTERNALSYM SRP_VBASE} - SRP_VBASE = record - users_pwd : PSTACK_OF_SRP_user_pwd; - gN_cache : PSTACK_OF_SRP_gN_cache; -//* to simulate a user */ - seed_key : PIdAnsiChar; - default_g : PBIGNUM; - default_N : PBIGNUM; - end; - {$EXTERNALSYM PSRP_VBASE} - PSRP_VBASE = ^SRP_VBASE; - -//*Structure interne pour retenir les couples N et g*/ - {$EXTERNALSYM SRP_gN} - SRP_gN = record - id : PIdAnsiChar; - g : PBIGNUM; - N : PBIGNUM; - end; - {$EXTERNALSYM PSRP_gN} - PSRP_gN = ^SRP_gN; - - {$IFDEF DEBUG_SAFESTACK} - {$EXTERNALSYM STACK_OF_SRP_gN} - STACK_OF_SRP_gN = record - _stack: stack; - end; - {$EXTERNALSYM PSTACK_OF_SRP_gN} - PSTACK_OF_SRP_gN = ^STACK_OF_SRP_gN; - {$ELSE} - //I think the DECLARE_STACK_OF macro is empty - {$EXTERNALSYM PSTACK_OF_SRP_gN} - PSTACK_OF_SRP_gN = PSTACK; - {$ENDIF} - //kssl.h - {These are structures for Kerberos support. These will not be complete because - FreePascal, Borland Delphi, and Indy don't support Kerberos. These are here - as place holders so we get an exact OpenSSL API if Kerberos support was compiled - in. - } - {$IFNDEF OPENSSL_NO_KRB5} - {$EXTERNALSYM KSSL_ERR} - KSSL_ERR = record - reason : TIdC_INT; - text : array [0..KSSL_ERR_MAX] of Char; - end; - {$EXTERNALSYM PKSSL_CTX} - {I am not going to do anything to define this because it uses things in the - Kerberos API. Since there's no support for Kerberos, I'm leaving it empty. - We only need the pointer anyway} - - PKSSL_CTX = Pointer; //^KSSL_CTX; - {$ENDIF} - //ssl.h - {$ifndef OPENSSL_NO_SSL_INTERN} - {$EXTERNALSYM PSSL_CIPHER} - PSSL_CIPHER = ^SSL_CIPHER; - {$EXTERNALSYM SSL_CIPHER} - SSL_CIPHER = record - valid : TIdC_INT; - name: PIdAnsiChar; // text name - id: TIdC_ULONG; // id, 4 bytes, first is version - - //* changed in 0.9.9: these four used to be portions of a single value 'algorithms' */ - algorithm_mkey : TIdC_ULONG; //* key exchange algorithm */ - algorithm_auth : TIdC_ULONG; //* server authentication */ - algorithm_enc : TIdC_ULONG; //* symmetric encryption */ - algorithm_mac : TIdC_ULONG; //* symmetric authentication */ - algorithm_ssl : TIdC_ULONG; //* (major) protocol version */ - algo_strength: TIdC_ULONG; // strength and export flags - algorithm2: TIdC_ULONG;// Extra flags - strength_bits: TIdC_INT; // Number of bits really used - alg_bits: TIdC_INT; // Number of bits for algorithm - end; - {$IFDEF DEBUG_SAFESTACK} - {$EXTERNALSYM STACK_OF_SSL_CIPHER} - STACK_OF_SSL_CIPHER = record - _stack: STACK; - end; - {$EXTERNALSYM PSTACK_OF_SSL_CIPHER} - PSTACK_OF_SSL_CIPHER = ^STACK_OF_SSL_CIPHER; - {$ELSE} - //I think the DECLARE_STACK_OF macro is empty - {$EXTERNALSYM PSTACK_OF_SSL_CIPHER} - PSTACK_OF_SSL_CIPHER = PSTACK; - {$ENDIF} - - {$EXTERNALSYM PSSL_SESSION} - PSSL_SESSION = ^SSL_SESSION; - {$EXTERNALSYM SSL_SESSION} - SSL_SESSION = record - ssl_version : TIdC_INT; // what ssl version session info is being kept in here? - // only really used in SSLv2 - key_arg_length: TIdC_UINT; - key_arg: Array[0..SSL_MAX_KEY_ARG_LENGTH-1] of Byte; - master_key_length: TIdC_INT; - master_key: Array[0..SSL_MAX_MASTER_KEY_LENGTH-1] of Byte; - // session_id - valid? - session_id_length: TIdC_UINT; - session_id: Array[0..SSL_MAX_SSL_SESSION_ID_LENGTH-1] of Byte; - // this is used to determine whether the session is being reused in - // the appropriate context. It is up to the application to set this, - // via SSL_new - sid_ctx_length: TIdC_UINT; - sid_ctx: array[0..SSL_MAX_SID_CTX_LENGTH-1] of Byte; - {$IFNDEF OPENSSL_NO_KRB5} - krb5_client_princ_len: TIdC_UINT; - krb5_client_princ: array[0..SSL_MAX_KRB5_PRINCIPAL_LENGTH-1] of Byte; - {$ENDIF} -{$ifndef OPENSSL_NO_PSK} - psk_identity_hint : PIdAnsiChar; - psk_identity : PIdAnsiChar; -{$endif} - not_resumable: TIdC_INT; - // The cert is the certificate used to establish this connection - sess_cert : PSESS_CERT; - - //* This is the cert for the other end. - // * On clients, it will be the same as sess_cert->peer_key->x509 - // * (the latter is not enough as sess_cert is not retained - // * in the external representation of sessions, see ssl_asn1.c). */ - peer : PX509; - //* when app_verify_callback accepts a session where the peer's certificate - // * is not ok, we must remember the error for session reuse: */ - verify_result : TIdC_LONG; //* only for servers */ - references : TIdC_INT; - timeout : TIdC_LONG; - time : TIdC_LONG; - compress_meth : TIdC_UINT; //* Need to lookup the method */ - - cipher : PSSL_CIPHER; - cipher_id : TIdC_ULONG; //* when ASN.1 loaded, this - // * needs to be used to load - // * the 'cipher' structure */ - ciphers : PSTACK_OF_SSL_CIPHER; //* shared ciphers? */ - ex_data : CRYPTO_EX_DATA; // application specific data */ - //* These are used to make removal of session-ids more - // * efficient and to implement a maximum cache size. */ - prev, next : PSSL_SESSION; - - {$IFNDEF OPENSSL_NO_TLSEXT} - tlsext_hostname : PIdAnsiChar; - {$IFDEF OPENSSL_NO_EC} - tlsext_ecpointformatlist_length : size_t; - tlsext_ecpointformatlist : PIdAnsiChar; //* peer's list */ - tlsext_ellipticcurvelist_length : size_t; - tlsext_ellipticcurvelist : PIdAnsiChar; //* peer's list */ - {$ENDIF} //* OPENSSL_NO_EC */ - - //* RFC4507 info */ - tlsext_tick : PIdAnsiChar;//* Session ticket */ - tlsext_ticklen : size_t;//* Session ticket length */ - tlsext_tick_lifetime_hint : TIdC_LONG;//* Session lifetime hint in seconds */ - {$ENDIF} -{$ifndef OPENSSL_NO_SRP} - srp_username : PIdAnsiChar; -{$endif} - end; - {$ENDIF} - -{$ifndef OPENSSL_NO_SRP} - -{$ifndef OPENSSL_NO_SSL_INTERN} - - {$EXTERNALSYM SRP_CTX} - SRP_CTX = record - //* param for all the callbacks */ - SRP_cb_arg : Pointer; - //* set client Hello login callback */ - TLS_ext_srp_username_callback : function(para1 : PSSL; para2 : TIdC_INT; para3 : Pointer) : TIdC_INT cdecl; - //int (*TLS_ext_srp_username_callback)(SSL *, int *, void *); - //* set SRP N/g param callback for verification */ - SRP_verify_param_callback : function(para1 : PSSL; para2 : Pointer) : TIdC_INT cdecl; -// int (*SRP_verify_param_callback)(SSL *, void *); - //* set SRP client passwd callback */ - SRP_give_srp_client_pwd_callback : function(para1 : PSSL; para2 : Pointer) : PIdAnsiChar cdecl; - // char *(*SRP_give_srp_client_pwd_callback)(SSL *, void *); - login : PIdAnsiChar; - N, g, s, B, A : PBIGNUM; - _a, _b, v : PBIGNUM; - info : PIdAnsiChar; - strength : TIdC_INT; - srp_Mask : TIdC_ULONG; - end; - {$EXTERNALSYM PSRP_CTX} - PSRP_CTX = ^SRP_CTX; -{$endif} -{$ENDIF} - // typedef struct ssl_method_st - {$NODEFINE PSSL_CTX} - PSSL_CTX = ^SSL_CTX; - {$EXTERNALSYM SRTP_PROTECTION_PROFILE} - SRTP_PROTECTION_PROFILE = record - name : PIdAnsiChar; - id : TIdC_ULONG; - end; - {$EXTERNALSYM PTLS_SESSION_TICKET_EXT} - PTLS_SESSION_TICKET_EXT = ^TLS_SESSION_TICKET_EXT; - {$EXTERNALSYM TLS_SESSION_TICKET_EXT} - TLS_SESSION_TICKET_EXT = record - length : TIdC_USHORT; - data : Pointer; - end; - {$EXTERNALSYM PSRTP_PROTECTION_PROFILE} - PSRTP_PROTECTION_PROFILE = ^SRTP_PROTECTION_PROFILE; - {$EXTERNALSYM tls_session_ticket_ext_cb_fn} - tls_session_ticket_ext_cb_fn = function(S : PSSL; data : PIdAnsiChar; len : TIdC_INT; arg : Pointer) : TIdC_INT cdecl; - {$EXTERNALSYM tls_session_secret_cb_fn} - tls_session_secret_cb_fn = function(S : PSSL; - secret : Pointer; - var secret_len : TIdC_INT; - peer_ciphers : PSTACK_OF_SSL_CIPHER; - out cipher : PSSL_CIPHER) : TIdC_INT cdecl; - {$EXTERNALSYM SSL_METHOD_PROC} - SSL_METHOD_PROC = procedure; cdecl; - {$NODEFINE PSSL_METHOD} - PSSL_METHOD = ^SSL_METHOD; - {$NODEFINE SSL_METHOD} - SSL_METHOD = record - version: TIdC_INT; - ssl_new: function(s: PSSL): TIdC_INT; cdecl; - ssl_clear: procedure(s: PSSL); cdecl; - ssl_free: procedure(s: PSSL); cdecl; - ssl_accept: function(s: PSSL): TIdC_INT; cdecl; - ssl_connect: function(s: PSSL): TIdC_INT; cdecl; - ssl_read: function(s: PSSL; buf: Pointer; len: TIdC_INT):TIdC_INT; cdecl; - ssl_peek: function(s: PSSL; buf: Pointer; len: TIdC_INT):TIdC_INT; cdecl; - ssl_write: function(s: PSSL; const buf: Pointer; len:TIdC_INT): TIdC_INT; cdecl; - ssl_shutdown: function(s: PSSL): TIdC_INT; cdecl; - ssl_renegotiate: function(s: PSSL): TIdC_INT; cdecl; - ssl_renegotiate_check: function(s: PSSL): TIdC_INT; cdecl; - ssl_get_message: function(s: PSSL; st1, stn, mt: TIdC_INT; max: TIdC_LONG; ok: PIdC_INT): TIdC_LONG; cdecl; - ssl_read_bytes: function(s: PSSL; _type: TIdC_INT; buf:PByte; len, peek: TIdC_INT): TIdC_INT; cdecl; - ssl_write_bytes: function(s: PSSL; _type: TIdC_INT; const buf: Pointer; len: TIdC_INT): TIdC_INT; cdecl; - ssl_dispatch_alert: function(s: PSSL): TIdC_INT; cdecl; - ssl_ctrl: function(s: PSSL; cmd: TIdC_INT; larg: TIdC_LONG; parg: Pointer): TIdC_LONG; cdecl; - ssl_ctx_ctrl: function(ctx: PSSL_CTX; cmd: TIdC_INT; larg:TIdC_LONG; parg: Pointer): TIdC_LONG; cdecl; - get_cipher_by_char: function(const ptr: PByte):PSSL_CIPHER; cdecl; - put_cipher_by_char: function(const cipher: PSSL_CIPHER;ptr: PByte): TIdC_INT; cdecl; - ssl_pending: function(const s: PSSL): TIdC_INT; cdecl; - num_ciphers: function: TIdC_INT; cdecl; - get_cipher: function(ncipher: TIdC_UNSIGNED): PSSL_CIPHER;cdecl; - get_ssl_method: function(version: TIdC_INT): PSSL_METHOD; cdecl; - get_timeout: function : TIdC_LONG; cdecl; - ssl3_enc: PSSL3_ENC_METHOD; - ssl_version: function : TIdC_INT; cdecl; - ssl_callback_ctrl: function(s: PSSL; cb_id: TIdC_INT; fp: SSL_METHOD_PROC): TIdC_LONG; cdecl; - ssl_ctx_callback_ctrl: function(s: PSSL_CTX; cb_id:TIdC_INT; fp: SSL_METHOD_PROC): TIdC_LONG; cdecl; - end; - {$EXTERNALSYM PPSSL_METHOD} - PPSSL_METHOD =^PSSL_METHOD; -// This callback type is used inside SSL_CTX, SSL, and in the functions that set -// them. It is used to override the generation of SSL/TLS session IDs in a -// server. Return value should be zero on an error, non-zero to proceed. Also, -// callbacks should themselves check if the id they generate is unique otherwise -// the SSL handshake will fail with an error - callbacks can do this using the -// 'ssl' value they're passed by; -// SSL_has_matching_session_id(ssl, id, *id_len) -// The length value passed in is set at the maximum size the session ID can be. -// In SSLv2 this is 16 bytes, whereas SSLv3/TLSv1 it is 32 bytes. The callback -// can alter this length to be less if desired, but under SSLv2 session IDs are -// supposed to be fixed at 16 bytes so the id will be padded after the callback -// returns in this case. It is also an error for the callback to set the size to -// zero. - {$EXTERNALSYM PGEN_SESSION_CB} - PGEN_SESSION_CB = function (const SSL : PSSL; id : PByte; id_len : TIdC_UINT) : TIdC_INT; cdecl; - {$EXTERNALSYM SSL_COMP} - SSL_COMP = record - id : TIdC_INT; - name : PIdAnsiChar; - {$IFNDEF OPENSSL_NO_COMP} - method : PCOMP_METHOD; - {$ELSE} - method : PIdAnsiChar; - {$ENDIF} - end; - {$IFDEF DEBUG_SAFESTACK} - {$EXTERNALSYM STACK_OF_COMP} - STACK_OF_COMP = record - _stack: stack; - end; - {$EXTERNALSYM PSTACK_OF_COMP} - PSTACK_OF_COMP = ^STACK_OF_COMP; - {$ELSE} - //I think the DECLARE_STACK_OF macro is empty - {$EXTERNALSYM PSTACK_OF_COMP} - PSTACK_OF_COMP = PSTACK; - {$ENDIF} - - {$EXTERNALSYM PSSL_CTEX_tlsext_servername_callback} - PSSL_CTEX_tlsext_servername_callback = function(ssl : PSSL; Para1 : TIdC_INT; Para2 : Pointer) : TIdC_INT; cdecl; - {$EXTERNALSYM PSSL_CTX_info_callback} - PSSL_CTX_info_callback = procedure (const ssl : PSSL; _type, val : TIdC_INT); cdecl; // used if SSL's info_callback is NULL -//int (*tlsext_ticket_key_cb)(SSL *ssl, -// unsigned char *name, unsigned char *iv, -// EVP_CIPHER_CTX *ectx, -// HMAC_CTX *hctx, int enc); - {$EXTERNALSYM Ptlsext_ticket_key_cb} - Ptlsext_ticket_key_cb = function (ssl : PSSL; name, iv : PIdAnsiChar; - ectx : PEVP_CIPHER_CTX; - hctx : PHMAC_CTX; enc : TIdC_INT) : TIdC_INT; cdecl; -// int (*tlsext_status_cb)(SSL *ssl, void *arg); - {$EXTERNALSYM Ptlsext_status_cb} - Ptlsext_status_cb = function (ssl : PSSL; arg : Pointer) : TIdC_INT; cdecl; - {$EXTERNALSYM SSL_CTX_stats} - SSL_CTX_stats = record - sess_connect: TIdC_INT; // SSL new conn - started - sess_connect_renegotiate: TIdC_INT; // SSL reneg - requested - sess_connect_good: TIdC_INT; // SSL new conne/reneg - finished - sess_accept: TIdC_INT; // SSL new accept - started - sess_accept_renegotiate: TIdC_INT; // SSL reneg - requested - sess_accept_good: TIdC_INT; // SSL accept/reneg - finished - sess_miss: TIdC_INT; // session lookup misses - sess_timeout: TIdC_INT; // reuse attempt on timeouted session - sess_cache_full: TIdC_INT; // session removed due to full cache - sess_hit: TIdC_INT; // session reuse actually done - sess_cb_hit: TIdC_INT; // session-id that was not - // in the cache was - // passed back via the callback. This - // indicates that the application is - // supplying session-id's from other - // processes - spooky :-) - end; - {$EXTERNALSYM lash_of_SSL_SESSION} - lash_of_SSL_SESSION = record - dummy : TIdC_INT; - end; - {$EXTERNALSYM Plash_of_SSL_SESSION} - Plash_of_SSL_SESSION = ^lash_of_SSL_SESSION; -{$ifndef OPENSSL_NO_BUF_FREELISTS} - {$EXTERNALSYM Pssl3_buf_freelist_st} - Pssl3_buf_freelist_st = Pointer; -{$endif} - - {$IFDEF DEBUG_SAFESTACK} - {$EXTERNALSYM STACK_OF_SRTP_PROTECTION_PROFILE} - STACK_OF_SRTP_PROTECTION_PROFILE = record - _stack: stack; - end; - {$EXTERNALSYM PSTACK_OF_SRTP_PROTECTION_PROFILE} - PSTACK_OF_SRTP_PROTECTION_PROFILE = ^STACK_OF_SRTP_PROTECTION_PROFILE; - {$ELSE} - //I think the DECLARE_STACK_OF macro is empty - {$EXTERNALSYM PSTACK_OF_SRTP_PROTECTION_PROFILE} - PSTACK_OF_SRTP_PROTECTION_PROFILE = PSTACK; - {$ENDIF} - {$NODEFINE SSL_CTX} - SSL_CTX = record - method: PSSL_METHOD; - cipher_list: PSTACK_OF_SSL_CIPHER; - // same as above but sorted for lookup - cipher_list_by_id: PSTACK_OF_SSL_CIPHER; - cert_store: PX509_STORE; - sessions: Plash_of_SSL_SESSION; - // a set of SSL_SESSIONs - // Most session-ids that will be cached, default is - // SSL_SESSION_CACHE_MAX_SIZE_DEFAULT. 0 is unlimited. - session_cache_size: TIdC_ULONG; - session_cache_head: PSSL_SESSION; - session_cache_tail: PSSL_SESSION; - // This can have one of 2 values, ored together, - // SSL_SESS_CACHE_CLIENT, - // SSL_SESS_CACHE_SERVER, - // Default is SSL_SESSION_CACHE_SERVER, which means only - // SSL_accept which cache SSL_SESSIONS. - session_cache_mode: TIdC_INT; - session_timeout: TIdC_LONG; - // If this callback is not null, it will be called each - // time a session id is added to the cache. If this function - // returns 1, it means that the callback will do a - // SSL_SESSION_free() when it has finished using it. Otherwise, - // on 0, it means the callback has finished with it. - // If remove_session_cb is not null, it will be called when - // a session-id is removed from the cache. After the call, - // OpenSSL will SSL_SESSION_free() it. - new_session_cb: function (ssl : PSSL; sess: PSSL_SESSION): TIdC_INT; cdecl; - remove_session_cb: procedure (ctx : PSSL_CTX; sess : PSSL_SESSION); cdecl; - get_session_cb: function (ssl : PSSL; data : PByte; len: TIdC_INT; copy : PIdC_INT) : PSSL_SESSION; cdecl; - stats : SSL_CTX_stats; - - references: TIdC_INT; - // if defined, these override the X509_verify_cert() calls - app_verify_callback: function (_para1 : PX509_STORE_CTX; _para2 : Pointer) : TIdC_INT; cdecl; - app_verify_arg: Pointer; - // before OpenSSL 0.9.7, 'app_verify_arg' was ignored - // ('app_verify_callback' was called with just one argument) - // Default password callback. - default_passwd_callback: ppem_password_cb; - // Default password callback user data. - default_passwd_callback_userdata: Pointer; - // get client cert callback - client_cert_cb: function (SSL : PSSL; x509 : PPX509; pkey : PPEVP_PKEY) : TIdC_INT; cdecl; - // verify cookie callback - app_gen_cookie_cb: function (ssl : PSSL; cookie : PByte; cookie_len : TIdC_UINT) : TIdC_INT; cdecl; - app_verify_cookie_cb: Pointer; - ex_data : CRYPTO_EX_DATA; - rsa_md5 : PEVP_MD; // For SSLv2 - name is 'ssl2-md5' - md5: PEVP_MD; // For SSLv3/TLSv1 'ssl3-md5' - sha1: PEVP_MD; // For SSLv3/TLSv1 'ssl3->sha1' - extra_certs: PSTACK_OF_X509; - comp_methods: PSTACK_OF_COMP; // stack of SSL_COMP, SSLv3/TLSv1 - // Default values used when no per-SSL value is defined follow - info_callback: PSSL_CTX_info_callback; // used if SSL's info_callback is NULL - // what we put in client cert requests - client_CA : PSTACK_OF_X509_NAME; - // Default values to use in SSL structures follow (these are copied by SSL_new) - options : TIdC_ULONG; - mode : TIdC_ULONG; - max_cert_list : TIdC_LONG; - cert : PCERT; - read_ahead : TIdC_INT; - // callback that allows applications to peek at protocol messages - msg_callback : procedure (write_p, version, content_type : TIdC_INT; const buf : Pointer; len : size_t; ssl : PSSL; arg : Pointer); cdecl; - msg_callback_arg : Pointer; - verify_mode : TIdC_INT; - sid_ctx_length : TIdC_UINT; - sid_ctx : array[0..SSL_MAX_SID_CTX_LENGTH - 1] of TIdAnsiChar; - default_verify_callback : function(ok : TIdC_INT; ctx : PX509_STORE_CTX) : TIdC_INT; cdecl; // called 'verify_callback' in the SSL - // Default generate session ID callback. - generate_session_id : PGEN_SESSION_CB; - param : PX509_VERIFY_PARAM; - {$IFDEF OMIT_THIS} - purpose : TIdC_INT; // Purpose setting - trust : TIdC_INT; // Trust setting - {$ENDIF} - - quiet_shutdown : TIdC_INT; - //* Maximum amount of data to send in one fragment. - // * actual record size can be more than this due to - // * padding and MAC overheads. - // */ - max_send_fragment : TIdC_UINT; - {$IFNDEF OPENSSL_ENGINE} - ///* Engine to pass requests for client certs to - // */ - client_cert_engine : PENGINE; - {$ENDIF} - {$IFNDEF OPENSSL_NO_TLSEXT} -//* TLS extensions servername callback */ - tlsext_servername_callback : PSSL_CTEX_tlsext_servername_callback; - tlsext_servername_arg : Pointer; - //* RFC 4507 session ticket keys */ - tlsext_tick_key_name : array [0..(16-1)] of TIdAnsiChar; - tlsext_tick_hmac_key : array [0..(16-1)] of TIdAnsiChar; - tlsext_tick_aes_key : array [0..(16-1)] of TIdAnsiChar; - //* Callback to support customisation of ticket key setting */ - // int (*tlsext_ticket_key_cb)(SSL *ssl, - // unsigned char *name, unsigned char *iv, - // EVP_CIPHER_CTX *ectx, - // HMAC_CTX *hctx, int enc); - tlsext_ticket_key_cb : Ptlsext_ticket_key_cb; - //* certificate status request info */ - //* Callback for status request */ - //int (*tlsext_status_cb)(SSL *ssl, void *arg); - tlsext_status_cb : Ptlsext_status_cb; - tlsext_status_arg : Pointer; - {$ENDIF} - //* draft-rescorla-tls-opaque-prf-input-00.txt information */ - tlsext_opaque_prf_input_callback : function(para1 : PSSL; peerinput : Pointer; len : size_t; arg : Pointer ) : TIdC_INT cdecl; - //int (*tlsext_opaque_prf_input_callback)(SSL *, void *peerinput, size_t len, void *arg); - tlsext_opaque_prf_input_callback_arg : Pointer; - -{$ifndef OPENSSL_NO_PSK} - psk_identity_hint : PIdAnsiChar; - psk_client_callback : function (ssl : PSSL; hint : PIdAnsiChar; - identity : PIdAnsiChar; max_identity_len : TIdC_UINT; - psk : PIdAnsiChar; max_psk_len : TIdC_UINT ) : TIdC_UINT cdecl; - // unsigned int (*psk_client_callback)(SSL *ssl, const char *hint, char *identity, -// unsigned int max_identity_len, unsigned char *psk, -// unsigned int max_psk_len); - psk_server_callback : function (ssl : PSSL; identity, psk : PIdAnsiChar; max_psk_len : TIdC_UINT) : TIdC_UINT cdecl; -// unsigned int (*psk_server_callback)(SSL *ssl, const char *identity, -// unsigned char *psk, unsigned int max_psk_len); -{$endif} - -{$ifndef OPENSSL_NO_BUF_FREELISTS} - freelist_max_len : TIdC_UINT; - wbuf_freelist : Pssl3_buf_freelist_st; - rbuf_freelist : Pssl3_buf_freelist_st; -{$endif} -{$ifndef OPENSSL_NO_SRP} - srp_ctx : SRP_CTX; //* ctx for SRP authentication */ -{$endif} - -{$ifndef OPENSSL_NO_TLSEXT} -//# ifndef OPENSSL_NO_NEXTPROTONEG - //* Next protocol negotiation information */ - //* (for experimental NPN extension). */ - - //* For a server, this contains a callback function by which the set of - // * advertised protocols can be provided. */ - next_protos_advertised_cb : function(s : PSSL; out but : PIdAnsiChar; - out len : TIdC_UINT; arg : Pointer) : TIdC_INT cdecl; -// int (*next_protos_advertised_cb)(SSL *s, const unsigned char **buf, -// unsigned int *len, void *arg); - next_protos_advertised_cb_arg : Pointer; - //* For a client, this contains a callback function that selects the - // * next protocol from the list provided by the server. */ - next_proto_select_cb : function(s : PSSL; out _out : PIdAnsiChar; - outlen : PIdAnsiChar; - _in : PIdAnsiChar; - inlen : TIdC_UINT; - arg : Pointer) : TIdC_INT cdecl; -// int (*next_proto_select_cb)(SSL *s, unsigned char **out, -// unsigned char *outlen, -// const unsigned char *in, -// unsigned int inlen, -// void *arg); - next_proto_select_cb_arg : Pointer; -//# endif - //* SRTP profiles we are willing to do from RFC 5764 */ - srtp_profiles : PSTACK_OF_SRTP_PROTECTION_PROFILE; -{$endif} - end; - {$EXTERNALSYM PSSL2_STATE} - PSSL2_STATE = ^SSL2_STATE; - {$EXTERNALSYM PSSL3_STATE} - PSSL3_STATE = ^SSL3_STATE; - {$EXTERNALSYM PDTLS1_STATE} - PDTLS1_STATE = ^DTLS1_STATE; -//* TLS extension debug callback */ - {$EXTERNALSYM PSSL_tlsext_debug_cb} - PSSL_tlsext_debug_cb = procedure (s : PSSL; client_server : TIdC_INT; - _type : TIdC_INT; data : PIdAnsiChar; len : TIdC_INT; arg : Pointer); cdecl; - {$NODEFINE SSL} - SSL = record - // protocol version - // (one of SSL2_VERSION, SSL3_VERSION, TLS1_VERSION, DTLS1_VERSION) - version : TIdC_INT; - _type : TIdC_INT; //* SSL_ST_CONNECT or SSL_ST_ACCEPT */ - method : PSSL_METHOD; //* SSLv3 */ - // There are 2 BIO's even though they are normally both the - // same. This is so data can be read and written to different - // handlers - {$IFNDEF OPENSSL_NO_BIO} - rbio : PBIO; // used by SSL_read - wbio : PBIO; // used by SSL_write - bbio : PBIO; // used during session-id reuse to concatenate messages - {$ELSE} - rbio : PIdAnsiChar; // used by SSL_read - wbio : PIdAnsiChar; // used by SSL_write - bbio : PIdAnsiChar; - {$ENDIF} - // This holds a variable that indicates what we were doing - // when a 0 or -1 is returned. This is needed for - // non-blocking IO so we know what request needs re-doing when - // in SSL_accept or SSL_connect - rwstate : TIdC_INT; - // true when we are actually in SSL_accept() or SSL_connect() - in_handshake : TIdC_INT; - handshake_func : function (_para1 : PSSL) : TIdC_INT; cdecl; - // Imagine that here's a boolean member "init" that is - // switched as soon as SSL_set_{accept/connect}_state - // is called for the first time, so that "state" and - // handshake_func" are properly initialized. But as - // handshake_func is == 0 until then, we use this - // test instead of an "init" member. - server : TIdC_INT; // are we the server side? - mostly used by SSL_clear - new_session : TIdC_INT;//* Generate a new session or reuse an old one. - //* NB: For servers, the 'new' session may actually be a previously - //* cached session or even the previous session unless - //* SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION is set */ - quiet_shutdown : TIdC_INT; // don't send shutdown packets - shutdown : TIdC_INT; // we have shut things down, 0x01 sent, 0x02 - // for received - state : TIdC_INT; // where we are - rstate : TIdC_INT; // where we are when reading - init_buf : PBUF_MEM; // buffer used during init - init_msg : Pointer; // pointer to handshake message body, set by ssl3_get_message() - init_num : TIdC_INT; // amount read/written - init_off : TIdC_INT; // amount read/written - // used internally to point at a raw packet - packet : PIdAnsiChar; - packet_length : TIdC_UINT; - s2 : Pssl2_state; // SSLv2 variables - s3 : Pssl3_state; // SSLv3 variables - d1 : Pdtls1_state; // DTLSv1 variables - read_ahead : TIdC_INT; // Read as many input bytes as possible (for non-blocking reads) - // callback that allows applications to peek at protocol messages - msg_callback : procedure(write_p, version, content_type : TIdC_INT; - const buf : Pointer; len : size_t; ssl : PSSL; arg : Pointer); cdecl; - msg_callback_arg : Pointer; - hit : TIdC_INT; //* reusing a previous session */ - param : PX509_VERIFY_PARAM; - {$IFDEF OMIT_THIS} - purpose : TIdC_INT; // Purpose setting - trust : TIdC_INT; // Trust setting - {$ENDIF} - // crypto - cipher_list : PSTACK_OF_SSL_CIPHER; - cipher_list_by_id : PSTACK_OF_SSL_CIPHER; - - //* These are the ones being used, the ones in SSL_SESSION are - // * the ones to be 'copied' into these ones */ - mac_flags : TIdC_INT; - // These are the ones being used, the ones in SSL_SESSION are - // the ones to be 'copied' into these ones - enc_read_ctx : PEVP_CIPHER_CTX; // cryptographic state - read_hash : PEVP_MD_CTX; // used for mac generation - {$IFNDEF OPENSSL_NO_COMP} - expand : PCOMP_CTX; // uncompress - {$ELSE} - expand : PIdAnsiChar; - {$ENDIF} - enc_write_ctx : PEVP_CIPHER_CTX; // cryptographic state - write_hash : PEVP_MD_CTX; // used for mac generation - {$IFNDEF OPENSSL_NO_COMP} - compress : PCOMP_CTX; // compression - {$ELSE} - compress : PIdAnsiChar; - {$ENDIF} - // session info - // client cert? - // This is used to hold the server certificate used - cert : PCERT; - // the session_id_context is used to ensure sessions are only reused - // in the appropriate context - sid_ctx_length : TIdC_UINT; - sid_ctx : array [0..SSL_MAX_SID_CTX_LENGTH -1] of TIdAnsiChar; - // This can also be in the session once a session is established - session : PSSL_SESSION; - // Default generate session ID callback. - generate_session_id : PGEN_SESSION_CB; - // Used in SSL2 and SSL3 - verify_mode : TIdC_INT; // 0 don't care about verify failure. - // 1 fail if verify fails - verify_callback : function (ok : TIdC_INT; ctx : PX509_STORE_CTX) : TIdC_INT; cdecl; // fail if callback returns 0 - info_callback : procedure(const ssl : PSSL; _type, val : TIdC_INT) ; cdecl; - error : TIdC_INT; // error bytes to be written - error_code : TIdC_INT; // actual code - {$IFNDEF OPENSSL_NO_KRB5} - kssl_ctx : PKSSL_CTX; // Kerberos 5 context - {$ENDIF} -{$ifndef OPENSSL_NO_PSK} - psk_client_callback : function(ssl : PSSL; hint : PIdAnsiChar; - identity : PIdAnsiChar; - max_identity_len : TIdC_UINT; - psk : PIdAnsiChar; - max_psk_len : TIdC_UINT) : TIdC_UINT cdecl; -// unsigned int (*psk_client_callback)(SSL *ssl, const char *hint, char *identity, -// unsigned int max_identity_len, unsigned char *psk, -// unsigned int max_psk_len); - psk_server_callback : function(ssl : PSSL; identity : PIdAnsiChar; - psk : PIdAnsiChar; max_psk_len : TIdC_UINT) : TIdC_UINT cdecl; -// unsigned int (*psk_server_callback)(SSL *ssl, const char *identity, -// unsigned char *psk, unsigned int max_psk_len); -{$endif} - ctx : PSSL_CTX; - // set this flag to 1 and a sleep(1) is put into all SSL_read() - // and SSL_write() calls, good for nbio debuging :-) - debug : TIdC_INT; - // extra application data - verify_result : TIdC_LONG; - ex_data : CRYPTO_EX_DATA; - // for server side, keep the list of CA_dn we can use - client_CA : PSTACK_OF_X509_NAME; - references : TIdC_INT; - options : TIdC_ULONG; // protocol behaviour - mode : TIdC_ULONG; // API behaviour - max_cert_list : TIdC_LONG; - first_packet : TIdC_INT; - client_version : TIdC_INT; // what was passed, used for - // SSLv3/TLS rollback check - max_send_fragment : TIdC_UINT; - {$IFNDEF OPENSSL_NO_TLSEXT} - //* TLS extension debug callback */ - tlsext_debug_cb : PSSL_tlsext_debug_cb; - tlsext_debug_arg : Pointer; - tlsext_hostname : PIdAnsiChar; - servername_done : TIdC_INT; //* no further mod of servername - // 0 : call the servername extension callback. - // 1 : prepare 2, allow last ack just after in server callback. - // 2 : don't call servername callback, no ack in server hello - //*/ - //* certificate status request info */ - //* Status type or -1 if no status type */ - tlsext_status_type : TIdC_INT; - //* Expect OCSP CertificateStatus message */ - tlsext_status_expected : TIdC_INT; - -{$ifndef OPENSSL_NO_EC} - tlsext_ecpointformatlist_length : size_t; - tlsext_ecpointformatlist : PIdAnsiChar; //* our list */ - tlsext_ellipticcurvelist_length : size_t; - tlsext_ellipticcurvelist : PIdAnsiChar; //* our list */ -{$endif} //* OPENSSL_NO_EC */ - - - //* draft-rescorla-tls-opaque-prf-input-00.txt information to be used for handshakes */ - tlsext_opaque_prf_input : Pointer; - tlsext_opaque_prf_input_len : size_t; - - //* TLS Session Ticket extension override */ - tlsext_session_ticket : PTLS_SESSION_TICKET_EXT; - - //* TLS Session Ticket extension callback */ - tls_session_ticket_ext_cb : tls_session_ticket_ext_cb_fn; - tls_session_ticket_ext_cb_arg : Pointer; - - //* TLS pre-shared secret session resumption */ - tls_session_secret_cb : tls_session_secret_cb_fn; - tls_session_secret_cb_arg : Pointer; - - initial_ctx : PSSL_CTX; //* initial ctx, used to store sessions */ - -{$ifndef OPENSSL_NO_NEXTPROTONEG} - ///* Next protocol negotiation. For the client, this is the protocol that - // * we sent in NextProtocol and is set when handling ServerHello - // * extensions. - // * - // * For a server, this is the client's selected_protocol from - // * NextProtocol and is set when handling the NextProtocol message, - // * before the Finished message. */ - next_proto_negotiated : PIdAnsiChar; - next_proto_negotiated_len : Byte; -{$endif} - - //* OCSP status request only */ - tlsext_ocsp_ids : PSTACK_OF_OCSP_RESPID;//STACK_OF(OCSP_RESPID) *tlsext_ocsp_ids; - tlsext_ocsp_exts : PX509_EXTENSIONS; - //* OCSP response received or to be sent */ - tlsext_ocsp_resp : PIdAnsiChar; - tlsext_ocsp_resplen : TIdC_INT; - //* RFC4507 session ticket expected to be received or sent */ - tlsext_ticket_expected : TIdC_INT; - _initial_ctx : PSSL_CTX; //* initial ctx, used to store sessions */ - {$DEFINE session_ctx} - {$DEFINE initial_ctx} -{$ELSE} - {$DEFINE ctx} - {$DEFINE session_ctx} -{$ENDIF} - end; - //ssl2.h - {$EXTERNALSYM SSL2_STATE} - SSL2_STATE = record - three_byte_header : TIdC_INT; - clear_text : TIdC_INT; // clear text - escape : TIdC_INT; // not used in SSLv2 - ssl2_rollback : TIdC_INT; // used if SSLv23 rolled back to SSLv2 - // non-blocking io info, used to make sure the same - // args were passwd - wnum : TIdC_UINT; // number of bytes sent so far - wpend_tot : TIdC_INT; - wpend_buf : PByte; - wpend_off : TIdC_INT; // offset to data to write - wpend_len : TIdC_INT; // number of bytes passwd to write - wpend_ret : TIdC_INT; // number of bytes to return to caller - // buffer raw data - rbuf_left : TIdC_INT; - rbuf_offs : TIdC_INT; - rbuf : PIdAnsiChar; - wbuf : PIdAnsiChar; - write_ptr : PIdAnsiChar; // used to point to the start due to 2/3 byte header. */ - padding : TIdC_UINT; - rlength : TIdC_UINT; // passed to ssl2_enc - ract_data_length : TIdC_INT; // Set when things are encrypted. - wlength : TIdC_UINT; // passed to ssl2_enc - wact_data_length : TIdC_INT; // Set when things are decrypted. - ract_data : PIdAnsiChar; - wact_data : PIdAnsiChar; - mac_data : PIdAnsiChar; - read_key : PIdAnsiChar; - write_key : PIdAnsiChar; - // Stuff specifically to do with this SSL session - challenge_length : TIdC_UINT; - challenge : array [0..SSL2_MAX_CHALLENGE_LENGTH -1] of TIdAnsiChar; - conn_id_length : TIdC_UINT; - conn_id : array [0..SSL2_MAX_CONNECTION_ID_LENGTH -1] of TIdAnsiChar; - key_material_length : TIdC_UINT; - key_material : array[0..(SSL2_MAX_KEY_MATERIAL_LENGTH*2)-1] of TIdAnsiChar; - read_sequence : TIdC_ULONG; - write_sequence : TIdC_ULONG; - tmp_conn_id_length : TIdC_UINT; - tmp_cert_type : TIdC_UINT; - tmp_cert_length : TIdC_UINT; - tmp_csl : TIdC_UINT; - tmp_clear : TIdC_UINT; - tmp_enc : TIdC_UINT; - tmp_ccl : array [0..SSL2_MAX_CERT_CHALLENGE_LENGTH -1] of TIdAnsiChar; - tmp_cipher_spec_length : TIdC_UINT; - tmp_session_id_length : TIdC_UINT; - tmp_clen : TIdC_UINT; - tmp_rlen : TIdC_UINT; - end; - //sl3.h - {$IFNDEF OPENSSL_NO_SSL_INTERN} - {$EXTERNALSYM PSSL3_RECORD} - PSSL3_RECORD = ^SSL3_RECORD; - {$EXTERNALSYM SSL3_RECORD} - SSL3_RECORD = record - {*r *} _type : TIdC_INT; // type of record - {*rw*} length : TIdC_UINT; // How many bytes available - {*r *} off : TIdC_UINT; // read/write offset into 'buf' - {*rw*} data : PIdAnsiChar; // pointer to the record data - {*rw*} input : PIdAnsiChar; // where the decode bytes are - {*r *} comp : PIdAnsiChar; // only used with decompression - malloc()ed - {*r *} epoch : TIdC_ULONG; // epoch number, needed by DTLS1 - {*r *} seq_num : array [0..7] of Byte; //* sequence number, needed by DTLS1 */ - end; - {$EXTERNALSYM PSSL3_BUFFER} - PSSL3_BUFFER = ^SSL3_BUFFER; - {$EXTERNALSYM SSL3_BUFFER} - SSL3_BUFFER = record - buf : PIdAnsiChar; // at least SSL3_RT_MAX_PACKET_SIZE bytes, - // see ssl3_setup_buffers() - len : size_t; // buffer size - offset : TIdC_INT; // where to 'copy from' - left : TIdC_INT; // how many bytes left - end; - - {$EXTERNALSYM SSL3_STATE} - SSL3_STATE = record - flags : TIdC_LONG; - delay_buf_pop_ret : TIdC_INT; - - read_sequence : array [0..7] of TIdAnsiChar; - read_mac_secret_size : TIdC_INT; - read_mac_secret : array [0..EVP_MAX_MD_SIZE -1] of TIdAnsiChar; - write_sequence : array [0..7] of TIdAnsiChar; - write_mac_secret_size : TIdC_INT; - write_mac_secret : array [0..EVP_MAX_MD_SIZE - 1] of TIdAnsiChar; - server_random : array [0..SSL3_RANDOM_SIZE - 1] of TIdAnsiChar; - client_random : array [0..SSL3_RANDOM_SIZE -1] of TIdAnsiChar; - // flags for countermeasure against known-IV weakness - need_empty_fragments : TIdC_INT; - empty_fragment_done : TIdC_INT; - - //* The value of 'extra' when the buffers were initialized */ - init_extra : TIdC_INT; - rbuf : PSSL3_BUFFER; //* read IO goes into here */ - wbuf : PSSL3_BUFFER; //* write IO goes into here */ - rrec : PSSL3_RECORD; //* each decoded record goes in here */ - wrec : PSSL3_RECORD; //* goes out from here */ - // storage for Alert/Handshake protocol data received but not - // yet processed by ssl3_read_bytes: - alert_fragment : array [0..1] of PIdAnsiChar; - alert_fragment_len : TIdC_UINT; - handshake_fragment : array [0..3] of PIdAnsiChar; - handshake_fragment_len : TIdC_UINT; - // partial write - check the numbers match - wnum : TIdC_UINT; // number of bytes sent so far - wpend_tot : TIdC_INT; // number bytes written - wpend_type : TIdC_INT; - wpend_ret : TIdC_INT; // number of bytes submitted - wpend_buf : PByte; - // used during startup, digest all incoming/outgoing packets */ - handshake_buffer : PBIO; - //* When set of handshake digests is determined, buffer is hashed - // * and freed and MD_CTX-es for all required digests are stored in - // * this array */ - handshake_dgst : PPEVP_MD_CTX; - - finish_dgst2 : PEVP_MD_CTX; - // this is set whenerver we see a change_cipher_spec message - // come in when we are not looking for one - change_cipher_spec : TIdC_INT; - warn_alert : TIdC_INT; - fatal_alert : TIdC_INT; - // we allow one fatal and one warning alert to be outstanding, - // send close alert via the warning alert */ - alert_dispatch : TIdC_INT; - send_alert : array [0..1] of TIdAnsiChar; - // This flag is set when we should renegotiate ASAP, basically when - // there is no more data in the read or write buffers - renegotiate : TIdC_INT; - total_renegotiations : TIdC_INT; - num_renegotiations : TIdC_INT; - in_read_app_data : TIdC_INT; - - //* Opaque PRF input as used for the current handshake. - // * These fields are used only if TLSEXT_TYPE_opaque_prf_input is defined - // * (otherwise, they are merely present to improve binary compatibility) */ - client_opaque_prf_input : Pointer; - client_opaque_prf_input_len : size_t; - server_opaque_prf_input : Pointer; - server_opaque_prf_input_len : size_t; - // actually only needs to be 16+20 - tmp_cert_verify_md: array [0..(EVP_MAX_MD_SIZE*2)-1] of TIdAnsiChar; - // actually only need to be 16+20 for SSLv3 and 12 for TLS - tmp_finish_md : array[0..(EVP_MAX_MD_SIZE*2)-1] of TIdAnsiChar; - tmp_finish_md_len : TIdC_INT; - tmp_peer_finish_md : array[0..(EVP_MAX_MD_SIZE*2)-1] of TIdAnsiChar; - tmp_peer_finish_md_len : TIdC_INT; - tmp_message_size : TIdC_UINT; - tmp_message_type : TIdC_INT; - // used to hold the new cipher we are going to use - tmp_new_cipher : PSSL_CIPHER; - {$IFNDEF OPENSSL_NO_DH} - tmp_dh : PDH; - {$ENDIF} - {$IFNDEF OPENSSL_NO_ECDH} - tmp_ecdh : PEC_KEY; // holds short lived ECDH key - {$ENDIF} - // used when SSL_ST_FLUSH_DATA is entered - tmp_next_state : TIdC_INT; - tmp_reuse_message : TIdC_INT; - // used for certificate requests - tmp_cert_req : TIdC_INT; - tmp_ctype_num : TIdC_INT; - tmp_ctype : array [0..SSL3_CT_NUMBER -1] of TIdAnsiChar; - tmp_ca_names : PSTACK_OF_X509_NAME; - tmp_use_rsa_tmp : TIdC_INT; - tmp_key_block_length : TIdC_INT; - tmp_key_block : PIdAnsiChar; - tmp_new_sym_enc : PEVP_CIPHER; - tmp_new_hash : PEVP_MD; - new_mac_pkey_type : TIdC_INT; - new_mac_secret_size : TIdC_INT; - {$IFNDEF OPENSSL_NO_COMP} - tmp_new_compression : PSSL_COMP; - {$ELSE} - tmp_new_compression : PIdAnsiChar; - {$ENDIF} - tmp_cert_request : TIdC_INT; - - //* Connection binding to prevent renegotiation attacks */ - previous_client_finished : array [0..EVP_MAX_MD_SIZE - 1] of TIdAnsiChar; - previous_client_finished_len : Byte; - previous_server_finished : array [0..EVP_MAX_MD_SIZE - 1] of TIdAnsiChar; - previous_server_finished_len : Byte; - send_connection_binding : TIdC_INT; //* TODOEKR */ -{$ifndef OPENSSL_NO_NEXTPROTONEG} - //* Set if we saw the Next Protocol Negotiation extension from our peer. */ - next_proto_neg_seen : TIdC_INT; -{$endif} - end; - {$ENDIF} - //openssl/pq_compat.h - {$EXTERNALSYM ppitem} - ppitem = ^pitem; - {$EXTERNALSYM pitem} - pitem = record - priority : PQ_64BIT; - data : Pointer; - next : ppitem; - end; - //ssl/dtls1.h - //for some reason, this header is refering to crypto/pqueue/pqueue.c - //which is in the OpenSSL headers. - {$EXTERNALSYM pqueue} - pqueue = record - items : ppitem; - count : TIdC_INT; - end; - // - {$EXTERNALSYM dtls1_retransmit_state} - dtls1_retransmit_state = record - enc_write_ctx : PEVP_CIPHER_CTX; //* cryptographic state */ - write_hash : PEVP_MD; //* used for mac generation */ -{$IFNDEF OPENSSL_NO_COMP} - compress : COMP_CTX; //* compression */ -{$ELSE} - compress : PIdAnsiChar; -{$ENDIF} - session : PSSL_SESSION; - epoch : TIdC_USHORT; - end; - {$EXTERNALSYM Pdtls1_retransmit_state} - Pdtls1_retransmit_state = ^dtls1_retransmit_state; - {$EXTERNALSYM DTLS1_BITMAP} - DTLS1_BITMAP = record - map : PQ_64BIT; - length : TIdC_ULONG; // sizeof the bitmap in bits - max_seq_num : PQ_64BIT; // max record number seen so far - end; - {$EXTERNALSYM PDTLS1_BITMAP} - PDTLS1_BITMAP = ^DTLS1_BITMAP; - {$EXTERNALSYM hm_header} - hm_header = record - _type : PIdAnsiChar; - msg_len : TIdC_ULONG; - seq : TIdC_USHORT; - frag_off : TIdC_ULONG; - frag_len : TIdC_ULONG; - is_ccs : TIdC_UINT; - // struct dtls1_retransmit_state saved_retransmit_state; - saved_retransmit_state : dtls1_retransmit_state; - end; - {$EXTERNALSYM ccs_header_st} - ccs_header_st = record - _type : PIdAnsiChar; - seq : TIdC_USHORT; - end; - {$EXTERNALSYM dtls1_timeout_st} - dtls1_timeout_st = record - // Number of read timeouts so far - read_timeouts : TIdC_UINT; - // Number of write timeouts so far - write_timeouts : TIdC_UINT; - // Number of alerts received so far - num_alerts : TIdC_UINT; - end; - {$EXTERNALSYM record_pqueue} - record_pqueue = record - epoch : TIdC_USHORT; - q : pqueue; - end; - {$EXTERNALSYM hm_fragment} - hm_fragment = record - msg_header : hm_header; - fragment : PIdAnsiChar; - reassembly : PIdAnsiChar; - end; - {$EXTERNALSYM DTLS1_STATE} - DTLS1_STATE = record - send_cookie : TIdC_UINT; - cookie : array [0..DTLS1_COOKIE_LENGTH - 1 ] of TIdAnsiChar; - rcvd_cookie : array [0..DTLS1_COOKIE_LENGTH -1] of TIdAnsiChar; - cookie_len : TIdC_UINT; - // The current data and handshake epoch. This is initially - // undefined, and starts at zero once the initial handshake is - // completed - r_epoch : TIdC_USHORT; - w_epoch : TIdC_USHORT; - // records being received in the current epoch - bitmap : DTLS1_BITMAP; - // renegotiation starts a new set of sequence numbers - next_bitmap : DTLS1_BITMAP; - // handshake message numbers - handshake_write_seq : TIdC_USHORT; - next_handshake_write_seq : TIdC_USHORT; - handshake_read_seq : TIdC_USHORT; - //* save last sequence number for retransmissions */ - last_write_sequence : array [0..8-1] of byte; - - // Received handshake records (processed and unprocessed) - unprocessed_rcds : record_pqueue; - processed_rcds : record_pqueue; - // Buffered handshake messages - buffered_messages : pqueue; - // Buffered (sent) handshake records - sent_messages : pqueue; - ///* Buffered application records. - //* Only for records between CCS and Finished - //* to prevent either protocol violation or - //* unnecessary message loss. - //*/ - buffered_app_data : record_pqueue; - - ///* Is set when listening for new connections with dtls1_listen() */ - listen : TIdC_UINT; - - mtu : TIdC_UINT; // max wire packet size - w_msg_hdr : hm_header; - r_msg_hdr : hm_header; - timeout : dtls1_timeout_st; - //* Indicates when the last handshake msg sent will timeout */ - next_timeout : timeval; - - //* Timeout duration */ - timeout_duration : TIdC_USHORT; - - // storage for Alert/Handshake protocol data received but not - // yet processed by ssl3_read_bytes: - alert_fragment : array [0..DTLS1_AL_HEADER_LENGTH-1] of TIdAnsiChar; - alert_fragment_len : TIdC_UINT; - handshake_fragment : array[0..DTLS1_HM_HEADER_LENGTH -1] of TIdAnsiChar; - handshake_fragment_len : TIdC_UINT; - retransmitting : TIdC_UINT; - change_cipher_spec_ok : TIdC_UINT; - end; - - {$EXTERNALSYM X509V3_CTX} - X509V3_CTX = V3_EXT_CTX; - {$EXTERNALSYM PX509V3_CTX} - PX509V3_CTX = ^X509V3_CTX; - -type - {$EXTERNALSYM Tsk_new_cmp} - Tsk_new_cmp = function (const a, b : PIdAnsiChar; const c : PIdAnsiChar) : TIdC_INT cdecl; - {$EXTERNALSYM TRSA_generate_key_callback} - TRSA_generate_key_callback = procedure (p1, p2 : TIdC_INT; p3 : Pointer); cdecl; - {$EXTERNALSYM TCRYPTO_set_mem_functions_m} - TCRYPTO_set_mem_functions_m = function (size : size_t) : Pointer; cdecl; - {$EXTERNALSYM TCRYPTO_set_mem_functions_r} - TCRYPTO_set_mem_functions_r = function (ptr : Pointer; size : size_t) : Pointer; cdecl; - {$EXTERNALSYM TCRYPTO_set_mem_functions_f} - TCRYPTO_set_mem_functions_f = procedure (ptr : Pointer); cdecl; - {$EXTERNALSYM TCRYPTO_set_mem_ex_functions_m} - TCRYPTO_set_mem_ex_functions_m = function(size : size_t; const c : PIdAnsiChar; i : TIdC_INT) : Pointer; cdecl; - {$EXTERNALSYM TCRYPTO_set_mem_ex_functions_r} - TCRYPTO_set_mem_ex_functions_r = function(ptr : Pointer; size : size_t; const c : PIdAnsiChar; i : TIdC_INT) : Pointer; cdecl; - {$EXTERNALSYM TCRYPTO_set_mem_ex_functions_f} - TCRYPTO_set_mem_ex_functions_f = procedure (ptr : Pointer); cdecl; - {$EXTERNALSYM Tset_mem_debug_functions_m} - Tset_mem_debug_functions_m = procedure (addr : Pointer; num : TIdC_INT; const _file : PIdAnsiChar; line, before_p : TIdC_INT); cdecl; - {$EXTERNALSYM Tset_mem_debug_functions_r} - Tset_mem_debug_functions_r = procedure (addr1, addr2 : Pointer; num : TIdC_INT; const _file : PIdAnsiChar; line, before_p : TIdC_INT); cdecl; - {$EXTERNALSYM Tset_mem_debug_functions_f} - Tset_mem_debug_functions_f = procedure (addr : Pointer; before_p : TIdC_INT); cdecl; - {$EXTERNALSYM Tset_mem_debug_functions_so} - Tset_mem_debug_functions_so = procedure (bits : TIdC_LONG); cdecl; - {$EXTERNALSYM Tset_mem_debug_functions_go} - Tset_mem_debug_functions_go = function : TIdC_LONG; cdecl; - {$EXTERNALSYM TSSL_CTX_set_verify_callback} - TSSL_CTX_set_verify_callback = function (ok : TIdC_INT; ctx : PX509_STORE_CTX) : TIdC_INT; cdecl; - {$EXTERNALSYM Tsk_pop_free_func} - Tsk_pop_free_func = procedure (p : Pointer); cdecl; - {$EXTERNALSYM SSL_callback_ctrl_fp} - SSL_callback_ctrl_fp = procedure (para1 : PBIO; para2 : TIdC_INT; - para3 : PIdAnsiChar; para4 : TIdC_INT; para5, para6 : TIdC_LONG); cdecl; - {$EXTERNALSYM TCRYPTO_THREADID_set_callback_threadid_func} - TCRYPTO_THREADID_set_callback_threadid_func = procedure (id : PCRYPTO_THREADID) cdecl; - {$EXTERNALSYM TSSL_CTX_set_tlsext_status_cb} - TSSL_CTX_set_tlsext_status_cb = function(SSL : PSSL; Arg : Pointer) : TIdC_INT cdecl; - {$EXTERNALSYM TSSL_CTX_set_tlsext_opaque_prf_input_callback_cb} - TSSL_CTX_set_tlsext_opaque_prf_input_callback_cb = function(ssl : PSSL; peerinput : Pointer; len : size_t; arg : Pointer) : TIdC_INT cdecl; - {$EXTERNALSYM TSSL_CTX_set_tlsext_ticket_key_cb_fp} - TSSL_CTX_set_tlsext_ticket_key_cb_fp = function(SSL : PSSL; keyname, iv : PIdAnsiChar; ctx : PEVP_CIPHER_CTX; hctx : PHMAC_CTX; enc : TIdC_INT) : TIdC_INT cdecl; - - {$EXTERNALSYM EVP_CIPHER_do_all_fn} - EVP_CIPHER_do_all_fn = procedure(ciph : PEVP_CIPHER; - from : PIdAnsiChar; _to : PIdAnsiChar; x : Pointer) cdecl; - {$EXTERNALSYM EVP_MD_do_all_fn} - EVP_MD_do_all_fn = procedure(ciph : PEVP_CIPHER; - from: PIdAnsiChar; _to: PIdAnsiChar; x : Pointer) cdecl; - {$EXTERNALSYM EVP_PKEY_asn1_set_public_pub_decode} - EVP_PKEY_asn1_set_public_pub_decode = function(pk : PEVP_PKEY; pub : PX509_PUBKEY) : TIdC_INT cdecl; - {$EXTERNALSYM EVP_PKEY_asn1_set_public_pub_encode} - EVP_PKEY_asn1_set_public_pub_encode = function(pub : PX509_PUBKEY; pk : PX509_PUBKEY) : TIdC_INT cdecl; - {$EXTERNALSYM EVP_PKEY_asn1_set_public_pub_cmp} - EVP_PKEY_asn1_set_public_pub_cmp = function (a : PEVP_PKEY; b : PEVP_PKEY) : TIdC_INT cdecl; - {$EXTERNALSYM EVP_PKEY_asn1_set_public_pub_print} - EVP_PKEY_asn1_set_public_pub_print = function(_out : PBIO; pkey : PEVP_PKEY; indent : TIdC_INT; - pctx : PASN1_PCTX) : TIdC_INT cdecl; - {$EXTERNALSYM EVP_PKEY_asn1_set_public_pub_pkey_size} - EVP_PKEY_asn1_set_public_pub_pkey_size = function(pk : PEVP_PKEY) : TIdC_INT cdecl; - {$EXTERNALSYM EVP_PKEY_asn1_set_public_pkey_bits} - EVP_PKEY_asn1_set_public_pkey_bits = function(pk : PEVP_PKEY) : TIdC_INT cdecl; - {$EXTERNALSYM EVP_PKEY_asn1_set_private_priv_decode} - EVP_PKEY_asn1_set_private_priv_decode = function (pk : PEVP_PKEY; p8inf : PPKCS8_PRIV_KEY_INFO) : TIdC_INT cdecl; - {$EXTERNALSYM EVP_PKEY_asn1_set_private_priv_encode} - EVP_PKEY_asn1_set_private_priv_encode = function (p8 : PPKCS8_PRIV_KEY_INFO; pk : PEVP_PKEY): TIdC_INT cdecl; - {$EXTERNALSYM EVP_PKEY_asn1_set_private_priv_print} - EVP_PKEY_asn1_set_private_priv_print = function (_out : PBIO; pkey : PEVP_PKEY; indent : TIdC_INT; - pctx : PASN1_PCTX) : TIdC_INT cdecl; - {$EXTERNALSYM EVP_PKEY_asn1_set_param_param_decode} - EVP_PKEY_asn1_set_param_param_decode = function(pkey : PEVP_PKEY; - pder : PPIdAnsiChar; derlen : TIdC_INT): TIdC_INT cdecl; - {$EXTERNALSYM EVP_PKEY_asn1_set_param_param_encode} - EVP_PKEY_asn1_set_param_param_encode = function(pkey : PEVP_PKEY; pder : PPIdAnsiChar) : TIdC_INT cdecl; - {$EXTERNALSYM EVP_PKEY_asn1_set_param_param_missing} - EVP_PKEY_asn1_set_param_param_missing = function(pk : EVP_PKEY) : TIdC_INT cdecl; - {$EXTERNALSYM EVP_PKEY_asn1_set_param_param_copy} - EVP_PKEY_asn1_set_param_param_copy = function(_to : PEVP_PKEY; from : PEVP_PKEY) : TIdC_INT cdecl; - {$EXTERNALSYM EVP_PKEY_asn1_set_param_param_cmp} - EVP_PKEY_asn1_set_param_param_cmp = function(a : PEVP_PKEY; b : PEVP_PKEY): TIdC_INT cdecl; - {$EXTERNALSYM EVP_PKEY_asn1_set_param_param_print} - EVP_PKEY_asn1_set_param_param_print = function(_out : PBIO; pkey : PEVP_PKEY; indent : TIdC_INT; - pctx : PASN1_PCTX) : TIdC_INT cdecl; - {$EXTERNALSYM EVP_PKEY_asn1_set_free_pkey_free} - EVP_PKEY_asn1_set_free_pkey_free = procedure(pkey : PEVP_PKEY) cdecl; - {$EXTERNALSYM EVP_PKEY_asn1_set_ctr_pkey_ctrl} - EVP_PKEY_asn1_set_ctr_pkey_ctrl = function(pkey : PEVP_PKEY; op : TIdC_INT; - arg1 : TIdC_LONG; arg2 : Pointer) : TIdC_INT cdecl; - - {$EXTERNALSYM EVP_PKEY_gen_cb} - - EVP_PKEY_gen_cb = function( ctx : PEVP_PKEY_CTX) : TIdC_INT cdecl; - {$EXTERNALSYM EVP_PKEY_meth_set_init_init} - - EVP_PKEY_meth_set_init_init = function (ctx : PEVP_PKEY_CTX) : TIdC_INT cdecl; - {$EXTERNALSYM EVP_PKEY_meth_set_copy_copy} - EVP_PKEY_meth_set_copy_copy = function (dst : PEVP_PKEY_CTX; src : PEVP_PKEY_CTX) : TIdC_INT cdecl; - {$EXTERNALSYM EVP_PKEY_meth_set_cleanup_cleanup} - EVP_PKEY_meth_set_cleanup_cleanup = procedure(ctx : PEVP_PKEY_CTX) cdecl; - {$EXTERNALSYM EVP_PKEY_meth_set_paramgen_paramgen_init} - EVP_PKEY_meth_set_paramgen_paramgen_init = function (ctx : PEVP_PKEY_CTX) : TIdC_INT cdecl; - {$EXTERNALSYM EVP_PKEY_meth_set_paramgen_paramgen} - EVP_PKEY_meth_set_paramgen_paramgen = function (ctx : PEVP_PKEY_CTX; pkey : PEVP_PKEY) : TIdC_INT cdecl; - {$EXTERNALSYM EVP_PKEY_meth_set_keygen_keygen_init} - EVP_PKEY_meth_set_keygen_keygen_init = function(ctx : PEVP_PKEY_CTX) : TIdC_INT cdecl; - {$EXTERNALSYM EVP_PKEY_meth_set_keygen_keygen} - EVP_PKEY_meth_set_keygen_keygen = function(ctx : PEVP_PKEY_CTX; pkey : PEVP_PKEY) : TIdC_INT cdecl; - {$EXTERNALSYM EVP_PKEY_meth_set_sign_sign_init} - EVP_PKEY_meth_set_sign_sign_init = function(ctx : PEVP_PKEY_CTX) : TIdC_INT cdecl; - {$EXTERNALSYM EVP_PKEY_meth_set_sign_sign} - EVP_PKEY_meth_set_sign_sign = function(ctx : PEVP_PKEY_CTX; sig : PIdAnsiChar; siglen : Psize_t; - tbs : PIdAnsiChar; tbslen : size_t) : TIdC_INT cdecl; - {$EXTERNALSYM EVP_PKEY_meth_set_verify_verify_init} - EVP_PKEY_meth_set_verify_verify_init = function(ctx : PEVP_PKEY_CTX) : TIdC_INT cdecl; - {$EXTERNALSYM EVP_PKEY_meth_set_verify_verify} - EVP_PKEY_meth_set_verify_verify = function(ctx : PEVP_PKEY_CTX; sig : PIdAnsiChar; siglen : size_t; - tbs : PIdAnsiChar; tbslen : size_t) : TIdC_INT cdecl; - {$EXTERNALSYM EVP_PKEY_meth_set_verify_recover_verify_recover_init} - EVP_PKEY_meth_set_verify_recover_verify_recover_init = function(ctx : PEVP_PKEY_CTX) : TIdC_INT cdecl; - {$EXTERNALSYM EVP_PKEY_meth_set_verify_recover_verify_recover} - EVP_PKEY_meth_set_verify_recover_verify_recover = function(ctx : PEVP_PKEY_CTX; - sig : PIdAnsiChar; siglen : Psize_t; - tbs: PIdAnsiChar; tbslen : size_t) : TIdC_INT cdecl; - {$EXTERNALSYM EVP_PKEY_meth_set_signctx_signctx_init} - EVP_PKEY_meth_set_signctx_signctx_init = function(ctx : PEVP_PKEY_CTX; mctx : PEVP_MD_CTX) : TIdC_INT cdecl; - {$EXTERNALSYM EVP_PKEY_meth_set_signctx_signctx} - EVP_PKEY_meth_set_signctx_signctx = function(ctx : PEVP_PKEY_CTX; sig : PIdAnsiChar; siglen : size_t; - mctx : PEVP_MD_CTX) : TIdC_INT cdecl; - {$EXTERNALSYM EVP_PKEY_meth_set_verifyctx_verifyctx_init} - EVP_PKEY_meth_set_verifyctx_verifyctx_init = function : TIdC_INT cdecl; - {$EXTERNALSYM EVP_PKEY_meth_set_verifyctx_verifyctx} - EVP_PKEY_meth_set_verifyctx_verifyctx = function : TIdC_INT cdecl; - {$EXTERNALSYM EVP_PKEY_meth_set_encrypt_encrypt_init} - EVP_PKEY_meth_set_encrypt_encrypt_init = function( ctx : PEVP_PKEY_CTX) : TIdC_INT cdecl; - {$EXTERNALSYM EVP_PKEY_meth_set_encrypt_encryptfn} - EVP_PKEY_meth_set_encrypt_encryptfn = function(ctx : PEVP_PKEY_CTX; _out : PIdAnsiChar; outlen : psize_t; - _in : PIdAnsiChar; inlen : size_t) : TIdC_INT cdecl; - {$EXTERNALSYM EVP_PKEY_meth_set_decrypt_decrypt_init} - EVP_PKEY_meth_set_decrypt_decrypt_init = function(ctx : PEVP_PKEY_CTX) : TIdC_INT cdecl; - {$EXTERNALSYM EVP_PKEY_meth_set_decrypt_decrypt} - EVP_PKEY_meth_set_decrypt_decrypt = function(ctx : PEVP_PKEY_CTX; _out : PIdAnsiChar; outlen : psize_t; - _in : PIdAnsiChar; inlen : size_t) : TIdC_INT cdecl; - {$EXTERNALSYM EVP_PKEY_meth_set_derive_derive_init} - EVP_PKEY_meth_set_derive_derive_init = function(ctx : PEVP_PKEY_CTX) : TIdC_INT cdecl; - - {$EXTERNALSYM EVP_PKEY_meth_set_derive_derive} - EVP_PKEY_meth_set_derive_derive = function (ctx : PEVP_PKEY_CTX; key : PIdAnsiChar; keylen : psize_t) : TIdC_INT cdecl; - {$EXTERNALSYM EVP_PKEY_meth_set_ctrl_ctrl} - EVP_PKEY_meth_set_ctrl_ctrl = function(ctx : PEVP_PKEY_CTX; _type : TIdC_INT; p1 : TIdC_INT; p2 : Pointer) : TIdC_INT cdecl; - {$EXTERNALSYM EVP_PKEY_meth_set_ctrlctrl_str} - EVP_PKEY_meth_set_ctrlctrl_str = function(ctx : PEVP_PKEY_CTX; - _type : PIdAnsiChar; value : PIdAnsiChar) : TIdC_INT cdecl; - - -var - {$EXTERNALSYM OpenSSL_add_all_algorithms} - OpenSSL_add_all_algorithms : procedure cdecl = nil; - {$EXTERNALSYM OpenSSL_add_all_ciphers} - OpenSSL_add_all_ciphers : procedure cdecl = nil; - {$EXTERNALSYM OpenSSL_add_all_digests} - OpenSSL_add_all_digests : procedure cdecl = nil; - {$EXTERNALSYM EVP_cleanup} - EVP_cleanup : procedure cdecl = nil; - //SSL Version function - {$EXTERNALSYM _SSLeay_version} - _SSLeay_version : function(_type : TIdC_INT) : PIdAnsiChar cdecl = nil; - //SSLeay - {$EXTERNALSYM SSLeay} - SSLeay : function : TIdC_ULONG cdecl = nil; - {$EXTERNALSYM _CRYPTO_lock} - _CRYPTO_lock : procedure(mode, _type : TIdC_INT; const _file : PIdAnsiChar; line : TIdC_INT) cdecl = nil; - - //CRYPTO_set_mem_ex_functions - {$EXTERNALSYM CRYPTO_set_mem_functions} - CRYPTO_set_mem_functions : function( - m: TCRYPTO_set_mem_functions_m; - r: TCRYPTO_set_mem_functions_r; - f: TCRYPTO_set_mem_functions_f): TIdC_INT cdecl = nil; - {$EXTERNALSYM CRYPTO_malloc} - CRYPTO_malloc : function(num: TIdC_INT; const _file: PIdAnsiChar; line: TIdC_INT): Pointer cdecl = nil; - {$EXTERNALSYM CRYPTO_free} - CRYPTO_free : procedure(ptr : Pointer) cdecl = nil; - {$EXTERNALSYM CRYPTO_mem_leaks} - CRYPTO_mem_leaks : procedure(b:PBIO) cdecl = nil; - {$EXTERNALSYM CRYPTO_mem_ctrl} - CRYPTO_mem_ctrl : function(mode: TIdC_INT): TIdC_INT cdecl = nil; - {$EXTERNALSYM CRYPTO_set_mem_debug_functions} - CRYPTO_set_mem_debug_functions : procedure ( - m: Tset_mem_debug_functions_m; - r: Tset_mem_debug_functions_r; - f : Tset_mem_debug_functions_f; - so : Tset_mem_debug_functions_so; - go : Tset_mem_debug_functions_go) cdecl = nil; - {$EXTERNALSYM CRYPTO_dbg_malloc} - CRYPTO_dbg_malloc : procedure(addr: Pointer; num: TIdC_INT; const _file: PIdAnsiChar; line, before: TIdC_INT) cdecl = nil; - {$EXTERNALSYM CRYPTO_dbg_realloc} - CRYPTO_dbg_realloc : procedure(arrd1, addr2: Pointer; num: TIdC_INT; const _file: PIdAnsiChar; line, before: TIdC_INT) cdecl = nil; - {$EXTERNALSYM CRYPTO_dbg_free} - CRYPTO_dbg_free : procedure(addr: Pointer; before: TIdC_INT) cdecl = nil; - {$EXTERNALSYM CRYPTO_dbg_set_options} - CRYPTO_dbg_set_options : procedure(bits: TIdC_LONG) cdecl = nil; - {$EXTERNALSYM CRYPTO_dbg_get_options} - CRYPTO_dbg_get_options : function: TIdC_LONG cdecl = nil; - {$EXTERNALSYM CRYPTO_THREADID_set_numeric} - CRYPTO_THREADID_set_numeric : procedure(id : PCRYPTO_THREADID; val : TIdC_ULONG) cdecl = nil; - {$EXTERNALSYM CRYPTO_THREADID_set_pointer} - CRYPTO_THREADID_set_pointer : procedure(id : PCRYPTO_THREADID; ptr : Pointer) cdecl = nil; - {$EXTERNALSYM CRYPTO_THREADID_set_callback} - CRYPTO_THREADID_set_callback : function(threadid_func : TCRYPTO_THREADID_set_callback_threadid_func) : TIdC_INT cdecl = nil; - {$EXTERNALSYM sk_num} - sk_num : function (const x : PSTACK) : TIdC_INT cdecl = nil; - {$EXTERNALSYM sk_value} - sk_value : function (x : PSTACK; i : TIdC_INT) : PIdAnsiChar cdecl = nil; - {$EXTERNALSYM sk_new} - sk_new : function ( cmp : Tsk_new_cmp) : PStack cdecl = nil; - {$EXTERNALSYM sk_new_null} - sk_new_null : function: PSTACK cdecl = nil; - {$EXTERNALSYM sk_free} - sk_free : procedure (st : PSTACK) cdecl = nil; - {$EXTERNALSYM sk_push} - sk_push : function(st: PSTACK; data: PIdAnsiChar): TIdC_INT cdecl = nil; - {$EXTERNALSYM RSA_new} - RSA_new: function: PRSA cdecl = nil; - {$EXTERNALSYM RSA_size} - RSA_size: function(key: PRSA): TIdC_INT cdecl = nil; - //This function is depreciated. - {$EXTERNALSYM RSA_generate_key} - RSA_generate_key : function(bits: TIdC_INT; e: TIdC_ULONG; callback: TRSA_generate_key_callback; cb_arg: Pointer): PRSA cdecl = nil; - {$EXTERNALSYM RSA_generate_key_ex} - RSA_generate_key_ex : function(rsa : PRSA; bits : TIdC_INT; e : PBIGNUM; cb : PBN_GENCB) : TIdC_INT cdecl = nil; - {$EXTERNALSYM RSA_free} - RSA_free : procedure(rsa: PRSA) cdecl = nil; - {$EXTERNALSYM RSA_check_key} - RSA_check_key : function(const rsa: PRSA): TIdC_INT cdecl = nil; - {$EXTERNALSYM RSA_private_decrypt} - RSA_private_decrypt: function(flen: TIdC_INT; from: PByte; _to: PByte; rsa: PRSA; padding: TIdC_INT): TIdC_INT cdecl = nil; - {$EXTERNALSYM RSA_public_encrypt} - RSA_public_encrypt: function(flen: TIdC_INT; from: PByte; _to: PByte; rsa: PRSA; padding: TIdC_INT): TIdC_INT cdecl = nil; - {$EXTERNALSYM X509_get_default_cert_file} - X509_get_default_cert_file : function : PIdAnsiChar cdecl = nil; - {$EXTERNALSYM X509_get_default_cert_file_env} - X509_get_default_cert_file_env : function : PIdAnsiChar cdecl = nil; - {$EXTERNALSYM BIO_set_flags} - BIO_set_flags : procedure(b: PBIO; flags: integer) cdecl = nil; - {$EXTERNALSYM BIO_new} - BIO_new : function(_type: PBIO_METHOD): PBIO cdecl = nil; - {$EXTERNALSYM BIO_new_mem_buf} - BIO_new_mem_buf : function (buf : Pointer; len : TIdC_INT) : PBIO cdecl = nil; - {$EXTERNALSYM BIO_push} - BIO_push : function(b: PBIO; append: PBIO): PBIO cdecl = nil; - {$EXTERNALSYM BIO_pop} - BIO_pop : function(b: PBIO): PBIO cdecl = nil; - {$EXTERNALSYM BIO_set_next} - BIO_set_next : procedure(b: PBIO; next: PBIO) cdecl = nil; - {$EXTERNALSYM BIO_free} - BIO_free : function(bio: PBIO): TIdC_INT cdecl = nil; - {$EXTERNALSYM BIO_free_all} - BIO_free_all : procedure(bio: PBIO) cdecl = nil; - {$EXTERNALSYM BIO_s_mem} - BIO_s_mem : function: PBIO_METHOD cdecl = nil; - {$EXTERNALSYM BIO_s_file} - BIO_s_file : function: PBIO_METHOD cdecl = nil; - {$EXTERNALSYM BIO_set_ex_data} - BIO_set_ex_data : function(bio : PBIO; idx : TIdC_INT; data : Pointer) : TidC_INT cdecl = nil; - {$EXTERNALSYM BIO_get_ex_data} - BIO_get_ex_data: function(bio : PBIO; idx : TIdC_INT) : Pointer cdecl = nil; - {$EXTERNALSYM BIO_ctrl} - BIO_ctrl : function(bp: PBIO; cmd: TIdC_INT; larg: TIdC_LONG; parg: Pointer): TIdC_LONG cdecl = nil; - {$EXTERNALSYM BIO_ptr_ctrl} - BIO_ptr_ctrl : function(bp : PBIO; cmd : TIdC_INT; larg : TIdC_LONG) : PIdAnsiChar cdecl = nil; - {$EXTERNALSYM BIO_int_ctrl} - BIO_int_ctrl : function(bp : PBIO; cmd : TIdC_INT; larg : TIdC_LONG; iArg : TIdC_INT) : TIdC_LONG cdecl = nil; - {$EXTERNALSYM BIO_callback_ctrl} - BIO_callback_ctrl : function(b : PBIO; cmd : TIdC_INT; fp : SSL_callback_ctrl_fp ) : TIdC_LONG cdecl = nil; - {$EXTERNALSYM BIO_new_file} - BIO_new_file : function(const filename: PIdAnsiChar; const mode: PIdAnsiChar): PBIO cdecl = nil; - {$EXTERNALSYM BIO_puts} - BIO_puts : function(b: PBIO; const txt: PIdAnsiChar): TIdC_INT cdecl = nil; - {$EXTERNALSYM BIO_read} - BIO_read : function(b: PBIO; data: Pointer; len: TIdC_INT): TIdC_INT cdecl = nil; - {$EXTERNALSYM BIO_write} - BIO_write : function(b: PBIO; const buf: Pointer; len: TIdC_INT): TIdC_INT cdecl = nil; - {$EXTERNALSYM BN_hex2bn} - BN_hex2bn: function(var n:PBIGNUM; const Str: PIdAnsiChar): TIdC_INT cdecl = nil; - {$EXTERNALSYM BN_new} - BN_new : function(): PBIGNUM cdecl = nil; - {$EXTERNALSYM BN_free} - BN_free : procedure(a: PBIGNUM) cdecl = nil; - {$EXTERNALSYM BN_bn2dec} - BN_bn2dec: function(const n:PBIGNUM): PIdAnsiChar cdecl = nil; - {$EXTERNALSYM BN_bn2hex} - BN_bn2hex: function(const n:PBIGNUM): PIdAnsiChar cdecl = nil; - {$EXTERNALSYM BN_set_word} - BN_set_word: function(a: PBIGNUM; w: TIdC_ULONG): TIdC_INT cdecl = nil; - {$EXTERNALSYM DH_free} - DH_free : procedure(dh: PDH) cdecl = nil; - - {$IFNDEF SSLEAY_MACROS} - //Note that these are defined as a pointer to a pointer to a structure. - //This is done because the pointer being passed could be nil. The pointer is probably - //more of a template than anything. If it is used, it should be initialized to nil. - {$EXTERNALSYM _PEM_read_bio_X509} - _PEM_read_bio_X509 : function(bp: PBIO; x: PPX509; cb: ppem_password_cb; u: Pointer): PX509 cdecl = nil; - {$EXTERNALSYM _PEM_read_bio_X509_REQ} - _PEM_read_bio_X509_REQ : function(bp :PBIO; x : PPX509_REQ; cb :ppem_password_cb; u: PIdAnsiChar) : PX509_REQ cdecl = nil; - {$EXTERNALSYM _PEM_read_bio_X509_CRL} - _PEM_read_bio_X509_CRL : function(bp : PBIO; x : PPX509_CRL;cb : ppem_password_cb; u: Pointer) : PX509_CRL cdecl = nil; - {$EXTERNALSYM _PEM_read_bio_RSAPrivateKey} - _PEM_read_bio_RSAPrivateKey : function(bp : PBIO; x : PPRSA; cb : ppem_password_cb; u: Pointer) : PRSA cdecl = nil; - {$EXTERNALSYM _PEM_read_bio_RSAPublicKey} - _PEM_read_bio_RSAPublicKey : function(bp : PBIO; x : PPRSA; cb : ppem_password_cb; u: Pointer) : PRSA cdecl = nil; - {$EXTERNALSYM _PEM_read_bio_DSAPrivateKey} - _PEM_read_bio_DSAPrivateKey : function(bp : PBIO; x : PPDSA; cb : ppem_password_cb; u : Pointer) : PDSA cdecl = nil; - {$EXTERNALSYM _PEM_read_bio_PrivateKey} - _PEM_read_bio_PrivateKey : function(bp : PBIO; x : PPEVP_PKEY; cb : ppem_password_cb; u : Pointer) : PEVP_PKEY cdecl = nil; - {$EXTERNALSYM _PEM_read_bio_PKCS7} - _PEM_read_bio_PKCS7 : function(bp : PBIO; x : PPPKCS7; cb : ppem_password_cb; u : Pointer) : PPKCS7 cdecl = nil; - {$EXTERNALSYM _PEM_read_bio_DHparams} - _PEM_read_bio_DHparams : function(bp : PBIO; x : PPDH; cb : ppem_password_cb; u : Pointer) : PDH cdecl = nil; - {$EXTERNALSYM _PEM_read_bio_DSAparams} - _PEM_read_bio_DSAparams : function(bp : PBIO; x : PPDSA; cb : ppem_password_cb; u : Pointer) : PDSA cdecl = nil; - {$EXTERNALSYM _PEM_read_bio_NETSCAPE_CERT_SEQUENCE} - _PEM_read_bio_NETSCAPE_CERT_SEQUENCE : function(bp : PBIO; x : PPNETSCAPE_CERT_SEQUENCE; - cb : ppem_password_cb; u : Pointer) : PNETSCAPE_CERT_SEQUENCE cdecl = nil; - {$EXTERNALSYM _PEM_read_bio_PUBKEY} - _PEM_read_bio_PUBKEY : function(bp : PBIO; x : PPEVP_PKEY; cb : ppem_password_cb; u : Pointer) : PEVP_PKEY cdecl = nil; - {$EXTERNALSYM _PEM_write_bio_X509} - _PEM_write_bio_X509 : function(b: PBIO; x: PX509): TIdC_INT cdecl = nil; - {$EXTERNALSYM _PEM_write_bio_X509_REQ} - _PEM_write_bio_X509_REQ : function(bp: PBIO; x: PX509_REQ): TIdC_INT cdecl = nil; - {$EXTERNALSYM _PEM_write_bio_X509_CRL} - _PEM_write_bio_X509_CRL : function(bp : PBIO; x : PX509_CRL) : TIdC_INT cdecl = nil; - {$EXTERNALSYM _PEM_write_bio_RSAPublicKey} - _PEM_write_bio_RSAPublicKey : function(bp : PBIO; x : PRSA) : TIdC_INT cdecl = nil; - {$EXTERNALSYM _PEM_write_bio_RSAPrivateKey} - _PEM_write_bio_RSAPrivateKey : function(bp : PBIO; x : PRSA; const enc : PEVP_CIPHER; - kstr : PIdAnsiChar; klen : TIdC_INT; cb : ppem_password_cb; u : POinter) : TIdC_INT cdecl = nil; - {$EXTERNALSYM _PEM_write_bio_DSAPrivateKey} - _PEM_write_bio_DSAPrivateKey : function(bp : PBIO; x : PDSA; const enc : PEVP_CIPHER; - kstr : PIdAnsiChar; klen : TIdC_INT; cb : Ppem_password_cb; u : Pointer) : TIdC_INT cdecl = nil; - {$EXTERNALSYM _PEM_write_bio_PrivateKey} - _PEM_write_bio_PrivateKey : function(bp : PBIO; x : PEVP_PKEY; const enc : PEVP_CIPHER; - kstr : PIdAnsiChar; klen : TIdC_INT; cb : Ppem_password_cb; u : Pointer) : TIdC_INT cdecl = nil; - {$EXTERNALSYM _PEM_write_bio_PKCS7} - _PEM_write_bio_PKCS7 : function(bp : PBIO; x : PPKCS7) : TIdC_INT cdecl = nil; - {$EXTERNALSYM _PEM_write_bio_DHparams} - _PEM_write_bio_DHparams : function(bp : PBIO; x : PDH): TIdC_INT cdecl = nil; - {$EXTERNALSYM _PEM_write_bio_DSAparams} - _PEM_write_bio_DSAparams : function(bp : PBIO; x : PDSA) : TIdC_INT cdecl = nil; - {$EXTERNALSYM _PEM_write_bio_NETSCAPE_CERT_SEQUENCE} - _PEM_write_bio_NETSCAPE_CERT_SEQUENCE : function(bp : PBIO; x : PDSA) : TIdC_INT cdecl = nil; - {$IFNDEF OPENSSL_NO_BIO} - {$EXTERNALSYM _PEM_write_bio_PKCS8PrivateKey} - _PEM_write_bio_PKCS8PrivateKey : function(bp: PBIO; key: PEVP_PKEY; enc: PEVP_CIPHER; - kstr: PIdAnsiChar; klen: TIdC_INT; cb: ppem_password_cb; u: Pointer): TIdC_INT cdecl = nil; - {$EXTERNALSYM _PEM_write_bio_PUBKEY} - _PEM_write_bio_PUBKEY : function(bp: PBIO; x: PEVP_PKEY): TIdC_INT cdecl = nil; - {$ENDIF} - {$ELSE} - {$IFNDEF OPENSSL_NO_BIO} - {$EXTERNALSYM PEM_ASN1_write_bio} - PEM_ASN1_write_bio : function(i2d: i2d_of_void; const name: PIdAnsiChar; - bp: PBIO; x: PIdAnsiChar; const enc: PEVP_CIPHER; kstr: PIdAnsiChar; klen: TIdC_INT; - cb: ppem_password_cb; u: Pointer):TIdC_INT cdecl = nil; - {$EXTERNALSYM PEM_ASN1_read_bio} - PEM_ASN1_read_bio : function(d2i: d2i_OF_void; name: PIdAnsiChar; bp: PBIO; - x: PPointer; cb: ppem_password_cb; u:Pointer): Pointer cdecl = nil; - {$ENDIF} - {$ENDIF} - {$EXTERNALSYM PEM_X509_INFO_read_bio} - PEM_X509_INFO_read_bio : function (bp : PBIO; sk : PSTACK_OF_X509_INFO; - cb : ppem_password_cb; u : Pointer) : PSTACK_OF_X509_INFO cdecl = nil; - {$EXTERNALSYM PEM_read_bio_X509_AUX} - PEM_read_bio_X509_AUX : function (bp : PBIO; x : PPX509; - cb : ppem_password_cb; u : Pointer) : PX509 cdecl = nil; - {$EXTERNALSYM EVP_DigestInit} - EVP_DigestInit : function(ctx : PEVP_MD_CTX; _type : PEVP_MD) : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_DigestFinal} - EVP_DigestFinal : function(ctx : PEVP_MD_CTX;md : PIdAnsiChar; s : TIdC_UINT) : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_DigestInit_ex} - EVP_DigestInit_ex : function (ctx : PEVP_MD_CTX; const AType : PEVP_MD; impl : PENGINE) : TIdC_Int cdecl = nil; - {$EXTERNALSYM EVP_DigestUpdate} - EVP_DigestUpdate : function (ctx : PEVP_MD_CTX; d : Pointer; cnt : size_t) : TIdC_Int cdecl = nil; - {$EXTERNALSYM EVP_DigestFinal_ex} - EVP_DigestFinal_ex : function(ctx : PEVP_MD_CTX; md : PIdAnsiChar; var s : TIdC_UInt) : TIdC_Int cdecl = nil; - {$EXTERNALSYM EVP_EncryptInit} - EVP_EncryptInit : function(ctx : PEVP_CIPHER_CTX;cipher : PEVP_CIPHER; - key : PIdAnsiChar; iv : PIdAnsiChar) : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_EncryptInit_ex} - EVP_EncryptInit_ex : function(ctx : PEVP_CIPHER_CTX; cipher : PEVP_CIPHER; impl : PENGINE; - key : PIdAnsiChar; iv : PIdAnsiChar) : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_EncryptUpdate} - EVP_EncryptUpdate : function(ctx : PEVP_CIPHER_CTX; _out : PIdAnsiChar; - outl : PIdC_INT; _in : PIdAnsiChar; inl : TIdC_INT) : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_EncryptFinal_ex} - EVP_EncryptFinal_ex : function(ctx : PEVP_CIPHER_CTX; _out : PIdAnsiChar; outl : PIdC_INT) : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_EncryptFinal} - EVP_EncryptFinal : function(ctx : PEVP_CIPHER_CTX; _out : PIdAnsiChar; outl: PIdC_INT) : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_DecryptInit} - EVP_DecryptInit : function(ctx : PEVP_CIPHER_CTX; cipher : PEVP_CIPHER; - key : PIdAnsiChar; iv : PIdAnsiChar) : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_DecryptInit_ex} - EVP_DecryptInit_ex : function(ctx : PEVP_CIPHER_CTX; cipher : PEVP_CIPHER; impl : PENGINE; - key : PIdAnsiChar; iv : PIdAnsiChar) : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_DecryptUpdate} - EVP_DecryptUpdate : function(ctx : PEVP_CIPHER_CTX; _out : PIdAnsiChar; - outl : PIdC_INT; _in : PIdAnsiChar; inl : TIdC_INT) : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_DecryptFinal} - EVP_DecryptFinal : function(ctx : PEVP_CIPHER_CTX; outm : PIdAnsiChar; outl : PIdC_INT) : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_DecryptFinal_ex} - EVP_DecryptFinal_ex : function(ctx : PEVP_CIPHER_CTX; outm: PIdAnsiChar; outl : PIdC_INT) : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_CipherInit} - EVP_CipherInit : function(ctx : PEVP_CIPHER_CTX; cipher : PEVP_CIPHER; - key : PIdAnsiChar; iv : PIdAnsiChar; - enc : TIdC_INT) : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_CipherInit_ex} - EVP_CipherInit_ex : function(ctx : PEVP_CIPHER_CTX; cipher: PEVP_CIPHER; impl : PENGINE; - key : PIdAnsiChar; iv : PIdAnsiChar; - enc : TIdC_INT) : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_CipherUpdate} - EVP_CipherUpdate : function(ctx : PEVP_CIPHER_CTX; _out : PIdAnsiChar; - outl : PIdC_INT; _in : PIdAnsiChar; inl : TIdC_INT) : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_CipherFinal} - EVP_CipherFinal : function(ctx : PEVP_CIPHER_CTX; outm : PIdAnsiChar; outl : PIdC_INT) : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_CipherFinal_ex} - EVP_CipherFinal_ex: function(ctx : PEVP_CIPHER_CTX; outm : PIdAnsiChar; outl : PIdC_INT) : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_SignFinal} - EVP_SignFinal : function(ctx : PEVP_MD_CTX; md : PIdAnsiChar; s : PIdC_INT; - pkey : PEVP_PKEY) : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_VerifyFinal} - EVP_VerifyFinal : function(ctx : PEVP_MD_CTX; sigbuf : PIdAnsiChar; - siglen : TIdC_UINT; pkey : PEVP_PKEY) : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_DigestSignInit} - EVP_DigestSignInit : function(ctx : PEVP_MD_CTX; pctx : PPEVP_PKEY_CTX; - _type : PEVP_MD; e : PENGINE; pkey : PEVP_PKEY) : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_DigestSignFinal} - EVP_DigestSignFinal : function(ctx : PEVP_MD_CTX; - sigret : PIdAnsiChar; siglen : Psize_t) : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_DigestVerifyInit} - EVP_DigestVerifyInit : function(ctx : PEVP_MD_CTX; pctx : PPEVP_PKEY_CTX; - _type : PEVP_MD;e : PENGINE; pkey : PEVP_PKEY) : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_DigestVerifyFinal} - EVP_DigestVerifyFinal: function(ctx : PEVP_MD_CTX; - sig : PIdAnsiChar; siglen : size_t) : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_OpenInit} - EVP_OpenInit : function(ctx : PEVP_CIPHER_CTX; _type : PEVP_CIPHER; - ek : PIdAnsiChar; ekl : TIdC_INT; iv : PIdAnsiChar; - priv : PEVP_PKEY) : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_OpenFinal} - EVP_OpenFinal : function (ctx : PEVP_CIPHER_CTX; _out : PIdAnsiChar; outl : PIdC_INT) : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_SealInit} - EVP_SealInit : function(ctx : PEVP_CIPHER_CTX; _type : PEVP_CIPHER; - ek : PPIdAnsiChar; ekl : PIdC_INT; iv : PIdAnsiChar; - pubk : PPEVP_PKEY; npubk : TIdC_INT) : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_SealFinal} - EVP_SealFinal : function(ctx : PEVP_CIPHER_CTX; _out : PIdAnsiChar; outl : PIdC_INT) : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_EncodeInit} - EVP_EncodeInit : procedure(ctx : PEVP_ENCODE_CTX) cdecl = nil; - {$EXTERNALSYM EVP_EncodeUpdate} - EVP_EncodeUpdate : procedure(ctx : PEVP_ENCODE_CTX; _out : PIdAnsiChar; outl : PIdC_INT; - _in : PIdAnsiChar; inl : TIdC_INT) cdecl = nil; - {$EXTERNALSYM EVP_EncodeFinal} - EVP_EncodeFinal : procedure(ctx : PEVP_ENCODE_CTX; _out: PIdAnsiChar; outl : PIdC_INT) cdecl = nil; - {$EXTERNALSYM EVP_EncodeBlock} - EVP_EncodeBlock : function(t: PIdAnsiChar; f: PIdAnsiChar; n : TIdC_INT) : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_DecodeInit} - EVP_DecodeInit : procedure(ctx : PEVP_ENCODE_CTX) cdecl = nil; - {$EXTERNALSYM EVP_DecodeUpdate} - EVP_DecodeUpdate : function(ctx : PEVP_ENCODE_CTX; _out : PIdAnsiChar; outl : PIdC_INT; - _in : PIdAnsiChar; inl : TIdC_INT) : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_DecodeFinal} - EVP_DecodeFinal: function(ctx : PEVP_ENCODE_CTX; _out : PIdAnsiChar; outl : PIdC_INT) : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_DecodeBlock} - EVP_DecodeBlock : function(t: PIdAnsiChar; f: PIdAnsiChar; n : TIdC_INT) : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_CIPHER_CTX_init} - EVP_CIPHER_CTX_init : procedure(a : PEVP_CIPHER_CTX) cdecl = nil; - {$EXTERNALSYM EVP_CIPHER_CTX_cleanup} - EVP_CIPHER_CTX_cleanup : function(a : PEVP_CIPHER_CTX) : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_CIPHER_CTX_new} - EVP_CIPHER_CTX_new : function : PEVP_CIPHER_CTX cdecl = nil; - {$EXTERNALSYM EVP_CIPHER_CTX_free} - EVP_CIPHER_CTX_free: procedure(a : PEVP_CIPHER_CTX) cdecl = nil; - {$EXTERNALSYM EVP_CIPHER_CTX_set_key_length} - EVP_CIPHER_CTX_set_key_length : function(x : PEVP_CIPHER_CTX; keylen : TIdC_INT) : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_CIPHER_CTX_set_padding} - EVP_CIPHER_CTX_set_padding : function(c : PEVP_CIPHER_CTX; pad : TIdC_INT) : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_CIPHER_CTX_ctrl} - EVP_CIPHER_CTX_ctrl : function(ctx : PEVP_CIPHER_CTX; _type : TIdC_INT; arg : TIdC_INT; ptr : Pointer) : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_CIPHER_CTX_rand_key} - EVP_CIPHER_CTX_rand_key : function(ctx : PEVP_CIPHER_CTX; key : PIdAnsiChar) : TIdC_INT cdecl = nil; - {$ifndef OPENSSL_NO_BIO} - {$EXTERNALSYM BIO_f_md} - BIO_f_md : function : PBIO_METHOD cdecl = nil; - {$EXTERNALSYM BIO_f_base64} - BIO_f_base64 : function : PBIO_METHOD cdecl = nil; - {$EXTERNALSYM BIO_f_cipher} - BIO_f_cipher : function : PBIO_METHOD cdecl = nil; - {$EXTERNALSYM BIO_f_reliable} - BIO_f_reliable : function : PBIO_METHOD cdecl = nil; - {$EXTERNALSYM BIO_set_cipher} - BIO_set_cipher : procedure (b : PBIO; c : PEVP_CIPHER; k : PIdAnsiChar; - i : PIdAnsiChar; enc : TIdC_INT) cdecl = nil; - {$endif} - {$EXTERNALSYM EVP_MD_CTX_init} - EVP_MD_CTX_init : procedure(ctx : PEVP_MD_CTX) cdecl = nil; - {$EXTERNALSYM EVP_MD_CTX_cleanup} - EVP_MD_CTX_cleanup : function(ctx : PEVP_MD_CTX) : TIdC_Int cdecl = nil; - {$EXTERNALSYM EVP_MD_CTX_create} - EVP_MD_CTX_create: function : PEVP_MD_CTX cdecl = nil; - {$EXTERNALSYM EVP_MD_CTX_destroy} - EVP_MD_CTX_destroy : procedure(ctx : PEVP_MD_CTX) cdecl = nil; - {$EXTERNALSYM EVP_MD_CTX_copy} - EVP_MD_CTX_copy : function(_out : PEVP_MD_CTX; _in: PEVP_MD_CTX): TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_MD_CTX_copy_ex} - EVP_MD_CTX_copy_ex : function (_out : PEVP_MD_CTX; const _in: PEVP_MD_CTX): TIdC_INT cdecl = nil; - - {$IFNDEF OPENSSL_NO_DES} - {$EXTERNALSYM EVP_des_ede3_cbc} - EVP_des_ede3_cbc : function: PEVP_CIPHER cdecl = nil; - {$ENDIF} - {$EXTERNALSYM EVP_PKEY_new} - EVP_PKEY_new : function : PEVP_PKEY cdecl = nil; - - {$EXTERNALSYM EVP_PKEY_free} - EVP_PKEY_free : procedure(pkey: PEVP_PKEY) cdecl = nil; - {$EXTERNALSYM EVP_PKEY_assign} - EVP_PKEY_assign : function(pkey: PEVP_PKEY; _type: TIdC_INT; key: Pointer): TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_get_cipherbyname} - EVP_get_cipherbyname : function(const name : PIdAnsiChar): PEVP_CIPHER cdecl = nil; - {$EXTERNALSYM EVP_get_digestbyname} - EVP_get_digestbyname : function(const name: PIdAnsiChar): PEVP_MD cdecl = nil; - {$EXTERNALSYM EVP_MD_type} - EVP_MD_type : function (md : PEVP_MD) : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_MD_size} - EVP_MD_size : function (md : PEVP_MD) : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_MD_block_size} - EVP_MD_block_size : function (md : PEVP_MD) : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_MD_flags} - EVP_MD_flags : function (md : PEVP_MD) : TIdC_ULONG cdecl = nil; - {$EXTERNALSYM EVP_MD_CTX_md} - EVP_MD_CTX_md : function (ctx : PEVP_MD_CTX) : PEVP_MD cdecl = nil; - {$EXTERNALSYM EVP_CIPHER_nid} - EVP_CIPHER_nid : function (cipher : PEVP_CIPHER) : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_CIPHER_block_size} - EVP_CIPHER_block_size : function(cipher : PEVP_CIPHER) : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_CIPHER_key_length} - EVP_CIPHER_key_length : function(cipher : EVP_CIPHER) : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_CIPHER_iv_length} - EVP_CIPHER_iv_length : function(cipher: PEVP_CIPHER) : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_CIPHER_flags} - EVP_CIPHER_flags : function(cipher : PEVP_CIPHER) : TIdC_ULONG cdecl = nil; - {$EXTERNALSYM EVP_CIPHER_type} - EVP_CIPHER_type : function(ctx : PEVP_CIPHER) : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_CIPHER_CTX_cipher} - EVP_CIPHER_CTX_cipher : function (ctx : PEVP_CIPHER_CTX) : PEVP_CIPHER cdecl = nil; - {$EXTERNALSYM EVP_CIPHER_CTX_nid} - EVP_CIPHER_CTX_nid : function (ctx : PEVP_CIPHER_CTX) : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_CIPHER_CTX_block_size} - EVP_CIPHER_CTX_block_size : function(ctx : PEVP_CIPHER_CTX) : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_CIPHER_CTX_key_length} - EVP_CIPHER_CTX_key_length : function(ctx : PEVP_CIPHER_CTX) : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_CIPHER_CTX_iv_length} - EVP_CIPHER_CTX_iv_length : function(ctx : PEVP_CIPHER_CTX) : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_CIPHER_CTX_copy} - EVP_CIPHER_CTX_copy : function(_out : PEVP_CIPHER_CTX; _in : PEVP_CIPHER_CTX) : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_CIPHER_CTX_get_app_data} - EVP_CIPHER_CTX_get_app_data : function(ctx : PEVP_CIPHER_CTX) : Pointer cdecl = nil; - {$EXTERNALSYM EVP_CIPHER_CTX_set_app_data} - EVP_CIPHER_CTX_set_app_data : procedure(ctx : PEVP_CIPHER_CTX; data : Pointer) cdecl =nil; - {$EXTERNALSYM EVP_CIPHER_CTX_flags} - EVP_CIPHER_CTX_flags : function(ctx : PEVP_CIPHER_CTX) : TIdC_ULONG cdecl = nil; - {$EXTERNALSYM ASN1_INTEGER_set} - ASN1_INTEGER_set : function(a: PASN1_INTEGER; v: TIdC_LONG): TIdC_INT cdecl = nil; - {$EXTERNALSYM ASN1_INTEGER_get} - ASN1_INTEGER_get : function(a: PASN1_INTEGER) : TIdC_LONG cdecl = nil; - //IdSslAsn1UtcTimeNew : function: Pointer cdecl = nil; - {$EXTERNALSYM ASN1_INTEGER_to_BN} - ASN1_INTEGER_to_BN : function(a: PASN1_INTEGER; bn: PBIGNUM) : PBIGNUM cdecl = nil; - {$EXTERNALSYM ASN1_STRING_type_new} - ASN1_STRING_type_new : function(_type: TIdC_INT): PASN1_STRING cdecl = nil; - {$EXTERNALSYM ASN1_STRING_free} - ASN1_STRING_free : procedure(a: PASN1_STRING) cdecl = nil; - {$EXTERNALSYM ASN1_dup} - ASN1_dup : function (i2d : i2d_of_void; d2i : d2i_of_void; x : PIdAnsiChar) : Pointer cdecl = nil; - {$EXTERNALSYM i2d_X509} - i2d_X509 : function(x: PX509; buf: PPByte) : TIdC_INT cdecl = nil; - {$EXTERNALSYM d2i_X509} - d2i_X509 : function(pr : PX509; _in : PPByte; len : TIdC_INT): PX509 cdecl = nil; - {$EXTERNALSYM i2d_X509_NAME} - i2d_X509_NAME : function(x : PX509_NAME; buf : PPByte) : TIdC_INT cdecl = nil; - {$EXTERNALSYM d2i_X509_NAME} - d2i_X509_NAME : function(pr : PPX509_NAME; _in : PPByte; length : TIdC_LONG):PX509_NAME cdecl = nil; - {$EXTERNALSYM i2d_X509_REQ} - i2d_X509_REQ : function(x: PX509_REQ; buf: PPByte): TIdC_INT cdecl = nil; - {$EXTERNALSYM d2i_X509_REQ} - d2i_X509_REQ : function(pr : PX509_REQ; _in : PPByte; len : TIdC_INT): PX509_REQ cdecl = nil; - {$EXTERNALSYM i2d_X509_CRL} - i2d_X509_CRL : function(x: PX509_CRL; buf: PPByte): TIdC_INT cdecl = nil; - {$EXTERNALSYM d2i_X509_CRL} - d2i_X509_CRL : function(pr : PX509_CRL; _in : PPByte; len : TIdC_INT): PX509_REQ cdecl = nil; - {$EXTERNALSYM i2d_RSAPrivateKey} - i2d_RSAPrivateKey : function(x: PRSA; buf: PPByte): TIdC_INT cdecl = nil; - {$EXTERNALSYM d2i_RSAPrivateKey} - d2i_RSAPrivateKey : function(pr : PRSA; _in : PPByte; len : TIdC_INT): PRSA cdecl = nil; - {$EXTERNALSYM i2d_RSAPublicKey} - i2d_RSAPublicKey : function(x: PRSA; buf: PPByte): TIdC_INT cdecl = nil; - {$EXTERNALSYM d2i_RSAPublicKey} - d2i_RSAPublicKey : function(pr : PRSA; _in : PPByte; len : TIdC_INT): PRSA cdecl = nil; - {$EXTERNALSYM i2d_DSAPrivateKey} - i2d_DSAPrivateKey : function(x: PDSA; buf: PPByte): TIdC_INT cdecl = nil; - {$EXTERNALSYM d2i_DSAPrivateKey} - d2i_DSAPrivateKey : function(pr : PDSA; _in : PPByte; len : TIdC_INT): PDSA cdecl = nil; - {$EXTERNALSYM i2d_PrivateKey} - i2d_PrivateKey : function(x: PEVP_PKEY; buf: PPByte): TIdC_INT cdecl = nil; - {$EXTERNALSYM d2i_PrivateKey} - d2i_PrivateKey : function(pr : PEVP_PKEY; _in : PPByte; len : TIdC_INT): PEVP_PKEY cdecl = nil; - {$EXTERNALSYM i2d_PKCS7} - i2d_PKCS7 : function(x: PPKCS7; buf: PPByte): TIdC_INT cdecl = nil; - {$EXTERNALSYM d2i_PKCS7} - d2i_PKCS7 : function(pr : PPKCS7; _in : PPByte; len : TIdC_INT): PPKCS7 cdecl = nil; - {$EXTERNALSYM i2d_DHparams} - i2d_DHparams : function(x: PDH; buf: PPByte): TIdC_INT cdecl = nil; - {$EXTERNALSYM d2i_DHparams} - d2i_DHparams : function(pr : PDH; _in : PPByte; len : TIdC_INT): PDH cdecl = nil; - {$EXTERNALSYM i2d_DSAparams} - i2d_DSAparams : function(x: PDSA; buf: PPByte): TIdC_INT cdecl = nil; - {$EXTERNALSYM d2i_DSAparams} - d2i_DSAparams : function(pr : PDSA; _in : PPByte; len : TIdC_INT): PDSA cdecl = nil; -//NETSCAPE_CERT_SEQUENCE - {$EXTERNALSYM i2d_NETSCAPE_CERT_SEQUENCE} - i2d_NETSCAPE_CERT_SEQUENCE : function(x: PNETSCAPE_CERT_SEQUENCE; buf: PPByte): TIdC_INT cdecl = nil; - {$EXTERNALSYM d2i_NETSCAPE_CERT_SEQUENCE} - d2i_NETSCAPE_CERT_SEQUENCE : function(pr : PNETSCAPE_CERT_SEQUENCE; _in : PPByte; len : TIdC_INT): PNETSCAPE_CERT_SEQUENCE cdecl = nil; - {$EXTERNALSYM i2d_PUBKEY} - i2d_PUBKEY : function(x: PEVP_PKEY; buf: PPByte): TIdC_INT cdecl = nil; - {$EXTERNALSYM d2i_PUBKEY} - d2i_PUBKEY : function(pr : PEVP_PKEY; _in : PPByte; len : TIdC_INT): PEVP_PKEY cdecl = nil; - - {$IFNDEF OPENSSL_NO_BIO} - {$EXTERNALSYM d2i_X509_bio} - d2i_X509_bio : function(bp: PBIO; x: PPx509): PX509 cdecl = nil; - {$EXTERNALSYM i2d_X509_REQ_bio} - i2d_X509_REQ_bio : function(bp: PBIO; x: PX509_REQ): TIdC_INT cdecl = nil; - {$EXTERNALSYM i2d_X509_bio} - i2d_X509_bio : function(bp: PBIO; x: PX509): TIdC_INT cdecl = nil; - {$EXTERNALSYM i2d_PrivateKey_bio} - i2d_PrivateKey_bio : function(b: PBIO; pkey: PEVP_PKEY): TIdC_INT cdecl = nil; - //P12 additions - {$EXTERNALSYM d2i_PKCS12_bio} - d2i_PKCS12_bio: function(bp: PBIO; x: PPPKCS12): PPKCS12 cdecl = nil; - {$EXTERNALSYM PKCS12_parse} - PKCS12_parse: function(P12: PPKCS12; Password: PIdAnsiChar; out PrivateKey: PEVP_PKEY; out Cert: PX509; CertChain: PPSTACK_OF_X509): TIdC_INT cdecl = nil; - {$ENDIF} - - {$EXTERNALSYM X509_new} - X509_new : function: PX509 cdecl = nil; - {$EXTERNALSYM X509_free} - X509_free : procedure(x: PX509) cdecl = nil; - {$EXTERNALSYM X509_NAME_new} - X509_NAME_new : function :PX509_NAME cdecl = nil; - {$EXTERNALSYM X509_NAME_free} - X509_NAME_free : procedure(x:PX509_NAME) cdecl = nil; - {$EXTERNALSYM X509_REQ_new} - X509_REQ_new : function :PX509_REQ cdecl = nil; - {$EXTERNALSYM X509_REQ_free} - X509_REQ_free : procedure(x:PX509_REQ) cdecl = nil; - {$EXTERNALSYM X509_to_X509_REQ} - X509_to_X509_REQ : function(x: PX509; pkey: PEVP_PKEY; const md: PEVP_MD): PX509_REQ cdecl = nil; - {$EXTERNALSYM X509_NAME_add_entry_by_txt} - X509_NAME_add_entry_by_txt : function(name: PX509_NAME; const field: PIdAnsiChar; _type: TIdC_INT; - const bytes: PIdAnsiChar; len, loc, _set: TIdC_INT): TIdC_INT cdecl = nil; - {$EXTERNALSYM X509_INFO_free} - X509_INFO_free : procedure (a : PX509_INFO) cdecl = nil; - {$EXTERNALSYM X509_set_version} - X509_set_version : function(x: PX509; version: TIdC_LONG): TIdC_INT cdecl = nil; - {$EXTERNALSYM X509_get_serialNumber} - X509_get_serialNumber : function(x: PX509): PASN1_INTEGER cdecl = nil; - {$EXTERNALSYM X509_gmtime_adj} - X509_gmtime_adj : function(s: PASN1_TIME; adj: TIdC_LONG): PASN1_TIME cdecl = nil; - {$EXTERNALSYM X509_set_notBefore} - X509_set_notBefore : function(x: PX509; tm: PASN1_TIME): TIdC_INT cdecl = nil; - {$EXTERNALSYM X509_set_notAfter} - X509_set_notAfter : function(x: PX509; tm: PASN1_TIME): TIdC_INT cdecl = nil; - {$EXTERNALSYM X509_set_pubkey} - X509_set_pubkey : function(x: PX509; pkey: PEVP_PKEY): TIdC_INT cdecl = nil; - {$EXTERNALSYM X509_REQ_set_pubkey} - X509_REQ_set_pubkey : function(x: PX509_REQ; pkey: PEVP_PKEY): TIdC_INT cdecl = nil; - {$EXTERNALSYM X509_PUBKEY_get} - X509_PUBKEY_get : function(key: PX509_PUBKEY): PEVP_PKEY cdecl = nil; - {$EXTERNALSYM X509_verify} - X509_verify : function(x509: PX509; pkey: PEVP_PKEY): TIdC_INT cdecl = nil; - {$EXTERNALSYM X509_sign} - X509_sign : function(x: PX509; pkey: PEVP_PKEY; const md: PEVP_MD): TIdC_INT cdecl = nil; - {$EXTERNALSYM X509_REQ_sign} - X509_REQ_sign : function(x: PX509_REQ; pkey: PEVP_PKEY; const md: PEVP_MD): TIdC_INT cdecl = nil; - {$EXTERNALSYM X509_REQ_add_extensions} - X509_REQ_add_extensions : function(req: PX509_REQ; exts: PSTACK_OF_X509_EXTENSION): TIdC_INT cdecl = nil; - {$EXTERNALSYM X509V3_EXT_conf_nid} - X509V3_EXT_conf_nid : function(conf: PLHASH; ctx: PX509V3_CTX; ext_nid: TIdC_INT; value: PIdAnsiChar): PX509_EXTENSION cdecl = nil; - {$EXTERNALSYM X509_EXTENSION_create_by_NID} - X509_EXTENSION_create_by_NID : function(ex: PPX509_EXTENSION; nid: TIdC_INT; - crit: TIdC_INT; data: PASN1_OCTET_STRING): PX509_EXTENSION cdecl = nil; - {$EXTERNALSYM X509V3_set_ctx} - X509V3_set_ctx : procedure(ctx: PX509V3_CTX; issuer, subject: PX509; req: PX509_REQ; crl: PX509_CRL; flags: TIdC_INT) cdecl = nil; - {$EXTERNALSYM X509_EXTENSION_free} - X509_EXTENSION_free : procedure(ex: PX509_EXTENSION) cdecl = nil; - {$EXTERNALSYM X509_add_ext} - X509_add_ext : function(cert: PX509; ext: PX509_EXTENSION; loc: TIdC_INT): TIdC_INT cdecl = nil; - {$IFNDEF OPENSSL_NO_BIO} - {$EXTERNALSYM X509_print} - X509_print : function(bp : PBIO; x : PX509) : TIdC_INT cdecl = nil; - {$ENDIF} - {$EXTERNALSYM X509_STORE_add_lookup} - X509_STORE_add_lookup : function (v : PX509_STORE; m : PX509_LOOKUP_METHOD) : PX509_LOOKUP cdecl = nil; - {$EXTERNALSYM X509_STORE_load_locations} - X509_STORE_load_locations : function ( ctx : PX509_STORE; const _file, path : PIdAnsiChar) : TIdC_INT cdecl = nil; - {$EXTERNALSYM SSL_CTX_set_cipher_list} - SSL_CTX_set_cipher_list : function(_para1: PSSL_CTX; const str: PIdAnsiChar): TIdC_INT cdecl = nil; - {$EXTERNALSYM SSL_CTX_new} - SSL_CTX_new : function(meth: PSSL_METHOD): PSSL_CTX cdecl = nil; - {$EXTERNALSYM SSL_CTX_free} - SSL_CTX_free : procedure(_para1: PSSL_CTX) cdecl = nil; - {$EXTERNALSYM SSL_set_fd} - SSL_set_fd : function(s: PSSL; fd: TIdC_INT): TIdC_INT cdecl = nil; - {$EXTERNALSYM SSL_CTX_use_PrivateKey_file} - SSL_CTX_use_PrivateKey_file : function(ctx: PSSL_CTX; const _file: PIdAnsiChar; _type: TIdC_INT): TIdC_INT cdecl = nil; - {$EXTERNALSYM SSL_CTX_use_PrivateKey} - SSL_CTX_use_PrivateKey : function(ctx: PSSL_CTX; pkey: PEVP_PKEY): TIdC_INT cdecl = nil; - {$EXTERNALSYM SSL_CTX_use_certificate} - SSL_CTX_use_certificate : function(ctx: PSSL_CTX; x: PX509): TIdC_INT cdecl = nil; - {$EXTERNALSYM SSL_CTX_use_certificate_file} - SSL_CTX_use_certificate_file : function(ctx: PSSL_CTX; const _file: PIdAnsiChar; _type: TIdC_INT): TIdC_INT cdecl = nil; - {$EXTERNALSYM SSL_CTX_use_certificate_chain_file} //OpenSSL 1.0.2 - SSL_CTX_use_certificate_chain_file : function(ctx : PSSL_CTX; _file : PIdAnsiChar) : TIdC_INT cdecl = nil; - {$EXTERNALSYM SSL_load_error_strings} - SSL_load_error_strings : procedure cdecl = nil; - {$EXTERNALSYM SSL_state_string_long} - SSL_state_string_long : function(s: PSSL): PIdAnsiChar cdecl = nil; - {$EXTERNALSYM SSL_alert_desc_string_long} - SSL_alert_desc_string_long : function(value : TIdC_INT) : PIdAnsiChar cdecl = nil; - {$EXTERNALSYM SSL_alert_type_string_long} - SSL_alert_type_string_long : function(value : TIdC_INT) : PIdAnsiChar cdecl = nil; - {$EXTERNALSYM SSL_get_peer_certificate} - SSL_get_peer_certificate : function(s: PSSL): PX509 cdecl = nil; - {$EXTERNALSYM SSL_CTX_set_verify} - SSL_CTX_set_verify : procedure(ctx: PSSL_CTX; mode: TIdC_INT; callback: TSSL_CTX_set_verify_callback) cdecl = nil; - {$EXTERNALSYM SSL_CTX_set_verify_depth} - SSL_CTX_set_verify_depth : procedure(ctx: PSSL_CTX; depth: TIdC_INT) cdecl = nil; - {$EXTERNALSYM SSL_CTX_get_verify_depth} - SSL_CTX_get_verify_depth : function (ctx: PSSL_CTX): TIdC_INT cdecl = nil; - {$EXTERNALSYM SSL_CTX_set_default_passwd_cb} - SSL_CTX_set_default_passwd_cb : procedure(ctx: PSSL_CTX; cb: ppem_password_cb) cdecl = nil; - {$EXTERNALSYM SSL_CTX_set_default_passwd_cb_userdata} - SSL_CTX_set_default_passwd_cb_userdata: procedure(ctx: PSSL_CTX; u: Pointer) cdecl = nil; - {$EXTERNALSYM SSL_CTX_check_private_key} - SSL_CTX_check_private_key : function(ctx: PSSL_CTX): TIdC_INT cdecl = nil; - - - {$EXTERNALSYM SSL_new} - SSL_new : function(ctx: PSSL_CTX): PSSL cdecl = nil; - {$EXTERNALSYM SSL_free} - SSL_free : procedure(ssl: PSSL) cdecl = nil; - {$EXTERNALSYM SSL_accept} - SSL_accept : function(ssl: PSSL): TIdC_INT cdecl = nil; - {$EXTERNALSYM SSL_connect} - SSL_connect : function(ssl: PSSL): TIdC_INT cdecl = nil; - {$EXTERNALSYM SSL_read} - SSL_read : function(ssl: PSSL; buf: Pointer; num: TIdC_INT): TIdC_INT cdecl = nil; - {$EXTERNALSYM SSL_peek} - SSL_peek : function(ssl: PSSL; buf: Pointer; num: TIdC_INT): TIdC_INT cdecl = nil; - {$EXTERNALSYM SSL_write} - SSL_write : function(ssl: PSSL; const buf: Pointer; num: TIdC_INT): TIdC_INT cdecl = nil; - {$EXTERNALSYM SSL_pending} - SSL_pending : function(ssl : PSSL) : TIdC_INT cdecl = nil; - {$EXTERNALSYM SSL_CTX_ctrl} - //long SSL_CTX_ctrl(SSL_CTX *ctx,int cmd, long larg, void *parg); - SSL_CTX_ctrl : function(ssl: PSSL_CTX; cmd: TIdC_INT; larg: TIdC_LONG; parg: Pointer): TIdC_LONG cdecl = nil; - {$EXTERNALSYM SSL_ctrl} - //long SSL_ctrl(SSL *ssl,int cmd, long larg, void *parg); - SSL_ctrl : function(ssl : PSSL; cmd : TIdC_INT; larg : TIdC_LONG; parg : Pointer) : TIdC_LONG cdecl = nil; - {$EXTERNALSYM SSL_callback_ctrl} - //long SSL_callback_ctrl(SSL *, int, void (*)(void)); - SSL_callback_ctrl : function(ssl : PSSL; cmd : TIdC_INT; fp : SSL_callback_ctrl_fp) : TIdC_LONG cdecl = nil; - {$EXTERNALSYM SSL_CTX_callback_ctrl} - //long SSL_CTX_callback_ctrl(SSL_CTX *, int, void (*)(void)); - SSL_CTX_callback_ctrl : function(ssl : PSSL_CTX; cmd : TIdC_INT; fp : SSL_callback_ctrl_fp) : TIdC_LONG cdecl = nil; - {$EXTERNALSYM SSL_get_error} - SSL_get_error : function(s: PSSL; ret_code: TIdC_INT): TIdC_INT cdecl = nil; - {$EXTERNALSYM SSLv2_method} - SSLv2_method : function: PSSL_METHOD cdecl = nil; // SSLv2 - {$EXTERNALSYM SSLv2_server_method} - SSLv2_server_method : function: PSSL_METHOD cdecl = nil; // SSLv2 - {$EXTERNALSYM SSLv2_client_method} - SSLv2_client_method : function: PSSL_METHOD cdecl = nil; // SSLv2 - {$EXTERNALSYM SSLv3_method} - SSLv3_method : function: PSSL_METHOD cdecl = nil; // SSLv3 - {$EXTERNALSYM SSLv3_server_method} - SSLv3_server_method : function: PSSL_METHOD cdecl = nil; // SSLv3 - {$EXTERNALSYM SSLv3_client_method} - SSLv3_client_method : function: PSSL_METHOD cdecl = nil; // SSLv3 - {$EXTERNALSYM SSLv23_method} - SSLv23_method : function: PSSL_METHOD cdecl = nil; // SSLv3 but can rollback to v2 - {$EXTERNALSYM SSLv23_server_method} - SSLv23_server_method : function: PSSL_METHOD cdecl = nil; // SSLv3 but can rollback to v2 - {$EXTERNALSYM SSLv23_client_method} - SSLv23_client_method : function: PSSL_METHOD cdecl = nil; // SSLv3 but can rollback to v2 - {$EXTERNALSYM TLSv1_method} - TLSv1_method : function: PSSL_METHOD cdecl = nil; // TLSv1.0 - {$EXTERNALSYM TLSv1_server_method} - TLSv1_server_method : function: PSSL_METHOD cdecl = nil; // TLSv1.0 - {$EXTERNALSYM TLSv1_client_method} - TLSv1_client_method : function: PSSL_METHOD cdecl = nil; // TLSv1.0 - {$EXTERNALSYM TLSv1_1_method} - TLSv1_1_method : function : PSSL_METHOD cdecl = nil; //TLS1.1 - {$EXTERNALSYM TLSv1_1_server_method} - TLSv1_1_server_method : function : PSSL_METHOD cdecl = nil; //TLS1.1 - {$EXTERNALSYM TLSv1_1_client_method} - TLSv1_1_client_method : function : PSSL_METHOD cdecl = nil; //TLS1.1 - {$EXTERNALSYM TLSv1_2_method} - TLSv1_2_method : function : PSSL_METHOD cdecl = nil; //* TLSv1.2 */ - {$EXTERNALSYM TLSv1_2_server_method} - TLSv1_2_server_method : function : PSSL_METHOD cdecl = nil; //* TLSv1.2 */ - {$EXTERNALSYM TLSv1_2_client_method} - TLSv1_2_client_method : function : PSSL_METHOD cdecl = nil; //* TLSv1.2 */ - - {$EXTERNALSYM DTLSv1_method} - DTLSv1_method : function: PSSL_METHOD cdecl = nil; // DTLSv1.0 - {$EXTERNALSYM DTLSv1_server_method} - DTLSv1_server_method : function: PSSL_METHOD cdecl = nil; // DTLSv1.0 - {$EXTERNALSYM DTLSv1_client_method} - DTLSv1_client_method : function: PSSL_METHOD cdecl = nil; // DTLSv1.0 - {$EXTERNALSYM SSL_shutdown} - SSL_shutdown : function(s: PSSL): TIdC_INT cdecl = nil; - {$EXTERNALSYM SSL_set_connect_state} - SSL_set_connect_state : procedure(s: PSSL) cdecl = nil; - {$EXTERNALSYM SSL_set_accept_state} - SSL_set_accept_state : procedure(s: PSSL) cdecl = nil; - {$EXTERNALSYM SSL_set_shutdown} - SSL_set_shutdown : procedure(ssl: PSSL; mode: TIdC_INT) cdecl = nil; - {$EXTERNALSYM SSL_CTX_load_verify_locations} - SSL_CTX_load_verify_locations : function(ctx: PSSL_CTX; const CAfile: PIdAnsiChar; const CApath: PIdAnsiChar): TIdC_INT cdecl = nil; - {$EXTERNALSYM SSL_get_session} - SSL_get_session : function(const ssl: PSSL): PSSL_SESSION cdecl = nil; - {$EXTERNALSYM SSLeay_add_ssl_algorithms} - SSLeay_add_ssl_algorithms : function: TIdC_INT cdecl = nil; - // SSL_set_app_data : function(s: PSSL; arg: Pointer): Integer cdecl = nil; - // SSL_get_app_data : function(s: PSSL): Pointer cdecl = nil; - {$EXTERNALSYM SSL_SESSION_get_id} - SSL_SESSION_get_id : function(const s: PSSL_SESSION; length: PIdC_UINT): PIdAnsiChar cdecl = nil; - {$EXTERNALSYM SSL_copy_session_id} - SSL_copy_session_id : procedure(sslTo: PSSL; const sslFrom: PSSL) cdecl = nil; - {$EXTERNALSYM X509_NAME_oneline} - X509_NAME_oneline : function(a: PX509_NAME; buf: PIdAnsiChar; size: TIdC_INT): PIdAnsiChar cdecl = nil; - {$EXTERNALSYM X509_NAME_cmp} - X509_NAME_cmp : function(const a, b: PX509_NAME): TIdC_INT cdecl = nil; - {$EXTERNALSYM X509_NAME_hash} - X509_NAME_hash : function(x: PX509_NAME): TIdC_ULONG cdecl = nil; - {$EXTERNALSYM X509_set_issuer_name} - X509_set_issuer_name : function(x: PX509; name: PX509_NAME): TIdC_INT cdecl = nil; - {$EXTERNALSYM X509_get_issuer_name} - X509_get_issuer_name : function(a: PX509): PX509_NAME cdecl = nil; - {$EXTERNALSYM X509_set_subject_name} - X509_set_subject_name : function(x: PX509; name: PX509_NAME): TIdC_INT cdecl = nil; - {$EXTERNALSYM X509_get_subject_name} - X509_get_subject_name : function(a: PX509): PX509_NAME cdecl = nil; - {$EXTERNALSYM OBJ_obj2nid} - OBJ_obj2nid : function (const o: PASN1_OBJECT): TIdC_INT cdecl = nil; - {$EXTERNALSYM OBJ_nid2obj} - OBJ_nid2obj : function (n : TIdC_INT) : PASN1_OBJECT cdecl = nil; - {$EXTERNALSYM OBJ_nid2ln} - OBJ_nid2ln : function (n : TIdC_INT) : PIdAnsiChar cdecl = nil; - {$EXTERNALSYM OBJ_nid2sn} - OBJ_nid2sn : function (n : TIdC_INT) : PIdAnsiChar cdecl = nil; - {$EXTERNALSYM X509_digest} - X509_digest : function(const data: PX509; const _type: PEVP_MD; - md: PByte; var len: TIdC_UINT): TIdC_INT cdecl = nil; - {$IFNDEF OPENSSL_NO_SHA512} - {$EXTERNALSYM EVP_sha512} - EVP_sha512 : function : PEVP_MD cdecl = nil; - {$EXTERNALSYM EVP_sha384} - EVP_sha384 : function : PEVP_MD cdecl = nil; - {$ENDIF} - {$IFNDEF OPENSSL_NO_SHA256} - {$EXTERNALSYM EVP_sha256} - EVP_sha256 : function : PEVP_MD cdecl = nil; - {$EXTERNALSYM EVP_sha224} - EVP_sha224 : function : PEVP_MD cdecl = nil; - {$ENDIF} - {$IFNDEF OPENSSL_NO_SHA} - {$EXTERNALSYM EVP_sha} - EVP_sha : function : PEVP_MD cdecl = nil; - {$EXTERNALSYM EVP_sha1} - EVP_sha1 : function: PEVP_MD cdecl = nil; - {$EXTERNALSYM EVP_dss} - EVP_dss : function : PEVP_MD cdecl = nil; - {$EXTERNALSYM EVP_dss1} - EVP_dss1 : function : PEVP_MD cdecl = nil; - {$EXTERNALSYM EVP_ecdsa} - EVP_ecdsa : function : PEVP_MD cdecl = nil; - {$ENDIF} - {$ifndef OPENSSL_NO_MDC2} - {$EXTERNALSYM EVP_mdc2} - EVP_mdc2 : function : PEVP_MD cdecl = nil; - {$endif} - {$IFNDEF OPENSSL_NO_MD5} - {$EXTERNALSYM EVP_md5} - EVP_md5 : function: PEVP_MD cdecl = nil; - {$ENDIF} - {$IFNDEF OPENSSL_NO_MD4} - {$EXTERNALSYM EVP_md4} - EVP_md4 : function: PEVP_MD cdecl = nil; - {$ENDIF} - {$IFNDEF OPENSSL_NO_MD2} - {$EXTERNALSYM EVP_md2} - EVP_md2 : function: PEVP_MD cdecl = nil; - {$ENDIF} - {$ifndef OPENSSL_NO_RIPEMD} - {$EXTERNALSYM EVP_ripemd160} - EVP_ripemd160: function: PEVP_MD cdecl = nil; - {$endif} - {$ifndef OPENSSL_NO_WHIRLPOOL} - {$EXTERNALSYM EVP_whirlpool} - EVP_whirlpool: function: PEVP_MD cdecl = nil; - {$endif} - {$EXTERNALSYM EVP_md_null} - EVP_md_null : function : PEVP_MD cdecl = nil; - {$ifndef OPENSSL_NO_DES} - {$EXTERNALSYM EVP_des_ecb} - EVP_des_ecb : function : PEVP_CIPHER cdecl = nil; - {$EXTERNALSYM EVP_des_ede} - EVP_des_ede : function : PEVP_CIPHER cdecl = nil; - {$EXTERNALSYM EVP_des_ede3} - EVP_des_ede3 : function : PEVP_CIPHER cdecl = nil; - {$EXTERNALSYM EVP_des_ede_ecb} - EVP_des_ede_ecb : function : PEVP_CIPHER cdecl = nil; - {$EXTERNALSYM EVP_des_ede3_ecb} - EVP_des_ede3_ecb : function : PEVP_CIPHER cdecl = nil; - {$EXTERNALSYM EVP_des_cfb64} - EVP_des_cfb64: function : PEVP_CIPHER cdecl = nil; -// # define EVP_des_cfb EVP_des_cfb64 - {$EXTERNALSYM EVP_des_cfb1} - EVP_des_cfb1: function : PEVP_CIPHER cdecl = nil; - {$EXTERNALSYM EVP_des_cfb8} - EVP_des_cfb8 : function : PEVP_CIPHER cdecl = nil; - {$EXTERNALSYM EVP_des_ede_cfb64} - EVP_des_ede_cfb64 :function : PEVP_CIPHER cdecl = nil; -//# define EVP_des_ede_cfb EVP_des_ede_cfb64 -//#if 0 - {/$EXTERNALSYM EVP_des_ede_cfb1} - //EVP_des_ede_cfb1 :function : PEVP_CIPHER cdecl = nil; - {/$EXTERNALSYM EVP_des_ede_cfb8} - //EVP_des_ede_cfb8 : function : PEVP_CIPHER cdecl = nil; -//#endif - {$EXTERNALSYM EVP_des_ede3_cfb64} - EVP_des_ede3_cfb64 :function : PEVP_CIPHER cdecl = nil; -//# define EVP_des_ede3_cfb EVP_des_ede3_cfb64 - {$EXTERNALSYM EVP_des_ede3_cfb1} - EVP_des_ede3_cfb1 :function : PEVP_CIPHER cdecl = nil; - {$EXTERNALSYM EVP_des_ede3_cfb8} - EVP_des_ede3_cfb8 :function : PEVP_CIPHER cdecl = nil; - {$EXTERNALSYM EVP_des_ofb} - EVP_des_ofb :function : PEVP_CIPHER cdecl = nil; - {$EXTERNALSYM EVP_des_ede_ofb} - EVP_des_ede_ofb :function : PEVP_CIPHER cdecl = nil; - {$EXTERNALSYM EVP_des_ede3_ofb} - EVP_des_ede3_ofb :function : PEVP_CIPHER cdecl = nil; - {$EXTERNALSYM EVP_des_cbc} - EVP_des_cbc :function : PEVP_CIPHER cdecl = nil; - {$EXTERNALSYM EVP_des_ede_cbc} - EVP_des_ede_cbc :function : PEVP_CIPHER cdecl = nil; -// EVP_des_ede3_cbc :function : PEVP_CIPHER cdecl = nil; - {$EXTERNALSYM EVP_desx_cbc} - EVP_desx_cbc :function : PEVP_CIPHER cdecl = nil; -//* This should now be supported through the dev_crypto ENGINE. But also, why are -// * rc4 and md5 declarations made here inside a "NO_DES" precompiler branch? */ -//#if 0 - {$ifdef OPENSSL_OPENBSD_DEV_CRYPTO} - {$EXTERNALSYM EVP_dev_crypto_des_ede3_cbc} - EVP_dev_crypto_des_ede3_cbc : function : PEVP_CIPHER cdecl = nil; - {$EXTERNALSYM EVP_dev_crypto_rc4} - EVP_dev_crypto_rc4 : function : PEVP_CIPHER cdecl = nil; - {$EXTERNALSYM EVP_dev_crypto_md5} - EVP_dev_crypto_md5 : function : PEVP_MD cdecl = nil; - {$endif} -//#endif - {$endif} - {$ifndef OPENSSL_NO_RC4} - {$EXTERNALSYM EVP_rc4} - EVP_rc4: function : PEVP_CIPHER cdecl = nil; - {$EXTERNALSYM EVP_rc4_40} - EVP_rc4_40: function : PEVP_CIPHER cdecl = nil; - {$ifndef OPENSSL_NO_MD5} - {$EXTERNALSYM EVP_rc4_hmac_md5} - EVP_rc4_hmac_md5: function : PEVP_CIPHER cdecl = nil; - {$endif} - {$endif} - {$ifndef OPENSSL_NO_IDEA} - {$EXTERNALSYM EVP_idea_ecb} - EVP_idea_ecb: function : PEVP_CIPHER cdecl = nil; - {$EXTERNALSYM EVP_idea_cfb64} - EVP_idea_cfb64: function : PEVP_CIPHER cdecl = nil; - {$EXTERNALSYM EVP_idea_ofb} - EVP_idea_ofb: function : PEVP_CIPHER cdecl = nil; - {$EXTERNALSYM EVP_idea_cbc} - EVP_idea_cbc: function : PEVP_CIPHER cdecl = nil; - {$endif} - {$ifndef OPENSSL_NO_RC2} - {$EXTERNALSYM EVP_rc2_ecb} - EVP_rc2_ecb: function : PEVP_CIPHER cdecl = nil; - {$EXTERNALSYM EVP_rc2_cbc} - EVP_rc2_cbc: function : PEVP_CIPHER cdecl = nil; - {$EXTERNALSYM EVP_rc2_40_cbc} - EVP_rc2_40_cbc: function : PEVP_CIPHER cdecl = nil; - {$EXTERNALSYM EVP_rc2_64_cbc} - EVP_rc2_64_cbc: function : PEVP_CIPHER cdecl = nil; - {$EXTERNALSYM EVP_rc2_cfb64} - EVP_rc2_cfb64: function : PEVP_CIPHER cdecl = nil; -//# define EVP_rc2_cfb EVP_rc2_cfb64 - {$EXTERNALSYM EVP_rc2_ofb} - EVP_rc2_ofb: function : PEVP_CIPHER cdecl = nil; - {$endif} - {$ifndef OPENSSL_NO_BF} - {$EXTERNALSYM EVP_bf_ecb} - EVP_bf_ecb: function : PEVP_CIPHER cdecl = nil; - {$EXTERNALSYM EVP_bf_cbc} - EVP_bf_cbc: function : PEVP_CIPHER cdecl = nil; - {$EXTERNALSYM EVP_bf_cfb64} - EVP_bf_cfb64: function : PEVP_CIPHER cdecl = nil; -//# define EVP_bf_cfb EVP_bf_cfb64 - {$EXTERNALSYM EVP_bf_ofb} - EVP_bf_ofb: function : PEVP_CIPHER cdecl = nil; - {$endif} - {$ifndef OPENSSL_NO_CAST} - {$EXTERNALSYM EVP_cast5_ecb} - EVP_cast5_ecb : function : PEVP_CIPHER cdecl = nil; - {$EXTERNALSYM EVP_cast5_cbc} - EVP_cast5_cbc : function : PEVP_CIPHER cdecl = nil; - {$EXTERNALSYM EVP_cast5_cfb64} - EVP_cast5_cfb64: function : PEVP_CIPHER cdecl = nil; -//# define EVP_cast5_cfb EVP_cast5_cfb64 - {$EXTERNALSYM EVP_cast5_ofb} - EVP_cast5_ofb: function : PEVP_CIPHER cdecl = nil; - {$endif} - {$ifndef OPENSSL_NO_RC5} - {$EXTERNALSYM EVP_rc5_32_12_16_cb} - EVP_rc5_32_12_16_cbc: function : PEVP_CIPHER cdecl = nil; - {$EXTERNALSYM EVP_rc5_32_12_16_ecb} - EVP_rc5_32_12_16_ecb: function : PEVP_CIPHER cdecl = nil; - {$EXTERNALSYM EVP_rc5_32_12_16_cfb64} - EVP_rc5_32_12_16_cfb64: function : PEVP_CIPHER cdecl = nil; - {$EXTERNALSYM EVP_rc5_32_12_16_ofb\} - EVP_rc5_32_12_16_ofb: function : PEVP_CIPHER cdecl = nil; - {$endif} - {$ifndef OPENSSL_NO_AES} - {$EXTERNALSYM EVP_aes_128_ecb} - EVP_aes_128_ecb: function : PEVP_CIPHER cdecl = nil; - {$EXTERNALSYM EVP_aes_128_cbc} - EVP_aes_128_cbc: function : PEVP_CIPHER cdecl = nil; - {$EXTERNALSYM EVP_aes_128_cfb1} - EVP_aes_128_cfb1: function : PEVP_CIPHER cdecl = nil; - {$EXTERNALSYM EVP_aes_128_cfb8} - EVP_aes_128_cfb8: function : PEVP_CIPHER cdecl = nil; - {$EXTERNALSYM EVP_aes_128_cfb128} - EVP_aes_128_cfb128: function : PEVP_CIPHER cdecl = nil; - {$EXTERNALSYM EVP_aes_128_ofb} - EVP_aes_128_ofb: function : PEVP_CIPHER cdecl = nil; - {$EXTERNALSYM EVP_aes_128_ctr} - EVP_aes_128_ctr: function : PEVP_CIPHER cdecl = nil; - {$EXTERNALSYM EVP_aes_128_gcm} - EVP_aes_128_gcm: function : PEVP_CIPHER cdecl = nil; - {$EXTERNALSYM EVP_aes_128_ccm} - EVP_aes_128_ccm: function : PEVP_CIPHER cdecl = nil; - {$EXTERNALSYM EVP_aes_128_xts} - EVP_aes_128_xts: function : PEVP_CIPHER cdecl = nil; - {$EXTERNALSYM EVP_aes_192_ecb} - EVP_aes_192_ecb: function : PEVP_CIPHER cdecl = nil; - {$EXTERNALSYM EVP_aes_192_cbc} - EVP_aes_192_cbc: function : PEVP_CIPHER cdecl = nil; - {$EXTERNALSYM EVP_aes_192_cfb1} - EVP_aes_192_cfb1: function : PEVP_CIPHER cdecl = nil; - {$EXTERNALSYM EVP_aes_192_cfb8} - EVP_aes_192_cfb8: function : PEVP_CIPHER cdecl = nil; - {$EXTERNALSYM EVP_aes_192_cfb128} - EVP_aes_192_cfb128: function : PEVP_CIPHER cdecl = nil; -//# define EVP_aes_192_cfb EVP_aes_192_cfb128 - {$EXTERNALSYM EVP_aes_192_ofb} - EVP_aes_192_ofb: function : PEVP_CIPHER cdecl = nil; - {$EXTERNALSYM EVP_aes_192_ctr} - EVP_aes_192_ctr: function : PEVP_CIPHER cdecl = nil; - {$EXTERNALSYM EVP_aes_192_gcm} - EVP_aes_192_gcm: function : PEVP_CIPHER cdecl = nil; - {$EXTERNALSYM EVP_aes_192_ccm} - EVP_aes_192_ccm: function : PEVP_CIPHER cdecl = nil; - {$EXTERNALSYM EVP_aes_256_ecb} - EVP_aes_256_ecb: function : PEVP_CIPHER cdecl = nil; - {$EXTERNALSYM EVP_aes_256_cbc} - EVP_aes_256_cbc: function : PEVP_CIPHER cdecl = nil; - {$EXTERNALSYM EVP_aes_256_cfb1} - EVP_aes_256_cfb1: function : PEVP_CIPHER cdecl = nil; - {$EXTERNALSYM EVP_aes_256_cfb8} - EVP_aes_256_cfb8: function : PEVP_CIPHER cdecl = nil; - {$EXTERNALSYM EVP_aes_256_cfb128} - EVP_aes_256_cfb128: function : PEVP_CIPHER cdecl = nil; - {$EXTERNALSYM EVP_aes_256_ofb} - EVP_aes_256_ofb: function : PEVP_CIPHER cdecl = nil; - {$EXTERNALSYM EVP_aes_256_ctr} - EVP_aes_256_ctr: function : PEVP_CIPHER cdecl = nil; - {$EXTERNALSYM EVP_aes_256_gcm} - EVP_aes_256_gcm: function : PEVP_CIPHER cdecl = nil; - {$EXTERNALSYM EVP_aes_256_ccm} - EVP_aes_256_ccm: function : PEVP_CIPHER cdecl = nil; - {$EXTERNALSYM EVP_aes_256_xts} - EVP_aes_256_xts: function : PEVP_CIPHER cdecl = nil; - {$ifndef OPENSSL_NO_SHA} - {$ifndef OPENSSL_NO_SHA1} - {$EXTERNALSYM EVP_aes_128_cbc_hmac_sha1} - EVP_aes_128_cbc_hmac_sha1 : function : PEVP_CIPHER cdecl = nil; - {$EXTERNALSYM EVP_aes_256_cbc_hmac_sha1} - EVP_aes_256_cbc_hmac_sha1 : function : PEVP_CIPHER cdecl = nil; - {$endif} - {$endif} - {$endif} - {$ifndef OPENSSL_NO_CAMELLIA} - {$EXTERNALSYM EVP_camellia_128_ecb} - EVP_camellia_128_ecb : function : PEVP_CIPHER cdecl = nil; - {$EXTERNALSYM EVP_camellia_128_cbc} - EVP_camellia_128_cbc : function : PEVP_CIPHER cdecl = nil; - {$EXTERNALSYM EVP_camellia_128_cfb1} - EVP_camellia_128_cfb1 : function : PEVP_CIPHER cdecl = nil; - {$EXTERNALSYM EVP_camellia_128_cfb8} - EVP_camellia_128_cfb8 : function : PEVP_CIPHER cdecl = nil; - {$EXTERNALSYM EVP_camellia_128_cfb128} - EVP_camellia_128_cfb128 : function : PEVP_CIPHER cdecl = nil; - {$EXTERNALSYM EVP_camellia_128_ofb} - EVP_camellia_128_ofb : function : PEVP_CIPHER cdecl = nil; - {$EXTERNALSYM EVP_camellia_192_ecb} - EVP_camellia_192_ecb : function : PEVP_CIPHER cdecl = nil; - {$EXTERNALSYM EVP_camellia_192_cbc} - EVP_camellia_192_cbc : function : PEVP_CIPHER cdecl = nil; - {$EXTERNALSYM EVP_camellia_192_cfb1} - EVP_camellia_192_cfb1 : function : PEVP_CIPHER cdecl = nil; - {$EXTERNALSYM EVP_camellia_192_cfb8} - EVP_camellia_192_cfb8 : function : PEVP_CIPHER cdecl = nil; - {$EXTERNALSYM EVP_camellia_192_cfb128} - EVP_camellia_192_cfb128 : function : PEVP_CIPHER cdecl = nil; - {$EXTERNALSYM EVP_camellia_192_ofb} - EVP_camellia_192_ofb : function : PEVP_CIPHER cdecl = nil; - {$EXTERNALSYM EVP_camellia_256_ecb} - EVP_camellia_256_ecb : function : PEVP_CIPHER cdecl = nil; - {$EXTERNALSYM EVP_camellia_256_cbc} - EVP_camellia_256_cbc : function : PEVP_CIPHER cdecl = nil; - {$EXTERNALSYM EVP_camellia_256_cfb1} - EVP_camellia_256_cfb1 : function : PEVP_CIPHER cdecl = nil; - {$EXTERNALSYM EVP_camellia_256_cfb8} - EVP_camellia_256_cfb8 : function : PEVP_CIPHER cdecl = nil; - {$EXTERNALSYM EVP_camellia_256_cfb128} - EVP_camellia_256_cfb128 : function : PEVP_CIPHER cdecl = nil; - {$EXTERNALSYM EVP_camellia_256_ofb} - EVP_camellia_256_ofb : function : PEVP_CIPHER cdecl = nil; - {$endif} - - {$ifndef OPENSSL_NO_SEED} - {$EXTERNALSYM EVP_seed_ecb} - EVP_seed_ecb : function : PEVP_CIPHER cdecl = nil; - {$EXTERNALSYM EVP_seed_cbc} - EVP_seed_cbc : function : PEVP_CIPHER cdecl = nil; - {$EXTERNALSYM EVP_seed_cfb128} - EVP_seed_cfb128 : function : PEVP_CIPHER cdecl = nil; - {$EXTERNALSYM EVP_seed_ofb} - EVP_seed_ofb : function : PEVP_CIPHER cdecl = nil; - {$endif} - {$EXTERNALSYM EVP_add_cipher} - EVP_add_cipher : function (cipher : PEVP_CIPHER) : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_add_digest} - EVP_add_digest : function(digest : PEVP_MD) : TIdC_INT cdecl = nil; - - {$EXTERNALSYM EVP_CIPHER_do_all} - EVP_CIPHER_do_all : procedure(fn : EVP_CIPHER_do_all_fn; arg : Pointer) cdecl = nil; - {$EXTERNALSYM EVP_CIPHER_do_all_sorted} - EVP_CIPHER_do_all_sorted : procedure(fn : EVP_CIPHER_do_all_fn; arg : Pointer) cdecl = nil; - {$EXTERNALSYM EVP_MD_do_all} - EVP_MD_do_all : procedure(fn : EVP_MD_do_all_fn; arg : Pointer) cdecl = nil; - {$EXTERNALSYM EVP_MD_do_all_sorted} - EVP_MD_do_all_sorted : procedure(fn : EVP_MD_do_all_fn; arg : Pointer) cdecl = nil; - - {$EXTERNALSYM EVP_PKEY_decrypt_old} - EVP_PKEY_decrypt_old : function(dec_key : PIdAnsiChar; - enc_key : PIdAnsiChar; enc_key_len : TIdC_INT; - private_key : PEVP_PKEY) : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_PKEY_encrypt_old} - EVP_PKEY_encrypt_old : function(enc_key : PIdAnsiChar; - key : PIdAnsiChar; key_len : TIdC_INT; - pub_key : PEVP_PKEY) : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_PKEY_type} - EVP_PKEY_type : function(_type : TIdC_INT) : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_PKEY_id} - EVP_PKEY_id : function(pkey : PEVP_PKEY) : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_PKEY_base_id} - EVP_PKEY_base_id : function(pkey : PEVP_PKEY) : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_PKEY_bits} - EVP_PKEY_bits : function(pkey : PEVP_PKEY) : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_PKEY_size} - EVP_PKEY_size : function(pkey : PEVP_PKEY) : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_PKEY_set_type} - EVP_PKEY_set_type : function(pkey : PEVP_PKEY;_type : TIdC_INT) : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_PKEY_set_type_str} - EVP_PKEY_set_type_str : function(pkey: PEVP_PKEY; str : PIdAnsiChar; len : TIdC_INT) : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_PKEY_get0} - EVP_PKEY_get0 : function(pkey : PEVP_PKEY) : Pointer cdecl = nil; - - {$ifndef OPENSSL_NO_RSA} -//struct rsa_st; - {$EXTERNALSYM EVP_PKEY_set1_RSA} - EVP_PKEY_set1_RSA: function(pkey : PEVP_PKEY;key : Prsa_st) : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_PKEY_get1_RSA} - EVP_PKEY_get1_RSA: function(pkey: PEVP_PKEY) : Prsa_st cdecl = nil; - {$endif} - {$ifndef OPENSSL_NO_DSA} -// struct dsa_st; - {$EXTERNALSYM EVP_PKEY_set1_DSA} - EVP_PKEY_set1_DSA: function(pkey : PEVP_PKEY; key : Pdsa_st) : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_PKEY_get1_DSA} - EVP_PKEY_get1_DSA: function(pkey : PEVP_PKEY) : Pdsa_st cdecl = nil; - {$endif} - {$ifndef OPENSSL_NO_DH} -// struct dh_st; - {$EXTERNALSYM EVP_PKEY_set1_DH} - EVP_PKEY_set1_DH: function(pkey : PEVP_PKEY; key : Pdh_st) : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_PKEY_get1_DH} - EVP_PKEY_get1_DH: function(pkey : PEVP_PKEY) : Pdh_st cdecl = nil; - {$endif} - {$ifndef OPENSSL_NO_EC} -// struct ec_key_st; - {$EXTERNALSYM EVP_PKEY_set1_EC_KEY} - EVP_PKEY_set1_EC_KEY : function(pkey : PEVP_PKEY; key : Pec_key_st) : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_PKEY_get1_EC_KEY} - EVP_PKEY_get1_EC_KEY : function(pkey : PEVP_PKEY) : Pec_key_st cdecl = nil; - {$endif} - - {$EXTERNALSYM d2i_PublicKey} - d2i_PublicKey : function(_type : TIdC_INT; a :PPEVP_PKEY; pp : PPIdAnsiChar; - length : TIdC_LONG) : PEVP_PKEY cdecl = nil; - {$EXTERNALSYM i2d_PublicKey} - i2d_PublicKey : function(a : PEVP_PKEY; pp : PPIdAnsiChar) : TIdC_INT cdecl = nil; - {$EXTERNALSYM d2i_AutoPrivateKey} - d2i_AutoPrivateKey : function(a : PPEVP_PKEY; pp : PPIdAnsiChar; - length : TIdC_LONG) : PEVP_PKEY cdecl = nil; - {$EXTERNALSYM EVP_PKEY_copy_parameters} - EVP_PKEY_copy_parameters : function(_to : PEVP_PKEY; from : PEVP_PKEY) : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_PKEY_missing_parameters} - EVP_PKEY_missing_parameters : function(pkey : PEVP_PKEY) : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_PKEY_save_parameters} - EVP_PKEY_save_parameters : function(pkey : PEVP_PKEY;mode : TIdC_INT) : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_PKEY_cmp_parameters} - EVP_PKEY_cmp_parameters : function(a : PEVP_PKEY; b : PEVP_PKEY) : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_PKEY_cmp} - EVP_PKEY_cmp : function(a : PEVP_PKEY; b : PEVP_PKEY) : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_PKEY_print_public} - EVP_PKEY_print_public : function(_out : PBIO; pkey : PEVP_PKEY; - indent : TIdC_INT; pctx : PASN1_PCTX) : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_PKEY_print_private} - EVP_PKEY_print_private : function(_out : PBIO; pkey : PEVP_PKEY; - indent : TIdC_INT; pctx : PASN1_PCTX) : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_PKEY_print_params} - EVP_PKEY_print_params : function(_out : PBIO; pkey : PEVP_PKEY; - indent : TIdC_INT; pctx : PASN1_PCTX) : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_PKEY_get_default_digest_nid} - EVP_PKEY_get_default_digest_nid : function(pkey : PEVP_PKEY; pnid : PIdC_INT) : TIdC_INT cdecl = nil; - -//* calls methods */ - {$EXTERNALSYM EVP_CIPHER_param_to_asn1} - EVP_CIPHER_param_to_asn1 : function(c : PEVP_CIPHER_CTX; _type : PASN1_TYPE) : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_CIPHER_asn1_to_param} - EVP_CIPHER_asn1_to_param : function(c : PEVP_CIPHER_CTX; _type : PASN1_TYPE) : TIdC_INT cdecl = nil; - -//* These are used by EVP_CIPHER methods */ - {$EXTERNALSYM EVP_CIPHER_set_asn1_iv} - EVP_CIPHER_set_asn1_iv : function(c : PEVP_CIPHER_CTX; _type : PASN1_TYPE) : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_CIPHER_get_asn1_iv} - EVP_CIPHER_get_asn1_iv : function(c : PEVP_CIPHER_CTX; _type : PASN1_TYPE) : TIdC_INT cdecl = nil; - -//* PKCS5 password based encryption */ - {$EXTERNALSYM PKCS5_PBE_keyivgen} - PKCS5_PBE_keyivgen : function(ctx : PEVP_CIPHER_CTX; pass : PIdAnsiChar; passlen : TIdC_INT; - param : PASN1_TYPE; cipher : PEVP_CIPHER; md : PEVP_MD; - en_de : TIdC_INT) : TIdC_INT cdecl = nil; - {$EXTERNALSYM PKCS5_PBKDF2_HMAC_SHA1} - PKCS5_PBKDF2_HMAC_SHA1 : function(pass : PIdAnsiChar; passlen : TIdC_INT; - salt : PIdAnsiChar; saltlen : TIdC_INT; iter : TIdC_INT; - keylen : TIdC_INT; _out : PIdAnsiChar) : TIdC_INT cdecl = nil; - {$EXTERNALSYM PKCS5_PBKDF2_HMAC} - PKCS5_PBKDF2_HMAC : function(pass : PIdAnsiChar; passlen : TIdC_INT; - salt : PIdAnsiChar; saltlen : TIdC_INT; iter : TIdC_INT; - digest : PEVP_MD; - keylen : TIdC_INT; _out : PIdAnsiChar) : TIdC_INT cdecl = nil; - {$EXTERNALSYM PKCS5_v2_PBE_keyivgen} - PKCS5_v2_PBE_keyivgen : function(ctx : PEVP_CIPHER_CTX; pass : PIdAnsiChar; passlen : TIdC_INT; - param : PASN1_TYPE; cipher : PEVP_CIPHER; md : PEVP_MD; - en_de : TIdC_INT) : TIdC_INT cdecl = nil; - {$EXTERNALSYM PKCS5_PBE_add} - PKCS5_PBE_add : procedure cdecl = nil; - {$EXTERNALSYM EVP_PBE_CipherInit} - EVP_PBE_CipherInit : function (pbe_obj : PASN1_OBJECT; pass : PIdAnsiChar; passlen : TIdC_INT; - param : PASN1_TYPE; ctx : PEVP_CIPHER_CTX; en_de : TIdC_INT) : TIdC_INT cdecl = nil; - - {$EXTERNALSYM EVP_PBE_alg_add_type} - - EVP_PBE_alg_add_type : function(pbe_type : TIdC_INT; pbe_nid : TIdC_INT; cipher_nid : TIdC_INT; md_nid : TIdC_INT; - keygen : PEVP_PBE_KEYGEN) : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_PBE_alg_add} - EVP_PBE_alg_add : function(nid : TIdC_INT; cipher : PEVP_CIPHER; md : PEVP_MD; - keygen :PEVP_PBE_KEYGEN) : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_PBE_find} - EVP_PBE_find : function(_type : TIdC_INT; pbe_nid : TIdC_INT; - pcnid : PIdC_INT; pmnid : PIdC_INT; var pkeygen : PEVP_PBE_KEYGEN) : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_PBE_cleanup} - EVP_PBE_cleanup : procedure cdecl = nil; - - {$EXTERNALSYM EVP_PKEY_asn1_get_count} - EVP_PKEY_asn1_get_count : function : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_PKEY_asn1_get0} - EVP_PKEY_asn1_get0 : function(idx : TIdC_INT) : PEVP_PKEY_ASN1_METHOD cdecl = nil; - {$EXTERNALSYM EVP_PKEY_asn1_find} - EVP_PKEY_asn1_find : function(pe :PPENGINE; _type : TIdC_INT) : PEVP_PKEY_ASN1_METHOD cdecl = nil; - {$EXTERNALSYM EVP_PKEY_asn1_find_str} - EVP_PKEY_asn1_find_str : function(pe : PPENGINE; - str : PIdAnsiChar; len : TIdC_INT) : PEVP_PKEY_ASN1_METHOD cdecl = nil; - {$EXTERNALSYM EVP_PKEY_asn1_add0} - EVP_PKEY_asn1_add0 : function(ameth : PEVP_PKEY_ASN1_METHOD) : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_PKEY_asn1_add_alias} - EVP_PKEY_asn1_add_alias : function(_to : TIdC_INT; from : TIdC_INT) : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_PKEY_asn1_get0_info} - EVP_PKEY_asn1_get0_info : function(ppkey_id : PIdC_int; pkey_base_id : PIdC_INT; ppkey_flags : PIdC_INT; - pinfo : PPIdAnsiChar; ppem_str : PPIdAnsiChar; - ameth : PEVP_PKEY_ASN1_METHOD) : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_PKEY_get0_asn1} - EVP_PKEY_get0_asn1 : function(pkey : PEVP_PKEY) : PEVP_PKEY_ASN1_METHOD cdecl = nil; - {$EXTERNALSYM EVP_PKEY_asn1_new} - EVP_PKEY_asn1_new : function(id : TIdC_INT; flags : TIdC_INT; - pem_str : PIdAnsiChar; info : PIdAnsiChar) : PEVP_PKEY_ASN1_METHOD cdecl = nil; - {$EXTERNALSYM EVP_PKEY_asn1_copy} - EVP_PKEY_asn1_copy : procedure(dst : PEVP_PKEY_ASN1_METHOD; - src : PEVP_PKEY_ASN1_METHOD) cdecl = nil; - {$EXTERNALSYM EVP_PKEY_asn1_free} - EVP_PKEY_asn1_free : procedure(ameth : PEVP_PKEY_ASN1_METHOD) cdecl = nil; - - {$EXTERNALSYM EVP_PKEY_asn1_set_public} - EVP_PKEY_asn1_set_public : procedure(ameth : PEVP_PKEY_ASN1_METHOD; - pub_decode : EVP_PKEY_asn1_set_public_pub_decode; - pub_encode : EVP_PKEY_asn1_set_public_pub_encode; - pub_cmp : EVP_PKEY_asn1_set_public_pub_cmp; - pub_print : EVP_PKEY_asn1_set_public_pub_print; - pkey_size : EVP_PKEY_asn1_set_public_pub_pkey_size; - pkey_bits : EVP_PKEY_asn1_set_public_pkey_bits) cdecl = nil; - {$EXTERNALSYM EVP_PKEY_asn1_set_private} - EVP_PKEY_asn1_set_private : procedure(ameth : PEVP_PKEY_ASN1_METHOD; - priv_decode : EVP_PKEY_asn1_set_private_priv_decode; - priv_encode : EVP_PKEY_asn1_set_private_priv_encode; - priv_print : EVP_PKEY_asn1_set_private_priv_print) cdecl = nil; - {$EXTERNALSYM EVP_PKEY_asn1_set_param} - EVP_PKEY_asn1_set_param : procedure(ameth : PEVP_PKEY_ASN1_METHOD; - param_decode : EVP_PKEY_asn1_set_param_param_decode; - param_encode : EVP_PKEY_asn1_set_param_param_encode; - param_missing : EVP_PKEY_asn1_set_param_param_missing; - param_copy : EVP_PKEY_asn1_set_param_param_copy; - param_cmp : EVP_PKEY_asn1_set_param_param_cmp; - param_print : EVP_PKEY_asn1_set_param_param_print) cdecl = nil; - {$EXTERNALSYM EVP_PKEY_asn1_set_free} - EVP_PKEY_asn1_set_free : procedure(ameth : PEVP_PKEY_ASN1_METHOD; - pkey_free : EVP_PKEY_asn1_set_free_pkey_free) cdecl = nil; - {$EXTERNALSYM EVP_PKEY_asn1_set_ctrl} - EVP_PKEY_asn1_set_ctrl : procedure(ameth : PEVP_PKEY_ASN1_METHOD; - pkey_ctrl : EVP_PKEY_asn1_set_ctr_pkey_ctrl) cdecl = nil; - - {$EXTERNALSYM EVP_PKEY_meth_find} - EVP_PKEY_meth_find : function (_type : TIdC_INT) : PEVP_PKEY_METHOD cdecl = nil; - {$EXTERNALSYM EVP_PKEY_meth_new} - EVP_PKEY_meth_new : function(id : TIdC_INT; flags : TIdC_INT) : PEVP_PKEY_METHOD cdecl = nil; - {$EXTERNALSYM EVP_PKEY_meth_get0_info} - EVP_PKEY_meth_get0_info : procedure(ppkey_id : PIdC_INT; pflags : PIdC_INT; - meth : PEVP_PKEY_METHOD) cdecl = nil; - {$EXTERNALSYM EVP_PKEY_meth_copy} - EVP_PKEY_meth_copy : procedure(dst : PEVP_PKEY_METHOD; src : PEVP_PKEY_METHOD) cdecl = nil; - {$EXTERNALSYM EVP_PKEY_meth_free} - EVP_PKEY_meth_free : procedure(pmeth : PEVP_PKEY_METHOD) cdecl =nil; - {$EXTERNALSYM EVP_PKEY_meth_add0} - EVP_PKEY_meth_add0 : function(pmeth : PEVP_PKEY_METHOD) : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_PKEY_CTX_new} - EVP_PKEY_CTX_new : function(pkey : PEVP_PKEY; e : PENGINE) : PEVP_PKEY_CTX cdecl = nil; - {$EXTERNALSYM EVP_PKEY_CTX_new_id} - EVP_PKEY_CTX_new_id : function(id : TIdC_INT; e : PENGINE) : PEVP_PKEY_CTX cdecl = nil; - {$EXTERNALSYM EVP_PKEY_CTX_dup} - EVP_PKEY_CTX_dup : function(ctx : PEVP_PKEY_CTX) : PEVP_PKEY_CTX cdecl = nil; - {$EXTERNALSYM EVP_PKEY_CTX_free} - EVP_PKEY_CTX_free : procedure(ctx : PEVP_PKEY_CTX) cdecl = nil; - {$EXTERNALSYM EVP_PKEY_CTX_ctrl} - EVP_PKEY_CTX_ctrl : function(ctx : PEVP_PKEY_CTX; keytype : TIdC_INT; optype : TIdC_INT; - cmd : TIdC_INT; p1 : TIdC_INT; p2 : Pointer) : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_PKEY_CTX_ctrl_str} - EVP_PKEY_CTX_ctrl_str : function(ctx : PEVP_PKEY_CTX; _type : PIdAnsiChar; - value : PIdAnsiChar) : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_PKEY_CTX_get_operation} - EVP_PKEY_CTX_get_operation : function(ctx : PEVP_PKEY_CTX) : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_PKEY_CTX_set0_keygen_info} - EVP_PKEY_CTX_set0_keygen_info : procedure(ctx : PEVP_PKEY_CTX; dat : PIdC_INT; datlen : TIdC_INT) cdecl = nil; - {$EXTERNALSYM EVP_PKEY_new_mac_key} - EVP_PKEY_new_mac_key : function(_type : TIdC_INT; e : PENGINE; - key : PIdAnsiChar; keylen : TIdC_INT) : PEVP_PKEY cdecl = nil; - {$EXTERNALSYM EVP_PKEY_CTX_set_data} - EVP_PKEY_CTX_set_data : procedure(ctx : PEVP_PKEY_CTX; data : Pointer) cdecl = nil; - {$EXTERNALSYM EVP_PKEY_CTX_get_data} - EVP_PKEY_CTX_get_data : function(ctx : PEVP_PKEY_CTX) : Pointer cdecl = nil; - {$EXTERNALSYM EVP_PKEY_CTX_get0_pkey} - EVP_PKEY_CTX_get0_pkey : function(ctx : PEVP_PKEY_CTX) : PEVP_PKEY cdecl = nil; - {$EXTERNALSYM EVP_PKEY_CTX_get0_peerkey} - EVP_PKEY_CTX_get0_peerkey : function(ctx : PEVP_PKEY_CTX) : PEVP_PKEY cdecl = nil; - {$EXTERNALSYM EVP_PKEY_CTX_set_app_data} - EVP_PKEY_CTX_set_app_data : procedure(ctx : PEVP_PKEY_CTX; data : Pointer) cdecl = nil; - {$EXTERNALSYM EVP_PKEY_CTX_get_app_data} - EVP_PKEY_CTX_get_app_data : function(ctx : PEVP_PKEY_CTX) : Pointer cdecl = nil; - {$EXTERNALSYM EVP_PKEY_sign_init} - EVP_PKEY_sign_init : function(ctx : PEVP_PKEY_CTX) : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_PKEY_sign} - EVP_PKEY_sign : function(ctx : PEVP_PKEY_CTX; - sig : PIdAnsiChar; siglen : Psize_t; - tbs : PIdAnsiChar; tbslen : size_t) : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_PKEY_verify_init} - EVP_PKEY_verify_init : function(ctx : PEVP_PKEY_CTX) : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_PKEY_verify} - EVP_PKEY_verify : function(ctx : PEVP_PKEY_CTX; - sig : PIdAnsiChar; siglen : size_t; - tbs : PIdAnsiChar; tbslen : size_t) : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_PKEY_verify_recover_init} - EVP_PKEY_verify_recover_init : function(ctx : PEVP_PKEY_CTX) : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_PKEY_verify_recover} - EVP_PKEY_verify_recover : function(ctx : PEVP_PKEY_CTX; - rout : PIdAnsiChar; routlen : Psize_t; - sig : PIdAnsiChar; siglen : size_t) : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_PKEY_encrypt_init} - EVP_PKEY_encrypt_init : function(ctx : PEVP_PKEY_CTX) : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_PKEY_encrypt} - EVP_PKEY_encrypt : function(ctx : PEVP_PKEY_CTX; - _out : PIdAnsiChar; outlen : Psize_t; - _in : PIdAnsiChar; inlen : size_t) : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_PKEY_decrypt_init} - EVP_PKEY_decrypt_init : function(ctx : PEVP_PKEY_CTX) : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_PKEY_decrypt} - EVP_PKEY_decrypt : function(ctx : PEVP_PKEY_CTX; - _out : PIdAnsiChar; outlen : Psize_t; - _in : PIdAnsiChar; inlen : size_t) : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_PKEY_derive_init} - EVP_PKEY_derive_init : function(ctx : PEVP_PKEY_CTX) : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_PKEY_derive_set_peer} - EVP_PKEY_derive_set_peer : function(ctx : PEVP_PKEY_CTX; peer : PEVP_PKEY) : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_PKEY_derive} - EVP_PKEY_derive : function(ctx : PEVP_PKEY_CTX; key : PIdAnsiChar; keylen : Psize_t) : TIdC_INT cdecl = nil; - - - {$EXTERNALSYM EVP_PKEY_paramgen_init} - EVP_PKEY_paramgen_init: function(ctx : PEVP_PKEY_CTX) : TIdC_INT cdecl; - {$EXTERNALSYM EVP_PKEY_paramgen} - EVP_PKEY_paramgen : function(ctx : PEVP_PKEY_CTX; ppkey : PPEVP_PKEY) : TIdC_INT; - {$EXTERNALSYM EVP_PKEY_keygen_init} - EVP_PKEY_keygen_init : function(ctx : PEVP_PKEY_CTX) : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_PKEY_keygen} - EVP_PKEY_keygen : function(ctx : PEVP_PKEY_CTX; ppkey : PPEVP_PKEY) : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_PKEY_CTX_set_cb} - EVP_PKEY_CTX_set_cb : procedure(ctx : PEVP_PKEY_CTX; cb : EVP_PKEY_gen_cb) cdecl = nil; - {$EXTERNALSYM EVP_PKEY_CTX_get_cb} - EVP_PKEY_CTX_get_cb : function(ctx : PEVP_PKEY_CTX) : EVP_PKEY_gen_cb cdecl = nil; - {$EXTERNALSYM EVP_PKEY_CTX_get_keygen_info} - EVP_PKEY_CTX_get_keygen_info : function(ctx : PEVP_PKEY_CTX; idx : TIdC_INT) : TIdC_INT cdecl = nil; - {$EXTERNALSYM EVP_PKEY_meth_set_init} - EVP_PKEY_meth_set_init : procedure(pmeth : PEVP_PKEY_METHOD; - init : EVP_PKEY_meth_set_init_init) cdecl = nil; - {$EXTERNALSYM EVP_PKEY_meth_set_copy} - EVP_PKEY_meth_set_copy : procedure (pmeth : PEVP_PKEY_METHOD; - copy : EVP_PKEY_meth_set_copy_copy) cdecl = nil; - {$EXTERNALSYM EVP_PKEY_meth_set_cleanup} - EVP_PKEY_meth_set_cleanup : procedure(pmeth : PEVP_PKEY_METHOD; - cleanup : EVP_PKEY_meth_set_cleanup_cleanup) cdecl = nil; - {$EXTERNALSYM EVP_PKEY_meth_set_paramgen} - EVP_PKEY_meth_set_paramgen : procedure(pmeth : PEVP_PKEY_METHOD; - paramgen_init : EVP_PKEY_meth_set_paramgen_paramgen_init; - paramgen : EVP_PKEY_meth_set_paramgen_paramgen); - {$EXTERNALSYM EVP_PKEY_meth_set_keygen} - EVP_PKEY_meth_set_keygen : procedure(pmeth : PEVP_PKEY_METHOD; - keygen_init : EVP_PKEY_meth_set_keygen_keygen_init; - keygen : EVP_PKEY_meth_set_keygen_keygen) cdecl = nil; - {$EXTERNALSYM EVP_PKEY_meth_set_sign} - EVP_PKEY_meth_set_sign : procedure(pmeth : PEVP_PKEY_METHOD; - sign_init : EVP_PKEY_meth_set_sign_sign_init; - sign : EVP_PKEY_meth_set_sign_sign) cdecl = nil; - {$EXTERNALSYM EVP_PKEY_meth_set_verify} - EVP_PKEY_meth_set_verify : procedure(pmeth : PEVP_PKEY_METHOD; - verify_init : EVP_PKEY_meth_set_verify_verify_init; - verify : EVP_PKEY_meth_set_verify_verify) cdecl = nil; - {$EXTERNALSYM EVP_PKEY_meth_set_verify_recover} - EVP_PKEY_meth_set_verify_recover : procedure(pmeth : PEVP_PKEY_METHOD; - verify_recover_init : EVP_PKEY_meth_set_verify_recover_verify_recover_init; - verify_recover : EVP_PKEY_meth_set_verify_recover_verify_recover) cdecl = nil; - {$EXTERNALSYM EVP_PKEY_meth_set_signctx} - EVP_PKEY_meth_set_signctx : procedure(pmeth : PEVP_PKEY_METHOD; - signctx_init : EVP_PKEY_meth_set_signctx_signctx_init; - signctx : EVP_PKEY_meth_set_signctx_signctx) cdecl = nil; - {$EXTERNALSYM EVP_PKEY_meth_set_verifyctx} - EVP_PKEY_meth_set_verifyctx : procedure(pmeth : PEVP_PKEY_METHOD; - verifyctx_init : EVP_PKEY_meth_set_verifyctx_verifyctx_init; - verifyctx : EVP_PKEY_meth_set_verifyctx_verifyctx) cdecl = nil; - {$EXTERNALSYM EVP_PKEY_meth_set_encrypt} - EVP_PKEY_meth_set_encrypt : procedure(pmeth : PEVP_PKEY_METHOD; - encrypt_init : EVP_PKEY_meth_set_encrypt_encrypt_init; - encryptfn : EVP_PKEY_meth_set_encrypt_encryptfn) cdecl = nil; - {$EXTERNALSYM EVP_PKEY_meth_set_decrypt} - EVP_PKEY_meth_set_decrypt : procedure(pmeth : PEVP_PKEY_METHOD; - decrypt_init : EVP_PKEY_meth_set_decrypt_decrypt_init; - decrypt : EVP_PKEY_meth_set_decrypt_decrypt); - {$EXTERNALSYM EVP_PKEY_meth_set_derive} - EVP_PKEY_meth_set_derive : procedure(pmeth : PEVP_PKEY_METHOD; - derive_init : EVP_PKEY_meth_set_derive_derive_init; - derive : EVP_PKEY_meth_set_derive_derive) cdecl = nil; - {$EXTERNALSYM EVP_PKEY_meth_set_ctrl} - EVP_PKEY_meth_set_ctrl : procedure(pmeth : PEVP_PKEY_METHOD; - ctrl : EVP_PKEY_meth_set_ctrl_ctrl; - ctrl_str : EVP_PKEY_meth_set_ctrlctrl_str) cdecl = nil; - - {$EXTERNALSYM d2i_PrivateKey_bio} - d2i_PrivateKey_bio : function(bp : PBIO; a : PPEVP_PKEY) : PEVP_PKEY cdecl = nil; - {$EXTERNALSYM X509_LOOKUP_ctrl} - X509_LOOKUP_ctrl : function(ctx : PX509_LOOKUP; cmd : TIdC_INT; argc : PIdAnsiChar; arg1 : TIdC_LONG; ret : PPIdAnsiChar) : TIdC_INT cdecl = nil; - {$EXTERNALSYM X509_STORE_add_cert} - X509_STORE_add_cert : function (ctx : PX509_STORE; x : PX509) : TIdC_INT cdecl = nil; - {$EXTERNALSYM X509_STORE_add_crl} - X509_STORE_add_crl : function (ctx : PX509_STORE; x : PX509_CRL) : TIdC_INT cdecl = nil; - {$EXTERNALSYM X509_STORE_CTX_get_ex_data} - X509_STORE_CTX_get_ex_data : function(ctx: PX509_STORE_CTX; idx: TIdC_INT): Pointer cdecl = nil; - {$EXTERNALSYM X509_STORE_CTX_get_error} - X509_STORE_CTX_get_error : function(ctx: PX509_STORE_CTX): TIdC_INT cdecl = nil; - {$EXTERNALSYM X509_STORE_CTX_set_error} - X509_STORE_CTX_set_error : procedure(ctx: PX509_STORE_CTX; s: TIdC_INT) cdecl = nil; - {$EXTERNALSYM X509_STORE_CTX_get_error_depth} - X509_STORE_CTX_get_error_depth : function(ctx: PX509_STORE_CTX): TIdC_INT cdecl = nil; - {$EXTERNALSYM X509_STORE_CTX_get_current_cert} - X509_STORE_CTX_get_current_cert : function(ctx: PX509_STORE_CTX): PX509 cdecl = nil; - {$EXTERNALSYM _CRYPTO_num_locks} - _CRYPTO_num_locks : function: TIdC_INT cdecl = nil; // return CRYPTO_NUM_LOCKS (shared libs!) - {$EXTERNALSYM CRYPTO_set_locking_callback} - CRYPTO_set_locking_callback : procedure(func: TIdSslLockingCallback) cdecl = nil; - {$EXTERNALSYM CRYPTO_set_id_callback} - CRYPTO_set_id_callback : procedure(func: TIdSslIdCallback) cdecl = nil; - // 3DES functions - {$EXTERNALSYM DES_set_odd_parity} - DES_set_odd_parity: procedure(key: Pdes_cblock) cdecl = nil; - {$EXTERNALSYM DES_set_key} - DES_set_key: function(key: Pconst_DES_cblock; schedule: DES_key_schedule): TIdC_INT cdecl = nil; - {$EXTERNALSYM DES_ecb_encrypt} - DES_ecb_encrypt: procedure(input, output: Pconst_DES_cblock; ks: DES_key_schedule; enc: TIdC_INT) cdecl = nil; - //old DES functions - {$EXTERNALSYM Id_ossl_old_des_set_odd_parity} - Id_ossl_old_des_set_odd_parity : procedure (key : p_ossl_old_des_cblock) cdecl = nil; - {$EXTERNALSYM Id_ossl_old_des_set_key} - Id_ossl_old_des_set_key : function (key : P_ossl_old_des_cblock; schedule : _ossl_old_des_key_schedule) : TIdC_INT cdecl = nil; - {$EXTERNALSYM Id_ossl_old_des_ecb_encrypt} - Id_ossl_old_des_ecb_encrypt : procedure ( input : p_ossl_old_des_cblock; output : p_ossl_old_des_cblock; ks : p_ossl_old_des_key_schedule; enc : TIdC_int) cdecl = nil; - //More SSL functions - {$EXTERNALSYM SSL_set_ex_data} - SSL_set_ex_data: function(ssl: PSSL; idx: TIdC_INT; data: Pointer): TIdC_INT cdecl = nil; - {$EXTERNALSYM SSL_get_ex_data} - SSL_get_ex_data: function(ssl: PSSL; idx: TIdC_INT): Pointer cdecl = nil; - {$EXTERNALSYM PKCS12_create} - PKCS12_create: function(pass, name: PIdAnsiChar; pkey: PEVP_PKEY; cert : PX509; - ca: PSTACK_OF_X509; nid_key, nid_cert, iter, mac_iter, keytype : TIdC_INT) : PPKCS12 cdecl = nil; - {$EXTERNALSYM i2d_PKCS12_bio} - i2d_PKCS12_bio: function(b: PBIO; p12: PPKCS12) : TIdC_INT cdecl = nil; - {$EXTERNALSYM PKCS12_free} - PKCS12_free: procedure(p12: PPKCS12) cdecl = nil; - {$EXTERNALSYM SSL_load_client_CA_file} - SSL_load_client_CA_file: function(const _file: PIdAnsiChar): PSTACK_OF_X509_NAME cdecl = nil; - {$EXTERNALSYM SSL_CTX_set_client_CA_list} - SSL_CTX_set_client_CA_list: procedure(ctx: PSSL_CTX; list: PSTACK_OF_X509_NAME) cdecl = nil; - {$EXTERNALSYM SSL_CTX_set_default_verify_paths} - SSL_CTX_set_default_verify_paths: function(ctx: PSSL_CTX): TIdC_INT cdecl = nil; - {$EXTERNALSYM SSL_CTX_set_session_id_context} - SSL_CTX_set_session_id_context: function(ctx: PSSL_CTX; const sid_ctx: PByte; sid_ctx_len: TIdC_UINT): TIdC_INT cdecl = nil; - {$EXTERNALSYM SSL_CIPHER_description} - SSL_CIPHER_description: function(_para1: PSSL_CIPHER; buf: PIdAnsiChar; size: TIdC_INT): PIdAnsiChar cdecl = nil; - {$EXTERNALSYM SSL_get_current_cipher} - SSL_get_current_cipher: function(const s: PSSL): PSSL_CIPHER cdecl = nil; - {$EXTERNALSYM SSL_CIPHER_get_name} - SSL_CIPHER_get_name: function(const c: PSSL_CIPHER): PIdAnsiChar cdecl = nil; - {$EXTERNALSYM SSL_CIPHER_get_version} - SSL_CIPHER_get_version: function(const c: PSSL_CIPHER): PIdAnsiChar cdecl = nil; - {$EXTERNALSYM SSL_CIPHER_get_bits} - SSL_CIPHER_get_bits: function(const c: PSSL_CIPHER; var alg_bits: TIdC_INT): TIdC_INT cdecl = nil; - //experimental - {$EXTERNALSYM ERR_error_string_n} - ERR_error_string_n: procedure(e: TIdC_ULONG; buf: PIdAnsiChar; len : size_t) cdecl = nil; - {$EXTERNALSYM ERR_put_error} - ERR_put_error : procedure (lib, func, reason : TIdC_INT; _file : PIdAnsiChar; line : TIdC_INT) cdecl = nil; - {$EXTERNALSYM ERR_get_error} - ERR_get_error : function: TIdC_ULONG cdecl = nil; - {$EXTERNALSYM ERR_peek_error} - ERR_peek_error : function: TIdC_ULONG cdecl = nil; - {$EXTERNALSYM ERR_peek_last_error} - ERR_peek_last_error : function : TIdC_ULONG cdecl = nil; - {$EXTERNALSYM ERR_clear_error} - ERR_clear_error : procedure cdecl = nil; - {$EXTERNALSYM ERR_error_string} - ERR_error_string : function (e: TIdC_ULONG; buf: PIdAnsiChar): PIdAnsiChar cdecl = nil; - {$EXTERNALSYM ERR_lib_error_string} - ERR_lib_error_string : function(e : TIdC_ULONG): PIdAnsiChar cdecl = nil; - {$EXTERNALSYM ERR_func_error_string} - ERR_func_error_string : function(e : TIdC_ULONG): PIdAnsiChar cdecl = nil; - {$EXTERNALSYM ERR_reason_error_string} - ERR_reason_error_string : function(e : TIdC_ULONG): PIdAnsiChar cdecl = nil; - {$EXTERNALSYM ERR_load_ERR_strings} - ERR_load_ERR_strings : procedure cdecl = nil; - {$EXTERNALSYM ERR_load_crypto_strings} - ERR_load_crypto_strings : procedure cdecl = nil; - {$EXTERNALSYM ERR_free_strings} - ERR_free_strings : procedure cdecl = nil; - {$EXTERNALSYM ERR_remove_thread_state} - ERR_remove_thread_state : procedure(const tId : PCRYPTO_THREADID) cdecl = nil; - - {$EXTERNALSYM ERR_remove_state} - ERR_remove_state : procedure(pid: TIdC_ULONG) cdecl = nil; - {$EXTERNALSYM CRYPTO_cleanup_all_ex_data} - CRYPTO_cleanup_all_ex_data : procedure cdecl = nil; - {$EXTERNALSYM SSL_COMP_get_compression_methods} - SSL_COMP_get_compression_methods : function: PSTACK_OF_SSL_COMP cdecl = nil; - {$EXTERNALSYM SSL_COMP_free_compression_methods} - SSL_COMP_free_compression_methods : procedure; cdecl = nil; - {$EXTERNALSYM sk_pop_free} - sk_pop_free : procedure(st: PSTACK; func: Tsk_pop_free_func) cdecl = nil; - {$EXTERNALSYM sk_dup} - sk_dup : function (st : PSTACK) : PSTACK cdecl = nil; - {$EXTERNALSYM sk_find} - sk_find : function (st : PSTACK; Data : PIdAnsiChar) : TIdC_INT cdecl = nil; -{$IFDEF OPENSSL_FIPS} -{Note that I'm doing things this way so that we can have wrapper functions that hide -any IFDEF's and cases where the FIPS functions aren't in the .DLL} - {$EXTERNALSYM _FIPS_mode_set} - _FIPS_mode_set : function(onoff : TIdC_INT) : TIdC_INT cdecl = nil; - {$EXTERNALSYM _FIPS_mode} - _FIPS_mode : function () : TIdC_INT cdecl = nil; -{$ENDIF} - -{$IFNDEF OPENSSL_NO_HMAC} -{ -NOTE: - -There is breakage between OpenSSL 0.9.x and OpenSSL 1.0x. Some HMAC functions -were changed to return a result code. MOst of this is ugly but necessary to -work around the issues involved. Basically, the result of the C functions is -changed from "void" to "int" so that they can return failure. -} -//void HMAC_CTX_init(HMAC_CTX *ctx); - {$EXTERNALSYM HMAC_CTX_init} - HMAC_CTX_init : procedure(ctx : PHMAC_CTX) cdecl = nil; - -//void HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len, -// const EVP_MD *md, ENGINE *impl); - {$EXTERNALSYM _HMAC_Init_ex} - _HMAC_Init_ex : procedure(ctx : PHMAC_CTX; key : Pointer; len : TIdC_INT; - md : PEVP_MD; impl : PENGINE) cdecl = nil; -//OpenSSL 1.0 -//int HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len, -// const EVP_MD *md, ENGINE *impl); - {$EXTERNALSYM _1_0_HMAC_Init_ex} - _1_0_HMAC_Init_ex : function(ctx : PHMAC_CTX; key : Pointer; len : TIdC_INT; - md : PEVP_MD; impl : PENGINE) : TIdC_INT cdecl = nil; -//void HMAC_Update(HMAC_CTX *ctx, const unsigned char *data, size_t len); - {$EXTERNALSYM _HMAC_Update} - _HMAC_Update : procedure(ctx : PHMAC_CTX; data : PIdAnsiChar; len : size_t) cdecl = nil; - //OpenSSL 1.0 - {$EXTERNALSYM _1_0_HMAC_Update} -//int HMAC_Update(HMAC_CTX *ctx, const unsigned char *data, size_t len); - _1_0_HMAC_Update : function(ctx : PHMAC_CTX; data : PIdAnsiChar; len : size_t) : TIdC_INT cdecl = nil; - //void HMAC_Final(HMAC_CTX *ctx, unsigned char *md, unsigned int *len); - {$EXTERNALSYM _HMAC_Final} - _HMAC_Final : procedure(ctx : PHMAC_CTX; md : PIdAnsiChar; len : PIdC_UINT) cdecl = nil; -//OpenSSL 1.0 - {$EXTERNALSYM _1_0_HMAC_Final} -// int HMAC_Final(HMAC_CTX *ctx, unsigned char *md, unsigned int *len); - _1_0_HMAC_Final : function(ctx : PHMAC_CTX; md : PIdAnsiChar; len : PIdC_UINT) : TIdC_INT cdecl = nil; -//void HMAC_CTX_cleanup(HMAC_CTX *ctx); - {$EXTERNALSYM HMAC_CTX_cleanup} - HMAC_CTX_cleanup : procedure (ctx : PHMAC_CTX) cdecl = nil; - - {$EXTERNALSYM HMAC_Init_ex} -procedure HMAC_Init_ex(ctx : PHMAC_CTX; key : Pointer; len : TIdC_INT; - md : PEVP_MD; impl : PENGINE); - {$EXTERNALSYM HMAC_Update} -procedure HMAC_Update(ctx : PHMAC_CTX; data : PIdAnsiChar; len : size_t); - {$EXTERNALSYM HMAC_Final} -procedure HMAC_Final(ctx : PHMAC_CTX; md : PIdAnsiChar; len : PIdC_UINT); -{$ENDIF} - -{begin stack fancy stuff} -{ -For the sk functions having a type, you have to typecase one procedural pointer -as another procedural pointer. In the headers, these are defined in -safestack.h. -} -type - {$EXTERNALSYM Tsk_X509_NAME_new} - Tsk_X509_NAME_new = function(cmp : Tsk_new_cmp) : PSTACK_OF_X509_NAME cdecl; - {$EXTERNALSYM Tsk_X509_NAME_new_null} - Tsk_X509_NAME_new_null = function : PSTACK_OF_X509_NAME cdecl; - {$EXTERNALSYM Tsk_X509_NAME_free} - Tsk_X509_NAME_free = procedure(st : PSTACK_OF_X509_NAME) cdecl; - {$EXTERNALSYM Tsk_X509_NAME_num} - Tsk_X509_NAME_num = function (const sk : PSTACK_OF_X509_NAME) : TIdC_INT cdecl; - {$EXTERNALSYM Tsk_X509_NAME_value} - Tsk_X509_NAME_value = function (const sk : PSTACK_OF_X509_NAME; i : TIdC_INT) : PX509_NAME cdecl; - {$EXTERNALSYM Tsk_X509_NAME_push} - Tsk_X509_NAME_push = function (sk : PSTACK_OF_X509_NAME; st : PX509_NAME) : TIdC_INT cdecl; - {$EXTERNALSYM Tsk_X509_NAME_dup} - Tsk_X509_NAME_dup = function (sk : PSTACK_OF_X509_NAME) : PSTACK_OF_X509_NAME cdecl; - {$EXTERNALSYM Tsk_X509_NAME_find} - Tsk_X509_NAME_find = function (sk : PSTACK_OF_X509_NAME; val : PX509_NAME) : TIdC_INT cdecl; - {$EXTERNALSYM Tsk_X509_NAME_pop_free} - Tsk_X509_NAME_pop_free = procedure (sk : PSTACK_OF_X509_NAME; func: Tsk_pop_free_func) cdecl; - - {$EXTERNALSYM Tsk_X509_INFO_num} - Tsk_X509_INFO_num = function (const sk : PSTACK_OF_X509_INFO) : TIdC_INT cdecl; - {$EXTERNALSYM Tsk_X509_INFO_value} - Tsk_X509_INFO_value = function (const sk : PSTACK_OF_X509_INFO; i : TIdC_INT) : PX509_INFO cdecl; - {$EXTERNALSYM Tsk_X509_INFO_push} - Tsk_X509_INFO_push = function (sk : PSTACK_OF_X509_INFO; st : PX509_INFO) : TIdC_INT cdecl; - {$EXTERNALSYM Tsk_X509_INFO_dup} - Tsk_X509_INFO_dup = function (sk : PSTACK_OF_X509_INFO) : PSTACK_OF_X509_INFO cdecl; - {$EXTERNALSYM Tsk_X509_INFO_find} - Tsk_X509_INFO_find = function (sk : PSTACK_OF_X509_INFO; val : PX509_INFO) : TIdC_INT cdecl; - {$EXTERNALSYM Tsk_X509_INFO_pop_free} - Tsk_X509_INFO_pop_free = procedure (sk : PSTACK_OF_X509_INFO; func: Tsk_pop_free_func) cdecl; - -var - {$EXTERNALSYM sk_X509_NAME_new} - sk_X509_NAME_new: Tsk_X509_NAME_new absolute sk_new; - {$EXTERNALSYM sk_X509_NAME_new_null} - sk_X509_NAME_new_null : Tsk_X509_NAME_new_null absolute sk_new_null; - {$EXTERNALSYM sk_X509_NAME_free} - sk_X509_NAME_free : Tsk_X509_NAME_free absolute sk_free; - {$EXTERNALSYM sk_X509_NAME_num} - sk_X509_NAME_num : Tsk_X509_NAME_num absolute sk_num; - {$EXTERNALSYM sk_X509_NAME_value} - sk_X509_NAME_value : Tsk_X509_NAME_value absolute sk_value; - {$EXTERNALSYM sk_X509_NAME_push} - sk_X509_NAME_push : Tsk_X509_NAME_push absolute sk_push; - {$EXTERNALSYM sk_X509_NAME_dup} - sk_X509_NAME_dup : Tsk_X509_NAME_dup absolute sk_dup; - {$EXTERNALSYM sk_X509_NAME_find} - sk_X509_NAME_find : Tsk_X509_NAME_find absolute sk_find; - {$EXTERNALSYM sk_X509_NAME_pop_free} - sk_X509_NAME_pop_free : Tsk_X509_NAME_pop_free absolute sk_pop_free; - {$EXTERNALSYM sk_X509_INFO_num} - sk_X509_INFO_num : Tsk_X509_INFO_num absolute sk_num; - {$EXTERNALSYM sk_X509_INFO_value} - sk_X509_INFO_value : Tsk_X509_INFO_value absolute sk_value; - {$EXTERNALSYM sk_X509_INFO_push} - sk_X509_INFO_push : Tsk_X509_INFO_push absolute sk_push; - {$EXTERNALSYM sk_X509_INFO_dup} - sk_X509_INFO_dup : Tsk_X509_INFO_dup absolute sk_dup; - {$EXTERNALSYM sk_X509_INFO_find} - sk_X509_INFO_find : Tsk_X509_INFO_find absolute sk_find; - {$EXTERNALSYM sk_X509_INFO_pop_free} - sk_X509_INFO_pop_free : Tsk_X509_INFO_pop_free absolute sk_pop_free; -{end} - - {$EXTERNALSYM FIPS_mode_set} -function FIPS_mode_set(onoff : TIdC_INT) : TIdC_INT; {$IFDEF INLINE}inline;{$ENDIF} - {$EXTERNALSYM FIPS_mode} -function FIPS_mode() : TIdC_INT; {$IFDEF INLINE}inline;{$ENDIF} - - -{begin other stuff} - {$EXTERNALSYM UTC_Time_Decode} -function UTC_Time_Decode(UCTtime : PASN1_UTCTIME; var year, month, day, hour, min, sec: Word; - var tz_hour, tz_min: Integer): Integer; - {$EXTERNALSYM SSL_set_app_data} -function SSL_set_app_data(s: PSSL; arg: Pointer): TIdC_INT; - {$EXTERNALSYM SSL_get_app_data} -function SSL_get_app_data(s: PSSL): Pointer; -// -function Load: Boolean; -procedure Unload; -{$IFNDEF STATICLOAD_OPENSSL} -function WhichFailedToLoad: String; -function GetSSLLibHandle : TIdLibHandle; -function GetCryptLibHandle : TIdLibHandle; -procedure IdOpenSSLSetLibPath(const APath: String); - {$IFDEF UNIX} -procedure IdOpenSSLSetCanLoadSymLinks(ACanLoad: Boolean); -procedure IdOpenSSLSetLoadSymLinksFirst(ALoadFirst: Boolean); - {$ENDIF} -{$ENDIF} -// -procedure InitializeRandom; -procedure CleanupRandom; - - {$EXTERNALSYM M_ASN1_STRING_length} -function M_ASN1_STRING_length(x : PASN1_STRING): TIdC_INT; - {$EXTERNALSYM M_ASN1_STRING_length_set} -procedure M_ASN1_STRING_length_set(x : PASN1_STRING; n : TIdC_INT); - {$EXTERNALSYM M_ASN1_STRING_type} -function M_ASN1_STRING_type(x : PASN1_STRING) : TIdC_INT; - {$EXTERNALSYM M_ASN1_STRING_data} -function M_ASN1_STRING_data(x : PASN1_STRING) : PIdAnsiChar; - {$EXTERNALSYM X509_NAME_dup} -function X509_NAME_dup(xn : PX509_NAME) : PX509_NAME; - {$EXTERNALSYM X509_STORE_CTX_get_app_data} -function X509_STORE_CTX_get_app_data(ctx: PX509_STORE_CTX):Pointer; - {$EXTERNALSYM X509_get_version} -function X509_get_version(x : PX509): TIdC_LONG; - {$EXTERNALSYM X509_get_signature_type} -function X509_get_signature_type(x : PX509) : TIdC_INT; - {$EXTERNALSYM X509_REQ_get_subject_name} -function X509_REQ_get_subject_name(x:PX509_REQ):PX509_NAME; - {$EXTERNALSYM X509_get_notBefore} -function X509_get_notBefore(x509: PX509):PASN1_TIME; - {$EXTERNALSYM X509_get_notAfter} -function X509_get_notAfter(x509: PX509):PASN1_TIME; - {$EXTERNALSYM X509_REQ_get_version} -function X509_REQ_get_version(x : PX509_REQ): TIdC_LONG; - {$EXTERNALSYM X509_CRL_get_version} -function X509_CRL_get_version(x : PX509_CRL) : TIdC_LONG; - {$EXTERNALSYM X509_CRL_get_lastUpdate} -function X509_CRL_get_lastUpdate(x : PX509_CRL) : PASN1_TIME; - {$EXTERNALSYM X509_CRL_get_nextUpdate} -function X509_CRL_get_nextUpdate(x : PX509_CRL) : PASN1_TIME; - {$EXTERNALSYM X509_CRL_get_issuer} -function X509_CRL_get_issuer(x : PX509_CRL) : PX509_NAME; - {$EXTERNALSYM X509_CRL_get_REVOKED} -function X509_CRL_get_REVOKED(x : PX509_CRL) : PSTACK_OF_X509_REVOKED; - {$EXTERNALSYM SSL_CTX_set_info_callback} -procedure SSL_CTX_set_info_callback(ctx: PSSL_CTX; cb: PSSL_CTX_info_callback); - {$EXTERNALSYM SSL_CTX_set_options} -function SSL_CTX_set_options(ctx: PSSL_CTX; op: TIdC_LONG):TIdC_LONG; - {$EXTERNALSYM SSL_CTX_clear_options} -function SSL_CTX_clear_options(ctx : PSSL_CTX; op : TIdC_LONG):TIdC_LONG; - {$EXTERNALSYM SSL_CTX_get_options} -function SSL_CTX_get_options(ctx: PSSL_CTX) : TIdC_LONG; - {$EXTERNALSYM SSL_set_options} -function SSL_set_options(ssl: PSSL; op : TIdC_LONG): TIdC_LONG; - {$EXTERNALSYM SSL_clear_mode} -function SSL_clear_mode(ssl : PSSL; op : TIdC_LONG) : TIdC_LONG; - {$EXTERNALSYM SSL_get_options} -function SSL_get_options(ssl : PSSL): TIdC_LONG; - {$EXTERNALSYM SSL_CTX_set_mode} -function SSL_CTX_set_mode(ctx : PSSL_CTX; op : TIdC_LONG) : TIdC_LONG; - {$EXTERNALSYM SSL_CTX_clear_mode} -function SSL_CTX_clear_mode(ctx : PSSL_CTX; op : TIdC_LONG) : TIdC_LONG; - {$EXTERNALSYM SSL_CTX_get_mode} -function SSL_CTX_get_mode(ctx : PSSL_CTX) : TIdC_LONG; - {$EXTERNALSYM SSL_set_mtu} -function SSL_set_mtu(ssl : PSSL; mtu : TIdC_LONG) : TIdC_LONG; - {$EXTERNALSYM SSL_get_secure_renegotiation_support} -function SSL_get_secure_renegotiation_support(ssl : PSSL) : TIdC_LONG; - {$EXTERNALSYM SSL_CTX_sess_number} -function SSL_CTX_sess_number(ctx : PSSL_CTX) : TIdC_LONG; - {$EXTERNALSYM SSL_CTX_sess_connect} -function SSL_CTX_sess_connect(ctx : PSSL_CTX) : TIdC_LONG; - {$EXTERNALSYM SSL_CTX_sess_connect_good} -function SSL_CTX_sess_connect_good(ctx : PSSL_CTX): TIdC_LONG; - {$EXTERNALSYM SSL_CTX_sess_connect_renegotiate} -function SSL_CTX_sess_connect_renegotiate(ctx : PSSL_CTX): TIdC_LONG; - {$EXTERNALSYM SSL_CTX_sess_accept} -function SSL_CTX_sess_accept(ctx : PSSL_CTX) : TIdC_LONG; - {$EXTERNALSYM SSL_CTX_sess_accept_renegotiate} -function SSL_CTX_sess_accept_renegotiate(ctx : PSSL_CTX) : TIdC_LONG; - {$EXTERNALSYM SSL_CTX_sess_accept_good} -function SSL_CTX_sess_accept_good(ctx : PSSL_CTX) : TIdC_LONG; - {$EXTERNALSYM SSL_CTX_sess_hits} -function SSL_CTX_sess_hits(ctx : PSSL_CTX) : TIdC_LONG; - {$EXTERNALSYM SSL_CTX_sess_cb_hits} -function SSL_CTX_sess_cb_hits(ctx : PSSL_CTX) : TIdC_LONG; - {$EXTERNALSYM SSL_CTX_sess_misses} -function SSL_CTX_sess_misses(ctx : PSSL_CTX) : TIdC_LONG; - {$EXTERNALSYM SSL_CTX_sess_timeouts} -function SSL_CTX_sess_timeouts(ctx : PSSL_CTX) : TIdC_LONG; - {$EXTERNALSYM SSL_CTX_sess_cache_full} -function SSL_CTX_sess_cache_full(ctx : PSSL_CTX) : TIdC_LONG; - {$EXTERNALSYM SSL_CTX_sess_set_cache_size} -function SSL_CTX_sess_set_cache_size(ctx : PSSL_CTX; t : TIdC_LONG) : TIdC_LONG; - {$EXTERNALSYM SSL_CTX_sess_get_cache_size} -function SSL_CTX_sess_get_cache_size(ctx : PSSL_CTX) : TIdC_LONG; - {$EXTERNALSYM SSL_CTX_set_session_cache_mode} -function SSL_CTX_set_session_cache_mode(ctx : PSSL_CTX; m : TIdC_LONG) : TIdC_LONG; - {$EXTERNALSYM SSL_CTX_get_session_cache_mode} -function SSL_CTX_get_session_cache_mode(ctx : PSSL_CTX) : TIdC_LONG; - {$EXTERNALSYM SSL_CTX_get_read_ahead} -function SSL_CTX_get_read_ahead(ctx : PSSL_CTX) : TIdC_LONG; - {$EXTERNALSYM SSL_CTX_set_read_ahead} -function SSL_CTX_set_read_ahead(ctx : PSSL_CTX; m : TIdC_LONG) : TIdC_LONG; - {$EXTERNALSYM SSL_CTX_get_max_cert_list} -function SSL_CTX_get_max_cert_list(ctx : PSSL_CTX) : TIdC_LONG; - {$EXTERNALSYM SSL_CTX_set_max_cert_list} -function SSL_CTX_set_max_cert_list(ctx : PSSL_CTX; m : TIdC_LONG) : TIdC_LONG; - {$EXTERNALSYM SSL_get_max_cert_list} -function SSL_get_max_cert_list(ssl : PSSL) : TIdC_LONG; - {$EXTERNALSYM SSL_set_max_cert_list} -function SSL_set_max_cert_list(ssl : PSSL; m : TIdC_LONG) : TIdC_LONG; - {$EXTERNALSYM DTLSv1_get_timeout} -function DTLSv1_get_timeout(ssl : PSSL; var arg : timeval) : TIdC_LONG; - {$EXTERNALSYM DTLSv1_handle_timeout} -function DTLSv1_handle_timeout(ssl : PSSL) : TIdC_LONG; - {$EXTERNALSYM DTLSv1_listen} -function DTLSv1_listen(ssl : PSSL; var peer : sockaddr) : TIdC_LONG; - {$EXTERNALSYM SSL_session_reused} -function SSL_session_reused(ssl : PSSL) : TIdC_LONG; - {$EXTERNALSYM SSL_num_renegotiations} -function SSL_num_renegotiations(ssl : PSSL) : TIdC_LONG; - {$EXTERNALSYM SSL_clear_num_renegotiations} -function SSL_clear_num_renegotiations(ssl : PSSL) : TIdC_LONG; - {$EXTERNALSYM SSL_total_renegotiations} -function SSL_total_renegotiations(ssl : PSSL) : TIdC_LONG; - {$EXTERNALSYM SSL_CTX_need_tmp_RSA} -function SSL_CTX_need_tmp_RSA(ctx : PSSL_CTX) : TIdC_LONG; - {$EXTERNALSYM SSL_CTX_set_tmp_rsa} -function SSL_CTX_set_tmp_rsa(ctx : PSSL_CTX; rsa : PRSA) : TIdC_LONG; - {$EXTERNALSYM SSL_CTX_set_tmp_dh} -function SSL_CTX_set_tmp_dh(ctx : PSSL_CTX; dh : PDH) : TIdC_LONG; - {$EXTERNALSYM SSL_CTX_set_tmp_ecdh} -function SSL_CTX_set_tmp_ecdh(ctx : PSSL_CTX; ecdh : PEC_KEY) : TIdC_LONG; - {$EXTERNALSYM SSL_CTX_set_ecdh_auto} -function SSL_CTX_set_ecdh_auto(ctx : PSSL_CTX; m : TIdC_LONG) : TIdC_LONG; - {$EXTERNALSYM SSL_need_tmp_RSA} -function SSL_need_tmp_RSA(ssl : PSSL) : TIdC_LONG; - {$EXTERNALSYM SSL_set_tmp_rsa} -procedure SSL_set_tmp_rsa(ssl : PSSL; rsa : PRSA); - {$EXTERNALSYM SSL_set_tmp_dh} -function SSL_set_tmp_dh(ssl : PSSL;dh : PDH) : TIdC_LONG; - {$EXTERNALSYM SSL_set_tmp_ecdh} -function SSL_set_tmp_ecdh(ssl : PSSL; ecdh : PEC_KEY) : TIdC_LONG; - {$EXTERNALSYM SSL_CTX_add0_chain_cert} //OpenSSL 1.0.2 -function SSL_CTX_add0_chain_cert(ctx : PSSL_CTX; x509 : PX509) : TIdC_LONG; - {$EXTERNALSYM SSL_CTX_add1_chain_cert} //OpenSSL 1.0.2 -function SSL_CTX_add1_chain_cert(ctx : PSSL_CTX; x509 : PX509) : TIdC_LONG; - {$EXTERNALSYM SSL_CTX_add_extra_chain_cert} -function SSL_CTX_add_extra_chain_cert(ctx : PSSL_CTX; x509 : PX509) : TIdC_LONG; - {$EXTERNALSYM SSL_CTX_get_extra_chain_certs} -function SSL_CTX_get_extra_chain_certs(ctx : PSSL_CTX; var px509 : px509) : TIdC_LONG; - {$EXTERNALSYM SSL_CTX_get_extra_chain_certs_only} -function SSL_CTX_get_extra_chain_certs_only(ctx: PSSL_CTX;var PX509 :PX509) : TIdC_LONG; - {$EXTERNALSYM SSL_CTX_clear_extra_chain_certs} -function SSL_CTX_clear_extra_chain_certs(ctx : PSSL_CTX) : TIdC_LONG; - {$EXTERNALSYM SSL_CTX_set0_chain} //OpenSSL 1.0.2 -function SSL_CTX_set0_chain(ctx:PSSL_CTX; sk : PSTACK_OF_X509) : TIdC_LONG; - {$EXTERNALSYM SSL_CTX_set1_chain} //OpenSSL 1.0.2 -function SSL_CTX_set1_chain(ctx:PSSL_CTX; sk : PSTACK_OF_X509) : TIdC_LONG; - {$EXTERNALSYM SSL_CTX_get0_chain_certs} //OpenSSL 1.0.2 -function SSL_CTX_get0_chain_certs(ctx :PSSL_CTX; var px509 :PX509) : TIdC_LONG; - {$EXTERNALSYM SSL_CTX_clear_chain_certs} //OpenSSL 1.0.2 -function SSL_CTX_clear_chain_certs(ctx :PSSL_CTX) : TIdC_LONG; - -{$IFNDEF OPENSSL_NO_TLSEXT} - {$EXTERNALSYM SSL_set_tlsext_host_name} -function SSL_set_tlsext_host_name(s : PSSL; name : string) : TIdC_LONG; - {$EXTERNALSYM SSL_set_tlsext_debug_callback} -function SSL_set_tlsext_debug_callback(ssl : PSSL; cb : SSL_callback_ctrl_fp) : TIdC_LONG; - {$EXTERNALSYM SSL_set_tlsext_debug_arg} -function SSL_set_tlsext_debug_arg(ssl : PSSL; arg : Pointer) : TIdC_LONG; - {$EXTERNALSYM SSL_set_tlsext_status_type} -function SSL_set_tlsext_status_type(ssl : PSSL; _type : TIdC_LONG):TIdC_LONG; - {$EXTERNALSYM SSL_get_tlsext_status_exts} -function SSL_get_tlsext_status_exts(ssl : PSSL; arg : Pointer): TIdC_LONG; - {$EXTERNALSYM SSL_set_tlsext_status_exts} -function SSL_set_tlsext_status_exts(ssl : PSSL; arg : Pointer):TIdC_LONG; - {$EXTERNALSYM SSL_get_tlsext_status_ids} -function SSL_get_tlsext_status_ids(ssl : PSSL; arg : Pointer) : TIdC_LONG; - {$EXTERNALSYM SSL_set_tlsext_status_ids} -function SSL_set_tlsext_status_ids(ssl : PSSL; arg : Pointer) : TIdC_LONG; - {$EXTERNALSYM SSL_get_tlsext_status_ocsp_resp} -function SSL_get_tlsext_status_ocsp_resp(ssl : PSSL; arg : Pointer) : TIdC_LONG; - {$EXTERNALSYM SSL_set_tlsext_status_ocsp_resp} -function SSL_set_tlsext_status_ocsp_resp(ssl : PSSL; arg : Pointer; arglen : TIdC_LONG) : TIdC_LONG; - {$EXTERNALSYM SSL_CTX_set_tlsext_servername_callback} -function SSL_CTX_set_tlsext_servername_callback(ctx : PSSL_CTX; cb :SSL_callback_ctrl_fp):TIdC_LONG; - {$EXTERNALSYM SSL_CTX_get_tlsext_ticket_keys} -function SSL_CTX_get_tlsext_ticket_keys(ctx : PSSL_CTX; keys : PIdAnsiChar; keylen : TIdC_LONG ) : TIdC_LONG; - {$EXTERNALSYM SSL_CTX_set_tlsext_status_cb} -function SSL_CTX_set_tlsext_status_cb(ssl : PSSL_CTX; cb : TSSL_CTX_set_tlsext_status_cb) :TIdC_LONG; - {$EXTERNALSYM SSL_set_tlsext_opaque_prf_input} -function SSL_set_tlsext_opaque_prf_input(s : PSSL; src : PIdAnsiChar; len : TIdC_LONG ) : TIdC_LONG; - {$EXTERNALSYM SSL_CTX_set_tlsext_opaque_prf_input_callback} -function SSL_CTX_set_tlsext_opaque_prf_input_callback(ctx : PSSL_CTX; cb : TSSL_CTX_set_tlsext_opaque_prf_input_callback_cb) : TIdC_LONG; - {$EXTERNALSYM SSL_CTX_set_tlsext_opaque_prf_input_callback_arg} -function SSL_CTX_set_tlsext_opaque_prf_input_callback_arg(ctx : PSSL_CTX; arg : Pointer) : TIdC_LONG; - {$EXTERNALSYM SSL_CTX_set_tlsext_ticket_key_cb} -function SSL_CTX_set_tlsext_ticket_key_cb(ssl : PSSL_CTX; cb : TSSL_CTX_set_tlsext_ticket_key_cb_fp) : TIdC_LONG; -{$ifndef OPENSSL_NO_HEARTBEATS} - {$EXTERNALSYM SSL_heartbeat} -function SSL_heartbeat(ssl : PSSL) : TIdC_LONG; - {$EXTERNALSYM SSL_get_tlsext_heartbeat_pending} -function SSL_get_tlsext_heartbeat_pending(ssl : PSSL) : TIdC_LONG; - {$EXTERNALSYM SSL_set_tlsext_heartbeat_no_requests} -function SSL_set_tlsext_heartbeat_no_requests(ssl : PSSL; arg : TIdC_LONG) : TIdC_LONG; -{$endif} -{$ENDIF} - - {$EXTERNALSYM TLS1_get_version} -function TLS1_get_version(s : PSSL) : TIdC_INT; - {$EXTERNALSYM TLS1_get_client_version} -function TLS1_get_client_version(s : PSSL) : TIdC_INT; - {$EXTERNALSYM SSL_CTX_get_version} -function SSL_CTX_get_version(ctx: PSSL_CTX):TIdC_INT; -//* BIO_s_connect() and BIO_s_socks4a_connect() */ - {$EXTERNALSYM BIO_set_conn_hostname} -function BIO_set_conn_hostname(b : PBIO; name : PIdAnsiChar) : TIdC_LONG; - {$EXTERNALSYM BIO_set_conn_port} -function BIO_set_conn_port(b : PBIO; port : PIdAnsiChar) : TIdC_LONG; - {$EXTERNALSYM BIO_set_conn_ip} -function BIO_set_conn_ip(b : PBIO; ip : PIdAnsiChar) : TIdC_LONG; - {$EXTERNALSYM BIO_set_conn_int_port} -function BIO_set_conn_int_port(b : PBIO; port : PIdAnsiChar) : TIdC_LONG; - {$EXTERNALSYM BIO_get_conn_hostname} -function BIO_get_conn_hostname(b : PBIO) : PIdAnsiChar; - {$EXTERNALSYM BIO_get_conn_port} -function BIO_get_conn_port(b : PBIO) : PIdAnsiChar; - {$EXTERNALSYM BIO_get_conn_ip} -function BIO_get_conn_ip(b : PBIO) : PIdAnsiChar; - {$EXTERNALSYM BIO_get_conn_int_port} -function BIO_get_conn_int_port(b : PBIO) : TIdC_LONG; - {$EXTERNALSYM BIO_set_nbio} -function BIO_set_nbio(b : PBIO; n : TIdC_LONG) : TIdC_LONG; -//* BIO_s_accept_socket() */ - {$EXTERNALSYM BIO_set_accept_port} -function BIO_set_accept_port(b : PBIO; name : PIdAnsiChar) : TIdC_LONG; - {$EXTERNALSYM BIO_get_accept_port} -function BIO_get_accept_port(b : PBIO) : PIdAnsiChar; - {$EXTERNALSYM BIO_set_nbio_accept} -function BIO_set_nbio_accept(b : PBIO; n : TIdC_INT) : TIdC_LONG; - {$EXTERNALSYM BIO_set_accept_bios} -function BIO_set_accept_bios(b : PBIO; bio : PBIO) : TIdC_LONG; - {$EXTERNALSYM BIO_set_bind_mode} -function BIO_set_bind_mode(b : PBIO; mode : TIdC_LONG) : TIdC_LONG; - {$EXTERNALSYM BIO_get_bind_mode} -function BIO_get_bind_mode(b : PBIO; mode : TIdC_LONG) : TIdC_LONG; - {$EXTERNALSYM BIO_do_handshake} -function BIO_do_handshake(b : PBIO) : TIdC_LONG; - {$EXTERNALSYM BIO_do_connect} -function BIO_do_connect(b : PBIO) : TIdC_LONG; - {$EXTERNALSYM BIO_do_accept} -function BIO_do_accept(b : PBIO) : TIdC_LONG; - {$EXTERNALSYM BIO_set_url} -function BIO_set_url(b : PBIO; url : PIdAnsiChar) : TIdC_LONG; - {$EXTERNALSYM BIO_set_proxies} -function BIO_set_proxies(b : PBIO; p : PIdAnsiChar) : TIdC_LONG; - -//* BIO_set_nbio(b,n) */ - {$EXTERNALSYM BIO_set_filter_bio} -function BIO_set_filter_bio(b : PBIO; s : PIdAnsiChar) : TIdC_LONG; - {$EXTERNALSYM BIO_set_proxy_header} -function BIO_set_proxy_header(b : PBIO; sk : PIdAnsiChar) : TIdC_LONG; - {$EXTERNALSYM BIO_set_no_connect_return} -function BIO_set_no_connect_return(b : PBIO; b2 : TIdC_LONG) : TIdC_LONG; - {$EXTERNALSYM BIO_get_proxy_header} -function BIO_get_proxy_header(b : PBIO; var skp : PIdAnsiChar) : TIdC_LONG; - {$EXTERNALSYM BIO_get_proxies} -function BIO_get_proxies(b : PBIO; var pxy_p : PIdAnsiChar) : TIdC_LONG; - {$EXTERNALSYM BIO_get_url} -function BIO_get_url(b : PBIO; var url : PIdAnsiChar) : TIdC_LONG; - {$EXTERNALSYM BIO_get_no_connect_return} -function BIO_get_no_connect_return(b : PBIO) : TIdC_LONG; - {$EXTERNALSYM BIO_set_fd} -function BIO_set_fd(b : PBIO; fd,c : TIdC_INT) : TIdC_LONG; - {$EXTERNALSYM BIO_get_fd} -function BIO_get_fd(b : PBIO; c : PIdC_INT) : TIdC_LONG; - {$EXTERNALSYM BIO_seek} -function BIO_seek(b : PBIO; ofs : TIdC_LONG) : TIdC_INT; - {$EXTERNALSYM BIO_tell} -function BIO_tell(b : PBIO) : TIdC_INT; -{$IFDEF CONST_STRICT} -{$ELSE} - {$EXTERNALSYM BIO_read_filename} -function BIO_read_filename(b : PBIO; name : PIdAnsiChar) : TIdC_LONG; -{$ENDIF} - {$EXTERNALSYM BIO_get_md} -function BIO_get_md(b : PBIO; var mdp : PEVP_MD) : TIdC_LONG; - {$EXTERNALSYM BIO_get_md_ctx} -function BIO_get_md_ctx(b : PBIO; var mdcp : PEVP_MD_CTX) : TIdC_LONG; - {$EXTERNALSYM BIO_set_md_ctx} -function BIO_set_md_ctx(b : PBIO; mdcp : PEVP_MD_CTX) : TIdC_LONG; - {$EXTERNALSYM BIO_get_cipher_status} -function BIO_get_cipher_status(b : PBIO) : TIdC_LONG; - {$EXTERNALSYM BIO_get_cipher_ctx} -function BIO_get_cipher_ctx(b : PBIO; var c_pp : PEVP_CIPHER_CTX): TIdC_LONG; - - {$EXTERNALSYM BIO_write_filename} -function BIO_write_filename(b : PBIO; name : PIdAnsiChar) : TIdC_LONG; - {$EXTERNALSYM BIO_append_filename} -function BIO_append_filename(b : PBIO; name : PIdAnsiChar) : TIdC_LONG; - {$EXTERNALSYM BIO_rw_filename} -function BIO_rw_filename(b : PBIO; name : PIdAnsiChar) : TIdC_LONG; - {$EXTERNALSYM BIO_set_ssl} -function BIO_set_ssl(b : PBIO; ssl : PSSL; c : TIdC_LONG) : TIdC_LONG; - {$EXTERNALSYM BIO_get_ssl} -function BIO_get_ssl(b : PBIO; var sslp : PSSL) : TIdC_LONG; - {$EXTERNALSYM BIO_set_ssl_mode} -function BIO_set_ssl_mode(b : PBIO; client : TIdC_LONG) : TIdC_LONG; - {$EXTERNALSYM BIO_set_ssl_renegotiate_bytes} -function BIO_set_ssl_renegotiate_bytes(b : PBIO; num : TIdC_LONG) : TIdC_LONG; - {$EXTERNALSYM BIO_get_num_renegotiates} -function BIO_get_num_renegotiates(b : PBIO) : TIdC_LONG; - {$EXTERNALSYM BIO_set_ssl_renegotiate_timeout} -function BIO_set_ssl_renegotiate_timeout(b : PBIO; seconds : TIdC_LONG) : TIdC_LONG; - {$EXTERNALSYM BIO_get_mem_data} -function BIO_get_mem_data(b : PBIO; var pp : PIdAnsiChar) : TIdC_INT; - {$EXTERNALSYM BIO_set_mem_buf} -function BIO_set_mem_buf(b : PBIO; bm : PBUF_MEM; c : TIdC_INT) : TIdC_INT; - {$EXTERNALSYM BIO_get_mem_ptr} -function BIO_get_mem_ptr(b: PBIO; var pp: PBUF_MEM) : TIdC_INT; - {$EXTERNALSYM BIO_set_mem_eof_return} -procedure BIO_set_mem_eof_return(b : PBIO; const v : TIdC_INT); -//* For the BIO_f_buffer() type */ - {$EXTERNALSYM BIO_get_buffer_num_lines} -function BIO_get_buffer_num_lines(b : PBIO) : TIdC_INT; - {$EXTERNALSYM BIO_set_buffer_size} -procedure BIO_set_buffer_size(b : PBIO; const size : TIdC_INT); -//* Don't use the next one unless you know what you are doing :-) */ - {$EXTERNALSYM BIO_dup_state} -function BIO_dup_state(b : PBIO; ret : PBIO) : TIdC_LONG; - {$EXTERNALSYM BIO_reset} -function BIO_reset(b : PBIO) : TIdC_INT; - {$EXTERNALSYM BIO_eof} -function BIO_eof(b : PBIO) : TIdC_INT; - {$EXTERNALSYM BIO_set_close} -function BIO_set_close(b: PBIO; c: TIdC_LONG): TIdC_INT; - {$EXTERNALSYM BIO_get_close} -function BIO_get_close(b : PBIO) : TIdC_INT; - {$EXTERNALSYM BIO_pending} -function BIO_pending(b : PBIO) : TIdC_INT; - {$EXTERNALSYM BIO_wpending} -function BIO_wpending(b : PBIO) : TIdC_INT; - {$EXTERNALSYM BIO_flush} -function BIO_flush(b : PBIO) : TIdC_INT; -//* For the BIO_f_buffer() type */ - {$EXTERNALSYM BIO_buffer_get_num_lines} -function BIO_buffer_get_num_lines(b : PBIO) : TIdC_INT; - {$EXTERNALSYM BIO_get_info_callback} -function BIO_get_info_callback(b : PBIO; var cbp : Pbio_info_cb) : TIdC_INT; - {$EXTERNALSYM BIO_set_info_callback} -function BIO_set_info_callback(b : PBIO; cb : Pbio_info_cb) : TIdC_INT; - {$EXTERNALSYM BIO_set_read_buffer_size} -function BIO_set_read_buffer_size(b : PBIO; size : TIdC_LONG) : TIdC_LONG; - {$EXTERNALSYM BIO_set_write_buffer_size} -function BIO_set_write_buffer_size(b : PBIO; size : TIdC_LONG) : TIdC_LONG; - {$EXTERNALSYM BIO_make_bio_pair} -function BIO_make_bio_pair(b1, b2 : PBIO ): TIdC_INT; - {$EXTERNALSYM BIO_destroy_bio_pair} -function BIO_destroy_bio_pair(b : PBIO) : TIdC_INT; - {$EXTERNALSYM BIO_shutdown_wr} -function BIO_shutdown_wr(b : PBIO) : TIdC_INT; -///* macros with inappropriate type -- but ...pending macros use int too: */ - {$EXTERNALSYM BIO_get_write_guarantee} -function BIO_get_write_guarantee(b : PBIO) : TIdC_INT; - {$EXTERNALSYM BIO_get_read_request} -function BIO_get_read_request(b : PBIO) : TIdC_INT; -//* ctrl macros for dgram */ - {$EXTERNALSYM _BIO_ctrl_dgram_connect} -function _BIO_ctrl_dgram_connect(b : PBIO; peer : Sockaddr) : TIdC_INT; - {$EXTERNALSYM BIO_ctrl_set_connected} -function BIO_ctrl_set_connected(b : PBIO; state : TIdC_INT; peer : Sockaddr) : TIdC_INT; - {$EXTERNALSYM BIO_dgram_recv_timedout} -function BIO_dgram_recv_timedout(b : PBIO) : TIdC_INT; - {$EXTERNALSYM BIO_dgram_send_timedout} -function BIO_dgram_send_timedout(b : PBIO) : TIdC_INT; - {$EXTERNALSYM BIO_dgram_get_peer} -function BIO_dgram_get_peer(b : PBIO; peer : PSockAddr) : TIdC_INT; - {$EXTERNALSYM BIO_dgram_set_peer} -function BIO_dgram_set_peer(b : PBIO; peer : PSockAddr) : TIdC_INT; - - {$EXTERNALSYM PEM_read_bio_X509} -function PEM_read_bio_X509(bp: PBIO; x: PPX509; cb: ppem_password_cb; u: Pointer): PX509; - {$EXTERNALSYM PEM_read_bio_X509_REQ} -function PEM_read_bio_X509_REQ(bp :PBIO; x : PPX509_REQ; cb :ppem_password_cb; u: Pointer) : PX509_REQ; - {$EXTERNALSYM PEM_read_bio_X509_CRL} -function PEM_read_bio_X509_CRL(bp : PBIO; x : PPX509_CRL;cb : ppem_password_cb; u: Pointer) : PX509_CRL; - {$EXTERNALSYM PEM_read_bio_RSAPrivateKey} -function PEM_read_bio_RSAPrivateKey(bp : PBIO; x : PPRSA; cb : ppem_password_cb; u: Pointer) : PRSA; - {$EXTERNALSYM PEM_read_bio_RSAPublicKey} -function PEM_read_bio_RSAPublicKey(bp : PBIO; x : PPRSA; cb : ppem_password_cb; u: Pointer) : PRSA; - {$EXTERNALSYM PEM_read_bio_DSAPrivateKey} -function PEM_read_bio_DSAPrivateKey(bp : PBIO; x : PPDSA; cb : ppem_password_cb; u : Pointer) : PDSA; - {$EXTERNALSYM PEM_read_bio_PrivateKey} -function PEM_read_bio_PrivateKey(bp : PBIO; x : PPEVP_PKEY; cb : ppem_password_cb; u : Pointer) : PEVP_PKEY; - {$EXTERNALSYM PEM_read_bio_PKCS7} -function PEM_read_bio_PKCS7(bp : PBIO; x : PPPKCS7; cb : ppem_password_cb; u : Pointer) : PPKCS7; - {$EXTERNALSYM PEM_read_bio_DHparams} -function PEM_read_bio_DHparams(bp : PBIO; x : PPDH; cb : ppem_password_cb; u : Pointer) : PDH; - {$EXTERNALSYM PEM_read_bio_DSAparams} -function PEM_read_bio_DSAparams(bp : PBIO; x : PPDSA; cb : ppem_password_cb; u : Pointer) : PDSA; - {$EXTERNALSYM PEM_read_bio_NETSCAPE_CERT_SEQUENCE} -function PEM_read_bio_NETSCAPE_CERT_SEQUENCE(bp : PBIO; x : PPNETSCAPE_CERT_SEQUENCE; - cb : ppem_password_cb; u : Pointer) : PNETSCAPE_CERT_SEQUENCE; - {$EXTERNALSYM PEM_read_bio_PUBKEY} -function PEM_read_bio_PUBKEY(bp : PBIO; x : PPEVP_PKEY; cb : ppem_password_cb; u : Pointer) : PEVP_PKEY; - {$EXTERNALSYM PEM_write_bio_X509} -function PEM_write_bio_X509(bp: PBIO; x: PX509): TIdC_INT; - {$EXTERNALSYM PEM_write_bio_X509_REQ} -function PEM_write_bio_X509_REQ(bp: PBIO; x: PX509_REQ): TIdC_INT; - {$EXTERNALSYM PEM_write_bio_X509_CRL} -function PEM_write_bio_X509_CRL(bp : PBIO; x : PX509_CRL) : TIdC_INT; - {$EXTERNALSYM PEM_write_bio_RSAPrivateKey} -function PEM_write_bio_RSAPrivateKey(bp : PBIO; x : PRSA; const enc : PEVP_CIPHER; - kstr : PIdAnsiChar; klen : TIdC_INT; cb : ppem_password_cb; u : POinter) : TIdC_INT; - {$EXTERNALSYM PEM_write_bio_RSAPublicKey} -function PEM_write_bio_RSAPublicKey(bp : PBIO; x : PRSA) : TIdC_INT; - {$EXTERNALSYM PEM_write_bio_DSAPrivateKey} -function PEM_write_bio_DSAPrivateKey( bp : PBIO; x : PDSA; const enc : PEVP_CIPHER; - kstr : PIdAnsiChar; klen : TIdC_INT; cb : Ppem_password_cb; u : Pointer) : TIdC_INT; - {$EXTERNALSYM PEM_write_bio_PrivateKey} -function PEM_write_bio_PrivateKey(bp : PBIO; x : PEVP_PKEY; const enc : PEVP_CIPHER; - kstr : PIdAnsiChar; klen : TIdC_INT; cb : Ppem_password_cb; u : Pointer) : TIdC_INT; - {$EXTERNALSYM PEM_write_bio_PKCS7} -function PEM_write_bio_PKCS7(bp : PBIO; x : PPKCS7) : TIdC_INT; - {$EXTERNALSYM PEM_write_bio_DHparams} -function PEM_write_bio_DHparams(bp : PBIO; x : PDH): TIdC_INT; - {$EXTERNALSYM PEM_write_bio_DSAparams} -function PEM_write_bio_DSAparams(bp : PBIO; x : PDSA) : TIdC_INT; - {$EXTERNALSYM PEM_write_bio_NETSCAPE_CERT_SEQUENCE} -function PEM_write_bio_NETSCAPE_CERT_SEQUENCE(bp : PBIO; x : PDSA) : TIdC_INT; - {$EXTERNALSYM PEM_write_bio_PUBKEY} -function PEM_write_bio_PUBKEY(bp : PBIO; x : PEVP_PKEY) : TIdC_INT; - - {$EXTERNALSYM OPENSSL_malloc} -function OPENSSL_malloc(aSize:TIdC_INT):Pointer; - {$EXTERNALSYM CRYPTO_SetMemCheck} -procedure CRYPTO_SetMemCheck(const aEnabled: Boolean); - -{$IFNDEF OPENSSL_NO_RSA} - {$EXTERNALSYM EVP_PKEY_assign_RSA} -function EVP_PKEY_assign_RSA(pkey: PEVP_PKEY; rsa: PRSA): TIdC_INT; -{$ENDIF} - -{$IFNDEF OPENSSL_NO_DSA} - {$EXTERNALSYM EVP_PKEY_assign_DSA} -function EVP_PKEY_assign_DSA(pkey : PEVP_PKEY; dsa : PDSA) : TIdC_INT; -{$ENDIF} - -{$IFNDEF OPENSSL_NO_DH} - {$EXTERNALSYM EVP_PKEY_assign_DH} -function EVP_PKEY_assign_DH(pkey : PEVP_PKEY; dh : PDH) : TIdC_INT; -{$ENDIF} - -{$IFNDEF OPENSSL_NO_EC} - {$EXTERNALSYM EVP_PKEY_assign_EC_KEY} -function EVP_PKEY_assign_EC_KEY(pkey : PEVP_PKEY; eckey : PEC_KEY) : TIdC_INT; -{$ENDIF} - -//* Add some extra combinations */ - {$EXTERNALSYM EVP_get_digestbynid} -function EVP_get_digestbynid(a : TIdC_INT) : PEVP_MD; - {$EXTERNALSYM EVP_get_digestbyobj} -function EVP_get_digestbyobj(a : PASN1_OBJECT) : PEVP_MD; - {$EXTERNALSYM EVP_get_cipherbynid} -function EVP_get_cipherbynid(a : TIdC_INT) : PEVP_CIPHER; - {$EXTERNALSYM EVP_get_cipherbyobj} -function EVP_get_cipherbyobj(a : PASN1_OBJECT) : PEVP_CIPHER; - {$EXTERNALSYM EVP_MD_nid} -function EVP_MD_nid(e : PEVP_MD) : TIdC_INT; - {$EXTERNALSYM EVP_MD_name} -function EVP_MD_name(e : PEVP_MD) : PIdAnsiChar; - {$EXTERNALSYM EVP_MD_CTX_size} -function EVP_MD_CTX_size(e : PEVP_MD_CTX) : TIdC_INT; - {$EXTERNALSYM EVP_MD_CTX_block_size} -function EVP_MD_CTX_block_size(e : PEVP_MD_CTX) : TIdC_INT; - {$EXTERNALSYM EVP_MD_CTX_type} -function EVP_MD_CTX_type(e : PEVP_MD_CTX) : TIdC_INT; - {$EXTERNALSYM EVP_CIPHER_name} -function EVP_CIPHER_name(e : PEVP_CIPHER) : PIdAnsiChar; - {$EXTERNALSYM EVP_CIPHER_mode} -function EVP_CIPHER_mode(e : PEVP_CIPHER) : TIdC_ULONG; - {$EXTERNALSYM EVP_CIPHER_CTX_type} -function EVP_CIPHER_CTX_type(c : PEVP_CIPHER_CTX) : TIdC_INT; - {$EXTERNALSYM EVP_CIPHER_CTX_mode} -function EVP_CIPHER_CTX_mode(e : PEVP_CIPHER_CTX) : TIdC_ULONG; - {$EXTERNALSYM EVP_ENCODE_LENGTH} -function EVP_ENCODE_LENGTH(l : Integer) : Integer; - {$EXTERNALSYM EVP_DECODE_LENGTH} -function EVP_DECODE_LENGTH(l : Integer) : Integer; - {$EXTERNALSYM EVP_SignInit_ex} -function EVP_SignInit_ex(a: PEVP_MD_CTX; b : PEVP_MD; c : PENGINE) : TIdC_INT; - {$EXTERNALSYM EVP_SignInit} -function EVP_SignInit(a : PEVP_MD_CTX; b : PEVP_MD) : TIdC_INT; - {$EXTERNALSYM EVP_SignUpdate} -function EVP_SignUpdate(a: PEVP_MD_CTX; b : Pointer; c : size_t) : TIdC_INT; - {$EXTERNALSYM EVP_VerifyInit_ex} -function EVP_VerifyInit_ex(a: PEVP_MD_CTX; b: PEVP_MD; c: PENGINE) : TIdC_INT; - {$EXTERNALSYM EVP_VerifyInit} -function EVP_VerifyInit(a: PEVP_MD_CTX; b: PEVP_MD) : TIdC_INT; - {$EXTERNALSYM EVP_VerifyUpdate} -function EVP_VerifyUpdate(a: PEVP_MD_CTX; b: Pointer; c : size_t) : TIdC_INT; - {$EXTERNALSYM EVP_OpenUpdate} -function EVP_OpenUpdate(a: PEVP_CIPHER_CTX; _out : PIdAnsiChar; outl : PIdC_INT; - _in : PIdAnsiChar; inl : TIdC_INT) : TIdC_INT; - {$EXTERNALSYM EVP_SealUpdate} -function EVP_SealUpdate(a : PEVP_CIPHER_CTX; b: PIdAnsiChar; c : PIdC_INT; - d: PIdAnsiChar; e : TIdC_INT) : TIdC_INT; - {$EXTERNALSYM EVP_DigestSignUpdate} -function EVP_DigestSignUpdate(a : PEVP_MD_CTX; b : Pointer; c : size_t) : TIdC_Int; - {$EXTERNALSYM EVP_DigestVerifyUpdate} -function EVP_DigestVerifyUpdate(a : PEVP_MD_CTX; b : Pointer; c : size_t) : TIdC_INT; -{$ifndef OPENSSL_NO_DES} - {$EXTERNALSYM EVP_des_cfb} -function EVP_des_cfb : PEVP_CIPHER; - {$EXTERNALSYM EVP_des_ede_cfb} -function EVP_des_ede_cfb: PEVP_CIPHER; - {$EXTERNALSYM EVP_des_ede3_cfb} -function EVP_des_ede3_cfb: PEVP_CIPHER; -{$endif} -{$ifndef OPENSSL_NO_IDEA} - {$EXTERNALSYM EVP_idea_cfb} -function EVP_idea_cfb: PEVP_CIPHER; -{$endif} -{$ifndef OPENSSL_NO_RC2} - {$EXTERNALSYM EVP_rc2_cfb} -function EVP_rc2_cfb: PEVP_CIPHER; -{$endif} -{$ifndef OPENSSL_NO_BF} - {$EXTERNALSYM EVP_bf_cfb} -function EVP_bf_cfb: PEVP_CIPHER; -{$endif} -{$ifndef OPENSSL_NO_CAST} - {$EXTERNALSYM EVP_cast5_cfb} -function EVP_cast5_cfb: PEVP_CIPHER; -{$endif} -{$ifndef OPENSSL_NO_RC5} - {$EXTERNALSYM EVP_rc5_32_12_16_cfb} -function EVP_rc5_32_12_16_cfb: PEVP_CIPHER; -{$endif} -{$ifndef OPENSSL_NO_AES} - {$EXTERNALSYM EVP_aes_128_cfb} -function EVP_aes_128_cfb: PEVP_CIPHER; - {$EXTERNALSYM EVP_aes_192_cfb} -function EVP_aes_192_cfb: PEVP_CIPHER; - {$EXTERNALSYM EVP_aes_256_cfb} -function EVP_aes_256_cfb: PEVP_CIPHER; -{$endif} -{$ifndef OPENSSL_NO_CAMELLIA} - {$EXTERNALSYM EVP_camellia_128_cfb} -function EVP_camellia_128_cfb: PEVP_CIPHER; - {$EXTERNALSYM EVP_camellia_192_cfb} -function EVP_camellia_192_cfb: PEVP_CIPHER; - {$EXTERNALSYM EVP_camellia_256_cfb} -function EVP_camellia_256_cfb: PEVP_CIPHER; -{$endif} -{$ifndef OPENSSL_NO_SEED} - {$EXTERNALSYM EVP_seed_cfb} -function EVP_seed_cfb: PEVP_CIPHER; -{$endif} - {$EXTERNALSYM EVP_PKEY_CTX_set_signature_md} -function EVP_PKEY_CTX_set_signature_md(ctx : PEVP_PKEY_CTX;md : PEVP_PKEY_CTX) : TIdC_INT; - {$EXTERNALSYM SSLeay_add_all_algorithms} -procedure SSLeay_add_all_algorithms; - {$EXTERNALSYM SSLeay_add_all_ciphers} -procedure SSLeay_add_all_ciphers; - {$EXTERNALSYM SSLeay_add_all_digests} -procedure SSLeay_add_all_digests; - - {$EXTERNALSYM X509V3_set_ctx_nodb} -procedure X509V3_set_ctx_nodb(ctx: X509V3_CTX); -// - {$EXTERNALSYM ErrMsg} -function ErrMsg(AErr : TIdC_ULONG) : string; - {$EXTERNALSYM ERR_PACK} -function ERR_PACK(l, f, r : TIdC_INT) : TIdC_ULONG; - {$EXTERNALSYM ERR_GET_LIB} -function ERR_GET_LIB(const l : TIdC_INT) : TIdC_ULONG; - {$EXTERNALSYM ERR_GET_FUNC} -function ERR_GET_FUNC(const l : TIdC_INT) : TIdC_ULONG; - {$EXTERNALSYM ERR_FATAL_ERROR} -function ERR_FATAL_ERROR(const l : TIdC_INT) : Boolean; - {$EXTERNALSYM ERR_GET_REASON} -function ERR_GET_REASON(const l : TIdC_INT) : TIdC_INT; - {$EXTERNALSYM SYSerr} -procedure SYSerr(const f,r : TIdC_INT); - {$EXTERNALSYM BNerr} -procedure BNerr(const f,r : TIdC_INT); - {$EXTERNALSYM RSAerr} -procedure RSAerr(const f,r : TIdC_INT); - {$EXTERNALSYM DHerrr} -procedure DHerrr(const f,r : TIdC_INT); - {$EXTERNALSYM EVPerr} -procedure EVPerr(const f,r : TIdC_INT); - {$EXTERNALSYM BUFerr} -procedure BUFerr(const f,r : TIdC_INT); - {$EXTERNALSYM OBJerr} -procedure OBJerr(const f,r : TIdC_INT); - {$EXTERNALSYM PEMerr} -procedure PEMerr(const f,r : TIdC_INT); - {$EXTERNALSYM DSAerr} -procedure DSAerr(const f,r : TIdC_INT); - {$EXTERNALSYM X509err} -procedure X509err(const f,r : TIdC_INT); - {$EXTERNALSYM ASN1err} -procedure ASN1err(const f,r : TIdC_INT); - {$EXTERNALSYM CONFerr} -procedure CONFerr(const f,r : TIdC_INT); - {$EXTERNALSYM CRYPTOerr} -procedure CRYPTOerr(const f,r : TIdC_INT); - {$EXTERNALSYM ECerr} -procedure ECerr(const f,r : TIdC_INT); - {$EXTERNALSYM SSLerr} -procedure SSLerr(const f,r : TIdC_INT); - {$EXTERNALSYM BIOerr} -procedure BIOerr(const f,r : TIdC_INT); - {$EXTERNALSYM PKCS7err} -procedure PKCS7err(const f,r : TIdC_INT); - {$EXTERNALSYM X509V3err} -procedure X509V3err(const f,r : TIdC_INT); - {$EXTERNALSYM PKCS12err} -procedure PKCS12err(const f,r : TIdC_INT); - {$EXTERNALSYM RANDerr} -procedure RANDerr(const f,r : TIdC_INT); - {$EXTERNALSYM DSOerr} -procedure DSOerr(const f,r : TIdC_INT); - {$EXTERNALSYM ENGINEerr} -procedure ENGINEerr(const f,r : TIdC_INT); - {$EXTERNALSYM OCSPerr} -procedure OCSPerr(const f,r : TIdC_INT); - {$EXTERNALSYM UIerr} -procedure UIerr(const f,r : TIdC_INT); - {$EXTERNALSYM COMPerr} -procedure COMPerr(const f,r : TIdC_INT); - {$EXTERNALSYM ECDSAerr} -procedure ECDSAerr(const f,r : TIdC_INT); - {$EXTERNALSYM ECDHerr} -procedure ECDHerr(const f,r : TIdC_INT); - {$EXTERNALSYM STOREerr} -procedure STOREerr(const f,r : TIdC_INT); - {$EXTERNALSYM FIPSerr} -procedure FIPSerr(const f,r : TIdC_INT); - {$EXTERNALSYM CMSerr} -procedure CMSerr(const f,r : TIdC_INT); - {$EXTERNALSYM TSerr} -procedure TSerr(const f,r : TIdC_INT); - {$EXTERNALSYM HMACerr} -procedure HMACerr(const f,r : TIdC_INT); - {$EXTERNALSYM JPAKEerr} -procedure JPAKEerr(const f,r : TIdC_INT); - {$EXTERNALSYM X509_LOOKUP_load_file} -function X509_LOOKUP_load_file(x : PX509_LOOKUP; name : PIdAnsiChar; _type : TIdC_LONG) : TIdC_INT; - {$EXTERNALSYM X509_LOOKUP_add_dir} -function X509_LOOKUP_add_dir(x : PX509_LOOKUP; name : PIdAnsiChar; _type : TIdC_LONG) : TIdC_INT; - -type -//moved from IdSSLOpenSSL so we can use these classes in other places - EIdOpenSSLError = class(EIdException); - TIdOpenSSLAPISSLError = class of EIdOpenSSLAPISSLError; - - EIdOpenSSLAPISSLError = class(EIdOpenSSLError) - protected - FErrorCode : TIdC_INT; - FRetCode : TIdC_INT; - public - class procedure RaiseException(ASSL: Pointer; const ARetCode : TIdC_INT; const AMsg : String = ''); - class procedure RaiseExceptionCode(const AErrCode, ARetCode : TIdC_INT; const AMsg : String = ''); - property ErrorCode : TIdC_INT read FErrorCode; - property RetCode : TIdC_INT read FRetCode; - end; - - TIdOpenSSLAPICryptoError = class of EIdOpenSSLAPICryptoError; - EIdOpenSSLAPICryptoError = class(EIdOpenSSLError) - protected - FErrorCode : TIdC_ULONG; - public - class procedure RaiseExceptionCode(const AErrCode : TIdC_ULONG; const AMsg : String = ''); - class procedure RaiseException(const AMsg : String = ''); - property ErrorCode : TIdC_ULONG read FErrorCode; - end; - EIdOSSLUnderlyingCryptoError = class(EIdOpenSSLAPICryptoError); - - EIdDigestError = class(EIdOpenSSLAPICryptoError); - EIdDigestFinalEx = class(EIdDigestError); - EIdDigestInitEx = class(EIdDigestError); - EIdDigestUpdate = class(EIdDigestError); - -function IsOpenSSL_1x : Boolean; -function IsOpenSSL_SSLv2_Available : Boolean; -function IsOpenSSL_SSLv3_Available : Boolean; -function IsOpenSSL_SSLv23_Available : Boolean; -function IsOpenSSL_TLSv1_0_Available : Boolean; -function IsOpenSSL_TLSv1_1_Available : Boolean; -function IsOpenSSL_TLSv1_2_Available : Boolean; -function IsOpenSSL_DTLSv1_Available : Boolean; - -// RLebeau: should these be declared as EXTERNALSYM? -procedure RAND_cleanup; -function RAND_bytes(buf : PIdAnsiChar; num : integer) : integer; -function RAND_pseudo_bytes(buf : PIdAnsiChar; num : integer) : integer; -procedure RAND_seed(buf : PIdAnsiChar; num : integer); -procedure RAND_add(buf : PIdAnsiChar; num : integer; entropy : integer); -function RAND_status() : integer; -{$IFDEF SYS_WIN} -function RAND_event(iMsg : UINT; wp : wparam; lp : lparam) : integer; -procedure RAND_screen(); -{$ENDIF} - -implementation - -uses - Classes, - IdFIPS, - IdGlobalProtocols, - IdResourceStringsProtocols, - IdResourceStringsOpenSSL, - IdStack - {$IFDEF FPC} - {$IFNDEF WINDOWS} - , DynLibs // needed for FreeLibrary - {$ENDIF} - {$ENDIF}; - -{$IFNDEF OPENSSL_NO_HMAC} -procedure HMAC_Init_ex(ctx : PHMAC_CTX; key : Pointer; len : TIdC_INT; - md : PEVP_MD; impl : PENGINE); - {$IFDEF USE_INLINE} inline; {$ENDIF} -begin - if Assigned(_HMAC_Init_ex) then begin - _HMAC_Init_ex(ctx, key, len, md, impl ); - end else begin - if Assigned(_1_0_HMAC_Init_ex) then begin - _1_0_HMAC_Init_ex(ctx, key, len, md, impl ); - end; - end; -end; - -procedure HMAC_Update(ctx : PHMAC_CTX; data : PIdAnsiChar; len : size_t); - {$IFDEF USE_INLINE} inline; {$ENDIF} -begin - if Assigned(_HMAC_Update) then begin - _HMAC_Update(ctx, data, len ); - end else begin - if Assigned(_1_0_HMAC_Update) then begin - _1_0_HMAC_Update(ctx, data, len ); - end; - end; -end; - -procedure HMAC_Final(ctx : PHMAC_CTX; md : PIdAnsiChar; len : PIdC_UINT); - {$IFDEF USE_INLINE} inline; {$ENDIF} -begin - if Assigned(_HMAC_Final) then begin - _HMAC_Final(ctx, md, len ); - end else begin - if Assigned(_1_0_HMAC_Update) then begin - _1_0_HMAC_Final(ctx, md, len ); - end; - end; -end; -{$ENDIF} - -function IsOpenSSL_1x : Boolean; - {$IFDEF USE_INLINE} inline; {$ENDIF} -begin - if Assigned( SSLeay ) then begin - Result := (SSLeay and $F0000000) = $10000000; - end else begin - Result := False; - end; -end; - -function IsOpenSSL_SSLv2_Available : Boolean; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := Assigned(SSLv2_method) and - Assigned(SSLv2_server_method) and - Assigned(SSLv2_client_method); -end; - -function IsOpenSSL_SSLv3_Available : Boolean; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := Assigned(SSLv3_method) and - Assigned(SSLv3_server_method) and - Assigned(SSLv3_client_method); -end; - -function IsOpenSSL_SSLv23_Available : Boolean; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := Assigned(SSLv23_method) and - Assigned(SSLv23_server_method) and - Assigned(SSLv23_client_method); -end; - -function IsOpenSSL_TLSv1_0_Available : Boolean; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := Assigned(TLSv1_method) and - Assigned(TLSv1_server_method) and - Assigned(TLSv1_client_method); -end; - -function IsOpenSSL_TLSv1_1_Available : Boolean; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := Assigned(TLSv1_1_method) and - Assigned(TLSv1_1_server_method) and - Assigned(TLSv1_1_client_method); -end; - -function IsOpenSSL_TLSv1_2_Available : Boolean; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := Assigned(TLSv1_2_method) and - Assigned(TLSv1_2_server_method) and - Assigned(TLSv1_2_client_method); -end; - -function IsOpenSSL_DTLSv1_Available : Boolean; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := Assigned(DTLSv1_method) and - Assigned(DTLSv1_server_method) and - Assigned(DTLSv1_client_method); -end; - -//**************** FIPS Support backend ******************* -function OpenSSLIsHashingIntfAvail : Boolean; -begin - Result := Assigned(EVP_DigestInit_ex) and - Assigned(EVP_DigestUpdate) and - Assigned(EVP_DigestFinal_ex) ; -end; - -function OpenSSLGetFIPSMode : Boolean; -begin - Result := FIPS_mode <> 0; -end; - -function OpenSSLSetFIPSMode(const AMode : Boolean) : Boolean; -begin - //leave this empty as we may not be using something that supports FIPS - if AMode then begin - Result := FIPS_mode_set(1) = 1; - end else begin - Result := FIPS_mode_set(0) = 1; - end; -end; - -function OpenSSLGetDigestCtx( AInst : PEVP_MD) : TIdHashIntCtx; - {$IFDEF USE_INLINE} inline; {$ENDIF} -var LRet : Integer; -begin - Result := AllocMem(SizeOf(EVP_MD_CTX)); - EVP_MD_CTX_init(Result); - - LRet := EVP_DigestInit_ex(Result, AInst, nil); - if LRet <> 1 then begin - EIdDigestInitEx.RaiseException('EVP_DigestInit_ex error'); - end; -end; - -function OpenSSLIsMD2HashIntfAvail: Boolean; -begin - {$IFDEF OPENSSL_NO_MD2} - Result := False; - {$ELSE} - Result := Assigned(EVP_md2); - {$ENDIF} -end; - -function OpenSSLGetMD2HashInst : TIdHashIntCtx; -{$IFNDEF OPENSSL_NO_MD2} -var - LRet : PEVP_MD; -{$ENDIF} -begin - {$IFDEF OPENSSL_NO_MD2} - Result := nil; - {$ELSE} - LRet := EVP_md2; - Result := OpenSSLGetDigestCtx(LRet); - {$ENDIF} -end; - -function OpenSSLIsMD4HashIntfAvail: Boolean; -begin - Result := Assigned(EVP_md4); -end; - -function OpenSSLGetMD4HashInst : TIdHashIntCtx; -var - LRet : PEVP_MD; -begin - LRet := EVP_md4; - Result := OpenSSLGetDigestCtx(LRet); -end; - -function OpenSSLIsMD5HashIntfAvail: Boolean; -begin - Result := Assigned(EVP_md5); -end; - -function OpenSSLGetMD5HashInst : TIdHashIntCtx; -var - LRet : PEVP_MD; -begin - LRet := EVP_md5; - Result := OpenSSLGetDigestCtx(LRet); -end; - -function OpenSSLIsSHA1HashIntfAvail: Boolean; -begin - {$IFDEF OPENSSL_NO_SHA} - Result := False; - {$ELSE} - Result := Assigned(EVP_sha1); - {$ENDIF} -end; - -function OpenSSLGetSHA1HashInst : TIdHashIntCtx; -{$IFNDEF OPENSSL_NO_SHA} -var - LRet : PEVP_MD; -{$ENDIF} -begin - {$IFDEF OPENSSL_NO_SHA} - Result := nil; - {$ELSE} - LRet := EVP_sha1; - Result := OpenSSLGetDigestCtx(LRet); - {$ENDIF} -end; - -function OpenSSLIsSHA224HashIntfAvail: Boolean; -begin - {$IFDEF OPENSSL_NO_SHA256} - Result := False; - {$ELSE} - Result := Assigned(EVP_sha224); - {$ENDIF} -end; - -function OpenSSLGetSHA224HashInst : TIdHashIntCtx; -{$IFNDEF OPENSSL_NO_SHA256} -var - LRet : PEVP_MD; -{$ENDIF} -begin - {$IFDEF OPENSSL_NO_SHA256} - Result := nil; - {$ELSE} - LRet := EVP_sha224; - Result := OpenSSLGetDigestCtx(LRet); - {$ENDIF} -end; - -function OpenSSLIsSHA256HashIntfAvail: Boolean; -begin - {$IFDEF OPENSSL_NO_SHA256} - Result := False; - {$ELSE} - Result := Assigned(EVP_sha256); - {$ENDIF} -end; - -function OpenSSLGetSHA256HashInst : TIdHashIntCtx; -{$IFNDEF OPENSSL_NO_SHA256} -var - LRet : PEVP_MD; -{$ENDIF} -begin - {$IFDEF OPENSSL_NO_SHA256} - Result := nil; - {$ELSE} - LRet := EVP_sha256; - Result := OpenSSLGetDigestCtx(LRet); - {$ENDIF} -end; - -function OpenSSLIsSHA384HashIntfAvail: Boolean; -begin - {$IFDEF OPENSSL_NO_SHA512} - Result := False; - {$ELSE} - Result := Assigned(EVP_sha384); - {$ENDIF} -end; - -function OpenSSLGetSHA384HashInst : TIdHashIntCtx; -{$IFNDEF OPENSSL_NO_SHA512} -var - LRet : PEVP_MD; -{$ENDIF} -begin - {$IFDEF OPENSSL_NO_SHA512} - Result := nil; - {$ELSE} - LRet := EVP_sha384; - Result := OpenSSLGetDigestCtx(LRet); - {$ENDIF} -end; - -function OpenSSLIsSHA512HashIntfAvail: Boolean; -begin - {$IFDEF OPENSSL_NO_SHA512} - Result := nil; - {$ELSE} - Result := Assigned(EVP_sha512); - {$ENDIF} -end; - -function OpenSSLGetSHA512HashInst : TIdHashIntCtx; -{$IFNDEF OPENSSL_NO_SHA512} -var - LRet : PEVP_MD; -{$ENDIF} -begin - {$IFDEF OPENSSL_NO_SHA512} - Result := nil; - {$ELSE} - LRet := EVP_sha512; - Result := OpenSSLGetDigestCtx(LRet); -{$ENDIF} -end; - -procedure OpenSSLUpdateHashInst(ACtx: TIdHashIntCtx; const AIn: TIdBytes); -var - LRet : TIdC_Int; -begin - LRet := EVP_DigestUpdate(ACtx, PByte(Ain), Length(AIn)); - if LRet <> 1 then begin - EIdDigestInitEx.RaiseException('EVP_DigestUpdate error'); - end; -end; - -function OpenSSLFinalHashInst(ACtx: TIdHashIntCtx): TIdBytes; -var - LLen : TIdC_UInt; - LRet : TIdC_Int; -begin - SetLength(Result,EVP_MAX_MD_SIZE); - LRet := EVP_DigestFinal_ex(ACtx, PIdAnsiChar(@Result[0]), LLen); - if LRet <> 1 then begin - EIdDigestFinalEx.RaiseException('EVP_DigestFinal_ex error'); - end; - SetLength(Result,LLen); - EVP_MD_CTX_cleanup(ACtx); - FreeMem(ACtx,SizeOf(EVP_MD_CTX)); -end; - -function OpenSSLIsHMACAvail : Boolean; -begin - {$IFDEF OPENSSL_NO_HMAC} - Result := False; - {$ELSE} - Result := Assigned(HMAC_CTX_init) and - ( Assigned(_HMAC_Init_ex) or Assigned(_1_0_HMAC_Init_ex) ) and - ( Assigned(_HMAC_Update) or Assigned(_1_0_HMAC_Update) ) and - ( Assigned(_HMAC_Final) or Assigned(_1_0_HMAC_Final) ) and - Assigned(HMAC_CTX_cleanup); - {$ENDIF} -end; - -function OpenSSLIsHMACMD5Avail: Boolean; -begin - {$IFDEF OPENSSL_NO_MD5} - Result := False; - {$ELSE} - Result := Assigned(EVP_md5); - {$ENDIF} -end; - -function OpenSSLGetHMACMD5Inst(const AKey : TIdBytes) : TIdHMACIntCtx; -begin - {$IFDEF OPENSSL_NO_MD5} - Result := nil; - {$ELSE} - Result := AllocMem(SizeOf(HMAC_CTX)); - HMAC_CTX_init(Result); - HMAC_Init_ex(Result, PByte(AKey), Length(AKey), EVP_md5, nil); - {$ENDIF} -end; - -function OpenSSLIsHMACSHA1Avail: Boolean; -begin - {$IFDEF OPENSSL_NO_SHA} - Result := False; - {$ELSE} - Result := Assigned(EVP_sha1); - {$ENDIF} -end; - -function OpenSSLGetHMACSHA1Inst(const AKey : TIdBytes) : TIdHMACIntCtx; -begin - {$IFDEF OPENSSL_NO_SHA} - Result := nil; - {$ELSE} - Result := AllocMem(SizeOf(HMAC_CTX)); - HMAC_CTX_init(Result); - HMAC_Init_ex(Result, PByte(AKey), Length(AKey), EVP_sha1, nil); - {$ENDIF} -end; - -function OpenSSLIsHMACSHA224Avail: Boolean; - -begin - {$IFDEF OPENSSL_NO_SHA256} - Result := False; - {$ELSE} - Result := Assigned(EVP_sha224); - {$ENDIF} -end; - -function OpenSSLGetHMACSHA224Inst(const AKey : TIdBytes) : TIdHMACIntCtx; -begin - {$IFDEF OPENSSL_NO_SHA256} - Result := nil; - {$ELSE} - Result := AllocMem(SizeOf(HMAC_CTX)); - HMAC_CTX_init(Result); - HMAC_Init_ex(Result, PByte(AKey), Length(AKey), EVP_sha224, nil); - {$ENDIF} -end; - -function OpenSSLIsHMACSHA256Avail: Boolean; -begin - {$IFDEF OPENSSL_NO_SHA256} - Result := False; - {$ELSE} - Result := Assigned(EVP_sha256); - {$ENDIF} -end; - -function OpenSSLGetHMACSHA256Inst(const AKey : TIdBytes) : TIdHMACIntCtx; -begin - {$IFDEF OPENSSL_NO_SHA256} - Result := nil; - {$ELSE} - Result := AllocMem(SizeOf(HMAC_CTX)); - HMAC_CTX_init(Result); - HMAC_Init_ex(Result, PByte(AKey), Length(AKey), EVP_sha256, nil); - {$ENDIF} -end; - -function OpenSSLIsHMACSHA384Avail: Boolean; -begin - {$IFDEF OPENSSL_NO_SHA512} - Result := False; - {$ELSE} - Result := Assigned(EVP_sha384); - {$ENDIF} -end; - -function OpenSSLGetHMACSHA384Inst(const AKey : TIdBytes) : TIdHMACIntCtx; -begin - {$IFDEF OPENSSL_NO_SHA512} - Result := nil; - {$ELSE} - Result := AllocMem(SizeOf(HMAC_CTX)); - HMAC_CTX_init(Result); - HMAC_Init_ex(Result, PByte(AKey), Length(AKey), EVP_sha384, nil); - {$ENDIF} -end; - -function OpenSSLIsHMACSHA512Avail: Boolean; -begin - {$IFDEF OPENSSL_NO_SHA512} - Result := False; - {$ELSE} - Result := Assigned(EVP_sha512); - {$ENDIF} -end; - -function OpenSSLGetHMACSHA512Inst(const AKey : TIdBytes) : TIdHMACIntCtx; -begin - {$IFDEF OPENSSL_NO_SHA512} - Result := nil; - {$ELSE} - Result := AllocMem(SizeOf(HMAC_CTX)); - HMAC_CTX_init(Result); - HMAC_Init_ex(Result, PByte(AKey), Length(AKey), EVP_sha512, nil); - {$ENDIF} -end; - -procedure OpenSSLUpdateHMACInst(ACtx : TIdHMACIntCtx; const AIn: TIdBytes); -begin - HMAC_Update(ACtx, PIdAnsiChar(PByte(AIn)), Length(AIn)); -end; - -function OpenSSLFinalHMACInst(ACtx: TIdHMACIntCtx): TIdBytes; -var - LLen : TIdC_UInt; -begin - LLen := EVP_MAX_MD_SIZE; - SetLength(Result,LLen); - HMAC_Final(ACtx, PIdAnsiChar(@Result[0]), @LLen); - SetLength(Result,LLen); - HMAC_CTX_cleanup(ACtx); - FreeMem(ACtx,SizeOf(HMAC_CTX)); -end; - -function LoadOpenSSL: Boolean; -begin - Result := Load; -end; - -//**************************************************** -function FIPS_mode_set(onoff : TIdC_INT) : TIdC_INT; {$IFDEF INLINE}inline;{$ENDIF} -begin - Result := 0; - {$IFDEF OPENSSL_FIPS} - if Assigned(_FIPS_mode_set) then begin - Result := _FIPS_mode_set(onoff); - end; - {$ENDIF} -end; - -function FIPS_mode() : TIdC_INT; {$IFDEF INLINE}inline;{$ENDIF} -begin - Result := 0; - {$IFDEF OPENSSL_FIPS} - if Assigned(_FIPS_mode) then begin - Result := _FIPS_mode; - end; - {$ENDIF} -end; - -function GetErrorMessage(const AErr : TIdC_ULONG) : String; -{$IFDEF USE_INLINE} inline; {$ENDIF} -const - sMaxErrMsg = 160; -var - LErrMsg: array [0..sMaxErrMsg] of TIdAnsiChar; - {$IFDEF USE_MARSHALLED_PTRS} - LErrMsgPtr: TPtrWrapper; - {$ENDIF} -begin - {$IFDEF USE_MARSHALLED_PTRS} - LErrMsgPtr := TPtrWrapper.Create(@LErrMsg[0]); - {$ENDIF} - ERR_error_string_n(AErr, - {$IFDEF USE_MARSHALLED_PTRS} - LErrMsgPtr.ToPointer - {$ELSE} - LErrMsg - {$ENDIF}, sMaxErrMsg); - LErrMsg[sMaxErrMsg] := TIdAnsiChar(0); - {$IFDEF USE_MARSHALLED_PTRS} - Result := TMarshal.ReadStringAsAnsi(LErrMsgPtr); - {$ELSE} - Result := String(LErrMsg); - {$ENDIF} -end; - -{ EIdOpenSSLAPICryptoError } -class procedure EIdOpenSSLAPICryptoError.RaiseException(const AMsg : String = ''); -begin - RaiseExceptionCode(ERR_get_error(), AMsg); -end; - -class procedure EIdOpenSSLAPICryptoError.RaiseExceptionCode( - const AErrCode: TIdC_ULONG; const AMsg: String); -var - LMsg: String; - LException : EIdOpenSSLAPICryptoError; -begin - if AMsg <> '' then begin - LMsg := AMsg + sLineBreak + String(GetErrorMessage(AErrCode)); - end else begin - LMsg := String(GetErrorMessage(AErrCode)); - end; - LException := Create(LMsg); - LException.FErrorCode := AErrCode; - raise LException; -end; - -{ EIdOpenSSLAPISSLError } - -class procedure EIdOpenSSLAPISSLError.RaiseException(ASSL: Pointer; const ARetCode: TIdC_INT; - const AMsg: String); -begin - RaiseExceptionCode(SSL_get_error(PSSL(ASSL), ARetCode), ARetCode, AMsg); -end; - -class procedure EIdOpenSSLAPISSLError.RaiseExceptionCode(const AErrCode, ARetCode: TIdC_INT; - const AMsg: String); -var - LErrQueue : TIdC_ULONG; - LException : EIdOpenSSLAPISSLError; - LErrStr : String; -begin - if AMsg <> '' then begin - LErrStr := AMsg + sLineBreak; - end else begin - LErrStr := ''; - end; - case AErrCode of - SSL_ERROR_SYSCALL : - begin - LErrQueue := ERR_get_error; - if LErrQueue <> 0 then begin - EIdOSSLUnderlyingCryptoError.RaiseExceptionCode(LErrQueue, AMsg); - end; - if ARetCode = 0 then begin - LException := Create(LErrStr + RSSSLEOFViolation); - LException.FErrorCode := AErrCode; - LException.FRetCode := ARetCode; - raise LException; - end; - {Note that if LErrQueue returns 0 and ARetCode = -1, there probably - is an error in the underlying socket so you should raise a socket error} - if ARetCode = -1 then begin - // TODO: catch the socket exception and re-raise it as the InnerException - // for an EIdOpenSSLAPISSLError exception... - GStack.RaiseLastSocketError; - end; - end; - SSL_ERROR_SSL : begin - EIdOSSLUnderlyingCryptoError.RaiseException(AMsg); - end - end; - // everything else... - LException := Create(LErrStr + String(GetErrorMessage(AErrCode))); - LException.FErrorCode := AErrCode; - LException.FRetCode := ARetCode; - raise LException; -end; - -type - TRAND_bytes = function(buf : PIdAnsiChar; num : integer) : integer; cdecl; - TRAND_pseudo_bytes = function(buf : PIdAnsiChar; num : integer) : integer; cdecl; - TRAND_seed = procedure(buf : PIdAnsiChar; num : integer); cdecl; - TRAND_add = procedure(buf : PIdAnsiChar; num : integer; entropy : integer); cdecl; - TRAND_status = function() : integer; cdecl; - {$IFDEF SYS_WIN} - TRAND_event = function(iMsg : UINT; wp : wparam; lp : lparam) : integer; cdecl; - {$ENDIF} - TRAND_cleanup = procedure; cdecl; - -{$IFDEF STATICLOAD_OPENSSL} -const - SSL_LIB_name = 'libssl.a'; {Do not Localize} - SSLCLIB_LIB_name = 'libcrypto.a'; {Do not Localize} -{$ELSE} - {$IFDEF UNIX} -const - {This is a workaround for some Linux distributions and a few other things - where the symbolic link libbsl.so and libcrypto.so do not exist} - SSL_DLL_name = 'libssl'; {Do not localize} - SSLCLIB_DLL_name = 'libcrypto'; {Do not localize} - SSLDLLVers : array [0..10] of string = ( - '.10', - '.1.0.2','.1.0.1', - // TODO: IFDEF the following for OSX only? - '.44', // MacOS LibreSSL forked from which OpenSSL version? Sometimes found ... - '.43', // MacOS LibreSSL forked from which OpenSSL version? Sometimes found ... - // TODO: Add '.41' as well? - '.35', // MacOS LibreSSL forked from OpenSSL version 1.0.1, almost always found - // - '.1.0.0','.0.9.9','.0.9.8','.0.9.7','.0.9.6' - ); - SSLDLLVersChar : array [0..26] of string = ('','a','b','c','d','e','f','g','h','i', - 'j','k','l','m','n','o','p','q','r', - 's','t','u','v','w','x','y','z'); - {$ENDIF} - {$IFDEF WINDOWS} -const - SSL_DLL_name = 'ssleay32.dll'; {Do not localize} - //The following is a workaround for an alternative name for - //one of the OpenSSL .DLL's. If you compile the .DLL's using - //mingw32, the SSL .dll might be named 'libssl32.dll' instead of - //ssleay32.dll like you would expect. - SSL_DLL_name_alt = 'libssl32.dll'; {Do not localize} - SSLCLIB_DLL_name = 'libeay32.dll'; {Do not localize} - {$ENDIF} -{$ENDIF} - -var - {$IFDEF STATICLOAD_OPENSSL} - bIsLoaded : Boolean = False; - {$ELSE} - hIdSSL : TIdLibHandle = IdNilHandle; - hIdCrypto : TIdLibHandle = IdNilHandle; - FFailedLoadList : TStringList; - {$ENDIF} - - _RAND_cleanup : TRAND_cleanup = nil; - _RAND_bytes : TRAND_bytes = nil; - _RAND_pseudo_bytes : TRAND_pseudo_bytes = nil; - _RAND_seed : TRAND_seed = nil; - _RAND_add : TRAND_add = nil; - _RAND_status : TRAND_status = nil; - {$IFDEF SYS_WIN} - // LIBEAY functions - open SSL 0.9.6a - _RAND_screen : procedure cdecl = nil; - _RAND_event : TRAND_event = nil; - {$ENDIF} - -{$IFNDEF STATICLOAD_OPENSSL} -function GetSSLLibHandle : TIdLibHandle; -begin - Result := hIdSSL; -end; - -function GetCryptLibHandle : TIdLibHandle; -begin - Result := hIdCrypto; -end; - -{ This constant's are used twice. First time in Load function and second time } {Do not localize} -{ in function WhichFailedToLoad. I belive that this reduce size of final } -{ compiled file. } -const -{most of these are commented out because we aren't using them now. I am keeping -them in case we use them later.} - fn_sk_num = 'sk_num'; {Do not localize} - fn_sk_value = 'sk_value'; {Do not localize} - {CH fn_sk_set = 'sk_set'; } {Do not localize} - fn_sk_new = 'sk_new'; {Do not localize} - fn_sk_new_null = 'sk_new_null'; {Do not localize} - fn_sk_free = 'sk_free'; {Do not localize} - fn_sk_pop_free = 'sk_pop_free'; {Do not localize} - {CH fn_sk_insert = 'sk_insert'; } {Do not localize} - {CH fn_sk_delete = 'sk_delete'; } {Do not localize} - {CH fn_sk_delete_ptr = 'sk_delete_ptr'; } {Do not localize} - fn_sk_find = 'sk_find'; {Do not localize} - fn_sk_push = 'sk_push'; {Do not localize} - {CH fn_sk_unshift = 'sk_unshift'; } {Do not localize} - {CH fn_sk_shift = 'sk_shift'; } {Do not localize} - {CH fn_sk_pop = 'sk_pop'; } {Do not localize} - {CH fn_sk_zero = 'sk_zero'; } {Do not localize} - fn_sk_dup = 'sk_dup'; {Do not localize} - {CH fn_sk_sort = 'sk_sort'; } {Do not localize} - fn_SSLeay_version = 'SSLeay_version'; {Do not localize} - fn_SSLeay = 'SSLeay'; {Do not localize} - {CH fn_OPENSSL_issetugid = 'OPENSSL_issetugid'; }{Do not localize} - {CH fn_CONF_set_default_method = 'CONF_set_default_method'; } {Do not localize} - {CH fn_CONF_set_nconf = 'CONF_set_nconf'; } {Do not localize} - {CH fn_CONF_load = 'CONF_load'; } {Do not localize} -{$IFNDEF OPENSSL_NO_FP_API} - {CH fn_CONF_load_fp = 'CONF_load_fp'; } {Do not localize} -{$ENDIF} - {CH fn_CONF_load_bio = 'CONF_load_bio'; } {Do not localize} - {CH fn_CONF_get_section = 'CONF_get_section'; } {Do not localize} - {CH fn_CONF_get_string = 'CONF_get_string'; } {Do not localize} - {CH fn_CONF_get_number = 'CONF_get_number'; } {Do not localize} - {CH fn_CONF_free = 'CONF_free'; }{Do not localize} - {CH fn_CONF_dump_fp = 'CONF_dump_fp'; } {Do not localize} - {CH fn_CONF_dump_bio = 'CONF_dump_bio'; } {Do not localize} - {CH fn_NCONF_new = 'NCONF_new'; } {Do not localize} - {CH fn_NCONF_default = 'NCONF_default'; } {Do not localize} - {CH fn_NCONF_WIN32 = 'NCONF_WIN32'; } {Do not localize} -{$IFDEF OMIT_THIS} //* Just to give you an idea of what I have in mind */ - {CH fn_NCONF_XML = 'NCONF_XML''; } {Do not localize} -{$ENDIF} - {CH fn_NCONF_free = 'NCONF_free'; } {Do not localize} - {CH fn_NCONF_free_data = 'NCONF_free_data'; } {Do not localize} - {CH fn_NCONF_load = 'NCONF_load'; } {Do not localize} -{$IFNDEF OPENSSL_NO_FP_API} - {CH fn_NCONF_load_fp = 'NCONF_load_fp'; }{Do not localize} -{$ENDIF} - {CH fn_NCONF_load_bio = 'NCONF_load_bio'; } {Do not localize} - {CH fn_NCONF_get_section = 'NCONF_get_section'; } {Do not localize} - {CH fn_NCONF_get_string = 'NCONF_get_string'; } {Do not localize} - {CH fn_NCONF_get_number_e = 'NCONF_get_number_e'; } {Do not localize} - {CH fn_NCONF_dump_fp = 'NCONF_dump_fp'; } {Do not localize} - {CH fn_NCONF_dump_bio = 'NCONF_dump_bio'; }{Do not localize} - {CH fn_CONF_modules_load = 'CONF_modules_load'; } {Do not localize} - {CH fn_CONF_modules_load_file = 'CONF_modules_load_file'; } {Do not localize} - {CH fn_CONF_modules_unload = 'CONF_modules_unload'; } {Do not localize} - {CH fn_CONF_modules_finish = 'CONF_modules_finish'; } {Do not localize} - {CH fn_CONF_modules_free = 'CONF_modules_free'; } {Do not localize} - {CH fn_CONF_module_add = 'CONF_module_add'; } {Do not localize} - {CH fn_CONF_imodule_get_name = 'CONF_imodule_get_name'; } {Do not localize} - {CH fn_CONF_imodule_get_value = 'CONF_imodule_get_value'; } {Do not localize} - {CH fn_CONF_imodule_get_usr_data = 'CONF_imodule_get_usr_data'; } {Do not localize} - {CH fn_CONF_imodule_set_usr_data = 'CONF_imodule_set_usr_data'; } {Do not localize} - {CH fn_CONF_imodule_get_module = 'CONF_imodule_get_module'; } {Do not localize} - {CH fn_CONF_imodule_get_flags = 'CONF_imodule_get_flags'; } {Do not localize} - {CH fn_CONF_imodule_set_flags = 'CONF_imodule_set_flags'; } {Do not localize} - {CH fn_CONF_module_get_usr_data = 'CONF_module_get_usr_data'; } {Do not localize} - {CH fn_CONF_module_set_usr_data = 'CONF_module_set_usr_data'; } {Do not localize} - {CH fn_ERR_load_CONF_strings = 'ERR_load_CONF_strings'; } {Do not localize} - {CH fn_CONF_get1_default_config_file = 'CONF_get1_default_config_file'; } {Do not localize} - {CH fn_CONF_parse_list = 'CONF_parse_list' ; } - {CH fn_OPENSSL_load_builtin_modules = 'OPENSSL_load_builtin_modules'; } {Do not localize} - {CH fn_CRYPTO_get_ex_new_index = 'CRYPTO_get_ex_new_index'; } {Do not localize} - {CH fn_CRYPTO_set_ex_data = 'CRYPTO_set_ex_data'; } {Do not localize} - {CH fn_CRYPTO_get_ex_data = 'CRYPTO_get_ex_data'; } {Do not localize} - {CH fn_CRYPTO_dup_ex_data = 'CRYPTO_dup_ex_data'; } {Do not localize} - {CH fn_CRYPTO_free_ex_data = 'CRYPTO_free_ex_data'; } {Do not localize} - {CH fn_CRYPTO_new_ex_data = 'CRYPTO_new_ex_data'; } {Do not localize} - fn_CRYPTO_mem_ctrl = 'CRYPTO_mem_ctrl'; {Do not localize} - {CH fn_OPENSSL_issetugid = 'OPENSSL_issetugid'; } {Do not localize} - {CH fn_CRYPTO_get_ex_data_implementation = 'CRYPTO_get_ex_data_implementation'; } {Do not localize} - {CH fn_CRYPTO_set_ex_data_implementation = 'CRYPTO_set_ex_data_implementation'; } {Do not localize} - {CH fn_CRYPTO_ex_data_new_class = 'CRYPTO_ex_data_new_class'; } {Do not localize} - {CH fn_CRYPTO_get_locking_callback = 'CRYPTO_get_locking_callback'; } {Do not localize} - {CH fn_CRYPTO_get_add_lock_callback = 'CRYPTO_get_add_lock_callback'; } {Do not localize} - {CH fn_CRYPTO_get_new_dynlockid = 'CRYPTO_get_new_dynlockid'; } {Do not localize} - {CH fn_CRYPTO_destroy_dynlockid = 'CRYPTO_destroy_dynlockid'; } {Do not localize} - {CH fn_CRYPTO_get_dynlock_value = 'CRYPTO_get_dynlock_value'; } {Do not localize} - {CH fn_CRYPTO_set_dynlock_create_callback = 'CRYPTO_set_dynlock_create_callback'; } {Do not localize} - {CH fn_CRYPTO_set_dynlock_lock_callback = 'CRYPTO_set_dynlock_lock_callback'; } {Do not localize} - {CH fn_CRYPTO_set_dynlock_destroy_callback = 'CRYPTO_set_dynlock_destroy_callback'; } {Do not localize} - {CH fn_CRYPTO_set_locked_mem_ex_functions = 'CRYPTO_set_locked_mem_ex_functions'; } {Do not localize} - {CH fn_CRYPTO_get_mem_ex_functions = 'CRYPTO_get_mem_ex_functions'; } {Do not localize} - {CH fn_CRYPTO_get_locked_mem_ex_functions = 'CRYPTO_get_locked_mem_ex_functions'; } {Do not localize} - {CH fn_CRYPTO_get_mem_debug_functions = 'CRYPTO_get_mem_debug_functions'; }{Do not localize} - {CH fn_CRYPTO_realloc_clean = 'CRYPTO_realloc_clean'; } {Do not localize} - {CH fn_OPENSSL_cleanse = 'OPENSSL_cleanse'; } {Do not localize} - {CH fn_CRYPTO_set_mem_debug_options = 'CRYPTO_set_mem_debug_options'; } {Do not localize} - {CH fn_CRYPTO_get_mem_debug_options = 'CRYPTO_get_mem_debug_options'; } {Do not localize} - {CH fn_CRYPTO_push_info_ = 'CRYPTO_push_info_'; } {Do not localize} - {CH fn_CRYPTO_pop_info = 'CRYPTO_pop_info'; } {Do not localize} - {CH fn_CRYPTO_remove_all_info = 'CRYPTO_remove_all_info'; } {Do not localize} - {CH fn_OpenSSLDie = 'OpenSSLDie'; } {Do not localize} - {CH fn_OPENSSL_ia32cap_loc = 'OPENSSL_ia32cap_loc'; } {Do not localize} - {CH fn_CRYPTO_get_new_lockid = 'CRYPTO_get_new_lockid'; } {Do not localize} - fn_CRYPTO_num_locks = 'CRYPTO_num_locks'; {Do not localize} - fn_CRYPTO_lock = 'CRYPTO_lock'; {Do not localize} - fn_CRYPTO_set_locking_callback = 'CRYPTO_set_locking_callback'; {Do not localize} - {CH fn_CRYPTO_set_add_lock_callback = 'CRYPTO_set_add_lock_callback'; } {Do not localize} - fn_CRYPTO_set_id_callback = 'CRYPTO_set_id_callback'; {Do not localize} - {CH fn_CRYPTO_thread_id = 'CRYPTO_thread_id'; } {Do not localize} - {CH fn_CRYPTO_get_lock_name = 'CRYPTO_get_lock_name'; } {Do not localize} - {CH fn_CRYPTO_add_lock = 'CRYPTO_add_lock'; } {Do not localize} - {CH fn_int_CRYPTO_set_do_dynlock_callback = 'int_CRYPTO_set_do_dynlock_callback'; } {Do not localize} - //OpenSSL 1.0.0 - use these instead of the depreciated CRYPTO_set_id_callback - fn_CRYPTO_THREADID_set_numeric = 'CRYPTO_THREADID_set_numeric'; {Do not localize} - fn_CRYPTO_THREADID_set_pointer = 'CRYPTO_THREADID_set_pointer'; {Do not localize} - fn_CRYPTO_THREADID_set_callback = 'CRYPTO_THREADID_set_callback'; {Do not localize} - //end section - fn_CRYPTO_set_mem_functions = 'CRYPTO_set_mem_functions'; {Do not localize} - {CH fn_CRYPTO_set_mem_info_functions = 'CRYPTO_set_mem_info_functions'; } {Do not localize} - {CH fn_CRYPTO_get_mem_functions = 'CRYPTO_get_mem_functions'; } {Do not localize} - {CH fn_CRYPTO_set_locked_mem_functions = 'CRYPTO_set_locked_mem_functions'; } {Do not localize} - {CH fn_CRYPTO_get_locked_mem_functions = 'CRYPTO_get_locked_mem_functions'; } {Do not localize} - {CH fn_CRYPTO_malloc_locked = 'CRYPTO_malloc_locked'; } {Do not localize} - {CH fn_CRYPTO_free_locked = 'CRYPTO_free_locked'; } {Do not localize} - fn_CRYPTO_malloc = 'CRYPTO_malloc'; {Do not localize} - fn_CRYPTO_free = 'CRYPTO_free'; {Do not localize} - {CH fn_CRYPTO_realloc = 'CRYPTO_realloc'; } {Do not localize} - {CH fn_CRYPTO_remalloc = 'CRYPTO_remalloc'; } {Do not localize} - {CH fn_CRYPTO_dbg_malloc = 'CRYPTO_dbg_malloc'; } {Do not localize} - {CH fn_CRYPTO_dbg_realloc = 'CRYPTO_dbg_realloc'; } {Do not localize} - {CH fn_CRYPTO_dbg_free = 'CRYPTO_dbg_free'; } {Do not localize} - {CH fn_CRYPTO_dbg_remalloc = 'CRYPTO_dbg_remalloc'; } {Do not localize} - {$IFNDEF OPENSSL_NO_FP_API} - {CH fn_CRYPTO_mem_leaks_fp = 'CRYPTO_mem_leaks_fp'; } {Do not localize} - {$ENDIF} - fn_CRYPTO_mem_leaks = 'CRYPTO_mem_leaks'; {Do not localize} - {CH fn_CRYPTO_mem_leaks_cb = 'CRYPTO_mem_leaks_cb'; } {Do not localize} - fn_CRYPTO_cleanup_all_ex_data = 'CRYPTO_cleanup_all_ex_data'; {Do not localize} - fn_CRYPTO_set_mem_debug_functions = 'CRYPTO_set_mem_debug_functions'; {Do not localize} - {CH fn_CRYPTO_dbg_set_options = 'CRYPTO_dbg_set_options'; } {Do not localize} - {CH fn_CRYPTO_dbg_get_options = 'CRYPTO_dbg_get_options'; } {Do not localize} - {CH fn_CRYPTO_dbg_push_info = 'CRYPTO_dbg_push_info'; } {Do not localize} - {CH fn_CRYPTO_dbg_pop_info = 'CRYPTO_dbg_pop_info'; } {Do not localize} - {CH fn_CRYPTO_dbg_remove_all_info = 'CRYPTO_dbg_remove_all_info'; } {Do not localize} - {CH fn_CRYPTO_memcmp = 'CRYPTO_memcmp'; } {Do not localize} - fn_ERR_load_CRYPTO_strings = 'ERR_load_CRYPTO_strings'; {Do not localize} - {CH fn_OPENSSL_init = 'OPENSSL_init'; } {Do not localize} - {CH fn_lh_new = 'lh_new'; } {Do not localize} - {CH fn_lh_free = 'lh_free'; } {Do not localize} - {CH fn_lh_insert = 'lh_insert'; } {Do not localize} - {CH fn_lh_delete = 'lh_delete'; } {Do not localize} - {CH fn_lh_retrieve = 'lh_retrieve'; } {Do not localize} - {CH fn_lh_doall = 'lh_doall'; } {Do not localize} - {CH fn_lh_doall_arg = 'lh_doall_arg'; } {Do not localize} - {CH fn_lh_strhash = 'lh_strhash'; } {Do not localize} - {CH fn_lh_stats = 'lh_stats'; } {Do not localize} - {CH fn_lh_node_stats = 'lh_node_stats'; } {Do not localize} - {CH fn_lh_node_usage_stats = 'lh_node_usage_stats'; } {Do not localize} - {CH fn_BUF_MEM_new = 'BUF_MEM_new'; } {Do not localize} - {CH fn_BUF_MEM_free = 'BUF_MEM_free'; } {Do not localize} - {CH fn_BUF_MEM_grow = 'BUF_MEM_grow'; } {Do not localize} - {CH fn_BUF_strdup = 'BUF_strdup'; } {Do not localize} - {CH fn_ERR_load_BUF_strings = 'ERR_load_BUF_strings'; } {Do not localize} - {CH fn_BIO_ctrl_pending = 'BIO_ctrl_pending'; } {Do not localize} - {CH fn_BIO_ctrl_wpending = 'BIO_ctrl_wpending'; } {Do not localize} - {CH fn_BIO_ctrl_get_write_guarantee = 'BIO_ctrl_get_write_guarantee'; } {Do not localize} - {CH fn_BIO_ctrl_get_read_request = 'BIO_ctrl_get_read_request'; } {Do not localize} - fn_BIO_set_ex_data = 'BIO_set_ex_data'; {Do not localize} - fn_BIO_get_ex_data = 'BIO_get_ex_data'; {Do not localize} - {CH fn_BIO_get_ex_new_index = 'BIO_get_ex_new_index'; } {Do not localize} - fn_BIO_s_file = 'BIO_s_file'; {Do not localize} - fn_BIO_new_file = 'BIO_new_file'; {Do not localize} - {CH fn_BIO_new_fp = 'BIO_new_fp'; } {Do not localize} - fn_BIO_new = 'BIO_new'; {Do not localize} - fn_BIO_set_flags = 'BIO_set_flags'; {Do not localize} - fn_BIO_new_mem_buf = 'BIO_new_mem_buf'; {Do not localize} - {CH fn_BIO_set = 'BIO_set'; } {Do not localize} - fn_BIO_free = 'BIO_free'; {Do not localize} - fn_BIO_read = 'BIO_read'; {Do not localize} - {CH fn_BIO_gets = 'BIO_gets'; } {Do not localize} - fn_BIO_write = 'BIO_write'; {Do not localize} - fn_BIO_puts = 'BIO_puts'; {Do not localize} - fn_BIO_ctrl = 'BIO_ctrl'; {Do not localize} - fn_BIO_ptr_ctrl = 'BIO_ptr_ctrl'; {Do not localize} - fn_BIO_int_ctrl = 'BIO_int_ctrl'; {Do not localize} - fn_BIO_push = 'BIO_push'; {Do not localize} - fn_BIO_pop = 'BIO_pop'; {Do not localize} - fn_BIO_set_next = 'BIO_set_next'; {Do not localize} - fn_BIO_free_all = 'BIO_free_all'; {Do not localize} - {CH fn_BIO_find_type = 'BIO_find_type'; } {Do not localize} - {CH fn_BIO_get_retry_BIO = 'BIO_get_retry_BIO'; } {Do not localize} - {CH fn_BIO_get_retry_reason = 'BIO_get_retry_reason'; } {Do not localize} - {CH fn_BIO_dup_chain = 'BIO_dup_chain'; } {Do not localize} - {CH fn_BIO_debug_callback = 'BIO_debug_callback'; } {Do not localize} - - fn_BIO_s_mem = 'BIO_s_mem'; {Do not localize} - {CH fn_BIO_s_socket = 'BIO_s_socket'; } {Do not localize} - {CH fn_BIO_s_connect = 'BIO_s_connect'; } {Do not localize} - {CH fn_BIO_s_accept = 'BIO_s_accept'; } {Do not localize} - {CH fn_BIO_s_fd = 'BIO_s_fd'; } {Do not localize} - {CH fn_BIO_s_bio = 'BIO_s_bio'; } {Do not localize} - {CH fn_BIO_s_null = 'BIO_s_null'; } {Do not localize} - {CH fn_BIO_f_null = 'BIO_f_null'; } {Do not localize} - {CH fn_BIO_f_buffer = 'BIO_f_buffer'; } {Do not localize} - {CH fn_BIO_f_nbio_test = 'BIO_f_nbio_test'; } {Do not localize} - {CH fn_BIO_sock_should_retry = 'BIO_sock_should_retry'; } {Do not localize} - {CH fn_BIO_sock_non_fatal_error = 'BIO_sock_non_fatal_error'; } {Do not localize} - {CH fn_BIO_fd_should_retry = 'BIO_fd_should_retry'; } {Do not localize} - {CH fn_BIO_fd_non_fatal_error = 'BIO_fd_non_fatal_error'; } {Do not localize} - {CH fn_BIO_dump = 'BIO_dump'; } {Do not localize} - {CH fn_BIO_gethostbyname = 'BIO_gethostbyname'; } {Do not localize} - {CH fn_BIO_sock_error = 'BIO_sock_error'; } {Do not localize} - {CH fn_BIO_socket_ioctl = 'BIO_socket_ioctl'; } {Do not localize} - {CH fn_BIO_socket_nbio = 'BIO_socket_nbio'; } {Do not localize} - {CH fn_BIO_get_port = 'BIO_get_port'; } {Do not localize} - {CH fn_BIO_get_host_ip = 'BIO_get_host_ip'; } {Do not localize} - {CH fn_BIO_get_accept_socket = 'BIO_get_accept_socket'; } {Do not localize} - {CH fn_BIO_accept = 'BIO_accept'; } {Do not localize} - {CH fn_BIO_sock_init = 'BIO_sock_init'; } {Do not localize} - {CH fn_BIO_sock_cleanup = 'BIO_sock_cleanup'; } {Do not localize} - {CH fn_BIO_set_tcp_ndelay = 'BIO_set_tcp_ndelay'; } {Do not localize} - {CH fn_ERR_load_BIO_strings = 'ERR_load_BIO_strings'; } {Do not localize} - {CH fn_BIO_new_socket = 'BIO_new_socket'; } {Do not localize} - {CH fn_BIO_new_fd = 'BIO_new_fd'; } {Do not localize} - {CH fn_BIO_new_connect = 'BIO_new_connect'; } {Do not localize} - {CH fn_BIO_new_accept = 'BIO_new_accept'; } {Do not localize} - {CH fn_BIO_new_bio_pair = 'BIO_new_bio_pair'; } {Do not localize} - {CH fn_BIO_copy_next_retry = 'BIO_copy_next_retry'; } {Do not localize} - {CH fn_BIO_ghbn_ctrl = 'BIO_ghbn_ctrl'; } {Do not localize} - {CH fn_COMP_CTX_new = 'COMP_CTX_new';} {Do not localize} - {CH fn_COMP_CTX_free = 'COMP_CTX_free'; } {Do not localize} - {CH fn_COMP_compress_block = 'COMP_compress_block'; } {Do not localize} - {CH fn_COMP_expand_block = 'COMP_expand_block'; } {Do not localize} - {CH fn_COMP_rle = 'COMP_rle'; } {Do not localize} - {CH fn_COMP_zlib = 'COMP_zlib'; } {Do not localize} - {CH fn_COMP_zlib_cleanup = 'COMP_zlib_cleanup'; } {Do not localized} - {$IFDEF HEADER_BIO_H} - {$IFDEF ZLIB} - {CH fn_BIO_f_zlib = 'BIO_f_zlib'; } {Do not localize} - {$ENDIF} - {$ENDIF} - {$IFNDEF OPENSSL_NO_MD2} - {CH fn_MD2_options = 'MD2_options'; } {Do not localize} - {$IFDEF OPENSSL_FIPS} - {CH fn_private_MD2_Init = 'private_MD2_Init'; } {Do not localize} - {$ENDIF} - {CH fn_MD2_Init = 'MD2_Init'; } {Do not localize} - {CH fn_MD2_Update = 'MD2_Update'; } {Do not localize} - {CH fn_MD2_Final = 'MD2_Final'; } {Do not localize} - {CH fn_MD2 = 'MD2'; } {Do not localize} - {$ENDIF} - {$IFNDEF OPENSSL_NO_MD4} - {$IFDEF OPENSSL_FIPS} - {CH fn_private_MD4_Init = 'private_MD4_Init'; } {Do not localize} - {$ENDIF} - {CH fn_MD4_Init = 'MD4_Init'; } {Do not localize} - {CH fn_MD4_Update = 'MD4_Update'; } {Do not localize} - {CH fn_MD4_Final = 'MD4_Final'; } {Do not localize} - {CH fn_MD4 = 'MD4'; } {Do not localize} - {CH fn_MD4_Transform = 'MD4_Transform'; } {Do not localize} - {$ENDIF} - {$IFNDEF OPENSSL_NO_MD5} - {$IFDEF OPENSSL_FIPS} - {CH fn_private_MD5_Init = 'private_MD5_Init'; } {Do not localize} - {$ENDIF} - {CH fn_MD5_Init = 'MD5_Init'; } {Do not localize} - {CH fn_MD5_Update = 'MD5_Update'; } {Do not localize} - {CH fn_MD5_Final = 'MD5_Final'; } {Do not localize} - {CH fn_MD5 = 'MD5'; } {Do not localize} - {CH fn_MD5_Transform = 'MD5_Transform'; } {Do not localize} - {$ENDIF} - {$IFNDEF OPENSSL_NO_SHA} - {$IFNDEF OPENSSL_NO_SHA0} - {$IFDEF OPENSSL_FIPS} - {CH fn_private_SHA_Init = 'private_SHA_Init'; } {Do not localize} - {$ENDIF} - {CH fn_SHA_Init = 'SHA_Init'; } {Do not localize} - {CH fn_SHA_Update = 'SHA_Update'; } {Do not localize} - {CH fn_SHA_Final = 'SHA_Final'; } {Do not localize} - {CH fn_SHA = 'SHA'; } {Do not localize} - {CH fn_SHA_Transform = 'SHA_Transform'; } {Do not localize} - {$ENDIF} - {$IFNDEF OPENSSL_NO_SHA1} - {CH fn_SHA1_Init = 'SHA1_Init'; } {Do not localize} - {CH fn_SHA1_Update = 'SHA1_Update'; } {Do not localize} - {CH fn_SHA1_Final = 'SHA1_Final'; } {Do not localize} - {CH fn_SHA1 = 'SHA1'; } {Do not localize} - {CH fn_SHA1_Transform = 'SHA1_Transform'; } {Do not localize} - {$ENDIF} - {$IFNDEF OPENSSL_NO_SHA256} - {CH fn_SHA224_Init = 'SHA224_Init'; } {Do not localize} - {CH fn_SHA224_Update = 'SHA224_Update'; } {Do not localize} - {CH fn_SHA224_Final = 'SHA224_Final'; } {Do not localize} - {CH fn_SHA224 = 'SHA224'; } {Do not localize} - {CH fn_SHA256_Init = 'SHA256_Init'; } {Do not localize} - {CH fn_SHA256_Update = 'SHA256_Update'; } {Do not localize} - {CH fn_SHA256_Final = 'SHA256_Final'; } {Do not localize} - {CH fn_SHA256 = 'SHA256'; } {Do not localize} - {CH fn_SHA256_Transform = 'SHA256_Transform'; } {Do not localize} - {$ENDIF} - {$IFNDEF OPENSSL_NO_SHA512} - {CH fn_SHA384_Init = 'SHA384_Init'; } {Do not localize} - {CH fn_SHA384_Update = 'SHA384_Update'; } {Do not localize} - {CH fn_SHA384_Final = 'SHA384_Final'; } {Do not localize} - {CH fn_SHA384 = 'SHA384'; } {Do not localize} - {CH fn_SHA512_Init = 'SHA512_Init'; } {Do not localize} - {CH fn_SHA512_Update = 'SHA512_Update'; } {Do not localize} - {CH fn_SHA512_Final = 'SHA512_Final'; } {Do not localize} - {CH fn_SHA512 = 'SHA512'; } {Do not localize} - {CH fn_SHA512_Transform = 'SHA512_Transform'; } {Do not localize} - {$ENDIF} - {$ENDIF} - {$IFNDEF OPENSSL_NO_RIPEMD} - {$IFDEF OPENSSL_FIPS} - {CH fn_private_RIPEMD160_Init = 'private_RIPEMD160_Init'; } {Do not localize} - {$ENDIF} - {CH fn_RIPEMD160_Init = 'RIPEMD160_Init'; } {Do not localize} - {CH fn_RIPEMD160_Update = 'RIPEMD160_Update'; } {Do not localize} - {CH fn_RIPEMD160_Final = 'RIPEMD160_Final'; } {Do not localize} - {CH fn_RIPEMD160 = 'RIPEMD160'; } {Do not localize} - {CH fn_RIPEMD160_Transform = 'RIPEMD160_Transform'; } {Do not localize} - {$ENDIF} - {$IFNDEF OPENSSL_NO_HMAC} - fn_HMAC_CTX_init = 'HMAC_CTX_init'; {Do not localize} - fn_HMAC_CTX_cleanup = 'HMAC_CTX_cleanup'; {Do not localize} - {CH fn_HMAC_Init = 'HMAC_Init'; } {Do not localize} - fn_HMAC_Init_ex = 'HMAC_Init_ex'; {Do not localize} - fn_HMAC_Update = 'HMAC_Update'; {Do not localize} - fn_HMAC_Final = 'HMAC_Final'; {Do not localize} - {CH fn_HMAC = 'HMAC'; } {Do not localize} - {CH fn_HMAC_CTX_set_flags = 'HMAC_CTX_set_flags'; } {Do not localize} - {$ENDIF} - {$IFNDEF HEADER_TMDIFF_H} - {CH fn_ms_time_new = 'ms_time_new'; } {Do not localize} - {CH fn_ms_time_free = 'ms_time_free'; } {Do not localize} - {CH fn_ms_time_get = 'ms_time_get'; } {Do not localize} - {CH fn_ms_time_diff = 'ms_time_diff'; } {Do not localize} - {CH fn_ms_time_cmp = 'ms_time_cmp'; } {Do not localize} - {$ENDIF} - {$IFNDEF OPENSSL_NO_AES} - {CH fn_AES_options = 'AES_options'; }{Do not localize} - {CH fn_AES_set_encrypt_key = 'AES_set_encrypt_key'; }{Do not localize} - {CH fn_AES_set_decrypt_key = 'AES_set_decrypt_key'; }{Do not localize} - {CH fn_AES_encrypt = 'AES_encrypt'; }{Do not localize} - {CH fn_AES_decrypt = 'AES_decrypt'; } {Do not localize} - {CH fn_AES_ecb_encrypt = 'AES_ecb_encrypt'; } {Do not localize} - {CH fn_AES_cbc_encrypt = 'AES_cbc_encrypt'; } {Do not localize} - {CH fn_AES_cfb128_encrypt = 'AES_cfb128_encrypt'; } {Do not localize} - {CH fn_AES_cfb1_encrypt = 'AES_cfb1_encrypt'; } {Do not localize} - {CH fn_AES_cfb8_encrypt = 'AES_cfb8_encrypt'; } {Do not localize} - {CH fn_AES_cfbr_encrypt_block = 'AES_cfbr_encrypt_block'; } {Do not localize} - {CH fn_AES_ofb128_encrypt = 'AES_ofb128_encrypt'; } {Do not localize} - {CH fn_AES_ctr128_encrypt = 'AES_ctr128_encrypt'; } {Do not localize} - {CH fn_AES_ige_encrypt = 'AES_ige_encrypt'; } {Do not localize} - {CH fn_AES_bi_ige_encrypt = 'AES_bi_ige_encrypt'; } {Do not localize} - {CH fn_AES_wrap_key = 'AES_wrap_key'; } {Do not localize} - {CH fn_AES_unwrap_key = 'AES_unwrap_key'; } {Do not localize} - {$ENDIF} - {$IFNDEF OPENSSL_NO_DES} - {CH fn_des_options = 'DES_options'; } {Do not localize} - {CH fn_des_ecb3_encrypt = 'DES_ecb3_encrypt'; } {Do not localize} - {CH fn_des_cbc_cksum = 'DES_cbc_cksum'; } {Do not localize} - {CH fn_des_cbc_encrypt = 'DES_cbc_encrypt'; } {Do not localize} - {CH fn_des_ncbc_encrypt = 'DES_ncbc_encrypt'; } {Do not localize} - {CH fn_des_xcbc_encrypt = 'DES_xcbc_encrypt'; } {Do not localize} - {CH fn_des_cfb_encrypt = 'DES_cfb_encrypt'; } {Do not localize} - fn_des_ecb_encrypt = 'DES_ecb_encrypt'; {Do not localize} - fnold_des_ecb_encrypt = 'DES_ecb_encrypt'; {Do not localize} - {CH fn_des_encrypt = 'DES_encrypt'; } {Do not localize} - {CH fn_des_encrypt2 = 'DES_encrypt2'; } {Do not localize} - {CH fn_des_encrypt3 = 'DES_encrypt3'; } {Do not localize} - {CH fn_des_decrypt3 = 'DES_decrypt3'; } {Do not localize} - {CH fn_des_ede3_cbc_encrypt = 'DES_ede3_cbc_encrypt'; } {Do not localize} - {CH fn_des_ede3_cbcm_encrypt = 'DES_ede3_cbcm_encrypt'; } {Do not localize} - {CH fn_des_ede3_cfb64_encrypt = 'DES_ede3_cfb64_encrypt'; } {Do not localize} - {CH fn_des_ede3_ofb64_encrypt = 'DES_ede3_ofb64_encrypt'; } {Do not localize} - {$IFDEF USE_THIS} - {CH fn_des_xwhite_in2out = 'DES_xwhite_in2out'; } {Do not localize} - {$ENDIF} - {CH fn_des_enc_read = 'DES_enc_read'; } {Do not localize} - {CH fn_des_enc_write = 'DES_enc_write'; } {Do not localize} - {CH fn_des_fcrypt = 'DES_fcrypt'; } {Do not localize} - {CH fn_crypt = 'crypt'; } {Do not localize} - {CH fn_des_ofb_encrypt = 'DES_ofb_encrypt'; } {Do not localize} - {CH fn_des_pcbc_encrypt = 'DES_pcbc_encrypt'; } {Do not localize} - {CH fn_des_quad_cksum = 'DES_quad_cksum'; } {Do not localize} - {CH fn_des_random_seed = 'DES_random_seed'; } {Do not localize} - {CH fn_des_random_key = 'DES_random_key'; } {Do not localize} - {CH fn_des_read_password = 'DES_read_password'; } {Do not localize} - {CH fn_des_read_2passwords = 'DES_read_2passwords'; } {Do not localize} - {CH fn_des_read_pw_string = 'DES_read_pw_string'; } {Do not localize} - fn_des_set_odd_parity = 'DES_set_odd_parity'; {Do not localize} - fnold_des_set_odd_parity = 'DES_set_odd_parity'; {Do not localize} - {CH fn_des_is_weak_key = 'DES_is_weak_key'; } {Do not localize} - fn_des_set_key = 'DES_set_key'; {Do not localize} - fnold_des_set_key = '_ossl_old_des_set_key'; {Do not localize} - {CH fn_des_key_sched = 'DES_key_sched'; } {Do not localize} - {CH fn_des_string_to_key = 'DES_string_to_key'; } {Do not localize} - {CH fn_des_string_to_2keys = 'DES_string_to_2keys'; } {Do not localize} - {CH fn_des_cfb64_encrypt = 'DES_cfb64_encrypt'; } {Do not localize} - {CH fn_des_ofb64_encrypt = 'DES_ofb64_encrypt'; } {Do not localize} - {CH fn_des_read_pw = 'DES_read_pw'; } {Do not localize} - {CH fn_des_cblock_print_file = 'DES_cblock_print_file'; } {Do not localize} - //des_old.h - {CH fn__ossl_old_des_options = '_ossl_old_des_options'; } {Do not localize} - {CH fn__ossl_old_des_ecb3_encrypt = '_ossl_old_des_ecb3_encrypt'; } {Do not localize} - {CH fn__ossl_old_des_cbc_cksum = '_ossl_old_des_cbc_cksum'; } {Do not localize} - {CH fn__ossl_old_des_cbc_encrypt = '_ossl_old_des_cbc_encrypt'; } {Do not localize} - {CH fn__ossl_old_des_ncbc_encrypt = '_ossl_old_des_ncbc_encrypt'; } {Do not localize} - {CH fn__ossl_old_des_xcbc_encrypt = '_ossl_old_des_xcbc_encrypt'; } {Do not localize} - {CH fn__ossl_old_des_cfb_encrypt = '_ossl_old_des_cfb_encrypt'; } {Do not localize} - fn__ossl_old_des_ecb_encrypt = '_ossl_old_des_ecb_encrypt'; {Do not localize} - {CH fn__ossl_old_des_encrypt = '_ossl_old_des_encrypt'; } {Do not localize} - {CH fn__ossl_old_des_encrypt2 = '_ossl_old_des_encrypt2'; } {Do not localize} - {CH fn__ossl_old_des_encrypt3 = '_ossl_old_des_encrypt3'; } {Do not localize} - {CH fn__ossl_old_des_decrypt3 = '_ossl_old_des_decrypt3'; } {Do not localize} - {CH fn__ossl_old_des_ede3_cbc_encrypt = '_ossl_old_des_ede3_cbc_encrypt'; } {Do not localize} - {CH fn__ossl_old_des_ede3_cfb64_encrypt = '_ossl_old_des_ede3_cfb64_encrypt'; } {Do not localize} - {CH fn__ossl_old_des_ede3_ofb64_encrypt = '_ossl_old_des_ede3_ofb64_encrypt'; } {Do not localize} - {$IFDEF USE_THIS} - {CH fn__ossl_old_des_xwhite_in2out = '_ossl_old_des_xwhite_in2out'; } {Do not localize} - {$ENDIF} - {CH fn__ossl_old_des_enc_read = '_ossl_old_des_enc_read'; } {Do not localize} - {CH fn__ossl_old_des_enc_write = '_ossl_old_des_enc_write'; } {Do not localize} - {CH fn__ossl_old_des_fcrypt = '_ossl_old_des_fcrypt'; } {Do not localize} - {CH fn__ossl_old_des_crypt = '_ossl_old_des_crypt'; } {Do not localize} - {$IFNDEF PERL5} - {$IFNDEF NeXT} - {CH fn__ossl_old_crypt = '_ossl_old_crypt'; } {Do not localize} - {$ENDIF} - {$ENDIF} - {CH fn__ossl_old_des_ofb_encrypt = '_ossl_old_des_ofb_encrypt'; } {Do not localize} - {CH fn__ossl_old_des_pcbc_encrypt = '_ossl_old_des_pcbc_encrypt'; } {Do not localize} - {CH fn__ossl_old_des_quad_cksum = '_ossl_old_des_quad_cksum'; } {Do not localize} - {CH fn__ossl_old_des_random_seed = '_ossl_old_des_random_seed'; } {Do not localize} - {CH fn__ossl_old_des_random_key = '_ossl_old_des_random_key'; } {Do not localize} - {CH fn__ossl_old_des_read_password = '_ossl_old_des_read_password'; } {Do not localize} - {CH fn__ossl_old_des_read_2passwords = '_ossl_old_des_read_2passwords'; } {Do not localize} - fn__ossl_old_des_set_odd_parity = '_ossl_old_des_set_odd_parity'; {Do not localize} - {CH fn__ossl_old_des_is_weak_key = '_ossl_old_des_is_weak_key'; } {Do not localize} - fn__ossl_old_des_set_key = '_ossl_old_des_set_key'; {Do not localize} - {CH fn__ossl_old_des_key_sched = '_ossl_old_des_key_sched'; } {Do not localize} - {CH fn__ossl_old_des_string_to_key = '_ossl_old_des_string_to_key'; } {Do not localize} - {CH fn__ossl_old_des_string_to_2keys = '_ossl_old_des_string_to_2keys'; } {Do not localize} - {CH fn__ossl_old_des_cfb64_encrypt = '_ossl_old_des_cfb64_encrypt'; } {Do not localize} - {CH fn__ossl_old_des_ofb64_encrypt = '_ossl_old_des_ofb64_encrypt'; } {Do not localize} - {CH fn__ossl_096_des_random_seed = '_ossl_096_des_random_seed'; } {Do not localize} - {$ENDIF} - {$IFNDEF OPENSSL_NO_RC4} - {CH fn_RC4_options = 'RC4_options'; } {Do not localize} - {$IFDEF OPENSSL_FIPS} - {CH private_RC4_set_key = 'private_RC4_set_key'; } {Do not localize} - {$ENDIF} - {CH fn_RC4_set_key = 'RC4_set_key'; } {Do not localize} - {CH fn_RC4 = 'RC4'; } {Do not localize} - {$ENDIF} - {$IFNDEF OPENSSL_NO_RC2} - {$IFDEF OPENSSL_FIPS} - {CH fn_private_RC2_set_key = 'private_RC2_set_key'; } {Do not localize} - {$ENDIF} - {CH fn_RC2_set_key = 'RC2_set_key'; } {Do not localize} - {CH fn_RC2_ecb_encrypt = 'RC2_ecb_encrypt'; } {Do not localize} - {CH fn_RC2_encrypt = 'RC2_encrypt'; } {Do not localize} - {CH fn_RC2_decrypt = 'RC2_decrypt'; } {Do not localize} - {CH fn_RC2_cbc_encrypt = 'RC2_cbc_encrypt'; } {Do not localize} - {CH fn_RC2_cfb64_encrypt = 'RC2_cfb64_encrypt'; } {Do not localize} - {CH fn_RC2_ofb64_encrypt = 'RC2_ofb64_encrypt'; } {Do not localize} - {$ENDIF} - {$IFNDEF OPENSSL_NO_RC5} - {CH fn_RC5_32_set_key = 'RC5_32_set_key'; } {Do not localize} - {CH fn_RC5_32_ecb_encrypt = 'RC5_32_ecb_encrypt'; } {Do not localize} - {CH fn_RC5_32_encrypt = 'RC5_32_encrypt'; } {Do not localize} - {CH fn_RC5_32_decrypt = 'RC5_32_decrypt'; } {Do not localize} - {CH fn_RC5_32_cbc_encrypt = 'RC5_32_cbc_encrypt'; } {Do not localize} - {CH fn_RC5_32_cfb64_encrypt = 'RC5_32_cfb64_encrypt'; } {Do not localize} - {CH fn_RC5_32_ofb64_encrypt = 'RC5_32_ofb64_encrypt'; } {Do not localize} - {$ENDIF} - {$IFNDEF OPENSSL_NO_BF} - {$IFDEF FIPS} - {CH fn_private_BF_set_key = 'private_BF_set_key'; } {Do not localize} - {$ENDIF} - {CH fn_BF_set_key = 'BF_set_key'; } {Do not localize} - {CH fn_BF_ecb_encrypt = 'BF_ecb_encrypt'; } {Do not localize} - {CH fn_BF_encrypt = 'BF_encrypt'; } {Do not localize} - {CH fn_BF_decrypt = 'BF_decrypt'; } {Do not localize} - {CH fn_BF_cbc_encrypt = 'BF_cbc_encrypt'; } {Do not localize} - {CH fn_BF_cfb64_encrypt = 'BF_cfb64_encrypt'; } {Do not localize} - {CH fn_BF_ofb64_encrypt = 'BF_ofb64_encrypt'; } {Do not localize} - {CH fn_BF_options = 'BF_options'; } {Do not localize} - {$ENDIF} - {$IFNDEF OPENSSL_NO_CAST} - {$IFDEF OPENSSL_FIPS} - {CH fn_private_CAST_set_key = 'private_CAST_set_key'; } {Do not localize} - {$ENDIF} - {CH fn_CAST_set_key = 'CAST_set_key'; } {Do not localize} - {CH fn_CAST_ecb_encrypt = 'CAST_ecb_encrypt'; } {Do not localize} - {CH fn_CAST_encrypt = 'CAST_encrypt'; } {Do not localize} - {CH fn_CAST_decrypt = 'CAST_decrypt'; } {Do not localize} - {CH fn_CAST_cbc_encrypt = 'CAST_cbc_encrypt'; } {Do not localize} - {CH fn_CAST_cfb64_encrypt = 'CAST_cfb64_encrypt'; } {Do not localize} - {CH fn_CAST_ofb64_encrypt = 'CAST_ofb64_encrypt'; } {Do not localize} - {$ENDIF} - {$IFNDEF OPENSSL_NO_IDEA} - {CH fn_idea_options = 'idea_options'; } {Do not localize} - {CH fn_idea_ecb_encrypt = 'idea_ecb_encrypt'; } {Do not localize} - {CH fn_idea_set_encrypt_key = 'idea_set_encrypt_key'; } {Do not localize} - {CH fn_idea_set_decrypt_key = 'idea_set_decrypt_key'; } {Do not localize} - {CH fn_idea_cbc_encrypt = 'idea_cbc_encrypt'; } {Do not localize} - {CH fn_idea_cfb64_encrypt = 'idea_cfb64_encrypt'; } {Do not localize} - {CH fn_idea_ofb64_encrypt = 'idea_ofb64_encrypt'; } {Do not localize} - {CH fn_idea_encrypt = 'idea_encrypt'; } {Do not localize} - {$IFDEF OPENSSL_FIPS} - {CH fn_private_idea_set_encrypt_key = 'private_idea_set_encrypt_key'; } {Do not localize} - {$ENDIF} - {$ENDIF} - {$IFNDEF OPENSSL_NO_MD2} - {CH fn_MDC2_Init = 'MDC2_Init'; } {Do not localize} - {CH fn_MDC2_Update = 'MDC2_Update'; } {Do not localize} - {CH fn_MDC2_Final = 'MDC2_Final'; } {Do not localize} - {CH fn_MDC2 = 'MDC2'; } {Do not localize} - {$ENDIF} - {$IFNDEF OPENSSL_NO_RSA} - fn_RSA_new = 'RSA_new'; {Do not localize} - {CH fn_RSA_new_method = 'RSA_new_method'; } {Do not localize} - fn_RSA_size = 'RSA_size'; {Do not localize} - fn_RSA_generate_key = 'RSA_generate_key'; {Do not localize} - fn_RSA_generate_key_ex = 'RSA_generate_key_ex'; {Do not localize} - {CH fn_RSA_X931_derive_ex = 'RSA_X931_derive_ex'; } {Do not localize} - {CH fn_RSA_X931_generate_key_ex = 'RSA_X931_generate_key_ex'; } {Do not localize} - fn_RSA_check_key = 'RSA_check_key'; {Do not localize} - fn_RSA_public_encrypt = 'RSA_public_encrypt'; {Do not localize} - {CH fn_RSA_private_encrypt = 'RSA_private_encrypt'; } {Do not localize} - {CH fn_RSA_public_decrypt = 'RSA_public_decrypt'; } {Do not localize} - fn_RSA_private_decrypt = 'RSA_private_decrypt'; {Do not localize} - fn_RSA_free = 'RSA_free'; {Do not localize} - {CH fn_RSA_flags = 'RSA_flags'; } {Do not localize} - {$IFDEF OPENSSL_FIPS} - {CH fn_FIPS_rsa_new = 'FIPS_rsa_new'; } {Do not localize} - {CH fn_FIPS_rsa_free = 'FIPS_rsa_free'; } {Do not localize} - {$ENDIF} - {CH fn_RSA_set_default_method = 'RSA_set_default_method'; } {Do not localize} - {CH fn_RSA_get_default_method = 'RSA_get_default_method'; } {Do not localize} - {CH fn_RSA_get_method = 'RSA_get_method'; } {Do not localize} - {CH fn_RSA_set_method = 'RSA_set_method'; } {Do not localize} - {CH fn_RSA_memory_lock = 'RSA_memory_lock'; } {Do not localize} - {CH fn_RSA_PKCS1_SSLeay = 'RSA_PKCS1_SSLeay'; } {Do not localize} - {CH fn_ERR_load_RSA_strings = 'ERR_load_RSA_strings'; } {Do not localize} - fn_d2i_RSAPublicKey = 'd2i_RSAPublicKey'; {Do not localize} - fn_i2d_RSAPublicKey = 'i2d_RSAPublicKey'; {Do not localize} - fn_d2i_RSAPrivateKey = 'd2i_RSAPrivateKey'; {Do not localize} - fn_i2d_RSAPrivateKey = 'i2d_RSAPrivateKey'; {Do not localize} - {$IFNDEF OPENSSL_NO_FP_API} - {CH fn_RSA_print_fp = 'RSA_print_fp'; } {Do not localize} - {$ENDIF} - {$IFNDEF OPENSSL_NO_BIO} - {CH fn_RSA_print = 'RSA_print'; } {Do not localize} - {$ENDIF} - {$IFNDEF OPENSSL_NO_RC4} - {CH fn_i2d_RSA_NET = 'i2d_RSA_NET'; }{Do not localize} - {CH fn_d2i_RSA_NET = 'd2i_RSA_NET'; }{Do not localize} - {CH fn_i2d_Netscape_RSA = 'i2d_Netscape_RSA'; } {Do not localize} - {CH fn_d2i_Netscape_RSA = 'd2i_Netscape_RSA'; } {Do not localize} - {$ENDIF} - {CH fn_d2i_Netscape_RSA_2 = 'd2i_Netscape_RSA_2'; } {Do not localize} - {CH fn_RSA_sign = 'RSA_sign'; } {Do not localize} - {CH fn_RSA_verify = 'RSA_verify'; } {Do not localize} - {CH fn_RSA_sign_ASN1_OCTET_STRING = 'RSA_sign_ASN1_OCTET_STRING'; } {Do not localize} - {CH fn_RSA_verify_ASN1_OCTET_STRING = 'RSA_verify_ASN1_OCTET_STRING'; } {Do not localize} - {CH fn_RSA_blinding_on = 'RSA_blinding_on'; } {Do not localize} - {CH fn_RSA_blinding_off = 'RSA_blinding_off'; } {Do not localize} - {CH fn_RSA_padding_add_PKCS1_type_1 = 'RSA_padding_add_PKCS1_type_1'; } {Do not localize} - {CH fn_RSA_padding_check_PKCS1_type_1 = 'RSA_padding_check_PKCS1_type_1'; } {Do not localize} - {CH fn_RSA_padding_add_PKCS1_type_2 = 'RSA_padding_add_PKCS1_type_2'; } {Do not localize} - {CH fn_RSA_padding_check_PKCS1_type_2 = 'RSA_padding_check_PKCS1_type_2'; } {Do not localize} - {CH fn_RSA_padding_add_PKCS1_OAEP = 'RSA_padding_add_PKCS1_OAEP'; } {Do not localize} - {CH fn_RSA_padding_check_PKCS1_OAEP = 'RSA_padding_check_PKCS1_OAEP'; } {Do not localize} - {CH fn_RSA_padding_add_SSLv23 = 'RSA_padding_add_SSLv23'; } {Do not localize} - {CH fn_RSA_padding_check_SSLv23 = 'RSA_padding_check_SSLv23'; } {Do not localize} - {CH fn_RSA_padding_add_none = 'RSA_padding_add_none'; } {Do not localize} - {CH fn_RSA_padding_check_none = 'RSA_padding_check_none'; } {Do not localize} - {CH fn_RSA_get_ex_new_index = 'RSA_get_ex_new_index'; } {Do not localize} - {CH fn_RSA_set_ex_data = 'RSA_set_ex_data'; } {Do not localize} - {CH fn_RSA_get_ex_data = 'RSA_get_ex_data'; } {Do not localize} - {$ENDIF} - {$IFNDEF OPENSSL_NO_DH} - {CH fn_DH_OpenSSL = 'DH_OpenSSL'; } {Do not localize} - {CH fn_DH_set_default_method = 'DH_set_default_method'; } {Do not localize} - {CH fn_DH_set_method = 'DH_set_method'; } {Do not localize} - {CH fn_DH_new_method = 'DH_new_method'; } {Do not localize} - {CH fn_DH_new = 'DH_new'; } {Do not localize} - {CH fn_DH_up_ref = 'DH_up_ref'; } {Do not localize} - fn_DH_free = 'DH_free'; {Do not localize} - {CH fn_DH_size = 'DH_size'; } {Do not localize} - {$IFNDEF OPENSSL_NO_DEPRECATED} - {CH fn_DH_generate_parameters = 'DH_generate_parameters'; } {Do not localize} - {$ENDIF} - {CH fn_DH_generate_parameters_ex = 'DH_generate_parameters_ex'; } {Do not localize} - {CH fn_DH_get_ex_new_index = 'DH_get_ex_new_index'; } {Do not localize} - {CH fn_DH_set_ex_data = 'DH_set_ex_data'; } {Do not localize} - {CH fn_DH_get_ex_data = 'DH_get_ex_data'; } {Do not localize} - {CH fn_DH_check = 'DH_check'; } {Do not localize} - {CH fn_DH_check_pub_key = 'DH_check_pub_key'; } {Do not localize} - {CH fn_DH_generate_key = 'DH_generate_key'; } {Do not localize} - {CH fn_DH_compute_key = 'DH_compute_key'; } {Do not localize} - fn_d2i_DHparams = 'd2i_DHparams'; {Do not localize} - fn_i2d_DHparams = 'i2d_DHparams'; {Do not localize} - {CH fn_DH_OpenSSL = 'DH_OpenSSL'; } {Do not localize} - {$IFDEF OPENSSL_FIPS} - {CH fn_FIPS_dh_new = 'FIPS_dh_new'; } {Do not localize} - {CH fn_FIPS_dh_free = 'FIPS_dh_free'; } {Do not localize} - {$ENDIF} - {$IFNDEF OPENSSL_NO_FP_API} - {CH fn_DHparams_print_fp = 'DHparams_print_fp'; } {Do not localize} - {$ENDIF} - {CH fn_DHparams_print = 'DHparams_print'; } {Do not localize} - {$ENDIF} - {CH fn_ERR_load_DH_strings = 'ERR_load_DH_strings'; } {Do not localize} - {$IFNDEF OPENSSL_NO_DSA} - {CH fn_DSA_SIG_new = 'DSA_SIG_new'; } {Do not localize} - {CH fn_DSA_SIG_free = 'DSA_SIG_free'; } {Do not localize} - {CH fn_i2d_DSA_SIG = 'i2d_DSA_SIG'; } {Do not localize} - {CH fn_d2i_DSA_SIG = 'd2i_DSA_SIG'; } {Do not localize} - {CH fn_DSA_do_sign = 'DSA_do_sign'; } {Do not localize} - {CH fn_DSA_do_verify = 'DSA_do_verify'; } {Do not localize} - {$IFDEF OPENSSL_FIPS} - {CH fn_FIPS_dsa_new = 'FIPS_dsa_new'; } {Do not localize} - {CH fn_FIPS_dsa_free = 'FIPS_dsa_free'; } {Co not localize} - {$ENDIF} - {CH fn_DSA_new = 'DSA_new'; } {Do not localize} - {CH fn_DSA_size = 'DSA_size'; } {Do not localize} - {CH fn_DSA_sign_setup = 'DSA_sign_setup'; } {Do not localize} - {CH fn_DSA_sign = 'DSA_sign'; } {Do not localize} - {CH fn_DSA_verify = 'DSA_verify'; } {Do not localize} - {CH fn_DSA_free = 'DSA_free'; } {Do not localize} - {CH fn_ERR_load_DSA_strings = 'ERR_load_DSA_strings'; } {Do not localize} - - {$IFNDEF OPENSSL_NO_DEPRECATED} - {CH fn_DSA_generate_parameters = 'DSA_generate_parameters'; } {Do not localize} - {$ENDIF} - {CH fn_DSA_generate_parameters_ex = 'DSA_generate_parameters_ex'; } {Do not localize} - {CH fn_DSA_generate_key = 'DSA_generate_key'; } {Do not localize} - fn_d2i_DSAPublicKey = 'd2i_DSAPublicKey'; {Do not localize} - fn_i2d_DSAPublicKey = 'i2d_DSAPublicKey'; {Do not localize} - fn_d2i_DSAPrivateKey = 'd2i_DSAPrivateKey'; {Do not localize} - fn_i2d_DSAPrivateKey = 'i2d_DSAPrivateKey'; {Do not localize} - fn_i2d_DSAparams = 'i2d_DSAparams'; {Do not localize} - fn_d2i_DSAparams = 'd2i_DSAparams'; {Do not localize} - {$IFNDEF OPENSSL_NO_BIO} - {CH fn_DSAparams_print = 'DSAparams_print'; } {Do not localize} - {CH fn_DSA_print = 'DSA_print'; } {Do not localize} - {$ENDIF} - {$IFNDEF OPENSSL_NO_FP_API} - {CH fn_DSAparams_print_fp = 'DSAparams_print_fp'; } {Do not localize} - {CH fn_DSA_print_fp = 'DSA_print_fp'; } {Do not localize} - {$ENDIF} - {CH fn_DSA_is_prime = 'DSA_is_prime'; } {Do not localize} - {$IFNDEF OPENSSL_NO_DH} - {CH fn_DSA_dup_DH = 'DSA_dup_DH'; } {Do not localize} - {$ENDIF} - {$IFDEF OPENSSL_FIPS} - {CH fn_FIPS_dsa_sig_encode = 'FIPS_dsa_sig_encode'; } {Do not localize} - {CH fn_FIPS_dsa_sig_decode = 'FIPS_dsa_sig_decode'; } {Do not localize} - {$ENDIF} - {$ENDIF} - {$IFNDEF OPENSSL_NO_EC} - {CH fn_EC_GFp_simple_method = 'EC_GFp_simple_method'; } {Do not localize} - {CH fn_EC_GFp_mont_method = 'EC_GFp_mont_method'; } {Do not localize} - {CH fn_EC_GFp_nist_method = 'EC_GFp_nist_method'; } {Do not localize} - {CH fn_EC_GF2m_simple_method = 'EC_GF2m_simple_method'; } {Do not localize} - {CH fn_EC_GROUP_new = 'EC_GROUP_new'; } {Do not localize} - {CH fn_EC_GROUP_free = 'EC_GROUP_free'; } {Do not localize} - {CH fn_EC_GROUP_clear_free = 'EC_GROUP_clear_free'; } {Do not localize} - {CH fn_EC_GROUP_copy = 'EC_GROUP_copy'; } {Do not localize} - {CH fn_EC_GROUP_dup = 'EC_GROUP_dup'; } {Do not localize} - {CH fn_EC_GROUP_method_of = 'EC_GROUP_method_of'; } {Do not localize} - {CH fn_EC_METHOD_get_field_type = 'EC_METHOD_get_field_type'; } {Do not localize} - {CH fn_EC_GROUP_set_generator = 'EC_GROUP_set_generator'; } {Do not localize} - {CH fn_EC_GROUP_get0_generator = 'EC_GROUP_get0_generator'; } {Do not localize} - {CH fn_EC_GROUP_get_order = 'EC_GROUP_get_order'; } {Do not localize} - {CH fn_EC_GROUP_get_cofactor = 'EC_GROUP_get_cofactor'; } {Do not localize} - {CH fn_EC_GROUP_set_curve_name ='EC_GROUP_set_curve_name'; } {Do not localize} - {CH fn_EC_GROUP_get_curve_name = 'EC_GROUP_get_curve_name'; } {Do not localize} - {CH fn_EC_GROUP_set_asn1_flag = 'EC_GROUP_set_asn1_flag'; } {Do not localize} - {CH fn_EC_GROUP_get_asn1_flag = 'EC_GROUP_get_asn1_flag'; } {Do not localize} - {CH fn_EC_GROUP_set_point_conversion_form = 'EC_GROUP_set_point_conversion_form'; } {Do not localize} - {CH fn_EC_GROUP_get_point_conversion_form = 'EC_GROUP_get_point_conversion_form'; } {Do not localize} - {CH fn_EC_GROUP_get0_seed = 'EC_GROUP_get0_seed'; } {Do not localize} - {CH fn_EC_GROUP_get_seed_len = 'EC_GROUP_get_seed_len'; } {Do not localize} - {CH fn_EC_GROUP_set_seed = 'EC_GROUP_set_seed'; } {Do not localize} - {CH fn_EC_GROUP_set_curve_GFp = 'EC_GROUP_set_curve_GFp'; } {Do not localize} - {CH fn_EC_GROUP_get_curve_GFp = 'EC_GROUP_get_curve_GFp'; } {Do not localize} - {CH fn_EC_GROUP_set_curve_GF2m = 'EC_GROUP_set_curve_GF2m'; } {Do not localize} - {CH fn_EC_GROUP_get_curve_GF2m = 'EC_GROUP_get_curve_GF2m'; } {Do not localize} - {CH fn_EC_GROUP_get_degree = 'EC_GROUP_get_degree'; } {Do not localize} - {CH fn_EC_GROUP_check = 'EC_GROUP_check'; } {Do not localize} - {CH fn_EC_GROUP_check_discriminant = 'EC_GROUP_check_discriminant'; } {Do not localize} - {CH fn_EC_GROUP_cmp = 'EC_GROUP_cmp'; } {Do not localize} - {CH fn_EC_GROUP_new_curve_GFp = 'EC_GROUP_new_curve_GFp'; } {Do not localize} - {CH fn_EC_GROUP_new_curve_GF2m = 'EC_GROUP_new_curve_GF2m'; } {Do not localize} - {CH fn_EC_GROUP_new_by_curve_name = 'EC_GROUP_new_by_curve_name'; } {Do not localize} - {CH fn_EC_get_builtin_curves = 'EC_get_builtin_curves'; } {Do not localize} - {CH fn_EC_POINT_new = 'EC_POINT_new'; } {Do not localize} - {CH fn_EC_POINT_free = 'EC_POINT_free'; } {Do not localize} - {CH fn_EC_POINT_clear_free = 'EC_POINT_clear_free'; } {Do not localize} - {CH fn_EC_POINT_copy = 'EC_POINT_copy'; } {Do not localize} - {CH fn_EC_POINT_dup = 'EC_POINT_dup'; } {Do not localize} - {CH fn_EC_POINT_method_of = 'EC_POINT_method_of'; } {Do not localize} - {CH fn_EC_POINT_set_to_infinity = 'EC_POINT_set_to_infinity'; } {Do not localize} - {CH fn_EC_POINT_set_Jprojective_coordinates_GFp = 'EC_POINT_set_Jprojective_coordinates_GFp'; } {Do not localize} - {CH fn_EC_POINT_get_Jprojective_coordinates_GFp = 'EC_POINT_get_Jprojective_coordinates_GFp'; } {Do not localize} - {CH fn_EC_POINT_set_affine_coordinates_GFp = 'EC_POINT_set_affine_coordinates_GFp'; } {Do not localize} - {CH fn_EC_POINT_get_affine_coordinates_GFp = 'EC_POINT_get_affine_coordinates_GFp'; } {Do not localize} - {CH fn_EC_POINT_set_compressed_coordinates_GFp = 'EC_POINT_set_compressed_coordinates_GFp'; } {Do not localize} - {CH fn_EC_POINT_set_affine_coordinates_GF2m = 'EC_POINT_set_affine_coordinates_GF2m'; } {Do not localize} - {CH fn_EC_POINT_set_compressed_coordinates_GF2m = 'EC_POINT_set_compressed_coordinates_GF2m'; } {Do not localize} - {CH fn_EC_POINT_point2oct = 'EC_POINT_point2oct'; } {Do not localize} - {CH fn_EC_POINT_oct2point = 'EC_POINT_oct2point'; } {Do not localize} - {CH fn_EC_POINT_point2bn = 'EC_POINT_point2bn'; } {Do not localize} - {CH fn_EC_POINT_bn2point = 'EC_POINT_bn2point'; } {Do not localize} - {CH fn_EC_POINT_point2hex = 'EC_POINT_point2hex'; } {Do not localize} - {CH fn_EC_POINT_hex2point = 'EC_POINT_hex2point'; } {Do not localize} - {CH fn_EC_POINT_add = 'EC_POINT_add'; } {Do not localize} - {CH fn_EC_POINT_dbl = 'EC_POINT_dbl'; } {Do not localize} - {CH fn_EC_POINT_invert = 'EC_POINT_invert'; } {Do not localize} - {CH fn_EC_POINT_is_at_infinity = 'EC_POINT_is_at_infinity'; } {Do not localize} - {CH fn_EC_POINT_is_on_curve = 'EC_POINT_is_on_curve'; } {Do not localize} - {CH fn_EC_POINT_cmp = 'EC_POINT_cmp'; } {Do not localize} - {CH fn_EC_POINT_make_affine = 'EC_POINT_make_affine'; } {Do not localize} - {CH fn_EC_POINTs_make_affine = 'EC_POINTs_make_affine'; } {Do not localize} - {CH fn_EC_POINTs_mul = 'EC_POINTs_mul'; } {Do not localize} - {CH fn_EC_POINT_mul = 'EC_POINT_mul'; } {Do not localize} - {CH fn_EC_GROUP_precompute_mult = 'EC_GROUP_precompute_mult'; } {Do not localize} - {CH fn_EC_GROUP_have_precompute_mult = 'EC_GROUP_have_precompute_mult'; } {Do not localize} - {CH fn_EC_GROUP_get_basis_type = 'EC_GROUP_get_basis_type'; } {Do not localize} - {CH fn_EC_GROUP_get_trinomial_basis = 'EC_GROUP_get_trinomial_basis'; } {Do not localize} - {CH fn_EC_GROUP_get_pentanomial_basis = 'EC_GROUP_get_pentanomial_basis'; } {Do not localize} - {CH fn_d2i_ECPKParameters = 'd2i_ECPKParameters'; } {Do not localize} - {CH fn_i2d_ECPKParameters = 'i2d_ECPKParameters'; } {Do not localize} - {$IFNDEF OPENSSL_NO_BIO} - {CH fn_ECPKParameters_print = 'ECPKParameters_print'; } {Do not localize} - {$ENDIF} - {$IFNDEF OPENSSL_NO_FP_API} - {CH fn_ECPKParameters_print_fp = 'ECPKParameters_print_fp'; } {Do not localize} - {$ENDIF} - {CH fn_EC_KEY_new = 'EC_KEY_new'; } {Do not localize} - {CH fn_EC_KEY_new_by_curve_name = 'EC_KEY_new_by_curve_name'; } {Do not localize} - {CH fn_EC_KEY_free = 'EC_KEY_free'; } {Do not localize} - {CH fn_EC_KEY_copy = 'EC_KEY_copy'; } {Do not localize} - {CH fn_EC_KEY_dup = 'EC_KEY_dup'; } {Do not localize} - {CH fn_EC_KEY_up_ref = 'EC_KEY_up_ref'; } {Do not localize} - {CH fn_EC_KEY_get0_group = 'EC_KEY_get0_group'; } {Do not localize} - {CH fn_EC_KEY_set_group = 'EC_KEY_set_group'; } {Do not localize} - {CH fn_EC_KEY_get0_private_key = 'EC_KEY_get0_private_key'; } {Do not localize} - {CH fn_EC_KEY_set_private_key = 'EC_KEY_set_private_key'; } {Do not localize} - {CH fn_EC_KEY_get0_public_key = 'EC_KEY_get0_public_key'; } {Do not localize} - {CH fn_EC_KEY_set_public_key = 'EC_KEY_set_public_key'; } {Do not localize} - {CH fn_EC_KEY_get_enc_flags = 'EC_KEY_get_enc_flags'; } {Do not localize} - {CH fn_EC_KEY_set_enc_flags = 'EC_KEY_set_enc_flags'; } {Do not localize} - {CH fn_EC_KEY_get_conv_form = 'EC_KEY_get_conv_form'; } {Do not localize} - {CH fn_EC_KEY_set_conv_form = 'EC_KEY_set_conv_form'; } {Do not localize} - {CH fn_EC_KEY_get_key_method_data = 'EC_KEY_get_key_method_data'; } {Do not localize} - {CH fn_EC_KEY_insert_key_method_data = 'EC_KEY_insert_key_method_data'; } {Do not localize} - {CH fn_EC_KEY_set_asn1_flag = 'EC_KEY_set_asn1_flag'; } {Do not localize} - {CH fn_EC_KEY_precompute_mult = 'EC_KEY_precompute_mult'; } {Do not localize} - {CH fn_EC_KEY_generate_key = 'EC_KEY_generate_key'; } {Do not localize} - {CH fn_EC_KEY_check_key = 'EC_KEY_check_key'; } {Do not localize} - {CH fn_d2i_ECPrivateKey = 'd2i_ECPrivateKey'; } {Do not localize} - {CH fn_i2d_ECPrivateKey = 'i2d_ECPrivateKey'; } {Do not localize} - {CH fn_d2i_ECParameters = 'd2i_ECParameters'; } {Do not localize} - {CH fn_i2d_ECParameters = 'i2d_ECParameters'; } {Do not localize} - {CH fn_o2i_ECPublicKey = 'o2i_ECPublicKey'; } {Do not localize} - {CH fn_i2o_ECPublicKey = 'i2o_ECPublicKey'; } {Do not localize} - {$IFNDEF OPENSSL_NO_BIO} - {CH fn_ECParameters_print = 'ECParameters_print'; } {Do not localize} - {CH fn_EC_KEY_print = 'EC_KEY_print'; } {Do not localize} - {$ENDIF} - {$IFNDEF OPENSSL_NO_FP_API} - {CH fn_ECParameters_print_fp = 'ECParameters_print_fp'; } {Do not localize} - {CH fn_EC_KEY_print_fp = 'EC_KEY_print_fp'; } {Do not localize} - {$ENDIF} - {$ENDIF} - {$IFNDEF OPENSSL_NO_ECDSA} - {CH fn_ECDSA_SIG_new = 'ECDSA_SIG_new'; } {Do not localize} - {CH fn_ECDSA_SIG_free = 'ECDSA_SIG_free'; } {Do not localize} - {CH fn_i2d_ECDSA_SIG = 'i2d_ECDSA_SIG'; } {Do not localize} - {CH fn_d2i_ECDSA_SIG = 'd2i_ECDSA_SIG'; } {Do not localize} - {CH fn_ECDSA_do_sign = 'ECDSA_do_sign'; } {Do not localize} - {CH fn_ECDSA_do_sign_ex = 'ECDSA_do_sign_ex'; } {Do not localize} - {CH fn_ECDSA_do_verify = 'ECDSA_do_verify'; } {Do not localize} - {CH fn_ECDSA_OpenSSL = 'ECDSA_OpenSSL'; } {Do not localize} - {CH fn_ECDSA_set_default_method = 'ECDSA_set_default_method'; } {Do not localize} - {CH fn_ECDSA_get_default_method = 'ECDSA_get_default_method'; } {Do not localize} - {CH fn_ECDSA_set_method = 'ECDSA_set_method'; } {Do not localize} - {CH fn_ECDSA_size = 'ECDSA_size'; } {Do not localize} - {CH fn_ECDSA_sign_setup = 'ECDSA_sign_setup'; } {Do not localize} - {CH fn_ECDSA_sign = 'ECDSA_sign'; } {Do not localize} - {CH fn_ECDSA_sign_ex = 'ECDSA_sign_ex'; } {Do not localize} - {CH fn_ECDSA_verify = 'ECDSA_verify'; } {Do not localize} - {CH fn_ECDSA_get_ex_new_index = 'ECDSA_get_ex_new_index'; } {Do not localize} - {CH fn_ECDSA_set_ex_data = 'ECDSA_set_ex_data'; } {Do not localize} - {CH fn_ECDSA_get_ex_data = 'ECDSA_get_ex_data'; } {Do not localize} - {CH fn_ERR_load_ECDSA_strings = 'ERR_load_ECDSA_strings'; } {Do not localize} - {$ENDIF} - {$IFNDEF OPENSSL_NO_ECDH} - {CH fn_ECDH_OpenSSL = 'ECDH_OpenSSL'; } {Do not localize} - {CH fn_ECDH_set_default_method = 'ECDH_set_default_method'; } {Do not localize} - {CH fn_ECDH_get_default_method = 'ECDH_get_default_method'; } {Do not localize} - {CH fn_ECDH_set_method = 'ECDH_set_method'; } {Do not localize} - {CH fn_ECDH_compute_key = 'ECDH_compute_key'; } {Do not localize} - {CH fn_ECDH_get_ex_new_index = 'ECDH_get_ex_new_index'; } {Do not localize} - {CH fn_ECDH_set_ex_data = 'ECDH_set_ex_data'; } {Do not localize} - {CH fn_ECDH_get_ex_data = 'ECDH_get_ex_data'; } {Do not localize} - {CH fn_ERR_load_ECDH_strings = 'ERR_load_ECDH_strings'; } {Do not localize} - {$ENDIF} - {CH fn_BN_value_one = 'BN_value_one'; } {Do not localize} - {CH fn_BN_options = 'BN_options'; } {Do not localize} - {CH fn_BN_CTX_new = 'BN_CTX_new'; } {Do not localize} - {$IFNDEF OPENSSL_NO_DEPRECATED} - {CH fn_BN_CTX_init = 'BN_CTX_init'; } {Do not localize} - {$ENDIF} - {CH fn_BN_CTX_free = 'BN_CTX_free'; } {Do not localize} - {CH fn_BN_rand = 'BN_rand'; } {Do not localize} - {CH fn_BN_pseudo_rand = 'BN_pseudo_rand'; } {Do not localize} - {CH fn_BN_rand_range = 'BN_rand_range'; } {Do not localize} - {CH fn_BN_pseudo_rand_range = 'BN_pseudo_rand_range'; } {Do not localize} - {CH fn_BN_num_bits = 'BN_num_bits'; } {Do not localize} - {CH fn_BN_num_bits_word = 'BN_num_bits_word'; } {Do not localize} - fn_BN_new = 'BN_new'; {Do not localize} - {CH fn_BN_init = 'BN_init'; } {Do not localize} - {CH fn_BN_clear_free = 'BN_clear_free'; } {Do not localize} - {CH fn_BN_copy = 'BN_copy'; } {Do not localize} - {CH fn_BN_bin2bn = 'BN_bin2bn'; } {Do not localize} - {CH fn_BN_bn2bin = 'BN_bn2bin'; } {Do not localize} - {CH fn_BN_mpi2bn = 'BN_mpi2bn'; } {Do not localize} - {CH fn_BN_bn2mpi = 'BN_bn2mpi'; } {Do not localize} - {CH fn_BN_sub = 'BN_sub'; } {Do not localize} - {CH fn_BN_usub = 'BN_usub'; } {Do not localize} - {CH fn_BN_uadd = 'BN_uadd'; } {Do not localize} - {CH fn_BN_add = 'BN_add'; } {Do not localize} - {CH fn_BN_mod = 'BN_mod'; } {Do not localize} - {CH fn_BN_div = 'BN_div'; } {Do not localize} - {CH fn_BN_mul = 'BN_mul'; } {Do not localize} - {CH fn_BN_sqr = 'BN_sqr'; } {Do not localize} - {CH fn_BN_mod_word = 'BN_mod_word'; } {Do not localize} - {CH fn_BN_div_word = 'BN_div_word'; } {Do not localize} - {CH fn_BN_mul_word = 'BN_mul_word'; } {Do not localize} - {CH fn_BN_add_word = 'BN_add_word'; } {Do not localize} - {CH fn_BN_sub_word = 'BN_sub_word'; } {Do not localize} - fn_BN_set_word = 'BN_set_word'; {Do not localize} - {CH fn_BN_get_word = 'BN_get_word'; } {Do not localize} - {CH fn_BN_cmp = 'BN_cmp'; } {Do not localize} - fn_BN_free = 'BN_free'; {Do not localize} - {CH fn_BN_is_bit_set = 'BN_is_bit_set'; } {Do not localize} - {CH fn_BN_lshift = 'BN_lshift'; } {Do not localize} - {CH fn_BN_lshift1 = 'BN_lshift1'; } {Do not localize} - {CH fn_BN_exp = 'BN_exp'; } {Do not localize} - {CH fn_BN_mod_exp = 'BN_mod_exp'; } {Do not localize} - {CH fn_BN_mod_exp_mont = 'BN_mod_exp_mont'; } {Do not localize} - {CH fn_BN_mod_exp2_mont = 'BN_mod_exp2_mont'; } {Do not localize} - {CH fn_BN_mod_exp_simple = 'BN_mod_exp_simple'; } {Do not localize} - {CH fn_BN_mask_bits = 'BN_mask_bits'; } {Do not localize} - {CH fn_BN_mod_mul = 'BN_mod_mul'; } {Do not localize} - {$IFNDEF OPENSSL_NO_FP_API} - {CH fn_BN_print_fp = 'BN_print_fp'; } {Do not localize} - {$ENDIF} - {CH fn_BN_print = 'BN_print'; } {Do not localize} - {CH fn_BN_reciprocal = 'BN_reciprocal'; } {Do not localize} - {CH fn_BN_rshift = 'BN_rshift'; } {Do not localize} - {CH fn_BN_rshift1 = 'BN_rshift1'; } {Do not localize} - {CH fn_BN_clear = 'BN_clear'; } {Do not localize} - {CH fn_bn_expand2 = 'bn_expand2'; } {Do not localize} - {CH fn_BN_dup = 'BN_dup'; } {Do not localize} - {CH fn_BN_ucmp = 'BN_ucmp'; } {Do not localize} - {CH fn_BN_set_bit = 'BN_set_bit'; } {Do not localize} - {CH fn_BN_clear_bit = 'BN_clear_bit'; } {Do not localize} - fn_BN_bn2hex = 'BN_bn2hex'; {Do not localize} - fn_BN_bn2dec = 'BN_bn2dec'; {Do not localize} - fn_BN_hex2bn = 'BN_hex2bn'; {Do not localize} - {CH fn_BN_dec2bn = 'BN_dec2bn'; } {Do not localize} - {CH fn_BN_gcd = 'BN_gcd'; } {Do not localize} - {CH fn_BN_mod_inverse = 'BN_mod_inverse'; } {Do not localize} - {$IFNDEF OPENSSL_NO_DEPRECATED} - {CH fn_BN_generate_prime = 'BN_generate_prime'; } {Do not localize} - {CH fn_BN_is_prime = 'BN_is_prime'; } {Do not localize} - {CH fn_BN_is_prime_fasttest = 'BN_is_prime_fasttest'; } {Do not localize} - {$ENDIF} - {CH fn_ERR_load_BN_strings = 'ERR_load_BN_strings'; } {Do not localize} - {CH fn_bn_mul_add_words = 'bn_mul_add_words'; } {Do not localize} - {CH fn_bn_mul_words = 'bn_mul_words'; } {Do not localize} - {CH fn_bn_sqr_words = 'bn_sqr_words'; } {Do not localize} - {CH fn_bn_div_words = 'bn_div_words'; } {Do not localize} - {CH fn_bn_add_words = 'bn_add_words'; } {Do not localize} - {CH fn_bn_sub_words = 'bn_sub_words'; } {Do not localize} - {CH fn_BN_MONT_CTX_new = 'BN_MONT_CTX_new'; } {Do not localize} - {CH fn_BN_MONT_CTX_init = 'BN_MONT_CTX_init'; } {Do not localize} - {CH fn_BN_mod_mul_montgomery = 'BN_mod_mul_montgomery'; } {Do not localize} - {CH fn_BN_from_montgomery = 'BN_from_montgomery'; } {Do not localize} - {CH fn_BN_MONT_CTX_free = 'BN_MONT_CTX_free'; } {Do not localize} - {CH fn_BN_MONT_CTX_set = 'BN_MONT_CTX_set'; } {Do not localize} - {CH fn_BN_MONT_CTX_copy = 'BN_MONT_CTX_copy'; } {Do not localize} - {CH fn_BN_BLINDING_new = 'BN_BLINDING_new'; } {Do not localize} - {CH fn_BN_BLINDING_free = 'BN_BLINDING_free'; } {Do not localize} - {CH fn_BN_BLINDING_update = 'BN_BLINDING_update'; } {Do not localize} - {CH fn_BN_BLINDING_convert = 'BN_BLINDING_convert'; } {Do not localize} - {CH fn_BN_BLINDING_invert = 'BN_BLINDING_invert'; } {Do not localize} - {$IFNDEF OPENSSL_NO_DEPRECATED} - {CH fn_BN_set_params = 'BN_set_params'; } {Do not localize} - {CH fn_BN_get_params = 'BN_get_params'; } {Do not localize} - {$ENDIF} - {CH fn_BN_RECP_CTX_init = 'BN_RECP_CTX_init'; } {Do not localize} - {CH fn_BN_RECP_CTX_new = 'BN_RECP_CTX_new'; } {Do not localize} - {CH fn_BN_RECP_CTX_free = 'BN_RECP_CTX_free'; } {Do not localize} - {CH fn_BN_RECP_CTX_set = 'BN_RECP_CTX_set'; } {Do not localize} - {CH fn_BN_mod_mul_reciprocal = 'BN_mod_mul_reciprocal'; } {Do not localize} - {CH fn_BN_mod_exp_recp = 'BN_mod_exp_recp'; } {Do not localize} - - {CH fn_BN_div_recp = 'BN_div_recp'; } {Do not localize} - {CH fn_BN_GF2m_add = 'BN_GF2m_add'; } {Do not localize} - {CH fn_BN_GF2m_mod = 'BN_GF2m_mod'; } {Do not localize} - {CH fn_BN_GF2m_mod_mul = 'BN_GF2m_mod_mul'; } {Do not localize} - {CH fn_BN_GF2m_mod_sqr = 'BN_GF2m_mod_sqr'; } {Do not localize} - {CH fn_BN_GF2m_mod_inv = 'BN_GF2m_mod_inv'; } {Do not localize} - {CH fn_BN_GF2m_mod_div = 'BN_GF2m_mod_div'; } {Do not localize} - {CH fn_BN_GF2m_mod_exp = 'BN_GF2m_mod_exp'; } {Do not localize} - {CH fn_BN_GF2m_mod_sqrt = 'BN_GF2m_mod_sqrt'; } {Do not localize} - {CH fn_BN_GF2m_mod_solve_quad = 'BN_GF2m_mod_solve_quad'; } {Do not localize} - {CH fn_BN_GF2m_mod_arr = 'BN_GF2m_mod_arr'; } {Do not localize} - {CH fn_BN_GF2m_mod_mul_arr = 'BN_GF2m_mod_mul_arr'; } {Do not localize} - {CH fn_BN_GF2m_mod_sqr_arr = 'BN_GF2m_mod_sqr_arr'; } {Do not localize} - {CH fn_BN_GF2m_mod_inv_arr = 'BN_GF2m_mod_inv_arr'; } {Do not localize} - {CH fn_BN_GF2m_mod_div_arr = 'BN_GF2m_mod_div_arr'; } {Do not localize} - {CH fn_BN_GF2m_mod_exp_arr = 'BN_GF2m_mod_exp_arr'; } {Do not localize} - {CH fn_BN_GF2m_mod_sqrt_arr = 'BN_GF2m_mod_sqrt_arr'; } {Do not localize} - {CH fn_BN_GF2m_mod_solve_quad_arr = 'BN_GF2m_mod_solve_quad_arr'; } {Do not localize} - {CH fn_BN_GF2m_poly2arr = 'BN_GF2m_poly2arr'; } {Do not localize} - {CH fn_BN_GF2m_arr2poly = 'BN_GF2m_arr2poly'; } {Do not localize} - // faster mod functions for the 'NIST primes' - // 0 <= a < p^2 - {CH fn_BN_nist_mod_192 = 'BN_nist_mod_192'; } {Do not localize} - {CH fn_BN_nist_mod_224 = 'BN_nist_mod_224'; } {Do not localize} - {CH fn_BN_nist_mod_256 = 'BN_nist_mod_256'; } {Do not localize} - {CH fn_BN_nist_mod_384 = 'BN_nist_mod_384'; } {Do not localize} - {CH fn_BN_nist_mod_521 = 'BN_nist_mod_521'; } {Do not localize} - {CH fn_BN_get0_nist_prime_192 = 'BN_get0_nist_prime_192'; } {Do not localize} - {CH fn_BN_get0_nist_prime_224 = 'BN_get0_nist_prime_224'; } {Do not localize} - {CH fn_BN_get0_nist_prime_256 = 'BN_get0_nist_prime_256'; } {Do not localize} - {CH fn_BN_get0_nist_prime_384 = 'BN_get0_nist_prime_384'; } {Do not localize} - {CH fn_BN_get0_nist_prime_521 = 'BN_get0_nist_prime_521'; } {Do not localize} - // - {CH fn_get_rfc2409_prime_768 = 'get_rfc2409_prime_768'; } {Do not localize} - {CH fn_get_rfc2409_prime_1024 = 'get_rfc2409_prime_1024'; } {Do not localize} - {CH fn_get_rfc3526_prime_1536 = 'get_rfc3526_prime_1536'; } {Do not localize} - {CH fn_get_rfc3526_prime_2048 = 'get_rfc3526_prime_2048'; } {Do not localize} - {CH fn_get_rfc3526_prime_3072 = 'get_rfc3526_prime_3072'; } {Do not localize} - {CH fn_get_rfc3526_prime_4096 = 'get_rfc3526_prime_4096'; } {Do not localize} - {CH fn_get_rfc3526_prime_6144 = 'get_rfc3526_prime_6144'; } {Do not localize} - {CH fn_get_rfc3526_prime_8192 = 'get_rfc3526_prime_8192'; } {Do not localize} - {CH fn_BN_bntest_rand = 'BN_bntest_rand'; } {Do not localize} - {CH fn_sk_ASN1_TYPE_new = 'sk_ASN1_TYPE_new'; } {Do not localize} - {CH fn_sk_ASN1_TYPE_new_null = 'sk_ASN1_TYPE_new_null'; } {Do not localize} - {CH fn_sk_ASN1_TYPE_free = 'sk_ASN1_TYPE_free'; } {Do not localize} - {CH fn_sk_ASN1_TYPE_num = 'sk_ASN1_TYPE_num'; } {Do not localize} - {CH fn_sk_ASN1_TYPE_value = 'sk_ASN1_TYPE_value'; } {Do not localize} - {CH fn_sk_ASN1_TYPE_set = 'sk_ASN1_TYPE_set'; } {Do not localize} - {CH fn_ASN1_TYPE_set1 = 'ASN1_TYPE_set1'; } {Do not localize} - {CH fn_sk_ASN1_TYPE_zero = 'sk_ASN1_TYPE_zero'; } {Do not localize} - {CH fn_sk_ASN1_TYPE_push = 'sk_ASN1_TYPE_push'; } {Do not localize} - {CH fn_sk_ASN1_TYPE_unshift = 'sk_ASN1_TYPE_unshift'; } {Do not localize} - {CH fn_sk_ASN1_TYPE_find = 'sk_ASN1_TYPE_find'; } {Do not localize} - {CH fn_sk_ASN1_TYPE_delete = 'sk_ASN1_TYPE_delete'; } {Do not localize} - {CH fn_sk_ASN1_TYPE_delete_ptr = 'sk_ASN1_TYPE_delete_ptr'; } {Do not localize} - {CH fn_sk_ASN1_TYPE_insert = 'sk_ASN1_TYPE_insert'; } {Do not localize} - {CH fn_sk_ASN1_TYPE_dup = 'sk_ASN1_TYPE_dup'; } {Do not localize} - {CH fn_sk_ASN1_TYPE_pop_free = 'sk_ASN1_TYPE_pop_free'; } {Do not localize} - {CH fn_sk_ASN1_TYPE_shift = 'sk_ASN1_TYPE_shift'; } {Do not localize} - {CH fn_sk_ASN1_TYPE_pop = 'sk_ASN1_TYPE_pop'; } {Do not localize} - {CH fn_sk_ASN1_TYPE_sort = 'sk_ASN1_TYPE_sort'; } {Do not localize} - {CH fn_i2d_ASN1_SET_OF_ASN1_TYPE = 'i2d_ASN1_SET_OF_ASN1_TYPE'; } {Do not localize} - {CH fn_d2i_ASN1_SET_OF_ASN1_TYPE = 'd2i_ASN1_SET_OF_ASN1_TYPE'; } {Do not localize} - {CH fn_ASN1_TYPE_new = 'ASN1_TYPE_new'; } {Do not localize} - {CH fn_ASN1_TYPE_free = 'ASN1_TYPE_free'; } {Do not localize} - {CH fn_i2d_ASN1_TYPE = 'i2d_ASN1_TYPE'; } {Do not localize} - {CH fn_d2i_ASN1_TYPE = 'd2i_ASN1_TYPE'; } {Do not localize} - {CH fn_ASN1_TYPE_get = 'ASN1_TYPE_get'; } {Do not localize} - {CH fn_ASN1_TYPE_set = 'ASN1_TYPE_set'; } {Do not localize} - {CH fn_ASN1_TYPE_set1 = 'ASN1_TYPE_set1'; } {Do not localize} - {CH fn_ASN1_OBJECT_new = 'ASN1_OBJECT_new'; } {Do not localize} - {CH fn_ASN1_OBJECT_free = 'ASN1_OBJECT_free'; } {Do not localize} - {CH fn_i2d_ASN1_OBJECT = 'i2d_ASN1_OBJECT'; } {Do not localize} - {CH fn_d2i_ASN1_OBJECT = 'd2i_ASN1_OBJECT'; } {Do not localize} - {CH fn_sk_ASN1_OBJECT_new = 'sk_ASN1_OBJECT_new'; } {Do not localize} - {CH fn_sk_ASN1_OBJECT_new_null = 'sk_ASN1_OBJECT_new_null'; } {Do not localize} - {CH fn_sk_ASN1_OBJECT_free = 'sk_ASN1_OBJECT_free'; } {Do not localize} - {CH fn_sk_ASN1_OBJECT_num = 'sk_ASN1_OBJECT_num'; } {Do not localize} - {CH fn_sk_ASN1_OBJECT_value = 'sk_ASN1_OBJECT_value'; } {Do not localize} - {CH fn_sk_ASN1_OBJECT_set = 'sk_ASN1_OBJECT_set'; } {Do not localize} - {CH fn_sk_ASN1_OBJECT_zero = 'sk_ASN1_OBJECT_zero'; } {Do not localize} - {CH fn_sk_ASN1_OBJECT_push = 'sk_ASN1_OBJECT_push'; } {Do not localize} - {CH fn_sk_ASN1_OBJECT_unshift = 'sk_ASN1_OBJECT_unshift'; } {Do not localize} - {CH fn_sk_ASN1_OBJECT_find = 'sk_ASN1_OBJECT_find'; } {Do not localize} - {CH fn_sk_ASN1_OBJECT_delete = 'sk_ASN1_OBJECT_delete'; } {Do not localize} - {CH fn_sk_ASN1_OBJECT_delete_ptr = 'sk_ASN1_OBJECT_delete_ptr'; } {Do not localize} - {CH fn_sk_ASN1_OBJECT_insert = 'sk_ASN1_OBJECT_insert'; } {Do not localize} - {CH fn_sk_ASN1_OBJECT_dup = 'sk_ASN1_OBJECT_dup'; } {Do not localize} - {CH fn_sk_ASN1_OBJECT_pop_free = 'sk_ASN1_OBJECT_pop_free'; } {Do not localize} - {CH fn_sk_ASN1_OBJECT_shift = 'sk_ASN1_OBJECT_shift'; } {Do not localize} - {CH fn_sk_ASN1_OBJECT_pop = 'sk_ASN1_OBJECT_pop'; } {Do not localize} - {CH fn_sk_ASN1_OBJECT_sort = 'sk_ASN1_OBJECT_sort'; } {Do not localize} - {CH fn_i2d_ASN1_SET_OF_ASN1_OBJECT = 'i2d_ASN1_SET_OF_ASN1_OBJECT'; } {Do not localize} - {CH fn_d2i_ASN1_SET_OF_ASN1_OBJECT = 'd2i_ASN1_SET_OF_ASN1_OBJECT'; } {Do not localize} - {CH fn_ASN1_STRING_new = 'ASN1_STRING_new'; } {Do not localize} - fn_ASN1_STRING_free = 'ASN1_STRING_free'; {Do not localize} - {CH fn_ASN1_STRING_dup = 'ASN1_STRING_dup'; } {Do not localize} - fn_ASN1_STRING_type_new = 'ASN1_STRING_type_new'; {Do not localize} - {CH fn_ASN1_STRING_cmp = 'ASN1_STRING_cmp'; } {Do not localize} - {CH fn_ASN1_STRING_set = 'ASN1_STRING_set'; } {Do not localize} - {CH fn_ASN1_STRING_set0 = 'ASN1_STRING_set0'; } {Do not localize} - {CH fn_i2d_ASN1_BIT_STRING = 'i2d_ASN1_BIT_STRING'; } {Do not localize} - {CH fn_d2i_ASN1_BIT_STRING = 'd2i_ASN1_BIT_STRING'; } {Do not localize} - {CH fn_ASN1_BIT_STRING_set_bit = 'ASN1_BIT_STRING_set_bit'; } {Do not localize} - {CH fn_ASN1_BIT_STRING_get_bit = 'ASN1_BIT_STRING_get_bit'; } {Do not localize} - {CH fn_i2d_ASN1_BOOLEAN = 'i2d_ASN1_BOOLEAN'; } {Do not localize} - {CH fn_d2i_ASN1_BOOLEAN = 'd2i_ASN1_BOOLEAN'; } {Do not localize} - {CH fn_i2d_ASN1_INTEGER = 'i2d_ASN1_INTEGER'; } {Do not localize} - {CH fn_d2i_ASN1_INTEGER = 'd2i_ASN1_INTEGER'; } {Do not localize} - {CH fn_d2i_ASN1_UINTEGER = 'd2i_ASN1_UINTEGER'; } {Do not localize} - {CH fn_i2d_ASN1_ENUMERATED = 'i2d_ASN1_ENUMERATED'; } {Do not localize} - {CH fn_d2i_ASN1_ENUMERATED = 'd2i_ASN1_ENUMERATED'; } {Do not localize} - {CH fn_ASN1_UTCTIME_check = 'ASN1_UTCTIME_check'; } {Do not localize} - {CH fn_ASN1_UTCTIME_set = 'ASN1_UTCTIME_set'; } {Do not localize} - {CH fn_ASN1_UTCTIME_set_string = 'ASN1_UTCTIME_set_string'; } {Do not localize} - {CH fn_ASN1_GENERALIZEDTIME_check = 'ASN1_GENERALIZEDTIME_check'; } {Do not localize} - {CH fn_ASN1_GENERALIZEDTIME_set = 'ASN1_GENERALIZEDTIME_set'; } {Do not localize} - {CH fn_ASN1_GENERALIZEDTIME_set_string = 'ASN1_GENERALIZEDTIME_set_string'; } {Do not localize} - {CH fn_i2d_ASN1_OCTET_STRING = 'i2d_ASN1_OCTET_STRING'; } {Do not localize} - {CH fn_d2i_ASN1_OCTET_STRING = 'd2i_ASN1_OCTET_STRING'; } {Do not localize} - {CH fn_i2d_ASN1_VISIBLESTRING = 'i2d_ASN1_VISIBLESTRING'; } {Do not localize} - {CH fn_d2i_ASN1_VISIBLESTRING = 'd2i_ASN1_VISIBLESTRING'; } {Do not localize} - {CH fn_i2d_ASN1_UTF8STRING = 'i2d_ASN1_UTF8STRING'; } {Do not localize} - {CH fn_d2i_ASN1_UTF8STRING = 'd2i_ASN1_UTF8STRING'; } {Do not localize} - {CH fn_i2d_ASN1_BMPSTRING = 'i2d_ASN1_BMPSTRING'; } {Do not localize} - {CH fn_d2i_ASN1_BMPSTRING = 'd2i_ASN1_BMPSTRING'; } {Do not localize} - {CH fn_i2d_ASN1_PRINTABLE = 'i2d_ASN1_PRINTABLE'; } {Do not localize} - {CH fn_d2i_ASN1_PRINTABLE = 'd2i_ASN1_PRINTABLE'; } {Do not localize} - {CH fn_d2i_ASN1_PRINTABLESTRING = 'd2i_ASN1_PRINTABLESTRING'; } {Do not localize} - {CH fn_i2d_DIRECTORYSTRING = 'i2d_DIRECTORYSTRING'; } {Do not localize} - {CH fn_d2i_DIRECTORYSTRING = 'd2i_DIRECTORYSTRING'; } {Do not localize} - {CH fn_i2d_DISPLAYTEXT = 'i2d_DISPLAYTEXT'; } {Do not localize} - {CH fn_d2i_DISPLAYTEXT = 'd2i_DISPLAYTEXT'; } {Do not localize} - {CH fn_d2i_ASN1_T61STRING = 'd2i_ASN1_T61STRING'; } {Do not localize} - {CH fn_i2d_ASN1_IA5STRING = 'i2d_ASN1_IA5STRING'; } {Do not localize} - {CH fn_d2i_ASN1_IA5STRING = 'd2i_ASN1_IA5STRING'; } {Do not localize} - {CH fn_i2d_ASN1_UTCTIME = 'i2d_ASN1_UTCTIME'; } {Do not localize} - {CH fn_d2i_ASN1_UTCTIME = 'd2i_ASN1_UTCTIME'; } {Do not localize} - {CH fn_i2d_ASN1_GENERALIZEDTIME = 'i2d_ASN1_GENERALIZEDTIME'; } {Do not localize} - {CH fn_d2i_ASN1_GENERALIZEDTIME = 'd2i_ASN1_GENERALIZEDTIME'; } {Do not localize} - {CH fn_i2d_ASN1_TIME = 'i2d_ASN1_TIME'; } {Do not localize} - {CH fn_d2i_ASN1_TIME = 'd2i_ASN1_TIME'; } {Do not localize} - {CH fn_ASN1_TIME_set = 'ASN1_TIME_set'; } {Do not localize} - {CH fn_i2d_ASN1_SET = 'i2d_ASN1_SET'; } {Do not localize} - {CH fn_d2i_ASN1_SET = 'd2i_ASN1_SET'; } {Do not localize} - {$IFNDEF OPENSSL_NO_BIO} - {CH fn_i2a_ASN1_INTEGER = 'i2a_ASN1_INTEGER'; } {Do not localize} - {CH fn_a2i_ASN1_INTEGER = 'a2i_ASN1_INTEGER'; } {Do not localize} - {CH fn_i2a_ASN1_ENUMERATED = 'i2a_ASN1_ENUMERATED'; } {Do not localize} - {CH fn_a2i_ASN1_ENUMERATED = 'a2i_ASN1_ENUMERATED'; } {Do not localize} - {CH fn_i2a_ASN1_OBJECT = 'i2a_ASN1_OBJECT'; } {Do not localize} - {CH fn_a2i_ASN1_STRING = 'a2i_ASN1_STRING'; } {Do not localize} - {CH fn_i2a_ASN1_STRING = 'i2a_ASN1_STRING'; } {Do not localize} - {$ENDIF} - {CH fn_i2t_ASN1_OBJECT = 'i2t_ASN1_OBJECT'; } {Do not localize} - {CH fn_a2d_ASN1_OBJECT = 'a2d_ASN1_OBJECT'; } {Do not localize} - {CH fn_ASN1_OBJECT_create = 'ASN1_OBJECT_create'; } {Do not localize} - fn_ASN1_INTEGER_set = 'ASN1_INTEGER_set'; {Do not localize} - fn_ASN1_INTEGER_get = 'ASN1_INTEGER_get'; {Do not localize} - {CH fn_BN_to_ASN1_INTEGER = 'BN_to_ASN1_INTEGER'; } {Do not localize} - fn_ASN1_INTEGER_to_BN = 'ASN1_INTEGER_to_BN'; {Do not localize} - {CH fn_ASN1_ENUMERATED_set = 'ASN1_ENUMERATED_set'; } {Do not localize} - {CH fn_ASN1_ENUMERATED_get = 'ASN1_ENUMERATED_get'; } {Do not localize} - {CH fn_BN_to_ASN1_ENUMERATED = 'BN_to_ASN1_ENUMERATED'; } {Do not localize} - {CH fn_ASN1_ENUMERATED_to_BN = 'ASN1_ENUMERATED_to_BN'; } {Do not localize} - {CH fn_ASN1_PRINTABLE_type = 'ASN1_PRINTABLE_type'; } {Do not localize} - {CH fn_i2d_ASN1_bytes = 'i2d_ASN1_bytes'; } {Do not localize} - {CH fn_d2i_ASN1_bytes = 'd2i_ASN1_bytes'; } {Do not localize} - {CH fn_d2i_ASN1_type_bytes = 'd2i_ASN1_type_bytes'; } {Do not localize} - {CH fn_asn1_Finish = 'asn1_Finish'; } {Do not localize} - {CH fn_ASN1_get_object = 'ASN1_get_object'; } {Do not localize} - {CH fn_ASN1_check_infinite_end = 'ASN1_check_infinite_end'; } {Do not localize} - {CH fn_ASN1_put_object = 'ASN1_put_object'; } {Do not localize} - {CH fn_ASN1_object_size = 'ASN1_object_size'; } {Do not localize} - fn_ASN1_dup = 'ASN1_dup'; {Do not localize} - {$IFNDEF OPENSSL_NO_FP_API} - {CH fn_ASN1_d2i_fp = 'ASN1_d2i_fp'; } {Do not localize} - {CH fn_ASN1_i2d_fp = 'ASN1_i2d_fp'; } {Do not localize} - {$ENDIF} - {$IFNDEF OPENSSL_NO_BIO} - {CH fn_ASN1_d2i_bio = 'ASN1_d2i_bio'; } {Do not localize} - {CH fn_ASN1_item_d2i_bio = 'ASN1_item_d2i_bio'; } {Do not localize} - {CH fn_ASN1_i2d_bio = 'ASN1_i2d_bio'; } {Do not localize} - {CH fn_ASN1_item_i2d_bio = 'ASN1_item_i2d_bio'; } {Do not localize} - {CH fn_ASN1_UTCTIME_print = 'ASN1_UTCTIME_print'; } {Do not localize} - {CH fn_ASN1_GENERALIZEDTIME_print = 'ASN1_GENERALIZEDTIME_print'; } {Do not localize} - {CH fn_ASN1_TIME_print = 'ASN1_TIME_print'; } {Do not localize} - {CH fn_ASN1_STRING_print = 'ASN1_STRING_print'; } {Do not localize} - {CH fn_ASN1_STRING_print_ex = 'ASN1_STRING_print_ex'; } {Do not localize} - {CH fn_ASN1_parse = 'ASN1_parse'; } {Do not localize} - {CH fn_ASN1_parse_dump = 'ASN1_parse_dump'; } {Do not localize} - {$ENDIF} - {CH fn_ASN1_tag2str = 'ASN1_tag2str'; } {Do not localize} - {CH fn_i2d_ASN1_HEADER = 'i2d_ASN1_HEADER'; } {Do not localize} - {CH fn_d2i_ASN1_HEADER = 'd2i_ASN1_HEADER'; } {Do not localize} - {CH fn_ASN1_HEADER_new = 'ASN1_HEADER_new'; } {Do not localize} - {CH fn_ASN1_HEADER_free = 'ASN1_HEADER_free'; } {Do not localize} - {CH fn_ASN1_UNIVERSALSTRING_to_string = 'ASN1_UNIVERSALSTRING_to_string'; } {Do not localize} - {CH fn_ERR_load_ASN1_strings = 'ERR_load_ASN1_strings'; } {Do not localize} - {CH fn_X509_asn1_meth = 'X509_asn1_meth'; } {Do not localize} - {CH fn_RSAPrivateKey_asn1_meth = 'RSAPrivateKey_asn1_meth'; } {Do not localize} - {CH fn_ASN1_IA5STRING_asn1_meth = 'ASN1_IA5STRING_asn1_meth'; } {Do not localize} - {CH fn_ASN1_BIT_STRING_asn1_meth = 'ASN1_BIT_STRING_asn1_meth'; } {Do not localize} - {CH fn_ASN1_TYPE_set_octetstring = 'ASN1_TYPE_set_octetstring'; } {Do not localize} - {CH fn_ASN1_TYPE_get_octetstring = 'ASN1_TYPE_get_octetstring'; } {Do not localize} - {CH fn_ASN1_TYPE_set_int_octetstring = 'ASN1_TYPE_set_int_octetstring'; } {Do not localize} - {CH fn_ASN1_TYPE_get_int_octetstring = 'ASN1_TYPE_get_int_octetstring'; } {Do not localize} - {CH fn_ASN1_seq_unpack = 'ASN1_seq_unpack'; } {Do not localize} - {CH fn_ASN1_seq_pack = 'ASN1_seq_pack'; } {Do not localize} - {CH fn_ASN1_unpack_string = 'ASN1_unpack_string'; } {Do not localize} - {CH fn_ASN1_pack_string = 'ASN1_pack_string'; } {Do not localize} - {CH fn_ASN1_item_unpack = 'ASN1_item_unpack'; } {Do not localize} - {CH fn_ASN1_item_pack = 'ASN1_item_pack'; } {Do not localize} - {CH fn_ASN1_STRING_set_default_mask = 'ASN1_STRING_set_default_mask'; } {Do not localize} - {CH fn_ASN1_STRING_set_default_mask_asc = 'ASN1_STRING_set_default_mask_asc'; } {Do not localize} - {CH fn_ASN1_STRING_get_default_mask = 'ASN1_STRING_get_default_mask'; } {Do not localize} - {CH fn_ASN1_mbstring_copy = 'ASN1_mbstring_copy'; } {Do not localize} - {CH fn_ASN1_mbstring_ncopy = 'ASN1_mbstring_ncopy'; } {Do not localize} - {CH fn_ASN1_STRING_set_by_NID = 'ASN1_STRING_set_by_NID'; } {Do not localize} - {CH fn_ASN1_STRING_TABLE_get = 'ASN1_STRING_TABLE_get'; } {Do not localize} - {CH fn_ASN1_STRING_TABLE_add = 'ASN1_STRING_TABLE_add'; } {Do not localize} - {CH fn_ASN1_STRING_TABLE_cleanup = 'ASN1_STRING_TABLE_cleanup'; } {Do not localize} - {CH fn_ASN1_item_new = 'ASN1_item_new'; } {Do not localize} - {CH fn_ASN1_item_free = 'ASN1_item_free'; } {Do not localize} - {CH fn_ASN1_item_d2i = 'ASN1_item_d2i'; } {Do not localize} - {CH fn_ASN1_item_i2d = 'ASN1_item_i2d'; } {Do not localize} - {CH fn_ASN1_item_ndef_i2d = 'ASN1_item_ndef_i2d'; } {Do not localize} - {CH fn_ASN1_add_oid_module = 'ASN1_add_oid_module'; } {Do not localize} - {CH fn_ASN1_generate_nconf = 'ASN1_generate_nconf'; } {Do not localize} - {CH fn_ASN1_generate_v3 = 'ASN1_generate_v3'; } {Do not localize} - {CH fn_int_smime_write_ASN1 = 'int_smime_write_ASN1'; } {Do not localize} - {CH fn_SMIME_read_ASN1 = 'SMIME_read_ASN1'; } {Do not localize} - {CH fn_OBJ_NAME_init = 'OBJ_NAME_init'; } {Do not localize} - {CH fn_OBJ_NAME_new_index = 'OBJ_NAME_new_index'; } {Do not localize} - {CH fn_OBJ_NAME_get = 'OBJ_NAME_get'; } {Do not localize} - {CH fn_OBJ_NAME_add = 'OBJ_NAME_add'; } {Do not localize} - {CH fn_OBJ_NAME_remove = 'OBJ_NAME_remove'; } {Do not localize} - {CH fn_OBJ_NAME_cleanup = 'OBJ_NAME_cleanup'; } {Do not localize} - {CH fn_OBJ_dup = 'OBJ_dup'; } {Do not localize} - fn_OBJ_nid2obj = 'OBJ_nid2obj'; {Do not localize} - fn_OBJ_nid2ln = 'OBJ_nid2ln'; {Do not localize} - fn_OBJ_nid2sn = 'OBJ_nid2sn'; {Do not localize} - fn_OBJ_obj2nid = 'OBJ_obj2nid'; {Do not localize} - {CH fn_OBJ_txt2obj = 'OBJ_txt2obj'; } {Do not localize} - {CH fn_OBJ_obj2txt = 'OBJ_obj2txt'; } {Do not localize} - {CH fn_OBJ_txt2nid = 'OBJ_txt2nid'; } {Do not localize} - {CH fn_OBJ_ln2nid = 'OBJ_ln2nid'; } {Do not localize} - {CH fn_OBJ_sn2nid = 'OBJ_sn2nid'; } {Do not localize} - {CH fn_OBJ_cmp = 'OBJ_cmp'; } {Do not localize} - {CH fn_OBJ_bsearch = 'OBJ_bsearch'; } {Do not localize} - {CH fn_ERR_load_OBJ_strings = 'ERR_load_OBJ_strings'; } {Do not localize} - {CH fn_OBJ_new_nid = 'OBJ_new_nid'; } {Do not localize} - {CH fn_OBJ_add_object = 'OBJ_add_object'; } {Do not localize} - {CH fn_OBJ_create = 'OBJ_create'; } {Do not localize} - {CH fn_OBJ_cleanup = 'OBJ_cleanup'; } {Do not localize} - {CH fn_OBJ_create_objects = 'OBJ_create_objects'; } {Do not localize} - {===} - fn_EVP_MD_type = 'EVP_MD_type'; {Do not localize} - fn_EVP_MD_pkey_type = 'EVP_MD_pkey_type'; {Do not localize} - fn_EVP_MD_size = 'EVP_MD_size'; {Do not localize} - fn_EVP_MD_block_size = 'EVP_MD_block_size'; {Do not localize} - fn_EVP_MD_flags = 'EVP_MD_flags'; {Do not localize} - fn_EVP_MD_CTX_md = 'EVP_MD_CTX_md'; {Do not localize} - fn_EVP_CIPHER_nid = 'EVP_CIPHER_nid'; {Do not localize} - fn_EVP_CIPHER_block_size = 'EVP_CIPHER_block_size'; {Do not localize} - fn_EVP_CIPHER_key_length = 'EVP_CIPHER_key_length'; {Do not localize} - fn_EVP_CIPHER_iv_length = 'EVP_CIPHER_iv_length'; {Do not localize} - fn_EVP_CIPHER_flags = 'EVP_CIPHER_flags'; {Do not localize} - fn_EVP_CIPHER_CTX_cipher = 'EVP_CIPHER_CTX_cipher'; {Do not localize} - fn_EVP_CIPHER_CTX_nid = 'EVP_CIPHER_CTX_nid'; {Do not localize} - fn_EVP_CIPHER_CTX_block_size = 'EVP_CIPHER_CTX_block_size'; {Do not localize} - fn_EVP_CIPHER_CTX_key_length = 'EVP_CIPHER_CTX_key_length'; {Do not localize} - fn_EVP_CIPHER_CTX_iv_length = 'EVP_CIPHER_CTX_iv_length'; {Do not localize} - fn_EVP_CIPHER_CTX_get_app_data = 'EVP_CIPHER_CTX_get_app_data'; {Do not localize} - fn_EVP_CIPHER_CTX_set_app_data = 'EVP_CIPHER_CTX_set_app_data'; {Do not localize} - fn_EVP_CIPHER_CTX_flags = 'EVP_CIPHER_CTX_flags'; {Do not localize} - fn_EVP_Cipher = 'EVP_Cipher'; {Do not localize} - fn_EVP_MD_CTX_init = 'EVP_MD_CTX_init'; {Do not localize} - fn_EVP_MD_CTX_cleanup = 'EVP_MD_CTX_cleanup'; {Do not localize} - fn_EVP_MD_CTX_create = 'EVP_MD_CTX_create'; {Do not localize} - fn_EVP_MD_CTX_destroy = 'EVP_MD_CTX_destroy'; {Do not localize} - fn_EVP_MD_CTX_copy_ex = 'EVP_MD_CTX_copy_ex'; {Do not localize} - fn_EVP_MD_CTX_set_flags = 'EVP_MD_CTX_set_flags'; {Do not localize} - fn_EVP_MD_CTX_clear_flags = 'EVP_MD_CTX_clear_flags'; {Do not localize} - fn_EVP_MD_CTX_test_flags = 'EVP_MD_CTX_test_flags'; {Do not localize} - fn_EVP_DigestInit_ex = 'EVP_DigestInit_ex'; {Do not localize} - fn_EVP_DigestUpdate = 'EVP_DigestUpdate'; {Do not localize} - fn_EVP_DigestFinal_ex = 'EVP_DigestFinal_ex'; {Do not localize} - fn_EVP_Digest = 'EVP_Digest'; {Do not localize} - fn_EVP_MD_CTX_copy = 'EVP_MD_CTX_copy'; {Do not localize} - fn_EVP_DigestInit = 'EVP_DigestInit'; {Do not localize} - fn_EVP_DigestFinal = 'EVP_DigestFinal'; {Do not localize} - fn_EVP_read_pw_string = 'EVP_read_pw_string'; {Do not localize} - fn_EVP_set_pw_prompt = 'EVP_set_pw_prompt'; {Do not localize} - fn_EVP_get_pw_prompt = 'EVP_get_pw_prompt'; {Do not localize} - fn_EVP_BytesToKey = 'EVP_BytesToKey'; {Do not localize} - fn_EVP_CIPHER_CTX_set_flags = 'EVP_CIPHER_CTX_set_flags'; {Do not localize} - fn_EVP_CIPHER_CTX_clear_flags = 'EVP_CIPHER_CTX_clear_flags'; {Do not localize} - fn_EVP_CIPHER_CTX_test_flags = 'EVP_CIPHER_CTX_test_flags'; {Do not localize} - fn_EVP_EncryptInit = 'EVP_EncryptInit'; {Do not localize} - fn_EVP_EncryptInit_ex = 'EVP_EncryptInit_ex'; {Do not localize} - fn_EVP_EncryptUpdate = 'EVP_EncryptUpdate'; {Do not localize} - fn_EVP_EncryptFinal = 'EVP_EncryptFinal'; {Do not localize} - fn_EVP_EncryptFinal_ex = 'EVP_EncryptFinal_ex'; {Do not localize} - fn_EVP_DecryptInit = 'EVP_DecryptInit'; {Do not localize} - fn_EVP_DecryptInit_ex = 'EVP_DecryptInit_ex'; {Do not localize} - fn_EVP_DecryptUpdate = 'EVP_DecryptUpdate'; {Do not localize} - fn_EVP_DecryptFinal = 'EVP_DecryptFinal'; {Do not localize} - fn_EVP_DecryptFinal_ex = 'EVP_DecryptFinal_ex'; {Do not localize} - fn_EVP_CipherInit = 'EVP_CipherInit'; {Do not localize} - fn_EVP_CipherInit_ex = 'EVP_CipherInit_ex'; {Do not localize} - fn_EVP_CipherUpdate = 'EVP_CipherUpdate'; {Do not localize} - fn_EVP_CipherFinal = 'EVP_CipherFinal'; {Do not localize} - fn_EVP_CipherFinal_ex = 'EVP_CipherFinal_ex'; {Do not localize} - - fn_EVP_DigestSignInit = 'EVP_DigestSignInit'; {Do not localize} - fn_EVP_DigestSignFinal = 'EVP_DigestSignFinal'; {Do not localize} - fn_EVP_DigestVerifyInit = 'EVP_DigestVerifyInit'; {Do not localize} - fn_EVP_DigestVerifyFinal = 'EVP_DigestVerifyFinal'; {Do not localize} - - fn_EVP_SignFinal = 'EVP_SignFinal'; {Do not localize} - fn_EVP_VerifyFinal = 'EVP_VerifyFinal'; {Do not localize} - fn_EVP_OpenInit = 'EVP_OpenInit'; {Do not localize} - fn_EVP_OpenFinal = 'EVP_OpenFinal'; {Do not localize} - fn_EVP_SealInit = 'EVP_SealInit'; {Do not localize} - fn_EVP_SealFinal = 'EVP_SealFinal'; {Do not localize} - fn_EVP_EncodeInit = 'EVP_EncodeInit'; {Do not localize} - fn_EVP_EncodeUpdate = 'EVP_EncodeUpdate'; {Do not localize} - fn_EVP_EncodeFinal = 'EVP_EncodeFinal'; {Do not localize} - fn_EVP_EncodeBlock = 'EVP_EncodeBlock'; {Do not localize} - fn_EVP_DecodeInit = 'EVP_DecodeInit'; {Do not localize} - fn_EVP_DecodeUpdate = 'EVP_DecodeUpdate'; {Do not localize} - fn_EVP_DecodeFinal = 'EVP_DecodeFinal'; {Do not localize} - fn_EVP_DecodeBlock = 'EVP_DecodeBlock'; {Do not localize} - fn_EVP_CIPHER_CTX_init = 'EVP_CIPHER_CTX_init'; {Do not localize} - fn_EVP_CIPHER_CTX_cleanup = 'EVP_CIPHER_CTX_cleanup'; {Do not localize} - fn_EVP_CIPHER_CTX_new = 'EVP_CIPHER_CTX_new'; {Do not localize} - fn_EVP_CIPHER_CTX_set_key_length = 'EVP_CIPHER_CTX_set_key_length'; {Do not localize} - fn_EVP_CIPHER_CTX_ctrl = 'EVP_CIPHER_CTX_ctrl'; {Do not localize} - fn_EVP_CIPHER_CTX_rand_key = 'EVP_CIPHER_CTX_rand_key'; {Do not localize} - fn_EVP_CIPHER_CTX_copy = 'EVP_CIPHER_CTX_copy'; {Do not localize} - fn_EVP_CIPHER_CTX_free = 'EVP_CIPHER_CTX_free'; {Do not localize} - fn_EVP_CIPHER_CTX_set_padding = 'EVP_CIPHER_CTX_set_padding'; {Do not localize} - {$IFNDEF OPENSSL_NO_BIO} - fn_BIO_f_md = 'BIO_f_md'; {Do not localize} - fn_BIO_f_base64 = 'BIO_f_base64'; {Do not localize} - fn_BIO_f_cipher = 'BIO_f_cipher'; {Do not localize} - fn_BIO_f_reliable = 'BIO_f_reliable'; {Do not localize} - fn_BIO_set_cipher = 'BIO_set_cipher'; {Do not localize} - {$ENDIF} - fn_EVP_md_null = 'EVP_md_null'; {Do not localize} - {$IFNDEF OPENSSL_NO_MD2} - fn_EVP_md2 = 'EVP_md2'; {Do not localize} - {$ENDIF} - {$IFNDEF OPENSSL_NO_MD4} - fn_EVP_md4 = 'EVP_md4'; {Do not localize} - {$ENDIF} - {$IFNDEF OPENSSL_NO_MD5} - fn_EVP_md5 = 'EVP_md5'; {Do not localize} - {$ENDIF} - {$IFNDEF OPENSSL_NO_SHA} - fn_EVP_sha = 'EVP_sha'; {Do not localize} - fn_EVP_sha1 = 'EVP_sha1'; {Do not localize} - fn_EVP_dss = 'EVP_dss'; {Do not localize} - fn_EVP_dss1 = 'EVP_dss1'; {Do not localize} - fn_EVP_ecdsa = 'EVP_ecdsa'; {Do not localize} - {$ENDIF} - {$IFNDEF OPENSSL_NO_SHA256} - fn_EVP_sha512 = 'EVP_sha512'; {Do not localize} - fn_EVP_sha384 = 'EVP_sha384'; {Do not localize} - {$ENDIF} - {$IFNDEF OPENSSL_NO_SHA512} - fn_EVP_sha256 = 'EVP_sha256'; {Do not localize} - fn_EVP_sha224 = 'EVP_sha224'; {Do not localize} - {$ENDIF} - {$IFNDEF OPENSSL_NO_MDC2} - fn_EVP_mdc2 = 'EVP_mdc2'; {Do not localize} - {$ENDIF} - {$IFNDEF OPENSSL_NO_RIPEMD} - fn_EVP_ripemd160 = 'EVP_ripemd160'; {Do not localize} - {$ENDIF} - {$ifndef OPENSSL_NO_WHIRLPOOL} - fn_EVP_whirlpool = 'EVP_whirlpool'; {Do not localize} - {$ENDIF} - fn_EVP_enc_null = 'EVP_enc_null'; {Do not localize} - {$IFNDEF OPENSSL_NO_DES} - fn_EVP_des_ecb = 'EVP_des_ecb'; {Do not localize} - fn_EVP_des_ede = 'EVP_des_ede'; {Do not localize} - fn_EVP_des_ede3 = 'EVP_des_ede3'; {Do not localize} - fn_EVP_des_cfb = 'EVP_des_cfb'; {Do not localize} - fn_EVP_des_ede_cfb = 'EVP_des_ede_cfb'; {Do not localize} - fn_EVP_des_ede3_cfb = 'EVP_des_ede3_cfb'; {Do not localize} - fn_EVP_des_ofb = 'EVP_des_ofb'; {Do not localize} - fn_EVP_des_ede_ofb = 'EVP_des_ede_ofb'; {Do not localize} - fn_EVP_des_ede3_ofb = 'EVP_des_ede3_ofb'; {Do not localize} - fn_EVP_des_cbc = 'EVP_des_cbc'; {Do not localize} - fn_EVP_des_ede_cbc = 'EVP_des_ede_cbc'; {Do not localize} - fn_EVP_des_ede3_cbc = 'EVP_des_ede3_cbc'; {Do not localize} - fn_EVP_desx_cbc = 'EVP_desx_cbc'; {Do not localize} - fn_EVP_des_ede3_cfb8 = 'EVP_des_ede3_cfb8'; {Do not localize} - fn_EVP_des_ede_ecb = 'EVP_des_ede_ecb'; {Do not localize} - fn_EVP_des_ede3_ecb = 'EVP_des_ede3_ecb'; - fn_EVP_des_cfb64 = 'EVP_des_cfb64'; - - fn_EVP_des_cfb1 = 'EVP_des_cfb1'; - fn_EVP_des_cfb8 = 'EVP_des_cfb8'; - fn_EVP_des_ede_cfb64 = 'EVP_des_ede_cfb64'; -//#if 0 - fn_EVP_des_ede_cfb1 = 'EVP_des_ede_cfb1'; - fn_EVP_des_ede_cfb8 = 'EVP_des_ede_cfb8'; - //#endif - fn_EVP_des_ede3_cfb64 = 'EVP_des_ede3_cfb64'; - fn_EVP_des_ede3_cfb1 = 'EVP_des_ede3_cfb1'; - {$ENDIF} - {$IFNDEF OPENSSL_NO_RC4} - fn_EVP_rc4 = 'EVP_rc4'; {Do not localize} - fn_EVP_rc4_40 = 'EVP_rc4_40'; {Do not localize} - {$ifndef OPENSSL_NO_MD5} - fn_EVP_rc4_hmac_md5 = 'EVP_rc4_hmac_md5'; {Do not localize} - {$endif} - {$ENDIF} - {$IFNDEF OPENSSL_NO_IDEA} - fn_EVP_idea_ecb = 'EVP_idea_ecb'; {Do not localize} - fn_EVP_idea_cfb64 = 'EVP_idea_cfb64'; {Do not localize} - fn_EVP_idea_cfb = 'EVP_idea_cfb'; {Do not localize} - fn_EVP_idea_ofb = 'EVP_idea_ofb'; {Do not localize} - fn_EVP_idea_cbc = 'EVP_idea_cbc'; {Do not localize} - {$ENDIF} - {$IFNDEF OPENSSL_NO_RC2} - fn_EVP_rc2_ecb = 'EVP_rc2_ecb'; {Do not localize} - fn_EVP_rc2_cbc = 'EVP_rc2_cbc'; {Do not localize} - fn_EVP_rc2_40_cbc = 'EVP_rc2_40_cbc'; {Do not localize} - fn_EVP_rc2_64_cbc = 'EVP_rc2_64_cbc'; {Do not localize} - fn_EVP_rc2_cfb64 = 'EVP_rc2_cfb64'; {Do not localize} - fn_EVP_rc2_cfb = 'EVP_rc2_cfb'; {Do not localize} - fn_EVP_rc2_ofb = 'EVP_rc2_ofb'; {Do not localize} - {$ENDIF} - {$IFNDEF OPENSSL_NO_BF} - fn_EVP_bf_ecb = 'EVP_bf_ecb'; {Do not localize} - fn_EVP_bf_cbc = 'EVP_bf_cbc'; {Do not localize} - fn_EVP_bf_cfb = 'EVP_bf_cfb'; {Do not localize} - fn_EVP_bf_cfb64 = 'EVP_bf_cfb64'; {Do not localize} - fn_EVP_bf_ofb = 'EVP_bf_ofb'; {Do not localize} - {$ENDIF} - {$IFNDEF OPENSSL_NO_CAST} - fn_EVP_cast5_ecb = 'EVP_cast5_ecb'; {Do not localize} - fn_EVP_cast5_cbc = 'EVP_cast5_cbc'; {Do not localize} - fn_EVP_cast5_cfb = 'EVP_cast5_cfb'; {Do not localize} - fn_EVP_cast5_cfb64 = 'EVP_cast5_cfb64'; {Do not localize} - fn_EVP_cast5_ofb = 'EVP_cast5_ofb'; {Do not localize} - {$ENDIF} - {$IFNDEF OPENSSL_NO_RC5 } - fn_EVP_rc5_32_12_16_cbc = 'EVP_rc5_32_12_16_cbc'; {Do not localize} - fn_EVP_rc5_32_12_16_ecb = 'EVP_rc5_32_12_16_ecb'; {Do not localize} - fn_EVP_rc5_32_12_16_cfb = 'EVP_rc5_32_12_16_cfb'; {Do not localize} - fn_EVP_rc5_32_12_16_cfb64 = 'EVP_rc5_32_12_16_cfb64'; {Do not localize} - fn_EVP_rc5_32_12_16_ofb = 'EVP_rc5_32_12_16_ofb'; {Do not localize} - {$ENDIF} - {$IFNDEF OPENSSL_NO_AES} - fn_EVP_aes_128_ecb = 'EVP_aes_128_ecb'; {do not localize} - fn_EVP_aes_128_cbc = 'EVP_aes_128_cbc'; {do not localize} - fn_EVP_aes_128_cfb1 = 'EVP_aes_128_cfb1'; {do not localize} - fn_EVP_aes_128_cfb8 = 'EVP_aes_128_cfb8';{do not localize} - fn_EVP_aes_128_cfb128 = 'EVP_aes_128_cfb128'; {do not localize} - fn_EVP_aes_128_ofb = 'EVP_aes_128_ofb'; {do not localize} - fn_EVP_aes_128_ctr = 'EVP_aes_128_ctr'; {Do not localize} - fn_EVP_aes_128_gcm = 'EVP_aes_128_gcm'; {Do not localize} - fn_EVP_aes_128_ccm = 'EVP_aes_128_ccm'; {Do not localize} - fn_EVP_aes_128_xts = 'EVP_aes_128_xts'; {Do not localize} - fn_EVP_aes_192_ecb = 'EVP_aes_192_ecb'; {Do not localize} - fn_EVP_aes_192_cbc = 'EVP_aes_192_cbc'; {Do not localize} - fn_EVP_aes_192_cfb1 = 'EVP_aes_192_cfb1'; {Do not localize} - fn_EVP_aes_192_cfb8 = 'EVP_aes_192_cfb8'; {Do not localize} - fn_EVP_aes_192_cfb128 = 'EVP_aes_192_cfb128'; {Do not localize} - fn_EVP_aes_192_ctr = 'EVP_aes_192_ctr'; {Do not localize} - fn_EVP_aes_192_gcm = 'EVP_aes_192_gcm'; {Do not localize} - fn_EVP_aes_192_ccm = 'EVP_aes_192_ccm'; {Do not localize} - fn_EVP_aes_192_ofb = 'EVP_aes_192_ofb'; {Do not localize} - fn_EVP_aes_256_ecb = 'EVP_aes_256_ecb'; {Do not localize} - fn_EVP_aes_256_cbc = 'EVP_aes_256_cbc'; {Do not localize} - fn_EVP_aes_256_cfb1 = 'EVP_aes_256_cfb1'; {Do not localize} - fn_EVP_aes_256_cfb8 = 'EVP_aes_256_cfb8'; {Do not localize} - fn_EVP_aes_256_cfb128 = 'EVP_aes_256_cfb128'; {Do not localize} - fn_EVP_aes_256_ofb = 'EVP_aes_256_ofb'; {Do not localize} - fn_EVP_aes_256_ctr = 'EVP_aes_256_ctr'; {Do not localize} - fn_EVP_aes_256_gcm = 'EVP_aes_256_gcm'; {Do not localize} - fn_EVP_aes_256_ccm = 'EVP_aes_256_ccm'; {Do not localize} - fn_EVP_aes_256_xts = 'EVP_aes_256_xts'; {Do not localize} - {$ifndef OPENSSL_NO_SHA} - {$ifndef OPENSSL_NO_SHA1} - fn_EVP_aes_128_cbc_hmac_sha1 = 'EVP_aes_128_cbc_hmac_sha1'; {Do not localize} - fn_EVP_aes_256_cbc_hmac_sha1 = 'EVP_aes_256_cbc_hmac_sha1'; {do not localize} - {$endif} - {$endif} - {$endif} - {$IFNDEF OPENSSL_NO_CAMELLIA} - fn_EVP_camellia_128_ecb = 'EVP_camellia_128_ecb'; {Do not localize} - fn_EVP_camellia_128_cbc = 'EVP_camellia_128_cbc'; {Do not localize} - fn_EVP_camellia_128_cfb1 = 'EVP_camellia_128_cfb1'; {Do not localize} - fn_EVP_camellia_128_cfb8 = 'EVP_camellia_128_cfb8'; {Do not localize} - fn_EVP_camellia_128_cfb128 = 'EVP_camellia_128_cfb128'; {Do not localize} - fn_EVP_camellia_128_ofb = 'EVP_camellia_128_ofb'; {Do not localize} - fn_EVP_camellia_192_ecb = 'EVP_camellia_192_ecb'; {Do not localize} - fn_EVP_camellia_192_cbc = 'EVP_camellia_192_cbc'; {Do not localize} - fn_EVP_camellia_192_cfb1 = 'EVP_camellia_192_cfb1'; {Do not localize} - fn_EVP_camellia_192_cfb8 = 'EVP_camellia_192_cfb8'; {Do not localize} - fn_EVP_camellia_192_cfb128 = 'EVP_camellia_192_cfb128'; {Do not localize} - fn_EVP_camellia_192_ofb = 'EVP_camellia_192_ofb'; {Do not localize} - fn_EVP_camellia_256_ecb = 'EVP_camellia_256_ecb'; {Do not localize} - fn_EVP_camellia_256_cbc = 'EVP_camellia_256_cbc'; {Do not localize} - fn_EVP_camellia_256_cfb1 = 'EVP_camellia_256_cfb1'; {Do not localize} - fn_EVP_camellia_256_cfb8 = 'EVP_camellia_256_cfb8'; {Do not localize} - fn_EVP_camellia_256_cfb128 = 'EVP_camellia_256_cfb128'; {Do not localize} - fn_EVP_camellia_256_ofb = 'EVP_camellia_256_ofb'; {Do not localize} - {$ENDIF} - {$IFNDEF OPENSSL_NO_SEED} - fn_EVP_seed_ecb = 'EVP_seed_ecb'; {Do not localize} - fn_EVP_seed_cbc = 'EVP_seed_cbc'; {Do not localize} - fn_EVP_seed_cfb128 = 'EVP_seed_cfb128'; {Do not localize} - fn_EVP_seed_ofb = 'EVP_seed_ofb'; {Do not localize} - {$ENDIF} - fn_OPENSSL_add_all_algorithms_noconf = 'OPENSSL_add_all_algorithms_noconf'; {Do not localize} - { fn_OPENSSL_add_all_algorithms_conf = 'OPENSSL_add_all_algorithms_conf'; }{Do not localize} - fn_OpenSSL_add_all_algorithms = 'OpenSSL_add_all_algorithms'; - fn_OpenSSL_add_all_ciphers = 'OpenSSL_add_all_ciphers'; {Do not localize} - fn_OpenSSL_add_all_digests = 'OpenSSL_add_all_digests'; {Do not localize} - fn_EVP_add_cipher = 'EVP_add_cipher'; {Do not localize} - fn_EVP_add_digest = 'EVP_add_digest'; {Do not localize} - fn_EVP_CIPHER_do_all = 'EVP_CIPHER_do_all'; {Do not localize} - fn_EVP_CIPHER_do_all_sorted = 'EVP_CIPHER_do_all_sorted'; {do not localize} - fn_EVP_MD_do_all = 'EVP_MD_do_all'; {Do not localize} - fn_EVP_MD_do_all_sorted = 'EVP_MD_do_all_sorted'; {Do not localize} - fn_EVP_get_cipherbyname = 'EVP_get_cipherbyname'; {Do not localize} - fn_EVP_get_digestbyname = 'EVP_get_digestbyname'; {Do not localize} - fn_EVP_PKEY_decrypt_old = 'EVP_PKEY_decrypt_old'; {Do not localize} - fn_EVP_PKEY_encrypt_old = 'EVP_PKEY_encrypt_old'; {Do not localize} - - fn_EVP_cleanup = 'EVP_cleanup'; {Do not localize} - fn_EVP_PKEY_decrypt = 'EVP_PKEY_decrypt'; {Do not localize} - fn_EVP_PKEY_encrypt = 'EVP_PKEY_encrypt'; {Do not localize} - fn_EVP_PKEY_type = 'EVP_PKEY_type'; {Do not localize} - fn_EVP_PKEY_id = 'EVP_PKEY_id'; {Do not localize} - fn_EVP_PKEY_bits = 'EVP_PKEY_bits'; {Do not localize} - fn_EVP_PKEY_base_id = 'EVP_PKEY_base_id'; {Do not localize} - fn_EVP_PKEY_set_type = 'EVP_PKEY_set_type'; {Do not localize} - fn_EVP_PKEY_set_type_str = 'EVP_PKEY_set_type_str'; {Do not localize} - fn_EVP_PKEY_size = 'EVP_PKEY_size'; {Do not localize} - fn_EVP_PKEY_assign = 'EVP_PKEY_assign'; {Do not localize} - fn_EVP_PKEY_get0 = 'EVP_PKEY_get0'; {Do not localize} - {$IFNDEF OPENSSL_NO_RSA} - fn_EVP_PKEY_set1_RSA = 'EVP_PKEY_set1_RSA'; {Do not localize} - fn_EVP_PKEY_get1_RSA = 'EVP_PKEY_get1_RSA'; {Do not localize} - {$ENDIF} - {$IFNDEF OPENSSL_NO_DSA} - fn_EVP_PKEY_set1_DSA = 'EVP_PKEY_set1_DSA'; {Do not localize} - fn_EVP_PKEY_get1_DSA = 'EVP_PKEY_get1_DSA'; {Do not localize} - {$ENDIF} - {$IFNDEF OPENSSL_NO_DH} - fn_EVP_PKEY_set1_DH = 'EVP_PKEY_set1_DH'; {Do not localize} - fn_EVP_PKEY_get1_DH = 'EVP_PKEY_get1_DH'; {Do not localize} - {$ENDIF} - {$IFNDEF OPENSSL_NO_EC} - fn_EVP_PKEY_set1_EC_KEY = 'EVP_PKEY_set1_EC_KEY'; {Do not localize} - fn_EVP_PKEY_get1_EC_KEY = 'EVP_PKEY_get1_EC_KEY'; {Do not localize} - {$ENDIF} - fn_EVP_PKEY_new = 'EVP_PKEY_new'; {Do not localize} - fn_EVP_PKEY_free = 'EVP_PKEY_free'; {Do not localize} - fn_d2i_PublicKey = 'd2i_PublicKey'; {Do not localize} - fn_i2d_PublicKey = 'i2d_PublicKey'; {Do not localize} - fn_d2i_PrivateKey = 'd2i_PrivateKey'; {Do not localize} - fn_d2i_AutoPrivateKey = 'd2i_AutoPrivateKey'; {Do not localize} - fn_i2d_PrivateKey = 'i2d_PrivateKey'; {Do not localize} - fn_EVP_PKEY_copy_parameters = 'EVP_PKEY_copy_parameters'; {Do not localize} - fn_EVP_PKEY_missing_parameters = 'EVP_PKEY_missing_parameters'; {Do not localize} - fn_EVP_PKEY_save_parameters = 'EVP_PKEY_save_parameters'; {Do not localize} - fn_EVP_PKEY_cmp_parameters = 'EVP_PKEY_cmp_parameters'; {Do not localize} - fn_EVP_PKEY_cmp = 'EVP_PKEY_cmp'; {Do not localize} - fn_EVP_PKEY_print_public = 'EVP_PKEY_print_public'; {Do not localize} - fn_EVP_PKEY_print_private = 'EVP_PKEY_print_private'; {Do not localize} - fn_EVP_PKEY_print_params = 'EVP_PKEY_print_params'; {Do not localize} - fn_EVP_PKEY_get_default_digest_nid = 'EVP_PKEY_get_default_digest_nid'; {Do not localize} - fn_EVP_CIPHER_type = 'EVP_CIPHER_type'; {Do not localize} - fn_EVP_CIPHER_param_to_asn1 = 'EVP_CIPHER_param_to_asn1'; {Do not localize} - fn_EVP_CIPHER_asn1_to_param = 'EVP_CIPHER_asn1_to_param'; {Do not localize} - fn_EVP_CIPHER_set_asn1_iv = 'EVP_CIPHER_set_asn1_iv'; {Do not localize} - fn_EVP_CIPHER_get_asn1_iv = 'EVP_CIPHER_get_asn1_iv'; {Do not localize} - fn_PKCS5_PBE_keyivgen = 'PKCS5_PBE_keyivgen'; {Do not localize} - fn_PKCS5_PBKDF2_HMAC = 'PKCS5_PBKDF2_HMAC'; {Do not lozalize} - fn_PKCS5_PBKDF2_HMAC_SHA1 = 'PKCS5_PBKDF2_HMAC_SHA1'; {Do not localize} - fn_PKCS5_v2_PBE_keyivgen = 'PKCS5_v2_PBE_keyivgen'; {Do not localize} - fn_PKCS5_PBE_add = 'PKCS5_PBE_add'; {Do not localize} - fn_EVP_PBE_CipherInit = 'EVP_PBE_CipherInit'; {Do not localize} - fn_EVP_PBE_alg_add = 'EVP_PBE_alg_add'; {Do not localize} - fn_EVP_PBE_alg_add_type = 'EVP_PBE_alg_add_type'; {Do not localize} - fn_EVP_PBE_find = 'EVP_PBE_find'; {Do not localize} - fn_EVP_PBE_cleanup = 'EVP_PBE_cleanup'; {Do not localize} - fn_EVP_PKEY_asn1_get_count = 'EVP_PKEY_asn1_get_count'; - fn_EVP_PKEY_asn1_get0 = 'EVP_PKEY_asn1_get0'; - fn_EVP_PKEY_asn1_find = 'EVP_PKEY_asn1_find'; - fn_EVP_PKEY_asn1_find_str = 'EVP_PKEY_asn1_find_str'; - fn_EVP_PKEY_asn1_add0 = 'EVP_PKEY_asn1_add0'; - fn_EVP_PKEY_asn1_add_alias = 'EVP_PKEY_asn1_add_alias'; - fn_EVP_PKEY_asn1_get0_info = 'EVP_PKEY_asn1_get0_info'; - fn_EVP_PKEY_get0_asn1 = 'EVP_PKEY_get0_asn1'; - fn_EVP_PKEY_asn1_new = 'EVP_PKEY_asn1_new'; - fn_EVP_PKEY_asn1_copy = 'EVP_PKEY_asn1_copy'; - fn_EVP_PKEY_asn1_free = 'EVP_PKEY_asn1_free'; - fn_EVP_PKEY_asn1_set_public = 'EVP_PKEY_asn1_set_public'; - fn_EVP_PKEY_asn1_set_private = 'EVP_PKEY_asn1_set_private'; - fn_EVP_PKEY_asn1_set_param = 'EVP_PKEY_asn1_set_param'; - fn_EVP_PKEY_asn1_set_free = 'EVP_PKEY_asn1_set_free'; - fn_EVP_PKEY_asn1_set_ctrl = 'EVP_PKEY_asn1_set_ctrl'; - fn_EVP_PKEY_meth_find = 'EVP_PKEY_meth_find'; - fn_EVP_PKEY_meth_new = 'EVP_PKEY_meth_new'; - fn_EVP_PKEY_meth_get0_info = 'EVP_PKEY_meth_get0_info'; - fn_EVP_PKEY_meth_copy = 'EVP_PKEY_meth_copy'; - fn_EVP_PKEY_meth_free = 'EVP_PKEY_meth_free'; - fn_EVP_PKEY_meth_add0 = 'EVP_PKEY_meth_add0'; - fn_EVP_PKEY_CTX_new = 'EVP_PKEY_CTX_new'; - fn_EVP_PKEY_CTX_new_id = 'EVP_PKEY_CTX_new_id'; - fn_EVP_PKEY_CTX_dup = 'EVP_PKEY_CTX_dup'; - fn_EVP_PKEY_CTX_free = 'EVP_PKEY_CTX_free'; - fn_EVP_PKEY_CTX_ctrl = 'EVP_PKEY_CTX_ctrl'; - fn_EVP_PKEY_CTX_ctrl_str = 'EVP_PKEY_CTX_ctrl_str'; - fn_EVP_PKEY_CTX_get_operation = 'EVP_PKEY_CTX_get_operation'; - fn_EVP_PKEY_CTX_set0_keygen_info = 'EVP_PKEY_CTX_set0_keygen_info'; - fn_EVP_PKEY_new_mac_key = 'EVP_PKEY_new_mac_key'; - fn_EVP_PKEY_CTX_set_data = 'EVP_PKEY_CTX_set_data'; - fn_EVP_PKEY_CTX_get_data = 'EVP_PKEY_CTX_get_data'; - fn_EVP_PKEY_CTX_get0_pkey = 'EVP_PKEY_CTX_get0_pkey'; - fn_EVP_PKEY_CTX_get0_peerkey = 'EVP_PKEY_CTX_get0_peerkey'; - fn_EVP_PKEY_CTX_set_app_data = 'EVP_PKEY_CTX_set_app_data'; - fn_EVP_PKEY_CTX_get_app_data = 'EVP_PKEY_CTX_get_app_data'; - fn_EVP_PKEY_sign_init = 'EVP_PKEY_sign_init'; - fn_EVP_PKEY_sign = 'EVP_PKEY_sign'; - fn_EVP_PKEY_verify_init = 'EVP_PKEY_verify_init'; - fn_EVP_PKEY_verify = 'EVP_PKEY_verify'; - fn_EVP_PKEY_verify_recover_init = 'EVP_PKEY_verify_recover_init'; - fn_EVP_PKEY_verify_recover = 'EVP_PKEY_verify_recover'; - fn_EVP_PKEY_encrypt_init = 'EVP_PKEY_encrypt_init'; - fn_EVP_PKEY_decrypt_init = 'EVP_PKEY_decrypt_init'; - fn_EVP_PKEY_derive_init = 'EVP_PKEY_derive_init'; - fn_EVP_PKEY_derive_set_peer = 'EVP_PKEY_derive_set_peer'; - fn_EVP_PKEY_derive = 'EVP_PKEY_derive'; - fn_EVP_PKEY_paramgen_init = 'EVP_PKEY_paramgen_init'; - fn_EVP_PKEY_paramgen = 'EVP_PKEY_paramgen'; - fn_EVP_PKEY_keygen_init = 'EVP_PKEY_keygen_init'; - fn_EVP_PKEY_keygen = 'EVP_PKEY_keygen'; - fn_EVP_PKEY_CTX_set_cb = 'EVP_PKEY_CTX_set_cb'; - fn_EVP_PKEY_CTX_get_cb = 'EVP_PKEY_CTX_get_cb'; - fn_EVP_PKEY_CTX_get_keygen_info = 'EVP_PKEY_CTX_get_keygen_info'; - fn_EVP_PKEY_meth_set_init = 'EVP_PKEY_meth_set_init'; - fn_EVP_PKEY_meth_set_copy = 'EVP_PKEY_meth_set_copy'; - fn_EVP_PKEY_meth_set_cleanup = 'EVP_PKEY_meth_set_cleanup'; - fn_EVP_PKEY_meth_set_paramgen = 'EVP_PKEY_meth_set_paramgen'; - fn_EVP_PKEY_meth_set_keygen = 'EVP_PKEY_meth_set_keygen'; - fn_EVP_PKEY_meth_set_sign = 'EVP_PKEY_meth_set_sign'; - fn_EVP_PKEY_meth_set_verify = 'EVP_PKEY_meth_set_verify'; - fn_EVP_PKEY_meth_set_verify_recover = 'EVP_PKEY_meth_set_verify_recover'; - fn_EVP_PKEY_meth_set_signctx = 'EVP_PKEY_meth_set_signctx'; - fn_EVP_PKEY_meth_set_verifyctx = 'EVP_PKEY_meth_set_verifyctx'; - fn_EVP_PKEY_meth_set_encrypt = 'EVP_PKEY_meth_set_encrypt'; - fn_EVP_PKEY_meth_set_decrypt = 'EVP_PKEY_meth_set_decrypt'; - fn_EVP_PKEY_meth_set_derive = 'EVP_PKEY_meth_set_derive'; - fn_EVP_PKEY_meth_set_ctrl = 'EVP_PKEY_meth_set_ctrl'; - - {$IFDEF OPENSSL_FIPS} - {$IFNDEF OPENSSL_NO_ENGINE} - fn_EVP_MD_set_engine_callbacks = 'EVP_MD_set_engine_callbacks'; {Do not localize} - fn_int_EVP_MD_init_engine_callbacks = 'int_EVP_MD_init_engine_callbacks'; {Do not localize} - fn_int_EVP_CIPHER_set_engine_callbacks = 'int_EVP_CIPHER_set_engine_callbacks'; {Do not localize} - fn_int_EVP_CIPHER_init_engine_callbacks = 'int_EVP_CIPHER_init_engine_callbacks'; {Do not localize} - {$ENDIF} - {$ENDIF} - fn_EVP_add_alg_module = 'EVP_add_alg_module'; {Do not localize} - {CH fn_ERR_load_EVP_strings = 'ERR_load_EVP_strings'; } {Do not localize} - {$IFDEF OPENSSL_FIPS} - fn_FIPS_mode_set = 'FIPS_mode_set'; {Do not localize} - fn_FIPS_mode = 'FIPS_mode'; {Do not localize} - {CH fn_FIPS_rand_check = 'FIPS_rand_check'; } {Do not localize} - {CH fn_FIPS_selftest_failed = 'FIPS_selftest_failed'; } {Do not localize} - fn_FIPS_selftest_check = 'FIPS_selftest_check'; {Do not localize} - {CH fn_FIPS_corrupt_sha1 = 'FIPS_corrupt_sha1'; } {Do not localize} - {CH fn_FIPS_selftest_sha1 = 'FIPS_selftest_sha1'; } {Do not localize} - {CH fb_FIPS_corrupt_aes = 'FIPS_corrupt_aes'; } {Do not localize} - {CH fn_FIPS_selftest_aes = 'FIPS_selftest_aes'; } {Do not localize} - {CH fn_FIPS_corrupt_des = 'FIPS_corrupt_des'; } {Do not localize} - {CH fn_FIPS_selftest_des = 'FIPS_selftest_des'; } {Do not localize} - {CH fn_FIPS_corrupt_rsa = 'FIPS_corrupt_rsa'; } {Do not localize} - {CH fn_FIPS_corrupt_rsa_keygen = 'FIPS_corrupt_rsa_keygen'; } {Do not localize} - {CH fn_FIPS_selftest_rsa = 'FIPS_selftest_rsa'; } {Do not localize} - {CH fn_FIPS_corrupt_dsa = 'FIPS_corrupt_dsa'; } {Do not localize} - {CH fn_FIPS_corrupt_dsa_keygen = 'FIPS_corrupt_dsa_keygen'; } {Do not localize} - {CH fn_FIPS_selftest_dsa = 'FIPS_selftest_dsa'; } {Do not localize} - {CH fn_FIPS_corrupt_rng = 'FIPS_corrupt_rng'; } {Do not localize} - {CH fn_FIPS_rng_stick = 'FIPS_rng_stick'; } {Do not localize} - {CH fn_FIPS_selftest_rng = 'FIPS_selftest_rng'; } {Do not localize} - {CH fn_FIPS_selftest_hmac = 'FIPS_selftest_hmac'; } {Do not localize} - {CH fn_fips_pkey_signature_test = 'fips_pkey_signature_test'; } {Do not localize} - {CH fn_fips_cipher_test = 'fips_cipher_test'; } {Do not localize} - //fips_rand.h - {CH fn_FIPS_rand_set_key = 'FIPS_rand_set_key'; } {Do not localize} - {CH fn_FIPS_rand_seed = 'FIPS_rand_seed; } {Do not localize} - {CH fn_FIPS_rand_bytes = 'FIPS_rand_bytes'; } {Do not localize} - {CH fn_FIPS_rand_test_mode = 'FIPS_rand_test_mode'; } {Do not localize} - {CH fn_FIPS_rand_reset = 'FIPS_rand_reset'; } {Do not localize} - {CH fn_FIPS_rand_set_dt = 'FIPS_rand_set_dt'; } {Do not localize} - {CH fn_FIPS_rand_status = 'FIPS_rand_status'; } {Do not localize} - {CH fn_FIPS_rand_method = 'FIPS_rand_method'; } {Do not localize} - {$ENDIF} - {CH fn_sk_X509_ALGOR_new = 'sk_X509_ALGOR_new'; } {Do not localize} - {CH fn_sk_X509_ALGOR_new_null = 'sk_X509_ALGOR_new_null'; } {Do not localize} - {CH fn_sk_X509_ALGOR_free = 'sk_X509_ALGOR_free'; } {Do not localize} - {CH fn_sk_X509_ALGOR_num = 'sk_X509_ALGOR_num'; } {Do not localize} - {CH fn_sk_X509_ALGOR_value = 'sk_X509_ALGOR_value'; } {Do not localize} - {CH fn_sk_X509_ALGOR_set = 'sk_X509_ALGOR_set'; } {Do not localize} - {CH fn_sk_X509_ALGOR_zero = 'sk_X509_ALGOR_zero'; } {Do not localize} - {CH fn_sk_X509_ALGOR_push = 'sk_X509_ALGOR_push'; } {Do not localize} - {CH fn_sk_X509_ALGOR_unshift = 'sk_X509_ALGOR_unshift'; } {Do not localize} - {CH fn_sk_X509_ALGOR_find = 'sk_X509_ALGOR_find'; } {Do not localize} - {CH fn_sk_X509_ALGOR_delete = 'sk_X509_ALGOR_delete'; } {Do not localize} - {CH fn_sk_X509_ALGOR_delete_ptr = 'sk_X509_ALGOR_delete_ptr'; } {Do not localize} - {CH fn_sk_X509_ALGOR_insert = 'sk_X509_ALGOR_insert'; } {Do not localize} - {CH fn_sk_X509_ALGOR_dup = 'sk_X509_ALGOR_dup'; } {Do not localize} - {CH fn_sk_X509_ALGOR_pop_free = 'sk_X509_ALGOR_pop_free'; } {Do not localize} - {CH fn_sk_X509_ALGOR_shift = 'sk_X509_ALGOR_shift'; } {Do not localize} - {CH fn_sk_X509_ALGOR_pop = 'sk_X509_ALGOR_pop'; } {Do not localize} - {CH fn_sk_X509_ALGOR_sort = 'sk_X509_ALGOR_sort'; } {Do not localize} - {CH fn_i2d_ASN1_SET_OF_X509_ALGOR = 'i2d_ASN1_SET_OF_X509_ALGOR'; } {Do not localize} - {CH fn_d2i_ASN1_SET_OF_X509_ALGOR = 'd2i_ASN1_SET_OF_X509_ALGOR'; } {Do not localize} - {CH fn_sk_X509_NAME_ENTRY_new = 'sk_X509_NAME_ENTRY_new'; } {Do not localize} - {CH fn_sk_X509_NAME_ENTRY_new_null = 'sk_X509_NAME_ENTRY_new_null'; } {Do not localize} - {CH fn_sk_X509_NAME_ENTRY_free = 'sk_X509_NAME_ENTRY_free'; } {Do not localize} - {CH fn_sk_X509_NAME_ENTRY_num = 'sk_X509_NAME_ENTRY_num'; } {Do not localize} - {CH fn_sk_X509_NAME_ENTRY_value = 'sk_X509_NAME_ENTRY_value'; } {Do not localize} - {CH fn_sk_X509_NAME_ENTRY_set = 'sk_X509_NAME_ENTRY_set'; } {Do not localize} - {CH fn_sk_X509_NAME_ENTRY_zero = 'sk_X509_NAME_ENTRY_zero'; } {Do not localize} - {CH fn_sk_X509_NAME_ENTRY_push = 'sk_X509_NAME_ENTRY_push'; } {Do not localize} - {CH fn_sk_X509_NAME_ENTRY_unshift = 'sk_X509_NAME_ENTRY_unshift'; } {Do not localize} - {CH fn_sk_X509_NAME_ENTRY_find = 'sk_X509_NAME_ENTRY_find'; } {Do not localize} - {CH fn_sk_X509_NAME_ENTRY_delete = 'sk_X509_NAME_ENTRY_delete'; } {Do not localize} - {CH fn_sk_X509_NAME_ENTRY_delete_ptr = 'sk_X509_NAME_ENTRY_delete_ptr'; } {Do not localize} - {CH fn_sk_X509_NAME_ENTRY_insert = 'sk_X509_NAME_ENTRY_insert'; } {Do not localize} - {CH fn_sk_X509_NAME_ENTRY_dup = 'sk_X509_NAME_ENTRY_dup'; } {Do not localize} - {CH fn_sk_X509_NAME_ENTRY_pop_free = 'sk_X509_NAME_ENTRY_pop_free'; } {Do not localize} - {CH fn_sk_X509_NAME_ENTRY_shift = 'sk_X509_NAME_ENTRY_shift'; } {Do not localize} - {CH fn_sk_X509_NAME_ENTRY_pop = 'sk_X509_NAME_ENTRY_pop'; } {Do not localize} - {CH fn_sk_X509_NAME_ENTRY_sort = 'sk_X509_NAME_ENTRY_sort'; } {Do not localize} - {CH fn_i2d_ASN1_SET_OF_X509_NAME_ENTRY = 'i2d_ASN1_SET_OF_X509_NAME_ENTRY'; } {Do not localize} - {CH fn_d2i_ASN1_SET_OF_X509_NAME_ENTRY = 'd2i_ASN1_SET_OF_X509_NAME_ENTRY'; } {Do not localize} - {CH fn_sk_X509_NAME_new = 'sk_X509_NAME_new'; } {Do not localize} - {CH fn_sk_X509_NAME_new_null = 'sk_X509_NAME_new_null'; } {Do not localize} - {CH fn_sk_X509_NAME_free = 'sk_X509_NAME_free'; } {Do not localize} - {CH fn_sk_X509_NAME_num = 'sk_X509_NAME_num'; } {Do not localize} - {CH fn_sk_X509_NAME_value = 'sk_X509_NAME_value'; } {Do not localize} - {CH fn_sk_X509_NAME_set = 'sk_X509_NAME_set'; } {Do not localize} - {CH fn_sk_X509_NAME_zero = 'sk_X509_NAME_zero'; } {Do not localize} - {CH fn_sk_X509_NAME_push = 'sk_X509_NAME_push'; } {Do not localize} - {CH fn_sk_X509_NAME_unshift = 'sk_X509_NAME_unshift'; } {Do not localize} - {CH fn_sk_X509_NAME_find = 'sk_X509_NAME_find'; } {Do not localize} - {CH fn_sk_X509_NAME_delete = 'sk_X509_NAME_delete'; } {Do not localize} - {CH fn_sk_X509_NAME_delete_ptr = 'sk_X509_NAME_delete_ptr'; } {Do not localize} - {CH fn_sk_X509_NAME_insert = 'sk_X509_NAME_insert'; } {Do not localize} - {CH fn_sk_X509_NAME_dup = 'sk_X509_NAME_dup'; } {Do not localize} - {CH fn_sk_X509_NAME_pop_free = 'sk_X509_NAME_pop_free'; } {Do not localize} - {CH fn_sk_X509_NAME_shift = 'sk_X509_NAME_shift'; } {Do not localize} - {CH fn_sk_X509_NAME_pop = 'sk_X509_NAME_pop'; } {Do not localize} - {CH fn_sk_X509_NAME_sort = 'sk_X509_NAME_sort'; } {Do not localize} - {CH fn_sk_X509_EXTENSION_new = 'sk_X509_EXTENSION_new'; } {Do not localize} - {CH fn_sk_X509_EXTENSION_new_null = 'sk_X509_EXTENSION_new_null'; } {Do not localize} - {CH fn_sk_X509_EXTENSION_free = 'sk_X509_EXTENSION_free'; } {Do not localize} - {CH fn_sk_X509_EXTENSION_num = 'sk_X509_EXTENSION_num'; } {Do not localize} - {CH fn_sk_X509_EXTENSION_value = 'sk_X509_EXTENSION_value'; } {Do not localize} - {CH fn_sk_X509_EXTENSION_set = 'sk_X509_EXTENSION_set'; } {Do not localize} - {CH fn_sk_X509_EXTENSION_zero = 'sk_X509_EXTENSION_zero'; } {Do not localize} - {CH fn_sk_X509_EXTENSION_push = 'sk_X509_EXTENSION_push'; } {Do not localize} - {CH fn_sk_X509_EXTENSION_unshift = 'sk_X509_EXTENSION_unshift'; } {Do not localize} - {CH fn_sk_X509_EXTENSION_find = 'sk_X509_EXTENSION_find'; } {Do not localize} - {CH fn_sk_X509_EXTENSION_delete = 'sk_X509_EXTENSION_delete'; } {Do not localize} - {CH fn_sk_X509_EXTENSION_delete_ptr = 'sk_X509_EXTENSION_delete_ptr'; } {Do not localize} - {CH fn_sk_X509_EXTENSION_insert = 'sk_X509_EXTENSION_insert'; } {Do not localize} - {CH fn_sk_X509_EXTENSION_dup = 'sk_X509_EXTENSION_dup'; } {Do not localize} - {CH fn_sk_X509_EXTENSION_pop_free = 'sk_X509_EXTENSION_pop_free'; } {Do not localize} - {CH fn_sk_X509_EXTENSION_shift = 'sk_X509_EXTENSION_shift'; } {Do not localize} - {CH fn_sk_X509_EXTENSION_pop = 'sk_X509_EXTENSION_pop'; } {Do not localize} - {CH fn_sk_X509_EXTENSION_sort = 'sk_X509_EXTENSION_sort'; } {Do not localize} - {CH fn_i2d_ASN1_SET_OF_X509_EXTENSION = 'i2d_ASN1_SET_OF_X509_EXTENSION'; } {Do not localize} - {CH fn_d2i_ASN1_SET_OF_X509_EXTENSION = 'd2i_ASN1_SET_OF_X509_EXTENSION'; } {Do not localize} - {CH fn_sk_X509_ATTRIBUTE_new = 'sk_X509_ATTRIBUTE_new'; } {Do not localize} - {CH fn_sk_X509_ATTRIBUTE_new_null = 'sk_X509_ATTRIBUTE_new_null'; } {Do not localize} - {CH fn_sk_X509_ATTRIBUTE_free = 'sk_X509_ATTRIBUTE_free'; } {Do not localize} - {CH fn_sk_X509_ATTRIBUTE_num = 'sk_X509_ATTRIBUTE_num'; } {Do not localize} - {CH fn_sk_X509_ATTRIBUTE_value = 'sk_X509_ATTRIBUTE_value'; } {Do not localize} - {CH fn_sk_X509_ATTRIBUTE_set = 'sk_X509_ATTRIBUTE_set'; } {Do not localize} - {CH fn_sk_X509_ATTRIBUTE_zero = 'sk_X509_ATTRIBUTE_zero'; } {Do not localize} - {CH fn_sk_X509_ATTRIBUTE_push = 'sk_X509_ATTRIBUTE_push'; } {Do not localize} - {CH fn_sk_X509_ATTRIBUTE_unshift = 'sk_X509_ATTRIBUTE_unshift'; } {Do not localize} - {CH fn_sk_X509_ATTRIBUTE_find = 'sk_X509_ATTRIBUTE_find'; } {Do not localize} - {CH fn_sk_X509_ATTRIBUTE_delete = 'sk_X509_ATTRIBUTE_delete'; } {Do not localize} - {CH fn_sk_X509_ATTRIBUTE_delete_ptr = 'sk_X509_ATTRIBUTE_delete_ptr'; } {Do not localize} - {CH fn_sk_X509_ATTRIBUTE_insert = 'sk_X509_ATTRIBUTE_insert'; } {Do not localize} - {CH fn_sk_X509_ATTRIBUTE_dup = 'sk_X509_ATTRIBUTE_dup'; } {Do not localize} - {CH fn_sk_X509_ATTRIBUTE_pop_free = 'sk_X509_ATTRIBUTE_pop_free'; } {Do not localize} - {CH fn_sk_X509_ATTRIBUTE_shift = 'sk_X509_ATTRIBUTE_shift'; } {Do not localize} - {CH fn_sk_X509_ATTRIBUTE_pop = 'sk_X509_ATTRIBUTE_pop'; } {Do not localize} - {CH fn_sk_X509_ATTRIBUTE_sort = 'sk_X509_ATTRIBUTE_sort'; } {Do not localize} - {CH fn_i2d_ASN1_SET_OF_X509_ATTRIBUTE = 'i2d_ASN1_SET_OF_X509_ATTRIBUTE'; } {Do not localize} - {CH fn_d2i_ASN1_SET_OF_X509_ATTRIBUTE = 'd2i_ASN1_SET_OF_X509_ATTRIBUTE'; } {Do not localize} - {CH fn_sk_X509_new = 'sk_X509_new'; } {Do not localize} - {CH fn_sk_X509_new_null = 'sk_X509_new_null'; } {Do not localize} - {CH fn_sk_X509_free = 'sk_X509_free'; } {Do not localize} - {CH fn_sk_X509_num = 'sk_X509_num'; } {Do not localize} - {CH fn_sk_X509_value = 'sk_X509_value'; } {Do not localize} - {CH fn_sk_X509_set = 'sk_X509_set'; } {Do not localize} - {CH fn_sk_X509_zero = 'sk_X509_zero'; } {Do not localize} - {CH fn_sk_X509_push = 'sk_X509_push'; } {Do not localize} - {CH fn_sk_X509_unshift = 'sk_X509_unshift'; } {Do not localize} - {CH fn_sk_X509_find = 'sk_X509_find'; } {Do not localize} - {CH fn_sk_X509_delete = 'sk_X509_delete'; } {Do not localize} - {CH fn_sk_X509_delete_ptr = 'sk_X509_delete_ptr'; } {Do not localize} - {CH fn_sk_X509_insert = 'sk_X509_insert'; } {Do not localize} - {CH fn_sk_X509_dup = 'sk_X509_dup'; } {Do not localize} - {CH fn_sk_X509_pop_free = 'sk_X509_pop_free'; } {Do not localize} - {CH fn_sk_X509_shift = 'sk_X509_shift'; } {Do not localize} - {CH fn_sk_X509_pop = 'sk_X509_pop'; } {Do not localize} - {CH fn_sk_X509_sort = 'sk_X509_sort'; } {Do not localize} - {CH fn_i2d_ASN1_SET_OF_X509 = 'i2d_ASN1_SET_OF_X509'; } {Do not localize} - {CH fn_d2i_ASN1_SET_OF_X509 = 'd2i_ASN1_SET_OF_X509'; } {Do not localize} - {CH fn_sk_X509_REVOKED_new = 'sk_X509_REVOKED_new'; } {Do not localize} - {CH fn_sk_X509_REVOKED_new_null = 'sk_X509_REVOKED_new_null'; } {Do not localize} - {CH fn_sk_X509_REVOKED_free = 'sk_X509_REVOKED_free'; } {Do not localize} - {CH fn_sk_X509_REVOKED_num = 'sk_X509_REVOKED_num'; } {Do not localize} - {CH fn_sk_X509_REVOKED_value = 'sk_X509_REVOKED_value'; } {Do not localize} - {CH fn_sk_X509_REVOKED_set = 'sk_X509_REVOKED_set'; } {Do not localize} - {CH fn_sk_X509_REVOKED_zero = 'sk_X509_REVOKED_zero'; } {Do not localize} - {CH fn_sk_X509_REVOKED_push = 'sk_X509_REVOKED_push'; } {Do not localize} - {CH fn_sk_X509_REVOKED_unshift = 'sk_X509_REVOKED_unshift'; } {Do not localize} - {CH fn_sk_X509_REVOKED_find = 'sk_X509_REVOKED_find'; } {Do not localize} - {CH fn_sk_X509_REVOKED_delete = 'sk_X509_REVOKED_delete'; } {Do not localize} - {CH fn_sk_X509_REVOKED_delete_ptr = 'sk_X509_REVOKED_delete_ptr'; } {Do not localize} - {CH fn_sk_X509_REVOKED_insert = 'sk_X509_REVOKED_insert'; } {Do not localize} - {CH fn_sk_X509_REVOKED_dup = 'sk_X509_REVOKED_dup'; } {Do not localize} - {CH fn_sk_X509_REVOKED_pop_free = 'sk_X509_REVOKED_pop_free'; } {Do not localize} - {CH fn_sk_X509_REVOKED_shift = 'sk_X509_REVOKED_shift'; } {Do not localize} - {CH fn_sk_X509_REVOKED_pop = 'sk_X509_REVOKED_pop'; } {Do not localize} - {CH fn_sk_X509_REVOKED_sort = 'sk_X509_REVOKED_sort'; } {Do not localize} - {CH fn_i2d_ASN1_SET_OF_X509_REVOKED = 'i2d_ASN1_SET_OF_X509_REVOKED'; } {Do not localize} - {CH fn_d2i_ASN1_SET_OF_X509_REVOKED = 'd2i_ASN1_SET_OF_X509_REVOKED'; } {Do not localize} - {CH fn_sk_X509_CRL_new = 'sk_X509_CRL_new'; } {Do not localize} - {CH fn_sk_X509_CRL_new_null = 'sk_X509_CRL_new_null'; } {Do not localize} - {CH fn_sk_X509_CRL_free = 'sk_X509_CRL_free'; } {Do not localize} - {CH fn_sk_X509_CRL_num = 'sk_X509_CRL_num'; } {Do not localize} - {CH fn_sk_X509_CRL_value = 'sk_X509_CRL_value'; } {Do not localize} - {CH fn_sk_X509_CRL_set = 'sk_X509_CRL_set'; } {Do not localize} - {CH fn_sk_X509_CRL_zero = 'sk_X509_CRL_zero'; } {Do not localize} - {CH fn_sk_X509_CRL_push = 'sk_X509_CRL_push'; } {Do not localize} - {CH fn_sk_X509_CRL_unshift = 'sk_X509_CRL_unshift'; } {Do not localize} - {CH fn_sk_X509_CRL_find = 'sk_X509_CRL_find'; } {Do not localize} - {CH fn_sk_X509_CRL_delete = 'sk_X509_CRL_delete'; } {Do not localize} - {CH fn_sk_X509_CRL_delete_ptr = 'sk_X509_CRL_delete_ptr'; } {Do not localize} - {CH fn_sk_X509_CRL_insert = 'sk_X509_CRL_insert'; } {Do not localize} - {CH fn_sk_X509_CRL_dup = 'sk_X509_CRL_dup'; } {Do not localize} - {CH fn_sk_X509_CRL_pop_free = 'sk_X509_CRL_pop_free'; } {Do not localize} - {CH fn_sk_X509_CRL_shift = 'sk_X509_CRL_shift'; } {Do not localize} - {CH fn_sk_X509_CRL_pop = 'sk_X509_CRL_pop'; } {Do not localize} - {CH fn_sk_X509_CRL_sort = 'sk_X509_CRL_sort'; } {Do not localize} - {CH fn_i2d_ASN1_SET_OF_X509_CRL = 'i2d_ASN1_SET_OF_X509_CRL'; } {Do not localize} - {CH fn_d2i_ASN1_SET_OF_X509_CRL = 'd2i_ASN1_SET_OF_X509_CRL'; } {Do not localize} - {CH fn_sk_X509_INFO_new = 'sk_X509_INFO_new'; } {Do not localize} - {CH fn_sk_X509_INFO_new_null = 'sk_X509_INFO_new_null'; } {Do not localize} - {CH fn_sk_X509_INFO_free = 'sk_X509_INFO_free'; } {Do not localize} - {CH fn_sk_X509_INFO_num = 'sk_X509_INFO_num'; } {Do not localize} - {CH fn_sk_X509_INFO_value = 'sk_X509_INFO_value'; } {Do not localize} - {CH fn_sk_X509_INFO_set = 'sk_X509_INFO_set'; } {Do not localize} - {CH fn_sk_X509_INFO_zero = 'sk_X509_INFO_zero'; } {Do not localize} - {CH fn_sk_X509_INFO_push = 'sk_X509_INFO_push'; } {Do not localize} - {CH fn_sk_X509_INFO_unshift = 'sk_X509_INFO_unshift'; } {Do not localize} - {CH fn_sk_X509_INFO_find = 'sk_X509_INFO_find'; } {Do not localize} - {CH fn_sk_X509_INFO_delete = 'sk_X509_INFO_delete'; } {Do not localize} - {CH fn_sk_X509_INFO_delete_ptr = 'sk_X509_INFO_delete_ptr'; } {Do not localize} - {CH fn_sk_X509_INFO_insert = 'sk_X509_INFO_insert'; } {Do not localize} - {CH fn_sk_X509_INFO_dup = 'sk_X509_INFO_dup'; } {Do not localize} - {CH fn_sk_X509_INFO_pop_free = 'sk_X509_INFO_pop_free'; } {Do not localize} - {CH fn_sk_X509_INFO_shift = 'sk_X509_INFO_shift'; } {Do not localize} - {CH fn_sk_X509_INFO_pop = 'sk_X509_INFO_pop'; } {Do not localize} - {CH fn_sk_X509_INFO_sort = 'sk_X509_INFO_sort'; } {Do not localize} - {CH fn_sk_X509_LOOKUP_new = 'sk_X509_LOOKUP_new'; } {Do not localize} - {CH fn_sk_X509_LOOKUP_new_null = 'sk_X509_LOOKUP_new_null'; } {Do not localize} - {CH fn_sk_X509_LOOKUP_free = 'sk_X509_LOOKUP_free'; } {Do not localize} - {CH fn_sk_X509_LOOKUP_num = 'sk_X509_LOOKUP_num'; } {Do not localize} - {CH fn_sk_X509_LOOKUP_value = 'sk_X509_LOOKUP_value'; } {Do not localize} - {CH fn_sk_X509_LOOKUP_set = 'sk_X509_LOOKUP_set'; } {Do not localize} - {CH fn_sk_X509_LOOKUP_zero = 'sk_X509_LOOKUP_zero'; } {Do not localize} - {CH fn_sk_X509_LOOKUP_push = 'sk_X509_LOOKUP_push'; } {Do not localize} - {CH fn_sk_X509_LOOKUP_unshift = 'sk_X509_LOOKUP_unshift'; } {Do not localize} - {CH fn_sk_X509_LOOKUP_find = 'sk_X509_LOOKUP_find'; } {Do not localize} - {CH fn_sk_X509_LOOKUP_delete = 'sk_X509_LOOKUP_delete'; } {Do not localize} - {CH fn_sk_X509_LOOKUP_delete_ptr = 'sk_X509_LOOKUP_delete_ptr'; } {Do not localize} - {CH fn_sk_X509_LOOKUP_insert = 'sk_X509_LOOKUP_insert'; } {Do not localize} - {CH fn_sk_X509_LOOKUP_dup = 'sk_X509_LOOKUP_dup'; } {Do not localize} - {CH fn_sk_X509_LOOKUP_pop_free = 'sk_X509_LOOKUP_pop_free'; } {Do not localize} - {CH fn_sk_X509_LOOKUP_shift = 'sk_X509_LOOKUP_shift'; } {Do not localize} - {CH fn_sk_X509_LOOKUP_pop = 'sk_X509_LOOKUP_pop'; } {Do not localize} - {CH fn_sk_X509_LOOKUP_sort = 'sk_X509_LOOKUP_sort'; } {Do not localize} - {CH fn_X509_OBJECT_retrieve_by_subject = 'X509_OBJECT_retrieve_by_subject'; } {Do not localize} - {CH fn_X509_OBJECT_up_ref_count = 'X509_OBJECT_up_ref_count'; } {Do not localize} - {CH fn_X509_OBJECT_free_contents = 'X509_OBJECT_free_contents'; } {Do not localize} - {CH fn_X509_STORE_new = 'X509_STORE_new'; } {Do not localize} - {CH fn_X509_STORE_free = 'X509_STORE_free'; } {Do not localize} - {CH fn_X509_STORE_CTX_init = 'X509_STORE_CTX_init'; } {Do not localize} - {CH fn_X509_STORE_CTX_cleanup = 'X509_STORE_CTX_cleanup'; } {Do not localize} - fn_X509_STORE_add_lookup = 'X509_STORE_add_lookup'; {Do not localize} - {CH fn_X509_LOOKUP_hash_dir = 'X509_LOOKUP_hash_dir'; } {Do not localize} - {CH fn_X509_LOOKUP_file = 'X509_LOOKUP_file'; } {Do not localize} - fn_X509_STORE_add_cert = 'X509_STORE_add_cert'; {Do not localize} - fn_X509_STORE_add_crl = 'X509_STORE_add_crl'; {Do not localize} - {CH fn_X509_STORE_get_by_subject = 'X509_STORE_get_by_subject'; } {Do not localize} - fn_X509_LOOKUP_ctrl = 'X509_LOOKUP_ctrl'; {Do not localize} - {CH fn_X509_load_cert_file = 'X509_load_cert_file'; } {Do not localize} - {CH fn_X509_load_crl_file = 'X509_load_crl_file'; } {Do not localize} - {CH fn_X509_LOOKUP_new = 'X509_LOOKUP_new'; } {Do not localize} - {CH fn_X509_LOOKUP_free = 'X509_LOOKUP_free'; } {Do not localize} - {CH fn_X509_LOOKUP_init = 'X509_LOOKUP_init'; } {Do not localize} - {CH fn_X509_LOOKUP_by_subject = 'X509_LOOKUP_by_subject'; } {Do not localize} - {CH fn_X509_LOOKUP_by_issuer_serial = 'X509_LOOKUP_by_issuer_serial'; } {Do not localize} - {CH fn_X509_LOOKUP_by_fingerprint = 'X509_LOOKUP_by_fingerprint'; } {Do not localize} - {CH fn_X509_LOOKUP_by_alias = 'X509_LOOKUP_by_alias'; } {Do not localize} - {CH fn_X509_LOOKUP_shutdown = 'X509_LOOKUP_shutdown'; } {Do not localize} - fn_X509_STORE_load_locations = 'X509_STORE_load_locations'; {Do not localize} - {CH fn_X509_STORE_set_default_paths = 'X509_STORE_set_default_paths'; } {Do not localize} - {CH fn_X509_STORE_CTX_get_ex_new_index = 'X509_STORE_CTX_get_ex_new_index'; } {Do not localize} - {CH fn_X509_STORE_CTX_set_ex_data = 'X509_STORE_CTX_set_ex_data'; } {Do not localize} - fn_X509_STORE_CTX_get_ex_data = 'X509_STORE_CTX_get_ex_data'; {Do not localize} - fn_X509_STORE_CTX_get_error = 'X509_STORE_CTX_get_error'; {Do not localize} - fn_X509_STORE_CTX_set_error = 'X509_STORE_CTX_set_error'; {Do not localize} - fn_X509_STORE_CTX_get_error_depth = 'X509_STORE_CTX_get_error_depth'; {Do not localize} - fn_X509_STORE_CTX_get_current_cert = 'X509_STORE_CTX_get_current_cert'; {Do not localize} - {CH fn_X509_STORE_CTX_get_chain = 'X509_STORE_CTX_get_chain'; } {Do not localize} - {CH fn_X509_STORE_CTX_set_cert = 'X509_STORE_CTX_set_cert'; } {Do not localize} - {CH fn_X509_STORE_CTX_set_chain = 'X509_STORE_CTX_set_chain'; } {Do not localize} - {CH fn_sk_PKCS7_SIGNER_INFO_new = 'sk_PKCS7_SIGNER_INFO_new'; } {Do not localize} - {CH fn_sk_PKCS7_SIGNER_INFO_new_null = 'sk_PKCS7_SIGNER_INFO_new_null'; } {Do not localize} - {CH fn_sk_PKCS7_SIGNER_INFO_free = 'sk_PKCS7_SIGNER_INFO_free'; } {Do not localize} - {CH fn_sk_PKCS7_SIGNER_INFO_num = 'sk_PKCS7_SIGNER_INFO_num'; } {Do not localize} - {CH fn_sk_PKCS7_SIGNER_INFO_value = 'sk_PKCS7_SIGNER_INFO_value'; } {Do not localize} - {CH fn_sk_PKCS7_SIGNER_INFO_set = 'sk_PKCS7_SIGNER_INFO_set'; } {Do not localize} - {CH fn_sk_PKCS7_SIGNER_INFO_zero = 'sk_PKCS7_SIGNER_INFO_zero'; } {Do not localize} - {CH fn_sk_PKCS7_SIGNER_INFO_push = 'sk_PKCS7_SIGNER_INFO_push'; } {Do not localize} - {CH fn_sk_PKCS7_SIGNER_INFO_unshift = 'sk_PKCS7_SIGNER_INFO_unshift'; } {Do not localize} - {CH fn_sk_PKCS7_SIGNER_INFO_find = 'sk_PKCS7_SIGNER_INFO_find'; } {Do not localize} - {CH fn_sk_PKCS7_SIGNER_INFO_delete = 'sk_PKCS7_SIGNER_INFO_delete'; } {Do not localize} - {CH fn_sk_PKCS7_SIGNER_INFO_delete_ptr = 'sk_PKCS7_SIGNER_INFO_delete_ptr'; } {Do not localize} - {CH fn_sk_PKCS7_SIGNER_INFO_insert = 'sk_PKCS7_SIGNER_INFO_insert'; } {Do not localize} - {CH fn_sk_PKCS7_SIGNER_INFO_dup = 'sk_PKCS7_SIGNER_INFO_dup'; } {Do not localize} - {CH fn_sk_PKCS7_SIGNER_INFO_pop_free = 'sk_PKCS7_SIGNER_INFO_pop_free'; } {Do not localize} - {CH fn_sk_PKCS7_SIGNER_INFO_shift = 'sk_PKCS7_SIGNER_INFO_shift'; } {Do not localize} - {CH fn_sk_PKCS7_SIGNER_INFO_pop = 'sk_PKCS7_SIGNER_INFO_pop'; } {Do not localize} - {CH fn_sk_PKCS7_SIGNER_INFO_sort = 'sk_PKCS7_SIGNER_INFO_sort'; } {Do not localize} - {CH fn_i2d_ASN1_SET_OF_PKCS7_SIGNER_INFO = 'i2d_ASN1_SET_OF_PKCS7_SIGNER_INFO'; } {Do not localize} - {CH fn_d2i_ASN1_SET_OF_PKCS7_SIGNER_INFO = 'd2i_ASN1_SET_OF_PKCS7_SIGNER_INFO'; } {Do not localize} - {CH fn_sk_PKCS7_RECIP_INFO_new = 'sk_PKCS7_RECIP_INFO_new'; } {Do not localize} - {CH fn_sk_PKCS7_RECIP_INFO_new_null = 'sk_PKCS7_RECIP_INFO_new_null'; } {Do not localize} - {CH fn_sk_PKCS7_RECIP_INFO_free = 'sk_PKCS7_RECIP_INFO_free'; } {Do not localize} - {CH fn_sk_PKCS7_RECIP_INFO_num = 'sk_PKCS7_RECIP_INFO_num'; } {Do not localize} - {CH fn_sk_PKCS7_RECIP_INFO_value = 'sk_PKCS7_RECIP_INFO_value'; } {Do not localize} - {CH fn_sk_PKCS7_RECIP_INFO_set = 'sk_PKCS7_RECIP_INFO_set'; } {Do not localize} - {CH fn_sk_PKCS7_RECIP_INFO_zero = 'sk_PKCS7_RECIP_INFO_zero'; } {Do not localize} - {CH fn_sk_PKCS7_RECIP_INFO_push = 'sk_PKCS7_RECIP_INFO_push'; } {Do not localize} - {CH fn_sk_PKCS7_RECIP_INFO_unshift = 'sk_PKCS7_RECIP_INFO_unshift'; } {Do not localize} - {CH fn_sk_PKCS7_RECIP_INFO_find = 'sk_PKCS7_RECIP_INFO_find'; } {Do not localize} - {CH fn_sk_PKCS7_RECIP_INFO_delete = 'sk_PKCS7_RECIP_INFO_delete'; } {Do not localize} - {CH fn_sk_PKCS7_RECIP_INFO_delete_ptr = 'sk_PKCS7_RECIP_INFO_delete_ptr'; } {Do not localize} - {CH fn_sk_PKCS7_RECIP_INFO_insert = 'sk_PKCS7_RECIP_INFO_insert'; } {Do not localize} - {CH fn_sk_PKCS7_RECIP_INFO_dup = 'sk_PKCS7_RECIP_INFO_dup'; } {Do not localize} - {CH fn_sk_PKCS7_RECIP_INFO_pop_free = 'sk_PKCS7_RECIP_INFO_pop_free'; } {Do not localize} - {CH fn_sk_PKCS7_RECIP_INFO_shift = 'sk_PKCS7_RECIP_INFO_shift'; } {Do not localize} - {CH fn_sk_PKCS7_RECIP_INFO_pop = 'sk_PKCS7_RECIP_INFO_pop'; } {Do not localize} - {CH fn_sk_PKCS7_RECIP_INFO_sort = 'sk_PKCS7_RECIP_INFO_sort'; } {Do not localize} - {CH fn_i2d_ASN1_SET_OF_PKCS7_RECIP_INFO = 'i2d_ASN1_SET_OF_PKCS7_RECIP_INFO'; } {Do not localize} - {CH fn_d2i_ASN1_SET_OF_PKCS7_RECIP_INFO = 'd2i_ASN1_SET_OF_PKCS7_RECIP_INFO'; } {Do not localize} - {CH fn_PKCS7_ISSUER_AND_SERIAL_new = 'PKCS7_ISSUER_AND_SERIAL_new'; } {Do not localize} - {CH fn_PKCS7_ISSUER_AND_SERIAL_free = 'PKCS7_ISSUER_AND_SERIAL_free'; } {Do not localize} - {CH fn_i2d_PKCS7_ISSUER_AND_SERIAL = 'i2d_PKCS7_ISSUER_AND_SERIAL'; } {Do not localize} - {CH fn_d2i_PKCS7_ISSUER_AND_SERIAL = 'd2i_PKCS7_ISSUER_AND_SERIAL'; } {Do not localize} - {CH fn_PKCS7_ISSUER_AND_SERIAL_digest = 'PKCS7_ISSUER_AND_SERIAL_digest'; } {Do not localize} - {$IFNDEF OPENSSL_NO_FP_API} - {CH fn_d2i_PKCS7_fp = 'd2i_PKCS7_fp'; } {Do not localize} - {CH fn_i2d_PKCS7_fp = 'i2d_PKCS7_fp'; } {Do not localize} - {$ENDIF} - {CH fn_PKCS7_dup = 'PKCS7_dup'; } {Do not localize} - {CH fn_d2i_PKCS7_bio = 'd2i_PKCS7_bio'; } {Do not localize} - {CH fn_i2d_PKCS7_bio = 'i2d_PKCS7_bio'; } {Do not localize} - {CH fn_PKCS7_SIGNER_INFO_new = 'PKCS7_SIGNER_INFO_new'; } {Do not localize} - {CH fn_PKCS7_SIGNER_INFO_free = 'PKCS7_SIGNER_INFO_free'; } {Do not localize} - {CH fn_i2d_PKCS7_SIGNER_INFO = 'i2d_PKCS7_SIGNER_INFO'; } {Do not localize} - {CH fn_d2i_PKCS7_SIGNER_INFO = 'd2i_PKCS7_SIGNER_INFO'; } {Do not localize} - {CH fn_PKCS7_RECIP_INFO_new = 'PKCS7_RECIP_INFO_new'; } {Do not localize} - {CH fn_PKCS7_RECIP_INFO_free = 'PKCS7_RECIP_INFO_free'; } {Do not localize} - {CH fn_i2d_PKCS7_RECIP_INFO = 'i2d_PKCS7_RECIP_INFO'; } {Do not localize} - {CH fn_d2i_PKCS7_RECIP_INFO = 'd2i_PKCS7_RECIP_INFO'; } {Do not localize} - {CH fn_PKCS7_SIGNED_new = 'PKCS7_SIGNED_new'; } {Do not localize} - {CH fn_PKCS7_SIGNED_free = 'PKCS7_SIGNED_free'; } {Do not localize} - {CH fn_i2d_PKCS7_SIGNED = 'i2d_PKCS7_SIGNED'; } {Do not localize} - {CH fn_d2i_PKCS7_SIGNED = 'd2i_PKCS7_SIGNED'; } {Do not localize} - {CH fn_PKCS7_ENC_CONTENT_new = 'PKCS7_ENC_CONTENT_new'; } {Do not localize} - {CH fn_PKCS7_ENC_CONTENT_free = 'PKCS7_ENC_CONTENT_free'; } {Do not localize} - {CH fn_i2d_PKCS7_ENC_CONTENT = 'i2d_PKCS7_ENC_CONTENT'; } {Do not localize} - {CH fn_d2i_PKCS7_ENC_CONTENT = 'd2i_PKCS7_ENC_CONTENT'; } {Do not localize} - {CH fn_PKCS7_ENVELOPE_new = 'PKCS7_ENVELOPE_new'; } {Do not localize} - {CH fn_PKCS7_ENVELOPE_free = 'PKCS7_ENVELOPE_free'; } {Do not localize} - {CH fn_i2d_PKCS7_ENVELOPE = 'i2d_PKCS7_ENVELOPE'; } {Do not localize} - {CH fn_d2i_PKCS7_ENVELOPE = 'd2i_PKCS7_ENVELOPE'; } {Do not localize} - {CH fn_PKCS7_SIGN_ENVELOPE_new = 'PKCS7_SIGN_ENVELOPE_new'; } {Do not localize} - {CH fn_PKCS7_SIGN_ENVELOPE_free = 'PKCS7_SIGN_ENVELOPE_free'; } {Do not localize} - {CH fn_i2d_PKCS7_SIGN_ENVELOPE = 'i2d_PKCS7_SIGN_ENVELOPE'; } {Do not localize} - {CH fn_d2i_PKCS7_SIGN_ENVELOPE = 'd2i_PKCS7_SIGN_ENVELOPE'; } {Do not localize} - {CH fn_PKCS7_DIGEST_new = 'PKCS7_DIGEST_new'; } {Do not localize} - {CH fn_PKCS7_DIGEST_free = 'PKCS7_DIGEST_free'; } {Do not localize} - {CH fn_i2d_PKCS7_DIGEST = 'i2d_PKCS7_DIGEST'; } {Do not localize} - {CH fn_d2i_PKCS7_DIGEST = 'd2i_PKCS7_DIGEST'; } {Do not localize} - {CH fn_PKCS7_ENCRYPT_new = 'PKCS7_ENCRYPT_new'; } {Do not localize} - {CH fn_PKCS7_ENCRYPT_free = 'PKCS7_ENCRYPT_free'; } {Do not localize} - {CH fn_i2d_PKCS7_ENCRYPT = 'i2d_PKCS7_ENCRYPT'; } {Do not localize} - {CH fn_d2i_PKCS7_ENCRYPT = 'd2i_PKCS7_ENCRYPT'; } {Do not localize} - {CH fn_PKCS7_new = 'PKCS7_new'; } {Do not localize} - {CH fn_PKCS7_free = 'PKCS7_free'; } {Do not localize} - {CH fn_PKCS7_content_free = 'PKCS7_content_free'; } {Do not localize} - fn_i2d_PKCS7 = 'i2d_PKCS7'; {Do not localize} - fn_d2i_PKCS7 = 'd2i_PKCS7'; {Do not localize} - {CH fn_ERR_load_PKCS7_strings = 'ERR_load_PKCS7_strings'; } {Do not localize} - {CH fn_PKCS7_ctrl = 'PKCS7_ctrl'; } {Do not localize} - {CH fn_PKCS7_set_type = 'PKCS7_set_type'; } {Do not localize} - {CH fn_PKCS7_set_content = 'PKCS7_set_content'; } {Do not localize} - {CH fn_PKCS7_SIGNER_INFO_set = 'PKCS7_SIGNER_INFO_set'; } {Do not localize} - {CH fn_PKCS7_add_signer = 'PKCS7_add_signer'; } {Do not localize} - {CH fn_PKCS7_add_certificate = 'PKCS7_add_certificate'; } {Do not localize} - {CH fn_PKCS7_add_crl = 'PKCS7_add_crl'; } {Do not localize} - {CH fn_PKCS7_content_new = 'PKCS7_content_new'; } {Do not localize} - {CH fn_PKCS7_dataVerify = 'PKCS7_dataVerify'; } {Do not localize} - {CH fn_PKCS7_signatureVerify = 'PKCS7_signatureVerify'; } {Do not localize} - {CH fn_PKCS7_dataInit = 'PKCS7_dataInit'; } {Do not localize} - {CH fn_PKCS7_dataFinal = 'PKCS7_dataFinal'; } {Do not localize} - {CH fn_PKCS7_dataDecode = 'PKCS7_dataDecode'; } {Do not localize} - {CH fn_PKCS7_add_signature = 'PKCS7_add_signature'; } {Do not localize} - {CH fn_PKCS7_cert_from_signer_info = 'PKCS7_cert_from_signer_info'; } {Do not localize} - {CH fn_PKCS7_get_signer_info = 'PKCS7_get_signer_info'; } {Do not localize} - {CH fn_PKCS7_add_recipient = 'PKCS7_add_recipient'; } {Do not localize} - {CH fn_PKCS7_add_recipient_info = 'PKCS7_add_recipient_info'; } {Do not localize} - {CH fn_PKCS7_RECIP_INFO_set = 'PKCS7_RECIP_INFO_set'; } {Do not localize} - {CH fn_PKCS7_set_cipher = 'PKCS7_set_cipher'; } {Do not localize} - {CH fn_PKCS7_get_issuer_and_serial = 'PKCS7_get_issuer_and_serial'; } {Do not localize} - {CH fn_PKCS7_digest_from_attributes = 'PKCS7_digest_from_attributes'; } {Do not localize} - {CH fn_PKCS7_add_signed_attribute = 'PKCS7_add_signed_attribute'; } {Do not localize} - {CH fn_PKCS7_add_attribute = 'PKCS7_add_attribute'; } {Do not localize} - {CH fn_PKCS7_get_attribute = 'PKCS7_get_attribute'; } {Do not localize} - {CH fn_PKCS7_get_signed_attribute = 'PKCS7_get_signed_attribute'; } {Do not localize} - {CH fn_PKCS7_set_signed_attributes = 'PKCS7_set_signed_attributes'; } {Do not localize} - {CH fn_PKCS7_set_attributes = 'PKCS7_set_attributes'; } {Do not localize} - {CH fn_X509_verify_cert_error_string = 'X509_verify_cert_error_string'; } {Do not localize} - fn_X509_verify = 'X509_verify'; {Do not localize} - {CH fn_X509_REQ_verify = 'X509_REQ_verify'; } {Do not localize} - {CH fn_X509_CRL_verify = 'X509_CRL_verify'; } {Do not localize} - {CH fn_NETSCAPE_SPKI_verify = 'NETSCAPE_SPKI_verify'; } {Do not localize} - fn_X509_sign = 'X509_sign'; {Do not localize} - fn_X509_REQ_sign = 'X509_REQ_sign'; {Do not localize} - fn_X509V3_set_ctx = 'X509V3_set_ctx'; {Do not localize} - fn_X509V3_EXT_conf_nid = 'X509V3_EXT_conf_nid'; {Do not localize} - fn_X509_REQ_add_extensions = 'X509_REQ_add_extensions'; {Do not localize} - {CH fn_X509_CRL_sign = 'X509_CRL_sign'; } {Do not localize} - {CH fn_NETSCAPE_SPKI_sign = 'NETSCAPE_SPKI_sign'; } {Do not localize} - fn_X509_digest = 'X509_digest'; {Do not localize} - {CH fn_X509_NAME_digest = 'X509_NAME_digest'; } {Do not localize} - {CH fn_d2i_X509_fp = 'd2i_X509_fp'; } {Do not localize} - {CH fn_i2d_X509_fp = 'i2d_X509_fp'; } {Do not localize} - {CH fn_d2i_X509_CRL_fp = 'd2i_X509_CRL_fp'; } {Do not localize} - {CH fn_i2d_X509_CRL_fp = 'i2d_X509_CRL_fp'; } {Do not localize} - {CH fn_d2i_X509_REQ_fp = 'd2i_X509_REQ_fp'; } {Do not localize} - {CH fn_i2d_X509_REQ_fp = 'i2d_X509_REQ_fp'; } {Do not localize} - {$IFNDEF OPENSSL_NO_RSA} - {CH fn_d2i_RSAPrivateKey_fp = 'd2i_RSAPrivateKey_fp'; } {Do not localize} - {CH fn_i2d_RSAPrivateKey_fp = 'i2d_RSAPrivateKey_fp'; } {Do not localize} - {CH fn_d2i_RSAPublicKey_fp = 'd2i_RSAPublicKey_fp'; } {Do not localize} - {CH fn_i2d_RSAPublicKey_fp = 'i2d_RSAPublicKey_fp'; } {Do not localize} - {CH fn_d2i_RSA_PUBKEY_fp = 'd2i_RSA_PUBKEY_fp'; } {Do not localize} - {CH fn_i2d_RSA_PUBKEY_fp = 'i2d_RSA_PUBKEY_fp'; } {Do not localize} - {$ENDIF} - {$IFNDEF OPENSSL_NO_DSA} - {CH fn_d2i_DSA_PUBKEY_fp = 'd2i_DSA_PUBKEY_fp'; } {Do not localize} - {CH fn_i2d_DSA_PUBKEY_fp = 'i2d_DSA_PUBKEY_fp'; } {Do not localize} - {CH fn_d2i_DSAPrivateKey_fp = 'd2i_DSAPrivateKey_fp'; } {Do not localize} - {CH fn_i2d_DSAPrivateKey_fp = 'i2d_DSAPrivateKey_fp'; } {Do not localize} - {$ENDIF} - {$IFNDEF OPENSSL_NO_EC} - {CH fn_d2i_EC_PUBKEY_fp = 'd2i_EC_PUBKEY_fp'; } {Do not localize} - {CH fn_i2d_EC_PUBKEY_fp = 'i2d_EC_PUBKEY_fp'; } {Do not localize} - {CH fn_d2i_ECPrivateKey_fp = 'd2i_ECPrivateKey_fp'; } {Do not localize} - {CH fn_i2d_ECPrivateKey_fp = 'i2d_ECPrivateKey_fp'; } {Do not localize} - {$ENDIF} - {CH fn_d2i_PKCS8_fp = 'd2i_PKCS8_fp'; } {Do not localize} - {CH fn_i2d_PKCS8_fp = 'i2d_PKCS8_fp'; } {Do not localize} - {CH fn_d2i_PKCS8_PRIV_KEY_INFO_fp = 'd2i_PKCS8_PRIV_KEY_INFO_fp'; } {Do not localize} - {CH fn_i2d_PKCS8_PRIV_KEY_INFO_fp = 'i2d_PKCS8_PRIV_KEY_INFO_fp'; } {Do not localize} - {$IFNDEF OPENSSL_NO_BIO} - fn_d2i_X509_bio = 'd2i_X509_bio'; {Do not localize} - fn_i2d_X509_bio = 'i2d_X509_bio'; {Do not localize} - fn_d2i_PKCS12_bio = 'd2i_PKCS12_bio'; {Do not localize} - fn_PKCS12_parse = 'PKCS12_parse'; {Do not localize} - fn_i2d_PrivateKey_bio = 'i2d_PrivateKey_bio'; {Do not localize} - fn_d2i_X509_CRL_bio = 'd2i_X509_CRL_bio'; {Do not localize} - fn_i2d_X509_CRL_bio = 'i2d_X509_CRL_bio'; {Do not localize} - fn_d2i_X509_REQ_bio = 'd2i_X509_REQ_bio'; {Do not localize} - fn_i2d_X509_REQ_bio = 'i2d_X509_REQ_bio'; {Do not localize} - {$IFNDEF OPENSSL_NO_RSA} - fn_d2i_RSAPrivateKey_bio = 'd2i_RSAPrivateKey_bio'; {Do not localize} - fn_i2d_RSAPrivateKey_bio = 'i2d_RSAPrivateKey_bio'; {Do not localize} - fn_d2i_RSAPublicKey_bio = 'd2i_RSAPublicKey_bio'; {Do not localize} - fn_i2d_RSAPublicKey_bio = 'i2d_RSAPublicKey_bio'; {Do not localize} - {$ENDIF} - {$IFNDEF OPENSSL_NO_DSA} - {CH fn_d2i_DSA_PUBKEY_bio = 'd2i_DSA_PUBKEY_bio'; } {Do not localize} - {CH fn_i2d_DSA_PUBKEY_bio = 'i2d_DSA_PUBKEY_bio'; } {Do not localize} - {CH fn_d2i_DSAPrivateKey_bio = 'd2i_DSAPrivateKey_bio'; } {Do not localize} - {CH fn_i2d_DSAPrivateKey_bio = 'i2d_DSAPrivateKey_bio'; } {Do not localize} - {$ENDIF} - {$IFNDEF OPENSSL_NO_EC} - {CH fn_d2i_EC_PUBKEY_bio = 'd2i_EC_PUBKEY_bio'; } {Do not localize} - {CH fn_i2d_EC_PUBKEY_bio = 'i2d_EC_PUBKEY_bio'; } {Do not localize} - {CH fn_d2i_ECPrivateKey_bio = 'd2i_ECPrivateKey_bio'; } {Do not localize} - {CH fn_i2d_ECPrivateKey_bio = 'i2d_ECPrivateKey_bio'; } {Do not localize} - {$ENDIF} - {CH fn_d2i_PKCS8_bio = 'd2i_PKCS8_bio'; } {Do not localize} - {CH fn_i2d_PKCS8_bio = 'i2d_PKCS8_bio'; } {Do not localize} - {CH fn_d2i_PKCS8_PRIV_KEY_INFO_bio = 'd2i_PKCS8_PRIV_KEY_INFO_bio'; } {Do not localize} - {CH fn_i2d_PKCS8_PRIV_KEY_INFO_bio = 'i2d_PKCS8_PRIV_KEY_INFO_bio'; } {Do not localize} - fn_d2i_PrivateKey_bio = 'd2i_PrivateKey_bio'; {Do not localize} - {CH fn_i2d_PUBKEY_bio = 'i2d_PUBKEY_bio'; } {Do not localize} - {CH fn_d2i_PUBKEY_bio = 'd2i_PUBKEY_bio'; } {Do not localize} - {$ENDIF} - {CH fn_X509_dup = 'X509_dup'; } {Do not localize} - {CH fn_X509_ATTRIBUTE_dup = 'X509_ATTRIBUTE_dup'; } {Do not localize} - {CH fn_X509_EXTENSION_dup = 'X509_EXTENSION_dup'; } {Do not localize} - {CH fn_X509_CRL_dup = 'X509_CRL_dup'; } {Do not localize} - {CH fn_X509_REQ_dup = 'X509_REQ_dup'; } {Do not localize} - {CH fn_X509_ALGOR_dup = 'X509_ALGOR_dup'; } {Do not localize} - {CH fn_X509_NAME_dup = 'X509_NAME_dup'; } {Do not localize} - {CH fn_X509_NAME_ENTRY_dup = 'X509_NAME_ENTRY_dup'; } {Do not localize} - {CH fn_RSAPublicKey_dup = 'RSAPublicKey_dup'; } {Do not localize} - {CH fn_RSAPrivateKey_dup = 'RSAPrivateKey_dup'; } {Do not localize} - {CH fn_X509_cmp_current_time = 'X509_cmp_current_time'; } {Do not localize} - fn_X509_gmtime_adj = 'X509_gmtime_adj'; {Do not localize} - {CH fn_X509_get_default_cert_area = 'X509_get_default_cert_area'; } {Do not localize} - {CH fn_X509_get_default_cert_dir = 'X509_get_default_cert_dir'; } {Do not localize} - fn_X509_get_default_cert_file = 'X509_get_default_cert_file'; {Do not localize} - {CH fn_X509_get_default_cert_dir_env = 'X509_get_default_cert_dir_env'; } {Do not localize} - fn_X509_get_default_cert_file_env = 'X509_get_default_cert_file_env'; {Do not localize} - {CH fn_X509_get_default_private_dir = 'X509_get_default_private_dir'; } {Do not localize} - fn_X509_to_X509_REQ = 'X509_to_X509_REQ'; {Do not localize} - {CH fn_X509_REQ_to_X509 = 'X509_REQ_to_X509'; } {Do not localize} - fn_X509_NAME_add_entry_by_txt = 'X509_NAME_add_entry_by_txt'; {Do not localize} - {CH fn_ERR_load_X509_strings = 'ERR_load_X509_strings'; } {Do not localize} - {CH fn_X509_ALGOR_new = 'X509_ALGOR_new'; } {Do not localize} - {CH fn_X509_ALGOR_free = 'X509_ALGOR_free'; } {Do not localize} - {CH fn_i2d_X509_ALGOR = 'i2d_X509_ALGOR'; } {Do not localize} - {CH fn_d2i_X509_ALGOR = 'd2i_X509_ALGOR'; } {Do not localize} - {CH fn_X509_VAL_new = 'X509_VAL_new'; } {Do not localize} - {CH fn_X509_VAL_free = 'X509_VAL_free'; } {Do not localize} - {CH fn_i2d_X509_VAL = 'i2d_X509_VAL'; } {Do not localize} - {CH fn_d2i_X509_VAL = 'd2i_X509_VAL'; } {Do not localize} - {CH fn_X509_PUBKEY_new = 'X509_PUBKEY_new'; } {Do not localize} - {CH fn_X509_PUBKEY_free = 'X509_PUBKEY_free'; } {Do not localize} - {CH fn_i2d_X509_PUBKEY = 'i2d_X509_PUBKEY'; } {Do not localize} - {CH fn_d2i_X509_PUBKEY = 'd2i_X509_PUBKEY'; } {Do not localize} - {CH fn_X509_PUBKEY_set = 'X509_PUBKEY_set'; } {Do not localize} - fn_X509_PUBKEY_get = 'X509_PUBKEY_get'; {Do not localize} - {CH fn_X509_get_pubkey_parameters = 'X509_get_pubkey_parameters'; } {Do not localize} - {CH fn_X509_SIG_new = 'X509_SIG_new'; } {Do not localize} - {CH fn_X509_SIG_free = 'X509_SIG_free'; } {Do not localize} - {CH fn_i2d_X509_SIG = 'i2d_X509_SIG'; } {Do not localize} - {CH fn_d2i_X509_SIG = 'd2i_X509_SIG'; } {Do not localize} - {CH fn_X509_REQ_INFO_new = 'X509_REQ_INFO_new'; } {Do not localize} - {CH fn_X509_REQ_INFO_free = 'X509_REQ_INFO_free'; } {Do not localize} - {CH fn_i2d_X509_REQ_INFO = 'i2d_X509_REQ_INFO'; } {Do not localize} - {CH fn_d2i_X509_REQ_INFO = 'd2i_X509_REQ_INFO'; } {Do not localize} - fn_X509_REQ_new = 'X509_REQ_new'; {Do not localize} - fn_X509_REQ_free = 'X509_REQ_free'; {Do not localize} - fn_i2d_X509_REQ = 'i2d_X509_REQ'; {Do not localize} - fn_d2i_X509_REQ = 'd2i_X509_REQ'; {Do not localize} - {CH fn_X509_ATTRIBUTE_new = 'X509_ATTRIBUTE_new'; } {Do not localize} - {CH fn_X509_ATTRIBUTE_free = 'X509_ATTRIBUTE_free'; } {Do not localize} - {CH fn_i2d_X509_ATTRIBUTE = 'i2d_X509_ATTRIBUTE'; } {Do not localize} - {CH fn_d2i_X509_ATTRIBUTE = 'd2i_X509_ATTRIBUTE'; } {Do not localize} - {CH fn_X509_ATTRIBUTE_create = 'X509_ATTRIBUTE_create'; } {Do not localize} - {CH fn_X509_EXTENSION_new = 'X509_EXTENSION_new'; } {Do not localize} - fn_X509_EXTENSION_free = 'X509_EXTENSION_free'; {Do not localize} - {CH fn_i2d_X509_EXTENSION = 'i2d_X509_EXTENSION'; } {Do not localize} - {CH fn_d2i_X509_EXTENSION = 'd2i_X509_EXTENSION'; } {Do not localize} - {CH fn_X509_NAME_ENTRY_new = 'X509_NAME_ENTRY_new'; } {Do not localize} - {CH fn_X509_NAME_ENTRY_free = 'X509_NAME_ENTRY_free'; } {Do not localize} - fn_i2d_X509_NAME_ENTRY = 'i2d_X509_NAME_ENTRY'; {Do not localize} - fn_d2i_X509_NAME_ENTRY = 'd2i_X509_NAME_ENTRY'; {Do not localize} - fn_X509_NAME_new = 'X509_NAME_new'; {Do not localize} - fn_X509_NAME_free = 'X509_NAME_free'; {Do not localize} - fn_i2d_X509_NAME = 'i2d_X509_NAME'; {Do not localize} - fn_d2i_X509_NAME = 'd2i_X509_NAME'; {Do not localize} - {CH fn_X509_NAME_set = 'X509_NAME_set'; } {Do not localize} - {CH fn_X509_CINF_new = 'X509_CINF_new'; } {Do not localize} - {CH fn_X509_CINF_free = 'X509_CINF_free'; } {Do not localize} - {CH fn_i2d_X509_CINF = 'i2d_X509_CINF'; } {Do not localize} - {CH fn_d2i_X509_CINF = 'd2i_X509_CINF'; } {Do not localize} - fn_X509_new = 'X509_new'; {Do not localize} - fn_X509_free = 'X509_free'; {Do not localize} - fn_i2d_X509 = 'i2d_X509'; {Do not localize} - fn_d2i_X509 = 'd2i_X509'; {Do not localize} - {CH fn_X509_REVOKED_new = 'X509_REVOKED_new'; } {Do not localize} - {CH fn_X509_REVOKED_free = 'X509_REVOKED_free'; } {Do not localize} - {CH fn_i2d_X509_REVOKED = 'i2d_X509_REVOKED'; } {Do not localize} - {CH fn_d2i_X509_REVOKED = 'd2i_X509_REVOKED'; } {Do not localize} - {CH fn_X509_CRL_INFO_new = 'X509_CRL_INFO_new'; } {Do not localize} - {CH fn_X509_CRL_INFO_free = 'X509_CRL_INFO_free'; } {Do not localize} - {CH fn_i2d_X509_CRL_INFO = 'i2d_X509_CRL_INFO'; } {Do not localize} - {CH fn_d2i_X509_CRL_INFO = 'd2i_X509_CRL_INFO'; } {Do not localize} - {CH fn_X509_CRL_new = 'X509_CRL_new'; } {Do not localize} - {CH fn_X509_CRL_free = 'X509_CRL_free'; } {Do not localize} - fn_i2d_X509_CRL = 'i2d_X509_CRL'; {Do not localize} - fn_d2i_X509_CRL = 'd2i_X509_CRL'; {Do not localize} - {CH fn_X509_PKEY_new = 'X509_PKEY_new'; } {Do not localize} - {CH fn_X509_PKEY_free = 'X509_PKEY_free'; } {Do not localize} - {CH fn_i2d_X509_PKEY = 'i2d_X509_PKEY'; } {Do not localize} - {CH fn_d2i_X509_PKEY = 'd2i_X509_PKEY'; } {Do not localize} - {CH fn_NETSCAPE_SPKI_new = 'NETSCAPE_SPKI_new'; } {Do not localize} - {CH fn_NETSCAPE_SPKI_free = 'NETSCAPE_SPKI_free'; } {Do not localize} - {CH fn_i2d_NETSCAPE_SPKI = 'i2d_NETSCAPE_SPKI'; } {Do not localize} - {CH fn_d2i_NETSCAPE_SPKI = 'd2i_NETSCAPE_SPKI'; } {Do not localize} - {CH fn_NETSCAPE_SPKAC_new = 'NETSCAPE_SPKAC_new'; } {Do not localize} - {CH fn_NETSCAPE_SPKAC_free = 'NETSCAPE_SPKAC_free'; } {Do not localize} - {CH fn_i2d_NETSCAPE_SPKAC = 'i2d_NETSCAPE_SPKAC'; } {Do not localize} - {CH fn_d2i_NETSCAPE_SPKAC = 'd2i_NETSCAPE_SPKAC'; } {Do not localize} - fn_i2d_NETSCAPE_CERT_SEQUENCE = 'i2d_NETSCAPE_CERT_SEQUENCE'; {Do not localize} - fn_d2i_NETSCAPE_CERT_SEQUENCE = 'd2i_NETSCAPE_CERT_SEQUENCE'; {Do not localize} - fn_i2d_PUBKEY = 'i2d_PUBKEY'; {Do not localize} - fn_d2i_PUBKEY = 'd2i_PUBKEY'; {Do not localize} - - {CH fn_NETSCAPE_CERT_SEQUENCE_new = 'NETSCAPE_CERT_SEQUENCE_new'; } {Do not localize} - {CH fn_NETSCAPE_CERT_SEQUENCE_free = 'NETSCAPE_CERT_SEQUENCE_free'; } {Do not localize} - {CH fn_X509_INFO_new = 'X509_INFO_new'; } {Do not localize} - fn_X509_INFO_free = 'X509_INFO_free'; {Do not localize} - fn_X509_NAME_oneline = 'X509_NAME_oneline'; {Do not localize} - {CH fn_ASN1_verify = 'ASN1_verify'; } {Do not localize} - {CH fn_ASN1_digest = 'ASN1_digest'; } {Do not localize} - {CH fn_ASN1_sign = 'ASN1_sign'; } {Do not localize} - fn_X509_set_version = 'X509_set_version'; {Do not localize} - {CH fn_X509_set_serialNumber = 'X509_set_serialNumber'; } {Do not localize} - fn_X509_get_serialNumber = 'X509_get_serialNumber'; {Do not localize} - fn_X509_set_issuer_name = 'X509_set_issuer_name'; {Do not localize} - fn_X509_get_issuer_name = 'X509_get_issuer_name'; {Do not localize} - fn_X509_set_subject_name = 'X509_set_subject_name'; {Do not localize} - fn_X509_get_subject_name = 'X509_get_subject_name'; {Do not localize} - fn_X509_set_notBefore = 'X509_set_notBefore'; {Do not localize} - fn_X509_set_notAfter = 'X509_set_notAfter'; {Do not localize} - fn_X509_set_pubkey = 'X509_set_pubkey'; {Do not localize} - {CH fn_X509_get_pubkey = 'X509_get_pubkey'; } {Do not localize} - {CH fn_X509_certificate_type = 'X509_certificate_type'; } {Do not localize} - {CH fn_X509_REQ_set_version = 'X509_REQ_set_version'; } {Do not localize} - {CH fn_X509_REQ_set_subject_name = 'X509_REQ_set_subject_name'; } {Do not localize} - fn_X509_REQ_set_pubkey = 'X509_REQ_set_pubkey'; {Do not localize} - {CH fn_X509_REQ_get_pubkey = 'X509_REQ_get_pubkey'; } {Do not localize} - {CH fn_X509_check_private_key = 'X509_check_private_key'; } {Do not localize} - {CH fn_X509_issuer_and_serial_cmp = 'X509_issuer_and_serial_cmp'; } {Do not localize} - {CH fn_X509_issuer_and_serial_hash = 'X509_issuer_and_serial_hash'; } {Do not localize} - {CH fn_X509_issuer_name_cmp = 'X509_issuer_name_cmp'; } {Do not localize} - {CH fn_X509_issuer_name_hash = 'X509_issuer_name_hash'; } {Do not localize} - {CH fn_X509_subject_name_cmp = 'X509_subject_name_cmp'; } {Do not localize} - {CH fn_X509_subject_name_hash = 'X509_subject_name_hash'; } {Do not localize} - fn_X509_NAME_cmp = 'X509_NAME_cmp'; {Do not localize} - fn_X509_NAME_hash = 'X509_NAME_hash'; {Do not localize} - {CH fn_X509_CRL_cmp = 'X509_CRL_cmp'; } {Do not localize} - {$IFNDEF OPENSSL_NO_FP_API} - {CH fn_X509_print_ex_fp = 'X509_print_ex_fp'; } {Do not localize} - {CH fn_X509_print_fp = 'X509_print_fp'; } {Do not localize} - {CH fn_X509_CRL_print_fp = 'X509_CRL_print_fp'; } {Do not localize} - {CH fn_X509_REQ_print_fp = 'X509_REQ_print_fp'; } {Do not localize} - {CH fn_X509_NAME_print_ex_fp = 'X509_NAME_print_ex_fp'; } {Do not localize} - {$ENDIF} - {$IFNDEF OPENSSL_NO_BIO} - {CH fn_X509_NAME_print = 'X509_NAME_print'; } {Do not localize} - {CH fn_X509_NAME_print_ex = 'X509_NAME_print_ex'; } {Do not localize} - {CH fn_X509_print_ex = 'X509_print_ex'; } {Do not localize} - fn_X509_print = 'X509_print'; {Do not localize} - {CH fn_X509_ocspid_print = 'X509_ocspid_print'; } {Do not localize} - {CH fn_X509_CERT_AUX_print = 'X509_CERT_AUX_print'; } {Do not localize} - {CH fn_X509_CRL_print = 'X509_CRL_print'; } {Do not localize} - {CH fn_X509_REQ_print = 'X509_REQ_print'; } {Do not localize} - {CH fn_X509_REQ_print_ex = 'X509_REQ_print_ex'; } {Do not localize} - {$ENDIF} - {CH fn_X509_NAME_entry_count = 'X509_NAME_entry_count'; } {Do not localize} - {CH fn_X509_NAME_get_text_by_NID = 'X509_NAME_get_text_by_NID'; } {Do not localize} - {CH fn_X509_NAME_get_text_by_OBJ = 'X509_NAME_get_text_by_OBJ'; } {Do not localize} - {CH fn_X509_NAME_get_index_by_NID = 'X509_NAME_get_index_by_NID'; } {Do not localize} - {CH fn_X509_NAME_get_index_by_OBJ = 'X509_NAME_get_index_by_OBJ'; } {Do not localize} - {CH fn_X509_NAME_get_entry = 'X509_NAME_get_entry'; } {Do not localize} - {CH fn_X509_NAME_delete_entry = 'X509_NAME_delete_entry'; } {Do not localize} - {CH fn_X509_NAME_add_entry = 'X509_NAME_add_entry'; } {Do not localize} - {CH fn_X509_NAME_ENTRY_create_by_NID = 'X509_NAME_ENTRY_create_by_NID'; } {Do not localize} - {CH fn_X509_NAME_ENTRY_create_by_OBJ = 'X509_NAME_ENTRY_create_by_OBJ'; } {Do not localize} - {CH fn_X509_NAME_ENTRY_set_object = 'X509_NAME_ENTRY_set_object'; } {Do not localize} - {CH fn_X509_NAME_ENTRY_set_data = 'X509_NAME_ENTRY_set_data'; } {Do not localize} - {CH fn_X509_NAME_ENTRY_get_object = 'X509_NAME_ENTRY_get_object'; } {Do not localize} - {CH fn_X509_NAME_ENTRY_get_data = 'X509_NAME_ENTRY_get_data'; } {Do not localize} - {CH fn_X509v3_get_ext_count = 'X509v3_get_ext_count'; } {Do not localize} - {CH fn_X509v3_get_ext_by_NID = 'X509v3_get_ext_by_NID'; } {Do not localize} - {CH fn_X509v3_get_ext_by_OBJ = 'X509v3_get_ext_by_OBJ'; } {Do not localize} - {CH fn_X509v3_get_ext_by_critical = 'X509v3_get_ext_by_critical'; } {Do not localize} - {CH fn_X509v3_get_ext = 'X509v3_get_ext'; } {Do not localize} - {CH fn_X509v3_delete_ext = 'X509v3_delete_ext'; } {Do not localize} - {CH fn_X509v3_add_ext = 'X509v3_add_ext'; } {Do not localize} - {CH fn_X509_get_ext_count = 'X509_get_ext_count'; } {Do not localize} - {CH fn_X509_get_ext_by_NID = 'X509_get_ext_by_NID'; } {Do not localize} - {CH fn_X509_get_ext_by_OBJ = 'X509_get_ext_by_OBJ'; } {Do not localize} - {CH fn_X509_get_ext_by_critical = 'X509_get_ext_by_critical'; } {Do not localize} - {CH fn_X509_get_ext = 'X509_get_ext'; } {Do not localize} - {CH fn_X509_delete_ext = 'X509_delete_ext'; } {Do not localize} - fn_X509_add_ext = 'X509_add_ext'; {Do not localize} - {CH fn_X509_CRL_get_ext_count = 'X509_CRL_get_ext_count'; } {Do not localize} - {CH fn_X509_CRL_get_ext_by_NID = 'X509_CRL_get_ext_by_NID'; } {Do not localize} - {CH fn_X509_CRL_get_ext_by_OBJ = 'X509_CRL_get_ext_by_OBJ'; } {Do not localize} - {CH fn_X509_CRL_get_ext_by_critical = 'X509_CRL_get_ext_by_critical'; } {Do not localize} - {CH fn_X509_CRL_get_ext = 'X509_CRL_get_ext'; } {Do not localize} - {CH fn_X509_CRL_delete_ext = 'X509_CRL_delete_ext'; } {Do not localize} - {CH fn_X509_CRL_add_ext = 'X509_CRL_add_ext'; } {Do not localize} - {CH fn_X509_REVOKED_get_ext_count = 'X509_REVOKED_get_ext_count'; } {Do not localize} - {CH fn_X509_REVOKED_get_ext_by_NID = 'X509_REVOKED_get_ext_by_NID'; } {Do not localize} - {CH fn_X509_REVOKED_get_ext_by_OBJ = 'X509_REVOKED_get_ext_by_OBJ'; } {Do not localize} - {CH fn_X509_REVOKED_get_ext_by_critical = 'X509_REVOKED_get_ext_by_critical'; } {Do not localize} - {CH fn_X509_REVOKED_get_ext = 'X509_REVOKED_get_ext'; } {Do not localize} - {CH fn_X509_REVOKED_delete_ext = 'X509_REVOKED_delete_ext'; } {Do not localize} - {CH fn_X509_REVOKED_add_ext = 'X509_REVOKED_add_ext'; } {Do not localize} - fn_X509_EXTENSION_create_by_NID = 'X509_EXTENSION_create_by_NID'; {Do not localize} - {CH fn_X509_EXTENSION_create_by_OBJ = 'X509_EXTENSION_create_by_OBJ'; } {Do not localize} - {CH fn_X509_EXTENSION_set_object = 'X509_EXTENSION_set_object'; } {Do not localize} - {CH fn_X509_EXTENSION_set_critical = 'X509_EXTENSION_set_critical'; } {Do not localize} - {CH fn_X509_EXTENSION_set_data = 'X509_EXTENSION_set_data'; } {Do not localize} - {CH fn_X509_EXTENSION_get_object = 'X509_EXTENSION_get_object'; } {Do not localize} - {CH fn_X509_EXTENSION_get_data = 'X509_EXTENSION_get_data'; } {Do not localize} - {CH fn_X509_EXTENSION_get_critical = 'X509_EXTENSION_get_critical'; } {Do not localize} - {CH fn_X509_verify_cert = 'X509_verify_cert'; } {Do not localize} - {CH fn_X509_find_by_issuer_and_serial = 'X509_find_by_issuer_and_serial'; } {Do not localize} - {CH fn_X509_find_by_subject = 'X509_find_by_subject'; } {Do not localize} - {CH fn_i2d_PBEPARAM = 'i2d_PBEPARAM'; } {Do not localize} - {CH fn_PBEPARAM_new = 'PBEPARAM_new'; } {Do not localize} - {CH fn_d2i_PBEPARAM = 'd2i_PBEPARAM'; } {Do not localize} - {CH fn_PBEPARAM_free = 'PBEPARAM_free'; } {Do not localize} - {CH fn_PKCS5_pbe_set = 'PKCS5_pbe_set'; } {Do not localize} - {CH fn_PKCS5_pbe2_set = 'PKCS5_pbe2_set'; } {Do not localize} - {CH fn_i2d_PBKDF2PARAM = 'i2d_PBKDF2PARAM'; } {Do not localize} - {CH fn_PBKDF2PARAM_new = 'PBKDF2PARAM_new'; } {Do not localize} - {CH fn_d2i_PBKDF2PARAM = 'd2i_PBKDF2PARAM'; } {Do not localize} - {CH fn_PBKDF2PARAM_free = 'PBKDF2PARAM_free'; } {Do not localize} - {CH fn_i2d_PBE2PARAM = 'i2d_PBE2PARAM'; } {Do not localize} - {CH fn_PBE2PARAM_new = 'PBE2PARAM_new'; } {Do not localize} - {CH fn_d2i_PBE2PARAM = 'd2i_PBE2PARAM'; } {Do not localize} - {CH fn_PBE2PARAM_free = 'PBE2PARAM_free'; } {Do not localize} - {CH fn_i2d_PKCS8_PRIV_KEY_INFO = 'i2d_PKCS8_PRIV_KEY_INFO'; } {Do not localize} - {CH fn_PKCS8_PRIV_KEY_INFO_new = 'PKCS8_PRIV_KEY_INFO_new'; } {Do not localize} - {CH fn_d2i_PKCS8_PRIV_KEY_INFO = 'd2i_PKCS8_PRIV_KEY_INFO'; } {Do not localize} - {CH fn_PKCS8_PRIV_KEY_INFO_free = 'PKCS8_PRIV_KEY_INFO_free'; } {Do not localize} - {CH fn_EVP_PKCS82PKEY = 'EVP_PKCS82PKEY'; } {Do not localize} - {CH fn_EVP_PKEY2PKCS8 = 'EVP_PKEY2PKCS8'; } {Do not localize} - {CH fn_PKCS8_set_broken = 'PKCS8_set_broken'; } {Do not localize} - {CH fn_ERR_load_PEM_strings = 'ERR_load_PEM_strings'; } {Do not localize} - {CH fn_PEM_get_EVP_CIPHER_INFO = 'PEM_get_EVP_CIPHER_INFO'; } {Do not localize} - {CH fn_PEM_do_header = 'PEM_do_header'; } {Do not localize} - {CH fn_PEM_read_bio = 'PEM_read_bio'; } {Do not localize} - {CH fn_PEM_write_bio = 'PEM_write_bio'; } {Do not localize} - fn_PEM_ASN1_read_bio = 'PEM_ASN1_read_bio'; {Do not localize} - fn_PEM_ASN1_write_bio = 'PEM_ASN1_write_bio'; {Do not localize} - fn_PEM_X509_INFO_read_bio = 'PEM_X509_INFO_read_bio'; {Do not localize} - {CH fn_PEM_X509_INFO_write_bio = 'PEM_X509_INFO_write_bio'; } {Do not localize} - {CH fn_PEM_read = 'PEM_read'; } {Do not localize} - {CH fn_PEM_write = 'PEM_write'; } {Do not localize} - {CH fn_PEM_ASN1_read = 'PEM_ASN1_read'; } {Do not localize} - {CH fn_PEM_ASN1_write = 'PEM_ASN1_write'; } {Do not localize} - {CH fn_PEM_X509_INFO_read = 'PEM_X509_INFO_read'; } {Do not localize} - {CH fn_PEM_SealInit = 'PEM_SealInit'; } {Do not localize} - {CH fn_PEM_SealUpdate = 'PEM_SealUpdate'; } {Do not localize} - {CH fn_PEM_SealFinal = 'PEM_SealFinal'; } {Do not localize} - {CH fn_PEM_SignInit = 'PEM_SignInit'; } {Do not localize} - {CH fn_PEM_SignUpdate = 'PEM_SignUpdate'; } {Do not localize} - {CH fn_PEM_SignFinal = 'PEM_SignFinal'; } {Do not localize} - {CH fn_PEM_proc_type = 'PEM_proc_type'; } {Do not localize} - {CH fn_PEM_dek_info = 'PEM_dek_info'; } {Do not localize} - {$IFNDEF OPENSSL_NO_BIO} - {$IFNDEF SSLEAY_MACROS} - fn_PEM_read_bio_X509 = 'PEM_read_bio_X509'; {Do not localize} - fn_PEM_write_bio_X509 = 'PEM_write_bio_X509'; {Do not localize} - fn_PEM_read_bio_X509_REQ = 'PEM_read_bio_X509_REQ'; {Do not localize} - fn_PEM_write_bio_X509_REQ = 'PEM_write_bio_X509_REQ'; {Do not localize} - fn_PEM_read_bio_X509_CRL = 'PEM_read_bio_X509_CRL'; {Do not localize} - fn_PEM_write_bio_X509_CRL = 'PEM_write_bio_X509_CRL'; {Do not localize} - fn_PEM_read_bio_PKCS7 = 'PEM_read_bio_PKCS7'; {Do not localize} - fn_PEM_write_bio_PKCS7 = 'PEM_write_bio_PKCS7'; {Do not localize} - fn_PEM_read_bio_NETSCAPE_CERT_SEQUENCE = 'PEM_read_bio_NETSCAPE_CERT_SEQUENCE'; {Do not localize} - fn_PEM_write_bio_NETSCAPE_CERT_SEQUENCE = 'PEM_write_bio_NETSCAPE_CERT_SEQUENCE'; {Do not localize} - fn_PEM_read_bio_PKCS8 = 'PEM_read_bio_PKCS8'; {Do not localize} - fn_PEM_write_bio_PKCS8 = 'PEM_write_bio_PKCS8'; {Do not localize} - fn_PEM_read_bio_PKCS8_PRIV_KEY_INFO = 'PEM_read_bio_PKCS8_PRIV_KEY_INFO'; {Do not localize} - fn_PEM_write_bio_PKCS8_PRIV_KEY_INFO = 'PEM_write_bio_PKCS8_PRIV_KEY_INFO'; {Do not localize} - fn_PEM_read_bio_RSAPrivateKey = 'PEM_read_bio_RSAPrivateKey'; {Do not localize} - fn_PEM_write_bio_RSAPrivateKey = 'PEM_write_bio_RSAPrivateKey'; {Do not localize} - fn_PEM_read_bio_RSAPublicKey = 'PEM_read_bio_RSAPublicKey'; {Do not localize} - fn_PEM_write_bio_RSAPublicKey = 'PEM_write_bio_RSAPublicKey'; {Do not localize} - fn_PEM_read_bio_DSAPrivateKey = 'PEM_read_bio_DSAPrivateKey'; {Do not localize} - fn_PEM_write_bio_DSAPrivateKey = 'PEM_write_bio_DSAPrivateKey'; {Do not localize} - fn_PEM_read_bio_DSAparams = 'PEM_read_bio_DSAparams'; {Do not localize} - fn_PEM_write_bio_DSAparams = 'PEM_write_bio_DSAparams'; {Do not localize} - fn_PEM_read_bio_DHparams = 'PEM_read_bio_DHparams'; {Do not localize} - fn_PEM_write_bio_DHparams = 'PEM_write_bio_DHparams'; {Do not localize} - fn_PEM_read_bio_PrivateKey = 'PEM_read_bio_PrivateKey'; {Do not localize} - fn_PEM_write_bio_PrivateKey = 'PEM_write_bio_PrivateKey'; {Do not localize} - fn_PEM_write_bio_PKCS8PrivateKey = 'PEM_write_bio_PKCS8PrivateKey'; {Do not localize} - fn_PEM_read_bio_PUBKEY = 'PEM_read_bio_PUBKEY'; {Do not localize} - fn_PEM_write_bio_PUBKEY = 'PEM_write_bio_PUBKEY'; {Do not localize} - {$ENDIF} - {$ENDIF} - fn_PEM_read_bio_X509_AUX = 'PEM_read_bio_X509_AUX'; {Do not localize} - {CH fn_PEM_read_X509 = 'PEM_read_X509'; } {Do not localize} - {CH fn_PEM_write_X509 = 'PEM_write_X509'; } {Do not localize} - {CH fn_PEM_read_X509_REQ = 'PEM_read_X509_REQ'; } {Do not localize} - {CH fn_PEM_write_X509_REQ = 'PEM_write_X509_REQ'; } {Do not localize} - {CH fn_PEM_read_X509_CRL = 'PEM_read_X509_CRL'; } {Do not localize} - {CH fn_PEM_write_X509_CRL = 'PEM_write_X509_CRL'; } {Do not localize} - {CH fn_PEM_read_PKCS7 = 'PEM_read_PKCS7'; } {Do not localize} - {CH fn_PEM_write_PKCS7 = 'PEM_write_PKCS7'; } {Do not localize} - {CH fn_PEM_read_NETSCAPE_CERT_SEQUENCE = 'PEM_read_NETSCAPE_CERT_SEQUENCE'; } {Do not localize} - {CH fn_PEM_write_NETSCAPE_CERT_SEQUENCE = 'PEM_write_NETSCAPE_CERT_SEQUENCE'; } {Do not localize} - {CH fn_PEM_read_PKCS8 = 'PEM_read_PKCS8'; } {Do not localize} - {CH fn_PEM_write_PKCS8 = 'PEM_write_PKCS8'; } {Do not localize} - {CH fn_PEM_read_PKCS8_PRIV_KEY_INFO = 'PEM_read_PKCS8_PRIV_KEY_INFO'; } {Do not localize} - {CH fn_PEM_write_PKCS8_PRIV_KEY_INFO = 'PEM_write_PKCS8_PRIV_KEY_INFO'; } {Do not localize} - {CH fn_PEM_read_RSAPrivateKey = 'PEM_read_RSAPrivateKey'; } {Do not localize} - {CH fn_PEM_write_RSAPrivateKey = 'PEM_write_RSAPrivateKey'; } {Do not localize} - {CH fn_PEM_read_RSAPublicKey = 'PEM_read_RSAPublicKey'; } {Do not localize} - {CH fn_PEM_write_RSAPublicKey = 'PEM_write_RSAPublicKey'; } {Do not localize} - {CH fn_PEM_read_DSAPrivateKey = 'PEM_read_DSAPrivateKey'; } {Do not localize} - {CH fn_PEM_write_DSAPrivateKey = 'PEM_write_DSAPrivateKey'; } {Do not localize} - {CH fn_PEM_read_DSAparams = 'PEM_read_DSAparams'; } {Do not localize} - {CH fn_PEM_write_DSAparams = 'PEM_write_DSAparams'; } {Do not localize} - {CH fn_PEM_read_DHparams = 'PEM_read_DHparams'; } {Do not localize} - {CH fn_PEM_write_DHparams = 'PEM_write_DHparams'; } {Do not localize} - {CH fn_PEM_read_PrivateKey = 'PEM_read_PrivateKey'; } {Do not localize} - {CH fn_PEM_write_PrivateKey = 'PEM_write_PrivateKey'; } {Do not localize} - {CH fn_PEM_write_PKCS8PrivateKey = 'PEM_write_PKCS8PrivateKey'; } {Do not localize} - {CH fn_sk_SSL_CIPHER_new = 'sk_SSL_CIPHER_new'; } {Do not localize} - {CH fn_sk_SSL_CIPHER_new_null = 'sk_SSL_CIPHER_new_null'; } {Do not localize} - {CH fn_sk_SSL_CIPHER_free = 'sk_SSL_CIPHER_free'; } {Do not localize} - {CH fn_sk_SSL_CIPHER_num = 'sk_SSL_CIPHER_num'; } {Do not localize} - {CH fn_sk_SSL_CIPHER_value = 'sk_SSL_CIPHER_value'; } {Do not localize} - {CH fn_sk_SSL_CIPHER_set = 'sk_SSL_CIPHER_set'; } {Do not localize} - {CH fn_sk_SSL_CIPHER_zero = 'sk_SSL_CIPHER_zero'; } {Do not localize} - {CH fn_sk_SSL_CIPHER_push = 'sk_SSL_CIPHER_push'; } {Do not localize} - {CH fn_sk_SSL_CIPHER_unshift = 'sk_SSL_CIPHER_unshift'; } {Do not localize} - {CH fn_sk_SSL_CIPHER_find = 'sk_SSL_CIPHER_find'; } {Do not localize} - {CH fn_sk_SSL_CIPHER_delete = 'sk_SSL_CIPHER_delete'; } {Do not localize} - {CH fn_sk_SSL_CIPHER_delete_ptr = 'sk_SSL_CIPHER_delete_ptr'; } {Do not localize} - {CH fn_sk_SSL_CIPHER_insert = 'sk_SSL_CIPHER_insert'; } {Do not localize} - {CH fn_sk_SSL_CIPHER_dup = 'sk_SSL_CIPHER_dup'; } {Do not localize} - {CH fn_sk_SSL_CIPHER_pop_free = 'sk_SSL_CIPHER_pop_free'; } {Do not localize} - {CH fn_sk_SSL_CIPHER_shift = 'sk_SSL_CIPHER_shift'; } {Do not localize} - {CH fn_sk_SSL_CIPHER_pop = 'sk_SSL_CIPHER_pop'; } {Do not localize} - {CH fn_sk_SSL_CIPHER_sort = 'sk_SSL_CIPHER_sort'; } {Do not localize} - {CH fn_sk_SSL_COMP_new = 'sk_SSL_COMP_new'; } {Do not localize} - {CH fn_sk_SSL_COMP_new_null = 'sk_SSL_COMP_new_null'; } {Do not localize} - {CH fn_sk_SSL_COMP_free = 'sk_SSL_COMP_free'; } {Do not localize} - {CH fn_sk_SSL_COMP_num = 'sk_SSL_COMP_num'; } {Do not localize} - {CH fn_sk_SSL_COMP_value = 'sk_SSL_COMP_value'; } {Do not localize} - {CH fn_sk_SSL_COMP_set = 'sk_SSL_COMP_set'; } {Do not localize} - {CH fn_sk_SSL_COMP_zero = 'sk_SSL_COMP_zero'; } {Do not localize} - {CH fn_sk_SSL_COMP_push = 'sk_SSL_COMP_push'; } {Do not localize} - {CH fn_sk_SSL_COMP_unshift = 'sk_SSL_COMP_unshift'; } {Do not localize} - {CH fn_sk_SSL_COMP_find = 'sk_SSL_COMP_find'; } {Do not localize} - {CH fn_sk_SSL_COMP_delete = 'sk_SSL_COMP_delete'; } {Do not localize} - {CH fn_sk_SSL_COMP_delete_ptr = 'sk_SSL_COMP_delete_ptr'; } {Do not localize} - {CH fn_sk_SSL_COMP_insert = 'sk_SSL_COMP_insert'; } {Do not localize} - {CH fn_sk_SSL_COMP_dup = 'sk_SSL_COMP_dup'; } {Do not localize} - {CH fn_sk_SSL_COMP_pop_free = 'sk_SSL_COMP_pop_free'; } {Do not localize} - {CH fn_sk_SSL_COMP_shift = 'sk_SSL_COMP_shift'; } {Do not localize} - {CH fn_sk_SSL_COMP_pop = 'sk_SSL_COMP_pop'; } {Do not localize} - {CH fn_sk_SSL_COMP_sort = 'sk_SSL_COMP_sort'; } {Do not localize} - {$IFNDEF OPENSSL_NO_BIO} - {CH fn_BIO_f_ssl = 'BIO_f_ssl'; } {Do not localize} - {CH fn_BIO_new_ssl = 'BIO_new_ssl'; } {Do not localize} - {CH fn_BIO_new_ssl_connect = 'BIO_new_ssl_connect'; } {Do not localize} - {CH fn_BIO_new_buffer_ssl_connect = 'BIO_new_buffer_ssl_connect'; } {Do not localize} - {CH fn_BIO_ssl_copy_session_id = 'BIO_ssl_copy_session_id'; } {Do not localize} - {CH fn_BIO_ssl_shutdown = 'BIO_ssl_shutdown'; } {Do not localize} - {$ENDIF} - fn_SSL_CTX_set_cipher_list = 'SSL_CTX_set_cipher_list'; {Do not localize} - fn_SSL_CTX_new = 'SSL_CTX_new'; {Do not localize} - fn_SSL_CTX_free = 'SSL_CTX_free'; {Do not localize} - fn_SSL_callback_ctrl = 'SSL_callback_ctrl'; {Do not localize} - fn_SSL_CTX_callback_ctrl = 'SSL_CTX_callback_ctrl'; {Do not localize} - {CH fn_SSL_CTX_set_timeout = 'SSL_CTX_set_timeout'; } {Do not localize} - {CH fn_SSL_CTX_get_timeout = 'SSL_CTX_get_timeout'; } {Do not localize} - {CH fn_SSL_CTX_get_cert_store = 'SSL_CTX_get_cert_store'; } {Do not localize} - {CH fn_SSL_CTX_set_cert_store = 'SSL_CTX_set_cert_store'; } {Do not localize} - {CH fn_SSL_want = 'SSL_want'; } {Do not localize} - {CH fn_SSL_clear = 'SSL_clear'; } {Do not localize} - {CH fn_SSL_CTX_flush_sessions = 'SSL_CTX_flush_sessions'; } {Do not localize} - fn_SSL_get_current_cipher = 'SSL_get_current_cipher'; {Do not localize} - fn_SSL_CIPHER_get_bits = 'SSL_CIPHER_get_bits'; {Do not localize} - fn_SSL_CIPHER_get_version = 'SSL_CIPHER_get_version'; {Do not localize} - fn_SSL_CIPHER_get_name = 'SSL_CIPHER_get_name'; {Do not localize} - {CH fn_SSL_get_fd = 'SSL_get_fd'; } {Do not localize} - {CH fn_SSL_get_cipher_list = 'SSL_get_cipher_list'; } {Do not localize} - {CH fn_SSL_get_shared_ciphers = 'SSL_get_shared_ciphers'; } {Do not localize} - {CH fn_SSL_get_read_ahead = 'SSL_get_read_ahead'; } {Do not localize} - fn_SSL_pending = 'SSL_pending'; {Do not localize} - {$IFNDEF OPENSSL_NO_SOCK} - fn_SSL_set_fd = 'SSL_set_fd'; {Do not localize} - {CH fn_SSL_set_rfd = 'SSL_set_rfd'; } {Do not localize} - {CH fn_SSL_set_wfd = 'SSL_set_wfd'; } {Do not localize} - {$ENDIF} - {$IFNDEF OPENSSL_NO_BIO} - {CH fn_SSL_set_bio = 'SSL_set_bio'; } {Do not localize} - {CH fn_SSL_get_rbio = 'SSL_get_rbio'; } {Do not localize} - {CH fn_SSL_get_wbio = 'SSL_get_wbio'; } {Do not localize} - {$ENDIF} - {CH fn_SSL_set_cipher_list = 'SSL_set_cipher_list'; } {Do not localize} - {CH fn_SSL_set_read_ahead = 'SSL_set_read_ahead'; } {Do not localize} - {CH fn_SSL_get_verify_mode = 'SSL_get_verify_mode'; } {Do not localize} - {CH fn_SSL_get_verify_depth = 'SSL_get_verify_depth'; } {Do not localize} - {CH fn_SSL_set_verify = 'SSL_set_verify'; } {Do not localize} - {CH fn_SSL_set_verify_depth = 'SSL_set_verify_depth'; } {Do not localize} - {$IFNDEF OPENSSL_NO_RSA} - {CH fn_SSL_use_RSAPrivateKey = 'SSL_use_RSAPrivateKey'; } {Do not localize} - {CH fn_SSL_use_RSAPrivateKey_ASN1 = 'SSL_use_RSAPrivateKey_ASN1'; } {Do not localize} - {$ENDIF} - {CH fn_SSL_use_PrivateKey = 'SSL_use_PrivateKey'; } {Do not localize} - {CH fn_SSL_use_PrivateKey_ASN1 = 'SSL_use_PrivateKey_ASN1'; } {Do not localize} - {CH fn_SSL_use_certificate = 'SSL_use_certificate'; } {Do not localize} - {CH fn_SSL_use_certificate_ASN1 = 'SSL_use_certificate_ASN1'; } {Do not localize} - {CH fn_SSL_use_RSAPrivateKey_file = 'SSL_use_RSAPrivateKey_file'; } {Do not localize} - {CH fn_SSL_use_PrivateKey_file = 'SSL_use_PrivateKey_file'; } {Do not localize} - {CH fn_SSL_use_certificate_file = 'SSL_use_certificate_file'; } {Do not localize} - {$IFNDEF OPENSSL_NO_RSA} - {CH fn_SSL_CTX_use_RSAPrivateKey_file = 'SSL_CTX_use_RSAPrivateKey_file'; } {Do not localize} - {$ENDIF} - fn_SSL_CTX_use_PrivateKey_file = 'SSL_CTX_use_PrivateKey_file'; {Do not localize} - fn_SSL_CTX_use_certificate_file = 'SSL_CTX_use_certificate_file'; {Do not localize} - fn_SSL_CTX_use_certificate_chain_file = 'SSL_CTX_use_certificate_chain_file'; {Do not localize} - {$ifndef OPENSSL_NO_ENGINE} - {CH fn_SSL_CTX_set_client_cert_engine = 'SSL_CTX_set_client_cert_engine'; } {Do not localize} - {$endif} - {CH fn_SSL_CTX_use_certificate_chain_file = 'SSL_CTX_use_certificate_chain_file'; } {Do not localize} - fn_SSL_load_client_CA_file = 'SSL_load_client_CA_file'; {Do not localize} - {CH fn_SSL_add_file_cert_subjects_to_stack = 'SSL_add_file_cert_subjects_to_stack'; } {Do not localize} - {CH fn_ERR_load_SSL_strings = 'ERR_load_SSL_strings'; } {Do not localize} - fn_SSL_load_error_strings = 'SSL_load_error_strings'; {Do not localize} - {CH fn_SSL_state_string = 'SSL_state_string'; } {Do not localize} - {CH fn_SSL_rstate_string = 'SSL_rstate_string'; } {Do not localize} - fn_SSL_state_string_long = 'SSL_state_string_long'; {Do not localize} - {CH fn_SSL_rstate_string_long = 'SSL_rstate_string_long'; } {Do not localize} - {CH fn_SSL_SESSION_get_time = 'SSL_SESSION_get_time'; } {Do not localize} - {CH fn_SSL_SESSION_set_time = 'SSL_SESSION_set_time'; } {Do not localize} - {CH fn_SSL_SESSION_get_timeout = 'SSL_SESSION_get_timeout'; } {Do not localize} - {CH fn_SSL_SESSION_set_timeout = 'SSL_SESSION_set_timeout'; } {Do not localize} - fn_SSL_copy_session_id = 'SSL_copy_session_id'; {Do not localize} - {CH fn_SSL_SESSION_new = 'SSL_SESSION_new'; } {Do not localize} - {CH fn_SSL_SESSION_hash = 'SSL_SESSION_hash'; } {Do not localize} - {CH fn_SSL_SESSION_cmp = 'SSL_SESSION_cmp'; } {Do not localize} - {$IFNDEF OPENSSL_NO_FP_API} - {CH fn_SSL_SESSION_print_fp = 'SSL_SESSION_print_fp'; } {Do not localize} - {$ENDIF} - {$IFNDEF OPENSSL_NO_BIO} - {CH fn_SSL_SESSION_print = 'SSL_SESSION_print'; } {Do not localize} - {$ENDIF} - {CH fn_SSL_SESSION_free = 'SSL_SESSION_free'; } {Do not localize} - {CH fn_i2d_SSL_SESSION = 'i2d_SSL_SESSION'; } {Do not localize} - {CH fn_SSL_set_session = 'SSL_set_session'; } {Do not localize} - {CH fn_SSL_CTX_add_session = 'SSL_CTX_add_session'; } {Do not localize} - {CH fn_SSL_CTX_remove_session = 'SSL_CTX_remove_session'; } {Do not localize} - {CH fn_d2i_SSL_SESSION = 'd2i_SSL_SESSION'; } {Do not localize} - fn_SSL_get_peer_certificate = 'SSL_get_peer_certificate'; {Do not localize} - {CH fn_SSL_get_peer_cert_chain = 'SSL_get_peer_cert_chain'; } {Do not localize} - {CH fn_SSL_CTX_get_verify_mode = 'SSL_CTX_get_verify_mode'; } {Do not localize} - fn_SSL_CTX_get_verify_depth = 'SSL_CTX_get_verify_depth'; {Do not localize} - fn_SSL_CTX_set_verify = 'SSL_CTX_set_verify'; {Do not localize} - fn_SSL_CTX_set_verify_depth = 'SSL_CTX_set_verify_depth'; {Do not localize} - {CH fn_SSL_CTX_set_cert_verify_callback = 'SSL_CTX_set_cert_verify_callback'; } {Do not localize} - {CH fn_SSL_CTX_use_RSAPrivateKey = 'SSL_CTX_use_RSAPrivateKey'; } {Do not localize} - {CH fn_SSL_CTX_use_RSAPrivateKey_ASN1 = 'SSL_CTX_use_RSAPrivateKey_ASN1'; } {Do not localize} - fn_SSL_CTX_use_PrivateKey = 'SSL_CTX_use_PrivateKey'; {Do not localize} - {CH fn_SSL_CTX_use_PrivateKey_ASN1 = 'SSL_CTX_use_PrivateKey_ASN1'; } {Do not localize} - fn_SSL_CTX_use_certificate = 'SSL_CTX_use_certificate'; {Do not localize} - {CH fn_SSL_CTX_use_certificate_ASN1 = 'SSL_CTX_use_certificate_ASN1'; } {Do not localize} - fn_SSL_CTX_set_default_passwd_cb = 'SSL_CTX_set_default_passwd_cb'; {Do not localize} - fn_SSL_CTX_set_default_passwd_cb_userdata = 'SSL_CTX_set_default_passwd_cb_userdata'; {Do not localize} - fn_SSL_CTX_check_private_key = 'SSL_CTX_check_private_key'; {Do not localize} - {CH fn_SSL_check_private_key = 'SSL_check_private_key'; } {Do not localize} - fn_SSL_CTX_set_session_id_context = 'SSL_CTX_set_session_id_context'; {Do not localize} - fn_SSL_new = 'SSL_new'; {Do not localize} - {CH fn_SSL_set_session_id_context = 'SSL_set_session_id_context'; } {Do not localize} - fn_SSL_free = 'SSL_free'; {Do not localize} - fn_SSL_accept = 'SSL_accept'; {Do not localize} - fn_SSL_connect = 'SSL_connect'; {Do not localize} - fn_SSL_read = 'SSL_read'; {Do not localize} - fn_SSL_peek = 'SSL_peek'; {Do not localize} - fn_SSL_write = 'SSL_write'; {Do not localize} - fn_SSL_ctrl = 'SSL_ctrl'; {Do not localize} - fn_SSL_CTX_ctrl = 'SSL_CTX_ctrl'; {Do not localize} - fn_SSL_get_error = 'SSL_get_error'; {Do not localize} - {CH fn_SSL_get_version = 'SSL_get_version'; } {Do not localize} - {CH fn_SSL_CTX_set_ssl_version = 'SSL_CTX_set_ssl_version'; } {Do not localize} - fn_SSLv2_method = 'SSLv2_method'; {Do not localize} - fn_SSLv2_server_method = 'SSLv2_server_method'; {Do not localize} - fn_SSLv2_client_method = 'SSLv2_client_method'; {Do not localize} - fn_SSLv3_method = 'SSLv3_method'; {Do not localize} - fn_SSLv3_server_method = 'SSLv3_server_method'; {Do not localize} - fn_SSLv3_client_method = 'SSLv3_client_method'; {Do not localize} - fn_SSLv23_method = 'SSLv23_method'; {Do not localize} - fn_SSLv23_server_method = 'SSLv23_server_method'; {Do not localize} - fn_SSLv23_client_method = 'SSLv23_client_method'; {Do not localize} - fn_TLSv1_method = 'TLSv1_method'; {Do not localize} - fn_TLSv1_server_method = 'TLSv1_server_method'; {Do not localize} - fn_TLSv1_client_method = 'TLSv1_client_method'; {Do not localize} - fn_TLSv1_1_method = 'TLSv1_1_method'; {Do not localize} - fn_TLSv1_1_server_method = 'TLSv1_1_server_method'; {Do not localize} - fn_TLSv1_1_client_method = 'TLSv1_1_client_method'; {Do not localize} - fn_TLSv1_2_method = 'TLSv1_2_method'; {Do not localize} - fn_TLSv1_2_server_method = 'TLSv1_2_server_method'; {Do not localize} - fn_TLSv1_2_client_method = 'TLSv1_2_client_method'; {Do not localize} - fn_DTLSv1_method = 'DTLSv1_method'; {Do not localize} - fn_DTLSv1_server_method = 'DTLSv1_server_method'; {Do not localize} - fn_DTLSv1_client_method = 'DTLSv1_client_method'; {Do not localize} - {CH fn_SSL_get_ciphers = 'SSL_get_ciphers'; } {Do not localize} - {CH fn_SSL_do_handshake = 'SSL_do_handshake'; } {Do not localize} - {CH fn_SSL_renegotiate = 'SSL_renegotiate'; } {Do not localize} - fn_SSL_shutdown = 'SSL_shutdown'; {Do not localize} - {CH fn_SSL_get_ssl_method = 'SSL_get_ssl_method'; } {Do not localize} - {CH fn_SSL_set_ssl_method = 'SSL_set_ssl_method'; } {Do not localize} - fn_SSL_alert_type_string_long = 'SSL_alert_type_string_long'; {Do not localize} - {CH fn_SSL_alert_type_string = 'SSL_alert_type_string'; } {Do not localize} - fn_SSL_alert_desc_string_long = 'SSL_alert_desc_string_long'; {Do not localize} - {CH fn_SSL_alert_desc_string = 'SSL_alert_desc_string'; } {Do not localize} - {CH fn_SSL_set_client_CA_list = 'SSL_set_client_CA_list'; } {Do not localize} - fn_SSL_CTX_set_client_CA_list = 'SSL_CTX_set_client_CA_list'; {Do not localize} - {CH fn_SSL_get_client_CA_list = 'SSL_get_client_CA_list'; } {Do not localize} - {CH fn_SSL_CTX_get_client_CA_list = 'SSL_CTX_get_client_CA_list'; } {Do not localize} - {CH fn_SSL_add_client_CA = 'SSL_add_client_CA'; } {Do not localize} - {CH fn_SSL_CTX_add_client_CA = 'SSL_CTX_add_client_CA'; } {Do not localize} - fn_SSL_set_connect_state = 'SSL_set_connect_state'; {Do not localize} - fn_SSL_set_accept_state = 'SSL_set_accept_state'; {Do not localize} - {CH fn_SSL_get_default_timeout = 'SSL_get_default_timeout'; } {Do not localize} - {CH fn_SSL_library_init = 'SSL_library_init'; } {Do not localize} - fn_SSL_CIPHER_description = 'SSL_CIPHER_description'; {Do not localize} - {CH fn_SSL_dup_CA_list = 'SSL_dup_CA_list'; } {Do not localize} - {CH fn_SSL_dup = 'SSL_dup'; } {Do not localize} - {CH fn_SSL_get_certificate = 'SSL_get_certificate'; } {Do not localize} - {CH fn_SSL_get_privatekey = 'SSL_get_privatekey'; } {Do not localize} - {CH fn_SSL_CTX_set_quiet_shutdown = 'SSL_CTX_set_quiet_shutdown'; } {Do not localize} - {CH fn_SSL_CTX_get_quiet_shutdown = 'SSL_CTX_get_quiet_shutdown'; } {Do not localize} - {CH fn_SSL_set_quiet_shutdown = 'SSL_set_quiet_shutdown'; } {Do not localize} - {CH fn_SSL_get_quiet_shutdown = 'SSL_get_quiet_shutdown'; } {Do not localize} - fn_SSL_set_shutdown = 'SSL_set_shutdown'; {Do not localize} - {CH fn_SSL_get_shutdown = 'SSL_get_shutdown'; } {Do not localize} - {CH fn_SSL_version = 'SSL_version'; } {Do not localize} - fn_SSL_CTX_set_default_verify_paths = 'SSL_CTX_set_default_verify_paths'; {Do not localize} - fn_SSL_CTX_load_verify_locations = 'SSL_CTX_load_verify_locations'; {Do not localize} - fn_SSL_get_session = 'SSL_get_session'; {Do not localize} - {CH fn_SSL_get_SSL_CTX = 'SSL_get_SSL_CTX'; } {Do not localize} - {CH fn_SSL_set_SSL_CTX = 'SSL_set_SSL_CTX'; } {Do not localize} - {CH fn_OPENSSL_isservice = 'OPENSSL_isservice'; }{Do not localize} - {CH fn_SSL_set_info_callback = 'SSL_set_info_callback'; } {Do not localize} - {CH fn_SSL_state = 'SSL_state'; } {Do not localize} - - fn_SSL_set_verify_result = 'SSL_set_verify_result'; {Do not localize} - fn_SSL_get_verify_result = 'SSL_get_verify_result'; {Do not localize} - fn_SSL_set_ex_data = 'SSL_set_ex_data'; {Do not localize} - fn_SSL_get_ex_data = 'SSL_get_ex_data'; {Do not localize} - {CH fn_SSL_get_ex_new_index = 'SSL_get_ex_new_index'; } {Do not localize} - {CH fn_SSL_SESSION_set_ex_data = 'SSL_SESSION_set_ex_data'; } {Do not localize} - {CH fn_SSL_SESSION_get_ex_data = 'SSL_SESSION_get_ex_data'; } {Do not localize} - {CH fn_SSL_SESSION_get_ex_new_index = 'SSL_SESSION_get_ex_new_index'; } {Do not localize} - {CH fn_SSL_CTX_set_ex_data = 'SSL_CTX_set_ex_data'; } {Do not localize} - {CH fn_SSL_CTX_get_ex_data = 'SSL_CTX_get_ex_data'; } {Do not localize} - {CH fn_SSL_CTX_get_ex_new_index = 'SSL_CTX_get_ex_new_index'; } {Do not localize} - {CH fn_SSL_get_ex_data_X509_STORE_CTX_idx = 'SSL_get_ex_data_X509_STORE_CTX_idx'; } {Do not localize} - {$IFNDEF OPENSSL_NO_RSA} - {CH fn_SSL_CTX_set_tmp_rsa_callback = 'SSL_CTX_set_tmp_rsa_callback'; } {Do not localize} - {CH fn_SSL_set_tmp_rsa_callback = 'SSL_set_tmp_rsa_callback'; } {Do not localize} - {$ENDIF} - {$IFNDEF OPENSSL_NO_DH} - {CH fn_SSL_CTX_set_tmp_dh_callback = 'SSL_CTX_set_tmp_dh_callback'; } {Do not localize} - {CH fn_SSL_set_tmp_dh_callback = 'SSL_set_tmp_dh_callback'; } {Do not localize} - {$ENDIF} - {$IFNDEF OPENSSL_NO_ECDH} - {CH fn_SSL_CTX_set_tmp_ecdh_callback = 'SSL_CTX_set_tmp_ecdh_callback'; } {Do not localize} - {CH fn_SSL_set_tmp_ecdh_callback = 'SSL_set_tmp_ecdh_callback'; } {Do not localize} - {$ENDIF} - {CH fn_SSL_COMP_add_compression_method = 'SSL_COMP_add_compression_method'; } {Do not localize} - {CH fn_SSL_get_current_expansion = 'SSL_get_current_expansion'; } {Do not localize} - {CH fn_SSL_COMP_get_name = 'SSL_COMP_get_name'; } {Do not localize} - fn_SSL_COMP_get_compression_methods = 'SSL_COMP_get_compression_methods'; {Do not localize} - fn_SSL_COMP_free_compression_methods = 'SSL_COMP_free_compression_methods'; {Do not localize} - // GREGOR - //fn_SSLeay_add_ssl_algorithms = 'mi_SSLeay_add_ssl_algorithms'; {Do not localize} - //why does the function name not match? - // - // RLebeau: because it is not an actual function of its own to begin with. - // It is a precompiler macro that maps to another function - fn_SSLeay_add_ssl_algorithms = 'SSL_library_init'; {Do not localize} - fn_SSL_SESSION_get_id = 'SSL_SESSION_get_id'; {Do not localize} - {CH fn_SSL_is_init_finished = 'mi_SSL_is_init_finished'; } {Do not localize} - {CH fn_SSL_in_init = 'mi_SSL_in_init'; } {Do not localize} - {CH fn_SSL_in_before = 'mi_SSL_in_before'; } {Do not localize} - {CH fn_SSL_in_connect_init = 'mi_SSL_in_connect_init'; } {Do not localize} - {CH fn_SSL_in_accept_init = 'mi_SSL_in_accept_init'; } {Do not localize} - {CH fn_fopen = 'mi_fopen'; } {Do not localize} - {CH fn_fclose = 'mi_fclose'; } {Do not localize} - // - fn_PKCS12_create = 'PKCS12_create'; {Do not localize} - fn_i2d_PKCS12_bio = 'i2d_PKCS12_bio'; {Do not localize} - fn_PKCS12_free = 'PKCS12_free'; {Do not localize} - {CH fn_RAND_set_rand_method = 'RAND_set_rand_method'; } {Do not localize} - {CH fn_RAND_get_rand_method = 'RAND_get_rand_method'; } {Do not localize} - {$IFNDEF OPENSSL_NO_ENGINE} - {CH fn_RAND_set_rand_engine = 'RAND_set_rand_engine'; } {Do not localize} - {$ENDIF} - {CH fn_RAND_SSLeay = 'RAND_SSLeay'; } {Do not localize} - fn_RAND_cleanup = 'RAND_cleanup'; {Do not localize} - fn_RAND_bytes = 'RAND_bytes'; {Do not localize} - fn_RAND_pseudo_bytes = 'RAND_pseudo_bytes'; {Do not localize} - fn_RAND_seed = 'RAND_seed'; {Do not localize} - fn_RAND_add = 'RAND_add'; {Do not localize} - {CH fn_RAND_load_file = 'RAND_load_file'; } {Do not localize} - {CH fn_RAND_write_file = 'RAND_write_file'; } {Do not localize} - {CH fn_RAND_file_name = 'RAND_file_name'; } {Do not localize} - fn_RAND_status = 'RAND_status'; {Do not localize} - {CH fn_RAND_query_egd_bytes = 'RAND_query_egd_bytes'; } {Do not localize} - {CH fn_RAND_egd = 'RAND_egd'; } {Do not localize} - {CH fn_RAND_egd_bytes = 'RAND_egd_bytes'; } {Do not localize} - {CH fn_RAND_poll = 'RAND_poll'; } {Do not localize} - {$IFDEF SYS_WIN} - //GREGOR - fn_RAND_screen = 'RAND_screen'; {Do not localize} - fn_RAND_event = 'RAND_event'; {Do not localize} - {$ENDIF} - {CH fn_ERR_load_RAND_strings = 'ERR_load_RAND_strings'; } {Do not localize} - //experimental - fn_ERR_put_error = 'ERR_put_error'; {Do not localize} - fn_ERR_get_error = 'ERR_get_error'; {Do not localize} -{CH fn_ERR_get_error_line = 'ERR_get_error_line'; } {Do not localize} -{CH fn_ERR_get_error_line_data = 'ERR_get_error_line_data'; } {Do not localize} - fn_ERR_peek_error = 'ERR_peek_error'; {Do not localize} - fn_ERR_peek_last_error = 'ERR_peek_last_error'; {Do not localize} - {CH fn_ERR_peek_error_line = 'ERR_peek_error_line'; } {Do not localize} -{CH fn_ERR_peek_error_line_data = 'ERR_peek_error_line_data'; } {Do not localize} - fn_ERR_peek_last_error_line = 'ERR_peek_last_error_line'; {Do not localize} -{CH fn_ERR_peek_last_error_line_data = 'ERR_peek_last_error_line_data'; } {Do not localize} - fn_ERR_clear_error = 'ERR_clear_error'; {Do not localize} - fn_ERR_error_string = 'ERR_error_string'; {Do not localize} - fn_ERR_error_string_n = 'ERR_error_string_n'; {Do not localize} - fn_ERR_lib_error_string = 'ERR_lib_error_string'; {Do not localize} - fn_ERR_func_error_string = 'ERR_func_error_string'; {Do not localize} - fn_ERR_reason_error_string = 'ERR_reason_error_string'; {Do not localize} -{CH fn_ERR_print_errors_cb = 'ERR_print_errors_cb'; } {Do not localize} - {$IFNDEF OPENSSL_NO_FP_API} -{CH fn_ERR_print_errors_fp = 'ERR_print_errors_fp'; } {Do not localize} - {$ENDIF} - {$IFNDEF OPENSSL_NO_BIO} -{CH fn_ERR_print_errors = 'ERR_print_errors'; } {Do not localize} -{CH fn_ERR_add_error_data = 'ERR_add_error_data'; } {Do not localize} - {$ENDIF} - fn_ERR_load_ERR_strings = 'ERR_load_ERR_strings'; {Do not localize} - fn_ERR_free_strings = 'ERR_free_strings'; {do not localize} - fn_ERR_remove_thread_state = 'ERR_remove_thread_state'; {Do not localize} - fn_ERR_remove_state = 'ERR_remove_state'; {do not localize} -{CH fn_ERR_unload_strings = 'ERR_unload_strings'; } {Do not localize} -{CH fn_ERR_remove_thread_state = 'ERR_remove_thread_state'; } {Do not localize} -{CH fn_ERR_load_ERR_strings = 'ERR_load_ERR_strings'; } {Do not localize} -{CH fn_ERR_load_crypto_strings = 'ERR_load_crypto_strings'; } {Do not localize} -{CH fn_ERR_free_strings = 'ERR_free_strings'; } {Do not localize} -{CH fn_ERR_add_error_vdata = 'ERR_add_error_vdata'; } {Do not localize} -{CH fn_ERR_remove_state = 'ERR_remove_state'; } {Do not localize} -{CH fn_ERR_get_state = 'ERR_get_state'; } {Do not localize} - {$IFNDEF OPENSSL_NO_LHASH} - {CH fn_ERR_get_string_table = 'ERR_get_string_table'; } {Do not localize} - {CH fn_ERR_get_err_state_table = 'ERR_get_err_state_table'; } {Do not localize} - {CH fn_ERR_release_err_state_table = 'ERR_release_err_state_table'; } {Do not localize} - {$ENDIF} - {CH fn_ERR_get_next_error_library = 'ERR_get_next_error_library'; } {Do not localize} - {CH fn_ERR_set_mark = 'ERR_set_mark'; } {Do not localize} - {CH fn_ERR_pop_to_mark = 'ERR_pop_to_mark'; } {Do not localize} - {$IFDEF OPENSSL_FIPS} - {CH fn_int_ERR_set_state_func = 'int_ERR_set_state_func'; } {Do not localize} - {CH fn_int_ERR_lib_init = 'int_ERR_lib_init'; } {Do not localize} - {$ENDIF} - {CH fn_UI_new = 'UI_new'; } {Do not localize} - {CH fn_UI_new_method = 'UI_new_method'; } {Do not localize} - {CH fn_UI_free = 'UI_free'; } {Do not localize} - {CH fn_UI_add_input_string = 'UI_add_input_string'; } {Do not localize} - {CH fn_UI_dup_input_string = 'UI_dup_input_string'; } {Do not localize} - {CH fn_UI_add_verify_string = 'UI_add_verify_string'; } {Do not localize} - {CH fn_UI_dup_verify_string = 'UI_dup_verify_string'; } {Do not localize} - {CH fn_UI_add_input_boolean = 'UI_add_input_boolean'; } {Do not localize} - {CH fn_UI_dup_input_boolean = 'UI_dup_input_boolean'; } {Do not localize} - {CH fn_UI_add_info_string = 'UI_add_info_string'; } {Do not localize} - {CH fn_UI_dup_info_string = 'UI_dup_info_string'; } {Do not localize} - {CH fn_UI_add_error_string = 'UI_add_error_string'; } {Do not localize} - {CH fn_UI_dup_error_string = 'UI_dup_error_string'; } {Do not localize} - {CH fn_UI_construct_prompt = 'UI_construct_prompt'; } {Do not localize} - {CH fn_UI_add_user_data = 'UI_add_user_data'; } {Do not localize} - {CH fn_UI_get0_user_data = 'UI_get0_user_data'; } {Do not localize} - {CH fn_UI_get0_resul = 'UI_get0_resul'; } {Do not localize} - {CH fn_UI_process = 'UI_process'; } {Do not localize} - {CH fn_UI_ctrl = 'UI_ctrl'; } {Do not localize} - {CH fn_UI_get_ex_new_index = 'UI_get_ex_new_index'; } {Do not localize} - {CH fn_UI_set_ex_data = 'UI_set_ex_data'; } {Do not localize} - {CH fn_UI_get_ex_data = 'UI_get_ex_data'; } {Do not localize} - {CH fn_UI_set_default_method = 'UI_set_default_method'; } {Do not localize} - {CH fn_UI_get_method = 'UI_get_method'; } {Do not localize} - {CH fn_UI_set_method = 'UI_set_method'; } {Do not localize} - {CH fn_UI_OpenSSL = 'UI_OpenSSL'; } {Do not localize} - {CH fn_UI_create_method = 'UI_create_method'; } {Do not localize} - {CH fn_UI_destroy_method = 'UI_destroy_method'; } {Do not localize} - {CH fn_UI_method_set_opener = 'UI_method_set_opener'; } {Do not localize} - {CH fn_UI_method_set_writer = 'UI_method_set_writer'; } {Do not localize} - {CH fn_UI_method_set_flusher = 'UI_method_set_flusher'; } {Do not localize} - {CH fn_UI_method_set_reader = 'UI_method_set_reader'; } {Do not localize} - {CH fn_UI_method_set_closer = 'UI_method_set_closer'; } {Do not localize} - {CH fn_UI_get_string_type = 'UI_get_string_type'; } {Do not localize} - {CH fn_UI_get_input_flags = 'UI_get_input_flags'; } {Do not localize} - {CH fn_UI_get0_output_string = 'UI_get0_output_string'; } {Do not localize} - {CH fn_UI_get0_action_string = 'UI_get0_action_string'; } {Do not localize} - {CH fn_UI_get0_result_string = 'UI_get0_result_string'; } {Do not localize} - {CH fn_UI_get0_test_string = 'UI_get0_test_string'; } {Do not localize} - {CH fn_UI_get_result_minsize = 'UI_get_result_minsize'; } {Do not localize} - {CH fn_UI_get_result_maxsize = 'UI_get_result_maxsize'; } {Do not localize} - {CH fn_UI_set_result = 'UI_set_result'; } {Do not localize} - {CH fn_UI_UTIL_read_pw_string = 'UI_UTIL_read_pw_string'; } {Do not localize} - {CH fn_UI_UTIL_read_pw = 'UI_UTIL_read_pw'; } {Do not localize} - {CH fn_ERR_load_UI_strings = 'ERR_load_UI_strings'; } {Do not localize} - {$IFNDEF OPENSSL_NO_ENGINE} - {CH fn_ENGINE_get_first = 'ENGINE_get_first'; } {Do not localize} - {CH fn_ENGINE_get_last = 'ENGINE_get_last'; } {Do not localize} - {CH fn_ENGINE_get_next = 'ENGINE_get_next'; } {Do not localize} - {CH fn_ENGINE_get_prev = 'ENGINE_get_prev'; } {Do not localize} - {CH fn_ENGINE_add = 'ENGINE_add'; } {Do not localize} - {CH fn_ENGINE_remove = 'ENGINE_remove'; } {Do not localize} - {CH fn_ENGINE_by_id = 'ENGINE_by_id'; } {Do not localize} - {CH fn_ENGINE_load_openssl = 'ENGINE_load_openssl'; } {Do not localize} - {CH fn_ENGINE_load_dynamic = 'ENGINE_load_dynamic'; } {Do not localize} - {$IFNDEF OPENSSL_NO_STATIC_ENGINE} - {CH fn_ENGINE_load_4758cca = 'ENGINE_load_4758cca'; } {Do not localize} - {CH fn_ENGINE_load_aep = 'ENGINE_load_aep'; } {Do not localize} - {CH fn_ENGINE_load_atalla = 'ENGINE_load_atalla'; } {Do not localize} - {CH fn_ENGINE_load_chil = 'ENGINE_load_chil'; } {Do not localize} - {CH fn_ENGINE_load_cswift = 'ENGINE_load_cswift'; } {Do not localize} - {$IFNDEF OPENSSL_NO_GMP} - {CH fn_ENGINE_load_gmp = 'ENGINE_load_gmp'; } {Do not localize} - {$ENDIF} - {CH fn_ENGINE_load_nuron = 'ENGINE_load_nuron'; } {Do not localize} - {CH fn_ENGINE_load_sureware = 'ENGINE_load_sureware'; } {Do not localize} - {CH fn_ENGINE_load_ubsec = 'ENGINE_load_ubsec'; } {Do not localize} - {$ENDIF} - {CH fn_ENGINE_load_cryptodev = 'ENGINE_load_cryptodev'; } {Do not localize} - {CH fn_ENGINE_load_padlock = 'ENGINE_load_padlock'; } {Do not localize} - {CH fn_ENGINE_load_builtin_engines = 'ENGINE_load_builtin_engines'; } {Do not localize} - {$IFDEF WIN32_OR_WIN64} - {$IFNDEF OPENSSL_NO_CAPIENG} - {CH fn_ENGINE_load_capi = 'ENGINE_load_capi'; } {Do not localize} - {$ENDIF} - {$ENDIF} - {CH fn_ENGINE_get_table_flags = 'ENGINE_get_table_flags'; } {Do not localize} - {CH fn_ENGINE_set_table_flags = 'ENGINE_set_table_flags'; } {Do not localize} - {CH fn_ENGINE_register_RSA = 'ENGINE_register_RSA'; } {Do not localize} - {CH fn_ENGINE_unregister_RSA = 'ENGINE_unregister_RSA'; } {Do not localize} - {CH fn_ENGINE_register_all_RSA = 'ENGINE_register_all_RSA'; } {Do not localize} - {CH fn_ENGINE_register_DSA = 'ENGINE_register_DSA'; } {Do not localize} - {CH fn_ENGINE_unregister_DSA = 'ENGINE_unregister_DSA'; } {Do not localize} - {CH fn_ENGINE_register_all_DSA = 'ENGINE_register_all_DSA'; } {Do not localize} - {CH fn_ENGINE_register_ECDH = 'ENGINE_register_ECDH'; } {Do not localize} - {CH fn_ENGINE_unregister_ECDH = 'ENGINE_unregister_ECDH'; } {Do not localize} - {CH fn_ENGINE_register_all_ECDH = 'ENGINE_register_all_ECDH'; } {Do not localize} - {CH fn_ENGINE_register_ECDSA = 'ENGINE_register_ECDSA'; } {Do not localize} - {CH fn_ENGINE_unregister_ECDSA = 'ENGINE_unregister_ECDSA'; } {Do not localize} - {CH fn_ENGINE_register_all_ECDSA = 'ENGINE_register_all_ECDSA'; } {Do not localize} - {CH fn_ENGINE_register_DH = 'ENGINE_register_DH'; } {Do not localize} - {CH fn_ENGINE_unregister_DH = 'ENGINE_unregister_DH'; } {Do not localize} - {CH fn_ENGINE_register_all_DH = 'ENGINE_register_all_DH'; } {Do not localize} - {CH fn_ENGINE_register_RAND = 'ENGINE_register_RAND'; } {Do not localize} - {CH fn_ENGINE_unregister_RAND = 'ENGINE_unregister_RAND'; } {Do not localize} - {CH fn_ENGINE_register_all_RAND = 'ENGINE_register_all_RAND'; } {Do not localize} - {CH fn_ENGINE_register_STORE = 'ENGINE_register_STORE'; } {Do not localize} - {CH fn_ENGINE_unregister_STORE = 'ENGINE_unregister_STORE'; } {Do not localize} - {CH fn_ENGINE_register_all_STORE = 'ENGINE_register_all_STORE'; } {Do not localize} - {CH fn_ENGINE_register_ciphers = 'ENGINE_register_ciphers'; } {Do not localize} - {CH fn_ENGINE_unregister_ciphers = 'ENGINE_unregister_ciphers'; } {Do not localize} - {CH fn_ENGINE_register_all_ciphers = 'ENGINE_register_all_ciphers'; } {Do not localize} - {CH fn_ENGINE_register_digests = 'ENGINE_register_digests'; } {Do not localize} - {CH fn_ENGINE_unregister_digests = 'ENGINE_unregister_digests'; } {Do not localize} - {CH fn_ENGINE_register_all_digests= 'ENGINE_register_all_digests'; } {Do not localize} - {CH fn_ENGINE_register_complete = 'ENGINE_register_complete'; } {Do not localize} - {CH fn_ENGINE_register_all_complete = 'ENGINE_register_all_complete'; } {Do not localize} - {CH fn_ENGINE_ctrl = 'ENGINE_ctrl'; } {Do not localize} - {CH fn_ENGINE_cmd_is_executable = 'ENGINE_cmd_is_executable'; } {Do not localize} - {CH fn_ENGINE_ctrl_cmd = 'ENGINE_ctrl_cmd'; } {Do not localize} - {CH fn_ENGINE_ctrl_cmd_string = 'ENGINE_ctrl_cmd_string'; } {Do not localize} - {CH fn_ENGINE_new = 'ENGINE_new'; } {Do not localize} - {CH fn_ENGINE_free = 'ENGINE_free'; } {Do not localize} - {CH fn_ENGINE_up_ref = 'ENGINE_up_ref'; } {Do not localize} - {CH fn_ENGINE_set_id = 'ENGINE_set_id'; } {Do not localize} - {CH fn_ENGINE_set_name = 'ENGINE_set_name'; } {Do not localize} - {CH fn_ENGINE_set_RSA = 'ENGINE_set_RSA'; } {Do not localize} - {CH fn_ENGINE_set_DSA = 'ENGINE_set_DSA'; } {Do not localize} - {CH fn_ENGINE_set_ECDH = 'ENGINE_set_ECDH'; } {Do not localize} - {CH fn_ENGINE_set_ECDSA = 'ENGINE_set_ECDSA'; } {Do not localize} - {CH fn_ENGINE_set_DH = 'ENGINE_set_DH'; } {Do not localize} - {CH fn_ENGINE_set_RAND = 'ENGINE_set_RAND'; } {Do not localize} - {CH fn_ENGINE_set_STORE = 'ENGINE_set_STORE'; } {Do not localize} - {CH fn_ENGINE_set_destroy_function = 'ENGINE_set_destroy_function'; } {Do not localize} - {CH fn_ENGINE_set_init_function = 'ENGINE_set_init_function'; } {Do not localize} - {CH fn_ENGINE_set_finish_function = 'ENGINE_set_finish_function'; } {Do not localize} - {CH fn_ENGINE_set_ctrl_function = 'ENGINE_set_ctrl_function'; } {Do not localize} - {CH fn_ENGINE_set_load_privkey_function = 'ENGINE_set_load_privkey_function'; } {Do not localize} - {CH fn_ENGINE_set_load_pubkey_function = 'ENGINE_set_load_pubkey_function'; } {Do not localize} - {CH fn_ENGINE_set_load_ssl_client_cert_function = 'ENGINE_set_load_ssl_client_cert_function'; } {Do not localize} - {CH fn_ENGINE_set_ciphers = 'ENGINE_set_ciphers'; } {Do not localize} - {CH fn_ENGINE_set_digests = 'ENGINE_set_digests'; } {Do not localize} - {CH fn_ENGINE_set_flags = 'ENGINE_set_flags'; } {Do not localize} - {CH fn_ENGINE_set_cmd_defns = 'ENGINE_set_cmd_defns'; } {Do not localize} - {CH fn_ENGINE_get_ex_new_index = 'ENGINE_get_ex_new_index'; } {Do not localize} - {CH fn_ENGINE_set_ex_data = 'ENGINE_set_ex_data'; } {Do not localize} - {CH fn_ENGINE_get_ex_data = 'ENGINE_get_ex_data'; } {Do not localize} - {CH fn_ENGINE_cleanup = 'ENGINE_cleanup'; } {Do not localize} - {CH fn_ENGINE_get_id = 'ENGINE_get_id'; } {Do not localize} - {CH fn_ENGINE_get_name = 'ENGINE_get_name'; } {Do not localize} - {CH fn_ENGINE_get_RSA = 'ENGINE_get_RSA'; } {Do not localize} - {CH fn_ENGINE_get_DSA = 'ENGINE_get_DSA'; } {Do not localize} - {CH fn_ENGINE_get_ECDH = 'ENGINE_get_ECDH'; } {Do not localize} - {CH fn_ENGINE_get_ECDSA = 'ENGINE_get_ECDSA'; } {Do not localize} - {CH fn_ENGINE_get_DH = 'ENGINE_get_DH'; } {Do not localize} - {CH fn_ENGINE_get_RAND = 'ENGINE_get_RAND'; } {Do not localize} - {CH fn_ENGINE_get_STORE = 'ENGINE_get_STORE'; } {Do not localize} - {CH fn_ENGINE_get_destroy_function = 'ENGINE_get_destroy_function'; } {Do not localize} - {CH fn_ENGINE_get_init_function = 'ENGINE_get_init_function'; } {Do not localize} - {CH fn_ENGINE_get_finish_function = 'ENGINE_get_finish_function'; } {Do not localize} - {CH fn_ENGINE_get_ctrl_function = 'ENGINE_get_ctrl_function'; } {Do not localize} - {CH fn_ENGINE_get_load_privkey_function = 'ENGINE_get_load_privkey_function'; } {Do not localize} - {CH fn_ENGINE_get_load_pubkey_function = 'ENGINE_get_load_pubkey_function'; } {Do not localize} - {CH fn_ENGINE_get_ssl_client_cert_function = 'ENGINE_get_ssl_client_cert_function'; } {Do not localize} - {CH fn_ENGINE_get_ciphers = 'ENGINE_get_ciphers'; } {Do not localize} - {CH fn_ENGINE_get_digests = 'ENGINE_get_digests'; } {Do not localize} - {CH fn_ENGINE_get_cipher = 'ENGINE_get_cipher'; } {Do not localize} - {CH fn_ENGINE_get_digest = 'ENGINE_get_digest'; } {Do not localize} - {CH fn_ENGINE_get_cmd_defns = 'ENGINE_get_cmd_defns'; } {Do not localize} - {CH fn_ENGINE_get_flags = 'ENGINE_get_flags'; } {Do not localize} - {CH fn_ENGINE_init = 'ENGINE_init'; } {Do not localize} - {CH fn_ENGINE_finish = 'ENGINE_finish'; } {Do not localize} - {CH fn_ENGINE_load_private_key = 'ENGINE_load_private_key'; } {Do not localize} - {CH fn_ENGINE_load_public_key = 'ENGINE_load_public_key'; } {Do not localize} - {CH fn_ENGINE_load_ssl_client_cert = 'ENGINE_load_ssl_client_cert'; } {Do not localize} - {CH fn_ENGINE_get_default_RSA = 'ENGINE_get_default_RSA'; } {Do not localize} - {CH fn_ENGINE_get_default_DSA = 'ENGINE_get_default_DSA'; } {Do not localize} - {CH fn_ENGINE_get_default_ECDH = 'ENGINE_get_default_ECDH'; } {Do not localize} - {CH fn_ENGINE_get_default_ECDSA = 'ENGINE_get_default_ECDSA'; } {Do not localize} - {CH fn_ENGINE_get_default_DH = 'ENGINE_get_default_DH'; } {Do not localize} - {CH fn_ENGINE_get_default_RAND = 'ENGINE_get_default_RAND'; } {Do not localize} - {CH fn_ENGINE_get_cipher_engine = 'ENGINE_get_cipher_engine'; } {Do not localize} - {CH fn_ENGINE_get_digest_engine = 'ENGINE_get_digest_engine'; } {Do not localize} - {CH fn_ENGINE_set_default_RSA = 'ENGINE_set_default_RSA'; } {Do not localize} - {CH fn_ENGINE_set_default_string = 'ENGINE_set_default_string'; } {Do not localize} - {CH fn_ENGINE_set_default_DSA = 'ENGINE_set_default_DSA'; } {Do not localize} - {CH fn_ENGINE_set_default_ECDH = 'ENGINE_set_default_ECDH'; } {Do not localize} - {CH fn_ENGINE_set_default_ECDSA = 'ENGINE_set_default_ECDSA'; } {Do not localize} - {CH fn_ENGINE_set_default_DH = 'ENGINE_set_default_DH'; } {do not localize} - {CH fn_ENGINE_set_default_RAND = 'ENGINE_set_default_RAND'; } {Do not localize} - {CH fn_ENGINE_set_default_ciphers = 'ENGINE_set_default_ciphers'; } {Do not localize} - {CH fn_ENGINE_set_default_digests = 'ENGINE_set_default_digests'; } {Do not localize} - {CH fn_ENGINE_set_default = 'ENGINE_set_default'; } {Do not localize} - {CH fn_ENGINE_add_conf_module = 'ENGINE_add_conf_module'; } {Do not localize} - {CH fn_ENGINE_get_static_state = 'ENGINE_get_static_state'; } {Do not localize} - {$IFDEF OPENBSD} - {CH fn_ENGINE_setup_bsd_cryptodev = 'ENGINE_setup_bsd_cryptodev'; } {Do not localize} - {$ENDIF} - {$IFDEF FREEBSD} - {CH fn_ENGINE_setup_bsd_cryptodev = 'ENGINE_setup_bsd_cryptodev'; } {Do not localize} - {$ENDIF} - {CH fn_ERR_load_ENGINE_strings = 'ERR_load_ENGINE_strings'; } {Do not localize} - {$ENDIF} - {$IFDEF OPENSSL_EXPORT_VAR_AS_FUNCTION} - //These have a gl prefix because they may not be functions in some platforms. - //They are functions in Win32 because DLL's can't export global variables - //while Unix shared objects may expose them. - {CH gl_ASN1_OBJECT_it = 'ASN1_OBJECT_it'; } {do not localize} - {CH gl_ASN1_OCTET_STRING_NDEF_it = 'ASN1_OCTET_STRING_NDEF_it'; } {Do not localize} - {CH gl_ASN1_BOOLEAN_it = 'ASN1_BOOLEAN_it'; } {Do not localize} - {CH gl_ASN1_SEQUENCE_it = 'ASN1_SEQUENCE_it'; } {Do not localize} - {CH gl_CBIGNUM_it = 'CBIGNUM_it'; } {Do not localize} - {CH gl_BIGNUM_it = 'BIGNUM_it'; } {Do not localize} - {CH gl_LONG_it = 'LONG_it'; } {Do not localize} - {CH gl_ZLONG_it = 'ZLONG_it'; } {Do not localize} - {CH gl_POLICY_MAPPING_it = 'POLICY_MAPPING_it'; } {Do not localize} - {CH gl_POLICY_MAPPINGS_it = 'POLICY_MAPPINGS_it'; } {Do not localize} - {CH gl_GENERAL_SUBTREE_it = 'GENERAL_SUBTREE_it'; } {Do not localize} - {CH gl_NAME_CONSTRAINTS_it = 'NAME_CONSTRAINTS_it'; } {Do not localize} - {CH gl_POLICY_CONSTRAINTS_it = 'POLICY_CONSTRAINTS_it'; } {Do not localize} - {$ENDIF} - - -function LoadFunction(const FceName: TIdLibFuncName; const ACritical : Boolean = True): Pointer; -{$IFDEF WINDOWS} -var - Err: DWORD; -{$ENDIF} -begin - Result := LoadLibFunction(hIdSSL, FceName); - if (Result <> nil) or (not ACritical) then begin - Exit; - end; - {$IFDEF WINDOWS} - Err := GetLastError(); - if Err <> ERROR_PROC_NOT_FOUND then begin - FFailedLoadList.Add(IndyFormat(RSOSSMissingExport_WithErrCode, [FceName, Err])); - Exit; - end; - {$ELSE} - // TODO: add error code to message... - {$ENDIF} - FFailedLoadList.Add(FceName); -end; - -function LoadFunctionCLib(const FceName: TIdLibFuncName; const ACritical : Boolean = True): Pointer; -{$IFDEF WINDOWS} -var - Err: DWORD; -{$ENDIF} -begin - Result := LoadLibFunction(hIdCrypto, FceName); - if (Result <> nil) or (not ACritical) then begin - Exit; - end; - {$IFDEF WINDOWS} - Err := GetLastError(); - if Err <> ERROR_PROC_NOT_FOUND then begin - FFailedLoadList.Add(IndyFormat(RSOSSMissingExport_WithErrCode, [FceName, Err])); - Exit; - end; - {$ELSE} - // TODO: add error code to message... - {$ENDIF} - FFailedLoadList.Add(FceName); -end; - -// Id_ossl_old_des_set_odd_parity -{ -IMPORTANT!!! - -Indy DES support probably had been written to use some old "des_" functions. -The OpenSSL developers changed that interface to a new "des_*" API. They have some - "_ossl_old_des_*" for backwards compatability with the old functions - which are defined in des_old.h. -} -function LoadOldCLib(const AOldName, ANewName : TIdLibFuncName; const ACritical : Boolean = True): Pointer; -{$IFDEF WINDOWS} -var - Err: DWORD; -{$ENDIF} -begin - Result := LoadLibFunction(hIdCrypto, AOldName); - if Result <> nil then begin - Exit; - end; - {$IFDEF WINDOWS} - if ACritical then begin - Err := GetLastError(); - if Err <> ERROR_PROC_NOT_FOUND then begin - FFailedLoadList.Add(IndyFormat(RSOSSMissingExport_WithErrCode, [AOldName, Err])); - Exit; - end; - end; - {$ENDIF} - Result := LoadLibFunction(hIdCrypto, ANewName); - if (Result <> nil) or (not ACritical) then begin - Exit; - end; - {$IFDEF WINDOWS} - Err := GetLastError(); - if Err <> ERROR_PROC_NOT_FOUND then begin - FFailedLoadList.Add(IndyFormat(RSOSSMissingExport_WithErrCode, [ANewName, Err])); - Exit; - end; - {$ELSE} - // TODO: add error code to message... - {$ENDIF} - FFailedLoadList.Add(AOldName); -end; - -{$ENDIF} // STATICLOAD_OPENSSL - -// remove this function, it is not used -function ErrMsg(AErr : TIdC_ULONG) : string; -const - sMaxErrStr = 300; -var - LString: array[0..sMaxErrStr] of TIdAnsiChar; - {$IFDEF USE_MARSHALLED_PTRS} - LStringPtr: TPtrWrapper; - {$ENDIF} -begin - {$IFDEF USE_MARSHALLED_PTRS} - LStringPtr := TPtrWrapper.Create(@LString[0]); - {$ENDIF} - ERR_error_string_n(AErr, - {$IFDEF USE_MARSHALLED_PTRS} - LStringPtr.ToPointer - {$ELSE} - LString - {$ENDIF}, sMaxErrStr); - LString[sMaxErrStr] := TIdAnsiChar(0); - {$IFDEF USE_MARSHALLED_PTRS} - Result := TMarshal.ReadStringAsAnsi(LStringPtr); - {$ELSE} - Result := String(LString); - {$ENDIF} -end; - -{$IFNDEF STATICLOAD_OPENSSL} - -{$UNDEF USE_BASEUNIX_OR_VCL_POSIX} -{$IFDEF USE_BASEUNIX} - {$DEFINE USE_BASEUNIX_OR_VCL_POSIX} -{$ENDIF} -{$IFDEF USE_VCL_POSIX} - {$DEFINE USE_BASEUNIX_OR_VCL_POSIX} -{$ENDIF} - -{$UNDEF USE_BASEUNIX_OR_VCL_POSIX_OR_KYLIXCOMPAT} -{$IFDEF USE_BASEUNIX_OR_VCL_POSIX} - {$DEFINE USE_BASEUNIX_OR_VCL_POSIX_OR_KYLIXCOMPAT} -{$ENDIF} -{$IFDEF KYLIXCOMPAT} - {$DEFINE USE_BASEUNIX_OR_VCL_POSIX_OR_KYLIXCOMPAT} -{$ENDIF} - -var - GIdOpenSSLPath: String = ''; - -procedure IdOpenSSLSetLibPath(const APath: String); -begin - if APath <> '' then begin - GIdOpenSSLPath := IndyIncludeTrailingPathDelimiter(APath); - end else begin - GIdOpenSSLPath := ''; - end; -end; - - {$IFDEF UNIX} -var - // TODO: default these to False instead, as modern systems now - // use symlinks that point to OpenSSL 1.1.x+, which is not - // compatible with this unit... - GIdCanLoadSymLinks: Boolean = True; - GIdLoadSymLinksFirst: Boolean = True; - -procedure IdOpenSSLSetCanLoadSymLinks(ACanLoad: Boolean); -begin - GIdCanLoadSymLinks := ACanLoad; -end; - -procedure IdOpenSSLSetLoadSymLinksFirst(ALoadFirst: Boolean); -begin - GIdLoadSymLinksFirst := ALoadFirst; -end; - {$ENDIF} - -function LoadSSLCryptoLibrary: TIdLibHandle; -{$IFDEF WINDOWS} -var - Err: DWORD; -{$ELSE} - {$IFDEF USE_BASEUNIX_OR_VCL_POSIX_OR_KYLIXCOMPAT} // TODO: use {$IF DEFINED(UNIX)} instead? -var - i, j: Integer; - LLibVersions: array [0..26] of string; - LCanLoadSymLinks, LLoadSymLinksFirst: Boolean; - {$ENDIF} -{$ENDIF} -begin - {$IFDEF WINDOWS} - //On Windows, you should use SafeLoadLibrary because - //the LoadLibrary API call messes with the FPU control word. - Result := SafeLoadLibrary(GIdOpenSSLPath + SSLCLIB_DLL_name); - if Result <> IdNilHandle then begin - Exit; - end; - {$ELSE} - {$IFDEF USE_BASEUNIX_OR_VCL_POSIX_OR_KYLIXCOMPAT} // TODO: use {$IF DEFINED(UNIX)} instead? - // Workaround that is required under Linux (changed RTLD_GLOBAL with RTLD_LAZY Note: also work with LoadLibrary()) - Result := IdNilHandle; - LCanLoadSymLinks := GIdCanLoadSymLinks; - LLoadSymLinksFirst := GIdLoadSymLinksFirst; - if LCanLoadSymLinks and LLoadSymLinksFirst then begin - Result := HackLoad(GIdOpenSSLPath + SSLCLIB_DLL_name, []); - if Result <> IdNilHandle then begin - Exit; - end; - // TODO: exit here if the error is anything other than the file not being found... - end; - for i := Low(SSLDLLVers) to High(SSLDLLVers) do begin - for j := Low(SSLDLLVersChar) to High(SSLDLLVersChar) do begin - LLibVersions[j] := SSLDLLVers[i] + SSLDLLVersChar[j]; - end; - Result := HackLoad(GIdOpenSSLPath + SSLCLIB_DLL_name, LLibVersions); - if Result <> IdNilHandle then begin - Exit; - end; - // TODO: exit here if the error is anything other than the file not being found... - end; - if LCanLoadSymLinks and (not LLoadSymLinksFirst) then begin - Result := HackLoad(GIdOpenSSLPath + SSLCLIB_DLL_name, []); - if Result <> IdNilHandle then begin - Exit; - end; - // TODO: exit here if the error is anything other than the file not being found... - end; - {$ELSE} - Result := IdNilHandle; - {$ENDIF} - {$ENDIF} - {$IFDEF WINDOWS} - Err := GetLastError; - FFailedLoadList.Add(IndyFormat(RSOSSFailedToLoad_WithErrCode, [GIdOpenSSLPath + SSLCLIB_DLL_name, Err])); - {$ELSE} - // TODO: add error code to message... - FFailedLoadList.Add(IndyFormat(RSOSSFailedToLoad, [GIdOpenSSLPath + SSLCLIB_DLL_name {$IFDEF UNIX}+ LIBEXT{$ENDIF}])); - {$ENDIF} -end; - -function LoadSSLLibrary: TIdLibHandle; -{$IFDEF WINDOWS} -var - Err: DWORD; -{$ELSE} - {$IFDEF USE_BASEUNIX_OR_VCL_POSIX_OR_KYLIXCOMPAT} // TODO: use {$IF DEFINED(UNIX)} instead? -var - i, j: Integer; - LLibVersions: array [0..26] of string; - LCanLoadSymLinks, LLoadSymLinksFirst: Boolean; - {$ENDIF} -{$ENDIF} -begin - {$IFDEF WINDOWS} - //On Windows, you should use SafeLoadLibrary because - //the LoadLibrary API call messes with the FPU control word. - Result := SafeLoadLibrary(GIdOpenSSLPath + SSL_DLL_name); - if Result <> IdNilHandle then begin - Exit; - end; - // TODO: exit here if the error is anything other than the file not being found... - //This is a workaround for mingw32-compiled SSL .DLL which - //might be named 'libssl32.dll'. - Result := SafeLoadLibrary(GIdOpenSSLPath + SSL_DLL_name_alt); - if Result <> IdNilHandle then begin - Exit; - end; - {$ELSE} - {$IFDEF USE_BASEUNIX_OR_VCL_POSIX_OR_KYLIXCOMPAT} // TODO: use {$IF DEFINED(UNIX)} instead? - // Workaround that is required under Linux (changed RTLD_GLOBAL with RTLD_LAZY Note: also work with LoadLibrary()) - Result := IdNilHandle; - LCanLoadSymLinks := GIdCanLoadSymLinks; - LLoadSymLinksFirst := GIdLoadSymLinksFirst; - if LCanLoadSymLinks and LLoadSymLinksFirst then begin - Result := HackLoad(GIdOpenSSLPath + SSL_DLL_name, []); - if Result <> IdNilHandle then begin - Exit; - end; - // TODO: exit here if the error is anything other than the file not being found... - end; - for i := Low(SSLDLLVers) to High(SSLDLLVers) do begin - for j := Low(SSLDLLVersChar) to High(SSLDLLVersChar) do begin - LLibVersions[j] := SSLDLLVers[i] + SSLDLLVersChar[j]; - end; - Result := HackLoad(GIdOpenSSLPath + SSL_DLL_name, LLibVersions); - if Result <> IdNilHandle then begin - Exit; - end; - // TODO: exit here if the error is anything other than the file not being found... - end; - if LCanLoadSymLinks and (not LLoadSymLinksFirst) then begin - Result := HackLoad(GIdOpenSSLPath + SSL_DLL_name, []); - if Result <> IdNilHandle then begin - Exit; - end; - // TODO: exit here if the error is anything other than the file not being found... - end; - {$ELSE} - Result := IdNilHandle; - {$ENDIF} - {$ENDIF} - {$IFDEF WINDOWS} - Err := GetLastError; - FFailedLoadList.Add(IndyFormat(RSOSSFailedToLoad_WithErrCode, [GIdOpenSSLPath + SSL_DLL_name, Err])); - {$ELSE} - // TODO: add error code to message... - FFailedLoadList.Add(IndyFormat(RSOSSFailedToLoad, [GIdOpenSSLPath + SSL_DLL_name {$IFDEF UNIX}+ LIBEXT{$ENDIF}])); - {$ENDIF} -end; - -{$ENDIF} // STATICLOAD_OPENSSL - -{$IFDEF ANDROID} -// In Android 6, Google replaced OpenSSL with BoringSSL, which is a fork of -// OpenSSL and does not export many functions, including the following... - -type - msg_callback_proc = procedure(write_p, version, content_type : TIdC_INT; const buf : Pointer; len: size_t; ssl: PSSL; arg: Pointer); cdecl; - -function Indy_ssl_callback_ctrl(s: PSSL; cb_id: TIdC_INT; fp: SSL_METHOD_PROC): TIdC_LONG; cdecl; -begin - if cb_id = SSL_CTRL_SET_MSG_CALLBACK then begin - s.msg_callback := msg_callback_proc(fp); - Result := 1; - end else begin - Result := s.method.ssl_callback_ctrl(s, cb_id, fp); - end; -end; - -function Indy_SSL_CTX_callback_ctrl(ctx: PSSL_CTX; cmd: TIdC_INT; fp: SSL_METHOD_PROC): TIdC_LONG; cdecl; -begin - if cmd = SSL_CTRL_SET_MSG_CALLBACK then begin - ctx.msg_callback := msg_callback_proc(fp); - Result := 1; - end else begin - Result := ctx.method.ssl_ctx_callback_ctrl(ctx, cmd, fp); - end; -end; - -procedure Indy_SSL_copy_session_id(sslTo: PSSL; const sslFrom: PSSL) cdecl; -begin - // TODO: what to do here? -end; - -procedure Indy_CRYPTO_lock(mode, _type : TIdC_INT; const _file : PIdAnsiChar; line : TIdC_INT) cdecl; -begin - // TODO: what to do here? -end; -{$ENDIF} - -{$IFDEF STATICLOAD_OPENSSL} - -function Load: Boolean; -begin - bIsLoaded := True; - Result := True; -end; - -{$ELSE} - -function Load: Boolean; -var - LVersion, LMajor, LMinor: TIdC_ULONG; - LVersionStr: string; -begin - Result := False; - Assert(FFailedLoadList<>nil); - - if (hIdCrypto <> IdNilHandle) and (hIdSSL <> IdNilHandle) and (FFailedLoadList.Count = 0) then begin - Result := True; - Exit; - end; - - FFailedLoadList.Clear; - - if hIdCrypto = IdNilHandle then begin - hIdCrypto := LoadSSLCryptoLibrary; - if hIdCrypto = IdNilHandle then begin - Exit; - end; - end; - - if hIdSSL = IdNilHandle then begin - hIdSSL := LoadSSLLibrary; - if hIdSSL = IdNilHandle then begin - Exit; - end; - end; - - // RLebeau 6/8/2021: verify the type of library is supported... - - @_SSLeay_version := LoadOldCLib(fn_SSLeay_version, 'OpenSSL_version'); {Do not localize} //Used by Indy - @SSLeay := LoadOldCLib(fn_SSLeay, 'OpenSSL_version_num'); {Do not localize} //Used by Indy - - if Assigned(_SSLeay_version) then begin - LVersionStr := String(_SSLeay_version(SSLEAY_VERSION)); - end; - - if TextStartsWith(LVersionStr, 'LibreSSL') then {do not localize} - begin - { - According to the LibreSSL Portable GitHub repo: - https://github.com/libressl-portable/portable - - LibreSSL is API compatible with OpenSSL 1.0.1, but does not yet include all new APIs from OpenSSL 1.0.2 and later. - LibreSSL also includes APIs not yet present in OpenSSL. The current common API subset is OpenSSL 1.0.1. - - LibreSSL is not ABI compatible with any release of OpenSSL, or necessarily earlier releases of LibreSSL. - You will need to relink your programs to LibreSSL in order to use it, just as in moving between major versions - of OpenSSL. LibreSSL's installed library version numbers are incremented to account for ABI and API changes. - } - // TODO: add version checking? - end - else if TextStartsWith(LVersionStr, 'OpenSSL') or (LVersionStr = '') then {do not localize} - begin - // RLebeau 2/2/2021: verify the version is OpenSSL 1.0.2 or earlier, as OpenSSL 1.1.0 made MAJOR changes that we do not support yet... - if Assigned(SSLeay) then - begin - LVersion := SSLeay; - LMajor := (LVersion and $F0000000) shr 28; - LMinor := (LVersion and $0FF00000) shr 20; - if (LMajor = 0) and (LMinor = 0) then begin // < 0.9.3 - LMajor := (LVersion and $F000) shr 12; - LMinor := (LVersion and $0F00) shr 8; - end; - if (LMajor > 1) or ((LMajor = 1) and (LMinor > 0)) then // OpenSSL 1.1.0 or higher - begin - FFailedLoadList.Add(IndyFormat(RSOSSUnsupportedVersion, [LVersion])); - Exit; - end; - end; - end else - begin - FFailedLoadList.Add(IndyFormat(RSOSSUnsupportedLibrary, [LVersionStr])); - Exit; - end; - - // TODO: stop loading non-critical functions here. We should use per-function - // stubs instead, similar to the approach used in IdWinsock2.pas, so functions - // are not loaded until they are actually used for the first time... - - @SSL_CTX_set_cipher_list := LoadFunction(fn_SSL_CTX_set_cipher_list); //Used by Indy - @SSL_CTX_new := LoadFunction(fn_SSL_CTX_new); //Used by Indy - @SSL_CTX_free := LoadFunction(fn_SSL_CTX_free); //Used by Indy - @SSL_set_fd := LoadFunction(fn_SSL_set_fd); //Used by Indy - @SSL_CTX_use_PrivateKey_file := LoadFunction(fn_SSL_CTX_use_PrivateKey_file); //Used by Indy - @SSL_CTX_use_PrivateKey := LoadFunction(fn_SSL_CTX_use_PrivateKey); //Used by Indy - @SSL_CTX_use_certificate := LoadFunction(fn_SSL_CTX_use_certificate); //Used by Indy - @SSL_CTX_use_certificate_file := LoadFunction(fn_SSL_CTX_use_certificate_file); //Used by Indy - @SSL_CTX_use_certificate_chain_file := LoadFunction(fn_SSL_CTX_use_certificate_chain_file,False); //Used by Indy - @SSL_load_error_strings := LoadFunction(fn_SSL_load_error_strings); //Used by Indy - @SSL_state_string_long := LoadFunction(fn_SSL_state_string_long); //Used by Indy - @SSL_alert_desc_string_long := LoadFunction(fn_SSL_alert_desc_string_long); //Used by Indy - @SSL_alert_type_string_long := LoadFunction(fn_SSL_alert_type_string_long); //Used by Indy - - @SSL_get_peer_certificate := LoadFunction(fn_SSL_get_peer_certificate); //Used by Indy - @SSL_CTX_set_verify := LoadFunction(fn_SSL_CTX_set_verify); //Used by Indy - @SSL_CTX_set_verify_depth := LoadFunction(fn_SSL_CTX_set_verify_depth); //Used by Indy - @SSL_CTX_get_verify_depth := LoadFunction(fn_SSL_CTX_get_verify_depth); - @SSL_CTX_set_default_passwd_cb := LoadFunction(fn_SSL_CTX_set_default_passwd_cb); //Used by Indy - @SSL_CTX_set_default_passwd_cb_userdata:= LoadFunction(fn_SSL_CTX_set_default_passwd_cb_userdata); //Used by Indy - @SSL_CTX_check_private_key := LoadFunction(fn_SSL_CTX_check_private_key); //Used by Indy - @SSL_new := LoadFunction(fn_SSL_new); //Used by Indy - @SSL_free := LoadFunction(fn_SSL_free); //Used by Indy - @SSL_accept := LoadFunction(fn_SSL_accept); //Used by Indy - @SSL_connect := LoadFunction(fn_SSL_connect); //Used by Indy - @SSL_read := LoadFunction(fn_SSL_read); //Used by Indy - @SSL_peek := LoadFunction(fn_SSL_peek,False); - @SSL_pending := LoadFunction(fn_SSL_pending,False); - @SSL_write := LoadFunction(fn_SSL_write); //Used by Indy - @SSL_ctrl := LoadFunction(fn_SSL_ctrl); - @SSL_callback_ctrl := LoadFunction(fn_SSL_callback_ctrl{$IFDEF ANDROID}, False{$ENDIF}); - {$IFDEF ANDROID} - if not Assigned(SSL_callback_ctrl) then begin - @SSL_callback_ctrl := @Indy_SSL_callback_ctrl; - end; - {$ENDIF} - @SSL_CTX_ctrl := LoadFunction(fn_SSL_CTX_ctrl); - @SSL_CTX_callback_ctrl := LoadFunction(fn_SSL_CTX_callback_ctrl{$IFDEF ANDROID}, False{$ENDIF}); - {$IFDEF ANDROID} - if not Assigned(SSL_CTX_callback_ctrl) then begin - @SSL_CTX_callback_ctrl := @Indy_SSL_CTX_callback_ctrl; - end; - {$ENDIF} - @SSL_get_error := LoadFunction(fn_SSL_get_error); //Used by Indy - - // RLebeau 9/7/2015 - making all of the "..._method()" functions optional. If - // a user wants to disable a given SSL/TLS version at runtime, there is no need - // for it to be marked as "critical" at load time, in case it is not available - // in their version of OpenSSL. For instance, some vendors disable SSLv2 so - // it is not even exported. If a user wants to use a given version and it is - // not available in their version of OpenSSL, TIdSSLContext.SetSSLMethod() will - // now raise a runtime error... - @SSLv2_method := LoadFunction(fn_SSLv2_method,False); //Used by Indy - @SSLv2_server_method := LoadFunction(fn_SSLv2_server_method,False); //Used by Indy - @SSLv2_client_method := LoadFunction(fn_SSLv2_client_method,False); //Used by Indy - @SSLv3_method := LoadFunction(fn_SSLv3_method,False); //Used by Indy - @SSLv3_server_method := LoadFunction(fn_SSLv3_server_method,False); //Used by Indy - @SSLv3_client_method := LoadFunction(fn_SSLv3_client_method,False); //Used by Indy - @SSLv23_method := LoadFunction(fn_SSLv23_method,False); //Used by Indy - @SSLv23_server_method := LoadFunction(fn_SSLv23_server_method,False); //Used by Indy - @SSLv23_client_method := LoadFunction(fn_SSLv23_client_method,False); //Used by Indy - @TLSv1_method := LoadFunction(fn_TLSv1_method,False); //Used by Indy - @TLSv1_server_method := LoadFunction(fn_TLSv1_server_method,False); //Used by Indy - @TLSv1_client_method := LoadFunction(fn_TLSv1_client_method,False); //Used by Indy - @TLSv1_1_method := LoadFunction(fn_TLSv1_1_method,False); //Used by Indy - @TLSv1_1_server_method := LoadFunction(fn_TLSv1_1_server_method,False); //Used by Indy - @TLSv1_1_client_method := LoadFunction(fn_TLSv1_1_client_method,False); //Used by Indy - @TLSv1_2_method := LoadFunction(fn_TLSv1_2_method,False); //Used by Indy - @TLSv1_2_server_method := LoadFunction(fn_TLSv1_2_server_method,False); //Used by Indy - @TLSv1_2_client_method := LoadFunction(fn_TLSv1_2_client_method,False); //Used by Indy - @DTLSv1_method := LoadFunction(fn_DTLSv1_method, False); - @DTLSv1_server_method := LoadFunction(fn_DTLSv1_server_method, False); - @DTLSv1_client_method := LoadFunction(fn_DTLSv1_client_method, False); - // - - @SSL_shutdown := LoadFunction(fn_SSL_shutdown); //Used by Indy - @SSL_set_connect_state := LoadFunction(fn_SSL_set_connect_state,False); - @SSL_set_accept_state := LoadFunction(fn_SSL_set_accept_state,False); - @SSL_set_shutdown := LoadFunction(fn_SSL_set_shutdown); //Used by Indy - @SSL_CTX_load_verify_locations := LoadFunction(fn_SSL_CTX_load_verify_locations); //Used by Indy - @SSL_get_session := LoadFunction(fn_SSL_get_session); //Used by Indy - @SSLeay_add_ssl_algorithms := LoadFunction(fn_SSLeay_add_ssl_algorithms); //Used by Indy - @SSL_SESSION_get_id := LoadFunction(fn_SSL_SESSION_get_id); //Used by Indy - @SSL_copy_session_id := LoadFunction(fn_SSL_copy_session_id{$IFDEF ANDROID}, False{$ENDIF}); //Used by Indy - {$IFDEF ANDROID} - if not Assigned(SSL_copy_session_id) then begin - @SSL_copy_session_id := @Indy_SSL_copy_session_id; - end; - {$ENDIF} - // CRYPTO LIB - @d2i_X509_NAME := LoadFunctionCLib(fn_d2i_X509_NAME); - @i2d_X509_NAME := LoadFunctionCLib(fn_i2d_X509_NAME); - @X509_NAME_oneline := LoadFunctionCLib(fn_X509_NAME_oneline);//Used by Indy - @X509_NAME_cmp := LoadFunctionCLib(fn_X509_NAME_cmp); //Used by Indy - @X509_NAME_hash := LoadFunctionCLib(fn_X509_NAME_hash); //Used by Indy - @X509_set_issuer_name := LoadFunctionCLib(fn_X509_set_issuer_name,False); - @X509_get_issuer_name := LoadFunctionCLib(fn_X509_get_issuer_name); //Used by Indy - @X509_set_subject_name := LoadFunctionCLib(fn_X509_set_subject_name,False); - @X509_get_subject_name := LoadFunctionCLib(fn_X509_get_subject_name); //Used by Indy - @X509_digest := LoadFunctionCLib(fn_X509_digest);//Used by Indy - @X509_LOOKUP_ctrl := LoadFunctionCLib( fn_X509_LOOKUP_ctrl, False ); - @X509_STORE_add_cert := LoadFunctionCLib(fn_X509_STORE_add_cert); //Used by Indy - @X509_STORE_add_crl := LoadFunctionCLib(fn_X509_STORE_add_crl); //Used by Indy - @X509_STORE_CTX_get_ex_data := LoadFunctionCLib(fn_X509_STORE_CTX_get_ex_data,False); - @X509_STORE_CTX_get_error := LoadFunctionCLib(fn_X509_STORE_CTX_get_error); //Used by Indy - @X509_STORE_CTX_set_error := LoadFunctionCLib(fn_X509_STORE_CTX_set_error,False); - @X509_STORE_CTX_get_error_depth := LoadFunctionCLib(fn_X509_STORE_CTX_get_error_depth); //Used by Indy - @X509_STORE_CTX_get_current_cert := LoadFunctionCLib(fn_X509_STORE_CTX_get_current_cert); //Used by Indy - @X509_STORE_add_lookup := LoadFunctionCLib(fn_X509_STORE_add_lookup); //Used by Indy - @X509_STORE_load_locations := LoadFunctionCLib(fn_X509_STORE_load_locations); //Used by Indy - @X509_sign := LoadFunctionCLib(fn_X509_sign,False); - @X509_REQ_sign := LoadFunctionCLib(fn_X509_REQ_sign,False); - @X509_REQ_add_extensions := LoadFunctionCLib(fn_X509_REQ_add_extensions,False); - @X509V3_EXT_conf_nid := LoadFunctionCLib(fn_X509V3_EXT_conf_nid,False); - @X509_EXTENSION_create_by_NID := LoadFunctionCLib(fn_X509_EXTENSION_create_by_NID,False); - @X509V3_set_ctx := LoadFunctionCLib(fn_X509V3_set_ctx); - @X509_EXTENSION_free := LoadFunctionCLib(fn_X509_EXTENSION_free,False); - @X509_add_ext := LoadFunctionCLib(fn_X509_add_ext,False); - {$IFNDEF OPENSSL_NO_BIO} - //X509_print - @X509_print := LoadFunctionCLib(fn_X509_print, False ); //Used by Indy - {$ENDIF} - @_RAND_cleanup := LoadFunctionCLib(fn_RAND_cleanup, False); //Used by Indy - @_RAND_bytes := LoadFunctionCLib(fn_RAND_bytes); //Used by Indy - @_RAND_pseudo_bytes := LoadFunctionCLib(fn_RAND_pseudo_bytes); //Used by Indy - @_RAND_seed := LoadFunctionCLib(fn_RAND_seed); //Used by Indy - @_RAND_add := LoadFunctionCLib(fn_RAND_add); //Used by Indy - @_RAND_status := LoadFunctionCLib(fn_RAND_status); //Used by Indy - {$IFDEF SYS_WIN} - @_RAND_screen := LoadFunctionCLib(fn_RAND_screen); //Used by Indy - @_RAND_event := LoadFunctionCLib(fn_RAND_event); //Used by Indy - {$ENDIF} - {$IFNDEF OPENSSL_NO_DES} - // 3DES - @DES_set_odd_parity := LoadFunctionCLib(fn_DES_set_odd_parity); //Used by Indy - @DES_set_key := LoadFunctionCLib(fn_DES_set_key); //Used by Indy - @DES_ecb_encrypt := LoadFunctionCLib(fn_DES_ecb_encrypt); //Used by Indy - @Id_ossl_old_des_set_odd_parity := LoadOldCLib(fnold_des_set_odd_parity,fn__ossl_old_des_set_odd_parity,False); - @Id_ossl_old_des_set_key := LoadOldCLib(fnold_des_set_key,fn__ossl_old_des_set_key,False); - @Id_ossl_old_des_ecb_encrypt := LoadOldCLib(fnold_des_ecb_encrypt,fn__ossl_old_des_ecb_encrypt,False); - {$ENDIF} - // More SSL functions - @SSL_set_ex_data := LoadFunction(fn_SSL_set_ex_data,False); - @SSL_get_ex_data := LoadFunction(fn_SSL_get_ex_data,False); - @SSL_load_client_CA_file := LoadFunction(fn_SSL_load_client_CA_file); //Used by Indy - @SSL_CTX_set_client_CA_list := LoadFunction(fn_SSL_CTX_set_client_CA_list); //Used by Indy - @SSL_CTX_set_default_verify_paths := LoadFunction(fn_SSL_CTX_set_default_verify_paths); //Used by Indy - @SSL_CTX_set_session_id_context := LoadFunction(fn_SSL_CTX_set_session_id_context); //Used by Indy - @SSL_CIPHER_description := LoadFunction(fn_SSL_CIPHER_description); //Used by Indy - @SSL_get_current_cipher := LoadFunction(fn_SSL_get_current_cipher); //Used by Indy - @SSL_CIPHER_get_name := LoadFunction(fn_SSL_CIPHER_get_name); //Used by Indy - @SSL_CIPHER_get_version := LoadFunction(fn_SSL_CIPHER_get_version); //Used by Indy - @SSL_CIPHER_get_bits := LoadFunction(fn_SSL_CIPHER_get_bits); //Used by Indy - // Thread safe - @_CRYPTO_lock := LoadFunctionCLib(fn_CRYPTO_lock{$IFDEF ANDROID}, False{$ENDIF}); //Used by Indy - {$IFDEF ANDROID} - if not Assigned(_CRYPTO_lock) then begin - @_CRYPTO_lock := @Indy_CRYPTO_lock; - end; - {$ENDIF} - @_CRYPTO_num_locks := LoadFunctionCLib(fn_CRYPTO_num_locks); //Used by Indy - @CRYPTO_set_locking_callback := LoadFunctionCLib(fn_CRYPTO_set_locking_callback); //Used by Indy - {$IFNDEF WIN32_OR_WIN64} -{ -In OpenSSL 1.0.0, you should use these callback functions instead of the -depreciated set_id_callback. They are not in the older 0.9.8 OpenSSL series so -we have to handle both cases. -} - @CRYPTO_THREADID_set_callback := LoadFunctionCLib(fn_CRYPTO_THREADID_set_callback,False); //Used by Indy - @CRYPTO_THREADID_set_numeric := LoadFunctionClib(fn_CRYPTO_THREADID_set_numeric,False); //Used by Indy - @CRYPTO_THREADID_set_pointer := LoadFunctionClib(fn_CRYPTO_THREADID_set_pointer,False); - if not Assigned(CRYPTO_THREADID_set_callback) then begin //Used by Indy - @CRYPTO_set_id_callback := LoadFunctionCLib(fn_CRYPTO_set_id_callback); //Used by Indy - end else begin - @CRYPTO_set_id_callback := nil; - end; - {$ENDIF} - @ERR_put_error := LoadFunctionCLib(fn_ERR_put_error,False); - @ERR_get_error := LoadFunctionCLib(fn_ERR_get_error,False); - @ERR_peek_error := LoadFunctionCLib(fn_ERR_peek_error,False); - @ERR_peek_last_error := LoadFunctionCLib(fn_ERR_peek_last_error); //Used by Indy - @ERR_clear_error := LoadFunctionCLib(fn_ERR_clear_error); //Used by Indy - @ERR_error_string := LoadFunctionCLib(fn_ERR_error_string, False); - @ERR_error_string_n := LoadFunctionCLib(fn_ERR_error_string_n, False); - @ERR_lib_error_string := LoadFunctionCLib( fn_ERR_lib_error_string, False ); - @ERR_func_error_string := LoadFunctionCLib( fn_ERR_func_error_string, False ); - @ERR_reason_error_string := LoadFunctionCLib( fn_ERR_reason_error_string, False ); - @ERR_load_ERR_strings := LoadFunctionCLib( fn_ERR_load_ERR_strings,False); - @ERR_load_crypto_strings := LoadFunctionCLib(fn_ERR_load_crypto_strings,False); - @ERR_free_strings := LoadFunctionCLib(fn_ERR_free_strings); //Used by Indy - @ERR_remove_thread_state := LoadFunctionCLib(fn_ERR_remove_thread_state,False); //Used by Indy - if not Assigned(ERR_remove_thread_state) then begin - @ERR_remove_state := LoadFunctionCLib(fn_ERR_remove_state); //Used by Indy - end else begin - @ERR_remove_state := nil; - end; - @CRYPTO_cleanup_all_ex_data := LoadFunctionCLib(fn_CRYPTO_cleanup_all_ex_data,False); //Used by Indy - @SSL_COMP_get_compression_methods := LoadFunction(fn_SSL_COMP_get_compression_methods,False); - @SSL_COMP_free_compression_methods := LoadFunction(fn_SSL_COMP_free_compression_methods,False); - @sk_pop_free := LoadFunctionCLib(fn_sk_pop_free,False); - //RSA - @RSA_free := LoadFunctionCLib(fn_RSA_free,False); - @RSA_generate_key_ex := LoadFunctionCLib(fn_RSA_generate_key_ex, False); - @RSA_generate_key := LoadFunctionCLib(fn_RSA_generate_key, False); - // @RSA_generate_key := LoadFunctionCLib(fn_RSA_generate_key, not Assigned(RSA_generate_key_ex)); - @RSA_check_key := LoadFunctionCLib(fn_RSA_check_key,False); - @RSA_new := LoadFunctionCLib(fn_RSA_new,False); - @RSA_size := LoadFunctionCLib(fn_RSA_size,False); - @RSA_private_decrypt := LoadFunctionCLib(fn_RSA_private_decrypt,False); - @RSA_public_encrypt := LoadFunctionCLib(fn_RSA_public_encrypt,False); - //DH - @DH_free := LoadFunctionCLib(fn_DH_free); //Used by Indy - //BN - @BN_new := LoadFunctionCLib(fn_BN_new,False); - @BN_free := LoadFunctionCLib(fn_BN_free,False); - @BN_hex2bn := LoadFunctionCLib(fn_BN_hex2bn,False); - @BN_bn2dec := LoadFunctionCLib(fn_BN_bn2dec,False); - @BN_bn2hex := LoadFunctionCLib(fn_BN_bn2hex,False); - @BN_set_word := LoadFunctionCLib(fn_BN_set_word,False); - //BIO - @BIO_set_flags := LoadFunctionCLib(fn_BIO_set_flags,False); - @BIO_new := LoadFunctionCLib(fn_BIO_new); //Used by Indy - @BIO_push := LoadFunctionCLib(fn_BIO_push,False); - @BIO_pop := LoadFunctionCLib(fn_BIO_pop,False); - @BIO_set_next := LoadFunctionCLib(fn_BIO_set_next,False); - @BIO_free := LoadFunctionCLib(fn_BIO_free); //Used by Indy - @BIO_free_all := LoadFunctionCLib(fn_BIO_free_all,False); - @BIO_new_mem_buf := LoadFunctionCLib(fn_BIO_new_mem_buf); //Used by Indy - @BIO_s_mem := LoadFunctionCLib(fn_BIO_s_mem); //Used by Indy - @BIO_s_file := LoadFunctionCLib(fn_BIO_s_file,False); - @BIO_set_ex_data := LoadFunctionCLib(fn_BIO_set_ex_data,False); - @BIO_get_ex_data := LoadFunctionCLib(fn_BIO_get_ex_data,False); - @BIO_ctrl := LoadFunctionCLib(fn_BIO_ctrl); - @BIO_int_ctrl := LoadFunctionCLib( fn_BIO_int_ctrl,False); - @BIO_ptr_ctrl := LoadFunctionCLib( fn_BIO_ptr_ctrl,False); - @BIO_new_file := LoadFunctionCLib(fn_BIO_new_file); - @BIO_puts := LoadFunctionCLib(fn_BIO_puts,False); - @BIO_read := LoadFunctionCLib(fn_BIO_read,False); - @BIO_write := LoadFunctionCLib(fn_BIO_write,False); - //i2d - @i2d_X509_bio := LoadFunctionCLib(fn_i2d_X509_bio,False); - @i2d_PrivateKey_bio := LoadFunctionCLib(fn_i2d_PrivateKey_bio,False); - @d2i_X509_bio := LoadFunctionCLib(fn_d2i_X509_bio); //Used by Indy - @d2i_PKCS12_bio := LoadFunctionCLib(fn_d2i_PKCS12_bio); //Used by Indy - @PKCS12_parse := LoadFunctionCLib(fn_PKCS12_parse); //Used by Indy - @i2d_X509_REQ_bio := LoadFunctionCLib(fn_i2d_X509_REQ_bio,False); - @i2d_PKCS7 := LoadFunctionCLib(fn_i2d_PKCS7,False); - @d2i_PKCS7 := LoadFunctionCLib(fn_d2i_PKCS7,False); - @i2d_X509 := LoadFunctionCLib(fn_i2d_X509,False); - @d2i_X509 := LoadFunctionCLib(fn_d2i_X509); //Used by Indy - @i2d_X509_REQ := LoadFunctionCLib(fn_i2d_X509_REQ, False); - @d2i_X509_REQ := LoadFunctionCLib(fn_d2i_X509_REQ, False ); - @i2d_X509_CRL := LoadFunctionCLib(fn_i2d_X509_CRL, False ); - @d2i_X509_CRL := LoadFunctionCLib(fn_d2i_X509_CRL,False ); - @i2d_RSAPrivateKey := LoadFunctionCLib(fn_i2d_RSAPrivateKey,False ); - @d2i_RSAPrivateKey := LoadFunctionCLib(fn_d2i_RSAPrivateKey, False ); - @i2d_RSAPublicKey := LoadFunctionCLib(fn_i2d_RSAPublicKey,False); - @d2i_RSAPublicKey := LoadFunctionCLib(fn_d2i_RSAPublicKey,False); - @i2d_PrivateKey := LoadFunctionCLib(fn_i2d_PrivateKey,False); - @d2i_PrivateKey := LoadFunctionCLib(fn_d2i_PrivateKey); //Used by Indy - @d2i_PrivateKey_bio := LoadFunctionCLib(fn_d2i_PrivateKey_bio); //Used by Indy - - @i2d_DSAPrivateKey := LoadFunctionCLib(fn_i2d_DSAPrivateKey); //Used by Indy - @d2i_DSAPrivateKey := LoadFunctionCLib(fn_d2i_DSAPrivateKey); //Used by Indy - @i2d_DSAparams := LoadFunctionCLib(fn_i2d_DSAparams,False); - @d2i_DSAparams := LoadFunctionCLib(fn_d2i_DSAparams,False); - @i2d_DHparams := LoadFunctionCLib(fn_i2d_DHparams,False); - @d2i_DHparams := LoadFunctionCLib(fn_d2i_DHparams); //Used by Indy - @i2d_NETSCAPE_CERT_SEQUENCE := LoadFunctionCLib(fn_i2d_NETSCAPE_CERT_SEQUENCE,False); - @d2i_NETSCAPE_CERT_SEQUENCE := LoadFunctionCLib(fn_d2i_NETSCAPE_CERT_SEQUENCE); //Indy by Indy - @i2d_PUBKEY := LoadFunctionCLib(fn_i2d_PUBKEY,False); - @d2i_PUBKEY := LoadFunctionCLib(fn_d2i_PUBKEY,False); - - //X509 - @X509_get_default_cert_file := LoadFunctionCLib(fn_X509_get_default_cert_file); //Used by Indy - @X509_get_default_cert_file_env := LoadFunctionCLib(fn_X509_get_default_cert_file_env); //Used by Indy - @X509_new := LoadFunctionCLib(fn_X509_new,False); - @X509_free := LoadFunctionCLib(fn_X509_free); //Used by Indy - @X509_REQ_new := LoadFunctionCLib(fn_X509_REQ_new,False); - @X509_REQ_free := LoadFunctionCLib(fn_X509_REQ_free,False); - @X509_to_X509_REQ := LoadFunctionCLib(fn_X509_to_X509_REQ,False); - @X509_NAME_new := LoadFunctionCLib(fn_X509_NAME_new); //Used by Indy - @X509_NAME_free := LoadFunctionCLib(fn_X509_NAME_free); //Used by Indy - @X509_NAME_add_entry_by_txt := LoadFunctionCLib(fn_X509_NAME_add_entry_by_txt); - @X509_INFO_free := LoadFunctionCLib(fn_X509_INFO_free); //Used by Indy - @X509_set_version := LoadFunctionCLib(fn_X509_set_version,False); - @X509_get_serialNumber := LoadFunctionCLib(fn_X509_get_serialNumber); //USED by Indy - @X509_gmtime_adj := LoadFunctionCLib(fn_X509_gmtime_adj,False); - @X509_set_notBefore := LoadFunctionCLib(fn_X509_set_notBefore,False); - @X509_set_notAfter := LoadFunctionCLib(fn_X509_set_notAfter,False); - @X509_set_pubkey := LoadFunctionCLib(fn_X509_set_pubkey,False); - @X509_REQ_set_pubkey := LoadFunctionCLib(fn_X509_REQ_set_pubkey,False); - @X509_PUBKEY_get := LoadFunctionCLib(fn_X509_PUBKEY_get,False); - @X509_verify := LoadFunctionCLib(fn_X509_verify,False); - //PEM - {$IFNDEF SSLEAY_MACROS} - @_PEM_read_bio_X509 := LoadFunctionCLib(fn_PEM_read_bio_X509, False); - @_PEM_read_bio_X509_REQ := LoadFunctionCLib(fn_PEM_read_bio_X509_REQ, False); - @_PEM_read_bio_X509_CRL := LoadFunctionCLib(fn_PEM_read_bio_X509_CRL, False); - @_PEM_read_bio_RSAPrivateKey := LoadFunctionCLib(fn_PEM_read_bio_RSAPrivateKey, False); - @_PEM_read_bio_RSAPublicKey := LoadFunctionCLib(fn_PEM_read_bio_RSAPublicKey, False); - @_PEM_read_bio_DSAPrivateKey := LoadFunctionCLib(fn_PEM_read_bio_DSAPrivateKey, False); - @_PEM_read_bio_PrivateKey := LoadFunctionCLib (fn_PEM_read_bio_PrivateKey,False); - @_PEM_read_bio_PKCS7 := LoadFunctionCLib (fn_PEM_read_bio_PKCS7, False); - @_PEM_read_bio_DHparams := LoadFunctionCLib(fn_PEM_read_bio_DHparams, False); - @_PEM_read_bio_DSAparams := LoadFunctionCLib(fn_PEM_read_bio_DSAparams, False); - @_PEM_read_bio_NETSCAPE_CERT_SEQUENCE := LoadFunctionCLib(fn_PEM_read_bio_NETSCAPE_CERT_SEQUENCE,False); - @_PEM_read_bio_PUBKEY := LoadFunctionCLib(fn_PEM_read_bio_PUBKEY,False); - @_PEM_write_bio_X509 := LoadFunctionCLib(fn_PEM_write_bio_X509,False); - @_PEM_write_bio_X509_REQ := LoadFunctionCLib(fn_PEM_write_bio_X509_REQ,False); - @_PEM_write_bio_X509_CRL := LoadFunctionCLib( fn_PEM_write_bio_X509_CRL,False); - @_PEM_write_bio_RSAPrivateKey := LoadFunctionCLib(fn_PEM_write_bio_RSAPrivateKey,False); - @_PEM_write_bio_RSAPublicKey := LoadFunctionCLib( fn_PEM_write_bio_RSAPublicKey,False); - @_PEM_write_bio_DSAPrivateKey := LoadFunctionCLib( fn_PEM_write_bio_DSAPrivateKey,False); - @_PEM_write_bio_PrivateKey := LoadFunctionCLib( fn_PEM_write_bio_PrivateKey,False); - @_PEM_write_bio_PKCS7 := LoadFunctionCLib( fn_PEM_write_bio_PKCS7,False); - @_PEM_write_bio_DHparams := LoadFunctionCLib(fn_PEM_write_bio_DHparams,False); - @_PEM_write_bio_DSAparams := LoadFunctionCLib(fn_PEM_write_bio_DSAparams,False); - @_PEM_write_bio_NETSCAPE_CERT_SEQUENCE := LoadFunctionCLib(fn_PEM_write_bio_NETSCAPE_CERT_SEQUENCE,False); - @_PEM_write_bio_PKCS8PrivateKey := LoadFunctionCLib(fn_PEM_write_bio_PKCS8PrivateKey,False); - @_PEM_write_bio_PUBKEY := LoadFunctionCLib(fn_PEM_write_bio_PUBKEY,False); - {$ELSE} - @PEM_ASN1_write_bio := LoadFunctionCLib(fn_PEM_ASN1_write_bio,False); - @PEM_ASN1_read_bio := LoadFunctionCLib(fn_PEM_ASN1_read_bio,False); - {$ENDIF} - @PEM_X509_INFO_read_bio := LoadFunctionCLib(fn_PEM_X509_INFO_read_bio); //Used by Indy - @PEM_read_bio_X509_AUX := LoadFunctionCLib(fn_PEM_read_bio_X509_AUX); //Used by Indy - //EVP - {$IFNDEF OPENSSL_NO_DES} - @EVP_des_ede3_cbc := LoadFunctionCLib(fn_EVP_des_ede3_cbc,False); - {$ENDIF} - {$IFNDEF OPENSSL_NO_SHA512} - @EVP_sha512 := LoadFunctionCLib(fn_EVP_sha512,False); //Used by Indy but non-critical - @EVP_sha384 := LoadFunctionCLib(fn_EVP_sha384,False); //Used by Indy but non-critical - {$ENDIF} - {$IFNDEF OPENSSL_NO_SHA256} - @EVP_sha256 := LoadFunctionCLib(fn_EVP_sha256,False); //Used by Indy but non-critical - @EVP_sha224 := LoadFunctionCLib(fn_EVP_sha224,False); //Used by Indy but non-critical - {$ENDIF} - {$IFNDEF OPENSSL_NO_SHA} - @EVP_sha1 := LoadFunctionCLib(fn_EVP_sha1); //USED by Indy - - @EVP_sha := LoadFunctionCLib(fn_EVP_sha,False); //not available on Android - @EVP_dss := LoadFunctionCLib(fn_EVP_dss,False); - @EVP_dss1 := LoadFunctionCLib(fn_EVP_dss1,False); - @EVP_ecdsa := LoadFunctionCLib(fn_EVP_ecdsa,False); - {$ENDIF} - {$ifndef OPENSSL_NO_MDC2} - @EVP_mdc2 := LoadFunctionCLib(fn_EVP_mdc2,False); - {$endif} - {$IFNDEF OPENSSL_NO_MD5} - @EVP_md5 := LoadFunctionCLib(fn_EVP_md5); //USED By Indy - {$ENDIF} - {$IFNDEF OPENSSL_NO_MD4} - @EVP_md4 := LoadFunctionCLib(fn_EVP_md4,False); - {$ENDIF} - {$IFNDEF OPENSSL_NO_MD2} - @EVP_md2 := LoadFunctionCLib(fn_EVP_md2,False); - {$ENDIF} - {$ifndef OPENSSL_NO_RIPEMD} - @EVP_ripemd160 := LoadFunctionCLib(fn_EVP_ripemd160,False); - {$endif} - {$ifndef OPENSSL_NO_WHIRLPOOL} - @EVP_whirlpool := LoadFunctionCLib(fn_EVP_whirlpool,False); //not available on Android - {$endif} - @EVP_md_null := LoadFunctionCLib(fn_EVP_md_null, False); - {$IFNDEF OPENSSL_NO_DES} - @EVP_des_ecb := LoadFunctionCLib(fn_EVP_des_ecb,False); - @EVP_des_ede := LoadFunctionCLib(fn_EVP_des_ede,False); - @EVP_des_ede3 := LoadFunctionCLib(fn_EVP_des_ede3,False); - @EVP_des_ede_ecb := LoadFunctionCLib(fn_EVP_des_ede_ecb,False); - @EVP_des_ede3_ecb := LoadFunctionCLib(fn_EVP_des_ede3_ecb,False); - @EVP_des_cfb64 := LoadFunctionCLib(fn_EVP_des_cfb64,False); -// # define EVP_des_cfb EVP_des_cfb64 - - @EVP_des_cfb1 := LoadFunctionCLib(fn_EVP_des_cfb1,False); - @EVP_des_cfb8 := LoadFunctionCLib(fn_EVP_des_cfb8,False); - @EVP_des_ede_cfb64 := LoadFunctionCLib(fn_EVP_des_ede_cfb64,False); -//#if 0 - // @EVP_des_ede_cfb1 := LoadFunctionCLib(fn_EVP_des_ede_cfb1,False); - // @EVP_des_ede_cfb8 := LoadFunctionCLib(fn_EVP_des_ede_cfb8,False); - //#endif - @EVP_des_ede3_cfb64 := LoadFunctionCLib(fn_EVP_des_ede3_cfb64,False); - @EVP_des_ede3_cfb1 := LoadFunctionCLib(fn_EVP_des_ede3_cfb1,False); - @EVP_des_ede3_cfb8 := LoadFunctionCLib(fn_EVP_des_ede3_cfb8,False); - @EVP_des_ofb := LoadFunctionCLib(fn_EVP_des_ofb,False); - @EVP_des_ede_ofb := LoadFunctionCLib(fn_EVP_des_ede_ofb,False); - @EVP_des_ede3_ofb := LoadFunctionCLib(fn_EVP_des_ede3_ofb,False); - @EVP_des_cbc := LoadFunctionCLib(fn_EVP_des_cbc,False); - @EVP_des_ede_cbc := LoadFunctionCLib(fn_EVP_des_ede_cbc,False); - @EVP_desx_cbc := LoadFunctionCLib(fn_EVP_desx_cbc,False); -//* This should now be supported through the dev_crypto ENGINE. But also, why are -// * rc4 and md5 declarations made here inside a "NO_DES" precompiler branch? */ -//#if 0 - {$ifdef OPENSSL_OPENBSD_DEV_CRYPTO} - @EVP_dev_crypto_des_ede3_cbc := LoadFunctionCLib(fn_EVP_dev_crypto_des_ede3_cbc,False); - @EVP_dev_crypto_rc4 := LoadFunctionCLib(fn_EVP_dev_crypto_rc4,False); - @EVP_dev_crypto_md5 := LoadFunctionCLib(fn_EVP_dev_crypto_md5,False); - {$endif} -//#endif - {$endif} - {$ifndef OPENSSL_NO_RC4} - @EVP_rc4 := LoadFunctionCLib(fn_EVP_rc4,False); - @EVP_rc4_40 := LoadFunctionCLib(fn_EVP_rc4_40,False); - {$ifndef OPENSSL_NO_MD5} - @EVP_rc4_hmac_md5 := LoadFunctionCLib(fn_EVP_rc4_hmac_md5,False); - {$endif} - {$endif} - {$ifndef OPENSSL_NO_IDEA} - //not available on Android - @EVP_idea_ecb := LoadFunctionCLib(fn_EVP_idea_ecb,False); - @EVP_idea_cfb64 := LoadFunctionCLib(fn_EVP_idea_cfb64,False); - @EVP_idea_ofb := LoadFunctionCLib(fn_EVP_idea_ofb,False); - @EVP_idea_cbc := LoadFunctionCLib(fn_EVP_idea_cbc,False); - {$endif} - {$ifndef OPENSSL_NO_RC2} - @EVP_rc2_ecb := LoadFunctionCLib(fn_EVP_rc2_ecb,False); - @EVP_rc2_cbc := LoadFunctionCLib(fn_EVP_rc2_cbc,False); - @EVP_rc2_40_cbc := LoadFunctionCLib(fn_EVP_rc2_40_cbc,False); - @EVP_rc2_64_cbc := LoadFunctionCLib(fn_EVP_rc2_64_cbc,False); - @EVP_rc2_cfb64 := LoadFunctionCLib(fn_EVP_rc2_cfb64,False); - @EVP_rc2_ofb := LoadFunctionCLib(fn_EVP_rc2_ofb, False); - {$endif} - {$ifndef OPENSSL_NO_BF} - @EVP_bf_ecb := LoadFunctionCLib(fn_EVP_bf_ecb,False); - @EVP_bf_cbc := LoadFunctionCLib(fn_EVP_bf_cbc,False); - @EVP_bf_cfb64 := LoadFunctionCLib(fn_EVP_bf_cfb64,False); - @EVP_bf_ofb := LoadFunctionCLib(fn_EVP_bf_ofb,False); - {$endif} - {$ifndef OPENSSL_NO_CAST} - //not available on Android - @EVP_cast5_ecb := LoadFunctionCLib(fn_EVP_cast5_ecb,False); - @EVP_cast5_cbc := LoadFunctionCLib(fn_EVP_cast5_cbc,False); - @EVP_cast5_cfb64 := LoadFunctionCLib(fn_EVP_cast5_cfb64,False); - @EVP_cast5_ofb := LoadFunctionCLib(fn_EVP_cast5_ofb,False); - {$endif} - {$ifndef OPENSSL_NO_RC5} - @EVP_rc5_32_12_16_cbc := LoadFunctionCLib(fn_EVP_rc5_32_12_16_cbc,False); - @EVP_rc5_32_12_16_ecb := LoadFunctionCLib(fn_EVP_rc5_32_12_16_ecb,False); - @EVP_rc5_32_12_16_cfb64 := LoadFunctionCLib(fn_EVP_rc5_32_12_16_cfb64,False); - @EVP_rc5_32_12_16_ofb := LoadFunctionCLib(fn_EVP_rc5_32_12_16_ofb,False); - {$endif} - {$ifndef OPENSSL_NO_AES} - @EVP_aes_128_ecb := LoadFunctionCLib(fn_EVP_aes_128_ecb,False); - @EVP_aes_128_cbc := LoadFunctionCLib(fn_EVP_aes_128_cbc,False); - @EVP_aes_128_cfb1:= LoadFunctionCLib(fn_EVP_aes_128_cfb1,False); - @EVP_aes_128_cfb8:= LoadFunctionCLib(fn_EVP_aes_128_cfb8,False); - @EVP_aes_128_cfb128 := LoadFunctionCLib(fn_EVP_aes_128_cfb128,False); - @EVP_aes_128_ofb := LoadFunctionCLib(fn_EVP_aes_128_ofb,False); - @EVP_aes_128_ctr := LoadFunctionCLib(fn_EVP_aes_128_ctr,False); - @EVP_aes_128_gcm := LoadFunctionCLib(fn_EVP_aes_128_gcm,False); - @EVP_aes_128_ccm := LoadFunctionCLib(fn_EVP_aes_128_ccm,False); - @EVP_aes_128_xts := LoadFunctionCLib(fn_EVP_aes_128_xts,False); - @EVP_aes_192_ecb := LoadFunctionCLib(fn_EVP_aes_192_ecb,False); - @EVP_aes_192_cbc := LoadFunctionCLib(fn_EVP_aes_192_cbc,False); - @EVP_aes_192_cfb1 := LoadFunctionCLib(fn_EVP_aes_192_cfb1,False); - @EVP_aes_192_cfb128 := LoadFunctionCLib(fn_EVP_aes_192_cfb128,False); - - @EVP_aes_192_ofb := LoadFunctionCLib(fn_EVP_aes_192_ofb,False); - @EVP_aes_192_ctr := LoadFunctionCLib(fn_EVP_aes_192_ctr,False); - @EVP_aes_192_gcm := LoadFunctionCLib(fn_EVP_aes_192_gcm,False); - @EVP_aes_192_ccm := LoadFunctionCLib(fn_EVP_aes_192_ccm,False); - @EVP_aes_256_ecb := LoadFunctionCLib(fn_EVP_aes_256_ecb,False); - @EVP_aes_256_cbc := LoadFunctionCLib(fn_EVP_aes_256_cbc,False); - @EVP_aes_256_cfb1 := LoadFunctionCLib(fn_EVP_aes_256_cfb1,False); - @EVP_aes_256_cfb8 := LoadFunctionCLib(fn_EVP_aes_256_cfb8,False); - @EVP_aes_256_cfb128 := LoadFunctionCLib(fn_EVP_aes_256_cfb128,False); - @EVP_aes_256_ofb := LoadFunctionCLib(fn_EVP_aes_256_ofb,False); - @EVP_aes_256_ctr := LoadFunctionCLib(fn_EVP_aes_256_ctr,False); - @EVP_aes_256_gcm := LoadFunctionCLib(fn_EVP_aes_256_gcm,False); - @EVP_aes_256_ccm := LoadFunctionCLib(fn_EVP_aes_256_ccm,False); - @EVP_aes_256_xts := LoadFunctionCLib(fn_EVP_aes_256_xts,False); - {$ifndef OPENSSL_NO_SHA} - {$ifndef OPENSSL_NO_SHA1} - @EVP_aes_128_cbc_hmac_sha1 := LoadFunctionCLib(fn_EVP_aes_128_cbc_hmac_sha1,False); - @EVP_aes_256_cbc_hmac_sha1 := LoadFunctionCLib(fn_EVP_aes_256_cbc_hmac_sha1,False); - {$endif} - {$endif} - {$endif} - {$ifndef OPENSSL_NO_CAMELLIA} - @EVP_camellia_128_ecb := LoadFunctionCLib(fn_EVP_camellia_128_ecb, False); - @EVP_camellia_128_cbc := LoadFunctionCLib(fn_EVP_camellia_128_cbc, False); - @EVP_camellia_128_cfb1 := LoadFunctionCLib(fn_EVP_camellia_128_cfb1, False); - @EVP_camellia_128_cfb8 := LoadFunctionCLib(fn_EVP_camellia_128_cfb8, False); - @EVP_camellia_128_cfb128 := LoadFunctionCLib(fn_EVP_camellia_128_cfb12, False); - @EVP_camellia_128_ofb := LoadFunctionCLib(fn_EVP_camellia_128_ofb, False); - @EVP_camellia_192_ecb := LoadFunctionCLib(fn_EVP_camellia_192_ecb, False); - - @EVP_camellia_192_cbc := LoadFunctionCLib(fn_EVP_camellia_192_cbc,False); - @EVP_camellia_192_cfb1 := LoadFunctionCLib(fn_EVP_camellia_192_cfb1,False); - @EVP_camellia_192_cfb8 := LoadFunctionCLib(fn_EVP_camellia_192_cfb8,False); - @EVP_camellia_192_cfb128 := LoadFunctionCLib(fn_EVP_camellia_192_cfb128,False); - @EVP_camellia_192_ofb := LoadFunctionCLib(fn_EVP_camellia_192_ofb,False); - @EVP_camellia_256_ecb := LoadFunctionCLib(fn_EVP_camellia_256_ecb,False); - @EVP_camellia_256_cbc := LoadFunctionCLib(fn_EVP_camellia_256_cbc,False); - @EVP_camellia_256_cfb1 := LoadFunctionCLib(fn_EVP_camellia_256_cfb1,False); - @EVP_camellia_256_cfb8 := LoadFunctionCLib(fn_EVP_camellia_256_cfb8,False); - @EVP_camellia_256_cfb128 := LoadFunctionCLib(fn_EVP_camellia_256_cfb128,False); - @EVP_camellia_256_ofb := LoadFunctionCLib(fn_EVP_camellia_256_ofb,False); - {$endif} - - {$ifndef OPENSSL_NO_SEED} - @EVP_seed_ecb := LoadFunctionCLib(fn_EVP_seed_ecb,False); - @EVP_seed_cbc := LoadFunctionCLib(fn_EVP_seed_cbc,False); - @EVP_seed_cfb128 := LoadFunctionCLib(fn_EVP_seed_cfb128,False); - @EVP_seed_ofb := LoadFunctionCLib(fn_EVP_seed_ofb,False); - {$endif} - - @EVP_MD_CTX_init := LoadFunctionCLib(fn_EVP_MD_CTX_init); - @EVP_MD_CTX_cleanup := LoadFunctionCLib(fn_EVP_MD_CTX_cleanup); - @EVP_MD_CTX_create := LoadFunctionCLib(fn_EVP_MD_CTX_create, False); - @EVP_MD_CTX_destroy := LoadFunctionCLib(fn_EVP_MD_CTX_destroy, False); - @EVP_MD_CTX_copy := LoadFunctionCLib(fn_EVP_MD_CTX_copy, False); - @EVP_MD_CTX_copy_ex := LoadFunctionCLib(fn_EVP_MD_CTX_copy_ex, False); - //@EVP_MD_CTX_set_flags := LoadFunctionCLib(fn_EVP_MD_CTX_set_flags, False); - //@EVP_MD_CTX_clear_flags := LoadFunctionCLib(fn_EVP_MD_CTX_clear_flags, False); - //@EVP_MD_CTX_test_flags := LoadFunctionCLib(fn_EVP_MD_CTX_test_flags, False); - - @EVP_DigestInit := LoadFunctionCLib(fn_EVP_DigestInit); - @EVP_DigestInit_ex := LoadFunctionCLib(fn_EVP_DigestInit_ex); - @EVP_DigestUpdate := LoadFunctionCLib(fn_EVP_DigestUpdate); - @EVP_DigestFinal_ex := LoadFunctionCLib(fn_EVP_DigestFinal_ex); - - @EVP_EncryptInit := LoadFunctionCLib(fn_EVP_EncryptInit,False); - @EVP_EncryptInit_ex := LoadFunctionCLib(fn_EVP_EncryptInit_ex,False); - @EVP_EncryptUpdate := LoadFunctionCLib(fn_EVP_EncryptUpdate); - @EVP_EncryptFinal_ex := LoadFunctionCLib(fn_EVP_EncryptFinal_ex,False); - @EVP_EncryptFinal := LoadFunctionCLib(fn_EVP_EncryptFinal,False); - - @EVP_DecryptInit := LoadFunctionCLib(fn_EVP_DecryptInit,False); - @EVP_DecryptInit_ex := LoadFunctionCLib(fn_EVP_DecryptInit_ex,False); - @EVP_DecryptUpdate := LoadFunctionCLib(fn_EVP_DecryptUpdate); - @EVP_DecryptFinal := LoadFunctionCLib(fn_EVP_DecryptFinal,False); - @EVP_DecryptFinal_ex := LoadFunctionCLib(fn_EVP_DecryptFinal_ex,False); - @EVP_CipherInit := LoadFunctionCLib(fn_EVP_CipherInit,False); - @EVP_CipherInit_ex := LoadFunctionCLib(fn_EVP_CipherInit_ex,False); - @EVP_CipherUpdate := LoadFunctionCLib(fn_EVP_CipherUpdate,False); - @EVP_CipherFinal := LoadFunctionCLib(fn_EVP_CipherFinal,False); - @EVP_CipherFinal_ex := LoadFunctionCLib(fn_EVP_CipherFinal_ex,False); - @EVP_SignFinal := LoadFunctionCLib(fn_EVP_SignFinal,False); - @EVP_VerifyFinal := LoadFunctionCLib(fn_EVP_VerifyFinal,False); - @EVP_DigestSignInit := LoadFunctionCLib(fn_EVP_DigestSignInit,False); - @EVP_DigestSignFinal := LoadFunctionCLib(fn_EVP_DigestSignFinal,False); - @EVP_DigestVerifyInit := LoadFunctionCLib(fn_EVP_DigestVerifyInit,False); - @EVP_DigestVerifyFinal := LoadFunctionCLib(fn_EVP_DigestVerifyFinal,False); - @EVP_OpenInit := LoadFunctionCLib(fn_EVP_OpenInit,False); - @EVP_OpenFinal := LoadFunctionCLib(fn_EVP_OpenFinal,False); - @EVP_SealInit := LoadFunctionCLib(fn_EVP_SealInit,False); - @EVP_SealFinal := LoadFunctionCLib(fn_EVP_SealFinal,False); - - @EVP_EncodeInit := LoadFunctionCLib(fn_EVP_EncodeInit,False); - @EVP_EncodeUpdate := LoadFunctionCLib(fn_EVP_EncodeUpdate,False); - @EVP_EncodeFinal := LoadFunctionCLib(fn_EVP_EncodeFinal,False); - @EVP_EncodeBlock := LoadFunctionCLib(fn_EVP_EncodeBlock,False); - @EVP_DecodeInit := LoadFunctionCLib(fn_EVP_DecodeInit,False); - @EVP_DecodeUpdate:= LoadFunctionCLib(fn_EVP_DecodeUpdate,False); - @EVP_DecodeFinal:= LoadFunctionCLib(fn_EVP_DecodeFinal,False); - @EVP_DecodeBlock:= LoadFunctionCLib(fn_EVP_DecodeBlock,False); - - @EVP_CIPHER_CTX_init:= LoadFunctionCLib(fn_EVP_CIPHER_CTX_init,False); - @EVP_CIPHER_CTX_cleanup:= LoadFunctionCLib(fn_EVP_CIPHER_CTX_cleanup,False); - @EVP_CIPHER_CTX_new:= LoadFunctionCLib(fn_EVP_CIPHER_CTX_new,False); - @EVP_CIPHER_CTX_free:= LoadFunctionCLib(fn_EVP_CIPHER_CTX_free,False); - @EVP_CIPHER_CTX_set_key_length:= LoadFunctionCLib(fn_EVP_CIPHER_CTX_set_key_length,False); - @EVP_CIPHER_CTX_set_padding:= LoadFunctionCLib(fn_EVP_CIPHER_CTX_set_padding,False); - @EVP_CIPHER_CTX_ctrl:= LoadFunctionCLib(fn_EVP_CIPHER_CTX_ctrl,False); - @EVP_CIPHER_CTX_rand_key:= LoadFunctionCLib(fn_EVP_CIPHER_CTX_rand_key,False); - -{$ifndef OPENSSL_NO_BIO} - @BIO_f_md := LoadFunctionCLib(fn_BIO_f_md,False); - @BIO_f_base64 := LoadFunctionCLib(fn_BIO_f_base64,False); - @BIO_f_cipher := LoadFunctionCLib(fn_BIO_f_cipher,False); - @BIO_f_reliable :=LoadFunctionCLib(fn_BIO_f_reliable,False); - @BIO_set_cipher :=LoadFunctionCLib(fn_BIO_set_cipher,False); -{$endif} - - @EVP_PKEY_new := LoadFunctionCLib(fn_EVP_PKEY_new); - @EVP_PKEY_free := LoadFunctionCLib(fn_EVP_PKEY_free); //USED in Indy - @EVP_PKEY_assign := LoadFunctionCLib(fn_EVP_PKEY_assign); - @EVP_get_cipherbyname := LoadFunctionCLib(fn_EVP_get_cipherbyname); - @EVP_get_digestbyname := LoadFunctionCLib(fn_EVP_get_digestbyname); - @EVP_MD_type := LoadFunctionCLib(fn_EVP_MD_type); - @EVP_MD_size := LoadFunctionCLib(fn_EVP_MD_size); - @EVP_MD_block_size := LoadFunctionCLib(fn_EVP_MD_block_size); - @EVP_MD_flags := LoadFunctionCLib(fn_EVP_MD_flags,False); - @EVP_MD_CTX_md := LoadFunctionCLib(fn_EVP_MD_CTX_md); - @EVP_CIPHER_nid := LoadFunctionCLib(fn_EVP_CIPHER_nid,False); - @EVP_CIPHER_block_size := LoadFunctionCLib(fn_EVP_CIPHER_block_size,False); - @EVP_CIPHER_key_length := LoadFunctionCLib(fn_EVP_CIPHER_key_length,False); - @EVP_CIPHER_iv_length := LoadFunctionCLib(fn_EVP_CIPHER_iv_length,False); - @EVP_CIPHER_flags := LoadFunctionCLib(fn_EVP_CIPHER_flags); - @EVP_CIPHER_type := LoadFunctionCLib(fn_EVP_CIPHER_type); - @EVP_CIPHER_CTX_cipher := LoadFunctionCLib(fn_EVP_CIPHER_CTX_cipher); - @EVP_CIPHER_CTX_nid := LoadFunctionCLib(fn_EVP_CIPHER_CTX_nid,False); - @EVP_CIPHER_CTX_block_size := LoadFunctionCLib(fn_EVP_CIPHER_CTX_block_size, False ); - @EVP_CIPHER_CTX_key_length := LoadFunctionCLib(fn_EVP_CIPHER_CTX_key_length, False ); - @EVP_CIPHER_CTX_iv_length := LoadFunctionCLib(fn_EVP_CIPHER_CTX_iv_length,False); - @EVP_CIPHER_CTX_copy := LoadFunctionCLib(fn_EVP_CIPHER_CTX_copy,False ); - @EVP_CIPHER_CTX_get_app_data := LoadFunctionCLib(fn_EVP_CIPHER_CTX_get_app_data ); - @EVP_CIPHER_CTX_set_app_data := LoadFunctionCLib(fn_EVP_CIPHER_CTX_set_app_data ); - @EVP_CIPHER_CTX_flags := LoadFunctionCLib(fn_EVP_CIPHER_CTX_flags); - - @EVP_add_cipher := LoadFunctionCLib(fn_EVP_add_cipher,False); - @EVP_add_digest := LoadFunctionCLib(fn_EVP_add_digest,False); - - @EVP_CIPHER_do_all := LoadFunctionCLib(fn_EVP_CIPHER_do_all,False); - @EVP_CIPHER_do_all_sorted := LoadFunctionCLib(fn_EVP_CIPHER_do_all_sorted,False); - @EVP_MD_do_all := LoadFunctionCLib(fn_EVP_MD_do_all,False); - @EVP_MD_do_all_sorted := LoadFunctionCLib(fn_EVP_MD_do_all_sorted,False); - @EVP_PKEY_decrypt_old := LoadFunctionCLib(fn_EVP_PKEY_decrypt_old,False); - @EVP_PKEY_encrypt_old := LoadFunctionCLib(fn_EVP_PKEY_encrypt_old,False); - @EVP_PKEY_type := LoadFunctionCLib(fn_EVP_PKEY_type,False); - @EVP_PKEY_id := LoadFunctionCLib(fn_EVP_PKEY_id,False); - @EVP_PKEY_base_id := LoadFunctionCLib(fn_EVP_PKEY_base_id,False); - @EVP_PKEY_bits := LoadFunctionCLib(fn_EVP_PKEY_bits,False); - @EVP_PKEY_size := LoadFunctionCLib(fn_EVP_PKEY_size,False); - @EVP_PKEY_set_type := LoadFunctionCLib(fn_EVP_PKEY_set_type,False); - @EVP_PKEY_set_type_str := LoadFunctionCLib(fn_EVP_PKEY_set_type_str,False); - @EVP_PKEY_get0 := LoadFunctionCLib(fn_EVP_PKEY_get0,False); - {$ifndef OPENSSL_NO_RSA} - @EVP_PKEY_set1_RSA := LoadFunctionCLib(fn_EVP_PKEY_set1_RSA,False); - @EVP_PKEY_get1_RSA := LoadFunctionCLib(fn_EVP_PKEY_get1_RSA,False); - {$ENDIF} - {$ifndef OPENSSL_NO_DSA} - @EVP_PKEY_set1_DSA := LoadFunctionCLib(fn_EVP_PKEY_set1_DSA,False); - @EVP_PKEY_get1_DSA := LoadFunctionCLib(fn_EVP_PKEY_get1_DSA,False); - {$endif} - {$ifndef OPENSSL_NO_DH} - @EVP_PKEY_set1_DH := LoadFunctionCLib(fn_EVP_PKEY_set1_DH,False); - @EVP_PKEY_get1_DH := LoadFunctionCLib(fn_EVP_PKEY_get1_DH,False); - {$endif} - {$ifndef OPENSSL_NO_EC} - @EVP_PKEY_set1_EC_KEY := LoadFunctionCLib(fn_EVP_PKEY_set1_EC_KEY,False); - @EVP_PKEY_get1_EC_KEY := LoadFunctionCLib(fn_EVP_PKEY_get1_EC_KEY,False); - {$endif} - @d2i_PublicKey := LoadFunctionCLib(fn_d2i_PublicKey,False); - @i2d_PublicKey := LoadFunctionCLib(fn_i2d_PublicKey,False); - @d2i_AutoPrivateKey := LoadFunctionCLib(fn_d2i_AutoPrivateKey,False); - @EVP_PKEY_copy_parameters := LoadFunctionCLib(fn_EVP_PKEY_copy_parameters,False); - @EVP_PKEY_missing_parameters := LoadFunctionCLib(fn_EVP_PKEY_missing_parameters,False); - @EVP_PKEY_save_parameters := LoadFunctionCLib(fn_EVP_PKEY_save_parameters,False); - @EVP_PKEY_cmp_parameters := LoadFunctionCLib(fn_EVP_PKEY_cmp_parameters,False); - @EVP_PKEY_cmp := LoadFunctionCLib(fn_EVP_PKEY_cmp,False); - @EVP_PKEY_print_public := LoadFunctionCLib(fn_EVP_PKEY_print_public,False); - @EVP_PKEY_print_private := LoadFunctionCLib(fn_EVP_PKEY_print_private,False); - @EVP_PKEY_print_params := LoadFunctionCLib(fn_EVP_PKEY_print_params,False); - @EVP_PKEY_get_default_digest_nid := LoadFunctionCLib(fn_EVP_PKEY_get_default_digest_nid,False); - @EVP_CIPHER_param_to_asn1 := LoadFunctionCLib(fn_EVP_CIPHER_param_to_asn1,False); - @EVP_CIPHER_asn1_to_param := LoadFunctionCLib(fn_EVP_CIPHER_asn1_to_param,False); - @EVP_CIPHER_set_asn1_iv := LoadFunctionCLib(fn_EVP_CIPHER_set_asn1_iv,False); - @EVP_CIPHER_get_asn1_iv := LoadFunctionCLib(fn_EVP_CIPHER_get_asn1_iv,False); - @PKCS5_PBE_keyivgen := LoadFunctionCLib(fn_PKCS5_PBE_keyivgen,False); - @PKCS5_PBKDF2_HMAC_SHA1 := LoadFunctionCLib(fn_PKCS5_PBKDF2_HMAC_SHA1,False); - @PKCS5_PBKDF2_HMAC := LoadFunctionCLib(fn_PKCS5_PBKDF2_HMAC,False); - @PKCS5_v2_PBE_keyivgen := LoadFunctionCLib(fn_PKCS5_v2_PBE_keyivgen,False); - @PKCS5_PBE_add := LoadFunctionCLib(fn_PKCS5_PBE_add,False); - @EVP_PBE_CipherInit := LoadFunctionCLib(fn_EVP_PBE_CipherInit,False); - - @EVP_PBE_alg_add_type := LoadFunctionCLib(fn_EVP_PBE_alg_add_type,False); - @EVP_PBE_alg_add := LoadFunctionCLib(fn_EVP_PBE_alg_add,False); - @EVP_PBE_find := LoadFunctionCLib(fn_EVP_PBE_find,False); - @EVP_PBE_cleanup := LoadFunctionCLib(fn_EVP_PBE_cleanup,False); - @EVP_PKEY_asn1_get_count := LoadFunctionCLib(fn_EVP_PKEY_asn1_get_count,False); - @EVP_PKEY_asn1_get0 := LoadFunctionCLib(fn_EVP_PKEY_asn1_get0,False); - @EVP_PKEY_asn1_find := LoadFunctionCLib(fn_EVP_PKEY_asn1_find,False); - @EVP_PKEY_asn1_find_str := LoadFunctionCLib(fn_EVP_PKEY_asn1_find_str,False); - @EVP_PKEY_asn1_add0 := LoadFunctionCLib(fn_EVP_PKEY_asn1_add0,False); - @EVP_PKEY_asn1_add_alias := LoadFunctionCLib(fn_EVP_PKEY_asn1_add_alias,False); - @EVP_PKEY_asn1_get0_info := LoadFunctionCLib(fn_EVP_PKEY_asn1_get0_info,False); - @EVP_PKEY_get0_asn1 := LoadFunctionCLib(fn_EVP_PKEY_get0_asn1,False); - @EVP_PKEY_asn1_new := LoadFunctionCLib(fn_EVP_PKEY_asn1_new,False); - @EVP_PKEY_asn1_copy := LoadFunctionCLib(fn_EVP_PKEY_asn1_copy,False); - @EVP_PKEY_asn1_free := LoadFunctionCLib(fn_EVP_PKEY_asn1_free,False); - @EVP_PKEY_asn1_set_public := LoadFunctionCLib(fn_EVP_PKEY_asn1_set_public,False); - @EVP_PKEY_asn1_set_private := LoadFunctionCLib(fn_EVP_PKEY_asn1_set_private,False); - @EVP_PKEY_asn1_set_param := LoadFunctionCLib(fn_EVP_PKEY_asn1_set_param,False); - @EVP_PKEY_asn1_set_free := LoadFunctionCLib(fn_EVP_PKEY_asn1_set_free,False); - @EVP_PKEY_asn1_set_ctrl := LoadFunctionCLib(fn_EVP_PKEY_asn1_set_ctrl,False); - @EVP_PKEY_meth_find := LoadFunctionCLib(fn_EVP_PKEY_meth_find,False); - @EVP_PKEY_meth_new := LoadFunctionCLib(fn_EVP_PKEY_meth_new,False); - @EVP_PKEY_meth_get0_info := LoadFunctionCLib(fn_EVP_PKEY_meth_get0_info,False); - @EVP_PKEY_meth_copy := LoadFunctionCLib(fn_EVP_PKEY_meth_copy,False); - @EVP_PKEY_meth_free := LoadFunctionCLib(fn_EVP_PKEY_meth_free,False); - @EVP_PKEY_meth_add0 := LoadFunctionCLib(fn_EVP_PKEY_meth_add0,False); - @EVP_PKEY_CTX_new := LoadFunctionCLib(fn_EVP_PKEY_CTX_new,False); - @EVP_PKEY_CTX_new_id := LoadFunctionCLib(fn_EVP_PKEY_CTX_new_id,False); - @EVP_PKEY_CTX_dup := LoadFunctionCLib(fn_EVP_PKEY_CTX_dup,False); - @EVP_PKEY_CTX_free := LoadFunctionCLib(fn_EVP_PKEY_CTX_free,False); - @EVP_PKEY_CTX_ctrl := LoadFunctionCLib(fn_EVP_PKEY_CTX_ctrl,False); - @EVP_PKEY_CTX_ctrl_str := LoadFunctionCLib(fn_EVP_PKEY_CTX_ctrl_str,False); - @EVP_PKEY_CTX_get_operation := LoadFunctionCLib(fn_EVP_PKEY_CTX_get_operation,False); - @EVP_PKEY_CTX_set0_keygen_info := LoadFunctionCLib(fn_EVP_PKEY_CTX_set0_keygen_info,False); - @EVP_PKEY_new_mac_key := LoadFunctionCLib(fn_EVP_PKEY_new_mac_key,False); - @EVP_PKEY_CTX_set_data := LoadFunctionCLib(fn_EVP_PKEY_CTX_set_data,False); - @EVP_PKEY_CTX_get_data := LoadFunctionCLib(fn_EVP_PKEY_CTX_get_data,False); - @EVP_PKEY_CTX_get0_pkey := LoadFunctionCLib(fn_EVP_PKEY_CTX_get0_pkey,False); - @EVP_PKEY_CTX_get0_peerkey := LoadFunctionCLib(fn_EVP_PKEY_CTX_get0_peerkey,False); - @EVP_PKEY_CTX_set_app_data := LoadFunctionCLib(fn_EVP_PKEY_CTX_set_app_data,False); - @EVP_PKEY_CTX_get_app_data := LoadFunctionCLib(fn_EVP_PKEY_CTX_get_app_data,False); - @EVP_PKEY_sign_init := LoadFunctionCLib(fn_EVP_PKEY_sign_init,False); - @EVP_PKEY_sign := LoadFunctionCLib(fn_EVP_PKEY_sign,False); - @EVP_PKEY_verify_init := LoadFunctionCLib(fn_EVP_PKEY_verify_init,False); - @EVP_PKEY_verify := LoadFunctionCLib(fn_EVP_PKEY_verify,False); - @EVP_PKEY_verify_recover_init := LoadFunctionCLib(fn_EVP_PKEY_verify_recover_init,False); - @EVP_PKEY_verify_recover := LoadFunctionCLib(fn_EVP_PKEY_verify_recover,False); - @EVP_PKEY_encrypt_init := LoadFunctionCLib(fn_EVP_PKEY_encrypt_init,False); - @EVP_PKEY_encrypt := LoadFunctionCLib(fn_EVP_PKEY_encrypt,False); - @EVP_PKEY_decrypt_init := LoadFunctionCLib(fn_EVP_PKEY_decrypt_init,False); - @EVP_PKEY_decrypt := LoadFunctionCLib(fn_EVP_PKEY_decrypt,False); - @EVP_PKEY_derive_init := LoadFunctionCLib(fn_EVP_PKEY_derive_init,False); - @EVP_PKEY_derive_set_peer := LoadFunctionCLib(fn_EVP_PKEY_derive_set_peer,False); - @EVP_PKEY_derive := LoadFunctionCLib(fn_EVP_PKEY_derive,False); - @EVP_PKEY_paramgen_init := LoadFunctionCLib(fn_EVP_PKEY_paramgen_init,False); - @EVP_PKEY_paramgen := LoadFunctionCLib(fn_EVP_PKEY_paramgen,False); - @EVP_PKEY_keygen_init := LoadFunctionCLib(fn_EVP_PKEY_keygen_init,False); - @EVP_PKEY_keygen := LoadFunctionCLib(fn_EVP_PKEY_keygen,False); - @EVP_PKEY_CTX_set_cb := LoadFunctionCLib(fn_EVP_PKEY_CTX_set_cb,False); - @EVP_PKEY_CTX_get_cb := LoadFunctionCLib(fn_EVP_PKEY_CTX_get_cb,False); - @EVP_PKEY_CTX_get_keygen_info := LoadFunctionCLib(fn_EVP_PKEY_CTX_get_keygen_info,False); - @EVP_PKEY_meth_set_init := LoadFunctionCLib(fn_EVP_PKEY_meth_set_init,False); - @EVP_PKEY_meth_set_copy := LoadFunctionCLib(fn_EVP_PKEY_meth_set_copy,False); - @EVP_PKEY_meth_set_cleanup := LoadFunctionCLib(fn_EVP_PKEY_meth_set_cleanup,False); - @EVP_PKEY_meth_set_paramgen := LoadFunctionCLib(fn_EVP_PKEY_meth_set_paramgen,False); - @EVP_PKEY_meth_set_keygen := LoadFunctionCLib(fn_EVP_PKEY_meth_set_keygen,False); - @EVP_PKEY_meth_set_sign := LoadFunctionCLib(fn_EVP_PKEY_meth_set_sign,False); - @EVP_PKEY_meth_set_verify := LoadFunctionCLib(fn_EVP_PKEY_meth_set_verify,False); - @EVP_PKEY_meth_set_verify_recover := LoadFunctionCLib(fn_EVP_PKEY_meth_set_verify_recover,False); - @EVP_PKEY_meth_set_signctx := LoadFunctionCLib(fn_EVP_PKEY_meth_set_signctx,False); - @EVP_PKEY_meth_set_verifyctx := LoadFunctionCLib(fn_EVP_PKEY_meth_set_verifyctx,False); - @EVP_PKEY_meth_set_encrypt := LoadFunctionCLib(fn_EVP_PKEY_meth_set_encrypt,False); - @EVP_PKEY_meth_set_decrypt := LoadFunctionCLib(fn_EVP_PKEY_meth_set_decrypt,False); - @EVP_PKEY_meth_set_derive := LoadFunctionCLib(fn_EVP_PKEY_meth_set_derive,False); - @EVP_PKEY_meth_set_ctrl := LoadFunctionCLib(fn_EVP_PKEY_meth_set_ctrl,False); - //HMAC - {$IFNDEF OPENSSL_NO_HMAC} - @HMAC_CTX_init := LoadFunctionCLib(fn_HMAC_CTX_init); - if IsOpenSSL_1x then begin - @_HMAC_Init_ex := nil; - @_HMAC_Update := nil; - @_HMAC_Final := nil; - @_1_0_HMAC_Init_ex := LoadFunctionCLib(fn_HMAC_Init_ex); - @_1_0_HMAC_Update := LoadFunctionCLib(fn_HMAC_Update); - @_1_0_HMAC_Final := LoadFunctionCLib(fn_HMAC_Final); - end else begin - @_HMAC_Init_ex := LoadFunctionCLib(fn_HMAC_Init_ex); - @_HMAC_Update := LoadFunctionCLib(fn_HMAC_Update); - @_HMAC_Final := LoadFunctionCLib(fn_HMAC_Final); - @_1_0_HMAC_Init_ex := nil; - @_1_0_HMAC_Update := nil; - @_1_0_HMAC_Final := nil; - end; - @HMAC_CTX_cleanup := LoadFunctionCLib(fn_HMAC_CTX_cleanup); - {$ENDIF} - //OBJ - @OBJ_obj2nid := LoadFunctionCLib(fn_OBJ_obj2nid); - @OBJ_nid2obj := LoadFunctionCLib(fn_OBJ_nid2obj); - @OBJ_nid2ln := LoadFunctionCLib(fn_OBJ_nid2ln); - @OBJ_nid2sn := LoadFunctionCLib(fn_OBJ_nid2sn); - //ASN1 - @ASN1_INTEGER_set := LoadFunctionCLib(fn_ASN1_INTEGER_set); - @ASN1_INTEGER_get := LoadFunctionCLib(fn_ASN1_INTEGER_get); - @ASN1_INTEGER_to_BN := LoadFunctionCLib(fn_ASN1_INTEGER_to_BN); - @ASN1_STRING_type_new := LoadFunctionCLib(fn_ASN1_STRING_type_new); - @ASN1_STRING_free := LoadFunctionCLib(fn_ASN1_STRING_free); - @ASN1_dup := LoadFunctionCLib(fn_ASN1_dup ); - @CRYPTO_set_mem_functions := LoadFunctionCLib(fn_CRYPTO_set_mem_functions); - @CRYPTO_malloc := LoadFunctionCLib(fn_CRYPTO_malloc); - @CRYPTO_free := LoadFunctionCLib(fn_CRYPTO_free); - @CRYPTO_mem_leaks := LoadFunctionCLib(fn_CRYPTO_mem_leaks); - @CRYPTO_mem_ctrl := LoadFunctionCLib(fn_CRYPTO_mem_ctrl); - @CRYPTO_set_mem_debug_functions := LoadFunctionCLib(fn_CRYPTO_set_mem_debug_functions); - //@CRYPTO_dbg_malloc := LoadFunctionCLib(fn_CRYPTO_dbg_malloc); - //@CRYPTO_dbg_realloc := LoadFunctionCLib(fn_CRYPTO_dbg_realloc); - //@CRYPTO_dbg_free := LoadFunctionCLib(fn_CRYPTO_dbg_free); - //@CRYPTO_dbg_set_options := LoadFunctionCLib(fn_CRYPTO_dbg_set_options); - //@CRYPTO_dbg_get_options := LoadFunctionCLib(fn_CRYPTO_dbg_get_options); - @PKCS12_create := LoadFunctionCLib(fn_PKCS12_create); - @i2d_PKCS12_bio := LoadFunctionCLib(fn_i2d_PKCS12_bio); - @PKCS12_free := LoadFunctionCLib(fn_PKCS12_free); - @OpenSSL_add_all_algorithms := LoadOldCLib(fn_OpenSSL_add_all_algorithms, - fn_OPENSSL_add_all_algorithms_noconf); - @OpenSSL_add_all_ciphers := LoadFunctionCLib(fn_OpenSSL_add_all_ciphers); - @OpenSSL_add_all_digests := LoadFunctionCLib(fn_OpenSSL_add_all_digests); - @EVP_cleanup := LoadFunctionCLib(fn_EVP_cleanup); - - @sk_num := LoadFunctionCLib(fn_sk_num); - @sk_new := LoadFunctionCLib(fn_sk_new); - @sk_new_null := LoadFunctionCLib(fn_sk_new_null); - @sk_free := LoadFunctionCLib(fn_sk_free); - @sk_push := LoadFunctionCLib(fn_sk_push); - @sk_dup := LoadFunctionCLib(fn_sk_dup); - @sk_find := LoadFunctionCLib(fn_sk_find); - @sk_value := LoadFunctionCLib(fn_sk_value); - {$IFDEF OPENSSL_FIPS} - @_FIPS_mode_set := LoadFunctionCLib(fn_FIPS_mode_set,False); - @_FIPS_mode := LoadFunctionCLib(fn_FIPS_mode,False); - {$ENDIF} - - // TODO: expose a global callback function pointer, or an optional input - // parameter to Load(), so users can choose to load additional OpenSSL - // functions as desired using the DLL handles that we've already loaded... - { - if Assigned(LoadSSLFuncsCallback) then begin - LoadSSLFuncsCallback(hIdSSL, hIdCrypto, FFailedLoadList); - end; - } - - Result := (FFailedLoadList.Count = 0); -end; - -{$ENDIF} // STATICLOAD_OPENSSL - -procedure InitializeFuncPointers; -begin - @SSL_CTX_set_cipher_list := nil; - @SSL_CTX_new := nil; - @SSL_CTX_free := nil; - @SSL_set_fd := nil; - @SSL_CTX_use_PrivateKey_file := nil; - @SSL_CTX_use_PrivateKey := nil; - @SSL_CTX_use_certificate := nil; - @SSL_CTX_use_certificate_file := nil; - SSL_CTX_use_certificate_chain_file := nil; - @SSL_load_error_strings := nil; - @SSL_state_string_long := nil; - @SSL_load_error_strings := nil; - @SSL_alert_type_string_long := nil; - - @SSL_get_peer_certificate := nil; - @SSL_CTX_set_verify := nil; - @SSL_CTX_set_verify_depth := nil; - @SSL_CTX_get_verify_depth := nil; - @SSL_CTX_set_default_passwd_cb := nil; - @SSL_CTX_set_default_passwd_cb_userdata := nil; - @SSL_CTX_check_private_key := nil; - @SSL_new := nil; - @SSL_free := nil; - @SSL_accept := nil; - @SSL_connect := nil; - @SSL_read := nil; - @SSL_peek := nil; - @SSL_pending := nil; - @SSL_write := nil; - @SSL_ctrl := nil; - @SSL_callback_ctrl := nil; - @SSL_CTX_ctrl := nil; - @SSL_CTX_callback_ctrl := nil; - @SSL_get_error := nil; - @SSLv2_method := nil; - @SSLv2_server_method := nil; - @SSLv2_client_method := nil; - @SSLv3_method := nil; - @SSLv3_server_method := nil; - @SSLv3_client_method := nil; - @SSLv23_method := nil; - @SSLv23_server_method := nil; - @SSLv23_client_method := nil; - @TLSv1_method := nil; - @TLSv1_server_method := nil; - @TLSv1_client_method := nil; - @TLSv1_1_method := nil; - @TLSv1_1_server_method := nil; - @TLSv1_1_client_method := nil; - @TLSv1_2_method := nil; - @TLSv1_2_server_method := nil; - @TLSv1_2_client_method := nil; - @DTLSv1_method := nil; - @DTLSv1_server_method := nil; - @DTLSv1_client_method := nil; - @SSL_shutdown := nil; - @SSL_set_connect_state := nil; - @SSL_set_accept_state := nil; - @SSL_set_shutdown := nil; - @SSL_CTX_load_verify_locations := nil; - @SSL_get_session := nil; - @SSLeay_add_ssl_algorithms := nil; - @SSL_SESSION_get_id := nil; - @SSL_copy_session_id := nil; - // CRYPTO LIB - @_SSLeay_version := nil; - @SSLeay := nil; - @X509_NAME_oneline := nil; - @X509_NAME_hash := nil; - @X509_set_issuer_name := nil; - @X509_get_issuer_name := nil; - @X509_set_subject_name := nil; - @X509_get_subject_name := nil; - @X509_digest := nil; - @X509_LOOKUP_ctrl := nil; - @X509_STORE_add_cert := nil; - @X509_STORE_add_crl := nil; - @X509_STORE_CTX_get_ex_data := nil; - @X509_STORE_CTX_get_error := nil; - @X509_STORE_CTX_set_error := nil; - @X509_STORE_CTX_get_error_depth := nil; - @X509_STORE_CTX_get_current_cert := nil; - @X509_STORE_add_lookup := nil; - @X509_STORE_load_locations := nil; - @X509_sign := nil; - @X509_REQ_sign := nil; - @X509_REQ_add_extensions := nil; - @X509V3_EXT_conf_nid := nil; - @X509_EXTENSION_create_by_NID := nil; - @X509V3_set_ctx := nil; - @X509_EXTENSION_free := nil; - @X509_add_ext := nil; - {$IFNDEF OPENSSL_NO_BIO} - //X509_print - @X509_print := nil; - {$ENDIF} - @_RAND_cleanup := nil; - @_RAND_bytes := nil; - @_RAND_pseudo_bytes := nil; - @_RAND_seed := nil; - @_RAND_add := nil; - @_RAND_status := nil; - {$IFDEF SYS_WIN} - @_RAND_screen := nil; - @_RAND_event := nil; - {$ENDIF} - {$IFNDEF OPENSSL_NO_DES} - // 3DES - @DES_set_odd_parity := nil; - @DES_set_key := nil; - @DES_ecb_encrypt := nil; - @Id_ossl_old_des_set_odd_parity := nil; - @Id_ossl_old_des_set_key := nil; - @Id_ossl_old_des_ecb_encrypt := nil; - {$ENDIF} - // More SSL functions - @SSL_set_ex_data := nil; - @SSL_get_ex_data := nil; - @SSL_load_client_CA_file := nil; - @SSL_CTX_set_client_CA_list := nil; - @SSL_CTX_set_default_verify_paths := nil; - @SSL_CTX_set_session_id_context := nil; - @SSL_CIPHER_description := nil; - @SSL_get_current_cipher := nil; - @SSL_CIPHER_get_name := nil; - @SSL_CIPHER_get_version := nil; - @SSL_CIPHER_get_bits := nil; - // Thread safe - @_CRYPTO_num_locks := nil; - @CRYPTO_set_locking_callback := nil; - {$IFNDEF WIN32_OR_WIN64} - @CRYPTO_THREADID_set_callback := nil; - @CRYPTO_THREADID_set_numeric := nil; - @CRYPTO_THREADID_set_pointer := nil; - @CRYPTO_set_id_callback := nil; - {$ENDIF} - @ERR_put_error := nil; - @ERR_get_error := nil; - @ERR_peek_error := nil; - @ERR_peek_last_error := nil; - @ERR_clear_error := nil; - @ERR_error_string := nil; - @ERR_error_string_n := nil; - @ERR_lib_error_string := nil; - @ERR_func_error_string := nil; - @ERR_reason_error_string := nil; - @ERR_load_ERR_strings := nil; - @ERR_load_crypto_strings := nil; - @ERR_free_strings := nil; - @ERR_remove_thread_state := nil; - @ERR_remove_state := nil; - @CRYPTO_cleanup_all_ex_data := nil; - @SSL_COMP_get_compression_methods := nil; - @SSL_COMP_free_compression_methods := nil; - @sk_pop_free := nil; - //RSA - @RSA_new := nil; - @RSA_free := nil; - @RSA_size := nil; - @RSA_generate_key := nil; - @RSA_generate_key_ex := nil; - @RSA_check_key := nil; - @RSA_private_decrypt := nil; - @RSA_public_encrypt := nil; - //DH - @DH_free := nil; - //BIO - @BIO_set_flags := nil; - @BIO_new := nil; - @BIO_push := nil; - @BIO_pop := nil; - @BIO_set_next := nil; - @BIO_free := nil; - @BIO_free_all := nil; - @BIO_new_mem_buf := nil; - @BIO_s_mem := nil; - @BIO_s_file := nil; - @BIO_set_ex_data := nil; - @BIO_get_ex_data := nil; - @BIO_ctrl := nil; - @BIO_ptr_ctrl := nil; - @BIO_int_ctrl := nil; - @BIO_new_file := nil; - @BIO_puts := nil; - @BIO_read := nil; - @BIO_write := nil; - //BN - @BN_hex2bn := nil; - @BN_bn2dec := nil; - @BN_bn2hex := nil; - //i2d - @i2d_PKCS7 := nil; - @d2i_PKCS7 := nil; - @i2d_RSAPrivateKey := nil; - @d2i_RSAPrivateKey := nil; - @i2d_DSAPrivateKey := nil; - @d2i_DSAPrivateKey := nil; - @i2d_X509_bio := nil; - @i2d_PrivateKey_bio := nil; - @i2d_PrivateKey := nil; - @d2i_PrivateKey := nil; - @d2i_PrivateKey_bio := nil; - @i2d_X509 := nil; - @d2i_X509_bio := nil; - @d2i_X509 := nil; - @d2i_PKCS12_bio := nil; - @PKCS12_parse := nil; - @X509_NAME_new := nil; - @X509_NAME_free := nil; - @i2d_X509_REQ_bio := nil; - @i2d_X509_REQ := nil; - @d2i_X509_REQ := nil; - @i2d_X509_NAME := nil; - @d2i_X509_NAME := nil; - @i2d_DSAparams := nil; - @d2i_DSAparams := nil; - @i2d_DHparams := nil; - @d2i_DHparams := nil; - @i2d_NETSCAPE_CERT_SEQUENCE := nil; - @d2i_NETSCAPE_CERT_SEQUENCE := nil; - @i2d_PUBKEY := nil; - @d2i_PUBKEY := nil; - //X509 - @X509_get_default_cert_file := nil; - @X509_get_default_cert_file_env := nil; - @X509_new := nil; - @X509_free := nil; - @X509_REQ_new := nil; - @X509_REQ_free := nil; - @X509_to_X509_REQ := nil; - @X509_NAME_add_entry_by_txt := nil; - @X509_INFO_free := nil; - @X509_set_version := nil; - @X509_get_serialNumber := nil; - @X509_gmtime_adj := nil; - @X509_set_notBefore := nil; - @X509_set_notAfter := nil; - @X509_set_pubkey := nil; - @X509_REQ_set_pubkey := nil; - //PEM - {$IFNDEF SSLEAY_MACROS} - @_PEM_read_bio_X509 := nil; - @_PEM_read_bio_X509_REQ := nil; - @_PEM_read_bio_X509_CRL := nil; - @_PEM_read_bio_RSAPrivateKey := nil; - @_PEM_read_bio_RSAPublicKey := nil; - @_PEM_read_bio_DSAPrivateKey := nil; - @_PEM_read_bio_PrivateKey := nil; - @_PEM_read_bio_PKCS7 := nil; - @_PEM_read_bio_DHparams := nil; - @_PEM_read_bio_DSAparams := nil; - @_PEM_read_bio_NETSCAPE_CERT_SEQUENCE := nil; - @_PEM_read_bio_PUBKEY := nil; - @_PEM_write_bio_X509 := nil; - @_PEM_write_bio_X509_REQ := nil; - @_PEM_write_bio_X509_CRL := nil; - @_PEM_write_bio_RSAPublicKey := nil; - @_PEM_write_bio_RSAPrivateKey := nil; - @_PEM_write_bio_DSAPrivateKey := nil; - @_PEM_write_bio_PrivateKey := nil; - @_PEM_write_bio_PKCS7 := nil; - @_PEM_write_bio_DHparams := nil; - @_PEM_write_bio_DSAparams := nil; - @_PEM_write_bio_NETSCAPE_CERT_SEQUENCE := nil; - @_PEM_write_bio_PKCS8PrivateKey := nil; - @_PEM_write_bio_PUBKEY := nil; - {$ELSE} - @PEM_ASN1_write_bio := nil; - @PEM_ASN1_read_bio := nil; - {$ENDIF} - @PEM_X509_INFO_read_bio := nil; - @PEM_read_bio_X509_AUX := nil; - //EVP - {$IFNDEF OPENSSL_NO_DES} - @EVP_des_ede3_cbc := nil; - {$ENDIF} - {$IFNDEF OPENSSL_NO_SHA512} - @EVP_sha512 := nil; - @EVP_sha384 := nil; - {$ENDIF} - {$IFNDEF OPENSSL_NO_SHA256} - @EVP_sha256 := nil; - @EVP_sha224 := nil; - {$ENDIF} - {$IFNDEF OPENSSL_NO_SHA} - @EVP_sha := nil; - @EVP_sha1 := nil; - @EVP_dss := nil; - @EVP_dss1 := nil; - @EVP_ecdsa := nil; - {$ENDIF} - {$IFNDEF OPENSSL_NO_MD5} - @EVP_md5 := nil; - {$ENDIF} - {$IFNDEF OPENSSL_NO_MD4} - @EVP_md4 := nil; - {$ENDIF} - {$IFNDEF OPENSSL_NO_MD2} - @EVP_md2 := nil; - {$ENDIF} - {$ifndef OPENSSL_NO_MDC2} - @EVP_mdc2 := nil; - {$endif} - {$IFNDEF OPENSSL_NO_MD5} - @EVP_md5 := nil; - {$ENDIF} - - {$ifndef OPENSSL_NO_RIPEMD} - EVP_ripemd160 := nil; - {$endif} - {$ifndef OPENSSL_NO_WHIRLPOOL} - @EVP_whirlpool := nil; - {$endif} - @EVP_md_null := nil; - {$IFNDEF OPENSSL_NO_DES} - @EVP_des_ecb := nil; - @EVP_des_ede := nil; - @EVP_des_ede3 :=nil; - @EVP_des_ede_ecb := nil; - @EVP_des_ede3_ecb := nil; - @EVP_des_cfb64 := nil; - - @EVP_des_cfb1 := nil; - @EVP_des_cfb8 := nil; - @EVP_des_ede_cfb64 := nil; -//#if 0 - // @EVP_des_ede_cfb1 := nil; - // @EVP_des_ede_cfb8 := nil; - //#endif - @EVP_des_ede3_cfb64 :=nil; - @EVP_des_ede3_cfb1 := nil; - @EVP_des_ede3_cfb8 := nil; - @EVP_des_ofb := nil; - @EVP_des_ede_ofb := nil; - @EVP_des_ede3_ofb := nil; - @EVP_des_cbc := nil; - @EVP_des_ede_cbc := nil; - @EVP_desx_cbc := nil; -//* This should now be supported through the dev_crypto ENGINE. But also, why are -// * rc4 and md5 declarations made here inside a "NO_DES" precompiler branch? */ -//#if 0 - {$ifdef OPENSSL_OPENBSD_DEV_CRYPTO} - @EVP_dev_crypto_des_ede3_cbc := nil; - @EVP_dev_crypto_rc4 := nil; - @EVP_dev_crypto_md5 := nil; - {$endif} -//#endif - {$endif} - - {$ifndef OPENSSL_NO_RC4} - @EVP_rc4 := nil; - @EVP_rc4_40 := nil; - {$ifndef OPENSSL_NO_MD5} - @EVP_rc4_hmac_md5 := nil; - {$endif} - {$endif} - {$ifndef OPENSSL_NO_IDEA} - @EVP_idea_ecb := nil; - @EVP_idea_cfb64 := nil; - @EVP_idea_ofb := nil; - @EVP_idea_cbc := nil; - {$endif} - {$ifndef OPENSSL_NO_RC2} - @EVP_rc2_ecb := nil; - @EVP_rc2_cbc := nil; - @EVP_rc2_40_cbc := nil; - @EVP_rc2_64_cbc := nil; - @EVP_rc2_cfb64 := nil; - @EVP_rc2_ofb := nil; - {$endif} - {$ifndef OPENSSL_NO_BF} - @EVP_bf_ecb := nil; - @EVP_bf_cbc := nil; - @EVP_bf_cfb64 := nil; - @EVP_bf_ofb := nil; - {$endif} - {$ifndef OPENSSL_NO_CAST} - @EVP_cast5_ecb := nil; - @EVP_cast5_cbc := nil; - @EVP_cast5_cfb64 := nil; - @EVP_cast5_ofb := nil; - {$endif} - {$ifndef OPENSSL_NO_RC5} - @EVP_rc5_32_12_16_cbc := nil; - @EVP_rc5_32_12_16_ecb := nil; - @EVP_rc5_32_12_16_cfb64 := nil; - @EVP_rc5_32_12_16_ofb := nil; - {$endif} - {$ifndef OPENSSL_NO_AES} - @EVP_aes_128_ecb := nil; - @EVP_aes_128_cbc := nil; - @EVP_aes_128_cfb1:= nil; - @EVP_aes_128_cfb8:= nil; - @EVP_aes_128_cfb128 := nil; - @EVP_aes_128_ofb := nil; - @EVP_aes_128_ctr := nil; - @EVP_aes_128_gcm := nil; - @EVP_aes_128_ccm := nil; - @EVP_aes_128_xts := nil; - @EVP_aes_192_ecb := nil; - @EVP_aes_192_cbc := nil; - @EVP_aes_192_cfb1 := nil; - @EVP_aes_192_cfb128 := nil; - - @EVP_aes_192_ofb := nil; - @EVP_aes_192_ctr := nil; - @EVP_aes_192_gcm := nil; - @EVP_aes_192_ccm := nil; - @EVP_aes_256_ecb := nil; - @EVP_aes_256_cbc := nil; - @EVP_aes_256_cfb1 := nil; - @EVP_aes_256_cfb8 := nil; - @EVP_aes_256_cfb128 := nil; - @EVP_aes_256_ofb := nil; - @EVP_aes_256_ctr := nil; - @EVP_aes_256_gcm := nil; - @EVP_aes_256_ccm := nil; - @EVP_aes_256_xts := nil; - {$ifndef OPENSSL_NO_SHA} - {$ifndef OPENSSL_NO_SHA1} - @EVP_aes_128_cbc_hmac_sha1 := nil; - @EVP_aes_256_cbc_hmac_sha1 := nil; - {$endif} - {$endif} - {$endif} - {$ifndef OPENSSL_NO_CAMELLIA} - @EVP_camellia_128_ecb := nil; - @EVP_camellia_128_cbc := nil; - @EVP_camellia_128_cfb1 := nil; - @EVP_camellia_128_cfb8 := nil; - @EVP_camellia_128_cfb128 := nil; - @EVP_camellia_128_ofb := nil; - @EVP_camellia_192_ecb := nil; - - @EVP_camellia_192_cbc := nil; - @EVP_camellia_192_cfb1 := nil; - @EVP_camellia_192_cfb8 := nil; - @EVP_camellia_192_cfb128 :=nil; - @EVP_camellia_192_ofb := nil; - @EVP_camellia_256_ecb := nil; - @EVP_camellia_256_cbc := nil; - @EVP_camellia_256_cfb1 := nil; - @EVP_camellia_256_cfb8 := nil; - @EVP_camellia_256_cfb128 := nil; - @EVP_camellia_256_ofb := nil; - {$endif} - - {$ifndef OPENSSL_NO_SEED} - @EVP_seed_ecb := nil; - @EVP_seed_cbc := nil; - @EVP_seed_cfb128 := nil; - @EVP_seed_ofb := nil; - {$endif} - - @EVP_MD_CTX_init := nil; - @EVP_MD_CTX_cleanup := nil; - @EVP_MD_CTX_create := nil; - @EVP_MD_CTX_destroy := nil; - @EVP_MD_CTX_copy := nil; - @EVP_MD_CTX_copy_ex := nil; - //@EVP_MD_CTX_set_flags := nil; - //@EVP_MD_CTX_clear_flags := nil; - //@EVP_MD_CTX_test_flags := nil; - - @EVP_DigestInit := nil; - @EVP_DigestInit_ex := nil; - @EVP_DigestUpdate := nil; - @EVP_DigestFinal_ex := nil; - - @EVP_EncryptInit := nil; - @EVP_EncryptInit_ex := nil; - @EVP_EncryptUpdate := nil; - @EVP_EncryptFinal_ex := nil; - @EVP_EncryptFinal := nil; - - @EVP_DecryptInit := nil; - @EVP_DecryptInit_ex := nil; - @EVP_DecryptUpdate := nil; - @EVP_DecryptFinal := nil; - @EVP_DecryptFinal_ex := nil; - @EVP_CipherInit := nil; - @EVP_CipherInit_ex := nil; - @EVP_CipherUpdate := nil; - @EVP_CipherFinal := nil; - @EVP_CipherFinal_ex := nil; - @EVP_SignFinal := nil; - @EVP_VerifyFinal := nil; - @EVP_DigestSignInit := nil; - @EVP_DigestSignFinal := nil; - @EVP_DigestVerifyInit := nil; - @EVP_DigestVerifyFinal := nil; - @EVP_OpenInit := nil; - @EVP_OpenFinal := nil; - @EVP_SealInit := nil; - @EVP_SealFinal := nil; - @EVP_EncodeInit := nil; - - @EVP_EncodeUpdate := nil; - @EVP_EncodeFinal := nil; - @EVP_EncodeBlock := nil; - @EVP_DecodeInit := nil; - @EVP_DecodeUpdate := nil; - @EVP_DecodeFinal := nil; - @EVP_DecodeBlock := nil; - - @EVP_CIPHER_CTX_init := nil; - - @EVP_CIPHER_CTX_cleanup := nil; - @EVP_CIPHER_CTX_new := nil; - @EVP_CIPHER_CTX_free := nil; - @EVP_CIPHER_CTX_set_key_length := nil; - @EVP_CIPHER_CTX_set_padding := nil; - @EVP_CIPHER_CTX_ctrl := nil; - @EVP_CIPHER_CTX_rand_key := nil; - - @EVP_add_cipher := nil; - @EVP_add_digest := nil; - @EVP_CIPHER_do_all := nil; - @EVP_CIPHER_do_all_sorted := nil; - @EVP_MD_do_all := nil; - @EVP_MD_do_all_sorted := nil; - @EVP_PKEY_decrypt_old := nil; - @EVP_PKEY_encrypt_old := nil; - @EVP_PKEY_type := nil; - @EVP_PKEY_id := nil; - @EVP_PKEY_base_id := nil; - @EVP_PKEY_bits := nil; - @EVP_PKEY_size := nil; - @EVP_PKEY_set_type := nil; - @EVP_PKEY_set_type_str := nil; - @EVP_PKEY_get0 := nil; - {$ifndef OPENSSL_NO_RSA} - @EVP_PKEY_set1_RSA := nil; - @EVP_PKEY_get1_RSA := nil; - {$ENDIF} - {$ifndef OPENSSL_NO_DSA} - @EVP_PKEY_set1_DSA := nil; - @EVP_PKEY_get1_DSA := nil; - {$endif} - {$ifndef OPENSSL_NO_DH} - @EVP_PKEY_set1_DH := nil; - @EVP_PKEY_get1_DH := nil; - {$endif} - {$ifndef OPENSSL_NO_EC} - @EVP_PKEY_set1_EC_KEY := nil; - @EVP_PKEY_get1_EC_KEY := nil; - {$endif} - - {$EXTERNALSYM d2i_PublicKey} - @d2i_PublicKey := nil; - @i2d_PublicKey := nil; - @d2i_AutoPrivateKey := nil; - @EVP_PKEY_copy_parameters := nil; - @EVP_PKEY_missing_parameters := nil; - @EVP_PKEY_save_parameters := nil; - @EVP_PKEY_cmp_parameters := nil; - @EVP_PKEY_cmp := nil; - @EVP_PKEY_print_public := nil; - @EVP_PKEY_print_private := nil; - @EVP_PKEY_print_params := nil; - @EVP_PKEY_get_default_digest_nid := nil; - @EVP_CIPHER_param_to_asn1 := nil; - @EVP_CIPHER_asn1_to_param := nil; - @EVP_CIPHER_set_asn1_iv := nil; - @EVP_CIPHER_get_asn1_iv := nil; - @PKCS5_PBE_keyivgen := nil; - @PKCS5_PBKDF2_HMAC_SHA1 := nil; - @PKCS5_PBKDF2_HMAC := nil; - @PKCS5_v2_PBE_keyivgen := nil; - @PKCS5_PBE_add := nil; - @EVP_PBE_CipherInit := nil; - - @EVP_PBE_alg_add_type := nil; - @EVP_PBE_alg_add := nil; - @EVP_PBE_find := nil; - @EVP_PBE_cleanup := nil; - @EVP_PKEY_asn1_get_count := nil; - @EVP_PKEY_asn1_get0 := nil; - @EVP_PKEY_asn1_find := nil; - @EVP_PKEY_asn1_find_str := nil; - @EVP_PKEY_asn1_add0 := nil; - @EVP_PKEY_asn1_add_alias := nil; - @EVP_PKEY_asn1_get0_info := nil; - @EVP_PKEY_get0_asn1 := nil; - @EVP_PKEY_asn1_new := nil; - @EVP_PKEY_asn1_copy := nil; - @EVP_PKEY_asn1_free := nil; - @EVP_PKEY_asn1_set_public := nil; - @EVP_PKEY_asn1_set_private := nil; - @EVP_PKEY_asn1_set_param := nil; - @EVP_PKEY_asn1_set_free := nil; - @EVP_PKEY_asn1_set_ctrl := nil; - @EVP_PKEY_meth_find := nil; - @EVP_PKEY_meth_new := nil; - @EVP_PKEY_meth_get0_info := nil; - @EVP_PKEY_meth_copy := nil; - @EVP_PKEY_meth_free := nil; - @EVP_PKEY_meth_add0 := nil; - @EVP_PKEY_CTX_new := nil; - @EVP_PKEY_CTX_new_id := nil; - @EVP_PKEY_CTX_dup := nil; - @EVP_PKEY_CTX_free := nil; - @EVP_PKEY_CTX_ctrl := nil; - @EVP_PKEY_CTX_ctrl_str := nil; - @EVP_PKEY_CTX_get_operation := nil; - @EVP_PKEY_CTX_set0_keygen_info := nil; - @EVP_PKEY_new_mac_key := nil; - @EVP_PKEY_CTX_set_data := nil; - @EVP_PKEY_CTX_get_data := nil; - @EVP_PKEY_CTX_get0_pkey := nil; - @EVP_PKEY_CTX_get0_peerkey := nil; - @EVP_PKEY_CTX_set_app_data := nil; - @EVP_PKEY_CTX_get_app_data := nil; - @EVP_PKEY_sign_init := nil; - @EVP_PKEY_sign := nil; - @EVP_PKEY_verify_init := nil; - @EVP_PKEY_verify := nil; - @EVP_PKEY_verify_recover_init := nil; - @EVP_PKEY_verify_recover := nil; - @EVP_PKEY_encrypt_init := nil; - @EVP_PKEY_encrypt := nil; - @EVP_PKEY_decrypt_init := nil; - @EVP_PKEY_decrypt := nil; - @EVP_PKEY_derive_init := nil; - @EVP_PKEY_derive_set_peer := nil; - @EVP_PKEY_derive := nil; - @EVP_PKEY_paramgen_init := nil; - @EVP_PKEY_paramgen := nil; - @EVP_PKEY_keygen_init := nil; - @EVP_PKEY_keygen := nil; - @EVP_PKEY_CTX_set_cb := nil; - @EVP_PKEY_CTX_get_cb := nil; - @EVP_PKEY_CTX_get_keygen_info := nil; - @EVP_PKEY_meth_set_init := nil; - @EVP_PKEY_meth_set_copy := nil; - @EVP_PKEY_meth_set_cleanup := nil; - @EVP_PKEY_meth_set_paramgen := nil; - @EVP_PKEY_meth_set_keygen := nil; - @EVP_PKEY_meth_set_sign := nil; - @EVP_PKEY_meth_set_verify := nil; - @EVP_PKEY_meth_set_verify_recover := nil; - @EVP_PKEY_meth_set_signctx := nil; - @EVP_PKEY_meth_set_verifyctx := nil; - @EVP_PKEY_meth_set_encrypt := nil; - @EVP_PKEY_meth_set_decrypt := nil; - @EVP_PKEY_meth_set_derive := nil; - @EVP_PKEY_meth_set_ctrl := nil; -{$ifndef OPENSSL_NO_BIO} - BIO_f_md := nil; - BIO_f_base64 := nil; - BIO_f_cipher := nil; - BIO_f_reliable := nil; - BIO_set_cipher := nil; -{$endif} - @EVP_PKEY_type := nil; - @EVP_PKEY_new := nil; - @EVP_PKEY_free := nil; - @EVP_PKEY_assign := nil; - @EVP_get_cipherbyname := nil; - @EVP_get_digestbyname := nil; - @EVP_MD_type := nil; - @EVP_MD_size := nil; - @EVP_MD_block_size := nil; - @EVP_MD_flags := nil; - @EVP_MD_CTX_md := nil; - @EVP_CIPHER_nid := nil; - @EVP_CIPHER_block_size := nil; - @EVP_CIPHER_key_length := nil; - @EVP_CIPHER_iv_length := nil; - @EVP_CIPHER_flags := nil; - @EVP_CIPHER_type := nil; - @EVP_CIPHER_CTX_cipher := nil; - @EVP_CIPHER_CTX_nid := nil; - @EVP_CIPHER_CTX_block_size := nil; - @EVP_CIPHER_CTX_key_length := nil; - @EVP_CIPHER_CTX_iv_length := nil; - @EVP_CIPHER_CTX_copy := nil; - @EVP_CIPHER_CTX_get_app_data := nil; - @EVP_CIPHER_CTX_set_app_data := nil; - @EVP_CIPHER_CTX_flags := nil; - - //HMAC -{$IFNDEF OPENSSL_NO_HMAC} - @HMAC_CTX_init := nil; - @_HMAC_Init_ex := nil; - @_HMAC_Update := nil; - @_HMAC_Final := nil; - @_1_0_HMAC_Init_ex := nil; - @_1_0_HMAC_Update := nil; - @_1_0_HMAC_Final := nil; - @HMAC_CTX_cleanup := nil; -{$ENDIF} - //OBJ - @OBJ_obj2nid := nil; - @OBJ_nid2obj := nil; - @OBJ_nid2ln := nil; - @OBJ_nid2sn := nil; - //ASN1 - @ASN1_INTEGER_set := nil; - @ASN1_INTEGER_get := nil; - @ASN1_INTEGER_to_BN := nil; - @ASN1_STRING_type_new := nil; - @ASN1_STRING_free := nil; - @ASN1_dup := nil; - @_CRYPTO_lock := nil; - @CRYPTO_set_mem_functions := nil; - @CRYPTO_malloc := nil; - @CRYPTO_free := nil; - @CRYPTO_mem_leaks := nil; - @CRYPTO_mem_ctrl := nil; - @CRYPTO_set_mem_debug_functions := nil; - //@CRYPTO_dbg_malloc := nil; - //@CRYPTO_dbg_realloc := nil; - //@CRYPTO_dbg_free := nil; - //@CRYPTO_dbg_set_options := nil; - //@CRYPTO_dbg_get_options := nil; - @PKCS12_create := nil; - @i2d_PKCS12_bio := nil; - @PKCS12_free := nil; - @OpenSSL_add_all_algorithms := nil; - @OpenSSL_add_all_ciphers := nil; - @OpenSSL_add_all_digests := nil; - @EVP_cleanup := nil; - @sk_new := nil; - @sk_num := nil; - @sk_new_null := nil; - @sk_free := nil; - @sk_push := nil; - @sk_dup := nil; - @sk_find := nil; - @sk_value := nil; - {$IFDEF OPENSSL_FIPS} - @_FIPS_mode_set := nil; - @_FIPS_mode := nil; - {$ENDIF} - - // TODO: expose a global callback function pointer, or an optional input - // parameter to InitializeFuncPointers(), so users can reset any additional - // OpenSSL function pointers they loaded manually during Load()... - { - if Assigned(UnloadSSLFuncsCallback) then begin - UnloadSSLFuncsCallback(); - end; - } -end; - -procedure Unload; -var - LStack: Pointer; -begin - if {$IFDEF STATICLOAD_OPENSSL}bIsLoaded{$ELSE}hIdSSL <> IdNilHandle{$ENDIF} then begin - if Assigned(SSL_COMP_free_compression_methods) then begin - SSL_COMP_free_compression_methods; - end - //this is a workaround for a known leak in the openssl library - //present in 0.9.8a - else if Assigned(SSLeay) then begin - if SSLeay = $0090801f then begin - if Assigned(SSL_COMP_get_compression_methods) and - Assigned(sk_pop_free) and - Assigned(CRYPTO_free) then - begin - LStack := SSL_COMP_get_compression_methods; - sk_pop_free(LStack, CRYPTO_free); - end; - end; - end; - if Assigned(CRYPTO_cleanup_all_ex_data) then begin - CRYPTO_cleanup_all_ex_data; - end; - if Assigned(ERR_free_strings) then begin - ERR_free_strings; - end; - if Assigned(ERR_remove_thread_state) then begin - ERR_remove_thread_state(nil); - end - else if Assigned(ERR_remove_state) then begin - ERR_remove_state(0); - end; - if Assigned(EVP_cleanup) then begin - EVP_cleanup; - end; - {$IFDEF STATICLOAD_OPENSSL} - bIsLoaded := False; - {$ELSE} - {$IFDEF WINDOWS}Windows.{$ENDIF}FreeLibrary(hIdSSL); - hIdSSL := IdNilHandle; - {$ENDIF} - end; - - {$IFNDEF STATICLOAD_OPENSSL} - if hIdCrypto <> IdNilHandle then begin - {$IFDEF WINDOWS}Windows.{$ENDIF}FreeLibrary(hIdCrypto); - hIdCrypto := IdNilHandle; - end; - {$ENDIF} - - {$IFDEF USE_INVALIDATE_MOD_CACHE} - InvalidateModuleCache; - {$ENDIF} - - {$IFNDEF STATICLOAD_OPENSSL} - { - IMPORTANT!! - - We probably should reinitialize the functions to nil after the library is - unloaded as some code will test for their presence with Assigned. - } - InitializeFuncPointers; - {$ENDIF} -end; - - -{$IFNDEF STATICLOAD_OPENSSL} -function WhichFailedToLoad: string; -begin - Assert(FFailedLoadList<>nil); - Result := FFailedLoadList.CommaText; -end; -{$ENDIF} - -// Author : Gregor Ibich (gregor.ibic@intelicom.si) -// Pascal translation: Doychin Bondzhev (doichin@5group.com) - -// Converts the following string representations into corresponding parts -// YYYYMMDDHHMMSS(+|-)HH( )MM (GeneralizedTime, for dates 2050 and later) -// YYMMDDHHMMSS(+|-)HH( )MM (UTCTime, for dates up to 2049) -function UTC_Time_Decode(UCTtime : PASN1_UTCTIME; var year, month, day, hour, min, sec: Word; - var tz_hour, tz_min: Integer): Integer; -var - i, tz_dir, index: Integer; - time_str: string; - {$IFNDEF USE_MARSHALLED_PTRS} - {$IFNDEF STRING_IS_ANSI} - LTemp: AnsiString; - {$ENDIF} - {$ENDIF} -begin - Result := 0; - if UCTtime^.length < 12 then begin - Exit; - end; - {$IFDEF USE_MARSHALLED_PTRS} - time_str := TMarshal.ReadStringAsAnsi(TPtrWrapper.Create(UCTtime^.data), UCTtime^.length); - {$ELSE} - {$IFDEF STRING_IS_ANSI} - SetString(time_str, UCTtime^.data, UCTtime^.length); - {$ELSE} - SetString(LTemp, UCTtime^.data, UCTtime^.length); - // TODO: do we need to use SetCodePage() here? - time_str := String(LTemp); // explicit convert to Unicode - {$ENDIF} - {$ENDIF} - // Check if first 14 chars (4-digit year) are numbers - if (Length(time_str) >= 14) and IsNumeric(time_str, 14) then begin - // Convert time from string to number - year := IndyStrToInt(Copy(time_str, 1, 4)); - month := IndyStrToInt(Copy(time_str, 5, 2)); - day := IndyStrToInt(Copy(time_str, 7, 2)); - hour := IndyStrToInt(Copy(time_str, 9, 2)); - min := IndyStrToInt(Copy(time_str, 11, 2)); - sec := IndyStrToInt(Copy(time_str, 13, 2)); - index := 15; - end - // Check if first 12 chars (2-digit year) are numbers - else if (Length(time_str) >= 12) and IsNumeric(time_str, 12) then begin - // Convert time from string to number - year := IndyStrToInt(Copy(time_str, 1, 2)) + 1900; - month := IndyStrToInt(Copy(time_str, 3, 2)); - day := IndyStrToInt(Copy(time_str, 5, 2)); - hour := IndyStrToInt(Copy(time_str, 7, 2)); - min := IndyStrToInt(Copy(time_str, 9, 2)); - sec := IndyStrToInt(Copy(time_str, 11, 2)); - // Fix year. This function is Y2k but isn't compatible with Y2k5 :-( {Do not Localize} - if year < 1950 then begin - Inc(year, 100); - end; - index := 13; - end else begin - Exit; - end; - // Check TZ - tz_hour := 0; - tz_min := 0; - if CharIsInSet(time_str, index, '-+') then begin {Do not Localize} - tz_dir := iif(CharEquals(time_str, index, '-'), -1, 1); {Do not Localize} - for i := index+1 to index+5 do begin // Check if numbers are numbers - if i = index+3 then begin - Continue; - end; - if not IsNumeric(time_str[i]) then begin - Exit; - end; - end; - tz_hour := IndyStrToInt(Copy(time_str, index+1, 2)) * tz_dir; - tz_min := IndyStrToInt(Copy(time_str, index+4, 2)) * tz_dir; - end; - Result := 1; -end; - -function SSL_set_app_data(s: PSSL; arg: Pointer): TIdC_INT; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := SSL_set_ex_data(s, 0, arg); -end; - -function SSL_get_app_data(s: PSSL): Pointer; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := SSL_get_ex_data(s, 0); -end; - -procedure InitializeRandom; -begin - {$IFDEF SYS_WIN} - if Assigned(_RAND_screen) then begin - _RAND_screen; - end; - {$ENDIF} -end; - -procedure CleanupRandom; -begin - if Assigned(_RAND_cleanup) then begin - _RAND_cleanup; - end; -end; - -function M_ASN1_STRING_length(x : PASN1_STRING): TIdC_INT; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := x^.length; -end; - -procedure M_ASN1_STRING_length_set(x : PASN1_STRING; n : TIdC_INT); -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - x^.length := n; -end; - -function M_ASN1_STRING_type(x : PASN1_STRING) : TIdC_INT; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := x^._type; -end; - -function M_ASN1_STRING_data(x : PASN1_STRING) : PIdAnsiChar; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := x^.data; -end; - -function X509_NAME_dup(xn : PX509_NAME) : PX509_NAME; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := ASN1_dup(i2d_of_Void(i2d_X509_NAME), d2i_of_void(d2i_X509_NAME), PIdAnsiChar(xn) ); -end; - -function X509_STORE_CTX_get_app_data(ctx: PX509_STORE_CTX):Pointer; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - // TODO: use SSL_get_ex_data_X509_STORE_CTX_idx() instead of 0 to get the true index of the SSL pointer - Result := X509_STORE_CTX_get_ex_data(ctx, 0); -end; - -function X509_get_version(x : PX509): TIdC_LONG; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := ASN1_INTEGER_get(x^.cert_info^.version); -end; - -function X509_get_signature_type(x : PX509) : TIdC_INT; -{$IFDEF USE_INLINE} inline; {$ENDIF} -{ -http://groups.google.com/group/mailing.openssl.dev/browse_thread/thread/c1ab56fc4fb7af6a/98a2e94fe893aecf?lnk=st&q=X509_get_signature_type+&rnum=1&hl=en#98a2e94fe893aecf - -Austin Krauss via RT wrote: - -> D:\openssl-0.9.7b\out32dll\Release>openssl version -a -> OpenSSL 0.9.7b 10 Apr 2003 -> built on: date not available -> platform: information not available -> options: bn(64,32) md2(int) rc4(idx,int) des(idx,cisc,4,long) idea(int) blowfish(idx) -> compiler: information not available -> OPENSSLDIR: "/usr/local/ssl" - -> Windows 2000 SP3 x86 -> Visual C++ 6.0 SP5 - -> I'm running into a problem parsing the certificate that I've recieved from the peer. I'm trying to call X509_get_signature_type(...) to get the key algorithm used. After I went through this function with the debugger, I'm finding that "NID_sha1WithRSAEncryption" (which is correct by the way) is getting passed to EVP_PKEY_type(...). It seems as if there is not a EVP constant that maps to this particular NID and thus EVP_PKEY_type is returning NID_undef to my function. - -As a addition to: -http://marc.theaimsgroup.com/?l=openssl-users&m=105074607225189&w=2 -I would suggest that X509_get_signature_type(x) should -be changed to 'OBJ_obj2nid((x)->sig_alg->algorithm' (i.e. remove -the call to EVP_PKEY_type()) because currently this macro -returns the type of the key used for the signature generation -and *not* the type of the signature (i.e. key alg + hash alg). -The other solution would be to change EVP_PKEY_type() to -include the other RSA OIDs as well (from the usage of this macro -in OpenSSL the second alternative is simpler to implement, but -in this case the name of the macro should better be changed to -X509_get_signature_key_type() :-). - -Regards, -Nils -} -begin - Assert(x<>nil); - Result := EVP_PKEY_type(OBJ_obj2nid(x.sig_alg.algorithm)); -end; - -function X509_REQ_get_subject_name(x:PX509_REQ):PX509_NAME; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Assert(x<>nil); - Result := x^.req_info^.subject; -end; - -//function X509_get_notBefore(x509: PX509):PASN1_UTCTIME; -function X509_get_notBefore(x509: PX509):PASN1_TIME; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Assert(x509<>nil); - Result := x509.cert_info.validity.notBefore; -end; - -//function X509_get_notAfter(x509: PX509):PASN1_UTCTIME; -function X509_get_notAfter(x509: PX509):PASN1_TIME; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Assert(x509<>nil); - Result := x509.cert_info.validity.notAfter; -end; - -function X509_REQ_get_version(x : PX509_REQ): TIdC_LONG; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := ASN1_INTEGER_get(x^.req_info^.version); -end; - -function X509_CRL_get_version(x : PX509_CRL) : TIdC_LONG; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := ASN1_INTEGER_get(x^.crl^.version); -end; - -function X509_CRL_get_lastUpdate(x : PX509_CRL) : PASN1_TIME; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := x^.crl^.lastUpdate; -end; - -function X509_CRL_get_nextUpdate(x : PX509_CRL) : PASN1_TIME; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := x^.crl^.nextUpdate; -end; - -function X509_CRL_get_issuer(x : PX509_CRL) : PX509_NAME; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := x^.crl^.issuer -end; - -function X509_CRL_get_REVOKED(x : PX509_CRL) : PSTACK_OF_X509_REVOKED; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := x^.crl^.revoked; -end; - -procedure SSL_CTX_set_info_callback(ctx: PSSL_CTX; cb: PSSL_CTX_info_callback); -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Assert(ctx<>nil); - ctx.info_callback := cb; -end; - -//* Note: SSL[_CTX]_set_{options,mode} use |= op on the previous value, -// * they cannot be used to clear bits. */ - -function SSL_CTX_set_options(ctx: PSSL_CTX; op: TIdC_LONG):TIdC_LONG; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := SSL_CTX_ctrl(ctx, SSL_CTRL_OPTIONS, op, nil); -end; - -function SSL_CTX_clear_options(ctx : PSSL_CTX; op : TIdC_LONG):TIdC_LONG; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := SSL_CTX_ctrl(ctx,SSL_CTRL_CLEAR_OPTIONS,op,nil); -end; - -function SSL_CTX_get_options(ctx: PSSL_CTX) : TIdC_LONG; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := SSL_CTX_ctrl(ctx, SSL_CTRL_OPTIONS,0,nil); -end; - -function SSL_set_options(ssl: PSSL; op : TIdC_LONG): TIdC_LONG; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := SSL_ctrl(ssl, SSL_CTRL_OPTIONS,op,nil); -end; - -function SSL_clear_mode(ssl : PSSL; op : TIdC_LONG) : TIdC_LONG; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := SSL_ctrl(ssl,SSL_CTRL_CLEAR_MODE,op,nil); -end; - -function SSL_get_options(ssl : PSSL): TIdC_LONG; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := SSL_ctrl(ssl, SSL_CTRL_OPTIONS,0,nil); -end; - -function SSL_CTX_set_mode(ctx : PSSL_CTX; op : TIdC_LONG) : TIdC_LONG; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := SSL_CTX_ctrl(ctx, SSL_CTRL_MODE, op,nil); -end; - -function SSL_CTX_clear_mode(ctx : PSSL_CTX; op : TIdC_LONG) : TIdC_LONG; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := SSL_CTX_ctrl(ctx,SSL_CTRL_CLEAR_MODE,op,nil); -end; - -function SSL_CTX_get_mode(ctx : PSSL_CTX) : TIdC_LONG; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := SSL_CTX_ctrl(ctx, SSL_CTRL_MODE,0,nil); -end; - -function SSL_set_mtu(ssl : PSSL; mtu : TIdC_LONG) : TIdC_LONG; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := SSL_ctrl(ssl, SSL_CTRL_SET_MTU, mtu, nil); -end; - -function SSL_get_secure_renegotiation_support(ssl : PSSL) : TIdC_LONG; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := SSL_ctrl(ssl, SSL_CTRL_GET_RI_SUPPORT, 0, nil); -end; -// - -function SSL_CTX_sess_number(ctx : PSSL_CTX) : TIdC_LONG; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := SSL_CTX_ctrl(ctx, SSL_CTRL_SESS_NUMBER,0,nil); -end; - -function SSL_CTX_sess_connect(ctx : PSSL_CTX) : TIdC_LONG; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := SSL_CTX_ctrl(ctx, SSL_CTRL_SESS_CONNECT, 0,nil); -end; - -function SSL_CTX_sess_connect_good(ctx : PSSL_CTX): TIdC_LONG; - {$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := SSL_CTX_ctrl(ctx, SSL_CTRL_SESS_CONNECT_GOOD, 0, nil); -end; - -function SSL_CTX_sess_connect_renegotiate(ctx : PSSL_CTX): TIdC_LONG; - {$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := SSL_CTX_ctrl(ctx, SSL_CTRL_SESS_CONNECT_RENEGOTIATE, 0, nil); -end; - -function SSL_CTX_sess_accept(ctx : PSSL_CTX) : TIdC_LONG; - {$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := SSL_CTX_ctrl(ctx, SSL_CTRL_SESS_ACCEPT, 0, nil); -end; - -function SSL_CTX_sess_accept_renegotiate(ctx : PSSL_CTX) : TIdC_LONG; - {$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := SSL_CTX_ctrl(ctx, SSL_CTRL_SESS_ACCEPT_RENEGOTIATE, 0, nil); -end; - -function SSL_CTX_sess_accept_good(ctx : PSSL_CTX) : TIdC_LONG; - {$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := SSL_CTX_ctrl(ctx, SSL_CTRL_SESS_ACCEPT_GOOD, 0, nil); -end; - -function SSL_CTX_sess_hits(ctx : PSSL_CTX) : TIdC_LONG; - {$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := SSL_CTX_ctrl(ctx, SSL_CTRL_SESS_HIT, 0, nil); -end; - -function SSL_CTX_sess_cb_hits(ctx : PSSL_CTX) : TIdC_LONG; - {$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := SSL_CTX_ctrl(ctx, SSL_CTRL_SESS_CB_HIT, 0, nil); -end; - -function SSL_CTX_sess_misses(ctx : PSSL_CTX) : TIdC_LONG; - {$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := SSL_CTX_ctrl(ctx, SSL_CTRL_SESS_MISSES, 0, nil); -end; - -function SSL_CTX_sess_timeouts(ctx : PSSL_CTX) : TIdC_LONG; - {$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := SSL_CTX_ctrl(ctx, SSL_CTRL_SESS_TIMEOUTS, 0, nil); -end; - -function SSL_CTX_sess_cache_full(ctx : PSSL_CTX) : TIdC_LONG; - {$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := SSL_CTX_ctrl(ctx, SSL_CTRL_SESS_CACHE_FULL, 0, nil); -end; - -function SSL_CTX_sess_set_cache_size(ctx : PSSL_CTX; t : TIdC_LONG) : TIdC_LONG; - {$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := SSL_CTX_ctrl(ctx, SSL_CTRL_SET_SESS_CACHE_SIZE, t, nil); -end; - -function SSL_CTX_sess_get_cache_size(ctx : PSSL_CTX) : TIdC_LONG; - {$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := SSL_CTX_ctrl(ctx, SSL_CTRL_GET_SESS_CACHE_SIZE, 0, nil); -end; - -function SSL_CTX_set_session_cache_mode(ctx : PSSL_CTX; m : TIdC_LONG) : TIdC_LONG; - {$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := SSL_CTX_ctrl(ctx, SSL_CTRL_SET_SESS_CACHE_MODE, m, nil); -end; - -function SSL_CTX_get_session_cache_mode(ctx : PSSL_CTX) : TIdC_LONG; - {$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := SSL_CTX_ctrl(ctx, SSL_CTRL_GET_SESS_CACHE_MODE, 0, nil); -end; - -function SSL_CTX_get_read_ahead(ctx : PSSL_CTX) : TIdC_LONG; - {$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := SSL_CTX_ctrl(ctx, SSL_CTRL_GET_READ_AHEAD,0,nil); -end; - -function SSL_CTX_set_read_ahead(ctx : PSSL_CTX; m : TIdC_LONG) : TIdC_LONG; - {$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := SSL_CTX_ctrl(ctx, SSL_CTRL_SET_READ_AHEAD, m,nil); -end; - -function SSL_CTX_get_max_cert_list(ctx : PSSL_CTX) : TIdC_LONG; - {$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := SSL_CTX_ctrl(ctx, SSL_CTRL_GET_MAX_CERT_LIST,0,nil); -end; - -function SSL_CTX_set_max_cert_list(ctx : PSSL_CTX; m : TIdC_LONG) : TIdC_LONG; - {$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := SSL_CTX_ctrl(ctx, SSL_CTRL_GET_MAX_CERT_LIST,m,nil); -end; - -function SSL_get_max_cert_list(ssl : PSSL) : TIdC_LONG; - {$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := SSL_ctrl(ssl, SSL_CTRL_GET_MAX_CERT_LIST, 0, nil); -end; - -function SSL_set_max_cert_list(ssl : PSSL; m : TIdC_LONG) : TIdC_LONG; - {$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := SSL_ctrl(ssl, SSL_CTRL_SET_MAX_CERT_LIST, m, nil); -end; - -function SSL_CTX_set_max_send_fragment(ctx : PSSL_CTX; m : TIdC_LONG) : TIdC_LONG; - {$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := SSL_CTX_ctrl(ctx,SSL_CTRL_SET_MAX_SEND_FRAGMENT,m,nil); -end; - -function SSL_set_max_send_fragment(ssl : PSSL; m : TIdC_LONG) : TIdC_LONG; - {$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := SSL_ctrl(ssl,SSL_CTRL_SET_MAX_SEND_FRAGMENT,m,nil); -end; - -function DTLSv1_get_timeout(ssl : PSSL; var arg : timeval) : TIdC_LONG; - {$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := SSL_ctrl(ssl,DTLS_CTRL_GET_TIMEOUT,0, @arg); -end; - -function DTLSv1_handle_timeout(ssl : PSSL) : TIdC_LONG; - {$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := SSL_ctrl(ssl,DTLS_CTRL_HANDLE_TIMEOUT,0, nil); -end; - -function DTLSv1_listen(ssl : PSSL; var peer : sockaddr) : TIdC_LONG; - {$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := SSL_ctrl(ssl,DTLS_CTRL_LISTEN,0, @peer); -end; - -function SSL_session_reused(ssl : PSSL) : TIdC_LONG; - {$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := SSL_ctrl(ssl,SSL_CTRL_GET_SESSION_REUSED,0,nil); -end; - -function SSL_num_renegotiations(ssl : PSSL) : TIdC_LONG; - {$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := SSL_ctrl(ssl,SSL_CTRL_GET_NUM_RENEGOTIATIONS,0,nil); -end; - -function SSL_clear_num_renegotiations(ssl : PSSL) : TIdC_LONG; - {$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := SSL_ctrl(ssl,SSL_CTRL_CLEAR_NUM_RENEGOTIATIONS,0,nil); -end; - -function SSL_total_renegotiations(ssl : PSSL) : TIdC_LONG; - {$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := SSL_ctrl(ssl,SSL_CTRL_GET_TOTAL_RENEGOTIATIONS,0,nil); -end; - -function SSL_CTX_need_tmp_RSA(ctx : PSSL_CTX) : TIdC_LONG; - {$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := SSL_CTX_ctrl(ctx,SSL_CTRL_NEED_TMP_RSA,0,nil); -end; - -function SSL_CTX_set_tmp_rsa(ctx : PSSL_CTX; rsa : PRSA) : TIdC_LONG; - {$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := SSL_CTX_ctrl(ctx,SSL_CTRL_SET_TMP_RSA,0,rsa); -end; - -function SSL_CTX_set_tmp_dh(ctx : PSSL_CTX; dh : PDH) : TIdC_LONG; - {$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := SSL_CTX_ctrl(ctx,SSL_CTRL_SET_TMP_DH,0,dh); -end; - -function SSL_CTX_set_tmp_ecdh(ctx : PSSL_CTX; ecdh : PEC_KEY) : TIdC_LONG; - {$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := SSL_CTX_ctrl(ctx,SSL_CTRL_SET_TMP_ECDH,0,ecdh); -end; - -function SSL_CTX_set_ecdh_auto(ctx : PSSL_CTX; m : TIdC_LONG) : TIdC_LONG; - {$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := SSL_CTX_ctrl(ctx,SSL_CTRL_SET_ECDH_AUTO,m,nil); -end; - -function SSL_need_tmp_RSA(ssl : PSSL) : TIdC_LONG; - {$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := SSL_ctrl(ssl,SSL_CTRL_NEED_TMP_RSA,0,nil); -end; - -procedure SSL_set_tmp_rsa(ssl : PSSL; rsa : PRSA); - {$IFDEF USE_INLINE} inline; {$ENDIF} -begin - SSL_ctrl(ssl,SSL_CTRL_SET_TMP_RSA,0,rsa); -end; - -function SSL_set_tmp_dh(ssl : PSSL;dh : PDH) : TIdC_LONG; - {$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := SSL_ctrl(ssl,SSL_CTRL_SET_TMP_DH,0,dh); -end; - -function SSL_set_tmp_ecdh(ssl : PSSL; ecdh : PEC_KEY) : TIdC_LONG; - {$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := SSL_ctrl(ssl,SSL_CTRL_SET_TMP_ECDH,0,ecdh); -end; - -{$IFNDEF OPENSSL_NO_TLSEXT} -function SSL_set_tlsext_host_name(s : PSSL; name : string) : TIdC_LONG; - {$IFDEF USE_INLINE} inline; {$ENDIF} -{$IFDEF USE_MARSHALLED_PTRS} -var - M: TMarshaller; -{$ENDIF} -begin - Result := SSL_ctrl(s, SSL_CTRL_SET_TLSEXT_HOSTNAME, TLSEXT_NAMETYPE_host_name, - {$IFDEF USE_MARSHALLED_PTRS} - M.AsAnsi(name).ToPointer - {$ELSE} - PAnsiChar( - {$IFDEF STRING_IS_ANSI} - name - {$ELSE} - AnsiString(name) // explicit convert to Ansi - {$ENDIF} - ) - {$ENDIF} - ); -end; - -function SSL_set_tlsext_debug_callback(ssl : PSSL; cb : SSL_callback_ctrl_fp) : TIdC_LONG; - {$IFDEF USE_INLINE} inline; {$ENDIF} -begin - if Assigned(SSL_callback_ctrl) then begin - Result := SSL_callback_ctrl(ssl,SSL_CTRL_SET_TLSEXT_DEBUG_CB,cb); - end else begin - Result := ssl.method.ssl_callback_ctrl(ssl, SSL_CTRL_SET_TLSEXT_DEBUG_CB, SSL_METHOD_PROC(cb)); - end; -end; - -function SSL_set_tlsext_debug_arg(ssl : PSSL; arg : Pointer) : TIdC_LONG; - {$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := SSL_ctrl(ssl, SSL_CTRL_SET_TLSEXT_DEBUG_ARG,0,arg); -end; - -function SSL_set_tlsext_status_type(ssl : PSSL; _type : TIdC_LONG):TIdC_LONG; - {$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := SSL_ctrl(ssl, SSL_CTRL_SET_TLSEXT_STATUS_REQ_TYPE,_type,nil); -end; - -function SSL_get_tlsext_status_exts(ssl : PSSL; arg : Pointer): TIdC_LONG; - {$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := SSL_ctrl(ssl, SSL_CTRL_GET_TLSEXT_STATUS_REQ_EXTS,0,arg); -end; - -function SSL_set_tlsext_status_exts(ssl : PSSL; arg : Pointer):TIdC_LONG; - {$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := SSL_ctrl(ssl, SSL_CTRL_SET_TLSEXT_STATUS_REQ_EXTS, 0, arg); -end; - -function SSL_get_tlsext_status_ids(ssl : PSSL; arg : Pointer) : TIdC_LONG; - {$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := SSL_ctrl(ssl, SSL_CTRL_GET_TLSEXT_STATUS_REQ_IDS,0, arg); -end; - -function SSL_set_tlsext_status_ids(ssl : PSSL; arg : Pointer) : TIdC_LONG; - {$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := SSL_ctrl(ssl, SSL_CTRL_SET_TLSEXT_STATUS_REQ_IDS,0,arg); -end; - -function SSL_get_tlsext_status_ocsp_resp(ssl : PSSL; arg : Pointer) : TIdC_LONG; - {$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := SSL_ctrl(ssl, SSL_CTRL_GET_TLSEXT_STATUS_REQ_OCSP_RESP,0,arg); -end; - -function SSL_set_tlsext_status_ocsp_resp(ssl : PSSL; arg : Pointer; arglen : TIdC_LONG) : TIdC_LONG; - {$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := SSL_ctrl(ssl, SSL_CTRL_SET_TLSEXT_STATUS_REQ_OCSP_RESP,arglen,arg); -end; - -function SSL_CTX_set_tlsext_servername_callback(ctx : PSSL_CTX; cb :SSL_callback_ctrl_fp):TIdC_LONG; - {$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := SSL_CTX_callback_ctrl(ctx, SSL_CTRL_SET_TLSEXT_SERVERNAME_CB, cb); -end; - -function SSL_CTX_get_tlsext_ticket_keys(ctx : PSSL_CTX; keys : PIdAnsiChar; keylen : TIdC_LONG ) : TIdC_LONG; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := SSL_CTX_ctrl(ctx,SSL_CTRL_GET_TLSEXT_TICKET_KEYS, keylen, keys); -end; - -function SSL_CTX_set_tlsext_status_cb(ssl : PSSL_CTX; cb : TSSL_CTX_set_tlsext_status_cb) :TIdC_LONG; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := SSL_CTX_callback_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB,SSL_callback_ctrl_fp(cb)); -end; - -function SSL_set_tlsext_opaque_prf_input(s : PSSL; src : PIdAnsiChar; len : TIdC_LONG ) : TIdC_LONG; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := SSL_ctrl(s,SSL_CTRL_SET_TLSEXT_OPAQUE_PRF_INPUT, len, src) -end; - -function SSL_CTX_set_tlsext_opaque_prf_input_callback(ctx : PSSL_CTX; cb : TSSL_CTX_set_tlsext_opaque_prf_input_callback_cb) : TIdC_LONG; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := SSL_CTX_callback_ctrl(ctx,SSL_CTRL_SET_TLSEXT_OPAQUE_PRF_INPUT_CB, SSL_callback_ctrl_fp(cb)); -end; - -function SSL_CTX_set_tlsext_opaque_prf_input_callback_arg(ctx : PSSL_CTX; arg : Pointer) : TIdC_LONG; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := SSL_CTX_ctrl(ctx,SSL_CTRL_SET_TLSEXT_OPAQUE_PRF_INPUT_CB_ARG, 0, arg); -end; - -function SSL_CTX_set_tlsext_ticket_key_cb(ssl : PSSL_CTX; cb : TSSL_CTX_set_tlsext_ticket_key_cb_fp) : TIdC_LONG; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := SSL_CTX_callback_ctrl(ssl,SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB,SSL_callback_ctrl_fp(cb)); -end; - -function SSL_CTX_add_extra_chain_cert(ctx : PSSL_CTX; x509 : PX509) : TIdC_LONG; - {$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := SSL_CTX_ctrl(ctx,SSL_CTRL_EXTRA_CHAIN_CERT,0,x509); -end; - -function SSL_CTX_get_extra_chain_certs(ctx : PSSL_CTX; var px509 : px509) : TIdC_LONG; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := SSL_CTX_ctrl(ctx,SSL_CTRL_GET_EXTRA_CHAIN_CERTS,0,px509); -end; - -function SSL_CTX_get_extra_chain_certs_only(ctx: PSSL_CTX;var PX509 :PX509) : TIdC_LONG; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := SSL_CTX_ctrl(ctx,SSL_CTRL_GET_EXTRA_CHAIN_CERTS,1,px509); -end; - -function SSL_CTX_clear_extra_chain_certs(ctx : PSSL_CTX) : TIdC_LONG; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := SSL_CTX_ctrl(ctx,SSL_CTRL_CLEAR_EXTRA_CHAIN_CERTS,0,nil); -end; - -function SSL_CTX_set0_chain(ctx:PSSL_CTX; sk : PSTACK_OF_X509) : TIdC_LONG; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := SSL_CTX_ctrl(ctx,SSL_CTRL_CHAIN,0,sk); -end; - -function SSL_CTX_set1_chain(ctx:PSSL_CTX; sk : PSTACK_OF_X509) : TIdC_LONG; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := SSL_CTX_ctrl(ctx,SSL_CTRL_CHAIN,1,sk); -end; - -function SSL_CTX_add0_chain_cert(ctx : PSSL_CTX; x509 : PX509) : TIdC_LONG; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := SSL_CTX_ctrl(ctx,SSL_CTRL_CHAIN_CERT,0,x509); -end; - -function SSL_CTX_add1_chain_cert(ctx : PSSL_CTX; x509 : PX509) : TIdC_LONG; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := SSL_CTX_ctrl(ctx,SSL_CTRL_CHAIN_CERT,1,x509); -end; - -function SSL_CTX_get0_chain_certs(ctx :PSSL_CTX; var px509 :PX509) : TIdC_LONG; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := SSL_CTX_ctrl(ctx,SSL_CTRL_GET_CHAIN_CERTS,0,px509) -end; - -function SSL_CTX_clear_chain_certs(ctx :PSSL_CTX) : TIdC_LONG; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := SSL_CTX_set0_chain(ctx,nil); -end; - -{$ifndef OPENSSL_NO_HEARTBEATS} -function SSL_heartbeat(ssl : PSSL) : TIdC_LONG; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := SSL_ctrl(ssl,SSL_CTRL_TLS_EXT_SEND_HEARTBEAT,0,nil); -end; - -function SSL_get_tlsext_heartbeat_pending(ssl : PSSL) : TIdC_LONG; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := SSL_ctrl(ssl,SSL_CTRL_GET_TLS_EXT_HEARTBEAT_PENDING,0,nil); -end; - -function SSL_set_tlsext_heartbeat_no_requests(ssl : PSSL; arg : TIdC_LONG) : TIdC_LONG; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := SSL_ctrl(ssl,SSL_CTRL_SET_TLS_EXT_HEARTBEAT_NO_REQUESTS,arg,nil); -end; -{$endif} -{$ENDIF} - -function TLS1_get_version(s : PSSL) : TIdC_INT; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - if (s.version shr 8) = TLS1_VERSION_MAJOR then - Result := s.version - else - Result := 0; -end; - -function TLS1_get_client_version(s : PSSL) : TIdC_INT; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - if s.client_version shr 8 = TLS1_VERSION_MAJOR then - Result := s.client_version - else - Result := 0; -end; - -function SSL_CTX_get_version(ctx: PSSL_CTX):TIdC_INT; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Assert(ctx<>nil); - Result := ctx^.method^.version; -end; - -//* BIO_s_connect() and BIO_s_socks4a_connect() */ - -function BIO_set_conn_hostname(b : PBIO; name : PIdAnsiChar) : TIdC_LONG; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := BIO_ctrl(b,BIO_C_SET_CONNECT,0,name); -end; - -function BIO_set_conn_port(b : PBIO; port : PIdAnsiChar) : TIdC_LONG; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := BIO_ctrl(b,BIO_C_SET_CONNECT,1,port); -end; - -function BIO_set_conn_ip(b : PBIO; ip : PIdAnsiChar) : TIdC_LONG; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := BIO_ctrl(b,BIO_C_SET_CONNECT,2,ip); -end; - -function BIO_set_conn_int_port(b : PBIO; port : PIdAnsiChar) : TIdC_LONG; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := BIO_ctrl(b,BIO_C_SET_CONNECT,3,port); -end; - -function BIO_get_conn_hostname(b : PBIO) : PIdAnsiChar; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,0); -end; - -function BIO_get_conn_port(b : PBIO) : PIdAnsiChar; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,1); -end; - -function BIO_get_conn_ip(b : PBIO) : PIdAnsiChar; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,2); -end; - -function BIO_get_conn_int_port(b : PBIO) : TIdC_LONG; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := BIO_int_ctrl(b,BIO_C_GET_CONNECT,3,0); -end; - -function BIO_set_nbio(b : PBIO; n : TIdC_LONG) : TIdC_LONG; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := BIO_ctrl(b,BIO_C_SET_NBIO,n,nil); -end; - -//* BIO_s_accept_socket() */ -function BIO_set_accept_port(b : PBIO; name : PIdAnsiChar) : TIdC_LONG; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := BIO_ctrl(b,BIO_C_SET_ACCEPT,0,name); -end; - -function BIO_get_accept_port(b : PBIO) : PIdAnsiChar; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := BIO_ptr_ctrl(b,BIO_C_GET_ACCEPT,0); -end; - -//* #define BIO_set_nbio(b,n) BIO_ctrl(b,BIO_C_SET_NBIO,(n),NULL) */ -function BIO_set_nbio_accept(b : PBIO; n : TIdC_INT) : TIdC_LONG; -{$IFDEF USE_INLINE} inline; {$ENDIF} -var - a: array[0..1] of TIdAnsiChar; -begin - if n <> 0 then begin - a[0] := TIdAnsiChar('a'); - a[1] := TIdAnsiChar(#0); - Result := BIO_ctrl(b, BIO_C_SET_ACCEPT, 1, @a[0]); - end else begin - Result := BIO_ctrl(b, BIO_C_SET_ACCEPT, 1, nil); - end; -end; - -function BIO_set_accept_bios(b : PBIO; bio : PBIO) : TIdC_LONG; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := BIO_ctrl(b,BIO_C_SET_ACCEPT, 2, bio); -end; - -function BIO_set_bind_mode(b : PBIO; mode : TIdC_LONG) : TIdC_LONG; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := BIO_ctrl(b,BIO_C_SET_BIND_MODE,mode,nil); -end; - -function BIO_get_bind_mode(b : PBIO; mode : TIdC_LONG) : TIdC_LONG; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := BIO_ctrl(b,BIO_C_GET_BIND_MODE,0,nil); -end; - -function BIO_do_handshake(b : PBIO) : TIdC_LONG; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := BIO_ctrl(b,BIO_C_DO_STATE_MACHINE,0,nil); -end; - -function BIO_do_connect(b : PBIO) : TIdC_LONG; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := BIO_do_handshake(b); -end; - -function BIO_do_accept(b : PBIO) : TIdC_LONG; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := BIO_do_handshake(b) -end; - -//* BIO_s_proxy_client() */ -function BIO_set_url(b : PBIO; url : PIdAnsiChar) : TIdC_LONG; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := BIO_ctrl(b, BIO_C_SET_PROXY_PARAM,0,url); -end; - -function BIO_set_proxies(b : PBIO; p : PIdAnsiChar) : TIdC_LONG; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := BIO_ctrl(b,BIO_C_SET_PROXY_PARAM,1,p); -end; - -//* BIO_set_nbio(b,n) */ -function BIO_set_filter_bio(b : PBIO; s : PIdAnsiChar) : TIdC_LONG; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := BIO_ctrl(b,BIO_C_SET_PROXY_PARAM,2,s); -end; - -//* BIO *BIO_get_filter_bio(BIO *bio); */ -//function BIO_set_proxy_cb(b : PBIO,cb) : TIdC_LONG; -//begin -//BIO_callback_ctrl(b,BIO_C_SET_PROXY_PARAM,3,(void *(*cb)())) -//end; - -function BIO_set_proxy_header(b : PBIO; sk : PIdAnsiChar) : TIdC_LONG; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := BIO_ctrl(b,BIO_C_SET_PROXY_PARAM,4,sk); -end; - -function BIO_set_no_connect_return(b : PBIO; b2 : TIdC_LONG) : TIdC_LONG; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := BIO_int_ctrl(b,BIO_C_SET_PROXY_PARAM,5,b2); -end; - -function BIO_get_proxy_header(b : PBIO; var skp : PIdAnsiChar) : TIdC_LONG; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := BIO_ctrl(b,BIO_C_GET_PROXY_PARAM,0,@skp); -end; - -function BIO_get_proxies(b : PBIO; var pxy_p : PIdAnsiChar) : TIdC_LONG; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := BIO_ctrl(b,BIO_C_GET_PROXY_PARAM,1,@pxy_p); -end; - -function BIO_get_url(b : PBIO; var url : PIdAnsiChar) : TIdC_LONG; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := BIO_ctrl(b,BIO_C_GET_PROXY_PARAM,2,@url); -end; - -function BIO_get_no_connect_return(b : PBIO) : TIdC_LONG; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := BIO_ctrl(b,BIO_C_GET_PROXY_PARAM,5,nil); -end; - -function BIO_set_fd(b : PBIO; fd,c : TIdC_INT) : TIdC_LONG; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := BIO_int_ctrl(b,BIO_C_SET_FD,c,fd); -end; - -function BIO_get_fd(b : PBIO; c : PIdC_INT) : TIdC_LONG; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := BIO_ctrl(b,BIO_C_GET_FD,0,c); -end; - -//function BIO_set_fp(b : PBIO; fp : Pointer; c : TIdC_LONG) : TIdC_LONG; -//{$IFDEF USE_INLINE} inline; {$ENDIF} -//begin -// Result := BIO_ctrl(b,BIO_C_SET_FILE_PTR,c,fp); -//end; - -//function BIO_get_fp(b : PBIO; out fpp : Pointer) : TIdC_LONG; -//{$IFDEF USE_INLINE} inline; {$ENDIF} -//begin -// Result := BIO_ctrl(b,BIO_C_GET_FILE_PTR,0,@fpp); -//end; - -function BIO_seek(b : PBIO; ofs : TIdC_LONG) : TIdC_INT; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := BIO_ctrl(b,BIO_C_FILE_SEEK,ofs,nil); -end; - -function BIO_tell(b : PBIO) : TIdC_INT; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := BIO_ctrl(b,BIO_C_FILE_TELL,0,nil); -end; - -//* name is cast to lose const, but might be better to route through a function -// so we can do it safely */ -{$IFDEF CONST_STRICT} -///* If you are wondering why this isn't defined, its because CONST_STRICT is -// * purely a compile-time kludge to allow const to be checked. -// */ -//int BIO_read_filename(BIO *b,const char *name); -{$ELSE} -function BIO_read_filename(b : PBIO; name : PIdAnsiChar) : TIdC_LONG; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := BIO_ctrl(b,BIO_C_SET_FILENAME, BIO_CLOSE or BIO_FP_READ,name); -end; -{$ENDIF} - -function BIO_write_filename(b : PBIO; name : PIdAnsiChar) : TIdC_LONG; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := BIO_ctrl(b,BIO_C_SET_FILENAME, BIO_CLOSE or BIO_FP_WRITE,name); -end; - -function BIO_append_filename(b : PBIO; name : PIdAnsiChar) : TIdC_LONG; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := BIO_ctrl(b,BIO_C_SET_FILENAME, BIO_CLOSE or BIO_FP_APPEND,name); -end; - -function BIO_rw_filename(b : PBIO; name : PIdAnsiChar) : TIdC_LONG; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := BIO_ctrl(b,BIO_C_SET_FILENAME, BIO_CLOSE or BIO_FP_READ or BIO_FP_WRITE,name); -end; - -///* WARNING WARNING, this ups the reference count on the read bio of the -// * SSL structure. This is because the ssl read BIO is now pointed to by -// * the next_bio field in the bio. So when you free the BIO, make sure -// * you are doing a BIO_free_all() to catch the underlying BIO. */ -function BIO_set_ssl(b : PBIO; ssl : PSSL; c : TIdC_LONG) : TIdC_LONG; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := BIO_ctrl(b,BIO_C_SET_SSL,c,ssl); -end; - -function BIO_get_ssl(b : PBIO; var sslp : PSSL) : TIdC_LONG; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := BIO_ctrl(b,BIO_C_GET_SSL,0,@sslp); -end; - -function BIO_set_ssl_mode(b : PBIO; client : TIdC_LONG) : TIdC_LONG; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := BIO_ctrl(b,BIO_C_SSL_MODE,client,nil); -end; - -function BIO_set_ssl_renegotiate_bytes(b : PBIO; num : TIdC_LONG) : TIdC_LONG; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := BIO_ctrl(b,BIO_C_SET_SSL_RENEGOTIATE_BYTES,num,nil); -end; - -function BIO_get_num_renegotiates(b : PBIO) : TIdC_LONG; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := BIO_ctrl(b,BIO_C_GET_SSL_NUM_RENEGOTIATES,0,nil); -end; - -function BIO_set_ssl_renegotiate_timeout(b : PBIO; seconds : TIdC_LONG) : TIdC_LONG; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := BIO_ctrl(b,BIO_C_SET_SSL_RENEGOTIATE_TIMEOUT,seconds,nil); -end; - -function BIO_get_mem_data(b : PBIO; var pp : PIdAnsiChar) : TIdC_INT; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := BIO_ctrl(b,BIO_CTRL_INFO,0,@pp); -end; - -function BIO_set_mem_buf(b : PBIO; bm : PBUF_MEM; c : TIdC_INT) : TIdC_INT; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := BIO_ctrl(b, BIO_C_SET_BUF_MEM, c, bm); -end; - -function BIO_get_mem_ptr(b: PBIO; var pp: PBUF_MEM) : TIdC_INT; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := BIO_ctrl(b, BIO_C_GET_BUF_MEM_PTR, 0, @pp); -end; - -procedure BIO_set_mem_eof_return(b : PBIO; const v : TIdC_INT); -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - BIO_ctrl(b,BIO_C_SET_BUF_MEM_EOF_RETURN,v,nil); -end; - -//* For the BIO_f_buffer() type */ -function BIO_get_buffer_num_lines(b : PBIO) : TIdC_INT; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := BIO_ctrl(b,BIO_C_GET_BUFF_NUM_LINES,0,nil); -end; - -procedure BIO_set_buffer_size(b : PBIO; const size : TIdC_INT); -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - BIO_ctrl(b,BIO_C_SET_BUFF_SIZE,size,nil); -end; - -//* Don't use the next one unless you know what you are doing :-) */ -function BIO_dup_state(b : PBIO; ret : PBIO) : TIdC_LONG; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := BIO_ctrl(b,BIO_CTRL_DUP,0,ret); -end; - -function BIO_reset(b : PBIO) : TIdC_INT; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := BIO_ctrl(b,BIO_CTRL_RESET,0,nil); -end; - -function BIO_eof(b : PBIO) : TIdC_INT; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := BIO_ctrl(b,BIO_CTRL_EOF,0,nil); -end; - -function BIO_set_close(b: PBIO; c: TIdC_LONG): TIdC_INT; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := BIO_ctrl(b, BIO_CTRL_SET_CLOSE, c, nil); -end; - -function BIO_get_close(b : PBIO) : TIdC_INT; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := BIO_ctrl(b, BIO_CTRL_GET_CLOSE, 0, nil); -end; - -function BIO_pending(b : PBIO) : TIdC_INT; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := BIO_ctrl(b,BIO_CTRL_PENDING,0,nil); -end; - -function BIO_wpending(b : PBIO) : TIdC_INT; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := BIO_ctrl(b,BIO_CTRL_WPENDING,0,nil); -end; - -function BIO_flush(b : PBIO) : TIdC_INT; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := BIO_ctrl(b,BIO_CTRL_FLUSH,0,nil); -end; - -//* For the BIO_f_buffer() type */ -function BIO_buffer_get_num_lines(b : PBIO) : TIdC_INT; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := BIO_ctrl(b,BIO_CTRL_GET,0,nil); -end; - -function BIO_get_info_callback(b : PBIO; var cbp : Pbio_info_cb) : TIdC_INT; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := BIO_ctrl(b,BIO_CTRL_GET_CALLBACK,0, @cbp); -end; - -function BIO_set_info_callback(b : PBIO; cb : Pbio_info_cb) : TIdC_INT; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := BIO_callback_ctrl(b,BIO_CTRL_SET_CALLBACK,cb); -end; - -//* For BIO_s_bio() */ -//function(bp : PBIO; cmd : TIdC_INT; larg : TIdC_LONG; iArg : TIdC_INT) : TIdC_LONG cdecl = nil; -//BIO_set_read_buffer_size(b,size) BIO_int_ctrl(b,BIO_C_SET_BUFF_SIZE,size,0) -function BIO_set_read_buffer_size(b : PBIO; size : TIdC_LONG) : TIdC_LONG; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := BIO_int_ctrl(b,BIO_C_SET_BUFF_SIZE,size,0); -end; - -function BIO_set_write_buffer_size(b : PBIO; size : TIdC_LONG) : TIdC_LONG; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := BIO_int_ctrl(b,BIO_C_SET_BUFF_SIZE,size,1); -end; - -//#define BIO_make_bio_pair(b1,b2) (int)BIO_ctrl(b1,BIO_C_MAKE_BIO_PAIR,0,b2) -function BIO_make_bio_pair(b1, b2 : PBIO ): TIdC_INT; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := BIO_ctrl(b1,BIO_C_MAKE_BIO_PAIR,0,b2); -end; - -//#define BIO_destroy_bio_pair(b) (int)BIO_ctrl(b,BIO_C_DESTROY_BIO_PAIR,0,NULL) -function BIO_destroy_bio_pair(b : PBIO) : TIdC_INT; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := BIO_ctrl(b,BIO_C_DESTROY_BIO_PAIR,0,nil); -end; - -//#define BIO_shutdown_wr(b) (int)BIO_ctrl(b, BIO_C_SHUTDOWN_WR, 0, NULL) -function BIO_shutdown_wr(b : PBIO) : TIdC_INT; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := BIO_ctrl(b, BIO_C_SHUTDOWN_WR, 0, nil); -end; - -///* macros with inappropriate type -- but ...pending macros use int too: */ -//#define BIO_get_write_guarantee(b) (int)BIO_ctrl(b,BIO_C_GET_WRITE_GUARANTEE,0,NULL) -function BIO_get_write_guarantee(b : PBIO) : TIdC_INT; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := BIO_ctrl(b,BIO_C_GET_WRITE_GUARANTEE,0,nil); -end; - -//#define BIO_get_read_request(b) (int)BIO_ctrl(b,BIO_C_GET_READ_REQUEST,0,NULL) -function BIO_get_read_request(b : PBIO) : TIdC_INT; -begin - Result := BIO_ctrl(b,BIO_C_GET_READ_REQUEST,0,nil); -end; - -//* ctrl macros for dgram */ -function _BIO_ctrl_dgram_connect(b : PBIO; peer : Sockaddr) : TIdC_INT; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := BIO_ctrl(b,BIO_CTRL_DGRAM_CONNECT,0,@peer); -end; - -function BIO_ctrl_set_connected(b : PBIO; state : TIdC_INT; peer : Sockaddr) : TIdC_INT; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := BIO_ctrl(b, BIO_CTRL_DGRAM_SET_CONNECTED, state, @peer); -end; - -function BIO_dgram_recv_timedout(b : PBIO) : TIdC_INT; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := BIO_ctrl(b, BIO_CTRL_DGRAM_GET_RECV_TIMER_EXP, 0, nil); -end; - -function BIO_dgram_send_timedout(b : PBIO) : TIdC_INT; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := BIO_ctrl(b, BIO_CTRL_DGRAM_GET_SEND_TIMER_EXP, 0, nil); -end; - -function BIO_dgram_get_peer(b : PBIO; peer : PSockAddr) : TIdC_INT; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := BIO_ctrl(b, BIO_CTRL_DGRAM_GET_PEER, 0, peer); -end; - -function BIO_dgram_set_peer(b : PBIO; peer : PSockAddr) : TIdC_INT; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := BIO_ctrl(b, BIO_CTRL_DGRAM_SET_PEER, 0, peer); -end; - -{$IFDEF SSLEAY_MACROS} -//You should do the PEM_read_bio and PEM_write_bio functions like this -//because OpenSSL has a define for either using Macros or the native -//functions. - -function PEM_read_bio_X509(bp: PBIO; x: PPX509; cb: ppem_password_cb; u: Pointer): PX509; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := PEM_ASN1_read_bio(d2i_of_void(d2i_X509), PEM_STRING_X509, bp, PPointer(x), cb, u); -end; - -function PEM_read_bio_X509_REQ(bp :PBIO; x : PPX509_REQ; cb :ppem_password_cb; u: Pointer) : PX509_REQ; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := PEM_ASN1_read_bio(d2i_of_void(d2i_X509_REQ),PEM_STRING_X509_REQ,bp, Pointer(x), cb, u); -end; - -function PEM_read_bio_X509_CRL(bp : PBIO; x : PPX509_CRL;cb : ppem_password_cb; u: Pointer) : PX509_CRL; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := PEM_ASN1_read_bio(d2i_of_void(d2i_X509_CRL), PEM_STRING_X509_CRL, bp, Pointer(x), cb, u); -end; - -function PEM_read_bio_RSAPrivateKey(bp : PBIO; x : PPRSA; cb : ppem_password_cb; u: Pointer) : PRSA; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := PEM_ASN1_read_bio(d2i_of_void(d2i_RSAPrivateKey), PEM_STRING_RSA, bp, Pointer(x), cb, u); -end; - -function PEM_read_bio_RSAPublicKey(bp : PBIO; x : PPRSA; cb : ppem_password_cb; u: Pointer) : PRSA; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := PEM_ASN1_read_bio(d2i_of_void(d2i_RSAPublicKey),PEM_STRING_RSA_PUBLIC, bp, Pointer(x),cb, u); -end; - -function PEM_read_bio_DSAPrivateKey(bp : PBIO; x : PPDSA; cb : ppem_password_cb; u : Pointer) : PDSA; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := PEM_ASN1_read_bio( d2i_of_void(d2i_DSAPrivateKey),PEM_STRING_DSA,bp,Pointer(x),cb,u); -end; - -function PEM_read_bio_PrivateKey(bp : PBIO; x : PPEVP_PKEY; cb : ppem_password_cb; u : Pointer) : PEVP_PKEY; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := PEM_ASN1_read_bio( d2i_of_void(d2i_PrivateKey), PEM_STRING_EVP_PKEY, bp, Pointer(x),cb, u); -end; - -function PEM_read_bio_PKCS7(bp : PBIO; x : PPPKCS7; cb : ppem_password_cb; u : Pointer) : PPKCS7; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := PEM_ASN1_read_bio( d2i_of_void(d2i_PKCS7), PEM_STRING_PKCS7,bp,Pointer(x),cb, u); -end; - -function PEM_read_bio_DHparams(bp : PBIO; x : PPDH; cb : ppem_password_cb; u : Pointer) : PDH; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := PEM_ASN1_read_bio(d2i_of_void(d2i_DHparams),PEM_STRING_DHPARAMS,bp,Pointer(x),cb,u); -end; - -function PEM_read_bio_DSAparams(bp : PBIO; x : PPDSA; cb : ppem_password_cb; u : Pointer) : PDSA; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := PEM_ASN1_read_bio( d2i_of_void(d2i_DSAparams),PEM_STRING_DSAPARAMS,bp,Pointer(x),cb,u); -end; - -function PEM_read_bio_NETSCAPE_CERT_SEQUENCE(bp : PBIO; x : PPNETSCAPE_CERT_SEQUENCE; - cb : ppem_password_cb; u : Pointer) : PNETSCAPE_CERT_SEQUENCE; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := PEM_ASN1_read_bio( d2i_of_void(d2i_NETSCAPE_CERT_SEQUENCE),PEM_STRING_X509,bp,Pointer(x),cb, u); -end; - -function PEM_read_bio_PUBKEY(bp : PBIO; x: PPEVP_PKEY; cb: ppem_password_cb; u: Pointer): PEVP_PKEY; -begin - Result := PEM_ASN1_read_bio( d2i_of_void(d2i_PUBKEY),PEM_STRING_PUBLIC,bp,Pointer(x),cb, u); -end; - -function PEM_write_bio_X509(bp: PBIO; x: PX509): TIdC_INT; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Assert(bp<>nil); - Assert(x<>nil); - Result := PEM_ASN1_write_bio( i2d_of_void(i2d_X509), PEM_STRING_X509, bp, PIdAnsiChar(x), nil, nil, 0, nil, nil); - Assert(Result<>0); -end; - -function PEM_write_bio_X509_REQ(bp: PBIO; x: PX509_REQ): TIdC_INT; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Assert(bp<>nil); - Assert(x<>nil); - Result := PEM_ASN1_write_bio(i2d_of_void(i2d_X509_REQ), PEM_STRING_X509_REQ, bp, PIdAnsiChar(x), nil, nil, 0, nil, nil); - Assert(Result<>0); -end; - -function PEM_write_bio_X509_CRL(bp : PBIO; x : PX509_CRL) : TIdC_INT; -begin - Assert(bp<>nil); - Assert(x<>nil); - Result := PEM_ASN1_write_bio(i2d_of_void(i2d_X509_CRL), PEM_STRING_X509_CRL, bp, PIdAnsiChar(x), nil, nil, 0, nil, nil); - Assert(Result<>0); -end; - -function PEM_write_bio_RSAPrivateKey(bp : PBIO; x : PRSA; const enc : PEVP_CIPHER; - kstr : PIdAnsiChar; klen : TIdC_INT; cb : ppem_password_cb; u : POinter) : TIdC_INT; -begin - Assert(bp<>nil); - Assert(x<>nil); - Result := PEM_ASN1_write_bio(i2d_of_void(i2d_RSAPrivateKey), PEM_STRING_RSA, bp, PIdAnsiChar(x), enc,kstr,klen,cb,u); - Assert(Result<>0); -end; - -function PEM_write_bio_RSAPublicKey(bp : PBIO; x : PRSA) : TIdC_INT; -begin - Assert(bp<>nil); - Assert(x<>nil); - Result := PEM_ASN1_write_bio(i2d_of_void(i2d_RSAPublicKey), PEM_STRING_RSA_PUBLIC, bp, PIdAnsiChar(x), nil, nil, 0, nil, nil); - Assert(Result<>0); -end; - -function PEM_write_bio_DSAPrivateKey( bp : PBIO; x : PDSA; const enc : PEVP_CIPHER; - kstr : PIdAnsiChar; klen : TIdC_INT; cb : Ppem_password_cb; u : Pointer) : TIdC_INT; -begin - Assert(bp<>nil); - Assert(x<>nil); - Result := PEM_ASN1_write_bio(i2d_of_void(i2d_DSAPrivateKey), PEM_STRING_DSA, bp, PIdAnsiChar(x), enc,kstr,klen,cb,u); - Assert(Result<>0); -end; - -function PEM_write_bio_PrivateKey(bp : PBIO; x : PEVP_PKEY; const enc : PEVP_CIPHER; - kstr : PIdAnsiChar; klen : TIdC_INT; cb : Ppem_password_cb; u : Pointer) : TIdC_INT; -begin - Assert(bp<>nil); - Assert(x<>nil); - if x^._type = EVP_PKEY_DSA then begin - Result := PEM_ASN1_write_bio(i2d_of_void(i2d_PrivateKey),PEM_STRING_DSA,bp, Pointer(x),enc,kstr,klen,cb,u); - end else begin - Result := PEM_ASN1_write_bio(i2d_of_void(i2d_PrivateKey),PEM_STRING_RSA,bp, Pointer(x),enc,kstr,klen,cb,u); - end; - Assert(Result<>0); -end; - -function PEM_write_bio_PKCS7(bp : PBIO; x : PPKCS7) : TIdC_INT; -begin - Assert(bp<>nil); - Assert(x<>nil); - Result := PEM_ASN1_write_bio(i2d_of_void(i2d_PKCS7), PEM_STRING_PKCS7, bp, PIdAnsiChar(x), nil, nil, 0, nil, nil); - Assert(Result<>0); -end; - -function PEM_write_bio_DHparams(bp : PBIO; x : PDH): TIdC_INT; -begin - Assert(bp<>nil); - Assert(x<>nil); - Result := PEM_ASN1_write_bio(i2d_of_void(i2d_DHparams), PEM_STRING_DHPARAMS, bp, PIdAnsiChar(x), nil, nil, 0, nil, nil); - Assert(Result<>0); -end; - -function PEM_write_bio_DSAparams(bp : PBIO; x : PDSA) : TIdC_INT; -begin - Assert(bp<>nil); - Assert(x<>nil); - Result := PEM_ASN1_write_bio(i2d_of_void(i2d_DSAparams), PEM_STRING_DSAPARAMS, bp, PIdAnsiChar(x), nil, nil, 0, nil, nil); - Assert(Result<>0); -end; - -function PEM_write_bio_NETSCAPE_CERT_SEQUENCE(bp : PBIO; x : PDSA) : TIdC_INT; -begin - Assert(bp<>nil); - Assert(x<>nil); - Result := PEM_ASN1_write_bio(i2d_of_void(i2d_NETSCAPE_CERT_SEQUENCE), PEM_STRING_X509, bp, PIdAnsiChar(x), nil, nil, 0, nil, nil); - Assert(Result<>0); -end; - -function PEM_write_bio_PUBKEY(bp: PBIO; x : PEVP_PKEY): TIdC_INT; -begin - Assert(bp<>nil); - Assert(x<>nil); - Result := PEM_ASN1_write_bio(i2d_of_void(i2d_PUBKEY), PEM_STRING_PUBLIC, bp, PIdAnsiChar(x), nil, nil, 0, nil, nil); - Assert(Result<>0); -end; - -{$ELSE} - -function PEM_read_bio_X509(bp: PBIO; x: PPX509; cb: ppem_password_cb; u: Pointer): PX509; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := _PEM_read_bio_X509(bp, x, cb, u); -end; - -function PEM_read_bio_X509_REQ(bp :PBIO; x : PPX509_REQ; cb :ppem_password_cb; u: Pointer) : PX509_REQ; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := _PEM_read_bio_X509_REQ(bp, x, cb, u); -end; - -function PEM_read_bio_X509_CRL(bp : PBIO; x : PPX509_CRL;cb : ppem_password_cb; u: Pointer) : PX509_CRL; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := _PEM_read_bio_X509_CRL(bp, x, cb, u); -end; - -function PEM_read_bio_RSAPrivateKey(bp : PBIO; x : PPRSA; cb : ppem_password_cb; u: Pointer) : PRSA; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := _PEM_read_bio_RSAPrivateKey(bp, x, cb, u); -end; - -function PEM_read_bio_RSAPublicKey(bp : PBIO; x : PPRSA; cb : ppem_password_cb; u: Pointer) : PRSA; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := _PEM_read_bio_RSAPublicKey(bp, x, cb, u); -end; - -function PEM_read_bio_DSAPrivateKey(bp : PBIO; x : PPDSA; cb : ppem_password_cb; u : Pointer) : PDSA;{$IFDEF USE_INLINE} inline; {$ENDIF} -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := _PEM_read_bio_DSAPrivateKey(bp, x, cb, u); -end; - -function PEM_read_bio_PrivateKey(bp : PBIO; x : PPEVP_PKEY; cb : ppem_password_cb; u : Pointer) : PEVP_PKEY; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := _PEM_read_bio_PrivateKey(bp, x, cb, u); -end; - -function PEM_read_bio_PKCS7(bp : PBIO; x : PPPKCS7; cb : ppem_password_cb; u : Pointer) : PPKCS7; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := _PEM_read_bio_PKCS7(bp, x, cb, u); -end; - -function PEM_read_bio_DHparams(bp : PBIO; x : PPDH; cb : ppem_password_cb; u : Pointer) : PDH; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := _PEM_read_bio_DHparams(bp, x, cb, u); -end; - -function PEM_read_bio_DSAparams(bp : PBIO; x : PPDSA; cb : ppem_password_cb; u : Pointer) : PDSA; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := _PEM_read_bio_DSAparams(bp, x, cb, u); -end; - -function PEM_read_bio_NETSCAPE_CERT_SEQUENCE(bp : PBIO; x : PPNETSCAPE_CERT_SEQUENCE; - cb : ppem_password_cb; u : Pointer) : PNETSCAPE_CERT_SEQUENCE; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := _PEM_read_bio_NETSCAPE_CERT_SEQUENCE(bp, x, cb, u); -end; - -function PEM_read_bio_PUBKEY(bp : PBIO; x : PPEVP_PKEY; cb : ppem_password_cb; u : Pointer) : PEVP_PKEY; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := _PEM_read_bio_PUBKEY(bp, x, cb, u); -end; - -function PEM_write_bio_X509(bp: PBIO; x: PX509): TIdC_INT; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := _PEM_write_bio_X509(bp, x); -end; - -function PEM_write_bio_X509_REQ(bp: PBIO; x: PX509_REQ): TIdC_INT; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := _PEM_write_bio_X509_REQ(bp, x); -end; - -function PEM_write_bio_X509_CRL(bp : PBIO; x : PX509_CRL) : TIdC_INT; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := _PEM_write_bio_X509_CRL(bp, x); -end; - -function PEM_write_bio_RSAPublicKey(bp : PBIO; x : PRSA) : TIdC_INT; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := _PEM_write_bio_RSAPublicKey(bp,x); -end; - -function PEM_write_bio_RSAPrivateKey(bp : PBIO; x : PRSA; const enc : PEVP_CIPHER; - kstr : PIdAnsiChar; klen : TIdC_INT; cb : ppem_password_cb; u : POinter) : TIdC_INT; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := _PEM_write_bio_RSAPrivateKey(bp,x,enc,kstr,klen,cb, u); -end; - -function PEM_write_bio_DSAPrivateKey( bp : PBIO; x : PDSA; const enc : PEVP_CIPHER; - kstr : PIdAnsiChar; klen : TIdC_INT; cb : Ppem_password_cb; u : Pointer) : TIdC_INT; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := _PEM_write_bio_DSAPrivateKey( bp, x, enc, kstr, klen, cb, u); -end; - -function PEM_write_bio_PrivateKey(bp : PBIO; x : PEVP_PKEY; const enc : PEVP_CIPHER; - kstr : PIdAnsiChar; klen : TIdC_INT; cb : Ppem_password_cb; u : Pointer) : TIdC_INT; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := _PEM_write_bio_PrivateKey(bp,x, enc, kstr, klen, cb, u); -end; - -function PEM_write_bio_PKCS7(bp : PBIO; x : PPKCS7) : TIdC_INT; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := _PEM_write_bio_PKCS7(bp, x); -end; - -function PEM_write_bio_DHparams(bp : PBIO; x : PDH): TIdC_INT; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := _PEM_write_bio_DHparams(bp, x); -end; - -function PEM_write_bio_DSAparams(bp : PBIO; x : PDSA) : TIdC_INT; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := _PEM_write_bio_DSAparams(bp, x); -end; - -function PEM_write_bio_NETSCAPE_CERT_SEQUENCE(bp : PBIO; x : PDSA) : TIdC_INT; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := _PEM_write_bio_NETSCAPE_CERT_SEQUENCE(bp, x); -end; - -function PEM_write_bio_PUBKEY(bp : PBIO; x : PEVP_PKEY): TIdC_INT; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := _PEM_write_bio_PUBKEY(bp, x); -end; - -{$ENDIF} - -function OPENSSL_malloc(aSize:TIdC_INT):Pointer; -{$IFDEF USE_INLINE} inline; {$ENDIF} -//can also use CRYPTO_mem_leaks(bio) -begin - Result := CRYPTO_malloc(aSize, - {$IFNDEF HAS_PAnsiChar} - @cNull - {$ELSE} - '' - {$ENDIF}, 0); -end; - -procedure CRYPTO_SetMemCheck(const aEnabled: Boolean); -{$IFDEF USE_INLINE} inline; {$ENDIF} -//compile openssl with -DCRYPTO_MDEBUG -{$IFOPT C+} // detect assertions -var - r: Integer; -{$ENDIF} -begin - //compile openssl with -DCRYPTO_MDEBUG - {$IFOPT C+}r :={$ENDIF} CRYPTO_mem_ctrl(iif(aEnabled, CRYPTO_MEM_CHECK_ON, CRYPTO_MEM_CHECK_OFF)); - {$IFOPT C+}Assert(r<>0);{$ENDIF} -end; - -{$IFNDEF OPENSSL_NO_RSA} -function EVP_PKEY_assign_RSA(pkey: PEVP_PKEY; rsa: PRSA): TIdC_INT; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := EVP_PKEY_assign(pkey, EVP_PKEY_RSA, rsa); -end; -{$ENDIF} - -{$IFNDEF OPENSSL_NO_DSA} -function EVP_PKEY_assign_DSA(pkey : PEVP_PKEY; dsa : PDSA) : TIdC_INT; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := EVP_PKEY_assign(pkey, EVP_PKEY_DSA, dsa); -end; -{$ENDIF} - -{$IFNDEF OPENSSL_NO_DH} -function EVP_PKEY_assign_DH(pkey : PEVP_PKEY; dh : PDH) : TIdC_INT; -begin - Result := EVP_PKEY_assign(pkey, EVP_PKEY_DH, dh); -end; -{$ENDIF} - -{$IFNDEF OPENSSL_NO_EC} -function EVP_PKEY_assign_EC_KEY(pkey : PEVP_PKEY; eckey : PEC_KEY) : TIdC_INT; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := EVP_PKEY_assign(pkey, EVP_PKEY_EC, eckey); -end; -{$ENDIF} - -function EVP_get_digestbynid(a : TIdC_INT) : PEVP_MD; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := EVP_get_digestbyname(OBJ_nid2sn(a)); -end; - -function EVP_get_digestbyobj(a : PASN1_OBJECT) : PEVP_MD; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := EVP_get_digestbynid(OBJ_obj2nid(a)); -end; - -function EVP_get_cipherbynid(a : TIdC_INT) : PEVP_CIPHER; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := EVP_get_cipherbyname(OBJ_nid2sn(a)); -end; - -function EVP_get_cipherbyobj(a : PASN1_OBJECT) : PEVP_CIPHER; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := EVP_get_cipherbynid(OBJ_obj2nid(a)) -end; - -function EVP_MD_nid(e : PEVP_MD) : TIdC_INT; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := EVP_MD_type(e); -end; - -function EVP_MD_name(e : PEVP_MD) : PIdAnsiChar; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := OBJ_nid2sn(EVP_MD_nid(e)) -end; - -function EVP_MD_CTX_size(e : PEVP_MD_CTX) : TIdC_INT; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := EVP_MD_size(EVP_MD_CTX_md(e)); -end; - -function EVP_MD_CTX_block_size(e : PEVP_MD_CTX) : TIdC_INT; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := EVP_MD_block_size(EVP_MD_CTX_md(e)); -end; - -function EVP_MD_CTX_type(e : PEVP_MD_CTX) : TIdC_INT; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := EVP_MD_type(EVP_MD_CTX_md(e)); -end; - -function EVP_CIPHER_name(e : PEVP_CIPHER) : PIdAnsiChar; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := OBJ_nid2sn(EVP_CIPHER_nid(e)); -end; - -function EVP_CIPHER_mode(e : PEVP_CIPHER) : TIdC_ULONG; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := (EVP_CIPHER_flags(e) and EVP_CIPH_MODE) -end; - -function EVP_CIPHER_CTX_type(c : PEVP_CIPHER_CTX) : TIdC_INT; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := EVP_CIPHER_type(EVP_CIPHER_CTX_cipher(c)); -end; - -function EVP_CIPHER_CTX_mode(e : PEVP_CIPHER_CTX) : TIdC_ULONG; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := (EVP_CIPHER_CTX_flags(e) and EVP_CIPH_MODE) -end; - -function EVP_ENCODE_LENGTH(l : Integer) : Integer; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := (((l+2) div 3*4)+(l div 48+1)*2+80); -end; - -function EVP_DECODE_LENGTH(l : Integer) : Integer; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := ((l+3) div 4*3+80); -end; - -function EVP_SignInit_ex(a: PEVP_MD_CTX; b : PEVP_MD; c : PENGINE) : TIdC_INT; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := EVP_DigestInit_ex(a, b,c); -end; - -function EVP_SignInit(a : PEVP_MD_CTX; b : PEVP_MD) : TIdC_INT; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := EVP_DigestInit(a,b); -end; - -function EVP_SignUpdate(a: PEVP_MD_CTX; b : Pointer; c : size_t) : TIdC_INT; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := EVP_DigestUpdate(a,b,c); -end; - -function EVP_VerifyInit_ex(a: PEVP_MD_CTX; b: PEVP_MD; c: PENGINE) : TIdC_INT; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := EVP_DigestInit_ex(a,b,c); -end; - -function EVP_VerifyInit(a: PEVP_MD_CTX; b: PEVP_MD) : TIdC_INT; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := EVP_DigestInit(a,b); -end; - -function EVP_VerifyUpdate(a: PEVP_MD_CTX; b: Pointer; c : size_t) : TIdC_INT; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := EVP_DigestUpdate(a,b,c); -end; - -function EVP_OpenUpdate(a: PEVP_CIPHER_CTX; _out : PIdAnsiChar; outl : PIdC_INT; - _in : PIdAnsiChar; inl : TIdC_INT) : TIdC_INT; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := EVP_DecryptUpdate(a,_out,outl,_in,inl); -end; - -function EVP_SealUpdate(a : PEVP_CIPHER_CTX; b: PIdAnsiChar; c : PIdC_INT; - d: PIdAnsiChar; e : TIdC_INT) : TIdC_INT; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := EVP_EncryptUpdate(a,b,c,d,e) -end; - -function EVP_DigestSignUpdate(a : PEVP_MD_CTX; b : Pointer; c : size_t) : TIdC_Int; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := EVP_DigestUpdate(a,b,size_t(c)); -end; - -function EVP_DigestVerifyUpdate(a : PEVP_MD_CTX; b : Pointer; c : size_t) : TIdC_INT; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := EVP_DigestUpdate(a,b,size_t(c)); -end; - -function BIO_get_md(b : PBIO; var mdp : PEVP_MD) : TIdC_LONG; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := BIO_ctrl(b,BIO_C_GET_MD,0,@mdp); -end; - -function BIO_get_md_ctx(b : PBIO; var mdcp : PEVP_MD_CTX) : TIdC_LONG; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := BIO_ctrl(b,BIO_C_GET_MD_CTX,0,@mdcp); -end; - -function BIO_set_md_ctx(b : PBIO; mdcp : PEVP_MD_CTX) : TIdC_LONG; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := BIO_ctrl(b,BIO_C_SET_MD_CTX,0,mdcp); -end; - -function BIO_get_cipher_status(b : PBIO) : TIdC_LONG; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := BIO_ctrl(b,BIO_C_GET_CIPHER_STATUS,0,nil); -end; - -function BIO_get_cipher_ctx(b : PBIO; var c_pp : PEVP_CIPHER_CTX): TIdC_LONG; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := BIO_ctrl(b,BIO_C_GET_CIPHER_CTX,0,@c_pp); -end; - -{$ifndef OPENSSL_NO_DES} -function EVP_des_cfb : PEVP_CIPHER; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := EVP_des_cfb64; -end; - -function EVP_des_ede_cfb: PEVP_CIPHER; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := EVP_des_ede_cfb64; -end; - -function EVP_des_ede3_cfb: PEVP_CIPHER; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := EVP_des_ede3_cfb64 -end; -{$endif} - -{$ifndef OPENSSL_NO_IDEA} -function EVP_idea_cfb: PEVP_CIPHER; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := EVP_idea_cfb64 -end; - -{$endif} - -{$ifndef OPENSSL_NO_RC2} -function EVP_rc2_cfb: PEVP_CIPHER; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := EVP_rc2_cfb64; -end; -{$endif} - -{$ifndef OPENSSL_NO_BF} -function EVP_bf_cfb: PEVP_CIPHER; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := EVP_bf_cfb64; -end; -{$endif} - -{$ifndef OPENSSL_NO_CAST} -function EVP_cast5_cfb: PEVP_CIPHER; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := EVP_cast5_cfb64; -end; -{$endif} - -{$ifndef OPENSSL_NO_RC5} -function EVP_rc5_32_12_16_cfb: PEVP_CIPHER; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := EVP_rc5_32_12_16_cfb64; -end; -{$endif} - -{$ifndef OPENSSL_NO_AES} -function EVP_aes_128_cfb: PEVP_CIPHER; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := EVP_aes_128_cfb128; -end; - -function EVP_aes_192_cfb: PEVP_CIPHER; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := EVP_aes_192_cfb128 -end; - -function EVP_aes_256_cfb: PEVP_CIPHER; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := EVP_aes_256_cfb128; -end; -{$endif} - -{$ifndef OPENSSL_NO_CAMELLIA} -function EVP_camellia_128_cfb: PEVP_CIPHER; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := EVP_camellia_128_cfb128; -end; - -function EVP_camellia_192_cfb: PEVP_CIPHER; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := EVP_camellia_192_cfb128; -end; - -function EVP_camellia_256_cfb: PEVP_CIPHER; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := EVP_camellia_256_cfb128; -end; -{$ENDIF} - -{$ifndef OPENSSL_NO_SEED} -function EVP_seed_cfb: PEVP_CIPHER; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := EVP_seed_cfb128; -end; -{$endif} - -function EVP_PKEY_CTX_set_signature_md(ctx : PEVP_PKEY_CTX;md : PEVP_PKEY_CTX) : TIdC_INT; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := EVP_PKEY_CTX_ctrl(ctx, -1, EVP_PKEY_OP_TYPE_SIG, - EVP_PKEY_CTRL_MD, 0, Pointer(md)); -end; - -procedure SSLeay_add_all_algorithms; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - OpenSSL_add_all_algorithms; -end; - -procedure SSLeay_add_all_ciphers; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - OpenSSL_add_all_ciphers; -end; - -procedure SSLeay_add_all_digests; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - OpenSSL_add_all_digests; -end; - -procedure X509V3_set_ctx_nodb(ctx: X509V3_CTX); -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - ctx.db := nil; -end; - -function ERR_PACK(l, f, r : TIdC_INT) : TIdC_ULONG; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := ((TIdC_ULONG(l) and $ff) * $1000000) or - ((TIdC_ULONG(f) and $fff) * $1000) or - (TIdC_ULONG(r) and $fff); -end; - -function ERR_GET_LIB(const l : TIdC_INT) : TIdC_ULONG; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := (l shr 24) and $ff; -end; - -function ERR_GET_FUNC(const l : TIdC_INT) : TIdC_ULONG; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := (l shr 12) and $fff; -end; - -function ERR_FATAL_ERROR(const l : TIdC_INT) : Boolean; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := (l and ERR_R_FATAL) > 0; -end; - -function ERR_GET_REASON(const l : TIdC_INT) : TIdC_INT; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := l and $fff; -end; - -//__FILE__,__LINE__ preprocessor macros are not available in Pascal. -//so we can't pass error location info in the last two parameters. -procedure SYSerr(const f,r : TIdC_INT); -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - ERR_PUT_error(ERR_LIB_SYS,f,r,nil,0); -end; - -procedure BNerr(const f,r : TIdC_INT); -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - ERR_PUT_error(ERR_LIB_BN,f,r,nil,0); -end; - -procedure RSAerr(const f,r : TIdC_INT); -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - ERR_PUT_error(ERR_LIB_RSA,f,r,nil,0); -end; - -procedure DHerrr(const f,r : TIdC_INT); -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - ERR_PUT_error(ERR_LIB_DH,f,r,nil,0); -end; - -procedure EVPerr(const f,r : TIdC_INT); -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - ERR_PUT_error(ERR_LIB_EVP,f,r,nil,0); -end; - -procedure BUFerr(const f,r : TIdC_INT); -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - ERR_PUT_error(ERR_LIB_BUF,f,r,nil,0); -end; - -procedure OBJerr(const f,r : TIdC_INT); -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - ERR_PUT_error(ERR_LIB_OBJ,f,r,nil,0); -end; - -procedure PEMerr(const f,r : TIdC_INT); -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - ERR_PUT_error(ERR_LIB_PEM,f,r,nil,0); -end; - -procedure DSAerr(const f,r : TIdC_INT); -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - ERR_PUT_error(ERR_LIB_DSA,f,r,nil,0); -end; - -procedure X509err(const f,r : TIdC_INT); -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - ERR_PUT_error(ERR_LIB_X509,f,r,nil,0); -end; - -procedure ASN1err(const f,r : TIdC_INT); -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - ERR_PUT_error(ERR_LIB_ASN1,f,r,nil,0); -end; - -procedure CONFerr(const f,r : TIdC_INT); -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - ERR_PUT_error(ERR_LIB_CONF,f,r,nil,0); -end; - -procedure CRYPTOerr(const f,r : TIdC_INT); -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - ERR_PUT_error(ERR_LIB_CRYPTO,f,r,nil,0); -end; - -procedure ECerr(const f,r : TIdC_INT); -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - ERR_PUT_error(ERR_LIB_EC,f,r,nil,0); -end; - -procedure SSLerr(const f,r : TIdC_INT); -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - ERR_PUT_error(ERR_LIB_SSL,f,r,nil,0); -end; - -procedure BIOerr(const f,r : TIdC_INT); -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - ERR_PUT_error(ERR_LIB_BIO,f,r,nil,0); -end; - -procedure PKCS7err(const f,r : TIdC_INT); -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - ERR_PUT_error(ERR_LIB_PKCS7,f,r,nil,0); -end; - -procedure X509V3err(const f,r : TIdC_INT); -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - ERR_PUT_error(ERR_LIB_X509V3,f,r,nil,0); -end; - -procedure PKCS12err(const f,r : TIdC_INT); -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - ERR_PUT_error(ERR_LIB_PKCS12,f,r,nil,0); -end; - -procedure RANDerr(const f,r : TIdC_INT); -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - ERR_PUT_error(ERR_LIB_RAND,f,r,nil,0); -end; - -procedure DSOerr(const f,r : TIdC_INT); -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - ERR_PUT_error(ERR_LIB_DSO,f,r,nil,0); -end; - -procedure ENGINEerr(const f,r : TIdC_INT); -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - ERR_PUT_error(ERR_LIB_ENGINE,f,r,nil,0); -end; - -procedure OCSPerr(const f,r : TIdC_INT); -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - ERR_PUT_error(ERR_LIB_OCSP,f,r,nil,0); -end; - -procedure UIerr(const f,r : TIdC_INT); -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - ERR_PUT_error(ERR_LIB_UI,f,r,nil,0); -end; - -procedure COMPerr(const f,r : TIdC_INT); -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - ERR_PUT_error(ERR_LIB_COMP,f,r,nil,0); -end; - -procedure ECDSAerr(const f,r : TIdC_INT); -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - ERR_PUT_error(ERR_LIB_ECDSA,f,r,nil,0); -end; - -procedure ECDHerr(const f,r : TIdC_INT); -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - ERR_PUT_error(ERR_LIB_ECDH,f,r,nil,0); -end; - -procedure STOREerr(const f,r : TIdC_INT); -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - ERR_PUT_error(ERR_LIB_STORE,f,r,nil,0); -end; - -procedure FIPSerr(const f,r : TIdC_INT); -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - ERR_PUT_error(ERR_LIB_FIPS,f,r,nil,0); -end; - -procedure CMSerr(const f,r : TIdC_INT); -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - ERR_PUT_error(ERR_LIB_CMS,f,r,nil,0); -end; - -procedure TSerr(const f,r : TIdC_INT); -begin - ERR_PUT_error(ERR_LIB_TS,f,r,nil,0); -end; - -procedure HMACerr(const f,r : TIdC_INT); -begin - ERR_PUT_error(ERR_LIB_HMAC,(f),(r),nil,0); -end; - -procedure JPAKEerr(const f,r : TIdC_INT); -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - ERR_PUT_error(ERR_LIB_JPAKE,f,r,nil,0); -end; - -procedure CRYPTO_w_lock(const _type : TIdC_INT); -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - {$IFNDEF OPENSSL_NO_LOCKING} - _CRYPTO_lock(CRYPTO_LOCK or CRYPTO_WRITE,_type, nil, 0); - {$ENDIF} -end; - -procedure CRYPTO_w_unlock(const _type : TIdC_INT); -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - {$IFNDEF OPENSSL_NO_LOCKING} - _CRYPTO_lock(CRYPTO_UNLOCK or CRYPTO_WRITE,_type, nil, 0); - {$ENDIF} -end; - -procedure CRYPTO_r_lock(const _type : TIdC_INT); -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - {$IFNDEF OPENSSL_NO_LOCKING} - _CRYPTO_lock(CRYPTO_LOCK or CRYPTO_READ,_type, nil, 0); - {$ENDIF} -end; - -procedure CRYPTO_r_unlock(const _type : TIdC_INT); -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - {$IFNDEF OPENSSL_NO_LOCKING} - _CRYPTO_lock(CRYPTO_UNLOCK or CRYPTO_READ,_type, nil, 0); - {$ENDIF} -end; - -function X509_LOOKUP_load_file(x : PX509_LOOKUP; name : PIdAnsiChar; _type : TIdC_LONG) : TIdC_INT; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := X509_LOOKUP_ctrl(x, X509_L_FILE_LOAD, name, _type, nil); -end; - -function X509_LOOKUP_add_dir(x : PX509_LOOKUP; name : PIdAnsiChar; _type : TIdC_LONG) : TIdC_INT; -{$IFDEF USE_INLINE} inline; {$ENDIF} -begin - Result := X509_LOOKUP_ctrl(x, X509_L_ADD_DIR, name, _type, nil); -end; - -procedure RAND_cleanup; -begin - if Assigned(_RAND_cleanup) then begin - _RAND_cleanup(); - end; -end; - -function RAND_bytes(buf : PIdAnsiChar; num : integer) : integer; -begin - if Assigned(_RAND_bytes) then begin - Result := _RAND_bytes(buf, num); - end else begin - Result := 0; - end; -end; - -function RAND_pseudo_bytes(buf : PIdAnsiChar; num : integer) : integer; -begin - if Assigned(_RAND_pseudo_bytes) then begin - Result := _RAND_pseudo_bytes(buf, num); - end else begin - Result := 0; - end; -end; - -procedure RAND_seed(buf : PIdAnsiChar; num : integer); -begin - if Assigned(_RAND_seed) then begin - _RAND_seed(buf, num); - end; -end; - -procedure RAND_add(buf : PIdAnsiChar; num : integer; entropy : integer); -begin - if Assigned(_RAND_add) then begin - _RAND_add(buf, num, entropy); - end; -end; - -function RAND_status() : integer; -begin - if Assigned(_RAND_status) then begin - Result := _RAND_status(); - end else begin - Result := 0; - end; -end; - -{$IFDEF SYS_WIN} -function RAND_event(iMsg : UINT; wp : wparam; lp : lparam) : integer; -begin - if Assigned(_RAND_event) then begin - Result := _RAND_event(iMsg, wp, lp); - end else begin - Result := 0; - end; -end; - -procedure RAND_screen(); -begin - if Assigned(_RAND_screen) then begin - _RAND_screen(); - end; -end; -{$ENDIF} - -initialization - {$IFDEF STATICLOAD_OPENSSL} - InitializeFuncPointers; - {$ELSE} - FFailedLoadList := TStringList.Create; - {$ENDIF} - SetFIPSMode := OpenSSLSetFIPSMode; - GetFIPSMode := OpenSSLGetFIPSMode; - IsHashingIntfAvail := OpenSSLIsHashingIntfAvail; - IsMD2HashIntfAvail := OpenSSLIsMD2HashIntfAvail; - GetMD2HashInst := OpenSSLGetMD2HashInst; - IsMD4HashIntfAvail := OpenSSLIsMD4HashIntfAvail; - GetMD4HashInst := OpenSSLGetMD4HashInst; - IsMD5HashIntfAvail := OpenSSLIsMD5HashIntfAvail; - GetMD5HashInst := OpenSSLGetMD5HashInst; - IsSHA1HashIntfAvail := OpenSSLIsSHA1HashIntfAvail; - GetSHA1HashInst := OpenSSLGetSHA1HashInst; - IsSHA224HashIntfAvail := OpenSSLIsSHA224HashIntfAvail; - GetSHA224HashInst := OpenSSLGetSHA224HashInst; - IsSHA256HashIntfAvail := OpenSSLIsSHA256HashIntfAvail; - GetSHA256HashInst := OpenSSLGetSHA256HashInst; - IsSHA384HashIntfAvail := OpenSSLIsSHA384HashIntfAvail; - GetSHA384HashInst := OpenSSLGetSHA384HashInst; - IsSHA512HashIntfAvail := OpenSSLIsSHA512HashIntfAvail; - GetSHA512HashInst := OpenSSLGetSHA512HashInst; - UpdateHashInst := OpenSSLUpdateHashInst; - FinalHashInst := OpenSSLFinalHashInst; - IsHMACAvail := OpenSSLIsHMACAvail; - IsHMACMD5Avail := OpenSSLIsHMACMD5Avail; - GetHMACMD5HashInst := OpenSSLGetHMACMD5Inst; - IsHMACSHA1Avail := OpenSSLIsHMACSHA1Avail; - GetHMACSHA1HashInst:= OpenSSLGetHMACSHA1Inst; - IsHMACSHA224Avail := OpenSSLIsHMACSHA224Avail; - GetHMACSHA224HashInst:= OpenSSLGetHMACSHA224Inst; - IsHMACSHA256Avail := OpenSSLIsHMACSHA256Avail; - GetHMACSHA256HashInst:= OpenSSLGetHMACSHA256Inst; - IsHMACSHA384Avail := OpenSSLIsHMACSHA384Avail; - GetHMACSHA384HashInst:= OpenSSLGetHMACSHA384Inst; - IsHMACSHA512Avail := OpenSSLIsHMACSHA512Avail; - GetHMACSHA512HashInst:= OpenSSLGetHMACSHA512Inst; - UpdateHMACInst := OpenSSLUpdateHMACInst; - FinalHMACInst := OpenSSLFinalHMACInst; - LoadHashLibrary := LoadOpenSSL; -{$IFNDEF STATICLOAD_OPENSSL} -finalization - FreeAndNil(FFailedLoadList); -{$ENDIF} - -end. +{ + This file is part of the Indy (Internet Direct) project, and is offered + under the dual-licensing agreement described on the Indy website. + (http://www.indyproject.org/) + + Copyright: + (c) 1993-2024, Chad Z. Hower and the Indy Pit Crew. All rights reserved. +} +unit IdSSLOpenSSLHeaders; + +{ + Author: Gregor Ibic (gregor.ibic@intelicom.si) + Copyright: (c) Gregor Ibic, Intelicom d.o.o and Indy Working Group. +} +{ +Note to self:: +===== Win32 with mingw32 ==== +Configuring for mingw + no-camellia [default] OPENSSL_NO_CAMELLIA (skip dir) + no-capieng [default] OPENSSL_NO_CAPIENG (skip dir) + no-cms [default] OPENSSL_NO_CMS (skip dir) + no-gmp [default] OPENSSL_NO_GMP (skip dir) + no-jpake [experimental] OPENSSL_NO_JPAKE (skip dir) + no-krb5 [krb5-flavor not specified] OPENSSL_NO_KRB5 + no-mdc2 [default] OPENSSL_NO_MDC2 (skip dir) + no-montasm [default] + no-rc5 [default] OPENSSL_NO_RC5 (skip dir) + no-rfc3779 [default] OPENSSL_NO_RFC3779 (skip dir) + no-seed [default] OPENSSL_NO_SEED (skip dir) + no-shared [default] + no-zlib [default] + no-zlib-dynamic [default] +IsMK1MF=1 +CC =gcc +CFLAG =-DOPENSSL_THREADS -DDSO_WIN32 -mno-cygwin -DL_ENDIAN -fomit-frame-pointer -O3 -march=i486 -Wall -D_WIN32_WINNT=0x333 -DOPENSSL_BN_ASM_PART_WORDS -DOPENSSL_IA32_SSE2 -DSHA1_ASM -DMD5_ASM -DRMD160_ASM -DAES_ASM +EX_LIBS =-lwsock32 -lgdi32 +CPUID_OBJ =x86cpuid-cof.o +BN_ASM =bn86-cof.o co86-cof.o +DES_ENC =dx86-cof.o yx86-cof.o +AES_ASM_OBJ =ax86-cof.o +BF_ENC =bx86-cof.o +CAST_ENC =cx86-cof.o +RC4_ENC =rx86-cof.o rc4_skey.o +RC5_ENC =r586-cof.o +MD5_OBJ_ASM =mx86-cof.o +SHA1_OBJ_ASM =sx86-cof.o s512sse2-cof.o +RMD160_OBJ_ASM=rm86-cof.o +PROCESSOR = +RANLIB =true +ARFLAGS = +PERL =perl +THIRTY_TWO_BIT mode +DES_PTR used +DES_RISC1 used +DES_UNROLL used +BN_LLONG mode +RC4_INDEX mode +RC4_CHUNK is undefined + +Configured for mingw. +Generating x86 for GNU assember +Bignum +DES +crypt +Blowfish +CAST5 +RC4 +MD5 +SHA1 +RIPEMD160 +RC5\32 +CPUID +Generating makefile +Generating DLL definition files +Building the libraries +Building OpenSSL +===== Win64 ====== +Targeting Windows Server 2003 X64 RETAIL + +perl Configure VC-WIN64A + +W:\openssl\openssl-0.9.8k>perl Configure VC-WIN64A +Configuring for VC-WIN64A + no-camellia [default] OPENSSL_NO_CAMELLIA (skip dir) + no-capieng [default] OPENSSL_NO_CAPIENG (skip dir) + no-cms [default] OPENSSL_NO_CMS (skip dir) + no-gmp [default] OPENSSL_NO_GMP (skip dir) + no-jpake [experimental] OPENSSL_NO_JPAKE (skip dir) + no-krb5 [krb5-flavor not specified] OPENSSL_NO_KRB5 + no-mdc2 [default] OPENSSL_NO_MDC2 (skip dir) + no-montasm [default] + no-rc5 [default] OPENSSL_NO_RC5 (skip dir) + no-rfc3779 [default] OPENSSL_NO_RFC3779 (skip dir) + no-seed [default] OPENSSL_NO_SEED (skip dir) + no-shared [default] + no-zlib [default] + no-zlib-dynamic [default] +IsMK1MF=1 +CC =cl +CFLAG =-DOPENSSL_THREADS -DDSO_WIN32 +EX_LIBS = +CPUID_OBJ = +BN_ASM =bn_asm.o +DES_ENC =des_enc.o fcrypt_b.o +AES_ASM_OBJ =aes_core.o aes_cbc.o +BF_ENC =bf_enc.o +CAST_ENC =c_enc.o +RC4_ENC =rc4_enc.o rc4_skey.o +RC5_ENC =rc5_enc.o +MD5_OBJ_ASM = +SHA1_OBJ_ASM = +RMD160_OBJ_ASM= +PROCESSOR = +RANLIB =true +ARFLAGS = +PERL =perl +SIXTY_FOUR_BIT mode +DES_INT used +RC4_CHUNK is unsigned long long + +Configured for VC-WIN64A. + +W:\openssl\openssl-0.9.8k>ms\do_win64a + +W:\openssl\openssl-0.9.8k>perl util\mkfiles.pl 1>MINFO + +W:\openssl\openssl-0.9.8k>perl ms\uplink.pl win64a 1>ms\uptable.asm + +W:\openssl\openssl-0.9.8k>ml64 -c -Foms\uptable.obj ms\uptable.asm +Microsoft (R) Macro Assembler (AMD64) Version 8.00.40310.39 +Copyright (C) Microsoft Corporation. All rights reserved. + + Assembling: ms\uptable.asm + +W:\openssl\openssl-0.9.8k>perl util\mk1mf.pl no-asm VC-WIN64A 1>ms\nt.mak + +W:\openssl\openssl-0.9.8k>perl util\mk1mf.pl dll no-asm VC-WIN64A 1>ms\ntdll.ma +k + +W:\openssl\openssl-0.9.8k>perl util\mkdef.pl 32 libeay 1>ms\libeay32.def + +W:\openssl\openssl-0.9.8k>perl util\mkdef.pl 32 ssleay 1>ms\ssleay32.def + +CFLAG= /MD /Ox /W3 /Gs0 /GF /Gy /nologo +-DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DDSO_WIN32 -DOPENSSL_SYSNAME_WIN32 +-DOPENSSL_SYSNAME_WINNT -DUNICODE -D_UNICODE -D_CRT_SECURE_NO_DEPRECATE +-D_CRT_NONSTDC_NO_DEPRECATE -DOPENSSL_USE_APPLINK -I. /Fdout32dll +-DOPENSSL_NO_CAMELLIA -DOPENSSL_NO_SEED -DOPENSSL_NO_RC5 -DOPENSSL_NO_MDC2 +-DOPENSSL_NO_CMS -DOPENSSL_NO_JPAKE -DOPENSSL_NO_CAPIENG -DOPENSSL_NO_KRB5 +-DOPENSSL_NO_DYNAMIC_ENGINE + +} + +interface + +{$I IdCompilerDefines.inc} + +{$WRITEABLECONST OFF} + +{$IFNDEF FPC} + {$IFDEF WIN32} + {$ALIGN OFF} + {$ENDIF} + {$IFDEF WIN64} + {$ALIGN ON} + {$ENDIF} + {$IFNDEF WIN32_OR_WIN64} + {$IFNDEF VCL_CROSS_COMPILE} + {$message error error alignment!} + {$ENDIF} + {$ENDIF} +{$ELSE} + {$packrecords C} +{$ENDIF} + +//THe OpenSSL developers use a IF 0 and an IF 1 convention for selectively +//enabling or disabling things. +{$DEFINE USE_THIS} +{.$DEFINE OMIT_THIS} +{ +IMPORTANT!!!! + +A lot of IFDEF's and defines have to used because OpenSSL has a number of options' +and those can effect the API. The options are determined by a "configure" script +that generates apporpriate make files with the appropriate defines. If you do +custom compiles of OpenSSL or if it's compiled differently that what I assume, +you will need to add or deactivate the defines. + +my $x86_gcc_des="DES_PTR DES_RISC1 DES_UNROLL"; + +# MD2_CHAR slags pentium pros +my $x86_gcc_opts="RC4_INDEX MD2_INT"; +... +# This is what $depflags will look like with the above defaults +# (we need this to see if we should advise the user to run "make depend"): +my $default_depflags = " -DOPENSSL_NO_CAMELLIA -DOPENSSL_NO_CAPIENG -DOPENSSL_NO_CMS -DOPENSSL_NO_GMP -DOPENSSL_NO_JPAKE -DOPENSSL_NO_MDC2 -DOPENSSL_NO_RC5 -DOPENSSL_NO_RFC3779 -DOPENSSL_NO_SEED"; + +} + +// # Our development configs +// "purify", "purify gcc:-g -DPURIFY -Wall::(unknown)::-lsocket -lnsl::::", +// "debug", "gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DOPENSSL_NO_ASM -ggdb -g2 -Wformat -Wshadow -Wmissing-prototypes -Wmissing-declarations -Werror::(unknown)::-lefence::::", +// "debug-ben", "gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DPEDANTIC -DDEBUG_SAFESTACK -O2 -pedantic -Wall -Wshadow -Werror -pipe::(unknown):::::bn86-elf.o co86-elf.o", +// "debug-ben-openbsd","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DPEDANTIC -DDEBUG_SAFESTACK -DOPENSSL_OPENBSD_DEV_CRYPTO -DOPENSSL_NO_ASM -O2 -pedantic -Wall -Wshadow -Werror -pipe::(unknown)::::", +// "debug-ben-openbsd-debug","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DPEDANTIC -DDEBUG_SAFESTACK -DOPENSSL_OPENBSD_DEV_CRYPTO -DOPENSSL_NO_ASM -g3 -O2 -pedantic -Wall -Wshadow -Werror -pipe::(unknown)::::", +// "debug-ben-debug", "gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DPEDANTIC -DDEBUG_SAFESTACK -g3 -O2 -pedantic -Wall -Wshadow -Werror -pipe::(unknown)::::::", +// "debug-ben-strict", "gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DCONST_STRICT -O2 -Wall -Wshadow -Werror -Wpointer-arith -Wcast-qual -Wwrite-strings -pipe::(unknown)::::::", +// "debug-rse","cc:-DTERMIOS -DL_ENDIAN -pipe -O -g -ggdb3 -Wall::(unknown):::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}", +// "debug-bodo", "gcc:-DL_ENDIAN -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBIO_PAIR_DEBUG -DPEDANTIC -g -march=i486 -pedantic -Wshadow -Wall -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe::-D_REENTRANT:::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}", +// "debug-ulf", "gcc:-DTERMIOS -DL_ENDIAN -march=i486 -Wall -DBN_DEBUG -DBN_DEBUG_RAND -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DOPENSSL_NO_ASM -g -Wformat -Wshadow -Wmissing-prototypes -Wmissing-declarations:::CYGWIN32:::${no_asm}:win32:cygwin-shared:::.dll", +// "debug-steve64", "gcc:-m64 -DL_ENDIAN -DTERMIO -DREF_CHECK -DCONF_DEBUG -DDEBUG_SAFESTACK -DCRYPTO_MDEBUG_ALL -DPEDANTIC -DOPENSSL_NO_DEPRECATED -g -pedantic -Wall -Werror -Wno-long-long -Wsign-compare -DMD32_REG_T=int::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK BF_PTR2 DES_INT DES_UNROLL:${x86_64_asm}:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +// "debug-steve32", "gcc:-m32 -DL_ENDIAN -DREF_CHECK -DCONF_DEBUG -DDEBUG_SAFESTACK -DCRYPTO_MDEBUG_ALL -DPEDANTIC -DOPENSSL_NO_DEPRECATED -g -pedantic -Wno-long-long -Wall -Werror -Wshadow -pipe::-D_REENTRANT::-rdynamic -ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC:-m32:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +// "debug-steve", "gcc:-DL_ENDIAN -DREF_CHECK -DCONF_DEBUG -DDEBUG_SAFESTACK -DCRYPTO_MDEBUG_ALL -DPEDANTIC -m32 -g -pedantic -Wno-long-long -Wall -Werror -Wshadow -pipe::-D_REENTRANT::-rdynamic -ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared", +// "debug-steve-opt", "gcc:-DL_ENDIAN -DREF_CHECK -DCONF_DEBUG -DDEBUG_SAFESTACK -DCRYPTO_MDEBUG_ALL -DPEDANTIC -m32 -O3 -g -pedantic -Wno-long-long -Wall -Werror -Wshadow -pipe::-D_REENTRANT::-rdynamic -ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared", +// "debug-steve-linux-pseudo64", "gcc:-DL_ENDIAN -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DDEBUG_SAFESTACK -DCRYPTO_MDEBUG_ALL -DOPENSSL_NO_ASM -g -mcpu=i486 -Wall -Werror -Wshadow -pipe::-D_REENTRANT::-rdynamic -ldl:SIXTY_FOUR_BIT:${no_asm}:dlfcn:linux-shared", +// "debug-levitte-linux-elf","gcc:-DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -DPEDANTIC -ggdb -g3 -mcpu=i486 -pedantic -ansi -Wall -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +// "debug-levitte-linux-noasm","gcc:-DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DOPENSSL_NO_ASM -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -DPEDANTIC -ggdb -g3 -mcpu=i486 -pedantic -ansi -Wall -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +// "debug-levitte-linux-elf-extreme","gcc:-DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -DPEDANTIC -ggdb -g3 -mcpu=i486 -pedantic -ansi -Wall -W -Wundef -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +// "debug-levitte-linux-noasm-extreme","gcc:-DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DOPENSSL_NO_ASM -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -DPEDANTIC -ggdb -g3 -mcpu=i486 -pedantic -ansi -Wall -W -Wundef -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +// "debug-geoff","gcc:-DBN_DEBUG -DBN_DEBUG_RAND -DBN_STRICT -DPURIFY -DOPENSSL_NO_DEPRECATED -DOPENSSL_NO_ASM -DOPENSSL_NO_INLINE_ASM -DL_ENDIAN -DTERMIO -DPEDANTIC -O1 -ggdb2 -Wall -Werror -Wundef -pedantic -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-align -Wsign-compare -Wmissing-prototypes -Wmissing-declarations -Wno-long-long::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +// "debug-linux-pentium","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -DTERMIO -g -mcpu=pentium -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn", +// "debug-linux-ppro","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -DTERMIO -g -mcpu=pentiumpro -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn", +// "debug-linux-elf","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -DTERMIO -g -march=i486 -Wall::-D_REENTRANT::-lefence -ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +// "debug-linux-elf-noefence","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -DTERMIO -g -march=i486 -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +// "dist", "cc:-O::(unknown)::::::", + +// # Basic configs that should work on any (32 and less bit) box +// "gcc", "gcc:-O3::(unknown):::BN_LLONG:::", +// "cc", "cc:-O::(unknown)::::::", + +// ####VOS Configurations +// "vos-gcc","gcc:-O3 -Wall -D_POSIX_C_SOURCE=200112L -D_BSD -DB_ENDIAN::(unknown):VOS:-Wl,-map:BN_LLONG:${no_asm}:::::.so:", +// "debug-vos-gcc","gcc:-O0 -g -Wall -D_POSIX_C_SOURCE=200112L -D_BSD -DB_ENDIAN -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG::(unknown):VOS:-Wl,-map:BN_LLONG:${no_asm}:::::.so:", + +// #### Solaris x86 with GNU C setups +// # -DOPENSSL_NO_INLINE_ASM switches off inline assembler. We have to do it +// # here because whenever GNU C instantiates an assembler template it +// # surrounds it with #APP #NO_APP comment pair which (at least Solaris +// # 7_x86) /usr/ccs/bin/as fails to assemble with "Illegal mnemonic" +// # error message. +// "solaris-x86-gcc","gcc:-O3 -fomit-frame-pointer -march=pentium -Wall -DL_ENDIAN -DOPENSSL_NO_INLINE_ASM::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:solaris-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +// # -shared -static-libgcc might appear controversial, but modules taken +// # from static libgcc do not have relocations and linking them into our +// # shared objects doesn't have any negative side-effects. On the contrary, +// # doing so makes it possible to use gcc shared build with Sun C. Given +// # that gcc generates faster code [thanks to inline assembler], I would +// # actually recommend to consider using gcc shared build even with vendor +// # compiler:-) +// # +// "solaris64-x86_64-gcc","gcc:-m64 -O3 -Wall -DL_ENDIAN -DMD32_REG_T=int::-D_REENTRANT::-lsocket -lnsl -ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK BF_PTR2 DES_INT DES_UNROLL:${x86_64_asm}:dlfcn:solaris-shared:-fPIC:-m64 -shared -static-libgcc:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +// +// #### Solaris x86 with Sun C setups +// "solaris-x86-cc","cc:-fast -O -Xa::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_UNROLL BF_PTR:${no_asm}:dlfcn:solaris-shared:-KPIC:-G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +// "solaris64-x86_64-cc","cc:-fast -xarch=amd64 -xstrconst -Xa -DL_ENDIAN::-D_REENTRANT::-lsocket -lnsl -ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK BF_PTR2 DES_INT DES_UNROLL:${x86_64_asm}:dlfcn:solaris-shared:-KPIC:-xarch=amd64 -G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", + +// #### SPARC Solaris with GNU C setups +// "solaris-sparcv7-gcc","gcc:-O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${no_asm}:dlfcn:solaris-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +// "solaris-sparcv8-gcc","gcc:-mv8 -O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::sparcv8.o:des_enc-sparc.o fcrypt_b.o:::::::::dlfcn:solaris-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +// # -m32 should be safe to add as long as driver recognizes -mcpu=ultrasparc +// "solaris-sparcv9-gcc","gcc:-m32 -mcpu=ultrasparc -O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::sparcv8plus.o:des_enc-sparc.o fcrypt_b.o:::::::::dlfcn:solaris-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +// "solaris64-sparcv9-gcc","gcc:-m64 -mcpu=ultrasparc -O3 -Wall -DB_ENDIAN::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL BF_PTR:::des_enc-sparc.o fcrypt_b.o:::::::::dlfcn:solaris-shared:-fPIC:-m64 -shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +// #### +// "debug-solaris-sparcv8-gcc","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG_ALL -O -g -mv8 -Wall -DB_ENDIAN::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::sparcv8.o::::::::::dlfcn:solaris-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +// "debug-solaris-sparcv9-gcc","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG_ALL -DPEDANTIC -O -g -mcpu=ultrasparc -pedantic -ansi -Wall -Wshadow -Wno-long-long -D__EXTENSIONS__ -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::sparcv8plus.o:des_enc-sparc.o fcrypt_b.o:::::::::dlfcn:solaris-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", + +// #### SPARC Solaris with Sun C setups +// # SC4.0 doesn't pass 'make test', upgrade to SC5.0 or SC4.2. +// # SC4.2 is ok, better than gcc even on bn as long as you tell it -xarch=v8 +// # SC5.0 note: Compiler common patch 107357-01 or later is required! +// "solaris-sparcv7-cc","cc:-xO5 -xstrconst -xdepend -Xa -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_RISC1 DES_UNROLL BF_PTR:${no_asm}:dlfcn:solaris-shared:-KPIC:-G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +// "solaris-sparcv8-cc","cc:-xarch=v8 -xO5 -xstrconst -xdepend -Xa -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_RISC1 DES_UNROLL BF_PTR::sparcv8.o:des_enc-sparc.o fcrypt_b.o:::::::::dlfcn:solaris-shared:-KPIC:-G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +// "solaris-sparcv9-cc","cc:-xtarget=ultra -xarch=v8plus -xO5 -xstrconst -xdepend -Xa -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK_LL DES_PTR DES_RISC1 DES_UNROLL BF_PTR::sparcv8plus.o:des_enc-sparc.o fcrypt_b.o:::::::::dlfcn:solaris-shared:-KPIC:-G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +// "solaris64-sparcv9-cc","cc:-xtarget=ultra -xarch=v9 -xO5 -xstrconst -xdepend -Xa -DB_ENDIAN::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL BF_PTR:::des_enc-sparc.o fcrypt_b.o:::::::::dlfcn:solaris-shared:-KPIC:-xarch=v9 -G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):/usr/ccs/bin/ar rs", +// #### +// "debug-solaris-sparcv8-cc","cc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG_ALL -xarch=v8 -g -O -xstrconst -Xa -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_RISC1 DES_UNROLL BF_PTR::sparcv8.o::::::::::dlfcn:solaris-shared:-KPIC:-G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +// "debug-solaris-sparcv9-cc","cc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG_ALL -xtarget=ultra -xarch=v8plus -g -O -xstrconst -Xa -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK_LL DES_PTR DES_RISC1 DES_UNROLL BF_PTR::sparcv8plus.o::::::::::dlfcn:solaris-shared:-KPIC:-G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", + +// #### SunOS configs, assuming sparc for the gcc one. +// #"sunos-cc", "cc:-O4 -DNOPROTO -DNOCONST::(unknown):SUNOS::DES_UNROLL:${no_asm}::", +// "sunos-gcc","gcc:-O3 -mv8 -Dssize_t=int::(unknown):SUNOS::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL DES_PTR DES_RISC1:${no_asm}::", + +// #### IRIX 5.x configs +// # -mips2 flag is added by ./config when appropriate. +// "irix-gcc","gcc:-O3 -DTERMIOS -DB_ENDIAN::(unknown):::BN_LLONG MD2_CHAR RC4_INDEX RC4_CHAR RC4_CHUNK DES_UNROLL DES_RISC2 DES_PTR BF_PTR:${no_asm}:dlfcn:irix-shared:::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +// "irix-cc", "cc:-O2 -use_readonly_const -DTERMIOS -DB_ENDIAN::(unknown):::BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_RISC2 DES_UNROLL BF_PTR:${no_asm}:dlfcn:irix-shared:::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +// #### IRIX 6.x configs +// # Only N32 and N64 ABIs are supported. If you need O32 ABI build, invoke +// # './Configure irix-cc -o32' manually. +// "irix-mips3-gcc","gcc:-mabi=n32 -O3 -DTERMIOS -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE:::MD2_CHAR RC4_INDEX RC4_CHAR RC4_CHUNK_LL DES_UNROLL DES_RISC2 DES_PTR BF_PTR SIXTY_FOUR_BIT::bn-mips3.o::::::::::dlfcn:irix-shared::-mabi=n32:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +// "irix-mips3-cc", "cc:-n32 -mips3 -O2 -use_readonly_const -G0 -rdata_shared -DTERMIOS -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE:::DES_PTR RC4_CHAR RC4_CHUNK_LL DES_RISC2 DES_UNROLL BF_PTR SIXTY_FOUR_BIT::bn-mips3.o::::::::::dlfcn:irix-shared::-n32:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +// # N64 ABI builds. +// "irix64-mips4-gcc","gcc:-mabi=64 -mips4 -O3 -DTERMIOS -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE:::RC4_CHAR RC4_CHUNK DES_RISC2 DES_UNROLL SIXTY_FOUR_BIT_LONG::bn-mips3.o::::::::::dlfcn:irix-shared::-mabi=64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +// "irix64-mips4-cc", "cc:-64 -mips4 -O2 -use_readonly_const -G0 -rdata_shared -DTERMIOS -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE:::RC4_CHAR RC4_CHUNK DES_RISC2 DES_UNROLL SIXTY_FOUR_BIT_LONG::bn-mips3.o::::::::::dlfcn:irix-shared::-64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", + +// #### Unified HP-UX ANSI C configs. +// # Special notes: +// # - Originally we were optimizing at +O4 level. It should be noted +// # that the only difference between +O3 and +O4 is global inter- +// # procedural analysis. As it has to be performed during the link +// # stage the compiler leaves behind certain pseudo-code in lib*.a +// # which might be release or even patch level specific. Generating +// # the machine code for and analyzing the *whole* program appears +// # to be *extremely* memory demanding while the performance gain is +// # actually questionable. The situation is intensified by the default +// # HP-UX data set size limit (infamous 'maxdsiz' tunable) of 64MB +// # which is way too low for +O4. In other words, doesn't +O3 make +// # more sense? +// # - Keep in mind that the HP compiler by default generates code +// # suitable for execution on the host you're currently compiling at. +// # If the toolkit is ment to be used on various PA-RISC processors +// # consider './config +DAportable'. +// # - +DD64 is chosen in favour of +DA2.0W because it's meant to be +// # compatible with *future* releases. +// # - If you run ./Configure hpux-parisc-[g]cc manually don't forget to +// # pass -D_REENTRANT on HP-UX 10 and later. +// # - -DMD32_XARRAY triggers workaround for compiler bug we ran into in +// # 32-bit message digests. (For the moment of this writing) HP C +// # doesn't seem to "digest" too many local variables (they make "him" +// # chew forever:-). For more details look-up MD32_XARRAY comment in +// # crypto/sha/sha_lcl.h. +// # +// # +// # Since there is mention of this in shlib/hpux10-cc.sh +// "hpux-parisc-cc-o4","cc:-Ae +O4 +ESlit -z -DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY::-D_REENTRANT::-ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1:${no_asm}:dl:hpux-shared:+Z:-b:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +// "hpux-parisc-gcc","gcc:-O3 -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-Wl,+s -ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1:${no_asm}:dl:hpux-shared:-fPIC:-shared:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +// "hpux-parisc2-gcc","gcc:-march=2.0 -O3 -DB_ENDIAN -D_REENTRANT::::-Wl,+s -ldld:SIXTY_FOUR_BIT RC4_CHAR RC4_CHUNK DES_PTR DES_UNROLL DES_RISC1::pa-risc2.o::::::::::dl:hpux-shared:-fPIC:-shared:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +// "hpux64-parisc2-gcc","gcc:-O3 -DB_ENDIAN -D_REENTRANT::::-ldl:SIXTY_FOUR_BIT_LONG MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT::pa-risc2W.o::::::::::dlfcn:hpux-shared:-fpic:-shared:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", + +// # More attempts at unified 10.X and 11.X targets for HP C compiler. +// # +// # Chris Ruemmler +// # Kevin Steves +// "hpux-parisc-cc","cc:+O3 +Optrs_strongly_typed -Ae +ESlit -DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY::-D_REENTRANT::-Wl,+s -ldld:MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT:${no_asm}:dl:hpux-shared:+Z:-b:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +// "hpux-parisc1_0-cc","cc:+DAportable +O3 +Optrs_strongly_typed -Ae +ESlit -DB_ENDIAN -DMD32_XARRAY::-D_REENTRANT::-Wl,+s -ldld:MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT:${no_asm}:dl:hpux-shared:+Z:-b:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +// "hpux-parisc2-cc","cc:+DA2.0 +DS2.0 +O3 +Optrs_strongly_typed -Ae +ESlit -DB_ENDIAN -DMD32_XARRAY -D_REENTRANT::::-Wl,+s -ldld:SIXTY_FOUR_BIT MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT::pa-risc2.o::::::::::dl:hpux-shared:+Z:-b:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +// "hpux64-parisc2-cc","cc:+DD64 +O3 +Optrs_strongly_typed -Ae +ESlit -DB_ENDIAN -DMD32_XARRAY -D_REENTRANT::::-ldl:SIXTY_FOUR_BIT_LONG MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT::pa-risc2W.o::::::::::dlfcn:hpux-shared:+Z:+DD64 -b:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", + +// # HP/UX IA-64 targets +// "hpux-ia64-cc","cc:-Ae +DD32 +O2 +Olit=all -z -DB_ENDIAN -D_REENTRANT::::-ldl:SIXTY_FOUR_BIT MD2_CHAR RC4_INDEX DES_UNROLL DES_RISC1 DES_INT:${ia64_asm}:dlfcn:hpux-shared:+Z:+DD32 -b:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +// # Frank Geurts has patiently assisted with +// # with debugging of the following config. +// "hpux64-ia64-cc","cc:-Ae +DD64 +O3 +Olit=all -z -DB_ENDIAN -D_REENTRANT::::-ldl:SIXTY_FOUR_BIT_LONG MD2_CHAR RC4_INDEX DES_UNROLL DES_RISC1 DES_INT:${ia64_asm}:dlfcn:hpux-shared:+Z:+DD64 -b:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +// # GCC builds... +// "hpux-ia64-gcc","gcc:-O3 -DB_ENDIAN -D_REENTRANT::::-ldl:SIXTY_FOUR_BIT MD2_CHAR RC4_INDEX DES_UNROLL DES_RISC1 DES_INT:${ia64_asm}:dlfcn:hpux-shared:-fpic:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +// "hpux64-ia64-gcc","gcc:-mlp64 -O3 -DB_ENDIAN -D_REENTRANT::::-ldl:SIXTY_FOUR_BIT_LONG MD2_CHAR RC4_INDEX DES_UNROLL DES_RISC1 DES_INT:${ia64_asm}:dlfcn:hpux-shared:-fpic:-mlp64 -shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", + +// # Legacy HPUX 9.X configs... +// "hpux-cc", "cc:-DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY -Ae +ESlit +O2 -z::(unknown)::-Wl,+s -ldld:DES_PTR DES_UNROLL DES_RISC1:${no_asm}:dl:hpux-shared:+Z:-b:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +// "hpux-gcc", "gcc:-DB_ENDIAN -DBN_DIV2W -O3::(unknown)::-Wl,+s -ldld:DES_PTR DES_UNROLL DES_RISC1:${no_asm}:dl:hpux-shared:-fPIC:-shared:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", + +// #### HP MPE/iX http://jazz.external.hp.com/src/openssl/ +// "MPE/iX-gcc", "gcc:-D_ENDIAN -DBN_DIV2W -O3 -D_POSIX_SOURCE -D_SOCKET_SOURCE -I/SYSLOG/PUB::(unknown):MPE:-L/SYSLOG/PUB -lsyslog -lsocket -lcurses:BN_LLONG DES_PTR DES_UNROLL DES_RISC1:::", + +// # DEC Alpha OSF/1/Tru64 targets. +// # +// # "What's in a name? That which we call a rose +// # By any other word would smell as sweet." +// # +// # - William Shakespeare, "Romeo & Juliet", Act II, scene II. +// # +// # For gcc, the following gave a %50 speedup on a 164 over the 'DES_INT' version +// # +// "osf1-alpha-gcc", "gcc:-O3::(unknown):::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_UNROLL DES_RISC1:${no_asm}:dlfcn:alpha-osf1-shared:::.so", +// "osf1-alpha-cc", "cc:-std1 -tune host -O4 -readonly_strings::(unknown):::SIXTY_FOUR_BIT_LONG RC4_CHUNK:${no_asm}:dlfcn:alpha-osf1-shared:::.so", +// "tru64-alpha-cc", "cc:-std1 -tune host -fast -readonly_strings::-pthread:::SIXTY_FOUR_BIT_LONG RC4_CHUNK:${no_asm}:dlfcn:alpha-osf1-shared::-msym:.so", + +// #### +// #### Variety of LINUX:-) +// #### +// # *-generic* is endian-neutral target, but ./config is free to +// # throw in -D[BL]_ENDIAN, whichever appropriate... +// "linux-generic32","gcc:-DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +// "linux-ppc", "gcc:-DB_ENDIAN -DTERMIO -O3 -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_RISC1 DES_UNROLL::linux_ppc32.o::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +// #### IA-32 targets... +// "linux-ia32-icc", "icc:-DL_ENDIAN -DTERMIO -O2 -no_cpprt::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-KPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +// "linux-elf", "gcc:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +// "linux-aout", "gcc:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -march=i486 -Wall::(unknown):::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_out_asm}", +// #### +// "linux-generic64","gcc:-DTERMIO -O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +// "linux-ppc64", "gcc:-m64 -DB_ENDIAN -DTERMIO -O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_RISC1 DES_UNROLL::linux_ppc64.o::::::::::dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +// "linux-ia64", "gcc:-DL_ENDIAN -DTERMIO -O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK:${ia64_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +// "linux-ia64-ecc","ecc:-DL_ENDIAN -DTERMIO -O2 -Wall -no_cpprt::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK:${ia64_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +// "linux-ia64-icc","icc:-DL_ENDIAN -DTERMIO -O2 -Wall -no_cpprt::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK:${ia64_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +// "linux-x86_64", "gcc:-m64 -DL_ENDIAN -DTERMIO -O3 -Wall -DMD32_REG_T=int::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK BF_PTR2 DES_INT DES_UNROLL:${x86_64_asm}:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +// #### SPARC Linux setups +// # Ray Miller has patiently +// # assisted with debugging of following two configs. +// "linux-sparcv8","gcc:-mv8 -DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall -DBN_DIV2W::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::sparcv8.o:des_enc-sparc.o fcrypt_b.o:::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +// # it's a real mess with -mcpu=ultrasparc option under Linux, but +// # -Wa,-Av8plus should do the trick no matter what. +// "linux-sparcv9","gcc:-m32 -mcpu=ultrasparc -DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall -Wa,-Av8plus -DBN_DIV2W::-D_REENTRANT:ULTRASPARC:-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::sparcv8plus.o:des_enc-sparc.o fcrypt_b.o:::::::::dlfcn:linux-shared:-fPIC:-m32:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +// # GCC 3.1 is a requirement +// "linux64-sparcv9","gcc:-m64 -mcpu=ultrasparc -DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT:ULTRASPARC:-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::::::::::::dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +// #### Alpha Linux with GNU C and Compaq C setups +// # Special notes: +// # - linux-alpha+bwx-gcc is ment to be used from ./config only. If you +// # ought to run './Configure linux-alpha+bwx-gcc' manually, do +// # complement the command line with -mcpu=ev56, -mcpu=ev6 or whatever +// # which is appropriate. +// # - If you use ccc keep in mind that -fast implies -arch host and the +// # compiler is free to issue instructions which gonna make elder CPU +// # choke. If you wish to build "blended" toolkit, add -arch generic +// # *after* -fast and invoke './Configure linux-alpha-ccc' manually. +// # +// # +// # +// "linux-alpha-gcc","gcc:-O3 -DL_ENDIAN -DTERMIO::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_RISC1 DES_UNROLL:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +// "linux-alpha+bwx-gcc","gcc:-O3 -DL_ENDIAN -DTERMIO::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_RISC1 DES_UNROLL:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +// "linux-alpha-ccc","ccc:-fast -readonly_strings -DL_ENDIAN -DTERMIO::-D_REENTRANT:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL:${no_asm}", +// "linux-alpha+bwx-ccc","ccc:-fast -readonly_strings -DL_ENDIAN -DTERMIO::-D_REENTRANT:::SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL:${no_asm}", + +// #### *BSD [do see comment about ${BSDthreads} above!] +// "BSD-generic32","gcc:-DTERMIOS -O3 -fomit-frame-pointer -Wall::${BSDthreads}:::BN_LLONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL:${no_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +// "BSD-x86", "gcc:-DL_ENDIAN -DTERMIOS -O3 -fomit-frame-pointer -Wall::${BSDthreads}:::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_out_asm}:dlfcn:bsd-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +// "BSD-x86-elf", "gcc:-DL_ENDIAN -DTERMIOS -O3 -fomit-frame-pointer -Wall::${BSDthreads}:::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:bsd-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +// "debug-BSD-x86-elf", "gcc:-DL_ENDIAN -DTERMIOS -O3 -Wall -g::${BSDthreads}:::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:bsd-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +// "BSD-sparcv8", "gcc:-DB_ENDIAN -DTERMIOS -O3 -mv8 -Wall::${BSDthreads}:::BN_LLONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL::sparcv8.o:des_enc-sparc.o fcrypt_b.o:::::::::dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", + +// "BSD-generic64","gcc:-DTERMIOS -O3 -Wall::${BSDthreads}:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${no_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +// # -DMD32_REG_T=int doesn't actually belong in sparc64 target, it +// # simply *happens* to work around a compiler bug in gcc 3.3.3, +// # triggered by RIPEMD160 code. +// "BSD-sparc64", "gcc:-DB_ENDIAN -DTERMIOS -O3 -DMD32_REG_T=int -Wall::${BSDthreads}:::SIXTY_FOUR_BIT_LONG RC2_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC2 BF_PTR:::des_enc-sparc.o fcrypt_b.o:::::::::dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +// "BSD-ia64", "gcc:-DL_ENDIAN -DTERMIOS -O3 -Wall::${BSDthreads}:::SIXTY_FOUR_BIT_LONG RC4_CHUNK:${ia64_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +// "BSD-x86_64", "gcc:-DL_ENDIAN -DTERMIOS -O3 -DMD32_REG_T=int -Wall::${BSDthreads}:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", + +// "bsdi-elf-gcc", "gcc:-DPERL5 -DL_ENDIAN -fomit-frame-pointer -O3 -march=i486 -Wall::(unknown)::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", + +// "nextstep", "cc:-O -Wall::(unknown):::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:::", +// "nextstep3.3", "cc:-O3 -Wall::(unknown):::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:::", + +// # NCR MP-RAS UNIX ver 02.03.01 +// "ncr-scde","cc:-O6 -Xa -Hoff=BEHAVED -686 -Hwide -Hiw::(unknown)::-lsocket -lnsl -lc89:${x86_gcc_des} ${x86_gcc_opts}:::", + +// # QNX +// "qnx4", "cc:-DL_ENDIAN -DTERMIO::(unknown):::${x86_gcc_des} ${x86_gcc_opts}:", +// "qnx6", "cc:-DL_ENDIAN -DTERMIOS::(unknown)::-lsocket:${x86_gcc_des} ${x86_gcc_opts}:", + +// #### SCO/Caldera targets. +// # +// # Originally we had like unixware-*, unixware-*-pentium, unixware-*-p6, etc. +// # Now we only have blended unixware-* as it's the only one used by ./config. +// # If you want to optimize for particular microarchitecture, bypass ./config +// # and './Configure unixware-7 -Kpentium_pro' or whatever appropriate. +// # Note that not all targets include assembler support. Mostly because of +// # lack of motivation to support out-of-date platforms with out-of-date +// # compiler drivers and assemblers. Tim Rice has +// # patiently assisted to debug most of it. +// # +// # UnixWare 2.0x fails destest with -O. +// "unixware-2.0","cc:-DFILIO_H -DNO_STRINGS_H::-Kthread::-lsocket -lnsl -lresolv -lx:${x86_gcc_des} ${x86_gcc_opts}:::", +// "unixware-2.1","cc:-O -DFILIO_H::-Kthread::-lsocket -lnsl -lresolv -lx:${x86_gcc_des} ${x86_gcc_opts}:::", +// "unixware-7","cc:-O -DFILIO_H -Kalloca::-Kthread::-lsocket -lnsl:BN_LLONG MD2_CHAR RC4_INDEX ${x86_gcc_des}:${x86_elf_asm}:dlfcn:svr5-shared:-Kpic::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +// "unixware-7-gcc","gcc:-DL_ENDIAN -DFILIO_H -O3 -fomit-frame-pointer -march=pentium -Wall::-D_REENTRANT::-lsocket -lnsl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:gnu-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +// # SCO 5 - Ben Laurie says the -O breaks the SCO cc. +// "sco5-cc", "cc:-belf::(unknown)::-lsocket -lnsl:${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:svr3-shared:-Kpic::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +// "sco5-gcc", "gcc:-O3 -fomit-frame-pointer::(unknown)::-lsocket -lnsl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:svr3-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", + +// #### IBM's AIX. +// "aix3-cc", "cc:-O -DB_ENDIAN -qmaxmem=16384::(unknown):AIX::BN_LLONG RC4_CHAR:::", +// "aix-gcc", "gcc:-O -DB_ENDIAN::-pthread:AIX::BN_LLONG RC4_CHAR::aix_ppc32.o::::::::::dlfcn:aix-shared::-shared -Wl,-G:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)::-X 32", +// "aix64-gcc","gcc:-maix64 -O -DB_ENDIAN::-pthread:AIX::SIXTY_FOUR_BIT_LONG RC4_CHAR::aix_ppc64.o::::::::::dlfcn:aix-shared::-maix64 -shared -Wl,-G:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)::-X64", +// # Below targets assume AIX 5. Idea is to effectively disregard $OBJECT_MODE +// # at build time. $OBJECT_MODE is respected at ./config stage! +// "aix-cc", "cc:-q32 -O -DB_ENDIAN -qmaxmem=16384 -qro -qroconst::-qthreaded:AIX::BN_LLONG RC4_CHAR::aix_ppc32.o::::::::::dlfcn:aix-shared::-q32 -G:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)::-X 32", +// "aix64-cc", "cc:-q64 -O -DB_ENDIAN -qmaxmem=16384 -qro -qroconst::-qthreaded:AIX::SIXTY_FOUR_BIT_LONG RC4_CHAR::aix_ppc64.o::::::::::dlfcn:aix-shared::-q64 -G:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)::-X 64", + +// # +// # Cray T90 and similar (SDSC) +// # It's Big-endian, but the algorithms work properly when B_ENDIAN is NOT +// # defined. The T90 ints and longs are 8 bytes long, and apparently the +// # B_ENDIAN code assumes 4 byte ints. Fortunately, the non-B_ENDIAN and +// # non L_ENDIAN code aligns the bytes in each word correctly. +// # +// # The BIT_FIELD_LIMITS define is to avoid two fatal compiler errors: +// #'Taking the address of a bit field is not allowed. ' +// #'An expression with bit field exists as the operand of "sizeof" ' +// # (written by Wayne Schroeder ) +// # +// # j90 is considered the base machine type for unicos machines, +// # so this configuration is now called "cray-j90" ... +// "cray-j90", "cc: -DBIT_FIELD_LIMITS -DTERMIOS::(unknown):CRAY::SIXTY_FOUR_BIT_LONG DES_INT:::", + +// # +// # Cray T3E (Research Center Juelich, beckman@acl.lanl.gov) +// # +// # The BIT_FIELD_LIMITS define was written for the C90 (it seems). I added +// # another use. Basically, the problem is that the T3E uses some bit fields +// # for some st_addr stuff, and then sizeof and address-of fails +// # I could not use the ams/alpha.o option because the Cray assembler, 'cam' +// # did not like it. +// "cray-t3e", "cc: -DBIT_FIELD_LIMITS -DTERMIOS::(unknown):CRAY::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT:::", + +// # DGUX, 88100. +// "dgux-R3-gcc", "gcc:-O3 -fomit-frame-pointer::(unknown):::RC4_INDEX DES_UNROLL:::", +// "dgux-R4-gcc", "gcc:-O3 -fomit-frame-pointer::(unknown)::-lnsl -lsocket:RC4_INDEX DES_UNROLL:::", +// "dgux-R4-x86-gcc", "gcc:-O3 -fomit-frame-pointer -DL_ENDIAN::(unknown)::-lnsl -lsocket:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}", + +// # Sinix/ReliantUNIX RM400 +// # NOTE: The CDS++ Compiler up to V2.0Bsomething has the IRIX_CC_BUG optimizer problem. Better use -g */ +// "ReliantUNIX","cc:-KPIC -g -DTERMIOS -DB_ENDIAN::-Kthread:SNI:-lsocket -lnsl -lc -L/usr/ucblib -lucb:BN_LLONG DES_PTR DES_RISC2 DES_UNROLL BF_PTR:${no_asm}:dlfcn:reliantunix-shared:::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +// "SINIX","cc:-O::(unknown):SNI:-lsocket -lnsl -lc -L/usr/ucblib -lucb:RC4_INDEX RC4_CHAR:::", +// "SINIX-N","/usr/ucb/cc:-O2 -misaligned::(unknown)::-lucb:RC4_INDEX RC4_CHAR:::", + +// # SIEMENS BS2000/OSD: an EBCDIC-based mainframe +// "BS2000-OSD","c89:-O -XLLML -XLLMK -XL -DB_ENDIAN -DTERMIOS -DCHARSET_EBCDIC::(unknown)::-lsocket -lnsl:THIRTY_TWO_BIT DES_PTR DES_UNROLL MD2_CHAR RC4_INDEX RC4_CHAR BF_PTR:::", + +// # OS/390 Unix an EBCDIC-based Unix system on IBM mainframe +// # You need to compile using the c89.sh wrapper in the tools directory, because the +// # IBM compiler does not like the -L switch after any object modules. +// # +// "OS390-Unix","c89.sh:-O -DB_ENDIAN -DCHARSET_EBCDIC -DNO_SYS_PARAM_H -D_ALL_SOURCE::(unknown):::THIRTY_TWO_BIT DES_PTR DES_UNROLL MD2_CHAR RC4_INDEX RC4_CHAR BF_PTR:::", + +// # Win64 targets, WIN64I denotes IA-64 and WIN64A - AMD64 +// "VC-WIN64I","cl::::WIN64I::SIXTY_FOUR_BIT RC4_CHUNK_LL DES_INT EXPORT_VAR_AS_FN:${no_asm}:win32", +// "VC-WIN64A","cl::::WIN64A::SIXTY_FOUR_BIT RC4_CHUNK_LL DES_INT EXPORT_VAR_AS_FN:${no_asm}:win32", + +// # Visual C targets +// "VC-NT","cl::::WINNT::BN_LLONG RC4_INDEX EXPORT_VAR_AS_FN ${x86_gcc_opts}:${no_asm}:win32", +// "VC-CE","cl::::WINCE::BN_LLONG RC4_INDEX EXPORT_VAR_AS_FN ${x86_gcc_opts}:${no_asm}:win32", +// "VC-WIN32","cl::::WIN32::BN_LLONG RC4_INDEX EXPORT_VAR_AS_FN ${x86_gcc_opts}:${no_asm}:win32", + +// # Borland C++ 4.5 +// "BC-32","bcc32::::WIN32::BN_LLONG DES_PTR RC4_INDEX EXPORT_VAR_AS_FN:${no_asm}:win32", + +// # MinGW +// "mingw", "gcc:-mno-cygwin -DL_ENDIAN -fomit-frame-pointer -O3 -march=i486 -Wall -D_WIN32_WINNT=0x333:::MINGW32:-lwsock32 -lgdi32:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts} EXPORT_VAR_AS_FN:${x86_coff_asm}:win32:cygwin-shared:-D_WINDLL -DOPENSSL_USE_APPLINK:-mno-cygwin -shared:.dll.a", + +// # UWIN +// "UWIN", "cc:-DTERMIOS -DL_ENDIAN -O -Wall:::UWIN::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${no_asm}:win32", + +// # Cygwin +// "Cygwin-pre1.3", "gcc:-DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O3 -m486 -Wall::(unknown):CYGWIN32::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${no_asm}:win32", +// "Cygwin", "gcc:-DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O3 -march=i486 -Wall:::CYGWIN32::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_coff_asm}:dlfcn:cygwin-shared:-D_WINDLL:-shared:.dll.a", +// "debug-Cygwin", "gcc:-DTERMIOS -DL_ENDIAN -march=i486 -Wall -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DOPENSSL_NO_ASM -g -Wformat -Wshadow -Wmissing-prototypes -Wmissing-declarations -Werror:::CYGWIN32:::${no_asm}:dlfcn:cygwin-shared:-D_WINDLL:-shared:.dll.a", + +// # NetWare from David Ward (dsward@novell.com) +// # requires either MetroWerks NLM development tools, or gcc / nlmconv +// # NetWare defaults socket bio to WinSock sockets. However, +// # the builds can be configured to use BSD sockets instead. +// # netware-clib => legacy CLib c-runtime support +// "netware-clib", "mwccnlm::::::${x86_gcc_opts}::", +// "netware-clib-bsdsock", "mwccnlm::::::${x86_gcc_opts}::", +// "netware-clib-gcc", "i586-netware-gcc:-nostdinc -I/ndk/nwsdk/include/nlm -I/ndk/ws295sdk/include -DL_ENDIAN -DNETWARE_CLIB -DOPENSSL_SYSNAME_NETWARE -O2 -Wall:::::${x86_gcc_opts}::", +// "netware-clib-bsdsock-gcc", "i586-netware-gcc:-nostdinc -I/ndk/nwsdk/include/nlm -DNETWARE_BSDSOCK -DNETDB_USE_INTERNET -DL_ENDIAN -DNETWARE_CLIB -DOPENSSL_SYSNAME_NETWARE -O2 -Wall:::::${x86_gcc_opts}::", +// # netware-libc => LibC/NKS support +// "netware-libc", "mwccnlm::::::BN_LLONG ${x86_gcc_opts}::", +// "netware-libc-bsdsock", "mwccnlm::::::BN_LLONG ${x86_gcc_opts}::", +// "netware-libc-gcc", "i586-netware-gcc:-nostdinc -I/ndk/libc/include -I/ndk/libc/include/winsock -DL_ENDIAN -DNETWARE_LIBC -DOPENSSL_SYSNAME_NETWARE -DTERMIO -O2 -Wall:::::BN_LLONG ${x86_gcc_opts}::", +// "netware-libc-bsdsock-gcc", "i586-netware-gcc:-nostdinc -I/ndk/libc/include -DNETWARE_BSDSOCK -DL_ENDIAN -DNETWARE_LIBC -DOPENSSL_SYSNAME_NETWARE -DTERMIO -O2 -Wall:::::BN_LLONG ${x86_gcc_opts}::", + +// # DJGPP +// "DJGPP", "gcc:-I/dev/env/WATT_ROOT/inc -DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O2 -Wall:::MSDOS:-L/dev/env/WATT_ROOT/lib -lwatt:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_out_asm}:", + +// # Ultrix from Bernhard Simon +// "ultrix-cc","cc:-std1 -O -Olimit 2500 -DL_ENDIAN::(unknown):::::::", +// "ultrix-gcc","gcc:-O3 -DL_ENDIAN::(unknown):::BN_LLONG::::", +// # K&R C is no longer supported; you need gcc on old Ultrix installations +// ##"ultrix","cc:-O2 -DNOPROTO -DNOCONST -DL_ENDIAN::(unknown):::::::", + +// ##### MacOS X (a.k.a. Rhapsody or Darwin) setup +// "rhapsody-ppc-cc","cc:-O3 -DB_ENDIAN::(unknown):MACOSX_RHAPSODY::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${no_asm}::", +// "darwin-ppc-cc","cc:-arch ppc -O3 -DB_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::osx_ppc32.o::::::::::dlfcn:darwin-shared:-fPIC -fno-common:-arch ppc -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib", +// "darwin64-ppc-cc","cc:-arch ppc64 -O3 -DB_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::osx_ppc64.o::::::::::dlfcn:darwin-shared:-fPIC -fno-common:-arch ppc64 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib", +// "darwin-i386-cc","cc:-arch i386 -O3 -fomit-frame-pointer -DL_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${no_asm}:dlfcn:darwin-shared:-fPIC -fno-common:-arch i386 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib", +// "debug-darwin-i386-cc","cc:-arch i386 -g3 -DL_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${no_asm}:dlfcn:darwin-shared:-fPIC -fno-common:-arch i386 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib", +// "darwin64-x86_64-cc","cc:-arch x86_64 -O3 -fomit-frame-pointer -DL_ENDIAN -DMD32_REG_T=int -Wall::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK BF_PTR2 DES_INT DES_UNROLL:${no_asm}:dlfcn:darwin-shared:-fPIC -fno-common:-arch x86_64 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib", +// "debug-darwin-ppc-cc","cc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DB_ENDIAN -g -Wall -O::-D_REENTRANT:MACOSX::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::osx_ppc32.o::::::::::dlfcn:darwin-shared:-fPIC -fno-common:-dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib", + +// ##### A/UX +// "aux3-gcc","gcc:-O2 -DTERMIO::(unknown):AUX:-lbsd:RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:::", + +// ##### Sony NEWS-OS 4.x +// "newsos4-gcc","gcc:-O -DB_ENDIAN::(unknown):NEWS4:-lmld -liberty:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_RISC1 DES_UNROLL BF_PTR::::", + +// ##### GNU Hurd +// "hurd-x86", "gcc:-DL_ENDIAN -DTERMIOS -O3 -fomit-frame-pointer -march=i486 -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC", + +// ##### OS/2 EMX +// "OS2-EMX", "gcc::::::::", + +// ##### VxWorks for various targets +// "vxworks-ppc405","ccppc:-g -msoft-float -mlongcall -DCPU=PPC405 -I\$(WIND_BASE)/target/h:::VXWORKS:-r:::::", +// "vxworks-ppc750","ccppc:-ansi -nostdinc -DPPC750 -D_REENTRANT -fvolatile -fno-builtin -fno-for-scope -fsigned-char -Wall -msoft-float -mlongcall -DCPU=PPC604 -I\$(WIND_BASE)/target/h \$(DEBUG_FLAG):::VXWORKS:-r:::::", +// "vxworks-ppc750-debug","ccppc:-ansi -nostdinc -DPPC750 -D_REENTRANT -fvolatile -fno-builtin -fno-for-scope -fsigned-char -Wall -msoft-float -mlongcall -DCPU=PPC604 -I\$(WIND_BASE)/target/h -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DPEDANTIC -DDEBUG_SAFESTACK -DDEBUG -g:::VXWORKS:-r:::::", +// "vxworks-ppc860","ccppc:-nostdinc -msoft-float -DCPU=PPC860 -DNO_STRINGS_H -I\$(WIND_BASE)/target/h:::VXWORKS:-r:::::", +// "vxworks-mipsle","ccmips:-B\$(WIND_BASE)/host/\$(WIND_HOST_TYPE)/lib/gcc-lib/ -DL_ENDIAN -EL -Wl,-EL -mips2 -mno-branch-likely -G 0 -fno-builtin -msoft-float -DCPU=MIPS32 -DMIPSEL -DNO_STRINGS_H -I\$(WIND_BASE)/target/h:::VXWORKS:-r::${no_asm}::::::ranlibmips:", + +// ##### Compaq Non-Stop Kernel (Tandem) +// "tandem-c89","c89:-Ww -D__TANDEM -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1 -D_TANDEM_SOURCE -DB_ENDIAN::(unknown):::THIRTY_TWO_BIT:::", + +{enable if you want FIPS support and are using an openssl library with FIPS support compiled in.} +{$DEFINE OPENSSL_FIPS} +//use this only for Safe Stack define and some define changes in OpenSSL 1.0 +//defines. + +{$UNDEF OPENSSL_1_0} + +{$IFDEF WIN32} + {$DEFINE OPENSSL_SYSNAME_WIN32} + {$DEFINE OPENSSL_SYS_WIN32} + {$DEFINE L_ENDIAN} + {$DEFINE DSO_WIN32} + + {$DEFINE BN_LLONG} + {$DEFINE RC4_INDEX} + {$DEFINE EXPORT_VAR_AS_FN} + {$DEFINE RC4_INDEX} + {$DEFINE MD2_INT} + + {$DEFINE _CRT_SECURE_NO_DEPRECATE} + {$DEFINE _CRT_NONSTDC_NO_DEPRECATE} + {$DEFINE BN_ASM} + {$DEFINE MD5_ASM} + {$DEFINE SHA1_ASM} + {$DEFINE RMD160_ASM} + {$DEFINE OPENSSL_NO_CMS} + {$DEFINE OPENSSL_NO_GMP} + {$DEFINE OPENSSL_NO_CAMELLIA} + {$DEFINE OPENSSL_NO_RC5} + {$DEFINE OPENSSL_NO_MD2} + {$DEFINE OPENSSL_NO_MDC2} + {$DEFINE OPENSSL_NO_KRB5} + {$DEFINE OPENSSL_NO_MDC} + {$DEFINE OPENSSL_NO_DYNAMIC_ENGINE} + {$DEFINE OPENSSL_NO_RFC3779} + {$DEFINE OPENSSL_NO_SEED} + + {$DEFINE OPENSSL_NO_CAPIENG} + {$DEFINE OPENSSL_NO_JPAKE} + {$DEFINE OPENSSL_1_0} +{$ENDIF} + +{$IFDEF WINCE} + {$DEFINE BN_LLONG} + {$DEFINE RC4_INDEX} + {$DEFINE EXPORT_VAR_AS_FN} + {$DEFINE RC4_INDEX} + {$DEFINE MD2_INT} + {$DEFINE OPENSSL_NO_CMS} + {$DEFINE OPENSSL_NO_CAMELLIA} + {$DEFINE OPENSSL_NO_RC5} + {$DEFINE OPENSSL_NO_MD2} + {$DEFINE OPENSSL_NO_MDC2} + {$DEFINE OPENSSL_NO_KRB5} + {$DEFINE OPENSSL_NO_DYNAMIC_ENGINE} + + {$DEFINE EXPORT_VAR_AS_FN} + {$DEFINE OPENSSL_NO_RFC3779} + {$DEFINE OPENSSL_NO_SEED} + {$DEFINE OPENSSL_NO_CAPIENG} + {$DEFINE OPENSSL_NO_JPAKE} +{$ENDIF} + +{$IFDEF WIN64} + //"VC-WIN64A","cl::::WIN64A::-SIXTY_FOUR_BIT RC4_CHUNK_LL DES_INT EXPORT_VAR_AS_FN:${no_asm}:win32", + {$DEFINE SIXTY_FOUR_BIT} + {$DEFINE RC4_CHUNK_LL} + {$DEFINE DES_INT} + {$DEFINE EXPORT_VAR_AS_FN} + + {$DEFINE L_ENDIAN} + + {$DEFINE DSO_WIN32} + {$DEFINE OPENSSL_SYSNAME_WIN32} + {$DEFINE OPENSSL_SYSNAME_WINNT} + {$DEFINE UNICODE} + {$DEFINE _UNICODE} + {$DEFINE _CRT_SECURE_NO_DEPRECATE} + {$DEFINE _CRT_NONSTDC_NO_DEPRECATE} + {$DEFINE OPENSSL_NO_CAMELLIA} + {$DEFINE OPENSSL_NO_RC5} + {$DEFINE OPENSSL_NO_MD2} + {$DEFINE OPENSSL_NO_MDC2} + {$DEFINE OPENSSL_NO_KRB5} + {$DEFINE OPENSSL_NO_DYNAMIC_ENGINE} + + {$DEFINE EXPORT_VAR_AS_FN} + {$DEFINE OPENSSL_NO_GMP} + {$DEFINE OPENSSL_NO_RFC3779} + {$DEFINE OPENSSL_NO_SEED} + {$DEFINE OPENSSL_NO_CAPIENG} + {$DEFINE OPENSSL_NO_JPAKE} + {$DEFINE OPENSSL_1_0} +{$ENDIF} + +{$IFDEF UNIX} +//attempt to get this right from FreeBSD CVS +//Makefile compile options. The file is located +//at http://www.freebsd.org/cgi/cvsweb.cgi/src/crypto/openssl/ . + {$DEFINE OPENSSL_NO_CAMELLIA} + {$DEFINE OPENSSL_NO_GMP} + {$DEFINE OPENSSL_NO_MD2} + {$DEFINE OPENSSL_NO_MDC2} + {$DEFINE OPENSSL_NO_RC5} + {$DEFINE OPENSSL_NO_SEED} + {$DEFINE OPENSSL_NO_RFC3779} + + {$DEFINE OPENSSL_NO_CAPIENG} + {$DEFINE OPENSSL_NO_JPAKE} +{$ENDIF} + +//#if (defined(OPENSSL_NO_RSA) || defined(OPENSSL_NO_MD5)) && !defined(OPENSSL_NO_SSL2) +//#define OPENSSL_NO_SSL2 +//#endif +{$IFDEF OPENSSL_NO_RSA} + {$IFNDEF OPENSSL_NO_SSL2} + {$DEFINE OPENSSL_NO_SSL2} + {$ENDIF} +{$ENDIF} +{$IFDEF OPENSSL_NO_MD5} + {$IFNDEF OPENSSL_NO_SSL2} + {$DEFINE OPENSSL_NO_SSL2} + {$ENDIF} +{$ENDIF} + +{$IFDEF WIN64} + {$DEFINE SYS_WIN} +{$ENDIF} +{$IFDEF WIN32} + {$DEFINE SYS_WIN} +{$ENDIF} +{$IFDEF WINCE} + {$DEFINE SYS_WIN} +{$ENDIF} + +{$IFNDEF SIXTY_FOUR_BIT} + {$IFNDEF SIXTY_FOUR_BIT_LONG} +//I've over simplified this because we don't support 8 or 16bit architectures + {$DEFINE THIRTY_TWO_BIT} + {$ENDIF} +{$ENDIF} +{$IFDEF OPENSSL_1_0} + {$DEFINE DEBUG_SAFESTACK} + {$UNDEF OPENSSL_NO_SEED} + {$UNDEF OPENSSL_NO_MDC2} + {$UNDEF OPENSSL_NO_CMS} + {$UNDEF OPENSSL_NO_CAPIENG} +{$ENDIF} + +// the following emits are a workaround to a +// name conflict with Win32 API header files +(*$HPPEMIT '#include '*) +{$IFDEF SYS_WIN} +(*$HPPEMIT '#undef X509_NAME'*) +(*$HPPEMIT '#undef X509_EXTENSIONS'*) +(*$HPPEMIT '#undef X509_CERT_PAIR'*) +(*$HPPEMIT '#undef PKCS7_ISSUER_AND_SERIAL'*) +(*$HPPEMIT '#undef OCSP_RESPONSE'*) +(*$HPPEMIT '#undef OCSP_REQUEST'*) +(*$HPPEMIT '#undef PKCS7_SIGNER_INFO'*) +(*$HPPEMIT '#undef OCSP_REQUEST'*) +(*$HPPEMIT '#undef OCSP_RESPONSE'*) +{$ENDIF} + +// the following emits are a workaround to allow +// compiling in C++ without having to re-define +// OpenSSL data types and without having to +// include the OpenSSL header files +{$IFDEF HAS_DIRECTIVE_HPPEMIT_NAMESPACE} +{$HPPEMIT OPENNAMESPACE} +{$ELSE} +(*$HPPEMIT 'namespace Idsslopensslheaders'*) +(*$HPPEMIT '{'*) +{$ENDIF} +(*$HPPEMIT ' struct SSL;'*) +(*$HPPEMIT ' typedef SSL* PSSL;'*) +(*$HPPEMIT ' struct SSL_CTX;'*) +(*$HPPEMIT ' typedef SSL_CTX* PSSL_CTX;'*) +(*$HPPEMIT ' struct SSL_METHOD;'*) +(*$HPPEMIT ' typedef SSL_METHOD* PSSL_METHOD;'*) +(*$HPPEMIT ' struct X509;'*) +(*$HPPEMIT ' typedef X509* PX509;'*) +(*$HPPEMIT ' struct X509_NAME;'*) +(*$HPPEMIT ' typedef X509_NAME* PX509_NAME;'*) +{$IFDEF HAS_DIRECTIVE_HPPEMIT_NAMESPACE} +{$HPPEMIT CLOSENAMESPACE} +{$ELSE} +(*$HPPEMIT '}'*) +{$ENDIF} + +// RLebeau: why are the following types not being placed in +// the Idsslopensslheaders namespace with the types above? +(*$HPPEMIT 'struct RSA;'*) +(*$HPPEMIT 'typedef RSA* PRSA;'*) +(*$HPPEMIT 'struct DSA;'*) +(*$HPPEMIT 'typedef DSA* PDSA;'*) +(*$HPPEMIT 'struct DH;'*) +(*$HPPEMIT 'typedef DH* PDH;'*) +(*$HPPEMIT 'typedef void* PEC_KEY;'*) + +uses + IdException, + IdGlobal, + {$IFDEF WINDOWS} + Windows, + IdWinsock2, + {$ENDIF} + {$IFDEF USE_VCL_POSIX} + Posix.SysSocket, + Posix.SysTime, + Posix.SysTypes, + {$ENDIF} + {$IFDEF KYLIXCOMPAT} + libc, + {$ENDIF} + {$IFDEF USE_BASEUNIX} + baseunix, + sockets, + {$ENDIF} + SysUtils, + IdCTypes; + +//temp for compile tests +{.$DEFINE SSLEAY_MACROS} + +const + {$IFNDEF HAS_PAnsiChar} + cNull: TIdAnsiChar = 0; + {$ENDIF} + + {$EXTERNALSYM CONF_MFLAGS_IGNORE_ERRORS} + CONF_MFLAGS_IGNORE_ERRORS = $1; + {$EXTERNALSYM CONF_MFLAGS_IGNORE_RETURN_CODES} + CONF_MFLAGS_IGNORE_RETURN_CODES = $2; + {$EXTERNALSYM CONF_MFLAGS_SILENT} + CONF_MFLAGS_SILENT = $4; + {$EXTERNALSYM CONF_MFLAGS_NO_DSO} + CONF_MFLAGS_NO_DSO = $8; + {$EXTERNALSYM CONF_MFLAGS_IGNORE_MISSING_FILE} + CONF_MFLAGS_IGNORE_MISSING_FILE = $10; + {$EXTERNALSYM CONF_MFLAGS_DEFAULT_SECTION} + CONF_MFLAGS_DEFAULT_SECTION = $20; + {$EXTERNALSYM CONF_F_CONF_DUMP_FP} + CONF_F_CONF_DUMP_FP = 104; + {$EXTERNALSYM CONF_F_CONF_LOAD} + CONF_F_CONF_LOAD = 100; + {$EXTERNALSYM CONF_F_CONF_LOAD_BIO} + CONF_F_CONF_LOAD_BIO = 102; + {$EXTERNALSYM CONF_F_CONF_LOAD_FP} + CONF_F_CONF_LOAD_FP = 103; + {$EXTERNALSYM CONF_F_CONF_MODULES_LOAD} + CONF_F_CONF_MODULES_LOAD = 116; + {$EXTERNALSYM CONF_F_DEF_LOAD} + CONF_F_DEF_LOAD = 120; + {$EXTERNALSYM CONF_F_DEF_LOAD_BIO} + CONF_F_DEF_LOAD_BIO = 121; + {$EXTERNALSYM CONF_F_MODULE_INIT} + CONF_F_MODULE_INIT = 115; + {$EXTERNALSYM CONF_F_MODULE_LOAD_DSO} + CONF_F_MODULE_LOAD_DSO = 117; + {$EXTERNALSYM CONF_F_CONF_PARSE_LIST} + CONF_F_CONF_PARSE_LIST = 119; + {$EXTERNALSYM CONF_F_MODULE_RUN} + CONF_F_MODULE_RUN = 118; + {$EXTERNALSYM CONF_F_NCONF_DUMP_BIO} + CONF_F_NCONF_DUMP_BIO = 105; + {$EXTERNALSYM CONF_F_NCONF_DUMP_FP} + CONF_F_NCONF_DUMP_FP = 106; + {$EXTERNALSYM CONF_F_NCONF_GET_NUMBER} + CONF_F_NCONF_GET_NUMBER = 107; + {$EXTERNALSYM CONF_F_NCONF_GET_NUMBER_E} + CONF_F_NCONF_GET_NUMBER_E = 112; + {$EXTERNALSYM CONF_F_NCONF_GET_SECTION} + CONF_F_NCONF_GET_SECTION = 108; + {$EXTERNALSYM CONF_F_NCONF_GET_STRING} + CONF_F_NCONF_GET_STRING = 109; + {$EXTERNALSYM CONF_F_NCONF_LOAD} + CONF_F_NCONF_LOAD = 113; + {$EXTERNALSYM CONF_F_NCONF_LOAD_BIO} + CONF_F_NCONF_LOAD_BIO = 110; + {$EXTERNALSYM CONF_F_NCONF_LOAD_FP} + CONF_F_NCONF_LOAD_FP = 114; + {$EXTERNALSYM CONF_F_NCONF_NEW} + CONF_F_NCONF_NEW = 111; + {$EXTERNALSYM CONF_F_STR_COPY} + CONF_F_STR_COPY = 101; + +//* Reason codes. */ + {$EXTERNALSYM CONF_R_ERROR_LOADING_DSO} + CONF_R_ERROR_LOADING_DSO = 110; + {$EXTERNALSYM CONF_R_LIST_CANNOT_BE_NULL} + CONF_R_LIST_CANNOT_BE_NULL = 115; + {$EXTERNALSYM CONF_R_MISSING_CLOSE_SQUARE_BRACKET} + CONF_R_MISSING_CLOSE_SQUARE_BRACKET = 100; + {$EXTERNALSYM CONF_R_MISSING_EQUAL_SIGN} + CONF_R_MISSING_EQUAL_SIGN = 101; + {$EXTERNALSYM CONF_R_MISSING_FINISH_FUNCTION} + CONF_R_MISSING_FINISH_FUNCTION = 111; + {$EXTERNALSYM CONF_R_MISSING_INIT_FUNCTION} + CONF_R_MISSING_INIT_FUNCTION = 112; + {$EXTERNALSYM CONF_R_MODULE_INITIALIZATION_ERROR} + CONF_R_MODULE_INITIALIZATION_ERROR = 109; + {$EXTERNALSYM CONF_R_NO_CLOSE_BRACE} + CONF_R_NO_CLOSE_BRACE = 102; + {$EXTERNALSYM CONF_R_NO_CONF} + CONF_R_NO_CONF = 105; + {$EXTERNALSYM CONF_R_NO_CONF_OR_ENVIRONMENT_VARIABLE} + CONF_R_NO_CONF_OR_ENVIRONMENT_VARIABLE = 106; + {$EXTERNALSYM CONF_R_NO_SECTION} + CONF_R_NO_SECTION = 107; + {$EXTERNALSYM CONF_R_NO_SUCH_FILE} + CONF_R_NO_SUCH_FILE = 114; + {$EXTERNALSYM CONF_R_NO_VALUE} + CONF_R_NO_VALUE = 108; + {$EXTERNALSYM CONF_R_UNABLE_TO_CREATE_NEW_SECTION} + CONF_R_UNABLE_TO_CREATE_NEW_SECTION = 103; + {$EXTERNALSYM CONF_R_UNKNOWN_MODULE_NAME} + CONF_R_UNKNOWN_MODULE_NAME = 113; + {$EXTERNALSYM CONF_R_VARIABLE_HAS_NO_VALUE} + CONF_R_VARIABLE_HAS_NO_VALUE = 104; + + {$EXTERNALSYM ASN1_F_A2D_ASN1_OBJECT} + ASN1_F_A2D_ASN1_OBJECT = 100; + {$EXTERNALSYM ASN1_F_A2I_ASN1_ENUMERATED} + ASN1_F_A2I_ASN1_ENUMERATED = 236; + {$EXTERNALSYM ASN1_F_A2I_ASN1_INTEGER} + ASN1_F_A2I_ASN1_INTEGER = 101; + {$EXTERNALSYM ASN1_F_A2I_ASN1_STRING} + ASN1_F_A2I_ASN1_STRING = 102; + {$EXTERNALSYM ASN1_F_ASN1_COLLATE_PRIMITIVE} + ASN1_F_ASN1_COLLATE_PRIMITIVE = 103; + {$EXTERNALSYM ASN1_F_ASN1_D2I_BIO} + ASN1_F_ASN1_D2I_BIO = 104; + {$EXTERNALSYM ASN1_F_ASN1_D2I_FP} + ASN1_F_ASN1_D2I_FP = 105; + {$EXTERNALSYM ASN1_F_ASN1_DUP} + ASN1_F_ASN1_DUP = 106; + {$EXTERNALSYM ASN1_F_ASN1_ENUMERATED_SET} + ASN1_F_ASN1_ENUMERATED_SET = 232; + {$EXTERNALSYM ASN1_F_ASN1_ENUMERATED_TO_BN} + ASN1_F_ASN1_ENUMERATED_TO_BN = 233; + {$EXTERNALSYM ASN1_F_ASN1_GENERALIZEDTIME_NEW} + ASN1_F_ASN1_GENERALIZEDTIME_NEW = 222; + {$EXTERNALSYM ASN1_F_ASN1_GET_OBJECT} + ASN1_F_ASN1_GET_OBJECT = 107; + {$EXTERNALSYM ASN1_F_ASN1_HEADER_NEW} + ASN1_F_ASN1_HEADER_NEW = 108; + {$EXTERNALSYM ASN1_F_ASN1_I2D_BIO} + ASN1_F_ASN1_I2D_BIO = 109; + {$EXTERNALSYM ASN1_F_ASN1_I2D_FP} + ASN1_F_ASN1_I2D_FP = 110; + {$EXTERNALSYM ASN1_F_ASN1_INTEGER_SET} + ASN1_F_ASN1_INTEGER_SET = 111; + {$EXTERNALSYM ASN1_F_ASN1_INTEGER_TO_BN} + ASN1_F_ASN1_INTEGER_TO_BN = 112; + {$EXTERNALSYM ASN1_F_ASN1_OBJECT_NEW} + ASN1_F_ASN1_OBJECT_NEW = 113; + + {$EXTERNALSYM ASN1_F_ASN1_OUTPUT_DATA} + ASN1_F_ASN1_OUTPUT_DATA= 207; + + {$EXTERNALSYM ASN1_F_ASN1_PACK_STRING} + ASN1_F_ASN1_PACK_STRING = 245; + {$EXTERNALSYM ASN1_F_ASN1_PBE_SET} + ASN1_F_ASN1_PBE_SET = 253; + {$EXTERNALSYM ASN1_F_ASN1_SEQ_PACK} + ASN1_F_ASN1_SEQ_PACK = 246; + {$EXTERNALSYM ASN1_F_ASN1_SEQ_UNPACK} + ASN1_F_ASN1_SEQ_UNPACK = 247; + {$EXTERNALSYM ASN1_F_ASN1_SIGN} + ASN1_F_ASN1_SIGN = 114; + {$EXTERNALSYM ASN1_F_ASN1_STRING_NEW} + ASN1_F_ASN1_STRING_NEW = 115; + {$EXTERNALSYM ASN1_F_ASN1_STRING_TYPE_NEW} + ASN1_F_ASN1_STRING_TYPE_NEW = 116; + {$EXTERNALSYM ASN1_F_ASN1_TYPE_GET_INT_OCTETSTRING} + ASN1_F_ASN1_TYPE_GET_INT_OCTETSTRING = 117; + {$EXTERNALSYM ASN1_F_ASN1_TYPE_GET_OCTETSTRING} + ASN1_F_ASN1_TYPE_GET_OCTETSTRING = 118; + {$EXTERNALSYM ASN1_F_ASN1_TYPE_NEW} + ASN1_F_ASN1_TYPE_NEW = 119; + {$EXTERNALSYM ASN1_F_ASN1_UNPACK_STRING} + ASN1_F_ASN1_UNPACK_STRING = 248; + {$EXTERNALSYM ASN1_F_ASN1_UTCTIME_NEW} + ASN1_F_ASN1_UTCTIME_NEW = 120; + {$EXTERNALSYM ASN1_F_ASN1_VERIFY} + ASN1_F_ASN1_VERIFY = 121; + {$EXTERNALSYM ASN1_F_B64_READ_ASN1} + ASN1_F_B64_READ_ASN1 = 208; + {$EXTERNALSYM ASN1_F_B64_WRITE_ASN1} + ASN1_F_B64_WRITE_ASN1 = 209; + {$EXTERNALSYM ASN1_F_BIO_NEW_NDEF} + ASN1_F_BIO_NEW_NDEF = 212; + {$EXTERNALSYM ASN1_F_BITSTR_CB} + ASN1_F_BITSTR_CB = 180; + {$EXTERNALSYM ASN1_F_SMIME_READ_ASN1} + ASN1_F_SMIME_READ_ASN1 = 210; + {$EXTERNALSYM ASN1_F_SMIME_TEXT} + ASN1_F_SMIME_TEXT = 211; + + + {$EXTERNALSYM ASN1_F_AUTHORITY_KEYID_NEW} + ASN1_F_AUTHORITY_KEYID_NEW = 237; + {$EXTERNALSYM ASN1_F_BASIC_CONSTRAINTS_NEW} + ASN1_F_BASIC_CONSTRAINTS_NEW = 226; + {$EXTERNALSYM ASN1_F_BN_TO_ASN1_ENUMERATED} + ASN1_F_BN_TO_ASN1_ENUMERATED = 234; + {$EXTERNALSYM ASN1_F_BN_TO_ASN1_INTEGER} + ASN1_F_BN_TO_ASN1_INTEGER = 122; + {$EXTERNALSYM ASN1_F_D2I_ASN1_BIT_STRING} + ASN1_F_D2I_ASN1_BIT_STRING = 123; + {$EXTERNALSYM ASN1_F_D2I_ASN1_BMPSTRING} + ASN1_F_D2I_ASN1_BMPSTRING = 124; + {$EXTERNALSYM ASN1_F_D2I_ASN1_BOOLEAN} + ASN1_F_D2I_ASN1_BOOLEAN = 125; + {$EXTERNALSYM ASN1_F_D2I_ASN1_BYTES} + ASN1_F_D2I_ASN1_BYTES = 126; + {$EXTERNALSYM ASN1_F_D2I_ASN1_ENUMERATED} + ASN1_F_D2I_ASN1_ENUMERATED = 235; + {$EXTERNALSYM ASN1_F_D2I_ASN1_GENERALIZEDTIME} + ASN1_F_D2I_ASN1_GENERALIZEDTIME = 223; + {$EXTERNALSYM ASN1_F_D2I_ASN1_HEADER} + ASN1_F_D2I_ASN1_HEADER = 127; + {$EXTERNALSYM ASN1_F_D2I_ASN1_INTEGER} + ASN1_F_D2I_ASN1_INTEGER = 128; + {$EXTERNALSYM ASN1_F_D2I_ASN1_OBJECT} + ASN1_F_D2I_ASN1_OBJECT = 129; + {$EXTERNALSYM ASN1_F_D2I_ASN1_OCTET_STRING} + ASN1_F_D2I_ASN1_OCTET_STRING = 130; + {$EXTERNALSYM ASN1_F_D2I_ASN1_PRINT_TYPE} + ASN1_F_D2I_ASN1_PRINT_TYPE = 131; + {$EXTERNALSYM ASN1_F_D2I_ASN1_SET} + ASN1_F_D2I_ASN1_SET = 132; + {$EXTERNALSYM ASN1_F_D2I_ASN1_TIME} + ASN1_F_D2I_ASN1_TIME = 224; + {$EXTERNALSYM ASN1_F_D2I_ASN1_TYPE} + ASN1_F_D2I_ASN1_TYPE = 133; + {$EXTERNALSYM ASN1_F_D2I_ASN1_TYPE_BYTES} + ASN1_F_D2I_ASN1_TYPE_BYTES = 134; + {$EXTERNALSYM ASN1_F_D2I_ASN1_UINTEGER} + ASN1_F_D2I_ASN1_UINTEGER = 280; + {$EXTERNALSYM ASN1_F_D2I_ASN1_UTCTIME} + ASN1_F_D2I_ASN1_UTCTIME = 135; + {$EXTERNALSYM ASN1_F_D2I_ASN1_UTF8STRING} + ASN1_F_D2I_ASN1_UTF8STRING = 266; + {$EXTERNALSYM ASN1_F_D2I_ASN1_VISIBLESTRING} + ASN1_F_D2I_ASN1_VISIBLESTRING = 267; + {$EXTERNALSYM ASN1_F_D2I_AUTHORITY_KEYID} + ASN1_F_D2I_AUTHORITY_KEYID = 238; + {$EXTERNALSYM ASN1_F_D2I_BASIC_CONSTRAINTS} + ASN1_F_D2I_BASIC_CONSTRAINTS = 227; + {$EXTERNALSYM ASN1_F_D2I_DHPARAMS} + ASN1_F_D2I_DHPARAMS = 136; + {$EXTERNALSYM ASN1_F_D2I_DIST_POINT} + ASN1_F_D2I_DIST_POINT = 276; + {$EXTERNALSYM ASN1_F_D2I_DIST_POINT_NAME} + ASN1_F_D2I_DIST_POINT_NAME = 277; + {$EXTERNALSYM ASN1_F_D2I_DSAPARAMS} + ASN1_F_D2I_DSAPARAMS = 137; + {$EXTERNALSYM ASN1_F_D2I_DSAPRIVATEKEY} + ASN1_F_D2I_DSAPRIVATEKEY = 138; + {$EXTERNALSYM ASN1_F_D2I_DSAPUBLICKEY} + ASN1_F_D2I_DSAPUBLICKEY = 139; + {$EXTERNALSYM ASN1_F_D2I_GENERAL_NAME} + ASN1_F_D2I_GENERAL_NAME = 230; + {$EXTERNALSYM ASN1_F_D2I_NETSCAPE_CERT_SEQUENCE} + ASN1_F_D2I_NETSCAPE_CERT_SEQUENCE = 228; + {$EXTERNALSYM ASN1_F_D2I_NETSCAPE_PKEY} + ASN1_F_D2I_NETSCAPE_PKEY = 140; + {$EXTERNALSYM ASN1_F_D2I_NETSCAPE_RSA} + ASN1_F_D2I_NETSCAPE_RSA = 141; + {$EXTERNALSYM ASN1_F_D2I_NETSCAPE_RSA_2} + ASN1_F_D2I_NETSCAPE_RSA_2 = 142; + {$EXTERNALSYM ASN1_F_D2I_NETSCAPE_SPKAC} + ASN1_F_D2I_NETSCAPE_SPKAC = 143; + {$EXTERNALSYM ASN1_F_D2I_NETSCAPE_SPKI} + ASN1_F_D2I_NETSCAPE_SPKI = 144; + {$EXTERNALSYM ASN1_F_D2I_NOTICEREF} + ASN1_F_D2I_NOTICEREF = 268; + {$EXTERNALSYM ASN1_F_D2I_PBE2PARAM} + ASN1_F_D2I_PBE2PARAM = 262; + {$EXTERNALSYM ASN1_F_D2I_PBEPARAM} + ASN1_F_D2I_PBEPARAM = 249; + {$EXTERNALSYM ASN1_F_D2I_PBKDF2PARAM} + ASN1_F_D2I_PBKDF2PARAM = 263; + {$EXTERNALSYM ASN1_F_D2I_PKCS12} + ASN1_F_D2I_PKCS12 = 254; + {$EXTERNALSYM ASN1_F_D2I_PKCS12_BAGS} + ASN1_F_D2I_PKCS12_BAGS = 255; + {$EXTERNALSYM ASN1_F_D2I_PKCS12_MAC_DATA} + ASN1_F_D2I_PKCS12_MAC_DATA = 256; + {$EXTERNALSYM ASN1_F_D2I_PKCS12_SAFEBAG} + ASN1_F_D2I_PKCS12_SAFEBAG = 257; + {$EXTERNALSYM ASN1_F_D2I_PKCS7} + ASN1_F_D2I_PKCS7 = 145; + {$EXTERNALSYM ASN1_F_D2I_PKCS7_DIGEST} + ASN1_F_D2I_PKCS7_DIGEST = 146; + {$EXTERNALSYM ASN1_F_D2I_PKCS7_ENCRYPT} + ASN1_F_D2I_PKCS7_ENCRYPT = 147; + {$EXTERNALSYM ASN1_F_D2I_PKCS7_ENC_CONTENT} + ASN1_F_D2I_PKCS7_ENC_CONTENT = 148; + {$EXTERNALSYM ASN1_F_D2I_PKCS7_ENVELOPE} + ASN1_F_D2I_PKCS7_ENVELOPE = 149; + {$EXTERNALSYM ASN1_F_D2I_PKCS7_ISSUER_AND_SERIAL} + ASN1_F_D2I_PKCS7_ISSUER_AND_SERIAL = 150; + {$EXTERNALSYM ASN1_F_D2I_PKCS7_RECIP_INFO} + ASN1_F_D2I_PKCS7_RECIP_INFO = 151; + {$EXTERNALSYM ASN1_F_D2I_PKCS7_SIGNED} + ASN1_F_D2I_PKCS7_SIGNED = 152; + {$EXTERNALSYM ASN1_F_D2I_PKCS7_SIGNER_INFO} + ASN1_F_D2I_PKCS7_SIGNER_INFO = 153; + {$EXTERNALSYM ASN1_F_D2I_PKCS7_SIGN_ENVELOPE} + ASN1_F_D2I_PKCS7_SIGN_ENVELOPE = 154; + {$EXTERNALSYM ASN1_F_D2I_PKCS8_PRIV_KEY_INFO} + ASN1_F_D2I_PKCS8_PRIV_KEY_INFO = 250; + {$EXTERNALSYM ASN1_F_D2I_PKEY_USAGE_PERIOD} + ASN1_F_D2I_PKEY_USAGE_PERIOD = 239; + {$EXTERNALSYM ASN1_F_D2I_POLICYINFO} + ASN1_F_D2I_POLICYINFO = 269; + {$EXTERNALSYM ASN1_F_D2I_POLICYQUALINFO} + ASN1_F_D2I_POLICYQUALINFO = 270; + {$EXTERNALSYM ASN1_F_D2I_PRIVATEKEY} + ASN1_F_D2I_PRIVATEKEY = 155; + {$EXTERNALSYM ASN1_F_D2I_PUBLICKEY} + ASN1_F_D2I_PUBLICKEY = 156; + {$EXTERNALSYM ASN1_F_D2I_RSAPRIVATEKEY} + ASN1_F_D2I_RSAPRIVATEKEY = 157; + {$EXTERNALSYM ASN1_F_D2I_RSAPUBLICKEY} + ASN1_F_D2I_RSAPUBLICKEY = 158; + {$EXTERNALSYM ASN1_F_D2I_SXNET} + ASN1_F_D2I_SXNET = 241; + {$EXTERNALSYM ASN1_F_D2I_SXNETID} + ASN1_F_D2I_SXNETID = 243; + {$EXTERNALSYM ASN1_F_D2I_USERNOTICE} + ASN1_F_D2I_USERNOTICE = 271; + {$EXTERNALSYM ASN1_F_D2I_X509} + ASN1_F_D2I_X509 = 159; + {$EXTERNALSYM ASN1_F_D2I_X509_ALGOR} + ASN1_F_D2I_X509_ALGOR = 160; + {$EXTERNALSYM ASN1_F_D2I_X509_ATTRIBUTE} + ASN1_F_D2I_X509_ATTRIBUTE = 161; + {$EXTERNALSYM ASN1_F_D2I_X509_CINF} + ASN1_F_D2I_X509_CINF = 162; + {$EXTERNALSYM ASN1_F_D2I_X509_CRL} + ASN1_F_D2I_X509_CRL = 163; + {$EXTERNALSYM ASN1_F_D2I_X509_CRL_INFO} + ASN1_F_D2I_X509_CRL_INFO = 164; + {$EXTERNALSYM ASN1_F_D2I_X509_EXTENSION} + ASN1_F_D2I_X509_EXTENSION = 165; + {$EXTERNALSYM ASN1_F_D2I_X509_KEY} + ASN1_F_D2I_X509_KEY = 166; + {$EXTERNALSYM ASN1_F_D2I_X509_NAME} + ASN1_F_D2I_X509_NAME = 167; + {$EXTERNALSYM ASN1_F_D2I_X509_NAME_ENTRY} + ASN1_F_D2I_X509_NAME_ENTRY = 168; + {$EXTERNALSYM ASN1_F_D2I_X509_PKEY} + ASN1_F_D2I_X509_PKEY = 169; + {$EXTERNALSYM ASN1_F_D2I_X509_PUBKEY} + ASN1_F_D2I_X509_PUBKEY = 170; + {$EXTERNALSYM ASN1_F_D2I_X509_REQ} + ASN1_F_D2I_X509_REQ = 171; + {$EXTERNALSYM ASN1_F_D2I_X509_REQ_INFO} + ASN1_F_D2I_X509_REQ_INFO = 172; + {$EXTERNALSYM ASN1_F_D2I_X509_REVOKED} + ASN1_F_D2I_X509_REVOKED = 173; + {$EXTERNALSYM ASN1_F_D2I_X509_SIG} + ASN1_F_D2I_X509_SIG = 174; + {$EXTERNALSYM ASN1_F_D2I_X509_VAL} + ASN1_F_D2I_X509_VAL = 175; + {$EXTERNALSYM ASN1_F_DIST_POINT_NAME_NEW} + ASN1_F_DIST_POINT_NAME_NEW = 278; + {$EXTERNALSYM ASN1_F_DIST_POINT_NEW} + ASN1_F_DIST_POINT_NEW = 279; + {$EXTERNALSYM ASN1_F_GENERAL_NAME_NEW} + ASN1_F_GENERAL_NAME_NEW = 231; + {$EXTERNALSYM ASN1_F_I2D_ASN1_HEADER} + ASN1_F_I2D_ASN1_HEADER = 176; + {$EXTERNALSYM ASN1_F_I2D_ASN1_TIME} + ASN1_F_I2D_ASN1_TIME = 225; + {$EXTERNALSYM ASN1_F_I2D_DHPARAMS} + ASN1_F_I2D_DHPARAMS = 177; + {$EXTERNALSYM ASN1_F_I2D_DSAPARAMS} + ASN1_F_I2D_DSAPARAMS = 178; + {$EXTERNALSYM ASN1_F_I2D_DSAPRIVATEKEY} + ASN1_F_I2D_DSAPRIVATEKEY = 179; + {$EXTERNALSYM ASN1_F_I2D_DSAPUBLICKEY} + ASN1_F_I2D_DSAPUBLICKEY = 180; + {$EXTERNALSYM ASN1_F_I2D_NETSCAPE_RSA} + ASN1_F_I2D_NETSCAPE_RSA = 181; + {$EXTERNALSYM ASN1_F_I2D_PKCS7} + ASN1_F_I2D_PKCS7 = 182; + {$EXTERNALSYM ASN1_F_I2D_PRIVATEKEY} + ASN1_F_I2D_PRIVATEKEY = 183; + {$EXTERNALSYM ASN1_F_I2D_PUBLICKEY} + ASN1_F_I2D_PUBLICKEY = 184; + {$EXTERNALSYM ASN1_F_I2D_RSAPRIVATEKEY} + ASN1_F_I2D_RSAPRIVATEKEY = 185; + {$EXTERNALSYM ASN1_F_I2D_RSAPUBLICKEY} + ASN1_F_I2D_RSAPUBLICKEY = 186; + {$EXTERNALSYM ASN1_F_I2D_X509_ATTRIBUTE} + ASN1_F_I2D_X509_ATTRIBUTE = 187; + {$EXTERNALSYM ASN1_F_I2T_ASN1_OBJECT} + ASN1_F_I2T_ASN1_OBJECT = 188; + {$EXTERNALSYM ASN1_F_NETSCAPE_CERT_SEQUENCE_NEW} + ASN1_F_NETSCAPE_CERT_SEQUENCE_NEW = 229; + {$EXTERNALSYM ASN1_F_NETSCAPE_PKEY_NEW} + ASN1_F_NETSCAPE_PKEY_NEW = 189; + {$EXTERNALSYM ASN1_F_NETSCAPE_SPKAC_NEW} + ASN1_F_NETSCAPE_SPKAC_NEW = 190; + {$EXTERNALSYM ASN1_F_NETSCAPE_SPKI_NEW} + ASN1_F_NETSCAPE_SPKI_NEW = 191; + {$EXTERNALSYM ASN1_F_NOTICEREF_NEW} + ASN1_F_NOTICEREF_NEW = 272; + {$EXTERNALSYM ASN1_F_PBE2PARAM_NEW} + ASN1_F_PBE2PARAM_NEW = 264; + {$EXTERNALSYM ASN1_F_PBEPARAM_NEW} + ASN1_F_PBEPARAM_NEW = 251; + {$EXTERNALSYM ASN1_F_PBKDF2PARAM_NEW} + ASN1_F_PBKDF2PARAM_NEW = 265; + {$EXTERNALSYM ASN1_F_PKCS12_BAGS_NEW} + ASN1_F_PKCS12_BAGS_NEW = 258; + {$EXTERNALSYM ASN1_F_PKCS12_MAC_DATA_NEW} + ASN1_F_PKCS12_MAC_DATA_NEW = 259; + {$EXTERNALSYM ASN1_F_PKCS12_NEW} + ASN1_F_PKCS12_NEW = 260; + {$EXTERNALSYM ASN1_F_PKCS12_SAFEBAG_NEW} + ASN1_F_PKCS12_SAFEBAG_NEW = 261; + {$EXTERNALSYM ASN1_F_PKCS5_PBE2_SET} + ASN1_F_PKCS5_PBE2_SET = 281; + {$EXTERNALSYM ASN1_F_PKCS7_DIGEST_NEW} + ASN1_F_PKCS7_DIGEST_NEW = 192; + {$EXTERNALSYM ASN1_F_PKCS7_ENCRYPT_NEW} + ASN1_F_PKCS7_ENCRYPT_NEW = 193; + {$EXTERNALSYM ASN1_F_PKCS7_ENC_CONTENT_NEW} + ASN1_F_PKCS7_ENC_CONTENT_NEW = 194; + {$EXTERNALSYM ASN1_F_PKCS7_ENVELOPE_NEW} + ASN1_F_PKCS7_ENVELOPE_NEW = 195; + {$EXTERNALSYM ASN1_F_PKCS7_ISSUER_AND_SERIAL_NEW} + ASN1_F_PKCS7_ISSUER_AND_SERIAL_NEW = 196; + {$EXTERNALSYM ASN1_F_PKCS7_NEW} + ASN1_F_PKCS7_NEW = 197; + {$EXTERNALSYM ASN1_F_PKCS7_RECIP_INFO_NEW} + ASN1_F_PKCS7_RECIP_INFO_NEW = 198; + {$EXTERNALSYM ASN1_F_PKCS7_SIGNED_NEW} + ASN1_F_PKCS7_SIGNED_NEW = 199; + {$EXTERNALSYM ASN1_F_PKCS7_SIGNER_INFO_NEW} + ASN1_F_PKCS7_SIGNER_INFO_NEW = 200; + {$EXTERNALSYM ASN1_F_PKCS7_SIGN_ENVELOPE_NEW} + ASN1_F_PKCS7_SIGN_ENVELOPE_NEW = 201; + {$EXTERNALSYM ASN1_F_PKCS8_PRIV_KEY_INFO_NEW} + ASN1_F_PKCS8_PRIV_KEY_INFO_NEW = 252; + {$EXTERNALSYM ASN1_F_PKEY_USAGE_PERIOD_NEW} + ASN1_F_PKEY_USAGE_PERIOD_NEW = 240; + {$EXTERNALSYM ASN1_F_POLICYINFO_NEW} + ASN1_F_POLICYINFO_NEW = 273; + {$EXTERNALSYM ASN1_F_POLICYQUALINFO_NEW} + ASN1_F_POLICYQUALINFO_NEW = 274; + {$EXTERNALSYM ASN1_F_SXNETID_NEW} + ASN1_F_SXNETID_NEW = 244; + {$EXTERNALSYM ASN1_F_SXNET_NEW} + ASN1_F_SXNET_NEW = 242; + {$EXTERNALSYM ASN1_F_USERNOTICE_NEW} + ASN1_F_USERNOTICE_NEW = 275; + {$EXTERNALSYM ASN1_F_X509_ALGOR_NEW} + ASN1_F_X509_ALGOR_NEW = 202; + {$EXTERNALSYM ASN1_F_X509_ATTRIBUTE_NEW} + ASN1_F_X509_ATTRIBUTE_NEW = 203; + {$EXTERNALSYM ASN1_F_X509_CINF_NEW} + ASN1_F_X509_CINF_NEW = 204; + {$EXTERNALSYM ASN1_F_X509_CRL_INFO_NEW} + ASN1_F_X509_CRL_INFO_NEW = 205; + {$EXTERNALSYM ASN1_F_X509_CRL_NEW} + ASN1_F_X509_CRL_NEW = 206; + {$EXTERNALSYM ASN1_F_X509_DHPARAMS_NEW} + ASN1_F_X509_DHPARAMS_NEW = 207; + {$EXTERNALSYM ASN1_F_X509_EXTENSION_NEW} + ASN1_F_X509_EXTENSION_NEW = 208; + {$EXTERNALSYM ASN1_F_X509_INFO_NEW} + ASN1_F_X509_INFO_NEW = 209; + {$EXTERNALSYM ASN1_F_X509_KEY_NEW} + ASN1_F_X509_KEY_NEW = 210; + {$EXTERNALSYM ASN1_F_X509_NAME_ENTRY_NEW} + ASN1_F_X509_NAME_ENTRY_NEW = 211; + {$EXTERNALSYM ASN1_F_X509_NAME_NEW} + ASN1_F_X509_NAME_NEW = 212; + {$EXTERNALSYM ASN1_F_X509_NEW} + ASN1_F_X509_NEW = 213; + {$EXTERNALSYM ASN1_F_X509_PKEY_NEW} + ASN1_F_X509_PKEY_NEW = 214; + {$EXTERNALSYM ASN1_F_X509_PUBKEY_NEW} + ASN1_F_X509_PUBKEY_NEW = 215; + {$EXTERNALSYM ASN1_F_X509_REQ_INFO_NEW} + ASN1_F_X509_REQ_INFO_NEW = 216; + {$EXTERNALSYM ASN1_F_X509_REQ_NEW} + ASN1_F_X509_REQ_NEW = 217; + {$EXTERNALSYM ASN1_F_X509_REVOKED_NEW} + ASN1_F_X509_REVOKED_NEW = 218; + {$EXTERNALSYM ASN1_F_X509_SIG_NEW} + ASN1_F_X509_SIG_NEW = 219; + {$EXTERNALSYM ASN1_F_X509_VAL_FREE} + ASN1_F_X509_VAL_FREE = 220; + {$EXTERNALSYM ASN1_F_X509_VAL_NEW} + ASN1_F_X509_VAL_NEW = 221; + {$EXTERNALSYM ASN1_OBJECT_FLAG_CRITICAL} + ASN1_OBJECT_FLAG_CRITICAL = $02; + {$EXTERNALSYM ASN1_OBJECT_FLAG_DYNAMIC} + ASN1_OBJECT_FLAG_DYNAMIC = $01; + {$EXTERNALSYM ASN1_OBJECT_FLAG_DYNAMIC_DATA} + ASN1_OBJECT_FLAG_DYNAMIC_DATA = $08; + {$EXTERNALSYM ASN1_OBJECT_FLAG_DYNAMIC_STRINGS} + ASN1_OBJECT_FLAG_DYNAMIC_STRINGS = $04; + {$EXTERNALSYM ASN1_R_ADDING_OBJECT} + ASN1_R_ADDING_OBJECT = 171; + {$EXTERNALSYM ASN1_R_ASN1_PARSE_ERROR} + ASN1_R_ASN1_PARSE_ERROR= 198; + {$EXTERNALSYM ASN1_R_ASN1_SIG_PARSE_ERROR} + ASN1_R_ASN1_SIG_PARSE_ERROR = 199; + + {$EXTERNALSYM ASN1_R_AUX_ERROR} + ASN1_R_AUX_ERROR = 100; + {$EXTERNALSYM ASN1_R_BAD_CLASS} + ASN1_R_BAD_CLASS = 101; + {$EXTERNALSYM ASN1_R_BAD_OBJECT_HEADER} + ASN1_R_BAD_OBJECT_HEADER = 102; + {$EXTERNALSYM ASN1_R_BAD_PASSWORD_READ} + ASN1_R_BAD_PASSWORD_READ = 103; + {$EXTERNALSYM ASN1_R_BAD_TAG} + ASN1_R_BAD_TAG = 104; + {$EXTERNALSYM ASN1_R_BMPSTRING_IS_WRONG_LENGTH} + ASN1_R_BMPSTRING_IS_WRONG_LENGTH = 210; + {$EXTERNALSYM ASN1_R_BN_LIB} + ASN1_R_BN_LIB = 105; + {$EXTERNALSYM ASN1_R_BOOLEAN_IS_WRONG_LENGTH} + ASN1_R_BOOLEAN_IS_WRONG_LENGTH = 106; + {$EXTERNALSYM ASN1_R_BUFFER_TOO_SMALL} + ASN1_R_BUFFER_TOO_SMALL = 107; + {$EXTERNALSYM ASN1_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER} + ASN1_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER = 108; + {$EXTERNALSYM ASN1_R_DATA_IS_WRONG} + ASN1_R_DATA_IS_WRONG = 109; + {$EXTERNALSYM ASN1_R_DECODE_ERROR} + ASN1_R_DECODE_ERROR = 110; + {$EXTERNALSYM ASN1_R_DECODING_ERROR} + ASN1_R_DECODING_ERROR = 111; + {$EXTERNALSYM ASN1_R_DEPTH_EXCEEDED} + ASN1_R_DEPTH_EXCEEDED = 174; + {$EXTERNALSYM ASN1_R_ENCODE_ERROR} + ASN1_R_ENCODE_ERROR = 112; + {$EXTERNALSYM ASN1_R_ERROR_GETTING_TIME} + ASN1_R_ERROR_GETTING_TIME = 173; + {$EXTERNALSYM ASN1_R_ERROR_LOADING_SECTION} + ASN1_R_ERROR_LOADING_SECTION = 172; + {$EXTERNALSYM ASN1_R_ERROR_PARSING_SET_ELEMENT} + ASN1_R_ERROR_PARSING_SET_ELEMENT = 113; + {$EXTERNALSYM ASN1_R_ERROR_SETTING_CIPHER_PARAMS} + ASN1_R_ERROR_SETTING_CIPHER_PARAMS = 114; + {$EXTERNALSYM ASN1_R_EXPECTING_AN_INTEGER} + ASN1_R_EXPECTING_AN_INTEGER = 115; + {$EXTERNALSYM ASN1_R_EXPECTING_AN_OBJECT} + ASN1_R_EXPECTING_AN_OBJECT = 116; + {$EXTERNALSYM ASN1_R_EXPECTING_A_BOOLEAN} + ASN1_R_EXPECTING_A_BOOLEAN = 117; + {$EXTERNALSYM ASN1_R_EXPECTING_A_TIME} + ASN1_R_EXPECTING_A_TIME = 118; + {$EXTERNALSYM ASN1_R_EXPLICIT_LENGTH_MISMATCH} + ASN1_R_EXPLICIT_LENGTH_MISMATCH = 119; + {$EXTERNALSYM ASN1_R_EXPLICIT_TAG_NOT_CONSTRUCTED} + ASN1_R_EXPLICIT_TAG_NOT_CONSTRUCTED = 120; + {$EXTERNALSYM ASN1_R_FIELD_MISSING} + ASN1_R_FIELD_MISSING = 121; + {$EXTERNALSYM ASN1_R_FIRST_NUM_TOO_LARGE} + ASN1_R_FIRST_NUM_TOO_LARGE = 122; + {$EXTERNALSYM ASN1_R_HEADER_TOO_LONG} + ASN1_R_HEADER_TOO_LONG = 123; + {$EXTERNALSYM ASN1_R_ILLEGAL_BITSTRING_FORMAT} + ASN1_R_ILLEGAL_BITSTRING_FORMAT = 175; + {$EXTERNALSYM ASN1_R_ILLEGAL_BOOLEAN} + ASN1_R_ILLEGAL_BOOLEAN = 176; + {$EXTERNALSYM ASN1_R_ILLEGAL_CHARACTERS} + ASN1_R_ILLEGAL_CHARACTERS = 124; + {$EXTERNALSYM ASN1_R_ILLEGAL_FORMAT} + ASN1_R_ILLEGAL_FORMAT = 177; + {$EXTERNALSYM ASN1_R_ILLEGAL_HEX} + ASN1_R_ILLEGAL_HEX = 178; + {$EXTERNALSYM ASN1_R_ILLEGAL_IMPLICIT_TAG} + ASN1_R_ILLEGAL_IMPLICIT_TAG = 179; + {$EXTERNALSYM ASN1_R_ILLEGAL_INTEGER} + ASN1_R_ILLEGAL_INTEGER = 180; + {$EXTERNALSYM ASN1_R_ILLEGAL_NESTED_TAGGING} + ASN1_R_ILLEGAL_NESTED_TAGGING = 181; + {$EXTERNALSYM ASN1_R_ILLEGAL_NULL} + ASN1_R_ILLEGAL_NULL = 125; + {$EXTERNALSYM ASN1_R_ILLEGAL_NULL_VALUE} + ASN1_R_ILLEGAL_NULL_VALUE = 182; + {$EXTERNALSYM ASN1_R_ILLEGAL_OBJECT} + ASN1_R_ILLEGAL_OBJECT = 183; + {$EXTERNALSYM ASN1_R_ILLEGAL_OPTIONAL_ANY} + ASN1_R_ILLEGAL_OPTIONAL_ANY = 126; + {$EXTERNALSYM ASN1_R_ILLEGAL_OPTIONS_ON_ITEM_TEMPLATE} + ASN1_R_ILLEGAL_OPTIONS_ON_ITEM_TEMPLATE = 170; + {$EXTERNALSYM ASN1_R_ILLEGAL_TAGGED_ANY} + ASN1_R_ILLEGAL_TAGGED_ANY = 127; + {$EXTERNALSYM ASN1_R_ILLEGAL_TIME_VALUE} + ASN1_R_ILLEGAL_TIME_VALUE = 184; + {$EXTERNALSYM ASN1_R_INTEGER_NOT_ASCII_FORMAT} + ASN1_R_INTEGER_NOT_ASCII_FORMAT = 185; + {$EXTERNALSYM ASN1_R_INTEGER_TOO_LARGE_FOR_LONG} + ASN1_R_INTEGER_TOO_LARGE_FOR_LONG = 128; + {$EXTERNALSYM ASN1_R_INVALID_BMPSTRING_LENGTH} + ASN1_R_INVALID_BMPSTRING_LENGTH = 129; + {$EXTERNALSYM ASN1_R_INVALID_DIGIT} + ASN1_R_INVALID_DIGIT = 130; + {$EXTERNALSYM ASN1_R_INVALID_MIME_TYPE} + ASN1_R_INVALID_MIME_TYPE = 200; + {$EXTERNALSYM ASN1_R_INVALID_MODIFIER} + ASN1_R_INVALID_MODIFIER = 186; + {$EXTERNALSYM ASN1_R_INVALID_NUMBER} + ASN1_R_INVALID_NUMBER = 187; + {$EXTERNALSYM ASN1_R_INVALID_OBJECT_ENCODING} + ASN1_R_INVALID_OBJECT_ENCODING = 212; + + {$EXTERNALSYM ASN1_R_INVALID_SEPARATOR} + ASN1_R_INVALID_SEPARATOR = 131; + {$EXTERNALSYM ASN1_R_INVALID_TIME_FORMAT} + ASN1_R_INVALID_TIME_FORMAT = 132; + {$EXTERNALSYM ASN1_R_INVALID_UNIVERSALSTRING_LENGTH} + ASN1_R_INVALID_UNIVERSALSTRING_LENGTH = 133; + {$EXTERNALSYM ASN1_R_INVALID_UTF8STRING} + ASN1_R_INVALID_UTF8STRING = 134; + {$EXTERNALSYM ASN1_R_IV_TOO_LARGE} + ASN1_R_IV_TOO_LARGE = 135; + {$EXTERNALSYM ASN1_R_LENGTH_ERROR} + ASN1_R_LENGTH_ERROR = 136; + {$EXTERNALSYM ASN1_R_LIST_ERROR} + ASN1_R_LIST_ERROR = 188; + {$EXTERNALSYM ASN1_R_MIME_NO_CONTENT_TYPE} + ASN1_R_MIME_NO_CONTENT_TYPE = 201; + {$EXTERNALSYM ASN1_R_MIME_PARSE_ERROR} + ASN1_R_MIME_PARSE_ERROR = 202; + {$EXTERNALSYM ASN1_R_MIME_SIG_PARSE_ERROR} + ASN1_R_MIME_SIG_PARSE_ERROR = 203; + {$EXTERNALSYM ASN1_R_MISSING_EOC} + ASN1_R_MISSING_EOC = 137; + {$EXTERNALSYM ASN1_R_MISSING_SECOND_NUMBER} + ASN1_R_MISSING_SECOND_NUMBER = 138; + {$EXTERNALSYM ASN1_R_MISSING_VALUE} + ASN1_R_MISSING_VALUE = 189; + {$EXTERNALSYM ASN1_R_MSTRING_NOT_UNIVERSAL} + ASN1_R_MSTRING_NOT_UNIVERSAL = 139; + {$EXTERNALSYM ASN1_R_MSTRING_WRONG_TAG} + ASN1_R_MSTRING_WRONG_TAG = 140; + {$EXTERNALSYM ASN1_R_NESTED_ASN1_STRING} + ASN1_R_NESTED_ASN1_STRING = 197; + {$EXTERNALSYM ASN1_R_NON_HEX_CHARACTERS} + ASN1_R_NON_HEX_CHARACTERS = 141; + {$EXTERNALSYM ASN1_R_NOT_ASCII_FORMAT} + ASN1_R_NOT_ASCII_FORMAT = 190; + {$EXTERNALSYM ASN1_R_NOT_ENOUGH_DATA} + ASN1_R_NOT_ENOUGH_DATA = 142; + {$EXTERNALSYM ASN1_R_NO_CONTENT_TYPE} + ASN1_R_NO_CONTENT_TYPE = 204; + {$EXTERNALSYM ASN1_R_NO_MATCHING_CHOICE_TYPE} + ASN1_R_NO_MATCHING_CHOICE_TYPE = 143; + {$EXTERNALSYM ASN1_R_NO_MULTIPART_BODY_FAILURE} + ASN1_R_NO_MULTIPART_BODY_FAILURE = 205; + {$EXTERNALSYM ASN1_R_NO_MULTIPART_BOUNDARY} + ASN1_R_NO_MULTIPART_BOUNDARY = 206; + {$EXTERNALSYM ASN1_R_NO_SIG_CONTENT_TYPE} + ASN1_R_NO_SIG_CONTENT_TYPE = 207; + {$EXTERNALSYM ASN1_R_NULL_IS_WRONG_LENGTH} + ASN1_R_NULL_IS_WRONG_LENGTH = 144; + {$EXTERNALSYM ASN1_R_OBJECT_NOT_ASCII_FORMAT} + ASN1_R_OBJECT_NOT_ASCII_FORMAT = 191; + {$EXTERNALSYM ASN1_R_ODD_NUMBER_OF_CHARS} + ASN1_R_ODD_NUMBER_OF_CHARS = 145; + {$EXTERNALSYM ASN1_R_PRIVATE_KEY_HEADER_MISSING} + ASN1_R_PRIVATE_KEY_HEADER_MISSING = 146; + {$EXTERNALSYM ASN1_R_SECOND_NUMBER_TOO_LARGE} + ASN1_R_SECOND_NUMBER_TOO_LARGE = 147; + {$EXTERNALSYM ASN1_R_SEQUENCE_LENGTH_MISMATCH} + ASN1_R_SEQUENCE_LENGTH_MISMATCH = 148; + {$EXTERNALSYM ASN1_R_SEQUENCE_NOT_CONSTRUCTED} + ASN1_R_SEQUENCE_NOT_CONSTRUCTED = 149; + {$EXTERNALSYM ASN1_R_SEQUENCE_OR_SET_NEEDS_CONFIG} + ASN1_R_SEQUENCE_OR_SET_NEEDS_CONFIG = 192; + {$EXTERNALSYM ASN1_R_SHORT_LINE} + ASN1_R_SHORT_LINE = 150; + {$EXTERNALSYM ASN1_R_SIG_INVALID_MIME_TYPE} + ASN1_R_SIG_INVALID_MIME_TYPE = 208; + {$EXTERNALSYM ASN1_R_STREAMING_NOT_SUPPORTED} + ASN1_R_STREAMING_NOT_SUPPORTED = 209; + {$EXTERNALSYM ASN1_R_STRING_TOO_LONG} + ASN1_R_STRING_TOO_LONG = 151; + {$EXTERNALSYM ASN1_R_STRING_TOO_SHORT} + ASN1_R_STRING_TOO_SHORT = 152; + {$EXTERNALSYM ASN1_R_TAG_VALUE_TOO_HIGH} + ASN1_R_TAG_VALUE_TOO_HIGH = 153; + {$EXTERNALSYM ASN1_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD} + ASN1_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD = 154; + {$EXTERNALSYM ASN1_R_TIME_NOT_ASCII_FORMAT} + ASN1_R_TIME_NOT_ASCII_FORMAT = 193; + {$EXTERNALSYM ASN1_R_TOO_LONG} + ASN1_R_TOO_LONG = 155; + {$EXTERNALSYM ASN1_R_TYPE_NOT_CONSTRUCTED} + ASN1_R_TYPE_NOT_CONSTRUCTED = 156; + {$EXTERNALSYM ASN1_R_UNABLE_TO_DECODE_RSA_KEY} + ASN1_R_UNABLE_TO_DECODE_RSA_KEY = 157; + {$EXTERNALSYM ASN1_R_UNABLE_TO_DECODE_RSA_PRIVATE_KEY} + ASN1_R_UNABLE_TO_DECODE_RSA_PRIVATE_KEY = 158; + {$EXTERNALSYM ASN1_R_UNEXPECTED_EOC} + ASN1_R_UNEXPECTED_EOC = 159; + {$EXTERNALSYM ASN1_R_UNIVERSALSTRING_IS_WRONG_LENGTH} + ASN1_R_UNIVERSALSTRING_IS_WRONG_LENGTH = 211; + {$EXTERNALSYM ASN1_R_UNKNOWN_FORMAT} + ASN1_R_UNKNOWN_FORMAT = 160; + {$EXTERNALSYM ASN1_R_UNKNOWN_MESSAGE_DIGEST_ALGORITHM} + ASN1_R_UNKNOWN_MESSAGE_DIGEST_ALGORITHM = 161; + {$EXTERNALSYM ASN1_R_UNKNOWN_OBJECT_TYPE} + ASN1_R_UNKNOWN_OBJECT_TYPE = 162; + {$EXTERNALSYM ASN1_R_UNKNOWN_PUBLIC_KEY_TYPE} + ASN1_R_UNKNOWN_PUBLIC_KEY_TYPE = 163; + {$EXTERNALSYM ASN1_R_UNKNOWN_TAG} + ASN1_R_UNKNOWN_TAG = 194; + {$EXTERNALSYM ASN1_R_UNKOWN_FORMAT} + ASN1_R_UNKOWN_FORMAT = 195; + {$EXTERNALSYM ASN1_R_UNSUPPORTED_ANY_DEFINED_BY_TYPE} + ASN1_R_UNSUPPORTED_ANY_DEFINED_BY_TYPE = 164; + {$EXTERNALSYM ASN1_R_UNSUPPORTED_CIPHER} + ASN1_R_UNSUPPORTED_CIPHER = 165; + {$EXTERNALSYM ASN1_R_UNSUPPORTED_ENCRYPTION_ALGORITHM} + ASN1_R_UNSUPPORTED_ENCRYPTION_ALGORITHM = 166; + {$EXTERNALSYM ASN1_R_UNSUPPORTED_PUBLIC_KEY_TYPE} + ASN1_R_UNSUPPORTED_PUBLIC_KEY_TYPE = 167; + {$EXTERNALSYM ASN1_R_UNSUPPORTED_TYPE} + ASN1_R_UNSUPPORTED_TYPE = 196; + {$EXTERNALSYM ASN1_R_WRONG_TAG} + ASN1_R_WRONG_TAG = 168; + {$EXTERNALSYM ASN1_R_WRONG_TYPE} + ASN1_R_WRONG_TYPE = 169; + + {$EXTERNALSYM ASN1_STRING_FLAG_BITS_LEFT} + ASN1_STRING_FLAG_BITS_LEFT = $08; + {$EXTERNALSYM ASN1_STRING_FLAG_NDEF} + ASN1_STRING_FLAG_NDEF = $010; +//* This flag is used by the CMS code to indicate that a string is not +// * complete and is a place holder for content when it had all been +// * accessed. The flag will be reset when content has been written to it. +// */ + {$EXTERNALSYM ASN1_STRING_FLAG_CONT} + ASN1_STRING_FLAG_CONT = $020; + {$EXTERNALSYM ASN1_LONG_UNDEF} + ASN1_LONG_UNDEF = $7fffffff; //0x7fffffffL + + {$EXTERNALSYM UB_NAME} + UB_NAME = 32768; + {$EXTERNALSYM UB_COMMON_NAME} + UB_COMMON_NAME = 64; + {$EXTERNALSYM UB_LOCALITY_NAME} + UB_LOCALITY_NAME = 128; + {$EXTERNALSYM UB_STATE_NAME} + UB_STATE_NAME = 128; + {$EXTERNALSYM UB_ORGANIZATION_NAME} + UB_ORGANIZATION_NAME = 64; + {$EXTERNALSYM UB_ORGANIZATION_UNIT_NAME} + UB_ORGANIZATION_UNIT_NAME = 64; + {$EXTERNALSYM UB_TITLE} + UB_TITLE = 64; + {$EXTERNALSYM UB_EMAIL_ADDRESS} + UB_EMAIL_ADDRESS = 128; + + {$EXTERNALSYM ASN1_STRFLGS_ESC_2253} + ASN1_STRFLGS_ESC_2253 = 1; + {$EXTERNALSYM ASN1_STRFLGS_ESC_CTRL} + ASN1_STRFLGS_ESC_CTRL = 2; + {$EXTERNALSYM ASN1_STRFLGS_ESC_MSB} + ASN1_STRFLGS_ESC_MSB = 4; + {$EXTERNALSYM ASN1_STRFLGS_ESC_QUOTE} + ASN1_STRFLGS_ESC_QUOTE = 8; + + {$EXTERNALSYM ASN1_STRFLGS_UTF8_CONVERT} + ASN1_STRFLGS_UTF8_CONVERT = $10; + {$EXTERNALSYM ASN1_STRFLGS_IGNORE_TYPE} + ASN1_STRFLGS_IGNORE_TYPE = $20; + {$EXTERNALSYM ASN1_STRFLGS_SHOW_TYPE} + ASN1_STRFLGS_SHOW_TYPE = $40; + {$EXTERNALSYM ASN1_STRFLGS_DUMP_ALL} + ASN1_STRFLGS_DUMP_ALL = $80; + {$EXTERNALSYM ASN1_STRFLGS_DUMP_UNKNOWN} + ASN1_STRFLGS_DUMP_UNKNOWN = $100; + {$EXTERNALSYM ASN1_STRFLGS_DUMP_DER} + ASN1_STRFLGS_DUMP_DER = $200; + {$EXTERNALSYM ASN1_STRFLGS_RFC2253} + ASN1_STRFLGS_RFC2253 = ASN1_STRFLGS_ESC_2253 or + ASN1_STRFLGS_ESC_CTRL or + ASN1_STRFLGS_ESC_MSB or + ASN1_STRFLGS_UTF8_CONVERT or + ASN1_STRFLGS_DUMP_UNKNOWN or + ASN1_STRFLGS_DUMP_DER; + + {$EXTERNALSYM BIO_BIND_NORMAL} + BIO_BIND_NORMAL = 0; + {$EXTERNALSYM BIO_BIND_REUSEADDR} + BIO_BIND_REUSEADDR = 2; + {$EXTERNALSYM BIO_BIND_REUSEADDR_IF_UNUSED} + BIO_BIND_REUSEADDR_IF_UNUSED = 1; + {$EXTERNALSYM BIO_CB_CTRL} + BIO_CB_CTRL = $06; + {$EXTERNALSYM BIO_CB_FREE} + BIO_CB_FREE = $01; + {$EXTERNALSYM BIO_CB_GETS} + BIO_CB_GETS = $05; + {$EXTERNALSYM BIO_CB_PUTS} + BIO_CB_PUTS = $04; + {$EXTERNALSYM BIO_CB_READ} + BIO_CB_READ = $02; + {$EXTERNALSYM BIO_CB_RETURN} + BIO_CB_RETURN = $80; + {$EXTERNALSYM BIO_CB_WRITE} + BIO_CB_WRITE = $03; + {$EXTERNALSYM BIO_CLOSE} + BIO_CLOSE = $01; + {$EXTERNALSYM BIO_CONN_S_BEFORE} + BIO_CONN_S_BEFORE = 1; + {$EXTERNALSYM BIO_CONN_S_BLOCKED_CONNECT} + BIO_CONN_S_BLOCKED_CONNECT = 7; + {$EXTERNALSYM BIO_CONN_S_CONNECT} + BIO_CONN_S_CONNECT = 5; + {$EXTERNALSYM BIO_CONN_S_CREATE_SOCKET} + BIO_CONN_S_CREATE_SOCKET = 4; + {$EXTERNALSYM BIO_CONN_S_GET_IP} + BIO_CONN_S_GET_IP = 2; + {$EXTERNALSYM BIO_CONN_S_GET_PORT} + BIO_CONN_S_GET_PORT = 3; + {$EXTERNALSYM BIO_CONN_S_NBIO} + BIO_CONN_S_NBIO = 8; + {$EXTERNALSYM BIO_CONN_S_OK} + BIO_CONN_S_OK = 6; + {$EXTERNALSYM BIO_CTRL_DUP} + BIO_CTRL_DUP = 12; + {$EXTERNALSYM BIO_CTRL_EOF} + BIO_CTRL_EOF = 2; + {$EXTERNALSYM BIO_CTRL_FLUSH} + BIO_CTRL_FLUSH = 11; + {$EXTERNALSYM BIO_CTRL_GET} + BIO_CTRL_GET = 5; + {$EXTERNALSYM BIO_CTRL_GET_CALLBACK} + BIO_CTRL_GET_CALLBACK = 15; + {$EXTERNALSYM BIO_CTRL_GET_CLOSE} + BIO_CTRL_GET_CLOSE = 8; + {$EXTERNALSYM BIO_CTRL_INFO} + BIO_CTRL_INFO = 3; + {$EXTERNALSYM BIO_CTRL_PENDING} + BIO_CTRL_PENDING = 10; + {$EXTERNALSYM BIO_CTRL_POP} + BIO_CTRL_POP = 7; + {$EXTERNALSYM BIO_CTRL_PUSH} + BIO_CTRL_PUSH = 6; + {$EXTERNALSYM BIO_CTRL_RESET} + BIO_CTRL_RESET = 1; + {$EXTERNALSYM BIO_CTRL_SET} + BIO_CTRL_SET = 4; + {$EXTERNALSYM BIO_CTRL_SET_CALLBACK} + BIO_CTRL_SET_CALLBACK = 14; + {$EXTERNALSYM BIO_CTRL_SET_CLOSE} + BIO_CTRL_SET_CLOSE = 9; + {$EXTERNALSYM BIO_CTRL_SET_FILENAME} + BIO_CTRL_SET_FILENAME = 30; + //* dgram BIO stuff */ + {$EXTERNALSYM BIO_CTRL_DGRAM_CONNECT} + BIO_CTRL_DGRAM_CONNECT = 31; //* BIO dgram special */ + {$EXTERNALSYM BIO_CTRL_DGRAM_SET_CONNECTED} + BIO_CTRL_DGRAM_SET_CONNECTED = 32; //* allow for an externally + //* connected socket to be + //* passed in */ + {$EXTERNALSYM BIO_CTRL_DGRAM_SET_RECV_TIMEOUT} + BIO_CTRL_DGRAM_SET_RECV_TIMEOUT = 33; //* setsockopt, essentially */ + {$EXTERNALSYM BIO_CTRL_DGRAM_GET_RECV_TIMEOUT} + BIO_CTRL_DGRAM_GET_RECV_TIMEOUT = 34; //* getsockopt, essentially */ + {$EXTERNALSYM BIO_CTRL_DGRAM_SET_SEND_TIMEOUT} + BIO_CTRL_DGRAM_SET_SEND_TIMEOUT = 35; //* setsockopt, essentially */ + {$EXTERNALSYM BIO_CTRL_DGRAM_GET_SEND_TIMEOUT} + BIO_CTRL_DGRAM_GET_SEND_TIMEOUT = 36; //* getsockopt, essentially */ + + {$EXTERNALSYM BIO_CTRL_DGRAM_GET_RECV_TIMER_EXP} + BIO_CTRL_DGRAM_GET_RECV_TIMER_EXP = 37; //* flag whether the last */ + {$EXTERNALSYM BIO_CTRL_DGRAM_GET_SEND_TIMER_EXP} + BIO_CTRL_DGRAM_GET_SEND_TIMER_EXP = 38; //* I/O operation tiemd out */ + + +//* #ifdef IP_MTU_DISCOVER */ + {$EXTERNALSYM BIO_CTRL_DGRAM_MTU_DISCOVER} + BIO_CTRL_DGRAM_MTU_DISCOVER = 39; //* set DF bit on egress packets */ +//* #endif */ + + {$EXTERNALSYM BIO_CTRL_DGRAM_QUERY_MTU} + BIO_CTRL_DGRAM_QUERY_MTU = 40; //* as kernel for current MTU */ + {$EXTERNALSYM BIO_CTRL_DGRAM_GET_MTU} + BIO_CTRL_DGRAM_GET_MTU = 41; //* get cached value for MTU */ + {$EXTERNALSYM BIO_CTRL_DGRAM_SET_MTU} + BIO_CTRL_DGRAM_SET_MTU = 42; //* set cached value for + // * MTU. want to use this + // * if asking the kernel + // * fails */ + + {$EXTERNALSYM BIO_CTRL_DGRAM_MTU_EXCEEDED} + BIO_CTRL_DGRAM_MTU_EXCEEDED = 43; //* check whether the MTU + // * was exceed in the + // * previous write + // * operation */ + {$EXTERNALSYM BIO_CTRL_DGRAM_GET_PEER} + BIO_CTRL_DGRAM_GET_PEER = 46; + + {$EXTERNALSYM BIO_CTRL_DGRAM_SET_PEER} + BIO_CTRL_DGRAM_SET_PEER = 44; //* Destination for the data */ + {$EXTERNALSYM BIO_CTRL_DGRAM_SET_NEXT_TIMEOUT} + BIO_CTRL_DGRAM_SET_NEXT_TIMEOUT = 45; //* Next DTLS handshake timeout to + + {$EXTERNALSYM BIO_CTRL_WPENDING} + BIO_CTRL_WPENDING = 13; + {$EXTERNALSYM BIO_C_DESTROY_BIO_PAIR} + BIO_C_DESTROY_BIO_PAIR = 139; + {$EXTERNALSYM BIO_C_DO_STATE_MACHINE} + BIO_C_DO_STATE_MACHINE = 101; + {$EXTERNALSYM BIO_C_FILE_SEEK} + BIO_C_FILE_SEEK = 128; + {$EXTERNALSYM BIO_C_FILE_TELL} + BIO_C_FILE_TELL = 133; + {$EXTERNALSYM BIO_C_GET_ACCEPT} + BIO_C_GET_ACCEPT = 124; + {$EXTERNALSYM BIO_C_GET_BIND_MODE} + BIO_C_GET_BIND_MODE = 132; + {$EXTERNALSYM BIO_C_GET_BUFF_NUM_LINES} + BIO_C_GET_BUFF_NUM_LINES = 116; + {$EXTERNALSYM BIO_C_GET_BUF_MEM_PTR} + BIO_C_GET_BUF_MEM_PTR = 115; + {$EXTERNALSYM BIO_C_GET_CIPHER_CTX} + BIO_C_GET_CIPHER_CTX = 129; + {$EXTERNALSYM BIO_C_GET_CIPHER_STATUS} + BIO_C_GET_CIPHER_STATUS = 113; + {$EXTERNALSYM BIO_C_GET_CONNECT} + BIO_C_GET_CONNECT = 123; + {$EXTERNALSYM BIO_C_GET_FD} + BIO_C_GET_FD = 105; + {$EXTERNALSYM BIO_C_GET_FILE_PTR} + BIO_C_GET_FILE_PTR = 107; + {$EXTERNALSYM BIO_C_GET_MD} + BIO_C_GET_MD = 112; + {$EXTERNALSYM BIO_C_GET_MD_CTX} + BIO_C_GET_MD_CTX = 120; + + {$EXTERNALSYM BIO_C_GET_PROXY_PARAM} + BIO_C_GET_PROXY_PARAM = 121; + {$EXTERNALSYM BIO_C_GET_READ_REQUEST} + BIO_C_GET_READ_REQUEST = 141; + {$EXTERNALSYM BIO_C_GET_SOCKS} + BIO_C_GET_SOCKS = 134; + + {$EXTERNALSYM BIO_C_GET_SSL} + BIO_C_GET_SSL = 110; + {$EXTERNALSYM BIO_C_GET_SSL_NUM_RENEGOTIATES} + BIO_C_GET_SSL_NUM_RENEGOTIATES = 126; + {$EXTERNALSYM BIO_C_GET_WRITE_BUF_SIZE} + BIO_C_GET_WRITE_BUF_SIZE = 137; + {$EXTERNALSYM BIO_C_GET_WRITE_GUARANTEE} + BIO_C_GET_WRITE_GUARANTEE = 140; + {$EXTERNALSYM BIO_C_MAKE_BIO_PAIR} + BIO_C_MAKE_BIO_PAIR = 138; + {$EXTERNALSYM BIO_C_SET_ACCEPT} + BIO_C_SET_ACCEPT = 118; + {$EXTERNALSYM BIO_C_SET_BIND_MODE} + BIO_C_SET_BIND_MODE = 131; + {$EXTERNALSYM BIO_C_SET_BUFF_READ_DATA} + BIO_C_SET_BUFF_READ_DATA = 122; + {$EXTERNALSYM BIO_C_SET_BUFF_SIZE} + BIO_C_SET_BUFF_SIZE = 117; + {$EXTERNALSYM BIO_C_SET_BUF_MEM} + BIO_C_SET_BUF_MEM = 114; + {$EXTERNALSYM BIO_C_SET_BUF_MEM_EOF_RETURN} + BIO_C_SET_BUF_MEM_EOF_RETURN = 130; + {$EXTERNALSYM BIO_C_SET_CONNECT} + BIO_C_SET_CONNECT = 100; + {$EXTERNALSYM BIO_C_SET_FD} + BIO_C_SET_FD = 104; + {$EXTERNALSYM BIO_C_SET_FILENAME} + BIO_C_SET_FILENAME = 108; + {$EXTERNALSYM BIO_C_SET_FILE_PTR} + BIO_C_SET_FILE_PTR = 106; + {$EXTERNALSYM BIO_C_SET_MD} + BIO_C_SET_MD = 111; + {$EXTERNALSYM BIO_C_SET_NBIO} + BIO_C_SET_NBIO = 102; + {$EXTERNALSYM BIO_C_SET_PROXY_PARAM} + BIO_C_SET_PROXY_PARAM = 103; + {$EXTERNALSYM BIO_C_SET_SOCKS} + BIO_C_SET_SOCKS = 135; + {$EXTERNALSYM BIO_C_SET_SSL} + BIO_C_SET_SSL = 109; + {$EXTERNALSYM BIO_C_SET_SSL_RENEGOTIATE_BYTES} + BIO_C_SET_SSL_RENEGOTIATE_BYTES = 125; + {$EXTERNALSYM BIO_C_SET_SSL_RENEGOTIATE_TIMEOUT} + BIO_C_SET_SSL_RENEGOTIATE_TIMEOUT = 127; + {$EXTERNALSYM BIO_C_SET_WRITE_BUF_SIZE} + BIO_C_SET_WRITE_BUF_SIZE = 136; + {$EXTERNALSYM BIO_C_SHUTDOWN_WR} + BIO_C_SHUTDOWN_WR = 142; + {$EXTERNALSYM BIO_C_NREAD0} + BIO_C_NREAD0 = 143; + {$EXTERNALSYM BIO_C_NREAD} + BIO_C_NREAD = 144; + {$EXTERNALSYM BIO_C_NWRITE0} + BIO_C_NWRITE0 = 145; + {$EXTERNALSYM BIO_C_NWRITE} + BIO_C_NWRITE = 146; + {$EXTERNALSYM BIO_C_RESET_READ_REQUEST} + BIO_C_RESET_READ_REQUEST = 147; + {$EXTERNALSYM BIO_C_SET_MD_CTX} + BIO_C_SET_MD_CTX = 148; + {$EXTERNALSYM BIO_C_SSL_MODE} + BIO_C_SSL_MODE = 119; + {$EXTERNALSYM BIO_FLAGS_BASE64_NO_NL} + BIO_FLAGS_BASE64_NO_NL = $100; + {$EXTERNALSYM BIO_FLAGS_IO_SPECIAL} + BIO_FLAGS_IO_SPECIAL = $04; + {$EXTERNALSYM BIO_FLAGS_READ} + BIO_FLAGS_READ = $01; + {$EXTERNALSYM BIO_FLAGS_WRITE} + BIO_FLAGS_WRITE = $02; + {$EXTERNALSYM BIO_FLAGS_RWS} + BIO_FLAGS_RWS = BIO_FLAGS_READ or + BIO_FLAGS_WRITE or + BIO_FLAGS_IO_SPECIAL; + {$EXTERNALSYM BIO_FLAGS_SHOULD_RETRY} + BIO_FLAGS_SHOULD_RETRY = $08; + {$EXTERNALSYM BIO_FP_APPEND} + BIO_FP_APPEND = $08; + {$EXTERNALSYM BIO_FP_READ} + BIO_FP_READ = $02; + {$EXTERNALSYM BIO_FP_TEXT} + BIO_FP_TEXT = $10; + {$EXTERNALSYM BIO_FP_WRITE} + BIO_FP_WRITE = $04; + {$EXTERNALSYM BIO_F_ACPT_STATE} + BIO_F_ACPT_STATE = 100; + {$EXTERNALSYM BIO_F_BIO_ACCEPT} + BIO_F_BIO_ACCEPT = 101; + {$EXTERNALSYM BIO_F_BIO_BER_GET_HEADER} + BIO_F_BIO_BER_GET_HEADER = 102; + {$EXTERNALSYM BIO_F_BIO_CTRL} + BIO_F_BIO_CTRL = 103; + {$EXTERNALSYM BIO_F_BIO_GETHOSTBYNAME} + BIO_F_BIO_GETHOSTBYNAME = 120; + {$EXTERNALSYM BIO_F_BIO_GETS} + BIO_F_BIO_GETS = 104; + {$EXTERNALSYM BIO_F_BIO_GET_ACCEPT_SOCKET} + BIO_F_BIO_GET_ACCEPT_SOCKET = 105; + {$EXTERNALSYM BIO_F_BIO_GET_HOST_IP} + BIO_F_BIO_GET_HOST_IP = 106; + {$EXTERNALSYM BIO_F_BIO_GET_PORT} + BIO_F_BIO_GET_PORT = 107; + {$EXTERNALSYM BIO_F_BIO_MAKE_PAIR} + BIO_F_BIO_MAKE_PAIR = 121; + {$EXTERNALSYM BIO_F_BIO_NEW} + BIO_F_BIO_NEW = 108; + {$EXTERNALSYM BIO_F_BIO_NEW_FILE} + BIO_F_BIO_NEW_FILE = 109; + {$EXTERNALSYM BIO_F_BIO_PUTS} + BIO_F_BIO_PUTS = 110; + {$EXTERNALSYM BIO_F_BIO_READ} + BIO_F_BIO_READ = 111; + {$EXTERNALSYM BIO_F_BIO_SOCK_INIT} + BIO_F_BIO_SOCK_INIT = 112; + {$EXTERNALSYM BIO_F_BIO_WRITE} + BIO_F_BIO_WRITE = 113; + {$EXTERNALSYM BIO_F_BUFFER_CTRL} + BIO_F_BUFFER_CTRL = 114; + {$EXTERNALSYM BIO_F_CONN_STATE} + BIO_F_CONN_STATE = 115; + {$EXTERNALSYM BIO_F_FILE_CTRL} + BIO_F_FILE_CTRL = 116; + {$EXTERNALSYM BIO_F_MEM_WRITE} + BIO_F_MEM_WRITE = 117; + {$EXTERNALSYM BIO_F_SSL_NEW} + BIO_F_SSL_NEW = 118; + {$EXTERNALSYM BIO_F_WSASTARTUP} + BIO_F_WSASTARTUP = 119; + {$EXTERNALSYM BIO_GHBN_CTRL_CACHE_SIZE} + BIO_GHBN_CTRL_CACHE_SIZE = 3; + {$EXTERNALSYM BIO_GHBN_CTRL_FLUSH} + BIO_GHBN_CTRL_FLUSH = 5; + {$EXTERNALSYM BIO_GHBN_CTRL_GET_ENTRY} + BIO_GHBN_CTRL_GET_ENTRY = 4; + {$EXTERNALSYM BIO_GHBN_CTRL_HITS} + BIO_GHBN_CTRL_HITS = 1; + {$EXTERNALSYM BIO_GHBN_CTRL_MISSES} + BIO_GHBN_CTRL_MISSES = 2; + {$EXTERNALSYM BIO_NOCLOSE} + BIO_NOCLOSE = $00; + {$EXTERNALSYM BIO_RR_CONNECT} + BIO_RR_CONNECT = $02; + {$EXTERNALSYM BIO_RR_SSL_X509_LOOKUP} + BIO_RR_SSL_X509_LOOKUP = $01; + {$EXTERNALSYM BIO_R_ACCEPT_ERROR} + BIO_R_ACCEPT_ERROR = 100; + {$EXTERNALSYM BIO_R_BAD_FOPEN_MODE} + BIO_R_BAD_FOPEN_MODE = 101; + {$EXTERNALSYM BIO_R_BAD_HOSTNAME_LOOKUP} + BIO_R_BAD_HOSTNAME_LOOKUP = 102; + {$EXTERNALSYM BIO_R_BROKEN_PIPE} + BIO_R_BROKEN_PIPE = 124; + {$EXTERNALSYM BIO_R_CONNECT_ERROR} + BIO_R_CONNECT_ERROR = 103; + {$EXTERNALSYM BIO_R_ERROR_SETTING_NBIO} + BIO_R_ERROR_SETTING_NBIO = 104; + {$EXTERNALSYM BIO_R_ERROR_SETTING_NBIO_ON_ACCEPTED_SOCKET} + BIO_R_ERROR_SETTING_NBIO_ON_ACCEPTED_SOCKET = 105; + {$EXTERNALSYM BIO_R_ERROR_SETTING_NBIO_ON_ACCEPT_SOCKET} + BIO_R_ERROR_SETTING_NBIO_ON_ACCEPT_SOCKET = 106; + {$EXTERNALSYM BIO_R_GETHOSTBYNAME_ADDR_IS_NOT_AF_INET} + BIO_R_GETHOSTBYNAME_ADDR_IS_NOT_AF_INET = 107; + {$EXTERNALSYM BIO_R_INVALID_ARGUMENT} + BIO_R_INVALID_ARGUMENT = 125; + {$EXTERNALSYM BIO_R_INVALID_IP_ADDRESS} + BIO_R_INVALID_IP_ADDRESS = 108; + {$EXTERNALSYM BIO_R_IN_USE} + BIO_R_IN_USE = 123; + {$EXTERNALSYM BIO_R_KEEPALIVE} + BIO_R_KEEPALIVE = 109; + {$EXTERNALSYM BIO_R_NBIO_CONNECT_ERROR} + BIO_R_NBIO_CONNECT_ERROR = 110; + {$EXTERNALSYM BIO_R_NO_ACCEPT_PORT_SPECIFIED} + BIO_R_NO_ACCEPT_PORT_SPECIFIED = 111; + {$EXTERNALSYM BIO_R_NO_HOSTNAME_SPECIFIED} + BIO_R_NO_HOSTNAME_SPECIFIED = 112; + {$EXTERNALSYM BIO_R_NO_PORT_DEFINED} + BIO_R_NO_PORT_DEFINED = 113; + {$EXTERNALSYM BIO_R_NO_PORT_SPECIFIED} + BIO_R_NO_PORT_SPECIFIED = 114; + {$EXTERNALSYM BIO_R_NULL_PARAMETER} + BIO_R_NULL_PARAMETER = 115; + {$EXTERNALSYM BIO_R_TAG_MISMATCH} + BIO_R_TAG_MISMATCH = 116; + {$EXTERNALSYM BIO_R_UNABLE_TO_BIND_SOCKET} + BIO_R_UNABLE_TO_BIND_SOCKET = 117; + {$EXTERNALSYM BIO_R_UNABLE_TO_CREATE_SOCKET} + BIO_R_UNABLE_TO_CREATE_SOCKET = 118; + {$EXTERNALSYM BIO_R_UNABLE_TO_LISTEN_SOCKET} + BIO_R_UNABLE_TO_LISTEN_SOCKET = 119; + {$EXTERNALSYM BIO_R_UNINITIALIZED} + BIO_R_UNINITIALIZED = 120; + {$EXTERNALSYM BIO_R_UNSUPPORTED_METHOD} + BIO_R_UNSUPPORTED_METHOD = 121; + {$EXTERNALSYM BIO_R_WSASTARTUP} + BIO_R_WSASTARTUP = 122; + {$EXTERNALSYM BIO_TYPE_ACCEPT} + BIO_TYPE_ACCEPT = 13 or $0400 or $0100; + {$EXTERNALSYM BIO_TYPE_BASE64} + BIO_TYPE_BASE64 = 11 or $0200; + {$EXTERNALSYM BIO_TYPE_BER} + BIO_TYPE_BER = 18 or $0200; + {$EXTERNALSYM BIO_TYPE_BIO} + BIO_TYPE_BIO = 19 or $0400; + {$EXTERNALSYM BIO_TYPE_BUFFER} + BIO_TYPE_BUFFER = 9 or $0200; + {$EXTERNALSYM BIO_TYPE_CIPHER} + BIO_TYPE_CIPHER = 10 or $0200; + {$EXTERNALSYM BIO_TYPE_CONNECT} + BIO_TYPE_CONNECT = 12 or $0400 or $0100; + {$EXTERNALSYM BIO_TYPE_DESCRIPTOR} + BIO_TYPE_DESCRIPTOR = $0100; + {$EXTERNALSYM BIO_TYPE_FD} + BIO_TYPE_FD = 4 or $0400 or $0100; + {$EXTERNALSYM BIO_TYPE_FILE} + BIO_TYPE_FILE = 2 or $0400; + {$EXTERNALSYM BIO_TYPE_FILTER} + BIO_TYPE_FILTER = $0200; + {$EXTERNALSYM BIO_TYPE_MD} + BIO_TYPE_MD = 8 or $0200; + {$EXTERNALSYM BIO_TYPE_MEM} + BIO_TYPE_MEM = 1 or $0400; + {$EXTERNALSYM BIO_TYPE_NBIO_TEST} + BIO_TYPE_NBIO_TEST = 16 or $0200; + {$EXTERNALSYM BIO_TYPE_NONE} + BIO_TYPE_NONE = 0; + {$EXTERNALSYM BIO_TYPE_NULL} + BIO_TYPE_NULL = 6 or $0400; + {$EXTERNALSYM BIO_TYPE_NULL_FILTER} + BIO_TYPE_NULL_FILTER = 17 or $0200; + {$EXTERNALSYM BIO_TYPE_PROXY_CLIENT} + BIO_TYPE_PROXY_CLIENT = 14 or $0200; + {$EXTERNALSYM BIO_TYPE_PROXY_SERVER} + BIO_TYPE_PROXY_SERVER = 15 or $0200; + {$EXTERNALSYM BIO_TYPE_SOCKET} + BIO_TYPE_SOCKET = 5 or $0400 or $0100; + {$EXTERNALSYM BIO_TYPE_SOURCE_SINK} + BIO_TYPE_SOURCE_SINK = $0400; + {$EXTERNALSYM BIO_TYPE_SSL} + BIO_TYPE_SSL = 7 or $0200; + {$EXTERNALSYM BIO_TYPE_LINEBUFFER} + BIO_TYPE_LINEBUFFER = 20 or $0200; + {$EXTERNALSYM BIO_TYPE_DGRAM} + BIO_TYPE_DGRAM = 21 or $0400 or $0100; + {$EXTERNALSYM BIO_TYPE_COMP} + BIO_TYPE_COMP = 23 or $0200; + + {$IFDEF SIXTY_FOUR_BIT_LONG} + {$EXTERNALSYM BN_BITS} + BN_BITS = 128; + {$EXTERNALSYM BN_BYTES} + BN_BYTES = 8; + {$EXTERNALSYM BN_BITS2} + BN_BITS2 = 64; + {$EXTERNALSYM BN_BITS4} + BN_BITS4 = 32; + {$EXTERNALSYM BN_DEC_FMT1} + BN_DEC_FMT1 = '%lu'; {Do not localize} + {$EXTERNALSYM BN_DEC_FMT2} + BN_DEC_FMT2 = '%019lu'; {Do not localize} + {$EXTERNALSYM BN_DEC_NUM} + BN_DEC_NUM = 19; + {$ENDIF} + {$IFDEF SIXTY_FOUR_BIT} + {$UNDEF BN_LLONG} + {$UNDEF BN_ULLONG} + {$EXTERNALSYM OPENSSL_BN_BITS} + OPENSSL_BN_BITS = 128; + {$EXTERNALSYM OPENSSL_BN_BYTES} + OPENSSL_BN_BYTES = 8; + {$EXTERNALSYM OPENSSL_BN_BITS2} + OPENSSL_BN_BITS2 = 64; + {$EXTERNALSYM OPENSSL_BN_BITS4} + OPENSSL_BN_BITS4 = 32; + {$EXTERNALSYM OPENSSL_BN_DEC_FMT1} + OPENSSL_BN_DEC_FMT1 = '%llu'; {Do not localize} + {$EXTERNALSYM OPENSSL_BN_DEC_FMT2} + OPENSSL_BN_DEC_FMT2 = '%019llu'; {Do not localize} + {$EXTERNALSYM OPENSSL_BN_DEC_NUM} + OPENSSL_BN_DEC_NUM = 19; + {$ENDIF} + {$IFDEF THIRTY_TWO_BIT} + {$EXTERNALSYM BN_BITS} + BN_BITS = 64; + {$EXTERNALSYM BN_BYTES} + BN_BYTES = 4; + {$EXTERNALSYM BN_BITS2} + BN_BITS2 = 32; + {$EXTERNALSYM BN_BITS4} + BN_BITS4 = 16; + {$EXTERNALSYM BN_DEC_FMT1} + BN_DEC_FMT1 = '%lu'; {Do not localize} + {$EXTERNALSYM BN_DEC_FMT2} + BN_DEC_FMT2 = '%09lu'; {Do not localize} + {$EXTERNALSYM BN_DEC_NUM} + BN_DEC_NUM = 9; + {$ENDIF} + {$EXTERNALSYM BN_CTX_NUM} + BN_CTX_NUM = 12; + {$IFNDEF OPENSSL_NO_DEPRECATED} + {$EXTERNALSYM BN_DEFAULT_BITS} + BN_DEFAULT_BITS = 1280; + {$ENDIF} + {$EXTERNALSYM BN_FLG_FREE} + BN_FLG_FREE = $8000; + {$EXTERNALSYM BN_FLG_MALLOCED} + BN_FLG_MALLOCED = $01; + {$EXTERNALSYM BN_FLG_STATIC_DATA} + BN_FLG_STATIC_DATA = $02; + {$EXTERNALSYM BN_FLG_CONSTTIME} + BN_FLG_CONSTTIME = $04; + //* avoid leaking exponent information through timing, + //* BN_mod_exp_mont() will call BN_mod_exp_mont_consttime, + //* BN_div() will call BN_div_no_branch, + // * BN_mod_inverse() will call BN_mod_inverse_no_branch. + // */ + {$IFNDEF OPENSSL_NO_DEPRECATED} + {$EXTERNALSYM BN_FLG_EXP_CONSTTIME} + BN_FLG_EXP_CONSTTIME = BN_FLG_CONSTTIME; //* deprecated name for the flag */ + //* avoid leaking exponent information through timings + //* (BN_mod_exp_mont() will call BN_mod_exp_mont_consttime) */ + {$ENDIF} + {$EXTERNALSYM BN_F_BN_BLINDING_CONVERT} + BN_F_BN_BLINDING_CONVERT = 100; + {$EXTERNALSYM BN_F_BN_BLINDING_INVERT} + BN_F_BN_BLINDING_INVERT = 101; + {$EXTERNALSYM BN_F_BN_BLINDING_NEW} + BN_F_BN_BLINDING_NEW = 102; + {$EXTERNALSYM BN_F_BN_BLINDING_UPDATE} + BN_F_BN_BLINDING_UPDATE = 103; + {$EXTERNALSYM BN_F_BN_BN2DEC} + BN_F_BN_BN2DEC = 104; + {$EXTERNALSYM BN_F_BN_BN2HEX} + BN_F_BN_BN2HEX = 105; + {$EXTERNALSYM BN_F_BN_CTX_NEW} + BN_F_BN_CTX_NEW = 106; + {$EXTERNALSYM BN_F_BN_DIV} + BN_F_BN_DIV = 107; + {$EXTERNALSYM BN_F_BN_DIV_NO_BRANCH} + BN_F_BN_DIV_NO_BRANCH = 138; + {$EXTERNALSYM BN_F_BN_EXPAND2} + BN_F_BN_EXPAND2 = 108; + {$EXTERNALSYM BN_F_BN_MOD_EXP_MONT} + BN_F_BN_MOD_EXP_MONT = 109; + {$EXTERNALSYM BN_F_BN_MOD_INVERSE} + BN_F_BN_MOD_INVERSE = 110; + {$EXTERNALSYM BN_F_BN_MOD_INVERSE_NO_BRANCH} + BN_F_BN_MOD_INVERSE_NO_BRANCH = 139; + {$EXTERNALSYM BN_F_BN_MOD_MUL_RECIPROCAL} + BN_F_BN_MOD_MUL_RECIPROCAL = 111; + {$EXTERNALSYM BN_F_BN_MPI2BN} + BN_F_BN_MPI2BN = 112; + {$EXTERNALSYM BN_F_BN_NEW} + BN_F_BN_NEW = 113; + {$EXTERNALSYM BN_F_BN_RAND} + BN_F_BN_RAND = 114; + {$EXTERNALSYM BN_F_BN_USUB} + BN_F_BN_USUB = 115; + {$EXTERNALSYM BN_MASK2} + BN_MASK2 = $ffffffff; + {$EXTERNALSYM BN_MASK2h} + BN_MASK2h = $ffff0000; + {$EXTERNALSYM BN_MASK2h1} + BN_MASK2h1 = $ffff8000; + {$EXTERNALSYM BN_MASK2l} + BN_MASK2l = $ffff; + {$EXTERNALSYM BN_R_ARG2_LT_ARG3} + BN_R_ARG2_LT_ARG3 = 100; + {$EXTERNALSYM BN_R_BAD_RECIPROCAL} + BN_R_BAD_RECIPROCAL = 101; + {$EXTERNALSYM BN_R_CALLED_WITH_EVEN_MODULUS} + BN_R_CALLED_WITH_EVEN_MODULUS = 102; + {$EXTERNALSYM BN_R_DIV_BY_ZERO} + BN_R_DIV_BY_ZERO = 103; + {$EXTERNALSYM BN_R_ENCODING_ERROR} + BN_R_ENCODING_ERROR = 104; + {$EXTERNALSYM BN_R_EXPAND_ON_STATIC_BIGNUM_DATA} + BN_R_EXPAND_ON_STATIC_BIGNUM_DATA = 105; + {$EXTERNALSYM BN_R_INVALID_LENGTH} + BN_R_INVALID_LENGTH = 106; + {$EXTERNALSYM BN_R_NOT_INITIALIZED} + BN_R_NOT_INITIALIZED = 107; + {$EXTERNALSYM BN_R_NO_INVERSE} + BN_R_NO_INVERSE = 108; + {$EXTERNALSYM BN_TBIT} + BN_TBIT = $80000000; + {$EXTERNALSYM BUFSIZ} + BUFSIZ = 1024; + {$EXTERNALSYM BUF_F_BUF_MEM_GROW} + BUF_F_BUF_MEM_GROW = 100; + {$EXTERNALSYM BUF_F_BUF_MEM_NEW} + BUF_F_BUF_MEM_NEW = 101; + {$EXTERNALSYM BUF_F_BUF_STRDUP} + BUF_F_BUF_STRDUP = 102; + + //function codes + {$EXTERNALSYM RAND_F_ENG_RAND_GET_RAND_METHOD} + RAND_F_ENG_RAND_GET_RAND_METHOD = 108; + {$EXTERNALSYM RAND_F_FIPS_RAND} + RAND_F_FIPS_RAND = 103; + {$EXTERNALSYM RAND_F_FIPS_RAND_BYTES} + RAND_F_FIPS_RAND_BYTES = 102; + {$EXTERNALSYM RAND_F_FIPS_RAND_GET_RAND_METHOD} + RAND_F_FIPS_RAND_GET_RAND_METHOD = 109; + {$EXTERNALSYM RAND_F_FIPS_RAND_SET_DT} + RAND_F_FIPS_RAND_SET_DT = 106; + {$EXTERNALSYM RAND_F_FIPS_SET_DT} + RAND_F_FIPS_SET_DT = 104; + {$EXTERNALSYM RAND_F_FIPS_SET_PRNG_SEED} + RAND_F_FIPS_SET_PRNG_SEED = 107; + {$EXTERNALSYM RAND_F_FIPS_SET_TEST_MODE} + RAND_F_FIPS_SET_TEST_MODE = 105; + {$EXTERNALSYM RAND_F_RAND_GET_RAND_METHOD} + RAND_F_RAND_GET_RAND_METHOD = 101; + {$EXTERNALSYM RAND_F_SSLEAY_RAND_BYTES} + RAND_F_SSLEAY_RAND_BYTES = 100; + +//* Reason codes. */ + {$EXTERNALSYM RAND_R_NON_FIPS_METHOD} + RAND_R_NON_FIPS_METHOD = 105; + {$EXTERNALSYM RAND_R_NOT_IN_TEST_MODE} + RAND_R_NOT_IN_TEST_MODE = 106; + {$EXTERNALSYM RAND_R_NO_KEY_SET} + RAND_R_NO_KEY_SET = 107; + {$EXTERNALSYM RAND_R_PRNG_ASKING_FOR_TOO_MUCH} + RAND_R_PRNG_ASKING_FOR_TOO_MUCH = 101; + {$EXTERNALSYM RAND_R_PRNG_ERROR} + RAND_R_PRNG_ERROR = 108; + {$EXTERNALSYM RAND_R_PRNG_KEYED} + RAND_R_PRNG_KEYED = 109; + {$EXTERNALSYM RAND_R_PRNG_NOT_REKEYED} + RAND_R_PRNG_NOT_REKEYED = 102; + {$EXTERNALSYM RAND_R_PRNG_NOT_RESEEDED} + RAND_R_PRNG_NOT_RESEEDED = 103; + {$EXTERNALSYM RAND_R_PRNG_NOT_SEEDED} + RAND_R_PRNG_NOT_SEEDED = 100; + {$EXTERNALSYM RAND_R_PRNG_SEED_MUST_NOT_MATCH_KEY} + RAND_R_PRNG_SEED_MUST_NOT_MATCH_KEY = 110; + {$EXTERNALSYM RAND_R_PRNG_STUCK} + RAND_R_PRNG_STUCK = 104; + + {$EXTERNALSYM B_ASN1_BIT_STRING} + B_ASN1_BIT_STRING = $0400; + {$EXTERNALSYM B_ASN1_BMPSTRING} + B_ASN1_BMPSTRING = $0800; + {$EXTERNALSYM B_ASN1_GENERALSTRING} + B_ASN1_GENERALSTRING = $0080; + {$EXTERNALSYM B_ASN1_GRAPHICSTRING} + B_ASN1_GRAPHICSTRING = $0020; + {$EXTERNALSYM B_ASN1_IA5STRING} + B_ASN1_IA5STRING = $0010; + {$EXTERNALSYM B_ASN1_ISO64STRING} + B_ASN1_ISO64STRING = $0040; + {$EXTERNALSYM B_ASN1_NUMERICSTRING} + B_ASN1_NUMERICSTRING = $0001; + {$EXTERNALSYM B_ASN1_OCTET_STRING} + B_ASN1_OCTET_STRING = $0200; + {$EXTERNALSYM B_ASN1_PRINTABLESTRING} + B_ASN1_PRINTABLESTRING = $0002; + {$EXTERNALSYM B_ASN1_T61STRING} + B_ASN1_T61STRING = $0004; + {$EXTERNALSYM B_ASN1_TELETEXSTRING} + B_ASN1_TELETEXSTRING = $0008; + {$EXTERNALSYM B_ASN1_UNIVERSALSTRING} + B_ASN1_UNIVERSALSTRING = $0100; + {$EXTERNALSYM B_ASN1_UNKNOWN} + B_ASN1_UNKNOWN = $1000; + {$EXTERNALSYM B_ASN1_UTF8STRING} + B_ASN1_UTF8STRING = $2000; + {$EXTERNALSYM B_ASN1_VIDEOTEXSTRING} + B_ASN1_VIDEOTEXSTRING = $0008; + {$EXTERNALSYM B_ASN1_VISIBLESTRING} + B_ASN1_VISIBLESTRING = $0040; + {$EXTERNALSYM B_ASN1_UTCTIME} + B_ASN1_UTCTIME = $4000; + {$EXTERNALSYM B_ASN1_GENERALIZEDTIME} + B_ASN1_GENERALIZEDTIME = $8000; + {$EXTERNALSYM B_ASN1_SEQUENCE} + B_ASN1_SEQUENCE = $10000; + {$EXTERNALSYM B_ASN1_TIME} + B_ASN1_TIME = B_ASN1_UTCTIME or + {$EXTERNALSYM B_ASN1_PRINTABLE} + B_ASN1_GENERALIZEDTIME; + + {$EXTERNALSYM B_ASN1_PRINTABLE} + B_ASN1_PRINTABLE = B_ASN1_NUMERICSTRING or + {$EXTERNALSYM B_ASN1_DIRECTORYSTRING} + B_ASN1_PRINTABLESTRING or + {$EXTERNALSYM B_ASN1_DIRECTORYSTRING} + B_ASN1_T61STRING or + {$EXTERNALSYM B_ASN1_DIRECTORYSTRING} + B_ASN1_IA5STRING or + {$EXTERNALSYM B_ASN1_DIRECTORYSTRING} + B_ASN1_BIT_STRING or + {$EXTERNALSYM B_ASN1_DIRECTORYSTRING} + B_ASN1_UNIVERSALSTRING or + {$EXTERNALSYM B_ASN1_DIRECTORYSTRING} + B_ASN1_BMPSTRING or + {$EXTERNALSYM B_ASN1_DIRECTORYSTRING} + B_ASN1_UTF8STRING or + {$EXTERNALSYM B_ASN1_DIRECTORYSTRING} + B_ASN1_SEQUENCE or + {$EXTERNALSYM B_ASN1_DIRECTORYSTRING} + B_ASN1_UNKNOWN; + {$EXTERNALSYM B_ASN1_DIRECTORYSTRING} + B_ASN1_DIRECTORYSTRING = B_ASN1_PRINTABLESTRING or + {$EXTERNALSYM B_ASN1_DISPLAYTEXT} + B_ASN1_TELETEXSTRING or + {$EXTERNALSYM B_ASN1_DISPLAYTEXT} + B_ASN1_BMPSTRING or + {$EXTERNALSYM B_ASN1_DISPLAYTEXT} + B_ASN1_UNIVERSALSTRING or + {$EXTERNALSYM B_ASN1_DISPLAYTEXT} + B_ASN1_UTF8STRING; + {$EXTERNALSYM B_ASN1_DISPLAYTEXT} + B_ASN1_DISPLAYTEXT = B_ASN1_IA5STRING or + {$EXTERNALSYM MBSTRING_FLAG} + B_ASN1_VISIBLESTRING or + {$EXTERNALSYM MBSTRING_FLAG} + B_ASN1_BMPSTRING or + {$EXTERNALSYM MBSTRING_FLAG} + B_ASN1_UTF8STRING; + {$EXTERNALSYM MBSTRING_FLAG} + MBSTRING_FLAG = $1000; + {$EXTERNALSYM MBSTRING_UTF8} + MBSTRING_UTF8 = MBSTRING_FLAG; + {$EXTERNALSYM MBSTRING_ASC} + MBSTRING_ASC = MBSTRING_FLAG or 1; + {$EXTERNALSYM MBSTRING_BMP} + MBSTRING_BMP = MBSTRING_FLAG or 2; + {$EXTERNALSYM MBSTRING_UNIV} + MBSTRING_UNIV = MBSTRING_FLAG or 4; + {$EXTERNALSYM SMIME_OLDMIME} + SMIME_OLDMIME = $400; + {$EXTERNALSYM SMIME_CRLFEOL} + SMIME_CRLFEOL = $800; + {$EXTERNALSYM SMIME_STREAM} + SMIME_STREAM = $1000; + + {$EXTERNALSYM _CLOCKS_PER_SEC_} + _CLOCKS_PER_SEC_ = 1000; + {$EXTERNALSYM _CLOCKS_PER_SEC_} + {$EXTERNALSYM CLOCKS_PER_SEC} + CLOCKS_PER_SEC = _CLOCKS_PER_SEC_; + {$EXTERNALSYM CLOCKS_PER_SEC} + {$EXTERNALSYM CLK_TCK} + CLK_TCK = CLOCKS_PER_SEC; + {$EXTERNALSYM CLK_TCK} +//* Function codes. */ + {$EXTERNALSYM COMP_F_BIO_ZLIB_FLUSH} + COMP_F_BIO_ZLIB_FLUSH = 99; + {$EXTERNALSYM COMP_F_BIO_ZLIB_NEW} + COMP_F_BIO_ZLIB_NEW = 100; + {$EXTERNALSYM COMP_F_BIO_ZLIB_READ} + COMP_F_BIO_ZLIB_READ = 101; + {$EXTERNALSYM COMP_F_BIO_ZLIB_WRITE} + COMP_F_BIO_ZLIB_WRITE = 102; + +//* Reason codes. */ + {$EXTERNALSYM COMP_R_ZLIB_DEFLATE_ERROR} + COMP_R_ZLIB_DEFLATE_ERROR = 99; + {$EXTERNALSYM COMP_R_ZLIB_INFLATE_ERROR} + COMP_R_ZLIB_INFLATE_ERROR = 100; + {$EXTERNALSYM COMP_R_ZLIB_NOT_SUPPORTED} + COMP_R_ZLIB_NOT_SUPPORTED = 101; + + {$EXTERNALSYM CRYPTO_EX_INDEX_BIO} + CRYPTO_EX_INDEX_BIO = 0; + {$EXTERNALSYM CRYPTO_EX_INDEX_SSL} + CRYPTO_EX_INDEX_SSL = 1; + {$EXTERNALSYM CRYPTO_EX_INDEX_SSL_CTX} + CRYPTO_EX_INDEX_SSL_CTX = 2; + {$EXTERNALSYM CRYPTO_EX_INDEX_SSL_SESSION} + CRYPTO_EX_INDEX_SSL_SESSION = 3; + {$EXTERNALSYM CRYPTO_EX_INDEX_X509_STORE} + CRYPTO_EX_INDEX_X509_STORE = 4; + {$EXTERNALSYM CRYPTO_EX_INDEX_X509_STORE_CTX} + CRYPTO_EX_INDEX_X509_STORE_CTX = 5; + {$EXTERNALSYM CRYPTO_EX_INDEX_RSA} + CRYPTO_EX_INDEX_RSA = 6; + {$EXTERNALSYM CRYPTO_EX_INDEX_DSA} + CRYPTO_EX_INDEX_DSA = 7; + {$EXTERNALSYM CRYPTO_EX_INDEX_DH} + CRYPTO_EX_INDEX_DH = 8; + {$EXTERNALSYM CRYPTO_EX_INDEX_ENGINE} + CRYPTO_EX_INDEX_ENGINE = 9; + {$EXTERNALSYM CRYPTO_EX_INDEX_X509} + CRYPTO_EX_INDEX_X509 = 10; + {$EXTERNALSYM CRYPTO_EX_INDEX_UI} + CRYPTO_EX_INDEX_UI = 11; + {$EXTERNALSYM CRYPTO_EX_INDEX_ECDSA} + CRYPTO_EX_INDEX_ECDSA = 12; + {$EXTERNALSYM CRYPTO_EX_INDEX_ECDH} + CRYPTO_EX_INDEX_ECDH = 13; + {$EXTERNALSYM CRYPTO_EX_INDEX_COMP} + CRYPTO_EX_INDEX_COMP = 14; + {$EXTERNALSYM CRYPTO_EX_INDEX_STORE} + CRYPTO_EX_INDEX_STORE = 15; + {$EXTERNALSYM CRYPTO_EX_INDEX_USER} + CRYPTO_EX_INDEX_USER = 100; + + {$EXTERNALSYM CRYPTO_F_CRYPTO_GET_EX_NEW_INDEX} + CRYPTO_F_CRYPTO_GET_EX_NEW_INDEX = 100; + {$EXTERNALSYM CRYPTO_F_CRYPTO_GET_NEW_DYNLOCKID} + CRYPTO_F_CRYPTO_GET_NEW_DYNLOCKID = 103; + {$EXTERNALSYM CRYPTO_F_CRYPTO_GET_NEW_LOCKID} + CRYPTO_F_CRYPTO_GET_NEW_LOCKID = 101; + {$EXTERNALSYM CRYPTO_F_CRYPTO_SET_EX_DATA} + CRYPTO_F_CRYPTO_SET_EX_DATA = 102; + {$EXTERNALSYM CRYPTO_F_DEF_ADD_INDEX} + CRYPTO_F_DEF_ADD_INDEX = 104; + {$EXTERNALSYM CRYPTO_F_DEF_GET_CLASS} + CRYPTO_F_DEF_GET_CLASS = 105; + {$EXTERNALSYM CRYPTO_F_INT_DUP_EX_DATA} + CRYPTO_F_INT_DUP_EX_DATA = 106; + {$EXTERNALSYM CRYPTO_F_INT_FREE_EX_DATA} + CRYPTO_F_INT_FREE_EX_DATA = 107; + {$EXTERNALSYM CRYPTO_F_INT_NEW_EX_DATA} + CRYPTO_F_INT_NEW_EX_DATA = 108; + {$EXTERNALSYM CRYPTO_R_NO_DYNLOCK_CREATE_CALLBACK} + CRYPTO_R_NO_DYNLOCK_CREATE_CALLBACK = 100; + + {$EXTERNALSYM CRYPTO_LOCK} + CRYPTO_LOCK = 1; + {$EXTERNALSYM CRYPTO_LOCK_ERR} + CRYPTO_LOCK_ERR = 1; + {$EXTERNALSYM CRYPTO_LOCK_ERR_HASH} + CRYPTO_LOCK_ERR_HASH = 2; + {$EXTERNALSYM CRYPTO_LOCK_X509} + CRYPTO_LOCK_X509 = 3; + {$EXTERNALSYM CRYPTO_LOCK_X509_INFO} + CRYPTO_LOCK_X509_INFO = 4; + {$EXTERNALSYM CRYPTO_LOCK_X509_PKEY} + CRYPTO_LOCK_X509_PKEY = 5; + {$EXTERNALSYM CRYPTO_LOCK_X509_CRL} + CRYPTO_LOCK_X509_CRL = 6; + {$EXTERNALSYM CRYPTO_LOCK_X509_REQ} + CRYPTO_LOCK_X509_REQ = 7; + {$EXTERNALSYM CRYPTO_LOCK_DSA} + CRYPTO_LOCK_DSA = 8; + {$EXTERNALSYM CRYPTO_LOCK_RSA} + CRYPTO_LOCK_RSA = 9; + {$EXTERNALSYM CRYPTO_LOCK_EVP_PKEY} + CRYPTO_LOCK_EVP_PKEY = 10; + {$EXTERNALSYM CRYPTO_LOCK_X509_STORE} + CRYPTO_LOCK_X509_STORE = 11; + {$EXTERNALSYM CRYPTO_LOCK_SSL_CTX} + CRYPTO_LOCK_SSL_CTX = 12; + {$EXTERNALSYM CRYPTO_LOCK_SSL_CERT} + CRYPTO_LOCK_SSL_CERT = 13; + {$EXTERNALSYM CRYPTO_LOCK_SSL_SESSION} + CRYPTO_LOCK_SSL_SESSION = 14; + {$EXTERNALSYM CRYPTO_LOCK_SSL_SESS_CERT} + CRYPTO_LOCK_SSL_SESS_CERT = 15; + {$EXTERNALSYM CRYPTO_LOCK_SSL} + CRYPTO_LOCK_SSL = 16; + {$EXTERNALSYM CRYPTO_LOCK_SSL_METHOD} + CRYPTO_LOCK_SSL_METHOD = 17; + {$EXTERNALSYM CRYPTO_LOCK_RAND} + CRYPTO_LOCK_RAND = 18; +// CRYPTO_LOCK_RAND = 17; + {$EXTERNALSYM CRYPTO_LOCK_RAND2} + CRYPTO_LOCK_RAND2 = 19; + {$EXTERNALSYM CRYPTO_LOCK_MALLOC} + CRYPTO_LOCK_MALLOC = 20; +//was CRYPTO_LOCK_MALLOC = 18; + {$EXTERNALSYM CRYPTO_LOCK_BIO} + CRYPTO_LOCK_BIO = 21; +//was CRYPTO_LOCK_BIO = 19; + {$EXTERNALSYM CRYPTO_LOCK_GETHOSTBYNAME} + CRYPTO_LOCK_GETHOSTBYNAME = 22; +//was CRYPTO_LOCK_GETHOSTBYNAME = 20; + {$EXTERNALSYM CRYPTO_LOCK_GETSERVBYNAME} + CRYPTO_LOCK_GETSERVBYNAME = 23; +//was CRYPTO_LOCK_GETSERVBYNAME = 21; + {$EXTERNALSYM CRYPTO_LOCK_READDIR} + CRYPTO_LOCK_READDIR = 24; +//was CRYPTO_LOCK_READDIR = 22; + {$EXTERNALSYM CRYPTO_LOCK_RSA_BLINDING} + CRYPTO_LOCK_RSA_BLINDING = 25; +//was CRYPTO_LOCK_RSA_BLINDING = 23; + {$EXTERNALSYM CRYPTO_LOCK_DH} + CRYPTO_LOCK_DH = 26; + {$EXTERNALSYM CRYPTO_LOCK_MALLOC2} + CRYPTO_LOCK_MALLOC2 = 27; + {$EXTERNALSYM CRYPTO_LOCK_DSO} + CRYPTO_LOCK_DSO = 28; + {$EXTERNALSYM CRYPTO_LOCK_DYNLOCK} + CRYPTO_LOCK_DYNLOCK = 29; + {$EXTERNALSYM CRYPTO_LOCK_ENGINE} + CRYPTO_LOCK_ENGINE = 30; + {$EXTERNALSYM CRYPTO_LOCK_UI} + CRYPTO_LOCK_UI = 31; + {$EXTERNALSYM CRYPTO_LOCK_ECDSA} + CRYPTO_LOCK_ECDSA = 32; + {$EXTERNALSYM CRYPTO_LOCK_EC} + CRYPTO_LOCK_EC = 33; + {$EXTERNALSYM CRYPTO_LOCK_ECDH} + CRYPTO_LOCK_ECDH = 34; + {$EXTERNALSYM CRYPTO_LOCK_BN} + CRYPTO_LOCK_BN = 35; + {$EXTERNALSYM CRYPTO_LOCK_EC_PRE_COMP} + CRYPTO_LOCK_EC_PRE_COMP = 36; + {$EXTERNALSYM CRYPTO_LOCK_STORE} + CRYPTO_LOCK_STORE = 37; + {$EXTERNALSYM CRYPTO_LOCK_COMP} + CRYPTO_LOCK_COMP = 38; + {$IFNDEF OPENSSL_FIPS} + {$EXTERNALSYM CRYPTO_NUM_LOCKS} + CRYPTO_NUM_LOCKS = 39; +// was OPENSSL_CRYPTO_NUM_LOCKS = 24; + {$ELSE} + {$EXTERNALSYM CRYPTO_LOCK_FIPS} + CRYPTO_LOCK_FIPS = 39; + {$EXTERNALSYM CRYPTO_LOCK_FIPS2} + CRYPTO_LOCK_FIPS2 = 40; + {$EXTERNALSYM CRYPTO_NUM_LOCKS} + CRYPTO_NUM_LOCKS = 41; + {$ENDIF} + {$EXTERNALSYM CRYPTO_MEM_CHECK_DISABLE} + CRYPTO_MEM_CHECK_DISABLE = $3; + {$EXTERNALSYM CRYPTO_MEM_CHECK_ENABLE} + CRYPTO_MEM_CHECK_ENABLE = $2; + {$EXTERNALSYM CRYPTO_MEM_CHECK_OFF} + CRYPTO_MEM_CHECK_OFF = $0; + {$EXTERNALSYM CRYPTO_MEM_CHECK_ON} + CRYPTO_MEM_CHECK_ON = $1; + {$EXTERNALSYM CRYPTO_READ} + CRYPTO_READ = 4; + {$EXTERNALSYM CRYPTO_UNLOCK} + CRYPTO_UNLOCK = 2; + {$EXTERNALSYM CRYPTO_WRITE} + CRYPTO_WRITE = 8; + {$EXTERNALSYM V_CRYPTO_MDEBUG_TIME} + V_CRYPTO_MDEBUG_TIME = $1; + {$EXTERNALSYM V_CRYPTO_MDEBUG_THREAD} + V_CRYPTO_MDEBUG_THREAD = $2; + {$IFNDEF OPENSSL_NO_AES} + {$EXTERNALSYM AES_ENCRYPT} + AES_ENCRYPT = 1; + {$EXTERNALSYM AES_DECRYPT} + AES_DECRYPT = 0; + {$EXTERNALSYM AES_MAXNR} + AES_MAXNR = 14; + {$EXTERNALSYM AES_BLOCK_SIZE} + AES_BLOCK_SIZE = 16; + {$ENDIF} +//* These values are used as commands to DSO_ctrl() */ + {$EXTERNALSYM DSO_CTRL_GET_FLAGS} + DSO_CTRL_GET_FLAGS = 1; + {$EXTERNALSYM DSO_CTRL_SET_FLAGS} + DSO_CTRL_SET_FLAGS = 2; + {$EXTERNALSYM DSO_CTRL_OR_FLAGS} + DSO_CTRL_OR_FLAGS = 3; + +///* By default, DSO_load() will translate the provided filename into a form +// * typical for the platform (more specifically the DSO_METHOD) using the +// * dso_name_converter function of the method. Eg. win32 will transform "blah" +// * into "blah.dll", and dlfcn will transform it into "libblah.so". The +// * behaviour can be overriden by setting the name_converter callback in the DSO +// * object (using DSO_set_name_converter()). This callback could even utilise +// * the DSO_METHOD's converter too if it only wants to override behaviour for +// * one or two possible DSO methods. However, the following flag can be set in a +// * DSO to prevent *any* native name-translation at all - eg. if the caller has +// * prompted the user for a path to a driver library so the filename should be +// * interpreted as-is. */ + {$EXTERNALSYM DSO_FLAG_NO_NAME_TRANSLATION} + DSO_FLAG_NO_NAME_TRANSLATION = $01; +///* An extra flag to give if only the extension should be added as +// * translation. This is obviously only of importance on Unix and +// * other operating systems where the translation also may prefix +// * the name with something, like 'lib', and ignored everywhere else. +// * This flag is also ignored if DSO_FLAG_NO_NAME_TRANSLATION is used +// * at the same time. */ + {$EXTERNALSYM DSO_FLAG_NAME_TRANSLATION_EXT_ONLY} + DSO_FLAG_NAME_TRANSLATION_EXT_ONLY = $02; + +///* The following flag controls the translation of symbol names to upper +// * case. This is currently only being implemented for OpenVMS. +// */ + {$EXTERNALSYM DSO_FLAG_UPCASE_SYMBOL} + DSO_FLAG_UPCASE_SYMBOL = $10; + +//* This flag loads the library with public symbols. +// * Meaning: The exported symbols of this library are public +// * to all libraries loaded after this library. +// * At the moment only implemented in unix. +// */ + {$EXTERNALSYM DSO_FLAG_GLOBAL_SYMBOLS} + DSO_FLAG_GLOBAL_SYMBOLS = $20; + //seed.h + {$IFNDEF OPENSSL_NO_SEED} + {$IFDEF AES_LONG} //* look whether we need 'long' to get 32 bits */ + {$DEFINE SEED_LONG} + {$ENDIF} + {$EXTERNALSYM SEED_BLOCK_SIZE} + SEED_BLOCK_SIZE = 16; + {$EXTERNALSYM SEED_KEY_LENGTH} + SEED_KEY_LENGTH = 16; + {$ENDIF} + {$IFNDEF OPENSSL_NO_CAST} + {$EXTERNALSYM CAST_BLOCK} + CAST_BLOCK = 8; + {$EXTERNALSYM CAST_DECRYPT} + CAST_DECRYPT = 0; + {$EXTERNALSYM CAST_ENCRYPT} + CAST_ENCRYPT = 1; + {$EXTERNALSYM CAST_KEY_LENGTH} + CAST_KEY_LENGTH = 16; + {$ENDIF} + {$IFNDEF OPENSSL_NO_DES} + {$EXTERNALSYM DES_CBC_MODE} + DES_CBC_MODE = 0; + {$EXTERNALSYM DES_DECRYPT} + DES_DECRYPT = 0; + {$EXTERNALSYM DES_ENCRYPT} + DES_ENCRYPT = 1; + {$EXTERNALSYM DES_PCBC_MODE} + DES_PCBC_MODE = 1; + {$ENDIF} + {$IFNDEF OPENSSL_NO_DH} + //the OpenSSL developers probably only wanted to make sure this was defined. + {$EXTERNALSYM DH_MAX_MODULUS_BITS} + DH_MAX_MODULUS_BITS = 10000; + {$EXTERNALSYM DH_FIPS_MIN_MODULUS_BITS} + DH_FIPS_MIN_MODULUS_BITS = 1024; + {$EXTERNALSYM DH_FLAG_CACHE_MONT_P} + DH_FLAG_CACHE_MONT_P = $01; + {$EXTERNALSYM DH_FLAG_NO_EXP_CONSTTIME} + DH_FLAG_NO_EXP_CONSTTIME = $02; + {$EXTERNALSYM DH_GENERATOR_2} + DH_GENERATOR_2 = 2; + {$EXTERNALSYM DH_GENERATOR_5} + DH_GENERATOR_5 = 5; + {$EXTERNALSYM DH_CHECK_P_NOT_PRIME} + DH_CHECK_P_NOT_PRIME = $01; + {$EXTERNALSYM DH_CHECK_P_NOT_STRONG_PRIME} + DH_CHECK_P_NOT_STRONG_PRIME = $02; + {$EXTERNALSYM DH_UNABLE_TO_CHECK_GENERATOR} + DH_UNABLE_TO_CHECK_GENERATOR = $04; + {$EXTERNALSYM DH_NOT_SUITABLE_GENERATOR} + DH_NOT_SUITABLE_GENERATOR = $08; + {$EXTERNALSYM DH_CHECK_PUBKEY_TOO_SMALL} + DH_CHECK_PUBKEY_TOO_SMALL = $01; + {$EXTERNALSYM DH_CHECK_PUBKEY_TOO_LARGE} + DH_CHECK_PUBKEY_TOO_LARGE = $02; + {$EXTERNALSYM DH_CHECK_P_NOT_SAFE_PRIME} + DH_CHECK_P_NOT_SAFE_PRIME = DH_CHECK_P_NOT_STRONG_PRIME; + {$EXTERNALSYM DH_F_DHPARAMS_PRINT} + DH_F_DHPARAMS_PRINT = 100; + {$EXTERNALSYM DH_F_DHPARAMS_PRINT_FP} + DH_F_DHPARAMS_PRINT_FP = 101; + {$EXTERNALSYM DH_F_COMPUTE_KEY} + DH_F_COMPUTE_KEY = 102; + {$EXTERNALSYM DH_F_GENERATE_KEY} + DH_F_GENERATE_KEY = 103; + {$EXTERNALSYM DH_F_GENERATE_PARAMETERS} + DH_F_GENERATE_PARAMETERS = 104; + {$EXTERNALSYM DH_F_DH_NEW_METHOD} + DH_F_DH_NEW_METHOD = 105; + {$EXTERNALSYM DH_F_DH_NEW} + DH_F_DH_NEW = 105; + {$EXTERNALSYM DH_F_DH_BUILTIN_GENPARAMS} + DH_F_DH_BUILTIN_GENPARAMS = 106; + {$EXTERNALSYM DH_F_DH_COMPUTE_KEY} + DH_F_DH_COMPUTE_KEY = 107; + //was DH_F_DH_COMPUTE_KEY = 102; + {$EXTERNALSYM DH_F_DH_GENERATE_KEY} + DH_F_DH_GENERATE_KEY = 108; + //was DH_F_DH_GENERATE_KEY = 103; + {$EXTERNALSYM DH_F_DH_GENERATE_PARAMETERS} + DH_F_DH_GENERATE_PARAMETERS = 109; + //was DH_F_DH_GENERATE_PARAMETERS = 104; + {$EXTERNALSYM DH_R_NO_PRIVATE_VALUE} + DH_R_NO_PRIVATE_VALUE = 100; + {$EXTERNALSYM DH_R_BAD_GENERATOR} + DH_R_BAD_GENERATOR = 101; + {$EXTERNALSYM DH_R_INVALID_PUBKEY} + DH_R_INVALID_PUBKEY = 102; + {$EXTERNALSYM DH_R_MODULUS_TOO_LARGE} + DH_R_MODULUS_TOO_LARGE = 103; + {$EXTERNALSYM DH_R_KEY_SIZE_TOO_SMALL} + DH_R_KEY_SIZE_TOO_SMALL = 104; + {$ENDIF} + {$IFNDEF OPENSSL_NO_DSA} + //I think the OpenSSL developers wanted to make sure this was defined. + {$EXTERNALSYM DSA_MAX_MODULUS_BITS} + DSA_MAX_MODULUS_BITS = 10000; + {$EXTERNALSYM DSA_FIPS_MIN_MODULUS_BITS} + DSA_FIPS_MIN_MODULUS_BITS = 1024; + {$EXTERNALSYM DSA_FLAG_CACHE_MONT_P} + DSA_FLAG_CACHE_MONT_P = $01; + {$EXTERNALSYM DSA_FLAG_NO_EXP_CONSTTIME} + DSA_FLAG_NO_EXP_CONSTTIME = $02; //* new with 0.9.7h; the built-in DSA +///* If this flag is set the DSA method is FIPS compliant and can be used +// * in FIPS mode. This is set in the validated module method. If an +// * application sets this flag in its own methods it is its reposibility +// * to ensure the result is compliant. +// */ + {$EXTERNALSYM DSA_FLAG_FIPS_METHOD} + DSA_FLAG_FIPS_METHOD = $0400; +///* If this flag is set the operations normally disabled in FIPS mode are +// * permitted it is then the applications responsibility to ensure that the +// * usage is compliant. +// */ + {$EXTERNALSYM DSA_FLAG_NON_FIPS_ALLOW} + DSA_FLAG_NON_FIPS_ALLOW = $0400; + {$EXTERNALSYM DSA_F_D2I_DSA_SIG} + DSA_F_D2I_DSA_SIG = 110; + {$EXTERNALSYM DSA_F_DSAPARAMS_PRINT} + DSA_F_DSAPARAMS_PRINT = 100; + {$EXTERNALSYM DSA_F_DSAPARAMS_PRINT_FP} + DSA_F_DSAPARAMS_PRINT_FP = 101; + {$EXTERNALSYM DSA_F_DSA_BUILTIN_KEYGEN} + DSA_F_DSA_BUILTIN_KEYGEN = 119; + {$EXTERNALSYM DSA_F_DSA_BUILTIN_PARAMGEN} + DSA_F_DSA_BUILTIN_PARAMGEN = 118; + {$EXTERNALSYM DSA_F_DSA_DO_SIGN} + DSA_F_DSA_DO_SIGN = 112; + {$EXTERNALSYM DSA_F_DSA_DO_VERIFY} + DSA_F_DSA_DO_VERIFY = 113; + {$EXTERNALSYM DSA_F_DSA_IS_PRIME} + DSA_F_DSA_IS_PRIME = 102; + {$EXTERNALSYM DSA_F_DSA_NEW} + DSA_F_DSA_NEW = 103; + {$EXTERNALSYM DSA_F_DSA_PRINT} + DSA_F_DSA_PRINT = 104; + {$EXTERNALSYM DSA_F_DSA_PRINT_FP} + DSA_F_DSA_PRINT_FP = 105; + {$EXTERNALSYM DSA_F_DSA_SIGN} + DSA_F_DSA_SIGN = 106; + {$EXTERNALSYM DSA_F_DSA_SIGN_SETUP} + DSA_F_DSA_SIGN_SETUP = 107; + {$EXTERNALSYM DSA_F_DSA_SIG_NEW} + DSA_F_DSA_SIG_NEW = 109; + {$EXTERNALSYM DSA_F_DSA_VERIFY} + DSA_F_DSA_VERIFY = 108; + {$EXTERNALSYM DSA_F_DSA_GENERATE_PARAMETERS} + DSA_F_DSA_GENERATE_PARAMETERS = 117; + {$EXTERNALSYM DSA_F_I2D_DSA_SIG} + DSA_F_I2D_DSA_SIG = 111; + {$EXTERNALSYM DSA_F_SIG_CB} + DSA_F_SIG_CB = 114; + {$EXTERNALSYM DSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE} + DSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE = 100; + {$EXTERNALSYM DSA_R_MISSING_PARAMETERS} + DSA_R_MISSING_PARAMETERS = 101; + {$EXTERNALSYM DSA_R_BAD_Q_VALUE} + DSA_R_BAD_Q_VALUE = 102; + {$EXTERNALSYM DSA_R_MODULUS_TOO_LARGE} + DSA_R_MODULUS_TOO_LARGE = 103; + {$EXTERNALSYM DSA_R_NON_FIPS_METHOD} + DSA_R_NON_FIPS_METHOD = 104; + {$EXTERNALSYM DSA_R_OPERATION_NOT_ALLOWED_IN_FIPS_MODE} + DSA_R_OPERATION_NOT_ALLOWED_IN_FIPS_MODE = 105; + {$EXTERNALSYM DSA_R_KEY_SIZE_TOO_SMALL} + DSA_R_KEY_SIZE_TOO_SMALL = 106; + {$ENDIF} + {$IFNDEF NO_EC} + {$EXTERNALSYM ECC_MAX_FIELD_BITS} + ECC_MAX_FIELD_BITS = 661; + {$EXTERNALSYM EC_NAMED_CURVE} + EC_NAMED_CURVE = $001; + {$EXTERNALSYM POINT_CONVERSION_COMPRESSED} + POINT_CONVERSION_COMPRESSED = 2; + {$EXTERNALSYM POINT_CONVERSION_UNCOMPRESSED} + POINT_CONVERSION_UNCOMPRESSED = 4; + {$EXTERNALSYM POINT_CONVERSION_HYBRID} + POINT_CONVERSION_HYBRID = 6; + {$EXTERNALSYM EC_PKEY_NO_PARAMETERS} + EC_PKEY_NO_PARAMETERS = $001; + {$EXTERNALSYM EC_PKEY_NO_PUBKEY} + EC_PKEY_NO_PUBKEY = $002; +//* Error codes for the EC functions. */ +//* Function codes. */ + {$EXTERNALSYM EC_F_COMPUTE_WNAF} + EC_F_COMPUTE_WNAF = 143; + {$EXTERNALSYM EC_F_D2I_ECPARAMETERS} + EC_F_D2I_ECPARAMETERS = 144; + {$EXTERNALSYM EC_F_D2I_ECPKPARAMETERS} + EC_F_D2I_ECPKPARAMETERS = 145; + {$EXTERNALSYM EC_F_D2I_ECPRIVATEKEY} + EC_F_D2I_ECPRIVATEKEY = 146; + {$EXTERNALSYM EC_F_ECPARAMETERS_PRINT} + EC_F_ECPARAMETERS_PRINT = 147; + {$EXTERNALSYM EC_F_ECPARAMETERS_PRINT_FP} + EC_F_ECPARAMETERS_PRINT_FP = 148; + {$EXTERNALSYM EC_F_ECPKPARAMETERS_PRINT} + EC_F_ECPKPARAMETERS_PRINT = 149; + {$EXTERNALSYM EC_F_ECPKPARAMETERS_PRINT_FP} + EC_F_ECPKPARAMETERS_PRINT_FP = 150; + {$EXTERNALSYM EC_F_ECP_NIST_MOD_192} + EC_F_ECP_NIST_MOD_192 = 203; + {$EXTERNALSYM EC_F_ECP_NIST_MOD_224} + EC_F_ECP_NIST_MOD_224 = 204; + {$EXTERNALSYM EC_F_ECP_NIST_MOD_256} + EC_F_ECP_NIST_MOD_256 = 205; + {$EXTERNALSYM EC_F_ECP_NIST_MOD_521} + EC_F_ECP_NIST_MOD_521 = 206; + {$EXTERNALSYM EC_F_EC_ASN1_GROUP2CURVE} + EC_F_EC_ASN1_GROUP2CURVE = 153; + {$EXTERNALSYM EC_F_EC_ASN1_GROUP2FIELDID} + EC_F_EC_ASN1_GROUP2FIELDID = 154; + {$EXTERNALSYM EC_F_EC_ASN1_GROUP2PARAMETERS} + EC_F_EC_ASN1_GROUP2PARAMETERS = 155; + {$EXTERNALSYM EC_F_EC_ASN1_GROUP2PKPARAMETERS} + EC_F_EC_ASN1_GROUP2PKPARAMETERS = 156; + {$EXTERNALSYM EC_F_EC_ASN1_PARAMETERS2GROUP} + EC_F_EC_ASN1_PARAMETERS2GROUP = 157; + {$EXTERNALSYM EC_F_EC_ASN1_PKPARAMETERS2GROUP} + EC_F_EC_ASN1_PKPARAMETERS2GROUP = 158; + {$EXTERNALSYM EC_F_EC_EX_DATA_SET_DATA} + EC_F_EC_EX_DATA_SET_DATA = 211; + {$EXTERNALSYM EC_F_EC_GF2M_MONTGOMERY_POINT_MULTIPLY} + EC_F_EC_GF2M_MONTGOMERY_POINT_MULTIPLY = 208; + {$EXTERNALSYM EC_F_EC_GF2M_SIMPLE_GROUP_CHECK_DISCRIMINANT} + EC_F_EC_GF2M_SIMPLE_GROUP_CHECK_DISCRIMINANT = 159; + {$EXTERNALSYM EC_F_EC_GF2M_SIMPLE_GROUP_SET_CURVE} + EC_F_EC_GF2M_SIMPLE_GROUP_SET_CURVE = 195; + {$EXTERNALSYM EC_F_EC_GF2M_SIMPLE_OCT2POINT} + EC_F_EC_GF2M_SIMPLE_OCT2POINT = 160; + {$EXTERNALSYM EC_F_EC_GF2M_SIMPLE_POINT2OCT} + EC_F_EC_GF2M_SIMPLE_POINT2OCT = 161; + {$EXTERNALSYM EC_F_EC_GF2M_SIMPLE_POINT_GET_AFFINE_COORDINATES} + EC_F_EC_GF2M_SIMPLE_POINT_GET_AFFINE_COORDINATES = 162; + {$EXTERNALSYM EC_F_EC_GF2M_SIMPLE_POINT_SET_AFFINE_COORDINATES} + EC_F_EC_GF2M_SIMPLE_POINT_SET_AFFINE_COORDINATES = 163; + {$EXTERNALSYM EC_F_EC_GF2M_SIMPLE_SET_COMPRESSED_COORDINATES} + EC_F_EC_GF2M_SIMPLE_SET_COMPRESSED_COORDINATES = 164; + {$EXTERNALSYM EC_F_EC_GFP_MONT_FIELD_DECODE} + EC_F_EC_GFP_MONT_FIELD_DECODE = 133; + {$EXTERNALSYM EC_F_EC_GFP_MONT_FIELD_ENCODE} + EC_F_EC_GFP_MONT_FIELD_ENCODE = 134; + {$EXTERNALSYM EC_F_EC_GFP_MONT_FIELD_MUL} + EC_F_EC_GFP_MONT_FIELD_MUL = 131; + {$EXTERNALSYM EC_F_EC_GFP_MONT_FIELD_SET_TO_ONE} + EC_F_EC_GFP_MONT_FIELD_SET_TO_ONE = 209; + {$EXTERNALSYM EC_F_EC_GFP_MONT_FIELD_SQR} + EC_F_EC_GFP_MONT_FIELD_SQR = 132; + {$EXTERNALSYM EC_F_EC_GFP_MONT_GROUP_SET_CURVE} + EC_F_EC_GFP_MONT_GROUP_SET_CURVE = 189; + {$EXTERNALSYM EC_F_EC_GFP_MONT_GROUP_SET_CURVE_GFP} + EC_F_EC_GFP_MONT_GROUP_SET_CURVE_GFP = 135; + {$EXTERNALSYM EC_F_EC_GFP_NIST_FIELD_MUL} + EC_F_EC_GFP_NIST_FIELD_MUL = 200; + {$EXTERNALSYM EC_F_EC_GFP_NIST_FIELD_SQR} + EC_F_EC_GFP_NIST_FIELD_SQR = 201; + {$EXTERNALSYM EC_F_EC_GFP_NIST_GROUP_SET_CURVE} + EC_F_EC_GFP_NIST_GROUP_SET_CURVE = 202; + {$EXTERNALSYM EC_F_EC_GFP_SIMPLE_GROUP_CHECK_DISCRIMINANT} + EC_F_EC_GFP_SIMPLE_GROUP_CHECK_DISCRIMINANT = 165; + {$EXTERNALSYM EC_F_EC_GFP_SIMPLE_GROUP_SET_CURVE} + EC_F_EC_GFP_SIMPLE_GROUP_SET_CURVE = 166; + {$EXTERNALSYM EC_F_EC_GFP_SIMPLE_GROUP_SET_CURVE_GFP} + EC_F_EC_GFP_SIMPLE_GROUP_SET_CURVE_GFP = 100; + {$EXTERNALSYM EC_F_EC_GFP_SIMPLE_GROUP_SET_GENERATOR} + EC_F_EC_GFP_SIMPLE_GROUP_SET_GENERATOR = 101; + {$EXTERNALSYM EC_F_EC_GFP_SIMPLE_MAKE_AFFINE} + EC_F_EC_GFP_SIMPLE_MAKE_AFFINE = 102; + {$EXTERNALSYM EC_F_EC_GFP_SIMPLE_OCT2POINT} + EC_F_EC_GFP_SIMPLE_OCT2POINT = 103; + {$EXTERNALSYM EC_F_EC_GFP_SIMPLE_POINT2OCT} + EC_F_EC_GFP_SIMPLE_POINT2OCT = 104; + {$EXTERNALSYM EC_F_EC_GFP_SIMPLE_POINTS_MAKE_AFFINE} + EC_F_EC_GFP_SIMPLE_POINTS_MAKE_AFFINE = 137; + {$EXTERNALSYM EC_F_EC_GFP_SIMPLE_POINT_GET_AFFINE_COORDINATES} + EC_F_EC_GFP_SIMPLE_POINT_GET_AFFINE_COORDINATES = 167; + {$EXTERNALSYM EC_F_EC_GFP_SIMPLE_POINT_GET_AFFINE_COORDINATES_GFP} + EC_F_EC_GFP_SIMPLE_POINT_GET_AFFINE_COORDINATES_GFP = 105; + {$EXTERNALSYM EC_F_EC_GFP_SIMPLE_POINT_SET_AFFINE_COORDINATES} + EC_F_EC_GFP_SIMPLE_POINT_SET_AFFINE_COORDINATES = 168; + {$EXTERNALSYM EC_F_EC_GFP_SIMPLE_POINT_SET_AFFINE_COORDINATES_GFP} + EC_F_EC_GFP_SIMPLE_POINT_SET_AFFINE_COORDINATES_GFP = 128; + {$EXTERNALSYM EC_F_EC_GFP_SIMPLE_SET_COMPRESSED_COORDINATES} + EC_F_EC_GFP_SIMPLE_SET_COMPRESSED_COORDINATES = 169; + {$EXTERNALSYM EC_F_EC_GFP_SIMPLE_SET_COMPRESSED_COORDINATES_GFP} + EC_F_EC_GFP_SIMPLE_SET_COMPRESSED_COORDINATES_GFP = 129; + {$EXTERNALSYM EC_F_EC_GROUP_CHECK} + EC_F_EC_GROUP_CHECK = 170; + {$EXTERNALSYM EC_F_EC_GROUP_CHECK_DISCRIMINANT} + EC_F_EC_GROUP_CHECK_DISCRIMINANT = 171; + {$EXTERNALSYM EC_F_EC_GROUP_COPY} + EC_F_EC_GROUP_COPY = 106; + {$EXTERNALSYM EC_F_EC_GROUP_GET0_GENERATOR} + EC_F_EC_GROUP_GET0_GENERATOR = 139; + {$EXTERNALSYM EC_F_EC_GROUP_GET_COFACTOR} + EC_F_EC_GROUP_GET_COFACTOR = 140; + {$EXTERNALSYM EC_F_EC_GROUP_GET_CURVE_GF2M} + EC_F_EC_GROUP_GET_CURVE_GF2M = 172; + {$EXTERNALSYM EC_F_EC_GROUP_GET_CURVE_GFP} + EC_F_EC_GROUP_GET_CURVE_GFP = 130; + {$EXTERNALSYM EC_F_EC_GROUP_GET_DEGREE} + EC_F_EC_GROUP_GET_DEGREE = 173; + {$EXTERNALSYM EC_F_EC_GROUP_GET_ORDER} + EC_F_EC_GROUP_GET_ORDER = 141; + {$EXTERNALSYM EC_F_EC_GROUP_GET_PENTANOMIAL_BASIS} + EC_F_EC_GROUP_GET_PENTANOMIAL_BASIS = 193; + {$EXTERNALSYM EC_F_EC_GROUP_GET_TRINOMIAL_BASIS} + EC_F_EC_GROUP_GET_TRINOMIAL_BASIS = 194; + {$EXTERNALSYM EC_F_EC_GROUP_NEW} + EC_F_EC_GROUP_NEW = 108; + {$EXTERNALSYM EC_F_EC_GROUP_NEW_BY_CURVE_NAME} + EC_F_EC_GROUP_NEW_BY_CURVE_NAME = 174; + {$EXTERNALSYM EC_F_EC_GROUP_NEW_FROM_DATA} + EC_F_EC_GROUP_NEW_FROM_DATA = 175; + {$EXTERNALSYM EC_F_EC_GROUP_PRECOMPUTE_MULT} + EC_F_EC_GROUP_PRECOMPUTE_MULT = 142; + {$EXTERNALSYM EC_F_EC_GROUP_SET_CURVE_GF2M} + EC_F_EC_GROUP_SET_CURVE_GF2M = 176; + {$EXTERNALSYM EC_F_EC_GROUP_SET_CURVE_GFP} + EC_F_EC_GROUP_SET_CURVE_GFP = 109; + {$EXTERNALSYM EC_F_EC_GROUP_SET_EXTRA_DATA} + EC_F_EC_GROUP_SET_EXTRA_DATA = 110; + {$EXTERNALSYM EC_F_EC_GROUP_SET_GENERATOR} + EC_F_EC_GROUP_SET_GENERATOR = 111; + {$EXTERNALSYM EC_F_EC_KEY_CHECK_KEY} + EC_F_EC_KEY_CHECK_KEY = 177; + {$EXTERNALSYM EC_F_EC_KEY_COPY} + EC_F_EC_KEY_COPY = 178; + {$EXTERNALSYM EC_F_EC_KEY_GENERATE_KEY} + EC_F_EC_KEY_GENERATE_KEY = 179; + {$EXTERNALSYM EC_F_EC_KEY_NEW} + EC_F_EC_KEY_NEW = 182; + {$EXTERNALSYM EC_F_EC_KEY_PRINT} + EC_F_EC_KEY_PRINT = 180; + {$EXTERNALSYM EC_F_EC_KEY_PRINT_FP} + EC_F_EC_KEY_PRINT_FP = 181; + {$EXTERNALSYM EC_F_EC_POINTS_MAKE_AFFINE} + EC_F_EC_POINTS_MAKE_AFFINE = 136; + {$EXTERNALSYM EC_F_EC_POINTS_MUL} + EC_F_EC_POINTS_MUL = 138; + {$EXTERNALSYM EC_F_EC_POINT_ADD} + EC_F_EC_POINT_ADD = 112; + {$EXTERNALSYM EC_F_EC_POINT_CMP} + EC_F_EC_POINT_CMP = 113; + {$EXTERNALSYM EC_F_EC_POINT_COPY} + EC_F_EC_POINT_COPY = 114; + {$EXTERNALSYM EC_F_EC_POINT_DBL} + EC_F_EC_POINT_DBL = 115; + {$EXTERNALSYM EC_F_EC_POINT_GET_AFFINE_COORDINATES_GF2M} + EC_F_EC_POINT_GET_AFFINE_COORDINATES_GF2M = 183; + {$EXTERNALSYM EC_F_EC_POINT_GET_AFFINE_COORDINATES_GFP} + EC_F_EC_POINT_GET_AFFINE_COORDINATES_GFP = 116; + {$EXTERNALSYM EC_F_EC_POINT_GET_JPROJECTIVE_COORDINATES_GFP} + EC_F_EC_POINT_GET_JPROJECTIVE_COORDINATES_GFP = 117; + {$EXTERNALSYM EC_F_EC_POINT_INVERT} + EC_F_EC_POINT_INVERT = 210; + {$EXTERNALSYM EC_F_EC_POINT_IS_AT_INFINITY} + EC_F_EC_POINT_IS_AT_INFINITY = 118; + {$EXTERNALSYM EC_F_EC_POINT_IS_ON_CURVE} + EC_F_EC_POINT_IS_ON_CURVE = 119; + {$EXTERNALSYM EC_F_EC_POINT_MAKE_AFFINE} + EC_F_EC_POINT_MAKE_AFFINE = 120; + {$EXTERNALSYM EC_F_EC_POINT_MUL} + EC_F_EC_POINT_MUL = 184; + {$EXTERNALSYM EC_F_EC_POINT_NEW} + EC_F_EC_POINT_NEW = 121; + {$EXTERNALSYM EC_F_EC_POINT_OCT2POINT} + EC_F_EC_POINT_OCT2POINT = 122; + {$EXTERNALSYM EC_F_EC_POINT_POINT2OCT} + EC_F_EC_POINT_POINT2OCT = 123; + {$EXTERNALSYM EC_F_EC_POINT_SET_AFFINE_COORDINATES_GF2M} + EC_F_EC_POINT_SET_AFFINE_COORDINATES_GF2M = 185; + {$EXTERNALSYM EC_F_EC_POINT_SET_AFFINE_COORDINATES_GFP} + EC_F_EC_POINT_SET_AFFINE_COORDINATES_GFP = 124; + {$EXTERNALSYM EC_F_EC_POINT_SET_COMPRESSED_COORDINATES_GF2M} + EC_F_EC_POINT_SET_COMPRESSED_COORDINATES_GF2M = 186; + {$EXTERNALSYM EC_F_EC_POINT_SET_COMPRESSED_COORDINATES_GFP} + EC_F_EC_POINT_SET_COMPRESSED_COORDINATES_GFP = 125; + {$EXTERNALSYM EC_F_EC_POINT_SET_JPROJECTIVE_COORDINATES_GFP} + EC_F_EC_POINT_SET_JPROJECTIVE_COORDINATES_GFP = 126; + {$EXTERNALSYM EC_F_EC_POINT_SET_TO_INFINITY} + EC_F_EC_POINT_SET_TO_INFINITY = 127; + {$EXTERNALSYM EC_F_EC_PRE_COMP_DUP} + EC_F_EC_PRE_COMP_DUP = 207; + {$EXTERNALSYM EC_F_EC_PRE_COMP_NEW} + EC_F_EC_PRE_COMP_NEW = 196; + {$EXTERNALSYM EC_F_EC_WNAF_MUL} + EC_F_EC_WNAF_MUL = 187; + {$EXTERNALSYM EC_F_EC_WNAF_PRECOMPUTE_MULT} + EC_F_EC_WNAF_PRECOMPUTE_MULT = 188; + {$EXTERNALSYM EC_F_I2D_ECPARAMETERS} + EC_F_I2D_ECPARAMETERS = 190; + {$EXTERNALSYM EC_F_I2D_ECPKPARAMETERS} + EC_F_I2D_ECPKPARAMETERS = 191; + {$EXTERNALSYM EC_F_I2D_ECPRIVATEKEY} + EC_F_I2D_ECPRIVATEKEY = 192; + {$EXTERNALSYM EC_F_I2O_ECPUBLICKEY} + EC_F_I2O_ECPUBLICKEY = 151; + {$EXTERNALSYM EC_F_O2I_ECPUBLICKEY} + EC_F_O2I_ECPUBLICKEY = 152; +//* Reason codes. */ + {$EXTERNALSYM EC_R_ASN1_ERROR} + EC_R_ASN1_ERROR = 115; + {$EXTERNALSYM EC_R_ASN1_UNKNOWN_FIELD} + EC_R_ASN1_UNKNOWN_FIELD = 116; + {$EXTERNALSYM EC_R_BUFFER_TOO_SMALL} + EC_R_BUFFER_TOO_SMALL = 100; + {$EXTERNALSYM EC_R_D2I_ECPKPARAMETERS_FAILURE} + EC_R_D2I_ECPKPARAMETERS_FAILURE = 117; + {$EXTERNALSYM EC_R_DISCRIMINANT_IS_ZERO} + EC_R_DISCRIMINANT_IS_ZERO = 118; + {$EXTERNALSYM EC_R_EC_GROUP_NEW_BY_NAME_FAILURE} + EC_R_EC_GROUP_NEW_BY_NAME_FAILURE = 119; + {$EXTERNALSYM EC_R_FIELD_TOO_LARGE} + EC_R_FIELD_TOO_LARGE = 138; + {$EXTERNALSYM EC_R_GROUP2PKPARAMETERS_FAILURE} + EC_R_GROUP2PKPARAMETERS_FAILURE = 120; + {$EXTERNALSYM EC_R_I2D_ECPKPARAMETERS_FAILURE} + EC_R_I2D_ECPKPARAMETERS_FAILURE = 121; + {$EXTERNALSYM EC_R_INCOMPATIBLE_OBJECTS} + EC_R_INCOMPATIBLE_OBJECTS = 101; + {$EXTERNALSYM EC_R_INVALID_ARGUMENT} + EC_R_INVALID_ARGUMENT = 112; + {$EXTERNALSYM EC_R_INVALID_COMPRESSED_POINT} + EC_R_INVALID_COMPRESSED_POINT = 110; + {$EXTERNALSYM EC_R_INVALID_COMPRESSION_BIT} + EC_R_INVALID_COMPRESSION_BIT = 109; + {$EXTERNALSYM EC_R_INVALID_ENCODING} + EC_R_INVALID_ENCODING = 102; + {$EXTERNALSYM EC_R_INVALID_FIELD} + EC_R_INVALID_FIELD = 103; + {$EXTERNALSYM EC_R_INVALID_FORM} + EC_R_INVALID_FORM = 104; + {$EXTERNALSYM EC_R_INVALID_GROUP_ORDER} + EC_R_INVALID_GROUP_ORDER = 122; + {$EXTERNALSYM EC_R_INVALID_PENTANOMIAL_BASIS} + EC_R_INVALID_PENTANOMIAL_BASIS = 132; + {$EXTERNALSYM EC_R_INVALID_PRIVATE_KEY} + EC_R_INVALID_PRIVATE_KEY = 123; + {$EXTERNALSYM EC_R_INVALID_TRINOMIAL_BASIS} + EC_R_INVALID_TRINOMIAL_BASIS = 137; + {$EXTERNALSYM EC_R_MISSING_PARAMETERS} + EC_R_MISSING_PARAMETERS = 124; + {$EXTERNALSYM EC_R_MISSING_PRIVATE_KEY} + EC_R_MISSING_PRIVATE_KEY = 125; + {$EXTERNALSYM EC_R_NOT_A_NIST_PRIME} + EC_R_NOT_A_NIST_PRIME = 135; + {$EXTERNALSYM EC_R_NOT_A_SUPPORTED_NIST_PRIME} + EC_R_NOT_A_SUPPORTED_NIST_PRIME = 136; + {$EXTERNALSYM EC_R_NOT_IMPLEMENTED} + EC_R_NOT_IMPLEMENTED = 126; + {$EXTERNALSYM EC_R_NOT_INITIALIZED} + EC_R_NOT_INITIALIZED = 111; + {$EXTERNALSYM EC_R_NO_FIELD_MOD} + EC_R_NO_FIELD_MOD = 133; + {$EXTERNALSYM EC_R_PASSED_NULL_PARAMETER} + EC_R_PASSED_NULL_PARAMETER = 134; + {$EXTERNALSYM EC_R_PKPARAMETERS2GROUP_FAILURE} + EC_R_PKPARAMETERS2GROUP_FAILURE = 127; + {$EXTERNALSYM EC_R_POINT_AT_INFINITY} + EC_R_POINT_AT_INFINITY = 106; + {$EXTERNALSYM EC_R_POINT_IS_NOT_ON_CURVE} + EC_R_POINT_IS_NOT_ON_CURVE = 107; + {$EXTERNALSYM EC_R_SLOT_FULL} + EC_R_SLOT_FULL = 108; + {$EXTERNALSYM EC_R_UNDEFINED_GENERATOR} + EC_R_UNDEFINED_GENERATOR = 113; + {$EXTERNALSYM EC_R_UNDEFINED_ORDER} + EC_R_UNDEFINED_ORDER = 128; + {$EXTERNALSYM EC_R_UNKNOWN_GROUP} + EC_R_UNKNOWN_GROUP = 129; + {$EXTERNALSYM EC_R_UNKNOWN_ORDER} + EC_R_UNKNOWN_ORDER = 114; + {$EXTERNALSYM EC_R_UNSUPPORTED_FIELD} + EC_R_UNSUPPORTED_FIELD = 131; + {$EXTERNALSYM EC_R_WRONG_ORDER} + EC_R_WRONG_ORDER = 130; + {$ENDIF} + {$IFNDEF OPENSSL_NO_ECDSA} + {$EXTERNALSYM ECDSA_F_ECDSA_DATA_NEW_METHOD} + ECDSA_F_ECDSA_DATA_NEW_METHOD = 100; + {$EXTERNALSYM ECDSA_F_ECDSA_DO_SIGN} + ECDSA_F_ECDSA_DO_SIGN = 101; + {$EXTERNALSYM ECDSA_F_ECDSA_DO_VERIFY} + ECDSA_F_ECDSA_DO_VERIFY = 102; + {$EXTERNALSYM ECDSA_F_ECDSA_SIGN_SETUP} + ECDSA_F_ECDSA_SIGN_SETUP = 103; + {$EXTERNALSYM ECDSA_R_BAD_SIGNATURE} + ECDSA_R_BAD_SIGNATURE = 100; + {$EXTERNALSYM ECDSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE} + ECDSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE = 101; + {$EXTERNALSYM ECDSA_R_ERR_EC_LIB} + ECDSA_R_ERR_EC_LIB = 102; + {$EXTERNALSYM ECDSA_R_MISSING_PARAMETERS} + ECDSA_R_MISSING_PARAMETERS = 103; + {$EXTERNALSYM ECDSA_R_RANDOM_NUMBER_GENERATION_FAILED} + ECDSA_R_RANDOM_NUMBER_GENERATION_FAILED = 104; + {$EXTERNALSYM ECDSA_R_SIGNATURE_MALLOC_FAILED} + ECDSA_R_SIGNATURE_MALLOC_FAILED = 105; + {$ENDIF} + {$IFNDEF OPENSSL_NO_ECDH} + {$EXTERNALSYM ECDH_F_ECDH_COMPUTE_KEY} + ECDH_F_ECDH_COMPUTE_KEY = 100; + {$EXTERNALSYM ECDH_F_ECDH_DATA_NEW_METHOD} + ECDH_F_ECDH_DATA_NEW_METHOD = 101; + {$EXTERNALSYM ECDH_R_KDF_FAILED} + ECDH_R_KDF_FAILED = 102; + {$EXTERNALSYM ECDH_R_NO_PRIVATE_VALUE} + ECDH_R_NO_PRIVATE_VALUE = 100; + {$EXTERNALSYM ECDH_R_POINT_ARITHMETIC_FAILURE} + ECDH_R_POINT_ARITHMETIC_FAILURE = 101; + {$ENDIF} + {$IFNDEF OPENSSL_NO_BF} + {$EXTERNALSYM BF_BLOCK} + BF_BLOCK = 8; + {$EXTERNALSYM BF_DECRYPT} + BF_DECRYPT = 0; + {$EXTERNALSYM BF_ENCRYPT} + BF_ENCRYPT = 1; + {$EXTERNALSYM BF_ROUNDS} + BF_ROUNDS = 16; + {$ENDIF} + {$EXTERNALSYM EVP_MAX_MD_SIZE} + EVP_MAX_MD_SIZE = 64; //* longest known is SHA512 */ - value I found, 16+20; + {$EXTERNALSYM EVP_MAX_KEY_LENGTH} + EVP_MAX_KEY_LENGTH = 32; //value I found, 24; + {$EXTERNALSYM EVP_MAX_IV_LENGTH} + EVP_MAX_IV_LENGTH = 16; //value I found, 8; + {$EXTERNALSYM EVP_MAX_BLOCK_LENGTH} + EVP_MAX_BLOCK_LENGTH=32; + {$EXTERNALSYM NID_dhKeyAgreement} + NID_dhKeyAgreement = 28; + + {$EXTERNALSYM NID_dsa} + NID_dsa = 116; + + {$EXTERNALSYM NID_dsa_2} + NID_dsa_2 = 67; + + {$EXTERNALSYM NID_dsaWithSHA} + NID_dsaWithSHA = 66; + + {$EXTERNALSYM NID_dsaWithSHA1} + NID_dsaWithSHA1 = 113; + + {$EXTERNALSYM NID_dsaWithSHA1_2} + NID_dsaWithSHA1_2 = 70; + + {$EXTERNALSYM EVP_PKEY_MO_SIGN} + EVP_PKEY_MO_SIGN = $0001; + {$EXTERNALSYM EVP_PKEY_MO_VERIFY} + EVP_PKEY_MO_VERIFY = $0002; + + {$EXTERNALSYM EVP_PKEY_MO_ENCRYPT} + EVP_PKEY_MO_ENCRYPT = $0004; + {$EXTERNALSYM EVP_PKEY_MO_DECRYPT} + EVP_PKEY_MO_DECRYPT = $0008; + + {$EXTERNALSYM EVP_MD_FLAG_FIPS} + EVP_MD_FLAG_FIPS = $0400; + //* Note if suitable for use in FIPS mode */ + {$EXTERNALSYM EVP_MD_FLAG_PKEY_DIGEST} + EVP_MD_FLAG_PKEY_DIGEST = $0002; //* digest is a "clone" digest used +// * which is a copy of an existing +// * one for a specific public key type. +// * EVP_dss1() etc */ +//* Digest uses EVP_PKEY_METHOD for signing instead of MD specific signing */ + + {$EXTERNALSYM EVP_MD_FLAG_PKEY_METHOD_SIGNATURE} + EVP_MD_FLAG_PKEY_METHOD_SIGNATURE = $0004; //note: conflicts with FIPS + +//* DigestAlgorithmIdentifier flags... */ + + {$EXTERNALSYM EVP_MD_FLAG_DIGALGID_MASK} + EVP_MD_FLAG_DIGALGID_MASK = $0018; + +//* NULL or absent parameter accepted. Use NULL */ + + {$EXTERNALSYM EVP_MD_FLAG_DIGALGID_NULL} + EVP_MD_FLAG_DIGALGID_NULL = $0000; + +//* NULL or absent parameter accepted. Use NULL for PKCS#1 otherwise absent */ + + {$EXTERNALSYM EVP_MD_FLAG_DIGALGID_ABSENT} + EVP_MD_FLAG_DIGALGID_ABSENT = $0008; + +//* Custom handling via ctrl */ + + {$EXTERNALSYM EVP_MD_FLAG_DIGALGID_CUSTOM} + EVP_MD_FLAG_DIGALGID_CUSTOM = $0018; + + {$EXTERNALSYM EVP_MD_FLAG_SVCTX} + EVP_MD_FLAG_SVCTX = $0800; + //* pass EVP_MD_SVCTX to sign/verify */ + +//* Digest ctrls */ + + {$EXTERNALSYM EVP_MD_CTRL_DIGALGID} + EVP_MD_CTRL_DIGALGID = $1; + {$EXTERNALSYM EVP_MD_CTRL_MICALG} + EVP_MD_CTRL_MICALG = $2; + +//* Minimum Algorithm specific ctrl value */ + + {$EXTERNALSYM EVP_MD_CTRL_ALG_CTRL} + EVP_MD_CTRL_ALG_CTRL = $1000; + + {$EXTERNALSYM NID_undef} + NID_undef = 0; + {$EXTERNALSYM NID_rsaEncryption} + NID_rsaEncryption = 6; + {$EXTERNALSYM NID_rsa} + NID_rsa = 19; + {$EXTERNALSYM NID_X9_62_id_ecPublicKey} + NID_X9_62_id_ecPublicKey = 408; + + {$EXTERNALSYM EVP_PKEY_NONE} + EVP_PKEY_NONE = NID_undef; + {$EXTERNALSYM EVP_PKEY_RSA} + EVP_PKEY_RSA = NID_rsaEncryption; + {$EXTERNALSYM EVP_PKEY_RSA2} + EVP_PKEY_RSA2 = NID_rsa; + {$EXTERNALSYM EVP_PKEY_DSA} + EVP_PKEY_DSA = NID_dsa; + {$EXTERNALSYM EVP_PKEY_DSA1} + EVP_PKEY_DSA1 = NID_dsa_2; + {$EXTERNALSYM EVP_PKEY_DSA2} + EVP_PKEY_DSA2 = NID_dsaWithSHA; + {$EXTERNALSYM EVP_PKEY_DSA3} + EVP_PKEY_DSA3 = NID_dsaWithSHA1; + {$EXTERNALSYM EVP_PKEY_DSA4} + EVP_PKEY_DSA4 = NID_dsaWithSHA1_2; + + {$EXTERNALSYM EVP_PKEY_DH} + EVP_PKEY_DH = NID_dhKeyAgreement; + {$EXTERNALSYM EVP_PKEY_EC} + EVP_PKEY_EC = NID_X9_62_id_ecPublicKey; + + {$EXTERNALSYM EVP_PKT_SIGN} + EVP_PKT_SIGN = $0010; + {$EXTERNALSYM EVP_PKT_ENC} + EVP_PKT_ENC = $0020; + {$EXTERNALSYM EVP_PKT_EXCH} + EVP_PKT_EXCH = $0040; + {$EXTERNALSYM EVP_PKT_EXP} + EVP_PKT_EXP = $1000; + + {$EXTERNALSYM EVP_PKS_RSA} + EVP_PKS_RSA = $0100; + {$EXTERNALSYM EVP_PKS_DSA} + EVP_PKS_DSA = $0200; + {$EXTERNALSYM EVP_PKS_EC} + EVP_PKS_EC = $0400; + + {$EXTERNALSYM EVP_PK_RSA} + EVP_PK_RSA = $0001; + {$EXTERNALSYM EVP_PK_DSA} + EVP_PK_DSA = $0002; + {$EXTERNALSYM EVP_PK_DH} + EVP_PK_DH = $0004; + {$EXTERNALSYM EVP_PK_EC} + EVP_PK_EC = $0008; + + {$EXTERNALSYM EVP_BLOWFISH_KEY_SIZE} + EVP_BLOWFISH_KEY_SIZE = 16; + {$EXTERNALSYM EVP_CAST5_KEY_SIZE} + EVP_CAST5_KEY_SIZE = 16; + {$EXTERNALSYM EVP_RC2_KEY_SIZE} + EVP_RC2_KEY_SIZE = 16; + {$EXTERNALSYM EVP_RC4_KEY_SIZE} + EVP_RC4_KEY_SIZE = 16; + {$EXTERNALSYM EVP_RC5_32_12_16_KEY_SIZE} + EVP_RC5_32_12_16_KEY_SIZE = 16; + {$EXTERNALSYM EVP_MD_CTX_FLAG_ONESHOT} + EVP_MD_CTX_FLAG_ONESHOT = $0001; + //* digest update will be called + //* once only */ + {$EXTERNALSYM EVP_MD_CTX_FLAG_CLEANED} + EVP_MD_CTX_FLAG_CLEANED = $0002; + //* context has already been + //* cleaned */ + {$EXTERNALSYM EVP_MD_CTX_FLAG_REUSE} + EVP_MD_CTX_FLAG_REUSE = $0004; + //* Don't free up ctx->md_data + //* in EVP_MD_CTX_cleanup */ + //OpenSSL 1.0.0. + //* FIPS and pad options are ignored in 1.0.0, definitions are here +// * so we don't accidentally reuse the values for other purposes. +// */ + + {$EXTERNALSYM EVP_MD_CTX_FLAG_NON_FIPS_ALLOW} + EVP_MD_CTX_FLAG_NON_FIPS_ALLOW = $0008; //* Allow use of non FIPS digest +// * in FIPS mode */ + +//* The following PAD options are also currently ignored in 1.0.0, digest +// * parameters are handled through EVP_DigestSign*() and EVP_DigestVerify*() +// * instead. +// */ + + + {$EXTERNALSYM EVP_MD_CTX_FLAG_PAD_MASK} + EVP_MD_CTX_FLAG_PAD_MASK = $F0; //* RSA mode to use */ + {$EXTERNALSYM EVP_MD_CTX_FLAG_PAD_PKCS1} + EVP_MD_CTX_FLAG_PAD_PKCS1 = $00; //* PKCS#1 v1.5 mode */ + {$EXTERNALSYM EVP_MD_CTX_FLAG_PAD_X931} + EVP_MD_CTX_FLAG_PAD_X931 = $10; //* X9.31 mode */ + {$EXTERNALSYM EVP_MD_CTX_FLAG_PAD_PSS} + EVP_MD_CTX_FLAG_PAD_PSS = $20; //* PSS mode */ +//#define M_EVP_MD_CTX_FLAG_PSS_SALT(ctx) \ +// ((ctx->flags>>16) &0xFFFF) /* seed length */ + {$EXTERNALSYM EVP_MD_CTX_FLAG_PSS_MDLEN} + EVP_MD_CTX_FLAG_PSS_MDLEN = $FFFF; //* salt len same as digest */ + {$EXTERNALSYM EVP_MD_CTX_FLAG_PSS_MREC} + EVP_MD_CTX_FLAG_PSS_MREC = $FFFE; //* salt max or auto recovered */ + {$EXTERNALSYM EVP_MD_CTX_FLAG_NO_INIT} + EVP_MD_CTX_FLAG_NO_INIT = $0100; //* Don't initialize md_data */ + + //* Modes for ciphers */ + {$EXTERNALSYM EVP_CIPH_STREAM_CIPHER} + EVP_CIPH_STREAM_CIPHER = $0; + {$EXTERNALSYM EVP_CIPH_ECB_MODE} + EVP_CIPH_ECB_MODE = $1; + {$EXTERNALSYM EVP_CIPH_CBC_MODE} + EVP_CIPH_CBC_MODE = $2; + {$EXTERNALSYM EVP_CIPH_CFB_MODE} + EVP_CIPH_CFB_MODE = $3; + {$EXTERNALSYM EVP_CIPH_OFB_MODE} + EVP_CIPH_OFB_MODE = $4; + {$EXTERNALSYM EVP_CIPH_CTR_MODE} + EVP_CIPH_CTR_MODE = $5; + {$EXTERNALSYM EVP_CIPH_GCM_MODE} + EVP_CIPH_GCM_MODE = $6; + {$EXTERNALSYM EVP_CIPH_CCM_MODE} + EVP_CIPH_CCM_MODE = $7; + {$EXTERNALSYM EVP_CIPH_XTS_MODE} + EVP_CIPH_XTS_MODE = $10001; + {$EXTERNALSYM EVP_CIPH_MODE} + EVP_CIPH_MODE = $F0007; + +//* Set if variable length cipher */ + {$EXTERNALSYM EVP_CIPH_VARIABLE_LENGTH} + EVP_CIPH_VARIABLE_LENGTH = $8; +//* Set if the iv handling should be done by the cipher itself */ + {$EXTERNALSYM EVP_CIPH_CUSTOM_IV} + EVP_CIPH_CUSTOM_IV = $10; +//* Set if the cipher's init() function should be called if key is NULL */ + {$EXTERNALSYM EVP_CIPH_ALWAYS_CALL_INIT} + EVP_CIPH_ALWAYS_CALL_INIT = $20; +//* Call ctrl() to init cipher parameters */ + {$EXTERNALSYM EVP_CIPH_CTRL_INIT} + EVP_CIPH_CTRL_INIT = $40; +//* Don't use standard key length function */ + {$EXTERNALSYM EVP_CIPH_CUSTOM_KEY_LENGTH} + EVP_CIPH_CUSTOM_KEY_LENGTH = $80; +//* Don't use standard block padding */ + {$EXTERNALSYM EVP_CIPH_NO_PADDING} + EVP_CIPH_NO_PADDING = $100; +//* cipher handles random key generation */ + {$EXTERNALSYM EVP_CIPH_RAND_KEY} + EVP_CIPH_RAND_KEY = $200; +//* cipher has its own additional copying logic */ + {$EXTERNALSYM EVP_CIPH_CUSTOM_COPY} + EVP_CIPH_CUSTOM_COPY = $400; +//* Allow use default ASN1 get/set iv */ + {$EXTERNALSYM EVP_CIPH_FLAG_DEFAULT_ASN1} + EVP_CIPH_FLAG_DEFAULT_ASN1 = $1000; +//* Buffer length in bits not bytes: CFB1 mode only */ + {$EXTERNALSYM EVP_CIPH_FLAG_LENGTH_BITS} + EVP_CIPH_FLAG_LENGTH_BITS = $2000; +//* Note if suitable for use in FIPS mode */ + {$EXTERNALSYM EVP_CIPH_FLAG_FIPS} + EVP_CIPH_FLAG_FIPS = $4000; +//* Allow non FIPS cipher in FIPS mode */ + {$EXTERNALSYM EVP_CIPH_FLAG_NON_FIPS_ALLOW} + EVP_CIPH_FLAG_NON_FIPS_ALLOW = $8000; +///* Cipher handles any and all padding logic as well +// * as finalisation. +// */ + {$EXTERNALSYM EVP_CIPH_FLAG_CUSTOM_CIPHER} + EVP_CIPH_FLAG_CUSTOM_CIPHER = $100000; + {$EXTERNALSYM EVP_CIPH_FLAG_AEAD_CIPHER} + EVP_CIPH_FLAG_AEAD_CIPHER = $200000; + + {$EXTERNALSYM EVP_CTRL_INIT} + EVP_CTRL_INIT = $0; + {$EXTERNALSYM EVP_CTRL_SET_KEY_LENGTH} + EVP_CTRL_SET_KEY_LENGTH = $1; + {$EXTERNALSYM EVP_CTRL_GET_RC2_KEY_BITS} + EVP_CTRL_GET_RC2_KEY_BITS = $2; + {$EXTERNALSYM EVP_CTRL_SET_RC2_KEY_BITS} + EVP_CTRL_SET_RC2_KEY_BITS = $3; + {$EXTERNALSYM EVP_CTRL_GET_RC5_ROUNDS} + EVP_CTRL_GET_RC5_ROUNDS = $4; + {$EXTERNALSYM EVP_CTRL_SET_RC5_ROUNDS} + EVP_CTRL_SET_RC5_ROUNDS = $5; + {$EXTERNALSYM EVP_CTRL_RAND_KEY} + EVP_CTRL_RAND_KEY = $6; + {$EXTERNALSYM EVP_CTRL_PBE_PRF_NID} + EVP_CTRL_PBE_PRF_NID = $7; + {$EXTERNALSYM EVP_CTRL_COPY} + EVP_CTRL_COPY = $8; + {$EXTERNALSYM EVP_CTRL_GCM_SET_IVLEN} + EVP_CTRL_GCM_SET_IVLEN = $9; + {$EXTERNALSYM EVP_CTRL_GCM_GET_TAG} + EVP_CTRL_GCM_GET_TAG = $10; + {$EXTERNALSYM EVP_CTRL_GCM_SET_TAG} + EVP_CTRL_GCM_SET_TAG = $11; + {$EXTERNALSYM EVP_CTRL_GCM_SET_IV_FIXED} + EVP_CTRL_GCM_SET_IV_FIXED = $12; + {$EXTERNALSYM EVP_CTRL_GCM_IV_GEN} + EVP_CTRL_GCM_IV_GEN = $13; + {$EXTERNALSYM EVP_CTRL_CCM_SET_IVLEN} + EVP_CTRL_CCM_SET_IVLEN = EVP_CTRL_GCM_SET_IVLEN; + {$EXTERNALSYM EVP_CTRL_CCM_GET_TAG} + EVP_CTRL_CCM_GET_TAG = EVP_CTRL_GCM_GET_TAG; + {$EXTERNALSYM EVP_CTRL_CCM_SET_TAG} + EVP_CTRL_CCM_SET_TAG = EVP_CTRL_GCM_SET_TAG; + {$EXTERNALSYM EVP_CTRL_CCM_SET_L} + EVP_CTRL_CCM_SET_L = $14; + {$EXTERNALSYM EVP_CTRL_CCM_SET_MSGLEN} + EVP_CTRL_CCM_SET_MSGLEN = $15; + +///* AEAD cipher deduces payload length and returns number of bytes +// * required to store MAC and eventual padding. Subsequent call to +// * EVP_Cipher even appends/verifies MAC. +// */ + {$EXTERNALSYM EVP_CTRL_AEAD_TLS1_AAD} + EVP_CTRL_AEAD_TLS1_AAD = $16; +//* Used by composite AEAD ciphers, no-op in GCM, CCM... */ + {$EXTERNALSYM EVP_CTRL_AEAD_SET_MAC_KEY} + EVP_CTRL_AEAD_SET_MAC_KEY = $17; +//* Set the GCM invocation field, decrypt only */ + {$EXTERNALSYM EVP_CTRL_GCM_SET_IV_INV} + EVP_CTRL_GCM_SET_IV_INV = $18; +//* PBE type */ + +//* GCM TLS constants */ +//* Length of fixed part of IV derived from PRF */ + {$EXTERNALSYM EVP_GCM_TLS_FIXED_IV_LEN} + EVP_GCM_TLS_FIXED_IV_LEN = 4; +//* Length of explicit part of IV part of TLS records */ + {$EXTERNALSYM EVP_GCM_TLS_EXPLICIT_IV_LEN} + EVP_GCM_TLS_EXPLICIT_IV_LEN = 8; +//* Length of tag for TLS */ + {$EXTERNALSYM EVP_GCM_TLS_TAG_LEN} + EVP_GCM_TLS_TAG_LEN = 16; + +//* Can appear as the outermost AlgorithmIdentifier */ + {$EXTERNALSYM EVP_PBE_TYPE_OUTER} + EVP_PBE_TYPE_OUTER = $0; +//* Is an PRF type OID */ + {$EXTERNALSYM EVP_PBE_TYPE_PRF} + EVP_PBE_TYPE_PRF = $1; + + {$EXTERNALSYM ASN1_PKEY_ALIAS} + ASN1_PKEY_ALIAS = $1; + {$EXTERNALSYM ASN1_PKEY_DYNAMIC} + ASN1_PKEY_DYNAMIC = $2; + {$EXTERNALSYM ASN1_PKEY_SIGPARAM_NULL} + ASN1_PKEY_SIGPARAM_NULL = $4; + {$EXTERNALSYM ASN1_PKEY_CTRL_PKCS7_SIGN} + ASN1_PKEY_CTRL_PKCS7_SIGN = $1; + {$EXTERNALSYM ASN1_PKEY_CTRL_PKCS7_ENCRYPT} + ASN1_PKEY_CTRL_PKCS7_ENCRYPT = $2; + {$EXTERNALSYM ASN1_PKEY_CTRL_DEFAULT_MD_NID} + ASN1_PKEY_CTRL_DEFAULT_MD_NID = $3; + {$EXTERNALSYM ASN1_PKEY_CTRL_CMS_SIGN} + ASN1_PKEY_CTRL_CMS_SIGN = $5; + {$EXTERNALSYM ASN1_PKEY_CTRL_CMS_ENVELOPE} + ASN1_PKEY_CTRL_CMS_ENVELOPE = $7; + + {$EXTERNALSYM EVP_PKEY_OP_UNDEFINED} + EVP_PKEY_OP_UNDEFINED = 0; + {$EXTERNALSYM EVP_PKEY_OP_PARAMGEN} + EVP_PKEY_OP_PARAMGEN =(1 shl 1); + {$EXTERNALSYM EVP_PKEY_OP_KEYGEN} + EVP_PKEY_OP_KEYGEN = (1 shl 2); + {$EXTERNALSYM EVP_PKEY_OP_SIGN} + EVP_PKEY_OP_SIGN = (1 shl 3); + {$EXTERNALSYM EVP_PKEY_OP_VERIFY} + EVP_PKEY_OP_VERIFY = (1 shl 4); + {$EXTERNALSYM EVP_PKEY_OP_VERIFYRECOVER} + EVP_PKEY_OP_VERIFYRECOVER = (1 shl 5); + {$EXTERNALSYM EVP_PKEY_OP_SIGNCTX} + EVP_PKEY_OP_SIGNCTX = (1 shl 6); + {$EXTERNALSYM EVP_PKEY_OP_VERIFYCTX} + EVP_PKEY_OP_VERIFYCTX = (1 shl 7); + {$EXTERNALSYM EVP_PKEY_OP_ENCRYPT} + EVP_PKEY_OP_ENCRYPT = (1 shl 8); + {$EXTERNALSYM EVP_PKEY_OP_DECRYPT} + EVP_PKEY_OP_DECRYPT = (1 shl 9); + {$EXTERNALSYM EVP_PKEY_OP_DERIVE} + EVP_PKEY_OP_DERIVE = (1 shl 10); + + {$EXTERNALSYM EVP_PKEY_OP_TYPE_SIG} + EVP_PKEY_OP_TYPE_SIG = + {$EXTERNALSYM EVP_PKEY_OP_TYPE_CRYPT} + (EVP_PKEY_OP_SIGN or EVP_PKEY_OP_VERIFY or EVP_PKEY_OP_VERIFYRECOVER + {$EXTERNALSYM EVP_PKEY_OP_TYPE_CRYPT} + or EVP_PKEY_OP_SIGNCTX or EVP_PKEY_OP_VERIFYCTX); + + {$EXTERNALSYM EVP_PKEY_OP_TYPE_CRYPT} + EVP_PKEY_OP_TYPE_CRYPT = (EVP_PKEY_OP_ENCRYPT or EVP_PKEY_OP_DECRYPT); + +// EVP_PKEY_OP_TYPE_NOGEN = +// (EVP_PKEY_OP_SIG or EVP_PKEY_OP_CRYPT or EVP_PKEY_OP_DERIVE); +// guessing from above. THere may be a typo in the header. + {$EXTERNALSYM EVP_PKEY_OP_TYPE_NOGEN} + EVP_PKEY_OP_TYPE_NOGEN = + {$EXTERNALSYM EVP_PKEY_OP_TYPE_GEN} + (EVP_PKEY_OP_TYPE_SIG or EVP_PKEY_OP_TYPE_CRYPT or EVP_PKEY_OP_DERIVE); + + {$EXTERNALSYM EVP_PKEY_OP_TYPE_GEN} + EVP_PKEY_OP_TYPE_GEN = + (EVP_PKEY_OP_PARAMGEN or EVP_PKEY_OP_KEYGEN); + + {$EXTERNALSYM EVP_PKEY_CTRL_MD} + EVP_PKEY_CTRL_MD = 1; + {$EXTERNALSYM EVP_PKEY_CTRL_PEER_KEY} + EVP_PKEY_CTRL_PEER_KEY = 2; + + {$EXTERNALSYM EVP_PKEY_CTRL_PKCS7_ENCRYPT} + EVP_PKEY_CTRL_PKCS7_ENCRYPT = 3; + {$EXTERNALSYM EVP_PKEY_CTRL_PKCS7_DECRYPT} + EVP_PKEY_CTRL_PKCS7_DECRYPT = 4; + + {$EXTERNALSYM EVP_PKEY_CTRL_PKCS7_SIGN} + EVP_PKEY_CTRL_PKCS7_SIGN = 5; + + {$EXTERNALSYM EVP_PKEY_CTRL_SET_MAC_KEY} + EVP_PKEY_CTRL_SET_MAC_KEY = 6; + + {$EXTERNALSYM EVP_PKEY_CTRL_DIGESTINIT} + EVP_PKEY_CTRL_DIGESTINIT = 7; + +//* Used by GOST key encryption in TLS */ + + {$EXTERNALSYM EVP_PKEY_CTRL_SET_IV} + EVP_PKEY_CTRL_SET_IV = 8; + {$EXTERNALSYM EVP_PKEY_CTRL_CMS_ENCRYPT} + EVP_PKEY_CTRL_CMS_ENCRYPT = 9; + {$EXTERNALSYM EVP_PKEY_CTRL_CMS_DECRYPT} + EVP_PKEY_CTRL_CMS_DECRYPT = 10; + {$EXTERNALSYM EVP_PKEY_CTRL_CMS_SIGN} + EVP_PKEY_CTRL_CMS_SIGN = 11; + {$EXTERNALSYM EVP_PKEY_CTRL_CIPHER} + EVP_PKEY_CTRL_CIPHER = 12; + {$EXTERNALSYM EVP_PKEY_ALG_CTRL} + EVP_PKEY_ALG_CTRL = $1000; + + {$EXTERNALSYM EVP_PKEY_FLAG_AUTOARGLEN} + EVP_PKEY_FLAG_AUTOARGLEN = 2; +///* Method handles all operations: don't assume any digest related +// * defaults. +// */ + {$EXTERNALSYM EVP_PKEY_FLAG_SIGCTX_CUSTOM} + EVP_PKEY_FLAG_SIGCTX_CUSTOM = 4; + {$EXTERNALSYM EVP_F_AESNI_INIT_KEY} + EVP_F_AESNI_INIT_KEY = 165; + {$EXTERNALSYM EVP_F_AESNI_XTS_CIPHER} + EVP_F_AESNI_XTS_CIPHER = 176; + {$EXTERNALSYM EVP_F_AES_INIT_KEY} + EVP_F_AES_INIT_KEY = 133; + {$EXTERNALSYM EVP_F_ALG_MODULE_INIT} + EVP_F_ALG_MODULE_INIT = 138; + {$EXTERNALSYM EVP_F_AES_XTS} + EVP_F_AES_XTS = 172; + {$EXTERNALSYM EVP_F_AES_XTS_CIPHER} + EVP_F_AES_XTS_CIPHER = 175; + {$EXTERNALSYM EVP_F_CAMELLIA_INIT_KEY} + EVP_F_CAMELLIA_INIT_KEY = 159; + {$EXTERNALSYM EVP_F_CMAC_INIT} + EVP_F_CMAC_INIT = 173; + {$EXTERNALSYM EVP_F_D2I_PKEY} + EVP_F_D2I_PKEY = 100; + {$EXTERNALSYM EVP_F_DO_SIGVER_INIT} + EVP_F_DO_SIGVER_INIT = 161; + {$EXTERNALSYM EVP_F_DO_EVP_ENC_ENGINE} + EVP_F_DO_EVP_ENC_ENGINE = 140; + {$EXTERNALSYM EVP_F_DSAPKEY2PKCS8} + EVP_F_DSAPKEY2PKCS8 = 134; + {$EXTERNALSYM EVP_F_DSA_PKEY2PKCS8} + EVP_F_DSA_PKEY2PKCS8 = 135; + {$EXTERNALSYM EVP_F_ECDSA_PKEY2PKCS8} + EVP_F_ECDSA_PKEY2PKCS8 = 129; + {$EXTERNALSYM EVP_F_ECKEY_PKEY2PKCS8} + EVP_F_ECKEY_PKEY2PKCS8 = 132; + {$EXTERNALSYM EVP_F_EVP_CIPHERINIT_EX} + EVP_F_EVP_CIPHERINIT_EX = 123; + {$EXTERNALSYM EVP_F_EVP_CIPHER_CTX_COPY} + EVP_F_EVP_CIPHER_CTX_COPY = 163; + {$EXTERNALSYM EVP_F_EVP_CIPHER_CTX_CTRL} + EVP_F_EVP_CIPHER_CTX_CTRL = 124; + {$EXTERNALSYM EVP_F_EVP_CIPHER_CTX_SET_KEY_LENGTH} + EVP_F_EVP_CIPHER_CTX_SET_KEY_LENGTH = 122; + {$EXTERNALSYM EVP_F_EVP_DECRYPTFINAL_EX} + EVP_F_EVP_DECRYPTFINAL_EX = 101; + //was EVP_F_EVP_DECRYPTFINAL = 101; + {$EXTERNALSYM EVP_F_EVP_DIGESTINIT_EX} + EVP_F_EVP_DIGESTINIT_EX = 128; + {$EXTERNALSYM EVP_F_EVP_ENCRYPTFINAL_EX} + EVP_F_EVP_ENCRYPTFINAL_EX = 127; + {$EXTERNALSYM EVP_F_EVP_MD_CTX_COPY_EX} + EVP_F_EVP_MD_CTX_COPY_EX = 110; + {$EXTERNALSYM EVP_F_EVP_MD_SIZE} + EVP_F_EVP_MD_SIZE = 162; + //was EVP_F_EVP_MD_CTX_COPY = 110; + {$EXTERNALSYM EVP_F_EVP_OPENINIT} + EVP_F_EVP_OPENINIT = 102; + {$EXTERNALSYM EVP_F_EVP_PBE_ALG_ADD} + EVP_F_EVP_PBE_ALG_ADD = 115; + {$EXTERNALSYM EVP_F_EVP_PBE_ALG_ADD_TYPE} + EVP_F_EVP_PBE_ALG_ADD_TYPE = 160; + {$EXTERNALSYM EVP_F_EVP_PBE_CIPHERINIT} + EVP_F_EVP_PBE_CIPHERINIT = 116; + {$EXTERNALSYM EVP_F_EVP_PKCS82PKEY} + EVP_F_EVP_PKCS82PKEY = 111; + {$EXTERNALSYM EVP_F_EVP_PKEY2PKCS8_BROKEN} + EVP_F_EVP_PKEY2PKCS8_BROKEN = 113; + //was EVP_F_EVP_PKEY2PKCS8 = 113; + {$EXTERNALSYM EVP_F_EVP_PKCS82PKEY_BROKEN} + EVP_F_EVP_PKCS82PKEY_BROKEN = 136; + {$EXTERNALSYM EVP_F_EVP_PKEY_COPY_PARAMETERS} + EVP_F_EVP_PKEY_COPY_PARAMETERS = 103; + {$EXTERNALSYM EVP_F_EVP_PKEY_CTX_CTRL} + EVP_F_EVP_PKEY_CTX_CTRL = 137; + {$EXTERNALSYM EVP_F_EVP_PKEY_CTX_CTRL_STR} + EVP_F_EVP_PKEY_CTX_CTRL_STR = 150; + {$EXTERNALSYM EVP_F_EVP_PKEY_CTX_DUP} + EVP_F_EVP_PKEY_CTX_DUP = 156; + {$EXTERNALSYM EVP_F_EVP_PKEY_DECRYPT} + EVP_F_EVP_PKEY_DECRYPT = 104; + {$EXTERNALSYM EVP_F_EVP_PKEY_DECRYPT_INIT} + EVP_F_EVP_PKEY_DECRYPT_INIT = 138; + {$EXTERNALSYM EVP_F_EVP_PKEY_DECRYPT_OLD} + EVP_F_EVP_PKEY_DECRYPT_OLD = 151; + {$EXTERNALSYM EVP_F_EVP_PKEY_DERIVE} + EVP_F_EVP_PKEY_DERIVE = 153; + {$EXTERNALSYM EVP_F_EVP_PKEY_DERIVE_INIT} + EVP_F_EVP_PKEY_DERIVE_INIT = 154; + {$EXTERNALSYM EVP_F_EVP_PKEY_DERIVE_SET_PEER} + EVP_F_EVP_PKEY_DERIVE_SET_PEER = 155; + {$EXTERNALSYM EVP_F_EVP_PKEY_ENCRYPT} + EVP_F_EVP_PKEY_ENCRYPT = 105; + {$EXTERNALSYM EVP_F_EVP_PKEY_ENCRYPT_INIT} + EVP_F_EVP_PKEY_ENCRYPT_INIT = 139; + {$EXTERNALSYM EVP_F_EVP_PKEY_ENCRYPT_OLD} + EVP_F_EVP_PKEY_ENCRYPT_OLD = 152; + {$EXTERNALSYM EVP_F_EVP_PKEY_GET1_DH} + EVP_F_EVP_PKEY_GET1_DH = 119; + {$EXTERNALSYM EVP_F_EVP_PKEY_GET1_DSA} + EVP_F_EVP_PKEY_GET1_DSA = 120; + {$EXTERNALSYM EVP_F_EVP_PKEY_GET1_ECDSA} + EVP_F_EVP_PKEY_GET1_ECDSA = 130; + {$EXTERNALSYM EVP_F_EVP_PKEY_GET1_EC_KEY} + EVP_F_EVP_PKEY_GET1_EC_KEY = 131; + {$EXTERNALSYM EVP_F_EVP_PKEY_GET1_RSA} + EVP_F_EVP_PKEY_GET1_RSA = 121; + {$EXTERNALSYM EVP_F_EVP_PKEY_KEYGEN} + EVP_F_EVP_PKEY_KEYGEN = 146; + {$EXTERNALSYM EVP_F_EVP_PKEY_KEYGEN_INIT} + EVP_F_EVP_PKEY_KEYGEN_INIT = 147; + {$EXTERNALSYM EVP_F_EVP_PKEY_NEW} + EVP_F_EVP_PKEY_NEW = 106; + {$EXTERNALSYM EVP_F_EVP_PKEY_PARAMGEN} + EVP_F_EVP_PKEY_PARAMGEN = 148; + {$EXTERNALSYM EVP_F_EVP_PKEY_PARAMGEN_INIT} + EVP_F_EVP_PKEY_PARAMGEN_INIT = 149; + {$EXTERNALSYM EVP_F_EVP_PKEY_SIGN} + EVP_F_EVP_PKEY_SIGN = 140; + {$EXTERNALSYM EVP_F_EVP_PKEY_SIGN_INIT} + EVP_F_EVP_PKEY_SIGN_INIT = 141; + {$EXTERNALSYM EVP_F_EVP_PKEY_VERIFY} + EVP_F_EVP_PKEY_VERIFY = 142; + {$EXTERNALSYM EVP_F_EVP_PKEY_VERIFY_INIT} + EVP_F_EVP_PKEY_VERIFY_INIT = 143; + {$EXTERNALSYM EVP_F_EVP_PKEY_VERIFY_RECOVER} + EVP_F_EVP_PKEY_VERIFY_RECOVER = 144; + {$EXTERNALSYM EVP_F_EVP_PKEY_VERIFY_RECOVER_INIT} + EVP_F_EVP_PKEY_VERIFY_RECOVER_INIT = 145; + {$EXTERNALSYM EVP_F_EVP_RIJNDAEL} + EVP_F_EVP_RIJNDAEL = 126; + {$EXTERNALSYM EVP_F_EVP_SIGNFINAL} + EVP_F_EVP_SIGNFINAL = 107; + {$EXTERNALSYM EVP_F_EVP_VERIFYFINAL} + EVP_F_EVP_VERIFYFINAL = 108; + {$EXTERNALSYM EVP_F_FIPS_CIPHERINIT} + EVP_F_FIPS_CIPHERINIT = 166; + {$EXTERNALSYM EVP_F_FIPS_CIPHER_CTX_COPY} + EVP_F_FIPS_CIPHER_CTX_COPY = 170; + {$EXTERNALSYM EVP_F_FIPS_CIPHER_CTX_CTRL} + EVP_F_FIPS_CIPHER_CTX_CTRL = 167; + {$EXTERNALSYM EVP_F_FIPS_CIPHER_CTX_SET_KEY_LENGTH} + EVP_F_FIPS_CIPHER_CTX_SET_KEY_LENGTH = 171; + {$EXTERNALSYM EVP_F_FIPS_DIGESTINIT} + EVP_F_FIPS_DIGESTINIT = 168; + {$EXTERNALSYM EVP_F_FIPS_MD_CTX_COPY} + EVP_F_FIPS_MD_CTX_COPY = 169; + {$EXTERNALSYM EVP_F_HMAC_INIT_EX} + EVP_F_HMAC_INIT_EX = 174; + {$EXTERNALSYM EVP_F_INT_CTX_NEW} + EVP_F_INT_CTX_NEW = 157; + {$EXTERNALSYM EVP_F_PKCS5_PBE_KEYIVGEN} + EVP_F_PKCS5_PBE_KEYIVGEN = 117; + {$EXTERNALSYM EVP_F_PKCS5_V2_PBKDF2_KEYIVGEN} + EVP_F_PKCS5_V2_PBKDF2_KEYIVGEN = 164; + + {$EXTERNALSYM EVP_F_PKCS5_V2_PBE_KEYIVGEN} + EVP_F_PKCS5_V2_PBE_KEYIVGEN = 118; + {$EXTERNALSYM EVP_F_PKCS8_SET_BROKEN} + EVP_F_PKCS8_SET_BROKEN = 112; + {$EXTERNALSYM EVP_F_PKEY_SET_TYPE} + EVP_F_PKEY_SET_TYPE = 158; + + //was EVP_F_EVP_PKCS8_SET_BROKEN = 112; + {$EXTERNALSYM EVP_F_RC2_MAGIC_TO_METH} + EVP_F_RC2_MAGIC_TO_METH = 109; + {$EXTERNALSYM EVP_F_RC5_CTRL} + EVP_F_RC5_CTRL = 125; + {$EXTERNALSYM EVP_R_AES_IV_SETUP_FAILED} + EVP_R_AES_IV_SETUP_FAILED = 162; + {$EXTERNALSYM EVP_R_AES_KEY_SETUP_FAILED} + EVP_R_AES_KEY_SETUP_FAILED = 143; + {$EXTERNALSYM EVP_R_ASN1_LIB} + EVP_R_ASN1_LIB = 140; + {$EXTERNALSYM EVP_R_BAD_BLOCK_LENGTH} + EVP_R_BAD_BLOCK_LENGTH = 136; + {$EXTERNALSYM EVP_R_BAD_DECRYPT} + EVP_R_BAD_DECRYPT = 100; + {$EXTERNALSYM EVP_R_BN_DECODE_ERROR} + EVP_R_BN_DECODE_ERROR = 112; + {$EXTERNALSYM EVP_R_BN_PUBKEY_ERROR} + EVP_R_BN_PUBKEY_ERROR = 113; + {$EXTERNALSYM EVP_R_BUFFER_TOO_SMALL} + EVP_R_BUFFER_TOO_SMALL = 155; + {$EXTERNALSYM EVP_R_CIPHER_PARAMETER_ERROR} + EVP_R_CIPHER_PARAMETER_ERROR = 122; + {$EXTERNALSYM EVP_R_COMMAND_NOT_SUPPORTED} + EVP_R_COMMAND_NOT_SUPPORTED = 147; + {$EXTERNALSYM EVP_R_DECODE_ERROR} + EVP_R_DECODE_ERROR = 114; + {$EXTERNALSYM EVP_R_DIFFERENT_KEY_TYPES} + EVP_R_DIFFERENT_KEY_TYPES = 101; + {$EXTERNALSYM EVP_R_DIFFERENT_PARAMETERS} + EVP_R_DIFFERENT_PARAMETERS = 153; + {$EXTERNALSYM EVP_R_DISABLED_FOR_FIPS} + EVP_R_DISABLED_FOR_FIPS = 163; //was 144; + + {$EXTERNALSYM EVP_R_ENCODE_ERROR} + EVP_R_ENCODE_ERROR = 115; + {$EXTERNALSYM EVP_R_ERROR_LOADING_SECTION} + EVP_R_ERROR_LOADING_SECTION = 165; + {$EXTERNALSYM EVP_R_ERROR_SETTING_FIPS_MODE} + EVP_R_ERROR_SETTING_FIPS_MODE = 166; + + {$EXTERNALSYM EVP_R_EVP_PBE_CIPHERINIT_ERROR} + EVP_R_EVP_PBE_CIPHERINIT_ERROR = 119; + {$EXTERNALSYM EVP_R_EXPECTING_AN_RSA_KEY} + EVP_R_EXPECTING_AN_RSA_KEY = 127; + {$EXTERNALSYM EVP_R_EXPECTING_A_DH_KEY} + EVP_R_EXPECTING_A_DH_KEY = 128; + {$EXTERNALSYM EVP_R_EXPECTING_A_DSA_KEY} + EVP_R_EXPECTING_A_DSA_KEY = 129; + {$EXTERNALSYM EVP_R_EXPECTING_A_ECDSA_KEY} + EVP_R_EXPECTING_A_ECDSA_KEY = 141; + {$EXTERNALSYM EVP_R_EXPECTING_A_EC_KEY} + EVP_R_EXPECTING_A_EC_KEY = 142; + {$EXTERNALSYM EVP_R_FIPS_MODE_NOT_SUPPORTED} + EVP_R_FIPS_MODE_NOT_SUPPORTED = 167; + {$EXTERNALSYM EVP_R_INITIALIZATION_ERROR} + EVP_R_INITIALIZATION_ERROR = 134; + {$EXTERNALSYM EVP_R_INPUT_NOT_INITIALIZED} + EVP_R_INPUT_NOT_INITIALIZED = 111; + {$EXTERNALSYM EVP_R_INVALID_DIGEST} + EVP_R_INVALID_DIGEST = 152; + {$EXTERNALSYM EVP_R_INVALID_KEY_LENGTH} + EVP_R_INVALID_KEY_LENGTH = 130; + {$EXTERNALSYM EVP_R_INVALID_OPERATION} + EVP_R_INVALID_OPERATION = 148; + {$EXTERNALSYM EVP_R_INVALID_FIPS_MODE} + EVP_R_INVALID_FIPS_MODE = 168; //was: 148; + {$EXTERNALSYM EVP_R_IV_TOO_LARGE} + EVP_R_IV_TOO_LARGE = 102; + {$EXTERNALSYM EVP_R_KEYGEN_FAILURE} + EVP_R_KEYGEN_FAILURE = 120; + {$EXTERNALSYM EVP_R_MESSAGE_DIGEST_IS_NULL} + EVP_R_MESSAGE_DIGEST_IS_NULL = 159; + {$EXTERNALSYM EVP_R_METHOD_NOT_SUPPORTED} + EVP_R_METHOD_NOT_SUPPORTED = 144; + {$EXTERNALSYM EVP_R_MISSING_PARMATERS} + EVP_R_MISSING_PARMATERS = 103; + {$EXTERNALSYM EVP_R_NO_CIPHER_SET} + EVP_R_NO_CIPHER_SET = 131; + {$EXTERNALSYM EVP_R_NO_DEFAULT_DIGEST} + EVP_R_NO_DEFAULT_DIGEST = 158; + {$EXTERNALSYM EVP_R_NO_DIGEST_SET} + EVP_R_NO_DIGEST_SET = 139; + {$EXTERNALSYM EVP_R_NO_DSA_PARAMETERS} + EVP_R_NO_DSA_PARAMETERS = 116; + {$EXTERNALSYM EVP_R_NO_KEY_SET} + EVP_R_NO_KEY_SET = 154; + {$EXTERNALSYM EVP_R_NO_OPERATION_SET} + EVP_R_NO_OPERATION_SET = 149; + {$EXTERNALSYM EVP_R_NO_SIGN_FUNCTION_CONFIGURED} + EVP_R_NO_SIGN_FUNCTION_CONFIGURED = 104; + {$EXTERNALSYM EVP_R_NO_VERIFY_FUNCTION_CONFIGURED} + EVP_R_NO_VERIFY_FUNCTION_CONFIGURED = 105; + {$EXTERNALSYM EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE} + EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE = 150; + {$EXTERNALSYM EVP_R_OPERATON_NOT_INITIALIZED} + EVP_R_OPERATON_NOT_INITIALIZED = 151; + {$EXTERNALSYM EVP_R_PKCS8_UNKNOWN_BROKEN_TYPE} + EVP_R_PKCS8_UNKNOWN_BROKEN_TYPE = 117; + {$EXTERNALSYM EVP_R_PRIVATE_KEY_DECODE_ERROR} + EVP_R_PRIVATE_KEY_DECODE_ERROR = 145; + {$EXTERNALSYM EVP_R_PRIVATE_KEY_ENCODE_ERROR} + EVP_R_PRIVATE_KEY_ENCODE_ERROR = 146; + {$EXTERNALSYM EVP_R_PUBLIC_KEY_NOT_RSA} + EVP_R_PUBLIC_KEY_NOT_RSA = 106; + {$EXTERNALSYM EVP_R_TOO_LARGE} + EVP_R_TOO_LARGE = 164; + {$EXTERNALSYM EVP_R_UNKNOWN_CIPHER} + EVP_R_UNKNOWN_CIPHER = 160; + {$EXTERNALSYM EVP_R_UNKNOWN_DIGEST} + EVP_R_UNKNOWN_DIGEST = 161; + {$EXTERNALSYM EVP_R_UNKNOWN_OPTION} + EVP_R_UNKNOWN_OPTION = 169; //149; + {$EXTERNALSYM EVP_R_UNKNOWN_PBE_ALGORITHM} + EVP_R_UNKNOWN_PBE_ALGORITHM = 121; + {$EXTERNALSYM EVP_R_UNSUPPORTED_CIPHER} + EVP_R_UNSUPPORTED_CIPHER = 107; + {$EXTERNALSYM EVP_R_UNSUPORTED_NUMBER_OF_ROUNDS} + EVP_R_UNSUPORTED_NUMBER_OF_ROUNDS = 135; + + {$EXTERNALSYM EVP_R_UNSUPPORTED_KEYLENGTH} + EVP_R_UNSUPPORTED_KEYLENGTH = 123; + {$EXTERNALSYM EVP_R_UNSUPPORTED_KEY_DERIVATION_FUNCTION} + EVP_R_UNSUPPORTED_KEY_DERIVATION_FUNCTION = 124; + {$EXTERNALSYM EVP_R_UNSUPPORTED_KEY_SIZE} + EVP_R_UNSUPPORTED_KEY_SIZE = 108; + {$EXTERNALSYM EVP_R_UNSUPPORTED_PRF} + EVP_R_UNSUPPORTED_PRF = 125; + {$EXTERNALSYM EVP_R_UNSUPPORTED_PRIVATE_KEY_ALGORITHM} + EVP_R_UNSUPPORTED_PRIVATE_KEY_ALGORITHM = 118; + {$EXTERNALSYM EVP_R_UNSUPPORTED_SALT_TYPE} + EVP_R_UNSUPPORTED_SALT_TYPE = 126; + {$EXTERNALSYM EVP_R_WRONG_FINAL_BLOCK_LENGTH} + EVP_R_WRONG_FINAL_BLOCK_LENGTH = 109; + {$EXTERNALSYM EVP_R_WRONG_PUBLIC_KEY_TYPE} + EVP_R_WRONG_PUBLIC_KEY_TYPE = 110; + {$EXTERNALSYM EVP_R_SEED_KEY_SETUP_FAILED} + EVP_R_SEED_KEY_SETUP_FAILED = 162; + {$IFDEF OPENSSL_FIPS} +//* Function codes. */ + {$EXTERNALSYM FIPS_F_DH_BUILTIN_GENPARAMS} + FIPS_F_DH_BUILTIN_GENPARAMS = 100; + {$EXTERNALSYM FIPS_F_DSA_BUILTIN_PARAMGEN} + FIPS_F_DSA_BUILTIN_PARAMGEN = 101; + {$EXTERNALSYM FIPS_F_DSA_DO_SIGN} + FIPS_F_DSA_DO_SIGN = 102; + {$EXTERNALSYM FIPS_F_DSA_DO_VERIFY} + FIPS_F_DSA_DO_VERIFY = 103; + {$EXTERNALSYM FIPS_F_EVP_CIPHERINIT_EX} + FIPS_F_EVP_CIPHERINIT_EX = 124; + {$EXTERNALSYM FIPS_F_EVP_DIGESTINIT_EX} + FIPS_F_EVP_DIGESTINIT_EX = 125; + {$EXTERNALSYM FIPS_F_FIPS_CHECK_DSA} + FIPS_F_FIPS_CHECK_DSA = 104; + {$EXTERNALSYM FIPS_F_FIPS_CHECK_INCORE_FINGERPRINT} + FIPS_F_FIPS_CHECK_INCORE_FINGERPRINT = 105; + {$EXTERNALSYM FIPS_F_FIPS_CHECK_RSA} + FIPS_F_FIPS_CHECK_RSA = 106; + {$EXTERNALSYM FIPS_F_FIPS_DSA_CHECK} + FIPS_F_FIPS_DSA_CHECK = 107; + {$EXTERNALSYM FIPS_F_FIPS_MODE_SET} + FIPS_F_FIPS_MODE_SET = 108; + {$EXTERNALSYM FIPS_F_FIPS_PKEY_SIGNATURE_TEST} + FIPS_F_FIPS_PKEY_SIGNATURE_TEST = 109; + {$EXTERNALSYM FIPS_F_FIPS_SELFTEST_AES} + FIPS_F_FIPS_SELFTEST_AES = 110; + {$EXTERNALSYM FIPS_F_FIPS_SELFTEST_DES} + FIPS_F_FIPS_SELFTEST_DES = 111; + {$EXTERNALSYM FIPS_F_FIPS_SELFTEST_DSA} + FIPS_F_FIPS_SELFTEST_DSA = 112; + {$EXTERNALSYM FIPS_F_FIPS_SELFTEST_HMAC} + FIPS_F_FIPS_SELFTEST_HMAC = 113; + {$EXTERNALSYM FIPS_F_FIPS_SELFTEST_RNG} + FIPS_F_FIPS_SELFTEST_RNG = 114; + {$EXTERNALSYM FIPS_F_FIPS_SELFTEST_SHA1} + FIPS_F_FIPS_SELFTEST_SHA1 = 115; + {$EXTERNALSYM FIPS_F_HASH_FINAL} + FIPS_F_HASH_FINAL = 123; + {$EXTERNALSYM FIPS_F_RSA_BUILTIN_KEYGEN} + FIPS_F_RSA_BUILTIN_KEYGEN = 116; + {$EXTERNALSYM FIPS_F_RSA_EAY_PRIVATE_DECRYPT} + FIPS_F_RSA_EAY_PRIVATE_DECRYPT = 117; + {$EXTERNALSYM FIPS_F_RSA_EAY_PRIVATE_ENCRYPT} + FIPS_F_RSA_EAY_PRIVATE_ENCRYPT = 118; + {$EXTERNALSYM FIPS_F_RSA_EAY_PUBLIC_DECRYPT} + FIPS_F_RSA_EAY_PUBLIC_DECRYPT = 119; + {$EXTERNALSYM FIPS_F_RSA_EAY_PUBLIC_ENCRYPT} + FIPS_F_RSA_EAY_PUBLIC_ENCRYPT = 120; + {$EXTERNALSYM FIPS_F_RSA_X931_GENERATE_KEY_EX} + FIPS_F_RSA_X931_GENERATE_KEY_EX = 121; + {$EXTERNALSYM FIPS_F_SSLEAY_RAND_BYTES} + FIPS_F_SSLEAY_RAND_BYTES = 122; +//* Reason codes. */ + {$EXTERNALSYM FIPS_R_CANNOT_READ_EXE} + FIPS_R_CANNOT_READ_EXE = 103; + {$EXTERNALSYM FIPS_R_CANNOT_READ_EXE_DIGEST} + FIPS_R_CANNOT_READ_EXE_DIGEST = 104; + {$EXTERNALSYM FIPS_R_CONTRADICTING_EVIDENCE} + FIPS_R_CONTRADICTING_EVIDENCE = 114; + {$EXTERNALSYM FIPS_R_EXE_DIGEST_DOES_NOT_MATCH} + FIPS_R_EXE_DIGEST_DOES_NOT_MATCH = 105; + {$EXTERNALSYM FIPS_R_FINGERPRINT_DOES_NOT_MATCH} + FIPS_R_FINGERPRINT_DOES_NOT_MATCH = 110; + {$EXTERNALSYM FIPS_R_FINGERPRINT_DOES_NOT_MATCH_NONPIC_RELOCATED} + FIPS_R_FINGERPRINT_DOES_NOT_MATCH_NONPIC_RELOCATED = 111; + {$EXTERNALSYM FIPS_R_FINGERPRINT_DOES_NOT_MATCH_SEGMENT_ALIASING} + FIPS_R_FINGERPRINT_DOES_NOT_MATCH_SEGMENT_ALIASING = 112; + {$EXTERNALSYM FIPS_R_FIPS_MODE_ALREADY_SET} + FIPS_R_FIPS_MODE_ALREADY_SET = 102; + {$EXTERNALSYM FIPS_R_FIPS_SELFTEST_FAILED} + FIPS_R_FIPS_SELFTEST_FAILED = 106; + {$EXTERNALSYM FIPS_R_INVALID_KEY_LENGTH} + FIPS_R_INVALID_KEY_LENGTH = 109; + {$EXTERNALSYM FIPS_R_KEY_TOO_SHORT} + FIPS_R_KEY_TOO_SHORT = 108; + {$EXTERNALSYM FIPS_R_NON_FIPS_METHOD} + FIPS_R_NON_FIPS_METHOD = 100; + {$EXTERNALSYM FIPS_R_PAIRWISE_TEST_FAILED} + FIPS_R_PAIRWISE_TEST_FAILED = 107; + {$EXTERNALSYM FIPS_R_RSA_DECRYPT_ERROR} + FIPS_R_RSA_DECRYPT_ERROR = 115; + {$EXTERNALSYM FIPS_R_RSA_ENCRYPT_ERROR} + FIPS_R_RSA_ENCRYPT_ERROR = 116; + {$EXTERNALSYM FIPS_R_SELFTEST_FAILED} + FIPS_R_SELFTEST_FAILED = 101; + {$EXTERNALSYM FIPS_R_TEST_FAILURE} + FIPS_R_TEST_FAILURE = 117; + {$EXTERNALSYM FIPS_R_UNSUPPORTED_PLATFORM} + FIPS_R_UNSUPPORTED_PLATFORM = 113; + {$ENDIF} + {$IFNDEF OPENSSL_NO_ENGINE} +//* These flags are used to control combinations of algorithm (methods) +// * by bitwise "OR"ing. */ + {$EXTERNALSYM ENGINE_METHOD_RSA : TIdC_UINT} + ENGINE_METHOD_RSA : TIdC_UINT = $0001; + {$EXTERNALSYM ENGINE_METHOD_DSA : TIdC_UINT} + ENGINE_METHOD_DSA : TIdC_UINT = $0002; + {$EXTERNALSYM ENGINE_METHOD_DH : TIdC_UINT} + ENGINE_METHOD_DH : TIdC_UINT = $0004; + {$EXTERNALSYM ENGINE_METHOD_RAND : TIdC_UINT} + ENGINE_METHOD_RAND : TIdC_UINT = $0008; + {$EXTERNALSYM ENGINE_METHOD_ECDH : TIdC_UINT} + ENGINE_METHOD_ECDH : TIdC_UINT = $0010; + {$EXTERNALSYM ENGINE_METHOD_ECDSA : TIdC_UINT} + ENGINE_METHOD_ECDSA : TIdC_UINT = $0020; + {$EXTERNALSYM ENGINE_METHOD_CIPHERS : TIdC_UINT} + ENGINE_METHOD_CIPHERS : TIdC_UINT = $0040; + {$EXTERNALSYM ENGINE_METHOD_DIGESTS : TIdC_UINT} + ENGINE_METHOD_DIGESTS : TIdC_UINT = $0080; + {$EXTERNALSYM ENGINE_METHOD_STORE : TIdC_UINT} + ENGINE_METHOD_STORE : TIdC_UINT = $0100; + {$EXTERNALSYM ENGINE_METHOD_PKEY_METHS : TIdC_UINT} + ENGINE_METHOD_PKEY_METHS : TIdC_UINT = $0200; + {$EXTERNALSYM ENGINE_METHOD_PKEY_ASN1_METHS : TIdC_UINT} + ENGINE_METHOD_PKEY_ASN1_METHS : TIdC_UINT = $0400; + +//* Obvious all-or-nothing cases. */ + {$EXTERNALSYM ENGINE_METHOD_ALL : TIdC_UINT} + ENGINE_METHOD_ALL : TIdC_UINT = $FFFF; + {$EXTERNALSYM ENGINE_METHOD_NONE : TIdC_UINT} + ENGINE_METHOD_NONE : TIdC_UINT = $0000; + {$EXTERNALSYM ENGINE_TABLE_FLAG_NOINIT : TIdC_UINT} + ENGINE_TABLE_FLAG_NOINIT : TIdC_UINT = $0001; + + {$EXTERNALSYM ENGINE_FLAGS_MANUAL_CMD_CTRL : TIdC_INT} + ENGINE_FLAGS_MANUAL_CMD_CTRL : TIdC_INT = $0002; + {$EXTERNALSYM ENGINE_FLAGS_BY_ID_COPY : TIdC_INT} + ENGINE_FLAGS_BY_ID_COPY : TIdC_INT = $0004; + {$EXTERNALSYM ENGINE_CMD_FLAG_NUMERIC : TIdC_UINT} + ENGINE_CMD_FLAG_NUMERIC : TIdC_UINT = $0001; + {$EXTERNALSYM ENGINE_CMD_FLAG_STRING : TIdC_UINT} + ENGINE_CMD_FLAG_STRING : TIdC_UINT = $0002; + {$EXTERNALSYM ENGINE_CMD_FLAG_NO_INPUT : TIdC_UINT} + ENGINE_CMD_FLAG_NO_INPUT : TIdC_UINT = $0004; + {$EXTERNALSYM ENGINE_CMD_FLAG_INTERNAL : TIdC_UINT} + ENGINE_CMD_FLAG_INTERNAL : TIdC_UINT = $0008; + + {$EXTERNALSYM ENGINE_CTRL_SET_LOGSTREAM} + ENGINE_CTRL_SET_LOGSTREAM = 1; + {$EXTERNALSYM ENGINE_CTRL_SET_PASSWORD_CALLBACK} + ENGINE_CTRL_SET_PASSWORD_CALLBACK = 2; + {$EXTERNALSYM ENGINE_CTRL_HUP} + ENGINE_CTRL_HUP = 3; + //* Close and reinitialise any + // handles/connections etc. */ + {$EXTERNALSYM ENGINE_CTRL_SET_USER_INTERFACE} + ENGINE_CTRL_SET_USER_INTERFACE = 4; //* Alternative to callback */ + {$EXTERNALSYM _CALLBACK_DATA} + _CALLBACK_DATA = 5; + //* User-specific data, used + // when calling the password + // callback and the user + // interface */ + {$EXTERNALSYM D_CONFIGURATION} + D_CONFIGURATION = 6; + //* Load a configuration, given + //a string that represents a + //file name or so */ + {$EXTERNALSYM D_SECTION} + D_SECTION = 7; + ///* Load data from a given + //section in the already loaded + //configuration */ + +////* Returns non-zero if the supplied ENGINE has a ctrl() handler. If "not", then +// * all the remaining control commands will return failure, so it is worth +// * checking this first if the caller is trying to "discover" the engine's +// * capabilities and doesn't want errors generated unnecessarily. */ + {$EXTERNALSYM ENGINE_CTRL_HAS_CTRL_FUNCTION} + ENGINE_CTRL_HAS_CTRL_FUNCTION = 10; +///* Returns a positive command number for the first command supported by the +// * engine. Returns zero if no ctrl commands are supported. */ + {$EXTERNALSYM ENGINE_CTRL_GET_FIRST_CMD_TYPE} + ENGINE_CTRL_GET_FIRST_CMD_TYPE = 11; +///* The 'long' argument specifies a command implemented by the engine, and the +// * return value is the next command supported, or zero if there are no more. */ + {$EXTERNALSYM ENGINE_CTRL_GET_NEXT_CMD_TYPE} + ENGINE_CTRL_GET_NEXT_CMD_TYPE = 12; +///* The 'void*' argument is a command name (cast from 'const char *'), and the +// * return value is the command that corresponds to it. */ + {$EXTERNALSYM ENGINE_CTRL_GET_CMD_FROM_NAME} + ENGINE_CTRL_GET_CMD_FROM_NAME = 13; +///* The next two allow a command to be converted into its corresponding string +// * form. In each case, the 'long' argument supplies the command. In the NAME_LEN +// * case, the return value is the length of the command name (not counting a +// * trailing EOL). In the NAME case, the 'void*' argument must be a string buffer +// * large enough, and it will be populated with the name of the command (WITH a +// * trailing EOL). */ + {$EXTERNALSYM ENGINE_CTRL_GET_NAME_LEN_FROM_CMD} + ENGINE_CTRL_GET_NAME_LEN_FROM_CMD = 14; + {$EXTERNALSYM ENGINE_CTRL_GET_NAME_FROM_CMD} + ENGINE_CTRL_GET_NAME_FROM_CMD = 15; +//* The next two are similar but give a "short description" of a command. */ + {$EXTERNALSYM ENGINE_CTRL_GET_DESC_LEN_FROM_CMD} + ENGINE_CTRL_GET_DESC_LEN_FROM_CMD = 16; + {$EXTERNALSYM ENGINE_CTRL_GET_DESC_FROM_CMD} + ENGINE_CTRL_GET_DESC_FROM_CMD = 17; +///* With this command, the return value is the OR'd combination of +// * ENGINE_CMD_FLAG_*** values that indicate what kind of input a given +// * engine-specific ctrl command expects. */ + {$EXTERNALSYM ENGINE_CTRL_GET_CMD_FLAGS} + ENGINE_CTRL_GET_CMD_FLAGS = 18; + +///* ENGINE implementations should start the numbering of their own control +// * commands from this value. (ie. ENGINE_CMD_BASE, ENGINE_CMD_BASE + 1, etc). */ + {$EXTERNALSYM ENGINE_CMD_BASE} + ENGINE_CMD_BASE = 200; + +///* NB: These 2 nCipher "chil" control commands are deprecated, and their +// * functionality is now available through ENGINE-specific control commands +// * (exposed through the above-mentioned 'CMD'-handling). Code using these 2 +// * commands should be migrated to the more general command handling before these +// * are removed. */ + +//* Flags specific to the nCipher "chil" engine */ + {$EXTERNALSYM ENGINE_CTRL_CHIL_SET_FORKCHECK} + ENGINE_CTRL_CHIL_SET_FORKCHECK = 100; +///* Depending on the value of the (long)i argument, this sets or +// * unsets the SimpleForkCheck flag in the CHIL API to enable or +// * disable checking and workarounds for applications that fork(). +// */ + {$EXTERNALSYM ENGINE_CTRL_CHIL_NO_LOCKING} + ENGINE_CTRL_CHIL_NO_LOCKING = 101; +///* This prevents the initialisation function from providing mutex +// * callbacks to the nCipher library. */ + +///* Binary/behaviour compatibility levels */ + {$EXTERNALSYM OSSL_DYNAMIC_VERSION : TIdC_UINT} + OSSL_DYNAMIC_VERSION : TIdC_UINT = $00020000; +///* Binary versions older than this are too old for us (whether we're a loader or +// * a loadee) */ + {$EXTERNALSYM OSSL_DYNAMIC_OLDEST : TIdC_UINT} + OSSL_DYNAMIC_OLDEST : TIdC_UINT = $00020000; +//* Function codes. */ + {$EXTERNALSYM ENGINE_F_DYNAMIC_CTRL} + ENGINE_F_DYNAMIC_CTRL = 180; + {$EXTERNALSYM ENGINE_F_DYNAMIC_GET_DATA_CTX} + ENGINE_F_DYNAMIC_GET_DATA_CTX = 181; + {$EXTERNALSYM ENGINE_F_DYNAMIC_LOAD} + ENGINE_F_DYNAMIC_LOAD = 182; + {$EXTERNALSYM ENGINE_F_DYNAMIC_SET_DATA_CTX} + ENGINE_F_DYNAMIC_SET_DATA_CTX = 183; + {$EXTERNALSYM ENGINE_F_ENGINE_ADD} + ENGINE_F_ENGINE_ADD = 105; + {$EXTERNALSYM ENGINE_F_ENGINE_BY_ID} + ENGINE_F_ENGINE_BY_ID = 106; + {$EXTERNALSYM ENGINE_F_ENGINE_CMD_IS_EXECUTABLE} + ENGINE_F_ENGINE_CMD_IS_EXECUTABLE = 170; + {$EXTERNALSYM ENGINE_F_ENGINE_CTRL} + ENGINE_F_ENGINE_CTRL = 142; + {$EXTERNALSYM ENGINE_F_ENGINE_CTRL_CMD} + ENGINE_F_ENGINE_CTRL_CMD = 178; + {$EXTERNALSYM ENGINE_F_ENGINE_CTRL_CMD_STRING} + ENGINE_F_ENGINE_CTRL_CMD_STRING = 171; + {$EXTERNALSYM ENGINE_F_ENGINE_FINISH} + ENGINE_F_ENGINE_FINISH = 107; + {$EXTERNALSYM ENGINE_F_ENGINE_FREE_UTIL} + ENGINE_F_ENGINE_FREE_UTIL = 108; + {$EXTERNALSYM ENGINE_F_ENGINE_GET_CIPHER} + ENGINE_F_ENGINE_GET_CIPHER = 185; + {$EXTERNALSYM ENGINE_F_ENGINE_GET_DEFAULT_TYPE} + ENGINE_F_ENGINE_GET_DEFAULT_TYPE = 177; + {$EXTERNALSYM ENGINE_F_ENGINE_GET_DIGEST} + ENGINE_F_ENGINE_GET_DIGEST = 186; + {$EXTERNALSYM ENGINE_F_ENGINE_GET_NEXT} + ENGINE_F_ENGINE_GET_NEXT = 115; + {$EXTERNALSYM ENGINE_F_ENGINE_GET_PKEY_ASN1_METH} + ENGINE_F_ENGINE_GET_PKEY_ASN1_METH = 193; + {$EXTERNALSYM ENGINE_F_ENGINE_GET_PKEY_METH} + ENGINE_F_ENGINE_GET_PKEY_METH = 192; + {$EXTERNALSYM ENGINE_F_ENGINE_GET_PREV} + ENGINE_F_ENGINE_GET_PREV = 116; + {$EXTERNALSYM ENGINE_F_ENGINE_INIT} + ENGINE_F_ENGINE_INIT = 119; + {$EXTERNALSYM ENGINE_F_ENGINE_LIST_ADD} + ENGINE_F_ENGINE_LIST_ADD = 120; + {$EXTERNALSYM ENGINE_F_ENGINE_LIST_REMOVE} + ENGINE_F_ENGINE_LIST_REMOVE = 121; + {$EXTERNALSYM ENGINE_F_ENGINE_LOAD_PRIVATE_KEY} + ENGINE_F_ENGINE_LOAD_PRIVATE_KEY = 150; + {$EXTERNALSYM ENGINE_F_ENGINE_LOAD_PUBLIC_KEY} + ENGINE_F_ENGINE_LOAD_PUBLIC_KEY = 151; + //was ENGINE_F_ENGINE_LOAD_SSL_CLIENT_CERT = 192; + {$EXTERNALSYM ENGINE_F_ENGINE_LOAD_SSL_CLIENT_CERT} + ENGINE_F_ENGINE_LOAD_SSL_CLIENT_CERT = 194; + + {$EXTERNALSYM ENGINE_F_ENGINE_NEW} + ENGINE_F_ENGINE_NEW = 122; + {$EXTERNALSYM ENGINE_F_ENGINE_REMOVE} + ENGINE_F_ENGINE_REMOVE = 123; + {$EXTERNALSYM ENGINE_F_ENGINE_SET_DEFAULT_STRING} + ENGINE_F_ENGINE_SET_DEFAULT_STRING = 189; + {$EXTERNALSYM ENGINE_F_ENGINE_SET_DEFAULT_TYPE} + ENGINE_F_ENGINE_SET_DEFAULT_TYPE = 126; + {$EXTERNALSYM ENGINE_F_ENGINE_SET_ID} + ENGINE_F_ENGINE_SET_ID = 129; + {$EXTERNALSYM ENGINE_F_ENGINE_SET_NAME} + ENGINE_F_ENGINE_SET_NAME = 130; + {$EXTERNALSYM ENGINE_F_ENGINE_TABLE_REGISTER} + ENGINE_F_ENGINE_TABLE_REGISTER = 184; + {$EXTERNALSYM ENGINE_F_ENGINE_UNLOAD_KEY} + ENGINE_F_ENGINE_UNLOAD_KEY = 152; + {$EXTERNALSYM ENGINE_F_ENGINE_UNLOCKED_FINISH} + ENGINE_F_ENGINE_UNLOCKED_FINISH = 191; + {$EXTERNALSYM ENGINE_F_ENGINE_UP_REF} + ENGINE_F_ENGINE_UP_REF = 190; + {$EXTERNALSYM ENGINE_F_INT_CTRL_HELPER} + ENGINE_F_INT_CTRL_HELPER = 172; + {$EXTERNALSYM ENGINE_F_INT_ENGINE_CONFIGURE} + ENGINE_F_INT_ENGINE_CONFIGURE = 188; + {$EXTERNALSYM ENGINE_F_INT_ENGINE_MODULE_INIT} + ENGINE_F_INT_ENGINE_MODULE_INIT = 187; + {$EXTERNALSYM ENGINE_F_LOG_MESSAGE} + ENGINE_F_LOG_MESSAGE = 141; +//* Reason codes. */ + {$EXTERNALSYM ENGINE_R_ALREADY_LOADED} + ENGINE_R_ALREADY_LOADED = 100; + {$EXTERNALSYM ENGINE_R_ARGUMENT_IS_NOT_A_NUMBER} + ENGINE_R_ARGUMENT_IS_NOT_A_NUMBER = 133; + {$EXTERNALSYM ENGINE_R_CMD_NOT_EXECUTABLE} + ENGINE_R_CMD_NOT_EXECUTABLE = 134; + {$EXTERNALSYM ENGINE_R_COMMAND_TAKES_INPUT} + ENGINE_R_COMMAND_TAKES_INPUT = 135; + {$EXTERNALSYM ENGINE_R_COMMAND_TAKES_NO_INPUT} + ENGINE_R_COMMAND_TAKES_NO_INPUT = 136; + {$EXTERNALSYM ENGINE_R_CONFLICTING_ENGINE_ID} + ENGINE_R_CONFLICTING_ENGINE_ID = 103; + {$EXTERNALSYM ENGINE_R_CTRL_COMMAND_NOT_IMPLEMENTED} + ENGINE_R_CTRL_COMMAND_NOT_IMPLEMENTED = 119; + {$EXTERNALSYM ENGINE_R_DH_NOT_IMPLEMENTED} + ENGINE_R_DH_NOT_IMPLEMENTED = 139; + {$EXTERNALSYM ENGINE_R_DSA_NOT_IMPLEMENTED} + ENGINE_R_DSA_NOT_IMPLEMENTED = 140; + {$EXTERNALSYM ENGINE_R_DSO_FAILURE} + ENGINE_R_DSO_FAILURE = 104; + {$EXTERNALSYM ENGINE_R_DSO_NOT_FOUND} + ENGINE_R_DSO_NOT_FOUND = 132; + {$EXTERNALSYM ENGINE_R_ENGINES_SECTION_ERROR} + ENGINE_R_ENGINES_SECTION_ERROR = 148; +//was: ENGINE_R_ENGINE_CONFIGURATION_ERROR = 101; + {$EXTERNALSYM ENGINE_R_ENGINE_CONFIGURATION_ERROR} + ENGINE_R_ENGINE_CONFIGURATION_ERROR = 102; + + {$EXTERNALSYM ENGINE_R_ENGINE_IS_NOT_IN_LIST} + ENGINE_R_ENGINE_IS_NOT_IN_LIST = 105; + {$EXTERNALSYM ENGINE_R_ENGINE_SECTION_ERROR} + ENGINE_R_ENGINE_SECTION_ERROR = 149; + {$EXTERNALSYM ENGINE_R_FAILED_LOADING_PRIVATE_KEY} + ENGINE_R_FAILED_LOADING_PRIVATE_KEY = 128; + {$EXTERNALSYM ENGINE_R_FAILED_LOADING_PUBLIC_KEY} + ENGINE_R_FAILED_LOADING_PUBLIC_KEY = 129; + {$EXTERNALSYM ENGINE_R_FINISH_FAILED} + ENGINE_R_FINISH_FAILED = 106; + {$EXTERNALSYM ENGINE_R_GET_HANDLE_FAILED} + ENGINE_R_GET_HANDLE_FAILED = 107; + {$EXTERNALSYM ENGINE_R_ID_OR_NAME_MISSING} + ENGINE_R_ID_OR_NAME_MISSING = 108; + {$EXTERNALSYM ENGINE_R_INIT_FAILED} + ENGINE_R_INIT_FAILED = 109; + {$EXTERNALSYM ENGINE_R_INTERNAL_LIST_ERROR} + ENGINE_R_INTERNAL_LIST_ERROR = 110; + {$EXTERNALSYM ENGINE_R_INVALID_ARGUMENT} + ENGINE_R_INVALID_ARGUMENT = 143; + {$EXTERNALSYM ENGINE_R_INVALID_CMD_NAME} + ENGINE_R_INVALID_CMD_NAME = 137; + {$EXTERNALSYM ENGINE_R_INVALID_CMD_NUMBER} + ENGINE_R_INVALID_CMD_NUMBER = 138; + {$EXTERNALSYM ENGINE_R_INVALID_INIT_VALUE} + ENGINE_R_INVALID_INIT_VALUE = 151; + {$EXTERNALSYM ENGINE_R_INVALID_STRING} + ENGINE_R_INVALID_STRING = 150; + {$EXTERNALSYM ENGINE_R_NOT_INITIALISED} + ENGINE_R_NOT_INITIALISED = 117; + {$EXTERNALSYM ENGINE_R_NOT_LOADED} + ENGINE_R_NOT_LOADED = 112; + {$EXTERNALSYM ENGINE_R_NO_CONTROL_FUNCTION} + ENGINE_R_NO_CONTROL_FUNCTION = 120; + {$EXTERNALSYM ENGINE_R_NO_INDEX} + ENGINE_R_NO_INDEX = 144; + {$EXTERNALSYM ENGINE_R_NO_LOAD_FUNCTION} + ENGINE_R_NO_LOAD_FUNCTION = 125; + {$EXTERNALSYM ENGINE_R_NO_REFERENCE} + ENGINE_R_NO_REFERENCE = 130; + {$EXTERNALSYM ENGINE_R_NO_SUCH_ENGINE} + ENGINE_R_NO_SUCH_ENGINE = 116; + {$EXTERNALSYM ENGINE_R_NO_UNLOAD_FUNCTION} + ENGINE_R_NO_UNLOAD_FUNCTION = 126; + {$EXTERNALSYM ENGINE_R_PROVIDE_PARAMETERS} + ENGINE_R_PROVIDE_PARAMETERS = 113; + {$EXTERNALSYM ENGINE_R_RSA_NOT_IMPLEMENTED} + ENGINE_R_RSA_NOT_IMPLEMENTED = 141; + {$EXTERNALSYM ENGINE_R_UNIMPLEMENTED_CIPHER} + ENGINE_R_UNIMPLEMENTED_CIPHER = 146; + {$EXTERNALSYM ENGINE_R_UNIMPLEMENTED_DIGEST} + ENGINE_R_UNIMPLEMENTED_DIGEST = 147; + {$EXTERNALSYM ENGINE_R_UNIMPLEMENTED_PUBLIC_KEY_METHOD} + ENGINE_R_UNIMPLEMENTED_PUBLIC_KEY_METHOD = 101; + {$EXTERNALSYM ENGINE_R_VERSION_INCOMPATIBILITY} + ENGINE_R_VERSION_INCOMPATIBILITY = 145; +{$ENDIF} + {$EXTERNALSYM MSS_EXIT_FAILURE} + MSS_EXIT_FAILURE = 1; + {$EXTERNALSYM MSS_EXIT_SUCCESS} + MSS_EXIT_SUCCESS = 0; + {$EXTERNALSYM FILENAME_MAX} + FILENAME_MAX = 1024; + {$EXTERNALSYM FOPEN_MAX} + FOPEN_MAX = 20; + {$IFNDEF OPENSSL_NO_IDEA} + {$EXTERNALSYM IDEA_BLOCK} + IDEA_BLOCK = 8; + {$EXTERNALSYM IDEA_DECRYPT} + IDEA_DECRYPT = 0; + {$EXTERNALSYM IDEA_ENCRYPT} + IDEA_ENCRYPT = 1; + {$EXTERNALSYM IDEA_KEY_LENGTH} + IDEA_KEY_LENGTH = 16; + {$ENDIF} + {$EXTERNALSYM IS_SEQUENCE} + IS_SEQUENCE = 0; + {$EXTERNALSYM IS_SET} + IS_SET = 1; + {$EXTERNALSYM KRBDES_DECRYPT} + KRBDES_DECRYPT = DES_DECRYPT; + {$EXTERNALSYM KRBDES_ENCRYPT} + KRBDES_ENCRYPT = DES_ENCRYPT; + {$EXTERNALSYM LH_LOAD_MULT} + LH_LOAD_MULT = 256; + {$EXTERNALSYM L_ctermid} + L_ctermid = 16; + {$EXTERNALSYM L_cuserid} + L_cuserid = 9; + {$EXTERNALSYM L_tmpnam} + L_tmpnam = 1024; + //chamellia.h + {$IFNDEF OPENSSL_NO_CAMELLIA} + {$EXTERNALSYM CAMELLIA_ENCRYPT} + CAMELLIA_ENCRYPT = 1; + {$EXTERNALSYM CAMELLIA_DECRYPT} + CAMELLIA_DECRYPT = 0; +//* This should be a hidden type, but EVP requires that the size be known */ + + {$EXTERNALSYM CAMELLIA_BLOCK_SIZE} + CAMELLIA_BLOCK_SIZE = 16; + {$EXTERNALSYM CAMELLIA_TABLE_BYTE_LEN} + CAMELLIA_TABLE_BYTE_LEN = 272; + {$EXTERNALSYM CAMELLIA_TABLE_WORD_LEN} + CAMELLIA_TABLE_WORD_LEN = (CAMELLIA_TABLE_BYTE_LEN / 4); + {$ENDIF} + //whrlpool.h + {$EXTERNALSYM WHIRLPOOL_DIGEST_LENGTH} + WHIRLPOOL_DIGEST_LENGTH = (512 div 8); + {$EXTERNALSYM WHIRLPOOL_BBLOCK} + WHIRLPOOL_BBLOCK = 512; + {$EXTERNALSYM WHIRLPOOL_COUNTER} + WHIRLPOOL_COUNTER = (256 div 8); + {$IFNDEF OPENSSL_NO_MD2} + {$EXTERNALSYM MD2_BLOCK} + MD2_BLOCK = 16; + {$EXTERNALSYM MD2_DIGEST_LENGTH} + MD2_DIGEST_LENGTH = 16; + {$ENDIF} + {$IFNDEF OPENSSL_NO_MD4} + {$EXTERNALSYM MD4_CBLOCK} + MD4_CBLOCK = 64; + {$EXTERNALSYM MD4_LBLOCK} + MD4_LBLOCK = (MD4_CBLOCK div 4); + {$EXTERNALSYM MD4_DIGEST_LENGTH} + MD4_DIGEST_LENGTH = 16; + {$ENDIF} + {$IFNDEF OPENSSL_NO_MD5} + {$EXTERNALSYM MD5_CBLOCK} + MD5_CBLOCK = 64; + {$EXTERNALSYM MD5_LBLOCK} + MD5_LBLOCK = 16; //(MD5_CBLOCK/4); + {$EXTERNALSYM MD5_DIGEST_LENGTH} + MD5_DIGEST_LENGTH = 16; + {$ENDIF} + {$IFNDEF OPENSSL_NO_MDC2} + {$EXTERNALSYM OPENSSL_MDC2_BLOCK} + OPENSSL_MDC2_BLOCK = 8; + {$EXTERNALSYM OPENSSL_MDC2_DIGEST_LENGTH} + OPENSSL_MDC2_DIGEST_LENGTH = 16; + {$ENDIF} + {$IFNDEF OPENSSL_NO_SHA} + {$EXTERNALSYM SHA_LBLOCK} + SHA_LBLOCK = 16; + {$EXTERNALSYM SHA_CBLOCK} + SHA_CBLOCK = 64; //(SHA_LBLOCK * 4); + {$EXTERNALSYM SHA_DIGEST_LENGTH} + SHA_DIGEST_LENGTH = 20; + {$EXTERNALSYM SHA_LAST_BLOCK} + SHA_LAST_BLOCK = ( SHA_CBLOCK -8); + {$EXTERNALSYM SHA256_CBLOCK} + SHA256_CBLOCK = ( SHA_LBLOCK * 4); + {$EXTERNALSYM SHA224_DIGEST_LENGTH} + SHA224_DIGEST_LENGTH = 28; + {$EXTERNALSYM SHA256_DIGEST_LENGTH} + SHA256_DIGEST_LENGTH = 32; + {$EXTERNALSYM SHA384_DIGEST_LENGTH} + SHA384_DIGEST_LENGTH = 48; + {$EXTERNALSYM SHA512_DIGEST_LENGTH} + SHA512_DIGEST_LENGTH = 64; + {$IFNDEF OPENSSL_NO_SHA512} + {$EXTERNALSYM SHA512_CBLOCK} + SHA512_CBLOCK = (SHA_LBLOCK*8); + {$ENDIF} + {$ENDIF} + {$EXTERNALSYM LN_SMIMECapabilities} + LN_SMIMECapabilities = 'S/MIME Capabilities'; {Do not localize} + {$EXTERNALSYM LN_X500} + LN_X500 = 'X500'; {Do not localize} + {$EXTERNALSYM LN_X509} + LN_X509 = 'X509'; {Do not localize} + {$EXTERNALSYM LN_algorithm} + LN_algorithm = 'algorithm'; {Do not localize} + {$EXTERNALSYM LN_authority_key_identifier} + LN_authority_key_identifier = 'X509v3 Authority Key Identifier'; {Do not localize} + {$EXTERNALSYM LN_basic_constraints} + LN_basic_constraints = 'X509v3 Basic Constraints'; {Do not localize} + {$EXTERNALSYM LN_bf_cbc} + LN_bf_cbc = 'bf-cbc'; {Do not localize} + {$EXTERNALSYM LN_bf_cfb64} + LN_bf_cfb64 = 'bf-cfb'; {Do not localize} + {$EXTERNALSYM LN_bf_ecb} + LN_bf_ecb = 'bf-ecb'; {Do not localize} + {$EXTERNALSYM LN_bf_ofb64} + LN_bf_ofb64 = 'bf-ofb'; {Do not localize} + {$EXTERNALSYM LN_cast5_cbc} + LN_cast5_cbc = 'cast5-cbc'; {Do not localize} + {$EXTERNALSYM LN_cast5_cfb64} + LN_cast5_cfb64 = 'cast5-cfb'; {Do not localize} + {$EXTERNALSYM LN_cast5_ecb} + LN_cast5_ecb = 'cast5-ecb'; {Do not localize} + {$EXTERNALSYM LN_cast5_ofb64} + LN_cast5_ofb64 = 'cast5-ofb'; {Do not localize} + {$EXTERNALSYM LN_certBag} + LN_certBag = 'certBag'; {Do not localize} + {$EXTERNALSYM LN_certificate_policies} + LN_certificate_policies = 'X509v3 Certificate Policies'; {Do not localize} + {$EXTERNALSYM LN_client_auth} + LN_client_auth = 'TLS Web Client Authentication'; {Do not localize} + {$EXTERNALSYM LN_code_sign} + LN_code_sign = 'Code Signing'; {Do not localize} + {$EXTERNALSYM LN_commonName} + LN_commonName = 'commonName'; {Do not localize} + {$EXTERNALSYM LN_countryName} + LN_countryName = 'countryName'; {Do not localize} + {$EXTERNALSYM LN_crlBag} + LN_crlBag = 'crlBag'; {Do not localize} + {$EXTERNALSYM LN_crl_distribution_points} + LN_crl_distribution_points = 'X509v3 CRL Distribution Points'; {Do not localize} + {$EXTERNALSYM LN_crl_number} + LN_crl_number = 'X509v3 CRL Number'; {Do not localize} + {$EXTERNALSYM LN_crl_reason} + LN_crl_reason = 'CRL Reason Code'; {Do not localize} + {$EXTERNALSYM LN_delta_crl} + LN_delta_crl = 'X509v3 Delta CRL Indicator'; {Do not localize} + {$EXTERNALSYM LN_des_cbc} + LN_des_cbc = 'des-cbc'; {Do not localize} + {$EXTERNALSYM LN_des_cfb64} + LN_des_cfb64 = 'des-cfb'; {Do not localize} + {$EXTERNALSYM LN_des_ecb} + LN_des_ecb = 'des-ecb'; {Do not localize} + {$EXTERNALSYM LN_des_ede} + LN_des_ede = 'des-ede'; {Do not localize} + {$EXTERNALSYM LN_des_ede3} + LN_des_ede3 = 'des-ede3'; {Do not localize} + {$EXTERNALSYM LN_des_ede3_cbc} + LN_des_ede3_cbc = 'des-ede3-cbc'; {Do not localize} + {$EXTERNALSYM LN_des_ede3_cfb64} + LN_des_ede3_cfb64 = 'des-ede3-cfb'; {Do not localize} + {$EXTERNALSYM LN_des_ede3_ofb64} + LN_des_ede3_ofb64 = 'des-ede3-ofb'; {Do not localize} + {$EXTERNALSYM LN_des_ede_cbc} + LN_des_ede_cbc = 'des-ede-cbc'; {Do not localize} + {$EXTERNALSYM LN_des_ede_cfb64} + LN_des_ede_cfb64 = 'des-ede-cfb'; {Do not localize} + {$EXTERNALSYM LN_des_ede_ofb64} + LN_des_ede_ofb64 = 'des-ede-ofb'; {Do not localize} + {$EXTERNALSYM LN_des_ofb64} + LN_des_ofb64 = 'des-ofb'; {Do not localize} + {$EXTERNALSYM LN_description} + LN_description = 'description'; {Do not localize} + {$EXTERNALSYM LN_desx_cbc} + LN_desx_cbc = 'desx-cbc'; {Do not localize} + {$EXTERNALSYM LN_dhKeyAgreement} + LN_dhKeyAgreement = 'dhKeyAgreement'; {Do not localize} + {$EXTERNALSYM LN_dsa} + LN_dsa = 'dsaEncryption'; {Do not localize} + {$EXTERNALSYM LN_dsaWithSHA} + LN_dsaWithSHA = 'dsaWithSHA'; {Do not localize} + {$EXTERNALSYM LN_dsaWithSHA1} + LN_dsaWithSHA1 = 'dsaWithSHA1'; {Do not localize} + {$EXTERNALSYM LN_dsaWithSHA1_2} + LN_dsaWithSHA1_2 = 'dsaWithSHA1-old'; {Do not localize} + {$EXTERNALSYM LN_dsa_2} + LN_dsa_2 = 'dsaEncryption-old'; {Do not localize} + {$EXTERNALSYM LN_email_protect} + LN_email_protect = 'E-mail Protection'; {Do not localize} + {$EXTERNALSYM LN_ext_key_usage} + LN_ext_key_usage = 'X509v3 Extended Key Usage'; {Do not localize} + {$EXTERNALSYM LN_friendlyName} + LN_friendlyName = 'friendlyName'; {Do not localize} + {$EXTERNALSYM LN_givenName} + LN_givenName = 'givenName'; {Do not localize} + {$EXTERNALSYM LN_hmacWithSHA1} + LN_hmacWithSHA1 = 'hmacWithSHA1'; {Do not localize} + {$EXTERNALSYM LN_id_pbkdf2} + LN_id_pbkdf2 = 'PBKDF2'; {Do not localize} + {$EXTERNALSYM LN_id_qt_cps} + LN_id_qt_cps = 'Policy Qualifier CPS'; {Do not localize} + {$EXTERNALSYM LN_id_qt_unotice} + LN_id_qt_unotice = 'Policy Qualifier User Notice'; {Do not localize} + {$EXTERNALSYM LN_idea_cbc} + LN_idea_cbc = 'idea-cbc'; {Do not localize} + {$EXTERNALSYM LN_idea_cfb64} + LN_idea_cfb64 = 'idea-cfb'; {Do not localize} + {$EXTERNALSYM LN_idea_ecb} + LN_idea_ecb = 'idea-ecb'; {Do not localize} + {$EXTERNALSYM LN_idea_ofb64} + LN_idea_ofb64 = 'idea-ofb'; {Do not localize} + {$EXTERNALSYM LN_initials} + LN_initials = 'initials'; {Do not localize} + {$EXTERNALSYM LN_invalidity_date} + LN_invalidity_date = 'Invalidity Date'; {Do not localize} + {$EXTERNALSYM LN_issuer_alt_name} + LN_issuer_alt_name = 'X509v3 Issuer Alternative Name'; {Do not localize} + {$EXTERNALSYM LN_keyBag} + LN_keyBag = 'keyBag'; {Do not localize} + {$EXTERNALSYM LN_key_usage} + LN_key_usage = 'X509v3 Key Usage'; {Do not localize} + {$EXTERNALSYM LN_localKeyID} + LN_localKeyID = 'localKeyID'; {Do not localize} + {$EXTERNALSYM LN_localityName} + LN_localityName = 'localityName'; {Do not localize} + {$EXTERNALSYM LN_md2} + LN_md2 = 'md2'; {Do not localize} + {$EXTERNALSYM LN_md2WithRSAEncryption} + LN_md2WithRSAEncryption = 'md2WithRSAEncryption'; {Do not localize} + {$EXTERNALSYM LN_md4} + LN_md4 = 'md4'; {Do not localize} + {$EXTERNALSYM LN_md5} + LN_md5 = 'md5'; {Do not localize} + {$EXTERNALSYM LN_md5WithRSA} + LN_md5WithRSA = 'md5WithRSA'; {Do not localize} + {$EXTERNALSYM LN_md5WithRSAEncryption} + LN_md5WithRSAEncryption = 'md5WithRSAEncryption'; {Do not localize} + {$EXTERNALSYM LN_md5_sha1} + LN_md5_sha1 = 'md5-sha1'; {Do not localize} + {$EXTERNALSYM LN_mdc2} + LN_mdc2 = 'mdc2'; {Do not localize} + {$EXTERNALSYM LN_mdc2WithRSA} + LN_mdc2WithRSA = 'mdc2withRSA'; {Do not localize} + {$EXTERNALSYM LN_ms_code_com} + LN_ms_code_com = 'Microsoft Commercial Code Signing'; {Do not localize} + {$EXTERNALSYM LN_ms_code_ind} + LN_ms_code_ind = 'Microsoft Individual Code Signing'; {Do not localize} + {$EXTERNALSYM LN_ms_ctl_sign} + LN_ms_ctl_sign = 'Microsoft Trust List Signing'; {Do not localize} + {$EXTERNALSYM LN_ms_efs} + LN_ms_efs = 'Microsoft Encrypted File System'; {Do not localize} + {$EXTERNALSYM LN_ms_sgc} + LN_ms_sgc = 'Microsoft Server Gated Crypto'; {Do not localize} + {$EXTERNALSYM LN_netscape} + LN_netscape = 'Netscape Communications Corp.'; {Do not localize} + {$EXTERNALSYM LN_netscape_base_url} + LN_netscape_base_url = 'Netscape Base Url'; {Do not localize} + {$EXTERNALSYM LN_netscape_ca_policy_url} + LN_netscape_ca_policy_url = 'Netscape CA Policy Url'; {Do not localize} + {$EXTERNALSYM LN_netscape_ca_revocation_url} + LN_netscape_ca_revocation_url = 'Netscape CA Revocation Url'; {Do not localize} + {$EXTERNALSYM LN_netscape_cert_extension} + LN_netscape_cert_extension = 'Netscape Certificate Extension'; {Do not localize} + {$EXTERNALSYM LN_netscape_cert_sequence} + LN_netscape_cert_sequence = 'Netscape Certificate Sequence'; {Do not localize} + {$EXTERNALSYM LN_netscape_cert_type} + LN_netscape_cert_type = 'Netscape Cert Type'; {Do not localize} + {$EXTERNALSYM LN_netscape_comment} + LN_netscape_comment = 'Netscape Comment'; {Do not localize} + {$EXTERNALSYM LN_netscape_data_type} + LN_netscape_data_type = 'Netscape Data Type'; {Do not localize} + {$EXTERNALSYM LN_netscape_renewal_url} + LN_netscape_renewal_url = 'Netscape Renewal Url'; {Do not localize} + {$EXTERNALSYM LN_netscape_revocation_url} + LN_netscape_revocation_url = 'Netscape Revocation Url'; {Do not localize} + {$EXTERNALSYM LN_netscape_ssl_server_name} + LN_netscape_ssl_server_name = 'Netscape SSL Server Name'; {Do not localize} + {$EXTERNALSYM LN_ns_sgc} + LN_ns_sgc = 'Netscape Server Gated Crypto'; {Do not localize} + {$EXTERNALSYM LN_organizationName} + LN_organizationName = 'organizationName'; {Do not localize} + {$EXTERNALSYM LN_organizationalUnitName} + LN_organizationalUnitName = 'organizationalUnitName'; {Do not localize} + {$EXTERNALSYM LN_pbeWithMD2AndDES_CBC} + LN_pbeWithMD2AndDES_CBC = 'pbeWithMD2AndDES-CBC'; {Do not localize} + {$EXTERNALSYM LN_pbeWithMD2AndRC2_CBC} + LN_pbeWithMD2AndRC2_CBC = 'pbeWithMD2AndRC2-CBC'; {Do not localize} + {$EXTERNALSYM LN_pbeWithMD5AndCast5_CBC} + LN_pbeWithMD5AndCast5_CBC = 'pbeWithMD5AndCast5CBC'; {Do not localize} + {$EXTERNALSYM LN_pbeWithMD5AndDES_CBC} + LN_pbeWithMD5AndDES_CBC = 'pbeWithMD5AndDES-CBC'; {Do not localize} + {$EXTERNALSYM LN_pbeWithMD5AndRC2_CBC} + LN_pbeWithMD5AndRC2_CBC = 'pbeWithMD5AndRC2-CBC'; {Do not localize} + {$EXTERNALSYM LN_pbeWithSHA1AndDES_CBC} + LN_pbeWithSHA1AndDES_CBC = 'pbeWithSHA1AndDES-CBC'; {Do not localize} + {$EXTERNALSYM LN_pbeWithSHA1AndRC2_CBC} + LN_pbeWithSHA1AndRC2_CBC = 'pbeWithSHA1AndRC2-CBC'; {Do not localize} + {$EXTERNALSYM LN_pbe_WithSHA1And128BitRC2_CBC} + LN_pbe_WithSHA1And128BitRC2_CBC = 'pbeWithSHA1And128BitRC2-CBC'; {Do not localize} + {$EXTERNALSYM LN_pbe_WithSHA1And128BitRC4} + LN_pbe_WithSHA1And128BitRC4 = 'pbeWithSHA1And128BitRC4'; {Do not localize} + {$EXTERNALSYM LN_pbe_WithSHA1And2_Key_TripleDES_CBC} + LN_pbe_WithSHA1And2_Key_TripleDES_CBC = 'pbeWithSHA1And2-KeyTripleDES-CBC'; {Do not localize} + {$EXTERNALSYM LN_pbe_WithSHA1And3_Key_TripleDES_CBC} + LN_pbe_WithSHA1And3_Key_TripleDES_CBC = 'pbeWithSHA1And3-KeyTripleDES-CBC'; {Do not localize} + {$EXTERNALSYM LN_pbe_WithSHA1And40BitRC2_CBC} + LN_pbe_WithSHA1And40BitRC2_CBC = 'pbeWithSHA1And40BitRC2-CBC'; {Do not localize} + {$EXTERNALSYM LN_pbe_WithSHA1And40BitRC4} + LN_pbe_WithSHA1And40BitRC4 = 'pbeWithSHA1And40BitRC4'; {Do not localize} + {$EXTERNALSYM LN_pbes2} + LN_pbes2 = 'PBES2'; {Do not localize} + {$EXTERNALSYM LN_pbmac1} + LN_pbmac1 = 'PBMAC1'; {Do not localize} + {$EXTERNALSYM LN_pkcs} + LN_pkcs = 'pkcs'; {Do not localize} + {$EXTERNALSYM LN_pkcs3} + LN_pkcs3 = 'pkcs3'; {Do not localize} + {$EXTERNALSYM LN_pkcs7} + LN_pkcs7 = 'pkcs7'; {Do not localize} + {$EXTERNALSYM LN_pkcs7_data} + LN_pkcs7_data = 'pkcs7-data'; {Do not localize} + {$EXTERNALSYM LN_pkcs7_digest} + LN_pkcs7_digest = 'pkcs7-digestData'; {Do not localize} + {$EXTERNALSYM LN_pkcs7_encrypted} + LN_pkcs7_encrypted = 'pkcs7-encryptedData'; {Do not localize} + {$EXTERNALSYM LN_pkcs7_enveloped} + LN_pkcs7_enveloped = 'pkcs7-envelopedData'; {Do not localize} + {$EXTERNALSYM LN_pkcs7_signed} + LN_pkcs7_signed = 'pkcs7-signedData'; {Do not localize} + {$EXTERNALSYM LN_pkcs7_signedAndEnveloped} + LN_pkcs7_signedAndEnveloped = 'pkcs7-signedAndEnvelopedData'; {Do not localize} + {$EXTERNALSYM LN_pkcs8ShroudedKeyBag} + LN_pkcs8ShroudedKeyBag = 'pkcs8ShroudedKeyBag'; {Do not localize} + {$EXTERNALSYM LN_pkcs9} + LN_pkcs9 = 'pkcs9'; {Do not localize} + {$EXTERNALSYM LN_pkcs9_challengePassword} + LN_pkcs9_challengePassword = 'challengePassword'; {Do not localize} + {$EXTERNALSYM LN_pkcs9_contentType} + LN_pkcs9_contentType = 'contentType'; {Do not localize} + {$EXTERNALSYM LN_pkcs9_countersignature} + LN_pkcs9_countersignature = 'countersignature'; {Do not localize} + {$EXTERNALSYM LN_pkcs9_emailAddress} + LN_pkcs9_emailAddress = 'emailAddress'; {Do not localize} + {$EXTERNALSYM LN_pkcs9_extCertAttributes} + LN_pkcs9_extCertAttributes = 'extendedCertificateAttributes'; {Do not localize} + {$EXTERNALSYM LN_pkcs9_messageDigest} + LN_pkcs9_messageDigest = 'messageDigest'; {Do not localize} + {$EXTERNALSYM LN_pkcs9_signingTime} + LN_pkcs9_signingTime = 'signingTime'; {Do not localize} + {$EXTERNALSYM LN_pkcs9_unstructuredAddress} + LN_pkcs9_unstructuredAddress = 'unstructuredAddress'; {Do not localize} + {$EXTERNALSYM LN_pkcs9_unstructuredName} + LN_pkcs9_unstructuredName = 'unstructuredName'; {Do not localize} + {$EXTERNALSYM LN_private_key_usage_period} + LN_private_key_usage_period = 'X509v3 Private Key Usage Period'; {Do not localize} + {$EXTERNALSYM LN_rc2_40_cbc} + LN_rc2_40_cbc = 'rc2-40-cbc'; {Do not localize} + {$EXTERNALSYM LN_rc2_64_cbc} + LN_rc2_64_cbc = 'rc2-64-cbc'; {Do not localize} + {$EXTERNALSYM LN_rc2_cbc} + LN_rc2_cbc = 'rc2-cbc'; {Do not localize} + {$EXTERNALSYM LN_rc2_cfb64} + LN_rc2_cfb64 = 'rc2-cfb'; {Do not localize} + {$EXTERNALSYM LN_rc2_ecb} + LN_rc2_ecb = 'rc2-ecb'; {Do not localize} + {$EXTERNALSYM LN_rc2_ofb64} + LN_rc2_ofb64 = 'rc2-ofb'; {Do not localize} + {$EXTERNALSYM LN_rc4} + LN_rc4 = 'rc4'; {Do not localize} + {$EXTERNALSYM LN_rc4_40} + LN_rc4_40 = 'rc4-40'; {Do not localize} + {$EXTERNALSYM LN_rc5_cbc} + LN_rc5_cbc = 'rc5-cbc'; {Do not localize} + {$EXTERNALSYM LN_rc5_cfb64} + LN_rc5_cfb64 = 'rc5-cfb'; {Do not localize} + {$EXTERNALSYM LN_rc5_ecb} + LN_rc5_ecb = 'rc5-ecb'; {Do not localize} + {$EXTERNALSYM LN_rc5_ofb64} + LN_rc5_ofb64 = 'rc5-ofb'; {Do not localize} + {$EXTERNALSYM LN_ripemd160} + LN_ripemd160 = 'ripemd160'; {Do not localize} + {$EXTERNALSYM LN_ripemd160WithRSA} + LN_ripemd160WithRSA = 'ripemd160WithRSA'; {Do not localize} + {$EXTERNALSYM LN_rle_compression} + LN_rle_compression = 'run length compression'; {Do not localize} + {$EXTERNALSYM LN_rsa} + LN_rsa = 'rsa'; {Do not localize} + {$EXTERNALSYM LN_rsaEncryption} + LN_rsaEncryption = 'rsaEncryption'; {Do not localize} + {$EXTERNALSYM LN_rsadsi} + LN_rsadsi = 'rsadsi'; {Do not localize} + {$EXTERNALSYM LN_safeContentsBag} + LN_safeContentsBag = 'safeContentsBag'; {Do not localize} + {$EXTERNALSYM LN_sdsiCertificate} + LN_sdsiCertificate = 'sdsiCertificate'; {Do not localize} + {$EXTERNALSYM LN_secretBag} + LN_secretBag = 'secretBag'; {Do not localize} + {$EXTERNALSYM LN_serialNumber} + LN_serialNumber = 'serialNumber'; {Do not localize} + {$EXTERNALSYM LN_server_auth} + LN_server_auth = 'TLS Web Server Authentication'; {Do not localize} + {$EXTERNALSYM LN_sha} + LN_sha = 'sha'; {Do not localize} + {$EXTERNALSYM LN_sha1} + LN_sha1 = 'sha1'; {Do not localize} + {$EXTERNALSYM LN_sha1WithRSA} + LN_sha1WithRSA = 'sha1WithRSA'; {Do not localize} + {$EXTERNALSYM LN_sha1WithRSAEncryption} + LN_sha1WithRSAEncryption = 'sha1WithRSAEncryption'; {Do not localize} + {$EXTERNALSYM LN_shaWithRSAEncryption} + LN_shaWithRSAEncryption = 'shaWithRSAEncryption'; {Do not localize} + {$EXTERNALSYM LN_sha256WithRSAEncryption} + LN_sha256WithRSAEncryption = 'sha256WithRSAEncryption'; {Do not localize} + {$EXTERNALSYM LN_sha384WithRSAEncryption} + LN_sha384WithRSAEncryption = 'sha384WithRSAEncryption'; {Do not localize} + {$EXTERNALSYM LN_sha512WithRSAEncryption} + LN_sha512WithRSAEncryption = 'sha512WithRSAEncryption'; {do not localize} + {$EXTERNALSYM LN_sha224WithRSAEncryption} + LN_sha224WithRSAEncryption = 'sha224WithRSAEncryption'; {Do not localize} + {$EXTERNALSYM LN_stateOrProvinceName} + LN_stateOrProvinceName = 'stateOrProvinceName'; {Do not localize} + {$EXTERNALSYM LN_subject_alt_name} + LN_subject_alt_name = 'X509v3 Subject Alternative Name'; {Do not localize} + {$EXTERNALSYM LN_subject_key_identifier} + LN_subject_key_identifier = 'X509v3 Subject Key Identifier'; {Do not localize} + {$EXTERNALSYM LN_surname} + LN_surname = 'surname'; {Do not localize} + {$EXTERNALSYM LN_sxnet} + LN_sxnet = 'Strong Extranet ID'; {Do not localize} + {$EXTERNALSYM LN_time_stamp} + LN_time_stamp = 'Time Stamping'; {Do not localize} + {$EXTERNALSYM LN_title} + LN_title = 'title'; {Do not localize} + {$EXTERNALSYM LN_undef} + LN_undef = 'undefined'; {Do not localize} + {$EXTERNALSYM LN_uniqueIdentifier} + LN_uniqueIdentifier = 'uniqueIdentifier'; {Do not localize} + {$EXTERNALSYM LN_x509Certificate} + LN_x509Certificate = 'x509Certificate'; {Do not localize} + {$EXTERNALSYM LN_x509Crl} + LN_x509Crl = 'x509Crl'; {Do not localize} + {$EXTERNALSYM LN_zlib_compression} + LN_zlib_compression = 'zlib compression'; {Do not localize} + {$EXTERNALSYM NID_SMIMECapabilities} + NID_SMIMECapabilities = 167; + {$EXTERNALSYM NID_X500} + NID_X500 = 11; + {$EXTERNALSYM NID_X509} + NID_X509 = 12; + {$EXTERNALSYM NID_algorithm} + NID_algorithm = 38; + {$EXTERNALSYM NID_authority_key_identifier} + NID_authority_key_identifier = 90; + {$EXTERNALSYM NID_basic_constraints} + NID_basic_constraints = 87; + {$EXTERNALSYM NID_bf_cbc} + NID_bf_cbc = 91; + {$EXTERNALSYM NID_bf_cfb64} + NID_bf_cfb64 = 93; + {$EXTERNALSYM NID_bf_ecb} + NID_bf_ecb = 92; + {$EXTERNALSYM NID_bf_ofb64} + NID_bf_ofb64 = 94; + {$EXTERNALSYM NID_cast5_cbc} + NID_cast5_cbc = 108; + {$EXTERNALSYM NID_cast5_cfb64} + NID_cast5_cfb64 = 110; + {$EXTERNALSYM NID_cast5_ecb} + NID_cast5_ecb = 109; + {$EXTERNALSYM NID_cast5_ofb64} + NID_cast5_ofb64 = 111; + {$EXTERNALSYM NID_certBag} + NID_certBag = 152; + {$EXTERNALSYM NID_certificate_policies} + NID_certificate_policies = 89; + {$EXTERNALSYM NID_client_auth} + NID_client_auth = 130; + {$EXTERNALSYM NID_code_sign} + NID_code_sign = 131; + {$EXTERNALSYM NID_commonName} + NID_commonName = 13; + {$EXTERNALSYM NID_countryName} + NID_countryName = 14; + {$EXTERNALSYM NID_crlBag} + NID_crlBag = 153; + {$EXTERNALSYM NID_crl_distribution_points} + NID_crl_distribution_points = 103; + {$EXTERNALSYM NID_crl_number} + NID_crl_number = 88; + {$EXTERNALSYM NID_crl_reason} + NID_crl_reason = 141; + {$EXTERNALSYM NID_delta_crl} + NID_delta_crl = 140; + {$EXTERNALSYM NID_des_cbc} + NID_des_cbc = 31; + {$EXTERNALSYM NID_des_cfb64} + NID_des_cfb64 = 30; + {$EXTERNALSYM NID_des_ecb} + NID_des_ecb = 29; + {$EXTERNALSYM NID_des_ede} + NID_des_ede = 32; + {$EXTERNALSYM NID_des_ede3} + NID_des_ede3 = 33; + {$EXTERNALSYM NID_des_ede3_cbc} + NID_des_ede3_cbc = 44; + {$EXTERNALSYM NID_des_ede3_cfb64} + NID_des_ede3_cfb64 = 61; + {$EXTERNALSYM NID_des_ede3_ofb64} + NID_des_ede3_ofb64 = 63; + {$EXTERNALSYM NID_des_ede_cbc} + NID_des_ede_cbc = 43; + {$EXTERNALSYM NID_des_ede_cfb64} + NID_des_ede_cfb64 = 60; + {$EXTERNALSYM NID_des_ede_ofb64} + NID_des_ede_ofb64 = 62; + {$EXTERNALSYM NID_des_ofb64} + NID_des_ofb64 = 45; + {$EXTERNALSYM NID_description} + NID_description = 107; + {$EXTERNALSYM NID_desx_cbc} + NID_desx_cbc = 80; + {$EXTERNALSYM NID_email_protect} + NID_email_protect = 132; + {$EXTERNALSYM NID_ext_key_usage} + NID_ext_key_usage = 126; + {$EXTERNALSYM NID_friendlyName} + NID_friendlyName = 156; + {$EXTERNALSYM NID_givenName} + NID_givenName = 99; + {$EXTERNALSYM NID_hmacWithSHA1} + NID_hmacWithSHA1 = 163; + {$EXTERNALSYM NID_id_kp} + NID_id_kp = 128; + {$EXTERNALSYM NID_id_pbkdf2} + NID_id_pbkdf2 = 69; + {$EXTERNALSYM NID_id_pkix} + NID_id_pkix = 127; + {$EXTERNALSYM NID_id_qt_cps} + NID_id_qt_cps = 164; + {$EXTERNALSYM NID_id_qt_unotice} + NID_id_qt_unotice = 165; + {$EXTERNALSYM NID_idea_cbc} + NID_idea_cbc = 34; + {$EXTERNALSYM NID_idea_cfb64} + NID_idea_cfb64 = 35; + {$EXTERNALSYM NID_idea_ecb} + NID_idea_ecb = 36; + {$EXTERNALSYM NID_idea_ofb64} + NID_idea_ofb64 = 46; + {$EXTERNALSYM NID_initials} + NID_initials = 101; + {$EXTERNALSYM NID_invalidity_date} + NID_invalidity_date = 142; + {$EXTERNALSYM NID_issuer_alt_name} + NID_issuer_alt_name = 86; + {$EXTERNALSYM NID_keyBag} + NID_keyBag = 150; + {$EXTERNALSYM NID_key_usage} + NID_key_usage = 83; + {$EXTERNALSYM NID_ld_ce} + NID_ld_ce = 81; + {$EXTERNALSYM NID_localKeyID} + NID_localKeyID = 157; + {$EXTERNALSYM NID_localityName} + NID_localityName = 15; + {$EXTERNALSYM NID_md2} + NID_md2 = 3; + {$EXTERNALSYM NID_md2WithRSAEncryption} + NID_md2WithRSAEncryption = 7; + {$EXTERNALSYM NID_md4} + NID_md4 = 257; + {$EXTERNALSYM NID_md4WithRSAEncryption} + NID_md4WithRSAEncryption = 396; + {$EXTERNALSYM NID_md5} + NID_md5 = 4; + {$EXTERNALSYM NID_md5WithRSA} + NID_md5WithRSA = 104; + {$EXTERNALSYM NID_md5WithRSAEncryption} + NID_md5WithRSAEncryption = 8; + {$EXTERNALSYM NID_md5_sha1} + NID_md5_sha1 = 114; + {$EXTERNALSYM NID_mdc2} + NID_mdc2 = 95; + {$EXTERNALSYM NID_mdc2WithRSA} + NID_mdc2WithRSA = 96; + {$EXTERNALSYM NID_ms_code_com} + NID_ms_code_com = 135; + {$EXTERNALSYM NID_ms_code_ind} + NID_ms_code_ind = 134; + {$EXTERNALSYM NID_ms_ctl_sign} + NID_ms_ctl_sign = 136; + {$EXTERNALSYM NID_ms_efs} + NID_ms_efs = 138; + {$EXTERNALSYM NID_ms_sgc} + NID_ms_sgc = 137; + {$EXTERNALSYM NID_netscape} + NID_netscape = 57; + {$EXTERNALSYM NID_netscape_base_url} + NID_netscape_base_url = 72; + {$EXTERNALSYM NID_netscape_ca_policy_url} + NID_netscape_ca_policy_url = 76; + {$EXTERNALSYM NID_netscape_ca_revocation_url} + NID_netscape_ca_revocation_url = 74; + {$EXTERNALSYM NID_netscape_cert_extension} + NID_netscape_cert_extension = 58; + {$EXTERNALSYM NID_netscape_cert_sequence} + NID_netscape_cert_sequence = 79; + {$EXTERNALSYM NID_netscape_cert_type} + NID_netscape_cert_type = 71; + {$EXTERNALSYM NID_netscape_comment} + NID_netscape_comment = 78; + {$EXTERNALSYM NID_netscape_data_type} + NID_netscape_data_type = 59; + {$EXTERNALSYM NID_netscape_renewal_url} + NID_netscape_renewal_url = 75; + {$EXTERNALSYM NID_netscape_revocation_url} + NID_netscape_revocation_url = 73; + {$EXTERNALSYM NID_netscape_ssl_server_name} + NID_netscape_ssl_server_name = 77; + {$EXTERNALSYM NID_ns_sgc} + NID_ns_sgc = 139; + {$EXTERNALSYM NID_organizationName} + NID_organizationName = 17; + {$EXTERNALSYM NID_organizationalUnitName} + NID_organizationalUnitName = 18; + {$EXTERNALSYM NID_pbeWithMD2AndDES_CBC} + NID_pbeWithMD2AndDES_CBC = 9; + {$EXTERNALSYM NID_pbeWithMD2AndRC2_CBC} + NID_pbeWithMD2AndRC2_CBC = 168; + {$EXTERNALSYM NID_pbeWithMD5AndCast5_CBC} + NID_pbeWithMD5AndCast5_CBC = 112; + {$EXTERNALSYM NID_pbeWithMD5AndDES_CBC} + NID_pbeWithMD5AndDES_CBC = 10; + {$EXTERNALSYM NID_pbeWithMD5AndRC2_CBC} + NID_pbeWithMD5AndRC2_CBC = 169; + {$EXTERNALSYM NID_pbeWithSHA1AndDES_CBC} + NID_pbeWithSHA1AndDES_CBC = 170; + {$EXTERNALSYM NID_pbeWithSHA1AndRC2_CBC} + NID_pbeWithSHA1AndRC2_CBC = 68; + {$EXTERNALSYM NID_pbe_WithSHA1And128BitRC2_CBC} + NID_pbe_WithSHA1And128BitRC2_CBC = 148; + {$EXTERNALSYM NID_pbe_WithSHA1And128BitRC4} + NID_pbe_WithSHA1And128BitRC4 = 144; + {$EXTERNALSYM NID_pbe_WithSHA1And2_Key_TripleDES_CBC} + NID_pbe_WithSHA1And2_Key_TripleDES_CBC = 147; + {$EXTERNALSYM NID_pbe_WithSHA1And3_Key_TripleDES_CBC} + NID_pbe_WithSHA1And3_Key_TripleDES_CBC = 146; + {$EXTERNALSYM NID_pbe_WithSHA1And40BitRC2_CBC} + NID_pbe_WithSHA1And40BitRC2_CBC = 149; + {$EXTERNALSYM NID_pbe_WithSHA1And40BitRC4} + NID_pbe_WithSHA1And40BitRC4 = 145; + {$EXTERNALSYM NID_pbes2} + NID_pbes2 = 161; + {$EXTERNALSYM NID_pbmac1} + NID_pbmac1 = 162; + {$EXTERNALSYM NID_pkcs} + NID_pkcs = 2; + {$EXTERNALSYM NID_pkcs3} + NID_pkcs3 = 27; + {$EXTERNALSYM NID_pkcs7} + NID_pkcs7 = 20; + {$EXTERNALSYM NID_pkcs7_data} + NID_pkcs7_data = 21; + {$EXTERNALSYM NID_pkcs7_digest} + NID_pkcs7_digest = 25; + {$EXTERNALSYM NID_pkcs7_encrypted} + NID_pkcs7_encrypted = 26; + {$EXTERNALSYM NID_pkcs7_enveloped} + NID_pkcs7_enveloped = 23; + {$EXTERNALSYM NID_pkcs7_signed} + NID_pkcs7_signed = 22; + {$EXTERNALSYM NID_pkcs7_signedAndEnveloped} + NID_pkcs7_signedAndEnveloped = 24; + {$EXTERNALSYM NID_pkcs8ShroudedKeyBag} + NID_pkcs8ShroudedKeyBag = 151; + {$EXTERNALSYM NID_pkcs9} + NID_pkcs9 = 47; + {$EXTERNALSYM NID_pkcs9_challengePassword} + NID_pkcs9_challengePassword = 54; + {$EXTERNALSYM NID_pkcs9_contentType} + NID_pkcs9_contentType = 50; + {$EXTERNALSYM NID_pkcs9_countersignature} + NID_pkcs9_countersignature = 53; + {$EXTERNALSYM NID_pkcs9_emailAddress} + NID_pkcs9_emailAddress = 48; + {$EXTERNALSYM NID_pkcs9_extCertAttributes} + NID_pkcs9_extCertAttributes = 56; + {$EXTERNALSYM NID_pkcs9_messageDigest} + NID_pkcs9_messageDigest = 51; + {$EXTERNALSYM NID_pkcs9_signingTime} + NID_pkcs9_signingTime = 52; + {$EXTERNALSYM NID_pkcs9_unstructuredAddress} + NID_pkcs9_unstructuredAddress = 55; + {$EXTERNALSYM NID_pkcs9_unstructuredName} + NID_pkcs9_unstructuredName = 49; + {$EXTERNALSYM NID_private_key_usage_period} + NID_private_key_usage_period = 84; + {$EXTERNALSYM NID_rc2_40_cbc} + NID_rc2_40_cbc = 98; + {$EXTERNALSYM NID_rc2_64_cbc} + NID_rc2_64_cbc = 166; + {$EXTERNALSYM NID_rc2_cbc} + NID_rc2_cbc = 37; + {$EXTERNALSYM NID_rc2_cfb64} + NID_rc2_cfb64 = 39; + {$EXTERNALSYM NID_rc2_ecb} + NID_rc2_ecb = 38; + {$EXTERNALSYM NID_rc2_ofb64} + NID_rc2_ofb64 = 40; + {$EXTERNALSYM NID_rc4} + NID_rc4 = 5; + {$EXTERNALSYM NID_rc4_40} + NID_rc4_40 = 97; + {$EXTERNALSYM NID_rc5_cbc} + NID_rc5_cbc = 120; + {$EXTERNALSYM NID_rc5_cfb64} + NID_rc5_cfb64 = 122; + {$EXTERNALSYM NID_rc5_ecb} + NID_rc5_ecb = 121; + {$EXTERNALSYM NID_rc5_ofb64} + NID_rc5_ofb64 = 123; + {$EXTERNALSYM NID_ripemd160} + NID_ripemd160 = 117; + {$EXTERNALSYM NID_ripemd160WithRSA} + NID_ripemd160WithRSA = 119; + {$EXTERNALSYM NID_rle_compression} + NID_rle_compression = 124; + {$EXTERNALSYM NID_rsadsi} + NID_rsadsi = 1; + {$EXTERNALSYM NID_safeContentsBag} + NID_safeContentsBag = 155; + {$EXTERNALSYM NID_sdsiCertificate} + NID_sdsiCertificate = 159; + {$EXTERNALSYM NID_secretBag} + NID_secretBag = 154; + {$EXTERNALSYM NID_serialNumber} + NID_serialNumber = 105; + {$EXTERNALSYM NID_server_auth} + NID_server_auth = 129; + {$EXTERNALSYM NID_sha} + NID_sha = 41; + {$EXTERNALSYM NID_sha1} + NID_sha1 = 64; + {$EXTERNALSYM NID_sha1WithRSA} + NID_sha1WithRSA = 115; + {$EXTERNALSYM NID_sha1WithRSAEncryption} + NID_sha1WithRSAEncryption = 65; + {$EXTERNALSYM NID_sha256WithRSAEncryption} + NID_sha256WithRSAEncryption = 668; + {$EXTERNALSYM NID_sha384WithRSAEncryption} + NID_sha384WithRSAEncryption = 669; + {$EXTERNALSYM NID_sha512WithRSAEncryption} + NID_sha512WithRSAEncryption = 670; + {$EXTERNALSYM NID_sha224WithRSAEncryption} + NID_sha224WithRSAEncryption = 671; + {$EXTERNALSYM NID_shaWithRSAEncryption} + NID_shaWithRSAEncryption = 42; + {$EXTERNALSYM NID_stateOrProvinceName} + NID_stateOrProvinceName = 16; + {$EXTERNALSYM NID_subject_alt_name} + NID_subject_alt_name = 85; + {$EXTERNALSYM NID_subject_key_identifier} + NID_subject_key_identifier = 82; + {$EXTERNALSYM NID_surname} + NID_surname = 100; + {$EXTERNALSYM NID_sxnet} + NID_sxnet = 143; + {$EXTERNALSYM NID_time_stamp} + NID_time_stamp = 133; + {$EXTERNALSYM NID_title} + NID_title = 106; + {$EXTERNALSYM NID_uniqueIdentifier} + NID_uniqueIdentifier = 102; + {$EXTERNALSYM NID_x509Certificate} + NID_x509Certificate = 158; + {$EXTERNALSYM NID_x509Crl} + NID_x509Crl = 160; + {$EXTERNALSYM NID_zlib_compression} + NID_zlib_compression = 125; + {$EXTERNALSYM OBJ_F_OBJ_CREATE} + OBJ_F_OBJ_CREATE = 100; + {$EXTERNALSYM OBJ_F_OBJ_DUP} + OBJ_F_OBJ_DUP = 101; + {$EXTERNALSYM OBJ_F_OBJ_NID2LN} + OBJ_F_OBJ_NID2LN = 102; + {$EXTERNALSYM OBJ_F_OBJ_NID2OBJ} + OBJ_F_OBJ_NID2OBJ = 103; + {$EXTERNALSYM OBJ_F_OBJ_NID2SN} + OBJ_F_OBJ_NID2SN = 104; + {$EXTERNALSYM OBJ_NAME_ALIAS} + OBJ_NAME_ALIAS = $8000; + {$EXTERNALSYM OBJ_NAME_TYPE_CIPHER_METH} + OBJ_NAME_TYPE_CIPHER_METH = $02; + {$EXTERNALSYM OBJ_NAME_TYPE_COMP_METH} + OBJ_NAME_TYPE_COMP_METH = $04; + {$EXTERNALSYM OBJ_NAME_TYPE_MD_METH} + OBJ_NAME_TYPE_MD_METH = $01; + {$EXTERNALSYM OBJ_NAME_TYPE_NUM} + OBJ_NAME_TYPE_NUM = $05; + {$EXTERNALSYM OBJ_NAME_TYPE_PKEY_METH} + OBJ_NAME_TYPE_PKEY_METH = $03; + {$EXTERNALSYM OBJ_NAME_TYPE_UNDEF} + OBJ_NAME_TYPE_UNDEF = $00; + {$EXTERNALSYM OBJ_R_MALLOC_FAILURE} + OBJ_R_MALLOC_FAILURE = 100; + {$EXTERNALSYM OBJ_R_UNKNOWN_NID} + OBJ_R_UNKNOWN_NID = 101; + {$EXTERNALSYM OPENSSL_VERSION_NUMBER} + OPENSSL_VERSION_NUMBER = $1000105f; // MMNNFFPPS Major, Minor, Fix, Patch, Status + {$EXTERNALSYM OPENSSL_VERSION_TEXT} +{$IFDEF OPENSSL_FIPS} + OPENSSL_VERSION_TEXT = 'OpenSSL 1.0.1e-fips 11 Feb 2013'; {Do not localize} +{$ELSE} + OPENSSL_VERSION_TEXT = 'OpenSSL 1.0.1e 11 Feb 2013'; {Do not localize} +{$ENDIF} + {$EXTERNALSYM OPENSSL_VERSION_PTEXT} + OPENSSL_VERSION_PTEXT = ' part of '+ OPENSSL_VERSION_TEXT; {Do not localize} + {$EXTERNALSYM PEM_BUFSIZE} + PEM_BUFSIZE = 1024; + {$EXTERNALSYM PEM_DEK_DES_CBC} + PEM_DEK_DES_CBC = 40; + {$EXTERNALSYM PEM_DEK_DES_ECB} + PEM_DEK_DES_ECB = 60; + {$EXTERNALSYM PEM_DEK_DES_EDE} + PEM_DEK_DES_EDE = 50; + {$EXTERNALSYM PEM_DEK_IDEA_CBC} + PEM_DEK_IDEA_CBC = 45; + {$EXTERNALSYM PEM_DEK_RSA} + PEM_DEK_RSA = 70; + {$EXTERNALSYM PEM_DEK_RSA_MD2} + PEM_DEK_RSA_MD2 = 80; + {$EXTERNALSYM PEM_DEK_RSA_MD5} + PEM_DEK_RSA_MD5 = 90; + {$EXTERNALSYM PEM_ERROR} + PEM_ERROR = 30; + {$EXTERNALSYM PEM_F_DEF_CALLBACK} + PEM_F_DEF_CALLBACK = 100; + {$EXTERNALSYM PEM_F_LOAD_IV} + PEM_F_LOAD_IV = 101; + {$EXTERNALSYM PEM_F_PEM_ASN1_READ} + PEM_F_PEM_ASN1_READ = 102; + {$EXTERNALSYM PEM_F_PEM_ASN1_READ_BIO} + PEM_F_PEM_ASN1_READ_BIO = 103; + {$EXTERNALSYM PEM_F_PEM_ASN1_WRITE} + PEM_F_PEM_ASN1_WRITE = 104; + {$EXTERNALSYM PEM_F_PEM_ASN1_WRITE_BIO} + PEM_F_PEM_ASN1_WRITE_BIO = 105; + {$EXTERNALSYM PEM_F_PEM_DO_HEADER} + PEM_F_PEM_DO_HEADER = 106; + {$EXTERNALSYM PEM_F_PEM_F_PEM_WRITE_PKCS8PRIVATEKEY} + PEM_F_PEM_F_PEM_WRITE_PKCS8PRIVATEKEY = 118; + {$EXTERNALSYM PEM_F_PEM_GET_EVP_CIPHER_INFO} + PEM_F_PEM_GET_EVP_CIPHER_INFO = 107; + {$EXTERNALSYM PEM_F_PEM_READ} + PEM_F_PEM_READ = 108; + {$EXTERNALSYM PEM_F_PEM_READ_BIO} + PEM_F_PEM_READ_BIO = 109; + {$EXTERNALSYM PEM_F_PEM_SEALFINAL} + PEM_F_PEM_SEALFINAL = 110; + {$EXTERNALSYM PEM_F_PEM_SEALINIT} + PEM_F_PEM_SEALINIT = 111; + {$EXTERNALSYM PEM_F_PEM_SIGNFINAL} + PEM_F_PEM_SIGNFINAL = 112; + {$EXTERNALSYM PEM_F_PEM_WRITE} + PEM_F_PEM_WRITE = 113; + {$EXTERNALSYM PEM_F_PEM_WRITE_BIO} + PEM_F_PEM_WRITE_BIO = 114; + {$EXTERNALSYM PEM_F_PEM_WRITE_BIO_PKCS8PRIVATEKEY} + PEM_F_PEM_WRITE_BIO_PKCS8PRIVATEKEY = 119; + {$EXTERNALSYM PEM_F_PEM_X509_INFO_READ} + PEM_F_PEM_X509_INFO_READ = 115; + {$EXTERNALSYM PEM_F_PEM_X509_INFO_READ_BIO} + PEM_F_PEM_X509_INFO_READ_BIO = 116; + {$EXTERNALSYM PEM_F_PEM_X509_INFO_WRITE_BIO} + PEM_F_PEM_X509_INFO_WRITE_BIO = 117; + {$EXTERNALSYM PEM_MD_MD2} + PEM_MD_MD2 = NID_md2; + {$EXTERNALSYM PEM_MD_MD2_RSA} + PEM_MD_MD2_RSA = NID_md2WithRSAEncryption; + {$EXTERNALSYM PEM_MD_MD5} + PEM_MD_MD5 = NID_md5; + {$EXTERNALSYM PEM_MD_MD5_RSA} + PEM_MD_MD5_RSA = NID_md5WithRSAEncryption; + {$EXTERNALSYM PEM_MD_SHA} + PEM_MD_SHA = NID_sha; + {$EXTERNALSYM PEM_MD_SHA_RSA} + PEM_MD_SHA_RSA = NID_sha1WithRSAEncryption; + {$EXTERNALSYM PEM_OBJ_UNDEF} + PEM_OBJ_UNDEF = 0; + {$EXTERNALSYM PEM_OBJ_X509} + PEM_OBJ_X509 = 1; + {$EXTERNALSYM PEM_OBJ_X509_REQ} + PEM_OBJ_X509_REQ = 2; + {$EXTERNALSYM PEM_OBJ_CRL} + PEM_OBJ_CRL = 3; + {$EXTERNALSYM PEM_OBJ_SSL_SESSION} + PEM_OBJ_SSL_SESSION = 4; + {$EXTERNALSYM PEM_OBJ_PRIV_KEY} + PEM_OBJ_PRIV_KEY = 10; + {$EXTERNALSYM PEM_OBJ_PRIV_RSA} + PEM_OBJ_PRIV_RSA = 11; + {$EXTERNALSYM PEM_OBJ_PRIV_DSA} + PEM_OBJ_PRIV_DSA = 12; + {$EXTERNALSYM PEM_OBJ_PRIV_DH} + PEM_OBJ_PRIV_DH = 13; + {$EXTERNALSYM PEM_OBJ_PUB_RSA} + PEM_OBJ_PUB_RSA = 14; + {$EXTERNALSYM PEM_OBJ_PUB_DSA} + PEM_OBJ_PUB_DSA = 15; + {$EXTERNALSYM PEM_OBJ_PUB_DH} + PEM_OBJ_PUB_DH = 16; + {$EXTERNALSYM PEM_OBJ_DHPARAMS} + PEM_OBJ_DHPARAMS = 17; + {$EXTERNALSYM PEM_OBJ_DSAPARAMS} + PEM_OBJ_DSAPARAMS = 18; + {$EXTERNALSYM PEM_OBJ_PRIV_RSA_PUBLIC} + PEM_OBJ_PRIV_RSA_PUBLIC = 19; + {$EXTERNALSYM PEM_OBJ_PRIV_ECDSA} + PEM_OBJ_PRIV_ECDSA = 20; + {$EXTERNALSYM PEM_OBJ_PUB_ECDSA} + PEM_OBJ_PUB_ECDSA = 21; + {$EXTERNALSYM PEM_OBJ_ECPARAMETERS} + PEM_OBJ_ECPARAMETERS = 22; + {$EXTERNALSYM PEM_R_BAD_BASE64_DECODE} + PEM_R_BAD_BASE64_DECODE = 100; + {$EXTERNALSYM PEM_R_BAD_DECRYPT} + PEM_R_BAD_DECRYPT = 101; + {$EXTERNALSYM PEM_R_BAD_END_LINE} + PEM_R_BAD_END_LINE = 102; + {$EXTERNALSYM PEM_R_BAD_IV_CHARS} + PEM_R_BAD_IV_CHARS = 103; + {$EXTERNALSYM PEM_R_BAD_PASSWORD_READ} + PEM_R_BAD_PASSWORD_READ = 104; + {$EXTERNALSYM PEM_R_ERROR_CONVERTING_PRIVATE_KEY} + PEM_R_ERROR_CONVERTING_PRIVATE_KEY = 115; + {$EXTERNALSYM PEM_R_NOT_DEK_INFO} + PEM_R_NOT_DEK_INFO = 105; + {$EXTERNALSYM PEM_R_NOT_ENCRYPTED} + PEM_R_NOT_ENCRYPTED = 106; + {$EXTERNALSYM PEM_R_NOT_PROC_TYPE} + PEM_R_NOT_PROC_TYPE = 107; + {$EXTERNALSYM PEM_R_NO_START_LINE} + PEM_R_NO_START_LINE = 108; + {$EXTERNALSYM PEM_R_PROBLEMS_GETTING_PASSWORD} + PEM_R_PROBLEMS_GETTING_PASSWORD = 109; + {$EXTERNALSYM PEM_R_PUBLIC_KEY_NO_RSA} + PEM_R_PUBLIC_KEY_NO_RSA = 110; + {$EXTERNALSYM PEM_R_READ_KEY} + PEM_R_READ_KEY = 111; + {$EXTERNALSYM PEM_R_SHORT_HEADER} + PEM_R_SHORT_HEADER = 112; + {$EXTERNALSYM PEM_R_UNSUPPORTED_CIPHER} + PEM_R_UNSUPPORTED_CIPHER = 113; + {$EXTERNALSYM PEM_R_UNSUPPORTED_ENCRYPTION} + PEM_R_UNSUPPORTED_ENCRYPTION = 114; + {$EXTERNALSYM PEM_STRING_EVP_PKEY} + PEM_STRING_EVP_PKEY = 'ANY PRIVATE KEY'; {Do not localize} + {$EXTERNALSYM PEM_STRING_X509_OLD} + PEM_STRING_X509_OLD = 'X509 CERTIFICATE'; {Do not localize} + {$EXTERNALSYM PEM_STRING_X509} + PEM_STRING_X509 = 'CERTIFICATE'; {Do not localize} + {$EXTERNALSYM PEM_STRING_X509_PAIR} + PEM_STRING_X509_PAIR = 'CERTIFICATE PAIR'; {Do not localize} + {$EXTERNALSYM PEM_STRING_X509_TRUSTED} + PEM_STRING_X509_TRUSTED = 'TRUSTED CERTIFICATE'; {Do not localize} + {$EXTERNALSYM PEM_STRING_X509_REQ_OLD} + PEM_STRING_X509_REQ_OLD = 'NEW CERTIFICATE REQUEST'; {Do not localize} + {$EXTERNALSYM PEM_STRING_X509_REQ} + PEM_STRING_X509_REQ = 'CERTIFICATE REQUEST'; {Do not localize} + {$EXTERNALSYM PEM_STRING_X509_CRL} + PEM_STRING_X509_CRL = 'X509 CRL'; {Do not localize} + {$EXTERNALSYM PEM_STRING_PUBLIC} + PEM_STRING_PUBLIC = 'PUBLIC KEY'; {Do not localize} + {$EXTERNALSYM PEM_STRING_RSA} + PEM_STRING_RSA = 'RSA PRIVATE KEY'; {Do not localize} + {$EXTERNALSYM PEM_STRING_RSA_PUBLIC} + PEM_STRING_RSA_PUBLIC = 'RSA PUBLIC KEY'; {Do not localize} + {$EXTERNALSYM PEM_STRING_DSA} + PEM_STRING_DSA = 'DSA PRIVATE KEY'; {Do not localize} + {$EXTERNALSYM PEM_STRING_DSA_PUBLIC} + PEM_STRING_DSA_PUBLIC = 'DSA PUBLIC KEY'; {Do not localize} + {$EXTERNALSYM PEM_STRING_PKCS7} + PEM_STRING_PKCS7 = 'PKCS7'; {Do not localize} + {$EXTERNALSYM PEM_STRING_PKCS7_SIGNED} + PEM_STRING_PKCS7_SIGNED ='PKCS #7 SIGNED DATA'; {Do not localize} + {$EXTERNALSYM PEM_STRING_PKCS8} + PEM_STRING_PKCS8 = 'ENCRYPTED PRIVATE KEY'; {Do not localize} + {$EXTERNALSYM PEM_STRING_PKCS8INF} + PEM_STRING_PKCS8INF = 'PRIVATE KEY'; {Do not localize} + {$EXTERNALSYM PEM_STRING_DHPARAMS} + PEM_STRING_DHPARAMS = 'DH PARAMETERS'; {Do not localize} + {$EXTERNALSYM PEM_STRING_SSL_SESSION} + PEM_STRING_SSL_SESSION = 'SSL SESSION PARAMETERS'; {Do not localize} + {$EXTERNALSYM PEM_STRING_DSAPARAMS} + PEM_STRING_DSAPARAMS = 'DSA PARAMETERS'; {Do not localize} + {$EXTERNALSYM PEM_STRING_ECDSA_PUBLIC} + PEM_STRING_ECDSA_PUBLIC = 'ECDSA PUBLIC KEY'; {Do not localize} + {$EXTERNALSYM PEM_STRING_ECPARAMETERS} + PEM_STRING_ECPARAMETERS = 'EC PARAMETERS'; {Do not localize} + {$EXTERNALSYM PEM_STRING_ECPRIVATEKEY} + PEM_STRING_ECPRIVATEKEY = 'EC PRIVATE KEY'; {Do not localize} + {$EXTERNALSYM PEM_STRING_CMS} + PEM_STRING_CMS = 'CMS'; {Do not localize} + {$EXTERNALSYM PEM_TYPE_CLEAR} + PEM_TYPE_CLEAR = 40; + {$EXTERNALSYM PEM_TYPE_ENCRYPTED} + PEM_TYPE_ENCRYPTED = 10; + {$EXTERNALSYM PEM_TYPE_MIC_CLEAR} + PEM_TYPE_MIC_CLEAR = 30; + {$EXTERNALSYM PEM_TYPE_MIC_ONLY} + PEM_TYPE_MIC_ONLY = 20; + {$EXTERNALSYM PKCS5_DEFAULT_ITER} + PKCS5_DEFAULT_ITER = 2048; + {$EXTERNALSYM PKCS5_SALT_LEN} + PKCS5_SALT_LEN = 8; + {$EXTERNALSYM PKCS7_F_PKCS7_ADD_CERTIFICATE} + PKCS7_F_PKCS7_ADD_CERTIFICATE = 100; + {$EXTERNALSYM PKCS7_F_PKCS7_ADD_CRL} + PKCS7_F_PKCS7_ADD_CRL = 101; + {$EXTERNALSYM PKCS7_F_PKCS7_ADD_RECIPIENT_INFO} + PKCS7_F_PKCS7_ADD_RECIPIENT_INFO = 102; + {$EXTERNALSYM PKCS7_F_PKCS7_ADD_SIGNER} + PKCS7_F_PKCS7_ADD_SIGNER = 103; + {$EXTERNALSYM PKCS7_F_PKCS7_CTRL} + PKCS7_F_PKCS7_CTRL = 104; + {$EXTERNALSYM PKCS7_F_PKCS7_DATADECODE} + PKCS7_F_PKCS7_DATADECODE = 112; + {$EXTERNALSYM PKCS7_F_PKCS7_DATAINIT} + PKCS7_F_PKCS7_DATAINIT = 105; + {$EXTERNALSYM PKCS7_F_PKCS7_DATASIGN} + PKCS7_F_PKCS7_DATASIGN = 106; + {$EXTERNALSYM PKCS7_F_PKCS7_DATAVERIFY} + PKCS7_F_PKCS7_DATAVERIFY = 107; + {$EXTERNALSYM PKCS7_F_PKCS7_SET_CIPHER} + PKCS7_F_PKCS7_SET_CIPHER = 108; + {$EXTERNALSYM PKCS7_F_PKCS7_SET_CONTENT} + PKCS7_F_PKCS7_SET_CONTENT = 109; + {$EXTERNALSYM PKCS7_F_PKCS7_SET_TYPE} + PKCS7_F_PKCS7_SET_TYPE = 110; + {$EXTERNALSYM PKCS7_F_PKCS7_SIGNATUREVERIFY} + PKCS7_F_PKCS7_SIGNATUREVERIFY = 113; + {$EXTERNALSYM PKCS7_OP_GET_DETACHED_SIGNATURE} + PKCS7_OP_GET_DETACHED_SIGNATURE = 2; + {$EXTERNALSYM PKCS7_OP_SET_DETACHED_SIGNATURE} + PKCS7_OP_SET_DETACHED_SIGNATURE = 1; + {$EXTERNALSYM PKCS7_R_CIPHER_NOT_INITIALIZED} + PKCS7_R_CIPHER_NOT_INITIALIZED = 116; + {$EXTERNALSYM PKCS7_R_DECRYPTED_KEY_IS_WRONG_LENGTH} + PKCS7_R_DECRYPTED_KEY_IS_WRONG_LENGTH = 100; + {$EXTERNALSYM PKCS7_R_DIGEST_FAILURE} + PKCS7_R_DIGEST_FAILURE = 101; + {$EXTERNALSYM PKCS7_R_INTERNAL_ERROR} + PKCS7_R_INTERNAL_ERROR = 102; + {$EXTERNALSYM PKCS7_R_MISSING_CERIPEND_INFO} + PKCS7_R_MISSING_CERIPEND_INFO = 103; + {$EXTERNALSYM PKCS7_R_NO_RECIPIENT_MATCHES_CERTIFICATE} + PKCS7_R_NO_RECIPIENT_MATCHES_CERTIFICATE = 115; + {$EXTERNALSYM PKCS7_R_OPERATION_NOT_SUPPORTED_ON_THIS_TYPE} + PKCS7_R_OPERATION_NOT_SUPPORTED_ON_THIS_TYPE = 104; + {$EXTERNALSYM PKCS7_R_SIGNATURE_FAILURE} + PKCS7_R_SIGNATURE_FAILURE = 105; + {$EXTERNALSYM PKCS7_R_UNABLE_TO_FIND_CERTIFICATE} + PKCS7_R_UNABLE_TO_FIND_CERTIFICATE = 106; + {$EXTERNALSYM PKCS7_R_UNABLE_TO_FIND_MEM_BIO} + PKCS7_R_UNABLE_TO_FIND_MEM_BIO = 107; + {$EXTERNALSYM PKCS7_R_UNABLE_TO_FIND_MESSAGE_DIGEST} + PKCS7_R_UNABLE_TO_FIND_MESSAGE_DIGEST = 108; + {$EXTERNALSYM PKCS7_R_UNKNOWN_DIGEST_TYPE} + PKCS7_R_UNKNOWN_DIGEST_TYPE = 109; + {$EXTERNALSYM PKCS7_R_UNKNOWN_OPERATION} + PKCS7_R_UNKNOWN_OPERATION = 110; + {$EXTERNALSYM PKCS7_R_UNSUPPORTED_CIPHER_TYPE} + PKCS7_R_UNSUPPORTED_CIPHER_TYPE = 111; + {$EXTERNALSYM PKCS7_R_UNSUPPORTED_CONTENT_TYPE} + PKCS7_R_UNSUPPORTED_CONTENT_TYPE = 112; + {$EXTERNALSYM PKCS7_R_WRONG_CONTENT_TYPE} + PKCS7_R_WRONG_CONTENT_TYPE = 113; + {$EXTERNALSYM PKCS7_R_WRONG_PKCS7_TYPE} + PKCS7_R_WRONG_PKCS7_TYPE = 114; + {$EXTERNALSYM PKCS7_S_BODY} + PKCS7_S_BODY = 1; + {$EXTERNALSYM PKCS7_S_HEADER} + PKCS7_S_HEADER = 0; + {$EXTERNALSYM PKCS7_S_TAIL} + PKCS7_S_TAIL = 2; + {$EXTERNALSYM PKCS8_NEG_PRIVKEY} + PKCS8_NEG_PRIVKEY = 4; + {$EXTERNALSYM PKCS8_NS_DB} + PKCS8_NS_DB = 3; + {$EXTERNALSYM PKCS8_EMBEDDED_PARAM} + PKCS8_EMBEDDED_PARAM = 2; + {$EXTERNALSYM PKCS8_NO_OCTET} + PKCS8_NO_OCTET = 1; + {$EXTERNALSYM PKCS8_OK} + PKCS8_OK = 0; + {$EXTERNALSYM P_tmpdir} + P_tmpdir = '/tmp'; {Do not localize} + {$EXTERNALSYM MSS_RAND_MAX} + MSS_RAND_MAX = $7fffffff; + {$IFNDEF OPENSSL_NO_RC2} + {$EXTERNALSYM RC2_BLOCK} + RC2_BLOCK = 8; + {$EXTERNALSYM RC2_DECRYPT} + RC2_DECRYPT = 0; + {$EXTERNALSYM RC2_ENCRYPT} + RC2_ENCRYPT = 1; + {$EXTERNALSYM RC2_KEY_LENGTH} + RC2_KEY_LENGTH = 16; + {$ENDIF} + {$IFNDEF OPENSSL_NO_RC5} + {$EXTERNALSYM RC5_12_ROUNDS} + RC5_12_ROUNDS = 12; + {$EXTERNALSYM RC5_16_ROUNDS} + RC5_16_ROUNDS = 16; + {$EXTERNALSYM RC5_32_BLOCK} + RC5_32_BLOCK = 8; + {$EXTERNALSYM RC5_32_KEY_LENGTH} + RC5_32_KEY_LENGTH = 16; + {$EXTERNALSYM RC5_8_ROUNDS} + RC5_8_ROUNDS = 8; + {$EXTERNALSYM RC5_DECRYPT} + RC5_DECRYPT = 0; + {$EXTERNALSYM RC5_ENCRYPT} + RC5_ENCRYPT = 1; + {$ENDIF} + {$IFNDEF OPENSSL_NO_HMAC} + {$EXTERNALSYM HMAC_MAX_MD_CBLOCK} + HMAC_MAX_MD_CBLOCK = 128; //* largest known is SHA512 */ + {$ENDIF} + {$IFNDEF OPENSSL_NO_RIPEMD} + {$EXTERNALSYM RIPEMD160_BLOCK} + RIPEMD160_BLOCK = 16; + {$EXTERNALSYM RIPEMD160_CBLOCK} + RIPEMD160_CBLOCK = 64; + {$EXTERNALSYM RIPEMD160_DIGEST_LENGTH} + RIPEMD160_DIGEST_LENGTH = 20; + {$EXTERNALSYM RIPEMD160_LAST_BLOCK} + RIPEMD160_LAST_BLOCK = 56; + {$EXTERNALSYM RIPEMD160_LBLOCK} + RIPEMD160_LBLOCK = 16; + {$EXTERNALSYM RIPEMD160_LENGTH_BLOCK} + RIPEMD160_LENGTH_BLOCK = 8; + {$ENDIF} + {$IFNDEF OPENSSL_NO_RSA} +///* If this flag is set the RSA method is FIPS compliant and can be used +// * in FIPS mode. This is set in the validated module method. If an +// * application sets this flag in its own methods it is its reposibility +// * to ensure the result is compliant. +// */ + + {$EXTERNALSYM RSA_FLAG_FIPS_METHOD} + RSA_FLAG_FIPS_METHOD = $0400; + +///* If this flag is set the operations normally disabled in FIPS mode are +// * permitted it is then the applications responsibility to ensure that the +// * usage is compliant. +// */ + + {$EXTERNALSYM RSA_FLAG_NON_FIPS_ALLOW} + RSA_FLAG_NON_FIPS_ALLOW = $0400; + + {$EXTERNALSYM RSA_3} + RSA_3 = $3; + {$EXTERNALSYM RSA_F4} + RSA_F4 = $10001; + {$EXTERNALSYM RSA_FLAG_BLINDING} + RSA_FLAG_BLINDING = $08; + {$EXTERNALSYM RSA_FLAG_CACHE_PRIVATE} + RSA_FLAG_CACHE_PRIVATE = $04; + {$EXTERNALSYM RSA_FLAG_CACHE_PUBLIC} + RSA_FLAG_CACHE_PUBLIC = $02; + {$EXTERNALSYM RSA_FLAG_EXT_PKEY} + RSA_FLAG_EXT_PKEY = $20; + {$EXTERNALSYM RSA_FLAG_SIGN_VER} + RSA_FLAG_SIGN_VER = $0040; + {$EXTERNALSYM RSA_FLAG_NO_BLINDING} + RSA_FLAG_NO_BLINDING =$0080; //* new with 0.9.6j and 0.9.7b; the built-in + //* RSA implementation now uses blinding by + //* default (ignoring RSA_FLAG_BLINDING), + //* but other engines might not need it + //*/ + {$EXTERNALSYM RSA_FLAG_NO_CONSTTIME} + RSA_FLAG_NO_CONSTTIME = $0100; //* new with 0.9.8f; the built-in RSA + //* implementation now uses constant time + //* operations by default in private key operations, + //* e.g., constant time modular exponentiation, + //* modular inverse without leaking branches, + //* division without leaking branches. This + //* flag disables these constant time + //* operations and results in faster RSA + //* private key operations. + //*/ +{$IFNDEF OPENSSL_NO_DEPRECATED} + {$EXTERNALSYM RSA_FLAG_NO_EXP_CONSTTIME} + RSA_FLAG_NO_EXP_CONSTTIME = RSA_FLAG_NO_CONSTTIME; //* deprecated name for the flag*/ + //* new with 0.9.7h; the built-in RSA + //* implementation now uses constant time + //* modular exponentiation for secret exponents + //* by default. This flag causes the + //* faster variable sliding window method to + //* be used for all exponents. + //*/ +{$ENDIF} + //the openssl developers probably only wanted to define this if it was not already defined. + {$EXTERNALSYM RSA_MAX_MODULUS_BITS} + RSA_MAX_MODULUS_BITS = 16384; + {$EXTERNALSYM RSA_FIPS_MIN_MODULUS_BITS} + RSA_FIPS_MIN_MODULUS_BITS = 1024; + //the openssl developers probably only wanted to define this if it was not already defined. + {$EXTERNALSYM RSA_SMALL_MODULUS_BITS} + RSA_SMALL_MODULUS_BITS = 3072; + //the openssl developers probably only wanted to define this if it was not already defined. + {$EXTERNALSYM RSA_MAX_PUBEXP_BITS} + RSA_MAX_PUBEXP_BITS = 64; //* exponent limit enforced for "large" modulus only */ + + {$EXTERNALSYM RSA_FLAG_THREAD_SAFE} + RSA_FLAG_THREAD_SAFE = $10; + //* function codes */ + {$EXTERNALSYM RSA_F_FIPS_RSA_SIGN} + RSA_F_FIPS_RSA_SIGN = 140; + {$EXTERNALSYM RSA_F_FIPS_RSA_VERIFY} + RSA_F_FIPS_RSA_VERIFY = 141; + {$EXTERNALSYM RSA_F_MEMORY_LOCK} + RSA_F_MEMORY_LOCK = 100; + {$EXTERNALSYM RSA_F_RSA_CHECK_KEY} + RSA_F_RSA_CHECK_KEY = 123; + {$EXTERNALSYM RSA_F_RSA_EAY_PRIVATE_DECRYPT} + RSA_F_RSA_EAY_PRIVATE_DECRYPT = 101; + {$EXTERNALSYM RSA_F_RSA_EAY_PRIVATE_ENCRYPT} + RSA_F_RSA_EAY_PRIVATE_ENCRYPT = 102; + {$EXTERNALSYM RSA_F_RSA_EAY_PUBLIC_DECRYPT} + RSA_F_RSA_EAY_PUBLIC_DECRYPT = 103; + {$EXTERNALSYM RSA_F_RSA_EAY_PUBLIC_ENCRYPT} + RSA_F_RSA_EAY_PUBLIC_ENCRYPT = 104; + {$EXTERNALSYM RSA_F_RSA_GENERATE_KEY} + RSA_F_RSA_GENERATE_KEY = 105; + {$EXTERNALSYM RSA_F_RSA_NEW_METHOD} + RSA_F_RSA_NEW_METHOD = 106; + {$EXTERNALSYM RSA_F_RSA_PADDING_ADD_NONE} + RSA_F_RSA_PADDING_ADD_NONE = 107; + {$EXTERNALSYM RSA_F_RSA_PADDING_ADD_PKCS1_OAEP} + RSA_F_RSA_PADDING_ADD_PKCS1_OAEP = 121; + {$EXTERNALSYM RSA_F_RSA_PADDING_ADD_PKCS1_TYPE_1} + RSA_F_RSA_PADDING_ADD_PKCS1_TYPE_1 = 108; + {$EXTERNALSYM RSA_F_RSA_PADDING_ADD_PKCS1_TYPE_2} + RSA_F_RSA_PADDING_ADD_PKCS1_TYPE_2 = 109; + {$EXTERNALSYM RSA_F_RSA_PADDING_ADD_SSLV23} + RSA_F_RSA_PADDING_ADD_SSLV23 = 110; + {$EXTERNALSYM RSA_F_RSA_PADDING_CHECK_NONE} + RSA_F_RSA_PADDING_CHECK_NONE = 111; + {$EXTERNALSYM RSA_F_RSA_PADDING_CHECK_PKCS1_OAEP} + RSA_F_RSA_PADDING_CHECK_PKCS1_OAEP = 122; + {$EXTERNALSYM RSA_F_RSA_PADDING_CHECK_PKCS1_TYPE_1} + RSA_F_RSA_PADDING_CHECK_PKCS1_TYPE_1 = 112; + {$EXTERNALSYM RSA_F_RSA_PADDING_CHECK_PKCS1_TYPE_2} + RSA_F_RSA_PADDING_CHECK_PKCS1_TYPE_2 = 113; + {$EXTERNALSYM RSA_F_RSA_PADDING_CHECK_SSLV23} + RSA_F_RSA_PADDING_CHECK_SSLV23 = 114; + {$EXTERNALSYM RSA_F_RSA_PRINT} + RSA_F_RSA_PRINT = 115; + {$EXTERNALSYM RSA_F_RSA_PRINT_FP} + RSA_F_RSA_PRINT_FP = 116; + {$EXTERNALSYM RSA_F_RSA_PRIVATE_ENCRYPT} + RSA_F_RSA_PRIVATE_ENCRYPT = 137; + {$EXTERNALSYM RSA_F_RSA_PUBLIC_DECRYPT} + RSA_F_RSA_PUBLIC_DECRYPT = 138; + {$EXTERNALSYM RSA_F_RSA_SETUP_BLINDING} + RSA_F_RSA_SETUP_BLINDING = 136; + {$EXTERNALSYM RSA_F_RSA_SET_DEFAULT_METHOD} + RSA_F_RSA_SET_DEFAULT_METHOD = 139; + {$EXTERNALSYM RSA_F_RSA_SET_METHOD} + RSA_F_RSA_SET_METHOD = 142; + {$EXTERNALSYM RSA_F_RSA_SIGN} + RSA_F_RSA_SIGN = 117; + {$EXTERNALSYM RSA_F_RSA_SIGN_ASN1_OCTET_STRING} + RSA_F_RSA_SIGN_ASN1_OCTET_STRING = 118; + {$EXTERNALSYM RSA_F_RSA_VERIFY} + RSA_F_RSA_VERIFY = 119; + {$EXTERNALSYM RSA_F_RSA_VERIFY_ASN1_OCTET_STRING} + RSA_F_RSA_VERIFY_ASN1_OCTET_STRING = 120; + {$EXTERNALSYM RSA_F_RSA_VERIFY_PKCS1_PSS} + RSA_F_RSA_VERIFY_PKCS1_PSS = 126; + {$EXTERNALSYM RSA_METHOD_FLAG_NO_CHECK} + RSA_METHOD_FLAG_NO_CHECK = $01; + {$EXTERNALSYM RSA_NO_PADDING} + RSA_NO_PADDING = 3; + {$EXTERNALSYM RSA_PKCS1_OAEP_PADDING} + RSA_PKCS1_OAEP_PADDING = 4; + {$EXTERNALSYM RSA_PKCS1_PADDING} + RSA_PKCS1_PADDING = 1; + {$EXTERNALSYM RSA_R_ALGORITHM_MISMATCH} + RSA_R_ALGORITHM_MISMATCH = 100; + {$EXTERNALSYM RSA_R_BAD_E_VALUE} + RSA_R_BAD_E_VALUE = 101; + {$EXTERNALSYM RSA_R_BAD_FIXED_HEADER_DECRYPT} + RSA_R_BAD_FIXED_HEADER_DECRYPT = 102; + {$EXTERNALSYM RSA_R_BAD_PAD_BYTE_COUNT} + RSA_R_BAD_PAD_BYTE_COUNT = 103; + {$EXTERNALSYM RSA_R_BAD_SIGNATURE} + RSA_R_BAD_SIGNATURE = 104; + {$EXTERNALSYM RSA_R_BLOCK_TYPE_IS_NOT_01} + RSA_R_BLOCK_TYPE_IS_NOT_01 = 106; + {$EXTERNALSYM RSA_R_BLOCK_TYPE_IS_NOT_02} + RSA_R_BLOCK_TYPE_IS_NOT_02 = 107; + {$EXTERNALSYM RSA_R_DATA_GREATER_THAN_MOD_LEN} + RSA_R_DATA_GREATER_THAN_MOD_LEN = 108; + {$EXTERNALSYM RSA_R_DATA_TOO_LARGE} + RSA_R_DATA_TOO_LARGE = 109; + {$EXTERNALSYM RSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE} + RSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE = 110; + {$EXTERNALSYM RSA_R_DATA_TOO_SMALL} + RSA_R_DATA_TOO_SMALL = 111; + {$EXTERNALSYM RSA_R_DATA_TOO_SMALL_FOR_KEY_SIZE} + RSA_R_DATA_TOO_SMALL_FOR_KEY_SIZE = 122; + {$EXTERNALSYM RSA_R_DIGEST_TOO_BIG_FOR_RSA_KEY} + RSA_R_DIGEST_TOO_BIG_FOR_RSA_KEY = 112; + {$EXTERNALSYM RSA_R_DMP1_NOT_CONGRUENT_TO_D} + RSA_R_DMP1_NOT_CONGRUENT_TO_D = 124; + {$EXTERNALSYM RSA_R_DMQ1_NOT_CONGRUENT_TO_D} + RSA_R_DMQ1_NOT_CONGRUENT_TO_D = 125; + {$EXTERNALSYM RSA_R_D_E_NOT_CONGRUENT_TO_1} + RSA_R_D_E_NOT_CONGRUENT_TO_1 = 123; + {$EXTERNALSYM RSA_R_IQMP_NOT_INVERSE_OF_Q} + RSA_R_IQMP_NOT_INVERSE_OF_Q = 126; + {$EXTERNALSYM RSA_R_KEY_SIZE_TOO_SMALL} + RSA_R_KEY_SIZE_TOO_SMALL = 120; + {$EXTERNALSYM RSA_R_LAST_OCTET_INVALID} + RSA_R_LAST_OCTET_INVALID = 134; + {$EXTERNALSYM RSA_R_MODULUS_TOO_LARGE} + RSA_R_MODULUS_TOO_LARGE = 105; + {$EXTERNALSYM RSA_R_NON_FIPS_METHOD} + RSA_R_NON_FIPS_METHOD = 141; + {$EXTERNALSYM RSA_R_NO_PUBLIC_EXPONENT} + RSA_R_NO_PUBLIC_EXPONENT = 140; + {$EXTERNALSYM RSA_R_NULL_BEFORE_BLOCK_MISSING} + RSA_R_NULL_BEFORE_BLOCK_MISSING = 113; + {$EXTERNALSYM RSA_R_N_DOES_NOT_EQUAL_P_Q} + RSA_R_N_DOES_NOT_EQUAL_P_Q = 127; + {$EXTERNALSYM RSA_R_OAEP_DECODING_ERROR} + RSA_R_OAEP_DECODING_ERROR = 121; + {$EXTERNALSYM RSA_R_OPERATION_NOT_ALLOWED_IN_FIPS_MODE} + RSA_R_OPERATION_NOT_ALLOWED_IN_FIPS_MODE = 142; + {$EXTERNALSYM RSA_R_PADDING_CHECK_FAILED} + RSA_R_PADDING_CHECK_FAILED = 114; + {$EXTERNALSYM RSA_R_P_NOT_PRIME} + RSA_R_P_NOT_PRIME = 128; + {$EXTERNALSYM RSA_R_Q_NOT_PRIME} + RSA_R_Q_NOT_PRIME = 129; + {$EXTERNALSYM RSA_R_SLEN_CHECK_FAILED} + RSA_R_SLEN_CHECK_FAILED = 136; + {$EXTERNALSYM RSA_R_SLEN_RECOVERY_FAILED} + RSA_R_SLEN_RECOVERY_FAILED = 135; + {$EXTERNALSYM RSA_R_SSLV3_ROLLBACK_ATTACK} + RSA_R_SSLV3_ROLLBACK_ATTACK = 115; + {$EXTERNALSYM RSA_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD} + RSA_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD = 116; + {$EXTERNALSYM RSA_R_UNKNOWN_ALGORITHM_TYPE} + RSA_R_UNKNOWN_ALGORITHM_TYPE = 117; + {$EXTERNALSYM RSA_R_UNKNOWN_PADDING_TYPE} + RSA_R_UNKNOWN_PADDING_TYPE = 118; + {$EXTERNALSYM RSA_R_WRONG_SIGNATURE_LENGTH} + RSA_R_WRONG_SIGNATURE_LENGTH = 119; + {$EXTERNALSYM RSA_SSLV23_PADDING} + RSA_SSLV23_PADDING = 2; + {$ENDIF} + {$EXTERNALSYM SEEK_CUR} + SEEK_CUR = 1; + {$EXTERNALSYM SEEK_END} + SEEK_END = 2; + {$EXTERNALSYM SEEK_SET} + SEEK_SET = 0; + {$EXTERNALSYM SN_Algorithm} + SN_Algorithm = 'Algorithm'; {Do not localize} + {$EXTERNALSYM SN_SMIMECapabilities} + SN_SMIMECapabilities = 'SMIME-CAPS'; {Do not localize} + {$EXTERNALSYM SN_authority_key_identifier} + SN_authority_key_identifier = 'authorityKeyIdentifier'; {Do not localize} + {$EXTERNALSYM SN_basic_constraints} + SN_basic_constraints = 'basicConstraints'; {Do not localize} + {$EXTERNALSYM SN_bf_cbc} + SN_bf_cbc = 'BF-CBC'; {Do not localize} + {$EXTERNALSYM SN_bf_cfb64} + SN_bf_cfb64 = 'BF-CFB'; {Do not localize} + {$EXTERNALSYM SN_bf_ecb} + SN_bf_ecb = 'BF-ECB'; {Do not localize} + {$EXTERNALSYM SN_bf_ofb64} + SN_bf_ofb64 = 'BF-OFB'; {Do not localize} + {$EXTERNALSYM SN_cast5_cbc} + SN_cast5_cbc = 'CAST5-CBC'; {Do not localize} + {$EXTERNALSYM SN_cast5_cfb64} + SN_cast5_cfb64 = 'CAST5-CFB'; {Do not localize} + {$EXTERNALSYM SN_cast5_ecb} + SN_cast5_ecb = 'CAST5-ECB'; {Do not localize} + {$EXTERNALSYM SN_cast5_ofb64} + SN_cast5_ofb64 = 'CAST5-OFB'; {Do not localize} + {$EXTERNALSYM SN_certificate_policies} + SN_certificate_policies = 'certificatePolicies'; {Do not localize} + {$EXTERNALSYM SN_client_auth} + SN_client_auth = 'clientAuth'; {Do not localize} + {$EXTERNALSYM SN_code_sign} + SN_code_sign = 'codeSigning'; {Do not localize} + {$EXTERNALSYM SN_commonName} + SN_commonName = 'CN'; {Do not localize} + {$EXTERNALSYM SN_countryName} + SN_countryName = 'C'; {Do not localize} + {$EXTERNALSYM SN_crl_distribution_points} + SN_crl_distribution_points = 'crlDistributionPoints'; {Do not localize} + {$EXTERNALSYM SN_crl_number} + SN_crl_number = 'crlNumber'; {Do not localize} + {$EXTERNALSYM SN_crl_reason} + SN_crl_reason = 'CRLReason'; {Do not localize} + {$EXTERNALSYM SN_delta_crl} + SN_delta_crl = 'deltaCRL'; {Do not localize} + {$EXTERNALSYM SN_des_cbc} + SN_des_cbc = 'DES-CBC'; {Do not localize} + {$EXTERNALSYM SN_des_cfb64} + SN_des_cfb64 = 'DES-CFB'; {Do not localize} + {$EXTERNALSYM SN_des_ecb} + SN_des_ecb = 'DES-ECB'; {Do not localize} + {$EXTERNALSYM SN_des_ede} + SN_des_ede = 'DES-EDE'; {Do not localize} + {$EXTERNALSYM SN_des_ede3} + SN_des_ede3 = 'DES-EDE3'; {Do not localize} + {$EXTERNALSYM SN_des_ede3_cbc} + SN_des_ede3_cbc = 'DES-EDE3-CBC'; {Do not localize} + {$EXTERNALSYM SN_des_ede3_cfb64} + SN_des_ede3_cfb64 = 'DES-EDE3-CFB'; {Do not localize} + {$EXTERNALSYM SN_des_ede3_ofb64} + SN_des_ede3_ofb64 = 'DES-EDE3-OFB'; {Do not localize} + {$EXTERNALSYM SN_des_ede_cbc} + SN_des_ede_cbc = 'DES-EDE-CBC'; {Do not localize} + {$EXTERNALSYM SN_des_ede_cfb64} + SN_des_ede_cfb64 = 'DES-EDE-CFB'; {Do not localize} + {$EXTERNALSYM SN_des_ede_ofb64} + SN_des_ede_ofb64 = 'DES-EDE-OFB'; {Do not localize} + {$EXTERNALSYM SN_des_ofb64} + SN_des_ofb64 = 'DES-OFB'; {Do not localize} + {$EXTERNALSYM SN_description} + SN_description = 'D'; {Do not localize} + {$EXTERNALSYM SN_desx_cbc} + SN_desx_cbc = 'DESX-CBC'; {Do not localize} + {$EXTERNALSYM SN_dsa} + SN_dsa = 'DSA'; {Do not localize} + {$EXTERNALSYM SN_dsaWithSHA} + SN_dsaWithSHA = 'DSA-SHA'; {Do not localize} + {$EXTERNALSYM SN_dsaWithSHA1} + SN_dsaWithSHA1 = 'DSA-SHA1'; {Do not localize} + {$EXTERNALSYM SN_dsaWithSHA1_2} + SN_dsaWithSHA1_2 = 'DSA-SHA1-old'; {Do not localize} + {$EXTERNALSYM SN_dsa_2} + SN_dsa_2 = 'DSA-old'; {Do not localize} + {$EXTERNALSYM SN_X9_62_id_ecPublicKey} + SN_X9_62_id_ecPublicKey = 'id-ecPublicKey'; {Do not localize} + {$EXTERNALSYM SN_email_protect} + SN_email_protect = 'emailProtection'; {Do not localize} + {$EXTERNALSYM SN_ext_key_usage} + SN_ext_key_usage = 'extendedKeyUsage'; {Do not localize} + {$EXTERNALSYM SN_givenName} + SN_givenName = 'G'; {Do not localize} + {$EXTERNALSYM SN_id_kp} + SN_id_kp = 'id-kp'; {Do not localize} + {$EXTERNALSYM SN_id_pkix} + SN_id_pkix = 'PKIX'; {Do not localize} + {$EXTERNALSYM SN_id_qt_cps} + SN_id_qt_cps = 'id-qt-cps'; {Do not localize} + {$EXTERNALSYM SN_id_qt_unotice} + SN_id_qt_unotice = 'id-qt-unotice'; {Do not localize} + {$EXTERNALSYM SN_idea_cbc} + SN_idea_cbc = 'IDEA-CBC'; {Do not localize} + {$EXTERNALSYM SN_idea_cfb64} + SN_idea_cfb64 = 'IDEA-CFB'; {Do not localize} + {$EXTERNALSYM SN_idea_ecb} + SN_idea_ecb = 'IDEA-ECB'; {Do not localize} + {$EXTERNALSYM SN_idea_ofb64} + SN_idea_ofb64 = 'IDEA-OFB'; {Do not localize} + {$EXTERNALSYM SN_identified_organization} + SN_identified_organization = 'identified-organization'; {Do not localize} + {$EXTERNALSYM SN_initials} + SN_initials = 'I'; {Do not localize} + {$EXTERNALSYM SN_invalidity_date} + SN_invalidity_date = 'invalidityDate'; {Do not localize} + {$EXTERNALSYM SN_iso} + SN_iso = 'ISO'; {Do not localize} + {$EXTERNALSYM SN_issuer_alt_name} + SN_issuer_alt_name = 'issuerAltName'; {Do not localize} + {$EXTERNALSYM SN_itu_t} + SN_itu_t = 'ITU-T'; {Do not localize} + {$EXTERNALSYM SN_joint_iso_itu_t} + SN_joint_iso_itu_t = 'JOINT-ISO-ITU-T'; {Do not localize} + {$EXTERNALSYM SN_key_usage} + SN_key_usage = 'keyUsage'; {Do not localize} + {$EXTERNALSYM SN_ld_ce} + SN_ld_ce = 'ld-ce'; {Do not localize} + {$EXTERNALSYM SN_localityName} + SN_localityName = 'L'; {Do not localize} + {$EXTERNALSYM SN_md2} + SN_md2 = 'MD2'; {Do not localize} + {$EXTERNALSYM SN_md2WithRSAEncryption} + SN_md2WithRSAEncryption = 'RSA-MD2'; {Do not localize} + {$EXTERNALSYM SN_md5} + SN_md5 = 'MD5'; {Do not localize} + {$EXTERNALSYM SN_md5WithRSA} + SN_md5WithRSA = 'RSA-NP-MD5'; {Do not localize} + {$EXTERNALSYM SN_md5WithRSAEncryption} + SN_md5WithRSAEncryption = 'RSA-MD5'; {Do not localize} + {$EXTERNALSYM SN_md5_sha1} + SN_md5_sha1 = 'MD5-SHA1'; {Do not localize} + {$EXTERNALSYM SN_mdc2} + SN_mdc2 = 'MDC2'; {Do not localize} + {$EXTERNALSYM SN_mdc2WithRSA} + SN_mdc2WithRSA = 'RSA-MDC2'; {Do not localize} + {$EXTERNALSYM SN_member_body} + SN_member_body ='member-body'; {Do not localize} + {$EXTERNALSYM SN_ms_code_com} + SN_ms_code_com = 'msCodeCom'; {Do not localize} + {$EXTERNALSYM SN_ms_code_ind} + SN_ms_code_ind = 'msCodeInd'; {Do not localize} + {$EXTERNALSYM SN_ms_ctl_sign} + SN_ms_ctl_sign = 'msCTLSign'; {Do not localize} + {$EXTERNALSYM SN_ms_efs} + SN_ms_efs = 'msEFS'; {Do not localize} + {$EXTERNALSYM SN_ms_sgc} + SN_ms_sgc = 'msSGC'; {Do not localize} + {$EXTERNALSYM SN_netscape} + SN_netscape = 'Netscape'; {Do not localize} + {$EXTERNALSYM SN_netscape_base_url} + SN_netscape_base_url = 'nsBaseUrl'; {Do not localize} + {$EXTERNALSYM SN_netscape_ca_policy_url} + SN_netscape_ca_policy_url = 'nsCaPolicyUrl'; {Do not localize} + {$EXTERNALSYM SN_netscape_ca_revocation_url} + SN_netscape_ca_revocation_url = 'nsCaRevocationUrl'; {Do not localize} + {$EXTERNALSYM SN_netscape_cert_extension} + SN_netscape_cert_extension = 'nsCertExt'; {Do not localize} + {$EXTERNALSYM SN_netscape_cert_sequence} + SN_netscape_cert_sequence = 'nsCertSequence'; {Do not localize} + {$EXTERNALSYM SN_netscape_cert_type} + SN_netscape_cert_type = 'nsCertType'; {Do not localize} + {$EXTERNALSYM SN_netscape_comment} + SN_netscape_comment = 'nsComment'; {Do not localize} + {$EXTERNALSYM SN_netscape_data_type} + SN_netscape_data_type = 'nsDataType'; {Do not localize} + {$EXTERNALSYM SN_netscape_renewal_url} + SN_netscape_renewal_url = 'nsRenewalUrl'; {Do not localize} + {$EXTERNALSYM SN_netscape_revocation_url} + SN_netscape_revocation_url = 'nsRevocationUrl'; {Do not localize} + {$EXTERNALSYM SN_netscape_ssl_server_name} + SN_netscape_ssl_server_name = 'nsSslServerName'; {Do not localize} + {$EXTERNALSYM SN_ns_sgc} + SN_ns_sgc = 'nsSGC'; {Do not localize} + {$EXTERNALSYM SN_organizationName} + SN_organizationName = 'O'; {Do not localize} + {$EXTERNALSYM SN_organizationalUnitName} + SN_organizationalUnitName = 'OU'; {Do not localize} + {$EXTERNALSYM SN_pkcs9_emailAddress} + SN_pkcs9_emailAddress = 'Email'; {Do not localize} + {$EXTERNALSYM SN_private_key_usage_period} + SN_private_key_usage_period = 'privateKeyUsagePeriod'; {Do not localize} + {$EXTERNALSYM SN_rc2_40_cbc} + SN_rc2_40_cbc = 'RC2-40-CBC'; {Do not localize} + {$EXTERNALSYM SN_rc2_64_cbc} + SN_rc2_64_cbc = 'RC2-64-CBC'; {Do not localize} + {$EXTERNALSYM SN_rc2_cbc} + SN_rc2_cbc = 'RC2-CBC'; {Do not localize} + {$EXTERNALSYM SN_rc2_cfb64} + SN_rc2_cfb64 = 'RC2-CFB'; {Do not localize} + {$EXTERNALSYM SN_rc2_ecb} + SN_rc2_ecb = 'RC2-ECB'; {Do not localize} + {$EXTERNALSYM SN_rc2_ofb64} + SN_rc2_ofb64 = 'RC2-OFB'; {Do not localize} + {$EXTERNALSYM SN_rc4} + SN_rc4 = 'RC4'; {Do not localize} + {$EXTERNALSYM SN_rc4_40} + SN_rc4_40 = 'RC4-40'; {Do not localize} + {$EXTERNALSYM SN_rc5_cbc} + SN_rc5_cbc = 'RC5-CBC'; {Do not localize} + {$EXTERNALSYM SN_rc5_cfb64} + SN_rc5_cfb64 = 'RC5-CFB'; {Do not localize} + {$EXTERNALSYM SN_rc5_ecb} + SN_rc5_ecb = 'RC5-ECB'; {Do not localize} + {$EXTERNALSYM SN_rc5_ofb64} + SN_rc5_ofb64 = 'RC5-OFB'; {Do not localize} + {$EXTERNALSYM SN_ripemd160} + SN_ripemd160 = 'RIPEMD160'; {Do not localize} + {$EXTERNALSYM SN_ripemd160WithRSA} + SN_ripemd160WithRSA = 'RSA-RIPEMD160'; {Do not localize} + {$EXTERNALSYM SN_rle_compression} + SN_rle_compression = 'RLE'; {Do not localize} + {$EXTERNALSYM SN_rsa} + SN_rsa = 'RSA'; {Do not localize} + {$EXTERNALSYM SN_serialNumber} + SN_serialNumber = 'SN'; {Do not localize} + {$EXTERNALSYM SN_server_auth} + SN_server_auth = 'serverAuth'; {Do not localize} + {$EXTERNALSYM SN_sha} + SN_sha = 'SHA'; {Do not localize} + {$EXTERNALSYM SN_sha1} + SN_sha1 = 'SHA1'; {Do not localize} + {$EXTERNALSYM SN_sha1WithRSA} + SN_sha1WithRSA = 'RSA-SHA1-2'; {Do not localize} + {$EXTERNALSYM SN_sha1WithRSAEncryption} + SN_sha1WithRSAEncryption = 'RSA-SHA1'; {Do not localize} + {$EXTERNALSYM SN_shaWithRSAEncryption} + SN_shaWithRSAEncryption = 'RSA-SHA'; {Do not localize} + {$EXTERNALSYM SN_stateOrProvinceName} + SN_stateOrProvinceName = 'ST'; {Do not localize} + {$EXTERNALSYM SN_subject_alt_name} + SN_subject_alt_name = 'subjectAltName'; {Do not localize} + {$EXTERNALSYM SN_subject_key_identifier} + SN_subject_key_identifier = 'subjectKeyIdentifier'; {Do not localize} + {$EXTERNALSYM SN_surname} + SN_surname = 'S'; {Do not localize} + {$EXTERNALSYM SN_sxnet} + SN_sxnet = 'SXNetID'; {Do not localize} + {$EXTERNALSYM SN_time_stamp} + SN_time_stamp = 'timeStamping'; {Do not localize} + {$EXTERNALSYM SN_title} + SN_title = 'T'; {Do not localize} + {$EXTERNALSYM SN_undef} + SN_undef = 'UNDEF'; {Do not localize} + {$EXTERNALSYM SN_uniqueIdentifier} + SN_uniqueIdentifier = 'UID'; {Do not localize} + {$EXTERNALSYM SN_zlib_compression} + SN_zlib_compression = 'ZLIB'; {Do not localize} + {$EXTERNALSYM OCSP_DEFAULT_NONCE_LENGTH} + OCSP_DEFAULT_NONCE_LENGTH = 16; + {$EXTERNALSYM OCSP_NOCERTS} + OCSP_NOCERTS = $1; + {$EXTERNALSYM OCSP_NOINTERN} + OCSP_NOINTERN = $2; + {$EXTERNALSYM OCSP_NOSIGS} + OCSP_NOSIGS = $4; + {$EXTERNALSYM OCSP_NOCHAIN} + OCSP_NOCHAIN = $8; + {$EXTERNALSYM OCSP_NOVERIFY} + OCSP_NOVERIFY = $10; + {$EXTERNALSYM OCSP_NOEXPLICIT} + OCSP_NOEXPLICIT = $20; + {$EXTERNALSYM OCSP_NOCASIGN} + OCSP_NOCASIGN = $40; + {$EXTERNALSYM OCSP_NODELEGATED} + OCSP_NODELEGATED = $80; + {$EXTERNALSYM OCSP_NOCHECKS} + OCSP_NOCHECKS = $100; + {$EXTERNALSYM OCSP_TRUSTOTHER} + OCSP_TRUSTOTHER = $200; + {$EXTERNALSYM OCSP_RESPID_KEY} + OCSP_RESPID_KEY = $400; + {$EXTERNALSYM OCSP_NOTIME} + OCSP_NOTIME = $800; + {$EXTERNALSYM OCSP_RESPONSE_STATUS_SUCCESSFUL} + OCSP_RESPONSE_STATUS_SUCCESSFUL = 0; + {$EXTERNALSYM OCSP_RESPONSE_STATUS_MALFORMEDREQUEST} + OCSP_RESPONSE_STATUS_MALFORMEDREQUEST = 1; + {$EXTERNALSYM OCSP_RESPONSE_STATUS_INTERNALERROR} + OCSP_RESPONSE_STATUS_INTERNALERROR = 2; + {$EXTERNALSYM OCSP_RESPONSE_STATUS_TRYLATER} + OCSP_RESPONSE_STATUS_TRYLATER = 3; + {$EXTERNALSYM OCSP_RESPONSE_STATUS_SIGREQUIRED} + OCSP_RESPONSE_STATUS_SIGREQUIRED = 5; + {$EXTERNALSYM OCSP_RESPONSE_STATUS_UNAUTHORIZED} + OCSP_RESPONSE_STATUS_UNAUTHORIZED = 6; + {$EXTERNALSYM OCSP_REVOKED_STATUS_NOSTATUS} + OCSP_REVOKED_STATUS_NOSTATUS = -1; + {$EXTERNALSYM OCSP_REVOKED_STATUS_UNSPECIFIED} + OCSP_REVOKED_STATUS_UNSPECIFIED = 0; + {$EXTERNALSYM OCSP_REVOKED_STATUS_KEYCOMPROMISE} + OCSP_REVOKED_STATUS_KEYCOMPROMISE = 1; + {$EXTERNALSYM OCSP_REVOKED_STATUS_CACOMPROMISE} + OCSP_REVOKED_STATUS_CACOMPROMISE = 2; + {$EXTERNALSYM OCSP_REVOKED_STATUS_AFFILIATIONCHANGED} + OCSP_REVOKED_STATUS_AFFILIATIONCHANGED = 3; + {$EXTERNALSYM OCSP_REVOKED_STATUS_SUPERSEDED} + OCSP_REVOKED_STATUS_SUPERSEDED = 4; + {$EXTERNALSYM OCSP_REVOKED_STATUS_CESSATIONOFOPERATION} + OCSP_REVOKED_STATUS_CESSATIONOFOPERATION = 5; + {$EXTERNALSYM OCSP_REVOKED_STATUS_CERTIFICATEHOLD} + OCSP_REVOKED_STATUS_CERTIFICATEHOLD = 6; + {$EXTERNALSYM OCSP_REVOKED_STATUS_REMOVEFROMCRL} + OCSP_REVOKED_STATUS_REMOVEFROMCRL = 8; + {$EXTERNALSYM V_OCSP_CERTSTATUS_GOOD} + V_OCSP_CERTSTATUS_GOOD = 0; + {$EXTERNALSYM V_OCSP_CERTSTATUS_REVOKED} + V_OCSP_CERTSTATUS_REVOKED = 1; + {$EXTERNALSYM V_OCSP_CERTSTATUS_UNKNOWN} + V_OCSP_CERTSTATUS_UNKNOWN = 2; + {$EXTERNALSYM OCSP_F_ASN1_STRING_ENCODE} + OCSP_F_ASN1_STRING_ENCODE = 100; + {$EXTERNALSYM OCSP_F_D2I_OCSP_NONCE} + OCSP_F_D2I_OCSP_NONCE = 102; + {$EXTERNALSYM OCSP_F_OCSP_BASIC_ADD1_STATUS} + OCSP_F_OCSP_BASIC_ADD1_STATUS = 103; + {$EXTERNALSYM OCSP_F_OCSP_BASIC_SIGN} + OCSP_F_OCSP_BASIC_SIGN = 104; + {$EXTERNALSYM OCSP_F_OCSP_BASIC_VERIFY} + OCSP_F_OCSP_BASIC_VERIFY = 105; + {$EXTERNALSYM OCSP_F_OCSP_CERT_ID_NEW} + OCSP_F_OCSP_CERT_ID_NEW = 101; + {$EXTERNALSYM OCSP_F_OCSP_CHECK_DELEGATED} + OCSP_F_OCSP_CHECK_DELEGATED = 106; + {$EXTERNALSYM OCSP_F_OCSP_CHECK_IDS} + OCSP_F_OCSP_CHECK_IDS = 107; + {$EXTERNALSYM OCSP_F_OCSP_CHECK_ISSUER} + OCSP_F_OCSP_CHECK_ISSUER = 108; + {$EXTERNALSYM OCSP_F_OCSP_CHECK_VALIDITY} + OCSP_F_OCSP_CHECK_VALIDITY = 115; + {$EXTERNALSYM OCSP_F_OCSP_MATCH_ISSUERID} + OCSP_F_OCSP_MATCH_ISSUERID = 109; + {$EXTERNALSYM OCSP_F_OCSP_PARSE_URL} + OCSP_F_OCSP_PARSE_URL = 114; + {$EXTERNALSYM OCSP_F_OCSP_REQUEST_SIGN} + OCSP_F_OCSP_REQUEST_SIGN = 110; + {$EXTERNALSYM OCSP_F_OCSP_REQUEST_VERIFY} + OCSP_F_OCSP_REQUEST_VERIFY = 116; + {$EXTERNALSYM OCSP_F_OCSP_RESPONSE_GET1_BASIC} + OCSP_F_OCSP_RESPONSE_GET1_BASIC = 111; + {$EXTERNALSYM OCSP_F_OCSP_SENDREQ_BIO} + OCSP_F_OCSP_SENDREQ_BIO = 112; + {$EXTERNALSYM OCSP_F_PARSE_HTTP_LINE1} + OCSP_F_PARSE_HTTP_LINE1 = 117; + {$EXTERNALSYM OCSP_F_REQUEST_VERIFY} + OCSP_F_REQUEST_VERIFY = 113; +//* Reason codes. */ + {$EXTERNALSYM OCSP_R_BAD_DATA} + OCSP_R_BAD_DATA = 100; + {$EXTERNALSYM OCSP_R_CERTIFICATE_VERIFY_ERROR} + OCSP_R_CERTIFICATE_VERIFY_ERROR = 101; + {$EXTERNALSYM OCSP_R_DIGEST_ERR} + OCSP_R_DIGEST_ERR = 102; + {$EXTERNALSYM OCSP_R_ERROR_IN_NEXTUPDATE_FIELD} + OCSP_R_ERROR_IN_NEXTUPDATE_FIELD = 122; + {$EXTERNALSYM OCSP_R_ERROR_IN_THISUPDATE_FIELD} + OCSP_R_ERROR_IN_THISUPDATE_FIELD = 123; + {$EXTERNALSYM OCSP_R_ERROR_PARSING_URL} + OCSP_R_ERROR_PARSING_URL = 121; + {$EXTERNALSYM OCSP_R_MISSING_OCSPSIGNING_USAGE} + OCSP_R_MISSING_OCSPSIGNING_USAGE = 103; + {$EXTERNALSYM OCSP_R_NEXTUPDATE_BEFORE_THISUPDATE} + OCSP_R_NEXTUPDATE_BEFORE_THISUPDATE = 124; + {$EXTERNALSYM OCSP_R_NOT_BASIC_RESPONSE} + OCSP_R_NOT_BASIC_RESPONSE = 104; + {$EXTERNALSYM OCSP_R_NO_CERTIFICATES_IN_CHAIN} + OCSP_R_NO_CERTIFICATES_IN_CHAIN = 105; + {$EXTERNALSYM OCSP_R_NO_CONTENT} + OCSP_R_NO_CONTENT = 106; + {$EXTERNALSYM OCSP_R_NO_PUBLIC_KEY} + OCSP_R_NO_PUBLIC_KEY = 107; + {$EXTERNALSYM OCSP_R_NO_RESPONSE_DATA} + OCSP_R_NO_RESPONSE_DATA = 108; + {$EXTERNALSYM OCSP_R_NO_REVOKED_TIME} + OCSP_R_NO_REVOKED_TIME = 109; + {$EXTERNALSYM OCSP_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE} + OCSP_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE = 110; + {$EXTERNALSYM OCSP_R_REQUEST_NOT_SIGNED} + OCSP_R_REQUEST_NOT_SIGNED = 128; + {$EXTERNALSYM OCSP_R_RESPONSE_CONTAINS_NO_REVOCATION_DATA} + OCSP_R_RESPONSE_CONTAINS_NO_REVOCATION_DATA = 111; + {$EXTERNALSYM OCSP_R_ROOT_CA_NOT_TRUSTED} + OCSP_R_ROOT_CA_NOT_TRUSTED = 112; + {$EXTERNALSYM OCSP_R_SERVER_READ_ERROR} + OCSP_R_SERVER_READ_ERROR = 113; + {$EXTERNALSYM OCSP_R_SERVER_RESPONSE_ERROR} + OCSP_R_SERVER_RESPONSE_ERROR = 114; + {$EXTERNALSYM OCSP_R_SERVER_RESPONSE_PARSE_ERROR} + OCSP_R_SERVER_RESPONSE_PARSE_ERROR = 115; + {$EXTERNALSYM OCSP_R_SERVER_WRITE_ERROR} + OCSP_R_SERVER_WRITE_ERROR = 116; + {$EXTERNALSYM OCSP_R_SIGNATURE_FAILURE} + OCSP_R_SIGNATURE_FAILURE = 117; + {$EXTERNALSYM OCSP_R_SIGNER_CERTIFICATE_NOT_FOUND} + OCSP_R_SIGNER_CERTIFICATE_NOT_FOUND = 118; + {$EXTERNALSYM OCSP_R_STATUS_EXPIRED} + OCSP_R_STATUS_EXPIRED = 125; + {$EXTERNALSYM OCSP_R_STATUS_NOT_YET_VALID} + OCSP_R_STATUS_NOT_YET_VALID = 126; + {$EXTERNALSYM OCSP_R_STATUS_TOO_OLD} + OCSP_R_STATUS_TOO_OLD = 127; + {$EXTERNALSYM OCSP_R_UNKNOWN_MESSAGE_DIGEST} + OCSP_R_UNKNOWN_MESSAGE_DIGEST = 119; + {$EXTERNALSYM OCSP_R_UNKNOWN_NID} + OCSP_R_UNKNOWN_NID = 120; + {$EXTERNALSYM OCSP_R_UNSUPPORTED_REQUESTORNAME_TYPE} + OCSP_R_UNSUPPORTED_REQUESTORNAME_TYPE = 129; + {$EXTERNALSYM SSL_ST_CONNECT} + SSL_ST_CONNECT = $1000; + {$EXTERNALSYM SSL_ST_ACCEPT} + SSL_ST_ACCEPT = $2000; + {$EXTERNALSYM SSL_ST_MASK} + SSL_ST_MASK = $0FFF; + {$EXTERNALSYM SSL_ST_INIT} + SSL_ST_INIT = SSL_ST_CONNECT or SSL_ST_ACCEPT; + {$EXTERNALSYM SSL_ST_BEFORE} + SSL_ST_BEFORE = $4000; + {$EXTERNALSYM SSL_ST_OK} + SSL_ST_OK = $03; + {$EXTERNALSYM SSL_ST_RENEGOTIATE} + SSL_ST_RENEGOTIATE = $04 or SSL_ST_INIT; + {$EXTERNALSYM SSL_CB_LOOP} + SSL_CB_LOOP = $01; + {$EXTERNALSYM SSL_CB_EXIT} + SSL_CB_EXIT = $02; + {$EXTERNALSYM SSL_CB_READ} + SSL_CB_READ = $04; + {$EXTERNALSYM SSL_CB_WRITE} + SSL_CB_WRITE = $08; + {$EXTERNALSYM SSL_CB_ALERT} + SSL_CB_ALERT = $4000; + + {$EXTERNALSYM SSL_CB_READ_ALERT} + SSL_CB_READ_ALERT = SSL_CB_ALERT or SSL_CB_READ; + {$EXTERNALSYM SSL_CB_WRITE_ALERT} + SSL_CB_WRITE_ALERT = SSL_CB_ALERT or SSL_CB_WRITE; + {$EXTERNALSYM SSL_CB_ACCEPT_LOOP} + SSL_CB_ACCEPT_LOOP = SSL_ST_ACCEPT or SSL_CB_LOOP; + {$EXTERNALSYM SSL_CB_ACCEPT_EXIT} + SSL_CB_ACCEPT_EXIT = SSL_ST_ACCEPT or SSL_CB_EXIT; + {$EXTERNALSYM SSL_CB_CONNECT_LOOP} + SSL_CB_CONNECT_LOOP = SSL_ST_CONNECT or SSL_CB_LOOP; + {$EXTERNALSYM SSL_CB_CONNECT_EXIT} + SSL_CB_CONNECT_EXIT = SSL_ST_CONNECT or SSL_CB_EXIT; + {$EXTERNALSYM SSL_CB_HANDSHAKE_START} + SSL_CB_HANDSHAKE_START = $10; + {$EXTERNALSYM SSL_CB_HANDSHAKE_DONE} + SSL_CB_HANDSHAKE_DONE = $20; + {$EXTERNALSYM SSL_ST_READ_BODY} + SSL_ST_READ_BODY = $F1; + {$EXTERNALSYM SSL_ST_READ_DONE} + SSL_ST_READ_DONE = $F2; + {$EXTERNALSYM SSL_ST_READ_HEADER} + SSL_ST_READ_HEADER = $F0; + + {$EXTERNALSYM SSL23_ST_CR_SRVR_HELLO_A} + SSL23_ST_CR_SRVR_HELLO_A = $220 or SSL_ST_CONNECT; + {$EXTERNALSYM SSL23_ST_CR_SRVR_HELLO_B} + SSL23_ST_CR_SRVR_HELLO_B = $221 or SSL_ST_CONNECT; + {$EXTERNALSYM SSL23_ST_CW_CLNT_HELLO_A} + SSL23_ST_CW_CLNT_HELLO_A = $210 or SSL_ST_CONNECT; + {$EXTERNALSYM SSL23_ST_CW_CLNT_HELLO_B} + SSL23_ST_CW_CLNT_HELLO_B = $211 or SSL_ST_CONNECT; + + {$EXTERNALSYM SSL23_ST_SR_CLNT_HELLO_A} + SSL23_ST_SR_CLNT_HELLO_A = $210 or SSL_ST_ACCEPT; + {$EXTERNALSYM SSL23_ST_SR_CLNT_HELLO_B} + SSL23_ST_SR_CLNT_HELLO_B = $211 or SSL_ST_ACCEPT; + {$EXTERNALSYM SSL2_AT_MD5_WITH_RSA_ENCRYPTION} + SSL2_AT_MD5_WITH_RSA_ENCRYPTION = $01; + {$EXTERNALSYM SSL2_CF_5_BYTE_ENC} + SSL2_CF_5_BYTE_ENC = $01; + {$EXTERNALSYM SSL2_CF_8_BYTE_ENC} + SSL2_CF_8_BYTE_ENC = $02; + {$EXTERNALSYM SSL2_CHALLENGE_LENGTH} + SSL2_CHALLENGE_LENGTH = 16; + {$EXTERNALSYM SSL2_CK_DES_192_EDE3_CBC_WITH_MD5} + SSL2_CK_DES_192_EDE3_CBC_WITH_MD5 = $020700c0; + {$EXTERNALSYM SSL2_CK_DES_192_EDE3_CBC_WITH_SHA} + SSL2_CK_DES_192_EDE3_CBC_WITH_SHA = $020701c0; + {$EXTERNALSYM SSL2_CK_DES_64_CBC_WITH_MD5} + SSL2_CK_DES_64_CBC_WITH_MD5 = $02060040; + {$EXTERNALSYM SSL2_CK_DES_64_CBC_WITH_SHA} + SSL2_CK_DES_64_CBC_WITH_SHA = $02060140; + {$EXTERNALSYM SSL2_CK_DES_64_CFB64_WITH_MD5_1} + SSL2_CK_DES_64_CFB64_WITH_MD5_1 = $02ff0800; + {$EXTERNALSYM SSL2_CK_IDEA_128_CBC_WITH_MD5} + SSL2_CK_IDEA_128_CBC_WITH_MD5 = $02050080; + {$EXTERNALSYM SSL2_CK_NULL} + SSL2_CK_NULL = $02ff0810; + {$EXTERNALSYM SSL2_CK_NULL_WITH_MD5} + SSL2_CK_NULL_WITH_MD5 = $02000000; + {$EXTERNALSYM SSL2_CK_RC2_128_CBC_EXPORT40_WITH_MD5} + SSL2_CK_RC2_128_CBC_EXPORT40_WITH_MD5 = $02040080; + {$EXTERNALSYM SSL2_CK_RC2_128_CBC_WITH_MD5} + SSL2_CK_RC2_128_CBC_WITH_MD5 = $02030080; + {$EXTERNALSYM SSL2_CK_RC4_128_EXPORT40_WITH_MD5} + SSL2_CK_RC4_128_EXPORT40_WITH_MD5 = $02020080; + {$EXTERNALSYM SSL2_CK_RC4_128_WITH_MD5} + SSL2_CK_RC4_128_WITH_MD5 = $02010080; + {$EXTERNALSYM SSL2_CK_RC4_64_WITH_MD5} + SSL2_CK_RC4_64_WITH_MD5 = $02080080; + {$EXTERNALSYM SSL2_CONNECTION_ID_LENGTH} + SSL2_CONNECTION_ID_LENGTH = 16; + {$EXTERNALSYM SSL2_CT_X509_CERTIFICATE} + SSL2_CT_X509_CERTIFICATE = $01; + {$EXTERNALSYM SSL2_MAX_CERT_CHALLENGE_LENGTH} + SSL2_MAX_CERT_CHALLENGE_LENGTH = 32; + {$EXTERNALSYM SSL2_MAX_CHALLENGE_LENGTH} + SSL2_MAX_CHALLENGE_LENGTH = 32; + {$EXTERNALSYM SSL2_MAX_CONNECTION_ID_LENGTH} + SSL2_MAX_CONNECTION_ID_LENGTH = 16; + {$EXTERNALSYM SSL2_MAX_KEY_MATERIAL_LENGTH} + SSL2_MAX_KEY_MATERIAL_LENGTH = 24; + {$EXTERNALSYM SSL2_MAX_MASTER_KEY_LENGTH_IN_BITS} + SSL2_MAX_MASTER_KEY_LENGTH_IN_BITS = 256; + {$EXTERNALSYM SSL2_MAX_RECORD_LENGTH_3_BYTE_HEADER} + SSL2_MAX_RECORD_LENGTH_3_BYTE_HEADER = 16383; + {$EXTERNALSYM SSL2_MAX_SSL_SESSION_ID_LENGTH} + SSL2_MAX_SSL_SESSION_ID_LENGTH = 32; + {$EXTERNALSYM SSL2_MIN_CERT_CHALLENGE_LENGTH} + SSL2_MIN_CERT_CHALLENGE_LENGTH = 16; + {$EXTERNALSYM SSL2_MIN_CHALLENGE_LENGTH} + SSL2_MIN_CHALLENGE_LENGTH = 16; + {$EXTERNALSYM SSL2_MT_CLIENT_CERTIFICATE} + SSL2_MT_CLIENT_CERTIFICATE = 8; + {$EXTERNALSYM SSL2_MT_CLIENT_FINISHED} + SSL2_MT_CLIENT_FINISHED = 3; + {$EXTERNALSYM SSL2_MT_CLIENT_HELLO} + SSL2_MT_CLIENT_HELLO = 1; + {$EXTERNALSYM SSL2_MT_CLIENT_MASTER_KEY} + SSL2_MT_CLIENT_MASTER_KEY = 2; + {$EXTERNALSYM SSL2_MT_ERROR} + SSL2_MT_ERROR = 0; + {$EXTERNALSYM SSL2_MT_REQUEST_CERTIFICATE} + SSL2_MT_REQUEST_CERTIFICATE = 7; + {$EXTERNALSYM SSL2_MT_SERVER_FINISHED} + SSL2_MT_SERVER_FINISHED = 6; + {$EXTERNALSYM SSL2_MT_SERVER_HELLO} + SSL2_MT_SERVER_HELLO = 4; + {$EXTERNALSYM SSL2_MT_SERVER_VERIFY} + SSL2_MT_SERVER_VERIFY = 5; + {$EXTERNALSYM SSL2_PE_BAD_CERTIFICATE} + SSL2_PE_BAD_CERTIFICATE = $0004; + {$EXTERNALSYM SSL2_PE_NO_CERTIFICATE} + SSL2_PE_NO_CERTIFICATE = $0002; + {$EXTERNALSYM SSL2_PE_NO_CIPHER} + SSL2_PE_NO_CIPHER = $0001; + {$EXTERNALSYM SSL2_PE_UNDEFINED_ERROR} + SSL2_PE_UNDEFINED_ERROR = $0000; + {$EXTERNALSYM SSL2_PE_UNSUPPORTED_CERTIFICATE_TYPE} + SSL2_PE_UNSUPPORTED_CERTIFICATE_TYPE = $0006; + {$EXTERNALSYM SSL2_SSL_SESSION_ID_LENGTH} + SSL2_SSL_SESSION_ID_LENGTH = 16; + {$EXTERNALSYM SSL2_ST_CLIENT_START_ENCRYPTION} + SSL2_ST_CLIENT_START_ENCRYPTION = $80 or SSL_ST_CONNECT; + {$EXTERNALSYM SSL2_ST_GET_CLIENT_FINISHED_A} + SSL2_ST_GET_CLIENT_FINISHED_A = $50 or SSL_ST_ACCEPT; + {$EXTERNALSYM SSL2_ST_GET_CLIENT_FINISHED_B} + SSL2_ST_GET_CLIENT_FINISHED_B = $51 or SSL_ST_ACCEPT; + {$EXTERNALSYM SSL2_ST_GET_CLIENT_HELLO_A} + SSL2_ST_GET_CLIENT_HELLO_A = $10 or SSL_ST_ACCEPT; + {$EXTERNALSYM SSL2_ST_GET_CLIENT_HELLO_B} + SSL2_ST_GET_CLIENT_HELLO_B = $11 or SSL_ST_ACCEPT; + {$EXTERNALSYM SSL2_ST_GET_CLIENT_HELLO_C} + SSL2_ST_GET_CLIENT_HELLO_C = $12 or SSL_ST_ACCEPT; + {$EXTERNALSYM SSL2_ST_GET_CLIENT_MASTER_KEY_A} + SSL2_ST_GET_CLIENT_MASTER_KEY_A = $30 or SSL_ST_ACCEPT; + {$EXTERNALSYM SSL2_ST_GET_CLIENT_MASTER_KEY_B} + SSL2_ST_GET_CLIENT_MASTER_KEY_B = $31 or SSL_ST_ACCEPT; + {$EXTERNALSYM SSL2_ST_GET_SERVER_FINISHED_A} + SSL2_ST_GET_SERVER_FINISHED_A = $70 or SSL_ST_CONNECT; + {$EXTERNALSYM SSL2_ST_GET_SERVER_FINISHED_B} + SSL2_ST_GET_SERVER_FINISHED_B = $71 or SSL_ST_CONNECT; + {$EXTERNALSYM SSL2_ST_GET_SERVER_HELLO_A} + SSL2_ST_GET_SERVER_HELLO_A = $20 or SSL_ST_CONNECT; + {$EXTERNALSYM SSL2_ST_GET_SERVER_HELLO_B} + SSL2_ST_GET_SERVER_HELLO_B = $21 or SSL_ST_CONNECT; + {$EXTERNALSYM SSL2_ST_GET_SERVER_VERIFY_A} + SSL2_ST_GET_SERVER_VERIFY_A = $60 or SSL_ST_CONNECT; + {$EXTERNALSYM SSL2_ST_GET_SERVER_VERIFY_B} + SSL2_ST_GET_SERVER_VERIFY_B = $61 or SSL_ST_CONNECT; + {$EXTERNALSYM SSL2_ST_SEND_CLIENT_CERTIFICATE_A} + SSL2_ST_SEND_CLIENT_CERTIFICATE_A = $50 or SSL_ST_CONNECT; + {$EXTERNALSYM SSL2_ST_SEND_CLIENT_CERTIFICATE_B} + SSL2_ST_SEND_CLIENT_CERTIFICATE_B = $51 or SSL_ST_CONNECT; + {$EXTERNALSYM SSL2_ST_SEND_CLIENT_CERTIFICATE_C} + SSL2_ST_SEND_CLIENT_CERTIFICATE_C = $52 or SSL_ST_CONNECT; + {$EXTERNALSYM SSL2_ST_SEND_CLIENT_CERTIFICATE_D} + SSL2_ST_SEND_CLIENT_CERTIFICATE_D = $53 or SSL_ST_CONNECT; + {$EXTERNALSYM SSL2_ST_SEND_CLIENT_FINISHED_A} + SSL2_ST_SEND_CLIENT_FINISHED_A = $40 or SSL_ST_CONNECT; + {$EXTERNALSYM SSL2_ST_SEND_CLIENT_FINISHED_B} + SSL2_ST_SEND_CLIENT_FINISHED_B = $41 or SSL_ST_CONNECT; + {$EXTERNALSYM SSL2_ST_SEND_CLIENT_HELLO_A} + SSL2_ST_SEND_CLIENT_HELLO_A = $10 or SSL_ST_CONNECT; + {$EXTERNALSYM SSL2_ST_SEND_CLIENT_HELLO_B} + SSL2_ST_SEND_CLIENT_HELLO_B = $11 or SSL_ST_CONNECT; + {$EXTERNALSYM SSL2_ST_SEND_CLIENT_MASTER_KEY_A} + SSL2_ST_SEND_CLIENT_MASTER_KEY_A = $30 or SSL_ST_CONNECT; + {$EXTERNALSYM SSL2_ST_SEND_CLIENT_MASTER_KEY_B} + SSL2_ST_SEND_CLIENT_MASTER_KEY_B = $31 or SSL_ST_CONNECT; + {$EXTERNALSYM SSL2_ST_SEND_REQUEST_CERTIFICATE_A} + SSL2_ST_SEND_REQUEST_CERTIFICATE_A = $70 or SSL_ST_ACCEPT; + {$EXTERNALSYM SSL2_ST_SEND_REQUEST_CERTIFICATE_B} + SSL2_ST_SEND_REQUEST_CERTIFICATE_B = $71 or SSL_ST_ACCEPT; + {$EXTERNALSYM SSL2_ST_SEND_REQUEST_CERTIFICATE_C} + SSL2_ST_SEND_REQUEST_CERTIFICATE_C = $72 or SSL_ST_ACCEPT; + {$EXTERNALSYM SSL2_ST_SEND_REQUEST_CERTIFICATE_D} + SSL2_ST_SEND_REQUEST_CERTIFICATE_D = $73 or SSL_ST_ACCEPT; + {$EXTERNALSYM SSL2_ST_SEND_SERVER_FINISHED_A} + SSL2_ST_SEND_SERVER_FINISHED_A = $60 or SSL_ST_ACCEPT; + {$EXTERNALSYM SSL2_ST_SEND_SERVER_FINISHED_B} + SSL2_ST_SEND_SERVER_FINISHED_B = $61 or SSL_ST_ACCEPT; + {$EXTERNALSYM SSL2_ST_SEND_SERVER_HELLO_A} + SSL2_ST_SEND_SERVER_HELLO_A = $20 or SSL_ST_ACCEPT; + {$EXTERNALSYM SSL2_ST_SEND_SERVER_HELLO_B} + SSL2_ST_SEND_SERVER_HELLO_B = $21 or SSL_ST_ACCEPT; + {$EXTERNALSYM SSL2_ST_SEND_SERVER_VERIFY_A} + SSL2_ST_SEND_SERVER_VERIFY_A = $40 or SSL_ST_ACCEPT; + {$EXTERNALSYM SSL2_ST_SEND_SERVER_VERIFY_B} + SSL2_ST_SEND_SERVER_VERIFY_B = $41 or SSL_ST_ACCEPT; + {$EXTERNALSYM SSL2_ST_SEND_SERVER_VERIFY_C} + SSL2_ST_SEND_SERVER_VERIFY_C = $42 or SSL_ST_ACCEPT; + {$EXTERNALSYM SSL2_ST_SERVER_START_ENCRYPTION} + SSL2_ST_SERVER_START_ENCRYPTION = $80 or SSL_ST_ACCEPT; + {$EXTERNALSYM SSL2_ST_X509_GET_CLIENT_CERTIFICATE} + SSL2_ST_X509_GET_CLIENT_CERTIFICATE = $90 or SSL_ST_CONNECT; + {$EXTERNALSYM SSL2_ST_X509_GET_SERVER_CERTIFICATE} + SSL2_ST_X509_GET_SERVER_CERTIFICATE = $90 or SSL_ST_ACCEPT; + {$EXTERNALSYM SSL2_TXT_DES_192_EDE3_CBC_WITH_MD5} + SSL2_TXT_DES_192_EDE3_CBC_WITH_MD5 = 'DES-CBC3-MD5'; {Do not localize} + {$EXTERNALSYM SSL2_TXT_DES_192_EDE3_CBC_WITH_SHA} + SSL2_TXT_DES_192_EDE3_CBC_WITH_SHA = 'DES-CBC3-SHA'; {Do not localize} + {$EXTERNALSYM SSL2_TXT_DES_64_CBC_WITH_MD5} + SSL2_TXT_DES_64_CBC_WITH_MD5 = 'DES-CBC-MD5'; {Do not localize} + {$EXTERNALSYM SSL2_TXT_DES_64_CBC_WITH_SHA} + SSL2_TXT_DES_64_CBC_WITH_SHA = 'DES-CBC-SHA'; {Do not localize} + {$EXTERNALSYM SSL2_TXT_DES_64_CFB64_WITH_MD5_1} + SSL2_TXT_DES_64_CFB64_WITH_MD5_1 = 'DES-CFB-M1'; {Do not localize} + {$EXTERNALSYM SSL2_TXT_IDEA_128_CBC_WITH_MD5} + SSL2_TXT_IDEA_128_CBC_WITH_MD5 = 'IDEA-CBC-MD5'; {Do not localize} + {$EXTERNALSYM SSL2_TXT_NULL} + SSL2_TXT_NULL = 'NULL'; {Do not localize} + {$EXTERNALSYM SSL2_TXT_NULL_WITH_MD5} + SSL2_TXT_NULL_WITH_MD5 = 'NULL-MD5'; {Do not localize} + {$EXTERNALSYM SSL2_TXT_RC2_128_CBC_EXPORT40_WITH_MD5} + SSL2_TXT_RC2_128_CBC_EXPORT40_WITH_MD5 = 'EXP-RC2-CBC-MD5'; {Do not localize} + {$EXTERNALSYM SSL2_TXT_RC2_128_CBC_WITH_MD5} + SSL2_TXT_RC2_128_CBC_WITH_MD5 = 'RC2-CBC-MD5'; {Do not localize} + {$EXTERNALSYM SSL2_TXT_RC4_128_EXPORT40_WITH_MD5} + SSL2_TXT_RC4_128_EXPORT40_WITH_MD5 = 'EXP-RC4-MD5'; {Do not localize} + {$EXTERNALSYM SSL2_TXT_RC4_128_WITH_MD5} + SSL2_TXT_RC4_128_WITH_MD5 = 'RC4-MD5'; {Do not localize} + {$EXTERNALSYM SSL2_TXT_RC4_64_WITH_MD5} + SSL2_TXT_RC4_64_WITH_MD5 = 'RC4-64-MD5'; {Do not localize} + {$EXTERNALSYM SSL2_VERSION} + SSL2_VERSION = $0002; + {$EXTERNALSYM SSL2_VERSION_MAJOR} + SSL2_VERSION_MAJOR = $00; + {$EXTERNALSYM SSL2_VERSION_MINOR} + SSL2_VERSION_MINOR = $02; + {$EXTERNALSYM SSL3_AD_BAD_CERTIFICATE} + SSL3_AD_BAD_CERTIFICATE = 42; + {$EXTERNALSYM SSL3_AD_BAD_RECORD_MAC} + SSL3_AD_BAD_RECORD_MAC = 20; + {$EXTERNALSYM SSL3_AD_CERTIFICATE_EXPIRED} + SSL3_AD_CERTIFICATE_EXPIRED = 45; + {$EXTERNALSYM SSL3_AD_CERTIFICATE_REVOKED} + SSL3_AD_CERTIFICATE_REVOKED = 44; + {$EXTERNALSYM SSL3_AD_CERTIFICATE_UNKNOWN} + SSL3_AD_CERTIFICATE_UNKNOWN = 46; + {$EXTERNALSYM SSL3_AD_CLOSE_NOTIFY} + SSL3_AD_CLOSE_NOTIFY = 0; + {$EXTERNALSYM SSL3_AD_DECOMPRESSION_FAILURE} + SSL3_AD_DECOMPRESSION_FAILURE = 30; + {$EXTERNALSYM SSL3_AD_HANDSHAKE_FAILURE} + SSL3_AD_HANDSHAKE_FAILURE = 40; + {$EXTERNALSYM SSL3_AD_ILLEGAL_PARAMETER} + SSL3_AD_ILLEGAL_PARAMETER = 47; + {$EXTERNALSYM TLS1_HB_REQUEST} + TLS1_HB_REQUEST = 1; + {$EXTERNALSYM TLS1_HB_RESPONSE} + TLS1_HB_RESPONSE = 2; + {$EXTERNALSYM SSL3_AD_NO_CERTIFICATE} + SSL3_AD_NO_CERTIFICATE = 41; + {$EXTERNALSYM SSL3_AD_UNEXPECTED_MESSAGE} + SSL3_AD_UNEXPECTED_MESSAGE = 10; + {$EXTERNALSYM SSL3_AD_UNSUPPORTED_CERTIFICATE} + SSL3_AD_UNSUPPORTED_CERTIFICATE = 43; + {$EXTERNALSYM SSL3_AL_FATAL} + SSL3_AL_FATAL = 2; + {$EXTERNALSYM SSL3_AL_WARNING} + SSL3_AL_WARNING = 1; + {$EXTERNALSYM SSL3_CC_CLIENT} + SSL3_CC_CLIENT = $10; + {$EXTERNALSYM SSL3_CC_READ} + SSL3_CC_READ = $01; + {$EXTERNALSYM SSL3_CC_SERVER} + SSL3_CC_SERVER = $20; + {$EXTERNALSYM SSL3_CC_WRITE} + SSL3_CC_WRITE = $02; + {$EXTERNALSYM SSL3_CHANGE_CIPHER_CLIENT_READ} + SSL3_CHANGE_CIPHER_CLIENT_READ = SSL3_CC_CLIENT or SSL3_CC_READ; + {$EXTERNALSYM SSL3_CHANGE_CIPHER_CLIENT_WRITE} + SSL3_CHANGE_CIPHER_CLIENT_WRITE = SSL3_CC_CLIENT or SSL3_CC_WRITE; + {$EXTERNALSYM SSL3_CHANGE_CIPHER_SERVER_READ} + SSL3_CHANGE_CIPHER_SERVER_READ = SSL3_CC_SERVER or SSL3_CC_READ; + {$EXTERNALSYM SSL3_CHANGE_CIPHER_SERVER_WRITE} + SSL3_CHANGE_CIPHER_SERVER_WRITE = SSL3_CC_SERVER or SSL3_CC_WRITE; + {$EXTERNALSYM SSL3_CK_ADH_DES_192_CBC_SHA} + SSL3_CK_ADH_DES_192_CBC_SHA = $0300001B; + {$EXTERNALSYM SSL3_CK_ADH_DES_40_CBC_SHA} + SSL3_CK_ADH_DES_40_CBC_SHA = $03000019; + {$EXTERNALSYM SSL3_CK_ADH_DES_64_CBC_SHA} + SSL3_CK_ADH_DES_64_CBC_SHA = $0300001A; + {$EXTERNALSYM SSL3_CK_ADH_RC4_128_MD5} + SSL3_CK_ADH_RC4_128_MD5 = $03000018; + {$EXTERNALSYM SSL3_CK_ADH_RC4_40_MD5} + SSL3_CK_ADH_RC4_40_MD5 = $03000017; + {$EXTERNALSYM SSL3_CK_DH_DSS_DES_192_CBC3_SHA} + SSL3_CK_DH_DSS_DES_192_CBC3_SHA = $0300000D; + {$EXTERNALSYM SSL3_CK_DH_DSS_DES_40_CBC_SHA} + SSL3_CK_DH_DSS_DES_40_CBC_SHA = $0300000B; + {$EXTERNALSYM SSL3_CK_DH_DSS_DES_64_CBC_SHA} + SSL3_CK_DH_DSS_DES_64_CBC_SHA = $0300000C; + {$EXTERNALSYM SSL3_CK_DH_RSA_DES_192_CBC3_SHA} + SSL3_CK_DH_RSA_DES_192_CBC3_SHA = $03000010; + {$EXTERNALSYM SSL3_CK_DH_RSA_DES_40_CBC_SHA} + SSL3_CK_DH_RSA_DES_40_CBC_SHA = $0300000E; + {$EXTERNALSYM SSL3_CK_DH_RSA_DES_64_CBC_SHA} + SSL3_CK_DH_RSA_DES_64_CBC_SHA = $0300000F; + {$EXTERNALSYM SSL3_CK_EDH_DSS_DES_192_CBC3_SHA} + SSL3_CK_EDH_DSS_DES_192_CBC3_SHA = $03000013; + {$EXTERNALSYM SSL3_CK_EDH_DSS_DES_40_CBC_SHA} + SSL3_CK_EDH_DSS_DES_40_CBC_SHA = $03000011; + {$EXTERNALSYM SSL3_CK_EDH_DSS_DES_64_CBC_SHA} + SSL3_CK_EDH_DSS_DES_64_CBC_SHA = $03000012; + {$EXTERNALSYM SSL3_CK_EDH_RSA_DES_192_CBC3_SHA} + SSL3_CK_EDH_RSA_DES_192_CBC3_SHA = $03000016; + {$EXTERNALSYM SSL3_CK_EDH_RSA_DES_40_CBC_SHA} + SSL3_CK_EDH_RSA_DES_40_CBC_SHA = $03000014; + {$EXTERNALSYM SSL3_CK_EDH_RSA_DES_64_CBC_SHA} + SSL3_CK_EDH_RSA_DES_64_CBC_SHA = $03000015; + {$EXTERNALSYM SSL3_CK_FZA_DMS_FZA_SHA} + SSL3_CK_FZA_DMS_FZA_SHA = $0300001D; + {$EXTERNALSYM SSL3_CK_FZA_DMS_NULL_SHA} + SSL3_CK_FZA_DMS_NULL_SHA = $0300001C; + {$EXTERNALSYM SSL3_CK_FZA_DMS_RC4_SHA} + SSL3_CK_FZA_DMS_RC4_SHA = $0300001E; + {$EXTERNALSYM SSL3_CK_RSA_DES_192_CBC3_SHA} + SSL3_CK_RSA_DES_192_CBC3_SHA = $0300000A; + {$EXTERNALSYM SSL3_CK_RSA_DES_40_CBC_SHA} + SSL3_CK_RSA_DES_40_CBC_SHA = $03000008; + {$EXTERNALSYM SSL3_CK_RSA_DES_64_CBC_SHA} + SSL3_CK_RSA_DES_64_CBC_SHA = $03000009; + {$EXTERNALSYM SSL3_CK_RSA_IDEA_128_SHA} + SSL3_CK_RSA_IDEA_128_SHA = $03000007; + //* Signalling cipher suite value: from draft-ietf-tls-renegotiation-03.txt */ + {$EXTERNALSYM SSL3_CK_SCSV} + SSL3_CK_SCSV = $030000FF; + + {$EXTERNALSYM SSL3_CK_RSA_NULL_MD5} + SSL3_CK_RSA_NULL_MD5 = $03000001; + {$EXTERNALSYM SSL3_CK_RSA_NULL_SHA} + SSL3_CK_RSA_NULL_SHA = $03000002; + {$EXTERNALSYM SSL3_CK_RSA_RC2_40_MD5} + SSL3_CK_RSA_RC2_40_MD5 = $03000006; + {$EXTERNALSYM SSL3_CK_RSA_RC4_128_MD5} + SSL3_CK_RSA_RC4_128_MD5 = $03000004; + {$EXTERNALSYM SSL3_CK_RSA_RC4_128_SHA} + SSL3_CK_RSA_RC4_128_SHA = $03000005; + {$EXTERNALSYM SSL3_CK_RSA_RC4_40_MD5} + SSL3_CK_RSA_RC4_40_MD5 = $03000003; + + {$EXTERNALSYM SSL3_CT_RSA_SIGN} + SSL3_CT_RSA_SIGN = 1; + {$EXTERNALSYM SSL3_CT_DSS_SIGN} + SSL3_CT_DSS_SIGN = 2; + {$EXTERNALSYM SSL3_CT_RSA_FIXED_DH} + SSL3_CT_RSA_FIXED_DH = 3; + {$EXTERNALSYM SSL3_CT_DSS_FIXED_DH} + SSL3_CT_DSS_FIXED_DH = 4; + {$EXTERNALSYM SSL3_CT_RSA_EPHEMERAL_DH} + SSL3_CT_RSA_EPHEMERAL_DH = 5; + {$EXTERNALSYM SSL3_CT_DSS_EPHEMERAL_DH} + SSL3_CT_DSS_EPHEMERAL_DH = 6; + + {$EXTERNALSYM SSL3_CT_FORTEZZA_DMS} + SSL3_CT_FORTEZZA_DMS = 20; + {$EXTERNALSYM SSL3_CT_NUMBER} + SSL3_CT_NUMBER = 9; //was 7; + + {$EXTERNALSYM SSL3_FLAGS_DELAY_CLIENT_FINISHED} + SSL3_FLAGS_DELAY_CLIENT_FINISHED = $0002; + {$EXTERNALSYM SSL3_FLAGS_NO_RENEGOTIATE_CIPHERS} + SSL3_FLAGS_NO_RENEGOTIATE_CIPHERS = $0001; + {$EXTERNALSYM SSL3_FLAGS_POP_BUFFER} + SSL3_FLAGS_POP_BUFFER = $0004; + {$EXTERNALSYM TLS1_FLAGS_TLS_PADDING_BUG} + TLS1_FLAGS_TLS_PADDING_BUG = $0008; + {$EXTERNALSYM TLS1_FLAGS_SKIP_CERT_VERIFY} + TLS1_FLAGS_SKIP_CERT_VERIFY = $0010; + {$EXTERNALSYM TLS1_FLAGS_KEEP_HANDSHAKE} + TLS1_FLAGS_KEEP_HANDSHAKE = $0020; + + {* SSL3_FLAGS_SGC_RESTART_DONE is set when we + * restart a handshake because of MS SGC and so prevents us + * from restarting the handshake in a loop. It's reset on a + * renegotiation, so effectively limits the client to one restart + * per negotiation. This limits the possibility of a DDoS + * attack where the client handshakes in a loop using SGC to + * restart. Servers which permit renegotiation can still be + * effected, but we can't prevent that. + *} + {$EXTERNALSYM SSL3_FLAGS_SGC_RESTART_DONE} + SSL3_FLAGS_SGC_RESTART_DONE = $0040; + + {$EXTERNALSYM SSL3_MASTER_SECRET_SIZE} + SSL3_MASTER_SECRET_SIZE = 48; + {$EXTERNALSYM SSL3_MAX_SSL_SESSION_ID_LENGTH} + SSL3_MAX_SSL_SESSION_ID_LENGTH = 32; + {$EXTERNALSYM SSL3_MT_HELLO_REQUEST} + SSL3_MT_HELLO_REQUEST = 0; + {$EXTERNALSYM SSL3_MT_CLIENT_REQUEST} + SSL3_MT_CLIENT_REQUEST = 0; + {$EXTERNALSYM SSL3_MT_CLIENT_HELLO} + SSL3_MT_CLIENT_HELLO = 1; + {$EXTERNALSYM SSL3_MT_SERVER_HELLO} + SSL3_MT_SERVER_HELLO = 2; + {$EXTERNALSYM SSL3_MT_NEWSESSION_TICKET} + SSL3_MT_NEWSESSION_TICKET = 4; + {$EXTERNALSYM SSL3_MT_CERTIFICATE} + SSL3_MT_CERTIFICATE = 11; + {$EXTERNALSYM SSL3_MT_SERVER_KEY_EXCHANGE} + SSL3_MT_SERVER_KEY_EXCHANGE = 12; + {$EXTERNALSYM SSL3_MT_CERTIFICATE_REQUEST} + SSL3_MT_CERTIFICATE_REQUEST = 13; + {$EXTERNALSYM SSL3_MT_SERVER_DONE} + SSL3_MT_SERVER_DONE = 14; + {$EXTERNALSYM SSL3_MT_CERTIFICATE_VERIFY} + SSL3_MT_CERTIFICATE_VERIFY = 15; + {$EXTERNALSYM SSL3_MT_CLIENT_KEY_EXCHANGE} + SSL3_MT_CLIENT_KEY_EXCHANGE = 16; + {$EXTERNALSYM SSL3_MT_FINISHED} + SSL3_MT_FINISHED = 20; + {$EXTERNALSYM SSL3_MT_CERTIFICATE_STATUS} + SSL3_MT_CERTIFICATE_STATUS = 22; + {$EXTERNALSYM SSL3_MT_NEXT_PROTO} + SSL3_MT_NEXT_PROTO = 67; + {$EXTERNALSYM DTLS1_MT_HELLO_VERIFY_REQUEST} + DTLS1_MT_HELLO_VERIFY_REQUEST = 3; + {$EXTERNALSYM SSL3_MT_CCS} + SSL3_MT_CCS = 1; + {$EXTERNALSYM SSL3_RANDOM_SIZE} + SSL3_RANDOM_SIZE = 32; + {$EXTERNALSYM SSL3_RS_BLANK} + SSL3_RS_BLANK = 1; + {$EXTERNALSYM SSL3_RS_ENCODED} + SSL3_RS_ENCODED = 2; + {$EXTERNALSYM SSL3_RS_PART_READ} + SSL3_RS_PART_READ = 4; + {$EXTERNALSYM SSL3_RS_PART_WRITE} + SSL3_RS_PART_WRITE = 5; + {$EXTERNALSYM SSL3_RS_PLAIN} + SSL3_RS_PLAIN = 3; + {$EXTERNALSYM SSL3_RS_READ_MORE} + SSL3_RS_READ_MORE = 3; + {$EXTERNALSYM SSL3_RT_ALERT} + SSL3_RT_ALERT = 21; + {$EXTERNALSYM SSL3_RT_APPLICATION_DATA} + SSL3_RT_APPLICATION_DATA = 23; + {$EXTERNALSYM TLS1_RT_HEARTBEAT} + TLS1_RT_HEARTBEAT = 24; + {$EXTERNALSYM SSL3_RT_CHANGE_CIPHER_SPEC} + SSL3_RT_CHANGE_CIPHER_SPEC = 20; + {$EXTERNALSYM SSL3_RT_HANDSHAKE} + SSL3_RT_HANDSHAKE = 22; + {$EXTERNALSYM SSL3_RT_HEADER_LENGTH} + SSL3_RT_HEADER_LENGTH = 5; + {$EXTERNALSYM SSL3_RT_MAX_MD_SIZE} + SSL3_RT_MAX_MD_SIZE = 64; + {$EXTERNALSYM SSL_RT_MAX_CIPHER_BLOCK_SIZE} + SSL_RT_MAX_CIPHER_BLOCK_SIZE = 16; + {$EXTERNALSYM SSL3_RT_MAX_EXTRA} + SSL3_RT_MAX_EXTRA = (16384); + + {$EXTERNALSYM SSL3_RT_MAX_PLAIN_LENGTH} + SSL3_RT_MAX_PLAIN_LENGTH = 16384; + {$EXTERNALSYM SSL3_RT_MAX_COMPRESSED_OVERHEAD} + SSL3_RT_MAX_COMPRESSED_OVERHEAD = 1024; + {$EXTERNALSYM SSL3_RT_MAX_ENCRYPTED_OVERHEAD} + SSL3_RT_MAX_ENCRYPTED_OVERHEAD = (256 + SSL3_RT_MAX_MD_SIZE); + {$EXTERNALSYM SSL3_RT_SEND_MAX_ENCRYPTED_OVERHEAD} + SSL3_RT_SEND_MAX_ENCRYPTED_OVERHEAD = (SSL_RT_MAX_CIPHER_BLOCK_SIZE + SSL3_RT_MAX_MD_SIZE); + {$EXTERNALSYM SSL3_RT_MAX_COMPRESSED_LENGTH} +{$ifdef OPENSSL_NO_COMP} + SSL3_RT_MAX_COMPRESSED_LENGTH = SSL3_RT_MAX_PLAIN_LENGTH; +{$else} + SSL3_RT_MAX_COMPRESSED_LENGTH = + (SSL3_RT_MAX_PLAIN_LENGTH+SSL3_RT_MAX_COMPRESSED_OVERHEAD); +{$endif} + {$EXTERNALSYM SSL3_RT_MAX_ENCRYPTED_LENGTH} + SSL3_RT_MAX_ENCRYPTED_LENGTH = + (SSL3_RT_MAX_ENCRYPTED_OVERHEAD+SSL3_RT_MAX_COMPRESSED_LENGTH); + {$EXTERNALSYM SSL3_RT_MAX_PACKET_SIZE} + SSL3_RT_MAX_PACKET_SIZE = + (SSL3_RT_MAX_ENCRYPTED_LENGTH+SSL3_RT_HEADER_LENGTH); + + {$EXTERNALSYM SSL3_RT_MAX_DATA_SIZE} + SSL3_RT_MAX_DATA_SIZE = 1024*1024; + + {$EXTERNALSYM SSL3_SESSION_ID_SIZE} + SSL3_SESSION_ID_SIZE = 32; + {$EXTERNALSYM SSL3_SSL_SESSION_ID_LENGTH} + SSL3_SSL_SESSION_ID_LENGTH = 32; + {$EXTERNALSYM SSL3_ST_CR_CERT_A} + SSL3_ST_CR_CERT_A = $130 or SSL_ST_CONNECT; + {$EXTERNALSYM SSL3_ST_CR_CERT_B} + SSL3_ST_CR_CERT_B = $131 or SSL_ST_CONNECT; + {$EXTERNALSYM SSL3_ST_CR_CERT_REQ_A} + SSL3_ST_CR_CERT_REQ_A = $150 or SSL_ST_CONNECT; + {$EXTERNALSYM SSL3_ST_CR_CERT_REQ_B} + SSL3_ST_CR_CERT_REQ_B = $151 or SSL_ST_CONNECT; + {$EXTERNALSYM SSL3_ST_CR_CHANGE_A} + SSL3_ST_CR_CHANGE_A = $1C0 or SSL_ST_CONNECT; + {$EXTERNALSYM SSL3_ST_CR_CHANGE_B} + SSL3_ST_CR_CHANGE_B = $1C1 or SSL_ST_CONNECT; + {$EXTERNALSYM SSL3_ST_CR_FINISHED_A} + SSL3_ST_CR_FINISHED_A = $1D0 or SSL_ST_CONNECT; + {$EXTERNALSYM SSL3_ST_CR_FINISHED_B} + SSL3_ST_CR_FINISHED_B = $1D1 or SSL_ST_CONNECT; + {$EXTERNALSYM SSL3_ST_CR_SESSION_TICKET_A} + SSL3_ST_CR_SESSION_TICKET_A = ($1E0 or SSL_ST_CONNECT); + {$EXTERNALSYM SSL3_ST_CR_SESSION_TICKET_B} + SSL3_ST_CR_SESSION_TICKET_B = ($1E1 or SSL_ST_CONNECT); + {$EXTERNALSYM SSL3_ST_CR_CERT_STATUS_A} + SSL3_ST_CR_CERT_STATUS_A = ($1F0 or SSL_ST_CONNECT); + {$EXTERNALSYM SSL3_ST_CR_CERT_STATUS_B} + SSL3_ST_CR_CERT_STATUS_B = ($1F1 or SSL_ST_CONNECT); + {$EXTERNALSYM SSL3_ST_CR_KEY_EXCH_A} + SSL3_ST_CR_KEY_EXCH_A = $140 or SSL_ST_CONNECT; + {$EXTERNALSYM SSL3_ST_CR_KEY_EXCH_B} + SSL3_ST_CR_KEY_EXCH_B = $141 or SSL_ST_CONNECT; + {$EXTERNALSYM SSL3_ST_CR_SRVR_DONE_A} + SSL3_ST_CR_SRVR_DONE_A = $160 or SSL_ST_CONNECT; + {$EXTERNALSYM SSL3_ST_CR_SRVR_DONE_B} + SSL3_ST_CR_SRVR_DONE_B = $161 or SSL_ST_CONNECT; + {$EXTERNALSYM SSL3_ST_CR_SRVR_HELLO_A} + SSL3_ST_CR_SRVR_HELLO_A = $120 or SSL_ST_CONNECT; + {$EXTERNALSYM SSL3_ST_CR_SRVR_HELLO_B} + SSL3_ST_CR_SRVR_HELLO_B = $121 or SSL_ST_CONNECT; + {$EXTERNALSYM SSL3_ST_CW_CERT_A} + SSL3_ST_CW_CERT_A = $170 or SSL_ST_CONNECT; + {$EXTERNALSYM SSL3_ST_CW_CERT_B} + SSL3_ST_CW_CERT_B = $171 or SSL_ST_CONNECT; + {$EXTERNALSYM SSL3_ST_CW_CERT_C} + SSL3_ST_CW_CERT_C = $172 or SSL_ST_CONNECT; + {$EXTERNALSYM SSL3_ST_CW_CERT_D} + SSL3_ST_CW_CERT_D = $173 or SSL_ST_CONNECT; + {$EXTERNALSYM SSL3_ST_CW_CERT_VRFY_A} + SSL3_ST_CW_CERT_VRFY_A = $190 or SSL_ST_CONNECT; + {$EXTERNALSYM SSL3_ST_CW_CERT_VRFY_B} + SSL3_ST_CW_CERT_VRFY_B = $191 or SSL_ST_CONNECT; + {$EXTERNALSYM SSL3_ST_CW_CHANGE_A} + SSL3_ST_CW_CHANGE_A = $1A0 or SSL_ST_CONNECT; + {$EXTERNALSYM SSL3_ST_CW_CHANGE_B} + SSL3_ST_CW_CHANGE_B = $1A1 or SSL_ST_CONNECT; + {$EXTERNALSYM SSL3_ST_CW_NEXT_PROTO_A} + SSL3_ST_CW_NEXT_PROTO_A = ($200 or SSL_ST_CONNECT); + {$EXTERNALSYM SSL3_ST_CW_NEXT_PROTO_B} + SSL3_ST_CW_NEXT_PROTO_B = ($201 or SSL_ST_CONNECT); + +{$ifndef OPENSSL_NO_SCTP} + {$EXTERNALSYM DTLS1_SCTP_ST_CW_WRITE_SOCK} + DTLS1_SCTP_ST_CW_WRITE_SOCK = $310 or SSL_ST_CONNECT; + {$EXTERNALSYM DTLS1_SCTP_ST_CR_READ_SOCK} + DTLS1_SCTP_ST_CR_READ_SOCK = $320 or SSL_ST_CONNECT; +{$endif} + {$EXTERNALSYM SSL3_ST_CW_CLNT_HELLO_A} + SSL3_ST_CW_CLNT_HELLO_A = $110 or SSL_ST_CONNECT; + {$EXTERNALSYM SSL3_ST_CW_CLNT_HELLO_B} + SSL3_ST_CW_CLNT_HELLO_B = $111 or SSL_ST_CONNECT; + {$EXTERNALSYM SSL3_ST_CW_FINISHED_A} + SSL3_ST_CW_FINISHED_A = $1B0 or SSL_ST_CONNECT; + {$EXTERNALSYM SSL3_ST_CW_FINISHED_B} + SSL3_ST_CW_FINISHED_B = $1B1 or SSL_ST_CONNECT; + {$EXTERNALSYM SSL3_ST_CW_FLUSH} + SSL3_ST_CW_FLUSH = $100 or SSL_ST_CONNECT; + {$EXTERNALSYM SSL3_ST_CW_KEY_EXCH_A} + SSL3_ST_CW_KEY_EXCH_A = $180 or SSL_ST_CONNECT; + {$EXTERNALSYM SSL3_ST_CW_KEY_EXCH_B} + SSL3_ST_CW_KEY_EXCH_B = $181 or SSL_ST_CONNECT; + {$EXTERNALSYM SSL3_ST_SR_CERT_A} + SSL3_ST_SR_CERT_A = $180 or SSL_ST_ACCEPT; + {$EXTERNALSYM SSL3_ST_SR_CERT_B} + SSL3_ST_SR_CERT_B = $181 or SSL_ST_ACCEPT; + {$EXTERNALSYM SSL3_ST_SR_CERT_VRFY_A} + SSL3_ST_SR_CERT_VRFY_A = $1A0 or SSL_ST_ACCEPT; + {$EXTERNALSYM SSL3_ST_SR_CERT_VRFY_B} + SSL3_ST_SR_CERT_VRFY_B = $1A1 or SSL_ST_ACCEPT; + {$EXTERNALSYM SSL3_ST_SR_CHANGE_A} + SSL3_ST_SR_CHANGE_A = $1B0 or SSL_ST_ACCEPT; + {$EXTERNALSYM SSL3_ST_SR_CHANGE_B} + SSL3_ST_SR_CHANGE_B = $1B1 or SSL_ST_ACCEPT; + {$EXTERNALSYM SSL3_ST_SR_NEXT_PROTO_A} + SSL3_ST_SR_NEXT_PROTO_A = ($210 or SSL_ST_ACCEPT); + {$EXTERNALSYM SSL3_ST_SR_NEXT_PROTO_B} + SSL3_ST_SR_NEXT_PROTO_B = ($211 or SSL_ST_ACCEPT); + {$EXTERNALSYM SSL3_ST_SR_CLNT_HELLO_A} + SSL3_ST_SR_CLNT_HELLO_A = $110 or SSL_ST_ACCEPT; + {$EXTERNALSYM SSL3_ST_SR_CLNT_HELLO_B} + SSL3_ST_SR_CLNT_HELLO_B = $111 or SSL_ST_ACCEPT; + {$EXTERNALSYM SSL3_ST_SR_CLNT_HELLO_C} + SSL3_ST_SR_CLNT_HELLO_C = $112 or SSL_ST_ACCEPT; + {$EXTERNALSYM SSL3_ST_SR_FINISHED_A} + SSL3_ST_SR_FINISHED_A = $1C0 or SSL_ST_ACCEPT; + {$EXTERNALSYM SSL3_ST_SR_FINISHED_B} + SSL3_ST_SR_FINISHED_B = $1C1 or SSL_ST_ACCEPT; + {$EXTERNALSYM SSL3_ST_SR_KEY_EXCH_A} + SSL3_ST_SR_KEY_EXCH_A = $190 or SSL_ST_ACCEPT; + {$EXTERNALSYM SSL3_ST_SR_KEY_EXCH_B} + SSL3_ST_SR_KEY_EXCH_B = $191 or SSL_ST_ACCEPT; + {$EXTERNALSYM SSL3_ST_SW_CERT_A} + SSL3_ST_SW_CERT_A = $140 or SSL_ST_ACCEPT; + {$EXTERNALSYM SSL3_ST_SW_CERT_B} + SSL3_ST_SW_CERT_B = $141 or SSL_ST_ACCEPT; + {$EXTERNALSYM SSL3_ST_SW_CERT_REQ_A} + SSL3_ST_SW_CERT_REQ_A = $160 or SSL_ST_ACCEPT; + {$EXTERNALSYM SSL3_ST_SW_CERT_REQ_B} + SSL3_ST_SW_CERT_REQ_B = $161 or SSL_ST_ACCEPT; + {$EXTERNALSYM SSL3_ST_SW_CHANGE_A} + SSL3_ST_SW_CHANGE_A = $1D0 or SSL_ST_ACCEPT; + {$EXTERNALSYM SSL3_ST_SW_CHANGE_B} + SSL3_ST_SW_CHANGE_B = $1D1 or SSL_ST_ACCEPT; + {$EXTERNALSYM SSL3_ST_SW_FINISHED_A} + SSL3_ST_SW_FINISHED_A = $1E0 or SSL_ST_ACCEPT; + {$EXTERNALSYM SSL3_ST_SW_FINISHED_B} + SSL3_ST_SW_FINISHED_B = $1E1 or SSL_ST_ACCEPT; + {$EXTERNALSYM SSL3_ST_SW_SESSION_TICKET_A} + SSL3_ST_SW_SESSION_TICKET_A = ($1F0 or SSL_ST_ACCEPT); + {$EXTERNALSYM SSL3_ST_SW_SESSION_TICKET_B} + SSL3_ST_SW_SESSION_TICKET_B = ($1F1 or SSL_ST_ACCEPT); + {$EXTERNALSYM SSL3_ST_SW_CERT_STATUS_A} + SSL3_ST_SW_CERT_STATUS_A = ($200 or SSL_ST_ACCEPT); + {$EXTERNALSYM SSL3_ST_SW_CERT_STATUS_B} + SSL3_ST_SW_CERT_STATUS_B = ($201 or SSL_ST_ACCEPT); + {$EXTERNALSYM SSL3_ST_SW_FLUSH} + SSL3_ST_SW_FLUSH = $100 or SSL_ST_ACCEPT; +{$ifndef OPENSSL_NO_SCTP} + {$EXTERNALSYM DTLS1_SCTP_ST_SW_WRITE_SOCK} + DTLS1_SCTP_ST_SW_WRITE_SOCK = ($310 or SSL_ST_ACCEPT); + {$EXTERNALSYM DTLS1_SCTP_ST_SR_READ_SOCK} + DTLS1_SCTP_ST_SR_READ_SOCK = ($320 or SSL_ST_ACCEPT); +{$endif} + {$EXTERNALSYM SSL3_ST_SW_HELLO_REQ_A} + SSL3_ST_SW_HELLO_REQ_A = $120 or SSL_ST_ACCEPT; + {$EXTERNALSYM SSL3_ST_SW_HELLO_REQ_B} + SSL3_ST_SW_HELLO_REQ_B = $121 or SSL_ST_ACCEPT; + {$EXTERNALSYM SSL3_ST_SW_HELLO_REQ_C} + SSL3_ST_SW_HELLO_REQ_C = $122 or SSL_ST_ACCEPT; + {$EXTERNALSYM SSL3_ST_SW_KEY_EXCH_A} + SSL3_ST_SW_KEY_EXCH_A = $150 or SSL_ST_ACCEPT; + {$EXTERNALSYM SSL3_ST_SW_KEY_EXCH_B} + SSL3_ST_SW_KEY_EXCH_B = $151 or SSL_ST_ACCEPT; + {$EXTERNALSYM SSL3_ST_SW_SRVR_DONE_A} + SSL3_ST_SW_SRVR_DONE_A = $170 or SSL_ST_ACCEPT; + {$EXTERNALSYM SSL3_ST_SW_SRVR_DONE_B} + SSL3_ST_SW_SRVR_DONE_B = $171 or SSL_ST_ACCEPT; + {$EXTERNALSYM SSL3_ST_SW_SRVR_HELLO_A} + SSL3_ST_SW_SRVR_HELLO_A = $130 or SSL_ST_ACCEPT; + {$EXTERNALSYM SSL3_ST_SW_SRVR_HELLO_B} + SSL3_ST_SW_SRVR_HELLO_B = $131 or SSL_ST_ACCEPT; + {$EXTERNALSYM SSL3_TXT_ADH_DES_192_CBC_SHA} + SSL3_TXT_ADH_DES_192_CBC_SHA = 'ADH-DES-CBC3-SHA'; {Do not localize} + {$EXTERNALSYM SSL3_TXT_ADH_DES_40_CBC_SHA} + SSL3_TXT_ADH_DES_40_CBC_SHA = 'EXP-ADH-DES-CBC-SHA'; {Do not localize} + {$EXTERNALSYM SSL3_TXT_ADH_DES_64_CBC_SHA} + SSL3_TXT_ADH_DES_64_CBC_SHA = 'ADH-DES-CBC-SHA'; {Do not localize} + {$EXTERNALSYM SSL3_TXT_ADH_RC4_128_MD5} + SSL3_TXT_ADH_RC4_128_MD5 = 'ADH-RC4-MD5'; {Do not localize} + {$EXTERNALSYM SSL3_TXT_ADH_RC4_40_MD5} + SSL3_TXT_ADH_RC4_40_MD5 = 'EXP-ADH-RC4-MD5'; {Do not localize} + {$EXTERNALSYM SSL3_TXT_DH_DSS_DES_192_CBC3_SHA} + SSL3_TXT_DH_DSS_DES_192_CBC3_SHA = 'DH-DSS-DES-CBC3-SHA'; {Do not localize} + {$EXTERNALSYM SSL3_TXT_DH_DSS_DES_40_CBC_SHA} + SSL3_TXT_DH_DSS_DES_40_CBC_SHA = 'EXP-DH-DSS-DES-CBC-SHA'; {Do not localize} + {$EXTERNALSYM SSL3_TXT_DH_DSS_DES_64_CBC_SHA} + SSL3_TXT_DH_DSS_DES_64_CBC_SHA = 'DH-DSS-DES-CBC-SHA'; {Do not localize} + {$EXTERNALSYM SSL3_TXT_DH_RSA_DES_192_CBC3_SHA} + SSL3_TXT_DH_RSA_DES_192_CBC3_SHA = 'DH-RSA-DES-CBC3-SHA'; {Do not localize} + {$EXTERNALSYM SSL3_TXT_DH_RSA_DES_40_CBC_SHA} + SSL3_TXT_DH_RSA_DES_40_CBC_SHA = 'EXP-DH-RSA-DES-CBC-SHA'; {Do not localize} + {$EXTERNALSYM SSL3_TXT_DH_RSA_DES_64_CBC_SHA} + SSL3_TXT_DH_RSA_DES_64_CBC_SHA = 'DH-RSA-DES-CBC-SHA'; {Do not localize} + {$EXTERNALSYM SSL3_TXT_EDH_DSS_DES_192_CBC3_SHA} + SSL3_TXT_EDH_DSS_DES_192_CBC3_SHA = 'EDH-DSS-DES-CBC3-SHA'; {Do not localize} + {$EXTERNALSYM SSL3_TXT_EDH_DSS_DES_40_CBC_SHA} + SSL3_TXT_EDH_DSS_DES_40_CBC_SHA = 'EXP-EDH-DSS-DES-CBC-SHA'; {Do not localize} + {$EXTERNALSYM SSL3_TXT_EDH_DSS_DES_64_CBC_SHA} + SSL3_TXT_EDH_DSS_DES_64_CBC_SHA = 'EDH-DSS-DES-CBC-SHA'; {Do not localize} + {$EXTERNALSYM SSL3_TXT_EDH_RSA_DES_192_CBC3_SHA} + SSL3_TXT_EDH_RSA_DES_192_CBC3_SHA = 'EDH-RSA-DES-CBC3-SHA'; {Do not localize} + {$EXTERNALSYM SSL3_TXT_EDH_RSA_DES_40_CBC_SHA} + SSL3_TXT_EDH_RSA_DES_40_CBC_SHA = 'EXP-EDH-RSA-DES-CBC-SHA'; {Do not localize} + {$EXTERNALSYM SSL3_TXT_EDH_RSA_DES_64_CBC_SHA} + SSL3_TXT_EDH_RSA_DES_64_CBC_SHA = 'EDH-RSA-DES-CBC-SHA'; {Do not localize} + {$EXTERNALSYM SSL3_TXT_FZA_DMS_FZA_SHA} + SSL3_TXT_FZA_DMS_FZA_SHA = 'FZA-FZA-CBC-SHA'; {Do not localize} + {$EXTERNALSYM SSL3_TXT_FZA_DMS_NULL_SHA} + SSL3_TXT_FZA_DMS_NULL_SHA = 'FZA-NULL-SHA'; {Do not localize} + {$EXTERNALSYM SSL3_TXT_FZA_DMS_RC4_SHA} + SSL3_TXT_FZA_DMS_RC4_SHA = 'FZA-RC4-SHA'; {Do not localize} + {$EXTERNALSYM SSL3_TXT_RSA_DES_192_CBC3_SHA} + SSL3_TXT_RSA_DES_192_CBC3_SHA = 'DES-CBC3-SHA'; {Do not localize} + {$EXTERNALSYM SSL3_TXT_RSA_DES_40_CBC_SHA} + SSL3_TXT_RSA_DES_40_CBC_SHA = 'EXP-DES-CBC-SHA'; {Do not localize} + {$EXTERNALSYM SSL3_TXT_RSA_DES_64_CBC_SHA} + SSL3_TXT_RSA_DES_64_CBC_SHA = 'DES-CBC-SHA'; {Do not localize} + {$EXTERNALSYM SSL3_TXT_RSA_IDEA_128_SHA} + SSL3_TXT_RSA_IDEA_128_SHA = 'IDEA-CBC-SHA'; {Do not localize} + {$EXTERNALSYM SSL3_TXT_RSA_NULL_MD5} + SSL3_TXT_RSA_NULL_MD5 = 'NULL-MD5'; {Do not localize} + {$EXTERNALSYM SSL3_TXT_RSA_NULL_SHA} + SSL3_TXT_RSA_NULL_SHA = 'NULL-SHA'; {Do not localize} + {$EXTERNALSYM SSL3_TXT_RSA_RC2_40_MD5} + SSL3_TXT_RSA_RC2_40_MD5 = 'EXP-RC2-CBC-MD5'; {Do not localize} + {$EXTERNALSYM SSL3_TXT_RSA_RC4_128_MD5} + SSL3_TXT_RSA_RC4_128_MD5 = 'RC4-MD5'; {Do not localize} + {$EXTERNALSYM SSL3_TXT_RSA_RC4_128_SHA} + SSL3_TXT_RSA_RC4_128_SHA = 'RC4-SHA'; {Do not localize} + {$EXTERNALSYM SSL3_TXT_RSA_RC4_40_MD5} + SSL3_TXT_RSA_RC4_40_MD5 = 'EXP-RC4-MD5'; {Do not localize} + {$EXTERNALSYM SSL3_VERSION} + SSL3_VERSION = $0300; + {$EXTERNALSYM SSL3_VERSION_MAJOR} + SSL3_VERSION_MAJOR = $03; + {$EXTERNALSYM SSL3_VERSION_MINOR} + SSL3_VERSION_MINOR = $00; + {$EXTERNALSYM SSLEAY_VERSION} + SSLEAY_VERSION = 0; +//* #define SSLEAY_OPTIONS 1 no longer supported */ + {$EXTERNALSYM SSLEAY_CFLAGS} + SSLEAY_CFLAGS = 2; + {$EXTERNALSYM SSLEAY_BUILT_ON} + SSLEAY_BUILT_ON = 3; + {$EXTERNALSYM SSLEAY_PLATFORM} + SSLEAY_PLATFORM = 4; + {$EXTERNALSYM SSLEAY_DIR} + SSLEAY_DIR = 5; + //tls1.h + {$EXTERNALSYM TLS1_AD_DECRYPTION_FAILED} + TLS1_AD_DECRYPTION_FAILED = 21; + {$EXTERNALSYM TLS1_AD_RECORD_OVERFLOW} + TLS1_AD_RECORD_OVERFLOW = 22; + {$EXTERNALSYM TLS1_AD_UNKNOWN_CA} + TLS1_AD_UNKNOWN_CA = 48; + {$EXTERNALSYM TLS1_AD_ACCESS_DENIED} + TLS1_AD_ACCESS_DENIED = 49; + {$EXTERNALSYM TLS1_AD_DECODE_ERROR} + TLS1_AD_DECODE_ERROR = 50; + {$EXTERNALSYM TLS1_AD_DECRYPT_ERROR} + TLS1_AD_DECRYPT_ERROR = 51; + {$EXTERNALSYM TLS1_AD_EXPORT_RESTRICTION} + TLS1_AD_EXPORT_RESTRICTION = 60; + {$EXTERNALSYM TLS1_AD_PROTOCOL_VERSION} + TLS1_AD_PROTOCOL_VERSION = 70; + {$EXTERNALSYM TLS1_AD_INSUFFICIENT_SECURITY} + TLS1_AD_INSUFFICIENT_SECURITY = 71; + {$EXTERNALSYM TLS1_AD_INTERNAL_ERROR} + TLS1_AD_INTERNAL_ERROR = 80; + {$EXTERNALSYM TLS1_AD_USER_CANCELLED} + TLS1_AD_USER_CANCELLED = 90; + {$EXTERNALSYM TLS1_AD_NO_RENEGOTIATION} + TLS1_AD_NO_RENEGOTIATION = 100; + //* codes 110-114 are from RFC3546 */ + {$EXTERNALSYM TLS1_AD_UNSUPPORTED_EXTENSION} + TLS1_AD_UNSUPPORTED_EXTENSION = 110; + {$EXTERNALSYM TLS1_AD_CERTIFICATE_UNOBTAINABLE} + TLS1_AD_CERTIFICATE_UNOBTAINABLE = 111; + {$EXTERNALSYM TLS1_AD_UNRECOGNIZED_NAME} + TLS1_AD_UNRECOGNIZED_NAME = 112; + {$EXTERNALSYM TLS1_AD_BAD_CERTIFICATE_STATUS_RESPONSE} + TLS1_AD_BAD_CERTIFICATE_STATUS_RESPONSE = 113; + {$EXTERNALSYM TLS1_AD_BAD_CERTIFICATE_HASH_VALUE} + TLS1_AD_BAD_CERTIFICATE_HASH_VALUE = 114; + {$EXTERNALSYM TLS1_AD_UNKNOWN_PSK_IDENTITY} + TLS1_AD_UNKNOWN_PSK_IDENTITY = 115;//* fatal */ +//* ExtensionType values from RFC 3546 */ + {$EXTERNALSYM TLSEXT_TYPE_server_name} + TLSEXT_TYPE_server_name = 0; + {$EXTERNALSYM TLSEXT_TYPE_max_fragment_length} + TLSEXT_TYPE_max_fragment_length = 1; + {$EXTERNALSYM TLSEXT_TYPE_client_certificate_url} + TLSEXT_TYPE_client_certificate_url = 2; + {$EXTERNALSYM TLSEXT_TYPE_trusted_ca_keys} + TLSEXT_TYPE_trusted_ca_keys = 3; + {$EXTERNALSYM TLSEXT_TYPE_truncated_hmac} + TLSEXT_TYPE_truncated_hmac = 4; + {$EXTERNALSYM TLSEXT_TYPE_status_request} + TLSEXT_TYPE_status_request =5; + {$EXTERNALSYM TLSEXT_TYPE_user_mapping} + TLSEXT_TYPE_user_mapping = 6; + {$EXTERNALSYM TLSEXT_TYPE_client_authz} + TLSEXT_TYPE_client_authz = 7; + {$EXTERNALSYM TLSEXT_TYPE_server_authz} + TLSEXT_TYPE_server_authz = 8; + {$EXTERNALSYM TLSEXT_TYPE_cert_type} + TLSEXT_TYPE_cert_type = 9; + {$EXTERNALSYM TLSEXT_TYPE_elliptic_curves} + TLSEXT_TYPE_elliptic_curves = 10; + {$EXTERNALSYM TLSEXT_TYPE_ec_point_formats} + TLSEXT_TYPE_ec_point_formats = 11; + {$EXTERNALSYM TLSEXT_TYPE_srp} + TLSEXT_TYPE_srp = 12; + {$EXTERNALSYM TLSEXT_TYPE_signature_algorithms} + TLSEXT_TYPE_signature_algorithms = 13; + {$EXTERNALSYM TLSEXT_TYPE_use_srtp} + TLSEXT_TYPE_use_srtp = 14; + {$EXTERNALSYM TLSEXT_TYPE_heartbeat} + TLSEXT_TYPE_heartbeat = 15; + {$EXTERNALSYM TLSEXT_TYPE_session_ticket} + TLSEXT_TYPE_session_ticket = 35; + {$IFNDEF OPENSSL_NO_NEXTPROTONEG} +//* This is not an IANA defined extension number */ + {$EXTERNALSYM TLSEXT_TYPE_next_proto_neg} + TLSEXT_TYPE_next_proto_neg = 13172; + {$ENDIF} + //* Temporary extension type */ + {$EXTERNALSYM TLSEXT_TYPE_renegotiate} + TLSEXT_TYPE_renegotiate = $ff01; + + //* NameType value from RFC 3546 */ + {$EXTERNALSYM TLSEXT_NAMETYPE_host_name} + TLSEXT_NAMETYPE_host_name = 0; +//* status request value from RFC 3546 */ + {$EXTERNALSYM TLSEXT_STATUSTYPE_ocsp} + TLSEXT_STATUSTYPE_ocsp = 1; + {$EXTERNALSYM TLSEXT_ECPOINTFORMAT_first} + TLSEXT_ECPOINTFORMAT_first = 0; + {$EXTERNALSYM TLSEXT_ECPOINTFORMAT_uncompressed} + TLSEXT_ECPOINTFORMAT_uncompressed = 0; + {$EXTERNALSYM TLSEXT_ECPOINTFORMAT_ansiX962_compressed_prime} + TLSEXT_ECPOINTFORMAT_ansiX962_compressed_prime = 1; + {$EXTERNALSYM TLSEXT_ECPOINTFORMAT_ansiX962_compressed_char2} + TLSEXT_ECPOINTFORMAT_ansiX962_compressed_char2 = 2; + {$EXTERNALSYM TLSEXT_ECPOINTFORMAT_last} + TLSEXT_ECPOINTFORMAT_last = 2; + {$EXTERNALSYM TLSEXT_signature_anonymous} + TLSEXT_signature_anonymous = 0; + {$EXTERNALSYM TLSEXT_signature_rsa} + TLSEXT_signature_rsa = 1; + {$EXTERNALSYM TLSEXT_signature_dsa} + TLSEXT_signature_dsa = 2; + {$EXTERNALSYM TLSEXT_signature_ecdsa} + TLSEXT_signature_ecdsa = 3; + {$EXTERNALSYM TLSEXT_hash_none} + TLSEXT_hash_none = 0; + {$EXTERNALSYM TLSEXT_hash_md5} + TLSEXT_hash_md5 = 1; + {$EXTERNALSYM TLSEXT_hash_sha1} + TLSEXT_hash_sha1 = 2; + {$EXTERNALSYM TLSEXT_hash_sha224} + TLSEXT_hash_sha224 = 3; + {$EXTERNALSYM TLSEXT_hash_sha256} + TLSEXT_hash_sha256 = 4; + {$EXTERNALSYM TLSEXT_hash_sha384} + TLSEXT_hash_sha384 = 5; + {$EXTERNALSYM TLSEXT_hash_sha512} + TLSEXT_hash_sha512 = 6; + +{$IFNDEF OPENSSL_NO_TLSEXT} + {$EXTERNALSYM TLSEXT_MAXLEN_host_name} + TLSEXT_MAXLEN_host_name = 255; + {$EXTERNALSYM SSL_TLSEXT_ERR_OK} + SSL_TLSEXT_ERR_OK = 0; + {$EXTERNALSYM SSL_TLSEXT_ERR_ALERT_WARNING} + SSL_TLSEXT_ERR_ALERT_WARNING = 1; + {$EXTERNALSYM SSL_TLSEXT_ERR_ALERT_FATAL} + SSL_TLSEXT_ERR_ALERT_FATAL = 2; + {$EXTERNALSYM SSL_TLSEXT_ERR_NOACK} + SSL_TLSEXT_ERR_NOACK = 3; + {$IFDEF OPENSSL_NO_HEARTBEATS} + {$EXTERNALSYM SSL_TLSEXT_HB_DONT_SEND_REQUESTS} + SSL_TLSEXT_HB_ENABLED = $01; + {$EXTERNALSYM SSL_TLSEXT_HB_DONT_SEND_REQUESTS} + SSL_TLSEXT_HB_DONT_SEND_REQUESTS = $02; + {$EXTERNALSYM SSL_TLSEXT_HB_DONT_RECV_REQUESTS} + SSL_TLSEXT_HB_DONT_RECV_REQUESTS = $04; + {$ENDIF} +{$ENDIF} + // + {$EXTERNALSYM SSLEAY_VERSION_NUMBER} + SSLEAY_VERSION_NUMBER = OPENSSL_VERSION_NUMBER; + {$EXTERNALSYM SSL_AD_REASON_OFFSET} + SSL_AD_REASON_OFFSET = 1000; + {$EXTERNALSYM SSL_AD_CLOSE_NOTIFY} + SSL_AD_CLOSE_NOTIFY = SSL3_AD_CLOSE_NOTIFY; + {$EXTERNALSYM SSL_AD_UNEXPECTED_MESSAGE} + SSL_AD_UNEXPECTED_MESSAGE = SSL3_AD_UNEXPECTED_MESSAGE; + {$EXTERNALSYM SSL_AD_BAD_RECORD_MAC} + SSL_AD_BAD_RECORD_MAC = SSL3_AD_BAD_RECORD_MAC; + {$EXTERNALSYM SSL_AD_DECRYPTION_FAILED} + SSL_AD_DECRYPTION_FAILED = TLS1_AD_DECRYPTION_FAILED; + {$EXTERNALSYM SSL_AD_RECORD_OVERFLOW} + SSL_AD_RECORD_OVERFLOW = TLS1_AD_RECORD_OVERFLOW; + {$EXTERNALSYM SSL_AD_DECOMPRESSION_FAILURE} + SSL_AD_DECOMPRESSION_FAILURE = SSL3_AD_DECOMPRESSION_FAILURE; + {$EXTERNALSYM SSL_AD_HANDSHAKE_FAILURE} + SSL_AD_HANDSHAKE_FAILURE = SSL3_AD_HANDSHAKE_FAILURE; + {$EXTERNALSYM SSL_AD_NO_CERTIFICATE} + SSL_AD_NO_CERTIFICATE = SSL3_AD_NO_CERTIFICATE; + {$EXTERNALSYM SSL_AD_BAD_CERTIFICATE} + SSL_AD_BAD_CERTIFICATE = SSL3_AD_BAD_CERTIFICATE; + {$EXTERNALSYM SSL_AD_UNSUPPORTED_CERTIFICATE} + SSL_AD_UNSUPPORTED_CERTIFICATE = SSL3_AD_UNSUPPORTED_CERTIFICATE; + {$EXTERNALSYM SSL_AD_CERTIFICATE_REVOKED} + SSL_AD_CERTIFICATE_REVOKED = SSL3_AD_CERTIFICATE_REVOKED; + {$EXTERNALSYM SSL_AD_CERTIFICATE_EXPIRED} + SSL_AD_CERTIFICATE_EXPIRED = SSL3_AD_CERTIFICATE_EXPIRED; + {$EXTERNALSYM SSL_AD_CERTIFICATE_UNKNOWN} + SSL_AD_CERTIFICATE_UNKNOWN = SSL3_AD_CERTIFICATE_UNKNOWN; + {$EXTERNALSYM SSL_AD_ILLEGAL_PARAMETER} + SSL_AD_ILLEGAL_PARAMETER = SSL3_AD_ILLEGAL_PARAMETER; + + {$EXTERNALSYM SSL_AD_UNKNOWN_CA} + SSL_AD_UNKNOWN_CA = TLS1_AD_UNKNOWN_CA; + {$EXTERNALSYM SSL_AD_ACCESS_DENIED} + SSL_AD_ACCESS_DENIED = TLS1_AD_ACCESS_DENIED; + {$EXTERNALSYM SSL_AD_DECODE_ERROR} + SSL_AD_DECODE_ERROR = TLS1_AD_DECODE_ERROR; + {$EXTERNALSYM SSL_AD_DECRYPT_ERROR} + SSL_AD_DECRYPT_ERROR = TLS1_AD_DECRYPT_ERROR; + {$EXTERNALSYM SSL_AD_EXPORT_RESTRICTION} + SSL_AD_EXPORT_RESTRICTION = TLS1_AD_EXPORT_RESTRICTION; + {$EXTERNALSYM SSL_AD_PROTOCOL_VERSION} + SSL_AD_PROTOCOL_VERSION = TLS1_AD_PROTOCOL_VERSION; + {$EXTERNALSYM SSL_AD_INSUFFICIENT_SECURITY} + SSL_AD_INSUFFICIENT_SECURITY = TLS1_AD_INSUFFICIENT_SECURITY; + {$EXTERNALSYM SSL_AD_INTERNAL_ERROR} + SSL_AD_INTERNAL_ERROR = TLS1_AD_INTERNAL_ERROR; + {$EXTERNALSYM SSL_AD_USER_CANCELLED} + SSL_AD_USER_CANCELLED = TLS1_AD_USER_CANCELLED; + {$EXTERNALSYM SSL_AD_NO_RENEGOTIATION} + SSL_AD_NO_RENEGOTIATION = TLS1_AD_NO_RENEGOTIATION; + {$EXTERNALSYM SSL_AD_UNSUPPORTED_EXTENSION} + SSL_AD_UNSUPPORTED_EXTENSION = TLS1_AD_UNSUPPORTED_EXTENSION; + {$EXTERNALSYM SSL_AD_CERTIFICATE_UNOBTAINABLE} + SSL_AD_CERTIFICATE_UNOBTAINABLE = TLS1_AD_CERTIFICATE_UNOBTAINABLE; + {$EXTERNALSYM SSL_AD_UNRECOGNIZED_NAME} + SSL_AD_UNRECOGNIZED_NAME = TLS1_AD_UNRECOGNIZED_NAME; + {$EXTERNALSYM SSL_AD_BAD_CERTIFICATE_STATUS_RESPONSE} + SSL_AD_BAD_CERTIFICATE_STATUS_RESPONSE = TLS1_AD_BAD_CERTIFICATE_STATUS_RESPONSE; + {$EXTERNALSYM SSL_AD_BAD_CERTIFICATE_HASH_VALUE} + SSL_AD_BAD_CERTIFICATE_HASH_VALUE = TLS1_AD_BAD_CERTIFICATE_HASH_VALUE; + {$EXTERNALSYM SSL_AD_UNKNOWN_PSK_IDENTITY} + SSL_AD_UNKNOWN_PSK_IDENTITY = TLS1_AD_UNKNOWN_PSK_IDENTITY; //* fatal */ + + + + + {$EXTERNALSYM SSL_CTRL_NEED_TMP_RSA} + SSL_CTRL_NEED_TMP_RSA = 1; + {$EXTERNALSYM SSL_CTRL_SET_TMP_RSA} + SSL_CTRL_SET_TMP_RSA = 2; + {$EXTERNALSYM SSL_CTRL_SET_TMP_DH} + SSL_CTRL_SET_TMP_DH = 3; + {$EXTERNALSYM SSL_CTRL_SET_TMP_ECDH} + SSL_CTRL_SET_TMP_ECDH = 4; + {$EXTERNALSYM SSL_CTRL_SET_TMP_RSA_CB} + SSL_CTRL_SET_TMP_RSA_CB = 5; + {$EXTERNALSYM SSL_CTRL_SET_TMP_DH_CB} + SSL_CTRL_SET_TMP_DH_CB = 6; + {$EXTERNALSYM SSL_CTRL_SET_TMP_ECDH_CB} + SSL_CTRL_SET_TMP_ECDH_CB = 7; + {$IFNDEF NO_TLSEXT} + //* see tls1.h for macros based on these */ + {$EXTERNALSYM SSL_CTRL_SET_TLSEXT_SERVERNAME_CB} + SSL_CTRL_SET_TLSEXT_SERVERNAME_CB = 53; + {$EXTERNALSYM SSL_CTRL_SET_TLSEXT_SERVERNAME_ARG} + SSL_CTRL_SET_TLSEXT_SERVERNAME_ARG = 54; + {$EXTERNALSYM SSL_CTRL_SET_TLSEXT_HOSTNAME} + SSL_CTRL_SET_TLSEXT_HOSTNAME = 55; + {$EXTERNALSYM SSL_CTRL_SET_TLSEXT_DEBUG_CB} + SSL_CTRL_SET_TLSEXT_DEBUG_CB = 56; + {$EXTERNALSYM SSL_CTRL_SET_TLSEXT_DEBUG_ARG} + SSL_CTRL_SET_TLSEXT_DEBUG_ARG = 57; + {$EXTERNALSYM SSL_CTRL_GET_TLSEXT_TICKET_KEYS} + SSL_CTRL_GET_TLSEXT_TICKET_KEYS = 58; + {$EXTERNALSYM SSL_CTRL_SET_TLSEXT_TICKET_KEYS} + SSL_CTRL_SET_TLSEXT_TICKET_KEYS = 59; + {$EXTERNALSYM SSL_CTRL_SET_TLSEXT_OPAQUE_PRF_INPUT} + SSL_CTRL_SET_TLSEXT_OPAQUE_PRF_INPUT = 60; + {$EXTERNALSYM SSL_CTRL_SET_TLSEXT_OPAQUE_PRF_INPUT_CB} + SSL_CTRL_SET_TLSEXT_OPAQUE_PRF_INPUT_CB = 61; + {$EXTERNALSYM SSL_CTRL_SET_TLSEXT_OPAQUE_PRF_INPUT_CB_ARG} + SSL_CTRL_SET_TLSEXT_OPAQUE_PRF_INPUT_CB_ARG = 62; + {$EXTERNALSYM SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB} + SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB = 63; + {$EXTERNALSYM SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB_ARG} + SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB_ARG = 64; + {$EXTERNALSYM SSL_CTRL_SET_TLSEXT_STATUS_REQ_TYPE} + SSL_CTRL_SET_TLSEXT_STATUS_REQ_TYPE = 65; + {$EXTERNALSYM SSL_CTRL_GET_TLSEXT_STATUS_REQ_EXTS} + SSL_CTRL_GET_TLSEXT_STATUS_REQ_EXTS = 66; + {$EXTERNALSYM SSL_CTRL_SET_TLSEXT_STATUS_REQ_EXTS} + SSL_CTRL_SET_TLSEXT_STATUS_REQ_EXTS = 67; + {$EXTERNALSYM SSL_CTRL_GET_TLSEXT_STATUS_REQ_IDS} + SSL_CTRL_GET_TLSEXT_STATUS_REQ_IDS = 68; + {$EXTERNALSYM SSL_CTRL_SET_TLSEXT_STATUS_REQ_IDS} + SSL_CTRL_SET_TLSEXT_STATUS_REQ_IDS = 69; + {$EXTERNALSYM SSL_CTRL_GET_TLSEXT_STATUS_REQ_OCSP_RESP} + SSL_CTRL_GET_TLSEXT_STATUS_REQ_OCSP_RESP = 70; + {$EXTERNALSYM SSL_CTRL_SET_TLSEXT_STATUS_REQ_OCSP_RESP} + SSL_CTRL_SET_TLSEXT_STATUS_REQ_OCSP_RESP = 71; + {$EXTERNALSYM SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB} + SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB = 72; + {$EXTERNALSYM SSL_CTRL_SET_TLS_EXT_SRP_USERNAME_CB} + SSL_CTRL_SET_TLS_EXT_SRP_USERNAME_CB = 75; + {$EXTERNALSYM SSL_CTRL_SET_SRP_VERIFY_PARAM_CB} + SSL_CTRL_SET_SRP_VERIFY_PARAM_CB = 76; + {$EXTERNALSYM SSL_CTRL_SET_SRP_GIVE_CLIENT_PWD_CB} + SSL_CTRL_SET_SRP_GIVE_CLIENT_PWD_CB = 77; + {$EXTERNALSYM SSL_CTRL_SET_SRP_ARG} + SSL_CTRL_SET_SRP_ARG = 78; + {$EXTERNALSYM SSL_CTRL_SET_TLS_EXT_SRP_USERNAME} + SSL_CTRL_SET_TLS_EXT_SRP_USERNAME = 79; + {$EXTERNALSYM SSL_CTRL_SET_TLS_EXT_SRP_STRENGTH} + SSL_CTRL_SET_TLS_EXT_SRP_STRENGTH = 80; + {$EXTERNALSYM SSL_CTRL_SET_TLS_EXT_SRP_PASSWORD} + SSL_CTRL_SET_TLS_EXT_SRP_PASSWORD = 81; + {$ifndef OPENSSL_NO_HEARTBEATS} + {$EXTERNALSYM SSL_CTRL_TLS_EXT_SEND_HEARTBEAT} + SSL_CTRL_TLS_EXT_SEND_HEARTBEAT = 85; + {$EXTERNALSYM SSL_CTRL_GET_TLS_EXT_HEARTBEAT_PENDING} + SSL_CTRL_GET_TLS_EXT_HEARTBEAT_PENDING = 86; + {$EXTERNALSYM SSL_CTRL_SET_TLS_EXT_HEARTBEAT_NO_REQUESTS} + SSL_CTRL_SET_TLS_EXT_HEARTBEAT_NO_REQUESTS = 87; + {$endif} + {$ENDIF} + {$EXTERNALSYM SSL_CTRL_SET_ECDH_AUTO} + SSL_CTRL_SET_ECDH_AUTO = 94; + + {$EXTERNALSYM DTLS_CTRL_GET_TIMEOUT} + DTLS_CTRL_GET_TIMEOUT = 73; + {$EXTERNALSYM DTLS_CTRL_HANDLE_TIMEOUT} + DTLS_CTRL_HANDLE_TIMEOUT = 74; + {$EXTERNALSYM DTLS_CTRL_LISTEN} + DTLS_CTRL_LISTEN = 75; + + {$EXTERNALSYM SSL_CTRL_GET_RI_SUPPORT} + SSL_CTRL_GET_RI_SUPPORT = 76; + {$EXTERNALSYM SSL_CTRL_CLEAR_OPTIONS} + SSL_CTRL_CLEAR_OPTIONS = 77; + {$EXTERNALSYM SSL_CTRL_CLEAR_MODE} + SSL_CTRL_CLEAR_MODE = 78; + {$EXTERNALSYM SSL_CTRL_GET_EXTRA_CHAIN_CERTS} + SSL_CTRL_GET_EXTRA_CHAIN_CERTS = 82; + {$EXTERNALSYM SSL_CTRL_CLEAR_EXTRA_CHAIN_CERTS} + SSL_CTRL_CLEAR_EXTRA_CHAIN_CERTS = 83; + {$EXTERNALSYM SSL_CTRL_CHAIN} //OpenSSL 1.0.2 + SSL_CTRL_CHAIN = 88; + {$EXTERNALSYM SSL_CTRL_CHAIN_CERT} //OpenSSL 1.0.2 + SSL_CTRL_CHAIN_CERT = 89; + {$EXTERNALSYM SSL_CTRL_GET_CHAIN_CERTS} //OpenSSL 1.0.2 + SSL_CTRL_GET_CHAIN_CERTS = 115; + {$EXTERNALSYM SSL_CTRL_GET_SESSION_REUSED} + SSL_CTRL_GET_SESSION_REUSED = 8; + {$EXTERNALSYM SSL_CTRL_GET_CLIENT_CERT_REQUEST} + SSL_CTRL_GET_CLIENT_CERT_REQUEST = 9; + {$EXTERNALSYM SSL_CTRL_GET_NUM_RENEGOTIATIONS} + SSL_CTRL_GET_NUM_RENEGOTIATIONS = 10; + {$EXTERNALSYM SSL_CTRL_CLEAR_NUM_RENEGOTIATIONS} + SSL_CTRL_CLEAR_NUM_RENEGOTIATIONS = 11; + {$EXTERNALSYM SSL_CTRL_GET_TOTAL_RENEGOTIATIONS} + SSL_CTRL_GET_TOTAL_RENEGOTIATIONS = 12; + {$EXTERNALSYM SSL_CTRL_GET_FLAGS} + SSL_CTRL_GET_FLAGS = 13; + {$EXTERNALSYM SSL_CTRL_EXTRA_CHAIN_CERT} + SSL_CTRL_EXTRA_CHAIN_CERT = 14; + {$EXTERNALSYM SSL_CTRL_SET_MSG_CALLBACK} + SSL_CTRL_SET_MSG_CALLBACK = 15; + {$EXTERNALSYM SSL_CTRL_SET_MSG_CALLBACK_ARG} + SSL_CTRL_SET_MSG_CALLBACK_ARG = 16; +//* only applies to datagram connections */ + {$EXTERNALSYM SSL_CTRL_SET_MTU} + SSL_CTRL_SET_MTU = 17; +//* Stats */ + {$EXTERNALSYM SSL_CTRL_SESS_NUMBER} + SSL_CTRL_SESS_NUMBER = 20; + {$EXTERNALSYM SSL_CTRL_SESS_CONNECT} + SSL_CTRL_SESS_CONNECT = 21; + {$EXTERNALSYM SSL_CTRL_SESS_CONNECT_GOOD} + SSL_CTRL_SESS_CONNECT_GOOD = 22; + {$EXTERNALSYM SSL_CTRL_SESS_CONNECT_RENEGOTIATE} + SSL_CTRL_SESS_CONNECT_RENEGOTIATE = 23; + {$EXTERNALSYM SSL_CTRL_SESS_ACCEPT} + SSL_CTRL_SESS_ACCEPT = 24; + {$EXTERNALSYM SSL_CTRL_SESS_ACCEPT_GOOD} + SSL_CTRL_SESS_ACCEPT_GOOD = 25; + {$EXTERNALSYM SSL_CTRL_SESS_ACCEPT_RENEGOTIATE} + SSL_CTRL_SESS_ACCEPT_RENEGOTIATE = 26; + {$EXTERNALSYM SSL_CTRL_SESS_HIT} + SSL_CTRL_SESS_HIT = 27; + {$EXTERNALSYM SSL_CTRL_SESS_CB_HIT} + SSL_CTRL_SESS_CB_HIT = 28; + {$EXTERNALSYM SSL_CTRL_SESS_MISSES} + SSL_CTRL_SESS_MISSES = 29; + {$EXTERNALSYM SSL_CTRL_SESS_TIMEOUTS} + SSL_CTRL_SESS_TIMEOUTS = 30; + {$EXTERNALSYM SSL_CTRL_SESS_CACHE_FULL} + SSL_CTRL_SESS_CACHE_FULL = 31; + {$EXTERNALSYM SSL_CTRL_OPTIONS} + SSL_CTRL_OPTIONS = 32; + {$EXTERNALSYM SSL_CTRL_MODE} + SSL_CTRL_MODE = 33; + {$EXTERNALSYM SSL_CTRL_GET_READ_AHEAD} + SSL_CTRL_GET_READ_AHEAD = 40; + {$EXTERNALSYM SSL_CTRL_SET_READ_AHEAD} + SSL_CTRL_SET_READ_AHEAD = 41; + {$EXTERNALSYM SSL_CTRL_SET_SESS_CACHE_SIZE} + SSL_CTRL_SET_SESS_CACHE_SIZE = 42; + {$EXTERNALSYM SSL_CTRL_GET_SESS_CACHE_SIZE} + SSL_CTRL_GET_SESS_CACHE_SIZE = 43; + {$EXTERNALSYM SSL_CTRL_SET_SESS_CACHE_MODE} + SSL_CTRL_SET_SESS_CACHE_MODE = 44; + {$EXTERNALSYM SSL_CTRL_GET_SESS_CACHE_MODE} + SSL_CTRL_GET_SESS_CACHE_MODE = 45; + {$EXTERNALSYM SSL_CTRL_GET_MAX_CERT_LIST} + SSL_CTRL_GET_MAX_CERT_LIST = 50; + {$EXTERNALSYM SSL_CTRL_SET_MAX_CERT_LIST} + SSL_CTRL_SET_MAX_CERT_LIST = 51; + {$EXTERNALSYM SSL_CTRL_SET_MAX_SEND_FRAGMENT} + SSL_CTRL_SET_MAX_SEND_FRAGMENT = 52; + + {$EXTERNALSYM SSL_DEFAULT_CIPHER_LIST} + SSL_DEFAULT_CIPHER_LIST = 'AES:ALL:!aNULL:!eNULL:+RC4:@STRENGTH'; //* low priority for RC4 */ + {$EXTERNALSYM SSL_ERROR_NONE} + SSL_ERROR_NONE = 0; + {$EXTERNALSYM SSL_ERROR_SSL} + SSL_ERROR_SSL = 1; + {$EXTERNALSYM SSL_ERROR_WANT_READ} + SSL_ERROR_WANT_READ = 2; + {$EXTERNALSYM SSL_ERROR_WANT_WRITE} + SSL_ERROR_WANT_WRITE = 3; + {$EXTERNALSYM SSL_ERROR_WANT_X509_LOOKUP} + SSL_ERROR_WANT_X509_LOOKUP = 4; + {$EXTERNALSYM SSL_ERROR_SYSCALL} + SSL_ERROR_SYSCALL = 5; + {$EXTERNALSYM SSL_ERROR_ZERO_RETURN} + SSL_ERROR_ZERO_RETURN = 6; + {$EXTERNALSYM SSL_ERROR_WANT_CONNECT} + SSL_ERROR_WANT_CONNECT = 7; + {$EXTERNALSYM SSL_ERROR_WANT_ACCEPT} + SSL_ERROR_WANT_ACCEPT = 8; + {$EXTERNALSYM X509_FILETYPE_ASN1} + X509_FILETYPE_ASN1 = 2; + {$EXTERNALSYM SSL_FILETYPE_ASN1} + SSL_FILETYPE_ASN1 = X509_FILETYPE_ASN1; + {$EXTERNALSYM X509_FILETYPE_PEM} + X509_FILETYPE_PEM = 1; + {$EXTERNALSYM SSL_FILETYPE_PEM} + SSL_FILETYPE_PEM = X509_FILETYPE_PEM; + {$EXTERNALSYM SSL_F_CLIENT_CERTIFICATE} + SSL_F_CLIENT_CERTIFICATE = 100; + {$EXTERNALSYM SSL_F_CLIENT_HELLO} + SSL_F_CLIENT_HELLO = 101; + {$EXTERNALSYM SSL_F_CLIENT_MASTER_KEY} + SSL_F_CLIENT_MASTER_KEY = 102; + {$EXTERNALSYM SSL_F_D2I_SSL_SESSION} + SSL_F_D2I_SSL_SESSION = 103; + {$EXTERNALSYM SSL_F_DO_SSL3_WRITE} + SSL_F_DO_SSL3_WRITE = 104; + {$EXTERNALSYM SSL_F_DTLS1_ACCEPT} + SSL_F_DTLS1_ACCEPT = 246; + {$EXTERNALSYM SSL_F_DTLS1_ADD_CERT_TO_BUF} + SSL_F_DTLS1_ADD_CERT_TO_BUF = 295; //was 280; + {$EXTERNALSYM SSL_F_DTLS1_BUFFER_RECORD} + SSL_F_DTLS1_BUFFER_RECORD = 247; + {$EXTERNALSYM SSL_F_DTLS1_CHECK_TIMEOUT_NUM} + SSL_F_DTLS1_CHECK_TIMEOUT_NUM = 316; + {$EXTERNALSYM SSL_F_DTLS1_CLIENT_HELLO} + SSL_F_DTLS1_CLIENT_HELLO = 248; + {$EXTERNALSYM SSL_F_DTLS1_CONNECT} + SSL_F_DTLS1_CONNECT = 249; + {$EXTERNALSYM SSL_F_DTLS1_ENC} + SSL_F_DTLS1_ENC = 250; + {$EXTERNALSYM SSL_F_DTLS1_GET_HELLO_VERIFY} + SSL_F_DTLS1_GET_HELLO_VERIFY = 251; + {$EXTERNALSYM SSL_F_DTLS1_GET_MESSAGE} + SSL_F_DTLS1_GET_MESSAGE = 252; + {$EXTERNALSYM SSL_F_DTLS1_GET_MESSAGE_FRAGMENT} + SSL_F_DTLS1_GET_MESSAGE_FRAGMENT = 253; + {$EXTERNALSYM SSL_F_DTLS1_GET_RECORD} + SSL_F_DTLS1_GET_RECORD = 254; + {$EXTERNALSYM SSL_F_DTLS1_HANDLE_TIMEOUT} + SSL_F_DTLS1_HANDLE_TIMEOUT = 297; //was 282 + {$EXTERNALSYM SSL_F_DTLS1_HEARTBEAT} + SSL_F_DTLS1_HEARTBEAT = 305; + {$EXTERNALSYM SSL_F_DTLS1_OUTPUT_CERT_CHAIN} + SSL_F_DTLS1_OUTPUT_CERT_CHAIN = 255; + {$EXTERNALSYM SSL_F_DTLS1_PREPROCESS_FRAGMENT} + SSL_F_DTLS1_PREPROCESS_FRAGMENT = 288; //was 277; + {$EXTERNALSYM SSL_F_DTLS1_PROCESS_OUT_OF_SEQ_MESSAGE} + SSL_F_DTLS1_PROCESS_OUT_OF_SEQ_MESSAGE = 256; + {$EXTERNALSYM SSL_F_DTLS1_PROCESS_RECORD} + SSL_F_DTLS1_PROCESS_RECORD = 257; + {$EXTERNALSYM SSL_F_DTLS1_READ_BYTES} + SSL_F_DTLS1_READ_BYTES = 258; + {$EXTERNALSYM SSL_F_DTLS1_READ_FAILED} + SSL_F_DTLS1_READ_FAILED = 259; + {$EXTERNALSYM SSL_F_DTLS1_SEND_CERTIFICATE_REQUEST} + SSL_F_DTLS1_SEND_CERTIFICATE_REQUEST = 260; + {$EXTERNALSYM SSL_F_DTLS1_SEND_CLIENT_CERTIFICATE} + SSL_F_DTLS1_SEND_CLIENT_CERTIFICATE = 261; + {$EXTERNALSYM SSL_F_DTLS1_SEND_CLIENT_KEY_EXCHANGE} + SSL_F_DTLS1_SEND_CLIENT_KEY_EXCHANGE = 262; + {$EXTERNALSYM SSL_F_DTLS1_SEND_CLIENT_VERIFY} + SSL_F_DTLS1_SEND_CLIENT_VERIFY = 263; + {$EXTERNALSYM SSL_F_DTLS1_SEND_HELLO_VERIFY_REQUEST} + SSL_F_DTLS1_SEND_HELLO_VERIFY_REQUEST = 264; + {$EXTERNALSYM SSL_F_DTLS1_SEND_SERVER_CERTIFICATE} + SSL_F_DTLS1_SEND_SERVER_CERTIFICATE = 265; + {$EXTERNALSYM SSL_F_DTLS1_SEND_SERVER_HELLO} + SSL_F_DTLS1_SEND_SERVER_HELLO = 266; + {$EXTERNALSYM SSL_F_DTLS1_SEND_SERVER_KEY_EXCHANGE} + SSL_F_DTLS1_SEND_SERVER_KEY_EXCHANGE = 267; + {$EXTERNALSYM SSL_F_DTLS1_WRITE_APP_DATA_BYTES} + SSL_F_DTLS1_WRITE_APP_DATA_BYTES = 268; + {$EXTERNALSYM SSL_F_GET_CLIENT_FINISHED} + SSL_F_GET_CLIENT_FINISHED = 105; + {$EXTERNALSYM SSL_F_GET_CLIENT_HELLO} + SSL_F_GET_CLIENT_HELLO = 106; + {$EXTERNALSYM SSL_F_GET_CLIENT_MASTER_KEY} + SSL_F_GET_CLIENT_MASTER_KEY = 107; + {$EXTERNALSYM SSL_F_GET_SERVER_FINISHED} + SSL_F_GET_SERVER_FINISHED = 108; + {$EXTERNALSYM SSL_F_GET_SERVER_HELLO} + SSL_F_GET_SERVER_HELLO = 109; + {$EXTERNALSYM SSL_F_GET_SERVER_VERIFY} + SSL_F_GET_SERVER_VERIFY = 110; + {$EXTERNALSYM SSL_F_I2D_SSL_SESSION} + SSL_F_I2D_SSL_SESSION = 111; + {$EXTERNALSYM SSL_F_READ_N} + SSL_F_READ_N = 112; + {$EXTERNALSYM SSL_F_REQUEST_CERTIFICATE} + SSL_F_REQUEST_CERTIFICATE = 113; + {$EXTERNALSYM SSL_F_SERVER_HELLO} + SSL_F_SERVER_HELLO = 114; + {$EXTERNALSYM SSL_F_SSL23_ACCEPT} + SSL_F_SSL23_ACCEPT = 115; + {$EXTERNALSYM SSL_F_SSL3_ADD_CERT_TO_BUF} + SSL_F_SSL3_ADD_CERT_TO_BUF = 296; //was 281; + + {$EXTERNALSYM SSL_F_SSL23_CLIENT_HELLO} + SSL_F_SSL23_CLIENT_HELLO = 116; + {$EXTERNALSYM SSL_F_SSL23_CONNECT} + SSL_F_SSL23_CONNECT = 117; + {$EXTERNALSYM SSL_F_SSL23_GET_CLIENT_HELLO} + SSL_F_SSL23_GET_CLIENT_HELLO = 118; + {$EXTERNALSYM SSL_F_SSL23_GET_SERVER_HELLO} + SSL_F_SSL23_GET_SERVER_HELLO = 119; + {$EXTERNALSYM SSL_F_SSL23_READ} + SSL_F_SSL23_READ = 120; + {$EXTERNALSYM SSL_F_SSL23_WRITE} + SSL_F_SSL23_WRITE = 121; + {$EXTERNALSYM SSL_F_SSL2_ACCEPT} + SSL_F_SSL2_ACCEPT = 122; + {$EXTERNALSYM SSL_F_SSL2_CONNECT} + SSL_F_SSL2_CONNECT = 123; + {$EXTERNALSYM SSL_F_SSL2_ENC_INIT} + SSL_F_SSL2_ENC_INIT = 124; + {$EXTERNALSYM SSL_F_SSL2_READ} + SSL_F_SSL2_READ = 125; + {$EXTERNALSYM SSL_F_SSL2_SET_CERTIFICATE} + SSL_F_SSL2_SET_CERTIFICATE = 126; + {$EXTERNALSYM SSL_F_SSL2_WRITE} + SSL_F_SSL2_WRITE = 127; + {$EXTERNALSYM SSL_F_SSL3_ACCEPT} + SSL_F_SSL3_ACCEPT = 128; + {$EXTERNALSYM SSL_F_SSL3_CHANGE_CIPHER_STATE} + SSL_F_SSL3_CHANGE_CIPHER_STATE = 129; + {$EXTERNALSYM SSL_F_SSL3_CHECK_CERT_AND_ALGORITHM} + SSL_F_SSL3_CHECK_CERT_AND_ALGORITHM = 130; + {$EXTERNALSYM SSL_F_SSL3_CHECK_CLIENT_HELLO} + SSL_F_SSL3_CHECK_CLIENT_HELLO = 304; + {$EXTERNALSYM SSL_F_SSL3_CLIENT_HELLO} + SSL_F_SSL3_CLIENT_HELLO = 131; + {$EXTERNALSYM SSL_F_SSL3_CONNECT} + SSL_F_SSL3_CONNECT = 132; + {$EXTERNALSYM SSL_F_SSL3_CTRL} + SSL_F_SSL3_CTRL = 213; + {$EXTERNALSYM SSL_F_SSL3_CTX_CTRL} + SSL_F_SSL3_CTX_CTRL = 133; + {$EXTERNALSYM SSL_F_SSL3_DIGEST_CACHED_RECORDS} + SSL_F_SSL3_DIGEST_CACHED_RECORDS = 293; + {$EXTERNALSYM SSL_F_SSL3_DO_CHANGE_CIPHER_SPEC} + SSL_F_SSL3_DO_CHANGE_CIPHER_SPEC = 292;//was 279; + {$EXTERNALSYM SSL_F_SSL3_ENC} + SSL_F_SSL3_ENC = 134; + {$EXTERNALSYM SSL_F_SSL3_GET_CERTIFICATE_REQUEST} + SSL_F_SSL3_GET_CERTIFICATE_REQUEST = 135; + {$EXTERNALSYM SSL_F_SSL3_GET_CERT_STATUS} + SSL_F_SSL3_GET_CERT_STATUS = 289;//was 288; + {$EXTERNALSYM SSL_F_SSL3_GET_CERT_VERIFY} + SSL_F_SSL3_GET_CERT_VERIFY = 136; + {$EXTERNALSYM SSL_F_SSL3_GET_CLIENT_CERTIFICATE} + SSL_F_SSL3_GET_CLIENT_CERTIFICATE = 137; + {$EXTERNALSYM SSL_F_SSL3_GET_CLIENT_HELLO} + SSL_F_SSL3_GET_CLIENT_HELLO = 138; + {$EXTERNALSYM SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE} + SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE = 139; + {$EXTERNALSYM SSL_F_SSL3_GET_FINISHED} + SSL_F_SSL3_GET_FINISHED = 140; + {$EXTERNALSYM SSL_F_SSL3_GET_KEY_EXCHANGE} + SSL_F_SSL3_GET_KEY_EXCHANGE = 141; + {$EXTERNALSYM SSL_F_SSL3_GET_MESSAGE} + SSL_F_SSL3_GET_MESSAGE = 142; + {$EXTERNALSYM SSL_F_SSL3_GET_NEW_SESSION_TICKET} + SSL_F_SSL3_GET_NEW_SESSION_TICKET = 283; + {$EXTERNALSYM SSL_F_SSL3_GET_NEXT_PROTO} + SSL_F_SSL3_GET_NEXT_PROTO = 306; + {$EXTERNALSYM SSL_F_SSL3_GET_RECORD} + SSL_F_SSL3_GET_RECORD = 143; + {$EXTERNALSYM SSL_F_SSL3_GET_SERVER_CERTIFICATE} + SSL_F_SSL3_GET_SERVER_CERTIFICATE = 144; + {$EXTERNALSYM SSL_F_SSL3_GET_SERVER_DONE} + SSL_F_SSL3_GET_SERVER_DONE = 145; + {$EXTERNALSYM SSL_F_SSL3_GET_SERVER_HELLO} + SSL_F_SSL3_GET_SERVER_HELLO = 146; + {$EXTERNALSYM SSL_F_SSL3_HANDSHAKE_MAC} + SSL_F_SSL3_HANDSHAKE_MAC = 285; + {$EXTERNALSYM SSL_F_SSL3_NEW_SESSION_TICKET} + SSL_F_SSL3_NEW_SESSION_TICKET = 287; //was 284; + {$EXTERNALSYM SSL_F_SSL3_OUTPUT_CERT_CHAIN} + SSL_F_SSL3_OUTPUT_CERT_CHAIN = 147; + {$EXTERNALSYM SSL_F_SSL3_READ_BYTES} + SSL_F_SSL3_READ_BYTES = 148; + {$EXTERNALSYM SSL_F_SSL3_READ_N} + SSL_F_SSL3_READ_N = 149; + {$EXTERNALSYM SSL_F_SSL3_SEND_CERTIFICATE_REQUEST} + SSL_F_SSL3_SEND_CERTIFICATE_REQUEST = 150; + {$EXTERNALSYM SSL_F_SSL3_SEND_CLIENT_CERTIFICATE} + SSL_F_SSL3_SEND_CLIENT_CERTIFICATE = 151; + {$EXTERNALSYM SSL_F_SSL3_SEND_CLIENT_KEY_EXCHANGE} + SSL_F_SSL3_SEND_CLIENT_KEY_EXCHANGE = 152; + {$EXTERNALSYM SSL_F_SSL3_SEND_CLIENT_VERIFY} + SSL_F_SSL3_SEND_CLIENT_VERIFY = 153; + {$EXTERNALSYM SSL_F_SSL3_SEND_SERVER_CERTIFICATE} + SSL_F_SSL3_SEND_SERVER_CERTIFICATE = 154; + {$EXTERNALSYM SSL_F_SSL3_SEND_SERVER_KEY_EXCHANGE} + SSL_F_SSL3_SEND_SERVER_KEY_EXCHANGE = 155; + {$EXTERNALSYM SSL_F_SSL3_SETUP_KEY_BLOCK} + SSL_F_SSL3_SETUP_KEY_BLOCK = 157; + {$EXTERNALSYM SSL_F_SSL3_SETUP_READ_BUFFER} + SSL_F_SSL3_SETUP_READ_BUFFER = 156; + {$EXTERNALSYM SSL_F_SSL3_SETUP_WRITE_BUFFER} + SSL_F_SSL3_SETUP_WRITE_BUFFER = 291; + {$EXTERNALSYM SSL_F_SSL3_WRITE_BYTES} + SSL_F_SSL3_WRITE_BYTES = 158; + {$EXTERNALSYM SSL_F_SSL3_WRITE_PENDING} + SSL_F_SSL3_WRITE_PENDING = 159; + {$EXTERNALSYM SSL_F_SSL_ADD_CLIENTHELLO_RENEGOTIATE_EXT} + SSL_F_SSL_ADD_CLIENTHELLO_RENEGOTIATE_EXT = 298;//was 285; + {$EXTERNALSYM SSL_F_SSL_ADD_CLIENTHELLO_TLSEXT} + SSL_F_SSL_ADD_CLIENTHELLO_TLSEXT = 277; //was 272; + {$EXTERNALSYM SSL_F_SSL_ADD_CLIENTHELLO_USE_SRTP_EXT} + SSL_F_SSL_ADD_CLIENTHELLO_USE_SRTP_EXT = 307; + {$EXTERNALSYM SSL_F_SSL_ADD_DIR_CERT_SUBJECTS_TO_STACK} + SSL_F_SSL_ADD_DIR_CERT_SUBJECTS_TO_STACK = 215; + {$EXTERNALSYM SSL_F_SSL_ADD_FILE_CERT_SUBJECTS_TO_STACK} + SSL_F_SSL_ADD_FILE_CERT_SUBJECTS_TO_STACK = 216; + {$EXTERNALSYM SSL_F_SSL_ADD_SERVERHELLO_RENEGOTIATE_EXT} + SSL_F_SSL_ADD_SERVERHELLO_RENEGOTIATE_EXT = 299;//was 286; + {$EXTERNALSYM SSL_F_SSL_ADD_SERVERHELLO_TLSEXT} + SSL_F_SSL_ADD_SERVERHELLO_TLSEXT = 278; //was 273; + {$EXTERNALSYM SSL_F_SSL_ADD_SERVERHELLO_USE_SRTP_EXT} + SSL_F_SSL_ADD_SERVERHELLO_USE_SRTP_EXT = 308; + {$EXTERNALSYM SSL_F_SSL_BAD_METHOD} + SSL_F_SSL_BAD_METHOD = 160; + {$EXTERNALSYM SSL_F_SSL_BYTES_TO_CIPHER_LIST} + SSL_F_SSL_BYTES_TO_CIPHER_LIST = 161; + {$EXTERNALSYM SSL_F_SSL_CERT_DUP} + SSL_F_SSL_CERT_DUP = 221; + {$EXTERNALSYM SSL_F_SSL_CERT_INST} + SSL_F_SSL_CERT_INST = 222; + {$EXTERNALSYM SSL_F_SSL_CERT_INSTANTIATE} + SSL_F_SSL_CERT_INSTANTIATE = 214; + {$EXTERNALSYM SSL_F_SSL_CERT_NEW} + SSL_F_SSL_CERT_NEW = 162; + {$EXTERNALSYM SSL_F_SSL_CHECK_PRIVATE_KEY} + SSL_F_SSL_CHECK_PRIVATE_KEY = 163; + {$EXTERNALSYM SSL_F_SSL_CHECK_SERVERHELLO_TLSEXT} + SSL_F_SSL_CHECK_SERVERHELLO_TLSEXT = 280;//was 274; + {$EXTERNALSYM SSL_F_SSL_CHECK_SRVR_ECC_CERT_AND_ALG} + SSL_F_SSL_CHECK_SRVR_ECC_CERT_AND_ALG = 279; + {$EXTERNALSYM SSL_F_SSL_CIPHER_PROCESS_RULESTR} + SSL_F_SSL_CIPHER_PROCESS_RULESTR = 230; + {$EXTERNALSYM SSL_F_SSL_CIPHER_STRENGTH_SORT} + SSL_F_SSL_CIPHER_STRENGTH_SORT = 231; + {$EXTERNALSYM SSL_F_SSL_CLEAR} + SSL_F_SSL_CLEAR = 164; + {$EXTERNALSYM SSL_F_SSL_COMP_ADD_COMPRESSION_METHOD} + SSL_F_SSL_COMP_ADD_COMPRESSION_METHOD = 165; + {$EXTERNALSYM SSL_F_SSL_CREATE_CIPHER_LIST} + SSL_F_SSL_CREATE_CIPHER_LIST = 166; + {$EXTERNALSYM SSL_F_SSL_CTRL} + SSL_F_SSL_CTRL = 232; + {$EXTERNALSYM SSL_F_SSL_CTX_CHECK_PRIVATE_KEY} + SSL_F_SSL_CTX_CHECK_PRIVATE_KEY = 168; + {$EXTERNALSYM SSL_F_SSL_CTX_MAKE_PROFILES} + SSL_F_SSL_CTX_MAKE_PROFILES = 309; + {$EXTERNALSYM SSL_F_SSL_CTX_NEW} + SSL_F_SSL_CTX_NEW = 169; + {$EXTERNALSYM SSL_F_SSL_CTX_SET_CIPHER_LIST} + SSL_F_SSL_CTX_SET_CIPHER_LIST = 269; + {$EXTERNALSYM SSL_F_SSL_CTX_SET_CLIENT_CERT_ENGINE} + SSL_F_SSL_CTX_SET_CLIENT_CERT_ENGINE = 290; //was 278; + {$EXTERNALSYM SSL_F_SSL_CTX_SET_PURPOSE} + SSL_F_SSL_CTX_SET_PURPOSE = 226; + {$EXTERNALSYM SSL_F_SSL_CTX_SET_SESSION_ID_CONTEXT} + SSL_F_SSL_CTX_SET_SESSION_ID_CONTEXT = 219; + {$EXTERNALSYM SSL_F_SSL_CTX_SET_SSL_VERSION} + SSL_F_SSL_CTX_SET_SSL_VERSION = 170; + {$EXTERNALSYM SSL_F_SSL_CTX_SET_TRUST} + SSL_F_SSL_CTX_SET_TRUST = 229; + {$EXTERNALSYM SSL_F_SSL_CTX_USE_CERTIFICATE} + SSL_F_SSL_CTX_USE_CERTIFICATE = 171; + {$EXTERNALSYM SSL_F_SSL_CTX_USE_CERTIFICATE_ASN1} + SSL_F_SSL_CTX_USE_CERTIFICATE_ASN1 = 172; + {$EXTERNALSYM SSL_F_SSL_CTX_USE_CERTIFICATE_CHAIN_FILE} + SSL_F_SSL_CTX_USE_CERTIFICATE_CHAIN_FILE = 220; + {$EXTERNALSYM SSL_F_SSL_CTX_USE_CERTIFICATE_FILE} + SSL_F_SSL_CTX_USE_CERTIFICATE_FILE = 173; + {$EXTERNALSYM SSL_F_SSL_CTX_USE_PRIVATEKEY} + SSL_F_SSL_CTX_USE_PRIVATEKEY = 174; + {$EXTERNALSYM SSL_F_SSL_CTX_USE_PRIVATEKEY_ASN1} + SSL_F_SSL_CTX_USE_PRIVATEKEY_ASN1 = 175; + {$EXTERNALSYM SSL_F_SSL_CTX_USE_PRIVATEKEY_FILE} + SSL_F_SSL_CTX_USE_PRIVATEKEY_FILE = 176; + {$EXTERNALSYM SSL_F_SSL_CTX_USE_PSK_IDENTITY_HINT} + SSL_F_SSL_CTX_USE_PSK_IDENTITY_HINT = 272; + {$EXTERNALSYM SSL_F_SSL_CTX_USE_RSAPRIVATEKEY} + SSL_F_SSL_CTX_USE_RSAPRIVATEKEY = 177; + {$EXTERNALSYM SSL_F_SSL_CTX_USE_RSAPRIVATEKEY_ASN1} + SSL_F_SSL_CTX_USE_RSAPRIVATEKEY_ASN1 = 178; + {$EXTERNALSYM SSL_F_SSL_CTX_USE_RSAPRIVATEKEY_FILE} + SSL_F_SSL_CTX_USE_RSAPRIVATEKEY_FILE = 179; + {$EXTERNALSYM SSL_F_SSL_DO_HANDSHAKE} + SSL_F_SSL_DO_HANDSHAKE = 180; + {$EXTERNALSYM SSL_F_SSL_GET_NEW_SESSION} + SSL_F_SSL_GET_NEW_SESSION = 181; + {$EXTERNALSYM SSL_F_SSL_GET_PREV_SESSION} + SSL_F_SSL_GET_PREV_SESSION = 217; + {$EXTERNALSYM SSL_F_SSL_GET_SERVER_SEND_CERT} + SSL_F_SSL_GET_SERVER_SEND_CERT = 182; + {$EXTERNALSYM SSL_F_SSL_GET_SERVER_SEND_PKEY} + SSL_F_SSL_GET_SERVER_SEND_PKEY = 317; + {$EXTERNALSYM SSL_F_SSL_GET_SIGN_PKEY} + SSL_F_SSL_GET_SIGN_PKEY = 183; + {$EXTERNALSYM SSL_F_SSL_INIT_WBIO_BUFFER} + SSL_F_SSL_INIT_WBIO_BUFFER = 184; + {$EXTERNALSYM SSL_F_SSL_LOAD_CLIENT_CA_FILE} + SSL_F_SSL_LOAD_CLIENT_CA_FILE = 185; + {$EXTERNALSYM SSL_F_SSL_NEW} + SSL_F_SSL_NEW = 186; + {$EXTERNALSYM SSL_F_SSL_PARSE_CLIENTHELLO_RENEGOTIATE_EXT} + SSL_F_SSL_PARSE_CLIENTHELLO_RENEGOTIATE_EXT = 300; //was 287; + {$EXTERNALSYM SSL_F_SSL_PARSE_CLIENTHELLO_TLSEXT} + SSL_F_SSL_PARSE_CLIENTHELLO_TLSEXT = 302; //was 290; + {$EXTERNALSYM SSL_F_SSL_PARSE_CLIENTHELLO_USE_SRTP_EXT} + SSL_F_SSL_PARSE_CLIENTHELLO_USE_SRTP_EXT = 310; + {$EXTERNALSYM SSL_F_SSL_PARSE_SERVERHELLO_RENEGOTIATE_EXT} + SSL_F_SSL_PARSE_SERVERHELLO_RENEGOTIATE_EXT = 301;//was 289; + {$EXTERNALSYM SSL_F_SSL_PARSE_SERVERHELLO_TLSEXT} + SSL_F_SSL_PARSE_SERVERHELLO_TLSEXT = 303; //was 291; + {$EXTERNALSYM SSL_F_SSL_PARSE_SERVERHELLO_USE_SRTP_EXT} + SSL_F_SSL_PARSE_SERVERHELLO_USE_SRTP_EXT = 311; + {$EXTERNALSYM SSL_F_SSL_PEEK} + SSL_F_SSL_PEEK = 270; + {$EXTERNALSYM SSL_F_SSL_PREPARE_CLIENTHELLO_TLSEXT} + SSL_F_SSL_PREPARE_CLIENTHELLO_TLSEXT = 281; //was 275; + {$EXTERNALSYM SSL_F_SSL_PREPARE_SERVERHELLO_TLSEXT} + SSL_F_SSL_PREPARE_SERVERHELLO_TLSEXT = 282;//was 276; + {$EXTERNALSYM SSL_F_SSL_READ} + SSL_F_SSL_READ = 223; + {$EXTERNALSYM SSL_F_SSL_RSA_PRIVATE_DECRYPT} + SSL_F_SSL_RSA_PRIVATE_DECRYPT = 187; + {$EXTERNALSYM SSL_F_SSL_RSA_PUBLIC_ENCRYPT} + SSL_F_SSL_RSA_PUBLIC_ENCRYPT = 188; + {$EXTERNALSYM SSL_F_SSL_SESSION_NEW} + SSL_F_SSL_SESSION_NEW = 189; + {$EXTERNALSYM SSL_F_SSL_SESSION_PRINT_FP} + SSL_F_SSL_SESSION_PRINT_FP = 190; + {$EXTERNALSYM SSL_F_SSL_SESSION_SET1_ID_CONTEXT} + SSL_F_SSL_SESSION_SET1_ID_CONTEXT = 312; + {$EXTERNALSYM SSL_F_SSL_SESS_CERT_NEW} + SSL_F_SSL_SESS_CERT_NEW = 225; + {$EXTERNALSYM SSL_F_SSL_SET_CERT} + SSL_F_SSL_SET_CERT = 191; + {$EXTERNALSYM SSL_F_SSL_SET_FD} + SSL_F_SSL_SET_FD = 192; + {$EXTERNALSYM SSL_F_SSL_SET_PKEY} + SSL_F_SSL_SET_PKEY = 193; + {$EXTERNALSYM SSL_F_SSL_SET_RFD} + SSL_F_SSL_SET_RFD = 194; + {$EXTERNALSYM SSL_F_SSL_SET_SESSION} + SSL_F_SSL_SET_SESSION = 195; + {$EXTERNALSYM SSL_F_SSL_SET_SESSION_ID_CONTEXT} + SSL_F_SSL_SET_SESSION_ID_CONTEXT = 218; + {$EXTERNALSYM SSL_F_SSL_SET_SESSION_TICKET_EXT} + SSL_F_SSL_SET_SESSION_TICKET_EXT = 294; + {$EXTERNALSYM SSL_F_SSL_SET_WFD} + SSL_F_SSL_SET_WFD = 196; + {$EXTERNALSYM SSL_F_SSL_SHUTDOWN} + SSL_F_SSL_SHUTDOWN = 224; + {$EXTERNALSYM SSL_F_SSL_SRP_CTX_INIT} + SSL_F_SSL_SRP_CTX_INIT = 313; + {$EXTERNALSYM SSL_F_SSL_UNDEFINED_FUNCTION} + SSL_F_SSL_UNDEFINED_FUNCTION = 197; + {$EXTERNALSYM SSL_F_SSL_USE_CERTIFICATE} + SSL_F_SSL_USE_CERTIFICATE = 198; + {$EXTERNALSYM SSL_F_SSL_USE_CERTIFICATE_ASN1} + SSL_F_SSL_USE_CERTIFICATE_ASN1 = 199; + {$EXTERNALSYM SSL_F_SSL_USE_CERTIFICATE_FILE} + SSL_F_SSL_USE_CERTIFICATE_FILE = 200; + {$EXTERNALSYM SSL_F_SSL_USE_PRIVATEKEY} + SSL_F_SSL_USE_PRIVATEKEY = 201; + {$EXTERNALSYM SSL_F_SSL_USE_PRIVATEKEY_ASN1} + SSL_F_SSL_USE_PRIVATEKEY_ASN1 = 202; + {$EXTERNALSYM SSL_F_SSL_USE_PRIVATEKEY_FILE} + SSL_F_SSL_USE_PRIVATEKEY_FILE = 203; + {$EXTERNALSYM SSL_F_SSL_USE_PSK_IDENTITY_HINT} + SSL_F_SSL_USE_PSK_IDENTITY_HINT = 273; + {$EXTERNALSYM SSL_F_SSL_USE_RSAPRIVATEKEY} + SSL_F_SSL_USE_RSAPRIVATEKEY = 204; + {$EXTERNALSYM SSL_F_SSL_USE_RSAPRIVATEKEY_ASN1} + SSL_F_SSL_USE_RSAPRIVATEKEY_ASN1 = 205; + {$EXTERNALSYM SSL_F_SSL_USE_RSAPRIVATEKEY_FILE} + SSL_F_SSL_USE_RSAPRIVATEKEY_FILE = 206; + {$EXTERNALSYM SSL_F_SSL_VERIFY_CERT_CHAIN} + SSL_F_SSL_VERIFY_CERT_CHAIN = 207; + {$EXTERNALSYM SSL_F_SSL_WRITE} + SSL_F_SSL_WRITE = 208; + {$EXTERNALSYM SSL_F_TLS1_CERT_VERIFY_MAC} + SSL_F_TLS1_CERT_VERIFY_MAC = 286; + {$EXTERNALSYM SSL_F_TLS1_CHANGE_CIPHER_STATE} + SSL_F_TLS1_CHANGE_CIPHER_STATE = 209; + {$EXTERNALSYM SSL_F_TLS1_CHECK_SERVERHELLO_TLSEXT} + SSL_F_TLS1_CHECK_SERVERHELLO_TLSEXT = 274; + {$EXTERNALSYM SSL_F_TLS1_ENC} + SSL_F_TLS1_ENC = 210; + {$EXTERNALSYM SSL_F_TLS1_EXPORT_KEYING_MATERIAL} + SSL_F_TLS1_EXPORT_KEYING_MATERIAL = 314; + {$EXTERNALSYM SSL_F_TLS1_HEARTBEAT} + SSL_F_TLS1_HEARTBEAT = 315; + {$EXTERNALSYM SSL_F_TLS1_PREPARE_CLIENTHELLO_TLSEXT} + SSL_F_TLS1_PREPARE_CLIENTHELLO_TLSEXT = 275; + {$EXTERNALSYM SSL_F_TLS1_PREPARE_SERVERHELLO_TLSEXT} + SSL_F_TLS1_PREPARE_SERVERHELLO_TLSEXT = 276; + {$EXTERNALSYM SSL_F_TLS1_PRF} + SSL_F_TLS1_PRF = 284; + {$EXTERNALSYM SSL_F_TLS1_SETUP_KEY_BLOCK} + SSL_F_TLS1_SETUP_KEY_BLOCK = 211; + {$EXTERNALSYM SSL_F_WRITE_PENDING} + SSL_F_WRITE_PENDING = 212; + {$EXTERNALSYM SSL_MAX_KEY_ARG_LENGTH} + SSL_MAX_KEY_ARG_LENGTH = 8; + {$EXTERNALSYM SSL_MAX_MASTER_KEY_LENGTH} + SSL_MAX_MASTER_KEY_LENGTH = 48; + {$EXTERNALSYM SSL_MAX_SID_CTX_LENGTH} + SSL_MAX_SID_CTX_LENGTH = 32; + {$EXTERNALSYM SSL_MAX_KRB5_PRINCIPAL_LENGTH} + SSL_MAX_KRB5_PRINCIPAL_LENGTH = 256; + {$EXTERNALSYM SSL_MAX_SSL_SESSION_ID_LENGTH} + SSL_MAX_SSL_SESSION_ID_LENGTH = 32; + {$EXTERNALSYM SSL_MODE_ENABLE_PARTIAL_WRITE} + SSL_MODE_ENABLE_PARTIAL_WRITE = $00000001; + {$EXTERNALSYM SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER} + SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER = $00000002; + {$EXTERNALSYM SSL_MODE_AUTO_RETRY} + SSL_MODE_AUTO_RETRY = $00000004; + {$EXTERNALSYM SSL_MODE_NO_AUTO_CHAIN} + SSL_MODE_NO_AUTO_CHAIN = $00000008; +///* Save RAM by releasing read and write buffers when they're empty. (SSL3 and +// * TLS only.) "Released" buffers are put onto a free-list in the context +// * or just freed (depending on the context's setting for freelist_max_len). */ + {$EXTERNALSYM SSL_MODE_RELEASE_BUFFERS} + SSL_MODE_RELEASE_BUFFERS = $00000010; + {$IFDEF OPENSSL_NO_BUF_FREELISTS} + {$EXTERNALSYM SSL_MAX_BUF_FREELIST_LEN_DEFAULT} + SSL_MAX_BUF_FREELIST_LEN_DEFAULT = 32; + {$ENDIF} + {$EXTERNALSYM SSL_NOTHING} + SSL_NOTHING = 1; + {$EXTERNALSYM SSL_WRITING} + SSL_WRITING = 2; + {$EXTERNALSYM SSL_READING} + SSL_READING = 3; + {$EXTERNALSYM SSL_X509_LOOKUP} + SSL_X509_LOOKUP = 4; + {$EXTERNALSYM SSL_OP_MICROSOFT_SESS_ID_BUG} + SSL_OP_MICROSOFT_SESS_ID_BUG = $00000001; + {$EXTERNALSYM SSL_OP_NETSCAPE_CHALLENGE_BUG} + SSL_OP_NETSCAPE_CHALLENGE_BUG = $00000002; +//* Allow initial connection to servers that don't support RI */ + {$EXTERNALSYM SSL_OP_LEGACY_SERVER_CONNECT} + SSL_OP_LEGACY_SERVER_CONNECT = $00000004; + + {$EXTERNALSYM SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG} + SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG = $00000008; + {$EXTERNALSYM SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG} + SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG = $00000010; + {$EXTERNALSYM SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER} + SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER = $00000020; + {$EXTERNALSYM SSL_OP_MSIE_SSLV2_RSA_PADDING} + SSL_OP_MSIE_SSLV2_RSA_PADDING = $00000040; + {$EXTERNALSYM SSL_OP_SSLEAY_080_CLIENT_DH_BUG} + SSL_OP_SSLEAY_080_CLIENT_DH_BUG = $00000080; + {$EXTERNALSYM SSL_OP_TLS_D5_BUG} + SSL_OP_TLS_D5_BUG = $00000100; + {$EXTERNALSYM SSL_OP_TLS_BLOCK_PADDING_BUG} + SSL_OP_TLS_BLOCK_PADDING_BUG = $00000200; + {$EXTERNALSYM SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS} + SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS = $00000800; + {$EXTERNALSYM SSL_OP_ALL} + SSL_OP_ALL = $00000FFF; //this was $000FFFFF; before 0.9.7 + {$EXTERNALSYM SSL_OP_NO_QUERY_MTU} + SSL_OP_NO_QUERY_MTU = $00001000; + {$EXTERNALSYM SSL_OP_COOKIE_EXCHANGE} + SSL_OP_COOKIE_EXCHANGE = $00002000; + {$EXTERNALSYM SSL_OP_NO_TICKET} + SSL_OP_NO_TICKET = $00004000; +//* Use Cisco's "speshul" version of DTLS_BAD_VER (as client) */ + {$EXTERNALSYM SSL_OP_CISCO_ANYCONNECT} + SSL_OP_CISCO_ANYCONNECT = $00008000; + {$EXTERNALSYM SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION} + SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION = $00010000; +//* Don't use compression even if supported */ + {$EXTERNALSYM SSL_OP_NO_COMPRESSION} + SSL_OP_NO_COMPRESSION = $00020000; +//* Permit unsafe legacy renegotiation */ + {$EXTERNALSYM SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION} + SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION = $00040000; + + {$EXTERNALSYM SSL_OP_SINGLE_ECDH_USE} + SSL_OP_SINGLE_ECDH_USE = $00080000; + {$EXTERNALSYM SSL_OP_SINGLE_DH_USE} + SSL_OP_SINGLE_DH_USE = $00100000; + {$EXTERNALSYM SSL_OP_EPHEMERAL_RSA} + SSL_OP_EPHEMERAL_RSA = $00200000; + {$EXTERNALSYM SSL_OP_CIPHER_SERVER_PREFERENCE} + SSL_OP_CIPHER_SERVER_PREFERENCE = $00400000; + {$EXTERNALSYM SSL_OP_TLS_ROLLBACK_BUG} + SSL_OP_TLS_ROLLBACK_BUG = $00800000; //was $00000400; + {$EXTERNALSYM SSL_OP_NO_SSLv2} + SSL_OP_NO_SSLv2 = $01000000; + {$EXTERNALSYM SSL_OP_NO_SSLv3} + SSL_OP_NO_SSLv3 = $02000000; + {$EXTERNALSYM SSL_OP_NO_TLSv1} + SSL_OP_NO_TLSv1 = $04000000; + {$EXTERNALSYM SSL_OP_NO_TLSv1_2} + SSL_OP_NO_TLSv1_2 = $08000000; + {$EXTERNALSYM SSL_OP_NO_TLSv1_1} + SSL_OP_NO_TLSv1_1 = $10000000; + {$EXTERNALSYM SSL_OP_PKCS1_CHECK_1} + SSL_OP_PKCS1_CHECK_1 = $00; //was $08000000; + {$EXTERNALSYM SSL_OP_PKCS1_CHECK_2} + SSL_OP_PKCS1_CHECK_2 = $00; //was $10000000; + + {$EXTERNALSYM SSL_OP_NETSCAPE_CA_DN_BUG} + SSL_OP_NETSCAPE_CA_DN_BUG = $20000000; + //OPENSSL_SSL_OP_NON_EXPORT_FIRST was removed for OpenSSL 0.9.7 (that was $40000000;) + {$EXTERNALSYM SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG} + SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG = $40000000;// was $80000000; +//* Make server add server-hello extension from early version of +// * cryptopro draft, when GOST ciphersuite is negotiated. +// * Required for interoperability with CryptoPro CSP 3.x +// */ + {$EXTERNALSYM SSL_OP_CRYPTOPRO_TLSEXT_BUG} + SSL_OP_CRYPTOPRO_TLSEXT_BUG = $80000000; + + {$EXTERNALSYM SSL_RECEIVED_SHUTDOWN} + SSL_RECEIVED_SHUTDOWN = 2; + {$EXTERNALSYM SSL_R_APP_DATA_IN_HANDSHAKE} + SSL_R_APP_DATA_IN_HANDSHAKE = 100; + {$EXTERNALSYM SSL_R_ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT} + SSL_R_ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT = 272; + {$EXTERNALSYM SSL_R_BAD_ALERT_RECORD} + SSL_R_BAD_ALERT_RECORD = 101; + {$EXTERNALSYM SSL_R_BAD_AUTHENTICATION_TYPE} + SSL_R_BAD_AUTHENTICATION_TYPE = 102; + {$EXTERNALSYM SSL_R_BAD_CHANGE_CIPHER_SPEC} + SSL_R_BAD_CHANGE_CIPHER_SPEC = 103; + {$EXTERNALSYM SSL_R_BAD_CHECKSUM} + SSL_R_BAD_CHECKSUM = 104; + {$EXTERNALSYM SSL_R_BAD_CLIENT_REQUEST} + SSL_R_BAD_CLIENT_REQUEST = 105; + {$EXTERNALSYM SSL_R_BAD_DATA_RETURNED_BY_CALLBACK} + SSL_R_BAD_DATA_RETURNED_BY_CALLBACK = 106; + {$EXTERNALSYM SSL_R_BAD_DECOMPRESSION} + SSL_R_BAD_DECOMPRESSION = 107; + {$EXTERNALSYM SSL_R_BAD_DH_G_LENGTH} + SSL_R_BAD_DH_G_LENGTH = 108; + {$EXTERNALSYM SSL_R_BAD_DH_PUB_KEY_LENGTH} + SSL_R_BAD_DH_PUB_KEY_LENGTH = 109; + {$EXTERNALSYM SSL_R_BAD_DH_P_LENGTH} + SSL_R_BAD_DH_P_LENGTH = 110; + {$EXTERNALSYM SSL_R_BAD_DIGEST_LENGTH} + SSL_R_BAD_DIGEST_LENGTH = 111; + {$EXTERNALSYM SSL_R_BAD_DSA_SIGNATURE} + SSL_R_BAD_DSA_SIGNATURE = 112; + {$EXTERNALSYM SSL_R_BAD_ECC_CERT} + SSL_R_BAD_ECC_CERT = 304; + {$EXTERNALSYM SSL_R_BAD_ECDSA_SIGNATURE} + SSL_R_BAD_ECDSA_SIGNATURE = 305; + {$EXTERNALSYM SSL_R_BAD_ECPOINT} + SSL_R_BAD_ECPOINT = 306; + {$EXTERNALSYM SSL_R_BAD_HANDSHAKE_LENGTH} + SSL_R_BAD_HANDSHAKE_LENGTH = 332; + {$EXTERNALSYM SSL_R_BAD_HELLO_REQUEST} + SSL_R_BAD_HELLO_REQUEST = 105; + {$EXTERNALSYM SSL_R_BAD_LENGTH} + SSL_R_BAD_LENGTH = 271; + {$EXTERNALSYM SSL_R_BAD_MAC_DECODE} + SSL_R_BAD_MAC_DECODE = 113; + {$EXTERNALSYM SSL_R_BAD_MAC_LENGTH} + SSL_R_BAD_MAC_LENGTH = 333; + {$EXTERNALSYM SSL_R_BAD_MESSAGE_TYPE} + SSL_R_BAD_MESSAGE_TYPE = 114; + {$EXTERNALSYM SSL_R_BAD_PACKET_LENGTH} + SSL_R_BAD_PACKET_LENGTH = 115; + {$EXTERNALSYM SSL_R_BAD_PROTOCOL_VERSION_NUMBER} + SSL_R_BAD_PROTOCOL_VERSION_NUMBER = 116; + {$EXTERNALSYM SSL_R_BAD_PSK_IDENTITY_HINT_LENGTH} + SSL_R_BAD_PSK_IDENTITY_HINT_LENGTH = 316; + {$EXTERNALSYM SSL_R_BAD_RESPONSE_ARGUMENT} + SSL_R_BAD_RESPONSE_ARGUMENT = 117; + {$EXTERNALSYM SSL_R_BAD_RSA_DECRYPT} + SSL_R_BAD_RSA_DECRYPT = 118; + {$EXTERNALSYM SSL_R_BAD_RSA_ENCRYPT} + SSL_R_BAD_RSA_ENCRYPT = 119; + {$EXTERNALSYM SSL_R_BAD_RSA_E_LENGTH} + SSL_R_BAD_RSA_E_LENGTH = 120; + {$EXTERNALSYM SSL_R_BAD_RSA_MODULUS_LENGTH} + SSL_R_BAD_RSA_MODULUS_LENGTH = 121; + {$EXTERNALSYM SSL_R_BAD_RSA_SIGNATURE} + SSL_R_BAD_RSA_SIGNATURE = 122; + {$EXTERNALSYM SSL_R_BAD_SIGNATURE} + SSL_R_BAD_SIGNATURE = 123; + {$EXTERNALSYM SSL_R_BAD_SRP_A_LENGTH} + SSL_R_BAD_SRP_A_LENGTH = 347; + {$EXTERNALSYM SSL_R_BAD_SRP_B_LENGTH} + SSL_R_BAD_SRP_B_LENGTH = 348; + {$EXTERNALSYM SSL_R_BAD_SRP_G_LENGTH} + SSL_R_BAD_SRP_G_LENGTH = 349; + {$EXTERNALSYM SSL_R_BAD_SRP_N_LENGTH} + SSL_R_BAD_SRP_N_LENGTH = 350; + {$EXTERNALSYM SSL_R_BAD_SRP_S_LENGTH} + SSL_R_BAD_SRP_S_LENGTH = 351; + {$EXTERNALSYM SSL_R_BAD_SRTP_MKI_VALUE} + SSL_R_BAD_SRTP_MKI_VALUE = 352; + {$EXTERNALSYM SSL_R_BAD_SRTP_PROTECTION_PROFILE_LIST} + SSL_R_BAD_SRTP_PROTECTION_PROFILE_LIST = 353; + + {$EXTERNALSYM SSL_R_BAD_SSL_FILETYPE} + SSL_R_BAD_SSL_FILETYPE = 124; + {$EXTERNALSYM SSL_R_BAD_SSL_SESSION_ID_LENGTH} + SSL_R_BAD_SSL_SESSION_ID_LENGTH = 125; + {$EXTERNALSYM SSL_R_BAD_STATE} + SSL_R_BAD_STATE = 126; + {$EXTERNALSYM SSL_R_BAD_WRITE_RETRY} + SSL_R_BAD_WRITE_RETRY = 127; + {$EXTERNALSYM SSL_R_BIO_NOT_SET} + SSL_R_BIO_NOT_SET = 128; + {$EXTERNALSYM SSL_R_BLOCK_CIPHER_PAD_IS_WRONG} + SSL_R_BLOCK_CIPHER_PAD_IS_WRONG = 129; + {$EXTERNALSYM SSL_R_BN_LIB} + SSL_R_BN_LIB = 130; + {$EXTERNALSYM SSL_R_CA_DN_LENGTH_MISMATCH} + SSL_R_CA_DN_LENGTH_MISMATCH = 131; + {$EXTERNALSYM SSL_R_CA_DN_TOO_LONG} + SSL_R_CA_DN_TOO_LONG = 132; + {$EXTERNALSYM SSL_R_CCS_RECEIVED_EARLY} + SSL_R_CCS_RECEIVED_EARLY = 133; + {$EXTERNALSYM SSL_R_CERTIFICATE_VERIFY_FAILED} + SSL_R_CERTIFICATE_VERIFY_FAILED = 134; + {$EXTERNALSYM SSL_R_CERT_LENGTH_MISMATCH} + SSL_R_CERT_LENGTH_MISMATCH = 135; + {$EXTERNALSYM SSL_R_CHALLENGE_IS_DIFFERENT} + SSL_R_CHALLENGE_IS_DIFFERENT = 136; + {$EXTERNALSYM SSL_R_CIPHER_CODE_WRONG_LENGTH} + SSL_R_CIPHER_CODE_WRONG_LENGTH = 137; + {$EXTERNALSYM SSL_R_CIPHER_OR_HASH_UNAVAILABLE} + SSL_R_CIPHER_OR_HASH_UNAVAILABLE = 138; + {$EXTERNALSYM SSL_R_CIPHER_TABLE_SRC_ERROR} + SSL_R_CIPHER_TABLE_SRC_ERROR = 139; + {$EXTERNALSYM SSL_R_CLIENTHELLO_TLSEXT} + SSL_R_CLIENTHELLO_TLSEXT = 226; //was 157; + {$EXTERNALSYM SSL_R_COMPRESSED_LENGTH_TOO_LONG} + SSL_R_COMPRESSED_LENGTH_TOO_LONG = 140; + {$EXTERNALSYM SSL_R_COMPRESSION_DISABLED} + SSL_R_COMPRESSION_DISABLED = 343; + {$EXTERNALSYM SSL_R_COMPRESSION_FAILURE} + SSL_R_COMPRESSION_FAILURE = 141; + {$EXTERNALSYM SSL_R_COMPRESSION_LIBRARY_ERROR} + SSL_R_COMPRESSION_LIBRARY_ERROR = 142; + {$EXTERNALSYM SSL_R_CONNECTION_ID_IS_DIFFERENT} + SSL_R_CONNECTION_ID_IS_DIFFERENT = 143; + {$EXTERNALSYM SSL_R_CONNECTION_TYPE_NOT_SET} + SSL_R_CONNECTION_TYPE_NOT_SET = 144; + {$EXTERNALSYM SSL_R_DATA_BETWEEN_CCS_AND_FINISHED} + SSL_R_DATA_BETWEEN_CCS_AND_FINISHED = 145; + {$EXTERNALSYM SSL_R_DATA_LENGTH_TOO_LONG} + SSL_R_DATA_LENGTH_TOO_LONG = 146; + {$EXTERNALSYM SSL_R_DECRYPTION_FAILED} + SSL_R_DECRYPTION_FAILED = 147; + {$EXTERNALSYM SSL_R_DH_PUBLIC_VALUE_LENGTH_IS_WRONG} + SSL_R_DH_PUBLIC_VALUE_LENGTH_IS_WRONG = 148; + {$EXTERNALSYM SSL_R_DIGEST_CHECK_FAILED} + SSL_R_DIGEST_CHECK_FAILED = 149; + {$EXTERNALSYM SSL_R_DTLS_MESSAGE_TOO_BIG} + SSL_R_DTLS_MESSAGE_TOO_BIG = 334; //was 318; + {$EXTERNALSYM SSL_R_ECC_CERT_NOT_FOR_KEY_AGREEMENT} + SSL_R_ECC_CERT_NOT_FOR_KEY_AGREEMENT = 317; + {$EXTERNALSYM SSL_R_ECC_CERT_NOT_FOR_SIGNING} + SSL_R_ECC_CERT_NOT_FOR_SIGNING = 318; + {$EXTERNALSYM SSL_R_ECC_CERT_SHOULD_HAVE_RSA_SIGNATURE} + SSL_R_ECC_CERT_SHOULD_HAVE_RSA_SIGNATURE = 322; + {$EXTERNALSYM SSL_R_ECC_CERT_SHOULD_HAVE_SHA1_SIGNATURE} + SSL_R_ECC_CERT_SHOULD_HAVE_SHA1_SIGNATURE = 323; + {$EXTERNALSYM SSL_R_ECGROUP_TOO_LARGE_FOR_CIPHER} + SSL_R_ECGROUP_TOO_LARGE_FOR_CIPHER = 310; + {$EXTERNALSYM SSL_R_EMPTY_SRTP_PROTECTION_PROFILE_LIST} + SSL_R_EMPTY_SRTP_PROTECTION_PROFILE_LIST = 354; + {$EXTERNALSYM SSL_R_ENCRYPTED_LENGTH_TOO_LONG} + SSL_R_ENCRYPTED_LENGTH_TOO_LONG = 150; + {$EXTERNALSYM SSL_R_ERROR_IN_RECEIVED_CIPHER_LIST} + SSL_R_ERROR_IN_RECEIVED_CIPHER_LIST = 151; + {$EXTERNALSYM SSL_R_EXCESSIVE_MESSAGE_SIZE} + SSL_R_EXCESSIVE_MESSAGE_SIZE = 152; + {$EXTERNALSYM SSL_R_EXTRA_DATA_IN_MESSAGE} + SSL_R_EXTRA_DATA_IN_MESSAGE = 153; + {$EXTERNALSYM SSL_R_GOT_A_FIN_BEFORE_A_CCS} + SSL_R_GOT_A_FIN_BEFORE_A_CCS = 154; + {$EXTERNALSYM SSL_R_GOT_NEXT_PROTO_BEFORE_A_CCS} + SSL_R_GOT_NEXT_PROTO_BEFORE_A_CCS = 355; + {$EXTERNALSYM SSL_R_GOT_NEXT_PROTO_WITHOUT_EXTENSION} + SSL_R_GOT_NEXT_PROTO_WITHOUT_EXTENSION = 356; + {$EXTERNALSYM SSL_R_HTTPS_PROXY_REQUEST} + SSL_R_HTTPS_PROXY_REQUEST = 155; + {$EXTERNALSYM SSL_R_HTTP_REQUEST} + SSL_R_HTTP_REQUEST = 156; + {$EXTERNALSYM SSL_R_ILLEGAL_PADDING} + SSL_R_ILLEGAL_PADDING = 283; + {$EXTERNALSYM SSL_R_INCONSISTENT_COMPRESSION} + SSL_R_INCONSISTENT_COMPRESSION = 340; + {$EXTERNALSYM SSL_R_INTERNAL_ERROR} + SSL_R_INTERNAL_ERROR = 157; + {$EXTERNALSYM SSL_R_INVALID_CHALLENGE_LENGTH} + SSL_R_INVALID_CHALLENGE_LENGTH = 158; + {$EXTERNALSYM SSL_R_INVALID_COMMAND} + SSL_R_INVALID_COMMAND = 280; + {$EXTERNALSYM SSL_R_INVALID_PURPOSE} + SSL_R_INVALID_PURPOSE = 278; + {$EXTERNALSYM SSL_R_INVALID_STATUS_RESPONSE} + SSL_R_INVALID_STATUS_RESPONSE = 316; + {$EXTERNALSYM SSL_R_INVALID_TICKET_KEYS_LENGTH} + SSL_R_INVALID_TICKET_KEYS_LENGTH = 275; + {$EXTERNALSYM SSL_R_INVALID_TRUST} + SSL_R_INVALID_TRUST = 279; + {$EXTERNALSYM SSL_R_LENGTH_MISMATCH} + SSL_R_LENGTH_MISMATCH = 159; + {$EXTERNALSYM SSL_R_LENGTH_TOO_SHORT} + SSL_R_LENGTH_TOO_SHORT = 160; + {$EXTERNALSYM SSL_R_LIBRARY_BUG} + SSL_R_LIBRARY_BUG = 274; + {$EXTERNALSYM SSL_R_LIBRARY_HAS_NO_CIPHERS} + SSL_R_LIBRARY_HAS_NO_CIPHERS = 161; + {$EXTERNALSYM SSL_R_MISSING_DH_DSA_CERT} + SSL_R_MISSING_DH_DSA_CERT = 162; + {$EXTERNALSYM SSL_R_MISSING_DH_KEY} + SSL_R_MISSING_DH_KEY = 163; + {$EXTERNALSYM SSL_R_MISSING_DH_RSA_CERT} + SSL_R_MISSING_DH_RSA_CERT = 164; + {$EXTERNALSYM SSL_R_MISSING_DSA_SIGNING_CERT} + SSL_R_MISSING_DSA_SIGNING_CERT = 165; + {$EXTERNALSYM SSL_R_MISSING_EXPORT_TMP_DH_KEY} + SSL_R_MISSING_EXPORT_TMP_DH_KEY = 166; + {$EXTERNALSYM SSL_R_MISSING_EXPORT_TMP_RSA_KEY} + SSL_R_MISSING_EXPORT_TMP_RSA_KEY = 167; + {$EXTERNALSYM SSL_R_MISSING_RSA_CERTIFICATE} + SSL_R_MISSING_RSA_CERTIFICATE = 168; + {$EXTERNALSYM SSL_R_MISSING_RSA_ENCRYPTING_CERT} + SSL_R_MISSING_RSA_ENCRYPTING_CERT = 169; + {$EXTERNALSYM SSL_R_MISSING_RSA_SIGNING_CERT} + SSL_R_MISSING_RSA_SIGNING_CERT = 170; + {$EXTERNALSYM SSL_R_MISSING_TMP_DH_KEY} + SSL_R_MISSING_TMP_DH_KEY = 171; + {$EXTERNALSYM SSL_R_MISSING_TMP_RSA_KEY} + SSL_R_MISSING_TMP_RSA_KEY = 172; + {$EXTERNALSYM SSL_R_MISSING_TMP_RSA_PKEY} + SSL_R_MISSING_TMP_RSA_PKEY = 173; + {$EXTERNALSYM SSL_R_MISSING_VERIFY_MESSAGE} + SSL_R_MISSING_VERIFY_MESSAGE = 174; + {$EXTERNALSYM SSL_R_MULTIPLE_SGC_RESTARTS} + SSL_R_MULTIPLE_SGC_RESTARTS = 346; + {$EXTERNALSYM SSL_R_NON_SSLV2_INITIAL_PACKET} + SSL_R_NON_SSLV2_INITIAL_PACKET = 175; + {$EXTERNALSYM SSL_R_NO_CERTIFICATES_RETURNED} + SSL_R_NO_CERTIFICATES_RETURNED = 176; + {$EXTERNALSYM SSL_R_NO_CERTIFICATE_ASSIGNED} + SSL_R_NO_CERTIFICATE_ASSIGNED = 177; + {$EXTERNALSYM SSL_R_NO_CERTIFICATE_RETURNED} + SSL_R_NO_CERTIFICATE_RETURNED = 178; + {$EXTERNALSYM SSL_R_NO_CERTIFICATE_SET} + SSL_R_NO_CERTIFICATE_SET = 179; + {$EXTERNALSYM SSL_R_NO_CERTIFICATE_SPECIFIED} + SSL_R_NO_CERTIFICATE_SPECIFIED = 180; + {$EXTERNALSYM SSL_R_NO_CIPHERS_AVAILABLE} + SSL_R_NO_CIPHERS_AVAILABLE = 181; + {$EXTERNALSYM SSL_R_NO_CIPHERS_PASSED} + SSL_R_NO_CIPHERS_PASSED = 182; + {$EXTERNALSYM SSL_R_NO_CIPHERS_SPECIFIED} + SSL_R_NO_CIPHERS_SPECIFIED = 183; + {$EXTERNALSYM SSL_R_NO_CIPHER_LIST} + SSL_R_NO_CIPHER_LIST = 184; + {$EXTERNALSYM SSL_R_NO_CIPHER_MATCH} + SSL_R_NO_CIPHER_MATCH = 185; + {$EXTERNALSYM SSL_R_NO_CLIENT_CERT_METHOD} + SSL_R_NO_CLIENT_CERT_METHOD = 317; + {$EXTERNALSYM SSL_R_NO_CLIENT_CERT_RECEIVED} + SSL_R_NO_CLIENT_CERT_RECEIVED = 186; + {$EXTERNALSYM SSL_R_NO_COMPRESSION_SPECIFIED} + SSL_R_NO_COMPRESSION_SPECIFIED = 187; + {$EXTERNALSYM SSL_R_NO_METHOD_SPECIFIED} + SSL_R_NO_METHOD_SPECIFIED = 188; + {$EXTERNALSYM SSL_R_NO_PRIVATEKEY} + SSL_R_NO_PRIVATEKEY = 189; + {$EXTERNALSYM SSL_R_NO_PRIVATE_KEY_ASSIGNED} + SSL_R_NO_PRIVATE_KEY_ASSIGNED = 190; + {$EXTERNALSYM SSL_R_NO_PROTOCOLS_AVAILABLE} + SSL_R_NO_PROTOCOLS_AVAILABLE = 191; + {$EXTERNALSYM SSL_R_NO_PUBLICKEY} + SSL_R_NO_PUBLICKEY = 192; + //was 318 + {$EXTERNALSYM SSL_R_NO_RENEGOTIATION} + SSL_R_NO_RENEGOTIATION = 319; + {$EXTERNALSYM SSL_R_NO_SHARED_CIPHER} + SSL_R_NO_SHARED_CIPHER = 193; + {$EXTERNALSYM SSL_R_NO_VERIFY_CALLBACK} + SSL_R_NO_VERIFY_CALLBACK = 194; + {$EXTERNALSYM SSL_R_NULL_SSL_CTX} + SSL_R_NULL_SSL_CTX = 195; + {$EXTERNALSYM SSL_R_NULL_SSL_METHOD_PASSED} + SSL_R_NULL_SSL_METHOD_PASSED = 196; + {$EXTERNALSYM SSL_R_OLD_SESSION_CIPHER_NOT_RETURNED} + SSL_R_OLD_SESSION_CIPHER_NOT_RETURNED = 197; + {$EXTERNALSYM SSL_R_ONLY_TLS_ALLOWED_IN_FIPS_MODE} + SSL_R_ONLY_TLS_ALLOWED_IN_FIPS_MODE = 297; + {$EXTERNALSYM SSL_R_PACKET_LENGTH_TOO_LONG} + SSL_R_PACKET_LENGTH_TOO_LONG = 198; + {$EXTERNALSYM SSL_R_PARSE_TLSEXT} + SSL_R_PARSE_TLSEXT = 223; + {$EXTERNALSYM SSL_R_PATH_TOO_LONG} + SSL_R_PATH_TOO_LONG = 270; + {$EXTERNALSYM SSL_R_PEER_DID_NOT_RETURN_A_CERTIFICATE} + SSL_R_PEER_DID_NOT_RETURN_A_CERTIFICATE = 199; + {$EXTERNALSYM SSL_R_PEER_ERROR} + SSL_R_PEER_ERROR = 200; + {$EXTERNALSYM SSL_R_PEER_ERROR_CERTIFICATE} + SSL_R_PEER_ERROR_CERTIFICATE = 201; + {$EXTERNALSYM SSL_R_PEER_ERROR_NO_CERTIFICATE} + SSL_R_PEER_ERROR_NO_CERTIFICATE = 202; + {$EXTERNALSYM SSL_R_PEER_ERROR_NO_CIPHER} + SSL_R_PEER_ERROR_NO_CIPHER = 203; + {$EXTERNALSYM SSL_R_PEER_ERROR_UNSUPPORTED_CERTIFICATE_TYPE} + SSL_R_PEER_ERROR_UNSUPPORTED_CERTIFICATE_TYPE = 204; + {$EXTERNALSYM SSL_R_PRE_MAC_LENGTH_TOO_LONG} + SSL_R_PRE_MAC_LENGTH_TOO_LONG = 205; + {$EXTERNALSYM SSL_R_PROBLEMS_MAPPING_CIPHER_FUNCTIONS} + SSL_R_PROBLEMS_MAPPING_CIPHER_FUNCTIONS = 206; + {$EXTERNALSYM SSL_R_PROTOCOL_IS_SHUTDOWN} + SSL_R_PROTOCOL_IS_SHUTDOWN = 207; + {$EXTERNALSYM SSL_R_PUBLIC_KEY_ENCRYPT_ERROR} + SSL_R_PUBLIC_KEY_ENCRYPT_ERROR = 208; + {$EXTERNALSYM SSL_R_PUBLIC_KEY_IS_NOT_RSA} + SSL_R_PUBLIC_KEY_IS_NOT_RSA = 209; + {$EXTERNALSYM SSL_R_PUBLIC_KEY_NOT_RSA} + SSL_R_PUBLIC_KEY_NOT_RSA = 210; + {$EXTERNALSYM SSL_R_READ_BIO_NOT_SET} + SSL_R_READ_BIO_NOT_SET = 211; + {$EXTERNALSYM SSL_R_READ_WRONG_PACKET_TYPE} + SSL_R_READ_WRONG_PACKET_TYPE = 212; + {$EXTERNALSYM SSL_R_RECORD_LENGTH_MISMATCH} + SSL_R_RECORD_LENGTH_MISMATCH = 213; + {$EXTERNALSYM SSL_R_RECORD_TOO_LARGE} + SSL_R_RECORD_TOO_LARGE = 214; + {$EXTERNALSYM SSL_R_RECORD_TOO_SMALL} + SSL_R_RECORD_TOO_SMALL = 298; + {$EXTERNALSYM SSL_R_RENEGOTIATE_EXT_TOO_LONG} + SSL_R_RENEGOTIATE_EXT_TOO_LONG = 320; + {$EXTERNALSYM SSL_R_RENEGOTIATION_ENCODING_ERR} + SSL_R_RENEGOTIATION_ENCODING_ERR = 321; + {$EXTERNALSYM SSL_R_RENEGOTIATION_MISMATCH} + SSL_R_RENEGOTIATION_MISMATCH = 322; + {$EXTERNALSYM SSL_R_REQUIRED_CIPHER_MISSING} + SSL_R_REQUIRED_CIPHER_MISSING = 215; + {$EXTERNALSYM SSL_R_REUSE_CERT_LENGTH_NOT_ZERO} + SSL_R_REUSE_CERT_LENGTH_NOT_ZERO = 216; + {$EXTERNALSYM SSL_R_REUSE_CERT_TYPE_NOT_ZERO} + SSL_R_REUSE_CERT_TYPE_NOT_ZERO = 217; + {$EXTERNALSYM SSL_R_REUSE_CIPHER_LIST_NOT_ZERO} + SSL_R_REUSE_CIPHER_LIST_NOT_ZERO = 218; + {$EXTERNALSYM SSL_R_SCSV_RECEIVED_WHEN_RENEGOTIATING} + SSL_R_SCSV_RECEIVED_WHEN_RENEGOTIATING = 324; + {$EXTERNALSYM SSL_R_SERVERHELLO_TLSEXT} + SSL_R_SERVERHELLO_TLSEXT = 224; + {$EXTERNALSYM SSL_R_SESSION_ID_CONTEXT_UNINITIALIZED} + SSL_R_SESSION_ID_CONTEXT_UNINITIALIZED = 277; + {$EXTERNALSYM SSL_R_SHORT_READ} + SSL_R_SHORT_READ = 219; + {$EXTERNALSYM SSL_R_SIGNATURE_FOR_NON_SIGNING_CERTIFICATE} + SSL_R_SIGNATURE_FOR_NON_SIGNING_CERTIFICATE = 220; + {$EXTERNALSYM SSL_R_SSL23_DOING_SESSION_ID_REUSE} + SSL_R_SSL23_DOING_SESSION_ID_REUSE = 221; + {$EXTERNALSYM SSL_R_SSL2_CONNECTION_ID_TOO_LONG} + SSL_R_SSL2_CONNECTION_ID_TOO_LONG = 299; + {$EXTERNALSYM SSL_R_SSL3_EXT_INVALID_SERVERNAME} + SSL_R_SSL3_EXT_INVALID_SERVERNAME = 225; + {$EXTERNALSYM SSL_R_SSL3_EXT_INVALID_SERVERNAME_TYPE} + SSL_R_SSL3_EXT_INVALID_SERVERNAME_TYPE = 226; + {$EXTERNALSYM SSL_R_SSL3_SESSION_ID_TOO_LONG} + SSL_R_SSL3_SESSION_ID_TOO_LONG = 300; + {$EXTERNALSYM SSL_R_SSL3_SESSION_ID_TOO_SHORT} + SSL_R_SSL3_SESSION_ID_TOO_SHORT = 222; + {$EXTERNALSYM SSL_R_SSLV3_ALERT_BAD_CERTIFICATE} + SSL_R_SSLV3_ALERT_BAD_CERTIFICATE = 1042; + {$EXTERNALSYM SSL_R_SSLV3_ALERT_BAD_RECORD_MAC} + SSL_R_SSLV3_ALERT_BAD_RECORD_MAC = 1020; + {$EXTERNALSYM SSL_R_SSLV3_ALERT_CERTIFICATE_EXPIRED} + SSL_R_SSLV3_ALERT_CERTIFICATE_EXPIRED = 1045; + {$EXTERNALSYM SSL_R_SSLV3_ALERT_CERTIFICATE_REVOKED} + SSL_R_SSLV3_ALERT_CERTIFICATE_REVOKED = 1044; + {$EXTERNALSYM SSL_R_SSLV3_ALERT_CERTIFICATE_UNKNOWN} + SSL_R_SSLV3_ALERT_CERTIFICATE_UNKNOWN = 1046; + {$EXTERNALSYM SSL_R_SSLV3_ALERT_DECOMPRESSION_FAILURE} + SSL_R_SSLV3_ALERT_DECOMPRESSION_FAILURE = 1030; + {$EXTERNALSYM SSL_R_SSLV3_ALERT_HANDSHAKE_FAILURE} + SSL_R_SSLV3_ALERT_HANDSHAKE_FAILURE = 1040; + {$EXTERNALSYM SSL_R_SSLV3_ALERT_ILLEGAL_PARAMETER} + SSL_R_SSLV3_ALERT_ILLEGAL_PARAMETER = 1047; + {$EXTERNALSYM SSL_R_SSLV3_ALERT_NO_CERTIFICATE} + SSL_R_SSLV3_ALERT_NO_CERTIFICATE = 1041; + {$EXTERNALSYM SSL_R_SSLV3_ALERT_PEER_ERROR_CERTIFICATE} + SSL_R_SSLV3_ALERT_PEER_ERROR_CERTIFICATE = 223; + {$EXTERNALSYM SSL_R_SSLV3_ALERT_PEER_ERROR_NO_CERTIFICATE} + SSL_R_SSLV3_ALERT_PEER_ERROR_NO_CERTIFICATE = 224; + {$EXTERNALSYM SSL_R_SSLV3_ALERT_PEER_ERROR_NO_CIPHER} + SSL_R_SSLV3_ALERT_PEER_ERROR_NO_CIPHER = 225; + {$EXTERNALSYM SSL_R_SSLV3_ALERT_PEER_ERROR_UNSUPPORTED_CERTIFICATE_TYPE} + SSL_R_SSLV3_ALERT_PEER_ERROR_UNSUPPORTED_CERTIFICATE_TYPE = 226; + {$EXTERNALSYM SSL_R_SSLV3_ALERT_UNEXPECTED_MESSAGE} + SSL_R_SSLV3_ALERT_UNEXPECTED_MESSAGE = 1010; + {$EXTERNALSYM SSL_R_SSLV3_ALERT_UNKNOWN_REMOTE_ERROR_TYPE} + SSL_R_SSLV3_ALERT_UNKNOWN_REMOTE_ERROR_TYPE = 227; + {$EXTERNALSYM SSL_R_SSLV3_ALERT_UNSUPPORTED_CERTIFICATE} + SSL_R_SSLV3_ALERT_UNSUPPORTED_CERTIFICATE = 1043; + {$EXTERNALSYM SSL_R_SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION} + SSL_R_SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION = 228; + {$EXTERNALSYM SSL_R_SSL_HANDSHAKE_FAILURE} + SSL_R_SSL_HANDSHAKE_FAILURE = 229; + {$EXTERNALSYM SSL_R_SSL_LIBRARY_HAS_NO_CIPHERS} + SSL_R_SSL_LIBRARY_HAS_NO_CIPHERS = 230; + {$EXTERNALSYM SSL_R_SSL_SESSION_ID_CONTEXT_TOO_LONG} + SSL_R_SSL_SESSION_ID_CONTEXT_TOO_LONG = 273; + {$EXTERNALSYM SSL_R_SSL_SESSION_ID_IS_DIFFERENT} + SSL_R_SSL_SESSION_ID_IS_DIFFERENT = 231; + {$EXTERNALSYM SSL_R_TLSV1_ALERT_ACCESS_DENIED} + SSL_R_TLSV1_ALERT_ACCESS_DENIED = 1049; + {$EXTERNALSYM SSL_R_TLSV1_ALERT_DECODE_ERROR} + SSL_R_TLSV1_ALERT_DECODE_ERROR = 1050; + {$EXTERNALSYM SSL_R_TLSV1_ALERT_DECRYPTION_FAILED} + SSL_R_TLSV1_ALERT_DECRYPTION_FAILED = 1021; + {$EXTERNALSYM SSL_R_TLSV1_ALERT_DECRYPT_ERROR} + SSL_R_TLSV1_ALERT_DECRYPT_ERROR = 1051; + {$EXTERNALSYM SSL_R_TLSV1_ALERT_EXPORT_RESTRICION} + SSL_R_TLSV1_ALERT_EXPORT_RESTRICION = 1060; + {$EXTERNALSYM SSL_R_TLSV1_ALERT_INSUFFICIENT_SECURITY} + SSL_R_TLSV1_ALERT_INSUFFICIENT_SECURITY = 1071; + {$EXTERNALSYM SSL_R_TLSV1_ALERT_INTERNAL_ERROR} + SSL_R_TLSV1_ALERT_INTERNAL_ERROR = 1080; + {$EXTERNALSYM SSL_R_TLSV1_ALERT_NO_RENEGOTIATION} + SSL_R_TLSV1_ALERT_NO_RENEGOTIATION = 1100; + {$EXTERNALSYM SSL_R_TLSV1_ALERT_PROTOCOL_VERSION} + SSL_R_TLSV1_ALERT_PROTOCOL_VERSION = 1070; + {$EXTERNALSYM SSL_R_TLSV1_ALERT_RECORD_OVERFLOW} + SSL_R_TLSV1_ALERT_RECORD_OVERFLOW = 1022; + {$EXTERNALSYM SSL_R_TLSV1_ALERT_UNKNOWN_CA} + SSL_R_TLSV1_ALERT_UNKNOWN_CA = 1048; + {$EXTERNALSYM SSL_R_TLSV1_ALERT_USER_CANCLED} + SSL_R_TLSV1_ALERT_USER_CANCLED = 1090; + {$EXTERNALSYM SSL_R_TLS_CLIENT_CERT_REQ_WITH_ANON_CIPHER} + SSL_R_TLS_CLIENT_CERT_REQ_WITH_ANON_CIPHER = 232; + {$EXTERNALSYM SSL_R_TLS_INVALID_ECPOINTFORMAT_LIST} + SSL_R_TLS_INVALID_ECPOINTFORMAT_LIST = 227; + {$EXTERNALSYM SSL_R_TLS_PEER_DID_NOT_RESPOND_WITH_CERTIFICATE_LIST} + SSL_R_TLS_PEER_DID_NOT_RESPOND_WITH_CERTIFICATE_LIST = 233; + {$EXTERNALSYM SSL_R_TLS_RSA_ENCRYPTED_VALUE_LENGTH_IS_WRONG} + SSL_R_TLS_RSA_ENCRYPTED_VALUE_LENGTH_IS_WRONG = 234; + {$EXTERNALSYM SSL_R_TRIED_TO_USE_UNSUPPORTED_CIPHER} + SSL_R_TRIED_TO_USE_UNSUPPORTED_CIPHER = 235; + {$EXTERNALSYM SSL_R_UNABLE_TO_DECODE_DH_CERTS} + SSL_R_UNABLE_TO_DECODE_DH_CERTS = 236; + {$EXTERNALSYM SSL_R_UNABLE_TO_EXTRACT_PUBLIC_KEY} + SSL_R_UNABLE_TO_EXTRACT_PUBLIC_KEY = 237; + {$EXTERNALSYM SSL_R_UNABLE_TO_FIND_DH_PARAMETERS} + SSL_R_UNABLE_TO_FIND_DH_PARAMETERS = 238; + {$EXTERNALSYM SSL_R_UNABLE_TO_FIND_PUBLIC_KEY_PARAMETERS} + SSL_R_UNABLE_TO_FIND_PUBLIC_KEY_PARAMETERS = 239; + {$EXTERNALSYM SSL_R_UNABLE_TO_FIND_SSL_METHOD} + SSL_R_UNABLE_TO_FIND_SSL_METHOD = 240; + {$EXTERNALSYM SSL_R_UNABLE_TO_LOAD_SSL2_MD5_ROUTINES} + SSL_R_UNABLE_TO_LOAD_SSL2_MD5_ROUTINES = 241; + {$EXTERNALSYM SSL_R_UNABLE_TO_LOAD_SSL3_MD5_ROUTINES} + SSL_R_UNABLE_TO_LOAD_SSL3_MD5_ROUTINES = 242; + {$EXTERNALSYM SSL_R_UNABLE_TO_LOAD_SSL3_SHA1_ROUTINES} + SSL_R_UNABLE_TO_LOAD_SSL3_SHA1_ROUTINES = 243; + {$EXTERNALSYM SSL_R_UNEXPECTED_MESSAGE} + SSL_R_UNEXPECTED_MESSAGE = 244; + {$EXTERNALSYM SSL_R_UNEXPECTED_RECORD} + SSL_R_UNEXPECTED_RECORD = 245; + {$EXTERNALSYM SSL_R_UNINITIALIZED} + SSL_R_UNINITIALIZED = 276; + {$EXTERNALSYM SSL_R_UNKNOWN_ALERT_TYPE} + SSL_R_UNKNOWN_ALERT_TYPE = 246; + {$EXTERNALSYM SSL_R_UNKNOWN_CERTIFICATE_TYPE} + SSL_R_UNKNOWN_CERTIFICATE_TYPE = 247; + {$EXTERNALSYM SSL_R_UNKNOWN_CIPHER_RETURNED} + SSL_R_UNKNOWN_CIPHER_RETURNED = 248; + {$EXTERNALSYM SSL_R_UNKNOWN_CIPHER_TYPE} + SSL_R_UNKNOWN_CIPHER_TYPE = 249; + {$EXTERNALSYM SSL_R_UNKNOWN_KEY_EXCHANGE_TYPE} + SSL_R_UNKNOWN_KEY_EXCHANGE_TYPE = 250; + {$EXTERNALSYM SSL_R_UNKNOWN_PKEY_TYPE} + SSL_R_UNKNOWN_PKEY_TYPE = 251; + {$EXTERNALSYM SSL_R_UNKNOWN_PROTOCOL} + SSL_R_UNKNOWN_PROTOCOL = 252; + {$EXTERNALSYM SSL_R_UNKNOWN_REMOTE_ERROR_TYPE} + SSL_R_UNKNOWN_REMOTE_ERROR_TYPE = 253; + {$EXTERNALSYM SSL_R_UNKNOWN_SSL_VERSION} + SSL_R_UNKNOWN_SSL_VERSION = 254; + {$EXTERNALSYM SSL_R_UNSUPPORTED_STATUS_TYPE} + SSL_R_UNSUPPORTED_STATUS_TYPE = 329; + {$EXTERNALSYM SSL_R_UNKNOWN_STATE} + SSL_R_UNKNOWN_STATE = 255; + {$EXTERNALSYM SSL_R_UNSAFE_LEGACY_RENEGOTIATION_DISABLED} + SSL_R_UNSAFE_LEGACY_RENEGOTIATION_DISABLED = 323; + {$EXTERNALSYM SSL_R_UNSUPPORTED_CIPHER} + SSL_R_UNSUPPORTED_CIPHER = 256; + {$EXTERNALSYM SSL_R_UNSUPPORTED_COMPRESSION_ALGORITHM} + SSL_R_UNSUPPORTED_COMPRESSION_ALGORITHM = 257; + {$EXTERNALSYM SSL_R_UNSUPPORTED_DIGEST_TYPE} + SSL_R_UNSUPPORTED_DIGEST_TYPE = 326; + {$EXTERNALSYM SSL_R_UNSUPPORTED_PROTOCOL} + SSL_R_UNSUPPORTED_PROTOCOL = 258; + {$EXTERNALSYM SSL_R_UNSUPPORTED_SSL_VERSION} + SSL_R_UNSUPPORTED_SSL_VERSION = 259; + {$EXTERNALSYM SSL_R_USE_SRTP_NOT_NEGOTIATED} + SSL_R_USE_SRTP_NOT_NEGOTIATED = 369; + {$EXTERNALSYM SSL_R_WRITE_BIO_NOT_SET} + SSL_R_WRITE_BIO_NOT_SET = 260; + {$EXTERNALSYM SSL_R_WRONG_CIPHER_RETURNED} + SSL_R_WRONG_CIPHER_RETURNED = 261; + {$EXTERNALSYM SSL_R_WRONG_MESSAGE_TYPE} + SSL_R_WRONG_MESSAGE_TYPE = 262; + {$EXTERNALSYM SSL_R_WRONG_NUMBER_OF_KEY_BITS} + SSL_R_WRONG_NUMBER_OF_KEY_BITS = 263; + {$EXTERNALSYM SSL_R_WRONG_SIGNATURE_LENGTH} + SSL_R_WRONG_SIGNATURE_LENGTH = 264; + {$EXTERNALSYM SSL_R_WRONG_SIGNATURE_SIZE} + SSL_R_WRONG_SIGNATURE_SIZE = 265; + {$EXTERNALSYM SSL_R_WRONG_SIGNATURE_TYPE} + SSL_R_WRONG_SIGNATURE_TYPE = 370; + {$EXTERNALSYM SSL_R_WRONG_SSL_VERSION} + SSL_R_WRONG_SSL_VERSION = 266; + {$EXTERNALSYM SSL_R_WRONG_VERSION_NUMBER} + SSL_R_WRONG_VERSION_NUMBER = 267; + {$EXTERNALSYM SSL_R_X509_LIB} + SSL_R_X509_LIB = 268; + {$EXTERNALSYM SSL_R_X509_VERIFICATION_SETUP_PROBLEMS} + SSL_R_X509_VERIFICATION_SETUP_PROBLEMS = 269; + {$EXTERNALSYM SSL_SENT_SHUTDOWN} + SSL_SENT_SHUTDOWN = 1; + {$EXTERNALSYM SSL_SESSION_ASN1_VERSION} + SSL_SESSION_ASN1_VERSION = $0001; + {$EXTERNALSYM SSL_SESSION_CACHE_MAX_SIZE_DEFAULT} + SSL_SESSION_CACHE_MAX_SIZE_DEFAULT = 1024*20; + {$EXTERNALSYM SSL_SESS_CACHE_CLIENT} + SSL_SESS_CACHE_CLIENT = $0001; + {$EXTERNALSYM SSL_SESS_CACHE_SERVER} + SSL_SESS_CACHE_SERVER = $0002; + {$EXTERNALSYM SSL_SESS_CACHE_BOTH} + SSL_SESS_CACHE_BOTH = SSL_SESS_CACHE_CLIENT or SSL_SESS_CACHE_SERVER; + {$EXTERNALSYM SSL_SESS_CACHE_NO_AUTO_CLEAR} + SSL_SESS_CACHE_NO_AUTO_CLEAR = $0080; + {$EXTERNALSYM SSL_SESS_CACHE_NO_INTERNAL_LOOKUP} + SSL_SESS_CACHE_NO_INTERNAL_LOOKUP = $0100; + {$EXTERNALSYM SSL_SESS_CACHE_OFF} + SSL_SESS_CACHE_OFF = $0000; + {$ifndef OPENSSL_NO_NEXTPROTONEG} + {$EXTERNALSYM OPENSSL_NPN_UNSUPPORTED} + OPENSSL_NPN_UNSUPPORTED = 0; + {$EXTERNALSYM OPENSSL_NPN_NEGOTIATED} + OPENSSL_NPN_NEGOTIATED = 1; + {$EXTERNALSYM OPENSSL_NPN_NO_OVERLAP} + OPENSSL_NPN_NO_OVERLAP = 2; + {$endif} +{$ifndef OPENSSL_NO_PSK} +//* the maximum length of the buffer given to callbacks containing the +// * resulting identity/psk */ + {$EXTERNALSYM PSK_MAX_IDENTITY_LEN} + PSK_MAX_IDENTITY_LEN = 128; + {$EXTERNALSYM PSK_MAX_PSK_LEN} + PSK_MAX_PSK_LEN = 256; +{$endif} + + + + {$EXTERNALSYM SSL_TXT_LOW} + SSL_TXT_LOW = 'LOW'; {Do not localize} + {$EXTERNALSYM SSL_TXT_MEDIUM} + SSL_TXT_MEDIUM = 'MEDIUM'; {Do not localize} + {$EXTERNALSYM SSL_TXT_HIGH} + SSL_TXT_HIGH = 'HIGH'; {Do not localize} + {$EXTERNALSYM SSL_TXT_FIPS} + SSL_TXT_FIPS = 'FIPS'; {Do not localize} + {$EXTERNALSYM SSL_TXT_kFZA} + SSL_TXT_kFZA = 'kFZA'; {Do not localize} + {$EXTERNALSYM SSL_TXT_aFZA} + SSL_TXT_aFZA = 'aFZA'; {Do not localize} + {$EXTERNALSYM SSL_TXT_eFZA} + SSL_TXT_eFZA = 'eFZA'; {Do not localize} + {$EXTERNALSYM SSL_TXT_FZA} + SSL_TXT_FZA = 'FZA'; {Do not localize} + {$EXTERNALSYM SSL_TXT_aNULL} + SSL_TXT_aNULL = 'aNULL'; {Do not localize} + {$EXTERNALSYM SSL_TXT_eNULL} + SSL_TXT_eNULL = 'eNULL'; {Do not localize} + {$EXTERNALSYM SSL_TXT_NULL} + SSL_TXT_NULL = 'NULL'; {Do not localize} + {$EXTERNALSYM SSL_TXT_kKRB5} + SSL_TXT_kKRB5 = 'kKRB5';{Do not localize} + {$EXTERNALSYM SSL_TXT_aKRB5} + SSL_TXT_aKRB5 ='aKRB5';{Do not localize} + {$EXTERNALSYM SSL_TXT_KRB5} + SSL_TXT_KRB5 = 'KRB5';{Do not localize} + {$EXTERNALSYM SSL_TXT_kRSA} + SSL_TXT_kRSA = 'kRSA'; {Do not localize} + {$EXTERNALSYM SSL_TXT_kDHr} + SSL_TXT_kDHr = 'kDHr'; {Do not localize} + {$EXTERNALSYM SSL_TXT_kDHd} + SSL_TXT_kDHd = 'kDHd'; {Do not localize} + {$EXTERNALSYM SSL_TXT_kEDH} + SSL_TXT_kEDH = 'kEDH'; {Do not localize} + {$EXTERNALSYM SSL_TXT_aRSA} + SSL_TXT_aRSA = 'aRSA'; {Do not localize} + {$EXTERNALSYM SSL_TXT_aDSS} + SSL_TXT_aDSS = 'aDSS'; {Do not localize} + {$EXTERNALSYM SSL_TXT_aDH} + SSL_TXT_aDH = 'aDH'; {Do not localize} + {$EXTERNALSYM SSL_TXT_RSA} + SSL_TXT_RSA = 'RSA'; {Do not localize} + {$EXTERNALSYM SSL_TXT_DH} + SSL_TXT_DH = 'DH'; {Do not localize} + {$EXTERNALSYM SSL_TXT_EDH} + SSL_TXT_EDH = 'EDH'; {Do not localize} + {$EXTERNALSYM SSL_TXT_ADH_C} + SSL_TXT_ADH_C = 'ADH'; {Do not localize} + {$EXTERNALSYM SSL_TXT_aDH_S} + SSL_TXT_aDH_S = 'aDH'; {Do not localize} + {$EXTERNALSYM SSL_TXT_DSS} + SSL_TXT_DSS = 'DSS'; {Do not localize} + {$EXTERNALSYM SSL_TXT_DES} + SSL_TXT_DES = 'DES'; {Do not localize} + {$EXTERNALSYM SSL_TXT_3DES} + SSL_TXT_3DES = '3DES'; {Do not localize} + {$EXTERNALSYM SSL_TXT_RC4} + SSL_TXT_RC4 = 'RC4'; {Do not localize} + {$EXTERNALSYM SSL_TXT_RC2} + SSL_TXT_RC2 = 'RC2'; {Do not localize} + {$EXTERNALSYM SSL_TXT_IDEA} + SSL_TXT_IDEA = 'IDEA'; {Do not localize} + {$EXTERNALSYM SSL_TXT_SEED} + SSL_TXT_SEED = 'SEED'; {Do not localize} + {$EXTERNALSYM SSL_TXT_AES} + SSL_TXT_AES = 'AES'; {Do not localize} + {$EXTERNALSYM SSL_TXT_CAMELLIA} + SSL_TXT_CAMELLIA = 'CAMELLIA'; {Do not localize} + {$EXTERNALSYM SSL_TXT_MD5} + SSL_TXT_MD5 = 'MD5'; {Do not localize} + {$EXTERNALSYM SSL_TXT_SHA1} + SSL_TXT_SHA1 = 'SHA1'; {Do not localize} + {$EXTERNALSYM SSL_TXT_SHA} + SSL_TXT_SHA = 'SHA'; {Do not localize} + {$EXTERNALSYM SSL_TXT_EXP} + SSL_TXT_EXP = 'EXP'; {Do not localize} + {$EXTERNALSYM SSL_TXT_EXPORT} + SSL_TXT_EXPORT = 'EXPORT'; {Do not localize} + {$EXTERNALSYM SSL_TXT_EXP40} + SSL_TXT_EXP40 = 'EXPORT40'; {Do not localize} + {$EXTERNALSYM SSL_TXT_EXP56} + SSL_TXT_EXP56 = 'EXPORT56'; {Do not localize} + {$EXTERNALSYM SSL_TXT_SSLV2} + SSL_TXT_SSLV2 = 'SSLv2'; {Do not localize} + {$EXTERNALSYM SSL_TXT_SSLV3} + SSL_TXT_SSLV3 = 'SSLv3'; {Do not localize} + {$EXTERNALSYM SSL_TXT_TLSV1} + SSL_TXT_TLSV1 = 'TLSv1'; {Do not localize} + {$EXTERNALSYM SSL_TXT_ALL} + SSL_TXT_ALL = 'ALL'; {Do not localize} + {$EXTERNALSYM SSL_TXT_ECC} + SSL_TXT_ECC = 'ECCdraft'; //* ECC ciphersuites are not yet official */ + {$EXTERNALSYM SSL_TXT_DES_192_EDE3_CBC_WITH_MD5} + SSL_TXT_DES_192_EDE3_CBC_WITH_MD5 = SSL2_TXT_DES_192_EDE3_CBC_WITH_MD5; + {$EXTERNALSYM SSL_TXT_DES_192_EDE3_CBC_WITH_SHA} + SSL_TXT_DES_192_EDE3_CBC_WITH_SHA = SSL2_TXT_DES_192_EDE3_CBC_WITH_SHA; + {$EXTERNALSYM SSL_TXT_DES_64_CBC_WITH_MD5} + SSL_TXT_DES_64_CBC_WITH_MD5 = SSL2_TXT_DES_64_CBC_WITH_MD5; + {$EXTERNALSYM SSL_TXT_DES_64_CBC_WITH_SHA} + SSL_TXT_DES_64_CBC_WITH_SHA = SSL2_TXT_DES_64_CBC_WITH_SHA; + {$EXTERNALSYM SSL_TXT_IDEA_128_CBC_WITH_MD5} + SSL_TXT_IDEA_128_CBC_WITH_MD5 = SSL2_TXT_IDEA_128_CBC_WITH_MD5; + {$EXTERNALSYM SSL_TXT_NULL_WITH_MD5} + SSL_TXT_NULL_WITH_MD5 = SSL2_TXT_NULL_WITH_MD5; + {$EXTERNALSYM SSL_TXT_RC2_128_CBC_EXPORT40_WITH_MD5} + SSL_TXT_RC2_128_CBC_EXPORT40_WITH_MD5 = SSL2_TXT_RC2_128_CBC_EXPORT40_WITH_MD5; + {$EXTERNALSYM SSL_TXT_RC2_128_CBC_WITH_MD5} + SSL_TXT_RC2_128_CBC_WITH_MD5 = SSL2_TXT_RC2_128_CBC_WITH_MD5; + {$EXTERNALSYM SSL_TXT_RC4_128_EXPORT40_WITH_MD5} + SSL_TXT_RC4_128_EXPORT40_WITH_MD5 = SSL2_TXT_RC4_128_EXPORT40_WITH_MD5; + {$EXTERNALSYM SSL_TXT_RC4_128_WITH_MD5} + SSL_TXT_RC4_128_WITH_MD5 = SSL2_TXT_RC4_128_WITH_MD5; + {$EXTERNALSYM SSL_VERIFY_CLIENT_ONCE} + SSL_VERIFY_CLIENT_ONCE = $04; + {$EXTERNALSYM SSL_VERIFY_FAIL_IF_NO_PEER_CERT} + SSL_VERIFY_FAIL_IF_NO_PEER_CERT = $02; + {$EXTERNALSYM SSL_VERIFY_NONE} + SSL_VERIFY_NONE = $00; + {$EXTERNALSYM SSL_VERIFY_PEER} + SSL_VERIFY_PEER = $01; + + {$EXTERNALSYM SSL_MAC_FLAG_READ_MAC_STREAM} + SSL_MAC_FLAG_READ_MAC_STREAM = 1; + {$EXTERNALSYM SSL_MAC_FLAG_WRITE_MAC_STREAM} + SSL_MAC_FLAG_WRITE_MAC_STREAM = 2; + {$EXTERNALSYM TLS1_ALLOW_EXPERIMENTAL_CIPHERSUITES} + TLS1_ALLOW_EXPERIMENTAL_CIPHERSUITES = 0; + {$EXTERNALSYM TLS1_2_VERSION} + TLS1_2_VERSION = $0303; + {$EXTERNALSYM TLS1_2_VERSION_MAJOR} + TLS1_2_VERSION_MAJOR = $03; + {$EXTERNALSYM TLS1_2_VERSION_MINOR} + TLS1_2_VERSION_MINOR = $03; + {$EXTERNALSYM TLS1_1_VERSION} + TLS1_1_VERSION = $0302; + {$EXTERNALSYM TLS1_1_VERSION_MAJOR} + TLS1_1_VERSION_MAJOR = $03; + {$EXTERNALSYM TLS1_1_VERSION_MINOR} + TLS1_1_VERSION_MINOR = $02; + {$EXTERNALSYM TLS1_VERSION} + TLS1_VERSION = $0301; + {$EXTERNALSYM TLS1_VERSION_MAJOR} + TLS1_VERSION_MAJOR = $03; + {$EXTERNALSYM TLS1_VERSION_MINOR} + TLS1_VERSION_MINOR = $01; + + {$IFNDEF OPENSSL_NO_HEARTBEATS} + {$EXTERNALSYM SSL_TLSEXT_HB_ENABLED} + SSL_TLSEXT_HB_ENABLED = $01; + {$EXTERNALSYM SSL_TLSEXT_HB_DONT_SEND_REQUESTS} + SSL_TLSEXT_HB_DONT_SEND_REQUESTS = $02; + {$EXTERNALSYM SSL_TLSEXT_HB_DONT_RECV_REQUESTS} + SSL_TLSEXT_HB_DONT_RECV_REQUESTS = $04; + + {$ENDIF} + + //* PSK ciphersuites from 4279 */ + {$EXTERNALSYM TLS1_CK_PSK_WITH_RC4_128_SHA} + TLS1_CK_PSK_WITH_RC4_128_SHA = $0300008A; + {$EXTERNALSYM TLS1_CK_PSK_WITH_3DES_EDE_CBC_SHA} + TLS1_CK_PSK_WITH_3DES_EDE_CBC_SHA = $0300008B; + {$EXTERNALSYM TLS1_CK_PSK_WITH_AES_128_CBC_SHA} + TLS1_CK_PSK_WITH_AES_128_CBC_SHA = $0300008C; + {$EXTERNALSYM TLS1_CK_PSK_WITH_AES_256_CBC_SHA} + TLS1_CK_PSK_WITH_AES_256_CBC_SHA = $0300008D; + + {$EXTERNALSYM TLS1_CK_RSA_EXPORT1024_WITH_RC4_56_MD5} + TLS1_CK_RSA_EXPORT1024_WITH_RC4_56_MD5 = $03000060; + {$EXTERNALSYM TLS1_CK_RSA_EXPORT1024_WITH_RC2_CBC_56_MD5} + TLS1_CK_RSA_EXPORT1024_WITH_RC2_CBC_56_MD5 = $03000061; + {$EXTERNALSYM TLS1_CK_RSA_EXPORT1024_WITH_DES_CBC_SHA} + TLS1_CK_RSA_EXPORT1024_WITH_DES_CBC_SHA = $03000062; + {$EXTERNALSYM TLS1_CK_DHE_DSS_EXPORT1024_WITH_DES_CBC_SHA} + TLS1_CK_DHE_DSS_EXPORT1024_WITH_DES_CBC_SHA = $03000063; + {$EXTERNALSYM TLS1_CK_RSA_EXPORT1024_WITH_RC4_56_SHA} + TLS1_CK_RSA_EXPORT1024_WITH_RC4_56_SHA = $03000064; + {$EXTERNALSYM TLS1_CK_DHE_DSS_EXPORT1024_WITH_RC4_56_SHA} + TLS1_CK_DHE_DSS_EXPORT1024_WITH_RC4_56_SHA = $03000065; + {$EXTERNALSYM TLS1_CK_DHE_DSS_WITH_RC4_128_SHA} + TLS1_CK_DHE_DSS_WITH_RC4_128_SHA = $03000066; +//* AES ciphersuites from RFC3268 */ + {$EXTERNALSYM TLS1_CK_RSA_WITH_AES_128_SHA} + TLS1_CK_RSA_WITH_AES_128_SHA = $0300002F; + {$EXTERNALSYM TLS1_CK_DH_DSS_WITH_AES_128_SHA} + TLS1_CK_DH_DSS_WITH_AES_128_SHA = $03000030; + {$EXTERNALSYM TLS1_CK_DH_RSA_WITH_AES_128_SHA} + TLS1_CK_DH_RSA_WITH_AES_128_SHA = $03000031; + {$EXTERNALSYM TLS1_CK_DHE_DSS_WITH_AES_128_SHA} + TLS1_CK_DHE_DSS_WITH_AES_128_SHA = $03000032; + {$EXTERNALSYM TLS1_CK_DHE_RSA_WITH_AES_128_SHA} + TLS1_CK_DHE_RSA_WITH_AES_128_SHA = $03000033; + {$EXTERNALSYM TLS1_CK_ADH_WITH_AES_128_SHA} + TLS1_CK_ADH_WITH_AES_128_SHA = $03000034; + {$EXTERNALSYM TLS1_CK_RSA_WITH_AES_256_SHA} + TLS1_CK_RSA_WITH_AES_256_SHA = $03000035; + {$EXTERNALSYM TLS1_CK_DH_DSS_WITH_AES_256_SHA} + TLS1_CK_DH_DSS_WITH_AES_256_SHA = $03000036; + {$EXTERNALSYM TLS1_CK_DH_RSA_WITH_AES_256_SHA} + TLS1_CK_DH_RSA_WITH_AES_256_SHA = $03000037; + {$EXTERNALSYM TLS1_CK_DHE_DSS_WITH_AES_256_SHA} + TLS1_CK_DHE_DSS_WITH_AES_256_SHA = $03000038; + {$EXTERNALSYM TLS1_CK_DHE_RSA_WITH_AES_256_SHA} + TLS1_CK_DHE_RSA_WITH_AES_256_SHA = $03000039; + {$EXTERNALSYM TLS1_CK_ADH_WITH_AES_256_SHA} + TLS1_CK_ADH_WITH_AES_256_SHA = $0300003A; +//* TLS v1.2 ciphersuites */ + {$EXTERNALSYM TLS1_CK_RSA_WITH_NULL_SHA256} + TLS1_CK_RSA_WITH_NULL_SHA256 = $0300003B; + {$EXTERNALSYM TLS1_CK_RSA_WITH_AES_128_SHA256} + TLS1_CK_RSA_WITH_AES_128_SHA256 = $0300003C; + {$EXTERNALSYM TLS1_CK_RSA_WITH_AES_256_SHA256} + TLS1_CK_RSA_WITH_AES_256_SHA256 = $0300003D; + {$EXTERNALSYM TLS1_CK_DH_DSS_WITH_AES_128_SHA256} + TLS1_CK_DH_DSS_WITH_AES_128_SHA256 = $0300003E; + {$EXTERNALSYM TLS1_CK_DH_RSA_WITH_AES_128_SHA256} + TLS1_CK_DH_RSA_WITH_AES_128_SHA256 = $0300003F; + {$EXTERNALSYM TLS1_CK_DHE_DSS_WITH_AES_128_SHA256} + TLS1_CK_DHE_DSS_WITH_AES_128_SHA256 = $03000040; + +//* Camellia ciphersuites from RFC4132 */ + {$EXTERNALSYM TLS1_CK_RSA_WITH_CAMELLIA_128_CBC_SHA} + TLS1_CK_RSA_WITH_CAMELLIA_128_CBC_SHA = $03000041; + {$EXTERNALSYM TLS1_CK_DH_DSS_WITH_CAMELLIA_128_CBC_SHA} + TLS1_CK_DH_DSS_WITH_CAMELLIA_128_CBC_SHA = $03000042; + {$EXTERNALSYM TLS1_CK_DH_RSA_WITH_CAMELLIA_128_CBC_SHA} + TLS1_CK_DH_RSA_WITH_CAMELLIA_128_CBC_SHA = $03000043; + {$EXTERNALSYM TLS1_CK_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA} + TLS1_CK_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA = $03000044; + {$EXTERNALSYM TLS1_CK_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA} + TLS1_CK_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA = $03000045; + {$EXTERNALSYM TLS1_CK_ADH_WITH_CAMELLIA_128_CBC_SHA} + TLS1_CK_ADH_WITH_CAMELLIA_128_CBC_SHA = $03000046; + {$EXTERNALSYM TLS1_CK_RSA_WITH_CAMELLIA_256_CBC_SHA} + TLS1_CK_RSA_WITH_CAMELLIA_256_CBC_SHA = $03000084; + {$EXTERNALSYM TLS1_CK_DH_DSS_WITH_CAMELLIA_256_CBC_SHA} + TLS1_CK_DH_DSS_WITH_CAMELLIA_256_CBC_SHA = $03000085; + {$EXTERNALSYM TLS1_CK_DH_RSA_WITH_CAMELLIA_256_CBC_SHA} + TLS1_CK_DH_RSA_WITH_CAMELLIA_256_CBC_SHA = $03000086; + {$EXTERNALSYM TLS1_CK_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA} + TLS1_CK_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA = $03000087; + {$EXTERNALSYM TLS1_CK_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA} + TLS1_CK_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA = $03000088; + {$EXTERNALSYM TLS1_CK_ADH_WITH_CAMELLIA_256_CBC_SHA} + TLS1_CK_ADH_WITH_CAMELLIA_256_CBC_SHA = $03000089; + +//* TLS v1.2 ciphersuites */ + {$EXTERNALSYM TLS1_CK_DHE_RSA_WITH_AES_128_SHA256} + TLS1_CK_DHE_RSA_WITH_AES_128_SHA256 = $03000067; + {$EXTERNALSYM TLS1_CK_DH_DSS_WITH_AES_256_SHA256} + TLS1_CK_DH_DSS_WITH_AES_256_SHA256 = $03000068; + {$EXTERNALSYM TLS1_CK_DH_RSA_WITH_AES_256_SHA256} + TLS1_CK_DH_RSA_WITH_AES_256_SHA256 = $03000069; + {$EXTERNALSYM TLS1_CK_DHE_DSS_WITH_AES_256_SHA256} + TLS1_CK_DHE_DSS_WITH_AES_256_SHA256 = $0300006A; + {$EXTERNALSYM TLS1_CK_DHE_RSA_WITH_AES_256_SHA256} + TLS1_CK_DHE_RSA_WITH_AES_256_SHA256 = $0300006B; + {$EXTERNALSYM TLS1_CK_ADH_WITH_AES_128_SHA256} + TLS1_CK_ADH_WITH_AES_128_SHA256 = $0300006C; + {$EXTERNALSYM TLS1_CK_ADH_WITH_AES_256_SHA256} + TLS1_CK_ADH_WITH_AES_256_SHA256 = $0300006D; + //* SEED ciphersuites from RFC4162 */ + {$EXTERNALSYM TLS1_CK_RSA_WITH_SEED_SHA} + TLS1_CK_RSA_WITH_SEED_SHA = $03000096; + {$EXTERNALSYM TLS1_CK_DH_DSS_WITH_SEED_SHA} + TLS1_CK_DH_DSS_WITH_SEED_SHA = $03000097; + {$EXTERNALSYM TLS1_CK_DH_RSA_WITH_SEED_SHA} + TLS1_CK_DH_RSA_WITH_SEED_SHA = $03000098; + {$EXTERNALSYM TLS1_CK_DHE_DSS_WITH_SEED_SHA} + TLS1_CK_DHE_DSS_WITH_SEED_SHA = $03000099; + {$EXTERNALSYM TLS1_CK_DHE_RSA_WITH_SEED_SHA} + TLS1_CK_DHE_RSA_WITH_SEED_SHA = $0300009A; + {$EXTERNALSYM TLS1_CK_ADH_WITH_SEED_SHA} + TLS1_CK_ADH_WITH_SEED_SHA = $0300009B; + +//* TLS v1.2 GCM ciphersuites from RFC5288 */ + {$EXTERNALSYM TLS1_CK_RSA_WITH_AES_128_GCM_SHA256} + TLS1_CK_RSA_WITH_AES_128_GCM_SHA256 = $0300009C; + {$EXTERNALSYM TLS1_CK_RSA_WITH_AES_256_GCM_SHA384} + TLS1_CK_RSA_WITH_AES_256_GCM_SHA384 = $0300009D; + {$EXTERNALSYM TLS1_CK_DHE_RSA_WITH_AES_128_GCM_SHA256} + TLS1_CK_DHE_RSA_WITH_AES_128_GCM_SHA256 = $0300009E; + {$EXTERNALSYM TLS1_CK_DHE_RSA_WITH_AES_256_GCM_SHA384} + TLS1_CK_DHE_RSA_WITH_AES_256_GCM_SHA384 = $0300009F; + {$EXTERNALSYM TLS1_CK_DH_RSA_WITH_AES_128_GCM_SHA256} + TLS1_CK_DH_RSA_WITH_AES_128_GCM_SHA256 = $030000A0; + {$EXTERNALSYM TLS1_CK_DH_RSA_WITH_AES_256_GCM_SHA384} + TLS1_CK_DH_RSA_WITH_AES_256_GCM_SHA384 = $030000A1; + {$EXTERNALSYM TLS1_CK_DHE_DSS_WITH_AES_128_GCM_SHA256} + TLS1_CK_DHE_DSS_WITH_AES_128_GCM_SHA256 = $030000A2; + {$EXTERNALSYM TLS1_CK_DHE_DSS_WITH_AES_256_GCM_SHA384} + TLS1_CK_DHE_DSS_WITH_AES_256_GCM_SHA384 = $030000A3; + {$EXTERNALSYM TLS1_CK_DH_DSS_WITH_AES_128_GCM_SHA256} + TLS1_CK_DH_DSS_WITH_AES_128_GCM_SHA256 = $030000A4; + {$EXTERNALSYM TLS1_CK_DH_DSS_WITH_AES_256_GCM_SHA384} + TLS1_CK_DH_DSS_WITH_AES_256_GCM_SHA384 = $030000A5; + {$EXTERNALSYM TLS1_CK_ADH_WITH_AES_128_GCM_SHA256} + TLS1_CK_ADH_WITH_AES_128_GCM_SHA256 = $030000A6; + {$EXTERNALSYM TLS1_CK_ADH_WITH_AES_256_GCM_SHA384} + TLS1_CK_ADH_WITH_AES_256_GCM_SHA384 = $030000A7; +//* ECC ciphersuites from draft-ietf-tls-ecc-12.txt with changes soon to be in draft 13 */ + {$EXTERNALSYM TLS1_CK_ECDH_ECDSA_WITH_NULL_SHA} + TLS1_CK_ECDH_ECDSA_WITH_NULL_SHA = $0300C001; + {$EXTERNALSYM TLS1_CK_ECDH_ECDSA_WITH_RC4_128_SHA} + TLS1_CK_ECDH_ECDSA_WITH_RC4_128_SHA = $0300C002; + {$EXTERNALSYM TLS1_CK_ECDH_ECDSA_WITH_DES_192_CBC3_SHA} + TLS1_CK_ECDH_ECDSA_WITH_DES_192_CBC3_SHA = $0300C003; + {$EXTERNALSYM TLS1_CK_ECDH_ECDSA_WITH_AES_128_CBC_SHA} + TLS1_CK_ECDH_ECDSA_WITH_AES_128_CBC_SHA = $0300C004; + {$EXTERNALSYM TLS1_CK_ECDH_ECDSA_WITH_AES_256_CBC_SHA} + TLS1_CK_ECDH_ECDSA_WITH_AES_256_CBC_SHA = $0300C005; + {$EXTERNALSYM TLS1_CK_ECDHE_ECDSA_WITH_NULL_SHA} + TLS1_CK_ECDHE_ECDSA_WITH_NULL_SHA = $0300C006; + {$EXTERNALSYM TLS1_CK_ECDHE_ECDSA_WITH_RC4_128_SHA} + TLS1_CK_ECDHE_ECDSA_WITH_RC4_128_SHA = $0300C007; + {$EXTERNALSYM TLS1_CK_ECDHE_ECDSA_WITH_DES_192_CBC3_SHA} + TLS1_CK_ECDHE_ECDSA_WITH_DES_192_CBC3_SHA = $0300C008; + {$EXTERNALSYM TLS1_CK_ECDHE_ECDSA_WITH_AES_128_CBC_SHA} + TLS1_CK_ECDHE_ECDSA_WITH_AES_128_CBC_SHA = $0300C009; + {$EXTERNALSYM TLS1_CK_ECDHE_ECDSA_WITH_AES_256_CBC_SHA} + TLS1_CK_ECDHE_ECDSA_WITH_AES_256_CBC_SHA = $0300C00A; + {$EXTERNALSYM TLS1_CK_ECDH_RSA_WITH_NULL_SHA} + TLS1_CK_ECDH_RSA_WITH_NULL_SHA = $0300C00B; + {$EXTERNALSYM TLS1_CK_ECDH_RSA_WITH_RC4_128_SHA} + TLS1_CK_ECDH_RSA_WITH_RC4_128_SHA = $0300C00C; + {$EXTERNALSYM TLS1_CK_ECDH_RSA_WITH_DES_192_CBC3_SHA} + TLS1_CK_ECDH_RSA_WITH_DES_192_CBC3_SHA = $0300C00D; + {$EXTERNALSYM TLS1_CK_ECDH_RSA_WITH_AES_128_CBC_SHA} + TLS1_CK_ECDH_RSA_WITH_AES_128_CBC_SHA = $0300C00E; + {$EXTERNALSYM TLS1_CK_ECDH_RSA_WITH_AES_256_CBC_SHA} + TLS1_CK_ECDH_RSA_WITH_AES_256_CBC_SHA = $0300C00F; + {$EXTERNALSYM TLS1_CK_ECDHE_RSA_WITH_NULL_SHA} + TLS1_CK_ECDHE_RSA_WITH_NULL_SHA = $0300C010; + {$EXTERNALSYM TLS1_CK_ECDHE_RSA_WITH_RC4_128_SHA} + TLS1_CK_ECDHE_RSA_WITH_RC4_128_SHA = $0300C011; + {$EXTERNALSYM TLS1_CK_ECDHE_RSA_WITH_DES_192_CBC3_SHA} + TLS1_CK_ECDHE_RSA_WITH_DES_192_CBC3_SHA = $0300C012; + {$EXTERNALSYM TLS1_CK_ECDHE_RSA_WITH_AES_128_CBC_SHA} + TLS1_CK_ECDHE_RSA_WITH_AES_128_CBC_SHA = $0300C013; + {$EXTERNALSYM TLS1_CK_ECDHE_RSA_WITH_AES_256_CBC_SHA} + TLS1_CK_ECDHE_RSA_WITH_AES_256_CBC_SHA = $0300C014; + {$EXTERNALSYM TLS1_CK_ECDH_anon_WITH_NULL_SHA} + TLS1_CK_ECDH_anon_WITH_NULL_SHA = $0300C015; + {$EXTERNALSYM TLS1_CK_ECDH_anon_WITH_RC4_128_SHA} + TLS1_CK_ECDH_anon_WITH_RC4_128_SHA = $0300C016; + {$EXTERNALSYM TLS1_CK_ECDH_anon_WITH_DES_192_CBC3_SHA} + TLS1_CK_ECDH_anon_WITH_DES_192_CBC3_SHA = $0300C017; + {$EXTERNALSYM TLS1_CK_ECDH_anon_WITH_AES_128_CBC_SHA} + TLS1_CK_ECDH_anon_WITH_AES_128_CBC_SHA = $0300C018; + {$EXTERNALSYM TLS1_CK_ECDH_anon_WITH_AES_256_CBC_SHA} + TLS1_CK_ECDH_anon_WITH_AES_256_CBC_SHA = $0300C019; +//* SRP ciphersuites from RFC 5054 */ + {$EXTERNALSYM TLS1_CK_SRP_SHA_WITH_3DES_EDE_CBC_SHA} + TLS1_CK_SRP_SHA_WITH_3DES_EDE_CBC_SHA = $0300C01A; + {$EXTERNALSYM TLS1_CK_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA} + TLS1_CK_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA = $0300C01B; + {$EXTERNALSYM TLS1_CK_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA} + TLS1_CK_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA = $0300C01C; + {$EXTERNALSYM TLS1_CK_SRP_SHA_WITH_AES_128_CBC_SHA} + TLS1_CK_SRP_SHA_WITH_AES_128_CBC_SHA = $0300C01D; + {$EXTERNALSYM TLS1_CK_SRP_SHA_RSA_WITH_AES_128_CBC_SHA} + TLS1_CK_SRP_SHA_RSA_WITH_AES_128_CBC_SHA = $0300C01E; + {$EXTERNALSYM TLS1_CK_SRP_SHA_DSS_WITH_AES_128_CBC_SHA} + TLS1_CK_SRP_SHA_DSS_WITH_AES_128_CBC_SHA = $0300C01F; + {$EXTERNALSYM TLS1_CK_SRP_SHA_WITH_AES_256_CBC_SHA} + TLS1_CK_SRP_SHA_WITH_AES_256_CBC_SHA = $0300C020; + {$EXTERNALSYM TLS1_CK_SRP_SHA_RSA_WITH_AES_256_CBC_SHA} + TLS1_CK_SRP_SHA_RSA_WITH_AES_256_CBC_SHA = $0300C021; + {$EXTERNALSYM TLS1_CK_SRP_SHA_DSS_WITH_AES_256_CBC_SHA} + TLS1_CK_SRP_SHA_DSS_WITH_AES_256_CBC_SHA = $0300C022; + +//* ECDH HMAC based ciphersuites from RFC5289 */ + + {$EXTERNALSYM TLS1_CK_ECDHE_ECDSA_WITH_AES_128_SHA256} + TLS1_CK_ECDHE_ECDSA_WITH_AES_128_SHA256 = $0300C023; + {$EXTERNALSYM TLS1_CK_ECDHE_ECDSA_WITH_AES_256_SHA384} + TLS1_CK_ECDHE_ECDSA_WITH_AES_256_SHA384 = $0300C024; + {$EXTERNALSYM TLS1_CK_ECDH_ECDSA_WITH_AES_128_SHA256} + TLS1_CK_ECDH_ECDSA_WITH_AES_128_SHA256 = $0300C025; + {$EXTERNALSYM TLS1_CK_ECDH_ECDSA_WITH_AES_256_SHA384} + TLS1_CK_ECDH_ECDSA_WITH_AES_256_SHA384 = $0300C026; + {$EXTERNALSYM TLS1_CK_ECDHE_RSA_WITH_AES_128_SHA256} + TLS1_CK_ECDHE_RSA_WITH_AES_128_SHA256 = $0300C027; + {$EXTERNALSYM TLS1_CK_ECDHE_RSA_WITH_AES_256_SHA384} + TLS1_CK_ECDHE_RSA_WITH_AES_256_SHA384 = $0300C028; + {$EXTERNALSYM TLS1_CK_ECDH_RSA_WITH_AES_128_SHA256} + TLS1_CK_ECDH_RSA_WITH_AES_128_SHA256 = $0300C029; + {$EXTERNALSYM TLS1_CK_ECDH_RSA_WITH_AES_256_SHA384} + TLS1_CK_ECDH_RSA_WITH_AES_256_SHA384 = $0300C02A; + +//* ECDH GCM based ciphersuites from RFC5289 */ + {$EXTERNALSYM TLS1_CK_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256} + TLS1_CK_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 = $0300C02B; + {$EXTERNALSYM TLS1_CK_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384} + TLS1_CK_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 = $0300C02C; + {$EXTERNALSYM TLS1_CK_ECDH_ECDSA_WITH_AES_128_GCM_SHA256} + TLS1_CK_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 = $0300C02D; + {$EXTERNALSYM TLS1_CK_ECDH_ECDSA_WITH_AES_256_GCM_SHA384} + TLS1_CK_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 = $0300C02E; + {$EXTERNALSYM TLS1_CK_ECDHE_RSA_WITH_AES_128_GCM_SHA256} + TLS1_CK_ECDHE_RSA_WITH_AES_128_GCM_SHA256 = $0300C02F; + {$EXTERNALSYM TLS1_CK_ECDHE_RSA_WITH_AES_256_GCM_SHA384} + TLS1_CK_ECDHE_RSA_WITH_AES_256_GCM_SHA384 = $0300C030; + {$EXTERNALSYM TLS1_CK_ECDH_RSA_WITH_AES_128_GCM_SHA256} + TLS1_CK_ECDH_RSA_WITH_AES_128_GCM_SHA256 = $0300C031; + {$EXTERNALSYM TLS1_CK_ECDH_RSA_WITH_AES_256_GCM_SHA384} + TLS1_CK_ECDH_RSA_WITH_AES_256_GCM_SHA384 = $0300C032; + + + {$EXTERNALSYM TLS1_FINISH_MAC_LENGTH} + TLS1_FINISH_MAC_LENGTH = 12; + {$EXTERNALSYM TLS1_TXT_RSA_EXPORT1024_WITH_RC4_56_MD5} + TLS1_TXT_RSA_EXPORT1024_WITH_RC4_56_MD5 = 'EXP1024-RC4-MD5'; + {$EXTERNALSYM TLS1_TXT_RSA_EXPORT1024_WITH_RC2_CBC_56_MD5} + TLS1_TXT_RSA_EXPORT1024_WITH_RC2_CBC_56_MD5 = 'EXP1024-RC2-CBC-MD5'; + {$EXTERNALSYM TLS1_TXT_RSA_EXPORT1024_WITH_DES_CBC_SHA} + TLS1_TXT_RSA_EXPORT1024_WITH_DES_CBC_SHA = 'EXP1024-DES-CBC-SHA'; + {$EXTERNALSYM TLS1_TXT_DHE_DSS_EXPORT1024_WITH_DES_CBC_SHA} + TLS1_TXT_DHE_DSS_EXPORT1024_WITH_DES_CBC_SHA = 'EXP1024-DHE-DSS-DES-CBC-SHA'; + {$EXTERNALSYM TLS1_TXT_RSA_EXPORT1024_WITH_RC4_56_SHA} + TLS1_TXT_RSA_EXPORT1024_WITH_RC4_56_SHA = 'EXP1024-RC4-SHA'; + {$EXTERNALSYM TLS1_TXT_DHE_DSS_EXPORT1024_WITH_RC4_56_SHA} + TLS1_TXT_DHE_DSS_EXPORT1024_WITH_RC4_56_SHA = 'EXP1024-DHE-DSS-RC4-SHA'; + {$EXTERNALSYM TLS1_TXT_DHE_DSS_WITH_RC4_128_SHA} + TLS1_TXT_DHE_DSS_WITH_RC4_128_SHA = 'DHE-DSS-RC4-SHA'; +//* AES ciphersuites from RFC3268 */ + {$EXTERNALSYM TLS1_TXT_RSA_WITH_AES_128_SHA} + TLS1_TXT_RSA_WITH_AES_128_SHA = 'AES128-SHA'; + {$EXTERNALSYM TLS1_TXT_DH_DSS_WITH_AES_128_SHA} + TLS1_TXT_DH_DSS_WITH_AES_128_SHA ='DH-DSS-AES128-SHA'; + {$EXTERNALSYM TLS1_TXT_DH_RSA_WITH_AES_128_SHA} + TLS1_TXT_DH_RSA_WITH_AES_128_SHA = 'DH-RSA-AES128-SHA'; + {$EXTERNALSYM TLS1_TXT_DHE_DSS_WITH_AES_128_SHA} + TLS1_TXT_DHE_DSS_WITH_AES_128_SHA = 'DHE-DSS-AES128-SHA'; + {$EXTERNALSYM TLS1_TXT_DHE_RSA_WITH_AES_128_SHA} + TLS1_TXT_DHE_RSA_WITH_AES_128_SHA = 'DHE-RSA-AES128-SHA'; + {$EXTERNALSYM TLS1_TXT_ADH_WITH_AES_128_SHA} + TLS1_TXT_ADH_WITH_AES_128_SHA = 'ADH-AES128-SHA'; + {$EXTERNALSYM TLS1_TXT_RSA_WITH_AES_256_SHA} + TLS1_TXT_RSA_WITH_AES_256_SHA = 'AES256-SHA'; + {$EXTERNALSYM TLS1_TXT_DH_DSS_WITH_AES_256_SHA} + TLS1_TXT_DH_DSS_WITH_AES_256_SHA ='DH-DSS-AES256-SHA'; + {$EXTERNALSYM TLS1_TXT_DH_RSA_WITH_AES_256_SHA} + TLS1_TXT_DH_RSA_WITH_AES_256_SHA = 'DH-RSA-AES256-SHA'; + {$EXTERNALSYM TLS1_TXT_DHE_DSS_WITH_AES_256_SHA} + TLS1_TXT_DHE_DSS_WITH_AES_256_SHA = 'DHE-DSS-AES256-SHA'; + {$EXTERNALSYM TLS1_TXT_DHE_RSA_WITH_AES_256_SHA} + TLS1_TXT_DHE_RSA_WITH_AES_256_SHA ='DHE-RSA-AES256-SHA'; + {$EXTERNALSYM TLS1_TXT_ADH_WITH_AES_256_SHA} + TLS1_TXT_ADH_WITH_AES_256_SHA = 'ADH-AES256-SHA'; +//* ECC ciphersuites from draft-ietf-tls-ecc-01.txt (Mar 15, 2001) */ + {$EXTERNALSYM TLS1_TXT_ECDH_ECDSA_WITH_NULL_SHA} + TLS1_TXT_ECDH_ECDSA_WITH_NULL_SHA = 'ECDH-ECDSA-NULL-SHA'; + {$EXTERNALSYM TLS1_TXT_ECDH_ECDSA_WITH_RC4_128_SHA} + TLS1_TXT_ECDH_ECDSA_WITH_RC4_128_SHA = 'ECDH-ECDSA-RC4-SHA'; + {$EXTERNALSYM TLS1_TXT_ECDH_ECDSA_WITH_DES_192_CBC3_SHA} + TLS1_TXT_ECDH_ECDSA_WITH_DES_192_CBC3_SHA = 'ECDH-ECDSA-DES-CBC3-SHA'; + {$EXTERNALSYM TLS1_TXT_ECDH_ECDSA_WITH_AES_128_CBC_SHA} + TLS1_TXT_ECDH_ECDSA_WITH_AES_128_CBC_SHA = 'ECDH-ECDSA-AES128-SHA'; + {$EXTERNALSYM TLS1_TXT_ECDH_ECDSA_WITH_AES_256_CBC_SHA} + TLS1_TXT_ECDH_ECDSA_WITH_AES_256_CBC_SHA = 'ECDH-ECDSA-AES256-SHA'; + {$EXTERNALSYM TLS1_TXT_ECDHE_ECDSA_WITH_NULL_SHA} + TLS1_TXT_ECDHE_ECDSA_WITH_NULL_SHA = 'ECDHE-ECDSA-NULL-SHA'; + {$EXTERNALSYM TLS1_TXT_ECDHE_ECDSA_WITH_RC4_128_SHA} + TLS1_TXT_ECDHE_ECDSA_WITH_RC4_128_SHA = 'ECDHE-ECDSA-RC4-SHA'; + {$EXTERNALSYM TLS1_TXT_ECDHE_ECDSA_WITH_DES_192_CBC3_SHA} + TLS1_TXT_ECDHE_ECDSA_WITH_DES_192_CBC3_SHA = 'ECDHE-ECDSA-DES-CBC3-SHA'; + {$EXTERNALSYM TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_CBC_SHA} + TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_CBC_SHA = 'ECDHE-ECDSA-AES128-SHA'; + {$EXTERNALSYM TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_CBC_SHA} + TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_CBC_SHA = 'ECDHE-ECDSA-AES256-SHA'; + {$EXTERNALSYM TLS1_TXT_ECDH_RSA_WITH_NULL_SHA} + TLS1_TXT_ECDH_RSA_WITH_NULL_SHA = 'ECDH-RSA-NULL-SHA'; + {$EXTERNALSYM TLS1_TXT_ECDH_RSA_WITH_RC4_128_SHA} + TLS1_TXT_ECDH_RSA_WITH_RC4_128_SHA = 'ECDH-RSA-RC4-SHA'; + {$EXTERNALSYM TLS1_TXT_ECDH_RSA_WITH_DES_192_CBC3_SHA} + TLS1_TXT_ECDH_RSA_WITH_DES_192_CBC3_SHA = 'ECDH-RSA-DES-CBC3-SHA'; + {$EXTERNALSYM TLS1_TXT_ECDH_RSA_WITH_AES_128_CBC_SHA} + TLS1_TXT_ECDH_RSA_WITH_AES_128_CBC_SHA = 'ECDH-RSA-AES128-SHA'; + {$EXTERNALSYM TLS1_TXT_ECDH_RSA_WITH_AES_256_CBC_SHA} + TLS1_TXT_ECDH_RSA_WITH_AES_256_CBC_SHA = 'ECDH-RSA-AES256-SHA'; + {$EXTERNALSYM TLS1_TXT_ECDHE_RSA_WITH_NULL_SHA} + TLS1_TXT_ECDHE_RSA_WITH_NULL_SHA = 'ECDHE-RSA-NULL-SHA'; + {$EXTERNALSYM TLS1_TXT_ECDHE_RSA_WITH_RC4_128_SHA} + TLS1_TXT_ECDHE_RSA_WITH_RC4_128_SHA = 'ECDHE-RSA-RC4-SHA'; + {$EXTERNALSYM TLS1_TXT_ECDHE_RSA_WITH_DES_192_CBC3_SHA} + TLS1_TXT_ECDHE_RSA_WITH_DES_192_CBC3_SHA = 'ECDHE-RSA-DES-CBC3-SHA'; + {$EXTERNALSYM TLS1_TXT_ECDHE_RSA_WITH_AES_128_CBC_SHA} + TLS1_TXT_ECDHE_RSA_WITH_AES_128_CBC_SHA = 'ECDHE-RSA-AES128-SHA'; + {$EXTERNALSYM TLS1_TXT_ECDHE_RSA_WITH_AES_256_CBC_SHA} + TLS1_TXT_ECDHE_RSA_WITH_AES_256_CBC_SHA = 'ECDHE-RSA-AES256-SHA'; + {$EXTERNALSYM TLS1_TXT_ECDH_anon_WITH_NULL_SHA} + TLS1_TXT_ECDH_anon_WITH_NULL_SHA = 'AECDH-NULL-SHA'; + {$EXTERNALSYM TLS1_TXT_ECDH_anon_WITH_RC4_128_SHA} + TLS1_TXT_ECDH_anon_WITH_RC4_128_SHA = 'AECDH-RC4-SHA'; + {$EXTERNALSYM TLS1_TXT_ECDH_anon_WITH_DES_192_CBC3_SHA} + TLS1_TXT_ECDH_anon_WITH_DES_192_CBC3_SHA = 'AECDH-DES-CBC3-SHA'; + {$EXTERNALSYM TLS1_TXT_ECDH_anon_WITH_AES_128_CBC_SHA} + TLS1_TXT_ECDH_anon_WITH_AES_128_CBC_SHA = 'AECDH-AES128-SHA'; + {$EXTERNALSYM TLS1_TXT_ECDH_anon_WITH_AES_256_CBC_SHA} + TLS1_TXT_ECDH_anon_WITH_AES_256_CBC_SHA = 'AECDH-AES256-SHA'; +//* Camellia ciphersuites from RFC4132 */ + {$EXTERNALSYM TLS1_TXT_RSA_WITH_CAMELLIA_128_CBC_SHA} + TLS1_TXT_RSA_WITH_CAMELLIA_128_CBC_SHA = 'CAMELLIA128-SHA'; + {$EXTERNALSYM TLS1_TXT_DH_DSS_WITH_CAMELLIA_128_CBC_SHA} + TLS1_TXT_DH_DSS_WITH_CAMELLIA_128_CBC_SHA = 'DH-DSS-CAMELLIA128-SHA'; + {$EXTERNALSYM TLS1_TXT_DH_RSA_WITH_CAMELLIA_128_CBC_SHA} + TLS1_TXT_DH_RSA_WITH_CAMELLIA_128_CBC_SHA = 'DH-RSA-CAMELLIA128-SHA'; + {$EXTERNALSYM TLS1_TXT_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA} + TLS1_TXT_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA = 'DHE-DSS-CAMELLIA128-SHA'; + {$EXTERNALSYM TLS1_TXT_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA} + TLS1_TXT_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA = 'DHE-RSA-CAMELLIA128-SHA'; + {$EXTERNALSYM TLS1_TXT_ADH_WITH_CAMELLIA_128_CBC_SHA} + TLS1_TXT_ADH_WITH_CAMELLIA_128_CBC_SHA = 'ADH-CAMELLIA128-SHA'; + {$EXTERNALSYM TLS1_TXT_RSA_WITH_CAMELLIA_256_CBC_SHA} + TLS1_TXT_RSA_WITH_CAMELLIA_256_CBC_SHA = 'CAMELLIA256-SHA'; + {$EXTERNALSYM TLS1_TXT_DH_DSS_WITH_CAMELLIA_256_CBC_SHA} + TLS1_TXT_DH_DSS_WITH_CAMELLIA_256_CBC_SHA = 'DH-DSS-CAMELLIA256-SHA'; + {$EXTERNALSYM TLS1_TXT_DH_RSA_WITH_CAMELLIA_256_CBC_SHA} + TLS1_TXT_DH_RSA_WITH_CAMELLIA_256_CBC_SHA = 'DH-RSA-CAMELLIA256-SHA'; + {$EXTERNALSYM TLS1_TXT_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA} + TLS1_TXT_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA = 'DHE-DSS-CAMELLIA256-SHA'; + {$EXTERNALSYM TLS1_TXT_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA} + TLS1_TXT_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA = 'DHE-RSA-CAMELLIA256-SHA'; + {$EXTERNALSYM TLS1_TXT_ADH_WITH_CAMELLIA_256_CBC_SHA} + TLS1_TXT_ADH_WITH_CAMELLIA_256_CBC_SHA = 'ADH-CAMELLIA256-SHA'; +//* SEED ciphersuites from RFC4162 */ + {$EXTERNALSYM TLS1_TXT_RSA_WITH_SEED_SHA} + TLS1_TXT_RSA_WITH_SEED_SHA = 'SEED-SHA'; + {$EXTERNALSYM TLS1_TXT_DH_DSS_WITH_SEED_SHA} + TLS1_TXT_DH_DSS_WITH_SEED_SHA = 'DH-DSS-SEED-SHA'; + {$EXTERNALSYM TLS1_TXT_DH_RSA_WITH_SEED_SHA} + TLS1_TXT_DH_RSA_WITH_SEED_SHA = 'DH-RSA-SEED-SHA'; + {$EXTERNALSYM TLS1_TXT_DHE_DSS_WITH_SEED_SHA} + TLS1_TXT_DHE_DSS_WITH_SEED_SHA = 'DHE-DSS-SEED-SHA'; + {$EXTERNALSYM TLS1_TXT_DHE_RSA_WITH_SEED_SHA} + TLS1_TXT_DHE_RSA_WITH_SEED_SHA = 'DHE-RSA-SEED-SHA'; + {$EXTERNALSYM TLS1_TXT_ADH_WITH_SEED_SHA} + TLS1_TXT_ADH_WITH_SEED_SHA = 'ADH-SEED-SHA'; +//* TLS v1.2 ciphersuites */ + {$EXTERNALSYM TLS1_TXT_RSA_WITH_NULL_SHA256} + TLS1_TXT_RSA_WITH_NULL_SHA256 = 'NULL-SHA256'; + {$EXTERNALSYM TLS1_TXT_RSA_WITH_AES_128_SHA256} + TLS1_TXT_RSA_WITH_AES_128_SHA256 = 'AES128-SHA256'; + {$EXTERNALSYM TLS1_TXT_RSA_WITH_AES_256_SHA256} + TLS1_TXT_RSA_WITH_AES_256_SHA256 = 'AES256-SHA256'; + {$EXTERNALSYM TLS1_TXT_DH_DSS_WITH_AES_128_SHA256} + TLS1_TXT_DH_DSS_WITH_AES_128_SHA256 = 'DH-DSS-AES128-SHA256'; + {$EXTERNALSYM TLS1_TXT_DH_RSA_WITH_AES_128_SHA256} + TLS1_TXT_DH_RSA_WITH_AES_128_SHA256 = 'DH-RSA-AES128-SHA256'; + {$EXTERNALSYM TLS1_TXT_DHE_DSS_WITH_AES_128_SHA256} + TLS1_TXT_DHE_DSS_WITH_AES_128_SHA256 = 'DHE-DSS-AES128-SHA256'; + {$EXTERNALSYM TLS1_TXT_DHE_RSA_WITH_AES_128_SHA256} + TLS1_TXT_DHE_RSA_WITH_AES_128_SHA256 = 'DHE-RSA-AES128-SHA256'; + {$EXTERNALSYM TLS1_TXT_DH_DSS_WITH_AES_256_SHA256} + TLS1_TXT_DH_DSS_WITH_AES_256_SHA256 = 'DH-DSS-AES256-SHA256'; + {$EXTERNALSYM TLS1_TXT_DH_RSA_WITH_AES_256_SHA256} + TLS1_TXT_DH_RSA_WITH_AES_256_SHA256 = 'DH-RSA-AES256-SHA256'; + {$EXTERNALSYM TLS1_TXT_DHE_DSS_WITH_AES_256_SHA256} + TLS1_TXT_DHE_DSS_WITH_AES_256_SHA256 = 'DHE-DSS-AES256-SHA256'; + {$EXTERNALSYM TLS1_TXT_DHE_RSA_WITH_AES_256_SHA256} + TLS1_TXT_DHE_RSA_WITH_AES_256_SHA256 = 'DHE-RSA-AES256-SHA256'; + {$EXTERNALSYM TLS1_TXT_ADH_WITH_AES_128_SHA256} + TLS1_TXT_ADH_WITH_AES_128_SHA256 = 'ADH-AES128-SHA256'; + {$EXTERNALSYM TLS1_TXT_ADH_WITH_AES_256_SHA256} + TLS1_TXT_ADH_WITH_AES_256_SHA256 = 'ADH-AES256-SHA256'; + +//* TLS v1.2 GCM ciphersuites from RFC5288 */ + {$EXTERNALSYM TLS1_TXT_RSA_WITH_AES_128_GCM_SHA256} + TLS1_TXT_RSA_WITH_AES_128_GCM_SHA256 = 'AES128-GCM-SHA256'; + {$EXTERNALSYM TLS1_TXT_RSA_WITH_AES_256_GCM_SHA384} + TLS1_TXT_RSA_WITH_AES_256_GCM_SHA384 = 'AES256-GCM-SHA384'; + {$EXTERNALSYM TLS1_TXT_DHE_RSA_WITH_AES_128_GCM_SHA256} +TLS1_TXT_DHE_RSA_WITH_AES_128_GCM_SHA256 = 'DHE-RSA-AES128-GCM-SHA256'; + {$EXTERNALSYM TLS1_TXT_DHE_RSA_WITH_AES_256_GCM_SHA384} +TLS1_TXT_DHE_RSA_WITH_AES_256_GCM_SHA384 = 'DHE-RSA-AES256-GCM-SHA384'; + {$EXTERNALSYM TLS1_TXT_DH_RSA_WITH_AES_128_GCM_SHA256} + TLS1_TXT_DH_RSA_WITH_AES_128_GCM_SHA256 = 'DH-RSA-AES128-GCM-SHA256'; + {$EXTERNALSYM TLS1_TXT_DH_RSA_WITH_AES_256_GCM_SHA384} + TLS1_TXT_DH_RSA_WITH_AES_256_GCM_SHA384 = 'DH-RSA-AES256-GCM-SHA384'; + {$EXTERNALSYM TLS1_TXT_DHE_DSS_WITH_AES_128_GCM_SHA256} + TLS1_TXT_DHE_DSS_WITH_AES_128_GCM_SHA256 = 'DHE-DSS-AES128-GCM-SHA256'; + {$EXTERNALSYM TLS1_TXT_DHE_DSS_WITH_AES_256_GCM_SHA384} + TLS1_TXT_DHE_DSS_WITH_AES_256_GCM_SHA384 = 'DHE-DSS-AES256-GCM-SHA384'; + {$EXTERNALSYM TLS1_TXT_DH_DSS_WITH_AES_128_GCM_SHA256} + TLS1_TXT_DH_DSS_WITH_AES_128_GCM_SHA256 = 'DH-DSS-AES128-GCM-SHA256'; + {$EXTERNALSYM TLS1_TXT_DH_DSS_WITH_AES_256_GCM_SHA384} + TLS1_TXT_DH_DSS_WITH_AES_256_GCM_SHA384 = 'DH-DSS-AES256-GCM-SHA384'; + {$EXTERNALSYM TLS1_TXT_ADH_WITH_AES_128_GCM_SHA256} + TLS1_TXT_ADH_WITH_AES_128_GCM_SHA256 = 'ADH-AES128-GCM-SHA256'; + {$EXTERNALSYM TLS1_TXT_ADH_WITH_AES_256_GCM_SHA384} + TLS1_TXT_ADH_WITH_AES_256_GCM_SHA384 = 'ADH-AES256-GCM-SHA384'; + +//* ECDH HMAC based ciphersuites from RFC5289 */ + + {$EXTERNALSYM TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_SHA256} + TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_SHA256 = 'ECDHE-ECDSA-AES128-SHA256'; + {$EXTERNALSYM TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_SHA384} + TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_SHA384 = 'ECDHE-ECDSA-AES256-SHA384'; + {$EXTERNALSYM TLS1_TXT_ECDH_ECDSA_WITH_AES_128_SHA256} + TLS1_TXT_ECDH_ECDSA_WITH_AES_128_SHA256 = 'ECDH-ECDSA-AES128-SHA256'; + {$EXTERNALSYM TLS1_TXT_ECDH_ECDSA_WITH_AES_256_SHA384} + TLS1_TXT_ECDH_ECDSA_WITH_AES_256_SHA384 = 'ECDH-ECDSA-AES256-SHA384'; + {$EXTERNALSYM TLS1_TXT_ECDHE_RSA_WITH_AES_128_SHA256} + TLS1_TXT_ECDHE_RSA_WITH_AES_128_SHA256 = 'ECDHE-RSA-AES128-SHA256'; + {$EXTERNALSYM TLS1_TXT_ECDHE_RSA_WITH_AES_256_SHA384} + TLS1_TXT_ECDHE_RSA_WITH_AES_256_SHA384 = 'ECDHE-RSA-AES256-SHA384'; + {$EXTERNALSYM TLS1_TXT_ECDH_RSA_WITH_AES_128_SHA256} + TLS1_TXT_ECDH_RSA_WITH_AES_128_SHA256 = 'ECDH-RSA-AES128-SHA256'; + {$EXTERNALSYM TLS1_TXT_ECDH_RSA_WITH_AES_256_SHA384} + TLS1_TXT_ECDH_RSA_WITH_AES_256_SHA384 = 'ECDH-RSA-AES256-SHA384'; + +//* ECDH GCM based ciphersuites from RFC5289 */ + {$EXTERNALSYM TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256} + TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 = 'ECDHE-ECDSA-AES128-GCM-SHA256'; + {$EXTERNALSYM TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384} + TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 = 'ECDHE-ECDSA-AES256-GCM-SHA384'; + {$EXTERNALSYM TLS1_TXT_ECDH_ECDSA_WITH_AES_128_GCM_SHA256} + TLS1_TXT_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 = 'ECDH-ECDSA-AES128-GCM-SHA256'; + {$EXTERNALSYM TLS1_TXT_ECDH_ECDSA_WITH_AES_256_GCM_SHA384} + TLS1_TXT_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 = 'ECDH-ECDSA-AES256-GCM-SHA384'; + {$EXTERNALSYM TLS1_TXT_ECDHE_RSA_WITH_AES_128_GCM_SHA256} + TLS1_TXT_ECDHE_RSA_WITH_AES_128_GCM_SHA256 = 'ECDHE-RSA-AES128-GCM-SHA256'; + {$EXTERNALSYM TLS1_TXT_ECDHE_RSA_WITH_AES_256_GCM_SHA384} + TLS1_TXT_ECDHE_RSA_WITH_AES_256_GCM_SHA384 = 'ECDHE-RSA-AES256-GCM-SHA384'; + {$EXTERNALSYM TLS1_TXT_ECDH_RSA_WITH_AES_128_GCM_SHA256} + TLS1_TXT_ECDH_RSA_WITH_AES_128_GCM_SHA256 = 'ECDH-RSA-AES128-GCM-SHA256'; + {$EXTERNALSYM TLS1_TXT_ECDH_RSA_WITH_AES_256_GCM_SHA384} + TLS1_TXT_ECDH_RSA_WITH_AES_256_GCM_SHA384 = 'ECDH-RSA-AES256-GCM-SHA384'; + + {$EXTERNALSYM TLS_CT_RSA_SIGN} + TLS_CT_RSA_SIGN = 1; + {$EXTERNALSYM TLS_CT_DSS_SIGN} + TLS_CT_DSS_SIGN = 2; + {$EXTERNALSYM TLS_CT_RSA_FIXED_DH} + TLS_CT_RSA_FIXED_DH = 3; + {$EXTERNALSYM TLS_CT_DSS_FIXED_DH} + TLS_CT_DSS_FIXED_DH = 4; + {$EXTERNALSYM TLS_CT_ECDSA_SIGN} + TLS_CT_ECDSA_SIGN = 64; + {$EXTERNALSYM TLS_CT_RSA_FIXED_ECDH} + TLS_CT_RSA_FIXED_ECDH = 65; + {$EXTERNALSYM TLS_CT_ECDSA_FIXED_ECDH} + TLS_CT_ECDSA_FIXED_ECDH = 66; + {$EXTERNALSYM TLS_CT_GOST94_SIGN} + TLS_CT_GOST94_SIGN = 21; + {$EXTERNALSYM TLS_CT_GOST01_SIGN} + TLS_CT_GOST01_SIGN = 22; +///* when correcting this number, correct also SSL3_CT_NUMBER in ssl3.h (see +// * comment there) */ + {$EXTERNALSYM TLS_CT_NUMBER} + TLS_CT_NUMBER = 9; //was 4; + + {$EXTERNALSYM TLS_MD_CLIENT_FINISH_CONST} + TLS_MD_CLIENT_FINISH_CONST = 'client finished'; {Do not localize} + {$EXTERNALSYM TLS_MD_CLIENT_FINISH_CONST_SIZE} + TLS_MD_CLIENT_FINISH_CONST_SIZE = 15; + {$EXTERNALSYM TLS_MD_SERVER_FINISH_CONST} + TLS_MD_SERVER_FINISH_CONST = 'server finished'; {Do not localize} + {$EXTERNALSYM TLS_MD_SERVER_FINISH_CONST_SIZE} + TLS_MD_SERVER_FINISH_CONST_SIZE = 15; + {$EXTERNALSYM TLS_MD_KEY_EXPANSION_CONST} + TLS_MD_KEY_EXPANSION_CONST = 'key expansion'; {Do not localize} + {$EXTERNALSYM TLS_MD_KEY_EXPANSION_CONST_SIZE} + TLS_MD_KEY_EXPANSION_CONST_SIZE = 13; + {$EXTERNALSYM TLS_MD_CLIENT_WRITE_KEY_CONST} + TLS_MD_CLIENT_WRITE_KEY_CONST = 'client write key'; {Do not localize} + {$EXTERNALSYM TLS_MD_CLIENT_WRITE_KEY_CONST_SIZE} + TLS_MD_CLIENT_WRITE_KEY_CONST_SIZE = 16; + {$EXTERNALSYM TLS_MD_SERVER_WRITE_KEY_CONST} + TLS_MD_SERVER_WRITE_KEY_CONST = 'server write key'; {Do not localize} + {$EXTERNALSYM TLS_MD_SERVER_WRITE_KEY_CONST_SIZE} + TLS_MD_SERVER_WRITE_KEY_CONST_SIZE = 16; + {$EXTERNALSYM TLS_MD_IV_BLOCK_CONST} + TLS_MD_IV_BLOCK_CONST = 'IV block'; {Do not localize} + {$EXTERNALSYM TLS_MD_IV_BLOCK_CONST_SIZE} + TLS_MD_IV_BLOCK_CONST_SIZE = 8; + {$EXTERNALSYM TLS_MD_MASTER_SECRET_CONST} + TLS_MD_MASTER_SECRET_CONST = 'master secret'; {Do not localize} + {$EXTERNALSYM TLS_MD_MASTER_SECRET_CONST_SIZE} + TLS_MD_MASTER_SECRET_CONST_SIZE = 13; + {$EXTERNALSYM TLS_MD_MAX_CONST_SIZE} + TLS_MD_MAX_CONST_SIZE = 20; + + {$EXTERNALSYM TMP_MAX} + TMP_MAX = 26; + {$EXTERNALSYM V_ASN1_APPLICATION} + V_ASN1_APPLICATION = $40; + {$EXTERNALSYM V_ASN1_APP_CHOOSE} + V_ASN1_APP_CHOOSE = -2; + {$EXTERNALSYM V_ASN1_BIT_STRING} + V_ASN1_BIT_STRING = 3; + {$EXTERNALSYM V_ASN1_BMPSTRING} + V_ASN1_BMPSTRING = 30; + {$EXTERNALSYM V_ASN1_BOOLEAN} + V_ASN1_BOOLEAN = 1; + {$EXTERNALSYM V_ASN1_CONSTRUCTED} + V_ASN1_CONSTRUCTED = $20; + {$EXTERNALSYM V_ASN1_CONTEXT_SPECIFIC} + V_ASN1_CONTEXT_SPECIFIC = $80; + {$EXTERNALSYM V_ASN1_ENUMERATED} + V_ASN1_ENUMERATED = 10; + {$EXTERNALSYM V_ASN1_EOC} + V_ASN1_EOC = 0; + {$EXTERNALSYM V_ASN1_EXTERNAL} + V_ASN1_EXTERNAL = 8; + {$EXTERNALSYM V_ASN1_GENERALIZEDTIME} + V_ASN1_GENERALIZEDTIME = 24; + {$EXTERNALSYM V_ASN1_GENERALSTRING} + V_ASN1_GENERALSTRING = 27; + {$EXTERNALSYM V_ASN1_GRAPHICSTRING} + V_ASN1_GRAPHICSTRING = 25; + {$EXTERNALSYM V_ASN1_IA5STRING} + V_ASN1_IA5STRING = 22; + {$EXTERNALSYM V_ASN1_INTEGER} + V_ASN1_INTEGER = 2; + {$EXTERNALSYM V_ASN1_ISO64STRING} + V_ASN1_ISO64STRING = 26; + {$EXTERNALSYM V_ASN1_NEG_ENUMERATED} + V_ASN1_NEG_ENUMERATED = 10+$100; + {$EXTERNALSYM V_ASN1_NEG_INTEGER} + V_ASN1_NEG_INTEGER = 2+$100; + {$EXTERNALSYM V_ASN1_NULL} + V_ASN1_NULL = 5; + {$EXTERNALSYM V_ASN1_NUMERICSTRING} + V_ASN1_NUMERICSTRING = 18; + {$EXTERNALSYM V_ASN1_OBJECT} + V_ASN1_OBJECT = 6; + {$EXTERNALSYM V_ASN1_OBJECT_DESCRIPTOR} + V_ASN1_OBJECT_DESCRIPTOR = 7; + {$EXTERNALSYM V_ASN1_OCTET_STRING} + V_ASN1_OCTET_STRING = 4; + {$EXTERNALSYM V_ASN1_PRIMATIVE_TAG} + V_ASN1_PRIMATIVE_TAG = $1f; + {$EXTERNALSYM V_ASN1_PRIMITIVE_TAG} + V_ASN1_PRIMITIVE_TAG = $1f; + {$EXTERNALSYM V_ASN1_PRINTABLESTRING} + V_ASN1_PRINTABLESTRING = 19; + {$EXTERNALSYM V_ASN1_PRIVATE} + V_ASN1_PRIVATE = $c0; + {$EXTERNALSYM V_ASN1_REAL} + V_ASN1_REAL = 9; + {$EXTERNALSYM V_ASN1_SEQUENCE} + V_ASN1_SEQUENCE = 16; + {$EXTERNALSYM V_ASN1_SET} + V_ASN1_SET = 17; + {$EXTERNALSYM V_ASN1_T61STRING} + V_ASN1_T61STRING = 20; + {$EXTERNALSYM V_ASN1_TELETEXSTRING} + V_ASN1_TELETEXSTRING = 20; + {$EXTERNALSYM V_ASN1_UNDEF} + V_ASN1_UNDEF = -1; + {$EXTERNALSYM V_ASN1_UNIVERSAL} + V_ASN1_UNIVERSAL = $00; + {$EXTERNALSYM V_ASN1_UNIVERSALSTRING} + V_ASN1_UNIVERSALSTRING = 28; + {$EXTERNALSYM V_ASN1_UTCTIME} + V_ASN1_UTCTIME = 23; + {$EXTERNALSYM V_ASN1_UTF8STRING} + V_ASN1_UTF8STRING = 12; + {$EXTERNALSYM V_ASN1_VIDEOTEXSTRING} + V_ASN1_VIDEOTEXSTRING = 21; + {$EXTERNALSYM V_ASN1_VISIBLESTRING} + V_ASN1_VISIBLESTRING = 26; + {$EXTERNALSYM WINNT} + WINNT = 1; + {$EXTERNALSYM X509_TRUST_DEFAULT} + X509_TRUST_DEFAULT = -1; //* Only valid in purpose settings */ + {$EXTERNALSYM X509_TRUST_COMPAT} + X509_TRUST_COMPAT = 1; + {$EXTERNALSYM X509_TRUST_SSL_CLIENT} + X509_TRUST_SSL_CLIENT = 2; + {$EXTERNALSYM X509_TRUST_SSL_SERVER} + X509_TRUST_SSL_SERVER = 3; + {$EXTERNALSYM X509_TRUST_EMAIL} + X509_TRUST_EMAIL = 4; + {$EXTERNALSYM X509_TRUST_OBJECT_SIGN} + X509_TRUST_OBJECT_SIGN = 5; + {$EXTERNALSYM X509_TRUST_OCSP_SIGN} + X509_TRUST_OCSP_SIGN = 6; + {$EXTERNALSYM X509_TRUST_OCSP_REQUEST} + X509_TRUST_OCSP_REQUEST = 7; + {$EXTERNALSYM X509_TRUST_TSA} + X509_TRUST_TSA = 8; + {$EXTERNALSYM X509_TRUST_MIN} + X509_TRUST_MIN = 1; + {$EXTERNALSYM X509_TRUST_MAX} + X509_TRUST_MAX = 8; + {$EXTERNALSYM X509_EXT_PACK_STRING} + X509_EXT_PACK_STRING = 2; + {$EXTERNALSYM X509_EXT_PACK_UNKNOWN} + X509_EXT_PACK_UNKNOWN = 1; + {$EXTERNALSYM X509_EX_V_INIT} + X509_EX_V_INIT = $0001; + {$EXTERNALSYM X509_EX_V_NETSCAPE_HACK} + X509_EX_V_NETSCAPE_HACK = $8000; + {$EXTERNALSYM X509_FILETYPE_DEFAULT} + X509_FILETYPE_DEFAULT = 3; + {$EXTERNALSYM X509_F_ADD_CERT_DIR} + X509_F_ADD_CERT_DIR = 100; + {$EXTERNALSYM X509_F_BY_FILE_CTRL} + X509_F_BY_FILE_CTRL = 101; + {$EXTERNALSYM X509_F_DIR_CTRL} + X509_F_DIR_CTRL = 102; + {$EXTERNALSYM X509_F_GET_CERT_BY_SUBJECT} + X509_F_GET_CERT_BY_SUBJECT = 103; + {$EXTERNALSYM X509_F_X509V3_ADD_EXT} + X509_F_X509V3_ADD_EXT = 104; + {$EXTERNALSYM X509_F_X509_EXTENSION_CREATE_BY_NID} + X509_F_X509_EXTENSION_CREATE_BY_NID = 108; + {$EXTERNALSYM X509_F_X509_EXTENSION_CREATE_BY_OBJ} + X509_F_X509_EXTENSION_CREATE_BY_OBJ = 109; + + {$EXTERNALSYM X509_F_X509_GET_PUBKEY_PARAMETERS} + X509_F_X509_GET_PUBKEY_PARAMETERS = 110; + {$EXTERNALSYM X509_F_X509_LOAD_CERT_FILE} + X509_F_X509_LOAD_CERT_FILE = 111; + {$EXTERNALSYM X509_F_X509_LOAD_CRL_FILE} + X509_F_X509_LOAD_CRL_FILE = 112; + {$EXTERNALSYM X509_F_X509_NAME_ADD_ENTRY} + X509_F_X509_NAME_ADD_ENTRY = 113; + {$EXTERNALSYM X509_F_X509_NAME_ENTRY_CREATE_BY_NID} + X509_F_X509_NAME_ENTRY_CREATE_BY_NID = 114; + {$EXTERNALSYM X509_F_X509_NAME_ENTRY_SET_OBJECT} + X509_F_X509_NAME_ENTRY_SET_OBJECT = 115; + {$EXTERNALSYM X509_F_X509_NAME_ONELINE} + X509_F_X509_NAME_ONELINE = 116; + {$EXTERNALSYM X509_F_X509_NAME_PRINT} + X509_F_X509_NAME_PRINT = 117; + {$EXTERNALSYM X509_F_X509_PRINT_FP} + X509_F_X509_PRINT_FP = 118; + {$EXTERNALSYM X509_F_X509_PUBKEY_GET} + X509_F_X509_PUBKEY_GET = 119; + + {$EXTERNALSYM X509_F_X509_PUBKEY_SET} + X509_F_X509_PUBKEY_SET = 120; + {$EXTERNALSYM X509_F_X509_REQ_PRINT} + X509_F_X509_REQ_PRINT = 121; + {$EXTERNALSYM X509_F_X509_REQ_PRINT_FP} + X509_F_X509_REQ_PRINT_FP = 122; + {$EXTERNALSYM X509_F_X509_REQ_TO_X509} + X509_F_X509_REQ_TO_X509 = 123; + {$EXTERNALSYM X509_F_X509_STORE_ADD_CERT} + X509_F_X509_STORE_ADD_CERT = 124; + {$EXTERNALSYM X509_F_X509_STORE_ADD_CRL} + X509_F_X509_STORE_ADD_CRL = 125; + {$EXTERNALSYM X509_F_X509_TO_X509_REQ} + X509_F_X509_TO_X509_REQ = 126; + {$EXTERNALSYM X509_F_X509_VERIFY_CERT} + X509_F_X509_VERIFY_CERT = 127; + {$EXTERNALSYM X509_F_X509_CHECK_PRIVATE_KEY} + X509_F_X509_CHECK_PRIVATE_KEY = 128; + {$EXTERNALSYM X509_F_NETSCAPE_SPKI_B64_DECODE} + X509_F_NETSCAPE_SPKI_B64_DECODE = 129; + + {$EXTERNALSYM X509_F_NETSCAPE_SPKI_B64_ENCODE} + X509_F_NETSCAPE_SPKI_B64_ENCODE = 130; + {$EXTERNALSYM X509_F_X509_NAME_ENTRY_CREATE_BY_TXT} + X509_F_X509_NAME_ENTRY_CREATE_BY_TXT = 131; + {$EXTERNALSYM X509_F_X509_LOAD_CERT_CRL_FILE} + X509_F_X509_LOAD_CERT_CRL_FILE = 132; + {$EXTERNALSYM X509_F_X509_TRUST_ADD} + X509_F_X509_TRUST_ADD = 133; + + {$EXTERNALSYM X509_F_X509_STORE_CTX_PURPOSE_INHERIT} + X509_F_X509_STORE_CTX_PURPOSE_INHERIT = 134; + {$EXTERNALSYM X509_F_X509AT_ADD1_ATTR} + X509_F_X509AT_ADD1_ATTR = 135; + {$EXTERNALSYM X509_F_X509_ATTRIBUTE_CREATE_BY_NID} + X509_F_X509_ATTRIBUTE_CREATE_BY_NID = 136; + {$EXTERNALSYM X509_F_X509_ATTRIBUTE_CREATE_BY_OBJ} + X509_F_X509_ATTRIBUTE_CREATE_BY_OBJ = 137; + {$EXTERNALSYM X509_F_X509_ATTRIBUTE_SET1_DATA} + X509_F_X509_ATTRIBUTE_SET1_DATA = 138; + {$EXTERNALSYM X509_F_X509_ATTRIBUTE_GET0_DATA} + X509_F_X509_ATTRIBUTE_GET0_DATA = 139; + + {$EXTERNALSYM X509_F_X509_ATTRIBUTE_CREATE_BY_TXT} + X509_F_X509_ATTRIBUTE_CREATE_BY_TXT = 140; + {$EXTERNALSYM X509_F_X509_TRUST_SET} + X509_F_X509_TRUST_SET = 141; + {$EXTERNALSYM X509_F_X509_STORE_CTX_NEW} + X509_F_X509_STORE_CTX_NEW = 142; + {$EXTERNALSYM X509_F_X509_STORE_CTX_INIT} + X509_F_X509_STORE_CTX_INIT = 143; + {$EXTERNALSYM X509_F_X509_REQ_CHECK_PRIVATE_KEY} + X509_F_X509_REQ_CHECK_PRIVATE_KEY = 144; + {$EXTERNALSYM X509_F_CHECK_POLICY} + X509_F_CHECK_POLICY = 145; + {$EXTERNALSYM X509_F_X509_STORE_CTX_GET1_ISSUER} + X509_F_X509_STORE_CTX_GET1_ISSUER = 146; + {$EXTERNALSYM X509_F_X509_CRL_PRINT_FP} + X509_F_X509_CRL_PRINT_FP = 147; + + {$EXTERNALSYM X509_LU_CRL} + X509_LU_CRL = 2; + {$EXTERNALSYM X509_LU_FAIL} + X509_LU_FAIL = 0; + {$EXTERNALSYM X509_LU_PKEY} + X509_LU_PKEY = 3; + {$EXTERNALSYM X509_LU_RETRY} + X509_LU_RETRY = -1; + {$EXTERNALSYM X509_LU_X509} + X509_LU_X509 = 1; + {$EXTERNALSYM X509_L_ADD_DIR} + X509_L_ADD_DIR = 2; + {$EXTERNALSYM X509_L_FILE_LOAD} + X509_L_FILE_LOAD = 1; + {$EXTERNALSYM X509_R_BAD_X509_FILETYPE} + X509_R_BAD_X509_FILETYPE = 100; + {$EXTERNALSYM X509_R_BASE64_DECODE_ERROR} + X509_R_BASE64_DECODE_ERROR = 118; + {$EXTERNALSYM X509_R_CANT_CHECK_DH_KEY} + X509_R_CANT_CHECK_DH_KEY = 114; + {$EXTERNALSYM X509_R_CERT_ALREADY_IN_HASH_TABLE} + X509_R_CERT_ALREADY_IN_HASH_TABLE = 101; + {$EXTERNALSYM X509_R_ERR_ASN1_LIB} + X509_R_ERR_ASN1_LIB = 102; + {$EXTERNALSYM X509_R_INVALID_DIRECTORY} + X509_R_INVALID_DIRECTORY = 113; + {$EXTERNALSYM X509_R_INVALID_FIELD_NAME} + X509_R_INVALID_FIELD_NAME = 119; + {$EXTERNALSYM X509_R_INVALID_TRUST} + X509_R_INVALID_TRUST = 123; + {$EXTERNALSYM X509_R_KEY_TYPE_MISMATCH} + X509_R_KEY_TYPE_MISMATCH = 115; + {$EXTERNALSYM X509_R_KEY_VALUES_MISMATCH} + X509_R_KEY_VALUES_MISMATCH = 116; + {$EXTERNALSYM X509_R_LOADING_CERT_DIR} + X509_R_LOADING_CERT_DIR = 103; + {$EXTERNALSYM X509_R_LOADING_DEFAULTS} + X509_R_LOADING_DEFAULTS = 104; + {$EXTERNALSYM X509_R_METHOD_NOT_SUPPORTED} + X509_R_METHOD_NOT_SUPPORTED = 124; + {$EXTERNALSYM X509_R_NO_CERT_SET_FOR_US_TO_VERIFY} + X509_R_NO_CERT_SET_FOR_US_TO_VERIFY = 105; + {$EXTERNALSYM X509_R_PUBLIC_KEY_DECODE_ERROR} + X509_R_PUBLIC_KEY_DECODE_ERROR = 125; + {$EXTERNALSYM X509_R_PUBLIC_KEY_ENCODE_ERROR} + X509_R_PUBLIC_KEY_ENCODE_ERROR = 126; + {$EXTERNALSYM X509_R_SHOULD_RETRY} + X509_R_SHOULD_RETRY = 106; + {$EXTERNALSYM X509_R_UNABLE_TO_FIND_PARAMETERS_IN_CHAIN} + X509_R_UNABLE_TO_FIND_PARAMETERS_IN_CHAIN = 107; + {$EXTERNALSYM X509_R_UNABLE_TO_GET_CERTS_PUBLIC_KEY} + X509_R_UNABLE_TO_GET_CERTS_PUBLIC_KEY = 108; + {$EXTERNALSYM X509_R_UNKNOWN_KEY_TYPE} + X509_R_UNKNOWN_KEY_TYPE = 117; + {$EXTERNALSYM X509_R_UNKNOWN_NID} + X509_R_UNKNOWN_NID = 109; + {$EXTERNALSYM X509_R_UNKNOWN_PURPOSE_ID} + X509_R_UNKNOWN_PURPOSE_ID = 121; + {$EXTERNALSYM X509_R_UNSUPPORTED_ALGORITHM} + X509_R_UNSUPPORTED_ALGORITHM = 111; + {$EXTERNALSYM X509_R_WRONG_LOOKUP_TYPE} + X509_R_WRONG_LOOKUP_TYPE = 112; + {$EXTERNALSYM X509_R_WRONG_TYPE} + X509_R_WRONG_TYPE = 122; + + {$EXTERNALSYM X509_V_ERR_UNSPECIFIED} + X509_V_ERR_UNSPECIFIED = 1; + {$EXTERNALSYM X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT} + X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT = 2; + {$EXTERNALSYM X509_V_ERR_UNABLE_TO_GET_CRL} + X509_V_ERR_UNABLE_TO_GET_CRL = 3; + {$EXTERNALSYM X509_V_ERR_UNABLE_TO_DECRYPT_CERT_SIGNATURE} + X509_V_ERR_UNABLE_TO_DECRYPT_CERT_SIGNATURE = 4; + {$EXTERNALSYM X509_V_ERR_UNABLE_TO_DECRYPT_CRL_SIGNATURE} + X509_V_ERR_UNABLE_TO_DECRYPT_CRL_SIGNATURE = 5; + {$EXTERNALSYM X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY} + X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY = 6; + {$EXTERNALSYM X509_V_ERR_CERT_SIGNATURE_FAILURE} + X509_V_ERR_CERT_SIGNATURE_FAILURE = 7; + {$EXTERNALSYM X509_V_ERR_CRL_SIGNATURE_FAILURE} + X509_V_ERR_CRL_SIGNATURE_FAILURE = 8; + {$EXTERNALSYM X509_V_ERR_CERT_NOT_YET_VALID} + X509_V_ERR_CERT_NOT_YET_VALID = 9; + {$EXTERNALSYM X509_V_ERR_CERT_HAS_EXPIRED} + X509_V_ERR_CERT_HAS_EXPIRED = 10; + {$EXTERNALSYM X509_V_ERR_CRL_NOT_YET_VALID} + X509_V_ERR_CRL_NOT_YET_VALID = 11; + {$EXTERNALSYM X509_V_ERR_CRL_HAS_EXPIRED} + X509_V_ERR_CRL_HAS_EXPIRED = 12; + {$EXTERNALSYM X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD} + X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD = 13; + {$EXTERNALSYM X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD} + X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD = 14; + {$EXTERNALSYM X509_V_ERR_ERROR_IN_CRL_LAST_UPDATE_FIELD} + X509_V_ERR_ERROR_IN_CRL_LAST_UPDATE_FIELD = 15; + {$EXTERNALSYM X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD} + X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD = 16; + {$EXTERNALSYM X509_V_ERR_OUT_OF_MEM} + X509_V_ERR_OUT_OF_MEM = 17; + {$EXTERNALSYM X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT} + X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT = 18; + {$EXTERNALSYM X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN} + X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN = 19; + {$EXTERNALSYM X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY} + X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY = 20; + {$EXTERNALSYM X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE} + X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE = 21; + {$EXTERNALSYM X509_V_ERR_CERT_CHAIN_TOO_LONG} + X509_V_ERR_CERT_CHAIN_TOO_LONG = 22; + {$EXTERNALSYM X509_V_ERR_CERT_REVOKED} + X509_V_ERR_CERT_REVOKED = 23; + {$EXTERNALSYM X509_V_ERR_INVALID_CA} + X509_V_ERR_INVALID_CA = 24; + {$EXTERNALSYM X509_V_ERR_PATH_LENGTH_EXCEEDED} + X509_V_ERR_PATH_LENGTH_EXCEEDED = 25; + {$EXTERNALSYM X509_V_ERR_INVALID_PURPOSE} + X509_V_ERR_INVALID_PURPOSE = 26; + {$EXTERNALSYM X509_V_ERR_CERT_UNTRUSTED} + X509_V_ERR_CERT_UNTRUSTED = 27; + {$EXTERNALSYM X509_V_ERR_CERT_REJECTED} + X509_V_ERR_CERT_REJECTED = 28; +//* These are 'informational' when looking for issuer cert */ + {$EXTERNALSYM X509_V_ERR_SUBJECT_ISSUER_MISMATCH} + X509_V_ERR_SUBJECT_ISSUER_MISMATCH = 29; + {$EXTERNALSYM X509_V_ERR_AKID_SKID_MISMATCH} + X509_V_ERR_AKID_SKID_MISMATCH = 30; + {$EXTERNALSYM X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH} + X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH = 31; + {$EXTERNALSYM X509_V_ERR_KEYUSAGE_NO_CERTSIGN} + X509_V_ERR_KEYUSAGE_NO_CERTSIGN = 32; + {$EXTERNALSYM X509_V_ERR_UNABLE_TO_GET_CRL_ISSUER} + X509_V_ERR_UNABLE_TO_GET_CRL_ISSUER = 33; + {$EXTERNALSYM X509_V_ERR_UNHANDLED_CRITICAL_EXTENSION} + X509_V_ERR_UNHANDLED_CRITICAL_EXTENSION = 34; + {$EXTERNALSYM X509_V_ERR_KEYUSAGE_NO_CRL_SIGN} + X509_V_ERR_KEYUSAGE_NO_CRL_SIGN = 35; + {$EXTERNALSYM X509_V_ERR_UNHANDLED_CRITICAL_CRL_EXTENSION} + X509_V_ERR_UNHANDLED_CRITICAL_CRL_EXTENSION = 36; + {$EXTERNALSYM X509_V_ERR_INVALID_NON_CA} + X509_V_ERR_INVALID_NON_CA = 37; + {$EXTERNALSYM X509_V_ERR_PROXY_PATH_LENGTH_EXCEEDED} + X509_V_ERR_PROXY_PATH_LENGTH_EXCEEDED = 38; + {$EXTERNALSYM X509_V_ERR_KEYUSAGE_NO_DIGITAL_SIGNATURE} + X509_V_ERR_KEYUSAGE_NO_DIGITAL_SIGNATURE = 39; + {$EXTERNALSYM X509_V_ERR_PROXY_CERTIFICATES_NOT_ALLOWED} + X509_V_ERR_PROXY_CERTIFICATES_NOT_ALLOWED = 40; + {$EXTERNALSYM X509_V_ERR_INVALID_EXTENSION} + X509_V_ERR_INVALID_EXTENSION = 41; + {$EXTERNALSYM X509_V_ERR_INVALID_POLICY_EXTENSION} + X509_V_ERR_INVALID_POLICY_EXTENSION = 42; + {$EXTERNALSYM X509_V_ERR_NO_EXPLICIT_POLICY} + X509_V_ERR_NO_EXPLICIT_POLICY = 43; + {$EXTERNALSYM X509_V_ERR_DIFFERENT_CRL_SCOPE} + X509_V_ERR_DIFFERENT_CRL_SCOPE = 44; + {$EXTERNALSYM X509_V_ERR_UNSUPPORTED_EXTENSION_FEATURE} + X509_V_ERR_UNSUPPORTED_EXTENSION_FEATURE = 45; + + {$EXTERNALSYM X509_V_ERR_UNNESTED_RESOURCE} + X509_V_ERR_UNNESTED_RESOURCE = 46; //was 44; + {$EXTERNALSYM X509_V_ERR_PERMITTED_VIOLATION} + X509_V_ERR_PERMITTED_VIOLATION = 47; + {$EXTERNALSYM X509_V_ERR_EXCLUDED_VIOLATION} + X509_V_ERR_EXCLUDED_VIOLATION = 48; + {$EXTERNALSYM X509_V_ERR_SUBTREE_MINMAX} + X509_V_ERR_SUBTREE_MINMAX = 49; + {$EXTERNALSYM X509_V_ERR_APPLICATION_VERIFICATION} + X509_V_ERR_APPLICATION_VERIFICATION = 50; + {$EXTERNALSYM X509_V_ERR_UNSUPPORTED_CONSTRAINT_TYPE} + X509_V_ERR_UNSUPPORTED_CONSTRAINT_TYPE = 51; + {$EXTERNALSYM X509_V_ERR_UNSUPPORTED_CONSTRAINT_SYNTAX} + X509_V_ERR_UNSUPPORTED_CONSTRAINT_SYNTAX = 52; + {$EXTERNALSYM X509_V_ERR_UNSUPPORTED_NAME_SYNTAX} + X509_V_ERR_UNSUPPORTED_NAME_SYNTAX = 53; + {$EXTERNALSYM X509_V_ERR_CRL_PATH_VALIDATION_ERROR} + X509_V_ERR_CRL_PATH_VALIDATION_ERROR = 54; + {$EXTERNALSYM X509_V_ERR_PATH_LOOP} + X509_V_ERR_PATH_LOOP = 55; + {$EXTERNALSYM X509_V_ERR_SUITE_B_INVALID_VERSION} + X509_V_ERR_SUITE_B_INVALID_VERSION = 56; + {$EXTERNALSYM X509_V_ERR_SUITE_B_INVALID_ALGORITHM} + X509_V_ERR_SUITE_B_INVALID_ALGORITHM = 57; + {$EXTERNALSYM X509_V_ERR_SUITE_B_INVALID_CURVE} + X509_V_ERR_SUITE_B_INVALID_CURVE = 58; + {$EXTERNALSYM X509_V_ERR_SUITE_B_INVALID_SIGNATURE_ALGORITHM} + X509_V_ERR_SUITE_B_INVALID_SIGNATURE_ALGORITHM = 59; + {$EXTERNALSYM X509_V_ERR_SUITE_B_LOS_NOT_ALLOWED} + X509_V_ERR_SUITE_B_LOS_NOT_ALLOWED = 60; + {$EXTERNALSYM X509_V_ERR_SUITE_B_CANNOT_SIGN_P_384_WITH_P_256} + X509_V_ERR_SUITE_B_CANNOT_SIGN_P_384_WITH_P_256 = 61; + {$EXTERNALSYM X509_V_ERR_HOSTNAME_MISMATCH} + X509_V_ERR_HOSTNAME_MISMATCH = 62; + {$EXTERNALSYM X509_V_ERR_EMAIL_MISMATCH} + X509_V_ERR_EMAIL_MISMATCH = 63; + {$EXTERNALSYM X509_V_ERR_IP_ADDRESS_MISMATCH} + X509_V_ERR_IP_ADDRESS_MISMATCH = 64; + {$EXTERNALSYM X509_V_ERR_DANE_NO_MATCH} + X509_V_ERR_DANE_NO_MATCH = 65; + {$EXTERNALSYM X509_V_ERR_EE_KEY_TOO_SMALL} + X509_V_ERR_EE_KEY_TOO_SMALL = 66; + {$EXTERNALSYM X509_V_ERR_CA_KEY_TOO_SMALL} + X509_V_ERR_CA_KEY_TOO_SMALL = 67; + {$EXTERNALSYM X509_V_ERR_CA_MD_TOO_WEAK} + X509_V_ERR_CA_MD_TOO_WEAK = 68; + {$EXTERNALSYM X509_V_ERR_INVALID_CALL} + X509_V_ERR_INVALID_CALL = 69; + {$EXTERNALSYM X509_V_ERR_STORE_LOOKUP} + X509_V_ERR_STORE_LOOKUP = 70; + {$EXTERNALSYM X509_V_ERR_NO_VALID_SCTS} + X509_V_ERR_NO_VALID_SCTS = 71; + {$EXTERNALSYM X509_V_ERR_PROXY_SUBJECT_NAME_VIOLATION} + X509_V_ERR_PROXY_SUBJECT_NAME_VIOLATION = 72; + {$EXTERNALSYM X509_V_ERR_OCSP_VERIFY_NEEDED} + X509_V_ERR_OCSP_VERIFY_NEEDED = 73; + {$EXTERNALSYM X509_V_ERR_OCSP_VERIFY_FAILED} + X509_V_ERR_OCSP_VERIFY_FAILED = 74; + {$EXTERNALSYM X509_V_ERR_OCSP_CERT_UNKNOWN} + X509_V_ERR_OCSP_CERT_UNKNOWN = 75; + + //* Certificate verify flags */ + + //* Send issuer+subject checks to verify_cb */ + {$EXTERNALSYM X509_V_FLAG_CB_ISSUER_CHECK} + X509_V_FLAG_CB_ISSUER_CHECK = $1; + //* Use check time instead of current time */ + {$EXTERNALSYM X509_V_FLAG_USE_CHECK_TIME} + X509_V_FLAG_USE_CHECK_TIME = $2; + //* Lookup CRLs */ + {$EXTERNALSYM X509_V_FLAG_CRL_CHECK} + X509_V_FLAG_CRL_CHECK = $4; + //* Lookup CRLs for whole chain */ + {$EXTERNALSYM X509_V_FLAG_CRL_CHECK_ALL} + X509_V_FLAG_CRL_CHECK_ALL = $8; + //* Ignore unhandled critical extensions */ + {$EXTERNALSYM X509_V_FLAG_IGNORE_CRITICAL} + X509_V_FLAG_IGNORE_CRITICAL = $10; +//* Disable workarounds for broken certificates */ + {$EXTERNALSYM X509_V_FLAG_X509_STRICT} + X509_V_FLAG_X509_STRICT = $20; +//* Enable proxy certificate validation */ + {$EXTERNALSYM X509_V_FLAG_ALLOW_PROXY_CERTS} + X509_V_FLAG_ALLOW_PROXY_CERTS = $40; +//* Enable policy checking */ + {$EXTERNALSYM X509_V_FLAG_POLICY_CHECK} + X509_V_FLAG_POLICY_CHECK = $80; +//* Policy variable require-explicit-policy */ + {$EXTERNALSYM X509_V_FLAG_EXPLICIT_POLICY} + X509_V_FLAG_EXPLICIT_POLICY = $100; +//* Policy variable inhibit-any-policy */ + {$EXTERNALSYM X509_V_FLAG_INHIBIT_ANY} + X509_V_FLAG_INHIBIT_ANY = $200; +//* Policy variable inhibit-policy-mapping */ + {$EXTERNALSYM X509_V_FLAG_INHIBIT_MAP} + X509_V_FLAG_INHIBIT_MAP = $400; +//* Notify callback that policy is OK */ + {$EXTERNALSYM X509_V_FLAG_NOTIFY_POLICY} + X509_V_FLAG_NOTIFY_POLICY = $800; +//* Extended CRL features such as indirect CRLs, alternate CRL signing keys */ + {$EXTERNALSYM X509_V_FLAG_EXTENDED_CRL_SUPPORT} + X509_V_FLAG_EXTENDED_CRL_SUPPORT = $1000; +//* Delta CRL support */ + {$EXTERNALSYM X509_V_FLAG_USE_DELTAS} + X509_V_FLAG_USE_DELTAS = $2000; +//* Check selfsigned CA signature */ + {$EXTERNALSYM X509_V_FLAG_CHECK_SS_SIGNATURE} + X509_V_FLAG_CHECK_SS_SIGNATURE = $4000; + + {$EXTERNALSYM X509_VP_FLAG_DEFAULT} + X509_VP_FLAG_DEFAULT = $1; + {$EXTERNALSYM X509_VP_FLAG_OVERWRITE} + X509_VP_FLAG_OVERWRITE = $2; + {$EXTERNALSYM X509_VP_FLAG_RESET_FLAGS} + X509_VP_FLAG_RESET_FLAGS = $4; + {$EXTERNALSYM X509_VP_FLAG_LOCKED} + X509_VP_FLAG_LOCKED = $8; + {$EXTERNALSYM X509_VP_FLAG_ONCE} + X509_VP_FLAG_ONCE = $10; + {$EXTERNALSYM X509_V_FLAG_POLICY_MASK} + X509_V_FLAG_POLICY_MASK = (X509_V_FLAG_POLICY_CHECK or + X509_V_FLAG_EXPLICIT_POLICY or + X509_V_FLAG_INHIBIT_ANY or + X509_V_FLAG_INHIBIT_MAP); + + {$EXTERNALSYM X509_V_OK} + X509_V_OK = 0; + {$EXTERNALSYM X509v3_KU_CRL_SIGN} + X509v3_KU_CRL_SIGN = $0002; + {$EXTERNALSYM X509v3_KU_DATA_ENCIPHERMENT} + X509v3_KU_DATA_ENCIPHERMENT = $0010; + {$EXTERNALSYM X509v3_KU_DECIPHER_ONLY} + X509v3_KU_DECIPHER_ONLY = $8000; + {$EXTERNALSYM X509v3_KU_DIGITAL_SIGNATURE} + X509v3_KU_DIGITAL_SIGNATURE = $0080; + {$EXTERNALSYM X509v3_KU_ENCIPHER_ONLY} + X509v3_KU_ENCIPHER_ONLY = $0001; + {$EXTERNALSYM X509v3_KU_KEY_AGREEMENT} + X509v3_KU_KEY_AGREEMENT = $0008; + {$EXTERNALSYM X509v3_KU_KEY_CERT_SIGN} + X509v3_KU_KEY_CERT_SIGN = $0004; + {$EXTERNALSYM X509v3_KU_KEY_ENCIPHERMENT} + X509v3_KU_KEY_ENCIPHERMENT = $0020; + {$EXTERNALSYM X509v3_KU_NON_REPUDIATION} + X509v3_KU_NON_REPUDIATION = $0040; + {$EXTERNALSYM X509v3_KU_UNDEF} + X509v3_KU_UNDEF = $ffff; + {$EXTERNALSYM X509V3_EXT_DYNAMIC} + X509V3_EXT_DYNAMIC = $1; + {$EXTERNALSYM X509V3_EXT_CTX_DEP} + X509V3_EXT_CTX_DEP = $2; + {$EXTERNALSYM X509V3_EXT_MULTILINE} + X509V3_EXT_MULTILINE = $4; + {$EXTERNALSYM GEN_OTHERNAME} + GEN_OTHERNAME = 0; + {$EXTERNALSYM GEN_EMAIL} + GEN_EMAIL = 1; + {$EXTERNALSYM GEN_DNS} + GEN_DNS = 2; + {$EXTERNALSYM GEN_X400} + GEN_X400 = 3; + {$EXTERNALSYM GEN_DIRNAME} + GEN_DIRNAME = 4; + {$EXTERNALSYM GEN_EDIPARTY} + GEN_EDIPARTY = 5; + {$EXTERNALSYM GEN_URI} + GEN_URI = 6; + {$EXTERNALSYM GEN_IPADD} + GEN_IPADD = 7; + {$EXTERNALSYM GEN_RID} + GEN_RID = 8; + {$EXTERNALSYM CRLDP_ALL_REASONS} + CRLDP_ALL_REASONS = $807f; + {$EXTERNALSYM CRL_REASON_NONE} + CRL_REASON_NONE = -1; + {$EXTERNALSYM CRL_REASON_UNSPECIFIED} + CRL_REASON_UNSPECIFIED = 0; + {$EXTERNALSYM CRL_REASON_KEY_COMPROMISE} + CRL_REASON_KEY_COMPROMISE = 1; + {$EXTERNALSYM CRL_REASON_CA_COMPROMISE} + CRL_REASON_CA_COMPROMISE = 2; + {$EXTERNALSYM CRL_REASON_AFFILIATION_CHANGED} + CRL_REASON_AFFILIATION_CHANGED = 3; + {$EXTERNALSYM CRL_REASON_SUPERSEDED} + CRL_REASON_SUPERSEDED = 4; + {$EXTERNALSYM CRL_REASON_CESSATION_OF_OPERATION} + CRL_REASON_CESSATION_OF_OPERATION = 5; + {$EXTERNALSYM CRL_REASON_CERTIFICATE_HOLD} + CRL_REASON_CERTIFICATE_HOLD = 6; + {$EXTERNALSYM CRL_REASON_REMOVE_FROM_CRL} + CRL_REASON_REMOVE_FROM_CRL = 8; + {$EXTERNALSYM CRL_REASON_PRIVILEGE_WITHDRAWN} + CRL_REASON_PRIVILEGE_WITHDRAWN = 9; + {$EXTERNALSYM CRL_REASON_AA_COMPROMISE} + CRL_REASON_AA_COMPROMISE = 10; + +//* Values in idp_flags field */ +//* IDP present */ + {$EXTERNALSYM IDP_PRESENT} + IDP_PRESENT = $1; +//* IDP values inconsistent */ + {$EXTERNALSYM IDP_INVALID} + IDP_INVALID = $2; +//* onlyuser true */ + {$EXTERNALSYM IDP_ONLYUSER} + IDP_ONLYUSER = $4; +//* onlyCA true */ + {$EXTERNALSYM IDP_ONLYCA} + IDP_ONLYCA = $8; +//* onlyattr true */ + {$EXTERNALSYM IDP_ONLYATTR} + IDP_ONLYATTR = $10; +//* indirectCRL true */ + {$EXTERNALSYM IDP_INDIRECT} + IDP_INDIRECT = $20; +//* onlysomereasons present */ + {$EXTERNALSYM IDP_REASONS} + IDP_REASONS = $40; + + //* X509_PURPOSE stuff */ + {$EXTERNALSYM EXFLAG_BCONS} + EXFLAG_BCONS = $1; + {$EXTERNALSYM EXFLAG_KUSAGE} + EXFLAG_KUSAGE = $2; + {$EXTERNALSYM EXFLAG_XKUSAGE} + EXFLAG_XKUSAGE = $4; + {$EXTERNALSYM EXFLAG_NSCERT} + EXFLAG_NSCERT = $8; + {$EXTERNALSYM EXFLAG_CA} + EXFLAG_CA = $10; + //* Really self issued not necessarily self signed */ + {$EXTERNALSYM EXFLAG_SI} + EXFLAG_SI = $20; + {$EXTERNALSYM EXFLAG_SS} + EXFLAG_SS = $20; + {$EXTERNALSYM EXFLAG_V1} + EXFLAG_V1 = $40; + {$EXTERNALSYM EXFLAG_INVALID} + EXFLAG_INVALID = $80; + {$EXTERNALSYM EXFLAG_SET} + EXFLAG_SET = $100; + {$EXTERNALSYM EXFLAG_CRITICAL} + EXFLAG_CRITICAL = $200; + {$EXTERNALSYM EXFLAG_PROXY} + EXFLAG_PROXY = $400; + {$EXTERNALSYM EXFLAG_INVALID_POLICY} + EXFLAG_INVALID_POLICY = $800; + {$EXTERNALSYM KU_DIGITAL_SIGNATURE} + KU_DIGITAL_SIGNATURE = $0080; + {$EXTERNALSYM KU_NON_REPUDIATION} + KU_NON_REPUDIATION = $0040; + {$EXTERNALSYM KU_KEY_ENCIPHERMENT} + KU_KEY_ENCIPHERMENT = $0020; + {$EXTERNALSYM KU_DATA_ENCIPHERMENT} + KU_DATA_ENCIPHERMENT = $0010; + {$EXTERNALSYM KU_KEY_AGREEMENT} + KU_KEY_AGREEMENT = $0008; + {$EXTERNALSYM KU_KEY_CERT_SIGN} + KU_KEY_CERT_SIGN = $0004; + {$EXTERNALSYM KU_CRL_SIGN} + KU_CRL_SIGN = $0002; + {$EXTERNALSYM KU_ENCIPHER_ONLY} + KU_ENCIPHER_ONLY = $0001; + {$EXTERNALSYM KU_DECIPHER_ONLY} + KU_DECIPHER_ONLY = $8000; + {$EXTERNALSYM NS_SSL_CLIENT} + NS_SSL_CLIENT = $80; + {$EXTERNALSYM NS_SSL_SERVER} + NS_SSL_SERVER = $40; + {$EXTERNALSYM NS_SMIME} + NS_SMIME = $20; + {$EXTERNALSYM NS_OBJSIGN} + NS_OBJSIGN = $10; + {$EXTERNALSYM NS_SSL_CA} + NS_SSL_CA = $04; + {$EXTERNALSYM NS_SMIME_CA} + NS_SMIME_CA = $02; + {$EXTERNALSYM NS_OBJSIGN_CA} + NS_OBJSIGN_CA = $01; + {$EXTERNALSYM NS_ANY_CA} + NS_ANY_CA = (NS_SSL_CA or NS_SMIME_CA or + {$EXTERNALSYM XKU_SSL_SERVER} + NS_OBJSIGN_CA); + {$EXTERNALSYM XKU_SSL_SERVER} + XKU_SSL_SERVER = $1; + {$EXTERNALSYM XKU_SSL_CLIENT} + XKU_SSL_CLIENT = $2; + {$EXTERNALSYM XKU_SMIME} + XKU_SMIME = $4; + {$EXTERNALSYM XKU_CODE_SIGN} + XKU_CODE_SIGN = $8; + {$EXTERNALSYM XKU_SGC} + XKU_SGC = $10; + {$EXTERNALSYM XKU_OCSP_SIGN} + XKU_OCSP_SIGN = $20; + {$EXTERNALSYM XKU_TIMESTAMP} + XKU_TIMESTAMP = $40; + {$EXTERNALSYM XKU_DVCS} + XKU_DVCS = $80; + {$EXTERNALSYM X509_PURPOSE_DYNAMIC} + X509_PURPOSE_DYNAMIC = $1; + {$EXTERNALSYM X509_PURPOSE_DYNAMIC_NAME} + X509_PURPOSE_DYNAMIC_NAME = $2; + + {$EXTERNALSYM X509_PURPOSE_SSL_CLIENT} + X509_PURPOSE_SSL_CLIENT = 1; + {$EXTERNALSYM X509_PURPOSE_SSL_SERVER} + X509_PURPOSE_SSL_SERVER = 2; + {$EXTERNALSYM X509_PURPOSE_NS_SSL_SERVER} + X509_PURPOSE_NS_SSL_SERVER = 3; + {$EXTERNALSYM X509_PURPOSE_SMIME_SIGN} + X509_PURPOSE_SMIME_SIGN = 4; + {$EXTERNALSYM X509_PURPOSE_SMIME_ENCRYPT} + X509_PURPOSE_SMIME_ENCRYPT = 5; + {$EXTERNALSYM X509_PURPOSE_CRL_SIGN} + X509_PURPOSE_CRL_SIGN = 6; + {$EXTERNALSYM X509_PURPOSE_ANY} + X509_PURPOSE_ANY = 7; + {$EXTERNALSYM X509_PURPOSE_OCSP_HELPER} + X509_PURPOSE_OCSP_HELPER = 8; + {$EXTERNALSYM X509_PURPOSE_TIMESTAMP_SIGN} + X509_PURPOSE_TIMESTAMP_SIGN = 9; + + {$EXTERNALSYM X509_PURPOSE_MIN} + X509_PURPOSE_MIN = 1; + {$EXTERNALSYM X509_PURPOSE_MAX} + X509_PURPOSE_MAX = 9; + + +//* Flags for X509V3_EXT_print() */ + + {$EXTERNALSYM X509V3_EXT_UNKNOWN_MASK} + X509V3_EXT_UNKNOWN_MASK = TIdC_LONG($f shl 16); +//* Return error for unknown extensions */ + {$EXTERNALSYM X509V3_EXT_DEFAULT} + X509V3_EXT_DEFAULT = 0; +//* Print error for unknown extensions */ + {$EXTERNALSYM X509V3_EXT_ERROR_UNKNOWN} + X509V3_EXT_ERROR_UNKNOWN = (TIdC_LONG(1) shl 16); +//* ASN1 parse unknown extensions */ + {$EXTERNALSYM X509V3_EXT_PARSE_UNKNOWN} + X509V3_EXT_PARSE_UNKNOWN = (TIdC_LONG(2) shl 16); +//* BIO_dump unknown extensions */ + {$EXTERNALSYM X509V3_EXT_DUMP_UNKNOWN} + X509V3_EXT_DUMP_UNKNOWN = (TIdC_LONG(3) shl 16); + +//* Flags for X509V3_add1_i2d */ + {$EXTERNALSYM X509V3_ADD_OP_MASK} + X509V3_ADD_OP_MASK = TIdC_LONG($f); + {$EXTERNALSYM X509V3_ADD_DEFAULT} + X509V3_ADD_DEFAULT = TIdC_LONG(0); + {$EXTERNALSYM X509V3_ADD_APPEND} + X509V3_ADD_APPEND = TIdC_LONG(1); + {$EXTERNALSYM X509V3_ADD_REPLACE} + X509V3_ADD_REPLACE = TIdC_LONG(2); + {$EXTERNALSYM X509V3_ADD_REPLACE_EXISTING} + X509V3_ADD_REPLACE_EXISTING = TIdC_LONG(3); + {$EXTERNALSYM X509V3_ADD_KEEP_EXISTING} + X509V3_ADD_KEEP_EXISTING = TIdC_LONG(4); + {$EXTERNALSYM X509V3_ADD_DELETE} + X509V3_ADD_DELETE = TIdC_LONG(5); + {$EXTERNALSYM X509V3_ADD_SILENT} + X509V3_ADD_SILENT = TIdC_LONG($10); + + {$IFNDEF OPENSSL_NO_RFC3779} + {$EXTERNALSYM ASIdOrRange_id} + ASIdOrRange_id = 0; + {$EXTERNALSYM ASIdOrRange_range} + ASIdOrRange_range = 1; + + {$EXTERNALSYM ASIdentifierChoice_inherit} + ASIdentifierChoice_inherit = 0; + {$EXTERNALSYM ASIdentifierChoice_asIdsOrRanges} + ASIdentifierChoice_asIdsOrRanges = 1; + + {$EXTERNALSYM IPAddressOrRange_addressPrefix} + IPAddressOrRange_addressPrefix = 0; + {$EXTERNALSYM IPAddressOrRange_addressRange} + IPAddressOrRange_addressRange = 1; + + {$EXTERNALSYM IPAddressChoice_inherit} + IPAddressChoice_inherit = 0; + {$EXTERNALSYM IPAddressChoice_addressesOrRanges} + IPAddressChoice_addressesOrRanges = 1; + +// /* +// * API tag for elements of the ASIdentifer SEQUENCE. +// */ + {$EXTERNALSYM V3_ASID_ASNUM} + V3_ASID_ASNUM = 0; + {$EXTERNALSYM V3_ASID_RDI} + V3_ASID_RDI = 1; + +//* +// * AFI values, assigned by IANA. It'd be nice to make the AFI +// * handling code totally generic, but there are too many little things +// * that would need to be defined for other address families for it to +// * be worth the trouble. +// */ + {$EXTERNALSYM IANA_AFI_IPV4} + IANA_AFI_IPV4 = 1; + {$EXTERNALSYM IANA_AFI_IPV6} + IANA_AFI_IPV6 = 2; + {$ENDIF} + + //* Function codes. */ + {$EXTERNALSYM X509V3_F_A2I_GENERAL_NAME} + X509V3_F_A2I_GENERAL_NAME = 164; + {$EXTERNALSYM X509V3_F_ASIDENTIFIERCHOICE_CANONIZE} + X509V3_F_ASIDENTIFIERCHOICE_CANONIZE = 161; + {$EXTERNALSYM X509V3_F_ASIDENTIFIERCHOICE_IS_CANONICAL} + X509V3_F_ASIDENTIFIERCHOICE_IS_CANONICAL = 162; + {$EXTERNALSYM X509V3_F_COPY_EMAIL} + X509V3_F_COPY_EMAIL = 122; + {$EXTERNALSYM X509V3_F_COPY_ISSUER} + X509V3_F_COPY_ISSUER = 123; + {$EXTERNALSYM X509V3_F_DO_DIRNAME} + X509V3_F_DO_DIRNAME = 144; + {$EXTERNALSYM X509V3_F_DO_EXT_CONF} + X509V3_F_DO_EXT_CONF = 124; + {$EXTERNALSYM X509V3_F_DO_EXT_I2D} + X509V3_F_DO_EXT_I2D = 135; + {$EXTERNALSYM X509V3_F_DO_EXT_NCONF} + X509V3_F_DO_EXT_NCONF = 151; + {$EXTERNALSYM X509V3_F_DO_I2V_NAME_CONSTRAINTS} + X509V3_F_DO_I2V_NAME_CONSTRAINTS = 148; + {$EXTERNALSYM X509V3_F_GNAMES_FROM_SECTNAME} + X509V3_F_GNAMES_FROM_SECTNAME = 156; + {$EXTERNALSYM X509V3_F_HEX_TO_STRING} + X509V3_F_HEX_TO_STRING = 111; + {$EXTERNALSYM X509V3_F_I2S_ASN1_ENUMERATED} + X509V3_F_I2S_ASN1_ENUMERATED = 121; + {$EXTERNALSYM X509V3_F_I2S_ASN1_IA5STRING} + X509V3_F_I2S_ASN1_IA5STRING = 149; + {$EXTERNALSYM X509V3_F_I2S_ASN1_INTEGER} + X509V3_F_I2S_ASN1_INTEGER = 120; + {$EXTERNALSYM X509V3_F_I2V_AUTHORITY_INFO_ACCESS} + X509V3_F_I2V_AUTHORITY_INFO_ACCESS = 138; + {$EXTERNALSYM X509V3_F_NOTICE_SECTION} + X509V3_F_NOTICE_SECTION =132; + {$EXTERNALSYM X509V3_F_NREF_NOS} + X509V3_F_NREF_NOS =133; + {$EXTERNALSYM X509V3_F_POLICY_SECTION} + X509V3_F_POLICY_SECTION =131; + {$EXTERNALSYM X509V3_F_PROCESS_PCI_VALUE} + X509V3_F_PROCESS_PCI_VALUE =150; + {$EXTERNALSYM X509V3_F_R2I_CERTPOL} + X509V3_F_R2I_CERTPOL =130; + {$EXTERNALSYM X509V3_F_R2I_PCI} + X509V3_F_R2I_PCI = 155; + {$EXTERNALSYM X509V3_F_S2I_ASN1_IA5STRING} + X509V3_F_S2I_ASN1_IA5STRING = 100; + {$EXTERNALSYM X509V3_F_S2I_ASN1_INTEGER} + X509V3_F_S2I_ASN1_INTEGER = 108; + {$EXTERNALSYM X509V3_F_S2I_ASN1_OCTET_STRING} + X509V3_F_S2I_ASN1_OCTET_STRING = 112; + {$EXTERNALSYM X509V3_F_S2I_ASN1_SKEY_ID} + X509V3_F_S2I_ASN1_SKEY_ID = 114; + {$EXTERNALSYM X509V3_F_S2I_SKEY_ID} + X509V3_F_S2I_SKEY_ID = 115; + {$EXTERNALSYM X509V3_F_SET_DIST_POINT_NAME} + X509V3_F_SET_DIST_POINT_NAME = 158; + {$EXTERNALSYM X509V3_F_STRING_TO_HEX} + X509V3_F_STRING_TO_HEX = 113; + {$EXTERNALSYM X509V3_F_SXNET_ADD_ID_ASC} + X509V3_F_SXNET_ADD_ID_ASC = 125; + {$EXTERNALSYM X509V3_F_SXNET_ADD_ID_INTEGER} + X509V3_F_SXNET_ADD_ID_INTEGER = 126; + {$EXTERNALSYM X509V3_F_SXNET_ADD_ID_ULONG} + X509V3_F_SXNET_ADD_ID_ULONG = 127; + {$EXTERNALSYM X509V3_F_SXNET_GET_ID_ASC} + X509V3_F_SXNET_GET_ID_ASC = 128; + {$EXTERNALSYM X509V3_F_SXNET_GET_ID_ULONG} + X509V3_F_SXNET_GET_ID_ULONG = 129; + {$EXTERNALSYM X509V3_F_V2I_ASIDENTIFIERS} + X509V3_F_V2I_ASIDENTIFIERS = 163; + {$EXTERNALSYM X509V3_F_V2I_ASN1_BIT_STRING} + X509V3_F_V2I_ASN1_BIT_STRING = 101; + {$EXTERNALSYM X509V3_F_V2I_AUTHORITY_INFO_ACCESS} + X509V3_F_V2I_AUTHORITY_INFO_ACCESS = 139; + {$EXTERNALSYM X509V3_F_V2I_AUTHORITY_KEYID} + X509V3_F_V2I_AUTHORITY_KEYID = 119; + {$EXTERNALSYM X509V3_F_V2I_BASIC_CONSTRAINTS} + X509V3_F_V2I_BASIC_CONSTRAINTS = 102; + {$EXTERNALSYM X509V3_F_V2I_CRLD} + X509V3_F_V2I_CRLD = 134; + {$EXTERNALSYM X509V3_F_V2I_EXTENDED_KEY_USAGE} + X509V3_F_V2I_EXTENDED_KEY_USAGE = 103; + {$EXTERNALSYM X509V3_F_V2I_GENERAL_NAMES} + X509V3_F_V2I_GENERAL_NAMES = 118; + {$EXTERNALSYM X509V3_F_V2I_GENERAL_NAME_EX} + X509V3_F_V2I_GENERAL_NAME_EX = 117; + {$EXTERNALSYM X509V3_F_V2I_IDP} + X509V3_F_V2I_IDP = 157; + {$EXTERNALSYM X509V3_F_V2I_IPADDRBLOCKS} + X509V3_F_V2I_IPADDRBLOCKS = 159; + {$EXTERNALSYM X509V3_F_V2I_ISSUER_ALT} + X509V3_F_V2I_ISSUER_ALT = 153; + {$EXTERNALSYM X509V3_F_V2I_NAME_CONSTRAINTS} + X509V3_F_V2I_NAME_CONSTRAINTS = 147; + {$EXTERNALSYM X509V3_F_V2I_POLICY_CONSTRAINTS} + X509V3_F_V2I_POLICY_CONSTRAINTS = 146; + {$EXTERNALSYM X509V3_F_V2I_POLICY_MAPPINGS} + X509V3_F_V2I_POLICY_MAPPINGS = 145; + {$EXTERNALSYM X509V3_F_V2I_SUBJECT_ALT} + X509V3_F_V2I_SUBJECT_ALT = 154; + {$EXTERNALSYM X509V3_F_V3_ADDR_VALIDATE_PATH_INTERNAL} + X509V3_F_V3_ADDR_VALIDATE_PATH_INTERNAL = 160; + {$EXTERNALSYM X509V3_F_V3_GENERIC_EXTENSION} + X509V3_F_V3_GENERIC_EXTENSION = 116; + {$EXTERNALSYM X509V3_F_X509V3_ADD1_I2D} + X509V3_F_X509V3_ADD1_I2D = 140; + {$EXTERNALSYM X509V3_F_X509V3_ADD_VALUE} + X509V3_F_X509V3_ADD_VALUE = 105; + {$EXTERNALSYM X509V3_F_X509V3_EXT_ADD} + X509V3_F_X509V3_EXT_ADD = 104; + {$EXTERNALSYM X509V3_F_X509V3_EXT_ADD_ALIAS} + X509V3_F_X509V3_EXT_ADD_ALIAS = 106; + {$EXTERNALSYM X509V3_F_X509V3_EXT_CONF} + X509V3_F_X509V3_EXT_CONF = 107; + {$EXTERNALSYM X509V3_F_X509V3_EXT_I2D} + X509V3_F_X509V3_EXT_I2D = 136; + {$EXTERNALSYM X509V3_F_X509V3_EXT_NCONF} + X509V3_F_X509V3_EXT_NCONF = 152; + {$EXTERNALSYM X509V3_F_X509V3_GET_SECTION} + X509V3_F_X509V3_GET_SECTION = 142; + {$EXTERNALSYM X509V3_F_X509V3_GET_STRING} + X509V3_F_X509V3_GET_STRING = 143; + {$EXTERNALSYM X509V3_F_X509V3_GET_VALUE_BOOL} + X509V3_F_X509V3_GET_VALUE_BOOL = 110; + {$EXTERNALSYM X509V3_F_X509V3_PARSE_LIST} + X509V3_F_X509V3_PARSE_LIST = 109; + {$EXTERNALSYM X509V3_F_X509_PURPOSE_ADD} + X509V3_F_X509_PURPOSE_ADD = 137; + {$EXTERNALSYM X509V3_F_X509_PURPOSE_SET} + X509V3_F_X509_PURPOSE_SET = 141; + + //* Reason codes. */ + {$EXTERNALSYM X509V3_R_BAD_IP_ADDRESS} + X509V3_R_BAD_IP_ADDRESS = 118; + {$EXTERNALSYM X509V3_R_BAD_OBJECT} + X509V3_R_BAD_OBJECT = 119; + {$EXTERNALSYM X509V3_R_BN_DEC2BN_ERROR} + X509V3_R_BN_DEC2BN_ERROR = 100; + {$EXTERNALSYM X509V3_R_BN_TO_ASN1_INTEGER_ERROR} + X509V3_R_BN_TO_ASN1_INTEGER_ERROR = 101; + {$EXTERNALSYM X509V3_R_DIRNAME_ERROR} + X509V3_R_DIRNAME_ERROR = 149; + {$EXTERNALSYM X509V3_R_DISTPOINT_ALREADY_SET} + X509V3_R_DISTPOINT_ALREADY_SET = 160; + {$EXTERNALSYM X509V3_R_DUPLICATE_ZONE_ID} + X509V3_R_DUPLICATE_ZONE_ID = 133; + {$EXTERNALSYM X509V3_R_ERROR_CONVERTING_ZONE} + X509V3_R_ERROR_CONVERTING_ZONE = 131; + {$EXTERNALSYM X509V3_R_ERROR_CREATING_EXTENSION} + X509V3_R_ERROR_CREATING_EXTENSION = 144; + {$EXTERNALSYM X509V3_R_ERROR_IN_EXTENSION} + X509V3_R_ERROR_IN_EXTENSION = 128; + {$EXTERNALSYM X509V3_R_EXPECTED_A_SECTION_NAME} + X509V3_R_EXPECTED_A_SECTION_NAME = 137; + {$EXTERNALSYM X509V3_R_EXTENSION_EXISTS} + X509V3_R_EXTENSION_EXISTS = 145; + {$EXTERNALSYM X509V3_R_EXTENSION_NAME_ERROR} + X509V3_R_EXTENSION_NAME_ERROR = 115; + {$EXTERNALSYM X509V3_R_EXTENSION_NOT_FOUND} + X509V3_R_EXTENSION_NOT_FOUND = 102; + {$EXTERNALSYM X509V3_R_EXTENSION_SETTING_NOT_SUPPORTED} + X509V3_R_EXTENSION_SETTING_NOT_SUPPORTED = 103; + {$EXTERNALSYM X509V3_R_EXTENSION_VALUE_ERROR} + X509V3_R_EXTENSION_VALUE_ERROR = 116; + {$EXTERNALSYM X509V3_R_ILLEGAL_EMPTY_EXTENSION} + X509V3_R_ILLEGAL_EMPTY_EXTENSION = 151; + {$EXTERNALSYM X509V3_R_ILLEGAL_HEX_DIGIT} + X509V3_R_ILLEGAL_HEX_DIGIT = 113; + {$EXTERNALSYM X509V3_R_INCORRECT_POLICY_SYNTAX_TAG} + X509V3_R_INCORRECT_POLICY_SYNTAX_TAG = 152; + {$EXTERNALSYM X509V3_R_INVALID_MULTIPLE_RDNS} + X509V3_R_INVALID_MULTIPLE_RDNS = 161; + {$EXTERNALSYM X509V3_R_INVALID_ASNUMBER} + X509V3_R_INVALID_ASNUMBER = 162; + {$EXTERNALSYM X509V3_R_INVALID_ASRANGE} + X509V3_R_INVALID_ASRANGE = 163; + {$EXTERNALSYM X509V3_R_INVALID_BOOLEAN_STRING} + X509V3_R_INVALID_BOOLEAN_STRING = 104; + {$EXTERNALSYM X509V3_R_INVALID_EXTENSION_STRING} + X509V3_R_INVALID_EXTENSION_STRING = 105; + {$EXTERNALSYM X509V3_R_INVALID_INHERITANCE} + X509V3_R_INVALID_INHERITANCE = 165; + {$EXTERNALSYM X509V3_R_INVALID_IPADDRESS} + X509V3_R_INVALID_IPADDRESS = 166; + {$EXTERNALSYM X509V3_R_INVALID_NAME} + X509V3_R_INVALID_NAME = 106; + {$EXTERNALSYM X509V3_R_INVALID_NULL_ARGUMENT} + X509V3_R_INVALID_NULL_ARGUMENT = 107; + {$EXTERNALSYM X509V3_R_INVALID_NULL_NAME} + X509V3_R_INVALID_NULL_NAME = 108; + {$EXTERNALSYM X509V3_R_INVALID_NULL_VALUE} + X509V3_R_INVALID_NULL_VALUE = 109; + {$EXTERNALSYM X509V3_R_INVALID_NUMBER} + X509V3_R_INVALID_NUMBER = 140; + {$EXTERNALSYM X509V3_R_INVALID_NUMBERS} + X509V3_R_INVALID_NUMBERS = 141; + {$EXTERNALSYM X509V3_R_INVALID_OBJECT_IDENTIFIER} + X509V3_R_INVALID_OBJECT_IDENTIFIER = 110; + {$EXTERNALSYM X509V3_R_INVALID_OPTION} + X509V3_R_INVALID_OPTION = 138; + {$EXTERNALSYM X509V3_R_INVALID_POLICY_IDENTIFIER} + X509V3_R_INVALID_POLICY_IDENTIFIER = 134; + {$EXTERNALSYM X509V3_R_INVALID_PROXY_POLICY_SETTING} + X509V3_R_INVALID_PROXY_POLICY_SETTING = 153; + {$EXTERNALSYM X509V3_R_INVALID_PURPOSE} + X509V3_R_INVALID_PURPOSE = 146; + {$EXTERNALSYM X509V3_R_INVALID_SAFI} + X509V3_R_INVALID_SAFI = 164; + {$EXTERNALSYM X509V3_R_INVALID_SECTION} + X509V3_R_INVALID_SECTION = 135; + {$EXTERNALSYM X509V3_R_INVALID_SYNTAX} + X509V3_R_INVALID_SYNTAX = 143; + {$EXTERNALSYM X509V3_R_ISSUER_DECODE_ERROR} + X509V3_R_ISSUER_DECODE_ERROR = 126; + {$EXTERNALSYM X509V3_R_MISSING_VALUE} + X509V3_R_MISSING_VALUE = 124; + {$EXTERNALSYM X509V3_R_NEED_ORGANIZATION_AND_NUMBERS} + X509V3_R_NEED_ORGANIZATION_AND_NUMBERS = 142; + {$EXTERNALSYM X509V3_R_NO_CONFIG_DATABASE} + X509V3_R_NO_CONFIG_DATABASE = 136; + {$EXTERNALSYM X509V3_R_NO_ISSUER_CERTIFICATE} + X509V3_R_NO_ISSUER_CERTIFICATE = 121; + {$EXTERNALSYM X509V3_R_NO_ISSUER_DETAILS} + X509V3_R_NO_ISSUER_DETAILS = 127; + {$EXTERNALSYM X509V3_R_NO_POLICY_IDENTIFIER} + X509V3_R_NO_POLICY_IDENTIFIER = 139; + {$EXTERNALSYM X509V3_R_NO_PROXY_CERT_POLICY_LANGUAGE_DEFINED} + X509V3_R_NO_PROXY_CERT_POLICY_LANGUAGE_DEFINED = 154; + {$EXTERNALSYM X509V3_R_NO_PUBLIC_KEY} + X509V3_R_NO_PUBLIC_KEY = 114; + {$EXTERNALSYM X509V3_R_NO_SUBJECT_DETAILS} + X509V3_R_NO_SUBJECT_DETAILS = 125; + {$EXTERNALSYM X509V3_R_ODD_NUMBER_OF_DIGITS} + X509V3_R_ODD_NUMBER_OF_DIGITS = 112; + {$EXTERNALSYM X509V3_R_OPERATION_NOT_DEFINED} + X509V3_R_OPERATION_NOT_DEFINED = 148; + {$EXTERNALSYM X509V3_R_OTHERNAME_ERROR} + X509V3_R_OTHERNAME_ERROR = 147; + {$EXTERNALSYM X509V3_R_POLICY_LANGUAGE_ALREADY_DEFINED} + X509V3_R_POLICY_LANGUAGE_ALREADY_DEFINED = 155; + {$EXTERNALSYM X509V3_R_POLICY_PATH_LENGTH} + X509V3_R_POLICY_PATH_LENGTH = 156; + {$EXTERNALSYM X509V3_R_POLICY_PATH_LENGTH_ALREADY_DEFINED} + X509V3_R_POLICY_PATH_LENGTH_ALREADY_DEFINED = 157; + {$EXTERNALSYM X509V3_R_POLICY_SYNTAX_NOT_CURRENTLY_SUPPORTED} + X509V3_R_POLICY_SYNTAX_NOT_CURRENTLY_SUPPORTED = 158; + {$EXTERNALSYM X509V3_R_POLICY_WHEN_PROXY_LANGUAGE_REQUIRES_NO_POLICY} + X509V3_R_POLICY_WHEN_PROXY_LANGUAGE_REQUIRES_NO_POLICY = 159; + {$EXTERNALSYM X509V3_R_SECTION_NOT_FOUND} + X509V3_R_SECTION_NOT_FOUND = 150; + {$EXTERNALSYM X509V3_R_UNABLE_TO_GET_ISSUER_DETAILS} + X509V3_R_UNABLE_TO_GET_ISSUER_DETAILS = 122; + {$EXTERNALSYM X509V3_R_UNABLE_TO_GET_ISSUER_KEYID} + X509V3_R_UNABLE_TO_GET_ISSUER_KEYID = 123; + {$EXTERNALSYM X509V3_R_UNKNOWN_BIT_STRING_ARGUMENT} + X509V3_R_UNKNOWN_BIT_STRING_ARGUMENT = 111; + {$EXTERNALSYM X509V3_R_UNKNOWN_EXTENSION} + X509V3_R_UNKNOWN_EXTENSION = 129; + {$EXTERNALSYM X509V3_R_UNKNOWN_EXTENSION_NAME} + X509V3_R_UNKNOWN_EXTENSION_NAME = 130; + {$EXTERNALSYM X509V3_R_UNKNOWN_OPTION} + X509V3_R_UNKNOWN_OPTION = 120; + {$EXTERNALSYM X509V3_R_UNSUPPORTED_OPTION} + X509V3_R_UNSUPPORTED_OPTION = 117; + {$EXTERNALSYM X509V3_R_UNSUPPORTED_TYPE} + X509V3_R_UNSUPPORTED_TYPE = 167; + {$EXTERNALSYM X509V3_R_USER_TOO_LONG} + X509V3_R_USER_TOO_LONG = 132; +//* Possible values for status. See ts_resp_print.c && ts_resp_verify.c. */ + {$EXTERNALSYM TS_STATUS_GRANTED} + TS_STATUS_GRANTED = 0; + {$EXTERNALSYM TS_STATUS_GRANTED_WITH_MODS} + TS_STATUS_GRANTED_WITH_MODS = 1; + {$EXTERNALSYM TS_STATUS_REJECTION} + TS_STATUS_REJECTION = 2; + {$EXTERNALSYM TS_STATUS_WAITING} + TS_STATUS_WAITING = 3; + {$EXTERNALSYM TS_STATUS_REVOCATION_WARNING} + TS_STATUS_REVOCATION_WARNING = 4; + {$EXTERNALSYM TS_STATUS_REVOCATION_NOTIFICATION} + TS_STATUS_REVOCATION_NOTIFICATION = 5; + +//* Possible values for failure_info. See ts_resp_print.c && ts_resp_verify.c */ + {$EXTERNALSYM TS_INFO_BAD_ALG} + TS_INFO_BAD_ALG = 0; + {$EXTERNALSYM TS_INFO_BAD_REQUEST} + TS_INFO_BAD_REQUEST = 2; + {$EXTERNALSYM TS_INFO_BAD_DATA_FORMAT} + TS_INFO_BAD_DATA_FORMAT = 5; + {$EXTERNALSYM TS_INFO_TIME_NOT_AVAILABLE} + TS_INFO_TIME_NOT_AVAILABLE = 14; + {$EXTERNALSYM TS_INFO_UNACCEPTED_POLICY} + TS_INFO_UNACCEPTED_POLICY = 15; + {$EXTERNALSYM TS_INFO_UNACCEPTED_EXTENSION} + TS_INFO_UNACCEPTED_EXTENSION = 16; + {$EXTERNALSYM TS_INFO_ADD_INFO_NOT_AVAILABLE} + TS_INFO_ADD_INFO_NOT_AVAILABLE = 17; + {$EXTERNALSYM TS_INFO_SYSTEM_FAILURE} + TS_INFO_SYSTEM_FAILURE = 25; +//* Declarations related to response generation, defined in ts/ts_resp_sign.c. */ +//* Optional flags for response generation. */ +//* Don't include the TSA name in response. */ + {$EXTERNALSYM TS_TSA_NAME} + TS_TSA_NAME = $01; +//* Set ordering to true in response. */ + {$EXTERNALSYM TS_ORDERING} + TS_ORDERING = $02; +///* +// * Include the signer certificate and the other specified certificates in +// * the ESS signing certificate attribute beside the PKCS7 signed data. +// * Only the signer certificates is included by default. +// */ + {$EXTERNALSYM TS_ESS_CERT_ID_CHAIN} + TS_ESS_CERT_ID_CHAIN = $04; +//* At most we accept usec precision. */ + {$EXTERNALSYM TS_MAX_CLOCK_PRECISION_DIGITS} + TS_MAX_CLOCK_PRECISION_DIGITS = 6; +//* Context structure for the generic verify method. */ + +//* Verify the signer's certificate and the signature of the response. */ + {$EXTERNALSYM TS_VFY_SIGNATURE} + TS_VFY_SIGNATURE = TIdC_ULONG(1 shl 0); +//* Verify the version number of the response. */ + {$EXTERNALSYM TS_VFY_VERSION} + TS_VFY_VERSION = TIdC_ULONG(1 shl 1); + ///* Verify if the policy supplied by the user matches the policy of the TSA. */ + {$EXTERNALSYM TS_VFY_POLICY} + TS_VFY_POLICY = TIdC_ULONG(1 shl 2); + +///* Verify the message imprint provided by the user. This flag should not be +// specified with TS_VFY_DATA. */ + {$EXTERNALSYM TS_VFY_IMPRINT} + TS_VFY_IMPRINT = TIdC_ULONG(1 shl 3); +///* Verify the message imprint computed by the verify method from the user +// provided data and the MD algorithm of the response. This flag should not be +// specified with TS_VFY_IMPRINT. */ + {$EXTERNALSYM TS_VFY_DATA} + TS_VFY_DATA = TIdC_ULONG(1 shl 4); +//* Verify the nonce value. */ + {$EXTERNALSYM TS_VFY_NONCE} + TS_VFY_NONCE = TIdC_ULONG(1 shl 5); +//* Verify if the TSA name field matches the signer certificate. */ + {$EXTERNALSYM TS_VFY_SIGNER} + TS_VFY_SIGNER = TIdC_ULONG(1 shl 6); +//* Verify if the TSA name field equals to the user provided name. */ + {$EXTERNALSYM TS_VFY_TSA_NAME} + TS_VFY_TSA_NAME = TIdC_ULONG(1 shl 7); + +//* You can use the following convenience constants. */ + {$EXTERNALSYM TS_VFY_ALL_IMPRINT} + TS_VFY_ALL_IMPRINT = (TS_VFY_SIGNATURE + or TS_VFY_VERSION + or TS_VFY_POLICY + or TS_VFY_IMPRINT + or TS_VFY_NONCE + or TS_VFY_SIGNER + or TS_VFY_TSA_NAME); + {$EXTERNALSYM TS_VFY_ALL_DATA} + TS_VFY_ALL_DATA = (TS_VFY_SIGNATURE + or TS_VFY_VERSION + or TS_VFY_POLICY + or TS_VFY_DATA + or TS_VFY_NONCE + or TS_VFY_SIGNER + or TS_VFY_TSA_NAME); + +//* Error codes for the TS functions. */ + + +//* Function codes. */ + {$EXTERNALSYM TS_F_D2I_TS_RESP} + TS_F_D2I_TS_RESP = 147; + {$EXTERNALSYM TS_F_DEF_SERIAL_CB} + TS_F_DEF_SERIAL_CB = 110; + {$EXTERNALSYM TS_F_DEF_TIME_CB} + TS_F_DEF_TIME_CB = 111; + {$EXTERNALSYM TS_F_ESS_ADD_SIGNING_CERT} + TS_F_ESS_ADD_SIGNING_CERT = 112; + {$EXTERNALSYM TS_F_ESS_CERT_ID_NEW_INIT} + TS_F_ESS_CERT_ID_NEW_INIT = 113; + {$EXTERNALSYM TS_F_ESS_SIGNING_CERT_NEW_INIT} + TS_F_ESS_SIGNING_CERT_NEW_INIT = 114; + {$EXTERNALSYM TS_F_INT_TS_RESP_VERIFY_TOKEN} + TS_F_INT_TS_RESP_VERIFY_TOKEN = 149; + {$EXTERNALSYM TS_F_PKCS7_TO_TS_TST_INFO} + TS_F_PKCS7_TO_TS_TST_INFO = 148; + {$EXTERNALSYM TS_F_TS_ACCURACY_SET_MICROS} + TS_F_TS_ACCURACY_SET_MICROS = 115; + {$EXTERNALSYM TS_F_TS_ACCURACY_SET_MILLIS} + TS_F_TS_ACCURACY_SET_MILLIS = 116; + {$EXTERNALSYM TS_F_TS_ACCURACY_SET_SECONDS} + TS_F_TS_ACCURACY_SET_SECONDS = 117; + {$EXTERNALSYM TS_F_TS_CHECK_IMPRINTS} + TS_F_TS_CHECK_IMPRINTS = 100; + {$EXTERNALSYM TS_F_TS_CHECK_NONCES} + TS_F_TS_CHECK_NONCES = 101; + {$EXTERNALSYM TS_F_TS_CHECK_POLICY} + TS_F_TS_CHECK_POLICY = 102; + {$EXTERNALSYM TS_F_TS_CHECK_SIGNING_CERTS} + TS_F_TS_CHECK_SIGNING_CERTS = 103; + {$EXTERNALSYM TS_F_TS_CHECK_STATUS_INFO} + TS_F_TS_CHECK_STATUS_INFO = 104; + {$EXTERNALSYM TS_F_TS_COMPUTE_IMPRINT} + TS_F_TS_COMPUTE_IMPRINT = 145; + {$EXTERNALSYM TS_F_TS_CONF_SET_DEFAULT_ENGINE} + TS_F_TS_CONF_SET_DEFAULT_ENGINE = 146; + {$EXTERNALSYM TS_F_TS_GET_STATUS_TEXT} + TS_F_TS_GET_STATUS_TEXT = 105; + {$EXTERNALSYM TS_F_TS_MSG_IMPRINT_SET_ALGO} + TS_F_TS_MSG_IMPRINT_SET_ALGO = 118; + {$EXTERNALSYM TS_F_TS_REQ_SET_MSG_IMPRINT} + TS_F_TS_REQ_SET_MSG_IMPRINT = 119; + {$EXTERNALSYM TS_F_TS_REQ_SET_NONCE} + TS_F_TS_REQ_SET_NONCE = 120; + {$EXTERNALSYM TS_F_TS_REQ_SET_POLICY_ID} + TS_F_TS_REQ_SET_POLICY_ID = 121; + {$EXTERNALSYM TS_F_TS_RESP_CREATE_RESPONSE} + TS_F_TS_RESP_CREATE_RESPONSE = 122; + {$EXTERNALSYM TS_F_TS_RESP_CREATE_TST_INFO} + TS_F_TS_RESP_CREATE_TST_INFO = 123; + {$EXTERNALSYM TS_F_TS_RESP_CTX_ADD_FAILURE_INFO} + TS_F_TS_RESP_CTX_ADD_FAILURE_INFO = 124; + {$EXTERNALSYM TS_F_TS_RESP_CTX_ADD_MD} + TS_F_TS_RESP_CTX_ADD_MD = 125; + {$EXTERNALSYM TS_F_TS_RESP_CTX_ADD_POLICY} + TS_F_TS_RESP_CTX_ADD_POLICY = 126; + {$EXTERNALSYM TS_F_TS_RESP_CTX_NEW} + TS_F_TS_RESP_CTX_NEW = 127; + {$EXTERNALSYM TS_F_TS_RESP_CTX_SET_ACCURACY} + TS_F_TS_RESP_CTX_SET_ACCURACY = 128; + {$EXTERNALSYM TS_F_TS_RESP_CTX_SET_CERTS} + TS_F_TS_RESP_CTX_SET_CERTS = 129; + {$EXTERNALSYM TS_F_TS_RESP_CTX_SET_DEF_POLICY} + TS_F_TS_RESP_CTX_SET_DEF_POLICY = 130; + {$EXTERNALSYM TS_F_TS_RESP_CTX_SET_SIGNER_CERT} + TS_F_TS_RESP_CTX_SET_SIGNER_CERT = 131; + {$EXTERNALSYM TS_F_TS_RESP_CTX_SET_STATUS_INFO} + TS_F_TS_RESP_CTX_SET_STATUS_INFO = 132; + {$EXTERNALSYM TS_F_TS_RESP_GET_POLICY} + TS_F_TS_RESP_GET_POLICY = 133; + {$EXTERNALSYM TS_F_TS_RESP_SET_GENTIME_WITH_PRECISION} + TS_F_TS_RESP_SET_GENTIME_WITH_PRECISION = 134; + {$EXTERNALSYM TS_F_TS_RESP_SET_STATUS_INFO} + TS_F_TS_RESP_SET_STATUS_INFO = 135; + {$EXTERNALSYM TS_F_TS_RESP_SET_TST_INFO} + TS_F_TS_RESP_SET_TST_INFO = 150; + {$EXTERNALSYM TS_F_TS_RESP_SIGN} + TS_F_TS_RESP_SIGN = 136; + {$EXTERNALSYM TS_F_TS_RESP_VERIFY_SIGNATURE} + TS_F_TS_RESP_VERIFY_SIGNATURE = 106; + {$EXTERNALSYM TS_F_TS_RESP_VERIFY_TOKEN} + TS_F_TS_RESP_VERIFY_TOKEN = 107; + {$EXTERNALSYM TS_F_TS_TST_INFO_SET_ACCURACY} + TS_F_TS_TST_INFO_SET_ACCURACY = 137; + {$EXTERNALSYM TS_F_TS_TST_INFO_SET_MSG_IMPRINT} + TS_F_TS_TST_INFO_SET_MSG_IMPRINT = 138; + {$EXTERNALSYM TS_F_TS_TST_INFO_SET_NONCE} + TS_F_TS_TST_INFO_SET_NONCE = 139; + {$EXTERNALSYM TS_F_TS_TST_INFO_SET_POLICY_ID} + TS_F_TS_TST_INFO_SET_POLICY_ID = 140; + {$EXTERNALSYM TS_F_TS_TST_INFO_SET_SERIAL} + TS_F_TS_TST_INFO_SET_SERIAL = 141; + {$EXTERNALSYM TS_F_TS_TST_INFO_SET_TIME} + TS_F_TS_TST_INFO_SET_TIME = 142; + {$EXTERNALSYM TS_F_TS_TST_INFO_SET_TSA} + TS_F_TS_TST_INFO_SET_TSA = 143; + {$EXTERNALSYM TS_F_TS_VERIFY} + TS_F_TS_VERIFY = 108; + {$EXTERNALSYM TS_F_TS_VERIFY_CERT} + TS_F_TS_VERIFY_CERT = 109; + {$EXTERNALSYM TS_F_TS_VERIFY_CTX_NEW} + TS_F_TS_VERIFY_CTX_NEW = 144; + +//* Reason codes. */ + {$EXTERNALSYM TS_R_BAD_PKCS7_TYPE} + TS_R_BAD_PKCS7_TYPE = 132; + {$EXTERNALSYM TS_R_BAD_TYPE} + TS_R_BAD_TYPE = 133; + {$EXTERNALSYM TS_R_CERTIFICATE_VERIFY_ERROR} + TS_R_CERTIFICATE_VERIFY_ERROR = 100; + {$EXTERNALSYM TS_R_COULD_NOT_SET_ENGINE} + TS_R_COULD_NOT_SET_ENGINE = 127; + {$EXTERNALSYM TS_R_COULD_NOT_SET_TIME} + TS_R_COULD_NOT_SET_TIME = 115; + {$EXTERNALSYM TS_R_D2I_TS_RESP_INT_FAILED} + TS_R_D2I_TS_RESP_INT_FAILED = 128; + {$EXTERNALSYM TS_R_DETACHED_CONTENT} + TS_R_DETACHED_CONTENT = 134; + {$EXTERNALSYM TS_R_ESS_ADD_SIGNING_CERT_ERROR} + TS_R_ESS_ADD_SIGNING_CERT_ERROR = 116; + {$EXTERNALSYM TS_R_ESS_SIGNING_CERTIFICATE_ERROR} + TS_R_ESS_SIGNING_CERTIFICATE_ERROR = 101; + {$EXTERNALSYM TS_R_INVALID_NULL_POINTER} + TS_R_INVALID_NULL_POINTER = 102; + {$EXTERNALSYM TS_R_INVALID_SIGNER_CERTIFICATE_PURPOSE} + TS_R_INVALID_SIGNER_CERTIFICATE_PURPOSE = 117; + {$EXTERNALSYM TS_R_MESSAGE_IMPRINT_MISMATCH} + TS_R_MESSAGE_IMPRINT_MISMATCH = 103; + {$EXTERNALSYM TS_R_NONCE_MISMATCH} + TS_R_NONCE_MISMATCH = 104; + {$EXTERNALSYM TS_R_NONCE_NOT_RETURNED} + TS_R_NONCE_NOT_RETURNED = 105; + {$EXTERNALSYM TS_R_NO_CONTENT} + TS_R_NO_CONTENT = 106; + {$EXTERNALSYM TS_R_NO_TIME_STAMP_TOKEN} + TS_R_NO_TIME_STAMP_TOKEN = 107; + {$EXTERNALSYM TS_R_PKCS7_ADD_SIGNATURE_ERROR} + TS_R_PKCS7_ADD_SIGNATURE_ERROR = 118; + {$EXTERNALSYM TS_R_PKCS7_ADD_SIGNED_ATTR_ERROR} + TS_R_PKCS7_ADD_SIGNED_ATTR_ERROR = 119; + {$EXTERNALSYM TS_R_PKCS7_TO_TS_TST_INFO_FAILED} + TS_R_PKCS7_TO_TS_TST_INFO_FAILED = 129; + {$EXTERNALSYM TS_R_POLICY_MISMATCH} + TS_R_POLICY_MISMATCH = 108; + {$EXTERNALSYM TS_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE} + TS_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE = 120; + {$EXTERNALSYM TS_R_RESPONSE_SETUP_ERROR} + TS_R_RESPONSE_SETUP_ERROR = 121; + {$EXTERNALSYM TS_R_SIGNATURE_FAILURE} + TS_R_SIGNATURE_FAILURE = 109; + {$EXTERNALSYM TS_R_THERE_MUST_BE_ONE_SIGNER} + TS_R_THERE_MUST_BE_ONE_SIGNER = 110; + {$EXTERNALSYM TS_R_TIME_SYSCALL_ERROR} + TS_R_TIME_SYSCALL_ERROR = 122; + {$EXTERNALSYM TS_R_TOKEN_NOT_PRESENT} + TS_R_TOKEN_NOT_PRESENT = 130; + {$EXTERNALSYM TS_R_TOKEN_PRESENT} + TS_R_TOKEN_PRESENT = 131; + {$EXTERNALSYM TS_R_TSA_NAME_MISMATCH} + TS_R_TSA_NAME_MISMATCH = 111; + {$EXTERNALSYM TS_R_TSA_UNTRUSTED} + TS_R_TSA_UNTRUSTED = 112; + {$EXTERNALSYM TS_R_TST_INFO_SETUP_ERROR} + TS_R_TST_INFO_SETUP_ERROR = 123; + {$EXTERNALSYM TS_R_TS_DATASIGN} + TS_R_TS_DATASIGN = 124; + {$EXTERNALSYM TS_R_UNACCEPTABLE_POLICY} + TS_R_UNACCEPTABLE_POLICY = 125; + {$EXTERNALSYM TS_R_UNSUPPORTED_MD_ALGORITHM} + TS_R_UNSUPPORTED_MD_ALGORITHM = 126; + {$EXTERNALSYM TS_R_UNSUPPORTED_VERSION} + TS_R_UNSUPPORTED_VERSION = 113; + {$EXTERNALSYM TS_R_WRONG_CONTENT_TYPE} + TS_R_WRONG_CONTENT_TYPE = 114; + + {$UNDEF OPENSSL_NO_CMS} + {$IFNDEF OPENSSL_NO_CMS} + {$EXTERNALSYM CMS_SIGNERINFO_ISSUER_SERIAL} + CMS_SIGNERINFO_ISSUER_SERIAL = 0; + {$EXTERNALSYM CMS_SIGNERINFO_KEYIDENTIFIER} + CMS_SIGNERINFO_KEYIDENTIFIER = 1; + {$EXTERNALSYM CMS_RECIPINFO_TRANS} + CMS_RECIPINFO_TRANS = 0; + {$EXTERNALSYM CMS_RECIPINFO_AGREE} + CMS_RECIPINFO_AGREE = 1; + {$EXTERNALSYM CMS_RECIPINFO_KEK} + CMS_RECIPINFO_KEK = 2; + {$EXTERNALSYM CMS_RECIPINFO_PASS} + CMS_RECIPINFO_PASS = 3; + {$EXTERNALSYM CMS_RECIPINFO_OTHER} + CMS_RECIPINFO_OTHER = 4; + +//* S/MIME related flags */ + {$EXTERNALSYM CMS_TEXT} + CMS_TEXT = $1; + {$EXTERNALSYM CMS_NOCERTS} + CMS_NOCERTS = $2; + {$EXTERNALSYM CMS_NO_CONTENT_VERIFY} + CMS_NO_CONTENT_VERIFY = $4; + {$EXTERNALSYM CMS_NO_ATTR_VERIFY} + CMS_NO_ATTR_VERIFY = $8; + {$EXTERNALSYM CMS_NOSIGS} + CMS_NOSIGS = (CMS_NO_CONTENT_VERIFY or CMS_NO_ATTR_VERIFY); + {$EXTERNALSYM CMS_NOINTERN} + CMS_NOINTERN = $10; + {$EXTERNALSYM CMS_NO_SIGNER_CERT_VERIFY} + CMS_NO_SIGNER_CERT_VERIFY = $20; + {$EXTERNALSYM CMS_NOVERIFY} + CMS_NOVERIFY = $20; + {$EXTERNALSYM CMS_DETACHED} + CMS_DETACHED = $40; + {$EXTERNALSYM CMS_BINARY} + CMS_BINARY = $80; + {$EXTERNALSYM CMS_NOATTR} + CMS_NOATTR = $100; + {$EXTERNALSYM CMS_NOSMIMECAP} + CMS_NOSMIMECAP = $200; + {$EXTERNALSYM CMS_NOOLDMIMETYPE} + CMS_NOOLDMIMETYPE = $400; + {$EXTERNALSYM CMS_CRLFEOL} + CMS_CRLFEOL = $800; + {$EXTERNALSYM CMS_STREAM} + CMS_STREAM = $1000; + {$EXTERNALSYM CMS_NOCRL} + CMS_NOCRL = $2000; + {$EXTERNALSYM CMS_PARTIAL} + CMS_PARTIAL = $4000; + {$EXTERNALSYM CMS_REUSE_DIGEST} + CMS_REUSE_DIGEST = $8000; + {$EXTERNALSYM CMS_USE_KEYID} + CMS_USE_KEYID = $10000; + +//* Error codes for the CMS functions. */ + +//* Function codes. */ + {$EXTERNALSYM CMS_F_CHECK_CONTENT} + CMS_F_CHECK_CONTENT = 99; + {$EXTERNALSYM CMS_F_CMS_ADD0_CERT} + CMS_F_CMS_ADD0_CERT = 164; + {$EXTERNALSYM CMS_F_CMS_ADD0_RECIPIENT_KEY} + CMS_F_CMS_ADD0_RECIPIENT_KEY = 100; + {$EXTERNALSYM CMS_F_CMS_ADD1_RECEIPTREQUEST} + CMS_F_CMS_ADD1_RECEIPTREQUEST = 158; + {$EXTERNALSYM CMS_F_CMS_ADD1_RECIPIENT_CERT} + CMS_F_CMS_ADD1_RECIPIENT_CERT = 101; + {$EXTERNALSYM CMS_F_CMS_ADD1_SIGNER} + CMS_F_CMS_ADD1_SIGNER = 102; + {$EXTERNALSYM CMS_F_CMS_ADD1_SIGNINGTIME} + CMS_F_CMS_ADD1_SIGNINGTIME = 103; + {$EXTERNALSYM CMS_F_CMS_COMPRESS} + CMS_F_CMS_COMPRESS = 104; + {$EXTERNALSYM CMS_F_CMS_COMPRESSEDDATA_CREATE} + CMS_F_CMS_COMPRESSEDDATA_CREATE = 105; + {$EXTERNALSYM CMS_F_CMS_COMPRESSEDDATA_INIT_BIO} + CMS_F_CMS_COMPRESSEDDATA_INIT_BIO = 106; + {$EXTERNALSYM CMS_F_CMS_COPY_CONTENT} + CMS_F_CMS_COPY_CONTENT = 107; + {$EXTERNALSYM CMS_F_CMS_COPY_MESSAGEDIGEST} + CMS_F_CMS_COPY_MESSAGEDIGEST = 108; + {$EXTERNALSYM CMS_F_CMS_DATA} + CMS_F_CMS_DATA = 109; + {$EXTERNALSYM CMS_F_CMS_DATAFINAL} + CMS_F_CMS_DATAFINAL = 110; + {$EXTERNALSYM CMS_F_CMS_DATAINIT} + CMS_F_CMS_DATAINIT = 111; + {$EXTERNALSYM CMS_F_CMS_DECRYPT} + CMS_F_CMS_DECRYPT = 112; + {$EXTERNALSYM CMS_F_CMS_DECRYPT_SET1_KEY} + CMS_F_CMS_DECRYPT_SET1_KEY = 113; + {$EXTERNALSYM CMS_F_CMS_DECRYPT_SET1_PKEY} + CMS_F_CMS_DECRYPT_SET1_PKEY = 114; + {$EXTERNALSYM CMS_F_CMS_DIGESTALGORITHM_FIND_CTX} + CMS_F_CMS_DIGESTALGORITHM_FIND_CTX = 115; + {$EXTERNALSYM CMS_F_CMS_DIGESTALGORITHM_INIT_BIO} + CMS_F_CMS_DIGESTALGORITHM_INIT_BIO = 116; + {$EXTERNALSYM CMS_F_CMS_DIGESTEDDATA_DO_FINAL} + CMS_F_CMS_DIGESTEDDATA_DO_FINAL = 117; + {$EXTERNALSYM CMS_F_CMS_DIGEST_VERIFY} + CMS_F_CMS_DIGEST_VERIFY = 118; + {$EXTERNALSYM CMS_F_CMS_ENCODE_RECEIPT} + CMS_F_CMS_ENCODE_RECEIPT = 161; + {$EXTERNALSYM CMS_F_CMS_ENCRYPT} + CMS_F_CMS_ENCRYPT = 119; + {$EXTERNALSYM CMS_F_CMS_ENCRYPTEDCONTENT_INIT_BIO} + CMS_F_CMS_ENCRYPTEDCONTENT_INIT_BIO = 120; + {$EXTERNALSYM CMS_F_CMS_ENCRYPTEDDATA_DECRYPT} + CMS_F_CMS_ENCRYPTEDDATA_DECRYPT = 121; + {$EXTERNALSYM CMS_F_CMS_ENCRYPTEDDATA_ENCRYPT} + CMS_F_CMS_ENCRYPTEDDATA_ENCRYPT = 122; + {$EXTERNALSYM CMS_F_CMS_ENCRYPTEDDATA_SET1_KEY} + CMS_F_CMS_ENCRYPTEDDATA_SET1_KEY = 123; + {$EXTERNALSYM CMS_F_CMS_ENVELOPEDDATA_CREATE} + CMS_F_CMS_ENVELOPEDDATA_CREATE = 124; + {$EXTERNALSYM CMS_F_CMS_ENVELOPEDDATA_INIT_BIO} + CMS_F_CMS_ENVELOPEDDATA_INIT_BIO = 125; + {$EXTERNALSYM CMS_F_CMS_ENVELOPED_DATA_INIT} + CMS_F_CMS_ENVELOPED_DATA_INIT = 126; + {$EXTERNALSYM CMS_F_CMS_FINAL} + CMS_F_CMS_FINAL = 127; + {$EXTERNALSYM CMS_F_CMS_GET0_CERTIFICATE_CHOICES} + CMS_F_CMS_GET0_CERTIFICATE_CHOICES = 128; + {$EXTERNALSYM CMS_F_CMS_GET0_CONTENT} + CMS_F_CMS_GET0_CONTENT = 129; + {$EXTERNALSYM CMS_F_CMS_GET0_ECONTENT_TYPE} + CMS_F_CMS_GET0_ECONTENT_TYPE = 130; + {$EXTERNALSYM CMS_F_CMS_GET0_ENVELOPED} + CMS_F_CMS_GET0_ENVELOPED = 131; + {$EXTERNALSYM CMS_F_CMS_GET0_REVOCATION_CHOICES} + CMS_F_CMS_GET0_REVOCATION_CHOICES = 132; + {$EXTERNALSYM CMS_F_CMS_GET0_SIGNED} + CMS_F_CMS_GET0_SIGNED = 133; + {$EXTERNALSYM CMS_F_CMS_MSGSIGDIGEST_ADD1} + CMS_F_CMS_MSGSIGDIGEST_ADD1 = 162; + {$EXTERNALSYM CMS_F_CMS_RECEIPTREQUEST_CREATE0} + CMS_F_CMS_RECEIPTREQUEST_CREATE0 = 159; + {$EXTERNALSYM CMS_F_CMS_RECEIPT_VERIFY} + CMS_F_CMS_RECEIPT_VERIFY = 160; + {$EXTERNALSYM CMS_F_CMS_RECIPIENTINFO_DECRYPT} + CMS_F_CMS_RECIPIENTINFO_DECRYPT = 134; + {$EXTERNALSYM CMS_F_CMS_RECIPIENTINFO_KEKRI_DECRYPT} + CMS_F_CMS_RECIPIENTINFO_KEKRI_DECRYPT = 135; + {$EXTERNALSYM CMS_F_CMS_RECIPIENTINFO_KEKRI_ENCRYPT} + CMS_F_CMS_RECIPIENTINFO_KEKRI_ENCRYPT = 136; + {$EXTERNALSYM CMS_F_CMS_RECIPIENTINFO_KEKRI_GET0_ID} + CMS_F_CMS_RECIPIENTINFO_KEKRI_GET0_ID = 137; + {$EXTERNALSYM CMS_F_CMS_RECIPIENTINFO_KEKRI_ID_CMP} + CMS_F_CMS_RECIPIENTINFO_KEKRI_ID_CMP = 138; + {$EXTERNALSYM CMS_F_CMS_RECIPIENTINFO_KTRI_CERT_CMP} + CMS_F_CMS_RECIPIENTINFO_KTRI_CERT_CMP = 139; + {$EXTERNALSYM CMS_F_CMS_RECIPIENTINFO_KTRI_DECRYPT} + CMS_F_CMS_RECIPIENTINFO_KTRI_DECRYPT = 140; + {$EXTERNALSYM CMS_F_CMS_RECIPIENTINFO_KTRI_ENCRYPT} + CMS_F_CMS_RECIPIENTINFO_KTRI_ENCRYPT = 141; + {$EXTERNALSYM CMS_F_CMS_RECIPIENTINFO_KTRI_GET0_ALGS} + CMS_F_CMS_RECIPIENTINFO_KTRI_GET0_ALGS = 142; + {$EXTERNALSYM CMS_F_CMS_RECIPIENTINFO_KTRI_GET0_SIGNER_ID} + CMS_F_CMS_RECIPIENTINFO_KTRI_GET0_SIGNER_ID = 143; + {$EXTERNALSYM CMS_F_CMS_RECIPIENTINFO_SET0_KEY} + CMS_F_CMS_RECIPIENTINFO_SET0_KEY = 144; + {$EXTERNALSYM CMS_F_CMS_RECIPIENTINFO_SET0_PKEY} + CMS_F_CMS_RECIPIENTINFO_SET0_PKEY = 145; + {$EXTERNALSYM CMS_F_CMS_SET1_SIGNERIDENTIFIER} + CMS_F_CMS_SET1_SIGNERIDENTIFIER = 146; + {$EXTERNALSYM CMS_F_CMS_SET_DETACHED} + CMS_F_CMS_SET_DETACHED = 147; + {$EXTERNALSYM CMS_F_CMS_SIGN} + CMS_F_CMS_SIGN = 148; + {$EXTERNALSYM CMS_F_CMS_SIGNED_DATA_INIT} + CMS_F_CMS_SIGNED_DATA_INIT = 149; + {$EXTERNALSYM CMS_F_CMS_SIGNERINFO_CONTENT_SIGN} + CMS_F_CMS_SIGNERINFO_CONTENT_SIGN = 150; + {$EXTERNALSYM CMS_F_CMS_SIGNERINFO_SIGN} + CMS_F_CMS_SIGNERINFO_SIGN = 151; + {$EXTERNALSYM CMS_F_CMS_SIGNERINFO_VERIFY} + CMS_F_CMS_SIGNERINFO_VERIFY = 152; + {$EXTERNALSYM CMS_F_CMS_SIGNERINFO_VERIFY_CERT} + CMS_F_CMS_SIGNERINFO_VERIFY_CERT = 153; + {$EXTERNALSYM CMS_F_CMS_SIGNERINFO_VERIFY_CONTENT} + CMS_F_CMS_SIGNERINFO_VERIFY_CONTENT = 154; + {$EXTERNALSYM CMS_F_CMS_SIGN_RECEIPT} + CMS_F_CMS_SIGN_RECEIPT = 163; + {$EXTERNALSYM CMS_F_CMS_STREAM} + CMS_F_CMS_STREAM = 155; + {$EXTERNALSYM CMS_F_CMS_UNCOMPRESS} + CMS_F_CMS_UNCOMPRESS = 156; + {$EXTERNALSYM CMS_F_CMS_VERIFY} + CMS_F_CMS_VERIFY = 157; + +//* Reason codes. */ + {$EXTERNALSYM CMS_R_ADD_SIGNER_ERROR} + CMS_R_ADD_SIGNER_ERROR = 99; + {$EXTERNALSYM CMS_R_CERTIFICATE_ALREADY_PRESENT} + CMS_R_CERTIFICATE_ALREADY_PRESENT = 175; + {$EXTERNALSYM CMS_R_CERTIFICATE_HAS_NO_KEYID} + CMS_R_CERTIFICATE_HAS_NO_KEYID = 160; + {$EXTERNALSYM CMS_R_CERTIFICATE_VERIFY_ERROR} + CMS_R_CERTIFICATE_VERIFY_ERROR = 100; + {$EXTERNALSYM CMS_R_CIPHER_INITIALISATION_ERROR} + CMS_R_CIPHER_INITIALISATION_ERROR = 101; + {$EXTERNALSYM CMS_R_CIPHER_PARAMETER_INITIALISATION_ERROR} + CMS_R_CIPHER_PARAMETER_INITIALISATION_ERROR = 102; + {$EXTERNALSYM CMS_R_CMS_DATAFINAL_ERROR} + CMS_R_CMS_DATAFINAL_ERROR = 103; + {$EXTERNALSYM CMS_R_CMS_LIB} + CMS_R_CMS_LIB = 104; + {$EXTERNALSYM CMS_R_CONTENTIDENTIFIER_MISMATCH} + CMS_R_CONTENTIDENTIFIER_MISMATCH = 170; + {$EXTERNALSYM CMS_R_CONTENT_NOT_FOUND} + CMS_R_CONTENT_NOT_FOUND = 105; + {$EXTERNALSYM CMS_R_CONTENT_TYPE_MISMATCH} + CMS_R_CONTENT_TYPE_MISMATCH = 171; + {$EXTERNALSYM CMS_R_CONTENT_TYPE_NOT_COMPRESSED_DATA} + CMS_R_CONTENT_TYPE_NOT_COMPRESSED_DATA = 106; + {$EXTERNALSYM CMS_R_CONTENT_TYPE_NOT_ENVELOPED_DATA} + CMS_R_CONTENT_TYPE_NOT_ENVELOPED_DATA = 107; + {$EXTERNALSYM CMS_R_CONTENT_TYPE_NOT_SIGNED_DATA} + CMS_R_CONTENT_TYPE_NOT_SIGNED_DATA = 108; + {$EXTERNALSYM CMS_R_CONTENT_VERIFY_ERROR} + CMS_R_CONTENT_VERIFY_ERROR = 109; + {$EXTERNALSYM CMS_R_CTRL_ERROR} + CMS_R_CTRL_ERROR = 110; + {$EXTERNALSYM CMS_R_CTRL_FAILURE} + CMS_R_CTRL_FAILURE = 111; + {$EXTERNALSYM CMS_R_DECRYPT_ERROR} + CMS_R_DECRYPT_ERROR = 112; + {$EXTERNALSYM CMS_R_DIGEST_ERROR} + CMS_R_DIGEST_ERROR = 161; + {$EXTERNALSYM CMS_R_ERROR_GETTING_PUBLIC_KEY} + CMS_R_ERROR_GETTING_PUBLIC_KEY = 113; + {$EXTERNALSYM CMS_R_ERROR_READING_MESSAGEDIGEST_ATTRIBUTE} + CMS_R_ERROR_READING_MESSAGEDIGEST_ATTRIBUTE = 114; + {$EXTERNALSYM CMS_R_ERROR_SETTING_KEY} + CMS_R_ERROR_SETTING_KEY = 115; + {$EXTERNALSYM CMS_R_ERROR_SETTING_RECIPIENTINFO} + CMS_R_ERROR_SETTING_RECIPIENTINFO = 116; + {$EXTERNALSYM CMS_R_INVALID_ENCRYPTED_KEY_LENGTH} + CMS_R_INVALID_ENCRYPTED_KEY_LENGTH = 117; + {$EXTERNALSYM CMS_R_INVALID_KEY_LENGTH} + CMS_R_INVALID_KEY_LENGTH = 118; + {$EXTERNALSYM CMS_R_MD_BIO_INIT_ERROR} + CMS_R_MD_BIO_INIT_ERROR = 119; + {$EXTERNALSYM CMS_R_MESSAGEDIGEST_ATTRIBUTE_WRONG_LENGTH} + CMS_R_MESSAGEDIGEST_ATTRIBUTE_WRONG_LENGTH = 120; + {$EXTERNALSYM CMS_R_MESSAGEDIGEST_WRONG_LENGTH} + CMS_R_MESSAGEDIGEST_WRONG_LENGTH = 121; + {$EXTERNALSYM CMS_R_MSGSIGDIGEST_ERROR} + CMS_R_MSGSIGDIGEST_ERROR = 172; + {$EXTERNALSYM CMS_R_MSGSIGDIGEST_VERIFICATION_FAILURE} + CMS_R_MSGSIGDIGEST_VERIFICATION_FAILURE = 162; + {$EXTERNALSYM CMS_R_MSGSIGDIGEST_WRONG_LENGTH} + CMS_R_MSGSIGDIGEST_WRONG_LENGTH = 163; + {$EXTERNALSYM CMS_R_NEED_ONE_SIGNER} + CMS_R_NEED_ONE_SIGNER = 164; + {$EXTERNALSYM CMS_R_NOT_A_SIGNED_RECEIPT} + CMS_R_NOT_A_SIGNED_RECEIPT = 165; + {$EXTERNALSYM CMS_R_NOT_ENCRYPTED_DATA} + CMS_R_NOT_ENCRYPTED_DATA = 122; + {$EXTERNALSYM CMS_R_NOT_KEK} + CMS_R_NOT_KEK = 123; + {$EXTERNALSYM CMS_R_NOT_KEY_TRANSPORT} + CMS_R_NOT_KEY_TRANSPORT = 124; + {$EXTERNALSYM CMS_R_NOT_SUPPORTED_FOR_THIS_KEY_TYPE} + CMS_R_NOT_SUPPORTED_FOR_THIS_KEY_TYPE = 125; + {$EXTERNALSYM CMS_R_NO_CIPHER} + CMS_R_NO_CIPHER = 126; + {$EXTERNALSYM CMS_R_NO_CONTENT} + CMS_R_NO_CONTENT = 127; + {$EXTERNALSYM CMS_R_NO_CONTENT_TYPE} + CMS_R_NO_CONTENT_TYPE = 173; + {$EXTERNALSYM CMS_R_NO_DEFAULT_DIGEST} + CMS_R_NO_DEFAULT_DIGEST = 128; + {$EXTERNALSYM CMS_R_NO_DIGEST_SET} + CMS_R_NO_DIGEST_SET = 129; + {$EXTERNALSYM CMS_R_NO_KEY} + CMS_R_NO_KEY = 130; + {$EXTERNALSYM CMS_R_NO_KEY_OR_CERT} + CMS_R_NO_KEY_OR_CERT = 174; + {$EXTERNALSYM CMS_R_NO_MATCHING_DIGEST} + CMS_R_NO_MATCHING_DIGEST = 131; + {$EXTERNALSYM CMS_R_NO_MATCHING_RECIPIENT} + CMS_R_NO_MATCHING_RECIPIENT = 132; + {$EXTERNALSYM CMS_R_NO_MATCHING_SIGNATURE} + CMS_R_NO_MATCHING_SIGNATURE = 166; + {$EXTERNALSYM CMS_R_NO_MSGSIGDIGEST} + CMS_R_NO_MSGSIGDIGEST = 167; + {$EXTERNALSYM CMS_R_NO_PRIVATE_KEY} + CMS_R_NO_PRIVATE_KEY = 133; + {$EXTERNALSYM CMS_R_NO_PUBLIC_KEY} + CMS_R_NO_PUBLIC_KEY = 134; + {$EXTERNALSYM CMS_R_NO_RECEIPT_REQUEST} + CMS_R_NO_RECEIPT_REQUEST = 168; + {$EXTERNALSYM CMS_R_NO_SIGNERS} + CMS_R_NO_SIGNERS = 135; + {$EXTERNALSYM CMS_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE} + CMS_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE = 136; + {$EXTERNALSYM CMS_R_RECEIPT_DECODE_ERROR} + CMS_R_RECEIPT_DECODE_ERROR = 169; + {$EXTERNALSYM CMS_R_RECIPIENT_ERROR} + CMS_R_RECIPIENT_ERROR = 137; + {$EXTERNALSYM CMS_R_SIGNER_CERTIFICATE_NOT_FOUND} + CMS_R_SIGNER_CERTIFICATE_NOT_FOUND = 138; + {$EXTERNALSYM CMS_R_SIGNFINAL_ERROR} + CMS_R_SIGNFINAL_ERROR = 139; + {$EXTERNALSYM CMS_R_SMIME_TEXT_ERROR} + CMS_R_SMIME_TEXT_ERROR = 140; + {$EXTERNALSYM CMS_R_STORE_INIT_ERROR} + CMS_R_STORE_INIT_ERROR = 141; + {$EXTERNALSYM CMS_R_TYPE_NOT_COMPRESSED_DATA} + CMS_R_TYPE_NOT_COMPRESSED_DATA = 142; + {$EXTERNALSYM CMS_R_TYPE_NOT_DATA} + CMS_R_TYPE_NOT_DATA = 143; + {$EXTERNALSYM CMS_R_TYPE_NOT_DIGESTED_DATA} + CMS_R_TYPE_NOT_DIGESTED_DATA = 144; + {$EXTERNALSYM CMS_R_TYPE_NOT_ENCRYPTED_DATA} + CMS_R_TYPE_NOT_ENCRYPTED_DATA = 145; + {$EXTERNALSYM CMS_R_TYPE_NOT_ENVELOPED_DATA} + CMS_R_TYPE_NOT_ENVELOPED_DATA = 146; + {$EXTERNALSYM CMS_R_UNABLE_TO_FINALIZE_CONTEXT} + CMS_R_UNABLE_TO_FINALIZE_CONTEXT = 147; + {$EXTERNALSYM CMS_R_UNKNOWN_CIPHER} + CMS_R_UNKNOWN_CIPHER = 148; + {$EXTERNALSYM CMS_R_UNKNOWN_DIGEST_ALGORIHM} + CMS_R_UNKNOWN_DIGEST_ALGORIHM = 149; + {$EXTERNALSYM CMS_R_UNKNOWN_ID} + CMS_R_UNKNOWN_ID = 150; + {$EXTERNALSYM CMS_R_UNSUPPORTED_COMPRESSION_ALGORITHM} + CMS_R_UNSUPPORTED_COMPRESSION_ALGORITHM = 151; + {$EXTERNALSYM CMS_R_UNSUPPORTED_CONTENT_TYPE} + CMS_R_UNSUPPORTED_CONTENT_TYPE = 152; + {$EXTERNALSYM CMS_R_UNSUPPORTED_KEK_ALGORITHM} + CMS_R_UNSUPPORTED_KEK_ALGORITHM = 153; + {$EXTERNALSYM CMS_R_UNSUPPORTED_RECIPIENT_TYPE} + CMS_R_UNSUPPORTED_RECIPIENT_TYPE = 154; + {$EXTERNALSYM CMS_R_UNSUPPORTED_RECPIENTINFO_TYPE} + CMS_R_UNSUPPORTED_RECPIENTINFO_TYPE = 155; + {$EXTERNALSYM CMS_R_UNSUPPORTED_TYPE} + CMS_R_UNSUPPORTED_TYPE = 156; + {$EXTERNALSYM CMS_R_UNWRAP_ERROR} + CMS_R_UNWRAP_ERROR = 157; + {$EXTERNALSYM CMS_R_VERIFICATION_FAILURE} + CMS_R_VERIFICATION_FAILURE = 158; + {$EXTERNALSYM CMS_R_WRAP_ERROR} + CMS_R_WRAP_ERROR = 159; + + {$ENDIF} + + {$EXTERNALSYM DSO_F_BEOS_BIND_FUNC} + DSO_F_BEOS_BIND_FUNC = 144; + {$EXTERNALSYM DSO_F_BEOS_BIND_VAR} + DSO_F_BEOS_BIND_VAR = 145; + {$EXTERNALSYM DSO_F_BEOS_LOAD} + DSO_F_BEOS_LOAD = 146; + {$EXTERNALSYM DSO_F_BEOS_NAME_CONVERTER} + DSO_F_BEOS_NAME_CONVERTER = 147; + {$EXTERNALSYM DSO_F_BEOS_UNLOAD} + DSO_F_BEOS_UNLOAD = 148; + {$EXTERNALSYM DSO_F_DLFCN_BIND_FUNC} + DSO_F_DLFCN_BIND_FUNC = 100; + {$EXTERNALSYM DSO_F_DLFCN_BIND_VAR} + DSO_F_DLFCN_BIND_VAR = 101; + {$EXTERNALSYM DSO_F_DLFCN_LOAD} + DSO_F_DLFCN_LOAD = 102; + {$EXTERNALSYM DSO_F_DLFCN_MERGER} + DSO_F_DLFCN_MERGER = 130; + {$EXTERNALSYM DSO_F_DLFCN_NAME_CONVERTER} + DSO_F_DLFCN_NAME_CONVERTER = 123; + {$EXTERNALSYM DSO_F_DLFCN_UNLOAD} + DSO_F_DLFCN_UNLOAD = 103; + {$EXTERNALSYM DSO_F_DL_BIND_FUNC} + DSO_F_DL_BIND_FUNC = 104; + {$EXTERNALSYM DSO_F_DL_BIND_VAR} + DSO_F_DL_BIND_VAR = 105; + {$EXTERNALSYM DSO_F_DL_LOAD} + DSO_F_DL_LOAD = 106; + {$EXTERNALSYM DSO_F_DL_MERGER} + DSO_F_DL_MERGER = 131; + {$EXTERNALSYM DSO_F_DL_NAME_CONVERTER} + DSO_F_DL_NAME_CONVERTER = 124; + {$EXTERNALSYM DSO_F_DL_UNLOAD} + DSO_F_DL_UNLOAD = 107; + {$EXTERNALSYM DSO_F_DSO_BIND_FUNC} + DSO_F_DSO_BIND_FUNC = 108; + {$EXTERNALSYM DSO_F_DSO_BIND_VAR} + DSO_F_DSO_BIND_VAR = 109; + {$EXTERNALSYM DSO_F_DSO_CONVERT_FILENAME} + DSO_F_DSO_CONVERT_FILENAME = 126; + {$EXTERNALSYM DSO_F_DSO_CTRL} + DSO_F_DSO_CTRL = 110; + {$EXTERNALSYM DSO_F_DSO_FREE} + DSO_F_DSO_FREE = 111; + {$EXTERNALSYM DSO_F_DSO_GET_FILENAME} + DSO_F_DSO_GET_FILENAME = 127; + {$EXTERNALSYM DSO_F_DSO_GET_LOADED_FILENAME} + DSO_F_DSO_GET_LOADED_FILENAME = 128; + {$EXTERNALSYM DSO_F_DSO_GLOBAL_LOOKUP} + DSO_F_DSO_GLOBAL_LOOKUP = 139; + {$EXTERNALSYM DSO_F_DSO_LOAD} + DSO_F_DSO_LOAD = 112; + {$EXTERNALSYM DSO_F_DSO_MERGE} + DSO_F_DSO_MERGE = 132; + {$EXTERNALSYM DSO_F_DSO_NEW_METHOD} + DSO_F_DSO_NEW_METHOD = 113; + {$EXTERNALSYM DSO_F_DSO_PATHBYADDR} + DSO_F_DSO_PATHBYADDR = 140; + {$EXTERNALSYM DSO_F_DSO_SET_FILENAME} + DSO_F_DSO_SET_FILENAME = 129; + {$EXTERNALSYM DSO_F_DSO_SET_NAME_CONVERTER} + DSO_F_DSO_SET_NAME_CONVERTER = 122; + {$EXTERNALSYM DSO_F_DSO_UP_REF} + DSO_F_DSO_UP_REF = 114; + {$EXTERNALSYM DSO_F_GLOBAL_LOOKUP_FUNC} + DSO_F_GLOBAL_LOOKUP_FUNC = 138; + {$EXTERNALSYM DSO_F_PATHBYADDR} + DSO_F_PATHBYADDR = 137; + {$EXTERNALSYM DSO_F_VMS_BIND_SYM} + DSO_F_VMS_BIND_SYM = 115; + {$EXTERNALSYM DSO_F_VMS_LOAD} + DSO_F_VMS_LOAD = 116; + {$EXTERNALSYM DSO_F_VMS_MERGER} + DSO_F_VMS_MERGER = 133; + {$EXTERNALSYM DSO_F_VMS_UNLOAD} + DSO_F_VMS_UNLOAD = 117; + {$EXTERNALSYM DSO_F_WIN32_BIND_FUNC} + DSO_F_WIN32_BIND_FUNC = 118; + {$EXTERNALSYM DSO_F_WIN32_BIND_VAR} + DSO_F_WIN32_BIND_VAR = 119; + {$EXTERNALSYM DSO_F_WIN32_GLOBALLOOKUP} + DSO_F_WIN32_GLOBALLOOKUP = 142; + {$EXTERNALSYM DSO_F_WIN32_GLOBALLOOKUP_FUNC} + DSO_F_WIN32_GLOBALLOOKUP_FUNC = 143; + {$EXTERNALSYM DSO_F_WIN32_JOINER} + DSO_F_WIN32_JOINER = 135; + {$EXTERNALSYM DSO_F_WIN32_LOAD} + DSO_F_WIN32_LOAD = 120; + {$EXTERNALSYM DSO_F_WIN32_MERGER} + DSO_F_WIN32_MERGER = 134; + {$EXTERNALSYM DSO_F_WIN32_NAME_CONVERTER} + DSO_F_WIN32_NAME_CONVERTER = 125; + {$EXTERNALSYM DSO_F_WIN32_PATHBYADDR} + DSO_F_WIN32_PATHBYADDR = 141; + {$EXTERNALSYM DSO_F_WIN32_SPLITTER} + DSO_F_WIN32_SPLITTER = 136; + {$EXTERNALSYM DSO_F_WIN32_UNLOAD} + DSO_F_WIN32_UNLOAD = 121; + +//* Reason codes. */ + {$EXTERNALSYM DSO_R_CTRL_FAILED} + DSO_R_CTRL_FAILED = 100; + {$EXTERNALSYM DSO_R_DSO_ALREADY_LOADED} + DSO_R_DSO_ALREADY_LOADED = 110; + {$EXTERNALSYM DSO_R_EMPTY_FILE_STRUCTURE} + DSO_R_EMPTY_FILE_STRUCTURE = 113; + {$EXTERNALSYM DSO_R_FAILURE} + DSO_R_FAILURE = 114; + {$EXTERNALSYM DSO_R_FILENAME_TOO_BIG} + DSO_R_FILENAME_TOO_BIG = 101; + {$EXTERNALSYM DSO_R_FINISH_FAILED} + DSO_R_FINISH_FAILED = 102; + {$EXTERNALSYM DSO_R_INCORRECT_FILE_SYNTAX} + DSO_R_INCORRECT_FILE_SYNTAX = 115; + {$EXTERNALSYM DSO_R_LOAD_FAILED} + DSO_R_LOAD_FAILED = 103; + {$EXTERNALSYM DSO_R_NAME_TRANSLATION_FAILED} + DSO_R_NAME_TRANSLATION_FAILED = 109; + {$EXTERNALSYM DSO_R_NO_FILENAME} + DSO_R_NO_FILENAME = 111; + {$EXTERNALSYM DSO_R_NO_FILE_SPECIFICATION} + DSO_R_NO_FILE_SPECIFICATION = 116; + {$EXTERNALSYM DSO_R_NULL_HANDLE} + DSO_R_NULL_HANDLE = 104; + {$EXTERNALSYM DSO_R_SET_FILENAME_FAILED} + DSO_R_SET_FILENAME_FAILED = 112; + {$EXTERNALSYM DSO_R_STACK_ERROR} + DSO_R_STACK_ERROR = 105; + {$EXTERNALSYM DSO_R_SYM_FAILURE} + DSO_R_SYM_FAILURE = 106; + {$EXTERNALSYM DSO_R_UNLOAD_FAILED} + DSO_R_UNLOAD_FAILED = 107; + {$EXTERNALSYM DSO_R_UNSUPPORTED} + DSO_R_UNSUPPORTED = 108; + + {$ifndef OPENSSL_NO_SRP} + {$EXTERNALSYM SRP_NO_ERROR} + + SRP_NO_ERROR = 0; + {$EXTERNALSYM SRP_ERR_VBASE_INCOMPLETE_FILE} + SRP_ERR_VBASE_INCOMPLETE_FILE = 1; + {$EXTERNALSYM SRP_ERR_VBASE_BN_LIB} + SRP_ERR_VBASE_BN_LIB = 2; + {$EXTERNALSYM SRP_ERR_OPEN_FILE} + SRP_ERR_OPEN_FILE = 3; + {$EXTERNALSYM SRP_ERR_MEMORY} + SRP_ERR_MEMORY = 4; + + {$EXTERNALSYM DB_srptype} + DB_srptype = 0; + {$EXTERNALSYM DB_srpverifier} + DB_srpverifier = 1; + {$EXTERNALSYM DB_srpsalt} + DB_srpsalt = 2; + {$EXTERNALSYM DB_srpid} + DB_srpid = 3; + {$EXTERNALSYM DB_srpgN} + DB_srpgN = 4; + {$EXTERNALSYM DB_srpinfo} + DB_srpinfo = 5; + {$NODEFINE DB_NUMBER} + DB_NUMBER = 6; + {$EXTERNALSYM DB_SRP_INDEX} + DB_SRP_INDEX = 'I'; + {$EXTERNALSYM DB_SRP_VALID} + DB_SRP_VALID = 'V'; + {$EXTERNALSYM DB_SRP_REVOKED} + DB_SRP_REVOKED = 'R'; + {$EXTERNALSYM DB_SRP_MODIF} + DB_SRP_MODIF = 'v'; + {$ENDIF} + {$EXTERNALSYM SRTP_AES128_CM_SHA1_80} + SRTP_AES128_CM_SHA1_80 = $0001; + {$EXTERNALSYM SRTP_AES128_CM_SHA1_32} + SRTP_AES128_CM_SHA1_32 = $0002; + {$EXTERNALSYM SRTP_AES128_F8_SHA1_80} + SRTP_AES128_F8_SHA1_80 = $0003; + {$EXTERNALSYM SRTP_AES128_F8_SHA1_32} + SRTP_AES128_F8_SHA1_32 = $0004; + {$EXTERNALSYM SRTP_NULL_SHA1_80} + SRTP_NULL_SHA1_80 = $0005; + {$EXTERNALSYM SRTP_NULL_SHA1_32} + SRTP_NULL_SHA1_32 = $0006; + + _ATEXIT_SIZE = 32; + {$EXTERNALSYM _ATEXIT_SIZE} + _IOFBF = 0; + {$EXTERNALSYM _IOFBF} + _IOLBF = 1; + {$EXTERNALSYM _IOLBF} + _IONBF = 2; + {$EXTERNALSYM _IONBF} + _N_LISTS = 30; + {$EXTERNALSYM _N_LISTS} + _MSS_WIN32 = 1; + {$EXTERNALSYM _MSS_WIN32} + _MSS_X86_ = 1; + {$EXTERNALSYM _MSS_X86_} + __CYGWIN32__ = 1; + {$EXTERNALSYM __CYGWIN32__} + __CYGWIN__ = 1; + {$EXTERNALSYM __CYGWIN__} + __GNUC_MINOR__ = 91; + {$EXTERNALSYM __GNUC_MINOR__} + __GNUC__ = 2; + {$EXTERNALSYM __GNUC__} + __SAPP = $0100; + {$EXTERNALSYM __SAPP } + __SEOF = $0020; + {$EXTERNALSYM __SEOF } + __SERR = $0040; + {$EXTERNALSYM __SERR } + __SLBF = $0001; + {$EXTERNALSYM __SLBF } + __SMBF = $0080; + {$EXTERNALSYM __SMBF } + __SMOD = $2000; + {$EXTERNALSYM __SMOD } + __SNBF = $0002; + {$EXTERNALSYM __SNBF } + __SNPT = $0800; + {$EXTERNALSYM __SNPT } + __SOFF = $1000; + {$EXTERNALSYM __SOFF } + __SOPT = $0400; + {$EXTERNALSYM __SOPT } + __SRD = $0004; + {$EXTERNALSYM __SRD } + __SRW = $0010; + {$EXTERNALSYM __SRW } + __SSTR = $0200; + {$EXTERNALSYM __SSTR } + __STDC__ = 1; + {$EXTERNALSYM __STDC__} + __SWR = $0008; + {$EXTERNALSYM __SWR } + __WINNT = 1; + {$EXTERNALSYM __WINNT} + __WINNT__ = 1; + {$EXTERNALSYM __WINNT__} + __i386 = 1; + {$EXTERNALSYM __i386} + __i386__ = 1; + {$EXTERNALSYM __i386__} + __i586 = 1; + {$EXTERNALSYM __i586} + __i586__ = 1; + {$EXTERNALSYM __i586__} + __pentium = 1; + {$EXTERNALSYM __pentium} + __pentium__ = 1; + {$EXTERNALSYM __pentium__} + i386 = 1; + {$EXTERNALSYM i386} + i586 = 1; + {$EXTERNALSYM i586} + pentium = 1; + {$EXTERNALSYM pentium} +//kssl.h +{$IFNDEF OPENSSL_NO_KRB5} +{These are consts for Kerberos support. These will not be complete because +FreePascal, Borland Delphi, and Indy don't support Kerberos. These are here +as place holders so we get an exact OpenSSL API if Kerberos support was compiled +in. +} + {$EXTERNALSYM KSSL_ERR_MAX} + KSSL_ERR_MAX = 255; + {$EXTERNALSYM KSSL_CLIENT} + KSSL_CLIENT = 1; + {$EXTERNALSYM KSSL_SERVER} + KSSL_SERVER = 2; + {$EXTERNALSYM KSSL_SERVICE} + KSSL_SERVICE = 3; + {$EXTERNALSYM KSSL_KEYTAB} + KSSL_KEYTAB = 4; + {$EXTERNALSYM KSSL_CTX_OK} + KSSL_CTX_OK = 0; + {$EXTERNALSYM KSSL_CTX_ERR} + KSSL_CTX_ERR = 1; + {$EXTERNALSYM KSSL_NOMEM} + KSSL_NOMEM = 2; +{$ENDIF} + +{Error - err.h } +const + {$EXTERNALSYM ERR_TXT_MALLOCED} + ERR_TXT_MALLOCED = $01; + {$EXTERNALSYM ERR_TXT_STRING} + ERR_TXT_STRING = $02; + {$EXTERNALSYM ERR_NUM_ERRORS} + ERR_NUM_ERRORS = 16; + +const + // library + {$EXTERNALSYM ERR_LIB_NONE} + ERR_LIB_NONE = 1; + {$EXTERNALSYM ERR_LIB_SYS} + ERR_LIB_SYS = 2; + {$EXTERNALSYM ERR_LIB_BN} + ERR_LIB_BN = 3; + {$EXTERNALSYM ERR_LIB_RSA} + ERR_LIB_RSA = 4; + {$EXTERNALSYM ERR_LIB_DH} + ERR_LIB_DH = 5; + {$EXTERNALSYM ERR_LIB_EVP} + ERR_LIB_EVP = 6; + {$EXTERNALSYM ERR_LIB_BUF} + ERR_LIB_BUF = 7; + {$EXTERNALSYM ERR_LIB_OBJ} + ERR_LIB_OBJ = 8; + {$EXTERNALSYM ERR_LIB_PEM} + ERR_LIB_PEM = 9; + {$EXTERNALSYM ERR_LIB_DSA} + ERR_LIB_DSA = 10; + {$EXTERNALSYM ERR_LIB_X509} + ERR_LIB_X509 = 11; +// ERR_LIB_METH = 12; + {$EXTERNALSYM ERR_LIB_ASN1} + ERR_LIB_ASN1 = 13; + {$EXTERNALSYM ERR_LIB_CONF} + ERR_LIB_CONF = 14; + {$EXTERNALSYM ERR_LIB_CRYPTO} + ERR_LIB_CRYPTO = 15; + {$EXTERNALSYM ERR_LIB_EC} + ERR_LIB_EC = 16; + {$EXTERNALSYM ERR_LIB_SSL} + ERR_LIB_SSL = 20; +// ERR_LIB_SSL23 = 21; +// ERR_LIB_SSL2 = 22; +// ERR_LIB_SSL3 = 23; +// ERR_LIB_RSAREF = 30; +// ERR_LIB_PROXY = 31; + {$EXTERNALSYM ERR_LIB_BIO} + ERR_LIB_BIO = 32; + {$EXTERNALSYM ERR_LIB_PKCS7} + ERR_LIB_PKCS7 = 33; + {$EXTERNALSYM ERR_LIB_X509V3} + ERR_LIB_X509V3 = 34; + {$EXTERNALSYM ERR_LIB_PKCS12} + ERR_LIB_PKCS12 = 35; + {$EXTERNALSYM ERR_LIB_RAND} + ERR_LIB_RAND = 36; + {$EXTERNALSYM ERR_LIB_DSO} + ERR_LIB_DSO = 37; + {$EXTERNALSYM ERR_LIB_ENGINE} + ERR_LIB_ENGINE = 38; + {$EXTERNALSYM ERR_LIB_OCSP} + ERR_LIB_OCSP = 39; + {$EXTERNALSYM ERR_LIB_UI} + ERR_LIB_UI = 40; + {$EXTERNALSYM ERR_LIB_COMP} + ERR_LIB_COMP = 41; + {$EXTERNALSYM ERR_LIB_ECDSA} + ERR_LIB_ECDSA = 42; + {$EXTERNALSYM ERR_LIB_ECDH} + ERR_LIB_ECDH = 43; + {$EXTERNALSYM ERR_LIB_STORE} + ERR_LIB_STORE = 44; + {$EXTERNALSYM ERR_LIB_FIPS} + ERR_LIB_FIPS = 45; + {$EXTERNALSYM ERR_LIB_CMS} + ERR_LIB_CMS = 46; + {$EXTERNALSYM ERR_LIB_TS} + ERR_LIB_TS = 47; + {$EXTERNALSYM ERR_LIB_HMAC} + ERR_LIB_HMAC = 48; + {$EXTERNALSYM ERR_LIB_JPAKE} + //OpenSSL 0.9.8n was 47 + ERR_LIB_JPAKE = 49; +//* fatal error */ + {$EXTERNALSYM ERR_R_FATAL} + ERR_R_FATAL = 64; +//was ERR_R_FATAL = 32; + {$EXTERNALSYM ERR_R_MALLOC_FAILURE} + ERR_R_MALLOC_FAILURE = (1 or ERR_R_FATAL); + {$EXTERNALSYM ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED} + ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED = (2 or ERR_R_FATAL); + {$EXTERNALSYM ERR_R_PASSED_NULL_PARAMETER} + ERR_R_PASSED_NULL_PARAMETER = (3 or ERR_R_FATAL); + {$EXTERNALSYM ERR_R_INTERNAL_ERROR} + ERR_R_INTERNAL_ERROR = (4 or ERR_R_FATAL); + {$EXTERNALSYM ERR_R_DISABLED} + ERR_R_DISABLED = (5 or ERR_R_FATAL); + {$EXTERNALSYM ERR_LIB_USER} + ERR_LIB_USER = 128; + // OS functions + {$EXTERNALSYM SYS_F_FOPEN} + SYS_F_FOPEN = 1; + {$EXTERNALSYM SYS_F_CONNECT} + SYS_F_CONNECT = 2; + {$EXTERNALSYM SYS_F_GETSERVBYNAME} + SYS_F_GETSERVBYNAME = 3; + {$EXTERNALSYM SYS_F_SOCKET} + SYS_F_SOCKET = 4; + {$EXTERNALSYM SYS_F_IOCTLSOCKET} + SYS_F_IOCTLSOCKET = 5; + {$EXTERNALSYM SYS_F_BIND} + SYS_F_BIND = 6; + {$EXTERNALSYM SYS_F_LISTEN} + SYS_F_LISTEN = 7; + {$EXTERNALSYM SYS_F_ACCEPT} + SYS_F_ACCEPT = 8; + {$EXTERNALSYM SYS_F_WSASTARTUP} + SYS_F_WSASTARTUP = 9; { Winsock stuff } + {$EXTERNALSYM SYS_F_OPENDIR} + SYS_F_OPENDIR = 10; + {$EXTERNALSYM SYS_F_FREAD} + SYS_F_FREAD = 11; +//* These are the possible flags. They can be or'ed together. */ +//* Use to have echoing of input */ + {$EXTERNALSYM UI_INPUT_FLAG_ECHO} + UI_INPUT_FLAG_ECHO = $01; +///* Use a default password. Where that password is found is completely +// up to the application, it might for example be in the user data set +// with UI_add_user_data(). It is not recommended to have more than +// one input in each UI being marked with this flag, or the application +// might get confused. */ + {$EXTERNALSYM UI_INPUT_FLAG_DEFAULT_PWD} + UI_INPUT_FLAG_DEFAULT_PWD = $02; + +//* The user of these routines may want to define flags of their own. The core +// UI won't look at those, but will pass them on to the method routines. They +// must use higher bits so they don't get confused with the UI bits above. +// UI_INPUT_FLAG_USER_BASE tells which is the lowest bit to use. A good +// example of use is this: + +// #define MY_UI_FLAG1 (0x01 << UI_INPUT_FLAG_USER_BASE) +//*/ + {$EXTERNALSYM UI_INPUT_FLAG_USER_BASE} + UI_INPUT_FLAG_USER_BASE = 16; + //IO_ctrl commands +//* The commands */ +//* Use UI_CONTROL_PRINT_ERRORS with the value 1 to have UI_process print the +// OpenSSL error stack before printing any info or added error messages and +// before any prompting. */ + {$EXTERNALSYM UI_CTRL_PRINT_ERRORS} + UI_CTRL_PRINT_ERRORS = 1; +//* Check if a UI_process() is possible to do again with the same instance of +// a user interface. This makes UI_ctrl() return 1 if it is redoable, and 0 +// if not. */ + {$EXTERNALSYM UI_CTRL_IS_REDOABLE} + UI_CTRL_IS_REDOABLE = 2; +//* Function codes. */ + {$EXTERNALSYM UI_F_GENERAL_ALLOCATE_BOOLEAN} + UI_F_GENERAL_ALLOCATE_BOOLEAN = 108; + {$EXTERNALSYM UI_F_GENERAL_ALLOCATE_PROMPT} + UI_F_GENERAL_ALLOCATE_PROMPT = 109; + {$EXTERNALSYM UI_F_GENERAL_ALLOCATE_STRING} + UI_F_GENERAL_ALLOCATE_STRING = 100; + {$EXTERNALSYM UI_F_UI_CTRL} + UI_F_UI_CTRL = 111; + {$EXTERNALSYM UI_F_UI_DUP_ERROR_STRING} + UI_F_UI_DUP_ERROR_STRING = 101; + {$EXTERNALSYM UI_F_UI_DUP_INFO_STRING} + UI_F_UI_DUP_INFO_STRING = 102; + {$EXTERNALSYM UI_F_UI_DUP_INPUT_BOOLEAN} + UI_F_UI_DUP_INPUT_BOOLEAN = 110; + {$EXTERNALSYM UI_F_UI_DUP_INPUT_STRING} + UI_F_UI_DUP_INPUT_STRING = 103; + {$EXTERNALSYM UI_F_UI_DUP_VERIFY_STRING} + UI_F_UI_DUP_VERIFY_STRING = 106; + {$EXTERNALSYM UI_F_UI_GET0_RESULT} + UI_F_UI_GET0_RESULT = 107; + {$EXTERNALSYM UI_F_UI_NEW_METHOD} + UI_F_UI_NEW_METHOD = 104; + {$EXTERNALSYM UI_F_UI_SET_RESULT} + UI_F_UI_SET_RESULT = 105; +//* Reason codes. */ + {$EXTERNALSYM UI_R_COMMON_OK_AND_CANCEL_CHARACTERS} + UI_R_COMMON_OK_AND_CANCEL_CHARACTERS = 104; + {$EXTERNALSYM UI_R_INDEX_TOO_LARGE} + UI_R_INDEX_TOO_LARGE = 102; + {$EXTERNALSYM UI_R_INDEX_TOO_SMALL} + UI_R_INDEX_TOO_SMALL = 103; + {$EXTERNALSYM UI_R_NO_RESULT_BUFFER} + UI_R_NO_RESULT_BUFFER = 105; + {$EXTERNALSYM UI_R_RESULT_TOO_LARGE} + UI_R_RESULT_TOO_LARGE = 100; + {$EXTERNALSYM UI_R_RESULT_TOO_SMALL} + UI_R_RESULT_TOO_SMALL = 101; + {$EXTERNALSYM UI_R_UNKNOWN_CONTROL_COMMAND} + UI_R_UNKNOWN_CONTROL_COMMAND = 106; + +const + // reasons + {$EXTERNALSYM ERR_R_SYS_LIB} + ERR_R_SYS_LIB = ERR_LIB_SYS; + {$EXTERNALSYM ERR_R_BN_LIB} + ERR_R_BN_LIB = ERR_LIB_BN; + {$EXTERNALSYM ERR_R_RSA_LIB} + ERR_R_RSA_LIB = ERR_LIB_RSA; + {$EXTERNALSYM ERR_R_DH_LIB} + ERR_R_DH_LIB = ERR_LIB_DH; + {$EXTERNALSYM ERR_R_EVP_LIB} + ERR_R_EVP_LIB = ERR_LIB_EVP; + {$EXTERNALSYM ERR_R_BUF_LIB} + ERR_R_BUF_LIB = ERR_LIB_BUF; + {$EXTERNALSYM ERR_R_OBJ_LIB} + ERR_R_OBJ_LIB = ERR_LIB_OBJ; + {$EXTERNALSYM ERR_R_PEM_LIB} + ERR_R_PEM_LIB = ERR_LIB_PEM; + {$EXTERNALSYM ERR_R_DSA_LIB} + ERR_R_DSA_LIB = ERR_LIB_DSA; + {$EXTERNALSYM ERR_R_X509_LIB} + ERR_R_X509_LIB = ERR_LIB_X509; + {$EXTERNALSYM ERR_R_ASN1_LIB} + ERR_R_ASN1_LIB = ERR_LIB_ASN1; + {$EXTERNALSYM ERR_R_CONF_LIB} + ERR_R_CONF_LIB = ERR_LIB_CONF; + {$EXTERNALSYM ERR_R_CRYPTO_LIB} + ERR_R_CRYPTO_LIB = ERR_LIB_CRYPTO; + {$EXTERNALSYM ERR_R_EC_LIB} + ERR_R_EC_LIB = ERR_LIB_EC; + {$EXTERNALSYM ERR_R_SSL_LIB} + ERR_R_SSL_LIB = ERR_LIB_SSL; + {$EXTERNALSYM ERR_R_BIO_LIB} + ERR_R_BIO_LIB = ERR_LIB_BIO; + {$EXTERNALSYM ERR_R_PKCS7_LIB} + ERR_R_PKCS7_LIB = ERR_LIB_PKCS7; + {$EXTERNALSYM ERR_R_X509V3_LIB} + ERR_R_X509V3_LIB = ERR_LIB_X509V3; + {$EXTERNALSYM ERR_R_PKCS12_LIB} + ERR_R_PKCS12_LIB = ERR_LIB_PKCS12; + {$EXTERNALSYM ERR_R_RAND_LIB} + ERR_R_RAND_LIB = ERR_LIB_RAND; + {$EXTERNALSYM ERR_R_DSO_LIB} + ERR_R_DSO_LIB = ERR_LIB_DSO; + {$EXTERNALSYM ERR_R_ENGINE_LIB} + ERR_R_ENGINE_LIB = ERR_LIB_ENGINE; + {$EXTERNALSYM ERR_R_OCSP_LIB} + ERR_R_OCSP_LIB = ERR_LIB_OCSP; + {$EXTERNALSYM ERR_R_UI_LIB} + ERR_R_UI_LIB = ERR_LIB_UI; + {$EXTERNALSYM ERR_R_COMP_LIB} + ERR_R_COMP_LIB = ERR_LIB_COMP; + {$EXTERNALSYM ERR_R_ECDSA_LIB} + ERR_R_ECDSA_LIB = ERR_LIB_ECDSA; + {$EXTERNALSYM ERR_R_ECDH_LIB} + ERR_R_ECDH_LIB = ERR_LIB_ECDH; + {$EXTERNALSYM ERR_R_STORE_LIB} + ERR_R_STORE_LIB = ERR_LIB_STORE; + {$EXTERNALSYM ERR_R_TS_LIB} + ERR_R_TS_LIB = ERR_LIB_TS; //* 45 */ + {$EXTERNALSYM ERR_R_NESTED_ASN1_ERROR} + ERR_R_NESTED_ASN1_ERROR = 58; + {$EXTERNALSYM ERR_R_BAD_ASN1_OBJECT_HEADER} + ERR_R_BAD_ASN1_OBJECT_HEADER = 59; + {$EXTERNALSYM ERR_R_BAD_GET_ASN1_OBJECT_CALL} + ERR_R_BAD_GET_ASN1_OBJECT_CALL = 60; + {$EXTERNALSYM ERR_R_EXPECTING_AN_ASN1_SEQUENCE} + ERR_R_EXPECTING_AN_ASN1_SEQUENCE = 61; + {$EXTERNALSYM ERR_R_ASN1_LENGTH_MISMATCH} + ERR_R_ASN1_LENGTH_MISMATCH = 62; + {$EXTERNALSYM ERR_R_MISSING_ASN1_EOS} + ERR_R_MISSING_ASN1_EOS = 63; + {$EXTERNALSYM DTLS1_VERSION} + DTLS1_VERSION = $FEFF; + {$EXTERNALSYM DTLS1_BAD_VER} + DTLS1_BAD_VER = $0100; +{$IFNDEF USE_THIS} +//* this alert description is not specified anywhere... */ + {$EXTERNALSYM DTLS1_AD_MISSING_HANDSHAKE_MESSAGE} + DTLS1_AD_MISSING_HANDSHAKE_MESSAGE = 110; +{$endif} + //was 32 + {$EXTERNALSYM DTLS1_COOKIE_LENGTH} + DTLS1_COOKIE_LENGTH = 256; + {$EXTERNALSYM DTLS1_RT_HEADER_LENGTH} + DTLS1_RT_HEADER_LENGTH = 13; + {$EXTERNALSYM DTLS1_HM_HEADER_LENGTH} + DTLS1_HM_HEADER_LENGTH = 12; + {$EXTERNALSYM DTLS1_HM_BAD_FRAGMENT} + DTLS1_HM_BAD_FRAGMENT = -2; + {$EXTERNALSYM DTLS1_HM_FRAGMENT_RETRY} + DTLS1_HM_FRAGMENT_RETRY = -3; + {$EXTERNALSYM DTLS1_CCS_HEADER_LENGTH} + //OpenSSL 0.9.8e defines this as OPENSSL_DTLS1_CCS_HEADER_LENGTH = 3; + DTLS1_CCS_HEADER_LENGTH = 1; + {$EXTERNALSYM DTLS1_AL_HEADER_LENGTH} +{$ifdef DTLS1_AD_MISSING_HANDSHAKE_MESSAGE} + DTLS1_AL_HEADER_LENGTH = 7; +{$else} + DTLS1_AL_HEADER_LENGTH = 2; +{$endif} + +type + {$EXTERNALSYM PPByte} + PPByte = ^PByte; + {$IFNDEF HAS_PPointer} + {$EXTERNALSYM PPointer} + PPointer = ^Pointer; + {$ENDIF} + +//This is just a synthasis since Pascal probably has what we need. +//In C, the OpenSSL developers were using the PQ_64BIT moniker +//to ensure that they had a value that is always 64bit. +//In Pascal, this is not a problem since Delphi and FreePascal have this in some form. + {$EXTERNALSYM PQ_64BIT} + PQ_64BIT = TIdC_UINT64; + +// RLebeau - the following value was conflicting with iphlpapi.h under C++Builder +// (and possibly other headers) so using the HPPEMIT further above as a workaround + {$EXTERNALSYM time_t} + time_t = TIdC_LONG; + {$EXTERNALSYM STACK} + STACK = record + num : TIdC_INT; //int num; + data : PIdAnsiChar; //char **data; + sorted : TIdC_INT;//int sorted; + num_alloc : TIdC_INT; //int num_alloc; + comp : function (_para1: PPIdAnsiChar; _para2: PPIdAnsiChar): TIdC_INT; cdecl; + //int (*comp)(const char * const *, const char * const *); + end; + {$EXTERNALSYM PSTACK} + PSTACK = ^STACK; + {$EXTERNALSYM PPSTACK} + PPSTACK = ^PSTACK; + {$EXTERNALSYM PSTACK_OF_POINTER} + PSTACK_OF_POINTER = Pointer; + {$NODEFINE PSSL} + PSSL = ^SSL; + //opensslconf.h + {$IFNDEF OPENSSL_NO_MD2} + {$EXTERNALSYM MD2_INT} + {$IFDEF MD2_CHAR} + MD2_INT = Char; + {$ELSE} + {$IFDEF MD2_LONG} + MD2_INT = TIdC_ULONG; + {$ELSE} + MD2_INT = TIdC_UINT; + {$ENDIF} + {$ENDIF} + {$ENDIF} + + {$IFNDEF OPENSSL_NO_RC1} + {$EXTERNALSYM RC2_INT} + {$IFDEF RC2_SHORT} + RC2_INT = TIdC_USHORT; + {$ELSE} + {$IFDEF RC2_LONG} + RC2_INT = TIdC_ULONG; + {$ELSE} + RC2_INT = TIdC_UINT; + {$ENDIF} + {$ENDIF} + {$ENDIF} + {$IFNDEF OPENSSL_NO_RC4} + {$EXTERNALSYM RC4_INT} + {$IFDEF RC4_CHAR} + RC4_INT = TIdC_USHORT; + {$ELSE} + {$IFDEF RC4_LONG} + RC4_INT = TIdC_ULONG; + {$ELSE} + RC4_INT = TIdC_UINT; + {$ENDIF} + {$ENDIF} + {$IFDEF RC4_CHUNK} + {$EXTERNALSYM RC4_CHUNK} + RC4_CHUNK = TIdC_ULONG; + {$ELSE} + {$IFDEF RC4_CHUNK_LL} + {$EXTERNALSYM RC4_CHUNK} + RC4_CHUNK = TIdC_ULONGLONG; + {$ELSE} + {$UNDEF RC4_CHUNK} + {$ENDIF} + {$ENDIF} + {$ENDIF} + {$IFNDEF OPENSSL_NO_IDEA} + {$EXTERNALSYM IDEA_INT} + {$IFDEF IDEA_SHORT} + IDEA_INT = TIdC_USHORT; + {$ELSE} + {$IFDEF IDEA_LONG} + IDEA_INT = TIdC_ULONG; + {$ELSE} + IDEA_INT = TIdC_UINT; + {$ENDIF} + {$ENDIF} + {$ENDIF} + //crypto.h + // OpenSSL 1.0.0 structure + ///* Don't use this structure directly. */ + {$EXTERNALSYM CRYPTO_THREADID} + CRYPTO_THREADID = record + ptr : Pointer; + val : TIdC_ULONG; + end; + {$EXTERNALSYM PCRYPTO_THREADID} + PCRYPTO_THREADID = ^CRYPTO_THREADID; + // end OpenSSL 1.0.0 structures + {$EXTERNALSYM OPENSSL_ITEM} + OPENSSL_ITEM = record + code : TIdC_INT; + value : Pointer; //* Not used for flag attributes */ + value_size : size_t; //* Max size of value for output, length for input */ + value_length : Psize_t; //* Returned length of value for output */ + end; + {$EXTERNALSYM CRYPTO_EX_DATA} + CRYPTO_EX_DATA = record + sk : PSTACK; + dummy : TIdC_INT; // gcc is screwing up this data structure :-( + end; + {$EXTERNALSYM PCRYPTO_EX_DATA} + PCRYPTO_EX_DATA = ^CRYPTO_EX_DATA; +{ +/* Some applications as well as some parts of OpenSSL need to allocate + and deallocate locks in a dynamic fashion. The following typedef + makes this possible in a type-safe manner. */ +/* struct CRYPTO_dynlock_value has to be defined by the application. */ +} + {$EXTERNALSYM PCRYPTO_dynlock_value} + PCRYPTO_dynlock_value = Pointer; + {$EXTERNALSYM CRYPTO_dynlock} + CRYPTO_dynlock = record + references : TIdC_INT; + data : PCRYPTO_dynlock_value; + end; + {$EXTERNALSYM PCRYPTO_dynlock} + PCRYPTO_dynlock = ^CRYPTO_dynlock; +//* Callback types for crypto.h */ +//typedef int CRYPTO_EX_new(void *parent, void *ptr, CRYPTO_EX_DATA *ad, +// int idx, long argl, void *argp); + {$EXTERNALSYM CRYPTO_EX_new} + CRYPTO_EX_new = function(parent : Pointer; ptr : Pointer; ad : CRYPTO_EX_DATA; + idx : TIdC_INT; arg1 : TIdC_LONG; argp : Pointer) : TIdC_INT; cdecl; +//typedef void CRYPTO_EX_free(void *parent, void *ptr, CRYPTO_EX_DATA *ad, +// int idx, long argl, void *argp); + {$EXTERNALSYM CRYPTO_EX_free} + CRYPTO_EX_free = procedure (parent : Pointer; ptr : Pointer; ad : CRYPTO_EX_DATA; + idx : TIdC_INT; arg1 : TIdC_LONG; argp : Pointer); cdecl; +//typedef int CRYPTO_EX_dup(CRYPTO_EX_DATA *to, CRYPTO_EX_DATA *from, void *from_d, +// int idx, long argl, void *argp); + {$EXTERNALSYM CRYPTO_EX_dup} + CRYPTO_EX_dup = function (_to : PCRYPTO_EX_DATA; from : PCRYPTO_EX_DATA; + from_d : Pointer; idx : TIdC_INT; arg1 : TIdC_LONG; argp : Pointer) : TIdC_INT; cdecl; + {$EXTERNALSYM CRYPTO_EX_DATA_FUNCS} + CRYPTO_EX_DATA_FUNCS = record + argl : TIdC_LONG; //* Arbitary long */ + argp : Pointer; //* Arbitary void * */ + new_func : CRYPTO_EX_new; + free_func : CRYPTO_EX_free; + dup_func : CRYPTO_EX_dup; + end; + {$IFDEF DEBUG_SAFESTACK} + {$EXTERNALSYM STACK_OF_CRYPTO_EX_DATA_FUNCS} + STACK_OF_CRYPTO_EX_DATA_FUNCS = record + stack: stack; + end; + {$EXTERNALSYM PSTACK_OF_CRYPTO_EX_DATA_FUNCS} + PSTACK_OF_CRYPTO_EX_DATA_FUNCS = ^STACK_OF_CRYPTO_EX_DATA_FUNCS; + {$ELSE} + //I think the DECLARE_STACK_OF macro is empty + {$EXTERNALSYM PSTACK_OF_CRYPTO_EX_DATA_FUNCS} + PSTACK_OF_CRYPTO_EX_DATA_FUNCS = PSTACK; + {$ENDIF} + ///* An opaque type representing an implementation of "ex_data" support */ + {$EXTERNALSYM PCRYPTO_EX_DATA_IMPL} + PCRYPTO_EX_DATA_IMPL = Pointer; + {$EXTERNALSYM ERR_string_data} + ERR_string_data = record + error : TIdC_ULONG; + _string : PIdAnsiChar; + end; + {$EXTERNALSYM PERR_string_data} + PERR_string_data = ^ERR_string_data; + {$EXTERNALSYM ERR_STATE} + ERR_STATE = record + tid : CRYPTO_THREADID; + // PID: TIdC_UINT; + err_flags : array [0..ERR_NUM_ERRORS - 1] of TIdC_INT; + err_buffer: array[0..ERR_NUM_ERRORS-1] of TIdC_UINT; + err_data : array [0..ERR_NUM_ERRORS -1] of PIdAnsiChar; + err_data_flags : array [0..ERR_NUM_ERRORS -1] of TIdC_INT; + err_file: array[0..ERR_NUM_ERRORS-1] of PIdAnsiChar; + err_line: array[0..ERR_NUM_ERRORS-1] of TIdC_INT; + top: TIdC_INT; + bottom: TIdC_INT; + end; // record + {$EXTERNALSYM TERR_STATE} + TERR_STATE = ERR_STATE; + {$EXTERNALSYM PERR_FNS} + PERR_FNS = Pointer; + //rand.h + {$IFDEF OPENSSL_FIPS} + {$EXTERNALSYM FIPS_RAND_SIZE_T} + FIPS_RAND_SIZE_T = TIdC_int; + {$ENDIF} + {$EXTERNALSYM RAND_METHOD} + RAND_METHOD = record + seed : procedure (const buf : Pointer; num : TIdC_INT) cdecl; + bytes : function(const buf : PIdAnsiChar; num : TIdC_INT) : TIdC_INT cdecl; + cleanup : procedure cdecl; + add : procedure (const buf : Pointer; num : TIdC_INT; entropy : TIdC_DOUBLE) cdecl; + pseudorand : function(buf : PIdAnsiChar; num : TIdC_INT) : TIdC_INT cdecl; + status : function : TIdC_INT cdecl; + end; + //bn.h + {$IFDEF SIXTY_FOUR_BIT_LONG} + {$EXTERNALSYM BN_ULLONG} + BN_ULLONG = TIdC_LONGLONG; + {$EXTERNALSYM BN_ULONG} + BN_ULONG = TIdC_ULONG; + {$EXTERNALSYM BN_LONG} + BN_LONG = TIdC_LONG; + {$ENDIF} + {$IFDEF SIXTY_FOUR_BIT} + {$EXTERNALSYM BN_ULLONG} + BN_ULLONG = TIdC_ULONGLONG; + {$EXTERNALSYM BN_LONG} + BN_LONG = TIdC_LONGLONG; + {$EXTERNALSYM BN_ULONG} + BN_ULONG = TIdC_ULONGLONG; + {$ENDIF} + {$IFDEF THIRTY_TWO_BIT} + {$EXTERNALSYM BN_ULLONG} + {$IFDEF BN_LLONG} + BN_ULLONG = TIdC_INT64; + {$ELSE} + BN_ULLONG = TIdC_ULONGLONG; + {$ENDIF} + {$EXTERNALSYM BN_LONG} + BN_LONG = TIdC_LONG; + {$EXTERNALSYM BN_ULONG} + BN_ULONG = TIdC_ULONG; + {$ENDIF} + {$EXTERNALSYM PBN_LONG} + PBN_LONG = ^BN_LONG; + {$EXTERNALSYM PBN_ULONG} + PBN_ULONG = ^BN_ULONG; + {$EXTERNALSYM BIGNUM} + BIGNUM = record + d : PBN_ULONG; // Pointer to an array of 'BN_BITS2' bit chunks. + top : TIdC_INT; // Index of last used d +1. + // The next are internal book keeping for bn_expand. + dmax : TIdC_INT; // Size of the d array. + neg : TIdC_INT; // one if the number is negative + flags : TIdC_INT; + end; + {$EXTERNALSYM PBIGNUM} + PBIGNUM = ^BIGNUM; + // BN_CTX = record + //This is defined internally. I don't want to do anything with an internal structure. + // end; + {$EXTERNALSYM PBN_CTX} + PBN_CTX = Pointer;//^BN_CTX; + {$EXTERNALSYM PPBN_CTX} + PPBN_CTX = ^PBN_CTX; + // Used for montgomery multiplication + {$EXTERNALSYM BN_MONT_CTX} + BN_MONT_CTX = record + ri : TIdC_INT; // number of bits in R + RR : BIGNUM; // used to convert to montgomery form + N : BIGNUM; // The modulus + Ni : BIGNUM; // R*(1/R mod N) - N*Ni = 1 + // (Ni is only stored for bignum algorithm) +{#if 0 + /* OpenSSL 0.9.9 preview: */ + BN_ULONG n0[2];/* least significant word(s) of Ni */ +#else + BN_ULONG n0; /* least significant word of Ni */ +#endif} + {$IFNDEF USE_THIS} + //* OpenSSL 0.9.9 preview: */ + n0 : array [0..1] of BN_ULONG; + {$ELSE} + n0 : BN_ULONG; // least significant word of Ni + {$ENDIF} + flags : TIdC_INT; + end; + {$EXTERNALSYM PBN_MONT_CTX} + PBN_MONT_CTX = ^BN_MONT_CTX; +// BN_BLINDING = record + //I can't locate any information about the record fields in this. +// end; + {$EXTERNALSYM PBN_BLINDING} + PBN_BLINDING = pointer;//^BN_BLINDING; + {$EXTERNALSYM BN_RECP_CTX} + BN_RECP_CTX = record + N : BIGNUM; // the divisor + Nr : BIGNUM; // the reciprocal + num_bits : TIdC_INT; + shift : TIdC_INT; + flags : TIdC_INT; + end; + {$EXTERNALSYM PBN_RECP_CTX} + PBN_RECP_CTX = ^BN_RECP_CTX; + {$EXTERNALSYM PBN_GENCB} + PBN_GENCB = ^BN_GENCB; + {$EXTERNALSYM PPBN_GENCB} + PPBN_GENCB = ^PBN_GENCB; + {$EXTERNALSYM BN_cb_1} + BN_cb_1 = procedure (p1, p2 : TIdC_INT; p3 : Pointer); cdecl; + {$EXTERNALSYM BN_cb_2} + BN_cb_2 = function (p1, p2 : TIdC_INT; p3 : PBN_GENCB): TIdC_INT; cdecl; + {$EXTERNALSYM BN_GENCB_union} + BN_GENCB_union = record + case Integer of + // if(ver==1) - handles old style callbacks + 0 : (cb_1 : BN_cb_1); + // if(ver==2) - new callback style + 1 : (cb_2 : BN_cb_2); + end; + {$EXTERNALSYM BN_GENCB} + BN_GENCB = record + ver : TIdC_UINT; // To handle binary (in)compatibility + arg : Pointer; // callback-specific data + cb : BN_GENCB_union; + end; + //aes.h + + //seed.h + + //chamellia.h + {$IFNDEF OPENSSL_NO_CAMELLIA} + {$EXTERNALSYM KEY_TABLE_TYPE} + KEY_TABLE_TYPE = array [0..(CAMELLIA_TABLE_WORD_LEN - 1)] of TIdC_UINT; //* to match with WORD */ + {$EXTERNALSYM CAMELLIA_KEY_union} + CAMELLIA_KEY_union = record + case byte of + 0 : (d : TIdC_DOUBLE); //* ensures 64-bit align */ + 1 : (rd_key : KEY_TABLE_TYPE); + end; + {$EXTERNALSYM CAMELLIA_KEY} + CAMELLIA_KEY = record + u : CAMELLIA_KEY_union; + grand_rounds : TIdC_INT; + end; + {$EXTERNALSYM PCAMELLIA_KEY} + PCAMELLIA_KEY = ^CAMELLIA_KEY; + {$ENDIF} + //whrlpool.h + {$EXTERNALSYM WHIRLPOOL_CTX_union} + WHIRLPOOL_CTX_union = record + case byte of + 0 : (c : array [0..WHIRLPOOL_DIGEST_LENGTH - 1] of byte ); + 1 : (q : array [0..(WHIRLPOOL_DIGEST_LENGTH div SizeOf(TIdC_DOUBLE))-1 ] of TIdC_DOUBLE); + end; + {$EXTERNALSYM WHIRLPOOL_CTX} + WHIRLPOOL_CTX = record + H : WHIRLPOOL_CTX_union; + data : array [0..(WHIRLPOOL_BBLOCK div 8)-1] of byte; + bitoff : TIdC_INT; + bitlen : array[0..(WHIRLPOOL_COUNTER div sizeof(size_t))-1] of size_t; + end; + {$EXTERNALSYM PWHIRLPOOL_CTX} + PWHIRLPOOL_CTX = ^WHIRLPOOL_CTX; + + //md2.h + {$IFNDEF OPENSSL_NO_MD2} + {$EXTERNALSYM MD2_CTX} + MD2_CTX = record + num : TIdC_UINT; + data : array [0..MD2_BLOCK - 1] of TIdAnsiChar; + cksm : array [0..MD2_BLOCK - 1] of MD2_INT; + state : array[0..MD2_BLOCK -1] of MD2_INT; + end; + {$EXTERNALSYM PMD2_CTX} + PMD2_CTX = ^MD2_CTX; + {$ENDIF} + //md4.h + {$IFNDEF OPENSSL_NO_MD4} + {$EXTERNALSYM MD4_LONG} + MD4_LONG = TIdC_ULONG; + {$EXTERNALSYM MD4_CTX} + MD4_CTX = record + A,B,C,D : MD4_LONG; + Nl,Nh : MD4_LONG; + data : array [0..(MD4_LBLOCK-1)] of MD4_LONG; + num : TIdC_UINT; + end; + {$EXTERNALSYM PMD4_CTX} + PMD4_CTX = ^MD4_CTX; + {$ENDIF} + //md5.h + {$EXTERNALSYM MD5_LONG} + MD5_LONG = TIdC_UINT; + {$EXTERNALSYM MD5_CTX} + MD5_CTX = record + A,B,C,D : MD5_LONG; + Nl,Nh : MD5_LONG; + data : array [0..(MD5_LBLOCK - 1)] of MD5_LONG; + num : TIdC_UINT; + end; + {$EXTERNALSYM PMD5_CTX} + PMD5_CTX = ^MD5_CTX; + //sha.h +//#if defined(OPENSSL_NO_SHA) || (defined(OPENSSL_NO_SHA0) && defined(OPENSSL_NO_SHA1)) +//#error SHA is disabled. +//#endif + {$IFDEF OPENSSL_NO_SHA} + {$DEFINE DONTUSESHA} + {$ENDIF} + {$IFDEF PENSSL_NO_SHA0} + {$IFDEF OPENSSL_NO_SHA1} + {$DEFINE DONTUSESHA} + {$ENDIF} + {$ENDIF} + {$IFNDEF DONTUSESHA} + {$IFDEF OPENSSL_FIPS} + {$EXTERNALSYM FIPS_SHA_SIZE_T} + FIPS_SHA_SIZE_T = size_t; + {$ENDIF} + {$ENDIF} + {$EXTERNALSYM SHA_LONG} + SHA_LONG = TIdC_UINT; + {$EXTERNALSYM SHA_CTX} + SHA_CTX = record + h0,h1,h2,h3,h4 : SHA_LONG; + Nl,Nh : SHA_LONG; + data : array [0..SHA_LBLOCK] of SHA_LONG; + num : TIdC_INT; + end; + {$IFNDEF OPENSSL_NO_SHA256} + {$EXTERNALSYM SHA256_CTX} + SHA256_CTX = record + h : array [0..(8 - 1)] of SHA_LONG; + Nl,Nh : SHA_LONG; + data : array [0..(SHA_LBLOCK -1)] of SHA_LONG; + num,md_len : TIdC_UINT; + end; + {$ENDIF} + {$IFNDEF OPENSSL_NO_SHA512} + {$EXTERNALSYM SHA_LONG64} + //not defined like this in sha.h but a comment + //says that it must be 64 bit. + SHA_LONG64 = TIdC_UINT64; + {$EXTERNALSYM TSHA512_CTX_Union} + TSHA512_CTX_Union = record + case integer of + 0 : (d : array [0..(SHA_LBLOCK -1)] of SHA_LONG64); + 1 : (p : array [0..(SHA512_CBLOCK -1)] of byte); + end; + {$EXTERNALSYM SHA512_CTX} + SHA512_CTX = record + h : array[0..(8-1)]of SHA_LONG64; + Nl,Nh : SHA_LONG64; + u : TSHA512_CTX_Union; + num,md_len : TIdC_UINT; + end; + {$EXTERNALSYM PSHA512_CTX} + PSHA512_CTX = ^SHA512_CTX; + {$ENDIF} + //ui.h + {$EXTERNALSYM PUI_METHOD} + PUI_METHOD = Pointer; //^UI_METHOD + {$EXTERNALSYM PUI_STRING} + PUI_STRING = Pointer; //^UI_STRING; + {$IFDEF DEBUG_SAFESTACK} + {$EXTERNALSYM STACK_OF_UI_STRING} + STACK_OF_UI_STRING = record + stack: stack; + end; + {$EXTERNALSYM PSTACK_OF_UI_STRING} + PSTACK_OF_UI_STRING = ^STACK_OF_UI_STRING; + {$ELSE} + //I think the DECLARE_STACK_OF macro is empty + {$EXTERNALSYM PSTACK_OF_UI_STRING} + PSTACK_OF_UI_STRING = PSTACK; + {$ENDIF} + {$EXTERNALSYM UI_string_types} + {$EXTERNALSYM UIT_NONE} + {$EXTERNALSYM UIT_PROMPT} + {$EXTERNALSYM UIT_VERIFY} + {$EXTERNALSYM UIT_BOOLEAN} + {$EXTERNALSYM UIT_INFO} + {$EXTERNALSYM UIT_ERROR} + UI_string_types = ( + UIT_NONE, //=0, + UIT_PROMPT, //* Prompt for a string */ + UIT_VERIFY, //* Prompt for a string and verify */ + UIT_BOOLEAN, //* Prompt for a yes/no response */ + UIT_INFO, //* Send info to the user */ + UIT_ERROR); //* Send an error message to the user */ + + //bio.h + //http://www.openssl.org/docs/crypto/bio.html + {$EXTERNALSYM PBIO} + PBIO = ^BIO; + {$EXTERNALSYM PBIO_METHOD} + PBIO_METHOD = ^BIO_METHOD; + {$EXTERNALSYM Pbio_info_cb} + Pbio_info_cb = procedure (_para1 : PBIO; _para2 : TIdC_INT; _para3 : PIdAnsiChar; + _para4 : TIdC_INT; _para5, _para6 : TIdC_LONG); cdecl; + {$EXTERNALSYM BIO_METHOD} + BIO_METHOD = record + _type : TIdC_INT; + name : PIdAnsiChar; + bwrite : function(_para1 : PBIO; _para2 : PIdAnsiChar; _para3 : TIdC_INT) : TIdC_INT; cdecl; + bread : function(_para1: PBIO; _para2: PIdAnsiChar; _para3: TIdC_INT) : TIdC_INT; cdecl; + bputs : function (_para1 : PBIO; _para2 : PIdAnsiChar) : TIdC_INT; cdecl; + bgets : function (_para1 : PBIO; _para2 : PIdAnsiChar; _para3 : TIdC_INT) : TIdC_INT; cdecl; + ctrl : function (_para1 : PBIO; _para2 : TIdC_INT; _para3 : TIdC_LONG; _para4 : Pointer) : TIdC_LONG; cdecl; + create : function(_para1 : PBIO) : TIdC_INT; cdecl; + destroy : function (_para1 : PBIO) : TIdC_INT; cdecl; + callback_ctrl : function (_para1 : PBIO; _para2 : TIdC_INT; _para3 : pbio_info_cb): TIdC_LONG; cdecl; + end; + BIO = record + method : PBIO_METHOD; + // bio, mode, argp, argi, argl, ret + callback : function (_para1 : PBIO; _para2 : TIdC_INT; _para3 : PIdAnsiChar; + _para4 : TIdC_INT; _para5, _para6 : TIdC_LONG) : TIdC_LONG cdecl; + cb_arg : PIdAnsiChar; // first argument for the callback + init : TIdC_INT; + shutdown : TIdC_INT; + flags : TIdC_INT; // extra storage + retry_reason : TIdC_INT; + num : TIdC_INT; + ptr : Pointer; + next_bio : PBIO; // used by filter BIOs + prev_bio : PBIO; // used by filter BIOs + references : TIdC_INT; + num_read : TIdC_ULONG; + num_write : TIdC_ULONG; + ex_data : CRYPTO_EX_DATA; + end; + {$EXTERNALSYM BIO} + {$EXTERNALSYM BIO_F_BUFFER_CTX} + BIO_F_BUFFER_CTX = record + { + /* Buffers are setup like this: + * + * <---------------------- size -----------------------> + * +---------------------------------------------------+ + * | consumed | remaining | free space | + * +---------------------------------------------------+ + * <-- off --><------- len -------> + *} + + //* BIO *bio; */ /* this is now in the BIO struct */ + ibuf_size : TIdC_INT; //* how big is the input buffer */ + obuf_size : TIdC_INT; //* how big is the output buffer */ + + ibuf : PIdAnsiChar; //* the char array */ + ibuf_len : TIdC_INT; //* how many bytes are in it */ + ibuf_off : TIdC_INT; //* write/read offset */ + + obuf : PIdAnsiChar; //* the char array */ + obuf_len : TIdC_INT; //* how many bytes are in it */ + obuf_off : TIdC_INT; //* write/read offset */ + end; + {$EXTERNALSYM PBIO_F_BUFFER_CTX} + PBIO_F_BUFFER_CTX = ^BIO_F_BUFFER_CTX; + //* Prefix and suffix callback in ASN1 BIO *// + {$EXTERNALSYM asn1_ps_function} + asn1_ps_function = function (b : PBIO; pbuf : PPIdAnsiChar; plen : PIdC_INT; parg : Pointer) : TIdC_INT cdecl; + //struct from engine.h +// ENGINE = record + //I don't have any info about record fields. +// end; + {$EXTERNALSYM PENGINE} + PENGINE = Pointer;//^ENGINE; + {$EXTERNALSYM PPENGINE} + PPENGINE = ^PENGINE; + //asn1.h + {$EXTERNALSYM I2D_OF_void} + //#define I2D_OF(type) int (*)(type *,unsigned char **) + I2D_OF_void = function(_para1 : Pointer; _para2 : PPByte) : TIdC_INT cdecl; + //D2I_OF(type) type *(*)(type **,const unsigned char **,long) + {$EXTERNALSYM D2I_OF_void} + D2I_OF_void = function (_para1 : PPointer; _para2 : PPByte; _para3 : TIdC_LONG) : Pointer cdecl; + // This is just an opaque pointer + // ASN1_VALUE = record + // end; + {$EXTERNALSYM PASN1_VALUE} + PASN1_VALUE = Pointer;//^ASN1_VALUE; + {$EXTERNALSYM PPASN1_VALUE} + PPASN1_VALUE = ^PASN1_VALUE; + {$IFDEF DEBUG_SAFESTACK} + {$EXTERNALSYM STACK_OF_ASN1_VALUE} + STACK_OF_ASN1_VALUE = record + stack: stack; + end; + {$EXTERNALSYM PSTACK_OF_ASN1_VALUE} + PSTACK_OF_ASN1_VALUE = ^STACK_OF_ASN1_VALUE; + {$ELSE} + //I think the DECLARE_STACK_OF macro is empty + {$EXTERNALSYM PSTACK_OF_ASN1_VALUE} + PSTACK_OF_ASN1_VALUE = PSTACK; + {$ENDIF} + {$EXTERNALSYM ASN1_OBJECT} + ASN1_OBJECT = record + sn, ln : PIdAnsiChar; + nid : TIdC_INT; + length : TIdC_INT; + data : PIdAnsiChar; + flags : TIdC_INT; // Should we free this one + end; + {$EXTERNALSYM PASN1_OBJECT} + PASN1_OBJECT = ^ASN1_OBJECT; + {$EXTERNALSYM PPASN1_OBJECT} + PPASN1_OBJECT = ^PASN1_OBJECT; + {$IFDEF DEBUG_SAFESTACK} + {$EXTERNALSYM STACK_OF_ASN1_OBJECT} + STACK_OF_ASN1_OBJECT = record + stack: stack; + end; + {$EXTERNALSYM PSTACK_OF_ASN1_OBJECT} + PSTACK_OF_ASN1_OBJECT = ^STACK_OF_ASN1_OBJECT; + {$ELSE} + //I think the DECLARE_STACK_OF macro is empty + {$EXTERNALSYM PSTACK_OF_ASN1_OBJECT} + PSTACK_OF_ASN1_OBJECT = PSTACK; + {$ENDIF} + {$EXTERNALSYM PPSTACK_OF_ASN1_OBJECT} + PPSTACK_OF_ASN1_OBJECT = ^PSTACK_OF_ASN1_OBJECT; + {$EXTERNALSYM asn1_string_st} + asn1_string_st = record + length : TIdC_INT; + _type : TIdC_INT; + data : PIdAnsiChar; + { The value of the following field depends on the type being + held. It is mostly being used for BIT_STRING so if the + input data has a non-zero 'unused bits' value, it will be + handled correctly } + flags : TIdC_LONG; + end; + //moved from asn1.h section here for a type definition + + {$IFNDEF OPENSSL_EXPORT_VAR_AS_FUNCTION} + {$EXTERNALSYM PASN1_ITEM} + // ASN1_ITEM pointer exported type + // typedef const ASN1_ITEM ASN1_ITEM_EXP; + PASN1_ITEM = ^ASN1_ITEM; + {$ELSE} + // Platforms that can't easily handle shared global variables are declared + // as functions returning ASN1_ITEM pointers. + // ASN1_ITEM pointer exported type + //typedef const ASN1_ITEM * ASN1_ITEM_EXP(void); + {$EXTERNALSYM PASN1_ITEM_EXP} + PASN1_ITEM_EXP = ^ASN1_ITEM_EXP; + {$ENDIF} +// typedef int asn1_output_data_fn(BIO *out, BIO *data, ASN1_VALUE *val, int flags, +// const ASN1_ITEM *it); + {$EXTERNALSYM asn1_output_data_fn} + asn1_output_data_fn = function(AOut : PBIO; data : PBIO; val : PASN1_VALUE; + flags : TIdC_INT; it : PASN1_ITEM): TIdC_INT; stdcall; + {$EXTERNALSYM ASN1_STRING} + ASN1_STRING = asn1_string_st; + {$EXTERNALSYM PASN1_STRING} + PASN1_STRING = ^ASN1_STRING; + {$EXTERNALSYM PPASN1_STRING} + PPASN1_STRING = ^PASN1_STRING; + {$EXTERNALSYM ASN1_INTEGER} + ASN1_INTEGER = ASN1_STRING; + {$EXTERNALSYM PASN1_INTEGER} + PASN1_INTEGER = ^ASN1_INTEGER; + {$EXTERNALSYM PPASN1_INTEGER} + PPASN1_INTEGER = ^PASN1_INTEGER; + {$IFDEF DEBUG_SAFESTACK} + {$EXTERNALSYM STACK_OF_ASN1_INTEGER} + STACK_OF_ASN1_INTEGER = record + stack: stack; + end; + {$EXTERNALSYM PSTACK_OF_ASN1_INTEGER} + PSTACK_OF_ASN1_INTEGER = ^STACK_OF_ASN1_INTEGER; + {$ELSE} + //I think the DECLARE_STACK_OF macro is empty + {$EXTERNALSYM PSTACK_OF_ASN1_INTEGER} + PSTACK_OF_ASN1_INTEGER = PSTACK; + {$ENDIF} + {$EXTERNALSYM ASN1_ENUMERATED} + ASN1_ENUMERATED = ASN1_STRING; + {$EXTERNALSYM PASN1_ENUMERATED} + PASN1_ENUMERATED = ^ASN1_ENUMERATED; + {$EXTERNALSYM PPASN1_ENUMERATED} + PPASN1_ENUMERATED = ^PASN1_ENUMERATED; + {$EXTERNALSYM ASN1_BIT_STRING} + ASN1_BIT_STRING = ASN1_STRING; + {$EXTERNALSYM PASN1_BIT_STRING} + PASN1_BIT_STRING = ^ASN1_BIT_STRING; + {$EXTERNALSYM PPASN1_BIT_STRING} + PPASN1_BIT_STRING = ^PASN1_BIT_STRING; + {$EXTERNALSYM ASN1_OCTET_STRING} + ASN1_OCTET_STRING = ASN1_STRING; + {$EXTERNALSYM PASN1_OCTET_STRING} + PASN1_OCTET_STRING = ^ASN1_OCTET_STRING; + {$EXTERNALSYM PPASN1_OCTET_STRING} + PPASN1_OCTET_STRING = ^PASN1_OCTET_STRING; + {$EXTERNALSYM ASN1_PRINTABLESTRING} + ASN1_PRINTABLESTRING = ASN1_STRING; + {$EXTERNALSYM PASN1_PRINTABLESTRING} + PASN1_PRINTABLESTRING = ^ASN1_PRINTABLESTRING; + {$EXTERNALSYM PPASN1_PRINTABLESTRING} + PPASN1_PRINTABLESTRING = ^PASN1_PRINTABLESTRING; + {$EXTERNALSYM ASN1_T61STRING} + ASN1_T61STRING = ASN1_STRING; + {$EXTERNALSYM PASN1_T61STRING} + PASN1_T61STRING = ^ASN1_T61STRING; + {$EXTERNALSYM PPASN1_T61STRING} + PPASN1_T61STRING = ^PASN1_T61STRING; + {$EXTERNALSYM ASN1_IA5STRING} + ASN1_IA5STRING = ASN1_STRING; + {$EXTERNALSYM PASN1_IA5STRING} + PASN1_IA5STRING = ^ASN1_IA5STRING; + {$EXTERNALSYM PPASN1_IA5STRING} + PPASN1_IA5STRING = ^PASN1_IA5STRING; + {$EXTERNALSYM ASN1_UTCTIME} + ASN1_UTCTIME = ASN1_STRING; + {$EXTERNALSYM PASN1_UTCTIME} + PASN1_UTCTIME = ^ASN1_UTCTIME; + {$EXTERNALSYM PPASN1_UTCTIME} + PPASN1_UTCTIME = ^PASN1_UTCTIME; + {$EXTERNALSYM ASN1_GENERALIZEDTIME} + ASN1_GENERALIZEDTIME = ASN1_STRING; + {$EXTERNALSYM PASN1_GENERALIZEDTIME} + PASN1_GENERALIZEDTIME = ^ASN1_GENERALIZEDTIME; + {$EXTERNALSYM PPASN1_GENERALIZEDTIME} + PPASN1_GENERALIZEDTIME = ^PASN1_GENERALIZEDTIME; + {$EXTERNALSYM ASN1_TIME} + ASN1_TIME = ASN1_STRING; + {$EXTERNALSYM PASN1_TIME} + PASN1_TIME = ^ASN1_TIME; + {$EXTERNALSYM PPASN1_TIME} + PPASN1_TIME = ^PASN1_TIME; + {$EXTERNALSYM ASN1_GENERALSTRING} + ASN1_GENERALSTRING = ASN1_STRING; + {$EXTERNALSYM PASN1_GENERALSTRING} + PASN1_GENERALSTRING = ^ASN1_GENERALSTRING; + {$EXTERNALSYM PPASN1_GENERALSTRING} + PPASN1_GENERALSTRING = ^PASN1_GENERALSTRING; + {$IFDEF DEBUG_SAFESTACK} + {$EXTERNALSYM STACK_OF_ASN1_GENERALSTRING} + STACK_OF_ASN1_GENERALSTRING = record + _stack: STACK; + end; + {$EXTERNALSYM PSTACK_OF_ASN1_GENERALSTRING} + PSTACK_OF_ASN1_GENERALSTRING =^STACK_OF_ASN1_GENERALSTRING; + {$ELSE} + //I think the DECLARE_STACK_OF macro is empty + {$EXTERNALSYM PSTACK_OF_ASN1_GENERALSTRING} + PSTACK_OF_ASN1_GENERALSTRING = PSTACK; + {$ENDIF} + {$EXTERNALSYM ASN1_UNIVERSALSTRING} + ASN1_UNIVERSALSTRING = ASN1_STRING; + {$EXTERNALSYM PASN1_UNIVERSALSTRING} + PASN1_UNIVERSALSTRING = ^ASN1_UNIVERSALSTRING; + {$EXTERNALSYM PPASN1_UNIVERSALSTRING} + PPASN1_UNIVERSALSTRING = ^PASN1_UNIVERSALSTRING; + {$EXTERNALSYM ASN1_BMPSTRING} + ASN1_BMPSTRING = ASN1_STRING; + {$EXTERNALSYM PASN1_BMPSTRING} + PASN1_BMPSTRING = ^ASN1_BMPSTRING; + {$EXTERNALSYM PPASN1_BMPSTRING} + PPASN1_BMPSTRING = ^PASN1_BMPSTRING; + {$EXTERNALSYM ASN1_VISIBLESTRING} + ASN1_VISIBLESTRING = ASN1_STRING; + {$EXTERNALSYM PASN1_VISIBLESTRING} + PASN1_VISIBLESTRING = ^ASN1_VISIBLESTRING; + {$EXTERNALSYM PPASN1_VISIBLESTRING} + PPASN1_VISIBLESTRING = ^PASN1_VISIBLESTRING; + {$EXTERNALSYM ASN1_UTF8STRING} + ASN1_UTF8STRING = ASN1_STRING; + {$EXTERNALSYM PASN1_UTF8STRING} + PASN1_UTF8STRING = ^ASN1_UTF8STRING; + {$EXTERNALSYM PPASN1_UTF8STRING} + PPASN1_UTF8STRING = ^PASN1_UTF8STRING; + {$EXTERNALSYM ASN1_BOOLEAN} + ASN1_BOOLEAN = TIdC_INT; + {$EXTERNALSYM PASN1_BOOLEAN} + PASN1_BOOLEAN = ^ASN1_BOOLEAN; + {$EXTERNALSYM PPASN1_BOOLEAN} + PPASN1_BOOLEAN = ^PASN1_BOOLEAN; + {$EXTERNALSYM ASN1_NULL} + ASN1_NULL = TIdC_INT; + {$EXTERNALSYM PASN1_NULL} + PASN1_NULL = ^ASN1_NULL; + {$EXTERNALSYM PPASN1_NULL} + PPASN1_NULL = ^PASN1_NULL; + {$EXTERNALSYM ASN1_TYPE} + ASN1_TYPE = record + case Integer of + 0: (ptr: PIdAnsiChar); + 1: (boolean: ASN1_BOOLEAN); + 2: (asn1_string: PASN1_STRING); + 3: (_object: PASN1_OBJECT); + 4: (integer: PASN1_INTEGER); + 5: (enumerated: PASN1_ENUMERATED); + 6: (bit_string: PASN1_BIT_STRING); + 7: (octet_string: PASN1_OCTET_STRING); + 8: (printablestring: PASN1_PRINTABLESTRING); + 9: (t61string: PASN1_T61STRING); + 10: (ia5string: PASN1_IA5STRING); + 11: (generalstring: PASN1_GENERALSTRING); + 12: (bmpstring: PASN1_BMPSTRING); + 13: (universalstring: PASN1_UNIVERSALSTRING); + 14: (utctime: PASN1_UTCTIME); + 15: (generalizedtime: PASN1_GENERALIZEDTIME); + 16: (visiblestring: PASN1_VISIBLESTRING); + 17: (utf8string: PASN1_UTF8STRING); + { set and sequence are left complete and still + contain the set or sequence bytes } + 18: (_set: PASN1_STRING); + 19: (sequence: PASN1_STRING); + end; + {$EXTERNALSYM PASN1_TYPE} + PASN1_TYPE = ^ASN1_TYPE; + {$EXTERNALSYM PPASN1_TYPE} + PPASN1_TYPE = ^PASN1_TYPE; + {$IFDEF DEBUG_SAFESTACK} + {$EXTERNALSYM STACK_OF_ASN1_TYPE} + STACK_OF_ASN1_TYPE = record + _stack: stack; + end; + {$EXTERNALSYM PSTACK_OF_ASN1_TYPE} + PSTACK_OF_ASN1_TYPE = ^STACK_OF_ASN1_TYPE; + {$ELSE} + //I think the DECLARE_STACK_OF macro is empty + {$EXTERNALSYM PSTACK_OF_ASN1_TYPE} + PSTACK_OF_ASN1_TYPE = ^PSTACK; + {$ENDIF} + {$EXTERNALSYM ASN1_CTX} + ASN1_CTX = record + p : PIdAnsiChar; // work char pointer + eos : TIdC_INT; // end of sequence read for indefinite encoding + error : TIdC_INT; // error code to use when returning an error + inf : TIdC_INT; // constructed if 0x20, indefinite is 0x21 + tag : TIdC_INT; // tag from last 'get object' + xclass : TIdC_INT; // class from last 'get object' + slen : TIdC_LONG; // length of last 'get object' + max : PIdAnsiChar; // largest value of p allowed + q : PIdAnsiChar; // temporary variable + pp : PPIdAnsiChar; // variable + line : TIdC_INT; // used in error processing + end; + {$EXTERNALSYM PASN1_CTX} + PASN1_CTX = ^ASN1_CTX; + {$EXTERNALSYM PPASN1_CTX} + PPASN1_CTX = ^PASN1_CTX; + {$EXTERNALSYM ASN1_METHOD} + ASN1_METHOD = record + i2d : i2d_of_void; + d2i : i2d_of_void; + create : function: Pointer; cdecl; + destroy : procedure(ptr: Pointer); cdecl; + end; + {$EXTERNALSYM PASN1_METHOD} + PASN1_METHOD = ^ASN1_METHOD; + {$EXTERNALSYM PPASN1_METHOD} + PPASN1_METHOD = ^PASN1_METHOD; + // This is used when parsing some Netscape objects + {$EXTERNALSYM ASN1_HEADER} + ASN1_HEADER = record + header : PASN1_OCTET_STRING; + data : Pointer; + meth : PASN1_METHOD; + end; + {$EXTERNALSYM PASN1_HEADER} + PASN1_HEADER = ^ASN1_HEADER; + {$EXTERNALSYM PPASN1_HEADER} + PPASN1_HEADER = ^PASN1_HEADER; + {$EXTERNALSYM ASN1_ENCODING} + ASN1_ENCODING = record + enc: PIdAnsiChar; + len: TIdC_LONG; + modified: TIdC_INT; + end; + {$EXTERNALSYM PASN1_ENCODING} + PASN1_ENCODING = ^ASN1_ENCODING; + {$EXTERNALSYM PPASN1_ENCODING} + PPASN1_ENCODING = ^PASN1_ENCODING; + {$EXTERNALSYM ASN1_STRING_TABLE} + ASN1_STRING_TABLE = record + nid : TIdC_INT; + minsize : TIdC_LONG; + maxsize : TIdC_LONG; + mask : TIdC_ULONG; + flags : TIdC_ULONG; + end; + {$EXTERNALSYM PASN1_STRING_TABLE} + PASN1_STRING_TABLE = ^ASN1_STRING_TABLE; + {$EXTERNALSYM PPASN1_STRING_TABLE} + PPASN1_STRING_TABLE = ^ASN1_STRING_TABLE; + {$IFDEF DEBUG_SAFESTACK} + {$EXTERNALSYM STACK_OF_ASN1_STRING_TABLE} + STACK_OF_ASN1_STRING_TABLE = record + _stack: stack; + end; + {$EXTERNALSYM PSTACK_OF_ASN1_STRING_TABLE} + PSTACK_OF_ASN1_STRING_TABLE = ^STACK_OF_ASN1_STRING_TABLE; + {$ELSE} + //I think the DECLARE_STACK_OF macro is empty + {$EXTERNALSYM PSTACK_OF_ASN1_STRING_TABLE} + PSTACK_OF_ASN1_STRING_TABLE = PSTACK; + {$ENDIF} + {$IFNDEF OPENSSL_EXPORT_VAR_AS_FUNCTION} + // ASN1_ITEM pointer exported type + // typedef const ASN1_ITEM ASN1_ITEM_EXP; + // ASN1_ITEM_EXP = ASN1_ITEM; + // PASN1_ITEM_EXP = ^ASN1_ITEM_EXP; + // PASN1_ITEM = ^ASN1_ITEM; + {$EXTERNALSYM PASN1_ITEM_EXP} + PASN1_ITEM_EXP = PASN1_ITEM; + {$ELSE} + // Platforms that can't easily handle shared global variables are declared + // as functions returning ASN1_ITEM pointers. + + // ASN1_ITEM pointer exported type + //typedef const ASN1_ITEM * ASN1_ITEM_EXP(void); + {$EXTERNALSYM ASN1_ITEM_EXP} + ASN1_ITEM_EXP = function : PASN1_ITEM cdecl; +// PASN1_ITEM_EXP = ^ASN1_ITEM_EXP; + {$ENDIF} + //rsa.h - struct rsa_st + {$IFNDEF OPENSSL_NO_RSA} + {$IFDEF OPENSSL_FIPS} + {$EXTERNALSYM FIPS_RSA_SIZE_T} + FIPS_RSA_SIZE_T = TIdC_int; + {$ENDIF} + {$EXTERNALSYM PRSA} + PRSA = ^RSA; + {$EXTERNALSYM PPRSA} + PPRSA =^PRSA; + {$EXTERNALSYM RSA_METHOD} + RSA_METHOD = record + name : PIdAnsiChar; + rsa_pub_enc : function (flen : TIdC_INT; const from : PIdAnsiChar; + _to : PIdAnsiChar; rsa : PRSA; padding : TIdC_INT) : TIdC_INT; cdecl; + rsa_pub_dec : function (flen : TIdC_INT; const from : PIdAnsiChar; + _to : PIdAnsiChar; rsa : PRSA; padding : TIdC_INT) : TIdC_INT; cdecl; + rsa_priv_enc : function (flen : TIdC_INT; const from : PIdAnsiChar; + _to : PIdAnsiChar; rsa : PRSA; padding : TIdC_INT) : TIdC_INT; cdecl; + rsa_priv_dec : function (flen : TIdC_INT; const from : PIdAnsiChar; + _to : PIdAnsiChar; rsa : PRSA; padding : TIdC_INT) : TIdC_INT; cdecl; + rsa_mod_exp : function (r0 : PBIGNUM; const I : PBIGNUM; + rsa : PRSA; ctx : PBN_CTX) : TIdC_INT cdecl; // Can be null / + bn_mod_exp : function (r : PBIGNUM; const a : PBIGNUM; + const p : PBIGNUM; const m: PBIGNUM; ctx : PBN_CTX; + m_ctx : PBN_MONT_CTX ) : TIdC_INT; cdecl; // Can be null + init : function (rsa : PRSA) : TIdC_INT; cdecl; // called at new + finish : function (rsa : PRSA) : TIdC_INT; cdecl; // called at free + flags : TIdC_INT; // RSA_METHOD_FLAG_* things + app_data : PIdAnsiChar; // may be needed! + // New sign and verify functions: some libraries don't allow arbitrary data + // to be signed/verified: this allows them to be used. Note: for this to work + // the RSA_public_decrypt() and RSA_private_encrypt() should *NOT* be used + // RSA_sign(), RSA_verify() should be used instead. Note: for backwards + // compatibility this functionality is only enabled if the RSA_FLAG_SIGN_VER + // option is set in 'flags'. + // + rsa_sign : function (_type : TIdC_INT; const m : PIdAnsiChar; m_length : TIdC_UINT; + sigret : PIdAnsiChar; siglen : PIdC_UINT; const rsa : PRSA) : TIdC_INT; cdecl; + rsa_verify : function(dtype : TIdC_INT; const m : PIdAnsiChar; m_length : PIdC_UINT; + sigbuf : PIdAnsiChar; siglen : PIdC_UINT; const rsa :PRSA) : TIdC_INT; cdecl; + // If this callback is NULL, the builtin software RSA key-gen will be used. + // This is for behavioural compatibility whilst the code gets rewired, but + // one day it would be nice to assume there are no such things as "builtin + // software" implementations. + rsa_keygen : function (rsa : PRSA; bits : TIdC_INT; e : PBIGNUM; cb : PBN_GENCB) : TIdC_INT; cdecl; + end; + {$EXTERNALSYM PRSA_METHOD} + PRSA_METHOD = ^RSA_METHOD; + + {$EXTERNALSYM rsa_st} + rsa_st = record + // The first parameter is used to pickup errors where + // this is passed instead of aEVP_PKEY, it is set to 0 + pad : TIdC_INT; + version : TIdC_LONG; + meth : PRSA_METHOD; // const RSA_METHOD *meth; + // functional reference if 'meth' is ENGINE-provided + engine : PENGINE; + n : PBIGNUM; + e : PBIGNUM; + d : PBIGNUM; + p : PBIGNUM; + q : PBIGNUM; + dmp1 : PBIGNUM; + dmq1 : PBIGNUM; + iqmp : PBIGNUM; + // be careful using this if the RSA structure is shared + ex_data : CRYPTO_EX_DATA; + references : TIdC_INT; + flags : TIdC_INT; + // Used to cache montgomery values + _method_mod_n : PBN_MONT_CTX; + _method_mod_p : PBN_MONT_CTX; + _method_mod_q : PBN_MONT_CTX; + // all BIGNUM values are actually in the following data, if it is not NULL + bignum_data : PIdAnsiChar; + blinding : PBN_BLINDING; + mt_blinding : PBN_BLINDING; + end; + {$EXTERNALSYM RSA} + RSA = rsa_st; + {$EXTERNALSYM Prsa_st} + Prsa_st = PRSA; + {$ENDIF} + //dso.h + {$EXTERNALSYM PDSO} + PDSO = ^DSO; +///* The function prototype used for method functions (or caller-provided +// * callbacks) that transform filenames. They are passed a DSO structure pointer +// * (or NULL if they are to be used independantly of a DSO object) and a +// * filename to transform. They should either return NULL (if there is an error +// * condition) or a newly allocated string containing the transformed form that +// * the caller will need to free with OPENSSL_free() when done. */ + {$EXTERNALSYM DSO_NAME_CONVERTER_FUNC} + DSO_NAME_CONVERTER_FUNC = function (dso : PDSO; para1 : PIdAnsiChar) : PIdAnsiChar cdecl; + {$EXTERNALSYM PDSO_METHOD} + PDSO_METHOD = ^DSO_METHOD; + {$EXTERNALSYM DSO_FUNC_TYPE} + DSO_FUNC_TYPE = procedure cdecl; +///* The function prototype used for method functions (or caller-provided +// * callbacks) that merge two file specifications. They are passed a +// * DSO structure pointer (or NULL if they are to be used independantly of +// * a DSO object) and two file specifications to merge. They should +// * either return NULL (if there is an error condition) or a newly allocated +// * string containing the result of merging that the caller will need +// * to free with OPENSSL_free() when done. +// * Here, merging means that bits and pieces are taken from each of the +// * file specifications and added together in whatever fashion that is +// * sensible for the DSO method in question. The only rule that really +// * applies is that if the two specification contain pieces of the same +// * type, the copy from the first string takes priority. One could see +// * it as the first specification is the one given by the user and the +// * second being a bunch of defaults to add on if they're missing in the +// * first. */ + {$EXTERNALSYM DSO_MERGER_FUNC} + DSO_MERGER_FUNC = function (DSO : PDSO; para1, para2 : PIdAnsiChar) : PIdAnsiChar stdcall; + {$EXTERNALSYM DSO_METHOD} + DSO_METHOD = record + name : PIdAnsiChar; + ///* Loads a shared library, NB: new DSO_METHODs must ensure that a + // * successful load populates the loaded_filename field, and likewise a + // * successful unload OPENSSL_frees and NULLs it out. */ + dso_load : function (dso : PDSO) : TIdC_INT cdecl; + //* Unloads a shared library */ + dso_unload : function (dso : PDSO) : TIdC_INT cdecl; + //* Binds a variable */ + dso_bind_var : function (dso : PDSO; symname : PIdAnsiChar) : Pointer cdecl; + ///* Binds a function - assumes a return type of DSO_FUNC_TYPE. + // * This should be cast to the real function prototype by the + // * caller. Platforms that don't have compatible representations + // * for different prototypes (this is possible within ANSI C) + // * are highly unlikely to have shared libraries at all, let + // * alone a DSO_METHOD implemented for them. */ + dso_bind_func : function (dso : PDSO; symname : PIdAnsiChar) : DSO_FUNC_TYPE stdcall; + + ///* The generic (yuck) "ctrl()" function. NB: Negative return + // * values (rather than zero) indicate errors. */ + dso_ctrl : function (dso : PDSO; cmd : TIdC_INT; larg : TIdC_LONG; parg : Pointer) : TIdC_LONG stdcall; + ///* The default DSO_METHOD-specific function for converting filenames to + // * a canonical native form. */ + dso_name_converter : DSO_NAME_CONVERTER_FUNC; + ///* The default DSO_METHOD-specific function for converting filenames to + // * a canonical native form. */ + dso_merger : DSO_MERGER_FUNC; + + //* [De]Initialisation handlers. */ + init : function (dso : PDSO) : TIdC_INT stdcall; + finish : function (dso : PDSO) : TIdC_INT stdcall; + + //* Return pathname of the module containing location */ + pathbyaddr : function (addr : Pointer; path : PIdAnsiChar; sz : TIdC_INT) : TIdC_INT stdcall; + //* Perform global symbol lookup, i.e. among *all* modules */ + globallookup : function (symname : PIdAnsiChar) : Pointer stdcall; + end; + {$EXTERNALSYM DSO} + DSO = record + meth : PDSO_METHOD; + ///* Standard dlopen uses a (void *). Win32 uses a HANDLE. VMS + // * doesn't use anything but will need to cache the filename + // * for use in the dso_bind handler. All in all, let each + // * method control its own destiny. "Handles" and such go in + // * a STACK. */ + meth_data : PSTACK_OF_POINTER; + references : TIdC_INT; + flags : TIdC_INT; + ///* For use by applications etc ... use this for your bits'n'pieces, + // * don't touch meth_data! */ + ex_data : CRYPTO_EX_DATA; + ///* If this callback function pointer is set to non-NULL, then it will + // * be used in DSO_load() in place of meth->dso_name_converter. NB: This + // * should normally set using DSO_set_name_converter(). */ + name_converter : DSO_NAME_CONVERTER_FUNC; + ///* If this callback function pointer is set to non-NULL, then it will + // * be used in DSO_load() in place of meth->dso_merger. NB: This + // * should normally set using DSO_set_merger(). */ + merger : DSO_MERGER_FUNC; + ///* This is populated with (a copy of) the platform-independant + // * filename used for this DSO. */ + filename : PIdAnsiChar; + ///* This is populated with (a copy of) the translated filename by which + // * the DSO was actually loaded. It is NULL iff the DSO is not currently + // * loaded. NB: This is here because the filename translation process + // * may involve a callback being invoked more than once not only to + // * convert to a platform-specific form, but also to try different + // * filenames in the process of trying to perform a load. As such, this + // * variable can be used to indicate (a) whether this DSO structure + // * corresponds to a loaded library or not, and (b) the filename with + // * which it was actually loaded. */ + loaded_filename : PIdAnsiChar; + end; + //dh.h + {$IFNDEF OPENSSL_NO_DH} + {$EXTERNALSYM PDH} + PDH = ^DH; + {$EXTERNALSYM DH_METHOD} + DH_METHOD = record + name : PIdAnsiChar; + // Methods here + generate_key : function (dh : PDH) : TIdC_INT; cdecl; + compute_key : function (key : PIdAnsiChar; const pub_key : PBIGNUM; dh : PDH) : TIdC_INT; cdecl; + bn_mod_exp : function (const dh : PDH; r : PBIGNUM; const e : PBIGNUM; + const p : PBIGNUM; const m : PBIGNUM; ctx : PBN_CTX; + m_ctx : PBN_MONT_CTX) : TIdC_INT; cdecl; // Can be null + init : function (dh : PDH) : TIdC_INT; cdecl; + finish : function (dh : PDH) : TIdC_INT; cdecl; + flags : TIdC_INT; + app_data : PIdAnsiChar; + // If this is non-NULL, it will be used to generate parameters + generate_params : function(dh : PDH; prime_len, generator : TIdC_INT; cb : PBN_GENCB) : TIdC_INT; cdecl; + end; + {$EXTERNALSYM dh_st} + dh_st = record + // The first parameter is used to pickup errors where + // this is passed instead of aEVP_PKEY, it is set to 0 + pad : TIdC_INT; + version : TIdC_LONG; + meth : PRSA_METHOD; + // functional reference if 'meth' is ENGINE-provided + engine: PENGINE; + n : PBIGNUM; + e : PBIGNUM; + d : PBIGNUM; + p : PBIGNUM; + q : PBIGNUM; + dmp1 : PBIGNUM; + dmq1 : PBIGNUM; + iqmp : PBIGNUM; + // be careful using this if the RSA structure is shared + ex_data : CRYPTO_EX_DATA; + references : TIdC_INT; + flags : TIdC_INT; + // Used to cache montgomery values + _method_mod_n : BN_MONT_CTX; + _method_mod_p : BN_MONT_CTX; + _method_mod_q : BN_MONT_CTX; + // all BIGNUM values are actually in the following data, if it is not NULL + bignum_data : PIdAnsiChar; + blinding : PBN_BLINDING; + mt_blinding : PBN_BLINDING; + end; + {$EXTERNALSYM DH} + DH = dh_st; + {$EXTERNALSYM Pdh_st} + Pdh_st = PDH; + {$EXTERNALSYM PPDH} + PPDH =^PDH; + {$ENDIF} + // dsa.h + {$IFNDEF OPENSSL_NO_DSA} + {$IFDEF OPENSSL_FIPS} + {$EXTERNALSYM FIPS_DSA_SIZE_T} + FIPS_DSA_SIZE_T = TIdC_int; + {$ENDIF} + {$EXTERNALSYM DSA_SIG} + DSA_SIG = record + r : PBIGNUM; + s : PBIGNUM; + end; + {$EXTERNALSYM PDSA_SIG} + PDSA_SIG = ^DSA_SIG; + {$EXTERNALSYM PDSA} + PDSA = ^DSA; + {$EXTERNALSYM DSA_METHOD} + DSA_METHOD = record + name : PIdAnsiChar; + dsa_do_sign : function (const dgst : PIdAnsiChar; dlen : TIdC_INT; dsa : PDSA) : PDSA_SIG; cdecl; + dsa_sign_setup : function (dsa : PDSA; ctx_in : PBN_CTX; kinvp, rp : PPBN_CTX) : TIdC_INT; cdecl; + dsa_do_verify : function(dgst : PIdAnsiChar; dgst_len : TIdC_INT; + sig : PDSA_SIG; dsa : PDSA) : TIdC_INT; cdecl; + dsa_mod_exp : function(dsa : PDSA; rr, a1, p1, + a2, p2, m : PBIGNUM; ctx : PBN_CTX; + in_mont : PBN_MONT_CTX) : TIdC_INT; cdecl; + bn_mod_exp : function (dsa : PDSA; r, a : PBIGNUM; const p, m : PBIGNUM; + ctx : PBN_CTX; m_ctx : PBN_CTX): TIdC_INT; cdecl; // Can be null + init : function (dsa : PDSA) : TIdC_INT; cdecl; + finish : function (dsa : PDSA) : TIdC_INT; cdecl; + flags : TIdC_INT; + app_data : PIdAnsiChar; + // If this is non-NULL, it is used to generate DSA parameters + dsa_paramgen : function (dsa : PDSA; bits : TIdC_INT; seed : PIdAnsiChar; + seed_len : TIdC_INT; counter_ret : PIdC_INT; h_ret : PIdC_ULONG; + cb : PBN_GENCB ) : TIdC_INT; cdecl; + // If this is non-NULL, it is used to generate DSA keys + dsa_keygen : function(dsa : PDSA) : TIdC_INT; cdecl; + end; + {$EXTERNALSYM PDSA_METHOD} + PDSA_METHOD = ^DSA_METHOD; + + {$EXTERNALSYM dsa_st} + dsa_st = record + // This first variable is used to pick up errors where + // a DSA is passed instead of of a EVP_PKEY + pad : TIdC_INT; + version : TIdC_LONG; + write_params : TIdC_INT; + p : PBIGNUM; + q : PBIGNUM; // == 20 + g : PBIGNUM; + pub_key : PBIGNUM; // y public key + priv_key : PBIGNUM; // x private key + kinv : BIGNUM; // Signing pre-calc + r : PBIGNUM; // Signing pre-calc + flags : TIdC_INT; + // Normally used to cache montgomery values + method_mont_p : PBN_MONT_CTX; + references : TIdC_INT; + ex_data : CRYPTO_EX_DATA; + meth : PDSA_METHOD; + // functional reference if 'meth' is ENGINE-provided + engine : PENGINE; + end; + {$EXTERNALSYM DSA} + DSA = dsa_st; + {$EXTERNALSYM Pdsa_st} + Pdsa_st = PDSA; + {$EXTERNALSYM PPDSA} + PPDSA = ^PDSA; + {$ENDIF} + // ec.h + {$IFNDEF OPENSSL_NO_EC} + // EC_METHOD = record + //The fields are internal to OpenSSL, they are not listed in the header. + // end; + {$EXTERNALSYM PEC_METHOD} + PEC_METHOD = Pointer;//^EC_METHOD; + {$EXTERNALSYM PPEC_METHOD} + PPEC_METHOD = ^PEC_METHOD; + // EC_GROUP = record + //The fields are internal to OpenSSL, they are not listed in the header. +// end; + {$EXTERNALSYM PEC_GROUP} + PEC_GROUP = Pointer;//^EC_GROUP; + {$EXTERNALSYM PPEC_GROUP} + PPEC_GROUP = ^PEC_GROUP; +// EC_POINT = record + //The fields are internal to OpenSSL, they are not listed in the header. +// end; + {$EXTERNALSYM PEC_POINT} + PEC_POINT = Pointer;//^EC_POINT; + {$EXTERNALSYM PPEC_POINT} + PPEC_POINT = ^PEC_POINT; + {$EXTERNALSYM EC_builtin_curve} + EC_builtin_curve = record + nid : TIdC_INT; + comment : PIdAnsiChar; + end; + {$EXTERNALSYM Pec_key_st} + Pec_key_st = Pointer; + {$EXTERNALSYM PEC_KEY} + PEC_KEY = Pec_key_st;//^EC_KEY; +// EC_KEY = record + //The fields are internal to OpenSSL, they are not listed in the header. +// end; + + {$EXTERNALSYM PPEC_KEY} + PPEC_KEY = ^PEC_KEY; + {$ENDIF} + //evp.h +// EVP_PBE_KEYGEN = record +// end; + {$EXTERNALSYM PEVP_PKEY_METHOD} + PEVP_PKEY_METHOD = pointer; //This is not defined publically in OpenSSL 1.0.0 + {$EXTERNALSYM PEVP_PKEY_CTX} + PEVP_PKEY_CTX = pointer; //This is not defined publically in OpenSSL 1.0.0 + {$EXTERNALSYM PPEVP_PKEY_CTX} + PPEVP_PKEY_CTX = ^PEVP_PKEY_CTX; + {$EXTERNALSYM PEVP_PKEY_ASN1_METHOD} + PEVP_PKEY_ASN1_METHOD = pointer; + {$EXTERNALSYM PEVP_PBE_KEYGEN} + PEVP_PBE_KEYGEN = Pointer;//^EVP_PBE_KEYGEN; + //evp.h + //struct evp_pkey_st + {$EXTERNALSYM PPEVP_PKEY} + PPEVP_PKEY = ^PEVP_PKEY; + {$EXTERNALSYM PEVP_PKEY} + PEVP_PKEY = ^EVP_PKEY; + {$EXTERNALSYM EVP_PKEY_union} + EVP_PKEY_union = record + case byte of + 0: (ptr : PIdAnsiChar); + + {$IFNDEF OPENSSL_NO_RSA} + 1: (rsa : PRSA); // RSA + {$ENDIF} + {$IFNDEF OPENSSL_NO_DSA} + 2: (dsa : PDSA); // DSA + {$ENDIF} + {$IFNDEF OPENSSL_NO_DH} + 3: (dh :PDH); // DH + {$ENDIF} + {$IFNDEF OPENSSL_NO_EC} + 4: (ec : PEC_KEY); // ECC + {$ENDIF} + end; + {$EXTERNALSYM Pevp_pkey_st} + Pevp_pkey_st = PEVP_PKEY; + //this was moved from x509 section so that something here can compile. + {$IFDEF DEBUG_SAFESTACK} + {$EXTERNALSYM STACK_OF_X509_ATTRIBUTE} + STACK_OF_X509_ATTRIBUTE = record + _stack: STACK; + end; + {$EXTERNALSYM PSTACK_OF_X509_ATTRIBUTE} + PSTACK_OF_X509_ATTRIBUTE = ^STACK_OF_X509_ATTRIBUTE; + {$ELSE} + //I think the DECLARE_STACK_OF macro is empty + {$EXTERNALSYM PSTACK_OF_X509_ATTRIBUTE} + PSTACK_OF_X509_ATTRIBUTE = PSTACK; + {$ENDIF} + {$EXTERNALSYM PPSTACK_OF_X509_ATTRIBUTE} + PPSTACK_OF_X509_ATTRIBUTE = ^PSTACK_OF_X509_ATTRIBUTE; + {$EXTERNALSYM EVP_PKEY} + EVP_PKEY = record + _type : TIdC_INT; + save_type : TIdC_INT; + references : TIdC_INT; + ameth : PEVP_PKEY_ASN1_METHOD; + pkey : EVP_PKEY_union; + attributes : PSTACK_OF_X509_ATTRIBUTE; // [ 0 ] + end; + {$EXTERNALSYM PEVP_MD} + PEVP_MD = ^EVP_MD; + {$EXTERNALSYM PEVP_MD_CTX} + PEVP_MD_CTX = ^EVP_MD_CTX; + {$EXTERNALSYM PPEVP_MD_CTX} + PPEVP_MD_CTX = ^PEVP_MD_CTX; + {$EXTERNALSYM EVP_MD_CTX} + EVP_MD_CTX = record + digest : PEVP_MD; + engine : PENGINE; // functional reference if 'digest' is ENGINE-provided + flags : TIdC_ULONG; + md_data : Pointer; + //* Public key context for sign/verify */ + pctx : PEVP_PKEY_CTX; + //* Update function: usually copied from EVP_MD */ +// int (*update)(EVP_MD_CTX *ctx,const void *data,size_t count); + update : function (ctx : PEVP_MD_CTX; const data : Pointer; count : size_t) : TIdC_INT cdecl; + end; + {$EXTERNALSYM EVP_MD_SVCTX} + EVP_MD_SVCTX = record + mctx : PEVP_MD_CTX; + key : Pointer; + end; + {$EXTERNALSYM PEVP_MD_SVCTX} + PEVP_MD_SVCTX = ^EVP_MD_SVCTX; + {$EXTERNALSYM EVP_MD} + EVP_MD = record + _type : TIdC_INT; + pkey_type : TIdC_INT; + md_size : TIdC_INT; + flags : TIdC_ULONG; + init : function (ctx : PEVP_MD_CTX) : TIdC_INT; cdecl; + update : function (ctx : PEVP_MD_CTX; data : Pointer; count : size_t):TIdC_INT; cdecl; + _final : function (ctx : PEVP_MD_CTX; md : PIdAnsiChar) : TIdC_INT; cdecl; + copy : function (_to : PEVP_MD_CTX; from : PEVP_MD_CTX ) : TIdC_INT; cdecl; + cleanup : function(ctx : PEVP_MD_CTX) : TIdC_INT; cdecl; + // FIXME: prototype these some day + sign : function(_type : TIdC_INT; m : PIdAnsiChar; m_length : TIdC_UINT; + sigret : PIdAnsiChar; siglen : TIdC_UINT; key : Pointer) : TIdC_INT; cdecl; + verify : function(_type : TIdC_INT; m : PIdAnsiChar; m_length : PIdAnsiChar; + sigbuf : PIdAnsiChar; siglen : TIdC_UINT; key : Pointer) : TIdC_INT; cdecl; + required_pkey_type : array [0..4] of TIdC_INT; // EVP_PKEY_xxx + block_size : TIdC_INT; + ctx_size : TIdC_INT; // how big does the ctx->md_data need to be + end; + {$EXTERNALSYM PPEVP_CIPHER_CTX} + PPEVP_CIPHER_CTX = ^PEVP_CIPHER_CTX; + {$EXTERNALSYM PEVP_CIPHER_CTX} + PEVP_CIPHER_CTX = ^EVP_CIPHER_CTX; + {$EXTERNALSYM PEVP_CIPHER} + PEVP_CIPHER = ^EVP_CIPHER; + {$EXTERNALSYM EVP_CIPHER} + EVP_CIPHER = record + nid : TIdC_INT; + block_size : TIdC_INT; + key_len : TIdC_INT; // Default value for variable length ciphers + iv_len : TIdC_INT; + flags : TIdC_UINT; // Various flags + init : function (ctx : PEVP_CIPHER_CTX; key : PIdAnsiChar; iv : PIdAnsiChar; enc : TIdC_INT): TIdC_INT; cdecl; + do_cipher : function (ctx : PEVP_CIPHER_CTX; _out : PIdAnsiChar; _in : PIdAnsiChar; inl : size_t) : TIdC_INT; cdecl; + cleanup : function (_para1 : PEVP_CIPHER_CTX): TIdC_INT; cdecl; // cleanup ctx + ctx_size : TIdC_INT; // how big ctx->cipher_data needs to be + set_asn1_parameters : function (_para1 : PEVP_CIPHER_CTX; + _para2 : PASN1_TYPE) : TIdC_INT; cdecl; // Populate a ASN1_TYPE with parameters + get_asn1_parameters :function (_para1 : PEVP_CIPHER_CTX; + _para2 : PASN1_TYPE) : TIdC_INT; cdecl; // Get parameters from a ASN1_TYPE + ctrl : function (_para1 : PEVP_CIPHER_CTX; _type : TIdC_INT; arg : TIdC_INT; + ptr : Pointer): TIdC_INT; cdecl; // Miscellaneous operations + app_data : Pointer; // Application data + end; + {$EXTERNALSYM EVP_CIPHER_CTX} + EVP_CIPHER_CTX = record + cipher : PEVP_CIPHER; + engine : PENGINE; // functional reference if 'cipher' is ENGINE-provided + encrypt: TIdC_INT; // encrypt or decrypt + buf_len : TIdC_INT; // number we have left + oiv : array [0..EVP_MAX_IV_LENGTH-1] of TIdAnsiChar; // original iv + iv : array [0..EVP_MAX_IV_LENGTH -1] of TIdAnsiChar; // working iv + buf : array [0..EVP_MAX_BLOCK_LENGTH -1] of TIdAnsiChar; // saved partial block + num : TIdC_INT; // used by cfb/ofb mode + app_data : Pointer; // application stuff + key_len : TIdC_INT; // May change for variable length cipher + flags : TIdC_ULONG; // Various flags + cipher_data : Pointer; // per EVP data + final_used : TIdC_INT; + block_mask : TIdC_INT; + _final : array [0..EVP_MAX_BLOCK_LENGTH-1] of TIdAnsiChar; // possible final block + end; + {$EXTERNALSYM EVP_CIPHER_INFO} + EVP_CIPHER_INFO = record + cipher : PEVP_CIPHER; + iv : array [0..EVP_MAX_IV_LENGTH -1] of TIdAnsiChar; + end; + {$EXTERNALSYM PEVP_CIPHER_INFO} + PEVP_CIPHER_INFO = ^EVP_CIPHER_INFO; + {$EXTERNALSYM EVP_ENCODE_CTX} + EVP_ENCODE_CTX = record + num : TIdC_INT; // number saved in a partial encode/decode + length: TIdC_INT; // The length is either the output line length + // (in input bytes) or the shortest input line + // length that is ok. Once decoding begins, + // the length is adjusted up each time a longer + // line is decoded + enc_data:array [0..79] of TIdAnsiChar; + line_num: TIdC_INT; // number read on current line + expect_nl: TIdC_INT; + end; + {$EXTERNALSYM PEVP_ENCODE_CTX} + PEVP_ENCODE_CTX = ^EVP_ENCODE_CTX; + //forward declarations from x509.h to make sure this compiles. + {$NODEFINE PX509} + PX509 = ^X509; + {$EXTERNALSYM PPX509} + PPX509 = ^PX509; + {$EXTERNALSYM PX509_CRL} + PX509_CRL = ^X509_CRL; + {$NODEFINE PX509_NAME} + PX509_NAME = ^X509_NAME; + {$EXTERNALSYM PX509_NAME_ENTRY} + PX509_NAME_ENTRY = ^X509_NAME_ENTRY; + {$EXTERNALSYM PX509_REQ} + PX509_REQ = ^X509_REQ; + {$EXTERNALSYM PX509_REQ_INFO} + PX509_REQ_INFO = ^X509_REQ_INFO; + {$EXTERNALSYM PPX509_REQ_INFO} + PPX509_REQ_INFO = ^PX509_REQ_INFO; + {$IFDEF DEBUG_SAFESTACK} + {$EXTERNALSYM STACK_OF_X509_NAME_ENTRY} + STACK_OF_X509_NAME_ENTRY = record + _stack: stack; + end; + {$EXTERNALSYM PSTACK_OF_X509_NAME_ENTRY} + PSTACK_OF_X509_NAME_ENTRY = ^STACK_OF_X509_NAME_ENTRY; + {$EXTERNALSYM STACK_OF_X509_REVOKED} + STACK_OF_X509_REVOKED = record + _stack: stack; + end; + {$EXTERNALSYM PSTACK_OF_X509_REVOKED} + PSTACK_OF_X509_REVOKED = ^STACK_OF_X509_REVOKED; + {$EXTERNALSYM STACK_OF_X509_NAME} + STACK_OF_X509_NAME = record + _stack: STACK; + end; + {$EXTERNALSYM PSTACK_OF_X509_NAME} + PSTACK_OF_X509_NAME = ^STACK_OF_X509_NAME; + {$ELSE} + {$EXTERNALSYM PSTACK_OF_X509_NAME_ENTRY} + PSTACK_OF_X509_NAME_ENTRY = PSTACK; + {$EXTERNALSYM PSTACK_OF_X509_REVOKED} + PSTACK_OF_X509_REVOKED = PSTACK; + {$EXTERNALSYM PSTACK_OF_X509_NAME} + PSTACK_OF_X509_NAME = PSTACK; + {$ENDIF} + {$EXTERNALSYM PPSTACK_OF_X509_REVOKED} + PPSTACK_OF_X509_REVOKED = ^PSTACK_OF_X509_REVOKED; + {$EXTERNALSYM PPX509_NAME} + PPX509_NAME =^PX509_NAME; + {$EXTERNALSYM PPSTACK_OF_X509_NAME} + PPSTACK_OF_X509_NAME = ^PSTACK_OF_X509_NAME; + //pcy_int.h + //Note that anything other than PSTACK should be undefined since the record + //members aren't exposed in the headers. + {$IFDEF DEBUG_SAFESTACK} + {$EXTERNALSYM STACK_OF_X509_POLICY_DATA} + STACK_OF_X509_POLICY_DATA = record + _stack: stack; + end; + {$EXTERNALSYM PSTACK_OF_X509_POLICY_DATA} + PSTACK_OF_X509_POLICY_DATA = ^STACK_OF_X509_POLICY_DATA; + {$EXTERNALSYM STACK_OF_X509_POLICY_REF} + STACK_OF_X509_POLICY_REF = record + _stack: stack; + end; + {$EXTERNALSYM PSTACK_OF_X509_POLICY_REF} + PSTACK_OF_X509_POLICY_REF = ^STACK_OF_X509_POLICY_DATA; + {$EXTERNALSYM STACK_OF_X509_POLICY_NODE} + STACK_OF_X509_POLICY_NODE = record + _stack: stack; + end; + {$EXTERNALSYM PSTACK_OF_X509_POLICY_NODE} + PSTACK_OF_X509_POLICY_NODE = ^STACK_OF_X509_POLICY_NODE; + {$EXTERNALSYM STACK_OF_POLICYQUALINFO} + STACK_OF_POLICYQUALINFO = record + _stack: stack; + end; + {$EXTERNALSYM PSTACK_OF_POLICYQUALINFO} + PSTACK_OF_POLICYQUALINFO = ^STACK_OF_POLICYQUALINFO; + {$ELSE} + //I think the DECLARE_STACK_OF macro is empty + {$EXTERNALSYM PSTACK_OF_X509_POLICY_DATA} + PSTACK_OF_X509_POLICY_DATA = PSTACK; + {$EXTERNALSYM PSTACK_OF_X509_POLICY_REF} + PSTACK_OF_X509_POLICY_REF = PSTACK; + {$EXTERNALSYM PSTACK_OF_X509_POLICY_NODE} + PSTACK_OF_X509_POLICY_NODE = PSTACK; + {$EXTERNALSYM PSTACK_OF_POLICYQUALINFO} + PSTACK_OF_POLICYQUALINFO = PSTACK; + {$ENDIF} + {$IFDEF DEBUG_SAFESTACK} + {$EXTERNALSYM STACK_OF_X509V3_EXT_METHOD} + STACK_OF_X509V3_EXT_METHOD = record + _stack: stack; + end; + {$EXTERNALSYM PSTACK_OF_X509V3_EXT_METHOD} + PSTACK_OF_X509V3_EXT_METHOD = ^STACK_OF_X509V3_EXT_METHOD; + {$ELSE} + //I think the DECLARE_STACK_OF macro is empty + {$EXTERNALSYM PSTACK_OF_X509V3_EXT_METHOD} + PSTACK_OF_X509V3_EXT_METHOD = PSTACK; + {$ENDIF} + {$EXTERNALSYM PPSTACK_OF_X509V3_EXT_METHOD} + PPSTACK_OF_X509V3_EXT_METHOD = ^PSTACK_OF_X509V3_EXT_METHOD; + {$IFDEF DEBUF_SAFESTACK} + {$EXTERNALSYM STACK_OF_X509} + STACK_OF_X509 = record + _stack: STACK; + end; + {$EXTERNALSYM PSTACK_OF_X509} + PSTACK_OF_X509 = ^STACK_OF_X509; + {$ELSE} + //I think the DECLARE_STACK_OF macro is empty + {$EXTERNALSYM PSTACK_OF_X509} + PSTACK_OF_X509 = PSTACK; + {$ENDIF} + {$EXTERNALSYM PPSTACK_OF_X509} + PPSTACK_OF_X509 = ^PSTACK_OF_X509; + //fips.h + //engiene.h + {$IFNDEF OPENSSL_NO_ENGINE} + //* Generic function pointer */ +//typedef int (*ENGINE_GEN_FUNC_PTR)(void); + {$EXTERNALSYM ENGINE_GEN_FUNC_PTR} + ENGINE_GEN_FUNC_PTR = function : TIdC_INT; cdecl; +// typedef int (*ENGINE_GEN_INT_FUNC_PTR)(ENGINE *); + {$EXTERNALSYM ENGINE_GEN_INT_FUNC_PTR} + ENGINE_GEN_INT_FUNC_PTR = function(Para1 : PENGINE) : TIdC_INT; cdecl; +//typedef int (*ENGINE_CTRL_FUNC_PTR)(ENGINE *, int, long, void *, void (*f)(void)); + {$EXTERNALSYM ENGINE_CTRL_FUNC_PTR_F} + ENGINE_CTRL_FUNC_PTR_F = procedure; cdecl; + {$EXTERNALSYM ENGINE_CTRL_FUNC_PTR} + ENGINE_CTRL_FUNC_PTR = function(Para1 : PENGINE; Para2 : TIdC_INT; + Para3 : TIdC_LONG; Para4 : Pointer; f : ENGINE_CTRL_FUNC_PTR_F) : TIdC_Int; cdecl; +//typedef EVP_PKEY * (*ENGINE_LOAD_KEY_PTR)(ENGINE *, const char *, +// UI_METHOD *ui_method, void *callback_data); + {$EXTERNALSYM ENGINE_LOAD_KEY_PTR} + ENGINE_LOAD_KEY_PTR = function(Para1 : PENGINE; Para2 : PIdAnsiChar; + ui_method : PUI_METHOD; callback_data : Pointer) : PEVP_PKEY; cdecl; +//typedef int (*ENGINE_SSL_CLIENT_CERT_PTR)(ENGINE *, SSL *ssl, +// STACK_OF(X509_NAME) *ca_dn, X509 **pcert, EVP_PKEY **pkey, +// STACK_OF(X509) **pother, UI_METHOD *ui_method, void *callback_data); + {$EXTERNALSYM ENGINE_SSL_CLIENT_CERT_PTR} + ENGINE_SSL_CLIENT_CERT_PTR = function(Para1 : PENGINE; ssl : PSSL; + ca_dn : PSTACK_OF_X509_NAME; var pcert : PX509; var pkey : PEVP_PKEY; + var pother : PSTACK_OF_X509; ui_method : PUI_METHOD; callback_data : Pointer) : TIdC_Int; cdecl; +//typedef int (*ENGINE_CIPHERS_PTR)(ENGINE *, const EVP_CIPHER **, const int **, int); + {$EXTERNALSYM ENGINE_CIPHERS_PTR} + ENGINE_CIPHERS_PTR = function(para1 : PENGINE; var para2 : PEVP_CIPHER; var para3 : PIdC_Int; para4 : TIdC_Int) : TIdC_Int; cdecl; +//typedef int (*ENGINE_DIGESTS_PTR)(ENGINE *, const EVP_MD **, const int **, int); + {$EXTERNALSYM ENGINE_DIGESTS_PTR} + ENGINE_DIGESTS_PTR = function(para1 : PENGINE; var Para2 : PEVP_MD; var Para3 : PIdC_INT; para4 : TIdC_INT) : TIdC_INT cdecl; +//typedef int (*ENGINE_PKEY_METHS_PTR)(ENGINE *, EVP_PKEY_METHOD **, const int **, int); + {$EXTERNALSYM ENGINE_PKEY_METHS_PTR} + ENGINE_PKEY_METHS_PTR = function(para1 : PENGINE; var Para2 : PEVP_PKEY_METHOD; var Para3 : PIdC_INT; para4 : TIdC_INT) : TIdC_INT cdecl; +//typedef int (*ENGINE_PKEY_ASN1_METHS_PTR)(ENGINE *, EVP_PKEY_ASN1_METHOD **, const int **, int); + {$EXTERNALSYM ENGINE_PKEY_ASN1_METHS_PTR} + ENGINE_PKEY_ASN1_METHS_PTR = function(para1 : PENGINE; var Para2 : PEVP_PKEY_ASN1_METHOD; var Para3 : PIdC_INT; para4 : TIdC_INT) : TIdC_INT cdecl; +{ +/* When compiling an ENGINE entirely as an external shared library, loadable by + * the "dynamic" ENGINE, these types are needed. The 'dynamic_fns' structure + * type provides the calling application's (or library's) error functionality + * and memory management function pointers to the loaded library. These should + * be used/set in the loaded library code so that the loading application's + * 'state' will be used/changed in all operations. The 'static_state' pointer + * allows the loaded library to know if it shares the same static data as the + * calling application (or library), and thus whether these callbacks need to be + * set or not. */ +} +//typedef void *(*dyn_MEM_malloc_cb)(size_t); + {$EXTERNALSYM dyn_MEM_malloc_cb} + dyn_MEM_malloc_cb = function(para1 : size_t) : Pointer; cdecl; +//typedef void *(*dyn_MEM_realloc_cb)(void *, size_t); + {$EXTERNALSYM dyn_MEM_realloc_cb} + dyn_MEM_realloc_cb = function (para1 : Pointer; para2 : size_t): Pointer; cdecl; +//typedef void (*dyn_MEM_free_cb)(void *); + {$EXTERNALSYM dyn_MEM_free_cb} + dyn_MEM_free_cb = procedure (para1 : Pointer); cdecl; + {$EXTERNALSYM dynamic_MEM_fns} + dynamic_MEM_fns = record + malloc_cb : dyn_MEM_malloc_cb; + realloc_cb : dyn_MEM_realloc_cb; + free_cb : dyn_MEM_free_cb; + end; +///* FIXME: Perhaps the memory and locking code (crypto.h) should declare and use +// * these types so we (and any other dependant code) can simplify a bit?? */ +//typedef void (*dyn_lock_locking_cb)(int,int,const char *,int); + {$EXTERNALSYM dyn_lock_locking_cb} + dyn_lock_locking_cb = procedure (para1, para2 : TIdC_INT; para3 : PIdAnsiChar; para4 : TIdC_INT); cdecl; +//typedef int (*dyn_lock_add_lock_cb)(int*,int,int,const char *,int); + {$EXTERNALSYM dyn_lock_add_lock_cb} + dyn_lock_add_lock_cb = function (var para1 : TIdC_INT; para2, para3 : TIdC_INT; para4 : PIdAnsiChar; para5 : TIdC_INT) : TIdC_INT; cdecl; +//typedef struct CRYPTO_dynlock_value *(*dyn_dynlock_create_cb)( +// const char *,int); + {$EXTERNALSYM dyn_dynlock_create_cb} + dyn_dynlock_create_cb = function (para1 : PIdAnsiChar; para2 : TIdC_INT) : PCRYPTO_dynlock_value; cdecl; +//typedef void (*dyn_dynlock_lock_cb)(int,struct CRYPTO_dynlock_value *, +// const char *,int); + {$EXTERNALSYM dyn_dynlock_lock_cb} + dyn_dynlock_lock_cb = procedure (para1 : TIdC_INT; para2 : PCRYPTO_dynlock_value); cdecl; +//typedef void (*dyn_dynlock_destroy_cb)(struct CRYPTO_dynlock_value *, +// const char *,int); + {$EXTERNALSYM dyn_dynlock_destroy_cb} + dyn_dynlock_destroy_cb = procedure(para1 : PCRYPTO_dynlock_value; para2 : PIdAnsiChar; para3 : TIdC_INT); cdecl; +//typedef struct st_dynamic_LOCK_fns { +// dyn_lock_locking_cb lock_locking_cb; +// dyn_lock_add_lock_cb lock_add_lock_cb; +// dyn_dynlock_create_cb dynlock_create_cb; +// dyn_dynlock_lock_cb dynlock_lock_cb; +// dyn_dynlock_destroy_cb dynlock_destroy_cb; +// } dynamic_LOCK_fns; + {$EXTERNALSYM dynamic_LOCK_fns} + dynamic_LOCK_fns = record + lock_locking_cb : dyn_lock_locking_cb; + lock_add_lock_cb : dyn_lock_add_lock_cb; + dynlock_create_cb : dyn_dynlock_create_cb; + dynlock_lock_cb : dyn_dynlock_lock_cb; + dynlock_destroy_cb : dyn_dynlock_destroy_cb; + end; +//* The top-level structure */ + {$EXTERNALSYM dynamic_fns} + dynamic_fns = record + static_state : Pointer; + err_fns : PERR_FNS; + ex_data_fns : PCRYPTO_EX_DATA_IMPL; + mem_fns : dynamic_MEM_fns; + lock_fns : dynamic_LOCK_fns; + end; +// typedef unsigned long (*dynamic_v_check_fn)(unsigned long ossl_version); + {$EXTERNALSYM dynamic_v_check_fn} + dynamic_v_check_fn = function(ossl_version : TIdC_ULONG) : TIdC_ULONG; cdecl; +//typedef int (*dynamic_bind_engine)(ENGINE *e, const char *id, +// const dynamic_fns *fns); + {$EXTERNALSYM dynamic_bind_engine} + dynamic_bind_engine = function(e : PENGINE; id : PIdAnsiChar; fns : dynamic_fns) : TIdC_INT; cdecl; + {$ENDIF} + //ecdsa.h + {$IFNDEF OPENSSL_NO_ECDSA} + {$EXTERNALSYM ECDSA_SIG} + ECDSA_SIG = record + r : PBIGNUM; + s : PBIGNUM; + end; + {$EXTERNALSYM PECDSA_SIG} + PECDSA_SIG = ^ECDSA_SIG; + {$EXTERNALSYM PPECDSA_SIG} + PPECDSA_SIG = ^PECDSA_SIG; +// ECDH_METHOD = record + //defined interally, not through the header so use function to access members + // end; + {$EXTERNALSYM PECDH_METHOD} + PECDH_METHOD = Pointer;//^ECDH_METHOD; + {$EXTERNALSYM PPECDH_METHOD} + PPECDH_METHOD = ^PECDH_METHOD; + {$ENDIF} + //ecdh.h + //aes.h + {$IFNDEF OPENSSL_NO_AES} + {$IFDEF OPENSSL_FIPS} + {$EXTERNALSYM FIPS_AES_SIZE_T} + FIPS_AES_SIZE_T = TIdC_INT; + {$ENDIF} + //OpenSSL Developer's note + // This should be a hidden type, but EVP requires that the size be known + {$EXTERNALSYM AES_KEY} + AES_KEY = record + rd_key: array[0..(4 *(AES_MAXNR + 1)-1)] of TIdC_UINT; + rounds : TIdC_INT; + end; + {$EXTERNALSYM PAES_KEY} + PAES_KEY = ^AES_KEY; + {$EXTERNALSYM PPAES_KEY} + PPAES_KEY = ^PAES_KEY; + {$ENDIF} + //seed.h + {$IFNDEF OPENSSL_NO_SEED} + {$EXTERNALSYM SEED_KEY_SCHEDULE} + SEED_KEY_SCHEDULE = record + {$IFDEF SEED_LONG} + data : array [0..(32 -1)] of TIdC_ULONG ; + {$ELSE} + data : array[0..(32-1)] of TIdC_UINT; + {$ENDIF} + end; + {$EXTERNALSYM PSEED_KEY_SCHEDULE} + PSEED_KEY_SCHEDULE = ^SEED_KEY_SCHEDULE; + {$ENDIF} + //lhash.h + {$EXTERNALSYM PLHASH_NODE} + PLHASH_NODE = ^LHASH_NODE; + {$EXTERNALSYM PPLHASH_NODE} + PPLHASH_NODE = ^PLHASH_NODE; + {$EXTERNALSYM LHASH_NODE} + LHASH_NODE = record + data : Pointer; + next : PLHASH_NODE; + {$IFNDEF OPENSSL_NO_HASH_COMP} + hash : TIdC_ULONG; + {$ENDIF} + end; + {$EXTERNALSYM LHASH_COMP_FN_TYPE} + LHASH_COMP_FN_TYPE = function (const p1,p2 : Pointer) : TIdC_INT; cdecl; + {$EXTERNALSYM PLHASH_COMP_FN_TYPE} + PLHASH_COMP_FN_TYPE = ^LHASH_COMP_FN_TYPE; + {$EXTERNALSYM LHASH_HASH_FN_TYPE} + LHASH_HASH_FN_TYPE = function(const p1 : Pointer) : TIdC_ULONG; cdecl; + {$EXTERNALSYM LHASH_DOALL_FN_TYPE} + LHASH_DOALL_FN_TYPE = procedure(p1 : Pointer); cdecl; + {$EXTERNALSYM LHASH_DOALL_ARG_FN_TYPE} + LHASH_DOALL_ARG_FN_TYPE = procedure(p1, p2 : Pointer); cdecl; + {$EXTERNALSYM LHASH} + LHASH = record + b : PPLHASH_NODE; + comp : LHASH_COMP_FN_TYPE; + hash : LHASH_HASH_FN_TYPE; + num_nodes : TIdC_UINT; + num_alloc_nodes : TIdC_UINT; + p : TIdC_UINT; + pmax : TIdC_UINT; + up_load : TIdC_ULONG; // load times 256 + down_load : TIdC_ULONG; // load times 256 + num_items : TIdC_ULONG; + num_expands : TIdC_ULONG; + num_expand_reallocs : TIdC_ULONG; + num_contracts : TIdC_ULONG; + num_contract_reallocs : TIdC_ULONG; + num_hash_calls : TIdC_ULONG; + num_comp_calls : TIdC_ULONG; + num_insert : TIdC_ULONG; + num_replace : TIdC_ULONG; + num_delete : TIdC_ULONG; + num_no_delete : TIdC_ULONG; + num_retrieve : TIdC_ULONG; + num_retrieve_miss : TIdC_ULONG; + num_hash_comps : TIdC_ULONG; + error : TIdC_INT; + end; + {$EXTERNALSYM PLHASH} + PLHASH = ^LHASH; + //conf.h + {$EXTERNALSYM CONF_VALUE} + CONF_VALUE = record + section : PIdAnsiChar; + name : PIdAnsiChar; + value : PIdAnsiChar; + end; + {$EXTERNALSYM PCONF_VALUE} + PCONF_VALUE = ^CONF_VALUE; + {$IFDEF DEBUG_SAFESTACK} + {$EXTERNALSYM STACK_OF_CONF_VALUE} + STACK_OF_CONF_VALUE = record + stack: stack; + end; + {$EXTERNALSYM PSTACK_OF_CONF_VALUE} + PSTACK_OF_CONF_VALUE = ^STACK_OF_CONF_VALUE; + {$ELSE} + //I think the DECLARE_STACK_OF macro is empty + {$EXTERNALSYM PSTACK_OF_CONF_VALUE} + PSTACK_OF_CONF_VALUE = PSTACK; + {$ENDIF} + {$EXTERNALSYM BIT_STRING_BITNAME} + //* This is used to contain a list of bit names */ + BIT_STRING_BITNAME = record + bitnum : TIdC_INT; + lname : PIdAnsiChar; + sname : PIdAnsiChar; + end; + {$EXTERNALSYM PBIT_STRING_BITNAME} + PBIT_STRING_BITNAME = ^BIT_STRING_BITNAME; + {$EXTERNALSYM PPBIT_STRING_BITNAME} + PPBIT_STRING_BITNAME = ^PBIT_STRING_BITNAME; + {$EXTERNALSYM buf_mem_st} + buf_mem_st = record + length : TIdC_INT; // current number of bytes + data : PIdAnsiChar; + max: TIdC_INT; // size of buffer + end; + {$EXTERNALSYM BUF_MEM} + BUF_MEM = buf_mem_st; + {$EXTERNALSYM PBUF_MEM} + PBUF_MEM = ^BUF_MEM; + {$EXTERNALSYM PPBUF_MEM} + PPBUF_MEM = ^PBUF_MEM; + {$EXTERNALSYM PFILE} + PFILE = Pointer; + //asn1t.h + {$EXTERNALSYM ASN1_TEMPLATE} + ASN1_TEMPLATE = record + flags : TIdC_ULONG; // Various flags + tag : TIdC_LONG; // tag, not used if no tagging + offset : TIdC_ULONG; // Offset of this field in structure + {$IFNDEF NO_ASN1_FIELD_NAMES} + field_name : PIdAnsiChar; // Field name + {$ENDIF} + item : PASN1_ITEM_EXP; // Relevant ASN1_ITEM or ASN1_ADB + end; + {$EXTERNALSYM PASN1_TEMPLATE} + PASN1_TEMPLATE = ^ASN1_TEMPLATE; + {$EXTERNALSYM ASN1_ITEM} + ASN1_ITEM = record + itype : Char; // The item type, primitive, SEQUENCE, CHOICE or extern + utype : TIdC_LONG; // underlying type + templates : PASN1_TEMPLATE; // If SEQUENCE or CHOICE this contains the contents + tcount : TIdC_LONG; // Number of templates if SEQUENCE or CHOICE + funcs : Pointer; // functions that handle this type + size : TIdC_LONG; // Structure size (usually) + {$IFNDEF NO_ASN1_FIELD_NAMES} + sname : PIdAnsiChar; // Structure name + {$ENDIF} + end; + {$EXTERNALSYM PASN1_PCTX} + PASN1_PCTX = Pointer; + {$IFDEF DEBUG_SAFESTACK} + {$EXTERNALSYM STACK_OF_ASN1_ADB_TABLE} + STACK_OF_ASN1_ADB_TABLE = record + stack: stack; + end; + {$EXTERNALSYM PSTACK_OF_ASN1_ADB_TABLE} + PSTACK_OF_ASN1_ADB_TABLE = ^STACK_OF_ASN1_ADB_TABLE; + {$ELSE} + //I think the DECLARE_STACK_OF macro is empty + {$EXTERNALSYM PSTACK_OF_ASN1_ADB_TABLE} + PSTACK_OF_ASN1_ADB_TABLE = PSTACK; + {$ENDIF} + {$EXTERNALSYM PPSTACK_OF_ASN1_ADB_TABLE} + PPSTACK_OF_ASN1_ADB_TABLE = ^PSTACK_OF_ASN1_ADB_TABLE; + {$EXTERNALSYM PASN1_ADB_TABLE} + PASN1_ADB_TABLE = ^ASN1_ADB_TABLE; + {$EXTERNALSYM PASN1_ADB} + PASN1_ADB = ^ASN1_ADB; + {$EXTERNALSYM ASN1_ADB} + ASN1_ADB = record + flags : TIdC_ULONG; // Various flags + offset : TIdC_ULONG; // Offset of selector field + app_items : PPSTACK_OF_ASN1_ADB_TABLE; // Application defined items + tbl : PASN1_ADB_TABLE; // Table of possible types + tblcount : TIdC_LONG; // Number of entries in tbl + default_tt : PASN1_TEMPLATE; // Type to use if no match + null_tt : PASN1_TEMPLATE; // Type to use if selector is NULL + end; + {$EXTERNALSYM ASN1_ADB_TABLE} + ASN1_ADB_TABLE = record + flags : TIdC_LONG; // Various flags + offset : TIdC_LONG; // Offset of selector field + app_items : PPSTACK_OF_ASN1_ADB_TABLE; // Application defined items + tbl : PASN1_ADB_TABLE; // Table of possible types + tblcount : TIdC_LONG; // Number of entries in tbl + default_tt : PASN1_TEMPLATE; // Type to use if no match + null_tt : PASN1_TEMPLATE; // Type to use if selector is NULL + end; + {$EXTERNALSYM PASN1_TLC} + PASN1_TLC = ^ASN1_TLC; + {$EXTERNALSYM ASN1_TLC} + ASN1_TLC = record + valid : Byte; //* Values below are valid */ + ret : TIdC_INT; //* return value */ + plen : TIdC_LONG; //* length */ + ptag : TIdC_INT; //* class value */ + pclass : TIdC_INT; //* class value */ + hdrlen : TIdC_INT; //* header length */ + end; + ///* Typedefs for ASN1 function pointers */ + {$EXTERNALSYM ASN1_new_func} + ASN1_new_func = function : PASN1_VALUE; cdecl; + {$EXTERNALSYM ASN1_free_func} + ASN1_free_func = procedure (a : PASN1_VALUE); cdecl; +// typedef ASN1_VALUE * ASN1_d2i_func(ASN1_VALUE **a, const unsigned char ** in, long length); + {$EXTERNALSYM ASN1_d2i_func} + ASN1_d2i_func = function (a : PASN1_VALUE; _in : PPByte; length : TIdC_LONG ) : PASN1_VALUE; cdecl; + // typedef int ASN1_i2d_func(ASN1_VALUE * a, unsigned char **in); + {$EXTERNALSYM ASN1_i2d_func} + ASN1_i2d_func = function (a : PASN1_VALUE; _in : PPByte) : TIdC_INT; cdecl; +// typedef int ASN1_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len, const ASN1_ITEM *it, +// int tag, int aclass, char opt, ASN1_TLC *ctx); + {$EXTERNALSYM ASN1_ex_d2i} + ASN1_ex_d2i = function(pval : PPASN1_VALUE; _in : PPByte; len : TIdC_LONG; + it : PASN1_ITEM; tag, aclass : TIdC_INT; opt : Byte; + ctx : PASN1_TLC) : TIdC_INT; cdecl; +//typedef int ASN1_ex_i2d(ASN1_VALUE **pval, unsigned char **out, const ASN1_ITEM *it, int tag, int aclass); + {$EXTERNALSYM ASN1_ex_i2d} + ASN1_ex_i2d = function(pval : PPASN1_VALUE; _out : PPByte; it : PASN1_ITEM; tag, aclass : TIdC_INT) : TIdC_INT; cdecl; +//typedef int ASN1_ex_new_func(ASN1_VALUE **pval, const ASN1_ITEM *it); + {$EXTERNALSYM ASN1_ex_new_func} + ASN1_ex_new_func = function(pval : PPASN1_VALUE; it : PASN1_ITEM) : TIdC_INT; cdecl; +//typedef void ASN1_ex_free_func(ASN1_VALUE **pval, const ASN1_ITEM *it); + {$EXTERNALSYM ASN1_ex_free_func} + ASN1_ex_free_func = procedure( pval : PPASN1_VALUE; it : PASN1_ITEM); cdecl; +//typedef int ASN1_primitive_i2c(ASN1_VALUE **pval, unsigned char *cont, int *putype, const ASN1_ITEM *it); + {$EXTERNALSYM ASN1_primitive_i2c} + ASN1_primitive_i2c = function (pval : PPASN1_VALUE; cont : PByte; putype : PIdC_INT; it : PASN1_ITEM ) : TIdC_INT; cdecl; +//typedef int ASN1_primitive_c2i(ASN1_VALUE **pval, const unsigned char *cont, int len, int utype, char *free_cont, const ASN1_ITEM *it); + {$EXTERNALSYM ASN1_primitive_c2i} + ASN1_primitive_c2i = function (pval : PPASN1_VALUE; cont : PByte; len, utype : TIdC_INT; free_cont : PByte; it: PASN1_ITEM) : TIdC_INT; cdecl; + ///* end typedefs + {$EXTERNALSYM ASN1_COMPAT_FUNCS} + ASN1_COMPAT_FUNCS = record + asn1_new : ASN1_new_func; + asn1_free : ASN1_free_func; + asn1_d2i : ASN1_d2i_func; + asn1_i2d : ASN1_i2d_func; + end; + {$EXTERNALSYM PASN1_COMPAT_FUNCS} + PASN1_COMPAT_FUNCS = ^ASN1_COMPAT_FUNCS; + {$EXTERNALSYM ASN1_EXTERN_FUNCS} + ASN1_EXTERN_FUNCS = record + app_data : Pointer; + asn1_ex_new : ASN1_ex_new_func; // ASN1_ex_new_func *asn1_ex_new; + asn1_ex_free : ASN1_ex_free_func; // ASN1_ex_free_func *asn1_ex_free; + asn1_ex_clear: ASN1_ex_free_func;// ASN1_ex_free_func *asn1_ex_clear; + asn1_ex_d2i : ASN1_ex_d2i;// ASN1_ex_d2i *asn1_ex_d2i; + asn1_ex_i2d : ASN1_ex_i2d; // ASN1_ex_i2d *asn1_ex_i2d; + end; + {$EXTERNALSYM PASN1_EXTERN_FUNCS} + PASN1_EXTERN_FUNCS = ^ASN1_EXTERN_FUNCS; + {$EXTERNALSYM ASN1_PRIMITIVE_FUNCS} + ASN1_PRIMITIVE_FUNCS = record + app_data : Pointer; + flags : TIdC_ULONG; +// ASN1_ex_new_func *prim_new; + prim_new : ASN1_ex_new_func; +// ASN1_ex_free_func *prim_free; + prim_free : ASN1_ex_free_func; +// ASN1_ex_free_func *prim_clear; + prim_clear : ASN1_ex_free_func; +// ASN1_primitive_c2i *prim_c2i; + prim_c2i : ASN1_primitive_c2i; +// ASN1_primitive_i2c *prim_i2c; + prim_i2c : ASN1_primitive_i2c; + end; + {$EXTERNALSYM PASN1_PRIMITIVE_FUNCS} + PASN1_PRIMITIVE_FUNCS = ^ASN1_PRIMITIVE_FUNCS; +//typedef int ASN1_aux_cb(int operation, ASN1_VALUE **in, const ASN1_ITEM *it); + {$EXTERNALSYM ASN1_aux_cb} + ASN1_aux_cb = function (operation : TIdC_INT; _in : PPASN1_VALUE; it : PASN1_ITEM) : TIdC_INT; cdecl; + {$EXTERNALSYM ASN1_AUX} + ASN1_AUX = record + app_data : Pointer; + flags : TIdC_INT; + ref_offset : TIdC_INT; //* Offset of reference value */ + ref_lock : TIdC_INT; //* Lock type to use */ + asn1_cb : ASN1_aux_cb; //ASN1_aux_cb *asn1_cb; + enc_offset : TIdC_INT; //* Offset of ASN1_ENCODING structure */ + end; + {$EXTERNALSYM PASN1_AUX} + PASN1_AUX = ^ASN1_AUX; + //hmac.h + //This has to come after the EVP definitions + {$IFNDEF OPENSSL_NO_HMAC} + {$EXTERNALSYM HMAC_CTX} + HMAC_CTX = record + md : PEVP_MD; + md_ctx : EVP_MD_CTX; + i_ctx : EVP_MD_CTX; + o_ctx : EVP_MD_CTX; + key_length : TIdC_UINT; + key : array[0..(HMAC_MAX_MD_CBLOCK - 1)] of byte; + end; + {$EXTERNALSYM PHMAC_CTX} + PHMAC_CTX = ^HMAC_CTX; + {$EXTERNALSYM PPHMAC_CTX} + PPHMAC_CTX = ^PHMAC_CTX; + {$ENDIF} + // X509_POLICY_DATA = record + // end; + {$EXTERNALSYM PX509_POLICY_DATA} + PX509_POLICY_DATA = Pointer;//^X509_POLICY_DATA; + // X509_POLICY_REF = record + // end; + {$EXTERNALSYM PX509_POLICY_REF} + PX509_POLICY_REF = Pointer;//^X509_POLICY_REF; + // X509_POLICY_CACHE = record + // end; + {$EXTERNALSYM PX509_POLICY_CACHE} + PX509_POLICY_CACHE = Pointer; //^X509_POLICY_CACHE; + //x509v3.h + {$EXTERNALSYM PPX509_NAME_ENTRY} + PPX509_NAME_ENTRY = ^PX509_NAME_ENTRY; + //forward declarations + {$EXTERNALSYM PV3_EXT_METHOD} + PV3_EXT_METHOD = ^V3_EXT_METHOD; + {$EXTERNALSYM PV3_EXT_CTX} + PV3_EXT_CTX = ^V3_EXT_CTX; + // + {$EXTERNALSYM X509V3_EXT_NEW} + X509V3_EXT_NEW = function: Pointer; cdecl; + {$EXTERNALSYM X509V3_EXT_FREE} + X509V3_EXT_FREE = procedure(_para1 : Pointer); cdecl; + {$EXTERNALSYM X509V3_EXT_D2I} + X509V3_EXT_D2I = function(_para1 : Pointer; const _para2 : PPIdAnsiChar; para3 : TIdC_LONG): Pointer; cdecl; + {$EXTERNALSYM X509V3_EXT_I2D} + X509V3_EXT_I2D = function (_para1 : Pointer; _para2 : PPIdAnsiChar) : TIdC_INT; cdecl; + {$EXTERNALSYM X509V3_EXT_I2V} + X509V3_EXT_I2V = function (method : PV3_EXT_METHOD; ext : Pointer; extlist : PSTACK_OF_CONF_VALUE) : PSTACK_OF_CONF_VALUE; cdecl; + {$EXTERNALSYM X509V3_EXT_V2I} + X509V3_EXT_V2I = function (method : Pv3_ext_method; ctx : PV3_EXT_CTX; values : PSTACK_OF_CONF_VALUE): Pointer; cdecl; + {$EXTERNALSYM X509V3_EXT_I2S} + X509V3_EXT_I2S = function (method : Pv3_ext_method; ext : Pointer) : PIdAnsiChar; cdecl; + {$EXTERNALSYM X509V3_EXT_S2I} + X509V3_EXT_S2I = function (method : Pv3_ext_method; ctx : Pv3_ext_ctx; const str : PIdAnsiChar): Pointer; cdecl; + {$EXTERNALSYM X509V3_EXT_I2R} + X509V3_EXT_I2R = function (method : Pv3_ext_method; ext : Pointer; _out : PBIO; indent : TIdC_INT) : TIdC_INT; cdecl; + {$EXTERNALSYM X509V3_EXT_R2I} + X509V3_EXT_R2I = function (method : Pv3_ext_method; ctx : Pv3_ext_ctx; const str : PIdAnsiChar): Pointer; cdecl; + {$EXTERNALSYM V3_EXT_METHOD} + V3_EXT_METHOD = record + ext_nid : TIdC_INT; + ext_flags : TIdC_INT; + // If this is set the following four fields are ignored + // I'm not sure what the ASN1_ITEM_EXP really is. The headers don't make it clear, JPM. + it : PASN1_ITEM_EXP; + // Old style ASN1 calls + ext_new : X509V3_EXT_NEW; + ext_free : X509V3_EXT_FREE; + d2i : X509V3_EXT_D2I; + i2d : X509V3_EXT_I2D; + // The following pair is used for string extensions + i2s : X509V3_EXT_I2S; + s2i : X509V3_EXT_S2I; + // The following pair is used for multi-valued extensions + i2v : X509V3_EXT_I2V; + v2i : X509V3_EXT_V2I; + // The following are used for raw extensions + i2r : X509V3_EXT_I2R; + r2i : X509V3_EXT_R2I; + usr_data : Pointer; // Any extension specific data + end; + {$EXTERNALSYM X509V3_EXT_METHOD} + X509V3_EXT_METHOD = V3_EXT_METHOD; + {$EXTERNALSYM X509V3_CONF_METHOD} + X509V3_CONF_METHOD = record + get_string : function(db : Pointer; section, value : PIdAnsiChar) : PIdAnsiChar; cdecl; + get_section : function(db : Pointer; section : PIdAnsiChar) : PSTACK_OF_CONF_VALUE; cdecl; + free_string : procedure(db : Pointer; _string : PIdAnsiChar); cdecl; + free_section : procedure (db : Pointer; section : PSTACK_OF_CONF_VALUE); + end; + {$EXTERNALSYM V3_EXT_CTX} + V3_EXT_CTX = record + flags : TIdC_INT; + issuer_cert : PX509; + subject_cert : PX509; + subject_req : PX509_REQ; + crl : PX509_CRL; + db_meth : X509V3_CONF_METHOD; + db : Pointer; + // OpenSSL developer's message from header + // Maybe more here + end; + {$EXTERNALSYM ENUMERATED_NAMES} + ENUMERATED_NAMES = BIT_STRING_BITNAME; + {$EXTERNALSYM BASIC_CONSTRAINTS} + BASIC_CONSTRAINTS = record + ca : TIdC_INT; + pathlen: PASN1_INTEGER; + end; + {$EXTERNALSYM PBASIC_CONSTRAINTS} + PBASIC_CONSTRAINTS = ^BASIC_CONSTRAINTS; + {$EXTERNALSYM PKEY_USAGE_PERIOD} + PKEY_USAGE_PERIOD = record + notBefore : ASN1_GENERALIZEDTIME; + notAfter : PASN1_GENERALIZEDTIME; + end; + {$EXTERNALSYM PPKEY_USAGE_PERIOD} + PPKEY_USAGE_PERIOD = ^PKEY_USAGE_PERIOD; + {$EXTERNALSYM OTHERNAME} + OTHERNAME = record + type_id : PASN1_OBJECT; + value : PASN1_TYPE; + end; + {$EXTERNALSYM POTHERNAME} + POTHERNAME = ^OTHERNAME; + {$EXTERNALSYM EDIPARTYNAME} + EDIPARTYNAME = record + nameAssigner : PASN1_STRING; + partyName : PASN1_STRING; + end; + {$EXTERNALSYM PEDIPARTYNAME} + PEDIPARTYNAME = ^EDIPARTYNAME; + {$EXTERNALSYM GENERAL_NAME_union} + GENERAL_NAME_union = record + case byte of + 0 : (ptr : PIdAnsiChar); + 1 : (otherName : POTHERNAME); // otherName + 2 : (rfc822Name : PASN1_IA5STRING); + 3 : (dNSName : PASN1_IA5STRING); + 4 : (x400Address : PASN1_TYPE); + 5 : (directoryName : PX509_NAME); + 6 : (ediPartyName : PEDIPARTYNAME); + 7 : (uniformResourceIdentifier : PASN1_IA5STRING); + 8 : (iPAddress : PASN1_OCTET_STRING); + 9 : (registeredID : PASN1_OBJECT); + // Old names + 10 : (ip : PASN1_OCTET_STRING); // iPAddress + 11 : (dirn : PX509_NAME); // dirn + 12 : (ia5 : PASN1_IA5STRING); // rfc822Name, dNSName, uniformResourceIdentifier + 13 : (rid : ASN1_OBJECT); // registeredID + 14 : (other : PASN1_TYPE); // x400Address + end; + {$EXTERNALSYM GENERAL_NAME} + GENERAL_NAME = record + _type : TIdC_INT; + d : GENERAL_NAME_union; + end; + {$EXTERNALSYM PGENERAL_NAME} + PGENERAL_NAME = ^GENERAL_NAME; + {$IFDEF DEBUG_SAFESTACK} + {$EXTERNALSYM STACK_OF_GENERAL_NAME} + STACK_OF_GENERAL_NAME = record + _stack: stack; + end; + {$EXTERNALSYM PSTACK_OF_GENERAL_NAME} + PSTACK_OF_GENERAL_NAME = ^STACK_OF_GENERAL_NAME; + {$ELSE} + //I think the DECLARE_STACK_OF macro is empty + {$EXTERNALSYM PSTACK_OF_GENERAL_NAME} + PSTACK_OF_GENERAL_NAME = PSTACK; + {$ENDIF} + {$EXTERNALSYM PGENERAL_NAMES} + PGENERAL_NAMES = PSTACK_OF_GENERAL_NAME; + {$EXTERNALSYM ACCESS_DESCRIPTION} + ACCESS_DESCRIPTION = record + method : PASN1_OBJECT; + location : PGENERAL_NAME; + end; + {$EXTERNALSYM PACCESS_DESCRIPTION} + PACCESS_DESCRIPTION = ^ACCESS_DESCRIPTION; + {$IFDEF DEBUG_SAFESTACK} + {$EXTERNALSYM STACK_OF_ACCESS_DESCRIPTION} + STACK_OF_ACCESS_DESCRIPTION = record + _stack: stack; + end; + {$EXTERNALSYM PSTACK_OF_ACCESS_DESCRIPTION} + PSTACK_OF_ACCESS_DESCRIPTION = ^STACK_OF_ACCESS_DESCRIPTION; + {$ELSE} + //I think the DECLARE_STACK_OF macro is empty + {$EXTERNALSYM PSTACK_OF_ACCESS_DESCRIPTION} + PSTACK_OF_ACCESS_DESCRIPTION = PSTACK; + {$ENDIF} + {$EXTERNALSYM PAUTHORITY_INFO_ACCESS} + PAUTHORITY_INFO_ACCESS = PSTACK_OF_ACCESS_DESCRIPTION; + {$EXTERNALSYM PEXTENDED_KEY_USAGE} + PEXTENDED_KEY_USAGE = PSTACK_OF_ASN1_OBJECT; + {$EXTERNALSYM DIST_POINT_NAME_union} + DIST_POINT_NAME_union = record + case byte of + 0 : (fullname : PGENERAL_NAMES); + 1 : (relativename : PSTACK_OF_X509_NAME_ENTRY); + end; + {$EXTERNALSYM DIST_POINT_NAME} + DIST_POINT_NAME = record + _type : TIdC_INT; + name : DIST_POINT_NAME_union; + end; + {$EXTERNALSYM PDIST_POINT_NAME} + PDIST_POINT_NAME = ^DIST_POINT_NAME; + {$EXTERNALSYM DIST_POINT} + DIST_POINT = record + distpoint : PDIST_POINT_NAME; + reasons : PASN1_BIT_STRING; + CRLissuer : PGENERAL_NAMES; + dp_reasons : TIdC_INT; + end; + {$IFDEF DEBUG_SAFESTACK} + {$EXTERNALSYM STACK_OF_DIST_POINT} + STACK_OF_DIST_POINT = record + _stack: stack; + end; + {$EXTERNALSYM PSTACK_OF_DIST_POINT} + PSTACK_OF_DIST_POINT = ^STACK_OF_DIST_POINT; + {$ELSE} + //I think the DECLARE_STACK_OF macro is empty + {$EXTERNALSYM PSTACK_OF_DIST_POINT} + PSTACK_OF_DIST_POINT = PSTACK; + {$ENDIF} + {$EXTERNALSYM AUTHORITY_KEYID} + AUTHORITY_KEYID = record + keyid : PASN1_OCTET_STRING; + issuer : PGENERAL_NAMES; + serial : PASN1_INTEGER; + end; + {$EXTERNALSYM PAUTHORITY_KEYID} + PAUTHORITY_KEYID = ^AUTHORITY_KEYID; + // Strong extranet structures + {$EXTERNALSYM SXNETID} + SXNETID = record + zone : PASN1_INTEGER; + user : PASN1_OCTET_STRING; + end; + {$EXTERNALSYM PSXNETID} + PSXNETID = ^SXNETID; + {$IFDEF DEBUG_SAFESTACK} + {$EXTERNALSYM STACK_OF_SXNETID} + STACK_OF_SXNETID = record + _stack: stack; + end; + {$EXTERNALSYM PSTACK_OF_SXNETID} + PSTACK_OF_SXNETID = ^STACK_OF_SXNETID; + {$ELSE} + //I think the DECLARE_STACK_OF macro is empty + {$EXTERNALSYM PSTACK_OF_SXNETID} + PSTACK_OF_SXNETID = PSTACK; + {$ENDIF} + {$EXTERNALSYM SXNET} + SXNET = record + version : PASN1_INTEGER; + ids : PSTACK_OF_SXNETID; + end; + {$EXTERNALSYM PSXNET} + PSXNET = ^SXNET; + {$EXTERNALSYM NOTICEREF} + NOTICEREF = record + organization : PASN1_STRING; + noticenos : PSTACK_OF_ASN1_INTEGER; + end; + {$EXTERNALSYM PNOTICEREF} + PNOTICEREF = ^NOTICEREF; + {$EXTERNALSYM USERNOTICE} + USERNOTICE = record + noticeref : PNOTICEREF; + exptext : PASN1_STRING; + end; + {$EXTERNALSYM PUSERNOTICE} + PUSERNOTICE = ^USERNOTICE; + {$EXTERNALSYM POLICYQUALINFO_union} + POLICYQUALINFO_union = record + case byte of + 0 : (cpsuri : PASN1_IA5STRING); + 1 : (usernotice : PUSERNOTICE); + 2 : (other : PASN1_TYPE); + end; + {$EXTERNALSYM POLICYQUALINFO} + POLICYQUALINFO = record + pqualid : PASN1_OBJECT; + d : POLICYQUALINFO_union; + end; + {$EXTERNALSYM PPOLICYQUALINFO} + PPOLICYQUALINFO = ^POLICYQUALINFO; + {$IFDEF DEBUG_SAFESTACK} + {$EXTERNALSYM STACK_OF_POLICYINFO} + STACK_OF_POLICYINFO = record + _stack: stack; + end; + {$EXTERNALSYM PSTACK_OF_POLICYINFO} + PSTACK_OF_POLICYINFO = ^STACK_OF_POLICYINFO; + {$ELSE} + {$EXTERNALSYM PSTACK_OF_POLICYINFO} + PSTACK_OF_POLICYINFO = PSTACK; + {$ENDIF} + {$EXTERNALSYM POLICYINFO} + POLICYINFO = record + policyid : PASN1_OBJECT; + qualifiers : PSTACK_OF_POLICYQUALINFO; + end; + {$EXTERNALSYM CERTIFICATEPOLICIES} + CERTIFICATEPOLICIES = PSTACK_OF_POLICYINFO; + //typedef STACK_OF(POLICYINFO) CERTIFICATEPOLICIES; + {$EXTERNALSYM POLICY_MAPPING} + POLICY_MAPPING = record + issuerDomainPolicy : PASN1_OBJECT; + subjectDomainPolicy : PASN1_OBJECT; + end; + {$EXTERNALSYM PPOLICY_MAPPING} + PPOLICY_MAPPING = ^POLICY_MAPPING; + {$IFDEF DEBUG_SAFESTACK} + {$EXTERNALSYM STACK_OF_POLICY_MAPPING} + STACK_OF_POLICY_MAPPING = record + _stack: stack; + end; + {$EXTERNALSYM PSTACK_OF_POLICY_MAPPING} + PSTACK_OF_POLICY_MAPPING = ^STACK_OF_POLICY_MAPPING; + {$ELSE} + //I think the DECLARE_STACK_OF macro is empty + {$EXTERNALSYM PSTACK_OF_POLICY_MAPPING} + PSTACK_OF_POLICY_MAPPING = PSTACK; + {$ENDIF} + {$EXTERNALSYM PPSTACK_OF_POLICY_MAPPING} + PPSTACK_OF_POLICY_MAPPING = ^PSTACK_OF_POLICY_MAPPING; + {$EXTERNALSYM GENERAL_SUBTREE} + GENERAL_SUBTREE = record + base : PGENERAL_NAME; + minimum : PASN1_INTEGER; + maximum : PASN1_INTEGER; + end; + {$EXTERNALSYM PGENERAL_SUBTREE} + PGENERAL_SUBTREE = ^GENERAL_SUBTREE; + {$IFDEF DEBUG_SAFESTACK} + {$EXTERNALSYM STACK_OF_GENERAL_SUBTREE} + STACK_OF_GENERAL_SUBTREE = record + _stack: stack; + end; + {$EXTERNALSYM PSTACK_OF_GENERAL_SUBTREE} + PSTACK_OF_GENERAL_SUBTREE = ^STACK_OF_GENERAL_SUBTREE; + {$ELSE} + //I think the DECLARE_STACK_OF macro is empty + {$EXTERNALSYM PSTACK_OF_GENERAL_SUBTREE} + PSTACK_OF_GENERAL_SUBTREE = PSTACK; + {$ENDIF} + {$EXTERNALSYM NAME_CONSTRAINTS} + NAME_CONSTRAINTS = record + permittedSubtrees : PSTACK_OF_GENERAL_SUBTREE; + excludedSubtrees : PSTACK_OF_GENERAL_SUBTREE; + end; + {$EXTERNALSYM PNAME_CONSTRAINTS} + PNAME_CONSTRAINTS = ^NAME_CONSTRAINTS; + {$EXTERNALSYM POLICY_CONSTRAINTS} + POLICY_CONSTRAINTS = record + requireExplicitPolicy : PASN1_INTEGER; + inhibitPolicyMapping : ASN1_INTEGER; + end; + {$EXTERNALSYM PPOLICY_CONSTRAINTS} + PPOLICY_CONSTRAINTS = ^POLICY_CONSTRAINTS; + // Proxy certificate structures, see RFC 3820 + {$EXTERNALSYM PROXY_POLICY} + PROXY_POLICY = record + policyLanguage : PASN1_OBJECT; + policy : ASN1_OCTET_STRING; + end; + {$EXTERNALSYM PPROXY_POLICY} + PPROXY_POLICY = ^PROXY_POLICY; + {$EXTERNALSYM PROXY_CERT_INFO_EXTENSION} + PROXY_CERT_INFO_EXTENSION = record + pcPathLengthConstraint : PASN1_INTEGER; + proxyPolicy : PPROXY_POLICY; + end; + {$EXTERNALSYM ISSUING_DIST_POINT} + ISSUING_DIST_POINT = record + distpoint : PDIST_POINT_NAME; + onlyuser : TIdC_INT; + onlyCA : TIdC_INT; + onlysomereasons : PASN1_BIT_STRING; + indirectCRL : TIdC_INT; + onlyattr : TIdC_INT; + end; + {$IFDEF DEBUG_SAFESTACK} + //These are cut and paste but the duplication is for type checking. + {$EXTERNALSYM STACK_OF_CMS_SignerInfo} + STACK_OF_CMS_SignerInfo = record + _stack: stack; + end; + {$EXTERNALSYM STACK_OF_GENERAL_NAMES} + STACK_OF_GENERAL_NAMES = record + _stack: stack; + end; + {$EXTERNALSYM PSTACK_OF_CMS_SignerInfo} + PSTACK_OF_CMS_SignerInfo = ^STACK_OF_CMS_SignerInfo; + {$EXTERNALSYM PSTACK_OF_GENERAL_NAMES} + PSTACK_OF_GENERAL_NAMES = ^STACK_OF_GENERAL_NAMES; + {$ELSE} + //I think the DECLARE_STACK_OF macro is empty + {$EXTERNALSYM PSTACK_OF_CMS_SignerInfo} + PSTACK_OF_CMS_SignerInfo = PSTACK; + {$EXTERNALSYM PSTACK_OF_GENERAL_NAMES} + PSTACK_OF_GENERAL_NAMES = PSTACK; + {$ENDIF} + {.$ENDIF} + {$EXTERNALSYM PISSUING_DIST_POINT} + PISSUING_DIST_POINT = ^ISSUING_DIST_POINT; + {$EXTERNALSYM PPROXY_CERT_INFO_EXTENSION} + PPROXY_CERT_INFO_EXTENSION = ^PROXY_CERT_INFO_EXTENSION; + {$EXTERNALSYM PX509_PURPOSE} + PX509_PURPOSE = ^X509_PURPOSE; + {$EXTERNALSYM X509_PURPOSE_check_purpose} + X509_PURPOSE_check_purpose = function(const _para1 : Px509_purpose; const _para2 : PX509; + para3 : TIdC_INT) : TIdC_INT; cdecl; + {$EXTERNALSYM X509_PURPOSE} + X509_PURPOSE = record + purpose : TIdC_INT; + trust : TIdC_INT; // Default trust ID + flags : TIdC_INT; + check_purpose : X509_PURPOSE_check_purpose; + name : PIdAnsiChar; + sname : PIdAnsiChar; + usr_data : Pointer; + end; + {$IFDEF DEBUG_SAFESTACK} + {$EXTERNALSYM STACK_OF_X509_PURPOSE} + STACK_OF_X509_PURPOSE = record + _stack: stack; + end; + {$EXTERNALSYM PSTACK_OF_X509_PURPOSE} + PSTACK_OF_X509_PURPOSE = ^STACK_OF_X509_PURPOSE; + {$ELSE} + //I think the DECLARE_STACK_OF macro is empty + {$EXTERNALSYM PSTACK_OF_X509_PURPOSE} + PSTACK_OF_X509_PURPOSE = PSTACK; + {$ENDIF} + {$IFNDEF OPENSSL_NO_RFC3779} + {$EXTERNALSYM ASRange} + ASRange = record + min, max : PASN1_INTEGER; + end; + {$EXTERNALSYM PASRange} + PASRange = ^ASRange; + {$EXTERNALSYM ASIdOrRange_union} + ASIdOrRange_union = record + case byte of + ASIdOrRange_id : (id : PASN1_INTEGER); + ASIdOrRange_range : (range : PASRange); + end; + {$EXTERNALSYM ASIdOrRange} + ASIdOrRange = record + _type : TIdC_INT; + u : ASIdOrRange_union; + end; + {$EXTERNALSYM PASIdOrRange} + PASIdOrRange = ^ASIdOrRange; + {$IFDEF DEBUG_SAFESTACK} + {$EXTERNALSYM STACK_OF_ASIdOrRange} + STACK_OF_ASIdOrRange = record + _stack: stack; + end; + {$EXTERNALSYM PSTACK_OF_ASIdOrRange} + PSTACK_OF_ASIdOrRange = ^STACK_OF_ASIdOrRange; + {$ELSE} + //I think the DECLARE_STACK_OF macro is empty + {$EXTERNALSYM PSTACK_OF_ASIdOrRange} + PSTACK_OF_ASIdOrRange = PSTACK; + {$ENDIF} + {$EXTERNALSYM PASIdOrRanges} + PASIdOrRanges = PSTACK_OF_ASIdOrRange; + {$EXTERNALSYM ASIdentifierChoice_union} + ASIdentifierChoice_union = record + case byte of + ASIdentifierChoice_inherit : (inherit : PASN1_NULL); + ASIdentifierChoice_asIdsOrRanges : (asIdsOrRanges : PASIdOrRanges); + end; + {$EXTERNALSYM ASIdentifierChoice} + ASIdentifierChoice = record + _type : TIdC_INT; + u : ASIdentifierChoice_union; + end; + {$EXTERNALSYM PASIdentifierChoice} + PASIdentifierChoice = ^ASIdentifierChoice; + {$EXTERNALSYM ASIdentifiers} + ASIdentifiers = record + asnum : PASIdentifierChoice; + rdi : PASIdentifierChoice; + end; + {$EXTERNALSYM PASIdentifiers} + PASIdentifiers = ^ASIdentifiers; + {$EXTERNALSYM IPAddressRange} + IPAddressRange = record + min, max : PASN1_BIT_STRING; + end; + {$EXTERNALSYM PIPAddressRange} + PIPAddressRange = ^IPAddressRange; + {$EXTERNALSYM IPAddressOrRange_union} + IPAddressOrRange_union = record + case byte of + IPAddressOrRange_addressPrefix : (addressPrefix : PASN1_BIT_STRING); + IPAddressOrRange_addressRange : (addressRange : PIPAddressRange); + end; + {$EXTERNALSYM IPAddressOrRange} + IPAddressOrRange = record + _type : TIdC_INT; + u : IPAddressOrRange_union; + end; + {$EXTERNALSYM PIPAddressOrRange} + PIPAddressOrRange = ^IPAddressOrRange; + {$IFDEF DEBUG_SAFESTACK} + {$EXTERNALSYM STACK_OF_IPAddressOrRange} + STACK_OF_IPAddressOrRange = record + _stack: stack; + end; + {$EXTERNALSYM PSTACK_OF_IPAddressOrRange} + PSTACK_OF_IPAddressOrRange = ^STACK_OF_IPAddressOrRange; + {$ELSE} + //I think the DECLARE_STACK_OF macro is empty + {$EXTERNALSYM PSTACK_OF_IPAddressOrRange} + PSTACK_OF_IPAddressOrRange = PSTACK; + {$ENDIF} + {$EXTERNALSYM PIPAddressOrRanges} + PIPAddressOrRanges = PSTACK_OF_IPAddressOrRange; + {$EXTERNALSYM IPAddressChoice_union} + IPAddressChoice_union = record + case byte of + IPAddressChoice_inherit : (inherit : PASN1_NULL); + IPAddressChoice_addressesOrRanges : (addressesOrRanges : PIPAddressOrRanges); + end; + {$EXTERNALSYM IPAddressChoice} + IPAddressChoice = record + _type : TIdC_INT; + u : IPAddressChoice_union; + end; + {$EXTERNALSYM PIPAddressChoice} + PIPAddressChoice = ^IPAddressChoice; + {$EXTERNALSYM IPAddressFamily} + IPAddressFamily = record + addressFamily : PASN1_OCTET_STRING; + ipAddressChoice : PIPAddressChoice; + end; + {$EXTERNALSYM PIPAddressFamily} + PIPAddressFamily = ^IPAddressFamily; + {$IFDEF DEBUG_SAFESTACK} + {$EXTERNALSYM STACK_OF_IPAddressFamily} + STACK_OF_IPAddressFamily = record + _stack: stack; + end; + {$EXTERNALSYM PSTACK_OF_IPAddressFamily} + PSTACK_OF_IPAddressFamily = ^STACK_OF_IPAddressFamily; + {$ELSE} + //I think the DECLARE_STACK_OF macro is empty + {$EXTERNALSYM PSTACK_OF_IPAddressFamily} + PSTACK_OF_IPAddressFamily = PSTACK; + {$ENDIF} + {$EXTERNALSYM PIPAddrBlocks} + PIPAddrBlocks = PSTACK_OF_IPAddressFamily; + {$ENDIF} + //x509.h + {$EXTERNALSYM X509_HASH_DIR_CTX} + X509_HASH_DIR_CTX = record + num_dirs : TIDC_INT; + dirs : PPIdAnsiChar; + dirs_type : PIdC_INT; + num_dirs_alloced : TIdC_INT; + end; + {$EXTERNALSYM PX509_HASH_DIR_CTX} + PX509_HASH_DIR_CTX = ^X509_HASH_DIR_CTX; + {$EXTERNALSYM X509_CERT_FILE_CTX} + X509_CERT_FILE_CTX = record + num_paths : TIdC_INT; // number of paths to files or directories + num_alloced : TIdC_INT; + paths : PPIdAnsiChar; // the list of paths or directories + path_type : TIdC_INT; + end; + {$EXTERNALSYM PX509_CERT_FILE_CTX} + PX509_CERT_FILE_CTX = ^X509_CERT_FILE_CTX; + {$EXTERNALSYM x509_object_union} + x509_object_union = record + case byte of + 0: (ptr : PIdAnsiChar); + 1: (_x509 : Px509); + 2: (crl : PX509_CRL); + 3: (pkey : PEVP_PKEY); + end; + {$EXTERNALSYM X509_OBJECT} + X509_OBJECT = record + _type : TIdC_INT; + data : x509_object_union; + end; + {$EXTERNALSYM PX509_OBJECT} + PX509_OBJECT = ^X509_OBJECT; + {$EXTERNALSYM PPX509_OBJECT} + PPX509_OBJECT = ^PX509_OBJECT; + {$IFDEF DEBUG_SAFESTACK} + {$EXTERNALSYM STACK_OF_X509_OBJECT} + STACK_OF_X509_OBJECT = record + _stack: STACK; + end; + {$EXTERNALSYM PSTACK_OF_X509_OBJECT} + PSTACK_OF_X509_OBJECT = ^STACK_OF_X509_OBJECT; + {$ELSE} + //I think the DECLARE_STACK_OF macro is empty + {$EXTERNALSYM PSTACK_OF_X509_OBJECT} + PSTACK_OF_X509_OBJECT = PSTACK; + {$ENDIF} + {$EXTERNALSYM X509_ALGOR} + X509_ALGOR = record + algorithm : PASN1_OBJECT; + parameter : PASN1_TYPE; + end; + {$EXTERNALSYM PX509_ALGOR} + PX509_ALGOR = ^X509_ALGOR; + {$EXTERNALSYM PPX509_ALGOR} + PPX509_ALGOR =^PX509_ALGOR; + {$IFDEF DEBUG_SAFESTACK} + {$EXTERNALSYM STACK_OF_X509_ALGOR} + STACK_OF_X509_ALGOR = record + _stack: stack; + end; + {$EXTERNALSYM PSTACK_OF_X509_ALGOR} + PSTACK_OF_X509_ALGOR = ^STACK_OF_X509_ALGOR; + {$ELSE} + //I think the DECLARE_STACK_OF macro is empty + {$EXTERNALSYM PSTACK_OF_X509_ALGOR} + PSTACK_OF_X509_ALGOR = PSTACK; + {$ENDIF} + {$EXTERNALSYM PPSTACK_OF_X509_ALGOR} + PPSTACK_OF_X509_ALGOR = ^PSTACK_OF_X509_ALGOR; + {$EXTERNALSYM X509_VAL} + X509_VAL = record + notBefore : PASN1_TIME; + notAfter : PASN1_TIME; + end; + {$EXTERNALSYM PX509_VAL} + PX509_VAL = ^X509_VAL; + {$EXTERNALSYM PPX509_VAL} + PPX509_VAL =^PX509_VAL; + {$EXTERNALSYM X509_PUBKEY} + X509_PUBKEY = record + algor : PX509_ALGOR; + public_key : PASN1_BIT_STRING; + pkey : PEVP_PKEY; + end; + {$EXTERNALSYM PX509_PUBKEY} + PX509_PUBKEY = ^X509_PUBKEY; + {$EXTERNALSYM PPX509_PUBKEY} + PPX509_PUBKEY =^PX509_PUBKEY; + {$EXTERNALSYM X509_SIG} + X509_SIG = record + algor : PX509_ALGOR; + digest : PASN1_OCTET_STRING; + end; + {$EXTERNALSYM PX509_SIG} + PX509_SIG = X509_SIG; + {$EXTERNALSYM PPX509_SIG} + PPX509_SIG =^PX509_SIG; + {$EXTERNALSYM X509_NAME_ENTRY} + X509_NAME_ENTRY = record + _object : PASN1_OBJECT; + value : PASN1_STRING; + _set : TIdC_INT; + size : TIdC_INT; // temp variable + end; + {$NODEFINE X509_NAME} + X509_NAME = record + entries : PSTACK_OF_X509_NAME_ENTRY; + modified : TIdC_INT; // true if 'bytes' needs to be built + {$IFNDEF OPENSSL_NO_BUFFER} + bytes : PBUF_MEM; + {$else} + bytes : PIdAnsiChar; + {$ENDIF} + //* unsigned long hash; Keep the hash around for lookups */ + canon_enc : PIdAnsiChar; + canon_enclen : TIdC_INT; + end; + {$EXTERNALSYM X509_EXTENSION} + X509_EXTENSION = record + _object : PASN1_OBJECT; + critical : ASN1_BOOLEAN; + value : PASN1_OCTET_STRING; + end; + {$EXTERNALSYM PX509_EXTENSION} + PX509_EXTENSION = ^X509_EXTENSION; + {$EXTERNALSYM PPX509_EXTENSION} + PPX509_EXTENSION =^PX509_EXTENSION; + {$IFDEF DEBUG_SAFESTACK} + {$EXTERNALSYM STACK_OF_X509_EXTENSION} + STACK_OF_X509_EXTENSION = record + _stack: stack; + end; + {$EXTERNALSYM X509_EXTENSIONS} + X509_EXTENSIONS = STACK_OF_X509_EXTENSION; + {$EXTERNALSYM PSTACK_OF_X509_EXTENSION} + PSTACK_OF_X509_EXTENSION = ^STACK_OF_X509_EXTENSION; + {$ELSE} + //I think the DECLARE_STACK_OF macro is empty + {$EXTERNALSYM PSTACK_OF_X509_EXTENSION} + PSTACK_OF_X509_EXTENSION = PSTACK; + {$ENDIF} + {$EXTERNALSYM PPSTACK_OF_X509_EXTENSION} + PPSTACK_OF_X509_EXTENSION = ^PSTACK_OF_X509_EXTENSION; + {$EXTERNALSYM PX509_EXTENSIONS} + PX509_EXTENSIONS = PPSTACK_OF_X509_EXTENSION; + {$EXTERNALSYM x509_attributes_union} + x509_attributes_union = record + case Byte of + $FF :(Ptr : PIdAnsiChar); + 0 : (_set: PSTACK_OF_ASN1_TYPE); // 0 + 1 : (_single: PASN1_TYPE); + end; + {$EXTERNALSYM X509_ATTRIBUTE} + X509_ATTRIBUTE = record + _object : PASN1_OBJECT; + single : TIdC_INT; // 0 for a set, 1 for a single item (which is wrong) + value : x509_attributes_union; + end; + {$EXTERNALSYM PX509_ATTRIBUTE} + PX509_ATTRIBUTE = ^X509_ATTRIBUTE; + {$EXTERNALSYM PPX509_ATTRIBUTE} + PPX509_ATTRIBUTE =^PX509_ATTRIBUTE; + {$EXTERNALSYM X509_REQ_INFO} + X509_REQ_INFO = record + enc: ASN1_ENCODING; + version: PASN1_INTEGER; + subject: PX509_NAME; + pubkey: PX509_PUBKEY; + attributes: PSTACK_OF_X509_ATTRIBUTE; // [ 0 ] + end; + {$EXTERNALSYM X509_REQ} + X509_REQ = record + req_info: PX509_REQ_INFO; + sig_alg: PX509_ALGOR; + signature: PASN1_BIT_STRING; + references: TIdC_INT; + end; + {$EXTERNALSYM PPX509_REQ} + PPX509_REQ = ^PX509_REQ; + {$EXTERNALSYM PX509_CINF} + PX509_CINF = ^X509_CINF; + {$EXTERNALSYM X509_CINF} + X509_CINF = record + version: PASN1_INTEGER; + serialNumber: PASN1_INTEGER; + signature: PX509_ALGOR; + issuer: PX509_NAME; + validity: PX509_VAL; + subject: PX509_NAME; + key: PX509_PUBKEY; + issuerUID: PASN1_BIT_STRING; // [ 1 ] optional in v2 + subjectUID: PASN1_BIT_STRING; // [ 2 ] optional in v2 + extensions: PSTACK_OF_X509_EXTENSION; + enc : ASN1_ENCODING; + end; + {$EXTERNALSYM X509_CERT_AUX} + X509_CERT_AUX = record + trust : PSTACK_OF_ASN1_OBJECT; // trusted uses + reject : PSTACK_OF_ASN1_OBJECT; // rejected uses + alias : PASN1_UTF8STRING; // "friendly name" + keyid : PASN1_OCTET_STRING; // key id of private key + other : PSTACK_OF_X509_ALGOR; // other unspecified info + end; + {$EXTERNALSYM PX509_CERT_AUX} + PX509_CERT_AUX = ^X509_CERT_AUX; + {$NODEFINE X509} + X509 = record + cert_info: PX509_CINF; + sig_alg : PX509_ALGOR; + signature : PASN1_BIT_STRING; + valid : TIdC_INT; + references : TIdC_INT; + name : PIdAnsiChar; + ex_data : CRYPTO_EX_DATA; + // These contain copies of various extension values + ex_pathlen : TIdC_LONG; + ex_pcpathlen : TIdC_LONG; + ex_flags : TIdC_ULONG; + ex_kusage : TIdC_ULONG; + ex_xkusage : TIdC_ULONG; + ex_nscert : TIdC_ULONG; + skid : PASN1_OCTET_STRING; + akid : PAUTHORITY_KEYID; + policy_cache : PX509_POLICY_CACHE; + crldp : PSTACK_OF_DIST_POINT; + altname : PSTACK_OF_GENERAL_NAME; + nc : PNAME_CONSTRAINTS; + {$IFNDEF OPENSSL_NO_RFC3779} + rfc3779_addr : PSTACK_OF_IPAddressFamily; + rfc3779_asid : PASIdentifiers; + {$ENDIF} + {$IFNDEF OPENSSL_NO_SHA} + sha1_hash : array [0..SHA_DIGEST_LENGTH-1] of TIdAnsiChar; + {$ENDIF} + aux : PX509_CERT_AUX; + end; + {$EXTERNALSYM X509_CRL_INFO} + X509_CRL_INFO = record + version : PASN1_INTEGER; + sig_alg : PX509_ALGOR; + issuer : PX509_NAME; + lastUpdate : PASN1_TIME; + nextUpdate : PASN1_TIME; + revoked : PSTACK_OF_X509_REVOKED; + extensions : PSTACK_OF_X509_EXTENSION; // [0] + enc : ASN1_ENCODING; + end; + {$EXTERNALSYM PX509_CRL_INFO} + PX509_CRL_INFO = ^X509_CRL_INFO; + {$EXTERNALSYM PPX509_CRL_INFO} + PPX509_CRL_INFO =^PX509_CRL_INFO; + {$IFDEF DEBUG_SAFESTACK} + {$EXTERNALSYM STACK_OF_X509_CRL_INFO} + STACK_OF_X509_CRL_INFO = record + _stack: stack; + end; + {$EXTERNALSYM PSTACK_OF_X509_CRL_INFO} + PSTACK_OF_X509_CRL_INFO = ^STACK_OF_X509_CRL_INFO; + {$ELSE} + //I think the DECLARE_STACK_OF macro is empty + {$EXTERNALSYM PSTACK_OF_X509_CRL_INFO} + PSTACK_OF_X509_CRL_INFO = PSTACK; + {$ENDIF} + {$EXTERNALSYM PX509_LOOKUP} + PX509_LOOKUP = ^X509_LOOKUP; + //This has to be declared ehre for a reference in the next type. + {$IFDEF DEBUG_SAFESTACK} + {$EXTERNALSYM STACK_OF_X509_LOOKUP} + STACK_OF_X509_LOOKUP = record + _stack: STACK; + end; + {$EXTERNALSYM PSTACK_OF_X509_LOOKUP} + PSTACK_OF_X509_LOOKUP = ^STACK_OF_X509_LOOKUP; + {$ELSE} + //I think the DECLARE_STACK_OF macro is empty + {$EXTERNALSYM PSTACK_OF_X509_LOOKUP} + PSTACK_OF_X509_LOOKUP = PSTACK; + {$ENDIF} + + {$IFDEF DEBUG_SAFESTACK} + {$EXTERNALSYM STACK_OF_X509_CRL} + STACK_OF_X509_CRL = record + _stack: STACK; + end; + {$EXTERNALSYM PSTACK_OF_X509_CRL} + PSTACK_OF_X509_CRL = ^STACK_OF_X509_CRL; + {$ELSE} + //I think the DECLARE_STACK_OF macro is empty + {$EXTERNALSYM PSTACK_OF_X509_CRL} + PSTACK_OF_X509_CRL = PSTACK; + {$ENDIF} + {$EXTERNALSYM PX509_VERIFY_PARAM} + PX509_VERIFY_PARAM = ^X509_VERIFY_PARAM; + {$EXTERNALSYM PX509_STORE_CTX} + PX509_STORE_CTX = ^X509_STORE_CTX; + {$EXTERNALSYM PPX509_CRL} + PPX509_CRL = ^PX509_CRL; + {$EXTERNALSYM X509_STORE} + X509_STORE = record + // The following is a cache of trusted certs + cache : TIdC_INT; // if true, stash any hits + objs : PSTACK_OF_X509_OBJECT; // Cache of all objects + // These are external lookup methods + get_cert_methods : PSTACK_OF_X509_LOOKUP; + param : PX509_VERIFY_PARAM; + // Callbacks for various operations + verify : function (ctx : PX509_STORE_CTX) : TIdC_INT; cdecl; // called to verify a certificate + verify_cb : function (ok : TIdC_INT; ctx : PX509_STORE_CTX) : TIdC_INT; cdecl; // error callback + get_issuer : function (issuer : PPX509; ctx : PX509_STORE_CTX; x : PX509) : TIdC_INT; cdecl; // get issuers cert from ctx + check_issued : function (ctx : PX509_STORE_CTX; x : PX509; issuer : PX509) : TIdC_INT; cdecl; // check issued + check_revocation : function (ctx : PX509_STORE_CTX) : TIdC_INT; cdecl; // Check revocation status of chain + get_crl : function (ctx : PX509_STORE_CTX; crl : PPX509_CRL; x : PX509) : TIdC_INT; cdecl;// retrieve CRL + check_crl : function(ctx : PX509_STORE_CTX; crl : PX509_CRL) : TIdC_INT; cdecl; // Check CRL validity + cert_crl : function(ctx : PX509_STORE_CTX; crl : PX509_CRL; x : PX509) : TIdC_INT; cdecl; // Check certificate against CRL + lookup_certs : function(ctx : PX509_STORE_CTX; nm : PX509_NAME) : PSTACK_OF_X509 cdecl; + lookup_crls : function(ctx : PX509_STORE_CTX; nm : PX509_NAME) : PSTACK_OF_X509_CRL cdecl; + cleanup : function(ctx : PX509_STORE_CTX) : TIdC_INT; cdecl; + ex_data : CRYPTO_EX_DATA; + references : TIdC_INT; + end; + {$EXTERNALSYM PX509_STORE} + PX509_STORE = ^X509_STORE; + {$EXTERNALSYM PX509_CRL_METHOD} + PX509_CRL_METHOD = Pointer; + {$EXTERNALSYM X509_CRL} + X509_CRL = record + crl : PX509_CRL_INFO; + sig_alg : PX509_ALGOR; + signature : PASN1_BIT_STRING; + references : TIdC_INT; + flags : TIdC_INT; + //* Copies of various extensions */ + akid : PAUTHORITY_KEYID; + idp : PISSUING_DIST_POINT; + //* Convenient breakdown of IDP */ + idp_flags : TIdC_INT; + idp_reasons : TIdC_INT; + //* CRL and base CRL numbers for delta processing */ + crl_number : PASN1_INTEGER; + base_crl_number : PASN1_INTEGER; +{$ifndef OPENSSL_NO_SHA} + sha1_hash : array [0..(SHA_DIGEST_LENGTH - 1)] of byte; +{$endif} + issuers : PSTACK_OF_GENERAL_NAMES; + meth : PX509_CRL_METHOD; + meth_data : Pointer; + end; + {$EXTERNALSYM X509_LOOKUP_METHOD} + X509_LOOKUP_METHOD = record + name : PIdAnsiChar; + new_item : function (ctx : PX509_LOOKUP): TIdC_INT; cdecl; + free : procedure (ctx : PX509_LOOKUP); cdecl; + init : function(ctx : PX509_LOOKUP) : TIdC_INT; cdecl; + shutdown : function(ctx : PX509_LOOKUP) : TIdC_INT; cdecl; + ctrl: function(ctx : PX509_LOOKUP; cmd : TIdC_INT; const argc : PIdAnsiChar; argl : TIdC_LONG; out ret : PIdAnsiChar ) : TIdC_INT; cdecl; + get_by_subject: function(ctx : PX509_LOOKUP; _type : TIdC_INT; name : PX509_NAME; ret : PX509_OBJECT ) : TIdC_INT; cdecl; + get_by_issuer_serial : function(ctx : PX509_LOOKUP; _type : TIdC_INT; name : PX509_NAME; serial : PASN1_INTEGER; ret : PX509_OBJECT) : TIdC_INT; cdecl; + get_by_fingerprint : function (ctx : PX509_LOOKUP; _type : TIdC_INT; bytes : PIdAnsiChar; len : TIdC_INT; ret : PX509_OBJECT): TIdC_INT; cdecl; + get_by_alias : function(ctx : PX509_LOOKUP; _type : TIdC_INT; str : PIdAnsiChar; ret : PX509_OBJECT) : TIdC_INT; cdecl; + end; + {$EXTERNALSYM PX509_LOOKUP_METHOD} + PX509_LOOKUP_METHOD = ^X509_LOOKUP_METHOD; + {$EXTERNALSYM PPX509_LOOKUP_METHOD} + PPX509_LOOKUP_METHOD = ^PX509_LOOKUP_METHOD; + {$EXTERNALSYM X509_VERIFY_PARAM} + X509_VERIFY_PARAM = record + name : PIdAnsiChar; + check_time : time_t; // Time to use + inh_flags : TIdC_ULONG; // Inheritance flags + flags : TIdC_ULONG; // Various verify flags + purpose : TIdC_INT; // purpose to check untrusted certificates + trust : TIdC_INT; // trust setting to check + depth : TIdC_INT; // Verify depth + policies : PSTACK_OF_ASN1_OBJECT; // Permissible policies + end; + {$IFDEF DEBUG_SAFESTACK} + {$EXTERNALSYM STACK_OF_X509_VERIFY_PARAM} + STACK_OF_X509_VERIFY_PARAM = record + _stack: STACK; + end; + {$EXTERNALSYM PSTACK_OF_X509_VERIFY_PARAM} + PSTACK_OF_X509_VERIFY_PARAM = ^STACK_OF_X509_VERIFY_PARAM; + {$ELSE} + //I think the DECLARE_STACK_OF macro is empty + {$EXTERNALSYM PSTACK_OF_X509_VERIFY_PARAM} + PSTACK_OF_X509_VERIFY_PARAM = PSTACK; + {$ENDIF} + {$EXTERNALSYM X509_LOOKUP} + X509_LOOKUP = record + init : TIdC_INT; // have we been started + skip : TIdC_INT; // don't use us. + method : PX509_LOOKUP_METHOD; // the functions + method_data : PIdAnsiChar; // method data + store_ctx : PX509_STORE; // who owns us + end; + {$EXTERNALSYM PX509_POLICY_TREE} + PX509_POLICY_TREE = Pointer; + {$EXTERNALSYM PPSTACK_OF_X509_LOOKUP} + PPSTACK_OF_X509_LOOKUP = ^PSTACK_OF_X509_LOOKUP; + // This is used when verifying cert chains. Since the + // gathering of the cert chain can take some time (and have to be + // 'retried', this needs to be kept and passed around. + X509_STORE_CTX = record // X509_STORE_CTX + ctx : PX509_STORE; + current_method : TIdC_INT; // used when looking up certs + // The following are set by the caller + cert : PX509; // The cert to check + untrusted : PSTACK_OF_X509; // chain of X509s - untrusted - passed in + crls : PSTACK_OF_X509_CRL; // set of CRLs passed in + param : PX509_VERIFY_PARAM; + other_ctx : Pointer; // Other info for use with get_issuer() + // Callbacks for various operations + verify : function (ctx : PX509_STORE_CTX) : TIdC_INT; cdecl; // called to verify a certificate + verify_cb : function (ok : TIdC_INT; ctx : PX509_STORE_CTX) : TIdC_INT; cdecl; // error callback + get_issuer : function (var issuer : PX509; ctx : PX509_STORE_CTX; x : PX509) : TIdC_INT; cdecl; // get issuers cert from ctx + check_issued : function(ctx : PX509_STORE_CTX; x, issuer : PX509) : TIdC_INT; cdecl; // check issued + check_revocation : function (ctx : PX509_STORE_CTX): TIdC_INT; cdecl; // Check revocation status of chain + get_crl : function (ctx : PX509_STORE_CTX; var crl : X509_CRL; x : PX509): TIdC_INT; cdecl; // retrieve CRL + check_crl : function (ctx : PX509_STORE_CTX; var crl : X509_CRL) : TIdC_INT; cdecl; // Check CRL validity + cert_crl : function (ctx : PX509_STORE_CTX; crl : PX509_CRL; x : PX509) : TIdC_INT; cdecl; // Check certificate against CRL + check_policy : function (ctx : PX509_STORE_CTX) : TIdC_INT; cdecl; + cleanup : function (ctx : PX509_STORE_CTX) : TIdC_INT; cdecl; + //* The following is built up */ + valid : TIdC_INT; //* if 0, rebuild chain */ + last_untrusted : TIdC_INT; //* index of last untrusted cert */ + chain : PSTACK_OF_X509; //* chain of X509s - built up and trusted */ + tree : PX509_POLICY_TREE; //* Valid policy tree */ + + explicit_policy : TIdC_INT; //* Require explicit policy value */ + + //* When something goes wrong, this is why */ + error_depth : TIdC_INT; + error : TIdC_INT; + current_cert : PX509; + current_issuer : PX509; //* cert currently being tested as valid issuer */ + current_crl : PX509_CRL; //* current CRL */ + + current_crl_score : TIdC_INT; //* score of current CRL */ + current_reasons : TIdC_UINT; //* Reason mask */ + + parent : PX509_STORE_CTX; //* For CRL path validation: parent context */ + + ex_data : CRYPTO_EX_DATA; + end; + {$EXTERNALSYM X509_STORE_CTX} + + {$EXTERNALSYM PX509_EXTENSION_METHOD} + PX509_EXTENSION_METHOD = Pointer; + {$EXTERNALSYM PX509_TRUST} + PX509_TRUST = ^X509_TRUST; + {$EXTERNALSYM X509_TRUST_check_trust} + X509_TRUST_check_trust = function(_para1 : PX509_TRUST; para2 : PX509; _para3 : TIdC_INT) : TIdC_INT; cdecl; + {$EXTERNALSYM X509_TRUST} + X509_TRUST = record + trust : TIdC_INT; + flags : TIdC_INT; + check_trust : X509_TRUST_check_trust; + name : PIdAnsiChar; + arg1 : TIdC_INT; + arg2 : Pointer; + end; + {$EXTERNALSYM PPX509_TRUST} + PPX509_TRUST = ^PX509_TRUST; + {$IFDEF DEBUG_SAFESTACK} + {$EXTERNALSYM STACK_OF_509_TRUST} + STACK_OF_509_TRUST = record + _stack: stack; + end; + {$EXTERNALSYM PSTACK_OF_509_TRUST} + PSTACK_OF_509_TRUST = ^STACK_OF_509_TRUST; + {$ELSE} + //I think the DECLARE_STACK_OF macro is empty + {$EXTERNALSYM PSTACK_OF_509_TRUST} + PSTACK_OF_509_TRUST = PSTACK; + {$ENDIF} + {$EXTERNALSYM X509_REVOKED} + X509_REVOKED = record + serialNumber: PASN1_INTEGER; + revocationDate: PASN1_TIME; + extensions: PSTACK_OF_X509_EXTENSION; // optional + //* Set up if indirect CRL */ + issuer : PSTACK_OF_GENERAL_NAME; + //* Revocation reason */ + reason : TIdC_INT; + sequence: TIdC_INT; + end; + {$EXTERNALSYM PX509_REVOKED} + PX509_REVOKED = ^X509_REVOKED; + {$EXTERNALSYM PPX509_REVOKED} + PPX509_REVOKED =^PX509_REVOKED; + {$EXTERNALSYM PX509_PKEY} + PX509_PKEY = Pointer; + {$EXTERNALSYM PPX509_PKEY} + PPX509_PKEY =^PX509_PKEY; + {$EXTERNALSYM X509_INFO} + X509_INFO = record + x509 : PX509; + crl : PX509_CRL; + x_pkey : PX509_PKEY; + enc_cipher: EVP_CIPHER_INFO; + enc_len: TIdC_INT; + enc_data: PIdAnsiChar; + references: TIdC_INT; + end; + {$EXTERNALSYM PX509_INFO} + PX509_INFO = ^X509_INFO; + {$EXTERNALSYM PPX509_INFO} + PPX509_INFO =^PX509_INFO; + {$IFDEF DEBUG_SAFESTACK} + {$EXTERNALSYM STACK_OF_X509_INFO} + STACK_OF_X509_INFO = record + _stack: stack; + end; + {$EXTERNALSYM PSTACK_OF_X509_INFO} + PSTACK_OF_X509_INFO = ^STACK_OF_X509_INFO; + {$ELSE} + //I think the DECLARE_STACK_OF macro is empty + {$EXTERNALSYM PSTACK_OF_X509_INFO} + PSTACK_OF_X509_INFO = PSTACK; + {$ENDIF} +// OpenSSL Developer's note +// The next 2 structures and their 8 routines were sent to me by +// Pat Richard and are used to manipulate +// Netscapes spki structures - useful if you are writing a CA web page + {$EXTERNALSYM NETSCAPE_SPKAC} + NETSCAPE_SPKAC = record + pubkey : PX509_PUBKEY; + challenge : PASN1_IA5STRING; // challenge sent in atlas >= PR2 + end; + {$EXTERNALSYM PNETSCAPE_SPKAC} + PNETSCAPE_SPKAC = ^NETSCAPE_SPKAC; + {$EXTERNALSYM PPNETSCAPE_SPKAC} + PPNETSCAPE_SPKAC = ^PNETSCAPE_SPKAC; + {$EXTERNALSYM NETSCAPE_SPKI} + NETSCAPE_SPKI = record + spkac : PNETSCAPE_SPKAC; // signed public key and challenge + sig_algor : PX509_ALGOR; + signature : PASN1_BIT_STRING; + end; + {$EXTERNALSYM PNETSCAPE_SPKI} + PNETSCAPE_SPKI = ^NETSCAPE_SPKI; + {$EXTERNALSYM PPNETSCAPE_SPKI} + PPNETSCAPE_SPKI = ^PNETSCAPE_SPKI; + {$EXTERNALSYM NETSCAPE_CERT_SEQUENCE} + NETSCAPE_CERT_SEQUENCE = record + _type : PASN1_OBJECT; + certs : PSTACK_OF_X509; + end; + {$EXTERNALSYM PNETSCAPE_CERT_SEQUENCE} + PNETSCAPE_CERT_SEQUENCE = ^NETSCAPE_CERT_SEQUENCE; + {$EXTERNALSYM PPNETSCAPE_CERT_SEQUENCE} + PPNETSCAPE_CERT_SEQUENCE = ^PNETSCAPE_CERT_SEQUENCE; + // Password based encryption structure + {$EXTERNALSYM PBEPARAM} + PBEPARAM = record + salt : PASN1_OCTET_STRING; + iter : PASN1_INTEGER; + end; + {$EXTERNALSYM PPBEPARAM} + PPBEPARAM = ^PBEPARAM; + {$EXTERNALSYM PPPBEPARAM} + PPPBEPARAM = ^PPBEPARAM; + // Password based encryption V2 structures + {$EXTERNALSYM PBE2PARAM} + PBE2PARAM = record + keyfunc : PX509_ALGOR; + encryption : PX509_ALGOR; + end; + {$EXTERNALSYM PPBE2PARAM} + PPBE2PARAM = ^PBE2PARAM; + {$EXTERNALSYM PBKDF2PARAM} + PBKDF2PARAM = record + salt : PASN1_TYPE; // Usually OCTET STRING but could be anything + iter : PASN1_INTEGER; + keylength : PASN1_INTEGER; + prf : PX509_ALGOR; + end; + {$EXTERNALSYM PPBKDF2PARAM} + PPBKDF2PARAM = ^PBKDF2PARAM; + {$EXTERNALSYM PPPBKDF2PARAM} + PPPBKDF2PARAM = ^PPBKDF2PARAM; + {$EXTERNALSYM PKCS8_PRIV_KEY_INFO} + PKCS8_PRIV_KEY_INFO = record + broken : TIdC_INT; // Flag for various broken formats +//#define PKCS8_OK 0 +//#define PKCS8_NO_OCTET 1 +//#define PKCS8_EMBEDDED_PARAM 2 +//#define PKCS8_NS_DB 3 + version : PASN1_INTEGER; + pkeyalg : PX509_ALGOR; + pkey : PASN1_TYPE; // Should be OCTET STRING but some are broken + attributes : PSTACK_OF_X509_ATTRIBUTE; + end; + {$EXTERNALSYM PPKCS8_PRIV_KEY_INFO} + PPKCS8_PRIV_KEY_INFO = ^PKCS8_PRIV_KEY_INFO; + {$EXTERNALSYM PPPKCS8_PRIV_KEY_INFO} + PPPKCS8_PRIV_KEY_INFO = ^PPKCS8_PRIV_KEY_INFO; + {$EXTERNALSYM PPKCS7_RECIP_INFO} + PPKCS7_RECIP_INFO = ^PKCS7_RECIP_INFO; + {$EXTERNALSYM PSHA_CTX} + PSHA_CTX = ^SHA_CTX; + //cms.h + {$IFDEF OPENSSL_NO_CMS} + {$EXTERNALSYM PCMS_ContentInfo} + PCMS_ContentInfo = Pointer; + {$EXTERNALSYM PCMS_SignerInfo} + PCMS_SignerInfo = Pointer; + {$EXTERNALSYM PCMS_CertificateChoices} + PCMS_CertificateChoices = Pointer; + {$EXTERNALSYM PCMS_RevocationInfoChoice} + PCMS_RevocationInfoChoice = Pointer; + {$EXTERNALSYM PCMS_RecipientInfo} + PCMS_RecipientInfo = Pointer; + {$EXTERNALSYM PCMS_ReceiptRequest} + PCMS_ReceiptRequest = Pointer; + {$EXTERNALSYM PCMS_Receipt} + PCMS_Receipt = Pointer; + {$EXTERNALSYM PSTACK_OF_CMS_SignerInfo} + {$ENDIF} + //ripemd.h + {$IFNDEF OPENSSL_NO_RIPEMD} + {$EXTERNALSYM RIPEMD160_LONG} + RIPEMD160_LONG = TIdC_UINT; + {$EXTERNALSYM RIPEMD160_CTX} + RIPEMD160_CTX = record + A,B,C,D,E : RIPEMD160_LONG; + Nl,Nh : RIPEMD160_LONG; + data : array [0..RIPEMD160_LBLOCK -1 ] of RIPEMD160_LONG; + num : TIdC_UINT; + end; + {$EXTERNALSYM PRIPEMD160_CTX} + PRIPEMD160_CTX = ^RIPEMD160_CTX; + {$ENDIF} + {$IFNDEF OPENSSL_NO_RC4} + {$EXTERNALSYM RC4_KEY} + RC4_KEY = record + x,y : RC4_INT; + data : array [0..(256 - 1)] of RC4_INT; + end; + {$EXTERNALSYM PRC4_KEY} + PRC4_KEY = ^RC4_KEY; + {$ENDIF} + //rc2.h + {$IFNDEF OPENSSL_NO_RC2} + {$EXTERNALSYM RC2_KEY} + RC2_KEY = record + data : array [0..(64 - 1)] of RC2_INT; + end; + {$EXTERNALSYM PRC2_KEY} + PRC2_KEY = ^RC2_KEY; + {$ENDIF} + {$IFNDEF OPENSSL_NO_RC5} + {$EXTERNALSYM RC5_32_INT} + RC5_32_INT = TIdC_UINT; + {$EXTERNALSYM RC5_32_KEY} + RC5_32_KEY = record + // Number of rounds + rounds : TIdC_INT; + data : array [0..(2*(RC5_16_ROUNDS+1)-1)] of RC5_32_INT; + end; + {$EXTERNALSYM PRC5_32_KEY} + PRC5_32_KEY = ^RC5_32_KEY; + {$ENDIF} + //blowfish.h + {$IFNDEF OPENSSL_NO_BF} + {$EXTERNALSYM BF_LONG} + BF_LONG = TIdC_UINT; + {$EXTERNALSYM BF_KEY} + BF_KEY = record + P : array [0..(BF_ROUNDS+2)-1] of BF_LONG; + S : array [0..(4*256)-1] of BF_LONG; + end; + {$EXTERNALSYM PBF_KEY} + PBF_KEY = ^BF_KEY; + {$ENDIF} + {$IFNDEF OPENSSL_NO_CAST} + {$EXTERNALSYM CAST_LONG} + CAST_LONG = TIdC_ULONG; + {$EXTERNALSYM CAST_KEY} + CAST_KEY = record + data : array[0..(32 -1)] of CAST_LONG; + short_key : TIdC_INT; // Use reduced rounds for short key + end; + {$EXTERNALSYM PCAST_KEY} + PCAST_KEY = ^CAST_KEY; + {$ENDIF} + {$IFNDEF OPENSSL_NO_IDEA} + {$EXTERNALSYM IDEA_KEY_SCHEDULE} + IDEA_KEY_SCHEDULE = record + data : array [0..(9-1),0..(6-1)] of IDEA_INT; + end; + {$EXTERNALSYM PIDEA_KEY_SCHEDULE} + PIDEA_KEY_SCHEDULE = ^IDEA_KEY_SCHEDULE; + {$ENDIF} + //ocsp.h + //* CertID ::= SEQUENCE { + //* hashAlgorithm AlgorithmIdentifier, + //* issuerNameHash OCTET STRING, -- Hash of Issuer's DN + //* issuerKeyHash OCTET STRING, -- Hash of Issuers public key (excluding the tag & length fields) + //* serialNumber CertificateSerialNumber } + //*/ +//typedef struct ocsp_cert_id_st + {$EXTERNALSYM OCSP_CERTID} + OCSP_CERTID = record + hashAlgorithm : PX509_ALGOR; + issuerNameHash : PASN1_OCTET_STRING; + issuerKeyHash : PASN1_OCTET_STRING; + serialNumber : PASN1_INTEGER; + end; + {$EXTERNALSYM POCSP_CERTID} + POCSP_CERTID = ^OCSP_CERTID; + {$EXTERNALSYM PPOCSP_CERTID} + PPOCSP_CERTID = ^POCSP_CERTID; + {$IFDEF DEBUG_SAFESTACK} + {$EXTERNALSYM STACK_OF_OCSP_CERTID} + STACK_OF_OCSP_CERTID = record + _stack: stack; + end; + {$EXTERNALSYM PSTACK_OF_OCSP_CERTID} + PSTACK_OF_OCSP_CERTID = ^STACK_OF_OCSP_CERTID; + {$ELSE} + //I think the DECLARE_STACK_OF macro is empty + {$EXTERNALSYM PSTACK_OF_OCSP_CERTID} + PSTACK_OF_OCSP_CERTID = PSTACK; + {$ENDIF} +// * Request ::= SEQUENCE { +// * reqCert CertID, +// * singleRequestExtensions [0] EXPLICIT Extensions OPTIONAL } +// */ + {$EXTERNALSYM OCSP_ONEREQ} + OCSP_ONEREQ = record + reqCert : POCSP_CERTID; + singleRequestExtensions : PSTACK_OF_X509_EXTENSION; + end; + {$EXTERNALSYM POCSP_ONEREQ} + POCSP_ONEREQ = ^OCSP_ONEREQ; + {$EXTERNALSYM PPOCSP_ONEREQ} + PPOCSP_ONEREQ = ^POCSP_ONEREQ; + {$IFDEF DEBUG_SAFESTACK} + {$EXTERNALSYM STACK_OF_OCSP_ONEREQ} + STACK_OF_OCSP_ONEREQ = record + _stack: stack; + end; + {$EXTERNALSYM PSTACK_OF_OCSP_ONEREQ} + PSTACK_OF_OCSP_ONEREQ = ^STACK_OF_OCSP_ONEREQ; + {$ELSE} + //I think the DECLARE_STACK_OF macro is empty + {$EXTERNALSYM PSTACK_OF_OCSP_ONEREQ} + PSTACK_OF_OCSP_ONEREQ = PSTACK; + {$ENDIF} +//* TBSRequest ::= SEQUENCE { +//* version [0] EXPLICIT Version DEFAULT v1, +//* requestorName [1] EXPLICIT GeneralName OPTIONAL, +//* requestList SEQUENCE OF Request, +//* requestExtensions [2] EXPLICIT Extensions OPTIONAL } +//*/ + {$EXTERNALSYM OCSP_REQINFO} + OCSP_REQINFO = record + version : PASN1_INTEGER; + requestorName : PGENERAL_NAME; + requestList : PSTACK_OF_OCSP_ONEREQ; + requestExtensions : PSTACK_OF_X509_EXTENSION; + end; + {$EXTERNALSYM POCSP_REQINFO} + POCSP_REQINFO = ^OCSP_REQINFO; + {$EXTERNALSYM PPOCSP_REQINFO} + PPOCSP_REQINFO = ^POCSP_REQINFO; +///* Signature ::= SEQUENCE { +// * signatureAlgorithm AlgorithmIdentifier, +// * signature BIT STRING, +// * certs [0] EXPLICIT SEQUENCE OF Certificate OPTIONAL } +// */ + {$EXTERNALSYM OCSP_SIGNATURE} + OCSP_SIGNATURE = record + signatureAlgorithm : PX509_ALGOR; + signature : PASN1_BIT_STRING; + certs : PSTACK_OF_X509; + end; + {$EXTERNALSYM POCSP_SIGNATURE} + POCSP_SIGNATURE = ^OCSP_SIGNATURE; + {$EXTERNALSYM PPOCSP_SIGNATURE} + PPOCSP_SIGNATURE = ^POCSP_SIGNATURE; +///* OCSPRequest ::= SEQUENCE { +// * tbsRequest TBSRequest, +// * optionalSignature [0] EXPLICIT Signature OPTIONAL } +// */ + {$EXTERNALSYM OCSP_REQUEST} + OCSP_REQUEST = record + tbsRequest : POCSP_REQINFO; + optionalSignature : POCSP_SIGNATURE; //* OPTIONAL */ + end; + {$EXTERNALSYM POCSP_REQUEST} + POCSP_REQUEST = ^OCSP_REQUEST; + {$EXTERNALSYM PPOCSP_REQUEST} + PPOCSP_REQUEST = ^POCSP_REQUEST; +///* OCSPResponseStatus ::= ENUMERATED { +// * successful (0), --Response has valid confirmations +// * malformedRequest (1), --Illegal confirmation request +// * internalError (2), --Internal error in issuer +// * tryLater (3), --Try again later +// * --(4) is not used +// * sigRequired (5), --Must sign the request +// * unauthorized (6) --Request unauthorized +// * } +// */ +///* ResponseBytes ::= SEQUENCE { +// * responseType OBJECT IDENTIFIER, +// * response OCTET STRING } +// */ + {$EXTERNALSYM OCSP_RESPBYTES} + OCSP_RESPBYTES = record + responseType : PASN1_OBJECT; + response : PASN1_OCTET_STRING; + end; + {$EXTERNALSYM POCSP_RESPBYTES} + POCSP_RESPBYTES = ^OCSP_RESPBYTES; + {$EXTERNALSYM PPOCSP_RESPBYTES} + PPOCSP_RESPBYTES = ^POCSP_RESPBYTES; +///* OCSPResponse ::= SEQUENCE { +// * responseStatus OCSPResponseStatus, +// * responseBytes [0] EXPLICIT ResponseBytes OPTIONAL } +// */ + {$EXTERNALSYM OCSP_RESPONSE} + OCSP_RESPONSE = record + responseStatus : PASN1_ENUMERATED; + responseBytes : POCSP_RESPBYTES; + end; + {$EXTERNALSYM POCSP_RESPONSE} + POCSP_RESPONSE = ^OCSP_RESPONSE; + {$EXTERNALSYM PPOCSP_RESPONSE} + PPOCSP_RESPONSE = ^POCSP_RESPONSE; +// /* ResponderID ::= CHOICE { +// * byName [1] Name, +// * byKey [2] KeyHash } +// */ + {$EXTERNALSYM OCSP_RESPID_union} + OCSP_RESPID_union = record + case Integer of + 0 : (byName : PX509_NAME); + 1 : (byKey : PASN1_OCTET_STRING); + end; + {$EXTERNALSYM OCSP_RESPID} + OCSP_RESPID = record + _type : TIdC_INT; + value : OCSP_RESPID_union; + end; + {$EXTERNALSYM POCSP_RESPID} + POCSP_RESPID = ^OCSP_RESPID; + {$EXTERNALSYM PPOCSP_RESPID} + PPOCSP_RESPID = ^POCSP_RESPID; + //* KeyHash ::= OCTET STRING --SHA-1 hash of responder's public key + // * --(excluding the tag and length fields) + // */ + {$IFDEF DEBUG_SAFESTACK} + {$EXTERNALSYM STACK_OF_OCSP_RESPID} + STACK_OF_OCSP_RESPID = record + _stack: stack; + end; + {$EXTERNALSYM PSTACK_OF_OCSP_RESPID} + PSTACK_OF_OCSP_RESPID = ^STACK_OF_OCSP_RESPID; + {$ELSE} + //I think the DECLARE_STACK_OF macro is empty + {$EXTERNALSYM PSTACK_OF_OCSP_RESPID} + PSTACK_OF_OCSP_RESPID = PSTACK; + {$ENDIF} +///* RevokedInfo ::= SEQUENCE { +// * revocationTime GeneralizedTime, +// * revocationReason [0] EXPLICIT CRLReason OPTIONAL } +// */ + {$EXTERNALSYM OCSP_REVOKEDINFO} + OCSP_REVOKEDINFO = record + revocationTime : PASN1_GENERALIZEDTIME; + revocationReason : PASN1_ENUMERATED; + end; + {$EXTERNALSYM POCSP_REVOKEDINFO} + POCSP_REVOKEDINFO = ^OCSP_REVOKEDINFO; + {$EXTERNALSYM PPOCSP_REVOKEDINFO} + PPOCSP_REVOKEDINFO = ^POCSP_REVOKEDINFO; +///* CertStatus ::= CHOICE { +// * good [0] IMPLICIT NULL, +// * revoked [1] IMPLICIT RevokedInfo, +// * unknown [2] IMPLICIT UnknownInfo } +// */ + {$EXTERNALSYM OCSP_CERTSTATUS_union} + OCSP_CERTSTATUS_union = record + case Integer of + 0 : (good : PASN1_NULL); + 1 : (revoked : POCSP_REVOKEDINFO); + 2 : (unknown : PASN1_NULL); + end; + {$EXTERNALSYM OCSP_CERTSTATUS} + OCSP_CERTSTATUS = record + _type : TIdC_INT; + value : OCSP_CERTSTATUS_union; + end; + {$EXTERNALSYM POCSP_CERTSTATUS} + POCSP_CERTSTATUS = ^OCSP_CERTSTATUS; + {$EXTERNALSYM PPOCSP_CERTSTATUS} + PPOCSP_CERTSTATUS = ^POCSP_CERTSTATUS; +///* SingleResponse ::= SEQUENCE { +// * certID CertID, +// * certStatus CertStatus, +// * thisUpdate GeneralizedTime, +// * nextUpdate [0] EXPLICIT GeneralizedTime OPTIONAL, +// * singleExtensions [1] EXPLICIT Extensions OPTIONAL } +// */ + {$EXTERNALSYM OCSP_SINGLERESP} + OCSP_SINGLERESP = record + certId : POCSP_CERTID; + certStatus : POCSP_CERTSTATUS; + thisUpdate : PASN1_GENERALIZEDTIME; + nextUpdate : PASN1_GENERALIZEDTIME; + singleExtensions : PSTACK_OF_X509_EXTENSION; + end; + {$EXTERNALSYM POCSP_SINGLERESP} + POCSP_SINGLERESP = ^OCSP_SINGLERESP; + {$EXTERNALSYM PPOCSP_SINGLERESP} + PPOCSP_SINGLERESP = ^POCSP_SINGLERESP; + {$IFDEF DEBUG_SAFESTACK} + {$EXTERNALSYM STACK_OF_OCSP_SINGLERESP} + STACK_OF_OCSP_SINGLERESP = record + _stack: stack; + end; + {$EXTERNALSYM PSTACK_OF_OCSP_SINGLERESP} + PSTACK_OF_OCSP_SINGLERESP = ^STACK_OF_OCSP_SINGLERESP; + {$ELSE} + //I think the DECLARE_STACK_OF macro is empty + {$EXTERNALSYM PSTACK_OF_OCSP_SINGLERESP} + PSTACK_OF_OCSP_SINGLERESP = PSTACK; + {$ENDIF} +///* ResponseData ::= SEQUENCE { +// * version [0] EXPLICIT Version DEFAULT v1, +// * responderID ResponderID, +// * producedAt GeneralizedTime, +// * responses SEQUENCE OF SingleResponse, +// * responseExtensions [1] EXPLICIT Extensions OPTIONAL } +// */ + {$EXTERNALSYM OCSP_RESPDATA} + OCSP_RESPDATA = record + version : PASN1_INTEGER; + responderId : POCSP_RESPID; + producedAt : PASN1_GENERALIZEDTIME; + responses : PSTACK_OF_OCSP_SINGLERESP; + responseExtensions : PSTACK_OF_X509_EXTENSION; + end; + {$EXTERNALSYM POCSP_RESPDATA} + POCSP_RESPDATA = ^OCSP_RESPDATA; + {$EXTERNALSYM PPOCSP_RESPDATA} + PPOCSP_RESPDATA = ^POCSP_RESPDATA; +///* BasicOCSPResponse ::= SEQUENCE { +// * tbsResponseData ResponseData, +// * signatureAlgorithm AlgorithmIdentifier, +// * signature BIT STRING, +// * certs [0] EXPLICIT SEQUENCE OF Certificate OPTIONAL } +// */ +// /* Note 1: +// The value for "signature" is specified in the OCSP rfc2560 as follows: +// "The value for the signature SHALL be computed on the hash of the DER +// encoding ResponseData." This means that you must hash the DER-encoded +// tbsResponseData, and then run it through a crypto-signing function, which +// will (at least w/RSA) do a hash-'n'-private-encrypt operation. This seems +// a bit odd, but that's the spec. Also note that the data structures do not +// leave anywhere to independently specify the algorithm used for the initial +// hash. So, we look at the signature-specification algorithm, and try to do +// something intelligent. -- Kathy Weinhold, CertCo */ +// /* Note 2: +// It seems that the mentioned passage from RFC 2560 (section 4.2.1) is open +// for interpretation. I've done tests against another responder, and found +// that it doesn't do the double hashing that the RFC seems to say one +// should. Therefore, all relevant functions take a flag saying which +// variant should be used. -- Richard Levitte, OpenSSL team and CeloCom */ + {$EXTERNALSYM OCSP_BASICRESP} + OCSP_BASICRESP = record + tbsResponseData : POCSP_RESPDATA; + signatureAlgorithm : PX509_ALGOR; + signature : PASN1_BIT_STRING; + certs : PSTACK_OF_X509; + end; + {$EXTERNALSYM POCSP_BASICRESP} + POCSP_BASICRESP = ^OCSP_BASICRESP; + {$EXTERNALSYM PPOCSP_BASICRESP} + PPOCSP_BASICRESP = ^POCSP_BASICRESP; +///* CrlID ::= SEQUENCE { +// * crlUrl [0] EXPLICIT IA5String OPTIONAL, +// * crlNum [1] EXPLICIT INTEGER OPTIONAL, +// * crlTime [2] EXPLICIT GeneralizedTime OPTIONAL } +// */ + {$EXTERNALSYM OCSP_CRLID} + OCSP_CRLID = record + crlUrl : PASN1_IA5STRING; + crlNum : PASN1_INTEGER; + crlTime : PASN1_GENERALIZEDTIME; + end; + {$EXTERNALSYM POCSP_CRLID} + POCSP_CRLID = ^OCSP_CRLID; + {$EXTERNALSYM PPOCSP_CRLID} + PPOCSP_CRLID = ^POCSP_CRLID; +///* ServiceLocator ::= SEQUENCE { +// * issuer Name, +// * locator AuthorityInfoAccessSyntax OPTIONAL } +// */ + {$EXTERNALSYM OCSP_SERVICELOC} + OCSP_SERVICELOC = record + issuer : PX509_NAME; + locator : PSTACK_OF_ACCESS_DESCRIPTION; + end; + {$EXTERNALSYM POCSP_SERVICELOC} + POCSP_SERVICELOC = ^OCSP_SERVICELOC; + {$EXTERNALSYM PPOCSP_SERVICELOC} + PPOCSP_SERVICELOC = ^POCSP_SERVICELOC; + //mdc2.h + //MDC2_CTX = record + //this is not defined in headers so it's best use functions in the API to access the structure. + //end; + {$EXTERNALSYM PMDC2_CTX} + PMDC2_CTX = Pointer;//^MDC2_CTX; + //tmdiff.h +// MS_TM = record + //this is not defined in headers so it's best use functions in the API to access the structure. + // end; + {$EXTERNALSYM PMS_TM} + PMS_TM = Pointer;//^MS_TM; + {$EXTERNALSYM PPMS_TM} + PPMS_TM = ^PMS_TM; + //PEVP_PBE_KEYGEN = Pointer; + {$EXTERNALSYM ppem_password_cb} + ppem_password_cb = function (buf : PIdAnsiChar; size : TIdC_INT; rwflag : TIdC_INT; userdata : Pointer) : TIdC_INT; cdecl; + {$EXTERNALSYM PEM_ENCODE_SEAL_CTX} + PEM_ENCODE_SEAL_CTX = record + encode : EVP_ENCODE_CTX; + md : EVP_MD_CTX; + cipher : EVP_CIPHER_CTX; + end; + {$EXTERNALSYM PPEM_ENCODE_SEAL_CTX} + PPEM_ENCODE_SEAL_CTX = ^PEM_ENCODE_SEAL_CTX; + {$IFDEF DEBUG_SAFESTACK} + {$EXTERNALSYM STACK_OF_SSL_COMP} + STACK_OF_SSL_COMP = record + _stack: stack; + end; + {$EXTERNALSYM PSTACK_OF_SSL_COMP} + PSTACK_OF_SSL_COMP = ^STACK_OF_SSL_COMP; + {$ELSE} + //I think the DECLARE_STACK_OF macro is empty + {$EXTERNALSYM PSTACK_OF_SSL_COMP} + PSTACK_OF_SSL_COMP = PSTACK; + {$ENDIF} + {$EXTERNALSYM PPSTACK_OF_SSL_COMP} + PPSTACK_OF_SSL_COMP = ^PSTACK_OF_SSL_COMP; + {$EXTERNALSYM PSSL_COMP} + PSSL_COMP = ^SSL_COMP; + {$EXTERNALSYM lhash_of_SSL_SESSION} + lhash_of_SSL_SESSION = record + dummy : TIdC_INT; + end; + {$EXTERNALSYM Plhash_of_SSL_SESSION} + Plhash_of_SSL_SESSION = ^lhash_of_SSL_SESSION; + + // PASN1_UTCTIME = Pointer; + +//GREGOR - spremenjana deklaracija ker se tolèe +// Phostent = Pointer; + {$NODEFINE Phostent2} + Phostent2 = Pointer; +//END GREGOR +{ This should cause problems, but I will solve them ONLY if they came ... } +{ !!!InvalidTypes!!! } +//END REMY + //des.h + // des_cblock = Integer; + {$EXTERNALSYM DES_cblock} + DES_cblock = array[0..7] of Byte; + {$EXTERNALSYM PDES_cblock} + PDES_cblock = ^DES_cblock; + {$EXTERNALSYM const_DES_cblock} + const_DES_cblock = DES_cblock; + {$EXTERNALSYM Pconst_DES_cblock} + Pconst_DES_cblock = ^const_DES_cblock; + // des_key_schedule = Integer; + {$EXTERNALSYM DES_LONG} + {$IFDEF DES_INT} + DES_LONG = TIdC_UINT; + {$ELSE} + DES_LONG = TIdC_ULONG; + {$ENDIF} + {$EXTERNALSYM des_cblock_union} + des_cblock_union = record + case integer of + 0: (cblock: des_cblock); + 1: (deslong: array [0..1] of DES_LONG); + end; + {$EXTERNALSYM des_ks_struct} + des_ks_struct = record + ks : des_cblock_union; + //IMPORTANT!!! + //Since OpenSSL 0.9.7-dev, the OpenSSL developers + //dropped this member. See: + //http://marc.info/?l=openssl-dev&m=100342566217528&w=2 + + weak_key: TIdC_INT; + end; + {$EXTERNALSYM des_key_schedule} + des_key_schedule = array[0..15] of des_ks_struct; + {$EXTERNALSYM des_cblocks} + des_cblocks = array[0..7] of byte; + //des_cblocks = Integer; + //des_old.h + {$EXTERNALSYM _ossl_old_des_cblock} + _ossl_old_des_cblock = array [0..7] of byte; + {$EXTERNALSYM P_ossl_old_des_cblock} + P_ossl_old_des_cblock = ^_ossl_old_des_cblock; + {$EXTERNALSYM _ossl_old_des_ks_union} + _ossl_old_des_ks_union = record + case Integer of + 0 : (_ : _ossl_old_des_cblock); + //* make sure things are correct size on machines with + //* 8 byte longs */ + 2 : (pad : array [0..1] of DES_LONG); + end; + {$EXTERNALSYM _ossl_old_des_ks_struct} + _ossl_old_des_ks_struct = record + ks : _ossl_old_des_ks_union; + end; + {$EXTERNALSYM _ossl_old_des_key_schedule} + _ossl_old_des_key_schedule = array [0..15] of _ossl_old_des_ks_struct; + {$EXTERNALSYM P_ossl_old_des_key_schedule} + P_ossl_old_des_key_schedule = ^_ossl_old_des_key_schedule; +{IMPORTANT!!! + +In C, symbols are case sensitive while in Pascal, they are insensitive. +Thus, when we something like this: + +#define des_cblock DES_cblock + +we, should do something like this: + +_des_cblock = DES_cblock +} + {$EXTERNALSYM _des_cblock} + {$EXTERNALSYM _des_key_schedule} + {$IFNDEF OPENSSL_DES_LIBDES_COMPATIBILITY} + _des_cblock = DES_cblock; + {$EXTERNALSYM _const_des_cblock} + _const_des_cblock = const_DES_cblock; + _des_key_schedule = DES_key_schedule; + {$ELSE} +///* libdes compatibility */ +//* Map all symbol names to _ossl_old_des_* form, so we avoid all +// clashes with libdes */ + _des_cblock = _ossl_old_des_cblock; + _des_key_schedule = _ossl_old_des_key_schedule; + {$ENDIF} + {$EXTERNALSYM TIdSslLockingCallback} + TIdSslLockingCallback = procedure (mode, n : TIdC_INT; Afile : PIdAnsiChar; line : TIdC_INT); cdecl; + {$EXTERNALSYM TIdSslIdCallback} + TIdSslIdCallback = function: TIdC_ULONG; cdecl; +///ssl_locl.h structs. These are probably internal records so don't expose +//their members as ssl_lock.h is not included in the headers +//JPM + {$EXTERNALSYM PSSL3_ENC_METHOD} + PSSL3_ENC_METHOD = pointer;//^SSL3_ENC_METHOD; +// SSL3_ENC_METHOD = record +// end; + {$EXTERNALSYM PCERT} + PCERT = pointer; + {$EXTERNALSYM PPCERT} + PPCERT = ^PCERT; + {$EXTERNALSYM PSESS_CERT} + PSESS_CERT = pointer; + //pkcs7.h + {$EXTERNALSYM PPKCS7} + PPKCS7 = ^PKCS7; + {$EXTERNALSYM PPPKCS7} + PPPKCS7 = ^PPKCS7; + {$EXTERNALSYM PKCS7_ISSUER_AND_SERIAL} + PKCS7_ISSUER_AND_SERIAL = record + issuer : PX509_NAME; + serial : PASN1_INTEGER; + end; + {$EXTERNALSYM PPKCS7_ISSUER_AND_SERIAL} + PPKCS7_ISSUER_AND_SERIAL = ^PKCS7_ISSUER_AND_SERIAL; + {$EXTERNALSYM PKCS7_SIGNER_INFO} + PKCS7_SIGNER_INFO = record + version : PASN1_INTEGER; // version 1 + issuer_and_serial : PPKCS7_ISSUER_AND_SERIAL; + digest_alg : PX509_ALGOR; + auth_attr : PSTACK_OF_X509_ATTRIBUTE; // [ 0 ] + digest_enc_alg : PX509_ALGOR; + enc_digest : PASN1_OCTET_STRING; + unauth_attr : PSTACK_OF_X509_ATTRIBUTE; // [ 1 ] + // The private key to sign with + pkey : PEVP_PKEY; + end; + {$EXTERNALSYM PPKCS7_SIGNER_INFO} + PPKCS7_SIGNER_INFO = ^PKCS7_SIGNER_INFO; + {$IFDEF DEBUG_SAFESTACK} + {$EXTERNALSYM STACK_OF_PKCS7_SIGNER_INFO} + STACK_OF_PKCS7_SIGNER_INFO = record + _stack: stack; + end; + {$EXTERNALSYM PSTACK_OF_PKCS7_SIGNER_INFO} + PSTACK_OF_PKCS7_SIGNER_INFO = ^STACK_OF_PKCS7_SIGNER_INFO; + {$ELSE} + //I think the DECLARE_STACK_OF macro is empty + {$EXTERNALSYM PSTACK_OF_PKCS7_SIGNER_INFO} + PSTACK_OF_PKCS7_SIGNER_INFO = PSTACK; + {$ENDIF} + {$EXTERNALSYM PKCS7_RECIP_INFO} + PKCS7_RECIP_INFO = record + version : PASN1_INTEGER; // version 0 + issuer_and_serial : PPKCS7_ISSUER_AND_SERIAL; + key_enc_algor : PX509_ALGOR; + enc_key : PASN1_OCTET_STRING; + cert : PX509; // get the pub-key from this + end; + {$IFDEF DEBUG_SAFESTACK} + {$EXTERNALSYM STACK_OF_PKCS7_RECIP_INFO} + STACK_OF_PKCS7_RECIP_INFO = record + _stack: stack; + end; + {$EXTERNALSYM PSTACK_OF_PKCS7_RECIP_INFO} + PSTACK_OF_PKCS7_RECIP_INFO = ^STACK_OF_PKCS7_RECIP_INFO; + {$ELSE} + //I think the DECLARE_STACK_OF macro is empty + {$EXTERNALSYM PSTACK_OF_PKCS7_RECIP_INFO} + PSTACK_OF_PKCS7_RECIP_INFO = PSTACK; + {$ENDIF} + {$EXTERNALSYM PPSTACK_OF_PKCS7_RECIP_INFO} + PPSTACK_OF_PKCS7_RECIP_INFO = ^PSTACK_OF_PKCS7_RECIP_INFO; + {$EXTERNALSYM PKCS7_SIGNED} + PKCS7_SIGNED = record + version : PASN1_INTEGER; // version 1 + md_algs : PSTACK_OF_X509_ALGOR; // md used + cert : PSTACK_OF_X509; // [ 0 ] + crl : PSTACK_OF_X509_CRL; // [ 1 ] + signer_info : PSTACK_OF_PKCS7_SIGNER_INFO; + contents : PPKCS7; + end; + {$EXTERNALSYM PPKCS7_SIGNED} + PPKCS7_SIGNED = ^PKCS7_SIGNED; + {$EXTERNALSYM PPPKCS7_SIGNED} + PPPKCS7_SIGNED = ^PPKCS7_SIGNED; + {$EXTERNALSYM PKCS7_ENC_CONTENT} + PKCS7_ENC_CONTENT = record + content_type : PASN1_OBJECT; + algorithm : PX509_ALGOR; + enc_data : PASN1_OCTET_STRING; // [ 0 ] + cipher : PEVP_CIPHER; + end; + {$EXTERNALSYM PPKCS7_ENC_CONTENT} + PPKCS7_ENC_CONTENT = ^PKCS7_ENC_CONTENT; + {$EXTERNALSYM PKCS7_ENVELOPE} + PKCS7_ENVELOPE = record + version : PASN1_INTEGER; // version 0 + recipientinfo : PSTACK_OF_PKCS7_RECIP_INFO; + enc_data : PPKCS7_ENC_CONTENT; + end; + {$EXTERNALSYM PPKCS7_ENVELOPE} + PPKCS7_ENVELOPE = ^PKCS7_ENVELOPE; + // OpenSSL developer notes + // The above structure is very very similar to PKCS7_SIGN_ENVELOPE. + // How about merging the two + {$EXTERNALSYM PKCS7_SIGN_ENVELOPE} + PKCS7_SIGN_ENVELOPE = record + version : PASN1_INTEGER; // version 1 + md_algs : PSTACK_OF_X509_ALGOR; // md used + cert : PSTACK_OF_X509; // [ 0 ] + crl : PSTACK_OF_X509_CRL; // [ 1 ] + signer_info : PSTACK_OF_PKCS7_SIGNER_INFO; + enc_data : PPKCS7_ENC_CONTENT; + recipientinfo : PSTACK_OF_PKCS7_RECIP_INFO; + end; + {$EXTERNALSYM PPKCS7_SIGN_ENVELOPE} + PPKCS7_SIGN_ENVELOPE = ^PKCS7_SIGN_ENVELOPE; + {$EXTERNALSYM PKCS7_DIGEST} + PKCS7_DIGEST = record + version : PASN1_INTEGER; // version 0 + md : PX509_ALGOR; // md used + contents : PPKCS7; + digest : PASN1_OCTET_STRING; + end; + {$EXTERNALSYM PPKCS7_DIGEST} + PPKCS7_DIGEST = ^PKCS7_DIGEST; + {$EXTERNALSYM PKCS7_ENCRYPT} + PKCS7_ENCRYPT = record + version : PASN1_INTEGER; // version 0 + enc_data : PPKCS7_ENC_CONTENT; + end; + {$EXTERNALSYM PPKCS7_ENCRYPT} + PPKCS7_ENCRYPT = ^PKCS7_ENCRYPT; + {$EXTERNALSYM PKCS7_union} + PKCS7_union = record + // content as defined by the type + // all encryption/message digests are applied to the 'contents', + // leaving out the 'type' field. + case Integer of + 0 : (ptr : PIdAnsiChar); + // NID_pkcs7_data + 1 : (data : PASN1_OCTET_STRING); + // NID_pkcs7_signed + 2 : (sign : PPKCS7_SIGNED); + // NID_pkcs7_enveloped + 3 : (enveloped : PPKCS7_ENVELOPE); + // NID_pkcs7_signedAndEnveloped + 4 : (signed_and_enveloped : PPKCS7_SIGN_ENVELOPE); + // NID_pkcs7_digest + 5 : (digest : PPKCS7_DIGEST); + // NID_pkcs7_encrypted + 6 : (encrypted : PPKCS7_ENCRYPT); + end; + {$EXTERNALSYM PKCS7} + PKCS7 = record + // The following is non NULL if it contains ASN1 encoding of + // this structure + asn1 : PIdAnsiChar; + length : TIdC_LONG; +//#define PKCS7_S_HEADER 0 +//#define PKCS7_S_BODY 1 +//#define PKCS7_S_TAIL 2 + state : TIdC_INT; // used during processing + detached : TIdC_INT; + _type : PASN1_OBJECT; + // content as defined by the type + // all encryption/message digests are applied to the 'contents', + // leaving out the 'type' field. + d : PKCS7_union; + end; + {$IFDEF DEBUG_SAFESTACK} + {$EXTERNALSYM STACK_OF_PKCS7} + STACK_OF_PKCS7 = record + _stack: stack; + end; + {$EXTERNALSYM PSTACK_OF_PKCS7} + PSTACK_OF_PKCS7 = ^STACK_OF_PKCS7; + {$ELSE} + //I think the DECLARE_STACK_OF macro is empty + {$EXTERNALSYM PSTACK_OF_PKCS7} + PSTACK_OF_PKCS7 = PSTACK; + {$ENDIF} + //pkcs12.h + {$EXTERNALSYM PKCS12_MAC_DATA} + PKCS12_MAC_DATA = record + dinfo : PX509_SIG; + salt : PASN1_OCTET_STRING; + iter : PASN1_INTEGER; // defaults to 1 + end; + {$EXTERNALSYM PPKCS12_MAC_DATA} + PPKCS12_MAC_DATA = ^PKCS12_MAC_DATA; + // PSESS_CERT = ^SESS_CERT; + {$EXTERNALSYM PPKCS12} + PPKCS12 = ^PKCS12; + {$EXTERNALSYM PPPKCS12} + PPPKCS12 = ^PPKCS12; + {$EXTERNALSYM PKCS12} + PKCS12 = record + version : PASN1_INTEGER; + mac : PPKCS12_MAC_DATA; + authsafes : PPKCS7; + end; + //ts.h + {$IFDEF DEBUG_SAFESTACK} + {$EXTERNALSYM STACK_OF_EVP_MD} + STACK_OF_EVP_MD = record + _stack: stack; + end; + {$EXTERNALSYM PSTACK_OF_EVP_MD} + PSTACK_OF_EVP_MD = ^STACK_OF_EVP_MD; + {$EXTERNALSYM STACK_OF_ASN1_UTF8STRING} + STACK_OF_ASN1_UTF8STRING = record + _stack: stack; + end; + {$EXTERNALSYM PSTACK_OF_ASN1_UTF8STRING} + PSTACK_OF_ASN1_UTF8STRING = ^STACK_OF_ASN1_UTF8STRING; + {$ELSE} + //I think the DECLARE_STACK_OF macro is empty + {$EXTERNALSYM PSTACK_OF_EVP_MD} + PSTACK_OF_EVP_MD = PSTACK; + {$EXTERNALSYM PSTACK_OF_ASN1_UTF8STRING} + PSTACK_OF_ASN1_UTF8STRING = PSTACK; + {$ENDIF} + {$EXTERNALSYM TS_MSG_IMPRINT} + TS_MSG_IMPRINT = record + hash_algo : PX509_ALGOR; + hashed_msg : PASN1_OCTET_STRING; + end; + {$EXTERNALSYM PTS_MSG_IMPRINT} + PTS_MSG_IMPRINT = ^TS_MSG_IMPRINT; + {$EXTERNALSYM TS_REQ} + TS_REQ = record + version : PASN1_INTEGER; + msg_imprint : PTS_MSG_IMPRINT; + policy_id : PASN1_OBJECT; //* OPTIONAL */ + nonce : PASN1_INTEGER; //* OPTIONAL */ + cert_req : ASN1_BOOLEAN; //* DEFAULT FALSE */ + extensions : PSTACK_OF_X509_EXTENSION; //* [0] OPTIONAL */ + end; + {$EXTERNALSYM PTS_REQ} + PTS_REQ = ^TS_REQ; + {$EXTERNALSYM TS_ACCURACY} + TS_ACCURACY = record + seconds : PASN1_INTEGER; + millis : PASN1_INTEGER; + micros : PASN1_INTEGER; + end; + {$EXTERNALSYM PTS_ACCURACY} + PTS_ACCURACY = ^TS_ACCURACY; + {$EXTERNALSYM TS_TST_INFO} + TS_TST_INFO = record + version : PASN1_INTEGER; + policy_id : PASN1_OBJECT; + msg_imprint : PTS_MSG_IMPRINT; + serial : PASN1_INTEGER; + time : PASN1_GENERALIZEDTIME; + accuracy : PTS_ACCURACY; + ordering : PASN1_BOOLEAN; + nonce : PASN1_INTEGER; + tsa : PGENERAL_NAME; + extensions : PSTACK_OF_X509_EXTENSION; + end; + {$EXTERNALSYM PTS_TST_INFO} + PTS_TST_INFO = ^TS_TST_INFO; + {$EXTERNALSYM TS_STATUS_INFO} + TS_STATUS_INFO = record + status : PASN1_INTEGER; + text : PSTACK_OF_ASN1_UTF8STRING; + failure_info : PASN1_BIT_STRING; + end; + {$EXTERNALSYM PTS_STATUS_INFO} + PTS_STATUS_INFO = ^TS_STATUS_INFO; + {$EXTERNALSYM TS_RESP} + TS_RESP = record + status_info : PTS_STATUS_INFO; + token : PPKCS7; + tst_info : PTS_TST_INFO; + end; + {$EXTERNALSYM PTS_RESP} + PTS_RESP = ^TS_RESP; + {$EXTERNALSYM ESS_ISSUER_SERIAL} + ESS_ISSUER_SERIAL = record + issuer : PSTACK_OF_GENERAL_NAME; + serial : PASN1_INTEGER; + end; + {$EXTERNALSYM PESS_ISSUER_SERIAL} + PESS_ISSUER_SERIAL = ^ESS_ISSUER_SERIAL; + {$EXTERNALSYM ESS_CERT_ID} + ESS_CERT_ID = record + hash : PASN1_OCTET_STRING; //* Always SHA-1 digest. */ + issuer_serial : PESS_ISSUER_SERIAL; + end; + {$EXTERNALSYM PESS_CERT_ID} + PESS_CERT_ID = ^ESS_CERT_ID; + {$IFDEF DEBUG_SAFESTACK} + {$EXTERNALSYM STACK_OF_ESS_CERT_ID} + STACK_OF_ESS_CERT_ID = record + _stack: stack; + end; + {$EXTERNALSYM PSTACK_OF_ESS_CERT_ID} + PSTACK_OF_ESS_CERT_ID = ^STACK_OF_ESS_CERT_ID; + {$ELSE} + //I think the DECLARE_STACK_OF macro is empty + {$EXTERNALSYM PSTACK_OF_ESS_CERT_ID} + PSTACK_OF_ESS_CERT_ID = PSTACK; + {$ENDIF} + {$EXTERNALSYM ESS_SIGNING_CERT} + ESS_SIGNING_CERT = record + cert_ids : PSTACK_OF_ESS_CERT_ID; + policy_info : PSTACK_OF_POLICYINFO; + end; + {$EXTERNALSYM PESS_SIGNING_CERT} + PESS_SIGNING_CERT = ^ESS_SIGNING_CERT; + {$EXTERNALSYM PTS_resp_ctx} + PTS_resp_ctx = ^TS_resp_ctx; +//* This must return a unique number less than 160 bits long. */ +//typedef ASN1_INTEGER *(*TS_serial_cb)(struct TS_resp_ctx *, void *); + {$EXTERNALSYM TS_serial_cb} + TS_serial_cb = function (p1 : PTS_resp_ctx; p2 : Pointer) : PASN1_INTEGER cdecl; + //* This must return the seconds and microseconds since Jan 1, 1970 in + // the sec and usec variables allocated by the caller. + // Return non-zero for success and zero for failure. */ +//typedef int (*TS_time_cb)(struct TS_resp_ctx *, void *, long *sec, long *usec); + {$EXTERNALSYM TS_time_cb} + TS_time_cb = function (p1 : PTS_resp_ctx; p2 : Pointer; sec, usec : TIdC_LONG) : TIdC_INT cdecl; +///* This must process the given extension. +// * It can modify the TS_TST_INFO object of the context. +// * Return values: !0 (processed), 0 (error, it must set the +// * status info/failure info of the response). +// */ +//typedef int (*TS_extension_cb)(struct TS_resp_ctx *, X509_EXTENSION *, void *); + {$EXTERNALSYM TS_extension_cb} + TS_extension_cb = function (p1 : PTS_resp_ctx; p2 : PX509_EXTENSION; p3 : Pointer) : TIdC_INT cdecl; + {$EXTERNALSYM TS_RESP_CTX} + TS_RESP_CTX = record + signer_cert : PX509; + signer_key : PEVP_PKEY; + certs : PSTACK_OF_X509; //* Certs to include in signed data. */ + policies : PSTACK_OF_ASN1_OBJECT; //* Acceptable policies. */ + default_policy : PASN1_OBJECT; //* It may appear in policies, too. */ + mds : PSTACK_OF_EVP_MD; //* Acceptable message digests. */ + seconds : PASN1_INTEGER; //* accuracy, 0 means not specified. */ + millis : PASN1_INTEGER; //* accuracy, 0 means not specified. */ + micros : PASN1_INTEGER; //* accuracy, 0 means not specified. */ + clock_precision_digits : TIdC_UNSIGNED; //* fraction of seconds in + //time stamp token. */ + flags : TIdC_UNSIGNED; //* Optional info, see values above. */ + + //* Callback functions. */ + serial_cb : TS_serial_cb; + serial_cb_data : Pointer; //* User data for serial_cb. */ + + time_cb : TS_time_cb; + time_cb_data : Pointer; //* User data for time_cb. */ + + extension_cb : TS_extension_cb; + extension_cb_data : Pointer; //* User data for extension_cb. */ + + //* These members are used only while creating the response. */ + request : PTS_REQ; + response : PTS_RESP; + tst_info : PTS_TST_INFO; + end; + {$EXTERNALSYM TS_VERIFY_CTX} + TS_VERIFY_CTX = record + //* Set this to the union of TS_VFY_... flags you want to carry out. */ + flags : TIdC_UNSIGNED; + + //* Must be set only with TS_VFY_SIGNATURE. certs is optional. */ + store : PX509_STORE; + certs : PSTACK_OF_X509; + + //* Must be set only with TS_VFY_POLICY. */ + policy : PASN1_OBJECT; + +// /* Must be set only with TS_VFY_IMPRINT. If md_alg is NULL, +// the algorithm from the response is used. */ + md_alg : PX509_ALGOR; + imprint : PIdAnsiChar; + imprint_len : TIdC_UNSIGNED; + + //* Must be set only with TS_VFY_DATA. */ + data : PBIO; + + //* Must be set only with TS_VFY_TSA_NAME. */ + nonce : PASN1_INTEGER; + + //* Must be set only with TS_VFY_TSA_NAME. */ + tsa_name : PGENERAL_NAME; + end; + {$EXTERNALSYM PTS_VERIFY_CTX} + PTS_VERIFY_CTX = ^TS_VERIFY_CTX; + //comp.h + {$EXTERNALSYM PCOMP_CTX} + PCOMP_CTX = ^COMP_CTX; + {$EXTERNALSYM COMP_METHOD} + COMP_METHOD = record + _type : TIdC_INT; // NID for compression library + name : PIdAnsiChar; // A text string to identify the library + init : function (ctx : PCOMP_CTX) : TIdC_INT; cdecl; + finish : procedure (ctx : PCOMP_CTX); cdecl; + compress : function (ctx : PCOMP_CTX; + _out : PIdAnsiChar; olen : TIdC_UINT; + _in : PIdAnsiChar; ilen : TIdC_UINT) : TIdC_INT; cdecl; + expand : function (ctx : PCOMP_CTX; + _out : PIdAnsiChar; olen : TIdC_UINT; + _in : PIdAnsiChar; ilen : TIdC_UINT) : TIdC_INT; cdecl; + // The following two do NOTHING, but are kept for backward compatibility + ctrl : function : TIdC_INT; cdecl; + callback_ctrl : function : TIdC_INT; cdecl; + end; + {$EXTERNALSYM PCOMP_METHOD} + PCOMP_METHOD = ^COMP_METHOD; + {$EXTERNALSYM COMP_CTX} + COMP_CTX = record + meth : PCOMP_METHOD; + compress_in : TIdC_ULONG; + compress_out : TIdC_ULONG; + expand_in : TIdC_ULONG; + expand_out : TIdC_ULONG; + ex_data : PCRYPTO_EX_DATA; + end; + //srp.h + {$EXTERNALSYM SRP_gN_cache} + SRP_gN_cache = record + b64_bn : PIdAnsiChar; + bn : PBIGNUM; + end; + {$EXTERNALSYM PSRP_gN_cache} + PSRP_gN_cache = ^SRP_gN_cache; + {$IFDEF DEBUG_SAFESTACK} + {$EXTERNALSYM STACK_OF_SRP_gN_cache} + STACK_OF_SRP_gN_cache = record + _stack: stack; + end; + {$EXTERNALSYM PSTACK_OF_SRP_gN_cache} + PSTACK_OF_SRP_gN_cache = ^STACK_OF_SRP_gN_cache; + {$ELSE} + //I think the DECLARE_STACK_OF macro is empty + {$EXTERNALSYM PSTACK_OF_SRP_gN_cache} + PSTACK_OF_SRP_gN_cache = PSTACK; + {$ENDIF} + {$EXTERNALSYM SRP_user_pwd} + SRP_user_pwd = record + id : PIdAnsiChar; + s : PBIGNUM; + v : PBIGNUM; + g : PBIGNUM; + N : PBIGNUM; + info : PIdAnsiChar; + end; + {$EXTERNALSYM PSRP_user_pwd} + PSRP_user_pwd = ^SRP_user_pwd; + {$IFDEF DEBUG_SAFESTACK} + {$EXTERNALSYM STACK_OF_SRP_user_pwd} + STACK_OF_SRP_user_pwd = record + _stack: stack; + end; + {$EXTERNALSYM PSTACK_OF_SRP_user_pwd} + PSTACK_OF_SRP_user_pwd = ^STACK_OF_SRP_user_pwd; + {$ELSE} + //I think the DECLARE_STACK_OF macro is empty + {$EXTERNALSYM PSTACK_OF_SRP_user_pwd} + PSTACK_OF_SRP_user_pwd = PSTACK; + {$ENDIF} + {$EXTERNALSYM SRP_VBASE} + SRP_VBASE = record + users_pwd : PSTACK_OF_SRP_user_pwd; + gN_cache : PSTACK_OF_SRP_gN_cache; +//* to simulate a user */ + seed_key : PIdAnsiChar; + default_g : PBIGNUM; + default_N : PBIGNUM; + end; + {$EXTERNALSYM PSRP_VBASE} + PSRP_VBASE = ^SRP_VBASE; + +//*Structure interne pour retenir les couples N et g*/ + {$EXTERNALSYM SRP_gN} + SRP_gN = record + id : PIdAnsiChar; + g : PBIGNUM; + N : PBIGNUM; + end; + {$EXTERNALSYM PSRP_gN} + PSRP_gN = ^SRP_gN; + + {$IFDEF DEBUG_SAFESTACK} + {$EXTERNALSYM STACK_OF_SRP_gN} + STACK_OF_SRP_gN = record + _stack: stack; + end; + {$EXTERNALSYM PSTACK_OF_SRP_gN} + PSTACK_OF_SRP_gN = ^STACK_OF_SRP_gN; + {$ELSE} + //I think the DECLARE_STACK_OF macro is empty + {$EXTERNALSYM PSTACK_OF_SRP_gN} + PSTACK_OF_SRP_gN = PSTACK; + {$ENDIF} + //kssl.h + {These are structures for Kerberos support. These will not be complete because + FreePascal, Borland Delphi, and Indy don't support Kerberos. These are here + as place holders so we get an exact OpenSSL API if Kerberos support was compiled + in. + } + {$IFNDEF OPENSSL_NO_KRB5} + {$EXTERNALSYM KSSL_ERR} + KSSL_ERR = record + reason : TIdC_INT; + text : array [0..KSSL_ERR_MAX] of Char; + end; + {$EXTERNALSYM PKSSL_CTX} + {I am not going to do anything to define this because it uses things in the + Kerberos API. Since there's no support for Kerberos, I'm leaving it empty. + We only need the pointer anyway} + + PKSSL_CTX = Pointer; //^KSSL_CTX; + {$ENDIF} + //ssl.h + {$ifndef OPENSSL_NO_SSL_INTERN} + {$EXTERNALSYM PSSL_CIPHER} + PSSL_CIPHER = ^SSL_CIPHER; + {$EXTERNALSYM SSL_CIPHER} + SSL_CIPHER = record + valid : TIdC_INT; + name: PIdAnsiChar; // text name + id: TIdC_ULONG; // id, 4 bytes, first is version + + //* changed in 0.9.9: these four used to be portions of a single value 'algorithms' */ + algorithm_mkey : TIdC_ULONG; //* key exchange algorithm */ + algorithm_auth : TIdC_ULONG; //* server authentication */ + algorithm_enc : TIdC_ULONG; //* symmetric encryption */ + algorithm_mac : TIdC_ULONG; //* symmetric authentication */ + algorithm_ssl : TIdC_ULONG; //* (major) protocol version */ + algo_strength: TIdC_ULONG; // strength and export flags + algorithm2: TIdC_ULONG;// Extra flags + strength_bits: TIdC_INT; // Number of bits really used + alg_bits: TIdC_INT; // Number of bits for algorithm + end; + {$IFDEF DEBUG_SAFESTACK} + {$EXTERNALSYM STACK_OF_SSL_CIPHER} + STACK_OF_SSL_CIPHER = record + _stack: STACK; + end; + {$EXTERNALSYM PSTACK_OF_SSL_CIPHER} + PSTACK_OF_SSL_CIPHER = ^STACK_OF_SSL_CIPHER; + {$ELSE} + //I think the DECLARE_STACK_OF macro is empty + {$EXTERNALSYM PSTACK_OF_SSL_CIPHER} + PSTACK_OF_SSL_CIPHER = PSTACK; + {$ENDIF} + + {$EXTERNALSYM PSSL_SESSION} + PSSL_SESSION = ^SSL_SESSION; + {$EXTERNALSYM SSL_SESSION} + SSL_SESSION = record + ssl_version : TIdC_INT; // what ssl version session info is being kept in here? + // only really used in SSLv2 + key_arg_length: TIdC_UINT; + key_arg: Array[0..SSL_MAX_KEY_ARG_LENGTH-1] of Byte; + master_key_length: TIdC_INT; + master_key: Array[0..SSL_MAX_MASTER_KEY_LENGTH-1] of Byte; + // session_id - valid? + session_id_length: TIdC_UINT; + session_id: Array[0..SSL_MAX_SSL_SESSION_ID_LENGTH-1] of Byte; + // this is used to determine whether the session is being reused in + // the appropriate context. It is up to the application to set this, + // via SSL_new + sid_ctx_length: TIdC_UINT; + sid_ctx: array[0..SSL_MAX_SID_CTX_LENGTH-1] of Byte; + {$IFNDEF OPENSSL_NO_KRB5} + krb5_client_princ_len: TIdC_UINT; + krb5_client_princ: array[0..SSL_MAX_KRB5_PRINCIPAL_LENGTH-1] of Byte; + {$ENDIF} +{$ifndef OPENSSL_NO_PSK} + psk_identity_hint : PIdAnsiChar; + psk_identity : PIdAnsiChar; +{$endif} + not_resumable: TIdC_INT; + // The cert is the certificate used to establish this connection + sess_cert : PSESS_CERT; + + //* This is the cert for the other end. + // * On clients, it will be the same as sess_cert->peer_key->x509 + // * (the latter is not enough as sess_cert is not retained + // * in the external representation of sessions, see ssl_asn1.c). */ + peer : PX509; + //* when app_verify_callback accepts a session where the peer's certificate + // * is not ok, we must remember the error for session reuse: */ + verify_result : TIdC_LONG; //* only for servers */ + references : TIdC_INT; + timeout : TIdC_LONG; + time : TIdC_LONG; + compress_meth : TIdC_UINT; //* Need to lookup the method */ + + cipher : PSSL_CIPHER; + cipher_id : TIdC_ULONG; //* when ASN.1 loaded, this + // * needs to be used to load + // * the 'cipher' structure */ + ciphers : PSTACK_OF_SSL_CIPHER; //* shared ciphers? */ + ex_data : CRYPTO_EX_DATA; // application specific data */ + //* These are used to make removal of session-ids more + // * efficient and to implement a maximum cache size. */ + prev, next : PSSL_SESSION; + + {$IFNDEF OPENSSL_NO_TLSEXT} + tlsext_hostname : PIdAnsiChar; + {$IFDEF OPENSSL_NO_EC} + tlsext_ecpointformatlist_length : size_t; + tlsext_ecpointformatlist : PIdAnsiChar; //* peer's list */ + tlsext_ellipticcurvelist_length : size_t; + tlsext_ellipticcurvelist : PIdAnsiChar; //* peer's list */ + {$ENDIF} //* OPENSSL_NO_EC */ + + //* RFC4507 info */ + tlsext_tick : PIdAnsiChar;//* Session ticket */ + tlsext_ticklen : size_t;//* Session ticket length */ + tlsext_tick_lifetime_hint : TIdC_LONG;//* Session lifetime hint in seconds */ + {$ENDIF} +{$ifndef OPENSSL_NO_SRP} + srp_username : PIdAnsiChar; +{$endif} + end; + {$ENDIF} + +{$ifndef OPENSSL_NO_SRP} + +{$ifndef OPENSSL_NO_SSL_INTERN} + + {$EXTERNALSYM SRP_CTX} + SRP_CTX = record + //* param for all the callbacks */ + SRP_cb_arg : Pointer; + //* set client Hello login callback */ + TLS_ext_srp_username_callback : function(para1 : PSSL; para2 : TIdC_INT; para3 : Pointer) : TIdC_INT cdecl; + //int (*TLS_ext_srp_username_callback)(SSL *, int *, void *); + //* set SRP N/g param callback for verification */ + SRP_verify_param_callback : function(para1 : PSSL; para2 : Pointer) : TIdC_INT cdecl; +// int (*SRP_verify_param_callback)(SSL *, void *); + //* set SRP client passwd callback */ + SRP_give_srp_client_pwd_callback : function(para1 : PSSL; para2 : Pointer) : PIdAnsiChar cdecl; + // char *(*SRP_give_srp_client_pwd_callback)(SSL *, void *); + login : PIdAnsiChar; + N, g, s, B, A : PBIGNUM; + _a, _b, v : PBIGNUM; + info : PIdAnsiChar; + strength : TIdC_INT; + srp_Mask : TIdC_ULONG; + end; + {$EXTERNALSYM PSRP_CTX} + PSRP_CTX = ^SRP_CTX; +{$endif} +{$ENDIF} + // typedef struct ssl_method_st + {$NODEFINE PSSL_CTX} + PSSL_CTX = ^SSL_CTX; + {$EXTERNALSYM SRTP_PROTECTION_PROFILE} + SRTP_PROTECTION_PROFILE = record + name : PIdAnsiChar; + id : TIdC_ULONG; + end; + {$EXTERNALSYM PTLS_SESSION_TICKET_EXT} + PTLS_SESSION_TICKET_EXT = ^TLS_SESSION_TICKET_EXT; + {$EXTERNALSYM TLS_SESSION_TICKET_EXT} + TLS_SESSION_TICKET_EXT = record + length : TIdC_USHORT; + data : Pointer; + end; + {$EXTERNALSYM PSRTP_PROTECTION_PROFILE} + PSRTP_PROTECTION_PROFILE = ^SRTP_PROTECTION_PROFILE; + {$EXTERNALSYM tls_session_ticket_ext_cb_fn} + tls_session_ticket_ext_cb_fn = function(S : PSSL; data : PIdAnsiChar; len : TIdC_INT; arg : Pointer) : TIdC_INT cdecl; + {$EXTERNALSYM tls_session_secret_cb_fn} + tls_session_secret_cb_fn = function(S : PSSL; + secret : Pointer; + var secret_len : TIdC_INT; + peer_ciphers : PSTACK_OF_SSL_CIPHER; + out cipher : PSSL_CIPHER) : TIdC_INT cdecl; + {$EXTERNALSYM SSL_METHOD_PROC} + SSL_METHOD_PROC = procedure; cdecl; + {$NODEFINE PSSL_METHOD} + PSSL_METHOD = ^SSL_METHOD; + {$NODEFINE SSL_METHOD} + SSL_METHOD = record + version: TIdC_INT; + ssl_new: function(s: PSSL): TIdC_INT; cdecl; + ssl_clear: procedure(s: PSSL); cdecl; + ssl_free: procedure(s: PSSL); cdecl; + ssl_accept: function(s: PSSL): TIdC_INT; cdecl; + ssl_connect: function(s: PSSL): TIdC_INT; cdecl; + ssl_read: function(s: PSSL; buf: Pointer; len: TIdC_INT):TIdC_INT; cdecl; + ssl_peek: function(s: PSSL; buf: Pointer; len: TIdC_INT):TIdC_INT; cdecl; + ssl_write: function(s: PSSL; const buf: Pointer; len:TIdC_INT): TIdC_INT; cdecl; + ssl_shutdown: function(s: PSSL): TIdC_INT; cdecl; + ssl_renegotiate: function(s: PSSL): TIdC_INT; cdecl; + ssl_renegotiate_check: function(s: PSSL): TIdC_INT; cdecl; + ssl_get_message: function(s: PSSL; st1, stn, mt: TIdC_INT; max: TIdC_LONG; ok: PIdC_INT): TIdC_LONG; cdecl; + ssl_read_bytes: function(s: PSSL; _type: TIdC_INT; buf:PByte; len, peek: TIdC_INT): TIdC_INT; cdecl; + ssl_write_bytes: function(s: PSSL; _type: TIdC_INT; const buf: Pointer; len: TIdC_INT): TIdC_INT; cdecl; + ssl_dispatch_alert: function(s: PSSL): TIdC_INT; cdecl; + ssl_ctrl: function(s: PSSL; cmd: TIdC_INT; larg: TIdC_LONG; parg: Pointer): TIdC_LONG; cdecl; + ssl_ctx_ctrl: function(ctx: PSSL_CTX; cmd: TIdC_INT; larg:TIdC_LONG; parg: Pointer): TIdC_LONG; cdecl; + get_cipher_by_char: function(const ptr: PByte):PSSL_CIPHER; cdecl; + put_cipher_by_char: function(const cipher: PSSL_CIPHER;ptr: PByte): TIdC_INT; cdecl; + ssl_pending: function(const s: PSSL): TIdC_INT; cdecl; + num_ciphers: function: TIdC_INT; cdecl; + get_cipher: function(ncipher: TIdC_UNSIGNED): PSSL_CIPHER;cdecl; + get_ssl_method: function(version: TIdC_INT): PSSL_METHOD; cdecl; + get_timeout: function : TIdC_LONG; cdecl; + ssl3_enc: PSSL3_ENC_METHOD; + ssl_version: function : TIdC_INT; cdecl; + ssl_callback_ctrl: function(s: PSSL; cb_id: TIdC_INT; fp: SSL_METHOD_PROC): TIdC_LONG; cdecl; + ssl_ctx_callback_ctrl: function(s: PSSL_CTX; cb_id:TIdC_INT; fp: SSL_METHOD_PROC): TIdC_LONG; cdecl; + end; + {$EXTERNALSYM PPSSL_METHOD} + PPSSL_METHOD =^PSSL_METHOD; +// This callback type is used inside SSL_CTX, SSL, and in the functions that set +// them. It is used to override the generation of SSL/TLS session IDs in a +// server. Return value should be zero on an error, non-zero to proceed. Also, +// callbacks should themselves check if the id they generate is unique otherwise +// the SSL handshake will fail with an error - callbacks can do this using the +// 'ssl' value they're passed by; +// SSL_has_matching_session_id(ssl, id, *id_len) +// The length value passed in is set at the maximum size the session ID can be. +// In SSLv2 this is 16 bytes, whereas SSLv3/TLSv1 it is 32 bytes. The callback +// can alter this length to be less if desired, but under SSLv2 session IDs are +// supposed to be fixed at 16 bytes so the id will be padded after the callback +// returns in this case. It is also an error for the callback to set the size to +// zero. + {$EXTERNALSYM PGEN_SESSION_CB} + PGEN_SESSION_CB = function (const SSL : PSSL; id : PByte; id_len : TIdC_UINT) : TIdC_INT; cdecl; + {$EXTERNALSYM SSL_COMP} + SSL_COMP = record + id : TIdC_INT; + name : PIdAnsiChar; + {$IFNDEF OPENSSL_NO_COMP} + method : PCOMP_METHOD; + {$ELSE} + method : PIdAnsiChar; + {$ENDIF} + end; + {$IFDEF DEBUG_SAFESTACK} + {$EXTERNALSYM STACK_OF_COMP} + STACK_OF_COMP = record + _stack: stack; + end; + {$EXTERNALSYM PSTACK_OF_COMP} + PSTACK_OF_COMP = ^STACK_OF_COMP; + {$ELSE} + //I think the DECLARE_STACK_OF macro is empty + {$EXTERNALSYM PSTACK_OF_COMP} + PSTACK_OF_COMP = PSTACK; + {$ENDIF} + + {$EXTERNALSYM PSSL_CTEX_tlsext_servername_callback} + PSSL_CTEX_tlsext_servername_callback = function(ssl : PSSL; Para1 : TIdC_INT; Para2 : Pointer) : TIdC_INT; cdecl; + {$EXTERNALSYM PSSL_CTX_info_callback} + PSSL_CTX_info_callback = procedure (const ssl : PSSL; _type, val : TIdC_INT); cdecl; // used if SSL's info_callback is NULL +//int (*tlsext_ticket_key_cb)(SSL *ssl, +// unsigned char *name, unsigned char *iv, +// EVP_CIPHER_CTX *ectx, +// HMAC_CTX *hctx, int enc); + {$EXTERNALSYM Ptlsext_ticket_key_cb} + Ptlsext_ticket_key_cb = function (ssl : PSSL; name, iv : PIdAnsiChar; + ectx : PEVP_CIPHER_CTX; + hctx : PHMAC_CTX; enc : TIdC_INT) : TIdC_INT; cdecl; +// int (*tlsext_status_cb)(SSL *ssl, void *arg); + {$EXTERNALSYM Ptlsext_status_cb} + Ptlsext_status_cb = function (ssl : PSSL; arg : Pointer) : TIdC_INT; cdecl; + {$EXTERNALSYM SSL_CTX_stats} + SSL_CTX_stats = record + sess_connect: TIdC_INT; // SSL new conn - started + sess_connect_renegotiate: TIdC_INT; // SSL reneg - requested + sess_connect_good: TIdC_INT; // SSL new conne/reneg - finished + sess_accept: TIdC_INT; // SSL new accept - started + sess_accept_renegotiate: TIdC_INT; // SSL reneg - requested + sess_accept_good: TIdC_INT; // SSL accept/reneg - finished + sess_miss: TIdC_INT; // session lookup misses + sess_timeout: TIdC_INT; // reuse attempt on timeouted session + sess_cache_full: TIdC_INT; // session removed due to full cache + sess_hit: TIdC_INT; // session reuse actually done + sess_cb_hit: TIdC_INT; // session-id that was not + // in the cache was + // passed back via the callback. This + // indicates that the application is + // supplying session-id's from other + // processes - spooky :-) + end; + {$EXTERNALSYM lash_of_SSL_SESSION} + lash_of_SSL_SESSION = record + dummy : TIdC_INT; + end; + {$EXTERNALSYM Plash_of_SSL_SESSION} + Plash_of_SSL_SESSION = ^lash_of_SSL_SESSION; +{$ifndef OPENSSL_NO_BUF_FREELISTS} + {$EXTERNALSYM Pssl3_buf_freelist_st} + Pssl3_buf_freelist_st = Pointer; +{$endif} + + {$IFDEF DEBUG_SAFESTACK} + {$EXTERNALSYM STACK_OF_SRTP_PROTECTION_PROFILE} + STACK_OF_SRTP_PROTECTION_PROFILE = record + _stack: stack; + end; + {$EXTERNALSYM PSTACK_OF_SRTP_PROTECTION_PROFILE} + PSTACK_OF_SRTP_PROTECTION_PROFILE = ^STACK_OF_SRTP_PROTECTION_PROFILE; + {$ELSE} + //I think the DECLARE_STACK_OF macro is empty + {$EXTERNALSYM PSTACK_OF_SRTP_PROTECTION_PROFILE} + PSTACK_OF_SRTP_PROTECTION_PROFILE = PSTACK; + {$ENDIF} + {$NODEFINE SSL_CTX} + SSL_CTX = record + method: PSSL_METHOD; + cipher_list: PSTACK_OF_SSL_CIPHER; + // same as above but sorted for lookup + cipher_list_by_id: PSTACK_OF_SSL_CIPHER; + cert_store: PX509_STORE; + sessions: Plash_of_SSL_SESSION; + // a set of SSL_SESSIONs + // Most session-ids that will be cached, default is + // SSL_SESSION_CACHE_MAX_SIZE_DEFAULT. 0 is unlimited. + session_cache_size: TIdC_ULONG; + session_cache_head: PSSL_SESSION; + session_cache_tail: PSSL_SESSION; + // This can have one of 2 values, ored together, + // SSL_SESS_CACHE_CLIENT, + // SSL_SESS_CACHE_SERVER, + // Default is SSL_SESSION_CACHE_SERVER, which means only + // SSL_accept which cache SSL_SESSIONS. + session_cache_mode: TIdC_INT; + session_timeout: TIdC_LONG; + // If this callback is not null, it will be called each + // time a session id is added to the cache. If this function + // returns 1, it means that the callback will do a + // SSL_SESSION_free() when it has finished using it. Otherwise, + // on 0, it means the callback has finished with it. + // If remove_session_cb is not null, it will be called when + // a session-id is removed from the cache. After the call, + // OpenSSL will SSL_SESSION_free() it. + new_session_cb: function (ssl : PSSL; sess: PSSL_SESSION): TIdC_INT; cdecl; + remove_session_cb: procedure (ctx : PSSL_CTX; sess : PSSL_SESSION); cdecl; + get_session_cb: function (ssl : PSSL; data : PByte; len: TIdC_INT; copy : PIdC_INT) : PSSL_SESSION; cdecl; + stats : SSL_CTX_stats; + + references: TIdC_INT; + // if defined, these override the X509_verify_cert() calls + app_verify_callback: function (_para1 : PX509_STORE_CTX; _para2 : Pointer) : TIdC_INT; cdecl; + app_verify_arg: Pointer; + // before OpenSSL 0.9.7, 'app_verify_arg' was ignored + // ('app_verify_callback' was called with just one argument) + // Default password callback. + default_passwd_callback: ppem_password_cb; + // Default password callback user data. + default_passwd_callback_userdata: Pointer; + // get client cert callback + client_cert_cb: function (SSL : PSSL; x509 : PPX509; pkey : PPEVP_PKEY) : TIdC_INT; cdecl; + // verify cookie callback + app_gen_cookie_cb: function (ssl : PSSL; cookie : PByte; cookie_len : TIdC_UINT) : TIdC_INT; cdecl; + app_verify_cookie_cb: Pointer; + ex_data : CRYPTO_EX_DATA; + rsa_md5 : PEVP_MD; // For SSLv2 - name is 'ssl2-md5' + md5: PEVP_MD; // For SSLv3/TLSv1 'ssl3-md5' + sha1: PEVP_MD; // For SSLv3/TLSv1 'ssl3->sha1' + extra_certs: PSTACK_OF_X509; + comp_methods: PSTACK_OF_COMP; // stack of SSL_COMP, SSLv3/TLSv1 + // Default values used when no per-SSL value is defined follow + info_callback: PSSL_CTX_info_callback; // used if SSL's info_callback is NULL + // what we put in client cert requests + client_CA : PSTACK_OF_X509_NAME; + // Default values to use in SSL structures follow (these are copied by SSL_new) + options : TIdC_ULONG; + mode : TIdC_ULONG; + max_cert_list : TIdC_LONG; + cert : PCERT; + read_ahead : TIdC_INT; + // callback that allows applications to peek at protocol messages + msg_callback : procedure (write_p, version, content_type : TIdC_INT; const buf : Pointer; len : size_t; ssl : PSSL; arg : Pointer); cdecl; + msg_callback_arg : Pointer; + verify_mode : TIdC_INT; + sid_ctx_length : TIdC_UINT; + sid_ctx : array[0..SSL_MAX_SID_CTX_LENGTH - 1] of TIdAnsiChar; + default_verify_callback : function(ok : TIdC_INT; ctx : PX509_STORE_CTX) : TIdC_INT; cdecl; // called 'verify_callback' in the SSL + // Default generate session ID callback. + generate_session_id : PGEN_SESSION_CB; + param : PX509_VERIFY_PARAM; + {$IFDEF OMIT_THIS} + purpose : TIdC_INT; // Purpose setting + trust : TIdC_INT; // Trust setting + {$ENDIF} + + quiet_shutdown : TIdC_INT; + //* Maximum amount of data to send in one fragment. + // * actual record size can be more than this due to + // * padding and MAC overheads. + // */ + max_send_fragment : TIdC_UINT; + {$IFNDEF OPENSSL_ENGINE} + ///* Engine to pass requests for client certs to + // */ + client_cert_engine : PENGINE; + {$ENDIF} + {$IFNDEF OPENSSL_NO_TLSEXT} +//* TLS extensions servername callback */ + tlsext_servername_callback : PSSL_CTEX_tlsext_servername_callback; + tlsext_servername_arg : Pointer; + //* RFC 4507 session ticket keys */ + tlsext_tick_key_name : array [0..(16-1)] of TIdAnsiChar; + tlsext_tick_hmac_key : array [0..(16-1)] of TIdAnsiChar; + tlsext_tick_aes_key : array [0..(16-1)] of TIdAnsiChar; + //* Callback to support customisation of ticket key setting */ + // int (*tlsext_ticket_key_cb)(SSL *ssl, + // unsigned char *name, unsigned char *iv, + // EVP_CIPHER_CTX *ectx, + // HMAC_CTX *hctx, int enc); + tlsext_ticket_key_cb : Ptlsext_ticket_key_cb; + //* certificate status request info */ + //* Callback for status request */ + //int (*tlsext_status_cb)(SSL *ssl, void *arg); + tlsext_status_cb : Ptlsext_status_cb; + tlsext_status_arg : Pointer; + {$ENDIF} + //* draft-rescorla-tls-opaque-prf-input-00.txt information */ + tlsext_opaque_prf_input_callback : function(para1 : PSSL; peerinput : Pointer; len : size_t; arg : Pointer ) : TIdC_INT cdecl; + //int (*tlsext_opaque_prf_input_callback)(SSL *, void *peerinput, size_t len, void *arg); + tlsext_opaque_prf_input_callback_arg : Pointer; + +{$ifndef OPENSSL_NO_PSK} + psk_identity_hint : PIdAnsiChar; + psk_client_callback : function (ssl : PSSL; hint : PIdAnsiChar; + identity : PIdAnsiChar; max_identity_len : TIdC_UINT; + psk : PIdAnsiChar; max_psk_len : TIdC_UINT ) : TIdC_UINT cdecl; + // unsigned int (*psk_client_callback)(SSL *ssl, const char *hint, char *identity, +// unsigned int max_identity_len, unsigned char *psk, +// unsigned int max_psk_len); + psk_server_callback : function (ssl : PSSL; identity, psk : PIdAnsiChar; max_psk_len : TIdC_UINT) : TIdC_UINT cdecl; +// unsigned int (*psk_server_callback)(SSL *ssl, const char *identity, +// unsigned char *psk, unsigned int max_psk_len); +{$endif} + +{$ifndef OPENSSL_NO_BUF_FREELISTS} + freelist_max_len : TIdC_UINT; + wbuf_freelist : Pssl3_buf_freelist_st; + rbuf_freelist : Pssl3_buf_freelist_st; +{$endif} +{$ifndef OPENSSL_NO_SRP} + srp_ctx : SRP_CTX; //* ctx for SRP authentication */ +{$endif} + +{$ifndef OPENSSL_NO_TLSEXT} +//# ifndef OPENSSL_NO_NEXTPROTONEG + //* Next protocol negotiation information */ + //* (for experimental NPN extension). */ + + //* For a server, this contains a callback function by which the set of + // * advertised protocols can be provided. */ + next_protos_advertised_cb : function(s : PSSL; out but : PIdAnsiChar; + out len : TIdC_UINT; arg : Pointer) : TIdC_INT cdecl; +// int (*next_protos_advertised_cb)(SSL *s, const unsigned char **buf, +// unsigned int *len, void *arg); + next_protos_advertised_cb_arg : Pointer; + //* For a client, this contains a callback function that selects the + // * next protocol from the list provided by the server. */ + next_proto_select_cb : function(s : PSSL; out _out : PIdAnsiChar; + outlen : PIdAnsiChar; + _in : PIdAnsiChar; + inlen : TIdC_UINT; + arg : Pointer) : TIdC_INT cdecl; +// int (*next_proto_select_cb)(SSL *s, unsigned char **out, +// unsigned char *outlen, +// const unsigned char *in, +// unsigned int inlen, +// void *arg); + next_proto_select_cb_arg : Pointer; +//# endif + //* SRTP profiles we are willing to do from RFC 5764 */ + srtp_profiles : PSTACK_OF_SRTP_PROTECTION_PROFILE; +{$endif} + end; + {$EXTERNALSYM PSSL2_STATE} + PSSL2_STATE = ^SSL2_STATE; + {$EXTERNALSYM PSSL3_STATE} + PSSL3_STATE = ^SSL3_STATE; + {$EXTERNALSYM PDTLS1_STATE} + PDTLS1_STATE = ^DTLS1_STATE; +//* TLS extension debug callback */ + {$EXTERNALSYM PSSL_tlsext_debug_cb} + PSSL_tlsext_debug_cb = procedure (s : PSSL; client_server : TIdC_INT; + _type : TIdC_INT; data : PIdAnsiChar; len : TIdC_INT; arg : Pointer); cdecl; + {$NODEFINE SSL} + SSL = record + // protocol version + // (one of SSL2_VERSION, SSL3_VERSION, TLS1_VERSION, DTLS1_VERSION) + version : TIdC_INT; + _type : TIdC_INT; //* SSL_ST_CONNECT or SSL_ST_ACCEPT */ + method : PSSL_METHOD; //* SSLv3 */ + // There are 2 BIO's even though they are normally both the + // same. This is so data can be read and written to different + // handlers + {$IFNDEF OPENSSL_NO_BIO} + rbio : PBIO; // used by SSL_read + wbio : PBIO; // used by SSL_write + bbio : PBIO; // used during session-id reuse to concatenate messages + {$ELSE} + rbio : PIdAnsiChar; // used by SSL_read + wbio : PIdAnsiChar; // used by SSL_write + bbio : PIdAnsiChar; + {$ENDIF} + // This holds a variable that indicates what we were doing + // when a 0 or -1 is returned. This is needed for + // non-blocking IO so we know what request needs re-doing when + // in SSL_accept or SSL_connect + rwstate : TIdC_INT; + // true when we are actually in SSL_accept() or SSL_connect() + in_handshake : TIdC_INT; + handshake_func : function (_para1 : PSSL) : TIdC_INT; cdecl; + // Imagine that here's a boolean member "init" that is + // switched as soon as SSL_set_{accept/connect}_state + // is called for the first time, so that "state" and + // handshake_func" are properly initialized. But as + // handshake_func is == 0 until then, we use this + // test instead of an "init" member. + server : TIdC_INT; // are we the server side? - mostly used by SSL_clear + new_session : TIdC_INT;//* Generate a new session or reuse an old one. + //* NB: For servers, the 'new' session may actually be a previously + //* cached session or even the previous session unless + //* SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION is set */ + quiet_shutdown : TIdC_INT; // don't send shutdown packets + shutdown : TIdC_INT; // we have shut things down, 0x01 sent, 0x02 + // for received + state : TIdC_INT; // where we are + rstate : TIdC_INT; // where we are when reading + init_buf : PBUF_MEM; // buffer used during init + init_msg : Pointer; // pointer to handshake message body, set by ssl3_get_message() + init_num : TIdC_INT; // amount read/written + init_off : TIdC_INT; // amount read/written + // used internally to point at a raw packet + packet : PIdAnsiChar; + packet_length : TIdC_UINT; + s2 : Pssl2_state; // SSLv2 variables + s3 : Pssl3_state; // SSLv3 variables + d1 : Pdtls1_state; // DTLSv1 variables + read_ahead : TIdC_INT; // Read as many input bytes as possible (for non-blocking reads) + // callback that allows applications to peek at protocol messages + msg_callback : procedure(write_p, version, content_type : TIdC_INT; + const buf : Pointer; len : size_t; ssl : PSSL; arg : Pointer); cdecl; + msg_callback_arg : Pointer; + hit : TIdC_INT; //* reusing a previous session */ + param : PX509_VERIFY_PARAM; + {$IFDEF OMIT_THIS} + purpose : TIdC_INT; // Purpose setting + trust : TIdC_INT; // Trust setting + {$ENDIF} + // crypto + cipher_list : PSTACK_OF_SSL_CIPHER; + cipher_list_by_id : PSTACK_OF_SSL_CIPHER; + + //* These are the ones being used, the ones in SSL_SESSION are + // * the ones to be 'copied' into these ones */ + mac_flags : TIdC_INT; + // These are the ones being used, the ones in SSL_SESSION are + // the ones to be 'copied' into these ones + enc_read_ctx : PEVP_CIPHER_CTX; // cryptographic state + read_hash : PEVP_MD_CTX; // used for mac generation + {$IFNDEF OPENSSL_NO_COMP} + expand : PCOMP_CTX; // uncompress + {$ELSE} + expand : PIdAnsiChar; + {$ENDIF} + enc_write_ctx : PEVP_CIPHER_CTX; // cryptographic state + write_hash : PEVP_MD_CTX; // used for mac generation + {$IFNDEF OPENSSL_NO_COMP} + compress : PCOMP_CTX; // compression + {$ELSE} + compress : PIdAnsiChar; + {$ENDIF} + // session info + // client cert? + // This is used to hold the server certificate used + cert : PCERT; + // the session_id_context is used to ensure sessions are only reused + // in the appropriate context + sid_ctx_length : TIdC_UINT; + sid_ctx : array [0..SSL_MAX_SID_CTX_LENGTH -1] of TIdAnsiChar; + // This can also be in the session once a session is established + session : PSSL_SESSION; + // Default generate session ID callback. + generate_session_id : PGEN_SESSION_CB; + // Used in SSL2 and SSL3 + verify_mode : TIdC_INT; // 0 don't care about verify failure. + // 1 fail if verify fails + verify_callback : function (ok : TIdC_INT; ctx : PX509_STORE_CTX) : TIdC_INT; cdecl; // fail if callback returns 0 + info_callback : procedure(const ssl : PSSL; _type, val : TIdC_INT) ; cdecl; + error : TIdC_INT; // error bytes to be written + error_code : TIdC_INT; // actual code + {$IFNDEF OPENSSL_NO_KRB5} + kssl_ctx : PKSSL_CTX; // Kerberos 5 context + {$ENDIF} +{$ifndef OPENSSL_NO_PSK} + psk_client_callback : function(ssl : PSSL; hint : PIdAnsiChar; + identity : PIdAnsiChar; + max_identity_len : TIdC_UINT; + psk : PIdAnsiChar; + max_psk_len : TIdC_UINT) : TIdC_UINT cdecl; +// unsigned int (*psk_client_callback)(SSL *ssl, const char *hint, char *identity, +// unsigned int max_identity_len, unsigned char *psk, +// unsigned int max_psk_len); + psk_server_callback : function(ssl : PSSL; identity : PIdAnsiChar; + psk : PIdAnsiChar; max_psk_len : TIdC_UINT) : TIdC_UINT cdecl; +// unsigned int (*psk_server_callback)(SSL *ssl, const char *identity, +// unsigned char *psk, unsigned int max_psk_len); +{$endif} + ctx : PSSL_CTX; + // set this flag to 1 and a sleep(1) is put into all SSL_read() + // and SSL_write() calls, good for nbio debuging :-) + debug : TIdC_INT; + // extra application data + verify_result : TIdC_LONG; + ex_data : CRYPTO_EX_DATA; + // for server side, keep the list of CA_dn we can use + client_CA : PSTACK_OF_X509_NAME; + references : TIdC_INT; + options : TIdC_ULONG; // protocol behaviour + mode : TIdC_ULONG; // API behaviour + max_cert_list : TIdC_LONG; + first_packet : TIdC_INT; + client_version : TIdC_INT; // what was passed, used for + // SSLv3/TLS rollback check + max_send_fragment : TIdC_UINT; + {$IFNDEF OPENSSL_NO_TLSEXT} + //* TLS extension debug callback */ + tlsext_debug_cb : PSSL_tlsext_debug_cb; + tlsext_debug_arg : Pointer; + tlsext_hostname : PIdAnsiChar; + servername_done : TIdC_INT; //* no further mod of servername + // 0 : call the servername extension callback. + // 1 : prepare 2, allow last ack just after in server callback. + // 2 : don't call servername callback, no ack in server hello + //*/ + //* certificate status request info */ + //* Status type or -1 if no status type */ + tlsext_status_type : TIdC_INT; + //* Expect OCSP CertificateStatus message */ + tlsext_status_expected : TIdC_INT; + +{$ifndef OPENSSL_NO_EC} + tlsext_ecpointformatlist_length : size_t; + tlsext_ecpointformatlist : PIdAnsiChar; //* our list */ + tlsext_ellipticcurvelist_length : size_t; + tlsext_ellipticcurvelist : PIdAnsiChar; //* our list */ +{$endif} //* OPENSSL_NO_EC */ + + + //* draft-rescorla-tls-opaque-prf-input-00.txt information to be used for handshakes */ + tlsext_opaque_prf_input : Pointer; + tlsext_opaque_prf_input_len : size_t; + + //* TLS Session Ticket extension override */ + tlsext_session_ticket : PTLS_SESSION_TICKET_EXT; + + //* TLS Session Ticket extension callback */ + tls_session_ticket_ext_cb : tls_session_ticket_ext_cb_fn; + tls_session_ticket_ext_cb_arg : Pointer; + + //* TLS pre-shared secret session resumption */ + tls_session_secret_cb : tls_session_secret_cb_fn; + tls_session_secret_cb_arg : Pointer; + + initial_ctx : PSSL_CTX; //* initial ctx, used to store sessions */ + +{$ifndef OPENSSL_NO_NEXTPROTONEG} + ///* Next protocol negotiation. For the client, this is the protocol that + // * we sent in NextProtocol and is set when handling ServerHello + // * extensions. + // * + // * For a server, this is the client's selected_protocol from + // * NextProtocol and is set when handling the NextProtocol message, + // * before the Finished message. */ + next_proto_negotiated : PIdAnsiChar; + next_proto_negotiated_len : Byte; +{$endif} + + //* OCSP status request only */ + tlsext_ocsp_ids : PSTACK_OF_OCSP_RESPID;//STACK_OF(OCSP_RESPID) *tlsext_ocsp_ids; + tlsext_ocsp_exts : PX509_EXTENSIONS; + //* OCSP response received or to be sent */ + tlsext_ocsp_resp : PIdAnsiChar; + tlsext_ocsp_resplen : TIdC_INT; + //* RFC4507 session ticket expected to be received or sent */ + tlsext_ticket_expected : TIdC_INT; + _initial_ctx : PSSL_CTX; //* initial ctx, used to store sessions */ + {$DEFINE session_ctx} + {$DEFINE initial_ctx} +{$ELSE} + {$DEFINE ctx} + {$DEFINE session_ctx} +{$ENDIF} + end; + //ssl2.h + {$EXTERNALSYM SSL2_STATE} + SSL2_STATE = record + three_byte_header : TIdC_INT; + clear_text : TIdC_INT; // clear text + escape : TIdC_INT; // not used in SSLv2 + ssl2_rollback : TIdC_INT; // used if SSLv23 rolled back to SSLv2 + // non-blocking io info, used to make sure the same + // args were passwd + wnum : TIdC_UINT; // number of bytes sent so far + wpend_tot : TIdC_INT; + wpend_buf : PByte; + wpend_off : TIdC_INT; // offset to data to write + wpend_len : TIdC_INT; // number of bytes passwd to write + wpend_ret : TIdC_INT; // number of bytes to return to caller + // buffer raw data + rbuf_left : TIdC_INT; + rbuf_offs : TIdC_INT; + rbuf : PIdAnsiChar; + wbuf : PIdAnsiChar; + write_ptr : PIdAnsiChar; // used to point to the start due to 2/3 byte header. */ + padding : TIdC_UINT; + rlength : TIdC_UINT; // passed to ssl2_enc + ract_data_length : TIdC_INT; // Set when things are encrypted. + wlength : TIdC_UINT; // passed to ssl2_enc + wact_data_length : TIdC_INT; // Set when things are decrypted. + ract_data : PIdAnsiChar; + wact_data : PIdAnsiChar; + mac_data : PIdAnsiChar; + read_key : PIdAnsiChar; + write_key : PIdAnsiChar; + // Stuff specifically to do with this SSL session + challenge_length : TIdC_UINT; + challenge : array [0..SSL2_MAX_CHALLENGE_LENGTH -1] of TIdAnsiChar; + conn_id_length : TIdC_UINT; + conn_id : array [0..SSL2_MAX_CONNECTION_ID_LENGTH -1] of TIdAnsiChar; + key_material_length : TIdC_UINT; + key_material : array[0..(SSL2_MAX_KEY_MATERIAL_LENGTH*2)-1] of TIdAnsiChar; + read_sequence : TIdC_ULONG; + write_sequence : TIdC_ULONG; + tmp_conn_id_length : TIdC_UINT; + tmp_cert_type : TIdC_UINT; + tmp_cert_length : TIdC_UINT; + tmp_csl : TIdC_UINT; + tmp_clear : TIdC_UINT; + tmp_enc : TIdC_UINT; + tmp_ccl : array [0..SSL2_MAX_CERT_CHALLENGE_LENGTH -1] of TIdAnsiChar; + tmp_cipher_spec_length : TIdC_UINT; + tmp_session_id_length : TIdC_UINT; + tmp_clen : TIdC_UINT; + tmp_rlen : TIdC_UINT; + end; + //sl3.h + {$IFNDEF OPENSSL_NO_SSL_INTERN} + {$EXTERNALSYM PSSL3_RECORD} + PSSL3_RECORD = ^SSL3_RECORD; + {$EXTERNALSYM SSL3_RECORD} + SSL3_RECORD = record + {*r *} _type : TIdC_INT; // type of record + {*rw*} length : TIdC_UINT; // How many bytes available + {*r *} off : TIdC_UINT; // read/write offset into 'buf' + {*rw*} data : PIdAnsiChar; // pointer to the record data + {*rw*} input : PIdAnsiChar; // where the decode bytes are + {*r *} comp : PIdAnsiChar; // only used with decompression - malloc()ed + {*r *} epoch : TIdC_ULONG; // epoch number, needed by DTLS1 + {*r *} seq_num : array [0..7] of Byte; //* sequence number, needed by DTLS1 */ + end; + {$EXTERNALSYM PSSL3_BUFFER} + PSSL3_BUFFER = ^SSL3_BUFFER; + {$EXTERNALSYM SSL3_BUFFER} + SSL3_BUFFER = record + buf : PIdAnsiChar; // at least SSL3_RT_MAX_PACKET_SIZE bytes, + // see ssl3_setup_buffers() + len : size_t; // buffer size + offset : TIdC_INT; // where to 'copy from' + left : TIdC_INT; // how many bytes left + end; + + {$EXTERNALSYM SSL3_STATE} + SSL3_STATE = record + flags : TIdC_LONG; + delay_buf_pop_ret : TIdC_INT; + + read_sequence : array [0..7] of TIdAnsiChar; + read_mac_secret_size : TIdC_INT; + read_mac_secret : array [0..EVP_MAX_MD_SIZE -1] of TIdAnsiChar; + write_sequence : array [0..7] of TIdAnsiChar; + write_mac_secret_size : TIdC_INT; + write_mac_secret : array [0..EVP_MAX_MD_SIZE - 1] of TIdAnsiChar; + server_random : array [0..SSL3_RANDOM_SIZE - 1] of TIdAnsiChar; + client_random : array [0..SSL3_RANDOM_SIZE -1] of TIdAnsiChar; + // flags for countermeasure against known-IV weakness + need_empty_fragments : TIdC_INT; + empty_fragment_done : TIdC_INT; + + //* The value of 'extra' when the buffers were initialized */ + init_extra : TIdC_INT; + rbuf : PSSL3_BUFFER; //* read IO goes into here */ + wbuf : PSSL3_BUFFER; //* write IO goes into here */ + rrec : PSSL3_RECORD; //* each decoded record goes in here */ + wrec : PSSL3_RECORD; //* goes out from here */ + // storage for Alert/Handshake protocol data received but not + // yet processed by ssl3_read_bytes: + alert_fragment : array [0..1] of PIdAnsiChar; + alert_fragment_len : TIdC_UINT; + handshake_fragment : array [0..3] of PIdAnsiChar; + handshake_fragment_len : TIdC_UINT; + // partial write - check the numbers match + wnum : TIdC_UINT; // number of bytes sent so far + wpend_tot : TIdC_INT; // number bytes written + wpend_type : TIdC_INT; + wpend_ret : TIdC_INT; // number of bytes submitted + wpend_buf : PByte; + // used during startup, digest all incoming/outgoing packets */ + handshake_buffer : PBIO; + //* When set of handshake digests is determined, buffer is hashed + // * and freed and MD_CTX-es for all required digests are stored in + // * this array */ + handshake_dgst : PPEVP_MD_CTX; + + finish_dgst2 : PEVP_MD_CTX; + // this is set whenerver we see a change_cipher_spec message + // come in when we are not looking for one + change_cipher_spec : TIdC_INT; + warn_alert : TIdC_INT; + fatal_alert : TIdC_INT; + // we allow one fatal and one warning alert to be outstanding, + // send close alert via the warning alert */ + alert_dispatch : TIdC_INT; + send_alert : array [0..1] of TIdAnsiChar; + // This flag is set when we should renegotiate ASAP, basically when + // there is no more data in the read or write buffers + renegotiate : TIdC_INT; + total_renegotiations : TIdC_INT; + num_renegotiations : TIdC_INT; + in_read_app_data : TIdC_INT; + + //* Opaque PRF input as used for the current handshake. + // * These fields are used only if TLSEXT_TYPE_opaque_prf_input is defined + // * (otherwise, they are merely present to improve binary compatibility) */ + client_opaque_prf_input : Pointer; + client_opaque_prf_input_len : size_t; + server_opaque_prf_input : Pointer; + server_opaque_prf_input_len : size_t; + // actually only needs to be 16+20 + tmp_cert_verify_md: array [0..(EVP_MAX_MD_SIZE*2)-1] of TIdAnsiChar; + // actually only need to be 16+20 for SSLv3 and 12 for TLS + tmp_finish_md : array[0..(EVP_MAX_MD_SIZE*2)-1] of TIdAnsiChar; + tmp_finish_md_len : TIdC_INT; + tmp_peer_finish_md : array[0..(EVP_MAX_MD_SIZE*2)-1] of TIdAnsiChar; + tmp_peer_finish_md_len : TIdC_INT; + tmp_message_size : TIdC_UINT; + tmp_message_type : TIdC_INT; + // used to hold the new cipher we are going to use + tmp_new_cipher : PSSL_CIPHER; + {$IFNDEF OPENSSL_NO_DH} + tmp_dh : PDH; + {$ENDIF} + {$IFNDEF OPENSSL_NO_ECDH} + tmp_ecdh : PEC_KEY; // holds short lived ECDH key + {$ENDIF} + // used when SSL_ST_FLUSH_DATA is entered + tmp_next_state : TIdC_INT; + tmp_reuse_message : TIdC_INT; + // used for certificate requests + tmp_cert_req : TIdC_INT; + tmp_ctype_num : TIdC_INT; + tmp_ctype : array [0..SSL3_CT_NUMBER -1] of TIdAnsiChar; + tmp_ca_names : PSTACK_OF_X509_NAME; + tmp_use_rsa_tmp : TIdC_INT; + tmp_key_block_length : TIdC_INT; + tmp_key_block : PIdAnsiChar; + tmp_new_sym_enc : PEVP_CIPHER; + tmp_new_hash : PEVP_MD; + new_mac_pkey_type : TIdC_INT; + new_mac_secret_size : TIdC_INT; + {$IFNDEF OPENSSL_NO_COMP} + tmp_new_compression : PSSL_COMP; + {$ELSE} + tmp_new_compression : PIdAnsiChar; + {$ENDIF} + tmp_cert_request : TIdC_INT; + + //* Connection binding to prevent renegotiation attacks */ + previous_client_finished : array [0..EVP_MAX_MD_SIZE - 1] of TIdAnsiChar; + previous_client_finished_len : Byte; + previous_server_finished : array [0..EVP_MAX_MD_SIZE - 1] of TIdAnsiChar; + previous_server_finished_len : Byte; + send_connection_binding : TIdC_INT; //* TODOEKR */ +{$ifndef OPENSSL_NO_NEXTPROTONEG} + //* Set if we saw the Next Protocol Negotiation extension from our peer. */ + next_proto_neg_seen : TIdC_INT; +{$endif} + end; + {$ENDIF} + //openssl/pq_compat.h + {$EXTERNALSYM ppitem} + ppitem = ^pitem; + {$EXTERNALSYM pitem} + pitem = record + priority : PQ_64BIT; + data : Pointer; + next : ppitem; + end; + //ssl/dtls1.h + //for some reason, this header is refering to crypto/pqueue/pqueue.c + //which is in the OpenSSL headers. + {$EXTERNALSYM pqueue} + pqueue = record + items : ppitem; + count : TIdC_INT; + end; + // + {$EXTERNALSYM dtls1_retransmit_state} + dtls1_retransmit_state = record + enc_write_ctx : PEVP_CIPHER_CTX; //* cryptographic state */ + write_hash : PEVP_MD; //* used for mac generation */ +{$IFNDEF OPENSSL_NO_COMP} + compress : COMP_CTX; //* compression */ +{$ELSE} + compress : PIdAnsiChar; +{$ENDIF} + session : PSSL_SESSION; + epoch : TIdC_USHORT; + end; + {$EXTERNALSYM Pdtls1_retransmit_state} + Pdtls1_retransmit_state = ^dtls1_retransmit_state; + {$EXTERNALSYM DTLS1_BITMAP} + DTLS1_BITMAP = record + map : PQ_64BIT; + length : TIdC_ULONG; // sizeof the bitmap in bits + max_seq_num : PQ_64BIT; // max record number seen so far + end; + {$EXTERNALSYM PDTLS1_BITMAP} + PDTLS1_BITMAP = ^DTLS1_BITMAP; + {$EXTERNALSYM hm_header} + hm_header = record + _type : PIdAnsiChar; + msg_len : TIdC_ULONG; + seq : TIdC_USHORT; + frag_off : TIdC_ULONG; + frag_len : TIdC_ULONG; + is_ccs : TIdC_UINT; + // struct dtls1_retransmit_state saved_retransmit_state; + saved_retransmit_state : dtls1_retransmit_state; + end; + {$EXTERNALSYM ccs_header_st} + ccs_header_st = record + _type : PIdAnsiChar; + seq : TIdC_USHORT; + end; + {$EXTERNALSYM dtls1_timeout_st} + dtls1_timeout_st = record + // Number of read timeouts so far + read_timeouts : TIdC_UINT; + // Number of write timeouts so far + write_timeouts : TIdC_UINT; + // Number of alerts received so far + num_alerts : TIdC_UINT; + end; + {$EXTERNALSYM record_pqueue} + record_pqueue = record + epoch : TIdC_USHORT; + q : pqueue; + end; + {$EXTERNALSYM hm_fragment} + hm_fragment = record + msg_header : hm_header; + fragment : PIdAnsiChar; + reassembly : PIdAnsiChar; + end; + {$EXTERNALSYM DTLS1_STATE} + DTLS1_STATE = record + send_cookie : TIdC_UINT; + cookie : array [0..DTLS1_COOKIE_LENGTH - 1 ] of TIdAnsiChar; + rcvd_cookie : array [0..DTLS1_COOKIE_LENGTH -1] of TIdAnsiChar; + cookie_len : TIdC_UINT; + // The current data and handshake epoch. This is initially + // undefined, and starts at zero once the initial handshake is + // completed + r_epoch : TIdC_USHORT; + w_epoch : TIdC_USHORT; + // records being received in the current epoch + bitmap : DTLS1_BITMAP; + // renegotiation starts a new set of sequence numbers + next_bitmap : DTLS1_BITMAP; + // handshake message numbers + handshake_write_seq : TIdC_USHORT; + next_handshake_write_seq : TIdC_USHORT; + handshake_read_seq : TIdC_USHORT; + //* save last sequence number for retransmissions */ + last_write_sequence : array [0..8-1] of byte; + + // Received handshake records (processed and unprocessed) + unprocessed_rcds : record_pqueue; + processed_rcds : record_pqueue; + // Buffered handshake messages + buffered_messages : pqueue; + // Buffered (sent) handshake records + sent_messages : pqueue; + ///* Buffered application records. + //* Only for records between CCS and Finished + //* to prevent either protocol violation or + //* unnecessary message loss. + //*/ + buffered_app_data : record_pqueue; + + ///* Is set when listening for new connections with dtls1_listen() */ + listen : TIdC_UINT; + + mtu : TIdC_UINT; // max wire packet size + w_msg_hdr : hm_header; + r_msg_hdr : hm_header; + timeout : dtls1_timeout_st; + //* Indicates when the last handshake msg sent will timeout */ + next_timeout : timeval; + + //* Timeout duration */ + timeout_duration : TIdC_USHORT; + + // storage for Alert/Handshake protocol data received but not + // yet processed by ssl3_read_bytes: + alert_fragment : array [0..DTLS1_AL_HEADER_LENGTH-1] of TIdAnsiChar; + alert_fragment_len : TIdC_UINT; + handshake_fragment : array[0..DTLS1_HM_HEADER_LENGTH -1] of TIdAnsiChar; + handshake_fragment_len : TIdC_UINT; + retransmitting : TIdC_UINT; + change_cipher_spec_ok : TIdC_UINT; + end; + + {$EXTERNALSYM X509V3_CTX} + X509V3_CTX = V3_EXT_CTX; + {$EXTERNALSYM PX509V3_CTX} + PX509V3_CTX = ^X509V3_CTX; + +type + {$EXTERNALSYM Tsk_new_cmp} + Tsk_new_cmp = function (const a, b : PIdAnsiChar; const c : PIdAnsiChar) : TIdC_INT cdecl; + {$EXTERNALSYM TRSA_generate_key_callback} + TRSA_generate_key_callback = procedure (p1, p2 : TIdC_INT; p3 : Pointer); cdecl; + {$EXTERNALSYM TCRYPTO_set_mem_functions_m} + TCRYPTO_set_mem_functions_m = function (size : size_t) : Pointer; cdecl; + {$EXTERNALSYM TCRYPTO_set_mem_functions_r} + TCRYPTO_set_mem_functions_r = function (ptr : Pointer; size : size_t) : Pointer; cdecl; + {$EXTERNALSYM TCRYPTO_set_mem_functions_f} + TCRYPTO_set_mem_functions_f = procedure (ptr : Pointer); cdecl; + {$EXTERNALSYM TCRYPTO_set_mem_ex_functions_m} + TCRYPTO_set_mem_ex_functions_m = function(size : size_t; const c : PIdAnsiChar; i : TIdC_INT) : Pointer; cdecl; + {$EXTERNALSYM TCRYPTO_set_mem_ex_functions_r} + TCRYPTO_set_mem_ex_functions_r = function(ptr : Pointer; size : size_t; const c : PIdAnsiChar; i : TIdC_INT) : Pointer; cdecl; + {$EXTERNALSYM TCRYPTO_set_mem_ex_functions_f} + TCRYPTO_set_mem_ex_functions_f = procedure (ptr : Pointer); cdecl; + {$EXTERNALSYM Tset_mem_debug_functions_m} + Tset_mem_debug_functions_m = procedure (addr : Pointer; num : TIdC_INT; const _file : PIdAnsiChar; line, before_p : TIdC_INT); cdecl; + {$EXTERNALSYM Tset_mem_debug_functions_r} + Tset_mem_debug_functions_r = procedure (addr1, addr2 : Pointer; num : TIdC_INT; const _file : PIdAnsiChar; line, before_p : TIdC_INT); cdecl; + {$EXTERNALSYM Tset_mem_debug_functions_f} + Tset_mem_debug_functions_f = procedure (addr : Pointer; before_p : TIdC_INT); cdecl; + {$EXTERNALSYM Tset_mem_debug_functions_so} + Tset_mem_debug_functions_so = procedure (bits : TIdC_LONG); cdecl; + {$EXTERNALSYM Tset_mem_debug_functions_go} + Tset_mem_debug_functions_go = function : TIdC_LONG; cdecl; + {$EXTERNALSYM TSSL_CTX_set_verify_callback} + TSSL_CTX_set_verify_callback = function (ok : TIdC_INT; ctx : PX509_STORE_CTX) : TIdC_INT; cdecl; + {$EXTERNALSYM Tsk_pop_free_func} + Tsk_pop_free_func = procedure (p : Pointer); cdecl; + {$EXTERNALSYM SSL_callback_ctrl_fp} + SSL_callback_ctrl_fp = procedure (para1 : PBIO; para2 : TIdC_INT; + para3 : PIdAnsiChar; para4 : TIdC_INT; para5, para6 : TIdC_LONG); cdecl; + {$EXTERNALSYM TCRYPTO_THREADID_set_callback_threadid_func} + TCRYPTO_THREADID_set_callback_threadid_func = procedure (id : PCRYPTO_THREADID) cdecl; + {$EXTERNALSYM TSSL_CTX_set_tlsext_status_cb} + TSSL_CTX_set_tlsext_status_cb = function(SSL : PSSL; Arg : Pointer) : TIdC_INT cdecl; + {$EXTERNALSYM TSSL_CTX_set_tlsext_opaque_prf_input_callback_cb} + TSSL_CTX_set_tlsext_opaque_prf_input_callback_cb = function(ssl : PSSL; peerinput : Pointer; len : size_t; arg : Pointer) : TIdC_INT cdecl; + {$EXTERNALSYM TSSL_CTX_set_tlsext_ticket_key_cb_fp} + TSSL_CTX_set_tlsext_ticket_key_cb_fp = function(SSL : PSSL; keyname, iv : PIdAnsiChar; ctx : PEVP_CIPHER_CTX; hctx : PHMAC_CTX; enc : TIdC_INT) : TIdC_INT cdecl; + + {$EXTERNALSYM EVP_CIPHER_do_all_fn} + EVP_CIPHER_do_all_fn = procedure(ciph : PEVP_CIPHER; + from : PIdAnsiChar; _to : PIdAnsiChar; x : Pointer) cdecl; + {$EXTERNALSYM EVP_MD_do_all_fn} + EVP_MD_do_all_fn = procedure(ciph : PEVP_CIPHER; + from: PIdAnsiChar; _to: PIdAnsiChar; x : Pointer) cdecl; + {$EXTERNALSYM EVP_PKEY_asn1_set_public_pub_decode} + EVP_PKEY_asn1_set_public_pub_decode = function(pk : PEVP_PKEY; pub : PX509_PUBKEY) : TIdC_INT cdecl; + {$EXTERNALSYM EVP_PKEY_asn1_set_public_pub_encode} + EVP_PKEY_asn1_set_public_pub_encode = function(pub : PX509_PUBKEY; pk : PX509_PUBKEY) : TIdC_INT cdecl; + {$EXTERNALSYM EVP_PKEY_asn1_set_public_pub_cmp} + EVP_PKEY_asn1_set_public_pub_cmp = function (a : PEVP_PKEY; b : PEVP_PKEY) : TIdC_INT cdecl; + {$EXTERNALSYM EVP_PKEY_asn1_set_public_pub_print} + EVP_PKEY_asn1_set_public_pub_print = function(_out : PBIO; pkey : PEVP_PKEY; indent : TIdC_INT; + pctx : PASN1_PCTX) : TIdC_INT cdecl; + {$EXTERNALSYM EVP_PKEY_asn1_set_public_pub_pkey_size} + EVP_PKEY_asn1_set_public_pub_pkey_size = function(pk : PEVP_PKEY) : TIdC_INT cdecl; + {$EXTERNALSYM EVP_PKEY_asn1_set_public_pkey_bits} + EVP_PKEY_asn1_set_public_pkey_bits = function(pk : PEVP_PKEY) : TIdC_INT cdecl; + {$EXTERNALSYM EVP_PKEY_asn1_set_private_priv_decode} + EVP_PKEY_asn1_set_private_priv_decode = function (pk : PEVP_PKEY; p8inf : PPKCS8_PRIV_KEY_INFO) : TIdC_INT cdecl; + {$EXTERNALSYM EVP_PKEY_asn1_set_private_priv_encode} + EVP_PKEY_asn1_set_private_priv_encode = function (p8 : PPKCS8_PRIV_KEY_INFO; pk : PEVP_PKEY): TIdC_INT cdecl; + {$EXTERNALSYM EVP_PKEY_asn1_set_private_priv_print} + EVP_PKEY_asn1_set_private_priv_print = function (_out : PBIO; pkey : PEVP_PKEY; indent : TIdC_INT; + pctx : PASN1_PCTX) : TIdC_INT cdecl; + {$EXTERNALSYM EVP_PKEY_asn1_set_param_param_decode} + EVP_PKEY_asn1_set_param_param_decode = function(pkey : PEVP_PKEY; + pder : PPIdAnsiChar; derlen : TIdC_INT): TIdC_INT cdecl; + {$EXTERNALSYM EVP_PKEY_asn1_set_param_param_encode} + EVP_PKEY_asn1_set_param_param_encode = function(pkey : PEVP_PKEY; pder : PPIdAnsiChar) : TIdC_INT cdecl; + {$EXTERNALSYM EVP_PKEY_asn1_set_param_param_missing} + EVP_PKEY_asn1_set_param_param_missing = function(pk : EVP_PKEY) : TIdC_INT cdecl; + {$EXTERNALSYM EVP_PKEY_asn1_set_param_param_copy} + EVP_PKEY_asn1_set_param_param_copy = function(_to : PEVP_PKEY; from : PEVP_PKEY) : TIdC_INT cdecl; + {$EXTERNALSYM EVP_PKEY_asn1_set_param_param_cmp} + EVP_PKEY_asn1_set_param_param_cmp = function(a : PEVP_PKEY; b : PEVP_PKEY): TIdC_INT cdecl; + {$EXTERNALSYM EVP_PKEY_asn1_set_param_param_print} + EVP_PKEY_asn1_set_param_param_print = function(_out : PBIO; pkey : PEVP_PKEY; indent : TIdC_INT; + pctx : PASN1_PCTX) : TIdC_INT cdecl; + {$EXTERNALSYM EVP_PKEY_asn1_set_free_pkey_free} + EVP_PKEY_asn1_set_free_pkey_free = procedure(pkey : PEVP_PKEY) cdecl; + {$EXTERNALSYM EVP_PKEY_asn1_set_ctr_pkey_ctrl} + EVP_PKEY_asn1_set_ctr_pkey_ctrl = function(pkey : PEVP_PKEY; op : TIdC_INT; + arg1 : TIdC_LONG; arg2 : Pointer) : TIdC_INT cdecl; + + {$EXTERNALSYM EVP_PKEY_gen_cb} + + EVP_PKEY_gen_cb = function( ctx : PEVP_PKEY_CTX) : TIdC_INT cdecl; + {$EXTERNALSYM EVP_PKEY_meth_set_init_init} + + EVP_PKEY_meth_set_init_init = function (ctx : PEVP_PKEY_CTX) : TIdC_INT cdecl; + {$EXTERNALSYM EVP_PKEY_meth_set_copy_copy} + EVP_PKEY_meth_set_copy_copy = function (dst : PEVP_PKEY_CTX; src : PEVP_PKEY_CTX) : TIdC_INT cdecl; + {$EXTERNALSYM EVP_PKEY_meth_set_cleanup_cleanup} + EVP_PKEY_meth_set_cleanup_cleanup = procedure(ctx : PEVP_PKEY_CTX) cdecl; + {$EXTERNALSYM EVP_PKEY_meth_set_paramgen_paramgen_init} + EVP_PKEY_meth_set_paramgen_paramgen_init = function (ctx : PEVP_PKEY_CTX) : TIdC_INT cdecl; + {$EXTERNALSYM EVP_PKEY_meth_set_paramgen_paramgen} + EVP_PKEY_meth_set_paramgen_paramgen = function (ctx : PEVP_PKEY_CTX; pkey : PEVP_PKEY) : TIdC_INT cdecl; + {$EXTERNALSYM EVP_PKEY_meth_set_keygen_keygen_init} + EVP_PKEY_meth_set_keygen_keygen_init = function(ctx : PEVP_PKEY_CTX) : TIdC_INT cdecl; + {$EXTERNALSYM EVP_PKEY_meth_set_keygen_keygen} + EVP_PKEY_meth_set_keygen_keygen = function(ctx : PEVP_PKEY_CTX; pkey : PEVP_PKEY) : TIdC_INT cdecl; + {$EXTERNALSYM EVP_PKEY_meth_set_sign_sign_init} + EVP_PKEY_meth_set_sign_sign_init = function(ctx : PEVP_PKEY_CTX) : TIdC_INT cdecl; + {$EXTERNALSYM EVP_PKEY_meth_set_sign_sign} + EVP_PKEY_meth_set_sign_sign = function(ctx : PEVP_PKEY_CTX; sig : PIdAnsiChar; siglen : Psize_t; + tbs : PIdAnsiChar; tbslen : size_t) : TIdC_INT cdecl; + {$EXTERNALSYM EVP_PKEY_meth_set_verify_verify_init} + EVP_PKEY_meth_set_verify_verify_init = function(ctx : PEVP_PKEY_CTX) : TIdC_INT cdecl; + {$EXTERNALSYM EVP_PKEY_meth_set_verify_verify} + EVP_PKEY_meth_set_verify_verify = function(ctx : PEVP_PKEY_CTX; sig : PIdAnsiChar; siglen : size_t; + tbs : PIdAnsiChar; tbslen : size_t) : TIdC_INT cdecl; + {$EXTERNALSYM EVP_PKEY_meth_set_verify_recover_verify_recover_init} + EVP_PKEY_meth_set_verify_recover_verify_recover_init = function(ctx : PEVP_PKEY_CTX) : TIdC_INT cdecl; + {$EXTERNALSYM EVP_PKEY_meth_set_verify_recover_verify_recover} + EVP_PKEY_meth_set_verify_recover_verify_recover = function(ctx : PEVP_PKEY_CTX; + sig : PIdAnsiChar; siglen : Psize_t; + tbs: PIdAnsiChar; tbslen : size_t) : TIdC_INT cdecl; + {$EXTERNALSYM EVP_PKEY_meth_set_signctx_signctx_init} + EVP_PKEY_meth_set_signctx_signctx_init = function(ctx : PEVP_PKEY_CTX; mctx : PEVP_MD_CTX) : TIdC_INT cdecl; + {$EXTERNALSYM EVP_PKEY_meth_set_signctx_signctx} + EVP_PKEY_meth_set_signctx_signctx = function(ctx : PEVP_PKEY_CTX; sig : PIdAnsiChar; siglen : size_t; + mctx : PEVP_MD_CTX) : TIdC_INT cdecl; + {$EXTERNALSYM EVP_PKEY_meth_set_verifyctx_verifyctx_init} + EVP_PKEY_meth_set_verifyctx_verifyctx_init = function : TIdC_INT cdecl; + {$EXTERNALSYM EVP_PKEY_meth_set_verifyctx_verifyctx} + EVP_PKEY_meth_set_verifyctx_verifyctx = function : TIdC_INT cdecl; + {$EXTERNALSYM EVP_PKEY_meth_set_encrypt_encrypt_init} + EVP_PKEY_meth_set_encrypt_encrypt_init = function( ctx : PEVP_PKEY_CTX) : TIdC_INT cdecl; + {$EXTERNALSYM EVP_PKEY_meth_set_encrypt_encryptfn} + EVP_PKEY_meth_set_encrypt_encryptfn = function(ctx : PEVP_PKEY_CTX; _out : PIdAnsiChar; outlen : psize_t; + _in : PIdAnsiChar; inlen : size_t) : TIdC_INT cdecl; + {$EXTERNALSYM EVP_PKEY_meth_set_decrypt_decrypt_init} + EVP_PKEY_meth_set_decrypt_decrypt_init = function(ctx : PEVP_PKEY_CTX) : TIdC_INT cdecl; + {$EXTERNALSYM EVP_PKEY_meth_set_decrypt_decrypt} + EVP_PKEY_meth_set_decrypt_decrypt = function(ctx : PEVP_PKEY_CTX; _out : PIdAnsiChar; outlen : psize_t; + _in : PIdAnsiChar; inlen : size_t) : TIdC_INT cdecl; + {$EXTERNALSYM EVP_PKEY_meth_set_derive_derive_init} + EVP_PKEY_meth_set_derive_derive_init = function(ctx : PEVP_PKEY_CTX) : TIdC_INT cdecl; + + {$EXTERNALSYM EVP_PKEY_meth_set_derive_derive} + EVP_PKEY_meth_set_derive_derive = function (ctx : PEVP_PKEY_CTX; key : PIdAnsiChar; keylen : psize_t) : TIdC_INT cdecl; + {$EXTERNALSYM EVP_PKEY_meth_set_ctrl_ctrl} + EVP_PKEY_meth_set_ctrl_ctrl = function(ctx : PEVP_PKEY_CTX; _type : TIdC_INT; p1 : TIdC_INT; p2 : Pointer) : TIdC_INT cdecl; + {$EXTERNALSYM EVP_PKEY_meth_set_ctrlctrl_str} + EVP_PKEY_meth_set_ctrlctrl_str = function(ctx : PEVP_PKEY_CTX; + _type : PIdAnsiChar; value : PIdAnsiChar) : TIdC_INT cdecl; + + +var + {$EXTERNALSYM OpenSSL_add_all_algorithms} + OpenSSL_add_all_algorithms : procedure cdecl = nil; + {$EXTERNALSYM OpenSSL_add_all_ciphers} + OpenSSL_add_all_ciphers : procedure cdecl = nil; + {$EXTERNALSYM OpenSSL_add_all_digests} + OpenSSL_add_all_digests : procedure cdecl = nil; + {$EXTERNALSYM EVP_cleanup} + EVP_cleanup : procedure cdecl = nil; + //SSL Version function + {$EXTERNALSYM _SSLeay_version} + _SSLeay_version : function(_type : TIdC_INT) : PIdAnsiChar cdecl = nil; + //SSLeay + {$EXTERNALSYM SSLeay} + SSLeay : function : TIdC_ULONG cdecl = nil; + {$EXTERNALSYM _CRYPTO_lock} + _CRYPTO_lock : procedure(mode, _type : TIdC_INT; const _file : PIdAnsiChar; line : TIdC_INT) cdecl = nil; + + //CRYPTO_set_mem_ex_functions + {$EXTERNALSYM CRYPTO_set_mem_functions} + CRYPTO_set_mem_functions : function( + m: TCRYPTO_set_mem_functions_m; + r: TCRYPTO_set_mem_functions_r; + f: TCRYPTO_set_mem_functions_f): TIdC_INT cdecl = nil; + {$EXTERNALSYM CRYPTO_malloc} + CRYPTO_malloc : function(num: TIdC_INT; const _file: PIdAnsiChar; line: TIdC_INT): Pointer cdecl = nil; + {$EXTERNALSYM CRYPTO_free} + CRYPTO_free : procedure(ptr : Pointer) cdecl = nil; + {$EXTERNALSYM CRYPTO_mem_leaks} + CRYPTO_mem_leaks : procedure(b:PBIO) cdecl = nil; + {$EXTERNALSYM CRYPTO_mem_ctrl} + CRYPTO_mem_ctrl : function(mode: TIdC_INT): TIdC_INT cdecl = nil; + {$EXTERNALSYM CRYPTO_set_mem_debug_functions} + CRYPTO_set_mem_debug_functions : procedure ( + m: Tset_mem_debug_functions_m; + r: Tset_mem_debug_functions_r; + f : Tset_mem_debug_functions_f; + so : Tset_mem_debug_functions_so; + go : Tset_mem_debug_functions_go) cdecl = nil; + {$EXTERNALSYM CRYPTO_dbg_malloc} + CRYPTO_dbg_malloc : procedure(addr: Pointer; num: TIdC_INT; const _file: PIdAnsiChar; line, before: TIdC_INT) cdecl = nil; + {$EXTERNALSYM CRYPTO_dbg_realloc} + CRYPTO_dbg_realloc : procedure(arrd1, addr2: Pointer; num: TIdC_INT; const _file: PIdAnsiChar; line, before: TIdC_INT) cdecl = nil; + {$EXTERNALSYM CRYPTO_dbg_free} + CRYPTO_dbg_free : procedure(addr: Pointer; before: TIdC_INT) cdecl = nil; + {$EXTERNALSYM CRYPTO_dbg_set_options} + CRYPTO_dbg_set_options : procedure(bits: TIdC_LONG) cdecl = nil; + {$EXTERNALSYM CRYPTO_dbg_get_options} + CRYPTO_dbg_get_options : function: TIdC_LONG cdecl = nil; + {$EXTERNALSYM CRYPTO_THREADID_set_numeric} + CRYPTO_THREADID_set_numeric : procedure(id : PCRYPTO_THREADID; val : TIdC_ULONG) cdecl = nil; + {$EXTERNALSYM CRYPTO_THREADID_set_pointer} + CRYPTO_THREADID_set_pointer : procedure(id : PCRYPTO_THREADID; ptr : Pointer) cdecl = nil; + {$EXTERNALSYM CRYPTO_THREADID_set_callback} + CRYPTO_THREADID_set_callback : function(threadid_func : TCRYPTO_THREADID_set_callback_threadid_func) : TIdC_INT cdecl = nil; + {$EXTERNALSYM sk_num} + sk_num : function (const x : PSTACK) : TIdC_INT cdecl = nil; + {$EXTERNALSYM sk_value} + sk_value : function (x : PSTACK; i : TIdC_INT) : PIdAnsiChar cdecl = nil; + {$EXTERNALSYM sk_new} + sk_new : function ( cmp : Tsk_new_cmp) : PStack cdecl = nil; + {$EXTERNALSYM sk_new_null} + sk_new_null : function: PSTACK cdecl = nil; + {$EXTERNALSYM sk_free} + sk_free : procedure (st : PSTACK) cdecl = nil; + {$EXTERNALSYM sk_push} + sk_push : function(st: PSTACK; data: PIdAnsiChar): TIdC_INT cdecl = nil; + {$EXTERNALSYM RSA_new} + RSA_new: function: PRSA cdecl = nil; + {$EXTERNALSYM RSA_size} + RSA_size: function(key: PRSA): TIdC_INT cdecl = nil; + //This function is depreciated. + {$EXTERNALSYM RSA_generate_key} + RSA_generate_key : function(bits: TIdC_INT; e: TIdC_ULONG; callback: TRSA_generate_key_callback; cb_arg: Pointer): PRSA cdecl = nil; + {$EXTERNALSYM RSA_generate_key_ex} + RSA_generate_key_ex : function(rsa : PRSA; bits : TIdC_INT; e : PBIGNUM; cb : PBN_GENCB) : TIdC_INT cdecl = nil; + {$EXTERNALSYM RSA_free} + RSA_free : procedure(rsa: PRSA) cdecl = nil; + {$EXTERNALSYM RSA_check_key} + RSA_check_key : function(const rsa: PRSA): TIdC_INT cdecl = nil; + {$EXTERNALSYM RSA_private_decrypt} + RSA_private_decrypt: function(flen: TIdC_INT; from: PByte; _to: PByte; rsa: PRSA; padding: TIdC_INT): TIdC_INT cdecl = nil; + {$EXTERNALSYM RSA_public_encrypt} + RSA_public_encrypt: function(flen: TIdC_INT; from: PByte; _to: PByte; rsa: PRSA; padding: TIdC_INT): TIdC_INT cdecl = nil; + {$EXTERNALSYM X509_get_default_cert_file} + X509_get_default_cert_file : function : PIdAnsiChar cdecl = nil; + {$EXTERNALSYM X509_get_default_cert_file_env} + X509_get_default_cert_file_env : function : PIdAnsiChar cdecl = nil; + {$EXTERNALSYM BIO_set_flags} + BIO_set_flags : procedure(b: PBIO; flags: integer) cdecl = nil; + {$EXTERNALSYM BIO_new} + BIO_new : function(_type: PBIO_METHOD): PBIO cdecl = nil; + {$EXTERNALSYM BIO_new_mem_buf} + BIO_new_mem_buf : function (buf : Pointer; len : TIdC_INT) : PBIO cdecl = nil; + {$EXTERNALSYM BIO_push} + BIO_push : function(b: PBIO; append: PBIO): PBIO cdecl = nil; + {$EXTERNALSYM BIO_pop} + BIO_pop : function(b: PBIO): PBIO cdecl = nil; + {$EXTERNALSYM BIO_set_next} + BIO_set_next : procedure(b: PBIO; next: PBIO) cdecl = nil; + {$EXTERNALSYM BIO_free} + BIO_free : function(bio: PBIO): TIdC_INT cdecl = nil; + {$EXTERNALSYM BIO_free_all} + BIO_free_all : procedure(bio: PBIO) cdecl = nil; + {$EXTERNALSYM BIO_s_mem} + BIO_s_mem : function: PBIO_METHOD cdecl = nil; + {$EXTERNALSYM BIO_s_file} + BIO_s_file : function: PBIO_METHOD cdecl = nil; + {$EXTERNALSYM BIO_set_ex_data} + BIO_set_ex_data : function(bio : PBIO; idx : TIdC_INT; data : Pointer) : TidC_INT cdecl = nil; + {$EXTERNALSYM BIO_get_ex_data} + BIO_get_ex_data: function(bio : PBIO; idx : TIdC_INT) : Pointer cdecl = nil; + {$EXTERNALSYM BIO_ctrl} + BIO_ctrl : function(bp: PBIO; cmd: TIdC_INT; larg: TIdC_LONG; parg: Pointer): TIdC_LONG cdecl = nil; + {$EXTERNALSYM BIO_ptr_ctrl} + BIO_ptr_ctrl : function(bp : PBIO; cmd : TIdC_INT; larg : TIdC_LONG) : PIdAnsiChar cdecl = nil; + {$EXTERNALSYM BIO_int_ctrl} + BIO_int_ctrl : function(bp : PBIO; cmd : TIdC_INT; larg : TIdC_LONG; iArg : TIdC_INT) : TIdC_LONG cdecl = nil; + {$EXTERNALSYM BIO_callback_ctrl} + BIO_callback_ctrl : function(b : PBIO; cmd : TIdC_INT; fp : SSL_callback_ctrl_fp ) : TIdC_LONG cdecl = nil; + {$EXTERNALSYM BIO_new_file} + BIO_new_file : function(const filename: PIdAnsiChar; const mode: PIdAnsiChar): PBIO cdecl = nil; + {$EXTERNALSYM BIO_puts} + BIO_puts : function(b: PBIO; const txt: PIdAnsiChar): TIdC_INT cdecl = nil; + {$EXTERNALSYM BIO_read} + BIO_read : function(b: PBIO; data: Pointer; len: TIdC_INT): TIdC_INT cdecl = nil; + {$EXTERNALSYM BIO_write} + BIO_write : function(b: PBIO; const buf: Pointer; len: TIdC_INT): TIdC_INT cdecl = nil; + {$EXTERNALSYM BN_hex2bn} + BN_hex2bn: function(var n:PBIGNUM; const Str: PIdAnsiChar): TIdC_INT cdecl = nil; + {$EXTERNALSYM BN_new} + BN_new : function(): PBIGNUM cdecl = nil; + {$EXTERNALSYM BN_free} + BN_free : procedure(a: PBIGNUM) cdecl = nil; + {$EXTERNALSYM BN_bn2dec} + BN_bn2dec: function(const n:PBIGNUM): PIdAnsiChar cdecl = nil; + {$EXTERNALSYM BN_bn2hex} + BN_bn2hex: function(const n:PBIGNUM): PIdAnsiChar cdecl = nil; + {$EXTERNALSYM BN_set_word} + BN_set_word: function(a: PBIGNUM; w: TIdC_ULONG): TIdC_INT cdecl = nil; + {$EXTERNALSYM DH_free} + DH_free : procedure(dh: PDH) cdecl = nil; + + {$IFNDEF SSLEAY_MACROS} + //Note that these are defined as a pointer to a pointer to a structure. + //This is done because the pointer being passed could be nil. The pointer is probably + //more of a template than anything. If it is used, it should be initialized to nil. + {$EXTERNALSYM _PEM_read_bio_X509} + _PEM_read_bio_X509 : function(bp: PBIO; x: PPX509; cb: ppem_password_cb; u: Pointer): PX509 cdecl = nil; + {$EXTERNALSYM _PEM_read_bio_X509_REQ} + _PEM_read_bio_X509_REQ : function(bp :PBIO; x : PPX509_REQ; cb :ppem_password_cb; u: PIdAnsiChar) : PX509_REQ cdecl = nil; + {$EXTERNALSYM _PEM_read_bio_X509_CRL} + _PEM_read_bio_X509_CRL : function(bp : PBIO; x : PPX509_CRL;cb : ppem_password_cb; u: Pointer) : PX509_CRL cdecl = nil; + {$EXTERNALSYM _PEM_read_bio_RSAPrivateKey} + _PEM_read_bio_RSAPrivateKey : function(bp : PBIO; x : PPRSA; cb : ppem_password_cb; u: Pointer) : PRSA cdecl = nil; + {$EXTERNALSYM _PEM_read_bio_RSAPublicKey} + _PEM_read_bio_RSAPublicKey : function(bp : PBIO; x : PPRSA; cb : ppem_password_cb; u: Pointer) : PRSA cdecl = nil; + {$EXTERNALSYM _PEM_read_bio_DSAPrivateKey} + _PEM_read_bio_DSAPrivateKey : function(bp : PBIO; x : PPDSA; cb : ppem_password_cb; u : Pointer) : PDSA cdecl = nil; + {$EXTERNALSYM _PEM_read_bio_PrivateKey} + _PEM_read_bio_PrivateKey : function(bp : PBIO; x : PPEVP_PKEY; cb : ppem_password_cb; u : Pointer) : PEVP_PKEY cdecl = nil; + {$EXTERNALSYM _PEM_read_bio_PKCS7} + _PEM_read_bio_PKCS7 : function(bp : PBIO; x : PPPKCS7; cb : ppem_password_cb; u : Pointer) : PPKCS7 cdecl = nil; + {$EXTERNALSYM _PEM_read_bio_DHparams} + _PEM_read_bio_DHparams : function(bp : PBIO; x : PPDH; cb : ppem_password_cb; u : Pointer) : PDH cdecl = nil; + {$EXTERNALSYM _PEM_read_bio_DSAparams} + _PEM_read_bio_DSAparams : function(bp : PBIO; x : PPDSA; cb : ppem_password_cb; u : Pointer) : PDSA cdecl = nil; + {$EXTERNALSYM _PEM_read_bio_NETSCAPE_CERT_SEQUENCE} + _PEM_read_bio_NETSCAPE_CERT_SEQUENCE : function(bp : PBIO; x : PPNETSCAPE_CERT_SEQUENCE; + cb : ppem_password_cb; u : Pointer) : PNETSCAPE_CERT_SEQUENCE cdecl = nil; + {$EXTERNALSYM _PEM_read_bio_PUBKEY} + _PEM_read_bio_PUBKEY : function(bp : PBIO; x : PPEVP_PKEY; cb : ppem_password_cb; u : Pointer) : PEVP_PKEY cdecl = nil; + {$EXTERNALSYM _PEM_write_bio_X509} + _PEM_write_bio_X509 : function(b: PBIO; x: PX509): TIdC_INT cdecl = nil; + {$EXTERNALSYM _PEM_write_bio_X509_REQ} + _PEM_write_bio_X509_REQ : function(bp: PBIO; x: PX509_REQ): TIdC_INT cdecl = nil; + {$EXTERNALSYM _PEM_write_bio_X509_CRL} + _PEM_write_bio_X509_CRL : function(bp : PBIO; x : PX509_CRL) : TIdC_INT cdecl = nil; + {$EXTERNALSYM _PEM_write_bio_RSAPublicKey} + _PEM_write_bio_RSAPublicKey : function(bp : PBIO; x : PRSA) : TIdC_INT cdecl = nil; + {$EXTERNALSYM _PEM_write_bio_RSAPrivateKey} + _PEM_write_bio_RSAPrivateKey : function(bp : PBIO; x : PRSA; const enc : PEVP_CIPHER; + kstr : PIdAnsiChar; klen : TIdC_INT; cb : ppem_password_cb; u : POinter) : TIdC_INT cdecl = nil; + {$EXTERNALSYM _PEM_write_bio_DSAPrivateKey} + _PEM_write_bio_DSAPrivateKey : function(bp : PBIO; x : PDSA; const enc : PEVP_CIPHER; + kstr : PIdAnsiChar; klen : TIdC_INT; cb : Ppem_password_cb; u : Pointer) : TIdC_INT cdecl = nil; + {$EXTERNALSYM _PEM_write_bio_PrivateKey} + _PEM_write_bio_PrivateKey : function(bp : PBIO; x : PEVP_PKEY; const enc : PEVP_CIPHER; + kstr : PIdAnsiChar; klen : TIdC_INT; cb : Ppem_password_cb; u : Pointer) : TIdC_INT cdecl = nil; + {$EXTERNALSYM _PEM_write_bio_PKCS7} + _PEM_write_bio_PKCS7 : function(bp : PBIO; x : PPKCS7) : TIdC_INT cdecl = nil; + {$EXTERNALSYM _PEM_write_bio_DHparams} + _PEM_write_bio_DHparams : function(bp : PBIO; x : PDH): TIdC_INT cdecl = nil; + {$EXTERNALSYM _PEM_write_bio_DSAparams} + _PEM_write_bio_DSAparams : function(bp : PBIO; x : PDSA) : TIdC_INT cdecl = nil; + {$EXTERNALSYM _PEM_write_bio_NETSCAPE_CERT_SEQUENCE} + _PEM_write_bio_NETSCAPE_CERT_SEQUENCE : function(bp : PBIO; x : PDSA) : TIdC_INT cdecl = nil; + {$IFNDEF OPENSSL_NO_BIO} + {$EXTERNALSYM _PEM_write_bio_PKCS8PrivateKey} + _PEM_write_bio_PKCS8PrivateKey : function(bp: PBIO; key: PEVP_PKEY; enc: PEVP_CIPHER; + kstr: PIdAnsiChar; klen: TIdC_INT; cb: ppem_password_cb; u: Pointer): TIdC_INT cdecl = nil; + {$EXTERNALSYM _PEM_write_bio_PUBKEY} + _PEM_write_bio_PUBKEY : function(bp: PBIO; x: PEVP_PKEY): TIdC_INT cdecl = nil; + {$ENDIF} + {$ELSE} + {$IFNDEF OPENSSL_NO_BIO} + {$EXTERNALSYM PEM_ASN1_write_bio} + PEM_ASN1_write_bio : function(i2d: i2d_of_void; const name: PIdAnsiChar; + bp: PBIO; x: PIdAnsiChar; const enc: PEVP_CIPHER; kstr: PIdAnsiChar; klen: TIdC_INT; + cb: ppem_password_cb; u: Pointer):TIdC_INT cdecl = nil; + {$EXTERNALSYM PEM_ASN1_read_bio} + PEM_ASN1_read_bio : function(d2i: d2i_OF_void; name: PIdAnsiChar; bp: PBIO; + x: PPointer; cb: ppem_password_cb; u:Pointer): Pointer cdecl = nil; + {$ENDIF} + {$ENDIF} + {$EXTERNALSYM PEM_X509_INFO_read_bio} + PEM_X509_INFO_read_bio : function (bp : PBIO; sk : PSTACK_OF_X509_INFO; + cb : ppem_password_cb; u : Pointer) : PSTACK_OF_X509_INFO cdecl = nil; + {$EXTERNALSYM PEM_read_bio_X509_AUX} + PEM_read_bio_X509_AUX : function (bp : PBIO; x : PPX509; + cb : ppem_password_cb; u : Pointer) : PX509 cdecl = nil; + {$EXTERNALSYM EVP_DigestInit} + EVP_DigestInit : function(ctx : PEVP_MD_CTX; _type : PEVP_MD) : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_DigestFinal} + EVP_DigestFinal : function(ctx : PEVP_MD_CTX;md : PIdAnsiChar; s : TIdC_UINT) : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_DigestInit_ex} + EVP_DigestInit_ex : function (ctx : PEVP_MD_CTX; const AType : PEVP_MD; impl : PENGINE) : TIdC_Int cdecl = nil; + {$EXTERNALSYM EVP_DigestUpdate} + EVP_DigestUpdate : function (ctx : PEVP_MD_CTX; d : Pointer; cnt : size_t) : TIdC_Int cdecl = nil; + {$EXTERNALSYM EVP_DigestFinal_ex} + EVP_DigestFinal_ex : function(ctx : PEVP_MD_CTX; md : PIdAnsiChar; var s : TIdC_UInt) : TIdC_Int cdecl = nil; + {$EXTERNALSYM EVP_EncryptInit} + EVP_EncryptInit : function(ctx : PEVP_CIPHER_CTX;cipher : PEVP_CIPHER; + key : PIdAnsiChar; iv : PIdAnsiChar) : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_EncryptInit_ex} + EVP_EncryptInit_ex : function(ctx : PEVP_CIPHER_CTX; cipher : PEVP_CIPHER; impl : PENGINE; + key : PIdAnsiChar; iv : PIdAnsiChar) : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_EncryptUpdate} + EVP_EncryptUpdate : function(ctx : PEVP_CIPHER_CTX; _out : PIdAnsiChar; + outl : PIdC_INT; _in : PIdAnsiChar; inl : TIdC_INT) : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_EncryptFinal_ex} + EVP_EncryptFinal_ex : function(ctx : PEVP_CIPHER_CTX; _out : PIdAnsiChar; outl : PIdC_INT) : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_EncryptFinal} + EVP_EncryptFinal : function(ctx : PEVP_CIPHER_CTX; _out : PIdAnsiChar; outl: PIdC_INT) : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_DecryptInit} + EVP_DecryptInit : function(ctx : PEVP_CIPHER_CTX; cipher : PEVP_CIPHER; + key : PIdAnsiChar; iv : PIdAnsiChar) : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_DecryptInit_ex} + EVP_DecryptInit_ex : function(ctx : PEVP_CIPHER_CTX; cipher : PEVP_CIPHER; impl : PENGINE; + key : PIdAnsiChar; iv : PIdAnsiChar) : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_DecryptUpdate} + EVP_DecryptUpdate : function(ctx : PEVP_CIPHER_CTX; _out : PIdAnsiChar; + outl : PIdC_INT; _in : PIdAnsiChar; inl : TIdC_INT) : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_DecryptFinal} + EVP_DecryptFinal : function(ctx : PEVP_CIPHER_CTX; outm : PIdAnsiChar; outl : PIdC_INT) : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_DecryptFinal_ex} + EVP_DecryptFinal_ex : function(ctx : PEVP_CIPHER_CTX; outm: PIdAnsiChar; outl : PIdC_INT) : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_CipherInit} + EVP_CipherInit : function(ctx : PEVP_CIPHER_CTX; cipher : PEVP_CIPHER; + key : PIdAnsiChar; iv : PIdAnsiChar; + enc : TIdC_INT) : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_CipherInit_ex} + EVP_CipherInit_ex : function(ctx : PEVP_CIPHER_CTX; cipher: PEVP_CIPHER; impl : PENGINE; + key : PIdAnsiChar; iv : PIdAnsiChar; + enc : TIdC_INT) : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_CipherUpdate} + EVP_CipherUpdate : function(ctx : PEVP_CIPHER_CTX; _out : PIdAnsiChar; + outl : PIdC_INT; _in : PIdAnsiChar; inl : TIdC_INT) : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_CipherFinal} + EVP_CipherFinal : function(ctx : PEVP_CIPHER_CTX; outm : PIdAnsiChar; outl : PIdC_INT) : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_CipherFinal_ex} + EVP_CipherFinal_ex: function(ctx : PEVP_CIPHER_CTX; outm : PIdAnsiChar; outl : PIdC_INT) : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_SignFinal} + EVP_SignFinal : function(ctx : PEVP_MD_CTX; md : PIdAnsiChar; s : PIdC_INT; + pkey : PEVP_PKEY) : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_VerifyFinal} + EVP_VerifyFinal : function(ctx : PEVP_MD_CTX; sigbuf : PIdAnsiChar; + siglen : TIdC_UINT; pkey : PEVP_PKEY) : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_DigestSignInit} + EVP_DigestSignInit : function(ctx : PEVP_MD_CTX; pctx : PPEVP_PKEY_CTX; + _type : PEVP_MD; e : PENGINE; pkey : PEVP_PKEY) : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_DigestSignFinal} + EVP_DigestSignFinal : function(ctx : PEVP_MD_CTX; + sigret : PIdAnsiChar; siglen : Psize_t) : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_DigestVerifyInit} + EVP_DigestVerifyInit : function(ctx : PEVP_MD_CTX; pctx : PPEVP_PKEY_CTX; + _type : PEVP_MD;e : PENGINE; pkey : PEVP_PKEY) : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_DigestVerifyFinal} + EVP_DigestVerifyFinal: function(ctx : PEVP_MD_CTX; + sig : PIdAnsiChar; siglen : size_t) : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_OpenInit} + EVP_OpenInit : function(ctx : PEVP_CIPHER_CTX; _type : PEVP_CIPHER; + ek : PIdAnsiChar; ekl : TIdC_INT; iv : PIdAnsiChar; + priv : PEVP_PKEY) : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_OpenFinal} + EVP_OpenFinal : function (ctx : PEVP_CIPHER_CTX; _out : PIdAnsiChar; outl : PIdC_INT) : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_SealInit} + EVP_SealInit : function(ctx : PEVP_CIPHER_CTX; _type : PEVP_CIPHER; + ek : PPIdAnsiChar; ekl : PIdC_INT; iv : PIdAnsiChar; + pubk : PPEVP_PKEY; npubk : TIdC_INT) : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_SealFinal} + EVP_SealFinal : function(ctx : PEVP_CIPHER_CTX; _out : PIdAnsiChar; outl : PIdC_INT) : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_EncodeInit} + EVP_EncodeInit : procedure(ctx : PEVP_ENCODE_CTX) cdecl = nil; + {$EXTERNALSYM EVP_EncodeUpdate} + EVP_EncodeUpdate : procedure(ctx : PEVP_ENCODE_CTX; _out : PIdAnsiChar; outl : PIdC_INT; + _in : PIdAnsiChar; inl : TIdC_INT) cdecl = nil; + {$EXTERNALSYM EVP_EncodeFinal} + EVP_EncodeFinal : procedure(ctx : PEVP_ENCODE_CTX; _out: PIdAnsiChar; outl : PIdC_INT) cdecl = nil; + {$EXTERNALSYM EVP_EncodeBlock} + EVP_EncodeBlock : function(t: PIdAnsiChar; f: PIdAnsiChar; n : TIdC_INT) : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_DecodeInit} + EVP_DecodeInit : procedure(ctx : PEVP_ENCODE_CTX) cdecl = nil; + {$EXTERNALSYM EVP_DecodeUpdate} + EVP_DecodeUpdate : function(ctx : PEVP_ENCODE_CTX; _out : PIdAnsiChar; outl : PIdC_INT; + _in : PIdAnsiChar; inl : TIdC_INT) : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_DecodeFinal} + EVP_DecodeFinal: function(ctx : PEVP_ENCODE_CTX; _out : PIdAnsiChar; outl : PIdC_INT) : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_DecodeBlock} + EVP_DecodeBlock : function(t: PIdAnsiChar; f: PIdAnsiChar; n : TIdC_INT) : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_CIPHER_CTX_init} + EVP_CIPHER_CTX_init : procedure(a : PEVP_CIPHER_CTX) cdecl = nil; + {$EXTERNALSYM EVP_CIPHER_CTX_cleanup} + EVP_CIPHER_CTX_cleanup : function(a : PEVP_CIPHER_CTX) : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_CIPHER_CTX_new} + EVP_CIPHER_CTX_new : function : PEVP_CIPHER_CTX cdecl = nil; + {$EXTERNALSYM EVP_CIPHER_CTX_free} + EVP_CIPHER_CTX_free: procedure(a : PEVP_CIPHER_CTX) cdecl = nil; + {$EXTERNALSYM EVP_CIPHER_CTX_set_key_length} + EVP_CIPHER_CTX_set_key_length : function(x : PEVP_CIPHER_CTX; keylen : TIdC_INT) : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_CIPHER_CTX_set_padding} + EVP_CIPHER_CTX_set_padding : function(c : PEVP_CIPHER_CTX; pad : TIdC_INT) : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_CIPHER_CTX_ctrl} + EVP_CIPHER_CTX_ctrl : function(ctx : PEVP_CIPHER_CTX; _type : TIdC_INT; arg : TIdC_INT; ptr : Pointer) : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_CIPHER_CTX_rand_key} + EVP_CIPHER_CTX_rand_key : function(ctx : PEVP_CIPHER_CTX; key : PIdAnsiChar) : TIdC_INT cdecl = nil; + {$ifndef OPENSSL_NO_BIO} + {$EXTERNALSYM BIO_f_md} + BIO_f_md : function : PBIO_METHOD cdecl = nil; + {$EXTERNALSYM BIO_f_base64} + BIO_f_base64 : function : PBIO_METHOD cdecl = nil; + {$EXTERNALSYM BIO_f_cipher} + BIO_f_cipher : function : PBIO_METHOD cdecl = nil; + {$EXTERNALSYM BIO_f_reliable} + BIO_f_reliable : function : PBIO_METHOD cdecl = nil; + {$EXTERNALSYM BIO_set_cipher} + BIO_set_cipher : procedure (b : PBIO; c : PEVP_CIPHER; k : PIdAnsiChar; + i : PIdAnsiChar; enc : TIdC_INT) cdecl = nil; + {$endif} + {$EXTERNALSYM EVP_MD_CTX_init} + EVP_MD_CTX_init : procedure(ctx : PEVP_MD_CTX) cdecl = nil; + {$EXTERNALSYM EVP_MD_CTX_cleanup} + EVP_MD_CTX_cleanup : function(ctx : PEVP_MD_CTX) : TIdC_Int cdecl = nil; + {$EXTERNALSYM EVP_MD_CTX_create} + EVP_MD_CTX_create: function : PEVP_MD_CTX cdecl = nil; + {$EXTERNALSYM EVP_MD_CTX_destroy} + EVP_MD_CTX_destroy : procedure(ctx : PEVP_MD_CTX) cdecl = nil; + {$EXTERNALSYM EVP_MD_CTX_copy} + EVP_MD_CTX_copy : function(_out : PEVP_MD_CTX; _in: PEVP_MD_CTX): TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_MD_CTX_copy_ex} + EVP_MD_CTX_copy_ex : function (_out : PEVP_MD_CTX; const _in: PEVP_MD_CTX): TIdC_INT cdecl = nil; + + {$IFNDEF OPENSSL_NO_DES} + {$EXTERNALSYM EVP_des_ede3_cbc} + EVP_des_ede3_cbc : function: PEVP_CIPHER cdecl = nil; + {$ENDIF} + {$EXTERNALSYM EVP_PKEY_new} + EVP_PKEY_new : function : PEVP_PKEY cdecl = nil; + + {$EXTERNALSYM EVP_PKEY_free} + EVP_PKEY_free : procedure(pkey: PEVP_PKEY) cdecl = nil; + {$EXTERNALSYM EVP_PKEY_assign} + EVP_PKEY_assign : function(pkey: PEVP_PKEY; _type: TIdC_INT; key: Pointer): TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_get_cipherbyname} + EVP_get_cipherbyname : function(const name : PIdAnsiChar): PEVP_CIPHER cdecl = nil; + {$EXTERNALSYM EVP_get_digestbyname} + EVP_get_digestbyname : function(const name: PIdAnsiChar): PEVP_MD cdecl = nil; + {$EXTERNALSYM EVP_MD_type} + EVP_MD_type : function (md : PEVP_MD) : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_MD_size} + EVP_MD_size : function (md : PEVP_MD) : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_MD_block_size} + EVP_MD_block_size : function (md : PEVP_MD) : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_MD_flags} + EVP_MD_flags : function (md : PEVP_MD) : TIdC_ULONG cdecl = nil; + {$EXTERNALSYM EVP_MD_CTX_md} + EVP_MD_CTX_md : function (ctx : PEVP_MD_CTX) : PEVP_MD cdecl = nil; + {$EXTERNALSYM EVP_CIPHER_nid} + EVP_CIPHER_nid : function (cipher : PEVP_CIPHER) : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_CIPHER_block_size} + EVP_CIPHER_block_size : function(cipher : PEVP_CIPHER) : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_CIPHER_key_length} + EVP_CIPHER_key_length : function(cipher : EVP_CIPHER) : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_CIPHER_iv_length} + EVP_CIPHER_iv_length : function(cipher: PEVP_CIPHER) : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_CIPHER_flags} + EVP_CIPHER_flags : function(cipher : PEVP_CIPHER) : TIdC_ULONG cdecl = nil; + {$EXTERNALSYM EVP_CIPHER_type} + EVP_CIPHER_type : function(ctx : PEVP_CIPHER) : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_CIPHER_CTX_cipher} + EVP_CIPHER_CTX_cipher : function (ctx : PEVP_CIPHER_CTX) : PEVP_CIPHER cdecl = nil; + {$EXTERNALSYM EVP_CIPHER_CTX_nid} + EVP_CIPHER_CTX_nid : function (ctx : PEVP_CIPHER_CTX) : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_CIPHER_CTX_block_size} + EVP_CIPHER_CTX_block_size : function(ctx : PEVP_CIPHER_CTX) : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_CIPHER_CTX_key_length} + EVP_CIPHER_CTX_key_length : function(ctx : PEVP_CIPHER_CTX) : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_CIPHER_CTX_iv_length} + EVP_CIPHER_CTX_iv_length : function(ctx : PEVP_CIPHER_CTX) : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_CIPHER_CTX_copy} + EVP_CIPHER_CTX_copy : function(_out : PEVP_CIPHER_CTX; _in : PEVP_CIPHER_CTX) : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_CIPHER_CTX_get_app_data} + EVP_CIPHER_CTX_get_app_data : function(ctx : PEVP_CIPHER_CTX) : Pointer cdecl = nil; + {$EXTERNALSYM EVP_CIPHER_CTX_set_app_data} + EVP_CIPHER_CTX_set_app_data : procedure(ctx : PEVP_CIPHER_CTX; data : Pointer) cdecl =nil; + {$EXTERNALSYM EVP_CIPHER_CTX_flags} + EVP_CIPHER_CTX_flags : function(ctx : PEVP_CIPHER_CTX) : TIdC_ULONG cdecl = nil; + {$EXTERNALSYM ASN1_INTEGER_set} + ASN1_INTEGER_set : function(a: PASN1_INTEGER; v: TIdC_LONG): TIdC_INT cdecl = nil; + {$EXTERNALSYM ASN1_INTEGER_get} + ASN1_INTEGER_get : function(a: PASN1_INTEGER) : TIdC_LONG cdecl = nil; + //IdSslAsn1UtcTimeNew : function: Pointer cdecl = nil; + {$EXTERNALSYM ASN1_INTEGER_to_BN} + ASN1_INTEGER_to_BN : function(a: PASN1_INTEGER; bn: PBIGNUM) : PBIGNUM cdecl = nil; + {$EXTERNALSYM ASN1_STRING_type_new} + ASN1_STRING_type_new : function(_type: TIdC_INT): PASN1_STRING cdecl = nil; + {$EXTERNALSYM ASN1_STRING_free} + ASN1_STRING_free : procedure(a: PASN1_STRING) cdecl = nil; + {$EXTERNALSYM ASN1_dup} + ASN1_dup : function (i2d : i2d_of_void; d2i : d2i_of_void; x : PIdAnsiChar) : Pointer cdecl = nil; + {$EXTERNALSYM i2d_X509} + i2d_X509 : function(x: PX509; buf: PPByte) : TIdC_INT cdecl = nil; + {$EXTERNALSYM d2i_X509} + d2i_X509 : function(pr : PX509; _in : PPByte; len : TIdC_INT): PX509 cdecl = nil; + {$EXTERNALSYM i2d_X509_NAME} + i2d_X509_NAME : function(x : PX509_NAME; buf : PPByte) : TIdC_INT cdecl = nil; + {$EXTERNALSYM d2i_X509_NAME} + d2i_X509_NAME : function(pr : PPX509_NAME; _in : PPByte; length : TIdC_LONG):PX509_NAME cdecl = nil; + {$EXTERNALSYM i2d_X509_REQ} + i2d_X509_REQ : function(x: PX509_REQ; buf: PPByte): TIdC_INT cdecl = nil; + {$EXTERNALSYM d2i_X509_REQ} + d2i_X509_REQ : function(pr : PX509_REQ; _in : PPByte; len : TIdC_INT): PX509_REQ cdecl = nil; + {$EXTERNALSYM i2d_X509_CRL} + i2d_X509_CRL : function(x: PX509_CRL; buf: PPByte): TIdC_INT cdecl = nil; + {$EXTERNALSYM d2i_X509_CRL} + d2i_X509_CRL : function(pr : PX509_CRL; _in : PPByte; len : TIdC_INT): PX509_REQ cdecl = nil; + {$EXTERNALSYM i2d_RSAPrivateKey} + i2d_RSAPrivateKey : function(x: PRSA; buf: PPByte): TIdC_INT cdecl = nil; + {$EXTERNALSYM d2i_RSAPrivateKey} + d2i_RSAPrivateKey : function(pr : PRSA; _in : PPByte; len : TIdC_INT): PRSA cdecl = nil; + {$EXTERNALSYM i2d_RSAPublicKey} + i2d_RSAPublicKey : function(x: PRSA; buf: PPByte): TIdC_INT cdecl = nil; + {$EXTERNALSYM d2i_RSAPublicKey} + d2i_RSAPublicKey : function(pr : PRSA; _in : PPByte; len : TIdC_INT): PRSA cdecl = nil; + {$EXTERNALSYM i2d_DSAPrivateKey} + i2d_DSAPrivateKey : function(x: PDSA; buf: PPByte): TIdC_INT cdecl = nil; + {$EXTERNALSYM d2i_DSAPrivateKey} + d2i_DSAPrivateKey : function(pr : PDSA; _in : PPByte; len : TIdC_INT): PDSA cdecl = nil; + {$EXTERNALSYM i2d_PrivateKey} + i2d_PrivateKey : function(x: PEVP_PKEY; buf: PPByte): TIdC_INT cdecl = nil; + {$EXTERNALSYM d2i_PrivateKey} + d2i_PrivateKey : function(pr : PEVP_PKEY; _in : PPByte; len : TIdC_INT): PEVP_PKEY cdecl = nil; + {$EXTERNALSYM i2d_PKCS7} + i2d_PKCS7 : function(x: PPKCS7; buf: PPByte): TIdC_INT cdecl = nil; + {$EXTERNALSYM d2i_PKCS7} + d2i_PKCS7 : function(pr : PPKCS7; _in : PPByte; len : TIdC_INT): PPKCS7 cdecl = nil; + {$EXTERNALSYM i2d_DHparams} + i2d_DHparams : function(x: PDH; buf: PPByte): TIdC_INT cdecl = nil; + {$EXTERNALSYM d2i_DHparams} + d2i_DHparams : function(pr : PDH; _in : PPByte; len : TIdC_INT): PDH cdecl = nil; + {$EXTERNALSYM i2d_DSAparams} + i2d_DSAparams : function(x: PDSA; buf: PPByte): TIdC_INT cdecl = nil; + {$EXTERNALSYM d2i_DSAparams} + d2i_DSAparams : function(pr : PDSA; _in : PPByte; len : TIdC_INT): PDSA cdecl = nil; +//NETSCAPE_CERT_SEQUENCE + {$EXTERNALSYM i2d_NETSCAPE_CERT_SEQUENCE} + i2d_NETSCAPE_CERT_SEQUENCE : function(x: PNETSCAPE_CERT_SEQUENCE; buf: PPByte): TIdC_INT cdecl = nil; + {$EXTERNALSYM d2i_NETSCAPE_CERT_SEQUENCE} + d2i_NETSCAPE_CERT_SEQUENCE : function(pr : PNETSCAPE_CERT_SEQUENCE; _in : PPByte; len : TIdC_INT): PNETSCAPE_CERT_SEQUENCE cdecl = nil; + {$EXTERNALSYM i2d_PUBKEY} + i2d_PUBKEY : function(x: PEVP_PKEY; buf: PPByte): TIdC_INT cdecl = nil; + {$EXTERNALSYM d2i_PUBKEY} + d2i_PUBKEY : function(pr : PEVP_PKEY; _in : PPByte; len : TIdC_INT): PEVP_PKEY cdecl = nil; + + {$IFNDEF OPENSSL_NO_BIO} + {$EXTERNALSYM d2i_X509_bio} + d2i_X509_bio : function(bp: PBIO; x: PPx509): PX509 cdecl = nil; + {$EXTERNALSYM i2d_X509_REQ_bio} + i2d_X509_REQ_bio : function(bp: PBIO; x: PX509_REQ): TIdC_INT cdecl = nil; + {$EXTERNALSYM i2d_X509_bio} + i2d_X509_bio : function(bp: PBIO; x: PX509): TIdC_INT cdecl = nil; + {$EXTERNALSYM i2d_PrivateKey_bio} + i2d_PrivateKey_bio : function(b: PBIO; pkey: PEVP_PKEY): TIdC_INT cdecl = nil; + //P12 additions + {$EXTERNALSYM d2i_PKCS12_bio} + d2i_PKCS12_bio: function(bp: PBIO; x: PPPKCS12): PPKCS12 cdecl = nil; + {$EXTERNALSYM PKCS12_parse} + PKCS12_parse: function(P12: PPKCS12; Password: PIdAnsiChar; out PrivateKey: PEVP_PKEY; out Cert: PX509; CertChain: PPSTACK_OF_X509): TIdC_INT cdecl = nil; + {$ENDIF} + + {$EXTERNALSYM X509_new} + X509_new : function: PX509 cdecl = nil; + {$EXTERNALSYM X509_free} + X509_free : procedure(x: PX509) cdecl = nil; + {$EXTERNALSYM X509_NAME_new} + X509_NAME_new : function :PX509_NAME cdecl = nil; + {$EXTERNALSYM X509_NAME_free} + X509_NAME_free : procedure(x:PX509_NAME) cdecl = nil; + {$EXTERNALSYM X509_REQ_new} + X509_REQ_new : function :PX509_REQ cdecl = nil; + {$EXTERNALSYM X509_REQ_free} + X509_REQ_free : procedure(x:PX509_REQ) cdecl = nil; + {$EXTERNALSYM X509_to_X509_REQ} + X509_to_X509_REQ : function(x: PX509; pkey: PEVP_PKEY; const md: PEVP_MD): PX509_REQ cdecl = nil; + {$EXTERNALSYM X509_NAME_add_entry_by_txt} + X509_NAME_add_entry_by_txt : function(name: PX509_NAME; const field: PIdAnsiChar; _type: TIdC_INT; + const bytes: PIdAnsiChar; len, loc, _set: TIdC_INT): TIdC_INT cdecl = nil; + {$EXTERNALSYM X509_INFO_free} + X509_INFO_free : procedure (a : PX509_INFO) cdecl = nil; + {$EXTERNALSYM X509_set_version} + X509_set_version : function(x: PX509; version: TIdC_LONG): TIdC_INT cdecl = nil; + {$EXTERNALSYM X509_get_serialNumber} + X509_get_serialNumber : function(x: PX509): PASN1_INTEGER cdecl = nil; + {$EXTERNALSYM X509_gmtime_adj} + X509_gmtime_adj : function(s: PASN1_TIME; adj: TIdC_LONG): PASN1_TIME cdecl = nil; + {$EXTERNALSYM X509_set_notBefore} + X509_set_notBefore : function(x: PX509; tm: PASN1_TIME): TIdC_INT cdecl = nil; + {$EXTERNALSYM X509_set_notAfter} + X509_set_notAfter : function(x: PX509; tm: PASN1_TIME): TIdC_INT cdecl = nil; + {$EXTERNALSYM X509_set_pubkey} + X509_set_pubkey : function(x: PX509; pkey: PEVP_PKEY): TIdC_INT cdecl = nil; + {$EXTERNALSYM X509_REQ_set_pubkey} + X509_REQ_set_pubkey : function(x: PX509_REQ; pkey: PEVP_PKEY): TIdC_INT cdecl = nil; + {$EXTERNALSYM X509_PUBKEY_get} + X509_PUBKEY_get : function(key: PX509_PUBKEY): PEVP_PKEY cdecl = nil; + {$EXTERNALSYM X509_verify} + X509_verify : function(x509: PX509; pkey: PEVP_PKEY): TIdC_INT cdecl = nil; + {$EXTERNALSYM X509_sign} + X509_sign : function(x: PX509; pkey: PEVP_PKEY; const md: PEVP_MD): TIdC_INT cdecl = nil; + {$EXTERNALSYM X509_REQ_sign} + X509_REQ_sign : function(x: PX509_REQ; pkey: PEVP_PKEY; const md: PEVP_MD): TIdC_INT cdecl = nil; + {$EXTERNALSYM X509_REQ_add_extensions} + X509_REQ_add_extensions : function(req: PX509_REQ; exts: PSTACK_OF_X509_EXTENSION): TIdC_INT cdecl = nil; + {$EXTERNALSYM X509V3_EXT_conf_nid} + X509V3_EXT_conf_nid : function(conf: PLHASH; ctx: PX509V3_CTX; ext_nid: TIdC_INT; value: PIdAnsiChar): PX509_EXTENSION cdecl = nil; + {$EXTERNALSYM X509_EXTENSION_create_by_NID} + X509_EXTENSION_create_by_NID : function(ex: PPX509_EXTENSION; nid: TIdC_INT; + crit: TIdC_INT; data: PASN1_OCTET_STRING): PX509_EXTENSION cdecl = nil; + {$EXTERNALSYM X509V3_set_ctx} + X509V3_set_ctx : procedure(ctx: PX509V3_CTX; issuer, subject: PX509; req: PX509_REQ; crl: PX509_CRL; flags: TIdC_INT) cdecl = nil; + {$EXTERNALSYM X509_EXTENSION_free} + X509_EXTENSION_free : procedure(ex: PX509_EXTENSION) cdecl = nil; + {$EXTERNALSYM X509_add_ext} + X509_add_ext : function(cert: PX509; ext: PX509_EXTENSION; loc: TIdC_INT): TIdC_INT cdecl = nil; + {$IFNDEF OPENSSL_NO_BIO} + {$EXTERNALSYM X509_print} + X509_print : function(bp : PBIO; x : PX509) : TIdC_INT cdecl = nil; + {$ENDIF} + {$EXTERNALSYM X509_STORE_add_lookup} + X509_STORE_add_lookup : function (v : PX509_STORE; m : PX509_LOOKUP_METHOD) : PX509_LOOKUP cdecl = nil; + {$EXTERNALSYM X509_STORE_load_locations} + X509_STORE_load_locations : function ( ctx : PX509_STORE; const _file, path : PIdAnsiChar) : TIdC_INT cdecl = nil; + {$EXTERNALSYM SSL_CTX_set_cipher_list} + SSL_CTX_set_cipher_list : function(_para1: PSSL_CTX; const str: PIdAnsiChar): TIdC_INT cdecl = nil; + {$EXTERNALSYM SSL_CTX_new} + SSL_CTX_new : function(meth: PSSL_METHOD): PSSL_CTX cdecl = nil; + {$EXTERNALSYM SSL_CTX_free} + SSL_CTX_free : procedure(_para1: PSSL_CTX) cdecl = nil; + {$EXTERNALSYM SSL_set_fd} + SSL_set_fd : function(s: PSSL; fd: TIdC_INT): TIdC_INT cdecl = nil; + {$EXTERNALSYM SSL_CTX_use_PrivateKey_file} + SSL_CTX_use_PrivateKey_file : function(ctx: PSSL_CTX; const _file: PIdAnsiChar; _type: TIdC_INT): TIdC_INT cdecl = nil; + {$EXTERNALSYM SSL_CTX_use_PrivateKey} + SSL_CTX_use_PrivateKey : function(ctx: PSSL_CTX; pkey: PEVP_PKEY): TIdC_INT cdecl = nil; + {$EXTERNALSYM SSL_CTX_use_certificate} + SSL_CTX_use_certificate : function(ctx: PSSL_CTX; x: PX509): TIdC_INT cdecl = nil; + {$EXTERNALSYM SSL_CTX_use_certificate_file} + SSL_CTX_use_certificate_file : function(ctx: PSSL_CTX; const _file: PIdAnsiChar; _type: TIdC_INT): TIdC_INT cdecl = nil; + {$EXTERNALSYM SSL_CTX_use_certificate_chain_file} //OpenSSL 1.0.2 + SSL_CTX_use_certificate_chain_file : function(ctx : PSSL_CTX; _file : PIdAnsiChar) : TIdC_INT cdecl = nil; + {$EXTERNALSYM SSL_load_error_strings} + SSL_load_error_strings : procedure cdecl = nil; + {$EXTERNALSYM SSL_state_string_long} + SSL_state_string_long : function(s: PSSL): PIdAnsiChar cdecl = nil; + {$EXTERNALSYM SSL_alert_desc_string_long} + SSL_alert_desc_string_long : function(value : TIdC_INT) : PIdAnsiChar cdecl = nil; + {$EXTERNALSYM SSL_alert_type_string_long} + SSL_alert_type_string_long : function(value : TIdC_INT) : PIdAnsiChar cdecl = nil; + {$EXTERNALSYM SSL_get_peer_certificate} + SSL_get_peer_certificate : function(s: PSSL): PX509 cdecl = nil; + {$EXTERNALSYM SSL_CTX_set_verify} + SSL_CTX_set_verify : procedure(ctx: PSSL_CTX; mode: TIdC_INT; callback: TSSL_CTX_set_verify_callback) cdecl = nil; + {$EXTERNALSYM SSL_CTX_set_verify_depth} + SSL_CTX_set_verify_depth : procedure(ctx: PSSL_CTX; depth: TIdC_INT) cdecl = nil; + {$EXTERNALSYM SSL_CTX_get_verify_depth} + SSL_CTX_get_verify_depth : function (ctx: PSSL_CTX): TIdC_INT cdecl = nil; + {$EXTERNALSYM SSL_CTX_set_default_passwd_cb} + SSL_CTX_set_default_passwd_cb : procedure(ctx: PSSL_CTX; cb: ppem_password_cb) cdecl = nil; + {$EXTERNALSYM SSL_CTX_set_default_passwd_cb_userdata} + SSL_CTX_set_default_passwd_cb_userdata: procedure(ctx: PSSL_CTX; u: Pointer) cdecl = nil; + {$EXTERNALSYM SSL_CTX_check_private_key} + SSL_CTX_check_private_key : function(ctx: PSSL_CTX): TIdC_INT cdecl = nil; + + + {$EXTERNALSYM SSL_new} + SSL_new : function(ctx: PSSL_CTX): PSSL cdecl = nil; + {$EXTERNALSYM SSL_free} + SSL_free : procedure(ssl: PSSL) cdecl = nil; + {$EXTERNALSYM SSL_accept} + SSL_accept : function(ssl: PSSL): TIdC_INT cdecl = nil; + {$EXTERNALSYM SSL_connect} + SSL_connect : function(ssl: PSSL): TIdC_INT cdecl = nil; + {$EXTERNALSYM SSL_read} + SSL_read : function(ssl: PSSL; buf: Pointer; num: TIdC_INT): TIdC_INT cdecl = nil; + {$EXTERNALSYM SSL_peek} + SSL_peek : function(ssl: PSSL; buf: Pointer; num: TIdC_INT): TIdC_INT cdecl = nil; + {$EXTERNALSYM SSL_write} + SSL_write : function(ssl: PSSL; const buf: Pointer; num: TIdC_INT): TIdC_INT cdecl = nil; + {$EXTERNALSYM SSL_pending} + SSL_pending : function(ssl : PSSL) : TIdC_INT cdecl = nil; + {$EXTERNALSYM SSL_CTX_ctrl} + //long SSL_CTX_ctrl(SSL_CTX *ctx,int cmd, long larg, void *parg); + SSL_CTX_ctrl : function(ssl: PSSL_CTX; cmd: TIdC_INT; larg: TIdC_LONG; parg: Pointer): TIdC_LONG cdecl = nil; + {$EXTERNALSYM SSL_ctrl} + //long SSL_ctrl(SSL *ssl,int cmd, long larg, void *parg); + SSL_ctrl : function(ssl : PSSL; cmd : TIdC_INT; larg : TIdC_LONG; parg : Pointer) : TIdC_LONG cdecl = nil; + {$EXTERNALSYM SSL_callback_ctrl} + //long SSL_callback_ctrl(SSL *, int, void (*)(void)); + SSL_callback_ctrl : function(ssl : PSSL; cmd : TIdC_INT; fp : SSL_callback_ctrl_fp) : TIdC_LONG cdecl = nil; + {$EXTERNALSYM SSL_CTX_callback_ctrl} + //long SSL_CTX_callback_ctrl(SSL_CTX *, int, void (*)(void)); + SSL_CTX_callback_ctrl : function(ssl : PSSL_CTX; cmd : TIdC_INT; fp : SSL_callback_ctrl_fp) : TIdC_LONG cdecl = nil; + {$EXTERNALSYM SSL_get_error} + SSL_get_error : function(s: PSSL; ret_code: TIdC_INT): TIdC_INT cdecl = nil; + {$EXTERNALSYM SSLv2_method} + SSLv2_method : function: PSSL_METHOD cdecl = nil; // SSLv2 + {$EXTERNALSYM SSLv2_server_method} + SSLv2_server_method : function: PSSL_METHOD cdecl = nil; // SSLv2 + {$EXTERNALSYM SSLv2_client_method} + SSLv2_client_method : function: PSSL_METHOD cdecl = nil; // SSLv2 + {$EXTERNALSYM SSLv3_method} + SSLv3_method : function: PSSL_METHOD cdecl = nil; // SSLv3 + {$EXTERNALSYM SSLv3_server_method} + SSLv3_server_method : function: PSSL_METHOD cdecl = nil; // SSLv3 + {$EXTERNALSYM SSLv3_client_method} + SSLv3_client_method : function: PSSL_METHOD cdecl = nil; // SSLv3 + {$EXTERNALSYM SSLv23_method} + SSLv23_method : function: PSSL_METHOD cdecl = nil; // SSLv3 but can rollback to v2 + {$EXTERNALSYM SSLv23_server_method} + SSLv23_server_method : function: PSSL_METHOD cdecl = nil; // SSLv3 but can rollback to v2 + {$EXTERNALSYM SSLv23_client_method} + SSLv23_client_method : function: PSSL_METHOD cdecl = nil; // SSLv3 but can rollback to v2 + {$EXTERNALSYM TLSv1_method} + TLSv1_method : function: PSSL_METHOD cdecl = nil; // TLSv1.0 + {$EXTERNALSYM TLSv1_server_method} + TLSv1_server_method : function: PSSL_METHOD cdecl = nil; // TLSv1.0 + {$EXTERNALSYM TLSv1_client_method} + TLSv1_client_method : function: PSSL_METHOD cdecl = nil; // TLSv1.0 + {$EXTERNALSYM TLSv1_1_method} + TLSv1_1_method : function : PSSL_METHOD cdecl = nil; //TLS1.1 + {$EXTERNALSYM TLSv1_1_server_method} + TLSv1_1_server_method : function : PSSL_METHOD cdecl = nil; //TLS1.1 + {$EXTERNALSYM TLSv1_1_client_method} + TLSv1_1_client_method : function : PSSL_METHOD cdecl = nil; //TLS1.1 + {$EXTERNALSYM TLSv1_2_method} + TLSv1_2_method : function : PSSL_METHOD cdecl = nil; //* TLSv1.2 */ + {$EXTERNALSYM TLSv1_2_server_method} + TLSv1_2_server_method : function : PSSL_METHOD cdecl = nil; //* TLSv1.2 */ + {$EXTERNALSYM TLSv1_2_client_method} + TLSv1_2_client_method : function : PSSL_METHOD cdecl = nil; //* TLSv1.2 */ + + {$EXTERNALSYM DTLSv1_method} + DTLSv1_method : function: PSSL_METHOD cdecl = nil; // DTLSv1.0 + {$EXTERNALSYM DTLSv1_server_method} + DTLSv1_server_method : function: PSSL_METHOD cdecl = nil; // DTLSv1.0 + {$EXTERNALSYM DTLSv1_client_method} + DTLSv1_client_method : function: PSSL_METHOD cdecl = nil; // DTLSv1.0 + {$EXTERNALSYM SSL_shutdown} + SSL_shutdown : function(s: PSSL): TIdC_INT cdecl = nil; + {$EXTERNALSYM SSL_set_connect_state} + SSL_set_connect_state : procedure(s: PSSL) cdecl = nil; + {$EXTERNALSYM SSL_set_accept_state} + SSL_set_accept_state : procedure(s: PSSL) cdecl = nil; + {$EXTERNALSYM SSL_set_shutdown} + SSL_set_shutdown : procedure(ssl: PSSL; mode: TIdC_INT) cdecl = nil; + {$EXTERNALSYM SSL_CTX_load_verify_locations} + SSL_CTX_load_verify_locations : function(ctx: PSSL_CTX; const CAfile: PIdAnsiChar; const CApath: PIdAnsiChar): TIdC_INT cdecl = nil; + {$EXTERNALSYM SSL_get_session} + SSL_get_session : function(const ssl: PSSL): PSSL_SESSION cdecl = nil; + {$EXTERNALSYM SSLeay_add_ssl_algorithms} + SSLeay_add_ssl_algorithms : function: TIdC_INT cdecl = nil; + // SSL_set_app_data : function(s: PSSL; arg: Pointer): Integer cdecl = nil; + // SSL_get_app_data : function(s: PSSL): Pointer cdecl = nil; + {$EXTERNALSYM SSL_SESSION_get_id} + SSL_SESSION_get_id : function(const s: PSSL_SESSION; length: PIdC_UINT): PIdAnsiChar cdecl = nil; + {$EXTERNALSYM SSL_copy_session_id} + SSL_copy_session_id : procedure(sslTo: PSSL; const sslFrom: PSSL) cdecl = nil; + {$EXTERNALSYM X509_NAME_oneline} + X509_NAME_oneline : function(a: PX509_NAME; buf: PIdAnsiChar; size: TIdC_INT): PIdAnsiChar cdecl = nil; + {$EXTERNALSYM X509_NAME_cmp} + X509_NAME_cmp : function(const a, b: PX509_NAME): TIdC_INT cdecl = nil; + {$EXTERNALSYM X509_NAME_hash} + X509_NAME_hash : function(x: PX509_NAME): TIdC_ULONG cdecl = nil; + {$EXTERNALSYM X509_set_issuer_name} + X509_set_issuer_name : function(x: PX509; name: PX509_NAME): TIdC_INT cdecl = nil; + {$EXTERNALSYM X509_get_issuer_name} + X509_get_issuer_name : function(a: PX509): PX509_NAME cdecl = nil; + {$EXTERNALSYM X509_set_subject_name} + X509_set_subject_name : function(x: PX509; name: PX509_NAME): TIdC_INT cdecl = nil; + {$EXTERNALSYM X509_get_subject_name} + X509_get_subject_name : function(a: PX509): PX509_NAME cdecl = nil; + {$EXTERNALSYM OBJ_obj2nid} + OBJ_obj2nid : function (const o: PASN1_OBJECT): TIdC_INT cdecl = nil; + {$EXTERNALSYM OBJ_nid2obj} + OBJ_nid2obj : function (n : TIdC_INT) : PASN1_OBJECT cdecl = nil; + {$EXTERNALSYM OBJ_nid2ln} + OBJ_nid2ln : function (n : TIdC_INT) : PIdAnsiChar cdecl = nil; + {$EXTERNALSYM OBJ_nid2sn} + OBJ_nid2sn : function (n : TIdC_INT) : PIdAnsiChar cdecl = nil; + {$EXTERNALSYM X509_digest} + X509_digest : function(const data: PX509; const _type: PEVP_MD; + md: PByte; var len: TIdC_UINT): TIdC_INT cdecl = nil; + {$IFNDEF OPENSSL_NO_SHA512} + {$EXTERNALSYM EVP_sha512} + EVP_sha512 : function : PEVP_MD cdecl = nil; + {$EXTERNALSYM EVP_sha384} + EVP_sha384 : function : PEVP_MD cdecl = nil; + {$ENDIF} + {$IFNDEF OPENSSL_NO_SHA256} + {$EXTERNALSYM EVP_sha256} + EVP_sha256 : function : PEVP_MD cdecl = nil; + {$EXTERNALSYM EVP_sha224} + EVP_sha224 : function : PEVP_MD cdecl = nil; + {$ENDIF} + {$IFNDEF OPENSSL_NO_SHA} + {$EXTERNALSYM EVP_sha} + EVP_sha : function : PEVP_MD cdecl = nil; + {$EXTERNALSYM EVP_sha1} + EVP_sha1 : function: PEVP_MD cdecl = nil; + {$EXTERNALSYM EVP_dss} + EVP_dss : function : PEVP_MD cdecl = nil; + {$EXTERNALSYM EVP_dss1} + EVP_dss1 : function : PEVP_MD cdecl = nil; + {$EXTERNALSYM EVP_ecdsa} + EVP_ecdsa : function : PEVP_MD cdecl = nil; + {$ENDIF} + {$ifndef OPENSSL_NO_MDC2} + {$EXTERNALSYM EVP_mdc2} + EVP_mdc2 : function : PEVP_MD cdecl = nil; + {$endif} + {$IFNDEF OPENSSL_NO_MD5} + {$EXTERNALSYM EVP_md5} + EVP_md5 : function: PEVP_MD cdecl = nil; + {$ENDIF} + {$IFNDEF OPENSSL_NO_MD4} + {$EXTERNALSYM EVP_md4} + EVP_md4 : function: PEVP_MD cdecl = nil; + {$ENDIF} + {$IFNDEF OPENSSL_NO_MD2} + {$EXTERNALSYM EVP_md2} + EVP_md2 : function: PEVP_MD cdecl = nil; + {$ENDIF} + {$ifndef OPENSSL_NO_RIPEMD} + {$EXTERNALSYM EVP_ripemd160} + EVP_ripemd160: function: PEVP_MD cdecl = nil; + {$endif} + {$ifndef OPENSSL_NO_WHIRLPOOL} + {$EXTERNALSYM EVP_whirlpool} + EVP_whirlpool: function: PEVP_MD cdecl = nil; + {$endif} + {$EXTERNALSYM EVP_md_null} + EVP_md_null : function : PEVP_MD cdecl = nil; + {$ifndef OPENSSL_NO_DES} + {$EXTERNALSYM EVP_des_ecb} + EVP_des_ecb : function : PEVP_CIPHER cdecl = nil; + {$EXTERNALSYM EVP_des_ede} + EVP_des_ede : function : PEVP_CIPHER cdecl = nil; + {$EXTERNALSYM EVP_des_ede3} + EVP_des_ede3 : function : PEVP_CIPHER cdecl = nil; + {$EXTERNALSYM EVP_des_ede_ecb} + EVP_des_ede_ecb : function : PEVP_CIPHER cdecl = nil; + {$EXTERNALSYM EVP_des_ede3_ecb} + EVP_des_ede3_ecb : function : PEVP_CIPHER cdecl = nil; + {$EXTERNALSYM EVP_des_cfb64} + EVP_des_cfb64: function : PEVP_CIPHER cdecl = nil; +// # define EVP_des_cfb EVP_des_cfb64 + {$EXTERNALSYM EVP_des_cfb1} + EVP_des_cfb1: function : PEVP_CIPHER cdecl = nil; + {$EXTERNALSYM EVP_des_cfb8} + EVP_des_cfb8 : function : PEVP_CIPHER cdecl = nil; + {$EXTERNALSYM EVP_des_ede_cfb64} + EVP_des_ede_cfb64 :function : PEVP_CIPHER cdecl = nil; +//# define EVP_des_ede_cfb EVP_des_ede_cfb64 +//#if 0 + {/$EXTERNALSYM EVP_des_ede_cfb1} + //EVP_des_ede_cfb1 :function : PEVP_CIPHER cdecl = nil; + {/$EXTERNALSYM EVP_des_ede_cfb8} + //EVP_des_ede_cfb8 : function : PEVP_CIPHER cdecl = nil; +//#endif + {$EXTERNALSYM EVP_des_ede3_cfb64} + EVP_des_ede3_cfb64 :function : PEVP_CIPHER cdecl = nil; +//# define EVP_des_ede3_cfb EVP_des_ede3_cfb64 + {$EXTERNALSYM EVP_des_ede3_cfb1} + EVP_des_ede3_cfb1 :function : PEVP_CIPHER cdecl = nil; + {$EXTERNALSYM EVP_des_ede3_cfb8} + EVP_des_ede3_cfb8 :function : PEVP_CIPHER cdecl = nil; + {$EXTERNALSYM EVP_des_ofb} + EVP_des_ofb :function : PEVP_CIPHER cdecl = nil; + {$EXTERNALSYM EVP_des_ede_ofb} + EVP_des_ede_ofb :function : PEVP_CIPHER cdecl = nil; + {$EXTERNALSYM EVP_des_ede3_ofb} + EVP_des_ede3_ofb :function : PEVP_CIPHER cdecl = nil; + {$EXTERNALSYM EVP_des_cbc} + EVP_des_cbc :function : PEVP_CIPHER cdecl = nil; + {$EXTERNALSYM EVP_des_ede_cbc} + EVP_des_ede_cbc :function : PEVP_CIPHER cdecl = nil; +// EVP_des_ede3_cbc :function : PEVP_CIPHER cdecl = nil; + {$EXTERNALSYM EVP_desx_cbc} + EVP_desx_cbc :function : PEVP_CIPHER cdecl = nil; +//* This should now be supported through the dev_crypto ENGINE. But also, why are +// * rc4 and md5 declarations made here inside a "NO_DES" precompiler branch? */ +//#if 0 + {$ifdef OPENSSL_OPENBSD_DEV_CRYPTO} + {$EXTERNALSYM EVP_dev_crypto_des_ede3_cbc} + EVP_dev_crypto_des_ede3_cbc : function : PEVP_CIPHER cdecl = nil; + {$EXTERNALSYM EVP_dev_crypto_rc4} + EVP_dev_crypto_rc4 : function : PEVP_CIPHER cdecl = nil; + {$EXTERNALSYM EVP_dev_crypto_md5} + EVP_dev_crypto_md5 : function : PEVP_MD cdecl = nil; + {$endif} +//#endif + {$endif} + {$ifndef OPENSSL_NO_RC4} + {$EXTERNALSYM EVP_rc4} + EVP_rc4: function : PEVP_CIPHER cdecl = nil; + {$EXTERNALSYM EVP_rc4_40} + EVP_rc4_40: function : PEVP_CIPHER cdecl = nil; + {$ifndef OPENSSL_NO_MD5} + {$EXTERNALSYM EVP_rc4_hmac_md5} + EVP_rc4_hmac_md5: function : PEVP_CIPHER cdecl = nil; + {$endif} + {$endif} + {$ifndef OPENSSL_NO_IDEA} + {$EXTERNALSYM EVP_idea_ecb} + EVP_idea_ecb: function : PEVP_CIPHER cdecl = nil; + {$EXTERNALSYM EVP_idea_cfb64} + EVP_idea_cfb64: function : PEVP_CIPHER cdecl = nil; + {$EXTERNALSYM EVP_idea_ofb} + EVP_idea_ofb: function : PEVP_CIPHER cdecl = nil; + {$EXTERNALSYM EVP_idea_cbc} + EVP_idea_cbc: function : PEVP_CIPHER cdecl = nil; + {$endif} + {$ifndef OPENSSL_NO_RC2} + {$EXTERNALSYM EVP_rc2_ecb} + EVP_rc2_ecb: function : PEVP_CIPHER cdecl = nil; + {$EXTERNALSYM EVP_rc2_cbc} + EVP_rc2_cbc: function : PEVP_CIPHER cdecl = nil; + {$EXTERNALSYM EVP_rc2_40_cbc} + EVP_rc2_40_cbc: function : PEVP_CIPHER cdecl = nil; + {$EXTERNALSYM EVP_rc2_64_cbc} + EVP_rc2_64_cbc: function : PEVP_CIPHER cdecl = nil; + {$EXTERNALSYM EVP_rc2_cfb64} + EVP_rc2_cfb64: function : PEVP_CIPHER cdecl = nil; +//# define EVP_rc2_cfb EVP_rc2_cfb64 + {$EXTERNALSYM EVP_rc2_ofb} + EVP_rc2_ofb: function : PEVP_CIPHER cdecl = nil; + {$endif} + {$ifndef OPENSSL_NO_BF} + {$EXTERNALSYM EVP_bf_ecb} + EVP_bf_ecb: function : PEVP_CIPHER cdecl = nil; + {$EXTERNALSYM EVP_bf_cbc} + EVP_bf_cbc: function : PEVP_CIPHER cdecl = nil; + {$EXTERNALSYM EVP_bf_cfb64} + EVP_bf_cfb64: function : PEVP_CIPHER cdecl = nil; +//# define EVP_bf_cfb EVP_bf_cfb64 + {$EXTERNALSYM EVP_bf_ofb} + EVP_bf_ofb: function : PEVP_CIPHER cdecl = nil; + {$endif} + {$ifndef OPENSSL_NO_CAST} + {$EXTERNALSYM EVP_cast5_ecb} + EVP_cast5_ecb : function : PEVP_CIPHER cdecl = nil; + {$EXTERNALSYM EVP_cast5_cbc} + EVP_cast5_cbc : function : PEVP_CIPHER cdecl = nil; + {$EXTERNALSYM EVP_cast5_cfb64} + EVP_cast5_cfb64: function : PEVP_CIPHER cdecl = nil; +//# define EVP_cast5_cfb EVP_cast5_cfb64 + {$EXTERNALSYM EVP_cast5_ofb} + EVP_cast5_ofb: function : PEVP_CIPHER cdecl = nil; + {$endif} + {$ifndef OPENSSL_NO_RC5} + {$EXTERNALSYM EVP_rc5_32_12_16_cb} + EVP_rc5_32_12_16_cbc: function : PEVP_CIPHER cdecl = nil; + {$EXTERNALSYM EVP_rc5_32_12_16_ecb} + EVP_rc5_32_12_16_ecb: function : PEVP_CIPHER cdecl = nil; + {$EXTERNALSYM EVP_rc5_32_12_16_cfb64} + EVP_rc5_32_12_16_cfb64: function : PEVP_CIPHER cdecl = nil; + {$EXTERNALSYM EVP_rc5_32_12_16_ofb\} + EVP_rc5_32_12_16_ofb: function : PEVP_CIPHER cdecl = nil; + {$endif} + {$ifndef OPENSSL_NO_AES} + {$EXTERNALSYM EVP_aes_128_ecb} + EVP_aes_128_ecb: function : PEVP_CIPHER cdecl = nil; + {$EXTERNALSYM EVP_aes_128_cbc} + EVP_aes_128_cbc: function : PEVP_CIPHER cdecl = nil; + {$EXTERNALSYM EVP_aes_128_cfb1} + EVP_aes_128_cfb1: function : PEVP_CIPHER cdecl = nil; + {$EXTERNALSYM EVP_aes_128_cfb8} + EVP_aes_128_cfb8: function : PEVP_CIPHER cdecl = nil; + {$EXTERNALSYM EVP_aes_128_cfb128} + EVP_aes_128_cfb128: function : PEVP_CIPHER cdecl = nil; + {$EXTERNALSYM EVP_aes_128_ofb} + EVP_aes_128_ofb: function : PEVP_CIPHER cdecl = nil; + {$EXTERNALSYM EVP_aes_128_ctr} + EVP_aes_128_ctr: function : PEVP_CIPHER cdecl = nil; + {$EXTERNALSYM EVP_aes_128_gcm} + EVP_aes_128_gcm: function : PEVP_CIPHER cdecl = nil; + {$EXTERNALSYM EVP_aes_128_ccm} + EVP_aes_128_ccm: function : PEVP_CIPHER cdecl = nil; + {$EXTERNALSYM EVP_aes_128_xts} + EVP_aes_128_xts: function : PEVP_CIPHER cdecl = nil; + {$EXTERNALSYM EVP_aes_192_ecb} + EVP_aes_192_ecb: function : PEVP_CIPHER cdecl = nil; + {$EXTERNALSYM EVP_aes_192_cbc} + EVP_aes_192_cbc: function : PEVP_CIPHER cdecl = nil; + {$EXTERNALSYM EVP_aes_192_cfb1} + EVP_aes_192_cfb1: function : PEVP_CIPHER cdecl = nil; + {$EXTERNALSYM EVP_aes_192_cfb8} + EVP_aes_192_cfb8: function : PEVP_CIPHER cdecl = nil; + {$EXTERNALSYM EVP_aes_192_cfb128} + EVP_aes_192_cfb128: function : PEVP_CIPHER cdecl = nil; +//# define EVP_aes_192_cfb EVP_aes_192_cfb128 + {$EXTERNALSYM EVP_aes_192_ofb} + EVP_aes_192_ofb: function : PEVP_CIPHER cdecl = nil; + {$EXTERNALSYM EVP_aes_192_ctr} + EVP_aes_192_ctr: function : PEVP_CIPHER cdecl = nil; + {$EXTERNALSYM EVP_aes_192_gcm} + EVP_aes_192_gcm: function : PEVP_CIPHER cdecl = nil; + {$EXTERNALSYM EVP_aes_192_ccm} + EVP_aes_192_ccm: function : PEVP_CIPHER cdecl = nil; + {$EXTERNALSYM EVP_aes_256_ecb} + EVP_aes_256_ecb: function : PEVP_CIPHER cdecl = nil; + {$EXTERNALSYM EVP_aes_256_cbc} + EVP_aes_256_cbc: function : PEVP_CIPHER cdecl = nil; + {$EXTERNALSYM EVP_aes_256_cfb1} + EVP_aes_256_cfb1: function : PEVP_CIPHER cdecl = nil; + {$EXTERNALSYM EVP_aes_256_cfb8} + EVP_aes_256_cfb8: function : PEVP_CIPHER cdecl = nil; + {$EXTERNALSYM EVP_aes_256_cfb128} + EVP_aes_256_cfb128: function : PEVP_CIPHER cdecl = nil; + {$EXTERNALSYM EVP_aes_256_ofb} + EVP_aes_256_ofb: function : PEVP_CIPHER cdecl = nil; + {$EXTERNALSYM EVP_aes_256_ctr} + EVP_aes_256_ctr: function : PEVP_CIPHER cdecl = nil; + {$EXTERNALSYM EVP_aes_256_gcm} + EVP_aes_256_gcm: function : PEVP_CIPHER cdecl = nil; + {$EXTERNALSYM EVP_aes_256_ccm} + EVP_aes_256_ccm: function : PEVP_CIPHER cdecl = nil; + {$EXTERNALSYM EVP_aes_256_xts} + EVP_aes_256_xts: function : PEVP_CIPHER cdecl = nil; + {$ifndef OPENSSL_NO_SHA} + {$ifndef OPENSSL_NO_SHA1} + {$EXTERNALSYM EVP_aes_128_cbc_hmac_sha1} + EVP_aes_128_cbc_hmac_sha1 : function : PEVP_CIPHER cdecl = nil; + {$EXTERNALSYM EVP_aes_256_cbc_hmac_sha1} + EVP_aes_256_cbc_hmac_sha1 : function : PEVP_CIPHER cdecl = nil; + {$endif} + {$endif} + {$endif} + {$ifndef OPENSSL_NO_CAMELLIA} + {$EXTERNALSYM EVP_camellia_128_ecb} + EVP_camellia_128_ecb : function : PEVP_CIPHER cdecl = nil; + {$EXTERNALSYM EVP_camellia_128_cbc} + EVP_camellia_128_cbc : function : PEVP_CIPHER cdecl = nil; + {$EXTERNALSYM EVP_camellia_128_cfb1} + EVP_camellia_128_cfb1 : function : PEVP_CIPHER cdecl = nil; + {$EXTERNALSYM EVP_camellia_128_cfb8} + EVP_camellia_128_cfb8 : function : PEVP_CIPHER cdecl = nil; + {$EXTERNALSYM EVP_camellia_128_cfb128} + EVP_camellia_128_cfb128 : function : PEVP_CIPHER cdecl = nil; + {$EXTERNALSYM EVP_camellia_128_ofb} + EVP_camellia_128_ofb : function : PEVP_CIPHER cdecl = nil; + {$EXTERNALSYM EVP_camellia_192_ecb} + EVP_camellia_192_ecb : function : PEVP_CIPHER cdecl = nil; + {$EXTERNALSYM EVP_camellia_192_cbc} + EVP_camellia_192_cbc : function : PEVP_CIPHER cdecl = nil; + {$EXTERNALSYM EVP_camellia_192_cfb1} + EVP_camellia_192_cfb1 : function : PEVP_CIPHER cdecl = nil; + {$EXTERNALSYM EVP_camellia_192_cfb8} + EVP_camellia_192_cfb8 : function : PEVP_CIPHER cdecl = nil; + {$EXTERNALSYM EVP_camellia_192_cfb128} + EVP_camellia_192_cfb128 : function : PEVP_CIPHER cdecl = nil; + {$EXTERNALSYM EVP_camellia_192_ofb} + EVP_camellia_192_ofb : function : PEVP_CIPHER cdecl = nil; + {$EXTERNALSYM EVP_camellia_256_ecb} + EVP_camellia_256_ecb : function : PEVP_CIPHER cdecl = nil; + {$EXTERNALSYM EVP_camellia_256_cbc} + EVP_camellia_256_cbc : function : PEVP_CIPHER cdecl = nil; + {$EXTERNALSYM EVP_camellia_256_cfb1} + EVP_camellia_256_cfb1 : function : PEVP_CIPHER cdecl = nil; + {$EXTERNALSYM EVP_camellia_256_cfb8} + EVP_camellia_256_cfb8 : function : PEVP_CIPHER cdecl = nil; + {$EXTERNALSYM EVP_camellia_256_cfb128} + EVP_camellia_256_cfb128 : function : PEVP_CIPHER cdecl = nil; + {$EXTERNALSYM EVP_camellia_256_ofb} + EVP_camellia_256_ofb : function : PEVP_CIPHER cdecl = nil; + {$endif} + + {$ifndef OPENSSL_NO_SEED} + {$EXTERNALSYM EVP_seed_ecb} + EVP_seed_ecb : function : PEVP_CIPHER cdecl = nil; + {$EXTERNALSYM EVP_seed_cbc} + EVP_seed_cbc : function : PEVP_CIPHER cdecl = nil; + {$EXTERNALSYM EVP_seed_cfb128} + EVP_seed_cfb128 : function : PEVP_CIPHER cdecl = nil; + {$EXTERNALSYM EVP_seed_ofb} + EVP_seed_ofb : function : PEVP_CIPHER cdecl = nil; + {$endif} + {$EXTERNALSYM EVP_add_cipher} + EVP_add_cipher : function (cipher : PEVP_CIPHER) : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_add_digest} + EVP_add_digest : function(digest : PEVP_MD) : TIdC_INT cdecl = nil; + + {$EXTERNALSYM EVP_CIPHER_do_all} + EVP_CIPHER_do_all : procedure(fn : EVP_CIPHER_do_all_fn; arg : Pointer) cdecl = nil; + {$EXTERNALSYM EVP_CIPHER_do_all_sorted} + EVP_CIPHER_do_all_sorted : procedure(fn : EVP_CIPHER_do_all_fn; arg : Pointer) cdecl = nil; + {$EXTERNALSYM EVP_MD_do_all} + EVP_MD_do_all : procedure(fn : EVP_MD_do_all_fn; arg : Pointer) cdecl = nil; + {$EXTERNALSYM EVP_MD_do_all_sorted} + EVP_MD_do_all_sorted : procedure(fn : EVP_MD_do_all_fn; arg : Pointer) cdecl = nil; + + {$EXTERNALSYM EVP_PKEY_decrypt_old} + EVP_PKEY_decrypt_old : function(dec_key : PIdAnsiChar; + enc_key : PIdAnsiChar; enc_key_len : TIdC_INT; + private_key : PEVP_PKEY) : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_PKEY_encrypt_old} + EVP_PKEY_encrypt_old : function(enc_key : PIdAnsiChar; + key : PIdAnsiChar; key_len : TIdC_INT; + pub_key : PEVP_PKEY) : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_PKEY_type} + EVP_PKEY_type : function(_type : TIdC_INT) : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_PKEY_id} + EVP_PKEY_id : function(pkey : PEVP_PKEY) : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_PKEY_base_id} + EVP_PKEY_base_id : function(pkey : PEVP_PKEY) : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_PKEY_bits} + EVP_PKEY_bits : function(pkey : PEVP_PKEY) : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_PKEY_size} + EVP_PKEY_size : function(pkey : PEVP_PKEY) : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_PKEY_set_type} + EVP_PKEY_set_type : function(pkey : PEVP_PKEY;_type : TIdC_INT) : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_PKEY_set_type_str} + EVP_PKEY_set_type_str : function(pkey: PEVP_PKEY; str : PIdAnsiChar; len : TIdC_INT) : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_PKEY_get0} + EVP_PKEY_get0 : function(pkey : PEVP_PKEY) : Pointer cdecl = nil; + + {$ifndef OPENSSL_NO_RSA} +//struct rsa_st; + {$EXTERNALSYM EVP_PKEY_set1_RSA} + EVP_PKEY_set1_RSA: function(pkey : PEVP_PKEY;key : Prsa_st) : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_PKEY_get1_RSA} + EVP_PKEY_get1_RSA: function(pkey: PEVP_PKEY) : Prsa_st cdecl = nil; + {$endif} + {$ifndef OPENSSL_NO_DSA} +// struct dsa_st; + {$EXTERNALSYM EVP_PKEY_set1_DSA} + EVP_PKEY_set1_DSA: function(pkey : PEVP_PKEY; key : Pdsa_st) : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_PKEY_get1_DSA} + EVP_PKEY_get1_DSA: function(pkey : PEVP_PKEY) : Pdsa_st cdecl = nil; + {$endif} + {$ifndef OPENSSL_NO_DH} +// struct dh_st; + {$EXTERNALSYM EVP_PKEY_set1_DH} + EVP_PKEY_set1_DH: function(pkey : PEVP_PKEY; key : Pdh_st) : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_PKEY_get1_DH} + EVP_PKEY_get1_DH: function(pkey : PEVP_PKEY) : Pdh_st cdecl = nil; + {$endif} + {$ifndef OPENSSL_NO_EC} +// struct ec_key_st; + {$EXTERNALSYM EVP_PKEY_set1_EC_KEY} + EVP_PKEY_set1_EC_KEY : function(pkey : PEVP_PKEY; key : Pec_key_st) : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_PKEY_get1_EC_KEY} + EVP_PKEY_get1_EC_KEY : function(pkey : PEVP_PKEY) : Pec_key_st cdecl = nil; + {$endif} + + {$EXTERNALSYM d2i_PublicKey} + d2i_PublicKey : function(_type : TIdC_INT; a :PPEVP_PKEY; pp : PPIdAnsiChar; + length : TIdC_LONG) : PEVP_PKEY cdecl = nil; + {$EXTERNALSYM i2d_PublicKey} + i2d_PublicKey : function(a : PEVP_PKEY; pp : PPIdAnsiChar) : TIdC_INT cdecl = nil; + {$EXTERNALSYM d2i_AutoPrivateKey} + d2i_AutoPrivateKey : function(a : PPEVP_PKEY; pp : PPIdAnsiChar; + length : TIdC_LONG) : PEVP_PKEY cdecl = nil; + {$EXTERNALSYM EVP_PKEY_copy_parameters} + EVP_PKEY_copy_parameters : function(_to : PEVP_PKEY; from : PEVP_PKEY) : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_PKEY_missing_parameters} + EVP_PKEY_missing_parameters : function(pkey : PEVP_PKEY) : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_PKEY_save_parameters} + EVP_PKEY_save_parameters : function(pkey : PEVP_PKEY;mode : TIdC_INT) : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_PKEY_cmp_parameters} + EVP_PKEY_cmp_parameters : function(a : PEVP_PKEY; b : PEVP_PKEY) : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_PKEY_cmp} + EVP_PKEY_cmp : function(a : PEVP_PKEY; b : PEVP_PKEY) : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_PKEY_print_public} + EVP_PKEY_print_public : function(_out : PBIO; pkey : PEVP_PKEY; + indent : TIdC_INT; pctx : PASN1_PCTX) : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_PKEY_print_private} + EVP_PKEY_print_private : function(_out : PBIO; pkey : PEVP_PKEY; + indent : TIdC_INT; pctx : PASN1_PCTX) : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_PKEY_print_params} + EVP_PKEY_print_params : function(_out : PBIO; pkey : PEVP_PKEY; + indent : TIdC_INT; pctx : PASN1_PCTX) : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_PKEY_get_default_digest_nid} + EVP_PKEY_get_default_digest_nid : function(pkey : PEVP_PKEY; pnid : PIdC_INT) : TIdC_INT cdecl = nil; + +//* calls methods */ + {$EXTERNALSYM EVP_CIPHER_param_to_asn1} + EVP_CIPHER_param_to_asn1 : function(c : PEVP_CIPHER_CTX; _type : PASN1_TYPE) : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_CIPHER_asn1_to_param} + EVP_CIPHER_asn1_to_param : function(c : PEVP_CIPHER_CTX; _type : PASN1_TYPE) : TIdC_INT cdecl = nil; + +//* These are used by EVP_CIPHER methods */ + {$EXTERNALSYM EVP_CIPHER_set_asn1_iv} + EVP_CIPHER_set_asn1_iv : function(c : PEVP_CIPHER_CTX; _type : PASN1_TYPE) : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_CIPHER_get_asn1_iv} + EVP_CIPHER_get_asn1_iv : function(c : PEVP_CIPHER_CTX; _type : PASN1_TYPE) : TIdC_INT cdecl = nil; + +//* PKCS5 password based encryption */ + {$EXTERNALSYM PKCS5_PBE_keyivgen} + PKCS5_PBE_keyivgen : function(ctx : PEVP_CIPHER_CTX; pass : PIdAnsiChar; passlen : TIdC_INT; + param : PASN1_TYPE; cipher : PEVP_CIPHER; md : PEVP_MD; + en_de : TIdC_INT) : TIdC_INT cdecl = nil; + {$EXTERNALSYM PKCS5_PBKDF2_HMAC_SHA1} + PKCS5_PBKDF2_HMAC_SHA1 : function(pass : PIdAnsiChar; passlen : TIdC_INT; + salt : PIdAnsiChar; saltlen : TIdC_INT; iter : TIdC_INT; + keylen : TIdC_INT; _out : PIdAnsiChar) : TIdC_INT cdecl = nil; + {$EXTERNALSYM PKCS5_PBKDF2_HMAC} + PKCS5_PBKDF2_HMAC : function(pass : PIdAnsiChar; passlen : TIdC_INT; + salt : PIdAnsiChar; saltlen : TIdC_INT; iter : TIdC_INT; + digest : PEVP_MD; + keylen : TIdC_INT; _out : PIdAnsiChar) : TIdC_INT cdecl = nil; + {$EXTERNALSYM PKCS5_v2_PBE_keyivgen} + PKCS5_v2_PBE_keyivgen : function(ctx : PEVP_CIPHER_CTX; pass : PIdAnsiChar; passlen : TIdC_INT; + param : PASN1_TYPE; cipher : PEVP_CIPHER; md : PEVP_MD; + en_de : TIdC_INT) : TIdC_INT cdecl = nil; + {$EXTERNALSYM PKCS5_PBE_add} + PKCS5_PBE_add : procedure cdecl = nil; + {$EXTERNALSYM EVP_PBE_CipherInit} + EVP_PBE_CipherInit : function (pbe_obj : PASN1_OBJECT; pass : PIdAnsiChar; passlen : TIdC_INT; + param : PASN1_TYPE; ctx : PEVP_CIPHER_CTX; en_de : TIdC_INT) : TIdC_INT cdecl = nil; + + {$EXTERNALSYM EVP_PBE_alg_add_type} + + EVP_PBE_alg_add_type : function(pbe_type : TIdC_INT; pbe_nid : TIdC_INT; cipher_nid : TIdC_INT; md_nid : TIdC_INT; + keygen : PEVP_PBE_KEYGEN) : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_PBE_alg_add} + EVP_PBE_alg_add : function(nid : TIdC_INT; cipher : PEVP_CIPHER; md : PEVP_MD; + keygen :PEVP_PBE_KEYGEN) : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_PBE_find} + EVP_PBE_find : function(_type : TIdC_INT; pbe_nid : TIdC_INT; + pcnid : PIdC_INT; pmnid : PIdC_INT; var pkeygen : PEVP_PBE_KEYGEN) : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_PBE_cleanup} + EVP_PBE_cleanup : procedure cdecl = nil; + + {$EXTERNALSYM EVP_PKEY_asn1_get_count} + EVP_PKEY_asn1_get_count : function : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_PKEY_asn1_get0} + EVP_PKEY_asn1_get0 : function(idx : TIdC_INT) : PEVP_PKEY_ASN1_METHOD cdecl = nil; + {$EXTERNALSYM EVP_PKEY_asn1_find} + EVP_PKEY_asn1_find : function(pe :PPENGINE; _type : TIdC_INT) : PEVP_PKEY_ASN1_METHOD cdecl = nil; + {$EXTERNALSYM EVP_PKEY_asn1_find_str} + EVP_PKEY_asn1_find_str : function(pe : PPENGINE; + str : PIdAnsiChar; len : TIdC_INT) : PEVP_PKEY_ASN1_METHOD cdecl = nil; + {$EXTERNALSYM EVP_PKEY_asn1_add0} + EVP_PKEY_asn1_add0 : function(ameth : PEVP_PKEY_ASN1_METHOD) : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_PKEY_asn1_add_alias} + EVP_PKEY_asn1_add_alias : function(_to : TIdC_INT; from : TIdC_INT) : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_PKEY_asn1_get0_info} + EVP_PKEY_asn1_get0_info : function(ppkey_id : PIdC_int; pkey_base_id : PIdC_INT; ppkey_flags : PIdC_INT; + pinfo : PPIdAnsiChar; ppem_str : PPIdAnsiChar; + ameth : PEVP_PKEY_ASN1_METHOD) : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_PKEY_get0_asn1} + EVP_PKEY_get0_asn1 : function(pkey : PEVP_PKEY) : PEVP_PKEY_ASN1_METHOD cdecl = nil; + {$EXTERNALSYM EVP_PKEY_asn1_new} + EVP_PKEY_asn1_new : function(id : TIdC_INT; flags : TIdC_INT; + pem_str : PIdAnsiChar; info : PIdAnsiChar) : PEVP_PKEY_ASN1_METHOD cdecl = nil; + {$EXTERNALSYM EVP_PKEY_asn1_copy} + EVP_PKEY_asn1_copy : procedure(dst : PEVP_PKEY_ASN1_METHOD; + src : PEVP_PKEY_ASN1_METHOD) cdecl = nil; + {$EXTERNALSYM EVP_PKEY_asn1_free} + EVP_PKEY_asn1_free : procedure(ameth : PEVP_PKEY_ASN1_METHOD) cdecl = nil; + + {$EXTERNALSYM EVP_PKEY_asn1_set_public} + EVP_PKEY_asn1_set_public : procedure(ameth : PEVP_PKEY_ASN1_METHOD; + pub_decode : EVP_PKEY_asn1_set_public_pub_decode; + pub_encode : EVP_PKEY_asn1_set_public_pub_encode; + pub_cmp : EVP_PKEY_asn1_set_public_pub_cmp; + pub_print : EVP_PKEY_asn1_set_public_pub_print; + pkey_size : EVP_PKEY_asn1_set_public_pub_pkey_size; + pkey_bits : EVP_PKEY_asn1_set_public_pkey_bits) cdecl = nil; + {$EXTERNALSYM EVP_PKEY_asn1_set_private} + EVP_PKEY_asn1_set_private : procedure(ameth : PEVP_PKEY_ASN1_METHOD; + priv_decode : EVP_PKEY_asn1_set_private_priv_decode; + priv_encode : EVP_PKEY_asn1_set_private_priv_encode; + priv_print : EVP_PKEY_asn1_set_private_priv_print) cdecl = nil; + {$EXTERNALSYM EVP_PKEY_asn1_set_param} + EVP_PKEY_asn1_set_param : procedure(ameth : PEVP_PKEY_ASN1_METHOD; + param_decode : EVP_PKEY_asn1_set_param_param_decode; + param_encode : EVP_PKEY_asn1_set_param_param_encode; + param_missing : EVP_PKEY_asn1_set_param_param_missing; + param_copy : EVP_PKEY_asn1_set_param_param_copy; + param_cmp : EVP_PKEY_asn1_set_param_param_cmp; + param_print : EVP_PKEY_asn1_set_param_param_print) cdecl = nil; + {$EXTERNALSYM EVP_PKEY_asn1_set_free} + EVP_PKEY_asn1_set_free : procedure(ameth : PEVP_PKEY_ASN1_METHOD; + pkey_free : EVP_PKEY_asn1_set_free_pkey_free) cdecl = nil; + {$EXTERNALSYM EVP_PKEY_asn1_set_ctrl} + EVP_PKEY_asn1_set_ctrl : procedure(ameth : PEVP_PKEY_ASN1_METHOD; + pkey_ctrl : EVP_PKEY_asn1_set_ctr_pkey_ctrl) cdecl = nil; + + {$EXTERNALSYM EVP_PKEY_meth_find} + EVP_PKEY_meth_find : function (_type : TIdC_INT) : PEVP_PKEY_METHOD cdecl = nil; + {$EXTERNALSYM EVP_PKEY_meth_new} + EVP_PKEY_meth_new : function(id : TIdC_INT; flags : TIdC_INT) : PEVP_PKEY_METHOD cdecl = nil; + {$EXTERNALSYM EVP_PKEY_meth_get0_info} + EVP_PKEY_meth_get0_info : procedure(ppkey_id : PIdC_INT; pflags : PIdC_INT; + meth : PEVP_PKEY_METHOD) cdecl = nil; + {$EXTERNALSYM EVP_PKEY_meth_copy} + EVP_PKEY_meth_copy : procedure(dst : PEVP_PKEY_METHOD; src : PEVP_PKEY_METHOD) cdecl = nil; + {$EXTERNALSYM EVP_PKEY_meth_free} + EVP_PKEY_meth_free : procedure(pmeth : PEVP_PKEY_METHOD) cdecl =nil; + {$EXTERNALSYM EVP_PKEY_meth_add0} + EVP_PKEY_meth_add0 : function(pmeth : PEVP_PKEY_METHOD) : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_PKEY_CTX_new} + EVP_PKEY_CTX_new : function(pkey : PEVP_PKEY; e : PENGINE) : PEVP_PKEY_CTX cdecl = nil; + {$EXTERNALSYM EVP_PKEY_CTX_new_id} + EVP_PKEY_CTX_new_id : function(id : TIdC_INT; e : PENGINE) : PEVP_PKEY_CTX cdecl = nil; + {$EXTERNALSYM EVP_PKEY_CTX_dup} + EVP_PKEY_CTX_dup : function(ctx : PEVP_PKEY_CTX) : PEVP_PKEY_CTX cdecl = nil; + {$EXTERNALSYM EVP_PKEY_CTX_free} + EVP_PKEY_CTX_free : procedure(ctx : PEVP_PKEY_CTX) cdecl = nil; + {$EXTERNALSYM EVP_PKEY_CTX_ctrl} + EVP_PKEY_CTX_ctrl : function(ctx : PEVP_PKEY_CTX; keytype : TIdC_INT; optype : TIdC_INT; + cmd : TIdC_INT; p1 : TIdC_INT; p2 : Pointer) : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_PKEY_CTX_ctrl_str} + EVP_PKEY_CTX_ctrl_str : function(ctx : PEVP_PKEY_CTX; _type : PIdAnsiChar; + value : PIdAnsiChar) : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_PKEY_CTX_get_operation} + EVP_PKEY_CTX_get_operation : function(ctx : PEVP_PKEY_CTX) : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_PKEY_CTX_set0_keygen_info} + EVP_PKEY_CTX_set0_keygen_info : procedure(ctx : PEVP_PKEY_CTX; dat : PIdC_INT; datlen : TIdC_INT) cdecl = nil; + {$EXTERNALSYM EVP_PKEY_new_mac_key} + EVP_PKEY_new_mac_key : function(_type : TIdC_INT; e : PENGINE; + key : PIdAnsiChar; keylen : TIdC_INT) : PEVP_PKEY cdecl = nil; + {$EXTERNALSYM EVP_PKEY_CTX_set_data} + EVP_PKEY_CTX_set_data : procedure(ctx : PEVP_PKEY_CTX; data : Pointer) cdecl = nil; + {$EXTERNALSYM EVP_PKEY_CTX_get_data} + EVP_PKEY_CTX_get_data : function(ctx : PEVP_PKEY_CTX) : Pointer cdecl = nil; + {$EXTERNALSYM EVP_PKEY_CTX_get0_pkey} + EVP_PKEY_CTX_get0_pkey : function(ctx : PEVP_PKEY_CTX) : PEVP_PKEY cdecl = nil; + {$EXTERNALSYM EVP_PKEY_CTX_get0_peerkey} + EVP_PKEY_CTX_get0_peerkey : function(ctx : PEVP_PKEY_CTX) : PEVP_PKEY cdecl = nil; + {$EXTERNALSYM EVP_PKEY_CTX_set_app_data} + EVP_PKEY_CTX_set_app_data : procedure(ctx : PEVP_PKEY_CTX; data : Pointer) cdecl = nil; + {$EXTERNALSYM EVP_PKEY_CTX_get_app_data} + EVP_PKEY_CTX_get_app_data : function(ctx : PEVP_PKEY_CTX) : Pointer cdecl = nil; + {$EXTERNALSYM EVP_PKEY_sign_init} + EVP_PKEY_sign_init : function(ctx : PEVP_PKEY_CTX) : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_PKEY_sign} + EVP_PKEY_sign : function(ctx : PEVP_PKEY_CTX; + sig : PIdAnsiChar; siglen : Psize_t; + tbs : PIdAnsiChar; tbslen : size_t) : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_PKEY_verify_init} + EVP_PKEY_verify_init : function(ctx : PEVP_PKEY_CTX) : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_PKEY_verify} + EVP_PKEY_verify : function(ctx : PEVP_PKEY_CTX; + sig : PIdAnsiChar; siglen : size_t; + tbs : PIdAnsiChar; tbslen : size_t) : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_PKEY_verify_recover_init} + EVP_PKEY_verify_recover_init : function(ctx : PEVP_PKEY_CTX) : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_PKEY_verify_recover} + EVP_PKEY_verify_recover : function(ctx : PEVP_PKEY_CTX; + rout : PIdAnsiChar; routlen : Psize_t; + sig : PIdAnsiChar; siglen : size_t) : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_PKEY_encrypt_init} + EVP_PKEY_encrypt_init : function(ctx : PEVP_PKEY_CTX) : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_PKEY_encrypt} + EVP_PKEY_encrypt : function(ctx : PEVP_PKEY_CTX; + _out : PIdAnsiChar; outlen : Psize_t; + _in : PIdAnsiChar; inlen : size_t) : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_PKEY_decrypt_init} + EVP_PKEY_decrypt_init : function(ctx : PEVP_PKEY_CTX) : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_PKEY_decrypt} + EVP_PKEY_decrypt : function(ctx : PEVP_PKEY_CTX; + _out : PIdAnsiChar; outlen : Psize_t; + _in : PIdAnsiChar; inlen : size_t) : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_PKEY_derive_init} + EVP_PKEY_derive_init : function(ctx : PEVP_PKEY_CTX) : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_PKEY_derive_set_peer} + EVP_PKEY_derive_set_peer : function(ctx : PEVP_PKEY_CTX; peer : PEVP_PKEY) : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_PKEY_derive} + EVP_PKEY_derive : function(ctx : PEVP_PKEY_CTX; key : PIdAnsiChar; keylen : Psize_t) : TIdC_INT cdecl = nil; + + + {$EXTERNALSYM EVP_PKEY_paramgen_init} + EVP_PKEY_paramgen_init: function(ctx : PEVP_PKEY_CTX) : TIdC_INT cdecl; + {$EXTERNALSYM EVP_PKEY_paramgen} + EVP_PKEY_paramgen : function(ctx : PEVP_PKEY_CTX; ppkey : PPEVP_PKEY) : TIdC_INT; + {$EXTERNALSYM EVP_PKEY_keygen_init} + EVP_PKEY_keygen_init : function(ctx : PEVP_PKEY_CTX) : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_PKEY_keygen} + EVP_PKEY_keygen : function(ctx : PEVP_PKEY_CTX; ppkey : PPEVP_PKEY) : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_PKEY_CTX_set_cb} + EVP_PKEY_CTX_set_cb : procedure(ctx : PEVP_PKEY_CTX; cb : EVP_PKEY_gen_cb) cdecl = nil; + {$EXTERNALSYM EVP_PKEY_CTX_get_cb} + EVP_PKEY_CTX_get_cb : function(ctx : PEVP_PKEY_CTX) : EVP_PKEY_gen_cb cdecl = nil; + {$EXTERNALSYM EVP_PKEY_CTX_get_keygen_info} + EVP_PKEY_CTX_get_keygen_info : function(ctx : PEVP_PKEY_CTX; idx : TIdC_INT) : TIdC_INT cdecl = nil; + {$EXTERNALSYM EVP_PKEY_meth_set_init} + EVP_PKEY_meth_set_init : procedure(pmeth : PEVP_PKEY_METHOD; + init : EVP_PKEY_meth_set_init_init) cdecl = nil; + {$EXTERNALSYM EVP_PKEY_meth_set_copy} + EVP_PKEY_meth_set_copy : procedure (pmeth : PEVP_PKEY_METHOD; + copy : EVP_PKEY_meth_set_copy_copy) cdecl = nil; + {$EXTERNALSYM EVP_PKEY_meth_set_cleanup} + EVP_PKEY_meth_set_cleanup : procedure(pmeth : PEVP_PKEY_METHOD; + cleanup : EVP_PKEY_meth_set_cleanup_cleanup) cdecl = nil; + {$EXTERNALSYM EVP_PKEY_meth_set_paramgen} + EVP_PKEY_meth_set_paramgen : procedure(pmeth : PEVP_PKEY_METHOD; + paramgen_init : EVP_PKEY_meth_set_paramgen_paramgen_init; + paramgen : EVP_PKEY_meth_set_paramgen_paramgen); + {$EXTERNALSYM EVP_PKEY_meth_set_keygen} + EVP_PKEY_meth_set_keygen : procedure(pmeth : PEVP_PKEY_METHOD; + keygen_init : EVP_PKEY_meth_set_keygen_keygen_init; + keygen : EVP_PKEY_meth_set_keygen_keygen) cdecl = nil; + {$EXTERNALSYM EVP_PKEY_meth_set_sign} + EVP_PKEY_meth_set_sign : procedure(pmeth : PEVP_PKEY_METHOD; + sign_init : EVP_PKEY_meth_set_sign_sign_init; + sign : EVP_PKEY_meth_set_sign_sign) cdecl = nil; + {$EXTERNALSYM EVP_PKEY_meth_set_verify} + EVP_PKEY_meth_set_verify : procedure(pmeth : PEVP_PKEY_METHOD; + verify_init : EVP_PKEY_meth_set_verify_verify_init; + verify : EVP_PKEY_meth_set_verify_verify) cdecl = nil; + {$EXTERNALSYM EVP_PKEY_meth_set_verify_recover} + EVP_PKEY_meth_set_verify_recover : procedure(pmeth : PEVP_PKEY_METHOD; + verify_recover_init : EVP_PKEY_meth_set_verify_recover_verify_recover_init; + verify_recover : EVP_PKEY_meth_set_verify_recover_verify_recover) cdecl = nil; + {$EXTERNALSYM EVP_PKEY_meth_set_signctx} + EVP_PKEY_meth_set_signctx : procedure(pmeth : PEVP_PKEY_METHOD; + signctx_init : EVP_PKEY_meth_set_signctx_signctx_init; + signctx : EVP_PKEY_meth_set_signctx_signctx) cdecl = nil; + {$EXTERNALSYM EVP_PKEY_meth_set_verifyctx} + EVP_PKEY_meth_set_verifyctx : procedure(pmeth : PEVP_PKEY_METHOD; + verifyctx_init : EVP_PKEY_meth_set_verifyctx_verifyctx_init; + verifyctx : EVP_PKEY_meth_set_verifyctx_verifyctx) cdecl = nil; + {$EXTERNALSYM EVP_PKEY_meth_set_encrypt} + EVP_PKEY_meth_set_encrypt : procedure(pmeth : PEVP_PKEY_METHOD; + encrypt_init : EVP_PKEY_meth_set_encrypt_encrypt_init; + encryptfn : EVP_PKEY_meth_set_encrypt_encryptfn) cdecl = nil; + {$EXTERNALSYM EVP_PKEY_meth_set_decrypt} + EVP_PKEY_meth_set_decrypt : procedure(pmeth : PEVP_PKEY_METHOD; + decrypt_init : EVP_PKEY_meth_set_decrypt_decrypt_init; + decrypt : EVP_PKEY_meth_set_decrypt_decrypt); + {$EXTERNALSYM EVP_PKEY_meth_set_derive} + EVP_PKEY_meth_set_derive : procedure(pmeth : PEVP_PKEY_METHOD; + derive_init : EVP_PKEY_meth_set_derive_derive_init; + derive : EVP_PKEY_meth_set_derive_derive) cdecl = nil; + {$EXTERNALSYM EVP_PKEY_meth_set_ctrl} + EVP_PKEY_meth_set_ctrl : procedure(pmeth : PEVP_PKEY_METHOD; + ctrl : EVP_PKEY_meth_set_ctrl_ctrl; + ctrl_str : EVP_PKEY_meth_set_ctrlctrl_str) cdecl = nil; + + {$EXTERNALSYM d2i_PrivateKey_bio} + d2i_PrivateKey_bio : function(bp : PBIO; a : PPEVP_PKEY) : PEVP_PKEY cdecl = nil; + {$EXTERNALSYM X509_LOOKUP_ctrl} + X509_LOOKUP_ctrl : function(ctx : PX509_LOOKUP; cmd : TIdC_INT; argc : PIdAnsiChar; arg1 : TIdC_LONG; ret : PPIdAnsiChar) : TIdC_INT cdecl = nil; + {$EXTERNALSYM X509_STORE_add_cert} + X509_STORE_add_cert : function (ctx : PX509_STORE; x : PX509) : TIdC_INT cdecl = nil; + {$EXTERNALSYM X509_STORE_add_crl} + X509_STORE_add_crl : function (ctx : PX509_STORE; x : PX509_CRL) : TIdC_INT cdecl = nil; + {$EXTERNALSYM X509_STORE_CTX_get_ex_data} + X509_STORE_CTX_get_ex_data : function(ctx: PX509_STORE_CTX; idx: TIdC_INT): Pointer cdecl = nil; + {$EXTERNALSYM X509_STORE_CTX_get_error} + X509_STORE_CTX_get_error : function(ctx: PX509_STORE_CTX): TIdC_INT cdecl = nil; + {$EXTERNALSYM X509_STORE_CTX_set_error} + X509_STORE_CTX_set_error : procedure(ctx: PX509_STORE_CTX; s: TIdC_INT) cdecl = nil; + {$EXTERNALSYM X509_STORE_CTX_get_error_depth} + X509_STORE_CTX_get_error_depth : function(ctx: PX509_STORE_CTX): TIdC_INT cdecl = nil; + {$EXTERNALSYM X509_STORE_CTX_get_current_cert} + X509_STORE_CTX_get_current_cert : function(ctx: PX509_STORE_CTX): PX509 cdecl = nil; + {$EXTERNALSYM _CRYPTO_num_locks} + _CRYPTO_num_locks : function: TIdC_INT cdecl = nil; // return CRYPTO_NUM_LOCKS (shared libs!) + {$EXTERNALSYM CRYPTO_set_locking_callback} + CRYPTO_set_locking_callback : procedure(func: TIdSslLockingCallback) cdecl = nil; + {$EXTERNALSYM CRYPTO_set_id_callback} + CRYPTO_set_id_callback : procedure(func: TIdSslIdCallback) cdecl = nil; + // 3DES functions + {$EXTERNALSYM DES_set_odd_parity} + DES_set_odd_parity: procedure(key: Pdes_cblock) cdecl = nil; + {$EXTERNALSYM DES_set_key} + DES_set_key: function(key: Pconst_DES_cblock; schedule: DES_key_schedule): TIdC_INT cdecl = nil; + {$EXTERNALSYM DES_ecb_encrypt} + DES_ecb_encrypt: procedure(input, output: Pconst_DES_cblock; ks: DES_key_schedule; enc: TIdC_INT) cdecl = nil; + //old DES functions + {$EXTERNALSYM Id_ossl_old_des_set_odd_parity} + Id_ossl_old_des_set_odd_parity : procedure (key : p_ossl_old_des_cblock) cdecl = nil; + {$EXTERNALSYM Id_ossl_old_des_set_key} + Id_ossl_old_des_set_key : function (key : P_ossl_old_des_cblock; schedule : _ossl_old_des_key_schedule) : TIdC_INT cdecl = nil; + {$EXTERNALSYM Id_ossl_old_des_ecb_encrypt} + Id_ossl_old_des_ecb_encrypt : procedure ( input : p_ossl_old_des_cblock; output : p_ossl_old_des_cblock; ks : p_ossl_old_des_key_schedule; enc : TIdC_int) cdecl = nil; + //More SSL functions + {$EXTERNALSYM SSL_set_ex_data} + SSL_set_ex_data: function(ssl: PSSL; idx: TIdC_INT; data: Pointer): TIdC_INT cdecl = nil; + {$EXTERNALSYM SSL_get_ex_data} + SSL_get_ex_data: function(ssl: PSSL; idx: TIdC_INT): Pointer cdecl = nil; + {$EXTERNALSYM PKCS12_create} + PKCS12_create: function(pass, name: PIdAnsiChar; pkey: PEVP_PKEY; cert : PX509; + ca: PSTACK_OF_X509; nid_key, nid_cert, iter, mac_iter, keytype : TIdC_INT) : PPKCS12 cdecl = nil; + {$EXTERNALSYM i2d_PKCS12_bio} + i2d_PKCS12_bio: function(b: PBIO; p12: PPKCS12) : TIdC_INT cdecl = nil; + {$EXTERNALSYM PKCS12_free} + PKCS12_free: procedure(p12: PPKCS12) cdecl = nil; + {$EXTERNALSYM SSL_load_client_CA_file} + SSL_load_client_CA_file: function(const _file: PIdAnsiChar): PSTACK_OF_X509_NAME cdecl = nil; + {$EXTERNALSYM SSL_CTX_set_client_CA_list} + SSL_CTX_set_client_CA_list: procedure(ctx: PSSL_CTX; list: PSTACK_OF_X509_NAME) cdecl = nil; + {$EXTERNALSYM SSL_CTX_set_default_verify_paths} + SSL_CTX_set_default_verify_paths: function(ctx: PSSL_CTX): TIdC_INT cdecl = nil; + {$EXTERNALSYM SSL_CTX_set_session_id_context} + SSL_CTX_set_session_id_context: function(ctx: PSSL_CTX; const sid_ctx: PByte; sid_ctx_len: TIdC_UINT): TIdC_INT cdecl = nil; + {$EXTERNALSYM SSL_CIPHER_description} + SSL_CIPHER_description: function(_para1: PSSL_CIPHER; buf: PIdAnsiChar; size: TIdC_INT): PIdAnsiChar cdecl = nil; + {$EXTERNALSYM SSL_get_current_cipher} + SSL_get_current_cipher: function(const s: PSSL): PSSL_CIPHER cdecl = nil; + {$EXTERNALSYM SSL_CIPHER_get_name} + SSL_CIPHER_get_name: function(const c: PSSL_CIPHER): PIdAnsiChar cdecl = nil; + {$EXTERNALSYM SSL_CIPHER_get_version} + SSL_CIPHER_get_version: function(const c: PSSL_CIPHER): PIdAnsiChar cdecl = nil; + {$EXTERNALSYM SSL_CIPHER_get_bits} + SSL_CIPHER_get_bits: function(const c: PSSL_CIPHER; var alg_bits: TIdC_INT): TIdC_INT cdecl = nil; + //experimental + {$EXTERNALSYM ERR_error_string_n} + ERR_error_string_n: procedure(e: TIdC_ULONG; buf: PIdAnsiChar; len : size_t) cdecl = nil; + {$EXTERNALSYM ERR_put_error} + ERR_put_error : procedure (lib, func, reason : TIdC_INT; _file : PIdAnsiChar; line : TIdC_INT) cdecl = nil; + {$EXTERNALSYM ERR_get_error} + ERR_get_error : function: TIdC_ULONG cdecl = nil; + {$EXTERNALSYM ERR_peek_error} + ERR_peek_error : function: TIdC_ULONG cdecl = nil; + {$EXTERNALSYM ERR_peek_last_error} + ERR_peek_last_error : function : TIdC_ULONG cdecl = nil; + {$EXTERNALSYM ERR_clear_error} + ERR_clear_error : procedure cdecl = nil; + {$EXTERNALSYM ERR_error_string} + ERR_error_string : function (e: TIdC_ULONG; buf: PIdAnsiChar): PIdAnsiChar cdecl = nil; + {$EXTERNALSYM ERR_lib_error_string} + ERR_lib_error_string : function(e : TIdC_ULONG): PIdAnsiChar cdecl = nil; + {$EXTERNALSYM ERR_func_error_string} + ERR_func_error_string : function(e : TIdC_ULONG): PIdAnsiChar cdecl = nil; + {$EXTERNALSYM ERR_reason_error_string} + ERR_reason_error_string : function(e : TIdC_ULONG): PIdAnsiChar cdecl = nil; + {$EXTERNALSYM ERR_load_ERR_strings} + ERR_load_ERR_strings : procedure cdecl = nil; + {$EXTERNALSYM ERR_load_crypto_strings} + ERR_load_crypto_strings : procedure cdecl = nil; + {$EXTERNALSYM ERR_free_strings} + ERR_free_strings : procedure cdecl = nil; + {$EXTERNALSYM ERR_remove_thread_state} + ERR_remove_thread_state : procedure(const tId : PCRYPTO_THREADID) cdecl = nil; + + {$EXTERNALSYM ERR_remove_state} + ERR_remove_state : procedure(pid: TIdC_ULONG) cdecl = nil; + {$EXTERNALSYM CRYPTO_cleanup_all_ex_data} + CRYPTO_cleanup_all_ex_data : procedure cdecl = nil; + {$EXTERNALSYM SSL_COMP_get_compression_methods} + SSL_COMP_get_compression_methods : function: PSTACK_OF_SSL_COMP cdecl = nil; + {$EXTERNALSYM SSL_COMP_free_compression_methods} + SSL_COMP_free_compression_methods : procedure; cdecl = nil; + {$EXTERNALSYM sk_pop_free} + sk_pop_free : procedure(st: PSTACK; func: Tsk_pop_free_func) cdecl = nil; + {$EXTERNALSYM sk_dup} + sk_dup : function (st : PSTACK) : PSTACK cdecl = nil; + {$EXTERNALSYM sk_find} + sk_find : function (st : PSTACK; Data : PIdAnsiChar) : TIdC_INT cdecl = nil; +{$IFDEF OPENSSL_FIPS} +{Note that I'm doing things this way so that we can have wrapper functions that hide +any IFDEF's and cases where the FIPS functions aren't in the .DLL} + {$EXTERNALSYM _FIPS_mode_set} + _FIPS_mode_set : function(onoff : TIdC_INT) : TIdC_INT cdecl = nil; + {$EXTERNALSYM _FIPS_mode} + _FIPS_mode : function () : TIdC_INT cdecl = nil; +{$ENDIF} + +{$IFNDEF OPENSSL_NO_HMAC} +{ +NOTE: + +There is breakage between OpenSSL 0.9.x and OpenSSL 1.0x. Some HMAC functions +were changed to return a result code. MOst of this is ugly but necessary to +work around the issues involved. Basically, the result of the C functions is +changed from "void" to "int" so that they can return failure. +} +//void HMAC_CTX_init(HMAC_CTX *ctx); + {$EXTERNALSYM HMAC_CTX_init} + HMAC_CTX_init : procedure(ctx : PHMAC_CTX) cdecl = nil; + +//void HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len, +// const EVP_MD *md, ENGINE *impl); + {$EXTERNALSYM _HMAC_Init_ex} + _HMAC_Init_ex : procedure(ctx : PHMAC_CTX; key : Pointer; len : TIdC_INT; + md : PEVP_MD; impl : PENGINE) cdecl = nil; +//OpenSSL 1.0 +//int HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len, +// const EVP_MD *md, ENGINE *impl); + {$EXTERNALSYM _1_0_HMAC_Init_ex} + _1_0_HMAC_Init_ex : function(ctx : PHMAC_CTX; key : Pointer; len : TIdC_INT; + md : PEVP_MD; impl : PENGINE) : TIdC_INT cdecl = nil; +//void HMAC_Update(HMAC_CTX *ctx, const unsigned char *data, size_t len); + {$EXTERNALSYM _HMAC_Update} + _HMAC_Update : procedure(ctx : PHMAC_CTX; data : PIdAnsiChar; len : size_t) cdecl = nil; + //OpenSSL 1.0 + {$EXTERNALSYM _1_0_HMAC_Update} +//int HMAC_Update(HMAC_CTX *ctx, const unsigned char *data, size_t len); + _1_0_HMAC_Update : function(ctx : PHMAC_CTX; data : PIdAnsiChar; len : size_t) : TIdC_INT cdecl = nil; + //void HMAC_Final(HMAC_CTX *ctx, unsigned char *md, unsigned int *len); + {$EXTERNALSYM _HMAC_Final} + _HMAC_Final : procedure(ctx : PHMAC_CTX; md : PIdAnsiChar; len : PIdC_UINT) cdecl = nil; +//OpenSSL 1.0 + {$EXTERNALSYM _1_0_HMAC_Final} +// int HMAC_Final(HMAC_CTX *ctx, unsigned char *md, unsigned int *len); + _1_0_HMAC_Final : function(ctx : PHMAC_CTX; md : PIdAnsiChar; len : PIdC_UINT) : TIdC_INT cdecl = nil; +//void HMAC_CTX_cleanup(HMAC_CTX *ctx); + {$EXTERNALSYM HMAC_CTX_cleanup} + HMAC_CTX_cleanup : procedure (ctx : PHMAC_CTX) cdecl = nil; + + {$EXTERNALSYM HMAC_Init_ex} +procedure HMAC_Init_ex(ctx : PHMAC_CTX; key : Pointer; len : TIdC_INT; + md : PEVP_MD; impl : PENGINE); + {$EXTERNALSYM HMAC_Update} +procedure HMAC_Update(ctx : PHMAC_CTX; data : PIdAnsiChar; len : size_t); + {$EXTERNALSYM HMAC_Final} +procedure HMAC_Final(ctx : PHMAC_CTX; md : PIdAnsiChar; len : PIdC_UINT); +{$ENDIF} + +{begin stack fancy stuff} +{ +For the sk functions having a type, you have to typecase one procedural pointer +as another procedural pointer. In the headers, these are defined in +safestack.h. +} +type + {$EXTERNALSYM Tsk_X509_NAME_new} + Tsk_X509_NAME_new = function(cmp : Tsk_new_cmp) : PSTACK_OF_X509_NAME cdecl; + {$EXTERNALSYM Tsk_X509_NAME_new_null} + Tsk_X509_NAME_new_null = function : PSTACK_OF_X509_NAME cdecl; + {$EXTERNALSYM Tsk_X509_NAME_free} + Tsk_X509_NAME_free = procedure(st : PSTACK_OF_X509_NAME) cdecl; + {$EXTERNALSYM Tsk_X509_NAME_num} + Tsk_X509_NAME_num = function (const sk : PSTACK_OF_X509_NAME) : TIdC_INT cdecl; + {$EXTERNALSYM Tsk_X509_NAME_value} + Tsk_X509_NAME_value = function (const sk : PSTACK_OF_X509_NAME; i : TIdC_INT) : PX509_NAME cdecl; + {$EXTERNALSYM Tsk_X509_NAME_push} + Tsk_X509_NAME_push = function (sk : PSTACK_OF_X509_NAME; st : PX509_NAME) : TIdC_INT cdecl; + {$EXTERNALSYM Tsk_X509_NAME_dup} + Tsk_X509_NAME_dup = function (sk : PSTACK_OF_X509_NAME) : PSTACK_OF_X509_NAME cdecl; + {$EXTERNALSYM Tsk_X509_NAME_find} + Tsk_X509_NAME_find = function (sk : PSTACK_OF_X509_NAME; val : PX509_NAME) : TIdC_INT cdecl; + {$EXTERNALSYM Tsk_X509_NAME_pop_free} + Tsk_X509_NAME_pop_free = procedure (sk : PSTACK_OF_X509_NAME; func: Tsk_pop_free_func) cdecl; + + {$EXTERNALSYM Tsk_X509_INFO_num} + Tsk_X509_INFO_num = function (const sk : PSTACK_OF_X509_INFO) : TIdC_INT cdecl; + {$EXTERNALSYM Tsk_X509_INFO_value} + Tsk_X509_INFO_value = function (const sk : PSTACK_OF_X509_INFO; i : TIdC_INT) : PX509_INFO cdecl; + {$EXTERNALSYM Tsk_X509_INFO_push} + Tsk_X509_INFO_push = function (sk : PSTACK_OF_X509_INFO; st : PX509_INFO) : TIdC_INT cdecl; + {$EXTERNALSYM Tsk_X509_INFO_dup} + Tsk_X509_INFO_dup = function (sk : PSTACK_OF_X509_INFO) : PSTACK_OF_X509_INFO cdecl; + {$EXTERNALSYM Tsk_X509_INFO_find} + Tsk_X509_INFO_find = function (sk : PSTACK_OF_X509_INFO; val : PX509_INFO) : TIdC_INT cdecl; + {$EXTERNALSYM Tsk_X509_INFO_pop_free} + Tsk_X509_INFO_pop_free = procedure (sk : PSTACK_OF_X509_INFO; func: Tsk_pop_free_func) cdecl; + +var + {$EXTERNALSYM sk_X509_NAME_new} + sk_X509_NAME_new: Tsk_X509_NAME_new absolute sk_new; + {$EXTERNALSYM sk_X509_NAME_new_null} + sk_X509_NAME_new_null : Tsk_X509_NAME_new_null absolute sk_new_null; + {$EXTERNALSYM sk_X509_NAME_free} + sk_X509_NAME_free : Tsk_X509_NAME_free absolute sk_free; + {$EXTERNALSYM sk_X509_NAME_num} + sk_X509_NAME_num : Tsk_X509_NAME_num absolute sk_num; + {$EXTERNALSYM sk_X509_NAME_value} + sk_X509_NAME_value : Tsk_X509_NAME_value absolute sk_value; + {$EXTERNALSYM sk_X509_NAME_push} + sk_X509_NAME_push : Tsk_X509_NAME_push absolute sk_push; + {$EXTERNALSYM sk_X509_NAME_dup} + sk_X509_NAME_dup : Tsk_X509_NAME_dup absolute sk_dup; + {$EXTERNALSYM sk_X509_NAME_find} + sk_X509_NAME_find : Tsk_X509_NAME_find absolute sk_find; + {$EXTERNALSYM sk_X509_NAME_pop_free} + sk_X509_NAME_pop_free : Tsk_X509_NAME_pop_free absolute sk_pop_free; + {$EXTERNALSYM sk_X509_INFO_num} + sk_X509_INFO_num : Tsk_X509_INFO_num absolute sk_num; + {$EXTERNALSYM sk_X509_INFO_value} + sk_X509_INFO_value : Tsk_X509_INFO_value absolute sk_value; + {$EXTERNALSYM sk_X509_INFO_push} + sk_X509_INFO_push : Tsk_X509_INFO_push absolute sk_push; + {$EXTERNALSYM sk_X509_INFO_dup} + sk_X509_INFO_dup : Tsk_X509_INFO_dup absolute sk_dup; + {$EXTERNALSYM sk_X509_INFO_find} + sk_X509_INFO_find : Tsk_X509_INFO_find absolute sk_find; + {$EXTERNALSYM sk_X509_INFO_pop_free} + sk_X509_INFO_pop_free : Tsk_X509_INFO_pop_free absolute sk_pop_free; +{end} + + {$EXTERNALSYM FIPS_mode_set} +function FIPS_mode_set(onoff : TIdC_INT) : TIdC_INT; {$IFDEF INLINE}inline;{$ENDIF} + {$EXTERNALSYM FIPS_mode} +function FIPS_mode() : TIdC_INT; {$IFDEF INLINE}inline;{$ENDIF} + + +{begin other stuff} + {$EXTERNALSYM UTC_Time_Decode} +function UTC_Time_Decode(UCTtime : PASN1_UTCTIME; var year, month, day, hour, min, sec: Word; + var tz_hour, tz_min: Integer): Integer; + {$EXTERNALSYM SSL_set_app_data} +function SSL_set_app_data(s: PSSL; arg: Pointer): TIdC_INT; + {$EXTERNALSYM SSL_get_app_data} +function SSL_get_app_data(s: PSSL): Pointer; +// +function Load: Boolean; +procedure Unload; +{$IFNDEF STATICLOAD_OPENSSL} +function WhichFailedToLoad: String; +function GetSSLLibHandle : TIdLibHandle; +function GetCryptLibHandle : TIdLibHandle; +procedure IdOpenSSLSetLibPath(const APath: String); + {$IFDEF UNIX} +procedure IdOpenSSLSetCanLoadSymLinks(ACanLoad: Boolean); +procedure IdOpenSSLSetLoadSymLinksFirst(ALoadFirst: Boolean); + {$ENDIF} +{$ENDIF} +// +procedure InitializeRandom; +procedure CleanupRandom; + + {$EXTERNALSYM M_ASN1_STRING_length} +function M_ASN1_STRING_length(x : PASN1_STRING): TIdC_INT; + {$EXTERNALSYM M_ASN1_STRING_length_set} +procedure M_ASN1_STRING_length_set(x : PASN1_STRING; n : TIdC_INT); + {$EXTERNALSYM M_ASN1_STRING_type} +function M_ASN1_STRING_type(x : PASN1_STRING) : TIdC_INT; + {$EXTERNALSYM M_ASN1_STRING_data} +function M_ASN1_STRING_data(x : PASN1_STRING) : PIdAnsiChar; + {$EXTERNALSYM X509_NAME_dup} +function X509_NAME_dup(xn : PX509_NAME) : PX509_NAME; + {$EXTERNALSYM X509_STORE_CTX_get_app_data} +function X509_STORE_CTX_get_app_data(ctx: PX509_STORE_CTX):Pointer; + {$EXTERNALSYM X509_get_version} +function X509_get_version(x : PX509): TIdC_LONG; + {$EXTERNALSYM X509_get_signature_type} +function X509_get_signature_type(x : PX509) : TIdC_INT; + {$EXTERNALSYM X509_REQ_get_subject_name} +function X509_REQ_get_subject_name(x:PX509_REQ):PX509_NAME; + {$EXTERNALSYM X509_get_notBefore} +function X509_get_notBefore(x509: PX509):PASN1_TIME; + {$EXTERNALSYM X509_get_notAfter} +function X509_get_notAfter(x509: PX509):PASN1_TIME; + {$EXTERNALSYM X509_REQ_get_version} +function X509_REQ_get_version(x : PX509_REQ): TIdC_LONG; + {$EXTERNALSYM X509_CRL_get_version} +function X509_CRL_get_version(x : PX509_CRL) : TIdC_LONG; + {$EXTERNALSYM X509_CRL_get_lastUpdate} +function X509_CRL_get_lastUpdate(x : PX509_CRL) : PASN1_TIME; + {$EXTERNALSYM X509_CRL_get_nextUpdate} +function X509_CRL_get_nextUpdate(x : PX509_CRL) : PASN1_TIME; + {$EXTERNALSYM X509_CRL_get_issuer} +function X509_CRL_get_issuer(x : PX509_CRL) : PX509_NAME; + {$EXTERNALSYM X509_CRL_get_REVOKED} +function X509_CRL_get_REVOKED(x : PX509_CRL) : PSTACK_OF_X509_REVOKED; + {$EXTERNALSYM SSL_CTX_set_info_callback} +procedure SSL_CTX_set_info_callback(ctx: PSSL_CTX; cb: PSSL_CTX_info_callback); + {$EXTERNALSYM SSL_CTX_set_options} +function SSL_CTX_set_options(ctx: PSSL_CTX; op: TIdC_LONG):TIdC_LONG; + {$EXTERNALSYM SSL_CTX_clear_options} +function SSL_CTX_clear_options(ctx : PSSL_CTX; op : TIdC_LONG):TIdC_LONG; + {$EXTERNALSYM SSL_CTX_get_options} +function SSL_CTX_get_options(ctx: PSSL_CTX) : TIdC_LONG; + {$EXTERNALSYM SSL_set_options} +function SSL_set_options(ssl: PSSL; op : TIdC_LONG): TIdC_LONG; + {$EXTERNALSYM SSL_clear_mode} +function SSL_clear_mode(ssl : PSSL; op : TIdC_LONG) : TIdC_LONG; + {$EXTERNALSYM SSL_get_options} +function SSL_get_options(ssl : PSSL): TIdC_LONG; + {$EXTERNALSYM SSL_CTX_set_mode} +function SSL_CTX_set_mode(ctx : PSSL_CTX; op : TIdC_LONG) : TIdC_LONG; + {$EXTERNALSYM SSL_CTX_clear_mode} +function SSL_CTX_clear_mode(ctx : PSSL_CTX; op : TIdC_LONG) : TIdC_LONG; + {$EXTERNALSYM SSL_CTX_get_mode} +function SSL_CTX_get_mode(ctx : PSSL_CTX) : TIdC_LONG; + {$EXTERNALSYM SSL_set_mtu} +function SSL_set_mtu(ssl : PSSL; mtu : TIdC_LONG) : TIdC_LONG; + {$EXTERNALSYM SSL_get_secure_renegotiation_support} +function SSL_get_secure_renegotiation_support(ssl : PSSL) : TIdC_LONG; + {$EXTERNALSYM SSL_CTX_sess_number} +function SSL_CTX_sess_number(ctx : PSSL_CTX) : TIdC_LONG; + {$EXTERNALSYM SSL_CTX_sess_connect} +function SSL_CTX_sess_connect(ctx : PSSL_CTX) : TIdC_LONG; + {$EXTERNALSYM SSL_CTX_sess_connect_good} +function SSL_CTX_sess_connect_good(ctx : PSSL_CTX): TIdC_LONG; + {$EXTERNALSYM SSL_CTX_sess_connect_renegotiate} +function SSL_CTX_sess_connect_renegotiate(ctx : PSSL_CTX): TIdC_LONG; + {$EXTERNALSYM SSL_CTX_sess_accept} +function SSL_CTX_sess_accept(ctx : PSSL_CTX) : TIdC_LONG; + {$EXTERNALSYM SSL_CTX_sess_accept_renegotiate} +function SSL_CTX_sess_accept_renegotiate(ctx : PSSL_CTX) : TIdC_LONG; + {$EXTERNALSYM SSL_CTX_sess_accept_good} +function SSL_CTX_sess_accept_good(ctx : PSSL_CTX) : TIdC_LONG; + {$EXTERNALSYM SSL_CTX_sess_hits} +function SSL_CTX_sess_hits(ctx : PSSL_CTX) : TIdC_LONG; + {$EXTERNALSYM SSL_CTX_sess_cb_hits} +function SSL_CTX_sess_cb_hits(ctx : PSSL_CTX) : TIdC_LONG; + {$EXTERNALSYM SSL_CTX_sess_misses} +function SSL_CTX_sess_misses(ctx : PSSL_CTX) : TIdC_LONG; + {$EXTERNALSYM SSL_CTX_sess_timeouts} +function SSL_CTX_sess_timeouts(ctx : PSSL_CTX) : TIdC_LONG; + {$EXTERNALSYM SSL_CTX_sess_cache_full} +function SSL_CTX_sess_cache_full(ctx : PSSL_CTX) : TIdC_LONG; + {$EXTERNALSYM SSL_CTX_sess_set_cache_size} +function SSL_CTX_sess_set_cache_size(ctx : PSSL_CTX; t : TIdC_LONG) : TIdC_LONG; + {$EXTERNALSYM SSL_CTX_sess_get_cache_size} +function SSL_CTX_sess_get_cache_size(ctx : PSSL_CTX) : TIdC_LONG; + {$EXTERNALSYM SSL_CTX_set_session_cache_mode} +function SSL_CTX_set_session_cache_mode(ctx : PSSL_CTX; m : TIdC_LONG) : TIdC_LONG; + {$EXTERNALSYM SSL_CTX_get_session_cache_mode} +function SSL_CTX_get_session_cache_mode(ctx : PSSL_CTX) : TIdC_LONG; + {$EXTERNALSYM SSL_CTX_get_read_ahead} +function SSL_CTX_get_read_ahead(ctx : PSSL_CTX) : TIdC_LONG; + {$EXTERNALSYM SSL_CTX_set_read_ahead} +function SSL_CTX_set_read_ahead(ctx : PSSL_CTX; m : TIdC_LONG) : TIdC_LONG; + {$EXTERNALSYM SSL_CTX_get_max_cert_list} +function SSL_CTX_get_max_cert_list(ctx : PSSL_CTX) : TIdC_LONG; + {$EXTERNALSYM SSL_CTX_set_max_cert_list} +function SSL_CTX_set_max_cert_list(ctx : PSSL_CTX; m : TIdC_LONG) : TIdC_LONG; + {$EXTERNALSYM SSL_get_max_cert_list} +function SSL_get_max_cert_list(ssl : PSSL) : TIdC_LONG; + {$EXTERNALSYM SSL_set_max_cert_list} +function SSL_set_max_cert_list(ssl : PSSL; m : TIdC_LONG) : TIdC_LONG; + {$EXTERNALSYM DTLSv1_get_timeout} +function DTLSv1_get_timeout(ssl : PSSL; var arg : timeval) : TIdC_LONG; + {$EXTERNALSYM DTLSv1_handle_timeout} +function DTLSv1_handle_timeout(ssl : PSSL) : TIdC_LONG; + {$EXTERNALSYM DTLSv1_listen} +function DTLSv1_listen(ssl : PSSL; var peer : sockaddr) : TIdC_LONG; + {$EXTERNALSYM SSL_session_reused} +function SSL_session_reused(ssl : PSSL) : TIdC_LONG; + {$EXTERNALSYM SSL_num_renegotiations} +function SSL_num_renegotiations(ssl : PSSL) : TIdC_LONG; + {$EXTERNALSYM SSL_clear_num_renegotiations} +function SSL_clear_num_renegotiations(ssl : PSSL) : TIdC_LONG; + {$EXTERNALSYM SSL_total_renegotiations} +function SSL_total_renegotiations(ssl : PSSL) : TIdC_LONG; + {$EXTERNALSYM SSL_CTX_need_tmp_RSA} +function SSL_CTX_need_tmp_RSA(ctx : PSSL_CTX) : TIdC_LONG; + {$EXTERNALSYM SSL_CTX_set_tmp_rsa} +function SSL_CTX_set_tmp_rsa(ctx : PSSL_CTX; rsa : PRSA) : TIdC_LONG; + {$EXTERNALSYM SSL_CTX_set_tmp_dh} +function SSL_CTX_set_tmp_dh(ctx : PSSL_CTX; dh : PDH) : TIdC_LONG; + {$EXTERNALSYM SSL_CTX_set_tmp_ecdh} +function SSL_CTX_set_tmp_ecdh(ctx : PSSL_CTX; ecdh : PEC_KEY) : TIdC_LONG; + {$EXTERNALSYM SSL_CTX_set_ecdh_auto} +function SSL_CTX_set_ecdh_auto(ctx : PSSL_CTX; m : TIdC_LONG) : TIdC_LONG; + {$EXTERNALSYM SSL_need_tmp_RSA} +function SSL_need_tmp_RSA(ssl : PSSL) : TIdC_LONG; + {$EXTERNALSYM SSL_set_tmp_rsa} +procedure SSL_set_tmp_rsa(ssl : PSSL; rsa : PRSA); + {$EXTERNALSYM SSL_set_tmp_dh} +function SSL_set_tmp_dh(ssl : PSSL;dh : PDH) : TIdC_LONG; + {$EXTERNALSYM SSL_set_tmp_ecdh} +function SSL_set_tmp_ecdh(ssl : PSSL; ecdh : PEC_KEY) : TIdC_LONG; + {$EXTERNALSYM SSL_CTX_add0_chain_cert} //OpenSSL 1.0.2 +function SSL_CTX_add0_chain_cert(ctx : PSSL_CTX; x509 : PX509) : TIdC_LONG; + {$EXTERNALSYM SSL_CTX_add1_chain_cert} //OpenSSL 1.0.2 +function SSL_CTX_add1_chain_cert(ctx : PSSL_CTX; x509 : PX509) : TIdC_LONG; + {$EXTERNALSYM SSL_CTX_add_extra_chain_cert} +function SSL_CTX_add_extra_chain_cert(ctx : PSSL_CTX; x509 : PX509) : TIdC_LONG; + {$EXTERNALSYM SSL_CTX_get_extra_chain_certs} +function SSL_CTX_get_extra_chain_certs(ctx : PSSL_CTX; var px509 : px509) : TIdC_LONG; + {$EXTERNALSYM SSL_CTX_get_extra_chain_certs_only} +function SSL_CTX_get_extra_chain_certs_only(ctx: PSSL_CTX;var PX509 :PX509) : TIdC_LONG; + {$EXTERNALSYM SSL_CTX_clear_extra_chain_certs} +function SSL_CTX_clear_extra_chain_certs(ctx : PSSL_CTX) : TIdC_LONG; + {$EXTERNALSYM SSL_CTX_set0_chain} //OpenSSL 1.0.2 +function SSL_CTX_set0_chain(ctx:PSSL_CTX; sk : PSTACK_OF_X509) : TIdC_LONG; + {$EXTERNALSYM SSL_CTX_set1_chain} //OpenSSL 1.0.2 +function SSL_CTX_set1_chain(ctx:PSSL_CTX; sk : PSTACK_OF_X509) : TIdC_LONG; + {$EXTERNALSYM SSL_CTX_get0_chain_certs} //OpenSSL 1.0.2 +function SSL_CTX_get0_chain_certs(ctx :PSSL_CTX; var px509 :PX509) : TIdC_LONG; + {$EXTERNALSYM SSL_CTX_clear_chain_certs} //OpenSSL 1.0.2 +function SSL_CTX_clear_chain_certs(ctx :PSSL_CTX) : TIdC_LONG; + +{$IFNDEF OPENSSL_NO_TLSEXT} + {$EXTERNALSYM SSL_set_tlsext_host_name} +function SSL_set_tlsext_host_name(s : PSSL; name : string) : TIdC_LONG; + {$EXTERNALSYM SSL_set_tlsext_debug_callback} +function SSL_set_tlsext_debug_callback(ssl : PSSL; cb : SSL_callback_ctrl_fp) : TIdC_LONG; + {$EXTERNALSYM SSL_set_tlsext_debug_arg} +function SSL_set_tlsext_debug_arg(ssl : PSSL; arg : Pointer) : TIdC_LONG; + {$EXTERNALSYM SSL_set_tlsext_status_type} +function SSL_set_tlsext_status_type(ssl : PSSL; _type : TIdC_LONG):TIdC_LONG; + {$EXTERNALSYM SSL_get_tlsext_status_exts} +function SSL_get_tlsext_status_exts(ssl : PSSL; arg : Pointer): TIdC_LONG; + {$EXTERNALSYM SSL_set_tlsext_status_exts} +function SSL_set_tlsext_status_exts(ssl : PSSL; arg : Pointer):TIdC_LONG; + {$EXTERNALSYM SSL_get_tlsext_status_ids} +function SSL_get_tlsext_status_ids(ssl : PSSL; arg : Pointer) : TIdC_LONG; + {$EXTERNALSYM SSL_set_tlsext_status_ids} +function SSL_set_tlsext_status_ids(ssl : PSSL; arg : Pointer) : TIdC_LONG; + {$EXTERNALSYM SSL_get_tlsext_status_ocsp_resp} +function SSL_get_tlsext_status_ocsp_resp(ssl : PSSL; arg : Pointer) : TIdC_LONG; + {$EXTERNALSYM SSL_set_tlsext_status_ocsp_resp} +function SSL_set_tlsext_status_ocsp_resp(ssl : PSSL; arg : Pointer; arglen : TIdC_LONG) : TIdC_LONG; + {$EXTERNALSYM SSL_CTX_set_tlsext_servername_callback} +function SSL_CTX_set_tlsext_servername_callback(ctx : PSSL_CTX; cb :SSL_callback_ctrl_fp):TIdC_LONG; + {$EXTERNALSYM SSL_CTX_get_tlsext_ticket_keys} +function SSL_CTX_get_tlsext_ticket_keys(ctx : PSSL_CTX; keys : PIdAnsiChar; keylen : TIdC_LONG ) : TIdC_LONG; + {$EXTERNALSYM SSL_CTX_set_tlsext_status_cb} +function SSL_CTX_set_tlsext_status_cb(ssl : PSSL_CTX; cb : TSSL_CTX_set_tlsext_status_cb) :TIdC_LONG; + {$EXTERNALSYM SSL_set_tlsext_opaque_prf_input} +function SSL_set_tlsext_opaque_prf_input(s : PSSL; src : PIdAnsiChar; len : TIdC_LONG ) : TIdC_LONG; + {$EXTERNALSYM SSL_CTX_set_tlsext_opaque_prf_input_callback} +function SSL_CTX_set_tlsext_opaque_prf_input_callback(ctx : PSSL_CTX; cb : TSSL_CTX_set_tlsext_opaque_prf_input_callback_cb) : TIdC_LONG; + {$EXTERNALSYM SSL_CTX_set_tlsext_opaque_prf_input_callback_arg} +function SSL_CTX_set_tlsext_opaque_prf_input_callback_arg(ctx : PSSL_CTX; arg : Pointer) : TIdC_LONG; + {$EXTERNALSYM SSL_CTX_set_tlsext_ticket_key_cb} +function SSL_CTX_set_tlsext_ticket_key_cb(ssl : PSSL_CTX; cb : TSSL_CTX_set_tlsext_ticket_key_cb_fp) : TIdC_LONG; +{$ifndef OPENSSL_NO_HEARTBEATS} + {$EXTERNALSYM SSL_heartbeat} +function SSL_heartbeat(ssl : PSSL) : TIdC_LONG; + {$EXTERNALSYM SSL_get_tlsext_heartbeat_pending} +function SSL_get_tlsext_heartbeat_pending(ssl : PSSL) : TIdC_LONG; + {$EXTERNALSYM SSL_set_tlsext_heartbeat_no_requests} +function SSL_set_tlsext_heartbeat_no_requests(ssl : PSSL; arg : TIdC_LONG) : TIdC_LONG; +{$endif} +{$ENDIF} + + {$EXTERNALSYM TLS1_get_version} +function TLS1_get_version(s : PSSL) : TIdC_INT; + {$EXTERNALSYM TLS1_get_client_version} +function TLS1_get_client_version(s : PSSL) : TIdC_INT; + {$EXTERNALSYM SSL_CTX_get_version} +function SSL_CTX_get_version(ctx: PSSL_CTX):TIdC_INT; +//* BIO_s_connect() and BIO_s_socks4a_connect() */ + {$EXTERNALSYM BIO_set_conn_hostname} +function BIO_set_conn_hostname(b : PBIO; name : PIdAnsiChar) : TIdC_LONG; + {$EXTERNALSYM BIO_set_conn_port} +function BIO_set_conn_port(b : PBIO; port : PIdAnsiChar) : TIdC_LONG; + {$EXTERNALSYM BIO_set_conn_ip} +function BIO_set_conn_ip(b : PBIO; ip : PIdAnsiChar) : TIdC_LONG; + {$EXTERNALSYM BIO_set_conn_int_port} +function BIO_set_conn_int_port(b : PBIO; port : PIdAnsiChar) : TIdC_LONG; + {$EXTERNALSYM BIO_get_conn_hostname} +function BIO_get_conn_hostname(b : PBIO) : PIdAnsiChar; + {$EXTERNALSYM BIO_get_conn_port} +function BIO_get_conn_port(b : PBIO) : PIdAnsiChar; + {$EXTERNALSYM BIO_get_conn_ip} +function BIO_get_conn_ip(b : PBIO) : PIdAnsiChar; + {$EXTERNALSYM BIO_get_conn_int_port} +function BIO_get_conn_int_port(b : PBIO) : TIdC_LONG; + {$EXTERNALSYM BIO_set_nbio} +function BIO_set_nbio(b : PBIO; n : TIdC_LONG) : TIdC_LONG; +//* BIO_s_accept_socket() */ + {$EXTERNALSYM BIO_set_accept_port} +function BIO_set_accept_port(b : PBIO; name : PIdAnsiChar) : TIdC_LONG; + {$EXTERNALSYM BIO_get_accept_port} +function BIO_get_accept_port(b : PBIO) : PIdAnsiChar; + {$EXTERNALSYM BIO_set_nbio_accept} +function BIO_set_nbio_accept(b : PBIO; n : TIdC_INT) : TIdC_LONG; + {$EXTERNALSYM BIO_set_accept_bios} +function BIO_set_accept_bios(b : PBIO; bio : PBIO) : TIdC_LONG; + {$EXTERNALSYM BIO_set_bind_mode} +function BIO_set_bind_mode(b : PBIO; mode : TIdC_LONG) : TIdC_LONG; + {$EXTERNALSYM BIO_get_bind_mode} +function BIO_get_bind_mode(b : PBIO; mode : TIdC_LONG) : TIdC_LONG; + {$EXTERNALSYM BIO_do_handshake} +function BIO_do_handshake(b : PBIO) : TIdC_LONG; + {$EXTERNALSYM BIO_do_connect} +function BIO_do_connect(b : PBIO) : TIdC_LONG; + {$EXTERNALSYM BIO_do_accept} +function BIO_do_accept(b : PBIO) : TIdC_LONG; + {$EXTERNALSYM BIO_set_url} +function BIO_set_url(b : PBIO; url : PIdAnsiChar) : TIdC_LONG; + {$EXTERNALSYM BIO_set_proxies} +function BIO_set_proxies(b : PBIO; p : PIdAnsiChar) : TIdC_LONG; + +//* BIO_set_nbio(b,n) */ + {$EXTERNALSYM BIO_set_filter_bio} +function BIO_set_filter_bio(b : PBIO; s : PIdAnsiChar) : TIdC_LONG; + {$EXTERNALSYM BIO_set_proxy_header} +function BIO_set_proxy_header(b : PBIO; sk : PIdAnsiChar) : TIdC_LONG; + {$EXTERNALSYM BIO_set_no_connect_return} +function BIO_set_no_connect_return(b : PBIO; b2 : TIdC_LONG) : TIdC_LONG; + {$EXTERNALSYM BIO_get_proxy_header} +function BIO_get_proxy_header(b : PBIO; var skp : PIdAnsiChar) : TIdC_LONG; + {$EXTERNALSYM BIO_get_proxies} +function BIO_get_proxies(b : PBIO; var pxy_p : PIdAnsiChar) : TIdC_LONG; + {$EXTERNALSYM BIO_get_url} +function BIO_get_url(b : PBIO; var url : PIdAnsiChar) : TIdC_LONG; + {$EXTERNALSYM BIO_get_no_connect_return} +function BIO_get_no_connect_return(b : PBIO) : TIdC_LONG; + {$EXTERNALSYM BIO_set_fd} +function BIO_set_fd(b : PBIO; fd,c : TIdC_INT) : TIdC_LONG; + {$EXTERNALSYM BIO_get_fd} +function BIO_get_fd(b : PBIO; c : PIdC_INT) : TIdC_LONG; + {$EXTERNALSYM BIO_seek} +function BIO_seek(b : PBIO; ofs : TIdC_LONG) : TIdC_INT; + {$EXTERNALSYM BIO_tell} +function BIO_tell(b : PBIO) : TIdC_INT; +{$IFDEF CONST_STRICT} +{$ELSE} + {$EXTERNALSYM BIO_read_filename} +function BIO_read_filename(b : PBIO; name : PIdAnsiChar) : TIdC_LONG; +{$ENDIF} + {$EXTERNALSYM BIO_get_md} +function BIO_get_md(b : PBIO; var mdp : PEVP_MD) : TIdC_LONG; + {$EXTERNALSYM BIO_get_md_ctx} +function BIO_get_md_ctx(b : PBIO; var mdcp : PEVP_MD_CTX) : TIdC_LONG; + {$EXTERNALSYM BIO_set_md_ctx} +function BIO_set_md_ctx(b : PBIO; mdcp : PEVP_MD_CTX) : TIdC_LONG; + {$EXTERNALSYM BIO_get_cipher_status} +function BIO_get_cipher_status(b : PBIO) : TIdC_LONG; + {$EXTERNALSYM BIO_get_cipher_ctx} +function BIO_get_cipher_ctx(b : PBIO; var c_pp : PEVP_CIPHER_CTX): TIdC_LONG; + + {$EXTERNALSYM BIO_write_filename} +function BIO_write_filename(b : PBIO; name : PIdAnsiChar) : TIdC_LONG; + {$EXTERNALSYM BIO_append_filename} +function BIO_append_filename(b : PBIO; name : PIdAnsiChar) : TIdC_LONG; + {$EXTERNALSYM BIO_rw_filename} +function BIO_rw_filename(b : PBIO; name : PIdAnsiChar) : TIdC_LONG; + {$EXTERNALSYM BIO_set_ssl} +function BIO_set_ssl(b : PBIO; ssl : PSSL; c : TIdC_LONG) : TIdC_LONG; + {$EXTERNALSYM BIO_get_ssl} +function BIO_get_ssl(b : PBIO; var sslp : PSSL) : TIdC_LONG; + {$EXTERNALSYM BIO_set_ssl_mode} +function BIO_set_ssl_mode(b : PBIO; client : TIdC_LONG) : TIdC_LONG; + {$EXTERNALSYM BIO_set_ssl_renegotiate_bytes} +function BIO_set_ssl_renegotiate_bytes(b : PBIO; num : TIdC_LONG) : TIdC_LONG; + {$EXTERNALSYM BIO_get_num_renegotiates} +function BIO_get_num_renegotiates(b : PBIO) : TIdC_LONG; + {$EXTERNALSYM BIO_set_ssl_renegotiate_timeout} +function BIO_set_ssl_renegotiate_timeout(b : PBIO; seconds : TIdC_LONG) : TIdC_LONG; + {$EXTERNALSYM BIO_get_mem_data} +function BIO_get_mem_data(b : PBIO; var pp : PIdAnsiChar) : TIdC_INT; + {$EXTERNALSYM BIO_set_mem_buf} +function BIO_set_mem_buf(b : PBIO; bm : PBUF_MEM; c : TIdC_INT) : TIdC_INT; + {$EXTERNALSYM BIO_get_mem_ptr} +function BIO_get_mem_ptr(b: PBIO; var pp: PBUF_MEM) : TIdC_INT; + {$EXTERNALSYM BIO_set_mem_eof_return} +procedure BIO_set_mem_eof_return(b : PBIO; const v : TIdC_INT); +//* For the BIO_f_buffer() type */ + {$EXTERNALSYM BIO_get_buffer_num_lines} +function BIO_get_buffer_num_lines(b : PBIO) : TIdC_INT; + {$EXTERNALSYM BIO_set_buffer_size} +procedure BIO_set_buffer_size(b : PBIO; const size : TIdC_INT); +//* Don't use the next one unless you know what you are doing :-) */ + {$EXTERNALSYM BIO_dup_state} +function BIO_dup_state(b : PBIO; ret : PBIO) : TIdC_LONG; + {$EXTERNALSYM BIO_reset} +function BIO_reset(b : PBIO) : TIdC_INT; + {$EXTERNALSYM BIO_eof} +function BIO_eof(b : PBIO) : TIdC_INT; + {$EXTERNALSYM BIO_set_close} +function BIO_set_close(b: PBIO; c: TIdC_LONG): TIdC_INT; + {$EXTERNALSYM BIO_get_close} +function BIO_get_close(b : PBIO) : TIdC_INT; + {$EXTERNALSYM BIO_pending} +function BIO_pending(b : PBIO) : TIdC_INT; + {$EXTERNALSYM BIO_wpending} +function BIO_wpending(b : PBIO) : TIdC_INT; + {$EXTERNALSYM BIO_flush} +function BIO_flush(b : PBIO) : TIdC_INT; +//* For the BIO_f_buffer() type */ + {$EXTERNALSYM BIO_buffer_get_num_lines} +function BIO_buffer_get_num_lines(b : PBIO) : TIdC_INT; + {$EXTERNALSYM BIO_get_info_callback} +function BIO_get_info_callback(b : PBIO; var cbp : Pbio_info_cb) : TIdC_INT; + {$EXTERNALSYM BIO_set_info_callback} +function BIO_set_info_callback(b : PBIO; cb : Pbio_info_cb) : TIdC_INT; + {$EXTERNALSYM BIO_set_read_buffer_size} +function BIO_set_read_buffer_size(b : PBIO; size : TIdC_LONG) : TIdC_LONG; + {$EXTERNALSYM BIO_set_write_buffer_size} +function BIO_set_write_buffer_size(b : PBIO; size : TIdC_LONG) : TIdC_LONG; + {$EXTERNALSYM BIO_make_bio_pair} +function BIO_make_bio_pair(b1, b2 : PBIO ): TIdC_INT; + {$EXTERNALSYM BIO_destroy_bio_pair} +function BIO_destroy_bio_pair(b : PBIO) : TIdC_INT; + {$EXTERNALSYM BIO_shutdown_wr} +function BIO_shutdown_wr(b : PBIO) : TIdC_INT; +///* macros with inappropriate type -- but ...pending macros use int too: */ + {$EXTERNALSYM BIO_get_write_guarantee} +function BIO_get_write_guarantee(b : PBIO) : TIdC_INT; + {$EXTERNALSYM BIO_get_read_request} +function BIO_get_read_request(b : PBIO) : TIdC_INT; +//* ctrl macros for dgram */ + {$EXTERNALSYM _BIO_ctrl_dgram_connect} +function _BIO_ctrl_dgram_connect(b : PBIO; peer : Sockaddr) : TIdC_INT; + {$EXTERNALSYM BIO_ctrl_set_connected} +function BIO_ctrl_set_connected(b : PBIO; state : TIdC_INT; peer : Sockaddr) : TIdC_INT; + {$EXTERNALSYM BIO_dgram_recv_timedout} +function BIO_dgram_recv_timedout(b : PBIO) : TIdC_INT; + {$EXTERNALSYM BIO_dgram_send_timedout} +function BIO_dgram_send_timedout(b : PBIO) : TIdC_INT; + {$EXTERNALSYM BIO_dgram_get_peer} +function BIO_dgram_get_peer(b : PBIO; peer : PSockAddr) : TIdC_INT; + {$EXTERNALSYM BIO_dgram_set_peer} +function BIO_dgram_set_peer(b : PBIO; peer : PSockAddr) : TIdC_INT; + + {$EXTERNALSYM PEM_read_bio_X509} +function PEM_read_bio_X509(bp: PBIO; x: PPX509; cb: ppem_password_cb; u: Pointer): PX509; + {$EXTERNALSYM PEM_read_bio_X509_REQ} +function PEM_read_bio_X509_REQ(bp :PBIO; x : PPX509_REQ; cb :ppem_password_cb; u: Pointer) : PX509_REQ; + {$EXTERNALSYM PEM_read_bio_X509_CRL} +function PEM_read_bio_X509_CRL(bp : PBIO; x : PPX509_CRL;cb : ppem_password_cb; u: Pointer) : PX509_CRL; + {$EXTERNALSYM PEM_read_bio_RSAPrivateKey} +function PEM_read_bio_RSAPrivateKey(bp : PBIO; x : PPRSA; cb : ppem_password_cb; u: Pointer) : PRSA; + {$EXTERNALSYM PEM_read_bio_RSAPublicKey} +function PEM_read_bio_RSAPublicKey(bp : PBIO; x : PPRSA; cb : ppem_password_cb; u: Pointer) : PRSA; + {$EXTERNALSYM PEM_read_bio_DSAPrivateKey} +function PEM_read_bio_DSAPrivateKey(bp : PBIO; x : PPDSA; cb : ppem_password_cb; u : Pointer) : PDSA; + {$EXTERNALSYM PEM_read_bio_PrivateKey} +function PEM_read_bio_PrivateKey(bp : PBIO; x : PPEVP_PKEY; cb : ppem_password_cb; u : Pointer) : PEVP_PKEY; + {$EXTERNALSYM PEM_read_bio_PKCS7} +function PEM_read_bio_PKCS7(bp : PBIO; x : PPPKCS7; cb : ppem_password_cb; u : Pointer) : PPKCS7; + {$EXTERNALSYM PEM_read_bio_DHparams} +function PEM_read_bio_DHparams(bp : PBIO; x : PPDH; cb : ppem_password_cb; u : Pointer) : PDH; + {$EXTERNALSYM PEM_read_bio_DSAparams} +function PEM_read_bio_DSAparams(bp : PBIO; x : PPDSA; cb : ppem_password_cb; u : Pointer) : PDSA; + {$EXTERNALSYM PEM_read_bio_NETSCAPE_CERT_SEQUENCE} +function PEM_read_bio_NETSCAPE_CERT_SEQUENCE(bp : PBIO; x : PPNETSCAPE_CERT_SEQUENCE; + cb : ppem_password_cb; u : Pointer) : PNETSCAPE_CERT_SEQUENCE; + {$EXTERNALSYM PEM_read_bio_PUBKEY} +function PEM_read_bio_PUBKEY(bp : PBIO; x : PPEVP_PKEY; cb : ppem_password_cb; u : Pointer) : PEVP_PKEY; + {$EXTERNALSYM PEM_write_bio_X509} +function PEM_write_bio_X509(bp: PBIO; x: PX509): TIdC_INT; + {$EXTERNALSYM PEM_write_bio_X509_REQ} +function PEM_write_bio_X509_REQ(bp: PBIO; x: PX509_REQ): TIdC_INT; + {$EXTERNALSYM PEM_write_bio_X509_CRL} +function PEM_write_bio_X509_CRL(bp : PBIO; x : PX509_CRL) : TIdC_INT; + {$EXTERNALSYM PEM_write_bio_RSAPrivateKey} +function PEM_write_bio_RSAPrivateKey(bp : PBIO; x : PRSA; const enc : PEVP_CIPHER; + kstr : PIdAnsiChar; klen : TIdC_INT; cb : ppem_password_cb; u : POinter) : TIdC_INT; + {$EXTERNALSYM PEM_write_bio_RSAPublicKey} +function PEM_write_bio_RSAPublicKey(bp : PBIO; x : PRSA) : TIdC_INT; + {$EXTERNALSYM PEM_write_bio_DSAPrivateKey} +function PEM_write_bio_DSAPrivateKey( bp : PBIO; x : PDSA; const enc : PEVP_CIPHER; + kstr : PIdAnsiChar; klen : TIdC_INT; cb : Ppem_password_cb; u : Pointer) : TIdC_INT; + {$EXTERNALSYM PEM_write_bio_PrivateKey} +function PEM_write_bio_PrivateKey(bp : PBIO; x : PEVP_PKEY; const enc : PEVP_CIPHER; + kstr : PIdAnsiChar; klen : TIdC_INT; cb : Ppem_password_cb; u : Pointer) : TIdC_INT; + {$EXTERNALSYM PEM_write_bio_PKCS7} +function PEM_write_bio_PKCS7(bp : PBIO; x : PPKCS7) : TIdC_INT; + {$EXTERNALSYM PEM_write_bio_DHparams} +function PEM_write_bio_DHparams(bp : PBIO; x : PDH): TIdC_INT; + {$EXTERNALSYM PEM_write_bio_DSAparams} +function PEM_write_bio_DSAparams(bp : PBIO; x : PDSA) : TIdC_INT; + {$EXTERNALSYM PEM_write_bio_NETSCAPE_CERT_SEQUENCE} +function PEM_write_bio_NETSCAPE_CERT_SEQUENCE(bp : PBIO; x : PDSA) : TIdC_INT; + {$EXTERNALSYM PEM_write_bio_PUBKEY} +function PEM_write_bio_PUBKEY(bp : PBIO; x : PEVP_PKEY) : TIdC_INT; + + {$EXTERNALSYM OPENSSL_malloc} +function OPENSSL_malloc(aSize:TIdC_INT):Pointer; + {$EXTERNALSYM CRYPTO_SetMemCheck} +procedure CRYPTO_SetMemCheck(const aEnabled: Boolean); + +{$IFNDEF OPENSSL_NO_RSA} + {$EXTERNALSYM EVP_PKEY_assign_RSA} +function EVP_PKEY_assign_RSA(pkey: PEVP_PKEY; rsa: PRSA): TIdC_INT; +{$ENDIF} + +{$IFNDEF OPENSSL_NO_DSA} + {$EXTERNALSYM EVP_PKEY_assign_DSA} +function EVP_PKEY_assign_DSA(pkey : PEVP_PKEY; dsa : PDSA) : TIdC_INT; +{$ENDIF} + +{$IFNDEF OPENSSL_NO_DH} + {$EXTERNALSYM EVP_PKEY_assign_DH} +function EVP_PKEY_assign_DH(pkey : PEVP_PKEY; dh : PDH) : TIdC_INT; +{$ENDIF} + +{$IFNDEF OPENSSL_NO_EC} + {$EXTERNALSYM EVP_PKEY_assign_EC_KEY} +function EVP_PKEY_assign_EC_KEY(pkey : PEVP_PKEY; eckey : PEC_KEY) : TIdC_INT; +{$ENDIF} + +//* Add some extra combinations */ + {$EXTERNALSYM EVP_get_digestbynid} +function EVP_get_digestbynid(a : TIdC_INT) : PEVP_MD; + {$EXTERNALSYM EVP_get_digestbyobj} +function EVP_get_digestbyobj(a : PASN1_OBJECT) : PEVP_MD; + {$EXTERNALSYM EVP_get_cipherbynid} +function EVP_get_cipherbynid(a : TIdC_INT) : PEVP_CIPHER; + {$EXTERNALSYM EVP_get_cipherbyobj} +function EVP_get_cipherbyobj(a : PASN1_OBJECT) : PEVP_CIPHER; + {$EXTERNALSYM EVP_MD_nid} +function EVP_MD_nid(e : PEVP_MD) : TIdC_INT; + {$EXTERNALSYM EVP_MD_name} +function EVP_MD_name(e : PEVP_MD) : PIdAnsiChar; + {$EXTERNALSYM EVP_MD_CTX_size} +function EVP_MD_CTX_size(e : PEVP_MD_CTX) : TIdC_INT; + {$EXTERNALSYM EVP_MD_CTX_block_size} +function EVP_MD_CTX_block_size(e : PEVP_MD_CTX) : TIdC_INT; + {$EXTERNALSYM EVP_MD_CTX_type} +function EVP_MD_CTX_type(e : PEVP_MD_CTX) : TIdC_INT; + {$EXTERNALSYM EVP_CIPHER_name} +function EVP_CIPHER_name(e : PEVP_CIPHER) : PIdAnsiChar; + {$EXTERNALSYM EVP_CIPHER_mode} +function EVP_CIPHER_mode(e : PEVP_CIPHER) : TIdC_ULONG; + {$EXTERNALSYM EVP_CIPHER_CTX_type} +function EVP_CIPHER_CTX_type(c : PEVP_CIPHER_CTX) : TIdC_INT; + {$EXTERNALSYM EVP_CIPHER_CTX_mode} +function EVP_CIPHER_CTX_mode(e : PEVP_CIPHER_CTX) : TIdC_ULONG; + {$EXTERNALSYM EVP_ENCODE_LENGTH} +function EVP_ENCODE_LENGTH(l : Integer) : Integer; + {$EXTERNALSYM EVP_DECODE_LENGTH} +function EVP_DECODE_LENGTH(l : Integer) : Integer; + {$EXTERNALSYM EVP_SignInit_ex} +function EVP_SignInit_ex(a: PEVP_MD_CTX; b : PEVP_MD; c : PENGINE) : TIdC_INT; + {$EXTERNALSYM EVP_SignInit} +function EVP_SignInit(a : PEVP_MD_CTX; b : PEVP_MD) : TIdC_INT; + {$EXTERNALSYM EVP_SignUpdate} +function EVP_SignUpdate(a: PEVP_MD_CTX; b : Pointer; c : size_t) : TIdC_INT; + {$EXTERNALSYM EVP_VerifyInit_ex} +function EVP_VerifyInit_ex(a: PEVP_MD_CTX; b: PEVP_MD; c: PENGINE) : TIdC_INT; + {$EXTERNALSYM EVP_VerifyInit} +function EVP_VerifyInit(a: PEVP_MD_CTX; b: PEVP_MD) : TIdC_INT; + {$EXTERNALSYM EVP_VerifyUpdate} +function EVP_VerifyUpdate(a: PEVP_MD_CTX; b: Pointer; c : size_t) : TIdC_INT; + {$EXTERNALSYM EVP_OpenUpdate} +function EVP_OpenUpdate(a: PEVP_CIPHER_CTX; _out : PIdAnsiChar; outl : PIdC_INT; + _in : PIdAnsiChar; inl : TIdC_INT) : TIdC_INT; + {$EXTERNALSYM EVP_SealUpdate} +function EVP_SealUpdate(a : PEVP_CIPHER_CTX; b: PIdAnsiChar; c : PIdC_INT; + d: PIdAnsiChar; e : TIdC_INT) : TIdC_INT; + {$EXTERNALSYM EVP_DigestSignUpdate} +function EVP_DigestSignUpdate(a : PEVP_MD_CTX; b : Pointer; c : size_t) : TIdC_Int; + {$EXTERNALSYM EVP_DigestVerifyUpdate} +function EVP_DigestVerifyUpdate(a : PEVP_MD_CTX; b : Pointer; c : size_t) : TIdC_INT; +{$ifndef OPENSSL_NO_DES} + {$EXTERNALSYM EVP_des_cfb} +function EVP_des_cfb : PEVP_CIPHER; + {$EXTERNALSYM EVP_des_ede_cfb} +function EVP_des_ede_cfb: PEVP_CIPHER; + {$EXTERNALSYM EVP_des_ede3_cfb} +function EVP_des_ede3_cfb: PEVP_CIPHER; +{$endif} +{$ifndef OPENSSL_NO_IDEA} + {$EXTERNALSYM EVP_idea_cfb} +function EVP_idea_cfb: PEVP_CIPHER; +{$endif} +{$ifndef OPENSSL_NO_RC2} + {$EXTERNALSYM EVP_rc2_cfb} +function EVP_rc2_cfb: PEVP_CIPHER; +{$endif} +{$ifndef OPENSSL_NO_BF} + {$EXTERNALSYM EVP_bf_cfb} +function EVP_bf_cfb: PEVP_CIPHER; +{$endif} +{$ifndef OPENSSL_NO_CAST} + {$EXTERNALSYM EVP_cast5_cfb} +function EVP_cast5_cfb: PEVP_CIPHER; +{$endif} +{$ifndef OPENSSL_NO_RC5} + {$EXTERNALSYM EVP_rc5_32_12_16_cfb} +function EVP_rc5_32_12_16_cfb: PEVP_CIPHER; +{$endif} +{$ifndef OPENSSL_NO_AES} + {$EXTERNALSYM EVP_aes_128_cfb} +function EVP_aes_128_cfb: PEVP_CIPHER; + {$EXTERNALSYM EVP_aes_192_cfb} +function EVP_aes_192_cfb: PEVP_CIPHER; + {$EXTERNALSYM EVP_aes_256_cfb} +function EVP_aes_256_cfb: PEVP_CIPHER; +{$endif} +{$ifndef OPENSSL_NO_CAMELLIA} + {$EXTERNALSYM EVP_camellia_128_cfb} +function EVP_camellia_128_cfb: PEVP_CIPHER; + {$EXTERNALSYM EVP_camellia_192_cfb} +function EVP_camellia_192_cfb: PEVP_CIPHER; + {$EXTERNALSYM EVP_camellia_256_cfb} +function EVP_camellia_256_cfb: PEVP_CIPHER; +{$endif} +{$ifndef OPENSSL_NO_SEED} + {$EXTERNALSYM EVP_seed_cfb} +function EVP_seed_cfb: PEVP_CIPHER; +{$endif} + {$EXTERNALSYM EVP_PKEY_CTX_set_signature_md} +function EVP_PKEY_CTX_set_signature_md(ctx : PEVP_PKEY_CTX;md : PEVP_PKEY_CTX) : TIdC_INT; + {$EXTERNALSYM SSLeay_add_all_algorithms} +procedure SSLeay_add_all_algorithms; + {$EXTERNALSYM SSLeay_add_all_ciphers} +procedure SSLeay_add_all_ciphers; + {$EXTERNALSYM SSLeay_add_all_digests} +procedure SSLeay_add_all_digests; + + {$EXTERNALSYM X509V3_set_ctx_nodb} +procedure X509V3_set_ctx_nodb(ctx: X509V3_CTX); +// + {$EXTERNALSYM ErrMsg} +function ErrMsg(AErr : TIdC_ULONG) : string; + {$EXTERNALSYM ERR_PACK} +function ERR_PACK(l, f, r : TIdC_INT) : TIdC_ULONG; + {$EXTERNALSYM ERR_GET_LIB} +function ERR_GET_LIB(const l : TIdC_INT) : TIdC_ULONG; + {$EXTERNALSYM ERR_GET_FUNC} +function ERR_GET_FUNC(const l : TIdC_INT) : TIdC_ULONG; + {$EXTERNALSYM ERR_FATAL_ERROR} +function ERR_FATAL_ERROR(const l : TIdC_INT) : Boolean; + {$EXTERNALSYM ERR_GET_REASON} +function ERR_GET_REASON(const l : TIdC_INT) : TIdC_INT; + {$EXTERNALSYM SYSerr} +procedure SYSerr(const f,r : TIdC_INT); + {$EXTERNALSYM BNerr} +procedure BNerr(const f,r : TIdC_INT); + {$EXTERNALSYM RSAerr} +procedure RSAerr(const f,r : TIdC_INT); + {$EXTERNALSYM DHerrr} +procedure DHerrr(const f,r : TIdC_INT); + {$EXTERNALSYM EVPerr} +procedure EVPerr(const f,r : TIdC_INT); + {$EXTERNALSYM BUFerr} +procedure BUFerr(const f,r : TIdC_INT); + {$EXTERNALSYM OBJerr} +procedure OBJerr(const f,r : TIdC_INT); + {$EXTERNALSYM PEMerr} +procedure PEMerr(const f,r : TIdC_INT); + {$EXTERNALSYM DSAerr} +procedure DSAerr(const f,r : TIdC_INT); + {$EXTERNALSYM X509err} +procedure X509err(const f,r : TIdC_INT); + {$EXTERNALSYM ASN1err} +procedure ASN1err(const f,r : TIdC_INT); + {$EXTERNALSYM CONFerr} +procedure CONFerr(const f,r : TIdC_INT); + {$EXTERNALSYM CRYPTOerr} +procedure CRYPTOerr(const f,r : TIdC_INT); + {$EXTERNALSYM ECerr} +procedure ECerr(const f,r : TIdC_INT); + {$EXTERNALSYM SSLerr} +procedure SSLerr(const f,r : TIdC_INT); + {$EXTERNALSYM BIOerr} +procedure BIOerr(const f,r : TIdC_INT); + {$EXTERNALSYM PKCS7err} +procedure PKCS7err(const f,r : TIdC_INT); + {$EXTERNALSYM X509V3err} +procedure X509V3err(const f,r : TIdC_INT); + {$EXTERNALSYM PKCS12err} +procedure PKCS12err(const f,r : TIdC_INT); + {$EXTERNALSYM RANDerr} +procedure RANDerr(const f,r : TIdC_INT); + {$EXTERNALSYM DSOerr} +procedure DSOerr(const f,r : TIdC_INT); + {$EXTERNALSYM ENGINEerr} +procedure ENGINEerr(const f,r : TIdC_INT); + {$EXTERNALSYM OCSPerr} +procedure OCSPerr(const f,r : TIdC_INT); + {$EXTERNALSYM UIerr} +procedure UIerr(const f,r : TIdC_INT); + {$EXTERNALSYM COMPerr} +procedure COMPerr(const f,r : TIdC_INT); + {$EXTERNALSYM ECDSAerr} +procedure ECDSAerr(const f,r : TIdC_INT); + {$EXTERNALSYM ECDHerr} +procedure ECDHerr(const f,r : TIdC_INT); + {$EXTERNALSYM STOREerr} +procedure STOREerr(const f,r : TIdC_INT); + {$EXTERNALSYM FIPSerr} +procedure FIPSerr(const f,r : TIdC_INT); + {$EXTERNALSYM CMSerr} +procedure CMSerr(const f,r : TIdC_INT); + {$EXTERNALSYM TSerr} +procedure TSerr(const f,r : TIdC_INT); + {$EXTERNALSYM HMACerr} +procedure HMACerr(const f,r : TIdC_INT); + {$EXTERNALSYM JPAKEerr} +procedure JPAKEerr(const f,r : TIdC_INT); + {$EXTERNALSYM X509_LOOKUP_load_file} +function X509_LOOKUP_load_file(x : PX509_LOOKUP; name : PIdAnsiChar; _type : TIdC_LONG) : TIdC_INT; + {$EXTERNALSYM X509_LOOKUP_add_dir} +function X509_LOOKUP_add_dir(x : PX509_LOOKUP; name : PIdAnsiChar; _type : TIdC_LONG) : TIdC_INT; + +type +//moved from IdSSLOpenSSL so we can use these classes in other places + EIdOpenSSLError = class(EIdException); + TIdOpenSSLAPISSLError = class of EIdOpenSSLAPISSLError; + + EIdOpenSSLAPISSLError = class(EIdOpenSSLError) + protected + FErrorCode : TIdC_INT; + FRetCode : TIdC_INT; + public + class procedure RaiseException(ASSL: Pointer; const ARetCode : TIdC_INT; const AMsg : String = ''); + class procedure RaiseExceptionCode(const AErrCode, ARetCode : TIdC_INT; const AMsg : String = ''); + property ErrorCode : TIdC_INT read FErrorCode; + property RetCode : TIdC_INT read FRetCode; + end; + + TIdOpenSSLAPICryptoError = class of EIdOpenSSLAPICryptoError; + EIdOpenSSLAPICryptoError = class(EIdOpenSSLError) + protected + FErrorCode : TIdC_ULONG; + public + class procedure RaiseExceptionCode(const AErrCode : TIdC_ULONG; const AMsg : String = ''); + class procedure RaiseException(const AMsg : String = ''); + property ErrorCode : TIdC_ULONG read FErrorCode; + end; + EIdOSSLUnderlyingCryptoError = class(EIdOpenSSLAPICryptoError); + + EIdDigestError = class(EIdOpenSSLAPICryptoError); + EIdDigestFinalEx = class(EIdDigestError); + EIdDigestInitEx = class(EIdDigestError); + EIdDigestUpdate = class(EIdDigestError); + +function IsOpenSSL_1x : Boolean; +function IsOpenSSL_SSLv2_Available : Boolean; +function IsOpenSSL_SSLv3_Available : Boolean; +function IsOpenSSL_SSLv23_Available : Boolean; +function IsOpenSSL_TLSv1_0_Available : Boolean; +function IsOpenSSL_TLSv1_1_Available : Boolean; +function IsOpenSSL_TLSv1_2_Available : Boolean; +function IsOpenSSL_DTLSv1_Available : Boolean; + +// RLebeau: should these be declared as EXTERNALSYM? +procedure RAND_cleanup; +function RAND_bytes(buf : PIdAnsiChar; num : integer) : integer; +function RAND_pseudo_bytes(buf : PIdAnsiChar; num : integer) : integer; +procedure RAND_seed(buf : PIdAnsiChar; num : integer); +procedure RAND_add(buf : PIdAnsiChar; num : integer; entropy : integer); +function RAND_status() : integer; +{$IFDEF SYS_WIN} +function RAND_event(iMsg : UINT; wp : wparam; lp : lparam) : integer; +procedure RAND_screen(); +{$ENDIF} + +implementation + +uses + Classes, + IdFIPS, + IdGlobalProtocols, + IdResourceStringsProtocols, + IdResourceStringsOpenSSL, + IdStack + {$IFDEF FPC} + {$IFNDEF WINDOWS} + , DynLibs // needed for FreeLibrary + {$ENDIF} + {$ENDIF}; + +{$IFNDEF OPENSSL_NO_HMAC} +procedure HMAC_Init_ex(ctx : PHMAC_CTX; key : Pointer; len : TIdC_INT; + md : PEVP_MD; impl : PENGINE); + {$IFDEF USE_INLINE} inline; {$ENDIF} +begin + if Assigned(_HMAC_Init_ex) then begin + _HMAC_Init_ex(ctx, key, len, md, impl ); + end else begin + if Assigned(_1_0_HMAC_Init_ex) then begin + _1_0_HMAC_Init_ex(ctx, key, len, md, impl ); + end; + end; +end; + +procedure HMAC_Update(ctx : PHMAC_CTX; data : PIdAnsiChar; len : size_t); + {$IFDEF USE_INLINE} inline; {$ENDIF} +begin + if Assigned(_HMAC_Update) then begin + _HMAC_Update(ctx, data, len ); + end else begin + if Assigned(_1_0_HMAC_Update) then begin + _1_0_HMAC_Update(ctx, data, len ); + end; + end; +end; + +procedure HMAC_Final(ctx : PHMAC_CTX; md : PIdAnsiChar; len : PIdC_UINT); + {$IFDEF USE_INLINE} inline; {$ENDIF} +begin + if Assigned(_HMAC_Final) then begin + _HMAC_Final(ctx, md, len ); + end else begin + if Assigned(_1_0_HMAC_Update) then begin + _1_0_HMAC_Final(ctx, md, len ); + end; + end; +end; +{$ENDIF} + +function IsOpenSSL_1x : Boolean; + {$IFDEF USE_INLINE} inline; {$ENDIF} +begin + if Assigned( SSLeay ) then begin + Result := (SSLeay and $F0000000) = $10000000; + end else begin + Result := False; + end; +end; + +function IsOpenSSL_SSLv2_Available : Boolean; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := Assigned(SSLv2_method) and + Assigned(SSLv2_server_method) and + Assigned(SSLv2_client_method); +end; + +function IsOpenSSL_SSLv3_Available : Boolean; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := Assigned(SSLv3_method) and + Assigned(SSLv3_server_method) and + Assigned(SSLv3_client_method); +end; + +function IsOpenSSL_SSLv23_Available : Boolean; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := Assigned(SSLv23_method) and + Assigned(SSLv23_server_method) and + Assigned(SSLv23_client_method); +end; + +function IsOpenSSL_TLSv1_0_Available : Boolean; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := Assigned(TLSv1_method) and + Assigned(TLSv1_server_method) and + Assigned(TLSv1_client_method); +end; + +function IsOpenSSL_TLSv1_1_Available : Boolean; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := Assigned(TLSv1_1_method) and + Assigned(TLSv1_1_server_method) and + Assigned(TLSv1_1_client_method); +end; + +function IsOpenSSL_TLSv1_2_Available : Boolean; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := Assigned(TLSv1_2_method) and + Assigned(TLSv1_2_server_method) and + Assigned(TLSv1_2_client_method); +end; + +function IsOpenSSL_DTLSv1_Available : Boolean; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := Assigned(DTLSv1_method) and + Assigned(DTLSv1_server_method) and + Assigned(DTLSv1_client_method); +end; + +//**************** FIPS Support backend ******************* +function OpenSSLIsHashingIntfAvail : Boolean; +begin + Result := Assigned(EVP_DigestInit_ex) and + Assigned(EVP_DigestUpdate) and + Assigned(EVP_DigestFinal_ex) ; +end; + +function OpenSSLGetFIPSMode : Boolean; +begin + Result := FIPS_mode <> 0; +end; + +function OpenSSLSetFIPSMode(const AMode : Boolean) : Boolean; +begin + //leave this empty as we may not be using something that supports FIPS + if AMode then begin + Result := FIPS_mode_set(1) = 1; + end else begin + Result := FIPS_mode_set(0) = 1; + end; +end; + +function OpenSSLGetDigestCtx( AInst : PEVP_MD) : TIdHashIntCtx; + {$IFDEF USE_INLINE} inline; {$ENDIF} +var LRet : Integer; +begin + Result := AllocMem(SizeOf(EVP_MD_CTX)); + EVP_MD_CTX_init(Result); + + LRet := EVP_DigestInit_ex(Result, AInst, nil); + if LRet <> 1 then begin + EIdDigestInitEx.RaiseException('EVP_DigestInit_ex error'); + end; +end; + +function OpenSSLIsMD2HashIntfAvail: Boolean; +begin + {$IFDEF OPENSSL_NO_MD2} + Result := False; + {$ELSE} + Result := Assigned(EVP_md2); + {$ENDIF} +end; + +function OpenSSLGetMD2HashInst : TIdHashIntCtx; +{$IFNDEF OPENSSL_NO_MD2} +var + LRet : PEVP_MD; +{$ENDIF} +begin + {$IFDEF OPENSSL_NO_MD2} + Result := nil; + {$ELSE} + LRet := EVP_md2; + Result := OpenSSLGetDigestCtx(LRet); + {$ENDIF} +end; + +function OpenSSLIsMD4HashIntfAvail: Boolean; +begin + Result := Assigned(EVP_md4); +end; + +function OpenSSLGetMD4HashInst : TIdHashIntCtx; +var + LRet : PEVP_MD; +begin + LRet := EVP_md4; + Result := OpenSSLGetDigestCtx(LRet); +end; + +function OpenSSLIsMD5HashIntfAvail: Boolean; +begin + Result := Assigned(EVP_md5); +end; + +function OpenSSLGetMD5HashInst : TIdHashIntCtx; +var + LRet : PEVP_MD; +begin + LRet := EVP_md5; + Result := OpenSSLGetDigestCtx(LRet); +end; + +function OpenSSLIsSHA1HashIntfAvail: Boolean; +begin + {$IFDEF OPENSSL_NO_SHA} + Result := False; + {$ELSE} + Result := Assigned(EVP_sha1); + {$ENDIF} +end; + +function OpenSSLGetSHA1HashInst : TIdHashIntCtx; +{$IFNDEF OPENSSL_NO_SHA} +var + LRet : PEVP_MD; +{$ENDIF} +begin + {$IFDEF OPENSSL_NO_SHA} + Result := nil; + {$ELSE} + LRet := EVP_sha1; + Result := OpenSSLGetDigestCtx(LRet); + {$ENDIF} +end; + +function OpenSSLIsSHA224HashIntfAvail: Boolean; +begin + {$IFDEF OPENSSL_NO_SHA256} + Result := False; + {$ELSE} + Result := Assigned(EVP_sha224); + {$ENDIF} +end; + +function OpenSSLGetSHA224HashInst : TIdHashIntCtx; +{$IFNDEF OPENSSL_NO_SHA256} +var + LRet : PEVP_MD; +{$ENDIF} +begin + {$IFDEF OPENSSL_NO_SHA256} + Result := nil; + {$ELSE} + LRet := EVP_sha224; + Result := OpenSSLGetDigestCtx(LRet); + {$ENDIF} +end; + +function OpenSSLIsSHA256HashIntfAvail: Boolean; +begin + {$IFDEF OPENSSL_NO_SHA256} + Result := False; + {$ELSE} + Result := Assigned(EVP_sha256); + {$ENDIF} +end; + +function OpenSSLGetSHA256HashInst : TIdHashIntCtx; +{$IFNDEF OPENSSL_NO_SHA256} +var + LRet : PEVP_MD; +{$ENDIF} +begin + {$IFDEF OPENSSL_NO_SHA256} + Result := nil; + {$ELSE} + LRet := EVP_sha256; + Result := OpenSSLGetDigestCtx(LRet); + {$ENDIF} +end; + +function OpenSSLIsSHA384HashIntfAvail: Boolean; +begin + {$IFDEF OPENSSL_NO_SHA512} + Result := False; + {$ELSE} + Result := Assigned(EVP_sha384); + {$ENDIF} +end; + +function OpenSSLGetSHA384HashInst : TIdHashIntCtx; +{$IFNDEF OPENSSL_NO_SHA512} +var + LRet : PEVP_MD; +{$ENDIF} +begin + {$IFDEF OPENSSL_NO_SHA512} + Result := nil; + {$ELSE} + LRet := EVP_sha384; + Result := OpenSSLGetDigestCtx(LRet); + {$ENDIF} +end; + +function OpenSSLIsSHA512HashIntfAvail: Boolean; +begin + {$IFDEF OPENSSL_NO_SHA512} + Result := nil; + {$ELSE} + Result := Assigned(EVP_sha512); + {$ENDIF} +end; + +function OpenSSLGetSHA512HashInst : TIdHashIntCtx; +{$IFNDEF OPENSSL_NO_SHA512} +var + LRet : PEVP_MD; +{$ENDIF} +begin + {$IFDEF OPENSSL_NO_SHA512} + Result := nil; + {$ELSE} + LRet := EVP_sha512; + Result := OpenSSLGetDigestCtx(LRet); +{$ENDIF} +end; + +procedure OpenSSLUpdateHashInst(ACtx: TIdHashIntCtx; const AIn: TIdBytes); +var + LRet : TIdC_Int; +begin + LRet := EVP_DigestUpdate(ACtx, PByte(Ain), Length(AIn)); + if LRet <> 1 then begin + EIdDigestInitEx.RaiseException('EVP_DigestUpdate error'); + end; +end; + +function OpenSSLFinalHashInst(ACtx: TIdHashIntCtx): TIdBytes; +var + LLen : TIdC_UInt; + LRet : TIdC_Int; +begin + SetLength(Result,EVP_MAX_MD_SIZE); + LRet := EVP_DigestFinal_ex(ACtx, PIdAnsiChar(@Result[0]), LLen); + if LRet <> 1 then begin + EIdDigestFinalEx.RaiseException('EVP_DigestFinal_ex error'); + end; + SetLength(Result,LLen); + EVP_MD_CTX_cleanup(ACtx); + FreeMem(ACtx,SizeOf(EVP_MD_CTX)); +end; + +function OpenSSLIsHMACAvail : Boolean; +begin + {$IFDEF OPENSSL_NO_HMAC} + Result := False; + {$ELSE} + Result := Assigned(HMAC_CTX_init) and + ( Assigned(_HMAC_Init_ex) or Assigned(_1_0_HMAC_Init_ex) ) and + ( Assigned(_HMAC_Update) or Assigned(_1_0_HMAC_Update) ) and + ( Assigned(_HMAC_Final) or Assigned(_1_0_HMAC_Final) ) and + Assigned(HMAC_CTX_cleanup); + {$ENDIF} +end; + +function OpenSSLIsHMACMD5Avail: Boolean; +begin + {$IFDEF OPENSSL_NO_MD5} + Result := False; + {$ELSE} + Result := Assigned(EVP_md5); + {$ENDIF} +end; + +function OpenSSLGetHMACMD5Inst(const AKey : TIdBytes) : TIdHMACIntCtx; +begin + {$IFDEF OPENSSL_NO_MD5} + Result := nil; + {$ELSE} + Result := AllocMem(SizeOf(HMAC_CTX)); + HMAC_CTX_init(Result); + HMAC_Init_ex(Result, PByte(AKey), Length(AKey), EVP_md5, nil); + {$ENDIF} +end; + +function OpenSSLIsHMACSHA1Avail: Boolean; +begin + {$IFDEF OPENSSL_NO_SHA} + Result := False; + {$ELSE} + Result := Assigned(EVP_sha1); + {$ENDIF} +end; + +function OpenSSLGetHMACSHA1Inst(const AKey : TIdBytes) : TIdHMACIntCtx; +begin + {$IFDEF OPENSSL_NO_SHA} + Result := nil; + {$ELSE} + Result := AllocMem(SizeOf(HMAC_CTX)); + HMAC_CTX_init(Result); + HMAC_Init_ex(Result, PByte(AKey), Length(AKey), EVP_sha1, nil); + {$ENDIF} +end; + +function OpenSSLIsHMACSHA224Avail: Boolean; + +begin + {$IFDEF OPENSSL_NO_SHA256} + Result := False; + {$ELSE} + Result := Assigned(EVP_sha224); + {$ENDIF} +end; + +function OpenSSLGetHMACSHA224Inst(const AKey : TIdBytes) : TIdHMACIntCtx; +begin + {$IFDEF OPENSSL_NO_SHA256} + Result := nil; + {$ELSE} + Result := AllocMem(SizeOf(HMAC_CTX)); + HMAC_CTX_init(Result); + HMAC_Init_ex(Result, PByte(AKey), Length(AKey), EVP_sha224, nil); + {$ENDIF} +end; + +function OpenSSLIsHMACSHA256Avail: Boolean; +begin + {$IFDEF OPENSSL_NO_SHA256} + Result := False; + {$ELSE} + Result := Assigned(EVP_sha256); + {$ENDIF} +end; + +function OpenSSLGetHMACSHA256Inst(const AKey : TIdBytes) : TIdHMACIntCtx; +begin + {$IFDEF OPENSSL_NO_SHA256} + Result := nil; + {$ELSE} + Result := AllocMem(SizeOf(HMAC_CTX)); + HMAC_CTX_init(Result); + HMAC_Init_ex(Result, PByte(AKey), Length(AKey), EVP_sha256, nil); + {$ENDIF} +end; + +function OpenSSLIsHMACSHA384Avail: Boolean; +begin + {$IFDEF OPENSSL_NO_SHA512} + Result := False; + {$ELSE} + Result := Assigned(EVP_sha384); + {$ENDIF} +end; + +function OpenSSLGetHMACSHA384Inst(const AKey : TIdBytes) : TIdHMACIntCtx; +begin + {$IFDEF OPENSSL_NO_SHA512} + Result := nil; + {$ELSE} + Result := AllocMem(SizeOf(HMAC_CTX)); + HMAC_CTX_init(Result); + HMAC_Init_ex(Result, PByte(AKey), Length(AKey), EVP_sha384, nil); + {$ENDIF} +end; + +function OpenSSLIsHMACSHA512Avail: Boolean; +begin + {$IFDEF OPENSSL_NO_SHA512} + Result := False; + {$ELSE} + Result := Assigned(EVP_sha512); + {$ENDIF} +end; + +function OpenSSLGetHMACSHA512Inst(const AKey : TIdBytes) : TIdHMACIntCtx; +begin + {$IFDEF OPENSSL_NO_SHA512} + Result := nil; + {$ELSE} + Result := AllocMem(SizeOf(HMAC_CTX)); + HMAC_CTX_init(Result); + HMAC_Init_ex(Result, PByte(AKey), Length(AKey), EVP_sha512, nil); + {$ENDIF} +end; + +procedure OpenSSLUpdateHMACInst(ACtx : TIdHMACIntCtx; const AIn: TIdBytes); +begin + HMAC_Update(ACtx, PIdAnsiChar(PByte(AIn)), Length(AIn)); +end; + +function OpenSSLFinalHMACInst(ACtx: TIdHMACIntCtx): TIdBytes; +var + LLen : TIdC_UInt; +begin + LLen := EVP_MAX_MD_SIZE; + SetLength(Result,LLen); + HMAC_Final(ACtx, PIdAnsiChar(@Result[0]), @LLen); + SetLength(Result,LLen); + HMAC_CTX_cleanup(ACtx); + FreeMem(ACtx,SizeOf(HMAC_CTX)); +end; + +function LoadOpenSSL: Boolean; +begin + Result := Load; +end; + +//**************************************************** +function FIPS_mode_set(onoff : TIdC_INT) : TIdC_INT; {$IFDEF INLINE}inline;{$ENDIF} +begin + Result := 0; + {$IFDEF OPENSSL_FIPS} + if Assigned(_FIPS_mode_set) then begin + Result := _FIPS_mode_set(onoff); + end; + {$ENDIF} +end; + +function FIPS_mode() : TIdC_INT; {$IFDEF INLINE}inline;{$ENDIF} +begin + Result := 0; + {$IFDEF OPENSSL_FIPS} + if Assigned(_FIPS_mode) then begin + Result := _FIPS_mode; + end; + {$ENDIF} +end; + +function GetErrorMessage(const AErr : TIdC_ULONG) : String; +{$IFDEF USE_INLINE} inline; {$ENDIF} +const + sMaxErrMsg = 160; +var + LErrMsg: array [0..sMaxErrMsg] of TIdAnsiChar; + {$IFDEF USE_MARSHALLED_PTRS} + LErrMsgPtr: TPtrWrapper; + {$ENDIF} +begin + {$IFDEF USE_MARSHALLED_PTRS} + LErrMsgPtr := TPtrWrapper.Create(@LErrMsg[0]); + {$ENDIF} + ERR_error_string_n(AErr, + {$IFDEF USE_MARSHALLED_PTRS} + LErrMsgPtr.ToPointer + {$ELSE} + LErrMsg + {$ENDIF}, sMaxErrMsg); + LErrMsg[sMaxErrMsg] := TIdAnsiChar(0); + {$IFDEF USE_MARSHALLED_PTRS} + Result := TMarshal.ReadStringAsAnsi(LErrMsgPtr); + {$ELSE} + Result := String(LErrMsg); + {$ENDIF} +end; + +{ EIdOpenSSLAPICryptoError } +class procedure EIdOpenSSLAPICryptoError.RaiseException(const AMsg : String = ''); +begin + RaiseExceptionCode(ERR_get_error(), AMsg); +end; + +class procedure EIdOpenSSLAPICryptoError.RaiseExceptionCode( + const AErrCode: TIdC_ULONG; const AMsg: String); +var + LMsg: String; + LException : EIdOpenSSLAPICryptoError; +begin + if AMsg <> '' then begin + LMsg := AMsg + sLineBreak + String(GetErrorMessage(AErrCode)); + end else begin + LMsg := String(GetErrorMessage(AErrCode)); + end; + LException := Create(LMsg); + LException.FErrorCode := AErrCode; + raise LException; +end; + +{ EIdOpenSSLAPISSLError } + +class procedure EIdOpenSSLAPISSLError.RaiseException(ASSL: Pointer; const ARetCode: TIdC_INT; + const AMsg: String); +begin + RaiseExceptionCode(SSL_get_error(PSSL(ASSL), ARetCode), ARetCode, AMsg); +end; + +class procedure EIdOpenSSLAPISSLError.RaiseExceptionCode(const AErrCode, ARetCode: TIdC_INT; + const AMsg: String); +var + LErrQueue : TIdC_ULONG; + LException : EIdOpenSSLAPISSLError; + LErrStr : String; +begin + if AMsg <> '' then begin + LErrStr := AMsg + sLineBreak; + end else begin + LErrStr := ''; + end; + case AErrCode of + SSL_ERROR_SYSCALL : + begin + LErrQueue := ERR_get_error; + if LErrQueue <> 0 then begin + EIdOSSLUnderlyingCryptoError.RaiseExceptionCode(LErrQueue, AMsg); + end; + if ARetCode = 0 then begin + LException := Create(LErrStr + RSSSLEOFViolation); + LException.FErrorCode := AErrCode; + LException.FRetCode := ARetCode; + raise LException; + end; + {Note that if LErrQueue returns 0 and ARetCode = -1, there probably + is an error in the underlying socket so you should raise a socket error} + if ARetCode = -1 then begin + // TODO: catch the socket exception and re-raise it as the InnerException + // for an EIdOpenSSLAPISSLError exception... + GStack.RaiseLastSocketError; + end; + end; + SSL_ERROR_SSL : begin + EIdOSSLUnderlyingCryptoError.RaiseException(AMsg); + end + end; + // everything else... + LException := Create(LErrStr + String(GetErrorMessage(AErrCode))); + LException.FErrorCode := AErrCode; + LException.FRetCode := ARetCode; + raise LException; +end; + +type + TRAND_bytes = function(buf : PIdAnsiChar; num : integer) : integer; cdecl; + TRAND_pseudo_bytes = function(buf : PIdAnsiChar; num : integer) : integer; cdecl; + TRAND_seed = procedure(buf : PIdAnsiChar; num : integer); cdecl; + TRAND_add = procedure(buf : PIdAnsiChar; num : integer; entropy : integer); cdecl; + TRAND_status = function() : integer; cdecl; + {$IFDEF SYS_WIN} + TRAND_event = function(iMsg : UINT; wp : wparam; lp : lparam) : integer; cdecl; + {$ENDIF} + TRAND_cleanup = procedure; cdecl; + +{$IFDEF STATICLOAD_OPENSSL} +const + SSL_LIB_name = 'libssl.a'; {Do not Localize} + SSLCLIB_LIB_name = 'libcrypto.a'; {Do not Localize} +{$ELSE} + {$IFDEF UNIX} +const + {This is a workaround for some Linux distributions and a few other things + where the symbolic link libbsl.so and libcrypto.so do not exist} + SSL_DLL_name = 'libssl'; {Do not localize} + SSLCLIB_DLL_name = 'libcrypto'; {Do not localize} + SSLDLLVers : array [0..10] of string = ( + '.10', + '.1.0.2','.1.0.1', + // TODO: IFDEF the following for OSX only? + '.44', // MacOS LibreSSL forked from which OpenSSL version? Sometimes found ... + '.43', // MacOS LibreSSL forked from which OpenSSL version? Sometimes found ... + // TODO: Add '.41' as well? + '.35', // MacOS LibreSSL forked from OpenSSL version 1.0.1, almost always found + // + '.1.0.0','.0.9.9','.0.9.8','.0.9.7','.0.9.6' + ); + SSLDLLVersChar : array [0..26] of string = ('','a','b','c','d','e','f','g','h','i', + 'j','k','l','m','n','o','p','q','r', + 's','t','u','v','w','x','y','z'); + {$ENDIF} + {$IFDEF WINDOWS} +const + SSL_DLL_name = 'ssleay32.dll'; {Do not localize} + //The following is a workaround for an alternative name for + //one of the OpenSSL .DLL's. If you compile the .DLL's using + //mingw32, the SSL .dll might be named 'libssl32.dll' instead of + //ssleay32.dll like you would expect. + SSL_DLL_name_alt = 'libssl32.dll'; {Do not localize} + SSLCLIB_DLL_name = 'libeay32.dll'; {Do not localize} + {$ENDIF} +{$ENDIF} + +var + {$IFDEF STATICLOAD_OPENSSL} + bIsLoaded : Boolean = False; + {$ELSE} + hIdSSL : TIdLibHandle = IdNilHandle; + hIdCrypto : TIdLibHandle = IdNilHandle; + FFailedLoadList : TStringList; + {$ENDIF} + + _RAND_cleanup : TRAND_cleanup = nil; + _RAND_bytes : TRAND_bytes = nil; + _RAND_pseudo_bytes : TRAND_pseudo_bytes = nil; + _RAND_seed : TRAND_seed = nil; + _RAND_add : TRAND_add = nil; + _RAND_status : TRAND_status = nil; + {$IFDEF SYS_WIN} + // LIBEAY functions - open SSL 0.9.6a + _RAND_screen : procedure cdecl = nil; + _RAND_event : TRAND_event = nil; + {$ENDIF} + +{$IFNDEF STATICLOAD_OPENSSL} +function GetSSLLibHandle : TIdLibHandle; +begin + Result := hIdSSL; +end; + +function GetCryptLibHandle : TIdLibHandle; +begin + Result := hIdCrypto; +end; + +{ This constant's are used twice. First time in Load function and second time } {Do not localize} +{ in function WhichFailedToLoad. I belive that this reduce size of final } +{ compiled file. } +const +{most of these are commented out because we aren't using them now. I am keeping +them in case we use them later.} + fn_sk_num = 'sk_num'; {Do not localize} + fn_sk_value = 'sk_value'; {Do not localize} + {CH fn_sk_set = 'sk_set'; } {Do not localize} + fn_sk_new = 'sk_new'; {Do not localize} + fn_sk_new_null = 'sk_new_null'; {Do not localize} + fn_sk_free = 'sk_free'; {Do not localize} + fn_sk_pop_free = 'sk_pop_free'; {Do not localize} + {CH fn_sk_insert = 'sk_insert'; } {Do not localize} + {CH fn_sk_delete = 'sk_delete'; } {Do not localize} + {CH fn_sk_delete_ptr = 'sk_delete_ptr'; } {Do not localize} + fn_sk_find = 'sk_find'; {Do not localize} + fn_sk_push = 'sk_push'; {Do not localize} + {CH fn_sk_unshift = 'sk_unshift'; } {Do not localize} + {CH fn_sk_shift = 'sk_shift'; } {Do not localize} + {CH fn_sk_pop = 'sk_pop'; } {Do not localize} + {CH fn_sk_zero = 'sk_zero'; } {Do not localize} + fn_sk_dup = 'sk_dup'; {Do not localize} + {CH fn_sk_sort = 'sk_sort'; } {Do not localize} + fn_SSLeay_version = 'SSLeay_version'; {Do not localize} + fn_SSLeay = 'SSLeay'; {Do not localize} + {CH fn_OPENSSL_issetugid = 'OPENSSL_issetugid'; }{Do not localize} + {CH fn_CONF_set_default_method = 'CONF_set_default_method'; } {Do not localize} + {CH fn_CONF_set_nconf = 'CONF_set_nconf'; } {Do not localize} + {CH fn_CONF_load = 'CONF_load'; } {Do not localize} +{$IFNDEF OPENSSL_NO_FP_API} + {CH fn_CONF_load_fp = 'CONF_load_fp'; } {Do not localize} +{$ENDIF} + {CH fn_CONF_load_bio = 'CONF_load_bio'; } {Do not localize} + {CH fn_CONF_get_section = 'CONF_get_section'; } {Do not localize} + {CH fn_CONF_get_string = 'CONF_get_string'; } {Do not localize} + {CH fn_CONF_get_number = 'CONF_get_number'; } {Do not localize} + {CH fn_CONF_free = 'CONF_free'; }{Do not localize} + {CH fn_CONF_dump_fp = 'CONF_dump_fp'; } {Do not localize} + {CH fn_CONF_dump_bio = 'CONF_dump_bio'; } {Do not localize} + {CH fn_NCONF_new = 'NCONF_new'; } {Do not localize} + {CH fn_NCONF_default = 'NCONF_default'; } {Do not localize} + {CH fn_NCONF_WIN32 = 'NCONF_WIN32'; } {Do not localize} +{$IFDEF OMIT_THIS} //* Just to give you an idea of what I have in mind */ + {CH fn_NCONF_XML = 'NCONF_XML''; } {Do not localize} +{$ENDIF} + {CH fn_NCONF_free = 'NCONF_free'; } {Do not localize} + {CH fn_NCONF_free_data = 'NCONF_free_data'; } {Do not localize} + {CH fn_NCONF_load = 'NCONF_load'; } {Do not localize} +{$IFNDEF OPENSSL_NO_FP_API} + {CH fn_NCONF_load_fp = 'NCONF_load_fp'; }{Do not localize} +{$ENDIF} + {CH fn_NCONF_load_bio = 'NCONF_load_bio'; } {Do not localize} + {CH fn_NCONF_get_section = 'NCONF_get_section'; } {Do not localize} + {CH fn_NCONF_get_string = 'NCONF_get_string'; } {Do not localize} + {CH fn_NCONF_get_number_e = 'NCONF_get_number_e'; } {Do not localize} + {CH fn_NCONF_dump_fp = 'NCONF_dump_fp'; } {Do not localize} + {CH fn_NCONF_dump_bio = 'NCONF_dump_bio'; }{Do not localize} + {CH fn_CONF_modules_load = 'CONF_modules_load'; } {Do not localize} + {CH fn_CONF_modules_load_file = 'CONF_modules_load_file'; } {Do not localize} + {CH fn_CONF_modules_unload = 'CONF_modules_unload'; } {Do not localize} + {CH fn_CONF_modules_finish = 'CONF_modules_finish'; } {Do not localize} + {CH fn_CONF_modules_free = 'CONF_modules_free'; } {Do not localize} + {CH fn_CONF_module_add = 'CONF_module_add'; } {Do not localize} + {CH fn_CONF_imodule_get_name = 'CONF_imodule_get_name'; } {Do not localize} + {CH fn_CONF_imodule_get_value = 'CONF_imodule_get_value'; } {Do not localize} + {CH fn_CONF_imodule_get_usr_data = 'CONF_imodule_get_usr_data'; } {Do not localize} + {CH fn_CONF_imodule_set_usr_data = 'CONF_imodule_set_usr_data'; } {Do not localize} + {CH fn_CONF_imodule_get_module = 'CONF_imodule_get_module'; } {Do not localize} + {CH fn_CONF_imodule_get_flags = 'CONF_imodule_get_flags'; } {Do not localize} + {CH fn_CONF_imodule_set_flags = 'CONF_imodule_set_flags'; } {Do not localize} + {CH fn_CONF_module_get_usr_data = 'CONF_module_get_usr_data'; } {Do not localize} + {CH fn_CONF_module_set_usr_data = 'CONF_module_set_usr_data'; } {Do not localize} + {CH fn_ERR_load_CONF_strings = 'ERR_load_CONF_strings'; } {Do not localize} + {CH fn_CONF_get1_default_config_file = 'CONF_get1_default_config_file'; } {Do not localize} + {CH fn_CONF_parse_list = 'CONF_parse_list' ; } + {CH fn_OPENSSL_load_builtin_modules = 'OPENSSL_load_builtin_modules'; } {Do not localize} + {CH fn_CRYPTO_get_ex_new_index = 'CRYPTO_get_ex_new_index'; } {Do not localize} + {CH fn_CRYPTO_set_ex_data = 'CRYPTO_set_ex_data'; } {Do not localize} + {CH fn_CRYPTO_get_ex_data = 'CRYPTO_get_ex_data'; } {Do not localize} + {CH fn_CRYPTO_dup_ex_data = 'CRYPTO_dup_ex_data'; } {Do not localize} + {CH fn_CRYPTO_free_ex_data = 'CRYPTO_free_ex_data'; } {Do not localize} + {CH fn_CRYPTO_new_ex_data = 'CRYPTO_new_ex_data'; } {Do not localize} + fn_CRYPTO_mem_ctrl = 'CRYPTO_mem_ctrl'; {Do not localize} + {CH fn_OPENSSL_issetugid = 'OPENSSL_issetugid'; } {Do not localize} + {CH fn_CRYPTO_get_ex_data_implementation = 'CRYPTO_get_ex_data_implementation'; } {Do not localize} + {CH fn_CRYPTO_set_ex_data_implementation = 'CRYPTO_set_ex_data_implementation'; } {Do not localize} + {CH fn_CRYPTO_ex_data_new_class = 'CRYPTO_ex_data_new_class'; } {Do not localize} + {CH fn_CRYPTO_get_locking_callback = 'CRYPTO_get_locking_callback'; } {Do not localize} + {CH fn_CRYPTO_get_add_lock_callback = 'CRYPTO_get_add_lock_callback'; } {Do not localize} + {CH fn_CRYPTO_get_new_dynlockid = 'CRYPTO_get_new_dynlockid'; } {Do not localize} + {CH fn_CRYPTO_destroy_dynlockid = 'CRYPTO_destroy_dynlockid'; } {Do not localize} + {CH fn_CRYPTO_get_dynlock_value = 'CRYPTO_get_dynlock_value'; } {Do not localize} + {CH fn_CRYPTO_set_dynlock_create_callback = 'CRYPTO_set_dynlock_create_callback'; } {Do not localize} + {CH fn_CRYPTO_set_dynlock_lock_callback = 'CRYPTO_set_dynlock_lock_callback'; } {Do not localize} + {CH fn_CRYPTO_set_dynlock_destroy_callback = 'CRYPTO_set_dynlock_destroy_callback'; } {Do not localize} + {CH fn_CRYPTO_set_locked_mem_ex_functions = 'CRYPTO_set_locked_mem_ex_functions'; } {Do not localize} + {CH fn_CRYPTO_get_mem_ex_functions = 'CRYPTO_get_mem_ex_functions'; } {Do not localize} + {CH fn_CRYPTO_get_locked_mem_ex_functions = 'CRYPTO_get_locked_mem_ex_functions'; } {Do not localize} + {CH fn_CRYPTO_get_mem_debug_functions = 'CRYPTO_get_mem_debug_functions'; }{Do not localize} + {CH fn_CRYPTO_realloc_clean = 'CRYPTO_realloc_clean'; } {Do not localize} + {CH fn_OPENSSL_cleanse = 'OPENSSL_cleanse'; } {Do not localize} + {CH fn_CRYPTO_set_mem_debug_options = 'CRYPTO_set_mem_debug_options'; } {Do not localize} + {CH fn_CRYPTO_get_mem_debug_options = 'CRYPTO_get_mem_debug_options'; } {Do not localize} + {CH fn_CRYPTO_push_info_ = 'CRYPTO_push_info_'; } {Do not localize} + {CH fn_CRYPTO_pop_info = 'CRYPTO_pop_info'; } {Do not localize} + {CH fn_CRYPTO_remove_all_info = 'CRYPTO_remove_all_info'; } {Do not localize} + {CH fn_OpenSSLDie = 'OpenSSLDie'; } {Do not localize} + {CH fn_OPENSSL_ia32cap_loc = 'OPENSSL_ia32cap_loc'; } {Do not localize} + {CH fn_CRYPTO_get_new_lockid = 'CRYPTO_get_new_lockid'; } {Do not localize} + fn_CRYPTO_num_locks = 'CRYPTO_num_locks'; {Do not localize} + fn_CRYPTO_lock = 'CRYPTO_lock'; {Do not localize} + fn_CRYPTO_set_locking_callback = 'CRYPTO_set_locking_callback'; {Do not localize} + {CH fn_CRYPTO_set_add_lock_callback = 'CRYPTO_set_add_lock_callback'; } {Do not localize} + fn_CRYPTO_set_id_callback = 'CRYPTO_set_id_callback'; {Do not localize} + {CH fn_CRYPTO_thread_id = 'CRYPTO_thread_id'; } {Do not localize} + {CH fn_CRYPTO_get_lock_name = 'CRYPTO_get_lock_name'; } {Do not localize} + {CH fn_CRYPTO_add_lock = 'CRYPTO_add_lock'; } {Do not localize} + {CH fn_int_CRYPTO_set_do_dynlock_callback = 'int_CRYPTO_set_do_dynlock_callback'; } {Do not localize} + //OpenSSL 1.0.0 - use these instead of the depreciated CRYPTO_set_id_callback + fn_CRYPTO_THREADID_set_numeric = 'CRYPTO_THREADID_set_numeric'; {Do not localize} + fn_CRYPTO_THREADID_set_pointer = 'CRYPTO_THREADID_set_pointer'; {Do not localize} + fn_CRYPTO_THREADID_set_callback = 'CRYPTO_THREADID_set_callback'; {Do not localize} + //end section + fn_CRYPTO_set_mem_functions = 'CRYPTO_set_mem_functions'; {Do not localize} + {CH fn_CRYPTO_set_mem_info_functions = 'CRYPTO_set_mem_info_functions'; } {Do not localize} + {CH fn_CRYPTO_get_mem_functions = 'CRYPTO_get_mem_functions'; } {Do not localize} + {CH fn_CRYPTO_set_locked_mem_functions = 'CRYPTO_set_locked_mem_functions'; } {Do not localize} + {CH fn_CRYPTO_get_locked_mem_functions = 'CRYPTO_get_locked_mem_functions'; } {Do not localize} + {CH fn_CRYPTO_malloc_locked = 'CRYPTO_malloc_locked'; } {Do not localize} + {CH fn_CRYPTO_free_locked = 'CRYPTO_free_locked'; } {Do not localize} + fn_CRYPTO_malloc = 'CRYPTO_malloc'; {Do not localize} + fn_CRYPTO_free = 'CRYPTO_free'; {Do not localize} + {CH fn_CRYPTO_realloc = 'CRYPTO_realloc'; } {Do not localize} + {CH fn_CRYPTO_remalloc = 'CRYPTO_remalloc'; } {Do not localize} + {CH fn_CRYPTO_dbg_malloc = 'CRYPTO_dbg_malloc'; } {Do not localize} + {CH fn_CRYPTO_dbg_realloc = 'CRYPTO_dbg_realloc'; } {Do not localize} + {CH fn_CRYPTO_dbg_free = 'CRYPTO_dbg_free'; } {Do not localize} + {CH fn_CRYPTO_dbg_remalloc = 'CRYPTO_dbg_remalloc'; } {Do not localize} + {$IFNDEF OPENSSL_NO_FP_API} + {CH fn_CRYPTO_mem_leaks_fp = 'CRYPTO_mem_leaks_fp'; } {Do not localize} + {$ENDIF} + fn_CRYPTO_mem_leaks = 'CRYPTO_mem_leaks'; {Do not localize} + {CH fn_CRYPTO_mem_leaks_cb = 'CRYPTO_mem_leaks_cb'; } {Do not localize} + fn_CRYPTO_cleanup_all_ex_data = 'CRYPTO_cleanup_all_ex_data'; {Do not localize} + fn_CRYPTO_set_mem_debug_functions = 'CRYPTO_set_mem_debug_functions'; {Do not localize} + {CH fn_CRYPTO_dbg_set_options = 'CRYPTO_dbg_set_options'; } {Do not localize} + {CH fn_CRYPTO_dbg_get_options = 'CRYPTO_dbg_get_options'; } {Do not localize} + {CH fn_CRYPTO_dbg_push_info = 'CRYPTO_dbg_push_info'; } {Do not localize} + {CH fn_CRYPTO_dbg_pop_info = 'CRYPTO_dbg_pop_info'; } {Do not localize} + {CH fn_CRYPTO_dbg_remove_all_info = 'CRYPTO_dbg_remove_all_info'; } {Do not localize} + {CH fn_CRYPTO_memcmp = 'CRYPTO_memcmp'; } {Do not localize} + fn_ERR_load_CRYPTO_strings = 'ERR_load_CRYPTO_strings'; {Do not localize} + {CH fn_OPENSSL_init = 'OPENSSL_init'; } {Do not localize} + {CH fn_lh_new = 'lh_new'; } {Do not localize} + {CH fn_lh_free = 'lh_free'; } {Do not localize} + {CH fn_lh_insert = 'lh_insert'; } {Do not localize} + {CH fn_lh_delete = 'lh_delete'; } {Do not localize} + {CH fn_lh_retrieve = 'lh_retrieve'; } {Do not localize} + {CH fn_lh_doall = 'lh_doall'; } {Do not localize} + {CH fn_lh_doall_arg = 'lh_doall_arg'; } {Do not localize} + {CH fn_lh_strhash = 'lh_strhash'; } {Do not localize} + {CH fn_lh_stats = 'lh_stats'; } {Do not localize} + {CH fn_lh_node_stats = 'lh_node_stats'; } {Do not localize} + {CH fn_lh_node_usage_stats = 'lh_node_usage_stats'; } {Do not localize} + {CH fn_BUF_MEM_new = 'BUF_MEM_new'; } {Do not localize} + {CH fn_BUF_MEM_free = 'BUF_MEM_free'; } {Do not localize} + {CH fn_BUF_MEM_grow = 'BUF_MEM_grow'; } {Do not localize} + {CH fn_BUF_strdup = 'BUF_strdup'; } {Do not localize} + {CH fn_ERR_load_BUF_strings = 'ERR_load_BUF_strings'; } {Do not localize} + {CH fn_BIO_ctrl_pending = 'BIO_ctrl_pending'; } {Do not localize} + {CH fn_BIO_ctrl_wpending = 'BIO_ctrl_wpending'; } {Do not localize} + {CH fn_BIO_ctrl_get_write_guarantee = 'BIO_ctrl_get_write_guarantee'; } {Do not localize} + {CH fn_BIO_ctrl_get_read_request = 'BIO_ctrl_get_read_request'; } {Do not localize} + fn_BIO_set_ex_data = 'BIO_set_ex_data'; {Do not localize} + fn_BIO_get_ex_data = 'BIO_get_ex_data'; {Do not localize} + {CH fn_BIO_get_ex_new_index = 'BIO_get_ex_new_index'; } {Do not localize} + fn_BIO_s_file = 'BIO_s_file'; {Do not localize} + fn_BIO_new_file = 'BIO_new_file'; {Do not localize} + {CH fn_BIO_new_fp = 'BIO_new_fp'; } {Do not localize} + fn_BIO_new = 'BIO_new'; {Do not localize} + fn_BIO_set_flags = 'BIO_set_flags'; {Do not localize} + fn_BIO_new_mem_buf = 'BIO_new_mem_buf'; {Do not localize} + {CH fn_BIO_set = 'BIO_set'; } {Do not localize} + fn_BIO_free = 'BIO_free'; {Do not localize} + fn_BIO_read = 'BIO_read'; {Do not localize} + {CH fn_BIO_gets = 'BIO_gets'; } {Do not localize} + fn_BIO_write = 'BIO_write'; {Do not localize} + fn_BIO_puts = 'BIO_puts'; {Do not localize} + fn_BIO_ctrl = 'BIO_ctrl'; {Do not localize} + fn_BIO_ptr_ctrl = 'BIO_ptr_ctrl'; {Do not localize} + fn_BIO_int_ctrl = 'BIO_int_ctrl'; {Do not localize} + fn_BIO_push = 'BIO_push'; {Do not localize} + fn_BIO_pop = 'BIO_pop'; {Do not localize} + fn_BIO_set_next = 'BIO_set_next'; {Do not localize} + fn_BIO_free_all = 'BIO_free_all'; {Do not localize} + {CH fn_BIO_find_type = 'BIO_find_type'; } {Do not localize} + {CH fn_BIO_get_retry_BIO = 'BIO_get_retry_BIO'; } {Do not localize} + {CH fn_BIO_get_retry_reason = 'BIO_get_retry_reason'; } {Do not localize} + {CH fn_BIO_dup_chain = 'BIO_dup_chain'; } {Do not localize} + {CH fn_BIO_debug_callback = 'BIO_debug_callback'; } {Do not localize} + + fn_BIO_s_mem = 'BIO_s_mem'; {Do not localize} + {CH fn_BIO_s_socket = 'BIO_s_socket'; } {Do not localize} + {CH fn_BIO_s_connect = 'BIO_s_connect'; } {Do not localize} + {CH fn_BIO_s_accept = 'BIO_s_accept'; } {Do not localize} + {CH fn_BIO_s_fd = 'BIO_s_fd'; } {Do not localize} + {CH fn_BIO_s_bio = 'BIO_s_bio'; } {Do not localize} + {CH fn_BIO_s_null = 'BIO_s_null'; } {Do not localize} + {CH fn_BIO_f_null = 'BIO_f_null'; } {Do not localize} + {CH fn_BIO_f_buffer = 'BIO_f_buffer'; } {Do not localize} + {CH fn_BIO_f_nbio_test = 'BIO_f_nbio_test'; } {Do not localize} + {CH fn_BIO_sock_should_retry = 'BIO_sock_should_retry'; } {Do not localize} + {CH fn_BIO_sock_non_fatal_error = 'BIO_sock_non_fatal_error'; } {Do not localize} + {CH fn_BIO_fd_should_retry = 'BIO_fd_should_retry'; } {Do not localize} + {CH fn_BIO_fd_non_fatal_error = 'BIO_fd_non_fatal_error'; } {Do not localize} + {CH fn_BIO_dump = 'BIO_dump'; } {Do not localize} + {CH fn_BIO_gethostbyname = 'BIO_gethostbyname'; } {Do not localize} + {CH fn_BIO_sock_error = 'BIO_sock_error'; } {Do not localize} + {CH fn_BIO_socket_ioctl = 'BIO_socket_ioctl'; } {Do not localize} + {CH fn_BIO_socket_nbio = 'BIO_socket_nbio'; } {Do not localize} + {CH fn_BIO_get_port = 'BIO_get_port'; } {Do not localize} + {CH fn_BIO_get_host_ip = 'BIO_get_host_ip'; } {Do not localize} + {CH fn_BIO_get_accept_socket = 'BIO_get_accept_socket'; } {Do not localize} + {CH fn_BIO_accept = 'BIO_accept'; } {Do not localize} + {CH fn_BIO_sock_init = 'BIO_sock_init'; } {Do not localize} + {CH fn_BIO_sock_cleanup = 'BIO_sock_cleanup'; } {Do not localize} + {CH fn_BIO_set_tcp_ndelay = 'BIO_set_tcp_ndelay'; } {Do not localize} + {CH fn_ERR_load_BIO_strings = 'ERR_load_BIO_strings'; } {Do not localize} + {CH fn_BIO_new_socket = 'BIO_new_socket'; } {Do not localize} + {CH fn_BIO_new_fd = 'BIO_new_fd'; } {Do not localize} + {CH fn_BIO_new_connect = 'BIO_new_connect'; } {Do not localize} + {CH fn_BIO_new_accept = 'BIO_new_accept'; } {Do not localize} + {CH fn_BIO_new_bio_pair = 'BIO_new_bio_pair'; } {Do not localize} + {CH fn_BIO_copy_next_retry = 'BIO_copy_next_retry'; } {Do not localize} + {CH fn_BIO_ghbn_ctrl = 'BIO_ghbn_ctrl'; } {Do not localize} + {CH fn_COMP_CTX_new = 'COMP_CTX_new';} {Do not localize} + {CH fn_COMP_CTX_free = 'COMP_CTX_free'; } {Do not localize} + {CH fn_COMP_compress_block = 'COMP_compress_block'; } {Do not localize} + {CH fn_COMP_expand_block = 'COMP_expand_block'; } {Do not localize} + {CH fn_COMP_rle = 'COMP_rle'; } {Do not localize} + {CH fn_COMP_zlib = 'COMP_zlib'; } {Do not localize} + {CH fn_COMP_zlib_cleanup = 'COMP_zlib_cleanup'; } {Do not localized} + {$IFDEF HEADER_BIO_H} + {$IFDEF ZLIB} + {CH fn_BIO_f_zlib = 'BIO_f_zlib'; } {Do not localize} + {$ENDIF} + {$ENDIF} + {$IFNDEF OPENSSL_NO_MD2} + {CH fn_MD2_options = 'MD2_options'; } {Do not localize} + {$IFDEF OPENSSL_FIPS} + {CH fn_private_MD2_Init = 'private_MD2_Init'; } {Do not localize} + {$ENDIF} + {CH fn_MD2_Init = 'MD2_Init'; } {Do not localize} + {CH fn_MD2_Update = 'MD2_Update'; } {Do not localize} + {CH fn_MD2_Final = 'MD2_Final'; } {Do not localize} + {CH fn_MD2 = 'MD2'; } {Do not localize} + {$ENDIF} + {$IFNDEF OPENSSL_NO_MD4} + {$IFDEF OPENSSL_FIPS} + {CH fn_private_MD4_Init = 'private_MD4_Init'; } {Do not localize} + {$ENDIF} + {CH fn_MD4_Init = 'MD4_Init'; } {Do not localize} + {CH fn_MD4_Update = 'MD4_Update'; } {Do not localize} + {CH fn_MD4_Final = 'MD4_Final'; } {Do not localize} + {CH fn_MD4 = 'MD4'; } {Do not localize} + {CH fn_MD4_Transform = 'MD4_Transform'; } {Do not localize} + {$ENDIF} + {$IFNDEF OPENSSL_NO_MD5} + {$IFDEF OPENSSL_FIPS} + {CH fn_private_MD5_Init = 'private_MD5_Init'; } {Do not localize} + {$ENDIF} + {CH fn_MD5_Init = 'MD5_Init'; } {Do not localize} + {CH fn_MD5_Update = 'MD5_Update'; } {Do not localize} + {CH fn_MD5_Final = 'MD5_Final'; } {Do not localize} + {CH fn_MD5 = 'MD5'; } {Do not localize} + {CH fn_MD5_Transform = 'MD5_Transform'; } {Do not localize} + {$ENDIF} + {$IFNDEF OPENSSL_NO_SHA} + {$IFNDEF OPENSSL_NO_SHA0} + {$IFDEF OPENSSL_FIPS} + {CH fn_private_SHA_Init = 'private_SHA_Init'; } {Do not localize} + {$ENDIF} + {CH fn_SHA_Init = 'SHA_Init'; } {Do not localize} + {CH fn_SHA_Update = 'SHA_Update'; } {Do not localize} + {CH fn_SHA_Final = 'SHA_Final'; } {Do not localize} + {CH fn_SHA = 'SHA'; } {Do not localize} + {CH fn_SHA_Transform = 'SHA_Transform'; } {Do not localize} + {$ENDIF} + {$IFNDEF OPENSSL_NO_SHA1} + {CH fn_SHA1_Init = 'SHA1_Init'; } {Do not localize} + {CH fn_SHA1_Update = 'SHA1_Update'; } {Do not localize} + {CH fn_SHA1_Final = 'SHA1_Final'; } {Do not localize} + {CH fn_SHA1 = 'SHA1'; } {Do not localize} + {CH fn_SHA1_Transform = 'SHA1_Transform'; } {Do not localize} + {$ENDIF} + {$IFNDEF OPENSSL_NO_SHA256} + {CH fn_SHA224_Init = 'SHA224_Init'; } {Do not localize} + {CH fn_SHA224_Update = 'SHA224_Update'; } {Do not localize} + {CH fn_SHA224_Final = 'SHA224_Final'; } {Do not localize} + {CH fn_SHA224 = 'SHA224'; } {Do not localize} + {CH fn_SHA256_Init = 'SHA256_Init'; } {Do not localize} + {CH fn_SHA256_Update = 'SHA256_Update'; } {Do not localize} + {CH fn_SHA256_Final = 'SHA256_Final'; } {Do not localize} + {CH fn_SHA256 = 'SHA256'; } {Do not localize} + {CH fn_SHA256_Transform = 'SHA256_Transform'; } {Do not localize} + {$ENDIF} + {$IFNDEF OPENSSL_NO_SHA512} + {CH fn_SHA384_Init = 'SHA384_Init'; } {Do not localize} + {CH fn_SHA384_Update = 'SHA384_Update'; } {Do not localize} + {CH fn_SHA384_Final = 'SHA384_Final'; } {Do not localize} + {CH fn_SHA384 = 'SHA384'; } {Do not localize} + {CH fn_SHA512_Init = 'SHA512_Init'; } {Do not localize} + {CH fn_SHA512_Update = 'SHA512_Update'; } {Do not localize} + {CH fn_SHA512_Final = 'SHA512_Final'; } {Do not localize} + {CH fn_SHA512 = 'SHA512'; } {Do not localize} + {CH fn_SHA512_Transform = 'SHA512_Transform'; } {Do not localize} + {$ENDIF} + {$ENDIF} + {$IFNDEF OPENSSL_NO_RIPEMD} + {$IFDEF OPENSSL_FIPS} + {CH fn_private_RIPEMD160_Init = 'private_RIPEMD160_Init'; } {Do not localize} + {$ENDIF} + {CH fn_RIPEMD160_Init = 'RIPEMD160_Init'; } {Do not localize} + {CH fn_RIPEMD160_Update = 'RIPEMD160_Update'; } {Do not localize} + {CH fn_RIPEMD160_Final = 'RIPEMD160_Final'; } {Do not localize} + {CH fn_RIPEMD160 = 'RIPEMD160'; } {Do not localize} + {CH fn_RIPEMD160_Transform = 'RIPEMD160_Transform'; } {Do not localize} + {$ENDIF} + {$IFNDEF OPENSSL_NO_HMAC} + fn_HMAC_CTX_init = 'HMAC_CTX_init'; {Do not localize} + fn_HMAC_CTX_cleanup = 'HMAC_CTX_cleanup'; {Do not localize} + {CH fn_HMAC_Init = 'HMAC_Init'; } {Do not localize} + fn_HMAC_Init_ex = 'HMAC_Init_ex'; {Do not localize} + fn_HMAC_Update = 'HMAC_Update'; {Do not localize} + fn_HMAC_Final = 'HMAC_Final'; {Do not localize} + {CH fn_HMAC = 'HMAC'; } {Do not localize} + {CH fn_HMAC_CTX_set_flags = 'HMAC_CTX_set_flags'; } {Do not localize} + {$ENDIF} + {$IFNDEF HEADER_TMDIFF_H} + {CH fn_ms_time_new = 'ms_time_new'; } {Do not localize} + {CH fn_ms_time_free = 'ms_time_free'; } {Do not localize} + {CH fn_ms_time_get = 'ms_time_get'; } {Do not localize} + {CH fn_ms_time_diff = 'ms_time_diff'; } {Do not localize} + {CH fn_ms_time_cmp = 'ms_time_cmp'; } {Do not localize} + {$ENDIF} + {$IFNDEF OPENSSL_NO_AES} + {CH fn_AES_options = 'AES_options'; }{Do not localize} + {CH fn_AES_set_encrypt_key = 'AES_set_encrypt_key'; }{Do not localize} + {CH fn_AES_set_decrypt_key = 'AES_set_decrypt_key'; }{Do not localize} + {CH fn_AES_encrypt = 'AES_encrypt'; }{Do not localize} + {CH fn_AES_decrypt = 'AES_decrypt'; } {Do not localize} + {CH fn_AES_ecb_encrypt = 'AES_ecb_encrypt'; } {Do not localize} + {CH fn_AES_cbc_encrypt = 'AES_cbc_encrypt'; } {Do not localize} + {CH fn_AES_cfb128_encrypt = 'AES_cfb128_encrypt'; } {Do not localize} + {CH fn_AES_cfb1_encrypt = 'AES_cfb1_encrypt'; } {Do not localize} + {CH fn_AES_cfb8_encrypt = 'AES_cfb8_encrypt'; } {Do not localize} + {CH fn_AES_cfbr_encrypt_block = 'AES_cfbr_encrypt_block'; } {Do not localize} + {CH fn_AES_ofb128_encrypt = 'AES_ofb128_encrypt'; } {Do not localize} + {CH fn_AES_ctr128_encrypt = 'AES_ctr128_encrypt'; } {Do not localize} + {CH fn_AES_ige_encrypt = 'AES_ige_encrypt'; } {Do not localize} + {CH fn_AES_bi_ige_encrypt = 'AES_bi_ige_encrypt'; } {Do not localize} + {CH fn_AES_wrap_key = 'AES_wrap_key'; } {Do not localize} + {CH fn_AES_unwrap_key = 'AES_unwrap_key'; } {Do not localize} + {$ENDIF} + {$IFNDEF OPENSSL_NO_DES} + {CH fn_des_options = 'DES_options'; } {Do not localize} + {CH fn_des_ecb3_encrypt = 'DES_ecb3_encrypt'; } {Do not localize} + {CH fn_des_cbc_cksum = 'DES_cbc_cksum'; } {Do not localize} + {CH fn_des_cbc_encrypt = 'DES_cbc_encrypt'; } {Do not localize} + {CH fn_des_ncbc_encrypt = 'DES_ncbc_encrypt'; } {Do not localize} + {CH fn_des_xcbc_encrypt = 'DES_xcbc_encrypt'; } {Do not localize} + {CH fn_des_cfb_encrypt = 'DES_cfb_encrypt'; } {Do not localize} + fn_des_ecb_encrypt = 'DES_ecb_encrypt'; {Do not localize} + fnold_des_ecb_encrypt = 'DES_ecb_encrypt'; {Do not localize} + {CH fn_des_encrypt = 'DES_encrypt'; } {Do not localize} + {CH fn_des_encrypt2 = 'DES_encrypt2'; } {Do not localize} + {CH fn_des_encrypt3 = 'DES_encrypt3'; } {Do not localize} + {CH fn_des_decrypt3 = 'DES_decrypt3'; } {Do not localize} + {CH fn_des_ede3_cbc_encrypt = 'DES_ede3_cbc_encrypt'; } {Do not localize} + {CH fn_des_ede3_cbcm_encrypt = 'DES_ede3_cbcm_encrypt'; } {Do not localize} + {CH fn_des_ede3_cfb64_encrypt = 'DES_ede3_cfb64_encrypt'; } {Do not localize} + {CH fn_des_ede3_ofb64_encrypt = 'DES_ede3_ofb64_encrypt'; } {Do not localize} + {$IFDEF USE_THIS} + {CH fn_des_xwhite_in2out = 'DES_xwhite_in2out'; } {Do not localize} + {$ENDIF} + {CH fn_des_enc_read = 'DES_enc_read'; } {Do not localize} + {CH fn_des_enc_write = 'DES_enc_write'; } {Do not localize} + {CH fn_des_fcrypt = 'DES_fcrypt'; } {Do not localize} + {CH fn_crypt = 'crypt'; } {Do not localize} + {CH fn_des_ofb_encrypt = 'DES_ofb_encrypt'; } {Do not localize} + {CH fn_des_pcbc_encrypt = 'DES_pcbc_encrypt'; } {Do not localize} + {CH fn_des_quad_cksum = 'DES_quad_cksum'; } {Do not localize} + {CH fn_des_random_seed = 'DES_random_seed'; } {Do not localize} + {CH fn_des_random_key = 'DES_random_key'; } {Do not localize} + {CH fn_des_read_password = 'DES_read_password'; } {Do not localize} + {CH fn_des_read_2passwords = 'DES_read_2passwords'; } {Do not localize} + {CH fn_des_read_pw_string = 'DES_read_pw_string'; } {Do not localize} + fn_des_set_odd_parity = 'DES_set_odd_parity'; {Do not localize} + fnold_des_set_odd_parity = 'DES_set_odd_parity'; {Do not localize} + {CH fn_des_is_weak_key = 'DES_is_weak_key'; } {Do not localize} + fn_des_set_key = 'DES_set_key'; {Do not localize} + fnold_des_set_key = '_ossl_old_des_set_key'; {Do not localize} + {CH fn_des_key_sched = 'DES_key_sched'; } {Do not localize} + {CH fn_des_string_to_key = 'DES_string_to_key'; } {Do not localize} + {CH fn_des_string_to_2keys = 'DES_string_to_2keys'; } {Do not localize} + {CH fn_des_cfb64_encrypt = 'DES_cfb64_encrypt'; } {Do not localize} + {CH fn_des_ofb64_encrypt = 'DES_ofb64_encrypt'; } {Do not localize} + {CH fn_des_read_pw = 'DES_read_pw'; } {Do not localize} + {CH fn_des_cblock_print_file = 'DES_cblock_print_file'; } {Do not localize} + //des_old.h + {CH fn__ossl_old_des_options = '_ossl_old_des_options'; } {Do not localize} + {CH fn__ossl_old_des_ecb3_encrypt = '_ossl_old_des_ecb3_encrypt'; } {Do not localize} + {CH fn__ossl_old_des_cbc_cksum = '_ossl_old_des_cbc_cksum'; } {Do not localize} + {CH fn__ossl_old_des_cbc_encrypt = '_ossl_old_des_cbc_encrypt'; } {Do not localize} + {CH fn__ossl_old_des_ncbc_encrypt = '_ossl_old_des_ncbc_encrypt'; } {Do not localize} + {CH fn__ossl_old_des_xcbc_encrypt = '_ossl_old_des_xcbc_encrypt'; } {Do not localize} + {CH fn__ossl_old_des_cfb_encrypt = '_ossl_old_des_cfb_encrypt'; } {Do not localize} + fn__ossl_old_des_ecb_encrypt = '_ossl_old_des_ecb_encrypt'; {Do not localize} + {CH fn__ossl_old_des_encrypt = '_ossl_old_des_encrypt'; } {Do not localize} + {CH fn__ossl_old_des_encrypt2 = '_ossl_old_des_encrypt2'; } {Do not localize} + {CH fn__ossl_old_des_encrypt3 = '_ossl_old_des_encrypt3'; } {Do not localize} + {CH fn__ossl_old_des_decrypt3 = '_ossl_old_des_decrypt3'; } {Do not localize} + {CH fn__ossl_old_des_ede3_cbc_encrypt = '_ossl_old_des_ede3_cbc_encrypt'; } {Do not localize} + {CH fn__ossl_old_des_ede3_cfb64_encrypt = '_ossl_old_des_ede3_cfb64_encrypt'; } {Do not localize} + {CH fn__ossl_old_des_ede3_ofb64_encrypt = '_ossl_old_des_ede3_ofb64_encrypt'; } {Do not localize} + {$IFDEF USE_THIS} + {CH fn__ossl_old_des_xwhite_in2out = '_ossl_old_des_xwhite_in2out'; } {Do not localize} + {$ENDIF} + {CH fn__ossl_old_des_enc_read = '_ossl_old_des_enc_read'; } {Do not localize} + {CH fn__ossl_old_des_enc_write = '_ossl_old_des_enc_write'; } {Do not localize} + {CH fn__ossl_old_des_fcrypt = '_ossl_old_des_fcrypt'; } {Do not localize} + {CH fn__ossl_old_des_crypt = '_ossl_old_des_crypt'; } {Do not localize} + {$IFNDEF PERL5} + {$IFNDEF NeXT} + {CH fn__ossl_old_crypt = '_ossl_old_crypt'; } {Do not localize} + {$ENDIF} + {$ENDIF} + {CH fn__ossl_old_des_ofb_encrypt = '_ossl_old_des_ofb_encrypt'; } {Do not localize} + {CH fn__ossl_old_des_pcbc_encrypt = '_ossl_old_des_pcbc_encrypt'; } {Do not localize} + {CH fn__ossl_old_des_quad_cksum = '_ossl_old_des_quad_cksum'; } {Do not localize} + {CH fn__ossl_old_des_random_seed = '_ossl_old_des_random_seed'; } {Do not localize} + {CH fn__ossl_old_des_random_key = '_ossl_old_des_random_key'; } {Do not localize} + {CH fn__ossl_old_des_read_password = '_ossl_old_des_read_password'; } {Do not localize} + {CH fn__ossl_old_des_read_2passwords = '_ossl_old_des_read_2passwords'; } {Do not localize} + fn__ossl_old_des_set_odd_parity = '_ossl_old_des_set_odd_parity'; {Do not localize} + {CH fn__ossl_old_des_is_weak_key = '_ossl_old_des_is_weak_key'; } {Do not localize} + fn__ossl_old_des_set_key = '_ossl_old_des_set_key'; {Do not localize} + {CH fn__ossl_old_des_key_sched = '_ossl_old_des_key_sched'; } {Do not localize} + {CH fn__ossl_old_des_string_to_key = '_ossl_old_des_string_to_key'; } {Do not localize} + {CH fn__ossl_old_des_string_to_2keys = '_ossl_old_des_string_to_2keys'; } {Do not localize} + {CH fn__ossl_old_des_cfb64_encrypt = '_ossl_old_des_cfb64_encrypt'; } {Do not localize} + {CH fn__ossl_old_des_ofb64_encrypt = '_ossl_old_des_ofb64_encrypt'; } {Do not localize} + {CH fn__ossl_096_des_random_seed = '_ossl_096_des_random_seed'; } {Do not localize} + {$ENDIF} + {$IFNDEF OPENSSL_NO_RC4} + {CH fn_RC4_options = 'RC4_options'; } {Do not localize} + {$IFDEF OPENSSL_FIPS} + {CH private_RC4_set_key = 'private_RC4_set_key'; } {Do not localize} + {$ENDIF} + {CH fn_RC4_set_key = 'RC4_set_key'; } {Do not localize} + {CH fn_RC4 = 'RC4'; } {Do not localize} + {$ENDIF} + {$IFNDEF OPENSSL_NO_RC2} + {$IFDEF OPENSSL_FIPS} + {CH fn_private_RC2_set_key = 'private_RC2_set_key'; } {Do not localize} + {$ENDIF} + {CH fn_RC2_set_key = 'RC2_set_key'; } {Do not localize} + {CH fn_RC2_ecb_encrypt = 'RC2_ecb_encrypt'; } {Do not localize} + {CH fn_RC2_encrypt = 'RC2_encrypt'; } {Do not localize} + {CH fn_RC2_decrypt = 'RC2_decrypt'; } {Do not localize} + {CH fn_RC2_cbc_encrypt = 'RC2_cbc_encrypt'; } {Do not localize} + {CH fn_RC2_cfb64_encrypt = 'RC2_cfb64_encrypt'; } {Do not localize} + {CH fn_RC2_ofb64_encrypt = 'RC2_ofb64_encrypt'; } {Do not localize} + {$ENDIF} + {$IFNDEF OPENSSL_NO_RC5} + {CH fn_RC5_32_set_key = 'RC5_32_set_key'; } {Do not localize} + {CH fn_RC5_32_ecb_encrypt = 'RC5_32_ecb_encrypt'; } {Do not localize} + {CH fn_RC5_32_encrypt = 'RC5_32_encrypt'; } {Do not localize} + {CH fn_RC5_32_decrypt = 'RC5_32_decrypt'; } {Do not localize} + {CH fn_RC5_32_cbc_encrypt = 'RC5_32_cbc_encrypt'; } {Do not localize} + {CH fn_RC5_32_cfb64_encrypt = 'RC5_32_cfb64_encrypt'; } {Do not localize} + {CH fn_RC5_32_ofb64_encrypt = 'RC5_32_ofb64_encrypt'; } {Do not localize} + {$ENDIF} + {$IFNDEF OPENSSL_NO_BF} + {$IFDEF FIPS} + {CH fn_private_BF_set_key = 'private_BF_set_key'; } {Do not localize} + {$ENDIF} + {CH fn_BF_set_key = 'BF_set_key'; } {Do not localize} + {CH fn_BF_ecb_encrypt = 'BF_ecb_encrypt'; } {Do not localize} + {CH fn_BF_encrypt = 'BF_encrypt'; } {Do not localize} + {CH fn_BF_decrypt = 'BF_decrypt'; } {Do not localize} + {CH fn_BF_cbc_encrypt = 'BF_cbc_encrypt'; } {Do not localize} + {CH fn_BF_cfb64_encrypt = 'BF_cfb64_encrypt'; } {Do not localize} + {CH fn_BF_ofb64_encrypt = 'BF_ofb64_encrypt'; } {Do not localize} + {CH fn_BF_options = 'BF_options'; } {Do not localize} + {$ENDIF} + {$IFNDEF OPENSSL_NO_CAST} + {$IFDEF OPENSSL_FIPS} + {CH fn_private_CAST_set_key = 'private_CAST_set_key'; } {Do not localize} + {$ENDIF} + {CH fn_CAST_set_key = 'CAST_set_key'; } {Do not localize} + {CH fn_CAST_ecb_encrypt = 'CAST_ecb_encrypt'; } {Do not localize} + {CH fn_CAST_encrypt = 'CAST_encrypt'; } {Do not localize} + {CH fn_CAST_decrypt = 'CAST_decrypt'; } {Do not localize} + {CH fn_CAST_cbc_encrypt = 'CAST_cbc_encrypt'; } {Do not localize} + {CH fn_CAST_cfb64_encrypt = 'CAST_cfb64_encrypt'; } {Do not localize} + {CH fn_CAST_ofb64_encrypt = 'CAST_ofb64_encrypt'; } {Do not localize} + {$ENDIF} + {$IFNDEF OPENSSL_NO_IDEA} + {CH fn_idea_options = 'idea_options'; } {Do not localize} + {CH fn_idea_ecb_encrypt = 'idea_ecb_encrypt'; } {Do not localize} + {CH fn_idea_set_encrypt_key = 'idea_set_encrypt_key'; } {Do not localize} + {CH fn_idea_set_decrypt_key = 'idea_set_decrypt_key'; } {Do not localize} + {CH fn_idea_cbc_encrypt = 'idea_cbc_encrypt'; } {Do not localize} + {CH fn_idea_cfb64_encrypt = 'idea_cfb64_encrypt'; } {Do not localize} + {CH fn_idea_ofb64_encrypt = 'idea_ofb64_encrypt'; } {Do not localize} + {CH fn_idea_encrypt = 'idea_encrypt'; } {Do not localize} + {$IFDEF OPENSSL_FIPS} + {CH fn_private_idea_set_encrypt_key = 'private_idea_set_encrypt_key'; } {Do not localize} + {$ENDIF} + {$ENDIF} + {$IFNDEF OPENSSL_NO_MD2} + {CH fn_MDC2_Init = 'MDC2_Init'; } {Do not localize} + {CH fn_MDC2_Update = 'MDC2_Update'; } {Do not localize} + {CH fn_MDC2_Final = 'MDC2_Final'; } {Do not localize} + {CH fn_MDC2 = 'MDC2'; } {Do not localize} + {$ENDIF} + {$IFNDEF OPENSSL_NO_RSA} + fn_RSA_new = 'RSA_new'; {Do not localize} + {CH fn_RSA_new_method = 'RSA_new_method'; } {Do not localize} + fn_RSA_size = 'RSA_size'; {Do not localize} + fn_RSA_generate_key = 'RSA_generate_key'; {Do not localize} + fn_RSA_generate_key_ex = 'RSA_generate_key_ex'; {Do not localize} + {CH fn_RSA_X931_derive_ex = 'RSA_X931_derive_ex'; } {Do not localize} + {CH fn_RSA_X931_generate_key_ex = 'RSA_X931_generate_key_ex'; } {Do not localize} + fn_RSA_check_key = 'RSA_check_key'; {Do not localize} + fn_RSA_public_encrypt = 'RSA_public_encrypt'; {Do not localize} + {CH fn_RSA_private_encrypt = 'RSA_private_encrypt'; } {Do not localize} + {CH fn_RSA_public_decrypt = 'RSA_public_decrypt'; } {Do not localize} + fn_RSA_private_decrypt = 'RSA_private_decrypt'; {Do not localize} + fn_RSA_free = 'RSA_free'; {Do not localize} + {CH fn_RSA_flags = 'RSA_flags'; } {Do not localize} + {$IFDEF OPENSSL_FIPS} + {CH fn_FIPS_rsa_new = 'FIPS_rsa_new'; } {Do not localize} + {CH fn_FIPS_rsa_free = 'FIPS_rsa_free'; } {Do not localize} + {$ENDIF} + {CH fn_RSA_set_default_method = 'RSA_set_default_method'; } {Do not localize} + {CH fn_RSA_get_default_method = 'RSA_get_default_method'; } {Do not localize} + {CH fn_RSA_get_method = 'RSA_get_method'; } {Do not localize} + {CH fn_RSA_set_method = 'RSA_set_method'; } {Do not localize} + {CH fn_RSA_memory_lock = 'RSA_memory_lock'; } {Do not localize} + {CH fn_RSA_PKCS1_SSLeay = 'RSA_PKCS1_SSLeay'; } {Do not localize} + {CH fn_ERR_load_RSA_strings = 'ERR_load_RSA_strings'; } {Do not localize} + fn_d2i_RSAPublicKey = 'd2i_RSAPublicKey'; {Do not localize} + fn_i2d_RSAPublicKey = 'i2d_RSAPublicKey'; {Do not localize} + fn_d2i_RSAPrivateKey = 'd2i_RSAPrivateKey'; {Do not localize} + fn_i2d_RSAPrivateKey = 'i2d_RSAPrivateKey'; {Do not localize} + {$IFNDEF OPENSSL_NO_FP_API} + {CH fn_RSA_print_fp = 'RSA_print_fp'; } {Do not localize} + {$ENDIF} + {$IFNDEF OPENSSL_NO_BIO} + {CH fn_RSA_print = 'RSA_print'; } {Do not localize} + {$ENDIF} + {$IFNDEF OPENSSL_NO_RC4} + {CH fn_i2d_RSA_NET = 'i2d_RSA_NET'; }{Do not localize} + {CH fn_d2i_RSA_NET = 'd2i_RSA_NET'; }{Do not localize} + {CH fn_i2d_Netscape_RSA = 'i2d_Netscape_RSA'; } {Do not localize} + {CH fn_d2i_Netscape_RSA = 'd2i_Netscape_RSA'; } {Do not localize} + {$ENDIF} + {CH fn_d2i_Netscape_RSA_2 = 'd2i_Netscape_RSA_2'; } {Do not localize} + {CH fn_RSA_sign = 'RSA_sign'; } {Do not localize} + {CH fn_RSA_verify = 'RSA_verify'; } {Do not localize} + {CH fn_RSA_sign_ASN1_OCTET_STRING = 'RSA_sign_ASN1_OCTET_STRING'; } {Do not localize} + {CH fn_RSA_verify_ASN1_OCTET_STRING = 'RSA_verify_ASN1_OCTET_STRING'; } {Do not localize} + {CH fn_RSA_blinding_on = 'RSA_blinding_on'; } {Do not localize} + {CH fn_RSA_blinding_off = 'RSA_blinding_off'; } {Do not localize} + {CH fn_RSA_padding_add_PKCS1_type_1 = 'RSA_padding_add_PKCS1_type_1'; } {Do not localize} + {CH fn_RSA_padding_check_PKCS1_type_1 = 'RSA_padding_check_PKCS1_type_1'; } {Do not localize} + {CH fn_RSA_padding_add_PKCS1_type_2 = 'RSA_padding_add_PKCS1_type_2'; } {Do not localize} + {CH fn_RSA_padding_check_PKCS1_type_2 = 'RSA_padding_check_PKCS1_type_2'; } {Do not localize} + {CH fn_RSA_padding_add_PKCS1_OAEP = 'RSA_padding_add_PKCS1_OAEP'; } {Do not localize} + {CH fn_RSA_padding_check_PKCS1_OAEP = 'RSA_padding_check_PKCS1_OAEP'; } {Do not localize} + {CH fn_RSA_padding_add_SSLv23 = 'RSA_padding_add_SSLv23'; } {Do not localize} + {CH fn_RSA_padding_check_SSLv23 = 'RSA_padding_check_SSLv23'; } {Do not localize} + {CH fn_RSA_padding_add_none = 'RSA_padding_add_none'; } {Do not localize} + {CH fn_RSA_padding_check_none = 'RSA_padding_check_none'; } {Do not localize} + {CH fn_RSA_get_ex_new_index = 'RSA_get_ex_new_index'; } {Do not localize} + {CH fn_RSA_set_ex_data = 'RSA_set_ex_data'; } {Do not localize} + {CH fn_RSA_get_ex_data = 'RSA_get_ex_data'; } {Do not localize} + {$ENDIF} + {$IFNDEF OPENSSL_NO_DH} + {CH fn_DH_OpenSSL = 'DH_OpenSSL'; } {Do not localize} + {CH fn_DH_set_default_method = 'DH_set_default_method'; } {Do not localize} + {CH fn_DH_set_method = 'DH_set_method'; } {Do not localize} + {CH fn_DH_new_method = 'DH_new_method'; } {Do not localize} + {CH fn_DH_new = 'DH_new'; } {Do not localize} + {CH fn_DH_up_ref = 'DH_up_ref'; } {Do not localize} + fn_DH_free = 'DH_free'; {Do not localize} + {CH fn_DH_size = 'DH_size'; } {Do not localize} + {$IFNDEF OPENSSL_NO_DEPRECATED} + {CH fn_DH_generate_parameters = 'DH_generate_parameters'; } {Do not localize} + {$ENDIF} + {CH fn_DH_generate_parameters_ex = 'DH_generate_parameters_ex'; } {Do not localize} + {CH fn_DH_get_ex_new_index = 'DH_get_ex_new_index'; } {Do not localize} + {CH fn_DH_set_ex_data = 'DH_set_ex_data'; } {Do not localize} + {CH fn_DH_get_ex_data = 'DH_get_ex_data'; } {Do not localize} + {CH fn_DH_check = 'DH_check'; } {Do not localize} + {CH fn_DH_check_pub_key = 'DH_check_pub_key'; } {Do not localize} + {CH fn_DH_generate_key = 'DH_generate_key'; } {Do not localize} + {CH fn_DH_compute_key = 'DH_compute_key'; } {Do not localize} + fn_d2i_DHparams = 'd2i_DHparams'; {Do not localize} + fn_i2d_DHparams = 'i2d_DHparams'; {Do not localize} + {CH fn_DH_OpenSSL = 'DH_OpenSSL'; } {Do not localize} + {$IFDEF OPENSSL_FIPS} + {CH fn_FIPS_dh_new = 'FIPS_dh_new'; } {Do not localize} + {CH fn_FIPS_dh_free = 'FIPS_dh_free'; } {Do not localize} + {$ENDIF} + {$IFNDEF OPENSSL_NO_FP_API} + {CH fn_DHparams_print_fp = 'DHparams_print_fp'; } {Do not localize} + {$ENDIF} + {CH fn_DHparams_print = 'DHparams_print'; } {Do not localize} + {$ENDIF} + {CH fn_ERR_load_DH_strings = 'ERR_load_DH_strings'; } {Do not localize} + {$IFNDEF OPENSSL_NO_DSA} + {CH fn_DSA_SIG_new = 'DSA_SIG_new'; } {Do not localize} + {CH fn_DSA_SIG_free = 'DSA_SIG_free'; } {Do not localize} + {CH fn_i2d_DSA_SIG = 'i2d_DSA_SIG'; } {Do not localize} + {CH fn_d2i_DSA_SIG = 'd2i_DSA_SIG'; } {Do not localize} + {CH fn_DSA_do_sign = 'DSA_do_sign'; } {Do not localize} + {CH fn_DSA_do_verify = 'DSA_do_verify'; } {Do not localize} + {$IFDEF OPENSSL_FIPS} + {CH fn_FIPS_dsa_new = 'FIPS_dsa_new'; } {Do not localize} + {CH fn_FIPS_dsa_free = 'FIPS_dsa_free'; } {Co not localize} + {$ENDIF} + {CH fn_DSA_new = 'DSA_new'; } {Do not localize} + {CH fn_DSA_size = 'DSA_size'; } {Do not localize} + {CH fn_DSA_sign_setup = 'DSA_sign_setup'; } {Do not localize} + {CH fn_DSA_sign = 'DSA_sign'; } {Do not localize} + {CH fn_DSA_verify = 'DSA_verify'; } {Do not localize} + {CH fn_DSA_free = 'DSA_free'; } {Do not localize} + {CH fn_ERR_load_DSA_strings = 'ERR_load_DSA_strings'; } {Do not localize} + + {$IFNDEF OPENSSL_NO_DEPRECATED} + {CH fn_DSA_generate_parameters = 'DSA_generate_parameters'; } {Do not localize} + {$ENDIF} + {CH fn_DSA_generate_parameters_ex = 'DSA_generate_parameters_ex'; } {Do not localize} + {CH fn_DSA_generate_key = 'DSA_generate_key'; } {Do not localize} + fn_d2i_DSAPublicKey = 'd2i_DSAPublicKey'; {Do not localize} + fn_i2d_DSAPublicKey = 'i2d_DSAPublicKey'; {Do not localize} + fn_d2i_DSAPrivateKey = 'd2i_DSAPrivateKey'; {Do not localize} + fn_i2d_DSAPrivateKey = 'i2d_DSAPrivateKey'; {Do not localize} + fn_i2d_DSAparams = 'i2d_DSAparams'; {Do not localize} + fn_d2i_DSAparams = 'd2i_DSAparams'; {Do not localize} + {$IFNDEF OPENSSL_NO_BIO} + {CH fn_DSAparams_print = 'DSAparams_print'; } {Do not localize} + {CH fn_DSA_print = 'DSA_print'; } {Do not localize} + {$ENDIF} + {$IFNDEF OPENSSL_NO_FP_API} + {CH fn_DSAparams_print_fp = 'DSAparams_print_fp'; } {Do not localize} + {CH fn_DSA_print_fp = 'DSA_print_fp'; } {Do not localize} + {$ENDIF} + {CH fn_DSA_is_prime = 'DSA_is_prime'; } {Do not localize} + {$IFNDEF OPENSSL_NO_DH} + {CH fn_DSA_dup_DH = 'DSA_dup_DH'; } {Do not localize} + {$ENDIF} + {$IFDEF OPENSSL_FIPS} + {CH fn_FIPS_dsa_sig_encode = 'FIPS_dsa_sig_encode'; } {Do not localize} + {CH fn_FIPS_dsa_sig_decode = 'FIPS_dsa_sig_decode'; } {Do not localize} + {$ENDIF} + {$ENDIF} + {$IFNDEF OPENSSL_NO_EC} + {CH fn_EC_GFp_simple_method = 'EC_GFp_simple_method'; } {Do not localize} + {CH fn_EC_GFp_mont_method = 'EC_GFp_mont_method'; } {Do not localize} + {CH fn_EC_GFp_nist_method = 'EC_GFp_nist_method'; } {Do not localize} + {CH fn_EC_GF2m_simple_method = 'EC_GF2m_simple_method'; } {Do not localize} + {CH fn_EC_GROUP_new = 'EC_GROUP_new'; } {Do not localize} + {CH fn_EC_GROUP_free = 'EC_GROUP_free'; } {Do not localize} + {CH fn_EC_GROUP_clear_free = 'EC_GROUP_clear_free'; } {Do not localize} + {CH fn_EC_GROUP_copy = 'EC_GROUP_copy'; } {Do not localize} + {CH fn_EC_GROUP_dup = 'EC_GROUP_dup'; } {Do not localize} + {CH fn_EC_GROUP_method_of = 'EC_GROUP_method_of'; } {Do not localize} + {CH fn_EC_METHOD_get_field_type = 'EC_METHOD_get_field_type'; } {Do not localize} + {CH fn_EC_GROUP_set_generator = 'EC_GROUP_set_generator'; } {Do not localize} + {CH fn_EC_GROUP_get0_generator = 'EC_GROUP_get0_generator'; } {Do not localize} + {CH fn_EC_GROUP_get_order = 'EC_GROUP_get_order'; } {Do not localize} + {CH fn_EC_GROUP_get_cofactor = 'EC_GROUP_get_cofactor'; } {Do not localize} + {CH fn_EC_GROUP_set_curve_name ='EC_GROUP_set_curve_name'; } {Do not localize} + {CH fn_EC_GROUP_get_curve_name = 'EC_GROUP_get_curve_name'; } {Do not localize} + {CH fn_EC_GROUP_set_asn1_flag = 'EC_GROUP_set_asn1_flag'; } {Do not localize} + {CH fn_EC_GROUP_get_asn1_flag = 'EC_GROUP_get_asn1_flag'; } {Do not localize} + {CH fn_EC_GROUP_set_point_conversion_form = 'EC_GROUP_set_point_conversion_form'; } {Do not localize} + {CH fn_EC_GROUP_get_point_conversion_form = 'EC_GROUP_get_point_conversion_form'; } {Do not localize} + {CH fn_EC_GROUP_get0_seed = 'EC_GROUP_get0_seed'; } {Do not localize} + {CH fn_EC_GROUP_get_seed_len = 'EC_GROUP_get_seed_len'; } {Do not localize} + {CH fn_EC_GROUP_set_seed = 'EC_GROUP_set_seed'; } {Do not localize} + {CH fn_EC_GROUP_set_curve_GFp = 'EC_GROUP_set_curve_GFp'; } {Do not localize} + {CH fn_EC_GROUP_get_curve_GFp = 'EC_GROUP_get_curve_GFp'; } {Do not localize} + {CH fn_EC_GROUP_set_curve_GF2m = 'EC_GROUP_set_curve_GF2m'; } {Do not localize} + {CH fn_EC_GROUP_get_curve_GF2m = 'EC_GROUP_get_curve_GF2m'; } {Do not localize} + {CH fn_EC_GROUP_get_degree = 'EC_GROUP_get_degree'; } {Do not localize} + {CH fn_EC_GROUP_check = 'EC_GROUP_check'; } {Do not localize} + {CH fn_EC_GROUP_check_discriminant = 'EC_GROUP_check_discriminant'; } {Do not localize} + {CH fn_EC_GROUP_cmp = 'EC_GROUP_cmp'; } {Do not localize} + {CH fn_EC_GROUP_new_curve_GFp = 'EC_GROUP_new_curve_GFp'; } {Do not localize} + {CH fn_EC_GROUP_new_curve_GF2m = 'EC_GROUP_new_curve_GF2m'; } {Do not localize} + {CH fn_EC_GROUP_new_by_curve_name = 'EC_GROUP_new_by_curve_name'; } {Do not localize} + {CH fn_EC_get_builtin_curves = 'EC_get_builtin_curves'; } {Do not localize} + {CH fn_EC_POINT_new = 'EC_POINT_new'; } {Do not localize} + {CH fn_EC_POINT_free = 'EC_POINT_free'; } {Do not localize} + {CH fn_EC_POINT_clear_free = 'EC_POINT_clear_free'; } {Do not localize} + {CH fn_EC_POINT_copy = 'EC_POINT_copy'; } {Do not localize} + {CH fn_EC_POINT_dup = 'EC_POINT_dup'; } {Do not localize} + {CH fn_EC_POINT_method_of = 'EC_POINT_method_of'; } {Do not localize} + {CH fn_EC_POINT_set_to_infinity = 'EC_POINT_set_to_infinity'; } {Do not localize} + {CH fn_EC_POINT_set_Jprojective_coordinates_GFp = 'EC_POINT_set_Jprojective_coordinates_GFp'; } {Do not localize} + {CH fn_EC_POINT_get_Jprojective_coordinates_GFp = 'EC_POINT_get_Jprojective_coordinates_GFp'; } {Do not localize} + {CH fn_EC_POINT_set_affine_coordinates_GFp = 'EC_POINT_set_affine_coordinates_GFp'; } {Do not localize} + {CH fn_EC_POINT_get_affine_coordinates_GFp = 'EC_POINT_get_affine_coordinates_GFp'; } {Do not localize} + {CH fn_EC_POINT_set_compressed_coordinates_GFp = 'EC_POINT_set_compressed_coordinates_GFp'; } {Do not localize} + {CH fn_EC_POINT_set_affine_coordinates_GF2m = 'EC_POINT_set_affine_coordinates_GF2m'; } {Do not localize} + {CH fn_EC_POINT_set_compressed_coordinates_GF2m = 'EC_POINT_set_compressed_coordinates_GF2m'; } {Do not localize} + {CH fn_EC_POINT_point2oct = 'EC_POINT_point2oct'; } {Do not localize} + {CH fn_EC_POINT_oct2point = 'EC_POINT_oct2point'; } {Do not localize} + {CH fn_EC_POINT_point2bn = 'EC_POINT_point2bn'; } {Do not localize} + {CH fn_EC_POINT_bn2point = 'EC_POINT_bn2point'; } {Do not localize} + {CH fn_EC_POINT_point2hex = 'EC_POINT_point2hex'; } {Do not localize} + {CH fn_EC_POINT_hex2point = 'EC_POINT_hex2point'; } {Do not localize} + {CH fn_EC_POINT_add = 'EC_POINT_add'; } {Do not localize} + {CH fn_EC_POINT_dbl = 'EC_POINT_dbl'; } {Do not localize} + {CH fn_EC_POINT_invert = 'EC_POINT_invert'; } {Do not localize} + {CH fn_EC_POINT_is_at_infinity = 'EC_POINT_is_at_infinity'; } {Do not localize} + {CH fn_EC_POINT_is_on_curve = 'EC_POINT_is_on_curve'; } {Do not localize} + {CH fn_EC_POINT_cmp = 'EC_POINT_cmp'; } {Do not localize} + {CH fn_EC_POINT_make_affine = 'EC_POINT_make_affine'; } {Do not localize} + {CH fn_EC_POINTs_make_affine = 'EC_POINTs_make_affine'; } {Do not localize} + {CH fn_EC_POINTs_mul = 'EC_POINTs_mul'; } {Do not localize} + {CH fn_EC_POINT_mul = 'EC_POINT_mul'; } {Do not localize} + {CH fn_EC_GROUP_precompute_mult = 'EC_GROUP_precompute_mult'; } {Do not localize} + {CH fn_EC_GROUP_have_precompute_mult = 'EC_GROUP_have_precompute_mult'; } {Do not localize} + {CH fn_EC_GROUP_get_basis_type = 'EC_GROUP_get_basis_type'; } {Do not localize} + {CH fn_EC_GROUP_get_trinomial_basis = 'EC_GROUP_get_trinomial_basis'; } {Do not localize} + {CH fn_EC_GROUP_get_pentanomial_basis = 'EC_GROUP_get_pentanomial_basis'; } {Do not localize} + {CH fn_d2i_ECPKParameters = 'd2i_ECPKParameters'; } {Do not localize} + {CH fn_i2d_ECPKParameters = 'i2d_ECPKParameters'; } {Do not localize} + {$IFNDEF OPENSSL_NO_BIO} + {CH fn_ECPKParameters_print = 'ECPKParameters_print'; } {Do not localize} + {$ENDIF} + {$IFNDEF OPENSSL_NO_FP_API} + {CH fn_ECPKParameters_print_fp = 'ECPKParameters_print_fp'; } {Do not localize} + {$ENDIF} + {CH fn_EC_KEY_new = 'EC_KEY_new'; } {Do not localize} + {CH fn_EC_KEY_new_by_curve_name = 'EC_KEY_new_by_curve_name'; } {Do not localize} + {CH fn_EC_KEY_free = 'EC_KEY_free'; } {Do not localize} + {CH fn_EC_KEY_copy = 'EC_KEY_copy'; } {Do not localize} + {CH fn_EC_KEY_dup = 'EC_KEY_dup'; } {Do not localize} + {CH fn_EC_KEY_up_ref = 'EC_KEY_up_ref'; } {Do not localize} + {CH fn_EC_KEY_get0_group = 'EC_KEY_get0_group'; } {Do not localize} + {CH fn_EC_KEY_set_group = 'EC_KEY_set_group'; } {Do not localize} + {CH fn_EC_KEY_get0_private_key = 'EC_KEY_get0_private_key'; } {Do not localize} + {CH fn_EC_KEY_set_private_key = 'EC_KEY_set_private_key'; } {Do not localize} + {CH fn_EC_KEY_get0_public_key = 'EC_KEY_get0_public_key'; } {Do not localize} + {CH fn_EC_KEY_set_public_key = 'EC_KEY_set_public_key'; } {Do not localize} + {CH fn_EC_KEY_get_enc_flags = 'EC_KEY_get_enc_flags'; } {Do not localize} + {CH fn_EC_KEY_set_enc_flags = 'EC_KEY_set_enc_flags'; } {Do not localize} + {CH fn_EC_KEY_get_conv_form = 'EC_KEY_get_conv_form'; } {Do not localize} + {CH fn_EC_KEY_set_conv_form = 'EC_KEY_set_conv_form'; } {Do not localize} + {CH fn_EC_KEY_get_key_method_data = 'EC_KEY_get_key_method_data'; } {Do not localize} + {CH fn_EC_KEY_insert_key_method_data = 'EC_KEY_insert_key_method_data'; } {Do not localize} + {CH fn_EC_KEY_set_asn1_flag = 'EC_KEY_set_asn1_flag'; } {Do not localize} + {CH fn_EC_KEY_precompute_mult = 'EC_KEY_precompute_mult'; } {Do not localize} + {CH fn_EC_KEY_generate_key = 'EC_KEY_generate_key'; } {Do not localize} + {CH fn_EC_KEY_check_key = 'EC_KEY_check_key'; } {Do not localize} + {CH fn_d2i_ECPrivateKey = 'd2i_ECPrivateKey'; } {Do not localize} + {CH fn_i2d_ECPrivateKey = 'i2d_ECPrivateKey'; } {Do not localize} + {CH fn_d2i_ECParameters = 'd2i_ECParameters'; } {Do not localize} + {CH fn_i2d_ECParameters = 'i2d_ECParameters'; } {Do not localize} + {CH fn_o2i_ECPublicKey = 'o2i_ECPublicKey'; } {Do not localize} + {CH fn_i2o_ECPublicKey = 'i2o_ECPublicKey'; } {Do not localize} + {$IFNDEF OPENSSL_NO_BIO} + {CH fn_ECParameters_print = 'ECParameters_print'; } {Do not localize} + {CH fn_EC_KEY_print = 'EC_KEY_print'; } {Do not localize} + {$ENDIF} + {$IFNDEF OPENSSL_NO_FP_API} + {CH fn_ECParameters_print_fp = 'ECParameters_print_fp'; } {Do not localize} + {CH fn_EC_KEY_print_fp = 'EC_KEY_print_fp'; } {Do not localize} + {$ENDIF} + {$ENDIF} + {$IFNDEF OPENSSL_NO_ECDSA} + {CH fn_ECDSA_SIG_new = 'ECDSA_SIG_new'; } {Do not localize} + {CH fn_ECDSA_SIG_free = 'ECDSA_SIG_free'; } {Do not localize} + {CH fn_i2d_ECDSA_SIG = 'i2d_ECDSA_SIG'; } {Do not localize} + {CH fn_d2i_ECDSA_SIG = 'd2i_ECDSA_SIG'; } {Do not localize} + {CH fn_ECDSA_do_sign = 'ECDSA_do_sign'; } {Do not localize} + {CH fn_ECDSA_do_sign_ex = 'ECDSA_do_sign_ex'; } {Do not localize} + {CH fn_ECDSA_do_verify = 'ECDSA_do_verify'; } {Do not localize} + {CH fn_ECDSA_OpenSSL = 'ECDSA_OpenSSL'; } {Do not localize} + {CH fn_ECDSA_set_default_method = 'ECDSA_set_default_method'; } {Do not localize} + {CH fn_ECDSA_get_default_method = 'ECDSA_get_default_method'; } {Do not localize} + {CH fn_ECDSA_set_method = 'ECDSA_set_method'; } {Do not localize} + {CH fn_ECDSA_size = 'ECDSA_size'; } {Do not localize} + {CH fn_ECDSA_sign_setup = 'ECDSA_sign_setup'; } {Do not localize} + {CH fn_ECDSA_sign = 'ECDSA_sign'; } {Do not localize} + {CH fn_ECDSA_sign_ex = 'ECDSA_sign_ex'; } {Do not localize} + {CH fn_ECDSA_verify = 'ECDSA_verify'; } {Do not localize} + {CH fn_ECDSA_get_ex_new_index = 'ECDSA_get_ex_new_index'; } {Do not localize} + {CH fn_ECDSA_set_ex_data = 'ECDSA_set_ex_data'; } {Do not localize} + {CH fn_ECDSA_get_ex_data = 'ECDSA_get_ex_data'; } {Do not localize} + {CH fn_ERR_load_ECDSA_strings = 'ERR_load_ECDSA_strings'; } {Do not localize} + {$ENDIF} + {$IFNDEF OPENSSL_NO_ECDH} + {CH fn_ECDH_OpenSSL = 'ECDH_OpenSSL'; } {Do not localize} + {CH fn_ECDH_set_default_method = 'ECDH_set_default_method'; } {Do not localize} + {CH fn_ECDH_get_default_method = 'ECDH_get_default_method'; } {Do not localize} + {CH fn_ECDH_set_method = 'ECDH_set_method'; } {Do not localize} + {CH fn_ECDH_compute_key = 'ECDH_compute_key'; } {Do not localize} + {CH fn_ECDH_get_ex_new_index = 'ECDH_get_ex_new_index'; } {Do not localize} + {CH fn_ECDH_set_ex_data = 'ECDH_set_ex_data'; } {Do not localize} + {CH fn_ECDH_get_ex_data = 'ECDH_get_ex_data'; } {Do not localize} + {CH fn_ERR_load_ECDH_strings = 'ERR_load_ECDH_strings'; } {Do not localize} + {$ENDIF} + {CH fn_BN_value_one = 'BN_value_one'; } {Do not localize} + {CH fn_BN_options = 'BN_options'; } {Do not localize} + {CH fn_BN_CTX_new = 'BN_CTX_new'; } {Do not localize} + {$IFNDEF OPENSSL_NO_DEPRECATED} + {CH fn_BN_CTX_init = 'BN_CTX_init'; } {Do not localize} + {$ENDIF} + {CH fn_BN_CTX_free = 'BN_CTX_free'; } {Do not localize} + {CH fn_BN_rand = 'BN_rand'; } {Do not localize} + {CH fn_BN_pseudo_rand = 'BN_pseudo_rand'; } {Do not localize} + {CH fn_BN_rand_range = 'BN_rand_range'; } {Do not localize} + {CH fn_BN_pseudo_rand_range = 'BN_pseudo_rand_range'; } {Do not localize} + {CH fn_BN_num_bits = 'BN_num_bits'; } {Do not localize} + {CH fn_BN_num_bits_word = 'BN_num_bits_word'; } {Do not localize} + fn_BN_new = 'BN_new'; {Do not localize} + {CH fn_BN_init = 'BN_init'; } {Do not localize} + {CH fn_BN_clear_free = 'BN_clear_free'; } {Do not localize} + {CH fn_BN_copy = 'BN_copy'; } {Do not localize} + {CH fn_BN_bin2bn = 'BN_bin2bn'; } {Do not localize} + {CH fn_BN_bn2bin = 'BN_bn2bin'; } {Do not localize} + {CH fn_BN_mpi2bn = 'BN_mpi2bn'; } {Do not localize} + {CH fn_BN_bn2mpi = 'BN_bn2mpi'; } {Do not localize} + {CH fn_BN_sub = 'BN_sub'; } {Do not localize} + {CH fn_BN_usub = 'BN_usub'; } {Do not localize} + {CH fn_BN_uadd = 'BN_uadd'; } {Do not localize} + {CH fn_BN_add = 'BN_add'; } {Do not localize} + {CH fn_BN_mod = 'BN_mod'; } {Do not localize} + {CH fn_BN_div = 'BN_div'; } {Do not localize} + {CH fn_BN_mul = 'BN_mul'; } {Do not localize} + {CH fn_BN_sqr = 'BN_sqr'; } {Do not localize} + {CH fn_BN_mod_word = 'BN_mod_word'; } {Do not localize} + {CH fn_BN_div_word = 'BN_div_word'; } {Do not localize} + {CH fn_BN_mul_word = 'BN_mul_word'; } {Do not localize} + {CH fn_BN_add_word = 'BN_add_word'; } {Do not localize} + {CH fn_BN_sub_word = 'BN_sub_word'; } {Do not localize} + fn_BN_set_word = 'BN_set_word'; {Do not localize} + {CH fn_BN_get_word = 'BN_get_word'; } {Do not localize} + {CH fn_BN_cmp = 'BN_cmp'; } {Do not localize} + fn_BN_free = 'BN_free'; {Do not localize} + {CH fn_BN_is_bit_set = 'BN_is_bit_set'; } {Do not localize} + {CH fn_BN_lshift = 'BN_lshift'; } {Do not localize} + {CH fn_BN_lshift1 = 'BN_lshift1'; } {Do not localize} + {CH fn_BN_exp = 'BN_exp'; } {Do not localize} + {CH fn_BN_mod_exp = 'BN_mod_exp'; } {Do not localize} + {CH fn_BN_mod_exp_mont = 'BN_mod_exp_mont'; } {Do not localize} + {CH fn_BN_mod_exp2_mont = 'BN_mod_exp2_mont'; } {Do not localize} + {CH fn_BN_mod_exp_simple = 'BN_mod_exp_simple'; } {Do not localize} + {CH fn_BN_mask_bits = 'BN_mask_bits'; } {Do not localize} + {CH fn_BN_mod_mul = 'BN_mod_mul'; } {Do not localize} + {$IFNDEF OPENSSL_NO_FP_API} + {CH fn_BN_print_fp = 'BN_print_fp'; } {Do not localize} + {$ENDIF} + {CH fn_BN_print = 'BN_print'; } {Do not localize} + {CH fn_BN_reciprocal = 'BN_reciprocal'; } {Do not localize} + {CH fn_BN_rshift = 'BN_rshift'; } {Do not localize} + {CH fn_BN_rshift1 = 'BN_rshift1'; } {Do not localize} + {CH fn_BN_clear = 'BN_clear'; } {Do not localize} + {CH fn_bn_expand2 = 'bn_expand2'; } {Do not localize} + {CH fn_BN_dup = 'BN_dup'; } {Do not localize} + {CH fn_BN_ucmp = 'BN_ucmp'; } {Do not localize} + {CH fn_BN_set_bit = 'BN_set_bit'; } {Do not localize} + {CH fn_BN_clear_bit = 'BN_clear_bit'; } {Do not localize} + fn_BN_bn2hex = 'BN_bn2hex'; {Do not localize} + fn_BN_bn2dec = 'BN_bn2dec'; {Do not localize} + fn_BN_hex2bn = 'BN_hex2bn'; {Do not localize} + {CH fn_BN_dec2bn = 'BN_dec2bn'; } {Do not localize} + {CH fn_BN_gcd = 'BN_gcd'; } {Do not localize} + {CH fn_BN_mod_inverse = 'BN_mod_inverse'; } {Do not localize} + {$IFNDEF OPENSSL_NO_DEPRECATED} + {CH fn_BN_generate_prime = 'BN_generate_prime'; } {Do not localize} + {CH fn_BN_is_prime = 'BN_is_prime'; } {Do not localize} + {CH fn_BN_is_prime_fasttest = 'BN_is_prime_fasttest'; } {Do not localize} + {$ENDIF} + {CH fn_ERR_load_BN_strings = 'ERR_load_BN_strings'; } {Do not localize} + {CH fn_bn_mul_add_words = 'bn_mul_add_words'; } {Do not localize} + {CH fn_bn_mul_words = 'bn_mul_words'; } {Do not localize} + {CH fn_bn_sqr_words = 'bn_sqr_words'; } {Do not localize} + {CH fn_bn_div_words = 'bn_div_words'; } {Do not localize} + {CH fn_bn_add_words = 'bn_add_words'; } {Do not localize} + {CH fn_bn_sub_words = 'bn_sub_words'; } {Do not localize} + {CH fn_BN_MONT_CTX_new = 'BN_MONT_CTX_new'; } {Do not localize} + {CH fn_BN_MONT_CTX_init = 'BN_MONT_CTX_init'; } {Do not localize} + {CH fn_BN_mod_mul_montgomery = 'BN_mod_mul_montgomery'; } {Do not localize} + {CH fn_BN_from_montgomery = 'BN_from_montgomery'; } {Do not localize} + {CH fn_BN_MONT_CTX_free = 'BN_MONT_CTX_free'; } {Do not localize} + {CH fn_BN_MONT_CTX_set = 'BN_MONT_CTX_set'; } {Do not localize} + {CH fn_BN_MONT_CTX_copy = 'BN_MONT_CTX_copy'; } {Do not localize} + {CH fn_BN_BLINDING_new = 'BN_BLINDING_new'; } {Do not localize} + {CH fn_BN_BLINDING_free = 'BN_BLINDING_free'; } {Do not localize} + {CH fn_BN_BLINDING_update = 'BN_BLINDING_update'; } {Do not localize} + {CH fn_BN_BLINDING_convert = 'BN_BLINDING_convert'; } {Do not localize} + {CH fn_BN_BLINDING_invert = 'BN_BLINDING_invert'; } {Do not localize} + {$IFNDEF OPENSSL_NO_DEPRECATED} + {CH fn_BN_set_params = 'BN_set_params'; } {Do not localize} + {CH fn_BN_get_params = 'BN_get_params'; } {Do not localize} + {$ENDIF} + {CH fn_BN_RECP_CTX_init = 'BN_RECP_CTX_init'; } {Do not localize} + {CH fn_BN_RECP_CTX_new = 'BN_RECP_CTX_new'; } {Do not localize} + {CH fn_BN_RECP_CTX_free = 'BN_RECP_CTX_free'; } {Do not localize} + {CH fn_BN_RECP_CTX_set = 'BN_RECP_CTX_set'; } {Do not localize} + {CH fn_BN_mod_mul_reciprocal = 'BN_mod_mul_reciprocal'; } {Do not localize} + {CH fn_BN_mod_exp_recp = 'BN_mod_exp_recp'; } {Do not localize} + + {CH fn_BN_div_recp = 'BN_div_recp'; } {Do not localize} + {CH fn_BN_GF2m_add = 'BN_GF2m_add'; } {Do not localize} + {CH fn_BN_GF2m_mod = 'BN_GF2m_mod'; } {Do not localize} + {CH fn_BN_GF2m_mod_mul = 'BN_GF2m_mod_mul'; } {Do not localize} + {CH fn_BN_GF2m_mod_sqr = 'BN_GF2m_mod_sqr'; } {Do not localize} + {CH fn_BN_GF2m_mod_inv = 'BN_GF2m_mod_inv'; } {Do not localize} + {CH fn_BN_GF2m_mod_div = 'BN_GF2m_mod_div'; } {Do not localize} + {CH fn_BN_GF2m_mod_exp = 'BN_GF2m_mod_exp'; } {Do not localize} + {CH fn_BN_GF2m_mod_sqrt = 'BN_GF2m_mod_sqrt'; } {Do not localize} + {CH fn_BN_GF2m_mod_solve_quad = 'BN_GF2m_mod_solve_quad'; } {Do not localize} + {CH fn_BN_GF2m_mod_arr = 'BN_GF2m_mod_arr'; } {Do not localize} + {CH fn_BN_GF2m_mod_mul_arr = 'BN_GF2m_mod_mul_arr'; } {Do not localize} + {CH fn_BN_GF2m_mod_sqr_arr = 'BN_GF2m_mod_sqr_arr'; } {Do not localize} + {CH fn_BN_GF2m_mod_inv_arr = 'BN_GF2m_mod_inv_arr'; } {Do not localize} + {CH fn_BN_GF2m_mod_div_arr = 'BN_GF2m_mod_div_arr'; } {Do not localize} + {CH fn_BN_GF2m_mod_exp_arr = 'BN_GF2m_mod_exp_arr'; } {Do not localize} + {CH fn_BN_GF2m_mod_sqrt_arr = 'BN_GF2m_mod_sqrt_arr'; } {Do not localize} + {CH fn_BN_GF2m_mod_solve_quad_arr = 'BN_GF2m_mod_solve_quad_arr'; } {Do not localize} + {CH fn_BN_GF2m_poly2arr = 'BN_GF2m_poly2arr'; } {Do not localize} + {CH fn_BN_GF2m_arr2poly = 'BN_GF2m_arr2poly'; } {Do not localize} + // faster mod functions for the 'NIST primes' + // 0 <= a < p^2 + {CH fn_BN_nist_mod_192 = 'BN_nist_mod_192'; } {Do not localize} + {CH fn_BN_nist_mod_224 = 'BN_nist_mod_224'; } {Do not localize} + {CH fn_BN_nist_mod_256 = 'BN_nist_mod_256'; } {Do not localize} + {CH fn_BN_nist_mod_384 = 'BN_nist_mod_384'; } {Do not localize} + {CH fn_BN_nist_mod_521 = 'BN_nist_mod_521'; } {Do not localize} + {CH fn_BN_get0_nist_prime_192 = 'BN_get0_nist_prime_192'; } {Do not localize} + {CH fn_BN_get0_nist_prime_224 = 'BN_get0_nist_prime_224'; } {Do not localize} + {CH fn_BN_get0_nist_prime_256 = 'BN_get0_nist_prime_256'; } {Do not localize} + {CH fn_BN_get0_nist_prime_384 = 'BN_get0_nist_prime_384'; } {Do not localize} + {CH fn_BN_get0_nist_prime_521 = 'BN_get0_nist_prime_521'; } {Do not localize} + // + {CH fn_get_rfc2409_prime_768 = 'get_rfc2409_prime_768'; } {Do not localize} + {CH fn_get_rfc2409_prime_1024 = 'get_rfc2409_prime_1024'; } {Do not localize} + {CH fn_get_rfc3526_prime_1536 = 'get_rfc3526_prime_1536'; } {Do not localize} + {CH fn_get_rfc3526_prime_2048 = 'get_rfc3526_prime_2048'; } {Do not localize} + {CH fn_get_rfc3526_prime_3072 = 'get_rfc3526_prime_3072'; } {Do not localize} + {CH fn_get_rfc3526_prime_4096 = 'get_rfc3526_prime_4096'; } {Do not localize} + {CH fn_get_rfc3526_prime_6144 = 'get_rfc3526_prime_6144'; } {Do not localize} + {CH fn_get_rfc3526_prime_8192 = 'get_rfc3526_prime_8192'; } {Do not localize} + {CH fn_BN_bntest_rand = 'BN_bntest_rand'; } {Do not localize} + {CH fn_sk_ASN1_TYPE_new = 'sk_ASN1_TYPE_new'; } {Do not localize} + {CH fn_sk_ASN1_TYPE_new_null = 'sk_ASN1_TYPE_new_null'; } {Do not localize} + {CH fn_sk_ASN1_TYPE_free = 'sk_ASN1_TYPE_free'; } {Do not localize} + {CH fn_sk_ASN1_TYPE_num = 'sk_ASN1_TYPE_num'; } {Do not localize} + {CH fn_sk_ASN1_TYPE_value = 'sk_ASN1_TYPE_value'; } {Do not localize} + {CH fn_sk_ASN1_TYPE_set = 'sk_ASN1_TYPE_set'; } {Do not localize} + {CH fn_ASN1_TYPE_set1 = 'ASN1_TYPE_set1'; } {Do not localize} + {CH fn_sk_ASN1_TYPE_zero = 'sk_ASN1_TYPE_zero'; } {Do not localize} + {CH fn_sk_ASN1_TYPE_push = 'sk_ASN1_TYPE_push'; } {Do not localize} + {CH fn_sk_ASN1_TYPE_unshift = 'sk_ASN1_TYPE_unshift'; } {Do not localize} + {CH fn_sk_ASN1_TYPE_find = 'sk_ASN1_TYPE_find'; } {Do not localize} + {CH fn_sk_ASN1_TYPE_delete = 'sk_ASN1_TYPE_delete'; } {Do not localize} + {CH fn_sk_ASN1_TYPE_delete_ptr = 'sk_ASN1_TYPE_delete_ptr'; } {Do not localize} + {CH fn_sk_ASN1_TYPE_insert = 'sk_ASN1_TYPE_insert'; } {Do not localize} + {CH fn_sk_ASN1_TYPE_dup = 'sk_ASN1_TYPE_dup'; } {Do not localize} + {CH fn_sk_ASN1_TYPE_pop_free = 'sk_ASN1_TYPE_pop_free'; } {Do not localize} + {CH fn_sk_ASN1_TYPE_shift = 'sk_ASN1_TYPE_shift'; } {Do not localize} + {CH fn_sk_ASN1_TYPE_pop = 'sk_ASN1_TYPE_pop'; } {Do not localize} + {CH fn_sk_ASN1_TYPE_sort = 'sk_ASN1_TYPE_sort'; } {Do not localize} + {CH fn_i2d_ASN1_SET_OF_ASN1_TYPE = 'i2d_ASN1_SET_OF_ASN1_TYPE'; } {Do not localize} + {CH fn_d2i_ASN1_SET_OF_ASN1_TYPE = 'd2i_ASN1_SET_OF_ASN1_TYPE'; } {Do not localize} + {CH fn_ASN1_TYPE_new = 'ASN1_TYPE_new'; } {Do not localize} + {CH fn_ASN1_TYPE_free = 'ASN1_TYPE_free'; } {Do not localize} + {CH fn_i2d_ASN1_TYPE = 'i2d_ASN1_TYPE'; } {Do not localize} + {CH fn_d2i_ASN1_TYPE = 'd2i_ASN1_TYPE'; } {Do not localize} + {CH fn_ASN1_TYPE_get = 'ASN1_TYPE_get'; } {Do not localize} + {CH fn_ASN1_TYPE_set = 'ASN1_TYPE_set'; } {Do not localize} + {CH fn_ASN1_TYPE_set1 = 'ASN1_TYPE_set1'; } {Do not localize} + {CH fn_ASN1_OBJECT_new = 'ASN1_OBJECT_new'; } {Do not localize} + {CH fn_ASN1_OBJECT_free = 'ASN1_OBJECT_free'; } {Do not localize} + {CH fn_i2d_ASN1_OBJECT = 'i2d_ASN1_OBJECT'; } {Do not localize} + {CH fn_d2i_ASN1_OBJECT = 'd2i_ASN1_OBJECT'; } {Do not localize} + {CH fn_sk_ASN1_OBJECT_new = 'sk_ASN1_OBJECT_new'; } {Do not localize} + {CH fn_sk_ASN1_OBJECT_new_null = 'sk_ASN1_OBJECT_new_null'; } {Do not localize} + {CH fn_sk_ASN1_OBJECT_free = 'sk_ASN1_OBJECT_free'; } {Do not localize} + {CH fn_sk_ASN1_OBJECT_num = 'sk_ASN1_OBJECT_num'; } {Do not localize} + {CH fn_sk_ASN1_OBJECT_value = 'sk_ASN1_OBJECT_value'; } {Do not localize} + {CH fn_sk_ASN1_OBJECT_set = 'sk_ASN1_OBJECT_set'; } {Do not localize} + {CH fn_sk_ASN1_OBJECT_zero = 'sk_ASN1_OBJECT_zero'; } {Do not localize} + {CH fn_sk_ASN1_OBJECT_push = 'sk_ASN1_OBJECT_push'; } {Do not localize} + {CH fn_sk_ASN1_OBJECT_unshift = 'sk_ASN1_OBJECT_unshift'; } {Do not localize} + {CH fn_sk_ASN1_OBJECT_find = 'sk_ASN1_OBJECT_find'; } {Do not localize} + {CH fn_sk_ASN1_OBJECT_delete = 'sk_ASN1_OBJECT_delete'; } {Do not localize} + {CH fn_sk_ASN1_OBJECT_delete_ptr = 'sk_ASN1_OBJECT_delete_ptr'; } {Do not localize} + {CH fn_sk_ASN1_OBJECT_insert = 'sk_ASN1_OBJECT_insert'; } {Do not localize} + {CH fn_sk_ASN1_OBJECT_dup = 'sk_ASN1_OBJECT_dup'; } {Do not localize} + {CH fn_sk_ASN1_OBJECT_pop_free = 'sk_ASN1_OBJECT_pop_free'; } {Do not localize} + {CH fn_sk_ASN1_OBJECT_shift = 'sk_ASN1_OBJECT_shift'; } {Do not localize} + {CH fn_sk_ASN1_OBJECT_pop = 'sk_ASN1_OBJECT_pop'; } {Do not localize} + {CH fn_sk_ASN1_OBJECT_sort = 'sk_ASN1_OBJECT_sort'; } {Do not localize} + {CH fn_i2d_ASN1_SET_OF_ASN1_OBJECT = 'i2d_ASN1_SET_OF_ASN1_OBJECT'; } {Do not localize} + {CH fn_d2i_ASN1_SET_OF_ASN1_OBJECT = 'd2i_ASN1_SET_OF_ASN1_OBJECT'; } {Do not localize} + {CH fn_ASN1_STRING_new = 'ASN1_STRING_new'; } {Do not localize} + fn_ASN1_STRING_free = 'ASN1_STRING_free'; {Do not localize} + {CH fn_ASN1_STRING_dup = 'ASN1_STRING_dup'; } {Do not localize} + fn_ASN1_STRING_type_new = 'ASN1_STRING_type_new'; {Do not localize} + {CH fn_ASN1_STRING_cmp = 'ASN1_STRING_cmp'; } {Do not localize} + {CH fn_ASN1_STRING_set = 'ASN1_STRING_set'; } {Do not localize} + {CH fn_ASN1_STRING_set0 = 'ASN1_STRING_set0'; } {Do not localize} + {CH fn_i2d_ASN1_BIT_STRING = 'i2d_ASN1_BIT_STRING'; } {Do not localize} + {CH fn_d2i_ASN1_BIT_STRING = 'd2i_ASN1_BIT_STRING'; } {Do not localize} + {CH fn_ASN1_BIT_STRING_set_bit = 'ASN1_BIT_STRING_set_bit'; } {Do not localize} + {CH fn_ASN1_BIT_STRING_get_bit = 'ASN1_BIT_STRING_get_bit'; } {Do not localize} + {CH fn_i2d_ASN1_BOOLEAN = 'i2d_ASN1_BOOLEAN'; } {Do not localize} + {CH fn_d2i_ASN1_BOOLEAN = 'd2i_ASN1_BOOLEAN'; } {Do not localize} + {CH fn_i2d_ASN1_INTEGER = 'i2d_ASN1_INTEGER'; } {Do not localize} + {CH fn_d2i_ASN1_INTEGER = 'd2i_ASN1_INTEGER'; } {Do not localize} + {CH fn_d2i_ASN1_UINTEGER = 'd2i_ASN1_UINTEGER'; } {Do not localize} + {CH fn_i2d_ASN1_ENUMERATED = 'i2d_ASN1_ENUMERATED'; } {Do not localize} + {CH fn_d2i_ASN1_ENUMERATED = 'd2i_ASN1_ENUMERATED'; } {Do not localize} + {CH fn_ASN1_UTCTIME_check = 'ASN1_UTCTIME_check'; } {Do not localize} + {CH fn_ASN1_UTCTIME_set = 'ASN1_UTCTIME_set'; } {Do not localize} + {CH fn_ASN1_UTCTIME_set_string = 'ASN1_UTCTIME_set_string'; } {Do not localize} + {CH fn_ASN1_GENERALIZEDTIME_check = 'ASN1_GENERALIZEDTIME_check'; } {Do not localize} + {CH fn_ASN1_GENERALIZEDTIME_set = 'ASN1_GENERALIZEDTIME_set'; } {Do not localize} + {CH fn_ASN1_GENERALIZEDTIME_set_string = 'ASN1_GENERALIZEDTIME_set_string'; } {Do not localize} + {CH fn_i2d_ASN1_OCTET_STRING = 'i2d_ASN1_OCTET_STRING'; } {Do not localize} + {CH fn_d2i_ASN1_OCTET_STRING = 'd2i_ASN1_OCTET_STRING'; } {Do not localize} + {CH fn_i2d_ASN1_VISIBLESTRING = 'i2d_ASN1_VISIBLESTRING'; } {Do not localize} + {CH fn_d2i_ASN1_VISIBLESTRING = 'd2i_ASN1_VISIBLESTRING'; } {Do not localize} + {CH fn_i2d_ASN1_UTF8STRING = 'i2d_ASN1_UTF8STRING'; } {Do not localize} + {CH fn_d2i_ASN1_UTF8STRING = 'd2i_ASN1_UTF8STRING'; } {Do not localize} + {CH fn_i2d_ASN1_BMPSTRING = 'i2d_ASN1_BMPSTRING'; } {Do not localize} + {CH fn_d2i_ASN1_BMPSTRING = 'd2i_ASN1_BMPSTRING'; } {Do not localize} + {CH fn_i2d_ASN1_PRINTABLE = 'i2d_ASN1_PRINTABLE'; } {Do not localize} + {CH fn_d2i_ASN1_PRINTABLE = 'd2i_ASN1_PRINTABLE'; } {Do not localize} + {CH fn_d2i_ASN1_PRINTABLESTRING = 'd2i_ASN1_PRINTABLESTRING'; } {Do not localize} + {CH fn_i2d_DIRECTORYSTRING = 'i2d_DIRECTORYSTRING'; } {Do not localize} + {CH fn_d2i_DIRECTORYSTRING = 'd2i_DIRECTORYSTRING'; } {Do not localize} + {CH fn_i2d_DISPLAYTEXT = 'i2d_DISPLAYTEXT'; } {Do not localize} + {CH fn_d2i_DISPLAYTEXT = 'd2i_DISPLAYTEXT'; } {Do not localize} + {CH fn_d2i_ASN1_T61STRING = 'd2i_ASN1_T61STRING'; } {Do not localize} + {CH fn_i2d_ASN1_IA5STRING = 'i2d_ASN1_IA5STRING'; } {Do not localize} + {CH fn_d2i_ASN1_IA5STRING = 'd2i_ASN1_IA5STRING'; } {Do not localize} + {CH fn_i2d_ASN1_UTCTIME = 'i2d_ASN1_UTCTIME'; } {Do not localize} + {CH fn_d2i_ASN1_UTCTIME = 'd2i_ASN1_UTCTIME'; } {Do not localize} + {CH fn_i2d_ASN1_GENERALIZEDTIME = 'i2d_ASN1_GENERALIZEDTIME'; } {Do not localize} + {CH fn_d2i_ASN1_GENERALIZEDTIME = 'd2i_ASN1_GENERALIZEDTIME'; } {Do not localize} + {CH fn_i2d_ASN1_TIME = 'i2d_ASN1_TIME'; } {Do not localize} + {CH fn_d2i_ASN1_TIME = 'd2i_ASN1_TIME'; } {Do not localize} + {CH fn_ASN1_TIME_set = 'ASN1_TIME_set'; } {Do not localize} + {CH fn_i2d_ASN1_SET = 'i2d_ASN1_SET'; } {Do not localize} + {CH fn_d2i_ASN1_SET = 'd2i_ASN1_SET'; } {Do not localize} + {$IFNDEF OPENSSL_NO_BIO} + {CH fn_i2a_ASN1_INTEGER = 'i2a_ASN1_INTEGER'; } {Do not localize} + {CH fn_a2i_ASN1_INTEGER = 'a2i_ASN1_INTEGER'; } {Do not localize} + {CH fn_i2a_ASN1_ENUMERATED = 'i2a_ASN1_ENUMERATED'; } {Do not localize} + {CH fn_a2i_ASN1_ENUMERATED = 'a2i_ASN1_ENUMERATED'; } {Do not localize} + {CH fn_i2a_ASN1_OBJECT = 'i2a_ASN1_OBJECT'; } {Do not localize} + {CH fn_a2i_ASN1_STRING = 'a2i_ASN1_STRING'; } {Do not localize} + {CH fn_i2a_ASN1_STRING = 'i2a_ASN1_STRING'; } {Do not localize} + {$ENDIF} + {CH fn_i2t_ASN1_OBJECT = 'i2t_ASN1_OBJECT'; } {Do not localize} + {CH fn_a2d_ASN1_OBJECT = 'a2d_ASN1_OBJECT'; } {Do not localize} + {CH fn_ASN1_OBJECT_create = 'ASN1_OBJECT_create'; } {Do not localize} + fn_ASN1_INTEGER_set = 'ASN1_INTEGER_set'; {Do not localize} + fn_ASN1_INTEGER_get = 'ASN1_INTEGER_get'; {Do not localize} + {CH fn_BN_to_ASN1_INTEGER = 'BN_to_ASN1_INTEGER'; } {Do not localize} + fn_ASN1_INTEGER_to_BN = 'ASN1_INTEGER_to_BN'; {Do not localize} + {CH fn_ASN1_ENUMERATED_set = 'ASN1_ENUMERATED_set'; } {Do not localize} + {CH fn_ASN1_ENUMERATED_get = 'ASN1_ENUMERATED_get'; } {Do not localize} + {CH fn_BN_to_ASN1_ENUMERATED = 'BN_to_ASN1_ENUMERATED'; } {Do not localize} + {CH fn_ASN1_ENUMERATED_to_BN = 'ASN1_ENUMERATED_to_BN'; } {Do not localize} + {CH fn_ASN1_PRINTABLE_type = 'ASN1_PRINTABLE_type'; } {Do not localize} + {CH fn_i2d_ASN1_bytes = 'i2d_ASN1_bytes'; } {Do not localize} + {CH fn_d2i_ASN1_bytes = 'd2i_ASN1_bytes'; } {Do not localize} + {CH fn_d2i_ASN1_type_bytes = 'd2i_ASN1_type_bytes'; } {Do not localize} + {CH fn_asn1_Finish = 'asn1_Finish'; } {Do not localize} + {CH fn_ASN1_get_object = 'ASN1_get_object'; } {Do not localize} + {CH fn_ASN1_check_infinite_end = 'ASN1_check_infinite_end'; } {Do not localize} + {CH fn_ASN1_put_object = 'ASN1_put_object'; } {Do not localize} + {CH fn_ASN1_object_size = 'ASN1_object_size'; } {Do not localize} + fn_ASN1_dup = 'ASN1_dup'; {Do not localize} + {$IFNDEF OPENSSL_NO_FP_API} + {CH fn_ASN1_d2i_fp = 'ASN1_d2i_fp'; } {Do not localize} + {CH fn_ASN1_i2d_fp = 'ASN1_i2d_fp'; } {Do not localize} + {$ENDIF} + {$IFNDEF OPENSSL_NO_BIO} + {CH fn_ASN1_d2i_bio = 'ASN1_d2i_bio'; } {Do not localize} + {CH fn_ASN1_item_d2i_bio = 'ASN1_item_d2i_bio'; } {Do not localize} + {CH fn_ASN1_i2d_bio = 'ASN1_i2d_bio'; } {Do not localize} + {CH fn_ASN1_item_i2d_bio = 'ASN1_item_i2d_bio'; } {Do not localize} + {CH fn_ASN1_UTCTIME_print = 'ASN1_UTCTIME_print'; } {Do not localize} + {CH fn_ASN1_GENERALIZEDTIME_print = 'ASN1_GENERALIZEDTIME_print'; } {Do not localize} + {CH fn_ASN1_TIME_print = 'ASN1_TIME_print'; } {Do not localize} + {CH fn_ASN1_STRING_print = 'ASN1_STRING_print'; } {Do not localize} + {CH fn_ASN1_STRING_print_ex = 'ASN1_STRING_print_ex'; } {Do not localize} + {CH fn_ASN1_parse = 'ASN1_parse'; } {Do not localize} + {CH fn_ASN1_parse_dump = 'ASN1_parse_dump'; } {Do not localize} + {$ENDIF} + {CH fn_ASN1_tag2str = 'ASN1_tag2str'; } {Do not localize} + {CH fn_i2d_ASN1_HEADER = 'i2d_ASN1_HEADER'; } {Do not localize} + {CH fn_d2i_ASN1_HEADER = 'd2i_ASN1_HEADER'; } {Do not localize} + {CH fn_ASN1_HEADER_new = 'ASN1_HEADER_new'; } {Do not localize} + {CH fn_ASN1_HEADER_free = 'ASN1_HEADER_free'; } {Do not localize} + {CH fn_ASN1_UNIVERSALSTRING_to_string = 'ASN1_UNIVERSALSTRING_to_string'; } {Do not localize} + {CH fn_ERR_load_ASN1_strings = 'ERR_load_ASN1_strings'; } {Do not localize} + {CH fn_X509_asn1_meth = 'X509_asn1_meth'; } {Do not localize} + {CH fn_RSAPrivateKey_asn1_meth = 'RSAPrivateKey_asn1_meth'; } {Do not localize} + {CH fn_ASN1_IA5STRING_asn1_meth = 'ASN1_IA5STRING_asn1_meth'; } {Do not localize} + {CH fn_ASN1_BIT_STRING_asn1_meth = 'ASN1_BIT_STRING_asn1_meth'; } {Do not localize} + {CH fn_ASN1_TYPE_set_octetstring = 'ASN1_TYPE_set_octetstring'; } {Do not localize} + {CH fn_ASN1_TYPE_get_octetstring = 'ASN1_TYPE_get_octetstring'; } {Do not localize} + {CH fn_ASN1_TYPE_set_int_octetstring = 'ASN1_TYPE_set_int_octetstring'; } {Do not localize} + {CH fn_ASN1_TYPE_get_int_octetstring = 'ASN1_TYPE_get_int_octetstring'; } {Do not localize} + {CH fn_ASN1_seq_unpack = 'ASN1_seq_unpack'; } {Do not localize} + {CH fn_ASN1_seq_pack = 'ASN1_seq_pack'; } {Do not localize} + {CH fn_ASN1_unpack_string = 'ASN1_unpack_string'; } {Do not localize} + {CH fn_ASN1_pack_string = 'ASN1_pack_string'; } {Do not localize} + {CH fn_ASN1_item_unpack = 'ASN1_item_unpack'; } {Do not localize} + {CH fn_ASN1_item_pack = 'ASN1_item_pack'; } {Do not localize} + {CH fn_ASN1_STRING_set_default_mask = 'ASN1_STRING_set_default_mask'; } {Do not localize} + {CH fn_ASN1_STRING_set_default_mask_asc = 'ASN1_STRING_set_default_mask_asc'; } {Do not localize} + {CH fn_ASN1_STRING_get_default_mask = 'ASN1_STRING_get_default_mask'; } {Do not localize} + {CH fn_ASN1_mbstring_copy = 'ASN1_mbstring_copy'; } {Do not localize} + {CH fn_ASN1_mbstring_ncopy = 'ASN1_mbstring_ncopy'; } {Do not localize} + {CH fn_ASN1_STRING_set_by_NID = 'ASN1_STRING_set_by_NID'; } {Do not localize} + {CH fn_ASN1_STRING_TABLE_get = 'ASN1_STRING_TABLE_get'; } {Do not localize} + {CH fn_ASN1_STRING_TABLE_add = 'ASN1_STRING_TABLE_add'; } {Do not localize} + {CH fn_ASN1_STRING_TABLE_cleanup = 'ASN1_STRING_TABLE_cleanup'; } {Do not localize} + {CH fn_ASN1_item_new = 'ASN1_item_new'; } {Do not localize} + {CH fn_ASN1_item_free = 'ASN1_item_free'; } {Do not localize} + {CH fn_ASN1_item_d2i = 'ASN1_item_d2i'; } {Do not localize} + {CH fn_ASN1_item_i2d = 'ASN1_item_i2d'; } {Do not localize} + {CH fn_ASN1_item_ndef_i2d = 'ASN1_item_ndef_i2d'; } {Do not localize} + {CH fn_ASN1_add_oid_module = 'ASN1_add_oid_module'; } {Do not localize} + {CH fn_ASN1_generate_nconf = 'ASN1_generate_nconf'; } {Do not localize} + {CH fn_ASN1_generate_v3 = 'ASN1_generate_v3'; } {Do not localize} + {CH fn_int_smime_write_ASN1 = 'int_smime_write_ASN1'; } {Do not localize} + {CH fn_SMIME_read_ASN1 = 'SMIME_read_ASN1'; } {Do not localize} + {CH fn_OBJ_NAME_init = 'OBJ_NAME_init'; } {Do not localize} + {CH fn_OBJ_NAME_new_index = 'OBJ_NAME_new_index'; } {Do not localize} + {CH fn_OBJ_NAME_get = 'OBJ_NAME_get'; } {Do not localize} + {CH fn_OBJ_NAME_add = 'OBJ_NAME_add'; } {Do not localize} + {CH fn_OBJ_NAME_remove = 'OBJ_NAME_remove'; } {Do not localize} + {CH fn_OBJ_NAME_cleanup = 'OBJ_NAME_cleanup'; } {Do not localize} + {CH fn_OBJ_dup = 'OBJ_dup'; } {Do not localize} + fn_OBJ_nid2obj = 'OBJ_nid2obj'; {Do not localize} + fn_OBJ_nid2ln = 'OBJ_nid2ln'; {Do not localize} + fn_OBJ_nid2sn = 'OBJ_nid2sn'; {Do not localize} + fn_OBJ_obj2nid = 'OBJ_obj2nid'; {Do not localize} + {CH fn_OBJ_txt2obj = 'OBJ_txt2obj'; } {Do not localize} + {CH fn_OBJ_obj2txt = 'OBJ_obj2txt'; } {Do not localize} + {CH fn_OBJ_txt2nid = 'OBJ_txt2nid'; } {Do not localize} + {CH fn_OBJ_ln2nid = 'OBJ_ln2nid'; } {Do not localize} + {CH fn_OBJ_sn2nid = 'OBJ_sn2nid'; } {Do not localize} + {CH fn_OBJ_cmp = 'OBJ_cmp'; } {Do not localize} + {CH fn_OBJ_bsearch = 'OBJ_bsearch'; } {Do not localize} + {CH fn_ERR_load_OBJ_strings = 'ERR_load_OBJ_strings'; } {Do not localize} + {CH fn_OBJ_new_nid = 'OBJ_new_nid'; } {Do not localize} + {CH fn_OBJ_add_object = 'OBJ_add_object'; } {Do not localize} + {CH fn_OBJ_create = 'OBJ_create'; } {Do not localize} + {CH fn_OBJ_cleanup = 'OBJ_cleanup'; } {Do not localize} + {CH fn_OBJ_create_objects = 'OBJ_create_objects'; } {Do not localize} + {===} + fn_EVP_MD_type = 'EVP_MD_type'; {Do not localize} + fn_EVP_MD_pkey_type = 'EVP_MD_pkey_type'; {Do not localize} + fn_EVP_MD_size = 'EVP_MD_size'; {Do not localize} + fn_EVP_MD_block_size = 'EVP_MD_block_size'; {Do not localize} + fn_EVP_MD_flags = 'EVP_MD_flags'; {Do not localize} + fn_EVP_MD_CTX_md = 'EVP_MD_CTX_md'; {Do not localize} + fn_EVP_CIPHER_nid = 'EVP_CIPHER_nid'; {Do not localize} + fn_EVP_CIPHER_block_size = 'EVP_CIPHER_block_size'; {Do not localize} + fn_EVP_CIPHER_key_length = 'EVP_CIPHER_key_length'; {Do not localize} + fn_EVP_CIPHER_iv_length = 'EVP_CIPHER_iv_length'; {Do not localize} + fn_EVP_CIPHER_flags = 'EVP_CIPHER_flags'; {Do not localize} + fn_EVP_CIPHER_CTX_cipher = 'EVP_CIPHER_CTX_cipher'; {Do not localize} + fn_EVP_CIPHER_CTX_nid = 'EVP_CIPHER_CTX_nid'; {Do not localize} + fn_EVP_CIPHER_CTX_block_size = 'EVP_CIPHER_CTX_block_size'; {Do not localize} + fn_EVP_CIPHER_CTX_key_length = 'EVP_CIPHER_CTX_key_length'; {Do not localize} + fn_EVP_CIPHER_CTX_iv_length = 'EVP_CIPHER_CTX_iv_length'; {Do not localize} + fn_EVP_CIPHER_CTX_get_app_data = 'EVP_CIPHER_CTX_get_app_data'; {Do not localize} + fn_EVP_CIPHER_CTX_set_app_data = 'EVP_CIPHER_CTX_set_app_data'; {Do not localize} + fn_EVP_CIPHER_CTX_flags = 'EVP_CIPHER_CTX_flags'; {Do not localize} + fn_EVP_Cipher = 'EVP_Cipher'; {Do not localize} + fn_EVP_MD_CTX_init = 'EVP_MD_CTX_init'; {Do not localize} + fn_EVP_MD_CTX_cleanup = 'EVP_MD_CTX_cleanup'; {Do not localize} + fn_EVP_MD_CTX_create = 'EVP_MD_CTX_create'; {Do not localize} + fn_EVP_MD_CTX_destroy = 'EVP_MD_CTX_destroy'; {Do not localize} + fn_EVP_MD_CTX_copy_ex = 'EVP_MD_CTX_copy_ex'; {Do not localize} + fn_EVP_MD_CTX_set_flags = 'EVP_MD_CTX_set_flags'; {Do not localize} + fn_EVP_MD_CTX_clear_flags = 'EVP_MD_CTX_clear_flags'; {Do not localize} + fn_EVP_MD_CTX_test_flags = 'EVP_MD_CTX_test_flags'; {Do not localize} + fn_EVP_DigestInit_ex = 'EVP_DigestInit_ex'; {Do not localize} + fn_EVP_DigestUpdate = 'EVP_DigestUpdate'; {Do not localize} + fn_EVP_DigestFinal_ex = 'EVP_DigestFinal_ex'; {Do not localize} + fn_EVP_Digest = 'EVP_Digest'; {Do not localize} + fn_EVP_MD_CTX_copy = 'EVP_MD_CTX_copy'; {Do not localize} + fn_EVP_DigestInit = 'EVP_DigestInit'; {Do not localize} + fn_EVP_DigestFinal = 'EVP_DigestFinal'; {Do not localize} + fn_EVP_read_pw_string = 'EVP_read_pw_string'; {Do not localize} + fn_EVP_set_pw_prompt = 'EVP_set_pw_prompt'; {Do not localize} + fn_EVP_get_pw_prompt = 'EVP_get_pw_prompt'; {Do not localize} + fn_EVP_BytesToKey = 'EVP_BytesToKey'; {Do not localize} + fn_EVP_CIPHER_CTX_set_flags = 'EVP_CIPHER_CTX_set_flags'; {Do not localize} + fn_EVP_CIPHER_CTX_clear_flags = 'EVP_CIPHER_CTX_clear_flags'; {Do not localize} + fn_EVP_CIPHER_CTX_test_flags = 'EVP_CIPHER_CTX_test_flags'; {Do not localize} + fn_EVP_EncryptInit = 'EVP_EncryptInit'; {Do not localize} + fn_EVP_EncryptInit_ex = 'EVP_EncryptInit_ex'; {Do not localize} + fn_EVP_EncryptUpdate = 'EVP_EncryptUpdate'; {Do not localize} + fn_EVP_EncryptFinal = 'EVP_EncryptFinal'; {Do not localize} + fn_EVP_EncryptFinal_ex = 'EVP_EncryptFinal_ex'; {Do not localize} + fn_EVP_DecryptInit = 'EVP_DecryptInit'; {Do not localize} + fn_EVP_DecryptInit_ex = 'EVP_DecryptInit_ex'; {Do not localize} + fn_EVP_DecryptUpdate = 'EVP_DecryptUpdate'; {Do not localize} + fn_EVP_DecryptFinal = 'EVP_DecryptFinal'; {Do not localize} + fn_EVP_DecryptFinal_ex = 'EVP_DecryptFinal_ex'; {Do not localize} + fn_EVP_CipherInit = 'EVP_CipherInit'; {Do not localize} + fn_EVP_CipherInit_ex = 'EVP_CipherInit_ex'; {Do not localize} + fn_EVP_CipherUpdate = 'EVP_CipherUpdate'; {Do not localize} + fn_EVP_CipherFinal = 'EVP_CipherFinal'; {Do not localize} + fn_EVP_CipherFinal_ex = 'EVP_CipherFinal_ex'; {Do not localize} + + fn_EVP_DigestSignInit = 'EVP_DigestSignInit'; {Do not localize} + fn_EVP_DigestSignFinal = 'EVP_DigestSignFinal'; {Do not localize} + fn_EVP_DigestVerifyInit = 'EVP_DigestVerifyInit'; {Do not localize} + fn_EVP_DigestVerifyFinal = 'EVP_DigestVerifyFinal'; {Do not localize} + + fn_EVP_SignFinal = 'EVP_SignFinal'; {Do not localize} + fn_EVP_VerifyFinal = 'EVP_VerifyFinal'; {Do not localize} + fn_EVP_OpenInit = 'EVP_OpenInit'; {Do not localize} + fn_EVP_OpenFinal = 'EVP_OpenFinal'; {Do not localize} + fn_EVP_SealInit = 'EVP_SealInit'; {Do not localize} + fn_EVP_SealFinal = 'EVP_SealFinal'; {Do not localize} + fn_EVP_EncodeInit = 'EVP_EncodeInit'; {Do not localize} + fn_EVP_EncodeUpdate = 'EVP_EncodeUpdate'; {Do not localize} + fn_EVP_EncodeFinal = 'EVP_EncodeFinal'; {Do not localize} + fn_EVP_EncodeBlock = 'EVP_EncodeBlock'; {Do not localize} + fn_EVP_DecodeInit = 'EVP_DecodeInit'; {Do not localize} + fn_EVP_DecodeUpdate = 'EVP_DecodeUpdate'; {Do not localize} + fn_EVP_DecodeFinal = 'EVP_DecodeFinal'; {Do not localize} + fn_EVP_DecodeBlock = 'EVP_DecodeBlock'; {Do not localize} + fn_EVP_CIPHER_CTX_init = 'EVP_CIPHER_CTX_init'; {Do not localize} + fn_EVP_CIPHER_CTX_cleanup = 'EVP_CIPHER_CTX_cleanup'; {Do not localize} + fn_EVP_CIPHER_CTX_new = 'EVP_CIPHER_CTX_new'; {Do not localize} + fn_EVP_CIPHER_CTX_set_key_length = 'EVP_CIPHER_CTX_set_key_length'; {Do not localize} + fn_EVP_CIPHER_CTX_ctrl = 'EVP_CIPHER_CTX_ctrl'; {Do not localize} + fn_EVP_CIPHER_CTX_rand_key = 'EVP_CIPHER_CTX_rand_key'; {Do not localize} + fn_EVP_CIPHER_CTX_copy = 'EVP_CIPHER_CTX_copy'; {Do not localize} + fn_EVP_CIPHER_CTX_free = 'EVP_CIPHER_CTX_free'; {Do not localize} + fn_EVP_CIPHER_CTX_set_padding = 'EVP_CIPHER_CTX_set_padding'; {Do not localize} + {$IFNDEF OPENSSL_NO_BIO} + fn_BIO_f_md = 'BIO_f_md'; {Do not localize} + fn_BIO_f_base64 = 'BIO_f_base64'; {Do not localize} + fn_BIO_f_cipher = 'BIO_f_cipher'; {Do not localize} + fn_BIO_f_reliable = 'BIO_f_reliable'; {Do not localize} + fn_BIO_set_cipher = 'BIO_set_cipher'; {Do not localize} + {$ENDIF} + fn_EVP_md_null = 'EVP_md_null'; {Do not localize} + {$IFNDEF OPENSSL_NO_MD2} + fn_EVP_md2 = 'EVP_md2'; {Do not localize} + {$ENDIF} + {$IFNDEF OPENSSL_NO_MD4} + fn_EVP_md4 = 'EVP_md4'; {Do not localize} + {$ENDIF} + {$IFNDEF OPENSSL_NO_MD5} + fn_EVP_md5 = 'EVP_md5'; {Do not localize} + {$ENDIF} + {$IFNDEF OPENSSL_NO_SHA} + fn_EVP_sha = 'EVP_sha'; {Do not localize} + fn_EVP_sha1 = 'EVP_sha1'; {Do not localize} + fn_EVP_dss = 'EVP_dss'; {Do not localize} + fn_EVP_dss1 = 'EVP_dss1'; {Do not localize} + fn_EVP_ecdsa = 'EVP_ecdsa'; {Do not localize} + {$ENDIF} + {$IFNDEF OPENSSL_NO_SHA256} + fn_EVP_sha512 = 'EVP_sha512'; {Do not localize} + fn_EVP_sha384 = 'EVP_sha384'; {Do not localize} + {$ENDIF} + {$IFNDEF OPENSSL_NO_SHA512} + fn_EVP_sha256 = 'EVP_sha256'; {Do not localize} + fn_EVP_sha224 = 'EVP_sha224'; {Do not localize} + {$ENDIF} + {$IFNDEF OPENSSL_NO_MDC2} + fn_EVP_mdc2 = 'EVP_mdc2'; {Do not localize} + {$ENDIF} + {$IFNDEF OPENSSL_NO_RIPEMD} + fn_EVP_ripemd160 = 'EVP_ripemd160'; {Do not localize} + {$ENDIF} + {$ifndef OPENSSL_NO_WHIRLPOOL} + fn_EVP_whirlpool = 'EVP_whirlpool'; {Do not localize} + {$ENDIF} + fn_EVP_enc_null = 'EVP_enc_null'; {Do not localize} + {$IFNDEF OPENSSL_NO_DES} + fn_EVP_des_ecb = 'EVP_des_ecb'; {Do not localize} + fn_EVP_des_ede = 'EVP_des_ede'; {Do not localize} + fn_EVP_des_ede3 = 'EVP_des_ede3'; {Do not localize} + fn_EVP_des_cfb = 'EVP_des_cfb'; {Do not localize} + fn_EVP_des_ede_cfb = 'EVP_des_ede_cfb'; {Do not localize} + fn_EVP_des_ede3_cfb = 'EVP_des_ede3_cfb'; {Do not localize} + fn_EVP_des_ofb = 'EVP_des_ofb'; {Do not localize} + fn_EVP_des_ede_ofb = 'EVP_des_ede_ofb'; {Do not localize} + fn_EVP_des_ede3_ofb = 'EVP_des_ede3_ofb'; {Do not localize} + fn_EVP_des_cbc = 'EVP_des_cbc'; {Do not localize} + fn_EVP_des_ede_cbc = 'EVP_des_ede_cbc'; {Do not localize} + fn_EVP_des_ede3_cbc = 'EVP_des_ede3_cbc'; {Do not localize} + fn_EVP_desx_cbc = 'EVP_desx_cbc'; {Do not localize} + fn_EVP_des_ede3_cfb8 = 'EVP_des_ede3_cfb8'; {Do not localize} + fn_EVP_des_ede_ecb = 'EVP_des_ede_ecb'; {Do not localize} + fn_EVP_des_ede3_ecb = 'EVP_des_ede3_ecb'; + fn_EVP_des_cfb64 = 'EVP_des_cfb64'; + + fn_EVP_des_cfb1 = 'EVP_des_cfb1'; + fn_EVP_des_cfb8 = 'EVP_des_cfb8'; + fn_EVP_des_ede_cfb64 = 'EVP_des_ede_cfb64'; +//#if 0 + fn_EVP_des_ede_cfb1 = 'EVP_des_ede_cfb1'; + fn_EVP_des_ede_cfb8 = 'EVP_des_ede_cfb8'; + //#endif + fn_EVP_des_ede3_cfb64 = 'EVP_des_ede3_cfb64'; + fn_EVP_des_ede3_cfb1 = 'EVP_des_ede3_cfb1'; + {$ENDIF} + {$IFNDEF OPENSSL_NO_RC4} + fn_EVP_rc4 = 'EVP_rc4'; {Do not localize} + fn_EVP_rc4_40 = 'EVP_rc4_40'; {Do not localize} + {$ifndef OPENSSL_NO_MD5} + fn_EVP_rc4_hmac_md5 = 'EVP_rc4_hmac_md5'; {Do not localize} + {$endif} + {$ENDIF} + {$IFNDEF OPENSSL_NO_IDEA} + fn_EVP_idea_ecb = 'EVP_idea_ecb'; {Do not localize} + fn_EVP_idea_cfb64 = 'EVP_idea_cfb64'; {Do not localize} + fn_EVP_idea_cfb = 'EVP_idea_cfb'; {Do not localize} + fn_EVP_idea_ofb = 'EVP_idea_ofb'; {Do not localize} + fn_EVP_idea_cbc = 'EVP_idea_cbc'; {Do not localize} + {$ENDIF} + {$IFNDEF OPENSSL_NO_RC2} + fn_EVP_rc2_ecb = 'EVP_rc2_ecb'; {Do not localize} + fn_EVP_rc2_cbc = 'EVP_rc2_cbc'; {Do not localize} + fn_EVP_rc2_40_cbc = 'EVP_rc2_40_cbc'; {Do not localize} + fn_EVP_rc2_64_cbc = 'EVP_rc2_64_cbc'; {Do not localize} + fn_EVP_rc2_cfb64 = 'EVP_rc2_cfb64'; {Do not localize} + fn_EVP_rc2_cfb = 'EVP_rc2_cfb'; {Do not localize} + fn_EVP_rc2_ofb = 'EVP_rc2_ofb'; {Do not localize} + {$ENDIF} + {$IFNDEF OPENSSL_NO_BF} + fn_EVP_bf_ecb = 'EVP_bf_ecb'; {Do not localize} + fn_EVP_bf_cbc = 'EVP_bf_cbc'; {Do not localize} + fn_EVP_bf_cfb = 'EVP_bf_cfb'; {Do not localize} + fn_EVP_bf_cfb64 = 'EVP_bf_cfb64'; {Do not localize} + fn_EVP_bf_ofb = 'EVP_bf_ofb'; {Do not localize} + {$ENDIF} + {$IFNDEF OPENSSL_NO_CAST} + fn_EVP_cast5_ecb = 'EVP_cast5_ecb'; {Do not localize} + fn_EVP_cast5_cbc = 'EVP_cast5_cbc'; {Do not localize} + fn_EVP_cast5_cfb = 'EVP_cast5_cfb'; {Do not localize} + fn_EVP_cast5_cfb64 = 'EVP_cast5_cfb64'; {Do not localize} + fn_EVP_cast5_ofb = 'EVP_cast5_ofb'; {Do not localize} + {$ENDIF} + {$IFNDEF OPENSSL_NO_RC5 } + fn_EVP_rc5_32_12_16_cbc = 'EVP_rc5_32_12_16_cbc'; {Do not localize} + fn_EVP_rc5_32_12_16_ecb = 'EVP_rc5_32_12_16_ecb'; {Do not localize} + fn_EVP_rc5_32_12_16_cfb = 'EVP_rc5_32_12_16_cfb'; {Do not localize} + fn_EVP_rc5_32_12_16_cfb64 = 'EVP_rc5_32_12_16_cfb64'; {Do not localize} + fn_EVP_rc5_32_12_16_ofb = 'EVP_rc5_32_12_16_ofb'; {Do not localize} + {$ENDIF} + {$IFNDEF OPENSSL_NO_AES} + fn_EVP_aes_128_ecb = 'EVP_aes_128_ecb'; {do not localize} + fn_EVP_aes_128_cbc = 'EVP_aes_128_cbc'; {do not localize} + fn_EVP_aes_128_cfb1 = 'EVP_aes_128_cfb1'; {do not localize} + fn_EVP_aes_128_cfb8 = 'EVP_aes_128_cfb8';{do not localize} + fn_EVP_aes_128_cfb128 = 'EVP_aes_128_cfb128'; {do not localize} + fn_EVP_aes_128_ofb = 'EVP_aes_128_ofb'; {do not localize} + fn_EVP_aes_128_ctr = 'EVP_aes_128_ctr'; {Do not localize} + fn_EVP_aes_128_gcm = 'EVP_aes_128_gcm'; {Do not localize} + fn_EVP_aes_128_ccm = 'EVP_aes_128_ccm'; {Do not localize} + fn_EVP_aes_128_xts = 'EVP_aes_128_xts'; {Do not localize} + fn_EVP_aes_192_ecb = 'EVP_aes_192_ecb'; {Do not localize} + fn_EVP_aes_192_cbc = 'EVP_aes_192_cbc'; {Do not localize} + fn_EVP_aes_192_cfb1 = 'EVP_aes_192_cfb1'; {Do not localize} + fn_EVP_aes_192_cfb8 = 'EVP_aes_192_cfb8'; {Do not localize} + fn_EVP_aes_192_cfb128 = 'EVP_aes_192_cfb128'; {Do not localize} + fn_EVP_aes_192_ctr = 'EVP_aes_192_ctr'; {Do not localize} + fn_EVP_aes_192_gcm = 'EVP_aes_192_gcm'; {Do not localize} + fn_EVP_aes_192_ccm = 'EVP_aes_192_ccm'; {Do not localize} + fn_EVP_aes_192_ofb = 'EVP_aes_192_ofb'; {Do not localize} + fn_EVP_aes_256_ecb = 'EVP_aes_256_ecb'; {Do not localize} + fn_EVP_aes_256_cbc = 'EVP_aes_256_cbc'; {Do not localize} + fn_EVP_aes_256_cfb1 = 'EVP_aes_256_cfb1'; {Do not localize} + fn_EVP_aes_256_cfb8 = 'EVP_aes_256_cfb8'; {Do not localize} + fn_EVP_aes_256_cfb128 = 'EVP_aes_256_cfb128'; {Do not localize} + fn_EVP_aes_256_ofb = 'EVP_aes_256_ofb'; {Do not localize} + fn_EVP_aes_256_ctr = 'EVP_aes_256_ctr'; {Do not localize} + fn_EVP_aes_256_gcm = 'EVP_aes_256_gcm'; {Do not localize} + fn_EVP_aes_256_ccm = 'EVP_aes_256_ccm'; {Do not localize} + fn_EVP_aes_256_xts = 'EVP_aes_256_xts'; {Do not localize} + {$ifndef OPENSSL_NO_SHA} + {$ifndef OPENSSL_NO_SHA1} + fn_EVP_aes_128_cbc_hmac_sha1 = 'EVP_aes_128_cbc_hmac_sha1'; {Do not localize} + fn_EVP_aes_256_cbc_hmac_sha1 = 'EVP_aes_256_cbc_hmac_sha1'; {do not localize} + {$endif} + {$endif} + {$endif} + {$IFNDEF OPENSSL_NO_CAMELLIA} + fn_EVP_camellia_128_ecb = 'EVP_camellia_128_ecb'; {Do not localize} + fn_EVP_camellia_128_cbc = 'EVP_camellia_128_cbc'; {Do not localize} + fn_EVP_camellia_128_cfb1 = 'EVP_camellia_128_cfb1'; {Do not localize} + fn_EVP_camellia_128_cfb8 = 'EVP_camellia_128_cfb8'; {Do not localize} + fn_EVP_camellia_128_cfb128 = 'EVP_camellia_128_cfb128'; {Do not localize} + fn_EVP_camellia_128_ofb = 'EVP_camellia_128_ofb'; {Do not localize} + fn_EVP_camellia_192_ecb = 'EVP_camellia_192_ecb'; {Do not localize} + fn_EVP_camellia_192_cbc = 'EVP_camellia_192_cbc'; {Do not localize} + fn_EVP_camellia_192_cfb1 = 'EVP_camellia_192_cfb1'; {Do not localize} + fn_EVP_camellia_192_cfb8 = 'EVP_camellia_192_cfb8'; {Do not localize} + fn_EVP_camellia_192_cfb128 = 'EVP_camellia_192_cfb128'; {Do not localize} + fn_EVP_camellia_192_ofb = 'EVP_camellia_192_ofb'; {Do not localize} + fn_EVP_camellia_256_ecb = 'EVP_camellia_256_ecb'; {Do not localize} + fn_EVP_camellia_256_cbc = 'EVP_camellia_256_cbc'; {Do not localize} + fn_EVP_camellia_256_cfb1 = 'EVP_camellia_256_cfb1'; {Do not localize} + fn_EVP_camellia_256_cfb8 = 'EVP_camellia_256_cfb8'; {Do not localize} + fn_EVP_camellia_256_cfb128 = 'EVP_camellia_256_cfb128'; {Do not localize} + fn_EVP_camellia_256_ofb = 'EVP_camellia_256_ofb'; {Do not localize} + {$ENDIF} + {$IFNDEF OPENSSL_NO_SEED} + fn_EVP_seed_ecb = 'EVP_seed_ecb'; {Do not localize} + fn_EVP_seed_cbc = 'EVP_seed_cbc'; {Do not localize} + fn_EVP_seed_cfb128 = 'EVP_seed_cfb128'; {Do not localize} + fn_EVP_seed_ofb = 'EVP_seed_ofb'; {Do not localize} + {$ENDIF} + fn_OPENSSL_add_all_algorithms_noconf = 'OPENSSL_add_all_algorithms_noconf'; {Do not localize} + { fn_OPENSSL_add_all_algorithms_conf = 'OPENSSL_add_all_algorithms_conf'; }{Do not localize} + fn_OpenSSL_add_all_algorithms = 'OpenSSL_add_all_algorithms'; + fn_OpenSSL_add_all_ciphers = 'OpenSSL_add_all_ciphers'; {Do not localize} + fn_OpenSSL_add_all_digests = 'OpenSSL_add_all_digests'; {Do not localize} + fn_EVP_add_cipher = 'EVP_add_cipher'; {Do not localize} + fn_EVP_add_digest = 'EVP_add_digest'; {Do not localize} + fn_EVP_CIPHER_do_all = 'EVP_CIPHER_do_all'; {Do not localize} + fn_EVP_CIPHER_do_all_sorted = 'EVP_CIPHER_do_all_sorted'; {do not localize} + fn_EVP_MD_do_all = 'EVP_MD_do_all'; {Do not localize} + fn_EVP_MD_do_all_sorted = 'EVP_MD_do_all_sorted'; {Do not localize} + fn_EVP_get_cipherbyname = 'EVP_get_cipherbyname'; {Do not localize} + fn_EVP_get_digestbyname = 'EVP_get_digestbyname'; {Do not localize} + fn_EVP_PKEY_decrypt_old = 'EVP_PKEY_decrypt_old'; {Do not localize} + fn_EVP_PKEY_encrypt_old = 'EVP_PKEY_encrypt_old'; {Do not localize} + + fn_EVP_cleanup = 'EVP_cleanup'; {Do not localize} + fn_EVP_PKEY_decrypt = 'EVP_PKEY_decrypt'; {Do not localize} + fn_EVP_PKEY_encrypt = 'EVP_PKEY_encrypt'; {Do not localize} + fn_EVP_PKEY_type = 'EVP_PKEY_type'; {Do not localize} + fn_EVP_PKEY_id = 'EVP_PKEY_id'; {Do not localize} + fn_EVP_PKEY_bits = 'EVP_PKEY_bits'; {Do not localize} + fn_EVP_PKEY_base_id = 'EVP_PKEY_base_id'; {Do not localize} + fn_EVP_PKEY_set_type = 'EVP_PKEY_set_type'; {Do not localize} + fn_EVP_PKEY_set_type_str = 'EVP_PKEY_set_type_str'; {Do not localize} + fn_EVP_PKEY_size = 'EVP_PKEY_size'; {Do not localize} + fn_EVP_PKEY_assign = 'EVP_PKEY_assign'; {Do not localize} + fn_EVP_PKEY_get0 = 'EVP_PKEY_get0'; {Do not localize} + {$IFNDEF OPENSSL_NO_RSA} + fn_EVP_PKEY_set1_RSA = 'EVP_PKEY_set1_RSA'; {Do not localize} + fn_EVP_PKEY_get1_RSA = 'EVP_PKEY_get1_RSA'; {Do not localize} + {$ENDIF} + {$IFNDEF OPENSSL_NO_DSA} + fn_EVP_PKEY_set1_DSA = 'EVP_PKEY_set1_DSA'; {Do not localize} + fn_EVP_PKEY_get1_DSA = 'EVP_PKEY_get1_DSA'; {Do not localize} + {$ENDIF} + {$IFNDEF OPENSSL_NO_DH} + fn_EVP_PKEY_set1_DH = 'EVP_PKEY_set1_DH'; {Do not localize} + fn_EVP_PKEY_get1_DH = 'EVP_PKEY_get1_DH'; {Do not localize} + {$ENDIF} + {$IFNDEF OPENSSL_NO_EC} + fn_EVP_PKEY_set1_EC_KEY = 'EVP_PKEY_set1_EC_KEY'; {Do not localize} + fn_EVP_PKEY_get1_EC_KEY = 'EVP_PKEY_get1_EC_KEY'; {Do not localize} + {$ENDIF} + fn_EVP_PKEY_new = 'EVP_PKEY_new'; {Do not localize} + fn_EVP_PKEY_free = 'EVP_PKEY_free'; {Do not localize} + fn_d2i_PublicKey = 'd2i_PublicKey'; {Do not localize} + fn_i2d_PublicKey = 'i2d_PublicKey'; {Do not localize} + fn_d2i_PrivateKey = 'd2i_PrivateKey'; {Do not localize} + fn_d2i_AutoPrivateKey = 'd2i_AutoPrivateKey'; {Do not localize} + fn_i2d_PrivateKey = 'i2d_PrivateKey'; {Do not localize} + fn_EVP_PKEY_copy_parameters = 'EVP_PKEY_copy_parameters'; {Do not localize} + fn_EVP_PKEY_missing_parameters = 'EVP_PKEY_missing_parameters'; {Do not localize} + fn_EVP_PKEY_save_parameters = 'EVP_PKEY_save_parameters'; {Do not localize} + fn_EVP_PKEY_cmp_parameters = 'EVP_PKEY_cmp_parameters'; {Do not localize} + fn_EVP_PKEY_cmp = 'EVP_PKEY_cmp'; {Do not localize} + fn_EVP_PKEY_print_public = 'EVP_PKEY_print_public'; {Do not localize} + fn_EVP_PKEY_print_private = 'EVP_PKEY_print_private'; {Do not localize} + fn_EVP_PKEY_print_params = 'EVP_PKEY_print_params'; {Do not localize} + fn_EVP_PKEY_get_default_digest_nid = 'EVP_PKEY_get_default_digest_nid'; {Do not localize} + fn_EVP_CIPHER_type = 'EVP_CIPHER_type'; {Do not localize} + fn_EVP_CIPHER_param_to_asn1 = 'EVP_CIPHER_param_to_asn1'; {Do not localize} + fn_EVP_CIPHER_asn1_to_param = 'EVP_CIPHER_asn1_to_param'; {Do not localize} + fn_EVP_CIPHER_set_asn1_iv = 'EVP_CIPHER_set_asn1_iv'; {Do not localize} + fn_EVP_CIPHER_get_asn1_iv = 'EVP_CIPHER_get_asn1_iv'; {Do not localize} + fn_PKCS5_PBE_keyivgen = 'PKCS5_PBE_keyivgen'; {Do not localize} + fn_PKCS5_PBKDF2_HMAC = 'PKCS5_PBKDF2_HMAC'; {Do not lozalize} + fn_PKCS5_PBKDF2_HMAC_SHA1 = 'PKCS5_PBKDF2_HMAC_SHA1'; {Do not localize} + fn_PKCS5_v2_PBE_keyivgen = 'PKCS5_v2_PBE_keyivgen'; {Do not localize} + fn_PKCS5_PBE_add = 'PKCS5_PBE_add'; {Do not localize} + fn_EVP_PBE_CipherInit = 'EVP_PBE_CipherInit'; {Do not localize} + fn_EVP_PBE_alg_add = 'EVP_PBE_alg_add'; {Do not localize} + fn_EVP_PBE_alg_add_type = 'EVP_PBE_alg_add_type'; {Do not localize} + fn_EVP_PBE_find = 'EVP_PBE_find'; {Do not localize} + fn_EVP_PBE_cleanup = 'EVP_PBE_cleanup'; {Do not localize} + fn_EVP_PKEY_asn1_get_count = 'EVP_PKEY_asn1_get_count'; + fn_EVP_PKEY_asn1_get0 = 'EVP_PKEY_asn1_get0'; + fn_EVP_PKEY_asn1_find = 'EVP_PKEY_asn1_find'; + fn_EVP_PKEY_asn1_find_str = 'EVP_PKEY_asn1_find_str'; + fn_EVP_PKEY_asn1_add0 = 'EVP_PKEY_asn1_add0'; + fn_EVP_PKEY_asn1_add_alias = 'EVP_PKEY_asn1_add_alias'; + fn_EVP_PKEY_asn1_get0_info = 'EVP_PKEY_asn1_get0_info'; + fn_EVP_PKEY_get0_asn1 = 'EVP_PKEY_get0_asn1'; + fn_EVP_PKEY_asn1_new = 'EVP_PKEY_asn1_new'; + fn_EVP_PKEY_asn1_copy = 'EVP_PKEY_asn1_copy'; + fn_EVP_PKEY_asn1_free = 'EVP_PKEY_asn1_free'; + fn_EVP_PKEY_asn1_set_public = 'EVP_PKEY_asn1_set_public'; + fn_EVP_PKEY_asn1_set_private = 'EVP_PKEY_asn1_set_private'; + fn_EVP_PKEY_asn1_set_param = 'EVP_PKEY_asn1_set_param'; + fn_EVP_PKEY_asn1_set_free = 'EVP_PKEY_asn1_set_free'; + fn_EVP_PKEY_asn1_set_ctrl = 'EVP_PKEY_asn1_set_ctrl'; + fn_EVP_PKEY_meth_find = 'EVP_PKEY_meth_find'; + fn_EVP_PKEY_meth_new = 'EVP_PKEY_meth_new'; + fn_EVP_PKEY_meth_get0_info = 'EVP_PKEY_meth_get0_info'; + fn_EVP_PKEY_meth_copy = 'EVP_PKEY_meth_copy'; + fn_EVP_PKEY_meth_free = 'EVP_PKEY_meth_free'; + fn_EVP_PKEY_meth_add0 = 'EVP_PKEY_meth_add0'; + fn_EVP_PKEY_CTX_new = 'EVP_PKEY_CTX_new'; + fn_EVP_PKEY_CTX_new_id = 'EVP_PKEY_CTX_new_id'; + fn_EVP_PKEY_CTX_dup = 'EVP_PKEY_CTX_dup'; + fn_EVP_PKEY_CTX_free = 'EVP_PKEY_CTX_free'; + fn_EVP_PKEY_CTX_ctrl = 'EVP_PKEY_CTX_ctrl'; + fn_EVP_PKEY_CTX_ctrl_str = 'EVP_PKEY_CTX_ctrl_str'; + fn_EVP_PKEY_CTX_get_operation = 'EVP_PKEY_CTX_get_operation'; + fn_EVP_PKEY_CTX_set0_keygen_info = 'EVP_PKEY_CTX_set0_keygen_info'; + fn_EVP_PKEY_new_mac_key = 'EVP_PKEY_new_mac_key'; + fn_EVP_PKEY_CTX_set_data = 'EVP_PKEY_CTX_set_data'; + fn_EVP_PKEY_CTX_get_data = 'EVP_PKEY_CTX_get_data'; + fn_EVP_PKEY_CTX_get0_pkey = 'EVP_PKEY_CTX_get0_pkey'; + fn_EVP_PKEY_CTX_get0_peerkey = 'EVP_PKEY_CTX_get0_peerkey'; + fn_EVP_PKEY_CTX_set_app_data = 'EVP_PKEY_CTX_set_app_data'; + fn_EVP_PKEY_CTX_get_app_data = 'EVP_PKEY_CTX_get_app_data'; + fn_EVP_PKEY_sign_init = 'EVP_PKEY_sign_init'; + fn_EVP_PKEY_sign = 'EVP_PKEY_sign'; + fn_EVP_PKEY_verify_init = 'EVP_PKEY_verify_init'; + fn_EVP_PKEY_verify = 'EVP_PKEY_verify'; + fn_EVP_PKEY_verify_recover_init = 'EVP_PKEY_verify_recover_init'; + fn_EVP_PKEY_verify_recover = 'EVP_PKEY_verify_recover'; + fn_EVP_PKEY_encrypt_init = 'EVP_PKEY_encrypt_init'; + fn_EVP_PKEY_decrypt_init = 'EVP_PKEY_decrypt_init'; + fn_EVP_PKEY_derive_init = 'EVP_PKEY_derive_init'; + fn_EVP_PKEY_derive_set_peer = 'EVP_PKEY_derive_set_peer'; + fn_EVP_PKEY_derive = 'EVP_PKEY_derive'; + fn_EVP_PKEY_paramgen_init = 'EVP_PKEY_paramgen_init'; + fn_EVP_PKEY_paramgen = 'EVP_PKEY_paramgen'; + fn_EVP_PKEY_keygen_init = 'EVP_PKEY_keygen_init'; + fn_EVP_PKEY_keygen = 'EVP_PKEY_keygen'; + fn_EVP_PKEY_CTX_set_cb = 'EVP_PKEY_CTX_set_cb'; + fn_EVP_PKEY_CTX_get_cb = 'EVP_PKEY_CTX_get_cb'; + fn_EVP_PKEY_CTX_get_keygen_info = 'EVP_PKEY_CTX_get_keygen_info'; + fn_EVP_PKEY_meth_set_init = 'EVP_PKEY_meth_set_init'; + fn_EVP_PKEY_meth_set_copy = 'EVP_PKEY_meth_set_copy'; + fn_EVP_PKEY_meth_set_cleanup = 'EVP_PKEY_meth_set_cleanup'; + fn_EVP_PKEY_meth_set_paramgen = 'EVP_PKEY_meth_set_paramgen'; + fn_EVP_PKEY_meth_set_keygen = 'EVP_PKEY_meth_set_keygen'; + fn_EVP_PKEY_meth_set_sign = 'EVP_PKEY_meth_set_sign'; + fn_EVP_PKEY_meth_set_verify = 'EVP_PKEY_meth_set_verify'; + fn_EVP_PKEY_meth_set_verify_recover = 'EVP_PKEY_meth_set_verify_recover'; + fn_EVP_PKEY_meth_set_signctx = 'EVP_PKEY_meth_set_signctx'; + fn_EVP_PKEY_meth_set_verifyctx = 'EVP_PKEY_meth_set_verifyctx'; + fn_EVP_PKEY_meth_set_encrypt = 'EVP_PKEY_meth_set_encrypt'; + fn_EVP_PKEY_meth_set_decrypt = 'EVP_PKEY_meth_set_decrypt'; + fn_EVP_PKEY_meth_set_derive = 'EVP_PKEY_meth_set_derive'; + fn_EVP_PKEY_meth_set_ctrl = 'EVP_PKEY_meth_set_ctrl'; + + {$IFDEF OPENSSL_FIPS} + {$IFNDEF OPENSSL_NO_ENGINE} + fn_EVP_MD_set_engine_callbacks = 'EVP_MD_set_engine_callbacks'; {Do not localize} + fn_int_EVP_MD_init_engine_callbacks = 'int_EVP_MD_init_engine_callbacks'; {Do not localize} + fn_int_EVP_CIPHER_set_engine_callbacks = 'int_EVP_CIPHER_set_engine_callbacks'; {Do not localize} + fn_int_EVP_CIPHER_init_engine_callbacks = 'int_EVP_CIPHER_init_engine_callbacks'; {Do not localize} + {$ENDIF} + {$ENDIF} + fn_EVP_add_alg_module = 'EVP_add_alg_module'; {Do not localize} + {CH fn_ERR_load_EVP_strings = 'ERR_load_EVP_strings'; } {Do not localize} + {$IFDEF OPENSSL_FIPS} + fn_FIPS_mode_set = 'FIPS_mode_set'; {Do not localize} + fn_FIPS_mode = 'FIPS_mode'; {Do not localize} + {CH fn_FIPS_rand_check = 'FIPS_rand_check'; } {Do not localize} + {CH fn_FIPS_selftest_failed = 'FIPS_selftest_failed'; } {Do not localize} + fn_FIPS_selftest_check = 'FIPS_selftest_check'; {Do not localize} + {CH fn_FIPS_corrupt_sha1 = 'FIPS_corrupt_sha1'; } {Do not localize} + {CH fn_FIPS_selftest_sha1 = 'FIPS_selftest_sha1'; } {Do not localize} + {CH fb_FIPS_corrupt_aes = 'FIPS_corrupt_aes'; } {Do not localize} + {CH fn_FIPS_selftest_aes = 'FIPS_selftest_aes'; } {Do not localize} + {CH fn_FIPS_corrupt_des = 'FIPS_corrupt_des'; } {Do not localize} + {CH fn_FIPS_selftest_des = 'FIPS_selftest_des'; } {Do not localize} + {CH fn_FIPS_corrupt_rsa = 'FIPS_corrupt_rsa'; } {Do not localize} + {CH fn_FIPS_corrupt_rsa_keygen = 'FIPS_corrupt_rsa_keygen'; } {Do not localize} + {CH fn_FIPS_selftest_rsa = 'FIPS_selftest_rsa'; } {Do not localize} + {CH fn_FIPS_corrupt_dsa = 'FIPS_corrupt_dsa'; } {Do not localize} + {CH fn_FIPS_corrupt_dsa_keygen = 'FIPS_corrupt_dsa_keygen'; } {Do not localize} + {CH fn_FIPS_selftest_dsa = 'FIPS_selftest_dsa'; } {Do not localize} + {CH fn_FIPS_corrupt_rng = 'FIPS_corrupt_rng'; } {Do not localize} + {CH fn_FIPS_rng_stick = 'FIPS_rng_stick'; } {Do not localize} + {CH fn_FIPS_selftest_rng = 'FIPS_selftest_rng'; } {Do not localize} + {CH fn_FIPS_selftest_hmac = 'FIPS_selftest_hmac'; } {Do not localize} + {CH fn_fips_pkey_signature_test = 'fips_pkey_signature_test'; } {Do not localize} + {CH fn_fips_cipher_test = 'fips_cipher_test'; } {Do not localize} + //fips_rand.h + {CH fn_FIPS_rand_set_key = 'FIPS_rand_set_key'; } {Do not localize} + {CH fn_FIPS_rand_seed = 'FIPS_rand_seed; } {Do not localize} + {CH fn_FIPS_rand_bytes = 'FIPS_rand_bytes'; } {Do not localize} + {CH fn_FIPS_rand_test_mode = 'FIPS_rand_test_mode'; } {Do not localize} + {CH fn_FIPS_rand_reset = 'FIPS_rand_reset'; } {Do not localize} + {CH fn_FIPS_rand_set_dt = 'FIPS_rand_set_dt'; } {Do not localize} + {CH fn_FIPS_rand_status = 'FIPS_rand_status'; } {Do not localize} + {CH fn_FIPS_rand_method = 'FIPS_rand_method'; } {Do not localize} + {$ENDIF} + {CH fn_sk_X509_ALGOR_new = 'sk_X509_ALGOR_new'; } {Do not localize} + {CH fn_sk_X509_ALGOR_new_null = 'sk_X509_ALGOR_new_null'; } {Do not localize} + {CH fn_sk_X509_ALGOR_free = 'sk_X509_ALGOR_free'; } {Do not localize} + {CH fn_sk_X509_ALGOR_num = 'sk_X509_ALGOR_num'; } {Do not localize} + {CH fn_sk_X509_ALGOR_value = 'sk_X509_ALGOR_value'; } {Do not localize} + {CH fn_sk_X509_ALGOR_set = 'sk_X509_ALGOR_set'; } {Do not localize} + {CH fn_sk_X509_ALGOR_zero = 'sk_X509_ALGOR_zero'; } {Do not localize} + {CH fn_sk_X509_ALGOR_push = 'sk_X509_ALGOR_push'; } {Do not localize} + {CH fn_sk_X509_ALGOR_unshift = 'sk_X509_ALGOR_unshift'; } {Do not localize} + {CH fn_sk_X509_ALGOR_find = 'sk_X509_ALGOR_find'; } {Do not localize} + {CH fn_sk_X509_ALGOR_delete = 'sk_X509_ALGOR_delete'; } {Do not localize} + {CH fn_sk_X509_ALGOR_delete_ptr = 'sk_X509_ALGOR_delete_ptr'; } {Do not localize} + {CH fn_sk_X509_ALGOR_insert = 'sk_X509_ALGOR_insert'; } {Do not localize} + {CH fn_sk_X509_ALGOR_dup = 'sk_X509_ALGOR_dup'; } {Do not localize} + {CH fn_sk_X509_ALGOR_pop_free = 'sk_X509_ALGOR_pop_free'; } {Do not localize} + {CH fn_sk_X509_ALGOR_shift = 'sk_X509_ALGOR_shift'; } {Do not localize} + {CH fn_sk_X509_ALGOR_pop = 'sk_X509_ALGOR_pop'; } {Do not localize} + {CH fn_sk_X509_ALGOR_sort = 'sk_X509_ALGOR_sort'; } {Do not localize} + {CH fn_i2d_ASN1_SET_OF_X509_ALGOR = 'i2d_ASN1_SET_OF_X509_ALGOR'; } {Do not localize} + {CH fn_d2i_ASN1_SET_OF_X509_ALGOR = 'd2i_ASN1_SET_OF_X509_ALGOR'; } {Do not localize} + {CH fn_sk_X509_NAME_ENTRY_new = 'sk_X509_NAME_ENTRY_new'; } {Do not localize} + {CH fn_sk_X509_NAME_ENTRY_new_null = 'sk_X509_NAME_ENTRY_new_null'; } {Do not localize} + {CH fn_sk_X509_NAME_ENTRY_free = 'sk_X509_NAME_ENTRY_free'; } {Do not localize} + {CH fn_sk_X509_NAME_ENTRY_num = 'sk_X509_NAME_ENTRY_num'; } {Do not localize} + {CH fn_sk_X509_NAME_ENTRY_value = 'sk_X509_NAME_ENTRY_value'; } {Do not localize} + {CH fn_sk_X509_NAME_ENTRY_set = 'sk_X509_NAME_ENTRY_set'; } {Do not localize} + {CH fn_sk_X509_NAME_ENTRY_zero = 'sk_X509_NAME_ENTRY_zero'; } {Do not localize} + {CH fn_sk_X509_NAME_ENTRY_push = 'sk_X509_NAME_ENTRY_push'; } {Do not localize} + {CH fn_sk_X509_NAME_ENTRY_unshift = 'sk_X509_NAME_ENTRY_unshift'; } {Do not localize} + {CH fn_sk_X509_NAME_ENTRY_find = 'sk_X509_NAME_ENTRY_find'; } {Do not localize} + {CH fn_sk_X509_NAME_ENTRY_delete = 'sk_X509_NAME_ENTRY_delete'; } {Do not localize} + {CH fn_sk_X509_NAME_ENTRY_delete_ptr = 'sk_X509_NAME_ENTRY_delete_ptr'; } {Do not localize} + {CH fn_sk_X509_NAME_ENTRY_insert = 'sk_X509_NAME_ENTRY_insert'; } {Do not localize} + {CH fn_sk_X509_NAME_ENTRY_dup = 'sk_X509_NAME_ENTRY_dup'; } {Do not localize} + {CH fn_sk_X509_NAME_ENTRY_pop_free = 'sk_X509_NAME_ENTRY_pop_free'; } {Do not localize} + {CH fn_sk_X509_NAME_ENTRY_shift = 'sk_X509_NAME_ENTRY_shift'; } {Do not localize} + {CH fn_sk_X509_NAME_ENTRY_pop = 'sk_X509_NAME_ENTRY_pop'; } {Do not localize} + {CH fn_sk_X509_NAME_ENTRY_sort = 'sk_X509_NAME_ENTRY_sort'; } {Do not localize} + {CH fn_i2d_ASN1_SET_OF_X509_NAME_ENTRY = 'i2d_ASN1_SET_OF_X509_NAME_ENTRY'; } {Do not localize} + {CH fn_d2i_ASN1_SET_OF_X509_NAME_ENTRY = 'd2i_ASN1_SET_OF_X509_NAME_ENTRY'; } {Do not localize} + {CH fn_sk_X509_NAME_new = 'sk_X509_NAME_new'; } {Do not localize} + {CH fn_sk_X509_NAME_new_null = 'sk_X509_NAME_new_null'; } {Do not localize} + {CH fn_sk_X509_NAME_free = 'sk_X509_NAME_free'; } {Do not localize} + {CH fn_sk_X509_NAME_num = 'sk_X509_NAME_num'; } {Do not localize} + {CH fn_sk_X509_NAME_value = 'sk_X509_NAME_value'; } {Do not localize} + {CH fn_sk_X509_NAME_set = 'sk_X509_NAME_set'; } {Do not localize} + {CH fn_sk_X509_NAME_zero = 'sk_X509_NAME_zero'; } {Do not localize} + {CH fn_sk_X509_NAME_push = 'sk_X509_NAME_push'; } {Do not localize} + {CH fn_sk_X509_NAME_unshift = 'sk_X509_NAME_unshift'; } {Do not localize} + {CH fn_sk_X509_NAME_find = 'sk_X509_NAME_find'; } {Do not localize} + {CH fn_sk_X509_NAME_delete = 'sk_X509_NAME_delete'; } {Do not localize} + {CH fn_sk_X509_NAME_delete_ptr = 'sk_X509_NAME_delete_ptr'; } {Do not localize} + {CH fn_sk_X509_NAME_insert = 'sk_X509_NAME_insert'; } {Do not localize} + {CH fn_sk_X509_NAME_dup = 'sk_X509_NAME_dup'; } {Do not localize} + {CH fn_sk_X509_NAME_pop_free = 'sk_X509_NAME_pop_free'; } {Do not localize} + {CH fn_sk_X509_NAME_shift = 'sk_X509_NAME_shift'; } {Do not localize} + {CH fn_sk_X509_NAME_pop = 'sk_X509_NAME_pop'; } {Do not localize} + {CH fn_sk_X509_NAME_sort = 'sk_X509_NAME_sort'; } {Do not localize} + {CH fn_sk_X509_EXTENSION_new = 'sk_X509_EXTENSION_new'; } {Do not localize} + {CH fn_sk_X509_EXTENSION_new_null = 'sk_X509_EXTENSION_new_null'; } {Do not localize} + {CH fn_sk_X509_EXTENSION_free = 'sk_X509_EXTENSION_free'; } {Do not localize} + {CH fn_sk_X509_EXTENSION_num = 'sk_X509_EXTENSION_num'; } {Do not localize} + {CH fn_sk_X509_EXTENSION_value = 'sk_X509_EXTENSION_value'; } {Do not localize} + {CH fn_sk_X509_EXTENSION_set = 'sk_X509_EXTENSION_set'; } {Do not localize} + {CH fn_sk_X509_EXTENSION_zero = 'sk_X509_EXTENSION_zero'; } {Do not localize} + {CH fn_sk_X509_EXTENSION_push = 'sk_X509_EXTENSION_push'; } {Do not localize} + {CH fn_sk_X509_EXTENSION_unshift = 'sk_X509_EXTENSION_unshift'; } {Do not localize} + {CH fn_sk_X509_EXTENSION_find = 'sk_X509_EXTENSION_find'; } {Do not localize} + {CH fn_sk_X509_EXTENSION_delete = 'sk_X509_EXTENSION_delete'; } {Do not localize} + {CH fn_sk_X509_EXTENSION_delete_ptr = 'sk_X509_EXTENSION_delete_ptr'; } {Do not localize} + {CH fn_sk_X509_EXTENSION_insert = 'sk_X509_EXTENSION_insert'; } {Do not localize} + {CH fn_sk_X509_EXTENSION_dup = 'sk_X509_EXTENSION_dup'; } {Do not localize} + {CH fn_sk_X509_EXTENSION_pop_free = 'sk_X509_EXTENSION_pop_free'; } {Do not localize} + {CH fn_sk_X509_EXTENSION_shift = 'sk_X509_EXTENSION_shift'; } {Do not localize} + {CH fn_sk_X509_EXTENSION_pop = 'sk_X509_EXTENSION_pop'; } {Do not localize} + {CH fn_sk_X509_EXTENSION_sort = 'sk_X509_EXTENSION_sort'; } {Do not localize} + {CH fn_i2d_ASN1_SET_OF_X509_EXTENSION = 'i2d_ASN1_SET_OF_X509_EXTENSION'; } {Do not localize} + {CH fn_d2i_ASN1_SET_OF_X509_EXTENSION = 'd2i_ASN1_SET_OF_X509_EXTENSION'; } {Do not localize} + {CH fn_sk_X509_ATTRIBUTE_new = 'sk_X509_ATTRIBUTE_new'; } {Do not localize} + {CH fn_sk_X509_ATTRIBUTE_new_null = 'sk_X509_ATTRIBUTE_new_null'; } {Do not localize} + {CH fn_sk_X509_ATTRIBUTE_free = 'sk_X509_ATTRIBUTE_free'; } {Do not localize} + {CH fn_sk_X509_ATTRIBUTE_num = 'sk_X509_ATTRIBUTE_num'; } {Do not localize} + {CH fn_sk_X509_ATTRIBUTE_value = 'sk_X509_ATTRIBUTE_value'; } {Do not localize} + {CH fn_sk_X509_ATTRIBUTE_set = 'sk_X509_ATTRIBUTE_set'; } {Do not localize} + {CH fn_sk_X509_ATTRIBUTE_zero = 'sk_X509_ATTRIBUTE_zero'; } {Do not localize} + {CH fn_sk_X509_ATTRIBUTE_push = 'sk_X509_ATTRIBUTE_push'; } {Do not localize} + {CH fn_sk_X509_ATTRIBUTE_unshift = 'sk_X509_ATTRIBUTE_unshift'; } {Do not localize} + {CH fn_sk_X509_ATTRIBUTE_find = 'sk_X509_ATTRIBUTE_find'; } {Do not localize} + {CH fn_sk_X509_ATTRIBUTE_delete = 'sk_X509_ATTRIBUTE_delete'; } {Do not localize} + {CH fn_sk_X509_ATTRIBUTE_delete_ptr = 'sk_X509_ATTRIBUTE_delete_ptr'; } {Do not localize} + {CH fn_sk_X509_ATTRIBUTE_insert = 'sk_X509_ATTRIBUTE_insert'; } {Do not localize} + {CH fn_sk_X509_ATTRIBUTE_dup = 'sk_X509_ATTRIBUTE_dup'; } {Do not localize} + {CH fn_sk_X509_ATTRIBUTE_pop_free = 'sk_X509_ATTRIBUTE_pop_free'; } {Do not localize} + {CH fn_sk_X509_ATTRIBUTE_shift = 'sk_X509_ATTRIBUTE_shift'; } {Do not localize} + {CH fn_sk_X509_ATTRIBUTE_pop = 'sk_X509_ATTRIBUTE_pop'; } {Do not localize} + {CH fn_sk_X509_ATTRIBUTE_sort = 'sk_X509_ATTRIBUTE_sort'; } {Do not localize} + {CH fn_i2d_ASN1_SET_OF_X509_ATTRIBUTE = 'i2d_ASN1_SET_OF_X509_ATTRIBUTE'; } {Do not localize} + {CH fn_d2i_ASN1_SET_OF_X509_ATTRIBUTE = 'd2i_ASN1_SET_OF_X509_ATTRIBUTE'; } {Do not localize} + {CH fn_sk_X509_new = 'sk_X509_new'; } {Do not localize} + {CH fn_sk_X509_new_null = 'sk_X509_new_null'; } {Do not localize} + {CH fn_sk_X509_free = 'sk_X509_free'; } {Do not localize} + {CH fn_sk_X509_num = 'sk_X509_num'; } {Do not localize} + {CH fn_sk_X509_value = 'sk_X509_value'; } {Do not localize} + {CH fn_sk_X509_set = 'sk_X509_set'; } {Do not localize} + {CH fn_sk_X509_zero = 'sk_X509_zero'; } {Do not localize} + {CH fn_sk_X509_push = 'sk_X509_push'; } {Do not localize} + {CH fn_sk_X509_unshift = 'sk_X509_unshift'; } {Do not localize} + {CH fn_sk_X509_find = 'sk_X509_find'; } {Do not localize} + {CH fn_sk_X509_delete = 'sk_X509_delete'; } {Do not localize} + {CH fn_sk_X509_delete_ptr = 'sk_X509_delete_ptr'; } {Do not localize} + {CH fn_sk_X509_insert = 'sk_X509_insert'; } {Do not localize} + {CH fn_sk_X509_dup = 'sk_X509_dup'; } {Do not localize} + {CH fn_sk_X509_pop_free = 'sk_X509_pop_free'; } {Do not localize} + {CH fn_sk_X509_shift = 'sk_X509_shift'; } {Do not localize} + {CH fn_sk_X509_pop = 'sk_X509_pop'; } {Do not localize} + {CH fn_sk_X509_sort = 'sk_X509_sort'; } {Do not localize} + {CH fn_i2d_ASN1_SET_OF_X509 = 'i2d_ASN1_SET_OF_X509'; } {Do not localize} + {CH fn_d2i_ASN1_SET_OF_X509 = 'd2i_ASN1_SET_OF_X509'; } {Do not localize} + {CH fn_sk_X509_REVOKED_new = 'sk_X509_REVOKED_new'; } {Do not localize} + {CH fn_sk_X509_REVOKED_new_null = 'sk_X509_REVOKED_new_null'; } {Do not localize} + {CH fn_sk_X509_REVOKED_free = 'sk_X509_REVOKED_free'; } {Do not localize} + {CH fn_sk_X509_REVOKED_num = 'sk_X509_REVOKED_num'; } {Do not localize} + {CH fn_sk_X509_REVOKED_value = 'sk_X509_REVOKED_value'; } {Do not localize} + {CH fn_sk_X509_REVOKED_set = 'sk_X509_REVOKED_set'; } {Do not localize} + {CH fn_sk_X509_REVOKED_zero = 'sk_X509_REVOKED_zero'; } {Do not localize} + {CH fn_sk_X509_REVOKED_push = 'sk_X509_REVOKED_push'; } {Do not localize} + {CH fn_sk_X509_REVOKED_unshift = 'sk_X509_REVOKED_unshift'; } {Do not localize} + {CH fn_sk_X509_REVOKED_find = 'sk_X509_REVOKED_find'; } {Do not localize} + {CH fn_sk_X509_REVOKED_delete = 'sk_X509_REVOKED_delete'; } {Do not localize} + {CH fn_sk_X509_REVOKED_delete_ptr = 'sk_X509_REVOKED_delete_ptr'; } {Do not localize} + {CH fn_sk_X509_REVOKED_insert = 'sk_X509_REVOKED_insert'; } {Do not localize} + {CH fn_sk_X509_REVOKED_dup = 'sk_X509_REVOKED_dup'; } {Do not localize} + {CH fn_sk_X509_REVOKED_pop_free = 'sk_X509_REVOKED_pop_free'; } {Do not localize} + {CH fn_sk_X509_REVOKED_shift = 'sk_X509_REVOKED_shift'; } {Do not localize} + {CH fn_sk_X509_REVOKED_pop = 'sk_X509_REVOKED_pop'; } {Do not localize} + {CH fn_sk_X509_REVOKED_sort = 'sk_X509_REVOKED_sort'; } {Do not localize} + {CH fn_i2d_ASN1_SET_OF_X509_REVOKED = 'i2d_ASN1_SET_OF_X509_REVOKED'; } {Do not localize} + {CH fn_d2i_ASN1_SET_OF_X509_REVOKED = 'd2i_ASN1_SET_OF_X509_REVOKED'; } {Do not localize} + {CH fn_sk_X509_CRL_new = 'sk_X509_CRL_new'; } {Do not localize} + {CH fn_sk_X509_CRL_new_null = 'sk_X509_CRL_new_null'; } {Do not localize} + {CH fn_sk_X509_CRL_free = 'sk_X509_CRL_free'; } {Do not localize} + {CH fn_sk_X509_CRL_num = 'sk_X509_CRL_num'; } {Do not localize} + {CH fn_sk_X509_CRL_value = 'sk_X509_CRL_value'; } {Do not localize} + {CH fn_sk_X509_CRL_set = 'sk_X509_CRL_set'; } {Do not localize} + {CH fn_sk_X509_CRL_zero = 'sk_X509_CRL_zero'; } {Do not localize} + {CH fn_sk_X509_CRL_push = 'sk_X509_CRL_push'; } {Do not localize} + {CH fn_sk_X509_CRL_unshift = 'sk_X509_CRL_unshift'; } {Do not localize} + {CH fn_sk_X509_CRL_find = 'sk_X509_CRL_find'; } {Do not localize} + {CH fn_sk_X509_CRL_delete = 'sk_X509_CRL_delete'; } {Do not localize} + {CH fn_sk_X509_CRL_delete_ptr = 'sk_X509_CRL_delete_ptr'; } {Do not localize} + {CH fn_sk_X509_CRL_insert = 'sk_X509_CRL_insert'; } {Do not localize} + {CH fn_sk_X509_CRL_dup = 'sk_X509_CRL_dup'; } {Do not localize} + {CH fn_sk_X509_CRL_pop_free = 'sk_X509_CRL_pop_free'; } {Do not localize} + {CH fn_sk_X509_CRL_shift = 'sk_X509_CRL_shift'; } {Do not localize} + {CH fn_sk_X509_CRL_pop = 'sk_X509_CRL_pop'; } {Do not localize} + {CH fn_sk_X509_CRL_sort = 'sk_X509_CRL_sort'; } {Do not localize} + {CH fn_i2d_ASN1_SET_OF_X509_CRL = 'i2d_ASN1_SET_OF_X509_CRL'; } {Do not localize} + {CH fn_d2i_ASN1_SET_OF_X509_CRL = 'd2i_ASN1_SET_OF_X509_CRL'; } {Do not localize} + {CH fn_sk_X509_INFO_new = 'sk_X509_INFO_new'; } {Do not localize} + {CH fn_sk_X509_INFO_new_null = 'sk_X509_INFO_new_null'; } {Do not localize} + {CH fn_sk_X509_INFO_free = 'sk_X509_INFO_free'; } {Do not localize} + {CH fn_sk_X509_INFO_num = 'sk_X509_INFO_num'; } {Do not localize} + {CH fn_sk_X509_INFO_value = 'sk_X509_INFO_value'; } {Do not localize} + {CH fn_sk_X509_INFO_set = 'sk_X509_INFO_set'; } {Do not localize} + {CH fn_sk_X509_INFO_zero = 'sk_X509_INFO_zero'; } {Do not localize} + {CH fn_sk_X509_INFO_push = 'sk_X509_INFO_push'; } {Do not localize} + {CH fn_sk_X509_INFO_unshift = 'sk_X509_INFO_unshift'; } {Do not localize} + {CH fn_sk_X509_INFO_find = 'sk_X509_INFO_find'; } {Do not localize} + {CH fn_sk_X509_INFO_delete = 'sk_X509_INFO_delete'; } {Do not localize} + {CH fn_sk_X509_INFO_delete_ptr = 'sk_X509_INFO_delete_ptr'; } {Do not localize} + {CH fn_sk_X509_INFO_insert = 'sk_X509_INFO_insert'; } {Do not localize} + {CH fn_sk_X509_INFO_dup = 'sk_X509_INFO_dup'; } {Do not localize} + {CH fn_sk_X509_INFO_pop_free = 'sk_X509_INFO_pop_free'; } {Do not localize} + {CH fn_sk_X509_INFO_shift = 'sk_X509_INFO_shift'; } {Do not localize} + {CH fn_sk_X509_INFO_pop = 'sk_X509_INFO_pop'; } {Do not localize} + {CH fn_sk_X509_INFO_sort = 'sk_X509_INFO_sort'; } {Do not localize} + {CH fn_sk_X509_LOOKUP_new = 'sk_X509_LOOKUP_new'; } {Do not localize} + {CH fn_sk_X509_LOOKUP_new_null = 'sk_X509_LOOKUP_new_null'; } {Do not localize} + {CH fn_sk_X509_LOOKUP_free = 'sk_X509_LOOKUP_free'; } {Do not localize} + {CH fn_sk_X509_LOOKUP_num = 'sk_X509_LOOKUP_num'; } {Do not localize} + {CH fn_sk_X509_LOOKUP_value = 'sk_X509_LOOKUP_value'; } {Do not localize} + {CH fn_sk_X509_LOOKUP_set = 'sk_X509_LOOKUP_set'; } {Do not localize} + {CH fn_sk_X509_LOOKUP_zero = 'sk_X509_LOOKUP_zero'; } {Do not localize} + {CH fn_sk_X509_LOOKUP_push = 'sk_X509_LOOKUP_push'; } {Do not localize} + {CH fn_sk_X509_LOOKUP_unshift = 'sk_X509_LOOKUP_unshift'; } {Do not localize} + {CH fn_sk_X509_LOOKUP_find = 'sk_X509_LOOKUP_find'; } {Do not localize} + {CH fn_sk_X509_LOOKUP_delete = 'sk_X509_LOOKUP_delete'; } {Do not localize} + {CH fn_sk_X509_LOOKUP_delete_ptr = 'sk_X509_LOOKUP_delete_ptr'; } {Do not localize} + {CH fn_sk_X509_LOOKUP_insert = 'sk_X509_LOOKUP_insert'; } {Do not localize} + {CH fn_sk_X509_LOOKUP_dup = 'sk_X509_LOOKUP_dup'; } {Do not localize} + {CH fn_sk_X509_LOOKUP_pop_free = 'sk_X509_LOOKUP_pop_free'; } {Do not localize} + {CH fn_sk_X509_LOOKUP_shift = 'sk_X509_LOOKUP_shift'; } {Do not localize} + {CH fn_sk_X509_LOOKUP_pop = 'sk_X509_LOOKUP_pop'; } {Do not localize} + {CH fn_sk_X509_LOOKUP_sort = 'sk_X509_LOOKUP_sort'; } {Do not localize} + {CH fn_X509_OBJECT_retrieve_by_subject = 'X509_OBJECT_retrieve_by_subject'; } {Do not localize} + {CH fn_X509_OBJECT_up_ref_count = 'X509_OBJECT_up_ref_count'; } {Do not localize} + {CH fn_X509_OBJECT_free_contents = 'X509_OBJECT_free_contents'; } {Do not localize} + {CH fn_X509_STORE_new = 'X509_STORE_new'; } {Do not localize} + {CH fn_X509_STORE_free = 'X509_STORE_free'; } {Do not localize} + {CH fn_X509_STORE_CTX_init = 'X509_STORE_CTX_init'; } {Do not localize} + {CH fn_X509_STORE_CTX_cleanup = 'X509_STORE_CTX_cleanup'; } {Do not localize} + fn_X509_STORE_add_lookup = 'X509_STORE_add_lookup'; {Do not localize} + {CH fn_X509_LOOKUP_hash_dir = 'X509_LOOKUP_hash_dir'; } {Do not localize} + {CH fn_X509_LOOKUP_file = 'X509_LOOKUP_file'; } {Do not localize} + fn_X509_STORE_add_cert = 'X509_STORE_add_cert'; {Do not localize} + fn_X509_STORE_add_crl = 'X509_STORE_add_crl'; {Do not localize} + {CH fn_X509_STORE_get_by_subject = 'X509_STORE_get_by_subject'; } {Do not localize} + fn_X509_LOOKUP_ctrl = 'X509_LOOKUP_ctrl'; {Do not localize} + {CH fn_X509_load_cert_file = 'X509_load_cert_file'; } {Do not localize} + {CH fn_X509_load_crl_file = 'X509_load_crl_file'; } {Do not localize} + {CH fn_X509_LOOKUP_new = 'X509_LOOKUP_new'; } {Do not localize} + {CH fn_X509_LOOKUP_free = 'X509_LOOKUP_free'; } {Do not localize} + {CH fn_X509_LOOKUP_init = 'X509_LOOKUP_init'; } {Do not localize} + {CH fn_X509_LOOKUP_by_subject = 'X509_LOOKUP_by_subject'; } {Do not localize} + {CH fn_X509_LOOKUP_by_issuer_serial = 'X509_LOOKUP_by_issuer_serial'; } {Do not localize} + {CH fn_X509_LOOKUP_by_fingerprint = 'X509_LOOKUP_by_fingerprint'; } {Do not localize} + {CH fn_X509_LOOKUP_by_alias = 'X509_LOOKUP_by_alias'; } {Do not localize} + {CH fn_X509_LOOKUP_shutdown = 'X509_LOOKUP_shutdown'; } {Do not localize} + fn_X509_STORE_load_locations = 'X509_STORE_load_locations'; {Do not localize} + {CH fn_X509_STORE_set_default_paths = 'X509_STORE_set_default_paths'; } {Do not localize} + {CH fn_X509_STORE_CTX_get_ex_new_index = 'X509_STORE_CTX_get_ex_new_index'; } {Do not localize} + {CH fn_X509_STORE_CTX_set_ex_data = 'X509_STORE_CTX_set_ex_data'; } {Do not localize} + fn_X509_STORE_CTX_get_ex_data = 'X509_STORE_CTX_get_ex_data'; {Do not localize} + fn_X509_STORE_CTX_get_error = 'X509_STORE_CTX_get_error'; {Do not localize} + fn_X509_STORE_CTX_set_error = 'X509_STORE_CTX_set_error'; {Do not localize} + fn_X509_STORE_CTX_get_error_depth = 'X509_STORE_CTX_get_error_depth'; {Do not localize} + fn_X509_STORE_CTX_get_current_cert = 'X509_STORE_CTX_get_current_cert'; {Do not localize} + {CH fn_X509_STORE_CTX_get_chain = 'X509_STORE_CTX_get_chain'; } {Do not localize} + {CH fn_X509_STORE_CTX_set_cert = 'X509_STORE_CTX_set_cert'; } {Do not localize} + {CH fn_X509_STORE_CTX_set_chain = 'X509_STORE_CTX_set_chain'; } {Do not localize} + {CH fn_sk_PKCS7_SIGNER_INFO_new = 'sk_PKCS7_SIGNER_INFO_new'; } {Do not localize} + {CH fn_sk_PKCS7_SIGNER_INFO_new_null = 'sk_PKCS7_SIGNER_INFO_new_null'; } {Do not localize} + {CH fn_sk_PKCS7_SIGNER_INFO_free = 'sk_PKCS7_SIGNER_INFO_free'; } {Do not localize} + {CH fn_sk_PKCS7_SIGNER_INFO_num = 'sk_PKCS7_SIGNER_INFO_num'; } {Do not localize} + {CH fn_sk_PKCS7_SIGNER_INFO_value = 'sk_PKCS7_SIGNER_INFO_value'; } {Do not localize} + {CH fn_sk_PKCS7_SIGNER_INFO_set = 'sk_PKCS7_SIGNER_INFO_set'; } {Do not localize} + {CH fn_sk_PKCS7_SIGNER_INFO_zero = 'sk_PKCS7_SIGNER_INFO_zero'; } {Do not localize} + {CH fn_sk_PKCS7_SIGNER_INFO_push = 'sk_PKCS7_SIGNER_INFO_push'; } {Do not localize} + {CH fn_sk_PKCS7_SIGNER_INFO_unshift = 'sk_PKCS7_SIGNER_INFO_unshift'; } {Do not localize} + {CH fn_sk_PKCS7_SIGNER_INFO_find = 'sk_PKCS7_SIGNER_INFO_find'; } {Do not localize} + {CH fn_sk_PKCS7_SIGNER_INFO_delete = 'sk_PKCS7_SIGNER_INFO_delete'; } {Do not localize} + {CH fn_sk_PKCS7_SIGNER_INFO_delete_ptr = 'sk_PKCS7_SIGNER_INFO_delete_ptr'; } {Do not localize} + {CH fn_sk_PKCS7_SIGNER_INFO_insert = 'sk_PKCS7_SIGNER_INFO_insert'; } {Do not localize} + {CH fn_sk_PKCS7_SIGNER_INFO_dup = 'sk_PKCS7_SIGNER_INFO_dup'; } {Do not localize} + {CH fn_sk_PKCS7_SIGNER_INFO_pop_free = 'sk_PKCS7_SIGNER_INFO_pop_free'; } {Do not localize} + {CH fn_sk_PKCS7_SIGNER_INFO_shift = 'sk_PKCS7_SIGNER_INFO_shift'; } {Do not localize} + {CH fn_sk_PKCS7_SIGNER_INFO_pop = 'sk_PKCS7_SIGNER_INFO_pop'; } {Do not localize} + {CH fn_sk_PKCS7_SIGNER_INFO_sort = 'sk_PKCS7_SIGNER_INFO_sort'; } {Do not localize} + {CH fn_i2d_ASN1_SET_OF_PKCS7_SIGNER_INFO = 'i2d_ASN1_SET_OF_PKCS7_SIGNER_INFO'; } {Do not localize} + {CH fn_d2i_ASN1_SET_OF_PKCS7_SIGNER_INFO = 'd2i_ASN1_SET_OF_PKCS7_SIGNER_INFO'; } {Do not localize} + {CH fn_sk_PKCS7_RECIP_INFO_new = 'sk_PKCS7_RECIP_INFO_new'; } {Do not localize} + {CH fn_sk_PKCS7_RECIP_INFO_new_null = 'sk_PKCS7_RECIP_INFO_new_null'; } {Do not localize} + {CH fn_sk_PKCS7_RECIP_INFO_free = 'sk_PKCS7_RECIP_INFO_free'; } {Do not localize} + {CH fn_sk_PKCS7_RECIP_INFO_num = 'sk_PKCS7_RECIP_INFO_num'; } {Do not localize} + {CH fn_sk_PKCS7_RECIP_INFO_value = 'sk_PKCS7_RECIP_INFO_value'; } {Do not localize} + {CH fn_sk_PKCS7_RECIP_INFO_set = 'sk_PKCS7_RECIP_INFO_set'; } {Do not localize} + {CH fn_sk_PKCS7_RECIP_INFO_zero = 'sk_PKCS7_RECIP_INFO_zero'; } {Do not localize} + {CH fn_sk_PKCS7_RECIP_INFO_push = 'sk_PKCS7_RECIP_INFO_push'; } {Do not localize} + {CH fn_sk_PKCS7_RECIP_INFO_unshift = 'sk_PKCS7_RECIP_INFO_unshift'; } {Do not localize} + {CH fn_sk_PKCS7_RECIP_INFO_find = 'sk_PKCS7_RECIP_INFO_find'; } {Do not localize} + {CH fn_sk_PKCS7_RECIP_INFO_delete = 'sk_PKCS7_RECIP_INFO_delete'; } {Do not localize} + {CH fn_sk_PKCS7_RECIP_INFO_delete_ptr = 'sk_PKCS7_RECIP_INFO_delete_ptr'; } {Do not localize} + {CH fn_sk_PKCS7_RECIP_INFO_insert = 'sk_PKCS7_RECIP_INFO_insert'; } {Do not localize} + {CH fn_sk_PKCS7_RECIP_INFO_dup = 'sk_PKCS7_RECIP_INFO_dup'; } {Do not localize} + {CH fn_sk_PKCS7_RECIP_INFO_pop_free = 'sk_PKCS7_RECIP_INFO_pop_free'; } {Do not localize} + {CH fn_sk_PKCS7_RECIP_INFO_shift = 'sk_PKCS7_RECIP_INFO_shift'; } {Do not localize} + {CH fn_sk_PKCS7_RECIP_INFO_pop = 'sk_PKCS7_RECIP_INFO_pop'; } {Do not localize} + {CH fn_sk_PKCS7_RECIP_INFO_sort = 'sk_PKCS7_RECIP_INFO_sort'; } {Do not localize} + {CH fn_i2d_ASN1_SET_OF_PKCS7_RECIP_INFO = 'i2d_ASN1_SET_OF_PKCS7_RECIP_INFO'; } {Do not localize} + {CH fn_d2i_ASN1_SET_OF_PKCS7_RECIP_INFO = 'd2i_ASN1_SET_OF_PKCS7_RECIP_INFO'; } {Do not localize} + {CH fn_PKCS7_ISSUER_AND_SERIAL_new = 'PKCS7_ISSUER_AND_SERIAL_new'; } {Do not localize} + {CH fn_PKCS7_ISSUER_AND_SERIAL_free = 'PKCS7_ISSUER_AND_SERIAL_free'; } {Do not localize} + {CH fn_i2d_PKCS7_ISSUER_AND_SERIAL = 'i2d_PKCS7_ISSUER_AND_SERIAL'; } {Do not localize} + {CH fn_d2i_PKCS7_ISSUER_AND_SERIAL = 'd2i_PKCS7_ISSUER_AND_SERIAL'; } {Do not localize} + {CH fn_PKCS7_ISSUER_AND_SERIAL_digest = 'PKCS7_ISSUER_AND_SERIAL_digest'; } {Do not localize} + {$IFNDEF OPENSSL_NO_FP_API} + {CH fn_d2i_PKCS7_fp = 'd2i_PKCS7_fp'; } {Do not localize} + {CH fn_i2d_PKCS7_fp = 'i2d_PKCS7_fp'; } {Do not localize} + {$ENDIF} + {CH fn_PKCS7_dup = 'PKCS7_dup'; } {Do not localize} + {CH fn_d2i_PKCS7_bio = 'd2i_PKCS7_bio'; } {Do not localize} + {CH fn_i2d_PKCS7_bio = 'i2d_PKCS7_bio'; } {Do not localize} + {CH fn_PKCS7_SIGNER_INFO_new = 'PKCS7_SIGNER_INFO_new'; } {Do not localize} + {CH fn_PKCS7_SIGNER_INFO_free = 'PKCS7_SIGNER_INFO_free'; } {Do not localize} + {CH fn_i2d_PKCS7_SIGNER_INFO = 'i2d_PKCS7_SIGNER_INFO'; } {Do not localize} + {CH fn_d2i_PKCS7_SIGNER_INFO = 'd2i_PKCS7_SIGNER_INFO'; } {Do not localize} + {CH fn_PKCS7_RECIP_INFO_new = 'PKCS7_RECIP_INFO_new'; } {Do not localize} + {CH fn_PKCS7_RECIP_INFO_free = 'PKCS7_RECIP_INFO_free'; } {Do not localize} + {CH fn_i2d_PKCS7_RECIP_INFO = 'i2d_PKCS7_RECIP_INFO'; } {Do not localize} + {CH fn_d2i_PKCS7_RECIP_INFO = 'd2i_PKCS7_RECIP_INFO'; } {Do not localize} + {CH fn_PKCS7_SIGNED_new = 'PKCS7_SIGNED_new'; } {Do not localize} + {CH fn_PKCS7_SIGNED_free = 'PKCS7_SIGNED_free'; } {Do not localize} + {CH fn_i2d_PKCS7_SIGNED = 'i2d_PKCS7_SIGNED'; } {Do not localize} + {CH fn_d2i_PKCS7_SIGNED = 'd2i_PKCS7_SIGNED'; } {Do not localize} + {CH fn_PKCS7_ENC_CONTENT_new = 'PKCS7_ENC_CONTENT_new'; } {Do not localize} + {CH fn_PKCS7_ENC_CONTENT_free = 'PKCS7_ENC_CONTENT_free'; } {Do not localize} + {CH fn_i2d_PKCS7_ENC_CONTENT = 'i2d_PKCS7_ENC_CONTENT'; } {Do not localize} + {CH fn_d2i_PKCS7_ENC_CONTENT = 'd2i_PKCS7_ENC_CONTENT'; } {Do not localize} + {CH fn_PKCS7_ENVELOPE_new = 'PKCS7_ENVELOPE_new'; } {Do not localize} + {CH fn_PKCS7_ENVELOPE_free = 'PKCS7_ENVELOPE_free'; } {Do not localize} + {CH fn_i2d_PKCS7_ENVELOPE = 'i2d_PKCS7_ENVELOPE'; } {Do not localize} + {CH fn_d2i_PKCS7_ENVELOPE = 'd2i_PKCS7_ENVELOPE'; } {Do not localize} + {CH fn_PKCS7_SIGN_ENVELOPE_new = 'PKCS7_SIGN_ENVELOPE_new'; } {Do not localize} + {CH fn_PKCS7_SIGN_ENVELOPE_free = 'PKCS7_SIGN_ENVELOPE_free'; } {Do not localize} + {CH fn_i2d_PKCS7_SIGN_ENVELOPE = 'i2d_PKCS7_SIGN_ENVELOPE'; } {Do not localize} + {CH fn_d2i_PKCS7_SIGN_ENVELOPE = 'd2i_PKCS7_SIGN_ENVELOPE'; } {Do not localize} + {CH fn_PKCS7_DIGEST_new = 'PKCS7_DIGEST_new'; } {Do not localize} + {CH fn_PKCS7_DIGEST_free = 'PKCS7_DIGEST_free'; } {Do not localize} + {CH fn_i2d_PKCS7_DIGEST = 'i2d_PKCS7_DIGEST'; } {Do not localize} + {CH fn_d2i_PKCS7_DIGEST = 'd2i_PKCS7_DIGEST'; } {Do not localize} + {CH fn_PKCS7_ENCRYPT_new = 'PKCS7_ENCRYPT_new'; } {Do not localize} + {CH fn_PKCS7_ENCRYPT_free = 'PKCS7_ENCRYPT_free'; } {Do not localize} + {CH fn_i2d_PKCS7_ENCRYPT = 'i2d_PKCS7_ENCRYPT'; } {Do not localize} + {CH fn_d2i_PKCS7_ENCRYPT = 'd2i_PKCS7_ENCRYPT'; } {Do not localize} + {CH fn_PKCS7_new = 'PKCS7_new'; } {Do not localize} + {CH fn_PKCS7_free = 'PKCS7_free'; } {Do not localize} + {CH fn_PKCS7_content_free = 'PKCS7_content_free'; } {Do not localize} + fn_i2d_PKCS7 = 'i2d_PKCS7'; {Do not localize} + fn_d2i_PKCS7 = 'd2i_PKCS7'; {Do not localize} + {CH fn_ERR_load_PKCS7_strings = 'ERR_load_PKCS7_strings'; } {Do not localize} + {CH fn_PKCS7_ctrl = 'PKCS7_ctrl'; } {Do not localize} + {CH fn_PKCS7_set_type = 'PKCS7_set_type'; } {Do not localize} + {CH fn_PKCS7_set_content = 'PKCS7_set_content'; } {Do not localize} + {CH fn_PKCS7_SIGNER_INFO_set = 'PKCS7_SIGNER_INFO_set'; } {Do not localize} + {CH fn_PKCS7_add_signer = 'PKCS7_add_signer'; } {Do not localize} + {CH fn_PKCS7_add_certificate = 'PKCS7_add_certificate'; } {Do not localize} + {CH fn_PKCS7_add_crl = 'PKCS7_add_crl'; } {Do not localize} + {CH fn_PKCS7_content_new = 'PKCS7_content_new'; } {Do not localize} + {CH fn_PKCS7_dataVerify = 'PKCS7_dataVerify'; } {Do not localize} + {CH fn_PKCS7_signatureVerify = 'PKCS7_signatureVerify'; } {Do not localize} + {CH fn_PKCS7_dataInit = 'PKCS7_dataInit'; } {Do not localize} + {CH fn_PKCS7_dataFinal = 'PKCS7_dataFinal'; } {Do not localize} + {CH fn_PKCS7_dataDecode = 'PKCS7_dataDecode'; } {Do not localize} + {CH fn_PKCS7_add_signature = 'PKCS7_add_signature'; } {Do not localize} + {CH fn_PKCS7_cert_from_signer_info = 'PKCS7_cert_from_signer_info'; } {Do not localize} + {CH fn_PKCS7_get_signer_info = 'PKCS7_get_signer_info'; } {Do not localize} + {CH fn_PKCS7_add_recipient = 'PKCS7_add_recipient'; } {Do not localize} + {CH fn_PKCS7_add_recipient_info = 'PKCS7_add_recipient_info'; } {Do not localize} + {CH fn_PKCS7_RECIP_INFO_set = 'PKCS7_RECIP_INFO_set'; } {Do not localize} + {CH fn_PKCS7_set_cipher = 'PKCS7_set_cipher'; } {Do not localize} + {CH fn_PKCS7_get_issuer_and_serial = 'PKCS7_get_issuer_and_serial'; } {Do not localize} + {CH fn_PKCS7_digest_from_attributes = 'PKCS7_digest_from_attributes'; } {Do not localize} + {CH fn_PKCS7_add_signed_attribute = 'PKCS7_add_signed_attribute'; } {Do not localize} + {CH fn_PKCS7_add_attribute = 'PKCS7_add_attribute'; } {Do not localize} + {CH fn_PKCS7_get_attribute = 'PKCS7_get_attribute'; } {Do not localize} + {CH fn_PKCS7_get_signed_attribute = 'PKCS7_get_signed_attribute'; } {Do not localize} + {CH fn_PKCS7_set_signed_attributes = 'PKCS7_set_signed_attributes'; } {Do not localize} + {CH fn_PKCS7_set_attributes = 'PKCS7_set_attributes'; } {Do not localize} + {CH fn_X509_verify_cert_error_string = 'X509_verify_cert_error_string'; } {Do not localize} + fn_X509_verify = 'X509_verify'; {Do not localize} + {CH fn_X509_REQ_verify = 'X509_REQ_verify'; } {Do not localize} + {CH fn_X509_CRL_verify = 'X509_CRL_verify'; } {Do not localize} + {CH fn_NETSCAPE_SPKI_verify = 'NETSCAPE_SPKI_verify'; } {Do not localize} + fn_X509_sign = 'X509_sign'; {Do not localize} + fn_X509_REQ_sign = 'X509_REQ_sign'; {Do not localize} + fn_X509V3_set_ctx = 'X509V3_set_ctx'; {Do not localize} + fn_X509V3_EXT_conf_nid = 'X509V3_EXT_conf_nid'; {Do not localize} + fn_X509_REQ_add_extensions = 'X509_REQ_add_extensions'; {Do not localize} + {CH fn_X509_CRL_sign = 'X509_CRL_sign'; } {Do not localize} + {CH fn_NETSCAPE_SPKI_sign = 'NETSCAPE_SPKI_sign'; } {Do not localize} + fn_X509_digest = 'X509_digest'; {Do not localize} + {CH fn_X509_NAME_digest = 'X509_NAME_digest'; } {Do not localize} + {CH fn_d2i_X509_fp = 'd2i_X509_fp'; } {Do not localize} + {CH fn_i2d_X509_fp = 'i2d_X509_fp'; } {Do not localize} + {CH fn_d2i_X509_CRL_fp = 'd2i_X509_CRL_fp'; } {Do not localize} + {CH fn_i2d_X509_CRL_fp = 'i2d_X509_CRL_fp'; } {Do not localize} + {CH fn_d2i_X509_REQ_fp = 'd2i_X509_REQ_fp'; } {Do not localize} + {CH fn_i2d_X509_REQ_fp = 'i2d_X509_REQ_fp'; } {Do not localize} + {$IFNDEF OPENSSL_NO_RSA} + {CH fn_d2i_RSAPrivateKey_fp = 'd2i_RSAPrivateKey_fp'; } {Do not localize} + {CH fn_i2d_RSAPrivateKey_fp = 'i2d_RSAPrivateKey_fp'; } {Do not localize} + {CH fn_d2i_RSAPublicKey_fp = 'd2i_RSAPublicKey_fp'; } {Do not localize} + {CH fn_i2d_RSAPublicKey_fp = 'i2d_RSAPublicKey_fp'; } {Do not localize} + {CH fn_d2i_RSA_PUBKEY_fp = 'd2i_RSA_PUBKEY_fp'; } {Do not localize} + {CH fn_i2d_RSA_PUBKEY_fp = 'i2d_RSA_PUBKEY_fp'; } {Do not localize} + {$ENDIF} + {$IFNDEF OPENSSL_NO_DSA} + {CH fn_d2i_DSA_PUBKEY_fp = 'd2i_DSA_PUBKEY_fp'; } {Do not localize} + {CH fn_i2d_DSA_PUBKEY_fp = 'i2d_DSA_PUBKEY_fp'; } {Do not localize} + {CH fn_d2i_DSAPrivateKey_fp = 'd2i_DSAPrivateKey_fp'; } {Do not localize} + {CH fn_i2d_DSAPrivateKey_fp = 'i2d_DSAPrivateKey_fp'; } {Do not localize} + {$ENDIF} + {$IFNDEF OPENSSL_NO_EC} + {CH fn_d2i_EC_PUBKEY_fp = 'd2i_EC_PUBKEY_fp'; } {Do not localize} + {CH fn_i2d_EC_PUBKEY_fp = 'i2d_EC_PUBKEY_fp'; } {Do not localize} + {CH fn_d2i_ECPrivateKey_fp = 'd2i_ECPrivateKey_fp'; } {Do not localize} + {CH fn_i2d_ECPrivateKey_fp = 'i2d_ECPrivateKey_fp'; } {Do not localize} + {$ENDIF} + {CH fn_d2i_PKCS8_fp = 'd2i_PKCS8_fp'; } {Do not localize} + {CH fn_i2d_PKCS8_fp = 'i2d_PKCS8_fp'; } {Do not localize} + {CH fn_d2i_PKCS8_PRIV_KEY_INFO_fp = 'd2i_PKCS8_PRIV_KEY_INFO_fp'; } {Do not localize} + {CH fn_i2d_PKCS8_PRIV_KEY_INFO_fp = 'i2d_PKCS8_PRIV_KEY_INFO_fp'; } {Do not localize} + {$IFNDEF OPENSSL_NO_BIO} + fn_d2i_X509_bio = 'd2i_X509_bio'; {Do not localize} + fn_i2d_X509_bio = 'i2d_X509_bio'; {Do not localize} + fn_d2i_PKCS12_bio = 'd2i_PKCS12_bio'; {Do not localize} + fn_PKCS12_parse = 'PKCS12_parse'; {Do not localize} + fn_i2d_PrivateKey_bio = 'i2d_PrivateKey_bio'; {Do not localize} + fn_d2i_X509_CRL_bio = 'd2i_X509_CRL_bio'; {Do not localize} + fn_i2d_X509_CRL_bio = 'i2d_X509_CRL_bio'; {Do not localize} + fn_d2i_X509_REQ_bio = 'd2i_X509_REQ_bio'; {Do not localize} + fn_i2d_X509_REQ_bio = 'i2d_X509_REQ_bio'; {Do not localize} + {$IFNDEF OPENSSL_NO_RSA} + fn_d2i_RSAPrivateKey_bio = 'd2i_RSAPrivateKey_bio'; {Do not localize} + fn_i2d_RSAPrivateKey_bio = 'i2d_RSAPrivateKey_bio'; {Do not localize} + fn_d2i_RSAPublicKey_bio = 'd2i_RSAPublicKey_bio'; {Do not localize} + fn_i2d_RSAPublicKey_bio = 'i2d_RSAPublicKey_bio'; {Do not localize} + {$ENDIF} + {$IFNDEF OPENSSL_NO_DSA} + {CH fn_d2i_DSA_PUBKEY_bio = 'd2i_DSA_PUBKEY_bio'; } {Do not localize} + {CH fn_i2d_DSA_PUBKEY_bio = 'i2d_DSA_PUBKEY_bio'; } {Do not localize} + {CH fn_d2i_DSAPrivateKey_bio = 'd2i_DSAPrivateKey_bio'; } {Do not localize} + {CH fn_i2d_DSAPrivateKey_bio = 'i2d_DSAPrivateKey_bio'; } {Do not localize} + {$ENDIF} + {$IFNDEF OPENSSL_NO_EC} + {CH fn_d2i_EC_PUBKEY_bio = 'd2i_EC_PUBKEY_bio'; } {Do not localize} + {CH fn_i2d_EC_PUBKEY_bio = 'i2d_EC_PUBKEY_bio'; } {Do not localize} + {CH fn_d2i_ECPrivateKey_bio = 'd2i_ECPrivateKey_bio'; } {Do not localize} + {CH fn_i2d_ECPrivateKey_bio = 'i2d_ECPrivateKey_bio'; } {Do not localize} + {$ENDIF} + {CH fn_d2i_PKCS8_bio = 'd2i_PKCS8_bio'; } {Do not localize} + {CH fn_i2d_PKCS8_bio = 'i2d_PKCS8_bio'; } {Do not localize} + {CH fn_d2i_PKCS8_PRIV_KEY_INFO_bio = 'd2i_PKCS8_PRIV_KEY_INFO_bio'; } {Do not localize} + {CH fn_i2d_PKCS8_PRIV_KEY_INFO_bio = 'i2d_PKCS8_PRIV_KEY_INFO_bio'; } {Do not localize} + fn_d2i_PrivateKey_bio = 'd2i_PrivateKey_bio'; {Do not localize} + {CH fn_i2d_PUBKEY_bio = 'i2d_PUBKEY_bio'; } {Do not localize} + {CH fn_d2i_PUBKEY_bio = 'd2i_PUBKEY_bio'; } {Do not localize} + {$ENDIF} + {CH fn_X509_dup = 'X509_dup'; } {Do not localize} + {CH fn_X509_ATTRIBUTE_dup = 'X509_ATTRIBUTE_dup'; } {Do not localize} + {CH fn_X509_EXTENSION_dup = 'X509_EXTENSION_dup'; } {Do not localize} + {CH fn_X509_CRL_dup = 'X509_CRL_dup'; } {Do not localize} + {CH fn_X509_REQ_dup = 'X509_REQ_dup'; } {Do not localize} + {CH fn_X509_ALGOR_dup = 'X509_ALGOR_dup'; } {Do not localize} + {CH fn_X509_NAME_dup = 'X509_NAME_dup'; } {Do not localize} + {CH fn_X509_NAME_ENTRY_dup = 'X509_NAME_ENTRY_dup'; } {Do not localize} + {CH fn_RSAPublicKey_dup = 'RSAPublicKey_dup'; } {Do not localize} + {CH fn_RSAPrivateKey_dup = 'RSAPrivateKey_dup'; } {Do not localize} + {CH fn_X509_cmp_current_time = 'X509_cmp_current_time'; } {Do not localize} + fn_X509_gmtime_adj = 'X509_gmtime_adj'; {Do not localize} + {CH fn_X509_get_default_cert_area = 'X509_get_default_cert_area'; } {Do not localize} + {CH fn_X509_get_default_cert_dir = 'X509_get_default_cert_dir'; } {Do not localize} + fn_X509_get_default_cert_file = 'X509_get_default_cert_file'; {Do not localize} + {CH fn_X509_get_default_cert_dir_env = 'X509_get_default_cert_dir_env'; } {Do not localize} + fn_X509_get_default_cert_file_env = 'X509_get_default_cert_file_env'; {Do not localize} + {CH fn_X509_get_default_private_dir = 'X509_get_default_private_dir'; } {Do not localize} + fn_X509_to_X509_REQ = 'X509_to_X509_REQ'; {Do not localize} + {CH fn_X509_REQ_to_X509 = 'X509_REQ_to_X509'; } {Do not localize} + fn_X509_NAME_add_entry_by_txt = 'X509_NAME_add_entry_by_txt'; {Do not localize} + {CH fn_ERR_load_X509_strings = 'ERR_load_X509_strings'; } {Do not localize} + {CH fn_X509_ALGOR_new = 'X509_ALGOR_new'; } {Do not localize} + {CH fn_X509_ALGOR_free = 'X509_ALGOR_free'; } {Do not localize} + {CH fn_i2d_X509_ALGOR = 'i2d_X509_ALGOR'; } {Do not localize} + {CH fn_d2i_X509_ALGOR = 'd2i_X509_ALGOR'; } {Do not localize} + {CH fn_X509_VAL_new = 'X509_VAL_new'; } {Do not localize} + {CH fn_X509_VAL_free = 'X509_VAL_free'; } {Do not localize} + {CH fn_i2d_X509_VAL = 'i2d_X509_VAL'; } {Do not localize} + {CH fn_d2i_X509_VAL = 'd2i_X509_VAL'; } {Do not localize} + {CH fn_X509_PUBKEY_new = 'X509_PUBKEY_new'; } {Do not localize} + {CH fn_X509_PUBKEY_free = 'X509_PUBKEY_free'; } {Do not localize} + {CH fn_i2d_X509_PUBKEY = 'i2d_X509_PUBKEY'; } {Do not localize} + {CH fn_d2i_X509_PUBKEY = 'd2i_X509_PUBKEY'; } {Do not localize} + {CH fn_X509_PUBKEY_set = 'X509_PUBKEY_set'; } {Do not localize} + fn_X509_PUBKEY_get = 'X509_PUBKEY_get'; {Do not localize} + {CH fn_X509_get_pubkey_parameters = 'X509_get_pubkey_parameters'; } {Do not localize} + {CH fn_X509_SIG_new = 'X509_SIG_new'; } {Do not localize} + {CH fn_X509_SIG_free = 'X509_SIG_free'; } {Do not localize} + {CH fn_i2d_X509_SIG = 'i2d_X509_SIG'; } {Do not localize} + {CH fn_d2i_X509_SIG = 'd2i_X509_SIG'; } {Do not localize} + {CH fn_X509_REQ_INFO_new = 'X509_REQ_INFO_new'; } {Do not localize} + {CH fn_X509_REQ_INFO_free = 'X509_REQ_INFO_free'; } {Do not localize} + {CH fn_i2d_X509_REQ_INFO = 'i2d_X509_REQ_INFO'; } {Do not localize} + {CH fn_d2i_X509_REQ_INFO = 'd2i_X509_REQ_INFO'; } {Do not localize} + fn_X509_REQ_new = 'X509_REQ_new'; {Do not localize} + fn_X509_REQ_free = 'X509_REQ_free'; {Do not localize} + fn_i2d_X509_REQ = 'i2d_X509_REQ'; {Do not localize} + fn_d2i_X509_REQ = 'd2i_X509_REQ'; {Do not localize} + {CH fn_X509_ATTRIBUTE_new = 'X509_ATTRIBUTE_new'; } {Do not localize} + {CH fn_X509_ATTRIBUTE_free = 'X509_ATTRIBUTE_free'; } {Do not localize} + {CH fn_i2d_X509_ATTRIBUTE = 'i2d_X509_ATTRIBUTE'; } {Do not localize} + {CH fn_d2i_X509_ATTRIBUTE = 'd2i_X509_ATTRIBUTE'; } {Do not localize} + {CH fn_X509_ATTRIBUTE_create = 'X509_ATTRIBUTE_create'; } {Do not localize} + {CH fn_X509_EXTENSION_new = 'X509_EXTENSION_new'; } {Do not localize} + fn_X509_EXTENSION_free = 'X509_EXTENSION_free'; {Do not localize} + {CH fn_i2d_X509_EXTENSION = 'i2d_X509_EXTENSION'; } {Do not localize} + {CH fn_d2i_X509_EXTENSION = 'd2i_X509_EXTENSION'; } {Do not localize} + {CH fn_X509_NAME_ENTRY_new = 'X509_NAME_ENTRY_new'; } {Do not localize} + {CH fn_X509_NAME_ENTRY_free = 'X509_NAME_ENTRY_free'; } {Do not localize} + fn_i2d_X509_NAME_ENTRY = 'i2d_X509_NAME_ENTRY'; {Do not localize} + fn_d2i_X509_NAME_ENTRY = 'd2i_X509_NAME_ENTRY'; {Do not localize} + fn_X509_NAME_new = 'X509_NAME_new'; {Do not localize} + fn_X509_NAME_free = 'X509_NAME_free'; {Do not localize} + fn_i2d_X509_NAME = 'i2d_X509_NAME'; {Do not localize} + fn_d2i_X509_NAME = 'd2i_X509_NAME'; {Do not localize} + {CH fn_X509_NAME_set = 'X509_NAME_set'; } {Do not localize} + {CH fn_X509_CINF_new = 'X509_CINF_new'; } {Do not localize} + {CH fn_X509_CINF_free = 'X509_CINF_free'; } {Do not localize} + {CH fn_i2d_X509_CINF = 'i2d_X509_CINF'; } {Do not localize} + {CH fn_d2i_X509_CINF = 'd2i_X509_CINF'; } {Do not localize} + fn_X509_new = 'X509_new'; {Do not localize} + fn_X509_free = 'X509_free'; {Do not localize} + fn_i2d_X509 = 'i2d_X509'; {Do not localize} + fn_d2i_X509 = 'd2i_X509'; {Do not localize} + {CH fn_X509_REVOKED_new = 'X509_REVOKED_new'; } {Do not localize} + {CH fn_X509_REVOKED_free = 'X509_REVOKED_free'; } {Do not localize} + {CH fn_i2d_X509_REVOKED = 'i2d_X509_REVOKED'; } {Do not localize} + {CH fn_d2i_X509_REVOKED = 'd2i_X509_REVOKED'; } {Do not localize} + {CH fn_X509_CRL_INFO_new = 'X509_CRL_INFO_new'; } {Do not localize} + {CH fn_X509_CRL_INFO_free = 'X509_CRL_INFO_free'; } {Do not localize} + {CH fn_i2d_X509_CRL_INFO = 'i2d_X509_CRL_INFO'; } {Do not localize} + {CH fn_d2i_X509_CRL_INFO = 'd2i_X509_CRL_INFO'; } {Do not localize} + {CH fn_X509_CRL_new = 'X509_CRL_new'; } {Do not localize} + {CH fn_X509_CRL_free = 'X509_CRL_free'; } {Do not localize} + fn_i2d_X509_CRL = 'i2d_X509_CRL'; {Do not localize} + fn_d2i_X509_CRL = 'd2i_X509_CRL'; {Do not localize} + {CH fn_X509_PKEY_new = 'X509_PKEY_new'; } {Do not localize} + {CH fn_X509_PKEY_free = 'X509_PKEY_free'; } {Do not localize} + {CH fn_i2d_X509_PKEY = 'i2d_X509_PKEY'; } {Do not localize} + {CH fn_d2i_X509_PKEY = 'd2i_X509_PKEY'; } {Do not localize} + {CH fn_NETSCAPE_SPKI_new = 'NETSCAPE_SPKI_new'; } {Do not localize} + {CH fn_NETSCAPE_SPKI_free = 'NETSCAPE_SPKI_free'; } {Do not localize} + {CH fn_i2d_NETSCAPE_SPKI = 'i2d_NETSCAPE_SPKI'; } {Do not localize} + {CH fn_d2i_NETSCAPE_SPKI = 'd2i_NETSCAPE_SPKI'; } {Do not localize} + {CH fn_NETSCAPE_SPKAC_new = 'NETSCAPE_SPKAC_new'; } {Do not localize} + {CH fn_NETSCAPE_SPKAC_free = 'NETSCAPE_SPKAC_free'; } {Do not localize} + {CH fn_i2d_NETSCAPE_SPKAC = 'i2d_NETSCAPE_SPKAC'; } {Do not localize} + {CH fn_d2i_NETSCAPE_SPKAC = 'd2i_NETSCAPE_SPKAC'; } {Do not localize} + fn_i2d_NETSCAPE_CERT_SEQUENCE = 'i2d_NETSCAPE_CERT_SEQUENCE'; {Do not localize} + fn_d2i_NETSCAPE_CERT_SEQUENCE = 'd2i_NETSCAPE_CERT_SEQUENCE'; {Do not localize} + fn_i2d_PUBKEY = 'i2d_PUBKEY'; {Do not localize} + fn_d2i_PUBKEY = 'd2i_PUBKEY'; {Do not localize} + + {CH fn_NETSCAPE_CERT_SEQUENCE_new = 'NETSCAPE_CERT_SEQUENCE_new'; } {Do not localize} + {CH fn_NETSCAPE_CERT_SEQUENCE_free = 'NETSCAPE_CERT_SEQUENCE_free'; } {Do not localize} + {CH fn_X509_INFO_new = 'X509_INFO_new'; } {Do not localize} + fn_X509_INFO_free = 'X509_INFO_free'; {Do not localize} + fn_X509_NAME_oneline = 'X509_NAME_oneline'; {Do not localize} + {CH fn_ASN1_verify = 'ASN1_verify'; } {Do not localize} + {CH fn_ASN1_digest = 'ASN1_digest'; } {Do not localize} + {CH fn_ASN1_sign = 'ASN1_sign'; } {Do not localize} + fn_X509_set_version = 'X509_set_version'; {Do not localize} + {CH fn_X509_set_serialNumber = 'X509_set_serialNumber'; } {Do not localize} + fn_X509_get_serialNumber = 'X509_get_serialNumber'; {Do not localize} + fn_X509_set_issuer_name = 'X509_set_issuer_name'; {Do not localize} + fn_X509_get_issuer_name = 'X509_get_issuer_name'; {Do not localize} + fn_X509_set_subject_name = 'X509_set_subject_name'; {Do not localize} + fn_X509_get_subject_name = 'X509_get_subject_name'; {Do not localize} + fn_X509_set_notBefore = 'X509_set_notBefore'; {Do not localize} + fn_X509_set_notAfter = 'X509_set_notAfter'; {Do not localize} + fn_X509_set_pubkey = 'X509_set_pubkey'; {Do not localize} + {CH fn_X509_get_pubkey = 'X509_get_pubkey'; } {Do not localize} + {CH fn_X509_certificate_type = 'X509_certificate_type'; } {Do not localize} + {CH fn_X509_REQ_set_version = 'X509_REQ_set_version'; } {Do not localize} + {CH fn_X509_REQ_set_subject_name = 'X509_REQ_set_subject_name'; } {Do not localize} + fn_X509_REQ_set_pubkey = 'X509_REQ_set_pubkey'; {Do not localize} + {CH fn_X509_REQ_get_pubkey = 'X509_REQ_get_pubkey'; } {Do not localize} + {CH fn_X509_check_private_key = 'X509_check_private_key'; } {Do not localize} + {CH fn_X509_issuer_and_serial_cmp = 'X509_issuer_and_serial_cmp'; } {Do not localize} + {CH fn_X509_issuer_and_serial_hash = 'X509_issuer_and_serial_hash'; } {Do not localize} + {CH fn_X509_issuer_name_cmp = 'X509_issuer_name_cmp'; } {Do not localize} + {CH fn_X509_issuer_name_hash = 'X509_issuer_name_hash'; } {Do not localize} + {CH fn_X509_subject_name_cmp = 'X509_subject_name_cmp'; } {Do not localize} + {CH fn_X509_subject_name_hash = 'X509_subject_name_hash'; } {Do not localize} + fn_X509_NAME_cmp = 'X509_NAME_cmp'; {Do not localize} + fn_X509_NAME_hash = 'X509_NAME_hash'; {Do not localize} + {CH fn_X509_CRL_cmp = 'X509_CRL_cmp'; } {Do not localize} + {$IFNDEF OPENSSL_NO_FP_API} + {CH fn_X509_print_ex_fp = 'X509_print_ex_fp'; } {Do not localize} + {CH fn_X509_print_fp = 'X509_print_fp'; } {Do not localize} + {CH fn_X509_CRL_print_fp = 'X509_CRL_print_fp'; } {Do not localize} + {CH fn_X509_REQ_print_fp = 'X509_REQ_print_fp'; } {Do not localize} + {CH fn_X509_NAME_print_ex_fp = 'X509_NAME_print_ex_fp'; } {Do not localize} + {$ENDIF} + {$IFNDEF OPENSSL_NO_BIO} + {CH fn_X509_NAME_print = 'X509_NAME_print'; } {Do not localize} + {CH fn_X509_NAME_print_ex = 'X509_NAME_print_ex'; } {Do not localize} + {CH fn_X509_print_ex = 'X509_print_ex'; } {Do not localize} + fn_X509_print = 'X509_print'; {Do not localize} + {CH fn_X509_ocspid_print = 'X509_ocspid_print'; } {Do not localize} + {CH fn_X509_CERT_AUX_print = 'X509_CERT_AUX_print'; } {Do not localize} + {CH fn_X509_CRL_print = 'X509_CRL_print'; } {Do not localize} + {CH fn_X509_REQ_print = 'X509_REQ_print'; } {Do not localize} + {CH fn_X509_REQ_print_ex = 'X509_REQ_print_ex'; } {Do not localize} + {$ENDIF} + {CH fn_X509_NAME_entry_count = 'X509_NAME_entry_count'; } {Do not localize} + {CH fn_X509_NAME_get_text_by_NID = 'X509_NAME_get_text_by_NID'; } {Do not localize} + {CH fn_X509_NAME_get_text_by_OBJ = 'X509_NAME_get_text_by_OBJ'; } {Do not localize} + {CH fn_X509_NAME_get_index_by_NID = 'X509_NAME_get_index_by_NID'; } {Do not localize} + {CH fn_X509_NAME_get_index_by_OBJ = 'X509_NAME_get_index_by_OBJ'; } {Do not localize} + {CH fn_X509_NAME_get_entry = 'X509_NAME_get_entry'; } {Do not localize} + {CH fn_X509_NAME_delete_entry = 'X509_NAME_delete_entry'; } {Do not localize} + {CH fn_X509_NAME_add_entry = 'X509_NAME_add_entry'; } {Do not localize} + {CH fn_X509_NAME_ENTRY_create_by_NID = 'X509_NAME_ENTRY_create_by_NID'; } {Do not localize} + {CH fn_X509_NAME_ENTRY_create_by_OBJ = 'X509_NAME_ENTRY_create_by_OBJ'; } {Do not localize} + {CH fn_X509_NAME_ENTRY_set_object = 'X509_NAME_ENTRY_set_object'; } {Do not localize} + {CH fn_X509_NAME_ENTRY_set_data = 'X509_NAME_ENTRY_set_data'; } {Do not localize} + {CH fn_X509_NAME_ENTRY_get_object = 'X509_NAME_ENTRY_get_object'; } {Do not localize} + {CH fn_X509_NAME_ENTRY_get_data = 'X509_NAME_ENTRY_get_data'; } {Do not localize} + {CH fn_X509v3_get_ext_count = 'X509v3_get_ext_count'; } {Do not localize} + {CH fn_X509v3_get_ext_by_NID = 'X509v3_get_ext_by_NID'; } {Do not localize} + {CH fn_X509v3_get_ext_by_OBJ = 'X509v3_get_ext_by_OBJ'; } {Do not localize} + {CH fn_X509v3_get_ext_by_critical = 'X509v3_get_ext_by_critical'; } {Do not localize} + {CH fn_X509v3_get_ext = 'X509v3_get_ext'; } {Do not localize} + {CH fn_X509v3_delete_ext = 'X509v3_delete_ext'; } {Do not localize} + {CH fn_X509v3_add_ext = 'X509v3_add_ext'; } {Do not localize} + {CH fn_X509_get_ext_count = 'X509_get_ext_count'; } {Do not localize} + {CH fn_X509_get_ext_by_NID = 'X509_get_ext_by_NID'; } {Do not localize} + {CH fn_X509_get_ext_by_OBJ = 'X509_get_ext_by_OBJ'; } {Do not localize} + {CH fn_X509_get_ext_by_critical = 'X509_get_ext_by_critical'; } {Do not localize} + {CH fn_X509_get_ext = 'X509_get_ext'; } {Do not localize} + {CH fn_X509_delete_ext = 'X509_delete_ext'; } {Do not localize} + fn_X509_add_ext = 'X509_add_ext'; {Do not localize} + {CH fn_X509_CRL_get_ext_count = 'X509_CRL_get_ext_count'; } {Do not localize} + {CH fn_X509_CRL_get_ext_by_NID = 'X509_CRL_get_ext_by_NID'; } {Do not localize} + {CH fn_X509_CRL_get_ext_by_OBJ = 'X509_CRL_get_ext_by_OBJ'; } {Do not localize} + {CH fn_X509_CRL_get_ext_by_critical = 'X509_CRL_get_ext_by_critical'; } {Do not localize} + {CH fn_X509_CRL_get_ext = 'X509_CRL_get_ext'; } {Do not localize} + {CH fn_X509_CRL_delete_ext = 'X509_CRL_delete_ext'; } {Do not localize} + {CH fn_X509_CRL_add_ext = 'X509_CRL_add_ext'; } {Do not localize} + {CH fn_X509_REVOKED_get_ext_count = 'X509_REVOKED_get_ext_count'; } {Do not localize} + {CH fn_X509_REVOKED_get_ext_by_NID = 'X509_REVOKED_get_ext_by_NID'; } {Do not localize} + {CH fn_X509_REVOKED_get_ext_by_OBJ = 'X509_REVOKED_get_ext_by_OBJ'; } {Do not localize} + {CH fn_X509_REVOKED_get_ext_by_critical = 'X509_REVOKED_get_ext_by_critical'; } {Do not localize} + {CH fn_X509_REVOKED_get_ext = 'X509_REVOKED_get_ext'; } {Do not localize} + {CH fn_X509_REVOKED_delete_ext = 'X509_REVOKED_delete_ext'; } {Do not localize} + {CH fn_X509_REVOKED_add_ext = 'X509_REVOKED_add_ext'; } {Do not localize} + fn_X509_EXTENSION_create_by_NID = 'X509_EXTENSION_create_by_NID'; {Do not localize} + {CH fn_X509_EXTENSION_create_by_OBJ = 'X509_EXTENSION_create_by_OBJ'; } {Do not localize} + {CH fn_X509_EXTENSION_set_object = 'X509_EXTENSION_set_object'; } {Do not localize} + {CH fn_X509_EXTENSION_set_critical = 'X509_EXTENSION_set_critical'; } {Do not localize} + {CH fn_X509_EXTENSION_set_data = 'X509_EXTENSION_set_data'; } {Do not localize} + {CH fn_X509_EXTENSION_get_object = 'X509_EXTENSION_get_object'; } {Do not localize} + {CH fn_X509_EXTENSION_get_data = 'X509_EXTENSION_get_data'; } {Do not localize} + {CH fn_X509_EXTENSION_get_critical = 'X509_EXTENSION_get_critical'; } {Do not localize} + {CH fn_X509_verify_cert = 'X509_verify_cert'; } {Do not localize} + {CH fn_X509_find_by_issuer_and_serial = 'X509_find_by_issuer_and_serial'; } {Do not localize} + {CH fn_X509_find_by_subject = 'X509_find_by_subject'; } {Do not localize} + {CH fn_i2d_PBEPARAM = 'i2d_PBEPARAM'; } {Do not localize} + {CH fn_PBEPARAM_new = 'PBEPARAM_new'; } {Do not localize} + {CH fn_d2i_PBEPARAM = 'd2i_PBEPARAM'; } {Do not localize} + {CH fn_PBEPARAM_free = 'PBEPARAM_free'; } {Do not localize} + {CH fn_PKCS5_pbe_set = 'PKCS5_pbe_set'; } {Do not localize} + {CH fn_PKCS5_pbe2_set = 'PKCS5_pbe2_set'; } {Do not localize} + {CH fn_i2d_PBKDF2PARAM = 'i2d_PBKDF2PARAM'; } {Do not localize} + {CH fn_PBKDF2PARAM_new = 'PBKDF2PARAM_new'; } {Do not localize} + {CH fn_d2i_PBKDF2PARAM = 'd2i_PBKDF2PARAM'; } {Do not localize} + {CH fn_PBKDF2PARAM_free = 'PBKDF2PARAM_free'; } {Do not localize} + {CH fn_i2d_PBE2PARAM = 'i2d_PBE2PARAM'; } {Do not localize} + {CH fn_PBE2PARAM_new = 'PBE2PARAM_new'; } {Do not localize} + {CH fn_d2i_PBE2PARAM = 'd2i_PBE2PARAM'; } {Do not localize} + {CH fn_PBE2PARAM_free = 'PBE2PARAM_free'; } {Do not localize} + {CH fn_i2d_PKCS8_PRIV_KEY_INFO = 'i2d_PKCS8_PRIV_KEY_INFO'; } {Do not localize} + {CH fn_PKCS8_PRIV_KEY_INFO_new = 'PKCS8_PRIV_KEY_INFO_new'; } {Do not localize} + {CH fn_d2i_PKCS8_PRIV_KEY_INFO = 'd2i_PKCS8_PRIV_KEY_INFO'; } {Do not localize} + {CH fn_PKCS8_PRIV_KEY_INFO_free = 'PKCS8_PRIV_KEY_INFO_free'; } {Do not localize} + {CH fn_EVP_PKCS82PKEY = 'EVP_PKCS82PKEY'; } {Do not localize} + {CH fn_EVP_PKEY2PKCS8 = 'EVP_PKEY2PKCS8'; } {Do not localize} + {CH fn_PKCS8_set_broken = 'PKCS8_set_broken'; } {Do not localize} + {CH fn_ERR_load_PEM_strings = 'ERR_load_PEM_strings'; } {Do not localize} + {CH fn_PEM_get_EVP_CIPHER_INFO = 'PEM_get_EVP_CIPHER_INFO'; } {Do not localize} + {CH fn_PEM_do_header = 'PEM_do_header'; } {Do not localize} + {CH fn_PEM_read_bio = 'PEM_read_bio'; } {Do not localize} + {CH fn_PEM_write_bio = 'PEM_write_bio'; } {Do not localize} + fn_PEM_ASN1_read_bio = 'PEM_ASN1_read_bio'; {Do not localize} + fn_PEM_ASN1_write_bio = 'PEM_ASN1_write_bio'; {Do not localize} + fn_PEM_X509_INFO_read_bio = 'PEM_X509_INFO_read_bio'; {Do not localize} + {CH fn_PEM_X509_INFO_write_bio = 'PEM_X509_INFO_write_bio'; } {Do not localize} + {CH fn_PEM_read = 'PEM_read'; } {Do not localize} + {CH fn_PEM_write = 'PEM_write'; } {Do not localize} + {CH fn_PEM_ASN1_read = 'PEM_ASN1_read'; } {Do not localize} + {CH fn_PEM_ASN1_write = 'PEM_ASN1_write'; } {Do not localize} + {CH fn_PEM_X509_INFO_read = 'PEM_X509_INFO_read'; } {Do not localize} + {CH fn_PEM_SealInit = 'PEM_SealInit'; } {Do not localize} + {CH fn_PEM_SealUpdate = 'PEM_SealUpdate'; } {Do not localize} + {CH fn_PEM_SealFinal = 'PEM_SealFinal'; } {Do not localize} + {CH fn_PEM_SignInit = 'PEM_SignInit'; } {Do not localize} + {CH fn_PEM_SignUpdate = 'PEM_SignUpdate'; } {Do not localize} + {CH fn_PEM_SignFinal = 'PEM_SignFinal'; } {Do not localize} + {CH fn_PEM_proc_type = 'PEM_proc_type'; } {Do not localize} + {CH fn_PEM_dek_info = 'PEM_dek_info'; } {Do not localize} + {$IFNDEF OPENSSL_NO_BIO} + {$IFNDEF SSLEAY_MACROS} + fn_PEM_read_bio_X509 = 'PEM_read_bio_X509'; {Do not localize} + fn_PEM_write_bio_X509 = 'PEM_write_bio_X509'; {Do not localize} + fn_PEM_read_bio_X509_REQ = 'PEM_read_bio_X509_REQ'; {Do not localize} + fn_PEM_write_bio_X509_REQ = 'PEM_write_bio_X509_REQ'; {Do not localize} + fn_PEM_read_bio_X509_CRL = 'PEM_read_bio_X509_CRL'; {Do not localize} + fn_PEM_write_bio_X509_CRL = 'PEM_write_bio_X509_CRL'; {Do not localize} + fn_PEM_read_bio_PKCS7 = 'PEM_read_bio_PKCS7'; {Do not localize} + fn_PEM_write_bio_PKCS7 = 'PEM_write_bio_PKCS7'; {Do not localize} + fn_PEM_read_bio_NETSCAPE_CERT_SEQUENCE = 'PEM_read_bio_NETSCAPE_CERT_SEQUENCE'; {Do not localize} + fn_PEM_write_bio_NETSCAPE_CERT_SEQUENCE = 'PEM_write_bio_NETSCAPE_CERT_SEQUENCE'; {Do not localize} + fn_PEM_read_bio_PKCS8 = 'PEM_read_bio_PKCS8'; {Do not localize} + fn_PEM_write_bio_PKCS8 = 'PEM_write_bio_PKCS8'; {Do not localize} + fn_PEM_read_bio_PKCS8_PRIV_KEY_INFO = 'PEM_read_bio_PKCS8_PRIV_KEY_INFO'; {Do not localize} + fn_PEM_write_bio_PKCS8_PRIV_KEY_INFO = 'PEM_write_bio_PKCS8_PRIV_KEY_INFO'; {Do not localize} + fn_PEM_read_bio_RSAPrivateKey = 'PEM_read_bio_RSAPrivateKey'; {Do not localize} + fn_PEM_write_bio_RSAPrivateKey = 'PEM_write_bio_RSAPrivateKey'; {Do not localize} + fn_PEM_read_bio_RSAPublicKey = 'PEM_read_bio_RSAPublicKey'; {Do not localize} + fn_PEM_write_bio_RSAPublicKey = 'PEM_write_bio_RSAPublicKey'; {Do not localize} + fn_PEM_read_bio_DSAPrivateKey = 'PEM_read_bio_DSAPrivateKey'; {Do not localize} + fn_PEM_write_bio_DSAPrivateKey = 'PEM_write_bio_DSAPrivateKey'; {Do not localize} + fn_PEM_read_bio_DSAparams = 'PEM_read_bio_DSAparams'; {Do not localize} + fn_PEM_write_bio_DSAparams = 'PEM_write_bio_DSAparams'; {Do not localize} + fn_PEM_read_bio_DHparams = 'PEM_read_bio_DHparams'; {Do not localize} + fn_PEM_write_bio_DHparams = 'PEM_write_bio_DHparams'; {Do not localize} + fn_PEM_read_bio_PrivateKey = 'PEM_read_bio_PrivateKey'; {Do not localize} + fn_PEM_write_bio_PrivateKey = 'PEM_write_bio_PrivateKey'; {Do not localize} + fn_PEM_write_bio_PKCS8PrivateKey = 'PEM_write_bio_PKCS8PrivateKey'; {Do not localize} + fn_PEM_read_bio_PUBKEY = 'PEM_read_bio_PUBKEY'; {Do not localize} + fn_PEM_write_bio_PUBKEY = 'PEM_write_bio_PUBKEY'; {Do not localize} + {$ENDIF} + {$ENDIF} + fn_PEM_read_bio_X509_AUX = 'PEM_read_bio_X509_AUX'; {Do not localize} + {CH fn_PEM_read_X509 = 'PEM_read_X509'; } {Do not localize} + {CH fn_PEM_write_X509 = 'PEM_write_X509'; } {Do not localize} + {CH fn_PEM_read_X509_REQ = 'PEM_read_X509_REQ'; } {Do not localize} + {CH fn_PEM_write_X509_REQ = 'PEM_write_X509_REQ'; } {Do not localize} + {CH fn_PEM_read_X509_CRL = 'PEM_read_X509_CRL'; } {Do not localize} + {CH fn_PEM_write_X509_CRL = 'PEM_write_X509_CRL'; } {Do not localize} + {CH fn_PEM_read_PKCS7 = 'PEM_read_PKCS7'; } {Do not localize} + {CH fn_PEM_write_PKCS7 = 'PEM_write_PKCS7'; } {Do not localize} + {CH fn_PEM_read_NETSCAPE_CERT_SEQUENCE = 'PEM_read_NETSCAPE_CERT_SEQUENCE'; } {Do not localize} + {CH fn_PEM_write_NETSCAPE_CERT_SEQUENCE = 'PEM_write_NETSCAPE_CERT_SEQUENCE'; } {Do not localize} + {CH fn_PEM_read_PKCS8 = 'PEM_read_PKCS8'; } {Do not localize} + {CH fn_PEM_write_PKCS8 = 'PEM_write_PKCS8'; } {Do not localize} + {CH fn_PEM_read_PKCS8_PRIV_KEY_INFO = 'PEM_read_PKCS8_PRIV_KEY_INFO'; } {Do not localize} + {CH fn_PEM_write_PKCS8_PRIV_KEY_INFO = 'PEM_write_PKCS8_PRIV_KEY_INFO'; } {Do not localize} + {CH fn_PEM_read_RSAPrivateKey = 'PEM_read_RSAPrivateKey'; } {Do not localize} + {CH fn_PEM_write_RSAPrivateKey = 'PEM_write_RSAPrivateKey'; } {Do not localize} + {CH fn_PEM_read_RSAPublicKey = 'PEM_read_RSAPublicKey'; } {Do not localize} + {CH fn_PEM_write_RSAPublicKey = 'PEM_write_RSAPublicKey'; } {Do not localize} + {CH fn_PEM_read_DSAPrivateKey = 'PEM_read_DSAPrivateKey'; } {Do not localize} + {CH fn_PEM_write_DSAPrivateKey = 'PEM_write_DSAPrivateKey'; } {Do not localize} + {CH fn_PEM_read_DSAparams = 'PEM_read_DSAparams'; } {Do not localize} + {CH fn_PEM_write_DSAparams = 'PEM_write_DSAparams'; } {Do not localize} + {CH fn_PEM_read_DHparams = 'PEM_read_DHparams'; } {Do not localize} + {CH fn_PEM_write_DHparams = 'PEM_write_DHparams'; } {Do not localize} + {CH fn_PEM_read_PrivateKey = 'PEM_read_PrivateKey'; } {Do not localize} + {CH fn_PEM_write_PrivateKey = 'PEM_write_PrivateKey'; } {Do not localize} + {CH fn_PEM_write_PKCS8PrivateKey = 'PEM_write_PKCS8PrivateKey'; } {Do not localize} + {CH fn_sk_SSL_CIPHER_new = 'sk_SSL_CIPHER_new'; } {Do not localize} + {CH fn_sk_SSL_CIPHER_new_null = 'sk_SSL_CIPHER_new_null'; } {Do not localize} + {CH fn_sk_SSL_CIPHER_free = 'sk_SSL_CIPHER_free'; } {Do not localize} + {CH fn_sk_SSL_CIPHER_num = 'sk_SSL_CIPHER_num'; } {Do not localize} + {CH fn_sk_SSL_CIPHER_value = 'sk_SSL_CIPHER_value'; } {Do not localize} + {CH fn_sk_SSL_CIPHER_set = 'sk_SSL_CIPHER_set'; } {Do not localize} + {CH fn_sk_SSL_CIPHER_zero = 'sk_SSL_CIPHER_zero'; } {Do not localize} + {CH fn_sk_SSL_CIPHER_push = 'sk_SSL_CIPHER_push'; } {Do not localize} + {CH fn_sk_SSL_CIPHER_unshift = 'sk_SSL_CIPHER_unshift'; } {Do not localize} + {CH fn_sk_SSL_CIPHER_find = 'sk_SSL_CIPHER_find'; } {Do not localize} + {CH fn_sk_SSL_CIPHER_delete = 'sk_SSL_CIPHER_delete'; } {Do not localize} + {CH fn_sk_SSL_CIPHER_delete_ptr = 'sk_SSL_CIPHER_delete_ptr'; } {Do not localize} + {CH fn_sk_SSL_CIPHER_insert = 'sk_SSL_CIPHER_insert'; } {Do not localize} + {CH fn_sk_SSL_CIPHER_dup = 'sk_SSL_CIPHER_dup'; } {Do not localize} + {CH fn_sk_SSL_CIPHER_pop_free = 'sk_SSL_CIPHER_pop_free'; } {Do not localize} + {CH fn_sk_SSL_CIPHER_shift = 'sk_SSL_CIPHER_shift'; } {Do not localize} + {CH fn_sk_SSL_CIPHER_pop = 'sk_SSL_CIPHER_pop'; } {Do not localize} + {CH fn_sk_SSL_CIPHER_sort = 'sk_SSL_CIPHER_sort'; } {Do not localize} + {CH fn_sk_SSL_COMP_new = 'sk_SSL_COMP_new'; } {Do not localize} + {CH fn_sk_SSL_COMP_new_null = 'sk_SSL_COMP_new_null'; } {Do not localize} + {CH fn_sk_SSL_COMP_free = 'sk_SSL_COMP_free'; } {Do not localize} + {CH fn_sk_SSL_COMP_num = 'sk_SSL_COMP_num'; } {Do not localize} + {CH fn_sk_SSL_COMP_value = 'sk_SSL_COMP_value'; } {Do not localize} + {CH fn_sk_SSL_COMP_set = 'sk_SSL_COMP_set'; } {Do not localize} + {CH fn_sk_SSL_COMP_zero = 'sk_SSL_COMP_zero'; } {Do not localize} + {CH fn_sk_SSL_COMP_push = 'sk_SSL_COMP_push'; } {Do not localize} + {CH fn_sk_SSL_COMP_unshift = 'sk_SSL_COMP_unshift'; } {Do not localize} + {CH fn_sk_SSL_COMP_find = 'sk_SSL_COMP_find'; } {Do not localize} + {CH fn_sk_SSL_COMP_delete = 'sk_SSL_COMP_delete'; } {Do not localize} + {CH fn_sk_SSL_COMP_delete_ptr = 'sk_SSL_COMP_delete_ptr'; } {Do not localize} + {CH fn_sk_SSL_COMP_insert = 'sk_SSL_COMP_insert'; } {Do not localize} + {CH fn_sk_SSL_COMP_dup = 'sk_SSL_COMP_dup'; } {Do not localize} + {CH fn_sk_SSL_COMP_pop_free = 'sk_SSL_COMP_pop_free'; } {Do not localize} + {CH fn_sk_SSL_COMP_shift = 'sk_SSL_COMP_shift'; } {Do not localize} + {CH fn_sk_SSL_COMP_pop = 'sk_SSL_COMP_pop'; } {Do not localize} + {CH fn_sk_SSL_COMP_sort = 'sk_SSL_COMP_sort'; } {Do not localize} + {$IFNDEF OPENSSL_NO_BIO} + {CH fn_BIO_f_ssl = 'BIO_f_ssl'; } {Do not localize} + {CH fn_BIO_new_ssl = 'BIO_new_ssl'; } {Do not localize} + {CH fn_BIO_new_ssl_connect = 'BIO_new_ssl_connect'; } {Do not localize} + {CH fn_BIO_new_buffer_ssl_connect = 'BIO_new_buffer_ssl_connect'; } {Do not localize} + {CH fn_BIO_ssl_copy_session_id = 'BIO_ssl_copy_session_id'; } {Do not localize} + {CH fn_BIO_ssl_shutdown = 'BIO_ssl_shutdown'; } {Do not localize} + {$ENDIF} + fn_SSL_CTX_set_cipher_list = 'SSL_CTX_set_cipher_list'; {Do not localize} + fn_SSL_CTX_new = 'SSL_CTX_new'; {Do not localize} + fn_SSL_CTX_free = 'SSL_CTX_free'; {Do not localize} + fn_SSL_callback_ctrl = 'SSL_callback_ctrl'; {Do not localize} + fn_SSL_CTX_callback_ctrl = 'SSL_CTX_callback_ctrl'; {Do not localize} + {CH fn_SSL_CTX_set_timeout = 'SSL_CTX_set_timeout'; } {Do not localize} + {CH fn_SSL_CTX_get_timeout = 'SSL_CTX_get_timeout'; } {Do not localize} + {CH fn_SSL_CTX_get_cert_store = 'SSL_CTX_get_cert_store'; } {Do not localize} + {CH fn_SSL_CTX_set_cert_store = 'SSL_CTX_set_cert_store'; } {Do not localize} + {CH fn_SSL_want = 'SSL_want'; } {Do not localize} + {CH fn_SSL_clear = 'SSL_clear'; } {Do not localize} + {CH fn_SSL_CTX_flush_sessions = 'SSL_CTX_flush_sessions'; } {Do not localize} + fn_SSL_get_current_cipher = 'SSL_get_current_cipher'; {Do not localize} + fn_SSL_CIPHER_get_bits = 'SSL_CIPHER_get_bits'; {Do not localize} + fn_SSL_CIPHER_get_version = 'SSL_CIPHER_get_version'; {Do not localize} + fn_SSL_CIPHER_get_name = 'SSL_CIPHER_get_name'; {Do not localize} + {CH fn_SSL_get_fd = 'SSL_get_fd'; } {Do not localize} + {CH fn_SSL_get_cipher_list = 'SSL_get_cipher_list'; } {Do not localize} + {CH fn_SSL_get_shared_ciphers = 'SSL_get_shared_ciphers'; } {Do not localize} + {CH fn_SSL_get_read_ahead = 'SSL_get_read_ahead'; } {Do not localize} + fn_SSL_pending = 'SSL_pending'; {Do not localize} + {$IFNDEF OPENSSL_NO_SOCK} + fn_SSL_set_fd = 'SSL_set_fd'; {Do not localize} + {CH fn_SSL_set_rfd = 'SSL_set_rfd'; } {Do not localize} + {CH fn_SSL_set_wfd = 'SSL_set_wfd'; } {Do not localize} + {$ENDIF} + {$IFNDEF OPENSSL_NO_BIO} + {CH fn_SSL_set_bio = 'SSL_set_bio'; } {Do not localize} + {CH fn_SSL_get_rbio = 'SSL_get_rbio'; } {Do not localize} + {CH fn_SSL_get_wbio = 'SSL_get_wbio'; } {Do not localize} + {$ENDIF} + {CH fn_SSL_set_cipher_list = 'SSL_set_cipher_list'; } {Do not localize} + {CH fn_SSL_set_read_ahead = 'SSL_set_read_ahead'; } {Do not localize} + {CH fn_SSL_get_verify_mode = 'SSL_get_verify_mode'; } {Do not localize} + {CH fn_SSL_get_verify_depth = 'SSL_get_verify_depth'; } {Do not localize} + {CH fn_SSL_set_verify = 'SSL_set_verify'; } {Do not localize} + {CH fn_SSL_set_verify_depth = 'SSL_set_verify_depth'; } {Do not localize} + {$IFNDEF OPENSSL_NO_RSA} + {CH fn_SSL_use_RSAPrivateKey = 'SSL_use_RSAPrivateKey'; } {Do not localize} + {CH fn_SSL_use_RSAPrivateKey_ASN1 = 'SSL_use_RSAPrivateKey_ASN1'; } {Do not localize} + {$ENDIF} + {CH fn_SSL_use_PrivateKey = 'SSL_use_PrivateKey'; } {Do not localize} + {CH fn_SSL_use_PrivateKey_ASN1 = 'SSL_use_PrivateKey_ASN1'; } {Do not localize} + {CH fn_SSL_use_certificate = 'SSL_use_certificate'; } {Do not localize} + {CH fn_SSL_use_certificate_ASN1 = 'SSL_use_certificate_ASN1'; } {Do not localize} + {CH fn_SSL_use_RSAPrivateKey_file = 'SSL_use_RSAPrivateKey_file'; } {Do not localize} + {CH fn_SSL_use_PrivateKey_file = 'SSL_use_PrivateKey_file'; } {Do not localize} + {CH fn_SSL_use_certificate_file = 'SSL_use_certificate_file'; } {Do not localize} + {$IFNDEF OPENSSL_NO_RSA} + {CH fn_SSL_CTX_use_RSAPrivateKey_file = 'SSL_CTX_use_RSAPrivateKey_file'; } {Do not localize} + {$ENDIF} + fn_SSL_CTX_use_PrivateKey_file = 'SSL_CTX_use_PrivateKey_file'; {Do not localize} + fn_SSL_CTX_use_certificate_file = 'SSL_CTX_use_certificate_file'; {Do not localize} + fn_SSL_CTX_use_certificate_chain_file = 'SSL_CTX_use_certificate_chain_file'; {Do not localize} + {$ifndef OPENSSL_NO_ENGINE} + {CH fn_SSL_CTX_set_client_cert_engine = 'SSL_CTX_set_client_cert_engine'; } {Do not localize} + {$endif} + {CH fn_SSL_CTX_use_certificate_chain_file = 'SSL_CTX_use_certificate_chain_file'; } {Do not localize} + fn_SSL_load_client_CA_file = 'SSL_load_client_CA_file'; {Do not localize} + {CH fn_SSL_add_file_cert_subjects_to_stack = 'SSL_add_file_cert_subjects_to_stack'; } {Do not localize} + {CH fn_ERR_load_SSL_strings = 'ERR_load_SSL_strings'; } {Do not localize} + fn_SSL_load_error_strings = 'SSL_load_error_strings'; {Do not localize} + {CH fn_SSL_state_string = 'SSL_state_string'; } {Do not localize} + {CH fn_SSL_rstate_string = 'SSL_rstate_string'; } {Do not localize} + fn_SSL_state_string_long = 'SSL_state_string_long'; {Do not localize} + {CH fn_SSL_rstate_string_long = 'SSL_rstate_string_long'; } {Do not localize} + {CH fn_SSL_SESSION_get_time = 'SSL_SESSION_get_time'; } {Do not localize} + {CH fn_SSL_SESSION_set_time = 'SSL_SESSION_set_time'; } {Do not localize} + {CH fn_SSL_SESSION_get_timeout = 'SSL_SESSION_get_timeout'; } {Do not localize} + {CH fn_SSL_SESSION_set_timeout = 'SSL_SESSION_set_timeout'; } {Do not localize} + fn_SSL_copy_session_id = 'SSL_copy_session_id'; {Do not localize} + {CH fn_SSL_SESSION_new = 'SSL_SESSION_new'; } {Do not localize} + {CH fn_SSL_SESSION_hash = 'SSL_SESSION_hash'; } {Do not localize} + {CH fn_SSL_SESSION_cmp = 'SSL_SESSION_cmp'; } {Do not localize} + {$IFNDEF OPENSSL_NO_FP_API} + {CH fn_SSL_SESSION_print_fp = 'SSL_SESSION_print_fp'; } {Do not localize} + {$ENDIF} + {$IFNDEF OPENSSL_NO_BIO} + {CH fn_SSL_SESSION_print = 'SSL_SESSION_print'; } {Do not localize} + {$ENDIF} + {CH fn_SSL_SESSION_free = 'SSL_SESSION_free'; } {Do not localize} + {CH fn_i2d_SSL_SESSION = 'i2d_SSL_SESSION'; } {Do not localize} + {CH fn_SSL_set_session = 'SSL_set_session'; } {Do not localize} + {CH fn_SSL_CTX_add_session = 'SSL_CTX_add_session'; } {Do not localize} + {CH fn_SSL_CTX_remove_session = 'SSL_CTX_remove_session'; } {Do not localize} + {CH fn_d2i_SSL_SESSION = 'd2i_SSL_SESSION'; } {Do not localize} + fn_SSL_get_peer_certificate = 'SSL_get_peer_certificate'; {Do not localize} + {CH fn_SSL_get_peer_cert_chain = 'SSL_get_peer_cert_chain'; } {Do not localize} + {CH fn_SSL_CTX_get_verify_mode = 'SSL_CTX_get_verify_mode'; } {Do not localize} + fn_SSL_CTX_get_verify_depth = 'SSL_CTX_get_verify_depth'; {Do not localize} + fn_SSL_CTX_set_verify = 'SSL_CTX_set_verify'; {Do not localize} + fn_SSL_CTX_set_verify_depth = 'SSL_CTX_set_verify_depth'; {Do not localize} + {CH fn_SSL_CTX_set_cert_verify_callback = 'SSL_CTX_set_cert_verify_callback'; } {Do not localize} + {CH fn_SSL_CTX_use_RSAPrivateKey = 'SSL_CTX_use_RSAPrivateKey'; } {Do not localize} + {CH fn_SSL_CTX_use_RSAPrivateKey_ASN1 = 'SSL_CTX_use_RSAPrivateKey_ASN1'; } {Do not localize} + fn_SSL_CTX_use_PrivateKey = 'SSL_CTX_use_PrivateKey'; {Do not localize} + {CH fn_SSL_CTX_use_PrivateKey_ASN1 = 'SSL_CTX_use_PrivateKey_ASN1'; } {Do not localize} + fn_SSL_CTX_use_certificate = 'SSL_CTX_use_certificate'; {Do not localize} + {CH fn_SSL_CTX_use_certificate_ASN1 = 'SSL_CTX_use_certificate_ASN1'; } {Do not localize} + fn_SSL_CTX_set_default_passwd_cb = 'SSL_CTX_set_default_passwd_cb'; {Do not localize} + fn_SSL_CTX_set_default_passwd_cb_userdata = 'SSL_CTX_set_default_passwd_cb_userdata'; {Do not localize} + fn_SSL_CTX_check_private_key = 'SSL_CTX_check_private_key'; {Do not localize} + {CH fn_SSL_check_private_key = 'SSL_check_private_key'; } {Do not localize} + fn_SSL_CTX_set_session_id_context = 'SSL_CTX_set_session_id_context'; {Do not localize} + fn_SSL_new = 'SSL_new'; {Do not localize} + {CH fn_SSL_set_session_id_context = 'SSL_set_session_id_context'; } {Do not localize} + fn_SSL_free = 'SSL_free'; {Do not localize} + fn_SSL_accept = 'SSL_accept'; {Do not localize} + fn_SSL_connect = 'SSL_connect'; {Do not localize} + fn_SSL_read = 'SSL_read'; {Do not localize} + fn_SSL_peek = 'SSL_peek'; {Do not localize} + fn_SSL_write = 'SSL_write'; {Do not localize} + fn_SSL_ctrl = 'SSL_ctrl'; {Do not localize} + fn_SSL_CTX_ctrl = 'SSL_CTX_ctrl'; {Do not localize} + fn_SSL_get_error = 'SSL_get_error'; {Do not localize} + {CH fn_SSL_get_version = 'SSL_get_version'; } {Do not localize} + {CH fn_SSL_CTX_set_ssl_version = 'SSL_CTX_set_ssl_version'; } {Do not localize} + fn_SSLv2_method = 'SSLv2_method'; {Do not localize} + fn_SSLv2_server_method = 'SSLv2_server_method'; {Do not localize} + fn_SSLv2_client_method = 'SSLv2_client_method'; {Do not localize} + fn_SSLv3_method = 'SSLv3_method'; {Do not localize} + fn_SSLv3_server_method = 'SSLv3_server_method'; {Do not localize} + fn_SSLv3_client_method = 'SSLv3_client_method'; {Do not localize} + fn_SSLv23_method = 'SSLv23_method'; {Do not localize} + fn_SSLv23_server_method = 'SSLv23_server_method'; {Do not localize} + fn_SSLv23_client_method = 'SSLv23_client_method'; {Do not localize} + fn_TLSv1_method = 'TLSv1_method'; {Do not localize} + fn_TLSv1_server_method = 'TLSv1_server_method'; {Do not localize} + fn_TLSv1_client_method = 'TLSv1_client_method'; {Do not localize} + fn_TLSv1_1_method = 'TLSv1_1_method'; {Do not localize} + fn_TLSv1_1_server_method = 'TLSv1_1_server_method'; {Do not localize} + fn_TLSv1_1_client_method = 'TLSv1_1_client_method'; {Do not localize} + fn_TLSv1_2_method = 'TLSv1_2_method'; {Do not localize} + fn_TLSv1_2_server_method = 'TLSv1_2_server_method'; {Do not localize} + fn_TLSv1_2_client_method = 'TLSv1_2_client_method'; {Do not localize} + fn_DTLSv1_method = 'DTLSv1_method'; {Do not localize} + fn_DTLSv1_server_method = 'DTLSv1_server_method'; {Do not localize} + fn_DTLSv1_client_method = 'DTLSv1_client_method'; {Do not localize} + {CH fn_SSL_get_ciphers = 'SSL_get_ciphers'; } {Do not localize} + {CH fn_SSL_do_handshake = 'SSL_do_handshake'; } {Do not localize} + {CH fn_SSL_renegotiate = 'SSL_renegotiate'; } {Do not localize} + fn_SSL_shutdown = 'SSL_shutdown'; {Do not localize} + {CH fn_SSL_get_ssl_method = 'SSL_get_ssl_method'; } {Do not localize} + {CH fn_SSL_set_ssl_method = 'SSL_set_ssl_method'; } {Do not localize} + fn_SSL_alert_type_string_long = 'SSL_alert_type_string_long'; {Do not localize} + {CH fn_SSL_alert_type_string = 'SSL_alert_type_string'; } {Do not localize} + fn_SSL_alert_desc_string_long = 'SSL_alert_desc_string_long'; {Do not localize} + {CH fn_SSL_alert_desc_string = 'SSL_alert_desc_string'; } {Do not localize} + {CH fn_SSL_set_client_CA_list = 'SSL_set_client_CA_list'; } {Do not localize} + fn_SSL_CTX_set_client_CA_list = 'SSL_CTX_set_client_CA_list'; {Do not localize} + {CH fn_SSL_get_client_CA_list = 'SSL_get_client_CA_list'; } {Do not localize} + {CH fn_SSL_CTX_get_client_CA_list = 'SSL_CTX_get_client_CA_list'; } {Do not localize} + {CH fn_SSL_add_client_CA = 'SSL_add_client_CA'; } {Do not localize} + {CH fn_SSL_CTX_add_client_CA = 'SSL_CTX_add_client_CA'; } {Do not localize} + fn_SSL_set_connect_state = 'SSL_set_connect_state'; {Do not localize} + fn_SSL_set_accept_state = 'SSL_set_accept_state'; {Do not localize} + {CH fn_SSL_get_default_timeout = 'SSL_get_default_timeout'; } {Do not localize} + {CH fn_SSL_library_init = 'SSL_library_init'; } {Do not localize} + fn_SSL_CIPHER_description = 'SSL_CIPHER_description'; {Do not localize} + {CH fn_SSL_dup_CA_list = 'SSL_dup_CA_list'; } {Do not localize} + {CH fn_SSL_dup = 'SSL_dup'; } {Do not localize} + {CH fn_SSL_get_certificate = 'SSL_get_certificate'; } {Do not localize} + {CH fn_SSL_get_privatekey = 'SSL_get_privatekey'; } {Do not localize} + {CH fn_SSL_CTX_set_quiet_shutdown = 'SSL_CTX_set_quiet_shutdown'; } {Do not localize} + {CH fn_SSL_CTX_get_quiet_shutdown = 'SSL_CTX_get_quiet_shutdown'; } {Do not localize} + {CH fn_SSL_set_quiet_shutdown = 'SSL_set_quiet_shutdown'; } {Do not localize} + {CH fn_SSL_get_quiet_shutdown = 'SSL_get_quiet_shutdown'; } {Do not localize} + fn_SSL_set_shutdown = 'SSL_set_shutdown'; {Do not localize} + {CH fn_SSL_get_shutdown = 'SSL_get_shutdown'; } {Do not localize} + {CH fn_SSL_version = 'SSL_version'; } {Do not localize} + fn_SSL_CTX_set_default_verify_paths = 'SSL_CTX_set_default_verify_paths'; {Do not localize} + fn_SSL_CTX_load_verify_locations = 'SSL_CTX_load_verify_locations'; {Do not localize} + fn_SSL_get_session = 'SSL_get_session'; {Do not localize} + {CH fn_SSL_get_SSL_CTX = 'SSL_get_SSL_CTX'; } {Do not localize} + {CH fn_SSL_set_SSL_CTX = 'SSL_set_SSL_CTX'; } {Do not localize} + {CH fn_OPENSSL_isservice = 'OPENSSL_isservice'; }{Do not localize} + {CH fn_SSL_set_info_callback = 'SSL_set_info_callback'; } {Do not localize} + {CH fn_SSL_state = 'SSL_state'; } {Do not localize} + + fn_SSL_set_verify_result = 'SSL_set_verify_result'; {Do not localize} + fn_SSL_get_verify_result = 'SSL_get_verify_result'; {Do not localize} + fn_SSL_set_ex_data = 'SSL_set_ex_data'; {Do not localize} + fn_SSL_get_ex_data = 'SSL_get_ex_data'; {Do not localize} + {CH fn_SSL_get_ex_new_index = 'SSL_get_ex_new_index'; } {Do not localize} + {CH fn_SSL_SESSION_set_ex_data = 'SSL_SESSION_set_ex_data'; } {Do not localize} + {CH fn_SSL_SESSION_get_ex_data = 'SSL_SESSION_get_ex_data'; } {Do not localize} + {CH fn_SSL_SESSION_get_ex_new_index = 'SSL_SESSION_get_ex_new_index'; } {Do not localize} + {CH fn_SSL_CTX_set_ex_data = 'SSL_CTX_set_ex_data'; } {Do not localize} + {CH fn_SSL_CTX_get_ex_data = 'SSL_CTX_get_ex_data'; } {Do not localize} + {CH fn_SSL_CTX_get_ex_new_index = 'SSL_CTX_get_ex_new_index'; } {Do not localize} + {CH fn_SSL_get_ex_data_X509_STORE_CTX_idx = 'SSL_get_ex_data_X509_STORE_CTX_idx'; } {Do not localize} + {$IFNDEF OPENSSL_NO_RSA} + {CH fn_SSL_CTX_set_tmp_rsa_callback = 'SSL_CTX_set_tmp_rsa_callback'; } {Do not localize} + {CH fn_SSL_set_tmp_rsa_callback = 'SSL_set_tmp_rsa_callback'; } {Do not localize} + {$ENDIF} + {$IFNDEF OPENSSL_NO_DH} + {CH fn_SSL_CTX_set_tmp_dh_callback = 'SSL_CTX_set_tmp_dh_callback'; } {Do not localize} + {CH fn_SSL_set_tmp_dh_callback = 'SSL_set_tmp_dh_callback'; } {Do not localize} + {$ENDIF} + {$IFNDEF OPENSSL_NO_ECDH} + {CH fn_SSL_CTX_set_tmp_ecdh_callback = 'SSL_CTX_set_tmp_ecdh_callback'; } {Do not localize} + {CH fn_SSL_set_tmp_ecdh_callback = 'SSL_set_tmp_ecdh_callback'; } {Do not localize} + {$ENDIF} + {CH fn_SSL_COMP_add_compression_method = 'SSL_COMP_add_compression_method'; } {Do not localize} + {CH fn_SSL_get_current_expansion = 'SSL_get_current_expansion'; } {Do not localize} + {CH fn_SSL_COMP_get_name = 'SSL_COMP_get_name'; } {Do not localize} + fn_SSL_COMP_get_compression_methods = 'SSL_COMP_get_compression_methods'; {Do not localize} + fn_SSL_COMP_free_compression_methods = 'SSL_COMP_free_compression_methods'; {Do not localize} + // GREGOR + //fn_SSLeay_add_ssl_algorithms = 'mi_SSLeay_add_ssl_algorithms'; {Do not localize} + //why does the function name not match? + // + // RLebeau: because it is not an actual function of its own to begin with. + // It is a precompiler macro that maps to another function + fn_SSLeay_add_ssl_algorithms = 'SSL_library_init'; {Do not localize} + fn_SSL_SESSION_get_id = 'SSL_SESSION_get_id'; {Do not localize} + {CH fn_SSL_is_init_finished = 'mi_SSL_is_init_finished'; } {Do not localize} + {CH fn_SSL_in_init = 'mi_SSL_in_init'; } {Do not localize} + {CH fn_SSL_in_before = 'mi_SSL_in_before'; } {Do not localize} + {CH fn_SSL_in_connect_init = 'mi_SSL_in_connect_init'; } {Do not localize} + {CH fn_SSL_in_accept_init = 'mi_SSL_in_accept_init'; } {Do not localize} + {CH fn_fopen = 'mi_fopen'; } {Do not localize} + {CH fn_fclose = 'mi_fclose'; } {Do not localize} + // + fn_PKCS12_create = 'PKCS12_create'; {Do not localize} + fn_i2d_PKCS12_bio = 'i2d_PKCS12_bio'; {Do not localize} + fn_PKCS12_free = 'PKCS12_free'; {Do not localize} + {CH fn_RAND_set_rand_method = 'RAND_set_rand_method'; } {Do not localize} + {CH fn_RAND_get_rand_method = 'RAND_get_rand_method'; } {Do not localize} + {$IFNDEF OPENSSL_NO_ENGINE} + {CH fn_RAND_set_rand_engine = 'RAND_set_rand_engine'; } {Do not localize} + {$ENDIF} + {CH fn_RAND_SSLeay = 'RAND_SSLeay'; } {Do not localize} + fn_RAND_cleanup = 'RAND_cleanup'; {Do not localize} + fn_RAND_bytes = 'RAND_bytes'; {Do not localize} + fn_RAND_pseudo_bytes = 'RAND_pseudo_bytes'; {Do not localize} + fn_RAND_seed = 'RAND_seed'; {Do not localize} + fn_RAND_add = 'RAND_add'; {Do not localize} + {CH fn_RAND_load_file = 'RAND_load_file'; } {Do not localize} + {CH fn_RAND_write_file = 'RAND_write_file'; } {Do not localize} + {CH fn_RAND_file_name = 'RAND_file_name'; } {Do not localize} + fn_RAND_status = 'RAND_status'; {Do not localize} + {CH fn_RAND_query_egd_bytes = 'RAND_query_egd_bytes'; } {Do not localize} + {CH fn_RAND_egd = 'RAND_egd'; } {Do not localize} + {CH fn_RAND_egd_bytes = 'RAND_egd_bytes'; } {Do not localize} + {CH fn_RAND_poll = 'RAND_poll'; } {Do not localize} + {$IFDEF SYS_WIN} + //GREGOR + fn_RAND_screen = 'RAND_screen'; {Do not localize} + fn_RAND_event = 'RAND_event'; {Do not localize} + {$ENDIF} + {CH fn_ERR_load_RAND_strings = 'ERR_load_RAND_strings'; } {Do not localize} + //experimental + fn_ERR_put_error = 'ERR_put_error'; {Do not localize} + fn_ERR_get_error = 'ERR_get_error'; {Do not localize} +{CH fn_ERR_get_error_line = 'ERR_get_error_line'; } {Do not localize} +{CH fn_ERR_get_error_line_data = 'ERR_get_error_line_data'; } {Do not localize} + fn_ERR_peek_error = 'ERR_peek_error'; {Do not localize} + fn_ERR_peek_last_error = 'ERR_peek_last_error'; {Do not localize} + {CH fn_ERR_peek_error_line = 'ERR_peek_error_line'; } {Do not localize} +{CH fn_ERR_peek_error_line_data = 'ERR_peek_error_line_data'; } {Do not localize} + fn_ERR_peek_last_error_line = 'ERR_peek_last_error_line'; {Do not localize} +{CH fn_ERR_peek_last_error_line_data = 'ERR_peek_last_error_line_data'; } {Do not localize} + fn_ERR_clear_error = 'ERR_clear_error'; {Do not localize} + fn_ERR_error_string = 'ERR_error_string'; {Do not localize} + fn_ERR_error_string_n = 'ERR_error_string_n'; {Do not localize} + fn_ERR_lib_error_string = 'ERR_lib_error_string'; {Do not localize} + fn_ERR_func_error_string = 'ERR_func_error_string'; {Do not localize} + fn_ERR_reason_error_string = 'ERR_reason_error_string'; {Do not localize} +{CH fn_ERR_print_errors_cb = 'ERR_print_errors_cb'; } {Do not localize} + {$IFNDEF OPENSSL_NO_FP_API} +{CH fn_ERR_print_errors_fp = 'ERR_print_errors_fp'; } {Do not localize} + {$ENDIF} + {$IFNDEF OPENSSL_NO_BIO} +{CH fn_ERR_print_errors = 'ERR_print_errors'; } {Do not localize} +{CH fn_ERR_add_error_data = 'ERR_add_error_data'; } {Do not localize} + {$ENDIF} + fn_ERR_load_ERR_strings = 'ERR_load_ERR_strings'; {Do not localize} + fn_ERR_free_strings = 'ERR_free_strings'; {do not localize} + fn_ERR_remove_thread_state = 'ERR_remove_thread_state'; {Do not localize} + fn_ERR_remove_state = 'ERR_remove_state'; {do not localize} +{CH fn_ERR_unload_strings = 'ERR_unload_strings'; } {Do not localize} +{CH fn_ERR_remove_thread_state = 'ERR_remove_thread_state'; } {Do not localize} +{CH fn_ERR_load_ERR_strings = 'ERR_load_ERR_strings'; } {Do not localize} +{CH fn_ERR_load_crypto_strings = 'ERR_load_crypto_strings'; } {Do not localize} +{CH fn_ERR_free_strings = 'ERR_free_strings'; } {Do not localize} +{CH fn_ERR_add_error_vdata = 'ERR_add_error_vdata'; } {Do not localize} +{CH fn_ERR_remove_state = 'ERR_remove_state'; } {Do not localize} +{CH fn_ERR_get_state = 'ERR_get_state'; } {Do not localize} + {$IFNDEF OPENSSL_NO_LHASH} + {CH fn_ERR_get_string_table = 'ERR_get_string_table'; } {Do not localize} + {CH fn_ERR_get_err_state_table = 'ERR_get_err_state_table'; } {Do not localize} + {CH fn_ERR_release_err_state_table = 'ERR_release_err_state_table'; } {Do not localize} + {$ENDIF} + {CH fn_ERR_get_next_error_library = 'ERR_get_next_error_library'; } {Do not localize} + {CH fn_ERR_set_mark = 'ERR_set_mark'; } {Do not localize} + {CH fn_ERR_pop_to_mark = 'ERR_pop_to_mark'; } {Do not localize} + {$IFDEF OPENSSL_FIPS} + {CH fn_int_ERR_set_state_func = 'int_ERR_set_state_func'; } {Do not localize} + {CH fn_int_ERR_lib_init = 'int_ERR_lib_init'; } {Do not localize} + {$ENDIF} + {CH fn_UI_new = 'UI_new'; } {Do not localize} + {CH fn_UI_new_method = 'UI_new_method'; } {Do not localize} + {CH fn_UI_free = 'UI_free'; } {Do not localize} + {CH fn_UI_add_input_string = 'UI_add_input_string'; } {Do not localize} + {CH fn_UI_dup_input_string = 'UI_dup_input_string'; } {Do not localize} + {CH fn_UI_add_verify_string = 'UI_add_verify_string'; } {Do not localize} + {CH fn_UI_dup_verify_string = 'UI_dup_verify_string'; } {Do not localize} + {CH fn_UI_add_input_boolean = 'UI_add_input_boolean'; } {Do not localize} + {CH fn_UI_dup_input_boolean = 'UI_dup_input_boolean'; } {Do not localize} + {CH fn_UI_add_info_string = 'UI_add_info_string'; } {Do not localize} + {CH fn_UI_dup_info_string = 'UI_dup_info_string'; } {Do not localize} + {CH fn_UI_add_error_string = 'UI_add_error_string'; } {Do not localize} + {CH fn_UI_dup_error_string = 'UI_dup_error_string'; } {Do not localize} + {CH fn_UI_construct_prompt = 'UI_construct_prompt'; } {Do not localize} + {CH fn_UI_add_user_data = 'UI_add_user_data'; } {Do not localize} + {CH fn_UI_get0_user_data = 'UI_get0_user_data'; } {Do not localize} + {CH fn_UI_get0_resul = 'UI_get0_resul'; } {Do not localize} + {CH fn_UI_process = 'UI_process'; } {Do not localize} + {CH fn_UI_ctrl = 'UI_ctrl'; } {Do not localize} + {CH fn_UI_get_ex_new_index = 'UI_get_ex_new_index'; } {Do not localize} + {CH fn_UI_set_ex_data = 'UI_set_ex_data'; } {Do not localize} + {CH fn_UI_get_ex_data = 'UI_get_ex_data'; } {Do not localize} + {CH fn_UI_set_default_method = 'UI_set_default_method'; } {Do not localize} + {CH fn_UI_get_method = 'UI_get_method'; } {Do not localize} + {CH fn_UI_set_method = 'UI_set_method'; } {Do not localize} + {CH fn_UI_OpenSSL = 'UI_OpenSSL'; } {Do not localize} + {CH fn_UI_create_method = 'UI_create_method'; } {Do not localize} + {CH fn_UI_destroy_method = 'UI_destroy_method'; } {Do not localize} + {CH fn_UI_method_set_opener = 'UI_method_set_opener'; } {Do not localize} + {CH fn_UI_method_set_writer = 'UI_method_set_writer'; } {Do not localize} + {CH fn_UI_method_set_flusher = 'UI_method_set_flusher'; } {Do not localize} + {CH fn_UI_method_set_reader = 'UI_method_set_reader'; } {Do not localize} + {CH fn_UI_method_set_closer = 'UI_method_set_closer'; } {Do not localize} + {CH fn_UI_get_string_type = 'UI_get_string_type'; } {Do not localize} + {CH fn_UI_get_input_flags = 'UI_get_input_flags'; } {Do not localize} + {CH fn_UI_get0_output_string = 'UI_get0_output_string'; } {Do not localize} + {CH fn_UI_get0_action_string = 'UI_get0_action_string'; } {Do not localize} + {CH fn_UI_get0_result_string = 'UI_get0_result_string'; } {Do not localize} + {CH fn_UI_get0_test_string = 'UI_get0_test_string'; } {Do not localize} + {CH fn_UI_get_result_minsize = 'UI_get_result_minsize'; } {Do not localize} + {CH fn_UI_get_result_maxsize = 'UI_get_result_maxsize'; } {Do not localize} + {CH fn_UI_set_result = 'UI_set_result'; } {Do not localize} + {CH fn_UI_UTIL_read_pw_string = 'UI_UTIL_read_pw_string'; } {Do not localize} + {CH fn_UI_UTIL_read_pw = 'UI_UTIL_read_pw'; } {Do not localize} + {CH fn_ERR_load_UI_strings = 'ERR_load_UI_strings'; } {Do not localize} + {$IFNDEF OPENSSL_NO_ENGINE} + {CH fn_ENGINE_get_first = 'ENGINE_get_first'; } {Do not localize} + {CH fn_ENGINE_get_last = 'ENGINE_get_last'; } {Do not localize} + {CH fn_ENGINE_get_next = 'ENGINE_get_next'; } {Do not localize} + {CH fn_ENGINE_get_prev = 'ENGINE_get_prev'; } {Do not localize} + {CH fn_ENGINE_add = 'ENGINE_add'; } {Do not localize} + {CH fn_ENGINE_remove = 'ENGINE_remove'; } {Do not localize} + {CH fn_ENGINE_by_id = 'ENGINE_by_id'; } {Do not localize} + {CH fn_ENGINE_load_openssl = 'ENGINE_load_openssl'; } {Do not localize} + {CH fn_ENGINE_load_dynamic = 'ENGINE_load_dynamic'; } {Do not localize} + {$IFNDEF OPENSSL_NO_STATIC_ENGINE} + {CH fn_ENGINE_load_4758cca = 'ENGINE_load_4758cca'; } {Do not localize} + {CH fn_ENGINE_load_aep = 'ENGINE_load_aep'; } {Do not localize} + {CH fn_ENGINE_load_atalla = 'ENGINE_load_atalla'; } {Do not localize} + {CH fn_ENGINE_load_chil = 'ENGINE_load_chil'; } {Do not localize} + {CH fn_ENGINE_load_cswift = 'ENGINE_load_cswift'; } {Do not localize} + {$IFNDEF OPENSSL_NO_GMP} + {CH fn_ENGINE_load_gmp = 'ENGINE_load_gmp'; } {Do not localize} + {$ENDIF} + {CH fn_ENGINE_load_nuron = 'ENGINE_load_nuron'; } {Do not localize} + {CH fn_ENGINE_load_sureware = 'ENGINE_load_sureware'; } {Do not localize} + {CH fn_ENGINE_load_ubsec = 'ENGINE_load_ubsec'; } {Do not localize} + {$ENDIF} + {CH fn_ENGINE_load_cryptodev = 'ENGINE_load_cryptodev'; } {Do not localize} + {CH fn_ENGINE_load_padlock = 'ENGINE_load_padlock'; } {Do not localize} + {CH fn_ENGINE_load_builtin_engines = 'ENGINE_load_builtin_engines'; } {Do not localize} + {$IFDEF WIN32_OR_WIN64} + {$IFNDEF OPENSSL_NO_CAPIENG} + {CH fn_ENGINE_load_capi = 'ENGINE_load_capi'; } {Do not localize} + {$ENDIF} + {$ENDIF} + {CH fn_ENGINE_get_table_flags = 'ENGINE_get_table_flags'; } {Do not localize} + {CH fn_ENGINE_set_table_flags = 'ENGINE_set_table_flags'; } {Do not localize} + {CH fn_ENGINE_register_RSA = 'ENGINE_register_RSA'; } {Do not localize} + {CH fn_ENGINE_unregister_RSA = 'ENGINE_unregister_RSA'; } {Do not localize} + {CH fn_ENGINE_register_all_RSA = 'ENGINE_register_all_RSA'; } {Do not localize} + {CH fn_ENGINE_register_DSA = 'ENGINE_register_DSA'; } {Do not localize} + {CH fn_ENGINE_unregister_DSA = 'ENGINE_unregister_DSA'; } {Do not localize} + {CH fn_ENGINE_register_all_DSA = 'ENGINE_register_all_DSA'; } {Do not localize} + {CH fn_ENGINE_register_ECDH = 'ENGINE_register_ECDH'; } {Do not localize} + {CH fn_ENGINE_unregister_ECDH = 'ENGINE_unregister_ECDH'; } {Do not localize} + {CH fn_ENGINE_register_all_ECDH = 'ENGINE_register_all_ECDH'; } {Do not localize} + {CH fn_ENGINE_register_ECDSA = 'ENGINE_register_ECDSA'; } {Do not localize} + {CH fn_ENGINE_unregister_ECDSA = 'ENGINE_unregister_ECDSA'; } {Do not localize} + {CH fn_ENGINE_register_all_ECDSA = 'ENGINE_register_all_ECDSA'; } {Do not localize} + {CH fn_ENGINE_register_DH = 'ENGINE_register_DH'; } {Do not localize} + {CH fn_ENGINE_unregister_DH = 'ENGINE_unregister_DH'; } {Do not localize} + {CH fn_ENGINE_register_all_DH = 'ENGINE_register_all_DH'; } {Do not localize} + {CH fn_ENGINE_register_RAND = 'ENGINE_register_RAND'; } {Do not localize} + {CH fn_ENGINE_unregister_RAND = 'ENGINE_unregister_RAND'; } {Do not localize} + {CH fn_ENGINE_register_all_RAND = 'ENGINE_register_all_RAND'; } {Do not localize} + {CH fn_ENGINE_register_STORE = 'ENGINE_register_STORE'; } {Do not localize} + {CH fn_ENGINE_unregister_STORE = 'ENGINE_unregister_STORE'; } {Do not localize} + {CH fn_ENGINE_register_all_STORE = 'ENGINE_register_all_STORE'; } {Do not localize} + {CH fn_ENGINE_register_ciphers = 'ENGINE_register_ciphers'; } {Do not localize} + {CH fn_ENGINE_unregister_ciphers = 'ENGINE_unregister_ciphers'; } {Do not localize} + {CH fn_ENGINE_register_all_ciphers = 'ENGINE_register_all_ciphers'; } {Do not localize} + {CH fn_ENGINE_register_digests = 'ENGINE_register_digests'; } {Do not localize} + {CH fn_ENGINE_unregister_digests = 'ENGINE_unregister_digests'; } {Do not localize} + {CH fn_ENGINE_register_all_digests= 'ENGINE_register_all_digests'; } {Do not localize} + {CH fn_ENGINE_register_complete = 'ENGINE_register_complete'; } {Do not localize} + {CH fn_ENGINE_register_all_complete = 'ENGINE_register_all_complete'; } {Do not localize} + {CH fn_ENGINE_ctrl = 'ENGINE_ctrl'; } {Do not localize} + {CH fn_ENGINE_cmd_is_executable = 'ENGINE_cmd_is_executable'; } {Do not localize} + {CH fn_ENGINE_ctrl_cmd = 'ENGINE_ctrl_cmd'; } {Do not localize} + {CH fn_ENGINE_ctrl_cmd_string = 'ENGINE_ctrl_cmd_string'; } {Do not localize} + {CH fn_ENGINE_new = 'ENGINE_new'; } {Do not localize} + {CH fn_ENGINE_free = 'ENGINE_free'; } {Do not localize} + {CH fn_ENGINE_up_ref = 'ENGINE_up_ref'; } {Do not localize} + {CH fn_ENGINE_set_id = 'ENGINE_set_id'; } {Do not localize} + {CH fn_ENGINE_set_name = 'ENGINE_set_name'; } {Do not localize} + {CH fn_ENGINE_set_RSA = 'ENGINE_set_RSA'; } {Do not localize} + {CH fn_ENGINE_set_DSA = 'ENGINE_set_DSA'; } {Do not localize} + {CH fn_ENGINE_set_ECDH = 'ENGINE_set_ECDH'; } {Do not localize} + {CH fn_ENGINE_set_ECDSA = 'ENGINE_set_ECDSA'; } {Do not localize} + {CH fn_ENGINE_set_DH = 'ENGINE_set_DH'; } {Do not localize} + {CH fn_ENGINE_set_RAND = 'ENGINE_set_RAND'; } {Do not localize} + {CH fn_ENGINE_set_STORE = 'ENGINE_set_STORE'; } {Do not localize} + {CH fn_ENGINE_set_destroy_function = 'ENGINE_set_destroy_function'; } {Do not localize} + {CH fn_ENGINE_set_init_function = 'ENGINE_set_init_function'; } {Do not localize} + {CH fn_ENGINE_set_finish_function = 'ENGINE_set_finish_function'; } {Do not localize} + {CH fn_ENGINE_set_ctrl_function = 'ENGINE_set_ctrl_function'; } {Do not localize} + {CH fn_ENGINE_set_load_privkey_function = 'ENGINE_set_load_privkey_function'; } {Do not localize} + {CH fn_ENGINE_set_load_pubkey_function = 'ENGINE_set_load_pubkey_function'; } {Do not localize} + {CH fn_ENGINE_set_load_ssl_client_cert_function = 'ENGINE_set_load_ssl_client_cert_function'; } {Do not localize} + {CH fn_ENGINE_set_ciphers = 'ENGINE_set_ciphers'; } {Do not localize} + {CH fn_ENGINE_set_digests = 'ENGINE_set_digests'; } {Do not localize} + {CH fn_ENGINE_set_flags = 'ENGINE_set_flags'; } {Do not localize} + {CH fn_ENGINE_set_cmd_defns = 'ENGINE_set_cmd_defns'; } {Do not localize} + {CH fn_ENGINE_get_ex_new_index = 'ENGINE_get_ex_new_index'; } {Do not localize} + {CH fn_ENGINE_set_ex_data = 'ENGINE_set_ex_data'; } {Do not localize} + {CH fn_ENGINE_get_ex_data = 'ENGINE_get_ex_data'; } {Do not localize} + {CH fn_ENGINE_cleanup = 'ENGINE_cleanup'; } {Do not localize} + {CH fn_ENGINE_get_id = 'ENGINE_get_id'; } {Do not localize} + {CH fn_ENGINE_get_name = 'ENGINE_get_name'; } {Do not localize} + {CH fn_ENGINE_get_RSA = 'ENGINE_get_RSA'; } {Do not localize} + {CH fn_ENGINE_get_DSA = 'ENGINE_get_DSA'; } {Do not localize} + {CH fn_ENGINE_get_ECDH = 'ENGINE_get_ECDH'; } {Do not localize} + {CH fn_ENGINE_get_ECDSA = 'ENGINE_get_ECDSA'; } {Do not localize} + {CH fn_ENGINE_get_DH = 'ENGINE_get_DH'; } {Do not localize} + {CH fn_ENGINE_get_RAND = 'ENGINE_get_RAND'; } {Do not localize} + {CH fn_ENGINE_get_STORE = 'ENGINE_get_STORE'; } {Do not localize} + {CH fn_ENGINE_get_destroy_function = 'ENGINE_get_destroy_function'; } {Do not localize} + {CH fn_ENGINE_get_init_function = 'ENGINE_get_init_function'; } {Do not localize} + {CH fn_ENGINE_get_finish_function = 'ENGINE_get_finish_function'; } {Do not localize} + {CH fn_ENGINE_get_ctrl_function = 'ENGINE_get_ctrl_function'; } {Do not localize} + {CH fn_ENGINE_get_load_privkey_function = 'ENGINE_get_load_privkey_function'; } {Do not localize} + {CH fn_ENGINE_get_load_pubkey_function = 'ENGINE_get_load_pubkey_function'; } {Do not localize} + {CH fn_ENGINE_get_ssl_client_cert_function = 'ENGINE_get_ssl_client_cert_function'; } {Do not localize} + {CH fn_ENGINE_get_ciphers = 'ENGINE_get_ciphers'; } {Do not localize} + {CH fn_ENGINE_get_digests = 'ENGINE_get_digests'; } {Do not localize} + {CH fn_ENGINE_get_cipher = 'ENGINE_get_cipher'; } {Do not localize} + {CH fn_ENGINE_get_digest = 'ENGINE_get_digest'; } {Do not localize} + {CH fn_ENGINE_get_cmd_defns = 'ENGINE_get_cmd_defns'; } {Do not localize} + {CH fn_ENGINE_get_flags = 'ENGINE_get_flags'; } {Do not localize} + {CH fn_ENGINE_init = 'ENGINE_init'; } {Do not localize} + {CH fn_ENGINE_finish = 'ENGINE_finish'; } {Do not localize} + {CH fn_ENGINE_load_private_key = 'ENGINE_load_private_key'; } {Do not localize} + {CH fn_ENGINE_load_public_key = 'ENGINE_load_public_key'; } {Do not localize} + {CH fn_ENGINE_load_ssl_client_cert = 'ENGINE_load_ssl_client_cert'; } {Do not localize} + {CH fn_ENGINE_get_default_RSA = 'ENGINE_get_default_RSA'; } {Do not localize} + {CH fn_ENGINE_get_default_DSA = 'ENGINE_get_default_DSA'; } {Do not localize} + {CH fn_ENGINE_get_default_ECDH = 'ENGINE_get_default_ECDH'; } {Do not localize} + {CH fn_ENGINE_get_default_ECDSA = 'ENGINE_get_default_ECDSA'; } {Do not localize} + {CH fn_ENGINE_get_default_DH = 'ENGINE_get_default_DH'; } {Do not localize} + {CH fn_ENGINE_get_default_RAND = 'ENGINE_get_default_RAND'; } {Do not localize} + {CH fn_ENGINE_get_cipher_engine = 'ENGINE_get_cipher_engine'; } {Do not localize} + {CH fn_ENGINE_get_digest_engine = 'ENGINE_get_digest_engine'; } {Do not localize} + {CH fn_ENGINE_set_default_RSA = 'ENGINE_set_default_RSA'; } {Do not localize} + {CH fn_ENGINE_set_default_string = 'ENGINE_set_default_string'; } {Do not localize} + {CH fn_ENGINE_set_default_DSA = 'ENGINE_set_default_DSA'; } {Do not localize} + {CH fn_ENGINE_set_default_ECDH = 'ENGINE_set_default_ECDH'; } {Do not localize} + {CH fn_ENGINE_set_default_ECDSA = 'ENGINE_set_default_ECDSA'; } {Do not localize} + {CH fn_ENGINE_set_default_DH = 'ENGINE_set_default_DH'; } {do not localize} + {CH fn_ENGINE_set_default_RAND = 'ENGINE_set_default_RAND'; } {Do not localize} + {CH fn_ENGINE_set_default_ciphers = 'ENGINE_set_default_ciphers'; } {Do not localize} + {CH fn_ENGINE_set_default_digests = 'ENGINE_set_default_digests'; } {Do not localize} + {CH fn_ENGINE_set_default = 'ENGINE_set_default'; } {Do not localize} + {CH fn_ENGINE_add_conf_module = 'ENGINE_add_conf_module'; } {Do not localize} + {CH fn_ENGINE_get_static_state = 'ENGINE_get_static_state'; } {Do not localize} + {$IFDEF OPENBSD} + {CH fn_ENGINE_setup_bsd_cryptodev = 'ENGINE_setup_bsd_cryptodev'; } {Do not localize} + {$ENDIF} + {$IFDEF FREEBSD} + {CH fn_ENGINE_setup_bsd_cryptodev = 'ENGINE_setup_bsd_cryptodev'; } {Do not localize} + {$ENDIF} + {CH fn_ERR_load_ENGINE_strings = 'ERR_load_ENGINE_strings'; } {Do not localize} + {$ENDIF} + {$IFDEF OPENSSL_EXPORT_VAR_AS_FUNCTION} + //These have a gl prefix because they may not be functions in some platforms. + //They are functions in Win32 because DLL's can't export global variables + //while Unix shared objects may expose them. + {CH gl_ASN1_OBJECT_it = 'ASN1_OBJECT_it'; } {do not localize} + {CH gl_ASN1_OCTET_STRING_NDEF_it = 'ASN1_OCTET_STRING_NDEF_it'; } {Do not localize} + {CH gl_ASN1_BOOLEAN_it = 'ASN1_BOOLEAN_it'; } {Do not localize} + {CH gl_ASN1_SEQUENCE_it = 'ASN1_SEQUENCE_it'; } {Do not localize} + {CH gl_CBIGNUM_it = 'CBIGNUM_it'; } {Do not localize} + {CH gl_BIGNUM_it = 'BIGNUM_it'; } {Do not localize} + {CH gl_LONG_it = 'LONG_it'; } {Do not localize} + {CH gl_ZLONG_it = 'ZLONG_it'; } {Do not localize} + {CH gl_POLICY_MAPPING_it = 'POLICY_MAPPING_it'; } {Do not localize} + {CH gl_POLICY_MAPPINGS_it = 'POLICY_MAPPINGS_it'; } {Do not localize} + {CH gl_GENERAL_SUBTREE_it = 'GENERAL_SUBTREE_it'; } {Do not localize} + {CH gl_NAME_CONSTRAINTS_it = 'NAME_CONSTRAINTS_it'; } {Do not localize} + {CH gl_POLICY_CONSTRAINTS_it = 'POLICY_CONSTRAINTS_it'; } {Do not localize} + {$ENDIF} + + +function LoadFunction(const FceName: TIdLibFuncName; const ACritical : Boolean = True): Pointer; +{$IFDEF WINDOWS} +var + Err: DWORD; +{$ENDIF} +begin + Result := LoadLibFunction(hIdSSL, FceName); + if (Result <> nil) or (not ACritical) then begin + Exit; + end; + {$IFDEF WINDOWS} + Err := GetLastError(); + if Err <> ERROR_PROC_NOT_FOUND then begin + FFailedLoadList.Add(IndyFormat(RSOSSMissingExport_WithErrCode, [FceName, Err])); + Exit; + end; + {$ELSE} + // TODO: add error code to message... + {$ENDIF} + FFailedLoadList.Add(FceName); +end; + +function LoadFunctionCLib(const FceName: TIdLibFuncName; const ACritical : Boolean = True): Pointer; +{$IFDEF WINDOWS} +var + Err: DWORD; +{$ENDIF} +begin + Result := LoadLibFunction(hIdCrypto, FceName); + if (Result <> nil) or (not ACritical) then begin + Exit; + end; + {$IFDEF WINDOWS} + Err := GetLastError(); + if Err <> ERROR_PROC_NOT_FOUND then begin + FFailedLoadList.Add(IndyFormat(RSOSSMissingExport_WithErrCode, [FceName, Err])); + Exit; + end; + {$ELSE} + // TODO: add error code to message... + {$ENDIF} + FFailedLoadList.Add(FceName); +end; + +// Id_ossl_old_des_set_odd_parity +{ +IMPORTANT!!! + +Indy DES support probably had been written to use some old "des_" functions. +The OpenSSL developers changed that interface to a new "des_*" API. They have some + "_ossl_old_des_*" for backwards compatability with the old functions + which are defined in des_old.h. +} +function LoadOldCLib(const AOldName, ANewName : TIdLibFuncName; const ACritical : Boolean = True): Pointer; +{$IFDEF WINDOWS} +var + Err: DWORD; +{$ENDIF} +begin + Result := LoadLibFunction(hIdCrypto, AOldName); + if Result <> nil then begin + Exit; + end; + {$IFDEF WINDOWS} + if ACritical then begin + Err := GetLastError(); + if Err <> ERROR_PROC_NOT_FOUND then begin + FFailedLoadList.Add(IndyFormat(RSOSSMissingExport_WithErrCode, [AOldName, Err])); + Exit; + end; + end; + {$ENDIF} + Result := LoadLibFunction(hIdCrypto, ANewName); + if (Result <> nil) or (not ACritical) then begin + Exit; + end; + {$IFDEF WINDOWS} + Err := GetLastError(); + if Err <> ERROR_PROC_NOT_FOUND then begin + FFailedLoadList.Add(IndyFormat(RSOSSMissingExport_WithErrCode, [ANewName, Err])); + Exit; + end; + {$ELSE} + // TODO: add error code to message... + {$ENDIF} + FFailedLoadList.Add(AOldName); +end; + +{$ENDIF} // STATICLOAD_OPENSSL + +// remove this function, it is not used +function ErrMsg(AErr : TIdC_ULONG) : string; +const + sMaxErrStr = 300; +var + LString: array[0..sMaxErrStr] of TIdAnsiChar; + {$IFDEF USE_MARSHALLED_PTRS} + LStringPtr: TPtrWrapper; + {$ENDIF} +begin + {$IFDEF USE_MARSHALLED_PTRS} + LStringPtr := TPtrWrapper.Create(@LString[0]); + {$ENDIF} + ERR_error_string_n(AErr, + {$IFDEF USE_MARSHALLED_PTRS} + LStringPtr.ToPointer + {$ELSE} + LString + {$ENDIF}, sMaxErrStr); + LString[sMaxErrStr] := TIdAnsiChar(0); + {$IFDEF USE_MARSHALLED_PTRS} + Result := TMarshal.ReadStringAsAnsi(LStringPtr); + {$ELSE} + Result := String(LString); + {$ENDIF} +end; + +{$IFNDEF STATICLOAD_OPENSSL} + +{$UNDEF USE_BASEUNIX_OR_VCL_POSIX} +{$IFDEF USE_BASEUNIX} + {$DEFINE USE_BASEUNIX_OR_VCL_POSIX} +{$ENDIF} +{$IFDEF USE_VCL_POSIX} + {$DEFINE USE_BASEUNIX_OR_VCL_POSIX} +{$ENDIF} + +{$UNDEF USE_BASEUNIX_OR_VCL_POSIX_OR_KYLIXCOMPAT} +{$IFDEF USE_BASEUNIX_OR_VCL_POSIX} + {$DEFINE USE_BASEUNIX_OR_VCL_POSIX_OR_KYLIXCOMPAT} +{$ENDIF} +{$IFDEF KYLIXCOMPAT} + {$DEFINE USE_BASEUNIX_OR_VCL_POSIX_OR_KYLIXCOMPAT} +{$ENDIF} + +var + GIdOpenSSLPath: String = ''; + +procedure IdOpenSSLSetLibPath(const APath: String); +begin + if APath <> '' then begin + GIdOpenSSLPath := IndyIncludeTrailingPathDelimiter(APath); + end else begin + GIdOpenSSLPath := ''; + end; +end; + + {$IFDEF UNIX} +var + // TODO: default these to False instead, as modern systems now + // use symlinks that point to OpenSSL 1.1.x+, which is not + // compatible with this unit... + GIdCanLoadSymLinks: Boolean = True; + GIdLoadSymLinksFirst: Boolean = True; + +procedure IdOpenSSLSetCanLoadSymLinks(ACanLoad: Boolean); +begin + GIdCanLoadSymLinks := ACanLoad; +end; + +procedure IdOpenSSLSetLoadSymLinksFirst(ALoadFirst: Boolean); +begin + GIdLoadSymLinksFirst := ALoadFirst; +end; + {$ENDIF} + +function LoadSSLCryptoLibrary: TIdLibHandle; +{$IFDEF WINDOWS} +var + Err: DWORD; +{$ELSE} + {$IFDEF USE_BASEUNIX_OR_VCL_POSIX_OR_KYLIXCOMPAT} // TODO: use {$IF DEFINED(UNIX)} instead? +var + i, j: Integer; + LLibVersions: array [0..26] of string; + LCanLoadSymLinks, LLoadSymLinksFirst: Boolean; + {$ENDIF} +{$ENDIF} +begin + {$IFDEF WINDOWS} + //On Windows, you should use SafeLoadLibrary because + //the LoadLibrary API call messes with the FPU control word. + Result := SafeLoadLibrary(GIdOpenSSLPath + SSLCLIB_DLL_name); + if Result <> IdNilHandle then begin + Exit; + end; + {$ELSE} + {$IFDEF USE_BASEUNIX_OR_VCL_POSIX_OR_KYLIXCOMPAT} // TODO: use {$IF DEFINED(UNIX)} instead? + // Workaround that is required under Linux (changed RTLD_GLOBAL with RTLD_LAZY Note: also work with LoadLibrary()) + Result := IdNilHandle; + LCanLoadSymLinks := GIdCanLoadSymLinks; + LLoadSymLinksFirst := GIdLoadSymLinksFirst; + if LCanLoadSymLinks and LLoadSymLinksFirst then begin + Result := HackLoad(GIdOpenSSLPath + SSLCLIB_DLL_name, []); + if Result <> IdNilHandle then begin + Exit; + end; + // TODO: exit here if the error is anything other than the file not being found... + end; + for i := Low(SSLDLLVers) to High(SSLDLLVers) do begin + for j := Low(SSLDLLVersChar) to High(SSLDLLVersChar) do begin + LLibVersions[j] := SSLDLLVers[i] + SSLDLLVersChar[j]; + end; + Result := HackLoad(GIdOpenSSLPath + SSLCLIB_DLL_name, LLibVersions); + if Result <> IdNilHandle then begin + Exit; + end; + // TODO: exit here if the error is anything other than the file not being found... + end; + if LCanLoadSymLinks and (not LLoadSymLinksFirst) then begin + Result := HackLoad(GIdOpenSSLPath + SSLCLIB_DLL_name, []); + if Result <> IdNilHandle then begin + Exit; + end; + // TODO: exit here if the error is anything other than the file not being found... + end; + {$ELSE} + Result := IdNilHandle; + {$ENDIF} + {$ENDIF} + {$IFDEF WINDOWS} + Err := GetLastError; + FFailedLoadList.Add(IndyFormat(RSOSSFailedToLoad_WithErrCode, [GIdOpenSSLPath + SSLCLIB_DLL_name, Err])); + {$ELSE} + // TODO: add error code to message... + FFailedLoadList.Add(IndyFormat(RSOSSFailedToLoad, [GIdOpenSSLPath + SSLCLIB_DLL_name {$IFDEF UNIX}+ LIBEXT{$ENDIF}])); + {$ENDIF} +end; + +function LoadSSLLibrary: TIdLibHandle; +{$IFDEF WINDOWS} +var + Err: DWORD; +{$ELSE} + {$IFDEF USE_BASEUNIX_OR_VCL_POSIX_OR_KYLIXCOMPAT} // TODO: use {$IF DEFINED(UNIX)} instead? +var + i, j: Integer; + LLibVersions: array [0..26] of string; + LCanLoadSymLinks, LLoadSymLinksFirst: Boolean; + {$ENDIF} +{$ENDIF} +begin + {$IFDEF WINDOWS} + //On Windows, you should use SafeLoadLibrary because + //the LoadLibrary API call messes with the FPU control word. + Result := SafeLoadLibrary(GIdOpenSSLPath + SSL_DLL_name); + if Result <> IdNilHandle then begin + Exit; + end; + // TODO: exit here if the error is anything other than the file not being found... + //This is a workaround for mingw32-compiled SSL .DLL which + //might be named 'libssl32.dll'. + Result := SafeLoadLibrary(GIdOpenSSLPath + SSL_DLL_name_alt); + if Result <> IdNilHandle then begin + Exit; + end; + {$ELSE} + {$IFDEF USE_BASEUNIX_OR_VCL_POSIX_OR_KYLIXCOMPAT} // TODO: use {$IF DEFINED(UNIX)} instead? + // Workaround that is required under Linux (changed RTLD_GLOBAL with RTLD_LAZY Note: also work with LoadLibrary()) + Result := IdNilHandle; + LCanLoadSymLinks := GIdCanLoadSymLinks; + LLoadSymLinksFirst := GIdLoadSymLinksFirst; + if LCanLoadSymLinks and LLoadSymLinksFirst then begin + Result := HackLoad(GIdOpenSSLPath + SSL_DLL_name, []); + if Result <> IdNilHandle then begin + Exit; + end; + // TODO: exit here if the error is anything other than the file not being found... + end; + for i := Low(SSLDLLVers) to High(SSLDLLVers) do begin + for j := Low(SSLDLLVersChar) to High(SSLDLLVersChar) do begin + LLibVersions[j] := SSLDLLVers[i] + SSLDLLVersChar[j]; + end; + Result := HackLoad(GIdOpenSSLPath + SSL_DLL_name, LLibVersions); + if Result <> IdNilHandle then begin + Exit; + end; + // TODO: exit here if the error is anything other than the file not being found... + end; + if LCanLoadSymLinks and (not LLoadSymLinksFirst) then begin + Result := HackLoad(GIdOpenSSLPath + SSL_DLL_name, []); + if Result <> IdNilHandle then begin + Exit; + end; + // TODO: exit here if the error is anything other than the file not being found... + end; + {$ELSE} + Result := IdNilHandle; + {$ENDIF} + {$ENDIF} + {$IFDEF WINDOWS} + Err := GetLastError; + FFailedLoadList.Add(IndyFormat(RSOSSFailedToLoad_WithErrCode, [GIdOpenSSLPath + SSL_DLL_name, Err])); + {$ELSE} + // TODO: add error code to message... + FFailedLoadList.Add(IndyFormat(RSOSSFailedToLoad, [GIdOpenSSLPath + SSL_DLL_name {$IFDEF UNIX}+ LIBEXT{$ENDIF}])); + {$ENDIF} +end; + +{$ENDIF} // STATICLOAD_OPENSSL + +{$IFDEF ANDROID} +// In Android 6, Google replaced OpenSSL with BoringSSL, which is a fork of +// OpenSSL and does not export many functions, including the following... + +type + msg_callback_proc = procedure(write_p, version, content_type : TIdC_INT; const buf : Pointer; len: size_t; ssl: PSSL; arg: Pointer); cdecl; + +function Indy_ssl_callback_ctrl(s: PSSL; cb_id: TIdC_INT; fp: SSL_METHOD_PROC): TIdC_LONG; cdecl; +begin + if cb_id = SSL_CTRL_SET_MSG_CALLBACK then begin + s.msg_callback := msg_callback_proc(fp); + Result := 1; + end else begin + Result := s.method.ssl_callback_ctrl(s, cb_id, fp); + end; +end; + +function Indy_SSL_CTX_callback_ctrl(ctx: PSSL_CTX; cmd: TIdC_INT; fp: SSL_METHOD_PROC): TIdC_LONG; cdecl; +begin + if cmd = SSL_CTRL_SET_MSG_CALLBACK then begin + ctx.msg_callback := msg_callback_proc(fp); + Result := 1; + end else begin + Result := ctx.method.ssl_ctx_callback_ctrl(ctx, cmd, fp); + end; +end; + +procedure Indy_SSL_copy_session_id(sslTo: PSSL; const sslFrom: PSSL) cdecl; +begin + // TODO: what to do here? +end; + +procedure Indy_CRYPTO_lock(mode, _type : TIdC_INT; const _file : PIdAnsiChar; line : TIdC_INT) cdecl; +begin + // TODO: what to do here? +end; +{$ENDIF} + +{$IFDEF STATICLOAD_OPENSSL} + +function Load: Boolean; +begin + bIsLoaded := True; + Result := True; +end; + +{$ELSE} + +function Load: Boolean; +var + LVersion, LMajor, LMinor: TIdC_ULONG; + LVersionStr: string; +begin + Result := False; + Assert(FFailedLoadList<>nil); + + if (hIdCrypto <> IdNilHandle) and (hIdSSL <> IdNilHandle) and (FFailedLoadList.Count = 0) then begin + Result := True; + Exit; + end; + + FFailedLoadList.Clear; + + if hIdCrypto = IdNilHandle then begin + hIdCrypto := LoadSSLCryptoLibrary; + if hIdCrypto = IdNilHandle then begin + Exit; + end; + end; + + if hIdSSL = IdNilHandle then begin + hIdSSL := LoadSSLLibrary; + if hIdSSL = IdNilHandle then begin + Exit; + end; + end; + + // RLebeau 6/8/2021: verify the type of library is supported... + + @_SSLeay_version := LoadOldCLib(fn_SSLeay_version, 'OpenSSL_version'); {Do not localize} //Used by Indy + @SSLeay := LoadOldCLib(fn_SSLeay, 'OpenSSL_version_num'); {Do not localize} //Used by Indy + + if Assigned(_SSLeay_version) then begin + LVersionStr := String(_SSLeay_version(SSLEAY_VERSION)); + end; + + if TextStartsWith(LVersionStr, 'LibreSSL') then {do not localize} + begin + { + According to the LibreSSL Portable GitHub repo: + https://github.com/libressl-portable/portable + + LibreSSL is API compatible with OpenSSL 1.0.1, but does not yet include all new APIs from OpenSSL 1.0.2 and later. + LibreSSL also includes APIs not yet present in OpenSSL. The current common API subset is OpenSSL 1.0.1. + + LibreSSL is not ABI compatible with any release of OpenSSL, or necessarily earlier releases of LibreSSL. + You will need to relink your programs to LibreSSL in order to use it, just as in moving between major versions + of OpenSSL. LibreSSL's installed library version numbers are incremented to account for ABI and API changes. + } + // TODO: add version checking? + end + else if TextStartsWith(LVersionStr, 'OpenSSL') or (LVersionStr = '') then {do not localize} + begin + // RLebeau 2/2/2021: verify the version is OpenSSL 1.0.2 or earlier, as OpenSSL 1.1.0 made MAJOR changes that we do not support yet... + if Assigned(SSLeay) then + begin + LVersion := SSLeay; + LMajor := (LVersion and $F0000000) shr 28; + LMinor := (LVersion and $0FF00000) shr 20; + if (LMajor = 0) and (LMinor = 0) then begin // < 0.9.3 + LMajor := (LVersion and $F000) shr 12; + LMinor := (LVersion and $0F00) shr 8; + end; + if (LMajor > 1) or ((LMajor = 1) and (LMinor > 0)) then // OpenSSL 1.1.0 or higher + begin + FFailedLoadList.Add(IndyFormat(RSOSSUnsupportedVersion, [LVersion])); + Exit; + end; + end; + end else + begin + FFailedLoadList.Add(IndyFormat(RSOSSUnsupportedLibrary, [LVersionStr])); + Exit; + end; + + // TODO: stop loading non-critical functions here. We should use per-function + // stubs instead, similar to the approach used in IdWinsock2.pas, so functions + // are not loaded until they are actually used for the first time... + + @SSL_CTX_set_cipher_list := LoadFunction(fn_SSL_CTX_set_cipher_list); //Used by Indy + @SSL_CTX_new := LoadFunction(fn_SSL_CTX_new); //Used by Indy + @SSL_CTX_free := LoadFunction(fn_SSL_CTX_free); //Used by Indy + @SSL_set_fd := LoadFunction(fn_SSL_set_fd); //Used by Indy + @SSL_CTX_use_PrivateKey_file := LoadFunction(fn_SSL_CTX_use_PrivateKey_file); //Used by Indy + @SSL_CTX_use_PrivateKey := LoadFunction(fn_SSL_CTX_use_PrivateKey); //Used by Indy + @SSL_CTX_use_certificate := LoadFunction(fn_SSL_CTX_use_certificate); //Used by Indy + @SSL_CTX_use_certificate_file := LoadFunction(fn_SSL_CTX_use_certificate_file); //Used by Indy + @SSL_CTX_use_certificate_chain_file := LoadFunction(fn_SSL_CTX_use_certificate_chain_file,False); //Used by Indy + @SSL_load_error_strings := LoadFunction(fn_SSL_load_error_strings); //Used by Indy + @SSL_state_string_long := LoadFunction(fn_SSL_state_string_long); //Used by Indy + @SSL_alert_desc_string_long := LoadFunction(fn_SSL_alert_desc_string_long); //Used by Indy + @SSL_alert_type_string_long := LoadFunction(fn_SSL_alert_type_string_long); //Used by Indy + + @SSL_get_peer_certificate := LoadFunction(fn_SSL_get_peer_certificate); //Used by Indy + @SSL_CTX_set_verify := LoadFunction(fn_SSL_CTX_set_verify); //Used by Indy + @SSL_CTX_set_verify_depth := LoadFunction(fn_SSL_CTX_set_verify_depth); //Used by Indy + @SSL_CTX_get_verify_depth := LoadFunction(fn_SSL_CTX_get_verify_depth); + @SSL_CTX_set_default_passwd_cb := LoadFunction(fn_SSL_CTX_set_default_passwd_cb); //Used by Indy + @SSL_CTX_set_default_passwd_cb_userdata:= LoadFunction(fn_SSL_CTX_set_default_passwd_cb_userdata); //Used by Indy + @SSL_CTX_check_private_key := LoadFunction(fn_SSL_CTX_check_private_key); //Used by Indy + @SSL_new := LoadFunction(fn_SSL_new); //Used by Indy + @SSL_free := LoadFunction(fn_SSL_free); //Used by Indy + @SSL_accept := LoadFunction(fn_SSL_accept); //Used by Indy + @SSL_connect := LoadFunction(fn_SSL_connect); //Used by Indy + @SSL_read := LoadFunction(fn_SSL_read); //Used by Indy + @SSL_peek := LoadFunction(fn_SSL_peek,False); + @SSL_pending := LoadFunction(fn_SSL_pending,False); + @SSL_write := LoadFunction(fn_SSL_write); //Used by Indy + @SSL_ctrl := LoadFunction(fn_SSL_ctrl); + @SSL_callback_ctrl := LoadFunction(fn_SSL_callback_ctrl{$IFDEF ANDROID}, False{$ENDIF}); + {$IFDEF ANDROID} + if not Assigned(SSL_callback_ctrl) then begin + @SSL_callback_ctrl := @Indy_SSL_callback_ctrl; + end; + {$ENDIF} + @SSL_CTX_ctrl := LoadFunction(fn_SSL_CTX_ctrl); + @SSL_CTX_callback_ctrl := LoadFunction(fn_SSL_CTX_callback_ctrl{$IFDEF ANDROID}, False{$ENDIF}); + {$IFDEF ANDROID} + if not Assigned(SSL_CTX_callback_ctrl) then begin + @SSL_CTX_callback_ctrl := @Indy_SSL_CTX_callback_ctrl; + end; + {$ENDIF} + @SSL_get_error := LoadFunction(fn_SSL_get_error); //Used by Indy + + // RLebeau 9/7/2015 - making all of the "..._method()" functions optional. If + // a user wants to disable a given SSL/TLS version at runtime, there is no need + // for it to be marked as "critical" at load time, in case it is not available + // in their version of OpenSSL. For instance, some vendors disable SSLv2 so + // it is not even exported. If a user wants to use a given version and it is + // not available in their version of OpenSSL, TIdSSLContext.SetSSLMethod() will + // now raise a runtime error... + @SSLv2_method := LoadFunction(fn_SSLv2_method,False); //Used by Indy + @SSLv2_server_method := LoadFunction(fn_SSLv2_server_method,False); //Used by Indy + @SSLv2_client_method := LoadFunction(fn_SSLv2_client_method,False); //Used by Indy + @SSLv3_method := LoadFunction(fn_SSLv3_method,False); //Used by Indy + @SSLv3_server_method := LoadFunction(fn_SSLv3_server_method,False); //Used by Indy + @SSLv3_client_method := LoadFunction(fn_SSLv3_client_method,False); //Used by Indy + @SSLv23_method := LoadFunction(fn_SSLv23_method,False); //Used by Indy + @SSLv23_server_method := LoadFunction(fn_SSLv23_server_method,False); //Used by Indy + @SSLv23_client_method := LoadFunction(fn_SSLv23_client_method,False); //Used by Indy + @TLSv1_method := LoadFunction(fn_TLSv1_method,False); //Used by Indy + @TLSv1_server_method := LoadFunction(fn_TLSv1_server_method,False); //Used by Indy + @TLSv1_client_method := LoadFunction(fn_TLSv1_client_method,False); //Used by Indy + @TLSv1_1_method := LoadFunction(fn_TLSv1_1_method,False); //Used by Indy + @TLSv1_1_server_method := LoadFunction(fn_TLSv1_1_server_method,False); //Used by Indy + @TLSv1_1_client_method := LoadFunction(fn_TLSv1_1_client_method,False); //Used by Indy + @TLSv1_2_method := LoadFunction(fn_TLSv1_2_method,False); //Used by Indy + @TLSv1_2_server_method := LoadFunction(fn_TLSv1_2_server_method,False); //Used by Indy + @TLSv1_2_client_method := LoadFunction(fn_TLSv1_2_client_method,False); //Used by Indy + @DTLSv1_method := LoadFunction(fn_DTLSv1_method, False); + @DTLSv1_server_method := LoadFunction(fn_DTLSv1_server_method, False); + @DTLSv1_client_method := LoadFunction(fn_DTLSv1_client_method, False); + // + + @SSL_shutdown := LoadFunction(fn_SSL_shutdown); //Used by Indy + @SSL_set_connect_state := LoadFunction(fn_SSL_set_connect_state,False); + @SSL_set_accept_state := LoadFunction(fn_SSL_set_accept_state,False); + @SSL_set_shutdown := LoadFunction(fn_SSL_set_shutdown); //Used by Indy + @SSL_CTX_load_verify_locations := LoadFunction(fn_SSL_CTX_load_verify_locations); //Used by Indy + @SSL_get_session := LoadFunction(fn_SSL_get_session); //Used by Indy + @SSLeay_add_ssl_algorithms := LoadFunction(fn_SSLeay_add_ssl_algorithms); //Used by Indy + @SSL_SESSION_get_id := LoadFunction(fn_SSL_SESSION_get_id); //Used by Indy + @SSL_copy_session_id := LoadFunction(fn_SSL_copy_session_id{$IFDEF ANDROID}, False{$ENDIF}); //Used by Indy + {$IFDEF ANDROID} + if not Assigned(SSL_copy_session_id) then begin + @SSL_copy_session_id := @Indy_SSL_copy_session_id; + end; + {$ENDIF} + // CRYPTO LIB + @d2i_X509_NAME := LoadFunctionCLib(fn_d2i_X509_NAME); + @i2d_X509_NAME := LoadFunctionCLib(fn_i2d_X509_NAME); + @X509_NAME_oneline := LoadFunctionCLib(fn_X509_NAME_oneline);//Used by Indy + @X509_NAME_cmp := LoadFunctionCLib(fn_X509_NAME_cmp); //Used by Indy + @X509_NAME_hash := LoadFunctionCLib(fn_X509_NAME_hash); //Used by Indy + @X509_set_issuer_name := LoadFunctionCLib(fn_X509_set_issuer_name,False); + @X509_get_issuer_name := LoadFunctionCLib(fn_X509_get_issuer_name); //Used by Indy + @X509_set_subject_name := LoadFunctionCLib(fn_X509_set_subject_name,False); + @X509_get_subject_name := LoadFunctionCLib(fn_X509_get_subject_name); //Used by Indy + @X509_digest := LoadFunctionCLib(fn_X509_digest);//Used by Indy + @X509_LOOKUP_ctrl := LoadFunctionCLib( fn_X509_LOOKUP_ctrl, False ); + @X509_STORE_add_cert := LoadFunctionCLib(fn_X509_STORE_add_cert); //Used by Indy + @X509_STORE_add_crl := LoadFunctionCLib(fn_X509_STORE_add_crl); //Used by Indy + @X509_STORE_CTX_get_ex_data := LoadFunctionCLib(fn_X509_STORE_CTX_get_ex_data,False); + @X509_STORE_CTX_get_error := LoadFunctionCLib(fn_X509_STORE_CTX_get_error); //Used by Indy + @X509_STORE_CTX_set_error := LoadFunctionCLib(fn_X509_STORE_CTX_set_error,False); + @X509_STORE_CTX_get_error_depth := LoadFunctionCLib(fn_X509_STORE_CTX_get_error_depth); //Used by Indy + @X509_STORE_CTX_get_current_cert := LoadFunctionCLib(fn_X509_STORE_CTX_get_current_cert); //Used by Indy + @X509_STORE_add_lookup := LoadFunctionCLib(fn_X509_STORE_add_lookup); //Used by Indy + @X509_STORE_load_locations := LoadFunctionCLib(fn_X509_STORE_load_locations); //Used by Indy + @X509_sign := LoadFunctionCLib(fn_X509_sign,False); + @X509_REQ_sign := LoadFunctionCLib(fn_X509_REQ_sign,False); + @X509_REQ_add_extensions := LoadFunctionCLib(fn_X509_REQ_add_extensions,False); + @X509V3_EXT_conf_nid := LoadFunctionCLib(fn_X509V3_EXT_conf_nid,False); + @X509_EXTENSION_create_by_NID := LoadFunctionCLib(fn_X509_EXTENSION_create_by_NID,False); + @X509V3_set_ctx := LoadFunctionCLib(fn_X509V3_set_ctx); + @X509_EXTENSION_free := LoadFunctionCLib(fn_X509_EXTENSION_free,False); + @X509_add_ext := LoadFunctionCLib(fn_X509_add_ext,False); + {$IFNDEF OPENSSL_NO_BIO} + //X509_print + @X509_print := LoadFunctionCLib(fn_X509_print, False ); //Used by Indy + {$ENDIF} + @_RAND_cleanup := LoadFunctionCLib(fn_RAND_cleanup, False); //Used by Indy + @_RAND_bytes := LoadFunctionCLib(fn_RAND_bytes); //Used by Indy + @_RAND_pseudo_bytes := LoadFunctionCLib(fn_RAND_pseudo_bytes); //Used by Indy + @_RAND_seed := LoadFunctionCLib(fn_RAND_seed); //Used by Indy + @_RAND_add := LoadFunctionCLib(fn_RAND_add); //Used by Indy + @_RAND_status := LoadFunctionCLib(fn_RAND_status); //Used by Indy + {$IFDEF SYS_WIN} + @_RAND_screen := LoadFunctionCLib(fn_RAND_screen); //Used by Indy + @_RAND_event := LoadFunctionCLib(fn_RAND_event); //Used by Indy + {$ENDIF} + {$IFNDEF OPENSSL_NO_DES} + // 3DES + @DES_set_odd_parity := LoadFunctionCLib(fn_DES_set_odd_parity); //Used by Indy + @DES_set_key := LoadFunctionCLib(fn_DES_set_key); //Used by Indy + @DES_ecb_encrypt := LoadFunctionCLib(fn_DES_ecb_encrypt); //Used by Indy + @Id_ossl_old_des_set_odd_parity := LoadOldCLib(fnold_des_set_odd_parity,fn__ossl_old_des_set_odd_parity,False); + @Id_ossl_old_des_set_key := LoadOldCLib(fnold_des_set_key,fn__ossl_old_des_set_key,False); + @Id_ossl_old_des_ecb_encrypt := LoadOldCLib(fnold_des_ecb_encrypt,fn__ossl_old_des_ecb_encrypt,False); + {$ENDIF} + // More SSL functions + @SSL_set_ex_data := LoadFunction(fn_SSL_set_ex_data,False); + @SSL_get_ex_data := LoadFunction(fn_SSL_get_ex_data,False); + @SSL_load_client_CA_file := LoadFunction(fn_SSL_load_client_CA_file); //Used by Indy + @SSL_CTX_set_client_CA_list := LoadFunction(fn_SSL_CTX_set_client_CA_list); //Used by Indy + @SSL_CTX_set_default_verify_paths := LoadFunction(fn_SSL_CTX_set_default_verify_paths); //Used by Indy + @SSL_CTX_set_session_id_context := LoadFunction(fn_SSL_CTX_set_session_id_context); //Used by Indy + @SSL_CIPHER_description := LoadFunction(fn_SSL_CIPHER_description); //Used by Indy + @SSL_get_current_cipher := LoadFunction(fn_SSL_get_current_cipher); //Used by Indy + @SSL_CIPHER_get_name := LoadFunction(fn_SSL_CIPHER_get_name); //Used by Indy + @SSL_CIPHER_get_version := LoadFunction(fn_SSL_CIPHER_get_version); //Used by Indy + @SSL_CIPHER_get_bits := LoadFunction(fn_SSL_CIPHER_get_bits); //Used by Indy + // Thread safe + @_CRYPTO_lock := LoadFunctionCLib(fn_CRYPTO_lock{$IFDEF ANDROID}, False{$ENDIF}); //Used by Indy + {$IFDEF ANDROID} + if not Assigned(_CRYPTO_lock) then begin + @_CRYPTO_lock := @Indy_CRYPTO_lock; + end; + {$ENDIF} + @_CRYPTO_num_locks := LoadFunctionCLib(fn_CRYPTO_num_locks); //Used by Indy + @CRYPTO_set_locking_callback := LoadFunctionCLib(fn_CRYPTO_set_locking_callback); //Used by Indy + {$IFNDEF WIN32_OR_WIN64} +{ +In OpenSSL 1.0.0, you should use these callback functions instead of the +depreciated set_id_callback. They are not in the older 0.9.8 OpenSSL series so +we have to handle both cases. +} + @CRYPTO_THREADID_set_callback := LoadFunctionCLib(fn_CRYPTO_THREADID_set_callback,False); //Used by Indy + @CRYPTO_THREADID_set_numeric := LoadFunctionClib(fn_CRYPTO_THREADID_set_numeric,False); //Used by Indy + @CRYPTO_THREADID_set_pointer := LoadFunctionClib(fn_CRYPTO_THREADID_set_pointer,False); + if not Assigned(CRYPTO_THREADID_set_callback) then begin //Used by Indy + @CRYPTO_set_id_callback := LoadFunctionCLib(fn_CRYPTO_set_id_callback); //Used by Indy + end else begin + @CRYPTO_set_id_callback := nil; + end; + {$ENDIF} + @ERR_put_error := LoadFunctionCLib(fn_ERR_put_error,False); + @ERR_get_error := LoadFunctionCLib(fn_ERR_get_error,False); + @ERR_peek_error := LoadFunctionCLib(fn_ERR_peek_error,False); + @ERR_peek_last_error := LoadFunctionCLib(fn_ERR_peek_last_error); //Used by Indy + @ERR_clear_error := LoadFunctionCLib(fn_ERR_clear_error); //Used by Indy + @ERR_error_string := LoadFunctionCLib(fn_ERR_error_string, False); + @ERR_error_string_n := LoadFunctionCLib(fn_ERR_error_string_n, False); + @ERR_lib_error_string := LoadFunctionCLib( fn_ERR_lib_error_string, False ); + @ERR_func_error_string := LoadFunctionCLib( fn_ERR_func_error_string, False ); + @ERR_reason_error_string := LoadFunctionCLib( fn_ERR_reason_error_string, False ); + @ERR_load_ERR_strings := LoadFunctionCLib( fn_ERR_load_ERR_strings,False); + @ERR_load_crypto_strings := LoadFunctionCLib(fn_ERR_load_crypto_strings,False); + @ERR_free_strings := LoadFunctionCLib(fn_ERR_free_strings); //Used by Indy + @ERR_remove_thread_state := LoadFunctionCLib(fn_ERR_remove_thread_state,False); //Used by Indy + if not Assigned(ERR_remove_thread_state) then begin + @ERR_remove_state := LoadFunctionCLib(fn_ERR_remove_state); //Used by Indy + end else begin + @ERR_remove_state := nil; + end; + @CRYPTO_cleanup_all_ex_data := LoadFunctionCLib(fn_CRYPTO_cleanup_all_ex_data,False); //Used by Indy + @SSL_COMP_get_compression_methods := LoadFunction(fn_SSL_COMP_get_compression_methods,False); + @SSL_COMP_free_compression_methods := LoadFunction(fn_SSL_COMP_free_compression_methods,False); + @sk_pop_free := LoadFunctionCLib(fn_sk_pop_free,False); + //RSA + @RSA_free := LoadFunctionCLib(fn_RSA_free,False); + @RSA_generate_key_ex := LoadFunctionCLib(fn_RSA_generate_key_ex, False); + @RSA_generate_key := LoadFunctionCLib(fn_RSA_generate_key, False); + // @RSA_generate_key := LoadFunctionCLib(fn_RSA_generate_key, not Assigned(RSA_generate_key_ex)); + @RSA_check_key := LoadFunctionCLib(fn_RSA_check_key,False); + @RSA_new := LoadFunctionCLib(fn_RSA_new,False); + @RSA_size := LoadFunctionCLib(fn_RSA_size,False); + @RSA_private_decrypt := LoadFunctionCLib(fn_RSA_private_decrypt,False); + @RSA_public_encrypt := LoadFunctionCLib(fn_RSA_public_encrypt,False); + //DH + @DH_free := LoadFunctionCLib(fn_DH_free); //Used by Indy + //BN + @BN_new := LoadFunctionCLib(fn_BN_new,False); + @BN_free := LoadFunctionCLib(fn_BN_free,False); + @BN_hex2bn := LoadFunctionCLib(fn_BN_hex2bn,False); + @BN_bn2dec := LoadFunctionCLib(fn_BN_bn2dec,False); + @BN_bn2hex := LoadFunctionCLib(fn_BN_bn2hex,False); + @BN_set_word := LoadFunctionCLib(fn_BN_set_word,False); + //BIO + @BIO_set_flags := LoadFunctionCLib(fn_BIO_set_flags,False); + @BIO_new := LoadFunctionCLib(fn_BIO_new); //Used by Indy + @BIO_push := LoadFunctionCLib(fn_BIO_push,False); + @BIO_pop := LoadFunctionCLib(fn_BIO_pop,False); + @BIO_set_next := LoadFunctionCLib(fn_BIO_set_next,False); + @BIO_free := LoadFunctionCLib(fn_BIO_free); //Used by Indy + @BIO_free_all := LoadFunctionCLib(fn_BIO_free_all,False); + @BIO_new_mem_buf := LoadFunctionCLib(fn_BIO_new_mem_buf); //Used by Indy + @BIO_s_mem := LoadFunctionCLib(fn_BIO_s_mem); //Used by Indy + @BIO_s_file := LoadFunctionCLib(fn_BIO_s_file,False); + @BIO_set_ex_data := LoadFunctionCLib(fn_BIO_set_ex_data,False); + @BIO_get_ex_data := LoadFunctionCLib(fn_BIO_get_ex_data,False); + @BIO_ctrl := LoadFunctionCLib(fn_BIO_ctrl); + @BIO_int_ctrl := LoadFunctionCLib( fn_BIO_int_ctrl,False); + @BIO_ptr_ctrl := LoadFunctionCLib( fn_BIO_ptr_ctrl,False); + @BIO_new_file := LoadFunctionCLib(fn_BIO_new_file); + @BIO_puts := LoadFunctionCLib(fn_BIO_puts,False); + @BIO_read := LoadFunctionCLib(fn_BIO_read,False); + @BIO_write := LoadFunctionCLib(fn_BIO_write,False); + //i2d + @i2d_X509_bio := LoadFunctionCLib(fn_i2d_X509_bio,False); + @i2d_PrivateKey_bio := LoadFunctionCLib(fn_i2d_PrivateKey_bio,False); + @d2i_X509_bio := LoadFunctionCLib(fn_d2i_X509_bio); //Used by Indy + @d2i_PKCS12_bio := LoadFunctionCLib(fn_d2i_PKCS12_bio); //Used by Indy + @PKCS12_parse := LoadFunctionCLib(fn_PKCS12_parse); //Used by Indy + @i2d_X509_REQ_bio := LoadFunctionCLib(fn_i2d_X509_REQ_bio,False); + @i2d_PKCS7 := LoadFunctionCLib(fn_i2d_PKCS7,False); + @d2i_PKCS7 := LoadFunctionCLib(fn_d2i_PKCS7,False); + @i2d_X509 := LoadFunctionCLib(fn_i2d_X509,False); + @d2i_X509 := LoadFunctionCLib(fn_d2i_X509); //Used by Indy + @i2d_X509_REQ := LoadFunctionCLib(fn_i2d_X509_REQ, False); + @d2i_X509_REQ := LoadFunctionCLib(fn_d2i_X509_REQ, False ); + @i2d_X509_CRL := LoadFunctionCLib(fn_i2d_X509_CRL, False ); + @d2i_X509_CRL := LoadFunctionCLib(fn_d2i_X509_CRL,False ); + @i2d_RSAPrivateKey := LoadFunctionCLib(fn_i2d_RSAPrivateKey,False ); + @d2i_RSAPrivateKey := LoadFunctionCLib(fn_d2i_RSAPrivateKey, False ); + @i2d_RSAPublicKey := LoadFunctionCLib(fn_i2d_RSAPublicKey,False); + @d2i_RSAPublicKey := LoadFunctionCLib(fn_d2i_RSAPublicKey,False); + @i2d_PrivateKey := LoadFunctionCLib(fn_i2d_PrivateKey,False); + @d2i_PrivateKey := LoadFunctionCLib(fn_d2i_PrivateKey); //Used by Indy + @d2i_PrivateKey_bio := LoadFunctionCLib(fn_d2i_PrivateKey_bio); //Used by Indy + + @i2d_DSAPrivateKey := LoadFunctionCLib(fn_i2d_DSAPrivateKey); //Used by Indy + @d2i_DSAPrivateKey := LoadFunctionCLib(fn_d2i_DSAPrivateKey); //Used by Indy + @i2d_DSAparams := LoadFunctionCLib(fn_i2d_DSAparams,False); + @d2i_DSAparams := LoadFunctionCLib(fn_d2i_DSAparams,False); + @i2d_DHparams := LoadFunctionCLib(fn_i2d_DHparams,False); + @d2i_DHparams := LoadFunctionCLib(fn_d2i_DHparams); //Used by Indy + @i2d_NETSCAPE_CERT_SEQUENCE := LoadFunctionCLib(fn_i2d_NETSCAPE_CERT_SEQUENCE,False); + @d2i_NETSCAPE_CERT_SEQUENCE := LoadFunctionCLib(fn_d2i_NETSCAPE_CERT_SEQUENCE); //Indy by Indy + @i2d_PUBKEY := LoadFunctionCLib(fn_i2d_PUBKEY,False); + @d2i_PUBKEY := LoadFunctionCLib(fn_d2i_PUBKEY,False); + + //X509 + @X509_get_default_cert_file := LoadFunctionCLib(fn_X509_get_default_cert_file); //Used by Indy + @X509_get_default_cert_file_env := LoadFunctionCLib(fn_X509_get_default_cert_file_env); //Used by Indy + @X509_new := LoadFunctionCLib(fn_X509_new,False); + @X509_free := LoadFunctionCLib(fn_X509_free); //Used by Indy + @X509_REQ_new := LoadFunctionCLib(fn_X509_REQ_new,False); + @X509_REQ_free := LoadFunctionCLib(fn_X509_REQ_free,False); + @X509_to_X509_REQ := LoadFunctionCLib(fn_X509_to_X509_REQ,False); + @X509_NAME_new := LoadFunctionCLib(fn_X509_NAME_new); //Used by Indy + @X509_NAME_free := LoadFunctionCLib(fn_X509_NAME_free); //Used by Indy + @X509_NAME_add_entry_by_txt := LoadFunctionCLib(fn_X509_NAME_add_entry_by_txt); + @X509_INFO_free := LoadFunctionCLib(fn_X509_INFO_free); //Used by Indy + @X509_set_version := LoadFunctionCLib(fn_X509_set_version,False); + @X509_get_serialNumber := LoadFunctionCLib(fn_X509_get_serialNumber); //USED by Indy + @X509_gmtime_adj := LoadFunctionCLib(fn_X509_gmtime_adj,False); + @X509_set_notBefore := LoadFunctionCLib(fn_X509_set_notBefore,False); + @X509_set_notAfter := LoadFunctionCLib(fn_X509_set_notAfter,False); + @X509_set_pubkey := LoadFunctionCLib(fn_X509_set_pubkey,False); + @X509_REQ_set_pubkey := LoadFunctionCLib(fn_X509_REQ_set_pubkey,False); + @X509_PUBKEY_get := LoadFunctionCLib(fn_X509_PUBKEY_get,False); + @X509_verify := LoadFunctionCLib(fn_X509_verify,False); + //PEM + {$IFNDEF SSLEAY_MACROS} + @_PEM_read_bio_X509 := LoadFunctionCLib(fn_PEM_read_bio_X509, False); + @_PEM_read_bio_X509_REQ := LoadFunctionCLib(fn_PEM_read_bio_X509_REQ, False); + @_PEM_read_bio_X509_CRL := LoadFunctionCLib(fn_PEM_read_bio_X509_CRL, False); + @_PEM_read_bio_RSAPrivateKey := LoadFunctionCLib(fn_PEM_read_bio_RSAPrivateKey, False); + @_PEM_read_bio_RSAPublicKey := LoadFunctionCLib(fn_PEM_read_bio_RSAPublicKey, False); + @_PEM_read_bio_DSAPrivateKey := LoadFunctionCLib(fn_PEM_read_bio_DSAPrivateKey, False); + @_PEM_read_bio_PrivateKey := LoadFunctionCLib (fn_PEM_read_bio_PrivateKey,False); + @_PEM_read_bio_PKCS7 := LoadFunctionCLib (fn_PEM_read_bio_PKCS7, False); + @_PEM_read_bio_DHparams := LoadFunctionCLib(fn_PEM_read_bio_DHparams, False); + @_PEM_read_bio_DSAparams := LoadFunctionCLib(fn_PEM_read_bio_DSAparams, False); + @_PEM_read_bio_NETSCAPE_CERT_SEQUENCE := LoadFunctionCLib(fn_PEM_read_bio_NETSCAPE_CERT_SEQUENCE,False); + @_PEM_read_bio_PUBKEY := LoadFunctionCLib(fn_PEM_read_bio_PUBKEY,False); + @_PEM_write_bio_X509 := LoadFunctionCLib(fn_PEM_write_bio_X509,False); + @_PEM_write_bio_X509_REQ := LoadFunctionCLib(fn_PEM_write_bio_X509_REQ,False); + @_PEM_write_bio_X509_CRL := LoadFunctionCLib( fn_PEM_write_bio_X509_CRL,False); + @_PEM_write_bio_RSAPrivateKey := LoadFunctionCLib(fn_PEM_write_bio_RSAPrivateKey,False); + @_PEM_write_bio_RSAPublicKey := LoadFunctionCLib( fn_PEM_write_bio_RSAPublicKey,False); + @_PEM_write_bio_DSAPrivateKey := LoadFunctionCLib( fn_PEM_write_bio_DSAPrivateKey,False); + @_PEM_write_bio_PrivateKey := LoadFunctionCLib( fn_PEM_write_bio_PrivateKey,False); + @_PEM_write_bio_PKCS7 := LoadFunctionCLib( fn_PEM_write_bio_PKCS7,False); + @_PEM_write_bio_DHparams := LoadFunctionCLib(fn_PEM_write_bio_DHparams,False); + @_PEM_write_bio_DSAparams := LoadFunctionCLib(fn_PEM_write_bio_DSAparams,False); + @_PEM_write_bio_NETSCAPE_CERT_SEQUENCE := LoadFunctionCLib(fn_PEM_write_bio_NETSCAPE_CERT_SEQUENCE,False); + @_PEM_write_bio_PKCS8PrivateKey := LoadFunctionCLib(fn_PEM_write_bio_PKCS8PrivateKey,False); + @_PEM_write_bio_PUBKEY := LoadFunctionCLib(fn_PEM_write_bio_PUBKEY,False); + {$ELSE} + @PEM_ASN1_write_bio := LoadFunctionCLib(fn_PEM_ASN1_write_bio,False); + @PEM_ASN1_read_bio := LoadFunctionCLib(fn_PEM_ASN1_read_bio,False); + {$ENDIF} + @PEM_X509_INFO_read_bio := LoadFunctionCLib(fn_PEM_X509_INFO_read_bio); //Used by Indy + @PEM_read_bio_X509_AUX := LoadFunctionCLib(fn_PEM_read_bio_X509_AUX); //Used by Indy + //EVP + {$IFNDEF OPENSSL_NO_DES} + @EVP_des_ede3_cbc := LoadFunctionCLib(fn_EVP_des_ede3_cbc,False); + {$ENDIF} + {$IFNDEF OPENSSL_NO_SHA512} + @EVP_sha512 := LoadFunctionCLib(fn_EVP_sha512,False); //Used by Indy but non-critical + @EVP_sha384 := LoadFunctionCLib(fn_EVP_sha384,False); //Used by Indy but non-critical + {$ENDIF} + {$IFNDEF OPENSSL_NO_SHA256} + @EVP_sha256 := LoadFunctionCLib(fn_EVP_sha256,False); //Used by Indy but non-critical + @EVP_sha224 := LoadFunctionCLib(fn_EVP_sha224,False); //Used by Indy but non-critical + {$ENDIF} + {$IFNDEF OPENSSL_NO_SHA} + @EVP_sha1 := LoadFunctionCLib(fn_EVP_sha1); //USED by Indy + + @EVP_sha := LoadFunctionCLib(fn_EVP_sha,False); //not available on Android + @EVP_dss := LoadFunctionCLib(fn_EVP_dss,False); + @EVP_dss1 := LoadFunctionCLib(fn_EVP_dss1,False); + @EVP_ecdsa := LoadFunctionCLib(fn_EVP_ecdsa,False); + {$ENDIF} + {$ifndef OPENSSL_NO_MDC2} + @EVP_mdc2 := LoadFunctionCLib(fn_EVP_mdc2,False); + {$endif} + {$IFNDEF OPENSSL_NO_MD5} + @EVP_md5 := LoadFunctionCLib(fn_EVP_md5); //USED By Indy + {$ENDIF} + {$IFNDEF OPENSSL_NO_MD4} + @EVP_md4 := LoadFunctionCLib(fn_EVP_md4,False); + {$ENDIF} + {$IFNDEF OPENSSL_NO_MD2} + @EVP_md2 := LoadFunctionCLib(fn_EVP_md2,False); + {$ENDIF} + {$ifndef OPENSSL_NO_RIPEMD} + @EVP_ripemd160 := LoadFunctionCLib(fn_EVP_ripemd160,False); + {$endif} + {$ifndef OPENSSL_NO_WHIRLPOOL} + @EVP_whirlpool := LoadFunctionCLib(fn_EVP_whirlpool,False); //not available on Android + {$endif} + @EVP_md_null := LoadFunctionCLib(fn_EVP_md_null, False); + {$IFNDEF OPENSSL_NO_DES} + @EVP_des_ecb := LoadFunctionCLib(fn_EVP_des_ecb,False); + @EVP_des_ede := LoadFunctionCLib(fn_EVP_des_ede,False); + @EVP_des_ede3 := LoadFunctionCLib(fn_EVP_des_ede3,False); + @EVP_des_ede_ecb := LoadFunctionCLib(fn_EVP_des_ede_ecb,False); + @EVP_des_ede3_ecb := LoadFunctionCLib(fn_EVP_des_ede3_ecb,False); + @EVP_des_cfb64 := LoadFunctionCLib(fn_EVP_des_cfb64,False); +// # define EVP_des_cfb EVP_des_cfb64 + + @EVP_des_cfb1 := LoadFunctionCLib(fn_EVP_des_cfb1,False); + @EVP_des_cfb8 := LoadFunctionCLib(fn_EVP_des_cfb8,False); + @EVP_des_ede_cfb64 := LoadFunctionCLib(fn_EVP_des_ede_cfb64,False); +//#if 0 + // @EVP_des_ede_cfb1 := LoadFunctionCLib(fn_EVP_des_ede_cfb1,False); + // @EVP_des_ede_cfb8 := LoadFunctionCLib(fn_EVP_des_ede_cfb8,False); + //#endif + @EVP_des_ede3_cfb64 := LoadFunctionCLib(fn_EVP_des_ede3_cfb64,False); + @EVP_des_ede3_cfb1 := LoadFunctionCLib(fn_EVP_des_ede3_cfb1,False); + @EVP_des_ede3_cfb8 := LoadFunctionCLib(fn_EVP_des_ede3_cfb8,False); + @EVP_des_ofb := LoadFunctionCLib(fn_EVP_des_ofb,False); + @EVP_des_ede_ofb := LoadFunctionCLib(fn_EVP_des_ede_ofb,False); + @EVP_des_ede3_ofb := LoadFunctionCLib(fn_EVP_des_ede3_ofb,False); + @EVP_des_cbc := LoadFunctionCLib(fn_EVP_des_cbc,False); + @EVP_des_ede_cbc := LoadFunctionCLib(fn_EVP_des_ede_cbc,False); + @EVP_desx_cbc := LoadFunctionCLib(fn_EVP_desx_cbc,False); +//* This should now be supported through the dev_crypto ENGINE. But also, why are +// * rc4 and md5 declarations made here inside a "NO_DES" precompiler branch? */ +//#if 0 + {$ifdef OPENSSL_OPENBSD_DEV_CRYPTO} + @EVP_dev_crypto_des_ede3_cbc := LoadFunctionCLib(fn_EVP_dev_crypto_des_ede3_cbc,False); + @EVP_dev_crypto_rc4 := LoadFunctionCLib(fn_EVP_dev_crypto_rc4,False); + @EVP_dev_crypto_md5 := LoadFunctionCLib(fn_EVP_dev_crypto_md5,False); + {$endif} +//#endif + {$endif} + {$ifndef OPENSSL_NO_RC4} + @EVP_rc4 := LoadFunctionCLib(fn_EVP_rc4,False); + @EVP_rc4_40 := LoadFunctionCLib(fn_EVP_rc4_40,False); + {$ifndef OPENSSL_NO_MD5} + @EVP_rc4_hmac_md5 := LoadFunctionCLib(fn_EVP_rc4_hmac_md5,False); + {$endif} + {$endif} + {$ifndef OPENSSL_NO_IDEA} + //not available on Android + @EVP_idea_ecb := LoadFunctionCLib(fn_EVP_idea_ecb,False); + @EVP_idea_cfb64 := LoadFunctionCLib(fn_EVP_idea_cfb64,False); + @EVP_idea_ofb := LoadFunctionCLib(fn_EVP_idea_ofb,False); + @EVP_idea_cbc := LoadFunctionCLib(fn_EVP_idea_cbc,False); + {$endif} + {$ifndef OPENSSL_NO_RC2} + @EVP_rc2_ecb := LoadFunctionCLib(fn_EVP_rc2_ecb,False); + @EVP_rc2_cbc := LoadFunctionCLib(fn_EVP_rc2_cbc,False); + @EVP_rc2_40_cbc := LoadFunctionCLib(fn_EVP_rc2_40_cbc,False); + @EVP_rc2_64_cbc := LoadFunctionCLib(fn_EVP_rc2_64_cbc,False); + @EVP_rc2_cfb64 := LoadFunctionCLib(fn_EVP_rc2_cfb64,False); + @EVP_rc2_ofb := LoadFunctionCLib(fn_EVP_rc2_ofb, False); + {$endif} + {$ifndef OPENSSL_NO_BF} + @EVP_bf_ecb := LoadFunctionCLib(fn_EVP_bf_ecb,False); + @EVP_bf_cbc := LoadFunctionCLib(fn_EVP_bf_cbc,False); + @EVP_bf_cfb64 := LoadFunctionCLib(fn_EVP_bf_cfb64,False); + @EVP_bf_ofb := LoadFunctionCLib(fn_EVP_bf_ofb,False); + {$endif} + {$ifndef OPENSSL_NO_CAST} + //not available on Android + @EVP_cast5_ecb := LoadFunctionCLib(fn_EVP_cast5_ecb,False); + @EVP_cast5_cbc := LoadFunctionCLib(fn_EVP_cast5_cbc,False); + @EVP_cast5_cfb64 := LoadFunctionCLib(fn_EVP_cast5_cfb64,False); + @EVP_cast5_ofb := LoadFunctionCLib(fn_EVP_cast5_ofb,False); + {$endif} + {$ifndef OPENSSL_NO_RC5} + @EVP_rc5_32_12_16_cbc := LoadFunctionCLib(fn_EVP_rc5_32_12_16_cbc,False); + @EVP_rc5_32_12_16_ecb := LoadFunctionCLib(fn_EVP_rc5_32_12_16_ecb,False); + @EVP_rc5_32_12_16_cfb64 := LoadFunctionCLib(fn_EVP_rc5_32_12_16_cfb64,False); + @EVP_rc5_32_12_16_ofb := LoadFunctionCLib(fn_EVP_rc5_32_12_16_ofb,False); + {$endif} + {$ifndef OPENSSL_NO_AES} + @EVP_aes_128_ecb := LoadFunctionCLib(fn_EVP_aes_128_ecb,False); + @EVP_aes_128_cbc := LoadFunctionCLib(fn_EVP_aes_128_cbc,False); + @EVP_aes_128_cfb1:= LoadFunctionCLib(fn_EVP_aes_128_cfb1,False); + @EVP_aes_128_cfb8:= LoadFunctionCLib(fn_EVP_aes_128_cfb8,False); + @EVP_aes_128_cfb128 := LoadFunctionCLib(fn_EVP_aes_128_cfb128,False); + @EVP_aes_128_ofb := LoadFunctionCLib(fn_EVP_aes_128_ofb,False); + @EVP_aes_128_ctr := LoadFunctionCLib(fn_EVP_aes_128_ctr,False); + @EVP_aes_128_gcm := LoadFunctionCLib(fn_EVP_aes_128_gcm,False); + @EVP_aes_128_ccm := LoadFunctionCLib(fn_EVP_aes_128_ccm,False); + @EVP_aes_128_xts := LoadFunctionCLib(fn_EVP_aes_128_xts,False); + @EVP_aes_192_ecb := LoadFunctionCLib(fn_EVP_aes_192_ecb,False); + @EVP_aes_192_cbc := LoadFunctionCLib(fn_EVP_aes_192_cbc,False); + @EVP_aes_192_cfb1 := LoadFunctionCLib(fn_EVP_aes_192_cfb1,False); + @EVP_aes_192_cfb128 := LoadFunctionCLib(fn_EVP_aes_192_cfb128,False); + + @EVP_aes_192_ofb := LoadFunctionCLib(fn_EVP_aes_192_ofb,False); + @EVP_aes_192_ctr := LoadFunctionCLib(fn_EVP_aes_192_ctr,False); + @EVP_aes_192_gcm := LoadFunctionCLib(fn_EVP_aes_192_gcm,False); + @EVP_aes_192_ccm := LoadFunctionCLib(fn_EVP_aes_192_ccm,False); + @EVP_aes_256_ecb := LoadFunctionCLib(fn_EVP_aes_256_ecb,False); + @EVP_aes_256_cbc := LoadFunctionCLib(fn_EVP_aes_256_cbc,False); + @EVP_aes_256_cfb1 := LoadFunctionCLib(fn_EVP_aes_256_cfb1,False); + @EVP_aes_256_cfb8 := LoadFunctionCLib(fn_EVP_aes_256_cfb8,False); + @EVP_aes_256_cfb128 := LoadFunctionCLib(fn_EVP_aes_256_cfb128,False); + @EVP_aes_256_ofb := LoadFunctionCLib(fn_EVP_aes_256_ofb,False); + @EVP_aes_256_ctr := LoadFunctionCLib(fn_EVP_aes_256_ctr,False); + @EVP_aes_256_gcm := LoadFunctionCLib(fn_EVP_aes_256_gcm,False); + @EVP_aes_256_ccm := LoadFunctionCLib(fn_EVP_aes_256_ccm,False); + @EVP_aes_256_xts := LoadFunctionCLib(fn_EVP_aes_256_xts,False); + {$ifndef OPENSSL_NO_SHA} + {$ifndef OPENSSL_NO_SHA1} + @EVP_aes_128_cbc_hmac_sha1 := LoadFunctionCLib(fn_EVP_aes_128_cbc_hmac_sha1,False); + @EVP_aes_256_cbc_hmac_sha1 := LoadFunctionCLib(fn_EVP_aes_256_cbc_hmac_sha1,False); + {$endif} + {$endif} + {$endif} + {$ifndef OPENSSL_NO_CAMELLIA} + @EVP_camellia_128_ecb := LoadFunctionCLib(fn_EVP_camellia_128_ecb, False); + @EVP_camellia_128_cbc := LoadFunctionCLib(fn_EVP_camellia_128_cbc, False); + @EVP_camellia_128_cfb1 := LoadFunctionCLib(fn_EVP_camellia_128_cfb1, False); + @EVP_camellia_128_cfb8 := LoadFunctionCLib(fn_EVP_camellia_128_cfb8, False); + @EVP_camellia_128_cfb128 := LoadFunctionCLib(fn_EVP_camellia_128_cfb12, False); + @EVP_camellia_128_ofb := LoadFunctionCLib(fn_EVP_camellia_128_ofb, False); + @EVP_camellia_192_ecb := LoadFunctionCLib(fn_EVP_camellia_192_ecb, False); + + @EVP_camellia_192_cbc := LoadFunctionCLib(fn_EVP_camellia_192_cbc,False); + @EVP_camellia_192_cfb1 := LoadFunctionCLib(fn_EVP_camellia_192_cfb1,False); + @EVP_camellia_192_cfb8 := LoadFunctionCLib(fn_EVP_camellia_192_cfb8,False); + @EVP_camellia_192_cfb128 := LoadFunctionCLib(fn_EVP_camellia_192_cfb128,False); + @EVP_camellia_192_ofb := LoadFunctionCLib(fn_EVP_camellia_192_ofb,False); + @EVP_camellia_256_ecb := LoadFunctionCLib(fn_EVP_camellia_256_ecb,False); + @EVP_camellia_256_cbc := LoadFunctionCLib(fn_EVP_camellia_256_cbc,False); + @EVP_camellia_256_cfb1 := LoadFunctionCLib(fn_EVP_camellia_256_cfb1,False); + @EVP_camellia_256_cfb8 := LoadFunctionCLib(fn_EVP_camellia_256_cfb8,False); + @EVP_camellia_256_cfb128 := LoadFunctionCLib(fn_EVP_camellia_256_cfb128,False); + @EVP_camellia_256_ofb := LoadFunctionCLib(fn_EVP_camellia_256_ofb,False); + {$endif} + + {$ifndef OPENSSL_NO_SEED} + @EVP_seed_ecb := LoadFunctionCLib(fn_EVP_seed_ecb,False); + @EVP_seed_cbc := LoadFunctionCLib(fn_EVP_seed_cbc,False); + @EVP_seed_cfb128 := LoadFunctionCLib(fn_EVP_seed_cfb128,False); + @EVP_seed_ofb := LoadFunctionCLib(fn_EVP_seed_ofb,False); + {$endif} + + @EVP_MD_CTX_init := LoadFunctionCLib(fn_EVP_MD_CTX_init); + @EVP_MD_CTX_cleanup := LoadFunctionCLib(fn_EVP_MD_CTX_cleanup); + @EVP_MD_CTX_create := LoadFunctionCLib(fn_EVP_MD_CTX_create, False); + @EVP_MD_CTX_destroy := LoadFunctionCLib(fn_EVP_MD_CTX_destroy, False); + @EVP_MD_CTX_copy := LoadFunctionCLib(fn_EVP_MD_CTX_copy, False); + @EVP_MD_CTX_copy_ex := LoadFunctionCLib(fn_EVP_MD_CTX_copy_ex, False); + //@EVP_MD_CTX_set_flags := LoadFunctionCLib(fn_EVP_MD_CTX_set_flags, False); + //@EVP_MD_CTX_clear_flags := LoadFunctionCLib(fn_EVP_MD_CTX_clear_flags, False); + //@EVP_MD_CTX_test_flags := LoadFunctionCLib(fn_EVP_MD_CTX_test_flags, False); + + @EVP_DigestInit := LoadFunctionCLib(fn_EVP_DigestInit); + @EVP_DigestInit_ex := LoadFunctionCLib(fn_EVP_DigestInit_ex); + @EVP_DigestUpdate := LoadFunctionCLib(fn_EVP_DigestUpdate); + @EVP_DigestFinal_ex := LoadFunctionCLib(fn_EVP_DigestFinal_ex); + + @EVP_EncryptInit := LoadFunctionCLib(fn_EVP_EncryptInit,False); + @EVP_EncryptInit_ex := LoadFunctionCLib(fn_EVP_EncryptInit_ex,False); + @EVP_EncryptUpdate := LoadFunctionCLib(fn_EVP_EncryptUpdate); + @EVP_EncryptFinal_ex := LoadFunctionCLib(fn_EVP_EncryptFinal_ex,False); + @EVP_EncryptFinal := LoadFunctionCLib(fn_EVP_EncryptFinal,False); + + @EVP_DecryptInit := LoadFunctionCLib(fn_EVP_DecryptInit,False); + @EVP_DecryptInit_ex := LoadFunctionCLib(fn_EVP_DecryptInit_ex,False); + @EVP_DecryptUpdate := LoadFunctionCLib(fn_EVP_DecryptUpdate); + @EVP_DecryptFinal := LoadFunctionCLib(fn_EVP_DecryptFinal,False); + @EVP_DecryptFinal_ex := LoadFunctionCLib(fn_EVP_DecryptFinal_ex,False); + @EVP_CipherInit := LoadFunctionCLib(fn_EVP_CipherInit,False); + @EVP_CipherInit_ex := LoadFunctionCLib(fn_EVP_CipherInit_ex,False); + @EVP_CipherUpdate := LoadFunctionCLib(fn_EVP_CipherUpdate,False); + @EVP_CipherFinal := LoadFunctionCLib(fn_EVP_CipherFinal,False); + @EVP_CipherFinal_ex := LoadFunctionCLib(fn_EVP_CipherFinal_ex,False); + @EVP_SignFinal := LoadFunctionCLib(fn_EVP_SignFinal,False); + @EVP_VerifyFinal := LoadFunctionCLib(fn_EVP_VerifyFinal,False); + @EVP_DigestSignInit := LoadFunctionCLib(fn_EVP_DigestSignInit,False); + @EVP_DigestSignFinal := LoadFunctionCLib(fn_EVP_DigestSignFinal,False); + @EVP_DigestVerifyInit := LoadFunctionCLib(fn_EVP_DigestVerifyInit,False); + @EVP_DigestVerifyFinal := LoadFunctionCLib(fn_EVP_DigestVerifyFinal,False); + @EVP_OpenInit := LoadFunctionCLib(fn_EVP_OpenInit,False); + @EVP_OpenFinal := LoadFunctionCLib(fn_EVP_OpenFinal,False); + @EVP_SealInit := LoadFunctionCLib(fn_EVP_SealInit,False); + @EVP_SealFinal := LoadFunctionCLib(fn_EVP_SealFinal,False); + + @EVP_EncodeInit := LoadFunctionCLib(fn_EVP_EncodeInit,False); + @EVP_EncodeUpdate := LoadFunctionCLib(fn_EVP_EncodeUpdate,False); + @EVP_EncodeFinal := LoadFunctionCLib(fn_EVP_EncodeFinal,False); + @EVP_EncodeBlock := LoadFunctionCLib(fn_EVP_EncodeBlock,False); + @EVP_DecodeInit := LoadFunctionCLib(fn_EVP_DecodeInit,False); + @EVP_DecodeUpdate:= LoadFunctionCLib(fn_EVP_DecodeUpdate,False); + @EVP_DecodeFinal:= LoadFunctionCLib(fn_EVP_DecodeFinal,False); + @EVP_DecodeBlock:= LoadFunctionCLib(fn_EVP_DecodeBlock,False); + + @EVP_CIPHER_CTX_init:= LoadFunctionCLib(fn_EVP_CIPHER_CTX_init,False); + @EVP_CIPHER_CTX_cleanup:= LoadFunctionCLib(fn_EVP_CIPHER_CTX_cleanup,False); + @EVP_CIPHER_CTX_new:= LoadFunctionCLib(fn_EVP_CIPHER_CTX_new,False); + @EVP_CIPHER_CTX_free:= LoadFunctionCLib(fn_EVP_CIPHER_CTX_free,False); + @EVP_CIPHER_CTX_set_key_length:= LoadFunctionCLib(fn_EVP_CIPHER_CTX_set_key_length,False); + @EVP_CIPHER_CTX_set_padding:= LoadFunctionCLib(fn_EVP_CIPHER_CTX_set_padding,False); + @EVP_CIPHER_CTX_ctrl:= LoadFunctionCLib(fn_EVP_CIPHER_CTX_ctrl,False); + @EVP_CIPHER_CTX_rand_key:= LoadFunctionCLib(fn_EVP_CIPHER_CTX_rand_key,False); + +{$ifndef OPENSSL_NO_BIO} + @BIO_f_md := LoadFunctionCLib(fn_BIO_f_md,False); + @BIO_f_base64 := LoadFunctionCLib(fn_BIO_f_base64,False); + @BIO_f_cipher := LoadFunctionCLib(fn_BIO_f_cipher,False); + @BIO_f_reliable :=LoadFunctionCLib(fn_BIO_f_reliable,False); + @BIO_set_cipher :=LoadFunctionCLib(fn_BIO_set_cipher,False); +{$endif} + + @EVP_PKEY_new := LoadFunctionCLib(fn_EVP_PKEY_new); + @EVP_PKEY_free := LoadFunctionCLib(fn_EVP_PKEY_free); //USED in Indy + @EVP_PKEY_assign := LoadFunctionCLib(fn_EVP_PKEY_assign); + @EVP_get_cipherbyname := LoadFunctionCLib(fn_EVP_get_cipherbyname); + @EVP_get_digestbyname := LoadFunctionCLib(fn_EVP_get_digestbyname); + @EVP_MD_type := LoadFunctionCLib(fn_EVP_MD_type); + @EVP_MD_size := LoadFunctionCLib(fn_EVP_MD_size); + @EVP_MD_block_size := LoadFunctionCLib(fn_EVP_MD_block_size); + @EVP_MD_flags := LoadFunctionCLib(fn_EVP_MD_flags,False); + @EVP_MD_CTX_md := LoadFunctionCLib(fn_EVP_MD_CTX_md); + @EVP_CIPHER_nid := LoadFunctionCLib(fn_EVP_CIPHER_nid,False); + @EVP_CIPHER_block_size := LoadFunctionCLib(fn_EVP_CIPHER_block_size,False); + @EVP_CIPHER_key_length := LoadFunctionCLib(fn_EVP_CIPHER_key_length,False); + @EVP_CIPHER_iv_length := LoadFunctionCLib(fn_EVP_CIPHER_iv_length,False); + @EVP_CIPHER_flags := LoadFunctionCLib(fn_EVP_CIPHER_flags); + @EVP_CIPHER_type := LoadFunctionCLib(fn_EVP_CIPHER_type); + @EVP_CIPHER_CTX_cipher := LoadFunctionCLib(fn_EVP_CIPHER_CTX_cipher); + @EVP_CIPHER_CTX_nid := LoadFunctionCLib(fn_EVP_CIPHER_CTX_nid,False); + @EVP_CIPHER_CTX_block_size := LoadFunctionCLib(fn_EVP_CIPHER_CTX_block_size, False ); + @EVP_CIPHER_CTX_key_length := LoadFunctionCLib(fn_EVP_CIPHER_CTX_key_length, False ); + @EVP_CIPHER_CTX_iv_length := LoadFunctionCLib(fn_EVP_CIPHER_CTX_iv_length,False); + @EVP_CIPHER_CTX_copy := LoadFunctionCLib(fn_EVP_CIPHER_CTX_copy,False ); + @EVP_CIPHER_CTX_get_app_data := LoadFunctionCLib(fn_EVP_CIPHER_CTX_get_app_data ); + @EVP_CIPHER_CTX_set_app_data := LoadFunctionCLib(fn_EVP_CIPHER_CTX_set_app_data ); + @EVP_CIPHER_CTX_flags := LoadFunctionCLib(fn_EVP_CIPHER_CTX_flags); + + @EVP_add_cipher := LoadFunctionCLib(fn_EVP_add_cipher,False); + @EVP_add_digest := LoadFunctionCLib(fn_EVP_add_digest,False); + + @EVP_CIPHER_do_all := LoadFunctionCLib(fn_EVP_CIPHER_do_all,False); + @EVP_CIPHER_do_all_sorted := LoadFunctionCLib(fn_EVP_CIPHER_do_all_sorted,False); + @EVP_MD_do_all := LoadFunctionCLib(fn_EVP_MD_do_all,False); + @EVP_MD_do_all_sorted := LoadFunctionCLib(fn_EVP_MD_do_all_sorted,False); + @EVP_PKEY_decrypt_old := LoadFunctionCLib(fn_EVP_PKEY_decrypt_old,False); + @EVP_PKEY_encrypt_old := LoadFunctionCLib(fn_EVP_PKEY_encrypt_old,False); + @EVP_PKEY_type := LoadFunctionCLib(fn_EVP_PKEY_type,False); + @EVP_PKEY_id := LoadFunctionCLib(fn_EVP_PKEY_id,False); + @EVP_PKEY_base_id := LoadFunctionCLib(fn_EVP_PKEY_base_id,False); + @EVP_PKEY_bits := LoadFunctionCLib(fn_EVP_PKEY_bits,False); + @EVP_PKEY_size := LoadFunctionCLib(fn_EVP_PKEY_size,False); + @EVP_PKEY_set_type := LoadFunctionCLib(fn_EVP_PKEY_set_type,False); + @EVP_PKEY_set_type_str := LoadFunctionCLib(fn_EVP_PKEY_set_type_str,False); + @EVP_PKEY_get0 := LoadFunctionCLib(fn_EVP_PKEY_get0,False); + {$ifndef OPENSSL_NO_RSA} + @EVP_PKEY_set1_RSA := LoadFunctionCLib(fn_EVP_PKEY_set1_RSA,False); + @EVP_PKEY_get1_RSA := LoadFunctionCLib(fn_EVP_PKEY_get1_RSA,False); + {$ENDIF} + {$ifndef OPENSSL_NO_DSA} + @EVP_PKEY_set1_DSA := LoadFunctionCLib(fn_EVP_PKEY_set1_DSA,False); + @EVP_PKEY_get1_DSA := LoadFunctionCLib(fn_EVP_PKEY_get1_DSA,False); + {$endif} + {$ifndef OPENSSL_NO_DH} + @EVP_PKEY_set1_DH := LoadFunctionCLib(fn_EVP_PKEY_set1_DH,False); + @EVP_PKEY_get1_DH := LoadFunctionCLib(fn_EVP_PKEY_get1_DH,False); + {$endif} + {$ifndef OPENSSL_NO_EC} + @EVP_PKEY_set1_EC_KEY := LoadFunctionCLib(fn_EVP_PKEY_set1_EC_KEY,False); + @EVP_PKEY_get1_EC_KEY := LoadFunctionCLib(fn_EVP_PKEY_get1_EC_KEY,False); + {$endif} + @d2i_PublicKey := LoadFunctionCLib(fn_d2i_PublicKey,False); + @i2d_PublicKey := LoadFunctionCLib(fn_i2d_PublicKey,False); + @d2i_AutoPrivateKey := LoadFunctionCLib(fn_d2i_AutoPrivateKey,False); + @EVP_PKEY_copy_parameters := LoadFunctionCLib(fn_EVP_PKEY_copy_parameters,False); + @EVP_PKEY_missing_parameters := LoadFunctionCLib(fn_EVP_PKEY_missing_parameters,False); + @EVP_PKEY_save_parameters := LoadFunctionCLib(fn_EVP_PKEY_save_parameters,False); + @EVP_PKEY_cmp_parameters := LoadFunctionCLib(fn_EVP_PKEY_cmp_parameters,False); + @EVP_PKEY_cmp := LoadFunctionCLib(fn_EVP_PKEY_cmp,False); + @EVP_PKEY_print_public := LoadFunctionCLib(fn_EVP_PKEY_print_public,False); + @EVP_PKEY_print_private := LoadFunctionCLib(fn_EVP_PKEY_print_private,False); + @EVP_PKEY_print_params := LoadFunctionCLib(fn_EVP_PKEY_print_params,False); + @EVP_PKEY_get_default_digest_nid := LoadFunctionCLib(fn_EVP_PKEY_get_default_digest_nid,False); + @EVP_CIPHER_param_to_asn1 := LoadFunctionCLib(fn_EVP_CIPHER_param_to_asn1,False); + @EVP_CIPHER_asn1_to_param := LoadFunctionCLib(fn_EVP_CIPHER_asn1_to_param,False); + @EVP_CIPHER_set_asn1_iv := LoadFunctionCLib(fn_EVP_CIPHER_set_asn1_iv,False); + @EVP_CIPHER_get_asn1_iv := LoadFunctionCLib(fn_EVP_CIPHER_get_asn1_iv,False); + @PKCS5_PBE_keyivgen := LoadFunctionCLib(fn_PKCS5_PBE_keyivgen,False); + @PKCS5_PBKDF2_HMAC_SHA1 := LoadFunctionCLib(fn_PKCS5_PBKDF2_HMAC_SHA1,False); + @PKCS5_PBKDF2_HMAC := LoadFunctionCLib(fn_PKCS5_PBKDF2_HMAC,False); + @PKCS5_v2_PBE_keyivgen := LoadFunctionCLib(fn_PKCS5_v2_PBE_keyivgen,False); + @PKCS5_PBE_add := LoadFunctionCLib(fn_PKCS5_PBE_add,False); + @EVP_PBE_CipherInit := LoadFunctionCLib(fn_EVP_PBE_CipherInit,False); + + @EVP_PBE_alg_add_type := LoadFunctionCLib(fn_EVP_PBE_alg_add_type,False); + @EVP_PBE_alg_add := LoadFunctionCLib(fn_EVP_PBE_alg_add,False); + @EVP_PBE_find := LoadFunctionCLib(fn_EVP_PBE_find,False); + @EVP_PBE_cleanup := LoadFunctionCLib(fn_EVP_PBE_cleanup,False); + @EVP_PKEY_asn1_get_count := LoadFunctionCLib(fn_EVP_PKEY_asn1_get_count,False); + @EVP_PKEY_asn1_get0 := LoadFunctionCLib(fn_EVP_PKEY_asn1_get0,False); + @EVP_PKEY_asn1_find := LoadFunctionCLib(fn_EVP_PKEY_asn1_find,False); + @EVP_PKEY_asn1_find_str := LoadFunctionCLib(fn_EVP_PKEY_asn1_find_str,False); + @EVP_PKEY_asn1_add0 := LoadFunctionCLib(fn_EVP_PKEY_asn1_add0,False); + @EVP_PKEY_asn1_add_alias := LoadFunctionCLib(fn_EVP_PKEY_asn1_add_alias,False); + @EVP_PKEY_asn1_get0_info := LoadFunctionCLib(fn_EVP_PKEY_asn1_get0_info,False); + @EVP_PKEY_get0_asn1 := LoadFunctionCLib(fn_EVP_PKEY_get0_asn1,False); + @EVP_PKEY_asn1_new := LoadFunctionCLib(fn_EVP_PKEY_asn1_new,False); + @EVP_PKEY_asn1_copy := LoadFunctionCLib(fn_EVP_PKEY_asn1_copy,False); + @EVP_PKEY_asn1_free := LoadFunctionCLib(fn_EVP_PKEY_asn1_free,False); + @EVP_PKEY_asn1_set_public := LoadFunctionCLib(fn_EVP_PKEY_asn1_set_public,False); + @EVP_PKEY_asn1_set_private := LoadFunctionCLib(fn_EVP_PKEY_asn1_set_private,False); + @EVP_PKEY_asn1_set_param := LoadFunctionCLib(fn_EVP_PKEY_asn1_set_param,False); + @EVP_PKEY_asn1_set_free := LoadFunctionCLib(fn_EVP_PKEY_asn1_set_free,False); + @EVP_PKEY_asn1_set_ctrl := LoadFunctionCLib(fn_EVP_PKEY_asn1_set_ctrl,False); + @EVP_PKEY_meth_find := LoadFunctionCLib(fn_EVP_PKEY_meth_find,False); + @EVP_PKEY_meth_new := LoadFunctionCLib(fn_EVP_PKEY_meth_new,False); + @EVP_PKEY_meth_get0_info := LoadFunctionCLib(fn_EVP_PKEY_meth_get0_info,False); + @EVP_PKEY_meth_copy := LoadFunctionCLib(fn_EVP_PKEY_meth_copy,False); + @EVP_PKEY_meth_free := LoadFunctionCLib(fn_EVP_PKEY_meth_free,False); + @EVP_PKEY_meth_add0 := LoadFunctionCLib(fn_EVP_PKEY_meth_add0,False); + @EVP_PKEY_CTX_new := LoadFunctionCLib(fn_EVP_PKEY_CTX_new,False); + @EVP_PKEY_CTX_new_id := LoadFunctionCLib(fn_EVP_PKEY_CTX_new_id,False); + @EVP_PKEY_CTX_dup := LoadFunctionCLib(fn_EVP_PKEY_CTX_dup,False); + @EVP_PKEY_CTX_free := LoadFunctionCLib(fn_EVP_PKEY_CTX_free,False); + @EVP_PKEY_CTX_ctrl := LoadFunctionCLib(fn_EVP_PKEY_CTX_ctrl,False); + @EVP_PKEY_CTX_ctrl_str := LoadFunctionCLib(fn_EVP_PKEY_CTX_ctrl_str,False); + @EVP_PKEY_CTX_get_operation := LoadFunctionCLib(fn_EVP_PKEY_CTX_get_operation,False); + @EVP_PKEY_CTX_set0_keygen_info := LoadFunctionCLib(fn_EVP_PKEY_CTX_set0_keygen_info,False); + @EVP_PKEY_new_mac_key := LoadFunctionCLib(fn_EVP_PKEY_new_mac_key,False); + @EVP_PKEY_CTX_set_data := LoadFunctionCLib(fn_EVP_PKEY_CTX_set_data,False); + @EVP_PKEY_CTX_get_data := LoadFunctionCLib(fn_EVP_PKEY_CTX_get_data,False); + @EVP_PKEY_CTX_get0_pkey := LoadFunctionCLib(fn_EVP_PKEY_CTX_get0_pkey,False); + @EVP_PKEY_CTX_get0_peerkey := LoadFunctionCLib(fn_EVP_PKEY_CTX_get0_peerkey,False); + @EVP_PKEY_CTX_set_app_data := LoadFunctionCLib(fn_EVP_PKEY_CTX_set_app_data,False); + @EVP_PKEY_CTX_get_app_data := LoadFunctionCLib(fn_EVP_PKEY_CTX_get_app_data,False); + @EVP_PKEY_sign_init := LoadFunctionCLib(fn_EVP_PKEY_sign_init,False); + @EVP_PKEY_sign := LoadFunctionCLib(fn_EVP_PKEY_sign,False); + @EVP_PKEY_verify_init := LoadFunctionCLib(fn_EVP_PKEY_verify_init,False); + @EVP_PKEY_verify := LoadFunctionCLib(fn_EVP_PKEY_verify,False); + @EVP_PKEY_verify_recover_init := LoadFunctionCLib(fn_EVP_PKEY_verify_recover_init,False); + @EVP_PKEY_verify_recover := LoadFunctionCLib(fn_EVP_PKEY_verify_recover,False); + @EVP_PKEY_encrypt_init := LoadFunctionCLib(fn_EVP_PKEY_encrypt_init,False); + @EVP_PKEY_encrypt := LoadFunctionCLib(fn_EVP_PKEY_encrypt,False); + @EVP_PKEY_decrypt_init := LoadFunctionCLib(fn_EVP_PKEY_decrypt_init,False); + @EVP_PKEY_decrypt := LoadFunctionCLib(fn_EVP_PKEY_decrypt,False); + @EVP_PKEY_derive_init := LoadFunctionCLib(fn_EVP_PKEY_derive_init,False); + @EVP_PKEY_derive_set_peer := LoadFunctionCLib(fn_EVP_PKEY_derive_set_peer,False); + @EVP_PKEY_derive := LoadFunctionCLib(fn_EVP_PKEY_derive,False); + @EVP_PKEY_paramgen_init := LoadFunctionCLib(fn_EVP_PKEY_paramgen_init,False); + @EVP_PKEY_paramgen := LoadFunctionCLib(fn_EVP_PKEY_paramgen,False); + @EVP_PKEY_keygen_init := LoadFunctionCLib(fn_EVP_PKEY_keygen_init,False); + @EVP_PKEY_keygen := LoadFunctionCLib(fn_EVP_PKEY_keygen,False); + @EVP_PKEY_CTX_set_cb := LoadFunctionCLib(fn_EVP_PKEY_CTX_set_cb,False); + @EVP_PKEY_CTX_get_cb := LoadFunctionCLib(fn_EVP_PKEY_CTX_get_cb,False); + @EVP_PKEY_CTX_get_keygen_info := LoadFunctionCLib(fn_EVP_PKEY_CTX_get_keygen_info,False); + @EVP_PKEY_meth_set_init := LoadFunctionCLib(fn_EVP_PKEY_meth_set_init,False); + @EVP_PKEY_meth_set_copy := LoadFunctionCLib(fn_EVP_PKEY_meth_set_copy,False); + @EVP_PKEY_meth_set_cleanup := LoadFunctionCLib(fn_EVP_PKEY_meth_set_cleanup,False); + @EVP_PKEY_meth_set_paramgen := LoadFunctionCLib(fn_EVP_PKEY_meth_set_paramgen,False); + @EVP_PKEY_meth_set_keygen := LoadFunctionCLib(fn_EVP_PKEY_meth_set_keygen,False); + @EVP_PKEY_meth_set_sign := LoadFunctionCLib(fn_EVP_PKEY_meth_set_sign,False); + @EVP_PKEY_meth_set_verify := LoadFunctionCLib(fn_EVP_PKEY_meth_set_verify,False); + @EVP_PKEY_meth_set_verify_recover := LoadFunctionCLib(fn_EVP_PKEY_meth_set_verify_recover,False); + @EVP_PKEY_meth_set_signctx := LoadFunctionCLib(fn_EVP_PKEY_meth_set_signctx,False); + @EVP_PKEY_meth_set_verifyctx := LoadFunctionCLib(fn_EVP_PKEY_meth_set_verifyctx,False); + @EVP_PKEY_meth_set_encrypt := LoadFunctionCLib(fn_EVP_PKEY_meth_set_encrypt,False); + @EVP_PKEY_meth_set_decrypt := LoadFunctionCLib(fn_EVP_PKEY_meth_set_decrypt,False); + @EVP_PKEY_meth_set_derive := LoadFunctionCLib(fn_EVP_PKEY_meth_set_derive,False); + @EVP_PKEY_meth_set_ctrl := LoadFunctionCLib(fn_EVP_PKEY_meth_set_ctrl,False); + //HMAC + {$IFNDEF OPENSSL_NO_HMAC} + @HMAC_CTX_init := LoadFunctionCLib(fn_HMAC_CTX_init); + if IsOpenSSL_1x then begin + @_HMAC_Init_ex := nil; + @_HMAC_Update := nil; + @_HMAC_Final := nil; + @_1_0_HMAC_Init_ex := LoadFunctionCLib(fn_HMAC_Init_ex); + @_1_0_HMAC_Update := LoadFunctionCLib(fn_HMAC_Update); + @_1_0_HMAC_Final := LoadFunctionCLib(fn_HMAC_Final); + end else begin + @_HMAC_Init_ex := LoadFunctionCLib(fn_HMAC_Init_ex); + @_HMAC_Update := LoadFunctionCLib(fn_HMAC_Update); + @_HMAC_Final := LoadFunctionCLib(fn_HMAC_Final); + @_1_0_HMAC_Init_ex := nil; + @_1_0_HMAC_Update := nil; + @_1_0_HMAC_Final := nil; + end; + @HMAC_CTX_cleanup := LoadFunctionCLib(fn_HMAC_CTX_cleanup); + {$ENDIF} + //OBJ + @OBJ_obj2nid := LoadFunctionCLib(fn_OBJ_obj2nid); + @OBJ_nid2obj := LoadFunctionCLib(fn_OBJ_nid2obj); + @OBJ_nid2ln := LoadFunctionCLib(fn_OBJ_nid2ln); + @OBJ_nid2sn := LoadFunctionCLib(fn_OBJ_nid2sn); + //ASN1 + @ASN1_INTEGER_set := LoadFunctionCLib(fn_ASN1_INTEGER_set); + @ASN1_INTEGER_get := LoadFunctionCLib(fn_ASN1_INTEGER_get); + @ASN1_INTEGER_to_BN := LoadFunctionCLib(fn_ASN1_INTEGER_to_BN); + @ASN1_STRING_type_new := LoadFunctionCLib(fn_ASN1_STRING_type_new); + @ASN1_STRING_free := LoadFunctionCLib(fn_ASN1_STRING_free); + @ASN1_dup := LoadFunctionCLib(fn_ASN1_dup ); + @CRYPTO_set_mem_functions := LoadFunctionCLib(fn_CRYPTO_set_mem_functions); + @CRYPTO_malloc := LoadFunctionCLib(fn_CRYPTO_malloc); + @CRYPTO_free := LoadFunctionCLib(fn_CRYPTO_free); + @CRYPTO_mem_leaks := LoadFunctionCLib(fn_CRYPTO_mem_leaks); + @CRYPTO_mem_ctrl := LoadFunctionCLib(fn_CRYPTO_mem_ctrl); + @CRYPTO_set_mem_debug_functions := LoadFunctionCLib(fn_CRYPTO_set_mem_debug_functions); + //@CRYPTO_dbg_malloc := LoadFunctionCLib(fn_CRYPTO_dbg_malloc); + //@CRYPTO_dbg_realloc := LoadFunctionCLib(fn_CRYPTO_dbg_realloc); + //@CRYPTO_dbg_free := LoadFunctionCLib(fn_CRYPTO_dbg_free); + //@CRYPTO_dbg_set_options := LoadFunctionCLib(fn_CRYPTO_dbg_set_options); + //@CRYPTO_dbg_get_options := LoadFunctionCLib(fn_CRYPTO_dbg_get_options); + @PKCS12_create := LoadFunctionCLib(fn_PKCS12_create); + @i2d_PKCS12_bio := LoadFunctionCLib(fn_i2d_PKCS12_bio); + @PKCS12_free := LoadFunctionCLib(fn_PKCS12_free); + @OpenSSL_add_all_algorithms := LoadOldCLib(fn_OpenSSL_add_all_algorithms, + fn_OPENSSL_add_all_algorithms_noconf); + @OpenSSL_add_all_ciphers := LoadFunctionCLib(fn_OpenSSL_add_all_ciphers); + @OpenSSL_add_all_digests := LoadFunctionCLib(fn_OpenSSL_add_all_digests); + @EVP_cleanup := LoadFunctionCLib(fn_EVP_cleanup); + + @sk_num := LoadFunctionCLib(fn_sk_num); + @sk_new := LoadFunctionCLib(fn_sk_new); + @sk_new_null := LoadFunctionCLib(fn_sk_new_null); + @sk_free := LoadFunctionCLib(fn_sk_free); + @sk_push := LoadFunctionCLib(fn_sk_push); + @sk_dup := LoadFunctionCLib(fn_sk_dup); + @sk_find := LoadFunctionCLib(fn_sk_find); + @sk_value := LoadFunctionCLib(fn_sk_value); + {$IFDEF OPENSSL_FIPS} + @_FIPS_mode_set := LoadFunctionCLib(fn_FIPS_mode_set,False); + @_FIPS_mode := LoadFunctionCLib(fn_FIPS_mode,False); + {$ENDIF} + + // TODO: expose a global callback function pointer, or an optional input + // parameter to Load(), so users can choose to load additional OpenSSL + // functions as desired using the DLL handles that we've already loaded... + { + if Assigned(LoadSSLFuncsCallback) then begin + LoadSSLFuncsCallback(hIdSSL, hIdCrypto, FFailedLoadList); + end; + } + + Result := (FFailedLoadList.Count = 0); +end; + +{$ENDIF} // STATICLOAD_OPENSSL + +procedure InitializeFuncPointers; +begin + @SSL_CTX_set_cipher_list := nil; + @SSL_CTX_new := nil; + @SSL_CTX_free := nil; + @SSL_set_fd := nil; + @SSL_CTX_use_PrivateKey_file := nil; + @SSL_CTX_use_PrivateKey := nil; + @SSL_CTX_use_certificate := nil; + @SSL_CTX_use_certificate_file := nil; + SSL_CTX_use_certificate_chain_file := nil; + @SSL_load_error_strings := nil; + @SSL_state_string_long := nil; + @SSL_load_error_strings := nil; + @SSL_alert_type_string_long := nil; + + @SSL_get_peer_certificate := nil; + @SSL_CTX_set_verify := nil; + @SSL_CTX_set_verify_depth := nil; + @SSL_CTX_get_verify_depth := nil; + @SSL_CTX_set_default_passwd_cb := nil; + @SSL_CTX_set_default_passwd_cb_userdata := nil; + @SSL_CTX_check_private_key := nil; + @SSL_new := nil; + @SSL_free := nil; + @SSL_accept := nil; + @SSL_connect := nil; + @SSL_read := nil; + @SSL_peek := nil; + @SSL_pending := nil; + @SSL_write := nil; + @SSL_ctrl := nil; + @SSL_callback_ctrl := nil; + @SSL_CTX_ctrl := nil; + @SSL_CTX_callback_ctrl := nil; + @SSL_get_error := nil; + @SSLv2_method := nil; + @SSLv2_server_method := nil; + @SSLv2_client_method := nil; + @SSLv3_method := nil; + @SSLv3_server_method := nil; + @SSLv3_client_method := nil; + @SSLv23_method := nil; + @SSLv23_server_method := nil; + @SSLv23_client_method := nil; + @TLSv1_method := nil; + @TLSv1_server_method := nil; + @TLSv1_client_method := nil; + @TLSv1_1_method := nil; + @TLSv1_1_server_method := nil; + @TLSv1_1_client_method := nil; + @TLSv1_2_method := nil; + @TLSv1_2_server_method := nil; + @TLSv1_2_client_method := nil; + @DTLSv1_method := nil; + @DTLSv1_server_method := nil; + @DTLSv1_client_method := nil; + @SSL_shutdown := nil; + @SSL_set_connect_state := nil; + @SSL_set_accept_state := nil; + @SSL_set_shutdown := nil; + @SSL_CTX_load_verify_locations := nil; + @SSL_get_session := nil; + @SSLeay_add_ssl_algorithms := nil; + @SSL_SESSION_get_id := nil; + @SSL_copy_session_id := nil; + // CRYPTO LIB + @_SSLeay_version := nil; + @SSLeay := nil; + @X509_NAME_oneline := nil; + @X509_NAME_hash := nil; + @X509_set_issuer_name := nil; + @X509_get_issuer_name := nil; + @X509_set_subject_name := nil; + @X509_get_subject_name := nil; + @X509_digest := nil; + @X509_LOOKUP_ctrl := nil; + @X509_STORE_add_cert := nil; + @X509_STORE_add_crl := nil; + @X509_STORE_CTX_get_ex_data := nil; + @X509_STORE_CTX_get_error := nil; + @X509_STORE_CTX_set_error := nil; + @X509_STORE_CTX_get_error_depth := nil; + @X509_STORE_CTX_get_current_cert := nil; + @X509_STORE_add_lookup := nil; + @X509_STORE_load_locations := nil; + @X509_sign := nil; + @X509_REQ_sign := nil; + @X509_REQ_add_extensions := nil; + @X509V3_EXT_conf_nid := nil; + @X509_EXTENSION_create_by_NID := nil; + @X509V3_set_ctx := nil; + @X509_EXTENSION_free := nil; + @X509_add_ext := nil; + {$IFNDEF OPENSSL_NO_BIO} + //X509_print + @X509_print := nil; + {$ENDIF} + @_RAND_cleanup := nil; + @_RAND_bytes := nil; + @_RAND_pseudo_bytes := nil; + @_RAND_seed := nil; + @_RAND_add := nil; + @_RAND_status := nil; + {$IFDEF SYS_WIN} + @_RAND_screen := nil; + @_RAND_event := nil; + {$ENDIF} + {$IFNDEF OPENSSL_NO_DES} + // 3DES + @DES_set_odd_parity := nil; + @DES_set_key := nil; + @DES_ecb_encrypt := nil; + @Id_ossl_old_des_set_odd_parity := nil; + @Id_ossl_old_des_set_key := nil; + @Id_ossl_old_des_ecb_encrypt := nil; + {$ENDIF} + // More SSL functions + @SSL_set_ex_data := nil; + @SSL_get_ex_data := nil; + @SSL_load_client_CA_file := nil; + @SSL_CTX_set_client_CA_list := nil; + @SSL_CTX_set_default_verify_paths := nil; + @SSL_CTX_set_session_id_context := nil; + @SSL_CIPHER_description := nil; + @SSL_get_current_cipher := nil; + @SSL_CIPHER_get_name := nil; + @SSL_CIPHER_get_version := nil; + @SSL_CIPHER_get_bits := nil; + // Thread safe + @_CRYPTO_num_locks := nil; + @CRYPTO_set_locking_callback := nil; + {$IFNDEF WIN32_OR_WIN64} + @CRYPTO_THREADID_set_callback := nil; + @CRYPTO_THREADID_set_numeric := nil; + @CRYPTO_THREADID_set_pointer := nil; + @CRYPTO_set_id_callback := nil; + {$ENDIF} + @ERR_put_error := nil; + @ERR_get_error := nil; + @ERR_peek_error := nil; + @ERR_peek_last_error := nil; + @ERR_clear_error := nil; + @ERR_error_string := nil; + @ERR_error_string_n := nil; + @ERR_lib_error_string := nil; + @ERR_func_error_string := nil; + @ERR_reason_error_string := nil; + @ERR_load_ERR_strings := nil; + @ERR_load_crypto_strings := nil; + @ERR_free_strings := nil; + @ERR_remove_thread_state := nil; + @ERR_remove_state := nil; + @CRYPTO_cleanup_all_ex_data := nil; + @SSL_COMP_get_compression_methods := nil; + @SSL_COMP_free_compression_methods := nil; + @sk_pop_free := nil; + //RSA + @RSA_new := nil; + @RSA_free := nil; + @RSA_size := nil; + @RSA_generate_key := nil; + @RSA_generate_key_ex := nil; + @RSA_check_key := nil; + @RSA_private_decrypt := nil; + @RSA_public_encrypt := nil; + //DH + @DH_free := nil; + //BIO + @BIO_set_flags := nil; + @BIO_new := nil; + @BIO_push := nil; + @BIO_pop := nil; + @BIO_set_next := nil; + @BIO_free := nil; + @BIO_free_all := nil; + @BIO_new_mem_buf := nil; + @BIO_s_mem := nil; + @BIO_s_file := nil; + @BIO_set_ex_data := nil; + @BIO_get_ex_data := nil; + @BIO_ctrl := nil; + @BIO_ptr_ctrl := nil; + @BIO_int_ctrl := nil; + @BIO_new_file := nil; + @BIO_puts := nil; + @BIO_read := nil; + @BIO_write := nil; + //BN + @BN_hex2bn := nil; + @BN_bn2dec := nil; + @BN_bn2hex := nil; + //i2d + @i2d_PKCS7 := nil; + @d2i_PKCS7 := nil; + @i2d_RSAPrivateKey := nil; + @d2i_RSAPrivateKey := nil; + @i2d_DSAPrivateKey := nil; + @d2i_DSAPrivateKey := nil; + @i2d_X509_bio := nil; + @i2d_PrivateKey_bio := nil; + @i2d_PrivateKey := nil; + @d2i_PrivateKey := nil; + @d2i_PrivateKey_bio := nil; + @i2d_X509 := nil; + @d2i_X509_bio := nil; + @d2i_X509 := nil; + @d2i_PKCS12_bio := nil; + @PKCS12_parse := nil; + @X509_NAME_new := nil; + @X509_NAME_free := nil; + @i2d_X509_REQ_bio := nil; + @i2d_X509_REQ := nil; + @d2i_X509_REQ := nil; + @i2d_X509_NAME := nil; + @d2i_X509_NAME := nil; + @i2d_DSAparams := nil; + @d2i_DSAparams := nil; + @i2d_DHparams := nil; + @d2i_DHparams := nil; + @i2d_NETSCAPE_CERT_SEQUENCE := nil; + @d2i_NETSCAPE_CERT_SEQUENCE := nil; + @i2d_PUBKEY := nil; + @d2i_PUBKEY := nil; + //X509 + @X509_get_default_cert_file := nil; + @X509_get_default_cert_file_env := nil; + @X509_new := nil; + @X509_free := nil; + @X509_REQ_new := nil; + @X509_REQ_free := nil; + @X509_to_X509_REQ := nil; + @X509_NAME_add_entry_by_txt := nil; + @X509_INFO_free := nil; + @X509_set_version := nil; + @X509_get_serialNumber := nil; + @X509_gmtime_adj := nil; + @X509_set_notBefore := nil; + @X509_set_notAfter := nil; + @X509_set_pubkey := nil; + @X509_REQ_set_pubkey := nil; + //PEM + {$IFNDEF SSLEAY_MACROS} + @_PEM_read_bio_X509 := nil; + @_PEM_read_bio_X509_REQ := nil; + @_PEM_read_bio_X509_CRL := nil; + @_PEM_read_bio_RSAPrivateKey := nil; + @_PEM_read_bio_RSAPublicKey := nil; + @_PEM_read_bio_DSAPrivateKey := nil; + @_PEM_read_bio_PrivateKey := nil; + @_PEM_read_bio_PKCS7 := nil; + @_PEM_read_bio_DHparams := nil; + @_PEM_read_bio_DSAparams := nil; + @_PEM_read_bio_NETSCAPE_CERT_SEQUENCE := nil; + @_PEM_read_bio_PUBKEY := nil; + @_PEM_write_bio_X509 := nil; + @_PEM_write_bio_X509_REQ := nil; + @_PEM_write_bio_X509_CRL := nil; + @_PEM_write_bio_RSAPublicKey := nil; + @_PEM_write_bio_RSAPrivateKey := nil; + @_PEM_write_bio_DSAPrivateKey := nil; + @_PEM_write_bio_PrivateKey := nil; + @_PEM_write_bio_PKCS7 := nil; + @_PEM_write_bio_DHparams := nil; + @_PEM_write_bio_DSAparams := nil; + @_PEM_write_bio_NETSCAPE_CERT_SEQUENCE := nil; + @_PEM_write_bio_PKCS8PrivateKey := nil; + @_PEM_write_bio_PUBKEY := nil; + {$ELSE} + @PEM_ASN1_write_bio := nil; + @PEM_ASN1_read_bio := nil; + {$ENDIF} + @PEM_X509_INFO_read_bio := nil; + @PEM_read_bio_X509_AUX := nil; + //EVP + {$IFNDEF OPENSSL_NO_DES} + @EVP_des_ede3_cbc := nil; + {$ENDIF} + {$IFNDEF OPENSSL_NO_SHA512} + @EVP_sha512 := nil; + @EVP_sha384 := nil; + {$ENDIF} + {$IFNDEF OPENSSL_NO_SHA256} + @EVP_sha256 := nil; + @EVP_sha224 := nil; + {$ENDIF} + {$IFNDEF OPENSSL_NO_SHA} + @EVP_sha := nil; + @EVP_sha1 := nil; + @EVP_dss := nil; + @EVP_dss1 := nil; + @EVP_ecdsa := nil; + {$ENDIF} + {$IFNDEF OPENSSL_NO_MD5} + @EVP_md5 := nil; + {$ENDIF} + {$IFNDEF OPENSSL_NO_MD4} + @EVP_md4 := nil; + {$ENDIF} + {$IFNDEF OPENSSL_NO_MD2} + @EVP_md2 := nil; + {$ENDIF} + {$ifndef OPENSSL_NO_MDC2} + @EVP_mdc2 := nil; + {$endif} + {$IFNDEF OPENSSL_NO_MD5} + @EVP_md5 := nil; + {$ENDIF} + + {$ifndef OPENSSL_NO_RIPEMD} + EVP_ripemd160 := nil; + {$endif} + {$ifndef OPENSSL_NO_WHIRLPOOL} + @EVP_whirlpool := nil; + {$endif} + @EVP_md_null := nil; + {$IFNDEF OPENSSL_NO_DES} + @EVP_des_ecb := nil; + @EVP_des_ede := nil; + @EVP_des_ede3 :=nil; + @EVP_des_ede_ecb := nil; + @EVP_des_ede3_ecb := nil; + @EVP_des_cfb64 := nil; + + @EVP_des_cfb1 := nil; + @EVP_des_cfb8 := nil; + @EVP_des_ede_cfb64 := nil; +//#if 0 + // @EVP_des_ede_cfb1 := nil; + // @EVP_des_ede_cfb8 := nil; + //#endif + @EVP_des_ede3_cfb64 :=nil; + @EVP_des_ede3_cfb1 := nil; + @EVP_des_ede3_cfb8 := nil; + @EVP_des_ofb := nil; + @EVP_des_ede_ofb := nil; + @EVP_des_ede3_ofb := nil; + @EVP_des_cbc := nil; + @EVP_des_ede_cbc := nil; + @EVP_desx_cbc := nil; +//* This should now be supported through the dev_crypto ENGINE. But also, why are +// * rc4 and md5 declarations made here inside a "NO_DES" precompiler branch? */ +//#if 0 + {$ifdef OPENSSL_OPENBSD_DEV_CRYPTO} + @EVP_dev_crypto_des_ede3_cbc := nil; + @EVP_dev_crypto_rc4 := nil; + @EVP_dev_crypto_md5 := nil; + {$endif} +//#endif + {$endif} + + {$ifndef OPENSSL_NO_RC4} + @EVP_rc4 := nil; + @EVP_rc4_40 := nil; + {$ifndef OPENSSL_NO_MD5} + @EVP_rc4_hmac_md5 := nil; + {$endif} + {$endif} + {$ifndef OPENSSL_NO_IDEA} + @EVP_idea_ecb := nil; + @EVP_idea_cfb64 := nil; + @EVP_idea_ofb := nil; + @EVP_idea_cbc := nil; + {$endif} + {$ifndef OPENSSL_NO_RC2} + @EVP_rc2_ecb := nil; + @EVP_rc2_cbc := nil; + @EVP_rc2_40_cbc := nil; + @EVP_rc2_64_cbc := nil; + @EVP_rc2_cfb64 := nil; + @EVP_rc2_ofb := nil; + {$endif} + {$ifndef OPENSSL_NO_BF} + @EVP_bf_ecb := nil; + @EVP_bf_cbc := nil; + @EVP_bf_cfb64 := nil; + @EVP_bf_ofb := nil; + {$endif} + {$ifndef OPENSSL_NO_CAST} + @EVP_cast5_ecb := nil; + @EVP_cast5_cbc := nil; + @EVP_cast5_cfb64 := nil; + @EVP_cast5_ofb := nil; + {$endif} + {$ifndef OPENSSL_NO_RC5} + @EVP_rc5_32_12_16_cbc := nil; + @EVP_rc5_32_12_16_ecb := nil; + @EVP_rc5_32_12_16_cfb64 := nil; + @EVP_rc5_32_12_16_ofb := nil; + {$endif} + {$ifndef OPENSSL_NO_AES} + @EVP_aes_128_ecb := nil; + @EVP_aes_128_cbc := nil; + @EVP_aes_128_cfb1:= nil; + @EVP_aes_128_cfb8:= nil; + @EVP_aes_128_cfb128 := nil; + @EVP_aes_128_ofb := nil; + @EVP_aes_128_ctr := nil; + @EVP_aes_128_gcm := nil; + @EVP_aes_128_ccm := nil; + @EVP_aes_128_xts := nil; + @EVP_aes_192_ecb := nil; + @EVP_aes_192_cbc := nil; + @EVP_aes_192_cfb1 := nil; + @EVP_aes_192_cfb128 := nil; + + @EVP_aes_192_ofb := nil; + @EVP_aes_192_ctr := nil; + @EVP_aes_192_gcm := nil; + @EVP_aes_192_ccm := nil; + @EVP_aes_256_ecb := nil; + @EVP_aes_256_cbc := nil; + @EVP_aes_256_cfb1 := nil; + @EVP_aes_256_cfb8 := nil; + @EVP_aes_256_cfb128 := nil; + @EVP_aes_256_ofb := nil; + @EVP_aes_256_ctr := nil; + @EVP_aes_256_gcm := nil; + @EVP_aes_256_ccm := nil; + @EVP_aes_256_xts := nil; + {$ifndef OPENSSL_NO_SHA} + {$ifndef OPENSSL_NO_SHA1} + @EVP_aes_128_cbc_hmac_sha1 := nil; + @EVP_aes_256_cbc_hmac_sha1 := nil; + {$endif} + {$endif} + {$endif} + {$ifndef OPENSSL_NO_CAMELLIA} + @EVP_camellia_128_ecb := nil; + @EVP_camellia_128_cbc := nil; + @EVP_camellia_128_cfb1 := nil; + @EVP_camellia_128_cfb8 := nil; + @EVP_camellia_128_cfb128 := nil; + @EVP_camellia_128_ofb := nil; + @EVP_camellia_192_ecb := nil; + + @EVP_camellia_192_cbc := nil; + @EVP_camellia_192_cfb1 := nil; + @EVP_camellia_192_cfb8 := nil; + @EVP_camellia_192_cfb128 :=nil; + @EVP_camellia_192_ofb := nil; + @EVP_camellia_256_ecb := nil; + @EVP_camellia_256_cbc := nil; + @EVP_camellia_256_cfb1 := nil; + @EVP_camellia_256_cfb8 := nil; + @EVP_camellia_256_cfb128 := nil; + @EVP_camellia_256_ofb := nil; + {$endif} + + {$ifndef OPENSSL_NO_SEED} + @EVP_seed_ecb := nil; + @EVP_seed_cbc := nil; + @EVP_seed_cfb128 := nil; + @EVP_seed_ofb := nil; + {$endif} + + @EVP_MD_CTX_init := nil; + @EVP_MD_CTX_cleanup := nil; + @EVP_MD_CTX_create := nil; + @EVP_MD_CTX_destroy := nil; + @EVP_MD_CTX_copy := nil; + @EVP_MD_CTX_copy_ex := nil; + //@EVP_MD_CTX_set_flags := nil; + //@EVP_MD_CTX_clear_flags := nil; + //@EVP_MD_CTX_test_flags := nil; + + @EVP_DigestInit := nil; + @EVP_DigestInit_ex := nil; + @EVP_DigestUpdate := nil; + @EVP_DigestFinal_ex := nil; + + @EVP_EncryptInit := nil; + @EVP_EncryptInit_ex := nil; + @EVP_EncryptUpdate := nil; + @EVP_EncryptFinal_ex := nil; + @EVP_EncryptFinal := nil; + + @EVP_DecryptInit := nil; + @EVP_DecryptInit_ex := nil; + @EVP_DecryptUpdate := nil; + @EVP_DecryptFinal := nil; + @EVP_DecryptFinal_ex := nil; + @EVP_CipherInit := nil; + @EVP_CipherInit_ex := nil; + @EVP_CipherUpdate := nil; + @EVP_CipherFinal := nil; + @EVP_CipherFinal_ex := nil; + @EVP_SignFinal := nil; + @EVP_VerifyFinal := nil; + @EVP_DigestSignInit := nil; + @EVP_DigestSignFinal := nil; + @EVP_DigestVerifyInit := nil; + @EVP_DigestVerifyFinal := nil; + @EVP_OpenInit := nil; + @EVP_OpenFinal := nil; + @EVP_SealInit := nil; + @EVP_SealFinal := nil; + @EVP_EncodeInit := nil; + + @EVP_EncodeUpdate := nil; + @EVP_EncodeFinal := nil; + @EVP_EncodeBlock := nil; + @EVP_DecodeInit := nil; + @EVP_DecodeUpdate := nil; + @EVP_DecodeFinal := nil; + @EVP_DecodeBlock := nil; + + @EVP_CIPHER_CTX_init := nil; + + @EVP_CIPHER_CTX_cleanup := nil; + @EVP_CIPHER_CTX_new := nil; + @EVP_CIPHER_CTX_free := nil; + @EVP_CIPHER_CTX_set_key_length := nil; + @EVP_CIPHER_CTX_set_padding := nil; + @EVP_CIPHER_CTX_ctrl := nil; + @EVP_CIPHER_CTX_rand_key := nil; + + @EVP_add_cipher := nil; + @EVP_add_digest := nil; + @EVP_CIPHER_do_all := nil; + @EVP_CIPHER_do_all_sorted := nil; + @EVP_MD_do_all := nil; + @EVP_MD_do_all_sorted := nil; + @EVP_PKEY_decrypt_old := nil; + @EVP_PKEY_encrypt_old := nil; + @EVP_PKEY_type := nil; + @EVP_PKEY_id := nil; + @EVP_PKEY_base_id := nil; + @EVP_PKEY_bits := nil; + @EVP_PKEY_size := nil; + @EVP_PKEY_set_type := nil; + @EVP_PKEY_set_type_str := nil; + @EVP_PKEY_get0 := nil; + {$ifndef OPENSSL_NO_RSA} + @EVP_PKEY_set1_RSA := nil; + @EVP_PKEY_get1_RSA := nil; + {$ENDIF} + {$ifndef OPENSSL_NO_DSA} + @EVP_PKEY_set1_DSA := nil; + @EVP_PKEY_get1_DSA := nil; + {$endif} + {$ifndef OPENSSL_NO_DH} + @EVP_PKEY_set1_DH := nil; + @EVP_PKEY_get1_DH := nil; + {$endif} + {$ifndef OPENSSL_NO_EC} + @EVP_PKEY_set1_EC_KEY := nil; + @EVP_PKEY_get1_EC_KEY := nil; + {$endif} + + {$EXTERNALSYM d2i_PublicKey} + @d2i_PublicKey := nil; + @i2d_PublicKey := nil; + @d2i_AutoPrivateKey := nil; + @EVP_PKEY_copy_parameters := nil; + @EVP_PKEY_missing_parameters := nil; + @EVP_PKEY_save_parameters := nil; + @EVP_PKEY_cmp_parameters := nil; + @EVP_PKEY_cmp := nil; + @EVP_PKEY_print_public := nil; + @EVP_PKEY_print_private := nil; + @EVP_PKEY_print_params := nil; + @EVP_PKEY_get_default_digest_nid := nil; + @EVP_CIPHER_param_to_asn1 := nil; + @EVP_CIPHER_asn1_to_param := nil; + @EVP_CIPHER_set_asn1_iv := nil; + @EVP_CIPHER_get_asn1_iv := nil; + @PKCS5_PBE_keyivgen := nil; + @PKCS5_PBKDF2_HMAC_SHA1 := nil; + @PKCS5_PBKDF2_HMAC := nil; + @PKCS5_v2_PBE_keyivgen := nil; + @PKCS5_PBE_add := nil; + @EVP_PBE_CipherInit := nil; + + @EVP_PBE_alg_add_type := nil; + @EVP_PBE_alg_add := nil; + @EVP_PBE_find := nil; + @EVP_PBE_cleanup := nil; + @EVP_PKEY_asn1_get_count := nil; + @EVP_PKEY_asn1_get0 := nil; + @EVP_PKEY_asn1_find := nil; + @EVP_PKEY_asn1_find_str := nil; + @EVP_PKEY_asn1_add0 := nil; + @EVP_PKEY_asn1_add_alias := nil; + @EVP_PKEY_asn1_get0_info := nil; + @EVP_PKEY_get0_asn1 := nil; + @EVP_PKEY_asn1_new := nil; + @EVP_PKEY_asn1_copy := nil; + @EVP_PKEY_asn1_free := nil; + @EVP_PKEY_asn1_set_public := nil; + @EVP_PKEY_asn1_set_private := nil; + @EVP_PKEY_asn1_set_param := nil; + @EVP_PKEY_asn1_set_free := nil; + @EVP_PKEY_asn1_set_ctrl := nil; + @EVP_PKEY_meth_find := nil; + @EVP_PKEY_meth_new := nil; + @EVP_PKEY_meth_get0_info := nil; + @EVP_PKEY_meth_copy := nil; + @EVP_PKEY_meth_free := nil; + @EVP_PKEY_meth_add0 := nil; + @EVP_PKEY_CTX_new := nil; + @EVP_PKEY_CTX_new_id := nil; + @EVP_PKEY_CTX_dup := nil; + @EVP_PKEY_CTX_free := nil; + @EVP_PKEY_CTX_ctrl := nil; + @EVP_PKEY_CTX_ctrl_str := nil; + @EVP_PKEY_CTX_get_operation := nil; + @EVP_PKEY_CTX_set0_keygen_info := nil; + @EVP_PKEY_new_mac_key := nil; + @EVP_PKEY_CTX_set_data := nil; + @EVP_PKEY_CTX_get_data := nil; + @EVP_PKEY_CTX_get0_pkey := nil; + @EVP_PKEY_CTX_get0_peerkey := nil; + @EVP_PKEY_CTX_set_app_data := nil; + @EVP_PKEY_CTX_get_app_data := nil; + @EVP_PKEY_sign_init := nil; + @EVP_PKEY_sign := nil; + @EVP_PKEY_verify_init := nil; + @EVP_PKEY_verify := nil; + @EVP_PKEY_verify_recover_init := nil; + @EVP_PKEY_verify_recover := nil; + @EVP_PKEY_encrypt_init := nil; + @EVP_PKEY_encrypt := nil; + @EVP_PKEY_decrypt_init := nil; + @EVP_PKEY_decrypt := nil; + @EVP_PKEY_derive_init := nil; + @EVP_PKEY_derive_set_peer := nil; + @EVP_PKEY_derive := nil; + @EVP_PKEY_paramgen_init := nil; + @EVP_PKEY_paramgen := nil; + @EVP_PKEY_keygen_init := nil; + @EVP_PKEY_keygen := nil; + @EVP_PKEY_CTX_set_cb := nil; + @EVP_PKEY_CTX_get_cb := nil; + @EVP_PKEY_CTX_get_keygen_info := nil; + @EVP_PKEY_meth_set_init := nil; + @EVP_PKEY_meth_set_copy := nil; + @EVP_PKEY_meth_set_cleanup := nil; + @EVP_PKEY_meth_set_paramgen := nil; + @EVP_PKEY_meth_set_keygen := nil; + @EVP_PKEY_meth_set_sign := nil; + @EVP_PKEY_meth_set_verify := nil; + @EVP_PKEY_meth_set_verify_recover := nil; + @EVP_PKEY_meth_set_signctx := nil; + @EVP_PKEY_meth_set_verifyctx := nil; + @EVP_PKEY_meth_set_encrypt := nil; + @EVP_PKEY_meth_set_decrypt := nil; + @EVP_PKEY_meth_set_derive := nil; + @EVP_PKEY_meth_set_ctrl := nil; +{$ifndef OPENSSL_NO_BIO} + BIO_f_md := nil; + BIO_f_base64 := nil; + BIO_f_cipher := nil; + BIO_f_reliable := nil; + BIO_set_cipher := nil; +{$endif} + @EVP_PKEY_type := nil; + @EVP_PKEY_new := nil; + @EVP_PKEY_free := nil; + @EVP_PKEY_assign := nil; + @EVP_get_cipherbyname := nil; + @EVP_get_digestbyname := nil; + @EVP_MD_type := nil; + @EVP_MD_size := nil; + @EVP_MD_block_size := nil; + @EVP_MD_flags := nil; + @EVP_MD_CTX_md := nil; + @EVP_CIPHER_nid := nil; + @EVP_CIPHER_block_size := nil; + @EVP_CIPHER_key_length := nil; + @EVP_CIPHER_iv_length := nil; + @EVP_CIPHER_flags := nil; + @EVP_CIPHER_type := nil; + @EVP_CIPHER_CTX_cipher := nil; + @EVP_CIPHER_CTX_nid := nil; + @EVP_CIPHER_CTX_block_size := nil; + @EVP_CIPHER_CTX_key_length := nil; + @EVP_CIPHER_CTX_iv_length := nil; + @EVP_CIPHER_CTX_copy := nil; + @EVP_CIPHER_CTX_get_app_data := nil; + @EVP_CIPHER_CTX_set_app_data := nil; + @EVP_CIPHER_CTX_flags := nil; + + //HMAC +{$IFNDEF OPENSSL_NO_HMAC} + @HMAC_CTX_init := nil; + @_HMAC_Init_ex := nil; + @_HMAC_Update := nil; + @_HMAC_Final := nil; + @_1_0_HMAC_Init_ex := nil; + @_1_0_HMAC_Update := nil; + @_1_0_HMAC_Final := nil; + @HMAC_CTX_cleanup := nil; +{$ENDIF} + //OBJ + @OBJ_obj2nid := nil; + @OBJ_nid2obj := nil; + @OBJ_nid2ln := nil; + @OBJ_nid2sn := nil; + //ASN1 + @ASN1_INTEGER_set := nil; + @ASN1_INTEGER_get := nil; + @ASN1_INTEGER_to_BN := nil; + @ASN1_STRING_type_new := nil; + @ASN1_STRING_free := nil; + @ASN1_dup := nil; + @_CRYPTO_lock := nil; + @CRYPTO_set_mem_functions := nil; + @CRYPTO_malloc := nil; + @CRYPTO_free := nil; + @CRYPTO_mem_leaks := nil; + @CRYPTO_mem_ctrl := nil; + @CRYPTO_set_mem_debug_functions := nil; + //@CRYPTO_dbg_malloc := nil; + //@CRYPTO_dbg_realloc := nil; + //@CRYPTO_dbg_free := nil; + //@CRYPTO_dbg_set_options := nil; + //@CRYPTO_dbg_get_options := nil; + @PKCS12_create := nil; + @i2d_PKCS12_bio := nil; + @PKCS12_free := nil; + @OpenSSL_add_all_algorithms := nil; + @OpenSSL_add_all_ciphers := nil; + @OpenSSL_add_all_digests := nil; + @EVP_cleanup := nil; + @sk_new := nil; + @sk_num := nil; + @sk_new_null := nil; + @sk_free := nil; + @sk_push := nil; + @sk_dup := nil; + @sk_find := nil; + @sk_value := nil; + {$IFDEF OPENSSL_FIPS} + @_FIPS_mode_set := nil; + @_FIPS_mode := nil; + {$ENDIF} + + // TODO: expose a global callback function pointer, or an optional input + // parameter to InitializeFuncPointers(), so users can reset any additional + // OpenSSL function pointers they loaded manually during Load()... + { + if Assigned(UnloadSSLFuncsCallback) then begin + UnloadSSLFuncsCallback(); + end; + } +end; + +procedure Unload; +var + LStack: Pointer; +begin + if {$IFDEF STATICLOAD_OPENSSL}bIsLoaded{$ELSE}hIdSSL <> IdNilHandle{$ENDIF} then begin + if Assigned(SSL_COMP_free_compression_methods) then begin + SSL_COMP_free_compression_methods; + end + //this is a workaround for a known leak in the openssl library + //present in 0.9.8a + else if Assigned(SSLeay) then begin + if SSLeay = $0090801f then begin + if Assigned(SSL_COMP_get_compression_methods) and + Assigned(sk_pop_free) and + Assigned(CRYPTO_free) then + begin + LStack := SSL_COMP_get_compression_methods; + sk_pop_free(LStack, CRYPTO_free); + end; + end; + end; + if Assigned(CRYPTO_cleanup_all_ex_data) then begin + CRYPTO_cleanup_all_ex_data; + end; + if Assigned(ERR_free_strings) then begin + ERR_free_strings; + end; + if Assigned(ERR_remove_thread_state) then begin + ERR_remove_thread_state(nil); + end + else if Assigned(ERR_remove_state) then begin + ERR_remove_state(0); + end; + if Assigned(EVP_cleanup) then begin + EVP_cleanup; + end; + {$IFDEF STATICLOAD_OPENSSL} + bIsLoaded := False; + {$ELSE} + {$IFDEF WINDOWS}Windows.{$ENDIF}FreeLibrary(hIdSSL); + hIdSSL := IdNilHandle; + {$ENDIF} + end; + + {$IFNDEF STATICLOAD_OPENSSL} + if hIdCrypto <> IdNilHandle then begin + {$IFDEF WINDOWS}Windows.{$ENDIF}FreeLibrary(hIdCrypto); + hIdCrypto := IdNilHandle; + end; + {$ENDIF} + + {$IFDEF USE_INVALIDATE_MOD_CACHE} + InvalidateModuleCache; + {$ENDIF} + + {$IFNDEF STATICLOAD_OPENSSL} + { + IMPORTANT!! + + We probably should reinitialize the functions to nil after the library is + unloaded as some code will test for their presence with Assigned. + } + InitializeFuncPointers; + {$ENDIF} +end; + + +{$IFNDEF STATICLOAD_OPENSSL} +function WhichFailedToLoad: string; +begin + Assert(FFailedLoadList<>nil); + Result := FFailedLoadList.CommaText; +end; +{$ENDIF} + +// Author : Gregor Ibich (gregor.ibic@intelicom.si) +// Pascal translation: Doychin Bondzhev (doichin@5group.com) + +// Converts the following string representations into corresponding parts +// YYYYMMDDHHMMSS(+|-)HH( )MM (GeneralizedTime, for dates 2050 and later) +// YYMMDDHHMMSS(+|-)HH( )MM (UTCTime, for dates up to 2049) +function UTC_Time_Decode(UCTtime : PASN1_UTCTIME; var year, month, day, hour, min, sec: Word; + var tz_hour, tz_min: Integer): Integer; +var + i, tz_dir, index: Integer; + time_str: string; + {$IFNDEF USE_MARSHALLED_PTRS} + {$IFNDEF STRING_IS_ANSI} + LTemp: AnsiString; + {$ENDIF} + {$ENDIF} +begin + Result := 0; + if UCTtime^.length < 12 then begin + Exit; + end; + {$IFDEF USE_MARSHALLED_PTRS} + time_str := TMarshal.ReadStringAsAnsi(TPtrWrapper.Create(UCTtime^.data), UCTtime^.length); + {$ELSE} + {$IFDEF STRING_IS_ANSI} + SetString(time_str, UCTtime^.data, UCTtime^.length); + {$ELSE} + SetString(LTemp, UCTtime^.data, UCTtime^.length); + // TODO: do we need to use SetCodePage() here? + time_str := String(LTemp); // explicit convert to Unicode + {$ENDIF} + {$ENDIF} + // Check if first 14 chars (4-digit year) are numbers + if (Length(time_str) >= 14) and IsNumeric(time_str, 14) then begin + // Convert time from string to number + year := IndyStrToInt(Copy(time_str, 1, 4)); + month := IndyStrToInt(Copy(time_str, 5, 2)); + day := IndyStrToInt(Copy(time_str, 7, 2)); + hour := IndyStrToInt(Copy(time_str, 9, 2)); + min := IndyStrToInt(Copy(time_str, 11, 2)); + sec := IndyStrToInt(Copy(time_str, 13, 2)); + index := 15; + end + // Check if first 12 chars (2-digit year) are numbers + else if (Length(time_str) >= 12) and IsNumeric(time_str, 12) then begin + // Convert time from string to number + year := IndyStrToInt(Copy(time_str, 1, 2)) + 1900; + month := IndyStrToInt(Copy(time_str, 3, 2)); + day := IndyStrToInt(Copy(time_str, 5, 2)); + hour := IndyStrToInt(Copy(time_str, 7, 2)); + min := IndyStrToInt(Copy(time_str, 9, 2)); + sec := IndyStrToInt(Copy(time_str, 11, 2)); + // Fix year. This function is Y2k but isn't compatible with Y2k5 :-( {Do not Localize} + if year < 1950 then begin + Inc(year, 100); + end; + index := 13; + end else begin + Exit; + end; + // Check TZ + tz_hour := 0; + tz_min := 0; + if CharIsInSet(time_str, index, '-+') then begin {Do not Localize} + tz_dir := iif(CharEquals(time_str, index, '-'), -1, 1); {Do not Localize} + for i := index+1 to index+5 do begin // Check if numbers are numbers + if i = index+3 then begin + Continue; + end; + if not IsNumeric(time_str[i]) then begin + Exit; + end; + end; + tz_hour := IndyStrToInt(Copy(time_str, index+1, 2)) * tz_dir; + tz_min := IndyStrToInt(Copy(time_str, index+4, 2)) * tz_dir; + end; + Result := 1; +end; + +function SSL_set_app_data(s: PSSL; arg: Pointer): TIdC_INT; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := SSL_set_ex_data(s, 0, arg); +end; + +function SSL_get_app_data(s: PSSL): Pointer; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := SSL_get_ex_data(s, 0); +end; + +procedure InitializeRandom; +begin + {$IFDEF SYS_WIN} + if Assigned(_RAND_screen) then begin + _RAND_screen; + end; + {$ENDIF} +end; + +procedure CleanupRandom; +begin + if Assigned(_RAND_cleanup) then begin + _RAND_cleanup; + end; +end; + +function M_ASN1_STRING_length(x : PASN1_STRING): TIdC_INT; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := x^.length; +end; + +procedure M_ASN1_STRING_length_set(x : PASN1_STRING; n : TIdC_INT); +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + x^.length := n; +end; + +function M_ASN1_STRING_type(x : PASN1_STRING) : TIdC_INT; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := x^._type; +end; + +function M_ASN1_STRING_data(x : PASN1_STRING) : PIdAnsiChar; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := x^.data; +end; + +function X509_NAME_dup(xn : PX509_NAME) : PX509_NAME; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := ASN1_dup(i2d_of_Void(i2d_X509_NAME), d2i_of_void(d2i_X509_NAME), PIdAnsiChar(xn) ); +end; + +function X509_STORE_CTX_get_app_data(ctx: PX509_STORE_CTX):Pointer; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + // TODO: use SSL_get_ex_data_X509_STORE_CTX_idx() instead of 0 to get the true index of the SSL pointer + Result := X509_STORE_CTX_get_ex_data(ctx, 0); +end; + +function X509_get_version(x : PX509): TIdC_LONG; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := ASN1_INTEGER_get(x^.cert_info^.version); +end; + +function X509_get_signature_type(x : PX509) : TIdC_INT; +{$IFDEF USE_INLINE} inline; {$ENDIF} +{ +http://groups.google.com/group/mailing.openssl.dev/browse_thread/thread/c1ab56fc4fb7af6a/98a2e94fe893aecf?lnk=st&q=X509_get_signature_type+&rnum=1&hl=en#98a2e94fe893aecf + +Austin Krauss via RT wrote: + +> D:\openssl-0.9.7b\out32dll\Release>openssl version -a +> OpenSSL 0.9.7b 10 Apr 2003 +> built on: date not available +> platform: information not available +> options: bn(64,32) md2(int) rc4(idx,int) des(idx,cisc,4,long) idea(int) blowfish(idx) +> compiler: information not available +> OPENSSLDIR: "/usr/local/ssl" + +> Windows 2000 SP3 x86 +> Visual C++ 6.0 SP5 + +> I'm running into a problem parsing the certificate that I've recieved from the peer. I'm trying to call X509_get_signature_type(...) to get the key algorithm used. After I went through this function with the debugger, I'm finding that "NID_sha1WithRSAEncryption" (which is correct by the way) is getting passed to EVP_PKEY_type(...). It seems as if there is not a EVP constant that maps to this particular NID and thus EVP_PKEY_type is returning NID_undef to my function. + +As a addition to: +http://marc.theaimsgroup.com/?l=openssl-users&m=105074607225189&w=2 +I would suggest that X509_get_signature_type(x) should +be changed to 'OBJ_obj2nid((x)->sig_alg->algorithm' (i.e. remove +the call to EVP_PKEY_type()) because currently this macro +returns the type of the key used for the signature generation +and *not* the type of the signature (i.e. key alg + hash alg). +The other solution would be to change EVP_PKEY_type() to +include the other RSA OIDs as well (from the usage of this macro +in OpenSSL the second alternative is simpler to implement, but +in this case the name of the macro should better be changed to +X509_get_signature_key_type() :-). + +Regards, +Nils +} +begin + Assert(x<>nil); + Result := EVP_PKEY_type(OBJ_obj2nid(x.sig_alg.algorithm)); +end; + +function X509_REQ_get_subject_name(x:PX509_REQ):PX509_NAME; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Assert(x<>nil); + Result := x^.req_info^.subject; +end; + +//function X509_get_notBefore(x509: PX509):PASN1_UTCTIME; +function X509_get_notBefore(x509: PX509):PASN1_TIME; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Assert(x509<>nil); + Result := x509.cert_info.validity.notBefore; +end; + +//function X509_get_notAfter(x509: PX509):PASN1_UTCTIME; +function X509_get_notAfter(x509: PX509):PASN1_TIME; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Assert(x509<>nil); + Result := x509.cert_info.validity.notAfter; +end; + +function X509_REQ_get_version(x : PX509_REQ): TIdC_LONG; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := ASN1_INTEGER_get(x^.req_info^.version); +end; + +function X509_CRL_get_version(x : PX509_CRL) : TIdC_LONG; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := ASN1_INTEGER_get(x^.crl^.version); +end; + +function X509_CRL_get_lastUpdate(x : PX509_CRL) : PASN1_TIME; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := x^.crl^.lastUpdate; +end; + +function X509_CRL_get_nextUpdate(x : PX509_CRL) : PASN1_TIME; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := x^.crl^.nextUpdate; +end; + +function X509_CRL_get_issuer(x : PX509_CRL) : PX509_NAME; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := x^.crl^.issuer +end; + +function X509_CRL_get_REVOKED(x : PX509_CRL) : PSTACK_OF_X509_REVOKED; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := x^.crl^.revoked; +end; + +procedure SSL_CTX_set_info_callback(ctx: PSSL_CTX; cb: PSSL_CTX_info_callback); +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Assert(ctx<>nil); + ctx.info_callback := cb; +end; + +//* Note: SSL[_CTX]_set_{options,mode} use |= op on the previous value, +// * they cannot be used to clear bits. */ + +function SSL_CTX_set_options(ctx: PSSL_CTX; op: TIdC_LONG):TIdC_LONG; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := SSL_CTX_ctrl(ctx, SSL_CTRL_OPTIONS, op, nil); +end; + +function SSL_CTX_clear_options(ctx : PSSL_CTX; op : TIdC_LONG):TIdC_LONG; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := SSL_CTX_ctrl(ctx,SSL_CTRL_CLEAR_OPTIONS,op,nil); +end; + +function SSL_CTX_get_options(ctx: PSSL_CTX) : TIdC_LONG; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := SSL_CTX_ctrl(ctx, SSL_CTRL_OPTIONS,0,nil); +end; + +function SSL_set_options(ssl: PSSL; op : TIdC_LONG): TIdC_LONG; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := SSL_ctrl(ssl, SSL_CTRL_OPTIONS,op,nil); +end; + +function SSL_clear_mode(ssl : PSSL; op : TIdC_LONG) : TIdC_LONG; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := SSL_ctrl(ssl,SSL_CTRL_CLEAR_MODE,op,nil); +end; + +function SSL_get_options(ssl : PSSL): TIdC_LONG; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := SSL_ctrl(ssl, SSL_CTRL_OPTIONS,0,nil); +end; + +function SSL_CTX_set_mode(ctx : PSSL_CTX; op : TIdC_LONG) : TIdC_LONG; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := SSL_CTX_ctrl(ctx, SSL_CTRL_MODE, op,nil); +end; + +function SSL_CTX_clear_mode(ctx : PSSL_CTX; op : TIdC_LONG) : TIdC_LONG; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := SSL_CTX_ctrl(ctx,SSL_CTRL_CLEAR_MODE,op,nil); +end; + +function SSL_CTX_get_mode(ctx : PSSL_CTX) : TIdC_LONG; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := SSL_CTX_ctrl(ctx, SSL_CTRL_MODE,0,nil); +end; + +function SSL_set_mtu(ssl : PSSL; mtu : TIdC_LONG) : TIdC_LONG; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := SSL_ctrl(ssl, SSL_CTRL_SET_MTU, mtu, nil); +end; + +function SSL_get_secure_renegotiation_support(ssl : PSSL) : TIdC_LONG; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := SSL_ctrl(ssl, SSL_CTRL_GET_RI_SUPPORT, 0, nil); +end; +// + +function SSL_CTX_sess_number(ctx : PSSL_CTX) : TIdC_LONG; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := SSL_CTX_ctrl(ctx, SSL_CTRL_SESS_NUMBER,0,nil); +end; + +function SSL_CTX_sess_connect(ctx : PSSL_CTX) : TIdC_LONG; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := SSL_CTX_ctrl(ctx, SSL_CTRL_SESS_CONNECT, 0,nil); +end; + +function SSL_CTX_sess_connect_good(ctx : PSSL_CTX): TIdC_LONG; + {$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := SSL_CTX_ctrl(ctx, SSL_CTRL_SESS_CONNECT_GOOD, 0, nil); +end; + +function SSL_CTX_sess_connect_renegotiate(ctx : PSSL_CTX): TIdC_LONG; + {$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := SSL_CTX_ctrl(ctx, SSL_CTRL_SESS_CONNECT_RENEGOTIATE, 0, nil); +end; + +function SSL_CTX_sess_accept(ctx : PSSL_CTX) : TIdC_LONG; + {$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := SSL_CTX_ctrl(ctx, SSL_CTRL_SESS_ACCEPT, 0, nil); +end; + +function SSL_CTX_sess_accept_renegotiate(ctx : PSSL_CTX) : TIdC_LONG; + {$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := SSL_CTX_ctrl(ctx, SSL_CTRL_SESS_ACCEPT_RENEGOTIATE, 0, nil); +end; + +function SSL_CTX_sess_accept_good(ctx : PSSL_CTX) : TIdC_LONG; + {$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := SSL_CTX_ctrl(ctx, SSL_CTRL_SESS_ACCEPT_GOOD, 0, nil); +end; + +function SSL_CTX_sess_hits(ctx : PSSL_CTX) : TIdC_LONG; + {$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := SSL_CTX_ctrl(ctx, SSL_CTRL_SESS_HIT, 0, nil); +end; + +function SSL_CTX_sess_cb_hits(ctx : PSSL_CTX) : TIdC_LONG; + {$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := SSL_CTX_ctrl(ctx, SSL_CTRL_SESS_CB_HIT, 0, nil); +end; + +function SSL_CTX_sess_misses(ctx : PSSL_CTX) : TIdC_LONG; + {$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := SSL_CTX_ctrl(ctx, SSL_CTRL_SESS_MISSES, 0, nil); +end; + +function SSL_CTX_sess_timeouts(ctx : PSSL_CTX) : TIdC_LONG; + {$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := SSL_CTX_ctrl(ctx, SSL_CTRL_SESS_TIMEOUTS, 0, nil); +end; + +function SSL_CTX_sess_cache_full(ctx : PSSL_CTX) : TIdC_LONG; + {$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := SSL_CTX_ctrl(ctx, SSL_CTRL_SESS_CACHE_FULL, 0, nil); +end; + +function SSL_CTX_sess_set_cache_size(ctx : PSSL_CTX; t : TIdC_LONG) : TIdC_LONG; + {$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := SSL_CTX_ctrl(ctx, SSL_CTRL_SET_SESS_CACHE_SIZE, t, nil); +end; + +function SSL_CTX_sess_get_cache_size(ctx : PSSL_CTX) : TIdC_LONG; + {$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := SSL_CTX_ctrl(ctx, SSL_CTRL_GET_SESS_CACHE_SIZE, 0, nil); +end; + +function SSL_CTX_set_session_cache_mode(ctx : PSSL_CTX; m : TIdC_LONG) : TIdC_LONG; + {$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := SSL_CTX_ctrl(ctx, SSL_CTRL_SET_SESS_CACHE_MODE, m, nil); +end; + +function SSL_CTX_get_session_cache_mode(ctx : PSSL_CTX) : TIdC_LONG; + {$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := SSL_CTX_ctrl(ctx, SSL_CTRL_GET_SESS_CACHE_MODE, 0, nil); +end; + +function SSL_CTX_get_read_ahead(ctx : PSSL_CTX) : TIdC_LONG; + {$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := SSL_CTX_ctrl(ctx, SSL_CTRL_GET_READ_AHEAD,0,nil); +end; + +function SSL_CTX_set_read_ahead(ctx : PSSL_CTX; m : TIdC_LONG) : TIdC_LONG; + {$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := SSL_CTX_ctrl(ctx, SSL_CTRL_SET_READ_AHEAD, m,nil); +end; + +function SSL_CTX_get_max_cert_list(ctx : PSSL_CTX) : TIdC_LONG; + {$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := SSL_CTX_ctrl(ctx, SSL_CTRL_GET_MAX_CERT_LIST,0,nil); +end; + +function SSL_CTX_set_max_cert_list(ctx : PSSL_CTX; m : TIdC_LONG) : TIdC_LONG; + {$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := SSL_CTX_ctrl(ctx, SSL_CTRL_GET_MAX_CERT_LIST,m,nil); +end; + +function SSL_get_max_cert_list(ssl : PSSL) : TIdC_LONG; + {$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := SSL_ctrl(ssl, SSL_CTRL_GET_MAX_CERT_LIST, 0, nil); +end; + +function SSL_set_max_cert_list(ssl : PSSL; m : TIdC_LONG) : TIdC_LONG; + {$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := SSL_ctrl(ssl, SSL_CTRL_SET_MAX_CERT_LIST, m, nil); +end; + +function SSL_CTX_set_max_send_fragment(ctx : PSSL_CTX; m : TIdC_LONG) : TIdC_LONG; + {$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := SSL_CTX_ctrl(ctx,SSL_CTRL_SET_MAX_SEND_FRAGMENT,m,nil); +end; + +function SSL_set_max_send_fragment(ssl : PSSL; m : TIdC_LONG) : TIdC_LONG; + {$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := SSL_ctrl(ssl,SSL_CTRL_SET_MAX_SEND_FRAGMENT,m,nil); +end; + +function DTLSv1_get_timeout(ssl : PSSL; var arg : timeval) : TIdC_LONG; + {$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := SSL_ctrl(ssl,DTLS_CTRL_GET_TIMEOUT,0, @arg); +end; + +function DTLSv1_handle_timeout(ssl : PSSL) : TIdC_LONG; + {$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := SSL_ctrl(ssl,DTLS_CTRL_HANDLE_TIMEOUT,0, nil); +end; + +function DTLSv1_listen(ssl : PSSL; var peer : sockaddr) : TIdC_LONG; + {$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := SSL_ctrl(ssl,DTLS_CTRL_LISTEN,0, @peer); +end; + +function SSL_session_reused(ssl : PSSL) : TIdC_LONG; + {$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := SSL_ctrl(ssl,SSL_CTRL_GET_SESSION_REUSED,0,nil); +end; + +function SSL_num_renegotiations(ssl : PSSL) : TIdC_LONG; + {$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := SSL_ctrl(ssl,SSL_CTRL_GET_NUM_RENEGOTIATIONS,0,nil); +end; + +function SSL_clear_num_renegotiations(ssl : PSSL) : TIdC_LONG; + {$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := SSL_ctrl(ssl,SSL_CTRL_CLEAR_NUM_RENEGOTIATIONS,0,nil); +end; + +function SSL_total_renegotiations(ssl : PSSL) : TIdC_LONG; + {$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := SSL_ctrl(ssl,SSL_CTRL_GET_TOTAL_RENEGOTIATIONS,0,nil); +end; + +function SSL_CTX_need_tmp_RSA(ctx : PSSL_CTX) : TIdC_LONG; + {$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := SSL_CTX_ctrl(ctx,SSL_CTRL_NEED_TMP_RSA,0,nil); +end; + +function SSL_CTX_set_tmp_rsa(ctx : PSSL_CTX; rsa : PRSA) : TIdC_LONG; + {$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := SSL_CTX_ctrl(ctx,SSL_CTRL_SET_TMP_RSA,0,rsa); +end; + +function SSL_CTX_set_tmp_dh(ctx : PSSL_CTX; dh : PDH) : TIdC_LONG; + {$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := SSL_CTX_ctrl(ctx,SSL_CTRL_SET_TMP_DH,0,dh); +end; + +function SSL_CTX_set_tmp_ecdh(ctx : PSSL_CTX; ecdh : PEC_KEY) : TIdC_LONG; + {$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := SSL_CTX_ctrl(ctx,SSL_CTRL_SET_TMP_ECDH,0,ecdh); +end; + +function SSL_CTX_set_ecdh_auto(ctx : PSSL_CTX; m : TIdC_LONG) : TIdC_LONG; + {$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := SSL_CTX_ctrl(ctx,SSL_CTRL_SET_ECDH_AUTO,m,nil); +end; + +function SSL_need_tmp_RSA(ssl : PSSL) : TIdC_LONG; + {$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := SSL_ctrl(ssl,SSL_CTRL_NEED_TMP_RSA,0,nil); +end; + +procedure SSL_set_tmp_rsa(ssl : PSSL; rsa : PRSA); + {$IFDEF USE_INLINE} inline; {$ENDIF} +begin + SSL_ctrl(ssl,SSL_CTRL_SET_TMP_RSA,0,rsa); +end; + +function SSL_set_tmp_dh(ssl : PSSL;dh : PDH) : TIdC_LONG; + {$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := SSL_ctrl(ssl,SSL_CTRL_SET_TMP_DH,0,dh); +end; + +function SSL_set_tmp_ecdh(ssl : PSSL; ecdh : PEC_KEY) : TIdC_LONG; + {$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := SSL_ctrl(ssl,SSL_CTRL_SET_TMP_ECDH,0,ecdh); +end; + +{$IFNDEF OPENSSL_NO_TLSEXT} +function SSL_set_tlsext_host_name(s : PSSL; name : string) : TIdC_LONG; + {$IFDEF USE_INLINE} inline; {$ENDIF} +{$IFDEF USE_MARSHALLED_PTRS} +var + M: TMarshaller; +{$ENDIF} +begin + Result := SSL_ctrl(s, SSL_CTRL_SET_TLSEXT_HOSTNAME, TLSEXT_NAMETYPE_host_name, + {$IFDEF USE_MARSHALLED_PTRS} + M.AsAnsi(name).ToPointer + {$ELSE} + PAnsiChar( + {$IFDEF STRING_IS_ANSI} + name + {$ELSE} + AnsiString(name) // explicit convert to Ansi + {$ENDIF} + ) + {$ENDIF} + ); +end; + +function SSL_set_tlsext_debug_callback(ssl : PSSL; cb : SSL_callback_ctrl_fp) : TIdC_LONG; + {$IFDEF USE_INLINE} inline; {$ENDIF} +begin + if Assigned(SSL_callback_ctrl) then begin + Result := SSL_callback_ctrl(ssl,SSL_CTRL_SET_TLSEXT_DEBUG_CB,cb); + end else begin + Result := ssl.method.ssl_callback_ctrl(ssl, SSL_CTRL_SET_TLSEXT_DEBUG_CB, SSL_METHOD_PROC(cb)); + end; +end; + +function SSL_set_tlsext_debug_arg(ssl : PSSL; arg : Pointer) : TIdC_LONG; + {$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := SSL_ctrl(ssl, SSL_CTRL_SET_TLSEXT_DEBUG_ARG,0,arg); +end; + +function SSL_set_tlsext_status_type(ssl : PSSL; _type : TIdC_LONG):TIdC_LONG; + {$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := SSL_ctrl(ssl, SSL_CTRL_SET_TLSEXT_STATUS_REQ_TYPE,_type,nil); +end; + +function SSL_get_tlsext_status_exts(ssl : PSSL; arg : Pointer): TIdC_LONG; + {$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := SSL_ctrl(ssl, SSL_CTRL_GET_TLSEXT_STATUS_REQ_EXTS,0,arg); +end; + +function SSL_set_tlsext_status_exts(ssl : PSSL; arg : Pointer):TIdC_LONG; + {$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := SSL_ctrl(ssl, SSL_CTRL_SET_TLSEXT_STATUS_REQ_EXTS, 0, arg); +end; + +function SSL_get_tlsext_status_ids(ssl : PSSL; arg : Pointer) : TIdC_LONG; + {$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := SSL_ctrl(ssl, SSL_CTRL_GET_TLSEXT_STATUS_REQ_IDS,0, arg); +end; + +function SSL_set_tlsext_status_ids(ssl : PSSL; arg : Pointer) : TIdC_LONG; + {$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := SSL_ctrl(ssl, SSL_CTRL_SET_TLSEXT_STATUS_REQ_IDS,0,arg); +end; + +function SSL_get_tlsext_status_ocsp_resp(ssl : PSSL; arg : Pointer) : TIdC_LONG; + {$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := SSL_ctrl(ssl, SSL_CTRL_GET_TLSEXT_STATUS_REQ_OCSP_RESP,0,arg); +end; + +function SSL_set_tlsext_status_ocsp_resp(ssl : PSSL; arg : Pointer; arglen : TIdC_LONG) : TIdC_LONG; + {$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := SSL_ctrl(ssl, SSL_CTRL_SET_TLSEXT_STATUS_REQ_OCSP_RESP,arglen,arg); +end; + +function SSL_CTX_set_tlsext_servername_callback(ctx : PSSL_CTX; cb :SSL_callback_ctrl_fp):TIdC_LONG; + {$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := SSL_CTX_callback_ctrl(ctx, SSL_CTRL_SET_TLSEXT_SERVERNAME_CB, cb); +end; + +function SSL_CTX_get_tlsext_ticket_keys(ctx : PSSL_CTX; keys : PIdAnsiChar; keylen : TIdC_LONG ) : TIdC_LONG; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := SSL_CTX_ctrl(ctx,SSL_CTRL_GET_TLSEXT_TICKET_KEYS, keylen, keys); +end; + +function SSL_CTX_set_tlsext_status_cb(ssl : PSSL_CTX; cb : TSSL_CTX_set_tlsext_status_cb) :TIdC_LONG; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := SSL_CTX_callback_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB,SSL_callback_ctrl_fp(cb)); +end; + +function SSL_set_tlsext_opaque_prf_input(s : PSSL; src : PIdAnsiChar; len : TIdC_LONG ) : TIdC_LONG; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := SSL_ctrl(s,SSL_CTRL_SET_TLSEXT_OPAQUE_PRF_INPUT, len, src) +end; + +function SSL_CTX_set_tlsext_opaque_prf_input_callback(ctx : PSSL_CTX; cb : TSSL_CTX_set_tlsext_opaque_prf_input_callback_cb) : TIdC_LONG; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := SSL_CTX_callback_ctrl(ctx,SSL_CTRL_SET_TLSEXT_OPAQUE_PRF_INPUT_CB, SSL_callback_ctrl_fp(cb)); +end; + +function SSL_CTX_set_tlsext_opaque_prf_input_callback_arg(ctx : PSSL_CTX; arg : Pointer) : TIdC_LONG; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := SSL_CTX_ctrl(ctx,SSL_CTRL_SET_TLSEXT_OPAQUE_PRF_INPUT_CB_ARG, 0, arg); +end; + +function SSL_CTX_set_tlsext_ticket_key_cb(ssl : PSSL_CTX; cb : TSSL_CTX_set_tlsext_ticket_key_cb_fp) : TIdC_LONG; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := SSL_CTX_callback_ctrl(ssl,SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB,SSL_callback_ctrl_fp(cb)); +end; + +function SSL_CTX_add_extra_chain_cert(ctx : PSSL_CTX; x509 : PX509) : TIdC_LONG; + {$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := SSL_CTX_ctrl(ctx,SSL_CTRL_EXTRA_CHAIN_CERT,0,x509); +end; + +function SSL_CTX_get_extra_chain_certs(ctx : PSSL_CTX; var px509 : px509) : TIdC_LONG; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := SSL_CTX_ctrl(ctx,SSL_CTRL_GET_EXTRA_CHAIN_CERTS,0,px509); +end; + +function SSL_CTX_get_extra_chain_certs_only(ctx: PSSL_CTX;var PX509 :PX509) : TIdC_LONG; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := SSL_CTX_ctrl(ctx,SSL_CTRL_GET_EXTRA_CHAIN_CERTS,1,px509); +end; + +function SSL_CTX_clear_extra_chain_certs(ctx : PSSL_CTX) : TIdC_LONG; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := SSL_CTX_ctrl(ctx,SSL_CTRL_CLEAR_EXTRA_CHAIN_CERTS,0,nil); +end; + +function SSL_CTX_set0_chain(ctx:PSSL_CTX; sk : PSTACK_OF_X509) : TIdC_LONG; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := SSL_CTX_ctrl(ctx,SSL_CTRL_CHAIN,0,sk); +end; + +function SSL_CTX_set1_chain(ctx:PSSL_CTX; sk : PSTACK_OF_X509) : TIdC_LONG; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := SSL_CTX_ctrl(ctx,SSL_CTRL_CHAIN,1,sk); +end; + +function SSL_CTX_add0_chain_cert(ctx : PSSL_CTX; x509 : PX509) : TIdC_LONG; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := SSL_CTX_ctrl(ctx,SSL_CTRL_CHAIN_CERT,0,x509); +end; + +function SSL_CTX_add1_chain_cert(ctx : PSSL_CTX; x509 : PX509) : TIdC_LONG; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := SSL_CTX_ctrl(ctx,SSL_CTRL_CHAIN_CERT,1,x509); +end; + +function SSL_CTX_get0_chain_certs(ctx :PSSL_CTX; var px509 :PX509) : TIdC_LONG; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := SSL_CTX_ctrl(ctx,SSL_CTRL_GET_CHAIN_CERTS,0,px509) +end; + +function SSL_CTX_clear_chain_certs(ctx :PSSL_CTX) : TIdC_LONG; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := SSL_CTX_set0_chain(ctx,nil); +end; + +{$ifndef OPENSSL_NO_HEARTBEATS} +function SSL_heartbeat(ssl : PSSL) : TIdC_LONG; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := SSL_ctrl(ssl,SSL_CTRL_TLS_EXT_SEND_HEARTBEAT,0,nil); +end; + +function SSL_get_tlsext_heartbeat_pending(ssl : PSSL) : TIdC_LONG; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := SSL_ctrl(ssl,SSL_CTRL_GET_TLS_EXT_HEARTBEAT_PENDING,0,nil); +end; + +function SSL_set_tlsext_heartbeat_no_requests(ssl : PSSL; arg : TIdC_LONG) : TIdC_LONG; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := SSL_ctrl(ssl,SSL_CTRL_SET_TLS_EXT_HEARTBEAT_NO_REQUESTS,arg,nil); +end; +{$endif} +{$ENDIF} + +function TLS1_get_version(s : PSSL) : TIdC_INT; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + if (s.version shr 8) = TLS1_VERSION_MAJOR then + Result := s.version + else + Result := 0; +end; + +function TLS1_get_client_version(s : PSSL) : TIdC_INT; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + if s.client_version shr 8 = TLS1_VERSION_MAJOR then + Result := s.client_version + else + Result := 0; +end; + +function SSL_CTX_get_version(ctx: PSSL_CTX):TIdC_INT; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Assert(ctx<>nil); + Result := ctx^.method^.version; +end; + +//* BIO_s_connect() and BIO_s_socks4a_connect() */ + +function BIO_set_conn_hostname(b : PBIO; name : PIdAnsiChar) : TIdC_LONG; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := BIO_ctrl(b,BIO_C_SET_CONNECT,0,name); +end; + +function BIO_set_conn_port(b : PBIO; port : PIdAnsiChar) : TIdC_LONG; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := BIO_ctrl(b,BIO_C_SET_CONNECT,1,port); +end; + +function BIO_set_conn_ip(b : PBIO; ip : PIdAnsiChar) : TIdC_LONG; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := BIO_ctrl(b,BIO_C_SET_CONNECT,2,ip); +end; + +function BIO_set_conn_int_port(b : PBIO; port : PIdAnsiChar) : TIdC_LONG; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := BIO_ctrl(b,BIO_C_SET_CONNECT,3,port); +end; + +function BIO_get_conn_hostname(b : PBIO) : PIdAnsiChar; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,0); +end; + +function BIO_get_conn_port(b : PBIO) : PIdAnsiChar; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,1); +end; + +function BIO_get_conn_ip(b : PBIO) : PIdAnsiChar; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,2); +end; + +function BIO_get_conn_int_port(b : PBIO) : TIdC_LONG; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := BIO_int_ctrl(b,BIO_C_GET_CONNECT,3,0); +end; + +function BIO_set_nbio(b : PBIO; n : TIdC_LONG) : TIdC_LONG; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := BIO_ctrl(b,BIO_C_SET_NBIO,n,nil); +end; + +//* BIO_s_accept_socket() */ +function BIO_set_accept_port(b : PBIO; name : PIdAnsiChar) : TIdC_LONG; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := BIO_ctrl(b,BIO_C_SET_ACCEPT,0,name); +end; + +function BIO_get_accept_port(b : PBIO) : PIdAnsiChar; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := BIO_ptr_ctrl(b,BIO_C_GET_ACCEPT,0); +end; + +//* #define BIO_set_nbio(b,n) BIO_ctrl(b,BIO_C_SET_NBIO,(n),NULL) */ +function BIO_set_nbio_accept(b : PBIO; n : TIdC_INT) : TIdC_LONG; +{$IFDEF USE_INLINE} inline; {$ENDIF} +var + a: array[0..1] of TIdAnsiChar; +begin + if n <> 0 then begin + a[0] := TIdAnsiChar('a'); + a[1] := TIdAnsiChar(#0); + Result := BIO_ctrl(b, BIO_C_SET_ACCEPT, 1, @a[0]); + end else begin + Result := BIO_ctrl(b, BIO_C_SET_ACCEPT, 1, nil); + end; +end; + +function BIO_set_accept_bios(b : PBIO; bio : PBIO) : TIdC_LONG; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := BIO_ctrl(b,BIO_C_SET_ACCEPT, 2, bio); +end; + +function BIO_set_bind_mode(b : PBIO; mode : TIdC_LONG) : TIdC_LONG; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := BIO_ctrl(b,BIO_C_SET_BIND_MODE,mode,nil); +end; + +function BIO_get_bind_mode(b : PBIO; mode : TIdC_LONG) : TIdC_LONG; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := BIO_ctrl(b,BIO_C_GET_BIND_MODE,0,nil); +end; + +function BIO_do_handshake(b : PBIO) : TIdC_LONG; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := BIO_ctrl(b,BIO_C_DO_STATE_MACHINE,0,nil); +end; + +function BIO_do_connect(b : PBIO) : TIdC_LONG; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := BIO_do_handshake(b); +end; + +function BIO_do_accept(b : PBIO) : TIdC_LONG; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := BIO_do_handshake(b) +end; + +//* BIO_s_proxy_client() */ +function BIO_set_url(b : PBIO; url : PIdAnsiChar) : TIdC_LONG; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := BIO_ctrl(b, BIO_C_SET_PROXY_PARAM,0,url); +end; + +function BIO_set_proxies(b : PBIO; p : PIdAnsiChar) : TIdC_LONG; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := BIO_ctrl(b,BIO_C_SET_PROXY_PARAM,1,p); +end; + +//* BIO_set_nbio(b,n) */ +function BIO_set_filter_bio(b : PBIO; s : PIdAnsiChar) : TIdC_LONG; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := BIO_ctrl(b,BIO_C_SET_PROXY_PARAM,2,s); +end; + +//* BIO *BIO_get_filter_bio(BIO *bio); */ +//function BIO_set_proxy_cb(b : PBIO,cb) : TIdC_LONG; +//begin +//BIO_callback_ctrl(b,BIO_C_SET_PROXY_PARAM,3,(void *(*cb)())) +//end; + +function BIO_set_proxy_header(b : PBIO; sk : PIdAnsiChar) : TIdC_LONG; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := BIO_ctrl(b,BIO_C_SET_PROXY_PARAM,4,sk); +end; + +function BIO_set_no_connect_return(b : PBIO; b2 : TIdC_LONG) : TIdC_LONG; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := BIO_int_ctrl(b,BIO_C_SET_PROXY_PARAM,5,b2); +end; + +function BIO_get_proxy_header(b : PBIO; var skp : PIdAnsiChar) : TIdC_LONG; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := BIO_ctrl(b,BIO_C_GET_PROXY_PARAM,0,@skp); +end; + +function BIO_get_proxies(b : PBIO; var pxy_p : PIdAnsiChar) : TIdC_LONG; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := BIO_ctrl(b,BIO_C_GET_PROXY_PARAM,1,@pxy_p); +end; + +function BIO_get_url(b : PBIO; var url : PIdAnsiChar) : TIdC_LONG; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := BIO_ctrl(b,BIO_C_GET_PROXY_PARAM,2,@url); +end; + +function BIO_get_no_connect_return(b : PBIO) : TIdC_LONG; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := BIO_ctrl(b,BIO_C_GET_PROXY_PARAM,5,nil); +end; + +function BIO_set_fd(b : PBIO; fd,c : TIdC_INT) : TIdC_LONG; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := BIO_int_ctrl(b,BIO_C_SET_FD,c,fd); +end; + +function BIO_get_fd(b : PBIO; c : PIdC_INT) : TIdC_LONG; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := BIO_ctrl(b,BIO_C_GET_FD,0,c); +end; + +//function BIO_set_fp(b : PBIO; fp : Pointer; c : TIdC_LONG) : TIdC_LONG; +//{$IFDEF USE_INLINE} inline; {$ENDIF} +//begin +// Result := BIO_ctrl(b,BIO_C_SET_FILE_PTR,c,fp); +//end; + +//function BIO_get_fp(b : PBIO; out fpp : Pointer) : TIdC_LONG; +//{$IFDEF USE_INLINE} inline; {$ENDIF} +//begin +// Result := BIO_ctrl(b,BIO_C_GET_FILE_PTR,0,@fpp); +//end; + +function BIO_seek(b : PBIO; ofs : TIdC_LONG) : TIdC_INT; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := BIO_ctrl(b,BIO_C_FILE_SEEK,ofs,nil); +end; + +function BIO_tell(b : PBIO) : TIdC_INT; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := BIO_ctrl(b,BIO_C_FILE_TELL,0,nil); +end; + +//* name is cast to lose const, but might be better to route through a function +// so we can do it safely */ +{$IFDEF CONST_STRICT} +///* If you are wondering why this isn't defined, its because CONST_STRICT is +// * purely a compile-time kludge to allow const to be checked. +// */ +//int BIO_read_filename(BIO *b,const char *name); +{$ELSE} +function BIO_read_filename(b : PBIO; name : PIdAnsiChar) : TIdC_LONG; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := BIO_ctrl(b,BIO_C_SET_FILENAME, BIO_CLOSE or BIO_FP_READ,name); +end; +{$ENDIF} + +function BIO_write_filename(b : PBIO; name : PIdAnsiChar) : TIdC_LONG; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := BIO_ctrl(b,BIO_C_SET_FILENAME, BIO_CLOSE or BIO_FP_WRITE,name); +end; + +function BIO_append_filename(b : PBIO; name : PIdAnsiChar) : TIdC_LONG; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := BIO_ctrl(b,BIO_C_SET_FILENAME, BIO_CLOSE or BIO_FP_APPEND,name); +end; + +function BIO_rw_filename(b : PBIO; name : PIdAnsiChar) : TIdC_LONG; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := BIO_ctrl(b,BIO_C_SET_FILENAME, BIO_CLOSE or BIO_FP_READ or BIO_FP_WRITE,name); +end; + +///* WARNING WARNING, this ups the reference count on the read bio of the +// * SSL structure. This is because the ssl read BIO is now pointed to by +// * the next_bio field in the bio. So when you free the BIO, make sure +// * you are doing a BIO_free_all() to catch the underlying BIO. */ +function BIO_set_ssl(b : PBIO; ssl : PSSL; c : TIdC_LONG) : TIdC_LONG; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := BIO_ctrl(b,BIO_C_SET_SSL,c,ssl); +end; + +function BIO_get_ssl(b : PBIO; var sslp : PSSL) : TIdC_LONG; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := BIO_ctrl(b,BIO_C_GET_SSL,0,@sslp); +end; + +function BIO_set_ssl_mode(b : PBIO; client : TIdC_LONG) : TIdC_LONG; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := BIO_ctrl(b,BIO_C_SSL_MODE,client,nil); +end; + +function BIO_set_ssl_renegotiate_bytes(b : PBIO; num : TIdC_LONG) : TIdC_LONG; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := BIO_ctrl(b,BIO_C_SET_SSL_RENEGOTIATE_BYTES,num,nil); +end; + +function BIO_get_num_renegotiates(b : PBIO) : TIdC_LONG; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := BIO_ctrl(b,BIO_C_GET_SSL_NUM_RENEGOTIATES,0,nil); +end; + +function BIO_set_ssl_renegotiate_timeout(b : PBIO; seconds : TIdC_LONG) : TIdC_LONG; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := BIO_ctrl(b,BIO_C_SET_SSL_RENEGOTIATE_TIMEOUT,seconds,nil); +end; + +function BIO_get_mem_data(b : PBIO; var pp : PIdAnsiChar) : TIdC_INT; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := BIO_ctrl(b,BIO_CTRL_INFO,0,@pp); +end; + +function BIO_set_mem_buf(b : PBIO; bm : PBUF_MEM; c : TIdC_INT) : TIdC_INT; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := BIO_ctrl(b, BIO_C_SET_BUF_MEM, c, bm); +end; + +function BIO_get_mem_ptr(b: PBIO; var pp: PBUF_MEM) : TIdC_INT; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := BIO_ctrl(b, BIO_C_GET_BUF_MEM_PTR, 0, @pp); +end; + +procedure BIO_set_mem_eof_return(b : PBIO; const v : TIdC_INT); +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + BIO_ctrl(b,BIO_C_SET_BUF_MEM_EOF_RETURN,v,nil); +end; + +//* For the BIO_f_buffer() type */ +function BIO_get_buffer_num_lines(b : PBIO) : TIdC_INT; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := BIO_ctrl(b,BIO_C_GET_BUFF_NUM_LINES,0,nil); +end; + +procedure BIO_set_buffer_size(b : PBIO; const size : TIdC_INT); +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + BIO_ctrl(b,BIO_C_SET_BUFF_SIZE,size,nil); +end; + +//* Don't use the next one unless you know what you are doing :-) */ +function BIO_dup_state(b : PBIO; ret : PBIO) : TIdC_LONG; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := BIO_ctrl(b,BIO_CTRL_DUP,0,ret); +end; + +function BIO_reset(b : PBIO) : TIdC_INT; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := BIO_ctrl(b,BIO_CTRL_RESET,0,nil); +end; + +function BIO_eof(b : PBIO) : TIdC_INT; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := BIO_ctrl(b,BIO_CTRL_EOF,0,nil); +end; + +function BIO_set_close(b: PBIO; c: TIdC_LONG): TIdC_INT; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := BIO_ctrl(b, BIO_CTRL_SET_CLOSE, c, nil); +end; + +function BIO_get_close(b : PBIO) : TIdC_INT; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := BIO_ctrl(b, BIO_CTRL_GET_CLOSE, 0, nil); +end; + +function BIO_pending(b : PBIO) : TIdC_INT; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := BIO_ctrl(b,BIO_CTRL_PENDING,0,nil); +end; + +function BIO_wpending(b : PBIO) : TIdC_INT; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := BIO_ctrl(b,BIO_CTRL_WPENDING,0,nil); +end; + +function BIO_flush(b : PBIO) : TIdC_INT; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := BIO_ctrl(b,BIO_CTRL_FLUSH,0,nil); +end; + +//* For the BIO_f_buffer() type */ +function BIO_buffer_get_num_lines(b : PBIO) : TIdC_INT; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := BIO_ctrl(b,BIO_CTRL_GET,0,nil); +end; + +function BIO_get_info_callback(b : PBIO; var cbp : Pbio_info_cb) : TIdC_INT; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := BIO_ctrl(b,BIO_CTRL_GET_CALLBACK,0, @cbp); +end; + +function BIO_set_info_callback(b : PBIO; cb : Pbio_info_cb) : TIdC_INT; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := BIO_callback_ctrl(b,BIO_CTRL_SET_CALLBACK,cb); +end; + +//* For BIO_s_bio() */ +//function(bp : PBIO; cmd : TIdC_INT; larg : TIdC_LONG; iArg : TIdC_INT) : TIdC_LONG cdecl = nil; +//BIO_set_read_buffer_size(b,size) BIO_int_ctrl(b,BIO_C_SET_BUFF_SIZE,size,0) +function BIO_set_read_buffer_size(b : PBIO; size : TIdC_LONG) : TIdC_LONG; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := BIO_int_ctrl(b,BIO_C_SET_BUFF_SIZE,size,0); +end; + +function BIO_set_write_buffer_size(b : PBIO; size : TIdC_LONG) : TIdC_LONG; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := BIO_int_ctrl(b,BIO_C_SET_BUFF_SIZE,size,1); +end; + +//#define BIO_make_bio_pair(b1,b2) (int)BIO_ctrl(b1,BIO_C_MAKE_BIO_PAIR,0,b2) +function BIO_make_bio_pair(b1, b2 : PBIO ): TIdC_INT; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := BIO_ctrl(b1,BIO_C_MAKE_BIO_PAIR,0,b2); +end; + +//#define BIO_destroy_bio_pair(b) (int)BIO_ctrl(b,BIO_C_DESTROY_BIO_PAIR,0,NULL) +function BIO_destroy_bio_pair(b : PBIO) : TIdC_INT; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := BIO_ctrl(b,BIO_C_DESTROY_BIO_PAIR,0,nil); +end; + +//#define BIO_shutdown_wr(b) (int)BIO_ctrl(b, BIO_C_SHUTDOWN_WR, 0, NULL) +function BIO_shutdown_wr(b : PBIO) : TIdC_INT; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := BIO_ctrl(b, BIO_C_SHUTDOWN_WR, 0, nil); +end; + +///* macros with inappropriate type -- but ...pending macros use int too: */ +//#define BIO_get_write_guarantee(b) (int)BIO_ctrl(b,BIO_C_GET_WRITE_GUARANTEE,0,NULL) +function BIO_get_write_guarantee(b : PBIO) : TIdC_INT; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := BIO_ctrl(b,BIO_C_GET_WRITE_GUARANTEE,0,nil); +end; + +//#define BIO_get_read_request(b) (int)BIO_ctrl(b,BIO_C_GET_READ_REQUEST,0,NULL) +function BIO_get_read_request(b : PBIO) : TIdC_INT; +begin + Result := BIO_ctrl(b,BIO_C_GET_READ_REQUEST,0,nil); +end; + +//* ctrl macros for dgram */ +function _BIO_ctrl_dgram_connect(b : PBIO; peer : Sockaddr) : TIdC_INT; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := BIO_ctrl(b,BIO_CTRL_DGRAM_CONNECT,0,@peer); +end; + +function BIO_ctrl_set_connected(b : PBIO; state : TIdC_INT; peer : Sockaddr) : TIdC_INT; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := BIO_ctrl(b, BIO_CTRL_DGRAM_SET_CONNECTED, state, @peer); +end; + +function BIO_dgram_recv_timedout(b : PBIO) : TIdC_INT; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := BIO_ctrl(b, BIO_CTRL_DGRAM_GET_RECV_TIMER_EXP, 0, nil); +end; + +function BIO_dgram_send_timedout(b : PBIO) : TIdC_INT; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := BIO_ctrl(b, BIO_CTRL_DGRAM_GET_SEND_TIMER_EXP, 0, nil); +end; + +function BIO_dgram_get_peer(b : PBIO; peer : PSockAddr) : TIdC_INT; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := BIO_ctrl(b, BIO_CTRL_DGRAM_GET_PEER, 0, peer); +end; + +function BIO_dgram_set_peer(b : PBIO; peer : PSockAddr) : TIdC_INT; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := BIO_ctrl(b, BIO_CTRL_DGRAM_SET_PEER, 0, peer); +end; + +{$IFDEF SSLEAY_MACROS} +//You should do the PEM_read_bio and PEM_write_bio functions like this +//because OpenSSL has a define for either using Macros or the native +//functions. + +function PEM_read_bio_X509(bp: PBIO; x: PPX509; cb: ppem_password_cb; u: Pointer): PX509; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := PEM_ASN1_read_bio(d2i_of_void(d2i_X509), PEM_STRING_X509, bp, PPointer(x), cb, u); +end; + +function PEM_read_bio_X509_REQ(bp :PBIO; x : PPX509_REQ; cb :ppem_password_cb; u: Pointer) : PX509_REQ; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := PEM_ASN1_read_bio(d2i_of_void(d2i_X509_REQ),PEM_STRING_X509_REQ,bp, Pointer(x), cb, u); +end; + +function PEM_read_bio_X509_CRL(bp : PBIO; x : PPX509_CRL;cb : ppem_password_cb; u: Pointer) : PX509_CRL; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := PEM_ASN1_read_bio(d2i_of_void(d2i_X509_CRL), PEM_STRING_X509_CRL, bp, Pointer(x), cb, u); +end; + +function PEM_read_bio_RSAPrivateKey(bp : PBIO; x : PPRSA; cb : ppem_password_cb; u: Pointer) : PRSA; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := PEM_ASN1_read_bio(d2i_of_void(d2i_RSAPrivateKey), PEM_STRING_RSA, bp, Pointer(x), cb, u); +end; + +function PEM_read_bio_RSAPublicKey(bp : PBIO; x : PPRSA; cb : ppem_password_cb; u: Pointer) : PRSA; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := PEM_ASN1_read_bio(d2i_of_void(d2i_RSAPublicKey),PEM_STRING_RSA_PUBLIC, bp, Pointer(x),cb, u); +end; + +function PEM_read_bio_DSAPrivateKey(bp : PBIO; x : PPDSA; cb : ppem_password_cb; u : Pointer) : PDSA; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := PEM_ASN1_read_bio( d2i_of_void(d2i_DSAPrivateKey),PEM_STRING_DSA,bp,Pointer(x),cb,u); +end; + +function PEM_read_bio_PrivateKey(bp : PBIO; x : PPEVP_PKEY; cb : ppem_password_cb; u : Pointer) : PEVP_PKEY; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := PEM_ASN1_read_bio( d2i_of_void(d2i_PrivateKey), PEM_STRING_EVP_PKEY, bp, Pointer(x),cb, u); +end; + +function PEM_read_bio_PKCS7(bp : PBIO; x : PPPKCS7; cb : ppem_password_cb; u : Pointer) : PPKCS7; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := PEM_ASN1_read_bio( d2i_of_void(d2i_PKCS7), PEM_STRING_PKCS7,bp,Pointer(x),cb, u); +end; + +function PEM_read_bio_DHparams(bp : PBIO; x : PPDH; cb : ppem_password_cb; u : Pointer) : PDH; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := PEM_ASN1_read_bio(d2i_of_void(d2i_DHparams),PEM_STRING_DHPARAMS,bp,Pointer(x),cb,u); +end; + +function PEM_read_bio_DSAparams(bp : PBIO; x : PPDSA; cb : ppem_password_cb; u : Pointer) : PDSA; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := PEM_ASN1_read_bio( d2i_of_void(d2i_DSAparams),PEM_STRING_DSAPARAMS,bp,Pointer(x),cb,u); +end; + +function PEM_read_bio_NETSCAPE_CERT_SEQUENCE(bp : PBIO; x : PPNETSCAPE_CERT_SEQUENCE; + cb : ppem_password_cb; u : Pointer) : PNETSCAPE_CERT_SEQUENCE; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := PEM_ASN1_read_bio( d2i_of_void(d2i_NETSCAPE_CERT_SEQUENCE),PEM_STRING_X509,bp,Pointer(x),cb, u); +end; + +function PEM_read_bio_PUBKEY(bp : PBIO; x: PPEVP_PKEY; cb: ppem_password_cb; u: Pointer): PEVP_PKEY; +begin + Result := PEM_ASN1_read_bio( d2i_of_void(d2i_PUBKEY),PEM_STRING_PUBLIC,bp,Pointer(x),cb, u); +end; + +function PEM_write_bio_X509(bp: PBIO; x: PX509): TIdC_INT; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Assert(bp<>nil); + Assert(x<>nil); + Result := PEM_ASN1_write_bio( i2d_of_void(i2d_X509), PEM_STRING_X509, bp, PIdAnsiChar(x), nil, nil, 0, nil, nil); + Assert(Result<>0); +end; + +function PEM_write_bio_X509_REQ(bp: PBIO; x: PX509_REQ): TIdC_INT; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Assert(bp<>nil); + Assert(x<>nil); + Result := PEM_ASN1_write_bio(i2d_of_void(i2d_X509_REQ), PEM_STRING_X509_REQ, bp, PIdAnsiChar(x), nil, nil, 0, nil, nil); + Assert(Result<>0); +end; + +function PEM_write_bio_X509_CRL(bp : PBIO; x : PX509_CRL) : TIdC_INT; +begin + Assert(bp<>nil); + Assert(x<>nil); + Result := PEM_ASN1_write_bio(i2d_of_void(i2d_X509_CRL), PEM_STRING_X509_CRL, bp, PIdAnsiChar(x), nil, nil, 0, nil, nil); + Assert(Result<>0); +end; + +function PEM_write_bio_RSAPrivateKey(bp : PBIO; x : PRSA; const enc : PEVP_CIPHER; + kstr : PIdAnsiChar; klen : TIdC_INT; cb : ppem_password_cb; u : POinter) : TIdC_INT; +begin + Assert(bp<>nil); + Assert(x<>nil); + Result := PEM_ASN1_write_bio(i2d_of_void(i2d_RSAPrivateKey), PEM_STRING_RSA, bp, PIdAnsiChar(x), enc,kstr,klen,cb,u); + Assert(Result<>0); +end; + +function PEM_write_bio_RSAPublicKey(bp : PBIO; x : PRSA) : TIdC_INT; +begin + Assert(bp<>nil); + Assert(x<>nil); + Result := PEM_ASN1_write_bio(i2d_of_void(i2d_RSAPublicKey), PEM_STRING_RSA_PUBLIC, bp, PIdAnsiChar(x), nil, nil, 0, nil, nil); + Assert(Result<>0); +end; + +function PEM_write_bio_DSAPrivateKey( bp : PBIO; x : PDSA; const enc : PEVP_CIPHER; + kstr : PIdAnsiChar; klen : TIdC_INT; cb : Ppem_password_cb; u : Pointer) : TIdC_INT; +begin + Assert(bp<>nil); + Assert(x<>nil); + Result := PEM_ASN1_write_bio(i2d_of_void(i2d_DSAPrivateKey), PEM_STRING_DSA, bp, PIdAnsiChar(x), enc,kstr,klen,cb,u); + Assert(Result<>0); +end; + +function PEM_write_bio_PrivateKey(bp : PBIO; x : PEVP_PKEY; const enc : PEVP_CIPHER; + kstr : PIdAnsiChar; klen : TIdC_INT; cb : Ppem_password_cb; u : Pointer) : TIdC_INT; +begin + Assert(bp<>nil); + Assert(x<>nil); + if x^._type = EVP_PKEY_DSA then begin + Result := PEM_ASN1_write_bio(i2d_of_void(i2d_PrivateKey),PEM_STRING_DSA,bp, Pointer(x),enc,kstr,klen,cb,u); + end else begin + Result := PEM_ASN1_write_bio(i2d_of_void(i2d_PrivateKey),PEM_STRING_RSA,bp, Pointer(x),enc,kstr,klen,cb,u); + end; + Assert(Result<>0); +end; + +function PEM_write_bio_PKCS7(bp : PBIO; x : PPKCS7) : TIdC_INT; +begin + Assert(bp<>nil); + Assert(x<>nil); + Result := PEM_ASN1_write_bio(i2d_of_void(i2d_PKCS7), PEM_STRING_PKCS7, bp, PIdAnsiChar(x), nil, nil, 0, nil, nil); + Assert(Result<>0); +end; + +function PEM_write_bio_DHparams(bp : PBIO; x : PDH): TIdC_INT; +begin + Assert(bp<>nil); + Assert(x<>nil); + Result := PEM_ASN1_write_bio(i2d_of_void(i2d_DHparams), PEM_STRING_DHPARAMS, bp, PIdAnsiChar(x), nil, nil, 0, nil, nil); + Assert(Result<>0); +end; + +function PEM_write_bio_DSAparams(bp : PBIO; x : PDSA) : TIdC_INT; +begin + Assert(bp<>nil); + Assert(x<>nil); + Result := PEM_ASN1_write_bio(i2d_of_void(i2d_DSAparams), PEM_STRING_DSAPARAMS, bp, PIdAnsiChar(x), nil, nil, 0, nil, nil); + Assert(Result<>0); +end; + +function PEM_write_bio_NETSCAPE_CERT_SEQUENCE(bp : PBIO; x : PDSA) : TIdC_INT; +begin + Assert(bp<>nil); + Assert(x<>nil); + Result := PEM_ASN1_write_bio(i2d_of_void(i2d_NETSCAPE_CERT_SEQUENCE), PEM_STRING_X509, bp, PIdAnsiChar(x), nil, nil, 0, nil, nil); + Assert(Result<>0); +end; + +function PEM_write_bio_PUBKEY(bp: PBIO; x : PEVP_PKEY): TIdC_INT; +begin + Assert(bp<>nil); + Assert(x<>nil); + Result := PEM_ASN1_write_bio(i2d_of_void(i2d_PUBKEY), PEM_STRING_PUBLIC, bp, PIdAnsiChar(x), nil, nil, 0, nil, nil); + Assert(Result<>0); +end; + +{$ELSE} + +function PEM_read_bio_X509(bp: PBIO; x: PPX509; cb: ppem_password_cb; u: Pointer): PX509; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := _PEM_read_bio_X509(bp, x, cb, u); +end; + +function PEM_read_bio_X509_REQ(bp :PBIO; x : PPX509_REQ; cb :ppem_password_cb; u: Pointer) : PX509_REQ; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := _PEM_read_bio_X509_REQ(bp, x, cb, u); +end; + +function PEM_read_bio_X509_CRL(bp : PBIO; x : PPX509_CRL;cb : ppem_password_cb; u: Pointer) : PX509_CRL; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := _PEM_read_bio_X509_CRL(bp, x, cb, u); +end; + +function PEM_read_bio_RSAPrivateKey(bp : PBIO; x : PPRSA; cb : ppem_password_cb; u: Pointer) : PRSA; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := _PEM_read_bio_RSAPrivateKey(bp, x, cb, u); +end; + +function PEM_read_bio_RSAPublicKey(bp : PBIO; x : PPRSA; cb : ppem_password_cb; u: Pointer) : PRSA; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := _PEM_read_bio_RSAPublicKey(bp, x, cb, u); +end; + +function PEM_read_bio_DSAPrivateKey(bp : PBIO; x : PPDSA; cb : ppem_password_cb; u : Pointer) : PDSA;{$IFDEF USE_INLINE} inline; {$ENDIF} +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := _PEM_read_bio_DSAPrivateKey(bp, x, cb, u); +end; + +function PEM_read_bio_PrivateKey(bp : PBIO; x : PPEVP_PKEY; cb : ppem_password_cb; u : Pointer) : PEVP_PKEY; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := _PEM_read_bio_PrivateKey(bp, x, cb, u); +end; + +function PEM_read_bio_PKCS7(bp : PBIO; x : PPPKCS7; cb : ppem_password_cb; u : Pointer) : PPKCS7; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := _PEM_read_bio_PKCS7(bp, x, cb, u); +end; + +function PEM_read_bio_DHparams(bp : PBIO; x : PPDH; cb : ppem_password_cb; u : Pointer) : PDH; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := _PEM_read_bio_DHparams(bp, x, cb, u); +end; + +function PEM_read_bio_DSAparams(bp : PBIO; x : PPDSA; cb : ppem_password_cb; u : Pointer) : PDSA; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := _PEM_read_bio_DSAparams(bp, x, cb, u); +end; + +function PEM_read_bio_NETSCAPE_CERT_SEQUENCE(bp : PBIO; x : PPNETSCAPE_CERT_SEQUENCE; + cb : ppem_password_cb; u : Pointer) : PNETSCAPE_CERT_SEQUENCE; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := _PEM_read_bio_NETSCAPE_CERT_SEQUENCE(bp, x, cb, u); +end; + +function PEM_read_bio_PUBKEY(bp : PBIO; x : PPEVP_PKEY; cb : ppem_password_cb; u : Pointer) : PEVP_PKEY; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := _PEM_read_bio_PUBKEY(bp, x, cb, u); +end; + +function PEM_write_bio_X509(bp: PBIO; x: PX509): TIdC_INT; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := _PEM_write_bio_X509(bp, x); +end; + +function PEM_write_bio_X509_REQ(bp: PBIO; x: PX509_REQ): TIdC_INT; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := _PEM_write_bio_X509_REQ(bp, x); +end; + +function PEM_write_bio_X509_CRL(bp : PBIO; x : PX509_CRL) : TIdC_INT; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := _PEM_write_bio_X509_CRL(bp, x); +end; + +function PEM_write_bio_RSAPublicKey(bp : PBIO; x : PRSA) : TIdC_INT; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := _PEM_write_bio_RSAPublicKey(bp,x); +end; + +function PEM_write_bio_RSAPrivateKey(bp : PBIO; x : PRSA; const enc : PEVP_CIPHER; + kstr : PIdAnsiChar; klen : TIdC_INT; cb : ppem_password_cb; u : POinter) : TIdC_INT; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := _PEM_write_bio_RSAPrivateKey(bp,x,enc,kstr,klen,cb, u); +end; + +function PEM_write_bio_DSAPrivateKey( bp : PBIO; x : PDSA; const enc : PEVP_CIPHER; + kstr : PIdAnsiChar; klen : TIdC_INT; cb : Ppem_password_cb; u : Pointer) : TIdC_INT; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := _PEM_write_bio_DSAPrivateKey( bp, x, enc, kstr, klen, cb, u); +end; + +function PEM_write_bio_PrivateKey(bp : PBIO; x : PEVP_PKEY; const enc : PEVP_CIPHER; + kstr : PIdAnsiChar; klen : TIdC_INT; cb : Ppem_password_cb; u : Pointer) : TIdC_INT; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := _PEM_write_bio_PrivateKey(bp,x, enc, kstr, klen, cb, u); +end; + +function PEM_write_bio_PKCS7(bp : PBIO; x : PPKCS7) : TIdC_INT; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := _PEM_write_bio_PKCS7(bp, x); +end; + +function PEM_write_bio_DHparams(bp : PBIO; x : PDH): TIdC_INT; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := _PEM_write_bio_DHparams(bp, x); +end; + +function PEM_write_bio_DSAparams(bp : PBIO; x : PDSA) : TIdC_INT; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := _PEM_write_bio_DSAparams(bp, x); +end; + +function PEM_write_bio_NETSCAPE_CERT_SEQUENCE(bp : PBIO; x : PDSA) : TIdC_INT; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := _PEM_write_bio_NETSCAPE_CERT_SEQUENCE(bp, x); +end; + +function PEM_write_bio_PUBKEY(bp : PBIO; x : PEVP_PKEY): TIdC_INT; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := _PEM_write_bio_PUBKEY(bp, x); +end; + +{$ENDIF} + +function OPENSSL_malloc(aSize:TIdC_INT):Pointer; +{$IFDEF USE_INLINE} inline; {$ENDIF} +//can also use CRYPTO_mem_leaks(bio) +begin + Result := CRYPTO_malloc(aSize, + {$IFNDEF HAS_PAnsiChar} + @cNull + {$ELSE} + '' + {$ENDIF}, 0); +end; + +procedure CRYPTO_SetMemCheck(const aEnabled: Boolean); +{$IFDEF USE_INLINE} inline; {$ENDIF} +//compile openssl with -DCRYPTO_MDEBUG +{$IFOPT C+} // detect assertions +var + r: Integer; +{$ENDIF} +begin + //compile openssl with -DCRYPTO_MDEBUG + {$IFOPT C+}r :={$ENDIF} CRYPTO_mem_ctrl(iif(aEnabled, CRYPTO_MEM_CHECK_ON, CRYPTO_MEM_CHECK_OFF)); + {$IFOPT C+}Assert(r<>0);{$ENDIF} +end; + +{$IFNDEF OPENSSL_NO_RSA} +function EVP_PKEY_assign_RSA(pkey: PEVP_PKEY; rsa: PRSA): TIdC_INT; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := EVP_PKEY_assign(pkey, EVP_PKEY_RSA, rsa); +end; +{$ENDIF} + +{$IFNDEF OPENSSL_NO_DSA} +function EVP_PKEY_assign_DSA(pkey : PEVP_PKEY; dsa : PDSA) : TIdC_INT; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := EVP_PKEY_assign(pkey, EVP_PKEY_DSA, dsa); +end; +{$ENDIF} + +{$IFNDEF OPENSSL_NO_DH} +function EVP_PKEY_assign_DH(pkey : PEVP_PKEY; dh : PDH) : TIdC_INT; +begin + Result := EVP_PKEY_assign(pkey, EVP_PKEY_DH, dh); +end; +{$ENDIF} + +{$IFNDEF OPENSSL_NO_EC} +function EVP_PKEY_assign_EC_KEY(pkey : PEVP_PKEY; eckey : PEC_KEY) : TIdC_INT; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := EVP_PKEY_assign(pkey, EVP_PKEY_EC, eckey); +end; +{$ENDIF} + +function EVP_get_digestbynid(a : TIdC_INT) : PEVP_MD; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := EVP_get_digestbyname(OBJ_nid2sn(a)); +end; + +function EVP_get_digestbyobj(a : PASN1_OBJECT) : PEVP_MD; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := EVP_get_digestbynid(OBJ_obj2nid(a)); +end; + +function EVP_get_cipherbynid(a : TIdC_INT) : PEVP_CIPHER; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := EVP_get_cipherbyname(OBJ_nid2sn(a)); +end; + +function EVP_get_cipherbyobj(a : PASN1_OBJECT) : PEVP_CIPHER; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := EVP_get_cipherbynid(OBJ_obj2nid(a)) +end; + +function EVP_MD_nid(e : PEVP_MD) : TIdC_INT; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := EVP_MD_type(e); +end; + +function EVP_MD_name(e : PEVP_MD) : PIdAnsiChar; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := OBJ_nid2sn(EVP_MD_nid(e)) +end; + +function EVP_MD_CTX_size(e : PEVP_MD_CTX) : TIdC_INT; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := EVP_MD_size(EVP_MD_CTX_md(e)); +end; + +function EVP_MD_CTX_block_size(e : PEVP_MD_CTX) : TIdC_INT; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := EVP_MD_block_size(EVP_MD_CTX_md(e)); +end; + +function EVP_MD_CTX_type(e : PEVP_MD_CTX) : TIdC_INT; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := EVP_MD_type(EVP_MD_CTX_md(e)); +end; + +function EVP_CIPHER_name(e : PEVP_CIPHER) : PIdAnsiChar; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := OBJ_nid2sn(EVP_CIPHER_nid(e)); +end; + +function EVP_CIPHER_mode(e : PEVP_CIPHER) : TIdC_ULONG; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := (EVP_CIPHER_flags(e) and EVP_CIPH_MODE) +end; + +function EVP_CIPHER_CTX_type(c : PEVP_CIPHER_CTX) : TIdC_INT; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := EVP_CIPHER_type(EVP_CIPHER_CTX_cipher(c)); +end; + +function EVP_CIPHER_CTX_mode(e : PEVP_CIPHER_CTX) : TIdC_ULONG; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := (EVP_CIPHER_CTX_flags(e) and EVP_CIPH_MODE) +end; + +function EVP_ENCODE_LENGTH(l : Integer) : Integer; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := (((l+2) div 3*4)+(l div 48+1)*2+80); +end; + +function EVP_DECODE_LENGTH(l : Integer) : Integer; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := ((l+3) div 4*3+80); +end; + +function EVP_SignInit_ex(a: PEVP_MD_CTX; b : PEVP_MD; c : PENGINE) : TIdC_INT; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := EVP_DigestInit_ex(a, b,c); +end; + +function EVP_SignInit(a : PEVP_MD_CTX; b : PEVP_MD) : TIdC_INT; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := EVP_DigestInit(a,b); +end; + +function EVP_SignUpdate(a: PEVP_MD_CTX; b : Pointer; c : size_t) : TIdC_INT; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := EVP_DigestUpdate(a,b,c); +end; + +function EVP_VerifyInit_ex(a: PEVP_MD_CTX; b: PEVP_MD; c: PENGINE) : TIdC_INT; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := EVP_DigestInit_ex(a,b,c); +end; + +function EVP_VerifyInit(a: PEVP_MD_CTX; b: PEVP_MD) : TIdC_INT; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := EVP_DigestInit(a,b); +end; + +function EVP_VerifyUpdate(a: PEVP_MD_CTX; b: Pointer; c : size_t) : TIdC_INT; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := EVP_DigestUpdate(a,b,c); +end; + +function EVP_OpenUpdate(a: PEVP_CIPHER_CTX; _out : PIdAnsiChar; outl : PIdC_INT; + _in : PIdAnsiChar; inl : TIdC_INT) : TIdC_INT; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := EVP_DecryptUpdate(a,_out,outl,_in,inl); +end; + +function EVP_SealUpdate(a : PEVP_CIPHER_CTX; b: PIdAnsiChar; c : PIdC_INT; + d: PIdAnsiChar; e : TIdC_INT) : TIdC_INT; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := EVP_EncryptUpdate(a,b,c,d,e) +end; + +function EVP_DigestSignUpdate(a : PEVP_MD_CTX; b : Pointer; c : size_t) : TIdC_Int; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := EVP_DigestUpdate(a,b,size_t(c)); +end; + +function EVP_DigestVerifyUpdate(a : PEVP_MD_CTX; b : Pointer; c : size_t) : TIdC_INT; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := EVP_DigestUpdate(a,b,size_t(c)); +end; + +function BIO_get_md(b : PBIO; var mdp : PEVP_MD) : TIdC_LONG; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := BIO_ctrl(b,BIO_C_GET_MD,0,@mdp); +end; + +function BIO_get_md_ctx(b : PBIO; var mdcp : PEVP_MD_CTX) : TIdC_LONG; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := BIO_ctrl(b,BIO_C_GET_MD_CTX,0,@mdcp); +end; + +function BIO_set_md_ctx(b : PBIO; mdcp : PEVP_MD_CTX) : TIdC_LONG; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := BIO_ctrl(b,BIO_C_SET_MD_CTX,0,mdcp); +end; + +function BIO_get_cipher_status(b : PBIO) : TIdC_LONG; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := BIO_ctrl(b,BIO_C_GET_CIPHER_STATUS,0,nil); +end; + +function BIO_get_cipher_ctx(b : PBIO; var c_pp : PEVP_CIPHER_CTX): TIdC_LONG; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := BIO_ctrl(b,BIO_C_GET_CIPHER_CTX,0,@c_pp); +end; + +{$ifndef OPENSSL_NO_DES} +function EVP_des_cfb : PEVP_CIPHER; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := EVP_des_cfb64; +end; + +function EVP_des_ede_cfb: PEVP_CIPHER; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := EVP_des_ede_cfb64; +end; + +function EVP_des_ede3_cfb: PEVP_CIPHER; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := EVP_des_ede3_cfb64 +end; +{$endif} + +{$ifndef OPENSSL_NO_IDEA} +function EVP_idea_cfb: PEVP_CIPHER; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := EVP_idea_cfb64 +end; + +{$endif} + +{$ifndef OPENSSL_NO_RC2} +function EVP_rc2_cfb: PEVP_CIPHER; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := EVP_rc2_cfb64; +end; +{$endif} + +{$ifndef OPENSSL_NO_BF} +function EVP_bf_cfb: PEVP_CIPHER; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := EVP_bf_cfb64; +end; +{$endif} + +{$ifndef OPENSSL_NO_CAST} +function EVP_cast5_cfb: PEVP_CIPHER; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := EVP_cast5_cfb64; +end; +{$endif} + +{$ifndef OPENSSL_NO_RC5} +function EVP_rc5_32_12_16_cfb: PEVP_CIPHER; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := EVP_rc5_32_12_16_cfb64; +end; +{$endif} + +{$ifndef OPENSSL_NO_AES} +function EVP_aes_128_cfb: PEVP_CIPHER; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := EVP_aes_128_cfb128; +end; + +function EVP_aes_192_cfb: PEVP_CIPHER; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := EVP_aes_192_cfb128 +end; + +function EVP_aes_256_cfb: PEVP_CIPHER; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := EVP_aes_256_cfb128; +end; +{$endif} + +{$ifndef OPENSSL_NO_CAMELLIA} +function EVP_camellia_128_cfb: PEVP_CIPHER; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := EVP_camellia_128_cfb128; +end; + +function EVP_camellia_192_cfb: PEVP_CIPHER; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := EVP_camellia_192_cfb128; +end; + +function EVP_camellia_256_cfb: PEVP_CIPHER; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := EVP_camellia_256_cfb128; +end; +{$ENDIF} + +{$ifndef OPENSSL_NO_SEED} +function EVP_seed_cfb: PEVP_CIPHER; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := EVP_seed_cfb128; +end; +{$endif} + +function EVP_PKEY_CTX_set_signature_md(ctx : PEVP_PKEY_CTX;md : PEVP_PKEY_CTX) : TIdC_INT; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := EVP_PKEY_CTX_ctrl(ctx, -1, EVP_PKEY_OP_TYPE_SIG, + EVP_PKEY_CTRL_MD, 0, Pointer(md)); +end; + +procedure SSLeay_add_all_algorithms; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + OpenSSL_add_all_algorithms; +end; + +procedure SSLeay_add_all_ciphers; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + OpenSSL_add_all_ciphers; +end; + +procedure SSLeay_add_all_digests; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + OpenSSL_add_all_digests; +end; + +procedure X509V3_set_ctx_nodb(ctx: X509V3_CTX); +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + ctx.db := nil; +end; + +function ERR_PACK(l, f, r : TIdC_INT) : TIdC_ULONG; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := ((TIdC_ULONG(l) and $ff) * $1000000) or + ((TIdC_ULONG(f) and $fff) * $1000) or + (TIdC_ULONG(r) and $fff); +end; + +function ERR_GET_LIB(const l : TIdC_INT) : TIdC_ULONG; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := (l shr 24) and $ff; +end; + +function ERR_GET_FUNC(const l : TIdC_INT) : TIdC_ULONG; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := (l shr 12) and $fff; +end; + +function ERR_FATAL_ERROR(const l : TIdC_INT) : Boolean; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := (l and ERR_R_FATAL) > 0; +end; + +function ERR_GET_REASON(const l : TIdC_INT) : TIdC_INT; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := l and $fff; +end; + +//__FILE__,__LINE__ preprocessor macros are not available in Pascal. +//so we can't pass error location info in the last two parameters. +procedure SYSerr(const f,r : TIdC_INT); +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + ERR_PUT_error(ERR_LIB_SYS,f,r,nil,0); +end; + +procedure BNerr(const f,r : TIdC_INT); +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + ERR_PUT_error(ERR_LIB_BN,f,r,nil,0); +end; + +procedure RSAerr(const f,r : TIdC_INT); +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + ERR_PUT_error(ERR_LIB_RSA,f,r,nil,0); +end; + +procedure DHerrr(const f,r : TIdC_INT); +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + ERR_PUT_error(ERR_LIB_DH,f,r,nil,0); +end; + +procedure EVPerr(const f,r : TIdC_INT); +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + ERR_PUT_error(ERR_LIB_EVP,f,r,nil,0); +end; + +procedure BUFerr(const f,r : TIdC_INT); +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + ERR_PUT_error(ERR_LIB_BUF,f,r,nil,0); +end; + +procedure OBJerr(const f,r : TIdC_INT); +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + ERR_PUT_error(ERR_LIB_OBJ,f,r,nil,0); +end; + +procedure PEMerr(const f,r : TIdC_INT); +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + ERR_PUT_error(ERR_LIB_PEM,f,r,nil,0); +end; + +procedure DSAerr(const f,r : TIdC_INT); +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + ERR_PUT_error(ERR_LIB_DSA,f,r,nil,0); +end; + +procedure X509err(const f,r : TIdC_INT); +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + ERR_PUT_error(ERR_LIB_X509,f,r,nil,0); +end; + +procedure ASN1err(const f,r : TIdC_INT); +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + ERR_PUT_error(ERR_LIB_ASN1,f,r,nil,0); +end; + +procedure CONFerr(const f,r : TIdC_INT); +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + ERR_PUT_error(ERR_LIB_CONF,f,r,nil,0); +end; + +procedure CRYPTOerr(const f,r : TIdC_INT); +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + ERR_PUT_error(ERR_LIB_CRYPTO,f,r,nil,0); +end; + +procedure ECerr(const f,r : TIdC_INT); +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + ERR_PUT_error(ERR_LIB_EC,f,r,nil,0); +end; + +procedure SSLerr(const f,r : TIdC_INT); +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + ERR_PUT_error(ERR_LIB_SSL,f,r,nil,0); +end; + +procedure BIOerr(const f,r : TIdC_INT); +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + ERR_PUT_error(ERR_LIB_BIO,f,r,nil,0); +end; + +procedure PKCS7err(const f,r : TIdC_INT); +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + ERR_PUT_error(ERR_LIB_PKCS7,f,r,nil,0); +end; + +procedure X509V3err(const f,r : TIdC_INT); +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + ERR_PUT_error(ERR_LIB_X509V3,f,r,nil,0); +end; + +procedure PKCS12err(const f,r : TIdC_INT); +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + ERR_PUT_error(ERR_LIB_PKCS12,f,r,nil,0); +end; + +procedure RANDerr(const f,r : TIdC_INT); +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + ERR_PUT_error(ERR_LIB_RAND,f,r,nil,0); +end; + +procedure DSOerr(const f,r : TIdC_INT); +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + ERR_PUT_error(ERR_LIB_DSO,f,r,nil,0); +end; + +procedure ENGINEerr(const f,r : TIdC_INT); +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + ERR_PUT_error(ERR_LIB_ENGINE,f,r,nil,0); +end; + +procedure OCSPerr(const f,r : TIdC_INT); +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + ERR_PUT_error(ERR_LIB_OCSP,f,r,nil,0); +end; + +procedure UIerr(const f,r : TIdC_INT); +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + ERR_PUT_error(ERR_LIB_UI,f,r,nil,0); +end; + +procedure COMPerr(const f,r : TIdC_INT); +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + ERR_PUT_error(ERR_LIB_COMP,f,r,nil,0); +end; + +procedure ECDSAerr(const f,r : TIdC_INT); +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + ERR_PUT_error(ERR_LIB_ECDSA,f,r,nil,0); +end; + +procedure ECDHerr(const f,r : TIdC_INT); +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + ERR_PUT_error(ERR_LIB_ECDH,f,r,nil,0); +end; + +procedure STOREerr(const f,r : TIdC_INT); +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + ERR_PUT_error(ERR_LIB_STORE,f,r,nil,0); +end; + +procedure FIPSerr(const f,r : TIdC_INT); +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + ERR_PUT_error(ERR_LIB_FIPS,f,r,nil,0); +end; + +procedure CMSerr(const f,r : TIdC_INT); +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + ERR_PUT_error(ERR_LIB_CMS,f,r,nil,0); +end; + +procedure TSerr(const f,r : TIdC_INT); +begin + ERR_PUT_error(ERR_LIB_TS,f,r,nil,0); +end; + +procedure HMACerr(const f,r : TIdC_INT); +begin + ERR_PUT_error(ERR_LIB_HMAC,(f),(r),nil,0); +end; + +procedure JPAKEerr(const f,r : TIdC_INT); +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + ERR_PUT_error(ERR_LIB_JPAKE,f,r,nil,0); +end; + +procedure CRYPTO_w_lock(const _type : TIdC_INT); +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + {$IFNDEF OPENSSL_NO_LOCKING} + _CRYPTO_lock(CRYPTO_LOCK or CRYPTO_WRITE,_type, nil, 0); + {$ENDIF} +end; + +procedure CRYPTO_w_unlock(const _type : TIdC_INT); +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + {$IFNDEF OPENSSL_NO_LOCKING} + _CRYPTO_lock(CRYPTO_UNLOCK or CRYPTO_WRITE,_type, nil, 0); + {$ENDIF} +end; + +procedure CRYPTO_r_lock(const _type : TIdC_INT); +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + {$IFNDEF OPENSSL_NO_LOCKING} + _CRYPTO_lock(CRYPTO_LOCK or CRYPTO_READ,_type, nil, 0); + {$ENDIF} +end; + +procedure CRYPTO_r_unlock(const _type : TIdC_INT); +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + {$IFNDEF OPENSSL_NO_LOCKING} + _CRYPTO_lock(CRYPTO_UNLOCK or CRYPTO_READ,_type, nil, 0); + {$ENDIF} +end; + +function X509_LOOKUP_load_file(x : PX509_LOOKUP; name : PIdAnsiChar; _type : TIdC_LONG) : TIdC_INT; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := X509_LOOKUP_ctrl(x, X509_L_FILE_LOAD, name, _type, nil); +end; + +function X509_LOOKUP_add_dir(x : PX509_LOOKUP; name : PIdAnsiChar; _type : TIdC_LONG) : TIdC_INT; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := X509_LOOKUP_ctrl(x, X509_L_ADD_DIR, name, _type, nil); +end; + +procedure RAND_cleanup; +begin + if Assigned(_RAND_cleanup) then begin + _RAND_cleanup(); + end; +end; + +function RAND_bytes(buf : PIdAnsiChar; num : integer) : integer; +begin + if Assigned(_RAND_bytes) then begin + Result := _RAND_bytes(buf, num); + end else begin + Result := 0; + end; +end; + +function RAND_pseudo_bytes(buf : PIdAnsiChar; num : integer) : integer; +begin + if Assigned(_RAND_pseudo_bytes) then begin + Result := _RAND_pseudo_bytes(buf, num); + end else begin + Result := 0; + end; +end; + +procedure RAND_seed(buf : PIdAnsiChar; num : integer); +begin + if Assigned(_RAND_seed) then begin + _RAND_seed(buf, num); + end; +end; + +procedure RAND_add(buf : PIdAnsiChar; num : integer; entropy : integer); +begin + if Assigned(_RAND_add) then begin + _RAND_add(buf, num, entropy); + end; +end; + +function RAND_status() : integer; +begin + if Assigned(_RAND_status) then begin + Result := _RAND_status(); + end else begin + Result := 0; + end; +end; + +{$IFDEF SYS_WIN} +function RAND_event(iMsg : UINT; wp : wparam; lp : lparam) : integer; +begin + if Assigned(_RAND_event) then begin + Result := _RAND_event(iMsg, wp, lp); + end else begin + Result := 0; + end; +end; + +procedure RAND_screen(); +begin + if Assigned(_RAND_screen) then begin + _RAND_screen(); + end; +end; +{$ENDIF} + +initialization + {$IFDEF STATICLOAD_OPENSSL} + InitializeFuncPointers; + {$ELSE} + FFailedLoadList := TStringList.Create; + {$ENDIF} + SetFIPSMode := OpenSSLSetFIPSMode; + GetFIPSMode := OpenSSLGetFIPSMode; + IsHashingIntfAvail := OpenSSLIsHashingIntfAvail; + IsMD2HashIntfAvail := OpenSSLIsMD2HashIntfAvail; + GetMD2HashInst := OpenSSLGetMD2HashInst; + IsMD4HashIntfAvail := OpenSSLIsMD4HashIntfAvail; + GetMD4HashInst := OpenSSLGetMD4HashInst; + IsMD5HashIntfAvail := OpenSSLIsMD5HashIntfAvail; + GetMD5HashInst := OpenSSLGetMD5HashInst; + IsSHA1HashIntfAvail := OpenSSLIsSHA1HashIntfAvail; + GetSHA1HashInst := OpenSSLGetSHA1HashInst; + IsSHA224HashIntfAvail := OpenSSLIsSHA224HashIntfAvail; + GetSHA224HashInst := OpenSSLGetSHA224HashInst; + IsSHA256HashIntfAvail := OpenSSLIsSHA256HashIntfAvail; + GetSHA256HashInst := OpenSSLGetSHA256HashInst; + IsSHA384HashIntfAvail := OpenSSLIsSHA384HashIntfAvail; + GetSHA384HashInst := OpenSSLGetSHA384HashInst; + IsSHA512HashIntfAvail := OpenSSLIsSHA512HashIntfAvail; + GetSHA512HashInst := OpenSSLGetSHA512HashInst; + UpdateHashInst := OpenSSLUpdateHashInst; + FinalHashInst := OpenSSLFinalHashInst; + IsHMACAvail := OpenSSLIsHMACAvail; + IsHMACMD5Avail := OpenSSLIsHMACMD5Avail; + GetHMACMD5HashInst := OpenSSLGetHMACMD5Inst; + IsHMACSHA1Avail := OpenSSLIsHMACSHA1Avail; + GetHMACSHA1HashInst:= OpenSSLGetHMACSHA1Inst; + IsHMACSHA224Avail := OpenSSLIsHMACSHA224Avail; + GetHMACSHA224HashInst:= OpenSSLGetHMACSHA224Inst; + IsHMACSHA256Avail := OpenSSLIsHMACSHA256Avail; + GetHMACSHA256HashInst:= OpenSSLGetHMACSHA256Inst; + IsHMACSHA384Avail := OpenSSLIsHMACSHA384Avail; + GetHMACSHA384HashInst:= OpenSSLGetHMACSHA384Inst; + IsHMACSHA512Avail := OpenSSLIsHMACSHA512Avail; + GetHMACSHA512HashInst:= OpenSSLGetHMACSHA512Inst; + UpdateHMACInst := OpenSSLUpdateHMACInst; + FinalHMACInst := OpenSSLFinalHMACInst; + LoadHashLibrary := LoadOpenSSL; +{$IFNDEF STATICLOAD_OPENSSL} +finalization + FreeAndNil(FFailedLoadList); +{$ENDIF} + +end. diff --git a/IdSSLOpenSSLHeaders_static.pas b/IdSSLOpenSSLHeaders_static.pas index eb26de2..80efa12 100644 --- a/IdSSLOpenSSLHeaders_static.pas +++ b/IdSSLOpenSSLHeaders_static.pas @@ -1,1079 +1,1079 @@ -unit IdSSLOpenSSLHeaders_static; - -interface - -{$I IdCompilerDefines.inc} - -{$IFNDEF USE_OPENSSL} - {$message error Should not compile if USE_OPENSSL is not defined!!!} -{$ENDIF} - -{$IFDEF HAS_DIRECTIVE_HPPEMIT_LINKUNIT} - {$HPPEMIT LINKUNIT} -{$ELSE} - {$HPPEMIT '#pragma link "IdSSLOpenSSLHeaders_static"'} -{$ENDIF} - -implementation - -{$IFDEF STATICLOAD_OPENSSL} -uses - IdGlobal, Posix.SysTypes, IdCTypes, IdSSLOpenSSLHeaders; - -const - SSL_LIB_name = 'libssl.a'; {Do not Localize} - SSLCLIB_LIB_name = 'libcrypto.a'; {Do not Localize} - -function SSL_CTX_set_cipher_list_func(_para1: PSSL_CTX; const str: PIdAnsiChar): TIdC_INT cdecl; external SSL_LIB_NAME name 'SSL_CTX_set_cipher_list'; - -function SSL_CTX_new_func(meth: PSSL_METHOD): PSSL_CTX cdecl; external SSL_LIB_NAME name 'SSL_CTX_new'; - -procedure SSL_CTX_free_proc(_para1: PSSL_CTX) cdecl; external SSL_LIB_NAME name 'SSL_CTX_free'; - -function SSL_set_fd_func(s: PSSL; fd: TIdC_INT): TIdC_INT cdecl; external SSL_LIB_NAME name 'SSL_set_fd'; - -function SSL_CTX_use_PrivateKey_file_func(ctx: PSSL_CTX; const _file: PIdAnsiChar; _type: TIdC_INT): TIdC_INT cdecl; external SSL_LIB_NAME name 'SSL_CTX_use_PrivateKey_file'; - -function SSL_CTX_use_PrivateKey_func(ctx: PSSL_CTX; pkey: PEVP_PKEY): TIdC_INT cdecl; external SSL_LIB_NAME name 'SSL_CTX_use_PrivateKey'; - -function SSL_CTX_use_certificate_func(ctx: PSSL_CTX; x: PX509): TIdC_INT cdecl; external SSL_LIB_NAME name 'SSL_CTX_use_certificate'; - -function SSL_CTX_use_certificate_file_func(ctx: PSSL_CTX; const _file: PIdAnsiChar; _type: TIdC_INT): TIdC_INT cdecl; external SSL_LIB_NAME name 'SSL_CTX_use_certificate_file'; - -procedure SSL_load_error_strings_proc cdecl; external SSL_LIB_NAME name 'SSL_load_error_strings'; - -function SSL_state_string_long_func(s: PSSL): PIdAnsiChar cdecl; external SSL_LIB_NAME name 'SSL_state_string_long'; - -function SSL_alert_desc_string_long_func(value : TIdC_INT) : PIdAnsiChar cdecl; external SSL_LIB_NAME name 'SSL_alert_desc_string_long'; - -function SSL_alert_type_string_long_func(value : TIdC_INT) : PIdAnsiChar cdecl; external SSL_LIB_NAME name 'SSL_alert_type_string_long'; - -function SSL_get_peer_certificate_func(s: PSSL): PX509 cdecl; external SSL_LIB_NAME name 'SSL_get_peer_certificate'; - -procedure SSL_CTX_set_verify_proc(ctx: PSSL_CTX; mode: TIdC_INT; callback: TSSL_CTX_set_verify_callback) cdecl; external SSL_LIB_NAME name 'SSL_CTX_set_verify'; - -procedure SSL_CTX_set_verify_depth_proc(ctx: PSSL_CTX; depth: TIdC_INT) cdecl; external SSL_LIB_NAME name 'SSL_CTX_set_verify_depth'; - -function SSL_CTX_get_verify_depth_func(ctx: PSSL_CTX): TIdC_INT cdecl; external SSL_LIB_NAME name 'SSL_CTX_get_verify_depth'; - -procedure SSL_CTX_set_default_passwd_cb_proc(ctx: PSSL_CTX; cb: ppem_password_cb) cdecl; external SSL_LIB_NAME name 'SSL_CTX_set_default_passwd_cb'; - -procedure SSL_CTX_set_default_passwd_cb_userdata_proc(ctx: PSSL_CTX; u: Pointer) cdecl; external SSL_LIB_NAME name 'SSL_CTX_set_default_passwd_cb_userdata'; - -function SSL_CTX_check_private_key_func(ctx: PSSL_CTX): TIdC_INT cdecl; external SSL_LIB_NAME name 'SSL_CTX_check_private_key'; - -function SSL_new_func(ctx: PSSL_CTX): PSSL cdecl; external SSL_LIB_NAME name 'SSL_new'; - -procedure SSL_free_proc(ssl: PSSL) cdecl; external SSL_LIB_NAME name 'SSL_free'; - -function SSL_accept_func(ssl: PSSL): TIdC_INT cdecl; external SSL_LIB_NAME name 'SSL_accept'; - -function SSL_connect_func(ssl: PSSL): TIdC_INT cdecl; external SSL_LIB_NAME name 'SSL_connect'; - -function SSL_read_func(ssl: PSSL; buf: Pointer; num: TIdC_INT): TIdC_INT cdecl; external SSL_LIB_NAME name 'SSL_read'; - -function SSL_peek_func(ssl: PSSL; buf: Pointer; num: TIdC_INT): TIdC_INT cdecl; external SSL_LIB_NAME name 'SSL_peek'; - -function SSL_pending_func(ssl : PSSL) : TIdC_INT cdecl; external SSL_LIB_NAME name 'SSL_pending'; - -function SSL_write_func(ssl: PSSL; const buf: Pointer; num: TIdC_INT): TIdC_INT cdecl; external SSL_LIB_NAME name 'SSL_write'; - -function SSL_ctrl_func(ssl : PSSL; cmd : TIdC_INT; larg : TIdC_LONG; parg : Pointer) : TIdC_LONG cdecl; external SSL_LIB_NAME name 'SSL_ctrl'; - -function SSL_callback_ctrl_func(ssl : PSSL; cmd : TIdC_INT; fp : SSL_callback_ctrl_fp) : TIdC_LONG cdecl; external SSL_LIB_NAME name 'SSL_callback_ctrl'; - -function SSL_CTX_ctrl_func(ssl: PSSL_CTX; cmd: TIdC_INT; larg: TIdC_LONG; parg: Pointer): TIdC_LONG cdecl; external SSL_LIB_NAME name 'SSL_CTX_ctrl'; - -function SSL_CTX_callback_ctrl_func(ssl : PSSL_CTX; cmd : TIdC_INT; fp : SSL_callback_ctrl_fp) : TIdC_LONG cdecl; external SSL_LIB_NAME name 'SSL_CTX_callback_ctrl'; - -function SSL_get_error_func(s: PSSL; ret_code: TIdC_INT): TIdC_INT cdecl; external SSL_LIB_NAME name 'SSL_get_error'; - -{$IFNDEF OPENSSL_NO_SSL2} -function SSLv2_method_func: PSSL_METHOD cdecl; external SSL_LIB_NAME name 'SSLv2_method'; - -function SSLv2_server_method_func: PSSL_METHOD cdecl; external SSL_LIB_NAME name 'SSLv2_server_method'; - -function SSLv2_client_method_func: PSSL_METHOD cdecl; external SSL_LIB_NAME name 'SSLv2_client_method'; -{$ENDIF} - -function SSLv3_method_func: PSSL_METHOD cdecl; external SSL_LIB_NAME name 'SSLv3_method'; - -function SSLv3_server_method_func: PSSL_METHOD cdecl; external SSL_LIB_NAME name 'SSLv3_server_method'; - -function SSLv3_client_method_func: PSSL_METHOD cdecl; external SSL_LIB_NAME name 'SSLv3_client_method'; - -function SSLv23_method_func: PSSL_METHOD cdecl; external SSL_LIB_NAME name 'SSLv23_method'; - -function SSLv23_server_method_func: PSSL_METHOD cdecl; external SSL_LIB_NAME name 'SSLv23_server_method'; - -function SSLv23_client_method_func: PSSL_METHOD cdecl; external SSL_LIB_NAME name 'SSLv23_client_method'; - -function TLSv1_method_func: PSSL_METHOD cdecl; external SSL_LIB_NAME name 'TLSv1_method'; - -function TLSv1_server_method_func: PSSL_METHOD cdecl; external SSL_LIB_NAME name 'TLSv1_server_method'; - -function TLSv1_client_method_func: PSSL_METHOD cdecl; external SSL_LIB_NAME name 'TLSv1_client_method'; - -function TLSv1_1_method_func: PSSL_METHOD cdecl; external SSL_LIB_NAME name 'TLSv1_1_method'; - -function TLSv1_1_server_method_func: PSSL_METHOD cdecl; external SSL_LIB_NAME name 'TLSv1_1_server_method'; - -function TLSv1_1_client_method_func: PSSL_METHOD cdecl; external SSL_LIB_NAME name 'TLSv1_1_client_method'; - -function TLSv1_2_method_func: PSSL_METHOD cdecl; external SSL_LIB_NAME name 'TLSv1_2_method'; - -function TLSv1_2_server_method_func: PSSL_METHOD cdecl; external SSL_LIB_NAME name 'TLSv1_2_server_method'; - -function TLSv1_2_client_method_func: PSSL_METHOD cdecl; external SSL_LIB_NAME name 'TLSv1_2_client_method'; - -function DTLSv1_method_func: PSSL_METHOD cdecl; external SSL_LIB_NAME name 'DTLSv1_method'; - -function DTLSv1_server_method_func: PSSL_METHOD cdecl; external SSL_LIB_NAME name 'DTLSv1_server_method'; - -function DTLSv1_client_method_func: PSSL_METHOD cdecl; external SSL_LIB_NAME name 'DTLSv1_client_method'; - -function SSL_shutdown_func(s: PSSL): TIdC_INT cdecl; external SSL_LIB_NAME name 'SSL_shutdown'; - -procedure SSL_set_connect_state_proc(s: PSSL) cdecl; external SSL_LIB_NAME name 'SSL_set_connect_state'; - -procedure SSL_set_accept_state_proc(s: PSSL) cdecl; external SSL_LIB_NAME name 'SSL_set_accept_state'; - -procedure SSL_set_shutdown_proc(ssl: PSSL; mode: TIdC_INT) cdecl; external SSL_LIB_NAME name 'SSL_set_shutdown'; - -function SSL_CTX_load_verify_locations_func(ctx: PSSL_CTX; const CAfile: PIdAnsiChar; const CApath: PIdAnsiChar): TIdC_INT cdecl; external SSL_LIB_NAME name 'SSL_CTX_load_verify_locations'; - -function SSL_get_session_func(const ssl: PSSL): PSSL_SESSION cdecl; external SSL_LIB_NAME name 'SSL_get_session'; - -function SSLeay_add_ssl_algorithms_func: TIdC_INT cdecl; external SSL_LIB_NAME name 'SSL_library_init'; - -function SSL_SESSION_get_id_func(const s: PSSL_SESSION; length: PIdC_UINT): PIdAnsiChar cdecl; external SSL_LIB_NAME name 'SSL_SESSION_get_id'; - -procedure SSL_copy_session_id_proc(sslTo: PSSL; const sslFrom: PSSL) cdecl; external SSL_LIB_NAME name 'SSL_copy_session_id'; - -function SSLeay_version_func(_type : TIdC_INT) : PIdAnsiChar cdecl; external SSLCLIB_LIB_name name 'SSLeay_version'; - -function SSLeay_func: TIdC_ULONG cdecl; external SSLCLIB_LIB_name name 'SSLeay'; - -function d2i_X509_NAME_func(pr : PPX509_NAME; _in : PPByte; length : TIdC_LONG):PX509_NAME cdecl; external SSLCLIB_LIB_name name 'd2i_X509_NAME'; - -function i2d_X509_NAME_func(x : PX509_NAME; buf : PPByte) : TIdC_INT cdecl; external SSLCLIB_LIB_name name 'i2d_X509_NAME'; - -function X509_NAME_oneline_func(a: PX509_NAME; buf: PIdAnsiChar; size: TIdC_INT): PIdAnsiChar cdecl; external SSLCLIB_LIB_name name 'X509_NAME_oneline'; - -function X509_NAME_cmp_func(const a, b: PX509_NAME): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'X509_NAME_cmp'; - -function X509_NAME_hash_func(x: PX509_NAME): TIdC_ULONG cdecl; external SSLCLIB_LIB_name name 'X509_NAME_hash'; - -function X509_set_issuer_name_func(x: PX509; name: PX509_NAME): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'X509_set_issuer_name'; - -function X509_get_issuer_name_func(a: PX509): PX509_NAME cdecl; external SSLCLIB_LIB_name name 'X509_get_issuer_name'; - -function X509_set_subject_name_func(x: PX509; name: PX509_NAME): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'X509_set_subject_name'; - -function X509_get_subject_name_func(a: PX509): PX509_NAME cdecl; external SSLCLIB_LIB_name name 'X509_get_subject_name'; - -function X509_digest_func(const data: PX509; const _type: PEVP_MD; - md: PByte; var len: TIdC_UINT): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'X509_digest'; - -function X509_LOOKUP_ctrl_func(ctx : PX509_LOOKUP; cmd : TIdC_INT; argc : PIdAnsiChar; arg1 : TIdC_LONG; ret : PPIdAnsiChar) : TIdC_INT cdecl; external SSLCLIB_LIB_name name 'X509_LOOKUP_ctrl'; - -function X509_STORE_add_cert_func(ctx : PX509_STORE; x : PX509) : TIdC_INT cdecl; external SSLCLIB_LIB_name name 'X509_STORE_add_cert'; - -function X509_STORE_add_crl_func(ctx : PX509_STORE; x : PX509_CRL) : TIdC_INT cdecl; external SSLCLIB_LIB_name name 'X509_STORE_add_crl'; - -function X509_STORE_CTX_get_ex_data_func(ctx: PX509_STORE_CTX; idx: TIdC_INT): Pointer cdecl; external SSLCLIB_LIB_name name 'X509_STORE_CTX_get_ex_data'; - -function X509_STORE_CTX_get_error_func(ctx: PX509_STORE_CTX): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'X509_STORE_CTX_get_error'; - -procedure X509_STORE_CTX_set_error_proc(ctx: PX509_STORE_CTX; s: TIdC_INT) cdecl; external SSLCLIB_LIB_name name 'X509_STORE_CTX_set_error'; - -function X509_STORE_CTX_get_error_depth_func(ctx: PX509_STORE_CTX): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'X509_STORE_CTX_get_error_depth'; - -function X509_STORE_CTX_get_current_cert_func(ctx: PX509_STORE_CTX): PX509 cdecl; external SSLCLIB_LIB_name name 'X509_STORE_CTX_get_current_cert'; - -function X509_STORE_add_lookup_func(v : PX509_STORE; m : PX509_LOOKUP_METHOD) : PX509_LOOKUP cdecl; external SSLCLIB_LIB_name name 'X509_STORE_add_lookup'; - -function X509_STORE_load_locations_func( ctx : PX509_STORE; const _file, path : PIdAnsiChar) : TIdC_INT cdecl; external SSLCLIB_LIB_name name 'X509_STORE_load_locations'; - -function i2d_DSAPrivateKey_func(x: PDSA; buf: PPByte): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'i2d_DSAPrivateKey'; - -function d2i_DSAPrivateKey_func(pr : PDSA; _in : PPByte; len : TIdC_INT): PDSA cdecl; external SSLCLIB_LIB_name name 'd2i_DSAPrivateKey'; - -function d2i_PrivateKey_func(pr : PEVP_PKEY; _in : PPByte; len : TIdC_INT): PEVP_PKEY cdecl; external SSLCLIB_LIB_name name 'd2i_PrivateKey'; - -function d2i_PrivateKey_bio_func(bp : PBIO; a : PPEVP_PKEY) : PEVP_PKEY cdecl; external SSLCLIB_LIB_name name 'd2i_PrivateKey_bio'; - -function X509_sign_func(x: PX509; pkey: PEVP_PKEY; const md: PEVP_MD): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'X509_sign'; - -function X509_REQ_sign_func(x: PX509_REQ; pkey: PEVP_PKEY; const md: PEVP_MD): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'X509_REQ_sign'; - -function X509_REQ_add_extensions_func(req: PX509_REQ; exts: PSTACK_OF_X509_EXTENSION): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'X509_REQ_add_extensions'; - -function X509V3_EXT_conf_nid_func(conf: PLHASH; ctx: PX509V3_CTX; ext_nid: TIdC_INT; value: PIdAnsiChar): PX509_EXTENSION cdecl; external SSLCLIB_LIB_name name 'X509V3_EXT_conf_nid'; - -function X509_EXTENSION_create_by_NID_func(ex: PPX509_EXTENSION; nid: TIdC_INT; - crit: TIdC_INT; data: PASN1_OCTET_STRING): PX509_EXTENSION cdecl; external SSLCLIB_LIB_name name 'X509_EXTENSION_create_by_NID'; - -procedure X509V3_set_ctx_proc(ctx: PX509V3_CTX; issuer, subject: PX509; req: PX509_REQ; crl: PX509_CRL; flags: TIdC_INT) cdecl; external SSLCLIB_LIB_name name 'X509V3_set_ctx'; - -procedure X509_EXTENSION_free_proc(ex: PX509_EXTENSION) cdecl; external SSLCLIB_LIB_name name 'X509_EXTENSION_free'; - -function X509_add_ext_func(cert: PX509; ext: PX509_EXTENSION; loc: TIdC_INT): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'X509_add_ext'; - -{$IFNDEF OPENSSL_NO_BIO} -function X509_print_func(bp : PBIO; x : PX509) : TIdC_INT cdecl; external SSLCLIB_LIB_name name 'X509_print'; -{$ENDIF} - -procedure RAND_cleanup_func; cdecl; external SSLCLIB_LIB_name name 'RAND_cleanup'; - -function RAND_bytes_func(buf : PIdAnsiChar; num : integer) : integer; cdecl; external SSLCLIB_LIB_name name 'RAND_bytes'; - -function RAND_pseudo_bytes_func(buf : PIdAnsiChar; num : integer) : integer; cdecl; external SSLCLIB_LIB_name name 'RAND_pseudo_bytes'; - -procedure RAND_seed_proc(buf : PIdAnsiChar; num : integer); cdecl; external SSLCLIB_LIB_name name 'RAND_seed'; - -procedure RAND_add_proc(buf : PIdAnsiChar; num : integer; entropy : integer); cdecl; external SSLCLIB_LIB_name name 'RAND_add'; - -function RAND_status_func: integer; cdecl; external SSLCLIB_LIB_name name 'RAND_status'; - -{$IFDEF SYS_WIN} -procedure RAND_screen_proc cdecl; external SSLCLIB_LIB_name name 'RAND_screen'; - -function RAND_event_func(iMsg : UINT; wp : wparam; lp : lparam) : integer; cdecl; external SSLCLIB_LIB_name name 'RAND_event'; -{$ENDIF} - -{$IFNDEF OPENSSL_NO_DES} -procedure DES_set_odd_parity_proc(key: Pdes_cblock) cdecl; external SSLCLIB_LIB_name name 'DES_set_odd_parity'; - -function DES_set_key_func(key: Pconst_DES_cblock; schedule: DES_key_schedule): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'DES_set_key'; - -procedure DES_ecb_encrypt_proc(input, output: Pconst_DES_cblock; ks: DES_key_schedule; enc: TIdC_INT) cdecl; external SSLCLIB_LIB_name name 'DES_ecb_encrypt'; - -//procedure Id_ossl_old_des_set_odd_parity_proc(key : p_ossl_old_des_cblock) cdecl; external SSLCLIB_LIB_name name 'Id_ossl_old_des_set_odd_parity'; - -//function Id_ossl_old_des_set_key_func(key : P_ossl_old_des_cblock; schedule : _ossl_old_des_key_schedule) : TIdC_INT cdecl; external SSLCLIB_LIB_name name 'Id_ossl_old_des_set_key'; - -//procedure Id_ossl_old_des_ecb_encrypt_proc( input : p_ossl_old_des_cblock; output : p_ossl_old_des_cblock; ks : p_ossl_old_des_key_schedule; enc : TIdC_int) cdecl; external SSLCLIB_LIB_name name 'Id_ossl_old_des_ecb_encrypt'; -{$ENDIF} - -function SSL_set_ex_data_func(ssl: PSSL; idx: TIdC_INT; data: Pointer): TIdC_INT cdecl; external SSL_LIB_NAME name 'SSL_set_ex_data'; - -function SSL_get_ex_data_func(ssl: PSSL; idx: TIdC_INT): Pointer cdecl; external SSL_LIB_NAME name 'SSL_get_ex_data'; - -function SSL_load_client_CA_file_func(const _file: PIdAnsiChar): PSTACK_OF_X509_NAME cdecl; external SSL_LIB_NAME name 'SSL_load_client_CA_file'; - -procedure SSL_CTX_set_client_CA_list_proc(ctx: PSSL_CTX; list: PSTACK_OF_X509_NAME) cdecl; external SSL_LIB_NAME name 'SSL_CTX_set_client_CA_list'; - -function SSL_CTX_set_default_verify_paths_func(ctx: PSSL_CTX): TIdC_INT cdecl; external SSL_LIB_NAME name 'SSL_CTX_set_default_verify_paths'; - -function SSL_CTX_set_session_id_context_func(ctx: PSSL_CTX; const sid_ctx: PByte; sid_ctx_len: TIdC_UINT): TIdC_INT cdecl; external SSL_LIB_NAME name 'SSL_CTX_set_session_id_context'; - -function SSL_CIPHER_description_func(_para1: PSSL_CIPHER; buf: PIdAnsiChar; size: TIdC_INT): PIdAnsiChar cdecl; external SSL_LIB_NAME name 'SSL_CIPHER_description'; - -function SSL_get_current_cipher_func(const s: PSSL): PSSL_CIPHER cdecl; external SSL_LIB_NAME name 'SSL_get_current_cipher'; - -function SSL_CIPHER_get_name_func(const c: PSSL_CIPHER): PIdAnsiChar cdecl; external SSL_LIB_NAME name 'SSL_CIPHER_get_name'; - -function SSL_CIPHER_get_version_func(const c: PSSL_CIPHER): PIdAnsiChar cdecl; external SSL_LIB_NAME name 'SSL_CIPHER_get_version'; - -function SSL_CIPHER_get_bits_func(const c: PSSL_CIPHER; var alg_bits: TIdC_INT): TIdC_INT cdecl; external SSL_LIB_NAME name 'SSL_CIPHER_get_bits'; - -procedure CRYPTO_lock_proc(mode, _type : TIdC_INT; const _file : PIdAnsiChar; line : TIdC_INT) cdecl; external SSLCLIB_LIB_name name 'CRYPTO_lock'; - -function CRYPTO_num_locks_func: TIdC_INT cdecl; external SSLCLIB_LIB_name name 'CRYPTO_num_locks'; - -procedure CRYPTO_set_locking_callback_proc(func: TIdSslLockingCallback) cdecl; external SSLCLIB_LIB_name name 'CRYPTO_set_locking_callback'; - -function CRYPTO_THREADID_set_callback_func(threadid_func : TCRYPTO_THREADID_set_callback_threadid_func) : TIdC_INT cdecl; external SSLCLIB_LIB_name name 'CRYPTO_THREADID_set_callback'; - -procedure CRYPTO_THREADID_set_numeric_proc(id : PCRYPTO_THREADID; val : TIdC_ULONG) cdecl; external SSLCLIB_LIB_name name 'CRYPTO_THREADID_set_numeric'; - -procedure CRYPTO_THREADID_set_pointer_proc(id : PCRYPTO_THREADID; ptr : Pointer) cdecl; external SSLCLIB_LIB_name name 'CRYPTO_THREADID_set_pointer'; - -procedure ERR_put_error_proc(lib, func, reason : TIdC_INT; _file : PIdAnsiChar; line : TIdC_INT) cdecl; external SSLCLIB_LIB_name name 'ERR_put_error'; - -function ERR_get_error_func: TIdC_ULONG cdecl; external SSLCLIB_LIB_name name 'ERR_get_error'; - -function ERR_peek_error_func: TIdC_ULONG cdecl; external SSLCLIB_LIB_name name 'ERR_peek_error'; - -function ERR_peek_last_error_func: TIdC_ULONG cdecl; external SSLCLIB_LIB_name name 'ERR_peek_last_error'; - -procedure ERR_clear_error_proc cdecl; external SSLCLIB_LIB_name name 'ERR_clear_error'; - -function ERR_error_string_func(e: TIdC_ULONG; buf: PIdAnsiChar): PIdAnsiChar cdecl; external SSLCLIB_LIB_name name 'ERR_error_string'; - -procedure ERR_error_string_n_proc(e: TIdC_ULONG; buf: PIdAnsiChar; len : size_t) cdecl; external SSLCLIB_LIB_name name 'ERR_error_string_n'; - -function ERR_lib_error_string_func(e : TIdC_ULONG): PIdAnsiChar cdecl; external SSLCLIB_LIB_name name 'ERR_lib_error_string'; - -function ERR_func_error_string_func(e : TIdC_ULONG): PIdAnsiChar cdecl; external SSLCLIB_LIB_name name 'ERR_func_error_string'; - -function ERR_reason_error_string_func(e : TIdC_ULONG): PIdAnsiChar cdecl; external SSLCLIB_LIB_name name 'ERR_reason_error_string'; - -procedure ERR_load_ERR_strings_proc cdecl; external SSLCLIB_LIB_name name 'ERR_load_ERR_strings'; - -procedure ERR_load_crypto_strings_proc cdecl; external SSLCLIB_LIB_name name 'ERR_load_crypto_strings'; - -procedure ERR_free_strings_proc cdecl; external SSLCLIB_LIB_name name 'ERR_free_strings'; - -procedure ERR_remove_thread_state_proc(const tId : PCRYPTO_THREADID) cdecl; external SSLCLIB_LIB_name name 'ERR_remove_thread_state'; - -procedure CRYPTO_cleanup_all_ex_data_proc cdecl; external SSLCLIB_LIB_name name 'CRYPTO_cleanup_all_ex_data'; - -function SSL_COMP_get_compression_methods_func: PSTACK_OF_SSL_COMP cdecl; external SSL_LIB_NAME name 'SSL_COMP_get_compression_methods'; - -procedure SSL_COMP_free_compression_methods_func; cdecl; external SSL_LIB_NAME name 'SSL_COMP_free_compression_methods' - -procedure sk_pop_free_proc(st: PSTACK; func: Tsk_pop_free_func) cdecl; external SSLCLIB_LIB_name name 'sk_pop_free'; - -procedure RSA_free_proc(rsa: PRSA) cdecl; external SSLCLIB_LIB_name name 'RSA_free'; - -function RSA_generate_key_func(bits: TIdC_INT; e: TIdC_ULONG; callback: TRSA_generate_key_callback; cb_arg: Pointer): PRSA cdecl; external SSLCLIB_LIB_name name 'RSA_generate_key'; - -function RSA_check_key_func(const rsa: PRSA): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'RSA_check_key'; - -function RSA_generate_key_ex_func(rsa : PRSA; bits : TIdC_INT; e : PBIGNUM; cb : PBN_GENCB) : TIdC_INT cdecl; external SSLCLIB_LIB_name name 'RSA_generate_key_ex'; - -function RSA_new_func: PRSA cdecl; external SSLCLIB_LIB_name name 'RSA_new'; - -function RSA_size_func(key: PRSA): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'RSA_size'; - -function RSA_private_decrypt_func(flen: TIdC_INT; from: PByte; _to: PByte; rsa: PRSA; padding: TIdC_INT): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'RSA_private_decrypt'; - -function RSA_public_encrypt_func(flen: TIdC_INT; from: PByte; _to: PByte; rsa: PRSA; padding: TIdC_INT): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'RSA_public_encrypt'; - -procedure DH_free_proc(dh: PDH) cdecl; external SSLCLIB_LIB_name name 'DH_free'; - -function BN_new_func: PBIGNUM cdecl; external SSLCLIB_LIB_name name 'BN_new'; - -procedure BN_free_proc(a: PBIGNUM) cdecl; external SSLCLIB_LIB_name name 'BN_free'; - -function BN_hex2bn_func(var n:PBIGNUM; const Str: PIdAnsiChar): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'BN_hex2bn'; - -function BN_bn2hex_func(const n:PBIGNUM): PIdAnsiChar cdecl; external SSLCLIB_LIB_name name 'BN_bn2hex'; - -function BN_set_word_func(a: PBIGNUM; w: TIdC_ULONG): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'BN_set_word'; - -function BIO_new_func(_type: PBIO_METHOD): PBIO cdecl; external SSLCLIB_LIB_name name 'BIO_new'; - -function BIO_free_func(bio: PBIO): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'BIO_free'; - -function BIO_new_mem_buf_func(buf : Pointer; len : TIdC_INT) : PBIO cdecl; external SSLCLIB_LIB_name name 'BIO_new_mem_buf'; - -function BIO_s_mem_func: PBIO_METHOD cdecl; external SSLCLIB_LIB_name name 'BIO_s_mem'; - -function BIO_s_file_func: PBIO_METHOD cdecl; external SSLCLIB_LIB_name name 'BIO_s_file'; - -function BIO_ctrl_func(bp: PBIO; cmd: TIdC_INT; larg: TIdC_LONG; parg: Pointer): TIdC_LONG cdecl; external SSLCLIB_LIB_name name 'BIO_ctrl'; - -function BIO_int_ctrl_func(bp : PBIO; cmd : TIdC_INT; larg : TIdC_LONG; iArg : TIdC_INT) : TIdC_LONG cdecl; external SSLCLIB_LIB_name name 'BIO_int_ctrl'; - -function BIO_ptr_ctrl_func(bp : PBIO; cmd : TIdC_INT; larg : TIdC_LONG) : PIdAnsiChar cdecl; external SSLCLIB_LIB_name name 'BIO_ptr_ctrl'; - -function BIO_new_file_func(const filename: PIdAnsiChar; const mode: PIdAnsiChar): PBIO cdecl; external SSLCLIB_LIB_name name 'BIO_new_file'; - -function BIO_puts_func(b: PBIO; const txt: PIdAnsiChar): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'BIO_puts'; - -function BIO_read_func(b: PBIO; data: Pointer; len: TIdC_INT): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'BIO_read'; - -function BIO_write_func(b: PBIO; const buf: Pointer; len: TIdC_INT): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'BIO_write'; - -function i2d_X509_bio_func(bp: PBIO; x: PX509): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'i2d_X509_bio'; - -function i2d_PrivateKey_bio_func(b: PBIO; pkey: PEVP_PKEY): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'i2d_PrivateKey_bio'; - -function d2i_X509_bio_func(bp: PBIO; x: PPx509): PX509 cdecl; external SSLCLIB_LIB_name name 'd2i_X509_bio'; - -function i2d_X509_REQ_bio_func(bp: PBIO; x: PX509_REQ): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'i2d_X509_REQ_bio'; - -function i2d_PKCS7_func(x: PPKCS7; buf: PPByte): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'i2d_PKCS7'; - -function d2i_PKCS7_func(pr : PPKCS7; _in : PPByte; len : TIdC_INT): PPKCS7 cdecl; external SSLCLIB_LIB_name name 'd2i_PKCS7'; - -function i2d_X509_func(x: PX509; buf: PPByte) : TIdC_INT cdecl; external SSLCLIB_LIB_name name 'i2d_X509'; - -function d2i_X509_func(pr : PX509; _in : PPByte; len : TIdC_INT): PX509 cdecl; external SSLCLIB_LIB_name name 'd2i_X509'; - -function i2d_X509_REQ_func(x: PX509_REQ; buf: PPByte): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'i2d_X509_REQ'; - -function d2i_X509_REQ_func(pr : PX509_REQ; _in : PPByte; len : TIdC_INT): PX509_REQ cdecl; external SSLCLIB_LIB_name name 'd2i_X509_REQ'; - -function i2d_X509_CRL_func(x: PX509_CRL; buf: PPByte): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'i2d_X509_CRL'; - -function d2i_X509_CRL_func(pr : PX509_CRL; _in : PPByte; len : TIdC_INT): PX509_REQ cdecl; external SSLCLIB_LIB_name name 'd2i_X509_CRL'; - -function i2d_RSAPrivateKey_func(x: PRSA; buf: PPByte): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'i2d_RSAPrivateKey'; - -function d2i_RSAPrivateKey_func(pr : PRSA; _in : PPByte; len : TIdC_INT): PRSA cdecl; external SSLCLIB_LIB_name name 'd2i_RSAPrivateKey'; - -function i2d_RSAPublicKey_func(x: PRSA; buf: PPByte): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'i2d_RSAPublicKey'; - -function d2i_RSAPublicKey_func(pr : PRSA; _in : PPByte; len : TIdC_INT): PRSA cdecl; external SSLCLIB_LIB_name name 'd2i_RSAPublicKey'; - -function i2d_PrivateKey_func(x: PEVP_PKEY; buf: PPByte): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'i2d_PrivateKey'; - -function i2d_DSAparams_func(x: PDSA; buf: PPByte): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'i2d_DSAparams'; - -function d2i_DSAparams_func(pr : PDSA; _in : PPByte; len : TIdC_INT): PDSA cdecl; external SSLCLIB_LIB_name name 'd2i_DSAparams'; - -function i2d_DHparams_func(x: PDH; buf: PPByte): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'i2d_DHparams'; - -function d2i_DHparams_func(pr : PDH; _in : PPByte; len : TIdC_INT): PDH cdecl; external SSLCLIB_LIB_name name 'd2i_DHparams'; - -function i2d_NETSCAPE_CERT_SEQUENCE_func(x: PNETSCAPE_CERT_SEQUENCE; buf: PPByte): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'i2d_NETSCAPE_CERT_SEQUENCE'; - -function d2i_NETSCAPE_CERT_SEQUENCE_func(pr : PNETSCAPE_CERT_SEQUENCE; _in : PPByte; len : TIdC_INT): PNETSCAPE_CERT_SEQUENCE cdecl; external SSLCLIB_LIB_name name 'd2i_NETSCAPE_CERT_SEQUENCE'; - -function i2d_PUBKEY_func(x: PEVP_PKEY; buf: PPByte): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'i2d_PUBKEY'; - -function d2i_PUBKEY_func(pr : PEVP_PKEY; _in : PPByte; len : TIdC_INT): PEVP_PKEY cdecl; external SSLCLIB_LIB_name name 'd2i_PUBKEY'; - -function X509_get_default_cert_file_func: PIdAnsiChar cdecl; external SSLCLIB_LIB_name name 'X509_get_default_cert_file'; - -function X509_get_default_cert_file_env_func: PIdAnsiChar cdecl; external SSLCLIB_LIB_name name 'X509_get_default_cert_file_env'; - -function X509_new_func: PX509 cdecl; external SSLCLIB_LIB_name name 'X509_new'; - -procedure X509_free_proc(x: PX509) cdecl; external SSLCLIB_LIB_name name 'X509_free'; - -function X509_REQ_new_func: PX509_REQ cdecl; external SSLCLIB_LIB_name name 'X509_REQ_new'; - -procedure X509_REQ_free_proc(x:PX509_REQ) cdecl; external SSLCLIB_LIB_name name 'X509_REQ_free'; - -function X509_to_X509_REQ_func(x: PX509; pkey: PEVP_PKEY; const md: PEVP_MD): PX509_REQ cdecl; external SSLCLIB_LIB_name name 'X509_to_X509_REQ'; - -function X509_NAME_new_func: PX509_NAME cdecl; external SSLCLIB_LIB_name name 'X509_NAME_new'; - -procedure X509_NAME_free_proc(x:PX509_NAME) cdecl; external SSLCLIB_LIB_name name 'X509_NAME_free'; - -function X509_NAME_add_entry_by_txt_func(name: PX509_NAME; const field: PIdAnsiChar; _type: TIdC_INT; - const bytes: PIdAnsiChar; len, loc, _set: TIdC_INT): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'X509_NAME_add_entry_by_txt'; - -procedure X509_INFO_free_proc(a : PX509_INFO) cdecl; external SSLCLIB_LIB_name name 'X509_INFO_free'; - -function X509_set_version_func(x: PX509; version: TIdC_LONG): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'X509_set_version'; - -function X509_get_serialNumber_func(x: PX509): PASN1_INTEGER cdecl; external SSLCLIB_LIB_name name 'X509_get_serialNumber'; - -function X509_gmtime_adj_func(s: PASN1_TIME; adj: TIdC_LONG): PASN1_TIME cdecl; external SSLCLIB_LIB_name name 'X509_gmtime_adj'; - -function X509_set_notBefore_func(x: PX509; tm: PASN1_TIME): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'X509_set_notBefore'; - -function X509_set_notAfter_func(x: PX509; tm: PASN1_TIME): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'X509_set_notAfter'; - -function X509_set_pubkey_func(x: PX509; pkey: PEVP_PKEY): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'X509_set_pubkey'; - -function X509_REQ_set_pubkey_func(x: PX509_REQ; pkey: PEVP_PKEY): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'X509_REQ_set_pubkey'; - -function X509_PUBKEY_get_func(key: PX509_PUBKEY): PEVP_PKEY cdecl; external SSLCLIB_LIB_name name 'X509_PUBKEY_get'; - -function X509_verify_func(x509: PX509; pkey: PEVP_PKEY): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'X509_verify'; - -{$IFNDEF SSLEAY_MACROS} -function PEM_read_bio_X509_func(bp: PBIO; x: PPX509; cb: ppem_password_cb; u: Pointer): PX509 cdecl; external SSLCLIB_LIB_name name 'PEM_read_bio_X509'; - -function PEM_read_bio_X509_REQ_func(bp :PBIO; x : PPX509_REQ; cb :ppem_password_cb; u: PIdAnsiChar) : PX509_REQ cdecl; external SSLCLIB_LIB_name name 'PEM_read_bio_X509_REQ'; - -function PEM_read_bio_X509_CRL_func(bp : PBIO; x : PPX509_CRL;cb : ppem_password_cb; u: Pointer) : PX509_CRL cdecl; external SSLCLIB_LIB_name name 'PEM_read_bio_X509_CRL'; - -function PEM_read_bio_RSAPrivateKey_func(bp : PBIO; x : PPRSA; cb : ppem_password_cb; u: Pointer) : PRSA cdecl; external SSLCLIB_LIB_name name 'PEM_read_bio_RSAPrivateKey'; - -function PEM_read_bio_RSAPublicKey_func(bp : PBIO; x : PPRSA; cb : ppem_password_cb; u: Pointer) : PRSA cdecl; external SSLCLIB_LIB_name name 'PEM_read_bio_RSAPublicKey'; - -function PEM_read_bio_DSAPrivateKey_func(bp : PBIO; x : PPDSA; cb : ppem_password_cb; u : Pointer) : PDSA cdecl; external SSLCLIB_LIB_name name 'PEM_read_bio_DSAPrivateKey'; - -function PEM_read_bio_PrivateKey_func(bp : PBIO; x : PPEVP_PKEY; cb : ppem_password_cb; u : Pointer) : PEVP_PKEY cdecl; external SSLCLIB_LIB_name name 'PEM_read_bio_PrivateKey'; - -function PEM_read_bio_PKCS7_func(bp : PBIO; x : PPPKCS7; cb : ppem_password_cb; u : Pointer) : PPKCS7 cdecl; external SSLCLIB_LIB_name name 'PEM_read_bio_PKCS7'; - -function PEM_read_bio_DHparams_func(bp : PBIO; x : PPDH; cb : ppem_password_cb; u : Pointer) : PDH cdecl; external SSLCLIB_LIB_name name 'PEM_read_bio_DHparams'; - -function PEM_read_bio_DSAparams_func(bp : PBIO; x : PPDSA; cb : ppem_password_cb; u : Pointer) : PDSA cdecl; external SSLCLIB_LIB_name name 'PEM_read_bio_DSAparams'; - -function PEM_read_bio_NETSCAPE_CERT_SEQUENCE_func(bp : PBIO; x : PPNETSCAPE_CERT_SEQUENCE; - cb : ppem_password_cb; u : Pointer) : PNETSCAPE_CERT_SEQUENCE cdecl; external SSLCLIB_LIB_name name 'PEM_read_bio_NETSCAPE_CERT_SEQUENCE'; - -function PEM_read_bio_PUBKEY_func(bp : PBIO; x : PPEVP_PKEY; cb : ppem_password_cb; u : Pointer) : PEVP_PKEY cdecl; external SSLCLIB_LIB_name name 'PEM_read_bio_PUBKEY'; - -function PEM_write_bio_X509_func(b: PBIO; x: PX509): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'PEM_write_bio_X509'; - -function PEM_write_bio_X509_REQ_func(bp: PBIO; x: PX509_REQ): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'PEM_write_bio_X509_REQ'; - -function PEM_write_bio_X509_CRL_func(bp : PBIO; x : PX509_CRL) : TIdC_INT cdecl; external SSLCLIB_LIB_name name 'PEM_write_bio_X509_CRL'; - -function PEM_write_bio_RSAPrivateKey_func(bp : PBIO; x : PRSA; const enc : PEVP_CIPHER; - kstr : PIdAnsiChar; klen : TIdC_INT; cb : Ppem_password_cb; u : Pointer) : TIdC_INT cdecl; external SSLCLIB_LIB_name name 'PEM_write_bio_RSAPrivateKey'; - -function PEM_write_bio_RSAPublicKey_func(bp : PBIO; x : PRSA) : TIdC_INT cdecl; external SSLCLIB_LIB_name name 'PEM_write_bio_RSAPublicKey'; - -function PEM_write_bio_DSAPrivateKey_func(bp : PBIO; x : PDSA; const enc : PEVP_CIPHER; - kstr : PIdAnsiChar; klen : TIdC_INT; cb : Ppem_password_cb; u : Pointer) : TIdC_INT cdecl; external SSLCLIB_LIB_name name 'PEM_write_bio_DSAPrivateKey'; - -function PEM_write_bio_PrivateKey_func(bp : PBIO; x : PEVP_PKEY; const enc : PEVP_CIPHER; - kstr : PIdAnsiChar; klen : TIdC_INT; cb : Ppem_password_cb; u : Pointer) : TIdC_INT cdecl; external SSLCLIB_LIB_name name 'PEM_write_bio_PrivateKey'; - -function PEM_write_bio_PKCS7_func(bp : PBIO; x : PPKCS7) : TIdC_INT cdecl; external SSLCLIB_LIB_name name 'PEM_write_bio_PKCS7'; - -function PEM_write_bio_DHparams_func(bp : PBIO; x : PDH): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'PEM_write_bio_DHparams'; - -function PEM_write_bio_DSAparams_func(bp : PBIO; x : PDSA) : TIdC_INT cdecl; external SSLCLIB_LIB_name name 'PEM_write_bio_DSAparams'; - -function PEM_write_bio_NETSCAPE_CERT_SEQUENCE_func(bp : PBIO; x : PDSA) : TIdC_INT cdecl; external SSLCLIB_LIB_name name 'PEM_write_bio_NETSCAPE_CERT_SEQUENCE'; - -function PEM_write_bio_PKCS8PrivateKey_func(bp: PBIO; key: PEVP_PKEY; enc: PEVP_CIPHER; - kstr: PIdAnsiChar; klen: TIdC_INT; cb: ppem_password_cb; u: Pointer): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'PEM_write_bio_PKCS8PrivateKey'; - -function PEM_write_bio_PUBKEY_func(bp: PBIO; x: PEVP_PKEY): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'PEM_write_bio_PUBKEY'; -{$ELSE} -function PEM_ASN1_write_bio_func(i2d: i2d_of_void; const name: PIdAnsiChar; - bp: PBIO; x: PIdAnsiChar; const enc: PEVP_CIPHER; kstr: PIdAnsiChar; klen: TIdC_INT; - cb: ppem_password_cb; u: Pointer):TIdC_INT cdecl; external SSLCLIB_LIB_name name 'PEM_ASN1_write_bio'; - -function PEM_ASN1_read_bio_func(d2i: d2i_OF_void; name: PIdAnsiChar; bp: PBIO; - x: PPointer; cb: ppem_password_cb; u:Pointer): Pointer cdecl; external SSLCLIB_LIB_name name 'PEM_ASN1_read_bio'; -{$ENDIF} - -function PEM_X509_INFO_read_bio_func(bp : PBIO; sk : PSTACK_OF_X509_INFO; - cb : ppem_password_cb; u : Pointer) : PSTACK_OF_X509_INFO cdecl; external SSLCLIB_LIB_name name 'PEM_X509_INFO_read_bio'; - -function PEM_read_bio_X509_AUX_func(bp : PBIO; x : PPX509; - cb : ppem_password_cb; u : Pointer) : PX509 cdecl; external SSLCLIB_LIB_name name 'PEM_read_bio_X509_AUX'; - -{$IFNDEF OPENSSL_NO_DES} -function EVP_des_ede3_cbc_func: PEVP_CIPHER cdecl; external SSLCLIB_LIB_name name 'EVP_des_ede3_cbc'; -{$ENDIF} - -{$IFNDEF OPENSSL_NO_SHA512} -function EVP_sha512_func: PEVP_MD cdecl; external SSLCLIB_LIB_name name 'EVP_sha512'; - -function EVP_sha384_func: PEVP_MD cdecl; external SSLCLIB_LIB_name name 'EVP_sha384'; -{$ENDIF} - -{$IFNDEF OPENSSL_NO_SHA256} -function EVP_sha256_func: PEVP_MD cdecl; external SSLCLIB_LIB_name name 'EVP_sha256'; - -function EVP_sha224_func: PEVP_MD cdecl; external SSLCLIB_LIB_name name 'EVP_sha224'; -{$ENDIF} - -{$IFNDEF OPENSSL_NO_SHA} -function EVP_sha1_func: PEVP_MD cdecl; external SSLCLIB_LIB_name name 'EVP_sha1'; -{$ENDIF} - -{$IFNDEF OPENSSL_NO_MD5} -function EVP_md5_func: PEVP_MD cdecl; external SSLCLIB_LIB_name name 'EVP_md5'; -{$ENDIF} - -{$IFNDEF OPENSSL_NO_MD4} -function EVP_md4_func: PEVP_MD cdecl; external SSLCLIB_LIB_name name 'EVP_md4'; -{$ENDIF} - -//{$IFNDEF OPENSSL_NO_MD2} -//function EVP_md2_func: PEVP_MD cdecl; external SSLCLIB_LIB_name name 'EVP_md2'; -//{$ENDIF} - -procedure EVP_MD_CTX_init_proc(ctx : PEVP_MD_CTX) cdecl; external SSLCLIB_LIB_name name 'EVP_MD_CTX_init'; - -function EVP_MD_CTX_cleanup_func(ctx : PEVP_MD_CTX) : TIdC_Int cdecl; external SSLCLIB_LIB_name name 'EVP_MD_CTX_cleanup'; - -function EVP_MD_CTX_create_func : PEVP_MD_CTX cdecl; external SSLCLIB_LIB_name name 'EVP_MD_CTX_create'; - -procedure EVP_MD_CTX_destroy_proc(ctx : PEVP_MD_CTX) cdecl; external SSLCLIB_LIB_name name 'EVP_MD_CTX_destroy'; - -function EVP_MD_CTX_copy_func(_out : PEVP_MD_CTX; _in: PEVP_MD_CTX) : TIdC_INT cdecl; external SSLCLIB_LIB_name name 'EVP_MD_CTX_copy'; - -function EVP_MD_CTX_copy_ex_func(_out : PEVP_MD_CTX; const _in: PEVP_MD_CTX) : TIdC_INT cdecl; external SSLCLIB_LIB_name name 'EVP_MD_CTX_copy_ex'; - -function EVP_DigestInit_ex_func(ctx : PEVP_MD_CTX; const AType : PEVP_MD; impl : PENGINE) : TIdC_Int cdecl; external SSLCLIB_LIB_name name 'EVP_DigestInit_ex'; - -function EVP_DigestUpdate_func(ctx : PEVP_MD_CTX; d : Pointer; cnt : size_t) : TIdC_Int cdecl; external SSLCLIB_LIB_name name 'EVP_DigestUpdate'; - -function EVP_DigestFinal_ex_func(ctx : PEVP_MD_CTX; md : PIdAnsiChar; var s : TIdC_UInt) : TIdC_Int cdecl; external SSLCLIB_LIB_name name 'EVP_DigestFinal_ex'; - -function EVP_PKEY_type_func(_type : TIdC_INT): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'EVP_PKEY_type'; - -function EVP_PKEY_new_func: PEVP_PKEY cdecl; external SSLCLIB_LIB_name name 'EVP_PKEY_new'; - -procedure EVP_PKEY_free_proc(pkey: PEVP_PKEY) cdecl; external SSLCLIB_LIB_name name 'EVP_PKEY_free'; - -function EVP_PKEY_assign_func(pkey: PEVP_PKEY; _type: TIdC_INT; key: Pointer): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'EVP_PKEY_assign'; - -function EVP_get_digestbyname_func(const name: PIdAnsiChar): PEVP_MD cdecl; external SSLCLIB_LIB_name name 'EVP_get_digestbyname'; - -{$IFNDEF OPENSSL_NO_HMAC} -procedure HMAC_CTX_init_proc(ctx : PHMAC_CTX) cdecl; external SSLCLIB_LIB_name name 'HMAC_CTX_init'; - -function HMAC_Init_ex_func(ctx : PHMAC_CTX; key : Pointer; len : TIdC_INT; - md : PEVP_MD; impl : PENGINE) : TIdC_INT cdecl; external SSLCLIB_LIB_name name 'HMAC_Init_ex'; - -function HMAC_Update_func(ctx : PHMAC_CTX; data : PIdAnsiChar; len : size_t) : TIdC_INT cdecl; external SSLCLIB_LIB_name name 'HMAC_Update'; - -function HMAC_Final_func(ctx : PHMAC_CTX; md : PIdAnsiChar; len : PIdC_UINT) : TIdC_INT cdecl; external SSLCLIB_LIB_name name 'HMAC_Final'; - -procedure HMAC_CTX_cleanup_proc(ctx : PHMAC_CTX) cdecl; external SSLCLIB_LIB_name name 'HMAC_CTX_cleanup'; -{$ENDIF} - -function OBJ_obj2nid_func(const o: PASN1_OBJECT): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'OBJ_obj2nid'; - -function OBJ_nid2obj_func(n : TIdC_INT) : PASN1_OBJECT cdecl; external SSLCLIB_LIB_name name 'OBJ_nid2obj'; - -function OBJ_nid2ln_func(n : TIdC_INT) : PIdAnsiChar cdecl; external SSLCLIB_LIB_name name 'OBJ_nid2ln'; - -function OBJ_nid2sn_func(n : TIdC_INT) : PIdAnsiChar cdecl; external SSLCLIB_LIB_name name 'OBJ_nid2sn'; - -function ASN1_INTEGER_set_func(a: PASN1_INTEGER; v: TIdC_LONG): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'ASN1_INTEGER_set'; - -function ASN1_INTEGER_get_func(a: PASN1_INTEGER) : TIdC_LONG cdecl; external SSLCLIB_LIB_name name 'ASN1_INTEGER_get'; - -function ASN1_STRING_type_new_func(_type: TIdC_INT): PASN1_STRING cdecl; external SSLCLIB_LIB_name name 'ASN1_STRING_type_new'; - -procedure ASN1_STRING_free_proc(a: PASN1_STRING) cdecl; external SSLCLIB_LIB_name name 'ASN1_STRING_free'; - -function ASN1_dup_func(i2d : i2d_of_void; d2i : d2i_of_void; x : PIdAnsiChar) : Pointer cdecl; external SSLCLIB_LIB_name name 'ASN1_dup'; - -function CRYPTO_set_mem_functions_func( - m: TCRYPTO_set_mem_functions_m; - r: TCRYPTO_set_mem_functions_r; - f: TCRYPTO_set_mem_functions_f): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'CRYPTO_set_mem_functions'; - -function CRYPTO_malloc_func(num: TIdC_INT; const _file: PIdAnsiChar; line: TIdC_INT): Pointer cdecl; external SSLCLIB_LIB_name name 'CRYPTO_malloc'; - -procedure CRYPTO_free_proc(ptr : Pointer) cdecl; external SSLCLIB_LIB_name name 'CRYPTO_free'; - -procedure CRYPTO_mem_leaks_proc(b:PBIO) cdecl; external SSLCLIB_LIB_name name 'CRYPTO_mem_leaks'; - -function CRYPTO_mem_ctrl_func(mode: TIdC_INT): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'CRYPTO_mem_ctrl'; - -procedure CRYPTO_set_mem_debug_functions_proc( - m: Tset_mem_debug_functions_m; - r: Tset_mem_debug_functions_r; - f : Tset_mem_debug_functions_f; - so : Tset_mem_debug_functions_so; - go : Tset_mem_debug_functions_go) cdecl; external SSLCLIB_LIB_name name 'CRYPTO_set_mem_debug_functions'; - -function PKCS12_create_func(pass, name: PIdAnsiChar; pkey: PEVP_PKEY; cert : PX509; - ca: PSTACK_OF_X509; nid_key, nid_cert, iter, mac_iter, keytype : TIdC_INT) : PPKCS12 cdecl; external SSLCLIB_LIB_name name 'PKCS12_create'; - -function i2d_PKCS12_bio_func(b: PBIO; p12: PPKCS12) : TIdC_INT cdecl; external SSLCLIB_LIB_name name 'i2d_PKCS12_bio'; - -procedure PKCS12_free_proc(p12: PPKCS12) cdecl; external SSLCLIB_LIB_name name 'PKCS12_free'; - -//procedure OpenSSL_add_all_algorithms_proc cdecl; external SSLCLIB_LIB_name name 'OpenSSL_add_all_algorithms'; - -procedure OpenSSL_add_all_ciphers_proc cdecl; external SSLCLIB_LIB_name name 'OpenSSL_add_all_ciphers'; - -procedure OpenSSL_add_all_digests_proc cdecl; external SSLCLIB_LIB_name name 'OpenSSL_add_all_digests'; - -procedure EVP_cleanup_proc cdecl; external SSLCLIB_LIB_name name 'EVP_cleanup'; - -function sk_num_func(const x : PSTACK) : TIdC_INT cdecl; external SSLCLIB_LIB_name name 'sk_num'; - -function sk_new_func( cmp : Tsk_new_cmp) : PStack cdecl; external SSLCLIB_LIB_name name 'sk_new'; - -function sk_new_null_func: PSTACK cdecl; external SSLCLIB_LIB_name name 'sk_new_null'; - -procedure sk_free_proc(st : PSTACK) cdecl; external SSLCLIB_LIB_name name 'sk_free'; - -function sk_push_func(st: PSTACK; data: PIdAnsiChar): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'sk_push'; - -function sk_dup_func(st : PSTACK) : PSTACK cdecl; external SSLCLIB_LIB_name name 'sk_dup'; - -function sk_find_func(st : PSTACK; Data : PIdAnsiChar) : TIdC_INT cdecl; external SSLCLIB_LIB_name name 'sk_find'; - -function sk_value_func(x : PSTACK; i : TIdC_INT) : PIdAnsiChar cdecl; external SSLCLIB_LIB_name name 'sk_value'; - -{$IFDEF OPENSSL_FIPS} -//function FIPS_mode_set_func(onoff : TIdC_INT) : TIdC_INT cdecl; external SSLCLIB_LIB_name name 'FIPS_mode_set'; - -//function FIPS_mode_func: TIdC_INT cdecl; external SSLCLIB_LIB_name name 'FIPS_mode'; -{$ENDIF} - -procedure LoadSymbols; -begin - SSL_CTX_set_cipher_list := SSL_CTX_set_cipher_list_func; - SSL_CTX_new := SSL_CTX_new_func; - SSL_CTX_free := SSL_CTX_free_proc; - SSL_set_fd := SSL_set_fd_func; - SSL_CTX_use_PrivateKey_file := SSL_CTX_use_PrivateKey_file_func; - SSL_CTX_use_PrivateKey := SSL_CTX_use_PrivateKey_func; - SSL_CTX_use_certificate := SSL_CTX_use_certificate_func; - SSL_CTX_use_certificate_file := SSL_CTX_use_certificate_file_func; - SSL_load_error_strings := SSL_load_error_strings_proc; - SSL_state_string_long := SSL_state_string_long_func; - SSL_alert_desc_string_long := SSL_alert_desc_string_long_func; - SSL_alert_type_string_long := SSL_alert_type_string_long_func; - - SSL_get_peer_certificate := SSL_get_peer_certificate_func; - SSL_CTX_set_verify := SSL_CTX_set_verify_proc; - SSL_CTX_set_verify_depth := SSL_CTX_set_verify_depth_proc; - SSL_CTX_get_verify_depth := SSL_CTX_get_verify_depth_func; - SSL_CTX_set_default_passwd_cb := SSL_CTX_set_default_passwd_cb_proc; - SSL_CTX_set_default_passwd_cb_userdata:= SSL_CTX_set_default_passwd_cb_userdata_proc; - SSL_CTX_check_private_key := SSL_CTX_check_private_key_func; - SSL_new := SSL_new_func; - SSL_free := SSL_free_proc; - SSL_accept := SSL_accept_func; - SSL_connect := SSL_connect_func; - SSL_read := SSL_read_func; - SSL_peek := SSL_peek_func; - SSL_pending := SSL_pending_func; - SSL_write := SSL_write_func; - SSL_ctrl := SSL_ctrl_func; - SSL_callback_ctrl := SSL_callback_ctrl_func; - SSL_CTX_ctrl := SSL_CTX_ctrl_func; - SSL_CTX_callback_ctrl := SSL_CTX_callback_ctrl_func; - SSL_get_error := SSL_get_error_func; - {$IFNDEF OPENSSL_NO_SSL2} - SSLv2_method := SSLv2_method_func; - SSLv2_server_method := SSLv2_server_method_func; - SSLv2_client_method := SSLv2_client_method_func; - {$ELSE} - SSLv2_method := nil; - SSLv2_server_method := nil; - SSLv2_client_method := nil; - {$ENDIF} - SSLv3_method := SSLv3_method_func; - SSLv3_server_method := SSLv3_server_method_func; - SSLv3_client_method := SSLv3_client_method_func; - SSLv23_method := SSLv23_method_func; - SSLv23_server_method := SSLv23_server_method_func; - SSLv23_client_method := SSLv23_client_method_func; - TLSv1_method := TLSv1_method_func; - TLSv1_server_method := TLSv1_server_method_func; - TLSv1_client_method := TLSv1_client_method_func; - TLSv1_1_method := TLSv1_1_method_func; - TLSv1_1_server_method := TLSv1_1_server_method_func; - TLSv1_1_client_method := TLSv1_1_client_method_func; - TLSv1_2_method := TLSv1_2_method_func; - TLSv1_2_server_method := TLSv1_2_server_method_func; - TLSv1_2_client_method := TLSv1_2_client_method_func; - DTLSv1_method := DTLSv1_method_func; - DTLSv1_server_method := DTLSv1_server_method_func; - DTLSv1_client_method := DTLSv1_client_method_func; - SSL_shutdown := SSL_shutdown_func; - SSL_set_connect_state := SSL_set_connect_state_proc; - SSL_set_accept_state := SSL_set_accept_state_proc; - SSL_set_shutdown := SSL_set_shutdown_proc; - SSL_CTX_load_verify_locations := SSL_CTX_load_verify_locations_func; - SSL_get_session := SSL_get_session_func; - SSLeay_add_ssl_algorithms := SSLeay_add_ssl_algorithms_func; - SSL_SESSION_get_id := SSL_SESSION_get_id_func; - SSL_copy_session_id := SSL_copy_session_id_proc; - // CRYPTO LIB - _SSLeay_version := SSLeay_version_func; - SSLeay := SSLeay_func; - d2i_X509_NAME := d2i_X509_NAME_func; - i2d_X509_NAME := i2d_X509_NAME_func; - X509_NAME_oneline := X509_NAME_oneline_func; - X509_NAME_cmp := X509_NAME_cmp_func; - X509_NAME_hash := X509_NAME_hash_func; - X509_set_issuer_name := X509_set_issuer_name_func; - X509_get_issuer_name := X509_get_issuer_name_func; - X509_set_subject_name := X509_set_subject_name_func; - X509_get_subject_name := X509_get_subject_name_func; - X509_digest := X509_digest_func; - X509_LOOKUP_ctrl := X509_LOOKUP_ctrl_func; - X509_STORE_add_cert := X509_STORE_add_cert_func; - X509_STORE_add_crl := X509_STORE_add_crl_func; - X509_STORE_CTX_get_ex_data := X509_STORE_CTX_get_ex_data_func; - X509_STORE_CTX_get_error := X509_STORE_CTX_get_error_func; - X509_STORE_CTX_set_error := X509_STORE_CTX_set_error_proc; - X509_STORE_CTX_get_error_depth := X509_STORE_CTX_get_error_depth_func; - X509_STORE_CTX_get_current_cert := X509_STORE_CTX_get_current_cert_func; - X509_STORE_add_lookup := X509_STORE_add_lookup_func; - X509_STORE_load_locations := X509_STORE_load_locations_func; - i2d_DSAPrivateKey := i2d_DSAPrivateKey_func; - d2i_DSAPrivateKey := d2i_DSAPrivateKey_func; - d2i_PrivateKey := d2i_PrivateKey_func; - d2i_PrivateKey_bio := d2i_PrivateKey_bio_func; - X509_sign := X509_sign_func; - X509_REQ_sign := X509_REQ_sign_func; - X509_REQ_add_extensions := X509_REQ_add_extensions_func; - X509V3_EXT_conf_nid := X509V3_EXT_conf_nid_func; - X509_EXTENSION_create_by_NID := X509_EXTENSION_create_by_NID_func; - X509V3_set_ctx := X509V3_set_ctx_proc; - X509_EXTENSION_free := X509_EXTENSION_free_proc; - X509_add_ext := X509_add_ext_func; - {$IFNDEF OPENSSL_NO_BIO} - //X509_print - X509_print := X509_print_func; - {$ENDIF} -// _RAND_cleanup := RAND_cleanup_func; -// _RAND_bytes := RAND_bytes_func; -// _RAND_pseudo_bytes := RAND_pseudo_bytes_func; -// _RAND_seed := RAND_seed_proc; -// _RAND_add := RAND_add_proc; -// _RAND_status := RAND_status_func; - {$IFDEF SYS_WIN} - _RAND_screen := RAND_screen_proc; - _RAND_event := RAND_event_func; - {$ENDIF} - {$IFNDEF OPENSSL_NO_DES} - // 3DES - DES_set_odd_parity := DES_set_odd_parity_proc; - DES_set_key := DES_set_key_func; - DES_ecb_encrypt := DES_ecb_encrypt_proc; -// Id_ossl_old_des_set_odd_parity := Id_ossl_old_des_set_odd_parity_proc; -// Id_ossl_old_des_set_key := Id_ossl_old_des_set_key_func; -// Id_ossl_old_des_ecb_encrypt := Id_ossl_old_des_ecb_encrypt_proc; - {$ENDIF} - // More SSL functions - SSL_set_ex_data := SSL_set_ex_data_func; - SSL_get_ex_data := SSL_get_ex_data_func; - SSL_load_client_CA_file := SSL_load_client_CA_file_func; - SSL_CTX_set_client_CA_list := SSL_CTX_set_client_CA_list_proc; - SSL_CTX_set_default_verify_paths := SSL_CTX_set_default_verify_paths_func; - SSL_CTX_set_session_id_context := SSL_CTX_set_session_id_context_func; - SSL_CIPHER_description := SSL_CIPHER_description_func; - SSL_get_current_cipher := SSL_get_current_cipher_func; - SSL_CIPHER_get_name := SSL_CIPHER_get_name_func; - SSL_CIPHER_get_version := SSL_CIPHER_get_version_func; - SSL_CIPHER_get_bits := SSL_CIPHER_get_bits_func; - // Thread safe - _CRYPTO_lock := CRYPTO_lock_proc; - _CRYPTO_num_locks := CRYPTO_num_locks_func; - CRYPTO_set_locking_callback := CRYPTO_set_locking_callback_proc; - {$IFNDEF WIN32_OR_WIN64} -{ -In OpenSSL 1.0.0, you should use these callback functions instead of the -depreciated set_id_callback. They are not in the older 0.9.8 OpenSSL series so -we have to handle both cases. -} - CRYPTO_THREADID_set_callback := CRYPTO_THREADID_set_callback_func; - CRYPTO_THREADID_set_numeric := CRYPTO_THREADID_set_numeric_proc; - CRYPTO_THREADID_set_pointer := CRYPTO_THREADID_set_pointer_proc; {Do not localize} -// if not assigned(CRYPTO_THREADID_set_callback) then begin -// @CRYPTO_set_id_callback := LoadFunctionCLib(fn_CRYPTO_set_id_callback); -// end; - {$ENDIF} - ERR_put_error := ERR_put_error_proc; - ERR_get_error := ERR_get_error_func; - ERR_peek_error := ERR_peek_error_func; - ERR_peek_last_error := ERR_peek_last_error_func; - ERR_clear_error := ERR_clear_error_proc; - ERR_error_string := ERR_error_string_func; - ERR_error_string_n := ERR_error_string_n_proc; - ERR_lib_error_string := ERR_lib_error_string_func; - ERR_func_error_string := ERR_func_error_string_func; - ERR_reason_error_string := ERR_reason_error_string_func; - ERR_load_ERR_strings := ERR_load_ERR_strings_proc; - ERR_load_crypto_strings := ERR_load_crypto_strings_proc; - ERR_free_strings := ERR_free_strings_proc; - ERR_remove_thread_state := ERR_remove_thread_state_proc; -// if not Assigned(ERR_remove_thread_state) then begin -// @ERR_remove_state := LoadFunctionCLib(fn_ERR_remove_state); -// end; - CRYPTO_cleanup_all_ex_data := CRYPTO_cleanup_all_ex_data_proc; - SSL_COMP_get_compression_methods := SSL_COMP_get_compression_methods_func; - SSL_COMP_free_compression_methods := SSL_COMP_free_compression_methods_func; - sk_pop_free := sk_pop_free_proc; - //RSA - RSA_free := RSA_free_proc; - RSA_generate_key := RSA_generate_key_func; - RSA_check_key := RSA_check_key_func; - RSA_generate_key_ex := RSA_generate_key_ex_func; - RSA_new := RSA_new_func; - RSA_size := RSA_size_func; - RSA_private_decrypt := RSA_private_decrypt_func; - RSA_public_encrypt := RSA_public_encrypt_func; - //DH - DH_free := DH_free_proc; - //BN - BN_new := BN_new_func; - BN_free := BN_free_proc; - BN_hex2bn := BN_hex2bn_func; - BN_bn2hex := BN_bn2hex_func; - BN_set_word := BN_set_word_func; - //BIO - BIO_new := BIO_new_func; - BIO_free := BIO_free_func; - BIO_new_mem_buf := BIO_new_mem_buf_func; - BIO_s_mem := BIO_s_mem_func; - BIO_s_file := BIO_s_file_func; - BIO_ctrl := BIO_ctrl_func; - BIO_int_ctrl := BIO_int_ctrl_func; - BIO_ptr_ctrl := BIO_ptr_ctrl_func; - BIO_new_file := BIO_new_file_func; - BIO_puts := BIO_puts_func; - BIO_read := BIO_read_func; - BIO_write := BIO_write_func; - //i2d - i2d_X509_bio := i2d_X509_bio_func; - i2d_PrivateKey_bio := i2d_PrivateKey_bio_func; - d2i_X509_bio := d2i_X509_bio_func; - i2d_X509_REQ_bio := i2d_X509_REQ_bio_func; - i2d_PKCS7 := i2d_PKCS7_func; - d2i_PKCS7 := d2i_PKCS7_func; - i2d_X509 := i2d_X509_func; - d2i_X509 := d2i_X509_func; - i2d_X509_REQ := i2d_X509_REQ_func; - d2i_X509_REQ := d2i_X509_REQ_func; - i2d_X509_CRL := i2d_X509_CRL_func; - d2i_X509_CRL := d2i_X509_CRL_func; - i2d_RSAPrivateKey := i2d_RSAPrivateKey_func; - d2i_RSAPrivateKey := d2i_RSAPrivateKey_func; - i2d_RSAPublicKey := i2d_RSAPublicKey_func; - d2i_RSAPublicKey := d2i_RSAPublicKey_func; - i2d_PrivateKey := i2d_PrivateKey_func; - d2i_PrivateKey := d2i_PrivateKey_func; - - i2d_DSAparams := i2d_DSAparams_func; - d2i_DSAparams := d2i_DSAparams_func; - i2d_DHparams := i2d_DHparams_func; - d2i_DHparams := d2i_DHparams_func; - i2d_NETSCAPE_CERT_SEQUENCE := i2d_NETSCAPE_CERT_SEQUENCE_func; - d2i_NETSCAPE_CERT_SEQUENCE := d2i_NETSCAPE_CERT_SEQUENCE_func; - i2d_PUBKEY := i2d_PUBKEY_func; - d2i_PUBKEY := d2i_PUBKEY_func; - - //X509 - X509_get_default_cert_file := X509_get_default_cert_file_func; - X509_get_default_cert_file_env := X509_get_default_cert_file_env_func; - X509_new := X509_new_func; - X509_free := X509_free_proc; - X509_REQ_new := X509_REQ_new_func; - X509_REQ_free := X509_REQ_free_proc; - X509_to_X509_REQ := X509_to_X509_REQ_func; - X509_NAME_new := X509_NAME_new_func; - X509_NAME_free := X509_NAME_free_proc; - X509_NAME_add_entry_by_txt := X509_NAME_add_entry_by_txt_func; - X509_INFO_free := X509_INFO_free_proc; - X509_set_version := X509_set_version_func; - X509_get_serialNumber := X509_get_serialNumber_func; - X509_gmtime_adj := X509_gmtime_adj_func; - X509_set_notBefore := X509_set_notBefore_func; - X509_set_notAfter := X509_set_notAfter_func; - X509_set_pubkey := X509_set_pubkey_func; - X509_REQ_set_pubkey := X509_REQ_set_pubkey_func; - X509_PUBKEY_get := X509_PUBKEY_get_func; - X509_verify := X509_verify_func; - //PEM - {$IFNDEF SSLEAY_MACROS} - _PEM_read_bio_X509 := PEM_read_bio_X509_func; - _PEM_read_bio_X509_REQ := PEM_read_bio_X509_REQ_func; - _PEM_read_bio_X509_CRL := PEM_read_bio_X509_CRL_func; - _PEM_read_bio_RSAPrivateKey := PEM_read_bio_RSAPrivateKey_func; - _PEM_read_bio_RSAPublicKey := PEM_read_bio_RSAPublicKey_func; - _PEM_read_bio_DSAPrivateKey := PEM_read_bio_DSAPrivateKey_func; - _PEM_read_bio_PrivateKey := PEM_read_bio_PrivateKey_func; - _PEM_read_bio_PKCS7 := PEM_read_bio_PKCS7_func; - _PEM_read_bio_DHparams := PEM_read_bio_DHparams_func; - _PEM_read_bio_DSAparams := PEM_read_bio_DSAparams_func; - _PEM_read_bio_NETSCAPE_CERT_SEQUENCE := PEM_read_bio_NETSCAPE_CERT_SEQUENCE_func; - _PEM_read_bio_PUBKEY := PEM_read_bio_PUBKEY_func; - _PEM_write_bio_X509 := PEM_write_bio_X509_func; - _PEM_write_bio_X509_REQ := PEM_write_bio_X509_REQ_func; - _PEM_write_bio_X509_CRL := PEM_write_bio_X509_CRL_func; - _PEM_write_bio_RSAPrivateKey := PEM_write_bio_RSAPrivateKey_func; - _PEM_write_bio_RSAPublicKey := PEM_write_bio_RSAPublicKey_func; - _PEM_write_bio_DSAPrivateKey := PEM_write_bio_DSAPrivateKey_func; - _PEM_write_bio_PrivateKey := PEM_write_bio_PrivateKey_func; - _PEM_write_bio_PKCS7 := PEM_write_bio_PKCS7_func; - _PEM_write_bio_DHparams := PEM_write_bio_DHparams_func; - _PEM_write_bio_DSAparams := PEM_write_bio_DSAparams_func; - _PEM_write_bio_NETSCAPE_CERT_SEQUENCE := PEM_write_bio_NETSCAPE_CERT_SEQUENCE_func; - _PEM_write_bio_PKCS8PrivateKey := PEM_write_bio_PKCS8PrivateKey_func; - _PEM_write_bio_PUBKEY := PEM_write_bio_PUBKEY_func; - {$ELSE} - PEM_ASN1_write_bio := PEM_ASN1_write_bio_func; - PEM_ASN1_read_bio := PEM_ASN1_read_bio_func; - {$ENDIF} - PEM_X509_INFO_read_bio := PEM_X509_INFO_read_bio_func; - PEM_read_bio_X509_AUX := PEM_read_bio_X509_AUX_func; - //EVP - {$IFNDEF OPENSSL_NO_DES} - EVP_des_ede3_cbc := EVP_des_ede3_cbc_func; - {$ENDIF} - {$IFNDEF OPENSSL_NO_SHA512} - EVP_sha512 := EVP_sha512_func; - EVP_sha384 := EVP_sha384_func; - {$ENDIF} - {$IFNDEF OPENSSL_NO_SHA256} - EVP_sha256 := EVP_sha256_func; - EVP_sha224 := EVP_sha224_func; - {$ENDIF} - {$IFNDEF OPENSSL_NO_SHA} - EVP_sha1 := EVP_sha1_func; - {$ENDIF} - {$IFNDEF OPENSSL_NO_MD5} - EVP_md5 := EVP_md5_func; - {$ENDIF} - {$IFNDEF OPENSSL_NO_MD4} - EVP_md4 := EVP_md4_func; - {$ENDIF} -// {$IFNDEF OPENSSL_NO_MD2} -// EVP_md2 := EVP_md2_func; -// {$ENDIF} - EVP_MD_CTX_init := EVP_MD_CTX_init_proc; - EVP_MD_CTX_cleanup := EVP_MD_CTX_cleanup_func; - EVP_MD_CTX_create := EVP_MD_CTX_create_func; - EVP_MD_CTX_destroy := EVP_MD_CTX_destroy_proc; - EVP_MD_CTX_copy := EVP_MD_CTX_copy_func; - EVP_MD_CTX_copy_ex := EVP_MD_CTX_copy_ex_func; - EVP_DigestInit_ex := EVP_DigestInit_ex_func; - EVP_DigestUpdate := EVP_DigestUpdate_func; - EVP_DigestFinal_ex := EVP_DigestFinal_ex_func; - EVP_MD_CTX_cleanup := EVP_MD_CTX_cleanup_func; - EVP_PKEY_type := EVP_PKEY_type_func; - EVP_PKEY_new := EVP_PKEY_new_func; - EVP_PKEY_free := EVP_PKEY_free_proc; - EVP_PKEY_assign := EVP_PKEY_assign_func; - EVP_get_digestbyname := EVP_get_digestbyname_func; - //HMAC - {$IFNDEF OPENSSL_NO_HMAC} - HMAC_CTX_init := HMAC_CTX_init_proc; -// if IsOpenSSL_1x then begin - _1_0_HMAC_Init_ex := HMAC_Init_ex_func; - _1_0_HMAC_Update := HMAC_Update_func; - _1_0_HMAC_Final := HMAC_Final_func; -// end else begin -// @_HMAC_Init_ex := LoadFunctionCLib(fn_HMAC_Init_ex); -// @_HMAC_Update := LoadFunctionCLib(fn_HMAC_Update); -// @_HMAC_Final := LoadFunctionCLib(fn_HMAC_Final); -// end; - HMAC_CTX_cleanup := HMAC_CTX_cleanup_proc; - {$ENDIF} - //OBJ - OBJ_obj2nid := OBJ_obj2nid_func; - OBJ_nid2obj := OBJ_nid2obj_func; - OBJ_nid2ln := OBJ_nid2ln_func; - OBJ_nid2sn := OBJ_nid2sn_func; - //ASN1 - ASN1_INTEGER_set := ASN1_INTEGER_set_func; - ASN1_INTEGER_get := ASN1_INTEGER_get_func; - ASN1_STRING_type_new := ASN1_STRING_type_new_func; - ASN1_STRING_free := ASN1_STRING_free_proc; - ASN1_dup := ASN1_dup_func; - CRYPTO_set_mem_functions := CRYPTO_set_mem_functions_func; - CRYPTO_malloc := CRYPTO_malloc_func; - CRYPTO_free := CRYPTO_free_proc; - CRYPTO_mem_leaks := CRYPTO_mem_leaks_proc; - CRYPTO_mem_ctrl := CRYPTO_mem_ctrl_func; - CRYPTO_set_mem_debug_functions := CRYPTO_set_mem_debug_functions_proc; - PKCS12_create := PKCS12_create_func; - i2d_PKCS12_bio := i2d_PKCS12_bio_func; - PKCS12_free := PKCS12_free_proc; -// OpenSSL_add_all_algorithms := OpenSSL_add_all_algorithms_proc; - OpenSSL_add_all_ciphers := OpenSSL_add_all_ciphers_proc; - OpenSSL_add_all_digests := OpenSSL_add_all_digests_proc; - EVP_cleanup := EVP_cleanup_proc; - - sk_num := sk_num_func; - sk_new := sk_new_func; - sk_new_null := sk_new_null_func; - sk_free := sk_free_proc; - sk_push := sk_push_func; - sk_dup := sk_dup_func; - sk_find := sk_find_func; - sk_value := sk_value_func; - {$IFDEF OPENSSL_FIPS} -// _FIPS_mode_set := FIPS_mode_set_func; -// _FIPS_mode := FIPS_mode_func; - {$ENDIF} -end; - -initialization - LoadSymbols; - -{$ENDIF} - -end. +unit IdSSLOpenSSLHeaders_static; + +interface + +{$I IdCompilerDefines.inc} + +{$IFNDEF USE_OPENSSL} + {$message error Should not compile if USE_OPENSSL is not defined!!!} +{$ENDIF} + +{$IFDEF HAS_DIRECTIVE_HPPEMIT_LINKUNIT} + {$HPPEMIT LINKUNIT} +{$ELSE} + {$HPPEMIT '#pragma link "IdSSLOpenSSLHeaders_static"'} +{$ENDIF} + +implementation + +{$IFDEF STATICLOAD_OPENSSL} +uses + IdGlobal, Posix.SysTypes, IdCTypes, IdSSLOpenSSLHeaders; + +const + SSL_LIB_name = 'libssl.a'; {Do not Localize} + SSLCLIB_LIB_name = 'libcrypto.a'; {Do not Localize} + +function SSL_CTX_set_cipher_list_func(_para1: PSSL_CTX; const str: PIdAnsiChar): TIdC_INT cdecl; external SSL_LIB_NAME name 'SSL_CTX_set_cipher_list'; + +function SSL_CTX_new_func(meth: PSSL_METHOD): PSSL_CTX cdecl; external SSL_LIB_NAME name 'SSL_CTX_new'; + +procedure SSL_CTX_free_proc(_para1: PSSL_CTX) cdecl; external SSL_LIB_NAME name 'SSL_CTX_free'; + +function SSL_set_fd_func(s: PSSL; fd: TIdC_INT): TIdC_INT cdecl; external SSL_LIB_NAME name 'SSL_set_fd'; + +function SSL_CTX_use_PrivateKey_file_func(ctx: PSSL_CTX; const _file: PIdAnsiChar; _type: TIdC_INT): TIdC_INT cdecl; external SSL_LIB_NAME name 'SSL_CTX_use_PrivateKey_file'; + +function SSL_CTX_use_PrivateKey_func(ctx: PSSL_CTX; pkey: PEVP_PKEY): TIdC_INT cdecl; external SSL_LIB_NAME name 'SSL_CTX_use_PrivateKey'; + +function SSL_CTX_use_certificate_func(ctx: PSSL_CTX; x: PX509): TIdC_INT cdecl; external SSL_LIB_NAME name 'SSL_CTX_use_certificate'; + +function SSL_CTX_use_certificate_file_func(ctx: PSSL_CTX; const _file: PIdAnsiChar; _type: TIdC_INT): TIdC_INT cdecl; external SSL_LIB_NAME name 'SSL_CTX_use_certificate_file'; + +procedure SSL_load_error_strings_proc cdecl; external SSL_LIB_NAME name 'SSL_load_error_strings'; + +function SSL_state_string_long_func(s: PSSL): PIdAnsiChar cdecl; external SSL_LIB_NAME name 'SSL_state_string_long'; + +function SSL_alert_desc_string_long_func(value : TIdC_INT) : PIdAnsiChar cdecl; external SSL_LIB_NAME name 'SSL_alert_desc_string_long'; + +function SSL_alert_type_string_long_func(value : TIdC_INT) : PIdAnsiChar cdecl; external SSL_LIB_NAME name 'SSL_alert_type_string_long'; + +function SSL_get_peer_certificate_func(s: PSSL): PX509 cdecl; external SSL_LIB_NAME name 'SSL_get_peer_certificate'; + +procedure SSL_CTX_set_verify_proc(ctx: PSSL_CTX; mode: TIdC_INT; callback: TSSL_CTX_set_verify_callback) cdecl; external SSL_LIB_NAME name 'SSL_CTX_set_verify'; + +procedure SSL_CTX_set_verify_depth_proc(ctx: PSSL_CTX; depth: TIdC_INT) cdecl; external SSL_LIB_NAME name 'SSL_CTX_set_verify_depth'; + +function SSL_CTX_get_verify_depth_func(ctx: PSSL_CTX): TIdC_INT cdecl; external SSL_LIB_NAME name 'SSL_CTX_get_verify_depth'; + +procedure SSL_CTX_set_default_passwd_cb_proc(ctx: PSSL_CTX; cb: ppem_password_cb) cdecl; external SSL_LIB_NAME name 'SSL_CTX_set_default_passwd_cb'; + +procedure SSL_CTX_set_default_passwd_cb_userdata_proc(ctx: PSSL_CTX; u: Pointer) cdecl; external SSL_LIB_NAME name 'SSL_CTX_set_default_passwd_cb_userdata'; + +function SSL_CTX_check_private_key_func(ctx: PSSL_CTX): TIdC_INT cdecl; external SSL_LIB_NAME name 'SSL_CTX_check_private_key'; + +function SSL_new_func(ctx: PSSL_CTX): PSSL cdecl; external SSL_LIB_NAME name 'SSL_new'; + +procedure SSL_free_proc(ssl: PSSL) cdecl; external SSL_LIB_NAME name 'SSL_free'; + +function SSL_accept_func(ssl: PSSL): TIdC_INT cdecl; external SSL_LIB_NAME name 'SSL_accept'; + +function SSL_connect_func(ssl: PSSL): TIdC_INT cdecl; external SSL_LIB_NAME name 'SSL_connect'; + +function SSL_read_func(ssl: PSSL; buf: Pointer; num: TIdC_INT): TIdC_INT cdecl; external SSL_LIB_NAME name 'SSL_read'; + +function SSL_peek_func(ssl: PSSL; buf: Pointer; num: TIdC_INT): TIdC_INT cdecl; external SSL_LIB_NAME name 'SSL_peek'; + +function SSL_pending_func(ssl : PSSL) : TIdC_INT cdecl; external SSL_LIB_NAME name 'SSL_pending'; + +function SSL_write_func(ssl: PSSL; const buf: Pointer; num: TIdC_INT): TIdC_INT cdecl; external SSL_LIB_NAME name 'SSL_write'; + +function SSL_ctrl_func(ssl : PSSL; cmd : TIdC_INT; larg : TIdC_LONG; parg : Pointer) : TIdC_LONG cdecl; external SSL_LIB_NAME name 'SSL_ctrl'; + +function SSL_callback_ctrl_func(ssl : PSSL; cmd : TIdC_INT; fp : SSL_callback_ctrl_fp) : TIdC_LONG cdecl; external SSL_LIB_NAME name 'SSL_callback_ctrl'; + +function SSL_CTX_ctrl_func(ssl: PSSL_CTX; cmd: TIdC_INT; larg: TIdC_LONG; parg: Pointer): TIdC_LONG cdecl; external SSL_LIB_NAME name 'SSL_CTX_ctrl'; + +function SSL_CTX_callback_ctrl_func(ssl : PSSL_CTX; cmd : TIdC_INT; fp : SSL_callback_ctrl_fp) : TIdC_LONG cdecl; external SSL_LIB_NAME name 'SSL_CTX_callback_ctrl'; + +function SSL_get_error_func(s: PSSL; ret_code: TIdC_INT): TIdC_INT cdecl; external SSL_LIB_NAME name 'SSL_get_error'; + +{$IFNDEF OPENSSL_NO_SSL2} +function SSLv2_method_func: PSSL_METHOD cdecl; external SSL_LIB_NAME name 'SSLv2_method'; + +function SSLv2_server_method_func: PSSL_METHOD cdecl; external SSL_LIB_NAME name 'SSLv2_server_method'; + +function SSLv2_client_method_func: PSSL_METHOD cdecl; external SSL_LIB_NAME name 'SSLv2_client_method'; +{$ENDIF} + +function SSLv3_method_func: PSSL_METHOD cdecl; external SSL_LIB_NAME name 'SSLv3_method'; + +function SSLv3_server_method_func: PSSL_METHOD cdecl; external SSL_LIB_NAME name 'SSLv3_server_method'; + +function SSLv3_client_method_func: PSSL_METHOD cdecl; external SSL_LIB_NAME name 'SSLv3_client_method'; + +function SSLv23_method_func: PSSL_METHOD cdecl; external SSL_LIB_NAME name 'SSLv23_method'; + +function SSLv23_server_method_func: PSSL_METHOD cdecl; external SSL_LIB_NAME name 'SSLv23_server_method'; + +function SSLv23_client_method_func: PSSL_METHOD cdecl; external SSL_LIB_NAME name 'SSLv23_client_method'; + +function TLSv1_method_func: PSSL_METHOD cdecl; external SSL_LIB_NAME name 'TLSv1_method'; + +function TLSv1_server_method_func: PSSL_METHOD cdecl; external SSL_LIB_NAME name 'TLSv1_server_method'; + +function TLSv1_client_method_func: PSSL_METHOD cdecl; external SSL_LIB_NAME name 'TLSv1_client_method'; + +function TLSv1_1_method_func: PSSL_METHOD cdecl; external SSL_LIB_NAME name 'TLSv1_1_method'; + +function TLSv1_1_server_method_func: PSSL_METHOD cdecl; external SSL_LIB_NAME name 'TLSv1_1_server_method'; + +function TLSv1_1_client_method_func: PSSL_METHOD cdecl; external SSL_LIB_NAME name 'TLSv1_1_client_method'; + +function TLSv1_2_method_func: PSSL_METHOD cdecl; external SSL_LIB_NAME name 'TLSv1_2_method'; + +function TLSv1_2_server_method_func: PSSL_METHOD cdecl; external SSL_LIB_NAME name 'TLSv1_2_server_method'; + +function TLSv1_2_client_method_func: PSSL_METHOD cdecl; external SSL_LIB_NAME name 'TLSv1_2_client_method'; + +function DTLSv1_method_func: PSSL_METHOD cdecl; external SSL_LIB_NAME name 'DTLSv1_method'; + +function DTLSv1_server_method_func: PSSL_METHOD cdecl; external SSL_LIB_NAME name 'DTLSv1_server_method'; + +function DTLSv1_client_method_func: PSSL_METHOD cdecl; external SSL_LIB_NAME name 'DTLSv1_client_method'; + +function SSL_shutdown_func(s: PSSL): TIdC_INT cdecl; external SSL_LIB_NAME name 'SSL_shutdown'; + +procedure SSL_set_connect_state_proc(s: PSSL) cdecl; external SSL_LIB_NAME name 'SSL_set_connect_state'; + +procedure SSL_set_accept_state_proc(s: PSSL) cdecl; external SSL_LIB_NAME name 'SSL_set_accept_state'; + +procedure SSL_set_shutdown_proc(ssl: PSSL; mode: TIdC_INT) cdecl; external SSL_LIB_NAME name 'SSL_set_shutdown'; + +function SSL_CTX_load_verify_locations_func(ctx: PSSL_CTX; const CAfile: PIdAnsiChar; const CApath: PIdAnsiChar): TIdC_INT cdecl; external SSL_LIB_NAME name 'SSL_CTX_load_verify_locations'; + +function SSL_get_session_func(const ssl: PSSL): PSSL_SESSION cdecl; external SSL_LIB_NAME name 'SSL_get_session'; + +function SSLeay_add_ssl_algorithms_func: TIdC_INT cdecl; external SSL_LIB_NAME name 'SSL_library_init'; + +function SSL_SESSION_get_id_func(const s: PSSL_SESSION; length: PIdC_UINT): PIdAnsiChar cdecl; external SSL_LIB_NAME name 'SSL_SESSION_get_id'; + +procedure SSL_copy_session_id_proc(sslTo: PSSL; const sslFrom: PSSL) cdecl; external SSL_LIB_NAME name 'SSL_copy_session_id'; + +function SSLeay_version_func(_type : TIdC_INT) : PIdAnsiChar cdecl; external SSLCLIB_LIB_name name 'SSLeay_version'; + +function SSLeay_func: TIdC_ULONG cdecl; external SSLCLIB_LIB_name name 'SSLeay'; + +function d2i_X509_NAME_func(pr : PPX509_NAME; _in : PPByte; length : TIdC_LONG):PX509_NAME cdecl; external SSLCLIB_LIB_name name 'd2i_X509_NAME'; + +function i2d_X509_NAME_func(x : PX509_NAME; buf : PPByte) : TIdC_INT cdecl; external SSLCLIB_LIB_name name 'i2d_X509_NAME'; + +function X509_NAME_oneline_func(a: PX509_NAME; buf: PIdAnsiChar; size: TIdC_INT): PIdAnsiChar cdecl; external SSLCLIB_LIB_name name 'X509_NAME_oneline'; + +function X509_NAME_cmp_func(const a, b: PX509_NAME): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'X509_NAME_cmp'; + +function X509_NAME_hash_func(x: PX509_NAME): TIdC_ULONG cdecl; external SSLCLIB_LIB_name name 'X509_NAME_hash'; + +function X509_set_issuer_name_func(x: PX509; name: PX509_NAME): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'X509_set_issuer_name'; + +function X509_get_issuer_name_func(a: PX509): PX509_NAME cdecl; external SSLCLIB_LIB_name name 'X509_get_issuer_name'; + +function X509_set_subject_name_func(x: PX509; name: PX509_NAME): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'X509_set_subject_name'; + +function X509_get_subject_name_func(a: PX509): PX509_NAME cdecl; external SSLCLIB_LIB_name name 'X509_get_subject_name'; + +function X509_digest_func(const data: PX509; const _type: PEVP_MD; + md: PByte; var len: TIdC_UINT): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'X509_digest'; + +function X509_LOOKUP_ctrl_func(ctx : PX509_LOOKUP; cmd : TIdC_INT; argc : PIdAnsiChar; arg1 : TIdC_LONG; ret : PPIdAnsiChar) : TIdC_INT cdecl; external SSLCLIB_LIB_name name 'X509_LOOKUP_ctrl'; + +function X509_STORE_add_cert_func(ctx : PX509_STORE; x : PX509) : TIdC_INT cdecl; external SSLCLIB_LIB_name name 'X509_STORE_add_cert'; + +function X509_STORE_add_crl_func(ctx : PX509_STORE; x : PX509_CRL) : TIdC_INT cdecl; external SSLCLIB_LIB_name name 'X509_STORE_add_crl'; + +function X509_STORE_CTX_get_ex_data_func(ctx: PX509_STORE_CTX; idx: TIdC_INT): Pointer cdecl; external SSLCLIB_LIB_name name 'X509_STORE_CTX_get_ex_data'; + +function X509_STORE_CTX_get_error_func(ctx: PX509_STORE_CTX): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'X509_STORE_CTX_get_error'; + +procedure X509_STORE_CTX_set_error_proc(ctx: PX509_STORE_CTX; s: TIdC_INT) cdecl; external SSLCLIB_LIB_name name 'X509_STORE_CTX_set_error'; + +function X509_STORE_CTX_get_error_depth_func(ctx: PX509_STORE_CTX): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'X509_STORE_CTX_get_error_depth'; + +function X509_STORE_CTX_get_current_cert_func(ctx: PX509_STORE_CTX): PX509 cdecl; external SSLCLIB_LIB_name name 'X509_STORE_CTX_get_current_cert'; + +function X509_STORE_add_lookup_func(v : PX509_STORE; m : PX509_LOOKUP_METHOD) : PX509_LOOKUP cdecl; external SSLCLIB_LIB_name name 'X509_STORE_add_lookup'; + +function X509_STORE_load_locations_func( ctx : PX509_STORE; const _file, path : PIdAnsiChar) : TIdC_INT cdecl; external SSLCLIB_LIB_name name 'X509_STORE_load_locations'; + +function i2d_DSAPrivateKey_func(x: PDSA; buf: PPByte): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'i2d_DSAPrivateKey'; + +function d2i_DSAPrivateKey_func(pr : PDSA; _in : PPByte; len : TIdC_INT): PDSA cdecl; external SSLCLIB_LIB_name name 'd2i_DSAPrivateKey'; + +function d2i_PrivateKey_func(pr : PEVP_PKEY; _in : PPByte; len : TIdC_INT): PEVP_PKEY cdecl; external SSLCLIB_LIB_name name 'd2i_PrivateKey'; + +function d2i_PrivateKey_bio_func(bp : PBIO; a : PPEVP_PKEY) : PEVP_PKEY cdecl; external SSLCLIB_LIB_name name 'd2i_PrivateKey_bio'; + +function X509_sign_func(x: PX509; pkey: PEVP_PKEY; const md: PEVP_MD): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'X509_sign'; + +function X509_REQ_sign_func(x: PX509_REQ; pkey: PEVP_PKEY; const md: PEVP_MD): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'X509_REQ_sign'; + +function X509_REQ_add_extensions_func(req: PX509_REQ; exts: PSTACK_OF_X509_EXTENSION): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'X509_REQ_add_extensions'; + +function X509V3_EXT_conf_nid_func(conf: PLHASH; ctx: PX509V3_CTX; ext_nid: TIdC_INT; value: PIdAnsiChar): PX509_EXTENSION cdecl; external SSLCLIB_LIB_name name 'X509V3_EXT_conf_nid'; + +function X509_EXTENSION_create_by_NID_func(ex: PPX509_EXTENSION; nid: TIdC_INT; + crit: TIdC_INT; data: PASN1_OCTET_STRING): PX509_EXTENSION cdecl; external SSLCLIB_LIB_name name 'X509_EXTENSION_create_by_NID'; + +procedure X509V3_set_ctx_proc(ctx: PX509V3_CTX; issuer, subject: PX509; req: PX509_REQ; crl: PX509_CRL; flags: TIdC_INT) cdecl; external SSLCLIB_LIB_name name 'X509V3_set_ctx'; + +procedure X509_EXTENSION_free_proc(ex: PX509_EXTENSION) cdecl; external SSLCLIB_LIB_name name 'X509_EXTENSION_free'; + +function X509_add_ext_func(cert: PX509; ext: PX509_EXTENSION; loc: TIdC_INT): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'X509_add_ext'; + +{$IFNDEF OPENSSL_NO_BIO} +function X509_print_func(bp : PBIO; x : PX509) : TIdC_INT cdecl; external SSLCLIB_LIB_name name 'X509_print'; +{$ENDIF} + +procedure RAND_cleanup_func; cdecl; external SSLCLIB_LIB_name name 'RAND_cleanup'; + +function RAND_bytes_func(buf : PIdAnsiChar; num : integer) : integer; cdecl; external SSLCLIB_LIB_name name 'RAND_bytes'; + +function RAND_pseudo_bytes_func(buf : PIdAnsiChar; num : integer) : integer; cdecl; external SSLCLIB_LIB_name name 'RAND_pseudo_bytes'; + +procedure RAND_seed_proc(buf : PIdAnsiChar; num : integer); cdecl; external SSLCLIB_LIB_name name 'RAND_seed'; + +procedure RAND_add_proc(buf : PIdAnsiChar; num : integer; entropy : integer); cdecl; external SSLCLIB_LIB_name name 'RAND_add'; + +function RAND_status_func: integer; cdecl; external SSLCLIB_LIB_name name 'RAND_status'; + +{$IFDEF SYS_WIN} +procedure RAND_screen_proc cdecl; external SSLCLIB_LIB_name name 'RAND_screen'; + +function RAND_event_func(iMsg : UINT; wp : wparam; lp : lparam) : integer; cdecl; external SSLCLIB_LIB_name name 'RAND_event'; +{$ENDIF} + +{$IFNDEF OPENSSL_NO_DES} +procedure DES_set_odd_parity_proc(key: Pdes_cblock) cdecl; external SSLCLIB_LIB_name name 'DES_set_odd_parity'; + +function DES_set_key_func(key: Pconst_DES_cblock; schedule: DES_key_schedule): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'DES_set_key'; + +procedure DES_ecb_encrypt_proc(input, output: Pconst_DES_cblock; ks: DES_key_schedule; enc: TIdC_INT) cdecl; external SSLCLIB_LIB_name name 'DES_ecb_encrypt'; + +//procedure Id_ossl_old_des_set_odd_parity_proc(key : p_ossl_old_des_cblock) cdecl; external SSLCLIB_LIB_name name 'Id_ossl_old_des_set_odd_parity'; + +//function Id_ossl_old_des_set_key_func(key : P_ossl_old_des_cblock; schedule : _ossl_old_des_key_schedule) : TIdC_INT cdecl; external SSLCLIB_LIB_name name 'Id_ossl_old_des_set_key'; + +//procedure Id_ossl_old_des_ecb_encrypt_proc( input : p_ossl_old_des_cblock; output : p_ossl_old_des_cblock; ks : p_ossl_old_des_key_schedule; enc : TIdC_int) cdecl; external SSLCLIB_LIB_name name 'Id_ossl_old_des_ecb_encrypt'; +{$ENDIF} + +function SSL_set_ex_data_func(ssl: PSSL; idx: TIdC_INT; data: Pointer): TIdC_INT cdecl; external SSL_LIB_NAME name 'SSL_set_ex_data'; + +function SSL_get_ex_data_func(ssl: PSSL; idx: TIdC_INT): Pointer cdecl; external SSL_LIB_NAME name 'SSL_get_ex_data'; + +function SSL_load_client_CA_file_func(const _file: PIdAnsiChar): PSTACK_OF_X509_NAME cdecl; external SSL_LIB_NAME name 'SSL_load_client_CA_file'; + +procedure SSL_CTX_set_client_CA_list_proc(ctx: PSSL_CTX; list: PSTACK_OF_X509_NAME) cdecl; external SSL_LIB_NAME name 'SSL_CTX_set_client_CA_list'; + +function SSL_CTX_set_default_verify_paths_func(ctx: PSSL_CTX): TIdC_INT cdecl; external SSL_LIB_NAME name 'SSL_CTX_set_default_verify_paths'; + +function SSL_CTX_set_session_id_context_func(ctx: PSSL_CTX; const sid_ctx: PByte; sid_ctx_len: TIdC_UINT): TIdC_INT cdecl; external SSL_LIB_NAME name 'SSL_CTX_set_session_id_context'; + +function SSL_CIPHER_description_func(_para1: PSSL_CIPHER; buf: PIdAnsiChar; size: TIdC_INT): PIdAnsiChar cdecl; external SSL_LIB_NAME name 'SSL_CIPHER_description'; + +function SSL_get_current_cipher_func(const s: PSSL): PSSL_CIPHER cdecl; external SSL_LIB_NAME name 'SSL_get_current_cipher'; + +function SSL_CIPHER_get_name_func(const c: PSSL_CIPHER): PIdAnsiChar cdecl; external SSL_LIB_NAME name 'SSL_CIPHER_get_name'; + +function SSL_CIPHER_get_version_func(const c: PSSL_CIPHER): PIdAnsiChar cdecl; external SSL_LIB_NAME name 'SSL_CIPHER_get_version'; + +function SSL_CIPHER_get_bits_func(const c: PSSL_CIPHER; var alg_bits: TIdC_INT): TIdC_INT cdecl; external SSL_LIB_NAME name 'SSL_CIPHER_get_bits'; + +procedure CRYPTO_lock_proc(mode, _type : TIdC_INT; const _file : PIdAnsiChar; line : TIdC_INT) cdecl; external SSLCLIB_LIB_name name 'CRYPTO_lock'; + +function CRYPTO_num_locks_func: TIdC_INT cdecl; external SSLCLIB_LIB_name name 'CRYPTO_num_locks'; + +procedure CRYPTO_set_locking_callback_proc(func: TIdSslLockingCallback) cdecl; external SSLCLIB_LIB_name name 'CRYPTO_set_locking_callback'; + +function CRYPTO_THREADID_set_callback_func(threadid_func : TCRYPTO_THREADID_set_callback_threadid_func) : TIdC_INT cdecl; external SSLCLIB_LIB_name name 'CRYPTO_THREADID_set_callback'; + +procedure CRYPTO_THREADID_set_numeric_proc(id : PCRYPTO_THREADID; val : TIdC_ULONG) cdecl; external SSLCLIB_LIB_name name 'CRYPTO_THREADID_set_numeric'; + +procedure CRYPTO_THREADID_set_pointer_proc(id : PCRYPTO_THREADID; ptr : Pointer) cdecl; external SSLCLIB_LIB_name name 'CRYPTO_THREADID_set_pointer'; + +procedure ERR_put_error_proc(lib, func, reason : TIdC_INT; _file : PIdAnsiChar; line : TIdC_INT) cdecl; external SSLCLIB_LIB_name name 'ERR_put_error'; + +function ERR_get_error_func: TIdC_ULONG cdecl; external SSLCLIB_LIB_name name 'ERR_get_error'; + +function ERR_peek_error_func: TIdC_ULONG cdecl; external SSLCLIB_LIB_name name 'ERR_peek_error'; + +function ERR_peek_last_error_func: TIdC_ULONG cdecl; external SSLCLIB_LIB_name name 'ERR_peek_last_error'; + +procedure ERR_clear_error_proc cdecl; external SSLCLIB_LIB_name name 'ERR_clear_error'; + +function ERR_error_string_func(e: TIdC_ULONG; buf: PIdAnsiChar): PIdAnsiChar cdecl; external SSLCLIB_LIB_name name 'ERR_error_string'; + +procedure ERR_error_string_n_proc(e: TIdC_ULONG; buf: PIdAnsiChar; len : size_t) cdecl; external SSLCLIB_LIB_name name 'ERR_error_string_n'; + +function ERR_lib_error_string_func(e : TIdC_ULONG): PIdAnsiChar cdecl; external SSLCLIB_LIB_name name 'ERR_lib_error_string'; + +function ERR_func_error_string_func(e : TIdC_ULONG): PIdAnsiChar cdecl; external SSLCLIB_LIB_name name 'ERR_func_error_string'; + +function ERR_reason_error_string_func(e : TIdC_ULONG): PIdAnsiChar cdecl; external SSLCLIB_LIB_name name 'ERR_reason_error_string'; + +procedure ERR_load_ERR_strings_proc cdecl; external SSLCLIB_LIB_name name 'ERR_load_ERR_strings'; + +procedure ERR_load_crypto_strings_proc cdecl; external SSLCLIB_LIB_name name 'ERR_load_crypto_strings'; + +procedure ERR_free_strings_proc cdecl; external SSLCLIB_LIB_name name 'ERR_free_strings'; + +procedure ERR_remove_thread_state_proc(const tId : PCRYPTO_THREADID) cdecl; external SSLCLIB_LIB_name name 'ERR_remove_thread_state'; + +procedure CRYPTO_cleanup_all_ex_data_proc cdecl; external SSLCLIB_LIB_name name 'CRYPTO_cleanup_all_ex_data'; + +function SSL_COMP_get_compression_methods_func: PSTACK_OF_SSL_COMP cdecl; external SSL_LIB_NAME name 'SSL_COMP_get_compression_methods'; + +procedure SSL_COMP_free_compression_methods_func; cdecl; external SSL_LIB_NAME name 'SSL_COMP_free_compression_methods' + +procedure sk_pop_free_proc(st: PSTACK; func: Tsk_pop_free_func) cdecl; external SSLCLIB_LIB_name name 'sk_pop_free'; + +procedure RSA_free_proc(rsa: PRSA) cdecl; external SSLCLIB_LIB_name name 'RSA_free'; + +function RSA_generate_key_func(bits: TIdC_INT; e: TIdC_ULONG; callback: TRSA_generate_key_callback; cb_arg: Pointer): PRSA cdecl; external SSLCLIB_LIB_name name 'RSA_generate_key'; + +function RSA_check_key_func(const rsa: PRSA): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'RSA_check_key'; + +function RSA_generate_key_ex_func(rsa : PRSA; bits : TIdC_INT; e : PBIGNUM; cb : PBN_GENCB) : TIdC_INT cdecl; external SSLCLIB_LIB_name name 'RSA_generate_key_ex'; + +function RSA_new_func: PRSA cdecl; external SSLCLIB_LIB_name name 'RSA_new'; + +function RSA_size_func(key: PRSA): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'RSA_size'; + +function RSA_private_decrypt_func(flen: TIdC_INT; from: PByte; _to: PByte; rsa: PRSA; padding: TIdC_INT): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'RSA_private_decrypt'; + +function RSA_public_encrypt_func(flen: TIdC_INT; from: PByte; _to: PByte; rsa: PRSA; padding: TIdC_INT): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'RSA_public_encrypt'; + +procedure DH_free_proc(dh: PDH) cdecl; external SSLCLIB_LIB_name name 'DH_free'; + +function BN_new_func: PBIGNUM cdecl; external SSLCLIB_LIB_name name 'BN_new'; + +procedure BN_free_proc(a: PBIGNUM) cdecl; external SSLCLIB_LIB_name name 'BN_free'; + +function BN_hex2bn_func(var n:PBIGNUM; const Str: PIdAnsiChar): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'BN_hex2bn'; + +function BN_bn2hex_func(const n:PBIGNUM): PIdAnsiChar cdecl; external SSLCLIB_LIB_name name 'BN_bn2hex'; + +function BN_set_word_func(a: PBIGNUM; w: TIdC_ULONG): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'BN_set_word'; + +function BIO_new_func(_type: PBIO_METHOD): PBIO cdecl; external SSLCLIB_LIB_name name 'BIO_new'; + +function BIO_free_func(bio: PBIO): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'BIO_free'; + +function BIO_new_mem_buf_func(buf : Pointer; len : TIdC_INT) : PBIO cdecl; external SSLCLIB_LIB_name name 'BIO_new_mem_buf'; + +function BIO_s_mem_func: PBIO_METHOD cdecl; external SSLCLIB_LIB_name name 'BIO_s_mem'; + +function BIO_s_file_func: PBIO_METHOD cdecl; external SSLCLIB_LIB_name name 'BIO_s_file'; + +function BIO_ctrl_func(bp: PBIO; cmd: TIdC_INT; larg: TIdC_LONG; parg: Pointer): TIdC_LONG cdecl; external SSLCLIB_LIB_name name 'BIO_ctrl'; + +function BIO_int_ctrl_func(bp : PBIO; cmd : TIdC_INT; larg : TIdC_LONG; iArg : TIdC_INT) : TIdC_LONG cdecl; external SSLCLIB_LIB_name name 'BIO_int_ctrl'; + +function BIO_ptr_ctrl_func(bp : PBIO; cmd : TIdC_INT; larg : TIdC_LONG) : PIdAnsiChar cdecl; external SSLCLIB_LIB_name name 'BIO_ptr_ctrl'; + +function BIO_new_file_func(const filename: PIdAnsiChar; const mode: PIdAnsiChar): PBIO cdecl; external SSLCLIB_LIB_name name 'BIO_new_file'; + +function BIO_puts_func(b: PBIO; const txt: PIdAnsiChar): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'BIO_puts'; + +function BIO_read_func(b: PBIO; data: Pointer; len: TIdC_INT): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'BIO_read'; + +function BIO_write_func(b: PBIO; const buf: Pointer; len: TIdC_INT): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'BIO_write'; + +function i2d_X509_bio_func(bp: PBIO; x: PX509): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'i2d_X509_bio'; + +function i2d_PrivateKey_bio_func(b: PBIO; pkey: PEVP_PKEY): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'i2d_PrivateKey_bio'; + +function d2i_X509_bio_func(bp: PBIO; x: PPx509): PX509 cdecl; external SSLCLIB_LIB_name name 'd2i_X509_bio'; + +function i2d_X509_REQ_bio_func(bp: PBIO; x: PX509_REQ): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'i2d_X509_REQ_bio'; + +function i2d_PKCS7_func(x: PPKCS7; buf: PPByte): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'i2d_PKCS7'; + +function d2i_PKCS7_func(pr : PPKCS7; _in : PPByte; len : TIdC_INT): PPKCS7 cdecl; external SSLCLIB_LIB_name name 'd2i_PKCS7'; + +function i2d_X509_func(x: PX509; buf: PPByte) : TIdC_INT cdecl; external SSLCLIB_LIB_name name 'i2d_X509'; + +function d2i_X509_func(pr : PX509; _in : PPByte; len : TIdC_INT): PX509 cdecl; external SSLCLIB_LIB_name name 'd2i_X509'; + +function i2d_X509_REQ_func(x: PX509_REQ; buf: PPByte): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'i2d_X509_REQ'; + +function d2i_X509_REQ_func(pr : PX509_REQ; _in : PPByte; len : TIdC_INT): PX509_REQ cdecl; external SSLCLIB_LIB_name name 'd2i_X509_REQ'; + +function i2d_X509_CRL_func(x: PX509_CRL; buf: PPByte): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'i2d_X509_CRL'; + +function d2i_X509_CRL_func(pr : PX509_CRL; _in : PPByte; len : TIdC_INT): PX509_REQ cdecl; external SSLCLIB_LIB_name name 'd2i_X509_CRL'; + +function i2d_RSAPrivateKey_func(x: PRSA; buf: PPByte): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'i2d_RSAPrivateKey'; + +function d2i_RSAPrivateKey_func(pr : PRSA; _in : PPByte; len : TIdC_INT): PRSA cdecl; external SSLCLIB_LIB_name name 'd2i_RSAPrivateKey'; + +function i2d_RSAPublicKey_func(x: PRSA; buf: PPByte): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'i2d_RSAPublicKey'; + +function d2i_RSAPublicKey_func(pr : PRSA; _in : PPByte; len : TIdC_INT): PRSA cdecl; external SSLCLIB_LIB_name name 'd2i_RSAPublicKey'; + +function i2d_PrivateKey_func(x: PEVP_PKEY; buf: PPByte): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'i2d_PrivateKey'; + +function i2d_DSAparams_func(x: PDSA; buf: PPByte): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'i2d_DSAparams'; + +function d2i_DSAparams_func(pr : PDSA; _in : PPByte; len : TIdC_INT): PDSA cdecl; external SSLCLIB_LIB_name name 'd2i_DSAparams'; + +function i2d_DHparams_func(x: PDH; buf: PPByte): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'i2d_DHparams'; + +function d2i_DHparams_func(pr : PDH; _in : PPByte; len : TIdC_INT): PDH cdecl; external SSLCLIB_LIB_name name 'd2i_DHparams'; + +function i2d_NETSCAPE_CERT_SEQUENCE_func(x: PNETSCAPE_CERT_SEQUENCE; buf: PPByte): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'i2d_NETSCAPE_CERT_SEQUENCE'; + +function d2i_NETSCAPE_CERT_SEQUENCE_func(pr : PNETSCAPE_CERT_SEQUENCE; _in : PPByte; len : TIdC_INT): PNETSCAPE_CERT_SEQUENCE cdecl; external SSLCLIB_LIB_name name 'd2i_NETSCAPE_CERT_SEQUENCE'; + +function i2d_PUBKEY_func(x: PEVP_PKEY; buf: PPByte): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'i2d_PUBKEY'; + +function d2i_PUBKEY_func(pr : PEVP_PKEY; _in : PPByte; len : TIdC_INT): PEVP_PKEY cdecl; external SSLCLIB_LIB_name name 'd2i_PUBKEY'; + +function X509_get_default_cert_file_func: PIdAnsiChar cdecl; external SSLCLIB_LIB_name name 'X509_get_default_cert_file'; + +function X509_get_default_cert_file_env_func: PIdAnsiChar cdecl; external SSLCLIB_LIB_name name 'X509_get_default_cert_file_env'; + +function X509_new_func: PX509 cdecl; external SSLCLIB_LIB_name name 'X509_new'; + +procedure X509_free_proc(x: PX509) cdecl; external SSLCLIB_LIB_name name 'X509_free'; + +function X509_REQ_new_func: PX509_REQ cdecl; external SSLCLIB_LIB_name name 'X509_REQ_new'; + +procedure X509_REQ_free_proc(x:PX509_REQ) cdecl; external SSLCLIB_LIB_name name 'X509_REQ_free'; + +function X509_to_X509_REQ_func(x: PX509; pkey: PEVP_PKEY; const md: PEVP_MD): PX509_REQ cdecl; external SSLCLIB_LIB_name name 'X509_to_X509_REQ'; + +function X509_NAME_new_func: PX509_NAME cdecl; external SSLCLIB_LIB_name name 'X509_NAME_new'; + +procedure X509_NAME_free_proc(x:PX509_NAME) cdecl; external SSLCLIB_LIB_name name 'X509_NAME_free'; + +function X509_NAME_add_entry_by_txt_func(name: PX509_NAME; const field: PIdAnsiChar; _type: TIdC_INT; + const bytes: PIdAnsiChar; len, loc, _set: TIdC_INT): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'X509_NAME_add_entry_by_txt'; + +procedure X509_INFO_free_proc(a : PX509_INFO) cdecl; external SSLCLIB_LIB_name name 'X509_INFO_free'; + +function X509_set_version_func(x: PX509; version: TIdC_LONG): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'X509_set_version'; + +function X509_get_serialNumber_func(x: PX509): PASN1_INTEGER cdecl; external SSLCLIB_LIB_name name 'X509_get_serialNumber'; + +function X509_gmtime_adj_func(s: PASN1_TIME; adj: TIdC_LONG): PASN1_TIME cdecl; external SSLCLIB_LIB_name name 'X509_gmtime_adj'; + +function X509_set_notBefore_func(x: PX509; tm: PASN1_TIME): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'X509_set_notBefore'; + +function X509_set_notAfter_func(x: PX509; tm: PASN1_TIME): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'X509_set_notAfter'; + +function X509_set_pubkey_func(x: PX509; pkey: PEVP_PKEY): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'X509_set_pubkey'; + +function X509_REQ_set_pubkey_func(x: PX509_REQ; pkey: PEVP_PKEY): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'X509_REQ_set_pubkey'; + +function X509_PUBKEY_get_func(key: PX509_PUBKEY): PEVP_PKEY cdecl; external SSLCLIB_LIB_name name 'X509_PUBKEY_get'; + +function X509_verify_func(x509: PX509; pkey: PEVP_PKEY): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'X509_verify'; + +{$IFNDEF SSLEAY_MACROS} +function PEM_read_bio_X509_func(bp: PBIO; x: PPX509; cb: ppem_password_cb; u: Pointer): PX509 cdecl; external SSLCLIB_LIB_name name 'PEM_read_bio_X509'; + +function PEM_read_bio_X509_REQ_func(bp :PBIO; x : PPX509_REQ; cb :ppem_password_cb; u: PIdAnsiChar) : PX509_REQ cdecl; external SSLCLIB_LIB_name name 'PEM_read_bio_X509_REQ'; + +function PEM_read_bio_X509_CRL_func(bp : PBIO; x : PPX509_CRL;cb : ppem_password_cb; u: Pointer) : PX509_CRL cdecl; external SSLCLIB_LIB_name name 'PEM_read_bio_X509_CRL'; + +function PEM_read_bio_RSAPrivateKey_func(bp : PBIO; x : PPRSA; cb : ppem_password_cb; u: Pointer) : PRSA cdecl; external SSLCLIB_LIB_name name 'PEM_read_bio_RSAPrivateKey'; + +function PEM_read_bio_RSAPublicKey_func(bp : PBIO; x : PPRSA; cb : ppem_password_cb; u: Pointer) : PRSA cdecl; external SSLCLIB_LIB_name name 'PEM_read_bio_RSAPublicKey'; + +function PEM_read_bio_DSAPrivateKey_func(bp : PBIO; x : PPDSA; cb : ppem_password_cb; u : Pointer) : PDSA cdecl; external SSLCLIB_LIB_name name 'PEM_read_bio_DSAPrivateKey'; + +function PEM_read_bio_PrivateKey_func(bp : PBIO; x : PPEVP_PKEY; cb : ppem_password_cb; u : Pointer) : PEVP_PKEY cdecl; external SSLCLIB_LIB_name name 'PEM_read_bio_PrivateKey'; + +function PEM_read_bio_PKCS7_func(bp : PBIO; x : PPPKCS7; cb : ppem_password_cb; u : Pointer) : PPKCS7 cdecl; external SSLCLIB_LIB_name name 'PEM_read_bio_PKCS7'; + +function PEM_read_bio_DHparams_func(bp : PBIO; x : PPDH; cb : ppem_password_cb; u : Pointer) : PDH cdecl; external SSLCLIB_LIB_name name 'PEM_read_bio_DHparams'; + +function PEM_read_bio_DSAparams_func(bp : PBIO; x : PPDSA; cb : ppem_password_cb; u : Pointer) : PDSA cdecl; external SSLCLIB_LIB_name name 'PEM_read_bio_DSAparams'; + +function PEM_read_bio_NETSCAPE_CERT_SEQUENCE_func(bp : PBIO; x : PPNETSCAPE_CERT_SEQUENCE; + cb : ppem_password_cb; u : Pointer) : PNETSCAPE_CERT_SEQUENCE cdecl; external SSLCLIB_LIB_name name 'PEM_read_bio_NETSCAPE_CERT_SEQUENCE'; + +function PEM_read_bio_PUBKEY_func(bp : PBIO; x : PPEVP_PKEY; cb : ppem_password_cb; u : Pointer) : PEVP_PKEY cdecl; external SSLCLIB_LIB_name name 'PEM_read_bio_PUBKEY'; + +function PEM_write_bio_X509_func(b: PBIO; x: PX509): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'PEM_write_bio_X509'; + +function PEM_write_bio_X509_REQ_func(bp: PBIO; x: PX509_REQ): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'PEM_write_bio_X509_REQ'; + +function PEM_write_bio_X509_CRL_func(bp : PBIO; x : PX509_CRL) : TIdC_INT cdecl; external SSLCLIB_LIB_name name 'PEM_write_bio_X509_CRL'; + +function PEM_write_bio_RSAPrivateKey_func(bp : PBIO; x : PRSA; const enc : PEVP_CIPHER; + kstr : PIdAnsiChar; klen : TIdC_INT; cb : Ppem_password_cb; u : Pointer) : TIdC_INT cdecl; external SSLCLIB_LIB_name name 'PEM_write_bio_RSAPrivateKey'; + +function PEM_write_bio_RSAPublicKey_func(bp : PBIO; x : PRSA) : TIdC_INT cdecl; external SSLCLIB_LIB_name name 'PEM_write_bio_RSAPublicKey'; + +function PEM_write_bio_DSAPrivateKey_func(bp : PBIO; x : PDSA; const enc : PEVP_CIPHER; + kstr : PIdAnsiChar; klen : TIdC_INT; cb : Ppem_password_cb; u : Pointer) : TIdC_INT cdecl; external SSLCLIB_LIB_name name 'PEM_write_bio_DSAPrivateKey'; + +function PEM_write_bio_PrivateKey_func(bp : PBIO; x : PEVP_PKEY; const enc : PEVP_CIPHER; + kstr : PIdAnsiChar; klen : TIdC_INT; cb : Ppem_password_cb; u : Pointer) : TIdC_INT cdecl; external SSLCLIB_LIB_name name 'PEM_write_bio_PrivateKey'; + +function PEM_write_bio_PKCS7_func(bp : PBIO; x : PPKCS7) : TIdC_INT cdecl; external SSLCLIB_LIB_name name 'PEM_write_bio_PKCS7'; + +function PEM_write_bio_DHparams_func(bp : PBIO; x : PDH): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'PEM_write_bio_DHparams'; + +function PEM_write_bio_DSAparams_func(bp : PBIO; x : PDSA) : TIdC_INT cdecl; external SSLCLIB_LIB_name name 'PEM_write_bio_DSAparams'; + +function PEM_write_bio_NETSCAPE_CERT_SEQUENCE_func(bp : PBIO; x : PDSA) : TIdC_INT cdecl; external SSLCLIB_LIB_name name 'PEM_write_bio_NETSCAPE_CERT_SEQUENCE'; + +function PEM_write_bio_PKCS8PrivateKey_func(bp: PBIO; key: PEVP_PKEY; enc: PEVP_CIPHER; + kstr: PIdAnsiChar; klen: TIdC_INT; cb: ppem_password_cb; u: Pointer): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'PEM_write_bio_PKCS8PrivateKey'; + +function PEM_write_bio_PUBKEY_func(bp: PBIO; x: PEVP_PKEY): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'PEM_write_bio_PUBKEY'; +{$ELSE} +function PEM_ASN1_write_bio_func(i2d: i2d_of_void; const name: PIdAnsiChar; + bp: PBIO; x: PIdAnsiChar; const enc: PEVP_CIPHER; kstr: PIdAnsiChar; klen: TIdC_INT; + cb: ppem_password_cb; u: Pointer):TIdC_INT cdecl; external SSLCLIB_LIB_name name 'PEM_ASN1_write_bio'; + +function PEM_ASN1_read_bio_func(d2i: d2i_OF_void; name: PIdAnsiChar; bp: PBIO; + x: PPointer; cb: ppem_password_cb; u:Pointer): Pointer cdecl; external SSLCLIB_LIB_name name 'PEM_ASN1_read_bio'; +{$ENDIF} + +function PEM_X509_INFO_read_bio_func(bp : PBIO; sk : PSTACK_OF_X509_INFO; + cb : ppem_password_cb; u : Pointer) : PSTACK_OF_X509_INFO cdecl; external SSLCLIB_LIB_name name 'PEM_X509_INFO_read_bio'; + +function PEM_read_bio_X509_AUX_func(bp : PBIO; x : PPX509; + cb : ppem_password_cb; u : Pointer) : PX509 cdecl; external SSLCLIB_LIB_name name 'PEM_read_bio_X509_AUX'; + +{$IFNDEF OPENSSL_NO_DES} +function EVP_des_ede3_cbc_func: PEVP_CIPHER cdecl; external SSLCLIB_LIB_name name 'EVP_des_ede3_cbc'; +{$ENDIF} + +{$IFNDEF OPENSSL_NO_SHA512} +function EVP_sha512_func: PEVP_MD cdecl; external SSLCLIB_LIB_name name 'EVP_sha512'; + +function EVP_sha384_func: PEVP_MD cdecl; external SSLCLIB_LIB_name name 'EVP_sha384'; +{$ENDIF} + +{$IFNDEF OPENSSL_NO_SHA256} +function EVP_sha256_func: PEVP_MD cdecl; external SSLCLIB_LIB_name name 'EVP_sha256'; + +function EVP_sha224_func: PEVP_MD cdecl; external SSLCLIB_LIB_name name 'EVP_sha224'; +{$ENDIF} + +{$IFNDEF OPENSSL_NO_SHA} +function EVP_sha1_func: PEVP_MD cdecl; external SSLCLIB_LIB_name name 'EVP_sha1'; +{$ENDIF} + +{$IFNDEF OPENSSL_NO_MD5} +function EVP_md5_func: PEVP_MD cdecl; external SSLCLIB_LIB_name name 'EVP_md5'; +{$ENDIF} + +{$IFNDEF OPENSSL_NO_MD4} +function EVP_md4_func: PEVP_MD cdecl; external SSLCLIB_LIB_name name 'EVP_md4'; +{$ENDIF} + +//{$IFNDEF OPENSSL_NO_MD2} +//function EVP_md2_func: PEVP_MD cdecl; external SSLCLIB_LIB_name name 'EVP_md2'; +//{$ENDIF} + +procedure EVP_MD_CTX_init_proc(ctx : PEVP_MD_CTX) cdecl; external SSLCLIB_LIB_name name 'EVP_MD_CTX_init'; + +function EVP_MD_CTX_cleanup_func(ctx : PEVP_MD_CTX) : TIdC_Int cdecl; external SSLCLIB_LIB_name name 'EVP_MD_CTX_cleanup'; + +function EVP_MD_CTX_create_func : PEVP_MD_CTX cdecl; external SSLCLIB_LIB_name name 'EVP_MD_CTX_create'; + +procedure EVP_MD_CTX_destroy_proc(ctx : PEVP_MD_CTX) cdecl; external SSLCLIB_LIB_name name 'EVP_MD_CTX_destroy'; + +function EVP_MD_CTX_copy_func(_out : PEVP_MD_CTX; _in: PEVP_MD_CTX) : TIdC_INT cdecl; external SSLCLIB_LIB_name name 'EVP_MD_CTX_copy'; + +function EVP_MD_CTX_copy_ex_func(_out : PEVP_MD_CTX; const _in: PEVP_MD_CTX) : TIdC_INT cdecl; external SSLCLIB_LIB_name name 'EVP_MD_CTX_copy_ex'; + +function EVP_DigestInit_ex_func(ctx : PEVP_MD_CTX; const AType : PEVP_MD; impl : PENGINE) : TIdC_Int cdecl; external SSLCLIB_LIB_name name 'EVP_DigestInit_ex'; + +function EVP_DigestUpdate_func(ctx : PEVP_MD_CTX; d : Pointer; cnt : size_t) : TIdC_Int cdecl; external SSLCLIB_LIB_name name 'EVP_DigestUpdate'; + +function EVP_DigestFinal_ex_func(ctx : PEVP_MD_CTX; md : PIdAnsiChar; var s : TIdC_UInt) : TIdC_Int cdecl; external SSLCLIB_LIB_name name 'EVP_DigestFinal_ex'; + +function EVP_PKEY_type_func(_type : TIdC_INT): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'EVP_PKEY_type'; + +function EVP_PKEY_new_func: PEVP_PKEY cdecl; external SSLCLIB_LIB_name name 'EVP_PKEY_new'; + +procedure EVP_PKEY_free_proc(pkey: PEVP_PKEY) cdecl; external SSLCLIB_LIB_name name 'EVP_PKEY_free'; + +function EVP_PKEY_assign_func(pkey: PEVP_PKEY; _type: TIdC_INT; key: Pointer): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'EVP_PKEY_assign'; + +function EVP_get_digestbyname_func(const name: PIdAnsiChar): PEVP_MD cdecl; external SSLCLIB_LIB_name name 'EVP_get_digestbyname'; + +{$IFNDEF OPENSSL_NO_HMAC} +procedure HMAC_CTX_init_proc(ctx : PHMAC_CTX) cdecl; external SSLCLIB_LIB_name name 'HMAC_CTX_init'; + +function HMAC_Init_ex_func(ctx : PHMAC_CTX; key : Pointer; len : TIdC_INT; + md : PEVP_MD; impl : PENGINE) : TIdC_INT cdecl; external SSLCLIB_LIB_name name 'HMAC_Init_ex'; + +function HMAC_Update_func(ctx : PHMAC_CTX; data : PIdAnsiChar; len : size_t) : TIdC_INT cdecl; external SSLCLIB_LIB_name name 'HMAC_Update'; + +function HMAC_Final_func(ctx : PHMAC_CTX; md : PIdAnsiChar; len : PIdC_UINT) : TIdC_INT cdecl; external SSLCLIB_LIB_name name 'HMAC_Final'; + +procedure HMAC_CTX_cleanup_proc(ctx : PHMAC_CTX) cdecl; external SSLCLIB_LIB_name name 'HMAC_CTX_cleanup'; +{$ENDIF} + +function OBJ_obj2nid_func(const o: PASN1_OBJECT): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'OBJ_obj2nid'; + +function OBJ_nid2obj_func(n : TIdC_INT) : PASN1_OBJECT cdecl; external SSLCLIB_LIB_name name 'OBJ_nid2obj'; + +function OBJ_nid2ln_func(n : TIdC_INT) : PIdAnsiChar cdecl; external SSLCLIB_LIB_name name 'OBJ_nid2ln'; + +function OBJ_nid2sn_func(n : TIdC_INT) : PIdAnsiChar cdecl; external SSLCLIB_LIB_name name 'OBJ_nid2sn'; + +function ASN1_INTEGER_set_func(a: PASN1_INTEGER; v: TIdC_LONG): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'ASN1_INTEGER_set'; + +function ASN1_INTEGER_get_func(a: PASN1_INTEGER) : TIdC_LONG cdecl; external SSLCLIB_LIB_name name 'ASN1_INTEGER_get'; + +function ASN1_STRING_type_new_func(_type: TIdC_INT): PASN1_STRING cdecl; external SSLCLIB_LIB_name name 'ASN1_STRING_type_new'; + +procedure ASN1_STRING_free_proc(a: PASN1_STRING) cdecl; external SSLCLIB_LIB_name name 'ASN1_STRING_free'; + +function ASN1_dup_func(i2d : i2d_of_void; d2i : d2i_of_void; x : PIdAnsiChar) : Pointer cdecl; external SSLCLIB_LIB_name name 'ASN1_dup'; + +function CRYPTO_set_mem_functions_func( + m: TCRYPTO_set_mem_functions_m; + r: TCRYPTO_set_mem_functions_r; + f: TCRYPTO_set_mem_functions_f): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'CRYPTO_set_mem_functions'; + +function CRYPTO_malloc_func(num: TIdC_INT; const _file: PIdAnsiChar; line: TIdC_INT): Pointer cdecl; external SSLCLIB_LIB_name name 'CRYPTO_malloc'; + +procedure CRYPTO_free_proc(ptr : Pointer) cdecl; external SSLCLIB_LIB_name name 'CRYPTO_free'; + +procedure CRYPTO_mem_leaks_proc(b:PBIO) cdecl; external SSLCLIB_LIB_name name 'CRYPTO_mem_leaks'; + +function CRYPTO_mem_ctrl_func(mode: TIdC_INT): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'CRYPTO_mem_ctrl'; + +procedure CRYPTO_set_mem_debug_functions_proc( + m: Tset_mem_debug_functions_m; + r: Tset_mem_debug_functions_r; + f : Tset_mem_debug_functions_f; + so : Tset_mem_debug_functions_so; + go : Tset_mem_debug_functions_go) cdecl; external SSLCLIB_LIB_name name 'CRYPTO_set_mem_debug_functions'; + +function PKCS12_create_func(pass, name: PIdAnsiChar; pkey: PEVP_PKEY; cert : PX509; + ca: PSTACK_OF_X509; nid_key, nid_cert, iter, mac_iter, keytype : TIdC_INT) : PPKCS12 cdecl; external SSLCLIB_LIB_name name 'PKCS12_create'; + +function i2d_PKCS12_bio_func(b: PBIO; p12: PPKCS12) : TIdC_INT cdecl; external SSLCLIB_LIB_name name 'i2d_PKCS12_bio'; + +procedure PKCS12_free_proc(p12: PPKCS12) cdecl; external SSLCLIB_LIB_name name 'PKCS12_free'; + +//procedure OpenSSL_add_all_algorithms_proc cdecl; external SSLCLIB_LIB_name name 'OpenSSL_add_all_algorithms'; + +procedure OpenSSL_add_all_ciphers_proc cdecl; external SSLCLIB_LIB_name name 'OpenSSL_add_all_ciphers'; + +procedure OpenSSL_add_all_digests_proc cdecl; external SSLCLIB_LIB_name name 'OpenSSL_add_all_digests'; + +procedure EVP_cleanup_proc cdecl; external SSLCLIB_LIB_name name 'EVP_cleanup'; + +function sk_num_func(const x : PSTACK) : TIdC_INT cdecl; external SSLCLIB_LIB_name name 'sk_num'; + +function sk_new_func( cmp : Tsk_new_cmp) : PStack cdecl; external SSLCLIB_LIB_name name 'sk_new'; + +function sk_new_null_func: PSTACK cdecl; external SSLCLIB_LIB_name name 'sk_new_null'; + +procedure sk_free_proc(st : PSTACK) cdecl; external SSLCLIB_LIB_name name 'sk_free'; + +function sk_push_func(st: PSTACK; data: PIdAnsiChar): TIdC_INT cdecl; external SSLCLIB_LIB_name name 'sk_push'; + +function sk_dup_func(st : PSTACK) : PSTACK cdecl; external SSLCLIB_LIB_name name 'sk_dup'; + +function sk_find_func(st : PSTACK; Data : PIdAnsiChar) : TIdC_INT cdecl; external SSLCLIB_LIB_name name 'sk_find'; + +function sk_value_func(x : PSTACK; i : TIdC_INT) : PIdAnsiChar cdecl; external SSLCLIB_LIB_name name 'sk_value'; + +{$IFDEF OPENSSL_FIPS} +//function FIPS_mode_set_func(onoff : TIdC_INT) : TIdC_INT cdecl; external SSLCLIB_LIB_name name 'FIPS_mode_set'; + +//function FIPS_mode_func: TIdC_INT cdecl; external SSLCLIB_LIB_name name 'FIPS_mode'; +{$ENDIF} + +procedure LoadSymbols; +begin + SSL_CTX_set_cipher_list := SSL_CTX_set_cipher_list_func; + SSL_CTX_new := SSL_CTX_new_func; + SSL_CTX_free := SSL_CTX_free_proc; + SSL_set_fd := SSL_set_fd_func; + SSL_CTX_use_PrivateKey_file := SSL_CTX_use_PrivateKey_file_func; + SSL_CTX_use_PrivateKey := SSL_CTX_use_PrivateKey_func; + SSL_CTX_use_certificate := SSL_CTX_use_certificate_func; + SSL_CTX_use_certificate_file := SSL_CTX_use_certificate_file_func; + SSL_load_error_strings := SSL_load_error_strings_proc; + SSL_state_string_long := SSL_state_string_long_func; + SSL_alert_desc_string_long := SSL_alert_desc_string_long_func; + SSL_alert_type_string_long := SSL_alert_type_string_long_func; + + SSL_get_peer_certificate := SSL_get_peer_certificate_func; + SSL_CTX_set_verify := SSL_CTX_set_verify_proc; + SSL_CTX_set_verify_depth := SSL_CTX_set_verify_depth_proc; + SSL_CTX_get_verify_depth := SSL_CTX_get_verify_depth_func; + SSL_CTX_set_default_passwd_cb := SSL_CTX_set_default_passwd_cb_proc; + SSL_CTX_set_default_passwd_cb_userdata:= SSL_CTX_set_default_passwd_cb_userdata_proc; + SSL_CTX_check_private_key := SSL_CTX_check_private_key_func; + SSL_new := SSL_new_func; + SSL_free := SSL_free_proc; + SSL_accept := SSL_accept_func; + SSL_connect := SSL_connect_func; + SSL_read := SSL_read_func; + SSL_peek := SSL_peek_func; + SSL_pending := SSL_pending_func; + SSL_write := SSL_write_func; + SSL_ctrl := SSL_ctrl_func; + SSL_callback_ctrl := SSL_callback_ctrl_func; + SSL_CTX_ctrl := SSL_CTX_ctrl_func; + SSL_CTX_callback_ctrl := SSL_CTX_callback_ctrl_func; + SSL_get_error := SSL_get_error_func; + {$IFNDEF OPENSSL_NO_SSL2} + SSLv2_method := SSLv2_method_func; + SSLv2_server_method := SSLv2_server_method_func; + SSLv2_client_method := SSLv2_client_method_func; + {$ELSE} + SSLv2_method := nil; + SSLv2_server_method := nil; + SSLv2_client_method := nil; + {$ENDIF} + SSLv3_method := SSLv3_method_func; + SSLv3_server_method := SSLv3_server_method_func; + SSLv3_client_method := SSLv3_client_method_func; + SSLv23_method := SSLv23_method_func; + SSLv23_server_method := SSLv23_server_method_func; + SSLv23_client_method := SSLv23_client_method_func; + TLSv1_method := TLSv1_method_func; + TLSv1_server_method := TLSv1_server_method_func; + TLSv1_client_method := TLSv1_client_method_func; + TLSv1_1_method := TLSv1_1_method_func; + TLSv1_1_server_method := TLSv1_1_server_method_func; + TLSv1_1_client_method := TLSv1_1_client_method_func; + TLSv1_2_method := TLSv1_2_method_func; + TLSv1_2_server_method := TLSv1_2_server_method_func; + TLSv1_2_client_method := TLSv1_2_client_method_func; + DTLSv1_method := DTLSv1_method_func; + DTLSv1_server_method := DTLSv1_server_method_func; + DTLSv1_client_method := DTLSv1_client_method_func; + SSL_shutdown := SSL_shutdown_func; + SSL_set_connect_state := SSL_set_connect_state_proc; + SSL_set_accept_state := SSL_set_accept_state_proc; + SSL_set_shutdown := SSL_set_shutdown_proc; + SSL_CTX_load_verify_locations := SSL_CTX_load_verify_locations_func; + SSL_get_session := SSL_get_session_func; + SSLeay_add_ssl_algorithms := SSLeay_add_ssl_algorithms_func; + SSL_SESSION_get_id := SSL_SESSION_get_id_func; + SSL_copy_session_id := SSL_copy_session_id_proc; + // CRYPTO LIB + _SSLeay_version := SSLeay_version_func; + SSLeay := SSLeay_func; + d2i_X509_NAME := d2i_X509_NAME_func; + i2d_X509_NAME := i2d_X509_NAME_func; + X509_NAME_oneline := X509_NAME_oneline_func; + X509_NAME_cmp := X509_NAME_cmp_func; + X509_NAME_hash := X509_NAME_hash_func; + X509_set_issuer_name := X509_set_issuer_name_func; + X509_get_issuer_name := X509_get_issuer_name_func; + X509_set_subject_name := X509_set_subject_name_func; + X509_get_subject_name := X509_get_subject_name_func; + X509_digest := X509_digest_func; + X509_LOOKUP_ctrl := X509_LOOKUP_ctrl_func; + X509_STORE_add_cert := X509_STORE_add_cert_func; + X509_STORE_add_crl := X509_STORE_add_crl_func; + X509_STORE_CTX_get_ex_data := X509_STORE_CTX_get_ex_data_func; + X509_STORE_CTX_get_error := X509_STORE_CTX_get_error_func; + X509_STORE_CTX_set_error := X509_STORE_CTX_set_error_proc; + X509_STORE_CTX_get_error_depth := X509_STORE_CTX_get_error_depth_func; + X509_STORE_CTX_get_current_cert := X509_STORE_CTX_get_current_cert_func; + X509_STORE_add_lookup := X509_STORE_add_lookup_func; + X509_STORE_load_locations := X509_STORE_load_locations_func; + i2d_DSAPrivateKey := i2d_DSAPrivateKey_func; + d2i_DSAPrivateKey := d2i_DSAPrivateKey_func; + d2i_PrivateKey := d2i_PrivateKey_func; + d2i_PrivateKey_bio := d2i_PrivateKey_bio_func; + X509_sign := X509_sign_func; + X509_REQ_sign := X509_REQ_sign_func; + X509_REQ_add_extensions := X509_REQ_add_extensions_func; + X509V3_EXT_conf_nid := X509V3_EXT_conf_nid_func; + X509_EXTENSION_create_by_NID := X509_EXTENSION_create_by_NID_func; + X509V3_set_ctx := X509V3_set_ctx_proc; + X509_EXTENSION_free := X509_EXTENSION_free_proc; + X509_add_ext := X509_add_ext_func; + {$IFNDEF OPENSSL_NO_BIO} + //X509_print + X509_print := X509_print_func; + {$ENDIF} +// _RAND_cleanup := RAND_cleanup_func; +// _RAND_bytes := RAND_bytes_func; +// _RAND_pseudo_bytes := RAND_pseudo_bytes_func; +// _RAND_seed := RAND_seed_proc; +// _RAND_add := RAND_add_proc; +// _RAND_status := RAND_status_func; + {$IFDEF SYS_WIN} + _RAND_screen := RAND_screen_proc; + _RAND_event := RAND_event_func; + {$ENDIF} + {$IFNDEF OPENSSL_NO_DES} + // 3DES + DES_set_odd_parity := DES_set_odd_parity_proc; + DES_set_key := DES_set_key_func; + DES_ecb_encrypt := DES_ecb_encrypt_proc; +// Id_ossl_old_des_set_odd_parity := Id_ossl_old_des_set_odd_parity_proc; +// Id_ossl_old_des_set_key := Id_ossl_old_des_set_key_func; +// Id_ossl_old_des_ecb_encrypt := Id_ossl_old_des_ecb_encrypt_proc; + {$ENDIF} + // More SSL functions + SSL_set_ex_data := SSL_set_ex_data_func; + SSL_get_ex_data := SSL_get_ex_data_func; + SSL_load_client_CA_file := SSL_load_client_CA_file_func; + SSL_CTX_set_client_CA_list := SSL_CTX_set_client_CA_list_proc; + SSL_CTX_set_default_verify_paths := SSL_CTX_set_default_verify_paths_func; + SSL_CTX_set_session_id_context := SSL_CTX_set_session_id_context_func; + SSL_CIPHER_description := SSL_CIPHER_description_func; + SSL_get_current_cipher := SSL_get_current_cipher_func; + SSL_CIPHER_get_name := SSL_CIPHER_get_name_func; + SSL_CIPHER_get_version := SSL_CIPHER_get_version_func; + SSL_CIPHER_get_bits := SSL_CIPHER_get_bits_func; + // Thread safe + _CRYPTO_lock := CRYPTO_lock_proc; + _CRYPTO_num_locks := CRYPTO_num_locks_func; + CRYPTO_set_locking_callback := CRYPTO_set_locking_callback_proc; + {$IFNDEF WIN32_OR_WIN64} +{ +In OpenSSL 1.0.0, you should use these callback functions instead of the +depreciated set_id_callback. They are not in the older 0.9.8 OpenSSL series so +we have to handle both cases. +} + CRYPTO_THREADID_set_callback := CRYPTO_THREADID_set_callback_func; + CRYPTO_THREADID_set_numeric := CRYPTO_THREADID_set_numeric_proc; + CRYPTO_THREADID_set_pointer := CRYPTO_THREADID_set_pointer_proc; {Do not localize} +// if not assigned(CRYPTO_THREADID_set_callback) then begin +// @CRYPTO_set_id_callback := LoadFunctionCLib(fn_CRYPTO_set_id_callback); +// end; + {$ENDIF} + ERR_put_error := ERR_put_error_proc; + ERR_get_error := ERR_get_error_func; + ERR_peek_error := ERR_peek_error_func; + ERR_peek_last_error := ERR_peek_last_error_func; + ERR_clear_error := ERR_clear_error_proc; + ERR_error_string := ERR_error_string_func; + ERR_error_string_n := ERR_error_string_n_proc; + ERR_lib_error_string := ERR_lib_error_string_func; + ERR_func_error_string := ERR_func_error_string_func; + ERR_reason_error_string := ERR_reason_error_string_func; + ERR_load_ERR_strings := ERR_load_ERR_strings_proc; + ERR_load_crypto_strings := ERR_load_crypto_strings_proc; + ERR_free_strings := ERR_free_strings_proc; + ERR_remove_thread_state := ERR_remove_thread_state_proc; +// if not Assigned(ERR_remove_thread_state) then begin +// @ERR_remove_state := LoadFunctionCLib(fn_ERR_remove_state); +// end; + CRYPTO_cleanup_all_ex_data := CRYPTO_cleanup_all_ex_data_proc; + SSL_COMP_get_compression_methods := SSL_COMP_get_compression_methods_func; + SSL_COMP_free_compression_methods := SSL_COMP_free_compression_methods_func; + sk_pop_free := sk_pop_free_proc; + //RSA + RSA_free := RSA_free_proc; + RSA_generate_key := RSA_generate_key_func; + RSA_check_key := RSA_check_key_func; + RSA_generate_key_ex := RSA_generate_key_ex_func; + RSA_new := RSA_new_func; + RSA_size := RSA_size_func; + RSA_private_decrypt := RSA_private_decrypt_func; + RSA_public_encrypt := RSA_public_encrypt_func; + //DH + DH_free := DH_free_proc; + //BN + BN_new := BN_new_func; + BN_free := BN_free_proc; + BN_hex2bn := BN_hex2bn_func; + BN_bn2hex := BN_bn2hex_func; + BN_set_word := BN_set_word_func; + //BIO + BIO_new := BIO_new_func; + BIO_free := BIO_free_func; + BIO_new_mem_buf := BIO_new_mem_buf_func; + BIO_s_mem := BIO_s_mem_func; + BIO_s_file := BIO_s_file_func; + BIO_ctrl := BIO_ctrl_func; + BIO_int_ctrl := BIO_int_ctrl_func; + BIO_ptr_ctrl := BIO_ptr_ctrl_func; + BIO_new_file := BIO_new_file_func; + BIO_puts := BIO_puts_func; + BIO_read := BIO_read_func; + BIO_write := BIO_write_func; + //i2d + i2d_X509_bio := i2d_X509_bio_func; + i2d_PrivateKey_bio := i2d_PrivateKey_bio_func; + d2i_X509_bio := d2i_X509_bio_func; + i2d_X509_REQ_bio := i2d_X509_REQ_bio_func; + i2d_PKCS7 := i2d_PKCS7_func; + d2i_PKCS7 := d2i_PKCS7_func; + i2d_X509 := i2d_X509_func; + d2i_X509 := d2i_X509_func; + i2d_X509_REQ := i2d_X509_REQ_func; + d2i_X509_REQ := d2i_X509_REQ_func; + i2d_X509_CRL := i2d_X509_CRL_func; + d2i_X509_CRL := d2i_X509_CRL_func; + i2d_RSAPrivateKey := i2d_RSAPrivateKey_func; + d2i_RSAPrivateKey := d2i_RSAPrivateKey_func; + i2d_RSAPublicKey := i2d_RSAPublicKey_func; + d2i_RSAPublicKey := d2i_RSAPublicKey_func; + i2d_PrivateKey := i2d_PrivateKey_func; + d2i_PrivateKey := d2i_PrivateKey_func; + + i2d_DSAparams := i2d_DSAparams_func; + d2i_DSAparams := d2i_DSAparams_func; + i2d_DHparams := i2d_DHparams_func; + d2i_DHparams := d2i_DHparams_func; + i2d_NETSCAPE_CERT_SEQUENCE := i2d_NETSCAPE_CERT_SEQUENCE_func; + d2i_NETSCAPE_CERT_SEQUENCE := d2i_NETSCAPE_CERT_SEQUENCE_func; + i2d_PUBKEY := i2d_PUBKEY_func; + d2i_PUBKEY := d2i_PUBKEY_func; + + //X509 + X509_get_default_cert_file := X509_get_default_cert_file_func; + X509_get_default_cert_file_env := X509_get_default_cert_file_env_func; + X509_new := X509_new_func; + X509_free := X509_free_proc; + X509_REQ_new := X509_REQ_new_func; + X509_REQ_free := X509_REQ_free_proc; + X509_to_X509_REQ := X509_to_X509_REQ_func; + X509_NAME_new := X509_NAME_new_func; + X509_NAME_free := X509_NAME_free_proc; + X509_NAME_add_entry_by_txt := X509_NAME_add_entry_by_txt_func; + X509_INFO_free := X509_INFO_free_proc; + X509_set_version := X509_set_version_func; + X509_get_serialNumber := X509_get_serialNumber_func; + X509_gmtime_adj := X509_gmtime_adj_func; + X509_set_notBefore := X509_set_notBefore_func; + X509_set_notAfter := X509_set_notAfter_func; + X509_set_pubkey := X509_set_pubkey_func; + X509_REQ_set_pubkey := X509_REQ_set_pubkey_func; + X509_PUBKEY_get := X509_PUBKEY_get_func; + X509_verify := X509_verify_func; + //PEM + {$IFNDEF SSLEAY_MACROS} + _PEM_read_bio_X509 := PEM_read_bio_X509_func; + _PEM_read_bio_X509_REQ := PEM_read_bio_X509_REQ_func; + _PEM_read_bio_X509_CRL := PEM_read_bio_X509_CRL_func; + _PEM_read_bio_RSAPrivateKey := PEM_read_bio_RSAPrivateKey_func; + _PEM_read_bio_RSAPublicKey := PEM_read_bio_RSAPublicKey_func; + _PEM_read_bio_DSAPrivateKey := PEM_read_bio_DSAPrivateKey_func; + _PEM_read_bio_PrivateKey := PEM_read_bio_PrivateKey_func; + _PEM_read_bio_PKCS7 := PEM_read_bio_PKCS7_func; + _PEM_read_bio_DHparams := PEM_read_bio_DHparams_func; + _PEM_read_bio_DSAparams := PEM_read_bio_DSAparams_func; + _PEM_read_bio_NETSCAPE_CERT_SEQUENCE := PEM_read_bio_NETSCAPE_CERT_SEQUENCE_func; + _PEM_read_bio_PUBKEY := PEM_read_bio_PUBKEY_func; + _PEM_write_bio_X509 := PEM_write_bio_X509_func; + _PEM_write_bio_X509_REQ := PEM_write_bio_X509_REQ_func; + _PEM_write_bio_X509_CRL := PEM_write_bio_X509_CRL_func; + _PEM_write_bio_RSAPrivateKey := PEM_write_bio_RSAPrivateKey_func; + _PEM_write_bio_RSAPublicKey := PEM_write_bio_RSAPublicKey_func; + _PEM_write_bio_DSAPrivateKey := PEM_write_bio_DSAPrivateKey_func; + _PEM_write_bio_PrivateKey := PEM_write_bio_PrivateKey_func; + _PEM_write_bio_PKCS7 := PEM_write_bio_PKCS7_func; + _PEM_write_bio_DHparams := PEM_write_bio_DHparams_func; + _PEM_write_bio_DSAparams := PEM_write_bio_DSAparams_func; + _PEM_write_bio_NETSCAPE_CERT_SEQUENCE := PEM_write_bio_NETSCAPE_CERT_SEQUENCE_func; + _PEM_write_bio_PKCS8PrivateKey := PEM_write_bio_PKCS8PrivateKey_func; + _PEM_write_bio_PUBKEY := PEM_write_bio_PUBKEY_func; + {$ELSE} + PEM_ASN1_write_bio := PEM_ASN1_write_bio_func; + PEM_ASN1_read_bio := PEM_ASN1_read_bio_func; + {$ENDIF} + PEM_X509_INFO_read_bio := PEM_X509_INFO_read_bio_func; + PEM_read_bio_X509_AUX := PEM_read_bio_X509_AUX_func; + //EVP + {$IFNDEF OPENSSL_NO_DES} + EVP_des_ede3_cbc := EVP_des_ede3_cbc_func; + {$ENDIF} + {$IFNDEF OPENSSL_NO_SHA512} + EVP_sha512 := EVP_sha512_func; + EVP_sha384 := EVP_sha384_func; + {$ENDIF} + {$IFNDEF OPENSSL_NO_SHA256} + EVP_sha256 := EVP_sha256_func; + EVP_sha224 := EVP_sha224_func; + {$ENDIF} + {$IFNDEF OPENSSL_NO_SHA} + EVP_sha1 := EVP_sha1_func; + {$ENDIF} + {$IFNDEF OPENSSL_NO_MD5} + EVP_md5 := EVP_md5_func; + {$ENDIF} + {$IFNDEF OPENSSL_NO_MD4} + EVP_md4 := EVP_md4_func; + {$ENDIF} +// {$IFNDEF OPENSSL_NO_MD2} +// EVP_md2 := EVP_md2_func; +// {$ENDIF} + EVP_MD_CTX_init := EVP_MD_CTX_init_proc; + EVP_MD_CTX_cleanup := EVP_MD_CTX_cleanup_func; + EVP_MD_CTX_create := EVP_MD_CTX_create_func; + EVP_MD_CTX_destroy := EVP_MD_CTX_destroy_proc; + EVP_MD_CTX_copy := EVP_MD_CTX_copy_func; + EVP_MD_CTX_copy_ex := EVP_MD_CTX_copy_ex_func; + EVP_DigestInit_ex := EVP_DigestInit_ex_func; + EVP_DigestUpdate := EVP_DigestUpdate_func; + EVP_DigestFinal_ex := EVP_DigestFinal_ex_func; + EVP_MD_CTX_cleanup := EVP_MD_CTX_cleanup_func; + EVP_PKEY_type := EVP_PKEY_type_func; + EVP_PKEY_new := EVP_PKEY_new_func; + EVP_PKEY_free := EVP_PKEY_free_proc; + EVP_PKEY_assign := EVP_PKEY_assign_func; + EVP_get_digestbyname := EVP_get_digestbyname_func; + //HMAC + {$IFNDEF OPENSSL_NO_HMAC} + HMAC_CTX_init := HMAC_CTX_init_proc; +// if IsOpenSSL_1x then begin + _1_0_HMAC_Init_ex := HMAC_Init_ex_func; + _1_0_HMAC_Update := HMAC_Update_func; + _1_0_HMAC_Final := HMAC_Final_func; +// end else begin +// @_HMAC_Init_ex := LoadFunctionCLib(fn_HMAC_Init_ex); +// @_HMAC_Update := LoadFunctionCLib(fn_HMAC_Update); +// @_HMAC_Final := LoadFunctionCLib(fn_HMAC_Final); +// end; + HMAC_CTX_cleanup := HMAC_CTX_cleanup_proc; + {$ENDIF} + //OBJ + OBJ_obj2nid := OBJ_obj2nid_func; + OBJ_nid2obj := OBJ_nid2obj_func; + OBJ_nid2ln := OBJ_nid2ln_func; + OBJ_nid2sn := OBJ_nid2sn_func; + //ASN1 + ASN1_INTEGER_set := ASN1_INTEGER_set_func; + ASN1_INTEGER_get := ASN1_INTEGER_get_func; + ASN1_STRING_type_new := ASN1_STRING_type_new_func; + ASN1_STRING_free := ASN1_STRING_free_proc; + ASN1_dup := ASN1_dup_func; + CRYPTO_set_mem_functions := CRYPTO_set_mem_functions_func; + CRYPTO_malloc := CRYPTO_malloc_func; + CRYPTO_free := CRYPTO_free_proc; + CRYPTO_mem_leaks := CRYPTO_mem_leaks_proc; + CRYPTO_mem_ctrl := CRYPTO_mem_ctrl_func; + CRYPTO_set_mem_debug_functions := CRYPTO_set_mem_debug_functions_proc; + PKCS12_create := PKCS12_create_func; + i2d_PKCS12_bio := i2d_PKCS12_bio_func; + PKCS12_free := PKCS12_free_proc; +// OpenSSL_add_all_algorithms := OpenSSL_add_all_algorithms_proc; + OpenSSL_add_all_ciphers := OpenSSL_add_all_ciphers_proc; + OpenSSL_add_all_digests := OpenSSL_add_all_digests_proc; + EVP_cleanup := EVP_cleanup_proc; + + sk_num := sk_num_func; + sk_new := sk_new_func; + sk_new_null := sk_new_null_func; + sk_free := sk_free_proc; + sk_push := sk_push_func; + sk_dup := sk_dup_func; + sk_find := sk_find_func; + sk_value := sk_value_func; + {$IFDEF OPENSSL_FIPS} +// _FIPS_mode_set := FIPS_mode_set_func; +// _FIPS_mode := FIPS_mode_func; + {$ENDIF} +end; + +initialization + LoadSymbols; + +{$ENDIF} + +end. diff --git a/IdSSLOpenSSLLoader.pas b/IdSSLOpenSSLLoader.pas new file mode 100644 index 0000000..05aec41 --- /dev/null +++ b/IdSSLOpenSSLLoader.pas @@ -0,0 +1,327 @@ +{******************************************************************************} +{ } +{ Indy (Internet Direct) - Internet Protocols Simplified } +{ } +{ https://www.indyproject.org/ } +{ https://gitter.im/IndySockets/Indy } +{ } +{******************************************************************************} +{ } +{ This file is part of the Indy (Internet Direct) project, and is offered } +{ under the dual-licensing agreement described on the Indy website. } +{ (https://www.indyproject.org/license/) } +{ } +{ Copyright: } +{ (c) 1993-2024, the Indy Pit Crew. All rights reserved. } +{ } +{******************************************************************************} +{ } +{ Contributers: } +{ Here could be your name } +{ } +{******************************************************************************} + +unit IdSSLOpenSSLLoader; + +{$IFDEF MSWINDOWS} +{$DEFINE WINDOWS} +{$ENDIF} + +{$i IdCompilerDefines.inc} +{$i IdSSLOpenSSLDefines.inc} + +interface + +uses + Classes, IdGlobal, IdCTypes; + +type + { IOpenSSLLoader } + + IOpenSSLLoader = interface + ['{BBB0F670-CC26-42BC-A9E0-33647361941A}'] + + function GetOpenSSLPath: string; + function GetSSLLibVersions: string; + procedure SetOpenSSLPath(const Value: string); + function GetFailedToLoad: TStringList; + + function Load: Boolean; + procedure SetSSLLibVersions(const AValue: string); + procedure Unload; + + property SSLLibVersions: string read GetSSLLibVersions write SetSSLLibVersions; + property OpenSSLPath: string read GetOpenSSLPath write SetOpenSSLPath; + property FailedToLoad: TStringList read GetFailedToLoad; + end; + + TOpenSSLLoadProc = procedure(const ADllHandle: TIdLibHandle; LibVersion: TIdC_UINT; const AFailed: TStringList); + TOpenSSLUnloadProc = procedure; + +function GetOpenSSLLoader: IOpenSSLLoader; + + +procedure Register_SSLLoader(LoadProc: TOpenSSLLoadProc; const module_name: string); +procedure Register_SSLUnloader(UnloadProc: TOpenSSLUnloadProc); + +implementation + +uses + IdSSLOpenSSLExceptionHandlers, + IdResourceStringsOpenSSL + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} + {$IFDEF WINDOWS},Windows{$ENDIF} + {$IFDEF FPC},dynlibs{$ENDIF} + + ,IdSSLOpenSSLConsts, + IdThreadSafe, + SysUtils +{$ENDIF} + ; + +{$if not declared(NilHandle)} +const + NilHandle = 0; +{$ifend} + +var + GOpenSSLLoader: IOpenSSLLoader = nil; + GLibCryptoLoadList: TList = nil; + GLibSSLLoadList: TList = nil; + GUnLoadList: TList = nil; + +function GetOpenSSLLoader: IOpenSSLLoader; +begin + Result := GOpenSSLLoader; +end; + +procedure Register_SSLLoader(LoadProc: TOpenSSLLoadProc; const module_name: string); +begin + if GLibCryptoLoadList = nil then + GLibCryptoLoadList := TList.Create; + if GLibSSLLoadList = nil then + GLibSSLLoadList := TList.Create; + + if module_name = 'LibCrypto' then + GLibCryptoLoadList.Add(@LoadProc) + else + if module_name = 'LibSSL' then + GLibSSLLoadList.Add(@LoadProc) + else + raise EIdOpenSSLError.CreateFmt(ROSUnrecognisedLibName,[module_name]); +end; + +procedure Register_SSLUnloader(UnloadProc: TOpenSSLUnloadProc); +begin + if GUnLoadList = nil then + GUnLoadList := TList.Create; + GUnLoadList.Add(@UnloadProc); +end; + +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} +type + + { TOpenSSLLoader } + + TOpenSSLLoader = class(TInterfacedObject, IOpenSSLLoader) + private + FLibCrypto: TIdLibHandle; + FLibSSL: TIdLibHandle; + FOpenSSLPath: string; + FFailed: TStringList; + FSSLLibVersions: string; + FLibraryLoaded: TIdThreadSafeBoolean; + FFailedToLoad: boolean; + function FindLibrary(const LibName, LibVersions: string): TIdLibHandle; + function GetSSLLibVersions: string; + procedure SetSSLLibVersions(const AValue: string); + function GetOpenSSLPath: string; + procedure SetOpenSSLPath(const Value: string); + function GetFailedToLoad: TStringList; + public + constructor Create; + destructor Destroy; override; + + function Load: Boolean; + procedure Unload; + + property OpenSSLPath: string read GetOpenSSLPath write SetOpenSSLPath; + property FailedToLoad: TStringList read GetFailedToLoad; + end; + +{ TOpenSSLLoader } + +constructor TOpenSSLLoader.Create; +begin + inherited; + FFailed := TStringList.Create(); + FLibraryLoaded := TIdThreadSafeBoolean.Create; + FSSLLibVersions := DefaultLibVersions; + OpenSSLPath := GetEnvironmentVariable(OpenSSLLibraryPath) +end; + +destructor TOpenSSLLoader.Destroy; +begin + if FLibraryLoaded <> nil then + FLibraryLoaded.Free; + if FFailed <> nil then + FFailed.Free; + inherited; +end; + +function TOpenSSLLoader.FindLibrary(const LibName, LibVersions: string): TIdLibHandle; + + function DoLoadLibrary(const FullLibName: string): TIdLibHandle; + begin + Result := SafeLoadLibrary(FullLibName, {$IFDEF WINDOWS}SEM_FAILCRITICALERRORS {$ELSE} 0 {$ENDIF}); + end; + +var LibVersionsList: TStringList; + i: integer; +begin + Result := DoLoadLibrary(OpenSSLPath + LibName); + if (Result = NilHandle) and (LibVersions <> '') then + begin + LibVersionsList := TStringList.Create; + try + LibVersionsList.Delimiter := DirListDelimiter; + LibVersionsList.StrictDelimiter := true; + LibVersionsList.DelimitedText := LibVersions; {Split list on delimiter} + for i := 0 to LibVersionsList.Count - 1 do + begin + Result := DoLoadLibrary(OpenSSLPath + LibName + LibVersionsList[i]); + if Result <> NilHandle then + break; + end; + finally + LibVersionsList.Free; + end; + end; +end; + + +function TOpenSSLLoader.Load: Boolean; +type + TOpenSSL_version_num = function: TIdC_ULONG; cdecl; + +var i: integer; + OpenSSL_version_num: TOpenSSL_version_num; + SSLVersionNo: TIdC_ULONG; + +begin //FI:C101 + Result := not FFailedToLoad; + if not Result then + Exit; + FLibraryLoaded.Lock(); + try + if not FLibraryLoaded.Value then + begin + FLibCrypto := FindLibrary(CLibCryptoBase + LibSuffix,FSSLLibVersions); + FLibSSL := FindLibrary(CLibSSLBase + LibSuffix,FSSLLibVersions); + Result := not (FLibCrypto = IdNilHandle) and not (FLibSSL = IdNilHandle); + {$IFDEF WINDOWS} + if not Result then + begin + {try the legacy dll names} + FLibCrypto := FindLibrary(LegacyLibCrypto,''); + FLibSSL := FindLibrary(LegacyLibssl,''); + Result := not (FLibCrypto = IdNilHandle) and not (FLibSSL = IdNilHandle); + end; + {$ENDIF} + if not Result then + Exit; + + {Load Version number} + OpenSSL_version_num := LoadLibFunction(FLibCrypto, 'OpenSSL_version_num'); + if not assigned(OpenSSL_version_num) then + OpenSSL_version_num := LoadLibFunction(FLibCrypto, 'SSLeay'); + if not assigned(OpenSSL_version_num) then + raise EIdOpenSSLError.Create(ROSSLCantGetSSLVersionNo); + + SSLVersionNo := OpenSSL_version_num(); + if SSLVersionNo < min_supported_ssl_version then + raise EIdOpenSSLError.CreateFmt(RSOSSUnsupportedVersion,[SSLVersionNo]); + + SSLVersionNo := SSLVersionNo shr 12; + + + for i := 0 to GLibCryptoLoadList.Count - 1 do + TOpenSSLLoadProc(GLibCryptoLoadList[i])(FLibCrypto,SSLVersionNo,FFailed); + + for i := 0 to GLibSSLLoadList.Count - 1 do + TOpenSSLLoadProc(GLibSSLLoadList[i])(FLibSSL,SSLVersionNo,FFailed); + + end; + FLibraryLoaded.Value := true; + finally + FLibraryLoaded.Unlock(); + end; +end; + +function TOpenSSLLoader.GetSSLLibVersions: string; +begin + Result := FSSLLibVersions; +end; + +procedure TOpenSSLLoader.SetSSLLibVersions(const AValue: string); +begin + FSSLLibVersions := AValue; +end; + +function TOpenSSLLoader.GetOpenSSLPath: string; +begin + Result := FOpenSSLPath +end; + +procedure TOpenSSLLoader.SetOpenSSLPath(const Value: string); +begin + if Value = '' then + FOpenSSLPath := '' + else + FOpenSSLPath := IncludeTrailingPathDelimiter(Value); +end; + +function TOpenSSLLoader.GetFailedToLoad: TStringList; +begin + Result := FFailed; +end; + +procedure TOpenSSLLoader.Unload; +var i: integer; +begin //FI:C101 + FLibraryLoaded.Lock(); + try + if FLibraryLoaded.Value then + begin + for i := 0 to GUnLoadList.Count - 1 do + TOpenSSLUnloadProc(GUnLoadList[i]); + + FFailed.Clear(); + + if FLibSSL <> NilHandle then + FreeLibrary(FLibSSL); + if FLibCrypto <> NilHandle then + FreeLibrary(FLibCrypto); + FLibSSL := NilHandle; + FLibCrypto := NilHandle; + end; + FFailedToLoad := false; + FLibraryLoaded.Value := false; + finally + FLibraryLoaded.Unlock(); + end; +end; + +{$ENDIF} + +initialization +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} + GOpenSSLLoader := TOpenSSLLoader.Create(); +{$ENDIF} + +finalization + if GLibCryptoLoadList <> nil then GLibCryptoLoadList.Free; + if GLibSSLLoadList <> nil then GLibSSLLoadList.Free; + if GUnLoadList <> nil then GUnLoadList.Free; +end. diff --git a/IdSSLOpenSSL_Files.pas b/IdSSLOpenSSL_Files.pas new file mode 100644 index 0000000..40cdb05 --- /dev/null +++ b/IdSSLOpenSSL_Files.pas @@ -0,0 +1,1129 @@ +unit IdSSLOpenSSL_Files; + +interface +{$I IdCompilerDefines.inc} +{$i IdSSLOpenSSLDefines.inc} +uses + IdCTypes, + IdOpenSSLHeaders_ossl_typ, + IdOpenSSLHeaders_x509; + +const + MAX_SSL_PASSWORD_LENGTH = 128; + +function IndySSL_CTX_use_certificate_file_PKCS12(ctx: PSSL_CTX; const AFileName: String): TIdC_INT; +function IndySSL_CTX_use_PrivateKey_file_PKCS12(ctx: PSSL_CTX; const AFileName: String): TIdC_INT; +function IndySSL_CTX_use_PrivateKey_file(ctx: PSSL_CTX; const AFileName: String; + AType: Integer): TIdC_INT; +function IndySSL_CTX_load_verify_locations(ctx: PSSL_CTX; + const ACAFile, ACAPath: String): TIdC_INT; +function IndySSL_CTX_use_certificate_chain_file(ctx :PSSL_CTX; + const AFileName: String) : TIdC_INT; +function IndySSL_CTX_use_certificate_file(ctx: PSSL_CTX; + const AFileName: String; AType: Integer): TIdC_INT; +function IndySSL_load_client_CA_file(const AFileName: String) : PSTACK_OF_X509_NAME; +function IndySSL_CTX_use_DHparams_file(ctx: PSSL_CTX; + const AFileName: String; AType: Integer): TIdC_INT; +function IndyX509_STORE_load_locations(ctx: PX509_STORE; + const AFileName, APathName: String): TIdC_INT; + +implementation +uses + IdGlobal, + IdOpenSSLHeaders_asn1, + IdOpenSSLHeaders_bio, + IdOpenSSLHeaders_dh, + IdOpenSSLHeaders_err, + IdOpenSSLHeaders_evp, + IdOpenSSLHeaders_pem, + IdOpenSSLHeaders_pkcs12, + IdOpenSSLHeaders_ssl, + IdOpenSSLHeaders_sslerr, + IdOpenSSLHeaders_stack, + IdOpenSSLHeaders_x509_vfy, + System.Classes, + System.SysUtils; + +function xname_cmp(const a, b: PPX509_NAME): TIdC_INT; cdecl; +begin + Result := X509_NAME_cmp(a^, b^); +end; + +function d2i_DHparams_bio(bp: PBIO; x: PPointer): PDH; inline; +begin + Result := PDH(ASN1_d2i_bio(@DH_new, @d2i_DHparams, bp, x)); +end; + +// SSL_CTX_use_PrivateKey_file() and SSL_CTX_use_certificate_file() do not +// natively support PKCS12 certificates/keys, only PEM/ASN1, so load them +// manually... + +function IndySSL_CTX_use_PrivateKey_file_PKCS12(ctx: PSSL_CTX; const AFileName: String): TIdC_INT; +var + LM: TMemoryStream; + B: PBIO; + LKey: PEVP_PKEY; + LCert: PX509; + P12: PPKCS12; + CertChain: PSTACK_OF_X509; + LPassword: array of TIdAnsiChar; + LPasswordPtr: PIdAnsiChar; + default_passwd_cb: pem_password_cb; +begin + Result := 0; + + LM := nil; + try + LM := TMemoryStream.Create; + LM.LoadFromFile(AFileName); + except + // Surpress exception here since it's going to be called by the OpenSSL .DLL + // Follow the OpenSSL .DLL Error conventions. + SSLerr(SSL_F_SSL_CTX_USE_PRIVATEKEY_FILE, ERR_R_SYS_LIB); + LM.Free; + Exit; + end; + + try + B := BIO_new_mem_buf(LM.Memory, LM.Size); + if not Assigned(B) then begin + SSLerr(SSL_F_SSL_CTX_USE_PRIVATEKEY_FILE, ERR_R_BUF_LIB); + Exit; + end; + try + SetLength(LPassword, MAX_SSL_PASSWORD_LENGTH+1); + LPassword[MAX_SSL_PASSWORD_LENGTH] := TIdAnsiChar(0); + LPasswordPtr := PIdAnsiChar(LPassword); + default_passwd_cb := SSL_CTX_get_default_passwd_cb(ctx); + if Assigned(default_passwd_cb) then begin + default_passwd_cb(LPasswordPtr, MAX_SSL_PASSWORD_LENGTH, 0, SSL_CTX_get_default_passwd_cb_userdata(ctx)); + // TODO: check return value for failure + end else begin + // TODO: call PEM_def_callback(), like PEM_read_bio_X509() does + // when default_passwd_callback is nil + end; + P12 := d2i_PKCS12_bio(B, nil); + if not Assigned(P12) then begin + SSLerr(SSL_F_SSL_CTX_USE_PRIVATEKEY_FILE, ERR_R_PKCS12_LIB); + Exit; + end; + try + CertChain := nil; + if PKCS12_parse(P12, LPasswordPtr, LKey, LCert, @CertChain) <> 1 then begin + SSLerr(SSL_F_SSL_CTX_USE_CERTIFICATE_FILE, ERR_R_PKCS12_LIB); + Exit; + end; + try + Result := SSL_CTX_use_PrivateKey(ctx, LKey); + finally + sk_pop_free(CertChain, @X509_free); + X509_free(LCert); + EVP_PKEY_free(LKey); + end; + finally + PKCS12_free(P12); + end; + finally + BIO_free(B); + end; + finally + FreeAndNil(LM); + end; +end; + +function IndySSL_CTX_use_certificate_file_PKCS12(ctx: PSSL_CTX; const AFileName: String): TIdC_INT; +var + LM: TMemoryStream; + B: PBIO; + LCert: PX509; + P12: PPKCS12; + PKey: PEVP_PKEY; + CertChain: PSTACK_OF_X509; + LPassword: array of TIdAnsiChar; + LPasswordPtr: PIdAnsiChar; + default_passwd_callback: pem_password_cb; +begin + Result := 0; + + LM := nil; + try + LM := TMemoryStream.Create; + LM.LoadFromFile(AFileName); + except + // Surpress exception here since it's going to be called by the OpenSSL .DLL + // Follow the OpenSSL .DLL Error conventions. + SSLerr(SSL_F_SSL_CTX_USE_CERTIFICATE_FILE, ERR_R_SYS_LIB); + LM.Free; + Exit; + end; + + try + B := BIO_new_mem_buf(LM.Memory, LM.Size); + if not Assigned(B) then begin + SSLerr(SSL_F_SSL_CTX_USE_CERTIFICATE_FILE, ERR_R_BUF_LIB); + Exit; + end; + try + SetLength(LPassword, MAX_SSL_PASSWORD_LENGTH+1); + LPassword[MAX_SSL_PASSWORD_LENGTH] := TIdAnsiChar(0); + LPasswordPtr := PIdAnsiChar(LPassword); + default_passwd_callback := SSL_CTX_get_default_passwd_cb(ctx); + if Assigned(default_passwd_callback) then begin + default_passwd_callback(LPasswordPtr, MAX_SSL_PASSWORD_LENGTH, 0, SSL_CTX_get_default_passwd_cb_userdata(ctx)); + // TODO: check return value for failure + end else begin + // TODO: call PEM_def_callback(), like PEM_read_bio_X509() does + // when default_passwd_callback is nil + end; + P12 := d2i_PKCS12_bio(B, nil); + if not Assigned(P12) then + begin + SSLerr(SSL_F_SSL_CTX_USE_CERTIFICATE_FILE, ERR_R_PKCS12_LIB); + Exit; + end; + try + CertChain := nil; + if PKCS12_parse(P12, LPasswordPtr, PKey, LCert, @CertChain) <> 1 then begin + SSLerr(SSL_F_SSL_CTX_USE_CERTIFICATE_FILE, ERR_R_PKCS12_LIB); + Exit; + end; + try + Result := SSL_CTX_use_certificate(ctx, LCert); + finally + sk_pop_free(CertChain, @X509_free); + X509_free(LCert); + EVP_PKEY_free(PKey); + end; + finally + PKCS12_free(P12); + end; + finally + BIO_free(B); + end; + finally + FreeAndNil(LM); + end; +end; + +{ + IMPORTANT!!! + + OpenSSL can not handle Unicode file names at all. On Posix systems, UTF8 File + names can be used with OpenSSL. The Windows operating system does not accept + UTF8 file names at all so we have our own routines that will handle Unicode + filenames. Most of this section of code is based on code in the OpenSSL .DLL + which is copyrighted by the OpenSSL developers. Some of it is translated into + Pascal and made some modifications so that it will handle Unicode filenames. +} + +{$IFDEF STRING_IS_UNICODE} {UCS-2 implied} + + {$IFDEF WINDOWS} + +function Indy_unicode_X509_load_cert_crl_file(ctx: PX509_LOOKUP; const AFileName: String; + const _type: TIdC_INT): TIdC_INT; forward; +function Indy_unicode_X509_load_cert_file(ctx: PX509_LOOKUP; const AFileName: String; + _type: TIdC_INT): TIdC_INT; forward; + +{ + This is for some file lookup definitions for a LOOKUP method that + uses Unicode filenames instead of ASCII or UTF8. It is not meant + to be portable at all. +} + +function by_Indy_unicode_file_ctrl(ctx: PX509_LOOKUP; cmd: TIdC_INT; + const argc: PAnsiChar; argl: TIdC_LONG; out ret: PAnsiChar): TIdC_INT; cdecl; +var + LOk: TIdC_INT; + LFileName: String; +begin + LOk := 0; + case cmd of + X509_L_FILE_LOAD: + begin + // Note that typecasting an AnsiChar as a WideChar below is normally a crazy + // thing to do. The thing is that the OpenSSL API is based on PAnsiChar, and + // we are writing this function just for Unicode filenames. argc is actually + // a PWideChar that has been coerced into a PAnsiChar so it can pass through + // OpenSSL APIs... + case argl of + X509_FILETYPE_DEFAULT: + begin + LFileName := GetEnvironmentVariable(String(X509_get_default_cert_file_env)); + if LFileName = '' then begin + LFileName := String(X509_get_default_cert_file); + end; + LOk := Ord(Indy_unicode_X509_load_cert_crl_file(ctx, LFileName, X509_FILETYPE_PEM) <> 0); + if LOk = 0 then begin + X509err(X509_F_BY_FILE_CTRL, X509_R_LOADING_DEFAULTS); + end; + end; + X509_FILETYPE_PEM: + begin + LFileName := PWideChar(Pointer(argc)); + LOk := Ord(Indy_unicode_X509_load_cert_crl_file(ctx, LFileName, X509_FILETYPE_PEM) <> 0); + end; + else + LFileName := PWideChar(Pointer(argc)); + LOk := Ord(Indy_unicode_X509_load_cert_file(ctx, LFileName, TIdC_INT(argl)) <> 0); + end; + end; + end; + Result := LOk; +end; + +function Indy_unicode_X509_load_cert_file(ctx: PX509_LOOKUP; const AFileName: String; + _type: TIdC_INT): TIdC_INT; +var + LM: TMemoryStream; + Lin: PBIO; + LX: PX509; + i, count: Integer; +begin + Result := 0; + count := 0; + + if AFileName = '' then begin + Result := 1; + Exit; + end; + + LM := nil; + try + LM := TMemoryStream.Create; + LM.LoadFromFile(AFileName); + except + // Surpress exception here since it's going to be called by the OpenSSL .DLL + // Follow the OpenSSL .DLL Error conventions. + X509err(X509_F_X509_LOAD_CERT_FILE, ERR_R_SYS_LIB); + LM.Free; + Exit; + end; + + try + Lin := BIO_new_mem_buf(LM.Memory, LM.Size); + if not Assigned(Lin) then begin + X509err(X509_F_X509_LOAD_CERT_FILE, ERR_R_SYS_LIB); + Exit; + end; + try + case _type of + X509_FILETYPE_PEM: + begin + repeat + LX := PEM_read_bio_X509_AUX(Lin, nil, nil, nil); + if not Assigned(LX) then begin + if ((ERR_GET_REASON(ERR_peek_last_error()) + = PEM_R_NO_START_LINE) and (count > 0)) then begin + ERR_clear_error(); + Break; + end else begin + X509err(X509_F_X509_LOAD_CERT_FILE, ERR_R_PEM_LIB); + Exit; + end; + end; + i := X509_STORE_add_cert(X509_LOOKUP_get_store(ctx), LX); + if i = 0 then begin + Exit; + end; + Inc(count); + X509_Free(LX); + until False; + Result := count; + end; + X509_FILETYPE_ASN1: + begin + LX := d2i_X509_bio(Lin, nil); + if not Assigned(LX) then begin + X509err(X509_F_X509_LOAD_CERT_FILE, ERR_R_ASN1_LIB); + Exit; + end; + i := X509_STORE_add_cert(X509_LOOKUP_get_store(ctx), LX); + if i = 0 then begin + Exit; + end; + Result := i; + end; + else + X509err(X509_F_X509_LOAD_CERT_FILE, X509_R_BAD_X509_FILETYPE); + Exit; + end; + finally + BIO_free(Lin); + end; + finally + FreeAndNil(LM); + end; +end; + +function Indy_unicode_X509_load_cert_crl_file(ctx: PX509_LOOKUP; const AFileName: String; + const _type: TIdC_INT): TIdC_INT; +var + LM: TMemoryStream; + Linf: PSTACK_OF_X509_INFO; + Litmp: PX509_INFO; + Lin: PBIO; + i, count: Integer; +begin + Result := 0; + count := 0; + LM := nil; + + if _type <> X509_FILETYPE_PEM then begin + Result := Indy_unicode_X509_load_cert_file(ctx, AFileName, _type); + Exit; + end; + + try + LM := TMemoryStream.Create; + LM.LoadFromFile(AFileName); + except + // Surpress exception here since it's going to be called by the OpenSSL .DLL + // Follow the OpenSSL .DLL Error conventions. + X509err(X509_F_X509_LOAD_CERT_CRL_FILE, ERR_R_SYS_LIB); + LM.Free; + Exit; + end; + + try + Lin := BIO_new_mem_buf(LM.Memory, LM.Size); + if not Assigned(Lin) then begin + X509err(X509_F_X509_LOAD_CERT_CRL_FILE, ERR_R_SYS_LIB); + Exit; + end; + try + Linf := PEM_X509_INFO_read_bio(Lin, nil, nil, nil); + finally + BIO_free(Lin); + end; + finally + FreeAndNil(LM); + end; + if not Assigned(Linf) then begin + X509err(X509_F_X509_LOAD_CERT_CRL_FILE, ERR_R_PEM_LIB); + Exit; + end; + try + for i := 0 to sk_X509_INFO_num(Linf) - 1 do begin + Litmp := PX509_INFO(sk_X509_INFO_value(Linf, i)); + if Assigned(Litmp^.x509) then begin + X509_STORE_add_cert(X509_LOOKUP_get_store(ctx), Litmp^.x509); + Inc(count); + end; + if Assigned(Litmp^.crl) then begin + X509_STORE_add_crl(X509_LOOKUP_get_store(ctx), Litmp^.crl); + Inc(count); + end; + end; + finally + sk_X509_INFO_pop_free(Linf, @X509_INFO_free); + end; + Result := count; +end; + +procedure IndySSL_load_client_CA_file_err(var VRes: PSTACK_OF_X509_NAME); +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + if Assigned(VRes) then begin + sk_X509_NAME_pop_free(VRes, @X509_NAME_free); + VRes := nil; + end; +end; + +function IndySSL_load_client_CA_file(const AFileName: String): PSTACK_OF_X509_NAME; +var + LM: TMemoryStream; + LB: PBIO; + Lsk: PSTACK_OF_X509_NAME; + LX: PX509; + LXN, LXNDup: PX509_NAME; + Failed: Boolean; +begin + Result := nil; + Failed := False; + LX := nil; + Lsk := sk_X509_NAME_new(@xname_cmp); + if Assigned(Lsk) then begin + try + LM := nil; + try + LM := TMemoryStream.Create; + LM.LoadFromFile(AFileName); + except + // Surpress exception here since it's going to be called by the OpenSSL .DLL + // Follow the OpenSSL .DLL Error conventions. + SSLerr(SSL_F_SSL_LOAD_CLIENT_CA_FILE, ERR_R_SYS_LIB); + LM.Free; + Exit; + end; + try + LB := BIO_new_mem_buf(LM.Memory, LM.Size); + if Assigned(LB) then begin + try + try + repeat + LX := PEM_read_bio_X509(LB, nil, nil, nil); + if LX = nil then begin + Break; + end; + if not Assigned(Result) then begin + Result := sk_X509_NAME_new_null; + if not Assigned(Result) then begin + SSLerr(SSL_F_SSL_LOAD_CLIENT_CA_FILE, ERR_R_MALLOC_FAILURE); + Failed := True; + Exit; + end; + end; + LXN := X509_get_subject_name(LX); + if not Assigned(LXN) then begin + // error + IndySSL_load_client_CA_file_err(Result); + Failed := True; + Exit; + end; + // * check for duplicates */ + LXNDup := X509_NAME_dup(LXN); + if not Assigned(LXNDup) then begin + // error + IndySSL_load_client_CA_file_err(Result); + Failed := True; + Exit; + end; + if (sk_X509_NAME_find(Lsk, LXNDup) >= 0) then begin + X509_NAME_free(LXNDup); + end else begin + sk_X509_NAME_push(Lsk, LXNDup); + sk_X509_NAME_push(Result, LXNDup); + end; + X509_free(LX); + LX := nil; + until False; + finally + if Assigned(LX) then begin + X509_free(LX); + end; + if Failed and Assigned(Result) then begin + sk_X509_NAME_pop_free(Result, @X509_NAME_free); + Result := nil; + end; + end; + finally + BIO_free(LB); + end; + end + else begin + SSLerr(SSL_F_SSL_LOAD_CLIENT_CA_FILE, ERR_R_MALLOC_FAILURE); + end; + finally + FreeAndNil(LM); + end; + finally + sk_X509_NAME_free(Lsk); + end; + end + else begin + SSLerr(SSL_F_SSL_LOAD_CLIENT_CA_FILE, ERR_R_MALLOC_FAILURE); + end; + if Assigned(Result) then begin + ERR_clear_error; + end; +end; + +function IndySSL_CTX_use_PrivateKey_file(ctx: PSSL_CTX; const AFileName: String; + AType: Integer): TIdC_INT; +var + LM: TMemoryStream; + B: PBIO; + LKey: PEVP_PKEY; + j: TIdC_INT; +begin + Result := 0; + + LM := nil; + try + LM := TMemoryStream.Create; + LM.LoadFromFile(AFileName); + except + // Surpress exception here since it's going to be called by the OpenSSL .DLL + // Follow the OpenSSL .DLL Error conventions. + SSLerr(SSL_F_SSL_CTX_USE_PRIVATEKEY_FILE, ERR_R_SYS_LIB); + LM.Free; + Exit; + end; + + try + B := BIO_new_mem_buf(LM.Memory, LM.Size); + if not Assigned(B) then begin + SSLerr(SSL_F_SSL_CTX_USE_PRIVATEKEY_FILE, ERR_R_BUF_LIB); + Exit; + end; + try + case AType of + SSL_FILETYPE_PEM: + begin + j := ERR_R_PEM_LIB; + LKey := PEM_read_bio_PrivateKey(B, nil, + SSL_CTX_get_default_passwd_cb(ctx), + SSL_CTX_get_default_passwd_cb_userdata(ctx)); + end; + SSL_FILETYPE_ASN1: + begin + j := ERR_R_ASN1_LIB; + LKey := d2i_PrivateKey_bio(B, nil); + end; + else + SSLerr(SSL_F_SSL_CTX_USE_PRIVATEKEY_FILE, SSL_R_BAD_SSL_FILETYPE); + Exit; + end; + if not Assigned(LKey) then begin + SSLerr(SSL_F_SSL_CTX_USE_PRIVATEKEY_FILE, j); + Exit; + end; + Result := SSL_CTX_use_PrivateKey(ctx, LKey); + EVP_PKEY_free(LKey); + finally + BIO_free(B); + end; + finally + FreeAndNil(LM); + end; +end; + +function IndySSL_CTX_use_certificate_file(ctx: PSSL_CTX; + const AFileName: String; AType: Integer): TIdC_INT; +var + LM: TMemoryStream; + B: PBIO; + LX: PX509; + j: TIdC_INT; +begin + Result := 0; + + LM := nil; + try + LM := TMemoryStream.Create; + LM.LoadFromFile(AFileName); + except + // Surpress exception here since it's going to be called by the OpenSSL .DLL + // Follow the OpenSSL .DLL Error conventions. + SSLerr(SSL_F_SSL_CTX_USE_CERTIFICATE_FILE, ERR_R_SYS_LIB); + LM.Free; + Exit; + end; + + try + B := BIO_new_mem_buf(LM.Memory, LM.Size); + if not Assigned(B) then begin + SSLerr(SSL_F_SSL_CTX_USE_CERTIFICATE_FILE, ERR_R_BUF_LIB); + Exit; + end; + try + case AType of + SSL_FILETYPE_ASN1: + begin + j := ERR_R_ASN1_LIB; + LX := d2i_X509_bio(B, nil); + end; + SSL_FILETYPE_PEM: + begin + j := ERR_R_PEM_LIB; + LX := PEM_read_bio_X509(B, nil, SSL_CTX_get_default_passwd_cb(ctx), + SSL_CTX_get_default_passwd_cb_userdata(ctx)); + end + else begin + SSLerr(SSL_F_SSL_CTX_USE_CERTIFICATE_FILE, SSL_R_BAD_SSL_FILETYPE); + Exit; + end; + end; + if not Assigned(LX) then begin + SSLerr(SSL_F_SSL_CTX_USE_CERTIFICATE_FILE, j); + Exit; + end; + Result := SSL_CTX_use_certificate(ctx, LX); + X509_free(LX); + finally + BIO_free(B); + end; + finally + FreeAndNil(LM); + end; +end; + +function IndySSL_CTX_use_certificate_chain_file(ctx :PSSL_CTX; + const AFileName: String) : TIdC_INT; +var + LM: TMemoryStream; + B: PBIO; + LX: PX509; + ca :PX509; + r: TIdC_INT; + LErr :TIdC_ULONG; + +begin + Result := 0; + + ERR_clear_error(); //* clear error stack for + //* SSL_CTX_use_certificate() */ + + LM := nil; + try + LM := TMemoryStream.Create; + LM.LoadFromFile(AFileName); + except + // Surpress exception here since it's going to be called by the OpenSSL .DLL + // Follow the OpenSSL .DLL Error conventions. + SSLerr(SSL_F_SSL_CTX_USE_CERTIFICATE_CHAIN_FILE, ERR_R_SYS_LIB); + LM.Free; + Exit; + end; + try + B := BIO_new_mem_buf(LM.Memory, LM.Size); + if not Assigned(B) then begin + SSLerr(SSL_F_SSL_CTX_USE_CERTIFICATE_FILE, ERR_R_BUF_LIB); + Exit; + end; + try + LX := PEM_read_bio_X509_AUX(B, nil, SSL_CTX_get_default_passwd_cb(ctx), + SSL_CTX_get_default_passwd_cb_userdata(ctx)); + if (Lx = nil) then begin + SSLerr(SSL_F_SSL_CTX_USE_CERTIFICATE_CHAIN_FILE, ERR_R_PEM_LIB); + end else begin + Result := SSL_CTX_use_certificate(ctx, Lx); + if (ERR_peek_error() <> 0) then begin + Result := 0; //* Key/certificate mismatch doesn't imply + //* ret==0 ... */ + end; + if Result <> 0 then begin + SSL_CTX_clear_chain_certs(ctx); + repeat + ca := PEM_read_bio_X509(B, nil, + SSL_CTX_get_default_passwd_cb(ctx), + SSL_CTX_get_default_passwd_cb_userdata(ctx)); + if ca = nil then begin + break; + end; + r := SSL_CTX_add0_chain_cert(ctx, ca); + if (r = 0) then begin + X509_free(ca); + Result := 0; + break; +// goto end; + end; + //* + //* Note that we must not free r if it was successfully added to + //* the chain (while we must free the main certificate, since its + //* reference count is increased by SSL_CTX_use_certificate). + // */ + until False; + if ca <> nil then begin + //* When the while loop ends, it's usually just EOF. */ + LErr := ERR_peek_last_error(); + if (ERR_GET_LIB(Lerr) = ERR_LIB_PEM) + and (ERR_GET_REASON(Lerr) = PEM_R_NO_START_LINE) then begin + ERR_clear_error(); + end else begin + Result := 0; //* some real error */ + end; + end; + end; + //err: + if LX <> nil then begin + X509_free(LX); + end; + end; + finally + BIO_free(B); + end; + finally + FreeAndNil(LM); + end; +end; + +function IndyX509_STORE_load_locations(ctx: PX509_STORE; + const AFileName, APathName: String): TIdC_INT; +var + lookup: PX509_LOOKUP; + method: PX509_LOOKUP_METHOD; {reference counted} +begin + Result := 0; + if AFileName <> '' then begin + method := X509_LOOKUP_meth_new('Load file into cache'); + lookup := X509_STORE_add_lookup(ctx, method); + if not Assigned(lookup) then begin + Exit; + end; + X509_LOOKUP_meth_set_ctrl(method,@by_Indy_unicode_file_ctrl); + // RLebeau: the PAnsiChar(Pointer(...)) cast below looks weird, but it is + // intentional. X509_LOOKUP_load_file() takes a PAnsiChar as input, but + // we are using Unicode strings here. So casting the UnicodeString to a + // raw Pointer and then passing that to X509_LOOKUP_load_file() as PAnsiChar. + // Indy_Unicode_X509_LOOKUP_file will cast it back to PWideChar for processing... + if (X509_LOOKUP_load_file(lookup, PAnsiChar(pointer(AFileName)), X509_FILETYPE_PEM) <> 1) then begin + Exit; + end; + end; + if APathName <> '' then begin + { TODO: Figure out how to do the hash dir lookup with a Unicode path. } + if (X509_STORE_load_locations(ctx, nil, PAnsiChar(AnsiString(APathName))) <> 1) then begin + Exit; + end; + end; + if (AFileName = '') and (APathName = '') then begin + Exit; + end; + Result := 1; +end; + +function IndySSL_CTX_load_verify_locations(ctx: PSSL_CTX; + const ACAFile, ACAPath: String): TIdC_INT; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := IndyX509_STORE_load_locations(SSL_CTX_get_cert_store(ctx), ACAFile, ACAPath); +end; + +function IndySSL_CTX_use_DHparams_file(ctx: PSSL_CTX; + const AFileName: String; AType: Integer): TIdC_INT; +var + LM: TMemoryStream; + B: PBIO; + LDH: PDH; + j: Integer; +begin + Result := 0; + + LM := nil; + try + LM := TMemoryStream.Create; + LM.LoadFromFile(AFileName); + except + // Surpress exception here since it's going to be called by the OpenSSL .DLL + // Follow the OpenSSL .DLL Error conventions. + SSLerr(SSL_F_SSL3_CTRL, ERR_R_SYS_LIB); + LM.Free; + Exit; + end; + + try + B := BIO_new_mem_buf(LM.Memory, LM.Size); + if not Assigned(B) then begin + SSLerr(SSL_F_SSL3_CTRL, ERR_R_BUF_LIB); + Exit; + end; + try + case AType of + SSL_FILETYPE_ASN1: + begin + j := ERR_R_ASN1_LIB; + LDH := d2i_DHparams_bio(B, nil); + end; + SSL_FILETYPE_PEM: + begin + j := ERR_R_DH_LIB; + LDH := PEM_read_bio_DHparams(B, nil, SSL_CTX_get_default_passwd_cb(ctx), + SSL_CTX_get_default_passwd_cb_userdata(ctx)); + end + else begin + SSLerr(SSL_F_SSL3_CTRL, SSL_R_BAD_SSL_FILETYPE); + Exit; + end; + end; + if not Assigned(LDH) then begin + SSLerr(SSL_F_SSL3_CTRL, j); + Exit; + end; + Result := SSL_CTX_set_tmp_dh(ctx, LDH); + DH_free(LDH); + finally + BIO_free(B); + end; + finally + FreeAndNil(LM); + end; +end; + + {$ENDIF} // WINDOWS + + {$IFDEF UNIX} + +function IndySSL_load_client_CA_file(const AFileName: String) : PSTACK_OF_X509_NAME; +{$IFDEF USE_MARSHALLED_PTRS} +var + M: TMarshaller; +{$ENDIF} +begin + Result := SSL_load_client_CA_file( + {$IFDEF USE_MARSHALLED_PTRS} + M.AsUtf8(AFileName).ToPointer + {$ELSE} + PAnsiChar(UTF8String(AFileName)) + {$ENDIF} + ); +end; + +function IndySSL_CTX_use_PrivateKey_file(ctx: PSSL_CTX; const AFileName: String; + AType: Integer): TIdC_INT; +{$IFDEF USE_INLINE} inline; {$ENDIF} +{$IFDEF USE_MARSHALLED_PTRS} +var + M: TMarshaller; +{$ENDIF} +begin + Result := SSL_CTX_use_PrivateKey_file(ctx, + {$IFDEF USE_MARSHALLED_PTRS} + M.AsUtf8(AFileName).ToPointer + {$ELSE} + PAnsiChar(UTF8String(AFileName)) + {$ENDIF} + , AType); +end; + +function IndySSL_CTX_use_certificate_file(ctx: PSSL_CTX; + const AFileName: String; AType: Integer): TIdC_INT; +{$IFDEF USE_INLINE} inline; {$ENDIF} +{$IFDEF USE_MARSHALLED_PTRS} +var + M: TMarshaller; +{$ENDIF} +begin + Result := SSL_CTX_use_certificate_file(ctx, + {$IFDEF USE_MARSHALLED_PTRS} + M.AsUtf8(AFileName).ToPointer + {$ELSE} + PAnsiChar(UTF8String(AFileName)) + {$ENDIF} + , AType); +end; + +function IndySSL_CTX_use_certificate_chain_file(ctx :PSSL_CTX; + const AFileName: String) : TIdC_INT; +{$IFDEF USE_INLINE} inline; {$ENDIF} +{$IFDEF USE_MARSHALLED_PTRS} +var + M: TMarshaller; +{$ENDIF} +begin + Result := SSL_CTX_use_certificate_chain_file(ctx, + {$IFDEF USE_MARSHALLED_PTRS} + M.AsUtf8(AFileName).ToPointer + {$ELSE} + PAnsiChar(UTF8String(AFileName)) + {$ENDIF}); +end; + +{$IFDEF USE_MARSHALLED_PTRS} +function AsUtf8OrNil(var M: TMarshaller; const S: String): Pointer; + {$IFDEF USE_INLINE} inline; {$ENDIF} +begin + if S <> '' then begin + Result := M.AsUtf8(S).ToPointer; + end else begin + Result := nil; + end; +end; +{$ENDIF} + +function IndyX509_STORE_load_locations(ctx: PX509_STORE; + const AFileName, APathName: String): TIdC_INT; +{$IFDEF USE_INLINE} inline; {$ENDIF} +{$IFDEF USE_MARSHALLED_PTRS} +var + M: TMarshaller; +{$ENDIF} +begin + // RLebeau 4/18/2010: X509_STORE_load_locations() expects nil pointers + // for unused values, but casting a string directly to a PAnsiChar + // always produces a non-nil pointer, which causes X509_STORE_load_locations() + // to fail. Need to cast the string to an intermediate Pointer so the + // PAnsiChar cast is applied to the raw data and thus can be nil... + // + // RLebeau 8/18/2017: TMarshaller also produces a non-nil TPtrWrapper for + // an empty string, so need to handle nil specially with marshalled + // strings as well... + // + Result := X509_STORE_load_locations(ctx, + {$IFDEF USE_MARSHALLED_PTRS} + AsUtf8OrNil(M, AFileName), + AsUtf8OrNil(M, APathName) + {$ELSE} + PAnsiChar(Pointer(UTF8String(AFileName))), + PAnsiChar(Pointer(UTF8String(APathName))) + {$ENDIF} + ); +end; + +function IndySSL_CTX_load_verify_locations(ctx: PSSL_CTX; + const ACAFile, ACAPath: String): TIdC_INT; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + // RLebeau: why are we calling X509_STORE_load_locations() directly + // instead of just calling SSL_CTX_load_verify_locations() with + // UTF-8 input? + + //Result := SSL_CTX_load_verify_locations(ctx, + // {$IFDEF USE_MARSHALLED_PTRS} + // AsUtf8OrNl(ACAFile), + // AsUtf8OrNil(ACAPath) + // {$ELSE} + // PAnsiChar(Pointer(UTF8String(ACAFile))), + // PAnsiChar(Pointer(UTF8String(ACAPath))) + // {$ENDIF} + //); + + Result := IndyX509_STORE_load_locations(SSL_CTX_get_cert_store(ctx), ACAFile, ACAPath); +end; + +function IndySSL_CTX_use_DHparams_file(ctx: PSSL_CTX; + const AFileName: String; AType: Integer): TIdC_INT; +var + B: PBIO; + LDH: PDH; + j: Integer; + {$IFDEF USE_MARSHALLED_PTRS} + M: TMarshaller; + {$ENDIF} +begin + Result := 0; + B := BIO_new_file( + {$IFDEF USE_MARSHALLED_PTRS} + M.AsUtf8(AFileName).ToPointer + {$ELSE} + PAnsiChar(UTF8String(AFileName)) + {$ENDIF} + , 'r'); + if Assigned(B) then begin + try + case AType of + SSL_FILETYPE_ASN1: + begin + j := ERR_R_ASN1_LIB; + LDH := d2i_DHparams_bio(B, nil); + end; + SSL_FILETYPE_PEM: + begin + j := ERR_R_DH_LIB; + LDH := PEM_read_bio_DHparams(B, nil, SSL_CTX_get_default_passwd_cb(ctx), + SSL_CTX_get_default_passwd_cb_userdata(ctx)); + end + else begin + SSLerr(SSL_F_SSL3_CTRL, SSL_R_BAD_SSL_FILETYPE); + Exit; + end; + end; + if not Assigned(LDH) then begin + SSLerr(SSL_F_SSL3_CTRL, j); + Exit; + end; + Result := SSL_CTX_set_tmp_dh(ctx, LDH); + DH_free(LDH); + finally + BIO_free(B); + end; + end; +end; + + {$ENDIF} // UNIX + +{$ELSE} // STRING_IS_UNICODE +{this conditional section assumes that strings are UTF8 or perhaps use a codepage + and the calls typically resolve to direct calls to OpenSSL} + +function IndySSL_load_client_CA_file(const AFileName: String) : PSTACK_OF_X509_NAME; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := SSL_load_client_CA_file(PAnsiChar(AFileName)); +end; + +function IndySSL_CTX_use_PrivateKey_file(ctx: PSSL_CTX; const AFileName: String; + AType: Integer): TIdC_INT; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := SSL_CTX_use_PrivateKey_file(ctx, PAnsiChar(AFileName), AType); +end; + +function IndySSL_CTX_use_certificate_file(ctx: PSSL_CTX; + const AFileName: String; AType: Integer): TIdC_INT; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := SSL_CTX_use_certificate_file(ctx, PAnsiChar(AFileName), AType); +end; + +function IndySSL_CTX_use_certificate_chain_file(ctx :PSSL_CTX; + const AFileName: String) : TIdC_INT; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := SSL_CTX_use_certificate_chain_file(ctx, PAnsiChar(AFileName)); +end; + +function IndyX509_STORE_load_locations(ctx: PX509_STORE; + const AFileName, APathName: String): TIdC_INT; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + // RLebeau 4/18/2010: X509_STORE_load_locations() expects nil pointers + // for unused values, but casting a string directly to a PAnsiChar + // always produces a non-nil pointer, which causes X509_STORE_load_locations() + // to fail. Need to cast the string to an intermediate Pointer so the + // PAnsiChar cast is applied to the raw data and thus can be nil... + // + Result := X509_STORE_load_locations(ctx, + PAnsiChar(Pointer(AFileName)), + PAnsiChar(Pointer(APathName))); +end; + +function IndySSL_CTX_load_verify_locations(ctx: PSSL_CTX; + const ACAFile, ACAPath: String): TIdC_INT; +begin + // RLebeau 4/18/2010: X509_STORE_load_locations() expects nil pointers + // for unused values, but casting a string directly to a PAnsiChar + // always produces a non-nil pointer, which causes X509_STORE_load_locations() + // to fail. Need to cast the string to an intermediate Pointer so the + // PAnsiChar cast is applied to the raw data and thus can be nil... + // + Result := SSL_CTX_load_verify_locations(ctx, + PAnsiChar(Pointer(ACAFile)), + PAnsiChar(Pointer(ACAPath))); +end; + +function IndySSL_CTX_use_DHparams_file(ctx: PSSL_CTX; + const AFileName: String; AType: Integer): TIdC_INT; +var + B: PBIO; + LDH: PDH; + j: Integer; +begin + Result := 0; + B := BIO_new_file(PAnsiChar(AFileName), 'r'); + if Assigned(B) then begin + try + case AType of + SSL_FILETYPE_ASN1: + begin + j := ERR_R_ASN1_LIB; + LDH := d2i_DHparams_bio(B, nil); + end; + SSL_FILETYPE_PEM: + begin + j := ERR_R_DH_LIB; + LDH := PEM_read_bio_DHparams(B, nil, SSL_CTX_get_default_passwd_cb(ctx), + SSL_CTX_get_default_passwd_cb_userdata(ctx)); + end + else begin + SSLerr(SSL_F_SSL3_CTRL, SSL_R_BAD_SSL_FILETYPE); + Exit; + end; + end; + if not Assigned(LDH) then begin + SSLerr(SSL_F_SSL3_CTRL, j); + Exit; + end; + Result := SSL_CTX_set_tmp_dh(ctx, LDH); + DH_free(LDH); + finally + BIO_free(B); + end; + end; +end; + +{$ENDIF} + + +end. diff --git a/IdSSLOpenSSL_Utils.pas b/IdSSLOpenSSL_Utils.pas new file mode 100644 index 0000000..1ef51ff --- /dev/null +++ b/IdSSLOpenSSL_Utils.pas @@ -0,0 +1,246 @@ +unit IdSSLOpenSSL_Utils; + +interface +{$I IdCompilerDefines.inc} +{$i IdSSLOpenSSLDefines.inc} + +uses + IdCTypes, + IdGlobal, + IdGlobalProtocols, + IdOpenSSLHeaders_asn1, + IdOpenSSLHeaders_evp, + IdOpenSSLHeaders_ossl_typ, + System.Classes; + +type + TIdSSLEVP_MD = record + Length: TIdC_UINT; + MD: Array [0 .. EVP_MAX_MD_SIZE - 1] of TIdAnsiChar; + end; + +function ASN1_OBJECT_ToStr(a: PASN1_OBJECT): String; +function LogicalAnd(a, B: Integer): Boolean; +function BytesToHexString(APtr: Pointer; ALen: Integer): String; +function MDAsString(const AMD: TIdSSLEVP_MD): String; +procedure DumpCert(AOut: TStrings; AX509: PX509); +function UTCTime2DateTime(UTCtime: PASN1_UTCTIME): TDateTime; +function UTC_Time_Decode(UTCtime: PASN1_UTCTIME; + var year, month, day, hour, min, sec: Word; + var tz_hour, tz_min: Integer): Integer; +function AddMins(const DT: TDateTime; const Mins: Extended): TDateTime; +function AddHrs(const DT: TDateTime; const Hrs: Extended): TDateTime; + + +implementation + +uses IdOpenSSLHeaders_bio, IdOpenSSLHeaders_objects, IdOpenSSLHeaders_x509, + System.SysUtils; + +function AddMins(const DT: TDateTime; const Mins: Extended): TDateTime; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := DT + Mins / (60 * 24) +end; + +function AddHrs(const DT: TDateTime; const Hrs: Extended): TDateTime; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := DT + Hrs / 24.0; +end; + +function UTC_Time_Decode(UTCtime: PASN1_UTCTIME; + var year, month, day, hour, min, sec: Word; + var tz_hour, tz_min: Integer): Integer; +var + i, tz_dir: Integer; + time_str: string; +{$IFNDEF USE_MARSHALLED_PTRS} +{$IFNDEF STRING_IS_ANSI} + LTemp: AnsiString; +{$ENDIF} +{$ENDIF} +begin + Result := 0; { default is to return with an error indication } + if UTCtime^.Length < 12 then + begin + Exit; + end; +{$IFDEF USE_MARSHALLED_PTRS} + time_str := TMarshal.ReadStringAsAnsi(TPtrWrapper.Create(UTCtime^.data), + UTCtime^.Length); +{$ELSE} +{$IFDEF STRING_IS_ANSI} + SetString(time_str, PAnsiChar(UTCtime^.data), UTCtime^.Length); +{$ELSE} + SetString(LTemp, PAnsiChar(UTCtime^.data), UTCtime^.Length); + { Note: UTCtime is a type defined by OpenSSL and hence is ansistring and not UCS-2 } + // TODO: do we need to use SetCodePage() here? + time_str := String(LTemp); // explicit convert to Unicode +{$ENDIF} +{$ENDIF} + // Check if first 12 chars are numbers + if not IsNumeric(time_str, 12) then + begin + Exit; + end; + // Convert time from string to number + year := IndyStrToInt(Copy(time_str, 1, 2)) + 1900; + month := IndyStrToInt(Copy(time_str, 3, 2)); + day := IndyStrToInt(Copy(time_str, 5, 2)); + hour := IndyStrToInt(Copy(time_str, 7, 2)); + min := IndyStrToInt(Copy(time_str, 9, 2)); + sec := IndyStrToInt(Copy(time_str, 11, 2)); + // Fix year. This function is Y2k but isn't compatible with Y2k5 :-( {Do not Localize} + if year < 1950 then + begin + Inc(year, 100); + end; + // Check TZ + tz_hour := 0; + tz_min := 0; + if CharIsInSet(time_str, 13, '-+') then + begin { Do not Localize } + tz_dir := iif(CharEquals(time_str, 13, '-'), -1, 1); { Do not Localize } + for i := 14 to 18 do + begin // Check if numbers are numbers + if i = 16 then + begin + Continue; + end; + if not IsNumeric(time_str[i]) then + begin + Exit; + end; + end; + tz_hour := IndyStrToInt(Copy(time_str, 14, 15)) * tz_dir; + tz_min := IndyStrToInt(Copy(time_str, 17, 18)) * tz_dir; + end; + Result := 1; { everthing OK } +end; + +function LogicalAnd(a, B: Integer): Boolean; +{$IFDEF USE_INLINE} inline; {$ENDIF} +begin + Result := (a and B) = B; +end; + +function BytesToHexString(APtr: Pointer; ALen: Integer): String; +{$IFDEF USE_INLINE} inline; {$ENDIF} +var + i: Integer; + LPtr: PByte; +begin + Result := ''; + LPtr := PByte(APtr); + for i := 0 to (ALen - 1) do + begin + if i <> 0 then + begin + Result := Result + ':'; { Do not Localize } + end; + Result := Result + IndyFormat('%.2x', [LPtr^]); + Inc(LPtr); + end; +end; + +function MDAsString(const AMD: TIdSSLEVP_MD): String; +{$IFDEF USE_INLINE} inline; {$ENDIF} +var + i: Integer; +begin + Result := ''; + for i := 0 to AMD.Length - 1 do + begin + if i <> 0 then + begin + Result := Result + ':'; { Do not Localize } + end; + Result := Result + IndyFormat('%.2x', [Byte(AMD.MD[i])]); + { do not localize } + end; +end; + +function ASN1_OBJECT_ToStr(a: PASN1_OBJECT): String; +var + LBuf: array [0 .. 1024] of TIdAnsiChar; + LNoName: TIdC_INT; +begin + LNoName := 0; + OBJ_obj2txt(@LBuf[0], 1024, a, LNoName); + Result := String(LBuf); +end; + +// Note that I define UTCtime as PASN1_STRING +function UTCTime2DateTime(UTCtime: PASN1_UTCTIME): TDateTime; +{$IFDEF USE_INLINE} inline; {$ENDIF} +var + year: Word; + month: Word; + day: Word; + hour: Word; + min: Word; + sec: Word; + tz_h: Integer; + tz_m: Integer; +begin + Result := 0; + if UTC_Time_Decode(UTCtime, year, month, day, hour, min, sec, tz_h, tz_m) > 0 + then + begin + Result := EncodeDate(year, month, day) + EncodeTime(hour, min, sec, 0); + AddMins(Result, tz_m); + AddHrs(Result, tz_h); + Result := UTCTimeToLocalTime(Result); + end; +end; + +{$IFNDEF OPENSSL_NO_BIO} + +procedure DumpCert(AOut: TStrings; AX509: PX509); +var + LMem: PBIO; + LLen: TIdC_INT; + LBufPtr: PIdAnsiChar; +begin +{$IFNDEF OPENSSL_STATIC_LINK_MODEL} + if Assigned(X509_print) then +{$ENDIF} + begin + LMem := BIO_new(BIO_s_mem); + if LMem <> nil then + begin + try + X509_print(LMem, AX509); + LLen := BIO_get_mem_data(LMem, LBufPtr); + if (LLen > 0) and (LBufPtr <> nil) then + begin + AOut.Text := IndyTextEncoding_UTF8.GetString( +{$IFNDEF VCL_6_OR_ABOVE} + // RLebeau: for some reason, Delphi 5 causes a "There is no overloaded + // version of 'GetString' that can be called with these arguments" compiler + // error if the PByte type-cast is used, even though GetString() actually + // expects a PByte as input. Must be a compiler bug, as it compiles fine + // in Delphi 6. So, converting to TIdBytes until I find a better solution... + RawToBytes(LBufPtr^, LLen) +{$ELSE} + PByte(LBufPtr), LLen +{$ENDIF} + ); + end; + finally + BIO_free(LMem); + end; + end; + end; +end; + +{$ELSE} + +procedure DumpCert(AOut: TStrings; AX509: PX509); +begin +end; + +{$ENDIF} + +end. diff --git a/IdSSLOpenSSL_X509.pas b/IdSSLOpenSSL_X509.pas new file mode 100644 index 0000000..1cb7345 --- /dev/null +++ b/IdSSLOpenSSL_X509.pas @@ -0,0 +1,1152 @@ +unit IdSSLOpenSSL_X509; +{$I IdCompilerDefines.inc} +{$i IdSSLOpenSSLDefines.inc} +interface +uses + IdCTypes, + IdGlobal, + IdGlobalProtocols, + IdOpenSSLHeaders_evp, + IdOpenSSLHeaders_ossl_typ, + IdOpenSSLHeaders_x509, + IdOpenSSLHeaders_x509v3, + IdSSLOpenSSL_Utils, + System.Classes; + +type + TIdSSLULong = packed record + case Byte of + 0: (B1, B2, B3, B4: UInt8); + 1: (W1, W2: UInt16); + 2: (L1: Int32); + 3: (C1: UInt32); + end; + + TIdSSLByteArray = record + Length: TIdC_UINT; + Data: PByte; + end; + + TIdX509 = class; + + TIdX509Name = class(TObject) + protected + fX509Name: PX509_NAME; + function GetStrByNID(const ANid : TIdC_INT) : String; + function CertInOneLine: String; + function GetHash: TIdSSLULong; + function GetHashAsString: String; + function GetCommonName: String; + function GetOrginization: String; + function GetUnit: String; + function GetEMail : String; + function GetCity: String; + function GetCountry: String; + function GetProvidence: String; + function GetStreetAddress: String; + public + constructor Create(aX509Name: PX509_NAME); + // + property Hash: TIdSSLULong read GetHash; + property HashAsString: string read GetHashAsString; + property OneLine: string read CertInOneLine; + property CommonName : String read GetCommonName; + property Organization : String read GetOrginization; + property _Unit : String read GetUnit; + property EMail : String read GetEMail; + property StreetAddress : String read GetStreetAddress; + property City : String read GetCity; + property Providence : String read GetProvidence; + property Country : String read GetCountry; + // + property CertificateName: PX509_NAME read fX509Name; + end; + + TIdX509Info = class(TObject) + protected + //Do not free this here because it belongs + //to the X509 or something else. + FX509 : PX509; + public + constructor Create( aX509: PX509); virtual; + // + property Certificate: PX509 read FX509; + end; + + TIdX509Fingerprints = class(TIdX509Info) + protected + function GetMD5: TIdSSLEVP_MD; + function GetMD5AsString:String; + function GetSHA1: TIdSSLEVP_MD; + function GetSHA1AsString:String; + function GetSHA224 : TIdSSLEVP_MD; + function GetSHA224AsString : String; + function GetSHA256 : TIdSSLEVP_MD; + function GetSHA256AsString : String; + function GetSHA384 : TIdSSLEVP_MD; + function GetSHA384AsString : String; + function GetSHA512 : TIdSSLEVP_MD; + function GetSHA512AsString : String; + public + property MD5 : TIdSSLEVP_MD read GetMD5; + property MD5AsString : String read GetMD5AsString; +{IMPORTANT!!! + +FIPS approves only these algorithms for hashing. +SHA-1 +SHA-224 +SHA-256 +SHA-384 +SHA-512 + +http://csrc.nist.gov/CryptoToolkit/tkhash.html +} + property SHA1 : TIdSSLEVP_MD read GetSHA1; + property SHA1AsString : String read GetSHA1AsString; + property SHA224 : TIdSSLEVP_MD read GetSHA224; + property SHA224AsString : String read GetSHA224AsString; + property SHA256 : TIdSSLEVP_MD read GetSHA256; + property SHA256AsString : String read GetSHA256AsString; + property SHA384 : TIdSSLEVP_MD read GetSHA384; + property SHA384AsString : String read GetSHA384AsString; + property SHA512 : TIdSSLEVP_MD read GetSHA512; + property SHA512AsString : String read GetSHA512AsString; + end; + + TIdX509SigInfo = class(TIdX509Info) + protected + function GetSignature : String; + function GetSigType : TIdC_INT; + function GetSigTypeAsString : String; + function GetAlgorithm : String; + public + property Signature : String read GetSignature; + property Algorithm : String read GetAlgorithm; + property SigType : TIdC_INT read GetSigType ; + property SigTypeAsString : String read GetSigTypeAsString; + end; + TIdX509PublicKey = class(TIdX509Info) + protected + function GetModulus : String; + function GetAlgorithm: String; + function GetBits : TIdC_INT; + function GetSize : TIdC_INT; + function GetSecurityBits : TIdC_INT; + function GetEncoding : String; + function GetEncodingSize : TIdC_INT; + public + property Algorithm : String read GetAlgorithm; + property Bits : TIdC_INT read GetBits; + property SecurityBits : TIdC_INT read GetSecurityBits; + property Size : TIdC_INT read GetSize; + property Encoding : String read GetEncoding; + property EncodingSize : TIdC_INT read GetEncodingSize; + property Modulus : String read GetModulus; + end; + TIdX509Exts = class(TIdX509Info) + protected + //X509_get_ext + function GetExtension(const AIndex : TIdC_INT) : PX509_EXTENSION; + function GetExtensionByNid(const ANid : TIdC_INT) : PX509_EXTENSION; + function GetCount: TIdC_INT; + public + property ExtensionByNid[const ANid : TIdC_INT] : PX509_EXTENSION read GetExtensionByNid; + property Extensions[const AIndex : TIdC_INT] : PX509_EXTENSION read GetExtension; default; + property Count : TIdC_INT read GetCount; + end; + TIdX509AuthorityKeyID = class(TIdX509Info) + protected + function GetIssuer(const AIndex: TIdC_INT): String; + function GetKeyId : String; + function GetSerial : TIdC_INT64; + function GetIssuerCount : TIdC_INT; + public + property KeyID : String read GetKeyId; + property Serial : TIdC_INT64 read GetSerial; + property Issuer[const AIndex : TIdC_INT] : String read GetIssuer; + property IssuerCount : TIdC_INT read GetIssuerCount; + end; + TIdX509Warnings = class(TIdX509Info) + protected + function GetIsObsoleteV1: Boolean; + function GetIsSelfSigned: Boolean; + function GetSubjectAndIssuerMatch: Boolean; + public + property IsObsoleteV1 : Boolean read GetIsObsoleteV1; + property IsSelfSigned : Boolean read GetIsSelfSigned; + property SubjectAndIssuerMatch : Boolean read GetSubjectAndIssuerMatch; + end; + TIdX509Errors = class(TIdX509Info) + protected + function GetInvalidInconsistantValues: Boolean; + function GetInvalidPolicy: Boolean; + function GetUnhandledCriticalExtension: Boolean; + function GetNoFingerprint: Boolean; + public + property NoFingerprint : Boolean read GetNoFingerprint; + property InvalidInconsistantValues : Boolean read GetInvalidInconsistantValues; + property InvalidPolicy : Boolean read GetInvalidPolicy; + property UnhandledCriticalExtention : Boolean read GetUnhandledCriticalExtension; + end; + TIdX509AltSubjectAltNames = class(TIdX509Info) + private + function GetItems(const AIndex: TIdC_INT): string; + function GetItemsCount: TIdC_INT; + protected + FGeneralNames : PGENERAL_NAMES; + procedure GetGeneralNames; + public + constructor Create( aX509: PX509); override; + destructor Destroy; override; + property Items[const AIndex : TIdC_INT] : string read GetItems; + property ItemsCount : TIdC_INT read GetItemsCount; + end; + TIdX509KeyUse = (DigitalSignature, NonRepudiation, KeyEncipherment, + DataEncipherment, KeyAgreement, CertSign, CRLSign, EncipherOnly, DecipherOnly); + TIdX509KeyUsage = set of TIdX509KeyUse; + TIdX509ExtKeyUse = (Server, Client, SMIME, CodeSign, OCSPSign, TimeStamp, DVCS, AnyEKU); + TIdX509ExtKeyUsage = set of TIdX509ExtKeyUse; + TIdX509 = class(TObject) + protected + FErrors : TIdX509Errors; + FWarnings : TIdX509Warnings; + FExtensions : TIdX509Exts; + FFingerprints : TIdX509Fingerprints; + FSigInfo : TIdX509SigInfo; + FPublicKey : TIdX509PublicKey; + FCanFreeX509 : Boolean; + FX509 : PX509; + FSubject : TIdX509Name; + FIssuer : TIdX509Name; + FDisplayInfo : TStrings; + FAuthorityKeyID : TIdX509AuthorityKeyID; + FAltSubjectNames : TIdX509AltSubjectAltNames; + function GetExtensionCount: TIdC_LONG; + function RSubject:TIdX509Name; + function RIssuer:TIdX509Name; + function RnotBefore:TDateTime; + function RnotAfter:TDateTime; + function RFingerprint:TIdSSLEVP_MD; + function RFingerprintAsString:String; + function GetSerialNumber: String; + + function GetVersion : TIdC_LONG; + function GetDisplayInfo : TStrings; + function GetSubjectKeyIdentifier : String; + function GetBasicConstraints: String; + function GetExtentionName(const AIndex: TIdC_INT): string; + function GetExtentionCritical(const AIndex: TIdC_INT): Boolean; + function GetExtentionValues(const AIndex: TIdC_INT): string; + function GetKeyUsage: TIdX509KeyUsage; + function GetExtKeyUsage: TIdX509ExtKeyUsage; + function GetProxyPathLen: TIdC_LONG; + public + Constructor Create(aX509: PX509; aCanFreeX509: Boolean = True); virtual; + Destructor Destroy; override; + //These are temporary + property ExtensionCount : TIdC_LONG read GetExtensionCount; + // + property Version : TIdC_LONG read GetVersion; + // + property SigInfo : TIdX509SigInfo read FSigInfo; + property Fingerprints : TIdX509Fingerprints read FFingerprints; + // + property Fingerprint: TIdSSLEVP_MD read RFingerprint; + property FingerprintAsString: String read RFingerprintAsString; + property Subject: TIdX509Name read RSubject; + property AltSubjectNames : TIdX509AltSubjectAltNames read FAltSubjectNames; + property Issuer: TIdX509Name read RIssuer; + property notBefore: TDateTime read RnotBefore; + property notAfter: TDateTime read RnotAfter; + property SerialNumber : string read GetSerialNumber; + property DisplayInfo : TStrings read GetDisplayInfo; + + // + property Certificate: PX509 read FX509; + property PublicKey : TIdX509PublicKey read FPublicKey; + property SubjectKeyIdentifier : String read GetSubjectKeyIdentifier; + property BasicConstraints : String read GetBasicConstraints; + property ExtentionName[const AIndex : TIdC_INT] : string read GetExtentionName; + property ExtentionCritical[const AIndex : TIdC_INT] : Boolean read GetExtentionCritical; + property ExtensionValues[const AIndex : TIdC_INT] : string read GetExtentionValues; + property AuthorityKeyID : TIdX509AuthorityKeyID read FAuthorityKeyID; + property KeyUsage : TIdX509KeyUsage read GetKeyUsage; + property ExtendedKeyUsage : TIdX509ExtKeyUsage read GetExtKeyUsage; + property ProxyPathLen : TIdC_LONG read GetProxyPathLen; + property Errors : TIdX509Errors read FErrors; + property Warnings : TIdX509Warnings read FWarnings; + end; + +implementation +uses + IdFIPS, + IdOpenSSLHeaders_obj_mac, + IdOpenSSLHeaders_asn1, + IdOpenSSLHeaders_bn, + IdOpenSSLHeaders_objects, + IdOpenSSLHeaders_rsa, + IdOpenSSLHeaders_x509_vfy, + System.SysUtils; +/////////////////////////////////////////////////////////////// +// X509 Certificate +/////////////////////////////////////////////////////////////// + +{ TIdX509Name } + +function TIdX509Name.CertInOneLine: String; +var + LOneLine: array[0..2048] of TIdAnsiChar; +begin + if FX509Name = nil then begin + Result := ''; {Do not Localize} + end else begin + Result := String(X509_NAME_oneline(FX509Name, @LOneLine[0], SizeOf(LOneLine))); + end; +end; + +function TIdX509Name.GetCity: String; +begin + Result := GetStrByNid(NID_localityName); +end; + +function TIdX509Name.GetCommonName: String; +begin + Result := GetStrByNid(NID_commonName); +end; + +function TIdX509Name.GetCountry: String; +begin + Result := GetStrByNid(NID_countryName); +end; + +function TIdX509Name.GetEMail: String; +begin + Result := GetStrByNid(NID_pkcs9_emailAddress); +end; + +function TIdX509Name.GetHash: TIdSSLULong; +begin + if FX509Name = nil then begin + FillChar(Result, SizeOf(Result), 0) + end else begin + Result.C1 := X509_NAME_hash(FX509Name); + end; +end; + +function TIdX509Name.GetHashAsString: String; +begin + Result := IndyFormat('%.8x', [Hash.L1]); {do not localize} +end; + +function TIdX509Name.GetOrginization: String; +begin + Result := GetStrByNid( NID_organizationName ); +end; + +function TIdX509Name.GetProvidence: String; +begin + Result := GetStrByNid(NID_stateOrProvinceName); +end; + +function TIdX509Name.GetStrByNID(const ANid: TIdC_INT): String; +var + LBuffer: array[0..2048] of TIdAnsiChar; + LPtr : PAnsiChar; +begin + if FX509Name = nil then begin + Result := ''; {Do not Localize} + end else begin + LPtr := @LBuffer[0]; + if X509_NAME_get_text_by_NID(FX509Name,ANid,LPtr,256) > -1 then begin + Result := String(LPtr); + end else begin + Result := ''; + end; + end; +end; + +function TIdX509Name.GetStreetAddress: String; +begin + Result := GetStrByNid( NID_streetAddress ); +end; + +function TIdX509Name.GetUnit: String; +begin + Result := GetStrByNid( NID_organizationalUnitName ); +end; + +constructor TIdX509Name.Create(aX509Name: PX509_NAME); +begin + Inherited Create; + FX509Name := aX509Name; +end; + + +/////////////////////////////////////////////////////////////// +// X509 Certificate +/////////////////////////////////////////////////////////////// + +{ TIdX509Info } + +constructor TIdX509Info.Create(aX509: PX509); +begin + inherited Create; + FX509 := aX509; +end; + +{ TIdX509Fingerprints } + +function TIdX509Fingerprints.GetMD5: TIdSSLEVP_MD; +begin + CheckMD5Permitted; + X509_digest(FX509, EVP_md5, PByte(@Result.MD), Result.Length); +end; + +function TIdX509Fingerprints.GetMD5AsString: String; +begin + Result := MDAsString(MD5); +end; + +function TIdX509Fingerprints.GetSHA1: TIdSSLEVP_MD; +begin + X509_digest(FX509, EVP_sha1, PByte(@Result.MD), Result.Length); +end; + +function TIdX509Fingerprints.GetSHA1AsString: String; +begin + Result := MDAsString(SHA1); +end; + +function TIdX509Fingerprints.GetSHA224 : TIdSSLEVP_MD; +begin + {$IFDEF OPENSSL_STATIC_LINK_MODEL} + X509_digest(FX509, EVP_sha224, PByte(@Result.MD), Result.Length); + {$ELSE} + if Assigned(EVP_sha224) then begin + X509_digest(FX509, EVP_sha224, PByte(@Result.MD), Result.Length); + end else begin + FillChar(Result, SizeOf(Result), 0); + end; + {$ENDIF} +end; + +function TIdX509Fingerprints.GetSHA224AsString : String; +begin + {$IFDEF OPENSSL_STATIC_LINK_MODEL} + Result := MDAsString(SHA224); + {$ELSE} + if Assigned(EVP_sha224) then begin + Result := MDAsString(SHA224); + end else begin + Result := ''; + end; + {$ENDIF} +end; + +function TIdX509Fingerprints.GetSHA256 : TIdSSLEVP_MD; +begin + {$IFDEF OPENSSL_STATIC_LINK_MODEL} + X509_digest(FX509, EVP_sha256, PByte(@Result.MD), Result.Length); + {$ELSE} + if Assigned(EVP_sha256) then begin + X509_digest(FX509, EVP_sha256, PByte(@Result.MD), Result.Length); + end else begin + FillChar(Result, SizeOf(Result), 0); + end; + {$ENDIF} +end; + +function TIdX509Fingerprints.GetSHA256AsString : String; +begin + {$IFDEF OPENSSL_STATIC_LINK_MODEL} + Result := MDAsString(SHA256); + {$ELSE} + if Assigned(EVP_sha256) then begin + Result := MDAsString(SHA256); + end else begin + Result := ''; + end; + {$ENDIF} +end; + +function TIdX509Fingerprints.GetSHA384 : TIdSSLEVP_MD; +begin + {$IFDEF OPENSSL_STATIC_LINK_MODEL} + X509_digest(FX509, EVP_SHA384, PByte(@Result.MD), Result.Length); + {$ELSE} + if Assigned(EVP_SHA384) then begin + X509_digest(FX509, EVP_SHA384, PByte(@Result.MD), Result.Length); + end else begin + FillChar(Result, SizeOf(Result), 0); + end; + {$ENDIF} +end; + +function TIdX509Fingerprints.GetSHA384AsString : String; +begin + {$IFDEF OPENSSL_STATIC_LINK_MODEL} + Result := MDAsString(SHA384); + {$ELSE} + if Assigned(EVP_SHA384) then begin + Result := MDAsString(SHA384); + end else begin + Result := ''; + end; + {$ENDIF} +end; + +function TIdX509Fingerprints.GetSHA512 : TIdSSLEVP_MD; +begin + {$IFDEF OPENSSL_STATIC_LINK_MODEL} + X509_digest(FX509, EVP_sha512, PByte(@Result.MD), Result.Length); + {$ELSE} + if Assigned(EVP_sha512) then begin + X509_digest(FX509, EVP_sha512, PByte(@Result.MD), Result.Length); + end else begin + FillChar(Result, SizeOf(Result), 0); + end; + {$ENDIF} +end; + +function TIdX509Fingerprints.GetSHA512AsString : String; +begin + {$IFDEF OPENSSL_STATIC_LINK_MODEL} + Result := MDAsString(SHA512); + {$ELSE} + if Assigned(EVP_sha512) then begin + Result := MDAsString(SHA512); + end else begin + Result := ''; + end; + {$ENDIF} +end; + +{ TIdX509SigInfo } + +function TIdX509SigInfo.GetAlgorithm: String; +var + sig_alg : PX509_ALGOR; + signature : PASN1_BIT_STRING; + lalgorithm : PASN1_OBJECT; +begin + X509_get0_signature(signature,sig_alg, FX509); + X509_ALGOR_get0(@lalgorithm, nil, nil, sig_alg); + Result := ASN1_OBJECT_ToStr(lalgorithm); +end; + +function TIdX509SigInfo.GetSignature: String; +var + sig_alg : PX509_ALGOR; + signature : PASN1_BIT_STRING; +begin + X509_get0_signature(signature, sig_alg, FX509); + Result := BytesToHexString( signature^.data, signature^.length); +end; + +function TIdX509SigInfo.GetSigType: TIdC_INT; +begin + Result := X509_get_signature_type(FX509); +end; + +function TIdX509SigInfo.GetSigTypeAsString: String; +begin + Result := String(OBJ_nid2ln(SigType)); +end; + +{ TIdX509 } + +constructor TIdX509.Create(aX509: PX509; aCanFreeX509: Boolean = True); +begin + inherited Create; + //don't create FDisplayInfo unless specifically requested. + FDisplayInfo := nil; + FX509 := aX509; + FCanFreeX509 := aCanFreeX509; + FAltSubjectNames := TIdX509AltSubjectAltNames.Create(FX509); + FErrors := TIdX509Errors.Create(FX509); + FFingerprints := TIdX509Fingerprints.Create(FX509); + FSigInfo := TIdX509SigInfo.Create(FX509); + FPublicKey := TIdX509PublicKey.Create(FX509); + FExtensions := TIdX509Exts.Create(FX509); + FSubject := nil; + FIssuer := nil; + FAuthorityKeyID := TIdX509AuthorityKeyID.Create(FX509); + FWarnings := TIdX509Warnings.Create(FX509); +end; + +destructor TIdX509.Destroy; +begin + FreeAndNil(FWarnings); + FreeAndNil(FAuthorityKeyID); + FreeAndNil(FExtensions); + FreeAndNil(FDisplayInfo); + FreeAndNil(FSubject); + FreeAndNil(FIssuer); + FreeAndNil(FFingerprints); + FreeAndNil(FSigInfo); + FreeAndNil( FAltSubjectNames ); + { If the X.509 certificate handle was obtained from a certificate + store or from the SSL connection as a peer certificate, then DO NOT + free it here! The memory is owned by the OpenSSL library and will + crash the library if Indy tries to free its private memory here } + if FCanFreeX509 then begin + X509_free(FX509); + end; + FreeAndNil(FErrors); + inherited Destroy; +end; + +function TIdX509.GetSubjectKeyIdentifier: String; +var + LPtr : PAnsiChar; + LLen : TIdC_INT; + LASN1 : PASN1_OCTET_STRING; +begin + Result := ''; + LASN1 := X509_get0_subject_key_id(FX509); + if Assigned(LASN1) then begin + LPtr := PAnsiChar(ASN1_STRING_get0_data(PASN1_STRING(LASN1))); + LLen := ASN1_STRING_length(PASN1_STRING(LASN1)); + Result := BytesToHexString(LPtr, LLen); + end; +end; + +function TIdX509.GetBasicConstraints: String; +var + LFlags : TIdC_UINT32; + LPathLen : TIdC_LONG; +begin + Result := ''; + LFlags := X509_get_extension_flags(FX509); + if LFlags and EXFLAG_CA = EXFLAG_CA then begin + Result := 'CA = True'; + LPathLen := X509_get_pathlen(FX509); + if LPathLen > -1 then begin + Result := Result + ' (Pathlength: '+IntToStr(LPathLen)+')'; + end; + end; +end; + +function TIdX509.GetDisplayInfo: TStrings; +begin + if not Assigned(FDisplayInfo) then begin + FDisplayInfo := TStringList.Create; + DumpCert(FDisplayInfo, FX509); + end; + Result := FDisplayInfo; +end; + +function TIdX509.GetExtensionCount: TIdC_LONG; +begin + Result := Self.FExtensions.Count; +end; + +function TIdX509.GetExtentionCritical(const AIndex: TIdC_INT): Boolean; +var LExt : PX509_EXTENSION; + +begin + Result := False; + if AIndex > -1 then begin + LExt := X509_get_ext(FX509, AIndex); + Result := X509_EXTENSION_get_critical(LExt) > 0; + end; +end; + +function TIdX509.GetExtentionName(const AIndex: TIdC_INT): string; +var LExt : PX509_EXTENSION; + LASN1 : PASN1_OBJECT; +begin + Result := ''; + if AIndex > -1 then begin + LExt := X509_get_ext(FX509, AIndex); + LASN1 := X509_EXTENSION_get_object(LExt); + Result := ASN1_OBJECT_ToStr(LASN1); + end; +end; + +function TIdX509.GetExtentionValues(const AIndex: TIdC_INT): string; +var LExt : PX509_EXTENSION; + LASN1 : PASN1_OCTET_STRING; + LPtr : PAnsiChar; + LLen : TIdC_INT; +begin + Result := ''; + if AIndex > -1 then begin + LExt := X509_get_ext(FX509, AIndex); + LASN1 := X509_EXTENSION_get_data(LExt); + if Assigned(LASN1) then begin + LPtr := PAnsiChar(ASN1_STRING_get0_data(PASN1_STRING(LASN1))); + LLen := ASN1_STRING_length(PASN1_STRING(LASN1)); + Result := BytesToHexString(LPtr, LLen); + end; + end; +end; + +function TIdX509.GetExtKeyUsage: TIdX509ExtKeyUsage; +var LFlags : TIdC_UINT32; +begin + Result := []; + if X509_get_extension_flags(FX509) and EXFLAG_XKUSAGE = EXFLAG_XKUSAGE then begin + LFlags := X509_get_extended_key_usage(FX509); + if (LFlags and XKU_SSL_SERVER = XKU_SSL_SERVER) then begin + Result := Result + [Server]; + end; + if (LFlags and XKU_SSL_CLIENT = XKU_SSL_CLIENT) then begin + Result := Result + [Client]; + end; + if (LFlags and XKU_SMIME = XKU_SMIME) then begin + Result := Result + [SMIME]; + end; + if (LFlags and XKU_CODE_SIGN = XKU_CODE_SIGN) then begin + Result := Result + [CodeSign]; + end; + if (LFlags and XKU_OCSP_SIGN = XKU_OCSP_SIGN) then begin + Result := Result + [OCSPSign]; + end; + if (LFlags and XKU_TIMESTAMP = XKU_TIMESTAMP) then begin + Result := Result + [TimeStamp]; + end; + if (LFlags and XKU_DVCS = XKU_DVCS) then begin + Result := Result + [DVCS]; + end; + if (LFlags and XKU_ANYEKU = XKU_ANYEKU) then begin + Result := Result + [AnyEKU]; + end; + end; +end; + +function TIdX509.GetKeyUsage: TIdX509KeyUsage; +var + LKeyUsage : TIdC_UINT32; +begin + Result := []; + if X509_get_extension_flags(FX509) and EXFLAG_KUSAGE = EXFLAG_KUSAGE then begin + + LKeyUsage :=X509_get_key_usage(FX509); + if LKeyUsage and KU_DIGITAL_SIGNATURE = KU_DIGITAL_SIGNATURE then begin + Result := Result + [DigitalSignature]; + end; + if LKeyUsage and KU_NON_REPUDIATION = KU_NON_REPUDIATION then begin + Result := Result + [NonRepudiation]; + end; + if LKeyUsage and KU_KEY_ENCIPHERMENT = KU_KEY_ENCIPHERMENT then begin + Result := Result + [DataEncipherment]; + end; + if LKeyUsage and KU_KEY_AGREEMENT = KU_KEY_AGREEMENT then begin + Result := Result + [KeyAgreement]; + end; + if LKeyUsage and KU_KEY_CERT_SIGN = KU_KEY_CERT_SIGN then begin + Result := Result + [CertSign]; + end; + if LKeyUsage and KU_CRL_SIGN = KU_CRL_SIGN then begin + Result := Result + [CRLSign]; + end; + if LKeyUsage and KU_ENCIPHER_ONLY = KU_ENCIPHER_ONLY then begin + Result := Result + [EncipherOnly]; + end; + if LKeyUsage and KU_DECIPHER_ONLY = KU_DECIPHER_ONLY then begin + Result := Result + [DecipherOnly]; + end; + end; +end; + +function TIdX509.GetProxyPathLen: TIdC_LONG; +begin + Result := -1; + if X509_get_extension_flags(FX509) and EXFLAG_PROXY = EXFLAG_PROXY then + begin + Result := X509_get_proxy_pathlen(FX509); + end; +end; + +function TIdX509.GetSerialNumber: String; +var + LSN : PASN1_INTEGER; + LBN : PBIGNUM; +begin + if FX509 <> nil then begin + LSN := X509_get_serialNumber(FX509); + LBN := ASN1_INTEGER_to_BN(LSN, nil); + Result := String(BN_bn2hex(LBN)); + bn_free(LBN); + end else begin + Result := ''; + end; +end; + +function TIdX509.GetVersion : TIdC_LONG; +begin + Result := X509_get_version(FX509); +end; + +function TIdX509.RSubject: TIdX509Name; +var + Lx509_name: PX509_NAME; +Begin + if not Assigned(FSubject) then begin + if FX509 <> nil then begin + Lx509_name := X509_get_subject_name(FX509); + end else begin + Lx509_name := nil; + end; + FSubject := TIdX509Name.Create(Lx509_name); + end; + Result := FSubject; +end; + +function TIdX509.RIssuer: TIdX509Name; +var + Lx509_name: PX509_NAME; +begin + if not Assigned(FIssuer) then begin + if FX509 <> nil then begin + Lx509_name := X509_get_issuer_name(FX509); + end else begin + Lx509_name := nil; + end; + FIssuer := TIdX509Name.Create(Lx509_name); + End; + Result := FIssuer; +end; + +function TIdX509.RFingerprint: TIdSSLEVP_MD; +begin + X509_digest(FX509, EVP_md5, PByte(@Result.MD), Result.Length); +end; + +function TIdX509.RFingerprintAsString: String; +begin + Result := MDAsString(Fingerprint); +end; + +function TIdX509.RnotBefore: TDateTime; +begin + if FX509 = nil then begin + Result := 0 + end else begin + //This is a safe typecast since PASN1_UTCTIME and PASN1_TIME are really + //pointers to ASN1 strings since ASN1_UTCTIME amd ASM1_TIME are ASN1_STRING. + Result := UTCTime2DateTime(PASN1_UTCTIME(X509_get0_notBefore(FX509))); + end; +end; + +function TIdX509.RnotAfter:TDateTime; +begin + if FX509 = nil then begin + Result := 0 + end else begin + Result := UTCTime2DateTime(PASN1_UTCTIME(X509_get0_notAfter(FX509))); + end; +end; + +{ TIdX509PublicKey } + +function TIdX509PublicKey.GetAlgorithm: String; +var LPubKey : PX509_PUBKEY; + LAlgorithm : PASN1_OBJECT; +begin + LPubKey := X509_get_X509_PUBKEY(FX509); + X509_PUBKEY_get0_param(@LAlgorithm, nil, nil, nil,LPubKey); + Result := ASN1_OBJECT_ToStr(lalgorithm); +end; + +function TIdX509PublicKey.GetEncoding: String; +var LPubKey : PX509_PUBKEY; + LLen : TIdC_INT; + LKey : array[0..2048] of TIdAnsiChar; + LPtr : PByte; +begin + LPubKey := X509_get_X509_PUBKEY(FX509); + LPtr := @LKey[0]; + X509_PUBKEY_get0_param(nil, @LPtr, @LLen, nil,LPubKey); + Result := BytesToHexString(LPtr,LLen); +end; + +function TIdX509PublicKey.GetEncodingSize: TIdC_INT; +var LPubKey : PX509_PUBKEY; + LKey : array[0..2048] of TIdAnsiChar; + LPtr : PByte; +begin + LPubKey := X509_get_X509_PUBKEY(FX509); + LPtr := @LKey[0]; + X509_PUBKEY_get0_param(nil, @LPtr, @Result, nil,LPubKey); +end; + +function TIdX509PublicKey.GetModulus: String; +var LPubKey : PX509_PUBKEY; + LKey : PEVP_PKEY; + LBN : PBIGNUM; +begin + Result := ''; + LPubKey := X509_get_X509_PUBKEY(FX509); + LKey := X509_PUBKEY_get0(LPubKey); + if EVP_PKEY_base_id(LKey) = EVP_PKEY_RSA then begin + RSA_get0_key(EVP_PKEY_get0_RSA(LKey), @LBN, nil, nil); + Result := String(BN_bn2hex(LBN)); + end; +end; + +function TIdX509PublicKey.GetBits: TIdC_INT; +var LPubKey : PX509_PUBKEY; + LKey : PEVP_PKEY; +begin + LPubKey := X509_get_X509_PUBKEY(FX509); + LKey := X509_PUBKEY_get0(LPubKey); + Result := EVP_PKEY_bits(LKey); +end; + +function TIdX509PublicKey.GetSecurityBits: TIdC_INT; +var LPubKey : PX509_PUBKEY; + LKey : PEVP_PKEY; +begin + LPubKey := X509_get_X509_PUBKEY(FX509); + LKey := X509_PUBKEY_get0(LPubKey); + Result := EVP_PKEY_security_bits(LKey); +end; + +function TIdX509PublicKey.GetSize: TIdC_INT; +var LPubKey : PX509_PUBKEY; + LKey : PEVP_PKEY; +begin + LPubKey := X509_get_X509_PUBKEY(FX509); + LKey := X509_PUBKEY_get0(LPubKey); + Result := EVP_PKEY_size(LKey); +end; + +{ TIdX509Exts } + +function TIdX509Exts.GetCount: TIdC_INT; +begin + Result := X509_get_ext_count(FX509); +end; + +function TIdX509Exts.GetExtension(const AIndex: TIdC_INT): PX509_EXTENSION; +begin + Result := X509_get_ext(FX509, AIndex); +end; + +function TIdX509Exts.GetExtensionByNid(const ANid: TIdC_INT): PX509_EXTENSION; +var LIdx : TIdC_INT; +begin + LIdx := X509_get_ext_by_NID(FX509, ANid, -1); + if LIdx > -1 then begin + Result := X509_get_ext(FX509, LIdx); + end else begin + Result := nil; + end; +end; + + +{ TIdX509AuthorityKeyID } + +function TIdX509AuthorityKeyID.GetIssuerCount : TIdC_INT; +var + LGNs : PGENERAL_NAMES; +begin + Result := 0; + LGNs := X509_get0_authority_issuer( FX509); + if Assigned(LGNs) then begin + Result := sk_GENERAL_NAME_num(LGNs); + end; +end; + +function DirName(const ADirName : PX509_NAME) : String; +var i, Le_count : TIdC_INT; + LE : PX509_NAME_ENTRY; + LASN1 : PASN1_STRING; + LOBJ : PASN1_OBJECT; +begin + Result := ''; + Le_count := X509_NAME_entry_count(ADirName); + + for i := 0 to Le_count - 1 do begin + LE := X509_NAME_get_entry( ADirName, i); + LOBJ := X509_NAME_ENTRY_get_object(LE); + LASN1 := X509_NAME_ENTRY_get_data(LE); + Result := Result + ' '+ ASN1_OBJECT_ToStr(LOBJ) + ' = ' + String(PAnsiChar(ASN1_STRING_get0_data(LASN1))) +';'; + end; + Result := Trim(Result); +end; + +function ASN1_ToIPAddress(a : PASN1_OCTET_STRING) : String; +var + LIPv6 : TIdIPv6Address; + i : Integer; +begin + Result := ''; + if a.length = 4 then begin + Result := IntToStr( a.data[0]) + '.' + IntToStr(a.data[1]) + '.'+ + IntToStr( a.data[2])+'.'+IntToStr(a.data[3]); + end else begin + if a.length = 16 then begin + + for i := 0 to 7 do begin + LIPv6[i] := (a.data[i*2] shl 8) + (a.data[(i*2)+1]); + end; + Result := IdGlobal.IPv6AddressToStr( LIPv6); + end; + end; +end; + +function GeneralNameToStr(AGN : PGENERAL_NAME) : String; +begin + Result := ''; + case AGN.type_ of + GEN_OTHERNAME : + Result := 'Other Name'; + GEN_EMAIL : + begin + Result := 'E-Mail: '+String(PAnsiChar(AGN.d.rfc822Name.data)) ; + end; + GEN_DNS : + begin + Result := 'DNS: '+String(PAnsiChar(AGN.d.dNSName.data)); + end; + GEN_X400 : + begin + Result := 'X400'; + end; + GEN_DIRNAME : + begin + Result := 'Dir Name: '+DirName(AGN.d.directoryName ); + end; + GEN_EDIPARTY : + begin + Result := 'EDI Party'; + end; + GEN_URI : + begin + Result := 'URI: '+String(PAnsiChar(AGN.d.uniformResourceIdentifier.data)); + end; + GEN_IPADD : begin + Result := 'IP Address: '+ ASN1_ToIPAddress(AGN.d.iPAddress); + end; + GEN_RID : + Result := 'Registered ID: '+ ASN1_OBJECT_ToStr(AGN.d.rid); + end; +end; + +function TIdX509AuthorityKeyID.GetIssuer(const AIndex: TIdC_INT): String; +var + LGNs : PGENERAL_NAMES; + LG : PGENERAL_NAME; +begin + Result := ''; + LGNs := X509_get0_authority_issuer( FX509); + if Assigned(LGNs) then begin + LG := sk_GENERAL_NAME_value( LGNs, AIndex); + Result := GeneralNameToStr(LG); + end; + +end; + +function TIdX509AuthorityKeyID.GetKeyId: String; +var + LASN1 : PASN1_OCTET_STRING; + LPtr : PAnsiChar; + LLen : TIdC_INT; +begin + Result := ''; + LASN1 := X509_get0_authority_key_id(FX509); + if Assigned(LASN1) then begin + LPtr := PAnsiChar(ASN1_STRING_get0_data(PASN1_STRING(LASN1))); + LLen := ASN1_STRING_length(PASN1_STRING(LASN1)); + Result := BytesToHexString(LPtr, LLen); + end; +end; + +function TIdX509AuthorityKeyID.GetSerial: TIdC_INT64; +var + LASN1 : PASN1_INTEGER; + +begin + Result := -1; + LASN1 :=X509_get0_authority_serial(FX509); + if Assigned(LASN1) then begin + ASN1_INTEGER_get_int64(@Result,LASN1); + end; +end; + +{ TIdX509Warnings } + +function TIdX509Warnings.GetIsObsoleteV1: Boolean; +begin + Result := X509_get_extension_flags(FX509) and EXFLAG_V1 = EXFLAG_V1; +end; + +function TIdX509Warnings.GetIsSelfSigned: Boolean; +begin + Result := X509_get_extension_flags(FX509) and EXFLAG_SI = EXFLAG_SI; +end; + +function TIdX509Warnings.GetSubjectAndIssuerMatch: Boolean; +begin + Result := X509_get_extension_flags(FX509) and EXFLAG_SS = EXFLAG_SS; +end; + +{ TIdX509Errors } + +function TIdX509Errors.GetInvalidInconsistantValues: Boolean; +begin + Result := X509_get_extension_flags(FX509) and EXFLAG_INVALID = EXFLAG_INVALID; +end; + +function TIdX509Errors.GetInvalidPolicy: Boolean; +begin + Result := X509_get_extension_flags(FX509) and EXFLAG_INVALID_POLICY = EXFLAG_INVALID_POLICY; +end; + +function TIdX509Errors.GetNoFingerprint: Boolean; +begin + Result := X509_get_extension_flags(FX509) and EXFLAG_NO_FINGERPRINT = EXFLAG_NO_FINGERPRINT; +end; + +function TIdX509Errors.GetUnhandledCriticalExtension: Boolean; +begin + Result := X509_get_extension_flags(FX509) and EXFLAG_CRITICAL = EXFLAG_CRITICAL; +end; + +{ TIdX509AltSubjectAltNames } + +constructor TIdX509AltSubjectAltNames.Create(aX509: PX509); +begin + inherited Create(aX509); + FGeneralNames := nil; +end; + +destructor TIdX509AltSubjectAltNames.Destroy; +begin + if Assigned(FGeneralNames) then begin + GENERAL_NAMES_free(FGeneralNames); + end; + inherited; +end; + +procedure TIdX509AltSubjectAltNames.GetGeneralNames; +begin + if not Assigned(FGeneralNames) then begin + FGeneralNames := X509_get_ext_d2i(FX509, NID_subject_alt_name, nil, nil); + end; +end; + +function TIdX509AltSubjectAltNames.GetItems(const AIndex: TIdC_INT): string; +var LGN : PGENERAL_NAME; +begin + Result := ''; + GetGeneralNames; + if Assigned(FGeneralNames) then begin + LGN := sk_GENERAL_NAME_value(FGeneralNames,AIndex); + Result := GeneralNameToStr(LGN); + end; +end; + +function TIdX509AltSubjectAltNames.GetItemsCount: TIdC_INT; +begin + Result := -1; + GetGeneralNames; + if Assigned(FGeneralNames) then begin + Result := sk_GENERAL_NAME_num(FGeneralNames); + end; +end; + +end. diff --git a/IdSymbolDeprecatedOff.inc b/IdSymbolDeprecatedOff.inc new file mode 100644 index 0000000..744d9a7 --- /dev/null +++ b/IdSymbolDeprecatedOff.inc @@ -0,0 +1,4 @@ +// TODO: for FreePascal, use {$PUSH} here and {%POP} in IdSymbolDeprecatedOn.inc +{$IFDEF HAS_DEPRECATED} + {$WARN SYMBOL_DEPRECATED OFF} +{$ENDIF} diff --git a/IdSymbolDeprecatedOn.inc b/IdSymbolDeprecatedOn.inc new file mode 100644 index 0000000..dcbe2f8 --- /dev/null +++ b/IdSymbolDeprecatedOn.inc @@ -0,0 +1,9 @@ +// TODO: for FreePascal, use {$PUSH} in IdSymbolDeprecatedOff.inc and {$POP} here +{$IFDEF HAS_DEPRECATED} + {$IFDEF HAS_DIRECTIVE_WARN_DEFAULT} + {$WARN SYMBOL_DEPRECATED DEFAULT} + {$ELSE} + {$WARN SYMBOL_DEPRECATED ON} + {$ENDIF} +{$ENDIF} + diff --git a/IndyTLSOpenSSL100.dpk b/IndyTLSOpenSSL100.dpk index f31eafd..341d8ad 100644 --- a/IndyTLSOpenSSL100.dpk +++ b/IndyTLSOpenSSL100.dpk @@ -28,7 +28,6 @@ requires contains IdResourceStringsOpenSSL in 'IdResourceStringsOpenSSL.pas', - IdNTLMOpenSSL in 'IdNTLMOpenSSL.pas', IdSSLOpenSSL in 'IdSSLOpenSSL.pas', IdSSLOpenSSLHeaders in 'IdSSLOpenSSLHeaders.pas'; diff --git a/IndyTLSOpenSSL110.dpk b/IndyTLSOpenSSL110.dpk index 0389f87..03d9511 100644 --- a/IndyTLSOpenSSL110.dpk +++ b/IndyTLSOpenSSL110.dpk @@ -28,7 +28,6 @@ requires contains IdResourceStringsOpenSSL in 'IdResourceStringsOpenSSL.pas', - IdNTLMOpenSSL in 'IdNTLMOpenSSL.pas', IdSSLOpenSSL in 'IdSSLOpenSSL.pas', IdSSLOpenSSLHeaders in 'IdSSLOpenSSLHeaders.pas'; diff --git a/IndyTLSOpenSSL120.dpk b/IndyTLSOpenSSL120.dpk index f91c253..ee4fef6 100644 --- a/IndyTLSOpenSSL120.dpk +++ b/IndyTLSOpenSSL120.dpk @@ -28,7 +28,6 @@ requires contains IdResourceStringsOpenSSL in 'IdResourceStringsOpenSSL.pas', - IdNTLMOpenSSL in 'IdNTLMOpenSSL.pas', IdSSLOpenSSL in 'IdSSLOpenSSL.pas', IdSSLOpenSSLHeaders in 'IdSSLOpenSSLHeaders.pas'; diff --git a/IndyTLSOpenSSL130.dpk b/IndyTLSOpenSSL130.dpk index 6ae7bd1..ea3e3e3 100644 --- a/IndyTLSOpenSSL130.dpk +++ b/IndyTLSOpenSSL130.dpk @@ -28,7 +28,6 @@ requires contains IdResourceStringsOpenSSL in 'IdResourceStringsOpenSSL.pas', - IdNTLMOpenSSL in 'IdNTLMOpenSSL.pas', IdSSLOpenSSL in 'IdSSLOpenSSL.pas', IdSSLOpenSSLHeaders in 'IdSSLOpenSSLHeaders.pas'; diff --git a/IndyTLSOpenSSL140.dpk b/IndyTLSOpenSSL140.dpk index 4b53e2e..df5c83a 100644 --- a/IndyTLSOpenSSL140.dpk +++ b/IndyTLSOpenSSL140.dpk @@ -29,7 +29,6 @@ requires contains IdResourceStringsOpenSSL in 'IdResourceStringsOpenSSL.pas', - IdNTLMOpenSSL in 'IdNTLMOpenSSL.pas', IdSSLOpenSSL in 'IdSSLOpenSSL.pas', IdSSLOpenSSLHeaders in 'IdSSLOpenSSLHeaders.pas'; diff --git a/IndyTLSOpenSSL150.dpk b/IndyTLSOpenSSL150.dpk index cf380c9..41cb518 100644 --- a/IndyTLSOpenSSL150.dpk +++ b/IndyTLSOpenSSL150.dpk @@ -29,7 +29,6 @@ requires contains IdResourceStringsOpenSSL in 'IdResourceStringsOpenSSL.pas', - IdNTLMOpenSSL in 'IdNTLMOpenSSL.pas', IdSSLOpenSSL in 'IdSSLOpenSSL.pas', IdSSLOpenSSLHeaders in 'IdSSLOpenSSLHeaders.pas'; diff --git a/IndyTLSOpenSSL160.dpk b/IndyTLSOpenSSL160.dpk index 36f7a11..0c4443e 100644 --- a/IndyTLSOpenSSL160.dpk +++ b/IndyTLSOpenSSL160.dpk @@ -37,7 +37,6 @@ requires contains IdResourceStringsOpenSSL in 'IdResourceStringsOpenSSL.pas', - IdNTLMOpenSSL in 'IdNTLMOpenSSL.pas', IdSSLOpenSSL in 'IdSSLOpenSSL.pas', IdSSLOpenSSLHeaders in 'IdSSLOpenSSLHeaders.pas'; diff --git a/IndyTLSOpenSSL170.dpk b/IndyTLSOpenSSL170.dpk index d6a8329..402c235 100644 --- a/IndyTLSOpenSSL170.dpk +++ b/IndyTLSOpenSSL170.dpk @@ -39,7 +39,6 @@ requires contains IdResourceStringsOpenSSL in 'IdResourceStringsOpenSSL.pas', - IdNTLMOpenSSL in 'IdNTLMOpenSSL.pas', IdSSLOpenSSL in 'IdSSLOpenSSL.pas', IdSSLOpenSSLHeaders in 'IdSSLOpenSSLHeaders.pas'; diff --git a/IndyTLSOpenSSL180.dpk b/IndyTLSOpenSSL180.dpk index 45ee423..6f59795 100644 --- a/IndyTLSOpenSSL180.dpk +++ b/IndyTLSOpenSSL180.dpk @@ -50,7 +50,6 @@ requires contains IdResourceStringsOpenSSL in 'IdResourceStringsOpenSSL.pas', - IdNTLMOpenSSL in 'IdNTLMOpenSSL.pas', IdSSLOpenSSL in 'IdSSLOpenSSL.pas', IdSSLOpenSSLHeaders in 'IdSSLOpenSSLHeaders.pas'; diff --git a/IndyTLSOpenSSL190.dpk b/IndyTLSOpenSSL190.dpk index 53f05ee..8302baf 100644 --- a/IndyTLSOpenSSL190.dpk +++ b/IndyTLSOpenSSL190.dpk @@ -50,7 +50,6 @@ requires contains IdResourceStringsOpenSSL in 'IdResourceStringsOpenSSL.pas', - IdNTLMOpenSSL in 'IdNTLMOpenSSL.pas', IdSSLOpenSSL in 'IdSSLOpenSSL.pas', IdSSLOpenSSLHeaders in 'IdSSLOpenSSLHeaders.pas'; diff --git a/IndyTLSOpenSSL200.dpk b/IndyTLSOpenSSL200.dpk index e01f188..daf7877 100644 --- a/IndyTLSOpenSSL200.dpk +++ b/IndyTLSOpenSSL200.dpk @@ -50,7 +50,6 @@ requires contains IdResourceStringsOpenSSL in 'IdResourceStringsOpenSSL.pas', - IdNTLMOpenSSL in 'IdNTLMOpenSSL.pas', IdSSLOpenSSL in 'IdSSLOpenSSL.pas', IdSSLOpenSSLHeaders in 'IdSSLOpenSSLHeaders.pas'; diff --git a/IndyTLSOpenSSL210.dpk b/IndyTLSOpenSSL210.dpk index 753b818..5ed7872 100644 --- a/IndyTLSOpenSSL210.dpk +++ b/IndyTLSOpenSSL210.dpk @@ -50,7 +50,6 @@ requires contains IdResourceStringsOpenSSL in 'IdResourceStringsOpenSSL.pas', - IdNTLMOpenSSL in 'IdNTLMOpenSSL.pas', IdSSLOpenSSL in 'IdSSLOpenSSL.pas', IdSSLOpenSSLHeaders in 'IdSSLOpenSSLHeaders.pas'; diff --git a/IndyTLSOpenSSL220.dpk b/IndyTLSOpenSSL220.dpk index 77599a3..897293a 100644 --- a/IndyTLSOpenSSL220.dpk +++ b/IndyTLSOpenSSL220.dpk @@ -50,7 +50,6 @@ requires contains IdResourceStringsOpenSSL in 'IdResourceStringsOpenSSL.pas', - IdNTLMOpenSSL in 'IdNTLMOpenSSL.pas', IdSSLOpenSSL in 'IdSSLOpenSSL.pas', IdSSLOpenSSLHeaders in 'IdSSLOpenSSLHeaders.pas'; diff --git a/IndyTLSOpenSSL230.dpk b/IndyTLSOpenSSL230.dpk index 079321d..1e207d3 100644 --- a/IndyTLSOpenSSL230.dpk +++ b/IndyTLSOpenSSL230.dpk @@ -50,7 +50,6 @@ requires contains IdResourceStringsOpenSSL in 'IdResourceStringsOpenSSL.pas', - IdNTLMOpenSSL in 'IdNTLMOpenSSL.pas', IdSSLOpenSSL in 'IdSSLOpenSSL.pas', IdSSLOpenSSLHeaders in 'IdSSLOpenSSLHeaders.pas'; diff --git a/IndyTLSOpenSSL240.dpk b/IndyTLSOpenSSL240.dpk index 6721431..67e0020 100644 --- a/IndyTLSOpenSSL240.dpk +++ b/IndyTLSOpenSSL240.dpk @@ -50,7 +50,6 @@ requires contains IdResourceStringsOpenSSL in 'IdResourceStringsOpenSSL.pas', - IdNTLMOpenSSL in 'IdNTLMOpenSSL.pas', IdSSLOpenSSL in 'IdSSLOpenSSL.pas', IdSSLOpenSSLHeaders in 'IdSSLOpenSSLHeaders.pas'; diff --git a/IndyTLSOpenSSL250.dpk b/IndyTLSOpenSSL250.dpk index 335edf0..1f116cb 100644 --- a/IndyTLSOpenSSL250.dpk +++ b/IndyTLSOpenSSL250.dpk @@ -50,7 +50,6 @@ requires contains IdResourceStringsOpenSSL in 'IdResourceStringsOpenSSL.pas', - IdNTLMOpenSSL in 'IdNTLMOpenSSL.pas', IdSSLOpenSSL in 'IdSSLOpenSSL.pas', IdSSLOpenSSLHeaders in 'IdSSLOpenSSLHeaders.pas'; diff --git a/IndyTLSOpenSSL260.dpk b/IndyTLSOpenSSL260.dpk index 76dc717..9bf70d3 100644 --- a/IndyTLSOpenSSL260.dpk +++ b/IndyTLSOpenSSL260.dpk @@ -50,7 +50,6 @@ requires contains IdResourceStringsOpenSSL in 'IdResourceStringsOpenSSL.pas', - IdNTLMOpenSSL in 'IdNTLMOpenSSL.pas', IdSSLOpenSSL in 'IdSSLOpenSSL.pas', IdSSLOpenSSLHeaders in 'IdSSLOpenSSLHeaders.pas'; diff --git a/IndyTLSOpenSSL270.dpk b/IndyTLSOpenSSL270.dpk index 905f23b..28aeed3 100644 --- a/IndyTLSOpenSSL270.dpk +++ b/IndyTLSOpenSSL270.dpk @@ -50,7 +50,6 @@ requires contains IdResourceStringsOpenSSL in 'IdResourceStringsOpenSSL.pas', - IdNTLMOpenSSL in 'IdNTLMOpenSSL.pas', IdSSLOpenSSL in 'IdSSLOpenSSL.pas', IdSSLOpenSSLHeaders in 'IdSSLOpenSSLHeaders.pas'; diff --git a/IndyTLSOpenSSL280.dpk b/IndyTLSOpenSSL280.dpk index 5d71361..c247403 100644 --- a/IndyTLSOpenSSL280.dpk +++ b/IndyTLSOpenSSL280.dpk @@ -50,7 +50,6 @@ requires contains IdResourceStringsOpenSSL in 'IdResourceStringsOpenSSL.pas', - IdNTLMOpenSSL in 'IdNTLMOpenSSL.pas', IdSSLOpenSSL in 'IdSSLOpenSSL.pas', IdSSLOpenSSLHeaders in 'IdSSLOpenSSLHeaders.pas'; diff --git a/IndyTLSOpenSSL290.dpk b/IndyTLSOpenSSL290.dpk index a09c0e5..6ebfd47 100644 --- a/IndyTLSOpenSSL290.dpk +++ b/IndyTLSOpenSSL290.dpk @@ -13,8 +13,8 @@ package IndyTLSOpenSSL290; {$LONGSTRINGS ON} {$OPENSTRINGS ON} {$OPTIMIZATION OFF} -{$OVERFLOWCHECKS OFF} -{$RANGECHECKS OFF} +{$OVERFLOWCHECKS ON} +{$RANGECHECKS ON} {$REFERENCEINFO ON} {$SAFEDIVIDE OFF} {$STACKFRAMES ON} @@ -24,34 +24,108 @@ package IndyTLSOpenSSL290; {$MINENUMSIZE 1} {$IMAGEBASE $400000} {$DEFINE DEBUG} -{$DEFINE VER360} +{$DEFINE HAS_PKG_RTL} {$ENDIF IMPLICITBUILDING} {$DESCRIPTION 'Indy 10 TLS - OpenSSL'} {$RUNONLY} -{$IMPLICITBUILD ON} - -// RLebeau: cannot use IdCompilerDefines.inc here! - -{$DEFINE HAS_PKG_RTL} -{$IFDEF NEXTGEN} - {$IFDEF IOS} - // there is no RTL package available for iOS - {$UNDEF HAS_PKG_RTL} - {$ENDIF} -{$ENDIF} +{$IMPLICITBUILD OFF} requires - {$IFDEF HAS_PKG_RTL} rtl, - {$ENDIF} IndySystem290, IndyCore290, IndyProtocols290; contains + IdAllOpenSSLHeaders in 'IdAllOpenSSLHeaders.pas', + IdOpenSSLHeaders_aes in 'IdOpenSSLHeaders_aes.pas', + IdOpenSSLHeaders_asn1 in 'IdOpenSSLHeaders_asn1.pas', + IdOpenSSLHeaders_asn1_mac in 'IdOpenSSLHeaders_asn1_mac.pas', + IdOpenSSLHeaders_asn1err in 'IdOpenSSLHeaders_asn1err.pas', + IdOpenSSLHeaders_asn1t in 'IdOpenSSLHeaders_asn1t.pas', + IdOpenSSLHeaders_async in 'IdOpenSSLHeaders_async.pas', + IdOpenSSLHeaders_asyncerr in 'IdOpenSSLHeaders_asyncerr.pas', + IdOpenSSLHeaders_bio in 'IdOpenSSLHeaders_bio.pas', + IdOpenSSLHeaders_bioerr in 'IdOpenSSLHeaders_bioerr.pas', + IdOpenSSLHeaders_blowfish in 'IdOpenSSLHeaders_blowfish.pas', + IdOpenSSLHeaders_bn in 'IdOpenSSLHeaders_bn.pas', + IdOpenSSLHeaders_bnerr in 'IdOpenSSLHeaders_bnerr.pas', + IdOpenSSLHeaders_buffer in 'IdOpenSSLHeaders_buffer.pas', + IdOpenSSLHeaders_buffererr in 'IdOpenSSLHeaders_buffererr.pas', + IdOpenSSLHeaders_camellia in 'IdOpenSSLHeaders_camellia.pas', + IdOpenSSLHeaders_cast in 'IdOpenSSLHeaders_cast.pas', + IdOpenSSLHeaders_cmac in 'IdOpenSSLHeaders_cmac.pas', + IdOpenSSLHeaders_cms in 'IdOpenSSLHeaders_cms.pas', + IdOpenSSLHeaders_cmserr in 'IdOpenSSLHeaders_cmserr.pas', + IdOpenSSLHeaders_comp in 'IdOpenSSLHeaders_comp.pas', + IdOpenSSLHeaders_comperr in 'IdOpenSSLHeaders_comperr.pas', + IdOpenSSLHeaders_conf in 'IdOpenSSLHeaders_conf.pas', + IdOpenSSLHeaders_conf_api in 'IdOpenSSLHeaders_conf_api.pas', + IdOpenSSLHeaders_conferr in 'IdOpenSSLHeaders_conferr.pas', + IdOpenSSLHeaders_core in 'IdOpenSSLHeaders_core.pas', + IdOpenSSLHeaders_crypto in 'IdOpenSSLHeaders_crypto.pas', + IdOpenSSLHeaders_cryptoerr in 'IdOpenSSLHeaders_cryptoerr.pas', + IdOpenSSLHeaders_cterr in 'IdOpenSSLHeaders_cterr.pas', + IdOpenSSLHeaders_des in 'IdOpenSSLHeaders_des.pas', + IdOpenSSLHeaders_dh in 'IdOpenSSLHeaders_dh.pas', + IdOpenSSLHeaders_dherr in 'IdOpenSSLHeaders_dherr.pas', + IdOpenSSLHeaders_dsa in 'IdOpenSSLHeaders_dsa.pas', + IdOpenSSLHeaders_dsaerr in 'IdOpenSSLHeaders_dsaerr.pas', + IdOpenSSLHeaders_ebcdic in 'IdOpenSSLHeaders_ebcdic.pas', + IdOpenSSLHeaders_ec in 'IdOpenSSLHeaders_ec.pas', + IdOpenSSLHeaders_ecerr in 'IdOpenSSLHeaders_ecerr.pas', + IdOpenSSLHeaders_engine in 'IdOpenSSLHeaders_engine.pas', + IdOpenSSLHeaders_engineerr in 'IdOpenSSLHeaders_engineerr.pas', + IdOpenSSLHeaders_err in 'IdOpenSSLHeaders_err.pas', + IdOpenSSLHeaders_evp in 'IdOpenSSLHeaders_evp.pas', + IdOpenSSLHeaders_evperr in 'IdOpenSSLHeaders_evperr.pas', + IdOpenSSLHeaders_hmac in 'IdOpenSSLHeaders_hmac.pas', + IdOpenSSLHeaders_idea in 'IdOpenSSLHeaders_idea.pas', + IdOpenSSLHeaders_kdferr in 'IdOpenSSLHeaders_kdferr.pas', + IdOpenSSLHeaders_obj_mac in 'IdOpenSSLHeaders_obj_mac.pas', + IdOpenSSLHeaders_objects in 'IdOpenSSLHeaders_objects.pas', + IdOpenSSLHeaders_objectserr in 'IdOpenSSLHeaders_objectserr.pas', + IdOpenSSLHeaders_ocsperr in 'IdOpenSSLHeaders_ocsperr.pas', + IdOpenSSLHeaders_ossl_typ in 'IdOpenSSLHeaders_ossl_typ.pas', + IdOpenSSLHeaders_pem in 'IdOpenSSLHeaders_pem.pas', + IdOpenSSLHeaders_pemerr in 'IdOpenSSLHeaders_pemerr.pas', + IdOpenSSLHeaders_pkcs7 in 'IdOpenSSLHeaders_pkcs7.pas', + IdOpenSSLHeaders_pkcs7err in 'IdOpenSSLHeaders_pkcs7err.pas', + IdOpenSSLHeaders_pkcs12 in 'IdOpenSSLHeaders_pkcs12.pas', + IdOpenSSLHeaders_provider in 'IdOpenSSLHeaders_provider.pas', + IdOpenSSLHeaders_rand in 'IdOpenSSLHeaders_rand.pas', + IdOpenSSLHeaders_randerr in 'IdOpenSSLHeaders_randerr.pas', + IdOpenSSLHeaders_rc4 in 'IdOpenSSLHeaders_rc4.pas', + IdOpenSSLHeaders_rsa in 'IdOpenSSLHeaders_rsa.pas', + IdOpenSSLHeaders_rsaerr in 'IdOpenSSLHeaders_rsaerr.pas', + IdOpenSSLHeaders_sha in 'IdOpenSSLHeaders_sha.pas', + IdOpenSSLHeaders_srtp in 'IdOpenSSLHeaders_srtp.pas', + IdOpenSSLHeaders_ssl in 'IdOpenSSLHeaders_ssl.pas', + IdOpenSSLHeaders_ssl3 in 'IdOpenSSLHeaders_ssl3.pas', + IdOpenSSLHeaders_sslerr in 'IdOpenSSLHeaders_sslerr.pas', + IdOpenSSLHeaders_stack in 'IdOpenSSLHeaders_stack.pas', + IdOpenSSLHeaders_storeerr in 'IdOpenSSLHeaders_storeerr.pas', + IdOpenSSLHeaders_tls1 in 'IdOpenSSLHeaders_tls1.pas', + IdOpenSSLHeaders_ts in 'IdOpenSSLHeaders_ts.pas', + IdOpenSSLHeaders_tserr in 'IdOpenSSLHeaders_tserr.pas', + IdOpenSSLHeaders_txt_db in 'IdOpenSSLHeaders_txt_db.pas', + IdOpenSSLHeaders_ui in 'IdOpenSSLHeaders_ui.pas', + IdOpenSSLHeaders_uierr in 'IdOpenSSLHeaders_uierr.pas', + IdOpenSSLHeaders_whrlpool in 'IdOpenSSLHeaders_whrlpool.pas', + IdOpenSSLHeaders_x509 in 'IdOpenSSLHeaders_x509.pas', + IdOpenSSLHeaders_x509_vfy in 'IdOpenSSLHeaders_x509_vfy.pas', + IdOpenSSLHeaders_x509err in 'IdOpenSSLHeaders_x509err.pas', + IdOpenSSLHeaders_x509v3 in 'IdOpenSSLHeaders_x509v3.pas', IdResourceStringsOpenSSL in 'IdResourceStringsOpenSSL.pas', - IdNTLMOpenSSL in 'IdNTLMOpenSSL.pas', IdSSLOpenSSL in 'IdSSLOpenSSL.pas', - IdSSLOpenSSLHeaders in 'IdSSLOpenSSLHeaders.pas'; + IdSSLOpenSSLConsts in 'IdSSLOpenSSLConsts.pas', + IdSSLOpenSSLExceptionHandlers in 'IdSSLOpenSSLExceptionHandlers.pas', + IdSSLOpenSSLLoader in 'IdSSLOpenSSLLoader.pas', + IdSSLOpenSSLHeaders in 'IdSSLOpenSSLHeaders.pas', + IdSSLOpenSSLFIPS in 'IdSSLOpenSSLFIPS.pas', + IdSSLOpenSSL_X509 in 'IdSSLOpenSSL_X509.pas', + IdSSLOpenSSL_Utils in 'IdSSLOpenSSL_Utils.pas', + IdSSLOpenSSL_Files in 'IdSSLOpenSSL_Files.pas', + IdOpenSSLHeaders_safestack in 'IdOpenSSLHeaders_safestack.pas'; end. diff --git a/IndyTLSOpenSSL40.dpk b/IndyTLSOpenSSL40.dpk index 1dc4491..b5766b9 100644 --- a/IndyTLSOpenSSL40.dpk +++ b/IndyTLSOpenSSL40.dpk @@ -27,7 +27,6 @@ requires contains IdResourceStringsOpenSSL in 'IdResourceStringsOpenSSL.pas', - IdNTLMOpenSSL in 'IdNTLMOpenSSL.pas', IdSSLOpenSSL in 'IdSSLOpenSSL.pas', IdSSLOpenSSLHeaders in 'IdSSLOpenSSLHeaders.pas'; diff --git a/IndyTLSOpenSSL50.dpk b/IndyTLSOpenSSL50.dpk index df0a51d..d88e5c3 100644 --- a/IndyTLSOpenSSL50.dpk +++ b/IndyTLSOpenSSL50.dpk @@ -27,7 +27,6 @@ requires contains IdResourceStringsOpenSSL in 'IdResourceStringsOpenSSL.pas', - IdNTLMOpenSSL in 'IdNTLMOpenSSL.pas', IdSSLOpenSSL in 'IdSSLOpenSSL.pas', IdSSLOpenSSLHeaders in 'IdSSLOpenSSLHeaders.pas'; diff --git a/IndyTLSOpenSSL60.dpk b/IndyTLSOpenSSL60.dpk index 4491d30..59a9a68 100644 --- a/IndyTLSOpenSSL60.dpk +++ b/IndyTLSOpenSSL60.dpk @@ -28,7 +28,6 @@ requires contains IdResourceStringsOpenSSL in 'IdResourceStringsOpenSSL.pas', - IdNTLMOpenSSL in 'IdNTLMOpenSSL.pas', IdSSLOpenSSL in 'IdSSLOpenSSL.pas', IdSSLOpenSSLHeaders in 'IdSSLOpenSSLHeaders.pas'; diff --git a/IndyTLSOpenSSL70.dpk b/IndyTLSOpenSSL70.dpk index 74c32fd..910e255 100644 --- a/IndyTLSOpenSSL70.dpk +++ b/IndyTLSOpenSSL70.dpk @@ -28,7 +28,6 @@ requires contains IdResourceStringsOpenSSL in 'IdResourceStringsOpenSSL.pas', - IdNTLMOpenSSL in 'IdNTLMOpenSSL.pas', IdSSLOpenSSL in 'IdSSLOpenSSL.pas', IdSSLOpenSSLHeaders in 'IdSSLOpenSSLHeaders.pas'; diff --git a/IndyTLSOpenSSL80.dpk b/IndyTLSOpenSSL80.dpk index d4b7703..a794a71 100644 --- a/IndyTLSOpenSSL80.dpk +++ b/IndyTLSOpenSSL80.dpk @@ -28,7 +28,6 @@ requires contains IdResourceStringsOpenSSL in 'IdResourceStringsOpenSSL.pas', - IdNTLMOpenSSL in 'IdNTLMOpenSSL.pas', IdSSLOpenSSL in 'IdSSLOpenSSL.pas', IdSSLOpenSSLHeaders in 'IdSSLOpenSSLHeaders.pas'; diff --git a/IndyTLSOpenSSL90.dpk b/IndyTLSOpenSSL90.dpk index 7d22b6e..0f53e68 100644 --- a/IndyTLSOpenSSL90.dpk +++ b/IndyTLSOpenSSL90.dpk @@ -29,7 +29,6 @@ requires contains IdResourceStringsOpenSSL in 'IdResourceStringsOpenSSL.pas', - IdNTLMOpenSSL in 'IdNTLMOpenSSL.pas', IdSSLOpenSSL in 'IdSSLOpenSSL.pas', IdSSLOpenSSLHeaders in 'IdSSLOpenSSLHeaders.pas'; diff --git a/dclIndyTLSOpenSSL290.dpk b/dclIndyTLSOpenSSL290.dpk index 3c6fc10..cd29aab 100644 --- a/dclIndyTLSOpenSSL290.dpk +++ b/dclIndyTLSOpenSSL290.dpk @@ -13,8 +13,8 @@ package dclIndyTLSOpenSSL290; {$LONGSTRINGS ON} {$OPENSTRINGS ON} {$OPTIMIZATION OFF} -{$OVERFLOWCHECKS OFF} -{$RANGECHECKS OFF} +{$OVERFLOWCHECKS ON} +{$RANGECHECKS ON} {$REFERENCEINFO ON} {$SAFEDIVIDE OFF} {$STACKFRAMES ON} @@ -24,7 +24,6 @@ package dclIndyTLSOpenSSL290; {$MINENUMSIZE 1} {$IMAGEBASE $400000} {$DEFINE DEBUG} -{$DEFINE VER360} {$ENDIF IMPLICITBUILDING} {$DESCRIPTION 'Indy 10 TLS Design Time - OpenSSL'} {$DESIGNONLY} @@ -33,7 +32,8 @@ package dclIndyTLSOpenSSL290; requires designide, IndyTLSOpenSSL290, - dclIndyCore290; + dclIndyCore290, + IndyProtocols290; contains IdRegisterOpenSSL in 'IdRegisterOpenSSL.pas'; diff --git a/dclIndyTLSOpenSSL290.res b/dclIndyTLSOpenSSL290.res new file mode 100644 index 0000000..a360744 Binary files /dev/null and b/dclIndyTLSOpenSSL290.res differ diff --git a/demos/FTPServer/IndyFTPServer.dpr b/demos/FTPServer/IndyFTPServer.dpr new file mode 100644 index 0000000..cbb9e6a --- /dev/null +++ b/demos/FTPServer/IndyFTPServer.dpr @@ -0,0 +1,755 @@ +program IndyFTPServer; + +{$APPTYPE CONSOLE} +{$R *.res} + +uses + IdFIPS, + IdOpenSSL_FIPS, + IdExplicitTLSClientServerBase, + IdCompressorZLib, + IdFTPCommon, + IdFTPList, + IdFTPListOutput, + IdFTPServer, + IdFTPServerContextBase, + IdStack, + IdSSL, + IdSSLOpenSSL, + System.Classes, + System.IniFiles, + System.SysUtils, + System.IOUtils, + WinApi.Windows; + +type + TFTPServerApp = class(TObject) + private + FCompressor: TIdCompressorZLib; + FIO: TIdServerIOHandlerSSLOpenSSL; + FFTPServ: TIdFTPServer; + procedure ioOnGetPasswordEx(ASender: TObject; var VPassword: String; + const AIsWrite: Boolean); + procedure ftpsrvOnHostCheck(ASender: TIdFTPServerContext; + const AHost: String; var VAccepted: Boolean); + procedure ftpsrvOnLogin(ASender: TIdFTPServerContext; + const AUsername, APassword: string; var AAuthenticated: Boolean); + procedure ftpsrvOnClient(ASender: TIdFTPServerContext; const AID: String); + procedure ftpsrvOnList(ASender: TIdFTPServerContext; + const APath: TIdFTPFileName; ADirectoryListing: TIdFTPListOutput; + const ACmd: String; const ASwitches: String); + procedure ftpsrvOnMLST(ASender: TIdFTPServerContext; + const APath: TIdFTPFileName; ADirectoryListing: TIdFTPListOutput); + procedure ftpsrvOnCWD(ASender: TIdFTPServerContext; + var VDirectory: TIdFTPFileName); + procedure ftpsrvOnMakeDirectory(ASender: TIdFTPServerContext; + var VDirectory: TIdFTPFileName); + procedure ftpsrvOnRemoveDirectory(ASender: TIdFTPServerContext; + var VDirectory: TIdFTPFileName); + procedure ftpsrvOnRenameFile(ASender: TIdFTPServerContext; + const ARenameFromFile, ARenameToFile: TIdFTPFileName); + procedure ftpsrvOnRetrieveFile(ASender: TIdFTPServerContext; + const AFileName: TIdFTPFileName; var VStream: TStream); + procedure ftpsrvOnStoreFile(ASender: TIdFTPServerContext; + const AFileName: TIdFTPFileName; AAppend: Boolean; var VStream: TStream); + procedure ftpsrvOnDeleteFile(ASender: TIdFTPServerContext; + const APathName: TIdFTPFileName); + procedure ftpsrvOnGetFileDate(ASender: TIdFTPServerContext; + const AFileName: TIdFTPFileName; var VFileDate: TDateTime); + procedure ftpsrvOnSetModFileDate(ASender: TIdFTPServerContext; + const AFileName: TIdFTPFileName; var AFileTime: TDateTime); + procedure ftpsrvOnSetCreationFileDate(ASender: TIdFTPServerContext; + const AFileName: TIdFTPFileName; var AFileTime: TDateTime); + procedure ftpsrvOnFileExistCheck(ASender: TIdFTPServerContext; + const APathName: TIdFTPFileName; var VExist: Boolean); + procedure ftpsrvOnGetFileSize(ASender: TIdFTPServerContext; + const AFileName: TIdFTPFileName; var VFileSize: Int64); + procedure ftpsrvOnSiteUTIME(ASender: TIdFTPServerContext; + const AFileName: TIdFTPFileName; var VLastAccessTime, VLastModTime, + VCreateDate: TDateTime; var VAUth: Boolean); + public + constructor Create; + destructor Destroy; override; + end; + +var + app: TFTPServerApp; + +function SetFileLastAccessDateTime(const FileName: String; + DateTime: TDateTime): Boolean; inline; +begin + Result := (FileName <> '') and (FileExists(FileName) = True); + if Result then + begin + TFile.SetLastAccessTime(FileName, DateTime); + end; +end; + +function SetFileLastModifiedDateTime(const FileName: String; + DateTime: TDateTime): Boolean; inline; +begin + Result := (FileName <> '') and (FileExists(FileName) = True); + if Result then + begin + TFile.SetLastWriteTime(FileName, DateTime); + end; +end; + +function SetFileCreationDateTime(const FileName: String; DateTime: TDateTime) + : Boolean; inline; +begin + Result := (FileName <> '') and (FileExists(FileName) = True); + if Result then + begin + TFile.SetCreationTime(FileName, DateTime); + end; +end; + +// This is necessary because FileAge does not work with directories. +function GetFileLastModifiedDateTime(const FileName: String; + var VDateTime: TDateTime): Boolean; +var + F: TSearchRec; + +begin + Result := FindFirst(FileName, faAnyFile, F) = 0; + if Result then + begin + VDateTime := F.TimeStamp; + System.SysUtils.FindClose(F); + end; +end; + +// based on https://stackoverflow.com/questions/17064672/programmatical-log-in-by-providing-credentials +function ConnectAs(const lpszUsername, lpszPassword: string): Boolean; +var + hToken: THandle; +begin + Result := LogonUser(PChar(lpszUsername), nil, PChar(lpszPassword), + LOGON32_LOGON_INTERACTIVE, LOGON32_PROVIDER_DEFAULT, hToken); + if Result then + begin + Result := ImpersonateLoggedOnUser(hToken); + end; +end; + +function FTPPathToLocalPath(const APath: String; + const AAnonymous: Boolean): String; +begin + if AAnonymous then + begin + Result := StringReplace(System.IOUtils.TPath.GetSharedDocumentsPath + '\' + + APath, '/', '\', [rfReplaceAll]); + end + else + begin + Result := StringReplace(System.IOUtils.TPath.GetDocumentsPath + '\' + APath, + '/', '\', [rfReplaceAll]); + end; + Result := StringReplace(Result, '\\', '\', [rfReplaceAll]); +end; + +procedure FileNotFound(const APathName: String); +begin + raise Exception.Create(APathName + ' not found'); +end; + +procedure PermissionDenied; +begin + raise Exception.Create('permission denied'); +end; + +{ TFTPServerApp } + +constructor TFTPServerApp.Create; +var + Lini: TIniFile; +begin + inherited Create; + // temp + if not FileExists(GetCurrentDir + '\server.ini') then + begin + + Lini := TIniFile.Create(GetCurrentDir + '\server.ini'); + try + Lini.WriteString('Certificate', 'CertificateFile', + GetCurrentDir + '\localhost.crt'); + Lini.WriteString('Certificate', 'KeyFile', + GetCurrentDir + '\localhost.key'); + Lini.WriteString('Certificate', 'RootCertFile', ''); + Lini.WriteString('Certificate', 'DH_Parameters', ''); + Lini.WriteString('Certificate', 'Password', 'testinfg'); + + Lini.WriteInteger('Server', 'PASV_Bound_Port_Minimum', 0); + Lini.WriteInteger('Server', 'PASV_Bound_Port_Maximum', 0); + + Lini.WriteInteger('Server', 'Password_Attempts', + DEF_FTP_PASSWORDATTEMPTS); + Lini.WriteInteger('Server', 'Delay_On_Failed_Password_Attempt', + DEF_FTP_INVALIDPASS_DELAY); + Lini.WriteBool('Server', 'No_PORT_Requests_To_Ports_In_Reserved_Range', + DEF_FTP_NO_RESERVED_PORTS); + Lini.WriteBool('Server', 'Do_Not_Accept_PORT_Transfers', + DEF_FTP_BLOCK_ALL_PORTS); + Lini.WriteBool('Server', 'Disable_SYST_Command', DEF_FTP_DISABLE_SYST); + Lini.WriteBool('Server', 'Disable_STAT_Command', DEF_FTP_DISABLE_STAT); + Lini.WriteBool('Server', 'Reqiore_PORT_Connection_From_Same_IP_Address', + DEF_FTP_PORT_SAME_IP); + Lini.WriteBool('Server', 'Require_PASV_Connection_From_Same_IP_Address', + DEF_FTP_PASV_SAME_IP); + Lini.WriteBool('Server', 'Permit_CCC_Clear_Command_Connection_In_TLS_FTP', + DEF_FTP_PERMIT_CCC); + + Lini.WriteBool('Server', 'Allow_Anonymous_FTP', false); + Lini.WriteBool('Server', 'Allow_Compression', True); + Lini.WriteBool('Server', 'Allow_File_Checksums', True); + Lini.WriteBool('Server', 'Requre_TLS', True); + Lini.WriteBool('Server', 'SupportXAUTH', false); + Lini.WriteBool('Server', 'Unix_Emulation', True); + finally + FreeAndNil(Lini); + end; + end; + + // temp + FIO := TIdServerIOHandlerSSLOpenSSL.Create(nil); + Lini := TIniFile.Create(GetCurrentDir + '\server.ini'); + FFTPServ := TIdFTPServer.Create(nil); + try + FFTPServ.PASVBoundPortMin := Lini.ReadInteger('Server', + 'PASV_Bound_Port_Minimum', 0); + FFTPServ.PASVBoundPortMax := Lini.ReadInteger('Server', + 'PASV_Bound_Port_Maximum', 0); + WriteLn('Default Data Port: ' + IntToStr(FFTPServ.DefaultPort)); + FIO.SSLOptions.SSLVersions := [sslvTLSv1_1, sslvTLSv1_2, sslvTLSv1_3]; + // FIO.SSLOptions.Method := sslvTLSv1_3; + FIO.SSLOptions.CertFile := Lini.ReadString('Certificate', 'CertificateFile', + GetCurrentDir + '\localhost.crt'); + FIO.SSLOptions.KeyFile := Lini.ReadString('Certificate', 'KeyFile', + GetCurrentDir + '\localhost.key'); + FIO.SSLOptions.RootCertFile := Lini.ReadString('Certificate', + 'RootCertFile', ''); + FIO.SSLOptions.DHParamsFile := Lini.ReadString('Certificate', + 'DH_Parameters', ''); + FIO.OnGetPasswordEx := Self.ioOnGetPasswordEx; + if Lini.ReadBool('Server', 'Allow_Compression', True) then + begin + FCompressor := TIdCompressorZLib.Create(nil); + FFTPServ.Compressor := FCompressor; + end + else + begin + FCompressor := nil; + end; + FFTPServ.IOHandler := FIO; + {This must be set to 0 so PASV will work properly. If left + at its default, the data port will timeout doing PASV. That + is a serious thing since some FTP clients default to PASV or + even will NOT support PORT transfers.} + FFTPServ.DefaultDataPort := 0; + if Lini.ReadBool('Server', 'Requre_TLS', True) then + begin + FFTPServ.UseTLS := utUseRequireTLS; + end + else + begin + FFTPServ.UseTLS := utUseExplicitTLS; + end; + // Make the special Unix value case-insensitive + if Lini.ReadBool('Server', 'Unix_Emulation', True) then + begin + FFTPServ.DirFormat := ftpdfUnix; + end + else + begin + FFTPServ.DirFormat := ftpdfDOS; + end; + + FFTPServ.FTPSecurityOptions.PasswordAttempts := + Lini.ReadInteger('Server', 'Password_Attempts', DEF_FTP_PASSWORDATTEMPTS); + FFTPServ.FTPSecurityOptions.InvalidPassDelay := + Lini.ReadInteger('Server', 'Delay_On_Failed_Password_Attempt', + DEF_FTP_INVALIDPASS_DELAY); + FFTPServ.FTPSecurityOptions.NoReservedRangePORT := + Lini.ReadBool('Server', 'No_PORT_Requests_To_Ports_In_Reserved_Range', + DEF_FTP_NO_RESERVED_PORTS); + FFTPServ.FTPSecurityOptions.BlockAllPORTTransfers := + Lini.ReadBool('Server', 'Do_Not_Accept_PORT_Transfers', + DEF_FTP_BLOCK_ALL_PORTS); + FFTPServ.FTPSecurityOptions.DisableSYSTCommand := + Lini.ReadBool('Server', 'Disable_SYST_Command', DEF_FTP_DISABLE_SYST); + FFTPServ.FTPSecurityOptions.DisableSTATCommand := + Lini.ReadBool('Server', 'Disable_STAT_Command', DEF_FTP_DISABLE_STAT); + FFTPServ.FTPSecurityOptions.RequirePORTFromSameIP := + Lini.ReadBool('Server', 'Reqiore_PORT_Connection_From_Same_IP_Address', + DEF_FTP_PORT_SAME_IP); + FFTPServ.FTPSecurityOptions.RequirePASVFromSameIP := + Lini.ReadBool('Server', 'Require_PASV_Connection_From_Same_IP_Address', + DEF_FTP_PASV_SAME_IP); + FFTPServ.FTPSecurityOptions.PermitCCC := + Lini.ReadBool('Server', 'Permit_CCC_Clear_Command_Connection_In_TLS_FTP', + DEF_FTP_PERMIT_CCC); + + FFTPServ.AllowAnonymousLogin := Lini.ReadBool('Server', + 'Allow_Anonymous_FTP', false); + FFTPServ.MLSDFacts := [mlsdFileCreationTime, mlsdFileLastAccessTime, + mlsdWin32Attributes, mlsdPerms]; + FFTPServ.OnHostCheck := Self.ftpsrvOnHostCheck; + FFTPServ.SupportXAUTH := Lini.ReadBool('Server', 'SupportXAUTH', false); + FFTPServ.OnUserLogin := ftpsrvOnLogin; + FFTPServ.OnClientID := ftpsrvOnClient; + FFTPServ.PathProcessing := ftppDOS; + FFTPServ.OnChangeDirectory := ftpsrvOnCWD; + FFTPServ.OnMakeDirectory := ftpsrvOnMakeDirectory; + FFTPServ.OnRemoveDirectory := ftpsrvOnRemoveDirectory; + FFTPServ.OnListDirectory := ftpsrvOnList; + FFTPServ.OnRenameFile := ftpsrvOnRenameFile; + FFTPServ.OnRetrieveFile := ftpsrvOnRetrieveFile; + FFTPServ.OnStoreFile := ftpsrvOnStoreFile; + // OnCRCFile uses the same code as OnRetrieveFile + if Lini.ReadBool('Server', 'Allow_Compression', True) then + begin + FFTPServ.OnCRCFile := ftpsrvOnRetrieveFile; + end; + FFTPServ.OnDeleteFile := Self.ftpsrvOnDeleteFile; + FFTPServ.OnGetFileDate := ftpsrvOnGetFileDate; + FFTPServ.OnFileExistCheck := ftpsrvOnFileExistCheck; + FFTPServ.OnSetModifiedTime := ftpsrvOnSetModFileDate; + FFTPServ.OnSetCreationTime := ftpsrvOnSetCreationFileDate; + FFTPServ.OnSiteUTIME := ftpsrvOnSiteUTIME; + FFTPServ.OnGetFileSize := Self.ftpsrvOnGetFileSize; + FFTPServ.OnMLST := ftpsrvOnMLST; + finally + FreeAndNil(Lini) + end; + FFTPServ.Active := True; +end; + +destructor TFTPServerApp.Destroy; +begin + FreeAndNil(FFTPServ); + FreeAndNil(FIO); + if Assigned(FCompressor) then + begin + FreeAndNil(FCompressor); + end; + inherited; +end; + +procedure TFTPServerApp.ftpsrvOnClient(ASender: TIdFTPServerContext; + const AID: String); +begin + +end; + +procedure TFTPServerApp.ftpsrvOnCWD(ASender: TIdFTPServerContext; + var VDirectory: TIdFTPFileName); +begin + if not DirectoryExists(FTPPathToLocalPath(VDirectory, + ASender.UserType = utAnonymousUser)) then + begin + FileNotFound(VDirectory); + end; +end; + +procedure TFTPServerApp.ftpsrvOnDeleteFile(ASender: TIdFTPServerContext; + const APathName: TIdFTPFileName); +begin + if ASender.UserType = utAnonymousUser then + begin + PermissionDenied; + end; + + if not System.SysUtils.DeleteFile(FTPPathToLocalPath(APathName, + ASender.UserType = utAnonymousUser)) then + begin + FileNotFound(APathName); + end; +end; + +procedure TFTPServerApp.ftpsrvOnMakeDirectory(ASender: TIdFTPServerContext; + var VDirectory: TIdFTPFileName); +begin + if ASender.UserType = utAnonymousUser then + begin + PermissionDenied; + end; + if not CreateDir(FTPPathToLocalPath(VDirectory, + ASender.UserType = utAnonymousUser)) then + begin + Raise Exception.Create('Can not create ' + VDirectory); + end; +end; + +procedure TFTPServerApp.ftpsrvOnRemoveDirectory(ASender: TIdFTPServerContext; + var VDirectory: TIdFTPFileName); +begin + if ASender.UserType = utAnonymousUser then + begin + PermissionDenied; + end; + if not System.SysUtils.RemoveDir(FTPPathToLocalPath(VDirectory, + ASender.UserType = utAnonymousUser)) then + begin + FileNotFound(VDirectory); + end; +end; + +procedure TFTPServerApp.ftpsrvOnFileExistCheck(ASender: TIdFTPServerContext; + const APathName: TIdFTPFileName; var VExist: Boolean); +begin + VExist := FileExists(FTPPathToLocalPath(APathName, + ASender.UserType = utAnonymousUser), false); +end; + +procedure TFTPServerApp.ftpsrvOnGetFileDate(ASender: TIdFTPServerContext; + const AFileName: TIdFTPFileName; var VFileDate: TDateTime); +begin + if not GetFileLastModifiedDateTime(FTPPathToLocalPath(AFileName, + ASender.UserType = utAnonymousUser), VFileDate) then + begin + FileNotFound(AFileName); + end; + +end; + +procedure TFTPServerApp.ftpsrvOnGetFileSize(ASender: TIdFTPServerContext; + const AFileName: TIdFTPFileName; var VFileSize: Int64); +var + LFileEntry: TSearchRec; +begin + if FindFirst(FTPPathToLocalPath(AFileName, + ASender.UserType = utAnonymousUser), faAnyFile, LFileEntry) = 0 then + begin + VFileSize := LFileEntry.Size; + System.SysUtils.FindClose(LFileEntry); + end + else + begin + FileNotFound(AFileName); + end; +end; + +procedure TFTPServerApp.ftpsrvOnHostCheck(ASender: TIdFTPServerContext; + const AHost: String; var VAccepted: Boolean); +begin + VAccepted := (AHost = GStack.HostName); + if not VAccepted then + begin + VAccepted := (GStack.LocalAddresses.IndexOf(AHost) > -1); + end; +end; + +procedure TSearchRecToFTPListItem(ARec: TSearchRec; + var AFTPItem: TIdFTPListOutputItem; const AAnonymous: Boolean); inline; +var + LUnixPerm: String; + LMSLTPerm: String; +begin + AFTPItem.FileName := ARec.Name; + if (ARec.Attr and faDirectory) = faDirectory then + begin + AFTPItem.ItemType := ditDirectory; + end + else + begin + AFTPItem.ItemType := ditFile; + end; + + if AAnonymous then + begin + LMSLTPerm := 'elr'; + end + else + begin + LMSLTPerm := 'acdeflmprw'; + end; + if ARec.Attr and faReadOnly = faReadOnly then + begin + LUnixPerm := 'r-'; + LMSLTPerm := StringReplace(LMSLTPerm, 'a', '', [rfReplaceAll]); + // file may be APPE'd + LMSLTPerm := StringReplace(LMSLTPerm, 'w', '', [rfReplaceAll]); + // file may be STOR'ed + LMSLTPerm := StringReplace(LMSLTPerm, 'p', '', [rfReplaceAll]); + // dir may be RMD'ed + LMSLTPerm := StringReplace(LMSLTPerm, 'm', '', [rfReplaceAll]); + // dir may be MKD'ed + LMSLTPerm := StringReplace(LMSLTPerm, 'f', '', [rfReplaceAll]); + // file or dir may be RNFR'ed + LMSLTPerm := StringReplace(LMSLTPerm, 'd', '', [rfReplaceAll]); + // dir or file may be RMD'ed + LMSLTPerm := StringReplace(LMSLTPerm, 'c', '', [rfReplaceAll]); + // dir may be STOU'ed + LMSLTPerm := StringReplace(LMSLTPerm, 'p', '', [rfReplaceAll]); + // dir may be RMD'ed + end + else + begin + if AAnonymous then + begin + LUnixPerm := 'r-'; + end + else + begin + LUnixPerm := 'rw'; + end; + end; + // x - execute bit - for directories, means that you can access it. + if (ARec.Attr and faDirectory) = faDirectory then + begin + LUnixPerm := LUnixPerm + 'x'; + LMSLTPerm := StringReplace(LMSLTPerm, 'a', '', [rfReplaceAll]); + // file may be APPE'd + LMSLTPerm := StringReplace(LMSLTPerm, 'r', '', [rfReplaceAll]); + // file may be RETR'ed + LMSLTPerm := StringReplace(LMSLTPerm, 'w', '', [rfReplaceAll]); + // file may be STOR'ed + end + else + begin + LUnixPerm := LUnixPerm + '-'; + LMSLTPerm := StringReplace(LMSLTPerm, 'e', '', [rfReplaceAll]); + // dir may be CWD'ed + LMSLTPerm := StringReplace(LMSLTPerm, 'l', '', [rfReplaceAll]); + // dir may be LIST'ed + LMSLTPerm := StringReplace(LMSLTPerm, 'm', '', [rfReplaceAll]); + // dir may be MKD'ed + LMSLTPerm := StringReplace(LMSLTPerm, 'p', '', [rfReplaceAll]); + // dir may be RMD'ed + end; + AFTPItem.MLISTPermissions := LMSLTPerm; + AFTPItem.UnixOwnerPermissions := LUnixPerm; + AFTPItem.UnixGroupPermissions := LUnixPerm; + AFTPItem.UnixOtherPermissions := LUnixPerm; + AFTPItem.ModifiedDate := ARec.TimeStamp; + AFTPItem.LastAccessDate := ARec.LastAccessTime; + AFTPItem.CreationDate := ARec.CreationTime; + AFTPItem.Size := ARec.Size; + AFTPItem.WinAttribs := ARec.Attr; +end; + +procedure TFTPServerApp.ftpsrvOnList(ASender: TIdFTPServerContext; + const APath: TIdFTPFileName; ADirectoryListing: TIdFTPListOutput; + const ACmd, ASwitches: String); +var + LFTPFile: TIdFTPListOutputItem; + LFileEntry: TSearchRec; + +begin + if FindFirst(FTPPathToLocalPath(APath + '*.*', + ASender.UserType = utAnonymousUser), faAnyFile, LFileEntry) = 0 then + begin + repeat + LFTPFile := ADirectoryListing.Add; + TSearchRecToFTPListItem(LFileEntry, LFTPFile, + ASender.UserType = utAnonymousUser); + until FindNext(LFileEntry) <> 0; + System.SysUtils.FindClose(LFileEntry); + end + else + begin + if FindFirst(FTPPathToLocalPath(APath, ASender.UserType = utAnonymousUser), + faAnyFile, LFileEntry) = 0 then + begin + LFTPFile := ADirectoryListing.Add; + TSearchRecToFTPListItem(LFileEntry, LFTPFile, + ASender.UserType = utAnonymousUser); + System.SysUtils.FindClose(LFileEntry); + end + else + begin + FileNotFound(APath); + end; + end; +end; + +procedure TFTPServerApp.ftpsrvOnMLST(ASender: TIdFTPServerContext; + const APath: TIdFTPFileName; ADirectoryListing: TIdFTPListOutput); +var + LFTPFile: TIdFTPListOutputItem; + LFileEntry: TSearchRec; +begin + // Get info about a file + if FindFirst(FTPPathToLocalPath(APath, ASender.UserType = utAnonymousUser), + faAnyFile, LFileEntry) = 0 then + begin + LFTPFile := ADirectoryListing.Add; + TSearchRecToFTPListItem(LFileEntry, LFTPFile, + ASender.UserType = utAnonymousUser); + System.SysUtils.FindClose(LFileEntry); + end + else + begin + FileNotFound(APath); + end; +end; + +procedure TFTPServerApp.ftpsrvOnRenameFile(ASender: TIdFTPServerContext; + const ARenameFromFile, ARenameToFile: TIdFTPFileName); +var + LFromFile, LToFile: String; +begin + if ASender.UserType = utAnonymousUser then + begin + PermissionDenied; + end; + LFromFile := FTPPathToLocalPath(ARenameFromFile, + ASender.UserType = utAnonymousUser); + LToFile := FTPPathToLocalPath(ARenameToFile, + ASender.UserType = utAnonymousUser); + if not RenameFile(LFromFile, LToFile) then + begin + raise Exception.Create('Can not rename ' + ARenameFromFile + ' to ' + + ARenameToFile); + end; +end; + +procedure TFTPServerApp.ftpsrvOnRetrieveFile(ASender: TIdFTPServerContext; + const AFileName: TIdFTPFileName; var VStream: TStream); +begin + try + VStream := TFileStream.Create(FTPPathToLocalPath(AFileName, + ASender.UserType = utAnonymousUser), fmOpenRead); + except + FileNotFound(AFileName); + end; +end; + +procedure TFTPServerApp.ftpsrvOnSetModFileDate(ASender: TIdFTPServerContext; + const AFileName: TIdFTPFileName; var AFileTime: TDateTime); +begin + if ASender.UserType = utAnonymousUser then + begin + PermissionDenied; + end; + if not SetFileLastModifiedDateTime(FTPPathToLocalPath(AFileName, + ASender.UserType = utAnonymousUser), DateTimeToFileDate(AFileTime)) then + begin + FileNotFound(AFileName); + end; +end; + +procedure TFTPServerApp.ftpsrvOnSiteUTIME(ASender: TIdFTPServerContext; + const AFileName: TIdFTPFileName; var VLastAccessTime, VLastModTime, + VCreateDate: TDateTime; var VAUth: Boolean); +var + LPath: String; +begin + if ASender.UserType = utAnonymousUser then + begin + PermissionDenied; + end; + LPath := FTPPathToLocalPath(AFileName, ASender.UserType = utAnonymousUser); + if VLastAccessTime <> 0 then + begin + if not SetFileLastAccessDateTime(LPath, VLastAccessTime) then + begin + FileNotFound(AFileName); + end; + end; + if VLastModTime <> 0 then + begin + if not SetFileLastModifiedDateTime(LPath, VLastModTime) then + begin + FileNotFound(AFileName); + end; + end; + if VCreateDate <> 0 then + begin + if not SetFileCreationDateTime(LPath, VCreateDate) then + begin + FileNotFound(AFileName); + end; + end; +end; + +procedure TFTPServerApp.ftpsrvOnSetCreationFileDate + (ASender: TIdFTPServerContext; const AFileName: TIdFTPFileName; + var AFileTime: TDateTime); +begin + if ASender.UserType = utAnonymousUser then + begin + PermissionDenied; + end; + if not SetFileCreationDateTime(FTPPathToLocalPath(AFileName, + ASender.UserType = utAnonymousUser), AFileTime) then + begin + FileNotFound(AFileName); + end; +end; + +procedure TFTPServerApp.ftpsrvOnStoreFile(ASender: TIdFTPServerContext; + const AFileName: TIdFTPFileName; AAppend: Boolean; var VStream: TStream); +begin + if ASender.UserType = utAnonymousUser then + begin + PermissionDenied; + end; + try + if AAppend then + begin + VStream := TFileStream.Create(FTPPathToLocalPath(AFileName, + ASender.UserType = utAnonymousUser), fmOpenReadWrite); + VStream.Seek(0, soFromEnd); + end + else + begin + VStream := TFileStream.Create(FTPPathToLocalPath(AFileName, + ASender.UserType = utAnonymousUser), fmCreate); + end; + except + raise Exception.Create('Can not upload ' + AFileName); + end; +end; + +procedure TFTPServerApp.ioOnGetPasswordEx(ASender: TObject; + var VPassword: String; const AIsWrite: Boolean); +var + Lini: TIniFile; +begin + Lini := TIniFile.Create(GetCurrentDir + '\server.ini'); + try + VPassword := Lini.ReadString('Certificate', 'Password', 'testinfg'); + finally + FreeAndNil(Lini); + end; +end; + +procedure TFTPServerApp.ftpsrvOnLogin(ASender: TIdFTPServerContext; + const AUsername, APassword: string; var AAuthenticated: Boolean); +{ var + Lini: TIniFile; } +begin + if ASender.UserType = utNormalUser then + begin + AAuthenticated := ConnectAs(AUsername, APassword); + end + else + begin + AAuthenticated := True; + end; +end; + +begin + app := nil; + if IdSSLOpenSSL.LoadOpenSSLLibrary then + begin + try + app := TFTPServerApp.Create; + WriteLn(OpenSSLVersion); + WriteLn('FTP Server App'); + except + on E: Exception do + WriteLn(E.ClassName, ': ', E.Message); + end; + ReadLn; + end + else + begin + // WriteLn(WhichFailedToLoad); + ReadLn; + end; + FreeAndNil(app); + +end. diff --git a/demos/FTPServer/IndyFTPServer.dproj b/demos/FTPServer/IndyFTPServer.dproj new file mode 100644 index 0000000..4e05c00 --- /dev/null +++ b/demos/FTPServer/IndyFTPServer.dproj @@ -0,0 +1,1207 @@ + + + {A4147FBE-2CB3-4A81-897D-584726471D8C} + 20.2 + None + True + Debug + Win32 + IndyFTPServer + 3 + Console + IndyFTPServer.dpr + + + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Cfg_1 + true + true + + + true + Base + true + + + .\$(Platform)\$(Config) + .\$(Platform)\$(Config) + false + false + false + false + false + System;Xml;Data;Datasnap;Web;Soap;$(DCC_Namespace) + IndyFTPServer + C:\msys64\home\jpmugaas\IndyTLS-OpenSSL;C:\msys64\home\jpmugaas\Indy\Indy-Indy-10.6.3.4\Lib\System;C:\msys64\home\jpmugaas\Indy\Indy-Indy-10.6.3.4\Lib\Core;C:\msys64\home\jpmugaas\Indy\Indy-Indy-10.6.3.4\Lib\Protocols;$(DCC_UnitSearchPath) + 1033 + CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments= + + + fmx;DbxCommonDriver;bindengine;FireDACCommonDriver;dbxcds;bindcompfmx;FireDACSqliteDriver;DbxClientDriver;soapmidas;fmxFireDAC;dbexpress;inet;fmxase;dbrtl;CustomIPTransport;DBXInterBaseDriver;bindcomp;FireDACCommon;RESTBackendComponents;bindcompdbx;rtl;RESTComponents;DBXSqliteDriver;dsnapxml;FireDAC;xmlrtl;tethering;dsnap;CloudService;soaprtl;soapserver;FireDACIBDriver;$(DCC_UsePackage) + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_36x36.png + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_48x48.png + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_72x72.png + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_96x96.png + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_144x144.png + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_192x192.png + $(BDS)\bin\Artwork\Android\FM_SplashImage_426x320.png + $(BDS)\bin\Artwork\Android\FM_SplashImage_470x320.png + $(BDS)\bin\Artwork\Android\FM_SplashImage_640x480.png + $(BDS)\bin\Artwork\Android\FM_SplashImage_960x720.png + true + true + $(BDS)\bin\Artwork\Android\FM_AdaptiveIcon_Monochrome.xml + $(BDS)\bin\Artwork\Android\FM_AdaptiveIcon_Foreground.xml + $(BDS)\bin\Artwork\Android\FM_AdaptiveIcon_Background.xml + $(BDS)\bin\Artwork\Android\FM_VectorizedSplash.xml + $(BDS)\bin\Artwork\Android\FM_VectorizedSplashDark.xml + $(BDS)\bin\Artwork\Android\FM_VectorizedSplashV31.xml + $(BDS)\bin\Artwork\Android\FM_VectorizedSplashV31Dark.xml + $(BDS)\bin\Artwork\Android\FM_NotificationIcon_24x24.png + $(BDS)\bin\Artwork\Android\FM_NotificationIcon_36x36.png + $(BDS)\bin\Artwork\Android\FM_NotificationIcon_48x48.png + $(BDS)\bin\Artwork\Android\FM_NotificationIcon_72x72.png + $(BDS)\bin\Artwork\Android\FM_NotificationIcon_96x96.png + false + true + $(BDS)\bin\Artwork\Android\FM_VectorizedNotificationIcon.xml + activity-1.7.2.dex.jar;annotation-experimental-1.3.0.dex.jar;annotation-jvm-1.6.0.dex.jar;annotations-13.0.dex.jar;appcompat-1.2.0.dex.jar;appcompat-resources-1.2.0.dex.jar;billing-6.0.1.dex.jar;biometric-1.1.0.dex.jar;browser-1.4.0.dex.jar;cloud-messaging.dex.jar;collection-1.1.0.dex.jar;concurrent-futures-1.1.0.dex.jar;core-1.10.1.dex.jar;core-common-2.2.0.dex.jar;core-ktx-1.10.1.dex.jar;core-runtime-2.2.0.dex.jar;cursoradapter-1.0.0.dex.jar;customview-1.0.0.dex.jar;documentfile-1.0.0.dex.jar;drawerlayout-1.0.0.dex.jar;error_prone_annotations-2.9.0.dex.jar;exifinterface-1.3.6.dex.jar;firebase-annotations-16.2.0.dex.jar;firebase-common-20.3.1.dex.jar;firebase-components-17.1.0.dex.jar;firebase-datatransport-18.1.7.dex.jar;firebase-encoders-17.0.0.dex.jar;firebase-encoders-json-18.0.0.dex.jar;firebase-encoders-proto-16.0.0.dex.jar;firebase-iid-interop-17.1.0.dex.jar;firebase-installations-17.1.3.dex.jar;firebase-installations-interop-17.1.0.dex.jar;firebase-measurement-connector-19.0.0.dex.jar;firebase-messaging-23.1.2.dex.jar;fmx.dex.jar;fragment-1.2.5.dex.jar;google-play-licensing.dex.jar;interpolator-1.0.0.dex.jar;javax.inject-1.dex.jar;kotlin-stdlib-1.8.22.dex.jar;kotlin-stdlib-common-1.8.22.dex.jar;kotlin-stdlib-jdk7-1.8.22.dex.jar;kotlin-stdlib-jdk8-1.8.22.dex.jar;kotlinx-coroutines-android-1.6.4.dex.jar;kotlinx-coroutines-core-jvm-1.6.4.dex.jar;legacy-support-core-utils-1.0.0.dex.jar;lifecycle-common-2.6.1.dex.jar;lifecycle-livedata-2.6.1.dex.jar;lifecycle-livedata-core-2.6.1.dex.jar;lifecycle-runtime-2.6.1.dex.jar;lifecycle-service-2.6.1.dex.jar;lifecycle-viewmodel-2.6.1.dex.jar;lifecycle-viewmodel-savedstate-2.6.1.dex.jar;listenablefuture-1.0.dex.jar;loader-1.0.0.dex.jar;localbroadcastmanager-1.0.0.dex.jar;okio-jvm-3.4.0.dex.jar;play-services-ads-22.2.0.dex.jar;play-services-ads-base-22.2.0.dex.jar;play-services-ads-identifier-18.0.0.dex.jar;play-services-ads-lite-22.2.0.dex.jar;play-services-appset-16.0.1.dex.jar;play-services-base-18.1.0.dex.jar;play-services-basement-18.1.0.dex.jar;play-services-cloud-messaging-17.0.1.dex.jar;play-services-location-21.0.1.dex.jar;play-services-maps-18.1.0.dex.jar;play-services-measurement-base-20.1.2.dex.jar;play-services-measurement-sdk-api-20.1.2.dex.jar;play-services-stats-17.0.2.dex.jar;play-services-tasks-18.0.2.dex.jar;print-1.0.0.dex.jar;profileinstaller-1.3.0.dex.jar;room-common-2.2.5.dex.jar;room-runtime-2.2.5.dex.jar;savedstate-1.2.1.dex.jar;sqlite-2.1.0.dex.jar;sqlite-framework-2.1.0.dex.jar;startup-runtime-1.1.1.dex.jar;tracing-1.0.0.dex.jar;transport-api-3.0.0.dex.jar;transport-backend-cct-3.1.8.dex.jar;transport-runtime-3.1.8.dex.jar;user-messaging-platform-2.0.0.dex.jar;vectordrawable-1.1.0.dex.jar;vectordrawable-animated-1.1.0.dex.jar;versionedparcelable-1.1.1.dex.jar;viewpager-1.0.0.dex.jar;work-runtime-2.7.0.dex.jar + + + fmx;DbxCommonDriver;bindengine;FireDACCommonDriver;dbxcds;bindcompfmx;FireDACSqliteDriver;DbxClientDriver;soapmidas;fmxFireDAC;dbexpress;inet;dbrtl;CustomIPTransport;DBXInterBaseDriver;bindcomp;FireDACCommon;RESTBackendComponents;bindcompdbx;rtl;RESTComponents;DBXSqliteDriver;dsnapxml;FireDAC;xmlrtl;tethering;dsnap;CloudService;soaprtl;soapserver;FireDACIBDriver;$(DCC_UsePackage) + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_36x36.png + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_48x48.png + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_72x72.png + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_96x96.png + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_144x144.png + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_192x192.png + $(BDS)\bin\Artwork\Android\FM_SplashImage_426x320.png + $(BDS)\bin\Artwork\Android\FM_SplashImage_470x320.png + $(BDS)\bin\Artwork\Android\FM_SplashImage_640x480.png + $(BDS)\bin\Artwork\Android\FM_SplashImage_960x720.png + true + true + $(BDS)\bin\Artwork\Android\FM_AdaptiveIcon_Monochrome.xml + $(BDS)\bin\Artwork\Android\FM_AdaptiveIcon_Foreground.xml + $(BDS)\bin\Artwork\Android\FM_AdaptiveIcon_Background.xml + $(BDS)\bin\Artwork\Android\FM_VectorizedSplash.xml + $(BDS)\bin\Artwork\Android\FM_VectorizedSplashDark.xml + $(BDS)\bin\Artwork\Android\FM_VectorizedSplashV31.xml + $(BDS)\bin\Artwork\Android\FM_VectorizedSplashV31Dark.xml + $(BDS)\bin\Artwork\Android\FM_NotificationIcon_24x24.png + $(BDS)\bin\Artwork\Android\FM_NotificationIcon_36x36.png + $(BDS)\bin\Artwork\Android\FM_NotificationIcon_48x48.png + $(BDS)\bin\Artwork\Android\FM_NotificationIcon_72x72.png + $(BDS)\bin\Artwork\Android\FM_NotificationIcon_96x96.png + false + true + $(BDS)\bin\Artwork\Android\FM_VectorizedNotificationIcon.xml + activity-1.7.2.dex.jar;annotation-experimental-1.3.0.dex.jar;annotation-jvm-1.6.0.dex.jar;annotations-13.0.dex.jar;appcompat-1.2.0.dex.jar;appcompat-resources-1.2.0.dex.jar;billing-6.0.1.dex.jar;biometric-1.1.0.dex.jar;browser-1.4.0.dex.jar;cloud-messaging.dex.jar;collection-1.1.0.dex.jar;concurrent-futures-1.1.0.dex.jar;core-1.10.1.dex.jar;core-common-2.2.0.dex.jar;core-ktx-1.10.1.dex.jar;core-runtime-2.2.0.dex.jar;cursoradapter-1.0.0.dex.jar;customview-1.0.0.dex.jar;documentfile-1.0.0.dex.jar;drawerlayout-1.0.0.dex.jar;error_prone_annotations-2.9.0.dex.jar;exifinterface-1.3.6.dex.jar;firebase-annotations-16.2.0.dex.jar;firebase-common-20.3.1.dex.jar;firebase-components-17.1.0.dex.jar;firebase-datatransport-18.1.7.dex.jar;firebase-encoders-17.0.0.dex.jar;firebase-encoders-json-18.0.0.dex.jar;firebase-encoders-proto-16.0.0.dex.jar;firebase-iid-interop-17.1.0.dex.jar;firebase-installations-17.1.3.dex.jar;firebase-installations-interop-17.1.0.dex.jar;firebase-measurement-connector-19.0.0.dex.jar;firebase-messaging-23.1.2.dex.jar;fmx.dex.jar;fragment-1.2.5.dex.jar;google-play-licensing.dex.jar;interpolator-1.0.0.dex.jar;javax.inject-1.dex.jar;kotlin-stdlib-1.8.22.dex.jar;kotlin-stdlib-common-1.8.22.dex.jar;kotlin-stdlib-jdk7-1.8.22.dex.jar;kotlin-stdlib-jdk8-1.8.22.dex.jar;kotlinx-coroutines-android-1.6.4.dex.jar;kotlinx-coroutines-core-jvm-1.6.4.dex.jar;legacy-support-core-utils-1.0.0.dex.jar;lifecycle-common-2.6.1.dex.jar;lifecycle-livedata-2.6.1.dex.jar;lifecycle-livedata-core-2.6.1.dex.jar;lifecycle-runtime-2.6.1.dex.jar;lifecycle-service-2.6.1.dex.jar;lifecycle-viewmodel-2.6.1.dex.jar;lifecycle-viewmodel-savedstate-2.6.1.dex.jar;listenablefuture-1.0.dex.jar;loader-1.0.0.dex.jar;localbroadcastmanager-1.0.0.dex.jar;okio-jvm-3.4.0.dex.jar;play-services-ads-22.2.0.dex.jar;play-services-ads-base-22.2.0.dex.jar;play-services-ads-identifier-18.0.0.dex.jar;play-services-ads-lite-22.2.0.dex.jar;play-services-appset-16.0.1.dex.jar;play-services-base-18.1.0.dex.jar;play-services-basement-18.1.0.dex.jar;play-services-cloud-messaging-17.0.1.dex.jar;play-services-location-21.0.1.dex.jar;play-services-maps-18.1.0.dex.jar;play-services-measurement-base-20.1.2.dex.jar;play-services-measurement-sdk-api-20.1.2.dex.jar;play-services-stats-17.0.2.dex.jar;play-services-tasks-18.0.2.dex.jar;print-1.0.0.dex.jar;profileinstaller-1.3.0.dex.jar;room-common-2.2.5.dex.jar;room-runtime-2.2.5.dex.jar;savedstate-1.2.1.dex.jar;sqlite-2.1.0.dex.jar;sqlite-framework-2.1.0.dex.jar;startup-runtime-1.1.1.dex.jar;tracing-1.0.0.dex.jar;transport-api-3.0.0.dex.jar;transport-backend-cct-3.1.8.dex.jar;transport-runtime-3.1.8.dex.jar;user-messaging-platform-2.0.0.dex.jar;vectordrawable-1.1.0.dex.jar;vectordrawable-animated-1.1.0.dex.jar;versionedparcelable-1.1.1.dex.jar;viewpager-1.0.0.dex.jar;work-runtime-2.7.0.dex.jar + + + fmx;DbxCommonDriver;bindengine;FireDACCommonDriver;dbxcds;bindcompfmx;FireDACSqliteDriver;DbxClientDriver;soapmidas;fmxFireDAC;dbexpress;inet;fmxase;dbrtl;CustomIPTransport;DBXInterBaseDriver;bindcomp;FireDACCommon;RESTBackendComponents;bindcompdbx;rtl;RESTComponents;DBXSqliteDriver;dsnapxml;FireDAC;xmlrtl;tethering;dsnap;CloudService;soaprtl;soapserver;FireDACIBDriver;$(DCC_UsePackage) + + + fmx;DbxCommonDriver;bindengine;FireDACCommonDriver;dbxcds;bindcompfmx;FireDACSqliteDriver;DbxClientDriver;soapmidas;fmxFireDAC;dbexpress;inet;fmxase;dbrtl;CustomIPTransport;DBXInterBaseDriver;bindcomp;FireDACCommon;RESTBackendComponents;bindcompdbx;rtl;RESTComponents;DBXSqliteDriver;dsnapxml;FireDAC;xmlrtl;tethering;dsnap;CloudService;soaprtl;soapserver;FireDACIBDriver;$(DCC_UsePackage) + + + fmx;DbxCommonDriver;bindengine;FireDACCommonODBC;FireDACCommonDriver;dbxcds;bindcompfmx;inetdb;FireDACSqliteDriver;DbxClientDriver;soapmidas;fmxFireDAC;dbexpress;DBXMySQLDriver;inet;fmxase;dbrtl;fmxdae;CustomIPTransport;DBXInterBaseDriver;bindcomp;FireDACCommon;RESTBackendComponents;bindcompdbx;rtl;FireDACMySQLDriver;RESTComponents;DBXSqliteDriver;dsnapxml;FireDACPgDriver;FireDAC;inetdbxpress;xmlrtl;tethering;dsnap;CloudService;fmxobj;soaprtl;soapserver;FireDACIBDriver;$(DCC_UsePackage) + true + + + fmx;DbxCommonDriver;bindengine;FireDACCommonODBC;FireDACCommonDriver;dbxcds;bindcompfmx;inetdb;FireDACSqliteDriver;DbxClientDriver;soapmidas;fmxFireDAC;dbexpress;DBXMySQLDriver;inet;fmxase;dbrtl;fmxdae;CustomIPTransport;DBXInterBaseDriver;bindcomp;FireDACCommon;RESTBackendComponents;bindcompdbx;rtl;FireDACMySQLDriver;RESTComponents;DBXSqliteDriver;dsnapxml;FireDACPgDriver;FireDAC;inetdbxpress;xmlrtl;tethering;dsnap;CloudService;fmxobj;soaprtl;soapserver;FireDACIBDriver;$(DCC_UsePackage) + true + + + vclwinx;fmx;vclie;DbxCommonDriver;bindengine;VCLRESTComponents;FireDACCommonODBC;IndyCore290;FireDACCommonDriver;appanalytics;vclx;Skia.Package.RTL;dbxcds;vcledge;bindcompvclwinx;bindcompfmx;inetdb;FireDACSqliteDriver;DbxClientDriver;soapmidas;vclactnband;fmxFireDAC;dbexpress;DBXMySQLDriver;VclSmp;inet;vcltouch;fmxase;dbrtl;Skia.Package.FMX;fmxdae;FireDACMSAccDriver;CustomIPTransport;vcldsnap;DBXInterBaseDriver;Skia.Package.VCL;vcldb;vclFireDAC;bindcomp;FireDACCommon;RESTBackendComponents;IndyProtocols290;bindcompdbx;rtl;FireDACMySQLDriver;FireDACADSDriver;RESTComponents;DBXSqliteDriver;vcl;dsnapxml;adortl;dsnapcon;vclimg;FireDACPgDriver;FireDAC;inetdbxpress;xmlrtl;tethering;bindcompvcl;dsnap;CloudService;IndySystem290;fmxobj;bindcompvclsmp;soaprtl;soapserver;FireDACIBDriver;$(DCC_UsePackage) + Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) + Debug + CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments= + 1033 + true + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png + + + vclwinx;fmx;vclie;DbxCommonDriver;bindengine;VCLRESTComponents;FireDACCommonODBC;IndyCore290;FireDACCommonDriver;appanalytics;vclx;dbxcds;vcledge;bindcompvclwinx;bindcompfmx;inetdb;FireDACSqliteDriver;DbxClientDriver;soapmidas;vclactnband;fmxFireDAC;dbexpress;DBXMySQLDriver;VclSmp;inet;vcltouch;fmxase;dbrtl;fmxdae;FireDACMSAccDriver;CustomIPTransport;vcldsnap;DBXInterBaseDriver;Skia.Package.VCL;vcldb;vclFireDAC;bindcomp;FireDACCommon;RESTBackendComponents;IndyProtocols290;bindcompdbx;rtl;FireDACMySQLDriver;FireDACADSDriver;RESTComponents;DBXSqliteDriver;vcl;dsnapxml;adortl;dsnapcon;vclimg;FireDACPgDriver;FireDAC;inetdbxpress;xmlrtl;tethering;bindcompvcl;dsnap;CloudService;IndySystem290;fmxobj;bindcompvclsmp;soaprtl;soapserver;FireDACIBDriver;$(DCC_UsePackage) + true + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png + Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;$(DCC_Namespace) + Debug + + + DEBUG;$(DCC_Define) + true + false + true + true + true + true + true + + + false + 1033 + (None) + none + + + false + RELEASE;$(DCC_Define) + 0 + 0 + + + + MainSource + + + Base + + + Cfg_1 + Base + + + Cfg_2 + Base + + + + Delphi.Personality.12 + Application + + + + IndyFTPServer.dpr + + + Microsoft Office 2000 Sample Automation Server Wrapper Components + Microsoft Office XP Sample Automation Server Wrapper Components + + + + + + true + + + + + true + + + + + true + + + + + + 1 + + + Contents\MacOS + 1 + + + 0 + + + + + res\xml + 1 + + + res\xml + 1 + + + + + library\lib\armeabi + 1 + + + library\lib\armeabi + 1 + + + + + library\lib\armeabi-v7a + 1 + + + + + library\lib\mips + 1 + + + library\lib\mips + 1 + + + + + library\lib\armeabi-v7a + 1 + + + library\lib\arm64-v8a + 1 + + + + + library\lib\armeabi-v7a + 1 + + + + + res\drawable + 1 + + + res\drawable + 1 + + + + + res\drawable-anydpi-v21 + 1 + + + res\drawable-anydpi-v21 + 1 + + + + + res\values + 1 + + + res\values + 1 + + + + + res\values-v21 + 1 + + + res\values-v21 + 1 + + + + + res\values-v31 + 1 + + + res\values-v31 + 1 + + + + + res\drawable-anydpi-v26 + 1 + + + res\drawable-anydpi-v26 + 1 + + + + + res\drawable + 1 + + + res\drawable + 1 + + + + + res\drawable + 1 + + + res\drawable + 1 + + + + + res\drawable + 1 + + + res\drawable + 1 + + + + + res\drawable-anydpi-v33 + 1 + + + res\drawable-anydpi-v33 + 1 + + + + + res\values + 1 + + + res\values + 1 + + + + + res\values-night-v21 + 1 + + + res\values-night-v21 + 1 + + + + + res\drawable + 1 + + + res\drawable + 1 + + + + + res\drawable-xxhdpi + 1 + + + res\drawable-xxhdpi + 1 + + + + + res\drawable-xxxhdpi + 1 + + + res\drawable-xxxhdpi + 1 + + + + + res\drawable-ldpi + 1 + + + res\drawable-ldpi + 1 + + + + + res\drawable-mdpi + 1 + + + res\drawable-mdpi + 1 + + + + + res\drawable-hdpi + 1 + + + res\drawable-hdpi + 1 + + + + + res\drawable-xhdpi + 1 + + + res\drawable-xhdpi + 1 + + + + + res\drawable-mdpi + 1 + + + res\drawable-mdpi + 1 + + + + + res\drawable-hdpi + 1 + + + res\drawable-hdpi + 1 + + + + + res\drawable-xhdpi + 1 + + + res\drawable-xhdpi + 1 + + + + + res\drawable-xxhdpi + 1 + + + res\drawable-xxhdpi + 1 + + + + + res\drawable-xxxhdpi + 1 + + + res\drawable-xxxhdpi + 1 + + + + + res\drawable-small + 1 + + + res\drawable-small + 1 + + + + + res\drawable-normal + 1 + + + res\drawable-normal + 1 + + + + + res\drawable-large + 1 + + + res\drawable-large + 1 + + + + + res\drawable-xlarge + 1 + + + res\drawable-xlarge + 1 + + + + + res\values + 1 + + + res\values + 1 + + + + + res\drawable-anydpi-v24 + 1 + + + res\drawable-anydpi-v24 + 1 + + + + + res\drawable + 1 + + + res\drawable + 1 + + + + + res\drawable-night-anydpi-v21 + 1 + + + res\drawable-night-anydpi-v21 + 1 + + + + + res\drawable-anydpi-v31 + 1 + + + res\drawable-anydpi-v31 + 1 + + + + + res\drawable-night-anydpi-v31 + 1 + + + res\drawable-night-anydpi-v31 + 1 + + + + + 1 + + + Contents\MacOS + 1 + + + 0 + + + + + Contents\MacOS + 1 + .framework + + + Contents\MacOS + 1 + .framework + + + Contents\MacOS + 1 + .framework + + + 0 + + + + + 1 + .dylib + + + 1 + .dylib + + + 1 + .dylib + + + Contents\MacOS + 1 + .dylib + + + Contents\MacOS + 1 + .dylib + + + Contents\MacOS + 1 + .dylib + + + 0 + .dll;.bpl + + + + + 1 + .dylib + + + 1 + .dylib + + + 1 + .dylib + + + Contents\MacOS + 1 + .dylib + + + Contents\MacOS + 1 + .dylib + + + Contents\MacOS + 1 + .dylib + + + 0 + .bpl + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + Contents\Resources\StartUp\ + 0 + + + Contents\Resources\StartUp\ + 0 + + + Contents\Resources\StartUp\ + 0 + + + 0 + + + + + 1 + + + 1 + + + + + ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF + 1 + + + ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF + 1 + + + + + ..\ + 1 + + + ..\ + 1 + + + ..\ + 1 + + + + + Contents + 1 + + + Contents + 1 + + + Contents + 1 + + + + + Contents\Resources + 1 + + + Contents\Resources + 1 + + + Contents\Resources + 1 + + + + + library\lib\armeabi-v7a + 1 + + + library\lib\arm64-v8a + 1 + + + 1 + + + 1 + + + 1 + + + 1 + + + Contents\MacOS + 1 + + + Contents\MacOS + 1 + + + Contents\MacOS + 1 + + + 0 + + + + + library\lib\armeabi-v7a + 1 + + + + + 1 + + + 1 + + + 1 + + + + + ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF + 1 + + + ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF + 1 + + + ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF + 1 + + + + + ..\ + 1 + + + ..\ + 1 + + + ..\ + 1 + + + + + 1 + + + 1 + + + 1 + + + + + ..\$(PROJECTNAME).launchscreen + 64 + + + ..\$(PROJECTNAME).launchscreen + 64 + + + + + 1 + + + 1 + + + 1 + + + + + Assets + 1 + + + Assets + 1 + + + + + Assets + 1 + + + Assets + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + + + + + + + + + + + + + False + False + False + False + False + False + False + True + True + + + 12 + + + + + diff --git a/demos/IndyFTPClient/AcceptableCerts.pas b/demos/IndyFTPClient/AcceptableCerts.pas new file mode 100644 index 0000000..933781d --- /dev/null +++ b/demos/IndyFTPClient/AcceptableCerts.pas @@ -0,0 +1,58 @@ +unit AcceptableCerts; + +interface +uses + System.Classes; + +var + GAcceptableCertificates : TStrings; + +function GetFTPSitesIniFilePath: String; + +implementation +uses IniFiles, System.IOUtils, System.SysUtils; + +function GetFTPSitesIniFilePath: String; +begin + Result := System.IOUtils.TPath.GetHomePath + '\IndyFTPClient'; + if not DirectoryExists(Result) then + begin + CreateDir(Result); + end; + Result := Result + '\acceptable_certificates.ini'; +end; + +procedure ReadAcceptableCertificates; +var Lini : TIniFile; +begin + GAcceptableCertificates := TStringList.Create; + LIni := TIniFile.Create(GetFTPSitesIniFilePath); + try + LIni.ReadSection('Acceptable_Certificates',GAcceptableCertificates); + finally + FreeAndNil(LIni); + end; + +end; + +procedure WriteAcceptableCertificates; +var Lini : TIniFile; + i : Integer; +begin + LIni := TIniFile.Create(GetFTPSitesIniFilePath); + try + for i := 0 to GAcceptableCertificates.Count -1 do begin + LIni.WriteString('Acceptable_Certificates', GAcceptableCertificates[i], ''); + end; + finally + FreeAndNil(LIni); + end; +end; + +initialization + ReadAcceptableCertificates; + +finalization + WriteAcceptableCertificates; + FreeAndNil(GAcceptableCertificates); +end. diff --git a/demos/IndyFTPClient/CertViewer.dfm b/demos/IndyFTPClient/CertViewer.dfm new file mode 100644 index 0000000..12d4e28 --- /dev/null +++ b/demos/IndyFTPClient/CertViewer.dfm @@ -0,0 +1,111 @@ +object frmCertViewer: TfrmCertViewer + Left = 0 + Top = 0 + BorderStyle = bsDialog + Caption = 'frmCertViewer' + ClientHeight = 385 + ClientWidth = 558 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clBtnText + Font.Height = -12 + Font.Name = 'Segoe UI' + Font.Style = [] + Position = poDesktopCenter + OnCreate = FormCreate + DesignSize = ( + 558 + 385) + TextHeight = 15 + object lblErrorMessage: TLabel + Left = 8 + Top = 8 + Width = 542 + Height = 74 + Anchors = [akLeft, akTop, akRight] + AutoSize = False + FocusControl = redtCertView + WordWrap = True + end + object lblAcceptThisCertificate: TLabel + Left = 8 + Top = 88 + Width = 119 + Height = 15 + Caption = 'A&ccept this certificate?' + FocusControl = redtCertView + end + object Panel2: TPanel + Left = 0 + Top = 351 + Width = 558 + Height = 34 + Align = alBottom + BevelOuter = bvNone + Font.Charset = DEFAULT_CHARSET + Font.Color = clBtnText + Font.Height = -12 + Font.Name = 'Segoe UI' + Font.Style = [] + ParentColor = True + ParentFont = False + TabOrder = 0 + DesignSize = ( + 558 + 34) + object OKBtn: TButton + Left = 397 + Top = 2 + Width = 75 + Height = 25 + Anchors = [akTop, akRight] + Caption = '&Yes' + Default = True + ModalResult = 6 + TabOrder = 0 + end + object CancelBtn: TButton + Left = 478 + Top = 2 + Width = 75 + Height = 25 + Anchors = [akTop, akRight] + Cancel = True + Caption = '&No' + ModalResult = 7 + TabOrder = 1 + end + end + object redtCertView: TRichEdit + Left = 8 + Top = 104 + Width = 542 + Height = 217 + Anchors = [akLeft, akTop, akRight, akBottom] + Font.Charset = ANSI_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = 'Lucida Console' + Font.Style = [] + Lines.Strings = ( + 'redtCertView') + ParentFont = False + ReadOnly = True + ScrollBars = ssBoth + TabOrder = 1 + WantTabs = True + WantReturns = False + WordWrap = False + end + object chkacceptOnlyOnce: TCheckBox + Left = 8 + Top = 328 + Width = 542 + Height = 17 + Anchors = [akLeft, akRight, akBottom] + Caption = '&Accept Certificate Only Once' + Checked = True + State = cbChecked + TabOrder = 2 + end +end diff --git a/demos/IndyFTPClient/CertViewer.pas b/demos/IndyFTPClient/CertViewer.pas new file mode 100644 index 0000000..9959fa7 --- /dev/null +++ b/demos/IndyFTPClient/CertViewer.pas @@ -0,0 +1,466 @@ +unit CertViewer; + +interface + +uses + Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, + System.Classes, Vcl.Graphics, + Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls, + Vcl.ComCtrls, + IdSSLOpenSSL_X509; + +type + TfrmCertViewer = class(TForm) + Panel2: TPanel; + OKBtn: TButton; + CancelBtn: TButton; + redtCertView: TRichEdit; + lblErrorMessage: TLabel; + chkacceptOnlyOnce: TCheckBox; + lblAcceptThisCertificate: TLabel; + procedure FormCreate(Sender: TObject); + private + function GetErrorBackground: TColor; + function GetErrorForeground: TColor; + procedure SetErrorBackground(const Value: TColor); + procedure SetErrorForeground(const Value: TColor); + protected + { Private declarations } + FX509: TIdX509; + FError: Integer; + FErrorForeground : TColor; + FErrorBackground : TColor; + function GetX509: TIdX509; + procedure RefreshViewer; + procedure SetX509(const Value: TIdX509); + procedure WriteErrorString(const AStr : String); + procedure WriteWarningString(const AStr : String); + procedure DumpX509Name(AX509Name: TIdX509Name); + procedure DumpX509KeyUsage(AX509: TIdX509); + procedure DumpX509ExtKeyUsage(AX509: TIdX509); + procedure SetError(const Value: Integer); + public + { Public declarations } + property X509: TIdX509 read GetX509 write SetX509; + property Error: Integer read FError write SetError; + property ErrorForeground : TColor read GetErrorForeground write SetErrorForeground; + property ErrorBackground : TColor read GetErrorBackground write SetErrorBackground; + end; + +var + frmCertViewer: TfrmCertViewer; + +implementation + +{$R *.dfm} + +uses mainform, dkgFTPConnect, IdCTypes, IniFiles, System.UITypes, + System.IOUtils, + ProgUtils, IdOpenSSLHeaders_x509, IdOpenSSLHeaders_x509_vfy; + +const + TAB1 = 32; + TAB2 = 50; + TAB3 = 65; + + { TfrmCertViewer } + +procedure TfrmCertViewer.DumpX509ExtKeyUsage(AX509: TIdX509); +var + LStr: String; + LExtKeyUsage: TIdX509ExtKeyUsage; +begin + LStr := ''; + LExtKeyUsage := FX509.ExtendedKeyUsage; + if LExtKeyUsage <> [] then + begin + // (Server, Client, SMIME, CodeSign, OCSPSign, TimeStamp, DVCS, AnyEKU); + if Server in LExtKeyUsage then + begin + LStr := LStr + ', Server'; + end; + if Client in LExtKeyUsage then + begin + LStr := LStr + ', client'; + end; + if SMIME in LExtKeyUsage then + begin + LStr := LStr + ', S/MIME'; + end; + if CodeSign in LExtKeyUsage then + begin + LStr := LStr + ', Code Signing'; + end; + if OCSPSign in LExtKeyUsage then + begin + LStr := LStr + ', OCSP Signing'; + end; + if TimeStamp in LExtKeyUsage then + begin + LStr := LStr + ', TimeStamp'; + end; + if DVCS in LExtKeyUsage then + begin + LStr := LStr + ', DVCS'; + end; + if AnyEKU in LExtKeyUsage then + begin + LStr := LStr + ', Any Extended Key Usage'; + end; + Delete(LStr, 1, 1); + LStr := Trim(LStr); + redtCertView.Lines.Add(''); + Self.redtCertView.Lines.Add(RightJustify('Extended Key Usage: ', + TAB1) + LStr); + end; +end; + +procedure TfrmCertViewer.DumpX509KeyUsage(AX509: TIdX509); +var + LKeyUsage: TIdX509KeyUsage; + LStr: String; +begin + LStr := ''; + LKeyUsage := FX509.KeyUsage; + if LKeyUsage <> [] then + begin + { + (DigitalSignature, NonRepudiation, KeyEncipherment, + DataEncipherment, KeyAgreement, CertSign, CRLSign, EncipherOnly, DecipherOnly); + } + if (DigitalSignature in LKeyUsage) then + begin + LStr := LStr + ', Digital Signature'; + end; + if (NonRepudiation in LKeyUsage) then + begin + LStr := LStr + ', Non-Repudiation'; + end; + if (KeyEncipherment in LKeyUsage) then + begin + LStr := LStr + ', Key Encipherment'; + end; + if (DataEncipherment in LKeyUsage) then + begin + LStr := LStr + ', Data Encipherment'; + end; + if (CertSign in LKeyUsage) then + begin + LStr := LStr + ', Certificate Signing'; + end; + if (CRLSign in LKeyUsage) then + begin + LStr := LStr + ', CRL Signing'; + end; + if (EncipherOnly in LKeyUsage) then + begin + LStr := LStr + ', Encipher-Only'; + end; + if (DecipherOnly in LKeyUsage) then + begin + LStr := LStr + ', Decipher Only'; + end; + Delete(LStr, 1, 1); + LStr := Trim(LStr); + redtCertView.Lines.Add(''); + Self.redtCertView.Lines.Add(RightJustify('Key Usage: ', TAB1) + LStr); + end; + +end; + +procedure TfrmCertViewer.DumpX509Name(AX509Name: TIdX509Name); +var + LStr: String; +begin + LStr := AX509Name.CommonName; + if LStr <> '' then + begin + redtCertView.Lines.Add(RightJustify('Common Name: ', TAB1) + LStr); + end; + LStr := AX509Name.Organization; + if LStr <> '' then + begin + redtCertView.Lines.Add(RightJustify('Orginization: ', TAB1) + LStr); + end; + LStr := AX509Name._Unit; + if LStr <> '' then + begin + redtCertView.Lines.Add(RightJustify('Unit: ', TAB1) + LStr); + end; + LStr := AX509Name.EMail; + if LStr <> '' then + begin + redtCertView.Lines.Add(RightJustify('E-Mail Address: ', TAB1) + LStr); + end; + LStr := AX509Name.StreetAddress; + if LStr <> '' then + begin + redtCertView.Lines.Add(RightJustify('Street Address: ', TAB1) + LStr); + end; + LStr := AX509Name.City; + if LStr <> '' then + begin + redtCertView.Lines.Add(RightJustify('City or Town: ', TAB1) + LStr); + end; + LStr := AX509Name.Providence; + if LStr <> '' then + begin + redtCertView.Lines.Add(RightJustify('State or Providence: ', TAB1) + LStr); + end; + LStr := AX509Name.Country; + if LStr <> '' then + begin + redtCertView.Lines.Add(RightJustify('Country: ', TAB1) + LStr); + end; + +end; + +procedure TfrmCertViewer.FormCreate(Sender: TObject); +var + LIni: TIniFile; +begin + LIni := TIniFile.Create(GetIniFilePath); + try + Self.redtCertView.Font.Name := LIni.ReadString('Log_Font', 'Name', + Self.redtCertView.Font.Name); + Self.redtCertView.Font.Charset := LIni.ReadInteger('Log_Font', 'CharSet', + Self.redtCertView.Font.Charset); + Self.redtCertView.Font.Size := LIni.ReadInteger('Log_Font', 'Size', + Self.redtCertView.Font.Size); + Self.redtCertView.Font.Style := + TFontStyles(Byte(LIni.ReadInteger('Log_Font', 'Style', + Byte(Self.redtCertView.Font.Style)))); + finally + FreeAndNil(LIni); + end; +end; + +function TfrmCertViewer.GetErrorBackground: TColor; +begin + Result := Self.FErrorBackground; +end; + +function TfrmCertViewer.GetErrorForeground: TColor; +begin + Result := Self.FErrorForeground; +end; + +function TfrmCertViewer.GetX509: TIdX509; +begin + Result := FX509; +end; + +procedure TfrmCertViewer.RefreshViewer; +var + LStr: String; + i: Integer; + LProxyPathLen: TIdC_LONG; +begin + redtCertView.Lines.BeginUpdate; + try + redtCertView.Lines.Clear; + if FX509.Errors.InvalidInconsistantValues then + begin + WriteErrorString('Invalid or Inconsistant Values - Reject this certificated'); + end; + if FX509.Errors.InvalidPolicy then + begin + WriteErrorString('Invalid Certificate Policy - Reject this certificated'); + end; + if FX509.Errors.UnhandledCriticalExtention then + begin + WriteErrorString('Unhandled Critical Extention - Reject this certificated'); + end; + if FX509.Warnings.IsObsoleteV1 then + begin + WriteWarningString('Certificate is Obsolete Version 1'); + end; + if FX509.Warnings.IsSelfSigned then + begin + WriteWarningString('Certificate is Self-Signed'); + end + else + begin + if FX509.Warnings.SubjectAndIssuerMatch then + begin + WriteWarningString('Subject and Issuer match - Implies self-signed'); + end; + end; + redtCertView.Lines.Add('Fingerprint: '); + redtCertView.Lines.Add(RightJustify('SHA1: ', TAB1) + + FX509.Fingerprints.SHA1AsString); + redtCertView.Lines.Add(RightJustify('SHA224: ', TAB1) + + FX509.Fingerprints.SHA224AsString); + redtCertView.Lines.Add(RightJustify('SHA256: ', TAB1) + + FX509.Fingerprints.SHA256AsString); + redtCertView.Lines.Add(RightJustify('SHA384: ', TAB1) + + FX509.Fingerprints.SHA384AsString); + redtCertView.Lines.Add(RightJustify('SHA512: ', TAB1) + + FX509.Fingerprints.SHA512AsString); + LStr := FX509.SerialNumber; + redtCertView.Lines.Add('Serial Number: ' + LStr); + redtCertView.Lines.Add(''); + redtCertView.Lines.Add('Validity Period'); + redtCertView.Lines.Add(RightJustify('Not Before: ', TAB1) + + DateTimeToStr(FX509.NotBefore)); + redtCertView.Lines.Add(RightJustify('Not After: ', TAB1) + + DateTimeToStr(FX509.NotAfter)); + redtCertView.Lines.Add(''); + redtCertView.Lines.Add('Subject'); + DumpX509Name(FX509.Subject); + redtCertView.Lines.Add(''); + + if not FX509.Warnings.SubjectAndIssuerMatch then + begin + redtCertView.Lines.Add('Issuer'); + DumpX509Name(FX509.Issuer); + end; + redtCertView.Lines.Add(''); + redtCertView.Lines.Add('Subject Public Key Info'); + redtCertView.Lines.Add(RightJustify('Alorigthm: ', TAB1) + + FX509.PublicKey.Algorithm); + LStr := X509.PublicKey.Encoding; + if LStr <> '' then + begin + redtCertView.Lines.Add(RightJustify('Encoding Size: ', TAB1) + + IntToStr(FX509.PublicKey.EncodingSize)); + redtCertView.Lines.Add(RightJustify('Encoding: ', TAB1) + + FX509.PublicKey.Encoding); + end; + redtCertView.Lines.Add(RightJustify('Bits: ', TAB1) + + IntToStr(FX509.PublicKey.Bits) + ' Bits'); + redtCertView.Lines.Add(RightJustify('Security Bits: ', TAB1) + + IntToStr(FX509.PublicKey.SecurityBits) + ' Bits'); + redtCertView.Lines.Add(RightJustify('Size: ', TAB1) + + IntToStr(FX509.PublicKey.Size)); + LStr := FX509.PublicKey.Modulus; + if LStr <> '' then + begin + redtCertView.Lines.Add(RightJustify('Modulus: ', TAB1) + LStr); + end; + redtCertView.Lines.Add(''); + redtCertView.Lines.Add('Signature'); + redtCertView.Lines.Add(RightJustify('Signature: ', TAB1) + + X509.SigInfo.Signature); + redtCertView.Lines.Add(RightJustify('Signature Algorithm: ', TAB1) + + X509.SigInfo.Algorithm); + redtCertView.Lines.Add(''); + + LStr := FX509.SubjectKeyIdentifier; + if LStr <> '' then + begin + redtCertView.Lines.Add(RightJustify('X509v3 Subject Key Identifier: ', + TAB1) + LStr); + end; + LStr := X509.AuthorityKeyID.KeyID; + if (LStr <> '') or (FX509.AuthorityKeyID.Serial <> 0) then + begin + redtCertView.Lines.Add + (RightJustify('X509v3 Authority Key Identifier: ', TAB1)); + if LStr <> '' then + begin + redtCertView.Lines.Add(RightJustify('Key ID: ', TAB2) + LStr); + end; + for i := 0 to FX509.AuthorityKeyID.IssuerCount - 1 do + begin + redtCertView.Lines.Add(RightJustify('', TAB2) + + FX509.AuthorityKeyID.Issuer[i]); + end; + if X509.AuthorityKeyID.Serial > -1 then + begin + redtCertView.Lines.Add(RightJustify('Serial: ', TAB2) + + IntToHex(FX509.AuthorityKeyID.Serial)); + end; + end; + LStr := X509.BasicConstraints; + if LStr <> '' then + begin + redtCertView.Lines.Add(RightJustify('X509v3 Basic Constraints: ', + TAB1) + LStr); + end; + if X509.AltSubjectNames.ItemsCount > -1 then + begin + redtCertView.Lines.Add(''); + redtCertView.Lines.Add(RightJustify(' Subject ALternative Name Count: ', + TAB2) + IntToStr(FX509.AltSubjectNames.ItemsCount)); + for i := 0 to FX509.AltSubjectNames.ItemsCount - 1 do + begin + redtCertView.Lines.Add(RightJustify('Subject ALternate Name ' + + IntToStr(i) + ': ', TAB1) + FX509.AltSubjectNames.Items[i]); + end; + end; + DumpX509KeyUsage(FX509); + DumpX509ExtKeyUsage(FX509); + LProxyPathLen := FX509.ProxyPathLen; + if LProxyPathLen > -1 then + begin + redtCertView.Lines.Add(''); + redtCertView.Lines.Add(RightJustify('Proxy Path Length: ', TAB1) + + IntToStr(LProxyPathLen)); + end; + redtCertView.Lines.Add(''); + redtCertView.Lines.Add('Extensions: '); + redtCertView.Lines.Add(RightJustify('Extension Count: ', TAB1) + + IntToStr(FX509.ExtensionCount)); + for i := 0 to FX509.ExtensionCount - 1 do + begin + LStr := FX509.ExtentionName[i]; + if X509.ExtentionCritical[i] then + begin + redtCertView.Lines.Add(RightJustify(LStr + ' (critical): ', TAB2) + + FX509.ExtensionValues[i]); + end + else + begin + redtCertView.Lines.Add(RightJustify(LStr + ': ', TAB2) + + FX509.ExtensionValues[i]); + end; + end; + + finally + Self.redtCertView.Lines.EndUpdate; + end; + ScrollToTop(redtCertView); + +end; + +procedure TfrmCertViewer.SetError(const Value: Integer); +begin + FError := Value; + Caption := string(X509_verify_cert_error_string(FError)); + lblErrorMessage.Caption := ProgUtils.CertErrorToStr(Value); +end; + +procedure TfrmCertViewer.SetErrorBackground(const Value: TColor); +begin + Self.FErrorBackground := Value; +end; + +procedure TfrmCertViewer.SetErrorForeground(const Value: TColor); +begin + Self.FErrorForeground := Value; +end; + +procedure TfrmCertViewer.SetX509(const Value: TIdX509); +begin + FX509 := Value; + RefreshViewer; +end; + +procedure TfrmCertViewer.WriteErrorString(const AStr: String); +begin + redtCertView.SelAttributes.Color := FErrorForeground; + redtCertView.SelAttributes.Style := [fsBold]; + redtCertView.SelAttributes.BackColor := FErrorBackground; + redtCertView.Lines.Add(AStr); +end; + +procedure TfrmCertViewer.WriteWarningString(const AStr: String); +begin + redtCertView.SelAttributes.Color := FErrorForeground; + redtCertView.SelAttributes.Style := []; + redtCertView.SelAttributes.BackColor := FErrorBackground; + redtCertView.Lines.Add(AStr); +end; + +end. diff --git a/demos/IndyFTPClient/IndyFTPClient.dpr b/demos/IndyFTPClient/IndyFTPClient.dpr new file mode 100644 index 0000000..c7adc75 --- /dev/null +++ b/demos/IndyFTPClient/IndyFTPClient.dpr @@ -0,0 +1,25 @@ +program IndyFTPClient; + +uses + Vcl.Forms, + mainform in 'mainform.pas' {frmMainForm}, + dkgFTPConnect in 'dkgFTPConnect.pas' {frmConnect}, + frmAbout in 'frmAbout.pas' {AboutBox}, + settingsdlg in 'settingsdlg.pas' {frmSettings}, + frmBookmarks in 'frmBookmarks.pas' {frmFTPSites}, + CertViewer in 'CertViewer.pas' {frmCertViewer}, + ProgUtils in 'ProgUtils.pas', + AcceptableCerts in 'AcceptableCerts.pas', + dlgFTPProxySettings in 'dlgFTPProxySettings.pas' {frmFTPProxySettings}, + dlgNATSettings in 'dlgNATSettings.pas' {frmNATSettings}, + dlgProxySettings in 'dlgProxySettings.pas' {frmProxySettings}, + frmProgress in 'frmProgress.pas' {frmFileProgress}; + +{$R *.res} + +begin + Application.Initialize; + Application.MainFormOnTaskbar := True; + Application.CreateForm(TfrmMainForm, frmMainForm); + Application.Run; +end. diff --git a/demos/IndyFTPClient/IndyFTPClient.dproj b/demos/IndyFTPClient/IndyFTPClient.dproj new file mode 100644 index 0000000..159f978 --- /dev/null +++ b/demos/IndyFTPClient/IndyFTPClient.dproj @@ -0,0 +1,1189 @@ + + + {2E9129D7-1E35-4F80-B196-D04A5C658BA7} + 20.2 + VCL + True + Debug + Win32 + IndyFTPClient + 3 + Application + IndyFTPClient.dpr + + + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Cfg_1 + true + true + + + true + Cfg_1 + true + true + + + true + Base + true + + + true + Cfg_2 + true + true + + + true + Cfg_2 + true + true + + + .\$(Platform)\$(Config) + .\$(Platform)\$(Config) + false + false + false + false + false + System;Xml;Data;Datasnap;Web;Soap;Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;$(DCC_Namespace) + $(BDS)\bin\delphi_PROJECTICON.ico + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png + IndyFTPClient + C:\msys64\home\jpmugaas\IndyTLS-OpenSSL\$(Platform)\$(Config);C:\msys64\home\jpmugaas\IndyTLS-OpenSSL;C:\msys64\home\jpmugaas\Indy\Indy-Indy-10.6.3.4\Lib\System\$(Platform)\$(Config);C:\msys64\home\jpmugaas\Indy\Indy-Indy-10.6.3.4\Lib\System;C:\msys64\home\jpmugaas\Indy\Indy-Indy-10.6.3.4\Lib\Core\$(Platform)\$(Config);C:\msys64\home\jpmugaas\Indy\Indy-Indy-10.6.3.4\Lib\Core;C:\msys64\home\jpmugaas\Indy\Indy-Indy-10.6.3.4\Lib\Protocols\$(Platform)\$(Config);C:\msys64\home\jpmugaas\Indy\Indy-Indy-10.6.3.4\Lib\Protocols;$(DCC_UnitSearchPath) + 1033 + CompanyName=Indy Pitt Crew;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=Copyright (c) 2024 Indy Pitt Crew;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments= + true + + + vclwinx;fmx;vclie;DbxCommonDriver;bindengine;VCLRESTComponents;FireDACCommonODBC;IndyCore290;FireDACCommonDriver;appanalytics;vclx;Skia.Package.RTL;dbxcds;vcledge;bindcompvclwinx;bindcompfmx;inetdb;FireDACSqliteDriver;DbxClientDriver;soapmidas;vclactnband;fmxFireDAC;dbexpress;DBXMySQLDriver;VclSmp;inet;vcltouch;fmxase;dbrtl;Skia.Package.FMX;fmxdae;FireDACMSAccDriver;CustomIPTransport;IndyTLSOpenSSL290;vcldsnap;DBXInterBaseDriver;Skia.Package.VCL;vcldb;vclFireDAC;bindcomp;FireDACCommon;RESTBackendComponents;IndyProtocols290;bindcompdbx;rtl;FireDACMySQLDriver;FireDACADSDriver;RESTComponents;DBXSqliteDriver;vcl;dsnapxml;adortl;dsnapcon;vclimg;FireDACPgDriver;FireDAC;inetdbxpress;xmlrtl;tethering;bindcompvcl;dsnap;CloudService;IndySystem290;fmxobj;bindcompvclsmp;soaprtl;soapserver;FireDACIBDriver;$(DCC_UsePackage) + Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) + Debug + CompanyName=Indy Pitt Crew;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=$(MSBuildProjectName);LegalCopyright=Copyright (c) 2024 Indy Pitt Crew;LegalTrademarks=;OriginalFilename=$(MSBuildProjectName);ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments= + $(BDS)\bin\default_app.manifest + IndyFTPClient_Icon1.ico + IndyFTPClient_44.png + none + IndyFTPClient_150.png + + + vclwinx;fmx;vclie;DbxCommonDriver;bindengine;VCLRESTComponents;FireDACCommonODBC;IndyCore290;FireDACCommonDriver;appanalytics;vclx;dbxcds;vcledge;bindcompvclwinx;bindcompfmx;inetdb;FireDACSqliteDriver;DbxClientDriver;soapmidas;vclactnband;fmxFireDAC;dbexpress;DBXMySQLDriver;VclSmp;inet;vcltouch;fmxase;dbrtl;fmxdae;FireDACMSAccDriver;CustomIPTransport;vcldsnap;DBXInterBaseDriver;Skia.Package.VCL;vcldb;vclFireDAC;bindcomp;FireDACCommon;RESTBackendComponents;IndyProtocols290;bindcompdbx;rtl;FireDACMySQLDriver;FireDACADSDriver;RESTComponents;DBXSqliteDriver;vcl;dsnapxml;adortl;dsnapcon;vclimg;FireDACPgDriver;FireDAC;inetdbxpress;xmlrtl;tethering;bindcompvcl;dsnap;CloudService;IndySystem290;fmxobj;bindcompvclsmp;soaprtl;soapserver;FireDACIBDriver;$(DCC_UsePackage) + Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;$(DCC_Namespace) + Debug + CompanyName=Indy Pitt Crew;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=$(MSBuildProjectName);LegalCopyright=Copyright (c) 2024 Indy Pitt Crew;LegalTrademarks=$(MSBuildProjectName);OriginalFilename=$(MSBuildProjectName);ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments= + $(BDS)\bin\default_app.manifest + IndyFTPClient_Icon1.ico + IndyFTPClient_44.png + IndyFTPClient_150.png + none + + + DEBUG;$(DCC_Define) + true + false + true + true + true + true + true + + + false + PerMonitorV2 + CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments= + IndyFTPClient_Icon1.ico + + + PerMonitorV2 + CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments= + + + false + RELEASE;$(DCC_Define) + 0 + 0 + + + PerMonitorV2 + CompanyName=Indy Pitt Crew;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=$(MSBuildProjectName);LegalCopyright=Copyright (c) 2024 Indy Pitt Crew;LegalTrademarks=;OriginalFilename=$(MSBuildProjectName);ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments= + IndyFTPClient_Icon1.ico + + + PerMonitorV2 + CompanyName=Indy Pitt Crew;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=$(MSBuildProjectName);LegalCopyright=Copyright (c) 2024 Indy Pitt Crew;LegalTrademarks=$(MSBuildProjectName);OriginalFilename=$(MSBuildProjectName);ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments= + IndyFTPClient_Icon1.ico + + + + MainSource + + +
frmMainForm
+
+ +
frmConnect
+
+ +
AboutBox
+
+ +
frmSettings
+
+ +
frmFTPSites
+
+ +
frmCertViewer
+
+ + + +
frmFTPProxySettings
+
+ +
frmNATSettings
+
+ +
frmProxySettings
+
+ +
frmFileProgress
+
+ + Base + + + Cfg_1 + Base + + + Cfg_2 + Base + +
+ + Delphi.Personality.12 + Application + + + + IndyFTPClient.dpr + + + Embarcadero RAD Server Edge Components + Embarcadero C++Builder Office 2000 Servers Package + Embarcadero C++Builder Office XP Servers Package + Microsoft Office 2000 Sample Automation Server Wrapper Components + Microsoft Office XP Sample Automation Server Wrapper Components + + + + + + + Assets\ + Logo150x150.png + true + + + + + Assets\ + Logo150x150.png + true + + + + + Assets\ + Logo44x44.png + true + + + + + Assets\ + Logo44x44.png + true + + + + + + IndyFTPClient.exe + true + + + + + 1 + + + Contents\MacOS + 1 + + + 0 + + + + + res\xml + 1 + + + res\xml + 1 + + + + + library\lib\armeabi + 1 + + + library\lib\armeabi + 1 + + + + + library\lib\armeabi-v7a + 1 + + + + + library\lib\mips + 1 + + + library\lib\mips + 1 + + + + + library\lib\armeabi-v7a + 1 + + + library\lib\arm64-v8a + 1 + + + + + library\lib\armeabi-v7a + 1 + + + + + res\drawable + 1 + + + res\drawable + 1 + + + + + res\drawable-anydpi-v21 + 1 + + + res\drawable-anydpi-v21 + 1 + + + + + res\values + 1 + + + res\values + 1 + + + + + res\values-v21 + 1 + + + res\values-v21 + 1 + + + + + res\values-v31 + 1 + + + res\values-v31 + 1 + + + + + res\drawable-anydpi-v26 + 1 + + + res\drawable-anydpi-v26 + 1 + + + + + res\drawable + 1 + + + res\drawable + 1 + + + + + res\drawable + 1 + + + res\drawable + 1 + + + + + res\drawable + 1 + + + res\drawable + 1 + + + + + res\drawable-anydpi-v33 + 1 + + + res\drawable-anydpi-v33 + 1 + + + + + res\values + 1 + + + res\values + 1 + + + + + res\values-night-v21 + 1 + + + res\values-night-v21 + 1 + + + + + res\drawable + 1 + + + res\drawable + 1 + + + + + res\drawable-xxhdpi + 1 + + + res\drawable-xxhdpi + 1 + + + + + res\drawable-xxxhdpi + 1 + + + res\drawable-xxxhdpi + 1 + + + + + res\drawable-ldpi + 1 + + + res\drawable-ldpi + 1 + + + + + res\drawable-mdpi + 1 + + + res\drawable-mdpi + 1 + + + + + res\drawable-hdpi + 1 + + + res\drawable-hdpi + 1 + + + + + res\drawable-xhdpi + 1 + + + res\drawable-xhdpi + 1 + + + + + res\drawable-mdpi + 1 + + + res\drawable-mdpi + 1 + + + + + res\drawable-hdpi + 1 + + + res\drawable-hdpi + 1 + + + + + res\drawable-xhdpi + 1 + + + res\drawable-xhdpi + 1 + + + + + res\drawable-xxhdpi + 1 + + + res\drawable-xxhdpi + 1 + + + + + res\drawable-xxxhdpi + 1 + + + res\drawable-xxxhdpi + 1 + + + + + res\drawable-small + 1 + + + res\drawable-small + 1 + + + + + res\drawable-normal + 1 + + + res\drawable-normal + 1 + + + + + res\drawable-large + 1 + + + res\drawable-large + 1 + + + + + res\drawable-xlarge + 1 + + + res\drawable-xlarge + 1 + + + + + res\values + 1 + + + res\values + 1 + + + + + res\drawable-anydpi-v24 + 1 + + + res\drawable-anydpi-v24 + 1 + + + + + res\drawable + 1 + + + res\drawable + 1 + + + + + res\drawable-night-anydpi-v21 + 1 + + + res\drawable-night-anydpi-v21 + 1 + + + + + res\drawable-anydpi-v31 + 1 + + + res\drawable-anydpi-v31 + 1 + + + + + res\drawable-night-anydpi-v31 + 1 + + + res\drawable-night-anydpi-v31 + 1 + + + + + 1 + + + Contents\MacOS + 1 + + + 0 + + + + + Contents\MacOS + 1 + .framework + + + Contents\MacOS + 1 + .framework + + + Contents\MacOS + 1 + .framework + + + 0 + + + + + 1 + .dylib + + + 1 + .dylib + + + 1 + .dylib + + + Contents\MacOS + 1 + .dylib + + + Contents\MacOS + 1 + .dylib + + + Contents\MacOS + 1 + .dylib + + + 0 + .dll;.bpl + + + + + 1 + .dylib + + + 1 + .dylib + + + 1 + .dylib + + + Contents\MacOS + 1 + .dylib + + + Contents\MacOS + 1 + .dylib + + + Contents\MacOS + 1 + .dylib + + + 0 + .bpl + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + Contents\Resources\StartUp\ + 0 + + + Contents\Resources\StartUp\ + 0 + + + Contents\Resources\StartUp\ + 0 + + + 0 + + + + + 1 + + + 1 + + + + + ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF + 1 + + + ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF + 1 + + + + + ..\ + 1 + + + ..\ + 1 + + + ..\ + 1 + + + + + Contents + 1 + + + Contents + 1 + + + Contents + 1 + + + + + Contents\Resources + 1 + + + Contents\Resources + 1 + + + Contents\Resources + 1 + + + + + library\lib\armeabi-v7a + 1 + + + library\lib\arm64-v8a + 1 + + + 1 + + + 1 + + + 1 + + + 1 + + + Contents\MacOS + 1 + + + Contents\MacOS + 1 + + + Contents\MacOS + 1 + + + 0 + + + + + library\lib\armeabi-v7a + 1 + + + + + 1 + + + 1 + + + 1 + + + + + ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF + 1 + + + ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF + 1 + + + ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF + 1 + + + + + ..\ + 1 + + + ..\ + 1 + + + ..\ + 1 + + + + + 1 + + + 1 + + + 1 + + + + + ..\$(PROJECTNAME).launchscreen + 64 + + + ..\$(PROJECTNAME).launchscreen + 64 + + + + + 1 + + + 1 + + + 1 + + + + + Assets + 1 + + + Assets + 1 + + + + + Assets + 1 + + + Assets + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + + + + + + + + + + + + + True + True + + + 12 + + + + +
diff --git a/demos/IndyFTPClient/IndyFTPClient.res b/demos/IndyFTPClient/IndyFTPClient.res new file mode 100644 index 0000000..2833f82 Binary files /dev/null and b/demos/IndyFTPClient/IndyFTPClient.res differ diff --git a/demos/IndyFTPClient/IndyFTPClient_150.png b/demos/IndyFTPClient/IndyFTPClient_150.png new file mode 100644 index 0000000..3e416f3 Binary files /dev/null and b/demos/IndyFTPClient/IndyFTPClient_150.png differ diff --git a/demos/IndyFTPClient/IndyFTPClient_44.png b/demos/IndyFTPClient/IndyFTPClient_44.png new file mode 100644 index 0000000..03f8ef6 Binary files /dev/null and b/demos/IndyFTPClient/IndyFTPClient_44.png differ diff --git a/demos/IndyFTPClient/IndyFTPClient_Icon.ico b/demos/IndyFTPClient/IndyFTPClient_Icon.ico new file mode 100644 index 0000000..5e18677 Binary files /dev/null and b/demos/IndyFTPClient/IndyFTPClient_Icon.ico differ diff --git a/demos/IndyFTPClient/IndyFTPClient_Icon1.ico b/demos/IndyFTPClient/IndyFTPClient_Icon1.ico new file mode 100644 index 0000000..01e871f Binary files /dev/null and b/demos/IndyFTPClient/IndyFTPClient_Icon1.ico differ diff --git a/demos/IndyFTPClient/IndyFTPClient_Icon1.png b/demos/IndyFTPClient/IndyFTPClient_Icon1.png new file mode 100644 index 0000000..c059686 Binary files /dev/null and b/demos/IndyFTPClient/IndyFTPClient_Icon1.png differ diff --git a/demos/IndyFTPClient/IndyFTPClient_Icon2.ico b/demos/IndyFTPClient/IndyFTPClient_Icon2.ico new file mode 100644 index 0000000..5e18677 Binary files /dev/null and b/demos/IndyFTPClient/IndyFTPClient_Icon2.ico differ diff --git a/demos/IndyFTPClient/ProgUtils.pas b/demos/IndyFTPClient/ProgUtils.pas new file mode 100644 index 0000000..715fc1f --- /dev/null +++ b/demos/IndyFTPClient/ProgUtils.pas @@ -0,0 +1,288 @@ +unit ProgUtils; + +interface + +uses Vcl.ComCtrls; + +procedure ScrollToTop(ARichEdit: TRichEdit); +procedure ScrollToEnd(ARichEdit: TRichEdit); +function CertErrorToStr(ACertError: Integer): String; +function RightJustify(const AText: String; ALen: Integer): String; +function IsValidIP(const AAddr: String): Boolean; +function DlgCaptionToFormCaption(const ACaption : String) : String; + +implementation + +uses WinAPI.Messages, IdIPAddress, IdOpenSSLHeaders_x509, +IdOpenSSLHeaders_x509_vfy, System.SysUtils; + +function DlgCaptionToFormCaption(const ACaption : String) : String; +var i : Integer; +begin + Result := StringReplace(ACaption,'&','',[]); + //remove trailing ... + for i := Length(Result) downto 1 do + begin + if Result[i] = '.' then + begin + Delete(Result,i,1); + end + else + begin + break; + end; + end; +end; + +function IsValidIP(const AAddr: String): Boolean; +var + LIP: TIdIPAddress; +begin + LIP := TIdIPAddress.MakeAddressObject(AAddr); + Result := Assigned(LIP); + if Result then + begin + FreeAndNil(LIP); + end; +end; + +function CertErrorToStr(ACertError: Integer): String; +begin + { Thuis is stuff from: https://linux.die.net/man/3/x509_store_ctx_get_error + I found that the error message from X509_verify_cert_error_string does not + always accurately describe the issue involved. } + case ACertError of + X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT: + begin + Result := 'the issuer certificate could not be found: this occurs if the issuer certificate of an untrusted certificate cannot be found. '; + end; + X509_V_ERR_UNABLE_TO_GET_CRL: + begin + Result := 'the Certificate Revocation List (CRL) of a certificate could not be found. '; + end; + X509_V_ERR_UNABLE_TO_DECRYPT_CERT_SIGNATURE: + begin + Result := 'The certificate signature could not be decrypted. This means that the actual signature value could not be determined rather than it not matching the expected value, this is only meaningful for RSA keys. '; + end; + X509_V_ERR_UNABLE_TO_DECRYPT_CRL_SIGNATURE: + begin + Result := 'The Certificate Revocation List (CRL) signature could not be decrypted: this means that the actual signature value could not be determined rather than it not matching the expected value. Unused. '; + end; + X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY: + begin + Result := 'The public key in the certificate SubjectPublicKeyInfo could not be read. '; + end; + X509_V_ERR_CERT_SIGNATURE_FAILURE: + begin + Result := 'The signature of the certificate is invalid. '; + end; + X509_V_ERR_CRL_SIGNATURE_FAILURE: + begin + Result := 'The signature of the Certificate Revocation List (CRL) is invalid. ' + end; + X509_V_ERR_CERT_NOT_YET_VALID: + begin + Result := 'The certificate is not yet valid: the notBefore date is after the current time. '; + end; + X509_V_ERR_CERT_HAS_EXPIRED: + begin + Result := 'The certificate has expired: that is the notAfter date is before the current time.' + end; + X509_V_ERR_CRL_NOT_YET_VALID: + begin + Result := 'The Certificate Revocation List (CRL) is not yet valid. '; + end; + X509_V_ERR_CRL_HAS_EXPIRED: + begin + Result := 'The Certificate Revocation List (CRL) has expired. '; + end; + X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD: + begin + Result := 'The certificate notBefore field contains an invalid time. '; + end; + X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD: + begin + Result := 'The certificate notAfter field contains an invalid time.'; + end; + X509_V_ERR_ERROR_IN_CRL_LAST_UPDATE_FIELD: + begin + Result := 'The Certificate Revocation List (CRL) lastUpdate field contains an invalid time.'; + end; + X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD: + begin + Result := 'The Certificate Revocation List (CRL) nextUpdate field contains an invalid time.'; + end; + X509_V_ERR_OUT_OF_MEM: + begin + Result := 'An error occurred trying to allocate memory. This should never happen. '; + end; + + X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT: + begin + Result := 'The passed certificate is self signed and the same certificate cannot be found in the list of trusted certificates. '; + end; + X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN: + begin + Result := 'The certificate chain could be built up using the untrusted certificates but the root could not be found locally. '; + end; + X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY: + begin + Result := 'The issuer certificate of a locally looked up certificate could not be found. This normally means the list of trusted certificates is not complete. '; + end; + X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE: + begin + Result := 'No signatures could be verified because the chain contains only one certificate and it is not self signed. '; + end; + X509_V_ERR_CERT_CHAIN_TOO_LONG: + begin + Result := 'The certificate chain length is greater than the supplied maximum depth. Unused. '; + end; + X509_V_ERR_CERT_REVOKED: + begin + Result := 'The certificate has been revoked.'; + end; + X509_V_ERR_INVALID_CA: + begin + Result := 'A Certificate Authority (CA) certificate is invalid. Either it is not a CA or its extensions are not consistent with the supplied purpose.'; + end; + X509_V_ERR_PATH_LENGTH_EXCEEDED: + begin + Result := 'The basicConstraints pathlength parameter has been exceeded. '; + end; + X509_V_ERR_INVALID_PURPOSE: + begin + Result := 'The supplied certificate cannot be used for the specified purpose. '; + end; + X509_V_ERR_CERT_UNTRUSTED: + begin + Result := 'The root Certificate Authority (CA) is not marked as trusted for the specified purpose. '; + end; + X509_V_ERR_CERT_REJECTED: + begin + Result := 'The root Certificate Authority (CA) is marked to reject the specified purpose. '; + end; + X509_V_ERR_SUBJECT_ISSUER_MISMATCH: + begin + Result := 'The current candidate issuer certificate was rejected because its subject name did not match the issuer name of the current certificate. This is only set if issuer check debugging is enabled it is used for status notification and is not in itself an error. '; + end; + X509_V_ERR_AKID_SKID_MISMATCH: + begin + Result := 'The current candidate issuer certificate was rejected because its subject key identifier was present and did not match the authority key identifier current certificate. This is only set if issuer check debugging is enabled it is used for status notification and is not in itself an error. '; + end; + X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH: + begin + Result := 'The current candidate issuer certificate was rejected because its issuer name and serial number was present and did not match the authority key identifier of the current certificate. This is only set if issuer check debugging is enabled it is used for status notification and is not in itself an error. '; + end; + X509_V_ERR_KEYUSAGE_NO_CERTSIGN: + begin + Result := 'The current candidate issuer certificate was rejected because its keyUsage extension does not permit certificate signing. This is only set if issuer check debugging is enabled it is used for status notification and is not in itself an error. '; + end; + X509_V_ERR_INVALID_EXTENSION: + begin + Result := 'A certificate extension had an invalid value (for example an incorrect encoding) or some value inconsistent with other extensions. '; + end; + X509_V_ERR_INVALID_POLICY_EXTENSION: + begin + Result := 'A certificate policies extension had an invalid value (for example an incorrect encoding) or some value inconsistent with other extensions. This error only occurs if policy processing is enabled. '; + end; + X509_V_ERR_NO_EXPLICIT_POLICY: + begin + Result := 'The verification flags were set to require and explicit policy but none was present. '; + end; + X509_V_ERR_DIFFERENT_CRL_SCOPE: + begin + Result := 'The only Certificate Revocation Lists (CRLs) that could be found did not match the scope of the certificate.'; + end; + X509_V_ERR_UNSUPPORTED_EXTENSION_FEATURE: + begin + Result := 'Some feature of a certificate extension is not supported. Unused. '; + end; + X509_V_ERR_PERMITTED_VIOLATION: + begin + Result := 'A name constraint violation occured in the permitted subtrees. '; + end; + X509_V_ERR_EXCLUDED_VIOLATION: + begin + Result := 'A name constraint violation occured in the excluded subtrees. '; + end; + X509_V_ERR_SUBTREE_MINMAX: + begin + Result := 'A certificate name constraints extension included a minimum or maximum field: this is not supported.'; + end; + X509_V_ERR_UNSUPPORTED_CONSTRAINT_TYPE: + begin + Result := 'An unsupported name constraint type was encountered. OpenSSL currently only supports directory name, DNS name, email and URI types. '; + end; + X509_V_ERR_UNSUPPORTED_CONSTRAINT_SYNTAX: + begin + Result := 'The format of the name constraint is not recognised: for example an email address format of a form not mentioned in RFC3280 . This could be caused by a garbage extension or some new feature not currently supported.'; + end; + X509_V_ERR_CRL_PATH_VALIDATION_ERROR: + begin + Result := 'An error occured when attempting to verify the Certificate Revocation List (CRL) path. This error can only happen if extended CRL checking is enabled.'; + end; + X509_V_ERR_APPLICATION_VERIFICATION: + begin + Result := 'An application specific error. This will never be returned unless explicitly set by an application. '; + end + else + Result := string(X509_verify_cert_error_string(ACertError)); + + end; +end; + +function RightJustify(const AText: String; ALen: Integer): String; +var + i: Integer; +begin + Result := ''; + if ALen > Length(AText) then + begin + for i := 0 to ALen - Length(AText) do + begin + Result := Result + ' '; + end; + Result := Result + AText; + end + else + begin + Result := AText; + end; +end; + +procedure ScrollToEnd(ARichEdit: TRichEdit); +var + isSelectionHidden: Boolean; +begin + with ARichEdit do + begin + SelStart := Perform(WinAPI.Messages.EM_LINEINDEX, Lines.Count, 0); + // Set caret at end + isSelectionHidden := HideSelection; + try + HideSelection := False; + Perform(WinAPI.Messages.EM_SCROLLCARET, 0, 0); // Scroll to caret + finally + HideSelection := isSelectionHidden; + end; + end; +end; + +procedure ScrollToTop(ARichEdit: TRichEdit); +var + isSelectionHidden: Boolean; +begin + with ARichEdit do + begin + SelStart := Perform(WinAPI.Messages.EM_LINEINDEX, 0, 0); // Set caret at end + isSelectionHidden := HideSelection; + try + HideSelection := False; + Perform(WinAPI.Messages.EM_SCROLLCARET, 0, 0); // Scroll to caret + finally + HideSelection := isSelectionHidden; + end; + end; +end; + +end. diff --git a/demos/IndyFTPClient/dkgFTPConnect.dfm b/demos/IndyFTPClient/dkgFTPConnect.dfm new file mode 100644 index 0000000..d145800 --- /dev/null +++ b/demos/IndyFTPClient/dkgFTPConnect.dfm @@ -0,0 +1,590 @@ +object frmConnect: TfrmConnect + Left = 195 + Top = 108 + BorderStyle = bsDialog + Caption = 'Tabbed Notebook Dialog' + ClientHeight = 300 + ClientWidth = 427 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clBtnText + Font.Height = -12 + Font.Name = 'Segoe UI' + Font.Style = [] + Position = poScreenCenter + TextHeight = 15 + object Panel1: TPanel + Left = 0 + Top = 0 + Width = 427 + Height = 266 + Align = alClient + BevelOuter = bvNone + BorderWidth = 5 + ParentColor = True + TabOrder = 0 + object PageControl1: TPageControl + Left = 5 + Top = 5 + Width = 417 + Height = 256 + ActivePage = TabSheet1 + Align = alClient + Images = VirtualImageList1 + TabOrder = 0 + object TabSheet1: TTabSheet + Caption = 'C&onnection' + ImageName = 'libre-gui-server' + DesignSize = ( + 409 + 226) + object lblHost: TLabel + Left = 62 + Top = 53 + Width = 28 + Height = 15 + Caption = '&Host:' + FocusControl = edtHostname + end + object lblUsername: TLabel + Left = 31 + Top = 127 + Width = 59 + Height = 15 + Caption = '&User name:' + FocusControl = edtUsername + end + object lblPassword: TLabel + Left = 37 + Top = 166 + Width = 53 + Height = 15 + Caption = '&Password:' + FocusControl = edtPassword + end + object lblProfileName: TLabel + Left = 18 + Top = 16 + Width = 72 + Height = 15 + Caption = 'P&rofile Name:' + end + object lblConnectionType: TLabel + Left = 40 + Top = 201 + Width = 48 + Height = 15 + Caption = 'Pro&tocol:' + FocusControl = cboConnectionType + end + object edtHostname: TEdit + Left = 96 + Top = 50 + Width = 301 + Height = 23 + Anchors = [akLeft, akTop, akRight] + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = 'Segoe UI' + Font.Style = [] + ParentFont = False + TabOrder = 1 + OnChange = edtHostnameChange + end + object chkAnonymousFTP: TCheckBox + Left = 96 + Top = 87 + Width = 185 + Height = 17 + Anchors = [akLeft, akTop, akRight] + Caption = '&Anonymous FTP' + TabOrder = 2 + OnClick = chkAnonymousFTPClick + end + object edtUsername: TEdit + Left = 96 + Top = 124 + Width = 301 + Height = 23 + Anchors = [akLeft, akTop, akRight] + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = 'Segoe UI' + Font.Style = [] + ParentFont = False + TabOrder = 3 + OnChange = edtUsernameChange + end + object edtPassword: TEdit + Left = 96 + Top = 161 + Width = 301 + Height = 23 + Anchors = [akLeft, akTop, akRight] + PasswordChar = '*' + TabOrder = 4 + OnChange = edtPasswordChange + end + object cboConnectionType: TComboBox + Left = 96 + Top = 198 + Width = 301 + Height = 23 + Style = csDropDownList + Anchors = [akLeft, akTop, akRight] + TabOrder = 5 + OnChange = cboConnectionTypeChange + Items.Strings = ( + 'Unencrypted FTP Connection' + 'Use Explicit FTP TLS (FTPS) if Available' + 'Require Explicit FTP TLS (FTPS)' + 'Implicit TLS FTP Connection (FTPS)') + end + object edtProfileName: TEdit + Left = 96 + Top = 13 + Width = 301 + Height = 23 + TabOrder = 0 + OnChange = edtProfileNameChange + end + end + object TabSheet3: TTabSheet + Caption = 'SSL C&ertificate' + ImageIndex = 3 + ImageName = 'libre-gui-certificate' + DesignSize = ( + 409 + 226) + object lblPrivateKeyFile: TLabel + Left = 29 + Top = 16 + Width = 61 + Height = 15 + Caption = 'Private &Key:' + end + object lblPublicKey: TLabel + Left = 29 + Top = 46 + Width = 58 + Height = 15 + Caption = 'P&ublic Key:' + end + object spdbtnPrivateKeyFile: TSpeedButton + Left = 368 + Top = 16 + Width = 23 + Height = 22 + Anchors = [akTop] + ImageIndex = 2 + ImageName = 'libre-gui-key' + Images = VirtualImageList1 + OnClick = spdbtnPrivateKeyFileClick + end + object spdbtnPublicKey: TSpeedButton + Left = 368 + Top = 45 + Width = 23 + Height = 22 + Anchors = [akTop, akRight] + ImageIndex = 2 + ImageName = 'libre-gui-key' + Images = VirtualImageList1 + OnClick = spdbtnPublicKeyClick + end + object spdbtnCAKey: TSpeedButton + Left = 368 + Top = 75 + Width = 23 + Height = 22 + Anchors = [akTop, akRight] + ImageIndex = 2 + ImageName = 'libre-gui-key' + Images = VirtualImageList1 + OnClick = spdbtnCAKeyClick + end + object lblCAKey: TLabel + Left = 41 + Top = 76 + Width = 41 + Height = 15 + Caption = 'CA Key:' + end + object edtPublicKey: TEdit + Left = 96 + Top = 43 + Width = 265 + Height = 23 + Anchors = [akLeft, akTop, akRight] + AutoSelect = False + TabOrder = 1 + end + object edtPrivateKeyFile: TEdit + Left = 96 + Top = 13 + Width = 265 + Height = 23 + Anchors = [akLeft, akTop, akRight] + AutoSelect = False + TabOrder = 0 + end + object edtCAKey: TEdit + Left = 96 + Top = 73 + Width = 265 + Height = 23 + Anchors = [akLeft, akTop, akRight] + AutoSelect = False + TabOrder = 2 + end + end + object TabSheet2: TTabSheet + Caption = '&Advanced' + ImageIndex = 1 + ImageName = 'libre-gui-idea' + DesignSize = ( + 409 + 226) + object lblTransferType: TLabel + Left = 15 + Top = 45 + Width = 71 + Height = 15 + Caption = '&Transfer Type:' + FocusControl = cboTransferTypes + end + object lblAccount: TLabel + Left = 38 + Top = 16 + Width = 48 + Height = 15 + Caption = 'A&ccount:' + end + object lblPort: TLabel + Left = 61 + Top = 75 + Width = 25 + Height = 15 + Caption = 'Po&rt:' + end + object cboTransferTypes: TComboBox + Left = 96 + Top = 42 + Width = 301 + Height = 23 + Style = csDropDownList + Anchors = [akLeft, akTop, akRight] + ItemIndex = 0 + TabOrder = 1 + Text = 'Use Default Setting' + Items.Strings = ( + 'Use Default Setting' + 'Use PASV Transfers' + 'Use PORT Transfers') + end + object edtAccount: TEdit + Left = 96 + Top = 13 + Width = 301 + Height = 23 + TabOrder = 0 + end + object spnedtPort: TSpinEdit + Left = 96 + Top = 72 + Width = 121 + Height = 24 + MaxValue = 65535 + MinValue = 1 + TabOrder = 2 + Value = 21 + end + end + end + end + object Panel2: TPanel + Left = 0 + Top = 266 + Width = 427 + Height = 34 + Align = alBottom + BevelOuter = bvNone + Font.Charset = DEFAULT_CHARSET + Font.Color = clBtnText + Font.Height = -12 + Font.Name = 'Segoe UI' + Font.Style = [] + ParentColor = True + ParentFont = False + TabOrder = 1 + object OKBtn: TButton + Left = 266 + Top = 2 + Width = 75 + Height = 25 + Caption = 'OK' + Default = True + Enabled = False + ModalResult = 1 + TabOrder = 0 + end + object CancelBtn: TButton + Left = 347 + Top = 2 + Width = 75 + Height = 25 + Cancel = True + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 1 + end + end + object ImageCollection1: TImageCollection + Images = < + item + Name = 'libre-gui-server' + SourceImages = < + item + Image.Data = { + 89504E470D0A1A0A0000000D494844520000004900000049080600000071730B + DC000000017352474200AECE1CE90000000467414D410000B18F0BFC61050000 + 019F49444154785EED9AB151C4301405CF544009944009500947298444B44009 + 846447098494404807E6FD913CD8927C3C3B3B7B77E68DE591A21D7D49A773D7 + F7FD01CE73959F7006241920C90049064832409201920C9064802403241920C9 + 0049064832409241F3AAA4EBBA5B3D5ED2DBEE789693F7DC4E84A432E22EBA76 + 9A63E98372335823E97E269FCA3629A75644CC965B397688388DC75D7028B735 + 20C90049064832983B4CC6C21D0B718BA7FC2C79506E52F3A2799493D7DC4E8C + 57F12182C3E428949B01BFDD6AAADF6E7C0B6040B919CC95DBB51E51727BE44B + 4EBE733B1192CA0876B75128370324192C96A4E917EB5815757DA411DB839964 + 802403241920C90049068B25E9347E6A455DDB3DA16BFBAE2238718F42B919C4 + 413037FF50F9C435EC31BDED8E373999FCD1DA940453283703CAADA62AB7C92A + 3E44B0BB8D42B919AC91145722ADFC28DBA49C5A11315B6EE5D821824F6FF60C + 920C906480240324192C96A4D378DF8ABA6247DC24CC24032419705562C04C32 + 409201920C9064802403241920C90049064832409201920C906480A47F391C7E + 01A438EB56B1D6B1570000000049454E44AE426082} + end> + end + item + Name = 'libre-gui-idea' + SourceImages = < + item + Image.Data = { + 89504E470D0A1A0A0000000D494844520000004900000049080600000071730B + DC000000017352474200AECE1CE90000000467414D410000B18F0BFC61050000 + 099149444154785EED9C5D6C1C5715C7CFBDE3CF5D3BB11D9C38A86EDC3A6E0A + A8515A48D352040EAA4A438B7000A90912E036AD4878A1F4A5AA8414221EA015 + 2295408DA536A92950125E62D48AA44894F4A1E08A42230517306D70A334719A + 90C4B177BDFE98B99C73F76CB2DE7A67CE8C6777FDE09F64EFBD779DDDB9FF39 + F77CDC998932C6C012FE687E5DC2872591042C8924604924014B2209A85C749B + 78AE1BB4EEC66FDF84BD3A00D3A640DD9C7D330B1EDB082835426D05F01A8E1C + 87847314A03763FFA04C9451A4FE3A33E1F680565FC0C9F6A0204DFC4628F078 + 3328DC001EF82B30E30C4053EF657EAB64945EA4CBFD4DA6C67D1C0C3CAA9442 + 8B89173CFC3E057A0F247B477928764A2812598EB713B4D91DD56AA49075E109 + 7812A6F5D3A5B0ACD28894DEDF831FBB170FBC8347CA820143023DA1123BFAB2 + 23F110BF48E9033FC0DFBBB39DCA80333AA812FAC1B81C7C7C2291EFA9F69E57 + 0A7A78A4A2E0AC8E2BADB7425DAF8D8E0B211E9132FD1DC6F30E6398DEC0238B + 025C7EE8CCBDAD2AF1C8200F4562E122A5FADB0CB87F29B7FF9182F3CB28F0EE + 84E423C77928340B14092358CAFB132EB13B7820322673116026CD3DA63A01AA + AE853BD1C1398E287050A86869C2824432A903FB50A09DDC0DC74C0ABC0B6F83 + 197B0F3F8756C52CBF5180AE02956C03D5B01A544B17A8C44A7E231C38CD4195 + D49BA338F3C8229989038F2A0D7BB92BC6A43F0073E60DF02EBDCB23E150CBD7 + 805E759B7D0D0B4EB54F251FDAC55D31D1444A3DBB0194F316F764B853E09D19 + 046F34DC3F2B866ABC0E9CCE2DB824933C22C56C85C48E01EE8888B40B60C009 + 950791BF71877E1D9B4084193F0DB3275EB0CB350C06141E7B7FA8F228BC4868 + 456172219A84FBF621305357782446D03ADDE1C3E09DFD2B0F0443698A2D9742 + 105A24B4A27DDC0C84CEB6FBCE4B7632A5C43BFDBA0D0262B4793C8C35851309 + 6B3269B827CB71FF8302158B5A31E3BDF7AA78E961C1DD16C69A428984EBF9DB + DC0CC47BE7E5925BD01CF064B8FFFD83FC3B95F92EB7020921129AA731DDDCF1 + 851C3485FAB243B917465009542198F4B3A2552116897615459B6614EA47DFE4 + 4EF9F13E38213E419885DFCB4D5FE49664B75D83F1CEA303C5335A3170D999D1 + BF71C71F2C801FE0A62F429128121851D837E74F70AB72D86C5E1030EC85874C + 7F60612E13691C3A245BB014F26DA12A848A5767ED97ECCFBC85AC530B7ACDE7 + C1B9F96BA03FF2711E14800289CB1ED70DF4B33291D46C1BB77C311367B9158C + 5EBD119C4F7C1D5473A7FDA1368DE5A0DAACEA966F825EB9DE9620FA867BC0B9 + 69ABBC0C193BC98D2054E0DC842209F78A262F70A338D67A3EB60DF47577E1B7 + 57F128826D1AA3F79CCE2FCE2B484E3849716B52E7B9E58FD16615378B22F449 + C16A1366F212B7E6C70A44D6D370EDE32801CCCF96E93DD57213F7C83A47B361 + 3DE76370099280F956371F461A3C4C4C962451DBE2FA6FD5580BC8B31ECA926D + ED854920BD16464512C7FDE741F0DEC7D7A117E7D47FB4047DA1A4529658C6B4 + DC4C3CD7CDBC8BC3730E3C7FA2645154D5DB3A2C4F9CABD43682AA5DC61DFCAC + 0B43DC2A8E991588644C4CD12D2ED052F2EB395A567AD5ADB66DA144142B7A12 + 8796590EBB4CD14FE5F0CE61464F8207A0B4C32D3F54E096AE482405106ED3C6 + 074A13C85A72E8EB3FE7BF74280DE8BADFBE12D6879D7ACDB67DA1652D8B84F1 + 8894BD3423A03AC10D7FC812F29DB5D3857952DE52CA872C289743D99D85777F + 6FDB41A89AF93F6F1E62B32491486A99FCAA92DDDAC82D29B2164C28E7A40408 + A50457C33D2588C30352676C7D9804A5E01C378B22B4244F2652F38DDC128093 + B61B721CD154A2359B3B313681CC0BF3EEC923E1B2F9A0E89783EE810A406649 + D3D5FFE2A62F74B9A7D8B2991772E424144342E550CBAE4D92A29D097975455C + C6C42512DDCE62008E71CF17B53CDC85DCFC28560C73E534B764582B12386D7B + 174AC3C381F392894478F03B6EF9A23FBA097FCDF52DE546898B6125BAB42416 + 495569D9B52A3C83BAED53DC293F54D648979A02233BF1FC1A4C5DEF082E39D1 + 4D077A358A24ADD6E3042D98B6562418BAF7D2DEA41A8C5C24C2835F70CB1F3A + D8F6CF72A77C50F62EBE5740D15293DD17104A24D5A0FBA489A55EB1CEEE0195 + 0BCAA7AC3F14A28CFB243703096749A4BCA7E41F8EBEA11C429140B4BB290D18 + 4699A7C3DCAF145224B626416E91C30A25F41351082D10DDD4E539E2134D8416 + 89AC0953F9EF7147046DC186DAA3164289ABDD1D08937268E80B7B3357049190 + C48E018C74A2C89083AC29EA0D58F342C1E1461488770724D00A5053CE1EEE8A + 892612A2A6F5F630CBCE4E6AEDFDDC5938E4A4F3B78183A0EC1A97D9962837C3 + 471689BE8CBED4A6F6426879880B4F3F68D7207FB34E8231DBA1B15754831612 + 5D2482BE94BE3C0457B73E16806EC2FA308C1F32F0844A3E1CCA3DE4B3F05B94 + 1193DEBF538112DDB774F6E4157865E83EEE45E3AE3547A06B7D03F7FC897A9F + 643E0BB324C63ECBE1799B454BAF7E0537C23376651A2E8D4DC1687A358F1487 + 423D1ECFAE850A44C4624957B14F06B847EC35F6228CFEAF098EFEF916EE7D18 + 126176C6C0787A0666663C48A5662135390BD3D32EFF0540CFDD19F8EA3DEF73 + EFC3644F96B765A14F02E488572422E019939133CD70F8D52EC8645C989C7221 + 9D26013C181B9F4663941D8B9F48389D41E5E8ED713C5392237E91724C3CD76D + B4DE5BF8BCC9EB6FB542DF6F42EC5E22F5750ED4D5564163433538550ABE72F7 + 286C5837371FC4798C5807DDB0E3200FC546E94462CCC4FE6DA0E047B9674F8A + 89542844F3F21AA872B4ED17F2990DC3B0B63DBB7F8F4B6B94EA492A97E27A74 + AB90928B94A5BF0E52EE3603EACB6F0EB5DC37F0C7F6EA2021FC20913ADBCF1D + 43890EA969E760A99FC32D9348D7F8EDCB43B7A753356F70D717F251E4AB0A1D + F9CA15CEDEEF3FB6F131FEB39253769188E70F0D4F6204B4F75F661D3846309C + FCF4AC0713A9192B8A9F236F6DAEF9D64F7F78E70BDC2D39151169F7537F1F3C + 7F31B3697C628647E42413D599BEA73E5DCFDDB2104B3219969549780097CEB5 + C4671EC84F352FAF858EF646E8EC6884DBD6AF80DB6F6D853B3ED9BA99FFA46C + 54C492889F3CF38F8DA7CE4C1CD54AB52C5B560D35551A92C92AA8C708578791 + AE103CCC5165BC077BB7AF8B5C8345A56222E5E83FF4EF9E53A7D3FB1A1B6BE6 + DDF7B83C3E337B7D5BFD434EB2F6A5DE9E8E9246B162545C24E21BDF3946FF3D + C761EECE01F3A03DBFFA79373D465F312AE2930AF9E533DD0318C976E1E92A4C + 067F5C698188456149397A771EEB703596311AEA5C05C75FFC5977A44DB2B859 + 54222D5616C5725BEC2C89246049A44000FE0FE407E075DCC757DB0000000049 + 454E44AE426082} + end> + end + item + Name = 'libre-gui-key' + SourceImages = < + item + Image.Data = { + 89504E470D0A1A0A0000000D494844520000004900000049080600000071730B + DC000000017352474200AECE1CE90000000467414D410000B18F0BFC61050000 + 03DF49444154785EED9B315014311486131B1D47677046C72BE9A4F33AE984CE + 123A3B96920AAC2CD14AADD44A3B424789A595D89D1D7658711D7432144A17FF + B7F7E6C661E02EFB924D36906F0676DF1E77BBFBED4BF27673686BAD2A4CE606 + 2F0B1328921C28921C28921C28921C8837BA19BD803DF5B4527356AB87D83247 + 9B112FD0721A78EF3E1627F839D656FD427C8CF71E20DE5795A5EDADD18E24A3 + FBF8BD04198FB1ECE36466EBED2D8133204903C8FB81E51EA4EDD52F0422AC24 + CA16ADDE40CA3C6F4902CE680861AF21CBF0262FC24932FA15DACE26479D0067 + B60359AB9075C69B4404E9B8ADD11B5D134420A39F23B3DF7328C63F938CEEE1 + 688E38EA26562D239B76396A8C7726E14ABDE4D5CE82635CE15511DE9964B7F5 + 61D3D10B7B1C607186FEE2FB68CB98F3A3120D00B746ABF5C93EC182E279EC73 + BCDD09ABEE494B053F4946CFA0A9FDE66822D8CB01A4AC051B9E8DA67A6BCB79 + 24F56872BECDCDA9106406C104119525E95F399A0A67A1082F493E3B4E80B876 + F3CD24AAAC5D69D687842799A4261D767DAF161264F2235E9D4ADDD153B922C0 + 5792F34E71907D149DCF38F4071D377E2F8D026744D9EC37BA6DA3EB6C00FE98 + 6E0F3EE35D5F465BC4D03DE23AC4CF70EC86558B92C1432EC9E859A4C7214779 + 202C03C4CD0D6A45ED3B31CD328FF1ED93AE056249E80F8E79351BB84F6C8C3C + 932A3BE4B56C905E58AFE6862BD3EAB3E516882F09E4D6E44417D557525E4DAE + B2493289A679B2005D83F858BD24A172A6299C5C482309049DDF6A135CD0F34F + 419DF19354D913A4712EFD92F882FA6612219E8588052E243D15155F4C6F4948 + E377BCDA597C8FD13F9330AC5AAB5E70D4399045BB3846AF6C0FD1DC94AEEC07 + 1CCC5B0E3B03353364D12A8762BCE7DDFEC71A3D8F1BA44DDC23857B02290067 + 445FCFF9880C0A72E1824A1A63740F9FBA00614F11D14462930983C6605F74BB + 4175D000C14F64F64EFD4220DA91741146F7B1A73988FBD4F8B1EB05E0B0D7F0 + 39197F896B0293A6C54FFE2875C4A77BFFAE520FF073292B161F1387201DF755 + A74872A04872204B493C9A45233B49240835D0228751C84AD2585065A33EECCB + 4A527D8B115910915726D13769697A3D327965128A5088FA165B54761DF75854 + 44B293445C765BD316594A8A4D9692500A449D7CC84E12092AC5E404C682227F + A3252B495C4C469FE7CB2B93B4DA2AC5E4144A31E94829261D29C564074921C9 + 7B74BAF2C52486F1659CA4F899D0F528262B5B3F5D9488BA5EC5A440542A4144 + BA8EBB81A89482887492080751A90511D1BF0B7021F45FE14A6D9CFE55BDD3B3 + D17F58DEB9A98633B7EB51CCA41444744352C749DBDC32A14872A0489A8A52FF + 005C515BDE3E3155B80000000049454E44AE426082} + end> + end + item + Name = 'libre-gui-certificate' + SourceImages = < + item + Image.Data = { + 89504E470D0A1A0A0000000D494844520000004900000049080600000071730B + DC000000017352474200AECE1CE90000000467414D410000B18F0BFC61050000 + 046C49444154785EED9A4B4F534114804F6B1168A18A8A8044541491188D1AA3 + 688C1237FE00176A6222EEFC17EE4C4C4C8CFF80A5C48DAE342E7C2E141F08A2 + A214051F44110BD80785B6B4DE33CCA4B594DED387735B395F72D339B74D433F + 66CE9C99B9B6783C0E4C66ECF295C9004B22C09208B024022C89004B22C09208 + B024022C89004B22C09208B024026917B85D3786F6C463B6AB325C56D862B1CB + 9D675AEFC850905ED2F5E10EE39DFB325C5EC4E3E73B4F6FEF929180871B819C + 7AD2CED61AA8723A64547AF4BC9A90AD34A4E94939493AD1D10876BB4D46A5C7 + A39E71080623324AA110C3ADA1CE59D28290A60D4ED9A29195A4D5EE95D0D6B2 + 4A46A5CBE68DD550575B2923734C259595D9A0B1C125F2D0A1FDEBA17CE50AF9 + 4E69B36FD75AD8B3730D3435BA4C7F93A9A4EAAA72D8DD5623BEEC7F035307FE + F3D7ADAD9077D2C3250001D3D96D4D4D051CDCBB4EDC5F8A48340E7E7F5846C5 + 85CBE5301D4EAF07A760EC7B7021C8A504A0489A9C9ACB5C7B5808A60ACCA999 + 3093C4C38D004B22C09208B024020549DCBE4004063DBF65545C34375541AD49 + 1DA465762B7578762B002C89004B22C09208149DA4695F582C738A89A29034E1 + 9D85272F7EC2ED7BDFC42BAE03B18DDBAC9F3EFBE4A7ACC35249B87B80D3EF8B + FE5FA207A582FBD01F3EFA84B8D06C54DED58FA592DE7E48AA4F0C704B03EB32 + BC2A2B12A73128B077C00BB1D8E29A4E079649FA3E3E232E45F326371C3FD220 + 0A57BC3A0ED78B6D0E75E8E0F347C033E2176DDD5826098791A2658B1B5AB7BA + 659400F781509402F3130E51DD5822097FA8CA3138C49A37558B763A701F1A87 + 9FC28A1D504B2425FF50777599E9391E7E46E10B2C134991F9986C197F00E1A0 + D36E4B7CC68AE46D89243CE4540466CCA7F6E04CE248DAE54AF42A5D5822499C + 5EC8CE81B5507219900A4EFF3FBD2119FD2D58179648BAFB700C464613D3F980 + 512F61D59D0A0A7AD9EF85B81C9D5E63B972F3F697854023DA25A1A0BB0FC660 + F45B00FCF2C90E9480553756D6C3233E71A9381C99179F098763F06E680A9EF7 + 4D40F7AD11714F175A2529410826E0B7C69224184AE424EC391E43105EC93D2B + 6A247A1484A210DDA2B4494A16A44041CF7A2760F46B40DE590C0E31EC51F89A + 8C4E515A24A513A4C01E356B149647DBEB8DE548ADA8BCB102C7F6B1F63AF19E + EA41A9E812F5CF2565128434D63BE1C2B93670391D46655D2ED670DB0C49D876 + 3ACBA0F3540BECD8B6F433513A44D9749F965CBAD60F93D30B434709AAACC8FC + 4043341A83AE6E0FBC1F4E1C5B5DB97840B6F227EFD3929091373089167A3F87 + 2A087138ECA63D2A17E6C2F36217D46FB2D4319764C8C1E9F8D1D3C2ED126623 + 48516851E3BF42F0B8E787D805C56D984C9073122658DCDEF832B674754C6143 + 0E8214851285A546DF9B49884468EBC0AC13F7A0675AB672E3ECC9AD39095228 + 51F93038349DD542396B49F8E54B3E034D007F64BEE4FB1DF8EC423698CE6ECB + 0E7E162037581281B4C38DF91BEE490458120196448025116049045812019644 + 80251160490458120196640AC01FA72A35BDA3CFF86B0000000049454E44AE42 + 6082} + end> + end> + Left = 225 + Top = 205 + end + object VirtualImageList1: TVirtualImageList + Images = < + item + CollectionIndex = 0 + CollectionName = 'libre-gui-server' + Name = 'libre-gui-server' + end + item + CollectionIndex = 1 + CollectionName = 'libre-gui-idea' + Name = 'libre-gui-idea' + end + item + CollectionIndex = 2 + CollectionName = 'libre-gui-key' + Name = 'libre-gui-key' + end + item + CollectionIndex = 3 + CollectionName = 'libre-gui-certificate' + Name = 'libre-gui-certificate' + end> + ImageCollection = ImageCollection1 + Left = 177 + Top = 221 + end + object odlgPublicCertificate: TOpenDialog + Filter = 'PEM (*.pem)|*.pem|Key (*.key)|*.key|Certificate (*.crt)|*.crt' + Title = 'Select Public Key' + Left = 225 + Top = 159 + end + object odlgPrivateKey: TOpenDialog + Filter = 'PEM (*.pem)|*.pem|Key (*.key)|*.key|Certificate (*.crt)|*.crt' + Title = 'Select Private Key' + Left = 289 + Top = 207 + end + object odlgCAKey: TOpenDialog + Filter = 'PEM (*.pem)|*.pem|Key (*.key)|*.key|Certificate (*.crt)|*.crt' + Title = 'Select CA Key' + Left = 321 + Top = 175 + end +end diff --git a/demos/IndyFTPClient/dkgFTPConnect.pas b/demos/IndyFTPClient/dkgFTPConnect.pas new file mode 100644 index 0000000..b660d3a --- /dev/null +++ b/demos/IndyFTPClient/dkgFTPConnect.pas @@ -0,0 +1,360 @@ +unit dkgFTPConnect; + +interface + +uses Winapi.Windows, System.SysUtils, System.Classes, Vcl.Graphics, Vcl.Forms, + Vcl.Controls, Vcl.StdCtrls, Vcl.Buttons, Vcl.ComCtrls, Vcl.ExtCtrls, + System.ImageList, Vcl.ImgList, Vcl.VirtualImageList, Vcl.BaseImageCollection, + Vcl.ImageCollection, IdExplicitTLSClientServerBase, Vcl.Samples.Spin, + Vcl.Dialogs; + +type + TfrmConnect = class(TForm) + Panel1: TPanel; + Panel2: TPanel; + PageControl1: TPageControl; + TabSheet1: TTabSheet; + TabSheet2: TTabSheet; + OKBtn: TButton; + CancelBtn: TButton; + edtHostname: TEdit; + lblHost: TLabel; + chkAnonymousFTP: TCheckBox; + edtUsername: TEdit; + edtPassword: TEdit; + lblUsername: TLabel; + lblPassword: TLabel; + cboConnectionType: TComboBox; + ImageCollection1: TImageCollection; + VirtualImageList1: TVirtualImageList; + cboTransferTypes: TComboBox; + lblTransferType: TLabel; + edtProfileName: TEdit; + lblProfileName: TLabel; + lblConnectionType: TLabel; + edtAccount: TEdit; + lblAccount: TLabel; + spnedtPort: TSpinEdit; + lblPort: TLabel; + odlgPublicCertificate: TOpenDialog; + odlgPrivateKey: TOpenDialog; + TabSheet3: TTabSheet; + lblPrivateKeyFile: TLabel; + lblPublicKey: TLabel; + edtPublicKey: TEdit; + edtPrivateKeyFile: TEdit; + spdbtnPrivateKeyFile: TSpeedButton; + spdbtnPublicKey: TSpeedButton; + spdbtnCAKey: TSpeedButton; + edtCAKey: TEdit; + lblCAKey: TLabel; + odlgCAKey: TOpenDialog; + procedure chkAnonymousFTPClick(Sender: TObject); + procedure edtProfileNameChange(Sender: TObject); + procedure edtHostnameChange(Sender: TObject); + procedure edtUsernameChange(Sender: TObject); + procedure edtPasswordChange(Sender: TObject); + procedure cboConnectionTypeChange(Sender: TObject); + procedure spdbtnPrivateKeyFileClick(Sender: TObject); + procedure spdbtnPublicKeyClick(Sender: TObject); + procedure spdbtnCAKeyClick(Sender: TObject); + private + FQuickConnect: Boolean; + function GetHost: String; + procedure SetHost(const Value: String); + function GetUsername: String; + procedure SetUsername(const Value: String); + function GetPassword: String; + procedure SetPassword(const Value: String); + function GetUseTLS: TIdUseTLS; + procedure SetUseTLS(const Value: TIdUseTLS); + function GetUsePortTransferType: Boolean; + procedure SetUsePortTransferType(const Value: Boolean); + function GetQuickConnect: Boolean; + procedure SetQuickConnect(const Value: Boolean); + function IsAnonymousOrLoginCompleted: Boolean; + procedure ValidateOkBtn; + { Private declarations } + public + { Public declarations } + + property QuickConnect: Boolean read GetQuickConnect write SetQuickConnect; + + property Host: String read GetHost write SetHost; + property Username: String read GetUsername write SetUsername; + property Password: String read GetPassword write SetPassword; + property UseTLS: TIdUseTLS read GetUseTLS write SetUseTLS; + property UsePortTransferType: Boolean read GetUsePortTransferType + write SetUsePortTransferType; + end; + +var + frmConnect: TfrmConnect; + +function GetIniFilePath: String; + +function ReadTransferDefault: Boolean; + +implementation + +uses System.IniFiles, System.IOUtils; + +function GetIniFilePath: String; +begin + Result := System.IOUtils.TPath.GetHomePath + '\IndyFTPClient'; + if not DirectoryExists(Result) then + begin + CreateDir(Result); + end; + Result := Result + '\config.ini'; +end; + +{$R *.dfm} +{ TfrmConnect } + +procedure TfrmConnect.cboConnectionTypeChange(Sender: TObject); +begin + if cboConnectionType.ItemIndex = 3 then + begin + if spnedtPort.Value = 21 then + begin + spnedtPort.Value := 990; + end; + end + else + begin + if SpnedtPort.Value = 990 then + begin + spnedtPort.Value := 21; + end; + end; +end; + +procedure TfrmConnect.chkAnonymousFTPClick(Sender: TObject); +begin + if Self.chkAnonymousFTP.Checked then + begin + Self.edtUsername.Enabled := False; + Self.edtPassword.Enabled := False; + Self.lblUsername.Enabled := False; + Self.lblPassword.Enabled := False; + end + else + begin + Self.edtUsername.Enabled := True; + Self.edtPassword.Enabled := True; + Self.lblUsername.Enabled := True; + Self.lblPassword.Enabled := True; + end; + ValidateOkBtn; +end; + +procedure TfrmConnect.edtHostnameChange(Sender: TObject); +begin + ValidateOkBtn; +end; + +procedure TfrmConnect.edtPasswordChange(Sender: TObject); +begin + ValidateOkBtn; +end; + +procedure TfrmConnect.edtProfileNameChange(Sender: TObject); +begin + ValidateOkBtn; +end; + +procedure TfrmConnect.edtUsernameChange(Sender: TObject); +begin + ValidateOkBtn; +end; + +function TfrmConnect.GetHost: String; +begin + Result := edtHostname.Text; +end; + +function TfrmConnect.GetPassword: String; +begin + if Self.chkAnonymousFTP.Checked then + begin + Result := 'a@b'; + end + else + begin + Result := Self.edtPassword.Text; + end; +end; + +function TfrmConnect.GetQuickConnect: Boolean; +begin + Result := FQuickConnect; +end; + +function ReadTransferDefault: Boolean; +var + LIni: TIniFile; +begin + LIni := TIniFile.Create(GetIniFilePath); + try + Result := LIni.ReadBool('Transfers', 'Use_PORT_Transfers', False); + finally + FreeAndNil(LIni); + end; + +end; + +function TfrmConnect.GetUsePortTransferType: Boolean; +begin + + Result := ReadTransferDefault; + case Self.cboTransferTypes.ItemIndex of + // Use Default Setting + // Use PASV Transfers + // Use PORT Transfers + 1: + Result := False; + 2: + Result := True; + end; +end; + +function TfrmConnect.GetUsername: String; +begin + if Self.chkAnonymousFTP.Checked then + begin + Result := 'anonymous'; + end + else + begin + Result := Self.edtUsername.Text; + end; +end; + +function TfrmConnect.GetUseTLS: TIdUseTLS; +begin + Result := utUseExplicitTLS;; + case cboConnectionType.ItemIndex of + 0: + Result := utNoTLSSupport; + 1: + Result := utUseExplicitTLS; + 2: + Result := utUseRequireTLS; + 3: + Result := utUseImplicitTLS; + end; + +end; + +function TfrmConnect.IsAnonymousOrLoginCompleted: Boolean; +begin + Result := Self.chkAnonymousFTP.Checked; + if not Result then + begin + Result := (Self.edtUsername.Text <> '') and (Self.edtPassword.Text <> '') + end; +end; + +procedure TfrmConnect.SetHost(const Value: String); +begin + Self.edtHostname.Text := Value; +end; + +procedure TfrmConnect.SetPassword(const Value: String); +begin + Self.edtPassword.Text := Value; +end; + +procedure TfrmConnect.SetQuickConnect(const Value: Boolean); +begin + FQuickConnect := Value; + if FQuickConnect then + begin + edtProfileName.Visible := False; + lblProfileName.Visible := False; + edtHostname.Top := 13; + lblHost.Top := 16; + Self.chkAnonymousFTP.Top := 50; + Self.edtUsername.Top := 87; + Self.lblUsername.Top := 90; + Self.edtPassword.Top := 124; + Self.lblPassword.Top := 127; + Self.cboConnectionType.Top := 161; + Self.lblConnectionType.Top := 165; + end + else + begin + + end; +end; + +procedure TfrmConnect.SetUsePortTransferType(const Value: Boolean); +begin + +end; + +procedure TfrmConnect.SetUsername(const Value: String); +begin + Self.edtUsername.Text := Value; +end; + +procedure TfrmConnect.SetUseTLS(const Value: TIdUseTLS); +begin + Self.cboConnectionType.ItemIndex := 1; + case Value of + utNoTLSSupport: + cboConnectionType.ItemIndex := 0; + utUseExplicitTLS: + cboConnectionType.ItemIndex := 1; + utUseRequireTLS: + cboConnectionType.ItemIndex := 2; + utUseImplicitTLS: + cboConnectionType.ItemIndex := 3; + end; +end; + +procedure TfrmConnect.spdbtnPrivateKeyFileClick(Sender: TObject); +begin + if odlgPrivateKey.Execute then + begin + Self.edtPrivateKeyFile.Text := odlgPrivateKey.FileName; + end; +end; + +procedure TfrmConnect.spdbtnPublicKeyClick(Sender: TObject); +begin + if odlgPublicCertificate.Execute then + begin + Self.edtPublicKey.Text := odlgPublicCertificate.FileName; + end; +end; + +procedure TfrmConnect.spdbtnCAKeyClick(Sender: TObject); +begin + if odlgCAKey.Execute then + begin + Self.edtCAKey.Text := odlgCAKey.FileName; + end; +end; + +procedure TfrmConnect.ValidateOkBtn; +var + LRes: Boolean; +begin + LRes := False; + if not Self.QuickConnect then + begin + if Self.edtProfileName.Text <> '' then + begin + LRes := (Self.edtHostname.Text <> '') and IsAnonymousOrLoginCompleted; + end; + end + else + begin + LRes := (Self.edtHostname.Text <> '') and IsAnonymousOrLoginCompleted; + end; + Self.OKBtn.Enabled := LRes; +end; + +end. diff --git a/demos/IndyFTPClient/dlgFTPProxySettings.dfm b/demos/IndyFTPClient/dlgFTPProxySettings.dfm new file mode 100644 index 0000000..5491c10 --- /dev/null +++ b/demos/IndyFTPClient/dlgFTPProxySettings.dfm @@ -0,0 +1,157 @@ +object frmFTPProxySettings: TfrmFTPProxySettings + Left = 0 + Top = 0 + BorderStyle = bsDialog + Caption = 'frmFTPProxySettings' + ClientHeight = 187 + ClientWidth = 472 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = 'Segoe UI' + Font.Style = [] + Position = poDesktopCenter + TextHeight = 15 + object lblProxyPort: TLabel + Left = 64 + Top = 132 + Width = 25 + Height = 15 + Caption = 'P&ort:' + Enabled = False + end + object lblProxyServerPassword: TLabel + Left = 40 + Top = 103 + Width = 53 + Height = 15 + Caption = 'Password:' + Enabled = False + FocusControl = edtProxyServerPassword + end + object lblProxyServerUserName: TLabel + Left = 38 + Top = 74 + Width = 56 + Height = 15 + Caption = 'Username:' + Enabled = False + FocusControl = edtProxyServerUserName + end + object lblProxyServerName: TLabel + Left = 26 + Top = 46 + Width = 68 + Height = 15 + Caption = 'Proxy &Server:' + Enabled = False + FocusControl = edtProxyServerName + end + object lblProxyType: TLabel + Left = 64 + Top = 16 + Width = 27 + Height = 15 + Caption = '&Type:' + FocusControl = cboProxyType + end + object Panel2: TPanel + Left = 0 + Top = 153 + Width = 472 + Height = 34 + Align = alBottom + BevelOuter = bvNone + Font.Charset = DEFAULT_CHARSET + Font.Color = clBtnText + Font.Height = -12 + Font.Name = 'Segoe UI' + Font.Style = [] + ParentColor = True + ParentFont = False + TabOrder = 0 + DesignSize = ( + 472 + 34) + object OKBtn: TButton + Left = 311 + Top = 2 + Width = 75 + Height = 25 + Anchors = [akTop, akRight] + Caption = 'OK' + Default = True + ModalResult = 1 + TabOrder = 0 + end + object CancelBtn: TButton + Left = 392 + Top = 2 + Width = 75 + Height = 25 + Anchors = [akTop, akRight] + Cancel = True + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 1 + end + end + object spededtProxyPort: TSpinEdit + Left = 95 + Top = 129 + Width = 121 + Height = 24 + Enabled = False + MaxValue = 65535 + MinValue = 1 + TabOrder = 5 + Value = 1 + end + object edtProxyServerPassword: TEdit + Left = 97 + Top = 100 + Width = 369 + Height = 23 + Enabled = False + PasswordChar = '*' + TabOrder = 4 + end + object edtProxyServerUserName: TEdit + Left = 95 + Top = 71 + Width = 369 + Height = 23 + Enabled = False + TabOrder = 3 + end + object edtProxyServerName: TEdit + Left = 97 + Top = 42 + Width = 369 + Height = 23 + Enabled = False + TabOrder = 2 + end + object cboProxyType: TComboBox + Left = 97 + Top = 13 + Width = 369 + Height = 23 + Style = csDropDownList + TabOrder = 1 + OnChange = cboProxyTypeChange + Items.Strings = ( + 'None' + 'Send command USER user@hostname - USER after login' + 'Send command SITE (with logon)' + 'Send command OPEN' + 'USER user@firewalluser@hostname / PASS pass@firewallpass' + + 'First use the USER and PASS command with the firewall username a' + + 'nd password, and then with the target host username and password' + + '.' + 'USER hostuserId@hostname firewallUsername' + 'Novell BorderManager Proxy') + end +end diff --git a/demos/IndyFTPClient/dlgFTPProxySettings.pas b/demos/IndyFTPClient/dlgFTPProxySettings.pas new file mode 100644 index 0000000..adf71ed --- /dev/null +++ b/demos/IndyFTPClient/dlgFTPProxySettings.pas @@ -0,0 +1,91 @@ +unit dlgFTPProxySettings; + +interface + +uses + Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, + System.Classes, Vcl.Graphics, + Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls, + Vcl.Samples.Spin; + +type + TfrmFTPProxySettings = class(TForm) + Panel2: TPanel; + OKBtn: TButton; + CancelBtn: TButton; + spededtProxyPort: TSpinEdit; + lblProxyPort: TLabel; + edtProxyServerPassword: TEdit; + lblProxyServerPassword: TLabel; + edtProxyServerUserName: TEdit; + lblProxyServerUserName: TLabel; + edtProxyServerName: TEdit; + lblProxyServerName: TLabel; + cboProxyType: TComboBox; + lblProxyType: TLabel; + procedure edtExternalIPAddressChange(Sender: TObject); + procedure spnedtPortMinimumChange(Sender: TObject); + procedure spnedtPortMaximumChange(Sender: TObject); + procedure cboProxyTypeChange(Sender: TObject); + private + { Private declarations } + procedure ValidateFeilds; + public + { Public declarations } + end; + +var + frmFTPProxySettings: TfrmFTPProxySettings; + +implementation + +uses IdIPAddress, ProgUtils; + +{$R *.dfm} +{ TfrmNATSettings } + +procedure TfrmFTPProxySettings.cboProxyTypeChange(Sender: TObject); +begin + ValidateFeilds; +end; + +procedure TfrmFTPProxySettings.edtExternalIPAddressChange(Sender: TObject); +begin + ValidateFeilds; +end; + +procedure TfrmFTPProxySettings.spnedtPortMaximumChange(Sender: TObject); +begin + ValidateFeilds; +end; + +procedure TfrmFTPProxySettings.spnedtPortMinimumChange(Sender: TObject); +begin + ValidateFeilds; +end; + +procedure TfrmFTPProxySettings.ValidateFeilds; +var + LBool : Boolean; +begin + if cboProxyType.ItemIndex > 0 then + begin + OKBtn.Enabled := (edtProxyServerName.Text <> ''); + end + else + begin + OkBtn.Enabled := True; + end; + //validate proxy/host feilds - enable or disable appropriately + LBool := cboProxyType.ItemIndex > 0; + edtProxyServerName.Enabled := LBool; + lblProxyServerName.Enabled := LBool; + edtProxyServerUserName.Enabled := LBool; + lblProxyServerUserName.Enabled := LBool; + edtProxyServerPassword.Enabled := LBool; + lblProxyServerPassword.Enabled := LBool; + Self.spededtProxyPort.Enabled := LBool; + Self.lblProxyPort.Enabled := LBool; +end; + +end. diff --git a/demos/IndyFTPClient/dlgNATSettings.dfm b/demos/IndyFTPClient/dlgNATSettings.dfm new file mode 100644 index 0000000..497b445 --- /dev/null +++ b/demos/IndyFTPClient/dlgNATSettings.dfm @@ -0,0 +1,122 @@ +object frmNATSettings: TfrmNATSettings + Left = 0 + Top = 0 + BorderStyle = bsDialog + Caption = 'frmNATSettings' + ClientHeight = 138 + ClientWidth = 374 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = 'Segoe UI' + Font.Style = [] + Position = poDesktopCenter + DesignSize = ( + 374 + 138) + TextHeight = 15 + object lblMaximumPort: TLabel + Left = 230 + Top = 79 + Width = 58 + Height = 15 + Anchors = [akTop, akRight] + Caption = 'M&aximum:' + end + object lblMinPort: TLabel + Left = 43 + Top = 79 + Width = 56 + Height = 15 + Caption = '&Minimum:' + end + object lblPorts: TLabel + Left = 43 + Top = 55 + Width = 215 + Height = 15 + Caption = 'Data Port Range for PORT/EPRT transfers.' + end + object lblNATIPAddress: TLabel + Left = 41 + Top = 16 + Width = 58 + Height = 15 + Caption = '&IP Address:' + end + object Panel2: TPanel + Left = 0 + Top = 104 + Width = 374 + Height = 34 + Align = alBottom + BevelOuter = bvNone + Font.Charset = DEFAULT_CHARSET + Font.Color = clBtnText + Font.Height = -12 + Font.Name = 'Segoe UI' + Font.Style = [] + ParentColor = True + ParentFont = False + TabOrder = 3 + DesignSize = ( + 374 + 34) + object OKBtn: TButton + Left = 213 + Top = 2 + Width = 75 + Height = 25 + Anchors = [akTop, akRight] + Caption = 'OK' + Default = True + ModalResult = 1 + TabOrder = 0 + end + object CancelBtn: TButton + Left = 294 + Top = 2 + Width = 75 + Height = 25 + Anchors = [akTop, akRight] + Cancel = True + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 1 + end + end + object spnedtPortMaximum: TSpinEdit + Left = 294 + Top = 76 + Width = 75 + Height = 24 + Anchors = [akTop, akRight] + MaxValue = 65535 + MinValue = 0 + TabOrder = 2 + Value = 0 + OnChange = spnedtPortMaximumChange + end + object spnedtPortMinimum: TSpinEdit + Left = 105 + Top = 76 + Width = 75 + Height = 24 + MaxValue = 65535 + MinValue = 0 + TabOrder = 1 + Value = 0 + OnChange = spnedtPortMinimumChange + end + object edtExternalIPAddress: TEdit + Left = 105 + Top = 13 + Width = 263 + Height = 23 + Anchors = [akLeft, akTop, akRight] + TabOrder = 0 + TextHint = 'Leave empty unless you are behind a NAT' + OnChange = edtExternalIPAddressChange + end +end diff --git a/demos/IndyFTPClient/dlgNATSettings.pas b/demos/IndyFTPClient/dlgNATSettings.pas new file mode 100644 index 0000000..db7d9cd --- /dev/null +++ b/demos/IndyFTPClient/dlgNATSettings.pas @@ -0,0 +1,78 @@ +unit dlgNATSettings; + +interface + +uses + Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, + System.Classes, Vcl.Graphics, + Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls, + Vcl.Samples.Spin; + +type + TfrmNATSettings = class(TForm) + Panel2: TPanel; + OKBtn: TButton; + CancelBtn: TButton; + spnedtPortMaximum: TSpinEdit; + lblMaximumPort: TLabel; + spnedtPortMinimum: TSpinEdit; + lblMinPort: TLabel; + lblPorts: TLabel; + edtExternalIPAddress: TEdit; + lblNATIPAddress: TLabel; + procedure edtExternalIPAddressChange(Sender: TObject); + procedure spnedtPortMinimumChange(Sender: TObject); + procedure spnedtPortMaximumChange(Sender: TObject); + private + { Private declarations } + procedure ValidateFeilds; + public + { Public declarations } + end; + +var + frmNATSettings: TfrmNATSettings; + +implementation + +uses IdIPAddress, ProgUtils; + +{$R *.dfm} +{ TfrmNATSettings } + +procedure TfrmNATSettings.edtExternalIPAddressChange(Sender: TObject); +begin + ValidateFeilds; +end; + +procedure TfrmNATSettings.spnedtPortMaximumChange(Sender: TObject); +begin + ValidateFeilds; +end; + +procedure TfrmNATSettings.spnedtPortMinimumChange(Sender: TObject); +begin + ValidateFeilds; +end; + +procedure TfrmNATSettings.ValidateFeilds; +var + LIP: String; + LBool: Boolean; +begin + LIP := edtExternalIPAddress.Text; + Self.OKBtn.Enabled := (LIP = '') or IsValidIP(LIP); + if OKBtn.Enabled then + begin + if (spnedtPortMinimum.Value = 0) and (spnedtPortMaximum.Value = 0) then + begin + OKBtn.Enabled := True; + end + else + begin + OKBtn.Enabled := (spnedtPortMinimum.Value < spnedtPortMaximum.Value); + end; + end; +end; + +end. diff --git a/demos/IndyFTPClient/dlgProxySettings.dfm b/demos/IndyFTPClient/dlgProxySettings.dfm new file mode 100644 index 0000000..825c11f --- /dev/null +++ b/demos/IndyFTPClient/dlgProxySettings.dfm @@ -0,0 +1,153 @@ +object frmProxySettings: TfrmProxySettings + Left = 0 + Top = 0 + BorderStyle = bsDialog + Caption = 'frmFTPProxySettings' + ClientHeight = 187 + ClientWidth = 472 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = 'Segoe UI' + Font.Style = [] + Position = poDesktopCenter + TextHeight = 15 + object lblProxyPort: TLabel + Left = 64 + Top = 132 + Width = 25 + Height = 15 + Caption = 'P&ort:' + Enabled = False + end + object lblProxyServerPassword: TLabel + Left = 40 + Top = 103 + Width = 53 + Height = 15 + Caption = 'Password:' + Enabled = False + FocusControl = edtProxyServerPassword + end + object lblProxyServerUserName: TLabel + Left = 38 + Top = 74 + Width = 56 + Height = 15 + Caption = 'Username:' + Enabled = False + FocusControl = edtProxyServerUserName + end + object lblProxyServerName: TLabel + Left = 26 + Top = 46 + Width = 68 + Height = 15 + Caption = 'Proxy &Server:' + Enabled = False + FocusControl = edtProxyServerName + end + object lblProxyType: TLabel + Left = 64 + Top = 16 + Width = 27 + Height = 15 + Caption = '&Type:' + FocusControl = cboProxyType + end + object Panel2: TPanel + Left = 0 + Top = 153 + Width = 472 + Height = 34 + Align = alBottom + BevelOuter = bvNone + Font.Charset = DEFAULT_CHARSET + Font.Color = clBtnText + Font.Height = -12 + Font.Name = 'Segoe UI' + Font.Style = [] + ParentColor = True + ParentFont = False + TabOrder = 5 + DesignSize = ( + 472 + 34) + object OKBtn: TButton + Left = 311 + Top = 2 + Width = 75 + Height = 25 + Anchors = [akTop, akRight] + Caption = 'OK' + Default = True + ModalResult = 1 + TabOrder = 0 + end + object CancelBtn: TButton + Left = 392 + Top = 2 + Width = 75 + Height = 25 + Anchors = [akTop, akRight] + Cancel = True + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 1 + end + end + object spededtProxyPort: TSpinEdit + Left = 95 + Top = 129 + Width = 121 + Height = 24 + Enabled = False + MaxValue = 65535 + MinValue = 1 + TabOrder = 4 + Value = 1 + end + object edtProxyServerPassword: TEdit + Left = 97 + Top = 100 + Width = 369 + Height = 23 + Enabled = False + PasswordChar = '*' + TabOrder = 3 + end + object edtProxyServerUserName: TEdit + Left = 95 + Top = 71 + Width = 369 + Height = 23 + Enabled = False + TabOrder = 2 + end + object edtProxyServerName: TEdit + Left = 97 + Top = 42 + Width = 369 + Height = 23 + Enabled = False + TabOrder = 1 + end + object cboProxyType: TComboBox + Left = 97 + Top = 13 + Width = 369 + Height = 23 + Style = csDropDownList + ItemIndex = 0 + TabOrder = 0 + Text = 'None' + OnChange = cboProxyTypeChange + Items.Strings = ( + 'None' + ' HTTP CONNECT proxy' + 'SOCKS4' + 'SOCKS4a' + 'SOCKS5') + end +end diff --git a/demos/IndyFTPClient/dlgProxySettings.pas b/demos/IndyFTPClient/dlgProxySettings.pas new file mode 100644 index 0000000..363eac0 --- /dev/null +++ b/demos/IndyFTPClient/dlgProxySettings.pas @@ -0,0 +1,91 @@ +unit dlgProxySettings; + +interface + +uses + Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, + System.Classes, Vcl.Graphics, + Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls, + Vcl.Samples.Spin; + +type + TfrmProxySettings = class(TForm) + Panel2: TPanel; + OKBtn: TButton; + CancelBtn: TButton; + spededtProxyPort: TSpinEdit; + lblProxyPort: TLabel; + edtProxyServerPassword: TEdit; + lblProxyServerPassword: TLabel; + edtProxyServerUserName: TEdit; + lblProxyServerUserName: TLabel; + edtProxyServerName: TEdit; + lblProxyServerName: TLabel; + cboProxyType: TComboBox; + lblProxyType: TLabel; + procedure edtExternalIPAddressChange(Sender: TObject); + procedure spnedtPortMinimumChange(Sender: TObject); + procedure spnedtPortMaximumChange(Sender: TObject); + procedure cboProxyTypeChange(Sender: TObject); + private + { Private declarations } + procedure ValidateFeilds; + public + { Public declarations } + end; + +var + frmProxySettings: TfrmProxySettings; + +implementation + +uses IdIPAddress, ProgUtils; + +{$R *.dfm} +{ TfrmNATSettings } + +procedure TfrmProxySettings.cboProxyTypeChange(Sender: TObject); +begin + ValidateFeilds; +end; + +procedure TfrmProxySettings.edtExternalIPAddressChange(Sender: TObject); +begin + ValidateFeilds; +end; + +procedure TfrmProxySettings.spnedtPortMaximumChange(Sender: TObject); +begin + ValidateFeilds; +end; + +procedure TfrmProxySettings.spnedtPortMinimumChange(Sender: TObject); +begin + ValidateFeilds; +end; + +procedure TfrmProxySettings.ValidateFeilds; +var + LBool : Boolean; +begin + if cboProxyType.ItemIndex > 0 then + begin + OKBtn.Enabled := (edtProxyServerName.Text <> ''); + end + else + begin + OkBtn.Enabled := True; + end; + //validate proxy/host feilds - enable or disable appropriately + LBool := cboProxyType.ItemIndex > 0; + edtProxyServerName.Enabled := LBool; + lblProxyServerName.Enabled := LBool; + edtProxyServerUserName.Enabled := LBool; + lblProxyServerUserName.Enabled := LBool; + edtProxyServerPassword.Enabled := LBool; + lblProxyServerPassword.Enabled := LBool; + Self.spededtProxyPort.Enabled := LBool; + Self.lblProxyPort.Enabled := LBool; +end; + +end. diff --git a/demos/IndyFTPClient/frmAbout.dfm b/demos/IndyFTPClient/frmAbout.dfm new file mode 100644 index 0000000..af92c88 --- /dev/null +++ b/demos/IndyFTPClient/frmAbout.dfm @@ -0,0 +1,398 @@ +object AboutBox: TAboutBox + Left = 200 + Top = 108 + BorderStyle = bsDialog + Caption = 'About' + ClientHeight = 274 + ClientWidth = 298 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clBtnText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + Position = poScreenCenter + OnCreate = FormCreate + DesignSize = ( + 298 + 274) + TextHeight = 13 + object Panel1: TPanel + Left = 9 + Top = 8 + Width = 281 + Height = 222 + Anchors = [akLeft, akTop, akRight, akBottom] + BevelInner = bvRaised + BevelOuter = bvLowered + ParentColor = True + TabOrder = 0 + ExplicitHeight = 199 + DesignSize = ( + 281 + 222) + object ProductName: TLabel + Left = 119 + Top = 12 + Width = 68 + Height = 13 + Caption = 'Product Name' + IsControl = True + end + object Version: TLabel + Left = 119 + Top = 40 + Width = 35 + Height = 13 + Caption = 'Version' + IsControl = True + end + object Copyright: TLabel + Left = 8 + Top = 123 + Width = 154 + Height = 13 + Anchors = [akLeft, akBottom] + Caption = 'Copyright (c) 2024 Indy Pitt Crew' + IsControl = True + end + object Comments: TLabel + Left = 8 + Top = 142 + Width = 257 + Height = 43 + Anchors = [akLeft, akRight, akBottom] + AutoSize = False + Caption = + 'This software uses the LibreICONS-4.5. '#13#10'Copyright (c) 2018 Diem' + + 'en Design'#13#10'released under MIT LIcense and available at:' + WordWrap = True + IsControl = True + end + object VirtualImage1: TVirtualImage + Left = 8 + Top = 12 + Width = 105 + Height = 105 + ImageCollection = ImageCollection1 + ImageWidth = 0 + ImageHeight = 0 + ImageIndex = 0 + ImageName = 'IndyLogo' + end + object LinkLabel1: TLinkLabel + Left = 8 + Top = 191 + Width = 226 + Height = 17 + Hint = 'https://github.com/DennisSuitters/LibreICONS' + Caption = + 'https://g' + + 'ithub.com/DennisSuitters/LibreICONS' + TabOrder = 0 + OnClick = LinkLabel1Click + end + end + object OKButton: TButton + Left = 111 + Top = 235 + Width = 75 + Height = 25 + Anchors = [akLeft, akRight] + Caption = 'OK' + Default = True + ModalResult = 1 + TabOrder = 1 + ExplicitTop = 214 + end + object ImageCollection1: TImageCollection + Images = < + item + Name = 'IndyLogo' + SourceImages = < + item + Image.Data = { + 474946383961FA009B00F7000000000008000008080008080810000010080010 + 0808101000101008101010180000180800180808181000181008181010210000 + 2108002904002110001818042315022918002918081818102118102918101818 + 18211818212100292100212121310000390000310C00390C0031180031210039 + 1C00311810292110312110392110292118292900312900312921292929420000 + 4705004412004221003929003D2D0042310046250C520000520C005A04006209 + 00521C004B2A08631F00563100393900423D004A39004A420042310839311446 + 350C4A31184A42084A4218523900524200524A005A39005A42005A4A00633100 + 6B31006339006B39006342006B4200634A006B4A005A5200635200635210635A + 006B52006B5A006B52086B56105231183931215A39215A4A216339216342216B + 4221424229524A296B42293131313939314239315A52316B6331393939424239 + 4A42395A4A39424242524A425252425A52424A4A4A5A524A5252525A5A52635A + 525A5A5A63635A63636342FFFF7E0E00A00D00763C00962F007C58007D4E2A8D + 5300965712C10800DA0400DE0800E70800CF1C00E31A00BF4800DE4100826E02 + 927405A46E02A48708B66F03B19008CA7104C98D0879695277736BC57926D383 + 4A737373847B73817F7D8C8888EF0400F40D00FF0000FF0800FF1000EF1800F7 + 1800FF1800EF2100F72100FF2100E72900EF2900F72900FF2900E73100F43D00 + FF4A00ED5500FF5600ED6D03FF6700FF6F04FF7308E78808EF8408F77F08F38C + 08FF7B08FF8408FF8C08E78C52B69F08C7A308D6A008D0B308DE9C08DEA508DA + B108DABD08E79808EF9408EF9C08E9A708EBB108ECBA08E6CA08EFCE08F79408 + FF9408F7A008FF9C08FFA508F7AD08FBB108FFB508F7BD08FFBD08F7C608FFC6 + 08EFD608F7D208F7DE08FFCE08FFD608FFDE08FFE708FFE710E79452EF9452F7 + 9C5AFF9C5A9494949C9894B1A28BA5A5A5ADADA5ADADADBDB5ADB5B5B5BDBDB5 + BDBDBDC6BDBDC6C6C6CECECED6D6CED6D6D6DEDEDEE7E7DEE7E7E7F7F7E7EFEF + EFF7EFEFF7F7EFF7F7F7FFFFFF21F9040100007F002C00000000FA009B000008 + FE00FF081C48B0A0C18308132A5CC8B0A1C38710234A9C48B1A2C58B18336A2C + F8E283C78F20438A1C49B2A4C9932853AA04A966A3CB97302DAAD900A0A6CD9B + 3873EADCC9B3A7CF9F4083EAFC10B3A8D1A305130020A02350A2A750A34A9D4A + B5AAD5AB58B36ADDFA5407800448C38AD5485342A25168D3AA5DCBB6ADDBB770 + E3CA9D4B572D280560C7EADDFBF003800088EA0A1E4CB8B0E1B581BEF25DCCD8 + A05F00810E4B9E4CD9F02208005E34DEBCF8F18ECAA142290A44BAB4E940A12B + AB26BC288462CEB0C5AA19000010A9DBB873EBDE8D7B348EA0100021E24DBCB8 + F1E3C88BB70630A065ECE745670380112A7971443A02D884010875E8EFA110FE + 05D241A02604D4D6D3AB5F4FCAF500CDD0E3BFA40962117BDC8114D80C114811 + A2FF0006F81F29A18C67DE70F725A82020CCC127DF8318D1148022092AE25A00 + 4D21024808FAF92401208C9082480C35C580A08228269718004441E86245129E + B81E22DA41B0030E980965530C8134124879009898E290C421525E8B2F2609D1 + 0B7F2162CA93504629A594A5E408A48E3905624A23809447C00EA54C29E69864 + 9669A629A5949780734AB6B91093B59D49E68A58F29403948D7805400861CAE9 + E79F629602C36B6E168A109C3B004A658E75EE14429474F2A9E8A47EE6D0A0A1 + 9816245DA2943ED9C85F24AE7347A3373D0A25220074C869A7AC4AC9E07BFE99 + C6FA8774123492CAADB8E6AAEBAEA9A06AE906FEFCC309A9358590AB2990ED50 + 1320BC36EBECB3D0A6C2208BB2C6AA54ADD142CBA0A577FCF38F3FC392AA80AD + B842960A087F3192EDBAECDE8A2AB5D5624AD3B8ED360B48000CA6E3EDB7EFD0 + D628B9B79ADB8804A9A252EFC1BC32A21F92F1BA29612008EF2A810296BEB3AF + B7F1F88B25C0A9989BCAC0008C6070C4082BFC159B0D2BC9640010938C2B2A14 + 8F0080B7F7DC61F13FF1FC9BEB87B882CCACCBEDA222C2C929BB0967CB40A7C2 + 0800CACEFCCFA8037012ECA81BE79A430CB92E0D80BA49478B0A89CD15DDE6A6 + AD946DF6D968A79DF6D289CDF14F3B1AF3F10F3D753672F6D5682B4B00FE2A6A + F7EDF7DF65BFEAA0D82F2A1503E088A3BD348372C36993DC736C7CF7E168EB97 + 43E298F7BDE2E08443E85704AB649E78629672F28E4E9CD0A33150A19B9D830C + 69AFC888E8B49BCC70E70FAE1C08ED88DFAB6C3B7CE834403C54034540EB65BF + AEB6CC12B0C27BE226E785BB8B34EDF03CE080442033DC3BBDC03D5023A0ADFC + DADAED7EBDDFABE8B7E6F42F6E70FCF97E672FB31F3DF151BC4FE1DF0DBBDA0C + 820E7FDAABB0D4FAD8473D000C6215084CA00217C8C00622D007DA0340F0EA17 + 94FC992D7BCE4B1B2B22501B077AF0835DBA14015DF41862F524022218401E7C + A28612F6C482654BCC2BFAA63513EA64039C1BA17C3AB2929500C052FECDF989 + 0B7932025818D188323CA2128D2883AFF4F02439D4A1140732004BD910274554 + E22000F08A252AF115E541D914C7E8922A5E118B4BDC6217BD78441FC08B8C70 + D48819CF68131FA4918B6C3CE22B9813C73E62648E7434E0127390C53C323133 + 7E4CA44498C48340D664104B94810C0C79C42D6E40919874089386E648482A51 + 909434A276C498C95212C4719D5C222843E9C6DB99F2953471644D1EA14500D0 + 3294B07004A15EC9CB583A5204B088853063B1C5600EF398C884C50200404A5E + 62D2978194013265004C645A73985B74A53315094D3A0E629A3CB8A6381FC1C7 + 6D9AB29B67FCE63061812F718A53665134671CD17945630A131606FE74E7352D + 29CF4CD2D384D23CE6161FA14F6BC2820061EB2743D4C0D0863AB4996D528A23 + C329500014F49A8DD4A642D5D091044894271EDDC0075E00D1F8A0D29BC8E441 + 042E6ACD2D4A4FA17FF8C0063E5A930DCCE1A638CDE94DD5609304E0B07DB2CC + E731654051961E7399252DE5073EFA8237F8C113E9888754A74AD5AAC6E3137E + 28E14FE3C3D3A00E6216609D0539BF1AD6B29AF5AC5178E34B3ABA3A9D783401 + 2385CD4C6CF202D359F5AE789DEA3AFC209D04C4932F1F682B1D1F51D6410480 + B0674DAC591F118001B884AD3821E9431BDACD01F8F4AF4579CC00EEB08EBC7A + F6B3EDF0034D06A0D1B10CD1916695A462575B567862E405B1C4FEA11FFC908E + 76D8D6B3EFB06D3B38C1578992562C2FA0CD663BFBD9E2E296133419E05EE61A + 549B9455160B88026BA79BCD8ACC84361BF0C327DE61DCCFBE8313D219C00692 + 7A91C7A8011DDD4D6F5EDF11BCDFEA450D346D6E5975E988E9CE62102210010F + 645156C63A5622734DC01DB6ABDEEEAE03BC3525EF44FC92804F14F8C1779D20 + 665F125FF98655A5F6954501EA68D6464ED831E2B52B84D58B0EA87D40C17DF9 + 0A7A47CC62A9B6772CFF74E404C20A5DE94E579737412C5875794987C0170073 + 206E8BD54B3FA2BD9699421EF2882357DA83B470A96F8DB294A5DCDC9CD87816 + F4B5EF166F72E5594017003E564A1E940CE122C3EA226BE22EFE990B8C0E3EE4 + 011DEB18C07F17F2E39BA8E10E78CEB39EF7CCE73D47EE8C2618842306310113 + D4E2D0884E34A2D38A9347243AAD4D1E084D3CB166087F42292F9D0893565C69 + E3BEE3CF3579C31BD47A10387DE013E9B0873F8275B156BBFAD517F3073D3C01 + EA46896006B89E812314CDEB4333FA268348B42EE79C10BF8CB9D30F4E875222 + BD1091AA19D9B8AD754D77E9989AF0211FB0CEB6B6B39D8F74CC41B03FD975AF + C7EDEB9CCC20D1B2A8002213C2243540DBC07C80AF809983628444EDDD9F0DD7 + 4E12124BA96DFBDF00BF58B7B32A147193BBD75BBEC9B9135DDD84F834C9F8BE + 2B27C0CD6C8404B61D11C76B3B2A7C9328FA6500ED6075C0FE470EF07DA4E3B4 + 3911C0C1C98DE39B044016E806408F4B0D004E643CAFCADE09B121928037DC3C + C200C803C749FD0738DD8CE4482F799179C28395939B83388179A203906982C0 + F5D93FA72ACAE90AE09A679DAA709BC33EECB193990B044E7E48BADA03FE8E18 + 0BC216708FBBDCE73EF719E4841673E741423902004A7F9DAA9FF089D91DE217 + 4E7FDD0F09C0F63F029F93974A27ED6B8FFCB6FD71BF9B3882EE98C77CCB6D82 + 77B937B2991EC5F8DFA7BA759BECBC217EB92B3A38216D9C0C40A773F084EC45 + 9FD70F70625FFE109ED533A378C9FBFED5FE3829000AD0F9CC1B1FEE76B7C90C + E8AECB66067DF47AAD891F26DEBD8824E0D8F140871FBEFE7D45F1DE810F9F48 + 723B36D0FB7FAC3027036170F97FCFFE7DD123BE2438BEFC6DB1F9E5CF5D97AE + E429C4BF3E2A35044BDF910511B3315B73307467F41E7940699F900726870EFB + B0783A2110B1B40EED5781AD763A5C760B1AB8811CD8811E780BB6200836E108 + 1E680944275358F775ED501337B30FF4547103D1555556762FF00954E307FB90 + 3339B15435F58016F883FF30413541821F58841F680BB490844548758EF102D0 + 275581A70617E309370411A53783350180EDF00FE006000BB061B70784164876 + 356101B460846898861D4802A7F7017EF084F1403FED207BD846378D07113186 + 855F71136FF0343A618696500003A02F6258815D4584FE6A98884608057B2781 + 36F784C155646A900FC19713A7A71006A88739710F548813337086B760083541 + 8185C87E9123088A988A450805EB361009908255F50EB2388BB2A864DF631369 + D78937718909D1859A9813A6831350C00BC4488CA20800A4588A91B70E5E480B + C5F88CD0188DD2388DCFA84B9CF38AAA9707321859A2266A9CF08D9C60789E85 + 0E96180F7618800D217CBFB81379A03A36318CD1788CF7A08C6A072E43488DF8 + 988FD3C86349F16CDAD77A7572539EB07F52B5747C980F3AF16167B78E3B5106 + 627013FE205151A00BD2A80B22F801F3488F01E70FE8F0183F4091FA1892FAA8 + 0B05307809800E9E70079968424E155553757EAE67FE0FC2A79031C590396100 + BFF00B0E6013E13291BAF09340199476F701F6A091DB760FE8306A0060018E10 + 944EF99450199552F993255910CCB18ECDC109EBB075EDD07A3499877A7804E6 + 600E29701302600853099443B97E46E92DEC451B016002879096745997505995 + 046193A6C713AC971383C76F7A79139B30962A601302400976A90B76C70722A7 + 91B2E60970B2008260098959997629880471858109648C77137F696F9B09000D + 50084790023BF91794D00BAAB99AACD99ABD6009CBC498CAE80F48C907705200 + 0D6008B4E09ABCD99BBEF99BBCF903C4A6997A680069509636B101E9E0970EE1 + 8BCC0157D3A75BD2695B7BC57D3E110002C01C72FE367C1B1600A9099CAE099B + 12D498ECB70FF9D0667012000D300587900BE0F99EF0099C53309CA159138560 + 0E9BA01D353100BAD853CDE97A77F066EB400FF950A0067AA0089A0FF4B00EB6 + A91301809D004007EBD00EEFD007DAE19DF1D99A8158736BB76A1EEA0FF36083 + 1A13003F60089690A1289AA2AB39056F049658180083690E1A7013CB897E0DE1 + 2FD9D50E09BAA33C8AA0EBA094006008A9290900B007EB30A1DC453F3FA0A2AB + B9A15BE86AF7309D7E9007549A0700A97C8220094CBAA5287A8C3DB692586800 + 63690E8570132B68A30C21677E700F3DDAA66E1A0F7F6608B830016B900E134A + A152150713E09E5B7A8C7CC007345500D97913FE0DD003866AA88670088ABAA8 + 8770A25CCA9B96F09D8FDA9A94909DCD01A6339806639A9F8F13810C41139FE0 + A6A2DAA6F7102E163000E177A76AD62F87E00BAEFAAAB01AABB2EAAA86906B33 + 300586B06135510186900BBE9A0BB31AACC21AAC916A08522005265000CABAAC + DAA1AC3D2005946009C33AADB06A0924B09FF5799F637A9A00E00795D78A1627 + 416C3AAAE4BAA36D57002E60A7AA1A0FF3300F736001D41AAFAF9A0B767707B3 + A50601D0AAF2BAAFAE8A0B82D000DA315E6AC009B257B0062B7B7C85010D5001 + 8260A2C0CAAFAF8A0B52509F3511A3635906369107DF1A699645A0E5FAB1F770 + 607CF0011810007BA0AEB6C55DED4A85B800FEB1C2BA0B3F80009980A4EF2007 + DEE9B2C38A0B9690AB093007E8300FF6F0B1F4900E04279A0C6B09BB00B1BB70 + 0882D0B44EFBB4506B0116A0AB678493636A0E69607A1BAB104C12AA1F5BAEF4 + 009300909D5075A414AAB2F3000F002009383BAB9210007D60B6DCF50E6B5001 + 2DDBB6B19AAB5FE1071EFBB5077A0FEFE0097556029490B42EBB0BB890B88A8B + B88A9BB8884B09C967430E70B564AAB53B88892F30AE7E4BAAE9B00182F5114E + 355B76F50E02D004780BABBB60016C80B26AC60E096008A7DBAF3FC01C7CBBB9 + 6D6A0F44EB1724D0ABFB4A092660013851003DB0ACBA2A05BC4B09544B2A937B + B59B607A625B134D06009F30BDDB077B37FE057ED36B0FF7A0B93D0AA8ED400F + 1DD9537E603FEA08003F100DE89BBEEABBBEECABBE44DA09769AB252350F7C60 + 01D0D0BEF8DBBE1BDA8EB65BAEEFF0091B2099BB90BFE90B0D25C013B890BE91 + 6A771690C05560436240B9CDBB9FCC881325459C3CF10677800E3A9AA097460F + FBA283052085DE320F3801552F70BE04BCC2E9FB031C800EF18BA7ECBA9C94C0 + C2F9BB0BEA9607FDEBB7F340130560082B4C093D01C4EB6B099230C0446A42DA + BAA9A657C137A110CE2914D9B50E41ABA0A8DA6AE142C2FF700FBB388F7760BF + 36BCC2054007282BC3F3100F18500561CCBEBB60773ABCC33C4C358490BF06DC + 133340C0B890BC5822004B3C9613CC22FEEBD04D09B18D077807DF3807A29500 + 9E403335A1C5FEA031FEF7343570BF6BACBF00F006DF389078DAAEF4A0063450 + C9EA4B0541C7BD70DCA6F1F006721635707208F82BC43DD100099CBF34402C1A + F00B944B0E590B00EFE00F42584E0781C1A4B23A8BFC0F1B20005A6C7E3631CC + 77F003D3D0CCCEFCCCD01CCDCEECCA3DF556DFC7072B2000D2BCCDCF7C080070 + 07A45CCA3C8A0EFF5400B820CD3DF013E7CCCDC7482A7D8C9F83BA01B72873BD + A823E91CCC45493FC73C0FB4F1018A0707CCCCCD02FDCC420CB4F430CF709500 + DA3CD0D19C0C133000EF20CEA2DA9F3A2105D23CCB3E4109024DCD8DF2CE7F3C + 004E5C530841C83E5105C04B2C69B7FE0E02C0013EE82DB306C2FFB00F67C9D0 + 0C4D0800A0789598CCFEF00902000D344DD01224D16F2A672F20743A2100EBFC + CC183DC4029D0C4A2CC14D8C139FF9072E6A1384D00401F0C0C4E20F1808D3AF + 560F00A0D13FCDCD4D70D3DEE20F400A00F1F00FE4780963DDCC34B001552CD4 + 3B7A0F3C4588F96090366108D1BCD43CC1D7DC8C0C4F7DB5654AC138A14DD201 + 148440A457E0CDC4B20EFB401BC3FC6A9D10006FCDCD0FDC7BFAB6010F880E0B + 3DD626C80974DDA35438D9DEA2D700D0047DFD135420D0494C2A6040B9B9CC1C + 210DAE0351BE395102794C03D430B1C49207FF9000E80A6BC1A704D470DCC89D + DCCABDDCC92DC4BD778E90E7D9CCFE3DDDC77D050930D7A38DA0E3459E089913 + CBEDD73B5102D44D0DEDDC28CB3BA660601378868E0551D5E6AC0415800CD420 + CA41510685E99994B761477731EE00009630DE00DEDC66BD2F97A6063ED8070D + 10E0CA5D73051AB247FAE01D2CCE54380FE9F0A7F3B02FA77509CA0DDE3A21DE + D45DDE7572DE63C9ADDECADE311814872009022009C77DD23FA1ADC86913FEC0 + 530D9000F8D06AFBC00134200D0A1EE0C8200084887B22F7064DD0E3C72D8A28 + 7907E096CA03400E98C0077E30A120BB016FE0380970E1C292138690DCC8D000 + 3FE1E1D30DE27562B1E46000B8783F9788C136A00C164008C83DA83E510663AA + 0938910E0350039720006FD0D2FE9417001A6EE4005E0172036BF860005BDEE3 + D2A06E515C1386700505A0043D955DE8F00EE17CA0145D1357FE0F187813C68D + DC82FDE5E32DE658B2C47F5C732E7489601ADF925000F27DDC70CE13303AA6BF + 8000BB080091400D95BA02540CA701C0E2800EE057C0D2B0960E7E6EE4972014 + 8660D394F0DA52EDB3F190A0F6F04F5218913861013C7EDCC4001460CEDCA2AE + 23113C96855D13676A7A0641D23A1109C450015E80DCC7FE132A40B9E94DA8CA + 70DC94B0D415E0EBBF3EDE9710004FDA6A68CDDB460EE94061089750005EA00C + EAE6132F800E7D5BDB385194BD5C13D74E0DD9FE13003FDD8E4D2C0210A30FB9 + 9FE728D2EDFD1315500D84D0FE00C8500D28CFD13CF1CEE15E135480F2307F09 + 32AF0C305FF3367FF3387FF335F0026CC90EBD9EF3388F0C7ABC1357A00C3420 + 04D5A0F23D9100B50B80399176E488139400F315EF138600F4D5D0ED3AA2A99C + 5A53E30EF204B1E8E8BEE2D650F6D6A0F42957086ABFF62D0F009760F6701FF7 + 723FF7743FF705BF07AD960F1C5003D550F7727F05405101CB200425800C678F + 25208DDB3207A2394108665FF543ECF71CDED12870137950A3C96910515C01D6 + 600316D0F7668FF6585202A0EFF7A67FFA726FD37EA00FDE920F2F50006F8FFA + D6B00C09EF139740080210FBF42D4B901D5F36F0F8032FF9CDC509117F3B8A5F + 139170EC9210F75EF0139FFE006B51BFFCB23FFDA86FD307F0A7C317FBB20FF9 + 3CE1059120009560F6BB6FDEDC7A138B3C440DB00C65CFFD3B6108C21F54EE6A + E245E713236F034E20F702DF1358EE6AF4D300A50F10D6040E2458D0E0418405 + 2F39B161E30AB184080901A058D122450B970A402258E0E24790158F6CFA25E6 + E39C7F9C3E2E13482CE4458E0969BCA45973C0BC0D175FFCE1C9F345CD489100 + 5C32A8A4268079FF942E553A0700A18851A54EA58AD068CD4B546A14147034A4 + 834DE6C41EB9F8C69FCA8B2CADB93C1AF3E0B2065EE556FC90EFE3CE9E7F72BE + ACB0AC82126BD7040BB666E36852A64AF77D00206CF063C891254FA65CD9F263 + B835BD0813300972D7B9FE160B8915BBE9E33EB41697116E71B41265B6A1BDDE + 897771405E9E7B43061D1AB99857C489DF011072D9F871E4C72FD5F4C0CC0A8D + C0838505904DD14039D2E67E19B8B8CFD3CAC1358E16A32CB4FAD175E86CE3FE + 93E0658162346C3CBE64A54503FCA041DEDC97F8DF27003C4B6E4002939B8826 + 49A67BEDB149CE03A08CECC6EA8E1EF00413AF26F226A3C2419AEEF0C78FF570 + A3C98ADF22C9269B6A0811A00548843951984A628C91102B4A10E0460EE69883 + 8F74DAF1AE801383147248228B34F24824931472A6974AC0E68A16AC19B2C1F3 + C28AB0908BE6A1F0226682DC10C3234BE0F022C600D8C09E7FDEB86803F668AA + 04120196C966190B0AFE305149218B99D109D08014121B40B1C17350420BCD06 + 9B0A5E12A092DF2A21924AD98E88B0B48BD0B9E70E2E8334EF250F042DB2188F + C6AC089D74F840331FF72C62332F355EA28099166C38D186032E31D44848FC0C + 929037DEA8A1985B8315369BE55E52221B2F5AF0544848431B6D52D32CB21453 + 8BBA3CB159901C35B212512DE2832900D7C4AD4C904804C044A1261976482F00 + D0369B48DE89271F7B8A00765D7C932C1624018411C6DD229DA8725273A21D75 + CB6A836486A6062A5976482BBAB5281FC5C8A56BDC978499248060B0E9608987 + D76DED5D1BDE8847A94FECCD77E5220F0409926CEC337289EA1C208760832942 + 07E18AAC3D94669AFE0E3880022F5A3C1154892BE2046590F0EAC9628B9C5CC2 + 836D262920986DB2D67A6BAEBBEE7A64ADCF98E3937FDAF1871E3C26F17A6DB6 + B72E261866DA963BEB48E202A901668A59746DA0434B81E0822BAD8DCBAD83B1 + A8014222A9E492621AD713122140DE0692A42B1AE093706D5303E37299417C9B + 4A0488A499B94BDF06ECAC5188C78F4FD051EA9D4CB4E8D8F4B5B1A9E40B3FF2 + 288274DAB76E260B9A20D9E639B6FB9EEB59682FBA27B58A78CF5A9B4808493C + 7A0F0428C003ECB3F7C00A4828AFFC28A79FDEAD41ACA1A7A0021B2A71BEF7AD + 51DFE68B7BFC79C30FA5D6F9271F4E8A189DFD6D9A89648C4FD8CF0F6F88DBDA + 9A618CA0B44081FE56084A242E14920634035495589B360E501DE44528670040 + CD47D6D7BF4838C16EDFEBD607D8F307A855A41253E35A301CD80148042518CD + D006FBDC17AF7FACC30FE898C73DEA978F7884810891600636E4860D617CC10E + 79E88F27FCA0863C14706BD80086171265BD2C64910605E06201F4F391276CC3 + 0634609B36CE93C1EC6CB08317E15D3326412B12562E012744614884710042AC + CD185D7842A200E00121746112C0D0460DDBE6BE66640288FFE0C31DFAB3C81C + D2631D2F0064242671494C46420848B0C31CD0F48E7CCC6300142B8221B7A10D + 6378810200384016D4C7B666C8A8127C7C826122610CD195F18C80C39245D668 + 9166046309A1FE1AC006521847D90C207C7939A6BB1A2337E3596409D3A46635 + A779410A6AED0B9E58CA06F2F08E76F8D01FEDA8DF3FE2D10E4EB4439DE944E7 + EBFAF38E1778621DF9C88431B4964A00B0C89EFCCB1A210E104B0060AD82BB24 + 58192CA286B3BCA4984E1B003239B44C5681C406861BC6372C7A518C7EA30B63 + 8204469BE186FED0C31EFE00103AF6710FC4D8AF9C2B5529383FF10272FA230C + C6B0A83180D702426654A73BCD68059EF00D4254401B3CFD86193108380D5804 + 25292CA60939E750D938958E7F00094E3D3054A27E835BE7B943027EEA5190AA + D41FF2E4C306C89643C5BC63292AB55F3EEEF08179E4E31DFEC84445BF118C06 + D4A01258CDFE6A5FEFEAAE6F7860097DBDA06CD02896ED58849B504BC0E6E898 + 2AA8CA658E53E509642D12848E66B5191BAD4E5DE6F055B09ED51EF4508A2738 + 71073EA8811E92E4C46ADFC1077ABC740E7E48CF3FFCC18736D8154E59E0AB5F + FB4A8802A072237D65C25193679175DCC3B20090EA095FD0D0C81E65008EA5AC + 6E2ED281601843BBDBD5EE3020D11AAF587600E4FCEC4E9D31093BBC639E2BFD + 04273CE1093EBCE1BD73C8833CFDE0C37FA4631D6D98C4332CDA85CEF4D6B744 + ED860D86F00D6000C0AE442DAE6C544030B24C6C1E1F69AE73A30B3ECA8A2FB2 + 7CF8C4063CACD2373C011C232631899F1109247862A4E43427C5FE2152A5CCAB + 9CE34C42FE7F493C8C0344A2C43BE6718F79FC8C7381A30B1D78868F49DCE0D0 + D84C83D4B1DC583F42DDA9BE60B917BE58867D12DD01E07729B5A18091491C0C + 48C4C10FF4D8473AFA83D618530C357D40C324BAB163C305A3C85EA6F38EB915 + 0C7008B6CE480E8D26AE74913CFCC329178132655FF081294776B256AE6C7497 + B614E552E418750647378001092C60210377B8831AD6F1694ECC010E43988433 + 8C0CBC02082190C1E846AB5B4DE91D530E1CCED8C89ECFF360D2FCE28B0058DA + 726FC368F61C7A030980EEF712F0810F143AC33F89AE8BF7A1268AE818D63B7E + 862C2B31E73ABFE99A1711EC129810A337D33908224EF0A4E9CCE73E93A69713 + A347B1FE29B268604719D189AE49028C59E178E785D91BE6C3BE253D6D8053BA + 1B901A7602885D9100245CE10B4F3800BA008E2D1039DB0EC2F52F985C9137E4 + 90C2F98EB71A3CFE719087DCE31CB7F20BAC4B650010391C2B6779CB5DFE7298 + C7FCE503EF000094C92A9183FC239508470B8620F3966FF53C0630C0AE01404E + 6A5904DF24677AD3F3AD060FBB3BBA59E806D0AD7EF59703630B766B6CBE771E + 0ED1615DE8494B803FF621750028DBE96B67FBB2878DF6CA41B705C7C07ADD63 + CE8D497880220B25F9450240F7B05F3DC1DFA3DF773ED276C4279ED18786FB98 + A6FBDC9447E219E3A07CE52D7F79CC67DE1BE7DD420B6A0E8063AB9DD11711C0 + 380CFE778CCC637E18244C8ABFDFAD78D8C7FE846A30B9C456F50735A48A0290 + 78063752FF7BCB7363189108027829E2618872DCDD0238063002E00CE05BDEE8 + 1C42893D40727BD9675FFBAC4276F70DFE7DF0DB3BF952AEC80182506A6FA45F + FD95577F303039092C14D6E6C74E7ED3978B84630C23FA94F7C616BEE73AC323 + B4ED1B4002443C616BBC036002261802853226ED9BB2DDF306E03B864958A5CA + 79837DF08756B908782B400FFC408E5383EEEBBE82FBBE7B5B3AED6B268A6081 + 4C6B4106941868AB8817F0A1E1B80B10BC411CCCC1C453C1C86A2F8C3B331009 + 111D1C42222CC2A9DA4094AB0894C80726F407A5B007B44341239C422AFC407A + 8B9F2EB5620AF9F988E9AA422FFC420F743D94CB3870B93E303C433494BD2B8C + AC74588A7680BBFA4B43399CC3C54BC28BD0913980BB0EA4433EECC3285B433B + 94413F1C44423CA10F68BC403493425C444644214443C40BC3BE469C443F14C1 + 0D80446492424ADCC439B4444C949838E44451A443933BB8380AC5514C453AFC + 000F6BC556AC8E62DA005454455A9CC4431B415CFC8059AC455EEC455F3CA180 + 00003B} + end> + end> + Left = 240 + Top = 64 + end +end diff --git a/demos/IndyFTPClient/frmAbout.pas b/demos/IndyFTPClient/frmAbout.pas new file mode 100644 index 0000000..a678a9d --- /dev/null +++ b/demos/IndyFTPClient/frmAbout.pas @@ -0,0 +1,50 @@ +unit frmAbout; + +interface + +uses WinApi.Windows, System.SysUtils, System.Classes, Vcl.Graphics, + Vcl.Forms, Vcl.Controls, Vcl.StdCtrls, Vcl.Buttons, Vcl.ExtCtrls, + Vcl.BaseImageCollection, Vcl.ImageCollection, Vcl.VirtualImage; + +type + TAboutBox = class(TForm) + Panel1: TPanel; + ProductName: TLabel; + Version: TLabel; + Copyright: TLabel; + Comments: TLabel; + OKButton: TButton; + VirtualImage1: TVirtualImage; + ImageCollection1: TImageCollection; + LinkLabel1: TLinkLabel; + procedure FormCreate(Sender: TObject); + procedure LinkLabel1Click(Sender: TObject); + private + { Private declarations } + public + { Public declarations } + end; + +var + AboutBox: TAboutBox; + +implementation +uses ShellApi; + +{$R *.dfm} + +procedure TAboutBox.FormCreate(Sender: TObject); +var LMajor, LMinor, LBuild : Cardinal; +begin + GetProductVersion(ParamStr(0), LMajor, LMinor, LBuild); + Self.Version.Caption := IntToStr(LMajor)+'.'+IntToStr(LMinor)+'.'+IntToStr(LBuild); + Self.ProductName.Caption := Application.Title; +end; + +procedure TAboutBox.LinkLabel1Click(Sender: TObject); +begin + ShellExecute(0, 'open', PChar(LinkLabel1.Hint), nil, nil, SW_SHOWNORMAL); +end; + +end. + diff --git a/demos/IndyFTPClient/frmBookmarks.dfm b/demos/IndyFTPClient/frmBookmarks.dfm new file mode 100644 index 0000000..bd3c179 --- /dev/null +++ b/demos/IndyFTPClient/frmBookmarks.dfm @@ -0,0 +1,124 @@ +object frmFTPSites: TfrmFTPSites + Left = 0 + Top = 0 + BorderStyle = bsDialog + Caption = 'FTP Sites' + ClientHeight = 294 + ClientWidth = 267 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = 'Segoe UI' + Font.Style = [] + Position = poScreenCenter + OnCreate = FormCreate + OnDestroy = FormDestroy + DesignSize = ( + 267 + 294) + TextHeight = 15 + object lblFTPSites: TLabel + Left = 8 + Top = 11 + Width = 46 + Height = 15 + Caption = '&FTP Sites' + FocusControl = lbxFTPSites + end + object Panel2: TPanel + Left = 0 + Top = 260 + Width = 267 + Height = 34 + Align = alBottom + BevelOuter = bvNone + Font.Charset = DEFAULT_CHARSET + Font.Color = clBtnText + Font.Height = -12 + Font.Name = 'Segoe UI' + Font.Style = [] + ParentColor = True + ParentFont = False + TabOrder = 0 + DesignSize = ( + 267 + 34) + object OKBtn: TButton + Left = 106 + Top = 2 + Width = 75 + Height = 25 + Anchors = [akTop, akRight] + Caption = 'OK' + Default = True + ModalResult = 1 + TabOrder = 0 + end + object CancelBtn: TButton + Left = 187 + Top = 2 + Width = 75 + Height = 25 + Anchors = [akTop, akRight] + Cancel = True + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 1 + end + end + object lbxFTPSites: TListBox + Left = 8 + Top = 32 + Width = 173 + Height = 228 + Anchors = [akLeft, akTop, akRight, akBottom] + ItemHeight = 15 + TabOrder = 1 + end + object Button1: TButton + Left = 187 + Top = 32 + Width = 75 + Height = 25 + Action = actFTPSitesNew + Anchors = [akTop, akRight] + TabOrder = 2 + end + object Button2: TButton + Left = 187 + Top = 63 + Width = 75 + Height = 25 + Action = actFTPSitesEdit + Anchors = [akTop, akRight] + TabOrder = 3 + end + object Button4: TButton + Left = 187 + Top = 94 + Width = 75 + Height = 25 + Action = actFTPSiteDelete + Anchors = [akTop, akRight] + TabOrder = 4 + end + object actLstFTPSites: TActionList + Left = 160 + Top = 224 + object actFTPSitesNew: TAction + Caption = '&New...' + OnExecute = actFTPSitesNewExecute + end + object actFTPSitesEdit: TAction + Caption = '&Edit...' + OnExecute = actFTPSitesEditExecute + OnUpdate = actFTPSitesEditUpdate + end + object actFTPSiteDelete: TAction + Caption = '&Delete' + OnExecute = actFTPSiteDeleteExecute + OnUpdate = actFTPSiteDeleteUpdate + end + end +end diff --git a/demos/IndyFTPClient/frmBookmarks.pas b/demos/IndyFTPClient/frmBookmarks.pas new file mode 100644 index 0000000..9489ff8 --- /dev/null +++ b/demos/IndyFTPClient/frmBookmarks.pas @@ -0,0 +1,269 @@ +unit frmBookmarks; + +interface + +uses + Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, + System.Classes, Vcl.Graphics, + Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls, + Vcl.BaseImageCollection, Vcl.ImageCollection, System.ImageList, Vcl.ImgList, + Vcl.VirtualImageList, System.Actions, System.Generics.Collections, + Vcl.ActnList, IniFiles; + +type + TFTPSite = class(TObject) + protected + FSiteName: String; + FHostName: String; + FAnonymous: Boolean; + FUserName: String; + FPassword: String; + FAccount: String; + FFTPPRotocol: Integer; + FTransferMode: Integer; + FPort : Integer; + FPrivateKey : String; + FPublicKey : String; + FCAKey : String; + public + constructor Create(const AName: String); overload; + constructor Create(const AName: String; AIni: TIniFile); overload; + procedure Save(AIni: TIniFile); + property SiteName: String read FSiteName write FSiteName; + property HostName: String read FHostName write FHostName; + property Anonymous: Boolean read FAnonymous write FAnonymous; + property UserName: String read FUserName write FUserName; + property Password: String read FPassword write FPassword; + property Account: String read FAccount write FAccount; + property FTPPRotocol: Integer read FFTPPRotocol write FFTPPRotocol; + property TransferMode: Integer read FTransferMode write FTransferMode; + property Port : Integer read FPort write FPort; + property PrivateKey : String read FPrivateKey write FPrivateKey; + property PublicKey : String read FPublicKey write FPublicKey; + property CAKey : String read FCAKey write FCAKey; + end; + + TfrmFTPSites = class(TForm) + Panel2: TPanel; + OKBtn: TButton; + CancelBtn: TButton; + lbxFTPSites: TListBox; + lblFTPSites: TLabel; + Button1: TButton; + Button2: TButton; + actLstFTPSites: TActionList; + actFTPSitesNew: TAction; + actFTPSitesEdit: TAction; + actFTPSiteDelete: TAction; + Button4: TButton; + procedure actFTPSitesNewExecute(Sender: TObject); + procedure FormCreate(Sender: TObject); + procedure FormDestroy(Sender: TObject); + procedure actFTPSitesEditExecute(Sender: TObject); + procedure actFTPSitesEditUpdate(Sender: TObject); + procedure actFTPSiteDeleteExecute(Sender: TObject); + procedure actFTPSiteDeleteUpdate(Sender: TObject); + private + { Private declarations } + FFTPSites: TObjectList; + public + { Public declarations } + property FTPSites: TObjectList read FFTPSites; + end; + +var + frmFTPSites: TfrmFTPSites; + +function GetFTPSitesIniFilePath: String; + +implementation + +uses dkgFTPConnect, IOUtils, System.UITypes; + +function GetFTPSitesIniFilePath: String; +begin + Result := System.IOUtils.TPath.GetHomePath + '\IndyFTPClient'; + if not DirectoryExists(Result) then + begin + CreateDir(Result); + end; + Result := Result + '\ftpsites.ini'; +end; + +{$R *.dfm} + +procedure TfrmFTPSites.actFTPSiteDeleteExecute(Sender: TObject); +begin + if MessageDlg('Delete ' + FTPSites[lbxFTPSites.ItemIndex].SiteName + '?', + mtConfirmation, [mbYes, mbNo], 0) = mrYes then + begin + FTPSites.Delete(lbxFTPSites.ItemIndex); + lbxFTPSites.Items.Delete(lbxFTPSites.ItemIndex); + end; +end; + +procedure TfrmFTPSites.actFTPSiteDeleteUpdate(Sender: TObject); +begin + actFTPSiteDelete.Enabled := lbxFTPSites.ItemIndex > -1; +end; + +procedure TfrmFTPSites.actFTPSitesEditExecute(Sender: TObject); +var + LFrm: TfrmConnect; + LFTP: TFTPSite; +begin + LFrm := TfrmConnect.Create(nil); + try + LFrm.Caption := 'Edit FTP Site'; + LFTP := FTPSites[lbxFTPSites.ItemIndex]; + LFrm.edtProfileName.Text := LFTP.SiteName; + LFrm.edtHostname.Text := LFTP.FHostName; + LFrm.chkAnonymousFTP.Checked := LFTP.Anonymous; + LFrm.edtUsername.Text := LFTP.UserName; + LFrm.edtPassword.Text := LFTP.Password; + LFrm.edtAccount.Text := LFTP.Account; + LFrm.cboConnectionType.ItemIndex := LFTP.FTPPRotocol; + LFrm.cboTransferTypes.ItemIndex := LFTP.TransferMode; + LFrm.spnedtPort.Value := LFTP.Port; + LFrm.edtPrivateKeyFile.Text := LFTP.PrivateKey; + LFrm.edtPublicKey.Text := LFTP.PublicKey; + LFrm.edtCAKey.Text := LFTP.CAKey; + if LFrm.ShowModal = mrOk then + begin + LFTP.SiteName := LFrm.edtProfileName.Text; + LFTP.FHostName := LFrm.edtHostname.Text; + LFTP.Anonymous := LFrm.chkAnonymousFTP.Checked; + LFTP.UserName := LFrm.edtUsername.Text; + LFTP.Password := LFrm.edtPassword.Text; + LFTP.Account := LFrm.edtAccount.Text; + LFTP.FTPPRotocol := LFrm.cboConnectionType.ItemIndex; + LFTP.TransferMode := LFrm.cboTransferTypes.ItemIndex; + LFTP.Port := LFrm.spnedtPort.Value; + LFTP.PrivateKey := LFrm.edtPrivateKeyFile.Text; + LFTP.PublicKey := LFrm.edtPublicKey.Text; + LFTP.CAKey := LFrm.edtCAKey.Text; + end; + finally + FreeAndNil(LFrm); + end; +end; + +procedure TfrmFTPSites.actFTPSitesEditUpdate(Sender: TObject); +begin + actFTPSitesEdit.Enabled := lbxFTPSites.ItemIndex > -1; +end; + +procedure TfrmFTPSites.actFTPSitesNewExecute(Sender: TObject); +var + LFrm: TfrmConnect; + LFTP: TFTPSite; +begin + LFrm := TfrmConnect.Create(nil); + try + LFrm.Caption := 'New FTP Site'; + LFrm.cboTransferTypes.ItemIndex := 0; + if LFrm.ShowModal = mrOk then + begin + lbxFTPSites.Items.Add(LFrm.edtProfileName.Text); + LFTP := TFTPSite.Create(LFrm.edtProfileName.Text); + LFTP.FHostName := LFrm.edtHostname.Text; + LFTP.Anonymous := LFrm.chkAnonymousFTP.Checked; + LFTP.UserName := LFrm.edtUsername.Text; + LFTP.Password := LFrm.edtPassword.Text; + LFTP.Account := LFrm.edtAccount.Text; + LFTP.FTPPRotocol := LFrm.cboConnectionType.ItemIndex; + LFTP.TransferMode := LFrm.cboTransferTypes.ItemIndex; + LFTP.Port := LFrm.spnedtPort.Value; + LFTP.PrivateKey := LFrm.edtPrivateKeyFile.Text; + LFTP.PublicKey := LFrm.edtPublicKey.Text; + LFTP.CAKey := LFrm.edtCAKey.Text; + FFTPSites.Add(LFTP); + end; + finally + FreeAndNil(LFrm); + end; + +end; + +procedure TfrmFTPSites.FormCreate(Sender: TObject); +var + LIni: TIniFile; + LSections: TStringList; + i: Integer; +begin + FFTPSites := TObjectList.Create; + LIni := TIniFile.Create(GetFTPSitesIniFilePath); + LSections := TStringList.Create; + try + LIni.ReadSections(LSections); + for i := 0 to LSections.Count - 1 do + begin + FFTPSites.Add(TFTPSite.Create(LSections[i], LIni)); + lbxFTPSites.Items.Add(LSections[i]); + end; + finally + FreeAndNil(LSections); + FreeAndNil(LIni); + end; +end; + +procedure TfrmFTPSites.FormDestroy(Sender: TObject); +var + i: Integer; + LIni: TIniFile; +begin + // save profiles + System.SysUtils.DeleteFile(GetFTPSitesIniFilePath); + LIni := TIniFile.Create(GetFTPSitesIniFilePath); + try + for i := 0 to FFTPSites.Count - 1 do + begin + FFTPSites[i].Save(LIni); + end; + finally + FreeAndNil(LIni); + end; + FreeAndNil(FFTPSites); +end; + +{ TFTPSite } + +constructor TFTPSite.Create(const AName: String; AIni: TIniFile); +begin + inherited Create; + FSiteName := AName; + FHostName := AIni.ReadString(AName, 'Host', ''); + FAnonymous := AIni.ReadBool(AName, 'Anonymous', False); + FUserName := AIni.ReadString(AName, 'User_Name', ''); + FPassword := AIni.ReadString(AName, 'Password', ''); + FAccount := AIni.ReadString(AName, 'Account',''); + FFTPPRotocol := AIni.ReadInteger(AName, 'Protocol', 0); + FTransferMode := AIni.ReadInteger(AName, 'Transfer_Mode', 0); + FPort := AIni.ReadInteger(AName, 'Port',21); + FPrivateKey := AIni.ReadString(AName, 'Private_Key', ''); + FPublicKey := AIni.ReadString(AName,'Public_Key',''); + FCAKey := AIni.ReadString(AName,'Certificate_Authority_Key',''); +end; + +procedure TFTPSite.Save(AIni: TIniFile); +begin + AIni.WriteString(FSiteName, 'Host', FHostName); + AIni.WriteBool(FSiteName, 'Anonymous', FAnonymous); + AIni.WriteString(FSiteName, 'User_Name', FUserName); + AIni.WriteString(FSiteName, 'Password', FPassword); + AIni.WriteString(FSiteName, 'Account', FAccount); + AIni.WriteInteger(FSiteName, 'Protocol', FFTPPRotocol); + AIni.WriteInteger(FSiteName, 'Transfer_Mode', FTransferMode); + AIni.WriteInteger(FSiteName, 'Port', FPort); + AIni.WriteString(FSiteName, 'Private_Key', FPrivateKey); + AIni.WriteString(FSiteName,'Public_Key',FPublicKey); + AIni.WriteString(FSiteName,'Certificate_Authority_Key',FCAKey); +end; + +constructor TFTPSite.Create(const AName: String); +begin + inherited Create; + Self.FSiteName := AName; +end; + +end. diff --git a/demos/IndyFTPClient/frmProgress.dfm b/demos/IndyFTPClient/frmProgress.dfm new file mode 100644 index 0000000..811c409 --- /dev/null +++ b/demos/IndyFTPClient/frmProgress.dfm @@ -0,0 +1,71 @@ +object frmFileProgress: TfrmFileProgress + Left = 0 + Top = 0 + BorderStyle = bsDialog + Caption = 'frmFileProgress' + ClientHeight = 170 + ClientWidth = 386 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = 'Segoe UI' + Font.Style = [] + Position = poMainFormCenter + TextHeight = 15 + object lblAction: TLabel + Left = 8 + Top = 16 + Width = 370 + Height = 15 + AutoSize = False + Caption = 'lblAction' + end + object lblProgress: TLabel + Left = 8 + Top = 80 + Width = 370 + Height = 15 + AutoSize = False + Caption = 'lblProgress' + end + object Panel2: TPanel + Left = 0 + Top = 136 + Width = 386 + Height = 34 + Align = alBottom + BevelOuter = bvNone + Font.Charset = DEFAULT_CHARSET + Font.Color = clBtnText + Font.Height = -12 + Font.Name = 'Segoe UI' + Font.Style = [] + ParentColor = True + ParentFont = False + TabOrder = 0 + DesignSize = ( + 386 + 34) + object CancelBtn: TButton + Left = 306 + Top = 2 + Width = 75 + Height = 25 + Anchors = [akTop, akRight] + Cancel = True + Caption = 'Cancel' + Default = True + ModalResult = 2 + TabOrder = 0 + OnClick = CancelBtnClick + end + end + object prgbrDownloadUpload: TProgressBar + Left = 8 + Top = 45 + Width = 370 + Height = 17 + TabOrder = 1 + end +end diff --git a/demos/IndyFTPClient/frmProgress.pas b/demos/IndyFTPClient/frmProgress.pas new file mode 100644 index 0000000..2300ee9 --- /dev/null +++ b/demos/IndyFTPClient/frmProgress.pas @@ -0,0 +1,96 @@ +unit frmProgress; + +interface + +uses + Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, + Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls, IdComponent, + Vcl.ComCtrls, IdThreadSafe; + +type + TfrmFileProgress = class(TForm) + Panel2: TPanel; + CancelBtn: TButton; + lblAction: TLabel; + prgbrDownloadUpload: TProgressBar; + lblProgress: TLabel; + procedure CancelBtnClick(Sender: TObject); + strict protected + FCancelPressed : TIdThreadSafeBoolean; + function GetCancelPressed: Boolean; + procedure SetCancelPressed(const Value: Boolean); + public + { Public declarations } + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure UpdateProgressIndicator(const AFileName : String; + const AWorkMode : TWorkMode; const AWorkCount, AWorkCountMax : Int64); + property CancelPressed : Boolean read GetCancelPressed write SetCancelPressed; + end; + +var + frmFileProgress: TfrmFileProgress; + +implementation + +{$R *.dfm} + +{ TfrmFileProgress } + +procedure TfrmFileProgress.CancelBtnClick(Sender: TObject); +begin + FCancelPressed.Value := True; + CancelBtn.Enabled := False; +end; + +constructor TfrmFileProgress.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + Self.FCancelPressed := TIdThreadSafeBoolean.Create; + FCancelPressed.Value := False; +end; + +destructor TfrmFileProgress.Destroy; +begin + FreeAndNil(FCancelPressed); + inherited Destroy; +end; + +function TfrmFileProgress.GetCancelPressed: Boolean; +begin + Result := FCancelPressed.Value; +end; + +procedure TfrmFileProgress.SetCancelPressed(const Value: Boolean); +begin + FCancelPressed.Value := Value; +end; + +procedure TfrmFileProgress.UpdateProgressIndicator(const AFileName: String; + const AWorkMode: TWorkMode; const AWorkCount, AWorkCountMax: Int64); +var LStr : String; + LPerc : Integer; +begin + if AWorkMode = wmRead then + begin + LStr := 'Downloading '+AFileName+'...'; + end + else + begin + LStr := 'Uploading '+AFileName+'...'; + end; + lblAction.Caption := LStr; + if AWorkCountMax >= 0 then + begin + LPerc := Round((AWorkcount / AWorkCountMax) * 100); + Self.prgbrDownloadUpload.Position := LPerc; + Self.lblProgress.Caption := IntToStr(AWorkCount)+ ' of '+IntToStr(AWorkCountMax) + ' ('+IntToStr(LPerc)+'%)'; + end + else + begin + prgbrDownloadUpload.Style := pbstMarquee; + Self.lblProgress.Caption := IntToStr(AWorkCount); + end; +end; + +end. diff --git a/demos/IndyFTPClient/mainform.dfm b/demos/IndyFTPClient/mainform.dfm new file mode 100644 index 0000000..cecfad5 --- /dev/null +++ b/demos/IndyFTPClient/mainform.dfm @@ -0,0 +1,1463 @@ +object frmMainForm: TfrmMainForm + Left = 0 + Top = 0 + Caption = 'Indy FTP Client' + ClientHeight = 400 + ClientWidth = 741 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clBtnText + Font.Height = -12 + Font.Name = 'Segoe UI' + Font.Style = [] + Menu = MainMenu1 + OnClose = FormClose + OnCreate = FormCreate + TextHeight = 15 + object spltrLog: TSplitter + Left = 0 + Top = 279 + Width = 741 + Height = 11 + Cursor = crVSplit + Align = alBottom + ExplicitTop = 264 + ExplicitWidth = 689 + end + object sbrMainForm: TStatusBar + Left = 0 + Top = 381 + Width = 741 + Height = 19 + Panels = < + item + Width = 250 + end + item + Width = 50 + end> + end + object pnlLog: TPanel + Left = 0 + Top = 290 + Width = 741 + Height = 91 + Align = alBottom + BevelOuter = bvNone + TabOrder = 2 + object redtLog: TRichEdit + Left = 0 + Top = 0 + Width = 741 + Height = 91 + Align = alClient + Font.Charset = ANSI_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = 'Consolas' + Font.Style = [] + ParentFont = False + PopupMenu = ppmnuLog + ReadOnly = True + ScrollBars = ssBoth + TabOrder = 0 + WantReturns = False + WordWrap = False + end + end + object tbrMainProgram: TToolBar + Left = 0 + Top = 0 + Width = 741 + Height = 81 + ButtonHeight = 70 + ButtonWidth = 71 + Caption = 'Main Toolbar' + GradientEndColor = 1182475 + Images = vimglstMainProgram + TabOrder = 0 + object ToolButton5: TToolButton + Left = 0 + Top = 0 + Action = actFileFTPSites + end + object ToolButton4: TToolButton + Left = 71 + Top = 0 + Width = 8 + Caption = 'ToolButton4' + ImageIndex = 3 + ImageName = 'libre-gui-settings' + Style = tbsSeparator + end + object ToolButton1: TToolButton + Left = 79 + Top = 0 + Action = actFileConnect + end + object ToolButton2: TToolButton + Left = 150 + Top = 0 + Action = actFileDisconnect + end + object ToolButton3: TToolButton + Left = 221 + Top = 0 + Width = 8 + Caption = 'ToolButton3' + ImageIndex = 2 + ImageName = 'libre-gui-copy' + Style = tbsSeparator + end + object ToolButton6: TToolButton + Left = 229 + Top = 0 + Action = actFileDownload + end + object ToolButton7: TToolButton + Left = 300 + Top = 0 + Action = actFileUpload + end + end + object pnlMainWindow: TPanel + Left = 0 + Top = 81 + Width = 741 + Height = 198 + Align = alClient + BevelOuter = bvNone + TabOrder = 1 + object Splitter1: TSplitter + Left = 286 + Top = 0 + Width = 11 + Height = 198 + ExplicitHeight = 204 + end + object pnlLocalBrowser: TPanel + Left = 0 + Top = 0 + Width = 286 + Height = 198 + Align = alLeft + BevelOuter = bvNone + Font.Charset = DEFAULT_CHARSET + Font.Color = clBtnText + Font.Height = -12 + Font.Name = 'Segoe UI' + Font.Style = [] + ParentFont = False + TabOrder = 0 + DesignSize = ( + 286 + 198) + object lblLocalCurrentDir: TLabel + Left = 5 + Top = 9 + Width = 58 + Height = 15 + Caption = 'Current Dir' + FocusControl = cboLocalCurrentDir + end + object lvLocalFiles: TListView + Left = 0 + Top = 36 + Width = 286 + Height = 162 + Align = alBottom + Anchors = [akLeft, akTop, akRight, akBottom] + Columns = < + item + Caption = 'Name' + MinWidth = 150 + Width = 150 + end + item + Caption = 'Type' + MinWidth = 100 + Width = 100 + end + item + Alignment = taRightJustify + Caption = 'Size' + MinWidth = 50 + end + item + Caption = 'Last Modified' + MinWidth = 150 + Width = 150 + end> + PopupMenu = ppmnuLocal + SmallImages = vimglstSmall + SortType = stBoth + TabOrder = 0 + ViewStyle = vsReport + OnColumnClick = lvLocalFilesColumnClick + OnCompare = lvLocalFilesCompare + OnDblClick = lvLocalFilesDblClick + end + object cboLocalCurrentDir: TComboBox + Left = 69 + Top = 6 + Width = 214 + Height = 23 + Anchors = [akLeft, akTop, akRight] + TabOrder = 1 + OnKeyDown = cboLocalCurrentDirKeyDown + end + end + object pnlRemoteBrowser: TPanel + Left = 297 + Top = 0 + Width = 444 + Height = 198 + Align = alClient + BevelOuter = bvNone + TabOrder = 1 + DesignSize = ( + 444 + 198) + object lblRemotDir: TLabel + Left = 0 + Top = 9 + Width = 58 + Height = 15 + Caption = 'Current Dir' + Enabled = False + FocusControl = cboRemoteCurrentDir + end + object lvRemoteFiles: TListView + Left = 0 + Top = 36 + Width = 444 + Height = 162 + Align = alBottom + Anchors = [akLeft, akTop, akRight, akBottom] + Columns = < + item + Caption = 'Name' + MinWidth = 150 + Width = 150 + end + item + Caption = 'Type' + MinWidth = 100 + Width = 100 + end + item + Alignment = taRightJustify + Caption = 'Size' + MinWidth = 50 + end + item + Caption = 'Last Modified' + MinWidth = 150 + Width = 150 + end> + Enabled = False + LargeImages = vimglstSmall + PopupMenu = ppmnuRemote + SmallImages = vimglstSmall + SortType = stData + TabOrder = 0 + ViewStyle = vsReport + OnColumnClick = lvRemoteFilesColumnClick + OnCompare = lvRemoteFilesCompare + OnDblClick = lvRemoteFilesDblClick + end + object cboRemoteCurrentDir: TComboBox + Left = 64 + Top = 6 + Width = 373 + Height = 23 + Anchors = [akLeft, akTop, akRight] + Enabled = False + TabOrder = 1 + OnKeyDown = cboRemoteCurrentDirKeyDown + end + end + end + object vimglstMainProgram: TVirtualImageList + Images = < + item + CollectionIndex = 0 + CollectionName = 'libre-gui-link' + Name = 'libre-gui-link' + end + item + CollectionIndex = 1 + CollectionName = 'libre-gui-unlink' + Name = 'libre-gui-unlink' + end + item + CollectionIndex = 2 + CollectionName = 'libre-gui-copy' + Name = 'libre-gui-copy' + end + item + CollectionIndex = 3 + CollectionName = 'libre-gui-settings' + Name = 'libre-gui-settings' + end + item + CollectionIndex = 4 + CollectionName = 'libre-gui-address-book' + Name = 'libre-gui-address-book' + end + item + CollectionIndex = 5 + CollectionName = 'libre-gui-about' + Name = 'libre-gui-about' + end + item + CollectionIndex = 6 + CollectionName = 'libre-gui-folder' + Name = 'libre-gui-folder' + end + item + CollectionIndex = 7 + CollectionName = 'libre-gui-file-document' + Name = 'libre-gui-file-document' + end + item + CollectionIndex = 8 + CollectionName = 'libre-gui-arrow-up' + Name = 'libre-gui-arrow-up' + end + item + CollectionIndex = 9 + CollectionName = 'libre-gui-arrow-down' + Name = 'libre-gui-arrow-down' + end + item + CollectionIndex = 10 + CollectionName = 'libre-gui-download' + Name = 'libre-gui-download' + end + item + CollectionIndex = 11 + CollectionName = 'libre-gui-upload' + Name = 'libre-gui-upload' + end + item + CollectionIndex = 12 + CollectionName = 'libre-gui-close' + Name = 'libre-gui-close' + end + item + CollectionIndex = 13 + CollectionName = 'libre-gui-action-select' + Name = 'libre-gui-action-select' + end + item + CollectionIndex = 14 + CollectionName = 'libre-gui-eraser' + Name = 'libre-gui-eraser' + end + item + CollectionIndex = 15 + CollectionName = 'libre-gui-frame' + Name = 'libre-gui-frame' + end + item + CollectionIndex = 16 + CollectionName = 'libre-gui-folder-open' + Name = 'libre-gui-folder-open' + end> + ImageCollection = imgcolMainProgram + Width = 64 + Height = 64 + Left = 208 + Top = 112 + end + object imgcolMainProgram: TImageCollection + Images = < + item + Name = 'libre-gui-link' + SourceImages = < + item + Image.Data = { + 89504E470D0A1A0A0000000D494844520000004900000049080600000071730B + DC000000017352474200AECE1CE90000000467414D410000B18F0BFC61050000 + 050349444154785EED9A314C14411486EFCC15848A104230A1C08E0489949858 + 6087951A0B29292DB102BBA3522BED8895252558A1955427566825B139A050BB + F32A8D21C1FFBFDB39E766DFECBEBD5B28CCFB923FB737CCBE99FD77E6EDCC1E + D5F3F3F38A91CD95E4D3C8C04C5260262930931498490ACC2405669202334981 + 99A4C04C5260262930931498490ACC240566920233498199A4C04C5260262930 + 931498490ACC2405669282817F77AB56AB33F85886EE4223D018B400397E429F + BA879523E80DDA7ADBFD5A0EE8C3223E1E42AEDD5968AA7BD881EDB31FBFA177 + D02EFA708CCF62D0A42202ECD07B9E3A805A501D1A91626B051E41DFA130BE46 + 87D092143726B13026F022696858F1020B7594021C29BCC830DE20DA86C6A476 + 428985A1180C1A74F464694D6A4F12B8077124863186D11768566ACF9758E80B + 30DF7C80FCE0652AD728C0DC179E579638AA67A4769D721337922387E54AF79B + C841A2CF50981497A01B10F318137D8CDBE8C77E72DC47F280E014E36896F801 + 31417F84D80F2669079338DB6782A778C325781EFBE09FFB0FE79624C021EEBB + EE8BA32B77A83A0126DB5F501887E2DD149339D84BEA487A0AA91E02808665C5 + DA90CEA3C4420AD075CE593F90535D3A274F8089371633D54910BB49347531AC + AF11584D6284E20D9C12CF910A29C029E60771DA93EA6B0538F5A411D512EAC6 + 1E162B61DD22021C81614C4ABCF9A90227F0DA3BD9894F17D1ED22025C2B85B1 + A9DEB2003007857FA7B6FD588308C466C9A1543F9AB891306948982C5FA2FEE3 + E45845BD5E67C2E4D3A9C7D9D959ADD168AC23562D29EA303E3E7E303F3FCF95 + 71A5D96C5E3F3D3D7DD0F983C7DCDCDCAB898909266B9F03B45368358FEBE3B4 + E34008B98A7EF5C5174D42003ACD2911721FF57793E35C363737B7F0C1847D19 + ECA36F776096FC840AC035BAFC18721371F8B4EB11DBE0FAFB1F1FB717CB059D + 65272ECB20C2E546DF88CD0246703FC97D5D48EADA6326C5D61352D018B11817 + 49D136A551978A1133299CF30EE6172DBC53EA915702ECB3B82095C074E38891 + 664CEADAB312377352E8EA13D47F961CE78229378638EB384C997B7272720BB1 + FA12F7E8E8E8B7C9C9C9AF3C6EB7DB53AD568B53B68FE9E9E946AD56FB937C75 + 1C23D673B4C71BA302FDE21A6CA7FBAD8F6B88D5BF73A0499280B43AE5F660A8 + D71C1488EDC57AEB1FC0ED48F8772ABA322E22C0ED5618BB29D6950A29C0A4EB + 07701A68B5ED04B8AC90DE0575466E50575ACBB09E7A3B2409C416CA5B627DA9 + 90029CAFD2AB0976B2F0BB202720DD412AB548046BDEDF7D71DFA87A17140A70 + 844A37895A10CF910A9D40AC93947A734901E697D82B171A9F5AC903E6C4D805 + 35A142FB37C00564EC9D5474252F163A017632B621A598A3B8C5E01A25756701 + 8DE1D0E61B4D1A119EEF149DC220EF5D925BB0A60C03EC3FFBB60165BD01C8DC + 6E8985BE008767CCFD32B423B5EB0BC436A46569596AD7492C0CC520D04518A5 + CE2D2096CB86D5AAD49E2FB15012707B1DBF8161C46952683901B2726451F1A6 + AB1E4062614C80739CF37B985155F8271D5F80372B2BBFE489B9913952FD7414 + 0BF304B83C60B2D476964F288E9CCCB95F44802FEF78B1DAD1CDA9CD9198F9D2 + 5F52EE0F015AB0CC975EB41F217E6C1F582A689F8B54F74B6E0FB4AFDECFC528 + CDA4FF19FB87090566920233498199A4C04C5260262930931498490ACC240566 + 920233498199A4C04C5260262930931498490ACC240566920233498199A4C04C + CAA552F90BD78D6F41EF4331B50000000049454E44AE426082} + end> + end + item + Name = 'libre-gui-unlink' + SourceImages = < + item + Image.Data = { + 89504E470D0A1A0A0000000D494844520000004900000049080600000071730B + DC000000017352474200AECE1CE90000000467414D410000B18F0BFC61050000 + 066A49444154785EED9B2F74253514C6DFA0D651B9282AEB60DD3A8A2B8AE28A + A2288AA28EA2A85BD9832AAE8BEA59D5A20A6A715DD745755D4115B7EB76D53E + 7EDF7B99D74CE66626EFCFE4ED83F9CEF99AE44E9297DC496E6E3269311C0E07 + 3D9AF19E0B7B34A05752027A2525A05752027A2525A05752027A2525A0575202 + 7A2525A057520296A3A4A2B8070F8745B1E724ED288A4DF21F13DE77927CD0DE + 2D27DF0E063BF0961DE390F0DACA6391BC67AECC4BC20378CFCAD7054D61271C + 0CEED3C1CBD14F7A44B665E6F7392EFB3A287743F8B1997FC1CC37DD86C37FF8 + 2B86F8C6854DD82B18392E5EE20D7C318E768BBC472545B1C6AF5DD1E1752729 + F18153621DD82FCADC5066628B48BF21FD8032599494D7700F87AFF8FBA53A39 + 168C41FA3B17B5B0E52B4820FD6D2E058D10CEBF1CC49EECA318626392962137 + 0D31CF9E06794FAC7C5DD214E6209D1DAD565EE7776AF96498AB79AE09B3AD6A + 2597E64C3265BEA6C37FB9A4509B723CFFCA454B3BF405ADAE4CD52CB034978B + 8C8C87D05FDAEF9674464CF06CD72F9B934BDD96B0B43E23F8619C42139E3B40 + 7CB2EC137F4C6B1F8F1E2C010B73018AA2784810FA32CFA8BF757AB0DD384321 + DBB444534AEEC02B64721564935E106AB96FAD87366CBAE804FCFE1F2E3A3BCA + 21350D819664EDBB2E54450B5FC3A7F014DA1EF260B0C6D4BA81178A434DB523 + 37DD36AC3240BED60954DD2FA1844DBC84FB70DDAAAF89A63046A0917200531A + 15A33AB559AB1FC51BB2B550064AE594F54D4BBDB42358AB3B465368116CC06B + E8FFE03C9CDADF01BB5EF979A9175D7F59064D6148B0E52AF57F64113C83497E + 0FD0080ECB2F82ADABA629F40934BCBB5050C90BEB777D82AE1454B2F124C214 + 9604B2414D53EC0A1E42AD2A96FD50793D930D6852F47E58B624D0AA19E6F729 + FBB40D9B7E5F4A6E5A64D4B6BA4D74348525815603BF329F8F60F2160168446A + 8509EB11654C6B8D04EAA45E44985FBC810FC3324D04B269B197756A9511A37E + 123E8796798DA2B591E00EF2573EA3DC4CFE07F54AF1619D827CAADF5C7C04F2 + 6AB1D819A72A501B7E26BF4E15A60275962FCB3A067E409DCF5DFC0E52924520 + 3FC8D774C9432BFF2A1148F161BFC46333BF251481358735F4B3EFC2BB209073 + 1BF6EFC6CADBB477ABB9F8E00985F2EFC2BBC11317FA5877D3B10253496494CD + 90D10C519FAFAB0B6DAE2DA4290958464D8855BC726046C43E4CD4FA1E53526C + 4A59ABD22AC39A2DB5BEC794647FB96017EFC29587732FAC975EEBBBA924679C + 2D1FE41317FE17204FDE827FA43C426C2409E72EF4B1CB1B88D9AB95017DD034 + FB7E9CAAE0B9B355153429E97717FAD0F0D45E69D5F123D4740BF1AB0BAB90B3 + 641148DBB1CDED4C5E3750C3627BB10323BF8E68C27CE22D4C3A0B0A09626752 + E6FE7154C6129604DA5DFB15F9D4FEC73C5AB508D4383524AC478C7AF240674E + 61FE928FAC321681CC44D34940ED25956CFD10C0FC95FB6E6D324BC87712FF84 + A1D1D36AF82194B26B4E9A077B63099C0DD48EDF5AAE05D910D9CFBF61E8C7A9 + EC475046DAFA505142E53EA50DB6EB536A2B46A08A63471C8B60FBC9E078DAC5 + 46E1BCD4D46DFC38600A4302196C1DE0FB95CF4B75BAFE693B42A0BDE4A24F48 + 65735B4D86298C11E884D1FF9159A9B7D77E792B20D0F4D5D40BEB9B85322349 + 5F4C4C6113811A3AEBA85207754E35D7710B908D8CAD926D54B9A956C656C31D + 0306558658B6E273183388828CB98CAA1C35CB419D19B441C6586D781F366D99 + 6490E5F79DD3869A47DD869995F47F4293C79D15C3A2386168C8971A81F496EE + 08206B1AA579A091B46CBEADDE7CDB80BA0B505E63CE7EB32DA429CC499430B9 + A34438F95049FC68D4BC31977637493485D9C8128C32741F9BD488DBDEB3F552 + EE9498BC055A344D612ED2F9C9BD49E2B72DCF97725F525C9AE1C628EFEBE296 + 4BEA0EE54F2E3A01B25F5C5471D9AA6397CC0B4B735D935151B92BE9E2E63105 + CFFCE92866B74FF947D2F873D52923C35FDACF694DEC5CBD32C25092FE53C93A + 30EB0E96E6BA2423A3727F5BD4C8B2F28EC808F3479DCB9FD53E99C2AE48E72A + FF092022BBB2F2FA24CF89512E9BFF640A3B214B3A1DD3FFAA91BA23B23D33BF + 4FF6656139C7998E70A7A529EC8C6345F9CBBA9496346DC87BE595BB8453DD4D + 9A87A6B0733202D46978643EB7C8AA46FE5B987C50B7282EF714402B5DEA45AC + 72A3BB845B2DFD514902DE99A3927719BD9212D02B2901BD9212D02B2901BD92 + 12D02B2901BD925A3118FC0BF960F9143B43261D0000000049454E44AE426082} + end> + end + item + Name = 'libre-gui-copy' + SourceImages = < + item + Image.Data = { + 89504E470D0A1A0A0000000D494844520000004900000049080600000071730B + DC000000017352474200AECE1CE90000000467414D410000B18F0BFC61050000 + 02B249444154785EED9BB172D34014452DAA949474843FE013A04BC7A483CEF9 + 025A3A68A9802F483ACAA4832E942929E9A04C193A3A73DFEC0A366BC9B95A59 + D283BD67E68E5689AD591DFB3D4BB2DC6C369B95D8CDBDB8143B902402492290 + 2482CEC6DD34CD7D2C1E87B559B8C23C7EC5B13BFA243DC1E232ACCDC267E4D8 + AB282FE576849CE3C53908ABBEF0D493DC8A62CBED1AF916867BC1FA9DF5BD2E + FC959E49CA034C920DDA9C763DAE34C05E8074FB793E21075DCF5D225ECAED6B + 5CB6B82A3D2F925E205666296E44799164FDE7187129CACDA71B6ADFAD284F87 + 006E45B992647814E545D24BECFC9B36587F85D8275E7EAC64A23E86E18CB4C7 + 0269C0D2C749BBF2BD6B9B53C65DB979449208D873B7333CEE248E4783EDAFB1 + 380C6B14AFE3D2B8413E8421C50DE6FE3E8ECB68EB2E0D98B4270D4D3697928C + 9A7F2DE5B6C6BBF7348E0753534F2A16B5484F1A0AE6934EF2AE9EF410B19ED7 + C7F07D69EB2E0DF0DC93761E27817CEE5D19B43F3594DB05925FAF1A547A3548 + B2F27C8A148BAAA271A3644689AAE6D36D8CA89A0E018A455525C928115583A4 + 23ECFC651AFCED3CFC6B0B13F53C8EFF5083A407881D3BE5E9BB2164EBCA6775 + E556822411FC7792D098BF20764E4A054F390BCFEC47EF240249229024024922 + 902402492290240249229024024922B043F338FC4BB3FD9592DD2BF4360C1721 + 9DCB0FCCF9511C8F06FB6AD790D2AFA04EB0FDDBA72A26290F3049E957309EB2 + D75B6F80494AB7BFCE1FA37223902482BE9E6457EDDE85B549C87F367185E4B7 + FEF5718D39DB7DDF7BA1B8274D1D608D38ED03875D8F9B23403D691F48128124 + 11481281241148128124114812812411481241E7B9DBD4E07CC94E4BEC724C8B + FDACE16718CECE3324BDC3C4EDB99BA7E8DCAD04492258AA270DFD29D79C5CC0 + C9ADFB291791F4AFA1722390240249BA93D5EA37D8DE6F57EB2AA1C000000000 + 49454E44AE426082} + end> + end + item + Name = 'libre-gui-settings' + SourceImages = < + item + Image.Data = { + 89504E470D0A1A0A0000000D494844520000004900000049080600000071730B + DC000000017352474200AECE1CE90000000467414D410000B18F0BFC61050000 + 094349444154785EED9B4D70144514C75FEFE6134416CAD2A096861B54F9116E + 7012CA837012AA2C0927C241D914F2112F409556CC89501E124A31010F849358 + 1EC8CD78223738493C918316012F944011044292CD6EFB7F336FC3ECEECC74CF + CC7E08955FD5B2DD9DA4A7FBDFFD5EBFEE6994D69A56082725DF2B84B0229205 + 2B2259B02292058D73DC632A43F3D425393B5274873ED7D392AB1B0D11499F53 + 3B49D365A5A84D8AAC4173275456EF926C5D6894B91D8C231083BFDB49E7D526 + C9D6854689D429DFF1285087A4EA426344D294742624133922F51709A612D7D4 + 96D12FF84C82E34D3C0B749A5E93645D6884B92577BA2FF44C1A55DBF1EF7E37 + 9388ED30DBDD92AE39F58993D0213CE6A8E2CE5511B47C46691AA0AC1E93A29A + 104B242718243A8E4FB19133CE0FCA819346F51720CE5629A9092C16BE7AD541 + 3DE1969431A6DAF402F520B517EDBD1855D4E8229D551D709C37BD2B146A1857 + 2988F5999E9222A21175422BEA4FBC924500CF1B562D74927AF4BC53C06D6DA2 + A34865315019A70CE8026D53BDFA9A648D441609B38867068F4A05A86912A29C + A98569D982674FA32103F0B61F85B4730AB36E8B648D4413E947D58568F7BAE4 + 9E6BD06B36CF51C986126975C3341D91E48B403FFB2A4987622D921E51DD7570 + C0B36CB2F2B923C535017DE9D08B744AB2A1D8999BBB3ADCE48AA5A42AE4E15E + 176789720FB167CDA1204D1B33C3652BA5EB7C3926DA5B6D3F87AECF63C1D962 + 3AA3B29A4910A8BF9A02E59ED0C3477F113DFA9368E19E08C42CF938DA43FA0E + FB0E7C76E0E71BD0312B3F6203AFBCA8CF389BCC228DAA4ED8C131C925027376 + 0AFFEC787C9306F34FA5B094BDF2ED0F0B96D5BDB095CD6C92529A080CFE6E53 + F46E1409B1C75035621D8CD8846AA51D08E426559A2E4971298A36DD3B6C71A0 + 06F3405DBBAA35AB504FA8130F17097B2D47E98460D4C79C23D71E0D0F84A80E + 7E2768263469CBBD1D02469E55A8A7574A62833E76C1A564255B41A8483C8B24 + 191B67061DD40724BB0CCA7F9664097866B724AD607F05A106259B847E5E2424 + 5D42B048081C5961C9C5028D9FC224DE23D912524D8EC9B9DB070F7866E7FD23 + 2A52A801A14EE259E3928D059E9B9155B4826091F28859B0444A2E16585E0F2C + EFA3CA80C9B1E9F99A5CDAD6E43CA825EA4DDA5EE0BB510F168977F68AF66084 + 620575CEC87A37BC3E1478475E46533B51F36AFA54B2F660E5437B4F4A2E122C + 2EDA1B788A600E26DD5DFF05AC707C3C620F07690691667A545B660D3D685E43 + 6DADAFBA027941D3A66106A7AD8F366204BDCE335270092101A5FD0637C2D107 + 6A9C74823F13632A93BB4FBF37BF441BA5C417347142E561BA3C5B0C20EC1C41 + 1B03572A2FA877143EB32FC82514090F01BCF4EA410E042180B38C1BF05DB9CA + C1A80F9904627816C3A95E966C28984556CF6657E204A60681187B91801C5419 + 45821335AE347CBA890EF99EF7F881DFDD8A71FF46B2C12058C5409AFD688EAC + 0FDD2289C4A0B1A1AF849C99666116F8C58A182CF788E8C96D226C5B68119BDE + 7250F7713651C98661BE54D162EFB7A28914106C95A02D46111D8509956C3F1C + 816EE1FB5FEC739F10CDFD8D200A9B5F2FEC0FE76ED397165B17B3EF8AF0AA3C + 9A4836EA2B0B917CAEDC2CDCA345492EB37057121E94A6AF9B886ECC1E564F1F + 1C5657F01942BAA72400B56803EAA98D487AC962A36B13D0A59E1DCA17C1C8B6 + 48F219B0AF7260EE45DA90E6BD259F505C40007A1562E9D92FD4D5C559FAD0FD + 95EA10CD71DBCC126531423E4EB379AD243C207EAA205F31DFCA50B415B3E45D + C90593B25AA51DA2995BD0FBB552CC22C1B1978712ADEB61CD9EF9C502B5BF21 + 190FF9394984906A9644083A6F31E0423491806979C5F4EFE0C857B281C039FF + 26490744BDB4EA4DECE9DE713FABDF76CBBCB0732F2C49260405A765C2CA2A84 + 682259749ED14FC3CFA0660FA9AEB95BF4319F71DB827DDEFD857FE07F340D62 + A026112DFB9A4BBAD5FD1869B33737FB6D09BFB22E38F71C8D2787A8F112B625 + FB245BC2EC31D54979BA8A64077766D55BE64E8969EE2BDF80725D851C6D4AC1 + 0FE177DEC734EE6A7F853ADB2CD62DFCFE8CB36733EC2F192B91101D6751ABF5 + 312EAA9CC79C5B571EF2A353195A82401EA1D9A4DA5F2FF5475E5097F5BE8D29 + 9C537FA0CAF7241B8AD3CE14EDC3E6367487102E12823EECAFF8B576E4235CD4 + 3AC88761927576FC6BD7D0AFBC6C4B5109A916BA0B3FF455BA852099D3816995 + A6A9485792F9405FDBEDF14A702F7D046E798245728F1D6EA053B16EA639A394 + C7E655660062989FF01574343B4F05DA96396B9EFA81707BE7E9BA8D3BF003ED + 1D7536BC3E043A6E08C4815AECAB7B6C9AD8B93BFB3304783C4A8167D78502ED + 492410334F27E20AC4E06FB391CFB8552B5DC31CB35E01FC80C8DDB96FD52F48 + F44B51259AFAD69F0DB8576489735F2AEC1916387D5DEDBF5B080E01DCD73F03 + 6E263ECD2FD327F8F882860D67BED7C3928D07DF742162534ECA80F4B9826091 + 006613BFAE496606603596798EA8BDC0078CAFFB4EF74936163C8310965CC18C + B5393E0984FBC87D956C05A122C9121EEB70BD1C5EE6DB3740787EA2A66B0F1F + 63E94DC2883A017178B54C2490F0EC769C0FB671D2653426F19B5C06DB8A3C46 + FF48FAB0FE418AA2C197540B742A8993F682DE8F2354F17D3758C42EE276A36D + 5E5EAD82491BF054BE947A1173F99231161A559DDA7D5BB31F8355B53B524E98 + 42B4D9B471B71309E8F36A089DAACAED9272D08469AC4E1C4F5DC33316DC5294 + 2BFA005F197424D19BE420D0F3928037086B9124B8ACFA45AE46815EDF81B3DE + 18E68B8A843B6E2FA80CA35C1527FEBFA0607EDF56C45E2426ABC73002812101 + DB387ECEBF9328084D02CF106E83647DC1CF2755AFF6BF23E54334919842E57D + 203C94EF1BF561E7BF01367E402D3937D1ACDF6B550B3C731C26B499DB80CC46 + F8B4611E38F9F132084322C567F63EC90BBF24C436007F3A81079E0B3C6AA8D3 + FF0A400F66E10AFA78A64BD133783F96C64F9473013F83413EE9BC8D8E403C91 + A2E02EDFFDE84977B5C562713058632A47A76DCF9BE2507B918AF0ED94663A8E + 91CC26154B66CE19D4320CE75B73FF573F918A88A94A2E1E9A0EF89A568D88EE + B81302D34B6C16D5A8230A751709A696B883582C5E6C91A2BC140C6471652699 + A9E14AE647DD4532EDB84D609949F4F771A8BF4880835049C6A1EE917CFD4300 + C67D9FD78D5827EA89C20C62A3F17AC4465E1A23D2734643CCED796345240B56 + 443242F41FD7E18A00CEF5AEFA0000000049454E44AE426082} + end> + end + item + Name = 'libre-gui-address-book' + SourceImages = < + item + Image.Data = { + 89504E470D0A1A0A0000000D494844520000004900000049080600000071730B + DC000000017352474200AECE1CE90000000467414D410000B18F0BFC61050000 + 06F449444154785EED9C7B6C145514C6CF6C5B644BA91B0AB2481BCAAB22C5D0 + 0A9285840A620484284451437C34680C4610C588989A088995A0517968403404 + 62C41834F08718343E6A01A9486409292180B60848D142785381769C6FE62E9D + B93BB37BF731D3E932BF64B3F7CC4E979D6FCFEB9E092BC9B24C1EB1F1B1678F + 18782209E08924802792002925EE11852B42ADE4EB8AF590DEC1D6803F2F4B7D + C1A5ACDE3EA9862D13226191CA0B972F9464DF4492681C3BA432B0579F70416E + 5E1933DD8B4C61E5B3D7B4E4B42C5E5733ED0C3B1A136191CA82CB8AA5ACACCF + 258942EC90814E231243B9EA269F244F5FB57D721D3B6489704E8A2550674422 + 0AB6C9D2A6CA719B03EC902542229515AE783193048A00A1BA5EF12F61A62542 + 2249B234912D3310F931B6B0444C24CA3C2FBA8E4481D9A1ADC5CC3225AE4848 + D87823666626D9949A481E9E4842782209E08924802792009E4802782209E089 + 24806B452A1A9C4F25E53D68C2A3C534F5E9415456D15BB5F30B6E62673847DC + 51093A6E5F765603332D49755452D0C74F631F2CA28AE945949B97C38E5A535F + D74C3F6E6C549F5346A2F1B106721D2E52FFD2004D78A41F8DBCB70F3B9218A7 + 4E5C56C43A423F7CD1C88E24411C913A34DC2AA615D1AB6B42960235D49FA183 + 7B4EAB0FACCD8007CE7861083DB37838E574B1E7723ACC937061C8377A2E5DB8 + 4A3BB71CA76F3F6BA073A7FE63478D20141192F7CCE817959F8E1E3A47EFCFF9 + 4D7D9F8470A327CD7CA5344A2084CBEB0FD5D2C615072C05021060EBA77FD282 + 077EA20DEFD4D3D52B6DEC152DD93F59358C59E9C3719146DFDF570D333DEBAB + F7A9E224EA01B59B8FD2CAF9BB0D7F872AC8BF7FAA382A929A3FE60D6196C6CA + 9777D3CE6F8E332B7190AF562FDCC32C8D19F36E17AA90A2382A12F290FEC3C3 + 13629570543E7806FA248427FA24B38B8750E1DA93CC2235818F9ED29759A9E3 + 58E246BEA85A378659A4E69DAA877F36E494081003C2E0D98CDDDF9FA0AFD71E + A6A62317D911CD4BABBFBC9B595A12AFAEFC855971704BE29E326B205B69A082 + 9909048F99FFC1284B81005A86451BC61ACE41BFA46F13F0A540B874E08848F8 + B0089B0810A776D35FCC6A07022124F5E0DC48AFC4C38BB077DB3F6CA5114BE8 + 447044A4BBB86611E1C27B51B05F379A36BB84591A680BE68EFF8EDE9BB34B7D + F0C07BF420C4F420A7A50347441A3EF616B6D2E0BF713075D62043C78CA48EB6 + 208259E89C3B6DECA78E1E3ACF561A05C14E126EA846FC377AF07763E8A0731E + CE852312B39EFC1ED1BBFF4B17AEB19506DF84E676CF66ABD4B05DA4923B8D79 + 0121C1378D63940653EF457B95722E72C1B13A7360266C32D82E52F1D09BD94A + E3A4AE6C47C088444FC3FEB36CD50E7FC16602A5B381D463BB483DB95CD2CC25 + 5BE41A3EDF9C351120EA1C2E1F013FE76DA79A8CFF56B2D82E12BF53BF76D558 + D5CC92AB9997F09E7499CB47001552CFA5F3094E032CB05D24BE4CFBBB25974C + F37B74612B0DFE7D011A483DC70E1BAB5DB2D82E12DF0FE5764F2E6FF0E166E6 + 2583CB8C4582AFA2C962BB487C2FC36396378A4A8C1E010FE1BDE4F24563B8E1 + F5D2504F6669216BD6A52783ED22F1B9C39F670C375C0CEF6D232704AFB704A8 + 58B39794AB6B3D7C2EE3BB75EC0DD385ED22F195AA34D4CBD01341A0FABA7F99 + A581E6131B586C74DFFCAAC2B4DBC6261793020CF1709EDE8BB0D135DB1B268B + ED22EDAF6B36780A04E23BF02D6BFF60AB76200C36A891DE076311FD6804EF83 + ADCC535577444D033E79636F9477A682ED22A1BBE613287F77045D38269456E3 + 5BE496B79FAD8B790EC084133324B3CA970A8E0CDD1012F8C623E05BAEAEDC61 + F00C803E2734B92FDDA66C65FC8A07454624D8A6443C039E75DFE3FD69C0B080 + EA91082D8852FF6BB33A5D480A37DC9CC48521B7E8B70DB8B8A58A77B802374C + 2611221B97B78F3D00BCC0CE1B8AE9C4B14F887CC10FFD919B16AC0999562F37 + E1E8D7B8FEAD7D5149154D2006F8F02A94F1589E852A36E989016AC977124772 + 921E6C78E7BE3B22AA83D6C377CA6840F9F317CDDC1695F893C66DB7B9D161A3 + 9CC7BA21098FD13FCC042D8C2172BAE990AC89728E5BDBB8EF865976A28D1F4A + FD316EE86F278E879B15AAD728FD51FFA10175541BE9CAD16862FF875C16E99B + D2DD2CBAA24F723D6ECB499D114F24013C9104F04412C0134980B82205BA069A + 940AD8C2CC8CA4556E8DF9FB007145AA69AC6C9124C9B885CF241407F878C794 + 30B34C110B37992C7B88CE8E2C517A7E3C213BC7B75409B92666660E8A17B551 + DB4BCCB24448A45D8DCF2B79497A2ED37293B2D9782D5EA801B1705308FF3D77 + 73962C952B6FEC92996B2AC80724491EFDD1CEC9CBD88198C4DDBB9931AAF8C3 + E0B5D6D63225575DFF5185925EB75E08F8F3F298E94A646A0B4B6DBEF0EABA49 + 09FD6F9DA444BAD1100EB71B194F24013C91E242F43F22D4DC766B8C65200000 + 000049454E44AE426082} + end> + end + item + Name = 'libre-gui-about' + SourceImages = < + item + Image.Data = { + 89504E470D0A1A0A0000000D494844520000004900000049080600000071730B + DC000000017352474200AECE1CE90000000467414D410000B18F0BFC61050000 + 02E649444154785EEDDCB16B13511CC0F1DFBDC4A48DA966502AE210D4A13AD9 + 2D9BE8D40E820E22DDDA2D214BBB888B83A32E0A52746BFF840E0E0197EAD4AD + 4EC529DCA2282A445BB401F39EF7925FA9E12EEF7ED7A0F77AEFF78190F71232 + E4CBCBDD25C7C5534A01331378CF0C3812014722E04804636FB8ABCF3A1598C8 + 5FC3A99D7ADE7BBF79F213CE124B1C49471185FC3278702F98CE0C1E3D2614F8 + C15BDE900A1E278996285275F5FB9C10622D78D9397CE8B8EA482957FCE6A975 + 9C1B91235D7CB117C481C5C12C335AB2FB7BC15FAE74701E89B4E1AEAEEE3E08 + EEB216489B13C5FC531C8F14BB92AACF7767440EB6C1F326F0A1CC91B237EF37 + 4FB7701A12BB9244CE5BCB72204D6F67ABEB30F23D1A23E95514ECC56A38CDB0 + 6047F46BEF364E42CC2B49C0C817664D10E23A0E438C918427A671E80035F298 + CFBC923C55C191D3CC91581F4722E048041C898023117024028E446055A4FA6C + 015EDD2DC1EB8512DCAF15A098C32752664D241D4887B97A46C0A58AE8CF9FDC + B4E37BB545914EE0E8D0ADCB79385BF270961E6B2215F3D13138D25FB63EF470 + 74E8CB4F053B5F25CED2634DA4876FBB434174A07A6B1F67E932FE7C9BC68FFF + B3D3B9FE5E6DEB637865FD5B6AB3DD98BA819321D6ACA403DB9F7B290432B32E + 928D3812014722B022D2852901ED4639F2563B9FFE77135E49041C8980231170 + 24028E44C091083812014722E048041C898023117024028E44C0910838120147 + 22B0E26C893E3BA2CF9244D9F926E147977EFDCB185EB61BE5068E8758B192BA + BDC129A4A8DB7F0A0412E00D0E43F8E3A6E94BBC26CB1B380BE148012960C95F + 8491A78B3952B02DF2EBE54D1C47723D524B4E9657703C92AB91F495934BC1DE + 6CDEF4313BE05824F52ED8483F92D2BB42BDB4541BEF3849A97DA9E41DD30575 + 5970F495E44820ED68911C0AA4258FE458202D5924070369F4488E06D268911C + 0EA4C547723C901617C9F9409AF16052FFC34DDCFF78B820F66F3858D2430047 + 7124028E140BE00F2AEA15607ECC13300000000049454E44AE426082} + end> + end + item + Name = 'libre-gui-folder' + SourceImages = < + item + Image.Data = { + 89504E470D0A1A0A0000000D494844520000004900000049080600000071730B + DC000000017352474200AECE1CE90000000467414D410000B18F0BFC61050000 + 029F49444154785EEDDB3F6B535118C7F1E7B9B99A546B4C6C4BAD53075F4041 + 906CD62D0A826E8E755247475F81A36F2193838BA33AB583A0D025204204C18E + E262AC7FA889BDC773DB87D0907B6F7FA18D34F7FE3E4BCE3943DAFBED393729 + 24EA9C13CA16D8236560240023011809C04800460230128091008C0460240023 + 01A0FFDD5C4B9BA272CD0F1B2AB2BABF3A3EFF93B6D4C97559735BB63415B223 + B5B4E6549EFA306BB67264D3182AF3B8F9402F8E3350CC3FDFB27FDE75FF0758 + B6A5132F35923F620F8E72B4B24C5BA8F49DA472DF4613314DA192EF492DADF8 + 0BF8E62FA4622B13330DF7A8C448FEA83554E5AD4D45C2D0E72A8BCCCC889C3D + 638BC7C7FF063D0982DF36FD2F5CAFD7D17EB4A9FDDDE772EBEB1B5B4E94B693 + 56FD7958DF1BD7CE8B2C2E8A94F2FB962ADADE7E17FCF875436E77BBB63424FB + CA2FFA389796721D281654AB0D3757FF6CD311E9571F1FAB0B759BE49F562A35 + F77AE9994D87A4475A98B7418154AB776D34243D5279E22F6C278E8681BA970B + 376D3A9018C9CDCD5FCEFB7D2895864D1B0D2497381DCCDAA8785446DEE31474 + BB8C8791008C0460244072A4A0F4D346C51396BEDB68203192D6AB9F6C58387A + 6EF6BD0D0778DC008C0460240023011809C04800460230128091008C04602400 + 23011809C04800460230128091008C0460240023011809C04800460230122039 + 525869DBA8780219F9A87472A4957637FE7CB5CD8A256183641DB757F658187E + 636CC41BC4A603A991F454F9B113F7C5A6B9E703ED68103DB4E990F49D14178D + F44E114239275DD9957B72E563C79686647FDF2DD65EA9B9FE9F277ED48CBF34 + B3BF980F7B1B406543A3D223B9FA2175331C1EE9201F4CFEEEACD86CBA45A54E + 569883C68B545059AF6E641809C04800460230128091008C04602400231D4AE4 + 1F415A99F36C96A76D0000000049454E44AE426082} + end> + end + item + Name = 'libre-gui-file-document' + SourceImages = < + item + Image.Data = { + 89504E470D0A1A0A0000000D494844520000004900000049080600000071730B + DC000000017352474200AECE1CE90000000467414D410000B18F0BFC61050000 + 020E49444154785EEDD83F2F435118C7F1E74AEB4F9BA8840E060D6B43622006 + 24462F8357C04B692D6CBC068395957A0712B18845FC19142D2E872706D1EBD7 + 9B9ED39EE3F749A47D3AB5DFDCC7E96D14C7B150B23E7DA4048C046024002301 + 52FDE3AE9C3466A5EF6D44C7AED89C1B3CD2A7D6A58A54AD350E3F1E56BEA66E + 89F636E6B3EB3A58E5F1BAC56BD55A735707ABBC8B343E1C49F6FB5DBB09E55D + A491C14896A7324E4379B96E05C7A1BC8C64B80CE56D24C35528AF23192E4279 + 1FC9B01D2A884886CD50C144326C850A2A9261235470918C4E870A3292D1C950 + C146327E0BB5556B6CEB000B3A92F133542CB2FAF50CE7DDEF49B9FE48729948 + 275CFD25967AE3F3B35E6CCCF74F7DBE08F2EE4A321FF4BAFED6F69F064A25F8 + 75EB04460230128091008C0460240023011809E0E41BF7E5CDA3BCBEEA604921 + 9F91422EAB53A2B6BF713B89B473702EF7F5A64E762C954765B13CA653A2F06F + 4BBAC1C995B47F7C250FCF2F3AD9315D1A9699C9824E897A73DD7A0CD7CD0627 + 57D2E9D9AD3C373B73BC4D14F3522A0EE9944AF8A75B1BA7582B5C371BB86E00 + 9E6E00AE1BC0BB756BA58D350CFF746B85F76E5DC67503F0740370DD00DEAD1B + EFDD00BC77EB515C37004F3700D70DC04800460230128091008C046024002301 + 1809C0480046023012809100A97E05A89C3CAD7DF49DD4D12F717CB7B93050D1 + 09922AD27FC3750330128091FE24F20E09EB652AA97043DF0000000049454E44 + AE426082} + end> + end + item + Name = 'libre-gui-arrow-up' + SourceImages = < + item + Image.Data = { + 89504E470D0A1A0A0000000D494844520000004900000049080600000071730B + DC000000017352474200AECE1CE90000000467414D410000B18F0BFC61050000 + 022C49444154785EED9BAB52C3401885B3282412C92320C181C481EB6380ABE4 + 0DC0212B91C5C11B80ACEC63E0C095F3673703C36CDBD3642FE9CCF966CEE432 + 4CB3F948FF03226EB55A35623307612B3620490492442049049244303A49CEB9 + 29F2140E47C1A8FE04809C6B6CE6FEA8B9C3DA1EC37E55462309824EB179470E + DB139E2BACEF2DEC5763149220E8181B1374D29EF8E51339C71A97FEB00ED567 + 1204D993635FB1FF828C23E4153F63DB6A8C6170CF9033BF1BC5E4CD83CC2A54 + 95841B9F6233F1471BB9401EFC6E056C26D508B026B39D5D721BFBACDCA932B8 + F104C59A8CA578E315970441EB9A8CA578E3159D4961F8AE6B3296AEF14C7611 + 4A0FEE6D4DC652B4F18A49C20DB14DC662B24D7A7E6C26E50EE8D3646CA6B16B + A64CF6C18D27684893B1DCE03E5EC27E72B24A0AC3754893B17C23D6780B7F98 + 966C33290CD5A14DC6D25E2BFC5292937370A76A32967C8D675FB7D401D664DD + 602D9DE7D89A86247A724840CE266393B4F1A227FB0658937D8585D6CE24B6C6 + 3E49D66E059B8CC51AEF12F7F7E10FFB936470176E3296AEF186AFE9EF635532 + E0DE2EBF6366B1CFCA9DD2FFE0EE259244204904924420490492442049049244 + 2049049244204904924420490492442049049244204904924420490492442049 + 0492442049049244204904924420490492442049049244204904924420490492 + 442049049244204904924450E56D6EC33967EFFA5B766181F5667BAF6D1DD524 + ED13FABA11481281246DA5697E00BED54607B4EC6FA50000000049454E44AE42 + 6082} + end> + end + item + Name = 'libre-gui-arrow-down' + SourceImages = < + item + Image.Data = { + 89504E470D0A1A0A0000000D494844520000004900000049080600000071730B + DC000000017352474200AECE1CE90000000467414D410000B18F0BFC61050000 + 024B49444154785EED9B2D53C34014451314B21289C422714890FD093864FB0F + 90B8E2C0D5227195E040229148240E5CB98F2C4CA6B3949B64F76DC43D3377F2 + C14CB27B5ADE4B3349BD5EAF2BB19D9DB0145B90240249229024826285BBAEEB + 7D2C2C5D78C3785FC2BA1F26A944C0859DBE6396B163E58EFEDD082489409208 + 2489409208248940920824894092082489409208248940920824894092082489 + 4092082489409208248940920824894092082489409208248940920824894092 + 082489409208248940920824894092082489409208248920C973DC755D4FB058 + 22B664E9F51C37D2F539EE33CCF135ACF7A3FDBCF2908063E4C30E39A2CC6263 + ED9AE8CEBE01E7AD0196CE756C8C7D12DD392460D11A68A9DC23BBB1F1F54996 + 774B50A356589C345BEE58FD39C4BCDE9BCDE1E4926405FC1139F8DEE1878939 + C29C92BEA493E512207C8AA748B24F93E01399A6166464BB4EC260ED6B3F456C + F01ECC71CE87B09E161C386B8047C75BC4CE9D2AD19DA96393684D287556B173 + A68CDB9B93993A9ED51F2BD4596B9FA7A4D41DCFC458AB1FF69383C0ED076EF8 + B45375BC9F4E965D90E17A17204C2A45C7CBD7C922B8DF2A09939B375BBDB8C2 + 316EC2BA0F386191803E1D2F7B278BC5AD70C7E8D8F19E11EB645E17A7BF9496 + C4763CBBD966825C0AF526EE35A90D26CD743CD74E16A3A824234C7E5BC7B3DB + AF4F61BD08C5251990F057C7BBC4DF6EC37A318AD6A44D50A3ACE3CD9AADEA0E + 63B36F58714625C9081D6F0F29D2C9628C519275BC09C655AC506F323A496364 + 14857BEC48128124FD4B557D0111F22C417F9358340000000049454E44AE4260 + 82} + end> + end + item + Name = 'libre-gui-download' + SourceImages = < + item + Image.Data = { + 89504E470D0A1A0A0000000D494844520000004900000049080600000071730B + DC000000017352474200AECE1CE90000000467414D410000B18F0BFC61050000 + 02AD49444154785EED9C2170143114861314F2642512591CB85A64258E3A7054 + A228AE28EA40D6813C59471D12646525B2B22EFC2FC975989BDEDE5F2679D9B9 + F9BF999DE4EDDCDC6DFECDCB7B2FBB7331A514C4348F6A2B2690480412894022 + 110C5BB8E3495CA0D92F16CD553A497F6ADF8D91221D84187E54932385238874 + 5E2D37E46E0412894022114824028944A0DA8D4033894022118C4C26F7914C7E + AE26470A9F904C5E54CB0D65DC0472370289442091082412C1C885FB099AD7C5 + A25962E1FE5DFB6E28E32690BB11C8DD08944C12C8DD08241281442290480412 + 8940221148240289442091082412814422685ABBA11E7B5CEBB1E7E5CC30AE51 + E7BD409DD7E45DA6E6052E84DA83503FD1B52A7F04B755A066BB05CDDD2DDFBD + 140ED1BD2D679C49E155EBED942E6B52BE485C6C35FD48E13D7E7B59AD66745B + B8F3C5A6705C4D0FBEE3374F6BBF295DA31B2EFA0CCDD76275E51237E4A8F69B + D33F0528B3E9B2185DB04876881BD26D0D74D9BE45C45B20E2FD42B775C4BB81 + 4016C9AEAADD85FE33096010369897E8DE94338D2891ACAB40868B48461E4CCB + 880737C677BABC86E326929107D526E29DE1BB2C28B830E49152FC18BFA07953 + AC0773913E24735D375C67D21D6536FD8FABB4755992910F272DE2598DF7B49C + D98A2DFECFE066D7D57663CC4C0218EC43229E15AD960BB90B640C13C9C88366 + 8AE114DEE2B33D13D249868A64E4C14F47BC537CC6FDF9FFBF0C5B93D641C4B3 + D795DF15EB8E252299CDB4A10C9F492B20C67AC41BB3DD720FB311295344B132 + 236FDCC1CDC66CDCAD311B775B81D4C08AE00504727F596B13B313698ECCCBDD + 668A44229048045BD7A418E31E9A6FC5DA598EA1C3E64061224D1DC0A28D7576 + F938B86FECAB43EE46209108241281442260A29BFD85CF7A75BE6B9C43878D1B + 7A2A4B08E46E04128940226D2584BFEE0174ABA135BA4A0000000049454E44AE + 426082} + end> + end + item + Name = 'libre-gui-upload' + SourceImages = < + item + Image.Data = { + 89504E470D0A1A0A0000000D494844520000004900000049080600000071730B + DC000000017352474200AECE1CE90000000467414D410000B18F0BFC61050000 + 028F49444154785EED9B2D505C31148513141259894422A9DBBAC581A30E5CEB + A8ABDCAA4E552BEBC0816B1D7548EA8A442291C8BAF4DC97CB4C67A0BB674B7E + 1ECCF966C2CB7DB32BDE97979BDC301B534A41CC67C5AF620E92442049049244 + B03071C7185771D9CAD1B3E5121E6EBD7F1F9334AF8175FBD8336F93879EFDAE + 69BA1148128124114812812411A87623D09B442049049244303A49711657D1D6 + 3C1C05E37B9362F88C7662B2FC4E7746250962DEE3F2066D3AC81A09A3D90240 + D00EC47CF33093C2BB344B5F3CEAC6282441D026045DA07B7F8AA5B00D513F3C + EA42774910F4C205D991CC43DC42D42B88BAF4B8395D73D2909CF314FB972063 + CD3E33C8EC44DFC41DC311FE32A79EEB2EAACB8AD74D52FC103FE2B297238A2D + 97DA9C2E92F046981C5BEE97650FDF9D79BF19CD13371ED2DE887374FF7FEAA4 + F01A89FCD4A3EA34950441965B6C257B6C12FEED2BDE4F8FABD24CD29074B3A0 + CD7CE7D1DC40D44B88BAF6B81AED72525EEA4B09326C7F652B5EF562B88924AC + 6456874D735414DBA99F78BF1AD52561A4AD603DCC5115A63E08D5A89A932068 + 82913E43B7FE263085B7C84F5F3D2A4A3549BE92FD42B7D5019AAD78BB1055BC + 18AE226948A67925DBC8779A61C5B0AD78571E17A1784E82A0BBA2B5B520C306 + E76C18A482944FDCF9447192832E142F869BEEB8FF060F6149DDCA139E140E30 + 958E3D6A46BBCDE4134692082489409208248940920824894092082489409208 + 2489A067ED6647AFCB9D28A6F0A9C679D122BA497A4A68BA11F49C6E7630B6EC + BF98AE30DD6EBCDF0C9D271168BA1148128124114812812411683349A0378940 + 920854E01268C74DA0E94620490492442049043D13B7FD32693F4734DF91B89B + FFA44B3B6E024D3702492290A48584F00784272A2DE50595420000000049454E + 44AE426082} + end> + end + item + Name = 'libre-gui-close' + SourceImages = < + item + Image.Data = { + 89504E470D0A1A0A0000000D494844520000004900000049080600000071730B + DC000000017352474200AECE1CE90000000467414D410000B18F0BFC61050000 + 036649444154785EED9B217353411446F350919591954824B2B23FA33F038943 + 2291959595685471C8E02A9195E0C2774B6E67E7F5DBF7EEEEDEFBF2C2EC9939 + 94F93AED36073ACD4B93E170386C3AD3BC39BEED4CD02319E8910CF448067A24 + 033D92811EC9408F64A04732D02319708B340CC3167E820FF011DEC3B7C77787 + 83B376F00EEEE10FF8055E1CDFDD865CBBB50A2EE15E3EDDC8DFF0867D8CA7E0 + 1A3EC1F1F9BFE03BF63125D2B14420811E61FAC58D0D0B052490FC638CCF5425 + 5E53283A5A059640AA7B283017486D0A45478BA02490EA160A5803A9D5A1E838 + 27A809A4368702A581D4AA50749C12B40452AB4381DA406A71283AE6045BD81A + 482D0E055A03A912EA929DC1A4634EF0F9788897E650C02B90FA959DC3A4634E + C0EE0BB53A1B0A780752B7ECBCB174CC09E4BF697A8897D950202A9068FA96A3 + 634EF0901CE0EDAB502032D0D3F8BC9C74CC09AE9243227C09052203891FD2DB + 36251DA7041F938322BC81D1816ED96DCB49C7394174A8D50412E9681144878A + B038904847ABE09C42550512E95822388750D581443A960AD61CAA299048C71A + C11A43350712E9582B5853289740221D5B046B08E51648A463ABE094A15C0389 + 74F4109C22947B20918E5E822543850412E9E829582254582071895F737F877F + FEFD358C6FC7B731B0725E82E8ABF954F343C1A5D2D143B064203524141D5B05 + A708A4BA87A2638BE0948154D75074AC15AC2190EA168A8E35823505525D42D1 + B154B0C6406A73283A9608D61C486D0A4547ABE01C02A9D5A1E868119C5320B5 + 2A141DE704E718482D0E45C7294174A05B187D515C148A8E39C10E463D69427C + B99A07D1A1AED2DB36251D7382BBE4106F5F3DDC012243EDC7E7E5A4634E20CF + 8B4E0FF232FB7810880C75C1CE1C4BC79C20E25B6DF6013310156AC7CE1B4BC7 + 9CE03E39C043F3238AC03BD4233B8749C79C409E79EBF593CD1C48059EA1AED9 + 194C3A4E299F1CB6862A0EA4028F5071770154D012AA3A900A5A42C5DF995441 + 4DA8E6402AA809B5DC65890A4A42B905524149A8AA40221D4B049650EE815460 + 09551D48A463A9602A545820154C856A0A24D2B146F01EA6AF189068E6A701B7 + 0AE459BBE99D5DB93A30FF989F72903F3C198641EE4BC93D59F9CDEDE2E0FCE7 + D7FDE2FC9FCF8303EE91FE47FA4BDE0DF448067A24033D92811EC9408F64A047 + 32D023CDB2D9FC05FC2B1D0E0F1671C10000000049454E44AE426082} + end> + end + item + Name = 'libre-gui-action-select' + SourceImages = < + item + Image.Data = { + 89504E470D0A1A0A0000000D494844520000004900000049080600000071730B + DC000000017352474200AECE1CE90000000467414D410000B18F0BFC61050000 + 02E649444154785EED9B21735431148577514850B4AE3824923A1C8B03070E14 + 4870F00B2AC1B5288AEA3A70E0C015471D3870AC631DB8ED392F373B6F5E3B9D + 33CD43243DDFCC6D5EB2DB9DE69BBC9B9BB7D3E96AB59A98B3B914AD39034B12 + B024014B12B024014B12B024014B12B024014B12B024014B12B024014B12B024 + 014B12B024014B12B024014B12B024014B12B024014B12B024014B12B024014B + 12B024014B12B024014B12B024014B12B024014B12B024014B12B024014B12B0 + 2481EAFF23603A9D5E46F3147105B144EC614EFFD08E46D592206803CD7BC4AD + 6E20B1403CC4BCBEA46E39B54B7A85E659EA4DBE22B882B8B2B630AF4D0E8E41 + ED92FEC6E573CC632FAE39CE95B5C0D8AF345246ED92F8C7F3D69AE39A2B28CB + F9C1D74783926A0DB01B2D93F621821DAEAED9F0BD25517DE2C6DFBF40CBDD6D + 378D7630795FC76BA3EC7255D749141497C3DB8BBBDE2C5D96D344310959DCEE + 87A29E445B4C4B15F79B683333DC8637E2BA889624CD11C31C34CA6AAA3A710F + C1CA798BE651EA7574091CB18578C001F001733EC27B99B35832B0969A33C963 + ECF4FA8A925A097093531A04A5B186FA1DFD3F0826F6DBD1671CC4EF1F44BF2B + 2DD69FDBEFB410E05B4C34C7618CB344C8632F622C8B636D45712C25F27B76D6 + 9F992F5A89C14473F08CD797C7D5C4B1FE7B7E22389EFB9D387E6653398920AF + E45B8B5578293C13BE6EEEA11B26C51D6E3FF58AB9C31FCDAD2412F5D1F7D42B + 82C2AF36210952B8ABDD4BBDB4A5233E22B88395B25DBD2408620DC4A4DCCF41 + AC8F8E10639CDFEEB79093B88A86497ACC03EE460B923E21F8E8F67F51BFA4D8 + CDEE22C6DAD1865C6BA20480A825E2312EB711E33EBAC54A6AB598E411A47FD0 + 2D61D9649D44208BA77E3E15A0B4229A9544A27EE297972C13CE4D73C7923E58 + 00AC9598A7CEB3FBB1287D89D86C7A2565224F714529B513ABF577F0C2D2A2E3 + 424822218ADFCDF1161CC255C367E4FBF091BF815973612411886265FE199145 + 9D583527994C8E011334A632CA6369DA0000000049454E44AE426082} + end> + end + item + Name = 'libre-gui-eraser' + SourceImages = < + item + Image.Data = { + 89504E470D0A1A0A0000000D494844520000004900000049080600000071730B + DC000000017352474200AECE1CE90000000467414D410000B18F0BFC61050000 + 048249444154785EEDDA5B68544718C0F139A79BC4C4905473538CB1901A621F + DA7D2928C1883E485EB404095485928434E28315DB42A54FF1C9163110108918 + 8C28E26B4BA997529A34C56A2F48B4A164979A44238D976E6B6AACE676B6E78B + 33EB6EDCCB9C73E6F21DD83F843D33BB0FE1C7CC64CF6E8C68344AB2A5CFA48F + D9D29445E2288BC4511689A32C1247BEF8EBF6DAE9C15773F3CC4F0C420EC2D8 + FE9DEF19066909ED7CEBD2C20B24871E0980F2F2CC3EFB32F87CE64551CB6A09 + EF0E9EA64369A1DE6EE98020C3347B6BCE0D36D3A1B4D022650262A9804289C4 + 0BC4920D850EC929104B26142A24B7402C59506890BC02B16440A1401205C412 + 0DA51D4934104B2494562459402C5150DA906403B1444069415205C4F20AA51C + 493510CB0B9452245D402CB750CA907403B1DC402941C202C4720A251D091B10 + CB099454A4B6AEF3154706CF8D544F4EA00262F142494302A0C6F08FE1F5F786 + 971DBDD2436C28FA0CAE78A0A42031A037236345302E9C7D46FC0C25FC33EEC5 + 40F14DE52C211FD5B5915BC52BE90CB2A256636857F00B3A8A2514291D100B33 + 147C0B3333135D37D61C7C44A71612B6DD788020CC5BCF308C153901B3960E63 + 0941E20562E186B29ED1CB589E919C02B1704245AF85770707E920962724B740 + 2C4C50F6D13C6618D19D749890EB83BBA3A3ABEAED877FFCE616283EDD873900 + 99A6B579F8DDE0189D4AC81512006DFDBDEF56F1FC74A028274067BDA50B2A13 + 10E478BB31A0DCE92781A77373E4DFD939FA8CB7746C3D1E20C811523C109D22 + 7E85E20582B8919201B1FC06E50408E242EAEEEE5DDB54668C260362F905CA29 + 10941109801A6A2A43E58D3BCC92F7DEA7B3C9C30EE506084A8BB4B0C52A4B42 + 4B6BDF30605CB8A18EF815CA2D109412A967FFA71570064D5DFCD2B09EFE4767 + FD09E505084A89541D19B90967D0CCDD3BE47EE767C4AF505E81A0944845537F + 97D34BE2572811405052A4B37B0F6C59FC4EDC6F50A280A094B725BF363658C4 + 9A5F38B0E3CBADAC22151F1E24667E019DB16F29AE5E21913327E92879F98100 + 51750B2312084AB9DD6E97559DA59709615F51A281A0B437B85FB5B67DBF3272 + BB9E0E13C2B8A2640041295712B4ED54CFA689923503749810B615250B08E2FA + A804FB8A7AB8A4786E57C3C76B6500416957120BF38A7A12C8B56E2C5FFD8E2C + 20880B09C208054057CB6BB6B5741EBE40A7A4C48D0461825205043942823040 + A904821C23413AA1540341AE90201D503A8020D748904A285D40902724480594 + 4E20C8F597938B93F586F395FC02AD409030244838946190D18AD75B9B4E1CEF + A5335A128A040983B281FE2C5DB56F7B4FEF313AA32DCF67D2E2849C51888020 + E148902728644090F0ED169FD3ADF7B8EF1B32D437800A0892B292584E56143C + 4EFCF5E8736C4090D495C4CAB4A24AF77C40DADBDBC9D73FFD4C67B575C8F6E8 + A0D7B1A4AE2456BA1515191D219BEB3762004A99122408A0C64BAB2EC3C1CC1A + FA6792B4FEF00B094F3EA6333853B2DDE283AFCFC743D7BB2767E71F747DF7ED + 793A2DA315F6CF4BFF6E9CA17EDBA39F5EC7528EE4C7946D373F9745E2288B94 + 3142FE073D311463891BA5A90000000049454E44AE426082} + end> + end + item + Name = 'libre-gui-frame' + SourceImages = < + item + Image.Data = { + 89504E470D0A1A0A0000000D494844520000004900000049080600000071730B + DC000000017352474200AECE1CE90000000467414D410000B18F0BFC61050000 + 032449444154785EED9A2F78D34018C61354E524B212B929263737240A5014C5 + 709D9CC30D371CB8E1180A50E03607728EB9E198630ED4B2DF351F5D2FBDA77C + 699B6CEBDEDFF3BCBD3FB9E4BEBCB95CFE352F8A221393B963A998804C722093 + 1CC8240732C9814C7220931CC8240732C9814CF2101E4BAA82B5B0E896AA57F5 + 4323C9814C7220931CC82407C9F749799E8789FBA02C45AC5BBA28BC4777CBEC + 906778F2CEF225A3B3F83F41F2EA566D77D30527A3FB67D2D56D1A64920399E4 + 607E26E57917F5D04BB46CB5ED431C459EF7D126F97B563B1BD5492A086A4DDC + E759B689FED0885229CA6F526D9B54886334068B6327D536085C1377541856D6 + 3089205659482EA9B10E9B52880345076A44C938A0B5ABDB234B53EC31E48B36 + 9467D937D4B17E23D8F3A7969D8A7998349FF3BE59BA964E45AD3B6EDA72B062 + 982077A9EC5B31822D9F911C95A5C6E91247D20CE2386447C79E16D8CF70BA55 + D769E08E9BDB7AE682DFA4946251FF38B94E136244A7E6A450873652EB404B73 + 52519C720457D8FA77AB093D9DA12D8EDEBE55354F511CF3FB907E7F96158338 + 427E9D38BE96355352752D08EA3FBBB10E2237506B57B531C571AC25DB98A0A5 + 91740B90490E64920399E440263990490E64920399E440263990490E64920399 + E440263990490E649283B999548C7C1020FF3C9BD737AF3AE4F9D2A06FC3E258 + B2E2F4545F3005419DD7B79DF32C3B20A574297B95BA9C5CA7099571FC1A8D21 + 88BA1FA4DDD43AE07AE9965BE3889A1F02FA54EE5A31822D1FB1ECB3151B85BE + EED3D786152358B6CF8E3EB1E290D63E0470A43EB290DCF515319EA46287D65E + DF86CF46D79D99629CF974A3718FDFBDB210C396DFB2C2072B36CD2ADA29B331 + C4F18A1DDDB6E290F6BEBB2186F3171A90BB944D989D54FBA6943AF527C501AD + 9D6E61383E60EB2FD02774885E3382D6E9E1AF356905FA0C93F3B6C510B445DD + CACC71545D0B825A23E9A60ADA1B498B8E4C7220931CC82407B54CE2BE82A790 + C511BBE4FA739746920399E440263990490E78A208F3570C935A789B7775FFEA + BF5A8EF1E4D4F203922689189D6E0E64920399E440263990490E64920399E440 + 26FD972CBB00451B7076D6310F5F0000000049454E44AE426082} + end> + end + item + Name = 'libre-gui-folder-open' + SourceImages = < + item + Image.Data = { + 89504E470D0A1A0A0000000D494844520000004900000049080600000071730B + DC000000017352474200AECE1CE90000000467414D410000B18F0BFC61050000 + 034E49444154785EED9A3B6C1341104067CE8E6307252584081025124D24A428 + 1D6929E9DC61BA74880AA8101D250D121DA6A2439450918E84065320D95DCA54 + E086100A7B984D26528CF7CEE3FBA0DCDE3C897877A570F2CBECECCCDD211181 + 914C249F46022649814952609214982405264981495260921498240526498149 + 52609214E81ADC2EDEE09FEEDFFAF13C057C952176E8854C4BC56C495D7C4C08 + 4F11A0292BA9E12B75F11EDD9769694894446FF02DCB69CB3417CA282A362751 + 17DB790B72F0FFD961F9AF655A0AE21337C20319E54ED944F9B75B179B9C877E + E691879228CBD6F34AE2ADB689089F655A287CF51E7F0C4F6685D0E38B0CF80F + BEC3F1DB97B5B9888BA42DDE139F64160CFC4D9F23C1339675244B2A2A554C72 + 34B97266EE5C58B98A9B45B5DDC92D5315D56C4B101EC948453525B9168B4F70 + 19CFA49292A4B4593D99CDA6AA913417264941FE75D2CA0A07F322C0524B16CE + 27D46AEE02E20E8EA33DF87DF801B6F6636BA7FC242D3600D62E03B4CEB71C1F + AEEA478AEEC0C6F703599A209FED56AB015CBB5A4A410E4EE4EB84A3AFF0E5A6 + 3799E723E9D245808505999413045CA588BCF5537649DC09C3F2B24C4A0ED1B6 + 2F9AB24BBAB0C4DB2D8C43F2B87E8A46EE5EFE04D9BF5D834FB2C0C92EC91DF7 + 2131AE4DDDDBCA4152A1372FFF3F87BFA66ECC6597E4EAA340E092B1EF2B2AB3 + 497251E44EB7504096E4219BA4463851E440823D194E903192024BDA84054452 + 6849BB3E2A42523891C44DEE11DC1AE42CC935B5F5BA4C4280DCF33F2FE925B5 + 02DB6A8005480AAD1D19C3404653A49714D8C986B522B65B70275BB3004921B5 + 234007B0DE8B7D69239DA4D0DA9184A4ED482729B07624E9F877A49374CE1F17 + CDCD08BFC9C88B45128351E4ADB44F49999302AB913C37DACE32BF24D78A04D4 + 8EB80793494F6F1D7192E21359685184B3DFA3F44BEAD0900DFB7F39B07604C7 + F05186B1246DB7F7F239C9523895F6F1ED9146D3FF3DCF102BC9BDA5EA8DA690 + 2289E86152A57D4A7C2475E88845DD6551BBB2C2E6B8CA0EA01D21823F1C464F + 70A3FF4A9612F1BF7AF30FD4C56D40B84D8DC675BCB236F518B834D4A21F10D5 + DF21E04BD8ECEFCBEA4C5492AA4E52E2360493A4C0242930490A4C920293A4C0 + 242930490A4C920293A4C024CD04E02FD935CAA7E0C81CBD0000000049454E44 + AE426082} + end> + end> + Left = 368 + Top = 304 + end + object actlstMainProgram: TActionList + Images = vimglstMainProgram + Left = 504 + Top = 296 + object actFileDownload: TAction + Category = 'File' + Caption = 'Do&wload' + ImageIndex = 10 + ImageName = 'libre-gui-download' + OnExecute = actFileDownloadExecute + OnUpdate = actFileDownloadUpdate + end + object actFileUpload: TAction + Category = 'File' + Caption = '&Upload' + ImageIndex = 11 + ImageName = 'libre-gui-upload' + OnExecute = actFileUploadExecute + OnUpdate = actFileUploadUpdate + end + object actFileFTPSites: TAction + Category = 'File' + Caption = 'F&TP Sites...' + ImageIndex = 4 + ImageName = 'libre-gui-address-book' + OnExecute = actFileFTPSitesExecute + OnUpdate = actFileFTPSitesUpdate + end + object actFileConnect: TAction + Category = 'File' + Caption = '&Connect...' + ImageIndex = 0 + ImageName = 'libre-gui-link' + OnExecute = actFileConnectExecute + OnUpdate = actFileConnectUpdate + end + object actFileDisconnect: TAction + Category = 'File' + Caption = 'D&isonnct' + ImageIndex = 1 + ImageName = 'libre-gui-unlink' + OnExecute = actFileDisconnectExecute + OnUpdate = actFileDisconnectUpdate + end + object EditCopy1: TEditCopy + Category = 'Edit' + Caption = '&Copy' + Hint = 'Copy|Copies the selection and puts it on the Clipboard' + ImageIndex = 2 + ImageName = 'libre-gui-copy' + ShortCut = 16451 + end + object EditSelectAll1: TEditSelectAll + Category = 'Edit' + Caption = 'Select &All' + Hint = 'Select All|Selects the entire document' + ImageIndex = 13 + ImageName = 'libre-gui-action-select' + ShortCut = 16449 + end + object actViewSetting: TAction + Category = 'View' + Caption = '&Settings...' + ImageIndex = 3 + ImageName = 'libre-gui-settings' + OnExecute = actViewSettingExecute + end + object FileExit1: TFileExit + Category = 'File' + Caption = 'E&xit' + Hint = 'Exit|Quits the application' + ImageIndex = 12 + end + object actHelpAbout: TAction + Category = 'Help' + Caption = '&About...' + ImageIndex = 5 + ImageName = 'libre-gui-about' + OnExecute = actHelpAboutExecute + end + object actFileRemoteDelete: TAction + Category = 'File' + Caption = '&Delete' + ImageIndex = 14 + ImageName = 'libre-gui-eraser' + OnExecute = actFileRemoteDeleteExecute + OnUpdate = actFileRemoteDeleteUpdate + end + object actFileLocalDelete: TAction + Category = 'File' + Caption = '&Delete' + ImageIndex = 14 + ImageName = 'libre-gui-eraser' + OnExecute = actFileLocalDeleteExecute + OnUpdate = actFileLocalDeleteUpdate + end + object actFileRemoteRename: TAction + Category = 'File' + Caption = '&Rename...' + ImageIndex = 15 + ImageName = 'libre-gui-frame' + OnExecute = actFileRemoteRenameExecute + OnUpdate = actFileRemoteRenameUpdate + end + object actFileLocalRename: TAction + Category = 'File' + Caption = '&Rename...' + ImageIndex = 15 + ImageName = 'libre-gui-frame' + OnExecute = actFileLocalRenameExecute + OnUpdate = actFileLocalRenameUpdate + end + object actFileRemoteMakeDirectory: TAction + Category = 'File' + Caption = '&Make Directory...' + ImageIndex = 16 + ImageName = 'libre-gui-folder-open' + OnExecute = actFileRemoteMakeDirectoryExecute + OnUpdate = actFileRemoteMakeDirectoryUpdate + end + object actFileLocalMakeDirectory: TAction + Category = 'File' + Caption = '&Make Directory' + ImageIndex = 16 + ImageName = 'libre-gui-folder-open' + OnExecute = actFileLocalMakeDirectoryExecute + OnUpdate = actFileLocalMakeDirectoryUpdate + end + end + object IdFTPClient: TIdFTP + Intercept = FIdLog + IOHandler = iosslFTP + Compressor = IdCompressorZLib1 + ConnectTimeout = 0 + UseExtensionDataPort = True + NATKeepAlive.UseKeepAlive = False + NATKeepAlive.IdleTimeMS = 0 + NATKeepAlive.IntervalMS = 0 + ProxySettings.ProxyType = fpcmNone + ProxySettings.Port = 0 + Left = 168 + Top = 169 + end + object iosslFTP: TIdSSLIOHandlerSocketOpenSSL + Destination = ':21' + Intercept = FIdLog + MaxLineAction = maException + Port = 21 + DefaultPort = 0 + ReadTimeout = 60000 + SSLOptions.Method = sslvSSLv23 + SSLOptions.SSLVersions = [sslvSSLv2, sslvSSLv3, sslvTLSv1, sslvTLSv1_1, sslvTLSv1_2, sslvTLSv1_3] + SSLOptions.Mode = sslmUnassigned + SSLOptions.VerifyMode = [sslvrfFailIfNoPeerCert, sslvrfClientOnce] + SSLOptions.VerifyDepth = 0 + OnStatusInfoEx = iosslFTPStatusInfoEx + Left = 204 + Top = 273 + end + object FIdLog: TIdLogEvent + Active = True + ReplaceCRLF = False + OnReceived = FIdLogReceived + OnSent = FIdLogSent + OnStatus = FIdLogStatus + Left = 276 + Top = 249 + end + object ppmnuLog: TPopupMenu + Images = vimglstSmall + Left = 440 + Top = 344 + object Copy1: TMenuItem + Action = EditCopy1 + end + object N1: TMenuItem + Caption = '-' + end + object SelectAll1: TMenuItem + Action = EditSelectAll1 + end + end + object vimglstSmall: TVirtualImageList + Images = < + item + CollectionIndex = 0 + CollectionName = 'libre-gui-link' + Name = 'libre-gui-link' + end + item + CollectionIndex = 1 + CollectionName = 'libre-gui-unlink' + Name = 'libre-gui-unlink' + end + item + CollectionIndex = 2 + CollectionName = 'libre-gui-copy' + Name = 'libre-gui-copy' + end + item + CollectionIndex = 3 + CollectionName = 'libre-gui-settings' + Name = 'libre-gui-settings' + end + item + CollectionIndex = 4 + CollectionName = 'libre-gui-address-book' + Name = 'libre-gui-address-book' + end + item + CollectionIndex = 5 + CollectionName = 'libre-gui-about' + Name = 'libre-gui-about' + end + item + CollectionIndex = 6 + CollectionName = 'libre-gui-folder' + Name = 'libre-gui-folder' + end + item + CollectionIndex = 7 + CollectionName = 'libre-gui-file-document' + Name = 'libre-gui-file-document' + end + item + CollectionIndex = 8 + CollectionName = 'libre-gui-arrow-up' + Name = 'libre-gui-arrow-up' + end + item + CollectionIndex = 9 + CollectionName = 'libre-gui-arrow-down' + Name = 'libre-gui-arrow-down' + end + item + CollectionIndex = 10 + CollectionName = 'libre-gui-download' + Name = 'libre-gui-download' + end + item + CollectionIndex = 11 + CollectionName = 'libre-gui-upload' + Name = 'libre-gui-upload' + end + item + CollectionIndex = 12 + CollectionName = 'libre-gui-close' + Name = 'libre-gui-close' + end + item + CollectionIndex = 13 + CollectionName = 'libre-gui-action-select' + Name = 'libre-gui-action-select' + end + item + CollectionIndex = 14 + CollectionName = 'libre-gui-eraser' + Name = 'libre-gui-eraser' + end + item + CollectionIndex = 15 + CollectionName = 'libre-gui-frame' + Name = 'libre-gui-frame' + end + item + CollectionIndex = 16 + CollectionName = 'libre-gui-folder-open' + Name = 'libre-gui-folder-open' + end> + ImageCollection = imgcolMainProgram + Left = 208 + Top = 344 + end + object IdCompressorZLib1: TIdCompressorZLib + Left = 497 + Top = 233 + end + object MainMenu1: TMainMenu + Images = vimglstSmall + Left = 300 + Top = 121 + object File1: TMenuItem + Caption = '&File' + object FTPSites1: TMenuItem + Action = actFileFTPSites + end + object N3: TMenuItem + Caption = '-' + end + object Connect1: TMenuItem + Action = actFileConnect + end + object Disonnct1: TMenuItem + Action = actFileDisconnect + end + object N5: TMenuItem + Caption = '-' + end + object Dowload1: TMenuItem + Action = actFileDownload + end + object Upload1: TMenuItem + Action = actFileUpload + end + object N4: TMenuItem + Caption = '-' + end + object Exit1: TMenuItem + Action = FileExit1 + end + end + object Edit1: TMenuItem + Caption = '&Edit' + object Copy2: TMenuItem + Action = EditCopy1 + end + object N2: TMenuItem + Caption = '-' + end + object SelectAll2: TMenuItem + Action = EditSelectAll1 + end + end + object View1: TMenuItem + Caption = '&View' + object Settings1: TMenuItem + Action = actViewSetting + end + end + object Help1: TMenuItem + Caption = '&Help' + object About1: TMenuItem + Action = actHelpAbout + end + end + end + object ppmnuRemote: TPopupMenu + Images = vimglstSmall + Left = 577 + Top = 217 + object Dowload2: TMenuItem + Action = actFileDownload + end + object N8: TMenuItem + Caption = '-' + end + object MakeDirectory1: TMenuItem + Action = actFileRemoteMakeDirectory + end + object N7: TMenuItem + Caption = '-' + end + object Delete1: TMenuItem + Action = actFileRemoteDelete + end + object Rename2: TMenuItem + Action = actFileRemoteRename + end + end + object ppmnuLocal: TPopupMenu + Images = vimglstSmall + Left = 120 + Top = 225 + object Upload2: TMenuItem + Action = actFileUpload + end + object N9: TMenuItem + Caption = '-' + end + object actFileLocalMakeDirectory1: TMenuItem + Action = actFileLocalMakeDirectory + end + object N6: TMenuItem + Caption = '-' + end + object actFileLocalDelete1: TMenuItem + Action = actFileLocalDelete + end + object Rename1: TMenuItem + Action = actFileLocalRename + end + end + object SocksInfo: TIdSocksInfo + Left = 513 + Top = 193 + end + object HTTPConnectThrough: TIdConnectThroughHttpProxy + Enabled = False + Port = 0 + Left = 593 + Top = 177 + end +end diff --git a/demos/IndyFTPClient/mainform.pas b/demos/IndyFTPClient/mainform.pas new file mode 100644 index 0000000..a7e4f7d --- /dev/null +++ b/demos/IndyFTPClient/mainform.pas @@ -0,0 +1,2385 @@ +unit mainform; + +interface + +uses + Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, + System.Classes, Vcl.Graphics, + Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.BaseImageCollection, + Vcl.ImageCollection, frmProgress, System.ImageList, Vcl.ImgList, + Vcl.VirtualImageList, + System.Actions, Vcl.ActnList, Vcl.ComCtrls, Vcl.StdCtrls, Vcl.ExtCtrls, + Vcl.ToolWin, IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient, + IdExplicitTLSClientServerBase, IdFTP, IdCTypes, IdOpenSSLHeaders_ossl_typ, + IdIOHandler, IdIOHandlerSocket, IdIOHandlerStack, IdSSL, IdSSLOpenSSL, + IdIntercept, IdLogBase, IdLogEvent, Vcl.Menus, Vcl.StdActns, + IdZLibCompressorBase, IdCompressorZLib, IdSync, IdConnectThroughHttpProxy, + IdCustomTransparentProxy, IdSocks, IdSSLOpenSSL_X509; + +type + TfrmMainForm = class(TForm) + vimglstMainProgram: TVirtualImageList; + imgcolMainProgram: TImageCollection; + actlstMainProgram: TActionList; + actFileDownload: TAction; + actFileUpload: TAction; + sbrMainForm: TStatusBar; + pnlLog: TPanel; + tbrMainProgram: TToolBar; + spltrLog: TSplitter; + pnlMainWindow: TPanel; + pnlLocalBrowser: TPanel; + pnlRemoteBrowser: TPanel; + actFileConnect: TAction; + ToolButton1: TToolButton; + IdFTPClient: TIdFTP; + iosslFTP: TIdSSLIOHandlerSocketOpenSSL; + ToolButton2: TToolButton; + actFileDisconnect: TAction; + FIdLog: TIdLogEvent; + ToolButton3: TToolButton; + ppmnuLog: TPopupMenu; + EditCopy1: TEditCopy; + EditSelectAll1: TEditSelectAll; + Copy1: TMenuItem; + N1: TMenuItem; + SelectAll1: TMenuItem; + vimglstSmall: TVirtualImageList; + IdCompressorZLib1: TIdCompressorZLib; + MainMenu1: TMainMenu; + File1: TMenuItem; + Connect1: TMenuItem; + Disonnct1: TMenuItem; + Edit1: TMenuItem; + Copy2: TMenuItem; + N2: TMenuItem; + SelectAll2: TMenuItem; + View1: TMenuItem; + Help1: TMenuItem; + actViewSetting: TAction; + Settings1: TMenuItem; + FileExit1: TFileExit; + actFileFTPSites: TAction; + N3: TMenuItem; + FTPSites1: TMenuItem; + ToolButton4: TToolButton; + ToolButton5: TToolButton; + N4: TMenuItem; + Exit1: TMenuItem; + actHelpAbout: TAction; + About1: TMenuItem; + lvLocalFiles: TListView; + lvRemoteFiles: TListView; + cboLocalCurrentDir: TComboBox; + cboRemoteCurrentDir: TComboBox; + lblLocalCurrentDir: TLabel; + lblRemotDir: TLabel; + N5: TMenuItem; + Dowload1: TMenuItem; + Upload1: TMenuItem; + redtLog: TRichEdit; + Splitter1: TSplitter; + actFileRemoteDelete: TAction; + actFileLocalDelete: TAction; + ppmnuRemote: TPopupMenu; + ppmnuLocal: TPopupMenu; + Upload2: TMenuItem; + N6: TMenuItem; + actFileLocalDelete1: TMenuItem; + Dowload2: TMenuItem; + N7: TMenuItem; + Delete1: TMenuItem; + actFileRemoteRename: TAction; + actFileLocalRename: TAction; + Rename1: TMenuItem; + Rename2: TMenuItem; + actFileRemoteMakeDirectory: TAction; + actFileLocalMakeDirectory: TAction; + N8: TMenuItem; + MakeDirectory1: TMenuItem; + N9: TMenuItem; + actFileLocalMakeDirectory1: TMenuItem; + ToolButton6: TToolButton; + ToolButton7: TToolButton; + SocksInfo: TIdSocksInfo; + HTTPConnectThrough: TIdConnectThroughHttpProxy; + procedure FormCreate(Sender: TObject); + procedure actFileConnectExecute(Sender: TObject); + procedure actFileConnectUpdate(Sender: TObject); + procedure actFileDisconnectExecute(Sender: TObject); + procedure actFileDisconnectUpdate(Sender: TObject); + procedure FIdLogReceived(ASender: TComponent; const AText, AData: string); + procedure FIdLogSent(ASender: TComponent; const AText, AData: string); + procedure iosslFTPStatusInfoEx(ASender: TObject; const AsslSocket: PSSL; + const AWhere, Aret: TIdC_INT; const AType, AMsg: string); + procedure iosslFTPOnSSLNegotiated(ASender: TIdSSLIOHandlerSocketOpenSSL); + procedure actHelpAboutExecute(Sender: TObject); + procedure actViewSettingExecute(Sender: TObject); + procedure FormClose(Sender: TObject; var Action: TCloseAction); + procedure lvRemoteFilesColumnClick(Sender: TObject; Column: TListColumn); + procedure lvRemoteFilesCompare(Sender: TObject; Item1, Item2: TListItem; + Data: Integer; var Compare: Integer); + procedure lvRemoteFilesDblClick(Sender: TObject); + procedure lvLocalFilesCompare(Sender: TObject; Item1, Item2: TListItem; + Data: Integer; var Compare: Integer); + procedure lvLocalFilesColumnClick(Sender: TObject; Column: TListColumn); + procedure lvLocalFilesDblClick(Sender: TObject); + procedure FIdLogStatus(ASender: TComponent; const AText: string); + procedure actFileFTPSitesExecute(Sender: TObject); + procedure actFileFTPSitesUpdate(Sender: TObject); + procedure cboRemoteCurrentDirKeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); + procedure actFileUploadExecute(Sender: TObject); + procedure actFileDownloadExecute(Sender: TObject); + procedure actFileUploadUpdate(Sender: TObject); + procedure actFileDownloadUpdate(Sender: TObject); + procedure cboLocalCurrentDirKeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); + procedure actFileRemoteDeleteUpdate(Sender: TObject); + procedure actFileRemoteDeleteExecute(Sender: TObject); + procedure actFileLocalDeleteExecute(Sender: TObject); + procedure actFileLocalDeleteUpdate(Sender: TObject); + procedure actFileLocalRenameExecute(Sender: TObject); + procedure actFileLocalRenameUpdate(Sender: TObject); + procedure actFileRemoteRenameExecute(Sender: TObject); + procedure actFileRemoteRenameUpdate(Sender: TObject); + procedure actFileRemoteMakeDirectoryExecute(Sender: TObject); + procedure actFileRemoteMakeDirectoryUpdate(Sender: TObject); + procedure actFileLocalMakeDirectoryExecute(Sender: TObject); + procedure actFileLocalMakeDirectoryUpdate(Sender: TObject); + strict protected + { Private declarations } + LocalColumnToSort: Integer; + LocalAscending: Boolean; + + RemoteColumnToSort: Integer; + RemoteAscending: Boolean; + + FThreadRunning: Boolean; + + // colors + FErrorForeground: TColor; + FErrorBackground: TColor; + FSSLMessageForeground: TColor; + FSSLMessageBackground: TColor; + FDirOutputForeground: TColor; + FDirOutputBackground: TColor; + FDebugForeground: TColor; + FDebugBackground: TColor; + FLogDebugOutput: Boolean; + FLogDirOutput: Boolean; + + FProgressIndicator: TfrmFileProgress; + procedure InitLog; + // Thread procedure starts + procedure ConnectFTP; + procedure ChangeLocalDir(const ADir: String); + procedure ChangeRemoteDir(const ADir: String); + // + + procedure RemoteLvClearArrows; + procedure LocalClearArrows; + procedure DownloadFile(const AFile: String); + procedure UploadFile(const AFile: String); + procedure LocalDeleteFile(const AFile: String); + procedure RemoteDeleteFile(const AFile: String); + procedure LocalRemoveDir(const ADir: String); + procedure RemoteRemoveDir(const ADir: String); + procedure LocalRename(const AOldPathName, ANewPathName: String); + procedure RemoteRename(const AOldPathName, ANewPathName: String); + procedure LocalMakeDir(const ADir: String); + procedure RemoteMakeDir(const ADir: String); + procedure SetProxyType(const AType: Integer); + public + { Public declarations } + procedure PopulateLocalFiles; + procedure PopulateRemoteFiles(const ACurDir: String); + procedure SetupPRogressIndicator(const AFileName: String; + const AWorkMode: TWorkMode; const AWorkCount, AWorkMax: Int64); + procedure UpdateProgressIndicator(const AFileName: String; + const AWorkMode: TWorkMode; const AWorkCount, AWorkMax: Int64); + procedure CloseProgressIndicator; + + property LogDirOutput: Boolean read FLogDirOutput write FLogDirOutput; + property LogDebugOutput: Boolean read FLogDebugOutput write FLogDebugOutput; + property ThreadRunning : Boolean read FThreadRunning write FThreadRunning; + property ErrorForeground: TColor read FErrorForeground + write FErrorForeground; + property ErrorBackground: TColor read FErrorBackground + write FErrorBackground; + property DirOutputForeground: TColor read FDirOutputForeground + write FDirOutputForeground; + property DirOutputBackground: TColor read FDirOutputBackground + write FDirOutputBackground; + property DebugForeground: TColor read FDebugForeground + write FDebugForeground; + property DebugBackground: TColor read FDebugBackground + write FDebugBackground; + property SSLMessageForeground: TColor read FSSLMessageForeground + write FSSLMessageForeground; + property SSLMessageBackground: TColor read FSSLMessageBackground + write FSSLMessageBackground; + property ProgressIndicator: TfrmFileProgress read FProgressIndicator + write FProgressIndicator; + end; + + TFTPThread = class(TThread) + protected + FVerifyResult: Boolean; + FKeyPassword: String; + FError: Integer; + FDepth: Integer; + FX509: TIdX509; + FFTP: TIdFTP; + procedure PromptVerifyCert; + procedure PromptPassword; + procedure DoPasswordEx(ASender: TObject; var VPassword: String; + const AIsWrite: Boolean); + function DoVerifyPeer(Certificate: TIdX509; AOk: Boolean; + ADepth, AError: Integer): Boolean; + public + constructor Create(AFTP: TIdFTP); + destructor Destroy; override; + end; + + TConnectThread = class(TFTPThread) + public + procedure Execute(); override; + end; + + TRemoteChangeDirThread = class(TFTPThread) + protected + FNewDir: String; + public + constructor Create(AFTP: TIdFTP; const ANewDir: String); reintroduce; + procedure Execute(); override; + end; + + TFileThread = class(TFTPThread) + protected + FFile: String; + FSize: Int64; + public + constructor Create(AFTP: TIdFTP; const AFile: String); reintroduce; + end; + + TFileOnWorkThread = class(TFileThread) + protected + procedure OnWorkBegin(ASender: TObject; AWorkMode: TWorkMode; + AWorkCountMax: Int64); + procedure OnWork(ASender: TObject; AWorkMode: TWorkMode; AWorkCount: Int64); + procedure OnWorkEnd(ASender: TObject; AWorkMode: TWorkMode); + end; + + TDownloadFileThread = class(TFileOnWorkThread) + public + procedure Execute(); override; + end; + + TUploadFileThread = class(TFileOnWorkThread) + public + procedure Execute(); override; + end; + + TDeleteFileThread = class(TFileThread) + public + procedure Execute(); override; + end; + + TRemoveDirThread = class(TFileThread) + public + procedure Execute(); override; + end; + + TRenamePathThread = class(TFileThread) + protected + FNewName: String; + public + constructor Create(AFTP: TIdFTP; const AOldName, ANewName: String); + reintroduce; + procedure Execute(); override; + end; + + TMakeDirThread = class(TFileThread) + public + procedure Execute(); override; + end; + + TLogEventNotify = class(TIdNotify) + protected + FStr: String; + procedure DoNotify; override; + public + class procedure NotifyString(const AStr: String); virtual; + end; + + TLogFTPError = class(TLogEventNotify) + protected + procedure DoNotify; override; + public + class procedure NotifyString(const AStr: String); override; + end; + + TSSLEvent = class(TLogEventNotify) + protected + procedure DoNotify; override; + public + class procedure NotifyString(const AStr: String); override; + end; + + TSSLCipherEvent = class(TLogEventNotify) + protected + procedure DoNotify; override; + public + class procedure NotifyString(const AStr: String); override; + end; + + TStatusBarEvent = class(TLogEventNotify) + protected + procedure DoNotify; override; + public + class procedure NotifyString(const AStr: String); override; + end; + + TPopulateRemoteListNotify = class(TIdNotify) + protected + FCurrentDir: String; + procedure DoNotify; override; + public + class procedure PopulateRemoteList(const ACurrentDir: String); + end; + + TPopulateLocalListNotify = class(TIdNotify) + protected + procedure DoNotify; override; + public + class procedure PopulateLocalList; + end; + + TLogDirListingEvent = class(TIdNotify) + protected + FDirListing: TStrings; + procedure DoNotify; override; + public + class procedure LogDirListing(AStrings: TStrings); + end; + + TThreadStartNotify = class(TIdNotify) + protected + procedure DoNotify; override; + public + class procedure StartThread; + end; + + TThreadFinishedNotify = class(TIdNotify) + protected + procedure DoNotify; override; + public + class procedure EndThread; + end; + + TWorkEventNotify = class(TIdNotify) + protected + FFileName: String; + FWorkMode: TWorkMode; + FWorkCount: Int64; + FWorkCountMax: Int64; + public + end; + + TOnWorkNotify = class(TWorkEventNotify) + protected + procedure DoNotify; override; + public + class procedure WorkNotify(const AFileName: String; + const AWorkMode: TWorkMode; AWorkCount, AWorkCountMax: Int64); + end; + + TOnWorkNotifyBegin = class(TWorkEventNotify) + protected + procedure DoNotify; override; + public + class procedure WorkNotify(const AFileName: String; + const AWorkMode: TWorkMode; AWorkCount, AWorkCountMax: Int64); + end; + + TOnWorkNotifyEnd = class(TWorkEventNotify) + protected + procedure DoNotify; override; + public + class procedure WorkNotify(const AWorkMode: TWorkMode; + AWorkCount, AWorkCountMax: Int64); + end; + +var + frmMainForm: TfrmMainForm; + +implementation + +uses dkgFTPConnect, settingsdlg, frmAbout, frmBookmarks, CertViewer, + IdException, + IdAllFTPListParsers, + IdFTPCommon, + IdFTPList, IdGlobal, IdGlobalProtocols, IdReplyRFC, IdSSLOpenSSLLoader, + System.IOUtils, System.IniFiles, System.UITypes, + Winapi.CommCtrl, ProgUtils, AcceptableCerts; + +const + DIR_IMAGE_IDX = 6; + FILE_IMAGE_IDX = 7; + ARROW_UP_IMAGE_IDX = 8; + ARROW_DOWN_IMAGE_IDX = 9; + +{$R *.dfm} + +procedure TfrmMainForm.actFileDisconnectExecute(Sender: TObject); +begin + IdFTPClient.Disconnect; + lvRemoteFiles.Items.Clear; +end; + +procedure TfrmMainForm.actFileDisconnectUpdate(Sender: TObject); +begin + actFileDisconnect.Enabled := (not FThreadRunning) and IdFTPClient.Connected; +end; + +procedure TfrmMainForm.actFileDownloadExecute(Sender: TObject); +var + Li: TListItem; +begin + if lvRemoteFiles.ItemIndex > -1 then + begin + Li := lvRemoteFiles.Items[lvRemoteFiles.ItemIndex]; + DownloadFile(Li.Caption); + end; +end; + +procedure TfrmMainForm.actFileDownloadUpdate(Sender: TObject); +var + Li: TListItem; +begin + + actFileDownload.Enabled := (not FThreadRunning) and IdFTPClient.Connected and + (lvRemoteFiles.ItemIndex > -1); + if actFileDownload.Enabled then + begin + Li := lvRemoteFiles.Items[lvRemoteFiles.ItemIndex]; + actFileDownload.Enabled := Li.ImageIndex = FILE_IMAGE_IDX; + end; +end; + +procedure TfrmMainForm.actFileFTPSitesExecute(Sender: TObject); +var + LFrm: TfrmFTPSites; + LFTPSite: TFTPSite; +begin + LFrm := TfrmFTPSites.Create(nil); + try + if LFrm.ShowModal = mrOk then + begin + if LFrm.lbxFTPSites.ItemIndex > -1 then + begin + LFTPSite := LFrm.FTPSites[LFrm.lbxFTPSites.ItemIndex]; + IdFTPClient.Host := LFTPSite.HostName; + IdFTPClient.Username := LFTPSite.Username; + IdFTPClient.Password := LFTPSite.Password; + IdFTPClient.Account := LFTPSite.Account; + IdFTPClient.Port := LFTPSite.Port; + case LFTPSite.FTPPRotocol of + 0: + IdFTPClient.UseTLS := utNoTLSSupport; + 1: + IdFTPClient.UseTLS := utUseExplicitTLS; + 2: + IdFTPClient.UseTLS := utUseRequireTLS; + 3: + IdFTPClient.UseTLS := utUseImplicitTLS; + end; + case LFTPSite.TransferMode of + 0: + IdFTPClient.Passive := not ReadTransferDefault; + 1: + IdFTPClient.Passive := True; + 2: + IdFTPClient.Passive := False; + end; + Self.iosslFTP.SSLOptions.CertFile := LFTPSite.PublicKey; + Self.iosslFTP.SSLOptions.KeyFile := LFTPSite.PrivateKey; + Self.iosslFTP.SSLOptions.RootCertFile := LFTPSite.CAKey; + ConnectFTP; + end; + end; + finally + FreeAndNil(LFrm); + end; +end; + +procedure TfrmMainForm.actFileFTPSitesUpdate(Sender: TObject); +begin + actFileFTPSites.Enabled := (not FThreadRunning) and not IdFTPClient.Connected; +end; + +procedure TfrmMainForm.actFileLocalDeleteExecute(Sender: TObject); +var + Li: TListItem; +begin + if lvLocalFiles.ItemIndex > -1 then + begin + Li := lvLocalFiles.Items[lvLocalFiles.ItemIndex]; + case Li.ImageIndex of + FILE_IMAGE_IDX: + LocalDeleteFile(Li.Caption); + DIR_IMAGE_IDX: + LocalRemoveDir(Li.Caption); + end; + end; +end; + +procedure TfrmMainForm.actFileLocalDeleteUpdate(Sender: TObject); +var + Li: TListItem; + LRes: Boolean; +begin + LRes := (not FThreadRunning) and (lvLocalFiles.ItemIndex > -1); + if LRes then + begin + Li := lvLocalFiles.Items[lvLocalFiles.ItemIndex]; + LRes := Li.ImageIndex in [FILE_IMAGE_IDX, DIR_IMAGE_IDX]; + end; + actFileLocalDelete.Enabled := LRes; +end; + +procedure TfrmMainForm.actFileLocalMakeDirectoryExecute(Sender: TObject); +var + LNewDir: String; +begin + if InputQuery('Make Directory', 'New Directory Name: ', LNewDir) then + begin + if LNewDir <> '' then + begin + LocalMakeDir(LNewDir); + end; + end; +end; + +procedure TfrmMainForm.actFileLocalMakeDirectoryUpdate(Sender: TObject); +begin + actFileLocalMakeDirectory.Enabled := (not FThreadRunning); +end; + +procedure TfrmMainForm.actFileLocalRenameExecute(Sender: TObject); +var + Li: TListItem; + LNewName: String; +begin + if lvLocalFiles.ItemIndex > -1 then + begin + Li := lvLocalFiles.Items[lvLocalFiles.ItemIndex]; + if Li.ImageIndex in [FILE_IMAGE_IDX, DIR_IMAGE_IDX] then + begin + if InputQuery('Rename', 'Rename ' + Li.Caption + ' to:', LNewName) then + begin + if LNewName <> '' then + begin + LocalRename(Li.Caption, LNewName); + end; + end; + end; + end; +end; + +procedure TfrmMainForm.actFileLocalRenameUpdate(Sender: TObject); +var + Li: TListItem; + LRes: Boolean; +begin + LRes := (not FThreadRunning) and (lvLocalFiles.ItemIndex > -1); + if LRes then + begin + Li := lvLocalFiles.Items[lvLocalFiles.ItemIndex]; + LRes := Li.ImageIndex in [FILE_IMAGE_IDX, DIR_IMAGE_IDX]; + end; + actFileLocalRename.Enabled := LRes; + +end; + +procedure TfrmMainForm.actFileRemoteDeleteExecute(Sender: TObject); +var + Li: TListItem; +begin + if lvRemoteFiles.ItemIndex > -1 then + begin + Li := lvRemoteFiles.Items[lvRemoteFiles.ItemIndex]; + case Li.ImageIndex of + FILE_IMAGE_IDX: + RemoteDeleteFile(Li.Caption); + DIR_IMAGE_IDX: + RemoteRemoveDir(Li.Caption); + end; + + end; +end; + +procedure TfrmMainForm.actFileRemoteDeleteUpdate(Sender: TObject); +var + Li: TListItem; + LRes: Boolean; +begin + LRes := (not FThreadRunning) and IdFTPClient.Connected and + (lvRemoteFiles.ItemIndex > -1); + if LRes then + begin + Li := lvRemoteFiles.Items[lvRemoteFiles.ItemIndex]; + LRes := Li.ImageIndex in [FILE_IMAGE_IDX, DIR_IMAGE_IDX]; + end; + actFileRemoteDelete.Enabled := LRes; +end; + +procedure TfrmMainForm.actFileRemoteMakeDirectoryExecute(Sender: TObject); +var + LNewDir: String; +begin + if InputQuery('Make Directory', 'New Directory Name: ', LNewDir) then + begin + if LNewDir <> '' then + begin + RemoteMakeDir(LNewDir); + end; + end; +end; + +procedure TfrmMainForm.actFileRemoteMakeDirectoryUpdate(Sender: TObject); +begin + actFileRemoteMakeDirectory.Enabled := (not FThreadRunning) and + IdFTPClient.Connected +end; + +procedure TfrmMainForm.actFileRemoteRenameExecute(Sender: TObject); +var + Li: TListItem; + LNewName: String; +begin + if lvRemoteFiles.ItemIndex > -1 then + begin + Li := lvRemoteFiles.Items[lvRemoteFiles.ItemIndex]; + if Li.ImageIndex in [FILE_IMAGE_IDX, DIR_IMAGE_IDX] then + begin + if InputQuery('Rename', 'Rename ' + Li.Caption + ' to:', LNewName) then + begin + if LNewName <> '' then + begin + RemoteRename(Li.Caption, LNewName); + end; + end; + end; + end; +end; + +procedure TfrmMainForm.actFileRemoteRenameUpdate(Sender: TObject); +var + Li: TListItem; + LRes: Boolean; +begin + LRes := (not FThreadRunning) and IdFTPClient.Connected and + (lvRemoteFiles.ItemIndex > -1); + if LRes then + begin + Li := lvRemoteFiles.Items[lvRemoteFiles.ItemIndex]; + LRes := Li.ImageIndex in [FILE_IMAGE_IDX, DIR_IMAGE_IDX]; + end; + actFileRemoteRename.Enabled := LRes; + +end; + +procedure TfrmMainForm.actFileUploadExecute(Sender: TObject); +var + Li: TListItem; +begin + if lvLocalFiles.ItemIndex > -1 then + begin + Li := lvLocalFiles.Items[lvLocalFiles.ItemIndex]; + UploadFile(Li.Caption); + end; +end; + +procedure TfrmMainForm.actFileUploadUpdate(Sender: TObject); +var + Li: TListItem; +begin + actFileUpload.Enabled := (not FThreadRunning) and IdFTPClient.Connected and + (lvLocalFiles.ItemIndex > -1); + if actFileUpload.Enabled then + begin + Li := lvLocalFiles.Items[lvLocalFiles.ItemIndex]; + actFileUpload.Enabled := Li.ImageIndex = FILE_IMAGE_IDX; + end; +end; + +procedure TfrmMainForm.actHelpAboutExecute(Sender: TObject); +var + LFrm: TAboutBox; +begin + LFrm := TAboutBox.Create(nil); + try + LFrm.ShowModal; + finally + FreeAndNil(LFrm); + end; +end; + +procedure TfrmMainForm.actViewSettingExecute(Sender: TObject); +var + LFrm: TfrmSettings; + LIni: TIniFile; +begin + LFrm := TfrmSettings.Create(Application); + try + LIni := TIniFile.Create(GetIniFilePath); + try + LFrm.UsePortTransferType := LIni.ReadBool('Transfers', + 'Use_PORT_Transfers', False); + LFrm.redtLog.Font.Name := redtLog.Font.Name; + LFrm.redtTextSamples.Font.Name := LFrm.redtLog.Font.Name; + LFrm.redtLog.Font.Size := redtLog.Font.Size; + LFrm.redtTextSamples.Font.Size := LFrm.redtLog.Font.Size; + LFrm.ErrorForeground := FErrorForeground; + LFrm.ErrorBackground := FErrorBackground; + LFrm.SSLMessageForeground := FSSLMessageForeground; + LFrm.SSLMessageBackground := FSSLMessageBackground; + LFrm.DirOutputForeground := FDirOutputForeground; + LFrm.DirOutputBackground := FDirOutputBackground; + LFrm.DebugForeground := FDebugForeground; + LFrm.DebugBackground := FDebugBackground; + LFrm.NATIPAddress := IdFTPClient.ExternalIP; + LFrm.NATPortMin := IdFTPClient.DataPortMin; + LFrm.NATPortMax := IdFTPClient.DataPortMax; + LFrm.chklbAdvancedOptions.Checked[0] := IdFTPClient.UseHOST; + LFrm.chklbAdvancedOptions.Checked[1] := IdFTPClient.UseExtensionDataPort; + LFrm.chklbAdvancedOptions.Checked[2] := IdFTPClient.TryNATFastTrack; + LFrm.chklbAdvancedOptions.Checked[3] := IdFTPClient.UseMLIS; + if not Assigned(iosslFTP.TransparentProxy) then + begin + // 0 - none + LFrm.ProxyType := 0; + end + else + begin + // 1 - HTTP Connect Proxy + if iosslFTP.TransparentProxy = HTTPConnectThrough then + begin + LFrm.ProxyType := 1; + end + else + begin + case SocksInfo.Version of + // 2 - SOCKS4 + svSocks4: + begin + LFrm.ProxyType := 2; + end; + // 3 - SOCKS4A + svSocks4A: + begin + LFrm.ProxyType := 3; + end; + // 4 - SOCKS5 + svSocks5: + begin + LFrm.ProxyType := 4; + end; + end; + end; + end; + LFrm.ProxyHost := SocksInfo.Host; + LFrm.ProxyUsername := SocksInfo.Username; + LFrm.ProxyPassword := SocksInfo.Password; + LFrm.ProxyPort := SocksInfo.Port; + LFrm.FTPProxyType := Ord(IdFTPClient.ProxySettings.ProxyType); + LFrm.FTPProxyHost := IdFTPClient.ProxySettings.Host; + LFrm.FTPProxyPort := IdFTPClient.ProxySettings.Port; + LFrm.FTPProxyUsername := IdFTPClient.ProxySettings.Username; + LFrm.FTPProxyPassword := IdFTPClient.ProxySettings.Password; + LFrm.Connected := IdFTPClient.Connected; + LFrm.chkLogDebug.Checked := FLogDebugOutput; + LFrm.chkDirOutput.Checked := FLogDirOutput; + if LFrm.ShowModal = mrOk then + begin + FLogDebugOutput := LFrm.chkLogDebug.Checked; + FLogDirOutput := LFrm.chkDirOutput.Checked; + FErrorForeground := LFrm.ErrorForeground; + FErrorBackground := LFrm.ErrorBackground; + FSSLMessageForeground := LFrm.SSLMessageForeground; + FSSLMessageBackground := LFrm.SSLMessageBackground; + FDirOutputForeground := LFrm.DirOutputForeground; + FDirOutputBackground := LFrm.DirOutputBackground; + FDebugForeground := LFrm.DebugForeground; + FDebugBackground := LFrm.DebugBackground; + IdFTPClient.UseHOST := LFrm.chklbAdvancedOptions.Checked[0]; + IdFTPClient.ExternalIP := LFrm.NATIPAddress; + IdFTPClient.DataPortMin := LFrm.NATPortMin; + IdFTPClient.DataPortMax := LFrm.NATPortMax; + // Do things in a round about way because NAT fasttracking requires extended DataPort commands. + IdFTPClient.TryNATFastTrack := False; + + IdFTPClient.UseExtensionDataPort := + LFrm.chklbAdvancedOptions.Checked[1]; + if IdFTPClient.UseExtensionDataPort then + begin + IdFTPClient.TryNATFastTrack := LFrm.chklbAdvancedOptions.Checked[2]; + end; + IdFTPClient.UseMLIS := LFrm.chklbAdvancedOptions.Checked[3]; + LIni.WriteBool('FTP', 'Use_HOST_Command', IdFTPClient.UseHOST); + LIni.WriteString('NAT', 'NAT_IP_Address', IdFTPClient.ExternalIP); + LIni.WriteInteger('NAT', 'Data_PORT_Minimum', IdFTPClient.DataPortMin); + LIni.WriteInteger('NAT', 'Data_PORT_Maximum', IdFTPClient.DataPortMax); + LIni.WriteBool('Transfers', 'Use_Extended_Data_Port_Commands', + IdFTPClient.UseExtensionDataPort); + LIni.WriteBool('Transfers', 'Try_Using_NAT_Fast_Track', + IdFTPClient.TryNATFastTrack); + LIni.WriteBool('FTP', 'Use_MLSD_Command_Instead_Of_DIR_Command', + IdFTPClient.UseMLIS); + + LIni.WriteBool('Transfers', 'Use_PORT_Transfers', + LFrm.UsePortTransferType); + LIni.WriteBool('Transfers', 'Use_EPSV_EPRT_Data_Transfer', + LFrm.chklbAdvancedOptions.Checked[1]); + IdFTPClient.Passive := not LFrm.UsePortTransferType; + LIni.WriteBool('Debug', 'Log_Debug_Output', FLogDebugOutput); + LIni.WriteBool('Debug', 'Log_Directory_Output', FLogDirOutput); + redtLog.Font := LFrm.redtLog.Font; + LIni.WriteString('Log_Font', 'Name', redtLog.Font.Name); + LIni.WriteInteger('Log_Font', 'Size', redtLog.Font.Size); + + LIni.WriteString('Log_Font', 'Name', redtLog.Font.Name); + LIni.WriteInteger('Log_Font', 'CharSet', redtLog.Font.Charset); + LIni.WriteInteger('Log_Font', 'Size', redtLog.Font.Size); + LIni.WriteInteger('Log_Font', 'Style', Byte(redtLog.Font.Style)); + LIni.WriteInteger('Log_Font', 'Error_Foreground', FErrorForeground); + LIni.WriteInteger('Log_Font', 'Error_Background', FErrorBackground); + LIni.WriteInteger('Log_Font', 'SSL_Message_Foreground', + FSSLMessageForeground); + LIni.WriteInteger('Log_Font', 'SSL_Message_Background', + FSSLMessageBackground); + LIni.WriteInteger('Log_Font', 'Directory_Foreground', + FDirOutputForeground); + LIni.WriteInteger('Log_Font', 'Directory_Background', + FDirOutputBackground); + LIni.WriteInteger('Log_Font', 'Debug_Output_Foreground', + FDebugForeground); + LIni.WriteInteger('Log_Font', 'Debug_Output_Background', + FDebugBackground); + SetProxyType(LFrm.ProxyType); + LIni.WriteInteger('Proxy', 'Type', LFrm.ProxyType); + SocksInfo.Host := LFrm.ProxyHost; + SocksInfo.Port := LFrm.ProxyPort; + SocksInfo.Username := LFrm.ProxyUsername; + SocksInfo.Password := LFrm.ProxyPassword; + if (SocksInfo.Username <> '') and (SocksInfo.Password <> '') then + begin + SocksInfo.Authentication := saUsernamePassword; + end; + HTTPConnectThrough.Host := SocksInfo.Host; + HTTPConnectThrough.Port := SocksInfo.Port; + HTTPConnectThrough.Username := SocksInfo.Username; + HTTPConnectThrough.Password := SocksInfo.Password; + LIni.WriteString('Proxy', 'Server_Name', SocksInfo.Host); + LIni.WriteString('Proxy', 'User_Name', SocksInfo.Username); + LIni.WriteString('Proxy', 'Password', SocksInfo.Password); + LIni.WriteInteger('Proxy', 'Port', SocksInfo.Port); + IdFTPClient.ProxySettings.ProxyType := + TIdFtpProxyType(LFrm.FTPProxyType); + IdFTPClient.ProxySettings.Host := LFrm.FTPProxyHost; + IdFTPClient.ProxySettings.Port := LFrm.FTPProxyPort; + IdFTPClient.ProxySettings.Username := LFrm.FTPProxyUsername; + IdFTPClient.ProxySettings.Password := LFrm.FTPProxyPassword; + LIni.WriteInteger('FTP_Proxy', 'Type', LFrm.FTPProxyType); + LIni.WriteString('FTP_Proxy', 'Server_Name', SocksInfo.Host); + LIni.WriteString('FTP_Proxy', 'User_Name', SocksInfo.Username); + LIni.WriteString('FTP_Proxy', 'Password', SocksInfo.Password); + LIni.WriteInteger('FTP_Proxy', 'Port', SocksInfo.Port); + end; + finally + FreeAndNil(LIni); + end; + finally + FreeAndNil(LFrm); + end; +end; + +procedure TfrmMainForm.cboLocalCurrentDirKeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); +begin + if Key = 13 then + begin + ChangeLocalDir(cboLocalCurrentDir.Text); + end; +end; + +procedure TfrmMainForm.cboRemoteCurrentDirKeyDown(Sender: TObject; + var Key: Word; Shift: TShiftState); +begin + if Key = 13 then + begin + ChangeRemoteDir(cboRemoteCurrentDir.Text); + end; +end; + +procedure TfrmMainForm.ChangeLocalDir(const ADir: String); +begin + if System.SysUtils.SetCurrentDir(ADir) then + begin + PopulateLocalFiles; + end + else + begin + System.SysUtils.RaiseLastOSError; + end; +end; + +procedure TfrmMainForm.ChangeRemoteDir(const ADir: String); +begin + TRemoteChangeDirThread.Create(IdFTPClient, ADir); +end; + +procedure TfrmMainForm.ConnectFTP; +begin + if IdFTPClient.UseTLS <> utNoTLSSupport then + begin + IdFTPClient.DataPortProtection := ftpdpsPrivate; + end; + InitLog; + TConnectThread.Create(IdFTPClient); +end; + +procedure TfrmMainForm.DownloadFile(const AFile: String); +begin + TDownloadFileThread.Create(IdFTPClient, AFile); +end; + +procedure TfrmMainForm.UploadFile(const AFile: String); +begin + TUploadFileThread.Create(IdFTPClient, AFile); +end; + +procedure TfrmMainForm.actFileConnectExecute(Sender: TObject); +var + LFrm: TfrmConnect; +begin + LFrm := TfrmConnect.Create(Application); + try + LFrm.Caption := 'Connect'; + LFrm.QuickConnect := True; + LFrm.cboConnectionType.ItemIndex := 0; + if LFrm.ShowModal = mrOk then + begin + IdFTPClient.Host := LFrm.edtHostname.Text; + IdFTPClient.Username := LFrm.Username; + IdFTPClient.Password := LFrm.Password; + IdFTPClient.Account := LFrm.edtAccount.Text; + IdFTPClient.Port := LFrm.spnedtPort.Value; + IdFTPClient.IOHandler := iosslFTP; + IdFTPClient.Passive := not LFrm.UsePortTransferType; + IdFTPClient.UseTLS := LFrm.UseTLS; + iosslFTP.SSLOptions.KeyFile := LFrm.edtPrivateKeyFile.Text; + iosslFTP.SSLOptions.CertFile := LFrm.edtPublicKey.Text; + iosslFTP.SSLOptions.RootCertFile := LFrm.edtCAKey.Text; + ConnectFTP; + end; + finally + FreeAndNil(LFrm); + end; +end; + +procedure TfrmMainForm.actFileConnectUpdate(Sender: TObject); +begin + actFileConnect.Enabled := (not FThreadRunning) and not IdFTPClient.Connected; +end; + +procedure TfrmMainForm.FormClose(Sender: TObject; var Action: TCloseAction); +begin + if FThreadRunning then + begin + Action := caNone; + end + else + begin + IdFTPClient.Disconnect; + end; +end; + +procedure TfrmMainForm.FormCreate(Sender: TObject); +var + LIni: TIniFile; + i: Integer; +begin + FThreadRunning := False; + LocalColumnToSort := 0; + LocalAscending := True; + + RemoteColumnToSort := 0; + RemoteAscending := True; + + LocalClearArrows; + PopulateLocalFiles; + RemoteLvClearArrows; + pnlLocalBrowser.Constraints.MinWidth := pnlLocalBrowser.Width; + // pnlDivider.Constraints.MinWidth := pnlDivider.Width; + // pnlDivider.Constraints.MaxWidth := pnlDivider.Width; + pnlMainWindow.Constraints.MinHeight := pnlMainWindow.Height; + pnlRemoteBrowser.Constraints.MinWidth := pnlRemoteBrowser.Width; + IdFTPClient.Compressor := IdCompressorZLib1; + Application.Title := Caption; + iosslFTP.OnSSLNegotiated := iosslFTPOnSSLNegotiated; + LIni := TIniFile.Create(GetIniFilePath); + try + IdFTPClient.Passive := not LIni.ReadBool('Transfers', + 'Use_PORT_Transfers', False); + FLogDebugOutput := LIni.ReadBool('Debug', 'Log_Debug_Output', False); + FLogDirOutput := LIni.ReadBool('Debug', 'Log_Directory_Output', False); + redtLog.Font.Name := LIni.ReadString('Log_Font', 'Name', redtLog.Font.Name); + redtLog.Font.Charset := LIni.ReadInteger('Log_Font', 'CharSet', + redtLog.Font.Charset); + redtLog.Font.Size := LIni.ReadInteger('Log_Font', 'Size', + redtLog.Font.Size); + redtLog.Font.Style := TFontStyles(Byte(LIni.ReadInteger('Log_Font', 'Style', + Byte(redtLog.Font.Style)))); + FErrorForeground := LIni.ReadInteger('Log_Font', 'Error_Foreground', clRed); + FErrorBackground := LIni.ReadInteger('Log_Font', + 'Error_Background', clWhite); + FSSLMessageForeground := LIni.ReadInteger('Log_Font', + 'SSL_Message_Foreground', clTeal); + FSSLMessageBackground := LIni.ReadInteger('Log_Font', + 'SSL_Message_Background', clWhite); + FDirOutputForeground := LIni.ReadInteger('Log_Font', + 'Directory_Foreground', clBlue); + FDirOutputBackground := LIni.ReadInteger('Log_Font', + 'Directory_Background', clWhite); + FDebugForeground := LIni.ReadInteger('Log_Font', 'Debug_Output_Foreground', + clPurple); + FDebugBackground := LIni.ReadInteger('Log_Font', + 'Debug_Output_Background', clWhite); + IdFTPClient.UseHOST := LIni.ReadBool('FTP', 'Use_HOST_Command', + IdFTPClient.UseHOST); + IdFTPClient.UseExtensionDataPort := LIni.ReadBool('Transfers', + 'Use_Extended_Data_Port_Commands', IdFTPClient.UseExtensionDataPort); + IdFTPClient.TryNATFastTrack := LIni.ReadBool('Transfers', + 'Try_Using_NAT_Fast_Track', IdFTPClient.TryNATFastTrack); + IdFTPClient.UseMLIS := LIni.ReadBool('FTP', + 'Use_MLSD_Command_Instead_Of_DIR_Command', IdFTPClient.UseMLIS); + IdFTPClient.ExternalIP := LIni.ReadString('NAT', 'NAT_IP_Address', ''); + IdFTPClient.DataPortMin := LIni.ReadInteger('NAT', 'Data_PORT_Minimum', 0); + IdFTPClient.DataPortMax := LIni.ReadInteger('NAT', 'Data_PORT_Maximum', 0); + i := LIni.ReadInteger('Proxy', 'Type', 0); + SetProxyType(i); + if (SocksInfo.Username <> '') and (SocksInfo.Password <> '') then + begin + SocksInfo.Authentication := saUsernamePassword; + end; + SocksInfo.Host := LIni.ReadString('Proxy', 'Server_Name', ''); + SocksInfo.Username := LIni.ReadString('Proxy', 'User_Name', ''); + SocksInfo.Password := LIni.ReadString('Proxy', 'Password', ''); + SocksInfo.Port := LIni.ReadInteger('Proxy', 'Port', 1080); + HTTPConnectThrough.Username := SocksInfo.Username; + HTTPConnectThrough.Password := SocksInfo.Password; + HTTPConnectThrough.Port := SocksInfo.Port; + IdFTPClient.ProxySettings.ProxyType := + TIdFtpProxyType(LIni.ReadInteger('FTP_Proxy', 'Type', 0)); + IdFTPClient.ProxySettings.Host := LIni.ReadString('FTP_Proxy', + 'Server_Name', ''); + IdFTPClient.ProxySettings.Username := LIni.ReadString('FTP_Proxy', + 'User_Name', ''); + IdFTPClient.ProxySettings.Password := LIni.ReadString('FTP_Proxy', + 'Password', ''); + IdFTPClient.ProxySettings.Port := LIni.ReadInteger('FTP_Proxy', 'Port', 0); + finally + FreeAndNil(LIni); + end; + InitLog; +end; + +procedure TfrmMainForm.InitLog; +var + i: Integer; +begin + redtLog.Lines.Clear; + + redtLog.Lines.Add('Operating System: ' + TOSVersion.ToString); + redtLog.Lines.Add(' RTL Version: ' + IntToStr(Hi(GetRTLVersion)) + '.' + + IntToStr(Lo(GetRTLVersion))); +{$IFDEF WIN64} + redtLog.Lines.Add(' Compiled For: Win64'); +{$ELSE} + redtLog.Lines.Add(' Compiled For: Win32'); +{$ENDIF} + redtLog.Lines.Add(' OpenSSL Version: ' + IdSSLOpenSSL.OpenSSLVersion); + if GetOpenSSLLoader.GetFailedToLoad.Count > 0 then + begin + redtLog.Lines.Add(' Failed To Load: '); + for i := 0 to GetOpenSSLLoader.GetFailedToLoad.Count - 1 do + begin + redtLog.Lines.Add(GetOpenSSLLoader.GetFailedToLoad[i]); + end; + end; + ScrollToEnd(redtLog); +end; + +procedure TfrmMainForm.FIdLogReceived(ASender: TComponent; + const AText, AData: string); +var + LData: String; +begin + LData := Trim(AData); + if Length(LData) > 0 then + begin + if CharInSet(LData[1], ['4', '5']) then + begin + TLogFTPError.NotifyString(LData); + end + else + begin + TLogEventNotify.NotifyString(LData); + end; + end; +end; + +procedure TfrmMainForm.FIdLogSent(ASender: TComponent; + const AText, AData: string); +begin + if IndyPos('PASS ', AData) > 0 then + begin + TLogEventNotify.NotifyString('PASS ***'); + end + else + begin + TLogEventNotify.NotifyString(Trim(AData)); + end; +end; + +procedure TfrmMainForm.FIdLogStatus(ASender: TComponent; const AText: string); +begin + TStatusBarEvent.NotifyString(AText); + lvRemoteFiles.Enabled := IdFTPClient.Connected; + cboRemoteCurrentDir.Enabled := IdFTPClient.Connected; + lblRemotDir.Enabled := IdFTPClient.Connected; +end; + +procedure TfrmMainForm.iosslFTPOnSSLNegotiated + (ASender: TIdSSLIOHandlerSocketOpenSSL); +var + LStr: String; + LNo: Integer; +begin + if Assigned(ASender.SSLSocket) then + begin + LStr := ASender.SSLSocket.SSLProtocolVersionStr; + if LStr <> '' then + begin + TSSLCipherEvent.NotifyString(' TLS Version: ' + LStr); + end; + if Assigned(ASender.SSLSocket.Cipher) then + begin + LStr := ASender.SSLSocket.Cipher.Name; + if LStr <> '' then + TSSLCipherEvent.NotifyString(' Cipher Name: ' + LStr); + LStr := ASender.SSLSocket.Cipher.Description; + if LStr <> '' then + TSSLCipherEvent.NotifyString('Cipher Description: ' + Trim(LStr)); + LStr := ASender.SSLSocket.Cipher.Version; + if LStr <> '' then + TSSLCipherEvent.NotifyString(' Cipher Version: ' + LStr); + LNo := ASender.SSLSocket.Cipher.Bits; + if LNo <> 0 then + begin + TSSLCipherEvent.NotifyString(' Cipher Bits: ' + IntToStr(LNo)); + end; + end; + end; +end; + +procedure TfrmMainForm.iosslFTPStatusInfoEx(ASender: TObject; + const AsslSocket: PSSL; const AWhere, Aret: TIdC_INT; + const AType, AMsg: string); + +begin + TSSLEvent.NotifyString(AType); + TSSLEvent.NotifyString(AMsg); +end; + +procedure TfrmMainForm.LocalClearArrows; +var + i: Integer; + LMax: Integer; +begin + lvLocalFiles.Columns.BeginUpdate; + try + LMax := lvRemoteFiles.Columns.Count - 1; + for i := 0 to LMax do + begin + lvLocalFiles.Columns[i].ImageIndex := -1; + end; + if RemoteAscending then + begin + lvLocalFiles.Columns[LocalColumnToSort].ImageIndex := ARROW_UP_IMAGE_IDX; + end + else + begin + lvLocalFiles.Columns[LocalColumnToSort].ImageIndex := + ARROW_DOWN_IMAGE_IDX; + end; + finally + lvLocalFiles.Columns.EndUpdate; + end; + +end; + +procedure TfrmMainForm.LocalDeleteFile(const AFile: String); +begin + if MessageDlg('Delete ' + AFile + '?', mtConfirmation, [mbYes, mbNo], 0) = mrYes + then + begin + System.SysUtils.DeleteFile(AFile); + PopulateLocalFiles; + end; +end; + +procedure TfrmMainForm.LocalMakeDir(const ADir: String); +begin + System.SysUtils.CreateDir(ADir); + PopulateLocalFiles; +end; + +procedure TfrmMainForm.LocalRemoveDir(const ADir: String); +begin + if MessageDlg('Remove Directory ' + ADir + '?', mtConfirmation, [mbYes, mbNo], + 0) = mrYes then + begin + System.SysUtils.RemoveDir(ADir); + PopulateLocalFiles; + end; +end; + +procedure TfrmMainForm.LocalRename(const AOldPathName, ANewPathName: String); +begin + System.SysUtils.RenameFile(AOldPathName, ANewPathName); +end; + +function CompareCaptions(Item1, Item2: TListItem): Integer; +begin + if Item1.Caption > Item2.Caption then + begin + Result := 1; + end + else + begin + if Item1.Caption < Item2.Caption then + begin + Result := -1; + end + else + begin + Result := 0; + end; + end; +end; + +procedure TfrmMainForm.lvLocalFilesColumnClick(Sender: TObject; + Column: TListColumn); +begin + if Column.Index = LocalColumnToSort then + begin + LocalAscending := not LocalAscending + end + else + begin + LocalColumnToSort := Column.Index; + end; + LocalClearArrows; + lvLocalFiles.Items.BeginUpdate; + lvLocalFiles.AlphaSort; + lvLocalFiles.Items.EndUpdate; +end; + +procedure TfrmMainForm.lvLocalFilesCompare(Sender: TObject; + Item1, Item2: TListItem; Data: Integer; var Compare: Integer); +begin + // + case LocalColumnToSort of + 0: // file name + begin + Compare := CompareCaptions(Item1, Item2); + end; + 1: // file type, file name + begin + if Item1.SubItems[0] > Item2.SubItems[0] then + begin + Compare := 1; + end + else + begin + if Item1.SubItems[0] > Item2.SubItems[0] then + begin + Compare := 1; + end + else + begin + if Item1.SubItems[0] < Item2.SubItems[0] then + begin + Compare := -1; + end + else + begin + Compare := CompareCaptions(Item1, Item2); + end; + end; + end; + end; + 2: // file size, file name + begin + if Item1.SubItems[1] > Item2.SubItems[1] then + begin + Compare := 1; + end + else + begin + if Item1.SubItems[1] > Item2.SubItems[1] then + begin + Compare := 1; + end + else + begin + if Item1.SubItems[1] < Item2.SubItems[1] then + begin + Compare := -1; + end + else + begin + Compare := CompareCaptions(Item1, Item2); + end; + end; + end; + + end; + 3: // file modified date, file name + begin + if Item1.SubItems[2] > Item2.SubItems[2] then + begin + Compare := 1; + end + else + begin + if Item1.SubItems[2] > Item2.SubItems[2] then + begin + Compare := 1; + end + else + begin + if Item1.SubItems[2] < Item2.SubItems[2] then + begin + Compare := -1; + end + else + begin + Compare := CompareCaptions(Item1, Item2); + end; + end; + end; + end; + end; + if LocalAscending then + begin + Compare := 0 - Compare; + end; + +end; + +procedure TfrmMainForm.lvLocalFilesDblClick(Sender: TObject); +var + Li: TListItem; + LCurDir: String; +begin + // + if lvLocalFiles.ItemIndex > -1 then + begin + Li := lvLocalFiles.Items[lvLocalFiles.ItemIndex]; + if Li.ImageIndex = DIR_IMAGE_IDX then + begin + LCurDir := GetCurrentDir; + LCurDir := LCurDir + '\' + Li.Caption; + ChangeLocalDir(LCurDir); + end; + if Li.ImageIndex = FILE_IMAGE_IDX then + begin + UploadFile(Li.Caption); + end; + end; +end; + +procedure TfrmMainForm.lvRemoteFilesColumnClick(Sender: TObject; + Column: TListColumn); + +begin + if Column.Index = RemoteColumnToSort then + begin + RemoteAscending := not RemoteAscending + end + else + begin + RemoteColumnToSort := Column.Index; + end; + RemoteLvClearArrows; + lvRemoteFiles.Items.BeginUpdate; + lvRemoteFiles.AlphaSort; + lvRemoteFiles.Items.EndUpdate; +end; + +procedure TfrmMainForm.lvRemoteFilesCompare(Sender: TObject; + Item1, Item2: TListItem; Data: Integer; var Compare: Integer); +begin + // + case RemoteColumnToSort of + 0: // file name + begin + Compare := CompareCaptions(Item1, Item2); + end; + 1: // file type, file name + begin + if Item1.SubItems[0] > Item2.SubItems[0] then + begin + Compare := 1; + end + else + begin + if Item1.SubItems[0] > Item2.SubItems[0] then + begin + Compare := 1; + end + else + begin + if Item1.SubItems[0] < Item2.SubItems[0] then + begin + Compare := -1; + end + else + begin + Compare := CompareCaptions(Item1, Item2); + end; + end; + end; + end; + 2: // file size, file name + begin + if Item1.SubItems[1] > Item2.SubItems[1] then + begin + Compare := 1; + end + else + begin + if Item1.SubItems[1] > Item2.SubItems[1] then + begin + Compare := 1; + end + else + begin + if Item1.SubItems[1] < Item2.SubItems[1] then + begin + Compare := -1; + end + else + begin + Compare := CompareCaptions(Item1, Item2); + end; + end; + end; + + end; + 3: // file modified date, file name + begin + if Item1.SubItems[2] > Item2.SubItems[2] then + begin + Compare := 1; + end + else + begin + if Item1.SubItems[2] > Item2.SubItems[2] then + begin + Compare := 1; + end + else + begin + if Item1.SubItems[2] < Item2.SubItems[2] then + begin + Compare := -1; + end + else + begin + Compare := CompareCaptions(Item1, Item2); + end; + end; + end; + end; + end; + if RemoteAscending then + begin + Compare := 0 - Compare; + end; +end; + +procedure TfrmMainForm.lvRemoteFilesDblClick(Sender: TObject); +var + Li: TListItem; +begin + if lvRemoteFiles.ItemIndex > -1 then + begin + Li := lvRemoteFiles.Items[lvRemoteFiles.ItemIndex]; + if Li.ImageIndex = DIR_IMAGE_IDX then + begin + ChangeRemoteDir(Li.Caption); + end; + if Li.ImageIndex = FILE_IMAGE_IDX then + begin + DownloadFile(Li.Caption); + end; + end; +end; + +procedure TfrmMainForm.PopulateLocalFiles; +var + Li: TListItem; + LF: TSearchRec; +begin + lvLocalFiles.Items.BeginUpdate; + try + lvLocalFiles.Items.Clear; + lvLocalFiles.LargeImages := vimglstMainProgram; + cboLocalCurrentDir.Text := GetCurrentDir; + if FindFirst(GetCurrentDir + '\*.*', faAnyFile, LF) = 0 then + begin + repeat + Li := lvLocalFiles.Items.Add; + Li.Caption := LF.Name; + if LF.Attr and faDirectory <> 0 then + begin + Li.SubItems.Add('Directory'); + Li.ImageIndex := DIR_IMAGE_IDX; + end + else + begin + Li.SubItems.Add('File'); + Li.ImageIndex := FILE_IMAGE_IDX; + end; + Li.SubItems.Add(IntToStr(LF.Size)); + Li.SubItems.Add(DateTimeToStr(LF.TimeStamp)); + until FindNext(LF) <> 0; + FindClose(LF); + end; + lvLocalFiles.AlphaSort; + finally + lvLocalFiles.Items.EndUpdate; + end; +end; + +procedure TfrmMainForm.PopulateRemoteFiles(const ACurDir: String); +var + i: Integer; + Li: TListItem; +begin + lvRemoteFiles.Items.BeginUpdate; + try + cboRemoteCurrentDir.Text := ACurDir; + lvRemoteFiles.Items.Clear; + lvRemoteFiles.LargeImages := vimglstMainProgram; + for i := 0 to IdFTPClient.DirectoryListing.Count - 1 do + begin + Li := lvRemoteFiles.Items.Add; + Li.Caption := IdFTPClient.DirectoryListing[i].FileName; + case IdFTPClient.DirectoryListing[i].ItemType of + ditDirectory: + begin + Li.SubItems.Add('Directory'); + Li.ImageIndex := DIR_IMAGE_IDX; + end; + ditFile: + begin + Li.SubItems.Add('File'); + Li.ImageIndex := FILE_IMAGE_IDX; + end; + ditSymbolicLink: + begin + Li.SubItems.Add('Symbolic link'); + end; + ditSymbolicLinkDir: + begin + Li.SubItems.Add('Symbolic link'); + end; + ditBlockDev: + begin + Li.SubItems.Add('Block Device'); + end; + ditCharDev: + begin + Li.SubItems.Add('Character Device'); + end; + ditFIFO: + begin + Li.SubItems.Add('Named Pipe'); + end; + ditSocket: + begin + Li.SubItems.Add('Socket'); + end; + end; + if IdFTPClient.DirectoryListing[i].SizeAvail then + begin + Li.SubItems.Add(IntToStr(IdFTPClient.DirectoryListing[i].Size)); + end + else + begin + Li.SubItems.Add(''); + end; + if IdFTPClient.DirectoryListing[i].ModifiedAvail then + begin + Li.SubItems.Add(DateTimeToStr(IdFTPClient.DirectoryListing[i] + .ModifiedDate)); + end + else + begin + Li.SubItems.Add(''); + end; + end; + lvRemoteFiles.AlphaSort; + finally + lvRemoteFiles.Items.EndUpdate; + end; +end; + +procedure TfrmMainForm.RemoteDeleteFile(const AFile: String); +begin + if MessageDlg('Delete ' + AFile + '?', mtConfirmation, [mbYes, mbNo], 0) = mrYes + then + begin + TDeleteFileThread.Create(IdFTPClient, AFile); + end; +end; + +procedure TfrmMainForm.RemoteLvClearArrows; +var + i: Integer; + LMax: Integer; +begin + lvRemoteFiles.Columns.BeginUpdate; + try + LMax := lvRemoteFiles.Columns.Count - 1; + for i := 0 to LMax do + begin + lvRemoteFiles.Columns[i].ImageIndex := -1; + end; + if RemoteAscending then + begin + lvRemoteFiles.Columns[RemoteColumnToSort].ImageIndex := + ARROW_UP_IMAGE_IDX; + end + else + begin + lvRemoteFiles.Columns[RemoteColumnToSort].ImageIndex := + ARROW_DOWN_IMAGE_IDX; + end; + finally + lvRemoteFiles.Columns.EndUpdate; + end; +end; + +procedure TfrmMainForm.RemoteMakeDir(const ADir: String); +begin + TMakeDirThread.Create(IdFTPClient, ADir); +end; + +procedure TfrmMainForm.RemoteRemoveDir(const ADir: String); +begin + TRemoveDirThread.Create(IdFTPClient, ADir); +end; + +procedure TfrmMainForm.RemoteRename(const AOldPathName, ANewPathName: String); +begin + TRenamePathThread.Create(IdFTPClient, AOldPathName, ANewPathName); +end; + +procedure TfrmMainForm.SetProxyType(const AType: Integer); +begin + case AType of + 0: + iosslFTP.TransparentProxy := nil; + 1: + iosslFTP.TransparentProxy := HTTPConnectThrough; + 2: + begin + iosslFTP.TransparentProxy := SocksInfo; + SocksInfo.Version := svSocks4; + end; + 3: + begin + iosslFTP.TransparentProxy := SocksInfo; + SocksInfo.Version := svSocks4A; + end; + 4: + begin + iosslFTP.TransparentProxy := SocksInfo; + SocksInfo.Version := svSocks5; + end; + end; +end; + +procedure TfrmMainForm.SetupPRogressIndicator(const AFileName: String; + const AWorkMode: TWorkMode; const AWorkCount, AWorkMax: Int64); +begin + if not Assigned(FProgressIndicator) then + begin + FProgressIndicator := TfrmFileProgress.Create(Application); + end; + FProgressIndicator.UpdateProgressIndicator(AFileName, AWorkMode, AWorkCount, + AWorkMax); + FProgressIndicator.Show; + FProgressIndicator.Repaint; + Application.ProcessMessages; +end; + +procedure TfrmMainForm.UpdateProgressIndicator(const AFileName: String; + const AWorkMode: TWorkMode; const AWorkCount, AWorkMax: Int64); +begin + if not Assigned(FProgressIndicator) then + begin + FProgressIndicator := TfrmFileProgress.Create(Application); + end; + FProgressIndicator.UpdateProgressIndicator(AFileName, AWorkMode, AWorkCount, + AWorkMax); + FProgressIndicator.Show; + FProgressIndicator.Repaint; +end; + +procedure TfrmMainForm.CloseProgressIndicator; +begin + FreeAndNil(FProgressIndicator); +end; + +{ TFTPThread } + +constructor TFTPThread.Create(AFTP: TIdFTP); +begin + inherited Create(False); + FFTP := AFTP; + + FreeOnTerminate := True; +end; + +destructor TFTPThread.Destroy; +begin + inherited; +end; + +procedure TFTPThread.DoPasswordEx(ASender: TObject; var VPassword: String; + const AIsWrite: Boolean); +begin + Synchronize(Self, PromptPassword); + VPassword := FKeyPassword; +end; + +function TFTPThread.DoVerifyPeer(Certificate: TIdX509; AOk: Boolean; + ADepth, AError: Integer): Boolean; +begin + FX509 := Certificate; + FError := AError; + FDepth := ADepth; + Synchronize(Self, PromptVerifyCert); + Result := FVerifyResult; +end; + +procedure TFTPThread.PromptPassword; +begin + InputQuery('Key Password', 'Enter Key Password:', FKeyPassword); +end; + +procedure TFTPThread.PromptVerifyCert; +var + LFrm: TfrmCertViewer; +begin + try + if GAcceptableCertificates.IndexOf(FX509.Fingerprints.SHA512AsString) = -1 + then + begin + LFrm := TfrmCertViewer.Create(nil); + try + LFrm.ErrorForeground := frmMainForm.ErrorForeground; + LFrm.ErrorBackground := frmMainForm.ErrorBackground; + LFrm.X509 := FX509; + LFrm.Error := FError; + FVerifyResult := LFrm.ShowModal = mrYes; + if FVerifyResult and (LFrm.chkacceptOnlyOnce.Checked = False) then + begin + GAcceptableCertificates.Add(FX509.Fingerprints.SHA512AsString); + end; + finally + FreeAndNil(LFrm); + end; + end + else + begin + FVerifyResult := True; + end; + (FFTP.IOHandler as TIdSSLIOHandlerSocketOpenSSL).OnVerifyPeer := nil; + except + FVerifyResult := False; + end; +end; + +{ TConnectThread } + +procedure TConnectThread.Execute; +var + LCurDir: String; +begin + try + TThreadStartNotify.StartThread; + (FFTP.IOHandler as TIdSSLIOHandlerSocketOpenSSL).OnVerifyPeer := + DoVerifyPeer; + (FFTP.IOHandler as TIdSSLIOHandlerSocketOpenSSL).OnGetPasswordEx := + DoPasswordEx; + FFTP.Connect; + if FFTP.IsCompressionSupported then + begin + FFTP.TransferMode(dmDeflate); + end; + LCurDir := FFTP.RetrieveCurrentDir; + FFTP.List; + TLogDirListingEvent.LogDirListing(FFTP.ListResult); + TPopulateRemoteListNotify.PopulateRemoteList(LCurDir); + except + on E: EIdReplyRFCError do + begin + // This is already reported in the FTP log Window + end; + on E: Exception do + TLogFTPError.NotifyString(E.Message); + end; + (FFTP.IOHandler as TIdSSLIOHandlerSocketOpenSSL).OnGetPasswordEx := nil; + TThreadFinishedNotify.EndThread; +end; + +{ TRemoteChangeDirThread } + +constructor TRemoteChangeDirThread.Create(AFTP: TIdFTP; const ANewDir: String); +begin + inherited Create(AFTP); + FNewDir := ANewDir; +end; + +procedure TRemoteChangeDirThread.Execute; +var + LCurDir: String; +begin + try + (FFTP.IOHandler as TIdSSLIOHandlerSocketOpenSSL).OnGetPasswordEx := + DoPasswordEx; + TThreadStartNotify.StartThread; + FFTP.ChangeDir(FNewDir); + LCurDir := FFTP.RetrieveCurrentDir; + FFTP.List; + TLogDirListingEvent.LogDirListing(FFTP.ListResult); + TPopulateRemoteListNotify.PopulateRemoteList(LCurDir); + except + on E: EIdReplyRFCError do + begin + // This is already reported in the FTP log Window + end; + on E: Exception do + TLogFTPError.NotifyString(E.Message); + end; + TThreadFinishedNotify.EndThread; + (FFTP.IOHandler as TIdSSLIOHandlerSocketOpenSSL).OnGetPasswordEx := nil; +end; + +{ TFileThread } + +constructor TFileThread.Create(AFTP: TIdFTP; const AFile: String); +begin + inherited Create(AFTP); + FFile := AFile; +end; + +{ TFileOnWorkThread } + +procedure TFileOnWorkThread.OnWork(ASender: TObject; AWorkMode: TWorkMode; + AWorkCount: Int64); +begin + TOnWorkNotify.WorkNotify(FFile, AWorkMode, AWorkCount, FSize); + if Assigned(frmMainForm.ProgressIndicator) then + begin + if frmMainForm.ProgressIndicator.CancelPressed then + begin + Self.FFTP.Abort; + frmMainForm.ProgressIndicator.CancelPressed := False; + end; + end; +end; + +procedure TFileOnWorkThread.OnWorkBegin(ASender: TObject; AWorkMode: TWorkMode; + AWorkCountMax: Int64); +begin + + TOnWorkNotifyBegin.WorkNotify(FFile, AWorkMode, 0, FSize); +end; + +procedure TFileOnWorkThread.OnWorkEnd(ASender: TObject; AWorkMode: TWorkMode); +begin + TOnWorkNotifyEnd.WorkNotify(AWorkMode, FSize, FSize); +end; + +{ TDownloadFileThread } + +procedure TDownloadFileThread.Execute; +var + LFile: TStream; +begin + (FFTP.IOHandler as TIdSSLIOHandlerSocketOpenSSL).OnGetPasswordEx := + DoPasswordEx; + try + TThreadStartNotify.StartThread; + FSize := FFTP.Size(FFile); + FFTP.OnWorkBegin := Self.OnWorkBegin; + FFTP.OnWork := Self.OnWork; + FFTP.OnWorkEnd := Self.OnWorkEnd; + LFile := TFileStream.Create(FFile, fmCreate); + try + FFTP.TransferType := ftBinary; + FFTP.Get(FFile, LFile); + finally + FreeAndNil(LFile); + end; + TFile.SetLastWriteTime(FFile, FFTP.FileDate(FFile)); + TPopulateLocalListNotify.PopulateLocalList; + except + on E: EIdReplyRFCError do + begin + // This is already reported in the FTP log Window + end; + on E: Exception do + TLogFTPError.NotifyString(E.Message); + end; + FFTP.OnWorkBegin := nil; + FFTP.OnWork := nil; + FFTP.OnWorkEnd := nil; + (FFTP.IOHandler as TIdSSLIOHandlerSocketOpenSSL).OnGetPasswordEx := nil; + TThreadFinishedNotify.EndThread; +end; + +{ TUploadFileThread } + +procedure TUploadFileThread.Execute; +var + LFile: TStream; + LCurDir: String; +begin + try + FSize := IdGlobalProtocols.FileSizeByName(FFile); + (FFTP.IOHandler as TIdSSLIOHandlerSocketOpenSSL).OnGetPasswordEx := + DoPasswordEx; + FFTP.OnWorkBegin := Self.OnWorkBegin; + FFTP.OnWork := Self.OnWork; + FFTP.OnWorkEnd := Self.OnWorkEnd; + TThreadStartNotify.StartThread; + LFile := TFileStream.Create(FFile, fmOpenRead); + try + FFTP.TransferType := ftBinary; + FFTP.Put(LFile, FFile); + finally + FreeAndNil(LFile); + end; + FFTP.SetModTime(FFile, TFile.GetLastWriteTime(FFile)); + LCurDir := FFTP.RetrieveCurrentDir; + FFTP.List; + TLogDirListingEvent.LogDirListing(FFTP.ListResult); + TPopulateRemoteListNotify.PopulateRemoteList(LCurDir); + except + on E: EIdReplyRFCError do + begin + // This is already reported in the FTP log Window + end; + on E: Exception do + TLogFTPError.NotifyString(E.Message); + end; + FFTP.OnWorkBegin := nil; + FFTP.OnWork := nil; + FFTP.OnWorkEnd := nil; + (FFTP.IOHandler as TIdSSLIOHandlerSocketOpenSSL).OnGetPasswordEx := nil; + TThreadFinishedNotify.EndThread; +end; + +{ TDeleteFileThread } + +procedure TDeleteFileThread.Execute; +var + LCurDir: String; +begin + try + (FFTP.IOHandler as TIdSSLIOHandlerSocketOpenSSL).OnGetPasswordEx := + DoPasswordEx; + TThreadStartNotify.StartThread; + FFTP.Delete(FFile); + LCurDir := FFTP.RetrieveCurrentDir; + FFTP.List; + TLogDirListingEvent.LogDirListing(FFTP.ListResult); + TPopulateRemoteListNotify.PopulateRemoteList(LCurDir); + except + on E: EIdReplyRFCError do + begin + // This is already reported in the FTP log Window + end; + on E: Exception do + TLogFTPError.NotifyString(E.Message); + end; + (FFTP.IOHandler as TIdSSLIOHandlerSocketOpenSSL).OnGetPasswordEx := nil; + TThreadFinishedNotify.EndThread; +end; + +{ TRemoveDirThread } + +procedure TRemoveDirThread.Execute; +var + LCurDir: String; +begin + try + (FFTP.IOHandler as TIdSSLIOHandlerSocketOpenSSL).OnGetPasswordEx := + DoPasswordEx; + TThreadStartNotify.StartThread; + FFTP.RemoveDir(FFile); + LCurDir := FFTP.RetrieveCurrentDir; + FFTP.List; + TLogDirListingEvent.LogDirListing(FFTP.ListResult); + TPopulateRemoteListNotify.PopulateRemoteList(LCurDir); + except + on E: EIdReplyRFCError do + begin + // This is already reported in the FTP log Window + end; + on E: Exception do + TLogFTPError.NotifyString(E.Message); + end; + (FFTP.IOHandler as TIdSSLIOHandlerSocketOpenSSL).OnGetPasswordEx := + DoPasswordEx; + TThreadFinishedNotify.EndThread; +end; + +{ TRenamePathThread } + +constructor TRenamePathThread.Create(AFTP: TIdFTP; + const AOldName, ANewName: String); +begin + inherited Create(AFTP, AOldName); + FNewName := ANewName; +end; + +procedure TRenamePathThread.Execute; +var + LCurDir: String; +begin + try + (FFTP.IOHandler as TIdSSLIOHandlerSocketOpenSSL).OnGetPasswordEx := + DoPasswordEx; + TThreadStartNotify.StartThread; + FFTP.Rename(FFile, FNewName); + LCurDir := FFTP.RetrieveCurrentDir; + FFTP.List; + TLogDirListingEvent.LogDirListing(FFTP.ListResult); + TPopulateRemoteListNotify.PopulateRemoteList(LCurDir); + except + on E: EIdReplyRFCError do + begin + // This is already reported in the FTP log Window + end; + on E: Exception do + TLogFTPError.NotifyString(E.Message); + end; + (FFTP.IOHandler as TIdSSLIOHandlerSocketOpenSSL).OnGetPasswordEx := nil; + TThreadFinishedNotify.EndThread; + +end; + +{ TMakeDirThread } + +procedure TMakeDirThread.Execute; +var + LCurDir: String; +begin + try + (FFTP.IOHandler as TIdSSLIOHandlerSocketOpenSSL).OnGetPasswordEx := + DoPasswordEx; + TThreadStartNotify.StartThread; + FFTP.MakeDir(FFile); + LCurDir := FFTP.RetrieveCurrentDir; + FFTP.List; + TLogDirListingEvent.LogDirListing(FFTP.ListResult); + TPopulateRemoteListNotify.PopulateRemoteList(LCurDir); + except + on E: EIdReplyRFCError do + begin + // This is already reported in the FTP log Window + end; + on E: Exception do + TLogFTPError.NotifyString(E.Message); + end; + (FFTP.IOHandler as TIdSSLIOHandlerSocketOpenSSL).OnGetPasswordEx := nil; + TThreadFinishedNotify.EndThread; +end; + +{ TLogEventNotify } + +procedure TLogEventNotify.DoNotify; +begin + frmMainForm.redtLog.Lines.Add(FStr); + ScrollToEnd(frmMainForm.redtLog); +end; + +class procedure TLogEventNotify.NotifyString(const AStr: String); +var + L: TLogEventNotify; +begin + L := TLogEventNotify.Create; + L.FStr := AStr; + L.Notify; +end; + +{ TLogFTPError } + +procedure TLogFTPError.DoNotify; +begin + frmMainForm.redtLog.SelAttributes.Color := frmMainForm.ErrorForeground; + frmMainForm.redtLog.SelAttributes.BackColor := frmMainForm.ErrorBackground; + inherited; +end; + +class procedure TLogFTPError.NotifyString(const AStr: String); +var + L: TLogFTPError; +begin + L := TLogFTPError.Create; + L.FStr := AStr; + L.Notify; +end; + +{ TSSLEvent } + +procedure TSSLEvent.DoNotify; +begin + if frmMainForm.LogDebugOutput then + begin + frmMainForm.redtLog.SelAttributes.Color := frmMainForm.DebugForeground; + frmMainForm.redtLog.SelAttributes.BackColor := frmMainForm.DebugBackground; + inherited; + end; +end; + +class procedure TSSLEvent.NotifyString(const AStr: String); +var + L: TSSLEvent; +begin + L := TSSLEvent.Create; + L.FStr := AStr; + L.Notify; +end; + +{ TSSLCipherEvent } + +procedure TSSLCipherEvent.DoNotify; +begin + frmMainForm.redtLog.SelAttributes.Color := frmMainForm.SSLMessageForeground; + frmMainForm.redtLog.SelAttributes.BackColor := + frmMainForm.SSLMessageBackground; + inherited; +end; + +class procedure TSSLCipherEvent.NotifyString(const AStr: String); +var + L: TSSLCipherEvent; +begin + L := TSSLCipherEvent.Create; + L.FStr := AStr; + L.Notify; +end; + +{ TStatusBarEvent } + +procedure TStatusBarEvent.DoNotify; +begin + frmMainForm.sbrMainForm.Panels[0].Text := FStr; +end; + +class procedure TStatusBarEvent.NotifyString(const AStr: String); +var + L: TStatusBarEvent; +begin + L := TStatusBarEvent.Create; + L.FStr := AStr; + L.Notify; +end; + +{ TPopulateRemoteListNotify } + +procedure TPopulateRemoteListNotify.DoNotify; +begin + frmMainForm.PopulateRemoteFiles(FCurrentDir); +end; + +class procedure TPopulateRemoteListNotify.PopulateRemoteList + (const ACurrentDir: String); +var + L: TPopulateRemoteListNotify; +begin + L := TPopulateRemoteListNotify.Create; + L.FCurrentDir := ACurrentDir; + L.Notify; +end; + +{ TLogDirListingEvent } + +procedure TLogDirListingEvent.DoNotify; +var + i: Integer; +begin + if frmMainForm.LogDirOutput then + begin + frmMainForm.redtLog.Lines.BeginUpdate; + try + for i := 0 to FDirListing.Count - 1 do + begin + frmMainForm.redtLog.SelAttributes.Color := + frmMainForm.DirOutputForeground; + frmMainForm.redtLog.SelAttributes.BackColor := + frmMainForm.DirOutputBackground; + frmMainForm.redtLog.Lines.Add(FDirListing[i]); + end; + finally + frmMainForm.redtLog.Lines.EndUpdate; + end; + ScrollToEnd(frmMainForm.redtLog); + end; +end; + +class procedure TLogDirListingEvent.LogDirListing(AStrings: TStrings); +var + L: TLogDirListingEvent; +begin + L := TLogDirListingEvent.Create; + L.FDirListing := AStrings; + L.Notify; +end; + +{ TThreadFinishedNotify } + +procedure TThreadFinishedNotify.DoNotify; +begin + frmMainForm.ThreadRunning := False; +end; + +class procedure TThreadFinishedNotify.EndThread; +var + L: TThreadFinishedNotify; +begin + L := TThreadFinishedNotify.Create; + L.Notify; +end; + +{ TThreadStartNotify } + +procedure TThreadStartNotify.DoNotify; +begin + frmMainForm.ThreadRunning := True; +end; + +class procedure TThreadStartNotify.StartThread; +var + L: TThreadStartNotify; +begin + L := TThreadStartNotify.Create; + L.Notify; +end; + +{ TPopulateLocalListNotify } + +procedure TPopulateLocalListNotify.DoNotify; +begin + frmMainForm.PopulateLocalFiles; +end; + +class procedure TPopulateLocalListNotify.PopulateLocalList; +var + LNotify: TPopulateLocalListNotify; +begin + LNotify := TPopulateLocalListNotify.Create; + LNotify.Notify; +end; + +{ TOnWorkNotify } + +procedure TOnWorkNotify.DoNotify; +begin + frmMainForm.UpdateProgressIndicator(FFileName, FWorkMode, FWorkCount, + FWorkCountMax); +end; + +class procedure TOnWorkNotify.WorkNotify(const AFileName: String; + const AWorkMode: TWorkMode; AWorkCount, AWorkCountMax: Int64); +var + LW: TOnWorkNotify; + +begin + LW := TOnWorkNotify.Create; + LW.FFileName := AFileName; + LW.FWorkMode := AWorkMode; + LW.FWorkCount := AWorkCount; + LW.FWorkCountMax := AWorkCountMax; + LW.Notify; +end; + +{ TOnWorkNotifyBegin } + +procedure TOnWorkNotifyBegin.DoNotify; +begin + frmMainForm.SetupPRogressIndicator(FFileName, FWorkMode, FWorkCount, + FWorkCountMax); +end; + +class procedure TOnWorkNotifyBegin.WorkNotify(const AFileName: String; + const AWorkMode: TWorkMode; AWorkCount, AWorkCountMax: Int64); +var + LW: TOnWorkNotifyBegin; +begin + LW := TOnWorkNotifyBegin.Create; + LW.FFileName := AFileName; + LW.FWorkMode := AWorkMode; + LW.FWorkCount := AWorkCount; + LW.FWorkCountMax := AWorkCountMax; + LW.Notify; +end; + +{ TOnWorkNotifyEnd } + +procedure TOnWorkNotifyEnd.DoNotify; +begin + frmMainForm.CloseProgressIndicator; +end; + +class procedure TOnWorkNotifyEnd.WorkNotify(const AWorkMode: TWorkMode; + AWorkCount, AWorkCountMax: Int64); +var + LW: TOnWorkNotifyEnd; +begin + LW := TOnWorkNotifyEnd.Create; + LW.FWorkMode := AWorkMode; + LW.FWorkCount := AWorkCount; + LW.FWorkCountMax := AWorkCountMax; + LW.Notify; +end; + +initialization + +GetOpenSSLLoader.OpenSSLPath := ExtractFilePath(ParamStr(0)); + +end. diff --git a/demos/IndyFTPClient/settingsdlg.dfm b/demos/IndyFTPClient/settingsdlg.dfm new file mode 100644 index 0000000..222fa5a --- /dev/null +++ b/demos/IndyFTPClient/settingsdlg.dfm @@ -0,0 +1,672 @@ +object frmSettings: TfrmSettings + Left = 195 + Top = 108 + BorderStyle = bsDialog + Caption = 'Settings' + ClientHeight = 382 + ClientWidth = 508 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clBtnText + Font.Height = -12 + Font.Name = 'Segoe UI' + Font.Style = [] + Position = poScreenCenter + OnCreate = FormCreate + OnShow = FormShow + TextHeight = 15 + object Panel1: TPanel + Left = 0 + Top = 0 + Width = 508 + Height = 348 + Align = alClient + BevelOuter = bvNone + BorderWidth = 5 + ParentColor = True + TabOrder = 0 + object PageControl1: TPageControl + Left = 5 + Top = 5 + Width = 498 + Height = 338 + ActivePage = tbshtFont + Align = alClient + Images = VirtualImageList1 + TabOrder = 0 + object tbshtFont: TTabSheet + Caption = 'F&ont' + ImageIndex = 1 + ImageName = 'libre-gui-font' + DesignSize = ( + 490 + 308) + object redtLog: TRichEdit + Left = 13 + Top = 55 + Width = 458 + Height = 94 + Anchors = [akLeft, akTop, akRight, akBottom] + Font.Charset = ANSI_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = 'Consolas' + Font.Style = [] + ParentFont = False + ReadOnly = True + ScrollBars = ssBoth + TabOrder = 0 + WantReturns = False + WordWrap = False + end + object btnFontSelect: TButton + Left = 178 + Top = 13 + Width = 75 + Height = 25 + Caption = 'Fon&t...' + TabOrder = 1 + OnClick = btnFontSelectClick + end + object redtTextSamples: TRichEdit + Left = 13 + Top = 155 + Width = 156 + Height = 150 + Anchors = [akLeft, akBottom] + Font.Charset = ANSI_CHARSET + Font.Color = clBtnText + Font.Height = -12 + Font.Name = 'Segoe UI' + Font.Style = [] + ParentFont = False + ReadOnly = True + ScrollBars = ssBoth + TabOrder = 2 + WantReturns = False + WordWrap = False + end + object ScrollBox1: TScrollBox + Left = 175 + Top = 155 + Width = 296 + Height = 150 + HorzScrollBar.Position = 46 + Anchors = [akLeft, akRight, akBottom] + TabOrder = 3 + object lblErrors: TLabel + Left = -30 + Top = 39 + Width = 28 + Height = 15 + Caption = 'Error:' + end + object lblTLSMessages: TLabel + Left = -30 + Top = 67 + Width = 70 + Height = 15 + Caption = 'TLS Message:' + end + object lblDirOutput: TLabel + Left = -30 + Top = 95 + Width = 59 + Height = 15 + Caption = 'Dir Output:' + end + object lblForeground: TLabel + Left = 46 + Top = 16 + Width = 65 + Height = 15 + Caption = 'Foreground:' + end + object lblBackground: TLabel + Left = 162 + Top = 16 + Width = 64 + Height = 15 + Caption = 'Background' + end + object lblDebugOutput: TLabel + Left = -30 + Top = 123 + Width = 38 + Height = 15 + Caption = 'Debug:' + end + object cboErrorForeground: TColorBox + Left = 46 + Top = 36 + Width = 113 + Height = 22 + TabOrder = 0 + OnChange = cboErrorForegroundChange + end + object cboErrorBackground: TColorBox + Left = 162 + Top = 36 + Width = 113 + Height = 22 + TabOrder = 1 + OnChange = cboErrorBackgroundChange + end + object cboTLSMessageForeground: TColorBox + Left = 43 + Top = 64 + Width = 113 + Height = 22 + TabOrder = 2 + OnChange = cboTLSMessageForegroundChange + end + object cboTLSMessageBackground: TColorBox + Left = 162 + Top = 64 + Width = 113 + Height = 22 + TabOrder = 3 + OnChange = cboTLSMessageBackgroundChange + end + object cboDirOutputForeground: TColorBox + Left = 43 + Top = 92 + Width = 113 + Height = 22 + TabOrder = 4 + OnChange = cboDirOutputForegroundChange + end + object cboDirOutputBackground: TColorBox + Left = 162 + Top = 92 + Width = 113 + Height = 22 + TabOrder = 5 + OnChange = cboDirOutputBackgroundChange + end + object cboDebugForeground: TColorBox + Left = 42 + Top = 120 + Width = 113 + Height = 22 + TabOrder = 6 + OnSelect = cboDebugForegroundSelect + end + object cboDebugBackground: TColorBox + Left = 162 + Top = 120 + Width = 113 + Height = 22 + TabOrder = 7 + OnSelect = cboDebugBackgroundSelect + end + end + end + object tbshtFTPSettings: TTabSheet + Caption = '&FTP Settings' + ImageName = 'libre-gui-idea' + DesignSize = ( + 490 + 308) + object lblTransferType: TLabel + Left = 15 + Top = 16 + Width = 71 + Height = 15 + Caption = '&Transfer Type:' + FocusControl = cboTransferTypes + end + object lblAdvancedOptions: TLabel + Left = 30 + Top = 51 + Width = 56 + Height = 15 + Caption = '&Advanced:' + end + object cboTransferTypes: TComboBox + Left = 92 + Top = 13 + Width = 382 + Height = 23 + Style = csDropDownList + Anchors = [akLeft, akTop, akRight] + TabOrder = 0 + Items.Strings = ( + 'Use PASV Transfers' + 'Use PORT Transfers') + end + object chklbAdvancedOptions: TCheckListBox + Left = 92 + Top = 51 + Width = 382 + Height = 97 + Anchors = [akLeft, akTop, akRight] + ItemHeight = 17 + Items.Strings = ( + 'Send HOST command' + 'Send EPSV/EPRT command instead of PASV/PORT' + 'Try NAT Fast Tracking' + 'Send MLSD instead of DIR command') + TabOrder = 1 + OnClickCheck = chklbAdvancedOptionsClickCheck + end + end + object tbshtFrewallProxy: TTabSheet + Caption = 'F&irewall/Proxy' + ImageIndex = 2 + ImageName = 'libre-gui-firewall' + object btnNATSettings: TButton + Left = 103 + Top = 13 + Width = 210 + Height = 25 + Caption = '&NAT Settings...' + TabOrder = 0 + OnClick = btnNATSettingsClick + end + object btnTransparentProxy: TButton + Left = 104 + Top = 48 + Width = 210 + Height = 25 + Caption = '&HTTP Connect or SOCKS Proxy...' + TabOrder = 1 + OnClick = btnTransparentProxyClick + end + object btnFTPProxySettings: TButton + Left = 103 + Top = 83 + Width = 210 + Height = 25 + Caption = 'F&TP Proxy...' + TabOrder = 2 + OnClick = btnFTPProxySettingsClick + end + end + object tbshtDebugSetting: TTabSheet + Caption = '&Debug Settings' + ImageIndex = 3 + ImageName = 'libre-gui-bug' + object chkLogDebug: TCheckBox + Left = 97 + Top = 13 + Width = 316 + Height = 28 + Caption = 'Log Debug Output (This will be Extremely Verbose)' + TabOrder = 0 + end + object chkDirOutput: TCheckBox + Left = 97 + Top = 47 + Width = 280 + Height = 17 + Caption = 'Log Directory Output' + TabOrder = 1 + end + end + end + end + object Panel2: TPanel + Left = 0 + Top = 348 + Width = 508 + Height = 34 + Align = alBottom + BevelOuter = bvNone + Font.Charset = DEFAULT_CHARSET + Font.Color = clBtnText + Font.Height = -12 + Font.Name = 'Segoe UI' + Font.Style = [] + ParentColor = True + ParentFont = False + TabOrder = 1 + DesignSize = ( + 508 + 34) + object OKBtn: TButton + Left = 347 + Top = 2 + Width = 75 + Height = 25 + Anchors = [akTop, akRight] + Caption = 'OK' + Default = True + ModalResult = 1 + TabOrder = 0 + end + object CancelBtn: TButton + Left = 428 + Top = 2 + Width = 75 + Height = 25 + Anchors = [akTop, akRight] + Cancel = True + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 1 + end + end + object ImageCollection1: TImageCollection + Images = < + item + Name = 'libre-gui-idea' + SourceImages = < + item + Image.Data = { + 89504E470D0A1A0A0000000D494844520000004900000049080600000071730B + DC000000017352474200AECE1CE90000000467414D410000B18F0BFC61050000 + 099149444154785EED9C5D6C1C5715C7CFBDE3CF5D3BB11D9C38A86EDC3A6E0A + A8515A48D352040EAA4A438B7000A90912E036AD4878A1F4A5AA8414221EA015 + 2295408DA536A92950125E62D48AA44894F4A1E08A42230517306D70A334719A + 90C4B177BDFE98B99C73F76CB2DE7A67CE8C6777FDE09F64EFBD779DDDB9FF39 + F77CDC998932C6C012FE687E5DC2872591042C8924604924014B2209A85C749B + 78AE1BB4EEC66FDF84BD3A00D3A640DD9C7D330B1EDB082835426D05F01A8E1C + 87847314A03763FFA04C9451A4FE3A33E1F680565FC0C9F6A0204DFC4628F078 + 3328DC001EF82B30E30C4053EF657EAB64945EA4CBFD4DA6C67D1C0C3CAA9442 + 8B89173CFC3E057A0F247B477928764A2812598EB713B4D91DD56AA49075E109 + 7812A6F5D3A5B0ACD28894DEDF831FBB170FBC8347CA820143023DA1123BFAB2 + 23F110BF48E9033FC0DFBBB39DCA80333AA812FAC1B81C7C7C2291EFA9F69E57 + 0A7A78A4A2E0AC8E2BADB7425DAF8D8E0B211E9132FD1DC6F30E6398DEC0238B + 025C7EE8CCBDAD2AF1C8200F4562E122A5FADB0CB87F29B7FF9182F3CB28F0EE + 84E423C77928340B14092358CAFB132EB13B7820322673116026CD3DA63A01AA + AE853BD1C1398E287050A86869C2824432A903FB50A09DDC0DC74C0ABC0B6F83 + 197B0F3F8756C52CBF5180AE02956C03D5B01A544B17A8C44A7E231C38CD4195 + D49BA338F3C8229989038F2A0D7BB92BC6A43F0073E60DF02EBDCB23E150CBD7 + 805E759B7D0D0B4EB54F251FDAC55D31D1444A3DBB0194F316F764B853E09D19 + 046F34DC3F2B866ABC0E9CCE2DB824933C22C56C85C48E01EE8888B40B60C009 + 950791BF71877E1D9B4084193F0DB3275EB0CB350C06141E7B7FA8F228BC4868 + 456172219A84FBF621305357782446D03ADDE1C3E09DFD2B0F0443698A2D9742 + 105A24B4A27DDC0C84CEB6FBCE4B7632A5C43BFDBA0D0262B4793C8C35851309 + 6B3269B827CB71FF8302158B5A31E3BDF7AA78E961C1DD16C69A428984EBF9DB + DC0CC47BE7E5925BD01CF064B8FFFD83FC3B95F92EB7020921129AA731DDDCF1 + 851C3485FAB243B917465009542198F4B3A2552116897615459B6614EA47DFE4 + 4EF9F13E38213E419885DFCB4D5FE49664B75D83F1CEA303C5335A3170D999D1 + BF71C71F2C801FE0A62F429128121851D837E74F70AB72D86C5E1030EC85874C + 7F60612E13691C3A245BB014F26DA12A848A5767ED97ECCFBC85AC530B7ACDE7 + C1B9F96BA03FF2711E14800289CB1ED70DF4B33291D46C1BB77C311367B9158C + 5EBD119C4F7C1D5473A7FDA1368DE5A0DAACEA966F825EB9DE9620FA867BC0B9 + 69ABBC0C193BC98D2054E0DC842209F78A262F70A338D67A3EB60DF47577E1B7 + 57F128826D1AA3F79CCE2FCE2B484E3849716B52E7B9E58FD16615378B22F449 + C16A1366F212B7E6C70A44D6D370EDE32801CCCF96E93DD57213F7C83A47B361 + 3DE76370099280F956371F461A3C4C4C962451DBE2FA6FD5580BC8B31ECA926D + ED854920BD16464512C7FDE741F0DEC7D7A117E7D47FB4047DA1A4529658C6B4 + DC4C3CD7CDBC8BC3730E3C7FA2645154D5DB3A2C4F9CABD43682AA5DC61DFCAC + 0B43DC2A8E991588644C4CD12D2ED052F2EB395A567AD5ADB66DA144142B7A12 + 8796590EBB4CD14FE5F0CE61464F8207A0B4C32D3F54E096AE482405106ED3C6 + 074A13C85A72E8EB3FE7BF74280DE8BADFBE12D6879D7ACDB67DA1652D8B84F1 + 8894BD3423A03AC10D7FC812F29DB5D3857952DE52CA872C289743D99D85777F + 6FDB41A89AF93F6F1E62B32491486A99FCAA92DDDAC82D29B2164C28E7A40408 + A50457C33D2588C30352676C7D9804A5E01C378B22B4244F2652F38DDC128093 + B61B721CD154A2359B3B313681CC0BF3EEC923E1B2F9A0E89783EE810A406649 + D3D5FFE2A62F74B9A7D8B2991772E424144342E550CBAE4D92A29D097975455C + C6C42512DDCE62008E71CF17B53CDC85DCFC28560C73E534B764582B12386D7B + 174AC3C381F392894478F03B6EF9A23FBA097FCDF52DE546898B6125BAB42416 + 495569D9B52A3C83BAED53DC293F54D648979A02233BF1FC1A4C5DEF082E39D1 + 4D077A358A24ADD6E3042D98B6562418BAF7D2DEA41A8C5C24C2835F70CB1F3A + D8F6CF72A77C50F62EBE5740D15293DD17104A24D5A0FBA489A55EB1CEEE0195 + 0BCAA7AC3F14A28CFB243703096749A4BCA7E41F8EBEA11C429140B4BB290D18 + 4699A7C3DCAF145224B626416E91C30A25F41351082D10DDD4E539E2134D8416 + 89AC0953F9EF7147046DC186DAA3164289ABDD1D08937268E80B7B3357049190 + C48E018C74A2C89083AC29EA0D58F342C1E1461488770724D00A5053CE1EEE8A + 892612A2A6F5F630CBCE4E6AEDFDDC5938E4A4F3B78183A0EC1A97D9962837C3 + 471689BE8CBED4A6F6426879880B4F3F68D7207FB34E8231DBA1B15754831612 + 5D2482BE94BE3C0457B73E16806EC2FA308C1F32F0844A3E1CCA3DE4B3F05B94 + 1193DEBF538112DDB774F6E4157865E83EEE45E3AE3547A06B7D03F7FC897A9F + 643E0BB324C63ECBE1799B454BAF7E0537C23376651A2E8D4DC1687A358F1487 + 423D1ECFAE850A44C4624957B14F06B847EC35F6228CFEAF098EFEF916EE7D18 + 126176C6C0787A0666663C48A5662135390BD3D32EFF0540CFDD19F8EA3DEF73 + EFC3644F96B765A14F02E488572422E019939133CD70F8D52EC8645C989C7221 + 9D26013C181B9F4663941D8B9F48389D41E5E8ED713C5392237E91724C3CD76D + B4DE5BF8BCC9EB6FB542DF6F42EC5E22F5750ED4D5564163433538550ABE72F7 + 286C5837371FC4798C5807DDB0E3200FC546E94462CCC4FE6DA0E047B9674F8A + 89542844F3F21AA872B4ED17F2990DC3B0B63DBB7F8F4B6B94EA492A97E27A74 + AB90928B94A5BF0E52EE3603EACB6F0EB5DC37F0C7F6EA2021FC20913ADBCF1D + 43890EA969E760A99FC32D9348D7F8EDCB43B7A753356F70D717F251E4AB0A1D + F9CA15CEDEEF3FB6F131FEB39253769188E70F0D4F6204B4F75F661D3846309C + FCF4AC0713A9192B8A9F236F6DAEF9D64F7F78E70BDC2D39151169F7537F1F3C + 7F31B3697C628647E42413D599BEA73E5DCFDDB2104B3219969549780097CEB5 + C4671EC84F352FAF858EF646E8EC6884DBD6AF80DB6F6D853B3ED9BA99FFA46C + 54C492889F3CF38F8DA7CE4C1CD54AB52C5B560D35551A92C92AA8C708578791 + AE103CCC5165BC077BB7AF8B5C8345A56222E5E83FF4EF9E53A7D3FB1A1B6BE6 + DDF7B83C3E337B7D5BFD434EB2F6A5DE9E8E9246B162545C24E21BDF3946FF3D + C761EECE01F3A03DBFFA79373D465F312AE2930AF9E533DD0318C976E1E92A4C + 067F5C698188456149397A771EEB703596311AEA5C05C75FFC5977A44DB2B859 + 54222D5616C5725BEC2C89246049A44000FE0FE407E075DCC757DB0000000049 + 454E44AE426082} + end> + end + item + Name = 'libre-gui-font' + SourceImages = < + item + Image.Data = { + 89504E470D0A1A0A0000000D494844520000004900000049080600000071730B + DC000000017352474200AECE1CE90000000467414D410000B18F0BFC61050000 + 046649444154785EED9C315714411084392343CD30830C33CC3012328D34D34C + 437F8299FE1B0D31C3484232C9C00832CD30930CABB839DFBAEEED76F576CF1D + 7ADF7BFD6640D89BADEB9AE9995B9C5C5D5DADADE8E7566957F4B012C9C04A24 + 032B910C2C64E29E4C26B7D1EC4CBF9239C6987F947E1D2852ED008FF9D2CE78 + D375CDCC5894DD9E97D6C3D3D256A3BADD8AD5BE21EE5C7FC3C726C67D5EFAE9 + 2C22937611630422AF4A5B85458834C66A3322AE61A6AADD82AC36E33EC67E5A + FAA9D4CEA467880881C88BD2A6535BA4C895A99AE5AAD9AD58ED02C1368A0718 + FF71E9A751339368B5488148956CAA2952461158655EAA6237588D933557354B + 267D47F0E7AD59F710F77054FA29D4CA24C56A0708E5A6D3B729B54452E68E8F + 25ACA45B2EDD6EA2D52E117711EB88337EC3C81EEEE3B0F4C3A991498AD50E71 + B397086E5E956A3A7595AB21926AB519FBA5B5C037220FDA2D2B006DC38E35D6 + 1BBFCBD382F6BFF7C56EF3B523233B939477F80803E2F27F0DFA9C639463DA34 + CB658BA40CFC53699B48962B5B9F70D244C28069355AC64A97205DC2CD437D3D + 339999A458ED1CF6EADAA8B2B064596025C5729922BD2CAD058AF117108E7392 + 527DA7582E45240C74038DF2B95A5F85AD54DF2C5CC32D979549CA568176EAAB + 9695C99B845B2E4B2465D3B90F5BCD9D77F06F6AF51D6EB970911C56B3AC604A + 36D172A115784626A9BB728B004A2940428F4FC24F0190495FD06C4FBF1A841B + DABDD2EF05D7E5F938B3C4C2F569429F8D1542330937B285C62A10513244B11C + E7A430CB45DB2DC36A331666B950BB21934ED0309B2CB0CADE2CFD41706DE5F0 + 8ED06AF7F01AA39F650ACBA46235AB4044AA7FCACD2AD57798E5C2320922BD43 + F376FA95890F88AFD3AE994708A5A23EC0FD3D297D379122F14C9A35D2321162 + B910BB4120168FCB261009B15CD49C94FED9D70846EFE542ECB6A4566B42CBFD + 3E1A56199D494B6CB526A32C1761B7B403F840468D71B4DD90492CF078BEBCEC + B82D372A9320106B969B2010715B6EACDD6E82D5662867EE7F30CA6E0EAB715B + 11727C01F8BACA3688F81E92A7489E00B41A3BD6B8E8BA8E370057D4F66B0C85 + EBEF52C6D84D4D5F69433B0406AF9E7D1357D1EB120936F394FBEA79900555F8 + 1D8C5DAEE9BC9944AB598F5209E7A1CE0F2047E2115E7E32CE2B92BAAAF18991 + D1875F6D704DF5C91322AFC8B2484EAB299FC2AAA896DBC63D48ABA2279354AB + 91D049BB45BAE53C22A9ABDA695989B2509F3C2192E524919C56CBCC22CE4BEA + D937D9522CA7661205A2500A194B7F1BCF9C67B71CDE097380F7FC152142ABEC + 79013CD5F759D7B5BAC29C49CB68B519B8114FF5BD817B323DD8A1D86D59AD36 + C3F38698B6298A48EAAA965565CF23AF1468FBAF2B00EBA29FFC71213E775D2B + 33009F3C698F632876BAAED50C6B2679AC965965CFC363B9C19AC92A92E704B2 + CAA4DD22C7725DE9D50CE0B1DA49D7B5B20378C6CAE8FDBB94C1E3DB5299AAC7 + 0BFCEF7B1691491CEF6B34EA87137CE26EEE13C0219FE0FEEB2825C07FCB4A24 + 032B9106595BFB05384EF8DF1E0A48BD0000000049454E44AE426082} + end> + end + item + Name = 'libre-gui-firewall' + SourceImages = < + item + Image.Data = { + 89504E470D0A1A0A0000000D494844520000004900000049080600000071730B + DC000000017352474200AECE1CE90000000467414D410000B18F0BFC61050000 + 058D49444154785EED9A2F741547148777AA2253876B7048AA1A5CEA88A251B4 + AA44B59128401114441147AA82832AA8A32A71090A1CA9228E38708DEAF6BB33 + F7BDECEECCEC9BB7EFE51CE6ED7EE76C76EEECBF37BFDCB9337B774C5996C540 + 3BDFE87EA08541A40406911218444A6010298141A40406911218444AA07F2219 + B3541AB3AA5612FD1249042A8A67A6284EB526895E8984408FD9BD2DCAF2CCD5 + A4D19F773763AED3D2031AFCADD624D31B918843AFD87DA1C19BAE269D7E7437 + 639689433F517AEB2AA6A31722D157EC688650E7B6624A7A2112E25CD1E2683F + 157D1BDD7ED0E254F4A5BBD921DFC62563566CE514F4A5BBBDD7A208F6508BC9 + F4690AF011B1AC17D1E2751AFEC61E48A037310981FED0A2B04FB74B0EE27D0A + DCCFF1203B0590D18EF2335B9B407F4472EF6B2F9DE182385DF077355BE94D4C + B2F0FEC6DF77CEB0B1E91CB1BE47C013AD0AB2F09E647347C62C39A37C8F3087 + B60C0824A9937D35A3043D69DBCD25EE38AB95D7DB3C58CB63B85EFE63F2AE74 + A9F0EC6D2DC63146DA718A40561C44FB19715E4879040ADC45885D353D6222AD + 71A30335A370E5263FF4B99A63B8FE0ED74FFC0FCDCAC3B2E431ED208A04E87F + C622B8C4DB67F1226B03F619F655840CBEDB2D767773DDEC26022CBB0A70428C + 03B8C07119EDA2417CD163D27D0490D0D14CD7FEA9FB2AB775EFB1B02249C0C6 + 3BEEB189E7D466D70877A8F563A893001F7CAF5B48912438B33BA0E14B6C3B74 + B17A4EDB75B9F1285741AEF3583C918CD94698172210DE728820C11190E35E96 + 92F36F69B1C6E288C4BB181E7444C9BEE5D3E05384D89072088E872690D7745F + 235B9168E4032D8A40F225E403A2D8342D659949AFE3455FECF1001CF73E2B51 + B72C62AB39265791F6989F3DB1A5D1A7A2CA304F790B815A5F3562702F2F78E7 + 38E396A0BBCB73CF11E81ABFFEA82A10F6318DBAA1661C26CCFC0D4D987F44E0 + 7A50179172DDFE432044A174B151B71A3AD7DB8A62AD79AD6E6BCD73F30DDCC6 + C844B1B6F081069EE045C76ACE8D3C4572EF5FF7D4AA922C10D74B4848224B91 + A44B54E35047827322F0027E2C705FE147D4D20997014FFE8500EC0DC59A45F8 + 554D0BE7FEC5B9F64D9EF9D03EC7BD818573DED0A07535E3B861FE93332EE07A + 592BE02DA88889B4C28FF8A8E6A5C193AFD2706FAD10CF975973EDD30FE73EE0 + 5C3BEC23D2BF1C1FA73A1A6C106D5F6B3908D7CB944146B71A3C233832E6D4DD + C662B608240D7D8AA744E30D02C9222E4F2081FABFB558233F91267C81A5A12B + 087524A31FDB45DC324612FFEF38DE96FCAFE59946E4E8491303B67A9AAC6AFB + 8C38A5DD8AE215F5710F939131324BCF4924DBC5684CB4ABCD48281167C94924 + DBCDF0062FD0CF0AC24B8E7B4F4D8FEC44A24B9CD1A85A56710E48622E7ACF9C + 44AAA630E6E64D087ED2E645423622D190EFB428CC4524F5C8CD362F12629349 + 098E53AD9AEFC8B14D793490C92CBBE6507FC6B976F461287F8C68F76DED6C3C + 42A0891F3883227DED20D22A2249AAB633B4FA987B48EE68627CCB522401A13E + D1C84E0B45A59B71EDC4851223720ADC4D5ADFCFDA40A0A9D2BBB198749D1B3D + 55330A57EE1027BC65755C2F9F9643F99E5939E7991B368EC5D3AFAD70FD168D + 6E1DCD9AC444FA6A174CA848D68B3A74B9A440DD24BBEE8628D53C53F0853404 + E2EE761148C83126DDC453ADF720D80E8D9F383A71CE1E5DE6AE9A5393A34832 + 8773E90E97D56C5D6A8C40B2406B4BCD4E6439BAE141BFE14D361B40F991AD6C + A01EB68140D1156CA9E43A0590EE36F2265907599B0E60CB3A801B1CEB3C4DA8 + 92AB48D69BB458F326110C5B268ADE97E5AE642B125CAC0071DE2453914DBA97 + 7C08882E94E842CE22D5401C799BF7E66CF3807BF33F684050943C72CA17CE13 + 2676A1EF661233826B7DE609CF0EAD569B3B419106EA2C4C77BB4C0691121844 + 4A6010298141A4040691265214FF030C769EA3AE3398370000000049454E44AE + 426082} + end> + end + item + Name = 'libre-gui-bug' + SourceImages = < + item + Image.Data = { + 89504E470D0A1A0A0000000D494844520000004900000049080600000071730B + DC000000017352474200AECE1CE90000000467414D410000B18F0BFC61050000 + 0A8A49444154785EED9B7F6C93C719C7EF5EFB75280B25143142A576A0AE6A50 + B53548FB03A4490D5201A71416446913D3AA8E9A00D9FE184CD55AFEA2F9672D + FF0CD054419554645209B494D690B298508974AB4ABA6AE0AE6B93741B4DC318 + 16BF4A134AC86BFB6ECFF3BEE7D7AFED37C6B1EF8C32E52339EFDDD97EFDBEDF + F79EE7EE79EE4239E7649ADC68E2384D0EA645CA836991F2605AA43C9816290F + 0A1EDDD61E3F120489F7C3D787282543708C70CA3EF152BD2FE4AF1B121FBB23 + AC3E7EB8D2437835A1DA5242E9A384F04AB8D52AC279EBB1C79F7C597C2C6F8A + 16495433897242C3705147BB1E5F1F126D4A59DBFDEE52B897A7A158070F6DA1 + D59A41A9457AA2FB70BD46B483A23A219CF0EB60D521C6127B8EAFDE1011CD52 + A80B8716329E78118BF082DE921BCEC8F6AED5EB5F15D5BC297A32695E68C2A8 + B2BB3627702433C4DB19F05082F1D662C5C2DF4C70B683121E144D59C07DF5C1 + EDF5A10BA0712DD2B566FD80786BD2289971834FA8D6A8F61C1427E8FAA6582D + 20565434E4454D6FC78C593767BD02E7DC2A9A9CE0B942703B27649BB812919C + A0AF208481495034091B34434EC9BAF7FD4FF68AA69C08D37A0F8AD5568B4D2F + 61899DC7563F151675E9281729C99AAE2355C44B5FCC34917CFCC4DAE36FFBB9 + A61DA484568826A49751DE9AAFC8C55032919208537C2FC30CF71DAB5DDF22CA + 69640D109CDC629435BE5FBBE19068514EC94542EA42A18A4459027A06F18B26 + B0C8446DA6C9E07C47D3687FAA07F101F0650DB247C9DB7147444AB2A6FBDDFD + 0EF38B26185BE274E66BBB8F9C82438D5523116DDCB33C545707538AD27247C3 + 92D1BB465AE0192567E7951EAAED1265B2E64FEF6C81832510981808D8782704 + 42EE684F429E08BF53A3718A3D4640978DDC35129935567ED136B30267CAB250 + DE93563CD3BCB426189C607249088E4E10C274882A0E77FEF25BE54B9D7E6864 + E68D9CA3DF630D4D29DFA6006522A1302B3736BF423939ED8BE93B44B32B302B + FE231E2F5CB8403EFB7BE4977F3D7D7ACFF9E161F0E50C4DEDADDE9AE02DF383 + 2EC06F04C1B977C3B1BBE6A9E06D43934250261208530F8797AC1A79097B9428 + 67F1E9E099FE8F4F7F44CE9CF9940C0F7F33EFF2E54B3F8D7C76867CF8975364 + F8EB7F5F101FCBC2148593A41FF3FB742FC671D2512652CF813634A1D4448FF3 + FD1399DDA5C1E1DD57AF5C11B514374647C9E75F7EF91B3AC1F77CBABE1FE244 + D32CC1B30E197A7CBBF9866494FA242DE16984AB374724F031556E66473707AA + E02FF63A57186755646622CBE7A099C1C16EE79437F676744C6896C5A054A4F0 + A17D43A0CE3651C5C7BD157A9333B4007D3C139AA18347C5D10662BF946971BE + EF8337DB9585274A45B2E08F88023C6D1285A79D3ED7D1B87B822C8DB498CD04 + 7A662A8340691EE7281CA5228149548332382934D1384BF5AAE2719ECBBF2AF0 + 7C5A964126AA7BD22E47022E7CA2F30D69791E1818226866A20ACF42DB9B6B3E + 560CCA44124FD60E2BE0AFF491C788C75BE19034BBCADBCDC70A454958824F14 + 2EF86B288AC91DDFDD73A03DCBD4167674CCB87EFE8B7D9AE6794EF378498C12 + 32EEF5A08F21BA112765E273C6D858F89E453F69180A06B362B7151B9BB7C0D7 + F69A15781894684B4E74BE5E70AAD60D2522E14C1B0EC98964D4D0638B92C3F3 + 43075FF78308BFE08CFA3353BB23DFDF20D16B57CDF2DCD91564EEDDB3CD7212 + B8D4287CA717AEF9E857814D763E6945A0E92CA53499B10C8329D68AB214A48B + 8443BCCFD02F267D11E7B423E6335A866A6A66949519DDF093130EF9B713C909 + 5CF5005CFCBAC1C0A6819581A6974178DBD418E3B51F1C6C9796CE95EE93BC71 + 6FB5C359C3B5F3208A36FFDCB9C3B9049A2C60625533FF7BB50D7A2D3C909440 + 08C472526338E92259933ABE5B542D2074F08E8D3F266AD2D0BF1FFF391CD204 + 811E7608CC5B6A6A57C9E8864EDA88C51680296F878B36936ADEF1B8F99E4C3C + 31FB9C38C2BD0A61D0A29307DA1A6487274A1C772698EF199F77F7D64BCB16AF + 124DAE4CC6272115FDE73F9FFDAF0BBFEBE97C43E9A2404944421E3EFC5A653C + EEBB28AAAE4C562418D1960FD437295F52523DE3B6F962C3AF52B196245802F7 + 19A8A7642221D069A56EC9D17D8674E1DD28A948301D907A532A7AA71B2511C9 + 5FBF6521C672FA776359298F42D18CF8772B03CFD7AF0A6CAE124DCA50E6B831 + A74D39D9011317DC8A638A73EDE11F91D145F3CDF7DD988CE39E716D94CCFFB8 + DFAA60004D491FE56C8FCC4C4312753D8973DC0507719A2510E21D3744A9783C + B762A2045833FC1A4EB4832AD2254A4442F3C29CB6A8E293C6510803D3B7AC86 + E2619C7F08078CCF527E09C482B0485AE893448948CC9348AEDF639810EAE96C + 9B0391F9F2EB55F7495B85BD79EF3DFB30DA87D702F8153B0CD298BD77401A4A + 4482C83F95B867049FB80946ECA2583C9CDAE702C76AFF060CA1598B06C5A2C6 + 27516E3F4DAA39D6DE00E85952843262BA7D9E715FC2B1BE47722EAB17827491 + 2C7F249269E08BCC5C743A458B0403727428985AFAC61518F077D6EF28F04B52 + 45C22708FEC84AA5029CA6F722818C9E94B5890B3396A2482823BB30F927AA45 + 234D2414C817D371E3A7BDAAAA716B238413F01F9F886211B89D83DABF85A95C + DDF09E9225943491F4986ECD8B9270DEEA36B1A31A2B7A2B1F9873D639845937 + 5A354B289FE1ED16D5A29026125CF84E311F3205EAE96C771DEEEFEFFADB66CD + 39112C807B7BCE3EEBD64B4028DCA46109851B5039C125A7A2911A96E08A2D9C + CF7FB2B33D6BD3156E93F1E93AEEA2ADB9FCB307C9CDCA39D61B0EF2094B7C23 + 37C9823FFF0334E00330616D701918CCCD148CF1A8ACC5809224DDCCE56E42B0 + EB9BF9E8911F2F20DF56DD87C534F211A9FC3F57C8DCC839AB622E7AB246D599 + 49E953005738C711CF4AD8E38DC5F96B66B900C084FE609BB519B399CBDBD246 + 3237948B84A31E78517BDEC235B23CFAE0032F40A9A0ACE2D8FD737EAF31CF12 + 285A311B04D030AA4EDD5D25489951E6BC81E8C937DBFAAC89202DC05FF0C840 + FD962173DF937384C38D5E0A2981B9C59D37604F24C1171E15C5BC01F7E9F80E + 4F9D8B4CE1FD4908E35AEA0678EAC60CC387FF7635A9F4ABA6317B2B3367F41B + 5104B487444109CA45A294DB3700E3A87D63C2E4F21E9540D0309A9AA8C2B952 + 825332D5CDCDB1554F73DC18A2EBE33BE176F35A6DA594ED1145130FF5A4565E + A6F27640047A8FFD9439D5D2969470B58373CDDEAD3611708ED060C3E634479F + B107A952E53440A94838FCDB6913C0D063693D09310C6F2B98528EF5387E5DA3 + 09D7BD964E9353390D502A52E6F0EFB691C1DCBDC6C93A144334A5C349A3D317 + 3981B024D5AE701AA04C24EC459C247E2DAA48562F4AF2D5C6E608F89C25F178 + C2FE4C82B12B2C41960D0636E55822724C03A8F6B42A93532212AEB9E931EF59 + 70A8F6F664A04F1C5DC1DE7279CB0B8B2B7E50B1F087E5B31FF9B6E5B7F3FEF9 + 4C73CEEFC09067E795C0ACEBC0E4FA55FCC792D400177B0F5C28EE3A4BEE974C + 12067FB44EF6BE216465A0696FC6C300EDCC2D88DB30AD2B9A8A427A4FC25489 + 2842C50C441B7B0EB4D5AA1008E9E96C6FC13D9250B427A63037F3939BA92D89 + C52255241482528AFF748382848D786CB148842905F346D05317630F321B38DB + D6FB7687BCCD14686EB25F2B024D987C737D4FF54BC56F9724E936D5513A4FFA + 7F615AA43C9816E9B610F23F3CD251B86388BFA10000000049454E44AE426082} + end> + end> + Left = 305 + Top = 199 + end + object VirtualImageList1: TVirtualImageList + Images = < + item + CollectionIndex = 0 + CollectionName = 'libre-gui-idea' + Name = 'libre-gui-idea' + end + item + CollectionIndex = 1 + CollectionName = 'libre-gui-font' + Name = 'libre-gui-font' + end + item + CollectionIndex = 2 + CollectionName = 'libre-gui-firewall' + Name = 'libre-gui-firewall' + end + item + CollectionIndex = 3 + CollectionName = 'libre-gui-bug' + Name = 'libre-gui-bug' + end> + ImageCollection = ImageCollection1 + Left = 193 + Top = 151 + end + object FontDialog1: TFontDialog + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = 'Segoe UI' + Font.Style = [] + Options = [fdFixedPitchOnly] + Left = 273 + Top = 159 + end +end diff --git a/demos/IndyFTPClient/settingsdlg.pas b/demos/IndyFTPClient/settingsdlg.pas new file mode 100644 index 0000000..9367e4b --- /dev/null +++ b/demos/IndyFTPClient/settingsdlg.pas @@ -0,0 +1,511 @@ +unit settingsdlg; + +interface + +uses Winapi.Windows, System.SysUtils, System.Classes, Vcl.Graphics, Vcl.Forms, + Vcl.Controls, Vcl.StdCtrls, Vcl.Buttons, Vcl.ComCtrls, Vcl.ExtCtrls, + System.ImageList, Vcl.ImgList, Vcl.VirtualImageList, Vcl.BaseImageCollection, + Vcl.ImageCollection, Vcl.Dialogs, Vcl.CheckLst, Vcl.Samples.Spin; + +type + TfrmSettings = class(TForm) + Panel1: TPanel; + Panel2: TPanel; + PageControl1: TPageControl; + tbshtFont: TTabSheet; + tbshtFTPSettings: TTabSheet; + tbshtFrewallProxy: TTabSheet; + OKBtn: TButton; + CancelBtn: TButton; + cboTransferTypes: TComboBox; + lblTransferType: TLabel; + ImageCollection1: TImageCollection; + VirtualImageList1: TVirtualImageList; + FontDialog1: TFontDialog; + redtLog: TRichEdit; + btnFontSelect: TButton; + chklbAdvancedOptions: TCheckListBox; + lblAdvancedOptions: TLabel; + redtTextSamples: TRichEdit; + ScrollBox1: TScrollBox; + lblErrors: TLabel; + lblTLSMessages: TLabel; + lblDirOutput: TLabel; + cboErrorForeground: TColorBox; + cboErrorBackground: TColorBox; + cboTLSMessageForeground: TColorBox; + cboTLSMessageBackground: TColorBox; + cboDirOutputForeground: TColorBox; + cboDirOutputBackground: TColorBox; + lblForeground: TLabel; + lblBackground: TLabel; + cboDebugForeground: TColorBox; + cboDebugBackground: TColorBox; + lblDebugOutput: TLabel; + tbshtDebugSetting: TTabSheet; + chkLogDebug: TCheckBox; + btnNATSettings: TButton; + btnTransparentProxy: TButton; + btnFTPProxySettings: TButton; + chkDirOutput: TCheckBox; + procedure btnFontSelectClick(Sender: TObject); + procedure FormCreate(Sender: TObject); + procedure chklbAdvancedOptionsClickCheck(Sender: TObject); + procedure FormShow(Sender: TObject); + procedure cboErrorForegroundChange(Sender: TObject); + procedure cboErrorBackgroundChange(Sender: TObject); + procedure cboTLSMessageBackgroundChange(Sender: TObject); + procedure cboTLSMessageForegroundChange(Sender: TObject); + procedure cboDirOutputForegroundChange(Sender: TObject); + procedure cboDirOutputBackgroundChange(Sender: TObject); + procedure cboDebugForegroundSelect(Sender: TObject); + procedure cboDebugBackgroundSelect(Sender: TObject); + procedure edtExternalIPAddressChange(Sender: TObject); + procedure spnedtPortMinimumChange(Sender: TObject); + procedure spnedtPortMaxChange(Sender: TObject); + procedure cboProxyTypeChange(Sender: TObject); + procedure edtProxyServerNameChange(Sender: TObject); + procedure btnNATSettingsClick(Sender: TObject); + procedure btnTransparentProxyClick(Sender: TObject); + procedure btnFTPProxySettingsClick(Sender: TObject); + private + function GetConnected: Boolean; + procedure SetConnected(const Value: Boolean); + protected + FErrorForeground: TColor; + FErrorBackground: TColor; + FSSLMessageForeground: TColor; + FSSLMessageBackground: TColor; + FDirOutputForeground: TColor; + FDirOutputBackground: TColor; + FDebugForeground: TColor; + FDebugBackground: TColor; + //proxy/firewall settings for subdialog-boxes + FNATPortMin : Word; + FNATPortMax : Word; + FNATIPAddress : String; + FProxyPort : Word; + FProxyHost : String; + FProxyUsername : String; + FProxyPassword : String; + FProxyType : Integer; + FFTPProxyPort: Word; + FFTPProxyType: Integer; + FFTPProxyPassword: String; + FFTPProxyHost: String; + FFTPProxyUsername: String; + // + procedure ValidateFeilds; + function GetUsePortTransferType: Boolean; + procedure SetUsePortTransferType(const Value: Boolean); + procedure EnableDisableCheckBoxes; + procedure DisplaySampleTexts; + procedure SetDirOutputBackground(const Value: TColor); + procedure SetDirOutputForeground(const Value: TColor); + procedure SetErrorBackground(const Value: TColor); + procedure SetErrorForeground(const Value: TColor); + procedure SetSSLMessageBackground(const Value: TColor); + procedure SetSSLMessageForeground(const Value: TColor); + function GetDirOutputBackground: TColor; + function GetDirOutputForeground: TColor; + function GetErrorBackground: TColor; + function GetErrorForeground: TColor; + function GetSSLMessageBackground: TColor; + function GetSSLMessageForeground: TColor; + function GetDebugBackground: TColor; + function GetDebugForeground: TColor; + procedure SetDebugBackground(const Value: TColor); + procedure SetDebugForeground(const Value: TColor); + { Private declarations } + public + { Public declarations } + property Connected : Boolean read GetConnected write SetConnected; + property UsePortTransferType: Boolean read GetUsePortTransferType + write SetUsePortTransferType; + property ErrorForeground: TColor read GetErrorForeground + write SetErrorForeground; + property ErrorBackground: TColor read GetErrorBackground + write SetErrorBackground; + property SSLMessageForeground: TColor read GetSSLMessageForeground + write SetSSLMessageForeground; + property SSLMessageBackground: TColor read GetSSLMessageBackground + write SetSSLMessageBackground; + property DirOutputForeground: TColor read GetDirOutputForeground + write SetDirOutputForeground; + property DirOutputBackground: TColor read GetDirOutputBackground + write SetDirOutputBackground; + property DebugForeground: TColor read GetDebugForeground + write SetDebugForeground; + property DebugBackground: TColor read GetDebugBackground + write SetDebugBackground; + property NATPortMin : Word read FNATPortMin write FNATPortMin; + property NATPortMax : Word read FNATPortMax write FNATPortMax; + property NATIPAddress : String read FNATIPAddress write FNATIPAddress; + property ProxyPort : Word read FProxyPort write FProxyPort; + property ProxyHost : String read FProxyHost write FProxyHost; + property ProxyUsername : String read FProxyUsername write FProxyUsername; + property ProxyPassword : String read FProxyPassword write FProxyPassword; + property ProxyType : Integer read FProxyType write FProxyType; + + property FTPProxyPort : Word read FFTPProxyPort write FFTPProxyPort; + property FTPProxyHost : String read FFTPProxyHost write FFTPProxyHost; + property FTPProxyUsername : String read FFTPProxyUsername write FFTPProxyUsername; + property FTPProxyPassword : String read FFTPProxyPassword write FFTPProxyPassword; + property FTPProxyType : Integer read FFTPProxyType write FFTPProxyType; + + end; + +var + frmSettings: TfrmSettings; + +implementation + +uses IdSSLOpenSSL, ProgUtils, dlgNATSettings, dlgFTPProxySettings, dlgProxySettings; + +{$R *.dfm} +{ TfrmSettings } + +procedure TfrmSettings.btnFontSelectClick(Sender: TObject); +begin + FontDialog1.Font := redtLog.Font; + if FontDialog1.Execute then + begin + redtLog.Font := FontDialog1.Font; + Self.redtTextSamples.Font := FontDialog1.Font; + Self.DisplaySampleTexts; + end; +end; + +procedure TfrmSettings.cboDirOutputBackgroundChange(Sender: TObject); +begin + FDirOutputBackground := cboDirOutputBackground.Selected; + DisplaySampleTexts; +end; + +procedure TfrmSettings.cboDirOutputForegroundChange(Sender: TObject); +begin + FDirOutputForeground := cboDirOutputForeground.Selected; + DisplaySampleTexts; +end; + +procedure TfrmSettings.cboErrorBackgroundChange(Sender: TObject); +begin + FErrorBackground := cboErrorBackground.Selected; + DisplaySampleTexts; +end; + +procedure TfrmSettings.cboErrorForegroundChange(Sender: TObject); +begin + FErrorForeground := cboErrorForeground.Selected; + DisplaySampleTexts; +end; + +procedure TfrmSettings.cboProxyTypeChange(Sender: TObject); +begin + ValidateFeilds; +end; + +procedure TfrmSettings.cboTLSMessageBackgroundChange(Sender: TObject); +begin + FSSLMessageBackground := cboTLSMessageBackground.Selected; + DisplaySampleTexts; +end; + +procedure TfrmSettings.cboTLSMessageForegroundChange(Sender: TObject); +begin + FSSLMessageForeground := cboTLSMessageForeground.Selected; + DisplaySampleTexts; +end; + +procedure TfrmSettings.chklbAdvancedOptionsClickCheck(Sender: TObject); +begin + EnableDisableCheckBoxes; +end; + +procedure TfrmSettings.btnFTPProxySettingsClick(Sender: TObject); +var Lfrm : TfrmFTPProxySettings; +begin + LFrm := TfrmFTPProxySettings.Create(Application); + try + LFrm.Caption := DlgCaptionToFormCaption(btnFTPProxySettings.Caption); + LFrm.cboProxyType.ItemIndex := FFTPProxyType; + LFrm.edtProxyServerName.Text := FFTPProxyHost; + LFrm.edtProxyServerUserName.Text := FFTPProxyUsername; + LFrm.edtProxyServerPassword.Text := FFTPProxyPassword; + LFrm.spededtProxyPort.Value := FFTPProxyPort; + if LFrm.ShowModal = mrOk then + begin + FFTPProxyType := LFrm.cboProxyType.ItemIndex; + FFTPProxyHost := LFrm.edtProxyServerName.Text; + FFTPProxyUsername := LFrm.edtProxyServerUserName.Text; + FFTPProxyPassword := LFrm.edtProxyServerPassword.Text; + FFTPProxyPort := LFrm.spededtProxyPort.Value; + end; + finally + FreeAndNil(LFrm); + end; +end; + +procedure TfrmSettings.btnNATSettingsClick(Sender: TObject); +var LFrm : TfrmNATSettings; +begin + LFrm := TfrmNATSettings.Create(Application); + try + LFrm.Caption := DlgCaptionToFormCaption(btnNATSettings.Caption); + LFrm.edtExternalIPAddress.Text := FNATIPAddress; + LFrm.spnedtPortMinimum.Value := FNATPortMin; + LFrm.spnedtPortMaximum.Value := FNATPortMax; + if LFrm.ShowModal = mrOk then begin + FNATIPAddress := LFrm.edtExternalIPAddress.Text; + FNATPortMin := LFrm.spnedtPortMinimum.Value; + FNATPortMax := LFrm.spnedtPortMaximum.Value; + end; + finally + FreeAndNil(LFrm); + end; +end; + +procedure TfrmSettings.btnTransparentProxyClick(Sender: TObject); +var LFrm : TfrmProxySettings; +begin + LFrm := TfrmProxySettings.Create(Application); + try + LFrm.Caption := DlgCaptionToFormCaption(btnTransparentProxy.Caption); + LFrm.cboProxyType.ItemIndex := FProxyType; + LFrm.edtProxyServerName.Text := FProxyHost; + LFrm.edtProxyServerUserName.Text := FProxyUsername; + LFrm.edtProxyServerPassword.Text := FProxyPassword; + LFrm.spededtProxyPort.Value := FProxyPort; + if LFrm.ShowModal = mrOk then + begin + FProxyType := LFrm.cboProxyType.ItemIndex; + FProxyHost := LFrm.edtProxyServerName.Text; + FProxyUsername := LFrm.edtProxyServerUserName.Text; + FProxyPassword := LFrm.edtProxyServerPassword.Text; + FProxyPort := LFrm.spededtProxyPort.Value; + end; + finally + FreeAndNil(LFrm); + end; +end; + +procedure TfrmSettings.cboDebugBackgroundSelect(Sender: TObject); +begin + FDebugBackground := cboDebugBackground.Selected; + DisplaySampleTexts; +end; + +procedure TfrmSettings.cboDebugForegroundSelect(Sender: TObject); +begin + FDebugForeground := cboDebugForeground.Selected; + DisplaySampleTexts; +end; + +procedure TfrmSettings.DisplaySampleTexts; +begin + redtTextSamples.Lines.Clear; + redtTextSamples.SelAttributes.Color := FErrorForeground; + cboErrorForeground.Selected := FErrorForeground; + redtTextSamples.SelAttributes.BackColor := FErrorBackground; + cboErrorBackground.Selected := FErrorBackground; + redtTextSamples.Lines.Add('Error Text'); + redtTextSamples.SelAttributes.Color := FSSLMessageForeground; + cboTLSMessageForeground.Selected := FSSLMessageForeground; + redtTextSamples.SelAttributes.BackColor := FSSLMessageBackground; + cboTLSMessageBackground.Selected := FSSLMessageBackground; + redtTextSamples.Lines.Add('SSL Information'); + redtTextSamples.SelAttributes.Color := FDirOutputForeground; + cboDirOutputForeground.Selected := FDirOutputForeground; + redtTextSamples.SelAttributes.BackColor := FDirOutputBackground; + cboDirOutputBackground.Selected := FDirOutputBackground; + redtTextSamples.Lines.Add('Directory List Output'); + redtTextSamples.SelAttributes.Color := FDebugForeground; + redtTextSamples.SelAttributes.BackColor := FDebugBackground; + cboDebugForeground.Selected := FDebugForeground; + cboDebugBackground.Selected := FDebugBackground; + redtTextSamples.Lines.Add('Debug Output'); + ScrollToTop(redtTextSamples); +end; + +procedure TfrmSettings.edtExternalIPAddressChange(Sender: TObject); +begin + ValidateFeilds; +end; + +procedure TfrmSettings.edtProxyServerNameChange(Sender: TObject); +begin + ValidateFeilds; +end; + +procedure TfrmSettings.EnableDisableCheckBoxes; +begin + if chklbAdvancedOptions.Checked[1] = False then + begin + chklbAdvancedOptions.ItemEnabled[2] := False; + end + else + begin + chklbAdvancedOptions.ItemEnabled[2] := True; + end; +end; + +procedure TfrmSettings.FormCreate(Sender: TObject); +begin + redtLog.Lines.Clear; + redtLog.Lines.Add('Operating System: ' + TOSVersion.ToString); + redtLog.Lines.Add(' RTL Version: ' + IntToStr(Hi(GetRTLVersion)) + '.' + + IntToStr(Lo(GetRTLVersion))); +{$IFDEF WIN64} + redtLog.Lines.Add(' Compiled For: Win64'); +{$ELSE} + redtLog.Lines.Add(' Compiled For: Win32'); +{$ENDIF} + redtLog.Lines.Add(' OpenSSL Version: ' + IdSSLOpenSSL.OpenSSLVersion); + ScrollToEnd(redtLog); + chklbAdvancedOptions.ItemEnabled[2] := False; + DisplaySampleTexts; +end; + +procedure TfrmSettings.FormShow(Sender: TObject); +begin + EnableDisableCheckBoxes; + ValidateFeilds; +end; + +function TfrmSettings.GetConnected: Boolean; +begin + Result := not cboTransferTypes.Enabled; +end; + +function TfrmSettings.GetDebugBackground: TColor; +begin + Result := cboDebugBackground.Selected; +end; + +function TfrmSettings.GetDebugForeground: TColor; +begin + Result := cboDebugForeground.Selected; +end; + +function TfrmSettings.GetDirOutputBackground: TColor; +begin + Result := cboDirOutputBackground.Selected; +end; + +function TfrmSettings.GetDirOutputForeground: TColor; +begin + Result := cboDirOutputForeground.Selected; +end; + +function TfrmSettings.GetErrorBackground: TColor; +begin + Result := cboErrorBackground.Selected; +end; + +function TfrmSettings.GetErrorForeground: TColor; +begin + Result := cboErrorForeground.Selected; +end; + +function TfrmSettings.GetSSLMessageBackground: TColor; +begin + Result := cboTLSMessageBackground.Selected; +end; + +function TfrmSettings.GetSSLMessageForeground: TColor; +begin + Result := cboTLSMessageForeground.Selected; +end; + +function TfrmSettings.GetUsePortTransferType: Boolean; +begin + Result := cboTransferTypes.ItemIndex = 1; +end; + +procedure TfrmSettings.SetConnected(const Value: Boolean); +begin + cboTransferTypes.Enabled := not Value; + lblTransferType.Enabled := not Value; + chklbAdvancedOptions.Enabled := not Value; + lblAdvancedOptions.Enabled := not Value; + btnNATSettings.Enabled := not Value; + btnTransparentProxy.Enabled := not Value; + btnFTPProxySettings.Enabled := not Value; +end; + +procedure TfrmSettings.SetDebugBackground(const Value: TColor); +begin + Self.FDebugBackground := Value; + DisplaySampleTexts; +end; + +procedure TfrmSettings.SetDebugForeground(const Value: TColor); +begin + FDebugForeground := Value; + DisplaySampleTexts; +end; + +procedure TfrmSettings.SetDirOutputBackground(const Value: TColor); +begin + FDirOutputBackground := Value; + DisplaySampleTexts; +end; + +procedure TfrmSettings.SetDirOutputForeground(const Value: TColor); +begin + FDirOutputForeground := Value; + DisplaySampleTexts; +end; + +procedure TfrmSettings.SetErrorBackground(const Value: TColor); +begin + FErrorBackground := Value; + DisplaySampleTexts; +end; + +procedure TfrmSettings.SetErrorForeground(const Value: TColor); +begin + FErrorForeground := Value; + DisplaySampleTexts; +end; + +procedure TfrmSettings.SetSSLMessageBackground(const Value: TColor); +begin + FSSLMessageBackground := Value; + DisplaySampleTexts; +end; + +procedure TfrmSettings.SetSSLMessageForeground(const Value: TColor); +begin + FSSLMessageForeground := Value; + DisplaySampleTexts; +end; + +procedure TfrmSettings.SetUsePortTransferType(const Value: Boolean); +begin + if Value then + begin + cboTransferTypes.ItemIndex := 1; + end + else + begin + cboTransferTypes.ItemIndex := 0; + end; +end; + +procedure TfrmSettings.spnedtPortMaxChange(Sender: TObject); +begin + ValidateFeilds; +end; + +procedure TfrmSettings.spnedtPortMinimumChange(Sender: TObject); +begin + ValidateFeilds; +end; + +procedure TfrmSettings.ValidateFeilds; +begin + +end; + +end.